diff --git a/asm/battle_814AEAC.s b/asm/battle_814AEAC.s new file mode 100644 index 000000000..e6c77e04d --- /dev/null +++ b/asm/battle_814AEAC.s @@ -0,0 +1,5647 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start nullsub_112 +nullsub_112: @ 814AEAC + bx lr + thumb_func_end nullsub_112 + + thumb_func_start sub_814AEB0 +sub_814AEB0: @ 814AEB0 + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_exec_buffer_A_ch0_tbl4 + str r1, [r0] + bx lr + .pool + thumb_func_end sub_814AEB0 + + thumb_func_start bx_exec_buffer_A_ch0_tbl4 +bx_exec_buffer_A_ch0_tbl4: @ 814AECC + push {lr} + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldr r0, =0x02024064 + ldrb r3, [r0] + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0814AF18 + ldr r0, =0x02023064 + lsls r1, r3, 9 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x38 + bhi _0814AF14 + ldr r0, =gUnknown_085C9A94 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + b _0814AF18 + .pool +_0814AF14: + bl dp01_tbl4_exec_completed +_0814AF18: + pop {r0} + bx r0 + thumb_func_end bx_exec_buffer_A_ch0_tbl4 + + thumb_func_start sub_814AF1C +sub_814AF1C: @ 814AF1C + push {lr} + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + 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, =DummyObjectCallback + cmp r1, r0 + bne _0814AF40 + bl dp01_tbl4_exec_completed +_0814AF40: + pop {r0} + bx r0 + .pool + thumb_func_end sub_814AF1C + + thumb_func_start sub_814AF54 +sub_814AF54: @ 814AF54 + push {r4-r6,lr} + ldr r6, =0x02020630 + ldr r5, =0x020241e4 + ldr r4, =0x02024064 + 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, =DummyObjectCallback + cmp r1, r0 + bne _0814AFA4 + 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 obj_free_rotscale_entry + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl RemoveObjectAndFreeTiles + bl dp01_tbl4_exec_completed +_0814AFA4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814AF54 + + thumb_func_start sub_814AFBC +sub_814AFBC: @ 814AFBC + push {r4,lr} + ldr r4, =0x020244d0 + ldr r1, [r4] + ldr r3, =0x02024064 + 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 _0814AFF4 + 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 dp01_tbl4_exec_completed +_0814AFF4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814AFBC + + thumb_func_start sub_814B004 +sub_814B004: @ 814B004 + push {r4-r6,lr} + movs r6, 0 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0814B028 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0814B05C + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0814B05C +_0814B028: + ldr r2, =0x02020630 + ldr r1, =0x03005d70 + ldr r0, =0x02024064 + 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, =DummyObjectCallback + cmp r1, r0 + bne _0814B094 + b _0814B092 + .pool +_0814B05C: + ldr r2, =0x02020630 + ldr r5, =0x03005d70 + ldr r0, =0x02024064 + ldrb r3, [r0] + adds r0, r3, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r2, 0 + adds r4, 0x1C + adds r0, r4 + ldr r2, [r0] + ldr r0, =DummyObjectCallback + cmp r2, r0 + bne _0814B094 + 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, r4 + ldr r0, [r0] + cmp r0, r2 + bne _0814B094 +_0814B092: + movs r6, 0x1 +_0814B094: + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + beq _0814B0A0 + movs r6, 0 +_0814B0A0: + cmp r6, 0 + beq _0814B0C6 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r3, =0x02024064 + 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, =0x03005d60 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_814AFBC + str r1, [r0] +_0814B0C6: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814B004 + + thumb_func_start sub_814B0E8 +sub_814B0E8: @ 814B0E8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x020244d0 + mov r12, r0 + ldr r0, [r0] + ldr r7, =0x02024064 + 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 + beq _0814B114 + b _0814B252 +_0814B114: + movs r1, 0x2 + mov r8, r1 + adds r1, r2, 0 + mov r0, r8 + eors r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0] + adds r0, r5, 0 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + beq _0814B136 + b _0814B252 +_0814B136: + ldr r1, =0x02020630 + mov r10, r1 + ldr r0, =0x03005d7c + mov r9, r0 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + mov r5, r10 + adds r5, 0x1C + adds r0, r5 + ldr r3, [r0] + ldr r0, =DummyObjectCallback + cmp r3, r0 + bne _0814B252 + ldr r0, =0x020241e4 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r0, [r0] + cmp r0, r3 + bne _0814B252 + ldrb r0, [r4, 0x9] + adds r0, 0x1 + strb r0, [r4, 0x9] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0814B252 + mov r1, r12 + ldr r0, [r1] + ldrb r1, [r7] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r6, [r0, 0x9] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0814B1F0 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0814B1F0 + ldrb r0, [r7] + mov r1, r8 + eors r0, r1 + add r0, r9 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + bl RemoveObjectAndFreeTiles + ldr r4, =0x03005d70 + ldrb r0, [r7] + mov r1, r8 + eors r1, r0 + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + ldrb r0, [r7] + mov r1, r8 + eors r0, r1 + bl sub_8076918 + ldrb r0, [r7] + mov r1, r8 + eors r0, r1 + adds r0, r4 + ldrb r0, [r0] + bl sub_80729D0 +_0814B1F0: + ldr r1, =0x03005d7c + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + ldr r5, =0x03005d70 + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + 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 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r2, [r0, 0x8] + ldrb r1, [r2, 0x9] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x9] + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_814B004 + str r1, [r0] +_0814B252: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814B0E8 + + thumb_func_start sub_814B290 +sub_814B290: @ 814B290 + push {lr} + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + 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 _0814B2BE + movs r2, 0x24 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0814B2BE + bl dp01_tbl4_exec_completed +_0814B2BE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_814B290 + + thumb_func_start bx_t4_healthbar_update +bx_t4_healthbar_update: @ 814B2D0 + push {r4-r6,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + ldr r6, =0x03005d70 + 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 _0814B318 + ldrb r0, [r5] + adds r0, r6 + ldrb r0, [r0] + movs r2, 0 + bl heathbar_draw_hp + b _0814B332 + .pool +_0814B318: + ldr r2, =0x0202406e + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + adds r0, r2 + bl sub_805E990 + bl dp01_tbl4_exec_completed +_0814B332: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bx_t4_healthbar_update + + thumb_func_start sub_814B340 +sub_814B340: @ 814B340 + push {r4-r6,lr} + ldr r6, =0x02020630 + ldr r5, =0x020241e4 + ldr r4, =0x02024064 + 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 _0814B3BC + ldr r1, =0x0202406e + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + 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 rotscale_free_entry + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl RemoveObjectAndFreeTiles + ldr r1, =0x03005d70 + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl4_exec_completed +_0814B3BC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814B340 + + thumb_func_start sub_814B3DC +sub_814B3DC: @ 814B3DC + push {r4-r6,lr} + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r6, =0x02024064 + 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 _0814B430 + ldr r5, =0x020241e4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r1, =0x03005d70 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl4_exec_completed +_0814B430: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814B3DC + + thumb_func_start bx_t4_button_a +bx_t4_button_a: @ 814B44C + push {lr} + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _0814B45E + bl dp01_tbl4_exec_completed +_0814B45E: + pop {r0} + bx r0 + thumb_func_end bx_t4_button_a + + thumb_func_start dp01t_0F_4_move_anim +dp01t_0F_4_move_anim: @ 814B464 + push {r4,lr} + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + ldr r2, =0x02020630 + 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 _0814B4B0 + 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, =0x020244b9 + strb r3, [r0] + bl dp01_tbl4_exec_completed + b _0814B4DA + .pool +_0814B4B0: + ldrh r0, [r4, 0x30] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0814B4D4 + 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] +_0814B4D4: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] +_0814B4DA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end dp01t_0F_4_move_anim + + thumb_func_start sub_814B4E0 +sub_814B4E0: @ 814B4E0 + push {r4,lr} + ldr r2, =0x02020630 + ldr r0, =0x03005d70 + ldr r4, =0x02024064 + 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, =DummyObjectCallback + cmp r1, r0 + bne _0814B532 + adds r0, r3, 0 + bl sub_805E408 + ldr r0, =0x020244d0 + 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 _0814B526 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x6 + bl move_anim_start_t4 +_0814B526: + ldr r0, =0x03005d60 + ldrb r1, [r4] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_814B554 + str r0, [r1] +_0814B532: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814B4E0 + + thumb_func_start sub_814B554 +sub_814B554: @ 814B554 + push {lr} + ldr r0, =0x020244d0 + ldr r1, [r0] + ldr r0, =0x02024064 + 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 _0814B590 + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + 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, =DummyObjectCallback + cmp r1, r0 + bne _0814B590 + bl dp01_tbl4_exec_completed +_0814B590: + pop {r0} + bx r0 + .pool + thumb_func_end sub_814B554 + + thumb_func_start sub_814B5A8 +sub_814B5A8: @ 814B5A8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r3, =0x020244d0 + ldr r0, [r3] + ldr r7, =0x02024064 + 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 _0814B664 + 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 FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + ldr r0, =c3_0802FDF4 + movs r1, 0xA + bl CreateTask + ldr r0, =0x0202406e + mov r8, r0 + ldrb r1, [r7] + lsls r0, r1, 1 + add r0, r8 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + bl sub_805E990 + ldr r1, =0x020241e4 + ldrb r0, [r7] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0 + bl StartObjectImageAnim + ldr r4, =0x03005d70 + 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, =0x03005d60 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_814B4E0 + str r1, [r0] +_0814B664: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814B5A8 + + thumb_func_start sub_814B69C +sub_814B69C: @ 814B69C + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r0, [r6] + ldr r4, =0x02024064 + 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 _0814B6CE + ldr r0, =0x0202406e + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_0814B6CE: + ldr r5, =0x02020630 + ldr r0, =0x03005d7c + 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, =DummyObjectCallback + cmp r1, r0 + bne _0814B714 + 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 _0814B714 + adds r0, r3, r5 + bl RemoveObjectAndFreeTiles + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_814B5A8 + str r1, [r0] +_0814B714: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814B69C + + thumb_func_start dp01_tbl4_exec_completed +dp01_tbl4_exec_completed: @ 814B740 + push {r4,lr} + sub sp, 0x4 + ldr r1, =0x03005d60 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_exec_buffer_A_ch0_tbl4 + str r1, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0814B794 + bl link_get_multiplayer_id + mov r1, sp + strb r0, [r1] + movs r0, 0x2 + movs r1, 0x4 + mov r2, sp + bl dp01_prepare_buffer_wireless_probably + ldr r1, =0x02023064 + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _0814B7A6 + .pool +_0814B794: + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, [r2] + bics r0, r1 + str r0, [r2] +_0814B7A6: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_tbl4_exec_completed + + thumb_func_start sub_814B7B8 +sub_814B7B8: @ 814B7B8 + push {lr} + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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 _0814B7DA + bl dp01_tbl4_exec_completed +_0814B7DA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_814B7B8 + + thumb_func_start sub_814B7E8 +sub_814B7E8: @ 814B7E8 + push {lr} + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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 _0814B80A + bl dp01_tbl4_exec_completed +_0814B80A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_814B7E8 + + thumb_func_start dp01t_00_4_getattr +dp01t_00_4_getattr: @ 814B818 + push {r4-r6,lr} + sub sp, 0x100 + movs r6, 0 + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _0814B850 + ldr r0, =0x0202406e + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + mov r1, sp + bl dp01_getattr_by_ch1_for_player_pokemon__ + adds r6, r0, 0 + b _0814B872 + .pool +_0814B850: + ldrb r4, [r1] + movs r5, 0 +_0814B854: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0814B86A + lsls r0, r5, 24 + lsrs r0, 24 + mov r2, sp + adds r1, r2, r6 + bl dp01_getattr_by_ch1_for_player_pokemon__ + adds r6, r0 +_0814B86A: + lsrs r4, 1 + adds r5, 0x1 + cmp r5, 0x5 + ble _0814B854 +_0814B872: + lsls r1, r6, 16 + lsrs r1, 16 + movs r0, 0x1 + mov r2, sp + bl dp01_build_cmdbuf_x1D_1D_numargs_varargs + bl dp01_tbl4_exec_completed + add sp, 0x100 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end dp01t_00_4_getattr + + thumb_func_start dp01_getattr_by_ch1_for_player_pokemon__ +dp01_getattr_by_ch1_for_player_pokemon__: @ 814B88C + 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, =0x02023064 + ldr r3, =0x02024064 + ldrb r0, [r3] + lsls r0, 9 + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3B + bls _0814B8B6 + bl _0814C022 +_0814B8B6: + lsls r0, 2 + ldr r1, =_0814B8CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0814B8CC: + .4byte _0814B9BC + .4byte _0814BBE0 + .4byte _0814BBF0 + .4byte _0814BC00 + .4byte _0814BC68 + .4byte _0814BC68 + .4byte _0814BC68 + .4byte _0814BC68 + .4byte _0814BC84 + .4byte _0814BCC0 + .4byte _0814BCC0 + .4byte _0814BCC0 + .4byte _0814BCC0 + .4byte _0814C022 + .4byte _0814C022 + .4byte _0814C022 + .4byte _0814C022 + .4byte _0814BCDC + .4byte _0814BCEC + .4byte _0814BD1C + .4byte _0814BD2C + .4byte _0814BD3C + .4byte _0814BD4C + .4byte _0814BD5C + .4byte _0814BD6C + .4byte _0814BD7C + .4byte _0814BD8C + .4byte _0814BD9C + .4byte _0814BDAC + .4byte _0814BDBC + .4byte _0814BDCC + .4byte _0814BDDC + .4byte _0814BE2C + .4byte _0814BE3C + .4byte _0814BE4C + .4byte _0814BE5C + .4byte _0814BE6C + .4byte _0814BE7C + .4byte _0814BE8C + .4byte _0814BE9C + .4byte _0814BEAC + .4byte _0814BEE0 + .4byte _0814BEF0 + .4byte _0814BF00 + .4byte _0814BF10 + .4byte _0814BF20 + .4byte _0814BF30 + .4byte _0814BF40 + .4byte _0814BF50 + .4byte _0814BF70 + .4byte _0814BF80 + .4byte _0814BF90 + .4byte _0814BFA0 + .4byte _0814BFB0 + .4byte _0814BFC0 + .4byte _0814BFD0 + .4byte _0814BFE0 + .4byte _0814BFF0 + .4byte _0814C000 + .4byte _0814C010 +_0814B9BC: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + mov r1, sp + strh r0, [r1] + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + 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 +_0814BA08: + adds r1, r6, 0 + adds r1, 0xD + mov r0, r8 + bl pokemon_getattr + strh r0, [r4] + adds r1, r6, 0 + adds r1, 0x11 + mov r0, r8 + bl pokemon_getattr + mov r2, r9 + adds r1, r2, r6 + strb r0, [r1] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _0814BA08 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r10 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + ldr r2, [sp, 0x80] + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x19 + bl pokemon_getattr + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + str r0, [sp, 0x48] + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + str r0, [sp, 0x4C] + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + ldr r1, [sp, 0x7C] + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x28] + adds r0, r4, 0 + movs r1, 0x3A + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2C] + adds r0, r4, 0 + movs r1, 0x3B + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2] + adds r0, r4, 0 + movs r1, 0x3C + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x4] + adds r0, r4, 0 + movs r1, 0x3D + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x6] + adds r0, r4, 0 + movs r1, 0x3E + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x8] + adds r0, r4, 0 + movs r1, 0x3F + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0xA] + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + str r0, [sp, 0x54] + adds r0, r4, 0 + movs r1, 0x2 + ldr r2, [sp, 0x8C] + bl pokemon_getattr + ldr r0, [sp, 0x84] + ldr r1, [sp, 0x8C] + bl CopyString_Limit10 + adds r0, r4, 0 + movs r1, 0x7 + ldr r2, [sp, 0x88] + bl pokemon_getattr + mov r2, sp + movs r6, 0 +_0814BBC0: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0x57 + bls _0814BBC0 + b _0814C022 + .pool +_0814BBE0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + b _0814BF5A + .pool +_0814BBF0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xC + b _0814BF5A + .pool +_0814BC00: + 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, =0x020244ec + adds r4, r1, r0 + mov r8, r9 +_0814BC16: + adds r1, r6, 0 + adds r1, 0xD + adds r0, r4, 0 + bl pokemon_getattr + mov r1, r8 + strh r0, [r1] + adds r1, r6, 0 + adds r1, 0x11 + adds r0, r4, 0 + bl pokemon_getattr + mov r2, r10 + adds r1, r2, r6 + strb r0, [r1] + movs r0, 0x2 + add r8, r0 + adds r6, 0x1 + cmp r6, 0x3 + ble _0814BC16 + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r9 + strb r0, [r1, 0xC] + mov r2, r9 + movs r6, 0 +_0814BC54: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0xF + bls _0814BC54 + b _0814C022 + .pool +_0814BC68: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x9 + b _0814BF5A + .pool +_0814BC84: + movs r6, 0 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r2, =0x020244ec + mov r8, r2 +_0814BC90: + adds r1, r6, 0 + adds r1, 0x11 + mov r2, r8 + adds r0, r4, r2 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + cmp r6, 0x3 + ble _0814BC90 + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + b _0814C022 + .pool +_0814BCC0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x8 + b _0814C01A + .pool +_0814BCDC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1 + b _0814BCF6 + .pool +_0814BCEC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x19 +_0814BCF6: + bl pokemon_getattr + 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 _0814C022 + .pool +_0814BD1C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1A + b _0814C01A + .pool +_0814BD2C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1B + b _0814C01A + .pool +_0814BD3C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1C + b _0814C01A + .pool +_0814BD4C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1D + b _0814C01A + .pool +_0814BD5C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1E + b _0814C01A + .pool +_0814BD6C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1F + b _0814C01A + .pool +_0814BD7C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x20 + b _0814C01A + .pool +_0814BD8C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x22 + b _0814C01A + .pool +_0814BD9C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x23 + b _0814C01A + .pool +_0814BDAC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x24 + b _0814C01A + .pool +_0814BDBC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x25 + b _0814C01A + .pool +_0814BDCC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x26 + b _0814C01A + .pool +_0814BDDC: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_getattr + strb r0, [r7] + adds r0, r4, 0 + movs r1, 0x28 + bl pokemon_getattr + strb r0, [r7, 0x1] + adds r0, r4, 0 + movs r1, 0x29 + bl pokemon_getattr + strb r0, [r7, 0x2] + adds r0, r4, 0 + movs r1, 0x2A + bl pokemon_getattr + strb r0, [r7, 0x3] + adds r0, r4, 0 + movs r1, 0x2B + bl pokemon_getattr + strb r0, [r7, 0x4] + adds r0, r4, 0 + movs r1, 0x2C + bl pokemon_getattr + strb r0, [r7, 0x5] + movs r6, 0x6 + b _0814C022 + .pool +_0814BE2C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x27 + b _0814C01A + .pool +_0814BE3C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x28 + b _0814C01A + .pool +_0814BE4C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x29 + b _0814C01A + .pool +_0814BE5C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2A + b _0814C01A + .pool +_0814BE6C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2B + b _0814C01A + .pool +_0814BE7C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2C + b _0814C01A + .pool +_0814BE8C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0 + b _0814BEB6 + .pool +_0814BE9C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x9 + b _0814BF5A + .pool +_0814BEAC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x37 +_0814BEB6: + bl pokemon_getattr + 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 _0814C022 + .pool +_0814BEE0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x38 + b _0814C01A + .pool +_0814BEF0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x39 + b _0814BF5A + .pool +_0814BF00: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3A + b _0814BF5A + .pool +_0814BF10: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3B + b _0814BF5A + .pool +_0814BF20: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3C + b _0814BF5A + .pool +_0814BF30: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3D + b _0814BF5A + .pool +_0814BF40: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3E + b _0814BF5A + .pool +_0814BF50: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3F +_0814BF5A: + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + strb r0, [r7] + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r6, 0x2 + b _0814C022 + .pool +_0814BF70: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x16 + b _0814C01A + .pool +_0814BF80: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x17 + b _0814C01A + .pool +_0814BF90: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x18 + b _0814C01A + .pool +_0814BFA0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x21 + b _0814C01A + .pool +_0814BFB0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2F + b _0814C01A + .pool +_0814BFC0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x30 + b _0814C01A + .pool +_0814BFD0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x32 + b _0814C01A + .pool +_0814BFE0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x33 + b _0814C01A + .pool +_0814BFF0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x34 + b _0814C01A + .pool +_0814C000: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x35 + b _0814C01A + .pool +_0814C010: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x36 +_0814C01A: + bl pokemon_getattr + strb r0, [r7] + movs r6, 0x1 +_0814C022: + 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 dp01_getattr_by_ch1_for_player_pokemon__ + + thumb_func_start sub_814C038 +sub_814C038: @ 814C038 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814C038 + + thumb_func_start sub_814C044 +sub_814C044: @ 814C044 + push {r4,r5,lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _0814C074 + ldr r0, =0x0202406e + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + bl sub_814C09C + b _0814C092 + .pool +_0814C074: + ldrb r4, [r1] + movs r5, 0 +_0814C078: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0814C086 + adds r0, r5, 0 + bl sub_814C09C +_0814C086: + lsrs r4, 1 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _0814C078 +_0814C092: + bl dp01_tbl4_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_814C044 + + thumb_func_start sub_814C09C +sub_814C09C: @ 814C09C + 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, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + ldr r2, =0x02023067 + 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 _0814C0C8 + bl _0814CA62 +_0814C0C8: + lsls r0, 2 + ldr r1, =_0814C0E0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0814C0E0: + .4byte _0814C1D0 + .4byte _0814C368 + .4byte _0814C388 + .4byte _0814C3A8 + .4byte _0814C400 + .4byte _0814C400 + .4byte _0814C400 + .4byte _0814C400 + .4byte _0814C428 + .4byte _0814C48C + .4byte _0814C48C + .4byte _0814C48C + .4byte _0814C48C + .4byte _0814CA62 + .4byte _0814CA62 + .4byte _0814CA62 + .4byte _0814CA62 + .4byte _0814C4BC + .4byte _0814C4DC + .4byte _0814C4FC + .4byte _0814C51C + .4byte _0814C53C + .4byte _0814C55C + .4byte _0814C57C + .4byte _0814C59C + .4byte _0814C5BC + .4byte _0814C5DC + .4byte _0814C5FC + .4byte _0814C61C + .4byte _0814C63C + .4byte _0814C65C + .4byte _0814C67C + .4byte _0814C6EC + .4byte _0814C70C + .4byte _0814C72C + .4byte _0814C74C + .4byte _0814C76C + .4byte _0814C78C + .4byte _0814C7AC + .4byte _0814C7CC + .4byte _0814C7EC + .4byte _0814C80C + .4byte _0814C82C + .4byte _0814C84C + .4byte _0814C86C + .4byte _0814C88C + .4byte _0814C8AC + .4byte _0814C8CC + .4byte _0814C8EC + .4byte _0814C90C + .4byte _0814C92C + .4byte _0814C94C + .4byte _0814C96C + .4byte _0814C98C + .4byte _0814C9AC + .4byte _0814C9CC + .4byte _0814C9EC + .4byte _0814CA0C + .4byte _0814CA2C + .4byte _0814CA4C +_0814C1D0: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + adds r2, r6, 0 + bl pokemon_setattr + adds r2, r6, 0 + adds r2, 0x2E + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + 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 +_0814C236: + mov r1, r8 + adds r1, 0xD + mov r0, r9 + adds r2, r4, 0 + bl pokemon_setattr + mov r1, r8 + adds r1, 0x11 + mov r0, r9 + adds r2, r7, 0 + bl pokemon_setattr + adds r7, 0x1 + adds r4, 0x2 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x3 + ble _0814C236 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + mov r2, r10 + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x20 + ldr r2, [sp, 0x20] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x19 + ldr r2, [sp, 0x28] + bl pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + adds r0, r4, 0 + movs r1, 0 + ldr r2, [sp, 0x2C] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x37 + ldr r2, [sp, 0x30] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x38 + ldr r2, [sp, 0x1C] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x39 + ldr r2, [sp, 0x18] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3A + ldr r2, [sp, 0x24] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3B + ldr r2, [sp, 0x4] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3C + ldr r2, [sp, 0x8] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3D + ldr r2, [sp, 0xC] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3E + ldr r2, [sp, 0x10] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3F + ldr r2, [sp, 0x14] + bl pokemon_setattr + b _0814CA62 + .pool +_0814C368: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xB + bl pokemon_setattr + b _0814CA62 + .pool +_0814C388: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xC + bl pokemon_setattr + b _0814CA62 + .pool +_0814C3A8: + 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, =0x020244ec + adds r7, r1, r0 + adds r6, r3, 0 + adds r6, 0x8 + adds r4, r3, 0 +_0814C3C2: + mov r1, r8 + adds r1, 0xD + adds r0, r7, 0 + adds r2, r4, 0 + bl pokemon_setattr + mov r1, r8 + adds r1, 0x11 + adds r0, r7, 0 + adds r2, r6, 0 + bl pokemon_setattr + adds r6, 0x1 + adds r4, 0x2 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x3 + ble _0814C3C2 + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x15 + mov r2, r9 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C400: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r3, =0x02023064 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x9 + b _0814C4A4 + .pool +_0814C428: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + ldr r5, =0x02024064 + ldrb r2, [r5] + lsls r2, 9 + adds r2, r7 + adds r0, r4, 0 + movs r1, 0x11 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x12 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x2 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x13 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x3 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x14 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x4 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x15 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C48C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r3, =0x02023064 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x8 +_0814C4A4: + adds r3, 0x3 + adds r2, r3 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C4BC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C4DC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x19 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C4FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1A + bl pokemon_setattr + b _0814CA62 + .pool +_0814C51C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1B + bl pokemon_setattr + b _0814CA62 + .pool +_0814C53C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1C + bl pokemon_setattr + b _0814CA62 + .pool +_0814C55C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1D + bl pokemon_setattr + b _0814CA62 + .pool +_0814C57C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1E + bl pokemon_setattr + b _0814CA62 + .pool +_0814C59C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1F + bl pokemon_setattr + b _0814CA62 + .pool +_0814C5BC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x20 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C5DC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x22 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C5FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x23 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C61C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x24 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C63C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x25 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C65C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x26 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C67C: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + ldr r5, =0x02024064 + ldrb r2, [r5] + lsls r2, 9 + adds r2, r7 + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x28 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x2 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x29 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x3 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2A + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x4 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2B + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x5 + adds r2, r0 + adds r0, r4, 0 + b _0814C79C + .pool +_0814C6EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x27 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C70C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x28 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C72C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x29 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C74C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2A + bl pokemon_setattr + b _0814CA62 + .pool +_0814C76C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2B + bl pokemon_setattr + b _0814CA62 + .pool +_0814C78C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 +_0814C79C: + movs r1, 0x2C + bl pokemon_setattr + b _0814CA62 + .pool +_0814C7AC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C7CC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x9 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C7EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x37 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C80C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x38 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C82C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x39 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C84C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3A + bl pokemon_setattr + b _0814CA62 + .pool +_0814C86C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3B + bl pokemon_setattr + b _0814CA62 + .pool +_0814C88C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3C + bl pokemon_setattr + b _0814CA62 + .pool +_0814C8AC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3D + bl pokemon_setattr + b _0814CA62 + .pool +_0814C8CC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3E + bl pokemon_setattr + b _0814CA62 + .pool +_0814C8EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3F + bl pokemon_setattr + b _0814CA62 + .pool +_0814C90C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x16 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C92C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x17 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C94C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x18 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C96C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x21 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C98C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2F + bl pokemon_setattr + b _0814CA62 + .pool +_0814C9AC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x30 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C9CC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x32 + bl pokemon_setattr + b _0814CA62 + .pool +_0814C9EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x33 + bl pokemon_setattr + b _0814CA62 + .pool +_0814CA0C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x34 + bl pokemon_setattr + b _0814CA62 + .pool +_0814CA2C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x35 + bl pokemon_setattr + b _0814CA62 + .pool +_0814CA4C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x36 + bl pokemon_setattr +_0814CA62: + ldr r2, =0x0202406e + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + 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_814C09C + + thumb_func_start sub_814CA98 +sub_814CA98: @ 814CA98 + push {r4-r7,lr} + ldr r1, =0x0202406e + ldr r7, =0x02024064 + 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, =0x02023064 + lsls r2, 9 + adds r0, r4, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + ldr r1, =0x020244ec + adds r0, r1 + adds r5, r3, r0 + movs r3, 0 + adds r0, r4, 0x2 + adds r2, r0 + ldrb r2, [r2] + cmp r3, r2 + bcs _0814CAF0 + adds r6, r4, 0 + adds r2, r7, 0 + adds r4, r0, 0 +_0814CACE: + 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 _0814CACE +_0814CAF0: + bl dp01_tbl4_exec_completed + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814CA98 + + thumb_func_start sub_814CB0C +sub_814CB0C: @ 814CB0C + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =0x0202406e + mov r8, r0 + ldr r6, =0x02024064 + ldrb r1, [r6] + lsls r0, r1, 1 + add r0, r8 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + 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 pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r6] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_806A068 + ldr r0, =0x0202499c + 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 AddObjectToFront + ldr r4, =0x020241e4 + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r5, =0x02020630 + 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, =0x020244e4 + adds r2, r1 + ldrb r1, [r2] + bl StartObjectImageAnim + ldr r1, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_814B290 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814CB0C + + thumb_func_start sub_814CC28 +sub_814CC28: @ 814CC28 + push {r4-r6,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + ldr r4, =0x02023064 + lsls r1, r0, 9 + adds r6, r4, 0x2 + adds r1, r6 + ldrb r1, [r1] + bl sub_805EF84 + ldr r2, =0x0202406e + 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, =0x020244ec + adds r0, r2 + bl sub_805DD7C + ldrb r0, [r5] + lsls r1, r0, 9 + adds r1, r6 + ldrb r1, [r1] + bl sub_814CC98 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_814B69C + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814CC28 + + thumb_func_start sub_814CC98 +sub_814CC98: @ 814CC98 + 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, =0x0202406e + lsls r2, r6, 1 + adds r2, r0 + ldr r0, =0x02023064 + 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, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, =sub_805D714 + bl object_new_hidden_with_callback + ldr r1, =0x03005d7c + mov r9, r1 + add r9, r6 + mov r1, r9 + strb r0, [r1] + adds r0, r6, 0 + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl sub_806A068 + ldr r0, =0x0202499c + 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 AddObjectToFront + ldr r4, =0x020241e4 + adds r4, r6, r4 + strb r0, [r4] + ldr r5, =0x02020630 + 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, =0x020244e4 + adds r6, r1 + ldrb r1, [r6] + bl StartObjectImageAnim + 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, =DummyObjectCallback + 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_814CC98 + + thumb_func_start sub_814CE14 +sub_814CE14: @ 814CE14 + push {r4-r6,lr} + ldr r1, =0x02023064 + ldr r6, =0x02024064 + ldrb r2, [r6] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r3, [r0] + cmp r3, 0 + bne _0814CE5C + ldr r0, =0x020244d0 + 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, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_814CEA4 + str r1, [r0] + b _0814CE92 + .pool +_0814CE5C: + ldr r5, =0x020241e4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r1, =0x03005d70 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl4_exec_completed +_0814CE92: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814CE14 + + thumb_func_start sub_814CEA4 +sub_814CEA4: @ 814CEA4 + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r4, [r6] + ldr r5, =0x02024064 + 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 _0814CECC + cmp r0, 0x1 + beq _0814CEFA + b _0814CF22 + .pool +_0814CECC: + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0814CEE6 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_0814CEE6: + 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 _0814CF22 +_0814CEFA: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0814CF22 + 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, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_814B3DC + str r1, [r0] +_0814CF22: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814CEA4 + + thumb_func_start sub_814CF30 +sub_814CF30: @ 814CF30 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0814CF60 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_get_per_side_status + movs r1, 0x2 + ands r1, r0 + movs r7, 0x20 + cmp r1, 0 + beq _0814CF62 + movs r7, 0x5A + b _0814CF62 + .pool +_0814CF60: + movs r7, 0x50 +_0814CF62: + ldr r5, =0x02024064 + ldrb r0, [r5] + bl sub_806D864 + ldr r6, =0x020229e8 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + movs r4, 0xFF + ldrb r0, [r1] + cmp r0, 0x4 + beq _0814CF94 + ldrb r0, [r5] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r1, [r1] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x5 + bne _0814CFB0 +_0814CF94: + ldrb r0, [r5] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1, 0x13] + adds r4, r0, 0x2 + b _0814D002 + .pool +_0814CFB0: + ldrb r0, [r5] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r1, [r1] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x2 + beq _0814CFDE + ldrb r0, [r5] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r0, [r1] + ands r4, r0 + cmp r4, 0x1 + bne _0814CFF2 +_0814CFDE: + ldrb r0, [r5] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1, 0x13] + adds r4, r0, 0x4 + b _0814D002 +_0814CFF2: + ldrb r0, [r5] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r4, [r1, 0x13] +_0814D002: + ldr r5, =0x02024064 + ldrb r1, [r5] + adds r0, r4, 0 + bl sub_805DF84 + ldrb r0, [r5] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl template_build_for_pokemon_or_trainer + ldr r6, =0x0202499c + mov r8, r7 + ldr r0, =gUnknown_08305D2C + lsls r4, 2 + adds r4, r0 + ldrb r0, [r4] + movs r4, 0x8 + subs r4, r0 + lsls r4, 18 + movs r0, 0xA0 + lsls r0, 15 + 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, r8 + adds r2, r4, 0 + bl AddObjectToFront + ldr r6, =0x020241e4 + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, =0x02020630 + 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] + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_814AF1C + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814CF30 + + thumb_func_start sub_814D0E4 +sub_814D0E4: @ 814D0E4 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D0E4 + + thumb_func_start sub_814D0F0 +sub_814D0F0: @ 814D0F0 + push {r4-r6,lr} + ldr r6, =0x020241e4 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =0x02020630 + 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, =DummyObjectCallback + bl oamt_set_x3A_32 + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_814AF54 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814D0F0 + + thumb_func_start sub_814D19C +sub_814D19C: @ 814D19C + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r4, [r6] + ldr r5, =0x02024064 + 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 _0814D1F0 + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0814D1D0 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_0814D1D0: + 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 _0814D266 + .pool +_0814D1F0: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0814D266 + strb r4, [r3, 0x4] + ldr r2, =0x0202406e + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + adds r0, r2 + bl sub_805E990 + movs r1, 0x40 + negs r1, r1 + movs r0, 0x10 + bl audio_play_and_stuff + ldr r2, =0x02020630 + ldr r3, =0x020241e4 + 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, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_814B340 + str r1, [r0] +_0814D266: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814D19C + + thumb_func_start sub_814D288 +sub_814D288: @ 814D288 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D288 + + thumb_func_start sub_814D294 +sub_814D294: @ 814D294 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D294 + + thumb_func_start sub_814D2A0 +sub_814D2A0: @ 814D2A0 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D2A0 + + thumb_func_start sub_814D2AC +sub_814D2AC: @ 814D2AC + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D2AC + + thumb_func_start sub_814D2B8 +sub_814D2B8: @ 814D2B8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r5, =0x02024064 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + beq _0814D2CE + b _0814D3F4 +_0814D2CE: + ldr r0, =0x02023064 + mov r12, r0 + ldrb r1, [r5] + lsls r1, 9 + adds r0, 0x1 + adds r0, r1, r0 + ldrb r6, [r0] + mov r0, r12 + adds r0, 0x2 + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 8 + orrs r6, r0 + ldr r0, =0x02038432 + mov r8, r0 + mov r0, r12 + adds r0, 0x3 + adds r1, r0 + ldrb r0, [r1] + mov r1, r8 + strb r0, [r1] + ldr r3, =0x02038408 + ldrb r1, [r5] + lsls r1, 9 + mov r0, r12 + adds r0, 0x4 + adds r0, r1, r0 + ldrb r2, [r0] + mov r0, r12 + adds r0, 0x5 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 8 + orrs r2, r0 + strh r2, [r3] + ldr r3, =0x02038404 + ldrb r1, [r5] + lsls r1, 9 + mov r0, r12 + adds r0, 0x6 + adds r0, r1, r0 + ldrb r2, [r0] + mov r0, r12 + adds r0, 0x7 + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 8 + orrs r2, r0 + mov r0, r12 + adds r0, 0x8 + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 16 + orrs r2, r0 + mov r0, r12 + adds r0, 0x9 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 24 + orrs r2, r0 + str r2, [r3] + ldr r2, =0x0203841a + ldrb r0, [r5] + lsls r0, 9 + mov r1, r12 + adds r1, 0xA + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r4, =0x0203841c + ldrb r1, [r5] + lsls r1, 9 + mov r0, r12 + adds r0, 0xC + adds r0, r1, r0 + ldrb r2, [r0] + mov r0, r12 + adds r0, 0xD + adds r1, r0 + ldrb r0, [r1] + lsls r0, 8 + orrs r2, r0 + strh r2, [r4] + ldr r7, =0x02038400 + ldrb r1, [r5] + lsls r1, 9 + mov r0, r12 + adds r0, 0x10 + adds r1, r0 + str r1, [r7] + ldr r2, =0x020244bc + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldr r1, [r1] + str r1, [r0] + mov r0, r8 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_805DB8C + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _0814D3CC + bl dp01_tbl4_exec_completed + b _0814D3F4 + .pool +_0814D3CC: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r3, [r0, 0x4] + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_move_anim_4 + str r1, [r0] + ldrh r1, [r4] + ldr r2, [r7] + adds r0, r6, 0 + bl sub_817E0FC +_0814D3F4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814D2B8 + + thumb_func_start bx_move_anim_4 +bx_move_anim_4: @ 814D40C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r2, =0x02023064 + ldr r6, =0x02024064 + 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, =0x020244d0 + 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 _0814D4A4 + cmp r2, 0x1 + bgt _0814D464 + cmp r2, 0 + beq _0814D46E + b _0814D580 + .pool +_0814D464: + cmp r2, 0x2 + beq _0814D4CE + cmp r2, 0x3 + beq _0814D544 + b _0814D580 +_0814D46E: + ldr r1, [r5] + lsls r0, r3, 2 + adds r1, r0, r1 + ldrb r2, [r1] + movs r0, 0xC + ands r0, r2 + cmp r0, 0x4 + bne _0814D490 + 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 +_0814D490: + 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 _0814D580 +_0814D4A4: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0814D580 + 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 _0814D580 +_0814D4CE: + ldr r0, =0x020383f8 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =0x020383fd + ldrb r0, [r0] + cmp r0, 0 + bne _0814D580 + 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 _0814D51C + mov r0, r8 + cmp r0, 0x1 + bhi _0814D51C + 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] +_0814D51C: + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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 _0814D580 + .pool +_0814D544: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0814D580 + 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 dp01_tbl4_exec_completed +_0814D580: + 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_4 + + thumb_func_start sub_814D590 +sub_814D590: @ 814D590 + push {r4,r5,lr} + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r5, =0x02024064 + ldrb r4, [r5] + lsls r4, 9 + ldr r0, =0x02023066 + adds r4, r0 + ldrh r0, [r4] + bl battle_pick_message + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_t4_button_a + str r1, [r0] + ldrh r0, [r4] + bl sub_817C95C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814D590 + + thumb_func_start sub_814D5E8 +sub_814D5E8: @ 814D5E8 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D5E8 + + thumb_func_start sub_814D5F4 +sub_814D5F4: @ 814D5F4 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D5F4 + + thumb_func_start sub_814D600 +sub_814D600: @ 814D600 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D600 + + thumb_func_start sub_814D60C +sub_814D60C: @ 814D60C + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D60C + + thumb_func_start sub_814D618 +sub_814D618: @ 814D618 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D618 + + thumb_func_start sub_814D624 +sub_814D624: @ 814D624 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D624 + + thumb_func_start sub_814D630 +sub_814D630: @ 814D630 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D630 + + thumb_func_start sub_814D63C +sub_814D63C: @ 814D63C + 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, =0x02023064 + ldr r0, =0x02024064 + 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 _0814D6CC + ldr r6, =0x0202406e + lsls r0, r4, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + movs r1, 0x3A + bl pokemon_getattr + 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 pokemon_getattr + adds r3, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, =0x03005d70 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + mov r2, r8 + bl sub_807294C + b _0814D6F6 + .pool +_0814D6CC: + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3A + bl pokemon_getattr + adds r2, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, =0x03005d70 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + movs r3, 0 + bl sub_807294C +_0814D6F6: + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_t4_healthbar_update + 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_814D63C + + thumb_func_start sub_814D72C +sub_814D72C: @ 814D72C + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D72C + + thumb_func_start sub_814D738 +sub_814D738: @ 814D738 + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0814D78C + ldr r0, =0x03005d70 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0x9 + bl healthbar_draw_field_maybe + ldrb r2, [r4] + ldr r0, =0x020244d0 + 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, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_814B7B8 + str r1, [r0] +_0814D78C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814D738 + + thumb_func_start sub_814D7B0 +sub_814D7B0: @ 814D7B0 + push {r4,r5,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0814D800 + ldr r4, =0x02023064 + 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, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_814B7B8 + str r1, [r0] +_0814D800: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814D7B0 + + thumb_func_start sub_814D818 +sub_814D818: @ 814D818 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D818 + + thumb_func_start sub_814D824 +sub_814D824: @ 814D824 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D824 + + thumb_func_start sub_814D830 +sub_814D830: @ 814D830 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D830 + + thumb_func_start sub_814D83C +sub_814D83C: @ 814D83C + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D83C + + thumb_func_start sub_814D848 +sub_814D848: @ 814D848 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D848 + + thumb_func_start sub_814D854 +sub_814D854: @ 814D854 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D854 + + thumb_func_start sub_814D860 +sub_814D860: @ 814D860 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D860 + + thumb_func_start sub_814D86C +sub_814D86C: @ 814D86C + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D86C + + thumb_func_start sub_814D878 +sub_814D878: @ 814D878 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D878 + + thumb_func_start sub_814D884 +sub_814D884: @ 814D884 + push {lr} + ldr r2, =0x02022d0c + ldrb r1, [r2] + movs r0, 0x80 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_814D884 + + thumb_func_start sub_814D8A0 +sub_814D8A0: @ 814D8A0 + push {lr} + ldr r3, =0x02022d0c + ldr r1, =0x02023064 + ldr r0, =0x02024064 + 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 dp01_tbl4_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_814D8A0 + + thumb_func_start sub_814D8D8 +sub_814D8D8: @ 814D8D8 + push {lr} + ldr r2, =0x02022d0c + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_814D8D8 + + thumb_func_start sub_814D8F0 +sub_814D8F0: @ 814D8F0 + push {lr} + ldr r3, =0x02022d0c + 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 dp01_tbl4_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_814D8F0 + + thumb_func_start dp01t_29_4_blink +dp01t_29_4_blink: @ 814D918 + push {r4,lr} + ldr r3, =0x02020630 + ldr r2, =0x020241e4 + ldr r4, =0x02024064 + 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 _0814D94C + bl dp01_tbl4_exec_completed + b _0814D976 + .pool +_0814D94C: + ldr r1, =0x020244b9 + 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, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =dp01t_0F_4_move_anim + str r1, [r0] +_0814D976: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_29_4_blink + + thumb_func_start sub_814D988 +sub_814D988: @ 814D988 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814D988 + + thumb_func_start sub_814D994 +sub_814D994: @ 814D994 + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + movs r3, 0x3F + cmp r0, 0 + bne _0814D9A8 + movs r3, 0xC0 +_0814D9A8: + ldr r2, =0x02023064 + 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 audio_play_and_stuff + bl dp01_tbl4_exec_completed + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814D994 + + thumb_func_start sub_814D9D8 +sub_814D9D8: @ 814D9D8 + push {r4,r5,lr} + ldr r4, =0x02023064 + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r3, r0, 9 + adds r0, r4, 0x3 + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _0814DA14 + 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 song_play_for_text + b _0814DA28 + .pool +_0814DA14: + 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 fanfare_play +_0814DA28: + bl dp01_tbl4_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_814D9D8 + + thumb_func_start sub_814DA34 +sub_814DA34: @ 814DA34 + push {lr} + ldr r1, =0x0202406e + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x19 + negs r1, r1 + movs r2, 0x5 + bl sub_80A32E4 + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_814DA34 + + thumb_func_start dp01t_2E_4_battle_intro +dp01t_2E_4_battle_intro: @ 814DA74 + push {lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, =0x020243fc + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_2E_4_battle_intro + + thumb_func_start sub_814DAA8 +sub_814DAA8: @ 814DAA8 + push {r4-r7,lr} + ldr r5, =0x020241e4 + ldr r6, =0x02024064 + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + 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 StartObjectImageAnim + ldr r0, =0x0000d6f9 + bl AllocObjectPalette + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r6] + bl sub_806D864 + ldr r4, =0x020229e8 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + movs r5, 0xFF + ldrb r0, [r1] + cmp r0, 0x4 + beq _0814DB80 + ldrb r0, [r6] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0x5 + bne _0814DBB4 +_0814DB80: + ldrb r0, [r6] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r1, 0x13] + adds r0, 0x2 + b _0814DC06 + .pool +_0814DBB4: + ldrb r0, [r6] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0x2 + beq _0814DBE2 + ldrb r0, [r6] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r1] + ands r5, r0 + cmp r5, 0x1 + bne _0814DBF6 +_0814DBE2: + ldrb r0, [r6] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r1, 0x13] + adds r0, 0x4 + b _0814DC06 +_0814DBF6: + ldrb r0, [r6] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r1, 0x13] +_0814DC06: + ldr r1, =gTrainerBackPicPaletteTable + lsls r0, 3 + adds r0, r1 + ldr r0, [r0] + lsls r4, r7, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r4, r2 + movs r2, 0x20 + bl decompress_palette + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r5, =0x02024064 + 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_814DCCC + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + ldrb r0, [r5] + strh r0, [r1, 0x8] + ldr r3, =0x020244d0 + 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 _0814DC80 + ldr r0, =0x020244b4 + 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] +_0814DC80: + ldr r0, [r3] + ldr r2, [r0, 0x8] + ldrb r0, [r2, 0x9] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =nullsub_112 + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814DAA8 + + thumb_func_start sub_814DCCC +sub_814DCCC: @ 814DCCC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =0x03005e00 + 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 _0814DCF8 + adds r0, r2, 0x1 + strh r0, [r1, 0xA] + b _0814DDB4 + .pool +_0814DCF8: + ldr r7, =0x02024064 + 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 _0814DD18 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0814DD48 +_0814DD18: + ldr r0, =0x02023064 + ldrb r1, [r7] + lsls r2, r1, 9 + adds r0, 0x1 + adds r2, r0 + ldr r0, =0x0202406e + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + strb r0, [r2] + ldrb r0, [r7] + movs r1, 0 + bl sub_814CC98 + b _0814DD9C + .pool +_0814DD48: + ldr r4, =0x02023064 + ldrb r0, [r7] + lsls r1, r0, 9 + adds r4, 0x1 + adds r1, r4 + ldr r5, =0x0202406e + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + movs r1, 0 + bl sub_814CC98 + 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, =0x020244ec + adds r0, r2 + bl sub_805DD7C + ldrb r0, [r7] + movs r1, 0 + bl sub_814CC98 + ldrb r0, [r7] + eors r0, r6 + strb r0, [r7] +_0814DD9C: + ldr r1, =0x03005d60 + ldr r2, =0x02024064 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_814B0E8 + str r1, [r0] + mov r3, r9 + strb r3, [r2] + mov r0, r8 + bl DestroyTask +_0814DDB4: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814DCCC + + thumb_func_start sub_814DDD8 +sub_814DDD8: @ 814DDD8 + push {r4-r6,lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0814DE08 + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0814DE08 + bl dp01_tbl4_exec_completed + b _0814DE7C + .pool +_0814DE08: + ldr r6, =0x020244d0 + ldr r0, [r6] + ldr r5, =0x02024064 + 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, =0x02023068 + 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, =0x020244b4 + 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 _0814DE70 + 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] +_0814DE70: + ldr r0, =0x03005d60 + ldrb r1, [r5] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_814DE9C + str r0, [r1] +_0814DE7C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814DDD8 + + thumb_func_start sub_814DE9C +sub_814DE9C: @ 814DE9C + push {r4,lr} + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r3, =0x02024064 + 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 _0814DED4 + 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 dp01_tbl4_exec_completed +_0814DED4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814DE9C + + thumb_func_start sub_814DEE4 +sub_814DEE4: @ 814DEE4 + push {lr} + ldr r0, =0x020244d0 + ldr r1, [r0] + ldr r0, =0x02024064 + 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 _0814DF16 + ldr r2, =0x03005e00 + ldr r0, =0x020244b4 + 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] +_0814DF16: + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_814DEE4 + + thumb_func_start sub_814DF34 +sub_814DF34: @ 814DF34 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814DF34 + + thumb_func_start sub_814DF40 +sub_814DF40: @ 814DF40 + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _0814DF86 + ldr r3, =0x02020630 + ldr r0, =0x020241e4 + 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, =0x02023064 + 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 +_0814DF86: + bl dp01_tbl4_exec_completed + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814DF40 + + thumb_func_start sub_814DFA0 +sub_814DFA0: @ 814DFA0 + push {r4-r6,lr} + sub sp, 0x4 + ldr r5, =0x02024064 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0814E002 + ldr r4, =0x02023064 + ldrb r2, [r5] + lsls r1, r2, 9 + adds r0, r4, 0x1 + adds r0, r1, r0 + ldrb r6, [r0] + adds r0, r4, 0x2 + adds r0, r1, r0 + ldrb r3, [r0] + adds r4, 0x3 + adds r1, r4 + ldrb r0, [r1] + lsls r0, 8 + orrs r3, r0 + str r3, [sp] + adds r0, r2, 0 + adds r1, r2, 0 + adds r3, r6, 0 + bl move_anim_start_t3 + lsls r0, 24 + cmp r0, 0 + beq _0814DFF0 + bl dp01_tbl4_exec_completed + b _0814DFFC + .pool +_0814DFF0: + ldr r0, =0x03005d60 + ldrb r1, [r5] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_814B7E8 + str r0, [r1] +_0814DFFC: + adds r0, r6, 0 + bl sub_817E32C +_0814E002: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814DFA0 + + thumb_func_start sub_814E014 +sub_814E014: @ 814E014 + push {lr} + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + ldr r1, =0x02023066 + adds r0, r1 + bl sub_81851A8 + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_814E014 + + thumb_func_start sub_814E034 +sub_814E034: @ 814E034 + push {lr} + bl dp01_tbl4_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_814E034 + + thumb_func_start sub_814E040 +sub_814E040: @ 814E040 + push {r4,r5,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r0, 9 + ldr r4, =0x02023068 + adds r0, r4 + bl sub_81851A8 + ldr r2, =0x0202433a + ldrb r0, [r5] + lsls r0, 9 + subs r1, r4, 0x3 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r0, =0x03005d90 + ldr r3, [r0] + ldrb r0, [r5] + lsls r0, 9 + subs r4, 0x2 + adds r0, r4 + ldrb r0, [r0] + ldr r1, =0x00000ca9 + adds r3, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 3 + ldrb r2, [r3] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x5 + bl sub_80A2F50 + movs r0, 0x3 + bl sub_80A2390 + bl dp01_tbl4_exec_completed + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80587B0 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814E040 + + thumb_func_start nullsub_113 +nullsub_113: @ 814E0C0 + bx lr + thumb_func_end nullsub_113 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/battle_ai.s b/asm/battle_ai.s new file mode 100644 index 000000000..f0166da9e --- /dev/null +++ b/asm/battle_ai.s @@ -0,0 +1,6204 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_81308C8 +sub_81308C8: @ 81308C8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x020244a8 + ldr r0, [r1] + ldr r3, [r0, 0x18] + movs r4, 0 + mov r12, r1 + ldr r2, =0x02022fec + movs r1, 0 +_081308DC: + adds r0, r3, r4 + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x53 + bls _081308DC + ldr r0, [r2] + ldr r1, =0x0a7f098a + ands r0, r1 + cmp r0, 0x8 + bne _0813092E + movs r4, 0 + ldr r6, =0x02038bca + ldr r5, =gTrainers + 0x10 @ items offset +_081308F6: + lsls r2, r4, 1 + ldrh r1, [r6] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r2, r0 + adds r2, r5 + ldrh r3, [r2] + cmp r3, 0 + beq _08130928 + mov r0, r12 + ldr r2, [r0] + ldr r1, [r2, 0x18] + adds r0, r1, 0 + adds r0, 0x50 + ldrb r0, [r0] + lsls r0, 1 + adds r1, 0x48 + adds r1, r0 + strh r3, [r1] + ldr r1, [r2, 0x18] + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08130928: + adds r4, 0x1 + cmp r4, 0x3 + ble _081308F6 +_0813092E: + adds r0, r7, 0 + bl sub_8130950 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81308C8 + + thumb_func_start sub_8130950 +sub_8130950: @ 8130950 + push {r4-r7,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r4, 0 + ldr r6, =0x02024064 + movs r3, 0 +_08130962: + adds r0, r1, r4 + strb r3, [r0] + adds r4, 0x1 + cmp r4, 0x1B + bls _08130962 + movs r4, 0 + ldr r3, =0x020244a8 + movs r5, 0x1 +_08130972: + adds r1, r2, 0 + ands r1, r5 + cmp r1, 0 + beq _08130990 + ldr r0, [r3] + ldr r0, [r0, 0x14] + adds r0, 0x4 + adds r0, r4 + movs r1, 0x64 + b _08130998 + .pool +_08130990: + ldr r0, [r3] + ldr r0, [r0, 0x14] + adds r0, 0x4 + adds r0, r4 +_08130998: + strb r1, [r0] + lsrs r2, 1 + adds r4, 0x1 + cmp r4, 0x3 + ble _08130972 + ldrb r0, [r6] + movs r1, 0 + movs r2, 0xFF + bl sub_803FECC + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + ldr r5, =0x020244a8 +_081309B4: + ldr r7, =gUnknown_0832A328 + lsls r0, r4, 2 + adds r0, r7 + ldr r0, [r0] + ands r0, r6 + cmp r0, 0 + beq _081309CE + ldr r0, [r5] + ldr r0, [r0, 0x14] + adds r0, 0x4 + adds r0, r4 + movs r1, 0 + strb r1, [r0] +_081309CE: + bl GenerateRandomNumber + ldr r1, [r5] + ldr r2, [r1, 0x14] + adds r2, 0x18 + adds r2, r4 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF + ands r0, r1 + movs r1, 0x64 + subs r1, r0 + strb r1, [r2] + adds r4, 0x1 + cmp r4, 0x3 + ble _081309B4 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x1C] + adds r0, 0x20 + movs r1, 0 + strb r1, [r0] + ldr r0, =0x0203ab3c + ldr r6, =0x02024064 + ldrb r2, [r6] + strb r2, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08130A60 + ldr r5, =0x0202420c + bl GenerateRandomNumber + adds r4, r0, 0 + ldrb r0, [r6] + bl battle_side_get_owner + movs r3, 0x2 + adds r1, r3, 0 + ands r1, r4 + movs r2, 0x1 + eors r0, r2 + adds r1, r0 + strb r1, [r5] + ldr r0, =0x02024210 + ldrb r1, [r0] + ldrb r2, [r5] + lsls r0, r2, 2 + adds r0, r7 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08130A68 + eors r2, r3 + strb r2, [r5] + b _08130A68 + .pool +_08130A60: + ldr r0, =0x0202420c + movs r1, 0x1 + eors r1, r2 + strb r1, [r0] +_08130A68: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + beq _08130A84 + bl sub_8186438 + b _08130AE6 + .pool +_08130A84: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08130AA0 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0x80 + lsls r0, 23 + str r0, [r1, 0xC] + b _08130B72 + .pool +_08130AA0: + movs r0, 0x80 + lsls r0, 3 + ands r0, r1 + cmp r0, 0 + beq _08130ABC + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0x80 + lsls r0, 22 + str r0, [r1, 0xC] + b _08130B72 + .pool +_08130ABC: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08130AD8 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0x80 + lsls r0, 24 + str r0, [r1, 0xC] + b _08130B72 + .pool +_08130AD8: + movs r0, 0x80 + lsls r0, 12 + ands r0, r1 + cmp r0, 0 + beq _08130AF4 + bl sub_81A6FB4 +_08130AE6: + ldr r1, =0x020244a8 + ldr r1, [r1] + ldr r1, [r1, 0x14] + str r0, [r1, 0xC] + b _08130B72 + .pool +_08130AF4: + ldr r0, =0x0c3f0900 + ands r0, r1 + cmp r0, 0 + beq _08130B10 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0x7 + str r0, [r1, 0xC] + b _08130B72 + .pool +_08130B10: + movs r0, 0x80 + lsls r0, 8 + ands r1, r0 + cmp r1, 0 + beq _08130B58 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r4, [r0, 0x14] + ldr r3, =gTrainers + ldr r0, =0x02038bca + ldrh r0, [r0] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r3, 0x1C + adds r1, r3 + ldr r0, =0x02038bcc + ldrh r2, [r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r3 + ldr r1, [r1] + ldr r0, [r0] + orrs r1, r0 + str r1, [r4, 0xC] + b _08130B72 + .pool +_08130B58: + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r3, [r0, 0x14] + ldr r2, =gTrainers + ldr r0, =0x02038bca + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r2, 0x1C + adds r0, r2 + ldr r0, [r0] + str r0, [r3, 0xC] +_08130B72: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08130B8C + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldr r0, [r2, 0xC] + movs r1, 0x80 + orrs r0, r1 + str r0, [r2, 0xC] +_08130B8C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8130950 + + thumb_func_start sub_8130BA4 +sub_8130BA4: @ 8130BA4 + push {r4,lr} + ldr r0, =0x020241ea + ldrh r4, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08130BC4 + bl sub_8130BDC + b _08130BC8 + .pool +_08130BC4: + bl sub_8130CF4 +_08130BC8: + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, =0x020241ea + strh r4, [r0] + adds r0, r1, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8130BA4 + + thumb_func_start sub_8130BDC +sub_8130BDC: @ 8130BDC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + bl sub_8131074 + ldr r1, =0x020244a8 + ldr r0, [r1] + ldr r0, [r0, 0x14] + ldr r0, [r0, 0xC] + cmp r0, 0 + beq _08130C2C + adds r4, r1, 0 + movs r5, 0 +_08130BF8: + ldr r0, [r4] + ldr r2, [r0, 0x14] + ldr r0, [r2, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08130C0C + strb r5, [r2] + bl tai_run_script +_08130C0C: + ldr r0, [r4] + ldr r1, [r0, 0x14] + ldr r0, [r1, 0xC] + lsrs r0, 1 + str r0, [r1, 0xC] + ldrb r0, [r1, 0x11] + adds r0, 0x1 + strb r0, [r1, 0x11] + ldr r0, [r4] + ldr r0, [r0, 0x14] + strb r5, [r0, 0x1] + ldr r0, [r4] + ldr r0, [r0, 0x14] + ldr r0, [r0, 0xC] + cmp r0, 0 + bne _08130BF8 +_08130C2C: + ldr r1, =0x020244a8 + ldr r0, [r1] + ldr r3, [r0, 0x14] + ldrb r2, [r3, 0x10] + movs r0, 0x2 + ands r0, r2 + mov r12, r1 + cmp r0, 0 + beq _08130C48 + movs r0, 0x4 + b _08130CE0 + .pool +_08130C48: + movs r0, 0x4 + ands r0, r2 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _08130C58 + movs r0, 0x5 + b _08130CE0 +_08130C58: + movs r6, 0x1 + mov r1, sp + ldrb r0, [r3, 0x4] + strb r0, [r1] + add r0, sp, 0x4 + strb r2, [r0] + movs r3, 0x1 + mov r8, r0 + ldr r1, =0x02024084 + ldr r0, =0x0203ab3c + ldrb r2, [r0] + mov r5, sp + mov r7, r8 + movs r0, 0x58 + muls r0, r2 + adds r1, r0 + adds r4, r1, 0 + adds r4, 0xE +_08130C7C: + ldrh r0, [r4] + cmp r0, 0 + beq _08130CC6 + ldrb r1, [r5] + mov r2, r12 + ldr r0, [r2] + ldr r0, [r0, 0x14] + adds r0, 0x4 + adds r2, r0, r3 + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r1, r0 + bne _08130CAA + mov r0, sp + adds r1, r0, r6 + ldrb r0, [r2] + strb r0, [r1] + adds r1, r6, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r1, r7, r1 + strb r3, [r1] +_08130CAA: + ldrb r1, [r5] + mov r2, r12 + ldr r0, [r2] + ldr r0, [r0, 0x14] + adds r0, 0x4 + adds r2, r0, r3 + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r1, r0 + bge _08130CC6 + movs r6, 0x1 + ldrb r0, [r2] + strb r0, [r5] + strb r3, [r7] +_08130CC6: + adds r4, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _08130C7C + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + add r0, r8 + ldrb r0, [r0] +_08130CE0: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8130BDC + + thumb_func_start sub_8130CF4 +sub_8130CF4: @ 8130CF4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + movs r0, 0 + mov r8, r0 + mov r1, sp + adds r1, 0xC + str r1, [sp, 0x1C] + mov r2, sp + adds r2, 0x8 + str r2, [sp, 0x18] + str r1, [sp, 0x20] + mov r10, sp +_08130D14: + ldr r0, =0x0203ab3c + ldrb r0, [r0] + cmp r8, r0 + beq _08130D2E + movs r0, 0x58 + mov r7, r8 + muls r7, r0 + adds r0, r7, 0 + ldr r1, =0x02024084 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08130D48 +_08130D2E: + movs r0, 0xFF + ldr r2, [sp, 0x20] + strb r0, [r2] + ldr r0, =0x0000ffff + mov r7, r10 + strh r0, [r7] + b _08130EAE + .pool +_08130D48: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _08130D70 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x92 + ldrb r0, [r0] + lsrs r0, 4 + bl sub_8130950 + b _08130D76 + .pool +_08130D70: + movs r0, 0xF + bl sub_8130950 +_08130D76: + ldr r0, =0x0202420c + mov r1, r8 + strb r1, [r0] + movs r1, 0x1 + mov r2, r8 + ands r2, r1 + ldr r0, =0x0203ab3c + ldrb r0, [r0] + ands r1, r0 + cmp r2, r1 + beq _08130D90 + bl sub_8131074 +_08130D90: + ldr r2, =0x020244a8 + ldr r0, [r2] + ldr r0, [r0, 0x14] + movs r1, 0 + strb r1, [r0, 0x11] + ldr r0, [r2] + ldr r0, [r0, 0x14] + strb r1, [r0, 0x1] + ldr r0, [r2] + ldr r0, [r0, 0x14] + ldr r4, [r0, 0xC] + mov r9, r2 + cmp r4, 0 + beq _08130DD8 + mov r5, r9 + movs r6, 0 +_08130DB0: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _08130DC2 + ldr r0, [r5] + ldr r0, [r0, 0x14] + strb r6, [r0] + bl tai_run_script +_08130DC2: + asrs r4, 1 + ldr r0, [r5] + ldr r1, [r0, 0x14] + ldrb r0, [r1, 0x11] + adds r0, 0x1 + strb r0, [r1, 0x11] + ldr r0, [r5] + ldr r0, [r0, 0x14] + strb r6, [r0, 0x1] + cmp r4, 0 + bne _08130DB0 +_08130DD8: + mov r2, r9 + ldr r0, [r2] + ldr r3, [r0, 0x14] + ldrb r1, [r3, 0x10] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08130DFC + movs r0, 0x4 + ldr r7, [sp, 0x20] + strb r0, [r7] + b _08130EAE + .pool +_08130DFC: + movs r0, 0x4 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _08130E10 + movs r0, 0x5 + ldr r1, [sp, 0x20] + strb r0, [r1] + b _08130EAE +_08130E10: + add r1, sp, 0x10 + ldrb r0, [r3, 0x4] + strb r0, [r1] + add r0, sp, 0x14 + strb r2, [r0] + movs r5, 0x1 + movs r3, 0x1 + adds r6, r1, 0 + ldr r0, =0x0203ab3c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + ldr r2, =0x02024090 + adds r0, r2 + adds r4, r0, 0x2 + add r7, sp, 0x14 +_08130E30: + ldrh r0, [r4] + cmp r0, 0 + beq _08130E72 + ldrb r1, [r6] + mov r2, r9 + ldr r0, [r2] + ldr r0, [r0, 0x14] + adds r0, 0x4 + adds r2, r0, r3 + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r1, r0 + bne _08130E56 + adds r0, r6, r5 + ldrb r1, [r2] + strb r1, [r0] + adds r0, r7, r5 + strb r3, [r0] + adds r5, 0x1 +_08130E56: + ldrb r1, [r6] + mov r2, r9 + ldr r0, [r2] + ldr r0, [r0, 0x14] + adds r0, 0x4 + adds r2, r0, r3 + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r1, r0 + bge _08130E72 + ldrb r0, [r2] + strb r0, [r6] + strb r3, [r7] + movs r5, 0x1 +_08130E72: + adds r4, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _08130E30 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __modsi3 + add r0, sp + adds r0, 0x14 + ldrb r0, [r0] + ldr r7, [sp, 0x20] + strb r0, [r7] + ldrb r2, [r6] + mov r0, r10 + strh r2, [r0] + ldr r0, =0x0203ab3c + ldrb r1, [r0] + movs r0, 0x2 + eors r0, r1 + cmp r8, r0 + bne _08130EAE + cmp r2, 0x63 + bgt _08130EAE + ldr r0, =0x0000ffff + mov r1, r10 + strh r0, [r1] +_08130EAE: + ldr r2, [sp, 0x20] + adds r2, 0x1 + str r2, [sp, 0x20] + movs r7, 0x2 + add r10, r7 + movs r0, 0x1 + add r8, r0 + mov r1, r8 + cmp r1, 0x3 + bgt _08130EC4 + b _08130D14 +_08130EC4: + mov r0, sp + ldrh r5, [r0] + movs r0, 0 + ldr r2, [sp, 0x18] + strb r0, [r2] + movs r4, 0x1 + mov r8, r4 + ldr r6, =0x0202420c + ldr r3, [sp, 0x18] + mov r1, sp + adds r1, 0x2 +_08130EDA: + lsls r0, r5, 16 + asrs r2, r0, 16 + movs r7, 0 + ldrsh r0, [r1, r7] + cmp r2, r0 + bne _08130EEE + adds r0, r3, r4 + mov r7, r8 + strb r7, [r0] + adds r4, 0x1 +_08130EEE: + movs r7, 0 + ldrsh r0, [r1, r7] + cmp r2, r0 + bge _08130EFE + ldrh r5, [r1] + mov r0, r8 + strb r0, [r3] + movs r4, 0x1 +_08130EFE: + adds r1, 0x2 + movs r2, 0x1 + add r8, r2 + mov r7, r8 + cmp r7, 0x3 + ble _08130EDA + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + ldr r1, [sp, 0x18] + adds r0, r1, r0 + ldrb r0, [r0] + strb r0, [r6] + ldrb r0, [r6] + ldr r2, [sp, 0x1C] + adds r0, r2, r0 + ldrb r0, [r0] + 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_8130CF4 + + thumb_func_start tai_run_script +tai_run_script: @ 8130F48 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r7, =0x020244a8 + ldr r0, [r7] + ldr r0, [r0, 0x14] + ldrb r0, [r0] + adds r6, r7, 0 + cmp r0, 0x2 + bne _08130F60 + b _08131066 +_08130F60: + mov r9, r7 + ldr r0, =0x0203ab38 + mov r8, r0 +_08130F66: + mov r1, r9 + ldr r0, [r1] + ldr r2, [r0, 0x14] + ldrb r0, [r2] + cmp r0, 0x1 + beq _08130FD4 + cmp r0, 0x1 + bgt _0813105A + cmp r0, 0 + bne _0813105A + ldr r1, =gUnknown_082DBEF8 + ldrb r0, [r2, 0x11] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + mov r1, r8 + str r0, [r1] + ldr r5, =0x02024084 + ldrb r4, [r2, 0x1] + ldr r0, =0x0203ab3c + ldrb r1, [r0] + movs r0, 0x58 + adds r3, r1, 0 + muls r3, r0 + adds r0, r4, r3 + adds r1, r5, 0 + adds r1, 0x24 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08130FB0 + lsls r0, r4, 1 + adds r0, r3 + adds r1, r5, 0 + adds r1, 0xC + adds r0, r1 + ldrh r0, [r0] +_08130FB0: + strh r0, [r2, 0x2] + ldr r0, [r6] + ldr r1, [r0, 0x14] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0813105A + .pool +_08130FD4: + ldrh r1, [r2, 0x2] + cmp r1, 0 + beq _08130FF4 + ldr r1, =gUnknown_085B083C + mov r2, r8 + ldr r0, [r2] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + b _0813100A + .pool +_08130FF4: + adds r0, r2, 0x4 + ldrb r2, [r2, 0x1] + adds r0, r2 + strb r1, [r0] + mov r1, r9 + ldr r0, [r1] + ldr r2, [r0, 0x14] + ldrb r1, [r2, 0x10] + movs r0, 0x1 + orrs r0, r1 + strb r0, [r2, 0x10] +_0813100A: + ldr r2, =0x020244a8 + ldr r0, [r2] + ldr r3, [r0, 0x14] + ldrb r1, [r3, 0x10] + movs r0, 0x1 + ands r0, r1 + adds r6, r2, 0 + cmp r0, 0 + beq _0813105A + ldrb r0, [r3, 0x1] + adds r0, 0x1 + strb r0, [r3, 0x1] + ldr r0, [r6] + ldr r2, [r0, 0x14] + ldrb r0, [r2, 0x1] + cmp r0, 0x3 + bhi _08131044 + ldrb r1, [r2, 0x10] + movs r0, 0x8 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08131044 + strb r0, [r2] + b _0813104E + .pool +_08131044: + ldr r0, [r6] + ldr r1, [r0, 0x14] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0813104E: + ldr r0, [r6] + ldr r2, [r0, 0x14] + ldrb r1, [r2, 0x10] + movs r0, 0xFE + ands r0, r1 + strb r0, [r2, 0x10] +_0813105A: + ldr r0, [r7] + ldr r0, [r0, 0x14] + ldrb r0, [r0] + cmp r0, 0x2 + beq _08131066 + b _08130F66 +_08131066: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end tai_run_script + + thumb_func_start sub_8131074 +sub_8131074: @ 8131074 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r7, 0 + ldr r4, =0x020244a8 + ldr r0, [r4] + ldr r2, [r0, 0x18] + ldr r3, =0x0202420c + ldrb r1, [r3] + lsls r0, r1, 4 + adds r2, r0 + ldr r5, =0x02024248 + lsls r1, 1 + adds r1, r5 + ldrh r0, [r2] + mov r8, r4 + mov r12, r3 + ldrh r1, [r1] + cmp r0, r1 + beq _081310E4 + adds r6, r5, 0 + movs r5, 0 +_081310A0: + mov r1, r8 + ldr r0, [r1] + ldr r4, [r0, 0x18] + mov r0, r12 + ldrb r1, [r0] + lsls r3, r1, 4 + adds r0, r5, r3 + adds r2, r4, r0 + ldrh r0, [r2] + cmp r0, 0 + bne _081310CC + lsls r0, r1, 1 + adds r0, r6 + ldrh r0, [r0] + strh r0, [r2] + b _081310E4 + .pool +_081310CC: + adds r5, 0x2 + adds r7, 0x1 + cmp r7, 0x3 + bgt _081310E4 + adds r0, r5, r3 + adds r0, r4, r0 + lsls r1, 1 + adds r1, r6 + ldrh r0, [r0] + ldrh r1, [r1] + cmp r0, r1 + bne _081310A0 +_081310E4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8131074 + + thumb_func_start sub_81310F0 +sub_81310F0: @ 81310F0 + push {r4,lr} + lsls r0, 24 + ldr r4, =0x020244a8 + movs r3, 0 + lsrs r1, r0, 20 + movs r2, 0x3 +_081310FC: + ldr r0, [r4] + ldr r0, [r0, 0x18] + adds r0, r1 + strh r3, [r0] + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _081310FC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81310F0 + + thumb_func_start b_history__record_ability_usage_of_player +b_history__record_ability_usage_of_player: @ 8131118 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x020244a8 + ldr r2, [r2] + ldr r2, [r2, 0x18] + adds r2, 0x40 + adds r2, r0 + strb r1, [r2] + bx lr + .pool + thumb_func_end b_history__record_ability_usage_of_player + + thumb_func_start sub_8131130 +sub_8131130: @ 8131130 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020244a8 + ldr r1, [r1] + ldr r1, [r1, 0x18] + adds r1, 0x40 + adds r1, r0 + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_8131130 + + thumb_func_start b_history__record_item_x12_of_player +b_history__record_item_x12_of_player: @ 8131148 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x020244a8 + ldr r2, [r2] + ldr r2, [r2, 0x18] + adds r2, 0x44 + adds r2, r0 + strb r1, [r2] + bx lr + .pool + thumb_func_end b_history__record_item_x12_of_player + + thumb_func_start sub_8131160 +sub_8131160: @ 8131160 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020244a8 + ldr r1, [r1] + ldr r1, [r1, 0x18] + adds r1, 0x44 + adds r1, r0 + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_8131160 + + thumb_func_start tai00_unk +tai00_unk: @ 8131178 + push {lr} + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xFF + lsls r1, 16 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ands r1, r0 + lsrs r1, 16 + ldrb r0, [r2, 0x1] + cmp r1, r0 + bcs _081311B0 + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081311B4 + .pool +_081311B0: + adds r0, r2, 0x6 + str r0, [r3] +_081311B4: + pop {r0} + bx r0 + thumb_func_end tai00_unk + + thumb_func_start tai01_unk +tai01_unk: @ 81311B8 + push {lr} + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xFF + lsls r1, 16 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ands r1, r0 + lsrs r1, 16 + ldrb r0, [r2, 0x1] + cmp r1, r0 + bls _081311F0 + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081311F4 + .pool +_081311F0: + adds r0, r2, 0x6 + str r0, [r3] +_081311F4: + pop {r0} + bx r0 + thumb_func_end tai01_unk + + thumb_func_start tai02_unk +tai02_unk: @ 81311F8 + push {lr} + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xFF + lsls r1, 16 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ands r1, r0 + lsrs r1, 16 + ldrb r0, [r2, 0x1] + cmp r1, r0 + bne _08131230 + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08131234 + .pool +_08131230: + adds r0, r2, 0x6 + str r0, [r3] +_08131234: + pop {r0} + bx r0 + thumb_func_end tai02_unk + + thumb_func_start tai03_unk +tai03_unk: @ 8131238 + push {lr} + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xFF + lsls r1, 16 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ands r1, r0 + lsrs r1, 16 + ldrb r0, [r2, 0x1] + cmp r1, r0 + beq _08131270 + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08131274 + .pool +_08131270: + adds r0, r2, 0x6 + str r0, [r3] +_08131274: + pop {r0} + bx r0 + thumb_func_end tai03_unk + + thumb_func_start tai04_unk +tai04_unk: @ 8131278 + push {r4,lr} + ldr r2, =0x020244a8 + ldr r0, [r2] + ldr r0, [r0, 0x14] + adds r1, r0, 0x4 + ldrb r0, [r0, 0x1] + adds r1, r0 + ldr r3, =0x0203ab38 + ldr r0, [r3] + ldrb r0, [r0, 0x1] + ldrb r4, [r1] + adds r0, r4 + strb r0, [r1] + ldr r0, [r2] + ldr r1, [r0, 0x14] + adds r0, r1, 0x4 + ldrb r1, [r1, 0x1] + adds r1, r0, r1 + movs r0, 0 + ldrsb r0, [r1, r0] + cmp r0, 0 + bge _081312A8 + movs r0, 0 + strb r0, [r1] +_081312A8: + ldr r0, [r3] + adds r0, 0x2 + str r0, [r3] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end tai04_unk + + thumb_func_start tai05_unk +tai05_unk: @ 81312BC + push {r4,lr} + ldr r0, =0x0203ab38 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _081312D8 + ldr r0, =0x0203ab3c + b _081312DA + .pool +_081312D8: + ldr r0, =0x0202420c +_081312DA: + ldrb r1, [r0] + ldr r2, =0x02024084 + movs r0, 0x58 + muls r1, r0 + adds r1, r2 + ldrh r2, [r1, 0x28] + movs r0, 0x64 + muls r0, r2 + ldrh r1, [r1, 0x2C] + bl __divsi3 + ldr r2, [r4] + ldrb r1, [r2, 0x2] + cmp r0, r1 + bcs _08131318 + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _0813131C + .pool +_08131318: + adds r0, r2, 0x7 + str r0, [r4] +_0813131C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai05_unk + + thumb_func_start tai06_unk +tai06_unk: @ 8131324 + push {r4,lr} + ldr r0, =0x0203ab38 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _08131340 + ldr r0, =0x0203ab3c + b _08131342 + .pool +_08131340: + ldr r0, =0x0202420c +_08131342: + ldrb r1, [r0] + ldr r2, =0x02024084 + movs r0, 0x58 + muls r1, r0 + adds r1, r2 + ldrh r2, [r1, 0x28] + movs r0, 0x64 + muls r0, r2 + ldrh r1, [r1, 0x2C] + bl __divsi3 + ldr r2, [r4] + ldrb r1, [r2, 0x2] + cmp r0, r1 + bls _08131380 + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08131384 + .pool +_08131380: + adds r0, r2, 0x7 + str r0, [r4] +_08131384: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai06_unk + + thumb_func_start tai07_unk +tai07_unk: @ 813138C + push {r4,lr} + ldr r0, =0x0203ab38 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _081313A8 + ldr r0, =0x0203ab3c + b _081313AA + .pool +_081313A8: + ldr r0, =0x0202420c +_081313AA: + ldrb r1, [r0] + ldr r2, =0x02024084 + movs r0, 0x58 + muls r1, r0 + adds r1, r2 + ldrh r2, [r1, 0x28] + movs r0, 0x64 + muls r0, r2 + ldrh r1, [r1, 0x2C] + bl __divsi3 + ldr r2, [r4] + ldrb r1, [r2, 0x2] + cmp r0, r1 + bne _081313E8 + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _081313EC + .pool +_081313E8: + adds r0, r2, 0x7 + str r0, [r4] +_081313EC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai07_unk + + thumb_func_start tai08_unk +tai08_unk: @ 81313F4 + push {r4,lr} + ldr r0, =0x0203ab38 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _08131410 + ldr r0, =0x0203ab3c + b _08131412 + .pool +_08131410: + ldr r0, =0x0202420c +_08131412: + ldrb r1, [r0] + ldr r2, =0x02024084 + movs r0, 0x58 + muls r1, r0 + adds r1, r2 + ldrh r2, [r1, 0x28] + movs r0, 0x64 + muls r0, r2 + ldrh r1, [r1, 0x2C] + bl __divsi3 + ldr r2, [r4] + ldrb r1, [r2, 0x2] + cmp r0, r1 + beq _08131450 + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08131454 + .pool +_08131450: + adds r0, r2, 0x7 + str r0, [r4] +_08131454: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai08_unk + + thumb_func_start tai09_unk +tai09_unk: @ 813145C + push {r4,r5,lr} + ldr r0, =0x0203ab38 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r5, r0, 0 + cmp r1, 0x1 + bne _08131478 + ldr r0, =0x0203ab3c + b _0813147A + .pool +_08131478: + ldr r0, =0x0202420c +_0813147A: + ldrb r4, [r0] + ldr r3, [r5] + ldrb r2, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r2, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r2, r0 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r4 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + ands r0, r2 + cmp r0, 0 + beq _081314C4 + ldrb r1, [r3, 0x6] + ldrb r0, [r3, 0x7] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x8] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x9] + lsls r0, 24 + orrs r1, r0 + str r1, [r5] + b _081314CA + .pool +_081314C4: + adds r0, r3, 0 + adds r0, 0xA + str r0, [r5] +_081314CA: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end tai09_unk + + thumb_func_start tai0A_unk +tai0A_unk: @ 81314D0 + push {r4,r5,lr} + ldr r0, =0x0203ab38 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r5, r0, 0 + cmp r1, 0x1 + bne _081314EC + ldr r0, =0x0203ab3c + b _081314EE + .pool +_081314EC: + ldr r0, =0x0202420c +_081314EE: + ldrb r4, [r0] + ldr r3, [r5] + ldrb r2, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r2, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r2, r0 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r4 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + ands r0, r2 + cmp r0, 0 + bne _08131538 + ldrb r1, [r3, 0x6] + ldrb r0, [r3, 0x7] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x8] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x9] + lsls r0, 24 + orrs r1, r0 + str r1, [r5] + b _0813153E + .pool +_08131538: + adds r0, r3, 0 + adds r0, 0xA + str r0, [r5] +_0813153E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end tai0A_unk + + thumb_func_start tai0B_unk +tai0B_unk: @ 8131544 + push {r4,r5,lr} + ldr r0, =0x0203ab38 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r5, r0, 0 + cmp r1, 0x1 + bne _08131560 + ldr r0, =0x0203ab3c + b _08131562 + .pool +_08131560: + ldr r0, =0x0202420c +_08131562: + ldrb r4, [r0] + ldr r3, [r5] + ldrb r2, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r2, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r2, r0 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r4 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + ands r0, r2 + cmp r0, 0 + beq _081315AC + ldrb r1, [r3, 0x6] + ldrb r0, [r3, 0x7] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x8] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x9] + lsls r0, 24 + orrs r1, r0 + str r1, [r5] + b _081315B2 + .pool +_081315AC: + adds r0, r3, 0 + adds r0, 0xA + str r0, [r5] +_081315B2: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end tai0B_unk + + thumb_func_start tai0C_unk +tai0C_unk: @ 81315B8 + push {r4,r5,lr} + ldr r0, =0x0203ab38 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r5, r0, 0 + cmp r1, 0x1 + bne _081315D4 + ldr r0, =0x0203ab3c + b _081315D6 + .pool +_081315D4: + ldr r0, =0x0202420c +_081315D6: + ldrb r4, [r0] + ldr r3, [r5] + ldrb r2, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r2, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r2, r0 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r4 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + ands r0, r2 + cmp r0, 0 + bne _08131620 + ldrb r1, [r3, 0x6] + ldrb r0, [r3, 0x7] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x8] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x9] + lsls r0, 24 + orrs r1, r0 + str r1, [r5] + b _08131626 + .pool +_08131620: + adds r0, r3, 0 + adds r0, 0xA + str r0, [r5] +_08131626: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end tai0C_unk + + thumb_func_start tai0D_unk +tai0D_unk: @ 813162C + push {r4,r5,lr} + ldr r0, =0x0203ab38 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r5, r0, 0 + cmp r1, 0x1 + bne _08131648 + ldr r0, =0x0203ab3c + b _0813164A + .pool +_08131648: + ldr r0, =0x0202420c +_0813164A: + ldrb r4, [r0] + ldr r3, [r5] + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + ldr r2, =0x020242ac + lsls r0, r4, 2 + adds r0, r2 + ldr r0, [r0] + ands r0, r1 + cmp r0, 0 + beq _08131690 + ldrb r1, [r3, 0x6] + ldrb r0, [r3, 0x7] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x8] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x9] + lsls r0, 24 + orrs r1, r0 + str r1, [r5] + b _08131696 + .pool +_08131690: + adds r0, r3, 0 + adds r0, 0xA + str r0, [r5] +_08131696: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end tai0D_unk + + thumb_func_start tai0E_unk +tai0E_unk: @ 813169C + push {r4,r5,lr} + ldr r0, =0x0203ab38 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r5, r0, 0 + cmp r1, 0x1 + bne _081316B8 + ldr r0, =0x0203ab3c + b _081316BA + .pool +_081316B8: + ldr r0, =0x0202420c +_081316BA: + ldrb r4, [r0] + ldr r3, [r5] + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + ldr r2, =0x020242ac + lsls r0, r4, 2 + adds r0, r2 + ldr r0, [r0] + ands r0, r1 + cmp r0, 0 + bne _08131700 + ldrb r1, [r3, 0x6] + ldrb r0, [r3, 0x7] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x8] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x9] + lsls r0, 24 + orrs r1, r0 + str r1, [r5] + b _08131706 + .pool +_08131700: + adds r0, r3, 0 + adds r0, 0xA + str r0, [r5] +_08131706: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end tai0E_unk + + thumb_func_start tai0F_unk +tai0F_unk: @ 813170C + push {r4,lr} + ldr r0, =0x0203ab38 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bne _08131724 + ldr r0, =0x0203ab3c + b _08131726 + .pool +_08131724: + ldr r0, =0x0202420c +_08131726: + ldrb r0, [r0] + bl battle_get_per_side_status + movs r2, 0x1 + ands r2, r0 + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + ldr r0, =0x0202428e + lsls r2, 1 + adds r2, r0 + ldrh r0, [r2] + ands r0, r1 + cmp r0, 0 + beq _0813177C + ldrb r1, [r3, 0x6] + ldrb r0, [r3, 0x7] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x8] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x9] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08131782 + .pool +_0813177C: + adds r0, r3, 0 + adds r0, 0xA + str r0, [r4] +_08131782: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai0F_unk + + thumb_func_start tai10_unk +tai10_unk: @ 8131788 + push {r4,lr} + ldr r0, =0x0203ab38 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bne _081317A0 + ldr r0, =0x0203ab3c + b _081317A2 + .pool +_081317A0: + ldr r0, =0x0202420c +_081317A2: + ldrb r0, [r0] + bl battle_get_per_side_status + movs r2, 0x1 + ands r2, r0 + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + ldr r0, =0x0202428e + lsls r2, 1 + adds r2, r0 + ldrh r0, [r2] + ands r0, r1 + cmp r0, 0 + bne _081317F8 + ldrb r1, [r3, 0x6] + ldrb r0, [r3, 0x7] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x8] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x9] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _081317FE + .pool +_081317F8: + adds r0, r3, 0 + adds r0, 0xA + str r0, [r4] +_081317FE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai10_unk + + thumb_func_start tai11_unk +tai11_unk: @ 8131804 + push {lr} + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldr r0, [r0, 0x8] + ldrb r1, [r2, 0x1] + cmp r0, r1 + bcs _08131838 + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0813183C + .pool +_08131838: + adds r0, r2, 0x6 + str r0, [r3] +_0813183C: + pop {r0} + bx r0 + thumb_func_end tai11_unk + + thumb_func_start tai12_unk +tai12_unk: @ 8131840 + push {lr} + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldr r0, [r0, 0x8] + ldrb r1, [r2, 0x1] + cmp r0, r1 + bls _08131874 + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08131878 + .pool +_08131874: + adds r0, r2, 0x6 + str r0, [r3] +_08131878: + pop {r0} + bx r0 + thumb_func_end tai12_unk + + thumb_func_start tai13_unk +tai13_unk: @ 813187C + push {lr} + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldr r0, [r0, 0x8] + ldrb r1, [r2, 0x1] + cmp r0, r1 + bne _081318B0 + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081318B4 + .pool +_081318B0: + adds r0, r2, 0x6 + str r0, [r3] +_081318B4: + pop {r0} + bx r0 + thumb_func_end tai13_unk + + thumb_func_start tai14_unk +tai14_unk: @ 81318B8 + push {lr} + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldr r0, [r0, 0x8] + ldrb r1, [r2, 0x1] + cmp r0, r1 + beq _081318EC + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081318F0 + .pool +_081318EC: + adds r0, r2, 0x6 + str r0, [r3] +_081318F0: + pop {r0} + bx r0 + thumb_func_end tai14_unk + + thumb_func_start tai15_unk +tai15_unk: @ 81318F4 + push {lr} + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r0, [r0, 0x8] + ldrb r1, [r1] + cmp r0, r1 + bcs _0813193C + ldrb r1, [r2, 0x5] + ldrb r0, [r2, 0x6] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x8] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08131942 + .pool +_0813193C: + adds r0, r2, 0 + adds r0, 0x9 + str r0, [r3] +_08131942: + pop {r0} + bx r0 + thumb_func_end tai15_unk + + thumb_func_start tai16_unk +tai16_unk: @ 8131948 + push {lr} + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r0, [r0, 0x8] + ldrb r1, [r1] + cmp r0, r1 + bls _08131990 + ldrb r1, [r2, 0x5] + ldrb r0, [r2, 0x6] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x8] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08131996 + .pool +_08131990: + adds r0, r2, 0 + adds r0, 0x9 + str r0, [r3] +_08131996: + pop {r0} + bx r0 + thumb_func_end tai16_unk + + thumb_func_start tai17_unk +tai17_unk: @ 813199C + push {lr} + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r0, [r0, 0x8] + ldrb r1, [r1] + cmp r0, r1 + bne _081319E4 + ldrb r1, [r2, 0x5] + ldrb r0, [r2, 0x6] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x8] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081319EA + .pool +_081319E4: + adds r0, r2, 0 + adds r0, 0x9 + str r0, [r3] +_081319EA: + pop {r0} + bx r0 + thumb_func_end tai17_unk + + thumb_func_start tai18_unk +tai18_unk: @ 81319F0 + push {lr} + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r0, [r0, 0x8] + ldrb r1, [r1] + cmp r0, r1 + beq _08131A38 + ldrb r1, [r2, 0x5] + ldrb r0, [r2, 0x6] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x8] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08131A3E + .pool +_08131A38: + adds r0, r2, 0 + adds r0, 0x9 + str r0, [r3] +_08131A3E: + pop {r0} + bx r0 + thumb_func_end tai18_unk + + thumb_func_start tai19_unk +tai19_unk: @ 8131A44 + push {lr} + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldrh r0, [r0, 0x2] + cmp r0, r1 + bne _08131A80 + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08131A84 + .pool +_08131A80: + adds r0, r2, 0x7 + str r0, [r3] +_08131A84: + pop {r0} + bx r0 + thumb_func_end tai19_unk + + thumb_func_start tai1A_unk +tai1A_unk: @ 8131A88 + push {lr} + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldrh r0, [r0, 0x2] + cmp r0, r1 + beq _08131AC4 + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08131AC8 + .pool +_08131AC4: + adds r0, r2, 0x7 + str r0, [r3] +_08131AC8: + pop {r0} + bx r0 + thumb_func_end tai1A_unk + + thumb_func_start tai1B_unk +tai1B_unk: @ 8131ACC + push {r4,lr} + ldr r2, =0x0203ab38 + ldr r1, [r2] + ldrb r3, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + orrs r3, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + orrs r3, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + orrs r3, r0 + ldrb r0, [r3] + cmp r0, 0xFF + beq _08131B28 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r1, [r0, 0x8] + adds r4, r2, 0 +_08131AF6: + ldrb r0, [r3] + cmp r1, r0 + bne _08131B20 + ldr r2, [r4] + ldrb r1, [r2, 0x5] + ldrb r0, [r2, 0x6] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x8] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08131B2E + .pool +_08131B20: + adds r3, 0x1 + ldrb r0, [r3] + cmp r0, 0xFF + bne _08131AF6 +_08131B28: + ldr r0, [r2] + adds r0, 0x9 + str r0, [r2] +_08131B2E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai1B_unk + + thumb_func_start tai1C_unk +tai1C_unk: @ 8131B34 + push {r4,lr} + ldr r2, =0x0203ab38 + ldr r1, [r2] + ldrb r3, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + orrs r3, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + orrs r3, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + orrs r3, r0 + ldrb r0, [r3] + adds r4, r2, 0 + cmp r0, 0xFF + beq _08131B80 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r2, [r0, 0x8] + adds r1, r4, 0 +_08131B60: + ldrb r0, [r3] + cmp r2, r0 + bne _08131B78 + ldr r0, [r1] + adds r0, 0x9 + str r0, [r1] + b _08131B98 + .pool +_08131B78: + adds r3, 0x1 + ldrb r0, [r3] + cmp r0, 0xFF + bne _08131B60 +_08131B80: + ldr r2, [r4] + ldrb r1, [r2, 0x5] + ldrb r0, [r2, 0x6] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x8] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] +_08131B98: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai1C_unk + + thumb_func_start tai1D_unk +tai1D_unk: @ 8131BA0 + push {r4,r5,lr} + ldr r2, =0x0203ab38 + ldr r1, [r2] + ldrb r3, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + orrs r3, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + orrs r3, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + orrs r3, r0 + ldrh r0, [r3] + ldr r5, =0x0000ffff + cmp r0, r5 + beq _08131C00 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r1, [r0, 0x8] + adds r4, r2, 0 +_08131BCC: + ldrh r0, [r3] + cmp r1, r0 + bne _08131BF8 + ldr r2, [r4] + ldrb r1, [r2, 0x5] + ldrb r0, [r2, 0x6] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x8] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08131C06 + .pool +_08131BF8: + adds r3, 0x2 + ldrh r0, [r3] + cmp r0, r5 + bne _08131BCC +_08131C00: + ldr r0, [r2] + adds r0, 0x9 + str r0, [r2] +_08131C06: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end tai1D_unk + + thumb_func_start tai1E_unk +tai1E_unk: @ 8131C0C + push {r4,r5,lr} + ldr r2, =0x0203ab38 + ldr r1, [r2] + ldrb r3, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + orrs r3, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + orrs r3, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + orrs r3, r0 + ldrh r0, [r3] + ldr r4, =0x0000ffff + adds r5, r2, 0 + cmp r0, r4 + beq _08131C5C + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r2, [r0, 0x8] + adds r1, r5, 0 +_08131C3A: + ldrh r0, [r3] + cmp r2, r0 + bne _08131C54 + ldr r0, [r1] + adds r0, 0x9 + str r0, [r1] + b _08131C74 + .pool +_08131C54: + adds r3, 0x2 + ldrh r0, [r3] + cmp r0, r4 + bne _08131C3A +_08131C5C: + ldr r2, [r5] + ldrb r1, [r2, 0x5] + ldrb r0, [r2, 0x6] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x8] + lsls r0, 24 + orrs r1, r0 + str r1, [r5] +_08131C74: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end tai1E_unk + + thumb_func_start tai1F_unk +tai1F_unk: @ 8131C7C + push {r4,r5,lr} + movs r3, 0 + ldr r4, =0x0203ab38 + ldr r1, =0x02024084 + ldr r0, =0x0203ab3c + ldrb r2, [r0] + ldr r5, =gBattleMoves + movs r0, 0x58 + muls r0, r2 + adds r1, 0xC + adds r2, r0, r1 +_08131C92: + ldrh r0, [r2] + cmp r0, 0 + beq _08131CA6 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _08131CAE +_08131CA6: + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _08131C92 +_08131CAE: + cmp r3, 0x4 + bne _08131CCC + ldr r0, [r4] + adds r0, 0x5 + str r0, [r4] + b _08131CE4 + .pool +_08131CCC: + ldr r2, [r4] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] +_08131CE4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end tai1F_unk + + thumb_func_start tai20_unk +tai20_unk: @ 8131CEC + push {r4,r5,lr} + movs r3, 0 + ldr r4, =0x0203ab38 + ldr r1, =0x02024084 + ldr r0, =0x0203ab3c + ldrb r2, [r0] + ldr r5, =gBattleMoves + movs r0, 0x58 + muls r0, r2 + adds r1, 0xC + adds r2, r0, r1 +_08131D02: + ldrh r0, [r2] + cmp r0, 0 + beq _08131D16 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _08131D1E +_08131D16: + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _08131D02 +_08131D1E: + cmp r3, 0x4 + beq _08131D3C + ldr r0, [r4] + adds r0, 0x5 + str r0, [r4] + b _08131D54 + .pool +_08131D3C: + ldr r2, [r4] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] +_08131D54: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end tai20_unk + + thumb_func_start tai21_unk +tai21_unk: @ 8131D5C + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x14] + ldr r0, =0x03005d10 + ldrb r0, [r0, 0x13] + str r0, [r1, 0x8] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end tai21_unk + + thumb_func_start dp15_get_some_type +dp15_get_some_type: @ 8131D80 + push {r4,lr} + ldr r1, =0x0203ab38 + ldr r0, [r1] + ldrb r0, [r0, 0x1] + adds r4, r1, 0 + cmp r0, 0x4 + bhi _08131E5A + lsls r0, 2 + ldr r1, =_08131DA0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08131DA0: + .4byte _08131DD8 + .4byte _08131DB4 + .4byte _08131E20 + .4byte _08131DFC + .4byte _08131E44 +_08131DB4: + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r3, [r0, 0x14] + ldr r2, =0x02024084 + ldr r0, =0x0203ab3c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x21 + ldrb r0, [r0] + b _08131E58 + .pool +_08131DD8: + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r3, [r0, 0x14] + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x21 + ldrb r0, [r0] + b _08131E58 + .pool +_08131DFC: + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r3, [r0, 0x14] + ldr r2, =0x02024084 + ldr r0, =0x0203ab3c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x22 + ldrb r0, [r0] + b _08131E58 + .pool +_08131E20: + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r3, [r0, 0x14] + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x22 + ldrb r0, [r0] + b _08131E58 + .pool +_08131E44: + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r3, [r0, 0x14] + ldr r2, =gBattleMoves + ldrh r1, [r3, 0x2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x2] +_08131E58: + str r0, [r3, 0x8] +_08131E5A: + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp15_get_some_type + + thumb_func_start sub_8131E70 +sub_8131E70: @ 8131E70 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08131E84 + ldr r0, =0x0203ab3c + ldrb r0, [r0] + b _08131EAC + .pool +_08131E84: + cmp r0, 0x1 + ble _08131E90 + cmp r0, 0x2 + beq _08131EA4 + cmp r0, 0x3 + beq _08131E9C +_08131E90: + ldr r0, =0x0202420c + ldrb r0, [r0] + b _08131EAC + .pool +_08131E9C: + ldr r0, =0x0203ab3c + b _08131EA6 + .pool +_08131EA4: + ldr r0, =0x0202420c +_08131EA6: + ldrb r1, [r0] + movs r0, 0x2 + eors r0, r1 +_08131EAC: + pop {r1} + bx r1 + .pool + thumb_func_end sub_8131E70 + + thumb_func_start tai5F_unk +tai5F_unk: @ 8131EB4 + push {r4,lr} + ldr r4, =0x0203ab38 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl sub_8131E70 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02024084 + movs r1, 0x58 + muls r0, r1 + adds r3, r0, r2 + adds r1, r3, 0 + adds r1, 0x21 + ldr r0, [r4] + ldrb r1, [r1] + ldrb r2, [r0, 0x2] + cmp r1, r2 + beq _08131EE4 + adds r0, r3, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, r2 + bne _08131EFC +_08131EE4: + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0x1 + b _08131F04 + .pool +_08131EFC: + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0 +_08131F04: + str r0, [r1, 0x8] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x3 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end tai5F_unk + + thumb_func_start dp15_move_get_power__2_8 +dp15_move_get_power__2_8: @ 8131F1C + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r3, [r0, 0x14] + ldr r2, =gBattleMoves + ldrh r1, [r3, 0x2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + str r0, [r3, 0x8] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end dp15_move_get_power__2_8 + + thumb_func_start dp15_is_most_powerful_move__8 +dp15_is_most_powerful_move__8: @ 8131F48 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + movs r3, 0 + ldr r0, =gUnknown_085B09C8 + ldrh r1, [r0] + ldr r5, =0x0000ffff + ldr r6, =gBattleMoves + ldr r2, =0x020244a8 + cmp r1, r5 + beq _08131F86 + ldr r0, [r2] + ldr r0, [r0, 0x14] + ldrh r1, [r0, 0x2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r4, [r0] + ldr r1, =gUnknown_085B09C8 +_08131F76: + ldrh r0, [r1] + cmp r4, r0 + beq _08131F86 + adds r1, 0x2 + adds r3, 0x1 + ldrh r0, [r1] + cmp r0, r5 + bne _08131F76 +_08131F86: + ldr r0, [r2] + ldr r0, [r0, 0x14] + ldrh r1, [r0, 0x2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bhi _08131F9C + b _08132126 +_08131F9C: + lsls r0, r3, 1 + ldr r1, =gUnknown_085B09C8 + adds r0, r1 + ldrh r3, [r0] + ldr r0, =0x0000ffff + cmp r3, r0 + beq _08131FAC + b _08132126 +_08131FAC: + ldr r0, =0x02024400 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x0202449c + ldr r0, [r0] + strb r1, [r0, 0x13] + ldr r0, =0x02024474 + movs r2, 0x1 + strb r2, [r0, 0xE] + ldr r0, =0x0202427c + strb r1, [r0] + ldr r0, =0x02024211 + strb r2, [r0] + movs r6, 0 + mov r9, r3 + ldr r2, =gUnknown_085B09C8 + ldrh r2, [r2] + str r2, [sp, 0x10] +_08131FD0: + movs r3, 0 + ldr r5, =0x02024084 + lsls r4, r6, 1 + ldr r7, =0x0203ab3c + lsls r0, r6, 2 + mov r8, r0 + adds r1, r6, 0x1 + mov r10, r1 + ldr r2, [sp, 0x10] + cmp r2, r9 + beq _08132014 + ldr r2, =gBattleMoves + ldrb r1, [r7] + movs r0, 0x58 + muls r0, r1 + adds r0, r4, r0 + adds r1, r5, 0 + adds r1, 0xC + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r2, [r0] + ldr r1, =gUnknown_085B09C8 +_08132004: + ldrh r0, [r1] + cmp r2, r0 + beq _08132014 + adds r1, 0x2 + adds r3, 0x1 + ldrh r0, [r1] + cmp r0, r9 + bne _08132004 +_08132014: + ldrb r1, [r7] + movs r0, 0x58 + muls r0, r1 + adds r0, r4, r0 + adds r1, r5, 0 + adds r1, 0xC + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, 0 + beq _081320C0 + lsls r0, r3, 1 + ldr r2, =gUnknown_085B09C8 + adds r0, r2 + ldrh r0, [r0] + cmp r0, r9 + bne _081320C0 + ldr r0, =gBattleMoves + ldrh r2, [r1] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + cmp r0, 0x1 + bls _081320C0 + ldr r5, =0x020241ea + strh r2, [r5] + ldrb r0, [r7] + ldr r4, =0x0202420c + ldrb r1, [r4] + bl sub_8046E7C + ldrh r0, [r5] + ldrb r1, [r7] + ldrb r2, [r4] + bl move_effectiveness_something + mov r4, sp + add r4, r8 + ldr r2, =0x020241f0 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x14] + adds r0, 0x18 + adds r0, r6 + ldrb r1, [r0] + ldr r0, [r2] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + str r0, [r4] + cmp r0, 0 + bne _081320C8 + movs r0, 0x1 + str r0, [r4] + b _081320C8 + .pool +_081320C0: + mov r1, sp + add r1, r8 + movs r0, 0 + str r0, [r1] +_081320C8: + mov r6, r10 + cmp r6, 0x3 + bgt _081320D0 + b _08131FD0 +_081320D0: + movs r6, 0 + ldr r2, =0x020244a8 + ldr r0, [r2] + ldr r0, [r0, 0x14] + ldrb r0, [r0, 0x1] + lsls r0, 2 + add r0, sp + ldr r1, [sp] + ldr r0, [r0] + ldr r5, =0x0203ab38 + cmp r1, r0 + bgt _08132106 + adds r4, r2, 0 + mov r3, sp +_081320EC: + adds r3, 0x4 + adds r6, 0x1 + cmp r6, 0x3 + bgt _08132106 + ldr r0, [r4] + ldr r0, [r0, 0x14] + ldrb r0, [r0, 0x1] + lsls r0, 2 + add r0, sp + ldr r1, [r3] + ldr r0, [r0] + cmp r1, r0 + ble _081320EC +_08132106: + cmp r6, 0x4 + bne _0813211C + ldr r0, [r2] + ldr r1, [r0, 0x14] + movs r0, 0x2 + str r0, [r1, 0x8] + b _08132130 + .pool +_0813211C: + ldr r0, [r2] + ldr r1, [r0, 0x14] + movs r0, 0x1 + str r0, [r1, 0x8] + b _08132130 +_08132126: + ldr r0, [r2] + ldr r1, [r0, 0x14] + movs r0, 0 + str r0, [r1, 0x8] + ldr r5, =0x0203ab38 +_08132130: + ldr r0, [r5] + adds r0, 0x1 + str r0, [r5] + 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 dp15_is_most_powerful_move__8 + + thumb_func_start dp15_get_move_to_execute_B +dp15_get_move_to_execute_B: @ 813214C + push {lr} + ldr r0, =0x0203ab38 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r3, r0, 0 + cmp r1, 0x1 + bne _08132178 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldr r1, =0x02024248 + ldr r0, =0x0203ab3c + b _08132182 + .pool +_08132178: + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldr r1, =0x02024248 + ldr r0, =0x0202420c +_08132182: + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + str r0, [r2, 0x8] + ldr r0, [r3] + adds r0, 0x2 + str r0, [r3] + pop {r0} + bx r0 + .pool + thumb_func_end dp15_get_move_to_execute_B + + thumb_func_start tai26_unk +tai26_unk: @ 81321A4 + push {lr} + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r0, [r0, 0x8] + cmp r1, r0 + bne _081321D8 + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081321DC + .pool +_081321D8: + adds r0, r2, 0x6 + str r0, [r3] +_081321DC: + pop {r0} + bx r0 + thumb_func_end tai26_unk + + thumb_func_start tai27_unk +tai27_unk: @ 81321E0 + push {lr} + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r0, [r0, 0x8] + cmp r1, r0 + beq _08132214 + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08132218 + .pool +_08132214: + adds r0, r2, 0x6 + str r0, [r3] +_08132218: + pop {r0} + bx r0 + thumb_func_end tai27_unk + + thumb_func_start tai28_unk +tai28_unk: @ 813221C + push {lr} + ldr r0, =0x0203ab3c + ldrb r0, [r0] + ldr r1, =0x0202420c + ldrb r1, [r1] + movs r2, 0x1 + bl b_first_side + ldr r3, =0x0203ab38 + ldr r2, [r3] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r2, 0x1] + cmp r0, r1 + bne _08132260 + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08132264 + .pool +_08132260: + adds r0, r2, 0x6 + str r0, [r3] +_08132264: + pop {r0} + bx r0 + thumb_func_end tai28_unk + + thumb_func_start tai29_unk +tai29_unk: @ 8132268 + push {lr} + ldr r0, =0x0203ab3c + ldrb r0, [r0] + ldr r1, =0x0202420c + ldrb r1, [r1] + movs r2, 0x1 + bl b_first_side + ldr r3, =0x0203ab38 + ldr r2, [r3] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r2, 0x1] + cmp r0, r1 + beq _081322AC + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081322B0 + .pool +_081322AC: + adds r0, r2, 0x6 + str r0, [r3] +_081322B0: + pop {r0} + bx r0 + thumb_func_end tai29_unk + + thumb_func_start nullsub_102 +nullsub_102: @ 81322B4 + bx lr + thumb_func_end nullsub_102 + + thumb_func_start nullsub_103 +nullsub_103: @ 81322B8 + bx lr + thumb_func_end nullsub_103 + + thumb_func_start tai2C_unk +tai2C_unk: @ 81322BC + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0 + str r0, [r1, 0x8] + ldr r0, =0x0203ab38 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bne _081322E8 + ldr r0, =0x0203ab3c + b _081322EA + .pool +_081322E8: + ldr r0, =0x0202420c +_081322EA: + ldrb r5, [r0] + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x02024744 + mov r8, r1 + cmp r0, 0 + bne _08132300 + ldr r0, =0x020244ec + mov r8, r0 +_08132300: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08132344 + ldr r4, =0x0202406e + lsls r0, r5, 1 + adds r0, r4 + ldrb r7, [r0] + adds r0, r5, 0 + bl battle_get_per_side_status + movs r1, 0x2 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 23 + adds r0, r4 + ldrb r6, [r0] + b _0813234E + .pool +_08132344: + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r0, r1 + ldrb r6, [r0] + adds r7, r6, 0 +_0813234E: + movs r5, 0 +_08132350: + cmp r5, r7 + beq _08132394 + cmp r5, r6 + beq _08132394 + movs r0, 0x64 + muls r0, r5 + mov r1, r8 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08132394 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _08132394 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _08132394 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x14] + ldr r0, [r1, 0x8] + adds r0, 0x1 + str r0, [r1, 0x8] +_08132394: + adds r5, 0x1 + cmp r5, 0x5 + ble _08132350 + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end tai2C_unk + + thumb_func_start dp15_get_move_id__8 +dp15_get_move_id__8: @ 81323B8 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x14] + ldrh r0, [r1, 0x2] + str r0, [r1, 0x8] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end dp15_get_move_id__8 + + thumb_func_start dp15_move_get_move_script_id +dp15_move_get_move_script_id: @ 81323D4 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r3, [r0, 0x14] + ldr r2, =gBattleMoves + ldrh r1, [r3, 0x2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + str r0, [r3, 0x8] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end dp15_move_get_move_script_id + + thumb_func_start tai2F_unk +tai2F_unk: @ 8132400 + push {r4-r7,lr} + ldr r0, =0x0203ab38 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + mov r12, r0 + cmp r1, 0x1 + bne _0813241C + ldr r0, =0x0203ab3c + b _0813241E + .pool +_0813241C: + ldr r0, =0x0202420c +_0813241E: + ldrb r3, [r0] + ldr r0, =0x02024064 + ldrb r0, [r0] + cmp r0, r3 + beq _081324F0 + ldr r7, =0x020244a8 + ldr r5, [r7] + ldr r0, [r5, 0x18] + adds r0, 0x40 + adds r2, r0, r3 + ldrb r0, [r2] + adds r6, r7, 0 + cmp r0, 0 + beq _0813244C + ldr r1, [r5, 0x14] + str r0, [r1, 0x8] + b _08132504 + .pool +_0813244C: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r3 + adds r4, r0, r1 + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x17 + beq _08132468 + cmp r0, 0x2A + beq _08132468 + cmp r0, 0x47 + bne _08132480 +_08132468: + ldr r0, [r6] + ldr r1, [r0, 0x14] + movs r0, 0x58 + muls r0, r3 + adds r0, r2 + adds r0, 0x20 + ldrb r0, [r0] + str r0, [r1, 0x8] + b _08132504 + .pool +_08132480: + ldr r6, =gBaseStats + ldrh r0, [r4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r2, r1, r6 + ldrb r0, [r2, 0x16] + cmp r0, 0 + beq _081324E8 + ldrb r0, [r2, 0x17] + cmp r0, 0 + beq _081324E0 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _081324C4 + ldr r0, [r7] + ldr r2, [r0, 0x14] + ldrh r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x16] + str r0, [r2, 0x8] + ldr r0, =0x0203ab38 + mov r12, r0 + b _08132504 + .pool +_081324C4: + ldr r0, [r7] + ldr r2, [r0, 0x14] + ldrh r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x17] + str r0, [r2, 0x8] + ldr r1, =0x0203ab38 + mov r12, r1 + b _08132504 + .pool +_081324E0: + ldr r1, [r5, 0x14] + ldrb r0, [r2, 0x16] + str r0, [r1, 0x8] + b _08132504 +_081324E8: + ldr r1, [r5, 0x14] + ldrb r0, [r2, 0x17] + str r0, [r1, 0x8] + b _08132504 +_081324F0: + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r3 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + str r0, [r2, 0x8] +_08132504: + mov r1, r12 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end tai2F_unk + + thumb_func_start tai60_unk +tai60_unk: @ 813251C + push {r4-r6,lr} + ldr r4, =0x0203ab38 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl sub_8131E70 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r4] + ldrb r3, [r0, 0x2] + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _0813253A + cmp r0, 0x2 + bne _081325BC +_0813253A: + ldr r0, =0x020244a8 + ldr r4, [r0] + ldr r1, [r4, 0x18] + adds r1, 0x40 + adds r2, r1, r5 + ldrb r1, [r2] + adds r6, r0, 0 + cmp r1, 0 + beq _0813255C + adds r3, r1, 0 + ldr r0, [r4, 0x14] + str r3, [r0, 0x8] + b _081325CA + .pool +_0813255C: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r5 + adds r4, r0, r1 + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x17 + beq _08132576 + cmp r0, 0x2A + beq _08132576 + cmp r0, 0x47 + bne _08132588 +_08132576: + movs r0, 0x58 + muls r0, r5 + adds r0, r1 + adds r0, 0x20 + ldrb r3, [r0] + b _081325CA + .pool +_08132588: + ldr r2, =gBaseStats + ldrh r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r1, r0, r2 + ldrb r4, [r1, 0x16] + cmp r4, 0 + beq _081325B8 + ldrb r2, [r1, 0x17] + cmp r2, 0 + beq _081325B4 + adds r0, r3, 0 + cmp r4, r0 + beq _081325CE + cmp r2, r0 + beq _081325CE + adds r3, r4, 0 + b _081325CA + .pool +_081325B4: + ldrb r3, [r1, 0x16] + b _081325CA +_081325B8: + ldrb r3, [r1, 0x17] + b _081325CA +_081325BC: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r5 + adds r0, r1 + adds r0, 0x20 + ldrb r3, [r0] + ldr r6, =0x020244a8 +_081325CA: + cmp r3, 0 + bne _081325E8 +_081325CE: + ldr r0, [r6] + ldr r1, [r0, 0x14] + movs r0, 0x2 + str r0, [r1, 0x8] + ldr r2, =0x0203ab38 + b _08132608 + .pool +_081325E8: + ldr r0, =0x0203ab38 + ldr r1, [r0] + adds r2, r0, 0 + ldrb r1, [r1, 0x2] + cmp r3, r1 + bne _08132600 + ldr r0, [r6] + ldr r1, [r0, 0x14] + movs r0, 0x1 + b _08132606 + .pool +_08132600: + ldr r0, [r6] + ldr r1, [r0, 0x14] + movs r0, 0 +_08132606: + str r0, [r1, 0x8] +_08132608: + ldr r0, [r2] + adds r0, 0x3 + str r0, [r2] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end tai60_unk + + thumb_func_start tai30_unk +tai30_unk: @ 8132614 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x02024400 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x0202449c + ldr r0, [r0] + strb r1, [r0, 0x13] + ldr r0, =0x02024474 + movs r3, 0 + movs r2, 0x1 + strb r2, [r0, 0xE] + ldr r0, =0x0202427c + strb r1, [r0] + ldr r0, =0x02024211 + strb r2, [r0] + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x14] + str r3, [r0, 0x8] + movs r5, 0 + ldr r4, =0x020241f0 + ldr r7, =0x020241ea + ldr r0, =0x02024090 + mov r8, r0 + ldr r6, =0x0203ab3c +_0813264A: + movs r0, 0x28 + str r0, [r4] + lsls r1, r5, 1 + ldrb r2, [r6] + movs r0, 0x58 + muls r0, r2 + adds r1, r0 + add r1, r8 + ldrh r0, [r1] + strh r0, [r7] + lsls r0, 16 + cmp r0, 0 + beq _081326B8 + ldrh r0, [r7] + ldrb r1, [r6] + ldr r2, =0x0202420c + ldrb r2, [r2] + bl move_effectiveness_something + ldr r0, [r4] + cmp r0, 0x78 + bne _0813267A + movs r0, 0x50 + str r0, [r4] +_0813267A: + ldr r0, [r4] + cmp r0, 0xF0 + bne _08132684 + movs r0, 0xA0 + str r0, [r4] +_08132684: + ldr r0, [r4] + cmp r0, 0x1E + bne _0813268E + movs r0, 0x14 + str r0, [r4] +_0813268E: + ldr r0, [r4] + cmp r0, 0xF + bne _08132698 + movs r0, 0xA + str r0, [r4] +_08132698: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _081326A8 + movs r0, 0 + str r0, [r4] +_081326A8: + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldr r0, [r2, 0x8] + ldr r1, [r4] + cmp r0, r1 + bcs _081326B8 + str r1, [r2, 0x8] +_081326B8: + adds r5, 0x1 + cmp r5, 0x3 + ble _0813264A + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end tai30_unk + + thumb_func_start dp15_simulate_damage_bonus_jump_if_eq +dp15_simulate_damage_bonus_jump_if_eq: @ 8132700 + push {r4,r5,lr} + ldr r0, =0x02024400 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x0202449c + ldr r0, [r0] + strb r1, [r0, 0x13] + ldr r0, =0x02024474 + movs r2, 0x1 + strb r2, [r0, 0xE] + ldr r5, =0x0202427c + strb r1, [r5] + ldr r0, =0x02024211 + strb r2, [r0] + ldr r4, =0x020241f0 + movs r0, 0x28 + str r0, [r4] + ldr r1, =0x020241ea + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldrh r0, [r0, 0x2] + strh r0, [r1] + ldrh r0, [r1] + ldr r1, =0x0203ab3c + ldrb r1, [r1] + ldr r2, =0x0202420c + ldrb r2, [r2] + bl move_effectiveness_something + ldr r0, [r4] + cmp r0, 0x78 + bne _08132746 + movs r0, 0x50 + str r0, [r4] +_08132746: + ldr r0, [r4] + cmp r0, 0xF0 + bne _08132750 + movs r0, 0xA0 + str r0, [r4] +_08132750: + ldr r0, [r4] + cmp r0, 0x1E + bne _0813275A + movs r0, 0x14 + str r0, [r4] +_0813275A: + ldr r0, [r4] + cmp r0, 0xF + bne _08132764 + movs r0, 0xA + str r0, [r4] +_08132764: + ldrb r1, [r5] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08132772 + movs r0, 0 + str r0, [r4] +_08132772: + ldrb r0, [r4] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + cmp r0, r1 + bne _081327C4 + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081327C8 + .pool +_081327C4: + adds r0, r2, 0x6 + str r0, [r3] +_081327C8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end dp15_simulate_damage_bonus_jump_if_eq + + thumb_func_start nullsub_104 +nullsub_104: @ 81327D0 + bx lr + thumb_func_end nullsub_104 + + thumb_func_start nullsub_105 +nullsub_105: @ 81327D4 + bx lr + thumb_func_end nullsub_105 + + thumb_func_start tai34_unk +tai34_unk: @ 81327D8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x0203ab38 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bne _08132818 + ldr r0, =0x0203ab3c + b _0813281A + .pool +_081327F8: + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2, 0x6] + ldrb r0, [r2, 0x7] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x8] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x9] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0813289A + .pool +_08132818: + ldr r0, =0x0202420c +_0813281A: + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x02024744 + mov r9, r1 + cmp r0, 0 + bne _0813282E + ldr r0, =0x020244ec + mov r9, r0 +_0813282E: + ldr r0, =0x0203ab38 + ldr r1, [r0] + ldrb r7, [r1, 0x2] + ldrb r0, [r1, 0x3] + lsls r0, 8 + orrs r7, r0 + ldrb r0, [r1, 0x4] + lsls r0, 16 + orrs r7, r0 + ldrb r0, [r1, 0x5] + lsls r0, 24 + orrs r7, r0 + movs r1, 0 + mov r8, r1 + movs r0, 0xCE + lsls r0, 1 + mov r10, r0 +_08132850: + movs r0, 0x64 + mov r4, r8 + muls r4, r0 + add r4, r9 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + cmp r5, 0 + beq _08132888 + cmp r5, r10 + beq _08132888 + cmp r6, 0 + beq _08132888 + cmp r0, r7 + beq _081327F8 +_08132888: + movs r1, 0x1 + add r8, r1 + mov r0, r8 + cmp r0, 0x5 + ble _08132850 + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0xA + str r0, [r1] +_0813289A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end tai34_unk + + thumb_func_start tai35_unk +tai35_unk: @ 81328B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x0203ab38 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bne _081328D8 + ldr r0, =0x0203ab3c + b _081328DA + .pool +_081328D8: + ldr r0, =0x0202420c +_081328DA: + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x02024744 + mov r10, r1 + cmp r0, 0 + bne _081328EE + ldr r0, =0x020244ec + mov r10, r0 +_081328EE: + ldr r2, =0x0203ab38 + ldr r1, [r2] + ldrb r7, [r1, 0x2] + ldrb r0, [r1, 0x3] + lsls r0, 8 + orrs r7, r0 + ldrb r0, [r1, 0x4] + lsls r0, 16 + orrs r7, r0 + ldrb r0, [r1, 0x5] + lsls r0, 24 + orrs r7, r0 + movs r1, 0 + mov r8, r1 + mov r9, r2 +_0813290C: + movs r0, 0x64 + mov r4, r8 + muls r4, r0 + add r4, r10 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + cmp r5, 0 + beq _08132950 + movs r1, 0xCE + lsls r1, 1 + cmp r5, r1 + beq _08132950 + cmp r6, 0 + beq _08132950 + cmp r0, r7 + bne _08132950 + mov r1, r9 + ldr r0, [r1] + adds r0, 0xA + str r0, [r1] +_08132950: + movs r0, 0x1 + add r8, r0 + mov r1, r8 + cmp r1, 0x5 + ble _0813290C + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2, 0x6] + ldrb r0, [r2, 0x7] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x8] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x9] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end tai35_unk + + thumb_func_start dp15_get_weather__8 +dp15_get_weather__8: @ 8132994 + push {lr} + ldr r2, =0x020243cc + ldrh r1, [r2] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _081329AC + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0x1 + str r0, [r1, 0x8] +_081329AC: + ldrh r1, [r2] + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + beq _081329C0 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0x2 + str r0, [r1, 0x8] +_081329C0: + ldrh r1, [r2] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _081329D4 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0 + str r0, [r1, 0x8] +_081329D4: + ldrh r1, [r2] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081329E8 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0x3 + str r0, [r1, 0x8] +_081329E8: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end dp15_get_weather__8 + + thumb_func_start tai37_unk +tai37_unk: @ 8132A00 + push {lr} + ldr r2, =gBattleMoves + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldrh r1, [r0, 0x2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r0, [r0] + ldrb r1, [r2, 0x1] + cmp r0, r1 + bne _08132A44 + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08132A48 + .pool +_08132A44: + adds r0, r2, 0x6 + str r0, [r3] +_08132A48: + pop {r0} + bx r0 + thumb_func_end tai37_unk + + thumb_func_start tai38_unk +tai38_unk: @ 8132A4C + push {lr} + ldr r2, =gBattleMoves + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldrh r1, [r0, 0x2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r0, [r0] + ldrb r1, [r2, 0x1] + cmp r0, r1 + beq _08132A90 + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08132A94 + .pool +_08132A90: + adds r0, r2, 0x6 + str r0, [r3] +_08132A94: + pop {r0} + bx r0 + thumb_func_end tai38_unk + + thumb_func_start tai39_unk +tai39_unk: @ 8132A98 + push {r4,lr} + ldr r0, =0x0203ab38 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _08132AB4 + ldr r0, =0x0203ab3c + b _08132AB6 + .pool +_08132AB4: + ldr r0, =0x0202420c +_08132AB6: + ldrb r3, [r0] + ldr r1, =0x02024084 + ldr r2, [r4] + movs r0, 0x58 + muls r0, r3 + ldrb r3, [r2, 0x2] + adds r0, r3 + adds r1, 0x18 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrb r1, [r2, 0x3] + cmp r0, r1 + bge _08132AF4 + ldrb r1, [r2, 0x4] + ldrb r0, [r2, 0x5] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08132AFA + .pool +_08132AF4: + adds r0, r2, 0 + adds r0, 0x8 + str r0, [r4] +_08132AFA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai39_unk + + thumb_func_start tai3A_unk +tai3A_unk: @ 8132B00 + push {r4,lr} + ldr r0, =0x0203ab38 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _08132B1C + ldr r0, =0x0203ab3c + b _08132B1E + .pool +_08132B1C: + ldr r0, =0x0202420c +_08132B1E: + ldrb r3, [r0] + ldr r1, =0x02024084 + ldr r2, [r4] + movs r0, 0x58 + muls r0, r3 + ldrb r3, [r2, 0x2] + adds r0, r3 + adds r1, 0x18 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrb r1, [r2, 0x3] + cmp r0, r1 + ble _08132B5C + ldrb r1, [r2, 0x4] + ldrb r0, [r2, 0x5] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08132B62 + .pool +_08132B5C: + adds r0, r2, 0 + adds r0, 0x8 + str r0, [r4] +_08132B62: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai3A_unk + + thumb_func_start tai3B_unk +tai3B_unk: @ 8132B68 + push {r4,lr} + ldr r0, =0x0203ab38 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _08132B84 + ldr r0, =0x0203ab3c + b _08132B86 + .pool +_08132B84: + ldr r0, =0x0202420c +_08132B86: + ldrb r3, [r0] + ldr r1, =0x02024084 + ldr r2, [r4] + movs r0, 0x58 + muls r0, r3 + ldrb r3, [r2, 0x2] + adds r0, r3 + adds r1, 0x18 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrb r1, [r2, 0x3] + cmp r0, r1 + bne _08132BC4 + ldrb r1, [r2, 0x4] + ldrb r0, [r2, 0x5] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08132BCA + .pool +_08132BC4: + adds r0, r2, 0 + adds r0, 0x8 + str r0, [r4] +_08132BCA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai3B_unk + + thumb_func_start tai3C_unk +tai3C_unk: @ 8132BD0 + push {r4,lr} + ldr r0, =0x0203ab38 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _08132BEC + ldr r0, =0x0203ab3c + b _08132BEE + .pool +_08132BEC: + ldr r0, =0x0202420c +_08132BEE: + ldrb r3, [r0] + ldr r1, =0x02024084 + ldr r2, [r4] + movs r0, 0x58 + muls r0, r3 + ldrb r3, [r2, 0x2] + adds r0, r3 + adds r1, 0x18 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrb r1, [r2, 0x3] + cmp r0, r1 + beq _08132C2C + ldrb r1, [r2, 0x4] + ldrb r0, [r2, 0x5] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08132C32 + .pool +_08132C2C: + adds r0, r2, 0 + adds r0, 0x8 + str r0, [r4] +_08132C32: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai3C_unk + + thumb_func_start tai3D_unk +tai3D_unk: @ 8132C38 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r2, =gBattleMoves + ldr r0, =0x020244a8 + mov r8, r0 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldrh r1, [r0, 0x2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bls _08132D1C + ldr r0, =0x02024400 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x0202449c + ldr r0, [r0] + strb r1, [r0, 0x13] + ldr r0, =0x02024474 + movs r7, 0x1 + strb r7, [r0, 0xE] + ldr r0, =0x0202427c + strb r1, [r0] + ldr r0, =0x02024211 + strb r7, [r0] + ldr r5, =0x020241ea + mov r1, r8 + ldr r0, [r1] + ldr r0, [r0, 0x14] + ldrh r0, [r0, 0x2] + strh r0, [r5] + ldr r4, =0x0203ab3c + ldrb r0, [r4] + ldr r6, =0x0202420c + ldrb r1, [r6] + bl sub_8046E7C + ldrh r0, [r5] + ldrb r1, [r4] + ldrb r2, [r6] + bl move_effectiveness_something + ldr r4, =0x020241f0 + mov r1, r8 + ldr r0, [r1] + ldr r1, [r0, 0x14] + adds r0, r1, 0 + adds r0, 0x18 + ldrb r1, [r1, 0x1] + adds r0, r1 + ldrb r1, [r0] + ldr r0, [r4] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + str r0, [r4] + cmp r0, 0 + bne _08132CB8 + str r7, [r4] +_08132CB8: + ldr r2, =0x02024084 + ldrb r1, [r6] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r1, [r0, 0x28] + ldr r0, [r4] + cmp r1, r0 + bgt _08132D1C + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08132D24 + .pool +_08132D1C: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08132D24: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end tai3D_unk + + thumb_func_start dp15_determine_move_damage_jump_if_not_fatal +dp15_determine_move_damage_jump_if_not_fatal: @ 8132D34 + push {r4-r7,lr} + ldr r2, =gBattleMoves + ldr r7, =0x020244a8 + ldr r0, [r7] + ldr r0, [r0, 0x14] + ldrh r1, [r0, 0x2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bls _08132E04 + ldr r0, =0x02024400 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x0202449c + ldr r0, [r0] + strb r1, [r0, 0x13] + ldr r0, =0x02024474 + movs r2, 0x1 + strb r2, [r0, 0xE] + ldr r0, =0x0202427c + strb r1, [r0] + ldr r0, =0x02024211 + strb r2, [r0] + ldr r6, =0x020241ea + ldr r0, [r7] + ldr r0, [r0, 0x14] + ldrh r0, [r0, 0x2] + strh r0, [r6] + ldr r4, =0x0203ab3c + ldrb r0, [r4] + ldr r5, =0x0202420c + ldrb r1, [r5] + bl sub_8046E7C + ldrh r0, [r6] + ldrb r1, [r4] + ldrb r2, [r5] + bl move_effectiveness_something + ldr r4, =0x020241f0 + ldr r0, [r7] + ldr r1, [r0, 0x14] + adds r0, r1, 0 + adds r0, 0x18 + ldrb r1, [r1, 0x1] + adds r0, r1 + ldrb r1, [r0] + ldr r0, [r4] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + str r0, [r4] + ldr r3, =0x02024084 + ldrb r2, [r5] + movs r1, 0x58 + muls r1, r2 + adds r1, r3 + ldrh r1, [r1, 0x28] + cmp r1, r0 + ble _08132E04 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08132E0C + .pool +_08132E04: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08132E0C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp15_determine_move_damage_jump_if_not_fatal + + thumb_func_start tai3F_unk +tai3F_unk: @ 8132E18 + push {r4-r7,lr} + ldr r0, =0x0203ab38 + ldr r5, [r0] + adds r7, r5, 0x2 + ldrb r1, [r5, 0x1] + adds r6, r0, 0 + cmp r1, 0x1 + beq _08132E42 + cmp r1, 0x1 + bgt _08132E38 + cmp r1, 0 + beq _08132EDC + b _08132F40 + .pool +_08132E38: + cmp r1, 0x2 + beq _08132EDC + cmp r1, 0x3 + beq _08132E84 + b _08132F40 +_08132E42: + movs r4, 0 + ldr r3, =0x02024084 + ldr r2, =0x0203ab3c + ldrb r1, [r2] + movs r0, 0x58 + muls r0, r1 + adds r3, 0xC + adds r0, r3 + ldrh r0, [r0] + ldrh r5, [r5, 0x2] + cmp r0, r5 + beq _08132E74 + movs r5, 0x58 +_08132E5C: + adds r4, 0x1 + cmp r4, 0x3 + bgt _08132E74 + lsls r1, r4, 1 + ldrb r0, [r2] + muls r0, r5 + adds r1, r0 + adds r1, r3 + ldrh r0, [r1] + ldrh r1, [r7] + cmp r0, r1 + bne _08132E5C +_08132E74: + cmp r4, 0x4 + beq _08132F18 + b _08132F28 + .pool +_08132E84: + ldr r3, =0x02024084 + ldr r2, =0x0203ab3c + ldrb r1, [r2] + movs r0, 0x2 + eors r0, r1 + movs r1, 0x58 + muls r1, r0 + adds r0, r1, r3 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08132EA8 + adds r0, r5, 0 + b _08132F1A + .pool +_08132EA8: + movs r4, 0 + adds r3, 0xC + adds r0, r1, r3 + ldrh r0, [r0] + ldrh r5, [r5, 0x2] + cmp r0, r5 + beq _08132E74 + mov r12, r3 + adds r5, r2, 0 + movs r3, 0x2 +_08132EBC: + adds r4, 0x1 + cmp r4, 0x3 + bgt _08132E74 + lsls r1, r4, 1 + ldrb r0, [r5] + adds r2, r3, 0 + eors r2, r0 + movs r0, 0x58 + muls r0, r2 + adds r1, r0 + add r1, r12 + ldrh r0, [r1] + ldrh r1, [r7] + cmp r0, r1 + bne _08132EBC + b _08132E74 +_08132EDC: + movs r4, 0 + ldr r3, =0x020244a8 + ldr r0, [r3] + ldr r1, [r0, 0x18] + ldr r2, =0x0202420c + ldrb r0, [r2] + lsls r0, 4 + adds r1, r0 + ldrh r0, [r1] + ldrh r1, [r7] + cmp r0, r1 + beq _08132F14 + adds r7, r3, 0 + adds r5, r2, 0 + adds r3, r1, 0 +_08132EFA: + adds r4, 0x1 + cmp r4, 0x3 + bgt _08132F14 + ldr r0, [r7] + ldr r2, [r0, 0x18] + lsls r1, r4, 1 + ldrb r0, [r5] + lsls r0, 4 + adds r1, r0 + adds r2, r1 + ldrh r0, [r2] + cmp r0, r3 + bne _08132EFA +_08132F14: + cmp r4, 0x4 + bne _08132F28 +_08132F18: + ldr r0, [r6] +_08132F1A: + adds r0, 0x8 + str r0, [r6] + b _08132F40 + .pool +_08132F28: + ldr r2, [r6] + ldrb r1, [r2, 0x4] + ldrb r0, [r2, 0x5] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 24 + orrs r1, r0 + str r1, [r6] +_08132F40: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end tai3F_unk + + thumb_func_start tai40_unk +tai40_unk: @ 8132F48 + push {r4-r7,lr} + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r6, r0, 0x2 + ldrb r0, [r0, 0x1] + adds r5, r1, 0 + cmp r0, 0x1 + beq _08132F70 + cmp r0, 0x1 + bgt _08132F68 + cmp r0, 0 + beq _08132FB4 + b _08133018 + .pool +_08132F68: + cmp r0, 0x2 + beq _08132FB4 + cmp r0, 0x3 + bne _08133018 +_08132F70: + movs r3, 0 + ldr r2, =0x02024084 + ldr r4, =0x0203ab3c + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + adds r2, 0xC + adds r0, r2 + ldrh r0, [r0] + ldrh r1, [r6] + cmp r0, r1 + beq _08132FA6 + adds r7, r4, 0 + movs r6, 0x58 + adds r4, r2, 0 + adds r2, r1, 0 +_08132F90: + adds r3, 0x1 + cmp r3, 0x3 + bgt _08132FA6 + lsls r1, r3, 1 + ldrb r0, [r7] + muls r0, r6 + adds r1, r0 + adds r1, r4 + ldrh r0, [r1] + cmp r0, r2 + bne _08132F90 +_08132FA6: + cmp r3, 0x4 + bne _08132FF0 + b _08133000 + .pool +_08132FB4: + movs r3, 0 + ldr r4, =0x020244a8 + ldr r0, [r4] + ldr r1, [r0, 0x18] + ldr r2, =0x0202420c + ldrb r0, [r2] + lsls r0, 4 + adds r1, r0 + ldrh r0, [r1] + ldrh r1, [r6] + cmp r0, r1 + beq _08132FEC + adds r7, r4, 0 + adds r6, r2, 0 + adds r4, r1, 0 +_08132FD2: + adds r3, 0x1 + cmp r3, 0x3 + bgt _08132FEC + ldr r0, [r7] + ldr r2, [r0, 0x18] + lsls r1, r3, 1 + ldrb r0, [r6] + lsls r0, 4 + adds r1, r0 + adds r2, r1 + ldrh r0, [r2] + cmp r0, r4 + bne _08132FD2 +_08132FEC: + cmp r3, 0x4 + beq _08133000 +_08132FF0: + ldr r0, [r5] + adds r0, 0x8 + str r0, [r5] + b _08133018 + .pool +_08133000: + ldr r2, [r5] + ldrb r1, [r2, 0x4] + ldrb r0, [r2, 0x5] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 24 + orrs r1, r0 + str r1, [r5] +_08133018: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end tai40_unk + + thumb_func_start tai41_unk +tai41_unk: @ 8133020 + push {r4-r7,lr} + ldr r1, =0x0203ab38 + ldr r0, [r1] + ldrb r0, [r0, 0x1] + adds r5, r1, 0 + cmp r0, 0x1 + beq _08133044 + cmp r0, 0x1 + bgt _0813303C + cmp r0, 0 + beq _08133090 + b _08133110 + .pool +_0813303C: + cmp r0, 0x2 + beq _08133090 + cmp r0, 0x3 + bne _08133110 +_08133044: + movs r3, 0 + ldr r1, =0x02024084 + ldr r0, =0x0203ab3c + ldrb r2, [r0] + ldr r6, =gBattleMoves + movs r0, 0x58 + muls r0, r2 + adds r1, 0xC + adds r2, r0, r1 + ldr r4, =0x0203ab38 +_08133058: + ldrh r0, [r2] + cmp r0, 0 + beq _08133072 + adds r1, r0, 0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldr r1, [r4] + ldrb r0, [r0] + ldrb r1, [r1, 0x2] + cmp r0, r1 + beq _0813307A +_08133072: + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _08133058 +_0813307A: + cmp r3, 0x4 + beq _081330DC + b _081330F8 + .pool +_08133090: + movs r3, 0 + ldr r1, =0x02024084 + ldr r0, =0x0203ab3c + ldrb r2, [r0] + ldr r0, =gBattleMoves + mov r12, r0 + ldr r7, =0x020244a8 + ldr r6, =0x0202420c + movs r0, 0x58 + muls r0, r2 + adds r1, 0xC + adds r4, r0, r1 +_081330A8: + lsls r2, r3, 1 + ldrh r0, [r4] + cmp r0, 0 + beq _081330D0 + ldr r0, [r7] + ldr r1, [r0, 0x18] + ldrb r0, [r6] + lsls r0, 4 + adds r0, r2, r0 + adds r1, r0 + ldrh r1, [r1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + add r0, r12 + ldr r1, [r5] + ldrb r0, [r0] + ldrb r1, [r1, 0x2] + cmp r0, r1 + beq _081330D8 +_081330D0: + adds r4, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _081330A8 +_081330D8: + cmp r3, 0x4 + bne _081330F8 +_081330DC: + ldr r0, [r5] + adds r0, 0x7 + str r0, [r5] + b _08133110 + .pool +_081330F8: + ldr r2, [r5] + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r5] +_08133110: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end tai41_unk + + thumb_func_start tai42_unk +tai42_unk: @ 8133118 + push {r4-r6,lr} + ldr r1, =0x0203ab38 + ldr r0, [r1] + ldrb r0, [r0, 0x1] + adds r4, r1, 0 + cmp r0, 0x1 + beq _0813313C + cmp r0, 0x1 + bgt _08133134 + cmp r0, 0 + beq _08133188 + b _081331F4 + .pool +_08133134: + cmp r0, 0x2 + beq _08133188 + cmp r0, 0x3 + bne _081331F4 +_0813313C: + movs r3, 0 + ldr r1, =0x02024084 + ldr r0, =0x0203ab3c + ldrb r2, [r0] + ldr r6, =gBattleMoves + movs r0, 0x58 + muls r0, r2 + adds r1, 0xC + adds r2, r0, r1 + ldr r5, =0x0203ab38 +_08133150: + ldrh r0, [r2] + cmp r0, 0 + beq _0813316A + adds r1, r0, 0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldr r1, [r5] + ldrb r0, [r0] + ldrb r1, [r1, 0x2] + cmp r0, r1 + beq _08133172 +_0813316A: + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _08133150 +_08133172: + cmp r3, 0x4 + bne _081331C2 + b _081331DC + .pool +_08133188: + movs r3, 0 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x18] + ldr r0, =0x0202420c + ldrb r0, [r0] + ldr r6, =gBattleMoves + lsls r0, 4 + adds r2, r0, r1 + ldr r5, =0x0203ab38 +_0813319C: + ldrh r0, [r2] + cmp r0, 0 + beq _081331B6 + adds r1, r0, 0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldr r1, [r5] + ldrb r0, [r0] + ldrb r1, [r1, 0x2] + cmp r0, r1 + beq _081331BE +_081331B6: + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _0813319C +_081331BE: + cmp r3, 0x4 + beq _081331DC +_081331C2: + ldr r0, [r4] + adds r0, 0x7 + str r0, [r4] + b _081331F4 + .pool +_081331DC: + ldr r2, [r4] + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] +_081331F4: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end tai42_unk + + thumb_func_start tai43_unk +tai43_unk: @ 81331FC + push {r4,r5,lr} + ldr r0, =0x0203ab38 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r5, r0, 0 + cmp r1, 0x1 + bne _08133218 + ldr r0, =0x0203ab3c + b _0813321A + .pool +_08133218: + ldr r0, =0x0202420c +_0813321A: + ldrb r3, [r0] + adds r4, r5, 0 + ldr r2, [r4] + ldrb r0, [r2, 0x2] + cmp r0, 0 + bne _08133240 + ldr r0, =0x020242bc + lsls r1, r3, 3 + subs r1, r3 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x4] + cmp r0, 0 + beq _08133244 + b _0813325A + .pool +_08133240: + cmp r0, 0x1 + beq _0813324A +_08133244: + adds r0, r2, 0x7 + str r0, [r4] + b _0813327C +_0813324A: + ldr r0, =0x020242bc + lsls r1, r3, 3 + subs r1, r3 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x6] + cmp r0, 0 + beq _08133278 +_0813325A: + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _0813327C + .pool +_08133278: + adds r0, r2, 0x7 + str r0, [r5] +_0813327C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end tai43_unk + + thumb_func_start tai44_unk +tai44_unk: @ 8133284 + push {r4,lr} + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r0, [r3, 0x1] + cmp r0, 0 + beq _0813329C + cmp r0, 0x1 + beq _081332C8 + b _08133308 + .pool +_0813329C: + ldr r2, =0x020242bc + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x020244a8 + ldr r1, [r1] + ldr r1, [r1, 0x14] + ldrh r0, [r0, 0x4] + ldrh r1, [r1, 0x2] + cmp r0, r1 + beq _081332E4 + b _08133308 + .pool +_081332C8: + ldr r2, =0x020242bc + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x020244a8 + ldr r1, [r1] + ldr r1, [r1, 0x14] + ldrh r0, [r0, 0x6] + ldrh r1, [r1, 0x2] + cmp r0, r1 + bne _08133308 +_081332E4: + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _0813330C + .pool +_08133308: + adds r0, r3, 0x6 + str r0, [r4] +_0813330C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai44_unk + + thumb_func_start tai45_unk +tai45_unk: @ 8133314 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldrb r1, [r2, 0x10] + movs r0, 0xB + orrs r0, r1 + strb r0, [r2, 0x10] + bx lr + .pool + thumb_func_end tai45_unk + + thumb_func_start tai46_unk +tai46_unk: @ 8133328 + push {r4,lr} + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x7B + ldrb r0, [r0] + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, r4 + bcs _08133374 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0813337C + .pool +_08133374: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0813337C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end tai46_unk + + thumb_func_start dp15_end_with_move_5 +dp15_end_with_move_5: @ 8133388 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldrb r1, [r2, 0x10] + movs r0, 0xD + orrs r0, r1 + strb r0, [r2, 0x10] + bx lr + .pool + thumb_func_end dp15_end_with_move_5 + + thumb_func_start dp15_get_held_item_x12__8 +dp15_get_held_item_x12__8: @ 813339C + push {r4,lr} + ldr r0, =0x0203ab38 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bne _081333B4 + ldr r0, =0x0203ab3c + b _081333B6 + .pool +_081333B4: + ldr r0, =0x0202420c +_081333B6: + ldrb r2, [r0] + ldr r0, =0x02024064 + ldrb r0, [r0] + cmp r0, r2 + beq _081333E0 + ldr r4, =0x020244a8 + ldr r0, [r4] + ldr r0, [r0, 0x18] + adds r0, 0x44 + adds r0, r2 + ldrb r0, [r0] + bl itemid_get_x12 + ldr r1, [r4] + b _081333F2 + .pool +_081333E0: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x2E] + bl itemid_get_x12 + ldr r1, =0x020244a8 + ldr r1, [r1] +_081333F2: + ldr r1, [r1, 0x14] + lsls r0, 24 + lsrs r0, 24 + str r0, [r1, 0x8] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp15_get_held_item_x12__8 + + thumb_func_start tai62_unk +tai62_unk: @ 8133414 + push {r4,lr} + ldr r0, =0x0203ab38 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl sub_8131E70 + lsls r0, 24 + lsrs r3, r0, 24 + movs r0, 0x1 + ldr r1, =0x0203ab3c + ldrb r2, [r1] + adds r1, r3, 0 + ands r1, r0 + ands r0, r2 + cmp r1, r0 + bne _0813344C + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r3 + adds r0, r1 + ldrh r3, [r0, 0x2E] + b _08133458 + .pool +_0813344C: + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x18] + adds r0, 0x44 + adds r0, r3 + ldrb r3, [r0] +_08133458: + ldr r4, =0x0203ab38 + ldr r2, [r4] + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + orrs r0, r1 + cmp r0, r3 + bne _08133488 + ldrb r1, [r2, 0x4] + ldrb r0, [r2, 0x5] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _0813348E + .pool +_08133488: + adds r0, r2, 0 + adds r0, 0x8 + str r0, [r4] +_0813348E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai62_unk + + thumb_func_start tai49_unk +tai49_unk: @ 8133494 + push {lr} + ldr r0, =0x0203ab38 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bne _081334AC + ldr r0, =0x0203ab3c + b _081334AE + .pool +_081334AC: + ldr r0, =0x0202420c +_081334AE: + ldrb r1, [r0] + ldr r2, =0x02024084 + movs r0, 0x58 + muls r1, r0 + adds r0, r1, r2 + ldrh r0, [r0] + adds r2, 0x48 + adds r1, r2 + ldr r1, [r1] + bl pokemon_species_get_gender_info + ldr r1, =0x020244a8 + ldr r1, [r1] + ldr r1, [r1, 0x14] + lsls r0, 24 + lsrs r0, 24 + str r0, [r1, 0x8] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end tai49_unk + + thumb_func_start dp15_enter_battle_countdown_get_state +dp15_enter_battle_countdown_get_state: @ 81334EC + push {r4,lr} + ldr r0, =0x0203ab38 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _08133508 + ldr r0, =0x0203ab3c + b _0813350A + .pool +_08133508: + ldr r0, =0x0202420c +_0813350A: + ldrb r3, [r0] + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldr r1, =0x020242bc + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x16] + str r0, [r2, 0x8] + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp15_enter_battle_countdown_get_state + + thumb_func_start dp15_stockpile_get_num_uses +dp15_stockpile_get_num_uses: @ 8133538 + push {r4,lr} + ldr r0, =0x0203ab38 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _08133554 + ldr r0, =0x0203ab3c + b _08133556 + .pool +_08133554: + ldr r0, =0x0202420c +_08133556: + ldrb r3, [r0] + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldr r1, =0x020242bc + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x9] + str r0, [r2, 0x8] + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp15_stockpile_get_num_uses + + thumb_func_start dp15_is_double_battle +dp15_is_double_battle: @ 8133584 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + str r0, [r2, 0x8] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end dp15_is_double_battle + + thumb_func_start dp15_get_dp08_item__8 +dp15_get_dp08_item__8: @ 81335AC + push {r4,lr} + ldr r0, =0x0203ab38 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _081335C8 + ldr r0, =0x0203ab3c + b _081335CA + .pool +_081335C8: + ldr r0, =0x0202420c +_081335CA: + ldrb r3, [r0] + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldr r0, =0x0202449c + ldr r1, [r0] + lsls r0, r3, 1 + adds r0, r1 + adds r0, 0xB8 + ldrb r0, [r0] + str r0, [r2, 0x8] + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp15_get_dp08_item__8 + + thumb_func_start dp15_move_get_type__8 +dp15_move_get_type__8: @ 81335F8 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r3, [r0, 0x14] + ldr r2, =gBattleMoves + ldr r1, [r3, 0x8] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x2] + str r0, [r3, 0x8] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end dp15_move_get_type__8 + + thumb_func_start dp15_move_get_power__8_8 +dp15_move_get_power__8_8: @ 8133624 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r3, [r0, 0x14] + ldr r2, =gBattleMoves + ldr r1, [r3, 0x8] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + str r0, [r3, 0x8] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end dp15_move_get_power__8_8 + + thumb_func_start dp15_move_get_move_script_id__8 +dp15_move_get_move_script_id__8: @ 8133650 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r3, [r0, 0x14] + ldr r2, =gBattleMoves + ldr r1, [r3, 0x8] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + str r0, [r3, 0x8] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end dp15_move_get_move_script_id__8 + + thumb_func_start dp15_get_protect_endure_activity +dp15_get_protect_endure_activity: @ 813367C + push {r4,lr} + ldr r0, =0x0203ab38 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0x1 + bne _08133698 + ldr r0, =0x0203ab3c + b _0813369A + .pool +_08133698: + ldr r0, =0x0202420c +_0813369A: + ldrb r3, [r0] + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldr r1, =0x020242bc + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x8] + str r0, [r2, 0x8] + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp15_get_protect_endure_activity + + thumb_func_start nullsub_106 +nullsub_106: @ 81336C8 + bx lr + thumb_func_end nullsub_106 + + thumb_func_start nullsub_107 +nullsub_107: @ 81336CC + bx lr + thumb_func_end nullsub_107 + + thumb_func_start nullsub_108 +nullsub_108: @ 81336D0 + bx lr + thumb_func_end nullsub_108 + + thumb_func_start nullsub_109 +nullsub_109: @ 81336D4 + bx lr + thumb_func_end nullsub_109 + + thumb_func_start nullsub_110 +nullsub_110: @ 81336D8 + bx lr + thumb_func_end nullsub_110 + + thumb_func_start nullsub_111 +nullsub_111: @ 81336DC + bx lr + thumb_func_end nullsub_111 + + thumb_func_start tai58_unk +tai58_unk: @ 81336E0 + push {r4,lr} + ldr r4, =0x0203ab38 + ldr r0, [r4] + adds r0, 0x5 + bl b_mc_stack_push + ldr r2, [r4] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end tai58_unk + + thumb_func_start dp15_jump +dp15_jump: @ 8133710 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + bx lr + .pool + thumb_func_end dp15_jump + + thumb_func_start dp15_return +dp15_return: @ 8133730 + push {lr} + bl b_mc_stack_pop_cursor + lsls r0, 24 + cmp r0, 0 + bne _0813374A + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r2, [r0, 0x14] + ldrb r1, [r2, 0x10] + movs r0, 0x1 + orrs r0, r1 + strb r0, [r2, 0x10] +_0813374A: + pop {r0} + bx r0 + .pool + thumb_func_end dp15_return + + thumb_func_start dp15_compare_attacker_defender_levels +dp15_compare_attacker_defender_levels: @ 8133754 + push {r4,r5,lr} + ldr r5, =0x0203ab38 + ldr r4, [r5] + ldrb r0, [r4, 0x1] + cmp r0, 0x1 + beq _081337A8 + cmp r0, 0x1 + bgt _08133770 + cmp r0, 0 + beq _08133776 + b _08133824 + .pool +_08133770: + cmp r0, 0x2 + beq _081337D8 + b _08133824 +_08133776: + ldr r3, =0x02024084 + ldr r0, =0x0203ab3c + ldrb r0, [r0] + movs r2, 0x58 + adds r1, r0, 0 + muls r1, r2 + adds r1, r3 + adds r1, 0x2A + ldr r0, =0x0202420c + ldrb r0, [r0] + muls r0, r2 + adds r0, r3 + adds r0, 0x2A + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + bhi _081337FA + b _08133820 + .pool +_081337A8: + ldr r3, =0x02024084 + ldr r0, =0x0203ab3c + ldrb r0, [r0] + movs r2, 0x58 + adds r1, r0, 0 + muls r1, r2 + adds r1, r3 + adds r1, 0x2A + ldr r0, =0x0202420c + ldrb r0, [r0] + muls r0, r2 + adds r0, r3 + adds r0, 0x2A + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + bcc _081337FA + b _08133820 + .pool +_081337D8: + ldr r3, =0x02024084 + ldr r0, =0x0203ab3c + ldrb r0, [r0] + movs r2, 0x58 + adds r1, r0, 0 + muls r1, r2 + adds r1, r3 + adds r1, 0x2A + ldr r0, =0x0202420c + ldrb r0, [r0] + muls r0, r2 + adds r0, r3 + adds r0, 0x2A + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + bne _08133820 +_081337FA: + ldrb r1, [r4, 0x2] + ldrb r0, [r4, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r4, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r4, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r5] + b _08133824 + .pool +_08133820: + adds r0, r4, 0x6 + str r0, [r5] +_08133824: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end dp15_compare_attacker_defender_levels + + thumb_func_start tai5C_unk +tai5C_unk: @ 813382C + push {lr} + ldr r2, =0x020242bc + ldr r0, =0x0202420c + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x13] + lsls r0, 28 + cmp r0, 0 + beq _0813386C + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08133874 + .pool +_0813386C: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08133874: + pop {r0} + bx r0 + .pool + thumb_func_end tai5C_unk + + thumb_func_start tai5D_unk +tai5D_unk: @ 813387C + push {lr} + ldr r2, =0x020242bc + ldr r0, =0x0202420c + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x13] + lsls r0, 28 + cmp r0, 0 + bne _081338BC + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081338C4 + .pool +_081338BC: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_081338C4: + pop {r0} + bx r0 + .pool + thumb_func_end tai5D_unk + + thumb_func_start tai5E_unk +tai5E_unk: @ 81338CC + push {lr} + ldr r0, =0x0203ab3c + ldrb r3, [r0] + movs r0, 0x1 + ldr r1, =0x0202420c + ldrb r2, [r1] + adds r1, r0, 0 + ands r1, r3 + ands r0, r2 + cmp r1, r0 + bne _0813390C + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08133914 + .pool +_0813390C: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08133914: + pop {r0} + bx r0 + .pool + thumb_func_end tai5E_unk + + thumb_func_start tai61_unk +tai61_unk: @ 813391C + push {r4,lr} + ldr r4, =0x0203ab38 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl sub_8131E70 + lsls r0, 24 + ldr r1, =0x020244a8 + ldr r1, [r1] + ldr r1, [r1, 0x4] + lsrs r0, 22 + adds r1, r0 + ldr r0, [r1] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08133960 + ldr r2, [r4] + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08133966 + .pool +_08133960: + ldr r0, [r4] + adds r0, 0x6 + str r0, [r4] +_08133966: + pop {r4} + pop {r0} + bx r0 + thumb_func_end tai61_unk + + thumb_func_start b_mc_stack_push +b_mc_stack_push: @ 813396C + push {r4,lr} + ldr r1, =0x020244a8 + ldr r1, [r1] + ldr r3, [r1, 0x1C] + adds r4, r3, 0 + adds r4, 0x20 + ldrb r1, [r4] + adds r2, r1, 0x1 + strb r2, [r4] + lsls r1, 24 + lsrs r1, 22 + adds r3, r1 + str r0, [r3] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end b_mc_stack_push + + thumb_func_start b_mc_stack_push_cursor +b_mc_stack_push_cursor: @ 8133990 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r2, [r0, 0x1C] + adds r3, r2, 0 + adds r3, 0x20 + ldrb r0, [r3] + adds r1, r0, 0x1 + strb r1, [r3] + lsls r0, 24 + lsrs r0, 22 + adds r2, r0 + ldr r0, =0x0203ab38 + ldr r0, [r0] + str r0, [r2] + bx lr + .pool + thumb_func_end b_mc_stack_push_cursor + + thumb_func_start b_mc_stack_pop_cursor +b_mc_stack_pop_cursor: @ 81339B8 + push {lr} + ldr r3, =0x020244a8 + ldr r0, [r3] + ldr r0, [r0, 0x1C] + adds r1, r0, 0 + adds r1, 0x20 + ldrb r0, [r1] + cmp r0, 0 + bne _081339D4 + movs r0, 0 + b _081339EE + .pool +_081339D4: + subs r0, 0x1 + strb r0, [r1] + ldr r2, =0x0203ab38 + ldr r0, [r3] + ldr r1, [r0, 0x1C] + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2] + movs r0, 0x1 +_081339EE: + pop {r1} + bx r1 + .pool + thumb_func_end b_mc_stack_pop_cursor + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/battle_anim_80FE840.s b/asm/battle_anim_80FE840.s new file mode 100644 index 000000000..ccba858f5 --- /dev/null +++ b/asm/battle_anim_80FE840.s @@ -0,0 +1,52255 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80FE840 +sub_80FE840: @ 80FE840 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x0203841e + ldrh r0, [r5] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x2E] + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x30] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080FE87C + ldrh r0, [r5, 0x8] + negs r0, r0 + b _080FE87E + .pool +_080FE87C: + ldrh r0, [r5, 0x8] +_080FE87E: + strh r0, [r4, 0x34] + ldr r0, =0x0203841e + ldrh r0, [r0, 0xA] + strh r0, [r4, 0x36] + ldr r0, =sub_80FE898 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FE840 + + thumb_func_start sub_80FE898 +sub_80FE898: @ 80FE898 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _080FE8D4 + subs r0, r1, 0x1 + strh r0, [r4, 0x2E] + ldrh r1, [r4, 0x32] + lsls r0, r1, 16 + asrs r0, 24 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r1, r0 + strh r1, [r4, 0x32] + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r2, 0x34 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x38] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + b _080FE8DA +_080FE8D4: + adds r0, r4, 0 + bl move_anim_8072740 +_080FE8DA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FE898 + + thumb_func_start sub_80FE8E0 +sub_80FE8E0: @ 80FE8E0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, =0x0203841e + ldrh r0, [r0, 0x4] + strh r0, [r4, 0x2E] + ldr r5, =0x02038436 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r4, 0x1C] + ldr r1, =move_anim_8074EE0 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FE8E0 + + thumb_func_start sub_80FE930 +sub_80FE930: @ 80FE930 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r5, =0x0203841e + ldrb r1, [r5, 0x6] + adds r0, r4, 0 + bl StartObjectImageAnim + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x2E] + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r4, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FE930 + + thumb_func_start sub_80FE988 +sub_80FE988: @ 80FE988 + push {r4-r6,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r6, =0x0203841e + ldrh r0, [r6, 0x4] + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldrh r0, [r6, 0x6] + strh r0, [r4, 0x38] + ldr r1, =sub_80FE9E4 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FE988 + + thumb_func_start sub_80FE9E4 +sub_80FE9E4: @ 80FE9E4 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _080FE9FA + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + b _080FEA4E +_080FE9FA: + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x7F + ble _080FEA14 + ldr r0, =0x02038437 + ldrb r0, [r0] + bl sub_80A82E4 + adds r0, 0x1 + b _080FEA1E + .pool +_080FEA14: + ldr r0, =0x02038437 + ldrb r0, [r0] + bl sub_80A82E4 + adds r0, 0x6 +_080FEA1E: + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0x5 + bl sine + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0xE + bl cosine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x38] + adds r0, 0xF + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] +_080FEA4E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FE9E4 + + thumb_func_start sub_80FEA58 +sub_80FEA58: @ 80FEA58 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + ldrh r0, [r5, 0x8] + subs r0, 0x1 + movs r2, 0 + strh r0, [r5, 0x8] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _080FEAB2 + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + movs r0, 0x6 + strh r0, [r5, 0x8] + ldr r1, =0x0203841e + movs r0, 0xF + strh r0, [r1] + strh r2, [r1, 0x2] + movs r0, 0x50 + strh r0, [r1, 0x4] + strh r2, [r1, 0x6] + ldr r4, =gUnknown_08592210 + ldr r0, =0x02038437 + ldrb r0, [r0] + bl sub_80A82E4 + adds r3, r0, 0 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl AddObjectAndAnimateForOneFrame +_080FEAB2: + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0xF + bne _080FEAC0 + adds r0, r6, 0 + bl move_anim_task_del +_080FEAC0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FEA58 + + thumb_func_start sub_80FEAD8 +sub_80FEAD8: @ 80FEAD8 + push {r4-r6,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A6980 + ldr r6, =0x0203841e + ldrh r0, [r6, 0x6] + strh r0, [r4, 0x2E] + ldr r5, =0x02038436 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x36] + ldrh r0, [r6, 0x4] + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl sub_80A68D4 + ldr r0, =sub_80FEB28 + str r0, [r4, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FEAD8 + + thumb_func_start sub_80FEB28 +sub_80FEB28: @ 80FEB28 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _080FEB3C + adds r0, r4, 0 + bl move_anim_8072740 +_080FEB3C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FEB28 + + thumb_func_start sub_80FEB44 +sub_80FEB44: @ 80FEB44 + push {r4,r5,lr} + adds r5, r0, 0 + bl GenerateRandomNumber2 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x7 + ands r1, r0 + adds r0, r5, 0 + bl StartObjectImageAnim + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080FEB90 + ldrh r0, [r5, 0x20] + subs r0, 0x14 + b _080FEB94 + .pool +_080FEB90: + ldrh r0, [r5, 0x20] + adds r0, 0x14 +_080FEB94: + strh r0, [r5, 0x20] + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1F + ands r0, r1 + adds r0, 0x40 + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x30] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl sub_80A7160 + bl GenerateRandomNumber2 + movs r1, 0xFF + ands r1, r0 + strh r1, [r5, 0x38] + adds r0, r5, 0 + adds r0, 0x43 + ldrb r0, [r0] + strh r0, [r5, 0x3A] + ldr r1, =sub_80FEBFC + str r1, [r5, 0x1C] + adds r0, r5, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FEB44 + + thumb_func_start sub_80FEBFC +sub_80FEBFC: @ 80FEBFC + push {r4,lr} + adds r4, r0, 0 + bl sub_80A70E8 + lsls r0, 24 + cmp r0, 0 + beq _080FEC12 + adds r0, r4, 0 + bl move_anim_8072740 + b _080FEC42 +_080FEC12: + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0xC + bl cosine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x7E + bgt _080FEC2E + ldrh r0, [r4, 0x3A] + b _080FEC32 +_080FEC2E: + ldrh r0, [r4, 0x3A] + adds r0, 0x1 +_080FEC32: + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + ldrh r0, [r4, 0x38] + adds r0, 0x18 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] +_080FEC42: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FEBFC + + thumb_func_start sub_80FEC48 +sub_80FEC48: @ 80FEC48 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080FEC68 + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_080FEC68: + ldr r4, =0x0203841e + ldrh r0, [r4, 0x8] + strh r0, [r6, 0x2E] + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x4] + adds r0, r1 + strh r0, [r6, 0x32] + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x6] + adds r0, r1 + strh r0, [r6, 0x36] + ldrh r0, [r4, 0xA] + strh r0, [r6, 0x38] + adds r0, r6, 0 + bl sub_80A68D4 + ldr r0, =sub_80FECB8 + str r0, [r6, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FEC48 + + thumb_func_start sub_80FECB8 +sub_80FECB8: @ 80FECB8 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _080FECE2 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + movs r0, 0xA + strh r0, [r4, 0x2E] + ldr r0, =sub_80A64B0 + str r0, [r4, 0x1C] + ldr r1, =sub_80FECF0 + adds r0, r4, 0 + bl oamt_set_x3A_32 +_080FECE2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FECB8 + + thumb_func_start sub_80FECF0 +sub_80FECF0: @ 80FECF0 + push {r4,lr} + adds r4, r0, 0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnim + movs r0, 0x3C + strh r0, [r4, 0x2E] + ldr r0, =sub_80A64B0 + str r0, [r4, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FECF0 + + thumb_func_start sub_80FED28 +sub_80FED28: @ 80FED28 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A6980 + ldr r5, =0x0203841e + ldrb r1, [r5, 0x8] + adds r0, r4, 0 + bl StartObjectImageAnim + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _080FED52 + ldrb r0, [r4, 0x1] + movs r1, 0xD + negs r1, r1 + ands r1, r0 + movs r0, 0x4 + orrs r1, r0 + strb r1, [r4, 0x1] +_080FED52: + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x2E] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x30] + ldr r1, =sub_80FED74 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FED28 + + thumb_func_start sub_80FED74 +sub_80FED74: @ 80FED74 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x20 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x3 + negs r1, r1 + bl cosine + ldrh r1, [r4, 0x32] + adds r1, 0x18 + strh r1, [r4, 0x32] + lsls r1, 16 + asrs r1, 24 + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + subs r0, 0x40 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7F + bhi _080FEDC8 + ldr r0, =0x02038437 + ldrb r0, [r0] + bl sub_80A8328 + movs r1, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + b _080FEDEC + .pool +_080FEDC8: + ldr r0, =0x02038437 + ldrb r0, [r0] + bl sub_80A8328 + adds r0, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _080FEDDC + movs r2, 0x3 +_080FEDDC: + movs r0, 0x3 + ands r2, r0 + lsls r2, 2 + ldrb r1, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + orrs r0, r2 +_080FEDEC: + strb r0, [r4, 0x5] + ldrh r0, [r4, 0x30] + adds r0, 0x2 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _080FEE10 + adds r0, r4, 0 + bl move_anim_8072740 +_080FEE10: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FED74 + + thumb_func_start sub_80FEE1C +sub_80FEE1C: @ 80FEE1C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080FEE36 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _080FEE3E +_080FEE36: + adds r0, r4, 0 + bl move_anim_task_del + b _080FEE70 +_080FEE3E: + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FEE60 + movs r0, 0x2 + movs r1, 0x4 + movs r2, 0x3 + bl lcd_bg_operations + b _080FEE6A + .pool +_080FEE60: + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations +_080FEE6A: + adds r0, r4, 0 + bl move_anim_task_del +_080FEE70: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FEE1C + + thumb_func_start sub_80FEE78 +sub_80FEE78: @ 80FEE78 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0 + bl sub_80A69CC + ldr r5, =0x0203841e + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + ldr r0, =0x02038436 + ldrb r0, [r0] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r5, [r5, 0x4] + adds r0, r5 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + movs r0, 0x40 + strh r0, [r4, 0x38] + ldr r1, =sub_80FEECC + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FEE78 + + thumb_func_start sub_80FEECC +sub_80FEECC: @ 80FEECC + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + bne _080FEF38 + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0x20 + bl sine + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0x5 + negs r1, r1 + bl cosine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x38] + subs r0, 0x40 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7F + bhi _080FEF18 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl sub_80A82E4 + subs r0, 0x1 + b _080FEF22 + .pool +_080FEF18: + ldr r0, =0x02038436 + ldrb r0, [r0] + bl sub_80A82E4 + adds r0, 0x1 +_080FEF22: + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + ldrh r0, [r4, 0x38] + adds r0, 0x5 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + b _080FEF3E + .pool +_080FEF38: + adds r0, r4, 0 + bl move_anim_8072740 +_080FEF3E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FEECC + + thumb_func_start sub_80FEF44 +sub_80FEF44: @ 80FEF44 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r5, =0x0203841e + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + ldr r0, =0x02038436 + ldrb r0, [r0] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r5, [r5, 0x4] + adds r0, r5 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + movs r0, 0x40 + strh r0, [r4, 0x38] + ldr r1, =sub_80FEF98 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FEF44 + + thumb_func_start sub_80FEF98 +sub_80FEF98: @ 80FEF98 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + bne _080FEFF0 + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl sine + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + ldrh r1, [r4, 0x38] + adds r0, r1, 0 + subs r0, 0x3B + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4 + bls _080FEFD0 + adds r0, r1, 0 + subs r0, 0xBB + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4 + bhi _080FEFE4 +_080FEFD0: + ldrb r2, [r4, 0x3] + lsls r1, r2, 26 + lsrs r1, 27 + movs r0, 0x8 + eors r1, r0 + lsls r1, 1 + subs r0, 0x47 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x3] +_080FEFE4: + ldrh r0, [r4, 0x38] + adds r0, 0x5 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + b _080FEFF6 +_080FEFF0: + adds r0, r4, 0 + bl move_anim_8072740 +_080FEFF6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FEF98 + + thumb_func_start sub_80FEFFC +sub_80FEFFC: @ 80FEFFC + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x02038436 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + ldr r1, =0x0203841e + ldrh r0, [r1] + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x32] + ldr r0, =sub_80FF044 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FEFFC + + thumb_func_start sub_80FF044 +sub_80FF044: @ 80FF044 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x32] + movs r2, 0x32 + ldrsh r3, [r1, r2] + cmp r3, 0 + bne _080FF078 + ldrh r0, [r1, 0x30] + movs r2, 0x1 + ands r2, r0 + cmp r2, 0 + beq _080FF066 + movs r0, 0x80 + strh r0, [r1, 0x2E] + strh r3, [r1, 0x30] + strh r3, [r1, 0x32] + b _080FF06C +_080FF066: + strh r2, [r1, 0x2E] + strh r2, [r1, 0x30] + strh r2, [r1, 0x32] +_080FF06C: + ldr r0, =sub_80FF090 + str r0, [r1, 0x1C] + b _080FF08C + .pool +_080FF078: + subs r0, 0x1 + strh r0, [r1, 0x32] + ldrh r0, [r1, 0x2E] + ldrh r2, [r1, 0x20] + adds r0, r2 + strh r0, [r1, 0x20] + ldrh r0, [r1, 0x30] + ldrh r2, [r1, 0x22] + adds r0, r2 + strh r0, [r1, 0x22] +_080FF08C: + pop {r0} + bx r0 + thumb_func_end sub_80FF044 + + thumb_func_start sub_80FF090 +sub_80FF090: @ 80FF090 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080FF0B4 + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x19 + bl sine + negs r0, r0 + b _080FF0BE + .pool +_080FF0B4: + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x19 + bl sine +_080FF0BE: + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x2E] + adds r0, 0x2 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080FF0DE + ldrh r0, [r4, 0x26] + adds r0, 0x1 + strh r0, [r4, 0x26] +_080FF0DE: + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x50 + ble _080FF0EC + adds r0, r4, 0 + bl move_anim_8072740 +_080FF0EC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FF090 + + thumb_func_start sub_80FF0F4 +sub_80FF0F4: @ 80FF0F4 + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080FF114 + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_080FF114: + ldr r6, =0x0203841e + ldrh r0, [r6, 0x8] + strh r0, [r5, 0x2E] + movs r1, 0xC + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _080FF154 + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x4] + adds r0, r1 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r6, [r6, 0x6] + adds r0, r6 + b _080FF174 + .pool +_080FF154: + ldr r0, =0x02038437 + ldrb r0, [r0] + adds r2, r5, 0 + adds r2, 0x32 + adds r3, r5, 0 + adds r3, 0x36 + movs r1, 0x1 + bl sub_80A8924 + ldrh r0, [r6, 0x4] + ldrh r1, [r5, 0x32] + adds r0, r1 + strh r0, [r5, 0x32] + ldrh r0, [r6, 0x6] + ldrh r1, [r5, 0x36] + adds r0, r1 +_080FF174: + strh r0, [r5, 0x36] + ldr r0, =0x0203841e + ldrh r0, [r0, 0xA] + strh r0, [r5, 0x38] + adds r0, r5, 0 + bl sub_80A68D4 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _080FF1AC + movs r0, 0x1 + b _080FF1AE + .pool +_080FF1AC: + movs r0, 0 +_080FF1AE: + strh r0, [r5, 0x2E] + ldr r0, =sub_80FF1C0 + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FF0F4 + + thumb_func_start sub_80FF1C0 +sub_80FF1C0: @ 80FF1C0 + push {r4-r7,lr} + adds r6, r0, 0 + movs r7, 0 + ldrh r5, [r6, 0x2E] + ldrh r4, [r6, 0x3C] + movs r0, 0x1 + strh r0, [r6, 0x2E] + adds r0, r6, 0 + bl sub_80A6900 + ldrh r0, [r6, 0x3C] + strh r5, [r6, 0x2E] + lsls r4, 16 + asrs r4, 16 + cmp r4, 0xC8 + ble _080FF1F2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x37 + bgt _080FF1F2 + ldrh r0, [r6, 0x6] + cmp r0, 0 + bne _080FF1F8 + adds r0, 0x1 + strh r0, [r6, 0x6] +_080FF1F2: + ldrh r0, [r6, 0x6] + cmp r0, 0 + beq _080FF22A +_080FF1F8: + movs r1, 0x2E + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _080FF22A + adds r3, r6, 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] + ldrh r0, [r6, 0x6] + adds r0, 0x1 + strh r0, [r6, 0x6] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1E + bne _080FF22A + movs r7, 0x1 +_080FF22A: + movs r2, 0x20 + ldrsh r0, [r6, r2] + movs r2, 0x24 + ldrsh r1, [r6, r2] + adds r0, r1 + adds r0, 0x10 + movs r1, 0x88 + lsls r1, 1 + cmp r0, r1 + bhi _080FF254 + movs r0, 0x22 + ldrsh r1, [r6, r0] + movs r2, 0x26 + ldrsh r0, [r6, r2] + adds r1, r0 + cmp r1, 0xA0 + bgt _080FF254 + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + bge _080FF256 +_080FF254: + movs r7, 0x1 +_080FF256: + cmp r7, 0 + beq _080FF260 + adds r0, r6, 0 + bl move_anim_8072740 +_080FF260: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80FF1C0 + + thumb_func_start sub_80FF268 +sub_80FF268: @ 80FF268 + push {r4,lr} + adds r4, r0, 0 + bl battle_type_is_double + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FF28A + ldr r0, =0x02038437 + ldrb r0, [r0] + adds r2, r4, 0 + adds r2, 0x20 + adds r3, r4, 0 + adds r3, 0x22 + movs r1, 0x1 + bl sub_80A8924 +_080FF28A: + ldrh r0, [r4, 0x22] + adds r0, 0x20 + strh r0, [r4, 0x22] + ldr r1, =0x0203841e + ldrh r0, [r1] + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x32] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x34] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x36] + ldr r0, =sub_80FF2BC + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FF268 + + thumb_func_start sub_80FF2BC +sub_80FF2BC: @ 80FF2BC + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0xFF + bne _080FF2D2 + ldrh r0, [r4, 0x22] + subs r0, 0x2 + strh r0, [r4, 0x22] + b _080FF2E0 +_080FF2D2: + cmp r0, 0 + ble _080FF2E0 + ldrh r0, [r4, 0x22] + subs r0, 0x2 + strh r0, [r4, 0x22] + subs r0, r1, 0x2 + strh r0, [r4, 0x30] +_080FF2E0: + ldrh r3, [r4, 0x32] + ldrh r5, [r4, 0x38] + adds r2, r3, r5 + strh r2, [r4, 0x38] + movs r0, 0x2E + ldrsh r1, [r4, r0] + movs r5, 0x36 + ldrsh r0, [r4, r5] + cmp r1, r0 + bge _080FF2F8 + adds r0, r2, r3 + strh r0, [r4, 0x38] +_080FF2F8: + ldrh r1, [r4, 0x38] + movs r0, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r2, 0x34 + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x24] + movs r5, 0x38 + ldrsh r0, [r4, r5] + movs r1, 0x5 + bl sine + strh r0, [r4, 0x26] + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x7F + bgt _080FF338 + ldr r0, =0x02038437 + ldrb r0, [r0] + bl sub_80A8328 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + b _080FF346 + .pool +_080FF338: + ldr r0, =0x02038437 + ldrb r0, [r0] + bl sub_80A8328 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1 +_080FF346: + movs r1, 0x3 + ands r0, r1 + lsls r0, 2 + ldrb r2, [r4, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x5] + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + bne _080FF36A + adds r0, r4, 0 + bl move_anim_8072740 +_080FF36A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FF2BC + + thumb_func_start sub_80FF374 +sub_80FF374: @ 80FF374 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0 + bl sub_80A6980 + adds r2, r5, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r4, =0x0203841e + ldrb r1, [r4, 0x4] + adds r0, r5, 0 + bl StartObjectRotScalAnim + ldrh r0, [r4, 0x4] + strh r0, [r5, 0x3A] + ldrh r0, [r4, 0x6] + strh r0, [r5, 0x3C] + ldr r0, =sub_80FF3B0 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FF374 + + thumb_func_start sub_80FF3B0 +sub_80FF3B0: @ 80FF3B0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0203841e + ldrh r1, [r0, 0xE] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _080FF3DA + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + movs r0, 0x80 + lsls r0, 1 + strh r0, [r4, 0x2E] + ldr r0, =sub_80FF3EC + str r0, [r4, 0x1C] +_080FF3DA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FF3B0 + + thumb_func_start sub_80FF3EC +sub_80FF3EC: @ 80FF3EC + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080FF404 + ldrh r0, [r4, 0x2E] + adds r0, 0xB + b _080FF408 +_080FF404: + ldrh r0, [r4, 0x2E] + subs r0, 0xB +_080FF408: + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bne _080FF424 + movs r0, 0 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x32] + movs r1, 0x1 + eors r0, r1 + strh r0, [r4, 0x32] +_080FF424: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080FF452 + ldrh r0, [r4, 0x3C] + subs r0, 0x1 + strh r0, [r4, 0x3C] + lsls r0, 16 + cmp r0, 0 + ble _080FF44C + ldrh r1, [r4, 0x3A] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectRotScalAnim + b _080FF452 +_080FF44C: + adds r0, r4, 0 + bl move_anim_8072740 +_080FF452: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FF3EC + + thumb_func_start sub_80FF458 +sub_80FF458: @ 80FF458 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, =0x02020630 + mov r10, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + mov r2, r10 + adds r7, r0, r2 + adds r0, r7, 0 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _080FF498 + adds r0, r4, 0 + bl move_anim_task_del + b _080FF51C + .pool +_080FF498: + adds r0, r1, 0 + movs r1, 0x1 + bl sub_80A7270 + ldr r0, =0x03005e00 + lsls r6, r4, 2 + adds r6, r4 + lsls r6, 3 + adds r6, r0 + ldrb r0, [r7, 0x5] + lsls r0, 28 + lsrs r0, 30 + strh r0, [r6, 0x24] + ldr r0, =0x02038437 + mov r9, r0 + ldrb r0, [r0] + bl sub_80A8328 + movs r1, 0x3 + mov r8, r1 + mov r1, r8 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r7, 0x5] + movs r5, 0xD + negs r5, r5 + adds r0, r5, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r7, 0x5] + movs r0, 0x3 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r1, r0, 24 + lsls r4, r1, 4 + adds r4, r1 + lsls r4, 2 + add r4, r10 + ldrb r0, [r4, 0x5] + lsls r0, 28 + lsrs r0, 30 + strh r0, [r6, 0x26] + mov r2, r9 + ldrb r1, [r2] + movs r0, 0x2 + eors r0, r1 + bl sub_80A8328 + mov r1, r8 + ands r1, r0 + lsls r1, 2 + ldrb r0, [r4, 0x5] + ands r5, r0 + orrs r5, r1 + strb r5, [r4, 0x5] + ldr r1, =0x0203841e + ldrh r0, [r1] + strh r0, [r6, 0x8] + ldrh r0, [r1, 0x2] + strh r0, [r6, 0xA] + movs r0, 0x80 + lsls r0, 1 + strh r0, [r6, 0x1E] + ldr r0, =sub_80FF53C + str r0, [r6] +_080FF51C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FF458 + + thumb_func_start sub_80FF53C +sub_80FF53C: @ 80FF53C + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r1 + ldrh r1, [r4, 0x8] + ldrh r0, [r4, 0x1C] + adds r1, r0 + strh r1, [r4, 0x1C] + ldr r2, =0x02020630 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r5, r0, r2 + lsls r1, 16 + asrs r1, 24 + strh r1, [r5, 0x24] + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080FF586 + ldrh r0, [r5, 0x24] + negs r0, r0 + strh r0, [r5, 0x24] +_080FF586: + ldrh r0, [r4, 0x1E] + adds r0, 0x10 + strh r0, [r4, 0x1E] + movs r0, 0x1E + ldrsh r2, [r4, r0] + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + adds r0, r6, 0 + bl sub_80A7E6C + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bne _080FF5B4 + strh r0, [r4, 0x8] + ldr r0, =sub_80FF5CC + str r0, [r4] +_080FF5B4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FF53C + + thumb_func_start sub_80FF5CC +sub_80FF5CC: @ 80FF5CC + push {r4-r7,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, =0x0203841e + ldrh r1, [r0, 0xE] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _080FF660 + ldr r0, =0x03005e00 + lsls r2, r3, 2 + adds r1, r2, r3 + lsls r1, 3 + adds r7, r1, r0 + movs r1, 0x8 + ldrsh r5, [r7, r1] + adds r4, r0, 0 + cmp r5, 0 + bne _080FF674 + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_80A7344 + ldr r6, =0x02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r6 + strh r5, [r1, 0x24] + strh r5, [r1, 0x26] + movs r5, 0x3 + ldrh r2, [r7, 0x24] + ands r2, r5 + lsls r2, 2 + ldrb r3, [r1, 0x5] + movs r4, 0xD + negs r4, r4 + adds r0, r4, 0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x5] + movs r0, 0x3 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r0, [r7, 0x26] + ands r0, r5 + lsls r0, 2 + ldrb r2, [r1, 0x5] + ands r4, r2 + orrs r4, r0 + strb r4, [r1, 0x5] + ldrh r0, [r7, 0x8] + adds r0, 0x1 + strh r0, [r7, 0x8] + b _080FF68E + .pool +_080FF660: + ldr r1, =0x03005e00 + lsls r2, r3, 2 + adds r0, r2, r3 + lsls r0, 3 + adds r0, r1 + movs r4, 0x8 + ldrsh r0, [r0, r4] + adds r4, r1, 0 + cmp r0, 0 + beq _080FF68E +_080FF674: + adds r1, r2, r3 + lsls r1, 3 + adds r1, r4 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _080FF68E + adds r0, r3, 0 + bl move_anim_task_del +_080FF68E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FF5CC + + thumb_func_start sub_80FF698 +sub_80FF698: @ 80FF698 + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _080FF6AA + cmp r0, 0x1 + beq _080FF704 + b _080FF756 +_080FF6AA: + ldr r6, =0x02038437 + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080FF6C2 + ldr r1, =0x0203841e + movs r2, 0 + ldrsh r0, [r1, r2] + negs r0, r0 + strh r0, [r1] +_080FF6C2: + ldrb r0, [r6] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + ldr r4, =0x0203841e + lsrs r0, 24 + ldrh r1, [r4] + adds r0, r1 + strh r0, [r5, 0x20] + ldrb r0, [r6] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r4, [r4, 0x2] + adds r0, r4 + strh r0, [r5, 0x22] + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + b _080FF756 + .pool +_080FF704: + adds r2, r5, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080FF756 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80082B8 + movs r0, 0x19 + strh r0, [r5, 0x2E] + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + ldr r0, =sub_80A70C0 + str r0, [r5, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r5, 0 + bl oamt_set_x3A_32 +_080FF756: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FF698 + + thumb_func_start sub_80FF768 +sub_80FF768: @ 80FF768 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _080FF7D4 + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldr r4, =0x0203841e + ldrh r0, [r4] + strh r0, [r5, 0x24] + ldrh r0, [r4, 0x2] + strh r0, [r5, 0x26] + ldrb r0, [r4, 0x4] + adds r0, 0x1E + adds r1, r5, 0 + adds r1, 0x43 + strb r0, [r1] + ldrb r1, [r4, 0x6] + adds r0, r5, 0 + bl StartObjectImageAnim + ldrh r0, [r4, 0x8] + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + movs r2, 0x22 + ldrsh r0, [r5, r2] + movs r2, 0x26 + ldrsh r1, [r5, r2] + adds r0, r1 + cmp r0, 0x78 + ble _080FF7D4 + ldrh r0, [r5, 0x22] + adds r1, r0, 0 + subs r1, 0x78 + ldrh r2, [r5, 0x26] + adds r0, r2 + adds r1, r0 + strh r1, [r5, 0x22] +_080FF7D4: + ldr r0, =sub_80FF8DC + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FF768 + + thumb_func_start sub_80FF7EC +sub_80FF7EC: @ 80FF7EC + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x4 + mov r9, r0 + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + mov r8, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r6, =0x02038437 + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r6] + movs r1, 0x3 + bl sub_80A5C6C + adds r2, r0, 0 + lsls r2, 24 + subs r4, r5 + lsls r4, 16 + lsrs r2, 24 + mov r1, r8 + subs r2, r1 + lsls r2, 16 + lsrs r2, 16 + lsrs r3, r4, 16 + mov r10, r3 + asrs r4, 16 + ldr r6, =0x0203841e + movs r1, 0 + ldrsh r0, [r6, r1] + muls r0, r4 + movs r1, 0x64 + str r2, [sp] + bl __divsi3 + adds r5, r0 + mov r3, r9 + strh r5, [r3, 0x20] + ldr r2, [sp] + lsls r0, r2, 16 + asrs r0, 16 + movs r3, 0 + ldrsh r1, [r6, r3] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + add r8, r0 + mov r1, r8 + mov r0, r9 + strh r1, [r0, 0x22] + ldrh r0, [r6, 0x2] + mov r3, r9 + strh r0, [r3, 0x24] + ldrh r0, [r6, 0x4] + strh r0, [r3, 0x26] + ldrb r0, [r6, 0x6] + adds r0, 0x1E + mov r1, r9 + adds r1, 0x43 + strb r0, [r1] + ldrb r1, [r6, 0x8] + mov r0, r9 + bl StartObjectImageAnim + ldrh r0, [r6, 0xA] + mov r1, r9 + strh r0, [r1, 0x32] + ldr r0, =sub_80FF8DC + str r0, [r1, 0x1C] + ldr r1, =0x0203a0f8 + mov r3, r9 + ldrh r0, [r3, 0x20] + strh r0, [r1] + ldrh r0, [r3, 0x22] + strh r0, [r1, 0x2] + mov r0, r10 + strh r0, [r1, 0x4] + ldr r2, [sp] + strh r2, [r1, 0x6] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FF7EC + + thumb_func_start sub_80FF8DC +sub_80FF8DC: @ 80FF8DC + push {lr} + adds r3, r0, 0 + ldrh r1, [r3, 0x2E] + adds r1, 0x1 + strh r1, [r3, 0x2E] + lsls r1, 16 + asrs r1, 16 + movs r2, 0x32 + ldrsh r0, [r3, r2] + subs r0, 0xA + cmp r1, r0 + ble _080FF91C + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r0, 1 + lsls r0, 1 + subs r1, r0 + movs r2, 0x3E + adds r2, r3 + mov r12, r2 + movs r0, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] +_080FF91C: + movs r2, 0x2E + ldrsh r1, [r3, r2] + movs r2, 0x32 + ldrsh r0, [r3, r2] + cmp r1, r0 + ble _080FF92E + adds r0, r3, 0 + bl move_anim_8072740 +_080FF92E: + pop {r0} + bx r0 + thumb_func_end sub_80FF8DC + + thumb_func_start sub_80FF934 +sub_80FF934: @ 80FF934 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x2E + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _080FF974 + ldr r5, =0x02038436 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + ldr r4, =0x0203841e + lsrs r0, 24 + ldrh r2, [r4] + adds r0, r2 + strh r0, [r6, 0x20] + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x2] + adds r0, r1 + strh r0, [r6, 0x22] + ldrh r0, [r4, 0x4] + strh r0, [r6, 0x30] + ldrh r0, [r4, 0x6] + strh r0, [r6, 0x32] + ldrh r0, [r4, 0x8] + strh r0, [r6, 0x34] +_080FF974: + ldrh r0, [r6, 0x2E] + adds r0, 0x1 + strh r0, [r6, 0x2E] + ldrh r1, [r6, 0x30] + muls r0, r1 + strh r0, [r6, 0x24] + movs r2, 0x2E + ldrsh r1, [r6, r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + movs r1, 0xFF + ands r0, r1 + movs r2, 0x32 + ldrsh r1, [r6, r2] + bl sine + strh r0, [r6, 0x26] + movs r0, 0x2E + ldrsh r1, [r6, r0] + movs r2, 0x34 + ldrsh r0, [r6, r2] + cmp r1, r0 + ble _080FF9AA + adds r0, r6, 0 + bl move_anim_8072740 +_080FF9AA: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FF934 + + thumb_func_start sub_80FF9B8 +sub_80FF9B8: @ 80FF9B8 + push {r4,r5,lr} + movs r2, 0x20 + ldrsh r4, [r0, r2] + lsls r4, 8 + movs r3, 0x22 + ldrsh r2, [r0, r3] + orrs r4, r2 + movs r5, 0x3A + ldrsh r2, [r0, r5] + lsls r2, 8 + movs r5, 0x3C + ldrsh r3, [r0, r5] + orrs r2, r3 + lsls r1, 8 + strh r4, [r0, 0x38] + strh r2, [r0, 0x3A] + strh r1, [r0, 0x3C] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80FF9B8 + + thumb_func_start sub_80FF9E0 +sub_80FF9E0: @ 80FF9E0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r8, r0 + ldrh r0, [r0, 0x38] + lsrs r1, r0, 8 + mov r10, r1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r1, r8 + ldrh r0, [r1, 0x3A] + lsrs r2, r0, 8 + lsls r0, 24 + lsrs r4, r0, 24 + ldrh r1, [r1, 0x3C] + lsls r0, r1, 16 + asrs r0, 24 + lsls r0, 16 + lsrs r6, r0, 16 + movs r3, 0xFF + ands r3, r1 + cmp r2, 0 + bne _080FFA1A + movs r2, 0x20 + negs r2, r2 + b _080FFA22 +_080FFA1A: + cmp r2, 0xFF + bne _080FFA22 + movs r2, 0x88 + lsls r2, 1 +_080FFA22: + mov r0, r9 + subs r4, r0 + lsls r4, 16 + lsrs r4, 16 + mov r1, r10 + subs r0, r2, r1 + lsls r5, r3, 16 + asrs r5, 16 + muls r0, r5 + lsls r1, r6, 16 + asrs r7, r1, 16 + adds r1, r7, 0 + bl __divsi3 + adds r6, r0, 0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + muls r0, r5 + adds r1, r7, 0 + bl __divsi3 + add r6, r10 + mov r1, r8 + strh r6, [r1, 0x20] + add r0, r9 + strh r0, [r1, 0x22] + adds r5, 0x1 + lsls r5, 16 + lsrs r3, r5, 16 + asrs r5, 16 + cmp r5, r7 + beq _080FFA74 + lsls r1, r7, 8 + lsls r0, r3, 16 + asrs r0, 16 + orrs r0, r1 + mov r1, r8 + strh r0, [r1, 0x3C] + movs r0, 0 + b _080FFA76 +_080FFA74: + movs r0, 0x1 +_080FFA76: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80FF9E0 + + thumb_func_start sub_80FFA84 +sub_80FFA84: @ 80FFA84 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0xA + bne _080FFA98 + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim +_080FFA98: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x32 + ble _080FFAAC + adds r0, r4, 0 + bl move_anim_8072740 +_080FFAAC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FFA84 + + thumb_func_start sub_80FFAB4 +sub_80FFAB4: @ 80FFAB4 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + lsls r0, 7 + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl __divsi3 + ldrh r1, [r4, 0x2E] + adds r1, r0 + movs r5, 0 + strh r1, [r4, 0x2E] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x7F + ble _080FFADE + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + strh r5, [r4, 0x2E] +_080FFADE: + ldrh r0, [r4, 0x2E] + adds r0, 0x80 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x30 + ldrsh r2, [r4, r1] + lsls r2, 3 + movs r1, 0x1E + subs r1, r2 + lsls r1, 16 + asrs r1, 16 + bl sine + strh r0, [r4, 0x26] + adds r0, r4, 0 + bl sub_80FF9E0 + lsls r0, 24 + cmp r0, 0 + beq _080FFB0E + strh r5, [r4, 0x26] + strh r5, [r4, 0x2E] + ldr r0, =sub_80FFA84 + str r0, [r4, 0x1C] +_080FFB0E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FFAB4 + + thumb_func_start sub_80FFB18 +sub_80FFB18: @ 80FFB18 + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0 + bl sub_80A69CC + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02038436 + ldrb r1, [r0] + movs r0, 0x2 + eors r0, r1 + ldrb r4, [r4] + cmp r0, r4 + bne _080FFB68 + strh r6, [r5, 0x3A] + adds r0, r2, 0 + adds r0, 0xA + strh r0, [r5, 0x3C] + adds r0, r5, 0 + movs r1, 0x3C + bl sub_80FF9B8 + movs r0, 0x1 + b _080FFB7A + .pool +_080FFB68: + strh r6, [r5, 0x3A] + adds r0, r2, 0 + adds r0, 0xA + strh r0, [r5, 0x3C] + adds r0, r5, 0 + movs r1, 0x3C + bl sub_80FF9B8 + movs r0, 0x3 +_080FFB7A: + strh r0, [r5, 0x34] + movs r0, 0x3C + strh r0, [r5, 0x36] + ldr r0, =sub_80FFAB4 + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FFB18 + + thumb_func_start sub_80FFB90 +sub_80FFB90: @ 80FFB90 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + lsls r0, 7 + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl __divsi3 + ldrh r1, [r4, 0x2E] + adds r1, r0 + movs r5, 0 + strh r1, [r4, 0x2E] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x7F + ble _080FFBBA + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + strh r5, [r4, 0x2E] +_080FFBBA: + ldrh r0, [r4, 0x2E] + adds r0, 0x80 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x30 + ldrsh r2, [r4, r1] + lsls r2, 3 + movs r1, 0x1E + subs r1, r2 + lsls r1, 16 + asrs r1, 16 + bl sine + strh r0, [r4, 0x26] + adds r0, r4, 0 + bl sub_80FF9E0 + lsls r0, 24 + cmp r0, 0 + beq _080FFBEC + strh r5, [r4, 0x26] + strh r5, [r4, 0x2E] + adds r0, r4, 0 + bl move_anim_8072740 +_080FFBEC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80FFB90 + + thumb_func_start sub_80FFBF4 +sub_80FFBF4: @ 80FFBF4 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _080FFC38 + strh r0, [r5, 0x3A] + adds r0, r6, 0 + adds r0, 0xA + strh r0, [r5, 0x3C] + adds r0, r5, 0 + movs r1, 0x28 + bl sub_80FF9B8 + movs r0, 0x3 + strh r0, [r5, 0x34] + movs r0, 0x3C + strh r0, [r5, 0x36] + ldr r0, =sub_80FFAB4 + b _080FFC62 + .pool +_080FFC38: + movs r0, 0xFF + strh r0, [r5, 0x3A] + adds r0, r6, 0 + adds r0, 0xA + strh r0, [r5, 0x3C] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080FFC50 + movs r0, 0 + strh r0, [r5, 0x3A] +_080FFC50: + adds r0, r5, 0 + movs r1, 0x28 + bl sub_80FF9B8 + movs r0, 0x3 + strh r0, [r5, 0x34] + movs r0, 0x3C + strh r0, [r5, 0x36] + ldr r0, =sub_80FFB90 +_080FFC62: + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FFBF4 + + thumb_func_start sub_80FFC70 +sub_80FFC70: @ 80FFC70 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080FFC8A + adds r0, r4, 0 + movs r1, 0 + bl sub_80A6980 + ldr r0, =0x0203841e + ldrh r0, [r0, 0x4] + strh r0, [r4, 0x30] +_080FFC8A: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + ldrh r1, [r4, 0x30] + muls r0, r1 + strh r0, [r4, 0x26] + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080FFCAA + adds r0, r4, 0 + bl move_anim_8072740 +_080FFCAA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FFC70 + + thumb_func_start sub_80FFCB4 +sub_80FFCB4: @ 80FFCB4 + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0 + bl sub_80A6980 + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02038437 + ldrb r1, [r0] + movs r0, 0x2 + eors r0, r1 + ldrb r4, [r4] + cmp r0, r4 + bne _080FFD04 + strh r6, [r5, 0x3A] + adds r0, r2, 0 + adds r0, 0xA + strh r0, [r5, 0x3C] + adds r0, r5, 0 + movs r1, 0x3C + bl sub_80FF9B8 + movs r0, 0x1 + b _080FFD16 + .pool +_080FFD04: + strh r6, [r5, 0x3A] + adds r0, r2, 0 + adds r0, 0xA + strh r0, [r5, 0x3C] + adds r0, r5, 0 + movs r1, 0x3C + bl sub_80FF9B8 + movs r0, 0x3 +_080FFD16: + strh r0, [r5, 0x34] + movs r0, 0x3C + strh r0, [r5, 0x36] + ldr r0, =sub_80FFD2C + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FFCB4 + + thumb_func_start sub_80FFD2C +sub_80FFD2C: @ 80FFD2C + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + lsls r0, 7 + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl __divsi3 + ldrh r1, [r4, 0x2E] + adds r1, r0 + movs r5, 0 + strh r1, [r4, 0x2E] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x7F + ble _080FFD56 + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + strh r5, [r4, 0x2E] +_080FFD56: + ldrh r0, [r4, 0x2E] + adds r0, 0x80 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x30 + ldrsh r2, [r4, r1] + lsls r2, 3 + movs r1, 0x1E + subs r1, r2 + lsls r1, 16 + asrs r1, 16 + bl sine + strh r0, [r4, 0x26] + lsls r0, 16 + cmp r0, 0 + bne _080FFD8A + movs r0, 0x3F + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x7D + bl audio_play_and_stuff +_080FFD8A: + adds r0, r4, 0 + bl sub_80FF9E0 + lsls r0, 24 + cmp r0, 0 + beq _080FFDB2 + strh r5, [r4, 0x26] + strh r5, [r4, 0x2E] + ldr r0, =sub_80FFA84 + str r0, [r4, 0x1C] + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x7D + bl audio_play_and_stuff +_080FFDB2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FFD2C + + thumb_func_start sub_80FFDBC +sub_80FFDBC: @ 80FFDBC + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080FFE50 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080FFDE4 + ldr r0, =0x0203841e + ldrh r1, [r0, 0x2] + strh r1, [r4, 0x30] + movs r1, 0x78 + strh r1, [r4, 0x20] + adds r5, r0, 0 + b _080FFE06 + .pool +_080FFDE4: + ldr r0, =0x0203841e + movs r1, 0x2 + ldrsh r3, [r0, r1] + adds r1, r3, 0 + subs r1, 0x20 + adds r2, r1, 0 + adds r5, r0, 0 + cmp r1, 0 + bge _080FFDFA + adds r2, r3, 0 + adds r2, 0xDF +_080FFDFA: + asrs r0, r2, 8 + lsls r0, 8 + subs r0, r1, r0 + strh r0, [r4, 0x30] + movs r0, 0x46 + strh r0, [r4, 0x20] +_080FFE06: + ldrh r0, [r5] + strh r0, [r4, 0x22] + strh r0, [r4, 0x32] + movs r0, 0x14 + strh r0, [r4, 0x36] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x3C + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x14 + bl sine + strh r0, [r4, 0x26] + ldr r0, =sub_80FFE58 + str r0, [r4, 0x1C] + ldrh r0, [r4, 0x30] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xBE + bhi _080FFE48 + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1F + b _080FFE4E + .pool +_080FFE48: + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1D +_080FFE4E: + strb r0, [r1] +_080FFE50: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80FFDBC + + thumb_func_start sub_80FFE58 +sub_80FFE58: @ 80FFE58 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080FFE6A + cmp r0, 0x1 + beq _080FFE9A + b _080FFEBA +_080FFE6A: + ldrh r5, [r4, 0x32] + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x4E + ble _080FFE82 + movs r0, 0x1 + strh r0, [r4, 0x34] + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + b _080FFEBA +_080FFE82: + movs r1, 0x36 + ldrsh r0, [r4, r1] + movs r1, 0xA + bl __divsi3 + adds r0, r5, r0 + strh r0, [r4, 0x32] + ldrh r1, [r4, 0x36] + adds r1, 0x3 + strh r1, [r4, 0x36] + strh r0, [r4, 0x22] + b _080FFEBA +_080FFE9A: + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080FFEBA + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080FFEBA + movs r0, 0 + strh r0, [r4, 0x2E] + strh r0, [r4, 0x32] + ldr r0, =sub_80FFEC4 + str r0, [r4, 0x1C] +_080FFEBA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FFE58 + + thumb_func_start sub_80FFEC4 +sub_80FFEC4: @ 80FFEC4 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r5, =gUnknown_08592700 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r3, r0, r1 + adds r0, r5, 0x1 + adds r0, r3, r0 + ldrh r2, [r4, 0x32] + movs r6, 0x32 + ldrsh r1, [r4, r6] + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r1, r0 + bne _080FFF10 + adds r0, r5, 0x2 + adds r0, r3, r0 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x7F + bne _080FFEFC + movs r0, 0 + strh r0, [r4, 0x2E] + ldr r0, =sub_80FFF7C + str r0, [r4, 0x1C] +_080FFEFC: + movs r0, 0 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _080FFF76 + .pool +_080FFF10: + adds r0, r2, 0x1 + strh r0, [r4, 0x32] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + adds r1, r0, r5 + movs r2, 0 + ldrsb r2, [r1, r2] + adds r1, r5, 0x2 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + muls r0, r2 + ldrh r1, [r4, 0x30] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080FFF5E + ldrh r0, [r4, 0x30] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xBE + bhi _080FFF56 + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1F + b _080FFF5C +_080FFF56: + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1D +_080FFF5C: + strb r0, [r1] +_080FFF5E: + movs r6, 0x30 + ldrsh r0, [r4, r6] + movs r1, 0x3C + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x14 + bl sine + strh r0, [r4, 0x26] +_080FFF76: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80FFEC4 + + thumb_func_start sub_80FFF7C +sub_80FFF7C: @ 80FFF7C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x14 + ble _080FFF8E + adds r0, r4, 0 + bl move_anim_8072740 +_080FFF8E: + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r0, 1 + lsls r0, 1 + subs r1, r0 + adds r3, r4, 0 + adds r3, 0x3E + movs r0, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FFF7C + + thumb_func_start sub_80FFFC0 +sub_80FFFC0: @ 80FFFC0 + 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, =0x03005e00 + adds r5, r0, r1 + ldr r4, =0x02038437 + ldrb r0, [r4] + bl sub_80A82E4 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + strh r0, [r5, 0x10] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x14] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x16] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A861C + strh r0, [r5, 0x1C] + ldrb r0, [r4] + movs r1, 0 + bl sub_80A861C + strh r0, [r5, 0x1E] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x1 + negs r2, r2 + adds r1, r2, 0 + cmp r0, 0x1 + bne _08100028 + movs r1, 0x1 +_08100028: + strh r1, [r5, 0x12] + movs r3, 0x12 + ldrsh r0, [r5, r3] + lsls r0, 6 + movs r1, 0x38 + subs r1, r0 + strh r1, [r5, 0x1A] + ldrh r0, [r5, 0x16] + subs r0, r1 + ldrh r1, [r5, 0x14] + adds r0, r1 + strh r0, [r5, 0x18] + ldr r0, =gUnknown_08592778 + movs r2, 0x18 + ldrsh r1, [r5, r2] + movs r3, 0x1A + ldrsh r2, [r5, r3] + ldrb r3, [r5, 0x10] + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xC] + cmp r0, 0x40 + bne _08100060 + adds r0, r6, 0 + bl move_anim_task_del +_08100060: + ldr r4, =0x02020630 + movs r0, 0xC + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xA + strh r1, [r0, 0x2E] + movs r2, 0xC + ldrsh r1, [r5, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r5, 0x18] + strh r1, [r0, 0x30] + movs r3, 0xC + ldrsh r0, [r5, r3] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + movs r1, 0x1C + ldrsh r0, [r5, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r0, 0xA + movs r3, 0x12 + ldrsh r1, [r5, r3] + muls r1, r0 + ldrh r0, [r5, 0x14] + subs r0, r1 + strh r0, [r2, 0x32] + movs r0, 0xC + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r5, 0x1A] + strh r1, [r0, 0x34] + movs r1, 0xC + ldrsh r0, [r5, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + movs r2, 0x1E + ldrsh r0, [r5, r2] + lsrs r2, r0, 31 + adds r0, r2 + asrs r0, 1 + adds r0, 0xA + movs r3, 0x12 + ldrsh r2, [r5, r3] + muls r0, r2 + ldrh r2, [r5, 0x16] + adds r0, r2 + strh r0, [r1, 0x36] + movs r3, 0xC + ldrsh r1, [r5, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl sub_8100504 + movs r1, 0xC + ldrsh r2, [r5, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + strh r0, [r1, 0x38] + movs r2, 0xC + ldrsh r1, [r5, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl sub_80A68D4 + ldr r0, =sub_8100128 + str r0, [r5] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FFFC0 + + thumb_func_start sub_8100128 +sub_8100128: @ 8100128 + push {r4-r6,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r6, r0, r1 + movs r0, 0xC + ldrsh r1, [r6, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r5, [r6, r1] + cmp r5, 0x7 + bne _08100150 + b _08100380 +_08100150: + cmp r5, 0x7 + bgt _0810019E + cmp r5, 0x3 + bne _0810015A + b _08100272 +_0810015A: + cmp r5, 0x3 + bgt _08100174 + cmp r5, 0x1 + beq _08100204 + cmp r5, 0x1 + bgt _08100254 + cmp r5, 0 + beq _081001E6 + b _081004FC + .pool +_08100174: + cmp r5, 0x5 + bne _0810017A + b _081002E8 +_0810017A: + cmp r5, 0x5 + ble _08100180 + b _08100362 +_08100180: + adds r0, r6, 0 + adds r1, r2, 0 + bl sub_8100524 + adds r0, r4, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + bne _08100196 + b _081004FC +_08100196: + movs r0, 0x5 + strh r0, [r6, 0x26] + movs r0, 0xFF + b _081004FA +_0810019E: + cmp r5, 0xB + bne _081001A4 + b _08100464 +_081001A4: + cmp r5, 0xB + bgt _081001D2 + cmp r5, 0x9 + bne _081001AE + b _081003D2 +_081001AE: + cmp r5, 0x9 + ble _081001B4 + b _08100448 +_081001B4: + adds r0, r6, 0 + adds r1, r2, 0 + bl sub_8100524 + adds r0, r4, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + bne _081001CA + b _081004FC +_081001CA: + movs r0, 0x9 + strh r0, [r6, 0x26] + movs r0, 0xFF + b _081004FA +_081001D2: + cmp r5, 0xD + bne _081001D8 + b _081004D6 +_081001D8: + cmp r5, 0xD + bge _081001DE + b _081004B6 +_081001DE: + cmp r5, 0xFF + bne _081001E4 + b _081004E6 +_081001E4: + b _081004FC +_081001E6: + adds r0, r6, 0 + adds r1, r2, 0 + bl sub_8100524 + adds r0, r4, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + bne _081001FC + b _081004FC +_081001FC: + movs r0, 0x1 + strh r0, [r6, 0x26] + movs r0, 0xFF + b _081004FA +_08100204: + ldrh r2, [r4, 0x24] + ldrh r3, [r4, 0x20] + adds r2, r3 + movs r0, 0 + strh r2, [r4, 0x20] + ldrh r1, [r4, 0x26] + ldrh r3, [r4, 0x22] + adds r1, r3 + strh r1, [r4, 0x22] + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + movs r0, 0xA + strh r0, [r4, 0x2E] + strh r2, [r4, 0x30] + ldrh r0, [r6, 0x14] + strh r0, [r4, 0x32] + strh r1, [r4, 0x34] + ldrh r0, [r6, 0x16] + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl sub_8100504 + strh r0, [r4, 0x38] + ldrh r0, [r6, 0x10] + adds r0, 0x2 + strh r0, [r6, 0x10] + strh r5, [r6, 0xE] + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + ldrb r1, [r6, 0xE] + adds r0, r4, 0 + bl StartObjectImageAnim + adds r0, r4, 0 + bl sub_80A68D4 + ldrh r0, [r6, 0x8] + adds r0, 0x1 + b _081004FA +_08100254: + adds r0, r6, 0 + adds r1, r2, 0 + bl sub_8100524 + adds r0, r4, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + bne _0810026A + b _081004FC +_0810026A: + movs r0, 0x3 + strh r0, [r6, 0x26] + movs r0, 0xFF + b _081004FA +_08100272: + ldrh r1, [r4, 0x24] + ldrh r0, [r4, 0x20] + adds r1, r0 + movs r0, 0 + strh r1, [r4, 0x20] + ldrh r2, [r4, 0x26] + ldrh r3, [r4, 0x22] + adds r2, r3 + strh r2, [r4, 0x22] + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + movs r0, 0xA + strh r0, [r4, 0x2E] + strh r1, [r4, 0x30] + movs r1, 0x1C + ldrsh r0, [r6, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r0, 0xA + movs r3, 0x12 + ldrsh r1, [r6, r3] + muls r1, r0 + ldrh r0, [r6, 0x14] + subs r0, r1 + strh r0, [r4, 0x32] + strh r2, [r4, 0x34] + movs r1, 0x1E + ldrsh r0, [r6, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r0, 0xA + movs r2, 0x12 + ldrsh r1, [r6, r2] + muls r1, r0 + ldrh r0, [r6, 0x16] + subs r0, r1 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl sub_8100504 + strh r0, [r4, 0x38] + movs r0, 0x2 + strh r0, [r6, 0xE] + ldrh r0, [r6, 0x10] + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + ldrb r1, [r6, 0xE] + adds r0, r4, 0 + bl StartObjectImageAnim + adds r0, r4, 0 + bl sub_80A68D4 + ldrh r0, [r6, 0x8] + adds r0, 0x1 + b _081004FA +_081002E8: + ldrh r1, [r4, 0x24] + ldrh r3, [r4, 0x20] + adds r1, r3 + movs r0, 0 + strh r1, [r4, 0x20] + ldrh r2, [r4, 0x26] + ldrh r3, [r4, 0x22] + adds r2, r3 + strh r2, [r4, 0x22] + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + movs r0, 0xA + strh r0, [r4, 0x2E] + strh r1, [r4, 0x30] + movs r1, 0x1C + ldrsh r0, [r6, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r0, 0xA + movs r3, 0x12 + ldrsh r1, [r6, r3] + muls r0, r1 + ldrh r1, [r6, 0x14] + adds r0, r1 + strh r0, [r4, 0x32] + strh r2, [r4, 0x34] + movs r2, 0x1E + ldrsh r0, [r6, r2] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r0, 0xA + movs r3, 0x12 + ldrsh r1, [r6, r3] + muls r0, r1 + ldrh r1, [r6, 0x16] + adds r0, r1 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl sub_8100504 + strh r0, [r4, 0x38] + ldrh r1, [r6, 0x10] + subs r1, 0x2 + strh r1, [r6, 0x10] + movs r0, 0x3 + strh r0, [r6, 0xE] + adds r0, r4, 0 + adds r0, 0x43 + strb r1, [r0] + ldrb r1, [r6, 0xE] + adds r0, r4, 0 + bl StartObjectImageAnim + adds r0, r4, 0 + bl sub_80A68D4 + ldrh r0, [r6, 0x8] + adds r0, 0x1 + b _081004FA +_08100362: + adds r0, r6, 0 + adds r1, r2, 0 + bl sub_8100524 + adds r0, r4, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + bne _08100378 + b _081004FC +_08100378: + movs r0, 0x7 + strh r0, [r6, 0x26] + movs r0, 0xFF + b _081004FA +_08100380: + ldrh r2, [r4, 0x24] + ldrh r3, [r4, 0x20] + adds r2, r3 + movs r0, 0 + strh r2, [r4, 0x20] + ldrh r1, [r4, 0x26] + ldrh r3, [r4, 0x22] + adds r1, r3 + strh r1, [r4, 0x22] + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + movs r0, 0xA + strh r0, [r4, 0x2E] + strh r2, [r4, 0x30] + ldrh r0, [r6, 0x14] + strh r0, [r4, 0x32] + strh r1, [r4, 0x34] + ldrh r0, [r6, 0x16] + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl sub_8100504 + strh r0, [r4, 0x38] + ldrh r1, [r6, 0x10] + adds r1, 0x2 + strh r1, [r6, 0x10] + movs r0, 0x4 + strh r0, [r6, 0xE] + adds r0, r4, 0 + adds r0, 0x43 + strb r1, [r0] + ldrb r1, [r6, 0xE] + adds r0, r4, 0 + bl StartObjectImageAnim + adds r0, r4, 0 + bl sub_80A68D4 + ldrh r0, [r6, 0x8] + adds r0, 0x1 + b _081004FA +_081003D2: + ldrh r1, [r4, 0x24] + ldrh r0, [r4, 0x20] + adds r1, r0 + movs r0, 0 + strh r1, [r4, 0x20] + ldrh r2, [r4, 0x26] + ldrh r3, [r4, 0x22] + adds r2, r3 + strh r2, [r4, 0x22] + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + movs r0, 0xA + strh r0, [r4, 0x2E] + strh r1, [r4, 0x30] + movs r1, 0x1C + ldrsh r0, [r6, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r0, 0xA + movs r3, 0x12 + ldrsh r1, [r6, r3] + muls r1, r0 + ldrh r0, [r6, 0x14] + subs r0, r1 + strh r0, [r4, 0x32] + strh r2, [r4, 0x34] + movs r1, 0x1E + ldrsh r0, [r6, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r0, 0xA + movs r2, 0x12 + ldrsh r1, [r6, r2] + muls r0, r1 + ldrh r3, [r6, 0x16] + adds r0, r3 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl sub_8100504 + strh r0, [r4, 0x38] + movs r0, 0x5 + strh r0, [r6, 0xE] + ldrh r0, [r6, 0x10] + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + ldrb r1, [r6, 0xE] + adds r0, r4, 0 + bl StartObjectImageAnim + adds r0, r4, 0 + bl sub_80A68D4 + ldrh r0, [r6, 0x8] + adds r0, 0x1 + b _081004FA +_08100448: + adds r0, r6, 0 + adds r1, r2, 0 + bl sub_8100524 + adds r0, r4, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _081004FC + movs r0, 0xB + strh r0, [r6, 0x26] + movs r0, 0xFF + b _081004FA +_08100464: + ldrh r2, [r4, 0x24] + ldrh r0, [r4, 0x20] + adds r2, r0 + movs r0, 0 + strh r2, [r4, 0x20] + ldrh r1, [r4, 0x26] + ldrh r3, [r4, 0x22] + adds r1, r3 + strh r1, [r4, 0x22] + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + movs r0, 0xA + strh r0, [r4, 0x2E] + strh r2, [r4, 0x30] + ldrh r0, [r6, 0x18] + strh r0, [r4, 0x32] + strh r1, [r4, 0x34] + ldrh r0, [r6, 0x1A] + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl sub_8100504 + strh r0, [r4, 0x38] + ldrh r1, [r6, 0x10] + subs r1, 0x2 + strh r1, [r6, 0x10] + movs r0, 0x6 + strh r0, [r6, 0xE] + adds r0, r4, 0 + adds r0, 0x43 + strb r1, [r0] + ldrb r1, [r6, 0xE] + adds r0, r4, 0 + bl StartObjectImageAnim + adds r0, r4, 0 + bl sub_80A68D4 + ldrh r0, [r6, 0x8] + adds r0, 0x1 + b _081004FA +_081004B6: + adds r0, r6, 0 + adds r1, r2, 0 + bl sub_8100524 + adds r0, r4, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _081004FC + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + ldrh r0, [r6, 0x8] + adds r0, 0x1 + b _081004FA +_081004D6: + movs r1, 0x20 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _081004FC + adds r0, r2, 0 + bl move_anim_task_del + b _081004FC +_081004E6: + ldrh r0, [r6, 0xA] + adds r0, 0x1 + strh r0, [r6, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _081004FC + movs r0, 0 + strh r0, [r6, 0xA] + ldrh r0, [r6, 0x26] +_081004FA: + strh r0, [r6, 0x8] +_081004FC: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8100128 + + thumb_func_start sub_8100504 +sub_8100504: @ 8100504 + push {lr} + movs r2, 0x8 + movs r3, 0x36 + ldrsh r1, [r0, r3] + movs r3, 0x22 + ldrsh r0, [r0, r3] + cmp r1, r0 + bge _0810051A + negs r0, r2 + lsls r0, 16 + lsrs r2, r0, 16 +_0810051A: + lsls r0, r2, 16 + asrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_8100504 + + thumb_func_start sub_8100524 +sub_8100524: @ 8100524 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + ldrh r0, [r6, 0x24] + adds r0, 0x1 + strh r0, [r6, 0x24] + lsls r0, 16 + cmp r0, 0 + ble _081005BA + movs r0, 0 + strh r0, [r6, 0x24] + ldr r0, =0x02020630 + mov r8, r0 + movs r2, 0xC + ldrsh r1, [r6, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrh r1, [r0, 0x24] + ldrh r2, [r0, 0x20] + adds r1, r2 + ldrh r2, [r0, 0x26] + ldrh r0, [r0, 0x22] + adds r2, r0 + ldr r0, =gUnknown_08592778 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + ldrb r3, [r6, 0x10] + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _081005BA + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + mov r0, r8 + adds r4, r5, r0 + strh r7, [r4, 0x3A] + movs r0, 0xC + strh r0, [r4, 0x3C] + ldr r0, =0x03005e00 + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x20] + adds r0, 0x1 + strh r0, [r1, 0x20] + ldrh r2, [r6, 0x22] + movs r0, 0x1 + ands r0, r2 + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x22] + adds r0, 0x1 + strh r0, [r1, 0x22] + ldrb r1, [r6, 0xE] + adds r0, r4, 0 + bl StartObjectImageAnim + ldrh r0, [r6, 0x10] + adds r4, 0x43 + strb r0, [r4] + mov r0, r8 + adds r0, 0x1C + adds r5, r0 + ldr r0, =sub_81005D4 + str r0, [r5] +_081005BA: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8100524 + + thumb_func_start sub_81005D4 +sub_81005D4: @ 81005D4 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08100636 + movs r0, 0 + strh r0, [r4, 0x2E] + 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] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _08100636 + ldr r3, =0x03005e00 + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x3A + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_08100636: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81005D4 + + thumb_func_start sub_8100640 +sub_8100640: @ 8100640 + push {r4-r7,lr} + adds r4, r0, 0 + ldr r0, =0x0203841e + movs r1, 0xC + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810065C + ldr r0, =0x02038436 + b _0810065E + .pool +_0810065C: + ldr r0, =0x02038437 +_0810065E: + ldrb r6, [r0] + adds r0, r6, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08100688 + movs r0, 0 + strh r0, [r4, 0x36] + ldr r1, =0x0203841e + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x32] + ldr r0, =0x0000fff0 + b _08100698 + .pool +_08100688: + movs r0, 0x1 + strh r0, [r4, 0x36] + ldr r1, =0x0203841e + ldrh r0, [r1, 0x6] + negs r0, r0 + strh r0, [r4, 0x32] + movs r0, 0x80 + lsls r0, 1 +_08100698: + strh r0, [r4, 0x20] + adds r7, r1, 0 + adds r5, r7, 0 + ldrh r0, [r5, 0x2] + strh r0, [r4, 0x30] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x2E] + ldrh r0, [r5, 0x8] + strh r0, [r4, 0x34] + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _081006CE + cmp r0, 0x1 + bgt _081006C0 + cmp r0, 0 + beq _081006CA + b _08100738 + .pool +_081006C0: + cmp r0, 0x2 + beq _081006D4 + cmp r0, 0x3 + beq _08100700 + b _08100738 +_081006CA: + ldrh r0, [r5] + b _081006E4 +_081006CE: + ldrh r0, [r5] + strh r0, [r4, 0x22] + b _0810071A +_081006D4: + adds r0, r6, 0 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r5, [r5] + adds r0, r5 +_081006E4: + strh r0, [r4, 0x22] + adds r0, r6, 0 + bl sub_80A8328 + movs r1, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x5] + b _08100738 +_08100700: + ldr r0, =0x02038437 + ldrb r0, [r0] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r7, [r7] + adds r0, r7 + strh r0, [r4, 0x22] + movs r0, 0x1 + bl obj_id_for_side_relative_to_move +_0810071A: + adds r0, r6, 0 + bl sub_80A8328 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + lsls r0, 2 + ldrb r2, [r4, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x5] +_08100738: + ldr r0, =sub_810074C + str r0, [r4, 0x1C] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8100640 + + thumb_func_start sub_810074C +sub_810074C: @ 810074C + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x3C + ldrsh r3, [r4, r0] + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + movs r1, 0x30 + ldrsh r2, [r4, r1] + ldr r1, =gUnknown_08329F40 + movs r5, 0x2E + ldrsh r0, [r4, r5] + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + muls r0, r2 + asrs r0, 8 + strh r0, [r4, 0x26] + movs r2, 0x32 + ldrsh r0, [r4, r2] + muls r0, r3 + strh r0, [r4, 0x24] + movs r5, 0x34 + ldrsh r0, [r4, r5] + muls r0, r3 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + movs r1, 0x36 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081007A4 + movs r2, 0x24 + ldrsh r0, [r4, r2] + movs r5, 0x20 + ldrsh r1, [r4, r5] + adds r0, r1 + cmp r0, 0xF7 + ble _081007BC + b _081007B6 + .pool +_081007A4: + movs r1, 0x24 + ldrsh r0, [r4, r1] + movs r2, 0x20 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bgt _081007BC +_081007B6: + adds r0, r4, 0 + bl move_anim_8074EE0 +_081007BC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_810074C + + thumb_func_start sub_81007C4 +sub_81007C4: @ 81007C4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _081007E8 + cmp r0, 0x1 + beq _0810081C + b _08100876 + .pool +_081007E8: + ldr r0, =0x0000274f + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 20 + movs r2, 0x80 + lsls r2, 1 + adds r4, r2, 0 + adds r0, r4 + strh r0, [r5, 0x18] + ldr r0, =0x000027b0 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 20 + adds r0, r4 + strh r0, [r5, 0x20] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _08100876 + .pool +_0810081C: + ldrh r0, [r5, 0x1A] + adds r0, 0x1 + movs r7, 0 + strh r0, [r5, 0x1A] + lsls r0, 16 + cmp r0, 0 + blt _08100876 + strh r7, [r5, 0x1A] + ldrh r0, [r5, 0x18] + ldrb r2, [r5, 0x1C] + ldr r4, =gUnknown_08592878 + movs r3, 0x1E + ldrsh r1, [r5, r3] + lsls r1, 1 + adds r1, r4 + ldrh r3, [r1] + movs r1, 0x10 + bl pal_fade_1 + ldrh r0, [r5, 0x20] + ldrb r2, [r5, 0x1C] + movs r3, 0x1E + ldrsh r1, [r5, r3] + lsls r1, 1 + adds r1, r4 + ldrh r3, [r1] + movs r1, 0x10 + bl pal_fade_1 + ldrh r0, [r5, 0x1C] + adds r0, 0x1 + strh r0, [r5, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x11 + bne _08100876 + strh r7, [r5, 0x1C] + ldrh r0, [r5, 0x1E] + adds r0, 0x1 + strh r0, [r5, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + bne _08100876 + strh r7, [r5, 0x1E] +_08100876: + ldr r0, =0x0203841e + movs r2, 0xE + ldrsh r1, [r0, r2] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _0810088A + adds r0, r6, 0 + bl move_anim_task_del +_0810088A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81007C4 + + thumb_func_start sub_8100898 +sub_8100898: @ 8100898 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + ldr r1, =0x0203841e + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _081008B4 + adds r0, r6, 0 + bl move_anim_8072740 + b _0810098E + .pool +_081008B4: + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _081008C4 + ldr r4, =0x02038436 + b _081008C6 + .pool +_081008C4: + ldr r4, =0x02038437 +_081008C6: + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x0203841e + ldrh r1, [r0, 0x8] + strh r1, [r6, 0x2E] + movs r3, 0x2 + ldrsh r1, [r0, r3] + adds r7, r0, 0 + cmp r1, 0 + bne _08100908 + ldrh r0, [r7, 0x4] + adds r0, r5 + strh r0, [r6, 0x20] + ldrh r0, [r7, 0x6] + adds r0, r2 + strh r0, [r6, 0x22] + strh r5, [r6, 0x38] + strh r2, [r6, 0x3A] + b _08100918 + .pool +_08100908: + strh r5, [r6, 0x20] + strh r2, [r6, 0x22] + ldrh r0, [r7, 0x4] + adds r0, r5 + strh r0, [r6, 0x38] + ldrh r0, [r7, 0x6] + adds r0, r2 + strh r0, [r6, 0x3A] +_08100918: + ldrh r4, [r6, 0x20] + lsls r0, r4, 4 + strh r0, [r6, 0x30] + ldrh r5, [r6, 0x22] + lsls r0, r5, 4 + strh r0, [r6, 0x32] + movs r1, 0x38 + ldrsh r0, [r6, r1] + movs r2, 0x20 + ldrsh r1, [r6, r2] + subs r0, r1 + lsls r0, 4 + movs r3, 0x8 + ldrsh r1, [r7, r3] + bl __divsi3 + strh r0, [r6, 0x34] + movs r1, 0x3A + ldrsh r0, [r6, r1] + movs r2, 0x22 + ldrsh r1, [r6, r2] + subs r0, r1 + lsls r0, 4 + movs r3, 0x8 + ldrsh r1, [r7, r3] + bl __divsi3 + strh r0, [r6, 0x36] + ldrh r0, [r6, 0x38] + subs r0, r4 + lsls r0, 16 + asrs r0, 16 + ldrh r1, [r6, 0x3A] + subs r1, r5 + lsls r1, 16 + asrs r1, 16 + bl sub_80A74F4 + lsls r0, 16 + lsrs r4, r0, 16 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0810097A + ldr r1, =0xffff8000 + adds r0, r4, r1 + lsls r0, 16 + lsrs r4, r0, 16 +_0810097A: + movs r3, 0x80 + lsls r3, 1 + str r4, [sp] + adds r0, r6, 0 + movs r1, 0 + adds r2, r3, 0 + bl sub_80A73E0 + ldr r0, =sub_81009A0 + str r0, [r6, 0x1C] +_0810098E: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8100898 + + thumb_func_start sub_81009A0 +sub_81009A0: @ 81009A0 + push {r4,lr} + adds r2, r0, 0 + ldrh r3, [r2, 0x2E] + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _081009D0 + ldrh r0, [r2, 0x34] + ldrh r4, [r2, 0x30] + adds r0, r4 + strh r0, [r2, 0x30] + ldrh r1, [r2, 0x36] + ldrh r4, [r2, 0x32] + adds r1, r4 + strh r1, [r2, 0x32] + lsls r0, 16 + asrs r0, 20 + strh r0, [r2, 0x20] + lsls r1, 16 + asrs r1, 20 + strh r1, [r2, 0x22] + subs r0, r3, 0x1 + strh r0, [r2, 0x2E] + b _081009D6 +_081009D0: + adds r0, r2, 0 + bl move_anim_8074EE0 +_081009D6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81009A0 + + thumb_func_start sub_81009DC +sub_81009DC: @ 81009DC + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081009F2 + adds r0, r2, 0 + bl move_anim_8072740 +_081009F2: + pop {r0} + bx r0 + thumb_func_end sub_81009DC + + thumb_func_start sub_81009F8 +sub_81009F8: @ 81009F8 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08100A20 + ldr r2, =0x0203841e + ldrh r0, [r4, 0x20] + ldrh r1, [r2] + subs r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r2, 0x2] + b _08100A2C + .pool +_08100A20: + ldr r0, =0x0203841e + ldrh r1, [r0] + ldrh r2, [r4, 0x20] + adds r1, r2 + strh r1, [r4, 0x20] + ldrh r0, [r0, 0x2] +_08100A2C: + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r0, =sub_80A67D8 + str r0, [r4, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81009F8 + + thumb_func_start sub_8100A50 +sub_8100A50: @ 8100A50 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08100A6A + adds r0, r5, 0 + movs r1, 0x1 + bl StartObjectImageAnim +_08100A6A: + ldr r0, =sub_81009DC + str r0, [r5, 0x1C] + ldr r4, =0x0203841e + movs r0, 0 + ldrsh r1, [r4, r0] + adds r0, r5, 0 + bl sub_80A6864 + ldrh r0, [r4, 0x2] + ldrh r1, [r5, 0x22] + adds r0, r1 + strh r0, [r5, 0x22] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8100A50 + + thumb_func_start sub_8100A94 +sub_8100A94: @ 8100A94 + push {r4,lr} + adds r4, r0, 0 + ldr r1, =0x0203841e + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x34] + ldrh r0, [r1, 0xA] + strh r0, [r4, 0x38] + ldrb r1, [r1, 0xC] + adds r0, r4, 0 + bl StartObjectRotScalAnim + ldr r1, =move_anim_8074EE0 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A66DC + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8100A94 + + thumb_func_start sub_8100AE0 +sub_8100AE0: @ 8100AE0 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08100B14 + ldrh r0, [r5, 0x22] + adds r0, 0x8 + strh r0, [r5, 0x22] +_08100B14: + ldr r0, =sub_8100CCC + str r0, [r5, 0x1C] + ldr r0, =0x0203841e + movs r2, 0x4 + ldrsh r1, [r0, r2] + adds r3, r0, 0 + cmp r1, 0 + bne _08100B3C + ldrh r0, [r3] + ldrh r1, [r5, 0x20] + adds r0, r1 + strh r0, [r5, 0x20] + b _08100B50 + .pool +_08100B3C: + ldrh r0, [r5, 0x20] + ldrh r1, [r3] + subs r0, r1 + strh r0, [r5, 0x20] + adds r2, r5, 0 + adds r2, 0x3F + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] +_08100B50: + ldrh r0, [r3, 0x2] + ldrh r2, [r5, 0x22] + adds r0, r2 + strh r0, [r5, 0x22] + ldr r1, =0xfffffc00 + adds r0, r1, 0 + ldrh r2, [r5, 0x30] + adds r1, r0, r2 + strh r1, [r5, 0x30] + movs r2, 0x80 + lsls r2, 3 + adds r0, r2, 0 + ldrh r2, [r5, 0x32] + adds r0, r2 + strh r0, [r5, 0x32] + ldrh r0, [r3, 0x4] + strh r0, [r5, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _08100B7E + negs r0, r1 + strh r0, [r5, 0x30] +_08100B7E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8100AE0 + + thumb_func_start sub_8100B88 +sub_8100B88: @ 8100B88 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + ldr r0, =0x0203841e + movs r1, 0x6 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + beq _08100BA8 + cmp r0, 0x1 + ble _08100C24 + cmp r0, 0x2 + beq _08100BC8 + b _08100C24 + .pool +_08100BA8: + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r4, 0x2 + eors r0, r4 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r5] + eors r4, r0 + adds r0, r4, 0 + b _08100C34 + .pool +_08100BC8: + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r0, [r5] + movs r2, 0x2 + mov r8, r2 + mov r1, r8 + eors r0, r1 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _08100C3E + ldrb r0, [r5] + mov r2, r8 + eors r0, r2 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r7 + lsrs r7, r0, 1 + ldrb r0, [r5] + mov r1, r8 + eors r0, r1 + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + lsrs r4, r0, 1 + b _08100C3E + .pool +_08100C24: + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r4] +_08100C34: + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r4, r0, 24 +_08100C3E: + strh r7, [r6, 0x20] + strh r4, [r6, 0x22] + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08100C56 + ldrh r0, [r6, 0x22] + adds r0, 0x8 + strh r0, [r6, 0x22] +_08100C56: + ldr r0, =sub_8100CCC + str r0, [r6, 0x1C] + ldr r0, =0x0203841e + movs r2, 0x4 + ldrsh r1, [r0, r2] + adds r3, r0, 0 + cmp r1, 0 + bne _08100C7C + ldrh r0, [r3] + ldrh r1, [r6, 0x20] + adds r0, r1 + strh r0, [r6, 0x20] + b _08100C90 + .pool +_08100C7C: + ldrh r0, [r6, 0x20] + ldrh r1, [r3] + subs r0, r1 + strh r0, [r6, 0x20] + adds r2, r6, 0 + adds r2, 0x3F + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] +_08100C90: + ldrh r0, [r3, 0x2] + ldrh r2, [r6, 0x22] + adds r0, r2 + strh r0, [r6, 0x22] + ldr r1, =0xfffffc00 + adds r0, r1, 0 + ldrh r2, [r6, 0x30] + adds r1, r0, r2 + strh r1, [r6, 0x30] + movs r2, 0x80 + lsls r2, 3 + adds r0, r2, 0 + ldrh r2, [r6, 0x32] + adds r0, r2 + strh r0, [r6, 0x32] + ldrh r0, [r3, 0x4] + strh r0, [r6, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _08100CBE + negs r0, r1 + strh r0, [r6, 0x30] +_08100CBE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8100B88 + + thumb_func_start sub_8100CCC +sub_8100CCC: @ 8100CCC + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x30] + ldrh r2, [r4, 0x34] + adds r0, r1, r2 + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x32] + ldrh r2, [r4, 0x36] + adds r0, r2 + strh r0, [r4, 0x36] + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08100CEE + adds r0, r1, 0 + adds r0, 0x18 + b _08100CF2 +_08100CEE: + adds r0, r1, 0 + subs r0, 0x18 +_08100CF2: + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x32] + subs r0, 0x18 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + bne _08100D28 + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + movs r0, 0x3 + strh r0, [r4, 0x2E] + ldr r0, =sub_80A64B0 + str r0, [r4, 0x1C] +_08100D28: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8100CCC + + thumb_func_start sub_8100D38 +sub_8100D38: @ 8100D38 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r1, [r5, 0x32] + movs r2, 0x32 + ldrsh r0, [r5, r2] + cmp r0, 0x1 + ble _08100DDC + ldrh r1, [r5, 0x34] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08100D94 + adds r3, r5, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r1 + strb r0, [r3] + ldr r4, =0x02020630 + movs r0, 0x2E + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r3, [r0] + adds r1, r2, 0 + ands r1, r3 + strb r1, [r0] + movs r0, 0x30 + ldrsh r1, [r5, r0] + 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] + b _08100DCA + .pool +_08100D94: + adds r1, r5, 0 + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldr r3, =0x02020630 + movs r0, 0x2E + ldrsh r1, [r5, 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] + movs r0, 0x30 + ldrsh r1, [r5, 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] +_08100DCA: + movs r0, 0 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x34] + adds r0, 0x1 + strh r0, [r5, 0x34] + b _08100DE0 + .pool +_08100DDC: + adds r0, r1, 0x1 + strh r0, [r5, 0x32] +_08100DE0: + movs r1, 0x34 + ldrsh r0, [r5, r1] + cmp r0, 0xA + bne _08100E10 + movs r2, 0x2E + ldrsh r1, [r5, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl RemoveObjectAndFreeTiles + movs r0, 0x30 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + adds r0, r5, 0 + bl move_anim_8072740 +_08100E10: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8100D38 + + thumb_func_start sub_8100E1C +sub_8100E1C: @ 8100E1C + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x0203841e + ldrh r0, [r4, 0x4] + strh r0, [r5, 0x2E] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08100E44 + ldrh r0, [r5, 0x20] + ldrh r1, [r4] + subs r0, r1 + b _08100E4A + .pool +_08100E44: + ldrh r0, [r4] + ldrh r1, [r5, 0x20] + adds r0, r1 +_08100E4A: + strh r0, [r5, 0x20] + ldr r4, =0x0203841e + ldrb r1, [r4, 0xA] + adds r0, r5, 0 + bl StartObjectImageAnim + ldrh r0, [r4, 0x6] + negs r0, r0 + strh r0, [r5, 0x30] + ldrh r0, [r4, 0x2] + ldrh r1, [r5, 0x22] + adds r0, r1 + strh r0, [r5, 0x22] + ldrh r0, [r4, 0x8] + strh r0, [r5, 0x34] + ldr r1, =sub_8100E80 + str r1, [r5, 0x1C] + adds r0, r5, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8100E1C + + thumb_func_start sub_8100E80 +sub_8100E80: @ 8100E80 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x64 + bl cosine + strh r0, [r4, 0x24] + movs r2, 0x2E + ldrsh r0, [r4, r2] + movs r1, 0x14 + bl sine + strh r0, [r4, 0x26] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x7F + bgt _08100EAC + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0 + b _08100EB2 +_08100EAC: + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0xE +_08100EB2: + strb r0, [r1] + ldrh r0, [r4, 0x30] + ldrh r2, [r4, 0x2E] + adds r0, r2 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x38] + adds r0, 0x82 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x34 + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _08100EE8 + adds r0, r4, 0 + bl move_anim_8072740 +_08100EE8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8100E80 + + thumb_func_start sub_8100EF0 +sub_8100EF0: @ 8100EF0 + push {r4-r6,lr} + adds r5, r0, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08100F06 + ldr r1, =0x0203841e + ldrh r0, [r1, 0x2] + adds r0, 0x8 + strh r0, [r1, 0x2] +_08100F06: + ldr r6, =0x02038436 + ldrb r0, [r6] + movs r1, 0 + bl sub_80A60AC + lsls r0, 24 + ldr r4, =0x0203841e + lsrs r0, 24 + ldrh r1, [r4] + adds r0, r1 + strh r0, [r5, 0x20] + ldrb r0, [r6] + movs r1, 0x1 + bl sub_80A60AC + lsls r0, 24 + lsrs r0, 24 + ldrh r4, [r4, 0x2] + adds r0, r4 + strh r0, [r5, 0x22] + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08100F44 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08100F6C +_08100F44: + ldrb r0, [r6] + bl sub_80A8328 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + lsls r0, 2 + ldrb r2, [r5, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0x5] + b _08100F84 + .pool +_08100F6C: + ldrb r0, [r6] + bl sub_80A8328 + movs r1, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r5, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] +_08100F84: + ldr r0, =0x0203841e + ldrh r0, [r0, 0x4] + strh r0, [r5, 0x2E] + ldr r0, =0x00002828 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 20 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r0, [r5, 0x32] + movs r4, 0x10 + movs r0, 0x10 + strh r0, [r5, 0x3C] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + ldrh r0, [r5, 0x3C] + lsls r1, r0, 8 + subs r4, r0 + orrs r1, r4 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + ldr r0, =sub_8100FD4 + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8100EF0 + + thumb_func_start sub_8100FD4 +sub_8100FD4: @ 8100FD4 + push {r4-r6,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x38] + adds r0, 0x60 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 24 + negs r0, r0 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08101032 + movs r0, 0 + strh r0, [r4, 0x30] + ldr r1, =0x02037b14 + movs r2, 0x32 + ldrsh r0, [r4, r2] + adds r0, 0x1 + lsls r0, 1 + adds r0, r1 + ldrh r5, [r0] + movs r2, 0 + adds r6, r1, 0 + adds r3, r6, 0 +_0810100C: + movs r1, 0x32 + ldrsh r0, [r4, r1] + adds r2, 0x1 + adds r0, r2 + lsls r1, r0, 1 + adds r1, r3 + adds r0, 0x1 + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r1] + cmp r2, 0x5 + ble _0810100C + movs r2, 0x32 + ldrsh r0, [r4, r2] + adds r0, 0x7 + lsls r0, 1 + adds r0, r6 + strh r5, [r0] +_08101032: + ldrh r2, [r4, 0x3C] + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x6 + ble _0810106C + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + ble _08101080 + ldrh r0, [r4, 0x3A] + adds r0, 0x1 + strh r0, [r4, 0x3A] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0810106C + movs r0, 0 + strh r0, [r4, 0x3A] + subs r2, 0x1 + strh r2, [r4, 0x3C] + lsls r1, r2, 8 + movs r0, 0x10 + subs r0, r2 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg +_0810106C: + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _08101080 + subs r0, r1, 0x1 + strh r0, [r4, 0x2E] + b _081010C2 + .pool +_08101080: + ldrh r0, [r4, 0x3A] + adds r0, 0x1 + strh r0, [r4, 0x3A] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081010C2 + movs r0, 0 + strh r0, [r4, 0x3A] + ldrh r2, [r4, 0x3C] + adds r2, 0x1 + strh r2, [r4, 0x3C] + lsls r1, r2, 8 + movs r0, 0x10 + subs r0, r2 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _081010C2 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_80A67F4 + str r0, [r4, 0x1C] +_081010C2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8100FD4 + + thumb_func_start sub_81010CC +sub_81010CC: @ 81010CC + push {r4-r6,lr} + adds r4, r0, 0 + ldr r6, =0x02038437 + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r4, 0x20] + ldrb r0, [r6] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0000ffe8 + adds r0, r1 + strh r0, [r4, 0x22] + strh r5, [r4, 0x2E] + strh r5, [r4, 0x30] + strh r5, [r4, 0x32] + strh r5, [r4, 0x34] + strh r5, [r4, 0x36] + strh r5, [r4, 0x3A] + movs r0, 0x10 + strh r0, [r4, 0x3C] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + ldrh r1, [r4, 0x3C] + lsls r1, 8 + ldrh r0, [r4, 0x3A] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + ldr r0, =sub_8101138 + str r0, [r4, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81010CC + + thumb_func_start sub_8101138 +sub_8101138: @ 8101138 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bls _08101146 + b _08101290 +_08101146: + lsls r0, 2 + ldr r1, =_08101154 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08101154: + .4byte _08101168 + .4byte _081011CC + .4byte _081011E8 + .4byte _08101266 + .4byte _0810127A +_08101168: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + cmp r0, 0 + bgt _08101176 + b _08101290 +_08101176: + movs r0, 0 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08101198 + ldrh r1, [r4, 0x3A] + movs r2, 0x3A + ldrsh r0, [r4, r2] + cmp r0, 0xF + bgt _081011A6 + adds r0, r1, 0x1 + strh r0, [r4, 0x3A] + b _081011A6 +_08101198: + ldrh r1, [r4, 0x3C] + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _081011A6 + subs r0, r1, 0x1 + strh r0, [r4, 0x3C] +_081011A6: + ldrh r1, [r4, 0x3C] + lsls r1, 8 + ldrh r0, [r4, 0x3A] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _08101290 + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08101290 + strh r0, [r4, 0x30] + b _08101272 +_081011CC: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _08101290 + movs r0, 0 + strh r0, [r4, 0x30] + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + b _08101272 +_081011E8: + adds r0, r4, 0 + movs r1, 0x10 + movs r2, 0x4 + bl sub_8101298 + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _0810120A + movs r0, 0 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x22] + adds r0, 0x1 + strh r0, [r4, 0x22] +_0810120A: + ldrh r0, [r4, 0x32] + adds r1, r0, 0x1 + strh r1, [r4, 0x32] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x1D + ble _08101290 + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + beq _08101230 + ldrh r1, [r4, 0x3A] + movs r2, 0x3A + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _0810123E + subs r0, r1, 0x1 + strh r0, [r4, 0x3A] + b _0810123E +_08101230: + ldrh r1, [r4, 0x3C] + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0xF + bgt _0810123E + adds r0, r1, 0x1 + strh r0, [r4, 0x3C] +_0810123E: + ldrh r1, [r4, 0x3C] + lsls r1, 8 + ldrh r0, [r4, 0x3A] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x3A + ldrsh r1, [r4, r0] + cmp r1, 0 + bne _08101290 + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0x10 + bne _08101290 + strh r1, [r4, 0x30] + strh r1, [r4, 0x32] + b _08101272 +_08101266: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_08101272: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _08101290 +_0810127A: + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r4, 0 + bl move_anim_8072740 +_08101290: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8101138 + + thumb_func_start sub_8101298 +sub_8101298: @ 8101298 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0xB + bgt _081012AA + ldrh r0, [r4, 0x36] + adds r0, 0x2 + strh r0, [r4, 0x36] +_081012AA: + ldrh r5, [r4, 0x34] + adds r0, r5, 0 + subs r0, 0x12 + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + cmp r0, 0x17 + bhi _081012C0 + ldrh r0, [r4, 0x36] + subs r0, 0x2 + strh r0, [r4, 0x36] +_081012C0: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x2F + ble _081012CE + ldrh r0, [r4, 0x36] + adds r0, 0x2 + strh r0, [r4, 0x36] +_081012CE: + movs r1, 0x36 + ldrsh r0, [r4, r1] + movs r1, 0x9 + bl __divsi3 + strh r0, [r4, 0x24] + movs r1, 0x36 + ldrsh r0, [r4, r1] + movs r1, 0xE + bl __divsi3 + strh r0, [r4, 0x26] + lsls r0, 16 + cmp r0, 0 + bge _081012F4 + movs r1, 0x26 + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0x26] +_081012F4: + adds r0, r5, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3B + ble _08101304 + movs r0, 0 + strh r0, [r4, 0x34] +_08101304: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8101298 + + thumb_func_start sub_810130C +sub_810130C: @ 810130C + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x0203841e + movs r1, 0x4 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08101320 + adds r0, r4, 0 + bl sub_80A6838 +_08101320: + movs r0, 0 + ldrsh r1, [r5, r0] + adds r0, r4, 0 + bl sub_80A6864 + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldrh r0, [r5, 0xA] + strh r0, [r4, 0x2E] + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x30] + ldrh r0, [r5, 0x8] + strh r0, [r4, 0x32] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A656C + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810130C + + thumb_func_start sub_810135C +sub_810135C: @ 810135C + push {r4-r6,lr} + adds r5, r0, 0 + ldr r0, =0x0203841e + movs r1, 0x4 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08101378 + ldr r0, =0x02038436 + b _0810137A + .pool +_08101378: + ldr r0, =0x02038437 +_0810137A: + ldrb r6, [r0] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _081013C4 + movs r1, 0x2 + adds r0, r6, 0 + eors r0, r1 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _081013C4 + ldr r4, =0x0203841e + ldrb r1, [r4, 0xC] + adds r2, r5, 0 + adds r2, 0x20 + adds r3, r5, 0 + adds r3, 0x22 + adds r0, r6, 0 + bl sub_80A8924 + movs r2, 0 + ldrsh r1, [r4, r2] + adds r0, r5, 0 + bl sub_80A6864 + ldrh r0, [r4, 0x2] + ldrh r1, [r5, 0x22] + adds r0, r1 + strh r0, [r5, 0x22] + b _08101414 + .pool +_081013C4: + ldr r4, =0x0203841e + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _081013E8 + adds r0, r6, 0 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + adds r0, r6, 0 + movs r1, 0x1 + b _081013FA + .pool +_081013E8: + adds r0, r6, 0 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + adds r0, r6, 0 + movs r1, 0x3 +_081013FA: + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r4, [r4, 0x2] + adds r0, r4 + strh r0, [r5, 0x22] + ldr r0, =0x0203841e + movs r2, 0 + ldrsh r1, [r0, r2] + adds r0, r5, 0 + bl sub_80A6864 +_08101414: + ldr r1, =0x0203841e + ldrh r0, [r1, 0xA] + strh r0, [r5, 0x2E] + ldrh r0, [r1, 0x6] + strh r0, [r5, 0x30] + ldrh r0, [r1, 0x8] + strh r0, [r5, 0x32] + ldr r1, =move_anim_8072740 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A656C + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810135C + + thumb_func_start sub_8101440 +sub_8101440: @ 8101440 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6838 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08101474 + ldr r0, =0x0203841e + ldrh r1, [r0] + ldrh r2, [r4, 0x20] + adds r1, r2 + strh r1, [r4, 0x20] + ldrh r0, [r0, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + b _0810148E + .pool +_08101474: + ldr r2, =0x0203841e + ldrh r0, [r4, 0x20] + ldrh r1, [r2] + subs r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r2, 0x2] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnim +_0810148E: + ldr r0, =sub_81014A0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8101440 + + thumb_func_start sub_81014A0 +sub_81014A0: @ 81014A0 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1E + ble _081014D8 + movs r0, 0x2E + ldrsh r1, [r4, r0] + movs r0, 0x1E + subs r0, r1 + movs r1, 0x3 + bl __divsi3 + strh r0, [r4, 0x26] + movs r1, 0x30 + ldrsh r0, [r4, r1] + lsls r0, 18 + asrs r0, 16 + movs r1, 0x3 + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] +_081014D8: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081014EC + adds r0, r4, 0 + bl move_anim_8072740 +_081014EC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81014A0 + + thumb_func_start sub_81014F4 +sub_81014F4: @ 81014F4 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6838 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810152C + ldr r1, =0x0203841e + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + movs r0, 0x1 + strh r0, [r4, 0x34] + b _0810154A + .pool +_0810152C: + ldr r2, =0x0203841e + ldrh r0, [r4, 0x20] + ldrh r1, [r2] + subs r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r2, 0x2] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + ldr r0, =0x0000ffff + strh r0, [r4, 0x34] + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim +_0810154A: + ldr r0, =sub_8101560 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81014F4 + + thumb_func_start sub_8101560 +sub_8101560: @ 8101560 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x28 + bl __divsi3 + negs r0, r0 + strh r0, [r4, 0x26] + movs r2, 0x36 + ldrsh r0, [r4, r2] + movs r1, 0xA + bl __divsi3 + strh r0, [r4, 0x24] + movs r1, 0x34 + ldrsh r0, [r4, r1] + lsls r0, 1 + ldrh r2, [r4, 0x36] + adds r0, r2 + strh r0, [r4, 0x36] + ldrh r0, [r4, 0x30] + ldrh r2, [r4, 0x2E] + adds r1, r0, r2 + strh r1, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + ble _081015A4 + adds r0, r4, 0 + bl move_anim_8074EE0 +_081015A4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8101560 + + thumb_func_start sub_81015AC +sub_81015AC: @ 81015AC + push {lr} + ldrh r1, [r0, 0x20] + subs r1, 0x20 + strh r1, [r0, 0x20] + ldrh r1, [r0, 0x22] + subs r1, 0x20 + strh r1, [r0, 0x22] + movs r1, 0x14 + strh r1, [r0, 0x2E] + ldr r1, =sub_80A64B0 + str r1, [r0, 0x1C] + ldr r1, =sub_81015D4 + bl oamt_set_x3A_32 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81015AC + + thumb_func_start sub_81015D4 +sub_81015D4: @ 81015D4 + push {r4-r6,lr} + adds r5, r0, 0 + ldrh r6, [r5, 0x38] + movs r1, 0x1 + adds r0, r1, 0 + ands r0, r6 + cmp r0, 0 + beq _081015EA + cmp r0, 0x1 + beq _08101604 + b _0810166A +_081015EA: + strh r1, [r5, 0x2E] + ldr r0, =sub_80A64B0 + str r0, [r5, 0x1C] + ldr r1, =sub_81015D4 + adds r0, r5, 0 + bl oamt_set_x3A_32 + b _0810166A + .pool +_08101604: + ldrh r3, [r5, 0x24] + ldrh r0, [r5, 0x20] + adds r3, r0 + movs r0, 0 + strh r3, [r5, 0x20] + ldrh r4, [r5, 0x26] + ldrh r1, [r5, 0x22] + adds r4, r1 + strh r4, [r5, 0x22] + strh r0, [r5, 0x26] + strh r0, [r5, 0x24] + movs r0, 0x8 + strh r0, [r5, 0x2E] + ldr r2, =gUnknown_08592CD0 + lsls r0, r6, 16 + asrs r0, 24 + lsls r0, 1 + adds r1, r0, r2 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + adds r3, r1 + strh r3, [r5, 0x32] + adds r2, 0x1 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + adds r4, r0 + strh r4, [r5, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r5, 0x1C] + ldr r1, =sub_8101684 + adds r0, r5, 0 + bl oamt_set_x3A_32 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + ldrh r1, [r5, 0x38] + adds r0, r1 + strh r0, [r5, 0x38] + movs r0, 0x3F + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xD2 + bl audio_play_and_stuff +_0810166A: + ldrh r0, [r5, 0x38] + movs r1, 0x1 + eors r0, r1 + strh r0, [r5, 0x38] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81015D4 + + thumb_func_start sub_8101684 +sub_8101684: @ 8101684 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x38] + lsls r0, 16 + asrs r0, 24 + cmp r0, 0x4 + bne _081016AC + movs r0, 0xA + strh r0, [r2, 0x2E] + ldr r0, =sub_80A64B0 + str r0, [r2, 0x1C] + ldr r1, =sub_81016B8 + adds r0, r2, 0 + bl oamt_set_x3A_32 + b _081016B0 + .pool +_081016AC: + ldr r0, =sub_81015D4 + str r0, [r2, 0x1C] +_081016B0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8101684 + + thumb_func_start sub_81016B8 +sub_81016B8: @ 81016B8 + push {r4-r7,lr} + adds r5, r0, 0 + ldrh r1, [r5, 0x6] + cmp r1, 0 + bne _081016E0 + movs r0, 0x3 + strh r0, [r5, 0x2E] + strh r1, [r5, 0x30] + strh r1, [r5, 0x32] + ldr r0, =sub_80A64B0 + str r0, [r5, 0x1C] + ldr r1, =sub_8101774 + adds r0, r5, 0 + bl oamt_set_x3A_32 + b _08101760 + .pool +_081016E0: + ldrh r0, [r5, 0x6] + cmp r0, 0x2 + beq _08101700 + cmp r0, 0x2 + bgt _081016F0 + cmp r0, 0x1 + beq _081016F6 + b _08101714 +_081016F0: + cmp r0, 0x3 + beq _08101708 + b _08101714 +_081016F6: + ldr r6, =0x0000fff8 + adds r7, r6, 0 + b _08101718 + .pool +_08101700: + ldr r7, =0x0000fff8 + b _08101716 + .pool +_08101708: + movs r7, 0x8 + ldr r6, =0x0000fff8 + b _08101718 + .pool +_08101714: + movs r7, 0x8 +_08101716: + movs r6, 0x8 +_08101718: + ldrh r0, [r5, 0x24] + ldrh r1, [r5, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r5, 0x20] + ldrh r0, [r5, 0x26] + ldrh r2, [r5, 0x22] + adds r0, r2 + strh r0, [r5, 0x22] + strh r1, [r5, 0x26] + strh r1, [r5, 0x24] + movs r0, 0x6 + strh r0, [r5, 0x2E] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r7 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r6 + strh r0, [r5, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r5, 0x1C] + ldr r1, =sub_8101820 + adds r0, r5, 0 + bl oamt_set_x3A_32 +_08101760: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81016B8 + + thumb_func_start sub_8101774 +sub_8101774: @ 8101774 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08101794 + ldrh r0, [r4, 0x30] + adds r0, 0x3 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _081017A4 + movs r0, 0x10 + b _081017A2 +_08101794: + ldrh r0, [r4, 0x30] + subs r0, 0x3 + strh r0, [r4, 0x30] + lsls r0, 16 + cmp r0, 0 + bge _081017A4 + movs r0, 0 +_081017A2: + strh r0, [r4, 0x30] +_081017A4: + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x1 + movs r3, 0x1 + bl sub_80A75AC + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x00007fff + bl sub_80A2A20 + movs r3, 0x30 + ldrsh r0, [r4, r3] + cmp r0, 0x10 + bne _0810180C + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + ldrb r1, [r4, 0x5] + lsrs r1, 4 + lsls r0, r1, 5 + ldr r2, =0x02037924 + adds r0, r2 + lsls r1, 4 + ldr r3, =0x00000101 + adds r2, r3, 0 + orrs r1, r2 + movs r2, 0x4 + bl gpu_pal_apply + movs r0, 0x3F + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xC0 + bl audio_play_and_stuff + b _08101814 + .pool +_0810180C: + cmp r0, 0 + bne _08101814 + ldr r0, =sub_8101820 + str r0, [r4, 0x1C] +_08101814: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8101774 + + thumb_func_start sub_8101820 +sub_8101820: @ 8101820 + push {lr} + adds r2, r0, 0 + ldr r0, =0x0203841e + ldrh r1, [r0, 0xE] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _08101838 + movs r0, 0 + strh r0, [r2, 0x30] + strh r0, [r2, 0x2E] + ldr r0, =sub_8101848 + str r0, [r2, 0x1C] +_08101838: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8101820 + + thumb_func_start sub_8101848 +sub_8101848: @ 8101848 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _0810187C + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + 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] +_0810187C: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x8 + bne _08101890 + adds r0, r4, 0 + bl move_anim_8072740 +_08101890: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8101848 + + thumb_func_start sub_8101898 +sub_8101898: @ 8101898 + push {r4,lr} + adds r3, r0, 0 + ldr r0, =0x0203841e + ldrh r0, [r0] + strh r0, [r3, 0x6] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _081018BC + ldrh r0, [r3, 0x20] + subs r0, 0x18 + strh r0, [r3, 0x20] + ldrh r0, [r3, 0x22] + subs r0, 0x18 + strh r0, [r3, 0x22] + b _0810190E + .pool +_081018BC: + cmp r0, 0x2 + bne _081018D8 + ldrh r0, [r3, 0x20] + subs r0, 0x18 + strh r0, [r3, 0x20] + ldrh r0, [r3, 0x22] + adds r0, 0x18 + strh r0, [r3, 0x22] + ldrb r1, [r3, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x20 + b _0810190A +_081018D8: + cmp r0, 0x3 + bne _081018F4 + ldrh r0, [r3, 0x20] + adds r0, 0x18 + strh r0, [r3, 0x20] + ldrh r0, [r3, 0x22] + subs r0, 0x18 + strh r0, [r3, 0x22] + ldrb r1, [r3, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + b _0810190A +_081018F4: + ldrh r0, [r3, 0x20] + adds r0, 0x18 + strh r0, [r3, 0x20] + ldrh r0, [r3, 0x22] + adds r0, 0x18 + strh r0, [r3, 0x22] + ldrb r1, [r3, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x30 +_0810190A: + orrs r0, r1 + strb r0, [r3, 0x3] +_0810190E: + ldrh r2, [r3, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x10 + ldr r4, =0x000003ff + adds r0, r4, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x4] + ldr r1, =sub_81015AC + str r1, [r3, 0x1C] + adds r0, r3, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8101898 + + thumb_func_start sub_8101940 +sub_8101940: @ 8101940 + push {lr} + adds r3, r0, 0 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + movs r0, 0 + strh r0, [r3, 0x2E] + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + beq _0810197C + cmp r0, 0x1 + bgt _0810196C + cmp r0, 0 + beq _08101972 + b _0810198C + .pool +_0810196C: + cmp r0, 0x2 + beq _08101984 + b _0810198C +_08101972: + ldr r0, =sub_8101998 + b _0810198E + .pool +_0810197C: + ldr r0, =sub_8101A74 + b _0810198E + .pool +_08101984: + ldr r0, =sub_8101AC4 + b _0810198E + .pool +_0810198C: + ldr r0, =sub_8101B84 +_0810198E: + str r0, [r3, 0x1C] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8101940 + + thumb_func_start sub_8101998 +sub_8101998: @ 8101998 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x6 + strh r0, [r4, 0x2E] + ldr r5, =0x02038436 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + movs r2, 0x2 + negs r2, r2 + adds r1, r2, 0 + cmp r0, 0 + beq _081019B6 + movs r1, 0x2 +_081019B6: + strh r1, [r4, 0x30] + movs r0, 0 + strh r0, [r4, 0x32] + ldr r1, =0x020241e4 + ldrb r0, [r5] + adds r0, r1 + ldrb r0, [r0] + strh r0, [r4, 0x34] + ldr r1, =sub_81019E8 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A6630 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8101998 + + thumb_func_start sub_81019E8 +sub_81019E8: @ 81019E8 + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0x2E + ldrsh r6, [r5, r0] + cmp r6, 0 + bne _08101A24 + ldr r1, =0x020241e4 + ldr r4, =0x02038436 + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + strh r0, [r5, 0x34] + movs r1, 0 + bl sub_80A7270 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x3A] + ldr r2, =0xfffffd00 + adds r1, r2, 0 + cmp r0, 0 + beq _08101A20 + movs r0, 0xC0 + lsls r0, 2 + adds r1, r0, 0 +_08101A20: + strh r1, [r5, 0x36] + strh r6, [r5, 0x38] +_08101A24: + ldrh r0, [r5, 0x36] + ldrh r1, [r5, 0x38] + adds r0, r1 + strh r0, [r5, 0x38] + ldrh r0, [r5, 0x34] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r5, 0x38] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrh r0, [r5, 0x34] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A73A0 + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _08101A5E + movs r0, 0 + strh r0, [r5, 0x2E] + ldr r0, =sub_8101B84 + str r0, [r5, 0x1C] +_08101A5E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81019E8 + + thumb_func_start sub_8101A74 +sub_8101A74: @ 8101A74 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x4 + strh r0, [r4, 0x2E] + ldr r5, =0x02038436 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + movs r1, 0x3 + cmp r0, 0 + beq _08101A92 + movs r0, 0x3 + negs r0, r0 + adds r1, r0, 0 +_08101A92: + strh r1, [r4, 0x30] + movs r0, 0 + strh r0, [r4, 0x32] + ldr r1, =0x020241e4 + ldrb r0, [r5] + adds r0, r1 + ldrb r0, [r0] + strh r0, [r4, 0x34] + ldr r1, =sub_8101B84 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A6630 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8101A74 + + thumb_func_start sub_8101AC4 +sub_8101AC4: @ 8101AC4 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _08101ADE + movs r0, 0 + strh r0, [r1, 0x2E] + ldr r0, =sub_8101AE8 + str r0, [r1, 0x1C] +_08101ADE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8101AC4 + + thumb_func_start sub_8101AE8 +sub_8101AE8: @ 8101AE8 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08101B38 + ldr r1, =0x020241e4 + ldr r4, =0x02038436 + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + strh r0, [r5, 0x34] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x3A] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08101B2C + movs r0, 0xFC + lsls r0, 8 + strh r0, [r5, 0x36] + movs r0, 0xC0 + lsls r0, 4 + b _08101B36 + .pool +_08101B2C: + movs r0, 0x80 + lsls r0, 3 + strh r0, [r5, 0x36] + movs r0, 0xF4 + lsls r0, 8 +_08101B36: + strh r0, [r5, 0x38] +_08101B38: + ldrh r0, [r5, 0x36] + ldrh r1, [r5, 0x38] + adds r0, r1 + strh r0, [r5, 0x38] + ldrh r0, [r5, 0x34] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r5, 0x38] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrh r0, [r5, 0x34] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A73A0 + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _08101B78 + ldrh r0, [r5, 0x34] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A7344 + ldr r0, =sub_8101B84 + str r0, [r5, 0x1C] +_08101B78: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8101AE8 + + thumb_func_start sub_8101B84 +sub_8101B84: @ 8101B84 + push {lr} + bl move_anim_8072740 + pop {r0} + bx r0 + thumb_func_end sub_8101B84 + + thumb_func_start sub_8101B90 +sub_8101B90: @ 8101B90 + movs r1, 0 + strh r1, [r0, 0x2E] + ldr r1, =sub_8101BA0 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_8101B90 + + thumb_func_start sub_8101BA0 +sub_8101BA0: @ 8101BA0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x2E + ldrsh r5, [r4, r0] + cmp r5, 0x1 + beq _08101BFA + cmp r5, 0x1 + bgt _08101BB6 + cmp r5, 0 + beq _08101BBC + b _08101C8E +_08101BB6: + cmp r5, 0x2 + beq _08101C4C + b _08101C8E +_08101BBC: + strh r5, [r4, 0x30] + ldr r1, =0x020241e4 + ldr r2, =0x02038436 + ldrb r0, [r2] + adds r0, r1 + ldrb r0, [r0] + strh r0, [r4, 0x32] + ldrb r0, [r2] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x34] + ldr r2, =0xfffffe00 + adds r1, r2, 0 + cmp r0, 0 + beq _08101BE4 + movs r0, 0x80 + lsls r0, 2 + adds r1, r0, 0 +_08101BE4: + strh r1, [r4, 0x36] + strh r5, [r4, 0x38] + ldrh r0, [r4, 0x32] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_80A7270 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_08101BFA: + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x38] + adds r0, r1 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x32] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x38] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrh r0, [r4, 0x32] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A73A0 + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _08101C8E + movs r0, 0 + strh r0, [r4, 0x30] + movs r2, 0x36 + ldrsh r0, [r4, r2] + negs r0, r0 + strh r0, [r4, 0x36] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _08101C8E + .pool +_08101C4C: + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x38] + adds r0, r1 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x32] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x38] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrh r0, [r4, 0x32] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A73A0 + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _08101C8E + ldrh r0, [r4, 0x32] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A7344 + adds r0, r4, 0 + bl move_anim_8072740 +_08101C8E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8101BA0 + + thumb_func_start sub_8101C94 +sub_8101C94: @ 8101C94 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + ldr r1, =0x020241e4 + ldr r2, =0x02038436 + ldrb r0, [r2] + adds r0, r1 + ldrb r0, [r0] + movs r4, 0 + strh r0, [r5, 0x8] + ldrb r0, [r2] + bl battle_side_get_owner + lsls r0, 24 + lsrs r2, r0, 24 + strh r2, [r5, 0xA] + strh r4, [r5, 0xC] + ldr r0, =0x0203841e + movs r3, 0 + ldrsh r1, [r0, r3] + cmp r1, 0 + beq _08101CE8 + cmp r1, 0x1 + beq _08101D04 + adds r0, r6, 0 + bl move_anim_task_del + b _08101D22 + .pool +_08101CE8: + strh r1, [r5, 0xC] + movs r0, 0x8 + strh r0, [r5, 0xE] + strh r1, [r5, 0x10] + movs r0, 0x3 + strh r0, [r5, 0x12] + cmp r2, 0 + bne _08101CFC + negs r0, r0 + strh r0, [r5, 0x12] +_08101CFC: + ldr r0, =sub_8101D2C + b _08101D20 + .pool +_08101D04: + movs r0, 0x8 + strh r0, [r5, 0xE] + movs r0, 0xC0 + lsls r0, 3 + strh r0, [r5, 0x10] + movs r1, 0xC0 + strh r1, [r5, 0x12] + cmp r2, 0 + bne _08101D1E + negs r0, r0 + strh r0, [r5, 0x10] + negs r0, r1 + strh r0, [r5, 0x12] +_08101D1E: + ldr r0, =sub_8101EEC +_08101D20: + str r0, [r5] +_08101D22: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8101C94 + + thumb_func_start sub_8101D2C +sub_8101D2C: @ 8101D2C + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bls _08101D46 + b _08101EE6 +_08101D46: + lsls r0, 2 + ldr r1, =_08101D58 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08101D58: + .4byte _08101D6C + .4byte _08101D9E + .4byte _08101DF8 + .4byte _08101E70 + .4byte _08101EB4 +_08101D6C: + movs r2, 0xE + ldrsh r1, [r4, r2] + cmp r1, 0 + beq _08101D7C + ldrh r2, [r4, 0x12] + ldrh r3, [r4, 0x10] + adds r2, r3 + b _08101EC2 +_08101D7C: + movs r0, 0x8 + strh r0, [r4, 0xE] + strh r1, [r4, 0x10] + movs r1, 0xA + ldrsh r0, [r4, r1] + movs r1, 0xC0 + cmp r0, 0 + bne _08101D92 + movs r2, 0xC0 + negs r2, r2 + adds r1, r2, 0 +_08101D92: + strh r1, [r4, 0x12] + ldrb r0, [r4, 0x8] + movs r1, 0 + bl sub_80A7270 + b _08101EA8 +_08101D9E: + movs r3, 0xE + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _08101DC4 + ldrh r0, [r4, 0x12] + ldrh r1, [r4, 0x10] + adds r0, r1 + strh r0, [r4, 0x10] + ldrb r0, [r4, 0x8] + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x10] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrb r0, [r4, 0x8] + bl sub_80A73A0 + b _08101ED4 +_08101DC4: + movs r0, 0x8 + strh r0, [r4, 0xE] + ldr r2, =0x02020630 + movs r3, 0x8 + ldrsh r1, [r4, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x24] + strh r0, [r4, 0x10] + movs r1, 0xA + ldrsh r0, [r4, r1] + movs r2, 0x2 + negs r2, r2 + adds r1, r2, 0 + cmp r0, 0 + bne _08101DEA + movs r1, 0x2 +_08101DEA: + strh r1, [r4, 0x12] + movs r0, 0x1 + strh r0, [r4, 0x14] + b _08101EA8 + .pool +_08101DF8: + ldrh r2, [r4, 0xE] + movs r3, 0xE + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _08101E54 + ldrh r1, [r4, 0x14] + movs r3, 0x14 + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _08101E12 + subs r0, r1, 0x1 + strh r0, [r4, 0x14] + b _08101EE6 +_08101E12: + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _08101E34 + ldr r2, =0x02020630 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x12] + ldrh r2, [r4, 0x10] + adds r1, r2 + b _08101E48 + .pool +_08101E34: + ldr r2, =0x02020630 + movs r3, 0x8 + ldrsh r1, [r4, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x10] + ldrh r2, [r4, 0x12] + subs r1, r2 +_08101E48: + strh r1, [r0, 0x24] + movs r0, 0x1 + strh r0, [r4, 0x14] + b _08101ED4 + .pool +_08101E54: + ldr r2, =0x02020630 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x10] + strh r1, [r0, 0x24] + movs r0, 0xC + strh r0, [r4, 0xE] + b _08101EA8 + .pool +_08101E70: + ldrh r1, [r4, 0xE] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08101E80 + subs r0, r1, 0x1 + strh r0, [r4, 0xE] + b _08101EE6 +_08101E80: + movs r0, 0x3 + strh r0, [r4, 0xE] + ldr r2, =0x02020630 + movs r3, 0x8 + ldrsh r1, [r4, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x24] + strh r0, [r4, 0x10] + movs r1, 0xA + ldrsh r0, [r4, r1] + movs r2, 0x8 + negs r2, r2 + adds r1, r2, 0 + cmp r0, 0 + bne _08101EA6 + movs r1, 0x8 +_08101EA6: + strh r1, [r4, 0x12] +_08101EA8: + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + b _08101EE6 + .pool +_08101EB4: + movs r3, 0xE + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _08101EE0 + ldrh r2, [r4, 0x12] + ldrh r0, [r4, 0x10] + adds r2, r0 +_08101EC2: + strh r2, [r4, 0x10] + ldr r3, =0x02020630 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r2, [r0, 0x24] +_08101ED4: + ldrh r0, [r4, 0xE] + subs r0, 0x1 + strh r0, [r4, 0xE] + b _08101EE6 + .pool +_08101EE0: + adds r0, r2, 0 + bl move_anim_task_del +_08101EE6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8101D2C + + thumb_func_start sub_8101EEC +sub_8101EEC: @ 8101EEC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08101F2C + ldrh r0, [r4, 0x10] + ldrh r1, [r4, 0x12] + subs r0, r1 + strh r0, [r4, 0x10] + ldrb r0, [r4, 0x8] + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x10] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrb r0, [r4, 0x8] + bl sub_80A73A0 + ldrh r0, [r4, 0xE] + subs r0, 0x1 + strh r0, [r4, 0xE] + b _08101F38 + .pool +_08101F2C: + ldrb r0, [r4, 0x8] + bl sub_80A7344 + adds r0, r5, 0 + bl move_anim_task_del +_08101F38: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8101EEC + + thumb_func_start sub_8101F40 +sub_8101F40: @ 8101F40 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, =0x0203841e + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _08101F5C + ldr r4, =0x02038436 + b _08101F5E + .pool +_08101F5C: + ldr r4, =0x02038437 +_08101F5E: + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x2] + adds r0, r1 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r6, [r6, 0x4] + adds r0, r6 + strh r0, [r5, 0x22] + movs r0, 0 + strh r0, [r5, 0x2E] + strh r0, [r5, 0x30] + ldr r1, =sub_810208C + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A67D8 + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8101F40 + + thumb_func_start sub_8101FA8 +sub_8101FA8: @ 8101FA8 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0000ffd0 + adds r0, r1 + strh r0, [r4, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + ldr r1, =sub_8102044 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A67D8 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8101FA8 + + thumb_func_start sub_8101FF0 +sub_8101FF0: @ 8101FF0 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0203841e + ldr r2, =0x0000ffd0 + adds r0, r2 + ldrh r1, [r1] + adds r0, r1 + movs r6, 0 + strh r0, [r4, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnim + strh r6, [r4, 0x2E] + strh r6, [r4, 0x30] + ldr r0, =sub_810208C + str r0, [r4, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8101FF0 + + thumb_func_start sub_8102044 +sub_8102044: @ 8102044 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _0810206E + movs r0, 0xC + strh r0, [r4, 0x2E] + movs r0, 0x8 + strh r0, [r4, 0x30] + movs r0, 0 + strh r0, [r4, 0x32] + ldr r1, =sub_810207C + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A653C + str r0, [r4, 0x1C] +_0810206E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8102044 + + thumb_func_start sub_810207C +sub_810207C: @ 810207C + movs r1, 0 + strh r1, [r0, 0x2E] + strh r1, [r0, 0x30] + ldr r1, =sub_810208C + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_810207C + + thumb_func_start sub_810208C +sub_810208C: @ 810208C + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081020D4 + movs r0, 0 + strh r0, [r3, 0x2E] + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r2, [r0] + lsrs r1, r2, 2 + movs r0, 0x1 + eors r1, r0 + ands r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _081020D4 + adds r0, r3, 0 + bl move_anim_8072740 +_081020D4: + pop {r0} + bx r0 + thumb_func_end sub_810208C + + thumb_func_start sub_81020D8 +sub_81020D8: @ 81020D8 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, =0x0203841e + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _081020F4 + ldr r4, =0x02038436 + b _081020F6 + .pool +_081020F4: + ldr r4, =0x02038437 +_081020F6: + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x2] + adds r0, r1 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r6, [r6, 0x4] + adds r0, r6 + strh r0, [r5, 0x22] + movs r0, 0 + strh r0, [r5, 0x2E] + ldr r0, =0x0203841e + ldrh r0, [r0, 0x6] + strh r0, [r5, 0x30] + ldr r0, =sub_810213C + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81020D8 + + thumb_func_start sub_810213C +sub_810213C: @ 810213C + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x30 + ldrsh r1, [r2, r3] + cmp r0, r1 + ble _0810215C + movs r0, 0 + strh r0, [r2, 0x2E] + ldrh r0, [r2, 0x22] + subs r0, 0x1 + strh r0, [r2, 0x22] +_0810215C: + ldrh r0, [r2, 0x22] + ldrh r1, [r2, 0x2E] + subs r0, r1 + strh r0, [r2, 0x22] + adds r0, r2, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08102178 + adds r0, r2, 0 + bl move_anim_8072740 +_08102178: + pop {r0} + bx r0 + thumb_func_end sub_810213C + + thumb_func_start sub_810217C +sub_810217C: @ 810217C + push {r4-r6,lr} + adds r4, r0, 0 + ldr r6, =0x02038436 + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r4, 0x20] + ldrb r0, [r6] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + subs r0, 0xC + strh r0, [r4, 0x22] + strh r5, [r4, 0x2E] + movs r0, 0x2 + strh r0, [r4, 0x30] + strh r5, [r4, 0x32] + strh r5, [r4, 0x34] + strh r5, [r4, 0x36] + subs r0, 0x42 + bl sub_80A5178 + lsls r0, 24 + asrs r0, 24 + strh r0, [r4, 0x38] + ldr r0, =sub_81021CC + str r0, [r4, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810217C + + thumb_func_start sub_81021CC +sub_81021CC: @ 81021CC + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x30 + ldrsh r1, [r4, r2] + cmp r0, r1 + blt _08102238 + adds r3, r4, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsrs r1, r2, 2 + movs r0, 0x1 + eors r1, r0 + ands r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + bne _0810221E + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0810221E + ldrh r1, [r4, 0x38] + lsls r1, 24 + asrs r1, 24 + movs r0, 0xC2 + bl audio_play_and_stuff +_0810221E: + movs r1, 0 + strh r1, [r4, 0x2E] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08102238 + strh r1, [r4, 0x32] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] +_08102238: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08102262 + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x10 + ble _08102262 + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08102262 + adds r0, r4, 0 + bl move_anim_8072740 +_08102262: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81021CC + + thumb_func_start sub_8102268 +sub_8102268: @ 8102268 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x2E + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _081022B2 + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + ldr r5, =0x0203841e + lsrs r0, 24 + ldrh r1, [r5] + adds r0, r1 + strh r0, [r6, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r5, [r5, 0x2] + adds r0, r5 + strh r0, [r6, 0x22] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _081022AC + ldrh r0, [r6, 0x22] + adds r0, 0xA + strh r0, [r6, 0x22] +_081022AC: + ldrh r0, [r6, 0x2E] + adds r0, 0x1 + strh r0, [r6, 0x2E] +_081022B2: + ldr r0, =0x0203841e + ldrh r1, [r0, 0xE] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _081022C2 + adds r0, r6, 0 + bl move_anim_8072740 +_081022C2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8102268 + + thumb_func_start sub_81022D4 +sub_81022D4: @ 81022D4 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _08102300 + ldr r1, =0x0203841e + ldr r0, =0x0000ffff + strh r0, [r1, 0xE] + b _0810233E + .pool +_08102300: + cmp r0, 0x2 + bne _0810230C + adds r0, r2, 0 + bl move_anim_task_del + b _08102344 +_0810230C: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _08102344 + movs r0, 0 + strh r0, [r4, 0x8] + ldrh r2, [r4, 0xA] + adds r2, 0x1 + strh r2, [r4, 0xA] + lsls r1, r2, 8 + movs r0, 0x10 + subs r0, r2 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _08102344 +_0810233E: + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] +_08102344: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81022D4 + + thumb_func_start sub_810234C +sub_810234C: @ 810234C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + bl sub_80A6980 + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + ldr r0, =0x0203841e + ldrh r0, [r0, 0x4] + strh r0, [r4, 0x2E] + ldr r0, =sub_810237C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810234C + + thumb_func_start sub_810237C +sub_810237C: @ 810237C + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r1, [r5, 0x2E] + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _08102390 + subs r0, r1, 0x1 + strh r0, [r5, 0x2E] + b _081023CC +_08102390: + adds r2, r5, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + movs r0, 0x1E + strh r0, [r5, 0x2E] + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r5, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r5, 0 + bl oamt_set_x3A_32 +_081023CC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810237C + + thumb_func_start sub_81023E0 +sub_81023E0: @ 81023E0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _08102428 + movs r0, 0 + strh r0, [r4, 0x8] + ldrh r1, [r4, 0xA] + adds r1, 0x1 + strh r1, [r4, 0xA] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _08102428 + adds r0, r5, 0 + bl move_anim_task_del +_08102428: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81023E0 + + thumb_func_start sub_8102434 +sub_8102434: @ 8102434 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + bcs _08102490 + ldr r6, =0x0203841e + ldr r5, =0x03005d70 +_08102448: + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0x1 + bne _08102464 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08102464 + adds r0, r4, r5 + ldrb r0, [r0] + bl sub_8072984 +_08102464: + movs r1, 0x2 + ldrsh r0, [r6, r1] + cmp r0, 0x1 + bne _08102482 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08102482 + adds r0, r4, r5 + ldrb r0, [r0] + bl sub_8072984 +_08102482: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + bcc _08102448 +_08102490: + adds r0, r7, 0 + bl move_anim_task_del + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8102434 + + thumb_func_start sub_81024A8 +sub_81024A8: @ 81024A8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + b _081024C2 +_081024B2: + ldr r0, =0x03005d70 + adds r0, r4, r0 + ldrb r0, [r0] + bl sub_80729D0 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_081024C2: + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + bcc _081024B2 + adds r0, r5, 0 + bl move_anim_task_del + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81024A8 + + thumb_func_start sub_81024E0 +sub_81024E0: @ 81024E0 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _081024F6 + movs r0, 0x30 + strh r0, [r4, 0x20] + movs r0, 0x28 + b _081024FE +_081024F6: + ldr r0, =0x0203841e + ldrh r1, [r0] + strh r1, [r4, 0x20] + ldrh r0, [r0, 0x2] +_081024FE: + strh r0, [r4, 0x22] + ldrb r1, [r4, 0x1] + movs r0, 0x3F + ands r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x3] + movs r1, 0xC0 + orrs r0, r1 + strb r0, [r4, 0x3] + movs r0, 0 + strh r0, [r4, 0x2E] + ldr r0, =sub_8102528 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81024E0 + + thumb_func_start sub_8102528 +sub_8102528: @ 8102528 + push {lr} + adds r1, r0, 0 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _0810253A + adds r0, r1, 0 + bl move_anim_8072740 +_0810253A: + pop {r0} + bx r0 + thumb_func_end sub_8102528 + + thumb_func_start sub_8102540 +sub_8102540: @ 8102540 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02038436 + ldrb r0, [r0] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + ldr r2, =0x0203841e + lsrs r0, 24 + ldrh r1, [r2] + adds r0, r1 + movs r1, 0 + strh r0, [r4, 0x20] + ldrh r0, [r2, 0x2] + strh r0, [r4, 0x22] + strh r1, [r4, 0x2E] + strh r1, [r4, 0x30] + strh r1, [r4, 0x32] + strh r1, [r4, 0x34] + movs r0, 0x1 + strh r0, [r4, 0x36] + ldr r0, =sub_8102584 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8102540 + + thumb_func_start sub_8102584 +sub_8102584: @ 8102584 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x30] + adds r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081025AE + movs r0, 0 + strh r0, [r1, 0x30] + ldrh r2, [r1, 0x32] + movs r3, 0x32 + ldrsh r0, [r1, r3] + cmp r0, 0x77 + bgt _081025AE + ldrh r0, [r1, 0x22] + adds r0, 0x1 + strh r0, [r1, 0x22] + adds r0, r2, 0x1 + strh r0, [r1, 0x32] +_081025AE: + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _081025BC + adds r0, r1, 0 + bl move_anim_8072740 +_081025BC: + pop {r0} + bx r0 + thumb_func_end sub_8102584 + + thumb_func_start sub_81025C0 +sub_81025C0: @ 81025C0 + 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 + movs r4, 0 + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80A75AC + mov r8, r0 + ldr r0, =0x0000ffff + mov r1, r8 + ands r1, r0 + mov r8, r1 + ldr r0, =0x03005e00 + mov r9, r0 + lsls r5, r7, 2 + adds r5, r7 + lsls r5, 3 + adds r6, r5, r0 + strh r4, [r6, 0x8] + strh r4, [r6, 0xA] + strh r4, [r6, 0xC] + strh r1, [r6, 0xE] + strh r4, [r6, 0x10] + strh r4, [r6, 0x12] + strh r4, [r6, 0x14] + movs r0, 0xD + strh r0, [r6, 0x16] + movs r0, 0xE + strh r0, [r6, 0x18] + movs r0, 0xF + strh r0, [r6, 0x1A] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x1 + movs r3, 0x1 + bl sub_80A76C4 + mov r10, r0 + mov r1, r8 + orrs r1, r0 + mov r8, r1 + movs r0, 0x8 + add r9, r0 + add r5, r9 + adds r0, r5, 0 + adds r0, 0x1C + adds r5, 0x1E + adds r1, r5, 0 + mov r2, r8 + bl sub_80A8048 + ldr r0, =0x000027d2 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + movs r4, 0x80 + lsls r4, 9 + adds r1, r4, 0 + lsls r1, r0 + mov r0, r10 + orrs r0, r1 + mov r10, r0 + ldr r0, =0x000027d3 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0 + mov r1, r10 + orrs r4, r1 + ldr r0, =0x00007fbb + str r0, [sp] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =sub_81026A8 + str r1, [r6] + adds r0, r7, 0 + bl _call_via_r1 + 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_81025C0 + + thumb_func_start sub_81026A8 +sub_81026A8: @ 81026A8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _08102794 + cmp r1, 0x1 + bgt _081026D4 + cmp r1, 0 + beq _081026E2 + b _08102832 + .pool +_081026D4: + cmp r1, 0x2 + bne _081026DA + b _081027EC +_081026DA: + cmp r1, 0x3 + bne _081026E0 + b _08102820 +_081026E0: + b _08102832 +_081026E2: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bgt _081026F0 + b _08102832 +_081026F0: + strh r1, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + bgt _0810273C + ldrh r0, [r4, 0x16] + ldrh r1, [r4, 0x10] + adds r0, r1 + strh r0, [r4, 0x10] + ldrh r2, [r4, 0x18] + ldrh r3, [r4, 0x12] + adds r2, r3 + strh r2, [r4, 0x12] + ldrh r1, [r4, 0x1A] + ldrh r5, [r4, 0x14] + adds r1, r5 + strh r1, [r4, 0x14] + lsls r0, 16 + asrs r0, 19 + lsls r0, 16 + lsrs r0, 16 + lsls r2, 16 + asrs r2, 19 + lsls r2, 16 + lsls r1, 16 + asrs r1, 19 + lsls r1, 16 + lsrs r2, 11 + orrs r0, r2 + lsrs r1, 6 + orrs r0, r1 + lsls r0, 16 + lsrs r0, 16 + mov r12, r0 + b _08102746 +_0810273C: + ldr r7, =0x00007fbb + mov r12, r7 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_08102746: + movs r2, 0x1 + movs r3, 0 + movs r1, 0 +_0810274C: + movs r5, 0xE + ldrsh r0, [r4, r5] + ands r0, r2 + lsls r5, r2, 17 + adds r6, r3, 0 + adds r6, 0x10 + adds r1, 0x1 + mov r8, r1 + cmp r0, 0 + beq _08102778 + movs r1, 0x1 + ldr r2, =0x02037b14 +_08102764: + adds r0, r3, r1 + lsls r0, 1 + adds r0, r2 + mov r7, r12 + strh r7, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0xF + bls _08102764 +_08102778: + lsrs r2, r5, 16 + lsls r0, r6, 16 + lsrs r3, r0, 16 + mov r1, r8 + lsls r0, r1, 16 + lsrs r1, r0, 16 + cmp r1, 0xF + bls _0810274C + b _08102832 + .pool +_08102794: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08102832 + movs r2, 0 + ldr r3, =0x02020630 + movs r5, 0x14 + adds r5, r3 + mov r12, r5 + ldr r7, =gUnknown_08592EBC + mov r8, r7 + ldr r6, =gUnknown_08592EEC + movs r5, 0x1 +_081027B2: + lsls r0, r2, 4 + adds r0, r2 + lsls r1, r0, 2 + mov r7, r12 + adds r0, r1, r7 + ldr r0, [r0] + cmp r0, r8 + beq _081027C6 + cmp r0, r6 + bne _081027CA +_081027C6: + adds r0, r1, r3 + strh r5, [r0, 0x2E] +_081027CA: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3F + bls _081027B2 + movs r0, 0 + strh r0, [r4, 0xA] + b _08102814 + .pool +_081027EC: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1E + ble _08102832 + movs r1, 0x24 + ldrsh r0, [r4, r1] + movs r2, 0x26 + ldrsh r1, [r4, r2] + bl sub_80A8050 + ldr r1, =0x00007fbb + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe +_08102814: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08102832 + .pool +_08102820: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08102832 + adds r0, r2, 0 + bl move_anim_task_del +_08102832: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81026A8 + + thumb_func_start sub_8102844 +sub_8102844: @ 8102844 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, =0x0203841e + movs r1, 0x4 + ldrsh r0, [r6, r1] + cmp r0, 0x1 + bgt _08102856 + movs r0, 0x2 + strh r0, [r6, 0x4] +_08102856: + movs r1, 0x4 + ldrsh r0, [r6, r1] + cmp r0, 0x7F + ble _08102862 + movs r0, 0x7F + strh r0, [r6, 0x4] +_08102862: + movs r0, 0 + strh r0, [r5, 0x2E] + ldrh r0, [r6, 0x4] + strh r0, [r5, 0x30] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6] + adds r0, r1 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r6, [r6, 0x2] + adds r0, r6 + strh r0, [r5, 0x22] + ldrh r1, [r5, 0x20] + strh r1, [r5, 0x3A] + strh r0, [r5, 0x3C] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _081028D4 + ldrb r1, [r5, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r5, 0x3] + ldrh r0, [r5, 0x20] + adds r0, 0x28 + strh r0, [r5, 0x20] + ldrh r4, [r5, 0x22] + adds r4, 0x14 + strh r4, [r5, 0x22] + lsls r0, 7 + strh r0, [r5, 0x32] + movs r0, 0x30 + ldrsh r1, [r5, r0] + ldr r0, =0xffffec00 + b _081028FA + .pool +_081028D4: + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810291C + ldrh r0, [r5, 0x20] + subs r0, 0x28 + strh r0, [r5, 0x20] + ldrh r4, [r5, 0x22] + adds r4, 0x14 + strh r4, [r5, 0x22] + lsls r0, 7 + strh r0, [r5, 0x32] + movs r0, 0x30 + ldrsh r1, [r5, r0] + movs r0, 0xA0 + lsls r0, 5 +_081028FA: + bl __divsi3 + strh r0, [r5, 0x34] + lsls r4, 7 + strh r4, [r5, 0x36] + movs r0, 0x30 + ldrsh r1, [r5, r0] + ldr r0, =0xfffff600 + bl __divsi3 + strh r0, [r5, 0x38] + b _08102958 + .pool +_0810291C: + ldrh r0, [r5, 0x20] + adds r0, 0x28 + strh r0, [r5, 0x20] + ldrh r4, [r5, 0x22] + subs r4, 0x14 + strh r4, [r5, 0x22] + lsls r0, 7 + strh r0, [r5, 0x32] + movs r0, 0x30 + ldrsh r1, [r5, r0] + ldr r0, =0xffffec00 + bl __divsi3 + strh r0, [r5, 0x34] + lsls r4, 7 + strh r4, [r5, 0x36] + movs r0, 0x30 + ldrsh r1, [r5, r0] + movs r0, 0xA0 + lsls r0, 4 + bl __divsi3 + strh r0, [r5, 0x38] + ldrb r1, [r5, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x30 + orrs r0, r1 + strb r0, [r5, 0x3] +_08102958: + ldr r0, =sub_810296C + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8102844 + + thumb_func_start sub_810296C +sub_810296C: @ 810296C + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x34] + ldrh r1, [r2, 0x32] + adds r0, r1 + strh r0, [r2, 0x32] + ldrh r1, [r2, 0x38] + ldrh r3, [r2, 0x36] + adds r1, r3 + strh r1, [r2, 0x36] + lsls r0, 16 + asrs r0, 23 + strh r0, [r2, 0x20] + lsls r1, 16 + asrs r1, 23 + strh r1, [r2, 0x22] + ldrh r0, [r2, 0x30] + subs r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _081029A2 + ldrh r0, [r2, 0x3A] + strh r0, [r2, 0x20] + ldrh r0, [r2, 0x3C] + strh r0, [r2, 0x22] +_081029A2: + movs r1, 0x30 + ldrsh r0, [r2, r1] + cmp r0, 0 + bne _081029B0 + adds r0, r2, 0 + bl move_anim_8072740 +_081029B0: + pop {r0} + bx r0 + thumb_func_end sub_810296C + + thumb_func_start sub_81029B4 +sub_81029B4: @ 81029B4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r6, r0, r1 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x8] + ldr r0, =0x00002771 + bl AllocObjectPalette + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0xA] + movs r1, 0xA + ldrsh r0, [r6, r1] + lsls r0, 20 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r3, r0, 16 + ldr r2, =0x02020630 + movs r0, 0x8 + ldrsh r1, [r6, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + adds r0, 0x10 + lsls r4, r0, 4 + movs r5, 0x1 + ldr r2, =0x02037714 +_08102A0C: + adds r1, r3, r5 + lsls r1, 1 + adds r1, r2 + adds r0, r4, r5 + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0xF + bls _08102A0C + adds r0, r3, 0 + movs r1, 0x10 + movs r2, 0xB + movs r3, 0 + bl pal_fade_1 + movs r0, 0 + strh r0, [r6, 0xE] + movs r5, 0 + ldr r7, =0x02020630 + movs r1, 0x1C + adds r1, r7 + mov r9, r1 + b _08102A88 + .pool +_08102A54: + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r4, r2, r7 + ldrb r1, [r6, 0xA] + lsls r1, 4 + ldrb r3, [r4, 0x5] + movs r0, 0xF + ands r0, r3 + orrs r0, r1 + strb r0, [r4, 0x5] + movs r0, 0 + strh r0, [r4, 0x2E] + lsls r0, r5, 7 + strh r0, [r4, 0x30] + mov r0, r8 + strh r0, [r4, 0x32] + add r2, r9 + ldr r0, =sub_8102B3C + str r0, [r2] + ldrh r0, [r6, 0xE] + adds r0, 0x1 + strh r0, [r6, 0xE] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_08102A88: + cmp r5, 0x1 + bhi _08102A9A + movs r0, 0 + bl duplicate_obj_of_side_rel2move_in_transparent_mode + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08102A54 +_08102A9A: + ldr r0, =sub_8102AE0 + str r0, [r6] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08102AC8 + movs r1, 0x80 + lsls r1, 2 + movs r0, 0 + bl ClearGpuRegBits + b _08102AD2 + .pool +_08102AC8: + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + bl ClearGpuRegBits +_08102AD2: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81029B4 + + thumb_func_start sub_8102AE0 +sub_8102AE0: @ 8102AE0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r0, r1 + movs r1, 0xE + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08102B32 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08102B1C + movs r1, 0x80 + lsls r1, 2 + movs r0, 0 + bl SetGpuRegBits + b _08102B26 + .pool +_08102B1C: + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + bl SetGpuRegBits +_08102B26: + ldr r0, =0x00002771 + bl FreeObjectPaletteByTag + adds r0, r4, 0 + bl move_anim_task_del +_08102B32: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8102AE0 + + thumb_func_start sub_8102B3C +sub_8102B3C: @ 8102B3C + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x34] + adds r0, 0x1 + strh r0, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08102B58 + movs r0, 0 + strh r0, [r5, 0x34] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] +_08102B58: + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x40 + ble _08102B80 + ldr r2, =0x03005e00 + movs r0, 0x32 + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0xE] + subs r1, 0x1 + strh r1, [r0, 0xE] + adds r0, r5, 0 + bl obj_delete_but_dont_free_vram + b _08102BC2 + .pool +_08102B80: + ldr r4, =gUnknown_08329F40 + movs r1, 0x2E + ldrsh r0, [r5, r1] + lsls r0, 1 + adds r0, r4 + movs r2, 0 + ldrsh r0, [r0, r2] + movs r1, 0x6 + bl __divsi3 + strh r0, [r5, 0x36] + movs r1, 0x2E + ldrsh r0, [r5, r1] + lsls r0, 1 + adds r0, r4 + movs r2, 0 + ldrsh r0, [r0, r2] + movs r1, 0xD + bl __divsi3 + strh r0, [r5, 0x38] + ldrh r1, [r5, 0x30] + adds r1, r0 + movs r0, 0xFF + ands r1, r0 + strh r1, [r5, 0x30] + movs r1, 0x30 + ldrsh r0, [r5, r1] + movs r2, 0x36 + ldrsh r1, [r5, r2] + bl sine + strh r0, [r5, 0x24] +_08102BC2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8102B3C + + thumb_func_start sub_8102BCC +sub_8102BCC: @ 8102BCC + push {r4,lr} + adds r4, r0, 0 + ldr r1, =move_anim_8072740 + bl oamt_set_x3A_32 + ldr r0, =sub_80A67D8 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8102BCC + + thumb_func_start sub_8102BE8 +sub_8102BE8: @ 8102BE8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r4, =gUnknown_08593020 + ldrh r0, [r4] + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xFF + beq _08102C2C + lsls r0, r3, 20 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r3, r0, 16 + movs r2, 0x1 + ldr r5, =0x02037b14 +_08102C14: + adds r1, r3, r2 + lsls r1, 1 + adds r1, r5 + lsls r0, r2, 1 + adds r0, r4 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x5 + bls _08102C14 +_08102C2C: + movs r4, 0x1 + ldr r0, =gUnknown_08593020 + mov r8, r0 +_08102C32: + lsls r0, r4, 1 + adds r0, r4 + lsls r5, r0, 2 + mov r1, r8 + adds r0, r5, r1 + ldrh r0, [r0] + bl AllocObjectPalette + lsls r0, 24 + lsrs r3, r0, 24 + adds r4, 0x1 + mov r12, r4 + cmp r3, 0xFF + beq _08102C7A + lsls r0, r3, 20 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r3, r0, 16 + movs r2, 0x1 + ldr r7, =0x02037b14 + ldr r6, =gUnknown_08593020 + adds r4, r5, 0 +_08102C60: + adds r1, r3, r2 + lsls r1, 1 + adds r1, r7 + lsls r0, r2, 1 + adds r0, r4 + adds r0, r6 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x5 + bls _08102C60 +_08102C7A: + mov r1, r12 + lsls r0, r1, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _08102C32 + mov r0, r9 + bl move_anim_task_del + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8102BE8 + + thumb_func_start sub_8102CA0 +sub_8102CA0: @ 8102CA0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0x1 + ldr r6, =gUnknown_08593020 +_08102CAA: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r6 + ldrh r0, [r0] + bl FreeObjectPaletteByTag + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _08102CAA + adds r0, r5, 0 + bl move_anim_task_del + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8102CA0 + + thumb_func_start sub_8102CD4 +sub_8102CD4: @ 8102CD4 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + bl sub_80A6838 + ldr r4, =0x0203841e + ldrb r1, [r4] + adds r0, r5, 0 + bl StartObjectImageAnim + ldr r2, =gUnknown_08593020 + movs r0, 0x2 + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0] + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _08102D10 + lsls r2, r0, 4 + ldrb r1, [r5, 0x5] + movs r0, 0xF + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] +_08102D10: + ldrh r0, [r4, 0x2] + movs r1, 0 + strh r0, [r5, 0x30] + strh r1, [r5, 0x32] + ldrh r0, [r4, 0x4] + strh r0, [r5, 0x34] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08102D34 + movs r6, 0x30 + movs r3, 0x28 + b _08102D4E + .pool +_08102D34: + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r3, r0, 24 +_08102D4E: + ldrh r0, [r5, 0x20] + lsls r1, r0, 4 + strh r1, [r5, 0x36] + ldrh r1, [r5, 0x22] + lsls r2, r1, 4 + strh r2, [r5, 0x38] + subs r0, r6, r0 + lsls r0, 16 + asrs r0, 16 + subs r1, r3, r1 + lsls r1, 16 + asrs r1, 16 + adds r2, r5, 0 + adds r2, 0x3A + adds r3, r5, 0 + adds r3, 0x3C + movs r4, 0x28 + str r4, [sp] + bl sub_8102D8C + ldr r0, =sub_8102DE4 + str r0, [r5, 0x1C] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8102CD4 + + thumb_func_start sub_8102D8C +sub_8102D8C: @ 8102D8C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r2, 0 + mov r8, r3 + ldr r2, [sp, 0x18] + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 24 + lsrs r1, r2, 24 + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + bge _08102DAE + lsls r0, r1, 24 + negs r0, r0 + lsrs r1, r0, 24 +_08102DAE: + lsls r5, r2, 8 + lsls r1, 24 + asrs r1, 24 + adds r0, r5, 0 + bl __divsi3 + adds r4, r0, 0 + cmp r4, 0 + bne _08102DC2 + movs r4, 0x1 +_08102DC2: + adds r0, r5, 0 + adds r1, r4, 0 + bl __divsi3 + strh r0, [r7] + lsls r0, r6, 16 + asrs r0, 8 + adds r1, r4, 0 + bl __divsi3 + mov r1, r8 + strh r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8102D8C + + thumb_func_start sub_8102DE4 +sub_8102DE4: @ 8102DE4 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + movs r5, 0 + strh r0, [r4, 0x2E] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r1, r0, r1 + adds r0, r1, 0 + cmp r1, 0 + bge _08102E00 + adds r0, 0xFF +_08102E00: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + ldrh r1, [r4, 0x3A] + ldrh r2, [r4, 0x36] + adds r1, r2 + strh r1, [r4, 0x36] + ldrh r2, [r4, 0x3C] + ldrh r3, [r4, 0x38] + adds r2, r3 + strh r2, [r4, 0x38] + lsls r1, 16 + asrs r1, 20 + strh r1, [r4, 0x20] + lsls r2, 16 + asrs r2, 20 + strh r2, [r4, 0x22] + lsls r0, 16 + asrs r0, 16 + movs r1, 0xF + bl sine + strh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + ldrh r0, [r4, 0x20] + adds r0, 0x10 + lsls r0, 16 + movs r1, 0x88 + lsls r1, 17 + cmp r0, r1 + bhi _08102E4E + lsls r0, r2, 16 + asrs r1, r0, 16 + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + blt _08102E4E + cmp r1, 0x80 + ble _08102E56 +_08102E4E: + adds r0, r4, 0 + bl move_anim_8074EE0 + b _08102EA6 +_08102E56: + movs r0, 0x34 + ldrsh r1, [r4, r0] + cmp r1, 0 + beq _08102EA6 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, r1 + ble _08102EA6 + strh r5, [r4, 0x32] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _08102E7E + strh r5, [r4, 0x30] +_08102E7E: + ldr r2, =gUnknown_08593020 + movs r3, 0x30 + ldrsh r1, [r4, r3] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0] + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _08102EA6 + lsls r2, r0, 4 + ldrb r1, [r4, 0x5] + movs r0, 0xF + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x5] +_08102EA6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8102DE4 + + thumb_func_start sub_8102EB0 +sub_8102EB0: @ 8102EB0 + push {r4-r7,lr} + adds r6, r0, 0 + ldr r7, =0x02038436 + ldrb r0, [r7] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08102ECE + ldr r1, =0x0203841e + movs r2, 0x2 + ldrsh r0, [r1, r2] + negs r0, r0 + strh r0, [r1, 0x2] +_08102ECE: + ldrb r0, [r7] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + ldr r4, =0x0203841e + lsrs r0, 24 + ldrh r1, [r4, 0x2] + adds r0, r1 + movs r5, 0 + strh r0, [r6, 0x20] + ldrb r0, [r7] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r2, [r4, 0x4] + adds r0, r2 + strh r0, [r6, 0x22] + ldrb r1, [r4] + adds r0, r6, 0 + bl StartObjectImageAnim + strh r5, [r6, 0x32] + strh r5, [r6, 0x34] + ldrh r0, [r6, 0x20] + lsls r0, 4 + strh r0, [r6, 0x36] + ldrh r0, [r6, 0x22] + lsls r0, 4 + strh r0, [r6, 0x38] + movs r1, 0x2 + ldrsh r0, [r4, r1] + lsls r0, 4 + movs r1, 0x5 + bl __divsi3 + strh r0, [r6, 0x3A] + movs r2, 0x4 + ldrsh r0, [r4, r2] + lsls r0, 7 + movs r1, 0x5 + bl __divsi3 + strh r0, [r6, 0x3C] + ldr r0, =sub_8102F40 + str r0, [r6, 0x1C] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8102EB0 + + thumb_func_start sub_8102F40 +sub_8102F40: @ 8102F40 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x3A] + ldrh r1, [r4, 0x36] + adds r0, r1 + strh r0, [r4, 0x36] + ldrh r1, [r4, 0x3C] + ldrh r2, [r4, 0x38] + adds r1, r2 + strh r1, [r4, 0x38] + lsls r0, 16 + asrs r0, 20 + strh r0, [r4, 0x20] + lsls r1, 16 + asrs r1, 20 + strh r1, [r4, 0x22] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x5 + ble _08102F9E + movs r2, 0x34 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08102F9E + ldrh r0, [r4, 0x32] + adds r0, 0x10 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x32] + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r1, 0x12 + bl cosine + strh r0, [r4, 0x24] + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0x12 + bl sine + strh r0, [r4, 0x26] + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08102F9E + movs r0, 0x1 + strh r0, [r4, 0x34] +_08102F9E: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x30 + bne _08102FB2 + adds r0, r4, 0 + bl move_anim_8074EE0 +_08102FB2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8102F40 + + thumb_func_start sub_8102FB8 +sub_8102FB8: @ 8102FB8 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + bne _08102FDC + ldrb r0, [r5, 0x3] + movs r1, 0x3F + negs r1, r1 + ands r1, r0 + movs r0, 0x10 + orrs r1, r0 + strb r1, [r5, 0x3] + movs r6, 0x10 + b _08102FDE + .pool +_08102FDC: + ldr r6, =0x0000fff0 +_08102FDE: + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r6 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x8 + strh r0, [r5, 0x22] + movs r0, 0x8 + strh r0, [r5, 0x2E] + ldr r0, =sub_80A64B0 + str r0, [r5, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r5, 0 + bl oamt_set_x3A_32 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8102FB8 + + thumb_func_start sub_8103028 +sub_8103028: @ 8103028 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_80A6838 + ldrh r0, [r4, 0x22] + adds r0, 0x8 + strh r0, [r4, 0x22] + ldr r5, =0x0203841e + ldrb r1, [r5, 0x2] + adds r0, r4, 0 + bl StartObjectImageAnim + ldr r2, =gUnknown_08593020 + movs r0, 0x4 + ldrsh r1, [r5, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0] + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _08103068 + lsls r2, r0, 4 + ldrb r1, [r4, 0x5] + movs r0, 0xF + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x5] +_08103068: + movs r1, 0 + ldrsh r0, [r5, r1] + movs r2, 0x20 + cmp r0, 0 + bne _08103074 + ldr r2, =0x0000ffe0 +_08103074: + movs r0, 0x28 + strh r0, [r4, 0x2E] + ldrh r1, [r4, 0x20] + strh r1, [r4, 0x30] + lsls r0, r2, 16 + asrs r0, 16 + adds r0, r1 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + subs r0, 0x28 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x38] + ldr r0, =sub_81030B0 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8103028 + + thumb_func_start sub_81030B0 +sub_81030B0: @ 81030B0 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + bne _08103100 + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl sine + lsls r0, 16 + lsrs r1, r0, 16 + ldrh r2, [r4, 0x24] + movs r3, 0x24 + ldrsh r0, [r4, r3] + cmp r0, 0 + bge _081030DC + lsls r0, r1, 16 + negs r0, r0 + lsrs r1, r0, 16 +_081030DC: + lsls r0, r1, 16 + asrs r0, 16 + adds r0, r2 + strh r0, [r4, 0x24] + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0x4 + bl sine + ldrh r3, [r4, 0x26] + adds r0, r3 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x38] + adds r0, 0x8 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + b _08103106 +_08103100: + adds r0, r4, 0 + bl move_anim_8072740 +_08103106: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81030B0 + + thumb_func_start sub_810310C +sub_810310C: @ 810310C + push {r4-r6,lr} + adds r6, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810312C + adds r0, r5, 0 + movs r1, 0x5 + bl sub_80A861C + adds r0, 0x8 + b _08103136 +_0810312C: + adds r0, r5, 0 + movs r1, 0x4 + bl sub_80A861C + subs r0, 0x8 +_08103136: + strh r0, [r6, 0x20] + adds r0, r5, 0 + movs r1, 0x3 + bl sub_80A5C6C + adds r4, r0, 0 + adds r0, r5, 0 + movs r1, 0 + bl sub_80A861C + lsls r4, 24 + lsrs r4, 24 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08103158 + adds r0, 0x3 +_08103158: + asrs r0, 2 + subs r0, r4, r0 + strh r0, [r6, 0x22] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_810310C + + thumb_func_start sub_8103164 +sub_8103164: @ 8103164 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08103180 + ldr r0, =0x02038436 + b _08103182 + .pool +_08103180: + ldr r0, =0x02038437 +_08103182: + ldrb r4, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_810310C + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r1, 31 + ldr r0, =0x0203841e + ldrh r0, [r0, 0x2] + strh r0, [r5, 0x2E] + adds r0, r1, 0x2 + strh r0, [r5, 0x30] + adds r0, r5, 0 + bl StartObjectImageAnim + ldr r1, =sub_81031D0 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A67D8 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8103164 + + thumb_func_start sub_81031D0 +sub_81031D0: @ 81031D0 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + bne _081031F8 + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + ldr r0, =sub_80A67D8 + str r0, [r4, 0x1C] +_081031F8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81031D0 + + thumb_func_start sub_8103208 +sub_8103208: @ 8103208 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08103224 + ldr r0, =0x02038436 + b _08103226 + .pool +_08103224: + ldr r0, =0x02038437 +_08103226: + ldrb r0, [r0] + adds r1, r4, 0 + bl sub_810310C + movs r0, 0 + strh r0, [r4, 0x2E] + ldr r1, =sub_8103250 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A67BC + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8103208 + + thumb_func_start sub_8103250 +sub_8103250: @ 8103250 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _08103276 + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + ldr r1, =move_anim_8074EE0 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A67BC + str r0, [r4, 0x1C] +_08103276: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8103250 + + thumb_func_start sub_8103284 +sub_8103284: @ 8103284 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _081032A0 + ldr r0, =0x02038436 + b _081032A2 + .pool +_081032A0: + ldr r0, =0x02038437 +_081032A2: + ldrb r5, [r0] + adds r0, r5, 0 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + movs r6, 0 + strh r0, [r4, 0x20] + adds r0, r5, 0 + movs r1, 0x2 + bl sub_80A861C + strh r0, [r4, 0x22] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + bgt _081032CA + movs r0, 0xA + strh r0, [r4, 0x22] +_081032CA: + movs r0, 0x1 + strh r0, [r4, 0x2E] + strh r6, [r4, 0x30] + adds r1, r4, 0 + adds r1, 0x43 + ldrb r0, [r1] + strh r0, [r4, 0x32] + ldrb r0, [r1] + adds r0, 0x4 + strh r0, [r4, 0x34] + strh r6, [r4, 0x36] + ldr r1, =sub_8103300 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A67BC + str r0, [r4, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8103284 + + thumb_func_start sub_8103300 +sub_8103300: @ 8103300 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x36] + adds r0, 0x1 + strh r0, [r1, 0x36] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + ble _08103316 + ldr r0, =sub_8103320 + str r0, [r1, 0x1C] +_08103316: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8103300 + + thumb_func_start sub_8103320 +sub_8103320: @ 8103320 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x30] + adds r1, r0, 0x4 + strh r1, [r2, 0x30] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xFE + ble _08103352 + ldrh r0, [r2, 0x2E] + subs r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bne _0810334C + strh r0, [r2, 0x24] + ldr r0, =sub_8103250 + str r0, [r2, 0x1C] + b _08103388 + .pool +_0810334C: + movs r0, 0xFF + ands r1, r0 + strh r1, [r2, 0x30] +_08103352: + movs r1, 0x30 + ldrsh r0, [r2, r1] + cmp r0, 0x4F + ble _08103362 + ldrh r0, [r2, 0x34] + adds r1, r2, 0 + adds r1, 0x43 + strb r0, [r1] +_08103362: + movs r3, 0x30 + ldrsh r0, [r2, r3] + cmp r0, 0x9F + ble _08103372 + ldrh r0, [r2, 0x32] + adds r1, r2, 0 + adds r1, 0x43 + strb r0, [r1] +_08103372: + ldr r1, =gUnknown_08329F40 + movs r3, 0x30 + ldrsh r0, [r2, r3] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 19 + asrs r1, r0, 1 + adds r0, r1 + strh r0, [r2, 0x24] +_08103388: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8103320 + + thumb_func_start sub_8103390 +sub_8103390: @ 8103390 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _081033AC + ldr r0, =0x02038436 + b _081033AE + .pool +_081033AC: + ldr r0, =0x02038437 +_081033AE: + ldrb r4, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_810310C + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _081033D4 + adds r0, r5, 0 + movs r1, 0 + bl StartObjectImageAnim + movs r0, 0x2 + b _081033DE + .pool +_081033D4: + adds r0, r5, 0 + movs r1, 0x1 + bl StartObjectImageAnim + movs r0, 0x3 +_081033DE: + strh r0, [r5, 0x2E] + ldr r0, =sub_81033F0 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8103390 + + thumb_func_start sub_81033F0 +sub_81033F0: @ 81033F0 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + ble _0810341E + movs r0, 0 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x2E] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + ldr r1, =sub_810342C + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A67D8 + str r0, [r4, 0x1C] +_0810341E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81033F0 + + thumb_func_start sub_810342C +sub_810342C: @ 810342C + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x30] + adds r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _08103444 + adds r0, r1, 0 + bl move_anim_8072740 +_08103444: + pop {r0} + bx r0 + thumb_func_end sub_810342C + + thumb_func_start sub_8103448 +sub_8103448: @ 8103448 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_80A6838 + ldr r5, =0x0203841e + movs r0, 0 + ldrsh r1, [r5, r0] + adds r0, r4, 0 + bl sub_80A6864 + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x30] + ldrh r0, [r5, 0x8] + strh r0, [r4, 0x32] + ldrh r0, [r5, 0xA] + strh r0, [r4, 0x34] + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x36] + ldr r1, =move_anim_8074EE0 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r1, =sub_80A6450 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8103448 + + thumb_func_start sub_8103498 +sub_8103498: @ 8103498 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _081034B4 + ldr r0, =0x02038436 + b _081034B6 + .pool +_081034B4: + ldr r0, =0x02038437 +_081034B6: + ldrb r0, [r0] + adds r1, r4, 0 + bl sub_810310C + movs r0, 0 + strh r0, [r4, 0x2E] + strh r0, [r4, 0x30] + ldr r0, =sub_81034D8 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8103498 + + thumb_func_start sub_81034D8 +sub_81034D8: @ 81034D8 + push {lr} + adds r1, r0, 0 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0x1 + beq _0810350A + cmp r0, 0x1 + bgt _081034EE + cmp r0, 0 + beq _081034F4 + b _08103538 +_081034EE: + cmp r0, 0x2 + beq _08103524 + b _08103538 +_081034F4: + ldrh r0, [r1, 0x26] + subs r0, 0x3 + strh r0, [r1, 0x26] + ldrh r0, [r1, 0x30] + adds r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bne _08103538 + b _0810351C +_0810350A: + ldrh r0, [r1, 0x26] + adds r0, 0x3 + strh r0, [r1, 0x26] + ldrh r0, [r1, 0x30] + subs r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _08103538 +_0810351C: + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + b _08103538 +_08103524: + ldrh r0, [r1, 0x30] + adds r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + bne _08103538 + adds r0, r1, 0 + bl move_anim_8072740 +_08103538: + pop {r0} + bx r0 + thumb_func_end sub_81034D8 + + thumb_func_start sub_810353C +sub_810353C: @ 810353C + push {r4,lr} + adds r4, r0, 0 + ldr r3, =0x02020630 + movs r0, 0x32 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r4, 0x30] + ldrh r2, [r0, 0x24] + adds r1, r2 + strh r1, [r0, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0x30] + movs r0, 0x2E + ldrsh r2, [r4, r0] + cmp r2, 0 + bne _0810357A + movs r0, 0x32 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r2, [r0, 0x24] + adds r0, r4, 0 + bl move_anim_8074EE0 +_0810357A: + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810353C + + thumb_func_start sub_810358C +sub_810358C: @ 810358C + push {r4-r6,lr} + adds r5, r0, 0 + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldr r1, =0x020241e4 + ldr r0, =0x02038437 + ldrb r0, [r0] + adds r0, r1 + ldrb r6, [r0] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _081035E4 + ldr r0, =0x0203841e + ldrh r1, [r5, 0x20] + ldrh r2, [r0] + subs r1, r2 + strh r1, [r5, 0x20] + adds r1, r0, 0 + b _081035EE + .pool +_081035E4: + ldr r1, =0x0203841e + ldrh r0, [r1] + ldrh r2, [r5, 0x20] + adds r0, r2 + strh r0, [r5, 0x20] +_081035EE: + ldrh r0, [r1, 0x2] + ldrh r2, [r5, 0x22] + adds r0, r2 + strh r0, [r5, 0x22] + ldrh r0, [r1, 0x4] + strh r0, [r5, 0x2E] + ldrh r0, [r1, 0x6] + strh r0, [r5, 0x30] + strh r6, [r5, 0x32] + ldr r0, =sub_810353C + str r0, [r5, 0x1C] + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810358C + + thumb_func_start sub_8103620 +sub_8103620: @ 8103620 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x38] + ldr r0, =sub_80A64B0 + str r0, [r4, 0x1C] + ldr r1, =sub_8103658 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8103620 + + thumb_func_start sub_8103658 +sub_8103658: @ 8103658 + push {lr} + ldrh r1, [r0, 0x30] + strh r1, [r0, 0x2E] + ldrh r1, [r0, 0x20] + strh r1, [r0, 0x32] + ldrh r1, [r0, 0x22] + adds r1, 0xF + strh r1, [r0, 0x36] + ldr r1, =sub_80A6EEC + str r1, [r0, 0x1C] + ldr r1, =sub_8103680 + bl oamt_set_x3A_32 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8103658 + + thumb_func_start sub_8103680 +sub_8103680: @ 8103680 + push {lr} + adds r1, r0, 0 + ldrh r2, [r1, 0x38] + movs r3, 0x38 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _08103696 + adds r0, r1, 0 + bl move_anim_8072740 + b _0810369A +_08103696: + subs r0, r2, 0x1 + strh r0, [r1, 0x38] +_0810369A: + pop {r0} + bx r0 + thumb_func_end sub_8103680 + + thumb_func_start sub_81036A0 +sub_81036A0: @ 81036A0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =0x020241e4 + ldr r0, =0x02038436 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_80A7270 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81036DC + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81036A0 + + thumb_func_start sub_81036DC +sub_81036DC: @ 81036DC + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x020241e4 + ldr r0, =0x02038436 + ldrb r0, [r0] + adds r1, r0, r1 + ldrb r4, [r1] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08103718 + ldr r1, =0x03005e00 + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x8] + negs r0, r0 + lsls r0, 16 + lsrs r3, r0, 16 + adds r6, r2, 0 + b _08103726 + .pool +_08103718: + ldr r2, =0x03005e00 + lsls r1, r5, 2 + adds r0, r1, r5 + lsls r0, 3 + adds r0, r2 + ldrh r3, [r0, 0x8] + adds r6, r1, 0 +_08103726: + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + bl obj_id_set_rotscale + ldr r1, =0x03005e00 + adds r0, r6, r5 + lsls r0, 3 + adds r1, r0, r1 + movs r2, 0xA + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08103760 + ldrh r0, [r1, 0x8] + adds r0, 0xB0 + strh r0, [r1, 0x8] + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0, 0x26] + adds r1, 0x1 + b _0810378A + .pool +_08103760: + cmp r0, 0x1 + bne _08103776 + ldrh r0, [r1, 0xE] + adds r0, 0x1 + strh r0, [r1, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1E + bne _081037D0 + movs r0, 0x2 + b _081037CE +_08103776: + ldrh r0, [r1, 0x8] + subs r0, 0xB0 + strh r0, [r1, 0x8] + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0, 0x26] + subs r1, 0x1 +_0810378A: + strh r1, [r0, 0x26] + adds r0, r4, 0 + bl sub_80A73A0 + ldr r0, =0x03005e00 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + movs r3, 0x8 + ldrsh r2, [r1, r3] + movs r0, 0xF2 + lsls r0, 4 + cmp r2, r0 + beq _081037AA + cmp r2, 0 + bne _081037D0 +_081037AA: + ldrh r2, [r1, 0xA] + movs r3, 0xA + ldrsh r0, [r1, r3] + cmp r0, 0x2 + bne _081037CC + adds r0, r4, 0 + bl sub_80A7344 + adds r0, r5, 0 + bl move_anim_task_del + b _081037D0 + .pool +_081037CC: + adds r0, r2, 0x1 +_081037CE: + strh r0, [r1, 0xA] +_081037D0: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81036DC + + thumb_func_start sub_81037D8 +sub_81037D8: @ 81037D8 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_80A6838 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08103804 + ldr r0, =0x0203841e + ldrh r1, [r4, 0x20] + ldrh r2, [r0] + subs r1, r2 + strh r1, [r4, 0x20] + adds r5, r0, 0 + b _08103810 + .pool +_08103804: + ldr r1, =0x0203841e + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + adds r5, r1, 0 +_08103810: + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810384C + adds r3, r4, 0 + adds r3, 0x3F + ldrb r0, [r3] + movs r1, 0x1 + adds r2, r0, 0 + orrs r2, r1 + strb r2, [r3] + movs r1, 0x4 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08103860 + movs r0, 0x2 + orrs r2, r0 + strb r2, [r3] + b _08103860 + .pool +_0810384C: + movs r2, 0x4 + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _08103860 + adds r2, r4, 0 + adds r2, 0x3F + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] +_08103860: + ldr r0, =sub_80A67D8 + str r0, [r4, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81037D8 + + thumb_func_start sub_810387C +sub_810387C: @ 810387C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + bl sub_80A69CC + ldr r0, =sub_80A67BC + str r0, [r4, 0x1C] + ldr r1, =sub_81038A0 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810387C + + thumb_func_start sub_81038A0 +sub_81038A0: @ 81038A0 + push {lr} + movs r1, 0x6 + strh r1, [r0, 0x2E] + ldrh r1, [r0, 0x20] + strh r1, [r0, 0x32] + ldrh r1, [r0, 0x22] + subs r1, 0x20 + strh r1, [r0, 0x36] + ldr r1, =sub_80A6EEC + str r1, [r0, 0x1C] + ldr r1, =move_anim_8072740 + bl oamt_set_x3A_32 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81038A0 + + thumb_func_start sub_81038C8 +sub_81038C8: @ 81038C8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r5, r0, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _081038EC + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] + b _0810390E + .pool +_081038EC: + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810390E + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] + ldrh r0, [r1, 0x6] + negs r0, r0 + strh r0, [r1, 0x6] +_0810390E: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + ldr r6, =0x0203841e + lsrs r0, 24 + ldrh r1, [r6, 0x4] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r2, [r6, 0x6] + adds r0, r2 + lsls r0, 16 + lsrs r0, 16 + adds r7, r0, 0 + ldrh r1, [r5, 0x20] + mov r2, r8 + lsls r0, r2, 16 + asrs r0, 16 + subs r0, r1 + lsls r0, 16 + asrs r0, 16 + ldrh r2, [r5, 0x22] + lsls r1, r7, 16 + asrs r1, 16 + subs r1, r2 + lsls r1, 16 + asrs r1, 16 + bl sub_80A74F4 + lsls r0, 16 + movs r1, 0xF0 + lsls r1, 24 + adds r0, r1 + lsrs r4, r0, 16 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08103980 + ldr r2, =0xffffa000 + adds r0, r4, r2 + lsls r0, 16 + lsrs r4, r0, 16 +_08103980: + movs r3, 0x80 + lsls r3, 1 + str r4, [sp] + adds r0, r5, 0 + movs r1, 0 + adds r2, r3, 0 + bl sub_80A73E0 + ldrh r0, [r6, 0x8] + strh r0, [r5, 0x2E] + mov r0, r8 + strh r0, [r5, 0x32] + strh r7, [r5, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r5, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r5, 0 + bl oamt_set_x3A_32 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81038C8 + + thumb_func_start sub_81039CC +sub_81039CC: @ 81039CC + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x2E] + subs r1, r0, 0x1 + strh r1, [r3, 0x2E] + lsls r0, 16 + cmp r0, 0 + bgt _081039F6 + ldr r2, =0x03005e00 + movs r0, 0x3C + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0xA] + subs r1, 0x1 + strh r1, [r0, 0xA] + adds r0, r3, 0 + bl RemoveObjectAndFreeTiles +_081039F6: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81039CC + + thumb_func_start sub_8103A00 +sub_8103A00: @ 8103A00 + push {r4,lr} + adds r2, r0, 0 + movs r0, 0x3C + ldrsh r1, [r2, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r3, 0x2E + ldrsh r1, [r2, r3] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + ble _08103A34 + ldrh r0, [r2, 0x34] + ldrh r1, [r2, 0x38] + adds r0, r1 + strh r0, [r2, 0x38] + ldrh r0, [r2, 0x36] + ldrh r3, [r2, 0x3A] + adds r0, r3 + b _08103A42 + .pool +_08103A34: + ldrh r0, [r2, 0x38] + ldrh r1, [r2, 0x34] + subs r0, r1 + strh r0, [r2, 0x38] + ldrh r0, [r2, 0x3A] + ldrh r1, [r2, 0x36] + subs r0, r1 +_08103A42: + strh r0, [r2, 0x3A] + ldrh r0, [r2, 0x38] + ldrh r1, [r2, 0x30] + adds r3, r0, r1 + strh r3, [r2, 0x30] + ldrh r0, [r2, 0x3A] + ldrh r1, [r2, 0x32] + adds r0, r1 + strh r0, [r2, 0x32] + ldrh r1, [r4, 0x16] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08103A66 + lsls r0, r3, 16 + lsrs r0, 24 + negs r0, r0 + b _08103A6A +_08103A66: + lsls r0, r3, 16 + lsrs r0, 24 +_08103A6A: + strh r0, [r2, 0x24] + ldrh r1, [r4, 0x18] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08103A7E + ldrh r0, [r2, 0x32] + lsrs r0, 8 + negs r0, r0 + b _08103A82 +_08103A7E: + ldrh r0, [r2, 0x32] + lsrs r0, 8 +_08103A82: + strh r0, [r2, 0x26] + ldrh r0, [r2, 0x2E] + subs r1, r0, 0x1 + strh r1, [r2, 0x2E] + lsls r0, 16 + cmp r0, 0 + bgt _08103A98 + movs r0, 0x1E + strh r0, [r2, 0x2E] + ldr r0, =sub_81039CC + str r0, [r2, 0x1C] +_08103A98: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8103A00 + + thumb_func_start sub_8103AA4 +sub_8103AA4: @ 8103AA4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + movs r0, 0x3C + ldrsh r1, [r7, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r6, r0, r1 + ldrh r2, [r6, 0x16] + movs r1, 0x2 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + ldrh r3, [r7, 0x30] + adds r2, r0, r3 + strh r2, [r7, 0x30] + ldrh r0, [r6, 0x18] + ands r1, r0 + ldrh r0, [r7, 0x32] + adds r1, r0 + strh r1, [r7, 0x32] + ldrh r1, [r6, 0x16] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08103AEC + lsls r0, r2, 16 + lsrs r0, 24 + negs r0, r0 + b _08103AF0 + .pool +_08103AEC: + lsls r0, r2, 16 + lsrs r0, 24 +_08103AF0: + strh r0, [r7, 0x24] + ldrh r1, [r6, 0x18] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08103B04 + ldrh r0, [r7, 0x32] + lsrs r0, 8 + negs r0, r0 + b _08103B08 +_08103B04: + ldrh r0, [r7, 0x32] + lsrs r0, 8 +_08103B08: + strh r0, [r7, 0x26] + ldrh r0, [r7, 0x2E] + subs r1, r0, 0x1 + strh r1, [r7, 0x2E] + lsls r0, 16 + cmp r0, 0 + bgt _08103BD4 + movs r4, 0 + movs r0, 0x8 + strh r0, [r7, 0x2E] + movs r0, 0x4 + strh r0, [r6, 0x12] + movs r0, 0x80 + lsls r0, 5 + bl sub_8151624 + lsls r0, 16 + lsrs r5, r0, 16 + ldrh r0, [r7, 0x24] + ldrh r1, [r7, 0x20] + adds r2, r0, r1 + strh r2, [r7, 0x20] + ldrh r0, [r7, 0x26] + ldrh r3, [r7, 0x22] + adds r0, r3 + strh r0, [r7, 0x22] + strh r4, [r7, 0x26] + strh r4, [r7, 0x24] + ldrh r3, [r6, 0x1E] + movs r0, 0x1E + ldrsh r1, [r6, r0] + lsls r0, r2, 16 + asrs r0, 16 + cmp r1, r0 + blt _08103B52 + subs r0, r3, r2 + b _08103B54 +_08103B52: + subs r0, r2, r3 +_08103B54: + lsls r0, 24 + lsrs r4, r0, 16 + ldrh r3, [r6, 0x20] + movs r0, 0x20 + ldrsh r1, [r6, r0] + ldrh r2, [r7, 0x22] + movs r6, 0x22 + ldrsh r0, [r7, r6] + cmp r1, r0 + blt _08103B6C + subs r0, r3, r2 + b _08103B6E +_08103B6C: + subs r0, r2, r3 +_08103B6E: + lsls r0, 24 + lsrs r0, 16 + mov r8, r0 + movs r0, 0 + strh r0, [r7, 0x32] + strh r0, [r7, 0x30] + strh r0, [r7, 0x3A] + strh r0, [r7, 0x38] + lsls r0, r4, 16 + asrs r0, 16 + lsls r5, 16 + asrs r5, 16 + adds r1, r5, 0 + bl sub_8151534 + adds r4, r0, 0 + lsls r4, 16 + asrs r4, 16 + movs r6, 0xE0 + lsls r6, 1 + adds r0, r6, 0 + bl sub_8151624 + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_8151534 + strh r0, [r7, 0x34] + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + adds r1, r5, 0 + bl sub_8151534 + adds r4, r0, 0 + lsls r4, 16 + asrs r4, 16 + adds r0, r6, 0 + bl sub_8151624 + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_8151534 + strh r0, [r7, 0x36] + ldr r0, =sub_8103A00 + str r0, [r7, 0x1C] +_08103BD4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8103AA4 + + thumb_func_start sub_8103BE4 +sub_8103BE4: @ 8103BE4 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r1, 0xA + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08103C02 + adds r0, r2, 0 + bl move_anim_task_del +_08103C02: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8103BE4 + + thumb_func_start sub_8103C0C +sub_8103C0C: @ 8103C0C + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r5, r0, r1 + ldrh r0, [r5, 0x8] + subs r1, r0, 0x1 + strh r1, [r5, 0x8] + lsls r0, 16 + cmp r0, 0 + bgt _08103CE0 + ldr r0, =gUnknown_085933B0 + movs r2, 0x1A + ldrsh r1, [r5, r2] + movs r3, 0x1C + ldrsh r2, [r5, r3] + ldrb r3, [r5, 0xC] + ldrb r4, [r5, 0xA] + subs r3, r4 + lsls r3, 24 + lsrs r3, 24 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + lsls r0, 4 + add r0, r12 + lsls r0, 2 + ldr r1, =0x02020630 + adds r6, r0, r1 + movs r1, 0x10 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _08103C6C + cmp r0, 0x2 + beq _08103C82 + b _08103C90 + .pool +_08103C6C: + ldrb r2, [r6, 0x3] + lsls r1, r2, 26 + lsrs r1, 27 + movs r0, 0x18 + orrs r1, r0 + lsls r1, 1 + subs r0, 0x57 + ands r0, r2 + orrs r0, r1 + strb r0, [r6, 0x3] + b _08103C90 +_08103C82: + ldrb r0, [r6, 0x3] + movs r1, 0x3F + negs r1, r1 + ands r1, r0 + movs r0, 0x10 + orrs r1, r0 + strb r1, [r6, 0x3] +_08103C90: + ldr r3, =0x03005e00 + lsls r2, r7, 2 + adds r2, r7 + lsls r2, 3 + adds r4, r2, r3 + ldrh r0, [r4, 0x12] + ldrh r1, [r4, 0x14] + subs r0, r1 + strh r0, [r6, 0x2E] + strh r7, [r6, 0x3C] + movs r1, 0xA + ldrsh r0, [r4, r1] + adds r0, 0xD + lsls r0, 1 + adds r0, r2 + adds r3, 0x8 + adds r0, r3 + mov r2, r12 + strh r2, [r0] + ldrh r0, [r4, 0xE] + strh r0, [r4, 0x8] + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + movs r0, 0x3F + negs r0, r0 + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x9A + bl audio_play_and_stuff + movs r3, 0xA + ldrsh r0, [r4, r3] + cmp r0, 0x2 + ble _08103CE0 + ldr r0, =sub_8103BE4 + str r0, [r4] +_08103CE0: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8103C0C + + thumb_func_start sub_8103CF0 +sub_8103CF0: @ 8103CF0 + 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 + movs r0, 0 + mov r9, r0 + movs r5, 0 + mov r0, sp + mov r1, r9 + strh r1, [r0] + mov r4, sp + adds r4, 0x2 + strh r1, [r4] + bl sub_80A4DF0 + lsls r0, 24 + mov r10, r4 + cmp r0, 0 + beq _08103D5C + ldr r1, =0x03005e00 + lsls r2, r7, 2 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0x2 + strh r1, [r0, 0x10] + ldr r3, =0x0203841e + ldrh r0, [r3] + negs r0, r0 + strh r0, [r3] + ldrh r1, [r3, 0x4] + movs r0, 0x1 + ands r0, r1 + mov r8, r2 + cmp r0, 0 + beq _08103D54 + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strh r0, [r3, 0x4] + b _08103DB6 + .pool +_08103D54: + movs r0, 0x1 + orrs r0, r1 + strh r0, [r3, 0x4] + b _08103DB6 +_08103D5C: + ldr r1, =0x02024076 + ldr r0, =0x02038437 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r1 + lsls r2, r7, 2 + mov r8, r2 + cmp r0, 0 + bne _08103DB6 + ldr r1, =0x03005e00 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 + strh r3, [r0, 0x10] + ldr r2, =0x0203841e + ldrh r0, [r2] + negs r0, r0 + strh r0, [r2] + ldrh r0, [r2, 0x2] + negs r0, r0 + strh r0, [r2, 0x2] + ldrh r1, [r2, 0x4] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08103DB0 + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + b _08103DB4 + .pool +_08103DB0: + movs r0, 0x1 + orrs r0, r1 +_08103DB4: + strh r0, [r2, 0x4] +_08103DB6: + ldr r5, =0x02038436 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A5C6C + ldr r1, =0x03005e00 + mov r3, r8 + adds r4, r3, r7 + lsls r4, 3 + adds r4, r1 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x1A] + adds r6, r0, 0 + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x1C] + mov r9, r0 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08103E20 + ldr r4, =0x02038437 + ldrb r1, [r4] + movs r0, 0x2 + eors r0, r1 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _08103E20 + ldrb r0, [r4] + movs r1, 0 + mov r2, sp + mov r3, r10 + bl sub_80A8924 + b _08103E42 + .pool +_08103E20: + mov r5, sp + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + mov r1, r10 + strh r0, [r1] +_08103E42: + mov r4, sp + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + mov r2, sp + ldr r3, =0x0203841e + ldrh r0, [r3] + ldrh r2, [r2] + adds r0, r2 + strh r0, [r1, 0x1E] + strh r0, [r4] + ldrh r0, [r3, 0x2] + mov r3, r10 + ldrh r3, [r3] + adds r0, r3 + strh r0, [r1, 0x20] + mov r1, r10 + strh r0, [r1] + mov r0, sp + ldrh r2, [r0] + movs r3, 0 + ldrsh r0, [r0, r3] + adds r1, r6, 0 + cmp r0, r1 + blt _08103E88 + subs r0, r2, r1 + b _08103E8A + .pool +_08103E88: + subs r0, r1, r2 +_08103E8A: + lsls r0, 16 + lsrs r0, 16 + lsls r4, r0, 16 + asrs r4, 16 + ldr r5, =0x0203841e + ldrh r1, [r5, 0x4] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + lsls r0, 16 + asrs r0, 16 + bl sub_8151624 + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_8151534 + ldr r2, =0x03005e00 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r6, r1, r2 + strh r0, [r6, 0x12] + movs r1, 0x12 + ldrsh r0, [r6, r1] + movs r1, 0x80 + bl sub_8151534 + strh r0, [r6, 0x14] + ldrh r0, [r5, 0x4] + strh r0, [r6, 0x16] + mov r2, r10 + ldrh r1, [r2] + movs r3, 0 + ldrsh r0, [r2, r3] + mov r4, r9 + cmp r0, r4 + blt _08103F08 + subs r4, r1, r4 + lsls r4, 16 + asrs r4, 16 + movs r1, 0x12 + ldrsh r0, [r6, r1] + bl sub_8151624 + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_8151534 + movs r1, 0x2 + negs r1, r1 + ands r1, r0 + strh r1, [r6, 0x18] + b _08103F28 + .pool +_08103F08: + subs r4, r1 + lsls r4, 16 + asrs r4, 16 + movs r2, 0x12 + ldrsh r0, [r6, r2] + bl sub_8151624 + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_8151534 + movs r1, 0x1 + orrs r0, r1 + strh r0, [r6, 0x18] +_08103F28: + ldr r1, =0x03005e00 + mov r3, r8 + adds r0, r3, r7 + lsls r0, 3 + adds r5, r0, r1 + ldr r4, =0x0203841e + ldrh r0, [r4, 0x6] + strh r0, [r5, 0xE] + ldrh r1, [r4, 0x8] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08103F78 + movs r0, 0x80 + eors r0, r1 + strh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3F + ble _08103FA0 + ldr r0, =0x02038437 + ldrb r0, [r0] + bl sub_80A82E4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x0000ffc0 + adds r1, r2, 0 + ldrh r4, [r4, 0x8] + adds r1, r4 + adds r0, r1 + b _08103FB0 + .pool +_08103F78: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x3F + ble _08103FA0 + ldr r0, =0x02038437 + ldrb r0, [r0] + bl sub_80A82E4 + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x0000ffc0 + adds r1, r3, 0 + ldrh r4, [r4, 0x8] + adds r1, r4 + adds r0, r1 + b _08103FB0 + .pool +_08103FA0: + ldr r0, =0x02038437 + ldrb r0, [r0] + bl sub_80A82E4 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x8] + subs r0, r1 +_08103FB0: + strh r0, [r5, 0xC] + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r0, 0x2 + bgt _08103FC8 + movs r0, 0x3 + strh r0, [r1, 0xC] +_08103FC8: + ldr r0, =sub_8103C0C + str r0, [r1] + 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_8103CF0 + + thumb_func_start sub_8103FE8 +sub_8103FE8: @ 8103FE8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + bl sub_80A69CC + ldr r0, =gUnknown_085934A0 + ldrh r0, [r0, 0x2] + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 20 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r0, [r4, 0x2E] + ldr r0, =sub_8104018 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8103FE8 + + thumb_func_start sub_8104018 +sub_8104018: @ 8104018 + push {r4-r7,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _0810407C + movs r0, 0 + strh r0, [r4, 0x30] + ldrh r5, [r4, 0x2E] + ldr r1, =0x02037b14 + adds r0, r5, 0 + adds r0, 0x8 + lsls r0, 1 + adds r0, r1 + ldrh r7, [r0] + adds r6, r1, 0 + adds r1, r5, 0 + adds r1, 0x9 + lsls r0, r5, 1 + adds r0, r6 + adds r2, r0, 0 + adds r2, 0x10 + movs r3, 0x7 + lsls r1, 1 + adds r1, r6 +_08104050: + ldrh r0, [r1] + strh r0, [r2] + adds r1, 0x2 + adds r2, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _08104050 + adds r0, r5, 0 + adds r0, 0xF + lsls r0, 1 + adds r0, r6 + strh r7, [r0] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x18 + bne _0810407C + adds r0, r4, 0 + bl move_anim_8072740 +_0810407C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8104018 + + thumb_func_start sub_8104088 +sub_8104088: @ 8104088 + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + ldr r4, =0x0203841e + lsrs r0, 24 + ldrh r1, [r4, 0x6] + adds r0, r1 + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _081040CC + ldrh r0, [r4, 0x4] + negs r0, r0 + strh r0, [r4, 0x4] +_081040CC: + lsls r0, r6, 16 + asrs r0, 16 + ldrh r1, [r4, 0x4] + adds r0, r1 + lsls r0, 16 + ldrh r1, [r5, 0x20] + lsrs r6, r0, 16 + asrs r0, 16 + subs r0, r1 + lsls r0, 16 + asrs r0, 16 + ldrh r2, [r5, 0x22] + lsls r1, r7, 16 + asrs r1, 16 + subs r1, r2 + lsls r1, 16 + asrs r1, 16 + bl sub_80A74F4 + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 24 + adds r0, r1 + lsrs r0, 16 + movs r3, 0x80 + lsls r3, 1 + str r0, [sp] + adds r0, r5, 0 + movs r1, 0 + adds r2, r3, 0 + bl sub_80A73E0 + ldrh r0, [r4, 0x8] + strh r0, [r5, 0x2E] + strh r6, [r5, 0x32] + strh r7, [r5, 0x36] + ldr r0, =sub_80A7000 + str r0, [r5, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r5, 0 + bl oamt_set_x3A_32 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8104088 + + thumb_func_start sub_810413C +sub_810413C: @ 810413C + ldr r1, =0x0000fff0 + strh r1, [r0, 0x32] + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + ldr r1, =sub_8104154 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_810413C + + thumb_func_start sub_8104154 +sub_8104154: @ 8104154 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x80 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08104178 + ldrh r0, [r4, 0x24] + negs r0, r0 + strh r0, [r4, 0x24] +_08104178: + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r2, 0x32 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x5 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7E + ble _081041B8 + movs r0, 0 + strh r0, [r4, 0x30] + movs r1, 0x32 + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _081041B8 + adds r0, r4, 0 + bl move_anim_8072740 +_081041B8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8104154 + + thumb_func_start sub_81041C4 +sub_81041C4: @ 81041C4 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + movs r0, 0x14 + strh r0, [r4, 0x2E] + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r4, 0x1C] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r1, =sub_810421C + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81041C4 + + thumb_func_start sub_810421C +sub_810421C: @ 810421C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x3F + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xA6 + bl audio_play_and_stuff + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + strh r1, [r4, 0x26] + strh r1, [r4, 0x24] + movs r2, 0 + movs r1, 0x7 + adds r0, r4, 0 + adds r0, 0x3C +_08104250: + strh r2, [r0] + subs r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08104250 + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x7 + ands r0, r1 + ldr r2, =0x0000fff4 + adds r1, r2, 0 + subs r1, r0 + strh r1, [r4, 0x3A] + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA0 + bl __umodsi3 + adds r0, 0xA0 + strh r0, [r4, 0x3C] + ldr r0, =sub_81042A0 + str r0, [r4, 0x1C] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810421C + + thumb_func_start sub_81042A0 +sub_81042A0: @ 81042A0 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x3C] + ldrh r2, [r4, 0x2E] + adds r0, r1, r2 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r2, r0, 24 + strh r2, [r4, 0x24] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081042BE + negs r0, r2 + strh r0, [r4, 0x24] +_081042BE: + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r2, 0x3A + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x8 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7E + ble _081042FE + movs r0, 0 + strh r0, [r4, 0x30] + movs r1, 0x32 + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _081042FE + adds r0, r4, 0 + bl move_anim_8072740 +_081042FE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81042A0 + + thumb_func_start sub_8104304 +sub_8104304: @ 8104304 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + bl sub_80A69CC + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08104322 + ldrh r0, [r4, 0x22] + adds r0, 0x10 + strh r0, [r4, 0x22] +_08104322: + ldr r1, =0x0203841e + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0xA] + strh r0, [r4, 0x32] + ldrh r0, [r1, 0xC] + strh r0, [r4, 0x34] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x36] + ldr r0, =sub_80A62EC + str r0, [r4, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8104304 + + thumb_func_start sub_8104364 +sub_8104364: @ 8104364 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + movs r7, 0x20 + ldr r4, =0x0000ffe0 + movs r0, 0x10 + mov r8, r0 + ldr r6, =0x0000fff0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08104390 + adds r7, r4, 0 + movs r4, 0x20 + mov r8, r6 + movs r6, 0x10 + adds r0, r5, 0 + movs r1, 0x1 + bl StartObjectImageAnim +_08104390: + lsls r0, r7, 16 + asrs r0, 16 + ldrh r1, [r5, 0x20] + adds r0, r1 + strh r0, [r5, 0x20] + lsls r0, r4, 16 + asrs r0, 16 + ldrh r1, [r5, 0x22] + adds r0, r1 + strh r0, [r5, 0x22] + movs r0, 0x6 + strh r0, [r5, 0x2E] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + add r0, r8 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r6 + strh r0, [r5, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r5, 0x1C] + ldr r1, =sub_81043F8 + adds r0, r5, 0 + bl oamt_set_x3A_32 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8104364 + + thumb_func_start sub_81043F8 +sub_81043F8: @ 81043F8 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0810440E + adds r0, r2, 0 + bl move_anim_8072740 +_0810440E: + pop {r0} + bx r0 + thumb_func_end sub_81043F8 + + thumb_func_start sub_8104414 +sub_8104414: @ 8104414 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r5, r0, 0 + movs r0, 0x20 + mov r8, r0 + ldr r4, =0x0000ffe0 + movs r2, 0x10 + mov r9, r2 + ldr r6, =0x0000fff0 + ldr r7, =0x0203841e + ldrh r1, [r7] + movs r2, 0 + ldrsh r0, [r7, r2] + cmp r0, 0 + beq _08104448 + mov r8, r4 + movs r4, 0x20 + mov r9, r6 + movs r6, 0x10 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl StartObjectImageAnim +_08104448: + mov r0, r8 + lsls r1, r0, 16 + asrs r1, 16 + ldrh r2, [r5, 0x20] + adds r1, r2 + strh r1, [r5, 0x20] + lsls r0, r4, 16 + asrs r0, 16 + ldrh r2, [r5, 0x22] + adds r0, r2 + strh r0, [r5, 0x22] + movs r0, 0x6 + strh r0, [r5, 0x2E] + strh r1, [r5, 0x30] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + add r0, r9 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r6 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldrh r0, [r7] + strh r0, [r5, 0x38] + ldrh r0, [r5, 0x2E] + strh r0, [r5, 0x3A] + ldr r0, =sub_81044BC + str r0, [r5, 0x1C] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8104414 + + thumb_func_start sub_81044BC +sub_81044BC: @ 81044BC + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _08104520 + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08104520 + adds r0, r4, 0 + movs r1, 0 + bl SeekObjectImageAnim + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + movs r2, 0 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + movs r0, 0x2 + strh r0, [r4, 0x24] + ldr r0, =0x0000fffe + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3A] + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x30] + movs r1, 0x1 + eors r0, r1 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x32] + eors r0, r1 + strh r0, [r4, 0x32] + strh r2, [r4, 0x36] + strh r2, [r4, 0x34] + ldr r0, =sub_8104530 + str r0, [r4, 0x1C] +_08104520: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81044BC + + thumb_func_start sub_8104530 +sub_8104530: @ 8104530 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08104548 + ldrh r0, [r4, 0x24] + negs r0, r0 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x26] + negs r0, r0 + strh r0, [r4, 0x26] +_08104548: + ldrh r0, [r4, 0x34] + movs r1, 0x1 + eors r0, r1 + movs r1, 0 + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x33 + bne _0810458A + strh r1, [r4, 0x26] + strh r1, [r4, 0x24] + strh r1, [r4, 0x36] + strh r1, [r4, 0x34] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x38] + movs r1, 0x1 + eors r1, r0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + ldr r0, =sub_8104594 + str r0, [r4, 0x1C] +_0810458A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8104530 + + thumb_func_start sub_8104594 +sub_8104594: @ 8104594 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _081045A8 + adds r0, r4, 0 + bl move_anim_8072740 +_081045A8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8104594 + + thumb_func_start sub_81045B0 +sub_81045B0: @ 81045B0 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A7270 + adds r0, r4, 0 + movs r1, 0xD0 + movs r2, 0xD0 + movs r3, 0 + bl obj_id_set_rotscale + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + adds r0, 0x10 + movs r1, 0 + bl sub_80A750C + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x50 + strh r1, [r0, 0x8] + ldr r1, =sub_8104614 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81045B0 + + thumb_func_start sub_8104614 +sub_8104614: @ 8104614 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + subs r1, 0x1 + strh r1, [r0, 0x8] + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _08104664 + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_80A7344 + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + adds r0, 0x10 + movs r1, 0x1 + bl sub_80A750C + adds r0, r5, 0 + bl move_anim_task_del +_08104664: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8104614 + + thumb_func_start sub_8104674 +sub_8104674: @ 8104674 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r4, 0x8] + movs r1, 0 + bl sub_80A7270 + strh r5, [r4, 0xA] + strh r5, [r4, 0xC] + strh r5, [r4, 0xE] + movs r0, 0x80 + lsls r0, 1 + strh r0, [r4, 0x10] + strh r5, [r4, 0x12] + strh r5, [r4, 0x14] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl sub_80A82E4 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x16] + ldr r0, =sub_81046CC + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8104674 + + thumb_func_start sub_81046CC +sub_81046CC: @ 81046CC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x5 + bls _081046E6 + b _081047F6 +_081046E6: + lsls r0, 2 + ldr r1, =_081046F8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081046F8: + .4byte _08104710 + .4byte _08104758 + .4byte _0810478E + .4byte _08104794 + .4byte _081047A4 + .4byte _081047D8 +_08104710: + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08104720 + cmp r0, 0x3 + beq _08104720 + cmp r0, 0x6 + bne _08104728 +_08104720: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8104800 +_08104728: + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x10] + adds r0, 0x28 + strh r0, [r4, 0x10] + ldrb r0, [r4, 0x8] + movs r1, 0x10 + ldrsh r2, [r4, r1] + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrb r0, [r4, 0x8] + bl sub_80A7E6C + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0x20 + bne _081047F6 + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + b _081047D0 +_08104758: + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081047F6 + movs r2, 0x12 + ldrsh r1, [r4, r2] + cmp r1, 0x3 + bne _0810476E + strh r0, [r4, 0xC] + strh r1, [r4, 0xA] + b _081047F6 +_0810476E: + strh r0, [r4, 0xC] + strh r0, [r4, 0xE] + movs r2, 0x80 + lsls r2, 1 + strh r2, [r4, 0x10] + ldrb r0, [r4, 0x8] + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrb r0, [r4, 0x8] + bl sub_80A7E6C + movs r0, 0x2 + strh r0, [r4, 0xA] + b _081047F6 +_0810478E: + movs r0, 0 + strh r0, [r4, 0xA] + b _081047F6 +_08104794: + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x20 + ble _081047F6 + b _081047CC +_081047A4: + ldrh r0, [r4, 0xC] + adds r0, 0x2 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x10] + subs r0, 0x50 + strh r0, [r4, 0x10] + ldrb r0, [r4, 0x8] + movs r1, 0x10 + ldrsh r2, [r4, r1] + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrb r0, [r4, 0x8] + bl sub_80A7E6C + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0x20 + bne _081047F6 +_081047CC: + movs r0, 0 + strh r0, [r4, 0xC] +_081047D0: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + b _081047F6 +_081047D8: + ldrb r0, [r4, 0x8] + bl sub_80A7344 + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strh r1, [r0, 0x26] + adds r0, r5, 0 + bl move_anim_task_del +_081047F6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81046CC + + thumb_func_start sub_8104800 +sub_8104800: @ 8104800 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + movs r0, 0 + bl duplicate_obj_of_side_rel2move_in_transparent_mode + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r0, 16 + asrs r4, r0, 16 + cmp r4, 0 + blt _081048DA + bl rotscale_alloc_entry + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0xFF + bne _08104844 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl obj_delete_but_dont_free_vram + b _081048DA + .pool +_08104844: + ldr r5, =0x02020630 + lsls r3, r4, 4 + adds r3, r4 + lsls r3, 2 + adds r4, r3, r5 + ldrb r1, [r4, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x3 + orrs r0, r1 + strb r0, [r4, 0x1] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x1F + ands r6, r0 + lsls r2, r6, 1 + ldrb r1, [r4, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x3] + ldrb r0, [r7, 0x16] + ldrb r1, [r7, 0xE] + subs r0, r1 + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + ldrh r0, [r7, 0xE] + adds r0, 0x1 + strh r0, [r7, 0xE] + ldrh r0, [r7, 0x14] + adds r0, 0x1 + strh r0, [r7, 0x14] + movs r0, 0x10 + strh r0, [r4, 0x2E] + mov r0, r9 + strh r0, [r4, 0x30] + movs r0, 0x6 + strh r0, [r4, 0x32] + adds r5, 0x1C + adds r3, r5 + ldr r0, =sub_81048F0 + str r0, [r3] + mov r1, r8 + lsls r0, r1, 24 + lsrs r0, 24 + movs r1, 0x10 + ldrsh r2, [r7, r1] + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrb r0, [r4, 0x1] + movs r3, 0x4 + negs r3, r3 + ands r3, r0 + movs r0, 0x1 + orrs r3, r0 + strb r3, [r4, 0x1] + lsrs r1, r3, 6 + ldrb r2, [r4, 0x3] + lsrs r2, 6 + lsls r3, 30 + lsrs r3, 30 + adds r0, r4, 0 + bl CalcVecFromObjectCenterToObjectUpperLeft +_081048DA: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8104800 + + thumb_func_start sub_81048F0 +sub_81048F0: @ 81048F0 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + bne _0810492E + ldr r3, =0x03005e00 + movs r0, 0x32 + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x30 + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl obj_delete_but_dont_free_vram +_0810492E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81048F0 + + thumb_func_start sub_8104938 +sub_8104938: @ 8104938 + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + ldr r5, =0x0203841e + movs r1, 0x2 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08104964 + adds r0, r2, 0 + bl move_anim_task_del + b _0810498A + .pool +_08104964: + ldrb r0, [r5] + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r2, 0 + strh r1, [r4, 0x8] + strh r2, [r4, 0xA] + ldrh r0, [r5, 0x2] + strh r0, [r4, 0xC] + strh r2, [r4, 0xE] + strh r2, [r4, 0x10] + ldr r2, =gUnknown_085935E8 + adds r0, r4, 0 + bl sub_80A7CFC + ldr r0, =sub_8104998 + str r0, [r4] +_0810498A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8104938 + + thumb_func_start sub_8104998 +sub_8104998: @ 8104998 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r0, 0xA + ldrsh r5, [r4, r0] + cmp r5, 0x1 + beq _08104A00 + cmp r5, 0x1 + bgt _081049C0 + cmp r5, 0 + beq _081049CA + b _08104AA8 + .pool +_081049C0: + cmp r5, 0x2 + beq _08104A34 + cmp r5, 0x3 + beq _08104A64 + b _08104AA8 +_081049CA: + adds r0, r4, 0 + bl sub_80A7D34 + ldrh r2, [r4, 0x10] + adds r2, 0x3 + strh r2, [r4, 0x10] + ldr r3, =0x02020630 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x26] + adds r1, r2 + strh r1, [r0, 0x26] + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _08104AA8 + strh r5, [r4, 0xE] + b _08104A5C + .pool +_08104A00: + adds r0, r4, 0 + bl sub_80A7D34 + ldr r2, =0x02020630 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x10] + ldrh r2, [r0, 0x26] + adds r1, r2 + strh r1, [r0, 0x26] + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _08104AA8 + movs r0, 0 + strh r0, [r4, 0xE] + b _08104A5C + .pool +_08104A34: + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08104A5C + ldr r2, =0x02020630 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + subs r1, 0x2 + strh r1, [r0, 0x26] + ldrh r0, [r4, 0x10] + subs r0, 0x2 + strh r0, [r4, 0x10] + b _08104AA8 + .pool +_08104A5C: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + b _08104AA8 +_08104A64: + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _08104AA8 + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _08104A9C + ldr r2, =0x02020630 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x26] + adds r0, r6, 0 + bl move_anim_task_del + b _08104AA8 + .pool +_08104A9C: + ldrb r1, [r4, 0x8] + ldr r2, =gUnknown_085935E8 + adds r0, r4, 0 + bl sub_80A7CFC + strh r5, [r4, 0xA] +_08104AA8: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8104998 + + thumb_func_start sub_8104AB4 +sub_8104AB4: @ 8104AB4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_08593608 + adds r0, r4, 0 + bl sub_80A7CFC + ldr r0, =sub_8104AF0 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8104AB4 + + thumb_func_start sub_8104AF0 +sub_8104AF0: @ 8104AF0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r0, r1 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _08104B10 + adds r0, r4, 0 + bl move_anim_task_del +_08104B10: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8104AF0 + + thumb_func_start sub_8104B1C +sub_8104B1C: @ 8104B1C + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x02038436 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08104B50 + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnim + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x20 + strh r0, [r4, 0x20] + movs r0, 0x40 + b _08104B6A + .pool +_08104B50: + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnim + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x20 + strh r0, [r4, 0x20] + ldr r0, =0x0000ffc0 +_08104B6A: + strh r0, [r4, 0x30] + ldr r0, =0x02038436 + ldrb r0, [r0] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + strh r0, [r4, 0x22] + movs r0, 0x34 + strh r0, [r4, 0x2E] + strh r1, [r4, 0x32] + strh r1, [r4, 0x34] + strh r1, [r4, 0x36] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A656C + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8104B1C + + thumb_func_start sub_8104BAC +sub_8104BAC: @ 8104BAC + push {r4-r6,lr} + adds r6, r0, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08104BC8 + ldr r0, =0x02038436 + b _08104BCA + .pool +_08104BC8: + ldr r0, =0x02038437 +_08104BCA: + ldrb r5, [r0] + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08104BE4 + ldr r1, =0x0203841e + movs r2, 0x2 + ldrsh r0, [r1, r2] + negs r0, r0 + strh r0, [r1, 0x2] +_08104BE4: + adds r0, r5, 0 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + ldr r4, =0x0203841e + lsrs r0, 24 + ldrh r1, [r4, 0x2] + adds r0, r1 + strh r0, [r6, 0x20] + adds r0, r5, 0 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r4, [r4, 0x4] + adds r0, r4 + strh r0, [r6, 0x22] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + bgt _08104C16 + movs r0, 0x8 + strh r0, [r6, 0x22] +_08104C16: + ldr r1, =move_anim_8074EE0 + adds r0, r6, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A67BC + str r0, [r6, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8104BAC + + thumb_func_start sub_8104C38 +sub_8104C38: @ 8104C38 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + strh r1, [r4, 0x8] + strh r0, [r4, 0xA] + ldr r2, =gUnknown_085936A4 + adds r0, r4, 0 + bl sub_80A7CFC + ldr r0, =sub_8104C78 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8104C38 + + thumb_func_start sub_8104C78 +sub_8104C78: @ 8104C78 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r0, r1 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _08104C98 + adds r0, r4, 0 + bl move_anim_task_del +_08104C98: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8104C78 + + thumb_func_start sub_8104CA4 +sub_8104CA4: @ 8104CA4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r4, r1, r0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + strh r0, [r4, 0x8] + strh r2, [r4, 0xA] + movs r0, 0x4 + strh r0, [r4, 0xC] + movs r0, 0x7 + strh r0, [r4, 0xE] + movs r0, 0x3 + strh r0, [r4, 0x10] + ldr r3, =0x02020630 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x20] + strh r0, [r4, 0x12] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x22] + strh r0, [r4, 0x14] + strh r2, [r4, 0x16] + strh r2, [r4, 0x18] + movs r0, 0x2 + strh r0, [r4, 0x1A] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08104D0E + movs r1, 0xC + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0xC] +_08104D0E: + ldr r0, =sub_8104D28 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8104CA4 + + thumb_func_start sub_8104D28 +sub_8104D28: @ 8104D28 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r3, r0, r1 + ldrh r0, [r3, 0x16] + adds r0, 0x1 + strh r0, [r3, 0x16] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _08104D8E + movs r0, 0 + strh r0, [r3, 0x16] + ldrh r0, [r3, 0x18] + adds r0, 0x1 + strh r0, [r3, 0x18] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08104D78 + ldr r2, =0x02020630 + movs r0, 0x8 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0x1A] + ldrh r2, [r0, 0x22] + adds r1, r2 + b _08104D8C + .pool +_08104D78: + ldr r2, =0x02020630 + movs r5, 0x8 + ldrsh r1, [r3, r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + ldrh r2, [r3, 0x1A] + subs r1, r2 +_08104D8C: + strh r1, [r0, 0x22] +_08104D8E: + movs r1, 0xA + ldrsh r0, [r3, r1] + cmp r0, 0x1 + beq _08104DDC + cmp r0, 0x1 + bgt _08104DA4 + cmp r0, 0 + beq _08104DAA + b _08104E6C + .pool +_08104DA4: + cmp r0, 0x2 + beq _08104E0C + b _08104E6C +_08104DAA: + ldr r2, =0x02020630 + movs r5, 0x8 + ldrsh r1, [r3, r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0xC] + ldrh r2, [r0, 0x20] + adds r1, r2 + strh r1, [r0, 0x20] + ldrh r0, [r3, 0xE] + subs r0, 0x1 + strh r0, [r3, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _08104E6C + movs r0, 0xE + strh r0, [r3, 0xE] + movs r0, 0x1 + strh r0, [r3, 0xA] + b _08104E6C + .pool +_08104DDC: + ldr r2, =0x02020630 + movs r5, 0x8 + ldrsh r1, [r3, r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x20] + ldrh r2, [r3, 0xC] + subs r1, r2 + strh r1, [r0, 0x20] + ldrh r0, [r3, 0xE] + subs r0, 0x1 + strh r0, [r3, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _08104E6C + movs r0, 0x7 + strh r0, [r3, 0xE] + movs r0, 0x2 + strh r0, [r3, 0xA] + b _08104E6C + .pool +_08104E0C: + ldr r2, =0x02020630 + movs r0, 0x8 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0xC] + ldrh r5, [r0, 0x20] + adds r1, r5 + strh r1, [r0, 0x20] + ldrh r0, [r3, 0xE] + subs r0, 0x1 + strh r0, [r3, 0xE] + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + bne _08104E6C + ldrh r0, [r3, 0x10] + subs r0, 0x1 + strh r0, [r3, 0x10] + lsls r0, 16 + cmp r0, 0 + beq _08104E48 + movs r0, 0x7 + strh r0, [r3, 0xE] + strh r1, [r3, 0xA] + b _08104E6C + .pool +_08104E48: + ldrh r1, [r3, 0x18] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08104E66 + movs r0, 0x8 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + ldrh r2, [r3, 0x1A] + subs r1, r2 + strh r1, [r0, 0x22] +_08104E66: + adds r0, r4, 0 + bl move_anim_task_del +_08104E6C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8104D28 + + thumb_func_start sub_8104E74 +sub_8104E74: @ 8104E74 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r5, r1, r0 + ldr r4, =0x02038437 + ldrb r0, [r4] + bl sub_80A6190 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x20 + movs r1, 0 + strh r0, [r5, 0x8] + movs r0, 0x4 + strh r0, [r5, 0xA] + strh r1, [r5, 0xC] + strh r1, [r5, 0xE] + strh r1, [r5, 0x10] + strh r1, [r5, 0x12] + ldrb r0, [r4] + bl sub_80A861C + strh r0, [r5, 0x26] + ldrb r0, [r4] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08104ED4 + ldr r0, =0x02022e18 + ldrh r0, [r0] + strh r0, [r5, 0x14] + ldr r0, =0x04000014 + b _08104EDC + .pool +_08104ED4: + ldr r0, =0x02022e1c + ldrh r0, [r0] + strh r0, [r5, 0x14] + ldr r0, =0x04000018 +_08104EDC: + str r0, [sp] + ldrh r0, [r5, 0x8] + adds r1, r0, 0 + subs r1, 0x40 + lsls r2, r1, 16 + lsls r0, 16 + cmp r2, r0 + bgt _08104F1A + ldr r4, =0x02038c28 + movs r0, 0xF0 + lsls r0, 3 + adds r6, r4, r0 +_08104EF4: + asrs r3, r2, 16 + cmp r3, 0 + blt _08104F0C + lsls r1, r3, 1 + adds r2, r1, r4 + ldrh r0, [r5, 0x14] + adds r0, 0xF0 + strh r0, [r2] + adds r1, r6 + ldrh r0, [r5, 0x14] + adds r0, 0xF0 + strh r0, [r1] +_08104F0C: + adds r0, r3, 0x1 + lsls r2, r0, 16 + asrs r1, r2, 16 + movs r3, 0x8 + ldrsh r0, [r5, r3] + cmp r1, r0 + ble _08104EF4 +_08104F1A: + ldr r0, =0xa2600001 + str r0, [sp, 0x4] + mov r1, sp + movs r2, 0 + movs r0, 0x1 + strb r0, [r1, 0x8] + mov r0, sp + strb r2, [r0, 0x9] + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + ldr r0, =sub_8104F54 + str r0, [r5] + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8104E74 + + thumb_func_start sub_8104F54 +sub_8104F54: @ 8104F54 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r3, r0, r1 + movs r1, 0x10 + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _08104F78 + cmp r0, 0x1 + beq _08104F8E + b _0810500E + .pool +_08104F78: + ldrh r0, [r3, 0x12] + adds r0, 0x1 + strh r0, [r3, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _0810500E + ldrh r0, [r3, 0x10] + adds r0, 0x1 + strh r0, [r3, 0x10] + b _0810500E +_08104F8E: + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _0810500E + movs r0, 0 + strh r0, [r3, 0xA] + ldrh r1, [r3, 0xE] + movs r0, 0x3 + ands r0, r1 + strh r0, [r3, 0xC] + ldrh r0, [r3, 0x8] + subs r0, r1 + strh r0, [r3, 0x12] + movs r2, 0xC + ldrsh r1, [r3, r2] + cmp r1, 0x1 + beq _08104FC4 + cmp r1, 0x1 + ble _08104FCC + cmp r1, 0x2 + beq _08104FC8 + cmp r1, 0x3 + beq _08104FC8 + b _08104FCC +_08104FC4: + subs r0, 0x2 + b _08104FCA +_08104FC8: + adds r0, 0x1 +_08104FCA: + strh r0, [r3, 0x12] +_08104FCC: + movs r1, 0x12 + ldrsh r0, [r3, r1] + cmp r0, 0 + blt _08104FF0 + ldr r2, =0x02038c28 + lsls r0, 1 + adds r0, r2 + ldrh r1, [r3, 0x14] + strh r1, [r0] + movs r1, 0x12 + ldrsh r0, [r3, r1] + lsls r0, 1 + movs r1, 0xF0 + lsls r1, 3 + adds r2, r1 + adds r0, r2 + ldrh r1, [r3, 0x14] + strh r1, [r0] +_08104FF0: + ldrh r0, [r3, 0xE] + adds r0, 0x1 + strh r0, [r3, 0xE] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x26 + ldrsh r1, [r3, r2] + cmp r0, r1 + blt _0810500E + ldr r1, =0x02039b28 + movs r0, 0x3 + strb r0, [r1, 0x15] + adds r0, r4, 0 + bl move_anim_task_del +_0810500E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8104F54 + + thumb_func_start sub_810501C +sub_810501C: @ 810501C + push {r4-r6,lr} + adds r4, r0, 0 + ldr r6, =0x02038437 + ldrb r0, [r6] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x10 + movs r5, 0 + strh r0, [r4, 0x20] + ldrb r0, [r6] + bl sub_80A6190 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x10 + strh r0, [r4, 0x22] + strh r5, [r4, 0x2E] + strh r5, [r4, 0x30] + strh r5, [r4, 0x32] + movs r0, 0x10 + strh r0, [r4, 0x34] + strh r5, [r4, 0x36] + ldrb r0, [r6] + movs r1, 0 + bl sub_80A861C + adds r0, 0x2 + strh r0, [r4, 0x38] + movs r0, 0x3F + bl sub_80A5178 + lsls r0, 24 + asrs r0, 24 + strh r0, [r4, 0x3A] + ldr r0, =sub_8105078 + str r0, [r4, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810501C + + thumb_func_start sub_8105078 +sub_8105078: @ 8105078 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x2E + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _081050DC + cmp r1, 0x1 + bgt _0810508E + cmp r1, 0 + beq _08105094 + b _081051BC +_0810508E: + cmp r1, 0x2 + beq _0810516E + b _081051BC +_08105094: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081050BE + strh r1, [r4, 0x32] + adds r3, r4, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsrs r1, r2, 2 + movs r0, 0x1 + eors r1, r0 + ands r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_081050BE: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _081051BC + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x5 + negs r1, r1 + ands r1, r0 + strb r1, [r2] + b _08105166 +_081050DC: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _08105122 + ldrh r2, [r4, 0x32] + movs r3, 0x32 + ldrsh r1, [r4, r3] + movs r3, 0x38 + ldrsh r0, [r4, r3] + cmp r1, r0 + bge _08105122 + movs r0, 0 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x22] + subs r0, 0x1 + strh r0, [r4, 0x22] + adds r0, r2, 0x1 + strh r0, [r4, 0x32] + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r1, 0xA + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _08105122 + ldrh r1, [r4, 0x3A] + lsls r1, 24 + asrs r1, 24 + movs r0, 0xCD + bl audio_play_and_stuff +_08105122: + ldrh r0, [r4, 0x34] + ldrh r2, [r4, 0x36] + adds r1, r0, r2 + strh r1, [r4, 0x36] + lsls r0, r1, 16 + asrs r2, r0, 16 + cmp r2, 0x1F + ble _08105136 + movs r0, 0x40 + b _08105144 +_08105136: + movs r0, 0x20 + negs r0, r0 + cmp r2, r0 + bgt _08105150 + movs r2, 0x40 + negs r2, r2 + adds r0, r2, 0 +_08105144: + subs r0, r1 + strh r0, [r4, 0x36] + movs r3, 0x34 + ldrsh r0, [r4, r3] + negs r0, r0 + strh r0, [r4, 0x34] +_08105150: + ldrh r0, [r4, 0x36] + movs r2, 0 + strh r0, [r4, 0x24] + movs r0, 0x38 + ldrsh r1, [r4, r0] + movs r3, 0x32 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _081051BC + strh r2, [r4, 0x30] + strh r2, [r4, 0x32] +_08105166: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _081051BC +_0810516E: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0810519A + movs r0, 0 + strh r0, [r4, 0x32] + adds r3, r4, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsrs r1, r2, 2 + movs r0, 0x1 + eors r1, r0 + ands r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_0810519A: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _081051BC + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + bl move_anim_8072740 +_081051BC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8105078 + + thumb_func_start sub_81051C4 +sub_81051C4: @ 81051C4 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + movs r5, 0 + mov r0, sp + strh r5, [r0] + mov r1, sp + adds r1, 0x2 + strh r5, [r1] + ldr r0, =0x0203841e + movs r3, 0x4 + ldrsh r2, [r0, r3] + adds r7, r1, 0 + adds r1, r0, 0 + cmp r2, 0 + bne _081051F0 + ldr r0, =0x02038436 + b _081051F2 + .pool +_081051F0: + ldr r0, =0x02038437 +_081051F2: + ldrb r5, [r0] + ldrb r1, [r1, 0x6] + movs r0, 0x1 + adds r4, r0, 0 + eors r4, r1 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0810526A + movs r1, 0x2 + adds r0, r5, 0 + eors r0, r1 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810526A + adds r0, r5, 0 + adds r1, r4, 0 + mov r2, sp + adds r3, r7, 0 + bl sub_80A8924 + cmp r4, 0 + bne _08105230 + adds r0, r5, 0 + movs r1, 0 + b _08105234 + .pool +_08105230: + adds r0, r5, 0 + movs r1, 0x2 +_08105234: + bl sub_80A5C6C + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08105260 + ldr r2, =0x0203841e + mov r0, sp + ldrh r1, [r0] + subs r1, r4 + ldrh r0, [r2] + subs r1, r0 + subs r0, r1 + strh r0, [r2] + b _0810526A + .pool +_08105260: + ldr r1, =0x0203841e + mov r0, sp + ldrh r0, [r0] + subs r0, r4 + strh r0, [r1] +_0810526A: + ldr r1, =sub_80A77C8 + str r1, [r6, 0x1C] + adds r0, r6, 0 + bl _call_via_r1 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81051C4 + + thumb_func_start sub_8105284 +sub_8105284: @ 8105284 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _0810529E + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl move_anim_8072740 +_0810529E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8105284 + + thumb_func_start sub_81052A4 +sub_81052A4: @ 81052A4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r5, r0, 0 + movs r6, 0 + mov r0, sp + strh r6, [r0] + mov r1, sp + adds r1, 0x2 + strh r6, [r1] + ldr r0, =0x0203841e + movs r2, 0xA + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _081052DC + ldr r0, =0x02038436 + ldrb r7, [r0] + ldr r0, =0x02038437 + b _081052E2 + .pool +_081052DC: + ldr r0, =0x02038437 + ldrb r7, [r0] + ldr r0, =0x02038436 +_081052E2: + ldrb r0, [r0] + mov r8, r0 + ldr r0, =0x0203841e + movs r3, 0xC + ldrsh r0, [r0, r3] + cmp r0, 0 + bne _08105308 + movs r0, 0 + mov r10, r0 + movs r1, 0x1 + str r1, [sp, 0x4] + b _08105310 + .pool +_08105308: + movs r2, 0x2 + mov r10, r2 + movs r3, 0x3 + str r3, [sp, 0x4] +_08105310: + adds r0, r7, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810536C + adds r0, r7, 0 + mov r1, r10 + bl sub_80A5C6C + lsls r0, 24 + ldr r1, =0x0203841e + lsrs r0, 24 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + movs r0, 0x2 + mov r4, r8 + eors r4, r0 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810535C + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + adds r0, r4, r0 + b _081053EA + .pool +_0810535C: + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + add r0, r8 + b _081053EA + .pool +_0810536C: + adds r0, r7, 0 + mov r1, r10 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0203841e + ldrh r1, [r1] + subs r0, r1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _081053E4 + movs r0, 0x2 + adds r4, r7, 0 + eors r4, r0 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _081053E4 + ldr r3, =0x02020630 + ldr r2, =0x020241e4 + adds r0, r7, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r6, r0, r3 + adds r2, r4, r2 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r3 + movs r0, 0x20 + ldrsh r1, [r6, r0] + movs r3, 0x20 + ldrsh r0, [r2, r3] + cmp r1, r0 + bge _081053E0 + adds r0, r2, 0 + adds r0, 0x43 + ldrb r0, [r0] + adds r0, 0x1 + b _081053FA + .pool +_081053E0: + adds r0, r6, 0 + b _081053F4 +_081053E4: + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + adds r0, r7, r0 +_081053EA: + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 +_081053F4: + adds r0, 0x43 + ldrb r0, [r0] + subs r0, 0x1 +_081053FA: + adds r1, r5, 0 + adds r1, 0x43 + strb r0, [r1] + adds r0, r7, 0 + ldr r1, [sp, 0x4] + bl sub_80A5C6C + lsls r0, 24 + ldr r4, =0x0203841e + lsrs r0, 24 + ldrh r1, [r4, 0x2] + adds r0, r1 + lsls r0, 16 + lsrs r6, r0, 16 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810544C + movs r1, 0x2 + mov r0, r8 + eors r0, r1 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810544C + ldrb r1, [r4, 0xC] + mov r0, r8 + mov r2, sp + mov r3, sp + adds r3, 0x2 + bl sub_80A8924 + b _0810546C + .pool +_0810544C: + mov r4, sp + mov r0, r8 + mov r1, r10 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + mov r0, r8 + ldr r1, [sp, 0x4] + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + mov r2, sp + strh r0, [r2, 0x2] +_0810546C: + mov r0, r8 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08105490 + mov r3, sp + mov r2, sp + ldr r1, =0x0203841e + ldrh r0, [r1, 0x6] + ldrh r2, [r2] + adds r0, r2 + strh r0, [r3] + adds r2, r1, 0 + b _0810549E + .pool +_08105490: + mov r3, sp + mov r0, sp + ldr r2, =0x0203841e + ldrh r0, [r0] + ldrh r1, [r2, 0x6] + subs r0, r1 + strh r0, [r3] +_0810549E: + ldrh r1, [r2, 0x8] + mov r3, sp + ldrh r3, [r3, 0x2] + adds r1, r3 + mov r0, sp + strh r1, [r0, 0x2] + mov r3, r9 + strh r3, [r5, 0x30] + strh r3, [r5, 0x20] + strh r6, [r5, 0x34] + strh r6, [r5, 0x22] + ldrh r0, [r0] + strh r0, [r5, 0x32] + strh r1, [r5, 0x36] + ldrh r0, [r2] + strh r0, [r5, 0x2E] + adds r0, r5, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r1, =sub_8105284 + str r1, [r5, 0x1C] + adds r0, r5, 0 + bl _call_via_r1 + 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_81052A4 + + thumb_func_start sub_81054E8 +sub_81054E8: @ 81054E8 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x000027db + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _0810550E + lsls r0, 20 + ldr r1, =0x01010000 + adds r0, r1 + lsrs r0, 16 + ldr r1, =0x0203841e + ldrb r2, [r1, 0xA] + ldrh r3, [r1, 0x8] + movs r1, 0xF + bl pal_fade_1 +_0810550E: + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + ldr r1, =sub_80A77C8 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81054E8 + + thumb_func_start sub_8105538 +sub_8105538: @ 8105538 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + bl sub_80A69CC + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + movs r1, 0xA0 + cmp r0, 0 + beq _08105554 + ldr r1, =0x0000ff60 +_08105554: + movs r0, 0xE0 + lsls r0, 2 + strh r0, [r4, 0x2E] + strh r1, [r4, 0x30] + ldr r0, =0x0203841e + ldrh r0, [r0, 0x4] + strh r0, [r4, 0x3C] + ldr r0, =sub_810557C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8105538 + + thumb_func_start sub_810557C +sub_810557C: @ 810557C + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x2E] + lsls r0, r2, 16 + asrs r0, 24 + ldrh r1, [r4, 0x26] + subs r1, r0 + movs r5, 0 + strh r1, [r4, 0x26] + ldrh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + subs r2, 0x20 + strh r2, [r4, 0x2E] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + movs r1, 0xA0 + cmp r0, 0 + beq _081055AC + ldr r1, =0x0000ff60 +_081055AC: + lsls r0, r1, 16 + asrs r0, 16 + ldrh r1, [r4, 0x30] + adds r0, r1 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x26] + movs r2, 0x26 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _081055E0 + ldrh r2, [r4, 0x22] + adds r0, r1, r2 + strh r0, [r4, 0x22] + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + strh r5, [r4, 0x26] + strh r5, [r4, 0x24] + strh r5, [r4, 0x2E] + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + ldr r0, =sub_81055F4 + str r0, [r4, 0x1C] +_081055E0: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810557C + + thumb_func_start sub_81055F4 +sub_81055F4: @ 81055F4 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r1, r0, 0x1 + strh r1, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _08105612 + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectRotScalAnim + ldr r0, =sub_810561C + str r0, [r4, 0x1C] +_08105612: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81055F4 + + thumb_func_start sub_810561C +sub_810561C: @ 810561C + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08105682 + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + movs r0, 0 + strh r0, [r4, 0x2E] + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08105668 + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x10 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + ldr r0, =sub_8105694 + b _08105680 + .pool +_08105668: + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x20 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + ldr r0, =sub_810571C +_08105680: + str r0, [r4, 0x1C] +_08105682: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810561C + + thumb_func_start sub_8105694 +sub_8105694: @ 8105694 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x26] + subs r0, 0x2 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + bne _081056CA + movs r0, 0x10 + strh r0, [r4, 0x2E] + movs r0, 0 + strh r0, [r4, 0x30] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + ldrh r1, [r4, 0x2E] + movs r0, 0x52 + bl SetGpuReg + ldr r0, =sub_81056D4 + str r0, [r4, 0x1C] +_081056CA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8105694 + + thumb_func_start sub_81056D4 +sub_81056D4: @ 81056D4 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + adds r1, r0, 0x1 + strh r1, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _08105712 + ldrh r1, [r4, 0x2E] + subs r1, 0x1 + strh r1, [r4, 0x2E] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08105712 + ldr r0, =sub_810571C + str r0, [r4, 0x1C] +_08105712: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81056D4 + + thumb_func_start sub_810571C +sub_810571C: @ 810571C + push {lr} + adds r3, r0, 0 + ldr r0, =0x0203841e + ldrh r1, [r0, 0xE] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _08105754 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + movs r1, 0x3C + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _08105750 + ldr r0, =sub_810575C + b _08105752 + .pool +_08105750: + ldr r0, =move_anim_8072740 +_08105752: + str r0, [r3, 0x1C] +_08105754: + pop {r0} + bx r0 + .pool + thumb_func_end sub_810571C + + thumb_func_start sub_810575C +sub_810575C: @ 810575C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r4, 0 + bl move_anim_8072740 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810575C + + thumb_func_start sub_810577C +sub_810577C: @ 810577C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + strh r1, [r4, 0x8] + ldr r2, =gUnknown_085938B0 + adds r0, r4, 0 + bl sub_80A7CFC + ldr r0, =sub_81057B8 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810577C + + thumb_func_start sub_81057B8 +sub_81057B8: @ 81057B8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + bne _08105802 + ldr r2, =0x02020630 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x26] + movs r0, 0x8 + ldrsh r1, [r4, 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] + adds r0, r5, 0 + bl move_anim_task_del +_08105802: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81057B8 + + thumb_func_start sub_8105810 +sub_8105810: @ 8105810 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r4, r1, r0 + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0xA] + strh r0, [r4, 0xC] + strh r0, [r4, 0xE] + movs r0, 0x3 + strh r0, [r4, 0x20] + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08105850 + ldr r0, =0x0000ffff + strh r0, [r4, 0x22] + movs r0, 0x8 + b _08105856 + .pool +_08105850: + movs r0, 0x1 + strh r0, [r4, 0x22] + ldr r0, =0x0000fff8 +_08105856: + strh r0, [r4, 0x24] + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + ldr r0, =sub_8105878 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8105810 + + thumb_func_start sub_8105878 +sub_8105878: @ 8105878 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r3, r0, r1 + movs r0, 0x8 + ldrsh r4, [r3, r0] + cmp r4, 0x1 + beq _081058CC + cmp r4, 0x1 + bgt _081058A0 + cmp r4, 0 + beq _081058AA + b _08105992 + .pool +_081058A0: + cmp r4, 0x2 + beq _08105948 + cmp r4, 0x3 + beq _08105962 + b _08105992 +_081058AA: + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0x24] + ldrh r2, [r0, 0x24] + adds r1, r2 + strh r1, [r0, 0x24] + strh r4, [r3, 0xA] + strh r4, [r3, 0xC] + strh r4, [r3, 0xE] + b _0810595A + .pool +_081058CC: + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08105992 + movs r0, 0 + strh r0, [r3, 0xA] + ldrh r0, [r3, 0xC] + adds r0, 0x1 + strh r0, [r3, 0xC] + ands r0, r4 + lsls r0, 16 + cmp r0, 0 + beq _08105904 + ldr r2, =0x02020630 + movs r4, 0x26 + ldrsh r1, [r3, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x24] + adds r1, 0x6 + b _08105916 + .pool +_08105904: + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x24] + subs r1, 0x6 +_08105916: + strh r1, [r0, 0x24] + ldrh r0, [r3, 0xE] + adds r0, 0x1 + strh r0, [r3, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _08105992 + ldrh r1, [r3, 0xC] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0810595A + movs r1, 0x26 + ldrsh r0, [r3, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x24] + subs r0, 0x6 + strh r0, [r1, 0x24] + b _0810595A + .pool +_08105948: + ldrh r0, [r3, 0x20] + subs r0, 0x1 + strh r0, [r3, 0x20] + lsls r0, 16 + cmp r0, 0 + beq _0810595A + movs r0, 0 + strh r0, [r3, 0x8] + b _08105992 +_0810595A: + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] + b _08105992 +_08105962: + ldr r2, =0x02020630 + movs r4, 0x26 + ldrsh r1, [r3, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0x22] + ldrh r4, [r0, 0x24] + adds r1, r4 + strh r1, [r0, 0x24] + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x24 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08105992 + adds r0, r5, 0 + bl move_anim_task_del +_08105992: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8105878 + + thumb_func_start sub_810599C +sub_810599C: @ 810599C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0xA] + strh r0, [r4, 0xC] + strh r0, [r4, 0xE] + movs r0, 0x1 + strh r0, [r4, 0x10] + movs r0, 0xE + strh r0, [r4, 0x22] + movs r0, 0x2 + strh r0, [r4, 0x24] + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + ldr r0, =sub_81059E0 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810599C + + thumb_func_start sub_81059E0 +sub_81059E0: @ 81059E0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r2, [r4, r0] + cmp r2, 0 + bne _08105AA6 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x10 + ldrsh r1, [r4, r3] + cmp r0, r1 + ble _08105AA6 + strh r2, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08105A3C + ldr r3, =0x02020630 + movs r6, 0x26 + ldrsh r1, [r4, r6] + 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 + b _08105A52 + .pool +_08105A3C: + ldr r3, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + 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 +_08105A52: + strb r1, [r0] + ldrh r0, [r4, 0xE] + adds r0, 0x1 + movs r2, 0 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + movs r6, 0x22 + ldrsh r1, [r4, r6] + cmp r0, r1 + blt _08105AA6 + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 16 + movs r6, 0x24 + ldrsh r1, [r4, r6] + cmp r0, r1 + bge _08105A88 + strh r2, [r4, 0xA] + strh r2, [r4, 0xC] + strh r2, [r4, 0xE] + b _08105AA6 + .pool +_08105A88: + movs r0, 0x26 + 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] + adds r0, r5, 0 + bl move_anim_task_del +_08105AA6: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81059E0 + + thumb_func_start sub_8105AAC +sub_8105AAC: @ 8105AAC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + movs r0, 0 + strh r0, [r4, 0x8] + movs r1, 0x4 + strh r1, [r4, 0xA] + strh r0, [r4, 0xC] + strh r0, [r4, 0xE] + strh r0, [r4, 0x10] + strh r0, [r4, 0x12] + strh r0, [r4, 0x14] + strh r0, [r4, 0x16] + strh r0, [r4, 0x18] + strh r0, [r4, 0x22] + ldr r5, =0x02038436 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x24] + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + ldr r0, =sub_8105B08 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8105AAC + + thumb_func_start sub_8105B08 +sub_8105B08: @ 8105B08 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r0, 0x18 + ldrsh r2, [r4, r0] + cmp r2, 0x1 + beq _08105B74 + cmp r2, 0x1 + bgt _08105B30 + cmp r2, 0 + beq _08105B36 + b _08105B90 + .pool +_08105B30: + cmp r2, 0x2 + beq _08105B8C + b _08105B90 +_08105B36: + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08105B90 + strh r2, [r4, 0x10] + ldrh r0, [r4, 0x12] + adds r0, 0x1 + movs r1, 0x1 + ands r0, r1 + strh r0, [r4, 0x12] + ldrh r0, [r4, 0x14] + adds r0, 0x1 + strh r0, [r4, 0x14] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _08105B90 + movs r1, 0x16 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08105B6E + strh r2, [r4, 0x14] + movs r0, 0x1 + strh r0, [r4, 0x18] + b _08105B90 +_08105B6E: + movs r0, 0x2 + strh r0, [r4, 0x18] + b _08105B90 +_08105B74: + movs r1, 0 + strh r1, [r4, 0x12] + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _08105B90 + strh r2, [r4, 0x16] + strh r1, [r4, 0x18] + b _08105B90 +_08105B8C: + movs r0, 0x1 + strh r0, [r4, 0x12] +_08105B90: + movs r2, 0x8 + ldrsh r5, [r4, r2] + cmp r5, 0 + beq _08105B9E + cmp r5, 0x1 + beq _08105C34 + b _08105C42 +_08105B9E: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _08105C42 + strh r5, [r4, 0xA] + ldr r0, =gUnknown_085938DC + movs r3, 0x24 + ldrsh r1, [r4, r3] + movs r3, 0x26 + ldrsh r2, [r4, r3] + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _08105C42 + ldr r0, =0x02020630 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + strh r6, [r1, 0x2E] + movs r0, 0xD + strh r0, [r1, 0x30] + ldr r2, =gUnknown_085938F4 + movs r3, 0xC + ldrsh r0, [r4, r3] + lsls r0, 1 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + strh r0, [r1, 0x24] + movs r3, 0xC + ldrsh r0, [r4, r3] + lsls r0, 1 + adds r2, 0x1 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + strh r0, [r1, 0x26] + ldrh r0, [r4, 0x22] + adds r0, 0x1 + strh r0, [r4, 0x22] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _08105C42 + strh r5, [r4, 0xC] + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _08105C42 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08105C42 + .pool +_08105C34: + movs r1, 0x22 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08105C42 + adds r0, r6, 0 + bl move_anim_task_del +_08105C42: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8105B08 + + thumb_func_start sub_8105C48 +sub_8105C48: @ 8105C48 + push {r4,lr} + adds r3, r0, 0 + ldr r4, =0x03005e00 + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r1, 0x3E + adds r1, r3 + mov r12, r1 + movs r2, 0x1 + ldrb r1, [r0, 0x12] + ands r1, r2 + lsls r1, 2 + mov r0, r12 + ldrb r2, [r0] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + adds r0, r3, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08105CAA + movs r0, 0x30 + ldrsh r1, [r3, r0] + lsls r1, 1 + movs r0, 0x2E + ldrsh r2, [r3, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r0, r4, 0 + adds r0, 0x8 + adds r1, r0 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r3, 0 + bl RemoveObjectAndFreeTiles +_08105CAA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8105C48 + + thumb_func_start sub_8105CB4 +sub_8105CB4: @ 8105CB4 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x000027de + bl IndexOfObjectPaletteTag + mov r1, sp + strb r0, [r1] + movs r4, 0x1 + ldr r0, =0x00002710 + adds r5, r0, 0 +_08105CCC: + subs r0, r5, r4 + lsls r0, 16 + lsrs r0, 16 + bl AllocObjectPalette + mov r2, sp + adds r1, r2, r4 + strb r0, [r1] + adds r4, 0x1 + cmp r4, 0x2 + ble _08105CCC + movs r0, 0x80 + lsls r0, 6 + bl AllocZeroed + adds r1, r0, 0 + ldr r0, =0x020244d4 + ldr r0, [r0] + movs r2, 0xBE + lsls r2, 1 + adds r0, r2 + str r1, [r0] + ldr r0, =gUnknown_08C22610 + bl LZDecompressWram + movs r4, 0 +_08105D00: + ldr r5, =0x020244d4 + ldr r0, [r5] + movs r1, 0xBE + lsls r1, 1 + adds r0, r1 + lsls r1, r4, 6 + ldr r0, [r0] + adds r0, r1 + mov r2, sp + adds r1, r2, r4 + ldrb r1, [r1] + lsls r1, 20 + movs r2, 0x80 + lsls r2, 17 + adds r1, r2 + lsrs r1, 16 + movs r2, 0x20 + bl gpu_pal_apply + adds r4, 0x1 + cmp r4, 0x2 + ble _08105D00 + ldr r0, [r5] + movs r4, 0xBE + lsls r4, 1 + adds r0, r4 + ldr r0, [r0] + bl Free + ldr r0, [r5] + adds r0, r4 + movs r1, 0 + str r1, [r0] + adds r0, r6, 0 + bl move_anim_task_del + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8105CB4 + + thumb_func_start sub_8105D60 +sub_8105D60: @ 8105D60 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, =gUnknown_08593950 + movs r4, 0x2 +_08105D6A: + ldrh r0, [r5] + bl FreeObjectPaletteByTag + adds r5, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _08105D6A + adds r0, r6, 0 + bl move_anim_task_del + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8105D60 + + thumb_func_start sub_8105D88 +sub_8105D88: @ 8105D88 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 24 + lsls r2, 24 + lsrs r3, r2, 24 + movs r0, 0x1 + ands r3, r0 + negs r0, r3 + orrs r0, r3 + asrs r0, 31 + movs r3, 0x20 + ands r0, r3 + ldrh r4, [r5, 0x4] + lsls r3, r4, 22 + lsrs r3, 22 + lsrs r1, 22 + adds r0, r1 + adds r3, r0 + ldr r1, =0x000003ff + adds r0, r1, 0 + ands r3, r0 + ldr r0, =0xfffffc00 + ands r0, r4 + orrs r0, r3 + strh r0, [r5, 0x4] + ldr r0, =gUnknown_08593950 + lsrs r2, 25 + lsls r2, 1 + adds r2, r0 + ldrh r0, [r2] + bl IndexOfObjectPaletteTag + lsls r0, 4 + ldrb r2, [r5, 0x5] + movs r1, 0xF + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0x5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8105D88 + + thumb_func_start sub_8105DE8 +sub_8105DE8: @ 8105DE8 + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0 + bl sub_80A69CC + ldr r6, =0x02038436 + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08105E08 + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_08105E08: + ldr r4, =0x0203841e + ldrh r0, [r4, 0x8] + strh r0, [r5, 0x2E] + ldrb r0, [r6] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x4] + adds r0, r1 + strh r0, [r5, 0x32] + ldrb r0, [r6] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x6] + adds r0, r1 + strh r0, [r5, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r5, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldrb r1, [r4, 0xA] + ldrb r2, [r4, 0xC] + adds r0, r5, 0 + bl sub_8105D88 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8105DE8 + + thumb_func_start sub_8105E60 +sub_8105E60: @ 8105E60 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _08105E7A + adds r0, r4, 0 + movs r1, 0 + bl sub_80A69CC +_08105E7A: + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl sine + strh r0, [r4, 0x24] + ldrh r2, [r4, 0x32] + lsls r0, r2, 16 + asrs r0, 24 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x7 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + subs r2, 0x80 + strh r2, [r4, 0x32] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x3C + bne _08105EAA + adds r0, r4, 0 + bl move_anim_8072740 +_08105EAA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8105E60 + + thumb_func_start sub_8105EB0 +sub_8105EB0: @ 8105EB0 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + movs r6, 0xF0 + cmp r0, 0 + beq _08105EC4 + movs r6, 0x98 +_08105EC4: + movs r5, 0 + ldr r1, =0x02022e24 + strh r6, [r1] + ldr r4, =0x02022e26 + movs r0, 0xA0 + strh r0, [r4] + ldrh r1, [r1] + movs r0, 0x40 + bl SetGpuReg + ldrh r1, [r4] + movs r0, 0x44 + bl SetGpuReg + ldr r1, =0x00003f1f + movs r0, 0x48 + bl SetGpuReg + ldr r1, =0x00003f3f + movs r0, 0x4A + bl SetGpuReg + movs r0, 0x50 + movs r1, 0xC8 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0x10 + bl SetGpuReg + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x8] + strh r6, [r0, 0xA] + ldr r1, =sub_8105F30 + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8105EB0 + + thumb_func_start sub_8105F30 +sub_8105F30: @ 8105F30 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r3, r1, r2 + ldrh r0, [r3, 0x8] + adds r4, r0, 0 + adds r4, 0xD + strh r4, [r3, 0x8] + ldrh r0, [r3, 0xA] + adds r2, r0, 0 + subs r2, 0xD + strh r2, [r3, 0xA] + lsls r1, r4, 16 + lsls r0, r2, 16 + cmp r1, r0 + blt _08105F70 + ldr r0, =0x02022e24 + movs r1, 0 + strh r1, [r0] + ldr r0, =sub_8105F84 + str r0, [r3] + b _08105F78 + .pool +_08105F70: + ldr r1, =0x02022e24 + lsls r0, r4, 8 + orrs r2, r0 + strh r2, [r1] +_08105F78: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8105F30 + + thumb_func_start sub_8105F84 +sub_8105F84: @ 8105F84 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r1, r0, r1 + ldrh r0, [r1, 0x1C] + adds r0, 0x1 + movs r4, 0 + strh r0, [r1, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _08105FD8 + movs r0, 0x88 + strh r0, [r1, 0x1E] + movs r0, 0x50 + movs r1, 0x88 + bl SetGpuReg + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80A75AC + ldr r2, =0x00007fff + movs r1, 0x10 + bl sub_80A2A20 + b _0810600C + .pool +_08105FD8: + cmp r0, 0x4 + ble _0810600C + ldr r0, =0x02022e24 + strh r4, [r0] + ldr r0, =0x02022e26 + strh r4, [r0] + ldr r4, =0x00003f3f + movs r0, 0x48 + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x4A + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + adds r0, r5, 0 + bl move_anim_task_del +_0810600C: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8105F84 + + thumb_func_start sub_8106020 +sub_8106020: @ 8106020 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _0810607C + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_08593988 + adds r0, r5, 0 + bl sub_80A7CFC + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + movs r1, 0x4 + strh r1, [r0, 0x24] + b _081060A4 + .pool +_0810607C: + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r4, r0, r1 + ldrh r0, [r4, 0x24] + negs r0, r0 + strh r0, [r4, 0x24] + adds r0, r5, 0 + bl sub_80A7D34 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _081060A4 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + adds r0, r6, 0 + bl move_anim_task_del +_081060A4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8106020 + + thumb_func_start sub_81060B0 +sub_81060B0: @ 81060B0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _0810610C + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_08593988 + adds r0, r5, 0 + bl sub_80A7CFC + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + movs r1, 0x4 + strh r1, [r0, 0x24] + b _08106134 + .pool +_0810610C: + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r4, r0, r1 + ldrh r0, [r4, 0x24] + negs r0, r0 + strh r0, [r4, 0x24] + adds r0, r5, 0 + bl sub_80A7D34 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08106134 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + adds r0, r6, 0 + bl move_anim_task_del +_08106134: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81060B0 + + thumb_func_start sub_8106140 +sub_8106140: @ 8106140 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + movs r0, 0x5F + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r0, =sub_810618C + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8106140 + + thumb_func_start sub_810618C +sub_810618C: @ 810618C + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + bne _081061B6 + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0xE + bl sine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x38] + adds r0, 0x4 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + b _081061BC +_081061B6: + adds r0, r4, 0 + bl move_anim_8072740 +_081061BC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810618C + + thumb_func_start sub_81061C4 +sub_81061C4: @ 81061C4 + push {r4,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x2E] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081061E8 + ldr r1, =0x0203841e + ldrh r0, [r1] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x32] + adds r0, r2, 0x1 + strh r0, [r4, 0x2E] + b _08106244 + .pool +_081061E8: + ldrh r0, [r4, 0x30] + ldrh r2, [r4, 0x36] + adds r0, r2 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + movs r1, 0x34 + ldrsh r0, [r4, r1] + movs r2, 0x32 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x34] + adds r0, 0x3 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x34] + cmp r0, 0x64 + ble _08106236 + movs r0, 0x34 + ldrsh r1, [r4, r0] + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r0, 1 + lsls r0, 1 + subs r1, r0 + adds r3, r4, 0 + adds r3, 0x3E + movs r0, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_08106236: + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0x78 + ble _08106244 + adds r0, r4, 0 + bl move_anim_8072740 +_08106244: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81061C4 + + thumb_func_start sub_810624C +sub_810624C: @ 810624C + push {lr} + ldr r2, =0x0203841e + ldrh r1, [r2] + strh r1, [r0, 0x20] + movs r1, 0xA0 + strh r1, [r0, 0x22] + ldrh r1, [r2, 0x4] + strh r1, [r0, 0x2E] + ldrh r1, [r2, 0x2] + strh r1, [r0, 0x30] + ldr r1, =sub_80A64B0 + str r1, [r0, 0x1C] + ldr r1, =sub_810627C + bl oamt_set_x3A_32 + pop {r0} + bx r0 + .pool + thumb_func_end sub_810624C + + thumb_func_start sub_810627C +sub_810627C: @ 810627C + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] + lsls r0, 16 + lsrs r0, 24 + negs r0, r0 + strh r0, [r4, 0x26] + movs r1, 0x34 + ldrsh r0, [r4, r1] + movs r1, 0x4 + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x34] + adds r0, 0x3 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x26] + ldrh r1, [r4, 0x22] + adds r0, r1 + lsls r0, 16 + asrs r5, r0, 16 + cmp r5, 0x48 + bgt _081062E2 + movs r0, 0x34 + ldrsh r1, [r4, r0] + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r0, 1 + lsls r0, 1 + subs r1, r0 + adds r3, r4, 0 + adds r3, 0x3E + movs r0, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + cmp r5, 0x40 + bgt _081062E2 + adds r0, r4, 0 + bl move_anim_8072740 +_081062E2: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_810627C + + thumb_func_start sub_81062E8 +sub_81062E8: @ 81062E8 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x3 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810632A + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations +_0810632A: + ldr r0, =0x02022e18 + movs r1, 0 + strh r1, [r0] + ldr r4, =0x02022e1a + strh r1, [r4] + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + ldrh r1, [r4] + movs r0, 0x16 + bl SetGpuReg + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, =gUnknown_08C232E0 + mov r2, sp + ldrh r2, [r2, 0xA] + bl sub_80A6CC0 + ldr r1, =gUnknown_08C23D78 + mov r0, sp + movs r2, 0 + bl sub_80A6D60 + ldr r0, =gUnknown_08C23D50 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl decompress_palette + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81063A8 + str r1, [r0] + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81062E8 + + thumb_func_start sub_81063A8 +sub_81063A8: @ 81063A8 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x20 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x4 + bls _081063C6 + b _081064F0 +_081063C6: + lsls r0, 2 + ldr r1, =_081063D8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081063D8: + .4byte _081063EC + .4byte _08106430 + .4byte _08106452 + .4byte _08106496 + .4byte _081064BC +_081063EC: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + movs r5, 0 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _081064F0 + strh r5, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + adds r1, 0x1 + strh r1, [r4, 0x1E] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _081064F0 + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + strh r5, [r4, 0x1E] + b _081064F0 +_08106430: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r2 + ldrh r0, [r1, 0x1E] + adds r0, 0x1 + strh r0, [r1, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8D + bne _081064F0 + movs r0, 0x10 + strh r0, [r1, 0x1E] + ldrh r0, [r1, 0x20] + adds r0, 0x1 + strh r0, [r1, 0x20] + b _081064F0 +_08106452: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _081064F0 + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + subs r1, 0x1 + strh r1, [r4, 0x1E] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r2, 0x1E + ldrsh r1, [r4, r2] + cmp r1, 0 + bne _081064F0 + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + strh r1, [r4, 0x1E] + b _081064F0 +_08106496: + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + bl sub_80A6C68 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x20] + adds r1, 0x1 + strh r1, [r0, 0x20] + b _081064F0 + .pool +_081064BC: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _081064D0 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_081064D0: + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + adds r0, r4, 0 + bl move_anim_task_del +_081064F0: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81063A8 + + thumb_func_start sub_81064F8 +sub_81064F8: @ 81064F8 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810653A + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations +_0810653A: + ldr r0, =0x02022e18 + movs r1, 0 + strh r1, [r0] + ldr r4, =0x02022e1a + strh r1, [r4] + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + ldrh r1, [r4] + movs r0, 0x16 + bl SetGpuReg + mov r0, sp + bl sub_80A6B30 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08106578 + ldr r1, =gUnknown_08D93960 + b _0810658A + .pool +_08106578: + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0810659C + ldr r1, =gUnknown_08D93598 +_0810658A: + mov r0, sp + movs r2, 0 + bl sub_80A6D60 + b _081065A6 + .pool +_0810659C: + ldr r1, =gUnknown_08D9377C + mov r0, sp + movs r2, 0 + bl sub_80A6D60 +_081065A6: + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, =gUnknown_08C249F8 + mov r2, sp + ldrh r2, [r2, 0xA] + bl sub_80A6CC0 + ldr r0, =gUnknown_08C249D0 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl decompress_palette + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81065EC + str r1, [r0] + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81064F8 + + thumb_func_start sub_81065EC +sub_81065EC: @ 81065EC + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x20 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x4 + bls _0810660A + b _08106730 +_0810660A: + lsls r0, 2 + ldr r1, =_0810661C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0810661C: + .4byte _08106630 + .4byte _08106674 + .4byte _08106696 + .4byte _081066DA + .4byte _081066FC +_08106630: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + movs r5, 0 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _08106730 + strh r5, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + adds r1, 0x1 + strh r1, [r4, 0x1E] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0xE + bne _08106730 + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + strh r5, [r4, 0x1E] + b _08106730 +_08106674: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r2 + ldrh r0, [r1, 0x1E] + adds r0, 0x1 + strh r0, [r1, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x15 + bne _08106730 + movs r0, 0xE + strh r0, [r1, 0x1E] + ldrh r0, [r1, 0x20] + adds r0, 0x1 + strh r0, [r1, 0x20] + b _08106730 +_08106696: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _08106730 + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + subs r1, 0x1 + strh r1, [r4, 0x1E] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r2, 0x1E + ldrsh r1, [r4, r2] + cmp r1, 0 + bne _08106730 + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + strh r1, [r4, 0x1E] + b _08106730 +_081066DA: + mov r0, sp + bl sub_80A6B30 + movs r0, 0x1 + bl sub_80A6C68 + movs r0, 0x2 + bl sub_80A6C68 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x20] + adds r0, 0x1 + strh r0, [r1, 0x20] +_081066FC: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08106710 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_08106710: + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + adds r0, r4, 0 + bl move_anim_task_del +_08106730: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81065EC + + thumb_func_start sub_810673C +sub_810673C: @ 810673C + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x02038436 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x0203841e + ldrh r0, [r1] + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x30] + ldrb r0, [r5] + bl sub_80A82E4 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x3C] + ldr r1, =sub_810679C + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810673C + + thumb_func_start sub_810679C +sub_810679C: @ 810679C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + subs r0, 0x40 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7F + bhi _081067B2 + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + b _081067B6 +_081067B2: + ldrh r0, [r4, 0x3C] + subs r0, 0x1 +_081067B6: + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + movs r1, 0x30 + ldrsh r0, [r4, r1] + ldrh r1, [r4, 0x32] + lsls r1, 16 + asrs r1, 24 + bl sine + strh r0, [r4, 0x24] + movs r2, 0x30 + ldrsh r0, [r4, r2] + ldrh r1, [r4, 0x34] + lsls r1, 16 + asrs r1, 24 + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x9 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + movs r3, 0x38 + ldrsh r2, [r4, r3] + cmp r2, 0 + beq _08106828 + cmp r2, 0x1 + bne _08106858 + ldr r1, =0xfffffc00 + adds r0, r1, 0 + ldrh r2, [r4, 0x32] + adds r0, r2 + strh r0, [r4, 0x32] + ldr r3, =0xffffff00 + adds r0, r3, 0 + ldrh r1, [r4, 0x34] + adds r0, r1 + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x2E + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _08106858 + movs r0, 0x2 + strh r0, [r4, 0x38] + b _08106868 + .pool +_08106828: + movs r3, 0x80 + lsls r3, 3 + adds r0, r3, 0 + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + ldrh r1, [r4, 0x34] + adds r0, r1 + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x2E + ldrsh r1, [r4, r3] + cmp r0, r1 + bne _08106858 + strh r2, [r4, 0x36] + movs r0, 0x1 + strh r0, [r4, 0x38] +_08106858: + ldr r0, =0x0203841e + ldrh r1, [r0, 0xE] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _08106868 + adds r0, r4, 0 + bl move_anim_8072740 +_08106868: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810679C + + thumb_func_start sub_8106878 +sub_8106878: @ 8106878 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldr r4, =0x0203841e + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0xA + bl sine + strh r0, [r5, 0x2E] + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0x7 + bl cosine + strh r0, [r5, 0x30] + ldr r0, =sub_81068CC + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8106878 + + thumb_func_start sub_81068CC +sub_81068CC: @ 81068CC + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x24] + adds r0, r1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x30] + ldrh r3, [r2, 0x26] + adds r0, r3 + strh r0, [r2, 0x26] + movs r1, 0x20 + ldrsh r0, [r2, r1] + movs r3, 0x24 + ldrsh r1, [r2, r3] + adds r0, r1 + adds r0, 0x10 + movs r1, 0x88 + lsls r1, 1 + cmp r0, r1 + bhi _0810690A + movs r0, 0x22 + ldrsh r1, [r2, r0] + movs r3, 0x26 + ldrsh r0, [r2, r3] + adds r1, r0 + cmp r1, 0xA0 + bgt _0810690A + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + bge _08106910 +_0810690A: + adds r0, r2, 0 + bl move_anim_8072740 +_08106910: + pop {r0} + bx r0 + thumb_func_end sub_81068CC + + thumb_func_start sub_8106914 +sub_8106914: @ 8106914 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x24] + adds r0, r1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x30] + ldrh r3, [r2, 0x26] + adds r0, r3 + strh r0, [r2, 0x26] + ldrh r0, [r2, 0x34] + adds r1, r0, 0x1 + strh r1, [r2, 0x34] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x32 + ldrsh r1, [r2, r3] + cmp r0, r1 + blt _08106940 + adds r0, r2, 0 + bl move_anim_8072740 +_08106940: + pop {r0} + bx r0 + thumb_func_end sub_8106914 + + thumb_func_start sub_8106944 +sub_8106944: @ 8106944 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldr r4, =0x0203841e + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0xA + bl sine + strh r0, [r5, 0x2E] + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0x7 + bl cosine + strh r0, [r5, 0x30] + ldrh r0, [r4, 0x2] + strh r0, [r5, 0x32] + ldr r0, =sub_8106914 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8106944 + + thumb_func_start sub_810699C +sub_810699C: @ 810699C + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081069B2 + adds r0, r2, 0 + bl move_anim_8072740 +_081069B2: + pop {r0} + bx r0 + thumb_func_end sub_810699C + + thumb_func_start sub_81069B8 +sub_81069B8: @ 81069B8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, =sub_810699C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81069B8 + + thumb_func_start sub_81069D0 +sub_81069D0: @ 81069D0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081069EE + ldr r0, =0x0203841e + ldrh r1, [r0] + ldrh r2, [r4, 0x20] + adds r1, r2 + strh r1, [r4, 0x20] + ldrh r0, [r0, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] +_081069EE: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r2, 0x2E + ldrsh r1, [r4, r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r5, r0, 1 + movs r0, 0xFF + ands r5, r0 + adds r0, r5, 0 + movs r1, 0x50 + bl sine + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x4F + bgt _08106A32 + adds r0, r5, 0 + movs r1, 0x50 + bl cosine + movs r2, 0x2E + ldrsh r1, [r4, r2] + lsrs r2, r1, 31 + adds r1, r2 + asrs r1, 1 + lsls r0, 16 + asrs r0, 24 + adds r1, r0 + strh r1, [r4, 0x26] +_08106A32: + movs r0, 0x2E + ldrsh r2, [r4, r0] + cmp r2, 0x5A + ble _08106A50 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + movs r0, 0x32 + ldrsh r1, [r4, r0] + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + ldrh r0, [r4, 0x24] + subs r0, r1 + strh r0, [r4, 0x24] +_08106A50: + cmp r2, 0x64 + ble _08106A5A + adds r0, r4, 0 + bl move_anim_8072740 +_08106A5A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81069D0 + + thumb_func_start sub_8106A64 +sub_8106A64: @ 8106A64 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + movs r1, 0x34 + ldrsh r0, [r4, r1] + movs r1, 0x5 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x38 + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x34] + adds r0, 0x3 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x34] + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x14 + ble _08106ABA + adds r1, r0, 0 + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r0, 1 + lsls r0, 1 + subs r1, r0 + adds r3, r4, 0 + adds r3, 0x3E + movs r0, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_08106ABA: + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x1E + ble _08106AC8 + adds r0, r4, 0 + bl move_anim_8072740 +_08106AC8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8106A64 + + thumb_func_start sub_8106AD0 +sub_8106AD0: @ 8106AD0 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x2E] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08106AF4 + ldr r1, =0x0203841e + ldrh r0, [r1] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x32] + adds r0, r2, 0x1 + strh r0, [r4, 0x2E] + b _08106B48 + .pool +_08106AF4: + ldrh r0, [r4, 0x30] + ldrh r2, [r4, 0x36] + adds r0, r2 + movs r5, 0 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + movs r1, 0x34 + ldrsh r0, [r4, r1] + movs r2, 0x32 + ldrsh r1, [r4, r2] + bl sine + adds r2, r0, 0 + strh r2, [r4, 0x26] + ldrh r0, [r4, 0x34] + adds r0, 0x3 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x34] + cmp r0, 0x46 + ble _08106B48 + ldr r0, =sub_8106A64 + str r0, [r4, 0x1C] + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r1, [r4, 0x22] + adds r0, r2, r1 + strh r0, [r4, 0x22] + strh r5, [r4, 0x24] + strh r5, [r4, 0x26] + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xB4 + bl __umodsi3 + strh r0, [r4, 0x34] +_08106B48: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8106AD0 + + thumb_func_start sub_8106B54 +sub_8106B54: @ 8106B54 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08106B8E + ldr r1, =0x0203841e + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnim + ldr r0, =0x02038437 + ldrb r0, [r0] + bl sub_80A82E4 + subs r0, 0x1 + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + movs r0, 0x1 + strh r0, [r4, 0x32] +_08106B8E: + ldrh r0, [r4, 0x32] + ldrh r2, [r4, 0x2E] + adds r0, r2 + strh r0, [r4, 0x2E] + movs r1, 0x2E + ldrsh r0, [r4, r1] + lsls r1, r0, 2 + adds r0, r1, 0 + cmp r1, 0 + bge _08106BA4 + adds r0, 0xFF +_08106BA4: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + strh r0, [r4, 0x30] + lsls r0, 16 + cmp r0, 0 + bge _08106BB6 + movs r0, 0 + strh r0, [r4, 0x30] +_08106BB6: + movs r0, 0x30 + ldrsh r2, [r4, r0] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _08106BC4 + adds r0, 0x3 +_08106BC4: + asrs r0, 2 + movs r1, 0x1E + subs r1, r0 + adds r0, r2, 0 + bl cosine + strh r0, [r4, 0x24] + movs r0, 0x30 + ldrsh r2, [r4, r0] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _08106BE0 + adds r0, 0x7 +_08106BE0: + asrs r0, 3 + movs r1, 0xA + subs r1, r0 + adds r0, r2, 0 + bl sine + strh r0, [r4, 0x26] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0x80 + ble _08106C04 + ldrh r1, [r4, 0x32] + movs r2, 0x32 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _08106C04 + ldr r0, =0x0000ffff + strh r0, [r4, 0x32] +_08106C04: + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08106C18 + movs r2, 0x32 + ldrsh r0, [r4, r2] + cmp r0, 0 + bge _08106C18 + movs r0, 0x1 + strh r0, [r4, 0x32] +_08106C18: + ldrh r0, [r4, 0x34] + adds r1, r0, 0x1 + strh r1, [r4, 0x34] + subs r0, 0x9 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x46 + bls _08106C5C + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r0, 1 + lsls r0, 1 + subs r1, r0 + adds r3, r4, 0 + adds r3, 0x3E + movs r0, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + b _08106C6A + .pool +_08106C5C: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08106C6A: + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0x5A + ble _08106C78 + adds r0, r4, 0 + bl move_anim_8072740 +_08106C78: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8106B54 + + thumb_func_start sub_8106C80 +sub_8106C80: @ 8106C80 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08106CB4 + ldr r1, =0x0203841e + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + ldrb r1, [r1, 0x4] + adds r0, r4, 0 + bl StartObjectImageAnim + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _08106CC8 + .pool +_08106CB4: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08106CC8 + adds r0, r4, 0 + bl move_anim_8072740 +_08106CC8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8106C80 + + thumb_func_start sub_8106CD0 +sub_8106CD0: @ 8106CD0 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r1, =0x0203841e + movs r2, 0x4 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08106CEC + adds r0, r5, 0 + bl move_anim_8072740 + b _08106D50 + .pool +_08106CEC: + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08106CFC + ldr r4, =0x02038436 + b _08106CFE + .pool +_08106CFC: + ldr r4, =0x02038437 +_08106CFE: + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldr r0, =0x0203841e + movs r2, 0x2 + ldrsh r1, [r0, r2] + adds r2, r0, 0 + cmp r1, 0 + bne _08106D34 + ldrh r0, [r5, 0x20] + adds r0, 0x20 + b _08106D38 + .pool +_08106D34: + ldrh r0, [r5, 0x20] + subs r0, 0x20 +_08106D38: + strh r0, [r5, 0x20] + ldrh r0, [r2, 0x4] + strh r0, [r5, 0x2E] + ldrh r1, [r2, 0x2] + strh r1, [r5, 0x30] + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl StartObjectImageAnim + ldr r0, =sub_8106D5C + str r0, [r5, 0x1C] +_08106D50: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8106CD0 + + thumb_func_start sub_8106D5C +sub_8106D5C: @ 8106D5C + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08106D8C + ldrh r0, [r2, 0x2E] + subs r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + cmp r0, 0 + beq _08106D86 + ldrh r1, [r2, 0x30] + lsls r1, 24 + lsrs r1, 24 + adds r0, r2, 0 + bl StartObjectImageAnim + b _08106D8C +_08106D86: + adds r0, r2, 0 + bl move_anim_8072740 +_08106D8C: + pop {r0} + bx r0 + thumb_func_end sub_8106D5C + + thumb_func_start sub_8106D90 +sub_8106D90: @ 8106D90 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =0x0203841e + ldrb r0, [r0] + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + ldr r2, =gUnknown_08593B98 + adds r0, r4, 0 + bl sub_80A7CFC + ldr r0, =sub_8106DD4 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8106D90 + + thumb_func_start sub_8106DD4 +sub_8106DD4: @ 8106DD4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r0, r1 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _08106DF4 + adds r0, r4, 0 + bl move_anim_task_del +_08106DF4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8106DD4 + + thumb_func_start sub_8106E00 +sub_8106E00: @ 8106E00 + push {r4-r7,lr} + adds r5, r0, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08106E1C + ldr r0, =0x02038436 + b _08106E1E + .pool +_08106E1C: + ldr r0, =0x02038437 +_08106E1E: + ldrb r6, [r0] + adds r0, r6, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08106E38 + ldr r1, =0x0203841e + movs r2, 0x2 + ldrsh r0, [r1, r2] + negs r0, r0 + strh r0, [r1, 0x2] +_08106E38: + adds r0, r6, 0 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + ldr r7, =0x0203841e + lsrs r0, 24 + ldrh r3, [r7, 0x2] + adds r0, r3 + movs r4, 0 + strh r0, [r5, 0x20] + adds r0, r6, 0 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r7, 0x4] + adds r0, r1 + strh r0, [r5, 0x22] + strh r4, [r5, 0x2E] + ldrh r1, [r5, 0x20] + lsls r1, 3 + strh r1, [r5, 0x30] + lsls r0, 3 + strh r0, [r5, 0x32] + movs r2, 0x2 + ldrsh r0, [r7, r2] + lsls r0, 3 + cmp r0, 0 + bge _08106E78 + adds r0, 0x7 +_08106E78: + asrs r0, 3 + strh r0, [r5, 0x34] + movs r3, 0x4 + ldrsh r0, [r7, r3] + lsls r0, 3 + cmp r0, 0 + bge _08106E88 + adds r0, 0x7 +_08106E88: + asrs r0, 3 + strh r0, [r5, 0x36] + ldrh r2, [r5, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + movs r3, 0x6 + ldrsh r0, [r7, r3] + lsls r0, 4 + adds r1, r0 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + ldr r0, =sub_8106EC8 + str r0, [r5, 0x1C] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8106E00 + + thumb_func_start sub_8106EC8 +sub_8106EC8: @ 8106EC8 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x34] + ldrh r1, [r2, 0x30] + adds r0, r1 + strh r0, [r2, 0x30] + ldrh r1, [r2, 0x36] + ldrh r3, [r2, 0x32] + adds r1, r3 + strh r1, [r2, 0x32] + lsls r0, 16 + asrs r0, 19 + strh r0, [r2, 0x20] + lsls r1, 16 + asrs r1, 19 + strh r1, [r2, 0x22] + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _08106EFC + adds r0, r2, 0 + bl move_anim_8072740 +_08106EFC: + pop {r0} + bx r0 + thumb_func_end sub_8106EC8 + + thumb_func_start sub_8106F00 +sub_8106F00: @ 8106F00 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08106F22 + ldr r0, =0x0203841e + ldrh r1, [r0] + movs r0, 0x78 + subs r0, r1 + strh r0, [r4, 0x30] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_08106F22: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x30 + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _08106F40 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + adds r0, 0x10 + movs r1, 0 + bl sub_80A750C +_08106F40: + movs r0, 0x2E + ldrsh r1, [r4, r0] + movs r2, 0x30 + ldrsh r0, [r4, r2] + adds r0, 0x50 + cmp r1, r0 + bne _08106F54 + adds r0, r4, 0 + bl move_anim_8072740 +_08106F54: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8106F00 + + thumb_func_start sub_8106F60 +sub_8106F60: @ 8106F60 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x2E + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _08106F8E + movs r5, 0x78 + strh r5, [r6, 0x20] + ldr r4, =0x0203841e + movs r2, 0 + ldrsh r0, [r4, r2] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + subs r0, 0xF + strh r0, [r6, 0x22] + ldrb r1, [r4, 0x2] + adds r0, r6, 0 + bl StartObjectImageAnim + strh r5, [r6, 0x38] + ldrh r0, [r4, 0x4] + strh r0, [r6, 0x34] +_08106F8E: + ldrh r0, [r6, 0x2E] + adds r0, 0x1 + movs r5, 0 + strh r0, [r6, 0x2E] + movs r1, 0x2E + ldrsh r0, [r6, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r6, 0x30] + movs r2, 0x2E + ldrsh r0, [r6, r2] + lsls r4, r0, 1 + adds r4, r0 + ldrh r0, [r6, 0x34] + adds r4, r0 + movs r2, 0xFF + ldrh r0, [r6, 0x3A] + adds r0, 0xA + movs r1, 0xFF + ands r0, r1 + strh r0, [r6, 0x3A] + ands r4, r2 + adds r0, r4, 0 + movs r1, 0x64 + bl cosine + strh r0, [r6, 0x24] + adds r0, r4, 0 + movs r1, 0xA + bl sine + adds r4, r0, 0 + movs r1, 0x3A + ldrsh r0, [r6, r1] + movs r1, 0x4 + bl cosine + ldrh r2, [r6, 0x30] + adds r4, r2 + adds r0, r4 + strh r0, [r6, 0x26] + movs r0, 0x2E + ldrsh r1, [r6, r0] + movs r2, 0x38 + ldrsh r0, [r6, r2] + cmp r1, r0 + ble _0810700A + ldr r0, =sub_8107018 + str r0, [r6, 0x1C] + strh r5, [r6, 0x2E] + adds r0, r6, 0 + bl oamt_add_pos2_onto_pos1 + movs r0, 0x5 + strh r0, [r6, 0x32] + strh r5, [r6, 0x36] + strh r5, [r6, 0x34] + adds r0, r6, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim +_0810700A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8106F60 + + thumb_func_start sub_8107018 +sub_8107018: @ 8107018 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + ble _08107032 + movs r0, 0 + strh r0, [r1, 0x2E] + ldr r0, =sub_810703C + str r0, [r1, 0x1C] +_08107032: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8107018 + + thumb_func_start sub_810703C +sub_810703C: @ 810703C + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x32] + ldrh r2, [r4, 0x34] + adds r0, r1, r2 + strh r0, [r4, 0x34] + strh r0, [r4, 0x26] + adds r1, 0x1 + strh r1, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x30 + ble _08107066 + lsls r0, r1, 16 + cmp r0, 0 + ble _08107066 + ldrh r0, [r4, 0x36] + subs r1, r0, 0x5 + strh r1, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x36] +_08107066: + movs r1, 0x36 + ldrsh r0, [r4, r1] + cmp r0, 0x3 + ble _08107098 + movs r2, 0x32 + ldrsh r1, [r4, r2] + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r0, 1 + lsls r0, 1 + subs r1, r0 + adds r3, r4, 0 + adds r3, 0x3E + movs r0, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + adds r0, r4, 0 + bl move_anim_8072740 +_08107098: + movs r1, 0x36 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bne _081070A6 + adds r0, r4, 0 + bl move_anim_8072740 +_081070A6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810703C + + thumb_func_start sub_81070AC +sub_81070AC: @ 81070AC + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081070F8 + ldr r4, =0x02038436 + ldrb r1, [r4] + movs r0, 0x2 + eors r0, r1 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _081070F8 + ldrb r0, [r4] + adds r2, r5, 0 + adds r2, 0x20 + adds r3, r5, 0 + adds r3, 0x22 + movs r1, 0 + bl sub_80A8924 + ldrh r0, [r5, 0x22] + adds r0, 0x28 + strh r0, [r5, 0x22] + adds r0, r5, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + b _08107118 + .pool +_081070F8: + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x28 + strh r0, [r5, 0x22] +_08107118: + movs r0, 0xD + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x22] + subs r0, 0x48 + strh r0, [r5, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r5, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r5, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81070AC + + thumb_func_start sub_8107144 +sub_8107144: @ 8107144 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x0203841e + ldr r1, =0x02038400 + ldr r1, [r1] + ldrb r2, [r1, 0x10] + movs r1, 0x1 + ands r1, r2 + strh r1, [r3, 0xE] + bl move_anim_task_del + pop {r0} + bx r0 + .pool + thumb_func_end sub_8107144 + + thumb_func_start update_fury_cutter_counter_copy +update_fury_cutter_counter_copy: @ 8107168 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x0203841e + ldr r1, =0x02038400 + ldr r1, [r1] + ldrb r1, [r1, 0x10] + strh r1, [r2, 0xE] + bl move_anim_task_del + pop {r0} + bx r0 + .pool + thumb_func_end update_fury_cutter_counter_copy + + thumb_func_start sub_8107188 +sub_8107188: @ 8107188 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _081071B0 + ldr r1, =0x0203841e + ldrh r0, [r1] + strh r0, [r5, 0xA] + ldrh r0, [r1, 0x2] + strh r0, [r5, 0xC] + ldrh r0, [r1, 0x4] + strh r0, [r5, 0xE] +_081071B0: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r2, 0x8 + ldrsh r0, [r5, r2] + movs r2, 0xC + ldrsh r1, [r5, r2] + bl __modsi3 + cmp r0, 0x1 + bne _081071F8 + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF0 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x50 + bl __umodsi3 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_08595020 + adds r1, r4, 0 + movs r3, 0x4 + bl AddObjectToFront +_081071F8: + movs r0, 0x8 + ldrsh r1, [r5, r0] + movs r2, 0xE + ldrsh r0, [r5, r2] + cmp r1, r0 + bne _0810720A + adds r0, r6, 0 + bl move_anim_task_del +_0810720A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8107188 + + thumb_func_start sub_810721C +sub_810721C: @ 810721C + ldr r1, =sub_8107228 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_810721C + + thumb_func_start sub_8107228 +sub_8107228: @ 8107228 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD + bgt _08107246 + ldrh r0, [r2, 0x24] + adds r0, 0x1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x26] + adds r0, 0x4 + strh r0, [r2, 0x26] +_08107246: + adds r0, r2, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0810725A + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles +_0810725A: + pop {r0} + bx r0 + thumb_func_end sub_8107228 + + thumb_func_start sub_8107260 +sub_8107260: @ 8107260 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r5, =0x02038436 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08107290 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x0203841e + ldrh r1, [r4] + subs r0, r1 + b _081072A2 + .pool +_08107290: + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + ldr r4, =0x0203841e + lsrs r0, 24 + ldrh r1, [r4] + adds r0, r1 +_081072A2: + strh r0, [r6, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r4, [r4, 0x2] + adds r0, r4 + strh r0, [r6, 0x22] + adds r2, r6, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _081072D8 + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_081072D8: + ldr r5, =0x0203841e + ldrh r0, [r5, 0xC] + strh r0, [r6, 0x2E] + ldrh r0, [r6, 0x20] + strh r0, [r6, 0x30] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x32] + ldrh r0, [r6, 0x22] + strh r0, [r6, 0x34] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x36] + adds r0, r6, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r0, =DummyObjectCallback + bl object_new_hidden_with_callback + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + strh r4, [r6, 0x38] + ldrb r0, [r5, 0x8] + movs r2, 0x4 + ldrsh r1, [r5, r2] + bl sine + ldrh r1, [r6, 0x20] + subs r1, r0 + strh r1, [r6, 0x20] + ldrb r0, [r5, 0x8] + movs r2, 0x6 + ldrsh r1, [r5, r2] + bl cosine + ldrh r1, [r6, 0x22] + subs r1, r0 + strh r1, [r6, 0x22] + ldr r0, =0x02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r5, 0x4] + strh r0, [r1, 0x2E] + ldrh r0, [r5, 0x6] + strh r0, [r1, 0x30] + ldrh r0, [r5, 0xA] + strh r0, [r1, 0x32] + ldrb r0, [r5, 0x8] + lsls r0, 8 + strh r0, [r1, 0x34] + ldrh r0, [r5, 0xC] + strh r0, [r1, 0x36] + ldr r1, =sub_8107380 + str r1, [r6, 0x1C] + adds r0, r6, 0 + bl _call_via_r1 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8107260 + + thumb_func_start sub_8107380 +sub_8107380: @ 8107380 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r5, r0, 0 + ldrh r1, [r5, 0x38] + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r7, r0, r2 + ldrh r4, [r7, 0x36] + lsls r4, 24 + lsrs r4, 24 + ldrh r0, [r7, 0x34] + mov r8, r0 + movs r0, 0x1 + strh r0, [r5, 0x2E] + adds r0, r5, 0 + bl sub_80A6F3C + mov r1, r8 + lsrs r6, r1, 8 + movs r0, 0x2E + ldrsh r1, [r7, r0] + adds r0, r6, 0 + bl sine + ldrh r1, [r5, 0x24] + adds r0, r1 + strh r0, [r5, 0x24] + movs r0, 0x30 + ldrsh r1, [r7, r0] + adds r0, r6, 0 + bl cosine + ldrh r1, [r5, 0x26] + adds r0, r1 + strh r0, [r5, 0x26] + ldrh r0, [r7, 0x32] + mov r1, r8 + adds r1, r0 + strh r1, [r7, 0x34] + subs r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + cmp r4, 0 + beq _081073EC + strh r4, [r7, 0x36] + b _081073F6 + .pool +_081073EC: + ldr r0, =sub_8107408 + str r0, [r5, 0x1C] + adds r0, r7, 0 + bl RemoveObjectAndFreeTiles +_081073F6: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8107380 + + thumb_func_start sub_8107408 +sub_8107408: @ 8107408 + push {lr} + adds r3, r0, 0 + adds r3, 0x2C + ldrb r2, [r3] + movs r1, 0x41 + negs r1, r1 + ands r1, r2 + strb r1, [r3] + ldr r1, =sub_80A67D8 + str r1, [r0, 0x1C] + ldr r1, =sub_8107430 + bl oamt_set_x3A_32 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8107408 + + thumb_func_start sub_8107430 +sub_8107430: @ 8107430 + push {lr} + movs r1, 0xA + strh r1, [r0, 0x2E] + ldr r1, =sub_80A64B0 + str r1, [r0, 0x1C] + ldr r1, =move_anim_8074EE0 + bl oamt_set_x3A_32 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8107430 + + thumb_func_start sub_810744C +sub_810744C: @ 810744C + push {r4-r7,lr} + adds r5, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810747C + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + negs r0, r0 + lsls r0, 16 + lsrs r6, r0, 16 + adds r7, r1, 0 + b _08107482 + .pool +_0810747C: + ldr r0, =0x0203841e + ldrh r6, [r0, 0x4] + adds r7, r0, 0 +_08107482: + ldrh r0, [r7, 0x8] + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x30] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r6 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r7, [r7, 0x6] + adds r0, r7 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r0, =sub_81074E4 + str r0, [r5, 0x1C] + adds r2, r5, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r1, [r5, 0x1C] + adds r0, r5, 0 + bl _call_via_r1 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810744C + + thumb_func_start sub_81074E4 +sub_81074E4: @ 81074E4 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0203841e + ldrh r1, [r0, 0xE] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _08107506 + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnim + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] +_08107506: + adds r0, r4, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _08107518 + adds r0, r4, 0 + bl move_anim_8072740 +_08107518: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81074E4 + + thumb_func_start sub_8107528 +sub_8107528: @ 8107528 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldr r0, =0x0203841e + ldrh r0, [r0] + strh r0, [r4, 0x8] + ldr r0, =0x0000279c + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 20 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r0, [r4, 0xC] + ldr r0, =sub_810756C + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8107528 + + thumb_func_start sub_810756C +sub_810756C: @ 810756C + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + ldrh r0, [r2, 0x1C] + adds r0, 0x1 + strh r0, [r2, 0x1C] + lsls r0, 16 + asrs r0, 16 + mov r12, r1 + cmp r0, 0x3 + bne _081075BE + movs r0, 0 + strh r0, [r2, 0x1C] + ldrh r0, [r2, 0xC] + adds r0, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r1, =0x02037b14 + lsls r0, r5, 1 + adds r0, r1 + ldrh r6, [r0] + adds r7, r1, 0 + adds r3, r0, 0x2 + movs r1, 0x6 + adds r2, r0, 0 +_081075A8: + ldrh r0, [r3] + strh r0, [r2] + adds r3, 0x2 + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _081075A8 + adds r0, r5, 0x7 + lsls r0, 1 + adds r0, r7 + strh r6, [r0] +_081075BE: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + add r0, r12 + ldrh r1, [r0, 0x1E] + adds r1, 0x1 + strh r1, [r0, 0x1E] + lsls r1, 16 + asrs r1, 16 + movs r2, 0x8 + ldrsh r0, [r0, r2] + cmp r1, r0 + bne _081075DE + adds r0, r4, 0 + bl move_anim_task_del +_081075DE: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810756C + + thumb_func_start sub_81075EC +sub_81075EC: @ 81075EC + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + movs r0, 0x1E + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x30] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl obj_translate_based_on_private_1_2_3_4 + movs r0, 0x2E + ldrsh r1, [r5, r0] + movs r0, 0xD2 + lsls r0, 8 + bl __divsi3 + strh r0, [r5, 0x38] + ldr r0, =0x0203841e + ldrh r2, [r0, 0x6] + strh r2, [r5, 0x3C] + ldrh r1, [r0, 0xE] + movs r3, 0xE + ldrsh r0, [r0, r3] + cmp r0, 0x7F + ble _0810765C + adds r0, r1, 0 + subs r0, 0x7F + lsls r0, 8 + strh r0, [r5, 0x3A] + negs r0, r2 + strh r0, [r5, 0x3C] + b _08107660 + .pool +_0810765C: + lsls r0, r1, 8 + strh r0, [r5, 0x3A] +_08107660: + ldr r1, =sub_8107674 + str r1, [r5, 0x1C] + adds r0, r5, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81075EC + + thumb_func_start sub_8107674 +sub_8107674: @ 8107674 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _08107688 + adds r0, r4, 0 + bl move_anim_8072740 +_08107688: + ldrh r0, [r4, 0x3A] + lsls r0, 16 + asrs r0, 24 + movs r2, 0x3C + ldrsh r1, [r4, r2] + bl sine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + movs r2, 0x3A + ldrsh r0, [r4, r2] + movs r2, 0x38 + ldrsh r1, [r4, r2] + adds r0, r1 + asrs r0, 8 + cmp r0, 0x7F + ble _081076B8 + movs r0, 0 + strh r0, [r4, 0x3A] + ldrh r0, [r4, 0x3C] + negs r0, r0 + strh r0, [r4, 0x3C] + b _081076C0 +_081076B8: + ldrh r0, [r4, 0x38] + ldrh r1, [r4, 0x3A] + adds r0, r1 + strh r0, [r4, 0x3A] +_081076C0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8107674 + + thumb_func_start sub_81076C8 +sub_81076C8: @ 81076C8 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r3, =0x0203841e + ldrh r0, [r3] + movs r2, 0 + strh r0, [r1, 0x8] + strh r2, [r3, 0xE] + ldr r0, =sub_81076F4 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_81076C8 + + thumb_func_start sub_81076F4 +sub_81076F4: @ 81076F4 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =0x0203841e + ldrh r0, [r2, 0xE] + adds r0, 0x3 + movs r1, 0xFF + ands r0, r1 + strh r0, [r2, 0xE] + ldr r1, =0x03005e00 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + subs r1, 0x1 + strh r1, [r0, 0x8] + lsls r1, 16 + cmp r1, 0 + bne _08107722 + adds r0, r3, 0 + bl move_anim_task_del +_08107722: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81076F4 + + thumb_func_start sub_8107730 +sub_8107730: @ 8107730 + push {r4-r7,lr} + adds r4, r0, 0 + ldr r7, =0x02038436 + ldrb r0, [r7] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + ldrb r0, [r7] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + ldr r6, =0x0000fff6 + strh r6, [r4, 0x26] + ldrb r0, [r7] + bl sub_80A82E4 + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810778A + ldrb r0, [r7] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08107784 + movs r0, 0xA + strh r0, [r4, 0x24] + b _0810778C + .pool +_08107784: + strh r6, [r4, 0x24] + subs r0, r5, 0x2 + b _0810778E +_0810778A: + strh r6, [r4, 0x24] +_0810778C: + adds r0, r5, 0x2 +_0810778E: + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + ldr r0, =sub_81077A4 + str r0, [r4, 0x1C] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8107730 + + thumb_func_start sub_81077A4 +sub_81077A4: @ 81077A4 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _081077BA + adds r0, r2, 0 + bl move_anim_8072740 +_081077BA: + pop {r0} + bx r0 + thumb_func_end sub_81077A4 + + thumb_func_start sub_81077C0 +sub_81077C0: @ 81077C0 + push {r4-r7,lr} + adds r6, r0, 0 + ldr r5, =0x02038436 + ldrb r0, [r5] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _0810780A + ldr r4, =0x0203841e + movs r1, 0 + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4] + ldrb r0, [r5] + bl battle_get_per_side_status + lsls r0, 24 + cmp r0, 0 + beq _08107802 + ldrb r0, [r5] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0810780A +_08107802: + movs r1, 0 + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4] +_0810780A: + ldr r5, =0x0203841e + movs r1, 0xA + ldrsh r0, [r5, r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + movs r1, 0 + cmp r0, 0 + bne _0810781E + movs r1, 0x1 +_0810781E: + ldrb r0, [r5, 0xA] + movs r7, 0x1 + cmp r0, 0 + bne _08107828 + movs r7, 0x3 +_08107828: + adds r0, r6, 0 + bl sub_80A69CC + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08107842 + ldrh r0, [r5, 0x4] + negs r0, r0 + strh r0, [r5, 0x4] +_08107842: + ldrh r0, [r5, 0x8] + strh r0, [r6, 0x2E] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x4] + adds r0, r1 + strh r0, [r6, 0x32] + ldrb r0, [r4] + adds r1, r7, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r5, [r5, 0x6] + adds r0, r5 + strh r0, [r6, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r6, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r6, 0 + bl oamt_set_x3A_32 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81077C0 + + thumb_func_start sub_8107894 +sub_8107894: @ 8107894 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A6980 + ldr r0, =0x0203841e + ldrh r1, [r0, 0x8] + strh r1, [r4, 0x2E] + ldrh r0, [r0, 0x4] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x22] + adds r1, r0 + strh r1, [r4, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r4, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8107894 + + thumb_func_start sub_81078D0 +sub_81078D0: @ 81078D0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0203841e + movs r1, 0x6 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _081078EC + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A6980 + b _081078F4 + .pool +_081078EC: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A69CC +_081078F4: + ldr r0, =0x0203841e + ldrh r0, [r0, 0x4] + strh r0, [r4, 0x3C] + ldr r0, =sub_810790C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81078D0 + + thumb_func_start sub_810790C +sub_810790C: @ 810790C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0xB + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x4 + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x30] + adds r0, 0x30 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 24 + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3C] + subs r0, 0x1 + strh r0, [r4, 0x3C] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0810794C + adds r0, r4, 0 + bl move_anim_8072740 +_0810794C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810790C + + thumb_func_start sub_8107954 +sub_8107954: @ 8107954 + 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 + mov r10, r0 + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0 + movs r2, 0x1 + bl lcd_bg_operations + mov r0, sp + bl sub_80A6B30 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _081079E0 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081079D0 + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, =gUnknown_08D95E00 + bl sub_80A6D48 + b _081079EA + .pool +_081079D0: + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, =gUnknown_08D960D0 + bl sub_80A6D48 + b _081079EA + .pool +_081079E0: + ldr r1, =gUnknown_08D963A4 + mov r0, sp + movs r2, 0x1 + bl sub_80A6D60 +_081079EA: + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, =gUnknown_08D94AB8 + mov r2, sp + ldrh r2, [r2, 0xA] + bl sub_80A6CC0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08107A24 + ldr r0, =gUnknown_08D95DD8 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl decompress_palette + b _08107A32 + .pool +_08107A24: + ldr r0, =gUnknown_08D8FB9C + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl decompress_palette +_08107A32: + ldr r0, =sub_8107D58 + ldr r4, =0x03005e00 + mov r2, r10 + lsls r5, r2, 2 + adds r1, r5, r2 + lsls r1, 3 + adds r6, r1, r4 + ldrb r1, [r6, 0x7] + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0 + mov r9, r0 + mov r1, r8 + strh r1, [r6, 0x26] + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r7, r0, r4 + mov r0, r9 + strh r0, [r7, 0x8] + movs r0, 0x80 + lsls r0, 5 + strh r0, [r7, 0xA] + strh r0, [r7, 0xC] + bl sub_80A4DF0 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _08107AB4 + ldr r1, =0x0000ffb0 + adds r0, r1, 0 + ldr r2, =0x02022e18 + strh r0, [r2] + adds r1, 0x20 + adds r0, r1, 0 + ldr r2, =0x02022e1a + strh r0, [r2] + movs r0, 0x2 + strh r0, [r6, 0x8] + movs r0, 0x1 + strh r0, [r6, 0xA] + mov r0, r9 + strh r0, [r7, 0xE] + b _08107B0E + .pool +_08107AB4: + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + bne _08107AF8 + ldr r2, =0x0000ff20 + adds r0, r2, 0 + ldr r2, =0x02022e18 + strh r0, [r2] + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + ldr r2, =0x02022e1a + strh r0, [r2] + movs r0, 0x2 + strh r0, [r6, 0x8] + ldr r0, =0x0000ffff + strh r0, [r6, 0xA] + strh r1, [r7, 0xE] + b _08107B0E + .pool +_08107AF8: + ldr r0, =0x02022e18 + strh r4, [r0] + ldr r1, =0x0000ffd0 + adds r0, r1, 0 + ldr r2, =0x02022e1a + strh r0, [r2] + ldr r0, =0x0000fffe + strh r0, [r6, 0x8] + movs r0, 0x1 + strh r0, [r6, 0xA] + strh r4, [r7, 0xE] +_08107B0E: + ldr r0, =0x02022e18 + ldrh r1, [r0] + movs r0, 0x14 + bl SetGpuReg + ldr r2, =0x02022e1a + ldrh r1, [r2] + movs r0, 0x16 + bl SetGpuReg + ldr r1, =0x03005e00 + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r1, r0, r1 + movs r2, 0xE + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08107B54 + movs r0, 0x30 + strh r0, [r1, 0x10] + movs r0, 0x70 + b _08107B58 + .pool +_08107B54: + movs r0, 0 + strh r0, [r1, 0x10] +_08107B58: + strh r0, [r1, 0x12] + ldr r1, =0x03005e00 + mov r2, r10 + adds r0, r5, r2 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x14] + ldr r1, =sub_8107B84 + str 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_8107954 + + thumb_func_start sub_8107B84 +sub_8107B84: @ 8107B84 + push {r4-r7,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x02022e18 + ldr r2, =0x02022e1a + ldr r0, =0x03005e00 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r4, 0x8] + ldrh r3, [r1] + adds r0, r3 + strh r0, [r1] + ldrh r0, [r4, 0xA] + ldrh r1, [r2] + adds r0, r1 + strh r0, [r2] + mov r0, sp + bl sub_80A6B30 + ldrh r0, [r4, 0xA] + ldrh r3, [r4, 0xC] + adds r0, r3 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _08107C18 + ldr r1, =0x02037b14 + mov r0, sp + ldrb r0, [r0, 0x8] + lsls r0, 4 + adds r0, 0x7 + lsls r0, 1 + adds r0, r1 + ldrh r6, [r0] + movs r2, 0x6 + adds r7, r1, 0 + adds r3, r7, 0 + mov r4, sp +_08107BDE: + ldrb r0, [r4, 0x8] + lsls r0, 4 + adds r1, r2, 0x1 + adds r0, r1 + lsls r1, r0, 1 + adds r1, r3 + subs r0, 0x1 + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r1] + subs r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _08107BDE + mov r0, sp + ldrb r0, [r0, 0x8] + lsls r0, 4 + adds r0, 0x1 + lsls r0, 1 + adds r0, r7 + strh r6, [r0] + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r2, [r0, 0x12] +_08107C18: + ldr r1, =0x03005e00 + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 3 + adds r3, r0, r1 + ldrh r0, [r3, 0x14] + adds r0, 0x1 + strh r0, [r3, 0x14] + lsls r0, 16 + asrs r0, 16 + adds r4, r1, 0 + adds r6, r2, 0 + cmp r0, 0x1 + ble _08107C86 + movs r0, 0 + strh r0, [r3, 0x14] + ldrh r0, [r3, 0xE] + adds r2, r0, 0x1 + strh r2, [r3, 0xE] + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0xD + bgt _08107C62 + movs r1, 0x26 + ldrsh r0, [r3, r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + movs r0, 0x10 + subs r0, r2 + lsls r0, 8 + orrs r2, r0 + strh r2, [r1, 0xA] + ldrh r0, [r3, 0x10] + adds r0, 0x1 + strh r0, [r3, 0x10] +_08107C62: + movs r1, 0xE + ldrsh r0, [r3, r1] + cmp r0, 0x36 + ble _08107C86 + ldrh r2, [r3, 0x10] + subs r2, 0x1 + strh r2, [r3, 0x10] + movs r1, 0x26 + ldrsh r0, [r3, r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + movs r0, 0x10 + subs r0, r2 + lsls r0, 8 + orrs r2, r0 + strh r2, [r1, 0xA] +_08107C86: + adds r0, r6, r5 + lsls r0, 3 + adds r2, r0, r4 + movs r3, 0x26 + ldrsh r1, [r2, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + ldrh r0, [r0, 0xA] + movs r3, 0x1F + ands r3, r0 + cmp r3, 0 + bne _08107CA8 + strh r3, [r2, 0x8] + ldr r0, =sub_8107CC4 + str r0, [r2] +_08107CA8: + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8107B84 + + thumb_func_start sub_8107CC4 +sub_8107CC4: @ 8107CC4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r7, =0x02022e18 + ldr r0, =0x02022e1a + mov r8, r0 + ldr r6, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r6 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08107D08 + movs r0, 0x1 + bl sub_80A6C68 + movs r0, 0x2 + bl sub_80A6C68 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08107D4A + .pool +_08107D08: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08107D1C + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_08107D1C: + movs r0, 0 + strh r0, [r7] + mov r1, r8 + strh r0, [r1] + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + ldr r1, =0x0000ffff + strh r1, [r0, 0x26] + adds r0, r5, 0 + bl move_anim_task_del +_08107D4A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8107CC4 + + thumb_func_start sub_8107D58 +sub_8107D58: @ 8107D58 + 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, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _08107D74 + b _08107EAC +_08107D74: + cmp r0, 0x1 + bgt _08107D84 + cmp r0, 0 + beq _08107D8C + b _08108022 + .pool +_08107D84: + cmp r0, 0x2 + bne _08107D8A + b _08107F78 +_08107D8A: + b _08108022 +_08107D8C: + movs r3, 0 + movs r2, 0x10 + ldrsh r0, [r4, r2] + ldr r1, =0x02038c28 + mov r12, r1 + cmp r3, r0 + bge _08107DCA + mov r7, r12 + movs r5, 0xF0 + lsls r5, 3 + add r5, r12 + ldr r6, =0x0000ffff +_08107DA4: + lsls r2, r3, 16 + asrs r2, 16 + lsls r1, r2, 1 + adds r3, r1, r7 + adds r1, r5 + ldrh r0, [r4, 0xC] + strh r0, [r1] + ldrh r1, [r4, 0xC] + adds r0, r6, 0 + ands r0, r1 + strh r0, [r3] + adds r2, 0x1 + lsls r2, 16 + lsrs r3, r2, 16 + asrs r2, 16 + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r2, r0 + blt _08107DA4 +_08107DCA: + ldrh r3, [r4, 0x10] + lsls r2, r3, 16 + asrs r1, r2, 16 + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bge _08107E04 + ldr r5, =0x02038c28 + movs r0, 0xF0 + lsls r0, 3 + adds r6, r5, r0 + ldr r7, =0x0000ffff +_08107DE2: + asrs r2, 16 + lsls r1, r2, 1 + adds r3, r1, r5 + adds r1, r6 + ldrh r0, [r4, 0xA] + strh r0, [r1] + ldrh r1, [r4, 0xA] + adds r0, r7, 0 + ands r0, r1 + strh r0, [r3] + adds r2, 0x1 + lsls r2, 16 + asrs r1, r2, 16 + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + blt _08107DE2 +_08107E04: + ldrh r3, [r4, 0x12] + lsls r2, r3, 16 + asrs r0, r2, 16 + cmp r0, 0x9F + bgt _08107E3A + ldr r5, =0x02038c28 + movs r0, 0xF0 + lsls r0, 3 + adds r6, r5, r0 + ldr r7, =0x0000ffff +_08107E18: + asrs r2, 16 + lsls r1, r2, 1 + adds r3, r1, r5 + adds r1, r6 + ldrh r0, [r4, 0xC] + strh r0, [r1] + ldrh r1, [r4, 0xC] + adds r0, r7, 0 + ands r0, r1 + strh r0, [r3] + adds r2, 0x1 + lsls r2, 16 + lsrs r3, r2, 16 + lsls r2, r3, 16 + asrs r0, r2, 16 + cmp r0, 0x9F + ble _08107E18 +_08107E3A: + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08107E64 + lsls r0, r3, 16 + asrs r0, 15 + mov r3, r12 + adds r2, r0, r3 + movs r1, 0xF0 + lsls r1, 3 + add r1, r12 + adds r0, r1 + ldrh r1, [r4, 0xA] + strh r1, [r0] + ldrh r0, [r4, 0xA] + b _08107E7A + .pool +_08107E64: + lsls r0, r3, 16 + asrs r0, 15 + mov r1, r12 + adds r2, r0, r1 + movs r1, 0xF0 + lsls r1, 3 + add r1, r12 + adds r0, r1 + ldrh r1, [r4, 0xC] + strh r1, [r0] + ldrh r0, [r4, 0xC] +_08107E7A: + strh r0, [r2] + ldr r0, =0x04000052 + str r0, [sp] + ldr r0, =0xa2600001 + str r0, [sp, 0x4] + mov r1, sp + movs r2, 0 + movs r0, 0x1 + strb r0, [r1, 0x8] + mov r0, sp + strb r2, [r0, 0x9] + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08108022 + .pool +_08107EAC: + movs r2, 0xE + ldrsh r1, [r4, r2] + cmp r1, 0 + bne _08107EC4 + ldrh r0, [r4, 0x10] + subs r0, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + cmp r0, 0 + bgt _08107ED8 + strh r1, [r4, 0x10] + b _08107ED2 +_08107EC4: + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6F + ble _08107ED8 +_08107ED2: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_08107ED8: + movs r3, 0 + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r3, r0 + bge _08107F0C + ldr r6, =0x02038c28 + ldr r5, =0x02039b28 +_08107EE6: + lsls r1, r3, 16 + asrs r1, 16 + lsls r3, r1, 1 + ldrb r2, [r5, 0x14] + lsls r0, r2, 4 + subs r0, r2 + lsls r0, 7 + adds r3, r0 + adds r3, r6 + ldrh r0, [r4, 0xC] + strh r0, [r3] + adds r1, 0x1 + lsls r1, 16 + lsrs r3, r1, 16 + asrs r1, 16 + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r1, r0 + blt _08107EE6 +_08107F0C: + ldrh r3, [r4, 0x10] + lsls r2, r3, 16 + asrs r1, r2, 16 + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bge _08107F40 + ldr r6, =0x02038c28 + ldr r5, =0x02039b28 +_08107F1E: + asrs r3, r2, 16 + lsls r2, r3, 1 + ldrb r1, [r5, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r6 + ldrh r0, [r4, 0xA] + strh r0, [r2] + adds r3, 0x1 + lsls r2, r3, 16 + asrs r1, r2, 16 + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + blt _08107F1E +_08107F40: + ldrh r3, [r4, 0x12] + lsls r1, r3, 16 + asrs r0, r1, 16 + cmp r0, 0x9F + bgt _08108022 + ldr r6, =0x02038c28 + ldr r5, =0x02039b28 +_08107F4E: + asrs r3, r1, 16 + lsls r2, r3, 1 + ldrb r1, [r5, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r6 + ldrh r0, [r4, 0xC] + strh r0, [r2] + adds r3, 0x1 + lsls r1, r3, 16 + asrs r0, r1, 16 + cmp r0, 0x9F + ble _08107F4E + b _08108022 + .pool +_08107F78: + movs r3, 0 + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r3, r0 + bge _08107FAC + ldr r6, =0x02038c28 + ldr r5, =0x02039b28 +_08107F86: + lsls r1, r3, 16 + asrs r1, 16 + lsls r3, r1, 1 + ldrb r2, [r5, 0x14] + lsls r0, r2, 4 + subs r0, r2 + lsls r0, 7 + adds r3, r0 + adds r3, r6 + ldrh r0, [r4, 0xC] + strh r0, [r3] + adds r1, 0x1 + lsls r1, 16 + lsrs r3, r1, 16 + asrs r1, 16 + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r1, r0 + blt _08107F86 +_08107FAC: + ldrh r3, [r4, 0x10] + lsls r2, r3, 16 + asrs r1, r2, 16 + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bge _08107FE0 + ldr r6, =0x02038c28 + ldr r5, =0x02039b28 +_08107FBE: + asrs r3, r2, 16 + lsls r2, r3, 1 + ldrb r1, [r5, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r6 + ldrh r0, [r4, 0xA] + strh r0, [r2] + adds r3, 0x1 + lsls r2, r3, 16 + asrs r1, r2, 16 + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + blt _08107FBE +_08107FE0: + ldrh r3, [r4, 0x12] + lsls r1, r3, 16 + asrs r0, r1, 16 + cmp r0, 0x9F + bgt _0810800C + ldr r6, =0x02038c28 + ldr r5, =0x02039b28 +_08107FEE: + asrs r3, r1, 16 + lsls r2, r3, 1 + ldrb r1, [r5, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r6 + ldrh r0, [r4, 0xC] + strh r0, [r2] + adds r3, 0x1 + lsls r1, r3, 16 + asrs r0, r1, 16 + cmp r0, 0x9F + ble _08107FEE +_0810800C: + movs r0, 0x26 + ldrsh r1, [r4, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _08108022 + bl remove_some_task + adds r0, r7, 0 + bl DestroyTask +_08108022: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8107D58 + + thumb_func_start sub_8108034 +sub_8108034: @ 8108034 + push {r4-r6,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x8 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A6980 + bl GenerateRandomNumber2 + movs r5, 0xFF + ands r5, r0 + movs r0, 0x80 + lsls r0, 1 + adds r6, r0, 0 + orrs r5, r6 + bl GenerateRandomNumber2 + ldr r1, =0x000001ff + ands r1, r0 + adds r0, r1, 0 + cmp r0, 0xFF + ble _0810807A + subs r0, r6, r0 + lsls r0, 16 + lsrs r1, r0, 16 +_0810807A: + strh r5, [r4, 0x30] + strh r1, [r4, 0x32] + ldr r0, =sub_8108098 + str r0, [r4, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8108034 + + thumb_func_start sub_8108098 +sub_8108098: @ 8108098 + push {r4,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x30] + ldrh r1, [r2, 0x34] + adds r3, r0, r1 + strh r3, [r2, 0x34] + ldrh r1, [r2, 0x32] + ldrh r4, [r2, 0x36] + adds r1, r4 + strh r1, [r2, 0x36] + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _081080BC + lsls r0, r3, 16 + asrs r0, 24 + negs r0, r0 + b _081080C0 +_081080BC: + lsls r0, r3, 16 + asrs r0, 24 +_081080C0: + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x36] + lsls r0, 16 + asrs r0, 24 + strh r0, [r2, 0x26] + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x15 + bne _081080DE + adds r0, r2, 0 + bl move_anim_8072740 +_081080DE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8108098 + + thumb_func_start sub_81080E4 +sub_81080E4: @ 81080E4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x22] + strh r0, [r4, 0x12] + bl sub_8108384 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_80A7270 + ldr r0, =sub_8108140 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81080E4 + + thumb_func_start sub_8108140 +sub_8108140: @ 8108140 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x7 + bls _0810815C + b _0810837A +_0810815C: + lsls r0, 2 + ldr r1, =_08108170 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08108170: + .4byte _08108190 + .4byte _081081B6 + .4byte _08108248 + .4byte _0810827E + .4byte _08108292 + .4byte _081082A0 + .4byte _08108320 + .4byte _0810836C +_08108190: + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + movs r3, 0x80 + lsls r3, 1 + movs r0, 0xE0 + str r0, [sp] + movs r0, 0x80 + lsls r0, 2 + str r0, [sp, 0x4] + movs r0, 0x20 + str r0, [sp, 0x8] + adds r0, r4, 0 + adds r2, r3, 0 + bl sub_80A805C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_081081B6: + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08108212 + movs r0, 0 + strh r0, [r4, 0xE] + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08108200 + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3 + strh r1, [r0, 0x24] + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + adds r1, 0x1 + strh r1, [r0, 0x22] + b _08108212 + .pool +_08108200: + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000fffd + strh r1, [r0, 0x24] +_08108212: + adds r0, r4, 0 + bl sub_80A80C8 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _08108222 + b _0810837A +_08108222: + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A7E6C + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x24] + strh r5, [r4, 0xE] + b _0810835C + .pool +_08108248: + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bgt _08108258 + b _0810837A +_08108258: + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + movs r3, 0x80 + lsls r3, 2 + movs r0, 0xC0 + lsls r0, 1 + str r0, [sp] + movs r0, 0xE0 + str r0, [sp, 0x4] + movs r0, 0x8 + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r2, 0xE0 + bl sub_80A805C + movs r0, 0 + strh r0, [r4, 0xE] + b _0810835E +_0810827E: + adds r0, r4, 0 + bl sub_80A80C8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0810837A + strh r0, [r4, 0xE] + strh r0, [r4, 0x10] + b _0810835E +_08108292: + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_8108408 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_081082A0: + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0810837A + movs r0, 0 + strh r0, [r4, 0xE] + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081082D8 + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + adds r1, 0x2 + b _081082EA + .pool +_081082D8: + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + subs r1, 0x2 +_081082EA: + strh r1, [r0, 0x26] + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r0, 0xA + bne _0810837A + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + movs r2, 0xC0 + lsls r2, 1 + movs r0, 0x80 + lsls r0, 1 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x8 + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r3, 0xE0 + bl sub_80A805C + movs r0, 0 + strh r0, [r4, 0xE] + strh r0, [r4, 0x10] + b _0810835E + .pool +_08108320: + ldr r6, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrh r1, [r0, 0x22] + subs r1, 0x1 + strh r1, [r0, 0x22] + adds r0, r4, 0 + bl sub_80A80C8 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0810837A + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A7344 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrh r1, [r4, 0x12] + strh r1, [r0, 0x22] +_0810835C: + strh r5, [r4, 0x10] +_0810835E: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0810837A + .pool +_0810836C: + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0810837A + adds r0, r2, 0 + bl move_anim_task_del +_0810837A: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8108140 + + thumb_func_start sub_8108384 +sub_8108384: @ 8108384 + push {r4,r5,lr} + ldr r4, =0x02038436 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _081083B8 + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + b _081083C8 + .pool +_081083B4: + adds r0, r2, 0 + b _081083FA +_081083B8: + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 +_081083C8: + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x3A + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r3, r0, 16 + lsrs r4, 18 + movs r2, 0 +_081083E6: + adds r1, r2, 0x1 + adds r0, r4, 0 + muls r0, r1 + cmp r3, r0 + blt _081083B4 + lsls r0, r1, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _081083E6 + movs r0, 0x3 +_081083FA: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8108384 + + thumb_func_start sub_8108408 +sub_8108408: @ 8108408 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + adds r7, r0, 0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0xAC + ldrb r0, [r4] + bl sub_80A82E4 + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + ldrh r1, [r7, 0xA] + movs r0, 0x4 + subs r0, r1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r0, 0 + bgt _08108458 + movs r1, 0x1 +_08108458: + movs r0, 0 + str r0, [sp, 0x4] + lsls r0, r1, 16 + mov r10, r8 + mov r9, r6 + mov r1, r10 + lsls r1, 4 + str r1, [sp, 0xC] + mov r1, r9 + lsls r1, 4 + str r1, [sp, 0x10] + asrs r0, 16 + mov r8, r0 +_08108472: + ldr r0, =gUnknown_08595268 + mov r1, r10 + mov r2, r9 + ldr r3, [sp, 0x8] + bl AddObjectToFront + lsls r0, 24 + lsrs r2, r0, 24 + lsls r6, r5, 16 + cmp r2, 0x40 + beq _081084DA + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r5, r0, r1 + mov r0, sp + ldrh r0, [r0, 0x4] + strh r0, [r5, 0x30] + mov r1, sp + ldrh r1, [r1, 0xC] + strh r1, [r5, 0x32] + mov r0, sp + ldrh r0, [r0, 0x10] + strh r0, [r5, 0x34] + asrs r4, r6, 16 + adds r0, r4, 0 + movs r1, 0x40 + bl cosine + strh r0, [r5, 0x36] + adds r0, r4, 0 + movs r1, 0x40 + bl sine + strh r0, [r5, 0x38] + mov r1, sp + ldrh r1, [r1] + strh r1, [r5, 0x3A] + movs r0, 0x2 + strh r0, [r5, 0x3C] + ldrh r1, [r7, 0xC] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081084D4 + adds r0, r5, 0 + bl sub_810851C +_081084D4: + ldrh r0, [r7, 0xC] + adds r0, 0x1 + strh r0, [r7, 0xC] +_081084DA: + mov r1, r8 + lsls r0, r1, 1 + asrs r1, r6, 16 + adds r1, r0 + lsls r1, 16 + movs r0, 0xFF + lsls r0, 16 + ands r0, r1 + lsrs r5, r0, 16 + ldr r1, [sp, 0x4] + lsls r0, r1, 16 + asrs r0, 16 + add r0, r8 + lsls r0, 16 + lsrs r1, r0, 16 + str r1, [sp, 0x4] + asrs r0, 16 + cmp r0, 0x13 + ble _08108472 + 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_8108408 + + thumb_func_start sub_810851C +sub_810851C: @ 810851C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0810852E + cmp r0, 0x1 + beq _08108564 + b _081085BE +_0810852E: + movs r2, 0x30 + ldrsh r0, [r4, r2] + movs r1, 0x6 + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 1 + adds r1, r0 + ldrh r0, [r4, 0x36] + adds r1, r0 + strh r1, [r4, 0x36] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 1 + adds r1, r0 + ldrh r2, [r4, 0x38] + adds r1, r2 + strh r1, [r4, 0x38] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_08108564: + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] + ldrh r1, [r4, 0x38] + ldrh r2, [r4, 0x34] + adds r1, r2 + strh r1, [r4, 0x34] + lsls r0, 16 + asrs r0, 20 + strh r0, [r4, 0x20] + lsls r1, 16 + asrs r2, r1, 20 + strh r2, [r4, 0x22] + adds r0, 0x8 + lsls r0, 16 + movs r1, 0x80 + lsls r1, 17 + cmp r0, r1 + bhi _0810859A + adds r1, r2, 0 + movs r0, 0x8 + negs r0, r0 + cmp r1, r0 + blt _0810859A + cmp r1, 0x78 + ble _081085BE +_0810859A: + ldr r3, =0x03005e00 + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x3A + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_081085BE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810851C + + thumb_func_start sub_81085C8 +sub_81085C8: @ 81085C8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r4, r1, r0 + bl sub_8108384 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xA] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08108600 + movs r0, 0x88 + strh r0, [r4, 0x10] + movs r0, 0x28 + b _08108606 + .pool +_08108600: + movs r0, 0x10 + strh r0, [r4, 0x10] + movs r0, 0x50 +_08108606: + strh r0, [r4, 0x14] + movs r0, 0x62 + strh r0, [r4, 0x12] + ldrh r0, [r4, 0x10] + adds r0, 0x31 + strh r0, [r4, 0x16] + movs r0, 0xA + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + adds r0, 0x5 + strh r0, [r4, 0x20] + ldr r0, =sub_810862C + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81085C8 + + thumb_func_start sub_810862C +sub_810862C: @ 810862C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r7, =0x03005e00 + adds r4, r0, r7 + movs r0, 0x8 + ldrsh r2, [r4, r0] + cmp r2, 0 + beq _08108654 + cmp r2, 0x1 + beq _08108704 + b _08108712 + .pool +_08108654: + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _0810866A + strh r2, [r4, 0xC] + adds r0, r4, 0 + bl sub_810871C +_0810866A: + movs r1, 0x1C + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081086E4 + movs r2, 0x22 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _081086E4 + ldr r5, =0x0203841e + movs r1, 0x1 + mov r8, r1 + mov r2, r8 + strh r2, [r5] + strh r0, [r5, 0x2] + movs r0, 0xC + strh r0, [r5, 0x4] + ldr r6, =sub_81152DC + adds r0, r6, 0 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _081086B4 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r7 + ldr r1, [r0] + adds r0, r2, 0 + bl _call_via_r1 + ldr r1, =0x020383fe + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081086B4: + movs r0, 0x3 + strh r0, [r5] + adds r0, r6, 0 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _081086E0 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r7 + ldr r1, [r0] + adds r0, r2, 0 + bl _call_via_r1 + ldr r1, =0x020383fe + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081086E0: + mov r0, r8 + strh r0, [r4, 0x22] +_081086E4: + movs r2, 0x1E + ldrsh r1, [r4, r2] + movs r2, 0x20 + ldrsh r0, [r4, r2] + cmp r1, r0 + blt _08108712 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08108712 + .pool +_08108704: + movs r2, 0x1A + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08108712 + adds r0, r1, 0 + bl move_anim_task_del +_08108712: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_810862C + + thumb_func_start sub_810871C +sub_810871C: @ 810871C + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + ldr r1, =gUnknown_08329F40 + movs r2, 0x18 + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + adds r0, 0x3 + asrs r0, 4 + ldrh r2, [r4, 0x14] + adds r0, r2 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =gUnknown_08595268 + movs r2, 0x16 + ldrsh r1, [r4, r2] + movs r2, 0 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _08108776 + ldr r3, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x1C + adds r1, r0, r1 + ldr r2, =sub_81087C0 + str r2, [r1] + adds r0, r3 + strh r5, [r0, 0x38] + strh r6, [r0, 0x3A] + movs r1, 0x9 + strh r1, [r0, 0x3C] + ldrh r0, [r4, 0x1A] + adds r0, 0x1 + strh r0, [r4, 0x1A] +_08108776: + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + strh r0, [r4, 0x1E] + ldrh r0, [r4, 0x18] + adds r0, 0x27 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x18] + movs r0, 0x16 + ldrsh r1, [r4, r0] + ldr r0, =0x41c64e6d + muls r0, r1 + ldr r1, =0x00003039 + adds r0, r1 + movs r2, 0x12 + ldrsh r1, [r4, r2] + bl __modsi3 + ldrh r1, [r4, 0x10] + adds r1, r0 + strh r1, [r4, 0x16] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810871C + + thumb_func_start sub_81087C0 +sub_81087C0: @ 81087C0 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08108856 + ldrh r0, [r5, 0x22] + adds r0, 0x8 + strh r0, [r5, 0x22] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x38 + ldrsh r1, [r5, r2] + cmp r0, r1 + blt _08108856 + ldr r2, =0x03005e00 + movs r3, 0x3A + ldrsh r1, [r5, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x1 + strh r1, [r0, 0x1C] + ldr r0, =gUnknown_08597388 + movs r2, 0x20 + ldrsh r1, [r5, r2] + movs r3, 0x22 + ldrsh r2, [r5, r3] + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x30] + cmp r0, 0x40 + beq _08108850 + movs r0, 0x30 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + movs r1, 0x3 + bl StartObjectRotScalAnim + movs r2, 0x30 + ldrsh r1, [r5, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r5, 0x3A] + strh r1, [r0, 0x3A] + movs r3, 0x30 + ldrsh r1, [r5, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r5, 0x3C] + strh r1, [r0, 0x3C] + movs r0, 0x30 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, 0x1C + adds r0, r4 + ldr r1, =sub_810886C + str r1, [r0] +_08108850: + adds r0, r5, 0 + bl RemoveObjectAndFreeTiles +_08108856: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81087C0 + + thumb_func_start sub_810886C +sub_810886C: @ 810886C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081088D8 + movs r0, 0 + strh r0, [r4, 0x30] + 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] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + bne _081088D8 + ldr r3, =0x03005e00 + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x3A + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_081088D8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810886C + + thumb_func_start sub_81088E4 +sub_81088E4: @ 81088E4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r5, r1, r0 + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + movs r6, 0 + strh r0, [r5, 0xE] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x10] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + movs r2, 0x1 + negs r2, r2 + adds r1, r2, 0 + cmp r0, 0 + bne _08108928 + movs r1, 0x1 +_08108928: + strh r1, [r5, 0x16] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0810893C + movs r1, 0x16 + ldrsh r0, [r5, r1] + negs r0, r0 + strh r0, [r5, 0x16] +_0810893C: + movs r2, 0x16 + ldrsh r0, [r5, r2] + lsls r0, 3 + ldrh r1, [r5, 0xE] + adds r0, r1 + strh r0, [r5, 0x12] + movs r2, 0x16 + ldrsh r1, [r5, r2] + lsls r1, 3 + ldrh r0, [r5, 0x10] + subs r0, r1 + strh r0, [r5, 0x14] + ldr r0, =0x0000ffe0 + strh r0, [r5, 0x1A] + strh r6, [r5, 0xA] + strh r6, [r5, 0x8] + ldr r0, =sub_8108978 + str r0, [r5] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81088E4 + + thumb_func_start sub_8108978 +sub_8108978: @ 8108978 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x6 + bls _08108992 + b _08108AB2 +_08108992: + lsls r0, 2 + ldr r1, =_081089A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081089A4: + .4byte _081089C0 + .4byte _081089D0 + .4byte _081089EA + .4byte _08108A2C + .4byte _08108A4E + .4byte _08108A7C + .4byte _08108AA2 +_081089C0: + adds r0, r4, 0 + bl sub_8108AC0 + movs r1, 0x1C + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08108AB8 + b _08108AAA +_081089D0: + adds r0, r4, 0 + bl sub_8108AC0 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _08108AB8 + movs r0, 0 + strh r0, [r4, 0xA] + b _08108AAA +_081089EA: + adds r0, r4, 0 + bl sub_8108AC0 + movs r1, 0x16 + ldrsh r0, [r4, r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 1 + ldrh r0, [r4, 0x12] + adds r1, r0 + movs r2, 0 + strh r1, [r4, 0x12] + adds r1, 0x10 + lsls r1, 16 + movs r0, 0x88 + lsls r0, 17 + cmp r1, r0 + bls _08108AB8 + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _08108A28 + movs r0, 0x1 + strh r0, [r4, 0x22] + movs r0, 0x6 + strh r0, [r4, 0x8] + strh r2, [r4, 0xA] + b _08108AB8 +_08108A28: + strh r2, [r4, 0xA] + b _08108AAA +_08108A2C: + adds r0, r4, 0 + bl sub_8108AC0 + movs r0, 0x16 + ldrsh r1, [r4, r0] + lsls r1, 1 + ldrh r0, [r4, 0x14] + subs r0, r1 + strh r0, [r4, 0x14] + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _08108AB8 + b _08108AAA +_08108A4E: + adds r0, r4, 0 + bl sub_8108AC0 + movs r1, 0x16 + ldrsh r0, [r4, r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 1 + ldrh r0, [r4, 0x12] + subs r0, r1 + strh r0, [r4, 0x12] + adds r0, 0x10 + lsls r0, 16 + movs r1, 0x88 + lsls r1, 17 + cmp r0, r1 + bls _08108AB8 + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + movs r0, 0 + strh r0, [r4, 0xA] + b _08108AAA +_08108A7C: + adds r0, r4, 0 + bl sub_8108AC0 + movs r0, 0x16 + ldrsh r1, [r4, r0] + lsls r1, 1 + ldrh r0, [r4, 0x14] + subs r0, r1 + strh r0, [r4, 0x14] + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _08108AB8 + movs r0, 0x2 + strh r0, [r4, 0x8] + b _08108AB8 +_08108AA2: + movs r1, 0x18 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08108AB8 +_08108AAA: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08108AB8 +_08108AB2: + adds r0, r2, 0 + bl move_anim_task_del +_08108AB8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8108978 + + thumb_func_start sub_8108AC0 +sub_8108AC0: @ 8108AC0 + push {r4-r6,lr} + adds r6, r0, 0 + ldrh r0, [r6, 0xC] + adds r0, 0x1 + strh r0, [r6, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08108B1A + movs r0, 0 + strh r0, [r6, 0xC] + ldr r0, =gUnknown_08595268 + movs r2, 0xE + ldrsh r1, [r6, r2] + movs r3, 0x10 + ldrsh r2, [r6, r3] + movs r3, 0xA + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08108B1A + ldr r5, =0x02020630 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r0, r4, r5 + movs r1, 0x10 + strh r1, [r0, 0x2E] + ldrh r1, [r6, 0x12] + strh r1, [r0, 0x32] + ldrh r1, [r6, 0x14] + strh r1, [r0, 0x36] + ldrh r1, [r6, 0x1A] + strh r1, [r0, 0x38] + bl sub_80A68D4 + adds r5, 0x1C + adds r4, r5 + ldr r0, =sub_8108B2C + str r0, [r4] + ldrh r0, [r6, 0x18] + adds r0, 0x1 + strh r0, [r6, 0x18] +_08108B1A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8108AC0 + + thumb_func_start sub_8108B2C +sub_8108B2C: @ 8108B2C + push {r4-r6,lr} + adds r6, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _08108B86 + ldrh r0, [r6, 0x24] + ldrh r1, [r6, 0x20] + adds r0, r1 + strh r0, [r6, 0x20] + ldrh r0, [r6, 0x26] + ldrh r1, [r6, 0x22] + adds r0, r1 + strh r0, [r6, 0x22] + movs r0, 0x6 + strh r0, [r6, 0x2E] + bl GenerateRandomNumber2 + movs r4, 0x1F + adds r1, r4, 0 + ands r1, r0 + ldr r5, =0x0000fff0 + adds r1, r5 + ldrh r0, [r6, 0x20] + adds r1, r0 + strh r1, [r6, 0x32] + bl GenerateRandomNumber2 + ands r4, r0 + adds r4, r5 + ldrh r1, [r6, 0x22] + adds r4, r1 + strh r4, [r6, 0x36] + bl GenerateRandomNumber2 + movs r1, 0x7 + ands r1, r0 + mvns r1, r1 + strh r1, [r6, 0x38] + adds r0, r6, 0 + bl sub_80A68D4 + ldr r0, =sub_8108B94 + str r0, [r6, 0x1C] +_08108B86: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8108B2C + + thumb_func_start sub_8108B94 +sub_8108B94: @ 8108B94 + push {r4-r6,lr} + adds r5, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _08108BD0 + movs r4, 0 + ldr r6, =0x03005e00 +_08108BA6: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r6 + ldr r1, [r2] + ldr r0, =sub_8108978 + cmp r1, r0 + bne _08108BC6 + movs r0, 0x1 + strh r0, [r2, 0x1C] + ldrh r0, [r2, 0x18] + subs r0, 0x1 + strh r0, [r2, 0x18] + adds r0, r5, 0 + bl RemoveObjectAndFreeTiles +_08108BC6: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0xF + bls _08108BA6 +_08108BD0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8108B94 + + thumb_func_start sub_8108BE0 +sub_8108BE0: @ 8108BE0 + ldr r2, =0x0203841e + ldrh r1, [r2] + strh r1, [r0, 0x20] + ldrh r1, [r2, 0x2] + strh r1, [r0, 0x22] + ldrh r1, [r2, 0x4] + strh r1, [r0, 0x2E] + ldrh r1, [r2, 0x6] + strh r1, [r0, 0x30] + ldrh r1, [r2, 0x8] + strh r1, [r0, 0x32] + ldrh r1, [r2, 0xA] + strh r1, [r0, 0x34] + ldr r1, =sub_8108C08 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_8108BE0 + + thumb_func_start sub_8108C08 +sub_8108C08: @ 8108C08 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x2E] + subs r0, r1 + strh r0, [r4, 0x36] + movs r1, 0x36 + ldrsh r0, [r4, r1] + movs r1, 0xA + bl __divsi3 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + ldrh r2, [r4, 0x38] + adds r0, r2 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r2, 0x32 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x34] + subs r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + cmp r0, 0 + bne _08108C4C + adds r0, r4, 0 + bl move_anim_8072740 +_08108C4C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8108C08 + + thumb_func_start sub_8108C54 +sub_8108C54: @ 8108C54 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x34] + adds r0, r1 + strh r0, [r4, 0x34] + ldrh r1, [r4, 0x32] + ldrh r2, [r4, 0x36] + adds r1, r2 + strh r1, [r4, 0x36] + lsls r0, 16 + asrs r0, 23 + strh r0, [r4, 0x24] + lsls r1, 16 + asrs r1, 23 + strh r1, [r4, 0x26] + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + bne _08108C8C + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_08108C8C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8108C54 + + thumb_func_start sub_8108C94 +sub_8108C94: @ 8108C94 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x30] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x34] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x36] + ldr r0, =sub_8108CDC + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8108C94 + + thumb_func_start sub_8108CDC +sub_8108CDC: @ 8108CDC + push {r4-r6,lr} + adds r4, r0, 0 + movs r0, 0x30 + ldrsh r1, [r4, r0] + movs r2, 0x20 + ldrsh r0, [r4, r2] + subs r6, r1, r0 + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r2, 0x22 + ldrsh r0, [r4, r2] + subs r5, r1, r0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + muls r0, r6 + movs r2, 0x34 + ldrsh r1, [r4, r2] + bl __divsi3 + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + muls r0, r5 + movs r2, 0x34 + ldrsh r1, [r4, r2] + bl __divsi3 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x36 + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _08108D34 + movs r0, 0 + strh r0, [r4, 0x38] + adds r0, r4, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_8108D54 +_08108D34: + movs r0, 0x34 + ldrsh r1, [r4, r0] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _08108D46 + adds r0, r4, 0 + bl move_anim_8072740 +_08108D46: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8108CDC + + thumb_func_start sub_8108D54 +sub_8108D54: @ 8108D54 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + adds r4, r1, 0 + adds r5, r2, 0 + movs r2, 0x2E + ldrsh r1, [r0, r2] + lsrs r2, r1, 31 + adds r1, r2 + lsls r1, 15 + lsrs r1, 16 + str r1, [sp] + ldrh r1, [r0, 0x24] + ldrh r3, [r0, 0x20] + adds r1, r3 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + ldrh r1, [r0, 0x26] + ldrh r0, [r0, 0x22] + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + adds r0, r5, r0 + subs r0, 0x5 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + bl GenerateRandomNumber2 + negs r4, r4 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + adds r4, r0 + subs r4, 0x5 + lsls r4, 16 + lsrs r7, r4, 16 + movs r6, 0 + mov r0, r8 + lsls r0, 16 + mov r8, r0 + mov r1, r10 + lsls r1, 16 + str r1, [sp, 0xC] + ldr r2, [sp] + lsls r2, 16 + str r2, [sp, 0x10] + asrs r1, 16 + lsls r0, r7, 16 + asrs r5, r0, 16 + str r0, [sp, 0x14] + negs r3, r5 + str r3, [sp, 0x4] + asrs r0, r2, 16 + adds r1, r0 + lsls r1, 16 + mov r10, r1 +_08108DE2: + ldr r0, =gUnknown_08595310 + mov r2, r8 + asrs r1, r2, 16 + mov r3, r10 + asrs r2, r3, 16 + movs r3, 0x82 + bl AddObjectToFront + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r4, r0, r1 + movs r0, 0x14 + strh r0, [r4, 0x2E] + mov r0, r9 + strh r0, [r4, 0x30] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl sub_80A82E4 + subs r0, 0x1 + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + cmp r5, 0 + bge _08108E30 + mov r1, sp + ldrh r1, [r1, 0x4] + strh r1, [r4, 0x32] + b _08108E32 + .pool +_08108E30: + strh r7, [r4, 0x32] +_08108E32: + lsls r0, r6, 16 + movs r2, 0x80 + lsls r2, 9 + adds r0, r2 + lsrs r6, r0, 16 + cmp r0, 0 + ble _08108DE2 + movs r6, 0 + ldr r3, [sp, 0xC] + asrs r1, r3, 16 + ldr r0, [sp, 0x14] + asrs r5, r0, 16 + negs r2, r5 + str r2, [sp, 0x8] + ldr r3, [sp, 0x10] + asrs r0, r3, 16 + subs r1, r0 + lsls r1, 16 + mov r10, r1 +_08108E58: + ldr r0, =gUnknown_08595310 + mov r2, r8 + asrs r1, r2, 16 + mov r3, r10 + asrs r2, r3, 16 + movs r3, 0x82 + bl AddObjectToFront + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r4, r0, r1 + movs r0, 0x14 + strh r0, [r4, 0x2E] + mov r0, r9 + strh r0, [r4, 0x30] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl sub_80A82E4 + subs r0, 0x1 + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + cmp r5, 0 + ble _08108EA8 + mov r1, sp + ldrh r1, [r1, 0x8] + strh r1, [r4, 0x32] + b _08108EAA + .pool +_08108EA8: + strh r7, [r4, 0x32] +_08108EAA: + lsls r0, r6, 16 + movs r2, 0x80 + lsls r2, 9 + adds r0, r2 + lsrs r6, r0, 16 + cmp r0, 0 + ble _08108E58 + 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_8108D54 + + thumb_func_start sub_8108EC8 +sub_8108EC8: @ 8108EC8 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0203841e + ldrh r0, [r0] + strh r0, [r4, 0x2E] + movs r0, 0x3C + strh r0, [r4, 0x30] + movs r0, 0x9 + strh r0, [r4, 0x32] + movs r0, 0x1E + strh r0, [r4, 0x34] + movs r0, 0xFE + lsls r0, 8 + strh r0, [r4, 0x36] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r1, =sub_80A634C + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8108EC8 + + thumb_func_start sub_8108F08 +sub_8108F08: @ 8108F08 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x0203841e + movs r0, 0 + ldrsh r1, [r5, r0] + adds r0, r4, 0 + bl sub_80A6864 + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldrh r0, [r5, 0x8] + strh r0, [r4, 0x2E] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x30] + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x32] + ldr r0, =sub_80A656C + str r0, [r4, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8108F08 + + thumb_func_start sub_8108F4C +sub_8108F4C: @ 8108F4C + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6838 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08108F88 + ldr r2, =0x0203841e + ldrh r0, [r4, 0x20] + ldrh r1, [r2] + subs r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r2, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldrh r0, [r2, 0x8] + negs r0, r0 + strh r0, [r4, 0x32] + adds r1, r2, 0 + b _08108F9E + .pool +_08108F88: + ldr r1, =0x0203841e + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x32] +_08108F9E: + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x36] + ldrh r0, [r1, 0xA] + strh r0, [r4, 0x34] + ldr r0, =sub_8109028 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8108F4C + + thumb_func_start sub_8108FBC +sub_8108FBC: @ 8108FBC + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08108FF0 + ldr r2, =0x0203841e + ldrh r0, [r4, 0x20] + ldrh r1, [r2] + subs r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r2, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldrh r0, [r2, 0x8] + strh r0, [r4, 0x32] + adds r1, r2, 0 + b _08109008 + .pool +_08108FF0: + ldr r1, =0x0203841e + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + ldrh r0, [r1, 0x8] + negs r0, r0 + strh r0, [r4, 0x32] +_08109008: + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x36] + ldrh r0, [r1, 0xA] + strh r0, [r4, 0x34] + ldr r0, =sub_8109028 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8108FBC + + thumb_func_start sub_8109028 +sub_8109028: @ 8109028 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x36 + ldrsh r1, [r2, r3] + cmp r0, r1 + bge _0810904E + ldrh r0, [r2, 0x32] + ldrh r1, [r2, 0x24] + adds r0, r1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x34] + ldrh r3, [r2, 0x26] + adds r0, r3 + strh r0, [r2, 0x26] +_0810904E: + movs r0, 0x2E + ldrsh r1, [r2, r0] + movs r3, 0x30 + ldrsh r0, [r2, r3] + cmp r1, r0 + bne _08109060 + adds r0, r2, 0 + bl move_anim_8074EE0 +_08109060: + pop {r0} + bx r0 + thumb_func_end sub_8109028 + + thumb_func_start sub_8109064 +sub_8109064: @ 8109064 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6838 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08109090 + ldr r0, =0x0203841e + ldrh r1, [r4, 0x20] + ldrh r2, [r0] + subs r1, r2 + strh r1, [r4, 0x20] + b _081090A2 + .pool +_08109090: + ldr r0, =0x0203841e + ldrh r1, [r0] + ldrh r2, [r4, 0x20] + adds r1, r2 + strh r1, [r4, 0x20] + adds r2, r4, 0 + adds r2, 0x43 + movs r1, 0x8 + strb r1, [r2] +_081090A2: + adds r2, r0, 0 + ldrh r0, [r2, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + movs r1, 0 + strh r0, [r4, 0x22] + ldrh r0, [r2, 0x4] + strh r0, [r4, 0x2E] + ldrh r0, [r2, 0x6] + strh r0, [r4, 0x30] + ldrh r0, [r2, 0x8] + strh r0, [r4, 0x32] + ldrh r0, [r2, 0xA] + strh r0, [r4, 0x34] + ldrh r0, [r2, 0xC] + strh r0, [r4, 0x36] + strh r1, [r4, 0x38] + ldr r0, =sub_81090D8 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8109064 + + thumb_func_start sub_81090D8 +sub_81090D8: @ 81090D8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08109160 + movs r2, 0x38 + ldrsh r1, [r4, r2] + ldr r0, =0x00002710 + cmp r1, r0 + ble _081090F6 + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1 + strb r0, [r1] +_081090F6: + movs r1, 0x2E + ldrsh r0, [r4, r1] + ldrh r1, [r4, 0x38] + lsls r1, 16 + asrs r1, 24 + ldrh r2, [r4, 0x30] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + ldrh r1, [r4, 0x38] + lsls r1, 16 + asrs r1, 24 + ldrh r2, [r4, 0x30] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + ldrh r2, [r4, 0x2E] + adds r1, r0, r2 + strh r1, [r4, 0x2E] + ldrh r0, [r4, 0x36] + ldrh r2, [r4, 0x38] + adds r0, r2 + strh r0, [r4, 0x38] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _0810914C + ldr r2, =0xffffff00 + b _08109154 + .pool +_0810914C: + cmp r0, 0 + bge _08109158 + movs r2, 0x80 + lsls r2, 1 +_08109154: + adds r0, r1, r2 + strh r0, [r4, 0x2E] +_08109158: + ldrh r0, [r4, 0x34] + subs r0, 0x1 + strh r0, [r4, 0x34] + b _08109166 +_08109160: + adds r0, r4, 0 + bl move_anim_8074EE0 +_08109166: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81090D8 + + thumb_func_start sub_810916C +sub_810916C: @ 810916C + push {lr} + movs r1, 0 + strh r1, [r0, 0x20] + strh r1, [r0, 0x22] + movs r1, 0x3C + strh r1, [r0, 0x2E] + movs r1, 0x8C + strh r1, [r0, 0x32] + movs r1, 0x50 + strh r1, [r0, 0x36] + ldr r1, =sub_80A6EEC + str r1, [r0, 0x1C] + ldr r1, =move_anim_8072740 + bl oamt_set_x3A_32 + pop {r0} + bx r0 + .pool + thumb_func_end sub_810916C + + thumb_func_start sub_8109198 +sub_8109198: @ 8109198 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r5, =0x02038436 + ldrb r0, [r5] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _081091DE + movs r0, 0x2 + bl battle_get_side_with_given_state + ldrb r1, [r5] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + beq _081091D6 + movs r0, 0x3 + bl battle_get_side_with_given_state + ldrb r1, [r5] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + bne _081091DE +_081091D6: + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_081091DE: + ldr r1, =sub_80A7938 + str r1, [r6, 0x1C] + adds r0, r6, 0 + bl _call_via_r1 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8109198 + + thumb_func_start sub_8109200 +sub_8109200: @ 8109200 + ldr r2, =0x0203841e + ldrh r1, [r2] + negs r1, r1 + strh r1, [r2] + ldrh r1, [r2, 0x4] + negs r1, r1 + strh r1, [r2, 0x4] + ldr r1, =sub_80A7938 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_8109200 + + thumb_func_start sub_810921C +sub_810921C: @ 810921C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, =0x0203841e + ldrh r0, [r0, 0x4] + movs r1, 0 + strh r0, [r4, 0x3C] + strh r1, [r4, 0x2E] + ldr r0, =sub_8109244 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810921C + + thumb_func_start sub_8109244 +sub_8109244: @ 8109244 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_8109338 + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x12 + bne _0810928E + movs r0, 0x19 + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x30] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r0, =sub_810929C + str r0, [r5, 0x1C] +_0810928E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8109244 + + thumb_func_start sub_810929C +sub_810929C: @ 810929C + push {r4-r6,lr} + adds r6, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _081092E4 + movs r4, 0 + strh r4, [r6, 0x2E] + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x22] + strh r4, [r6, 0x26] + strh r4, [r6, 0x24] + ldr r1, =sub_8109314 + str r1, [r6, 0x1C] + adds r0, r6, 0 + bl _call_via_r1 + b _0810930E + .pool +_081092E4: + movs r1, 0x3C + ldrsh r0, [r6, r1] + movs r1, 0x1C + bl sine + ldrh r1, [r6, 0x24] + adds r0, r1 + strh r0, [r6, 0x24] + movs r1, 0x3C + ldrsh r0, [r6, r1] + movs r1, 0x1C + bl cosine + ldrh r1, [r6, 0x26] + adds r0, r1 + strh r0, [r6, 0x26] + ldrh r0, [r6, 0x3C] + adds r0, 0x14 + movs r1, 0xFF + ands r0, r1 + strh r0, [r6, 0x3C] +_0810930E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_810929C + + thumb_func_start sub_8109314 +sub_8109314: @ 8109314 + push {r4,lr} + adds r4, r0, 0 + bl sub_8109338 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _08109330 + adds r0, r4, 0 + bl move_anim_8072740 +_08109330: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8109314 + + thumb_func_start sub_8109338 +sub_8109338: @ 8109338 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x1C + bl sine + strh r0, [r4, 0x24] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x1C + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3C] + adds r0, 0x14 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x3C] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8109338 + + thumb_func_start sub_8109364 +sub_8109364: @ 8109364 + push {r4,lr} + adds r4, r0, 0 + ldr r1, =0x0203841e + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x32] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A653C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8109364 + + thumb_func_start sub_81093A4 +sub_81093A4: @ 81093A4 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x2E] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_80A64B0 + str r0, [r4, 0x1C] + ldr r1, =sub_81093E4 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81093A4 + + thumb_func_start sub_81093E4 +sub_81093E4: @ 81093E4 + push {lr} + adds r3, r0, 0 + adds r3, 0x3E + ldrb r2, [r3] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r3] + ldrh r1, [r0, 0x30] + movs r2, 0 + strh r1, [r0, 0x2E] + strh r2, [r0, 0x30] + ldr r1, =sub_810940C + str r1, [r0, 0x1C] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81093E4 + + thumb_func_start sub_810940C +sub_810940C: @ 810940C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x30 + ldrsh r0, [r4, r1] + ldrh r1, [r4, 0x32] + lsls r1, 16 + asrs r1, 24 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + ldrh r1, [r4, 0x32] + lsls r1, 16 + asrs r1, 24 + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0xA + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x32] + adds r0, 0xD0 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _08109458 + adds r0, r4, 0 + bl move_anim_8072740 +_08109458: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810940C + + thumb_func_start sub_8109460 +sub_8109460: @ 8109460 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r4, 0x26] + strh r5, [r4, 0x8] + strh r5, [r4, 0xA] + strh r5, [r4, 0xC] + strh r5, [r4, 0xE] + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x22] + strh r0, [r4, 0x10] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x12] + strh r5, [r4, 0x14] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_80A7270 + ldr r0, =sub_81094D0 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8109460 + + thumb_func_start sub_81094D0 +sub_81094D0: @ 81094D0 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x6 + bls _081094EC + b _081097AA +_081094EC: + lsls r0, 2 + ldr r1, =_08109500 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08109500: + .4byte _0810951C + .4byte _08109542 + .4byte _081095F4 + .4byte _08109654 + .4byte _08109672 + .4byte _08109748 + .4byte _0810979C +_0810951C: + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + movs r3, 0x80 + lsls r3, 1 + movs r0, 0xE0 + str r0, [sp] + movs r0, 0x80 + lsls r0, 2 + str r0, [sp, 0x4] + movs r0, 0x20 + str r0, [sp, 0x8] + adds r0, r4, 0 + adds r2, r3, 0 + bl sub_80A805C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_08109542: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0810958A + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08109578 + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3 + b _08109588 + .pool +_08109578: + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000fffd +_08109588: + strh r1, [r0, 0x24] +_0810958A: + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081095B8 + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _081095B8 + movs r0, 0 + strh r0, [r4, 0xE] + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + adds r1, 0x1 + strh r1, [r0, 0x22] +_081095B8: + adds r0, r4, 0 + bl sub_80A80C8 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _081095C8 + b _081097AA +_081095C8: + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A7E6C + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x24] + strh r5, [r4, 0xA] + strh r5, [r4, 0xC] + strh r5, [r4, 0xE] + b _08109790 + .pool +_081095F4: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bgt _08109604 + b _081097AA +_08109604: + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0810962E + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + movs r3, 0x80 + lsls r3, 2 + movs r0, 0xC0 + lsls r0, 1 + str r0, [sp] + movs r0, 0xF0 + str r0, [sp, 0x4] + movs r0, 0x6 + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r2, 0xE0 + bl sub_80A805C + b _0810964E +_0810962E: + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + movs r3, 0x80 + lsls r3, 2 + movs r0, 0xC0 + lsls r0, 1 + str r0, [sp] + movs r0, 0xC0 + str r0, [sp, 0x4] + movs r0, 0x6 + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r2, 0xE0 + bl sub_80A805C +_0810964E: + movs r0, 0 + strh r0, [r4, 0xA] + b _08109790 +_08109654: + adds r0, r4, 0 + bl sub_80A80C8 + lsls r0, 24 + cmp r0, 0 + beq _08109662 + b _081097AA +_08109662: + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + adds r1, r5, 0 + movs r2, 0x6 + bl sub_81097B4 + b _08109790 +_08109672: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081096C0 + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081096AC + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + adds r1, 0x3 + b _081096BE + .pool +_081096AC: + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + subs r1, 0x3 +_081096BE: + strh r1, [r0, 0x26] +_081096C0: + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x18 + ble _081097AA + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081096FC + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + movs r2, 0xC0 + lsls r2, 1 + movs r0, 0x80 + lsls r0, 1 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x8 + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r3, 0xF0 + bl sub_80A805C + b _0810971A + .pool +_081096FC: + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + movs r2, 0xC0 + lsls r2, 1 + movs r0, 0x80 + lsls r0, 1 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x8 + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r3, 0xC0 + bl sub_80A805C +_0810971A: + ldrh r1, [r4, 0xC] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08109738 + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + subs r1, 0x3 + strh r1, [r0, 0x26] +_08109738: + movs r0, 0 + strh r0, [r4, 0xA] + strh r0, [r4, 0xC] + strh r0, [r4, 0xE] + b _08109790 + .pool +_08109748: + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08109764 + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + subs r1, 0x1 + strh r1, [r0, 0x22] +_08109764: + adds r0, r4, 0 + bl sub_80A80C8 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081097AA + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x10] + strh r1, [r0, 0x22] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A7344 + strh r5, [r4, 0xC] +_08109790: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _081097AA + .pool +_0810979C: + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081097AA + adds r0, r5, 0 + bl move_anim_task_del +_081097AA: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81094D0 + + thumb_func_start sub_81097B4 +sub_81097B4: @ 81097B4 + 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 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + adds r0, r4, 0 + bl sub_8109930 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrh r4, [r0, 0x20] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810980C + adds r0, r4, 0 + subs r0, 0xC + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x1 + b _08109816 + .pool +_0810980C: + adds r0, r4, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0xFF +_08109816: + movs r6, 0 + movs r5, 0 + lsls r4, 16 + str r4, [sp, 0x8] + mov r1, r9 + lsls r1, 16 + str r1, [sp, 0x4] + ldr r2, =gUnknown_085955CC + mov r9, r2 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r3, r8 + lsls r3, 1 + mov r10, r3 +_08109834: + ldr r0, =gUnknown_085955B4 + ldr r2, [sp, 0x8] + asrs r1, r2, 16 + ldr r3, [sp, 0x4] + asrs r2, r3, 16 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _081098B6 + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r4, r0, r1 + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + lsls r0, r5, 2 + adds r0, 0x40 + adds r1, r0 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r1, r0 + ldr r3, =0xfffffc00 + adds r0, r3, 0 + ands r2, r0 + orrs r2, r1 + strh r2, [r4, 0x4] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x4 + bls _0810987E + movs r5, 0 +_0810987E: + lsls r2, r6, 2 + mov r1, r9 + adds r0, r2, r1 + ldrh r0, [r0] + ldr r3, [sp] + adds r1, r0, 0 + muls r1, r3 + lsls r1, 16 + asrs r1, 16 + ldr r0, =gUnknown_085955CE + adds r2, r0 + movs r3, 0 + ldrsh r2, [r2, r3] + adds r0, r4, 0 + bl sub_8109984 + strh r7, [r4, 0x3A] + mov r0, r8 + strh r0, [r4, 0x3C] + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + add r0, r10 + ldr r1, =0x03005e08 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] +_081098B6: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x6 + bls _08109834 + 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_81097B4 + + thumb_func_start sub_81098EC +sub_81098EC: @ 81098EC + push {r4,lr} + adds r4, r0, 0 + bl sub_81099A0 + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08109926 + ldr r3, =0x03005e00 + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x3A + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_08109926: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81098EC + + thumb_func_start sub_8109930 +sub_8109930: @ 8109930 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r2, [r1, 0x26] + ldrh r0, [r1, 0x22] + adds r2, r0 + adds r1, 0x29 + movs r0, 0 + ldrsb r0, [r1, r0] + adds r0, r2 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08109970 + lsls r0, r4, 16 + movs r1, 0x94 + lsls r1, 15 + b _08109976 + .pool +_08109970: + lsls r0, r4, 16 + movs r1, 0xB0 + lsls r1, 14 +_08109976: + adds r0, r1 + lsrs r4, r0, 16 + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8109930 + + thumb_func_start sub_8109984 +sub_8109984: @ 8109984 + movs r3, 0 + strh r3, [r0, 0x2E] + strh r3, [r0, 0x30] + ldrh r3, [r0, 0x20] + lsls r3, 3 + strh r3, [r0, 0x32] + ldrh r3, [r0, 0x22] + lsls r3, 3 + strh r3, [r0, 0x34] + lsls r1, 3 + strh r1, [r0, 0x36] + lsls r2, 3 + strh r2, [r0, 0x38] + bx lr + thumb_func_end sub_8109984 + + thumb_func_start sub_81099A0 +sub_81099A0: @ 81099A0 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _081099CA + movs r0, 0 + strh r0, [r2, 0x2E] + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + ldrh r0, [r2, 0x30] + adds r1, r0, 0 + muls r1, r0 + adds r0, r1, 0 + ldrh r3, [r2, 0x34] + adds r0, r3 + strh r0, [r2, 0x34] +_081099CA: + ldrh r0, [r2, 0x36] + ldrh r1, [r2, 0x32] + adds r0, r1 + strh r0, [r2, 0x32] + lsls r0, 16 + asrs r0, 19 + strh r0, [r2, 0x20] + ldrh r1, [r2, 0x38] + ldrh r3, [r2, 0x34] + adds r1, r3 + strh r1, [r2, 0x34] + lsls r1, 16 + asrs r3, r1, 19 + strh r3, [r2, 0x22] + adds r0, 0x8 + lsls r0, 16 + movs r1, 0x80 + lsls r1, 17 + cmp r0, r1 + bhi _08109A00 + adds r1, r3, 0 + movs r0, 0x8 + negs r0, r0 + cmp r1, r0 + blt _08109A00 + cmp r1, 0x78 + ble _08109A0C +_08109A00: + adds r0, r2, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_08109A0C: + pop {r0} + bx r0 + thumb_func_end sub_81099A0 + + thumb_func_start sub_8109A10 +sub_8109A10: @ 8109A10 + push {r4,r5,lr} + ldr r3, =0x0203841e + ldrh r1, [r3] + movs r2, 0 + strh r1, [r0, 0x20] + ldrh r1, [r3, 0x2] + strh r1, [r0, 0x22] + strh r2, [r0, 0x2E] + strh r2, [r0, 0x30] + strh r2, [r0, 0x32] + ldrh r1, [r3, 0x4] + strh r1, [r0, 0x3A] + ldrh r1, [r3, 0x6] + strh r1, [r0, 0x3C] + ldrh r4, [r0, 0x4] + lsls r2, r4, 22 + lsrs r2, 22 + movs r5, 0x8 + ldrsh r1, [r3, r5] + lsls r1, 4 + adds r2, r1 + ldr r3, =0x000003ff + adds r1, r3, 0 + ands r2, r1 + ldr r1, =0xfffffc00 + ands r1, r4 + orrs r1, r2 + strh r1, [r0, 0x4] + ldr r1, =sub_8109A64 + str r1, [r0, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8109A10 + + thumb_func_start sub_8109A64 +sub_8109A64: @ 8109A64 + push {r4,lr} + adds r2, r0, 0 + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0x1 + beq _08109A96 + cmp r0, 0x1 + bgt _08109A7A + cmp r0, 0 + beq _08109A80 + b _08109AF4 +_08109A7A: + cmp r0, 0x2 + beq _08109AB4 + b _08109AF4 +_08109A80: + ldrh r1, [r2, 0x3A] + movs r3, 0x3A + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _08109A90 + subs r0, r1, 0x1 + strh r0, [r2, 0x3A] + b _08109AF4 +_08109A90: + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] +_08109A96: + ldrh r0, [r2, 0x22] + adds r0, 0x8 + strh r0, [r2, 0x22] + lsls r0, 16 + asrs r0, 16 + ldrh r3, [r2, 0x3C] + movs r4, 0x3C + ldrsh r1, [r2, r4] + cmp r0, r1 + blt _08109AF4 + strh r3, [r2, 0x22] + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + b _08109AF4 +_08109AB4: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08109AE0 + movs r0, 0 + strh r0, [r2, 0x30] + ldrh r0, [r2, 0x32] + adds r0, 0x1 + strh r0, [r2, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08109ADC + ldr r0, =0x0000fffd + b _08109ADE + .pool +_08109ADC: + movs r0, 0x3 +_08109ADE: + strh r0, [r2, 0x26] +_08109AE0: + ldrh r0, [r2, 0x34] + adds r0, 0x1 + strh r0, [r2, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _08109AF4 + adds r0, r2, 0 + bl move_anim_8072740 +_08109AF4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8109A64 + + thumb_func_start sub_8109AFC +sub_8109AFC: @ 8109AFC + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _08109B70 + cmp r0, 0x1 + bgt _08109B12 + cmp r0, 0 + beq _08109B18 + b _08109C3E +_08109B12: + cmp r0, 0x2 + beq _08109BCE + b _08109C3E +_08109B18: + adds r0, r5, 0 + movs r1, 0 + bl sub_80A69CC + ldr r4, =0x0203841e + ldrb r1, [r4, 0x4] + adds r0, r5, 0 + bl StartObjectImageAnim + ldrh r0, [r4, 0x4] + strh r0, [r5, 0x3C] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08109B48 + movs r0, 0x4 + b _08109B4A + .pool +_08109B48: + ldr r0, =0x0000fffc +_08109B4A: + strh r0, [r5, 0x36] + ldr r0, =0x02038437 + ldrb r0, [r0] + bl sub_80A8328 + movs r1, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r5, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + b _08109BC6 + .pool +_08109B70: + ldrh r0, [r5, 0x30] + adds r0, 0xC0 + strh r0, [r5, 0x30] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08109B94 + ldrh r0, [r5, 0x30] + lsls r0, 16 + asrs r0, 24 + negs r0, r0 + b _08109B9A + .pool +_08109B94: + ldrh r0, [r5, 0x30] + lsls r0, 16 + asrs r0, 24 +_08109B9A: + strh r0, [r5, 0x26] + movs r2, 0x32 + ldrsh r0, [r5, r2] + movs r2, 0x36 + ldrsh r1, [r5, r2] + bl sine + strh r0, [r5, 0x24] + ldrh r0, [r5, 0x32] + adds r0, 0x4 + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x34] + adds r0, 0x1 + strh r0, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _08109C3E + movs r0, 0 + strh r0, [r5, 0x34] +_08109BC6: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + b _08109C3E +_08109BCE: + movs r1, 0x32 + ldrsh r0, [r5, r1] + movs r2, 0x36 + ldrsh r1, [r5, r2] + bl sine + adds r2, r0, 0 + movs r3, 0 + strh r2, [r5, 0x24] + ldrh r0, [r5, 0x32] + adds r0, 0x4 + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x34] + adds r0, 0x1 + strh r0, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _08109C3E + ldrh r0, [r5, 0x20] + adds r1, r2, r0 + strh r1, [r5, 0x20] + ldrh r0, [r5, 0x26] + ldrh r2, [r5, 0x22] + adds r0, r2 + strh r0, [r5, 0x22] + strh r3, [r5, 0x26] + strh r3, [r5, 0x24] + movs r0, 0x80 + lsls r0, 1 + strh r0, [r5, 0x2E] + strh r1, [r5, 0x30] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl sub_80A6FD4 + ldr r0, =sub_8109C4C + str r0, [r5, 0x1C] +_08109C3E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8109AFC + + thumb_func_start sub_8109C4C +sub_8109C4C: @ 8109C4C + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + bne _08109CA4 + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0x10 + bl sine + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + ldrh r2, [r4, 0x38] + adds r0, r2, 0x4 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x38] + lsls r2, 16 + asrs r2, 16 + cmp r2, 0 + beq _08109C82 + cmp r2, 0xC4 + ble _08109CAA +_08109C82: + lsls r0, 16 + cmp r0, 0 + ble _08109CAA + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08109CAA + ldr r0, =0x02038440 + movs r1, 0 + ldrsb r1, [r0, r1] + movs r0, 0x90 + bl audio_play_and_stuff + b _08109CAA + .pool +_08109CA4: + adds r0, r4, 0 + bl move_anim_8072740 +_08109CAA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8109C4C + + thumb_func_start sub_8109CB0 +sub_8109CB0: @ 8109CB0 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08109CC8 + ldr r0, =0x0203841e + ldrh r0, [r0] + strh r0, [r4, 0x30] + adds r0, r1, 0x1 + strh r0, [r4, 0x2E] +_08109CC8: + movs r0, 0xC0 + lsls r0, 1 + adds r1, r0, 0 + ldrh r2, [r4, 0x34] + adds r1, r2 + strh r1, [r4, 0x34] + ldrh r0, [r4, 0x36] + adds r0, 0xA0 + strh r0, [r4, 0x36] + movs r2, 0x30 + ldrsh r0, [r4, r2] + lsls r1, 16 + asrs r1, 24 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + ldrh r1, [r4, 0x36] + lsls r1, 16 + asrs r1, 24 + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x7 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08109D64 + ldrh r0, [r4, 0x30] + subs r0, 0x40 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x83 + bls _08109D3C + ldr r0, =0x02038437 + ldrb r0, [r0] + bl sub_80A8328 + movs r1, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x5] + b _08109D80 + .pool +_08109D3C: + ldr r0, =0x02038437 + ldrb r0, [r0] + bl sub_80A8328 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + lsls r0, 2 + ldrb r2, [r4, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x5] + b _08109D80 + .pool +_08109D64: + ldrh r0, [r4, 0x30] + subs r0, 0x40 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x83 + bls _08109D78 + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1D + b _08109D7E +_08109D78: + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1F +_08109D7E: + strb r0, [r1] +_08109D80: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _08109DA8 + 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] +_08109DA8: + movs r2, 0x32 + ldrsh r0, [r4, r2] + cmp r0, 0x1E + bne _08109DB6 + adds r0, r4, 0 + bl move_anim_8072740 +_08109DB6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8109CB0 + + thumb_func_start sub_8109DBC +sub_8109DBC: @ 8109DBC + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r4, r1, r0 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + movs r2, 0x1 + negs r2, r2 + adds r1, r2, 0 + cmp r0, 0 + bne _08109DE2 + movs r1, 0x1 +_08109DE2: + strh r1, [r4, 0x20] + ldr r0, =0x02038437 + ldrb r1, [r0] + movs r0, 0x2 + eors r0, r1 + bl b_side_obj__get_some_boolean + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1 + strh r0, [r4, 0x22] + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x24] + movs r0, 0x3 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + ldr r0, =sub_8109E2C + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8109DBC + + thumb_func_start sub_8109E2C +sub_8109E2C: @ 8109E2C + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r2, r0, r1 + movs r0, 0x8 + ldrsh r3, [r2, r0] + cmp r3, 0x1 + beq _08109EF4 + cmp r3, 0x1 + bgt _08109E54 + cmp r3, 0 + beq _08109E62 + b _0810A054 + .pool +_08109E54: + cmp r3, 0x2 + bne _08109E5A + b _08109F7C +_08109E5A: + cmp r3, 0x3 + bne _08109E60 + b _0810A010 +_08109E60: + b _0810A054 +_08109E62: + movs r1, 0x20 + ldrsh r0, [r2, r1] + lsls r0, 1 + ldrh r5, [r2, 0x1C] + adds r0, r5 + strh r0, [r2, 0x1C] + ldrh r0, [r2, 0xA] + adds r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08109E94 + strh r3, [r2, 0xA] + ldrh r0, [r2, 0xC] + adds r0, 0x1 + strh r0, [r2, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08109E90 + movs r0, 0x2 + b _08109E92 +_08109E90: + ldr r0, =0x0000fffe +_08109E92: + strh r0, [r2, 0x1E] +_08109E94: + movs r1, 0 + strh r1, [r2, 0xE] + movs r7, 0x22 + ldrsh r0, [r2, r7] + cmp r1, r0 + bge _08109ED6 + ldr r4, =0x02020630 + adds r3, r2, 0 + adds r3, 0x8 +_08109EA6: + movs r1, 0xE + ldrsh r0, [r2, r1] + adds r0, 0xE + lsls r0, 1 + adds r0, r3, r0 + movs r5, 0 + ldrsh r0, [r0, r5] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r2, 0x1E] + ldrh r7, [r2, 0x1C] + adds r0, r7 + strh r0, [r1, 0x24] + ldrh r0, [r2, 0xE] + adds r0, 0x1 + strh r0, [r2, 0xE] + lsls r0, 16 + asrs r0, 16 + movs r5, 0x22 + ldrsh r1, [r2, r5] + cmp r0, r1 + blt _08109EA6 +_08109ED6: + ldrh r0, [r2, 0x1A] + adds r0, 0x1 + strh r0, [r2, 0x1A] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + beq _08109EE6 + b _0810A054 +_08109EE6: + movs r0, 0 + strh r0, [r2, 0x1A] + b _0810A000 + .pool +_08109EF4: + ldrh r0, [r2, 0xA] + adds r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _08109F1C + movs r0, 0 + strh r0, [r2, 0xA] + ldrh r0, [r2, 0xC] + adds r0, 0x1 + strh r0, [r2, 0xC] + ands r0, r3 + lsls r0, 16 + cmp r0, 0 + beq _08109F18 + movs r0, 0x2 + b _08109F1A +_08109F18: + ldr r0, =0x0000fffe +_08109F1A: + strh r0, [r2, 0x1E] +_08109F1C: + movs r1, 0 + strh r1, [r2, 0xE] + movs r7, 0x22 + ldrsh r0, [r2, r7] + cmp r1, r0 + bge _08109F5E + ldr r4, =0x02020630 + adds r3, r2, 0 + adds r3, 0x8 +_08109F2E: + movs r1, 0xE + ldrsh r0, [r2, r1] + adds r0, 0xE + lsls r0, 1 + adds r0, r3, r0 + movs r5, 0 + ldrsh r0, [r0, r5] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r2, 0x1E] + ldrh r7, [r2, 0x1C] + adds r0, r7 + strh r0, [r1, 0x24] + ldrh r0, [r2, 0xE] + adds r0, 0x1 + strh r0, [r2, 0xE] + lsls r0, 16 + asrs r0, 16 + movs r5, 0x22 + ldrsh r1, [r2, r5] + cmp r0, r1 + blt _08109F2E +_08109F5E: + ldrh r0, [r2, 0x1A] + adds r0, 0x1 + strh r0, [r2, 0x1A] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x60 + bne _0810A054 + movs r0, 0 + strh r0, [r2, 0x1A] + b _0810A000 + .pool +_08109F7C: + movs r7, 0x20 + ldrsh r1, [r2, r7] + lsls r1, 1 + ldrh r0, [r2, 0x1C] + subs r0, r1 + strh r0, [r2, 0x1C] + ldrh r0, [r2, 0xA] + adds r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08109FB0 + movs r0, 0 + strh r0, [r2, 0xA] + ldrh r0, [r2, 0xC] + adds r0, 0x1 + strh r0, [r2, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08109FAC + strh r3, [r2, 0x1E] + b _08109FB0 +_08109FAC: + ldr r0, =0x0000fffe + strh r0, [r2, 0x1E] +_08109FB0: + movs r1, 0 + strh r1, [r2, 0xE] + movs r3, 0x22 + ldrsh r0, [r2, r3] + cmp r1, r0 + bge _08109FF2 + ldr r4, =0x02020630 + adds r3, r2, 0 + adds r3, 0x8 +_08109FC2: + movs r5, 0xE + ldrsh r0, [r2, r5] + adds r0, 0xE + lsls r0, 1 + adds r0, r3, r0 + movs r7, 0 + ldrsh r0, [r0, r7] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r2, 0x1E] + ldrh r5, [r2, 0x1C] + adds r0, r5 + strh r0, [r1, 0x24] + ldrh r0, [r2, 0xE] + adds r0, 0x1 + strh r0, [r2, 0xE] + lsls r0, 16 + asrs r0, 16 + movs r7, 0x22 + ldrsh r1, [r2, r7] + cmp r0, r1 + blt _08109FC2 +_08109FF2: + ldrh r0, [r2, 0x1A] + adds r0, 0x1 + strh r0, [r2, 0x1A] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + bne _0810A054 +_0810A000: + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + b _0810A054 + .pool +_0810A010: + movs r1, 0 + strh r1, [r2, 0xE] + movs r3, 0x22 + ldrsh r0, [r2, r3] + cmp r1, r0 + bge _0810A04E + ldr r6, =0x02020630 + adds r3, r2, 0 + adds r3, 0x8 + movs r5, 0 +_0810A024: + movs r7, 0xE + ldrsh r0, [r2, r7] + adds r0, 0xE + lsls r0, 1 + adds r0, r3, r0 + movs r7, 0 + ldrsh r1, [r0, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r5, [r0, 0x24] + ldrh r0, [r2, 0xE] + adds r0, 0x1 + strh r0, [r2, 0xE] + lsls r0, 16 + asrs r0, 16 + movs r7, 0x22 + ldrsh r1, [r2, r7] + cmp r0, r1 + blt _0810A024 +_0810A04E: + adds r0, r4, 0 + bl move_anim_task_del +_0810A054: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8109E2C + + thumb_func_start sub_810A060 +sub_810A060: @ 810A060 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x8] + lsls r0, 4 + ldr r1, =0x0203841e + ldrb r2, [r1] + ldrh r3, [r1, 0x2] + movs r1, 0x10 + bl pal_fade_1 + adds r0, r4, 0 + bl move_anim_task_del + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810A060 + + thumb_func_start sub_810A094 +sub_810A094: @ 810A094 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r2, r0, r1 + movs r3, 0x8 + ldrsh r0, [r2, r3] + mov r9, r1 + ldr r4, =0x0203841e + mov r8, r4 + cmp r0, 0 + bne _0810A0CA + ldrh r0, [r4] + strh r0, [r2, 0xA] + ldrh r0, [r4, 0x2] + strh r0, [r2, 0xC] + ldrh r0, [r4, 0x4] + strh r0, [r2, 0xE] + ldrh r0, [r4, 0x6] + strh r0, [r2, 0x10] +_0810A0CA: + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + ldr r1, =0x020241e4 + ldr r0, =0x02038437 + ldrb r0, [r0] + adds r0, r1 + ldrb r6, [r0] + movs r5, 0x10 + ldrsh r0, [r2, r5] + cmp r0, 0 + bne _0810A100 + ldr r4, =gUnknown_08595684 + movs r1, 0x8 + ldrsh r0, [r2, r1] + b _0810A106 + .pool +_0810A100: + ldr r4, =gUnknown_08595694 + movs r3, 0x8 + ldrsh r0, [r2, r3] +_0810A106: + movs r1, 0xA + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + adds r0, r4 + ldrb r5, [r0] + lsls r0, r7, 2 + adds r1, r0, r7 + lsls r1, 3 + add r1, r9 + movs r4, 0xE + ldrsh r1, [r1, r4] + mov r12, r0 + cmp r1, 0x1 + bne _0810A154 + ldr r2, =0x02020630 + lsls r3, r6, 4 + adds r0, r3, r6 + lsls r0, 2 + adds r0, r2 + mov r10, r0 + mov r0, r8 + movs r4, 0x2 + ldrsh r1, [r0, r4] + lsls r0, r5, 24 + asrs r0, 24 + muls r0, r1 + cmp r0, 0 + bge _0810A144 + negs r0, r0 +_0810A144: + mov r5, r10 + strh r0, [r5, 0x26] + b _0810A16E + .pool +_0810A154: + ldr r3, =0x02020630 + lsls r4, r6, 4 + adds r2, r4, r6 + lsls r2, 2 + adds r2, r3 + lsls r0, r5, 24 + asrs r0, 24 + mov r5, r8 + ldrh r1, [r5, 0x2] + muls r0, r1 + strh r0, [r2, 0x24] + adds r2, r3, 0 + adds r3, r4, 0 +_0810A16E: + mov r1, r12 + adds r0, r1, r7 + lsls r0, 3 + add r0, r9 + movs r4, 0x8 + ldrsh r1, [r0, r4] + movs r5, 0xA + ldrsh r0, [r0, r5] + cmp r1, r0 + bne _0810A194 + adds r0, r3, r6 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strh r1, [r0, 0x24] + strh r1, [r0, 0x26] + adds r0, r7, 0 + bl move_anim_task_del +_0810A194: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810A094 + + thumb_func_start sub_810A1A8 +sub_810A1A8: @ 810A1A8 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810A1D0 + ldr r0, =0x0203841e + ldrh r1, [r4, 0x20] + ldrh r2, [r0] + subs r1, r2 + strh r1, [r4, 0x20] + b _0810A1DC + .pool +_0810A1D0: + ldr r1, =0x0203841e + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + adds r0, r1, 0 +_0810A1DC: + ldrh r0, [r0, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r0, =sub_810A1F8 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810A1A8 + + thumb_func_start sub_810A1F8 +sub_810A1F8: @ 810A1F8 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0810A20E + adds r0, r2, 0 + bl move_anim_8072740 +_0810A20E: + pop {r0} + bx r0 + thumb_func_end sub_810A1F8 + + thumb_func_start sub_810A214 +sub_810A214: @ 810A214 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810A23C + ldr r0, =0x0203841e + ldrh r1, [r4, 0x20] + ldrh r0, [r0] + subs r1, r0 + strh r1, [r4, 0x20] + b _0810A246 + .pool +_0810A23C: + ldr r0, =0x0203841e + ldrh r0, [r0] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] +_0810A246: + ldr r0, =sub_810A258 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810A214 + + thumb_func_start sub_810A258 +sub_810A258: @ 810A258 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0810A26E + adds r0, r2, 0 + bl move_anim_8074EE0 +_0810A26E: + pop {r0} + bx r0 + thumb_func_end sub_810A258 + + thumb_func_start sub_810A274 +sub_810A274: @ 810A274 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810A2C4 + ldr r2, =0x0203841e + ldrh r0, [r5, 0x20] + ldrh r1, [r2] + subs r0, r1 + strh r0, [r5, 0x20] + ldrh r0, [r5, 0x22] + ldrh r1, [r2, 0x2] + subs r0, r1 + strh r0, [r5, 0x22] + b _0810A2D8 + .pool +_0810A2C4: + ldr r0, =0x0203841e + ldrh r1, [r0] + ldrh r2, [r5, 0x20] + adds r1, r2 + strh r1, [r5, 0x20] + ldrh r1, [r0, 0x2] + ldrh r2, [r5, 0x22] + adds r1, r2 + strh r1, [r5, 0x22] + adds r2, r0, 0 +_0810A2D8: + movs r0, 0 + strh r0, [r5, 0x2E] + ldrh r0, [r2, 0x4] + strh r0, [r5, 0x30] + ldrh r0, [r2, 0x6] + strh r0, [r5, 0x32] + ldrh r0, [r2, 0x8] + strh r0, [r5, 0x34] + ldr r1, =move_anim_8074EE0 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A62EC + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810A274 + + thumb_func_start sub_810A308 +sub_810A308: @ 810A308 + push {r4-r7,lr} + adds r5, r0, 0 + ldr r0, =0x0203841e + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + beq _0810A380 + cmp r0, 0x1 + bgt _0810A324 + cmp r0, 0 + beq _0810A32E + b _0810A380 + .pool +_0810A324: + cmp r0, 0x2 + beq _0810A338 + cmp r0, 0x3 + beq _0810A35C + b _0810A380 +_0810A32E: + ldr r0, =0x02038436 + b _0810A382 + .pool +_0810A338: + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r6, 0x2 + eors r0, r6 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + bne _0810A354 + ldrb r4, [r4] + b _0810A384 + .pool +_0810A354: + ldrb r0, [r4] + adds r4, r6, 0 + eors r4, r0 + b _0810A384 +_0810A35C: + ldr r0, =0x02038436 + ldrb r0, [r0] + movs r4, 0x2 + eors r0, r4 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810A380 + ldr r0, =0x02038437 + ldrb r0, [r0] + eors r4, r0 + b _0810A384 + .pool +_0810A380: + ldr r0, =0x02038437 +_0810A382: + ldrb r4, [r0] +_0810A384: + ldr r0, =0x0203841e + movs r2, 0xA + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _0810A3AC + adds r0, r4, 0 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + adds r0, r4, 0 + movs r1, 0x1 + b _0810A3BE + .pool +_0810A3AC: + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + adds r0, r4, 0 + movs r1, 0x3 +_0810A3BE: + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldr r7, =gUnknown_08329F40 + ldr r6, =0x0203841e + movs r1, 0 + ldrsh r0, [r6, r1] + lsls r0, 1 + adds r0, r7 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r2, 0x2 + ldrsh r0, [r6, r2] + muls r0, r1 + asrs r0, 8 + strh r0, [r5, 0x24] + movs r1, 0 + ldrsh r0, [r6, r1] + adds r0, 0x40 + lsls r0, 1 + adds r0, r7 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r2, 0x2 + ldrsh r0, [r6, r2] + muls r0, r1 + asrs r0, 8 + strh r0, [r5, 0x26] + ldrh r1, [r6, 0xC] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0810A422 + adds r0, r4, 0 + bl sub_80A8328 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + lsls r0, 2 + ldrb r2, [r5, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0x5] +_0810A422: + ldrb r2, [r5, 0x3] + lsls r2, 26 + lsrs r2, 27 + movs r0, 0x4 + ldrsh r1, [r6, r0] + lsls r0, r1, 1 + adds r0, r7 + ldrh r0, [r0] + ldr r3, =0x02021bc0 + lsls r2, 3 + adds r2, r3 + adds r1, 0x40 + lsls r1, 1 + adds r1, r7 + ldrh r1, [r1] + strh r1, [r2, 0x6] + strh r1, [r2] + strh r0, [r2, 0x2] + lsls r0, 16 + asrs r0, 16 + negs r0, r0 + strh r0, [r2, 0x4] + ldrh r0, [r6, 0x6] + strh r0, [r5, 0x2E] + ldr r0, =sub_810E2C8 + str r0, [r5, 0x1C] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810A308 + + thumb_func_start sub_810A46C +sub_810A46C: @ 810A46C + push {r4-r6,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r5, =0x0203841e + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + ldr r6, =0x02038437 + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + ldrb r0, [r6] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x38] + ldrh r0, [r5, 0xA] + strh r0, [r4, 0x3A] + ldrh r0, [r5, 0x8] + strh r0, [r4, 0x3C] + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + movs r3, 0xC + ldrsh r0, [r5, r3] + lsls r0, 2 + adds r1, r0 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + ldr r1, =sub_810A4F4 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810A46C + + thumb_func_start sub_810A4F4 +sub_810A4F4: @ 810A4F4 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + bne _0810A55E + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl cosine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3A] + ldrh r2, [r4, 0x3C] + adds r0, r2 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x3C] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _0810A564 + 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] + b _0810A564 +_0810A55E: + adds r0, r4, 0 + bl move_anim_8072740 +_0810A564: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810A4F4 + + thumb_func_start sub_810A56C +sub_810A56C: @ 810A56C + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x38] + subs r0, 0x1 + strh r0, [r3, 0x38] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0810A5A4 + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r2, [r0] + 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 + mov r1, r12 + strb r0, [r1] + ldrh r0, [r3, 0x36] + strh r0, [r3, 0x38] +_0810A5A4: + ldrh r0, [r3, 0x34] + subs r1, r0, 0x1 + strh r1, [r3, 0x34] + lsls r0, 16 + cmp r0, 0 + bgt _0810A5B6 + adds r0, r3, 0 + bl move_anim_8072740 +_0810A5B6: + pop {r0} + bx r0 + thumb_func_end sub_810A56C + + thumb_func_start sub_810A5BC +sub_810A5BC: @ 810A5BC + push {r4-r6,lr} + adds r6, r0, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810A5D8 + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810A5E0 +_0810A5D8: + ldr r1, =0x0203841e + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] +_0810A5E0: + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + ldr r4, =0x0203841e + lsrs r0, 24 + ldrh r1, [r4, 0x2] + adds r0, r1 + strh r0, [r6, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x4] + adds r0, r1 + strh r0, [r6, 0x22] + ldrh r0, [r4] + strh r0, [r6, 0x34] + ldrh r0, [r4, 0x6] + strh r0, [r6, 0x36] + strh r0, [r6, 0x38] + ldr r0, =sub_810A56C + str r0, [r6, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810A5BC + + thumb_func_start sub_810A628 +sub_810A628: @ 810A628 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r1, =0x0203841e + ldrh r0, [r1, 0x6] + strh r0, [r5, 0x2E] + movs r2, 0xE + ldrsh r0, [r1, r2] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0810A64C + ldr r0, =0x02038437 + b _0810A64E + .pool +_0810A64C: + ldr r0, =0x02038436 +_0810A64E: + ldrb r6, [r0] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810A666 + adds r0, r6, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810A66E +_0810A666: + ldr r1, =0x0203841e + ldrh r0, [r1] + negs r0, r0 + strh r0, [r1] +_0810A66E: + adds r0, r6, 0 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + ldr r4, =0x0203841e + lsrs r0, 24 + ldrh r3, [r4] + adds r0, r3 + strh r0, [r5, 0x20] + adds r0, r6, 0 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x2] + adds r0, r1 + strh r0, [r5, 0x22] + ldrh r1, [r4, 0xE] + ldr r0, =0x00007fff + ands r0, r1 + strh r0, [r5, 0x36] + ldrh r0, [r4, 0x4] + strh r0, [r5, 0x38] + ldrh r0, [r4, 0xA] + strh r0, [r5, 0x3A] + ldrh r0, [r4, 0x8] + strh r0, [r5, 0x3C] + ldrh r2, [r5, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + movs r3, 0xC + ldrsh r0, [r4, r3] + lsls r0, 2 + adds r1, r0 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + ldr r1, =sub_810A6EC + str r1, [r5, 0x1C] + adds r0, r5, 0 + bl _call_via_r1 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810A628 + + thumb_func_start sub_810A6EC +sub_810A6EC: @ 810A6EC + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3A] + ldrh r1, [r4, 0x3C] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x3C] + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl __modsi3 + cmp r0, 0 + bne _0810A742 + 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] +_0810A742: + ldrh r0, [r4, 0x2E] + subs r1, r0, 0x1 + strh r1, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + bgt _0810A754 + adds r0, r4, 0 + bl move_anim_8072740 +_0810A754: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810A6EC + + thumb_func_start sub_810A75C +sub_810A75C: @ 810A75C + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0 + bl sub_80A6980 + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + ldr r3, =0x0203841e + movs r5, 0x6 + ldrsh r0, [r3, r5] + lsls r0, 2 + adds r1, r0 + ldr r5, =0x000003ff + adds r0, r5, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + movs r1, 0x6 + ldrsh r0, [r3, r1] + cmp r0, 0x1 + bne _0810A7A4 + ldrb r0, [r4, 0x3] + movs r1, 0x3F + negs r1, r1 + ands r1, r0 + movs r0, 0x10 + b _0810A7B2 + .pool +_0810A7A4: + cmp r0, 0x2 + bne _0810A7B6 + ldrb r0, [r4, 0x3] + movs r1, 0x3F + negs r1, r1 + ands r1, r0 + movs r0, 0x20 +_0810A7B2: + orrs r1, r0 + strb r1, [r4, 0x3] +_0810A7B6: + ldr r0, =0x0203841e + ldrh r0, [r0, 0x4] + strh r0, [r4, 0x2E] + ldr r0, =sub_80A64B0 + str r0, [r4, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810A75C + + thumb_func_start sub_810A7DC +sub_810A7DC: @ 810A7DC + push {r4-r6,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r6, =0x02038437 + ldrb r0, [r6] + movs r1, 0 + bl sub_80A5C6C + ldr r1, =0x03005e00 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r1 + lsls r0, 24 + ldr r5, =0x0203841e + lsrs r0, 24 + ldrh r1, [r5] + adds r0, r1 + strh r0, [r4, 0x8] + ldrb r0, [r6] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x2] + adds r0, r1 + strh r0, [r4, 0xA] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0xC] + ldr r0, =sub_810A834 + str r0, [r4] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810A7DC + + thumb_func_start sub_810A834 +sub_810A834: @ 810A834 + 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 + movs r5, 0 + movs r7, 0 + ldr r1, =0x03005e00 + lsls r0, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldrb r2, [r0, 0xC] + str r2, [sp] + ldrh r4, [r0, 0x8] + ldrh r6, [r0, 0xA] + movs r3, 0xC + ldrsh r0, [r0, r3] + mov r10, r1 + cmp r0, 0 + bne _0810A878 + movs r0, 0 + mov r8, r0 + movs r2, 0x1 + movs r1, 0x10 + mov r12, r1 + b _0810A882 + .pool +_0810A878: + movs r2, 0x10 + mov r12, r2 + movs r3, 0x8 + mov r8, r3 + movs r2, 0x4 +_0810A882: + mov r0, r9 + lsls r1, r0, 2 + adds r0, r1, r0 + lsls r0, 3 + add r0, r10 + movs r3, 0x1C + ldrsh r0, [r0, r3] + mov r10, r1 + cmp r0, 0xA + bhi _0810A978 + lsls r0, 2 + ldr r1, =_0810A8A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0810A8A4: + .4byte _0810A8D0 + .4byte _0810A978 + .4byte _0810A8E4 + .4byte _0810A978 + .4byte _0810A904 + .4byte _0810A978 + .4byte _0810A91A + .4byte _0810A978 + .4byte _0810A93C + .4byte _0810A978 + .4byte _0810A970 +_0810A8D0: + ldr r0, =gUnknown_08595828 + lsls r1, r4, 16 + asrs r1, 16 + lsls r2, r6, 16 + asrs r2, 16 + mov r4, r12 + lsls r3, r4, 16 + b _0810A952 + .pool +_0810A8E4: + mov r0, r12 + lsls r3, r0, 17 + mov r1, r8 + adds r0, r1, r2 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, =gUnknown_08595828 + lsls r1, r4, 16 + asrs r1, 16 + lsls r2, r6, 16 + asrs r2, 16 + b _0810A952 + .pool +_0810A904: + mov r3, r12 + lsls r0, r3, 16 + asrs r0, 16 + lsls r3, r0, 1 + adds r3, r0 + lsls r0, r2, 1 + add r0, r8 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + b _0810A946 +_0810A91A: + mov r0, r12 + lsls r3, r0, 18 + lsls r0, r2, 1 + adds r0, r2 + add r0, r8 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, =gUnknown_08595828 + lsls r1, r4, 16 + asrs r1, 16 + lsls r2, r6, 16 + asrs r2, 16 + b _0810A952 + .pool +_0810A93C: + mov r1, r12 + lsls r0, r1, 16 + asrs r0, 16 + lsls r3, r0, 2 + adds r3, r0 +_0810A946: + ldr r0, =gUnknown_08595828 + lsls r1, r4, 16 + asrs r1, 16 + lsls r2, r6, 16 + asrs r2, 16 + lsls r3, 16 +_0810A952: + asrs r3, 16 + adds r2, r3 + lsls r2, 16 + asrs r2, 16 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + b _0810A978 + .pool +_0810A970: + mov r0, r9 + bl move_anim_task_del + b _0810A9BC +_0810A978: + cmp r7, 0 + beq _0810A9AC + ldr r4, =0x02020630 + lsls r3, r5, 4 + adds r3, r5 + lsls r3, 2 + adds r0, r3, r4 + ldrh r5, [r0, 0x4] + lsls r2, r5, 22 + lsrs r2, 22 + add r2, r8 + ldr r6, =0x000003ff + adds r1, r6, 0 + ands r2, r1 + ldr r1, =0xfffffc00 + ands r1, r5 + orrs r1, r2 + strh r1, [r0, 0x4] + mov r1, sp + ldrh r1, [r1] + strh r1, [r0, 0x2E] + adds r4, 0x1C + adds r3, r4 + ldr r1, [r3] + bl _call_via_r1 +_0810A9AC: + ldr r0, =0x03005e00 + mov r1, r10 + add r1, r9 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x1C] + adds r0, 0x1 + strh r0, [r1, 0x1C] +_0810A9BC: + 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_810A834 + + thumb_func_start sub_810A9DC +sub_810A9DC: @ 810A9DC + push {lr} + adds r3, r0, 0 + movs r1, 0x2E + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _0810A9FE + ldrb r1, [r3, 0x1] + movs r2, 0x3F + adds r0, r2, 0 + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r3, 0x1] + ldrb r0, [r3, 0x3] + ands r2, r0 + strb r2, [r3, 0x3] + b _0810AA12 +_0810A9FE: + ldrb r2, [r3, 0x1] + movs r1, 0x3F + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0x1] + ldrb r0, [r3, 0x3] + ands r1, r0 + movs r0, 0x40 + orrs r1, r0 + strb r1, [r3, 0x3] +_0810AA12: + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + bne _0810AA26 + adds r0, r3, 0 + bl RemoveObjectAndFreeTiles +_0810AA26: + pop {r0} + bx r0 + thumb_func_end sub_810A9DC + + thumb_func_start sub_810AA2C +sub_810AA2C: @ 810AA2C + push {r4-r7,lr} + adds r4, r0, 0 + ldr r0, =0x0203841e + ldrh r1, [r0] + ldrh r2, [r4, 0x20] + adds r1, r2 + strh r1, [r4, 0x20] + ldrh r0, [r0, 0x2] + ldrh r3, [r4, 0x22] + adds r0, r3 + strh r0, [r4, 0x22] + ldr r0, =gUnknown_08595840 + adds r1, 0x20 + lsls r1, 16 + asrs r1, 16 + movs r7, 0x22 + ldrsh r2, [r4, r7] + adds r3, r4, 0 + adds r3, 0x43 + ldrb r3, [r3] + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r6, r2, r3 + ldrh r5, [r6, 0x4] + lsls r1, r5, 22 + lsrs r1, 22 + adds r1, 0x8 + ldr r7, =0x000003ff + adds r0, r7, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r5 + orrs r0, r1 + strh r0, [r6, 0x4] + ldr r1, =0x020383fe + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + adds r3, 0x1C + adds r2, r3 + ldr r0, =sub_810AAB0 + str r0, [r2] + str r0, [r4, 0x1C] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810AA2C + + thumb_func_start sub_810AAB0 +sub_810AAB0: @ 810AAB0 + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _0810AAE4 + movs r0, 0 + strh r0, [r3, 0x2E] + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r2, [r0] + 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 + mov r1, r12 + strb r0, [r1] +_0810AAE4: + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x33 + bne _0810AAF8 + adds r0, r3, 0 + bl move_anim_8072740 +_0810AAF8: + pop {r0} + bx r0 + thumb_func_end sub_810AAB0 + + thumb_func_start sub_810AAFC +sub_810AAFC: @ 810AAFC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r5, r1, r0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810AB28 + ldr r4, =0x02038436 + b _0810AB2A + .pool +_0810AB28: + ldr r4, =0x02038437 +_0810AB2A: + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x24] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x26] + ldr r2, =0x0203841e + ldrh r0, [r2, 0x2] + movs r1, 0 + strh r0, [r5, 0x14] + strh r1, [r5, 0x16] + strh r1, [r5, 0x18] + strh r1, [r5, 0x1A] + strh r1, [r5, 0x1C] + ldrh r0, [r2, 0x6] + strh r0, [r5, 0x1E] + strh r1, [r5, 0x20] + ldrh r0, [r2, 0x4] + strh r0, [r5, 0x22] + ldr r0, =sub_810AB78 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810AAFC + + thumb_func_start sub_810AB78 +sub_810AB78: @ 810AB78 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + adds r2, r6, 0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r5, r0, r1 + movs r1, 0x14 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _0810AC78 + ldrh r0, [r5, 0x20] + adds r0, 0x1 + movs r7, 0 + strh r0, [r5, 0x20] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x22 + ldrsh r1, [r5, r2] + cmp r0, r1 + ble _0810AC86 + strh r7, [r5, 0x20] + ldr r0, =gUnknown_085958A8 + movs r3, 0x24 + ldrsh r1, [r5, r3] + movs r3, 0x26 + ldrsh r2, [r5, r3] + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _0810AC86 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + ldr r1, =gUnknown_08595858 + movs r2, 0x1A + ldrsh r0, [r5, r2] + lsls r0, 1 + adds r0, r1 + movs r3, 0 + ldrsb r3, [r0, r3] + ldrh r0, [r4, 0x20] + adds r3, r0 + strh r3, [r4, 0x20] + movs r2, 0x1A + ldrsh r0, [r5, r2] + lsls r0, 1 + adds r1, 0x1 + adds r0, r1 + movs r2, 0 + ldrsb r2, [r0, r2] + ldrh r0, [r4, 0x22] + adds r2, r0 + strh r2, [r4, 0x22] + movs r1, 0x18 + ldrsh r0, [r5, r1] + lsls r1, r0, 2 + adds r1, r0 + movs r0, 0x28 + subs r0, r1 + strh r0, [r4, 0x2E] + strh r3, [r4, 0x30] + ldrh r0, [r5, 0x24] + strh r0, [r4, 0x32] + strh r2, [r4, 0x34] + ldrh r0, [r5, 0x26] + strh r0, [r4, 0x36] + strh r6, [r4, 0x38] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r1, =sub_810ACC0 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A67D8 + str r0, [r4, 0x1C] + ldrh r0, [r5, 0x1A] + adds r0, 0x1 + strh r0, [r5, 0x1A] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + ble _0810AC30 + strh r7, [r5, 0x1A] +_0810AC30: + ldrh r0, [r5, 0x1C] + adds r0, 0x1 + strh r0, [r5, 0x1C] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x1E + ldrsh r1, [r5, r2] + cmp r0, r1 + blt _0810AC52 + strh r7, [r5, 0x1C] + ldrh r1, [r5, 0x18] + movs r3, 0x18 + ldrsh r0, [r5, r3] + cmp r0, 0x5 + bgt _0810AC52 + adds r0, r1, 0x1 + strh r0, [r5, 0x18] +_0810AC52: + ldrh r0, [r5, 0x16] + adds r0, 0x1 + strh r0, [r5, 0x16] + ldrh r0, [r5, 0x14] + subs r0, 0x1 + strh r0, [r5, 0x14] + b _0810AC86 + .pool +_0810AC78: + movs r1, 0x16 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0810AC86 + adds r0, r2, 0 + bl move_anim_task_del +_0810AC86: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_810AB78 + + thumb_func_start sub_810AC8C +sub_810AC8C: @ 810AC8C + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _0810ACB4 + ldr r2, =0x03005e00 + movs r0, 0x38 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0x16] + subs r1, 0x1 + strh r1, [r0, 0x16] + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0810ACB4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810AC8C + + thumb_func_start sub_810ACC0 +sub_810ACC0: @ 810ACC0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl StartObjectImageAnim + ldr r0, =sub_810AC8C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810ACC0 + + thumb_func_start sub_810ACD8 +sub_810ACD8: @ 810ACD8 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810ACF4 + ldr r4, =0x02038436 + b _0810ACF6 + .pool +_0810ACF4: + ldr r4, =0x02038437 +_0810ACF6: + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldr r1, =move_anim_8074EE0 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A67BC + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810ACD8 + + thumb_func_start sub_810AD30 +sub_810AD30: @ 810AD30 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810AD4C + ldr r4, =0x02038436 + b _0810AD4E + .pool +_0810AD4C: + ldr r4, =0x02038437 +_0810AD4E: + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldr r1, =0x0203841e + ldrh r0, [r1, 0x2] + strh r0, [r5, 0x24] + ldrh r0, [r1, 0x4] + strh r0, [r5, 0x26] + ldr r1, =move_anim_8072740 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A67D8 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810AD30 + + thumb_func_start sub_810AD98 +sub_810AD98: @ 810AD98 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x3A] + movs r0, 0x10 + strh r0, [r5, 0x3C] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0810ADE6 + movs r1, 0x3C + ldrsh r0, [r5, r1] + negs r0, r0 + strh r0, [r5, 0x3C] +_0810ADE6: + ldr r0, =sub_810ADF8 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810AD98 + + thumb_func_start sub_810ADF8 +sub_810ADF8: @ 810ADF8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0810AE0A + cmp r0, 0x1 + beq _0810AE20 + b _0810AE50 +_0810AE0A: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + ble _0810AE50 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0810AE50 +_0810AE20: + ldrh r2, [r4, 0x3C] + ldrh r1, [r4, 0x20] + adds r0, r2, r1 + strh r0, [r4, 0x20] + ldr r3, =0x02020630 + movs r0, 0x3A + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x24] + adds r2, r1 + strh r2, [r0, 0x24] + ldrh r0, [r4, 0x20] + adds r0, 0x50 + lsls r0, 16 + movs r1, 0xC8 + lsls r1, 17 + cmp r0, r1 + bls _0810AE50 + adds r0, r4, 0 + bl move_anim_8074EE0 +_0810AE50: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810ADF8 + + thumb_func_start sub_810AE5C +sub_810AE5C: @ 810AE5C + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _0810AEF0 + cmp r0, 0x1 + bgt _0810AE84 + cmp r0, 0 + beq _0810AE90 + b _0810AFC0 + .pool +_0810AE84: + cmp r0, 0x2 + beq _0810AF4C + cmp r0, 0x3 + bne _0810AE8E + b _0810AFA0 +_0810AE8E: + b _0810AFC0 +_0810AE90: + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + movs r6, 0 + strh r0, [r5, 0x26] + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x24] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810AECC + ldr r0, =0x0000ffe0 + strh r0, [r5, 0x24] + movs r0, 0x2 + b _0810AED2 + .pool +_0810AECC: + movs r0, 0x20 + strh r0, [r5, 0x24] + ldr r0, =0x0000fffe +_0810AED2: + strh r0, [r5, 0x22] + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r5, 0x24] + strh r1, [r0, 0x24] + b _0810AF92 + .pool +_0810AEF0: + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0810AFC0 + movs r0, 0 + strh r0, [r5, 0xA] + ldr r4, =0x02020630 + movs r1, 0x26 + ldrsh r0, [r5, r1] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + adds r2, 0x3E + ldrb r3, [r2] + lsls r0, r3, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldrh r1, [r5, 0x24] + movs r2, 0x24 + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _0810AF92 + ldrh r2, [r5, 0x22] + adds r2, r1, r2 + strh r2, [r5, 0x24] + movs r0, 0x26 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r2, [r0, 0x24] + b _0810AFC0 + .pool +_0810AF4C: + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0810AFC0 + movs r0, 0 + strh r0, [r5, 0xA] + ldr r1, =0x02020630 + movs r2, 0x26 + ldrsh r0, [r5, r2] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + adds r2, 0x3E + ldrb r3, [r2] + lsls r0, r3, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r5, 0xC] + adds r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + bne _0810AFC0 +_0810AF92: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _0810AFC0 + .pool +_0810AFA0: + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r5, r0] + 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] + adds r0, r3, 0 + bl move_anim_task_del +_0810AFC0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810AE5C + + thumb_func_start sub_810AFCC +sub_810AFCC: @ 810AFCC + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _0810AFE6 + b _0810B10C +_0810AFE6: + cmp r0, 0x1 + bgt _0810AFF4 + cmp r0, 0 + beq _0810AFFC + b _0810B14E + .pool +_0810AFF4: + cmp r0, 0x2 + bne _0810AFFA + b _0810B140 +_0810AFFA: + b _0810B14E +_0810AFFC: + ldr r4, =0x02038436 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + movs r2, 0x1 + negs r2, r2 + adds r1, r2, 0 + cmp r0, 0 + bne _0810B012 + movs r1, 0x1 +_0810B012: + movs r6, 0 + strh r1, [r5, 0xA] + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r2, [r0, r1] + adds r3, r0, 0 + cmp r2, 0 + beq _0810B048 + cmp r2, 0x4 + beq _0810B070 + ldrh r1, [r3] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0810B0A8 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r5, 0xE] + ldr r0, =0x0000fff0 + b _0810B0B0 + .pool +_0810B048: + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xE] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x12] + movs r2, 0xA + ldrsh r0, [r5, r2] + lsls r0, 7 + adds r0, 0x78 + strh r0, [r5, 0x10] + b _0810B0E6 +_0810B070: + movs r0, 0xA + ldrsh r1, [r5, r0] + lsls r1, 7 + movs r0, 0x78 + subs r0, r1 + strh r0, [r5, 0xE] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x12] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + movs r2, 0xA + ldrsh r1, [r5, r2] + lsls r1, 5 + subs r0, r1 + strh r0, [r5, 0x10] + b _0810B0E6 + .pool +_0810B0A8: + ldr r0, =0x0000fff0 + strh r0, [r5, 0xE] + movs r0, 0x80 + lsls r0, 1 +_0810B0B0: + strh r0, [r5, 0x10] + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _0810B0D0 + movs r2, 0 + ldrsh r0, [r3, r2] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 1 + movs r0, 0x50 + subs r0, r1 + strh r0, [r5, 0x12] + b _0810B0E6 + .pool +_0810B0D0: + movs r0, 0 + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + adds r0, 0x28 + strh r0, [r5, 0x12] + ldrh r1, [r5, 0xE] + ldrh r0, [r5, 0x10] + strh r0, [r5, 0xE] + strh r1, [r5, 0x10] +_0810B0E6: + movs r2, 0xE + ldrsh r1, [r5, r2] + movs r2, 0x10 + ldrsh r0, [r5, r2] + cmp r1, r0 + bge _0810B0FC + movs r1, 0 + movs r0, 0x1 + strh r0, [r5, 0xA] + strh r1, [r5, 0x14] + b _0810B138 +_0810B0FC: + ldr r0, =0x0000ffff + strh r0, [r5, 0xA] + movs r0, 0x3 + strh r0, [r5, 0x14] + b _0810B138 + .pool +_0810B10C: + ldrh r0, [r5, 0xC] + adds r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + ble _0810B14E + movs r0, 0 + strh r0, [r5, 0xC] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_810B154 + lsls r0, 24 + cmp r0, 0 + bne _0810B138 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_810B154 + lsls r0, 24 + cmp r0, 0 + beq _0810B14E +_0810B138: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _0810B14E +_0810B140: + movs r1, 0x16 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0810B14E + adds r0, r4, 0 + bl move_anim_task_del +_0810B14E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_810AFCC + + thumb_func_start sub_810B154 +sub_810B154: @ 810B154 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, =gUnknown_08595A00 + movs r2, 0xE + ldrsh r1, [r4, r2] + movs r3, 0x12 + ldrsh r2, [r4, r3] + movs r3, 0x23 + bl AddObjectToFront + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _0810B18A + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + strh r5, [r0, 0x3A] + movs r1, 0x7 + strh r1, [r0, 0x3C] + ldrh r0, [r4, 0x16] + adds r0, 0x1 + strh r0, [r4, 0x16] +_0810B18A: + ldrh r1, [r4, 0xA] + ldrh r5, [r4, 0x14] + adds r0, r1, r5 + strh r0, [r4, 0x14] + lsls r0, 16 + cmp r0, 0 + bge _0810B19C + movs r0, 0x3 + strh r0, [r4, 0x14] +_0810B19C: + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0x3 + ble _0810B1A8 + movs r0, 0 + strh r0, [r4, 0x14] +_0810B1A8: + movs r3, 0xA + ldrsh r0, [r4, r3] + lsls r0, 4 + ldrh r5, [r4, 0xE] + adds r2, r0, r5 + strh r2, [r4, 0xE] + lsls r0, r1, 16 + asrs r3, r0, 16 + cmp r3, 0x1 + bne _0810B1C8 + lsls r0, r2, 16 + asrs r0, 16 + movs r5, 0x10 + ldrsh r1, [r4, r5] + cmp r0, r1 + bge _0810B1DC +_0810B1C8: + movs r0, 0x1 + negs r0, r0 + cmp r3, r0 + bne _0810B1E8 + lsls r0, r2, 16 + asrs r0, 16 + movs r2, 0x10 + ldrsh r1, [r4, r2] + cmp r0, r1 + bgt _0810B1E8 +_0810B1DC: + movs r0, 0x1 + b _0810B1EA + .pool +_0810B1E8: + movs r0, 0 +_0810B1EA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_810B154 + + thumb_func_start sub_810B1F0 +sub_810B1F0: @ 810B1F0 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + ble _0810B230 + ldr r3, =0x03005e00 + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x3A + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0810B230: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810B1F0 + + thumb_func_start sub_810B23C +sub_810B23C: @ 810B23C + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _0810B24E + cmp r0, 0x1 + beq _0810B280 + b _0810B294 +_0810B24E: + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + adds r0, r5, 0 + movs r1, 0x2 + bl StartObjectRotScalAnim + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + b _0810B294 + .pool +_0810B280: + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0810B294 + adds r0, r5, 0 + bl move_anim_8074EE0 +_0810B294: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_810B23C + + thumb_func_start sub_810B29C +sub_810B29C: @ 810B29C + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x4 + bls _0810B2B6 + b _0810B428 +_0810B2B6: + lsls r0, 2 + ldr r1, =_0810B2C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0810B2C8: + .4byte _0810B2DC + .4byte _0810B36C + .4byte _0810B3A8 + .4byte _0810B404 + .4byte _0810B414 +_0810B2DC: + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x14] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x16] + movs r0, 0x4 + strh r0, [r5, 0x18] + ldr r0, =0x02038437 + ldrb r0, [r0] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x1C] + movs r2, 0x1C + ldrsh r0, [r5, r2] + movs r2, 0x14 + ldrsh r1, [r5, r2] + subs r0, r1 + movs r1, 0x5 + bl __divsi3 + strh r0, [r5, 0x1A] + movs r0, 0x7 + strh r0, [r5, 0x10] + ldr r0, =0x0000ffff + strh r0, [r5, 0x12] + movs r0, 0xC + strh r0, [r5, 0x1E] + subs r0, 0x4C + bl sub_80A5178 + lsls r0, 24 + asrs r0, 24 + strh r0, [r5, 0x20] + movs r0, 0x3F + bl sub_80A5178 + lsls r0, 24 + asrs r0, 24 + strh r0, [r5, 0x22] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x24] + movs r1, 0x22 + ldrsh r0, [r5, r1] + movs r2, 0x20 + ldrsh r1, [r5, r2] + subs r0, r1 + movs r1, 0x3 + bl __divsi3 + strh r0, [r5, 0x26] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + b _0810B426 + .pool +_0810B36C: + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + cmp r0, 0 + ble _0810B39C + movs r0, 0 + strh r0, [r5, 0xA] + adds r0, r5, 0 + adds r1, r2, 0 + bl sub_810B430 + lsls r0, 24 + cmp r0, 0 + beq _0810B39C + movs r1, 0xC + ldrsh r0, [r5, r1] + cmp r0, 0x5 + bne _0810B396 + movs r0, 0x3 + b _0810B39A +_0810B396: + ldrh r0, [r5, 0x8] + adds r0, 0x1 +_0810B39A: + strh r0, [r5, 0x8] +_0810B39C: + ldrh r1, [r5, 0x1E] + movs r2, 0x1E + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _0810B428 + b _0810B41E +_0810B3A8: + ldrh r1, [r5, 0x1E] + movs r2, 0x1E + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _0810B3B6 + subs r0, r1, 0x1 + strh r0, [r5, 0x1E] +_0810B3B6: + ldrh r0, [r5, 0xA] + adds r0, 0x1 + movs r3, 0 + strh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0810B428 + strh r3, [r5, 0xA] + ldrh r1, [r5, 0xC] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0810B3E2 + movs r0, 0x4 + strh r0, [r5, 0x16] + movs r0, 0x44 + strh r0, [r5, 0x18] + strh r3, [r5, 0x10] + strh r2, [r5, 0x12] + b _0810B3F2 +_0810B3E2: + movs r0, 0x44 + strh r0, [r5, 0x16] + movs r0, 0x4 + strh r0, [r5, 0x18] + movs r0, 0x7 + strh r0, [r5, 0x10] + ldr r0, =0x0000ffff + strh r0, [r5, 0x12] +_0810B3F2: + movs r1, 0x1E + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _0810B424 + movs r0, 0x4 + b _0810B426 + .pool +_0810B404: + movs r1, 0xE + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0810B428 + adds r0, r2, 0 + bl move_anim_task_del + b _0810B428 +_0810B414: + ldrh r1, [r5, 0x1E] + movs r2, 0x1E + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _0810B424 +_0810B41E: + subs r0, r1, 0x1 + strh r0, [r5, 0x1E] + b _0810B428 +_0810B424: + movs r0, 0x1 +_0810B426: + strh r0, [r5, 0x8] +_0810B428: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_810B29C + + thumb_func_start sub_810B430 +sub_810B430: @ 810B430 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, =gUnknown_08595A30 + movs r2, 0x14 + ldrsh r1, [r4, r2] + movs r3, 0x16 + ldrsh r2, [r4, r3] + movs r3, 0x23 + bl AddObjectToFront + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _0810B49C + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r3, r0, r1 + ldrh r2, [r3, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + ldrh r6, [r4, 0x10] + adds r1, r6 + ldr r6, =0x000003ff + adds r0, r6, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x4] + ldrh r0, [r4, 0x12] + ldrh r1, [r4, 0x10] + adds r0, r1 + strh r0, [r4, 0x10] + lsls r0, 16 + cmp r0, 0 + bge _0810B484 + movs r0, 0x7 + strh r0, [r4, 0x10] +_0810B484: + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r0, 0x7 + ble _0810B490 + movs r0, 0 + strh r0, [r4, 0x10] +_0810B490: + strh r5, [r3, 0x3A] + movs r0, 0x3 + strh r0, [r3, 0x3C] + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] +_0810B49C: + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r0, 0 + bne _0810B4BE + movs r5, 0x12 + ldrsh r0, [r4, r5] + cmp r0, 0 + ble _0810B4BE + ldrh r1, [r4, 0x26] + ldrh r6, [r4, 0x24] + adds r1, r6 + strh r1, [r4, 0x24] + lsls r1, 24 + asrs r1, 24 + movs r0, 0x76 + bl audio_play_and_stuff +_0810B4BE: + movs r0, 0x12 + ldrsh r3, [r4, r0] + ldrh r2, [r4, 0x16] + cmp r3, 0 + bge _0810B4D4 + lsls r0, r2, 16 + asrs r0, 16 + movs r5, 0x18 + ldrsh r1, [r4, r5] + cmp r0, r1 + ble _0810B4E4 +_0810B4D4: + cmp r3, 0 + ble _0810B508 + lsls r0, r2, 16 + asrs r0, 16 + movs r6, 0x18 + ldrsh r1, [r4, r6] + cmp r0, r1 + blt _0810B508 +_0810B4E4: + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x1A] + ldrh r1, [r4, 0x14] + adds r0, r1 + strh r0, [r4, 0x14] + movs r0, 0x1 + b _0810B514 + .pool +_0810B508: + movs r3, 0x12 + ldrsh r0, [r4, r3] + lsls r0, 3 + adds r0, r2, r0 + strh r0, [r4, 0x16] + movs r0, 0 +_0810B514: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_810B430 + + thumb_func_start sub_810B51C +sub_810B51C: @ 810B51C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + ble _0810B552 + ldr r3, =0x03005e00 + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x3A + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0810B552: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810B51C + + thumb_func_start sub_810B55C +sub_810B55C: @ 810B55C + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _0810B5D8 + cmp r0, 0x1 + bgt _0810B584 + cmp r0, 0 + beq _0810B58A + b _0810B60E + .pool +_0810B584: + cmp r0, 0x2 + beq _0810B600 + b _0810B60E +_0810B58A: + ldr r0, =0x02038437 + ldrb r0, [r0] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x20 + strh r0, [r5, 0x26] + strh r0, [r5, 0x24] + cmp r0, 0x10 + ble _0810B5B4 + adds r2, r0, 0 +_0810B5A4: + adds r1, r2, 0 + subs r1, 0x20 + adds r2, r1, 0 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x10 + bgt _0810B5A4 + strh r1, [r5, 0x24] +_0810B5B4: + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldrb r0, [r4] + bl sub_80A82E4 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x2 + strh r0, [r5, 0x20] + b _0810B5F8 + .pool +_0810B5D8: + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0810B60E + movs r0, 0 + strh r0, [r5, 0xA] + adds r0, r5, 0 + adds r1, r2, 0 + bl sub_810B614 + lsls r0, 24 + cmp r0, 0 + beq _0810B60E +_0810B5F8: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _0810B60E +_0810B600: + movs r1, 0x1C + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0810B60E + adds r0, r2, 0 + bl move_anim_task_del +_0810B60E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_810B55C + + thumb_func_start sub_810B614 +sub_810B614: @ 810B614 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, =gUnknown_085956C0 + movs r2, 0x22 + ldrsh r1, [r4, r2] + movs r3, 0x24 + ldrsh r2, [r4, r3] + ldrh r3, [r4, 0x20] + lsls r3, 24 + lsrs r3, 24 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _0810B658 + ldr r3, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x1C + adds r1, r0, r1 + ldr r2, =sub_810B684 + str r2, [r1] + adds r0, r3 + strh r5, [r0, 0x3A] + movs r1, 0xA + strh r1, [r0, 0x3C] + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] +_0810B658: + ldrh r2, [r4, 0x24] + movs r0, 0x24 + ldrsh r1, [r4, r0] + movs r3, 0x26 + ldrsh r0, [r4, r3] + cmp r1, r0 + bge _0810B67C + adds r0, r2, 0 + adds r0, 0x20 + strh r0, [r4, 0x24] + movs r0, 0 + b _0810B67E + .pool +_0810B67C: + movs r0, 0x1 +_0810B67E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_810B614 + + thumb_func_start sub_810B684 +sub_810B684: @ 810B684 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0810B6B8 + ldr r3, =0x03005e00 + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x3A + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0810B6B8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810B684 + + thumb_func_start sub_810B6C4 +sub_810B6C4: @ 810B6C4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r5, r0, 0 + ldrh r2, [r5, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x7 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r3, r0, 24 + ldrb r0, [r4] + movs r1, 0x3 + str r3, [sp] + bl sub_80A5C6C + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x0203841e + ldrh r0, [r1, 0x8] + strh r0, [r5, 0x2E] + ldrh r0, [r1] + ldr r3, [sp] + adds r0, r3 + strh r0, [r5, 0x30] + ldrh r0, [r1, 0x4] + mov r4, r9 + adds r0, r4, r0 + strh r0, [r5, 0x32] + ldrh r0, [r1, 0x2] + adds r0, r6 + strh r0, [r5, 0x34] + ldrh r0, [r1, 0x6] + mov r7, r8 + adds r0, r7, r0 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl sub_80A64EC + adds r4, 0x20 + movs r0, 0x98 + lsls r0, 1 + mov r12, r0 + ldr r3, [sp] + cmp r4, r12 + bhi _0810B79E + adds r0, r7, 0 + adds r0, 0x20 + ldrh r1, [r5, 0x30] + ldrh r2, [r5, 0x32] + cmp r0, 0xE0 + bhi _0810B79E + adds r4, r1, 0 + mov r10, r12 +_0810B76A: + mov r7, r9 + lsls r1, r7, 16 + asrs r1, 16 + adds r1, r4 + lsls r1, 16 + mov r7, r8 + lsls r0, r7, 16 + asrs r0, 16 + adds r0, r2 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsrs r0, r1, 16 + mov r9, r0 + movs r7, 0x80 + lsls r7, 14 + adds r1, r7 + lsrs r1, 16 + cmp r1, r10 + bhi _0810B79E + mov r1, r8 + lsls r0, r1, 16 + adds r0, r7 + lsrs r0, 16 + cmp r0, 0xE0 + bls _0810B76A +_0810B79E: + ldrh r0, [r5, 0x30] + negs r7, r0 + strh r7, [r5, 0x30] + ldrh r0, [r5, 0x32] + negs r4, r0 + strh r4, [r5, 0x32] + lsls r0, r3, 16 + movs r1, 0x80 + lsls r1, 14 + adds r0, r1 + lsrs r0, 16 + movs r2, 0x98 + lsls r2, 1 + mov r12, r2 + ldr r1, =0x0203841e + mov r10, r1 + cmp r0, r12 + bhi _0810B80A + lsls r1, r6, 16 + movs r2, 0x80 + lsls r2, 14 + adds r0, r1, r2 + b _0810B802 + .pool +_0810B7E0: + lsls r1, r3, 16 + asrs r1, 16 + adds r1, r7 + lsls r1, 16 + asrs r0, r2, 16 + adds r0, r4 + lsls r0, 16 + lsrs r6, r0, 16 + lsrs r3, r1, 16 + movs r0, 0x80 + lsls r0, 14 + adds r1, r0 + lsrs r1, 16 + cmp r1, r12 + bhi _0810B80A + lsls r1, r6, 16 + adds r0, r1, r0 +_0810B802: + lsrs r0, 16 + adds r2, r1, 0 + cmp r0, 0xE0 + bls _0810B7E0 +_0810B80A: + strh r3, [r5, 0x20] + strh r6, [r5, 0x22] + mov r1, r10 + ldrh r0, [r1, 0x8] + strh r0, [r5, 0x2E] + strh r3, [r5, 0x30] + mov r2, r9 + strh r2, [r5, 0x32] + strh r6, [r5, 0x34] + mov r3, r8 + strh r3, [r5, 0x36] + adds r0, r5, 0 + bl sub_80A64EC + mov r7, r10 + ldrh r0, [r7, 0xA] + strh r0, [r5, 0x34] + ldrh r0, [r7, 0xC] + strh r0, [r5, 0x36] + ldr r0, =sub_810B848 + str r0, [r5, 0x1C] + 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_810B6C4 + + thumb_func_start sub_810B848 +sub_810B848: @ 810B848 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0810B8A0 + ldrh r1, [r4, 0x30] + ldrh r2, [r4, 0x38] + adds r1, r2 + strh r1, [r4, 0x38] + ldrh r0, [r4, 0x32] + ldrh r2, [r4, 0x3A] + adds r0, r2 + strh r0, [r4, 0x3A] + strh r1, [r4, 0x24] + strh r0, [r4, 0x26] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r2, 0x34 + ldrsh r1, [r4, r2] + bl sine + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r2, 0x34 + ldrsh r1, [r4, r2] + bl sine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x36] + ldrh r2, [r4, 0x3C] + adds r0, r2 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x3C] + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + b _0810B8A6 +_0810B8A0: + adds r0, r4, 0 + bl move_anim_8072740 +_0810B8A6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810B848 + + thumb_func_start sub_810B8AC +sub_810B8AC: @ 810B8AC + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0203841e + ldrh r0, [r0] + strh r0, [r4, 0x2E] + movs r0, 0x3C + strh r0, [r4, 0x30] + movs r0, 0x9 + strh r0, [r4, 0x32] + movs r0, 0x1E + strh r0, [r4, 0x34] + movs r0, 0xFE + lsls r0, 8 + strh r0, [r4, 0x36] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r1, =sub_80A634C + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810B8AC + + thumb_func_start sub_810B8EC +sub_810B8EC: @ 810B8EC + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, =0x02038437 + ldrb r0, [r0] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810B92C + ldr r0, =0x0203841e + ldrh r1, [r4, 0x32] + ldrh r0, [r0, 0x4] + subs r1, r0 + strh r1, [r4, 0x32] + b _0810B936 + .pool +_0810B92C: + ldr r0, =0x0203841e + ldrh r0, [r0, 0x4] + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] +_0810B936: + ldr r0, =0x02038437 + ldrb r0, [r0] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + ldr r1, =0x0203841e + lsrs r0, 24 + ldrh r2, [r1, 0x6] + adds r0, r2 + strh r0, [r4, 0x36] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x2E] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A6EEC + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810B8EC + + thumb_func_start sub_810B974 +sub_810B974: @ 810B974 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x0203841e + movs r1, 0x4 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0810B990 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A6980 + b _0810B9C6 + .pool +_0810B990: + ldr r0, =0x02038437 + ldrb r0, [r0] + adds r2, r4, 0 + adds r2, 0x20 + adds r3, r4, 0 + adds r3, 0x22 + movs r1, 0x1 + bl sub_80A8924 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810B9B6 + ldrh r0, [r5] + negs r0, r0 + strh r0, [r5] +_0810B9B6: + ldrh r0, [r5] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] +_0810B9C6: + ldr r1, =sub_810B9E8 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A67BC + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810B974 + + thumb_func_start sub_810B9E8 +sub_810B9E8: @ 810B9E8 + push {lr} + adds r3, r0, 0 + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r2, [r0] + 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 + mov r1, r12 + strb r0, [r1] + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + bne _0810BA1E + adds r0, r3, 0 + bl move_anim_8074EE0 +_0810BA1E: + pop {r0} + bx r0 + thumb_func_end sub_810B9E8 + + thumb_func_start sub_810BA24 +sub_810BA24: @ 810BA24 + push {r4-r7,lr} + sub sp, 0x10 + adds r5, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r6, =0x0203841e + ldrh r0, [r6, 0x8] + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + movs r1, 0xA + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0810BA74 + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r6, [r6, 0x6] + adds r0, r6 + strh r0, [r5, 0x36] + b _0810BA86 + .pool +_0810BA74: + ldr r0, =0x02038437 + ldrb r0, [r0] + adds r2, r5, 0 + adds r2, 0x32 + adds r3, r5, 0 + adds r3, 0x36 + movs r1, 0x1 + bl sub_80A8924 +_0810BA86: + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810BAAC + ldr r0, =0x0203841e + ldrh r1, [r5, 0x32] + ldrh r0, [r0, 0x4] + subs r1, r0 + strh r1, [r5, 0x32] + b _0810BAB6 + .pool +_0810BAAC: + ldr r0, =0x0203841e + ldrh r0, [r0, 0x4] + ldrh r2, [r5, 0x32] + adds r0, r2 + strh r0, [r5, 0x32] +_0810BAB6: + adds r7, r5, 0 + adds r7, 0x2E + adds r2, r7, 0 + mov r1, sp + movs r4, 0x7 +_0810BAC0: + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _0810BAC0 + adds r0, r5, 0 + bl sub_80A7160 + ldrh r0, [r5, 0x30] + movs r1, 0x1 + eors r0, r1 + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x32] + eors r0, r1 + strh r0, [r5, 0x32] +_0810BAE2: + movs r0, 0x1 + strh r0, [r5, 0x2E] + adds r0, r5, 0 + bl sub_80A70E8 + movs r0, 0x20 + ldrsh r1, [r5, r0] + movs r2, 0x24 + ldrsh r0, [r5, r2] + adds r1, r0 + adds r1, 0x10 + movs r0, 0x88 + lsls r0, 1 + cmp r1, r0 + bhi _0810BB16 + movs r0, 0x22 + ldrsh r1, [r5, r0] + movs r2, 0x26 + ldrsh r0, [r5, r2] + adds r1, r0 + cmp r1, 0xA0 + bgt _0810BB16 + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + bge _0810BAE2 +_0810BB16: + ldrh r0, [r5, 0x24] + ldrh r1, [r5, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r5, 0x20] + ldrh r0, [r5, 0x26] + ldrh r2, [r5, 0x22] + adds r0, r2 + strh r0, [r5, 0x22] + strh r1, [r5, 0x26] + strh r1, [r5, 0x24] + ldr r6, =sub_80A718C + ldr r1, =sub_810BB60 + mov r3, sp + adds r2, r7, 0 + movs r4, 0x7 +_0810BB36: + ldrh r0, [r3] + strh r0, [r2] + adds r3, 0x2 + adds r2, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _0810BB36 + str r6, [r5, 0x1C] + adds r0, r5, 0 + bl oamt_set_x3A_32 + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810BA24 + + thumb_func_start sub_810BB60 +sub_810BB60: @ 810BB60 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + movs r5, 0 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + strh r5, [r4, 0x26] + strh r5, [r4, 0x24] + movs r0, 0x80 + strh r0, [r4, 0x2E] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x0000ffec + cmp r0, 0 + beq _0810BB90 + movs r1, 0x14 +_0810BB90: + movs r2, 0x2E + ldrsh r0, [r4, r2] + lsls r1, 16 + asrs r1, 16 + bl sine + strh r0, [r4, 0x34] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0xF + bl cosine + strh r0, [r4, 0x36] + strh r5, [r4, 0x38] + ldr r1, =sub_810BBC8 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810BB60 + + thumb_func_start sub_810BBC8 +sub_810BBC8: @ 810BBC8 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x0000ffec + cmp r0, 0 + beq _0810BBDE + movs r1, 0x14 +_0810BBDE: + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmp r0, 0x1F + bgt _0810BC24 + movs r2, 0x2E + ldrsh r0, [r4, r2] + lsls r1, 16 + asrs r1, 16 + bl sine + ldrh r1, [r4, 0x34] + subs r0, r1 + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0xF + bl cosine + ldrh r1, [r4, 0x36] + subs r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x2E] + adds r0, 0x10 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + b _0810BC42 + .pool +_0810BC24: + ldrh r0, [r4, 0x24] + ldrh r2, [r4, 0x20] + adds r0, r2 + movs r1, 0 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + strh r1, [r4, 0x26] + strh r1, [r4, 0x24] + strh r1, [r4, 0x36] + strh r1, [r4, 0x34] + ldr r0, =sub_810BC4C + str r0, [r4, 0x1C] +_0810BC42: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810BBC8 + + thumb_func_start sub_810BC4C +sub_810BC4C: @ 810BC4C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_80A70E8 + movs r1, 0x20 + ldrsh r0, [r4, r1] + movs r2, 0x24 + ldrsh r1, [r4, r2] + adds r0, r1 + adds r0, 0x10 + movs r1, 0x88 + lsls r1, 1 + cmp r0, r1 + bhi _0810BC88 + movs r1, 0x22 + ldrsh r0, [r4, r1] + movs r2, 0x26 + ldrsh r1, [r4, r2] + adds r1, r0, r1 + movs r0, 0x80 + lsls r0, 1 + cmp r1, r0 + bgt _0810BC88 + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + bge _0810BC8E +_0810BC88: + adds r0, r4, 0 + bl move_anim_8072740 +_0810BC8E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810BC4C + + thumb_func_start sub_810BC94 +sub_810BC94: @ 810BC94 + push {r4-r7,lr} + sub sp, 0x10 + adds r5, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r1, =0x0203841e + ldrh r0, [r1, 0x8] + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + movs r2, 0xE + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0810BCE0 + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + b _0810BCF2 + .pool +_0810BCE0: + ldr r0, =0x02038437 + ldrb r0, [r0] + adds r2, r5, 0 + adds r2, 0x32 + adds r3, r5, 0 + adds r3, 0x36 + movs r1, 0x1 + bl sub_80A8924 +_0810BCF2: + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810BD1C + ldr r0, =0x0203841e + ldrh r1, [r5, 0x32] + ldrh r2, [r0, 0x4] + subs r1, r2 + strh r1, [r5, 0x32] + adds r1, r0, 0 + b _0810BD26 + .pool +_0810BD1C: + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + ldrh r2, [r5, 0x32] + adds r0, r2 + strh r0, [r5, 0x32] +_0810BD26: + ldrh r0, [r1, 0x6] + ldrh r1, [r5, 0x36] + adds r0, r1 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl sub_80A7160 + adds r7, r5, 0 + adds r7, 0x2E + adds r2, r7, 0 + mov r1, sp + movs r4, 0x7 +_0810BD3E: + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _0810BD3E + ldrh r0, [r5, 0x30] + movs r1, 0x1 + eors r0, r1 + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x32] + eors r0, r1 + strh r0, [r5, 0x32] +_0810BD5A: + movs r0, 0x1 + strh r0, [r5, 0x2E] + adds r0, r5, 0 + bl sub_80A70E8 + movs r2, 0x20 + ldrsh r1, [r5, r2] + movs r2, 0x24 + ldrsh r0, [r5, r2] + adds r1, r0 + adds r1, 0x10 + movs r0, 0x88 + lsls r0, 1 + cmp r1, r0 + bhi _0810BD8E + movs r0, 0x22 + ldrsh r1, [r5, r0] + movs r2, 0x26 + ldrsh r0, [r5, r2] + adds r1, r0 + cmp r1, 0xA0 + bgt _0810BD8E + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + bge _0810BD5A +_0810BD8E: + ldrh r0, [r5, 0x24] + ldrh r1, [r5, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r5, 0x20] + ldrh r0, [r5, 0x26] + ldrh r2, [r5, 0x22] + adds r0, r2 + strh r0, [r5, 0x22] + strh r1, [r5, 0x26] + strh r1, [r5, 0x24] + ldr r1, =0x0203841e + ldr r6, =sub_810BDD8 + mov r3, sp + adds r2, r7, 0 + movs r4, 0x7 +_0810BDAE: + ldrh r0, [r3] + strh r0, [r2] + adds r3, 0x2 + adds r2, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _0810BDAE + ldrh r0, [r1, 0xA] + strh r0, [r5, 0x38] + ldrh r0, [r1, 0xC] + strh r0, [r5, 0x3A] + str r6, [r5, 0x1C] + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810BC94 + + thumb_func_start sub_810BDD8 +sub_810BDD8: @ 810BDD8 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A70E8 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0810BDEC + movs r0, 0x1 + strh r0, [r4, 0x2E] +_0810BDEC: + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3A] + ldrh r2, [r4, 0x3C] + adds r0, r2 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x3C] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _0810BE42 + movs r2, 0x20 + ldrsh r0, [r4, r2] + movs r2, 0x24 + ldrsh r1, [r4, r2] + adds r0, r1 + adds r0, 0x10 + movs r1, 0x88 + lsls r1, 1 + cmp r0, r1 + bhi _0810BE3C + movs r0, 0x22 + ldrsh r1, [r4, r0] + movs r2, 0x26 + ldrsh r0, [r4, r2] + adds r1, r0 + cmp r1, 0xA0 + bgt _0810BE3C + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + bge _0810BE42 +_0810BE3C: + adds r0, r4, 0 + bl move_anim_8072740 +_0810BE42: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810BDD8 + + thumb_func_start sub_810BE48 +sub_810BE48: @ 810BE48 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0810BEB4 + ldr r5, =0x0203841e + movs r1, 0x4 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0810BE6C + adds r0, r4, 0 + movs r1, 0 + bl sub_80A6980 + b _0810BEA2 + .pool +_0810BE6C: + ldr r0, =0x02038437 + ldrb r0, [r0] + adds r2, r4, 0 + adds r2, 0x20 + adds r3, r4, 0 + adds r3, 0x22 + movs r1, 0 + bl sub_80A8924 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810BE92 + ldrh r0, [r5] + negs r0, r0 + strh r0, [r5] +_0810BE92: + ldrh r0, [r5] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] +_0810BEA2: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0810BEC8 + .pool +_0810BEB4: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0810BEC8 + adds r0, r4, 0 + bl move_anim_8072740 +_0810BEC8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_810BE48 + + thumb_func_start sub_810BED0 +sub_810BED0: @ 810BED0 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, =0x0203841e + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0810BF40 + movs r1, 0xA + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0810BEF4 + adds r0, r5, 0 + movs r1, 0 + bl sub_80A69CC + b _0810BF32 + .pool +_0810BEF4: + ldr r4, =0x02038436 + ldrb r0, [r4] + adds r2, r5, 0 + adds r2, 0x20 + adds r3, r5, 0 + adds r3, 0x22 + movs r1, 0 + bl sub_80A8924 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810BF20 + ldrh r0, [r5, 0x20] + ldrh r1, [r6] + subs r0, r1 + b _0810BF26 + .pool +_0810BF20: + ldrh r0, [r6] + ldrh r1, [r5, 0x20] + adds r0, r1 +_0810BF26: + strh r0, [r5, 0x20] + ldr r0, =0x0203841e + ldrh r0, [r0, 0x2] + ldrh r1, [r5, 0x22] + adds r0, r1 + strh r0, [r5, 0x22] +_0810BF32: + ldr r0, =0x02038436 + b _0810BF90 + .pool +_0810BF40: + movs r1, 0xA + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0810BF52 + adds r0, r5, 0 + movs r1, 0 + bl sub_80A6980 + b _0810BF8E +_0810BF52: + ldr r4, =0x02038437 + ldrb r0, [r4] + adds r2, r5, 0 + adds r2, 0x20 + adds r3, r5, 0 + adds r3, 0x22 + movs r1, 0 + bl sub_80A8924 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810BF7C + ldrh r0, [r5, 0x20] + ldrh r1, [r6] + subs r0, r1 + b _0810BF82 + .pool +_0810BF7C: + ldrh r0, [r6] + ldrh r1, [r5, 0x20] + adds r0, r1 +_0810BF82: + strh r0, [r5, 0x20] + ldr r0, =0x0203841e + ldrh r0, [r0, 0x2] + ldrh r1, [r5, 0x22] + adds r0, r1 + strh r0, [r5, 0x22] +_0810BF8E: + ldr r0, =0x02038437 +_0810BF90: + ldrb r0, [r0] + strh r0, [r5, 0x3C] + ldr r0, =0x0203841e + movs r1, 0xA + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _0810BFA8 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _0810BFB4 +_0810BFA8: + movs r0, 0x20 + b _0810BFB6 + .pool +_0810BFB4: + movs r0, 0x40 +_0810BFB6: + strh r0, [r5, 0x3A] + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810BFCC + ldrh r0, [r5, 0x22] + adds r0, 0x8 + strh r0, [r5, 0x22] +_0810BFCC: + ldr r1, =0x0203841e + ldrh r0, [r1, 0x6] + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x30] + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + ldrh r1, [r1, 0x4] + adds r0, r1 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl obj_translate_based_on_private_1_2_3_4 + movs r0, 0x40 + strh r0, [r5, 0x38] + ldr r1, =sub_810C008 + str r1, [r5, 0x1C] + adds r0, r5, 0 + bl _call_via_r1 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810BED0 + + thumb_func_start sub_810C008 +sub_810C008: @ 810C008 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + bne _0810C092 + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r2, 0x3A + ldrsh r1, [r4, r2] + bl sine + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + movs r2, 0x38 + ldrsh r0, [r4, r2] + movs r1, 0x6 + negs r1, r1 + bl cosine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x38] + subs r0, 0x40 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7F + bhi _0810C064 + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A8328 + movs r1, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x5] + b _0810C086 +_0810C064: + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A8328 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + lsls r0, 2 + ldrb r2, [r4, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x5] +_0810C086: + ldrh r0, [r4, 0x38] + adds r0, 0x3 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + b _0810C098 +_0810C092: + adds r0, r4, 0 + bl move_anim_8072740 +_0810C098: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810C008 + + thumb_func_start sub_810C0A0 +sub_810C0A0: @ 810C0A0 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810C0E2 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations +_0810C0E2: + ldr r0, =0x02022e18 + movs r1, 0 + strh r1, [r0] + ldr r4, =0x02022e1a + strh r1, [r4] + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + ldrh r1, [r4] + movs r0, 0x16 + bl SetGpuReg + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, =gUnknown_0854CAD0 + movs r2, 0x80 + lsls r2, 4 + mov r3, sp + ldrh r3, [r3, 0xA] + bl LoadBgTiles + ldr r1, =gUnknown_08D932E0 + mov r0, sp + movs r2, 0 + bl sub_80A6D60 + ldr r0, =gUnknown_0854C270 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_810C164 + str r1, [r0] + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810C0A0 + + thumb_func_start sub_810C164 +sub_810C164: @ 810C164 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x02022e18 + ldr r2, =0x0000ffff + adds r0, r2, 0 + ldrh r2, [r1] + adds r0, r2 + strh r0, [r1] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x20 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x4 + bls _0810C18E + b _0810C2DA +_0810C18E: + lsls r0, 2 + ldr r1, =_0810C1A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0810C1A8: + .4byte _0810C1BC + .4byte _0810C214 + .4byte _0810C236 + .4byte _0810C27A + .4byte _0810C29C +_0810C1BC: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + movs r5, 0 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + beq _0810C1D6 + b _0810C2DA +_0810C1D6: + strh r5, [r4, 0x1C] + ldrh r0, [r4, 0x1A] + adds r0, 0x1 + strh r0, [r4, 0x1A] + ldr r1, =gUnknown_08595C5C + movs r2, 0x1A + ldrsh r0, [r4, r2] + adds r0, r1 + ldrb r1, [r0] + strh r1, [r4, 0x1E] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0x9 + bne _0810C2DA + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + strh r5, [r4, 0x1E] + b _0810C2DA + .pool +_0810C214: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r2 + ldrh r0, [r1, 0x1E] + adds r0, 0x1 + strh r0, [r1, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x51 + bne _0810C2DA + movs r0, 0x9 + strh r0, [r1, 0x1E] + ldrh r0, [r1, 0x20] + adds r0, 0x1 + strh r0, [r1, 0x20] + b _0810C2DA +_0810C236: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _0810C2DA + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + subs r1, 0x1 + strh r1, [r4, 0x1E] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r2, 0x1E + ldrsh r1, [r4, r2] + cmp r1, 0 + bne _0810C2DA + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + strh r1, [r4, 0x1E] + b _0810C2DA +_0810C27A: + mov r0, sp + bl sub_80A6B30 + movs r0, 0x1 + bl sub_80A6C68 + movs r0, 0x2 + bl sub_80A6C68 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x20] + adds r0, 0x1 + strh r0, [r1, 0x20] +_0810C29C: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810C2B0 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_0810C2B0: + ldr r0, =0x02022e18 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e1a + strh r1, [r0] + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + adds r0, r4, 0 + bl move_anim_task_del +_0810C2DA: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810C164 + + thumb_func_start sub_810C2F0 +sub_810C2F0: @ 810C2F0 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x02038436 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + ldr r0, =sub_80A7820 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810C2F0 + + thumb_func_start sub_810C324 +sub_810C324: @ 810C324 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810C366 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations +_0810C366: + ldr r0, =0x02022e18 + movs r1, 0 + strh r1, [r0] + ldr r4, =0x02022e1a + strh r1, [r4] + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + ldrh r1, [r4] + movs r0, 0x16 + bl SetGpuReg + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, =gUnknown_0854CAD0 + movs r2, 0x80 + lsls r2, 4 + mov r3, sp + ldrh r3, [r3, 0xA] + bl LoadBgTiles + ldr r1, =gUnknown_08D932E0 + mov r0, sp + movs r2, 0 + bl sub_80A6D60 + ldr r0, =gUnknown_0854C270 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =0x0000ffff + strh r1, [r0, 0x26] + ldr r1, =sub_810C3F0 + str r1, [r0] + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810C324 + + thumb_func_start sub_810C3F0 +sub_810C3F0: @ 810C3F0 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, =0x02022e18 + ldr r3, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r3 + ldrh r0, [r1, 0x26] + ldrh r5, [r2] + adds r0, r5 + strh r0, [r2] + movs r2, 0x20 + ldrsh r0, [r1, r2] + cmp r0, 0x4 + bls _0810C416 + b _0810C54A +_0810C416: + lsls r0, 2 + ldr r1, =_0810C42C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0810C42C: + .4byte _0810C440 + .4byte _0810C484 + .4byte _0810C4A6 + .4byte _0810C4EA + .4byte _0810C50C +_0810C440: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r3 + ldrh r0, [r4, 0x1A] + adds r0, 0x1 + strh r0, [r4, 0x1A] + ldr r1, =gUnknown_08595C88 + movs r5, 0x1A + ldrsh r0, [r4, r5] + adds r0, r1 + ldrb r1, [r0] + strh r1, [r4, 0x1E] + movs r0, 0x11 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0x5 + bne _0810C54A + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + movs r0, 0 + strh r0, [r4, 0x1E] + b _0810C54A + .pool +_0810C484: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r3 + ldrh r0, [r1, 0x1E] + adds r0, 0x1 + strh r0, [r1, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x51 + bne _0810C54A + movs r0, 0x5 + strh r0, [r1, 0x1E] + ldrh r0, [r1, 0x20] + adds r0, 0x1 + strh r0, [r1, 0x20] + b _0810C54A +_0810C4A6: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r3 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _0810C54A + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + subs r1, 0x1 + strh r1, [r4, 0x1E] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r2, 0x1E + ldrsh r1, [r4, r2] + cmp r1, 0 + bne _0810C54A + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + strh r1, [r4, 0x1E] + b _0810C54A +_0810C4EA: + mov r0, sp + bl sub_80A6B30 + movs r0, 0x1 + bl sub_80A6C68 + movs r0, 0x2 + bl sub_80A6C68 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x20] + adds r0, 0x1 + strh r0, [r1, 0x20] +_0810C50C: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810C520 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_0810C520: + ldr r0, =0x02022e18 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e1a + strh r1, [r0] + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + adds r0, r4, 0 + bl move_anim_task_del +_0810C54A: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810C3F0 + + thumb_func_start sub_810C560 +sub_810C560: @ 810C560 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + ldr r6, =0x0203841e + ldrh r0, [r6] + strh r0, [r5, 0x2E] + ldr r0, =0x02038436 + mov r8, r0 + ldrb r0, [r0] + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + ldr r7, =0x02038437 + ldrb r0, [r7] + movs r1, 0x2 + bl sub_80A5C6C + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bcs _0810C594 + movs r0, 0x80 + lsls r0, 8 + strh r0, [r5, 0x3C] +_0810C594: + ldr r3, =0x02024076 + ldrb r0, [r7] + adds r0, r3 + ldrb r1, [r0] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _0810C5F4 + ldrh r0, [r6, 0x2] + negs r0, r0 + strh r0, [r6, 0x2] + ldrh r0, [r6, 0x6] + negs r0, r0 + strh r0, [r6, 0x6] + movs r1, 0x3C + ldrsh r0, [r5, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0810C5F0 + mov r1, r8 + ldrb r0, [r1] + adds r0, r3 + ldrb r1, [r0] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _0810C5F0 + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + ldr r2, =0x02020630 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x43 + ldrb r0, [r1] + adds r0, 0x1 + adds r1, r5, 0 + adds r1, 0x43 + strb r0, [r1] +_0810C5F0: + movs r0, 0x1 + strh r0, [r5, 0x3A] +_0810C5F4: + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldr r6, =0x0203841e + movs r1, 0xE + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _0810C65C + ldrh r0, [r6, 0x2] + ldrh r1, [r5, 0x20] + adds r0, r1 + strh r0, [r5, 0x30] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x6] + adds r0, r1 + strh r0, [r5, 0x32] + ldrh r0, [r6, 0x4] + ldrh r1, [r5, 0x22] + adds r0, r1 + strh r0, [r5, 0x34] + ldrb r0, [r4] + movs r1, 0x3 + b _0810C684 + .pool +_0810C65C: + ldrh r0, [r6, 0x2] + ldrh r1, [r5, 0x20] + adds r0, r1 + strh r0, [r5, 0x30] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x6] + adds r0, r1 + strh r0, [r5, 0x32] + ldrh r0, [r6, 0x4] + ldrh r1, [r5, 0x22] + adds r0, r1 + strh r0, [r5, 0x34] + ldrb r0, [r4] + movs r1, 0x1 +_0810C684: + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r6, [r6, 0x8] + adds r0, r6 + strh r0, [r5, 0x36] + ldrb r0, [r4] + bl sub_80A8328 + lsls r0, 24 + lsrs r0, 16 + ldrh r1, [r5, 0x3C] + orrs r0, r1 + strh r0, [r5, 0x3C] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0810C6B8 + movs r0, 0x1 + strh r0, [r5, 0x3A] + adds r1, r5, 0 + adds r1, 0x43 + movs r0, 0x80 + strb r0, [r1] +_0810C6B8: + adds r0, r5, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r0, =sub_810C6D4 + str r0, [r5, 0x1C] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810C560 + + thumb_func_start sub_810C6D4 +sub_810C6D4: @ 810C6D4 + push {r4-r6,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x3C] + movs r5, 0xFF + movs r1, 0xFF + ands r1, r0 + cmp r1, 0x1 + beq _0810C7BC + cmp r1, 0x1 + bgt _0810C6EE + cmp r1, 0 + beq _0810C6F6 + b _0810C90C +_0810C6EE: + cmp r1, 0x2 + bne _0810C6F4 + b _0810C8D0 +_0810C6F4: + b _0810C90C +_0810C6F6: + adds r0, r4, 0 + bl sub_80A6F3C + ldr r1, =gUnknown_08329F40 + movs r2, 0x38 + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + asrs r0, 4 + ldrh r2, [r4, 0x24] + adds r0, r2 + strh r0, [r4, 0x24] + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0810C724 + ldrh r0, [r4, 0x38] + subs r0, 0x8 + b _0810C728 + .pool +_0810C724: + ldrh r0, [r4, 0x38] + adds r0, 0x8 +_0810C728: + ands r0, r5 + strh r0, [r4, 0x38] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _0810C736 + b _0810C90C +_0810C736: + movs r5, 0x50 + strh r5, [r4, 0x2E] + ldr r6, =0x02038437 + ldrb r0, [r6] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + strh r0, [r4, 0x30] + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x26] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + strh r0, [r4, 0x34] + adds r0, 0x1D + strh r0, [r4, 0x36] + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810C78C + ldr r1, =0x02024076 + ldrb r0, [r6] + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0810C78C + movs r0, 0xCC + strh r0, [r4, 0x38] + b _0810C78E + .pool +_0810C78C: + strh r5, [r4, 0x38] +_0810C78E: + movs r0, 0 + strh r0, [r4, 0x26] + ldr r1, =gUnknown_08329F40 + movs r2, 0x38 + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + asrs r0, 3 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x38] + adds r0, 0x2 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + b _0810C90C + .pool +_0810C7BC: + adds r0, r4, 0 + bl sub_80A6F3C + ldr r1, =gUnknown_08329F40 + movs r2, 0x38 + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + asrs r0, 3 + ldrh r2, [r4, 0x24] + adds r0, r2 + strh r0, [r4, 0x24] + movs r2, 0x38 + ldrsh r0, [r4, r2] + adds r0, 0x40 + lsls r0, 1 + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r0, r1, 1 + adds r0, r1 + negs r0, r0 + asrs r0, 8 + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810C83A + ldrh r1, [r4, 0x38] + adds r0, r1, 0 + subs r0, 0x40 + lsls r0, 16 + lsrs r0, 16 + adds r3, r1, 0 + cmp r0, 0x7F + bhi _0810C81C + ldrh r1, [r4, 0x3C] + lsls r1, 16 + asrs r1, 24 + b _0810C824 + .pool +_0810C81C: + ldrh r1, [r4, 0x3C] + lsls r1, 16 + asrs r1, 24 + adds r1, 0x1 +_0810C824: + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x5] + adds r0, r3, 0x4 + b _0810C85A +_0810C83A: + ldrh r0, [r4, 0x38] + subs r0, 0x40 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7F + bhi _0810C84E + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x80 + b _0810C854 +_0810C84E: + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x8C +_0810C854: + strb r0, [r1] + ldrh r0, [r4, 0x38] + subs r0, 0x4 +_0810C85A: + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + bgt _0810C90C + movs r5, 0 + movs r0, 0xC0 + lsls r0, 2 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + strh r0, [r4, 0x34] + adds r0, 0x4 + strh r0, [r4, 0x36] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810C8B4 + ldr r1, =0x02024076 + ldr r0, =0x02038437 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0810C8B4 + movs r0, 0x80 + lsls r0, 1 + b _0810C8B6 + .pool +_0810C8B4: + ldr r0, =0x0000fff0 +_0810C8B6: + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x3C] + strh r1, [r4, 0x26] + strh r1, [r4, 0x24] + adds r0, r4, 0 + bl sub_80A6FD4 + b _0810C90C + .pool +_0810C8D0: + adds r0, r4, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _0810C90C + ldrb r0, [r4, 0x1] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0810C8FE + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] +_0810C8FE: + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + ldr r1, =0x020383fe + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_0810C90C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810C6D4 + + thumb_func_start sub_810C918 +sub_810C918: @ 810C918 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r1, r0 + ldr r0, =sub_810C934 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_810C918 + + thumb_func_start sub_810C934 +sub_810C934: @ 810C934 + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r5, [r4, r0] + cmp r5, 0x1 + beq _0810C978 + cmp r5, 0x1 + bgt _0810C95C + cmp r5, 0 + beq _0810C962 + b _0810C9DC + .pool +_0810C95C: + cmp r5, 0x2 + beq _0810C9CE + b _0810C9DC +_0810C962: + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _0810C9DC + strh r5, [r4, 0x10] + strh r5, [r4, 0x12] + strh r5, [r4, 0xC] + b _0810C9B4 +_0810C978: + ldrh r1, [r4, 0x12] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r0, 0 + bne _0810C9C8 + ldrb r0, [r4, 0xE] + ldrb r1, [r4, 0xC] + movs r3, 0x1 + bl sub_810C9E4 + lsls r0, 24 + cmp r0, 0 + beq _0810C998 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] +_0810C998: + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _0810C9C4 + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _0810C9BC +_0810C9B4: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0810C9DC +_0810C9BC: + ldrh r0, [r4, 0x8] + subs r0, 0x1 + strh r0, [r4, 0x8] + b _0810C9DC +_0810C9C4: + strh r5, [r4, 0x12] + b _0810C9DC +_0810C9C8: + subs r0, r1, 0x1 + strh r0, [r4, 0x12] + b _0810C9DC +_0810C9CE: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0810C9DC + adds r0, r2, 0 + bl move_anim_task_del +_0810C9DC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_810C934 + + thumb_func_start sub_810C9E4 +sub_810C9E4: @ 810C9E4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp] + lsls r3, 24 + lsrs r3, 24 + mov r10, r3 + movs r1, 0 + str r1, [sp, 0x4] + ldr r1, =gUnknown_08595CB4 + lsrs r0, 22 + adds r4, r0, r1 + ldrb r0, [r4, 0x3] + lsls r0, 24 + asrs r0, 28 + mov r8, r0 + cmp r0, 0x2 + beq _0810CAD0 + ldrh r0, [r4, 0x2] + lsls r0, 20 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810CAD0 + movs r0, 0x1 + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r5, 0 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r6, r0, 24 + mov r1, r8 + cmp r1, 0 + beq _0810CA60 + cmp r1, 0x1 + beq _0810CA96 + b _0810CAE2 + .pool +_0810CA60: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A861C + lsls r0, 16 + asrs r0, 16 + movs r1, 0x6 + bl __divsi3 + lsls r1, r7, 16 + asrs r1, 16 + subs r1, r0 + lsls r1, 16 + lsrs r7, r1, 16 + adds r0, r5, 0 + movs r1, 0 + bl sub_80A861C + lsls r0, 16 + asrs r0, 16 + movs r1, 0x6 + bl __divsi3 + lsls r1, r6, 16 + asrs r1, 16 + subs r1, r0 + b _0810CACA +_0810CA96: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A861C + lsls r0, 16 + asrs r0, 16 + movs r1, 0x6 + bl __divsi3 + lsls r1, r7, 16 + asrs r1, 16 + adds r1, r0 + lsls r1, 16 + lsrs r7, r1, 16 + adds r0, r5, 0 + movs r1, 0 + bl sub_80A861C + lsls r0, 16 + asrs r0, 16 + movs r1, 0x6 + bl __divsi3 + lsls r1, r6, 16 + asrs r1, 16 + adds r1, r0 +_0810CACA: + lsls r1, 16 + lsrs r6, r1, 16 + b _0810CAE2 +_0810CAD0: + ldrh r0, [r4] + lsls r0, 22 + asrs r0, 6 + lsrs r7, r0, 16 + ldr r0, [r4] + lsls r0, 12 + asrs r0, 22 + lsls r0, 16 + lsrs r6, r0, 16 +_0810CAE2: + lsls r0, r6, 16 + asrs r0, 16 + adds r0, 0x8 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + lsls r1, r7, 16 + asrs r1, 16 + subs r1, r0 + ldr r0, =gUnknown_08595D2C + lsls r1, 16 + asrs r1, 16 + movs r2, 0x8 + negs r2, r2 + movs r3, 0x12 + bl AddObjectToFront + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x40 + beq _0810CB44 + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + adds r0, r4, 0 + mov r1, r9 + bl StartObjectRotScalAnim + mov r0, sp + ldrh r0, [r0, 0x4] + strh r0, [r4, 0x2E] + strh r7, [r4, 0x34] + strh r6, [r4, 0x36] + mov r1, r9 + strh r1, [r4, 0x38] + mov r0, sp + ldrh r0, [r0] + strh r0, [r4, 0x3A] + mov r1, r10 + strh r1, [r4, 0x3C] + movs r0, 0x1 + b _0810CB46 + .pool +_0810CB44: + movs r0, 0 +_0810CB46: + 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_810C9E4 + + thumb_func_start sub_810CB58 +sub_810CB58: @ 810CB58 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x20] + adds r0, 0x4 + strh r0, [r4, 0x20] + ldrh r1, [r4, 0x22] + adds r2, r1, 0 + adds r2, 0x8 + strh r2, [r4, 0x22] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x34 + ldrsh r1, [r4, r3] + cmp r0, r1 + bge _0810CB82 + lsls r0, r2, 16 + asrs r0, 16 + movs r2, 0x36 + ldrsh r1, [r4, r2] + cmp r0, r1 + blt _0810CC32 +_0810CB82: + movs r3, 0x2E + ldrsh r0, [r4, r3] + cmp r0, 0x1 + bne _0810CC04 + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0810CC04 + ldr r0, =gUnknown_08595B68 + movs r2, 0x34 + ldrsh r1, [r4, r2] + movs r3, 0x36 + ldrsh r2, [r4, r3] + adds r3, r4, 0 + adds r3, 0x43 + ldrb r3, [r3] + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + cmp r0, 0x40 + beq _0810CBE6 + ldr r2, =0x02020630 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r2, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_810CC3C + str r1, [r0] + movs r3, 0x2E + ldrsh r1, [r4, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x3A] + strh r1, [r0, 0x3A] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x3C] + strh r1, [r0, 0x3C] +_0810CBE6: + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + b _0810CC32 + .pool +_0810CC04: + ldr r3, =0x03005e00 + movs r2, 0x3C + ldrsh r1, [r4, r2] + lsls r1, 1 + movs r0, 0x3A + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0810CC32: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810CB58 + + thumb_func_start sub_810CC3C +sub_810CC3C: @ 810CC3C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + bne _0810CC7C + ldr r3, =0x03005e00 + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x3A + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0810CC7C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810CC3C + + thumb_func_start unc_080B06FC +unc_080B06FC: @ 810CC88 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r0, =0x02038400 + ldr r0, [r0] + ldrb r1, [r0, 0x11] + lsrs r0, r1, 4 + lsls r1, 28 + lsrs r1, 28 + subs r0, r1 + subs r0, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x4 + bls _0810CCA6 + movs r1, 0x4 +_0810CCA6: + adds r0, r5, 0 + bl StartObjectRotScalAnim + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r6, =0x0203841e + ldrh r0, [r6, 0x8] + strh r0, [r5, 0x2E] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810CCCE + ldrh r0, [r6, 0x4] + negs r0, r0 + strh r0, [r6, 0x4] +_0810CCCE: + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x4] + adds r0, r1 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x6] + adds r0, r1 + strh r0, [r5, 0x36] + ldrh r0, [r6, 0xA] + strh r0, [r5, 0x38] + adds r0, r5, 0 + bl sub_80A68D4 + ldr r0, =sub_810CD1C + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end unc_080B06FC + + thumb_func_start sub_810CD1C +sub_810CD1C: @ 810CD1C + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _0810CD3E + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnim + ldr r0, =sub_80A67D8 + str r0, [r4, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 +_0810CD3E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810CD1C + + thumb_func_start sub_810CD4C +sub_810CD4C: @ 810CD4C + push {r4-r6,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x8 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A6980 + bl GenerateRandomNumber2 + movs r5, 0xFF + ands r5, r0 + movs r0, 0x80 + lsls r0, 1 + adds r6, r0, 0 + orrs r5, r6 + bl GenerateRandomNumber2 + ldr r1, =0x000001ff + ands r1, r0 + adds r0, r1, 0 + cmp r0, 0xFF + ble _0810CD92 + subs r0, r6, r0 + lsls r0, 16 + lsrs r1, r0, 16 +_0810CD92: + strh r5, [r4, 0x30] + strh r1, [r4, 0x32] + ldr r0, =sub_810CDB0 + str r0, [r4, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810CD4C + + thumb_func_start sub_810CDB0 +sub_810CDB0: @ 810CDB0 + push {r4,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x30] + ldrh r1, [r2, 0x34] + adds r3, r0, r1 + strh r3, [r2, 0x34] + ldrh r1, [r2, 0x32] + ldrh r4, [r2, 0x36] + adds r1, r4 + strh r1, [r2, 0x36] + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0810CDD4 + lsls r0, r3, 16 + asrs r0, 24 + negs r0, r0 + b _0810CDD8 +_0810CDD4: + lsls r0, r3, 16 + asrs r0, 24 +_0810CDD8: + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x36] + lsls r0, 16 + asrs r0, 24 + strh r0, [r2, 0x26] + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x15 + bne _0810CDF6 + adds r0, r2, 0 + bl move_anim_8072740 +_0810CDF6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810CDB0 + + thumb_func_start sub_810CDFC +sub_810CDFC: @ 810CDFC + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0203841e + ldrb r3, [r1] + lsls r3, 1 + adds r3, r1 + ldr r1, =0x02038400 + ldr r1, [r1] + ldrb r1, [r1, 0x11] + lsrs r2, r1, 4 + lsls r1, 28 + lsrs r1, 28 + subs r2, r1 + subs r2, 0x1 + strh r2, [r3] + bl move_anim_task_del + pop {r0} + bx r0 + .pool + thumb_func_end sub_810CDFC + + thumb_func_start unc_080B08A0 +unc_080B08A0: @ 810CE2C + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x0203841e + movs r0, 0 + ldrsh r1, [r5, r0] + adds r0, r4, 0 + bl sub_80A6864 + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + movs r0, 0xF + strh r0, [r4, 0x2E] + ldr r0, =sub_80A64B0 + str r0, [r4, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end unc_080B08A0 + + thumb_func_start sub_810CE68 +sub_810CE68: @ 810CE68 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x0203841e + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _0810CE90 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810CE90 + ldrh r0, [r4, 0x2] + negs r0, r0 + strh r0, [r4, 0x2] + ldrh r0, [r4, 0x6] + negs r0, r0 + strh r0, [r4, 0x6] +_0810CE90: + ldr r4, =0x0203841e + ldrb r1, [r4, 0xC] + adds r0, r5, 0 + bl StartObjectImageAnim + movs r0, 0 + strh r0, [r4, 0xC] + adds r0, r5, 0 + bl sub_80A7938 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810CE68 + + thumb_func_start sub_810CEB4 +sub_810CEB4: @ 810CEB4 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0810CED0 + ldr r0, =0x0203841e + ldrh r1, [r0, 0x2] + negs r1, r1 + strh r1, [r0, 0x2] + ldrh r1, [r0, 0x6] + negs r1, r1 + strh r1, [r0, 0x6] +_0810CED0: + adds r0, r4, 0 + bl sub_810CE68 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810CEB4 + + thumb_func_start sub_810CEE0 +sub_810CEE0: @ 810CEE0 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x0203841e + ldrb r1, [r4, 0x8] + bl StartObjectImageAnim + movs r1, 0x6 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0810CF04 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A69CC + b _0810CF0C + .pool +_0810CF04: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A6980 +_0810CF0C: + ldr r0, =0x0203841e + ldrh r0, [r0, 0x4] + strh r0, [r5, 0x2E] + ldr r0, =sub_80A64B0 + str r0, [r5, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r5, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810CEE0 + + thumb_func_start sub_810CF30 +sub_810CF30: @ 810CF30 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r5, r0, 0 + ldr r0, =0x0203841e + movs r2, 0 + ldrsh r1, [r0, r2] + mov r9, r0 + cmp r1, 0 + bne _0810CF54 + ldr r0, =0x02038436 + b _0810CF56 + .pool +_0810CF54: + ldr r0, =0x02038437 +_0810CF56: + ldrb r0, [r0] + mov r8, r0 + mov r4, r9 + movs r3, 0x4 + ldrsh r0, [r4, r3] + cmp r0, 0 + bge _0810CF74 + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x5 + bl __umodsi3 + strh r0, [r4, 0x4] +_0810CF74: + ldrb r1, [r4, 0x4] + adds r0, r5, 0 + bl StartObjectImageAnim + mov r0, r8 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + mov r0, r8 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + mov r0, r8 + movs r1, 0x1 + bl sub_80A861C + lsls r0, 16 + asrs r1, r0, 16 + lsrs r0, 31 + adds r1, r0 + lsls r1, 15 + lsrs r6, r1, 16 + mov r0, r8 + movs r1, 0 + bl sub_80A861C + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0810CFBE + adds r0, 0x3 +_0810CFBE: + lsls r4, r0, 14 + lsrs r4, 16 + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r6, 16 + asrs r1, 16 + bl __modsi3 + lsls r0, 16 + lsrs r6, r0, 16 + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 16 + asrs r4, 16 + adds r1, r4, 0 + bl __modsi3 + lsls r0, 16 + lsrs r4, r0, 16 + bl GenerateRandomNumber2 + movs r7, 0x1 + adds r1, r7, 0 + ands r1, r0 + cmp r1, 0 + beq _0810D000 + lsls r0, r6, 16 + negs r0, r0 + lsrs r6, r0, 16 +_0810D000: + bl GenerateRandomNumber2 + adds r1, r7, 0 + ands r1, r0 + cmp r1, 0 + beq _0810D012 + lsls r0, r4, 16 + negs r0, r0 + lsrs r4, r0, 16 +_0810D012: + ldr r0, =0x02024076 + add r0, r8 + ldrb r1, [r0] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + bne _0810D028 + lsls r0, r4, 16 + ldr r1, =0xfff00000 + adds r0, r1 + lsrs r4, r0, 16 +_0810D028: + lsls r0, r6, 16 + asrs r0, 16 + ldrh r2, [r5, 0x20] + adds r0, r2 + strh r0, [r5, 0x20] + lsls r0, r4, 16 + asrs r0, 16 + ldrh r3, [r5, 0x22] + adds r0, r3 + strh r0, [r5, 0x22] + mov r1, r9 + ldrh r0, [r1, 0x2] + strh r0, [r5, 0x2E] + ldr r0, =gUnknown_08597358 + movs r2, 0x20 + ldrsh r1, [r5, r2] + movs r3, 0x22 + ldrsh r2, [r5, r3] + adds r3, r5, 0 + adds r3, 0x43 + ldrb r3, [r3] + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x3C] + cmp r0, 0x40 + beq _0810D08C + movs r0, 0x3C + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + movs r1, 0 + bl StartObjectRotScalAnim + movs r2, 0x3C + ldrsh r1, [r5, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, 0x1C + adds r0, r4 + ldr r1, =DummyObjectCallback + str r1, [r0] +_0810D08C: + ldr r0, =sub_810D0B8 + str r0, [r5, 0x1C] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810CF30 + + thumb_func_start sub_810D0B8 +sub_810D0B8: @ 810D0B8 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r1, [r5, 0x2E] + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0 + bne _0810D100 + movs r1, 0x3C + ldrsh r0, [r5, r1] + cmp r0, 0x40 + beq _0810D0F4 + ldr r4, =0x02020630 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + movs r0, 0x3C + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles +_0810D0F4: + adds r0, r5, 0 + bl move_anim_8072740 + b _0810D104 + .pool +_0810D100: + subs r0, r1, 0x1 + strh r0, [r5, 0x2E] +_0810D104: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_810D0B8 + + thumb_func_start sub_810D10C +sub_810D10C: @ 810D10C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A6980 + movs r0, 0x1E + strh r0, [r4, 0x2E] + ldr r0, =0x0203841e + movs r1, 0x4 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810D130 + ldrh r0, [r4, 0x20] + subs r0, 0x14 + strh r0, [r4, 0x32] + b _0810D142 + .pool +_0810D130: + ldrh r0, [r4, 0x20] + adds r0, 0x14 + strh r0, [r4, 0x32] + adds r2, r4, 0 + adds r2, 0x3F + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] +_0810D142: + ldrh r0, [r4, 0x22] + subs r0, 0x14 + strh r0, [r4, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r4, 0x1C] + ldr r1, =sub_810D164 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810D10C + + thumb_func_start sub_810D164 +sub_810D164: @ 810D164 + push {r4-r6,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x38] + adds r0, 0x1 + movs r6, 0 + strh r0, [r5, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + bne _0810D1A4 + ldrh r2, [r5, 0x20] + ldrh r4, [r5, 0x24] + subs r0, r2, r4 + strh r0, [r5, 0x32] + ldrh r1, [r5, 0x22] + ldrh r3, [r5, 0x26] + subs r0, r1, r3 + strh r0, [r5, 0x36] + movs r0, 0x8 + strh r0, [r5, 0x2E] + adds r2, r4 + strh r2, [r5, 0x20] + adds r1, r3 + strh r1, [r5, 0x22] + strh r6, [r5, 0x26] + strh r6, [r5, 0x24] + ldr r0, =sub_80A6EEC + str r0, [r5, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r5, 0 + bl oamt_set_x3A_32 +_0810D1A4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810D164 + + thumb_func_start sub_810D1B4 +sub_810D1B4: @ 810D1B4 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r0, =0x02038436 + ldrb r1, [r0] + movs r0, 0x2 + ldr r2, =0x02038437 + eors r0, r1 + ldrb r1, [r2] + cmp r0, r1 + bne _0810D1E0 + ldrb r0, [r2] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0810D1E0 + ldr r1, =0x0203841e + movs r2, 0 + ldrsh r0, [r1, r2] + negs r0, r0 + strh r0, [r1] +_0810D1E0: + adds r0, r6, 0 + movs r1, 0x1 + bl sub_80A6980 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810D1FE + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_0810D1FE: + ldr r4, =0x0203841e + ldrh r0, [r4, 0x6] + movs r5, 0 + strh r0, [r6, 0x2E] + ldrh r0, [r6, 0x20] + strh r0, [r6, 0x30] + ldrh r1, [r4, 0x4] + adds r0, r1 + strh r0, [r6, 0x32] + ldrh r0, [r6, 0x22] + strh r0, [r6, 0x34] + strh r0, [r6, 0x36] + adds r0, r6, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldrh r0, [r4, 0xA] + strh r0, [r6, 0x38] + ldrh r0, [r4, 0x8] + strh r0, [r6, 0x3A] + strh r5, [r6, 0x3C] + ldr r0, =sub_810D240 + str r0, [r6, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810D1B4 + + thumb_func_start sub_810D240 +sub_810D240: @ 810D240 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + bne _0810D26C + ldrh r0, [r4, 0x3C] + lsls r0, 16 + asrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3A] + ldrh r2, [r4, 0x3C] + adds r0, r2 + strh r0, [r4, 0x3C] + b _0810D272 +_0810D26C: + adds r0, r4, 0 + bl move_anim_8072740 +_0810D272: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810D240 + + thumb_func_start sub_810D278 +sub_810D278: @ 810D278 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A6980 + ldr r5, =0x0203841e + ldrb r1, [r5, 0x4] + adds r0, r4, 0 + bl StartObjectImageAnim + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x2E] + ldr r0, =sub_80A64B0 + str r0, [r4, 0x1C] + ldr r1, =sub_810D2B0 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810D278 + + thumb_func_start sub_810D2B0 +sub_810D2B0: @ 810D2B0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + bl StartObjectRotScalAnim + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x14 + strh r0, [r4, 0x2E] + ldr r0, =sub_80A64B0 + str r0, [r4, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810D2B0 + + thumb_func_start sub_810D2E4 +sub_810D2E4: @ 810D2E4 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A6980 + ldr r0, =0x0203841e + ldrh r0, [r0, 0x4] + strh r0, [r4, 0x2E] + ldr r0, =sub_810D308 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810D2E4 + + thumb_func_start sub_810D308 +sub_810D308: @ 810D308 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x2E] + subs r0, 0x1 + strh r0, [r5, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0810D34C + movs r0, 0x6 + strh r0, [r5, 0x2E] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r5, 0x1C] + ldr r1, =sub_810D360 + adds r0, r5, 0 + bl oamt_set_x3A_32 +_0810D34C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810D308 + + thumb_func_start sub_810D360 +sub_810D360: @ 810D360 + push {lr} + movs r1, 0xF + strh r1, [r0, 0x2E] + ldr r1, =sub_80A64B0 + str r1, [r0, 0x1C] + ldr r1, =move_anim_8072740 + bl oamt_set_x3A_32 + pop {r0} + bx r0 + .pool + thumb_func_end sub_810D360 + + thumb_func_start sub_810D37C +sub_810D37C: @ 810D37C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0810D3A8 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A6980 + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0810D404 + .pool +_0810D3A8: + ldrh r0, [r4, 0x30] + ldrh r2, [r4, 0x36] + adds r0, r2 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + movs r1, 0x34 + ldrsh r0, [r4, r1] + movs r2, 0x32 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x34] + adds r0, 0x3 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x34] + cmp r0, 0x64 + ble _0810D3F6 + movs r0, 0x34 + ldrsh r1, [r4, r0] + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r0, 1 + lsls r0, 1 + subs r1, r0 + adds r3, r4, 0 + adds r3, 0x3E + movs r0, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_0810D3F6: + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0x78 + ble _0810D404 + adds r0, r4, 0 + bl move_anim_8072740 +_0810D404: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810D37C + + thumb_func_start sub_810D40C +sub_810D40C: @ 810D40C + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810D428 + ldr r4, =0x02038436 + b _0810D42A + .pool +_0810D428: + ldr r4, =0x02038437 +_0810D42A: + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldr r1, =0x0203841e + ldrh r0, [r1, 0x2] + ldrh r2, [r5, 0x20] + adds r0, r2 + movs r2, 0 + strh r0, [r5, 0x20] + ldrh r0, [r1, 0x4] + ldrh r3, [r5, 0x22] + adds r0, r3 + strh r0, [r5, 0x22] + strh r2, [r5, 0x2E] + ldrh r0, [r1, 0x6] + strh r0, [r5, 0x30] + ldrh r0, [r1, 0x8] + strh r0, [r5, 0x32] + strh r2, [r5, 0x34] + ldr r0, =sub_810D47C + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810D40C + + thumb_func_start sub_810D47C +sub_810D47C: @ 810D47C + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + cmp r2, 0 + beq _0810D48E + cmp r2, 0x1 + beq _0810D4B2 + b _0810D4EC +_0810D48E: + ldrh r0, [r1, 0x30] + subs r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _0810D4EC + movs r2, 0x32 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0810D4AA + adds r0, r1, 0 + bl move_anim_8072740 + b _0810D4EC +_0810D4AA: + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + b _0810D4EC +_0810D4B2: + ldrh r0, [r1, 0x30] + adds r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0810D4DA + movs r0, 0 + strh r0, [r1, 0x30] + ldrh r0, [r1, 0x34] + adds r0, 0x1 + strh r0, [r1, 0x34] + ands r0, r2 + lsls r0, 16 + cmp r0, 0 + beq _0810D4D6 + movs r0, 0x2 + b _0810D4D8 +_0810D4D6: + ldr r0, =0x0000fffe +_0810D4D8: + strh r0, [r1, 0x24] +_0810D4DA: + ldrh r0, [r1, 0x32] + subs r0, 0x1 + strh r0, [r1, 0x32] + lsls r0, 16 + cmp r0, 0 + bne _0810D4EC + adds r0, r1, 0 + bl move_anim_8072740 +_0810D4EC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_810D47C + + thumb_func_start sub_810D4F4 +sub_810D4F4: @ 810D4F4 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, =0x0203841e + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0810D520 + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r2, [r6, 0x4] + adds r0, r2 + b _0810D532 + .pool +_0810D520: + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x4] + adds r0, r1 +_0810D532: + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r6, [r6, 0x6] + adds r0, r6 + strh r0, [r5, 0x22] + ldrh r2, [r5, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + ldr r3, =0x0203841e + movs r4, 0x2 + ldrsh r0, [r3, r4] + lsls r0, 4 + adds r1, r0 + ldr r4, =0x000003ff + adds r0, r4, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + movs r1, 0 + movs r0, 0 + strh r0, [r5, 0x2E] + movs r2, 0x2 + ldrsh r0, [r3, r2] + cmp r0, 0x1 + beq _0810D5A0 + cmp r0, 0x1 + bgt _0810D58C + cmp r0, 0 + beq _0810D596 + b _0810D5C6 + .pool +_0810D58C: + cmp r0, 0x2 + beq _0810D5B0 + cmp r0, 0x3 + beq _0810D5C0 + b _0810D5C6 +_0810D596: + ldr r0, =0x0000fffd + b _0810D5C0 + .pool +_0810D5A0: + movs r0, 0x3 + strh r0, [r5, 0x3A] + ldr r0, =0x0000fffd + strh r0, [r5, 0x3C] + b _0810D5CE + .pool +_0810D5B0: + ldr r0, =0x0000fffd + strh r0, [r5, 0x3A] + movs r0, 0x3 + strh r0, [r5, 0x3C] + b _0810D5CE + .pool +_0810D5C0: + strh r0, [r5, 0x3A] + strh r0, [r5, 0x3C] + b _0810D5CE +_0810D5C6: + adds r0, r5, 0 + bl move_anim_8072740 + b _0810D5D2 +_0810D5CE: + ldr r0, =sub_810D5DC + str r0, [r5, 0x1C] +_0810D5D2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810D4F4 + + thumb_func_start sub_810D5DC +sub_810D5DC: @ 810D5DC + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x3A] + ldrh r2, [r1, 0x20] + adds r0, r2 + strh r0, [r1, 0x20] + ldrh r0, [r1, 0x3C] + ldrh r2, [r1, 0x22] + adds r0, r2 + strh r0, [r1, 0x22] + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + ble _0810D604 + adds r0, r1, 0 + bl move_anim_8072740 +_0810D604: + pop {r0} + bx r0 + thumb_func_end sub_810D5DC + + thumb_func_start sub_810D608 +sub_810D608: @ 810D608 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810D664 + ldr r4, =0x0202420b + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl sub_80A8328 + movs r1, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r5, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + ldr r0, =0x02038437 + b _0810D680 + .pool +_0810D664: + ldr r0, =0x02038437 + ldrb r0, [r0] + bl sub_80A8328 + movs r1, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r5, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + ldr r0, =0x02038436 +_0810D680: + ldrb r0, [r0] + strh r0, [r5, 0x3C] + movs r0, 0 + strh r0, [r5, 0x2E] + movs r0, 0xC + strh r0, [r5, 0x30] + movs r0, 0x8 + strh r0, [r5, 0x32] + ldr r0, =sub_810D6A8 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810D608 + + thumb_func_start sub_810D6A8 +sub_810D6A8: @ 810D6A8 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB4 + bne _0810D704 + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x10 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r1, =move_anim_8074EE0 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A6F98 + str r0, [r4, 0x1C] +_0810D704: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810D6A8 + + thumb_func_start sub_810D714 +sub_810D714: @ 810D714 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x0203841e + ldrh r0, [r4] + strh r0, [r5, 0x20] + movs r2, 0x78 + strh r2, [r5, 0x22] + ldrh r0, [r4, 0x6] + strh r0, [r5, 0x2E] + adds r0, r5, 0 + adds r0, 0x36 + adds r1, r5, 0 + adds r1, 0x38 + lsls r2, 8 + bl sub_80A8048 + ldrh r0, [r4, 0x2] + strh r0, [r5, 0x3A] + ldrh r2, [r5, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + movs r3, 0x4 + ldrsh r0, [r4, r3] + lsls r0, 2 + adds r1, r0 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + ldr r0, =sub_810D770 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810D714 + + thumb_func_start sub_810D770 +sub_810D770: @ 810D770 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + movs r1, 0x2E + ldrsh r0, [r7, r1] + cmp r0, 0 + beq _0810D7C2 + movs r2, 0x36 + ldrsh r0, [r7, r2] + movs r2, 0x38 + ldrsh r1, [r7, r2] + bl sub_80A8050 + adds r4, r0, 0 + movs r1, 0x3A + ldrsh r0, [r7, r1] + subs r4, r0 + adds r0, r7, 0 + adds r0, 0x36 + adds r1, r7, 0 + adds r1, 0x38 + adds r2, r4, 0 + bl sub_80A8048 + asrs r4, 8 + strh r4, [r7, 0x22] + lsls r4, 16 + asrs r4, 16 + movs r0, 0x8 + negs r0, r0 + cmp r4, r0 + bge _0810D7BA + adds r0, r7, 0 + bl move_anim_8072740 + b _0810D818 +_0810D7BA: + ldrh r0, [r7, 0x2E] + subs r0, 0x1 + strh r0, [r7, 0x2E] + b _0810D818 +_0810D7C2: + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r2, =0x02038437 + mov r8, r2 + ldrb r0, [r2] + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r1, r8 + ldrb r0, [r1] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + subs r4, r6 + strh r4, [r7, 0x2E] + lsrs r0, 24 + subs r0, r5 + strh r0, [r7, 0x30] + ldrh r0, [r7, 0x20] + lsls r0, 4 + strh r0, [r7, 0x32] + ldrh r0, [r7, 0x22] + lsls r0, 4 + strh r0, [r7, 0x34] + ldr r0, =sub_810D830 + str r0, [r7, 0x1C] +_0810D818: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810D770 + + thumb_func_start sub_810D830 +sub_810D830: @ 810D830 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x32] + adds r0, r1 + strh r0, [r2, 0x32] + ldrh r1, [r2, 0x30] + ldrh r3, [r2, 0x34] + adds r1, r3 + strh r1, [r2, 0x34] + lsls r0, 16 + asrs r0, 20 + strh r0, [r2, 0x20] + lsls r1, 16 + asrs r3, r1, 20 + strh r3, [r2, 0x22] + adds r0, 0x8 + lsls r0, 16 + movs r1, 0x80 + lsls r1, 17 + cmp r0, r1 + bhi _0810D86A + adds r1, r3, 0 + movs r0, 0x8 + negs r0, r0 + cmp r1, r0 + blt _0810D86A + cmp r1, 0x78 + ble _0810D870 +_0810D86A: + adds r0, r2, 0 + bl move_anim_8072740 +_0810D870: + pop {r0} + bx r0 + thumb_func_end sub_810D830 + + thumb_func_start sub_810D874 +sub_810D874: @ 810D874 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810D8B8 + ldr r4, =0x0202420b + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldr r0, =0x02038437 + ldrb r4, [r0] + ldr r0, =0x02038436 + b _0810D8BE + .pool +_0810D8B8: + ldr r0, =0x02038436 + ldrb r4, [r0] + ldr r0, =0x02038437 +_0810D8BE: + ldrb r0, [r0] + bl sub_80A8328 + movs r1, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r5, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0810D8F8 + ldrb r2, [r5, 0x3] + lsls r1, r2, 26 + lsrs r1, 27 + movs r0, 0x8 + orrs r1, r0 + lsls r1, 1 + subs r0, 0x47 + b _0810D912 + .pool +_0810D8F8: + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810D918 + ldrb r2, [r5, 0x3] + lsls r1, r2, 26 + lsrs r1, 27 + movs r0, 0x18 + orrs r1, r0 + lsls r1, 1 + subs r0, 0x57 +_0810D912: + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x3] +_0810D918: + movs r0, 0x10 + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x30] + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + adds r0, r4, 0 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r1, =move_anim_8072740 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A6F98 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810D874 + + thumb_func_start sub_810D960 +sub_810D960: @ 810D960 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x2E + ldrsh r1, [r4, r0] + movs r2, 0x36 + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _0810D976 + adds r0, r4, 0 + bl move_anim_8072740 +_0810D976: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810D960 + + thumb_func_start sub_810D984 +sub_810D984: @ 810D984 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldr r1, =0x0203841e + ldrh r0, [r1, 0x6] + strh r0, [r5, 0x30] + ldrh r0, [r1] + strh r0, [r5, 0x32] + ldrh r0, [r1, 0x2] + strh r0, [r5, 0x34] + ldrh r0, [r1, 0x4] + strh r0, [r5, 0x36] + ldr r0, =0x02038432 + ldrb r6, [r0] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810D9CE + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0810D9CE: + movs r0, 0x1 + ands r6, r0 + cmp r6, 0 + beq _0810D9E2 + ldrh r0, [r5, 0x32] + negs r0, r0 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x30] + adds r0, 0x1 + strh r0, [r5, 0x30] +_0810D9E2: + ldrh r1, [r5, 0x30] + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl StartObjectImageAnim + ldrh r0, [r5, 0x32] + strh r0, [r5, 0x24] + ldrh r0, [r5, 0x34] + strh r0, [r5, 0x26] + ldr r0, =sub_810D960 + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810D984 + + thumb_func_start sub_810DA10 +sub_810DA10: @ 810DA10 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0203841e + movs r1, 0x4 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810DA2C + adds r0, r4, 0 + movs r1, 0 + bl sub_80A69CC + b _0810DA34 + .pool +_0810DA2C: + adds r0, r4, 0 + movs r1, 0 + bl sub_80A6980 +_0810DA34: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0810DA48 + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectImageAnim + b _0810DA5E +_0810DA48: + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810DA5E + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnim +_0810DA5E: + ldr r0, =sub_80A67D8 + str r0, [r4, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810DA10 + + thumb_func_start sub_810DA7C +sub_810DA7C: @ 810DA7C + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0810DAB6 + ldrh r0, [r4, 0x30] + adds r0, 0x28 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x2 + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + ble _0810DAB6 + adds r0, r4, 0 + bl move_anim_8072740 +_0810DAB6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810DA7C + + thumb_func_start sub_810DABC +sub_810DABC: @ 810DABC + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0810DAF4 + cmp r0, 0x1 + bgt _0810DB0E + cmp r0, 0 + bne _0810DB0E + movs r0, 0 + bl sub_80A6DAC + ldr r0, =0x0203841e + ldrh r0, [r0] + strh r0, [r4, 0x18] + b _0810DB06 + .pool +_0810DAF4: + ldrh r0, [r4, 0x18] + subs r0, 0x1 + strh r0, [r4, 0x18] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0810DB1A +_0810DB06: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0810DB1A +_0810DB0E: + movs r2, 0xA0 + lsls r2, 3 + adds r0, r2, 0 + ldrh r1, [r4, 0x1A] + adds r0, r1 + strh r0, [r4, 0x1A] +_0810DB1A: + movs r2, 0xB0 + lsls r2, 4 + adds r0, r2, 0 + ldrh r1, [r4, 0x1C] + adds r0, r1 + strh r0, [r4, 0x1C] + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810DB50 + ldr r1, =0x02022e20 + ldrh r0, [r4, 0x1A] + lsls r0, 16 + asrs r0, 24 + ldrh r2, [r1] + adds r0, r2 + strh r0, [r1] + adds r7, r1, 0 + b _0810DB60 + .pool +_0810DB50: + ldr r2, =0x02022e20 + ldrh r1, [r4, 0x1A] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r2] + subs r0, r1 + strh r0, [r2] + adds r7, r2, 0 +_0810DB60: + ldr r3, =0x02022e22 + ldrh r2, [r4, 0x1C] + lsls r0, r2, 16 + asrs r0, 24 + ldrh r1, [r3] + adds r0, r1 + strh r0, [r3] + movs r0, 0xFF + ldrb r1, [r4, 0x1A] + movs r5, 0 + strh r1, [r4, 0x1A] + ands r0, r2 + strh r0, [r4, 0x1C] + ldr r0, =0x0203841e + movs r2, 0xE + ldrsh r1, [r0, r2] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _0810DB98 + strh r5, [r7] + strh r5, [r3] + movs r0, 0x1 + bl sub_80A6DAC + adds r0, r6, 0 + bl move_anim_task_del +_0810DB98: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810DABC + + thumb_func_start sub_810DBAC +sub_810DBAC: @ 810DBAC + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x0203841e + movs r1, 0x6 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0810DBC2 + adds r0, r5, 0 + movs r1, 0x2 + bl StartObjectImageAnim +_0810DBC2: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A69CC + ldrh r0, [r4, 0x4] + strh r0, [r5, 0x2E] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + ldr r0, =0x0000ffe2 + strh r0, [r5, 0x38] + adds r0, r5, 0 + bl sub_80A68D4 + ldr r0, =sub_810DC10 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810DBAC + + thumb_func_start sub_810DC10 +sub_810DC10: @ 810DC10 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _0810DC24 + adds r0, r4, 0 + bl move_anim_8072740 +_0810DC24: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810DC10 + + thumb_func_start sub_810DC2C +sub_810DC2C: @ 810DC2C + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r5, =0x0203841e + movs r1, 0x6 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0810DC44 + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectImageAnim +_0810DC44: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, =0x02038437 + ldrb r0, [r0] + mov r6, sp + adds r6, 0x2 + movs r1, 0x1 + mov r2, sp + adds r3, r6, 0 + bl sub_80A8924 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810DC72 + ldrh r0, [r5, 0x8] + negs r0, r0 + strh r0, [r5, 0x8] +_0810DC72: + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x2E] + mov r1, sp + ldrh r0, [r5, 0x8] + ldrh r1, [r1] + adds r0, r1 + strh r0, [r4, 0x32] + ldrh r0, [r5, 0xA] + ldrh r6, [r6] + adds r0, r6 + strh r0, [r4, 0x36] + ldr r0, =0x0000ffe2 + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl sub_80A68D4 + ldr r0, =sub_810DCB4 + str r0, [r4, 0x1C] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810DC2C + + thumb_func_start sub_810DCB4 +sub_810DCB4: @ 810DCB4 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _0810DCC8 + adds r0, r4, 0 + bl move_anim_8072740 +_0810DCC8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810DCB4 + + thumb_func_start sub_810DCD0 +sub_810DCD0: @ 810DCD0 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x0203841e + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + ldrh r1, [r5] + adds r0, r1 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + ldrh r1, [r5, 0x2] + adds r0, r1 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl sub_80A6E14 + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r2, 0x4 + ldrsh r1, [r5, r2] + bl __divsi3 + strh r0, [r4, 0x38] + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r2, 0x4 + ldrsh r1, [r5, r2] + bl __divsi3 + strh r0, [r4, 0x3A] + ldr r0, =sub_810DD24 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810DCD0 + + thumb_func_start sub_810DD24 +sub_810DD24: @ 810DD24 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A656C + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x38] + subs r0, r1 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x32] + ldrh r1, [r4, 0x3A] + subs r0, r1 + strh r0, [r4, 0x32] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0810DD4A + adds r0, r4, 0 + bl move_anim_8072740 +_0810DD4A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810DD24 + + thumb_func_start sub_810DD50 +sub_810DD50: @ 810DD50 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02038437 + ldrb r0, [r0] + adds r2, r4, 0 + adds r2, 0x20 + adds r3, r4, 0 + adds r3, 0x22 + movs r1, 0x1 + bl sub_80A8924 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810DD7C + ldr r1, =0x0203841e + ldrh r0, [r1] + negs r0, r0 + strh r0, [r1] +_0810DD7C: + ldr r0, =0x0203841e + ldrh r2, [r0] + ldrh r1, [r4, 0x20] + adds r2, r1 + strh r2, [r4, 0x20] + ldrh r1, [r0, 0x2] + ldrh r3, [r4, 0x22] + adds r1, r3 + strh r1, [r4, 0x22] + ldrh r3, [r0, 0x8] + strh r3, [r4, 0x2E] + ldrh r0, [r0, 0x4] + adds r2, r0 + strh r2, [r4, 0x32] + adds r1, r3 + strh r1, [r4, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r4, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810DD50 + + thumb_func_start sub_810DDC4 +sub_810DDC4: @ 810DDC4 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x0203841e + movs r1, 0x4 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0810DDE0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A6980 + b _0810DE16 + .pool +_0810DDE0: + ldr r0, =0x02038437 + ldrb r0, [r0] + adds r2, r4, 0 + adds r2, 0x20 + adds r3, r4, 0 + adds r3, 0x22 + movs r1, 0x1 + bl sub_80A8924 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810DE06 + ldrh r0, [r5] + negs r0, r0 + strh r0, [r5] +_0810DE06: + ldrh r0, [r5] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] +_0810DE16: + ldr r0, =sub_810DE2C + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810DDC4 + + thumb_func_start sub_810DE2C +sub_810DE2C: @ 810DE2C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0xB + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x4 + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x30] + adds r0, 0x30 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 24 + negs r0, r0 + strh r0, [r4, 0x26] + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0810DE68 + adds r0, r4, 0 + bl move_anim_8072740 +_0810DE68: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810DE2C + + thumb_func_start sub_810DE70 +sub_810DE70: @ 810DE70 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + bl sub_80A6980 + ldrh r0, [r4, 0x22] + adds r0, 0x14 + strh r0, [r4, 0x22] + movs r0, 0xBF + strh r0, [r4, 0x30] + ldr r1, =sub_810DE98 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810DE70 + + thumb_func_start sub_810DE98 +sub_810DE98: @ 810DE98 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x20 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x5 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x47 + bne _0810DED2 + adds r0, r4, 0 + bl move_anim_8072740 +_0810DED2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810DE98 + + thumb_func_start sub_810DED8 +sub_810DED8: @ 810DED8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldr r1, =0x0203841e + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x8] + ldrh r0, [r1] + strh r0, [r4, 0xA] + ldr r0, =0x00002719 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xC] + ldr r0, =sub_810DF18 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810DED8 + + thumb_func_start sub_810DF18 +sub_810DF18: @ 810DF18 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r3, r0, r2 + ldrh r0, [r3, 0x1C] + adds r1, r0, 0x1 + strh r1, [r3, 0x1C] + lsls r0, 16 + asrs r0, 16 + movs r4, 0xA + ldrsh r1, [r3, r4] + adds r7, r2, 0 + cmp r0, r1 + bne _0810DF76 + movs r0, 0 + strh r0, [r3, 0x1C] + ldrb r0, [r3, 0xC] + ldr r2, =0x02037b14 + lsls r0, 4 + movs r3, 0x84 + lsls r3, 1 + adds r1, r0, r3 + lsls r1, 1 + adds r1, r2 + ldrh r6, [r1] + movs r4, 0x7 + mov r12, r0 + ldr r0, =0x00000107 + add r0, r12 + lsls r0, 1 + adds r3, r0, r2 +_0810DF5E: + ldrh r0, [r3] + strh r0, [r1] + subs r3, 0x2 + subs r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bgt _0810DF5E + ldr r0, =0x00000101 + add r0, r12 + lsls r0, 1 + adds r0, r2 + strh r6, [r0] +_0810DF76: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r7 + ldrh r1, [r0, 0x8] + subs r1, 0x1 + strh r1, [r0, 0x8] + lsls r1, 16 + cmp r1, 0 + bne _0810DF90 + adds r0, r5, 0 + bl move_anim_task_del +_0810DF90: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810DF18 + + thumb_func_start sub_810DFA8 +sub_810DFA8: @ 810DFA8 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810DFC8 + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_0810DFC8: + ldr r4, =0x0203841e + ldrh r0, [r4, 0x8] + strh r0, [r6, 0x2E] + ldrh r0, [r6, 0x20] + strh r0, [r6, 0x30] + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x4] + adds r0, r1 + strh r0, [r6, 0x32] + ldrh r0, [r6, 0x22] + strh r0, [r6, 0x34] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r4, [r4, 0x6] + adds r0, r4 + strh r0, [r6, 0x36] + adds r0, r6, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r0, =sub_80A67BC + str r0, [r6, 0x1C] + ldr r1, =sub_810E028 + adds r0, r6, 0 + bl oamt_set_x3A_32 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810DFA8 + + thumb_func_start sub_810E028 +sub_810E028: @ 810E028 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _0810E03C + adds r0, r4, 0 + bl move_anim_8072740 +_0810E03C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810E028 + + thumb_func_start sub_810E044 +sub_810E044: @ 810E044 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x02038436 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810E070 + ldr r1, =0x0203841e + ldrh r0, [r1] + negs r0, r0 + strh r0, [r1] + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] + ldrh r0, [r1, 0x6] + negs r0, r0 + strh r0, [r1, 0x6] +_0810E070: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0810E088 + ldr r0, =0x0203841e + ldrh r1, [r0, 0x2] + negs r1, r1 + strh r1, [r0, 0x2] + ldrh r1, [r0, 0x6] + negs r1, r1 + strh r1, [r0, 0x6] +_0810E088: + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + ldr r2, =0x0203841e + ldrh r1, [r2] + ldrh r3, [r5, 0x20] + adds r1, r3 + strh r1, [r5, 0x20] + lsrs r0, 24 + ldrh r1, [r2, 0x2] + adds r0, r1 + strh r0, [r5, 0x22] + ldrh r0, [r2, 0x8] + strh r0, [r5, 0x2E] + movs r3, 0xC + ldrsh r0, [r2, r3] + cmp r0, 0 + bne _0810E0EC + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + b _0810E0FE + .pool +_0810E0EC: + ldr r0, =0x02038437 + ldrb r0, [r0] + adds r2, r5, 0 + adds r2, 0x32 + adds r3, r5, 0 + adds r3, 0x36 + movs r1, 0x1 + bl sub_80A8924 +_0810E0FE: + ldr r4, =0x0203841e + ldrh r0, [r4, 0x4] + ldrh r1, [r5, 0x32] + adds r0, r1 + strh r0, [r5, 0x32] + ldrh r0, [r4, 0x6] + ldrh r3, [r5, 0x36] + adds r0, r3 + strh r0, [r5, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r5, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldrb r1, [r4, 0xA] + adds r0, r5, 0 + bl SeekObjectImageAnim + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810E044 + + thumb_func_start sub_810E13C +sub_810E13C: @ 810E13C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x30] + ldr r0, =sub_810E184 + str r0, [r4, 0x1C] + movs r0, 0 + bl obj_id_for_side_relative_to_move + ldr r2, =0x02020630 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810E13C + + thumb_func_start sub_810E184 +sub_810E184: @ 810E184 + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x2E] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + ble _0810E198 + subs r0, r1, 0x1 + strh r0, [r2, 0x2E] + b _0810E1AA +_0810E198: + ldrh r0, [r2, 0x30] + ldrh r1, [r2, 0x32] + adds r0, r1 + strh r0, [r2, 0x32] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r2, 0x26] + subs r1, r0 + strh r1, [r2, 0x26] +_0810E1AA: + movs r3, 0x22 + ldrsh r0, [r2, r3] + movs r3, 0x26 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bge _0810E1C2 + adds r0, r2, 0 + bl move_anim_8072740 +_0810E1C2: + pop {r0} + bx r0 + thumb_func_end sub_810E184 + + thumb_func_start sub_810E1C8 +sub_810E1C8: @ 810E1C8 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810E1F8 + movs r0, 0x88 + lsls r0, 1 + strh r0, [r5, 0x20] + ldr r0, =0x0000ffe0 + strh r0, [r5, 0x22] + adds r0, r5, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + b _0810E1FE + .pool +_0810E1F8: + ldr r0, =0x0000ffe0 + strh r0, [r5, 0x20] + strh r0, [r5, 0x22] +_0810E1FE: + ldr r0, =0x0203841e + ldrh r0, [r0] + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x30] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl obj_translate_based_on_private_1_2_3_4 + ldr r0, =sub_810E24C + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810E1C8 + + thumb_func_start sub_810E24C +sub_810E24C: @ 810E24C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_80A6F3C + ldrh r1, [r4, 0x34] + lsrs r0, r1, 8 + cmp r0, 0xC8 + bls _0810E274 + ldrh r0, [r4, 0x24] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + movs r0, 0 + strh r0, [r4, 0x24] + movs r0, 0xFF + ands r0, r1 + strh r0, [r4, 0x34] +_0810E274: + movs r1, 0x20 + ldrsh r0, [r4, r1] + movs r2, 0x24 + ldrsh r1, [r4, r2] + adds r0, r1 + adds r0, 0x20 + movs r1, 0x98 + lsls r1, 1 + cmp r0, r1 + bhi _0810E296 + movs r1, 0x22 + ldrsh r0, [r4, r1] + movs r2, 0x26 + ldrsh r1, [r4, r2] + adds r0, r1 + cmp r0, 0xA0 + ble _0810E2BC +_0810E296: + movs r0, 0 + bl obj_id_for_side_relative_to_move + ldr r2, =0x02020630 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + adds r0, r4, 0 + bl move_anim_8072740 +_0810E2BC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810E24C + + thumb_func_start sub_810E2C8 +sub_810E2C8: @ 810E2C8 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + subs r1, r0, 0x1 + strh r1, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + bgt _0810E308 + ldrb r0, [r4, 0x1] + lsls r0, 30 + lsrs r0, 30 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0810E2FA + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] +_0810E2FA: + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + ldr r1, =0x020383fe + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_0810E308: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810E2C8 + + thumb_func_start sub_810E314 +sub_810E314: @ 810E314 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + adds r5, r7, 0 + adds r5, 0x2E + ldr r0, =0x0203841e + ldrh r1, [r0, 0xE] + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _0810E33C + ldr r0, =0x02038436 + b _0810E33E + .pool +_0810E33C: + ldr r0, =0x02038437 +_0810E33E: + ldrb r6, [r0] + adds r0, r6, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810E354 + ldr r1, =0x0203841e + ldrh r0, [r1] + negs r0, r0 + strh r0, [r1] +_0810E354: + adds r0, r6, 0 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + ldr r4, =0x0203841e + lsrs r0, 24 + ldrh r1, [r4] + adds r0, r1 + strh r0, [r7, 0x20] + adds r0, r6, 0 + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + ldrh r1, [r4, 0x2] + lsrs r0, 24 + adds r1, r0, r1 + strh r1, [r7, 0x22] + lsls r1, 8 + strh r1, [r5, 0x8] + ldrh r1, [r4, 0xC] + adds r0, r1 + lsls r0, 1 + ldrh r2, [r5, 0xE] + movs r1, 0x1 + ands r1, r2 + orrs r1, r0 + strh r1, [r5, 0xE] + ldrb r0, [r5] + movs r2, 0x4 + mov r8, r2 + mov r1, r8 + orrs r0, r1 + strb r0, [r5] + ldrh r0, [r4, 0x4] + ldrb r1, [r4, 0x4] + strh r1, [r5, 0x2] + lsls r0, 16 + lsrs r0, 24 + strh r0, [r5, 0xA] + ldrh r0, [r4, 0x6] + strh r0, [r5, 0x4] + ldrh r0, [r4, 0x8] + strh r0, [r5, 0x6] + ldrh r0, [r4, 0xA] + strh r0, [r5, 0xC] + subs r1, 0x40 + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0x7F + bhi _0810E44A + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810E3F0 + adds r0, r6, 0 + bl sub_80A8328 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + lsls r0, 2 + ldrb r2, [r7, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r7, 0x5] + b _0810E408 + .pool +_0810E3F0: + adds r0, r6, 0 + bl sub_80A8328 + movs r1, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r7, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r7, 0x5] +_0810E408: + ldrb r1, [r5, 0xE] + movs r4, 0x2 + negs r4, r4 + adds r0, r4, 0 + ands r0, r1 + strb r0, [r5, 0xE] + movs r2, 0x4 + ldrsh r0, [r5, r2] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + bne _0810E4AA + adds r3, r7, 0 + adds r3, 0x3F + ldrb r2, [r3] + lsls r0, r2, 31 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + lsls r0, 31 + lsrs r0, 31 + adds r1, r7, 0 + adds r1, 0x2A + strb r0, [r1] + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + b _0810E4A2 +_0810E44A: + adds r0, r6, 0 + bl sub_80A8328 + movs r1, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r7, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r7, 0x5] + ldrb r0, [r5, 0xE] + movs r4, 0x1 + orrs r0, r4 + strb r0, [r5, 0xE] + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0810E4AA + adds r3, r7, 0 + adds r3, 0x3F + ldrb r2, [r3] + lsls r1, r2, 31 + lsrs r1, 31 + movs r0, 0x1 + eors r1, r0 + ands r1, r4 + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + lsls r0, 31 + lsrs r0, 31 + adds r1, r7, 0 + adds r1, 0x2A + strb r0, [r1] + ldrb r0, [r3] + mov r2, r8 + orrs r0, r2 +_0810E4A2: + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + strb r0, [r3] +_0810E4AA: + ldrh r1, [r5, 0x2] + lsrs r1, 6 + lsls r1, 4 + ldrb r2, [r5] + movs r0, 0xF + ands r0, r2 + orrs r0, r1 + strb r0, [r5] + ldr r3, =gUnknown_08329F40 + ldrh r0, [r5, 0x2] + lsls r0, 1 + adds r0, r3 + movs r2, 0 + ldrsh r1, [r0, r2] + ldrb r0, [r5, 0xC] + muls r0, r1 + asrs r0, 8 + strh r0, [r7, 0x24] + ldrb r2, [r7, 0x3] + lsls r2, 26 + lsrs r2, 27 + movs r1, 0x24 + ldrsh r0, [r7, r1] + negs r0, r0 + asrs r0, 1 + ldrb r5, [r5, 0xA] + adds r0, r5 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r3 + ldrh r4, [r1] + ldr r1, =0x02021bc0 + lsls r2, 3 + adds r2, r1 + adds r0, 0x40 + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r2, 0x6] + strh r0, [r2] + strh r4, [r2, 0x2] + lsls r0, r4, 16 + asrs r0, 16 + negs r0, r0 + strh r0, [r2, 0x4] + ldr r0, =sub_810E520 + str r0, [r7, 0x1C] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810E314 + + thumb_func_start sub_810E520 +sub_810E520: @ 810E520 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r5, r0, 0 + movs r6, 0 + adds r4, r5, 0 + adds r4, 0x2E + ldrb r2, [r4] + movs r7, 0x1 + movs r0, 0x1 + mov r9, r0 + ands r0, r2 + cmp r0, 0 + beq _0810E55A + ldrb r0, [r4, 0x1] + adds r1, r0, 0 + adds r1, 0xFF + strb r1, [r4, 0x1] + lsls r0, 24 + cmp r0, 0 + beq _0810E54E + b _0810EA36 +_0810E54E: + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r4] + strb r6, [r4, 0x1] + b _0810EA36 +_0810E55A: + ldrh r0, [r4, 0x2] + lsrs r1, r0, 6 + mov r12, r0 + cmp r1, 0x1 + bne _0810E566 + b _0810E68A +_0810E566: + cmp r1, 0x1 + bgt _0810E570 + cmp r1, 0 + beq _0810E57E + b _0810E97C +_0810E570: + cmp r1, 0x2 + bne _0810E576 + b _0810E77E +_0810E576: + cmp r1, 0x3 + bne _0810E57C + b _0810E872 +_0810E57C: + b _0810E97C +_0810E57E: + lsls r1, r2, 24 + lsrs r0, r1, 28 + cmp r0, 0x1 + bne _0810E592 + movs r0, 0x8 + orrs r0, r2 + orrs r0, r7 + strb r0, [r4] + strb r6, [r4, 0x1] + b _0810E680 +_0810E592: + lsrs r0, r1, 28 + cmp r0, 0x3 + bne _0810E5B4 + lsls r0, r2, 30 + lsrs r0, 31 + movs r1, 0x1 + eors r0, r1 + ands r0, r7 + lsls r0, 1 + movs r1, 0x3 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + orrs r1, r7 + strb r1, [r4] + strb r6, [r4, 0x1] + b _0810E680 +_0810E5B4: + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _0810E680 + adds r3, r5, 0 + adds r3, 0x3F + ldrb r2, [r3] + lsls r1, r2, 31 + lsrs r1, 31 + movs r6, 0x1 + eors r1, r6 + ands r1, r7 + movs r0, 0x2 + negs r0, r0 + mov r8, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + lsls r0, 31 + lsrs r0, 31 + adds r1, r5, 0 + adds r1, 0x2A + strb r0, [r1] + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + strb r0, [r3] + ldrb r1, [r4] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0810E672 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810E642 + ldrb r1, [r4, 0xE] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + bne _0810E628 + ldrb r2, [r5, 0x5] + lsls r1, r2, 28 + lsrs r1, 30 + subs r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + b _0810E660 +_0810E628: + ldrb r2, [r5, 0x5] + lsls r1, r2, 28 + lsrs r1, 30 + adds r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + b _0810E660 +_0810E642: + ldrb r1, [r4, 0xE] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + bne _0810E656 + adds r1, r5, 0 + adds r1, 0x43 + ldrb r0, [r1] + subs r0, 0xC + b _0810E65E +_0810E656: + adds r1, r5, 0 + adds r1, 0x43 + ldrb r0, [r1] + adds r0, 0xC +_0810E65E: + strb r0, [r1] +_0810E660: + ldrb r2, [r4, 0xE] + lsls r0, r2, 31 + lsrs r0, 31 + eors r0, r6 + ands r0, r7 + mov r1, r8 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0xE] +_0810E672: + ldrb r1, [r4] + movs r0, 0x9 + negs r0, r0 + ands r0, r1 + strb r0, [r4] + ldrh r1, [r4, 0x2] + mov r12, r1 +_0810E680: + ldrb r1, [r4] + movs r0, 0xF + ands r0, r1 + strb r0, [r4] + b _0810E97C +_0810E68A: + lsls r1, r2, 24 + lsrs r0, r1, 28 + cmp r0, 0 + bne _0810E698 + movs r0, 0x8 + orrs r0, r2 + b _0810E6A0 +_0810E698: + lsrs r0, r1, 28 + cmp r0, 0x2 + bne _0810E6A8 + adds r0, r2, 0 +_0810E6A0: + orrs r0, r7 + strb r0, [r4] + strb r6, [r4, 0x1] + b _0810E774 +_0810E6A8: + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _0810E774 + adds r3, r5, 0 + adds r3, 0x3F + ldrb r2, [r3] + lsls r1, r2, 31 + lsrs r1, 31 + movs r6, 0x1 + eors r1, r6 + ands r1, r7 + movs r0, 0x2 + negs r0, r0 + mov r8, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + lsls r0, 31 + lsrs r0, 31 + adds r1, r5, 0 + adds r1, 0x2A + strb r0, [r1] + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + strb r0, [r3] + ldrb r1, [r4] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0810E766 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810E736 + ldrb r1, [r4, 0xE] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + bne _0810E71C + ldrb r2, [r5, 0x5] + lsls r1, r2, 28 + lsrs r1, 30 + subs r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + b _0810E754 +_0810E71C: + ldrb r2, [r5, 0x5] + lsls r1, r2, 28 + lsrs r1, 30 + adds r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + b _0810E754 +_0810E736: + ldrb r1, [r4, 0xE] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + bne _0810E74A + adds r1, r5, 0 + adds r1, 0x43 + ldrb r0, [r1] + subs r0, 0xC + b _0810E752 +_0810E74A: + adds r1, r5, 0 + adds r1, 0x43 + ldrb r0, [r1] + adds r0, 0xC +_0810E752: + strb r0, [r1] +_0810E754: + ldrb r2, [r4, 0xE] + lsls r0, r2, 31 + lsrs r0, 31 + eors r0, r6 + ands r0, r7 + mov r1, r8 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0xE] +_0810E766: + ldrb r1, [r4] + movs r0, 0x9 + negs r0, r0 + ands r0, r1 + strb r0, [r4] + ldrh r1, [r4, 0x2] + mov r12, r1 +_0810E774: + ldrb r0, [r4] + movs r1, 0xF + ands r1, r0 + movs r0, 0x10 + b _0810E978 +_0810E77E: + lsls r1, r2, 24 + lsrs r0, r1, 28 + cmp r0, 0x3 + bne _0810E78C + movs r0, 0x8 + orrs r0, r2 + b _0810E794 +_0810E78C: + lsrs r0, r1, 28 + cmp r0, 0x1 + bne _0810E79C + adds r0, r2, 0 +_0810E794: + orrs r0, r7 + strb r0, [r4] + strb r6, [r4, 0x1] + b _0810E868 +_0810E79C: + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _0810E868 + adds r3, r5, 0 + adds r3, 0x3F + ldrb r2, [r3] + lsls r1, r2, 31 + lsrs r1, 31 + movs r6, 0x1 + eors r1, r6 + ands r1, r7 + movs r0, 0x2 + negs r0, r0 + mov r8, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + lsls r0, 31 + lsrs r0, 31 + adds r1, r5, 0 + adds r1, 0x2A + strb r0, [r1] + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + strb r0, [r3] + ldrb r1, [r4] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0810E85A + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810E82A + ldrb r1, [r4, 0xE] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + bne _0810E810 + ldrb r2, [r5, 0x5] + lsls r1, r2, 28 + lsrs r1, 30 + subs r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + b _0810E848 +_0810E810: + ldrb r2, [r5, 0x5] + lsls r1, r2, 28 + lsrs r1, 30 + adds r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + b _0810E848 +_0810E82A: + ldrb r1, [r4, 0xE] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + bne _0810E83E + adds r1, r5, 0 + adds r1, 0x43 + ldrb r0, [r1] + subs r0, 0xC + b _0810E846 +_0810E83E: + adds r1, r5, 0 + adds r1, 0x43 + ldrb r0, [r1] + adds r0, 0xC +_0810E846: + strb r0, [r1] +_0810E848: + ldrb r2, [r4, 0xE] + lsls r0, r2, 31 + lsrs r0, 31 + eors r0, r6 + ands r0, r7 + mov r1, r8 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0xE] +_0810E85A: + ldrb r1, [r4] + movs r0, 0x9 + negs r0, r0 + ands r0, r1 + strb r0, [r4] + ldrh r1, [r4, 0x2] + mov r12, r1 +_0810E868: + ldrb r0, [r4] + movs r1, 0xF + ands r1, r0 + movs r0, 0x20 + b _0810E978 +_0810E872: + lsls r1, r2, 24 + lsrs r0, r1, 28 + cmp r0, 0x2 + bne _0810E882 + movs r0, 0x8 + orrs r0, r2 + strb r0, [r4] + b _0810E970 +_0810E882: + lsrs r0, r1, 28 + cmp r0, 0 + bne _0810E8A4 + lsls r0, r2, 30 + lsrs r0, 31 + movs r1, 0x1 + eors r0, r1 + ands r0, r7 + lsls r0, 1 + movs r1, 0x3 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + orrs r1, r7 + strb r1, [r4] + strb r6, [r4, 0x1] + b _0810E970 +_0810E8A4: + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _0810E970 + adds r3, r5, 0 + adds r3, 0x3F + ldrb r2, [r3] + lsls r1, r2, 31 + lsrs r1, 31 + movs r6, 0x1 + eors r1, r6 + ands r1, r7 + movs r0, 0x2 + negs r0, r0 + mov r8, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + lsls r0, 31 + lsrs r0, 31 + adds r1, r5, 0 + adds r1, 0x2A + strb r0, [r1] + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + strb r0, [r3] + ldrb r1, [r4] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0810E962 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810E932 + ldrb r1, [r4, 0xE] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + bne _0810E918 + ldrb r2, [r5, 0x5] + lsls r1, r2, 28 + lsrs r1, 30 + subs r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + b _0810E950 +_0810E918: + ldrb r2, [r5, 0x5] + lsls r1, r2, 28 + lsrs r1, 30 + adds r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + b _0810E950 +_0810E932: + ldrb r1, [r4, 0xE] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + bne _0810E946 + adds r1, r5, 0 + adds r1, 0x43 + ldrb r0, [r1] + subs r0, 0xC + b _0810E94E +_0810E946: + adds r1, r5, 0 + adds r1, 0x43 + ldrb r0, [r1] + adds r0, 0xC +_0810E94E: + strb r0, [r1] +_0810E950: + ldrb r2, [r4, 0xE] + lsls r0, r2, 31 + lsrs r0, 31 + eors r0, r6 + ands r0, r7 + mov r1, r8 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0xE] +_0810E962: + ldrb r1, [r4] + movs r0, 0x9 + negs r0, r0 + ands r0, r1 + strb r0, [r4] + ldrh r1, [r4, 0x2] + mov r12, r1 +_0810E970: + ldrb r0, [r4] + movs r1, 0xF + ands r1, r0 + movs r0, 0x30 +_0810E978: + orrs r1, r0 + strb r1, [r4] +_0810E97C: + ldrb r1, [r4] + lsls r1, 30 + lsrs r1, 31 + adds r0, r4, 0 + adds r0, 0xC + adds r0, r1 + ldrb r1, [r0] + ldr r3, =gUnknown_08329F40 + mov r2, r12 + lsls r0, r2, 1 + adds r0, r3 + movs r2, 0 + ldrsh r0, [r0, r2] + muls r0, r1 + asrs r0, 8 + strh r0, [r5, 0x24] + ldrb r2, [r5, 0x3] + lsls r2, 26 + lsrs r2, 27 + movs r1, 0x24 + ldrsh r0, [r5, r1] + negs r0, r0 + asrs r0, 1 + ldrb r1, [r4, 0xA] + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r3 + ldrh r6, [r1] + ldr r1, =0x02021bc0 + lsls r2, 3 + adds r2, r1 + adds r0, 0x40 + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r2, 0x6] + strh r0, [r2] + strh r6, [r2, 0x2] + lsls r0, r6, 16 + asrs r0, 16 + negs r0, r0 + strh r0, [r2, 0x4] + ldrh r0, [r4, 0x6] + ldrh r2, [r4, 0x8] + adds r0, r2 + strh r0, [r4, 0x8] + lsls r0, 16 + lsrs r0, 24 + strh r0, [r5, 0x22] + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0810EA0C + ldrh r0, [r4, 0x4] + subs r1, 0x1 + ands r1, r0 + ldrh r0, [r4, 0x2] + subs r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2] + b _0810EA1C + .pool +_0810EA0C: + ldrh r0, [r4, 0x4] + ldr r1, =0x00007fff + ands r1, r0 + ldrh r2, [r4, 0x2] + adds r1, r2 + movs r0, 0xFF + ands r1, r0 + strh r1, [r4, 0x2] +_0810EA1C: + movs r0, 0x22 + ldrsh r1, [r5, r0] + movs r2, 0x26 + ldrsh r0, [r5, r2] + adds r1, r0 + ldrh r0, [r4, 0xE] + lsrs r0, 1 + cmp r1, r0 + blt _0810EA36 + movs r0, 0 + strh r0, [r5, 0x2E] + ldr r0, =sub_810E2C8 + str r0, [r5, 0x1C] +_0810EA36: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810E520 + + thumb_func_start sub_810EA4C +sub_810EA4C: @ 810EA4C + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, =0x02038437 + ldrb r0, [r0] + bl sub_80A8328 + movs r1, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x5] + ldr r5, =0x02038436 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + ldr r0, =sub_80A7820 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810EA4C + + thumb_func_start sub_810EAA0 +sub_810EAA0: @ 810EAA0 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x0203841e + movs r1, 0x4 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810EABC + adds r0, r5, 0 + movs r1, 0 + bl sub_80A69CC + b _0810EAC4 + .pool +_0810EABC: + adds r0, r5, 0 + movs r1, 0 + bl sub_80A6980 +_0810EAC4: + ldr r4, =0x0203841e + movs r2, 0x4 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0810EADC + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810EAF2 +_0810EADC: + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _0810EAF8 + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810EAF8 +_0810EAF2: + ldrh r0, [r5, 0x20] + adds r0, 0x8 + strh r0, [r5, 0x20] +_0810EAF8: + ldr r4, =0x0203841e + ldrb r1, [r4, 0x8] + adds r0, r5, 0 + bl SeekObjectImageAnim + ldrh r0, [r5, 0x20] + subs r0, 0x20 + strh r0, [r5, 0x20] + ldr r0, =0x00000ccc + strh r0, [r5, 0x30] + ldrh r1, [r4, 0x8] + movs r0, 0xC + adds r2, r0, 0 + muls r2, r1 + adds r0, r2, 0 + ldrh r2, [r5, 0x24] + adds r0, r2 + strh r0, [r5, 0x24] + strh r1, [r5, 0x2E] + ldrh r0, [r4, 0x6] + strh r0, [r5, 0x3C] + ldr r0, =sub_810EB40 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810EAA0 + + thumb_func_start sub_810EB40 +sub_810EB40: @ 810EB40 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r4, 0x24] + adds r0, r1 + movs r1, 0 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bne _0810EB6A + strh r1, [r4, 0x2E] + strh r1, [r4, 0x24] + adds r0, r4, 0 + bl StartObjectImageAnim +_0810EB6A: + ldrh r0, [r4, 0x3C] + subs r0, 0x1 + strh r0, [r4, 0x3C] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0810EB82 + adds r0, r4, 0 + bl move_anim_8072740 +_0810EB82: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810EB40 + + thumb_func_start sub_810EB88 +sub_810EB88: @ 810EB88 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r7, r0, r1 + ldrh r0, [r7, 0x8] + movs r1, 0x1F + ands r0, r1 + cmp r0, 0 + bne _0810EC02 + ldr r1, =0x020383fe + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r1, 0x8 + ldrsh r0, [r7, r1] + movs r5, 0xD + negs r5, r5 + adds r1, r5, 0 + bl sine + ldr r4, =0x0203841e + strh r0, [r4] + movs r1, 0x8 + ldrsh r0, [r7, r1] + adds r1, r5, 0 + bl cosine + strh r0, [r4, 0x2] + movs r0, 0x1 + strh r0, [r4, 0x4] + movs r0, 0x3 + strh r0, [r4, 0x6] + ldr r0, =gUnknown_085973E8 + mov r8, r0 + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + mov r0, r8 + adds r1, r4, 0 + movs r3, 0x3 + bl AddObjectAndAnimateForOneFrame +_0810EC02: + ldrh r0, [r7, 0x8] + adds r0, 0x8 + strh r0, [r7, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _0810EC16 + adds r0, r6, 0 + bl move_anim_task_del +_0810EC16: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810EB88 + + thumb_func_start sub_810EC34 +sub_810EC34: @ 810EC34 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0810EC46 + cmp r0, 0x1 + beq _0810EC78 + b _0810EC8C +_0810EC46: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A69CC + movs r0, 0 + bl obj_id_for_side_relative_to_move + ldr r2, =0x02020630 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0810EC8C + .pool +_0810EC78: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0810EC8C + adds r0, r4, 0 + bl move_anim_8072740 +_0810EC8C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810EC34 + + thumb_func_start sub_810EC94 +sub_810EC94: @ 810EC94 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0810ECCC + cmp r0, 0x1 + bgt _0810ECAA + cmp r0, 0 + beq _0810ECB0 + b _0810ED1E +_0810ECAA: + cmp r0, 0x2 + beq _0810ECE0 + b _0810ED1E +_0810ECB0: + ldr r0, =0x02038437 + ldrb r0, [r0] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + negs r0, r0 + subs r0, 0x20 + strh r0, [r4, 0x26] + b _0810ECD8 + .pool +_0810ECCC: + ldrh r0, [r4, 0x26] + adds r0, 0xA + strh r0, [r4, 0x26] + lsls r0, 16 + cmp r0, 0 + blt _0810ED1E +_0810ECD8: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0810ED1E +_0810ECE0: + ldrh r0, [r4, 0x26] + subs r0, 0xA + strh r0, [r4, 0x26] + movs r2, 0x22 + ldrsh r0, [r4, r2] + movs r2, 0x26 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bge _0810ED1E + movs r0, 0 + bl obj_id_for_side_relative_to_move + ldr r2, =0x02020630 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + adds r0, r4, 0 + bl move_anim_8072740 +_0810ED1E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810EC94 + + thumb_func_start sub_810ED28 +sub_810ED28: @ 810ED28 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x30] + ldr r0, =sub_810ED70 + str r0, [r4, 0x1C] + movs r0, 0 + bl obj_id_for_side_relative_to_move + ldr r2, =0x02020630 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810ED28 + + thumb_func_start sub_810ED70 +sub_810ED70: @ 810ED70 + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x2E] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + ble _0810ED84 + subs r0, r1, 0x1 + strh r0, [r2, 0x2E] + b _0810EDC8 +_0810ED84: + movs r1, 0x22 + ldrsh r0, [r2, r1] + movs r3, 0x26 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + ble _0810EDAA + ldrh r0, [r2, 0x30] + ldrh r1, [r2, 0x32] + adds r0, r1 + strh r0, [r2, 0x32] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r2, 0x26] + subs r1, r0 + strh r1, [r2, 0x26] + b _0810EDC8 +_0810EDAA: + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r3] + ldrh r0, [r2, 0x34] + adds r1, r0, 0x1 + strh r1, [r2, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _0810EDC8 + ldr r0, =sub_810EDD0 + str r0, [r2, 0x1C] +_0810EDC8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_810ED70 + + thumb_func_start sub_810EDD0 +sub_810EDD0: @ 810EDD0 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x32] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r2, 0x26] + adds r0, r1 + strh r0, [r2, 0x26] + movs r3, 0x22 + ldrsh r0, [r2, r3] + movs r3, 0x26 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + ble _0810EE00 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] +_0810EE00: + movs r1, 0x26 + ldrsh r0, [r2, r1] + cmp r0, 0 + ble _0810EE0E + adds r0, r2, 0 + bl move_anim_8072740 +_0810EE0E: + pop {r0} + bx r0 + thumb_func_end sub_810EDD0 + + thumb_func_start sub_810EE14 +sub_810EE14: @ 810EE14 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _0810EE28 + cmp r0, 0x1 + beq _0810EE80 + b _0810EEEC +_0810EE28: + ldr r0, =0x0203841e + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _0810EE40 + ldr r4, =0x02038436 + b _0810EE42 + .pool +_0810EE40: + ldr r4, =0x02038437 +_0810EE42: + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + movs r0, 0 + movs r3, 0x80 + lsls r3, 2 + strh r3, [r5, 0x30] + movs r2, 0x80 + lsls r2, 1 + str r0, [sp] + adds r0, r5, 0 + movs r1, 0 + bl sub_80A73E0 + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + b _0810EEEC + .pool +_0810EE80: + movs r1, 0x32 + ldrsh r0, [r5, r1] + cmp r0, 0xB + bgt _0810EE8E + ldrh r0, [r5, 0x30] + subs r0, 0x28 + b _0810EE92 +_0810EE8E: + ldrh r0, [r5, 0x30] + adds r0, 0x28 +_0810EE92: + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x32] + adds r0, 0x1 + movs r1, 0 + strh r0, [r5, 0x32] + movs r2, 0x80 + lsls r2, 1 + movs r0, 0x30 + ldrsh r3, [r5, r0] + str r1, [sp] + adds r0, r5, 0 + bl sub_80A73E0 + ldrb r1, [r5, 0x3] + lsls r1, 26 + lsrs r1, 27 + movs r0, 0xF4 + lsls r0, 6 + ldr r2, =0x02021bc0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x6 + ldrsh r1, [r1, r2] + bl __divsi3 + adds r1, r0, 0x1 + cmp r1, 0x80 + ble _0810EECC + movs r1, 0x80 +_0810EECC: + movs r0, 0x40 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r1, r0, 1 + strh r1, [r5, 0x26] + movs r1, 0x32 + ldrsh r0, [r5, r1] + cmp r0, 0x18 + bne _0810EEEC + adds r0, r5, 0 + bl sub_80A749C + adds r0, r5, 0 + bl move_anim_8072740 +_0810EEEC: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810EE14 + + thumb_func_start sub_810EEF8 +sub_810EEF8: @ 810EEF8 + push {r4,r5,lr} + adds r5, r0, 0 + bl GenerateRandomNumber2 + ldr r4, =0x000001ff + ands r4, r0 + bl GenerateRandomNumber2 + movs r1, 0x7F + ands r1, r0 + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0810EF20 + movs r2, 0xB8 + lsls r2, 2 + adds r0, r4, r2 + b _0810EF28 + .pool +_0810EF20: + movs r2, 0xB8 + lsls r2, 2 + adds r0, r2, 0 + subs r0, r4 +_0810EF28: + strh r0, [r5, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0810EF3C + movs r2, 0xE0 + lsls r2, 2 + adds r0, r2, 0 + adds r0, r1, r0 + b _0810EF44 +_0810EF3C: + movs r2, 0xE0 + lsls r2, 2 + adds r0, r2, 0 + subs r0, r1 +_0810EF44: + strh r0, [r5, 0x30] + ldr r2, =0x0203841e + ldrh r0, [r2] + strh r0, [r5, 0x32] + lsls r0, 16 + cmp r0, 0 + beq _0810EF60 + ldrb r0, [r5, 0x3] + movs r1, 0x3F + negs r1, r1 + ands r1, r0 + movs r0, 0x10 + orrs r1, r0 + strb r1, [r5, 0x3] +_0810EF60: + movs r1, 0x2 + ldrsh r0, [r2, r1] + cmp r0, 0 + bne _0810EF74 + ldr r4, =0x02038436 + b _0810EF76 + .pool +_0810EF74: + ldr r4, =0x02038437 +_0810EF76: + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x20 + strh r0, [r5, 0x22] + ldr r0, =sub_810EFA8 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810EEF8 + + thumb_func_start sub_810EFA8 +sub_810EFA8: @ 810EFA8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0810EFC0 + ldrh r3, [r4, 0x2E] + lsls r0, r3, 16 + asrs r0, 24 + ldrh r1, [r4, 0x24] + adds r0, r1 + b _0810EFCA +_0810EFC0: + ldrh r3, [r4, 0x2E] + lsls r1, r3, 16 + asrs r1, 24 + ldrh r0, [r4, 0x24] + subs r0, r1 +_0810EFCA: + strh r0, [r4, 0x24] + ldrh r2, [r4, 0x30] + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r4, 0x26] + subs r0, r1 + strh r0, [r4, 0x26] + strh r3, [r4, 0x2E] + adds r0, r2, 0 + subs r0, 0x20 + strh r0, [r4, 0x30] + lsls r0, r3, 16 + cmp r0, 0 + bge _0810EFEA + movs r0, 0 + strh r0, [r4, 0x2E] +_0810EFEA: + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _0810EFFE + adds r0, r4, 0 + bl move_anim_8072740 +_0810EFFE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810EFA8 + + thumb_func_start sub_810F004 +sub_810F004: @ 810F004 + movs r1, 0 + strh r1, [r0, 0x3A] + movs r1, 0x40 + strh r1, [r0, 0x3C] + ldr r1, =sub_810F018 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_810F004 + + thumb_func_start sub_810F018 +sub_810F018: @ 810F018 + push {lr} + adds r3, r0, 0 + movs r0, 0x2E + ldrsh r1, [r3, r0] + cmp r1, 0 + beq _0810F02A + cmp r1, 0x1 + beq _0810F078 + b _0810F07E +_0810F02A: + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _0810F07E + strh r1, [r3, 0x30] + movs r1, 0x3E + adds r1, r3 + mov r12, r1 + ldrb r2, [r1] + 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 + mov r1, r12 + strb r0, [r1] + ldrh r0, [r3, 0x32] + adds r0, 0x1 + strh r0, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _0810F07E + ldrb r1, [r1] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0810F07E + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + b _0810F07E +_0810F078: + adds r0, r3, 0 + bl move_anim_8072740 +_0810F07E: + pop {r0} + bx r0 + thumb_func_end sub_810F018 + + thumb_func_start sub_810F084 +sub_810F084: @ 810F084 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + mov r8, r0 + ldrh r4, [r0, 0x20] + ldrh r5, [r0, 0x22] + ldr r6, =0x02038436 + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + strh r0, [r1, 0x20] + ldrb r0, [r6] + movs r1, 0x3 + bl sub_80A5C6C + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + mov r2, r8 + strh r6, [r2, 0x22] + ldrh r0, [r2, 0x20] + mov r9, r0 + mov r1, r9 + lsls r0, r1, 4 + strh r0, [r2, 0x36] + lsls r0, r6, 4 + strh r0, [r2, 0x38] + lsls r4, 16 + asrs r4, 16 + movs r1, 0x20 + ldrsh r0, [r2, r1] + subs r0, r4, r0 + lsls r0, 4 + movs r1, 0xC + bl __divsi3 + mov r2, r8 + strh r0, [r2, 0x3A] + lsls r5, 16 + asrs r5, 16 + movs r1, 0x22 + ldrsh r0, [r2, r1] + subs r0, r5, r0 + lsls r0, 4 + movs r1, 0xC + bl __divsi3 + mov r2, r8 + strh r0, [r2, 0x3C] + mov r0, r9 + subs r4, r0 + lsls r4, 16 + asrs r4, 16 + subs r5, r6 + lsls r5, 16 + asrs r5, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80A74F4 + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 24 + adds r0, r1 + lsrs r0, 16 + movs r3, 0x80 + lsls r3, 1 + str r0, [sp] + mov r0, r8 + movs r1, 0x1 + adds r2, r3, 0 + bl sub_80A73E0 + ldr r0, =sub_810F140 + mov r2, r8 + str r0, [r2, 0x1C] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810F084 + + thumb_func_start sub_810F140 +sub_810F140: @ 810F140 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x3A] + ldrh r1, [r2, 0x36] + adds r0, r1 + strh r0, [r2, 0x36] + ldrh r1, [r2, 0x3C] + ldrh r3, [r2, 0x38] + adds r1, r3 + strh r1, [r2, 0x38] + lsls r0, 16 + asrs r0, 20 + strh r0, [r2, 0x20] + lsls r1, 16 + asrs r3, r1, 20 + strh r3, [r2, 0x22] + adds r0, 0x2D + lsls r0, 16 + movs r1, 0xA5 + lsls r1, 17 + cmp r0, r1 + bhi _0810F17A + adds r1, r3, 0 + cmp r1, 0x9D + bgt _0810F17A + movs r0, 0x2D + negs r0, r0 + cmp r1, r0 + bge _0810F180 +_0810F17A: + adds r0, r2, 0 + bl move_anim_8074EE0 +_0810F180: + pop {r0} + bx r0 + thumb_func_end sub_810F140 + + thumb_func_start sub_810F184 +sub_810F184: @ 810F184 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810F1BC + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + b _0810F1DA + .pool +_0810F1BC: + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 +_0810F1DA: + strb r0, [r1] + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810F184 + + thumb_func_start sub_810F1EC +sub_810F1EC: @ 810F1EC + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + bl sub_80A4DF0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810F212 + mov r0, r8 + cmp r0, 0 + beq _0810F22E +_0810F212: + ldrb r1, [r5, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r5, 0x5] + adds r1, r5, 0 + adds r1, 0x43 + movs r0, 0xC8 + strb r0, [r1] + mov r1, r8 + cmp r1, 0 + bne _0810F2B8 +_0810F22E: + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r4, r0, 24 + adds r7, r4, 0 + adds r0, r4, 0 + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + eors r0, r1 + negs r1, r0 + orrs r1, r0 + lsrs r6, r1, 31 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810F264 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_80A438C +_0810F264: + movs r0, 0x2 + adds r4, r0, 0 + eors r4, r7 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810F284 + movs r0, 0x1 + eors r6, r0 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_80A438C +_0810F284: + mov r0, r8 + cmp r0, 0 + bne _0810F2B8 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0810F2B8 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810F2B0 + movs r0, 0x48 + strh r0, [r5, 0x20] + movs r0, 0x50 + b _0810F2F2 + .pool +_0810F2B0: + movs r0, 0xB0 + strh r0, [r5, 0x20] + movs r0, 0x28 + b _0810F2F2 +_0810F2B8: + ldr r6, =0x02038436 + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810F2CE + ldr r1, =0x0203841e + ldrh r0, [r1] + negs r0, r0 + strh r0, [r1] +_0810F2CE: + ldrb r0, [r6] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + ldr r4, =0x0203841e + lsrs r0, 24 + ldrh r1, [r4] + adds r0, r1 + strh r0, [r5, 0x20] + ldrb r0, [r6] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r4, [r4, 0x2] + adds r0, r4 +_0810F2F2: + strh r0, [r5, 0x22] + ldr r0, =0x0203841e + ldrh r0, [r0, 0x4] + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 20 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r0, [r5, 0x2E] + mov r0, r8 + cmp r0, 0 + beq _0810F32C + ldrh r0, [r5, 0x22] + adds r0, 0x9 + strh r0, [r5, 0x22] + ldr r1, =sub_810F3C8 + str r1, [r5, 0x1C] + adds r0, r5, 0 + bl _call_via_r1 + b _0810F330 + .pool +_0810F32C: + ldr r0, =sub_810F340 + str r0, [r5, 0x1C] +_0810F330: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810F1EC + + thumb_func_start sub_810F340 +sub_810F340: @ 810F340 + push {r4,r5,lr} + adds r5, r0, 0 + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r4, r0, 24 + movs r1, 0x3C + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0810F35C + movs r0, 0x1 + strh r0, [r5, 0x3C] + b _0810F3B6 +_0810F35C: + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810F382 + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + adds r0, r4, r0 + 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] +_0810F382: + movs r0, 0x2 + eors r4, r0 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810F3AC + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + adds r0, r4, r0 + 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] +_0810F3AC: + ldr r1, =sub_810F3C8 + str r1, [r5, 0x1C] + adds r0, r5, 0 + bl _call_via_r1 +_0810F3B6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810F340 + + thumb_func_start sub_810F3C8 +sub_810F3C8: @ 810F3C8 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x34] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + ldrh r1, [r4, 0x34] + movs r2, 0x34 + ldrsh r0, [r4, r2] + cmp r0, 0xD + bne _0810F3F4 + ldr r0, =sub_810F400 + str r0, [r4, 0x1C] + b _0810F3F8 + .pool +_0810F3F4: + adds r0, r1, 0x1 + strh r0, [r4, 0x34] +_0810F3F8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810F3C8 + + thumb_func_start sub_810F400 +sub_810F400: @ 810F400 + push {r4-r7,lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _0810F45E + movs r0, 0 + strh r0, [r3, 0x30] + ldrh r4, [r3, 0x2E] + ldr r1, =0x02037b14 + adds r0, r4, 0 + adds r0, 0x8 + lsls r0, 1 + adds r0, r1 + ldrh r7, [r0] + movs r5, 0x8 + adds r6, r1, 0 + adds r1, r4, 0x7 + lsls r0, r4, 1 + adds r0, r6 + adds r2, r0, 0 + adds r2, 0x10 + lsls r1, 1 + adds r1, r6 +_0810F436: + ldrh r0, [r1] + strh r0, [r2] + subs r1, 0x2 + subs r2, 0x2 + subs r5, 0x1 + cmp r5, 0 + bgt _0810F436 + adds r0, r4, 0x1 + lsls r0, 1 + adds r0, r6 + strh r7, [r0] + ldrh r0, [r3, 0x32] + adds r0, 0x1 + strh r0, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + bne _0810F45E + ldr r0, =sub_810F46C + str r0, [r3, 0x1C] +_0810F45E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810F400 + + thumb_func_start sub_810F46C +sub_810F46C: @ 810F46C + push {r4-r6,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x34] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + ldrh r0, [r5, 0x34] + subs r0, 0x1 + strh r0, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0810F512 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810F502 + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810F4D4 + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + adds r0, r4, r0 + ldrb r1, [r0] + 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] +_0810F4D4: + movs r0, 0x2 + adds r4, r0, 0 + eors r4, r6 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810F502 + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + adds r0, r4, r0 + ldrb r1, [r0] + 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] +_0810F502: + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_810F524 + str r0, [r5, 0x1C] +_0810F512: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810F46C + + thumb_func_start sub_810F524 +sub_810F524: @ 810F524 + push {r4-r6,lr} + adds r6, r0, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810F57C + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + eors r0, r1 + negs r1, r0 + orrs r1, r0 + lsrs r5, r1, 31 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810F562 + adds r0, r5, 0 + bl sub_80A477C +_0810F562: + movs r0, 0x2 + eors r4, r0 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0810F57C + movs r0, 0x1 + eors r5, r0 + adds r0, r5, 0 + bl sub_80A477C +_0810F57C: + ldr r0, =move_anim_8072740 + str r0, [r6, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810F524 + + thumb_func_start sub_810F58C +sub_810F58C: @ 810F58C + push {r4-r6,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0810F618 + ldr r5, =0x0203841e + movs r1, 0x6 + ldrsh r0, [r5, r1] + movs r6, 0 + cmp r0, 0 + bne _0810F5A6 + movs r6, 0x1 +_0810F5A6: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0810F5EE + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0810F5EE + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0810F5E0 + ldrh r0, [r5] + movs r1, 0x48 + subs r1, r0 + strh r1, [r4, 0x20] + ldrh r0, [r5, 0x2] + adds r0, 0x50 + strh r0, [r4, 0x22] + b _0810F610 + .pool +_0810F5E0: + ldrh r0, [r5] + adds r0, 0xB0 + strh r0, [r4, 0x20] + ldrh r0, [r5, 0x2] + adds r0, 0x28 + strh r0, [r4, 0x22] + b _0810F610 +_0810F5EE: + ldr r0, =0x0203841e + movs r1, 0x4 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0810F608 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80A69CC + b _0810F610 + .pool +_0810F608: + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80A6980 +_0810F610: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0810F62C +_0810F618: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0 + beq _0810F62C + adds r0, r4, 0 + bl move_anim_8074EE0 +_0810F62C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_810F58C + + thumb_func_start sub_810F634 +sub_810F634: @ 810F634 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0810F684 + adds r0, r5, 0 + movs r1, 0x1 + bl StartObjectImageAnim + ldrh r0, [r5, 0x20] + subs r0, 0x28 + strh r0, [r5, 0x20] + ldrh r0, [r5, 0x22] + adds r0, 0xA + strh r0, [r5, 0x22] + ldr r0, =0x0000ffff + b _0810F692 + .pool +_0810F684: + ldrh r0, [r5, 0x20] + adds r0, 0x28 + strh r0, [r5, 0x20] + ldrh r0, [r5, 0x22] + subs r0, 0xA + strh r0, [r5, 0x22] + movs r0, 0x1 +_0810F692: + strh r0, [r5, 0x30] + ldr r1, =move_anim_8072740 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A67D8 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810F634 + + thumb_func_start sub_810F6B0 +sub_810F6B0: @ 810F6B0 + push {r4-r7,lr} + adds r5, r0, 0 + ldr r6, =0x02038436 + ldrb r0, [r6] + movs r1, 0x1 + bl sub_80A861C + lsls r0, 16 + asrs r1, r0, 16 + lsrs r0, 31 + adds r1, r0 + lsls r1, 15 + lsrs r4, r1, 16 + ldrb r0, [r6] + movs r1, 0 + bl sub_80A861C + lsls r0, 16 + asrs r1, r0, 16 + lsrs r0, 31 + adds r1, r0 + asrs r1, 1 + negs r1, r1 + lsls r1, 16 + lsrs r7, r1, 16 + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0810F6F6 + lsls r0, r4, 16 + negs r0, r0 + lsrs r4, r0, 16 +_0810F6F6: + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + strh r0, [r5, 0x20] + ldrb r0, [r6] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r7 + strh r0, [r5, 0x22] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + bgt _0810F722 + movs r0, 0x10 + strh r0, [r5, 0x22] +_0810F722: + ldr r1, =sub_810F740 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A67D8 + str r0, [r5, 0x1C] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810F6B0 + + thumb_func_start sub_810F740 +sub_810F740: @ 810F740 + push {r4,lr} + adds r4, r0, 0 + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4, 0x1] + ldr r0, =gUnknown_08596740 + str r0, [r4, 0x10] + movs r0, 0 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl obj_alloc_rotscale_entry + ldr r0, =sub_810F774 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810F740 + + thumb_func_start sub_810F774 +sub_810F774: @ 810F774 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0810F786 + cmp r0, 0x1 + beq _0810F7B4 + b _0810F7CC +_0810F786: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0810F7CC + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] + movs r0, 0x12 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0810F7CC +_0810F7B4: + ldrh r0, [r4, 0x30] + subs r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0810F7CC + adds r0, r4, 0 + bl move_anim_8072740 +_0810F7CC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810F774 + + thumb_func_start sub_810F7D4 +sub_810F7D4: @ 810F7D4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + strh r1, [r4, 0x8] + ldr r2, =gUnknown_0859675C + adds r0, r4, 0 + bl sub_80A7CFC + ldr r0, =sub_810F810 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810F7D4 + + thumb_func_start sub_810F810 +sub_810F810: @ 810F810 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r0, r1 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _0810F830 + adds r0, r4, 0 + bl move_anim_task_del +_0810F830: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810F810 + + thumb_func_start sub_810F83C +sub_810F83C: @ 810F83C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r4, r1, r0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + strh r0, [r4, 0x8] + strh r1, [r4, 0xA] + strh r1, [r4, 0xC] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + movs r1, 0x8 + cmp r0, 0 + beq _0810F870 + movs r1, 0x4 +_0810F870: + strh r1, [r4, 0xE] + ldrb r1, [r4, 0x8] + ldr r2, =gUnknown_0859677C + adds r0, r4, 0 + bl sub_80A7CFC + ldr r0, =sub_810F898 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810F83C + + thumb_func_start sub_810F898 +sub_810F898: @ 810F898 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0810F8BC + cmp r0, 0x1 + beq _0810F8D8 + b _0810F936 + .pool +_0810F8BC: + adds r0, r4, 0 + bl sub_80A7D34 + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _0810F936 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + b _0810F936 +_0810F8D8: + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0810F900 + ldr r2, =0x02020630 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + subs r1, 0x8 + strh r1, [r0, 0x26] + ldrh r0, [r4, 0xE] + subs r0, 0x1 + strh r0, [r4, 0xE] + b _0810F936 + .pool +_0810F900: + ldr r3, =0x02020630 + movs r0, 0x8 + ldrsh r1, [r4, r0] + 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] + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x88 + lsls r1, 1 + strh r1, [r0, 0x20] + ldrb r0, [r4, 0x8] + bl sub_80A7344 + adds r0, r5, 0 + bl move_anim_task_del +_0810F936: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810F898 + + thumb_func_start sub_810F940 +sub_810F940: @ 810F940 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r5, r1, r0 + movs r1, 0 + movs r0, 0x10 + strh r0, [r5, 0xE] + strh r1, [r5, 0x10] + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x24] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A861C + lsls r0, 16 + asrs r0, 16 + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + lsrs r6, r0, 16 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A861C + lsls r0, 16 + asrs r0, 16 + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + adds r1, r0, 0 + cmp r0, r6 + bcs _0810F9AA + adds r1, r6, 0 +_0810F9AA: + strh r1, [r5, 0x20] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0x10 + bl SetGpuReg + ldr r0, =sub_810F9D4 + str r0, [r5] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810F940 + + thumb_func_start sub_810F9D4 +sub_810F9D4: @ 810F9D4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _0810FAD4 + cmp r1, 0x1 + bgt _0810F9FC + cmp r1, 0 + beq _0810FA0A + b _0810FB5A + .pool +_0810F9FC: + cmp r1, 0x2 + bne _0810FA02 + b _0810FB36 +_0810FA02: + cmp r1, 0x3 + bne _0810FA08 + b _0810FB44 +_0810FA08: + b _0810FB5A +_0810FA0A: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + bgt _0810FA1A + b _0810FB5A +_0810FA1A: + strh r1, [r4, 0xA] + ldr r0, =gUnknown_08596794 + movs r2, 0x22 + ldrsh r1, [r4, r2] + movs r3, 0x24 + ldrsh r2, [r4, r3] + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r2, r0, 24 + movs r0, 0xC + ldrsh r1, [r4, r0] + adds r1, 0x8 + lsls r1, 1 + adds r0, r4, 0 + adds r0, 0x8 + adds r0, r1 + strh r2, [r0] + cmp r2, 0x40 + beq _0810FABE + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0810FA78 + cmp r0, 0x1 + bgt _0810FA5C + cmp r0, 0 + beq _0810FA66 + b _0810FABE + .pool +_0810FA5C: + cmp r0, 0x2 + beq _0810FA90 + cmp r0, 0x3 + beq _0810FAA8 + b _0810FABE +_0810FA66: + ldr r0, =0x02020630 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r4, 0x20] + b _0810FAB6 + .pool +_0810FA78: + ldr r0, =0x02020630 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r4, 0x20] + negs r0, r0 + strh r0, [r1, 0x24] + ldrh r0, [r4, 0x20] + b _0810FABC + .pool +_0810FA90: + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r4, 0x20] + strh r1, [r0, 0x24] + ldrh r1, [r4, 0x20] + strh r1, [r0, 0x26] + b _0810FABE + .pool +_0810FAA8: + ldr r0, =0x02020630 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r4, 0x20] + negs r0, r0 +_0810FAB6: + strh r0, [r1, 0x24] + ldrh r0, [r4, 0x20] + negs r0, r0 +_0810FABC: + strh r0, [r1, 0x26] +_0810FABE: + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _0810FB5A + b _0810FB36 + .pool +_0810FAD4: + ldrh r0, [r4, 0xA] + ands r1, r0 + cmp r1, 0 + beq _0810FAE4 + ldrh r0, [r4, 0xE] + subs r0, 0x1 + strh r0, [r4, 0xE] + b _0810FAEA +_0810FAE4: + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] +_0810FAEA: + ldrh r1, [r4, 0x10] + lsls r1, 8 + ldrh r0, [r4, 0xE] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x20 + bne _0810FB5A + movs r5, 0x8 + adds r6, r4, 0 + adds r6, 0x8 +_0810FB10: + lsls r0, r5, 1 + adds r1, r6, r0 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0x40 + beq _0810FB2C + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles +_0810FB2C: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0xC + bls _0810FB10 +_0810FB36: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0810FB5A + .pool +_0810FB44: + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + adds r0, r5, 0 + bl move_anim_task_del +_0810FB5A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_810F9D4 + + thumb_func_start sub_810FB60 +sub_810FB60: @ 810FB60 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x30 + ldrsh r1, [r4, r0] + movs r2, 0x2E + ldrsh r0, [r4, r2] + subs r0, 0xA + cmp r1, r0 + ble _0810FB8A + ldrh r0, [r4, 0x30] + movs r1, 0x1 + ands r1, r0 + adds r3, r4, 0 + adds r3, 0x3E + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_0810FB8A: + movs r0, 0x30 + ldrsh r1, [r4, r0] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _0810FB9C + adds r0, r4, 0 + bl move_anim_8072740 +_0810FB9C: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810FB60 + + thumb_func_start sub_810FBA8 +sub_810FBA8: @ 810FBA8 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, =0x0203841e + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0810FBD4 + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] +_0810FBD4: + ldrh r0, [r6, 0x2] + strh r0, [r5, 0x2E] + ldr r0, =sub_810FB60 + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810FBA8 + + thumb_func_start sub_810FBF0 +sub_810FBF0: @ 810FBF0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r5, r1, r0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0810FC94 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + bne _0810FC60 + ldr r0, =0x0000fff6 + strh r0, [r5, 0x1C] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x5 + bl sub_80A861C + subs r0, 0x8 + strh r0, [r5, 0x1E] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A861C + adds r0, 0x8 + strh r0, [r5, 0x20] + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x5 + bl sub_80A861C + subs r0, 0x8 + strh r0, [r5, 0x22] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A861C + adds r0, 0x8 + b _0810FD1E + .pool +_0810FC60: + movs r0, 0xA + strh r0, [r5, 0x1C] + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x4 + bl sub_80A861C + adds r0, 0x8 + strh r0, [r5, 0x1E] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A861C + subs r0, 0x8 + strh r0, [r5, 0x20] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x4 + bl sub_80A861C + adds r0, 0x8 + b _0810FD12 + .pool +_0810FC94: + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + bne _0810FCE8 + ldr r0, =0x0000fff6 + strh r0, [r5, 0x1C] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x4 + bl sub_80A861C + adds r0, 0x8 + strh r0, [r5, 0x1E] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A861C + adds r0, 0x8 + strh r0, [r5, 0x20] + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x4 + bl sub_80A861C + adds r0, 0x8 + strh r0, [r5, 0x22] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A861C + adds r0, 0x8 + b _0810FD1E + .pool +_0810FCE8: + movs r0, 0xA + strh r0, [r5, 0x1C] + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x5 + bl sub_80A861C + subs r0, 0x8 + strh r0, [r5, 0x1E] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A861C + subs r0, 0x8 + strh r0, [r5, 0x20] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x5 + bl sub_80A861C + subs r0, 0x8 +_0810FD12: + strh r0, [r5, 0x22] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A861C + subs r0, 0x8 +_0810FD1E: + strh r0, [r5, 0x24] + movs r0, 0x6 + strh r0, [r5, 0xA] + ldr r0, =sub_810FD3C + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810FBF0 + + thumb_func_start sub_810FD3C +sub_810FD3C: @ 810FD3C + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r5, r0, r1 + movs r0, 0x8 + ldrsh r1, [r5, r0] + cmp r1, 0 + beq _0810FD60 + cmp r1, 0x1 + beq _0810FDD4 + b _0810FDE8 + .pool +_0810FD60: + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + ble _0810FDE8 + strh r1, [r5, 0xA] + ldr r0, =gUnknown_08596864 + movs r2, 0x1E + ldrsh r1, [r5, r2] + movs r3, 0x20 + ldrsh r2, [r5, r3] + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _0810FDB4 + ldr r0, =0x02020630 + lsls r4, r1, 4 + adds r4, r1 + lsls r4, 2 + adds r4, r0 + movs r0, 0x10 + strh r0, [r4, 0x2E] + ldrh r0, [r5, 0x22] + strh r0, [r4, 0x32] + ldrh r0, [r5, 0x24] + strh r0, [r4, 0x36] + ldrh r0, [r5, 0x1C] + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl sub_80A68D4 + ldrb r0, [r5, 0xC] + movs r1, 0x3 + ands r1, r0 + adds r0, r4, 0 + bl StartObjectRotScalAnim +_0810FDB4: + ldrh r0, [r5, 0xC] + adds r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + bne _0810FDE8 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _0810FDE8 + .pool +_0810FDD4: + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x11 + ble _0810FDE8 + adds r0, r2, 0 + bl move_anim_task_del +_0810FDE8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_810FD3C + + thumb_func_start sub_810FDF0 +sub_810FDF0: @ 810FDF0 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _0810FE0E + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0810FE0E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_810FDF0 + + thumb_func_start sub_810FE14 +sub_810FE14: @ 810FE14 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r4, r1, r0 + ldr r0, =0x02038437 + ldrb r0, [r0] + bl sub_80A6190 + lsls r0, 24 + lsrs r1, r0, 24 + adds r0, r1, 0 + subs r0, 0x20 + strh r0, [r4, 0x24] + ldr r0, =0x0203841e + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0x1 + beq _0810FE6A + cmp r0, 0x1 + bgt _0810FE58 + cmp r0, 0 + beq _0810FE5E + b _0810FE86 + .pool +_0810FE58: + cmp r0, 0x2 + beq _0810FE76 + b _0810FE86 +_0810FE5E: + movs r0, 0x2 + strh r0, [r4, 0x1E] + movs r0, 0x5 + strh r0, [r4, 0x20] + movs r0, 0x40 + b _0810FE7E +_0810FE6A: + movs r0, 0x2 + strh r0, [r4, 0x1E] + movs r0, 0x5 + strh r0, [r4, 0x20] + movs r0, 0xC0 + b _0810FE7E +_0810FE76: + movs r0, 0x4 + strh r0, [r4, 0x1E] + strh r0, [r4, 0x20] + movs r0, 0 +_0810FE7E: + strh r0, [r4, 0x22] + adds r0, r1, 0 + adds r0, 0x20 + strh r0, [r4, 0x26] +_0810FE86: + movs r1, 0x24 + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _0810FE92 + movs r0, 0 + strh r0, [r4, 0x24] +_0810FE92: + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0810FEB8 + ldr r0, =0x02022e18 + ldrh r0, [r0] + strh r0, [r4, 0x1C] + ldr r0, =0x04000014 + b _0810FEC0 + .pool +_0810FEB8: + ldr r0, =0x02022e1c + ldrh r0, [r0] + strh r0, [r4, 0x1C] + ldr r0, =0x04000018 +_0810FEC0: + str r0, [sp] + ldrh r1, [r4, 0x24] + lsls r3, r1, 16 + asrs r1, r3, 16 + movs r2, 0x24 + ldrsh r0, [r4, r2] + adds r0, 0x40 + cmp r1, r0 + bgt _0810FEFA + ldr r5, =0x02038c28 + movs r0, 0xF0 + lsls r0, 3 + adds r6, r5, r0 +_0810FEDA: + asrs r3, 16 + lsls r1, r3, 1 + adds r2, r1, r5 + ldrh r0, [r4, 0x1C] + strh r0, [r2] + adds r1, r6 + ldrh r0, [r4, 0x1C] + strh r0, [r1] + adds r3, 0x1 + lsls r3, 16 + asrs r1, r3, 16 + movs r2, 0x24 + ldrsh r0, [r4, r2] + adds r0, 0x40 + cmp r1, r0 + ble _0810FEDA +_0810FEFA: + ldr r0, =0xa2600001 + str r0, [sp, 0x4] + mov r1, sp + movs r2, 0 + movs r0, 0x1 + strb r0, [r1, 0x8] + mov r0, sp + strb r2, [r0, 0x9] + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + ldr r0, =sub_810FF34 + str r0, [r4] + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_810FE14 + + thumb_func_start sub_810FF34 +sub_810FF34: @ 810FF34 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _0811000E + cmp r0, 0x1 + bgt _0810FF60 + cmp r0, 0 + beq _0810FF66 + b _08110026 + .pool +_0810FF60: + cmp r0, 0x2 + beq _08110020 + b _08110026 +_0810FF66: + ldrh r3, [r5, 0x22] + ldrh r4, [r5, 0x24] + movs r2, 0x24 + ldrsh r1, [r5, r2] + movs r2, 0x26 + ldrsh r0, [r5, r2] + cmp r1, r0 + bgt _0810FFFE + ldr r0, =gUnknown_08329F40 + mov r9, r0 + movs r7, 0x3 + ldr r1, =0x02038c28 + mov r12, r1 + movs r2, 0xF0 + lsls r2, 3 + add r2, r12 + mov r8, r2 +_0810FF88: + lsls r2, r3, 16 + asrs r0, r2, 15 + add r0, r9 + movs r3, 0 + ldrsh r0, [r0, r3] + movs r3, 0x20 + ldrsh r1, [r5, r3] + asrs r0, r1 + lsls r0, 16 + lsrs r1, r0, 16 + asrs r3, r0, 16 + adds r6, r2, 0 + cmp r3, 0 + ble _0810FFB8 + ldrh r1, [r5, 0xA] + adds r0, r7, 0 + ands r0, r1 + adds r0, r3, r0 + b _0810FFC4 + .pool +_0810FFB8: + cmp r3, 0 + bge _0810FFC8 + ldrh r1, [r5, 0xA] + adds r0, r7, 0 + ands r0, r1 + subs r0, r3, r0 +_0810FFC4: + lsls r0, 16 + lsrs r1, r0, 16 +_0810FFC8: + lsls r2, r4, 16 + asrs r2, 16 + lsls r3, r2, 1 + mov r0, r12 + adds r4, r3, r0 + ldrh r0, [r5, 0x1C] + lsls r1, 16 + asrs r1, 16 + adds r0, r1, r0 + strh r0, [r4] + add r3, r8 + ldrh r0, [r5, 0x1C] + adds r1, r0 + strh r1, [r3] + asrs r0, r6, 16 + ldrh r1, [r5, 0x1E] + adds r0, r1 + lsls r0, 16 + lsrs r3, r0, 16 + adds r2, 0x1 + lsls r2, 16 + lsrs r4, r2, 16 + asrs r2, 16 + movs r1, 0x26 + ldrsh r0, [r5, r1] + cmp r2, r0 + ble _0810FF88 +_0810FFFE: + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x17 + ble _08110026 + b _08110014 +_0811000E: + ldr r1, =0x02039b28 + movs r0, 0x3 + strb r0, [r1, 0x15] +_08110014: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _08110026 + .pool +_08110020: + adds r0, r2, 0 + bl move_anim_task_del +_08110026: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_810FF34 + + thumb_func_start sub_8110034 +sub_8110034: @ 8110034 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r4, r0, 24 + mov r8, r4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r7, r0, r1 + bl rotscale_alloc_entry + lsls r0, 24 + lsrs r5, r0, 24 + mov r10, r5 + adds r6, r5, 0 + cmp r6, 0xFF + bne _0811006C + adds r0, r4, 0 + bl move_anim_task_del + b _08110116 + .pool +_0811006C: + ldr r1, =0x0203841e + ldrb r0, [r1] + bl duplicate_obj_of_side_rel2move_in_transparent_mode + lsls r0, 16 + lsrs r1, r0, 16 + mov r9, r1 + asrs r0, 16 + cmp r0, 0 + bge _08110094 + adds r0, r5, 0 + bl rotscale_free_entry + mov r0, r8 + bl move_anim_task_del + b _08110116 + .pool +_08110094: + ldr r2, =0x02020630 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r0, r2, 0 + adds r0, 0x1C + adds r0, r4, r0 + ldr r1, =DummyObjectCallback + str r1, [r0] + adds r4, r2 + ldrb r0, [r4, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r4, 0x1] + movs r0, 0x1F + ands r6, r0 + lsls r2, r6, 1 + ldrb r1, [r4, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x3] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + adds r1, r4, 0 + adds r1, 0x43 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r1, r9 + lsls r0, r1, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrb r3, [r4, 0x1] + lsrs r1, r3, 6 + ldrb r2, [r4, 0x3] + lsrs r2, 6 + lsls r3, 30 + lsrs r3, 30 + adds r0, r4, 0 + bl CalcVecFromObjectCenterToObjectUpperLeft + ldr r1, =0x0203841e + ldrb r0, [r1] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x22] + mov r0, r10 + strh r0, [r7, 0x24] + mov r1, r9 + strh r1, [r7, 0x26] + ldr r0, =sub_8110134 + str r0, [r7] +_08110116: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8110034 + + thumb_func_start sub_8110134 +sub_8110134: @ 8110134 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _081101B8 + cmp r0, 0x1 + bgt _0811015C + cmp r0, 0 + beq _08110166 + b _08110238 + .pool +_0811015C: + cmp r0, 0x2 + beq _08110208 + cmp r0, 0x3 + beq _08110228 + b _08110238 +_08110166: + ldrh r0, [r4, 0xA] + adds r0, 0x4 + strh r0, [r4, 0xA] + ldr r1, =gUnknown_08329F40 + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 16 + asrs r1, 17 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + subs r0, r1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0xC + ldrsh r2, [r4, r1] + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x22] + lsls r1, 24 + lsrs r1, 24 + bl sub_80A7EC0 + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0x30 + bne _08110238 + b _0811021A + .pool +_081101B8: + ldrh r0, [r4, 0xA] + subs r0, 0x4 + strh r0, [r4, 0xA] + ldr r1, =gUnknown_08329F40 + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 16 + asrs r1, 17 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + subs r0, r1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0xC + ldrsh r2, [r4, r1] + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x22] + lsls r1, 24 + lsrs r1, 24 + bl sub_80A7EC0 + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08110238 + b _0811021A + .pool +_08110208: + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl obj_delete_but_dont_free_vram +_0811021A: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08110238 + .pool +_08110228: + ldrh r0, [r4, 0x24] + lsls r0, 24 + lsrs r0, 24 + bl rotscale_free_entry + adds r0, r5, 0 + bl move_anim_task_del +_08110238: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8110134 + + thumb_func_start sub_8110240 +sub_8110240: @ 8110240 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _081102B8 + cmp r0, 0x1 + bgt _08110256 + cmp r0, 0 + beq _08110260 + b _08110360 +_08110256: + cmp r0, 0x2 + beq _081102EA + cmp r0, 0x3 + beq _0811034A + b _08110360 +_08110260: + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0811028E + ldrh r0, [r5, 0x22] + adds r0, 0xC + strh r0, [r5, 0x22] +_0811028E: + movs r0, 0x8 + strh r0, [r5, 0x30] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + ldrh r0, [r5, 0x30] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + b _081102E2 + .pool +_081102B8: + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08110360 + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xCB + bl audio_play_and_stuff + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80082B8 +_081102E2: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + b _08110360 +_081102EA: + ldrh r0, [r5, 0x32] + adds r1, r0, 0x1 + strh r1, [r5, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0811032E + movs r0, 0 + strh r0, [r5, 0x32] + ldrh r1, [r5, 0x30] + subs r1, 0x1 + strh r1, [r5, 0x30] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x30 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0811032E + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_0811032E: + movs r0, 0xE0 + lsls r0, 2 + adds r2, r0, 0 + ldrh r1, [r5, 0x34] + adds r2, r1 + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r5, 0x26] + subs r0, r1 + strh r0, [r5, 0x26] + movs r0, 0xFF + ands r2, r0 + strh r2, [r5, 0x34] + b _08110360 +_0811034A: + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r5, 0 + bl move_anim_8072740 +_08110360: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8110240 + + thumb_func_start sub_8110368 +sub_8110368: @ 8110368 + push {r4-r6,lr} + adds r6, r0, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08110394 + adds r0, r6, 0 + movs r1, 0x2 + bl StartObjectRotScalAnim + ldr r0, =0x0203841e + ldrh r1, [r0, 0x4] + negs r1, r1 + strh r1, [r0, 0x4] + ldrh r1, [r0] + negs r1, r1 + strh r1, [r0] + b _081103C4 + .pool +_08110394: + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _081103C4 + adds r0, r6, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + ldr r1, =0x0203841e + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] + ldrh r0, [r1, 0x6] + negs r0, r0 + strh r0, [r1, 0x6] + ldrh r0, [r1] + negs r0, r0 + strh r0, [r1] +_081103C4: + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A60AC + lsls r0, 24 + ldr r4, =0x0203841e + lsrs r0, 24 + ldrh r1, [r4] + adds r0, r1 + strh r0, [r6, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A60AC + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x2] + adds r0, r1 + strh r0, [r6, 0x22] + ldrh r0, [r4, 0x8] + strh r0, [r6, 0x2E] + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x4] + adds r0, r1 + strh r0, [r6, 0x32] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r4, [r4, 0x6] + adds r0, r4 + strh r0, [r6, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r6, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r6, 0 + bl oamt_set_x3A_32 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8110368 + + thumb_func_start sub_8110438 +sub_8110438: @ 8110438 + push {r4-r6,lr} + adds r6, r0, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0811045C + ldr r1, =0x0203841e + ldrh r0, [r1] + negs r0, r0 + strh r0, [r1] + adds r0, r6, 0 + movs r1, 0x2 + bl StartObjectRotScalAnim + b _08110478 + .pool +_0811045C: + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08110478 + ldr r0, =0x0203841e + ldrh r1, [r0, 0x2] + negs r1, r1 + strh r1, [r0, 0x2] + ldrh r1, [r0] + negs r1, r1 + strh r1, [r0] +_08110478: + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A60AC + lsls r0, 24 + ldr r4, =0x0203841e + lsrs r0, 24 + ldrh r1, [r4] + adds r0, r1 + strh r0, [r6, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A60AC + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x2] + adds r0, r1 + strh r0, [r6, 0x22] + ldrh r0, [r4, 0x4] + strh r0, [r6, 0x2E] + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x32] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r6, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r6, 0 + bl oamt_set_x3A_32 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8110438 + + thumb_func_start sub_81104E4 +sub_81104E4: @ 81104E4 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08110500 + ldr r0, =0x0203841e + movs r2, 0x4 + ldrsh r1, [r0, r2] + lsrs r2, r1, 31 + adds r1, r2 + asrs r1, 1 + strh r1, [r0, 0x4] +_08110500: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x22] + strh r0, [r5, 0x34] + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08110548 + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + b _0811055A + .pool +_08110548: + ldr r0, =0x02038437 + ldrb r0, [r0] + adds r2, r5, 0 + adds r2, 0x32 + adds r3, r5, 0 + adds r3, 0x36 + movs r1, 0x1 + bl sub_80A8924 +_0811055A: + adds r0, r5, 0 + bl sub_80A6FD4 + ldr r0, =0x0203841e + ldrh r0, [r0, 0x6] + strh r0, [r5, 0x38] + ldr r0, =sub_811057C + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81104E4 + + thumb_func_start sub_811057C +sub_811057C: @ 811057C + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _08110592 + adds r0, r4, 0 + bl move_anim_8072740 + b _081105AE +_08110592: + movs r1, 0x3A + ldrsh r0, [r4, r1] + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x3A] + adds r0, 0xD + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x3A] +_081105AE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811057C + + thumb_func_start sub_81105B4 +sub_81105B4: @ 81105B4 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02038437 + ldrb r0, [r0] + adds r2, r4, 0 + adds r2, 0x20 + adds r3, r4, 0 + adds r3, 0x22 + movs r1, 0 + bl sub_80A8924 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _081105F0 + ldr r0, =0x0203841e + ldrh r1, [r4, 0x20] + ldrh r2, [r0] + subs r1, r2 + strh r1, [r4, 0x20] + b _081105FC + .pool +_081105F0: + ldr r1, =0x0203841e + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + adds r0, r1, 0 +_081105FC: + ldrh r0, [r0, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08110618 + ldrh r0, [r4, 0x22] + adds r0, 0x8 + strh r0, [r4, 0x22] +_08110618: + ldr r0, =sub_8110630 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81105B4 + + thumb_func_start sub_8110630 +sub_8110630: @ 8110630 + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _08110664 + movs r0, 0 + strh r0, [r3, 0x2E] + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r2, [r0] + 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 + mov r1, r12 + strb r0, [r1] +_08110664: + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x33 + bne _08110678 + adds r0, r3, 0 + bl move_anim_8072740 +_08110678: + pop {r0} + bx r0 + thumb_func_end sub_8110630 + + thumb_func_start sub_811067C +sub_811067C: @ 811067C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0x10 + bl SetGpuReg + movs r0, 0x10 + strh r0, [r4, 0x2E] + ldr r0, =sub_81106A4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811067C + + thumb_func_start sub_81106A4 +sub_81106A4: @ 81106A4 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x32] + movs r2, 0x32 + ldrsh r0, [r4, r2] + cmp r0, 0x13 + bgt _081106B8 + adds r0, r1, 0x1 + strh r0, [r4, 0x32] + b _081106F6 +_081106B8: + ldrh r1, [r4, 0x30] + adds r0, r1, 0x1 + strh r0, [r4, 0x30] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081106F6 + ldrh r1, [r4, 0x2E] + subs r1, 0x1 + strh r1, [r4, 0x2E] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081106F6 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_8110700 + str r0, [r4, 0x1C] +_081106F6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81106A4 + + thumb_func_start sub_8110700 +sub_8110700: @ 8110700 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r4, 0 + bl move_anim_8072740 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8110700 + + thumb_func_start sub_8110720 +sub_8110720: @ 8110720 + push {r4-r7,lr} + sub sp, 0x4 + adds r7, r0, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08110740 + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] + b _08110762 + .pool +_08110740: + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08110762 + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] + ldrh r0, [r1, 0x6] + negs r0, r0 + strh r0, [r1, 0x6] +_08110762: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _081107B2 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r5, =0x02038437 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _081107B2 + ldrb r0, [r5] + bl battle_get_per_side_status + lsls r0, 24 + cmp r0, 0 + beq _081107A0 + ldrb r0, [r5] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081107B2 +_081107A0: + ldr r0, =0x0203841e + movs r2, 0x4 + ldrsh r1, [r0, r2] + negs r1, r1 + strh r1, [r0, 0x4] + movs r2, 0 + ldrsh r1, [r0, r2] + negs r1, r1 + strh r1, [r0] +_081107B2: + adds r0, r7, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + ldr r6, =0x0203841e + lsrs r4, 24 + ldrh r0, [r6, 0x4] + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r6, 0x6] + adds r1, r2 + lsls r1, 16 + ldrh r2, [r7, 0x20] + lsls r0, r4, 16 + asrs r0, 16 + subs r0, r2 + lsls r0, 16 + asrs r0, 16 + ldrh r2, [r7, 0x22] + lsrs r5, r1, 16 + asrs r1, 16 + subs r1, r2 + lsls r1, 16 + asrs r1, 16 + bl sub_80A74F4 + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 24 + adds r0, r1 + lsrs r0, 16 + movs r3, 0x80 + lsls r3, 1 + str r0, [sp] + adds r0, r7, 0 + movs r1, 0 + adds r2, r3, 0 + bl sub_80A73E0 + ldrh r0, [r6, 0x8] + strh r0, [r7, 0x2E] + strh r4, [r7, 0x32] + strh r5, [r7, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r7, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r7, 0 + bl oamt_set_x3A_32 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8110720 + + thumb_func_start sub_8110850 +sub_8110850: @ 8110850 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08110870 + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_08110870: + ldr r4, =0x0203841e + ldrh r0, [r4, 0x8] + strh r0, [r6, 0x2E] + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x4] + adds r0, r1 + strh r0, [r6, 0x32] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x6] + adds r0, r1 + strh r0, [r6, 0x36] + ldrh r0, [r4, 0xA] + strh r0, [r6, 0x38] + adds r0, r6, 0 + bl sub_80A68D4 + ldr r0, =sub_81108CC + str r0, [r6, 0x1C] + adds r2, r6, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8110850 + + thumb_func_start sub_81108CC +sub_81108CC: @ 81108CC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + adds r4, r0, 0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x5 + negs r1, r1 + ands r1, r0 + strb r1, [r2] + adds r0, r4, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _081108F8 + adds r0, r4, 0 + bl move_anim_8072740 + b _08110988 +_081108F8: + movs r0, 0x2E + adds r0, r4 + mov r8, r0 + ldrh r7, [r4, 0x20] + ldrh r5, [r4, 0x24] + ldrh r1, [r4, 0x22] + mov r12, r1 + ldrh r6, [r4, 0x26] + mov r2, r8 + add r1, sp, 0x4 + movs r3, 0x7 +_0811090E: + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _0811090E + adds r0, r7, r5 + lsls r0, 16 + lsrs r5, r0, 16 + mov r2, r12 + adds r0, r2, r6 + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r4, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + bne _08110988 + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + lsls r1, r5, 16 + asrs r1, 16 + subs r0, r1 + lsls r0, 16 + asrs r0, 16 + ldrh r1, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r1, r2 + lsls r2, r6, 16 + asrs r2, 16 + subs r1, r2 + lsls r1, 16 + asrs r1, 16 + bl sub_80A74F4 + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 24 + adds r0, r1 + lsrs r0, 16 + movs r3, 0x80 + lsls r3, 1 + str r0, [sp] + adds r0, r4, 0 + movs r1, 0 + adds r2, r3, 0 + bl sub_80A73E0 + add r2, sp, 0x4 + mov r1, r8 + movs r3, 0x7 +_0811097A: + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _0811097A +_08110988: + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81108CC + + thumb_func_start sub_8110994 +sub_8110994: @ 8110994 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _081109B0 + ldr r4, =0x02038436 + b _081109B2 + .pool +_081109B0: + ldr r4, =0x02038437 +_081109B2: + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x12 + strh r0, [r5, 0x22] + ldr r1, =move_anim_8074EE0 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A67BC + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8110994 + + thumb_func_start sub_81109F0 +sub_81109F0: @ 81109F0 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, =0x0203841e + movs r1, 0x6 + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _08110A10 + ldr r0, =0x02038437 + ldrb r0, [r0] + adds r2, r5, 0 + adds r2, 0x20 + adds r3, r5, 0 + adds r3, 0x22 + movs r1, 0 + bl sub_80A8924 +_08110A10: + ldrh r0, [r6] + ldrh r1, [r5, 0x20] + adds r0, r1 + movs r4, 0 + strh r0, [r5, 0x20] + ldrh r0, [r5, 0x22] + adds r0, 0xE + strh r0, [r5, 0x22] + ldrb r1, [r6, 0x2] + adds r0, r5, 0 + bl StartObjectImageAnim + adds r0, r5, 0 + bl AnimateObject + strh r4, [r5, 0x2E] + strh r4, [r5, 0x30] + movs r0, 0x4 + strh r0, [r5, 0x32] + movs r0, 0x10 + strh r0, [r5, 0x34] + ldr r0, =0x0000ffba + strh r0, [r5, 0x36] + ldrh r0, [r6, 0x4] + strh r0, [r5, 0x38] + ldr r1, =sub_8110A70 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r1, =sub_80A6450 + str r1, [r5, 0x1C] + adds r0, r5, 0 + bl _call_via_r1 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81109F0 + + thumb_func_start sub_8110A70 +sub_8110A70: @ 8110A70 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x38] + ldrh r2, [r4, 0x20] + adds r0, r1, r2 + strh r0, [r4, 0x20] + movs r0, 0xC0 + strh r0, [r4, 0x2E] + strh r1, [r4, 0x30] + movs r0, 0x4 + strh r0, [r4, 0x32] + movs r0, 0x20 + strh r0, [r4, 0x34] + ldr r0, =0x0000ffe8 + strh r0, [r4, 0x36] + ldr r1, =move_anim_8074EE0 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r1, =sub_80A6450 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8110A70 + + thumb_func_start sub_8110AB4 +sub_8110AB4: @ 8110AB4 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x0203841e + ldrb r1, [r4, 0xA] + bl StartObjectImageAnim + adds r0, r5, 0 + bl AnimateObject + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08110AE4 + ldrh r0, [r5, 0x20] + ldrh r1, [r4] + subs r0, r1 + b _08110AEA + .pool +_08110AE4: + ldrh r0, [r4] + ldrh r1, [r5, 0x20] + adds r0, r1 +_08110AEA: + strh r0, [r5, 0x20] + ldr r3, =0x0203841e + ldrh r2, [r3, 0x2] + ldrh r0, [r5, 0x22] + adds r2, r0 + movs r4, 0 + strh r2, [r5, 0x22] + ldrh r0, [r3, 0x8] + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x30] + ldrh r1, [r3, 0x4] + adds r0, r1 + strh r0, [r5, 0x32] + strh r2, [r5, 0x34] + ldrh r0, [r3, 0x6] + adds r2, r0 + strh r2, [r5, 0x36] + adds r0, r5, 0 + bl sub_80A6E14 + strh r4, [r5, 0x34] + strh r4, [r5, 0x36] + ldr r0, =sub_80A656C + str r0, [r5, 0x1C] + ldr r1, =move_anim_8074EE0 + adds r0, r5, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8110AB4 + + thumb_func_start sub_8110B38 +sub_8110B38: @ 8110B38 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0203841e + movs r1, 0xC + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08110B54 + adds r0, r4, 0 + movs r1, 0 + bl sub_80A69CC + b _08110B5C + .pool +_08110B54: + adds r0, r4, 0 + movs r1, 0 + bl sub_80A6980 +_08110B5C: + ldr r1, =0x0203841e + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x32] + ldrh r0, [r1, 0xA] + strh r0, [r4, 0x34] + ldr r0, =sub_8110B80 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8110B38 + + thumb_func_start sub_8110B80 +sub_8110B80: @ 8110B80 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x36] + adds r0, r1 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 24 + negs r0, r0 + strh r0, [r4, 0x26] + movs r2, 0x38 + ldrsh r0, [r4, r2] + movs r2, 0x34 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + ldrh r1, [r4, 0x38] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _08110BC6 + adds r0, r4, 0 + bl move_anim_8072740 +_08110BC6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8110B80 + + thumb_func_start sub_8110BCC +sub_8110BCC: @ 8110BCC + push {r4-r6,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08110C10 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations +_08110C10: + ldr r0, =0x02022e18 + strh r5, [r0] + ldr r4, =0x02022e1a + strh r5, [r4] + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + ldrh r1, [r4] + movs r0, 0x16 + bl SetGpuReg + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, =gUnknown_08D8D58C + mov r2, sp + ldrh r2, [r2, 0xA] + bl sub_80A6CC0 + ldr r1, =gUnknown_08D8D410 + mov r0, sp + movs r2, 0 + bl sub_80A6D60 + ldr r0, =gUnknown_08D8DAB8 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl decompress_palette + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08110C6E + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08110C6E + movs r5, 0x1 +_08110C6E: + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + strh r5, [r1, 0x8] + ldr r0, =sub_8110CB0 + str r0, [r1] + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8110BCC + + thumb_func_start sub_8110CB0 +sub_8110CB0: @ 8110CB0 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0 + bne _08110CE4 + ldr r1, =0x02022e18 + ldr r3, =0x0000fffa + adds r0, r3, 0 + ldrh r3, [r1] + adds r0, r3 + b _08110CEA + .pool +_08110CE4: + ldr r1, =0x02022e18 + ldrh r0, [r1] + adds r0, 0x6 +_08110CEA: + strh r0, [r1] + ldr r1, =0x02022e1a + ldr r3, =0x0000ffff + adds r0, r3, 0 + ldrh r3, [r1] + adds r0, r3 + strh r0, [r1] + lsls r1, r5, 2 + adds r0, r1, r5 + lsls r0, 3 + adds r0, r2 + movs r3, 0x20 + ldrsh r0, [r0, r3] + adds r4, r1, 0 + cmp r0, 0x4 + bls _08110D0C + b _08110E3A +_08110D0C: + lsls r0, 2 + ldr r1, =_08110D28 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08110D28: + .4byte _08110D3C + .4byte _08110D7E + .4byte _08110D98 + .4byte _08110DDA + .4byte _08110DFC +_08110D3C: + adds r0, r4, r5 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + movs r5, 0 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _08110E3A + strh r5, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + adds r1, 0x1 + strh r1, [r4, 0x1E] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0x7 + bne _08110E3A + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + strh r5, [r4, 0x1E] + b _08110E3A +_08110D7E: + adds r0, r4, r5 + lsls r0, 3 + adds r1, r0, r2 + ldrh r0, [r1, 0x1E] + adds r0, 0x1 + strh r0, [r1, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x65 + bne _08110E3A + movs r0, 0x7 + strh r0, [r1, 0x1E] + b _08110DF0 +_08110D98: + adds r0, r4, r5 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _08110E3A + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + subs r1, 0x1 + strh r1, [r4, 0x1E] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r2, 0x1E + ldrsh r1, [r4, r2] + cmp r1, 0 + bne _08110E3A + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + strh r1, [r4, 0x1E] + b _08110E3A +_08110DDA: + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + bl sub_80A6C68 + ldr r0, =0x03005e00 + adds r1, r4, r5 + lsls r1, 3 + adds r1, r0 +_08110DF0: + ldrh r0, [r1, 0x20] + adds r0, 0x1 + strh r0, [r1, 0x20] + b _08110E3A + .pool +_08110DFC: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08110E10 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_08110E10: + ldr r0, =0x02022e18 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e1a + strh r1, [r0] + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + adds r0, r5, 0 + bl move_anim_task_del +_08110E3A: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8110CB0 + + thumb_func_start sub_8110E4C +sub_8110E4C: @ 8110E4C + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08110EC8 + ldr r4, =0x0203841e + movs r2, 0x6 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08110E98 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08110E98 + movs r0, 0x98 + lsls r0, 1 + strh r0, [r5, 0x20] + ldrh r0, [r4, 0x2] + negs r0, r0 + strh r0, [r4, 0x2] + movs r0, 0x1 + strh r0, [r5, 0x38] + ldrb r1, [r5, 0x3] + subs r0, 0x40 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r5, 0x3] + b _08110E9C + .pool +_08110E98: + ldr r0, =0x0000ffc0 + strh r0, [r5, 0x20] +_08110E9C: + ldr r4, =0x0203841e + ldrh r0, [r4] + strh r0, [r5, 0x22] + ldr r1, =gUnknown_08596BC0 + adds r0, r5, 0 + bl SetSpriteOamTables_NoPriorityFromTable + ldrh r0, [r4, 0x2] + strh r0, [r5, 0x30] + ldrh r0, [r4, 0x4] + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + b _08110F24 + .pool +_08110EC8: + ldrh r1, [r5, 0x30] + ldrh r3, [r5, 0x34] + adds r1, r3 + ldrh r2, [r5, 0x32] + ldrh r0, [r5, 0x36] + adds r2, r0 + lsls r0, r1, 16 + asrs r0, 24 + ldrh r3, [r5, 0x24] + adds r0, r3 + strh r0, [r5, 0x24] + lsls r0, r2, 16 + asrs r0, 24 + ldrh r3, [r5, 0x26] + adds r0, r3 + strh r0, [r5, 0x26] + movs r0, 0xFF + ands r1, r0 + strh r1, [r5, 0x34] + ands r2, r0 + strh r2, [r5, 0x36] + movs r1, 0x38 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08110F0E + movs r2, 0x20 + ldrsh r0, [r5, r2] + movs r3, 0x24 + ldrsh r1, [r5, r3] + adds r0, r1 + movs r1, 0x88 + lsls r1, 1 + cmp r0, r1 + ble _08110F24 + b _08110F20 +_08110F0E: + movs r1, 0x20 + ldrsh r0, [r5, r1] + movs r2, 0x24 + ldrsh r1, [r5, r2] + adds r0, r1 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bge _08110F24 +_08110F20: + ldr r0, =move_anim_8072740 + str r0, [r5, 0x1C] +_08110F24: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8110E4C + + thumb_func_start sub_8110F30 +sub_8110F30: @ 8110F30 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x0203841e + ldrb r1, [r5, 0x8] + bl StartObjectImageAnim + adds r0, r4, 0 + movs r1, 0 + bl sub_80A69CC + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x32] + ldrh r0, [r5, 0x4] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r4, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8110F30 + + thumb_func_start sub_8110F74 +sub_8110F74: @ 8110F74 + 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 + ldr r0, =0x03005e00 + adds r6, r1, r0 + ldr r5, =0x02038436 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 8 + movs r1, 0xC0 + lsls r1, 13 + adds r0, r1 + lsrs r7, r0, 16 + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 8 + movs r2, 0xC0 + lsls r2, 13 + adds r0, r2 + lsrs r0, 16 + mov r8, r0 + ldrb r1, [r5] + movs r0, 0x2 + eors r0, r1 + ldrb r4, [r4] + cmp r0, r4 + bne _08110FE4 + mov r8, r7 +_08110FE4: + bl sub_811135C + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _08111000 + movs r0, 0x20 + b _08111006 + .pool +_08111000: + lsls r1, r5, 3 + movs r0, 0x30 + subs r0, r1 +_08111006: + strh r0, [r6, 0x18] + movs r4, 0 + strh r4, [r6, 0x8] + strh r4, [r6, 0x1E] + strh r4, [r6, 0x1A] + movs r0, 0x1 + strh r0, [r6, 0x20] + movs r1, 0x18 + ldrsh r0, [r6, r1] + cmp r0, 0 + bge _0811101E + adds r0, 0x7 +_0811101E: + asrs r0, 3 + subs r0, 0x1 + strh r0, [r6, 0x1C] + mov r2, r9 + lsls r0, r2, 3 + strh r0, [r6, 0xC] + lsls r0, r7, 3 + strh r0, [r6, 0xE] + mov r1, r10 + subs r0, r1, r2 + lsls r0, 3 + movs r2, 0x18 + ldrsh r1, [r6, r2] + bl __divsi3 + strh r0, [r6, 0x10] + mov r1, r8 + subs r0, r1, r7 + lsls r0, 3 + movs r2, 0x18 + ldrsh r1, [r6, r2] + bl __divsi3 + strh r0, [r6, 0x12] + strh r4, [r6, 0x14] + strh r4, [r6, 0x16] + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + adds r4, r0, 0 + lsls r4, 24 + asrs r4, 8 + lsrs r4, 16 + movs r0, 0x3F + bl sub_80A5178 + lsls r0, 24 + strh r4, [r6, 0x22] + asrs r0, 24 + lsls r4, 16 + asrs r4, 16 + subs r0, r4 + movs r2, 0x18 + ldrsh r1, [r6, r2] + bl __divsi3 + strh r0, [r6, 0x24] + strh r5, [r6, 0xA] + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x26] + ldr r0, =sub_81110A4 + 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_8110F74 + + thumb_func_start sub_81110A4 +sub_81110A4: @ 81110A4 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bls _081110BE + b _0811120C +_081110BE: + lsls r0, 2 + ldr r1, =_081110D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081110D0: + .4byte _081110E4 + .4byte _08111148 + .4byte _08111150 + .4byte _081111AC + .4byte _081111FE +_081110E4: + ldrh r2, [r4, 0x14] + ldrh r0, [r4, 0x10] + subs r2, r0 + strh r2, [r4, 0x14] + ldrh r0, [r4, 0x16] + ldrh r1, [r4, 0x12] + subs r0, r1 + strh r0, [r4, 0x16] + ldr r3, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + lsls r2, 16 + asrs r2, 19 + strh r2, [r0, 0x24] + movs r1, 0x26 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r4, 0x16] + lsls r0, 16 + asrs r0, 19 + strh r0, [r1, 0x26] + ldrh r0, [r4, 0x1A] + adds r0, 0x1 + strh r0, [r4, 0x1A] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _08111134 + movs r0, 0x14 + strh r0, [r4, 0x1E] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_08111134: + ldrh r1, [r4, 0x22] + lsls r1, 24 + asrs r1, 24 + movs r0, 0xA2 + bl audio_play_and_stuff + b _0811120C + .pool +_08111148: + ldrh r0, [r4, 0x1E] + subs r0, 0x1 + strh r0, [r4, 0x1E] + b _081111F0 +_08111150: + ldrh r0, [r4, 0x1A] + subs r0, 0x1 + strh r0, [r4, 0x1A] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + beq _08111170 + ldrh r0, [r4, 0x10] + ldrh r2, [r4, 0x14] + adds r0, r2 + strh r0, [r4, 0x14] + ldrh r0, [r4, 0x12] + ldrh r1, [r4, 0x16] + adds r0, r1 + strh r0, [r4, 0x16] + b _0811117A +_08111170: + strh r0, [r4, 0x14] + strh r0, [r4, 0x16] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0811117A: + ldr r2, =0x02020630 + movs r1, 0x26 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r4, 0x14] + lsls r0, 16 + asrs r0, 19 + strh r0, [r1, 0x24] + movs r1, 0x26 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r4, 0x16] + lsls r0, 16 + asrs r0, 19 + strh r0, [r1, 0x26] + b _0811120C + .pool +_081111AC: + ldrh r0, [r4, 0x10] + ldrh r2, [r4, 0xC] + adds r0, r2 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x12] + ldrh r1, [r4, 0xE] + adds r0, r1 + strh r0, [r4, 0xE] + ldrh r0, [r4, 0x1A] + adds r0, 0x1 + strh r0, [r4, 0x1A] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x1C + ldrsh r1, [r4, r2] + cmp r0, r1 + blt _081111EA + movs r0, 0 + strh r0, [r4, 0x1A] + adds r0, r4, 0 + bl sub_8111214 + ldrh r1, [r4, 0x24] + ldrh r0, [r4, 0x22] + adds r1, r0 + strh r1, [r4, 0x22] + lsls r1, 24 + asrs r1, 24 + movs r0, 0xAF + bl audio_play_and_stuff +_081111EA: + ldrh r0, [r4, 0x18] + subs r0, 0x1 + strh r0, [r4, 0x18] +_081111F0: + lsls r0, 16 + cmp r0, 0 + bne _0811120C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0811120C +_081111FE: + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0811120C + adds r0, r2, 0 + bl move_anim_task_del +_0811120C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81110A4 + + thumb_func_start sub_8111214 +sub_8111214: @ 8111214 + push {r4-r7,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0xA] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bhi _08111304 + lsls r0, 2 + ldr r1, =_08111234 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08111234: + .4byte _08111248 + .4byte _08111254 + .4byte _08111254 + .4byte _08111260 + .4byte _0811126C +_08111248: + ldr r3, =gUnknown_08596C28 + movs r5, 0 + b _08111270 + .pool +_08111254: + ldr r3, =gUnknown_08596C40 + movs r5, 0x50 + b _08111270 + .pool +_08111260: + ldr r3, =gUnknown_08596C40 + movs r5, 0x40 + b _08111270 + .pool +_0811126C: + ldr r3, =gUnknown_08596C40 + movs r5, 0x30 +_08111270: + ldrh r1, [r4, 0xC] + lsls r1, 16 + asrs r1, 19 + lsls r1, 16 + lsrs r1, 16 + ldrh r2, [r4, 0xE] + lsls r2, 16 + asrs r2, 19 + lsls r2, 16 + movs r6, 0x20 + ldrsh r0, [r4, r6] + lsls r0, 2 + adds r1, r0 + lsls r1, 16 + lsrs r6, r1, 16 + asrs r1, 16 + lsrs r7, r2, 16 + asrs r2, 16 + adds r0, r3, 0 + movs r3, 0x23 + bl AddObjectToFront + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _081112FC + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0x12 + strh r1, [r0, 0x2E] + movs r2, 0x20 + ldrsh r1, [r4, r2] + lsls r2, r1, 2 + adds r2, r1 + lsls r2, 2 + adds r2, r6, r2 + movs r6, 0xA + ldrsh r3, [r4, r6] + lsls r1, r3, 1 + adds r1, r3 + adds r2, r1 + strh r2, [r0, 0x32] + strh r7, [r0, 0x36] + movs r1, 0xA + ldrsh r2, [r4, r1] + lsls r2, 1 + movs r3, 0x10 + negs r3, r3 + adds r1, r3, 0 + subs r1, r2 + strh r1, [r0, 0x38] + ldrh r3, [r0, 0x4] + lsls r2, r3, 22 + lsrs r2, 22 + adds r2, r5 + ldr r5, =0x000003ff + adds r1, r5, 0 + ands r2, r1 + ldr r1, =0xfffffc00 + ands r1, r3 + orrs r1, r2 + strh r1, [r0, 0x4] + bl sub_80A68D4 + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + strh r0, [r4, 0x1E] +_081112FC: + movs r6, 0x20 + ldrsh r0, [r4, r6] + negs r0, r0 + strh r0, [r4, 0x20] +_08111304: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8111214 + + thumb_func_start sub_811131C +sub_811131C: @ 811131C + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _0811134E + ldr r0, =sub_81110A4 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _08111348 + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x1E] + subs r0, 0x1 + strh r0, [r1, 0x1E] +_08111348: + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0811134E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811131C + + thumb_func_start sub_811135C +sub_811135C: @ 811135C + push {lr} + ldr r0, =0x02038400 + ldr r0, [r0] + ldrb r1, [r0, 0x11] + lsrs r0, r1, 4 + lsls r1, 28 + lsrs r1, 28 + subs r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xFF + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0x4 + bls _0811137E + movs r1, 0x1 +_0811137E: + adds r0, r1, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_811135C + + thumb_func_start sub_8111388 +sub_8111388: @ 8111388 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x0203841e + ldrb r1, [r5, 0x8] + bl StartObjectImageAnim + ldrh r0, [r5] + strh r0, [r4, 0x24] + ldrh r0, [r5, 0x2] + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x34] + ldrh r1, [r5, 0x4] + subs r0, r1 + strh r0, [r4, 0x34] + movs r0, 0x3 + strh r0, [r4, 0x2E] + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x30] + ldr r0, =sub_81113C8 + str r0, [r4, 0x1C] + adds r4, 0x3E + ldrb r0, [r4] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8111388 + + thumb_func_start sub_81113C8 +sub_81113C8: @ 81113C8 + push {lr} + adds r2, r0, 0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x5 + negs r1, r1 + ands r1, r0 + strb r1, [r3] + ldrh r1, [r2, 0x34] + movs r3, 0x34 + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _08111400 + ldrh r3, [r2, 0x32] + adds r0, r1, r3 + strh r0, [r2, 0x26] + ldrh r0, [r2, 0x2E] + adds r1, r0 + strh r1, [r2, 0x34] + adds r0, 0x1 + strh r0, [r2, 0x2E] + lsls r1, 16 + cmp r1, 0 + ble _08111412 + movs r0, 0 + strh r0, [r2, 0x34] + b _08111412 +_08111400: + ldrh r0, [r2, 0x30] + subs r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _08111412 + adds r0, r2, 0 + bl move_anim_8072740 +_08111412: + pop {r0} + bx r0 + thumb_func_end sub_81113C8 + + thumb_func_start sub_8111418 +sub_8111418: @ 8111418 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08111434 + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim +_08111434: + adds r0, r4, 0 + bl sub_80A7820 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8111418 + + thumb_func_start sub_8111444 +sub_8111444: @ 8111444 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x0203841e + ldrh r3, [r2] + ldrh r5, [r4, 0x20] + adds r1, r3, r5 + strh r1, [r4, 0x20] + ldrh r1, [r2, 0x2] + adds r0, r1 + strh r0, [r4, 0x22] + strh r3, [r4, 0x30] + strh r1, [r4, 0x32] + ldrh r0, [r2, 0x4] + strh r0, [r4, 0x38] + ldrb r1, [r2, 0x6] + adds r0, r4, 0 + bl StartObjectImageAnim + ldr r0, =sub_811149C + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8111444 + + thumb_func_start sub_811149C +sub_811149C: @ 811149C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x8 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x34] + adds r0, r1 + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x32] + ldrh r2, [r4, 0x36] + adds r0, r2 + strh r0, [r4, 0x36] + movs r1, 0x34 + ldrsh r0, [r4, r1] + movs r1, 0x28 + bl __divsi3 + ldrh r1, [r4, 0x24] + adds r1, r0 + strh r1, [r4, 0x24] + movs r2, 0x2E + ldrsh r0, [r4, r2] + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + ldrh r1, [r4, 0x26] + subs r1, r0 + strh r1, [r4, 0x26] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x8C + ble _081114E6 + adds r0, r4, 0 + bl move_anim_8072740 +_081114E6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811149C + + thumb_func_start sub_81114EC +sub_81114EC: @ 81114EC + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =0x02038404 + ldr r0, [r2] + cmp r0, 0x20 + bgt _08111500 + ldr r1, =0x0203841e + movs r0, 0 + strh r0, [r1, 0xE] +_08111500: + ldr r2, [r2] + adds r0, r2, 0 + subs r0, 0x21 + cmp r0, 0x20 + bhi _08111510 + ldr r1, =0x0203841e + movs r0, 0x1 + strh r0, [r1, 0xE] +_08111510: + cmp r2, 0x41 + ble _0811151A + ldr r1, =0x0203841e + movs r0, 0x2 + strh r0, [r1, 0xE] +_0811151A: + adds r0, r3, 0 + bl move_anim_task_del + pop {r0} + bx r0 + .pool + thumb_func_end sub_81114EC + + thumb_func_start sub_811152C +sub_811152C: @ 811152C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0811154E + movs r0, 0 + bl sub_80A6DAC + movs r0, 0xC8 + strh r0, [r5, 0xA] +_0811154E: + ldr r4, =0x02022e22 + movs r1, 0xA + ldrsh r0, [r5, r1] + movs r1, 0xA + bl __divsi3 + ldrh r1, [r4] + adds r1, r0 + strh r1, [r4] + ldrh r0, [r5, 0xA] + subs r0, 0x3 + strh r0, [r5, 0xA] + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x78 + bne _0811157A + movs r0, 0x1 + bl sub_80A6DAC + adds r0, r6, 0 + bl move_anim_task_del +_0811157A: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811152C + + thumb_func_start sub_8111590 +sub_8111590: @ 8111590 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081115BC + movs r0, 0 + bl sub_80A6DAC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldr r0, =0x02022e22 + ldrh r0, [r0] + strh r0, [r4, 0xC] +_081115BC: + ldrh r0, [r4, 0xA] + adds r0, 0x50 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0xA] + ldr r6, =0x02022e22 + movs r2, 0xA + ldrsh r1, [r4, r2] + movs r0, 0x4 + bl cosine + ldrh r4, [r4, 0xC] + adds r0, r4 + strh r0, [r6] + ldr r0, =0x0203841e + movs r2, 0xE + ldrsh r1, [r0, r2] + ldr r0, =0x00000fff + cmp r1, r0 + bne _081115F4 + movs r0, 0 + strh r0, [r6] + movs r0, 0x1 + bl sub_80A6DAC + adds r0, r5, 0 + bl move_anim_task_del +_081115F4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8111590 + + thumb_func_start sub_811160C +sub_811160C: @ 811160C + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, =0x0203841e + ldrh r0, [r0, 0x4] + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl sub_80A6FD4 + ldr r0, =sub_8111674 + str r0, [r4, 0x1C] + movs r0, 0x10 + strh r0, [r4, 0x3A] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + ldrh r1, [r4, 0x3A] + movs r0, 0x52 + bl SetGpuReg + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811160C + + thumb_func_start sub_8111674 +sub_8111674: @ 8111674 + push {r4,lr} + adds r4, r0, 0 + bl sub_8111764 + adds r0, r4, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _08111694 + ldr r0, =sub_81116E8 + str r0, [r4, 0x1C] + b _081116DE + .pool +_08111694: + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0xA + bl sine + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0xF + bl cosine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r2, [r4, 0x38] + adds r0, r2, 0x5 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x38] + lsls r2, 16 + asrs r2, 16 + cmp r2, 0 + beq _081116CC + cmp r2, 0xC4 + ble _081116DE +_081116CC: + lsls r0, 16 + cmp r0, 0 + ble _081116DE + ldr r0, =0x02038440 + movs r1, 0 + ldrsb r1, [r0, r1] + movs r0, 0xC4 + bl audio_play_and_stuff +_081116DE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8111674 + + thumb_func_start sub_81116E8 +sub_81116E8: @ 81116E8 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_80A6F3C + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0xA + bl sine + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r1, 0xF + bl cosine + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r2, [r4, 0x38] + adds r0, r2, 0x5 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x38] + lsls r2, 16 + asrs r2, 16 + cmp r2, 0 + beq _0811172E + cmp r2, 0xC4 + ble _0811173A +_0811172E: + lsls r0, 16 + cmp r0, 0 + ble _0811173A + movs r0, 0xC4 + bl audio_play +_0811173A: + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08111758 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_80A67F4 + str r0, [r4, 0x1C] + b _0811175E + .pool +_08111758: + adds r0, r4, 0 + bl sub_8111764 +_0811175E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81116E8 + + thumb_func_start sub_8111764 +sub_8111764: @ 8111764 + push {r4,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x3A] + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0xFF + ble _08111788 + adds r0, r2, 0x1 + strh r0, [r4, 0x3A] + lsls r0, 16 + ldr r1, =0x010d0000 + cmp r0, r1 + bne _081117EE + movs r0, 0 + b _081117EC + .pool +_08111788: + ldrh r1, [r4, 0x3C] + adds r3, r1, 0x1 + strh r3, [r4, 0x3C] + movs r0, 0xFF + ands r0, r1 + cmp r0, 0 + bne _081117EE + ldr r1, =0xffffff00 + ands r1, r3 + strh r1, [r4, 0x3C] + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _081117B0 + adds r0, r2, 0x1 + b _081117B2 + .pool +_081117B0: + subs r0, r2, 0x1 +_081117B2: + strh r0, [r4, 0x3A] + ldrh r0, [r4, 0x3A] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r2, 0x3A + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _081117D4 + cmp r0, 0x10 + bne _081117E0 +_081117D4: + ldrh r0, [r4, 0x3C] + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + eors r0, r1 + strh r0, [r4, 0x3C] +_081117E0: + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081117EE + movs r0, 0x80 + lsls r0, 1 +_081117EC: + strh r0, [r4, 0x3A] +_081117EE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8111764 + + thumb_func_start sub_81117F4 +sub_81117F4: @ 81117F4 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A6980 + ldr r1, =sub_8111814 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81117F4 + + thumb_func_start sub_8111814 +sub_8111814: @ 8111814 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x20 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x2E] + subs r0, 0x41 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x82 + bhi _08111848 + ldrb r0, [r4, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r0 + movs r0, 0x8 + b _08111852 +_08111848: + ldrb r0, [r4, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r0 + movs r0, 0x4 +_08111852: + orrs r1, r0 + strb r1, [r4, 0x5] + ldrh r0, [r4, 0x2E] + adds r0, 0x13 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x32] + adds r0, 0x50 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3D + bne _08111884 + adds r0, r4, 0 + bl move_anim_8072740 +_08111884: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8111814 + + thumb_func_start sub_811188C +sub_811188C: @ 811188C + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A7270 + adds r0, r4, 0 + movs r1, 0x80 + movs r2, 0x80 + movs r3, 0 + bl obj_id_set_rotscale + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x80 + strh r1, [r0, 0x8] + ldr r1, =0x0203841e + ldrh r1, [r1] + strh r1, [r0, 0xA] + strh r2, [r0, 0xC] + movs r1, 0x10 + strh r1, [r0, 0xE] + ldr r1, =sub_8111914 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811188C + + thumb_func_start sub_8111914 +sub_8111914: @ 8111914 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _0811195C + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r1, [r4, 0xC] + adds r1, 0x1 + strh r1, [r4, 0xC] + ldrh r0, [r4, 0xE] + subs r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x9 + bne _0811195C + ldr r0, =sub_811196C + str r0, [r4] +_0811195C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8111914 + + thumb_func_start sub_811196C +sub_811196C: @ 811196C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _08111994 + subs r0, r1, 0x1 + strh r0, [r4, 0xA] + b _081119D8 + .pool +_08111994: + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r1, r0, 24 + ldrh r0, [r4, 0x8] + adds r0, 0x8 + strh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xFF + bgt _081119BC + movs r0, 0x8 + ldrsh r2, [r4, r0] + adds r0, r1, 0 + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + b _081119D8 +_081119BC: + adds r0, r1, 0 + bl sub_80A7344 + adds r0, r5, 0 + bl move_anim_task_del + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg +_081119D8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_811196C + + thumb_func_start sub_81119E0 +sub_81119E0: @ 81119E0 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r4, r0, 0 + ldrh r5, [r4, 0x20] + ldrh r6, [r4, 0x22] + ldr r0, =0x02038436 + mov r8, r0 + ldrb r0, [r0] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + mov r9, r1 + strh r0, [r4, 0x20] + mov r1, r8 + ldrb r0, [r1] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + mov r1, r9 + strh r1, [r4, 0x2E] + ldr r2, =0x0203841e + ldrh r1, [r2] + strh r1, [r4, 0x30] + ldrh r1, [r2, 0x2] + strh r1, [r4, 0x32] + ldrh r1, [r2, 0x4] + strh r1, [r4, 0x34] + ldrh r1, [r4, 0x20] + lsls r1, 4 + strh r1, [r4, 0x36] + lsls r0, 4 + strh r0, [r4, 0x38] + lsls r5, 16 + asrs r5, 16 + movs r1, 0x20 + ldrsh r0, [r4, r1] + subs r5, r0 + lsls r5, 4 + movs r0, 0 + ldrsh r1, [r2, r0] + lsls r1, 1 + adds r0, r5, 0 + str r2, [sp] + bl __divsi3 + strh r0, [r4, 0x3A] + lsls r6, 16 + asrs r6, 16 + movs r1, 0x22 + ldrsh r0, [r4, r1] + subs r6, r0 + lsls r6, 4 + ldr r2, [sp] + movs r0, 0 + ldrsh r1, [r2, r0] + lsls r1, 1 + adds r0, r6, 0 + bl __divsi3 + strh r0, [r4, 0x3C] + ldr r0, =sub_8111A88 + str r0, [r4, 0x1C] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81119E0 + + thumb_func_start sub_8111A88 +sub_8111A88: @ 8111A88 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _08111AD2 + cmp r0, 0x1 + bgt _08111A9E + cmp r0, 0 + beq _08111AA8 + b _08111B96 +_08111A9E: + cmp r0, 0x2 + beq _08111B3C + cmp r0, 0x3 + beq _08111B90 + b _08111B96 +_08111AA8: + ldrh r0, [r5, 0x3A] + ldrh r2, [r5, 0x36] + adds r0, r2 + strh r0, [r5, 0x36] + ldrh r1, [r5, 0x3C] + ldrh r2, [r5, 0x38] + adds r1, r2 + strh r1, [r5, 0x38] + lsls r0, 16 + asrs r0, 20 + strh r0, [r5, 0x20] + lsls r1, 16 + asrs r1, 20 + strh r1, [r5, 0x22] + ldrh r0, [r5, 0x30] + subs r0, 0x1 + strh r0, [r5, 0x30] + lsls r0, 16 + cmp r0, 0 + bgt _08111B96 + b _08111B82 +_08111AD2: + ldrh r0, [r5, 0x32] + subs r0, 0x1 + strh r0, [r5, 0x32] + lsls r0, 16 + cmp r0, 0 + bgt _08111B96 + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x30] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x20] + lsls r0, 4 + strh r0, [r5, 0x36] + ldrh r0, [r5, 0x22] + lsls r0, 4 + strh r0, [r5, 0x38] + movs r1, 0x30 + ldrsh r0, [r5, r1] + movs r2, 0x20 + ldrsh r1, [r5, r2] + subs r0, r1 + lsls r0, 4 + movs r2, 0x34 + ldrsh r1, [r5, r2] + bl __divsi3 + strh r0, [r5, 0x3A] + movs r1, 0x32 + ldrsh r0, [r5, r1] + movs r2, 0x22 + ldrsh r1, [r5, r2] + subs r0, r1 + lsls r0, 4 + movs r2, 0x34 + ldrsh r1, [r5, r2] + bl __divsi3 + strh r0, [r5, 0x3C] + b _08111B82 + .pool +_08111B3C: + ldrh r0, [r5, 0x3A] + ldrh r1, [r5, 0x36] + adds r0, r1 + strh r0, [r5, 0x36] + ldrh r1, [r5, 0x3C] + ldrh r2, [r5, 0x38] + adds r1, r2 + strh r1, [r5, 0x38] + lsls r0, 16 + asrs r0, 20 + strh r0, [r5, 0x20] + lsls r1, 16 + asrs r1, 20 + strh r1, [r5, 0x22] + ldrh r0, [r5, 0x34] + subs r0, 0x1 + strh r0, [r5, 0x34] + lsls r0, 16 + cmp r0, 0 + bgt _08111B96 + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] +_08111B82: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + b _08111B96 + .pool +_08111B90: + adds r0, r5, 0 + bl move_anim_8074EE0 +_08111B96: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8111A88 + + thumb_func_start sub_8111B9C +sub_8111B9C: @ 8111B9C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A6980 + ldr r0, =sub_8111BB4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8111B9C + + thumb_func_start sub_8111BB4 +sub_8111BB4: @ 8111BB4 + push {r4-r6,lr} + adds r3, r0, 0 + movs r5, 0 + movs r6, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08111C4A + adds r1, r3, 0 + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x4 + ands r0, r2 + adds r4, r1, 0 + cmp r0, 0 + bne _08111BDE + movs r0, 0x4 + orrs r0, r2 + strb r0, [r4] +_08111BDE: + movs r1, 0x2E + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _08111BEE + cmp r0, 0x1 + beq _08111BF8 + movs r6, 0x1 + b _08111C02 +_08111BEE: + movs r1, 0x30 + ldrsh r0, [r3, r1] + cmp r0, 0x2 + bne _08111C02 + b _08111C06 +_08111BF8: + movs r1, 0x30 + ldrsh r0, [r3, r1] + cmp r0, 0x4 + bne _08111C02 + movs r5, 0x1 +_08111C02: + cmp r5, 0 + beq _08111C38 +_08111C06: + ldrb r2, [r4] + 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, [r4] + ldrh r0, [r3, 0x32] + adds r0, 0x1 + movs r1, 0 + strh r0, [r3, 0x32] + strh r1, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _08111C4A + strh r1, [r3, 0x32] + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + b _08111C4A +_08111C38: + cmp r6, 0 + beq _08111C44 + adds r0, r3, 0 + bl move_anim_8072740 + b _08111C4A +_08111C44: + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] +_08111C4A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8111BB4 + + thumb_func_start sub_8111C50 +sub_8111C50: @ 8111C50 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r5, r0, r1 + movs r0, 0x1 + bl duplicate_obj_of_side_rel2move_in_transparent_mode + movs r6, 0 + movs r1, 0 + strh r0, [r5, 0x8] + lsls r0, 16 + cmp r0, 0 + bge _08111C80 + adds r0, r4, 0 + bl move_anim_task_del + b _08111D5C + .pool +_08111C80: + strh r1, [r5, 0xA] + movs r0, 0xF + strh r0, [r5, 0xC] + movs r0, 0x2 + strh r0, [r5, 0xE] + strh r1, [r5, 0x10] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + ldrh r1, [r5, 0xE] + lsls r1, 8 + ldrh r0, [r5, 0xC] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + ldr r4, =0x02020630 + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x50 + strh r1, [r0, 0x2E] + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08111CF4 + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000ff70 + strh r1, [r0, 0x30] + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x70 + b _08111D12 + .pool +_08111CF4: + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x90 + strh r1, [r0, 0x30] + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000ff90 +_08111D12: + strh r1, [r0, 0x32] + ldr r4, =0x02020630 + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r2, 0 + strh r2, [r0, 0x34] + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r2, [r0, 0x36] + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =DummyObjectCallback + bl oamt_set_x3A_32 + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, 0x1C + adds r0, r4 + ldr r1, =sub_80A656C + str r1, [r0] + ldr r0, =sub_8111D78 + str r0, [r5] +_08111D5C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8111C50 + + thumb_func_start sub_8111D78 +sub_8111D78: @ 8111D78 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08111E1C + cmp r0, 0x1 + bgt _08111DA0 + cmp r0, 0 + beq _08111DA6 + b _08111E48 + .pool +_08111DA0: + cmp r0, 0x2 + beq _08111E42 + b _08111E48 +_08111DA6: + ldrh r1, [r4, 0xA] + adds r1, 0x1 + strh r1, [r4, 0xA] + movs r0, 0x3 + ands r0, r1 + strh r0, [r4, 0x12] + cmp r0, 0x1 + bne _08111DC4 + ldrh r1, [r4, 0xC] + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _08111DC4 + subs r0, r1, 0x1 + strh r0, [r4, 0xC] +_08111DC4: + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0x3 + bne _08111DDA + ldrh r1, [r4, 0xE] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0xF + bgt _08111DDA + adds r0, r1, 0x1 + strh r0, [r4, 0xE] +_08111DDA: + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0xC] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + ldr r1, [r4, 0xC] + movs r0, 0x80 + lsls r0, 13 + cmp r1, r0 + bne _08111E48 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x50 + ble _08111E48 + movs r2, 0x8 + ldrsh r1, [r4, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl obj_delete_but_dont_free_vram + movs r0, 0x1 + strh r0, [r4, 0x10] + b _08111E48 + .pool +_08111E1C: + ldrh r0, [r4, 0x14] + adds r0, 0x1 + strh r0, [r4, 0x14] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08111E48 + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + b _08111E48 +_08111E42: + adds r0, r2, 0 + bl move_anim_task_del +_08111E48: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8111D78 + + thumb_func_start sub_8111E50 +sub_8111E50: @ 8111E50 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r2, =0x03005e00 + adds r1, r2 + movs r2, 0 + strh r2, [r1, 0x26] + ldr r2, =sub_8111E78 + str r2, [r1] + bl _call_via_r2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8111E50 + + thumb_func_start sub_8111E78 +sub_8111E78: @ 8111E78 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r5, r0, r1 + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r6, r0, 24 + movs r1, 0x26 + ldrsh r0, [r5, r1] + cmp r0, 0x4 + bls _08111EA4 + b _081120C6 +_08111EA4: + lsls r0, 2 + ldr r1, =_08111EBC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08111EBC: + .4byte _08111ED0 + .4byte _08111FD0 + .4byte _08112014 + .4byte _0811207C + .4byte _081120A8 +_08111ED0: + ldr r7, =0x00002771 + adds r0, r7, 0 + bl AllocObjectPalette + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + mov r8, r2 + strh r0, [r5, 0x24] + cmp r0, 0xFF + beq _08111EFE + cmp r0, 0xF + beq _08111EFE + movs r0, 0x1 + bl duplicate_obj_of_side_rel2move_in_transparent_mode + strh r0, [r5, 0x8] + lsls r0, 16 + cmp r0, 0 + bge _08111F0C + adds r0, r7, 0 + bl FreeObjectPaletteByTag +_08111EFE: + adds r0, r4, 0 + bl move_anim_task_del + b _081120CC + .pool +_08111F0C: + ldr r4, =0x02020630 + movs r1, 0x8 + ldrsh r0, [r5, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r2, [r5, 0x24] + lsls r2, 4 + ldrb r3, [r1, 0x5] + movs r0, 0xF + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x5] + movs r2, 0x8 + ldrsh r0, [r5, r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r1, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x5] + movs r2, 0xC + orrs r1, r2 + strb r1, [r0, 0x5] + movs r1, 0x8 + ldrsh r0, [r5, r1] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + ldr r0, =0x020244d0 + ldr r1, [r0] + ldr r0, =0x02038437 + ldrb r0, [r0] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + lsls r1, 31 + adds r2, 0x3E + lsrs r1, 31 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + mov r2, r8 + strh r2, [r5, 0xA] + strh r2, [r5, 0xC] + movs r0, 0x10 + strh r0, [r5, 0xE] + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + movs r0, 0x22 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + adds r0, 0x10 + lsls r0, 4 + strh r0, [r5, 0x10] + cmp r6, 0x1 + bne _08111FC4 + movs r1, 0x80 + lsls r1, 2 + b _08111FC8 + .pool +_08111FC4: + movs r1, 0x80 + lsls r1, 3 +_08111FC8: + movs r0, 0 + bl ClearGpuRegBits + b _081120C6 +_08111FD0: + movs r1, 0x24 + ldrsh r0, [r5, r1] + adds r0, 0x10 + lsls r0, 4 + strh r0, [r5, 0x24] + movs r2, 0x10 + ldrsh r0, [r5, r2] + lsls r0, 1 + ldr r1, =0x02037714 + adds r0, r1 + movs r2, 0x24 + ldrsh r1, [r5, r2] + lsls r1, 1 + ldr r2, =0x02037b14 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + ldrh r0, [r5, 0x10] + ldr r3, =0x00003c0d + movs r1, 0x10 + movs r2, 0xA + bl pal_fade_1 + b _081120C6 + .pool +_08112014: + ldr r2, =0x02020630 + movs r0, 0x22 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + ldrh r0, [r0, 0x22] + adds r1, r0 + subs r1, 0x20 + lsls r1, 16 + lsrs r2, r1, 16 + cmp r1, 0 + bge _08112034 + movs r2, 0 +_08112034: + cmp r6, 0x1 + bne _08112054 + lsls r0, r2, 24 + lsrs r0, 24 + adds r1, r2, 0 + adds r1, 0x40 + lsls r1, 24 + lsrs r1, 24 + movs r2, 0 + str r2, [sp] + movs r2, 0x4 + str r2, [sp, 0x4] + str r6, [sp, 0x8] + b _0811206C + .pool +_08112054: + lsls r0, r2, 24 + lsrs r0, 24 + adds r1, r2, 0 + adds r1, 0x40 + lsls r1, 24 + lsrs r1, 24 + movs r2, 0 + str r2, [sp] + movs r2, 0x8 + str r2, [sp, 0x4] + movs r2, 0x1 + str r2, [sp, 0x8] +_0811206C: + movs r2, 0x2 + movs r3, 0x6 + bl sub_80BA384 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x1C] + b _081120C6 +_0811207C: + cmp r6, 0x1 + bne _08112090 + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + b _08112098 + .pool +_08112090: + ldr r1, =0x00003f44 + movs r0, 0x50 + bl SetGpuReg +_08112098: + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl SetGpuReg + b _081120C6 + .pool +_081120A8: + cmp r6, 0x1 + bne _081120B8 + movs r1, 0x80 + lsls r1, 2 + movs r0, 0 + bl SetGpuRegBits + b _081120C2 +_081120B8: + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + bl SetGpuRegBits +_081120C2: + ldr r0, =sub_81120DC + str r0, [r5] +_081120C6: + ldrh r0, [r5, 0x26] + adds r0, 0x1 + strh r0, [r5, 0x26] +_081120CC: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8111E78 + + thumb_func_start sub_81120DC +sub_81120DC: @ 81120DC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + ldrh r1, [r4, 0xA] + adds r1, 0x1 + strh r1, [r4, 0xA] + movs r0, 0x1 + ands r0, r1 + strh r0, [r4, 0x12] + cmp r0, 0 + bne _08112114 + ldr r1, =gUnknown_08329F40 + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0x12 + bl __divsi3 + strh r0, [r4, 0xC] +_08112114: + movs r2, 0x12 + ldrsh r0, [r4, r2] + cmp r0, 0x1 + bne _08112136 + ldr r1, =gUnknown_08329F40 + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0x12 + bl __divsi3 + movs r1, 0x10 + subs r1, r0 + strh r1, [r4, 0xE] +_08112136: + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0xC] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0x80 + bne _0811215E + movs r0, 0 + strh r0, [r4, 0x26] + ldr r1, =sub_8112170 + str r1, [r4] + adds r0, r5, 0 + bl _call_via_r1 +_0811215E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81120DC + + thumb_func_start sub_8112170 +sub_8112170: @ 8112170 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r6, r0, 24 + movs r1, 0x26 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _081121DC + cmp r0, 0x1 + bgt _081121A8 + cmp r0, 0 + beq _081121AE + b _08112258 + .pool +_081121A8: + cmp r0, 0x2 + beq _081121F0 + b _08112258 +_081121AE: + ldr r1, =0x02039b28 + movs r0, 0x3 + strb r0, [r1, 0x15] + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x24] + cmp r6, 0x1 + bne _081121D0 + movs r1, 0x80 + lsls r1, 2 + b _081121D4 + .pool +_081121D0: + movs r1, 0x80 + lsls r1, 3 +_081121D4: + movs r0, 0 + bl ClearGpuRegBits + b _08112258 +_081121DC: + ldrh r0, [r4, 0x10] + ldr r3, =0x00003c0d + movs r1, 0x10 + movs r2, 0 + bl pal_fade_1 + b _08112258 + .pool +_081121F0: + ldr r3, =0x02020630 + movs r0, 0x24 + ldrsh r1, [r4, r0] + 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] + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + bl obj_delete_but_dont_free_vram + ldr r0, =0x00002771 + bl FreeObjectPaletteByTag + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + cmp r6, 0x1 + bne _08112248 + movs r1, 0x80 + lsls r1, 2 + movs r0, 0 + bl SetGpuRegBits + b _08112252 + .pool +_08112248: + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + bl SetGpuRegBits +_08112252: + adds r0, r5, 0 + bl move_anim_task_del +_08112258: + ldrh r0, [r4, 0x26] + adds r0, 0x1 + strh r0, [r4, 0x26] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8112170 + + thumb_func_start sub_8112264 +sub_8112264: @ 8112264 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r7, r0, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _081122AC + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 8 + movs r2, 0xE0 + lsls r2, 13 + adds r0, r2 + lsrs r5, r0, 16 + ldr r4, =0x02038437 + b _081122D0 + .pool +_081122AC: + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 8 + movs r2, 0xE0 + lsls r2, 13 + adds r0, r2 + lsrs r5, r0, 16 + ldr r4, =0x02038436 +_081122D0: + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 8 + movs r1, 0xE0 + lsls r1, 13 + adds r0, r1 + lsrs r0, 16 + mov r9, r0 + mov r8, r5 + mov r2, r9 + subs r4, r2, r5 + lsls r4, 16 + lsrs r4, 16 + lsls r0, r6, 4 + strh r0, [r7, 0x2E] + lsls r0, r5, 4 + strh r0, [r7, 0x30] + mov r1, r10 + subs r0, r1, r6 + lsls r0, 4 + ldr r5, =0x0203841e + movs r2, 0x2 + ldrsh r1, [r5, r2] + bl __divsi3 + strh r0, [r7, 0x32] + lsls r4, 16 + asrs r4, 12 + movs r0, 0x2 + ldrsh r1, [r5, r0] + adds r0, r4, 0 + bl __divsi3 + strh r0, [r7, 0x34] + ldrh r0, [r5, 0x2] + strh r0, [r7, 0x36] + mov r1, r10 + strh r1, [r7, 0x38] + mov r2, r9 + strh r2, [r7, 0x3A] + movs r1, 0x36 + ldrsh r0, [r7, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r7, 0x3C] + ldrb r1, [r7, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r7, 0x5] + strh r6, [r7, 0x20] + mov r2, r8 + strh r2, [r7, 0x22] + ldr r0, =sub_8112384 + str r0, [r7, 0x1C] + adds r2, r7, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8112264 + + thumb_func_start sub_8112384 +sub_8112384: @ 8112384 + push {r4,lr} + adds r2, r0, 0 + ldrh r3, [r2, 0x36] + movs r1, 0x36 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _081123BC + ldrh r0, [r2, 0x32] + ldrh r4, [r2, 0x2E] + adds r0, r4 + strh r0, [r2, 0x2E] + ldrh r1, [r2, 0x34] + ldrh r4, [r2, 0x30] + adds r1, r4 + strh r1, [r2, 0x30] + lsls r0, 16 + asrs r0, 20 + strh r0, [r2, 0x20] + lsls r1, 16 + asrs r1, 20 + strh r1, [r2, 0x22] + subs r0, r3, 0x1 + strh r0, [r2, 0x36] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bne _081123BC + strh r0, [r2, 0x2E] +_081123BC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8112384 + + thumb_func_start sub_81123C4 +sub_81123C4: @ 81123C4 + 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 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r1, r0 + str r1, [sp] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0 + ldr r1, [sp] + strh r0, [r1, 0x12] + strh r0, [r1, 0x14] + strh r0, [r1, 0x16] + strh r0, [r1, 0x18] + movs r0, 0x10 + strh r0, [r1, 0x1A] + ldr r2, =0x0203841e + ldrh r0, [r2] + strh r0, [r1, 0x1C] + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A861C + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x8] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08112434 + b _08112530 +_08112434: + movs r4, 0 +_08112436: + lsls r1, r4, 16 + asrs r3, r1, 16 + ldr r0, =0x02038436 + ldrb r2, [r0] + str r1, [sp, 0x10] + cmp r3, r2 + beq _08112502 + movs r0, 0x2 + eors r2, r0 + cmp r3, r2 + beq _08112502 + lsls r0, r4, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _08112502 + ldr r6, [sp, 0x4] + ldr r3, [sp, 0x8] + lsls r0, r3, 16 + asrs r7, r0, 16 + ldr r0, =gUnknown_08596DB8 + adds r1, r6, 0 + adds r2, r7, 0 + movs r3, 0x37 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x40 + beq _08112502 + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + adds r0, r4, 0 + movs r1, 0x3 + bl sub_80A861C + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + mov r0, r8 + lsls r5, r0, 4 + add r5, r8 + lsls r5, 2 + ldr r1, =0x02020630 + adds r4, r5, r1 + lsls r0, r6, 4 + strh r0, [r4, 0x2E] + lsls r0, r7, 4 + strh r0, [r4, 0x30] + mov r2, r10 + subs r0, r2, r6 + lsls r0, 4 + ldr r3, =0x0203841e + movs r2, 0x2 + ldrsh r1, [r3, r2] + bl __divsi3 + strh r0, [r4, 0x32] + mov r3, r9 + lsls r0, r3, 16 + asrs r0, 16 + subs r0, r7 + lsls r0, 4 + ldr r2, =0x0203841e + movs r3, 0x2 + ldrsh r1, [r2, r3] + bl __divsi3 + strh r0, [r4, 0x34] + ldr r1, =0x0203841e + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x36] + mov r2, r10 + strh r2, [r4, 0x38] + mov r3, r9 + strh r3, [r4, 0x3A] + ldr r0, =0x0202064c + adds r5, r0 + ldr r0, =sub_8112384 + str r0, [r5] + ldr r2, [sp] + movs r3, 0x20 + ldrsh r1, [r2, r3] + adds r1, 0xD + lsls r1, 1 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r1 + mov r1, r8 + strh r1, [r0] + ldrh r0, [r2, 0x20] + adds r0, 0x1 + strh r0, [r2, 0x20] +_08112502: + ldr r2, [sp, 0x10] + movs r3, 0x80 + lsls r3, 9 + adds r0, r2, r3 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _08112436 + b _081125B4 + .pool +_08112530: + ldr r0, =gUnknown_08596DB8 + ldr r7, [sp, 0x4] + ldr r2, [sp, 0x8] + lsls r1, r2, 16 + asrs r1, 16 + str r1, [sp, 0xC] + adds r1, r7, 0 + ldr r2, [sp, 0xC] + movs r3, 0x37 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x40 + beq _081125B4 + movs r3, 0x30 + mov r10, r3 + movs r0, 0x28 + mov r9, r0 + ldr r6, =0x02020630 + mov r1, r8 + lsls r5, r1, 4 + add r5, r8 + lsls r5, 2 + adds r4, r5, r6 + lsls r0, r7, 4 + strh r0, [r4, 0x2E] + ldr r2, [sp, 0xC] + lsls r0, r2, 4 + strh r0, [r4, 0x30] + subs r0, r3, r7 + lsls r0, 4 + ldr r3, =0x0203841e + movs r2, 0x2 + ldrsh r1, [r3, r2] + bl __divsi3 + strh r0, [r4, 0x32] + mov r3, r9 + ldr r1, [sp, 0xC] + subs r0, r3, r1 + lsls r0, 4 + ldr r2, =0x0203841e + movs r3, 0x2 + ldrsh r1, [r2, r3] + bl __divsi3 + strh r0, [r4, 0x34] + ldr r1, =0x0203841e + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x36] + mov r2, r10 + strh r2, [r4, 0x38] + mov r3, r9 + strh r3, [r4, 0x3A] + adds r6, 0x1C + adds r5, r6 + ldr r0, =sub_8112384 + str r0, [r5] + mov r1, r8 + ldr r0, [sp] + strh r1, [r0, 0x22] + movs r0, 0x1 + ldr r2, [sp] + strh r0, [r2, 0x20] +_081125B4: + ldr r0, =sub_81125E0 + ldr r3, [sp] + str r0, [r3] + 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_81123C4 + + thumb_func_start sub_81125E0 +sub_81125E0: @ 81125E0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _08112696 + cmp r1, 0x1 + bgt _08112608 + cmp r1, 0 + beq _08112616 + b _08112752 + .pool +_08112608: + cmp r1, 0x2 + bne _0811260E + b _08112728 +_0811260E: + cmp r1, 0x3 + bne _08112614 + b _0811273C +_08112614: + b _08112752 +_08112616: + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0811267C + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0811267C + strh r1, [r4, 0x12] + ldrh r0, [r4, 0x16] + adds r0, 0x1 + strh r0, [r4, 0x16] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0811264C + ldrh r1, [r4, 0x18] + movs r2, 0x18 + ldrsh r0, [r4, r2] + cmp r0, 0xF + bgt _0811265A + adds r0, r1, 0x1 + strh r0, [r4, 0x18] + b _0811265A +_0811264C: + ldrh r1, [r4, 0x1A] + movs r2, 0x1A + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0811265A + subs r0, r1, 0x1 + strh r0, [r4, 0x1A] +_0811265A: + ldrh r1, [r4, 0x1A] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x16 + ldrsh r0, [r4, r1] + cmp r0, 0x17 + ble _0811267C + movs r0, 0 + strh r0, [r4, 0x16] + movs r0, 0x1 + strh r0, [r4, 0x14] +_0811267C: + ldrh r1, [r4, 0x1C] + movs r2, 0x1C + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0811268C + subs r0, r1, 0x1 + strh r0, [r4, 0x1C] + b _08112752 +_0811268C: + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08112752 + b _08112734 +_08112696: + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08112752 + movs r0, 0 + strh r0, [r4, 0x12] + ldrh r0, [r4, 0x16] + adds r0, 0x1 + strh r0, [r4, 0x16] + ands r0, r1 + lsls r0, 16 + cmp r0, 0 + beq _081126C6 + ldrh r1, [r4, 0x18] + movs r2, 0x18 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _081126D4 + subs r0, r1, 0x1 + strh r0, [r4, 0x18] + b _081126D4 +_081126C6: + ldrh r1, [r4, 0x1A] + movs r2, 0x1A + ldrsh r0, [r4, r2] + cmp r0, 0xF + bgt _081126D4 + adds r0, r1, 0x1 + strh r0, [r4, 0x1A] +_081126D4: + ldrh r1, [r4, 0x1A] + lsls r1, 8 + ldrh r0, [r4, 0x18] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + ldr r1, [r4, 0x18] + movs r0, 0x80 + lsls r0, 13 + cmp r1, r0 + bne _08112752 + movs r5, 0 + b _08112718 +_081126F4: + adds r1, r5, 0 + adds r1, 0xD + lsls r1, 1 + adds r0, r4, 0 + adds r0, 0x8 + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_08112718: + movs r1, 0x20 + ldrsh r0, [r4, r1] + cmp r5, r0 + blt _081126F4 + b _08112734 + .pool +_08112728: + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + lsls r0, 16 + cmp r0, 0 + ble _08112752 +_08112734: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08112752 +_0811273C: + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r5, 0 + bl move_anim_task_del +_08112752: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81125E0 + + thumb_func_start sub_8112758 +sub_8112758: @ 8112758 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02022e24 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e26 + strh r1, [r0] + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + ldr r1, =0x00003f1f + movs r0, 0x4A + bl SetGpuReg + movs r0, 0x50 + movs r1, 0xC8 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0x10 + bl SetGpuReg + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _081127A0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _081127B8 +_081127A0: + movs r6, 0x28 + b _081127BA + .pool +_081127B8: + movs r6, 0xC8 +_081127BA: + ldr r1, =0x02022e24 + lsls r3, r6, 16 + asrs r2, r3, 16 + lsls r0, r2, 8 + orrs r0, r2 + strh r0, [r1] + ldr r1, =0x02022e26 + movs r5, 0x28 + ldr r0, =0x00002828 + strh r0, [r1] + lsrs r3, 16 + movs r1, 0xF0 + subs r1, r2 + movs r4, 0x48 + ldr r2, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r2 + strh r3, [r0, 0xA] + strh r1, [r0, 0xC] + strh r5, [r0, 0xE] + strh r4, [r0, 0x10] + strh r6, [r0, 0x12] + strh r5, [r0, 0x14] + ldr r1, =sub_811280C + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8112758 + + thumb_func_start sub_811280C +sub_811280C: @ 811280C + 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 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r1, [r4, 0x8] + adds r0, r1, 0x1 + strh r0, [r4, 0x8] + ldrh r5, [r4, 0xA] + ldrh r7, [r4, 0xC] + ldrh r0, [r4, 0xE] + mov r10, r0 + ldrh r2, [r4, 0x10] + str r2, [sp, 0xC] + ldrh r0, [r4, 0x12] + ldrh r2, [r4, 0x14] + mov r8, r2 + lsls r1, 16 + asrs r6, r1, 16 + cmp r6, 0xF + ble _08112848 + b _08112938 +_08112848: + lsls r0, 16 + asrs r0, 16 + bl __floatsidf + str r0, [sp, 0x10] + str r1, [sp, 0x14] + lsls r0, r5, 16 + asrs r0, 16 + bl __floatsidf + ldr r2, =0x3fb00000 + ldr r3, =0x00000000 + bl __muldf3 + adds r5, r1, 0 + adds r4, r0, 0 + adds r0, r6, 0 + bl __floatsidf + str r0, [sp, 0x18] + str r1, [sp, 0x1C] + adds r1, r5, 0 + adds r0, r4, 0 + ldr r2, [sp, 0x18] + ldr r3, [sp, 0x1C] + bl __muldf3 + adds r3, r1, 0 + adds r2, r0, 0 + ldr r0, [sp, 0x10] + ldr r1, [sp, 0x14] + bl __subdf3 + bl __fixunsdfsi + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + lsls r0, r7, 16 + asrs r0, 16 + bl __floatsidf + ldr r2, =0x3fb00000 + ldr r3, =0x00000000 + bl __muldf3 + ldr r2, [sp, 0x18] + ldr r3, [sp, 0x1C] + bl __muldf3 + adds r3, r1, 0 + adds r2, r0, 0 + ldr r0, [sp, 0x10] + ldr r1, [sp, 0x14] + bl __adddf3 + bl __fixunsdfsi + lsls r0, 16 + lsrs r7, r0, 16 + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + bl __floatsidf + adds r5, r1, 0 + adds r4, r0, 0 + mov r2, r10 + lsls r0, r2, 16 + asrs r0, 16 + bl __floatsidf + ldr r2, =0x3fb00000 + ldr r3, =0x00000000 + bl __muldf3 + ldr r2, [sp, 0x18] + ldr r3, [sp, 0x1C] + bl __muldf3 + adds r3, r1, 0 + adds r2, r0, 0 + adds r1, r5, 0 + adds r0, r4, 0 + bl __subdf3 + bl __fixunsdfsi + lsls r0, 16 + lsrs r6, r0, 16 + ldr r1, [sp, 0xC] + lsls r0, r1, 16 + asrs r0, 16 + bl __floatsidf + ldr r2, =0x3fb00000 + ldr r3, =0x00000000 + bl __muldf3 + ldr r2, [sp, 0x18] + ldr r3, [sp, 0x1C] + bl __muldf3 + adds r3, r1, 0 + adds r2, r0, 0 + adds r1, r5, 0 + adds r0, r4, 0 + bl __adddf3 + bl __fixunsdfsi + lsls r0, 16 + lsrs r5, r0, 16 + b _08112966 + .pool +_08112938: + movs r2, 0 + mov r9, r2 + movs r7, 0xF0 + movs r6, 0 + movs r5, 0x70 + str r6, [sp] + str r6, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r3, 0 + bl sub_80A75AC + lsls r0, 16 + lsrs r0, 16 + str r6, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_8112994 + str r0, [r4] +_08112966: + ldr r1, =0x02022e24 + mov r2, r9 + lsls r0, r2, 8 + orrs r7, r0 + strh r7, [r1] + ldr r1, =0x02022e26 + lsls r0, r6, 8 + orrs r5, r0 + strh r5, [r1] + 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_811280C + + thumb_func_start sub_8112994 +sub_8112994: @ 8112994 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _081129DA + ldr r0, =0x02022e24 + strh r1, [r0] + ldr r0, =0x02022e26 + strh r1, [r0] + ldr r4, =0x00003f3f + movs r0, 0x48 + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x4A + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + adds r0, r5, 0 + bl move_anim_task_del +_081129DA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8112994 + + thumb_func_start sub_81129F0 +sub_81129F0: @ 81129F0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08112A24 + movs r2, 0x18 + ldr r3, =0x0000fffe + ldrb r0, [r4, 0x3] + movs r1, 0x3F + negs r1, r1 + ands r1, r0 + movs r0, 0x10 + orrs r1, r0 + strb r1, [r4, 0x3] + b _08112A28 + .pool +_08112A24: + ldr r2, =0x0000ffe8 + movs r3, 0x2 +_08112A28: + lsls r0, r2, 16 + asrs r0, 16 + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + strh r3, [r4, 0x30] + movs r0, 0x3C + strh r0, [r4, 0x2E] + ldr r0, =sub_8112A4C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81129F0 + + thumb_func_start sub_8112A4C +sub_8112A4C: @ 8112A4C + push {r4,lr} + adds r3, r0, 0 + ldrh r1, [r3, 0x2E] + movs r2, 0x2E + ldrsh r0, [r3, r2] + cmp r0, 0 + ble _08112A5E + subs r0, r1, 0x1 + b _08112AC2 +_08112A5E: + ldrh r0, [r3, 0x30] + ldrh r4, [r3, 0x24] + adds r1, r0, r4 + strh r1, [r3, 0x24] + adds r0, r1, 0x7 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xE + bls _08112AC4 + ldrh r0, [r3, 0x20] + adds r0, r1 + strh r0, [r3, 0x20] + movs r0, 0 + strh r0, [r3, 0x24] + ldrh r2, [r3, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x8 + ldr r4, =0x000003ff + adds r0, r4, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x4] + ldrh r0, [r3, 0x32] + adds r0, 0x1 + strh r0, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _08112AC0 + movs r0, 0x1E + strh r0, [r3, 0x2E] + ldr r0, =sub_80A64B0 + str r0, [r3, 0x1C] + ldr r1, =sub_8112ACC + adds r0, r3, 0 + bl oamt_set_x3A_32 + b _08112AC4 + .pool +_08112AC0: + movs r0, 0x28 +_08112AC2: + strh r0, [r3, 0x2E] +_08112AC4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8112A4C + + thumb_func_start sub_8112ACC +sub_8112ACC: @ 8112ACC + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x2E + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08112AF6 + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0x10 + bl SetGpuReg + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + strh r5, [r4, 0x30] + strh r5, [r4, 0x32] + b _08112B3A +_08112AF6: + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0x1 + bgt _08112B06 + adds r0, r1, 0x1 + strh r0, [r4, 0x30] + b _08112B3A +_08112B06: + movs r0, 0 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + movs r1, 0x10 + subs r1, r0 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _08112B3A + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_8112B44 + str r0, [r4, 0x1C] +_08112B3A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8112ACC + + thumb_func_start sub_8112B44 +sub_8112B44: @ 8112B44 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + ldr r0, =0x02022e24 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e26 + strh r1, [r0] + adds r0, r4, 0 + bl move_anim_8072740 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8112B44 + + thumb_func_start sub_8112B78 +sub_8112B78: @ 8112B78 + push {r4-r7,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + movs r1, 0xC + bl sine + strh r0, [r5, 0x24] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08112B9C + ldrh r0, [r5, 0x24] + negs r0, r0 + strh r0, [r5, 0x24] +_08112B9C: + ldrh r0, [r5, 0x2E] + adds r0, 0x6 + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x2E] + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + ldrh r1, [r5, 0x30] + adds r0, r1 + strh r0, [r5, 0x30] + lsls r0, 16 + asrs r0, 24 + negs r0, r0 + strh r0, [r5, 0x26] + ldrh r0, [r5, 0x3C] + adds r0, 0x1 + strh r0, [r5, 0x3C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _08112BE8 + ldr r0, =0x0000050b + strh r0, [r5, 0x3A] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + ldrh r1, [r5, 0x3A] + movs r0, 0x52 + bl SetGpuReg + b _08112C40 + .pool +_08112BE8: + cmp r0, 0x1E + ble _08112C40 + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] + ldrh r1, [r5, 0x3A] + lsls r0, r1, 16 + asrs r0, 24 + lsls r0, 16 + movs r6, 0xFF + ands r6, r1 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + lsrs r7, r0, 16 + cmp r7, 0x10 + bls _08112C0C + movs r7, 0x10 +_08112C0C: + subs r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r0, 0 + bge _08112C18 + movs r6, 0 +_08112C18: + lsls r4, r7, 8 + orrs r4, r6 + lsls r1, r4, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + strh r4, [r5, 0x3A] + cmp r7, 0x10 + bne _08112C40 + cmp r6, 0 + bne _08112C40 + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_8112C4C + str r0, [r5, 0x1C] +_08112C40: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8112B78 + + thumb_func_start sub_8112C4C +sub_8112C4C: @ 8112C4C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r4, 0 + bl move_anim_8072740 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8112C4C + + thumb_func_start sub_8112C6C +sub_8112C6C: @ 8112C6C + 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 r0, =0x03005e00 + adds r4, r0 + movs r6, 0 + strh r6, [r4, 0x8] + movs r0, 0x10 + mov r8, r0 + mov r0, r8 + strh r0, [r4, 0xA] + ldr r5, =0x02038436 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x1A] + ldrb r0, [r5] + bl sub_80A6190 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x1C] + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A861C + lsls r0, 16 + asrs r1, r0, 16 + lsrs r0, 31 + adds r1, r0 + asrs r1, 1 + adds r1, 0x8 + strh r1, [r4, 0x1E] + strh r6, [r4, 0x16] + ldrb r0, [r5] + bl sub_80A8328 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x12] + ldrb r0, [r5] + bl sub_80A82E4 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x2 + strh r0, [r4, 0x14] + strh r6, [r4, 0xE] + mov r0, r8 + strh r0, [r4, 0x10] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl SetGpuReg + strh r6, [r4, 0x18] + ldr r0, =sub_8112D10 + str r0, [r4] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8112C6C + + thumb_func_start sub_8112D10 +sub_8112D10: @ 8112D10 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x5 + bls _08112D2A + b _08112E96 +_08112D2A: + lsls r0, 2 + ldr r1, =_08112D3C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08112D3C: + .4byte _08112D54 + .4byte _08112DC4 + .4byte _08112E06 + .4byte _08112E1A + .4byte _08112E70 + .4byte _08112E80 +_08112D54: + movs r6, 0 +_08112D56: + movs r2, 0x1A + ldrsh r1, [r4, r2] + movs r0, 0x1C + ldrsh r2, [r4, r0] + ldrb r3, [r4, 0x14] + ldr r0, =gUnknown_08596E30 + bl AddObjectToFront + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _08112DAA + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r5, r0, r1 + strh r7, [r5, 0x2E] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + movs r1, 0 + lsls r0, 24 + cmp r0, 0 + bne _08112D8C + movs r1, 0x1 +_08112D8C: + strh r1, [r5, 0x30] + movs r0, 0x2A + muls r0, r6 + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x32] + ldrh r0, [r4, 0x1E] + strh r0, [r5, 0x34] + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 1 + strh r0, [r5, 0x38] + ldrh r0, [r4, 0x16] + adds r0, 0x1 + strh r0, [r4, 0x16] +_08112DAA: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x5 + bls _08112D56 + b _08112E78 + .pool +_08112DC4: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08112DE2 + ldrh r1, [r4, 0xE] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0xD + bgt _08112DF0 + adds r0, r1, 0x1 + strh r0, [r4, 0xE] + b _08112DF0 +_08112DE2: + ldrh r1, [r4, 0x10] + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r0, 0x4 + ble _08112DF0 + subs r0, r1, 0x1 + strh r0, [r4, 0x10] +_08112DF0: + movs r1, 0xE + ldrsh r0, [r4, r1] + ldrh r2, [r4, 0xE] + ldrh r1, [r4, 0x10] + cmp r0, 0xE + bne _08112E60 + cmp r1, 0x4 + bne _08112E60 + movs r0, 0 + strh r0, [r4, 0xA] + b _08112E5A +_08112E06: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1E + ble _08112E96 + movs r0, 0 + strh r0, [r4, 0xA] + b _08112E78 +_08112E1A: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08112E38 + ldrh r1, [r4, 0xE] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _08112E46 + subs r0, r1, 0x1 + strh r0, [r4, 0xE] + b _08112E46 +_08112E38: + ldrh r1, [r4, 0x10] + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r0, 0xF + bgt _08112E46 + adds r0, r1, 0x1 + strh r0, [r4, 0x10] +_08112E46: + movs r1, 0xE + ldrsh r0, [r4, r1] + ldrh r2, [r4, 0xE] + ldrh r1, [r4, 0x10] + cmp r0, 0 + bne _08112E60 + cmp r1, 0x10 + bne _08112E60 + movs r0, 0x1 + strh r0, [r4, 0x18] +_08112E5A: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_08112E60: + lsls r1, 8 + orrs r1, r2 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + b _08112E96 +_08112E70: + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08112E96 +_08112E78: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08112E96 +_08112E80: + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r7, 0 + bl move_anim_task_del +_08112E96: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8112D10 + + thumb_func_start sub_8112E9C +sub_8112E9C: @ 8112E9C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08112EAE + ldrh r0, [r4, 0x32] + adds r0, 0x2 + b _08112EB2 +_08112EAE: + ldrh r0, [r4, 0x32] + subs r0, 0x2 +_08112EB2: + strh r0, [r4, 0x32] + ldrh r1, [r4, 0x32] + movs r0, 0xFF + ands r0, r1 + strh r0, [r4, 0x32] + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r2, 0x34 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + subs r0, 0x41 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7E + bhi _08112EF4 + ldr r2, =0x03005e00 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0x12] + adds r1, 0x1 + movs r0, 0x3 + ands r1, r0 + b _08112F08 + .pool +_08112EF4: + ldr r2, =0x03005e00 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x3 + ldrb r1, [r0, 0x12] + ands r1, r2 +_08112F08: + lsls r1, 2 + ldrb r2, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x5] + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + movs r1, 0x38 + ldrsh r0, [r4, r1] + lsls r0, 3 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x3A] + movs r2, 0x3A + ldrsh r0, [r4, r2] + movs r1, 0x7 + bl sine + strh r0, [r4, 0x26] + ldr r2, =0x03005e00 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r1, r0, r2 + movs r2, 0x18 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _08112F56 + ldrh r0, [r1, 0x16] + subs r0, 0x1 + strh r0, [r1, 0x16] + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_08112F56: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8112E9C + + thumb_func_start sub_8112F60 +sub_8112F60: @ 8112F60 + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r3] + ldr r2, =0x020241e4 + ldr r1, =0x02038436 + ldrb r1, [r1] + adds r1, r2 + ldrb r1, [r1] + strh r1, [r0, 0x38] + movs r1, 0x80 + strh r1, [r0, 0x2E] + movs r1, 0xA + strh r1, [r0, 0x30] + ldr r2, =0x0203841e + ldrh r1, [r2] + strh r1, [r0, 0x32] + ldrh r1, [r2, 0x2] + strh r1, [r0, 0x34] + ldr r1, =sub_8112FB8 + str r1, [r0, 0x1C] + ldr r2, =0x02020630 + movs r3, 0x38 + ldrsh r1, [r0, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + bx lr + .pool + thumb_func_end sub_8112F60 + + thumb_func_start sub_8112FB8 +sub_8112FB8: @ 8112FB8 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x34] + movs r1, 0x34 + ldrsh r3, [r5, r1] + cmp r3, 0 + beq _08113020 + subs r0, 0x1 + strh r0, [r5, 0x34] + movs r2, 0x2E + ldrsh r0, [r5, r2] + movs r2, 0x30 + ldrsh r1, [r5, r2] + bl sine + ldr r4, =0x02020630 + movs r1, 0x38 + ldrsh r2, [r5, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + strh r0, [r1, 0x24] + movs r2, 0x2E + ldrsh r0, [r5, r2] + movs r2, 0x30 + ldrsh r1, [r5, r2] + bl cosine + movs r1, 0x38 + ldrsh r2, [r5, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + strh r0, [r1, 0x26] + ldrh r0, [r5, 0x32] + ldrh r2, [r5, 0x2E] + adds r1, r0, r2 + strh r1, [r5, 0x2E] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _08113054 + ldr r2, =0xffffff00 + adds r0, r1, r2 + strh r0, [r5, 0x2E] + b _08113054 + .pool +_08113020: + ldr r2, =0x02020630 + movs r0, 0x38 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x24] + movs r0, 0x38 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x26] + movs r0, 0x38 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + subs r1, 0x8 + strh r1, [r0, 0x22] + ldr r0, =move_anim_8074EE0 + str r0, [r5, 0x1C] +_08113054: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8112FB8 + + thumb_func_start sub_8113064 +sub_8113064: @ 8113064 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _081130B4 + ldr r2, =0x0203841e + ldrh r0, [r5, 0x20] + ldrh r1, [r2] + subs r0, r1 + strh r0, [r5, 0x20] + ldrh r0, [r2, 0x6] + negs r0, r0 + strh r0, [r2, 0x6] + ldrh r0, [r2, 0x8] + negs r0, r0 + strh r0, [r2, 0x8] + adds r1, r2, 0 + b _081130BE + .pool +_081130B4: + ldr r1, =0x0203841e + ldrh r0, [r1] + ldrh r2, [r5, 0x20] + adds r0, r2 + strh r0, [r5, 0x20] +_081130BE: + ldrh r0, [r1, 0x2] + ldrh r2, [r5, 0x22] + adds r0, r2 + strh r0, [r5, 0x22] + ldrh r0, [r1, 0x4] + strh r0, [r5, 0x2E] + ldrh r0, [r1, 0x6] + strh r0, [r5, 0x30] + ldrh r0, [r1, 0x8] + strh r0, [r5, 0x34] + ldrh r0, [r1, 0xA] + strh r0, [r5, 0x38] + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r1, =move_anim_8074EE0 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A66DC + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8113064 + + thumb_func_start sub_8113100 +sub_8113100: @ 8113100 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_80A6838 + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08113164 + ldr r2, =0x0203841e + ldrh r0, [r5, 0x20] + ldrh r1, [r2, 0x2] + subs r0, r1 + strh r0, [r5, 0x20] + ldrh r0, [r5, 0x22] + adds r1, r0 + strh r1, [r5, 0x22] + ldrh r0, [r5, 0x32] + ldrh r1, [r2, 0x4] + subs r0, r1 + strh r0, [r5, 0x32] + ldrh r0, [r2, 0x6] + ldrh r1, [r5, 0x36] + adds r0, r1 + strh r0, [r5, 0x36] + b _0811318E + .pool +_08113164: + ldr r1, =0x0203841e + ldrh r0, [r1] + ldrh r2, [r5, 0x20] + adds r0, r2 + strh r0, [r5, 0x20] + ldrh r0, [r1, 0x2] + ldrh r2, [r5, 0x22] + adds r0, r2 + strh r0, [r5, 0x22] + ldrh r0, [r1, 0x4] + ldrh r2, [r5, 0x32] + adds r0, r2 + strh r0, [r5, 0x32] + ldrh r0, [r1, 0x6] + ldrh r1, [r5, 0x36] + adds r0, r1 + strh r0, [r5, 0x36] + adds r0, r5, 0 + movs r1, 0x1 + bl StartObjectImageAnim +_0811318E: + ldr r0, =0x0203841e + ldrh r0, [r0, 0x8] + strh r0, [r5, 0x2E] + ldr r0, =sub_80A6EEC + str r0, [r5, 0x1C] + ldr r1, =move_anim_8074EE0 + adds r0, r5, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8113100 + + thumb_func_start sub_81131B4 +sub_81131B4: @ 81131B4 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _081131D0 + ldr r4, =0x02038436 + b _081131D2 + .pool +_081131D0: + ldr r4, =0x02038437 +_081131D2: + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldr r4, =0x0203841e + movs r0, 0x2 + ldrsh r1, [r4, r0] + adds r0, r5, 0 + bl sub_80A6864 + ldrh r0, [r4, 0x4] + ldrh r1, [r5, 0x22] + adds r0, r1 + strh r0, [r5, 0x22] + ldr r0, =sub_80A67D8 + str r0, [r5, 0x1C] + ldr r1, =move_anim_8074EE0 + adds r0, r5, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81131B4 + + thumb_func_start sub_8113224 +sub_8113224: @ 8113224 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0811323E + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim +_0811323E: + adds r0, r4, 0 + bl sub_8113100 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8113224 + + thumb_func_start sub_8113250 +sub_8113250: @ 8113250 + push {r4-r7,lr} + adds r6, r0, 0 + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r6, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x22] + strh r5, [r6, 0x36] + movs r0, 0x1 + strh r0, [r6, 0x38] + ldr r0, =0x0203841e + ldrh r0, [r0] + strh r0, [r6, 0x3A] + ldr r4, =0x0202420b + ldrb r0, [r4] + movs r1, 0 + bl sub_80A861C + lsls r7, r0, 16 + lsrs r5, r7, 16 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A861C + lsls r1, r0, 16 + lsrs r0, r1, 16 + cmp r5, r0 + bls _081132B0 + lsrs r0, r7, 17 + b _081132B2 + .pool +_081132B0: + lsrs r0, r1, 17 +_081132B2: + strh r0, [r6, 0x3C] + movs r1, 0x3A + ldrsh r0, [r6, r1] + movs r2, 0x3C + ldrsh r1, [r6, r2] + bl cosine + strh r0, [r6, 0x24] + movs r1, 0x3A + ldrsh r0, [r6, r1] + movs r2, 0x3C + ldrsh r1, [r6, r2] + bl sine + strh r0, [r6, 0x26] + ldr r0, =sub_81132E0 + str r0, [r6, 0x1C] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8113250 + + thumb_func_start sub_81132E0 +sub_81132E0: @ 81132E0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x2E + ldrsh r5, [r4, r0] + cmp r5, 0 + beq _081132F2 + cmp r5, 0x1 + beq _0811335E + b _081133E2 +_081132F2: + ldrh r0, [r4, 0x3A] + ldrh r1, [r4, 0x38] + subs r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x3A] + movs r1, 0x3A + ldrsh r0, [r4, r1] + movs r2, 0x3C + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x3A + ldrsh r0, [r4, r1] + movs r2, 0x3C + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _08113344 + strh r5, [r4, 0x36] + ldrh r1, [r4, 0x38] + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmp r0, 0xF + bgt _08113344 + adds r0, r1, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + ble _08113344 + movs r0, 0x10 + strh r0, [r4, 0x38] +_08113344: + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + ble _081133E2 + movs r0, 0 + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _081133E2 +_0811335E: + ldrh r0, [r4, 0x3A] + ldrh r1, [r4, 0x38] + subs r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x3A] + ldrh r1, [r4, 0x3C] + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0x95 + bgt _08113386 + adds r0, r1, 0 + adds r0, 0x8 + strh r0, [r4, 0x3C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x95 + ble _08113386 + movs r0, 0x96 + strh r0, [r4, 0x3C] +_08113386: + movs r1, 0x3A + ldrsh r0, [r4, r1] + movs r2, 0x3C + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x3A + ldrsh r0, [r4, r1] + movs r2, 0x3C + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _081133CE + movs r0, 0 + strh r0, [r4, 0x36] + ldrh r1, [r4, 0x38] + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmp r0, 0xF + bgt _081133CE + adds r0, r1, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + ble _081133CE + movs r0, 0x10 + strh r0, [r4, 0x38] +_081133CE: + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _081133E2 + adds r0, r4, 0 + bl move_anim_8072740 +_081133E2: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81132E0 + + thumb_func_start sub_81133E8 +sub_81133E8: @ 81133E8 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r4, r1, r0 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08113424 + ldr r0, =0x04000014 + str r0, [sp] + ldr r0, =0x02022e18 + b _0811342A + .pool +_08113424: + ldr r0, =0x04000018 + str r0, [sp] + ldr r0, =0x02022e1c +_0811342A: + ldrh r0, [r0] + strh r0, [r4, 0xC] + ldr r0, =0xa2600001 + str r0, [sp, 0x4] + mov r1, sp + movs r5, 0 + movs r0, 0x1 + strb r0, [r1, 0x8] + mov r0, sp + strb r5, [r0, 0x9] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl sub_80A6190 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + subs r1, 0x20 + strh r1, [r4, 0xE] + adds r0, 0x20 + strh r0, [r4, 0x10] + cmp r1, 0 + bge _0811345A + strh r5, [r4, 0xE] +_0811345A: + ldrh r3, [r4, 0xE] + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r3, r0 + bgt _08113488 + ldr r5, =0x02038c28 + movs r0, 0xF0 + lsls r0, 3 + adds r6, r5, r0 +_0811346C: + lsls r1, r3, 1 + adds r2, r1, r5 + ldrh r0, [r4, 0xC] + strh r0, [r2] + adds r1, r6 + ldrh r0, [r4, 0xC] + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r3, r0 + ble _0811346C +_08113488: + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + ldr r0, =sub_81134B8 + str r0, [r4] + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81133E8 + + thumb_func_start sub_81134B8 +sub_81134B8: @ 81134B8 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r2, r0, r1 + movs r1, 0x8 + ldrsh r0, [r2, r1] + cmp r0, 0x4 + bhi _0811356E + lsls r0, 2 + ldr r1, =_081134E4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081134E4: + .4byte _081134F8 + .4byte _0811351A + .4byte _0811352A + .4byte _08113556 + .4byte _08113568 +_081134F8: + ldrh r0, [r2, 0x16] + adds r0, 0x1 + strh r0, [r2, 0x16] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0811354E + movs r0, 0 + strh r0, [r2, 0x16] + ldrh r0, [r2, 0x14] + adds r0, 0x1 + strh r0, [r2, 0x14] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _0811354E + b _08113548 +_0811351A: + ldrh r0, [r2, 0xA] + adds r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + ble _0811354E + b _08113548 +_0811352A: + ldrh r0, [r2, 0x16] + adds r0, 0x1 + strh r0, [r2, 0x16] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0811354E + movs r0, 0 + strh r0, [r2, 0x16] + ldrh r0, [r2, 0x14] + subs r0, 0x1 + strh r0, [r2, 0x14] + lsls r0, 16 + cmp r0, 0 + bne _0811354E +_08113548: + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] +_0811354E: + adds r0, r2, 0 + bl sub_8113574 + b _0811356E +_08113556: + ldr r1, =0x02039b28 + movs r0, 0x3 + strb r0, [r1, 0x15] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + b _0811356E + .pool +_08113568: + adds r0, r3, 0 + bl move_anim_task_del +_0811356E: + pop {r0} + bx r0 + thumb_func_end sub_81134B8 + + thumb_func_start sub_8113574 +sub_8113574: @ 8113574 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + ldrh r3, [r5, 0x12] + ldrh r4, [r5, 0xE] + movs r1, 0x10 + ldrsh r0, [r5, r1] + cmp r4, r0 + bgt _081135CA + ldr r7, =0x02038c28 + mov r12, r7 + ldr r0, =gUnknown_08329F40 + mov r8, r0 + ldr r6, =0x02039b28 +_08113592: + lsls r2, r4, 1 + ldrb r1, [r6, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + add r2, r12 + lsls r0, r3, 1 + add r0, r8 + movs r7, 0 + ldrsh r1, [r0, r7] + movs r7, 0x14 + ldrsh r0, [r5, r7] + muls r0, r1 + asrs r0, 7 + ldrh r1, [r5, 0xC] + adds r0, r1 + strh r0, [r2] + adds r3, 0x8 + movs r0, 0xFF + ands r3, r0 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + movs r7, 0x10 + ldrsh r0, [r5, r7] + cmp r4, r0 + ble _08113592 +_081135CA: + ldrh r0, [r5, 0x12] + adds r0, 0x9 + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x12] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8113574 + + thumb_func_start sub_81135EC +sub_81135EC: @ 81135EC + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r4, r0, 0 + ldr r5, =0x0203841e + movs r0, 0x4 + ldrsh r1, [r5, r0] + lsls r0, r1, 1 + adds r0, r1 + movs r1, 0x5 + bl __divsi3 + adds r6, r0, 0 + ldr r1, =0x02038436 + mov r8, r1 + ldrb r0, [r1] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + mov r2, r8 + ldrb r0, [r2] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r3, [r5, 0x8] + adds r0, r3 + strh r0, [r4, 0x22] + movs r1, 0x2 + ldrsh r0, [r5, r1] + movs r2, 0x4 + ldrsh r1, [r5, r2] + bl cosine + strh r0, [r4, 0x30] + movs r3, 0x2 + ldrsh r0, [r5, r3] + lsls r6, 16 + asrs r6, 16 + adds r1, r6, 0 + bl sine + strh r0, [r4, 0x32] + ldrh r1, [r4, 0x30] + ldrh r2, [r5] + adds r3, r2, 0 + muls r3, r1 + adds r1, r3, 0 + ldrh r3, [r4, 0x20] + adds r1, r3 + strh r1, [r4, 0x20] + adds r1, r2, 0 + muls r1, r0 + adds r0, r1, 0 + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x34] + ldr r0, =sub_811369C + str r0, [r4, 0x1C] + adds r4, 0x2E + ldr r2, =0x0203a100 + movs r1, 0x6 +_08113674: + ldrh r0, [r4] + strh r0, [r2] + adds r4, 0x2 + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08113674 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81135EC + + thumb_func_start sub_811369C +sub_811369C: @ 811369C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x36] + adds r0, r1 + strh r0, [r4, 0x36] + ldrh r0, [r4, 0x32] + ldrh r2, [r4, 0x38] + adds r0, r2 + strh r0, [r4, 0x38] + movs r1, 0x36 + ldrsh r0, [r4, r1] + movs r1, 0xA + bl __divsi3 + strh r0, [r4, 0x24] + movs r2, 0x38 + ldrsh r0, [r4, r2] + movs r1, 0xA + bl __divsi3 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x34 + ldrsh r1, [r4, r2] + cmp r0, r1 + ble _081136E0 + adds r0, r4, 0 + bl move_anim_8072740 +_081136E0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811369C + + thumb_func_start sub_81136E8 +sub_81136E8: @ 81136E8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =0x0203841e + ldrh r1, [r1] + strh r1, [r0, 0x8] + ldr r1, =0x02038436 + ldrb r4, [r1] + movs r1, 0x10 + strh r1, [r0, 0xA] + movs r0, 0x52 + bl SetGpuReg + adds r0, r4, 0 + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08113734 + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + b _0811373C + .pool +_08113734: + ldr r1, =0x00003f44 + movs r0, 0x50 + bl SetGpuReg +_0811373C: + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_811375C + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81136E8 + + thumb_func_start sub_811375C +sub_811375C: @ 811375C + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r6, r0, r1 + ldrh r0, [r6, 0xA] + lsrs r4, r0, 8 + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xC + ldrsh r0, [r6, r2] + ldrb r2, [r6, 0x8] + cmp r0, r2 + bne _081137D8 + adds r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + subs r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r4, 8 + orrs r1, r0 + movs r5, 0 + strh r1, [r6, 0xA] + ldrh r1, [r6, 0xA] + movs r0, 0x52 + bl SetGpuReg + strh r5, [r6, 0xC] + cmp r4, 0x10 + bne _081137DE + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02038436 + ldrb r0, [r0] + adds r0, r1 + 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] + adds r0, r7, 0 + bl move_anim_task_del + b _081137DE + .pool +_081137D8: + ldrh r0, [r6, 0xC] + adds r0, 0x1 + strh r0, [r6, 0xC] +_081137DE: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_811375C + + thumb_func_start sub_81137E4 +sub_81137E4: @ 81137E4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r1 + ldr r0, =0x0203841e + ldrh r0, [r0] + strh r0, [r2, 0x8] + movs r1, 0x80 + lsls r1, 5 + strh r1, [r2, 0xA] + ldr r0, =sub_811381C + str r0, [r2] + movs r0, 0x52 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end sub_81137E4 + + thumb_func_start sub_811381C +sub_811381C: @ 811381C + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r6, r0, r1 + ldrh r0, [r6, 0xA] + lsrs r4, r0, 8 + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xC + ldrsh r0, [r6, r2] + ldrb r2, [r6, 0x8] + cmp r0, r2 + bne _0811387C + subs r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r4, 8 + orrs r1, r0 + movs r5, 0 + strh r1, [r6, 0xA] + ldrh r1, [r6, 0xA] + movs r0, 0x52 + bl SetGpuReg + strh r5, [r6, 0xC] + cmp r4, 0 + bne _08113882 + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r7, 0 + bl move_anim_task_del + b _08113882 + .pool +_0811387C: + ldrh r0, [r6, 0xC] + adds r0, 0x1 + strh r0, [r6, 0xC] +_08113882: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_811381C + + thumb_func_start sub_8113888 +sub_8113888: @ 8113888 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl SetGpuReg + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081138BC + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + b _081138C4 + .pool +_081138BC: + ldr r1, =0x00003f44 + movs r0, 0x50 + bl SetGpuReg +_081138C4: + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8113888 + + thumb_func_start sub_81138D4 +sub_81138D4: @ 81138D4 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r6, =0x02038437 + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x30] + ldr r5, =0x02038436 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrb r0, [r6] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x34] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x36] + movs r0, 0x7E + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_80A6E14 + ldrh r0, [r4, 0x30] + negs r0, r0 + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x32] + negs r0, r0 + strh r0, [r4, 0x36] + ldr r0, =0x0000ffd8 + strh r0, [r4, 0x3A] + ldr r1, =sub_8113950 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81138D4 + + thumb_func_start sub_8113950 +sub_8113950: @ 8113950 + push {r4-r6,lr} + adds r4, r0, 0 + ldrh r5, [r4, 0x30] + ldrh r0, [r4, 0x34] + adds r2, r5, r0 + strh r2, [r4, 0x34] + ldrh r3, [r4, 0x32] + ldrh r6, [r4, 0x36] + adds r1, r3, r6 + strh r1, [r4, 0x36] + lsls r0, r2, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + lsls r0, r1, 16 + asrs r0, 24 + strh r0, [r4, 0x26] + movs r6, 0x3C + ldrsh r0, [r4, r6] + cmp r0, 0 + bne _08113992 + adds r0, r2, r5 + strh r0, [r4, 0x34] + adds r1, r3 + strh r1, [r4, 0x36] + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + lsls r1, 16 + asrs r1, 24 + strh r1, [r4, 0x26] + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] +_08113992: + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r2, 0x3A + ldrsh r1, [r4, r2] + bl sine + ldrh r6, [r4, 0x26] + adds r0, r6 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x38] + adds r0, 0x3 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x38] + cmp r0, 0x7F + ble _081139C2 + movs r0, 0 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x3A] + adds r0, 0x14 + strh r0, [r4, 0x3A] + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] +_081139C2: + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + bne _081139D4 + adds r0, r4, 0 + bl move_anim_8072740 +_081139D4: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8113950 + + thumb_func_start sub_81139DC +sub_81139DC: @ 81139DC + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x0203841e + ldrh r0, [r5] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldrb r1, [r5, 0x4] + adds r0, r4, 0 + bl StartObjectRotScalAnim + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x2E] + ldrh r0, [r5, 0x8] + strh r0, [r4, 0x30] + ldrh r0, [r5, 0xA] + strh r0, [r4, 0x32] + ldr r0, =sub_8113A18 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81139DC + + thumb_func_start sub_8113A18 +sub_8113A18: @ 8113A18 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x36] + adds r0, r1 + strh r0, [r2, 0x36] + ldrh r1, [r2, 0x30] + ldrh r3, [r2, 0x38] + adds r1, r3 + strh r1, [r2, 0x38] + lsls r0, 16 + asrs r0, 24 + strh r0, [r2, 0x24] + lsls r1, 16 + asrs r1, 24 + strh r1, [r2, 0x26] + ldrh r0, [r2, 0x34] + adds r0, 0x1 + strh r0, [r2, 0x34] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x32 + ldrsh r1, [r2, r3] + cmp r0, r1 + bne _08113A4E + ldr r0, =sub_8113A58 + str r0, [r2, 0x1C] +_08113A4E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8113A18 + + thumb_func_start sub_8113A58 +sub_8113A58: @ 8113A58 + push {lr} + adds r3, r0, 0 + ldrh r1, [r3, 0x36] + ldrh r0, [r3, 0x2E] + subs r1, r0 + strh r1, [r3, 0x36] + ldrh r0, [r3, 0x38] + ldrh r2, [r3, 0x30] + subs r0, r2 + strh r0, [r3, 0x38] + lsls r1, 16 + asrs r1, 24 + strh r1, [r3, 0x24] + lsls r0, 16 + asrs r0, 24 + strh r0, [r3, 0x26] + ldrh r0, [r3, 0x34] + subs r0, 0x1 + strh r0, [r3, 0x34] + lsls r0, 16 + cmp r0, 0 + bne _08113A8A + adds r0, r3, 0 + bl move_anim_8074EE0 +_08113A8A: + pop {r0} + bx r0 + thumb_func_end sub_8113A58 + + thumb_func_start sub_8113A90 +sub_8113A90: @ 8113A90 + push {r4-r7,lr} + adds r4, r0, 0 + ldr r0, =0x0203841e + movs r2, 0 + ldrsh r1, [r0, r2] + adds r3, r0, 0 + cmp r1, 0 + bne _08113AAC + ldr r0, =0x02038436 + b _08113AAE + .pool +_08113AAC: + ldr r0, =0x02038437 +_08113AAE: + ldrb r5, [r0] + movs r6, 0x14 + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x4 + ldr r7, =0x000003ff + adds r0, r7, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + movs r1, 0x2 + ldrsh r0, [r3, r1] + cmp r0, 0x1 + beq _08113B0C + cmp r0, 0x1 + bgt _08113AE8 + cmp r0, 0 + beq _08113AF2 + b _08113B60 + .pool +_08113AE8: + cmp r0, 0x2 + beq _08113B26 + cmp r0, 0x3 + beq _08113B3E + b _08113B60 +_08113AF2: + adds r0, r5, 0 + movs r1, 0x5 + bl sub_80A861C + subs r0, 0x8 + strh r0, [r4, 0x20] + adds r0, r5, 0 + movs r1, 0x2 + bl sub_80A861C + adds r0, 0x8 + strh r0, [r4, 0x22] + b _08113B60 +_08113B0C: + adds r0, r5, 0 + movs r1, 0x5 + bl sub_80A861C + subs r0, 0xE + strh r0, [r4, 0x20] + adds r0, r5, 0 + movs r1, 0x2 + bl sub_80A861C + adds r0, 0x10 + strh r0, [r4, 0x22] + b _08113B60 +_08113B26: + adds r0, r5, 0 + movs r1, 0x4 + bl sub_80A861C + adds r0, 0x8 + strh r0, [r4, 0x20] + adds r0, r5, 0 + movs r1, 0x2 + bl sub_80A861C + adds r0, 0x8 + b _08113B54 +_08113B3E: + adds r0, r5, 0 + movs r1, 0x4 + bl sub_80A861C + adds r0, 0xE + strh r0, [r4, 0x20] + adds r0, r5, 0 + movs r1, 0x2 + bl sub_80A861C + adds r0, 0x10 +_08113B54: + strh r0, [r4, 0x22] + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + movs r6, 0xEC +_08113B60: + movs r0, 0x20 + strh r0, [r4, 0x2E] + lsls r0, r6, 24 + asrs r0, 24 + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x22] + adds r0, 0xC + strh r0, [r4, 0x36] + ldr r0, =0x0000fff4 + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl sub_80A68D4 + ldr r0, =sub_8113B90 + str r0, [r4, 0x1C] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8113A90 + + thumb_func_start sub_8113B90 +sub_8113B90: @ 8113B90 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _08113BA4 + adds r0, r4, 0 + bl move_anim_8074EE0 +_08113BA4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8113B90 + + thumb_func_start sub_8113BAC +sub_8113BAC: @ 8113BAC + push {r4-r7,lr} + sub sp, 0x1C + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r5, r1, r0 + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1F + movs r6, 0 + strh r0, [r5, 0x16] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A861C + subs r0, 0x7 + strh r0, [r5, 0x14] + ldrh r1, [r5, 0x16] + strh r1, [r5, 0x12] + strh r0, [r5, 0x10] + subs r1, r0 + lsls r1, 8 + strh r1, [r5, 0x22] + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + subs r1, 0x20 + strh r1, [r5, 0x24] + adds r0, 0x20 + strh r0, [r5, 0x26] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08113C1C + ldr r0, =0x0000fff4 + b _08113C1E + .pool +_08113C1C: + ldr r0, =0x0000ffc0 +_08113C1E: + strh r0, [r5, 0x18] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xE] + cmp r0, 0x1 + bne _08113C80 + add r4, sp, 0xC + adds r0, r4, 0 + bl sub_80A6B30 + ldr r0, =0x02022e1a + ldrh r0, [r0] + strh r0, [r5, 0x1C] + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + ldrb r1, [r4, 0x8] + lsls r1, 4 + movs r0, 0 + movs r2, 0x20 + bl rboxid_80040B8 + ldr r0, =0x04000016 + str r0, [sp] + movs r7, 0x2 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08113CB0 + ldr r1, =0x02022e1c + b _08113CAA + .pool +_08113C80: + ldr r0, =0x02022e1e + ldrh r0, [r0] + strh r0, [r5, 0x1C] + ldr r1, =0x00003f44 + movs r0, 0x50 + bl SetGpuReg + movs r0, 0 + movs r1, 0x90 + movs r2, 0x20 + bl rboxid_80040B8 + ldr r0, =0x0400001a + str r0, [sp] + movs r7, 0x4 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08113CB0 + ldr r1, =0x02022e18 +_08113CAA: + ldrh r0, [r1] + adds r0, 0xF0 + strh r0, [r1] +_08113CB0: + ldr r0, =0xa2600001 + str r0, [sp, 0x4] + mov r2, sp + movs r1, 0 + movs r0, 0x1 + strb r0, [r2, 0x8] + mov r0, sp + strb r1, [r0, 0x9] + strh r1, [r5, 0x1E] + movs r0, 0x10 + strh r0, [r5, 0x20] + strh r1, [r5, 0x8] + strh r1, [r5, 0xA] + strh r1, [r5, 0xC] + movs r0, 0x3 + bl sub_8114374 + movs r3, 0 + ldr r4, =0x02038c28 + movs r0, 0xF0 + lsls r0, 3 + adds r6, r4, r0 +_08113CDC: + lsls r1, r3, 1 + adds r2, r1, r4 + ldrh r0, [r5, 0x1C] + strh r0, [r2] + adds r1, r6 + ldrh r0, [r5, 0x1C] + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x6F + bls _08113CDC + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + movs r0, 0x3F + eors r7, r0 + movs r1, 0xFC + lsls r1, 6 + adds r0, r1, 0 + orrs r7, r0 + movs r0, 0x4A + adds r1, r7, 0 + bl SetGpuReg + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + ldr r2, =0x02022e24 + ldrh r0, [r5, 0x24] + lsls r0, 8 + ldrh r1, [r5, 0x26] + orrs r0, r1 + strh r0, [r2] + ldr r1, =0x02022e26 + movs r0, 0xA0 + strh r0, [r1] + ldr r0, =sub_8113D60 + str r0, [r5] + add sp, 0x1C + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8113BAC + + thumb_func_start sub_8113D60 +sub_8113D60: @ 8113D60 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bls _08113D7A + b _08113E72 +_08113D7A: + lsls r0, 2 + ldr r1, =_08113D8C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08113D8C: + .4byte _08113DA0 + .4byte _08113E02 + .4byte _08113E1C + .4byte _08113E58 + .4byte _08113E6C +_08113DA0: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08113E72 + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08113DD0 + ldrh r1, [r4, 0x1E] + movs r2, 0x1E + ldrsh r0, [r4, r2] + cmp r0, 0xC + beq _08113DDE + adds r0, r1, 0x1 + strh r0, [r4, 0x1E] + b _08113DDE +_08113DD0: + ldrh r1, [r4, 0x20] + movs r2, 0x20 + ldrsh r0, [r4, r2] + cmp r0, 0x8 + beq _08113DDE + subs r0, r1, 0x1 + strh r0, [r4, 0x20] +_08113DDE: + ldrh r1, [r4, 0x20] + lsls r1, 8 + ldrh r0, [r4, 0x1E] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0xC + bne _08113E72 + movs r2, 0x20 + ldrsh r0, [r4, r2] + cmp r0, 0x8 + bne _08113E72 + b _08113E5E +_08113E02: + ldrh r0, [r4, 0x10] + subs r0, 0x8 + strh r0, [r4, 0x10] + adds r0, r4, 0 + bl sub_8114244 + movs r0, 0x10 + ldrsh r1, [r4, r0] + movs r2, 0x18 + ldrsh r0, [r4, r2] + cmp r1, r0 + bge _08113E72 + b _08113E5E +_08113E1C: + ldrh r0, [r4, 0x10] + subs r0, 0x8 + strh r0, [r4, 0x10] + adds r0, r4, 0 + bl sub_8114244 + ldrh r1, [r4, 0x24] + adds r1, 0x4 + strh r1, [r4, 0x24] + ldrh r0, [r4, 0x26] + subs r2, r0, 0x4 + strh r2, [r4, 0x26] + lsls r1, 16 + lsls r0, r2, 16 + cmp r1, r0 + blt _08113E3E + strh r2, [r4, 0x24] +_08113E3E: + ldr r3, =0x02022e24 + ldrh r2, [r4, 0x24] + lsls r0, r2, 8 + ldrh r1, [r4, 0x26] + orrs r0, r1 + strh r0, [r3] + lsls r2, 16 + lsls r1, 16 + cmp r2, r1 + bne _08113E72 + b _08113E5E + .pool +_08113E58: + ldr r1, =0x02039b28 + movs r0, 0x3 + strb r0, [r1, 0x15] +_08113E5E: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08113E72 + .pool +_08113E6C: + adds r0, r2, 0 + bl move_anim_task_del +_08113E72: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8113D60 + + thumb_func_start sub_8113E78 +sub_8113E78: @ 8113E78 + push {r4-r7,lr} + sub sp, 0x1C + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x4 + bls _08113E94 + b _081140A6 +_08113E94: + lsls r0, 2 + ldr r1, =_08113EA8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08113EA8: + .4byte _08113EBC + .4byte _08113F40 + .4byte _08113F84 + .4byte _08113FF0 + .4byte _08114058 +_08113EBC: + bl sub_80A4DF0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08113EF8 + ldr r0, =0x02022e24 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e26 + strh r1, [r0] + ldr r4, =0x00003f3f + movs r0, 0x48 + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x4A + adds r1, r4, 0 + bl SetGpuReg + adds r0, r6, 0 + bl move_anim_task_del + b _081140A6 + .pool +_08113EF8: + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xE] + cmp r0, 0x1 + bne _08113F24 + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x02022e1c + b _08113F2E + .pool +_08113F24: + ldr r1, =0x00003f44 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x02022e18 +_08113F2E: + ldrh r0, [r1] + adds r0, 0xF0 + strh r0, [r1] + b _08114044 + .pool +_08113F40: + movs r1, 0xE + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _08113F68 + mov r0, sp + bl sub_80A6B30 + ldr r0, =0x02022e1a + ldrh r0, [r0] + strh r0, [r5, 0x1C] + mov r0, sp + ldrb r1, [r0, 0x8] + lsls r1, 4 + movs r0, 0 + movs r2, 0x20 + bl rboxid_80040B8 + b _08113F78 + .pool +_08113F68: + ldr r0, =0x02022e1e + ldrh r0, [r0] + strh r0, [r5, 0x1C] + movs r0, 0 + movs r1, 0x90 + movs r2, 0x20 + bl rboxid_80040B8 +_08113F78: + movs r0, 0x3 + bl sub_8114374 + b _08114044 + .pool +_08113F84: + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1F + movs r6, 0 + strh r0, [r5, 0x16] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A861C + subs r0, 0x7 + strh r0, [r5, 0x14] + ldrh r1, [r5, 0x16] + subs r1, r0 + lsls r1, 8 + strh r1, [r5, 0x22] + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + subs r1, r0, 0x4 + strh r1, [r5, 0x24] + adds r0, 0x4 + strh r0, [r5, 0x26] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08113FD8 + ldr r0, =0x0000fff4 + b _08113FDA + .pool +_08113FD8: + ldr r0, =0x0000ffc0 +_08113FDA: + strh r0, [r5, 0x18] + ldrh r0, [r5, 0x18] + strh r0, [r5, 0x10] + strh r0, [r5, 0x12] + movs r0, 0xC + strh r0, [r5, 0x1E] + movs r0, 0x8 + strh r0, [r5, 0x20] + b _08114044 + .pool +_08113FF0: + movs r1, 0xE + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _08114000 + ldr r0, =0x04000016 + b _08114002 + .pool +_08114000: + ldr r0, =0x0400001a +_08114002: + str r0, [sp, 0x10] + movs r3, 0 + add r4, sp, 0x10 + ldr r6, =0x02038c28 + movs r0, 0xF0 + lsls r0, 3 + adds r7, r6, r0 +_08114010: + lsls r1, r3, 1 + adds r2, r1, r6 + ldrh r0, [r5, 0x1C] + adds r0, 0x9F + subs r0, r3 + strh r0, [r2] + adds r1, r7 + ldrh r0, [r5, 0x1C] + adds r0, 0x9F + subs r0, r3 + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x6F + bls _08114010 + ldr r1, =0xa2600001 + str r1, [r4, 0x4] + movs r2, 0 + movs r0, 0x1 + strb r0, [r4, 0x8] + strb r2, [r4, 0x9] + ldr r0, [sp, 0x10] + ldr r2, [r4, 0x8] + bl sub_80BA038 +_08114044: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _081140A6 + .pool +_08114058: + movs r1, 0xE + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _08114070 + ldr r1, =0x00003f3d + movs r0, 0x4A + bl SetGpuReg + b _08114078 + .pool +_08114070: + ldr r1, =0x00003f3b + movs r0, 0x4A + bl SetGpuReg +_08114078: + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + ldr r2, =0x02022e24 + ldrh r0, [r5, 0x24] + lsls r0, 8 + ldrh r1, [r5, 0x26] + orrs r0, r1 + strh r0, [r2] + ldr r1, =0x02022e26 + movs r0, 0xA0 + strh r0, [r1] + movs r0, 0 + strh r0, [r5, 0x8] + strh r0, [r5, 0xA] + strh r0, [r5, 0xC] + ldr r1, =0x0000080c + movs r0, 0x52 + bl SetGpuReg + ldr r0, =sub_81140C8 + str r0, [r5] +_081140A6: + add sp, 0x1C + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8113E78 + + thumb_func_start sub_81140C8 +sub_81140C8: @ 81140C8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bls _081140E2 + b _08114232 +_081140E2: + lsls r0, 2 + ldr r1, =_081140F4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081140F4: + .4byte _08114108 + .4byte _08114134 + .4byte _0811419C + .4byte _081141FE + .4byte _08114210 +_08114108: + ldrh r0, [r4, 0x12] + adds r0, 0x8 + strh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 16 + ldrh r2, [r4, 0x16] + movs r3, 0x16 + ldrsh r1, [r4, r3] + cmp r0, r1 + blt _0811411E + strh r2, [r4, 0x12] +_0811411E: + adds r0, r4, 0 + bl sub_8114244 + movs r0, 0x12 + ldrsh r1, [r4, r0] + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r1, r0 + beq _08114132 + b _08114232 +_08114132: + b _08114204 +_08114134: + movs r3, 0x26 + ldrsh r0, [r4, r3] + movs r2, 0x24 + ldrsh r1, [r4, r2] + subs r0, r1 + cmp r0, 0x3F + bgt _08114150 + ldrh r0, [r4, 0x24] + subs r0, 0x4 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x26] + adds r0, 0x4 + strh r0, [r4, 0x26] + b _08114154 +_08114150: + movs r0, 0x1 + strh r0, [r4, 0xA] +_08114154: + ldr r2, =0x02022e24 + ldrh r0, [r4, 0x24] + lsls r0, 8 + ldrh r1, [r4, 0x26] + orrs r0, r1 + strh r0, [r2] + ldrh r0, [r4, 0x10] + adds r0, 0x8 + strh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 16 + ldrh r2, [r4, 0x14] + movs r3, 0x14 + ldrsh r1, [r4, r3] + cmp r0, r1 + blt _08114176 + strh r2, [r4, 0x10] +_08114176: + adds r0, r4, 0 + bl sub_8114244 + movs r0, 0x10 + ldrsh r1, [r4, r0] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _08114232 + movs r3, 0xA + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _08114232 + movs r0, 0 + strh r0, [r4, 0xA] + b _08114204 + .pool +_0811419C: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08114232 + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081141CC + ldrh r1, [r4, 0x1E] + movs r2, 0x1E + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _081141DA + subs r0, r1, 0x1 + strh r0, [r4, 0x1E] + b _081141DA +_081141CC: + ldrh r1, [r4, 0x20] + movs r3, 0x20 + ldrsh r0, [r4, r3] + cmp r0, 0xF + bgt _081141DA + adds r0, r1, 0x1 + strh r0, [r4, 0x20] +_081141DA: + ldrh r1, [r4, 0x20] + lsls r1, 8 + ldrh r0, [r4, 0x1E] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08114232 + movs r2, 0x20 + ldrsh r0, [r4, r2] + cmp r0, 0x10 + bne _08114232 + b _08114204 +_081141FE: + ldr r1, =0x02039b28 + movs r0, 0x3 + strb r0, [r1, 0x15] +_08114204: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08114232 + .pool +_08114210: + ldr r0, =0x02022e24 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e26 + strh r1, [r0] + ldr r4, =0x00003f3f + movs r0, 0x48 + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x4A + adds r1, r4, 0 + bl SetGpuReg + adds r0, r5, 0 + bl move_anim_task_del +_08114232: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81140C8 + + thumb_func_start sub_8114244 +sub_8114244: @ 8114244 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + ldrh r0, [r6, 0x12] + ldrh r4, [r6, 0x10] + subs r0, r4 + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + beq _08114338 + movs r2, 0x22 + ldrsh r0, [r6, r2] + bl __divsi3 + mov r8, r0 + movs r3, 0x14 + ldrsh r0, [r6, r3] + lsls r5, r0, 8 + lsls r0, r4, 16 + movs r4, 0 + cmp r0, 0 + ble _081142A4 + ldr r0, =0x02038c28 + mov r12, r0 + ldr r7, =0x02039b28 +_08114278: + lsls r2, r4, 16 + asrs r2, 16 + lsls r3, r2, 1 + ldrb r1, [r7, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r3, r0 + add r3, r12 + adds r1, r2, 0 + subs r1, 0x9F + ldrh r0, [r6, 0x1C] + subs r0, r1 + strh r0, [r3] + adds r2, 0x1 + lsls r2, 16 + lsrs r4, r2, 16 + asrs r2, 16 + movs r1, 0x10 + ldrsh r0, [r6, r1] + cmp r2, r0 + blt _08114278 +_081142A4: + ldrh r4, [r6, 0x10] + lsls r3, r4, 16 + asrs r1, r3, 16 + movs r2, 0x12 + ldrsh r0, [r6, r2] + cmp r1, r0 + bgt _081142EE + ldr r0, =0x02038c28 + mov r12, r0 + ldr r7, =0x02039b28 +_081142B8: + asrs r4, r3, 16 + cmp r4, 0 + blt _081142DA + asrs r1, r5, 8 + subs r1, r4 + lsls r3, r4, 1 + ldrb r2, [r7, 0x14] + lsls r0, r2, 4 + subs r0, r2 + lsls r0, 7 + adds r3, r0 + add r3, r12 + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r6, 0x1C] + adds r1, r2 + strh r1, [r3] +_081142DA: + add r5, r8 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + lsls r3, r4, 16 + asrs r1, r3, 16 + movs r2, 0x12 + ldrsh r0, [r6, r2] + cmp r1, r0 + ble _081142B8 +_081142EE: + movs r3, 0x1C + ldrsh r0, [r6, r3] + adds r0, 0x9F + lsls r2, r4, 16 + asrs r1, r2, 16 + subs r5, r0, r1 + movs r3, 0x16 + ldrsh r0, [r6, r3] + cmp r1, r0 + bge _08114366 + ldr r7, =0x02038c28 + ldr r4, =0x02039b28 +_08114306: + asrs r3, r2, 16 + cmp r3, 0 + blt _0811431E + lsls r2, r3, 1 + ldrb r1, [r4, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r7 + strh r5, [r2] + subs r5, 0x1 +_0811431E: + adds r0, r3, 0x1 + lsls r2, r0, 16 + asrs r1, r2, 16 + movs r3, 0x16 + ldrsh r0, [r6, r3] + cmp r1, r0 + blt _08114306 + b _08114366 + .pool +_08114338: + movs r1, 0x1C + ldrsh r0, [r6, r1] + adds r5, r0, 0 + adds r5, 0x9F + movs r4, 0 + ldr r3, =0x02038c28 + movs r2, 0xF0 + lsls r2, 3 + adds r6, r3, r2 +_0811434A: + lsls r0, r4, 16 + asrs r0, 16 + lsls r2, r0, 1 + adds r1, r2, r3 + strh r5, [r1] + adds r2, r6 + strh r5, [r2] + subs r5, 0x1 + adds r0, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, 0x6F + ble _0811434A +_08114366: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8114244 + + thumb_func_start sub_8114374 +sub_8114374: @ 8114374 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + movs r4, 0 + ldr r7, =0x02020630 + movs r1, 0x3 + ands r0, r1 + lsls r5, r0, 2 + movs r0, 0xD + negs r0, r0 + adds r6, r0, 0 +_0811438A: + lsls r0, r4, 24 + lsrs r0, 24 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _081143AA + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r0, [r1, 0x5] + ands r0, r6 + orrs r0, r5 + strb r0, [r1, 0x5] +_081143AA: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _0811438A + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8114374 + + thumb_func_start sub_81143C0 +sub_81143C0: @ 81143C0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r6, =0x02038436 + ldrb r0, [r6] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + eors r0, r1 + negs r1, r0 + orrs r1, r0 + lsrs r4, r1, 31 + ldrb r0, [r6] + adds r1, r4, 0 + movs r2, 0x1 + bl sub_80A438C + ldr r0, =0x02020630 + mov r9, r0 + ldr r0, =0x020241e4 + mov r8, r0 + ldrb r0, [r6] + add r0, r8 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r9 + adds r1, 0x3E + ldrb r2, [r1] + movs r7, 0x5 + negs r7, r7 + adds r0, r7, 0 + ands r0, r2 + strb r0, [r1] + ldrb r0, [r6] + movs r5, 0x2 + eors r0, r5 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0811444E + ldrb r0, [r6] + eors r0, r5 + movs r1, 0x1 + eors r4, r1 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_80A438C + ldrb r0, [r6] + eors r0, r5 + add r0, r8 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r2, [r0] + adds r1, r7, 0 + ands r1, r2 + strb r1, [r0] +_0811444E: + mov r0, r10 + bl move_anim_task_del + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81143C0 + + thumb_func_start sub_8114470 +sub_8114470: @ 8114470 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r4, =0x02038436 + ldrb r0, [r4] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + eors r0, r1 + negs r1, r0 + orrs r1, r0 + lsrs r5, r1, 31 + adds r0, r5, 0 + bl sub_80A477C + ldrb r1, [r4] + movs r0, 0x2 + eors r0, r1 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _081144AC + movs r0, 0x1 + eors r5, r0 + adds r0, r5, 0 + bl sub_80A477C +_081144AC: + adds r0, r6, 0 + bl move_anim_task_del + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8114470 + + thumb_func_start sub_81144BC +sub_81144BC: @ 81144BC + push {r4,lr} + adds r4, r0, 0 + ldr r1, =0x0203841e + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + ldrb r1, [r1, 0x4] + adds r0, r4, 0 + bl StartObjectImageAnim + ldr r0, =sub_80A67D8 + str r0, [r4, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81144BC + + thumb_func_start sub_81144F8 +sub_81144F8: @ 81144F8 + push {r4-r7,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r7, r0, 24 + movs r6, 0 + ldr r0, =0x02022e24 + strh r6, [r0] + ldr r0, =0x02022e26 + strh r6, [r0] + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + ldr r1, =0x00003f3d + movs r0, 0x4A + bl SetGpuReg + movs r1, 0x80 + lsls r1, 8 + movs r0, 0 + bl SetGpuRegBits + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x00000c08 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0811455C + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations +_0811455C: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _081145D6 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _081145D6 + ldr r4, =0x02038436 + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _0811458C + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + cmp r0, 0 + bne _081145D6 +_0811458C: + ldrb r0, [r4] + movs r5, 0x2 + eors r0, r5 + bl b_side_obj__get_some_boolean + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081145D6 + ldr r3, =0x02020630 + ldr r1, =0x020241e4 + ldrb r0, [r4] + eors r0, r5 + adds r0, r1 + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + ldrb r3, [r2, 0x5] + lsls r1, r3, 28 + lsrs r1, 30 + subs r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + movs r6, 0x1 +_081145D6: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08114614 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r5, [r0] + b _0811465C + .pool +_08114614: + ldr r4, =0x02038436 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08114640 + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + b _08114650 + .pool +_08114640: + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec +_08114650: + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 +_0811465C: + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x02038436 + ldrb r0, [r0] + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_80A89C8 + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, =gUnknown_08C1D210 + bl sub_80A6D48 + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, =gUnknown_08C1D0AC + mov r2, sp + ldrh r2, [r2, 0xA] + bl sub_80A6CC0 + ldr r0, =gUnknown_08C1D1E8 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl decompress_palette + ldr r2, =0x02022e18 + ldr r0, =0x02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x20] + negs r0, r0 + adds r0, 0x60 + strh r0, [r2] + ldr r2, =0x02022e1a + ldrh r0, [r1, 0x22] + negs r0, r0 + adds r0, 0x20 + strh r0, [r2] + ldrb r0, [r1, 0x5] + lsrs r0, 4 + adds r0, 0x10 + adds r1, r0, 0 + ldr r2, =0x0203841e + movs r3, 0x2 + ldrsh r0, [r2, r3] + cmp r0, 0 + bne _08114708 + adds r0, r1, 0 + movs r1, 0 + bl sub_80A750C + b _08114714 + .pool +_08114708: + lsls r0, r1, 4 + ldrh r3, [r2, 0x4] + movs r1, 0x10 + movs r2, 0xB + bl pal_fade_1 +_08114714: + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x8] + ldr r2, =0x0203841e + ldrh r1, [r2] + strh r1, [r0, 0xA] + ldrh r1, [r2, 0x2] + strh r1, [r0, 0xC] + ldrh r1, [r2, 0x4] + strh r1, [r0, 0xE] + strh r6, [r0, 0x14] + ldr r1, =sub_8114748 + str r1, [r0] + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81144F8 + + thumb_func_start sub_8114748 +sub_8114748: @ 8114748 + push {r4-r6,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x1C] + adds r0, 0x4 + movs r5, 0 + strh r0, [r4, 0x1C] + ldr r2, =0x02022e18 + ldrh r3, [r2] + subs r1, r3, 0x4 + strh r1, [r2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x80 + beq _08114776 + b _08114886 +_08114776: + strh r5, [r4, 0x1C] + adds r0, r3, 0 + adds r0, 0x7C + strh r0, [r2] + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + strh r0, [r4, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _08114824 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + ldr r5, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x5] + lsrs r0, 4 + adds r0, 0x10 + adds r1, r0, 0 + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _081147B8 + adds r0, r1, 0 + movs r1, 0x1 + bl sub_80A750C +_081147B8: + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + bl sub_80A6C68 + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _08114886 + ldr r2, =0x020241e4 + ldr r0, =0x02038436 + ldrb r1, [r0] + movs r0, 0x2 + eors r0, r1 + adds r0, r2 + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r5 + ldrb r3, [r2, 0x5] + lsls r1, r3, 28 + lsrs r1, 30 + adds r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + b _08114886 + .pool +_08114824: + cmp r0, 0x3 + bne _08114886 + ldr r0, =0x02022e24 + strh r5, [r0] + ldr r0, =0x02022e26 + strh r5, [r0] + ldr r4, =0x00003f3f + movs r0, 0x48 + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x4A + adds r1, r4, 0 + bl SetGpuReg + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08114856 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_08114856: + movs r0, 0 + bl GetGpuReg + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 8 + adds r0, r2, 0 + eors r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r6, 0 + bl move_anim_task_del +_08114886: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8114748 + + thumb_func_start sub_811489C +sub_811489C: @ 811489C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r0, =0x0203841e + movs r2, 0 + ldrsh r1, [r0, r2] + adds r2, r0, 0 + cmp r1, 0x7 + bhi _08114900 + lsls r0, r1, 2 + ldr r1, =_081148C4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081148C4: + .4byte _081148E4 + .4byte _081148E4 + .4byte _081148E4 + .4byte _081148E4 + .4byte _081148F0 + .4byte _081148F4 + .4byte _081148F8 + .4byte _081148FC +_081148E4: + ldrb r0, [r2] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r2, r0, 24 + b _08114902 +_081148F0: + movs r4, 0 + b _08114908 +_081148F4: + movs r4, 0x2 + b _08114908 +_081148F8: + movs r4, 0x1 + b _08114908 +_081148FC: + movs r4, 0x3 + b _08114908 +_08114900: + movs r2, 0xFF +_08114902: + movs r0, 0 + cmp r0, 0 + beq _0811492E +_08114908: + adds r0, r4, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0811492C + ldr r0, =0x020241e4 + adds r0, r4, r0 + ldrb r2, [r0] + b _0811492E + .pool +_0811492C: + movs r2, 0xFF +_0811492E: + cmp r2, 0xFF + beq _0811494A + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + adds r0, 0x10 + ldr r1, =0x0203841e + ldrb r1, [r1, 0x2] + bl sub_80A750C +_0811494A: + adds r0, r5, 0 + bl move_anim_task_del + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811489C + + thumb_func_start sub_8114960 +sub_8114960: @ 8114960 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =0x02038432 + ldrb r0, [r2] + cmp r0, 0x1 + bhi _08114974 + ldr r1, =0x0203841e + movs r0, 0 + strh r0, [r1, 0xE] +_08114974: + ldrb r0, [r2] + cmp r0, 0x2 + bne _08114980 + ldr r1, =0x0203841e + movs r0, 0x1 + strh r0, [r1, 0xE] +_08114980: + adds r0, r3, 0 + bl move_anim_task_del + pop {r0} + bx r0 + .pool + thumb_func_end sub_8114960 + + thumb_func_start sub_8114994 +sub_8114994: @ 8114994 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x02038436 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + movs r0, 0x14 + strh r0, [r4, 0x2E] + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x36] + ldr r0, =0x0000ffd8 + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl sub_80A68D4 + ldr r0, =sub_81149FC + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8114994 + + thumb_func_start sub_81149FC +sub_81149FC: @ 81149FC + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _08114A50 + ldrh r0, [r5, 0x24] + ldrh r1, [r5, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r5, 0x20] + ldrh r0, [r5, 0x26] + ldrh r2, [r5, 0x22] + adds r0, r2 + strh r0, [r5, 0x22] + strh r1, [r5, 0x26] + strh r1, [r5, 0x24] + movs r0, 0x14 + strh r0, [r5, 0x2E] + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + movs r0, 0x28 + strh r0, [r5, 0x38] + adds r0, r5, 0 + bl sub_80A68D4 + ldr r0, =sub_8114A60 + str r0, [r5, 0x1C] +_08114A50: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81149FC + + thumb_func_start sub_8114A60 +sub_8114A60: @ 8114A60 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _08114A74 + adds r0, r4, 0 + bl move_anim_8072740 +_08114A74: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8114A60 + + thumb_func_start sub_8114A7C +sub_8114A7C: @ 8114A7C + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x1 + bl sub_80A6980 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08114A9C + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_08114A9C: + ldr r4, =0x0203841e + ldrh r0, [r4, 0x8] + strh r0, [r6, 0x2E] + ldr r5, =0x02038437 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x4] + adds r0, r1 + strh r0, [r6, 0x32] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r4, [r4, 0x6] + adds r0, r4 + strh r0, [r6, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r6, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r6, 0 + bl oamt_set_x3A_32 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8114A7C + + thumb_func_start sub_8114AF0 +sub_8114AF0: @ 8114AF0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A60AC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A60AC + lsls r0, 24 + lsrs r7, r0, 24 + bl GenerateRandomNumber2 + movs r4, 0x1F + adds r5, r4, 0 + ands r5, r0 + bl GenerateRandomNumber2 + ands r4, r0 + adds r1, r5, 0 + cmp r1, 0x10 + ble _08114B38 + movs r0, 0x10 + subs r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 +_08114B38: + lsls r0, r4, 16 + asrs r1, r0, 16 + cmp r1, 0x10 + ble _08114B48 + movs r0, 0x10 + subs r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 +_08114B48: + ldr r0, =0x0203841e + ldrh r0, [r0, 0x4] + strh r0, [r6, 0x2E] + mov r1, r8 + adds r0, r1, r5 + strh r0, [r6, 0x32] + adds r0, r7, r4 + strh r0, [r6, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r6, 0x1C] + ldr r1, =move_anim_8074EE0 + adds r0, r6, 0 + bl oamt_set_x3A_32 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8114AF0 + + thumb_func_start sub_8114B80 +sub_8114B80: @ 8114B80 + push {r4-r6,lr} + adds r5, r0, 0 + ldrh r2, [r5, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x1 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + ldr r6, =0x0203841e + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _08114BF4 + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r2, [r6, 0x2] + adds r0, r2 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r3, [r6, 0x4] + adds r0, r3 + strh r0, [r5, 0x22] + movs r1, 0x2 + ldrsh r0, [r6, r1] + movs r2, 0x1 + negs r2, r2 + adds r1, r2, 0 + cmp r0, 0 + ble _08114BDA + movs r1, 0x1 +_08114BDA: + strh r1, [r5, 0x2E] + ldr r0, =sub_8114C10 + b _08114C02 + .pool +_08114BF4: + ldrh r0, [r6, 0x2] + strh r0, [r5, 0x20] + ldrh r0, [r6, 0x4] + strh r0, [r5, 0x22] + negs r0, r0 + strh r0, [r5, 0x26] + ldr r0, =sub_8114C4C +_08114C02: + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8114B80 + + thumb_func_start sub_8114C10 +sub_8114C10: @ 8114C10 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08114C2E + movs r0, 0 + strh r0, [r2, 0x30] + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x20] + adds r0, r1 + strh r0, [r2, 0x20] +_08114C2E: + ldrh r0, [r2, 0x22] + subs r0, 0x4 + strh r0, [r2, 0x22] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x4 + negs r1, r1 + cmp r0, r1 + bge _08114C46 + adds r0, r2, 0 + bl move_anim_8072740 +_08114C46: + pop {r0} + bx r0 + thumb_func_end sub_8114C10 + + thumb_func_start sub_8114C4C +sub_8114C4C: @ 8114C4C + push {lr} + adds r3, r0, 0 + movs r0, 0x2E + ldrsh r1, [r3, r0] + cmp r1, 0 + beq _08114C5E + cmp r1, 0x1 + beq _08114C74 + b _08114CB6 +_08114C5E: + ldrh r0, [r3, 0x26] + adds r0, 0x4 + strh r0, [r3, 0x26] + lsls r0, 16 + cmp r0, 0 + blt _08114CB6 + strh r1, [r3, 0x26] + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + b _08114CB6 +_08114C74: + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + cmp r0, 0 + ble _08114CB6 + movs r0, 0 + strh r0, [r3, 0x30] + movs r1, 0x3E + adds r1, r3 + mov r12, r1 + ldrb r2, [r1] + 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 + mov r1, r12 + strb r0, [r1] + ldrh r0, [r3, 0x32] + adds r0, 0x1 + strh r0, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _08114CB6 + adds r0, r3, 0 + bl move_anim_8072740 +_08114CB6: + pop {r0} + bx r0 + thumb_func_end sub_8114C4C + + thumb_func_start sub_8114CBC +sub_8114CBC: @ 8114CBC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r1, r0, r1 + ldr r0, =0x0203841e + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0 + bne _08114CE8 + ldr r0, =sub_8114CFC + b _08114CEA + .pool +_08114CE8: + ldr r0, =sub_8114EB4 +_08114CEA: + str r0, [r1] + ldr r1, [r1] + adds r0, r2, 0 + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8114CBC + + thumb_func_start sub_8114CFC +sub_8114CFC: @ 8114CFC + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bls _08114D16 + b _08114EAA +_08114D16: + lsls r0, 2 + ldr r1, =_08114D28 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08114D28: + .4byte _08114D3C + .4byte _08114DC4 + .4byte _08114DD4 + .4byte _08114E78 + .4byte _08114E8C +_08114D3C: + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x1C] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x1E] + cmp r0, 0x1 + bne _08114D70 + ldr r0, =0x02022e18 + ldrh r0, [r0] + strh r0, [r4, 0x20] + ldr r0, =0x02022e1a + b _08114D78 + .pool +_08114D70: + ldr r0, =0x02022e1c + ldrh r0, [r0] + strh r0, [r4, 0x20] + ldr r0, =0x02022e1e +_08114D78: + ldrh r0, [r0] + strh r0, [r4, 0x22] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl sub_80A6190 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + subs r1, 0x20 + strh r1, [r4, 0x24] + adds r0, 0x20 + strh r0, [r4, 0x26] + cmp r1, 0 + bge _08114D9A + movs r0, 0 + strh r0, [r4, 0x24] +_08114D9A: + ldr r2, =0x02020630 + movs r3, 0x1C + ldrsh r1, [r4, r3] + 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] + b _08114E7E + .pool +_08114DC4: + ldrb r0, [r4, 0x1E] + movs r2, 0x24 + ldrsh r1, [r4, r2] + movs r3, 0x26 + ldrsh r2, [r4, r3] + bl sub_81150E0 + b _08114E7E +_08114DD4: + ldrh r0, [r4, 0xC] + adds r0, 0x6 + movs r1, 0x7F + ands r0, r1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _08114DF6 + movs r0, 0 + strh r0, [r4, 0x10] + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] +_08114DF6: + ldr r1, =gUnknown_08329F40 + movs r2, 0xC + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 20 + ldrh r3, [r4, 0xE] + adds r2, r0, r3 + strh r2, [r4, 0x12] + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _08114E20 + ldr r1, =0x02022e1a + b _08114E22 + .pool +_08114E20: + ldr r1, =0x02022e1e +_08114E22: + ldrh r0, [r4, 0x22] + subs r0, r2 + strh r0, [r1] + movs r2, 0x12 + ldrsh r0, [r4, r2] + cmp r0, 0x3F + ble _08114EAA + ldrh r0, [r4, 0x24] + movs r1, 0x78 + subs r2, r1, r0 + strh r2, [r4, 0x12] + movs r3, 0x1E + ldrsh r0, [r4, r3] + cmp r0, 0x1 + bne _08114E4C + ldr r1, =0x02022e1a + b _08114E4E + .pool +_08114E4C: + ldr r1, =0x02022e1e +_08114E4E: + ldrh r0, [r4, 0x22] + subs r0, r2 + strh r0, [r1] + ldr r2, =0x02020630 + movs r1, 0x1C + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r2, [r1, 0x20] + movs r3, 0x88 + lsls r3, 1 + adds r0, r3, 0 + subs r0, r2 + strh r0, [r1, 0x24] + b _08114E7E + .pool +_08114E78: + ldr r1, =0x02039b28 + movs r0, 0x3 + strb r0, [r1, 0x15] +_08114E7E: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08114EAA + .pool +_08114E8C: + adds r0, r2, 0 + bl move_anim_task_del + ldr r2, =0x02020630 + movs r0, 0x1C + ldrsh r1, [r4, 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] +_08114EAA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8114CFC + + thumb_func_start sub_8114EB4 +sub_8114EB4: @ 8114EB4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r3, r1, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r3] + movs r4, 0 + strh r4, [r1, 0x24] + strh r4, [r1, 0x26] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08114F00 + ldr r0, =0x02022e1a + b _08114F02 + .pool +_08114F00: + ldr r0, =0x02022e1e +_08114F02: + strh r4, [r0] + adds r0, r5, 0 + bl move_anim_task_del + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8114EB4 + + thumb_func_start sub_8114F14 +sub_8114F14: @ 8114F14 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r1, r0, r1 + ldr r0, =0x0203841e + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0 + bne _08114F40 + ldr r0, =sub_8114F54 + b _08114F42 + .pool +_08114F40: + ldr r0, =sub_8114FD8 +_08114F42: + str r0, [r1] + ldr r1, [r1] + adds r0, r2, 0 + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8114F14 + + thumb_func_start sub_8114F54 +sub_8114F54: @ 8114F54 + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r5, [r4, r0] + cmp r5, 0 + beq _08114F78 + cmp r5, 0x1 + beq _08114FCC + b _08114FD2 + .pool +_08114F78: + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x1C] + ldr r3, =0x02020630 + movs r0, 0x1C + 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, 0x1C + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r5, [r0, 0x24] + movs r1, 0x1C + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r2, [r1, 0x22] + movs r0, 0xA0 + subs r0, r2 + strh r0, [r1, 0x26] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08114FD2 + .pool +_08114FCC: + adds r0, r2, 0 + bl move_anim_task_del +_08114FD2: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8114F54 + + thumb_func_start sub_8114FD8 +sub_8114FD8: @ 8114FD8 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bhi _081150DA + lsls r0, 2 + ldr r1, =_08115004 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08115004: + .4byte _08115018 + .4byte _0811506C + .4byte _0811507A + .4byte _08115094 + .4byte _081150D4 +_08115018: + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x1C] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x1E] + cmp r0, 0x1 + bne _08115044 + ldr r0, =0x02022e18 + b _08115046 + .pool +_08115044: + ldr r0, =0x02022e1c +_08115046: + ldrh r0, [r0] + strh r0, [r4, 0x20] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl sub_80A6190 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + subs r1, 0x20 + strh r1, [r4, 0x24] + adds r0, 0x20 + strh r0, [r4, 0x26] + b _081150C2 + .pool +_0811506C: + ldrb r0, [r4, 0x1E] + movs r1, 0x26 + ldrsh r2, [r4, r1] + movs r1, 0 + bl sub_81150E0 + b _081150C2 +_0811507A: + ldr r2, =0x02020630 + movs r0, 0x1C + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x60 + strh r1, [r0, 0x26] + b _081150C2 + .pool +_08115094: + ldr r2, =0x02020630 + movs r0, 0x1C + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + subs r1, 0x8 + strh r1, [r0, 0x26] + movs r0, 0x1C + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x26 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _081150DA + ldr r1, =0x02039b28 + movs r0, 0x3 + strb r0, [r1, 0x15] +_081150C2: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _081150DA + .pool +_081150D4: + adds r0, r2, 0 + bl move_anim_task_del +_081150DA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8114FD8 + + thumb_func_start sub_81150E0 +sub_81150E0: @ 81150E0 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r4, r2, 16 + cmp r0, 0x1 + bne _08115104 + ldr r0, =0x02022e18 + ldrh r3, [r0] + ldr r0, =0x04000014 + b _0811510A + .pool +_08115104: + ldr r0, =0x02022e1c + ldrh r3, [r0] + ldr r0, =0x04000018 +_0811510A: + str r0, [sp] + lsls r0, r1, 16 + cmp r0, 0 + bge _08115114 + movs r1, 0 +_08115114: + lsls r2, r1, 16 + lsls r0, r4, 16 + asrs r4, r0, 16 + cmp r2, r0 + bge _08115140 + ldr r5, =0x02038c28 + movs r0, 0xF0 + lsls r0, 3 + adds r6, r5, r0 +_08115126: + asrs r2, 16 + lsls r1, r2, 1 + adds r0, r1, r5 + strh r3, [r0] + adds r1, r6 + strh r3, [r1] + adds r2, 0x1 + lsls r2, 16 + lsrs r1, r2, 16 + lsls r2, r1, 16 + asrs r0, r2, 16 + cmp r0, r4 + blt _08115126 +_08115140: + lsls r1, 16 + asrs r0, r1, 16 + cmp r0, 0x9F + bgt _0811516E + ldr r4, =0x02038c28 + lsls r0, r3, 16 + asrs r0, 16 + adds r3, r0, 0 + adds r3, 0xF0 + movs r0, 0xF0 + lsls r0, 3 + adds r5, r4, r0 +_08115158: + asrs r2, r1, 16 + lsls r1, r2, 1 + adds r0, r1, r4 + strh r3, [r0] + adds r1, r5 + strh r3, [r1] + adds r2, 0x1 + lsls r1, r2, 16 + asrs r0, r1, 16 + cmp r0, 0x9F + ble _08115158 +_0811516E: + ldr r0, =0xa2600001 + str r0, [sp, 0x4] + mov r1, sp + movs r2, 0 + movs r0, 0x1 + strb r0, [r1, 0x8] + mov r0, sp + strb r2, [r0, 0x9] + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81150E0 + + thumb_func_start sub_81151A0 +sub_81151A0: @ 81151A0 + push {r4-r7,lr} + adds r5, r0, 0 + ldr r0, =0x0203841e + movs r2, 0 + ldrsh r1, [r0, r2] + adds r7, r0, 0 + cmp r1, 0 + bne _081151BC + ldr r0, =0x02038436 + b _081151BE + .pool +_081151BC: + ldr r0, =0x02038437 +_081151BE: + ldrb r4, [r0] + movs r6, 0x18 + adds r1, r7, 0 + movs r2, 0x2 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _081151DA + negs r0, r6 + lsls r0, 16 + lsrs r6, r0, 16 + movs r2, 0x4 + ldrsh r0, [r1, r2] + negs r0, r0 + strh r0, [r1, 0x4] +_081151DA: + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r6 + strh r0, [r5, 0x20] + adds r0, r4, 0 + bl sub_80A6190 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1E + strh r0, [r5, 0x22] + ldrh r1, [r7, 0xA] + strh r1, [r5, 0x2E] + ldrh r1, [r7, 0x4] + ldrh r2, [r5, 0x20] + adds r1, r2 + strh r1, [r5, 0x32] + ldrh r1, [r7, 0x6] + adds r0, r1 + strh r0, [r5, 0x36] + ldrh r0, [r7, 0x8] + strh r0, [r5, 0x38] + adds r0, r5, 0 + bl sub_80A68D4 + ldr r0, =sub_8115228 + str r0, [r5, 0x1C] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81151A0 + + thumb_func_start sub_8115228 +sub_8115228: @ 8115228 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _0811523C + adds r0, r4, 0 + bl move_anim_8072740 +_0811523C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8115228 + + thumb_func_start sub_8115244 +sub_8115244: @ 8115244 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08115260 + ldr r0, =0x02038436 + b _08115262 + .pool +_08115260: + ldr r0, =0x02038437 +_08115262: + ldrb r5, [r0] + adds r0, r5, 0 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x0000fff0 + adds r0, r2 + ldr r4, =0x0203841e + movs r3, 0x2 + ldrsh r1, [r4, r3] + lsls r1, 5 + adds r0, r1 + strh r0, [r6, 0x20] + adds r0, r5, 0 + bl sub_80A6190 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x20 + strh r0, [r6, 0x22] + ldrh r2, [r6, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + movs r3, 0x2 + ldrsh r0, [r4, r3] + lsls r0, 3 + adds r1, r0 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r6, 0x4] + ldr r1, =move_anim_8072740 + adds r0, r6, 0 + bl oamt_set_x3A_32 + ldrh r0, [r4, 0x4] + strh r0, [r6, 0x2E] + ldr r0, =sub_80A64B0 + str r0, [r6, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8115244 + + thumb_func_start sub_81152DC +sub_81152DC: @ 81152DC + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + ldr r0, =0x0203841e + ldrh r2, [r0, 0x2] + movs r3, 0x2 + ldrsh r1, [r0, r3] + adds r6, r0, 0 + cmp r1, 0 + beq _08115308 + adds r0, r2, 0x3 + b _08115314 + .pool +_08115308: + ldr r0, =0x02038408 + ldrh r0, [r0] + movs r1, 0xA + bl __udivsi3 + adds r0, 0x3 +_08115314: + strh r0, [r4, 0x26] + strh r0, [r4, 0x24] + adds r1, r6, 0 + ldrh r0, [r1, 0x4] + strh r0, [r4, 0xE] + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0x4 + beq _08115340 + cmp r0, 0x5 + bne _08115380 + ldr r0, =0x02022e20 + ldrh r0, [r0] + strh r0, [r4, 0x22] + ldr r0, =sub_81153AC + b _0811539E + .pool +_08115340: + movs r0, 0 + strh r0, [r4, 0x22] + movs r5, 0 +_08115346: + lsls r0, r5, 24 + lsrs r0, 24 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _08115370 + movs r3, 0x22 + ldrsh r0, [r4, r3] + adds r0, 0x9 + lsls r0, 1 + adds r1, r4, 0 + adds r1, 0x8 + adds r1, r0 + ldr r0, =0x020241e4 + adds r0, r5, r0 + ldrb r0, [r0] + strh r0, [r1] + ldrh r0, [r4, 0x22] + adds r0, 0x1 + strh r0, [r4, 0x22] +_08115370: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x3 + bls _08115346 + b _0811539C + .pool +_08115380: + ldrb r0, [r6] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x1A] + cmp r0, 0xFF + bne _08115398 + adds r0, r5, 0 + bl move_anim_task_del + b _081153A0 +_08115398: + movs r0, 0x1 + strh r0, [r4, 0x22] +_0811539C: + ldr r0, =sub_81154A4 +_0811539E: + str r0, [r4] +_081153A0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81152DC + + thumb_func_start sub_81153AC +sub_81153AC: @ 81153AC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r3, r0, r1 + movs r0, 0x8 + ldrsh r1, [r3, r0] + cmp r1, 0x1 + beq _08115430 + cmp r1, 0x1 + bgt _081153D4 + cmp r1, 0 + beq _081153DA + b _0811549C + .pool +_081153D4: + cmp r1, 0x2 + beq _08115490 + b _0811549C +_081153DA: + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0811549C + strh r1, [r3, 0xA] + ldrh r1, [r3, 0xC] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08115404 + ldr r1, =0x02022e20 + ldrh r0, [r3, 0x26] + ldrh r2, [r3, 0x22] + adds r0, r2 + strh r0, [r1] + b _0811540E + .pool +_08115404: + ldr r0, =0x02022e20 + ldrh r1, [r3, 0x22] + ldrh r2, [r3, 0x26] + subs r1, r2 + strh r1, [r0] +_0811540E: + ldrh r0, [r3, 0xC] + adds r0, 0x1 + strh r0, [r3, 0xC] + lsls r0, 16 + asrs r0, 16 + movs r2, 0xE + ldrsh r1, [r3, r2] + cmp r0, r1 + bne _0811549C + movs r0, 0 + strh r0, [r3, 0xC] + ldrh r0, [r3, 0x24] + subs r0, 0x1 + strh r0, [r3, 0x24] + b _08115484 + .pool +_08115430: + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0811549C + movs r0, 0 + strh r0, [r3, 0xA] + ldrh r0, [r3, 0xC] + ands r1, r0 + cmp r1, 0 + bne _0811545C + ldr r1, =0x02022e20 + ldrh r0, [r3, 0x24] + ldrh r2, [r3, 0x22] + adds r0, r2 + strh r0, [r1] + b _08115466 + .pool +_0811545C: + ldr r0, =0x02022e20 + ldrh r1, [r3, 0x22] + ldrh r2, [r3, 0x24] + subs r1, r2 + strh r1, [r0] +_08115466: + ldrh r0, [r3, 0xC] + adds r0, 0x1 + strh r0, [r3, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _0811549C + movs r0, 0 + strh r0, [r3, 0xC] + ldrh r0, [r3, 0x24] + subs r0, 0x1 + strh r0, [r3, 0x24] + lsls r0, 16 + cmp r0, 0 + bne _0811549C +_08115484: + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] + b _0811549C + .pool +_08115490: + ldr r1, =0x02022e20 + ldrh r0, [r3, 0x22] + strh r0, [r1] + adds r0, r2, 0 + bl move_anim_task_del +_0811549C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81153AC + + thumb_func_start sub_81154A4 +sub_81154A4: @ 81154A4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r5, [r4, r0] + cmp r5, 0x1 + beq _08115504 + cmp r5, 0x1 + bgt _081154CC + cmp r5, 0 + beq _081154D2 + b _0811557E + .pool +_081154CC: + cmp r5, 0x2 + beq _08115540 + b _0811557E +_081154D2: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0811557E + strh r5, [r4, 0xA] + adds r0, r4, 0 + bl sub_8115588 + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + movs r2, 0xE + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _0811557E + strh r5, [r4, 0xC] + ldrh r0, [r4, 0x24] + subs r0, 0x1 + strh r0, [r4, 0x24] + b _08115538 +_08115504: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + movs r5, 0 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0811557E + strh r5, [r4, 0xA] + adds r0, r4, 0 + bl sub_8115588 + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _0811557E + strh r5, [r4, 0xC] + ldrh r0, [r4, 0x24] + subs r0, 0x1 + strh r0, [r4, 0x24] + lsls r0, 16 + cmp r0, 0 + bne _0811557E +_08115538: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0811557E +_08115540: + movs r2, 0 + movs r7, 0x22 + ldrsh r0, [r4, r7] + cmp r2, r0 + bge _08115578 + ldr r0, =0x02020630 + mov r12, r0 + adds r5, r4, 0 + adds r5, 0x8 + movs r6, 0 +_08115554: + adds r0, r2, 0 + adds r0, 0x9 + lsls r0, 1 + adds r0, r5, r0 + movs r7, 0 + ldrsh r1, [r0, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r12 + strh r6, [r0, 0x24] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0x22 + ldrsh r0, [r4, r1] + cmp r2, r0 + blt _08115554 +_08115578: + adds r0, r3, 0 + bl move_anim_task_del +_0811557E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81154A4 + + thumb_func_start sub_8115588 +sub_8115588: @ 8115588 + push {r4-r7,lr} + adds r3, r0, 0 + ldrh r1, [r3, 0xC] + movs r4, 0x1 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _081155B0 + movs r0, 0x24 + ldrsh r1, [r3, r0] + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + ldrh r2, [r3, 0x24] + adds r0, r4, 0 + ands r0, r2 + adds r1, r0 + lsls r1, 16 + lsrs r4, r1, 16 + b _081155C0 +_081155B0: + movs r1, 0x24 + ldrsh r0, [r3, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + negs r0, r0 + lsls r0, 16 + lsrs r4, r0, 16 +_081155C0: + movs r2, 0 + movs r7, 0x22 + ldrsh r0, [r3, r7] + cmp r2, r0 + bge _081155F4 + ldr r6, =0x02020630 + adds r5, r3, 0 + adds r5, 0x8 +_081155D0: + adds r0, r2, 0 + adds r0, 0x9 + lsls r0, 1 + adds r0, r5, r0 + movs r7, 0 + ldrsh r1, [r0, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r4, [r0, 0x24] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0x22 + ldrsh r0, [r3, r1] + cmp r2, r0 + blt _081155D0 +_081155F4: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8115588 + + thumb_func_start sub_8115600 +sub_8115600: @ 8115600 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + ldr r3, =0x0203841e + movs r2, 0 + ldr r0, =0x02038408 + ldrh r0, [r0] + cmp r0, 0x63 + bls _08115614 + movs r2, 0x1 +_08115614: + strh r2, [r3, 0x1E] + adds r0, r1, 0 + bl move_anim_task_del + pop {r0} + bx r0 + .pool + thumb_func_end sub_8115600 + + thumb_func_start sub_8115628 +sub_8115628: @ 8115628 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, =0x0203841e + ldrh r1, [r2] + movs r0, 0x1 + ands r0, r1 + adds r6, r2, 0 + cmp r0, 0 + beq _08115648 + ldr r0, =0x02038437 + b _0811564A + .pool +_08115648: + ldr r0, =0x02038436 +_0811564A: + ldrb r0, [r0] + adds r5, r0, 0 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0x1 + ble _0811565A + movs r0, 0x2 + eors r5, r0 +_0811565A: + ldr r0, =sub_81156D0 + ldrb r1, [r6, 0x2] + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + adds r0, r5, 0 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x20 + subs r1, r0 + ldr r2, =0x000001ff + adds r0, r2, 0 + ands r1, r0 + strh r1, [r4, 0xA] + adds r0, r5, 0 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x40 + subs r1, r0 + movs r0, 0xFF + ands r1, r0 + strh r1, [r4, 0xC] + ldr r2, =0x02022e20 + ldrh r0, [r4, 0xA] + strh r0, [r2] + ldr r0, =0x02022e22 + strh r1, [r0] + ldrh r0, [r6, 0x4] + strh r0, [r4, 0xE] + adds r0, r7, 0 + bl move_anim_task_del + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8115628 + + thumb_func_start sub_81156D0 +sub_81156D0: @ 81156D0 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r2, r0, r1 + ldr r0, =0x0203841e + movs r4, 0xE + ldrsh r1, [r0, r4] + movs r4, 0xE + ldrsh r0, [r2, r4] + cmp r1, r0 + bne _08115710 + ldr r0, =0x02022e20 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e22 + strh r1, [r0] + adds r0, r3, 0 + bl DestroyTask + b _0811571C + .pool +_08115710: + ldr r1, =0x02022e20 + ldrh r0, [r2, 0xA] + strh r0, [r1] + ldr r1, =0x02022e22 + ldrh r0, [r2, 0xC] + strh r0, [r1] +_0811571C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81156D0 + + thumb_func_start sub_811572C +sub_811572C: @ 811572C + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x0203841e + ldrh r0, [r5] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x2E] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _0811576C + ldrh r0, [r5, 0x6] + negs r0, r0 + strh r0, [r4, 0x30] + movs r0, 0x1 + strh r0, [r4, 0x36] + b _0811577A + .pool +_0811576C: + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x30] + strh r1, [r4, 0x36] + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnim +_0811577A: + ldr r0, =0x0203841e + ldrh r0, [r0, 0x8] + strh r0, [r4, 0x34] + ldr r1, =sub_8115798 + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811572C + + thumb_func_start sub_8115798 +sub_8115798: @ 8115798 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x1E + bl cosine + strh r0, [r4, 0x24] + movs r2, 0x2E + ldrsh r0, [r4, r2] + movs r1, 0xA + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x2E] + cmp r0, 0x7F + bhi _081157CA + ldrb r0, [r4, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r0 + movs r0, 0x4 + orrs r1, r0 + strb r1, [r4, 0x5] + b _081157D2 +_081157CA: + ldrb r0, [r4, 0x5] + movs r1, 0xC + orrs r0, r1 + strb r0, [r4, 0x5] +_081157D2: + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x2E] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x34 + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _081157F6 + adds r0, r4, 0 + bl move_anim_8072740 +_081157F6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8115798 + + thumb_func_start sub_81157FC +sub_81157FC: @ 81157FC + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + ldr r4, =0x0203841e + movs r1, 0 + ldrsh r0, [r4, r1] + bl sub_811583C + movs r1, 0x2 + ldrsb r1, [r4, r1] + ldrb r2, [r4, 0x4] + ldrb r3, [r4, 0x6] + ldrh r4, [r4, 0x8] + str r4, [sp] + bl pal_fade_maybe + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_8115884 + str r0, [r5, 0x1C] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81157FC + + thumb_func_start sub_811583C +sub_811583C: @ 811583C + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + lsls r0, 16 + lsrs r0, 16 + movs r4, 0x1 + mov r8, r0 + mov r1, r8 + ands r1, r4 + mov r8, r1 + lsls r0, 16 + asrs r1, r0, 17 + ands r1, r4 + asrs r2, r0, 18 + ands r2, r4 + asrs r3, r0, 19 + ands r3, r4 + asrs r6, r0, 20 + ands r6, r4 + asrs r5, r0, 21 + ands r5, r4 + asrs r0, 22 + ands r0, r4 + str r6, [sp] + str r5, [sp, 0x4] + str r0, [sp, 0x8] + mov r0, r8 + bl sub_80A75AC + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_811583C + + thumb_func_start sub_8115884 +sub_8115884: @ 8115884 + push {lr} + adds r2, r0, 0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0811589A + adds r0, r2, 0 + bl move_anim_8072740 +_0811589A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8115884 + + thumb_func_start sub_81158A4 +sub_81158A4: @ 81158A4 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x0203841e + ldrh r0, [r4, 0x2] + strh r0, [r5, 0x2E] + strh r0, [r5, 0x30] + ldrh r0, [r4, 0x4] + strh r0, [r5, 0x32] + ldrh r0, [r4, 0x6] + strh r0, [r5, 0x34] + ldrh r0, [r4, 0x8] + strh r0, [r5, 0x36] + ldrh r0, [r4, 0xA] + strh r0, [r5, 0x38] + ldrh r0, [r4, 0xC] + strh r0, [r5, 0x3A] + ldrh r0, [r4] + strh r0, [r5, 0x3C] + movs r1, 0x3C + ldrsh r0, [r5, r1] + bl sub_811583C + ldrb r1, [r4, 0x8] + ldrh r2, [r4, 0x6] + bl sub_80A2A20 + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_81158F8 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81158A4 + + thumb_func_start sub_81158F8 +sub_81158F8: @ 81158F8 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _0811590C + subs r0, r1, 0x1 + strh r0, [r4, 0x2E] + b _0811597C +_0811590C: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0811597C + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08115930 + ldr r0, =sub_8115984 + str r0, [r4, 0x1C] + b _0811597C + .pool +_08115930: + movs r2, 0x3C + ldrsh r0, [r4, r2] + bl sub_811583C + adds r3, r0, 0 + ldrh r1, [r4, 0x30] + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _08115956 + ldrh r1, [r4, 0x36] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r4, 0x34] + adds r0, r3, 0 + bl sub_80A2A20 + b _08115964 +_08115956: + ldrh r1, [r4, 0x3A] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r4, 0x38] + adds r0, r3, 0 + bl sub_80A2A20 +_08115964: + ldrh r0, [r4, 0x30] + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + eors r0, r1 + strh r0, [r4, 0x30] + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x32] + subs r0, 0x1 + strh r0, [r4, 0x32] +_0811597C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81158F8 + + thumb_func_start sub_8115984 +sub_8115984: @ 8115984 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081159AA + movs r1, 0x3C + ldrsh r0, [r4, r1] + bl sub_811583C + movs r1, 0 + movs r2, 0 + bl sub_80A2A20 + adds r0, r4, 0 + bl move_anim_8072740 +_081159AA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8115984 + + thumb_func_start sub_81159B4 +sub_81159B4: @ 81159B4 + push {r4,lr} + adds r4, r0, 0 + ldr r1, =0x0203841e + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + movs r2, 0 + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + strh r2, [r4, 0x2E] + movs r0, 0xA + strh r0, [r4, 0x30] + movs r0, 0x8 + strh r0, [r4, 0x32] + movs r0, 0x28 + strh r0, [r4, 0x34] + movs r0, 0x70 + strh r0, [r4, 0x36] + strh r2, [r4, 0x38] + ldr r1, =move_anim_8074EE0 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r1, =sub_80A634C + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81159B4 + + thumb_func_start sub_8115A04 +sub_8115A04: @ 8115A04 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldr r3, =0x0203841e + ldrh r1, [r3] + movs r5, 0 + strh r1, [r4, 0x8] + ldrh r1, [r3, 0x2] + strh r1, [r4, 0xA] + ldrh r1, [r3, 0x4] + strh r1, [r4, 0xC] + ldrh r1, [r3, 0x6] + strh r1, [r4, 0xE] + ldrh r2, [r3, 0x8] + strh r2, [r4, 0x10] + ldrh r1, [r3, 0xA] + strh r1, [r4, 0x12] + strh r5, [r4, 0x18] + lsls r2, 24 + lsrs r2, 24 + movs r1, 0 + bl sub_8115A54 + ldr r0, =sub_8115AA4 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8115A04 + + thumb_func_start sub_8115A54 +sub_8115A54: @ 8115A54 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + bl sub_811583C + movs r1, 0xA + ldrsb r1, [r4, r1] + ldrh r2, [r4, 0x12] + str r2, [sp] + adds r2, r5, 0 + adds r3, r6, 0 + bl pal_fade_maybe + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x18] + movs r1, 0x1 + eors r0, r1 + strh r0, [r4, 0x18] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8115A54 + + thumb_func_start sub_8115AA4 +sub_8115AA4: @ 8115AA4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + adds r4, r3, 0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08115B06 + ldr r1, =0x03005e00 + lsls r2, r3, 2 + adds r0, r2, r3 + lsls r0, 3 + adds r3, r0, r1 + movs r5, 0xC + ldrsh r0, [r3, r5] + adds r6, r1, 0 + adds r5, r2, 0 + cmp r0, 0 + ble _08115B00 + movs r1, 0x18 + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _08115AE4 + ldrb r1, [r3, 0xE] + ldrb r2, [r3, 0x10] + b _08115AE8 + .pool +_08115AE4: + ldrb r1, [r3, 0x10] + ldrb r2, [r3, 0xE] +_08115AE8: + adds r0, r5, r4 + lsls r0, 3 + adds r0, r6 + movs r3, 0xC + ldrsh r0, [r0, r3] + cmp r0, 0x1 + bne _08115AF8 + movs r2, 0 +_08115AF8: + adds r0, r4, 0 + bl sub_8115A54 + b _08115B06 +_08115B00: + adds r0, r4, 0 + bl move_anim_task_del +_08115B06: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8115AA4 + + thumb_func_start sub_8115B0C +sub_8115B0C: @ 8115B0C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + ldr r3, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r3 + ldr r2, =0x0203841e + ldrh r1, [r2] + strh r1, [r0, 0x8] + ldrh r1, [r2, 0x2] + strh r1, [r0, 0xA] + ldrh r1, [r2, 0x4] + strh r1, [r0, 0xC] + ldrh r1, [r2, 0x6] + strh r1, [r0, 0xE] + ldrh r1, [r2, 0x8] + strh r1, [r0, 0x10] + ldrh r1, [r2, 0xA] + strh r1, [r0, 0x12] + strh r5, [r0, 0x18] + movs r4, 0 + ldr r0, =0x0202406c + ldrb r1, [r0] + mov r9, r3 + mov r8, r2 + cmp r5, r1 + bge _08115B74 + ldr r0, =0x02038436 + ldrb r3, [r0] + ldr r7, =0x02038437 + movs r0, 0x1 + mov r12, r0 + adds r2, r1, 0 +_08115B5A: + cmp r4, r3 + beq _08115B6E + ldrb r1, [r7] + cmp r4, r1 + beq _08115B6E + adds r1, r4, 0 + adds r1, 0x10 + mov r0, r12 + lsls r0, r1 + orrs r5, r0 +_08115B6E: + adds r4, 0x1 + cmp r4, r2 + blt _08115B5A +_08115B74: + mov r2, r8 + movs r1, 0 + ldrsh r0, [r2, r1] + cmp r0, 0x1 + bne _08115B82 + movs r0, 0xE + orrs r5, r0 +_08115B82: + lsls r4, r6, 2 + adds r4, r6 + lsls r4, 3 + add r4, r9 + lsrs r0, r5, 16 + strh r0, [r4, 0x1A] + movs r0, 0xFF + ands r5, r0 + strh r5, [r4, 0x1C] + ldrb r2, [r4, 0x10] + adds r0, r6, 0 + movs r1, 0 + bl sub_8115BC8 + ldr r0, =sub_8115C18 + str r0, [r4] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8115B0C + + thumb_func_start sub_8115BC8 +sub_8115BC8: @ 8115BC8 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r1, 0 + adds r3, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldrh r0, [r4, 0x1A] + lsls r0, 16 + ldrh r1, [r4, 0x1C] + orrs r0, r1 + movs r1, 0xA + ldrsb r1, [r4, r1] + ldrh r2, [r4, 0x12] + str r2, [sp] + adds r2, r5, 0 + bl pal_fade_maybe + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x18] + movs r1, 0x1 + eors r0, r1 + strh r0, [r4, 0x18] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8115BC8 + + thumb_func_start sub_8115C18 +sub_8115C18: @ 8115C18 + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + adds r4, r3, 0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08115C7A + ldr r1, =0x03005e00 + lsls r2, r3, 2 + adds r0, r2, r3 + lsls r0, 3 + adds r3, r0, r1 + movs r5, 0xC + ldrsh r0, [r3, r5] + adds r6, r1, 0 + adds r5, r2, 0 + cmp r0, 0 + ble _08115C74 + movs r1, 0x18 + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _08115C58 + ldrb r1, [r3, 0xE] + ldrb r2, [r3, 0x10] + b _08115C5C + .pool +_08115C58: + ldrb r1, [r3, 0x10] + ldrb r2, [r3, 0xE] +_08115C5C: + adds r0, r5, r4 + lsls r0, 3 + adds r0, r6 + movs r3, 0xC + ldrsh r0, [r0, r3] + cmp r0, 0x1 + bne _08115C6C + movs r2, 0 +_08115C6C: + adds r0, r4, 0 + bl sub_8115BC8 + b _08115C7A +_08115C74: + adds r0, r4, 0 + bl move_anim_task_del +_08115C7A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8115C18 + + thumb_func_start sub_8115C80 +sub_8115C80: @ 8115C80 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldr r3, =0x0203841e + ldrh r1, [r3] + movs r5, 0 + strh r1, [r4, 0x8] + ldrh r1, [r3, 0x2] + strh r1, [r4, 0xA] + ldrh r1, [r3, 0x4] + strh r1, [r4, 0xC] + ldrh r1, [r3, 0x6] + strh r1, [r4, 0xE] + ldrh r2, [r3, 0x8] + strh r2, [r4, 0x10] + ldrh r1, [r3, 0xA] + strh r1, [r4, 0x12] + strh r5, [r4, 0x18] + lsls r2, 24 + lsrs r2, 24 + movs r1, 0 + bl sub_8115CD0 + ldr r0, =sub_8115D2C + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8115C80 + + thumb_func_start sub_8115CD0 +sub_8115CD0: @ 8115CD0 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldrh r0, [r4, 0x8] + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x10 + movs r2, 0x1 + lsls r2, r0 + movs r1, 0xA + ldrsb r1, [r4, r1] + ldrh r0, [r4, 0x12] + str r0, [sp] + adds r0, r2, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl pal_fade_maybe + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x18] + movs r1, 0x1 + eors r0, r1 + strh r0, [r4, 0x18] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8115CD0 + + thumb_func_start sub_8115D2C +sub_8115D2C: @ 8115D2C + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + adds r4, r3, 0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08115D8E + ldr r1, =0x03005e00 + lsls r2, r3, 2 + adds r0, r2, r3 + lsls r0, 3 + adds r3, r0, r1 + movs r5, 0xC + ldrsh r0, [r3, r5] + adds r6, r1, 0 + adds r5, r2, 0 + cmp r0, 0 + ble _08115D88 + movs r1, 0x18 + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _08115D6C + ldrb r1, [r3, 0xE] + ldrb r2, [r3, 0x10] + b _08115D70 + .pool +_08115D6C: + ldrb r1, [r3, 0x10] + ldrb r2, [r3, 0xE] +_08115D70: + adds r0, r5, r4 + lsls r0, 3 + adds r0, r6 + movs r3, 0xC + ldrsh r0, [r0, r3] + cmp r0, 0x1 + bne _08115D80 + movs r2, 0 +_08115D80: + adds r0, r4, 0 + bl sub_8115CD0 + b _08115D8E +_08115D88: + adds r0, r4, 0 + bl move_anim_task_del +_08115D8E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8115D2C + + thumb_func_start sub_8115D94 +sub_8115D94: @ 8115D94 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldr r5, =0x0203841e + ldrh r0, [r5, 0x2] + strh r0, [r4, 0x8] + ldrh r0, [r5, 0x2] + strh r0, [r4, 0xA] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0xC] + ldrh r0, [r5, 0x6] + strh r0, [r4, 0xE] + ldrh r0, [r5, 0x8] + strh r0, [r4, 0x10] + ldrh r0, [r5, 0xA] + strh r0, [r4, 0x12] + ldrh r0, [r5, 0xC] + strh r0, [r4, 0x14] + ldrh r0, [r5] + strh r0, [r4, 0x16] + ldrh r0, [r5] + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x10 + movs r1, 0x1 + lsls r1, r0 + ldrb r3, [r5, 0x8] + ldrh r0, [r5, 0x6] + str r0, [sp] + adds r0, r1, 0 + movs r1, 0 + adds r2, r3, 0 + bl pal_fade_maybe + ldr r0, =sub_8115E00 + str r0, [r4] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8115D94 + + thumb_func_start sub_8115E00 +sub_8115E00: @ 8115E00 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r1, [r4, 0x8] + movs r2, 0x8 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _08115E28 + subs r0, r1, 0x1 + strh r0, [r4, 0x8] + b _08115EAC + .pool +_08115E28: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08115EAC + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0 + bne _08115E4C + ldr r0, =sub_8115EB8 + str r0, [r4] + b _08115EAC + .pool +_08115E4C: + ldrh r0, [r4, 0x16] + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x10 + movs r2, 0x1 + lsls r2, r0 + ldrh r1, [r4, 0xA] + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _08115E7A + ldrb r3, [r4, 0x10] + ldrh r0, [r4, 0xE] + str r0, [sp] + adds r0, r2, 0 + movs r1, 0 + adds r2, r3, 0 + bl pal_fade_maybe + b _08115E8A +_08115E7A: + ldrb r3, [r4, 0x14] + ldrh r0, [r4, 0x12] + str r0, [sp] + adds r0, r2, 0 + movs r1, 0 + adds r2, r3, 0 + bl pal_fade_maybe +_08115E8A: + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0xA] + movs r3, 0x80 + lsls r3, 1 + adds r2, r3, 0 + eors r0, r2 + strh r0, [r1, 0xA] + movs r2, 0xFF + ands r0, r2 + strh r0, [r1, 0x8] + ldrh r0, [r1, 0xC] + subs r0, 0x1 + strh r0, [r1, 0xC] +_08115EAC: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8115E00 + + thumb_func_start sub_8115EB8 +sub_8115EB8: @ 8115EB8 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _08115EFE + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x16] + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x10 + movs r1, 0x1 + lsls r1, r0 + str r5, [sp] + adds r0, r1, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl pal_fade_maybe + adds r0, r4, 0 + bl move_anim_task_del +_08115EFE: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8115EB8 + + thumb_func_start sub_8115F10 +sub_8115F10: @ 8115F10 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r2, 0 + ldr r0, =0x02038436 + ldrb r6, [r0] + ldr r0, =0x02038437 + ldrb r7, [r0] + ldr r4, =0x0203841e + ldrh r1, [r4] + movs r5, 0x80 + lsls r5, 1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08115F4A + str r2, [sp] + str r2, [sp, 0x4] + str r2, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r3, 0 + bl sub_80A75AC + adds r2, r0, 0 +_08115F4A: + ldrh r1, [r4, 0x2] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08115F5C + movs r0, 0x80 + lsls r0, 9 + lsls r0, r6 + orrs r2, r0 +_08115F5C: + ldrh r1, [r4, 0x4] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08115F6E + movs r0, 0x80 + lsls r0, 9 + lsls r0, r7 + orrs r2, r0 +_08115F6E: + adds r0, r2, 0 + bl sub_80A2218 + mov r0, r8 + bl move_anim_task_del + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8115F10 + + thumb_func_start sub_8115F94 +sub_8115F94: @ 8115F94 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + ldr r1, =0x03005e00 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08115FD6 + ldr r1, =0x0203841e + ldrh r0, [r1] + strh r0, [r4, 0xC] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0xE] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x10] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0xA] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x12] + ldrh r0, [r1, 0xA] + strh r0, [r4, 0x14] + ldrh r0, [r1, 0xC] + strh r0, [r4, 0x16] +_08115FD6: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldr r0, =0x02038436 + ldrb r0, [r0] + mov r9, r0 + ldr r0, =0x02038437 + ldrb r0, [r0] + mov r10, r0 + ldrh r1, [r4, 0xC] + movs r7, 0x80 + lsls r7, 1 + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08115FF8 + ldr r5, =0x0000ffff +_08115FF8: + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08116028 + ldr r2, =0x02020630 + ldr r0, =0x03005d70 + add r0, r9 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x14 + adds r0, r2 + ldr r0, [r0] + ldrh r0, [r0, 0x2] + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + adds r1, r6, 0 + lsls r1, r0 + lsls r1, 16 + orrs r5, r1 +_08116028: + ldrh r1, [r4, 0xE] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _0811603C + adds r0, r6, 0 + mov r2, r9 + lsls r0, r2 + lsls r0, 16 + orrs r5, r0 +_0811603C: + ldrh r1, [r4, 0x10] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08116050 + adds r0, r6, 0 + mov r1, r10 + lsls r0, r1 + lsls r0, 16 + orrs r5, r0 +_08116050: + movs r1, 0x12 + ldrsb r1, [r4, r1] + movs r2, 0x14 + ldrsb r2, [r4, r2] + movs r3, 0x16 + ldrsb r3, [r4, r3] + adds r0, r5, 0 + bl sub_80A2260 + movs r2, 0x8 + ldrsh r1, [r4, r2] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _0811607A + adds r0, r5, 0 + bl sub_80A2334 + mov r0, r8 + bl move_anim_task_del +_0811607A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8115F94 + + thumb_func_start sub_81160A4 +sub_81160A4: @ 81160A4 + push {r4,lr} + adds r4, r0, 0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x0203841e + ldrh r0, [r1] + negs r0, r0 + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x30] + strh r0, [r4, 0x32] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x34] + movs r2, 0x6 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + beq _081160EC + cmp r0, 0x1 + bgt _081160DC + cmp r0, 0 + beq _081160E2 + b _08116104 + .pool +_081160DC: + cmp r0, 0x2 + beq _081160F4 + b _08116104 +_081160E2: + ldr r1, =0x02022e20 + b _081160F6 + .pool +_081160EC: + ldr r1, =0x02022e22 + b _081160F6 + .pool +_081160F4: + ldr r1, =0x02021bbc +_081160F6: + adds r0, r4, 0 + bl oamt_set_x3A_32 + b _0811610C + .pool +_08116104: + ldr r1, =0x02021bbe + adds r0, r4, 0 + bl oamt_set_x3A_32 +_0811610C: + movs r0, 0x3A + ldrsh r1, [r4, r0] + movs r2, 0x3C + ldrsh r0, [r4, r2] + lsls r0, 16 + orrs r1, r0 + ldrh r0, [r1] + strh r0, [r4, 0x36] + ldr r0, =0x0203841e + ldrh r0, [r0, 0x6] + strh r0, [r4, 0x38] + subs r0, 0x2 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _08116130 + bl sub_81161F4 +_08116130: + ldr r0, =sub_8116148 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81160A4 + + thumb_func_start sub_8116148 +sub_8116148: @ 8116148 + push {r4-r7,lr} + adds r3, r0, 0 + ldrh r1, [r3, 0x34] + movs r2, 0x34 + ldrsh r0, [r3, r2] + cmp r0, 0 + ble _0811618A + subs r0, r1, 0x1 + strh r0, [r3, 0x34] + ldrh r1, [r3, 0x30] + movs r2, 0x30 + ldrsh r0, [r3, r2] + cmp r0, 0 + ble _0811616A + subs r0, r1, 0x1 + strh r0, [r3, 0x30] + b _081161E2 +_0811616A: + ldrh r0, [r3, 0x32] + strh r0, [r3, 0x30] + movs r0, 0x3A + ldrsh r1, [r3, r0] + movs r2, 0x3C + ldrsh r0, [r3, r2] + lsls r0, 16 + orrs r1, r0 + ldrh r0, [r3, 0x2E] + ldrh r2, [r1] + adds r0, r2 + strh r0, [r1] + ldrh r0, [r3, 0x2E] + negs r0, r0 + strh r0, [r3, 0x2E] + b _081161E2 +_0811618A: + movs r0, 0x3A + ldrsh r1, [r3, r0] + movs r2, 0x3C + ldrsh r0, [r3, r2] + lsls r0, 16 + orrs r1, r0 + ldrh r0, [r3, 0x36] + strh r0, [r1] + ldrh r0, [r3, 0x38] + subs r0, 0x2 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _081161DC + movs r4, 0 + ldr r5, =0x0202406c + ldrb r0, [r5] + cmp r4, r0 + bcs _081161DC + ldr r2, =0x02020630 + mov r12, r2 + ldr r6, =0x020241e4 + movs r7, 0x3 + negs r7, r7 +_081161BA: + adds r0, r4, r6 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r12 + adds r1, 0x3E + ldrb r2, [r1] + adds r0, r7, 0 + ands r0, r2 + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r0, [r5] + cmp r4, r0 + bcc _081161BA +_081161DC: + adds r0, r3, 0 + bl move_anim_8072740 +_081161E2: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8116148 + + thumb_func_start sub_81161F4 +sub_81161F4: @ 81161F4 + push {r4-r6,lr} + ldr r6, =0x02020630 + ldr r4, =0x020241e4 + ldr r5, =0x02038436 + ldrb r0, [r5] + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x3 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + ldr r3, =0x02038437 + ldrb r0, [r3] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + ldr r0, =0x0203841e + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0x2 + bne _0811627C + ldrb r0, [r5] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0] + ldrb r0, [r3] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + b _08116298 + .pool +_0811627C: + cmp r0, 0 + bne _08116284 + ldrb r0, [r5] + b _08116286 +_08116284: + ldrb r0, [r3] +_08116286: + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x2 +_08116298: + orrs r1, r2 + strb r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81161F4 + + thumb_func_start sub_81162A4 +sub_81162A4: @ 81162A4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r1 + ldr r3, =0x0203841e + ldrh r1, [r3] + strh r1, [r2, 0x8] + ldrh r1, [r3, 0x2] + strh r1, [r2, 0xA] + ldrh r1, [r3, 0x4] + strh r1, [r2, 0xC] + ldrh r1, [r3, 0x6] + strh r1, [r2, 0xE] + ldrh r1, [r3, 0x6] + strh r1, [r2, 0x18] + ldr r4, =0x02022e20 + ldrh r1, [r3] + strh r1, [r4] + ldr r4, =0x02022e22 + ldrh r1, [r3, 0x2] + strh r1, [r4] + ldr r1, =sub_81162F8 + str r1, [r2] + bl _call_via_r1 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81162A4 + + thumb_func_start sub_81162F8 +sub_81162F8: @ 81162F8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r3, r0, r1 + ldrh r2, [r3, 0xE] + movs r4, 0xE + ldrsh r0, [r3, r4] + mov r12, r1 + cmp r0, 0 + bne _0811637E + ldr r0, =0x02022e20 + ldrh r2, [r0] + movs r7, 0x8 + ldrsh r1, [r3, r7] + adds r6, r0, 0 + cmp r2, r1 + bne _08116330 + ldrh r0, [r3, 0x8] + negs r0, r0 + b _08116332 + .pool +_08116330: + ldrh r0, [r3, 0x8] +_08116332: + strh r0, [r6] + ldr r2, =0x02022e22 + ldrh r3, [r2] + lsls r1, r5, 2 + adds r0, r1, r5 + lsls r0, 3 + mov r7, r12 + adds r4, r0, r7 + movs r7, 0xA + ldrsh r0, [r4, r7] + cmn r3, r0 + bne _08116354 + movs r0, 0 + b _08116358 + .pool +_08116354: + ldrh r0, [r4, 0xA] + negs r0, r0 +_08116358: + strh r0, [r2] + adds r0, r1, r5 + lsls r0, 3 + add r0, r12 + ldrh r1, [r0, 0x18] + strh r1, [r0, 0xE] + ldrh r1, [r0, 0xC] + subs r1, 0x1 + strh r1, [r0, 0xC] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0 + bne _08116382 + strh r1, [r6] + strh r1, [r2] + adds r0, r5, 0 + bl move_anim_task_del + b _08116382 +_0811637E: + subs r0, r2, 0x1 + strh r0, [r3, 0xE] +_08116382: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81162F8 + + thumb_func_start sub_8116388 +sub_8116388: @ 8116388 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x0203841e + ldrb r1, [r4, 0x6] + bl StartObjectRotScalAnim + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081163AC + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A69CC + b _081163B4 + .pool +_081163AC: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A6980 +_081163B4: + ldr r0, =sub_80A67BC + str r0, [r5, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r5, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8116388 + + thumb_func_start sub_81163D0 +sub_81163D0: @ 81163D0 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x0203841e + ldrb r1, [r4, 0x6] + bl StartObjectRotScalAnim + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081163F4 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A69CC + b _081163FC + .pool +_081163F4: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A6980 +_081163FC: + ldr r0, =0x0203841e + ldrh r0, [r0, 0x8] + strh r0, [r5, 0x2E] + ldr r0, =sub_80A67BC + str r0, [r5, 0x1C] + ldr r1, =sub_810E2C8 + adds r0, r5, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81163D0 + + thumb_func_start sub_8116420 +sub_8116420: @ 8116420 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08116444 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08116444 + ldr r1, =0x0203841e + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] +_08116444: + adds r0, r4, 0 + bl sub_8116388 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8116420 + + thumb_func_start sub_8116458 +sub_8116458: @ 8116458 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x0203841e + movs r0, 0x2 + ldrsh r1, [r5, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _08116474 + bl GenerateRandomNumber2 + movs r1, 0x3 + ands r1, r0 + strh r1, [r5, 0x2] +_08116474: + ldrb r1, [r5, 0x2] + adds r0, r4, 0 + bl StartObjectRotScalAnim + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08116494 + adds r0, r4, 0 + movs r1, 0 + bl sub_80A69CC + b _0811649C + .pool +_08116494: + adds r0, r4, 0 + movs r1, 0 + bl sub_80A6980 +_0811649C: + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x30 + bl __umodsi3 + ldr r1, =0x0000ffe8 + adds r0, r1 + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x18 + bl __umodsi3 + ldr r1, =0x0000fff4 + adds r0, r1 + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldr r1, =move_anim_8074EE0 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A67BC + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8116458 + + thumb_func_start sub_81164F0 +sub_81164F0: @ 81164F0 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x0203841e + ldrb r0, [r5] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, =0x02020630 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x24] + ldrh r0, [r0, 0x20] + adds r1, r0 + strh r1, [r4, 0x20] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + ldrh r0, [r0, 0x22] + adds r1, r0 + strh r1, [r4, 0x22] + ldrh r0, [r5, 0x2] + strh r0, [r4, 0x24] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x26] + ldrb r1, [r5, 0x6] + adds r0, r4, 0 + bl StartObjectRotScalAnim + ldr r1, =move_anim_8074EE0 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A67BC + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81164F0 + + thumb_func_start sub_8116560 +sub_8116560: @ 8116560 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0203841e + movs r1, 0x4 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0811657C + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A69CC + b _08116584 + .pool +_0811657C: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A6980 +_08116584: + ldr r0, =0x0203841e + ldrh r0, [r0, 0x6] + strh r0, [r4, 0x2E] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A64B0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8116560 + + thumb_func_start sub_81165A8 +sub_81165A8: @ 81165A8 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x0203841e + ldrb r1, [r4, 0x6] + bl StartObjectRotScalAnim + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081165CC + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A69CC + b _081165D4 + .pool +_081165CC: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A6980 +_081165D4: + ldr r0, =sub_81165E4 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81165A8 + + thumb_func_start sub_81165E4 +sub_81165E4: @ 81165E4 + push {lr} + adds r3, r0, 0 + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r2, [r0] + 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 + mov r1, r12 + strb r0, [r1] + ldrh r0, [r3, 0x2E] + adds r1, r0, 0x1 + strh r1, [r3, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + ble _0811661A + adds r0, r3, 0 + bl move_anim_8072740 +_0811661A: + pop {r0} + bx r0 + thumb_func_end sub_81165E4 + + thumb_func_start sub_8116620 +sub_8116620: @ 8116620 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r4, =0x0203841e + movs r1, 0 + ldrsh r0, [r4, r1] + bl sub_811583C + adds r6, r0, 0 + ldrh r3, [r4] + lsls r3, 16 + asrs r0, r3, 23 + movs r4, 0x1 + ands r0, r4 + asrs r1, r3, 24 + ands r1, r4 + asrs r2, r3, 25 + ands r2, r4 + asrs r3, 26 + ands r3, r4 + bl sub_80A76C4 + orrs r6, r0 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8116874 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8116620 + + thumb_func_start sub_8116664 +sub_8116664: @ 8116664 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + mov r1, sp + movs r0, 0xFF + strb r0, [r1, 0x1] + movs r0, 0x1 + bl sub_811583C + adds r5, r0, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x7 + bhi _0811670E + lsls r0, 2 + ldr r1, =_08116698 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08116698: + .4byte _081166BA + .4byte _081166C6 + .4byte _081166B8 + .4byte _081166C4 + .4byte _081166D4 + .4byte _081166EC + .4byte _081166F4 + .4byte _08116700 +_081166B8: + movs r5, 0 +_081166BA: + mov r0, sp + ldr r1, =0x02038436 + b _081166CA + .pool +_081166C4: + movs r5, 0 +_081166C6: + mov r0, sp + ldr r1, =0x02038437 +_081166CA: + ldrb r1, [r1] + strb r1, [r0] + b _0811670E + .pool +_081166D4: + mov r1, sp + ldr r0, =0x02038436 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, =0x02038437 + ldrb r0, [r0] + strb r0, [r1, 0x1] + b _0811670E + .pool +_081166EC: + mov r1, sp + movs r0, 0xFF + strb r0, [r1] + b _0811670E +_081166F4: + movs r5, 0 + mov r2, sp + ldr r0, =0x02038436 + b _08116706 + .pool +_08116700: + movs r5, 0 + mov r2, sp + ldr r0, =0x02038437 +_08116706: + ldrb r0, [r0] + movs r1, 0x2 + eors r0, r1 + strb r0, [r2] +_0811670E: + movs r4, 0 + mov r6, sp +_08116712: + ldrb r0, [r6] + cmp r4, r0 + beq _0811673C + ldrb r0, [r6, 0x1] + cmp r4, r0 + beq _0811673C + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0811673C + adds r0, r4, 0 + bl sub_80A77AC + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x80 + lsls r1, 9 + lsls r1, r0 + orrs r5, r1 +_0811673C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _08116712 + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_8116874 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8116664 + + thumb_func_start sub_811675C +sub_811675C: @ 811675C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + bl sub_811583C + adds r2, r0, 0 + ldr r0, =0x02022ff0 + ldrb r0, [r0] + cmp r0, 0x9 + bhi _08116832 + lsls r0, 2 + ldr r1, =_0811678C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0811678C: + .4byte _081167B4 + .4byte _081167C4 + .4byte _081167D0 + .4byte _081167E0 + .4byte _081167EC + .4byte _081167FC + .4byte _0811680C + .4byte _0811681C + .4byte _0811682C + .4byte _0811682C +_081167B4: + ldr r1, =0x0203841e + ldr r0, =0x00000b0c + b _08116830 + .pool +_081167C4: + ldr r1, =0x0203841e + movs r0, 0x9E + lsls r0, 4 + b _08116830 + .pool +_081167D0: + ldr r1, =0x0203841e + ldr r0, =0x00002f1e + b _08116830 + .pool +_081167E0: + ldr r1, =0x0203841e + movs r0, 0x90 + lsls r0, 7 + b _08116830 + .pool +_081167EC: + ldr r1, =0x0203841e + ldr r0, =0x00007ecb + b _08116830 + .pool +_081167FC: + ldr r1, =0x0203841e + ldr r0, =0x00007ecb + b _08116830 + .pool +_0811680C: + ldr r1, =0x0203841e + ldr r0, =0x00002a16 + b _08116830 + .pool +_0811681C: + ldr r1, =0x0203841e + ldr r0, =0x00000d2e + b _08116830 + .pool +_0811682C: + ldr r1, =0x0203841e + ldr r0, =0x00007fff +_08116830: + strh r0, [r1, 0x8] +_08116832: + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_8116874 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811675C + + thumb_func_start sub_8116848 +sub_8116848: @ 8116848 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x0203841e + ldrh r0, [r0] + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x10 + movs r1, 0x1 + lsls r1, r0 + adds r0, r4, 0 + bl sub_8116874 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8116848 + + thumb_func_start sub_8116874 +sub_8116874: @ 8116874 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x03005e00 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r3 + strh r1, [r2, 0x8] + lsrs r1, 16 + strh r1, [r2, 0xA] + ldr r3, =0x0203841e + ldrh r1, [r3, 0x2] + strh r1, [r2, 0xC] + ldrh r1, [r3, 0x4] + strh r1, [r2, 0xE] + ldrh r1, [r3, 0x6] + strh r1, [r2, 0x10] + ldrh r1, [r3, 0x8] + strh r1, [r2, 0x12] + ldrh r1, [r3, 0x4] + strh r1, [r2, 0x1C] + ldr r1, =sub_81168B8 + str r1, [r2] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8116874 + + thumb_func_start sub_81168B8 +sub_81168B8: @ 81168B8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + movs r6, 0 + ldr r2, =0x03005e00 + lsls r5, r7, 2 + adds r0, r5, r7 + lsls r0, 3 + adds r3, r0, r2 + ldrh r0, [r3, 0x1A] + mov r8, r0 + movs r4, 0x1A + ldrsh r1, [r3, r4] + movs r4, 0xC + ldrsh r0, [r3, r4] + mov r9, r2 + cmp r1, r0 + bne _0811694E + strh r6, [r3, 0x1A] + movs r0, 0x8 + ldrsh r4, [r3, r0] + movs r1, 0xA + ldrsh r0, [r3, r1] + lsls r0, 16 + orrs r4, r0 + mov r8, r5 + cmp r4, 0 + beq _0811691A + adds r5, r3, 0 +_081168F8: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0811690C + ldrb r2, [r5, 0x1C] + ldrh r3, [r5, 0x12] + adds r0, r6, 0 + movs r1, 0x10 + bl pal_fade_1 +_0811690C: + adds r0, r6, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r6, r0, 16 + lsrs r4, 1 + cmp r4, 0 + bne _081168F8 +_0811691A: + mov r4, r8 + adds r0, r4, r7 + lsls r0, 3 + mov r1, r9 + adds r2, r0, r1 + ldrh r0, [r2, 0x1C] + movs r4, 0x1C + ldrsh r3, [r2, r4] + movs r4, 0x10 + ldrsh r1, [r2, r4] + cmp r3, r1 + bge _0811693C + adds r0, 0x1 + strh r0, [r2, 0x1C] + b _08116954 + .pool +_0811693C: + cmp r3, r1 + ble _08116946 + subs r0, 0x1 + strh r0, [r2, 0x1C] + b _08116954 +_08116946: + adds r0, r7, 0 + bl move_anim_task_del + b _08116954 +_0811694E: + mov r0, r8 + adds r0, 0x1 + strh r0, [r3, 0x1A] +_08116954: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81168B8 + + thumb_func_start sub_8116960 +sub_8116960: @ 8116960 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r4, =0x0203841e + ldrb r0, [r4] + ldrb r1, [r4, 0x2] + ldrb r2, [r4, 0x4] + ldrb r3, [r4, 0x6] + ldrb r4, [r4, 0x8] + str r4, [sp] + bl sub_80A27B0 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81169A0 + str r1, [r0] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8116960 + + thumb_func_start sub_81169A0 +sub_81169A0: @ 81169A0 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081169B8 + adds r0, r2, 0 + bl move_anim_task_del +_081169B8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81169A0 + + thumb_func_start sub_81169C0 +sub_81169C0: @ 81169C0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r1, r0 + ldr r2, =0x0203841e + ldrh r0, [r2] + movs r3, 0 + strh r0, [r1, 0x8] + strh r3, [r1, 0xA] + ldrh r0, [r2, 0x2] + strh r0, [r1, 0xC] + ldrh r0, [r2, 0x4] + strh r0, [r1, 0xE] + ldrh r0, [r2, 0x6] + strh r0, [r1, 0x10] + strh r3, [r1, 0x12] + ldr r0, =sub_81169F8 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_81169C0 + + thumb_func_start sub_81169F8 +sub_81169F8: @ 81169F8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r2, r5, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08116ABC + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08116A28 + subs r0, r1, 0x1 + strh r0, [r4, 0xA] + b _08116ACA + .pool +_08116A28: + ldrb r0, [r4, 0x8] + bl duplicate_obj_of_side_rel2move_in_transparent_mode + strh r0, [r4, 0x14] + lsls r0, 16 + cmp r0, 0 + blt _08116AA6 + ldr r6, =0x02020630 + movs r1, 0x14 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r3, r1, r6 + movs r2, 0x8 + ldrsh r0, [r4, r2] + movs r2, 0x2 + cmp r0, 0 + beq _08116A50 + movs r2, 0x1 +_08116A50: + lsls r2, 2 + ldrb r1, [r3, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x5] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrh r1, [r4, 0xE] + strh r1, [r0, 0x2E] + movs r2, 0x14 + ldrsh r1, [r4, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r5, [r0, 0x30] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x5 + strh r1, [r0, 0x32] + movs r2, 0x14 + ldrsh r1, [r4, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r6, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_8116AD0 + str r1, [r0] + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] +_08116AA6: + ldrh r0, [r4, 0x10] + subs r0, 0x1 + strh r0, [r4, 0x10] + ldrh r0, [r4, 0xC] + strh r0, [r4, 0xA] + b _08116ACA + .pool +_08116ABC: + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08116ACA + adds r0, r2, 0 + bl move_anim_task_del +_08116ACA: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81169F8 + + thumb_func_start sub_8116AD0 +sub_8116AD0: @ 8116AD0 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08116AE4 + subs r0, r1, 0x1 + strh r0, [r4, 0x2E] + b _08116B08 +_08116AE4: + ldr r3, =0x03005e00 + movs r0, 0x32 + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x30 + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl obj_delete_but_dont_free_vram +_08116B08: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8116AD0 + + thumb_func_start sub_8116B14 +sub_8116B14: @ 8116B14 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r7, 0 + ldr r0, =0x02022e24 + strh r7, [r0] + ldr r0, =0x02022e26 + strh r7, [r0] + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + ldr r1, =0x00003f3d + movs r0, 0x4A + bl SetGpuReg + movs r1, 0x80 + lsls r1, 8 + movs r0, 0 + bl SetGpuRegBits + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x00000c08 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0xA + bl GetGpuReg + add r4, sp, 0x10 + strh r0, [r4] + ldrb r1, [r4] + movs r0, 0x4 + negs r0, r0 + mov r8, r0 + ands r0, r1 + strb r0, [r4] + mov r2, sp + adds r2, 0x11 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2] + ldrh r1, [r4] + movs r0, 0xA + bl SetGpuReg + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08116BA2 + ldrb r1, [r4] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] + ldrh r1, [r4] + movs r0, 0xA + bl SetGpuReg +_08116BA2: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08116C26 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08116C26 + ldr r5, =0x02038436 + ldrb r0, [r5] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _08116BD2 + ldrb r0, [r5] + bl battle_get_per_side_status + lsls r0, 24 + cmp r0, 0 + bne _08116C26 +_08116BD2: + ldrb r0, [r5] + movs r6, 0x2 + eors r0, r6 + bl b_side_obj__get_some_boolean + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08116C26 + ldr r3, =0x02020630 + ldr r1, =0x020241e4 + ldrb r0, [r5] + eors r0, r6 + adds r0, r1 + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + ldrb r3, [r2, 0x5] + lsls r1, r3, 28 + lsrs r1, 30 + subs r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + ldrb r1, [r4] + mov r0, r8 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4] + ldrh r1, [r4] + movs r0, 0xA + bl SetGpuReg + movs r7, 0x1 +_08116C26: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08116C64 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r5, [r0] + b _08116CAC + .pool +_08116C64: + ldr r4, =0x02038436 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08116C90 + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + b _08116CA0 + .pool +_08116C90: + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec +_08116CA0: + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 +_08116CAC: + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x02038436 + ldrb r0, [r0] + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_80A89C8 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + mov r0, sp + bl sub_80A6B30 + ldr r1, =gUnknown_08C20684 + mov r0, sp + movs r2, 0 + bl sub_80A6D60 + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, =gUnknown_08C20668 + mov r2, sp + ldrh r2, [r2, 0xA] + bl sub_80A6CC0 + ldr r0, =gUnknown_08597418 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + adds r1, 0x1 + movs r2, 0x2 + bl gpu_pal_apply + ldr r2, =0x02022e18 + ldr r0, =0x02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x20] + negs r0, r0 + adds r0, 0x20 + strh r0, [r2] + ldr r2, =0x02022e1a + ldrh r0, [r1, 0x22] + negs r0, r0 + adds r0, 0x20 + strh r0, [r2] + ldr r1, =0x03005e00 + mov r2, r9 + lsls r0, r2, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x8] + strh r7, [r0, 0x14] + ldr r1, =sub_8116D64 + 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_8116B14 + + thumb_func_start sub_8116D64 +sub_8116D64: @ 8116D64 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + ldrh r0, [r5, 0x1C] + adds r0, 0x4 + movs r1, 0 + mov r8, r1 + strh r0, [r5, 0x1C] + ldr r7, =0x02022e1a + ldrh r2, [r7] + subs r1, r2, 0x4 + strh r1, [r7] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + bne _08116E86 + mov r0, r8 + strh r0, [r5, 0x1C] + adds r0, r2, 0 + adds r0, 0x3C + strh r0, [r7] + ldrh r0, [r5, 0x1E] + adds r0, 0x1 + strh r0, [r5, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _08116E86 + movs r0, 0 + bl sub_80A477C + ldr r0, =0x02022e24 + mov r1, r8 + strh r1, [r0] + ldr r0, =0x02022e26 + strh r1, [r0] + ldr r4, =0x00003f3f + movs r0, 0x48 + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x4A + adds r1, r4, 0 + bl SetGpuReg + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08116DF6 + movs r0, 0xA + bl GetGpuReg + add r1, sp, 0x10 + strh r0, [r1] + ldrb r2, [r1] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldrh r1, [r1] + movs r0, 0xA + bl SetGpuReg +_08116DF6: + movs r0, 0 + bl GetGpuReg + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 8 + adds r0, r2, 0 + eors r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0 + bl obj_id_for_side_relative_to_move + ldr r4, =0x02020630 + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + bl sub_80A6C68 + movs r1, 0x14 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _08116E7C + ldr r2, =0x020241e4 + ldr r0, =0x02038436 + ldrb r1, [r0] + movs r0, 0x2 + eors r0, r1 + adds r0, r2 + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + ldrb r3, [r2, 0x5] + lsls r1, r3, 28 + lsrs r1, 30 + adds r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] +_08116E7C: + mov r2, r8 + strh r2, [r7] + adds r0, r6, 0 + bl move_anim_task_del +_08116E86: + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8116D64 + + thumb_func_start sub_8116EB4 +sub_8116EB4: @ 8116EB4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x0203a110 + movs r0, 0x18 + bl AllocZeroed + str r0, [r4] + movs r2, 0 + ldr r3, =0x0203841e +_08116EC8: + ldr r1, [r4] + lsls r0, r2, 1 + adds r1, 0x4 + adds r1, r0 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _08116EC8 + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8116F04 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8116EB4 + + thumb_func_start sub_8116F04 +sub_8116F04: @ 8116F04 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x0203a110 + ldr r1, [r0] + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08116F24 + ldr r0, =0x02038436 + b _08116F26 + .pool +_08116F24: + ldr r0, =0x02038437 +_08116F26: + ldrb r0, [r0] + strb r0, [r1] + ldr r4, =0x0203a110 + ldr r2, [r4] + ldrb r0, [r2] + movs r1, 0x2 + eors r0, r1 + strb r0, [r2, 0x1] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08116F56 + ldr r1, [r4] + movs r2, 0xA + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _08116F5C + ldrb r0, [r1, 0x1] + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + bne _08116F5C +_08116F56: + ldr r1, [r4] + movs r0, 0 + strh r0, [r1, 0xA] +_08116F5C: + ldr r0, =0x02022e24 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e26 + strh r1, [r0] + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + ldr r1, =0x00003f3d + movs r0, 0x4A + bl SetGpuReg + movs r1, 0x80 + lsls r1, 8 + movs r0, 0 + bl SetGpuRegBits + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08116FBA + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations +_08116FBA: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08117036 + ldr r4, =0x0203a110 + ldr r1, [r4] + movs r2, 0xA + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08117036 + ldrb r0, [r1] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _08116FEC + ldr r0, [r4] + ldrb r0, [r0] + bl battle_get_per_side_status + lsls r0, 24 + cmp r0, 0 + bne _08117036 +_08116FEC: + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl b_side_obj__get_some_boolean + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bne _08117036 + ldr r3, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + adds r0, r1 + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + ldrb r3, [r2, 0x5] + lsls r1, r3, 28 + lsrs r1, 30 + subs r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + ldr r0, [r4] + strb r5, [r0, 0x2] +_08117036: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08117078 + ldr r0, =0x0203a110 + ldr r1, [r0] + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r0, [r0] + b _081170C4 + .pool +_08117078: + ldr r4, =0x0203a110 + ldr r0, [r4] + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _081170A8 + ldr r1, =0x0202406e + ldr r0, [r4] + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + b _081170BA + .pool +_081170A8: + ldr r1, =0x0202406e + ldr r0, [r4] + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec +_081170BA: + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + ldr r1, [r4] +_081170C4: + strh r0, [r1, 0x14] + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81170EC + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8116F04 + + thumb_func_start sub_81170EC +sub_81170EC: @ 81170EC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0 + mov r8, r0 + ldr r6, =0x020241e4 + ldr r4, =0x0203a110 + ldr r2, [r4] + ldrb r0, [r2] + adds r1, r0, r6 + ldrb r1, [r1] + ldrh r2, [r2, 0x14] + bl sub_80A89C8 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, [r4] + movs r1, 0xA + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0811712E + ldrb r0, [r2, 0x1] + adds r1, r0, r6 + ldrb r1, [r1] + ldrh r2, [r2, 0x14] + bl sub_80A89C8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 +_0811712E: + mov r0, sp + bl sub_80A6B30 + ldr r0, [r4] + movs r4, 0x4 + ldrsh r0, [r0, r4] + cmp r0, 0 + bne _08117158 + ldr r1, =gUnknown_08C2D930 + mov r0, sp + movs r2, 0 + bl sub_80A6D60 + b _08117162 + .pool +_08117158: + ldr r1, =gUnknown_08C2DA4C + mov r0, sp + movs r2, 0 + bl sub_80A6D60 +_08117162: + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, =gUnknown_08C2D720 + mov r2, sp + ldrh r2, [r2, 0xA] + bl sub_80A6CC0 + ldr r0, =0x0203a110 + ldr r0, [r0] + movs r1, 0x6 + ldrsh r0, [r0, r1] + cmp r0, 0x6 + bhi _081171F8 + lsls r0, 2 + ldr r1, =_08117198 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08117198: + .4byte _081171B4 + .4byte _081171BC + .4byte _081171C4 + .4byte _081171CC + .4byte _081171D4 + .4byte _081171DC + .4byte _081171E4 +_081171B4: + ldr r0, =gUnknown_08C2DB88 + b _081171E6 + .pool +_081171BC: + ldr r0, =gUnknown_08C2DB68 + b _081171E6 + .pool +_081171C4: + ldr r0, =gUnknown_08C2DBA8 + b _081171E6 + .pool +_081171CC: + ldr r0, =gUnknown_08C2DBC8 + b _081171E6 + .pool +_081171D4: + ldr r0, =gUnknown_08C2DC08 + b _081171E6 + .pool +_081171DC: + ldr r0, =gUnknown_08C2DC28 + b _081171E6 + .pool +_081171E4: + ldr r0, =gUnknown_08C2DC48 +_081171E6: + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl decompress_palette + b _08117206 + .pool +_081171F8: + ldr r0, =gUnknown_08C2DBE8 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl decompress_palette +_08117206: + ldr r3, =0x02022e18 + movs r2, 0 + strh r2, [r3] + ldr r0, =0x02022e1a + strh r2, [r0] + ldr r1, =0x0203a110 + ldr r0, [r1] + movs r4, 0x4 + ldrsh r0, [r0, r4] + adds r4, r1, 0 + cmp r0, 0x1 + bne _08117248 + movs r0, 0x40 + strh r0, [r3] + ldr r2, =0x03005e00 + lsls r3, r5, 2 + adds r0, r3, r5 + lsls r0, 3 + adds r0, r2 + ldr r1, =0x0000fffd + b _08117254 + .pool +_08117248: + ldr r2, =0x03005e00 + lsls r3, r5, 2 + adds r0, r3, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0x3 +_08117254: + strh r1, [r0, 0xA] + ldr r0, [r4] + movs r1, 0xC + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08117274 + adds r0, r3, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0xA + strh r1, [r0, 0x10] + movs r1, 0x14 + b _08117280 + .pool +_08117274: + adds r0, r3, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0xD + strh r1, [r0, 0x10] + movs r1, 0x1E +_08117280: + strh r1, [r0, 0x12] + adds r1, r3, r5 + lsls r1, 3 + adds r1, r2 + strh r7, [r1, 0x8] + ldr r3, [r4] + ldrh r0, [r3, 0xA] + strh r0, [r1, 0xC] + mov r4, r8 + strh r4, [r1, 0xE] + ldrb r0, [r3, 0x2] + strh r0, [r1, 0x14] + ldr r2, =0x020241e4 + ldrb r0, [r3, 0x1] + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1, 0x16] + ldr r0, =sub_81172EC + str r0, [r1] + movs r1, 0x4 + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _081172CC + movs r0, 0x40 + negs r0, r0 + bl sub_80A5278 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xEF + bl audio_play_and_stuff + b _081172E0 + .pool +_081172CC: + movs r0, 0x40 + negs r0, r0 + bl sub_80A5278 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xF5 + bl audio_play_and_stuff +_081172E0: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81170EC + + thumb_func_start sub_81172EC +sub_81172EC: @ 81172EC + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, =0x02022e1a + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + ldrh r0, [r5, 0xA] + ldrh r1, [r2] + adds r0, r1 + strh r0, [r2] + movs r0, 0x26 + ldrsh r2, [r5, r0] + cmp r2, 0x1 + beq _08117362 + cmp r2, 0x1 + bgt _08117320 + cmp r2, 0 + beq _0811732A + b _08117478 + .pool +_08117320: + cmp r2, 0x2 + beq _08117378 + cmp r2, 0x3 + beq _081173B6 + b _08117478 +_0811732A: + ldrh r0, [r5, 0x1E] + adds r1, r0, 0x1 + strh r1, [r5, 0x1E] + lsls r0, 16 + cmp r0, 0 + bgt _08117338 + b _08117478 +_08117338: + strh r2, [r5, 0x1E] + ldrh r1, [r5, 0x20] + adds r1, 0x1 + strh r1, [r5, 0x20] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r2, 0x20 + ldrsh r1, [r5, r2] + movs r2, 0x10 + ldrsh r0, [r5, r2] + cmp r1, r0 + beq _08117360 + b _08117478 +_08117360: + b _081173AE +_08117362: + ldrh r0, [r5, 0x1C] + adds r0, 0x1 + strh r0, [r5, 0x1C] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x12 + ldrsh r1, [r5, r2] + cmp r0, r1 + beq _08117376 + b _08117478 +_08117376: + b _081173AE +_08117378: + ldrh r0, [r5, 0x1E] + adds r1, r0, 0x1 + strh r1, [r5, 0x1E] + lsls r0, 16 + cmp r0, 0 + ble _08117478 + movs r0, 0 + strh r0, [r5, 0x1E] + ldrh r1, [r5, 0x20] + subs r1, 0x1 + strh r1, [r5, 0x20] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x20 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08117478 + movs r0, 0 + bl sub_80A477C +_081173AE: + ldrh r0, [r5, 0x26] + adds r0, 0x1 + strh r0, [r5, 0x26] + b _08117478 +_081173B6: + ldr r0, =0x02022e24 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e26 + strh r1, [r0] + ldr r4, =0x00003f3f + movs r0, 0x48 + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x4A + adds r1, r4, 0 + bl SetGpuReg + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _081173E6 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_081173E6: + movs r0, 0 + bl GetGpuReg + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 8 + adds r0, r2, 0 + eors r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x8 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl RemoveObjectAndFreeTiles + movs r1, 0xC + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _0811743A + movs r2, 0xE + ldrsh r1, [r5, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles +_0811743A: + movs r1, 0x14 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _08117466 + movs r2, 0x16 + ldrsh r0, [r5, r2] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + ldrb r3, [r2, 0x5] + lsls r1, r3, 28 + lsrs r1, 30 + adds r1, 0x1 + movs r0, 0x3 + ands r1, r0 + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] +_08117466: + ldr r4, =0x0203a110 + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] + adds r0, r6, 0 + bl move_anim_task_del +_08117478: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81172EC + + thumb_func_start sub_8117494 +sub_8117494: @ 8117494 + push {r4-r6,lr} + sub sp, 0xC + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x1 + movs r3, 0x1 + bl sub_80A76C4 + adds r6, r0, 0 + movs r1, 0 + bl sub_81175C4 + ldr r0, =0x03005e00 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + lsrs r0, r6, 16 + movs r5, 0 + strh r0, [r4, 0x24] + str r5, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80A75AC + adds r6, r0, 0 + ldr r1, =0x0000ffff + ands r6, r1 + adds r0, r6, 0 + bl sub_81175C4 + strh r6, [r4, 0x26] + strh r5, [r4, 0x8] + strh r5, [r4, 0xA] + ldr r0, =sub_8117500 + str r0, [r4] + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8117494 + + thumb_func_start sub_8117500 +sub_8117500: @ 8117500 + push {r4-r6,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _08117544 + cmp r1, 0x1 + bgt _08117528 + cmp r1, 0 + beq _0811752E + b _081175BE + .pool +_08117528: + cmp r1, 0x2 + beq _081175B8 + b _081175BE +_0811752E: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + ble _081175BE + strh r1, [r4, 0xA] + movs r0, 0x10 + strh r0, [r4, 0xC] + b _081175AC +_08117544: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081175BE + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + movs r5, 0 + movs r6, 0x1 +_08117560: + movs r1, 0x26 + ldrsh r0, [r4, r1] + asrs r0, r5 + ands r0, r6 + cmp r0, 0 + beq _0811757A + lsls r0, r5, 20 + lsrs r0, 16 + ldrb r2, [r4, 0xC] + movs r1, 0x10 + ldr r3, =0x0000ffff + bl pal_fade_1 +_0811757A: + movs r1, 0x24 + ldrsh r0, [r4, r1] + asrs r0, r5 + ands r0, r6 + cmp r0, 0 + beq _0811759A + lsls r0, r5, 20 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + ldrb r2, [r4, 0xC] + movs r1, 0x10 + movs r3, 0 + bl pal_fade_1 +_0811759A: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0xF + bls _08117560 + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081175BE +_081175AC: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _081175BE + .pool +_081175B8: + adds r0, r2, 0 + bl move_anim_task_del +_081175BE: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8117500 + + thumb_func_start sub_81175C4 +sub_81175C4: @ 81175C4 + push {r4-r6,lr} + adds r3, r0, 0 + lsls r1, 16 + lsrs r6, r1, 16 + movs r2, 0 +_081175CE: + movs r0, 0x1 + ands r0, r3 + lsrs r4, r3, 1 + adds r5, r2, 0x1 + cmp r0, 0 + beq _081175FA + lsls r0, r2, 20 + lsrs r2, r0, 16 + adds r0, r2, 0 + adds r0, 0x10 + cmp r2, r0 + bge _081175FA + ldr r1, =0x02037b14 + adds r3, r0, 0 +_081175EA: + lsls r0, r2, 1 + adds r0, r1 + strh r6, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, r3 + blt _081175EA +_081175FA: + adds r3, r4, 0 + lsls r0, r5, 16 + lsrs r2, r0, 16 + cmp r2, 0x1F + bls _081175CE + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81175C4 + + thumb_func_start sub_8117610 +sub_8117610: @ 8117610 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + movs r2, 0 + ldr r0, =0x02038436 + ldrb r3, [r0] + movs r5, 0x1 +_08117620: + cmp r3, r2 + beq _0811762E + adds r1, r2, 0 + adds r1, 0x10 + adds r0, r5, 0 + lsls r0, r1 + orrs r4, r0 +_0811762E: + adds r2, 0x1 + cmp r2, 0x3 + bls _08117620 + movs r2, 0x5 + ldr r0, =0x0203841e + adds r1, r0, 0 + adds r1, 0x8 +_0811763C: + ldrh r0, [r1] + strh r0, [r1, 0x2] + subs r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bne _0811763C + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8116874 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8117610 + + thumb_func_start sub_8117660 +sub_8117660: @ 8117660 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0 + bl sub_80A6DAC + ldr r0, =sub_81176D8 + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x0203841e + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0811769C + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0811769C + ldrh r0, [r4] + negs r0, r0 + strh r0, [r4] + ldrh r0, [r4, 0x2] + negs r0, r0 + strh r0, [r4, 0x2] +_0811769C: + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r2, =0x0203841e + ldrh r0, [r2] + strh r0, [r1, 0xA] + ldrh r0, [r2, 0x2] + strh r0, [r1, 0xC] + ldrh r0, [r2, 0x6] + strh r0, [r1, 0xE] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + adds r0, r6, 0 + bl move_anim_task_del + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8117660 + + thumb_func_start sub_81176D8 +sub_81176D8: @ 81176D8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrh r3, [r1, 0xA] + ldrh r0, [r1, 0x1C] + adds r3, r0 + movs r4, 0 + mov r12, r4 + strh r3, [r1, 0x1C] + ldrh r2, [r1, 0xC] + ldrh r7, [r1, 0x1E] + adds r2, r7 + strh r2, [r1, 0x1E] + ldr r6, =0x02022e20 + lsls r0, r3, 16 + asrs r0, 24 + ldrh r4, [r6] + adds r0, r4 + strh r0, [r6] + ldr r4, =0x02022e22 + lsls r0, r2, 16 + asrs r0, 24 + ldrh r7, [r4] + adds r0, r7 + strh r0, [r4] + movs r0, 0xFF + ands r3, r0 + strh r3, [r1, 0x1C] + ands r2, r0 + strh r2, [r1, 0x1E] + ldr r0, =0x0203841e + movs r3, 0xE + ldrsh r2, [r0, r3] + movs r7, 0xE + ldrsh r0, [r1, r7] + cmp r2, r0 + bne _0811773E + mov r0, r12 + strh r0, [r6] + strh r0, [r4] + movs r0, 0x1 + bl sub_80A6DAC + adds r0, r5, 0 + bl DestroyTask +_0811773E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81176D8 + + thumb_func_start sub_8117754 +sub_8117754: @ 8117754 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + ldr r1, =0x0203841e + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0xE] + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8117754 + + thumb_func_start sub_8117780 +sub_8117780: @ 8117780 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + ldr r1, =0x0203841e + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0xE] + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8117780 + + thumb_func_start sub_81177AC +sub_81177AC: @ 81177AC + push {r4,r5,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r5, =0x0203841e + movs r4, 0 + ldr r0, =0x02038436 + ldrb r2, [r0] + movs r0, 0x2 + ldr r1, =0x02038437 + eors r0, r2 + ldrb r1, [r1] + cmp r0, r1 + bne _081177C8 + movs r4, 0x1 +_081177C8: + strh r4, [r5, 0xE] + adds r0, r3, 0 + bl move_anim_task_del + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81177AC + + thumb_func_start sub_81177E4 +sub_81177E4: @ 81177E4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r6, =0x02020630 +_081177EE: + ldr r0, =0x02038436 + ldrb r0, [r0] + cmp r4, r0 + beq _0811782C + lsls r0, r4, 24 + lsrs r0, 24 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _0811782C + ldr r0, =0x020241e4 + adds r0, r4, r0 + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r6 + ldr r1, =0x0203841e + adds r2, 0x3E + movs r0, 0x1 + ldrb r3, [r1] + ands r3, r0 + lsls r3, 2 + ldrb r0, [r2] + movs r7, 0x5 + negs r7, r7 + adds r1, r7, 0 + ands r0, r1 + orrs r0, r3 + strb r0, [r2] +_0811782C: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _081177EE + adds r0, r5, 0 + bl move_anim_task_del + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81177E4 + + thumb_func_start sub_8117854 +sub_8117854: @ 8117854 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + ldr r1, [sp, 0x44] + ldr r4, [sp, 0x48] + ldr r5, [sp, 0x4C] + ldr r6, [sp, 0x50] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0x14] + lsls r3, 24 + lsrs r7, r3, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + 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 r10, r6 + movs r0, 0 + str r0, [sp, 0x20] + movs r0, 0x2 + adds r6, r7, 0 + eors r6, r0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _081178B6 + mov r1, r8 + cmp r1, 0 + beq _081178BA + adds r0, r6, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + bne _081178BA +_081178B6: + movs r2, 0 + mov r8, r2 +_081178BA: + ldr r0, =0x02022e24 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e26 + strh r1, [r0] + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + ldr r1, =0x00003f3d + movs r0, 0x4A + bl SetGpuReg + movs r1, 0x80 + lsls r1, 8 + movs r0, 0 + bl SetGpuRegBits + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0xA + bl GetGpuReg + add r4, sp, 0x10 + strh r0, [r4] + ldrb r1, [r4] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r4] + mov r2, sp + adds r2, 0x11 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2] + ldrb r0, [r2] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08117930 + ldrb r0, [r4] + movs r1, 0xD + negs r1, r1 + ands r1, r0 + movs r0, 0x4 + orrs r1, r0 + strb r1, [r4] +_08117930: + ldrh r1, [r4] + movs r0, 0xA + bl SetGpuReg + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08117964 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r4, [r0] + b _081179A2 + .pool +_08117964: + adds r0, r7, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08117988 + ldr r1, =0x0202406e + lsls r0, r7, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + b _08117996 + .pool +_08117988: + ldr r1, =0x0202406e + lsls r0, r7, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec +_08117996: + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 +_081179A2: + ldr r5, =0x020241e4 + adds r0, r7, r5 + ldrb r1, [r0] + adds r0, r7, 0 + adds r2, r4, 0 + bl sub_80A89C8 + lsls r0, 24 + lsrs r7, r0, 24 + mov r0, r8 + cmp r0, 0 + beq _081179CC + adds r0, r6, r5 + ldrb r1, [r0] + adds r0, r6, 0 + adds r2, r4, 0 + bl sub_80A89C8 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x20] +_081179CC: + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldr r1, [sp, 0x58] + movs r2, 0 + bl sub_80A6D60 + mov r0, sp + ldrb r0, [r0, 0x9] + mov r1, sp + ldrh r2, [r1, 0xA] + ldr r1, [sp, 0x54] + bl sub_80A6CC0 + mov r0, sp + ldrb r1, [r0, 0x8] + lsls r1, 4 + ldr r0, [sp, 0x5C] + movs r2, 0x20 + bl decompress_palette + ldr r0, =0x02022e18 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e1a + strh r1, [r0] + ldr r1, =0x03005e00 + mov r2, r9 + lsls r0, r2, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + mov r1, sp + ldrh r1, [r1, 0x14] + strh r1, [r0, 0xA] + mov r2, sp + ldrh r2, [r2, 0x18] + strh r2, [r0, 0x10] + mov r1, r10 + strh r1, [r0, 0x12] + mov r2, sp + ldrh r2, [r2, 0x1C] + strh r2, [r0, 0x14] + strh r7, [r0, 0x8] + mov r1, r8 + strh r1, [r0, 0xC] + mov r2, sp + ldrh r2, [r2, 0x20] + strh r2, [r0, 0xE] + ldr r1, =sub_8117A60 + str r1, [r0] + 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_8117854 + + thumb_func_start sub_8117A60 +sub_8117A60: @ 8117A60 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r3, r0, r1 + movs r0, 0xA + ldrsh r2, [r3, r0] + adds r5, r1, 0 + cmp r2, 0 + bge _08117A7E + negs r2, r2 +_08117A7E: + ldrh r0, [r3, 0x22] + adds r4, r0, r2 + strh r4, [r3, 0x22] + movs r1, 0xA + ldrsh r0, [r3, r1] + cmp r0, 0 + bge _08117AA4 + ldr r2, =0x02022e1a + lsls r1, r4, 16 + asrs r1, 24 + ldrh r0, [r2] + subs r0, r1 + strh r0, [r2] + b _08117AB0 + .pool +_08117AA4: + ldr r1, =0x02022e1a + lsls r0, r4, 16 + asrs r0, 24 + ldrh r2, [r1] + adds r0, r2 + strh r0, [r1] +_08117AB0: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r5 + ldrh r1, [r5, 0x22] + movs r0, 0xFF + ands r0, r1 + movs r2, 0 + strh r0, [r5, 0x22] + movs r3, 0x26 + ldrsh r0, [r5, r3] + cmp r0, 0x1 + beq _08117B1A + cmp r0, 0x1 + bgt _08117AD8 + cmp r0, 0 + beq _08117ADE + b _08117C0C + .pool +_08117AD8: + cmp r0, 0x2 + beq _08117B34 + b _08117C0C +_08117ADE: + ldrh r0, [r5, 0x1E] + adds r1, r0, 0x1 + strh r1, [r5, 0x1E] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x14 + ldrsh r1, [r5, r3] + cmp r0, r1 + bge _08117AF2 + b _08117C0C +_08117AF2: + strh r2, [r5, 0x1E] + ldrh r1, [r5, 0x20] + adds r1, 0x1 + strh r1, [r5, 0x20] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x20 + ldrsh r1, [r5, r0] + movs r2, 0x10 + ldrsh r0, [r5, r2] + cmp r1, r0 + bne _08117C0C + b _08117B2C +_08117B1A: + ldrh r0, [r5, 0x1C] + adds r0, 0x1 + strh r0, [r5, 0x1C] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x12 + ldrsh r1, [r5, r3] + cmp r0, r1 + bne _08117C0C +_08117B2C: + ldrh r0, [r5, 0x26] + adds r0, 0x1 + strh r0, [r5, 0x26] + b _08117C0C +_08117B34: + ldrh r0, [r5, 0x1E] + adds r1, r0, 0x1 + strh r1, [r5, 0x1E] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x14 + ldrsh r1, [r5, r3] + cmp r0, r1 + blt _08117C0C + strh r2, [r5, 0x1E] + ldrh r1, [r5, 0x20] + subs r1, 0x1 + strh r1, [r5, 0x20] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x20 + ldrsh r4, [r5, r0] + cmp r4, 0 + bne _08117C0C + movs r0, 0 + bl sub_80A477C + ldr r0, =0x02022e24 + strh r4, [r0] + ldr r0, =0x02022e26 + strh r4, [r0] + ldr r4, =0x00003f3f + movs r0, 0x48 + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x4A + adds r1, r4, 0 + bl SetGpuReg + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _08117BB2 + movs r0, 0xA + bl GetGpuReg + mov r1, sp + strh r0, [r1] + mov r2, sp + ldrb r1, [r2] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + strb r0, [r2] + mov r0, sp + ldrh r1, [r0] + movs r0, 0xA + bl SetGpuReg +_08117BB2: + movs r0, 0 + bl GetGpuReg + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 8 + adds r0, r2, 0 + eors r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r3, 0x8 + ldrsh r1, [r5, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl RemoveObjectAndFreeTiles + movs r1, 0xC + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08117C06 + movs r2, 0xE + ldrsh r1, [r5, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles +_08117C06: + adds r0, r6, 0 + bl move_anim_task_del +_08117C0C: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8117A60 + + thumb_func_start sub_8117C24 +sub_8117C24: @ 8117C24 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x0203841e + ldr r1, =0x02022ff0 + ldrb r1, [r1] + strh r1, [r2] + bl move_anim_task_del + pop {r0} + bx r0 + .pool + thumb_func_end sub_8117C24 + + thumb_func_start sub_8117C44 +sub_8117C44: @ 8117C44 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x80 + lsls r0, 6 + bl AllocZeroed + ldr r1, =0x020244d4 + ldr r1, [r1] + movs r2, 0xBE + lsls r2, 1 + adds r1, r2 + str r0, [r1] + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8117C44 + + thumb_func_start sub_8117C70 +sub_8117C70: @ 8117C70 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r6, =0x020244d4 + ldr r0, [r6] + movs r5, 0xBE + lsls r5, 1 + adds r0, r5 + ldr r0, [r0] + bl Free + ldr r0, [r6] + adds r0, r5 + movs r1, 0 + str r1, [r0] + adds r0, r4, 0 + bl move_anim_task_del + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8117C70 + + thumb_func_start sub_8117CA0 +sub_8117CA0: @ 8117CA0 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08117CE4 + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80A75AC + adds r1, r0, 0 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08117CFC + movs r2, 0x1 +_08117CD2: + lsrs r1, 1 + adds r4, 0x1 + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + beq _08117CD2 + b _08117CFC + .pool +_08117CE4: + cmp r0, 0x1 + bne _08117CF0 + ldr r0, =0x02038436 + b _08117CF6 + .pool +_08117CF0: + cmp r0, 0x2 + bne _08117CFC + ldr r0, =0x02038437 +_08117CF6: + ldrb r0, [r0] + adds r4, r0, 0 + adds r4, 0x10 +_08117CFC: + ldr r0, =0x020244d4 + ldr r1, [r0] + ldr r0, =0x0203841e + movs r2, 0x2 + ldrsh r0, [r0, r2] + movs r2, 0xBE + lsls r2, 1 + adds r1, r2 + ldr r1, [r1] + lsls r0, 5 + adds r0, r1 + lsls r1, r4, 5 + ldr r2, =0x02037714 + adds r1, r2 + movs r2, 0x20 + bl memcpy + adds r0, r5, 0 + bl move_anim_task_del + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8117CA0 + + thumb_func_start sub_8117D3C +sub_8117D3C: @ 8117D3C + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08117D80 + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80A75AC + adds r1, r0, 0 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08117D98 + movs r2, 0x1 +_08117D6E: + lsrs r1, 1 + adds r4, 0x1 + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + beq _08117D6E + b _08117D98 + .pool +_08117D80: + cmp r0, 0x1 + bne _08117D8C + ldr r0, =0x02038436 + b _08117D92 + .pool +_08117D8C: + cmp r0, 0x2 + bne _08117D98 + ldr r0, =0x02038437 +_08117D92: + ldrb r0, [r0] + adds r4, r0, 0 + adds r4, 0x10 +_08117D98: + lsls r0, r4, 5 + ldr r1, =0x02037714 + adds r0, r1 + ldr r1, =0x020244d4 + ldr r2, [r1] + ldr r1, =0x0203841e + movs r3, 0x2 + ldrsh r1, [r1, r3] + movs r3, 0xBE + lsls r3, 1 + adds r2, r3 + ldr r2, [r2] + lsls r1, 5 + adds r1, r2 + movs r2, 0x20 + bl memcpy + adds r0, r5, 0 + bl move_anim_task_del + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8117D3C + + thumb_func_start sub_8117DD8 +sub_8117DD8: @ 8117DD8 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08117E1C + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80A75AC + adds r1, r0, 0 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08117E34 + movs r2, 0x1 +_08117E0A: + lsrs r1, 1 + adds r4, 0x1 + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + beq _08117E0A + b _08117E34 + .pool +_08117E1C: + cmp r0, 0x1 + bne _08117E28 + ldr r0, =0x02038436 + b _08117E2E + .pool +_08117E28: + cmp r0, 0x2 + bne _08117E34 + ldr r0, =0x02038437 +_08117E2E: + ldrb r0, [r0] + adds r4, r0, 0 + adds r4, 0x10 +_08117E34: + lsls r1, r4, 5 + ldr r0, =0x02037714 + adds r0, r1, r0 + ldr r2, =0x02037b14 + adds r1, r2 + movs r2, 0x20 + bl memcpy + adds r0, r5, 0 + bl move_anim_task_del + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8117DD8 + + thumb_func_start sub_8117E60 +sub_8117E60: @ 8117E60 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08117E80 + ldr r1, =0x0203841e + movs r0, 0x1 + strh r0, [r1, 0xE] + b _08117E84 + .pool +_08117E80: + ldr r0, =0x0203841e + strh r1, [r0, 0xE] +_08117E84: + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8117E60 + + thumb_func_start sub_8117E94 +sub_8117E94: @ 8117E94 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02038436 + ldr r1, =0x0202420c + ldrb r1, [r1] + strb r1, [r2] + ldr r2, =0x02038437 + ldr r1, =0x0202420e + ldrb r1, [r1] + strb r1, [r2] + bl move_anim_task_del + pop {r0} + bx r0 + .pool + thumb_func_end sub_8117E94 + + thumb_func_start sub_8117EC4 +sub_8117EC4: @ 8117EC4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _08117EF8 + ldr r1, =0x0203841e + movs r0, 0x1 + b _08117EFC + .pool +_08117EF8: + ldr r1, =0x0203841e + movs r0, 0 +_08117EFC: + strh r0, [r1, 0xE] + adds r0, r5, 0 + bl move_anim_task_del + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8117EC4 + + thumb_func_start sub_8117F10 +sub_8117F10: @ 8117F10 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02038437 + ldr r1, =0x0202420c + ldrb r1, [r1] + strb r1, [r2] + bl move_anim_task_del + pop {r0} + bx r0 + .pool + thumb_func_end sub_8117F10 + + thumb_func_start sub_8117F30 +sub_8117F30: @ 8117F30 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02038436 + ldr r1, =0x0202420b + ldrb r1, [r1] + strb r1, [r2] + ldr r2, =0x02038437 + ldr r1, =0x0202420e + ldrb r1, [r1] + strb r1, [r2] + bl move_anim_task_del + pop {r0} + bx r0 + .pool + thumb_func_end sub_8117F30 + + thumb_func_start sub_8117F60 +sub_8117F60: @ 8117F60 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08117F78 + adds r0, r4, 0 + bl move_anim_task_del + b _08117FB4 +_08117F78: + ldr r0, =0x03005e00 + lsls r3, r4, 2 + adds r3, r4 + lsls r3, 3 + adds r3, r0 + ldr r0, =0x020244d0 + ldr r4, [r0] + ldr r2, =0x02038436 + ldrb r0, [r2] + ldr r1, [r4] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + lsls r0, 31 + lsrs r0, 31 + strh r0, [r3, 0x8] + ldrb r1, [r2] + ldr r0, [r4] + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x1 + orrs r0, r2 + strb r0, [r1] + ldr r0, =sub_8117FD0 + str r0, [r3] + ldr r1, =0x020383fe + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_08117FB4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8117F60 + + thumb_func_start sub_8117FD0 +sub_8117FD0: @ 8117FD0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0203841e + movs r2, 0xE + ldrsh r1, [r0, r2] + movs r0, 0x80 + lsls r0, 5 + cmp r1, r0 + bne _08118014 + ldr r0, =0x020244d0 + ldr r1, [r0] + ldr r0, =0x02038436 + ldrb r3, [r0] + ldr r0, [r1] + lsls r3, 2 + adds r3, r0 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0, 0x8] + movs r1, 0x1 + ands r1, r0 + ldrb r2, [r3] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + adds r0, r4, 0 + bl DestroyTask +_08118014: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8117FD0 + + thumb_func_start lcd_bg_operations +lcd_bg_operations: @ 811802C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r4, r2, 24 + cmp r6, 0x3 + bls _08118040 + b _08118132 +_08118040: + ldr r0, =gUnknown_0859741A + adds r0, r6, r0 + ldrb r0, [r0] + bl GetGpuReg + ldr r1, =0x0203a114 + strh r0, [r1] + cmp r5, 0x6 + bhi _08118124 + lsls r0, r5, 2 + ldr r1, =_08118068 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08118068: + .4byte _08118084 + .4byte _08118098 + .4byte _081180B0 + .4byte _081180C8 + .4byte _081180E0 + .4byte _081180FC + .4byte _08118110 +_08118084: + ldr r2, =0x0203a114 + lsls r3, r4, 6 + ldrb r1, [r2, 0x1] + movs r0, 0x3F + ands r0, r1 + orrs r0, r3 + strb r0, [r2, 0x1] + b _08118124 + .pool +_08118098: + ldr r3, =0x0203a114 + movs r0, 0x1 + adds r1, r4, 0 + ands r1, r0 + lsls r1, 5 + ldrb r2, [r3, 0x1] + movs r0, 0x21 + negs r0, r0 + b _0811811E + .pool +_081180B0: + ldr r3, =0x0203a114 + movs r0, 0x1 + adds r1, r4, 0 + ands r1, r0 + lsls r1, 6 + ldrb r2, [r3] + movs r0, 0x41 + negs r0, r0 + b _081180EE + .pool +_081180C8: + ldr r3, =0x0203a114 + movs r0, 0x3 + adds r1, r4, 0 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0xD + negs r0, r0 + b _081180EE + .pool +_081180E0: + ldr r3, =0x0203a114 + movs r0, 0x3 + adds r1, r4, 0 + ands r1, r0 + ldrb r2, [r3] + movs r0, 0x4 + negs r0, r0 +_081180EE: + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + b _08118124 + .pool +_081180FC: + ldr r2, =0x0203a114 + lsls r3, r4, 7 + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + orrs r0, r3 + strb r0, [r2] + b _08118124 + .pool +_08118110: + ldr r3, =0x0203a114 + movs r0, 0x1F + adds r1, r4, 0 + ands r1, r0 + ldrb r2, [r3, 0x1] + movs r0, 0x20 + negs r0, r0 +_0811811E: + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x1] +_08118124: + ldr r0, =gUnknown_0859741A + adds r0, r6, r0 + ldrb r0, [r0] + ldr r1, =0x0203a114 + ldrh r1, [r1] + bl SetGpuReg +_08118132: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end lcd_bg_operations + + thumb_func_start sub_8118140 +sub_8118140: @ 8118140 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r2, 0x3 + bhi _081181C8 + ldr r0, =gUnknown_0859741E + adds r0, r2, r0 + ldrb r0, [r0] + bl GetGpuReg + mov r1, sp + strh r0, [r1] + cmp r4, 0x6 + bhi _081181C8 + lsls r0, r4, 2 + ldr r1, =_08118174 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08118174: + .4byte _08118190 + .4byte _08118198 + .4byte _081181A0 + .4byte _081181A8 + .4byte _081181B0 + .4byte _081181B8 + .4byte _081181C0 +_08118190: + ldr r0, [sp] + lsls r0, 16 + lsrs r0, 30 + b _081181CA +_08118198: + ldr r0, [sp] + lsls r0, 18 + lsrs r0, 31 + b _081181CA +_081181A0: + ldr r0, [sp] + lsls r0, 25 + lsrs r0, 31 + b _081181CA +_081181A8: + ldr r0, [sp] + lsls r0, 28 + lsrs r0, 30 + b _081181CA +_081181B0: + ldr r0, [sp] + lsls r0, 30 + lsrs r0, 30 + b _081181CA +_081181B8: + ldr r0, [sp] + lsls r0, 24 + lsrs r0, 31 + b _081181CA +_081181C0: + ldr r0, [sp] + lsls r0, 19 + lsrs r0, 27 + b _081181CA +_081181C8: + movs r0, 0 +_081181CA: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8118140 + + thumb_func_start battle_intro_launch +battle_intro_launch: @ 81181D4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, =0x02022fec + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _08118208 + ldr r0, =0x02038bce + ldrh r1, [r0] + ldr r0, =0x00000c03 + cmp r1, r0 + beq _08118208 + ldr r0, =sub_8118D68 + b _08118258 + .pool +_08118208: + ldr r2, [r2] + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _0811821C + ldr r0, =task00_battle_intro_wireless + b _08118258 + .pool +_0811821C: + ldr r0, =0x003f0100 + ands r0, r2 + cmp r0, 0 + beq _08118230 + ldr r0, =task_battle_intro_anim + b _08118258 + .pool +_08118230: + movs r0, 0x80 + lsls r0, 5 + ands r2, r0 + cmp r2, 0 + beq _08118250 + ldr r0, =gUnknown_82E9530 + ldrb r0, [r0] + cmp r0, 0x2 + beq _08118250 + movs r4, 0x3 + ldr r0, =task00_battle_intro_80BC6C8 + b _08118258 + .pool +_08118250: + ldr r1, =gUnknown_08597424 + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] +_08118258: + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + movs r0, 0 + strh r0, [r1, 0x8] + strh r4, [r1, 0xA] + strh r0, [r1, 0xC] + strh r0, [r1, 0xE] + strh r0, [r1, 0x10] + strh r0, [r1, 0x12] + strh r0, [r1, 0x14] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end battle_intro_launch + + thumb_func_start sub_811828C +sub_811828C: @ 811828C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + ldr r0, =0x02022e18 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e1a + strh r1, [r0] + ldr r0, =0x02022e1c + strh r1, [r0] + ldr r0, =0x02022e1e + strh r1, [r0] + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + ldr r4, =0x00003f3f + movs r0, 0x48 + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x4A + adds r1, r4, 0 + bl SetGpuReg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811828C + + thumb_func_start task_battle_intro_80BC47C +task_battle_intro_80BC47C: @ 81182EC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x02022e18 + ldrh r0, [r1] + adds r0, 0x6 + strh r0, [r1] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + mov r8, r1 + cmp r0, 0x4 + bls _08118318 + b _0811852A +_08118318: + lsls r0, 2 + ldr r1, =_08118330 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08118330: + .4byte _08118344 + .4byte _08118374 + .4byte _0811839C + .4byte _081183E4 + .4byte _08118524 +_08118344: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08118360 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + add r0, r8 + movs r1, 0x10 + b _0811836A + .pool +_08118360: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + add r0, r8 + movs r1, 0x1 +_0811836A: + strh r1, [r0, 0xC] + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _0811852A +_08118374: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + mov r3, r8 + adds r1, r0, r3 + ldrh r0, [r1, 0xC] + subs r0, 0x1 + strh r0, [r1, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0811838C + b _0811852A +_0811838C: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + b _0811852A +_0811839C: + ldr r1, =0x02022e26 + ldrh r0, [r1] + subs r0, 0xFF + strh r0, [r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + movs r1, 0xC0 + lsls r1, 6 + cmp r0, r1 + beq _081183B4 + b _0811852A +_081183B4: + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + add r1, r8 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0xF0 + strh r0, [r1, 0xC] + movs r0, 0x20 + strh r0, [r1, 0xE] + ldr r2, =0x020243fc + ldrh r1, [r2] + ldr r0, =0x0000fffe + ands r0, r1 + strh r0, [r2] + b _0811852A + .pool +_081183E4: + lsls r0, r4, 2 + adds r1, r0, r4 + lsls r1, 3 + mov r5, r8 + adds r2, r1, r5 + ldrh r3, [r2, 0xE] + movs r5, 0xE + ldrsh r1, [r2, r5] + mov r12, r0 + cmp r1, 0 + beq _08118400 + subs r0, r3, 0x1 + strh r0, [r2, 0xE] + b _0811842E +_08118400: + movs r1, 0xA + ldrsh r0, [r2, r1] + cmp r0, 0x1 + bne _08118420 + ldr r2, =0x02022e1a + ldrh r1, [r2] + ldr r0, =0x0000ffb0 + cmp r1, r0 + beq _0811842E + subs r0, r1, 0x2 + b _0811842C + .pool +_08118420: + ldr r2, =0x02022e1a + ldrh r1, [r2] + ldr r0, =0x0000ffc8 + cmp r1, r0 + beq _0811842E + subs r0, r1, 0x1 +_0811842C: + strh r0, [r2] +_0811842E: + ldr r2, =0x02022e26 + ldrh r1, [r2] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _08118442 + ldr r3, =0xfffffc04 + adds r0, r1, r3 + strh r0, [r2] +_08118442: + mov r5, r12 + adds r0, r5, r4 + lsls r0, 3 + mov r2, r8 + adds r1, r0, r2 + ldrh r2, [r1, 0xC] + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _0811845A + subs r0, r2, 0x2 + strh r0, [r1, 0xC] +_0811845A: + movs r3, 0 + ldr r5, =0x02039b28 + mov r9, r5 + ldr r7, =0x02038c28 + mov r6, r9 + adds r5, r1, 0 +_08118466: + lsls r2, r3, 1 + ldrb r1, [r6, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r7 + ldrh r0, [r5, 0xC] + strh r0, [r2] + adds r3, 0x1 + cmp r3, 0x4F + ble _08118466 + cmp r3, 0x9F + bgt _081184AA + ldr r7, =0x02038c28 + ldr r6, =0x02039b28 + ldr r1, =0x03005e00 + mov r2, r12 + adds r0, r2, r4 + lsls r0, 3 + adds r5, r0, r1 +_08118490: + lsls r2, r3, 1 + ldrb r1, [r6, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r7 + ldrh r0, [r5, 0xC] + negs r0, r0 + strh r0, [r2] + adds r3, 0x1 + cmp r3, 0x9F + ble _08118490 +_081184AA: + mov r3, r12 + adds r0, r3, r4 + lsls r0, 3 + mov r5, r8 + adds r1, r0, r5 + movs r0, 0xC + ldrsh r2, [r1, r0] + cmp r2, 0 + bne _0811852A + movs r0, 0x3 + mov r3, r9 + strb r0, [r3, 0x15] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + str r2, [sp] + ldr r1, =0x0600e000 + ldr r2, =0x05000200 + mov r0, sp + bl CpuSet + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl SetBgAttribute + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + bl SetBgAttribute + movs r1, 0x9C + lsls r1, 8 + movs r0, 0xA + bl SetGpuReg + movs r1, 0xBC + lsls r1, 7 + movs r0, 0xC + bl SetGpuReg + b _0811852A + .pool +_08118524: + adds r0, r4, 0 + bl sub_811828C +_0811852A: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end task_battle_intro_80BC47C + + thumb_func_start task00_battle_intro_80BC6C8 +task00_battle_intro_80BC6C8: @ 8118538 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0xA + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x3 + beq _08118578 + cmp r0, 0x3 + bgt _08118568 + cmp r0, 0x2 + beq _0811856C + b _08118580 + .pool +_08118568: + cmp r0, 0x4 + bne _08118580 +_0811856C: + ldr r1, =0x02022e18 + ldrh r0, [r1] + adds r0, 0x8 + b _0811857E + .pool +_08118578: + ldr r1, =0x02022e18 + ldrh r0, [r1] + adds r0, 0x6 +_0811857E: + strh r0, [r1] +_08118580: + lsls r0, r5, 2 + adds r1, r0, r5 + lsls r1, 3 + adds r4, r1, r2 + movs r3, 0xA + ldrsh r1, [r4, r3] + adds r6, r0, 0 + cmp r1, 0x4 + bne _081185E4 + ldr r7, =0x02022e1a + ldrh r0, [r4, 0x14] + bl cosine2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _081185A6 + ldr r1, =0x000001ff + adds r0, r1 +_081185A6: + asrs r0, 9 + subs r0, 0x8 + strh r0, [r7] + ldrh r1, [r4, 0x14] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0xB3 + bgt _081185C8 + adds r0, r1, 0x4 + b _081185CA + .pool +_081185C8: + adds r0, r1, 0x6 +_081185CA: + strh r0, [r4, 0x14] + ldr r2, =0x03005e00 + adds r0, r6, r5 + lsls r0, 3 + adds r3, r0, r2 + movs r0, 0x14 + ldrsh r1, [r3, r0] + movs r0, 0xB4 + lsls r0, 1 + cmp r1, r0 + bne _081185E4 + movs r0, 0 + strh r0, [r3, 0x14] +_081185E4: + adds r0, r6, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0x4 + bls _081185F4 + b _0811881A +_081185F4: + lsls r0, 2 + ldr r1, =_08118608 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08118608: + .4byte _0811861C + .4byte _0811864C + .4byte _08118678 + .4byte _081186C8 + .4byte _08118814 +_0811861C: + ldr r1, =0x03005e00 + adds r0, r6, r5 + lsls r0, 3 + adds r2, r0, r1 + movs r3, 0x10 + strh r3, [r2, 0x10] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08118640 + strh r3, [r2, 0xC] + b _08118644 + .pool +_08118640: + movs r0, 0x1 + strh r0, [r2, 0xC] +_08118644: + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + b _0811881A +_0811864C: + ldr r0, =0x03005e00 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0xC] + subs r0, 0x1 + strh r0, [r1, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _08118662 + b _0811881A +_08118662: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + b _0811881A + .pool +_08118678: + ldr r1, =0x02022e26 + ldrh r0, [r1] + subs r0, 0xFF + strh r0, [r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + movs r1, 0xC0 + lsls r1, 6 + cmp r0, r1 + beq _08118690 + b _0811881A +_08118690: + ldr r0, =0x03005e00 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0xF0 + strh r0, [r1, 0xC] + movs r0, 0x20 + strh r0, [r1, 0xE] + movs r0, 0x1 + strh r0, [r1, 0x12] + ldr r2, =0x020243fc + ldrh r1, [r2] + ldr r0, =0x0000fffe + ands r0, r1 + strh r0, [r2] + b _0811881A + .pool +_081186C8: + ldr r0, =0x03005e00 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + ldrh r2, [r1, 0xE] + movs r3, 0xE + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _08118708 + subs r0, r2, 0x1 + strh r0, [r1, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _08118728 + ldr r1, =0x00001842 + movs r0, 0x50 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0xF + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + b _08118728 + .pool +_08118708: + ldrh r2, [r1, 0x10] + movs r0, 0x1F + ands r0, r2 + cmp r0, 0 + beq _08118728 + ldrh r0, [r1, 0x12] + subs r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + cmp r0, 0 + bne _08118728 + adds r0, r2, 0 + adds r0, 0xFF + strh r0, [r1, 0x10] + movs r0, 0x4 + strh r0, [r1, 0x12] +_08118728: + ldr r2, =0x02022e26 + ldrh r1, [r2] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _0811873C + ldr r3, =0xfffffc04 + adds r0, r1, r3 + strh r0, [r2] +_0811873C: + ldr r0, =0x03005e00 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + ldrh r2, [r1, 0xC] + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _08118752 + subs r0, r2, 0x2 + strh r0, [r1, 0xC] +_08118752: + movs r3, 0 + ldr r0, =0x02039b28 + mov r8, r0 + ldr r2, =0x02038c28 + mov r12, r2 + mov r7, r8 + adds r4, r1, 0 +_08118760: + lsls r2, r3, 1 + ldrb r1, [r7, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + add r2, r12 + ldrh r0, [r4, 0xC] + strh r0, [r2] + adds r3, 0x1 + cmp r3, 0x4F + ble _08118760 + cmp r3, 0x9F + bgt _081187A4 + ldr r0, =0x02038c28 + mov r12, r0 + ldr r7, =0x02039b28 + ldr r1, =0x03005e00 + adds r0, r6, r5 + lsls r0, 3 + adds r4, r0, r1 +_0811878A: + lsls r2, r3, 1 + ldrb r1, [r7, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + add r2, r12 + ldrh r0, [r4, 0xC] + negs r0, r0 + strh r0, [r2] + adds r3, 0x1 + cmp r3, 0x9F + ble _0811878A +_081187A4: + ldr r1, =0x03005e00 + adds r0, r6, r5 + lsls r0, 3 + adds r1, r0, r1 + movs r3, 0xC + ldrsh r2, [r1, r3] + cmp r2, 0 + bne _0811881A + movs r0, 0x3 + mov r3, r8 + strb r0, [r3, 0x15] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + str r2, [sp] + ldr r1, =0x0600e000 + ldr r2, =0x05000200 + mov r0, sp + bl CpuSet + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl SetBgAttribute + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + bl SetBgAttribute + movs r1, 0x9C + lsls r1, 8 + movs r0, 0xA + bl SetGpuReg + movs r1, 0xBC + lsls r1, 7 + movs r0, 0xC + bl SetGpuReg + b _0811881A + .pool +_08118814: + adds r0, r5, 0 + bl sub_811828C +_0811881A: + ldr r0, =0x03005e00 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0x4 + beq _08118832 + ldrh r1, [r1, 0x10] + movs r0, 0x52 + bl SetGpuReg +_08118832: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end task00_battle_intro_80BC6C8 + + thumb_func_start task_battle_intro_anim +task_battle_intro_anim: @ 8118844 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x02022e18 + ldrh r0, [r1] + adds r0, 0x8 + strh r0, [r1] + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r4, r1, 0 + cmp r0, 0x4 + bls _0811886E + b _08118A96 +_0811886E: + lsls r0, 2 + ldr r1, =_08118884 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08118884: + .4byte _08118898 + .4byte _081188F0 + .4byte _0811891C + .4byte _0811896C + .4byte _08118A90 +_08118898: + ldr r1, =0x00001842 + movs r0, 0x50 + bl SetGpuReg + ldr r4, =0x00000808 + movs r0, 0x52 + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r2, r0, r1 + strh r4, [r2, 0x10] + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x02000002 + ands r0, r1 + cmp r0, 0 + beq _081188E4 + movs r0, 0x10 + b _081188E6 + .pool +_081188E4: + movs r0, 0x1 +_081188E6: + strh r0, [r2, 0xC] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + b _08118A96 +_081188F0: + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0xC] + subs r0, 0x1 + strh r0, [r1, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _08118908 + b _08118A96 +_08118908: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + b _08118A96 + .pool +_0811891C: + ldr r1, =0x02022e26 + ldrh r0, [r1] + subs r0, 0xFF + strh r0, [r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + movs r1, 0xC0 + lsls r1, 6 + cmp r0, r1 + beq _08118934 + b _08118A96 +_08118934: + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0xF0 + strh r0, [r1, 0xC] + movs r0, 0x20 + strh r0, [r1, 0xE] + movs r0, 0x1 + strh r0, [r1, 0x12] + ldr r2, =0x020243fc + ldrh r1, [r2] + ldr r0, =0x0000fffe + ands r0, r1 + strh r0, [r2] + b _08118A96 + .pool +_0811896C: + lsls r0, r5, 2 + adds r1, r0, r5 + lsls r1, 3 + adds r2, r1, r4 + ldrh r3, [r2, 0xE] + movs r6, 0xE + ldrsh r1, [r2, r6] + mov r12, r0 + cmp r1, 0 + beq _08118986 + subs r0, r3, 0x1 + strh r0, [r2, 0xE] + b _081189A6 +_08118986: + ldrh r1, [r2, 0x10] + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + beq _081189A6 + ldrh r0, [r2, 0x12] + subs r0, 0x1 + strh r0, [r2, 0x12] + lsls r0, 16 + cmp r0, 0 + bne _081189A6 + adds r0, r1, 0 + adds r0, 0xFF + strh r0, [r2, 0x10] + movs r0, 0x6 + strh r0, [r2, 0x12] +_081189A6: + ldr r2, =0x02022e26 + ldrh r1, [r2] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _081189BA + ldr r3, =0xfffffc04 + adds r0, r1, r3 + strh r0, [r2] +_081189BA: + mov r6, r12 + adds r0, r6, r5 + lsls r0, 3 + adds r1, r0, r4 + ldrh r2, [r1, 0xC] + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _081189D0 + subs r0, r2, 0x2 + strh r0, [r1, 0xC] +_081189D0: + movs r3, 0 + ldr r6, =0x02039b28 + mov r8, r6 + ldr r7, =0x02038c28 + adds r4, r1, 0 +_081189DA: + lsls r2, r3, 1 + ldrb r1, [r6, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r7 + ldrh r0, [r4, 0xC] + strh r0, [r2] + adds r3, 0x1 + cmp r3, 0x4F + ble _081189DA + cmp r3, 0x9F + bgt _08118A1E + ldr r7, =0x02038c28 + ldr r6, =0x02039b28 + ldr r1, =0x03005e00 + mov r2, r12 + adds r0, r2, r5 + lsls r0, 3 + adds r4, r0, r1 +_08118A04: + lsls r2, r3, 1 + ldrb r1, [r6, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r7 + ldrh r0, [r4, 0xC] + negs r0, r0 + strh r0, [r2] + adds r3, 0x1 + cmp r3, 0x9F + ble _08118A04 +_08118A1E: + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r1, r0, r1 + movs r3, 0xC + ldrsh r2, [r1, r3] + cmp r2, 0 + bne _08118A96 + movs r0, 0x3 + mov r6, r8 + strb r0, [r6, 0x15] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + str r2, [sp] + ldr r1, =0x0600e000 + ldr r2, =0x05000200 + mov r0, sp + bl CpuSet + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl SetBgAttribute + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + bl SetBgAttribute + movs r1, 0x9C + lsls r1, 8 + movs r0, 0xA + bl SetGpuReg + movs r1, 0xBC + lsls r1, 7 + movs r0, 0xC + bl SetGpuReg + b _08118A96 + .pool +_08118A90: + adds r0, r5, 0 + bl sub_811828C +_08118A96: + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0x4 + beq _08118AB0 + ldrh r1, [r1, 0x10] + movs r0, 0x52 + bl SetGpuReg +_08118AB0: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end task_battle_intro_anim + + thumb_func_start task00_battle_intro_wireless +task00_battle_intro_wireless: @ 8118AC0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r7, r0, r1 + movs r1, 0x8 + ldrsh r0, [r7, r1] + cmp r0, 0x1 + ble _08118B36 + movs r2, 0x10 + ldrsh r0, [r7, r2] + cmp r0, 0 + bne _08118B36 + ldr r2, =0x02022e18 + ldrh r1, [r2] + movs r0, 0x80 + lsls r0, 8 + ands r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + bne _08118AFE + cmp r1, 0x4F + bhi _08118B18 +_08118AFE: + adds r0, r1, 0x3 + strh r0, [r2] + ldr r1, =0x02022e1c + ldrh r0, [r1] + subs r0, 0x3 + strh r0, [r1] + b _08118B36 + .pool +_08118B18: + str r5, [sp] + ldr r1, =0x0600e000 + ldr r4, =0x05000200 + mov r0, sp + adds r2, r4, 0 + bl CpuSet + str r5, [sp, 0x4] + add r0, sp, 0x4 + ldr r1, =0x0600f000 + adds r2, r4, 0 + bl CpuSet + movs r0, 0x1 + strh r0, [r7, 0x10] +_08118B36: + ldr r0, =0x03005e00 + lsls r2, r6, 2 + adds r1, r2, r6 + lsls r1, 3 + adds r1, r0 + movs r3, 0x8 + ldrsh r1, [r1, r3] + mov r9, r0 + adds r5, r2, 0 + cmp r1, 0x4 + bls _08118B4E + b _08118D5A +_08118B4E: + lsls r0, r1, 2 + ldr r1, =_08118B6C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08118B6C: + .4byte _08118B80 + .4byte _08118B92 + .4byte _08118C38 + .4byte _08118C7C + .4byte _08118D54 +_08118B80: + adds r0, r5, r6 + lsls r0, 3 + add r0, r9 + movs r1, 0x20 + strh r1, [r0, 0xC] + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _08118D5A +_08118B92: + adds r0, r5, r6 + lsls r0, 3 + mov r2, r9 + adds r1, r0, r2 + ldrh r0, [r1, 0xC] + subs r0, 0x1 + strh r0, [r1, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _08118BA8 + b _08118D5A +_08118BA8: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + ldr r4, =0x02020630 + ldr r5, =0x0202449c + ldr r0, [r5] + adds r0, 0x7D + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r3, [r1, 0x1] + movs r2, 0xD + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + movs r3, 0x8 + mov r9, r3 + mov r3, r9 + orrs r0, r3 + strb r0, [r1, 0x1] + ldr r3, [r5] + adds r0, r3, 0 + adds r0, 0x7D + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + movs r1, 0x1C + adds r1, r4 + mov r8, r1 + add r0, r8 + ldr r6, =sub_8038B74 + str r6, [r0] + adds r3, 0x7E + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x1] + ands r2, r1 + mov r3, r9 + orrs r2, r3 + strb r2, [r0, 0x1] + ldr r0, [r5] + adds r0, 0x7E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + str r6, [r0] + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + ldr r1, =0x00003f06 + movs r0, 0x4A + bl SetGpuReg + b _08118D5A + .pool +_08118C38: + ldr r1, =0x02022e26 + ldrh r0, [r1] + subs r0, 0xFF + strh r0, [r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + movs r1, 0xC0 + lsls r1, 6 + cmp r0, r1 + beq _08118C50 + b _08118D5A +_08118C50: + adds r1, r5, r6 + lsls r1, 3 + add r1, r9 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0xF0 + strh r0, [r1, 0xC] + movs r0, 0x20 + strh r0, [r1, 0xE] + ldr r2, =0x020243fc + ldrh r1, [r2] + ldr r0, =0x0000fffe + ands r0, r1 + strh r0, [r2] + b _08118D5A + .pool +_08118C7C: + ldr r2, =0x02022e26 + ldrh r1, [r2] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _08118C90 + ldr r3, =0xfffffc04 + adds r0, r1, r3 + strh r0, [r2] +_08118C90: + adds r0, r5, r6 + lsls r0, 3 + mov r2, r9 + adds r1, r0, r2 + ldrh r2, [r1, 0xC] + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _08118CA6 + subs r0, r2, 0x2 + strh r0, [r1, 0xC] +_08118CA6: + movs r3, 0 + ldr r0, =0x02039b28 + mov r12, r0 + ldr r2, =0x02038c28 + mov r8, r2 + mov r7, r12 + adds r4, r1, 0 +_08118CB4: + lsls r2, r3, 1 + ldrb r1, [r7, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + add r2, r8 + ldrh r0, [r4, 0xC] + strh r0, [r2] + adds r3, 0x1 + cmp r3, 0x4F + ble _08118CB4 + cmp r3, 0x9F + bgt _08118CF8 + ldr r0, =0x02038c28 + mov r8, r0 + ldr r7, =0x02039b28 + ldr r1, =0x03005e00 + adds r0, r5, r6 + lsls r0, 3 + adds r4, r0, r1 +_08118CDE: + lsls r2, r3, 1 + ldrb r1, [r7, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + add r2, r8 + ldrh r0, [r4, 0xC] + negs r0, r0 + strh r0, [r2] + adds r3, 0x1 + cmp r3, 0x9F + ble _08118CDE +_08118CF8: + adds r0, r5, r6 + lsls r0, 3 + mov r2, r9 + adds r1, r0, r2 + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _08118D5A + movs r0, 0x3 + mov r2, r12 + strb r0, [r2, 0x15] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl SetBgAttribute + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + bl SetBgAttribute + movs r1, 0x9C + lsls r1, 8 + movs r0, 0xA + bl SetGpuReg + movs r1, 0xBC + lsls r1, 7 + movs r0, 0xC + bl SetGpuReg + b _08118D5A + .pool +_08118D54: + adds r0, r6, 0 + bl sub_811828C +_08118D5A: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end task00_battle_intro_wireless + + thumb_func_start sub_8118D68 +sub_8118D68: @ 8118D68 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r6, r1, 0 + cmp r0, 0x5 + bls _08118D86 + b _08118FB2 +_08118D86: + lsls r0, 2 + ldr r1, =_08118D98 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08118D98: + .4byte _08118DB0 + .4byte _08118DBE + .4byte _08118E4C + .4byte _08118EA8 + .4byte _08118F00 + .4byte _08118FAC +_08118DB0: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r6 + movs r1, 0x1 + strh r1, [r0, 0xC] + b _08118F84 +_08118DBE: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r6 + ldrh r0, [r1, 0xC] + subs r0, 0x1 + strh r0, [r1, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _08118DD4 + b _08118FB2 +_08118DD4: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + ldr r1, =0x00005c0a + movs r0, 0xA + bl SetGpuReg + ldr r1, =0x00005e0a + movs r0, 0xC + bl SetGpuReg + movs r0, 0 + bl GetGpuReg + adds r1, r0, 0 + ldr r2, =0x0000f040 + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0 + bl SetGpuReg + movs r1, 0xF8 + lsls r1, 6 + movs r0, 0x48 + bl SetGpuReg + ldr r1, =0x00003f3f + movs r0, 0x4A + bl SetGpuReg + ldr r1, =0x02022e16 + ldr r2, =0x0000ffd0 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, =0x02022e18 + movs r0, 0xF0 + strh r0, [r1] + ldr r1, =0x02022e1c + subs r2, 0xC0 + adds r0, r2, 0 + strh r0, [r1] + b _08118FB2 + .pool +_08118E4C: + ldr r2, =0x02022e26 + ldrh r3, [r2] + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + adds r1, r3, r0 + strh r1, [r2] + movs r5, 0xFF + lsls r5, 8 + ands r1, r5 + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + beq _08118E6E + adds r0, r3, 0 + adds r0, 0xFF + strh r0, [r2] +_08118E6E: + ldrh r0, [r2] + adds r1, r5, 0 + ands r1, r0 + movs r0, 0x80 + lsls r0, 6 + cmp r1, r0 + beq _08118E7E + b _08118FB2 +_08118E7E: + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r6 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0xF0 + strh r0, [r1, 0xC] + ldr r2, =0x020243fc + ldrh r1, [r2] + ldr r0, =0x0000fffe + ands r0, r1 + strh r0, [r2] + b _08118FB2 + .pool +_08118EA8: + ldr r3, =0x02022e26 + ldrh r2, [r3] + movs r0, 0xFF + lsls r0, 8 + ands r0, r2 + movs r1, 0x98 + lsls r1, 7 + cmp r0, r1 + beq _08118EC2 + movs r1, 0xFF + lsls r1, 2 + adds r0, r2, r1 + strh r0, [r3] +_08118EC2: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r3, r0, r6 + ldrh r1, [r3, 0xC] + movs r2, 0xC + ldrsh r0, [r3, r2] + cmp r0, 0 + beq _08118ED8 + subs r0, r1, 0x2 + strh r0, [r3, 0xC] +_08118ED8: + ldr r1, =0x02022e18 + ldrh r0, [r3, 0xC] + strh r0, [r1] + ldr r2, =0x02022e1c + negs r1, r0 + strh r1, [r2] + lsls r0, 16 + cmp r0, 0 + bne _08118FB2 + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] + b _08118FB2 + .pool +_08118F00: + ldr r1, =0x02022e16 + ldrh r0, [r1] + adds r3, r0, 0x2 + strh r3, [r1] + ldr r1, =0x02022e1e + ldrh r0, [r1] + adds r0, 0x2 + strh r0, [r1] + ldr r5, =0x02022e26 + ldrh r2, [r5] + movs r0, 0xFF + lsls r0, 8 + ands r0, r2 + movs r1, 0xA0 + lsls r1, 7 + cmp r0, r1 + beq _08118F28 + adds r0, r2, 0 + adds r0, 0xFF + strh r0, [r5] +_08118F28: + lsls r0, r3, 16 + lsrs r0, 16 + cmp r0, 0 + bne _08118FB2 + str r0, [sp] + ldr r1, =0x0600e000 + ldr r2, =0x05000800 + mov r0, sp + bl CpuSet + movs r0, 0 + bl GetGpuReg + ldr r1, =0x0000bfff + ands r1, r0 + movs r0, 0 + bl SetGpuReg + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl SetBgAttribute + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + bl SetBgAttribute + movs r1, 0x9C + lsls r1, 8 + movs r0, 0xA + bl SetGpuReg + movs r1, 0xBC + lsls r1, 7 + movs r0, 0xC + bl SetGpuReg + ldr r1, =0x02039b28 + movs r0, 0x3 + strb r0, [r1, 0x15] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 +_08118F84: + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _08118FB2 + .pool +_08118FAC: + adds r0, r4, 0 + bl sub_811828C +_08118FB2: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8118D68 + + thumb_func_start sub_8118FBC +sub_8118FBC: @ 8118FBC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + str r0, [sp] + adds r6, r2, 0 + adds r4, r3, 0 + ldr r0, [sp, 0x24] + ldr r7, [sp, 0x28] + ldr r2, [sp, 0x2C] + mov r9, r2 + ldr r5, [sp, 0x30] + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020244d4 + ldr r2, [r1] + lsls r4, 2 + adds r2, 0x4 + adds r2, r4 + ldr r1, =0x020244e4 + adds r0, r1 + ldrb r1, [r0] + lsls r1, 11 + ldr r0, [r2] + adds r0, r1 + movs r2, 0x80 + lsls r2, 3 + adds r1, r7, 0 + bl CpuSet + ldr r1, [sp] + lsls r0, r1, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 5 + adds r1, r7, 0 + adds r3, r5, 0 + bl LoadBgTiles + adds r0, r6, 0 + adds r0, 0x8 + cmp r6, r0 + bge _08119068 + mov r12, r0 + mov r2, r8 + lsls r7, r2, 1 +_0811903A: + mov r1, r8 + adds r2, r1, 0 + adds r2, 0x8 + adds r4, r6, 0x1 + cmp r1, r2 + bge _08119062 + mov r0, r10 + lsls r3, r0, 12 + lsls r0, r6, 6 + add r0, r9 + adds r6, r7, r0 + subs r1, r2, r1 +_08119052: + adds r0, r5, 0 + orrs r0, r3 + strh r0, [r6] + adds r5, 0x1 + adds r6, 0x2 + subs r1, 0x1 + cmp r1, 0 + bne _08119052 +_08119062: + adds r6, r4, 0 + cmp r6, r12 + blt _0811903A +_08119068: + ldr r1, [sp] + lsls r0, r1, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 4 + mov r1, r9 + movs r3, 0 + bl LoadBgTilemap + 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_8118FBC + + thumb_func_start sub_8119094 +sub_8119094: @ 8119094 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r4, [sp, 0x24] + ldr r5, [sp, 0x28] + mov r8, r5 + ldr r5, [sp, 0x2C] + ldr r6, [sp, 0x30] + mov r9, r6 + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + lsls r1, 24 + lsls r2, 24 + lsls r3, 24 + lsls r4, 24 + lsrs r4, 24 + mov r10, r4 + mov r7, r8 + lsls r7, 16 + lsrs r6, r7, 16 + lsls r5, 24 + lsrs r5, 24 + mov r0, r9 + lsls r0, 24 + mov r9, r0 + ldr r4, =0x040000d4 + ldr r0, =0x020244d4 + ldr r0, [r0] + lsrs r2, 22 + adds r0, 0x4 + adds r0, r2 + lsrs r3, 13 + ldr r0, [r0] + adds r0, r3 + str r0, [r4] + movs r0, 0xC0 + lsls r0, 19 + adds r6, r0 + str r6, [r4, 0x4] + ldr r0, =0x80000400 + str r0, [r4, 0x8] + ldr r0, [r4, 0x8] + adds r2, r7, 0 + lsrs r2, 21 + mov r6, r9 + lsrs r6, 15 + subs r4, r2, r6 + lsrs r0, r1, 24 + adds r1, r0, 0 + adds r1, 0x8 + cmp r0, r1 + bge _08119148 + mov r9, r1 + mov r7, r12 + lsls r7, 1 + mov r8, r7 + lsls r5, 11 + str r5, [sp] +_08119110: + mov r2, r12 + adds r3, r2, 0 + adds r3, 0x8 + adds r5, r0, 0x1 + cmp r2, r3 + bge _08119142 + mov r1, r10 + lsls r6, r1, 12 + lsls r0, 6 + movs r7, 0xC0 + lsls r7, 19 + adds r0, r7 + ldr r1, [sp] + adds r0, r1, r0 + mov r7, r8 + adds r1, r7, r0 + subs r2, r3, r2 +_08119132: + adds r0, r4, 0 + orrs r0, r6 + strh r0, [r1] + adds r4, 0x1 + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bne _08119132 +_08119142: + adds r0, r5, 0 + cmp r0, r9 + blt _08119110 +_08119148: + 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_8119094 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/battle_message.s b/asm/battle_message.s new file mode 100644 index 000000000..ffd9a1d0f --- /dev/null +++ b/asm/battle_message.s @@ -0,0 +1,3089 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start battle_pick_message +battle_pick_message: @ 814E0C4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r6, r0, 16 + movs r7, 0 + ldr r4, =0x0203aba8 + ldr r0, =0x02024064 + mov r8, r0 + ldrb r1, [r0] + lsls r1, 9 + ldr r0, =0x02023068 + adds r1, r0 + str r1, [r4] + ldr r2, =0x02024208 + ldrh r0, [r1, 0x4] + strh r0, [r2] + ldr r2, =0x0202420a + ldrb r0, [r1, 0x6] + strb r0, [r2] + ldr r5, =0x02024474 + ldrb r0, [r1, 0x7] + strb r0, [r5, 0x17] + ldr r3, =0x0202449c + ldr r0, [r3] + adds r0, 0x52 + ldrb r1, [r1, 0x8] + strb r1, [r0] + ldr r0, [r3] + adds r0, 0xB1 + ldr r1, [r4] + ldrb r1, [r1, 0x9] + strb r1, [r0] + ldr r1, =0x0202420f + ldr r2, [r4] + ldrb r0, [r2, 0xA] + strb r0, [r1] + ldr r0, [r3] + adds r0, 0x8E + ldrb r1, [r2, 0xB] + strb r1, [r0] + movs r2, 0 + mov r12, r8 + mov r9, r5 + ldr r1, =0x02022f58 + mov r10, r1 + ldr r3, =0x0203aba4 +_0814E126: + adds r0, r2, r3 + ldr r1, [r4] + adds r1, 0xC + adds r1, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x3 + ble _0814E126 + movs r2, 0 + ldr r0, =0x02022f58 + mov r8, r0 + ldr r3, =0x0203aba8 + ldr r5, =0x02022f68 + ldr r4, =0x02022f78 +_0814E144: + mov r0, r8 + adds r1, r2, r0 + ldr r0, [r3] + adds r0, 0x10 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r2, r5 + ldr r0, [r3] + adds r0, 0x20 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r2, r4 + ldr r0, [r3] + adds r0, 0x30 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r2, 0x1 + cmp r2, 0xF + ble _0814E144 + cmp r6, 0x5 + bls _0814E176 + b _0814E6B8 +_0814E176: + lsls r0, r6, 2 + ldr r1, =_0814E1B4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0814E1B4: + .4byte _0814E1CC + .4byte _0814E2AC + .4byte _0814E394 + .4byte _0814E430 + .4byte _0814E4F8 + .4byte _0814E55C +_0814E1CC: + ldr r0, =0x02022fec + ldr r2, [r0] + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _0814E26C + ldr r0, =0x02000002 + ands r0, r2 + cmp r0, 0 + beq _0814E248 + movs r0, 0x80 + lsls r0, 16 + ands r0, r2 + cmp r0, 0 + bne _0814E260 + movs r0, 0x40 + ands r0, r2 + cmp r0, 0 + beq _0814E214 + movs r0, 0x80 + lsls r0, 17 + ands r2, r0 + ldr r7, =gUnknown_085CBBCD + cmp r2, 0 + bne _0814E200 + b _0814E6D8 +_0814E200: + ldr r7, =gUnknown_085CD318 + b _0814E6D8 + .pool +_0814E214: + ldr r0, =0x02038bca + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 4 + cmp r1, r0 + bne _0814E22C + ldr r7, =gUnknown_085CBB9C + b _0814E6D8 + .pool +_0814E22C: + movs r0, 0x80 + lsls r0, 17 + ands r2, r0 + ldr r7, =gUnknown_085CBBB9 + cmp r2, 0 + bne _0814E23A + b _0814E6D8 +_0814E23A: + ldr r7, =gUnknown_085CD301 + b _0814E6D8 + .pool +_0814E248: + movs r0, 0x80 + lsls r0, 15 + ands r0, r2 + cmp r0, 0 + bne _0814E260 + movs r0, 0x80 + lsls r0, 8 + ands r2, r0 + ldr r7, =gUnknown_085CBB9C + cmp r2, 0 + bne _0814E260 + b _0814E6D8 +_0814E260: + ldr r7, =gUnknown_085CCE17 + b _0814E6D8 + .pool +_0814E26C: + movs r0, 0x80 + lsls r0, 6 + ands r0, r2 + cmp r0, 0 + beq _0814E280 + ldr r7, =gUnknown_085CBB5A + b _0814E6D8 + .pool +_0814E280: + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _0814E290 + ldr r7, =gUnknown_085CBB82 + b _0814E6D8 + .pool +_0814E290: + movs r0, 0x80 + lsls r0, 2 + ands r2, r0 + ldr r7, =gUnknown_085CBB47 + cmp r2, 0 + bne _0814E29E + b _0814E6D8 +_0814E29E: + ldr r7, =gUnknown_085CBB6D + b _0814E6D8 + .pool +_0814E2AC: + mov r1, r12 + ldrb r0, [r1] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0814E310 + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0814E308 + movs r0, 0x80 + lsls r0, 15 + ands r0, r1 + cmp r0, 0 + beq _0814E2DC + ldr r7, =gUnknown_085CCE38 + b _0814E6D8 + .pool +_0814E2DC: + movs r0, 0x80 + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _0814E2F0 + ldr r7, =gUnknown_085CBC96 + b _0814E6D8 + .pool +_0814E2F0: + movs r0, 0x40 + ands r1, r0 + ldr r7, =gUnknown_085CBC96 + cmp r1, 0 + bne _0814E2FC + b _0814E6D8 +_0814E2FC: + ldr r7, =gUnknown_085CBCE5 + b _0814E6D8 + .pool +_0814E308: + ldr r7, =gUnknown_085CBC8E + b _0814E6D8 + .pool +_0814E310: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0814E368 + movs r0, 0x80 + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + bne _0814E330 + movs r0, 0x80 + lsls r0, 16 + ands r0, r1 + cmp r0, 0 + beq _0814E33C +_0814E330: + ldr r7, =gUnknown_085CCDDE + b _0814E6D8 + .pool +_0814E33C: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0814E34C + ldr r7, =gUnknown_085CBC4E + b _0814E6D8 + .pool +_0814E34C: + ldr r0, =0x02000002 + ands r1, r0 + ldr r7, =gUnknown_085CBBFA + cmp r1, 0 + bne _0814E358 + b _0814E6D8 +_0814E358: + ldr r7, =gUnknown_085CBC37 + b _0814E6D8 + .pool +_0814E368: + ldr r0, =0x02000002 + ands r1, r0 + cmp r1, 0 + beq _0814E380 + ldr r0, =0x02038bca + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 4 + ldr r7, =gUnknown_085CBC27 + cmp r1, r0 + beq _0814E380 + b _0814E6D8 +_0814E380: + ldr r7, =gUnknown_085CBBE7 + b _0814E6D8 + .pool +_0814E394: + mov r1, r12 + ldrb r0, [r1] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0814E3EC + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0xB1 + ldrb r2, [r0] + cmp r2, 0 + bne _0814E3BC + ldr r7, =gUnknown_085CBCFD + b _0814E6D8 + .pool +_0814E3BC: + cmp r2, 0x1 + beq _0814E3CC + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0814E3D8 +_0814E3CC: + ldr r7, =gUnknown_085CBD1B + b _0814E6D8 + .pool +_0814E3D8: + ldr r7, =gUnknown_085CBD3D + cmp r2, 0x2 + beq _0814E3E0 + b _0814E6D8 +_0814E3E0: + ldr r7, =gUnknown_085CBD2A + b _0814E6D8 + .pool +_0814E3EC: + ldr r0, =0x02038bca + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 4 + ldr r2, =0x02022fec + cmp r1, r0 + beq _0814E406 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _0814E428 +_0814E406: + ldr r0, [r2] + movs r1, 0x40 + ands r0, r1 + ldr r7, =gUnknown_085CBD65 + cmp r0, 0 + bne _0814E414 + b _0814E6D8 +_0814E414: + ldr r7, =gUnknown_085CBD75 + b _0814E6D8 + .pool +_0814E428: + ldr r7, =gUnknown_085CBD52 + b _0814E6D8 + .pool +_0814E430: + mov r4, r9 + ldrb r0, [r4, 0x17] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0814E488 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0xB1 + ldrb r2, [r0] + cmp r2, 0 + beq _0814E456 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0814E468 +_0814E456: + ldr r7, =gUnknown_085CBCA5 + b _0814E6D8 + .pool +_0814E468: + cmp r2, 0x1 + bne _0814E474 + ldr r7, =gUnknown_085CBCAD + b _0814E6D8 + .pool +_0814E474: + ldr r7, =gUnknown_085CBCC7 + cmp r2, 0x2 + beq _0814E47C + b _0814E6D8 +_0814E47C: + ldr r7, =gUnknown_085CBCB8 + b _0814E6D8 + .pool +_0814E488: + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r0, =0x02000002 + ands r0, r1 + cmp r0, 0 + beq _0814E4DC + movs r0, 0x80 + lsls r0, 16 + ands r0, r1 + cmp r0, 0 + beq _0814E4AC + ldrb r0, [r4, 0x17] + b _0814E4EA + .pool +_0814E4AC: + movs r0, 0x40 + ands r1, r0 + cmp r1, 0 + beq _0814E4BC + ldr r7, =gUnknown_085CBC7E + b _0814E6D8 + .pool +_0814E4BC: + ldr r0, =0x02038bca + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 4 + ldr r7, =gUnknown_085CBC6E + cmp r1, r0 + beq _0814E4CC + b _0814E6D8 +_0814E4CC: + ldr r7, =gUnknown_085CBC14 + b _0814E6D8 + .pool +_0814E4DC: + movs r0, 0x80 + lsls r0, 8 + ands r1, r0 + cmp r1, 0 + beq _0814E4CC + mov r1, r9 + ldrb r0, [r1, 0x17] +_0814E4EA: + ldr r7, =gUnknown_085CCE04 + cmp r0, 0x1 + beq _0814E4F2 + b _0814E6D8 +_0814E4F2: + b _0814E4CC + .pool +_0814E4F8: + mov r0, r10 + bl sub_814F8F8 + ldr r0, =0x0203aba8 + ldr r2, [r0] + ldrh r1, [r2] + movs r0, 0xB1 + lsls r0, 1 + cmp r1, r0 + bls _0814E534 + ldr r0, =0x02022f68 + ldr r1, =0x0202449c + ldr r1, [r1] + adds r1, 0x8E + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + ldr r2, =gUnknown_085CCBBC + adds r1, r2 + bl CopyString + b _0814E544 + .pool +_0814E534: + ldr r0, =0x02022f68 + ldrh r2, [r2] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString +_0814E544: + ldr r0, =0x02022f68 + bl sub_814F950 + ldr r7, =gUnknown_085CBDAC + b _0814E6D8 + .pool +_0814E55C: + ldr r4, =0x02022f58 + ldrb r1, [r4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0814E5C4 + movs r0, 0x7F + ands r0, r1 + strb r0, [r4] + mov r1, r12 + ldrb r0, [r1] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0814E58A + ldrb r1, [r4] + cmp r1, 0x3 + beq _0814E58A + movs r0, 0x3 + eors r0, r1 + strb r0, [r4] +_0814E58A: + ldr r0, =0x02022f58 + ldrb r0, [r0] + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0814E5A4 + ldr r7, =gUnknown_085CB4CA + b _0814E6D8 + .pool +_0814E5A4: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + ldr r7, =gUnknown_085CB5D2 + cmp r0, 0 + bne _0814E5B4 + b _0814E6D8 +_0814E5B4: + ldr r7, =gUnknown_085CB5DF + b _0814E6D8 + .pool +_0814E5C4: + mov r1, r12 + ldrb r0, [r1] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0814E5E0 + ldrb r1, [r4] + cmp r1, 0x3 + beq _0814E5E0 + movs r0, 0x3 + eors r0, r1 + strb r0, [r4] +_0814E5E0: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0814E638 + ldr r0, =0x02022f58 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0814E628 + cmp r0, 0x2 + bgt _0814E608 + cmp r0, 0x1 + beq _0814E60E + b _0814E6D8 + .pool +_0814E608: + cmp r0, 0x3 + beq _0814E630 + b _0814E6D8 +_0814E60E: + movs r0, 0x80 + lsls r0, 16 + ands r1, r0 + ldr r7, =gUnknown_085CB538 + cmp r1, 0 + beq _0814E6D8 + ldr r7, =gUnknown_085CCE53 + b _0814E6D8 + .pool +_0814E628: + ldr r7, =gUnknown_085CB567 + b _0814E6D8 + .pool +_0814E630: + ldr r7, =gUnknown_085CB5A6 + b _0814E6D8 + .pool +_0814E638: + ldr r0, =0x02038bca + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 4 + cmp r1, r0 + bne _0814E680 + ldr r0, =0x02022f58 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0814E670 + cmp r0, 0x2 + bgt _0814E660 + cmp r0, 0x1 + beq _0814E666 + b _0814E6D8 + .pool +_0814E660: + cmp r0, 0x3 + beq _0814E678 + b _0814E6D8 +_0814E666: + ldr r7, =gUnknown_085CBA2E + b _0814E6D8 + .pool +_0814E670: + ldr r7, =gUnknown_085CD24C + b _0814E6D8 + .pool +_0814E678: + ldr r7, =gUnknown_085CD267 + b _0814E6D8 + .pool +_0814E680: + ldr r0, =0x02022f58 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0814E6A8 + cmp r0, 0x2 + bgt _0814E698 + cmp r0, 0x1 + beq _0814E69E + b _0814E6D8 + .pool +_0814E698: + cmp r0, 0x3 + beq _0814E6B0 + b _0814E6D8 +_0814E69E: + ldr r7, =gUnknown_085CB524 + b _0814E6D8 + .pool +_0814E6A8: + ldr r7, =gUnknown_085CB54F + b _0814E6D8 + .pool +_0814E6B0: + ldr r7, =gUnknown_085CB581 + b _0814E6D8 + .pool +_0814E6B8: + movs r0, 0xBE + lsls r0, 1 + cmp r6, r0 + bls _0814E6CC + ldr r1, =0x02022e2c + movs r0, 0xFF + strb r0, [r1] + b _0814E6DE + .pool +_0814E6CC: + ldr r1, =gUnknown_085CC270 + adds r0, r6, 0 + subs r0, 0xC + lsls r0, 2 + adds r0, r1 + ldr r7, [r0] +_0814E6D8: + adds r0, r7, 0 + bl get_battle_strings_ +_0814E6DE: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end battle_pick_message + + thumb_func_start get_battle_strings_ +get_battle_strings_: @ 814E6F0 + push {lr} + ldr r1, =0x02022e2c + bl get_battle_strings + pop {r1} + bx r1 + .pool + thumb_func_end get_battle_strings_ + + thumb_func_start sub_814E700 +sub_814E700: @ 814E700 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, =gUnknown_085CD422 + mov r0, sp + movs r2, 0x8 + bl memcpy + mov r2, sp + movs r3, 0 + b _0814E728 + .pool +_0814E71C: + strb r1, [r2] + adds r4, 0x1 + adds r2, 0x1 + adds r3, 0x1 + cmp r3, 0x7 + bhi _0814E730 +_0814E728: + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + bne _0814E71C +_0814E730: + ldr r5, [sp] + ldr r4, [sp, 0x4] + movs r3, 0 + ldr r2, =gUnknown_0831BCA8 +_0814E738: + ldr r1, [r2] + ldr r0, [r1] + cmp r5, r0 + bne _0814E750 + ldr r0, [r1, 0x4] + cmp r4, r0 + bne _0814E750 + ldr r0, [r2, 0x4] + b _0814E75A + .pool +_0814E750: + adds r2, 0x8 + adds r3, 0x1 + cmp r3, 0x6 + bls _0814E738 + movs r0, 0 +_0814E75A: + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_814E700 + + thumb_func_start get_battle_strings +get_battle_strings: @ 814E764 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x20 + mov r9, r0 + mov r8, r1 + movs r6, 0 + movs r4, 0 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _0814E794 + ldr r0, =0x0203c7b4 + ldrb r7, [r0] + b _0814E79C + .pool +_0814E794: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r7, r0, 24 +_0814E79C: + mov r0, r9 + ldrb r1, [r0] + bl _0814F620 +_0814E7A4: + cmp r1, 0xFD + beq _0814E7AC + bl _0814F610 +_0814E7AC: + movs r1, 0x1 + add r9, r1 + mov r2, r9 + ldrb r0, [r2] + cmp r0, 0x34 + bls _0814E7BC + bl _0814F5C0 +_0814E7BC: + lsls r0, 2 + ldr r1, =_0814E7CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0814E7CC: + .4byte _0814E8A0 + .4byte _0814E8CE + .4byte _0814E90A + .4byte _0814E914 + .4byte _0814E920 + .4byte _0814E92C + .4byte _0814E960 + .4byte _0814E994 + .4byte _0814E9C8 + .4byte _0814E9FC + .4byte _0814EA38 + .4byte _0814EA78 + .4byte _0814EAB8 + .4byte _0814EAF8 + .4byte _0814EBB0 + .4byte _0814EC38 + .4byte _0814ECD4 + .4byte _0814ED70 + .4byte _0814EE0C + .4byte _0814EEA8 + .4byte _0814EF44 + .4byte _0814EF5C + .4byte _0814EF98 + .4byte _0814F080 + .4byte _0814F088 + .4byte _0814F098 + .4byte _0814F0A8 + .4byte _0814F0B8 + .4byte _0814F0D8 + .4byte _0814F164 + .4byte _0814F220 + .4byte _0814F230 + .4byte _0814F244 + .4byte _0814F258 + .4byte _0814F27C + .4byte _0814F298 + .4byte _0814F2C0 + .4byte _0814F300 + .4byte _0814F330 + .4byte _0814F3C4 + .4byte _0814F410 + .4byte _0814F418 + .4byte _0814F3E4 + .4byte _0814F3EC + .4byte _0814F43C + .4byte _0814F444 + .4byte _0814F468 + .4byte _0814F4B8 + .4byte _0814F508 + .4byte _0814F548 + .4byte _0814F594 + .4byte _0814F5B4 + .4byte _0814E8E4 +_0814E8A0: + ldr r5, =0x02022f58 + ldrb r0, [r5] + cmp r0, 0xFD + bne _0814E8B8 + ldr r4, =0x02021cc4 + adds r0, r5, 0 + b _0814E8F0 + .pool +_0814E8B8: + adds r0, r5, 0 + bl sub_814E700 + adds r4, r0, 0 + cmp r4, 0 + beq _0814E8C8 + bl _0814F5C0 +_0814E8C8: + adds r4, r5, 0 + bl _0814F5C0 +_0814E8CE: + ldr r1, =0x02022f68 + ldrb r0, [r1] + cmp r0, 0xFD + bne _0814E904 + ldr r4, =0x02021dc4 + b _0814E8EE + .pool +_0814E8E4: + ldr r1, =0x02022f78 + ldrb r0, [r1] + cmp r0, 0xFD + bne _0814E904 + ldr r4, =0x02021ec4 +_0814E8EE: + adds r0, r1, 0 +_0814E8F0: + adds r1, r4, 0 + bl sub_814F648 + bl _0814F5C0 + .pool +_0814E904: + adds r4, r1, 0 + bl _0814F5C0 +_0814E90A: + ldr r4, =0x02021cc4 + bl _0814F5C0 + .pool +_0814E914: + ldr r4, =0x02021dc4 + bl _0814F5C0 + .pool +_0814E920: + ldr r4, =0x02021ec4 + bl _0814F5C0 + .pool +_0814E92C: + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, =0x0202406e + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + mov r0, sp + bl GetStringEnd_Limit7 + bl _0814F5BE + .pool +_0814E960: + movs r0, 0x1 + bl battle_get_side_with_given_state + ldr r1, =0x0202406e + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + mov r0, sp + bl GetStringEnd_Limit7 + bl _0814F5BE + .pool +_0814E994: + movs r0, 0x2 + bl battle_get_side_with_given_state + ldr r1, =0x0202406e + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + mov r0, sp + bl GetStringEnd_Limit7 + bl _0814F5BE + .pool +_0814E9C8: + movs r0, 0x3 + bl battle_get_side_with_given_state + ldr r1, =0x0202406e + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + mov r0, sp + bl GetStringEnd_Limit7 + bl _0814F5BE + .pool +_0814E9FC: + ldr r2, =0x0202406e + ldr r1, =0x020229e8 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x18] + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + mov r0, sp + bl GetStringEnd_Limit7 + bl _0814F5BE + .pool +_0814EA38: + ldr r2, =0x0202406e + ldr r1, =0x020229e8 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0, 0x18] + movs r0, 0x1 + eors r0, r1 + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + mov r0, sp + bl GetStringEnd_Limit7 + bl _0814F5BE + .pool +_0814EA78: + ldr r2, =0x0202406e + ldr r1, =0x020229e8 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0, 0x18] + movs r0, 0x2 + eors r0, r1 + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + mov r0, sp + bl GetStringEnd_Limit7 + bl _0814F5BE + .pool +_0814EAB8: + ldr r2, =0x0202406e + ldr r1, =0x020229e8 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0, 0x18] + movs r0, 0x3 + eors r0, r1 + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + mov r0, sp + bl GetStringEnd_Limit7 + bl _0814F5BE + .pool +_0814EAF8: + ldr r4, =0x0202420b + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + adds r2, r4, 0 + cmp r0, 0 + beq _0814EB74 + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x8 + ands r1, r0 + ldr r4, =gUnknown_085CBD85 + cmp r1, 0 + beq _0814EB36 + ldr r4, =gUnknown_085CBD8B + b _0814EB36 + .pool +_0814EB2C: + mov r3, r8 + adds r0, r3, r6 + strb r1, [r0] + adds r6, 0x1 + adds r4, 0x1 +_0814EB36: + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + bne _0814EB2C + ldrb r0, [r2] + bl battle_get_per_side_status + adds r1, r0, 0 + movs r0, 0x1 + ands r0, r1 + bl battle_get_side_with_given_state + ldr r1, =0x0202406e + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + b _0814EB9E + .pool +_0814EB74: + ldrb r0, [r2] + bl battle_get_per_side_status + adds r1, r0, 0 + movs r0, 0x1 + ands r0, r1 + bl battle_get_side_with_given_state + ldr r1, =0x0202406e + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr +_0814EB9E: + mov r0, sp + bl GetStringEnd_Limit7 + bl _0814F5BE + .pool +_0814EBB0: + ldr r4, =0x0202420b + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0814EBF8 + ldrb r0, [r4] + bl battle_get_per_side_status + adds r1, r0, 0 + movs r0, 0x1 + ands r0, r1 + bl battle_get_side_with_given_state + ldr r1, =0x0202406e + lsls r0, 24 + lsrs r0, 23 + adds r0, 0x4 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + b _0814EC24 + .pool +_0814EBF8: + ldrb r0, [r4] + bl battle_get_per_side_status + adds r1, r0, 0 + movs r0, 0x1 + ands r0, r1 + bl battle_get_side_with_given_state + ldr r1, =0x0202406e + lsls r0, 24 + lsrs r0, 23 + adds r0, 0x4 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr +_0814EC24: + mov r0, sp + bl GetStringEnd_Limit7 + bl _0814F5BE + .pool +_0814EC38: + ldr r5, =0x0202420b + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0814ECA8 + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x8 + ands r1, r0 + ldr r4, =gUnknown_085CBD85 + cmp r1, 0 + beq _0814EC56 + ldr r4, =gUnknown_085CBD8B +_0814EC56: + ldrb r1, [r4] + adds r0, r1, 0 + ldr r3, =0x0202406e + ldr r2, =0x02024744 + mov r12, r2 + adds r2, r5, 0 + cmp r0, 0xFF + beq _0814EC78 +_0814EC66: + mov r5, r8 + adds r0, r5, r6 + strb r1, [r0] + adds r6, 0x1 + adds r4, 0x1 + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + bne _0814EC66 +_0814EC78: + ldrb r0, [r2] + lsls r0, 1 + adds r0, r3 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + add r0, r12 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + b _0814ECC2 + .pool +_0814ECA8: + ldr r1, =0x0202406e + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr +_0814ECC2: + mov r0, sp + bl GetStringEnd_Limit7 + bl _0814F5BE + .pool +_0814ECD4: + ldr r5, =0x0202420c + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0814ED44 + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x8 + ands r1, r0 + ldr r4, =gUnknown_085CBD85 + cmp r1, 0 + beq _0814ECF2 + ldr r4, =gUnknown_085CBD8B +_0814ECF2: + ldrb r1, [r4] + adds r0, r1, 0 + ldr r3, =0x0202406e + ldr r2, =0x02024744 + mov r12, r2 + adds r2, r5, 0 + cmp r0, 0xFF + beq _0814ED14 +_0814ED02: + mov r5, r8 + adds r0, r5, r6 + strb r1, [r0] + adds r6, 0x1 + adds r4, 0x1 + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + bne _0814ED02 +_0814ED14: + ldrb r0, [r2] + lsls r0, 1 + adds r0, r3 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + add r0, r12 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + b _0814ED5E + .pool +_0814ED44: + ldr r1, =0x0202406e + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr +_0814ED5E: + mov r0, sp + bl GetStringEnd_Limit7 + bl _0814F5BE + .pool +_0814ED70: + ldr r5, =0x0202420e + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0814EDE0 + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x8 + ands r1, r0 + ldr r4, =gUnknown_085CBD85 + cmp r1, 0 + beq _0814ED8E + ldr r4, =gUnknown_085CBD8B +_0814ED8E: + ldrb r1, [r4] + adds r0, r1, 0 + ldr r3, =0x0202406e + ldr r2, =0x02024744 + mov r12, r2 + adds r2, r5, 0 + cmp r0, 0xFF + beq _0814EDB0 +_0814ED9E: + mov r5, r8 + adds r0, r5, r6 + strb r1, [r0] + adds r6, 0x1 + adds r4, 0x1 + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + bne _0814ED9E +_0814EDB0: + ldrb r0, [r2] + lsls r0, 1 + adds r0, r3 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + add r0, r12 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + b _0814EDFA + .pool +_0814EDE0: + ldr r1, =0x0202406e + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr +_0814EDFA: + mov r0, sp + bl GetStringEnd_Limit7 + bl _0814F5BE + .pool +_0814EE0C: + ldr r5, =0x02024064 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0814EE7C + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x8 + ands r1, r0 + ldr r4, =gUnknown_085CBD85 + cmp r1, 0 + beq _0814EE2A + ldr r4, =gUnknown_085CBD8B +_0814EE2A: + ldrb r1, [r4] + adds r0, r1, 0 + ldr r3, =0x0202406e + ldr r2, =0x02024744 + mov r12, r2 + adds r2, r5, 0 + cmp r0, 0xFF + beq _0814EE4C +_0814EE3A: + mov r5, r8 + adds r0, r5, r6 + strb r1, [r0] + adds r6, 0x1 + adds r4, 0x1 + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + bne _0814EE3A +_0814EE4C: + ldrb r0, [r2] + lsls r0, 1 + adds r0, r3 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + add r0, r12 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + b _0814EE96 + .pool +_0814EE7C: + ldr r1, =0x0202406e + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr +_0814EE96: + mov r0, sp + bl GetStringEnd_Limit7 + b _0814F5BE + .pool +_0814EEA8: + ldr r5, =0x02024474 + ldrb r0, [r5, 0x17] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0814EF18 + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x8 + ands r1, r0 + ldr r4, =gUnknown_085CBD85 + cmp r1, 0 + beq _0814EEC6 + ldr r4, =gUnknown_085CBD8B +_0814EEC6: + ldrb r1, [r4] + adds r0, r1, 0 + ldr r3, =0x0202406e + ldr r2, =0x02024744 + mov r12, r2 + adds r2, r5, 0 + cmp r0, 0xFF + beq _0814EEE8 +_0814EED6: + mov r5, r8 + adds r0, r5, r6 + strb r1, [r0] + adds r6, 0x1 + adds r4, 0x1 + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + bne _0814EED6 +_0814EEE8: + ldrb r0, [r2, 0x17] + lsls r0, 1 + adds r0, r3 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + add r0, r12 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + b _0814EF32 + .pool +_0814EF18: + ldr r1, =0x0202406e + ldrb r0, [r5, 0x17] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr +_0814EF32: + mov r0, sp + bl GetStringEnd_Limit7 + b _0814F5BE + .pool +_0814EF44: + ldr r0, =0x0203aba8 + ldr r2, [r0] + ldrh r1, [r2] + movs r0, 0xB1 + lsls r0, 1 + cmp r1, r0 + bhi _0814EF6A + ldrh r1, [r2] + b _0814EF8A + .pool +_0814EF5C: + ldr r0, =0x0203aba8 + ldr r2, [r0] + ldrh r1, [r2, 0x2] + movs r0, 0xB1 + lsls r0, 1 + cmp r1, r0 + bls _0814EF88 +_0814EF6A: + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + ldr r1, =gUnknown_085CCBBC + adds r4, r0, r1 + b _0814F5C0 + .pool +_0814EF88: + ldrh r1, [r2, 0x2] +_0814EF8A: + movs r0, 0xD + muls r1, r0 + ldr r0, =gMoveNames + adds r4, r1, r0 + b _0814F5C0 + .pool +_0814EF98: + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r0, =0x02000002 + ands r0, r1 + cmp r0, 0 + beq _0814F06E + ldr r2, =0x02024208 + ldrh r0, [r2] + cmp r0, 0xAF + bne _0814F064 + movs r0, 0x40 + ands r1, r0 + cmp r1, 0 + bne _0814F014 + ldr r0, =0x02024474 + adds r0, 0x25 + ldrb r0, [r0] + cmp r0, 0 + beq _0814EFE0 + ldr r2, =0x0202420f + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0814EFEC + b _0814F05C + .pool +_0814EFE0: + ldr r2, =0x0202420f + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0814F05C +_0814EFEC: + ldrb r0, [r2] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r0, =0x02024404 + adds r1, r0 + mov r0, sp + bl CopyString + ldr r1, =gUnknown_085CC0AD + mov r0, sp + bl AppendString + b _0814F5BE + .pool +_0814F014: + ldr r2, =0x020229e8 + ldr r0, =0x02024474 + adds r0, 0x25 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0202420f + ldrb r2, [r1] + ldrh r0, [r0, 0x18] + cmp r0, r2 + bne _0814F05C + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + ldr r0, =0x02024404 + adds r1, r0 + mov r0, sp + bl CopyString + ldr r1, =gUnknown_085CC0AD + mov r0, sp + bl AppendString + b _0814F5BE + .pool +_0814F05C: + ldr r4, =gUnknown_085CC0A0 + b _0814F5C0 + .pool +_0814F064: + ldrh r0, [r2] + mov r1, sp + bl itemid_get_name + b _0814F5BE +_0814F06E: + ldr r0, =0x02024208 + ldrh r0, [r0] + mov r1, sp + bl itemid_get_name + b _0814F5BE + .pool +_0814F080: + ldr r0, =0x0202420a + b _0814F0C0 + .pool +_0814F088: + ldr r1, =0x0203aba4 + ldr r0, =0x0202420b + b _0814F0BC + .pool +_0814F098: + ldr r1, =0x0203aba4 + ldr r0, =0x0202420c + b _0814F0BC + .pool +_0814F0A8: + ldr r1, =0x0203aba4 + ldr r0, =0x02024474 + ldrb r0, [r0, 0x17] + b _0814F0BE + .pool +_0814F0B8: + ldr r1, =0x0203aba4 + ldr r0, =0x0202420e +_0814F0BC: + ldrb r0, [r0] +_0814F0BE: + adds r0, r1 +_0814F0C0: + ldrb r1, [r0] + movs r0, 0xD + muls r1, r0 + ldr r0, =gAbilityNames + adds r4, r1, r0 + b _0814F5C0 + .pool +_0814F0D8: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 20 + ands r0, r1 + cmp r0, 0 + beq _0814F0F0 + bl sub_806B870 + b _0814F59C + .pool +_0814F0F0: + ldr r3, =0x02038bca + ldrh r2, [r3] + movs r0, 0xC0 + lsls r0, 4 + cmp r2, r0 + bne _0814F10C + bl sub_8068BB0 + lsls r0, 16 + lsrs r0, 16 + b _0814F5A0 + .pool +_0814F10C: + ldr r0, =0x000003fe + cmp r2, r0 + bne _0814F11C + bl sub_81A4D00 + b _0814F59C + .pool +_0814F11C: + ldr r0, =0x003f0100 + ands r0, r1 + cmp r0, 0 + beq _0814F12C + ldrh r0, [r3] + b _0814F598 + .pool +_0814F12C: + movs r0, 0x80 + lsls r0, 19 + ands r0, r1 + cmp r0, 0 + beq _0814F13E + ldrh r0, [r3] + bl sub_81D5530 + b _0814F59C +_0814F13E: + movs r0, 0x80 + lsls r0, 4 + ands r1, r0 + cmp r1, 0 + beq _0814F14E + bl sub_8165264 + b _0814F59C +_0814F14E: + ldr r2, =gTrainers + ldrh r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r0, 0xD + b _0814F5A2 + .pool +_0814F164: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 20 + ands r0, r1 + cmp r0, 0 + beq _0814F1AC + movs r2, 0 + ldr r4, =0x020244a8 + ldr r3, [r4] +_0814F178: + mov r1, sp + adds r0, r1, r2 + ldr r1, [r3] + adds r1, 0x2 + adds r1, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x6 + ble _0814F178 + mov r3, sp + adds r1, r3, r2 + movs r0, 0xFF + strb r0, [r1] + ldr r0, [r4] + ldr r0, [r0] + ldrb r1, [r0, 0xD] + mov r0, sp + bl StopMusicWhileStringIsPrinted + b _0814F5BE + .pool +_0814F1AC: + ldr r3, =0x02038bca + ldrh r2, [r3] + movs r0, 0xC0 + lsls r0, 4 + cmp r2, r0 + bne _0814F1C4 + movs r1, 0x1 + adds r0, r7, 0 + eors r0, r1 + b _0814F284 + .pool +_0814F1C4: + ldr r0, =0x000003fe + cmp r2, r0 + bne _0814F1D8 + mov r0, sp + bl sub_81A4D50 + b _0814F5BE + .pool +_0814F1D8: + ldr r0, =0x003f0100 + ands r0, r1 + cmp r0, 0 + beq _0814F1E8 + ldrh r1, [r3] + b _0814F5B8 + .pool +_0814F1E8: + movs r0, 0x80 + lsls r0, 19 + ands r0, r1 + cmp r0, 0 + beq _0814F1FC + ldrh r1, [r3] + mov r0, sp + bl sub_81D5554 + b _0814F5BE +_0814F1FC: + movs r0, 0x80 + lsls r0, 4 + ands r1, r0 + cmp r1, 0 + beq _0814F20E + mov r0, sp + bl sub_8165284 + b _0814F5BE +_0814F20E: + ldrh r0, [r3] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTrainers + 0x4 @ name offset + adds r4, r1, r0 + b _0814F5C0 + .pool +_0814F220: + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + ldr r1, =0x020229f0 + adds r4, r0, r1 + b _0814F5C0 + .pool +_0814F230: + ldr r4, =0x020229e8 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x18] + movs r0, 0x2 + b _0814F266 + .pool +_0814F244: + ldr r4, =0x020229e8 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x18] + movs r0, 0x1 + b _0814F266 + .pool +_0814F258: + ldr r4, =0x020229e8 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x18] + movs r0, 0x3 +_0814F266: + eors r0, r1 + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r4, 0x8 + adds r4, r1, r4 + b _0814F5C0 + .pool +_0814F27C: + ldr r0, =0x02024474 + ldrb r0, [r0, 0x17] + bl sub_806D864 +_0814F284: + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r0, =0x020229f0 + adds r4, r1, r0 + b _0814F5C0 + .pool +_0814F298: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _0814F2B4 + ldr r4, =0x020229f0 + b _0814F5C0 + .pool +_0814F2B4: + ldr r0, =0x03005d90 + ldr r4, [r0] + b _0814F5C0 + .pool +_0814F2C0: + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r0, =0x003f0100 + ands r0, r1 + cmp r0, 0 + beq _0814F2E0 + ldr r0, =0x02038bca + ldrh r1, [r0] + movs r0, 0x2 + b _0814F55A + .pool +_0814F2E0: + movs r0, 0x80 + lsls r0, 19 + ands r1, r0 + cmp r1, 0 + beq _0814F2F8 + ldr r0, =0x02038bca + ldrh r1, [r0] + movs r0, 0x4 + b _0814F584 + .pool +_0814F2F8: + bl sub_80B1CA4 + adds r4, r0, 0 + b _0814F5C0 +_0814F300: + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r0, =0x003f0100 + ands r0, r1 + cmp r0, 0 + beq _0814F31C + ldr r0, =0x02038bca + b _0814F556 + .pool +_0814F31C: + movs r0, 0x80 + lsls r0, 19 + ands r1, r0 + cmp r1, 0 + bne _0814F328 + b _0814F5C0 +_0814F328: + ldr r0, =0x02038bca + b _0814F580 + .pool +_0814F330: + ldr r0, =0x02024474 + ldrb r0, [r0, 0x17] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0814F39C + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x8 + ands r1, r0 + ldr r4, =gUnknown_085CBD85 + cmp r1, 0 + beq _0814F34E + ldr r4, =gUnknown_085CBD8B +_0814F34E: + ldrb r1, [r4] + adds r0, r1, 0 + ldr r5, =0x02024744 + mov r12, r5 + ldr r2, =0x0202449c + cmp r0, 0xFF + beq _0814F36E +_0814F35C: + mov r3, r8 + adds r0, r3, r6 + strb r1, [r0] + adds r6, 0x1 + adds r4, 0x1 + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + bne _0814F35C +_0814F36E: + ldr r0, [r2] + adds r0, 0x52 + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + add r0, r12 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + b _0814F3B4 + .pool +_0814F39C: + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x52 + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr +_0814F3B4: + mov r0, sp + bl GetStringEnd_Limit7 + b _0814F5BE + .pool +_0814F3C4: + ldr r0, =0x000008ab + bl FlagGet + lsls r0, 24 + ldr r4, =gUnknown_085CC015 + cmp r0, 0 + bne _0814F3D4 + b _0814F5C0 +_0814F3D4: + ldr r4, =gUnknown_085CC01F + b _0814F5C0 + .pool +_0814F3E4: + ldr r0, =0x0202420b + b _0814F3EE + .pool +_0814F3EC: + ldr r0, =0x0202420c +_0814F3EE: + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + ldr r4, =gUnknown_085CBD9A + cmp r0, 0 + beq _0814F3FE + b _0814F5C0 +_0814F3FE: + ldr r4, =gUnknown_085CBD9E + b _0814F5C0 + .pool +_0814F410: + ldr r0, =0x0202420b + b _0814F41A + .pool +_0814F418: + ldr r0, =0x0202420c +_0814F41A: + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + ldr r4, =gUnknown_085CBD91 + cmp r0, 0 + beq _0814F42A + b _0814F5C0 +_0814F42A: + ldr r4, =gUnknown_085CBD95 + b _0814F5C0 + .pool +_0814F43C: + ldr r0, =0x0202420b + b _0814F446 + .pool +_0814F444: + ldr r0, =0x0202420c +_0814F446: + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + ldr r4, =gUnknown_085CBDA3 + cmp r0, 0 + beq _0814F456 + b _0814F5C0 +_0814F456: + ldr r4, =gUnknown_085CBDA7 + b _0814F5C0 + .pool +_0814F468: + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r0, =0x003f0100 + ands r0, r1 + cmp r0, 0 + beq _0814F484 + ldr r0, =0x02038bcc + b _0814F596 + .pool +_0814F484: + movs r0, 0x80 + lsls r0, 19 + ands r1, r0 + cmp r1, 0 + beq _0814F49C + ldr r0, =0x02038bcc + ldrh r0, [r0] + bl sub_81D5530 + b _0814F59C + .pool +_0814F49C: + ldr r2, =gTrainers + ldr r0, =0x02038bcc + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r0, 0xD + b _0814F5A2 + .pool +_0814F4B8: + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r0, =0x003f0100 + ands r0, r1 + cmp r0, 0 + beq _0814F4D4 + ldr r0, =0x02038bcc + b _0814F5B6 + .pool +_0814F4D4: + movs r0, 0x80 + lsls r0, 19 + ands r1, r0 + cmp r1, 0 + beq _0814F4F0 + ldr r0, =0x02038bcc + ldrh r1, [r0] + mov r0, sp + bl sub_81D5554 + b _0814F5BE + .pool +_0814F4F0: + ldr r0, =0x02038bcc + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, =gTrainers + 0x4 @ name offset + adds r4, r0, r1 + b _0814F5C0 + .pool +_0814F508: + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r0, =0x003f0100 + ands r0, r1 + cmp r0, 0 + beq _0814F528 + ldr r0, =0x02038bcc + ldrh r1, [r0] + movs r0, 0x2 + b _0814F55A + .pool +_0814F528: + movs r0, 0x80 + lsls r0, 19 + ands r1, r0 + cmp r1, 0 + beq _0814F540 + ldr r0, =0x02038bcc + ldrh r1, [r0] + movs r0, 0x4 + b _0814F584 + .pool +_0814F540: + bl sub_80B1CE0 + adds r4, r0, 0 + b _0814F5C0 +_0814F548: + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r0, =0x003f0100 + ands r0, r1 + cmp r0, 0 + beq _0814F574 + ldr r0, =0x02038bcc +_0814F556: + ldrh r1, [r0] + movs r0, 0x1 +_0814F55A: + bl sub_81A36D0 + ldr r4, =0x02021fc4 + b _0814F5C0 + .pool +_0814F574: + movs r0, 0x80 + lsls r0, 19 + ands r1, r0 + cmp r1, 0 + beq _0814F5C0 + ldr r0, =0x02038bcc +_0814F580: + ldrh r1, [r0] + movs r0, 0x3 +_0814F584: + bl sub_81D572C + ldr r4, =0x02021fc4 + b _0814F5C0 + .pool +_0814F594: + ldr r0, =0x02038bce +_0814F596: + ldrh r0, [r0] +_0814F598: + bl sub_8162BD8 +_0814F59C: + lsls r0, 24 + lsrs r0, 24 +_0814F5A0: + movs r1, 0xD +_0814F5A2: + muls r1, r0 + ldr r0, =gTrainerClassNames + adds r4, r1, r0 + b _0814F5C0 + .pool +_0814F5B4: + ldr r0, =0x02038bce +_0814F5B6: + ldrh r1, [r0] +_0814F5B8: + mov r0, sp + bl sub_8162E20 +_0814F5BE: + mov r4, sp +_0814F5C0: + ldrb r1, [r4] + adds r0, r1, 0 + mov r5, r9 + ldrb r2, [r5] + mov r3, r9 + adds r3, 0x1 + cmp r0, 0xFF + beq _0814F5E2 +_0814F5D0: + mov r5, r8 + adds r0, r5, r6 + strb r1, [r0] + adds r6, 0x1 + adds r4, 0x1 + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + bne _0814F5D0 +_0814F5E2: + lsls r0, r2, 24 + lsrs r0, 24 + cmp r0, 0x24 + beq _0814F5F6 + cmp r0, 0x30 + beq _0814F5F6 + cmp r0, 0x25 + beq _0814F5F6 + cmp r0, 0x31 + bne _0814F61C +_0814F5F6: + mov r0, r8 + adds r1, r0, r6 + movs r0, 0xFC + strb r0, [r1] + adds r6, 0x1 + mov r2, r8 + adds r1, r2, r6 + movs r0, 0x9 + strb r0, [r1] + adds r6, 0x1 + b _0814F61C + .pool +_0814F610: + mov r3, r8 + adds r0, r3, r6 + strb r1, [r0] + adds r6, 0x1 + mov r3, r9 + adds r3, 0x1 +_0814F61C: + mov r9, r3 + ldrb r1, [r3] +_0814F620: + adds r0, r1, 0 + cmp r0, 0xFF + beq _0814F62A + bl _0814E7A4 +_0814F62A: + mov r5, r8 + adds r1, r5, r6 + mov r2, r9 + ldrb r0, [r2] + strb r0, [r1] + adds r6, 0x1 + adds r0, r6, 0 + add sp, 0x20 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end get_battle_strings + + thumb_func_start sub_814F648 +sub_814F648: @ 814F648 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r7, r0, 0 + adds r6, r1, 0 + movs r5, 0x1 + movs r0, 0 + mov r8, r0 + movs r0, 0xFF + strb r0, [r6] + ldrb r0, [r7, 0x1] + cmp r0, 0xFF + bne _0814F666 + b _0814F8EA +_0814F666: + adds r0, r7, r5 + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0xA + bls _0814F672 + b _0814F8E0 +_0814F672: + lsls r0, r1, 2 + ldr r1, =_0814F680 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0814F680: + .4byte _0814F6AC + .4byte _0814F6C8 + .4byte _0814F71C + .4byte _0814F734 + .4byte _0814F744 + .4byte _0814F7BC + .4byte _0814F7D0 + .4byte _0814F7E2 + .4byte _0814F828 + .4byte _0814F83C + .4byte _0814F858 +_0814F6AC: + adds r0, r5, r7 + ldrb r1, [r0, 0x1] + ldrb r0, [r0, 0x2] + lsls r0, 8 + orrs r1, r0 + ldr r0, =gUnknown_085CC270 + subs r1, 0xC + lsls r1, 2 + adds r1, r0 + ldr r1, [r1] + b _0814F8BE + .pool +_0814F6C8: + ldrb r0, [r4, 0x1] + cmp r0, 0x2 + beq _0814F6E4 + cmp r0, 0x2 + bgt _0814F6D8 + cmp r0, 0x1 + beq _0814F6DE + b _0814F706 +_0814F6D8: + cmp r0, 0x4 + beq _0814F6EC + b _0814F706 +_0814F6DE: + ldrb r4, [r4, 0x3] + mov r8, r4 + b _0814F706 +_0814F6E4: + ldrb r1, [r4, 0x3] + ldrb r0, [r4, 0x4] + lsls r0, 8 + b _0814F702 +_0814F6EC: + ldrb r0, [r4, 0x3] + mov r8, r0 + ldrb r0, [r4, 0x4] + lsls r0, 8 + mov r1, r8 + orrs r1, r0 + ldrb r0, [r4, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r4, 0x6] + lsls r0, 24 +_0814F702: + orrs r1, r0 + mov r8, r1 +_0814F706: + adds r4, r5, r7 + ldrb r3, [r4, 0x2] + adds r0, r6, 0 + mov r1, r8 + movs r2, 0 + bl ConvertIntToDecimalString + adds r0, r5, 0x3 + ldrb r4, [r4, 0x1] + adds r5, r0, r4 + b _0814F8E0 +_0814F71C: + adds r0, r5, r7 + ldrb r1, [r0, 0x1] + ldrb r0, [r0, 0x2] + lsls r0, 8 + orrs r1, r0 + movs r0, 0xD + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + b _0814F8BE + .pool +_0814F734: + adds r0, r5, r7 + ldrb r0, [r0, 0x1] + lsls r1, r0, 3 + subs r1, r0 + ldr r0, =gTypeNames + b _0814F846 + .pool +_0814F744: + ldrb r0, [r4, 0x1] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0814F768 + ldrb r1, [r4, 0x2] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + b _0814F7A4 + .pool +_0814F768: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0814F788 + ldr r1, =gUnknown_085CBD8B + adds r0, r6, 0 + bl AppendString + b _0814F790 + .pool +_0814F788: + ldr r1, =gUnknown_085CBD85 + adds r0, r6, 0 + bl AppendString +_0814F790: + adds r0, r5, r7 + ldrb r1, [r0, 0x2] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr +_0814F7A4: + mov r0, sp + bl GetStringEnd_Limit7 + adds r0, r6, 0 + mov r1, sp + bl AppendString + b _0814F8DE + .pool +_0814F7BC: + ldr r1, =gUnknown_085CBE00 + adds r0, r5, r7 + ldrb r0, [r0, 0x1] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + b _0814F848 + .pool +_0814F7D0: + adds r0, r5, r7 + ldrb r1, [r0, 0x1] + ldrb r0, [r0, 0x2] + lsls r0, 8 + orrs r1, r0 + adds r0, r6, 0 + bl GetSpeciesName + b _0814F8DE +_0814F7E2: + adds r4, r5, r7 + ldrb r0, [r4, 0x1] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0814F808 + ldrb r1, [r4, 0x2] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + adds r2, r6, 0 + bl pokemon_getattr + b _0814F81A + .pool +_0814F808: + ldrb r1, [r4, 0x2] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2 + adds r2, r6, 0 + bl pokemon_getattr +_0814F81A: + adds r0, r6, 0 + bl GetStringEnd_Limit7 + b _0814F8DE + .pool +_0814F828: + ldr r1, =gUnknown_085CBE6C + adds r0, r5, r7 + ldrb r0, [r0, 0x1] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + b _0814F848 + .pool +_0814F83C: + adds r0, r5, r7 + ldrb r1, [r0, 0x1] + movs r0, 0xD + muls r1, r0 + ldr r0, =gAbilityNames +_0814F846: + adds r1, r0 +_0814F848: + adds r0, r6, 0 + bl AppendString + adds r5, 0x2 + b _0814F8E0 + .pool +_0814F858: + adds r0, r5, r7 + ldrb r2, [r0, 0x1] + ldrb r0, [r0, 0x2] + lsls r0, 8 + orrs r2, r0 + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x02000002 + ands r0, r1 + cmp r0, 0 + beq _0814F8D6 + cmp r2, 0xAF + bne _0814F8CC + ldr r2, =0x020229e8 + ldr r0, =0x02024474 + adds r0, 0x25 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0202420f + ldrb r2, [r1] + ldrh r0, [r0, 0x18] + cmp r0, r2 + bne _0814F8BC + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + ldr r0, =0x02024404 + adds r1, r0 + adds r0, r6, 0 + bl CopyString + ldr r1, =gUnknown_085CC0AD + b _0814F8BE + .pool +_0814F8BC: + ldr r1, =gUnknown_085CC0A0 +_0814F8BE: + adds r0, r6, 0 + bl AppendString + b _0814F8DE + .pool +_0814F8CC: + adds r0, r2, 0 + adds r1, r6, 0 + bl itemid_get_name + b _0814F8DE +_0814F8D6: + adds r0, r2, 0 + adds r1, r6, 0 + bl itemid_get_name +_0814F8DE: + adds r5, 0x3 +_0814F8E0: + adds r0, r7, r5 + ldrb r0, [r0] + cmp r0, 0xFF + beq _0814F8EA + b _0814F666 +_0814F8EA: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_814F648 + + thumb_func_start sub_814F8F8 +sub_814F8F8: @ 814F8F8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r2, 0 + ldr r5, =0x0203aba8 + ldr r3, =gUnknown_085CD336 +_0814F902: + cmp r2, 0x4 + beq _0814F918 + ldrh r1, [r3] + cmp r1, 0 + bne _0814F90E + adds r2, 0x1 +_0814F90E: + ldr r0, [r5] + adds r3, 0x2 + ldrh r0, [r0] + cmp r1, r0 + bne _0814F902 +_0814F918: + cmp r2, 0 + blt _0814F944 + cmp r2, 0x2 + bgt _0814F938 + ldr r1, =gUnknown_085CCBB5 + adds r0, r4, 0 + bl CopyString + b _0814F944 + .pool +_0814F938: + cmp r2, 0x4 + bgt _0814F944 + ldr r1, =gUnknown_085CCBB9 + adds r0, r4, 0 + bl CopyString +_0814F944: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814F8F8 + + thumb_func_start sub_814F950 +sub_814F950: @ 814F950 + push {r4,r5,lr} + adds r3, r0, 0 + movs r4, 0 + b _0814F95A +_0814F958: + adds r3, 0x1 +_0814F95A: + ldrb r0, [r3] + cmp r0, 0xFF + bne _0814F958 + ldr r1, =gUnknown_085CD336 + ldr r5, =0x0203aba8 + movs r0, 0 + lsls r0, 1 + adds r2, r0, r1 +_0814F96A: + cmp r4, 0x4 + beq _0814F984 + ldrh r1, [r2] + cmp r1, 0 + bne _0814F976 + adds r4, 0x1 +_0814F976: + ldr r0, [r5] + adds r2, 0x2 + ldrh r0, [r0] + cmp r1, r0 + bne _0814F96A + cmp r4, 0x4 + bhi _0814F9E0 +_0814F984: + lsls r0, r4, 2 + ldr r1, =_0814F99C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0814F99C: + .4byte _0814F9B0 + .4byte _0814F9B8 + .4byte _0814F9C0 + .4byte _0814F9C8 + .4byte _0814F9D8 +_0814F9B0: + ldr r1, =gUnknown_085CBDB7 + b _0814F9CA + .pool +_0814F9B8: + ldr r1, =gUnknown_085CBDB9 + b _0814F9CA + .pool +_0814F9C0: + ldr r1, =gUnknown_085CBDBB + b _0814F9CA + .pool +_0814F9C8: + ldr r1, =gUnknown_085CBDBD +_0814F9CA: + adds r0, r3, 0 + bl CopyString + b _0814F9E0 + .pool +_0814F9D8: + ldr r1, =gUnknown_085CBDBF + adds r0, r3, 0 + bl CopyString +_0814F9E0: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814F950 + + thumb_func_start battle_show_message_maybe +battle_show_message_maybe: @ 814F9EC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + adds r4, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r1, =gUnknown_085CD660 + ldr r0, =0x02024474 + adds r0, 0x24 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + mov r8, r0 + movs r0, 0x80 + ands r0, r7 + cmp r0, 0 + beq _0814FA24 + movs r0, 0x7F + ands r7, r0 + movs r0, 0 + b _0814FA36 + .pool +_0814FA24: + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 2 + add r0, r8 + ldrb r1, [r0] + adds r0, r7, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 +_0814FA36: + mov r9, r0 + str r4, [sp] + mov r0, sp + strb r7, [r0, 0x4] + mov r1, sp + lsls r6, r7, 1 + adds r3, r6, r7 + lsls r3, 2 + add r3, r8 + ldrb r0, [r3, 0x1] + strb r0, [r1, 0x5] + ldrb r0, [r3, 0x2] + strb r0, [r1, 0x6] + ldrb r0, [r3, 0x3] + strb r0, [r1, 0x7] + mov r0, sp + ldrb r0, [r0, 0x6] + strb r0, [r1, 0x8] + mov r0, sp + ldrb r0, [r0, 0x7] + strb r0, [r1, 0x9] + ldrb r0, [r3, 0x4] + strb r0, [r1, 0xA] + ldrb r0, [r3, 0x5] + strb r0, [r1, 0xB] + mov r4, sp + ldrb r2, [r4, 0xC] + movs r1, 0x10 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r4, 0xC] + mov r2, sp + ldrb r0, [r3, 0x7] + lsls r0, 4 + movs r5, 0xF + strb r0, [r2, 0xC] + ldrb r2, [r3, 0x8] + adds r0, r5, 0 + ands r0, r2 + ldrb r2, [r4, 0xD] + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0xD] + mov r2, sp + ldrb r0, [r3, 0x9] + lsls r0, 4 + ands r1, r5 + orrs r1, r0 + strb r1, [r2, 0xD] + mov r0, sp + ldrb r0, [r0, 0x6] + cmp r0, 0xFF + bne _0814FAC6 + ldr r0, =0x02024474 + adds r0, 0x24 + ldrb r0, [r0] + adds r1, r7, 0 + bl sub_80397C4 + adds r2, r0, 0 + mov r0, sp + ldrb r0, [r0, 0x5] + ldr r1, [sp] + mov r3, sp + ldrb r3, [r3, 0xA] + bl GetStringCenterAlignXOffsetWithLetterSpacing + mov r2, sp + mov r1, sp + strb r0, [r1, 0x8] + strb r0, [r2, 0x6] +_0814FAC6: + cmp r7, 0x16 + bne _0814FAE0 + ldr r0, =0x03003014 + ldrb r2, [r0] + movs r1, 0x3 + negs r1, r1 + ands r1, r2 + b _0814FAE8 + .pool +_0814FAE0: + ldr r0, =0x03003014 + ldrb r1, [r0] + movs r2, 0x2 + orrs r1, r2 +_0814FAE8: + strb r1, [r0] + adds r3, r0, 0 + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r2, =0x01000002 + ands r1, r2 + adds r2, r0, 0 + cmp r1, 0 + beq _0814FB10 + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + b _0814FB18 + .pool +_0814FB10: + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 +_0814FB18: + strb r0, [r3] + cmp r7, 0 + beq _0814FB22 + cmp r7, 0x16 + bne _0814FB6C +_0814FB22: + ldr r1, [r2] + ldr r0, =0x02000002 + ands r0, r1 + cmp r0, 0 + beq _0814FB34 + movs r6, 0x1 + b _0814FB5C + .pool +_0814FB34: + movs r0, 0x80 + lsls r0, 17 + ands r1, r0 + cmp r1, 0 + beq _0814FB54 + ldr r4, =gUnknown_085CD668 + bl sub_8185FC4 + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r6, [r0] + b _0814FB5C + .pool +_0814FB54: + bl sav2_get_text_speed + lsls r0, 24 + lsrs r6, r0, 24 +_0814FB5C: + ldr r0, =0x03003014 + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + b _0814FB7E + .pool +_0814FB6C: + adds r0, r6, r7 + lsls r0, 2 + add r0, r8 + ldrb r6, [r0, 0x6] + ldrb r1, [r3] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r3] +_0814FB7E: + mov r0, sp + adds r1, r6, 0 + movs r2, 0 + bl AddTextPrinter + mov r0, r9 + cmp r0, 0 + beq _0814FB9C + adds r0, r7, 0 + bl PutWindowTilemap + adds r0, r7, 0 + movs r1, 0x3 + bl CopyWindowToVram +_0814FB9C: + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end battle_show_message_maybe + + thumb_func_start sub_814FBAC +sub_814FBAC: @ 814FBAC + push {r4,r5,lr} + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r1, r2, 9 + ldr r0, =0x02023068 + adds r1, r0 + ldr r4, =gUnknown_08D85620 + ldr r0, =0x020244b0 + adds r2, r0 + ldrb r2, [r2] + adds r0, r1, 0 + adds r0, 0x8 + adds r0, r2 + ldrb r0, [r0] + adds r1, 0xC + adds r1, r2 + ldrb r1, [r1] + bl sub_814FC20 + lsls r0, 24 + ldr r5, =0x02037714 + lsrs r0, 22 + adds r0, r4 + ldrh r1, [r0] + adds r2, r5, 0 + adds r2, 0xB8 + strh r1, [r2] + ldrh r0, [r0, 0x2] + adds r5, 0xB6 + strh r0, [r5] + ldr r4, =0x02037bcc + adds r0, r2, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl CpuSet + subs r4, 0x2 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl CpuSet + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814FBAC + + thumb_func_start sub_814FC20 +sub_814FC20: @ 814FC20 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + adds r3, r2, 0 + lsls r1, 24 + lsrs r0, r1, 24 + cmp r0, r2 + beq _0814FC68 + cmp r0, 0x2 + bhi _0814FC3A + cmp r2, 0x1 + bhi _0814FC68 + b _0814FC42 +_0814FC3A: + cmp r0, 0x7 + bhi _0814FC4C + cmp r2, 0x2 + bhi _0814FC68 +_0814FC42: + movs r0, 0x2 + subs r0, r2 + lsls r0, 24 + lsrs r0, 24 + b _0814FC6A +_0814FC4C: + cmp r2, 0 + bne _0814FC54 + movs r0, 0x2 + b _0814FC6A +_0814FC54: + lsrs r0, r1, 26 + cmp r2, r0 + bhi _0814FC5E + movs r0, 0x1 + b _0814FC6A +_0814FC5E: + lsrs r0, r1, 25 + cmp r3, r0 + bhi _0814FC68 + movs r0, 0 + b _0814FC6A +_0814FC68: + movs r0, 0x3 +_0814FC6A: + pop {r1} + bx r1 + thumb_func_end sub_814FC20 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/battle_records.s b/asm/battle_records.s new file mode 100644 index 000000000..1290e96e6 --- /dev/null +++ b/asm/battle_records.s @@ -0,0 +1,763 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_813BF94 +sub_813BF94: @ 813BF94 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r2, =0x01000008 + mov r0, sp + adds r1, r4, 0 + bl CpuSet + movs r0, 0xFF + strb r0, [r4] + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0xA] + strh r0, [r4, 0xC] + strh r0, [r4, 0xE] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813BF94 + + thumb_func_start sub_813BFC4 +sub_813BFC4: @ 813BFC4 + push {r4,r5,lr} + adds r4, r0, 0 + movs r5, 0x4 +_0813BFCA: + adds r0, r4, 0 + bl sub_813BF94 + adds r4, 0x10 + subs r5, 0x1 + cmp r5, 0 + bge _0813BFCA + movs r0, 0x17 + movs r1, 0 + bl sav12_xor_set + movs r0, 0x18 + movs r1, 0 + bl sav12_xor_set + movs r0, 0x19 + movs r1, 0 + bl sav12_xor_set + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_813BFC4 + + thumb_func_start sub_813BFF8 +sub_813BFF8: @ 813BFF8 + adds r1, r0, 0 + ldrh r0, [r1, 0xA] + ldrh r2, [r1, 0xC] + adds r0, r2 + ldrh r1, [r1, 0xE] + adds r0, r1 + bx lr + thumb_func_end sub_813BFF8 + + thumb_func_start sub_813C008 +sub_813C008: @ 813C008 + push {r4-r7,lr} + adds r7, r1, 0 + lsls r2, 16 + lsrs r6, r2, 16 + movs r5, 0 + adds r4, r0, 0 +_0813C014: + adds r0, r4, 0 + adds r1, r7, 0 + movs r2, 0x7 + bl CompareString_LimitN + cmp r0, 0 + bne _0813C02C + ldrh r0, [r4, 0x8] + cmp r0, r6 + bne _0813C02C + adds r0, r5, 0 + b _0813C036 +_0813C02C: + adds r4, 0x10 + adds r5, 0x1 + cmp r5, 0x4 + ble _0813C014 + movs r0, 0x5 +_0813C036: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_813C008 + + thumb_func_start sub_813C03C +sub_813C03C: @ 813C03C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r10, r0 + movs r1, 0x4 +_0813C04C: + subs r3, r1, 0x1 + adds r6, r3, 0 + cmp r3, 0 + blt _0813C0BA + lsls r0, r1, 4 + add r0, r10 + str r0, [sp, 0x14] + lsls r0, r3, 4 + mov r2, r10 + adds r5, r0, r2 + movs r4, 0x50 + add r4, r10 + mov r9, r4 + add r1, r9 + mov r8, r1 +_0813C06A: + ldr r0, [sp, 0x14] + str r3, [sp, 0x10] + bl sub_813BFF8 + adds r4, r0, 0 + adds r0, r5, 0 + bl sub_813BFF8 + ldr r3, [sp, 0x10] + cmp r4, r0 + ble _0813C0B2 + mov r1, sp + ldr r0, [sp, 0x14] + ldm r0!, {r2,r4,r7} + stm r1!, {r2,r4,r7} + ldr r0, [r0] + str r0, [r1] + ldr r1, [sp, 0x14] + adds r0, r5, 0 + ldm r0!, {r2,r4,r7} + stm r1!, {r2,r4,r7} + ldr r0, [r0] + str r0, [r1] + adds r1, r5, 0 + mov r0, sp + ldm r0!, {r2,r4,r7} + stm r1!, {r2,r4,r7} + ldr r0, [r0] + str r0, [r1] + mov r7, r8 + ldrb r2, [r7] + mov r0, r9 + adds r1, r0, r6 + ldrb r0, [r1] + strb r0, [r7] + strb r2, [r1] +_0813C0B2: + subs r5, 0x10 + subs r6, 0x1 + cmp r6, 0 + bge _0813C06A +_0813C0BA: + adds r1, r3, 0 + cmp r1, 0 + bgt _0813C04C + 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_813C03C + + thumb_func_start sub_813C0D0 +sub_813C0D0: @ 813C0D0 + push {lr} + adds r2, r0, 0 + cmp r1, 0x2 + beq _0813C100 + cmp r1, 0x2 + bgt _0813C0E2 + cmp r1, 0x1 + beq _0813C0E8 + b _0813C12A +_0813C0E2: + cmp r1, 0x3 + beq _0813C118 + b _0813C12A +_0813C0E8: + ldrh r0, [r2, 0xA] + adds r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x0000270f + cmp r0, r1 + bls _0813C12A + strh r1, [r2, 0xA] + b _0813C12A + .pool +_0813C100: + ldrh r0, [r2, 0xC] + adds r0, 0x1 + strh r0, [r2, 0xC] + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x0000270f + cmp r0, r1 + bls _0813C12A + strh r1, [r2, 0xC] + b _0813C12A + .pool +_0813C118: + ldrh r0, [r2, 0xE] + adds r0, 0x1 + strh r0, [r2, 0xE] + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x0000270f + cmp r0, r1 + bls _0813C12A + strh r1, [r2, 0xE] +_0813C12A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_813C0D0 + + thumb_func_start sub_813C134 +sub_813C134: @ 813C134 + push {r4,lr} + cmp r0, 0x2 + beq _0813C14E + cmp r0, 0x2 + bgt _0813C144 + cmp r0, 0x1 + beq _0813C14A + b _0813C166 +_0813C144: + cmp r0, 0x3 + beq _0813C152 + b _0813C166 +_0813C14A: + movs r4, 0x17 + b _0813C154 +_0813C14E: + movs r4, 0x18 + b _0813C154 +_0813C152: + movs r4, 0x19 +_0813C154: + adds r0, r4, 0 + bl sub_80847F8 + ldr r1, =0x0000270e + cmp r0, r1 + bhi _0813C166 + adds r0, r4, 0 + bl sav12_xor_increment +_0813C166: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813C134 + + thumb_func_start sub_813C170 +sub_813C170: @ 813C170 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r6, r0, 0 + mov r8, r1 + mov r10, r3 + ldr r0, [sp, 0x20] + lsls r2, 16 + lsrs r7, r2, 16 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r0, r10 + bl sub_813C134 + adds r0, r6, 0 + bl sub_813C03C + adds r0, r6, 0 + mov r1, r8 + adds r2, r7, 0 + bl sub_813C008 + adds r5, r0, 0 + cmp r5, 0x5 + bne _0813C1D4 + movs r5, 0x4 + adds r4, r6, 0 + adds r4, 0x40 + adds r0, r4, 0 + bl sub_813BF94 + adds r0, r4, 0 + mov r1, r8 + movs r2, 0x7 + bl CopyString_LimitN + strh r7, [r4, 0x8] + adds r2, r6, 0 + adds r2, 0x54 + ldr r1, =0x020229e8 + mov r3, r9 + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x1A] + strb r0, [r2] +_0813C1D4: + lsls r0, r5, 4 + adds r0, r6, r0 + mov r1, r10 + bl sub_813C0D0 + adds r0, r6, 0 + bl sub_813C03C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813C170 + + thumb_func_start sub_813C1F8 +sub_813C1F8: @ 813C1F8 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003150 + adds r0, r1 + bl sub_813BFC4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_813C1F8 + + thumb_func_start sub_813C214 +sub_813C214: @ 813C214 + push {lr} + movs r1, 0x64 + muls r1, r0 + ldr r0, =0x02039b6c + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + ldr r2, =0x0000270f + cmp r0, r2 + bls _0813C230 + strh r2, [r1] +_0813C230: + pop {r0} + bx r0 + .pool + thumb_func_end sub_813C214 + + thumb_func_start sub_813C23C +sub_813C23C: @ 813C23C + push {lr} + movs r1, 0x64 + muls r1, r0 + ldr r0, =0x02039b6e + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + ldr r2, =0x0000270f + cmp r0, r2 + bls _0813C258 + strh r2, [r1] +_0813C258: + pop {r0} + bx r0 + .pool + thumb_func_end sub_813C23C + + thumb_func_start sub_813C264 +sub_813C264: @ 813C264 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0202433a + ldrb r0, [r0] + cmp r0, 0x1 + beq _0813C27C + cmp r0, 0x2 + beq _0813C28A + b _0813C298 + .pool +_0813C27C: + eors r0, r4 + bl sub_813C214 + adds r0, r4, 0 + bl sub_813C23C + b _0813C298 +_0813C28A: + movs r0, 0x1 + eors r0, r4 + bl sub_813C23C + adds r0, r4, 0 + bl sub_813C214 +_0813C298: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_813C264 + + thumb_func_start sub_813C2A0 +sub_813C2A0: @ 813C2A0 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + bl InUnionRoom + cmp r0, 0x1 + beq _0813C2DA + adds r0, r4, 0 + bl sub_813C264 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003150 + adds r0, r1 + movs r1, 0x64 + adds r3, r4, 0 + muls r3, r1 + ldr r2, =0x02039b88 + adds r1, r3, r2 + subs r2, 0x30 + adds r3, r2 + ldrh r2, [r3, 0xE] + ldr r3, =0x0202433a + ldrb r3, [r3] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp] + bl sub_813C170 +_0813C2DA: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813C2A0 + + thumb_func_start sub_813C2F4 +sub_813C2F4: @ 813C2F4 + push {r4,lr} + sub sp, 0xC + ldr r4, =0x02021cc4 + movs r0, 0x17 + bl sub_80847F8 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldr r4, =0x02021dc4 + movs r0, 0x18 + bl sub_80847F8 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldr r4, =0x02021ec4 + movs r0, 0x19 + bl sub_80847F8 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EF6A1 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xD0 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + ldr r0, =0x0203ab74 + ldrb r0, [r0] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x11 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + bl Print + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813C2F4 + + thumb_func_start sub_813C384 +sub_813C384: @ 813C384 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r6, r0, 0 + adds r5, r2, 0 + lsls r1, 24 + lsrs r4, r1, 24 + ldrh r0, [r6, 0xA] + cmp r0, 0 + bne _0813C40C + ldr r7, [r6, 0xC] + cmp r7, 0 + bne _0813C40C + ldr r0, =0x0203ab74 + mov r8, r0 + ldrb r0, [r0] + ldr r2, =gUnknown_085B3D84 + lsls r4, 3 + adds r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp] + str r7, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + mov r1, r8 + ldrb r0, [r1] + ldr r5, =gUnknown_085B3D8C + str r4, [sp] + str r7, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0x50 + bl Print + mov r1, r8 + ldrb r0, [r1] + str r4, [sp] + str r7, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0x80 + bl Print + mov r1, r8 + ldrb r0, [r1] + str r4, [sp] + str r7, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0xB0 + bl Print + b _0813C4A8 + .pool +_0813C40C: + ldr r0, =0x02021cc4 + movs r1, 0x8 + bl RepeatStringTerminator + ldr r0, =0x02021cc4 + adds r1, r6, 0 + movs r2, 0x7 + bl CopyString_LimitN + lsls r1, r5, 24 + lsrs r1, 24 + ldr r0, =0x02021cc4 + bl StopMusicWhileStringIsPrinted + ldr r0, =0x0203ab74 + mov r8, r0 + ldrb r0, [r0] + lsls r4, 3 + adds r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp] + movs r5, 0 + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + ldr r2, =0x02021cc4 + movs r3, 0x8 + bl Print + ldrh r1, [r6, 0xA] + ldr r0, =0x02021cc4 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalString + mov r1, r8 + ldrb r0, [r1] + str r4, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + ldr r2, =0x02021cc4 + movs r3, 0x50 + bl Print + ldrh r1, [r6, 0xC] + ldr r0, =0x02021cc4 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalString + mov r1, r8 + ldrb r0, [r1] + str r4, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + ldr r2, =0x02021cc4 + movs r3, 0x80 + bl Print + ldrh r1, [r6, 0xE] + ldr r0, =0x02021cc4 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalString + mov r1, r8 + ldrb r0, [r1] + str r4, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + ldr r2, =0x02021cc4 + movs r3, 0xB0 + bl Print +_0813C4A8: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813C384 + + thumb_func_start sub_813C4BC +sub_813C4BC: @ 813C4BC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + ldr r6, =0x0203ab74 + ldr r0, =gUnknown_085B3D7C + bl AddWindow + strb r0, [r6] + ldrb r0, [r6] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r6] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r5, =0x02021fc4 + ldr r1, =gUnknown_085EF68D + adds r0, r5, 0 + bl ExpandStringRefs + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0xD0 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + ldrb r0, [r6] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x1 + str r1, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + adds r2, r5, 0 + bl Print + ldr r0, =0x03005d8c + mov r8, r0 + ldr r0, [r0] + ldr r1, =0x00003150 + mov r9, r1 + add r0, r9 + bl sub_813C2F4 + ldr r1, =gUnknown_085EF6BD + adds r0, r5, 0 + bl ExpandStringRefs + ldrb r0, [r6] + movs r1, 0x29 + str r1, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0 + bl Print + mov r7, r8 + movs r6, 0xE0 + lsls r6, 19 + mov r5, r9 +_0813C540: + ldr r2, [r7] + adds r0, r2, r5 + lsrs r1, r6, 24 + ldr r3, =0x000031a0 + adds r2, r3 + adds r2, r4 + ldrb r2, [r2] + bl sub_813C384 + movs r0, 0x80 + lsls r0, 18 + adds r6, r0 + adds r5, 0x10 + adds r4, 0x1 + cmp r4, 0x4 + ble _0813C540 + ldr r4, =0x0203ab74 + ldrb r0, [r4] + bl PutWindowTilemap + ldrb r0, [r4] + 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_813C4BC + + thumb_func_start sub_813C5A0 +sub_813C5A0: @ 813C5A0 + push {r4,lr} + ldr r4, =0x0203ab74 + ldrb r0, [r4] + movs r1, 0 + bl sub_819746C + ldrb r0, [r4] + bl RemoveWindow + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813C5A0 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/battle_setup.s b/asm/battle_setup.s new file mode 100644 index 000000000..b9a19f664 --- /dev/null +++ b/asm/battle_setup.s @@ -0,0 +1,3550 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start task01_battle_start +task01_battle_start: @ 80B05F0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080B0614 + cmp r0, 0x1 + beq _080B062E + b _080B0652 + .pool +_080B0614: + bl c3_80A0DD8_is_running + cmp r0, 0 + bne _080B0652 + ldrb r0, [r4, 0x2] + bl sub_8145EF4 + bl sub_81BE72C + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _080B0652 +_080B062E: + bl sub_8145F20 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B0652 + bl overworld_free_bg_tilemaps + ldr r0, =sub_8036760 + bl SetMainCallback2 + bl prev_quest_postbuffer_cursor_backup_reset + bl overworld_poison_timer_set + adds r0, r5, 0 + bl DestroyTask +_080B0652: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end task01_battle_start + + thumb_func_start task_add_01_battle_start +task_add_01_battle_start: @ 80B065C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 16 + lsrs r5, 16 + ldr r0, =task01_battle_start + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0xA] + adds r0, r5, 0 + bl current_map_music_set__default_for_battle + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end task_add_01_battle_start + + thumb_func_start sub_80B0698 +sub_80B0698: @ 80B0698 + push {lr} + bl GetSafariZoneFlag + cmp r0, 0 + beq _080B06A8 + bl sub_80B077C + b _080B06AC +_080B06A8: + bl sub_80B06BC +_080B06AC: + pop {r0} + bx r0 + thumb_func_end sub_80B0698 + + thumb_func_start sub_80B06B0 +sub_80B06B0: @ 80B06B0 + push {lr} + bl sub_80B07B4 + pop {r0} + bx r0 + thumb_func_end sub_80B06B0 + + thumb_func_start sub_80B06BC +sub_80B06BC: @ 80B06BC + push {r4,lr} + bl script_env_2_enable + bl player_bitmagic + bl sub_808BCF4 + ldr r1, =0x030022c0 + ldr r0, =sub_80B0AF8 + str r0, [r1, 0x8] + ldr r4, =0x02022fec + movs r0, 0 + str r0, [r4] + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _080B06F2 + ldr r0, =0x0000400e + movs r1, 0 + bl VarSet + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 14 + orrs r0, r1 + str r0, [r4] +_080B06F2: + bl sub_80B0EC8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl task_add_01_battle_start + movs r0, 0x7 + bl sav12_xor_increment + movs r0, 0x8 + bl sav12_xor_increment + bl sub_80EECC8 + bl sub_80B1218 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B06BC + + thumb_func_start sub_80B072C +sub_80B072C: @ 80B072C + push {lr} + bl script_env_2_enable + bl player_bitmagic + bl sub_808BCF4 + ldr r1, =0x030022c0 + ldr r0, =sub_80B0AF8 + str r0, [r1, 0x8] + ldr r1, =0x02022fec + movs r0, 0x80 + lsls r0, 3 + str r0, [r1] + bl sub_80B0EC8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl task_add_01_battle_start + movs r0, 0x7 + bl sav12_xor_increment + movs r0, 0x8 + bl sav12_xor_increment + bl sub_80EECC8 + bl sub_80B1218 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B072C + + thumb_func_start sub_80B077C +sub_80B077C: @ 80B077C + push {lr} + bl script_env_2_enable + bl player_bitmagic + bl sub_808BCF4 + ldr r1, =0x030022c0 + ldr r0, =sub_80FC190 + str r0, [r1, 0x8] + ldr r1, =0x02022fec + movs r0, 0x80 + str r0, [r1] + bl sub_80B0EC8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl task_add_01_battle_start + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B077C + + thumb_func_start sub_80B07B4 +sub_80B07B4: @ 80B07B4 + push {lr} + bl script_env_2_enable + bl player_bitmagic + bl sub_808BCF4 + ldr r1, =0x030022c0 + ldr r0, =sub_80B0AF8 + str r0, [r1, 0x8] + ldr r1, =0x02022fec + movs r0, 0x80 + lsls r0, 13 + str r0, [r1] + bl sub_80B0EC8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl task_add_01_battle_start + movs r0, 0x7 + bl sav12_xor_increment + movs r0, 0x8 + bl sav12_xor_increment + bl sub_80EECC8 + bl sub_80B1218 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B07B4 + + thumb_func_start task_add_01_battle_start_with_music_and_stats +task_add_01_battle_start_with_music_and_stats: @ 80B0804 + push {lr} + bl reads_trainer_data_byte1_byte0x18 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl task_add_01_battle_start + movs r0, 0x7 + bl sav12_xor_increment + movs r0, 0x9 + bl sav12_xor_increment + bl sub_80B1234 + pop {r0} + bx r0 + thumb_func_end task_add_01_battle_start_with_music_and_stats + + thumb_func_start sub_80B0828 +sub_80B0828: @ 80B0828 + push {lr} + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _080B0846 + movs r0, 0xA + bl sub_80B100C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl task_add_01_battle_start + b _080B0856 +_080B0846: + movs r0, 0xB + bl sub_80B100C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl task_add_01_battle_start +_080B0856: + movs r0, 0x7 + bl sav12_xor_increment + movs r0, 0x9 + bl sav12_xor_increment + bl sub_80B1234 + pop {r0} + bx r0 + thumb_func_end sub_80B0828 + + thumb_func_start sub_80B086C +sub_80B086C: @ 80B086C + push {lr} + ldr r0, =0x02024744 + movs r1, 0xC4 + lsls r1, 1 + movs r2, 0x5 + bl sub_8067FF8 + bl script_env_2_enable + ldr r1, =0x030022c0 + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + str r0, [r1, 0x8] + ldr r1, =0x02022fec + movs r0, 0x80 + lsls r0, 2 + str r0, [r1] + movs r0, 0x8 + movs r1, 0 + bl task_add_01_battle_start + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B086C + + thumb_func_start sub_80B08A8 +sub_80B08A8: @ 80B08A8 + push {lr} + bl script_env_2_enable + ldr r1, =0x030022c0 + ldr r0, =sub_80B0B6C + str r0, [r1, 0x8] + ldr r1, =0x02022fec + movs r0, 0 + str r0, [r1] + bl sub_80B0EC8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl task_add_01_battle_start + movs r0, 0x7 + bl sav12_xor_increment + movs r0, 0x8 + bl sav12_xor_increment + bl sub_80EECC8 + bl sub_80B1218 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B08A8 + + thumb_func_start sub_80B08EC +sub_80B08EC: @ 80B08EC + push {lr} + bl script_env_2_enable + ldr r1, =0x030022c0 + ldr r0, =sub_80B0B6C + str r0, [r1, 0x8] + ldr r1, =0x02022fec + movs r0, 0x80 + lsls r0, 6 + str r0, [r1] + bl sub_80B0EC8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl task_add_01_battle_start + movs r0, 0x7 + bl sav12_xor_increment + movs r0, 0x8 + bl sav12_xor_increment + bl sub_80EECC8 + bl sub_80B1218 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B08EC + + thumb_func_start sub_80B0934 +sub_80B0934: @ 80B0934 + push {r4,lr} + bl script_env_2_enable + ldr r1, =0x030022c0 + ldr r0, =sub_80B0B6C + str r0, [r1, 0x8] + ldr r4, =0x02022fec + movs r0, 0x80 + lsls r0, 6 + str r0, [r4] + ldr r0, =0x02024744 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + movs r0, 0xCA + lsls r0, 1 + cmp r1, r0 + beq _080B09B8 + cmp r1, r0 + bhi _080B0988 + cmp r1, 0x97 + beq _080B09F4 + cmp r1, 0x97 + bcc _080B099A + cmp r1, 0xFA + bhi _080B099A + cmp r1, 0xF9 + bcc _080B099A + ldr r1, =0x00000229 + b _080B09E6 + .pool +_080B0988: + movs r0, 0xCB + lsls r0, 1 + cmp r1, r0 + beq _080B09CE + cmp r1, r0 + bcc _080B099A + adds r0, 0x4 + cmp r1, r0 + beq _080B09E4 +_080B099A: + ldr r2, =0x02022fec + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 21 + orrs r0, r1 + str r0, [r2] + movs r1, 0xF0 + lsls r1, 1 + movs r0, 0x17 + bl task_add_01_battle_start + b _080B09FE + .pool +_080B09B8: + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 22 + orrs r0, r1 + str r0, [r4] + movs r1, 0xF0 + lsls r1, 1 + movs r0, 0x16 + bl task_add_01_battle_start + b _080B09FE +_080B09CE: + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 23 + orrs r0, r1 + str r0, [r4] + movs r1, 0xEB + lsls r1, 1 + movs r0, 0x18 + bl task_add_01_battle_start + b _080B09FE +_080B09E4: + ldr r1, =0x00000227 +_080B09E6: + movs r0, 0 + bl task_add_01_battle_start + b _080B09FE + .pool +_080B09F4: + movs r1, 0xEC + lsls r1, 1 + movs r0, 0xA + bl task_add_01_battle_start +_080B09FE: + movs r0, 0x7 + bl sav12_xor_increment + movs r0, 0x8 + bl sav12_xor_increment + bl sub_80EECC8 + bl sub_80B1218 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B0934 + + thumb_func_start sub_80B0A18 +sub_80B0A18: @ 80B0A18 + push {lr} + bl script_env_2_enable + ldr r1, =0x030022c0 + ldr r0, =sub_80B0B6C + str r0, [r1, 0x8] + ldr r1, =0x02022fec + movs r0, 0xC0 + lsls r0, 6 + str r0, [r1] + ldr r0, =gUnknown_82E9530 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080B0A50 + movs r1, 0xF0 + lsls r1, 1 + movs r0, 0xB + bl task_add_01_battle_start + b _080B0A5A + .pool +_080B0A50: + movs r1, 0xF0 + lsls r1, 1 + movs r0, 0x6 + bl task_add_01_battle_start +_080B0A5A: + movs r0, 0x7 + bl sav12_xor_increment + movs r0, 0x8 + bl sav12_xor_increment + bl sub_80EECC8 + bl sub_80B1218 + pop {r0} + bx r0 + thumb_func_end sub_80B0A18 + + thumb_func_start sub_80B0A74 +sub_80B0A74: @ 80B0A74 + push {lr} + bl script_env_2_enable + ldr r1, =0x030022c0 + ldr r0, =sub_80B0B6C + str r0, [r1, 0x8] + ldr r1, =0x02022fec + movs r0, 0xC0 + lsls r0, 7 + str r0, [r1] + ldr r0, =0x02024744 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + adds r2, r1, 0 + movs r0, 0xC9 + lsls r0, 1 + cmp r1, r0 + beq _080B0ACC + cmp r1, r0 + bgt _080B0ABC + subs r0, 0x1 + cmp r1, r0 + beq _080B0AC8 + b _080B0AD4 + .pool +_080B0ABC: + ldr r0, =0x00000193 + cmp r2, r0 + beq _080B0AD0 + b _080B0AD4 + .pool +_080B0AC8: + movs r0, 0x15 + b _080B0AD6 +_080B0ACC: + movs r0, 0x13 + b _080B0AD6 +_080B0AD0: + movs r0, 0x14 + b _080B0AD6 +_080B0AD4: + movs r0, 0xA +_080B0AD6: + ldr r1, =0x000001df + bl task_add_01_battle_start + movs r0, 0x7 + bl sav12_xor_increment + movs r0, 0x8 + bl sav12_xor_increment + bl sub_80EECC8 + bl sub_80B1218 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B0A74 + + thumb_func_start sub_80B0AF8 +sub_80B0AF8: @ 80B0AF8 + push {lr} + sub sp, 0x4 + mov r1, sp + movs r0, 0 + strh r0, [r1] + movs r1, 0xA0 + lsls r1, 19 + ldr r2, =0x01000100 + mov r0, sp + bl CpuSet + movs r0, 0 + movs r1, 0x80 + bl ResetSpriteRange + ldr r0, =0x0202433a + ldrb r0, [r0] + bl battle_exit_is_player_defeat + cmp r0, 0x1 + bne _080B0B4C + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _080B0B4C + bl InBattlePike + lsls r0, 24 + cmp r0, 0 + bne _080B0B4C + ldr r0, =c2_whiteout + bl SetMainCallback2 + b _080B0B58 + .pool +_080B0B4C: + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + ldr r1, =0x03005dac + ldr r0, =sub_80AF6F0 + str r0, [r1] +_080B0B58: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B0AF8 + + thumb_func_start sub_80B0B6C +sub_80B0B6C: @ 80B0B6C + push {lr} + sub sp, 0x4 + mov r1, sp + movs r0, 0 + strh r0, [r1] + movs r1, 0xA0 + lsls r1, 19 + ldr r2, =0x01000100 + mov r0, sp + bl CpuSet + movs r0, 0 + movs r1, 0x80 + bl ResetSpriteRange + ldr r0, =0x0202433a + ldrb r0, [r0] + bl battle_exit_is_player_defeat + cmp r0, 0x1 + bne _080B0BC0 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _080B0BB4 + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + b _080B0BC6 + .pool +_080B0BB4: + ldr r0, =c2_whiteout + bl SetMainCallback2 + b _080B0BC6 + .pool +_080B0BC0: + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 +_080B0BC6: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B0B6C + + thumb_func_start sub_80B0BD0 +sub_80B0BD0: @ 80B0BD0 + push {r4,r5,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r5, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl MetatileBehavior_IsTallGrass + lsls r0, 24 + cmp r0, 0 + beq _080B0C06 + movs r0, 0 + b _080B0D1A +_080B0C06: + adds r0, r4, 0 + bl MetatileBehavior_IsLongGrass + lsls r0, 24 + cmp r0, 0 + beq _080B0C16 + movs r0, 0x1 + b _080B0D1A +_080B0C16: + adds r0, r4, 0 + bl MetatileBehavior_IsSandOrDeepSand + lsls r0, 24 + cmp r0, 0 + bne _080B0D18 + ldr r0, =0x02037318 + ldrb r0, [r0, 0x17] + subs r0, 0x1 + cmp r0, 0x8 + bhi _080B0C9C + lsls r0, 2 + ldr r1, =_080B0C40 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080B0C40: + .4byte _080B0C9C + .4byte _080B0C9C + .4byte _080B0C9C + .4byte _080B0C64 + .4byte _080B0C88 + .4byte _080B0C8C + .4byte _080B0C9C + .4byte _080B0C74 + .4byte _080B0C74 +_080B0C64: + lsls r0, r5, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8089588 + lsls r0, 24 + cmp r0, 0 + beq _080B0C78 +_080B0C74: + movs r0, 0x8 + b _080B0D1A +_080B0C78: + adds r0, r4, 0 + bl MetatileBehavior_IsSurfableWaterOrUnderwater + lsls r0, 24 + cmp r0, 0 + bne _080B0CE0 + movs r0, 0x7 + b _080B0D1A +_080B0C88: + movs r0, 0x3 + b _080B0D1A +_080B0C8C: + lsls r0, r5, 24 + lsrs r0, 24 + bl MetatileBehavior_IsSurfableWaterOrUnderwater + lsls r0, 24 + cmp r0, 0 + bne _080B0CF2 + b _080B0D10 +_080B0C9C: + lsls r0, r5, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_808962C + lsls r0, 24 + cmp r0, 0 + bne _080B0CF2 + adds r0, r4, 0 + bl MetatileBehavior_IsSurfableWaterOrUnderwater + lsls r0, 24 + cmp r0, 0 + bne _080B0CE0 + adds r0, r4, 0 + bl sub_808959C + lsls r0, 24 + cmp r0, 0 + beq _080B0CC8 + movs r0, 0x6 + b _080B0D1A +_080B0CC8: + movs r0, 0x8 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _080B0CF6 + adds r0, r4, 0 + bl sub_80894D4 + lsls r0, 24 + cmp r0, 0 + beq _080B0CE4 +_080B0CE0: + movs r0, 0x5 + b _080B0D1A +_080B0CE4: + adds r0, r4, 0 + bl sub_80894AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B0CF6 +_080B0CF2: + movs r0, 0x4 + b _080B0D1A +_080B0CF6: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0xE0 + lsls r0, 5 + cmp r1, r0 + beq _080B0D18 + bl sav1_get_weather_probably + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8 + beq _080B0D18 +_080B0D10: + movs r0, 0x9 + b _080B0D1A + .pool +_080B0D18: + movs r0, 0x2 +_080B0D1A: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B0BD0 + + thumb_func_start sub_80B0D24 +sub_80B0D24: @ 80B0D24 + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 16 + lsrs r4, r0, 16 + bl sav1_get_flash_used_on_map + lsls r0, 24 + cmp r0, 0 + beq _080B0D54 + movs r0, 0x2 + b _080B0D7E +_080B0D54: + lsls r0, r4, 24 + lsrs r0, 24 + bl MetatileBehavior_IsSurfableWaterOrUnderwater + lsls r0, 24 + cmp r0, 0 + bne _080B0D7C + ldr r0, =0x02037318 + ldrb r0, [r0, 0x17] + cmp r0, 0x4 + beq _080B0D78 + cmp r0, 0x5 + beq _080B0D7C + movs r0, 0 + b _080B0D7E + .pool +_080B0D78: + movs r0, 0x1 + b _080B0D7E +_080B0D7C: + movs r0, 0x3 +_080B0D7E: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B0D24 + + thumb_func_start sub_80B0D88 +sub_80B0D88: @ 80B0D88 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r7, 0 + movs r6, 0 +_080B0D92: + movs r0, 0x64 + adds r1, r6, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + adds r1, r0, 0 + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + beq _080B0DD6 + cmp r1, 0 + beq _080B0DD6 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _080B0DD6 + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + adds r0, r7, r0 + lsls r0, 24 + lsrs r7, r0, 24 + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _080B0DDC +_080B0DD6: + adds r6, 0x1 + cmp r6, 0x5 + ble _080B0D92 +_080B0DDC: + adds r0, r7, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B0D88 + + thumb_func_start reads_trainer_data_byte0 +reads_trainer_data_byte0: @ 80B0DE8 + push {r4,r5,lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r5, =gTrainers + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r2, r1, r5 + adds r0, r2, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, r4 + bcs _080B0E08 + adds r4, r0, 0 +_080B0E08: + movs r3, 0 + ldrb r0, [r2] + cmp r0, 0x1 + beq _080B0E50 + cmp r0, 0x1 + bgt _080B0E20 + cmp r0, 0 + beq _080B0E2A + b _080B0EC0 + .pool +_080B0E20: + cmp r0, 0x2 + beq _080B0E76 + cmp r0, 0x3 + beq _080B0E9C + b _080B0EC0 +_080B0E2A: + adds r0, r5, 0 + adds r0, 0x24 + adds r0, r1, r0 + ldr r1, [r0] + movs r2, 0 + cmp r3, r4 + bcs _080B0EC0 +_080B0E38: + lsls r0, r2, 3 + adds r0, r1 + ldrb r0, [r0, 0x2] + adds r0, r3, r0 + lsls r0, 24 + lsrs r3, r0, 24 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r4 + bcc _080B0E38 + b _080B0EC0 +_080B0E50: + adds r0, r5, 0 + adds r0, 0x24 + adds r0, r1, r0 + ldr r1, [r0] + movs r2, 0 + cmp r3, r4 + bcs _080B0EC0 +_080B0E5E: + lsls r0, r2, 4 + adds r0, r1 + ldrb r0, [r0, 0x2] + adds r0, r3, r0 + lsls r0, 24 + lsrs r3, r0, 24 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r4 + bcc _080B0E5E + b _080B0EC0 +_080B0E76: + adds r0, r5, 0 + adds r0, 0x24 + adds r0, r1, r0 + ldr r1, [r0] + movs r2, 0 + cmp r3, r4 + bcs _080B0EC0 +_080B0E84: + lsls r0, r2, 3 + adds r0, r1 + ldrb r0, [r0, 0x2] + adds r0, r3, r0 + lsls r0, 24 + lsrs r3, r0, 24 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r4 + bcc _080B0E84 + b _080B0EC0 +_080B0E9C: + adds r0, r5, 0 + adds r0, 0x24 + adds r0, r1, r0 + ldr r1, [r0] + movs r2, 0 + cmp r3, r4 + bcs _080B0EC0 +_080B0EAA: + lsls r0, r2, 4 + adds r0, r1 + ldrb r0, [r0, 0x2] + adds r0, r3, r0 + lsls r0, 24 + lsrs r3, r0, 24 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r4 + bcc _080B0EAA +_080B0EC0: + adds r0, r3, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end reads_trainer_data_byte0 + + thumb_func_start sub_80B0EC8 +sub_80B0EC8: @ 80B0EC8 + push {r4-r6,lr} + bl sub_80B0D24 + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + ldr r0, =0x02024744 + movs r1, 0x38 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl sub_80B0D88 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcs _080B0F10 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _080B0F04 + movs r0, 0 + b _080B0F2E + .pool +_080B0F04: + ldr r0, =gUnknown_0854FE88 + lsls r1, r5, 1 + b _080B0F20 + .pool +_080B0F10: + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _080B0F2C + ldr r0, =gUnknown_0854FE88 + lsls r1, r6, 1 + adds r0, 0x1 +_080B0F20: + adds r1, r0 + ldrb r0, [r1] + b _080B0F2E + .pool +_080B0F2C: + movs r0, 0xA +_080B0F2E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B0EC8 + + thumb_func_start reads_trainer_data_byte1_byte0x18 +reads_trainer_data_byte1_byte0x18: @ 80B0F34 + push {r4-r6,lr} + ldr r4, =0x02038bca + ldrh r1, [r4] + movs r0, 0x80 + lsls r0, 3 + cmp r1, r0 + beq _080B0F98 + ldr r1, =gTrainers + ldrh r2, [r4] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x1] + cmp r1, 0x1F + bne _080B0F94 + adds r1, r2, 0 + ldr r0, =0x00000105 + cmp r1, r0 + bne _080B0F6C + movs r0, 0xC + b _080B1000 + .pool +_080B0F6C: + movs r0, 0x83 + lsls r0, 1 + cmp r1, r0 + bne _080B0F78 + movs r0, 0xD + b _080B1000 +_080B0F78: + ldr r0, =0x00000107 + cmp r1, r0 + bne _080B0F88 + movs r0, 0xE + b _080B1000 + .pool +_080B0F88: + movs r0, 0x84 + lsls r0, 1 + cmp r1, r0 + bne _080B0F98 + movs r0, 0xF + b _080B1000 +_080B0F94: + cmp r1, 0x26 + bne _080B0F9C +_080B0F98: + movs r0, 0x10 + b _080B1000 +_080B0F9C: + cmp r1, 0x9 + beq _080B0FA8 + cmp r1, 0x35 + beq _080B0FA8 + cmp r1, 0x31 + bne _080B0FAC +_080B0FA8: + movs r0, 0x12 + b _080B1000 +_080B0FAC: + cmp r1, 0x3 + beq _080B0FB8 + cmp r1, 0xD + beq _080B0FB8 + cmp r1, 0xB + bne _080B0FBC +_080B0FB8: + movs r0, 0x11 + b _080B1000 +_080B0FBC: + ldrb r0, [r0, 0x18] + movs r5, 0x1 + cmp r0, 0x1 + bne _080B0FC6 + movs r5, 0x2 +_080B0FC6: + bl sub_80B0D24 + lsls r0, 24 + lsrs r6, r0, 24 + ldrh r0, [r4] + adds r1, r5, 0 + bl reads_trainer_data_byte0 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + bl sub_80B0D88 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcc _080B0FF8 + ldr r0, =gUnknown_0854FE90 + lsls r1, r6, 1 + adds r0, 0x1 + b _080B0FFC + .pool +_080B0FF8: + ldr r0, =gUnknown_0854FE90 + lsls r1, r6, 1 +_080B0FFC: + adds r1, r0 + ldrb r0, [r1] +_080B1000: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end reads_trainer_data_byte1_byte0x18 + + thumb_func_start sub_80B100C +sub_80B100C: @ 80B100C + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x02024744 + movs r1, 0x38 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl sub_80B0D88 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcs _080B1090 + cmp r5, 0xA + beq _080B1048 + cmp r5, 0xA + bgt _080B1040 + cmp r5, 0x3 + beq _080B105C + b _080B106C + .pool +_080B1040: + cmp r5, 0xD + bgt _080B106C + movs r0, 0x4 + b _080B1120 +_080B1048: + ldr r4, =gUnknown_0854FEA4 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + b _080B1114 + .pool +_080B105C: + ldr r4, =gUnknown_0854FEA7 + bl GenerateRandomNumber + ands r5, r0 + lsls r0, r5, 16 + b _080B111A + .pool +_080B106C: + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3 + beq _080B10EC + ldr r4, =gUnknown_0854FE98 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + b _080B1112 + .pool +_080B1090: + cmp r5, 0xA + beq _080B10A6 + cmp r5, 0xA + bgt _080B109E + cmp r5, 0x3 + beq _080B10B8 + b _080B10C8 +_080B109E: + cmp r5, 0xD + bgt _080B10C8 + movs r0, 0x3 + b _080B1120 +_080B10A6: + ldr r4, =gUnknown_0854FEA4 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + b _080B1114 + .pool +_080B10B8: + ldr r4, =gUnknown_0854FEA7 + bl GenerateRandomNumber + ands r5, r0 + lsls r0, r5, 16 + b _080B111A + .pool +_080B10C8: + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3 + beq _080B10EC + ldr r4, =gUnknown_0854FE98 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + b _080B1112 + .pool +_080B10EC: + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r2, =0x00000cb2 + adds r0, r1, r2 + ldrh r0, [r0] + lsls r2, r0, 2 + ldr r3, =0x00000cb4 + adds r1, r3 + adds r2, r1, r2 + lsls r0, 1 + adds r0, 0x1 + lsls r0, 1 + adds r1, r0 + ldrh r0, [r1] + ldrh r2, [r2] + adds r0, r2 + lsls r0, 16 + lsrs r0, 16 + ldr r4, =gUnknown_0854FE98 +_080B1112: + movs r1, 0xC +_080B1114: + bl __umodsi3 + lsls r0, 16 +_080B111A: + lsrs r0, 16 + adds r0, r4 + ldrb r0, [r0] +_080B1120: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B100C + + thumb_func_start sub_80B1138 +sub_80B1138: @ 80B1138 + push {lr} + ldr r0, =set_256color_bg_bg0 + bl SetMainCallback2 + ldr r1, =0x030022c0 + ldr r0, =sub_80B1158 + str r0, [r1, 0x8] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B1138 + + thumb_func_start sub_80B1158 +sub_80B1158: @ 80B1158 + push {lr} + sub sp, 0x8 + ldr r0, =0x00004023 + bl GetVarPointer + ldr r2, =0x020375f0 + ldrh r1, [r2] + strh r1, [r0] + ldrh r0, [r2] + bl sub_8133EDC + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + movs r1, 0x5 + movs r2, 0 + movs r3, 0 + bl sub_80F9244 + bl ResetTasks + bl sub_806E64C + ldr r0, =sub_80B11A8 + bl SetMainCallback2 + movs r0, 0 + bl sub_8145F10 + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B1158 + + thumb_func_start sub_80B11A8 +sub_80B11A8: @ 80B11A8 + push {lr} + bl fade_and_return_progress_probably + bl RunTasks + bl sub_8145F20 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B11F0 + ldr r1, =0x02022fec + movs r0, 0x10 + str r0, [r1] + ldr r1, =0x030022c0 + ldr r0, =sub_80B1204 + str r0, [r1, 0x8] + bl FreeAllWindowBuffers + ldr r0, =sub_8036760 + bl SetMainCallback2 + bl prev_quest_postbuffer_cursor_backup_reset + bl overworld_poison_timer_set + movs r0, 0x7 + bl sav12_xor_increment + movs r0, 0x8 + bl sav12_xor_increment + bl sub_80EECC8 + bl sub_80B1218 +_080B11F0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B11A8 + + thumb_func_start sub_80B1204 +sub_80B1204: @ 80B1204 + push {lr} + bl sav1_reset_battle_music_maybe + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B1204 + + thumb_func_start sub_80B1218 +sub_80B1218: @ 80B1218 + push {lr} + movs r0, 0x8 + bl sub_80847F8 + movs r1, 0x3C + bl __umodsi3 + cmp r0, 0 + bne _080B122E + bl sub_81DA57C +_080B122E: + pop {r0} + bx r0 + thumb_func_end sub_80B1218 + + thumb_func_start sub_80B1234 +sub_80B1234: @ 80B1234 + push {lr} + movs r0, 0x9 + bl sub_80847F8 + movs r1, 0x14 + bl __umodsi3 + cmp r0, 0 + bne _080B124A + bl sub_81DA57C +_080B124A: + pop {r0} + bx r0 + thumb_func_end sub_80B1234 + + thumb_func_start TrainerBattleLoadArg32 +@ u32 TrainerBattleLoadArg32(u8 *arg) +TrainerBattleLoadArg32: @ 80B1250 + adds r2, r0, 0 + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + lsls r1, 8 + orrs r0, r1 + ldrb r1, [r2, 0x2] + lsls r1, 16 + orrs r0, r1 + ldrb r1, [r2, 0x3] + lsls r1, 24 + orrs r0, r1 + bx lr + thumb_func_end TrainerBattleLoadArg32 + + thumb_func_start TrainerBattleLoadArg16 +@ u16 TrainerBattleLoadArg16(u8 *arg) +TrainerBattleLoadArg16: @ 80B1268 + adds r1, r0, 0 + ldrb r0, [r1] + ldrb r1, [r1, 0x1] + lsls r1, 8 + orrs r0, r1 + bx lr + thumb_func_end TrainerBattleLoadArg16 + + thumb_func_start TrainerBattleLoadArg8 +@ u8 TrainerBattleLoadArg8(u8 *arg) +TrainerBattleLoadArg8: @ 80B1274 + ldrb r0, [r0] + bx lr + thumb_func_end TrainerBattleLoadArg8 + + thumb_func_start trainerflag_opponent +trainerflag_opponent: @ 80B1278 + ldr r1, =0x02038bca + movs r2, 0xA0 + lsls r2, 3 + adds r0, r2, 0 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bx lr + .pool + thumb_func_end trainerflag_opponent + + thumb_func_start sub_80B1290 +sub_80B1290: @ 80B1290 + ldr r1, =0x02038bcc + movs r2, 0xA0 + lsls r2, 3 + adds r0, r2, 0 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bx lr + .pool + thumb_func_end sub_80B1290 + + thumb_func_start battle_exit_is_player_defeat +battle_exit_is_player_defeat: @ 80B12A8 + push {lr} + subs r0, 0x1 + cmp r0, 0x6 + bhi _080B12E0 + lsls r0, 2 + ldr r1, =_080B12C0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080B12C0: + .4byte _080B12E0 + .4byte _080B12DC + .4byte _080B12DC + .4byte _080B12E0 + .4byte _080B12E0 + .4byte _080B12E0 + .4byte _080B12E0 +_080B12DC: + movs r0, 0x1 + b _080B12E2 +_080B12E0: + movs r0, 0 +_080B12E2: + pop {r1} + bx r1 + thumb_func_end battle_exit_is_player_defeat + + thumb_func_start ResetTrainerOpponentIds +ResetTrainerOpponentIds: @ 80B12E8 + ldr r0, =0x02038bca + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02038bcc + strh r1, [r0] + bx lr + .pool + thumb_func_end ResetTrainerOpponentIds + + thumb_func_start InitTrainerBattleVariables +@ void InitTrainerBattleVariables() +InitTrainerBattleVariables: @ 80B12FC + push {lr} + ldr r0, =0x02038bc8 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02038bfc + ldrb r1, [r0] + cmp r1, 0 + bne _080B132C + ldr r0, =0x02038bd4 + str r1, [r0] + ldr r0, =0x02038bdc + str r1, [r0] + ldr r0, =0x02038bf0 + b _080B1338 + .pool +_080B132C: + ldr r0, =0x02038bd8 + movs r1, 0 + str r1, [r0] + ldr r0, =0x02038be0 + str r1, [r0] + ldr r0, =0x02038bf4 +_080B1338: + str r1, [r0] + ldr r1, =0x02038bd0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x02038be4 + movs r1, 0 + str r1, [r0] + ldr r0, =0x02038be8 + str r1, [r0] + ldr r0, =0x02038bec + str r1, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end InitTrainerBattleVariables + + thumb_func_start TrainerBattleLoadArgs +@ void TrainerBattleLoadArgs(struct TrainerBattleArgSpec *argSpecs, u8 *args) +TrainerBattleLoadArgs: @ 80B1370 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 +_080B1376: + ldrb r0, [r4, 0x4] + cmp r0, 0x6 + bhi _080B13E8 + lsls r0, 2 + ldr r1, =_080B138C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080B138C: + .4byte _080B13A8 + .4byte _080B13B6 + .4byte _080B13C4 + .4byte _080B13D2 + .4byte _080B13DA + .4byte _080B13E2 + .4byte _080B13EC +_080B13A8: + adds r0, r5, 0 + bl TrainerBattleLoadArg8 + ldr r1, [r4] + strb r0, [r1] + adds r5, 0x1 + b _080B13E8 +_080B13B6: + adds r0, r5, 0 + bl TrainerBattleLoadArg16 + ldr r1, [r4] + strh r0, [r1] + adds r5, 0x2 + b _080B13E8 +_080B13C4: + adds r0, r5, 0 + bl TrainerBattleLoadArg32 + ldr r1, [r4] + str r0, [r1] + adds r5, 0x4 + b _080B13E8 +_080B13D2: + ldr r1, [r4] + movs r0, 0 + strb r0, [r1] + b _080B13E8 +_080B13DA: + ldr r1, [r4] + movs r0, 0 + strh r0, [r1] + b _080B13E8 +_080B13E2: + ldr r1, [r4] + movs r0, 0 + str r0, [r1] +_080B13E8: + adds r4, 0x8 + b _080B1376 +_080B13EC: + ldr r0, [r4] + str r5, [r0] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end TrainerBattleLoadArgs + + thumb_func_start battle_80801F0 +battle_80801F0: @ 80B13F8 + push {lr} + ldr r0, =0x02038bd0 + ldrh r1, [r0] + cmp r1, 0 + beq _080B141A + ldr r0, =0x020375f2 + strh r1, [r0] + lsls r0, r1, 24 + lsrs r0, 24 + ldr r1, =0x03005d8c + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl GetFieldObjectIdByLocalIdAndMap + ldr r1, =0x03005df0 + strb r0, [r1] +_080B141A: + pop {r0} + bx r0 + .pool + thumb_func_end battle_80801F0 + + thumb_func_start TrainerBattleConfigure +@ u8 *TrainerBattleConfigure(u8 *args) +TrainerBattleConfigure: @ 80B1430 + push {r4,r5,lr} + adds r5, r0, 0 + bl InitTrainerBattleVariables + ldr r4, =0x02038bc8 + adds r0, r5, 0 + bl TrainerBattleLoadArg8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + ldrh r0, [r4] + subs r0, 0x1 + cmp r0, 0xB + bls _080B1450 + b _080B15F4 +_080B1450: + lsls r0, 2 + ldr r1, =_080B1464 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080B1464: + .4byte _080B14CC + .4byte _080B14B0 + .4byte _080B1494 + .4byte _080B14A8 + .4byte _080B1514 + .4byte _080B14D4 + .4byte _080B14EC + .4byte _080B14D4 + .4byte _080B153C + .4byte _080B1590 + .4byte _080B1598 + .4byte _080B15A8 +_080B1494: + ldr r0, =gUnknown_0854FF84 + adds r1, r5, 0 + bl TrainerBattleLoadArgs + ldr r0, =gUnknown_082713C2 + b _080B161E + .pool +_080B14A8: + ldr r0, =gUnknown_0854FF3C + b _080B14D6 + .pool +_080B14B0: + ldr r0, =0x02038bfc + ldrb r0, [r0] + cmp r0, 0 + bne _080B14C4 + ldr r0, =gUnknown_0854FEF4 + b _080B15FE + .pool +_080B14C4: + ldr r0, =gUnknown_0855005C + b _080B1616 + .pool +_080B14CC: + ldr r0, =gUnknown_0854FEF4 + b _080B15FE + .pool +_080B14D4: + ldr r0, =gUnknown_0854FFCC +_080B14D6: + adds r1, r5, 0 + bl TrainerBattleLoadArgs + bl battle_80801F0 + ldr r0, =gUnknown_0827138A + b _080B161E + .pool +_080B14EC: + ldr r0, =gUnknown_0854FF3C + adds r1, r5, 0 + bl TrainerBattleLoadArgs + bl battle_80801F0 + ldr r4, =0x02038bca + ldrh r0, [r4] + bl sub_80B2234 + strh r0, [r4] + ldr r0, =gUnknown_082713F8 + b _080B161E + .pool +_080B1514: + ldr r0, =gUnknown_0854FEAC + adds r1, r5, 0 + bl TrainerBattleLoadArgs + bl battle_80801F0 + ldr r4, =0x02038bca + ldrh r0, [r4] + bl sub_80B2234 + strh r0, [r4] + ldr r0, =gUnknown_082713D1 + b _080B161E + .pool +_080B153C: + ldr r0, =0x02038bfc + ldrb r0, [r0] + cmp r0, 0 + bne _080B156C + ldr r0, =gUnknown_0854FEAC + adds r1, r5, 0 + bl TrainerBattleLoadArgs + bl battle_80801F0 + ldr r0, =0x020375f2 + ldrb r0, [r0] + bl sub_81A9AA8 + ldr r1, =0x02038bca + b _080B157E + .pool +_080B156C: + ldr r0, =gUnknown_08550014 + adds r1, r5, 0 + bl TrainerBattleLoadArgs + ldr r0, =0x020375f2 + ldrb r0, [r0] + bl sub_81A9AA8 +_080B157C: + ldr r1, =0x02038bcc +_080B157E: + strh r0, [r1] + b _080B161C + .pool +_080B1590: + ldr r0, =gUnknown_0854FEAC + b _080B159A + .pool +_080B1598: + ldr r0, =gUnknown_08550014 +_080B159A: + adds r1, r5, 0 + bl TrainerBattleLoadArgs + movs r0, 0 + b _080B161E + .pool +_080B15A8: + ldr r0, =0x02038bfc + ldrb r0, [r0] + cmp r0, 0 + bne _080B15D8 + ldr r0, =gUnknown_0854FEAC + adds r1, r5, 0 + bl TrainerBattleLoadArgs + bl battle_80801F0 + ldr r0, =0x020375f2 + ldrb r0, [r0] + bl battle_init + ldr r1, =0x02038bca + b _080B157E + .pool +_080B15D8: + ldr r0, =gUnknown_08550014 + adds r1, r5, 0 + bl TrainerBattleLoadArgs + ldr r0, =0x020375f2 + ldrb r0, [r0] + bl battle_init + b _080B157C + .pool +_080B15F4: + ldr r0, =0x02038bfc + ldrb r0, [r0] + cmp r0, 0 + bne _080B1614 + ldr r0, =gUnknown_0854FEAC +_080B15FE: + adds r1, r5, 0 + bl TrainerBattleLoadArgs + bl battle_80801F0 + b _080B161C + .pool +_080B1614: + ldr r0, =gUnknown_08550014 +_080B1616: + adds r1, r5, 0 + bl TrainerBattleLoadArgs +_080B161C: + ldr r0, =gUnknown_08271362 +_080B161E: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end TrainerBattleConfigure + + thumb_func_start SingleTrainerWantsBattle +@ void SingleTrainerWantsBattle(u8 trainerFieldObjectId, u8 *trainerScript) +SingleTrainerWantsBattle: @ 80B162C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005df0 + strb r0, [r2] + ldr r4, =0x020375f2 + ldr r3, =0x02037350 + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + ldrb r0, [r2, 0x8] + strh r0, [r4] + adds r1, 0x1 + adds r0, r1, 0 + bl TrainerBattleConfigure + ldr r0, =gUnknown_08271354 + bl script_env_1_execute_new_script + bl script_env_2_enable + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end SingleTrainerWantsBattle + + thumb_func_start TwoTrainersWantBattle +@ void TwoTrainersWantBattle(u8 trainerFieldObjectId, u8 *trainerScript) +TwoTrainersWantBattle: @ 80B1670 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005df0 + strb r0, [r2] + ldr r4, =0x020375f2 + ldr r3, =0x02037350 + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + ldrb r0, [r2, 0x8] + strh r0, [r4] + adds r1, 0x1 + adds r0, r1, 0 + bl TrainerBattleConfigure + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end TwoTrainersWantBattle + + thumb_func_start TwoTrainersWantBattleExecuteScript +@ void TwoTrainersWantBattleExecuteScript() +TwoTrainersWantBattleExecuteScript: @ 80B16A4 + push {lr} + ldr r0, =gUnknown_08271354 + bl script_env_1_execute_new_script + bl script_env_2_enable + pop {r0} + bx r0 + .pool + thumb_func_end TwoTrainersWantBattleExecuteScript + + thumb_func_start GetTrainerFlagFromScriptPointer +@ u8 GetTrainerFlagFromScriptPointer(u8 *scriptPointer) +GetTrainerFlagFromScriptPointer: @ 80B16B8 + push {lr} + adds r0, 0x2 + bl TrainerBattleLoadArg16 + lsls r0, 16 + movs r1, 0xA0 + lsls r1, 19 + adds r0, r1 + lsrs r0, 16 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end GetTrainerFlagFromScriptPointer + + thumb_func_start sub_80B16D8 +sub_80B16D8: @ 80B16D8 + push {r4,lr} + ldr r0, =0x03005df0 + ldrb r0, [r0] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl npc_running_behaviour_by_direction + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_set_running_behaviour_etc + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B16D8 + + thumb_func_start sub_80B170C +sub_80B170C: @ 80B170C + ldr r0, =0x02038bc8 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80B170C + + thumb_func_start check_trainer_flag +@ pokescrcmd +check_trainer_flag: @ 80B1718 + push {lr} + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _080B1734 + ldr r0, =0x03005df0 + ldrb r0, [r0] + bl GetBattlePyramidTrainerFlag + b _080B1752 + .pool +_080B1734: + bl InTrainerHill + cmp r0, 0 + bne _080B174A + bl trainerflag_opponent + lsls r0, 16 + lsrs r0, 16 + bl FlagGet + b _080B1752 +_080B174A: + ldr r0, =0x03005df0 + ldrb r0, [r0] + bl GetTrainerHillTrainerFlag +_080B1752: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end check_trainer_flag + + thumb_func_start rom_npc_set_flag_for_script_id +rom_npc_set_flag_for_script_id: @ 80B1760 + push {lr} + ldr r0, =0x02038bcc + ldrh r0, [r0] + cmp r0, 0 + beq _080B1776 + bl sub_80B1290 + lsls r0, 16 + lsrs r0, 16 + bl FlagSet +_080B1776: + bl trainerflag_opponent + lsls r0, 16 + lsrs r0, 16 + bl FlagSet + pop {r0} + bx r0 + .pool + thumb_func_end rom_npc_set_flag_for_script_id + + thumb_func_start sub_80B178C +sub_80B178C: @ 80B178C + push {lr} + bl trainerflag_opponent + lsls r0, 16 + lsrs r0, 16 + bl FlagSet + pop {r0} + bx r0 + thumb_func_end sub_80B178C + + thumb_func_start trainer_flag_check +trainer_flag_check: @ 80B17A0 + push {lr} + lsls r0, 16 + movs r1, 0xA0 + lsls r1, 19 + adds r0, r1 + lsrs r0, 16 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end trainer_flag_check + + thumb_func_start trainer_flag_set +trainer_flag_set: @ 80B17B8 + push {lr} + lsls r0, 16 + movs r1, 0xA0 + lsls r1, 19 + adds r0, r1 + lsrs r0, 16 + bl FlagSet + pop {r0} + bx r0 + thumb_func_end trainer_flag_set + + thumb_func_start trainer_flag_clear +trainer_flag_clear: @ 80B17CC + push {lr} + lsls r0, 16 + movs r1, 0xA0 + lsls r1, 19 + adds r0, r1 + lsrs r0, 16 + bl FlagReset + pop {r0} + bx r0 + thumb_func_end trainer_flag_clear + + thumb_func_start sub_80B17E0 +sub_80B17E0: @ 80B17E0 + push {r4,lr} + ldr r0, =0x030060a8 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080B17FC + ldr r1, =0x02022fec + ldr r0, =0x00008009 + b _080B1800 + .pool +_080B17FC: + ldr r1, =0x02022fec + movs r0, 0x8 +_080B1800: + str r0, [r1] + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _080B1884 + ldr r0, =0x0000400e + movs r1, 0 + bl VarSet + ldr r2, =0x02022fec + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 14 + orrs r0, r1 + str r0, [r2] + ldr r0, =0x030060a8 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080B1864 + movs r0, 0x1 + bl sub_816306C + ldr r4, =0x020247a8 + adds r0, r4, 0 + bl zero_pokemon_struct + adds r0, r4, 0 + adds r0, 0x64 + bl zero_pokemon_struct + movs r1, 0x96 + lsls r1, 1 + adds r0, r4, r1 + bl zero_pokemon_struct + movs r1, 0xC8 + lsls r1, 1 + adds r0, r4, r1 + bl zero_pokemon_struct + b _080B187A + .pool +_080B1864: + movs r0, 0x1 + bl sub_8163048 + ldr r4, =0x020247a8 + adds r0, r4, 0 + bl zero_pokemon_struct + adds r4, 0x64 + adds r0, r4, 0 + bl zero_pokemon_struct +_080B187A: + bl sub_81A9B04 + b _080B18B8 + .pool +_080B1884: + bl sub_81D5C18 + lsls r0, 24 + cmp r0, 0 + beq _080B18B8 + ldr r2, =0x02022fec + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 19 + orrs r0, r1 + str r0, [r2] + ldr r0, =0x030060a8 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080B18B0 + bl sub_81D639C + b _080B18B4 + .pool +_080B18B0: + bl sub_81D6384 +_080B18B4: + bl sub_81D61E8 +_080B18B8: + ldr r1, =0x02038bf9 + ldr r2, =0x030060a8 + ldrb r0, [r2] + strb r0, [r1] + movs r1, 0 + strb r1, [r2] + ldr r0, =0x02038bf8 + strb r1, [r0] + ldr r1, =0x03006080 + movs r0, 0 + strh r0, [r1] + ldr r1, =0x030022c0 + ldr r0, =sub_80B1918 + str r0, [r1, 0x8] + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _080B18E8 + bl sub_81D5C18 + lsls r0, 24 + cmp r0, 0 + beq _080B1908 +_080B18E8: + bl sub_80B0828 + b _080B190C + .pool +_080B1908: + bl task_add_01_battle_start_with_music_and_stats +_080B190C: + bl script_env_2_set_ctx_paused + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B17E0 + + thumb_func_start sub_80B1918 +sub_80B1918: @ 80B1918 + push {lr} + ldr r0, =0x02038bca + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 3 + cmp r1, r0 + beq _080B1946 + ldr r0, =0x0202433a + ldrb r0, [r0] + bl battle_exit_is_player_defeat + cmp r0, 0x1 + bne _080B1968 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _080B1946 + bl sub_81D5C18 + lsls r0, 24 + cmp r0, 0 + beq _080B195C +_080B1946: + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + b _080B198A + .pool +_080B195C: + ldr r0, =c2_whiteout + bl SetMainCallback2 + b _080B198A + .pool +_080B1968: + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _080B198A + bl sub_81D5C18 + lsls r0, 24 + cmp r0, 0 + bne _080B198A + bl sub_80B20BC + bl rom_npc_set_flag_for_script_id +_080B198A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B1918 + + thumb_func_start sub_80B1994 +sub_80B1994: @ 80B1994 + push {lr} + ldr r0, =0x02038bca + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 3 + cmp r1, r0 + bne _080B19B4 + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + b _080B19E2 + .pool +_080B19B4: + ldr r0, =0x0202433a + ldrb r0, [r0] + bl battle_exit_is_player_defeat + cmp r0, 0x1 + bne _080B19D0 + ldr r0, =c2_whiteout + bl SetMainCallback2 + b _080B19E2 + .pool +_080B19D0: + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + bl sub_80B20BC + bl rom_npc_set_flag_for_script_id + bl sub_80B22BC +_080B19E2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B1994 + + thumb_func_start sub_80B19EC +sub_80B19EC: @ 80B19EC + push {lr} + ldr r1, =0x02022fec + movs r0, 0x8 + str r0, [r1] + ldr r1, =0x030022c0 + ldr r0, =sub_80B1994 + str r0, [r1, 0x8] + bl task_add_01_battle_start_with_music_and_stats + bl script_env_2_set_ctx_paused + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B19EC + + thumb_func_start sub_80B1A14 +sub_80B1A14: @ 80B1A14 + push {lr} + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _080B1A7C + ldr r0, =0x030060a8 + ldrb r0, [r0] + cmp r0, 0x1 + bhi _080B1A44 + ldr r0, =0x020375f2 + ldrb r0, [r0] + bl sub_81A9AA8 + lsls r0, 16 + lsrs r0, 16 + bl sub_81A9EDC + b _080B1AD8 + .pool +_080B1A44: + ldr r3, =0x02037350 + ldr r2, =0x03006090 + ldr r0, =0x02038bfc + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x8] + bl sub_81A9AA8 + lsls r0, 16 + lsrs r0, 16 + bl sub_81A9EDC + b _080B1AD8 + .pool +_080B1A7C: + bl sub_81D5C18 + lsls r0, 24 + cmp r0, 0 + beq _080B1AEC + ldr r0, =0x030060a8 + ldrb r0, [r0] + cmp r0, 0x1 + bhi _080B1AAC + ldr r0, =0x020375f2 + ldrb r0, [r0] + bl battle_init + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x2 + bl sub_81D572C + b _080B1AD8 + .pool +_080B1AAC: + ldr r3, =0x02037350 + ldr r2, =0x03006090 + ldr r0, =0x02038bfc + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x8] + bl battle_init + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x2 + bl sub_81D572C +_080B1AD8: + bl sub_80982B8 + b _080B1AF4 + .pool +_080B1AEC: + bl sub_80B1C7C + bl box_related_two__2 +_080B1AF4: + pop {r0} + bx r0 + thumb_func_end sub_80B1A14 + + thumb_func_start sub_80B1AF8 +sub_80B1AF8: @ 80B1AF8 + push {lr} + ldr r0, =0x02038bec + ldr r0, [r0] + cmp r0, 0 + bne _080B1B04 + ldr r0, =gUnknown_082C8436 +_080B1B04: + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B1AF8 + + thumb_func_start sub_80B1B10 +sub_80B1B10: @ 80B1B10 + push {lr} + ldr r1, =0x02038bf8 + ldrb r2, [r1] + cmp r2, 0 + beq _080B1B3C + movs r0, 0 + strb r0, [r1] + ldr r0, =0x02038bf4 + ldr r2, [r0] + cmp r2, 0 + beq _080B1B54 + ldr r1, =0x03006080 + movs r0, 0x1 + strh r0, [r1] + adds r0, r2, 0 + b _080B1B56 + .pool +_080B1B3C: + ldr r0, =0x02038bf0 + ldr r1, [r0] + cmp r1, 0 + beq _080B1B54 + ldr r0, =0x03006080 + strh r2, [r0] + adds r0, r1, 0 + b _080B1B56 + .pool +_080B1B54: + ldr r0, =gUnknown_082742E6 +_080B1B56: + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B1B10 + + thumb_func_start special_trainer_unable_to_battle +special_trainer_unable_to_battle: @ 80B1B60 + push {lr} + bl sub_80B1D18 + bl box_related_two__2 + pop {r0} + bx r0 + thumb_func_end special_trainer_unable_to_battle + + thumb_func_start SetUpTrainerEncounterMusic +@ void SetUpTrainerEncounterMusic() +SetUpTrainerEncounterMusic: @ 80B1B70 + push {lr} + ldr r0, =0x02038bfc + ldrb r0, [r0] + cmp r0, 0 + bne _080B1B88 + ldr r0, =0x02038bca + b _080B1B8A + .pool +_080B1B88: + ldr r0, =0x02038bcc +_080B1B8A: + ldrh r1, [r0] + ldr r0, =0x02038bc8 + ldrh r0, [r0] + cmp r0, 0x1 + beq _080B1C62 + cmp r0, 0x8 + beq _080B1C62 + adds r0, r1, 0 + bl GetTrainerEncounterMusicId + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD + bhi _080B1C5C + lsls r0, 2 + ldr r1, =_080B1BBC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080B1BBC: + .4byte _080B1BF4 + .4byte _080B1BFA + .4byte _080B1C04 + .4byte _080B1C5C + .4byte _080B1C0C + .4byte _080B1C12 + .4byte _080B1C1C + .4byte _080B1C24 + .4byte _080B1C2C + .4byte _080B1C34 + .4byte _080B1C3C + .4byte _080B1C42 + .4byte _080B1C4C + .4byte _080B1C54 +_080B1BF4: + movs r0, 0xBE + lsls r0, 1 + b _080B1C5E +_080B1BFA: + ldr r0, =0x00000197 + b _080B1C5E + .pool +_080B1C04: + ldr r0, =0x0000017b + b _080B1C5E + .pool +_080B1C0C: + movs r0, 0xD0 + lsls r0, 1 + b _080B1C5E +_080B1C12: + ldr r0, =0x000001a1 + b _080B1C5E + .pool +_080B1C1C: + ldr r0, =0x000001a3 + b _080B1C5E + .pool +_080B1C24: + ldr r0, =0x000001b9 + b _080B1C5E + .pool +_080B1C2C: + ldr r0, =0x00000181 + b _080B1C5E + .pool +_080B1C34: + ldr r0, =0x000001c1 + b _080B1C5E + .pool +_080B1C3C: + movs r0, 0xE1 + lsls r0, 1 + b _080B1C5E +_080B1C42: + ldr r0, =0x000001c3 + b _080B1C5E + .pool +_080B1C4C: + ldr r0, =0x000001c5 + b _080B1C5E + .pool +_080B1C54: + ldr r0, =0x0000018d + b _080B1C5E + .pool +_080B1C5C: + ldr r0, =0x000001a7 +_080B1C5E: + bl current_map_music_set +_080B1C62: + pop {r0} + bx r0 + .pool + thumb_func_end SetUpTrainerEncounterMusic + + thumb_func_start ReturnEmptyStringIfNull +@ u8 *ReturnEmptyStringIfNull(u8 *str) +ReturnEmptyStringIfNull: @ 80B1C6C + push {lr} + cmp r0, 0 + bne _080B1C74 + ldr r0, =gUnknown_085E8D03 +_080B1C74: + pop {r1} + bx r1 + .pool + thumb_func_end ReturnEmptyStringIfNull + + thumb_func_start sub_80B1C7C +sub_80B1C7C: @ 80B1C7C + push {lr} + ldr r0, =0x02038bfc + ldrb r0, [r0] + cmp r0, 0 + beq _080B1C94 + ldr r0, =0x02038bd8 + b _080B1C96 + .pool +_080B1C94: + ldr r0, =0x02038bd4 +_080B1C96: + ldr r0, [r0] + bl ReturnEmptyStringIfNull + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B1C7C + + thumb_func_start sub_80B1CA4 +sub_80B1CA4: @ 80B1CA4 + push {r4,lr} + ldr r0, =0x02038bca + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 3 + cmp r1, r0 + bne _080B1CBC + bl sub_80EA250 + b _080B1CC0 + .pool +_080B1CBC: + ldr r0, =0x02038bdc + ldr r0, [r0] +_080B1CC0: + ldr r4, =0x02021fc4 + bl ReturnEmptyStringIfNull + adds r1, r0, 0 + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B1CA4 + + thumb_func_start sub_80B1CE0 +sub_80B1CE0: @ 80B1CE0 + push {r4,lr} + ldr r4, =0x02021fc4 + ldr r0, =0x02038be0 + ldr r0, [r0] + bl ReturnEmptyStringIfNull + adds r1, r0, 0 + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B1CE0 + + thumb_func_start sub_80B1D04 +sub_80B1D04: @ 80B1D04 + push {lr} + ldr r0, =0x02038be4 + ldr r0, [r0] + bl ReturnEmptyStringIfNull + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B1D04 + + thumb_func_start sub_80B1D18 +sub_80B1D18: @ 80B1D18 + push {lr} + ldr r0, =0x02038be8 + ldr r0, [r0] + bl ReturnEmptyStringIfNull + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B1D18 + + thumb_func_start sub_80B1D2C +sub_80B1D2C: @ 80B1D2C + push {lr} + lsls r1, 16 + lsrs r1, 16 + movs r3, 0 + adds r2, r0, 0 +_080B1D36: + ldrh r0, [r2] + cmp r0, r1 + bne _080B1D40 + adds r0, r3, 0 + b _080B1D4C +_080B1D40: + adds r2, 0x10 + adds r3, 0x1 + cmp r3, 0x4D + ble _080B1D36 + movs r0, 0x1 + negs r0, r0 +_080B1D4C: + pop {r1} + bx r1 + thumb_func_end sub_80B1D2C + + thumb_func_start sub_80B1D50 +sub_80B1D50: @ 80B1D50 + push {r4,r5,lr} + lsls r1, 16 + lsrs r5, r1, 16 + movs r4, 0 + adds r2, r0, 0 +_080B1D5A: + movs r1, 0 + ldrh r0, [r2] + cmp r0, 0 + beq _080B1D80 + movs r3, 0 +_080B1D64: + adds r0, r2, r3 + ldrh r0, [r0] + cmp r0, r5 + bne _080B1D70 + adds r0, r4, 0 + b _080B1D8C +_080B1D70: + adds r3, 0x2 + adds r1, 0x1 + cmp r1, 0x4 + bgt _080B1D80 + adds r0, r2, r3 + ldrh r0, [r0] + cmp r0, 0 + bne _080B1D64 +_080B1D80: + adds r2, 0x10 + adds r4, 0x1 + cmp r4, 0x4D + ble _080B1D5A + movs r0, 0x1 + negs r0, r0 +_080B1D8C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B1D50 + + thumb_func_start sub_80B1D94 +sub_80B1D94: @ 80B1D94 + push {lr} + cmp r0, 0x48 + ble _080B1D9E + movs r0, 0x1 + b _080B1DB8 +_080B1D9E: + cmp r0, 0x40 + bne _080B1DB6 + movs r0, 0x7E + bl FlagGet + movs r1, 0 + lsls r0, 24 + cmp r0, 0 + bne _080B1DB2 + movs r1, 0x1 +_080B1DB2: + adds r0, r1, 0 + b _080B1DB8 +_080B1DB6: + movs r0, 0 +_080B1DB8: + pop {r1} + bx r1 + thumb_func_end sub_80B1D94 + + thumb_func_start sub_80B1DBC +sub_80B1DBC: @ 80B1DBC + push {r4-r6,lr} + adds r6, r1, 0 + movs r5, 0x1 + lsls r1, r6, 4 + adds r1, r0 + adds r4, r1, 0x2 + b _080B1DCE +_080B1DCA: + adds r4, 0x2 + adds r5, 0x1 +_080B1DCE: + cmp r5, 0x4 + bgt _080B1DE2 + ldrh r0, [r4] + cmp r0, 0 + beq _080B1DE2 + bl trainer_flag_check + lsls r0, 24 + cmp r0, 0 + bne _080B1DCA +_080B1DE2: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000009ca + adds r0, r1 + adds r0, r6 + strb r5, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B1DBC + + thumb_func_start sub_80B1DFC +sub_80B1DFC: @ 80B1DFC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + movs r7, 0 + movs r5, 0 + adds r4, r6, 0 + adds r4, 0xA +_080B1E1A: + ldrh r0, [r4] + cmp r0, r9 + bne _080B1E74 + ldrh r0, [r4, 0x2] + cmp r0, r8 + bne _080B1E74 + adds r0, r5, 0 + bl sub_80B1D94 + cmp r0, 0 + bne _080B1E74 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000009ca + adds r0, r1 + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _080B1E72 + movs r1, 0xAE + lsls r1, 1 + adds r0, r5, r1 + lsls r0, 16 + lsrs r0, 16 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _080B1E74 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1E + bhi _080B1E74 + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80B1DBC +_080B1E72: + movs r7, 0x1 +_080B1E74: + adds r4, 0x10 + adds r5, 0x1 + cmp r5, 0x40 + ble _080B1E1A + adds r0, r7, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B1DFC + + thumb_func_start sub_80B1E94 +sub_80B1E94: @ 80B1E94 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =gUnknown_085500A4 + lsls r0, r4, 4 + adds r0, r5 + ldrh r0, [r0] + bl trainer_flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B1EB4 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80B1DBC +_080B1EB4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B1E94 + + thumb_func_start sub_80B1EC0 +sub_80B1EC0: @ 80B1EC0 + push {r4-r6,lr} + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 16 + lsrs r2, 16 + movs r1, 0 + adds r3, r0, 0 + adds r3, 0xA + ldr r5, =0x03005d8c +_080B1ED2: + ldrh r0, [r3] + cmp r0, r4 + bne _080B1EF8 + ldrh r0, [r3, 0x2] + cmp r0, r2 + bne _080B1EF8 + ldr r0, [r5] + ldr r6, =0x000009ca + adds r0, r6 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080B1EF8 + movs r0, 0x1 + b _080B1F02 + .pool +_080B1EF8: + adds r3, 0x10 + adds r1, 0x1 + cmp r1, 0x4D + ble _080B1ED2 + movs r0, 0 +_080B1F02: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B1EC0 + + thumb_func_start sub_80B1F08 +sub_80B1F08: @ 80B1F08 + push {r4,lr} + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 16 + lsrs r2, 16 + movs r1, 0 + adds r3, r0, 0 + adds r3, 0xA +_080B1F18: + ldrh r0, [r3] + cmp r0, r4 + bne _080B1F28 + ldrh r0, [r3, 0x2] + cmp r0, r2 + bne _080B1F28 + movs r0, 0x1 + b _080B1F32 +_080B1F28: + adds r3, 0x10 + adds r1, 0x1 + cmp r1, 0x4D + ble _080B1F18 + movs r0, 0 +_080B1F32: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B1F08 + + thumb_func_start sub_80B1F38 +sub_80B1F38: @ 80B1F38 + push {lr} + lsls r1, 16 + lsrs r1, 16 + bl sub_80B1D2C + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080B1F6C + cmp r1, 0x63 + bgt _080B1F6C + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x000009ca + adds r0, r2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080B1F6C + movs r0, 0x1 + b _080B1F6E + .pool +_080B1F6C: + movs r0, 0 +_080B1F6E: + pop {r1} + bx r1 + thumb_func_end sub_80B1F38 + + thumb_func_start sub_80B1F74 +sub_80B1F74: @ 80B1F74 + push {lr} + lsls r1, 16 + lsrs r1, 16 + bl sub_80B1D50 + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080B1FA8 + cmp r1, 0x63 + bgt _080B1FA8 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x000009ca + adds r0, r2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080B1FA8 + movs r0, 0x1 + b _080B1FAA + .pool +_080B1FA8: + movs r0, 0 +_080B1FAA: + pop {r1} + bx r1 + thumb_func_end sub_80B1F74 + + thumb_func_start sub_80B1FB0 +sub_80B1FB0: @ 80B1FB0 + push {r4-r7,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r1, 16 + bl sub_80B1D2C + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080B1FD8 + movs r0, 0 + b _080B1FFE +_080B1FCA: + subs r0, r6, 0x1 + lsls r0, 1 + adds r0, r7, r0 + ldrh r0, [r0] + b _080B1FFE +_080B1FD4: + ldrh r0, [r5] + b _080B1FFE +_080B1FD8: + lsls r0, r1, 4 + adds r7, r4, r0 + movs r6, 0x1 + adds r5, r7, 0x2 + adds r4, r5, 0 +_080B1FE2: + ldrh r0, [r4] + cmp r0, 0 + beq _080B1FCA + bl trainer_flag_check + lsls r0, 24 + cmp r0, 0 + beq _080B1FD4 + adds r4, 0x2 + adds r5, 0x2 + adds r6, 0x1 + cmp r6, 0x4 + ble _080B1FE2 + ldrh r0, [r7, 0x8] +_080B1FFE: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80B1FB0 + + thumb_func_start sub_80B2004 +sub_80B2004: @ 80B2004 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r1, 16 + bl sub_80B1D2C + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080B2032 + movs r0, 0 + b _080B2054 +_080B201E: + subs r0, r5, 0x1 + lsls r0, 1 + adds r0, r6, r0 + ldrh r0, [r0] + b _080B2054 +_080B2028: + subs r0, r5, 0x1 + lsls r0, 1 + adds r0, r6, r0 + ldrh r0, [r0] + b _080B2054 +_080B2032: + lsls r0, r1, 4 + adds r6, r4, r0 + movs r5, 0x1 + adds r4, r6, 0x2 +_080B203A: + ldrh r0, [r4] + cmp r0, 0 + beq _080B201E + bl trainer_flag_check + lsls r0, 24 + cmp r0, 0 + beq _080B2028 + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x4 + ble _080B203A + ldrh r0, [r6, 0x8] +_080B2054: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B2004 + + thumb_func_start sub_80B205C +sub_80B205C: @ 80B205C + push {lr} + lsls r1, 16 + lsrs r1, 16 + bl sub_80B1D50 + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080B207E + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x000009ca + adds r0, r2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_080B207E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B205C + + thumb_func_start sub_80B208C +sub_80B208C: @ 80B208C + push {r4,lr} + adds r3, r0, 0 + movs r1, 0 + movs r4, 0xAE + lsls r4, 1 + ldr r2, =gUnknown_085500A4 +_080B2098: + ldrh r0, [r2] + cmp r0, r3 + bne _080B20A8 + adds r0, r1, r4 + b _080B20B2 + .pool +_080B20A8: + adds r2, 0x10 + adds r1, 0x1 + cmp r1, 0x4D + ble _080B2098 + ldr r0, =0x0000ffff +_080B20B2: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B208C + + thumb_func_start sub_80B20BC +sub_80B20BC: @ 80B20BC + push {lr} + ldr r0, =0x0000012f + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _080B20E2 + ldr r0, =0x02038bca + ldrh r0, [r0] + bl sub_80B208C + adds r1, r0, 0 + ldr r0, =0x0000ffff + cmp r1, r0 + beq _080B20E2 + lsls r0, r1, 16 + lsrs r0, 16 + bl FlagSet +_080B20E2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B20BC + + thumb_func_start sub_80B20F4 +sub_80B20F4: @ 80B20F4 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r1, 16 + bl sub_80B1D2C + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080B211E + lsls r0, r1, 4 + adds r0, r4 + ldrh r0, [r0, 0x2] + bl trainer_flag_check + lsls r0, 24 + cmp r0, 0 + beq _080B211E + movs r0, 0x1 + b _080B2120 +_080B211E: + movs r0, 0 +_080B2120: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B20F4 + + thumb_func_start sub_80B2128 +sub_80B2128: @ 80B2128 + push {r4-r6,lr} + movs r6, 0 + movs r5, 0 + ldr r4, =gUnknown_08550584 +_080B2130: + ldrh r0, [r4] + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B214C + adds r6, 0x1 + cmp r6, 0x4 + ble _080B214C + movs r0, 0x1 + b _080B2156 + .pool +_080B214C: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x7 + bls _080B2130 + movs r0, 0 +_080B2156: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B2128 + + thumb_func_start sub_80B215C +sub_80B215C: @ 80B215C + push {lr} + bl sub_80B2128 + cmp r0, 0 + beq _080B2184 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x000009c8 + adds r1, r0, r2 + ldrh r0, [r1] + cmp r0, 0xFE + bls _080B2180 + movs r0, 0xFF + b _080B2182 + .pool +_080B2180: + adds r0, 0x1 +_080B2182: + strh r0, [r1] +_080B2184: + pop {r0} + bx r0 + thumb_func_end sub_80B215C + + thumb_func_start sub_80B2188 +sub_80B2188: @ 80B2188 + push {lr} + bl sub_80B2128 + cmp r0, 0 + beq _080B21AC + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000009c8 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0xFE + bls _080B21AC + movs r0, 0x1 + b _080B21AE + .pool +_080B21AC: + movs r0, 0 +_080B21AE: + pop {r1} + bx r1 + thumb_func_end sub_80B2188 + + thumb_func_start sub_80B21B4 +sub_80B21B4: @ 80B21B4 + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + bl sub_80B2188 + cmp r0, 0 + beq _080B21E0 + ldr r0, =gUnknown_085500A4 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_80B1DFC + cmp r0, 0x1 + bne _080B21E0 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000009c8 + adds r0, r1 + movs r1, 0 + strh r1, [r0] +_080B21E0: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B21B4 + + thumb_func_start sub_80B21F4 +sub_80B21F4: @ 80B21F4 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + lsls r3, 16 + lsrs r3, 16 + lsls r2, 16 + lsrs r2, 16 + ldr r0, =gUnknown_085500A4 + adds r1, r3, 0 + bl sub_80B1EC0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B21F4 + + thumb_func_start sub_80B2214 +sub_80B2214: @ 80B2214 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + lsls r3, 16 + lsrs r3, 16 + lsls r2, 16 + lsrs r2, 16 + ldr r0, =gUnknown_085500A4 + adds r1, r3, 0 + bl sub_80B1F08 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B2214 + + thumb_func_start sub_80B2234 +sub_80B2234: @ 80B2234 + push {lr} + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =gUnknown_085500A4 + bl sub_80B1FB0 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B2234 + + thumb_func_start sub_80B2250 +sub_80B2250: @ 80B2250 + push {lr} + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =gUnknown_085500A4 + bl sub_80B2004 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B2250 + + thumb_func_start sub_80B226C +sub_80B226C: @ 80B226C + push {r4,r5,lr} + ldr r5, =gUnknown_085500A4 + ldr r4, =0x02038bca + ldrh r1, [r4] + adds r0, r5, 0 + bl sub_80B1F38 + lsls r0, 24 + cmp r0, 0 + bne _080B2298 + ldrh r1, [r4] + adds r0, r5, 0 + bl sub_80B20F4 + lsls r0, 24 + lsrs r0, 24 + b _080B229A + .pool +_080B2298: + movs r0, 0x1 +_080B229A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B226C + + thumb_func_start sub_80B22A0 +sub_80B22A0: @ 80B22A0 + push {lr} + ldr r0, =gUnknown_085500A4 + ldr r1, =0x02038bca + ldrh r1, [r1] + bl sub_80B1F74 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B22A0 + + thumb_func_start sub_80B22BC +sub_80B22BC: @ 80B22BC + push {lr} + ldr r0, =gUnknown_085500A4 + ldr r1, =0x02038bca + ldrh r1, [r1] + bl sub_80B205C + bl rom_npc_set_flag_for_script_id + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B22BC + + thumb_func_start CheckIfMultipleTrainersWantBattle +CheckIfMultipleTrainersWantBattle: @ 80B22D8 + push {lr} + ldr r1, =0x02038bf9 + ldrb r0, [r1] + cmp r0, 0x1 + bls _080B2300 + movs r0, 0 + strb r0, [r1] + ldr r1, =0x02038bf8 + movs r0, 0x1 + strb r0, [r1] + ldr r1, =0x020375f0 + movs r0, 0x1 + b _080B230A + .pool +_080B2300: + ldr r1, =0x02038bf8 + movs r0, 0 + strb r0, [r1] + ldr r1, =0x020375f0 + movs r0, 0 +_080B230A: + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end CheckIfMultipleTrainersWantBattle + + thumb_func_start sub_80B2318 +sub_80B2318: @ 80B2318 + push {r4-r7,lr} + lsls r0, 16 + ldr r7, =gUnknown_085500A4 + lsrs r4, r0, 12 + adds r6, r4, r7 + ldrh r0, [r6] + bl trainer_flag_check + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B2338 + movs r0, 0 + b _080B2364 + .pool +_080B2338: + movs r5, 0x1 + adds r0, r4, 0x2 + adds r0, r7 + ldrh r0, [r0] + cmp r0, 0 + beq _080B2360 + adds r4, r6, 0x2 +_080B2346: + ldrh r0, [r4] + bl trainer_flag_check + lsls r0, 24 + cmp r0, 0 + beq _080B2360 + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x4 + bgt _080B2360 + ldrh r0, [r4] + cmp r0, 0 + bne _080B2346 +_080B2360: + lsls r0, r5, 16 + lsrs r0, 16 +_080B2364: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80B2318 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/battle_transition.s b/asm/battle_transition.s new file mode 100644 index 000000000..7579473be --- /dev/null +++ b/asm/battle_transition.s @@ -0,0 +1,9774 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8145EF4 +sub_8145EF4: @ 8145EF4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x030022c0 + ldr r1, =sub_8085E50 + str r1, [r2, 0x4] + bl sub_8145F6C + pop {r0} + bx r0 + .pool + thumb_func_end sub_8145EF4 + + thumb_func_start sub_8145F10 +sub_8145F10: @ 8145F10 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_8145F6C + pop {r0} + bx r0 + thumb_func_end sub_8145F10 + + thumb_func_start sub_8145F20 +sub_8145F20: @ 8145F20 + push {r4,lr} + ldr r0, =sub_8145FA8 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r1, 0x26 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08145F4C + movs r0, 0 + b _08145F60 + .pool +_08145F4C: + adds r0, r2, 0 + bl DestroyTask + ldr r4, =0x0203aba0 + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] + movs r0, 0x1 +_08145F60: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8145F20 + + thumb_func_start sub_8145F6C +sub_8145F6C: @ 8145F6C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =sub_8145FA8 + movs r1, 0x2 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0xA] + ldr r4, =0x0203aba0 + movs r0, 0x3C + bl AllocZeroed + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8145F6C + + thumb_func_start sub_8145FA8 +sub_8145FA8: @ 8145FA8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8A98 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08145FBA: + 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 _08145FBA + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8145FA8 + + thumb_func_start sub_8145FE0 +sub_8145FE0: @ 8145FE0 + push {r4,lr} + adds r4, r0, 0 + bl sub_80AC3D0 + ldr r0, =0x02037b14 + ldr r1, =0x02037714 + ldr r2, =0x04000100 + bl CpuSet + ldr r1, =gUnknown_085C8948 + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + bne _0814601C + movs r0, 0x2 + strh r0, [r4, 0x8] + movs r0, 0x1 + b _0814602A + .pool +_0814601C: + movs r1, 0x4 + bl CreateTask + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 +_0814602A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8145FE0 + + thumb_func_start sub_8146030 +sub_8146030: @ 8146030 + push {r4,lr} + adds r4, r0, 0 + ldr r1, =gUnknown_085C8948 + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _08146054 + movs r0, 0 + b _0814605C + .pool +_08146054: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 +_0814605C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8146030 + + thumb_func_start sub_8146064 +sub_8146064: @ 8146064 + push {r4,lr} + adds r4, r0, 0 + ldr r1, =gUnknown_085C89F0 + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + bl CreateTask + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8146064 + + thumb_func_start sub_814608C +sub_814608C: @ 814608C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0 + strh r0, [r4, 0x26] + ldr r1, =gUnknown_085C89F0 + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _081460B0 + movs r0, 0x1 + strh r0, [r4, 0x26] +_081460B0: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814608C + + thumb_func_start sub_81460BC +sub_81460BC: @ 81460BC + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + ldr r1, =0x03005e00 + 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 _081460F4 + 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_8149D78 + b _08146104 + .pool +_081460F4: + bl sub_8149DDC + lsls r0, 24 + cmp r0, 0 + beq _08146104 + adds r0, r4, 0 + bl DestroyTask +_08146104: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81460BC + + thumb_func_start sub_814610C +sub_814610C: @ 814610C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8AA8 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814611E: + 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 _0814611E + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814610C + + thumb_func_start sub_8146144 +sub_8146144: @ 8146144 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + movs r0, 0xA + movs r1, 0x40 + bl SetGpuRegBits + movs r0, 0xC + movs r1, 0x40 + bl SetGpuRegBits + movs r0, 0xE + movs r1, 0x40 + bl SetGpuRegBits + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8146144 + + thumb_func_start sub_8146178 +sub_8146178: @ 8146178 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldrh r0, [r4, 0xA] + movs r1, 0xA + ldrsh r2, [r4, r1] + cmp r2, 0 + beq _0814618E + subs r0, 0x1 + strh r0, [r4, 0xA] + b _081461CE +_0814618E: + movs r0, 0x4 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _081461B0 + movs r1, 0x1 + negs r1, r1 + str r2, [sp] + adds r0, r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe +_081461B0: + ldrh r1, [r4, 0xC] + movs r0, 0xF + ands r0, r1 + lsls r1, r0, 4 + orrs r1, r0 + movs r0, 0x4C + bl SetGpuReg + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0xE + ble _081461CE + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_081461CE: + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8146178 + + thumb_func_start sub_81461D8 +sub_81461D8: @ 81461D8 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081461F4 + ldr r0, =sub_814610C + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_081461F4: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81461D8 + + thumb_func_start sub_8146204 +sub_8146204: @ 8146204 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8AB4 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08146216: + 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 _08146216 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8146204 + + thumb_func_start sub_814623C +sub_814623C: @ 814623C + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + movs r0, 0x1 + negs r0, r0 + movs r4, 0 + str r4, [sp] + movs r1, 0x4 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x020393a8 + ldr r1, =0x0203aba0 + ldr r1, [r1] + movs r2, 0x14 + ldrsh r1, [r1, r2] + str r4, [sp] + movs r2, 0xA0 + str r2, [sp, 0x4] + movs r2, 0 + movs r3, 0x2 + bl sub_8149F98 + ldr r0, =sub_8146320 + bl SetVBlankCallback + ldr r0, =sub_8146358 + bl SetHBlankCallback + movs r0, 0x3 + bl EnableInterrupts + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814623C + + thumb_func_start sub_81462A8 +sub_81462A8: @ 81462A8 + push {r4,r5,lr} + sub sp, 0x8 + ldr r4, =0x0203aba0 + ldr r2, [r4] + ldrb r1, [r2] + movs r1, 0 + strb r1, [r2] + ldrh r1, [r0, 0xA] + adds r1, 0x4 + strh r1, [r0, 0xA] + ldrh r1, [r0, 0xC] + adds r1, 0x8 + strh r1, [r0, 0xC] + ldr r3, =0x02038c28 + ldr r1, [r4] + movs r2, 0x14 + ldrsh r1, [r1, r2] + movs r5, 0xA + ldrsh r2, [r0, r5] + movs r5, 0xC + ldrsh r0, [r0, r5] + str r0, [sp] + movs r0, 0xA0 + str r0, [sp, 0x4] + adds r0, r3, 0 + movs r3, 0x2 + bl sub_8149F98 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081462FA + ldr r0, =sub_8146204 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_081462FA: + ldr r0, [r4] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81462A8 + + thumb_func_start sub_8146320 +sub_8146320: @ 8146320 + push {lr} + bl sub_8149F2C + ldr r0, =0x0203aba0 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0 + beq _08146344 + ldr r1, =0x040000d4 + ldr r0, =0x02038c28 + str r0, [r1] + movs r2, 0xF0 + lsls r2, 3 + adds r0, r2 + str r0, [r1, 0x4] + ldr r0, =0x800000a0 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_08146344: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8146320 + + thumb_func_start sub_8146358 +sub_8146358: @ 8146358 + ldr r1, =0x02038c28 + ldr r0, =0x04000006 + ldrh r0, [r0] + lsls r0, 1 + movs r2, 0xF0 + lsls r2, 3 + adds r1, r2 + adds r0, r1 + ldrh r1, [r0] + ldr r0, =0x04000014 + strh r1, [r0] + adds r0, 0x4 + strh r1, [r0] + adds r0, 0x4 + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_8146358 + + thumb_func_start sub_8146384 +sub_8146384: @ 8146384 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8ABC + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08146396: + 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 _08146396 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8146384 + + thumb_func_start sub_81463BC +sub_81463BC: @ 81463BC + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r1, 0x4 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x0203aba0 + ldr r1, [r0] + ldr r0, =0x020393a8 + movs r2, 0x16 + ldrsh r1, [r1, r2] + movs r2, 0xA0 + lsls r2, 1 + bl memset + ldr r0, =sub_81464B0 + bl SetVBlankCallback + ldr r0, =sub_81464E8 + bl SetHBlankCallback + movs r0, 0x3 + bl EnableInterrupts + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81463BC + + thumb_func_start sub_8146420 +sub_8146420: @ 8146420 + push {r4-r7,lr} + ldr r1, =0x0203aba0 + ldr r2, [r1] + ldrb r1, [r2] + movs r1, 0 + strb r1, [r2] + ldrh r4, [r0, 0xA] + ldrh r2, [r0, 0xC] + lsls r3, r2, 16 + asrs r3, 24 + movs r5, 0x84 + lsls r5, 5 + adds r1, r4, r5 + strh r1, [r0, 0xA] + movs r1, 0xC0 + lsls r1, 1 + adds r2, r1 + strh r2, [r0, 0xC] + movs r5, 0 + lsls r7, r3, 16 +_08146448: + lsrs r0, r4, 8 + asrs r1, r7, 16 + bl sine + ldr r1, =0x02038c28 + lsls r2, r5, 1 + adds r2, r1 + ldr r6, =0x0203aba0 + ldr r1, [r6] + ldrh r1, [r1, 0x16] + adds r0, r1 + strh r0, [r2] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + movs r1, 0x84 + lsls r1, 5 + adds r0, r4, r1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r5, 0x9F + bls _08146448 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0814648E + ldr r0, =sub_8146384 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_0814648E: + ldr r0, [r6] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8146420 + + thumb_func_start sub_81464B0 +sub_81464B0: @ 81464B0 + push {lr} + bl sub_8149F2C + ldr r0, =0x0203aba0 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0 + beq _081464D4 + ldr r1, =0x040000d4 + ldr r0, =0x02038c28 + str r0, [r1] + movs r2, 0xF0 + lsls r2, 3 + adds r0, r2 + str r0, [r1, 0x4] + ldr r0, =0x800000a0 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_081464D4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81464B0 + + thumb_func_start sub_81464E8 +sub_81464E8: @ 81464E8 + ldr r1, =0x02038c28 + ldr r0, =0x04000006 + ldrh r0, [r0] + lsls r0, 1 + movs r2, 0xF0 + lsls r2, 3 + adds r1, r2 + adds r0, r1 + ldrh r1, [r0] + ldr r0, =0x04000016 + strh r1, [r0] + adds r0, 0x4 + strh r1, [r0] + adds r0, 0x4 + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_81464E8 + + thumb_func_start sub_8146514 +sub_8146514: @ 8146514 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8AFC + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08146526: + 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 _08146526 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8146514 + + thumb_func_start sub_814654C +sub_814654C: @ 814654C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8AC4 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814655E: + 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 _0814655E + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814654C + + thumb_func_start sub_8146584 +sub_8146584: @ 8146584 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8AE0 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08146596: + 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 _08146596 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8146584 + + thumb_func_start sub_81465BC +sub_81465BC: @ 81465BC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8B14 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_081465CE: + 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 _081465CE + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81465BC + + thumb_func_start sub_81465F4 +sub_81465F4: @ 81465F4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8B2C + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08146606: + 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 _08146606 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81465F4 + + thumb_func_start sub_814662C +sub_814662C: @ 814662C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8B44 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814663E: + 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 _0814663E + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814662C + + thumb_func_start sub_8146664 +sub_8146664: @ 8146664 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8B5C + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08146676: + 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 _08146676 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8146664 + + thumb_func_start sub_814669C +sub_814669C: @ 814669C + push {r4,lr} + adds r4, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + movs r1, 0 + movs r0, 0x10 + strh r0, [r4, 0xA] + strh r1, [r4, 0xC] + strh r1, [r4, 0x10] + movs r0, 0x80 + lsls r0, 7 + strh r0, [r4, 0x12] + ldr r0, =0x0203aba0 + ldr r2, [r0] + movs r0, 0x3F + strh r0, [r2, 0x2] + strh r1, [r2, 0x4] + movs r0, 0xF0 + strh r0, [r2, 0x6] + movs r0, 0xA0 + strh r0, [r2, 0x8] + ldr r0, =0x00003f41 + strh r0, [r2, 0xE] + ldrh r0, [r4, 0xA] + lsls r0, 8 + ldrh r1, [r4, 0xC] + orrs r0, r1 + strh r0, [r2, 0x10] + ldr r0, =0x02038c28 + movs r2, 0xF0 + movs r1, 0x9F + ldr r3, =0x000008be + adds r0, r3 +_081466E2: + strh r2, [r0] + subs r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _081466E2 + ldr r0, =sub_8146F3C + bl SetVBlankCallback + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814669C + + thumb_func_start sub_814670C +sub_814670C: @ 814670C + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r5, 0 + movs r0, 0x3C + strh r0, [r4, 0x18] + adds r0, r4, 0 + bl sub_814669C + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + mov r0, sp + strh r5, [r0] + ldr r1, [sp, 0x4] + ldr r2, =0x01000400 + bl CpuSet + ldr r0, =gUnknown_085BAED0 + ldr r1, [sp, 0x8] + bl LZ77UnCompVram + ldr r0, =gUnknown_085BAEB0 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814670C + + thumb_func_start sub_8146760 +sub_8146760: @ 8146760 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r5, 0 + movs r0, 0x3C + strh r0, [r4, 0x18] + adds r0, r4, 0 + bl sub_814669C + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + mov r0, sp + strh r5, [r0] + ldr r1, [sp, 0x4] + ldr r2, =0x01000400 + bl CpuSet + ldr r0, =gUnknown_085BB4A4 + ldr r1, [sp, 0x8] + bl LZ77UnCompVram + ldr r0, =gUnknown_085BAEB0 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8146760 + + thumb_func_start sub_81467B4 +sub_81467B4: @ 81467B4 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r5, 0 + movs r0, 0x3C + strh r0, [r4, 0x18] + adds r0, r4, 0 + bl sub_814669C + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + mov r0, sp + strh r5, [r0] + ldr r1, [sp, 0x4] + ldr r2, =0x01000400 + bl CpuSet + ldr r0, =gUnknown_085BBC14 + ldr r1, [sp, 0x8] + movs r2, 0x80 + lsls r2, 5 + bl CpuSet + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81467B4 + + thumb_func_start sub_8146800 +sub_8146800: @ 8146800 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + bl sub_814669C + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, [sp, 0x4] + ldr r2, =0x01000400 + mov r0, sp + bl CpuSet + ldr r0, =gUnknown_085B9330 + ldr r1, [sp, 0x8] + movs r2, 0xB0 + lsls r2, 2 + bl CpuSet + ldr r0, =gFieldEffectObjectPalette10 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8146800 + + thumb_func_start sub_8146854 +sub_8146854: @ 8146854 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + adds r7, r0, 0 + add r1, sp, 0xC + add r0, sp, 0x8 + bl sub_8149F58 + ldr r5, =gUnknown_085C9020 + movs r1, 0 + ldr r0, [sp, 0x8] + mov r9, r0 + ldr r6, =0x02038c28 + mov r8, r6 + movs r0, 0xF0 + lsls r0, 8 + mov r12, r0 +_0814687A: + movs r0, 0 + lsls r3, r1, 16 + asrs r4, r3, 11 +_08146880: + lsls r2, r0, 16 + asrs r2, 16 + adds r1, r4, r2 + lsls r1, 1 + add r1, r9 + ldrh r0, [r5] + mov r6, r12 + orrs r0, r6 + strh r0, [r1] + adds r2, 0x1 + lsls r2, 16 + adds r5, 0x2 + lsrs r0, r2, 16 + asrs r2, 16 + cmp r2, 0x1D + ble _08146880 + movs r1, 0x80 + lsls r1, 9 + adds r0, r3, r1 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _0814687A + movs r6, 0x10 + ldrsh r2, [r7, r6] + movs r1, 0x12 + ldrsh r0, [r7, r1] + str r0, [sp] + movs r0, 0xA0 + str r0, [sp, 0x4] + mov r0, r8 + movs r1, 0 + movs r3, 0x84 + bl sub_8149F98 + ldrh r0, [r7, 0x8] + adds r0, 0x1 + strh r0, [r7, 0x8] + movs r0, 0x1 + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8146854 + + thumb_func_start sub_81468E4 +sub_81468E4: @ 81468E4 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + add r1, sp, 0xC + add r0, sp, 0x8 + bl sub_8149F58 + ldr r0, =gUnknown_085BB248 + ldr r1, [sp, 0x8] + bl LZ77UnCompVram + ldr r0, =0x02038c28 + movs r1, 0x10 + ldrsh r2, [r4, r1] + movs r3, 0x12 + ldrsh r1, [r4, r3] + str r1, [sp] + movs r1, 0xA0 + str r1, [sp, 0x4] + movs r1, 0 + movs r3, 0x84 + bl sub_8149F98 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0x10 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81468E4 + + thumb_func_start sub_814692C +sub_814692C: @ 814692C + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + add r1, sp, 0xC + add r0, sp, 0x8 + bl sub_8149F58 + ldr r0, =gUnknown_085BB930 + ldr r1, [sp, 0x8] + bl LZ77UnCompVram + ldr r0, =0x02038c28 + movs r1, 0x10 + ldrsh r2, [r4, r1] + movs r3, 0x12 + ldrsh r1, [r4, r3] + str r1, [sp] + movs r1, 0xA0 + str r1, [sp, 0x4] + movs r1, 0 + movs r3, 0x84 + bl sub_8149F98 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0x10 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814692C + + thumb_func_start sub_8146974 +sub_8146974: @ 8146974 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + add r1, sp, 0xC + add r0, sp, 0x8 + bl sub_8149F58 + ldr r0, =gUnknown_085BC2B4 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_085BC314 + ldr r1, [sp, 0x8] + movs r2, 0xA0 + lsls r2, 2 + bl CpuSet + ldr r0, =0x02038c28 + movs r1, 0x10 + ldrsh r2, [r4, r1] + movs r3, 0x12 + ldrsh r1, [r4, r3] + str r1, [sp] + movs r1, 0xA0 + str r1, [sp, 0x4] + movs r1, 0 + movs r3, 0x84 + bl sub_8149F98 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0x10 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8146974 + + thumb_func_start sub_81469CC +sub_81469CC: @ 81469CC + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + add r1, sp, 0xC + add r0, sp, 0x8 + bl sub_8149F58 + ldr r0, =gUnknown_085BC2D4 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_085BCB14 + ldr r1, [sp, 0x8] + movs r2, 0xA0 + lsls r2, 2 + bl CpuSet + ldr r0, =0x02038c28 + movs r1, 0x10 + ldrsh r2, [r4, r1] + movs r3, 0x12 + ldrsh r1, [r4, r3] + str r1, [sp] + movs r1, 0xA0 + str r1, [sp, 0x4] + movs r1, 0 + movs r3, 0x84 + bl sub_8149F98 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0x10 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81469CC + + thumb_func_start sub_8146A24 +sub_8146A24: @ 8146A24 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + add r1, sp, 0xC + add r0, sp, 0x8 + bl sub_8149F58 + ldr r0, =gUnknown_085BC2F4 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_085BD314 + ldr r1, [sp, 0x8] + movs r2, 0xA0 + lsls r2, 2 + bl CpuSet + ldr r0, =0x02038c28 + movs r1, 0x10 + ldrsh r2, [r4, r1] + movs r3, 0x12 + ldrsh r1, [r4, r3] + str r1, [sp] + movs r1, 0xA0 + str r1, [sp, 0x4] + movs r1, 0 + movs r3, 0x84 + bl sub_8149F98 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0x10 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8146A24 + + thumb_func_start sub_8146A7C +sub_8146A7C: @ 8146A7C + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, [sp, 0x4] + ldr r2, =0x01000400 + mov r0, sp + bl CpuSet + ldr r0, =gUnknown_085BDB34 + ldr r1, [sp, 0x8] + bl LZ77UnCompVram + ldr r0, =gUnknown_085BE1E8 + ldr r1, [sp, 0x4] + bl LZ77UnCompVram + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8146A7C + + thumb_func_start sub_8146AC8 +sub_8146AC8: @ 8146AC8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xA + ldrsh r5, [r4, r0] + adds r0, r5, 0 + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _08146B00 + adds r0, r5, 0 + movs r1, 0x1E + bl __modsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 11 + ldr r1, =gUnknown_085BEDA0 + adds r0, r1 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply +_08146B00: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3A + ble _08146B18 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + strh r0, [r4, 0xA] +_08146B18: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8146AC8 + + thumb_func_start sub_8146B24 +sub_8146B24: @ 8146B24 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xA + ldrsh r5, [r4, r0] + adds r0, r5, 0 + movs r1, 0x5 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _08146B52 + adds r0, r5, 0 + movs r1, 0x5 + bl __divsi3 + lsls r0, 16 + asrs r0, 11 + ldr r1, =gUnknown_085BEEE0 + adds r0, r1 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply +_08146B52: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x44 + ble _08146B6E + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + strh r0, [r4, 0xA] + movs r0, 0x1E + strh r0, [r4, 0x18] +_08146B6E: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8146B24 + + thumb_func_start sub_8146B7C +sub_8146B7C: @ 8146B7C + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r0, =0xffff8000 + movs r1, 0 + str r1, [sp] + movs r1, 0x1 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8146B7C + + thumb_func_start sub_8146BA8 +sub_8146BA8: @ 8146BA8 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08146BDE + ldr r1, =0x040000b0 + ldrh r2, [r1, 0xA] + ldr r0, =0x0000c5ff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, =0x00007fff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F84 + ldr r0, [r4] + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_08146BDE: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8146BA8 + + thumb_func_start sub_8146BF8 +sub_8146BF8: @ 8146BF8 + push {r4,r5,lr} + sub sp, 0x8 + adds r3, r0, 0 + ldr r2, =0x0203aba0 + ldr r1, [r2] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldrh r1, [r3, 0xE] + movs r4, 0xE + ldrsh r0, [r3, r4] + adds r4, r2, 0 + cmp r0, 0 + beq _08146C1E + subs r0, r1, 0x1 + strh r0, [r3, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _08146C28 +_08146C1E: + ldrh r0, [r3, 0xC] + adds r0, 0x1 + strh r0, [r3, 0xC] + movs r0, 0x2 + strh r0, [r3, 0xE] +_08146C28: + ldr r2, [r4] + ldrh r0, [r3, 0xA] + lsls r0, 8 + ldrh r1, [r3, 0xC] + orrs r0, r1 + strh r0, [r2, 0x10] + movs r5, 0xC + ldrsh r0, [r3, r5] + cmp r0, 0xF + ble _08146C42 + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_08146C42: + ldrh r0, [r3, 0x10] + adds r0, 0x8 + strh r0, [r3, 0x10] + ldr r0, =0xffffff00 + adds r1, r0, 0 + ldrh r5, [r3, 0x12] + adds r1, r5 + strh r1, [r3, 0x12] + ldr r0, =0x02038c28 + movs r5, 0x10 + ldrsh r2, [r3, r5] + lsls r1, 16 + asrs r1, 24 + str r1, [sp] + movs r1, 0xA0 + str r1, [sp, 0x4] + movs r1, 0 + movs r3, 0x84 + bl sub_8149F98 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8146BF8 + + thumb_func_start sub_8146C8C +sub_8146C8C: @ 8146C8C + push {r4,r5,lr} + sub sp, 0x8 + adds r3, r0, 0 + ldr r2, =0x0203aba0 + ldr r1, [r2] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldrh r1, [r3, 0xE] + movs r4, 0xE + ldrsh r0, [r3, r4] + adds r4, r2, 0 + cmp r0, 0 + beq _08146CB2 + subs r0, r1, 0x1 + strh r0, [r3, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _08146CBC +_08146CB2: + ldrh r0, [r3, 0xA] + subs r0, 0x1 + strh r0, [r3, 0xA] + movs r0, 0x2 + strh r0, [r3, 0xE] +_08146CBC: + ldr r2, [r4] + ldrh r0, [r3, 0xA] + lsls r0, 8 + ldrh r1, [r3, 0xC] + orrs r0, r1 + strh r0, [r2, 0x10] + movs r5, 0xA + ldrsh r0, [r3, r5] + cmp r0, 0 + bne _08146CD6 + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_08146CD6: + ldrh r0, [r3, 0x10] + adds r0, 0x8 + strh r0, [r3, 0x10] + ldr r0, =0xffffff00 + adds r1, r0, 0 + ldrh r5, [r3, 0x12] + adds r1, r5 + strh r1, [r3, 0x12] + ldr r0, =0x02038c28 + movs r5, 0x10 + ldrsh r2, [r3, r5] + lsls r1, 16 + asrs r1, 24 + str r1, [sp] + movs r1, 0xA0 + str r1, [sp, 0x4] + movs r1, 0 + movs r3, 0x84 + bl sub_8149F98 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8146C8C + + thumb_func_start sub_8146D20 +sub_8146D20: @ 8146D20 + push {r4-r7,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r7, =0x0203aba0 + ldr r0, [r7] + ldrb r1, [r0] + movs r6, 0 + strb r6, [r0] + ldrh r0, [r4, 0x10] + adds r0, 0x8 + strh r0, [r4, 0x10] + ldr r0, =0xffffff00 + adds r1, r0, 0 + ldrh r3, [r4, 0x12] + adds r1, r3 + strh r1, [r4, 0x12] + ldr r0, =0x02038c28 + movs r3, 0x10 + ldrsh r2, [r4, r3] + lsls r1, 16 + asrs r1, 24 + str r1, [sp] + movs r5, 0xA0 + str r5, [sp, 0x4] + movs r1, 0 + movs r3, 0x84 + bl sub_8149F98 + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + bgt _08146D70 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + strh r5, [r4, 0xA] + movs r0, 0x80 + lsls r0, 1 + strh r0, [r4, 0xC] + strh r6, [r4, 0xE] +_08146D70: + ldr r0, [r7] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + movs r0, 0 + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8146D20 + + thumb_func_start sub_8146D90 +sub_8146D90: @ 8146D90 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x18] + subs r0, 0x1 + strh r0, [r1, 0x18] + lsls r0, 16 + cmp r0, 0 + bne _08146DA6 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_08146DA6: + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_8146D90 + + thumb_func_start sub_8146DAC +sub_8146DAC: @ 8146DAC + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r0, =0x0000ffff + movs r1, 0 + str r1, [sp] + movs r1, 0x1 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8146DAC + + thumb_func_start sub_8146DD8 +sub_8146DD8: @ 8146DD8 + push {lr} + adds r2, r0, 0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08146DEE + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] +_08146DEE: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8146DD8 + + thumb_func_start sub_8146DF8 +sub_8146DF8: @ 8146DF8 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0203aba0 + ldr r0, [r0] + ldrb r1, [r0] + movs r3, 0 + strb r3, [r0] + ldrh r2, [r4, 0xC] + movs r0, 0xC + ldrsh r1, [r4, r0] + ldr r0, =0x000003ff + cmp r1, r0 + bgt _08146E18 + adds r0, r2, 0 + adds r0, 0x80 + strh r0, [r4, 0xC] +_08146E18: + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08146E34 + ldrh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 24 + subs r0, r1, r0 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bge _08146E34 + strh r3, [r4, 0xA] +_08146E34: + ldr r0, =0x02038c28 + movs r1, 0xA + ldrsh r3, [r4, r1] + movs r1, 0x78 + movs r2, 0x50 + bl sub_814A014 + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08146E90 + movs r0, 0 + bl SetVBlankCallback + ldr r1, =0x040000b0 + ldrh r2, [r1, 0xA] + ldr r0, =0x0000c5ff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, =0x00007fff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F84 + ldr r0, [r4] + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + b _08146EB0 + .pool +_08146E90: + ldrh r1, [r4, 0xE] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08146EA4 + adds r0, r1, 0x1 + strh r0, [r4, 0xE] + ldr r0, =sub_8146F68 + bl SetVBlankCallback +_08146EA4: + ldr r0, =0x0203aba0 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] +_08146EB0: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8146DF8 + + thumb_func_start sub_8146EC0 +sub_8146EC0: @ 8146EC0 + push {lr} + ldr r1, =0x040000b0 + ldrh r2, [r1, 0xA] + ldr r0, =0x0000c5ff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, =0x00007fff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F2C + ldr r2, =0x0203aba0 + ldr r0, [r2] + ldrb r0, [r0] + cmp r0, 0 + beq _08146EF8 + ldr r1, =0x040000d4 + ldr r0, =0x02038c28 + str r0, [r1] + movs r3, 0xF0 + lsls r3, 3 + adds r0, r3 + str r0, [r1, 0x4] + ldr r0, =0x800000a0 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_08146EF8: + ldr r1, =0x04000048 + ldr r2, [r2] + ldrh r0, [r2, 0x2] + strh r0, [r1] + adds r1, 0x2 + ldrh r0, [r2, 0x4] + strh r0, [r1] + subs r1, 0x6 + ldrh r0, [r2, 0x8] + strh r0, [r1] + adds r1, 0xC + ldrh r0, [r2, 0xE] + strh r0, [r1] + adds r1, 0x2 + ldrh r0, [r2, 0x10] + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8146EC0 + + thumb_func_start sub_8146F3C +sub_8146F3C: @ 8146F3C + push {lr} + bl sub_8146EC0 + ldr r1, =0x040000b0 + ldr r0, =0x020393a8 + str r0, [r1] + ldr r0, =0x04000010 + str r0, [r1, 0x4] + ldr r0, =0xa2400001 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8146F3C + + thumb_func_start sub_8146F68 +sub_8146F68: @ 8146F68 + push {lr} + bl sub_8146EC0 + ldr r1, =0x040000b0 + ldr r0, =0x020393a8 + str r0, [r1] + ldr r0, =0x04000040 + str r0, [r1, 0x4] + ldr r0, =0xa2400001 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8146F68 + + thumb_func_start sub_8146F94 +sub_8146F94: @ 8146F94 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8B7C + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08146FA6: + 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 _08146FA6 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8146F94 + + thumb_func_start sub_8146FCC +sub_8146FCC: @ 8146FCC + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + ldr r0, =gUnknown_085B98B0 + ldr r1, [sp, 0x8] + movs r2, 0x20 + bl CpuSet + movs r0, 0 + str r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, =0x05000200 + mov r0, sp + bl CpuSet + ldr r0, =gFieldEffectObjectPalette10 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8146FCC + + thumb_func_start sub_8147018 +sub_8147018: @ 8147018 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + adds r7, r0, 0 + ldr r1, =gUnknown_085C8B88 + mov r0, sp + movs r2, 0x4 + bl memcpy + add r4, sp, 0x4 + ldr r1, =gUnknown_085C8B8C + adds r0, r4, 0 + movs r2, 0xA + bl memcpy + bl GenerateRandomNumber + movs r5, 0x1 + ands r5, r0 + movs r1, 0 + mov r8, r4 + ldr r6, =0x02038c08 +_08147046: + lsls r5, 16 + asrs r5, 16 + lsls r0, r5, 1 + add r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + str r0, [r6] + lsls r4, r1, 16 + asrs r4, 16 + lsls r0, r4, 5 + adds r0, 0x10 + str r0, [r6, 0x4] + str r5, [r6, 0x8] + lsls r0, r4, 1 + add r0, r8 + movs r1, 0 + ldrsh r0, [r0, r1] + str r0, [r6, 0xC] + movs r0, 0x2D + bl FieldEffectStart + adds r4, 0x1 + lsls r4, 16 + movs r0, 0x1 + eors r5, r0 + lsls r5, 16 + lsrs r5, 16 + lsrs r1, r4, 16 + asrs r4, 16 + cmp r4, 0x4 + ble _08147046 + ldrh r0, [r7, 0x8] + adds r0, 0x1 + strh r0, [r7, 0x8] + movs r0, 0 + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8147018 + + thumb_func_start sub_81470A4 +sub_81470A4: @ 81470A4 + push {lr} + movs r0, 0x2D + bl FieldEffectActiveListContains + lsls r0, 24 + cmp r0, 0 + bne _081470C4 + bl sub_8149F84 + ldr r0, =sub_8146F94 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_081470C4: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81470A4 + + thumb_func_start sub_81470D0 +sub_81470D0: @ 81470D0 + push {r4,r5,lr} + ldr r0, =gUnknown_085C8E68 + ldr r5, =0x02038c08 + movs r2, 0 + ldrsh r1, [r5, r2] + movs r3, 0x4 + ldrsh r2, [r5, r3] + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02020630 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r4, r1 + ldrb r1, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x5] + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4, 0x1] + ldr r0, [r5, 0x8] + strh r0, [r4, 0x2E] + ldr r0, [r5, 0xC] + strh r0, [r4, 0x30] + ldr r0, =0x0000ffff + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl obj_alloc_rotscale_entry + ldrb r1, [r5, 0x8] + adds r0, r4, 0 + bl StartObjectRotScalAnim + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81470D0 + + thumb_func_start sub_814713C +sub_814713C: @ 814713C + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r1, =gUnknown_085C8B96 + mov r0, sp + movs r2, 0x4 + bl memcpy + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08147160 + subs r0, r1, 0x1 + strh r0, [r4, 0x30] + b _081471F2 + .pool +_08147160: + ldrh r0, [r4, 0x20] + lsls r1, r0, 16 + lsrs r0, r1, 16 + cmp r0, 0xF0 + bhi _081471CE + asrs r0, r1, 19 + lsls r0, 16 + ldrh r1, [r4, 0x22] + lsls r1, 16 + asrs r1, 19 + lsls r1, 16 + lsrs r1, 16 + lsrs r2, r0, 16 + asrs r5, r0, 16 + movs r3, 0x32 + ldrsh r0, [r4, r3] + cmp r5, r0 + beq _081471CE + strh r2, [r4, 0x32] + ldr r0, =0x04000008 + ldrh r2, [r0] + lsrs r2, 8 + movs r0, 0x1F + ands r2, r0 + lsls r2, 11 + movs r0, 0xC0 + lsls r0, 19 + adds r2, r0 + lsls r1, 16 + asrs r1, 16 + subs r0, r1, 0x2 + lsls r0, 5 + adds r0, r5 + lsls r0, 1 + adds r0, r2 + ldr r6, =0x0000f001 + adds r3, r6, 0 + strh r3, [r0] + subs r0, r1, 0x1 + lsls r0, 5 + adds r0, r5 + lsls r0, 1 + adds r0, r2 + strh r3, [r0] + lsls r0, r1, 5 + adds r0, r5 + lsls r0, 1 + adds r0, r2 + strh r3, [r0] + adds r1, 0x1 + lsls r1, 5 + adds r1, r5 + lsls r1, 1 + adds r1, r2 + strh r3, [r1] +_081471CE: + movs r1, 0x2E + ldrsh r0, [r4, r1] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + adds r0, 0xF + lsls r0, 16 + movs r1, 0x87 + lsls r1, 17 + cmp r0, r1 + bls _081471F2 + adds r0, r4, 0 + movs r1, 0x2D + bl FieldEffectStop +_081471F2: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814713C + + thumb_func_start sub_8147204 +sub_8147204: @ 8147204 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8B9C + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08147216: + 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 _08147216 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8147204 + + thumb_func_start sub_814723C +sub_814723C: @ 814723C + push {r4,lr} + adds r4, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + ldr r0, =0x0203aba0 + ldr r1, [r0] + movs r0, 0 + strh r0, [r1, 0x2] + movs r0, 0x3F + strh r0, [r1, 0x4] + ldr r0, =0x0000f0f1 + strh r0, [r1, 0x6] + movs r0, 0xA0 + strh r0, [r1, 0x8] + movs r1, 0 + ldr r3, =0x020393a8 + ldr r2, =0x0000f3f4 +_08147262: + lsls r0, r1, 1 + adds r0, r3 + strh r2, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x9F + bls _08147262 + ldr r0, =sub_8147688 + bl SetVBlankCallback + ldr r0, =0x0203aba0 + ldr r1, [r0] + movs r0, 0x78 + strh r0, [r1, 0x2C] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814723C + + thumb_func_start sub_81472A4 +sub_81472A4: @ 81472A4 + push {r4-r7,lr} + sub sp, 0xC + adds r6, r0, 0 + ldr r2, =0x0203aba0 + ldr r1, [r2] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0x24 + movs r2, 0x2C + ldrsh r3, [r1, r2] + movs r1, 0x1 + negs r1, r1 + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x78 + movs r2, 0x50 + bl sub_814A1AC + ldr r5, =0x02038c28 +_081472D4: + ldr r4, =0x0203aba0 + ldr r0, [r4] + movs r7, 0x2A + ldrsh r3, [r0, r7] + lsls r3, 1 + adds r3, r5 + ldrh r1, [r0, 0x28] + adds r1, 0x1 + movs r7, 0xF0 + lsls r7, 7 + adds r2, r7, 0 + orrs r1, r2 + strh r1, [r3] + adds r0, 0x24 + movs r1, 0x1 + movs r2, 0x1 + bl sub_814A228 + lsls r0, 24 + cmp r0, 0 + beq _081472D4 + ldr r1, [r4] + ldrh r0, [r1, 0x2C] + adds r0, 0x10 + strh r0, [r1, 0x2C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xEF + ble _08147318 + movs r0, 0 + strh r0, [r1, 0x2E] + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] +_08147318: + ldr r0, [r4] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + movs r0, 0 + add sp, 0xC + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81472A4 + + thumb_func_start sub_8147334 +sub_8147334: @ 8147334 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + mov r8, r0 + add r1, sp, 0xC + movs r0, 0 + strb r0, [r1] + ldr r4, =0x0203aba0 + ldr r1, [r4] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x24 + movs r2, 0x2E + ldrsh r1, [r1, r2] + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0xF0 + bl sub_814A1AC + mov r9, r4 + mov r7, r9 + add r5, sp, 0xC +_08147372: + movs r1, 0x78 + ldr r3, [r7] + ldrh r0, [r3, 0x28] + adds r0, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + movs r2, 0x2E + ldrsh r0, [r3, r2] + cmp r0, 0x4F + ble _0814738A + ldrh r1, [r3, 0x28] + movs r4, 0xF0 +_0814738A: + ldr r6, =0x02038c28 + movs r0, 0x2A + ldrsh r2, [r3, r0] + lsls r2, 1 + adds r2, r6 + lsls r1, 16 + asrs r1, 8 + lsls r0, r4, 16 + asrs r4, r0, 16 + orrs r4, r1 + strh r4, [r2] + ldrb r0, [r5] + cmp r0, 0 + bne _081473C0 + adds r0, r3, 0 + adds r0, 0x24 + movs r1, 0x1 + movs r2, 0x1 + bl sub_814A228 + strb r0, [r5] + b _08147372 + .pool +_081473C0: + ldr r1, [r7] + ldrh r0, [r1, 0x2E] + adds r0, 0x8 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0x9F + ble _081473DE + movs r0, 0xF0 + strh r0, [r1, 0x2C] + mov r1, r8 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _08147406 +_081473DE: + movs r3, 0x2A + ldrsh r0, [r1, r3] + cmp r0, r2 + bge _08147406 + adds r3, r4, 0 + ldr r5, =0x0203aba0 +_081473EA: + ldr r2, [r5] + ldrh r0, [r2, 0x2A] + adds r0, 0x1 + strh r0, [r2, 0x2A] + lsls r0, 16 + asrs r0, 15 + adds r0, r6 + strh r3, [r0] + movs r4, 0x2A + ldrsh r1, [r2, r4] + movs r4, 0x2E + ldrsh r0, [r2, r4] + cmp r1, r0 + blt _081473EA +_08147406: + mov r1, r9 + ldr r0, [r1] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + movs r0, 0 + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8147334 + + thumb_func_start sub_8147428 +sub_8147428: @ 8147428 + push {r4-r6,lr} + sub sp, 0xC + adds r6, r0, 0 + ldr r2, =0x0203aba0 + ldr r1, [r2] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0x24 + movs r2, 0x2C + ldrsh r3, [r1, r2] + movs r1, 0xA0 + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x78 + movs r2, 0x50 + bl sub_814A1AC + ldr r5, =0x02038c28 +_08147456: + ldr r4, =0x0203aba0 + ldr r0, [r4] + movs r1, 0x2A + ldrsh r3, [r0, r1] + lsls r3, 1 + adds r3, r5 + ldrh r1, [r0, 0x28] + lsls r1, 8 + movs r2, 0xF0 + orrs r1, r2 + strh r1, [r3] + adds r0, 0x24 + movs r1, 0x1 + movs r2, 0x1 + bl sub_814A228 + lsls r0, 24 + cmp r0, 0 + beq _08147456 + ldr r1, [r4] + ldrh r0, [r1, 0x2C] + subs r0, 0x10 + strh r0, [r1, 0x2C] + lsls r0, 16 + cmp r0, 0 + bgt _08147494 + movs r0, 0xA0 + strh r0, [r1, 0x2E] + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] +_08147494: + ldr r0, [r4] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + movs r0, 0 + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8147428 + + thumb_func_start sub_81474B0 +sub_81474B0: @ 81474B0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + mov r9, r0 + add r1, sp, 0xC + movs r0, 0 + strb r0, [r1] + ldr r4, =0x0203aba0 + ldr r1, [r4] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x24 + movs r2, 0x2E + ldrsh r1, [r1, r2] + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0 + bl sub_814A1AC + ldr r7, =0x02038c28 + mov r10, r7 + ldr r0, =0x0203aba0 + mov r8, r0 + add r6, sp, 0xC +_081474F4: + mov r1, r8 + ldr r4, [r1] + movs r2, 0x2A + ldrsh r0, [r4, r2] + lsls r0, 1 + mov r7, r10 + adds r5, r0, r7 + ldrb r1, [r5] + ldrh r2, [r4, 0x28] + adds r3, r2, 0 + movs r7, 0x2E + ldrsh r0, [r4, r7] + cmp r0, 0x50 + bgt _08147514 + movs r2, 0x78 + adds r1, r3, 0 +_08147514: + lsls r0, r2, 16 + asrs r0, 8 + lsls r1, 16 + asrs r1, 16 + orrs r1, r0 + movs r7, 0 + strh r1, [r5] + ldrb r0, [r6] + cmp r0, 0 + bne _08147540 + adds r0, r4, 0 + adds r0, 0x24 + movs r1, 0x1 + movs r2, 0x1 + bl sub_814A228 + strb r0, [r6] + b _081474F4 + .pool +_08147540: + mov r0, r8 + ldr r2, [r0] + ldrh r0, [r2, 0x2E] + subs r0, 0x8 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r3, r0, 16 + cmp r3, 0 + bgt _0814755E + strh r7, [r2, 0x2C] + mov r1, r9 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _08147588 +_0814755E: + movs r4, 0x2A + ldrsh r0, [r2, r4] + cmp r0, r3 + ble _08147588 + ldr r6, =0x02038c28 + adds r3, r1, 0 + ldr r5, =0x0203aba0 +_0814756C: + ldr r2, [r5] + ldrh r0, [r2, 0x2A] + subs r0, 0x1 + strh r0, [r2, 0x2A] + lsls r0, 16 + asrs r0, 15 + adds r0, r6 + strh r3, [r0] + movs r7, 0x2A + ldrsh r1, [r2, r7] + movs r4, 0x2E + ldrsh r0, [r2, r4] + cmp r1, r0 + bgt _0814756C +_08147588: + ldr r7, =0x0203aba0 + ldr r0, [r7] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + movs r0, 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_81474B0 + + thumb_func_start sub_81475B0 +sub_81475B0: @ 81475B0 + push {r4-r7,lr} + sub sp, 0xC + adds r7, r0, 0 + ldr r1, =0x0203aba0 + ldr r0, [r1] + ldrb r2, [r0] + movs r2, 0 + strb r2, [r0] + ldr r1, [r1] + adds r0, r1, 0 + adds r0, 0x24 + movs r4, 0x2C + ldrsh r3, [r1, r4] + str r2, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x78 + movs r2, 0x50 + bl sub_814A1AC + ldr r6, =0x02038c28 +_081475DC: + movs r2, 0x78 + ldr r5, =0x0203aba0 + ldr r3, [r5] + ldrh r4, [r3, 0x28] + movs r1, 0x28 + ldrsh r0, [r3, r1] + cmp r0, 0x77 + ble _081475F0 + movs r2, 0 + movs r4, 0xF0 +_081475F0: + movs r0, 0x2A + ldrsh r1, [r3, r0] + lsls r1, 1 + adds r1, r6 + lsls r2, 8 + lsls r0, r4, 16 + asrs r0, 16 + orrs r0, r2 + strh r0, [r1] + adds r0, r3, 0 + adds r0, 0x24 + movs r1, 0x1 + movs r2, 0x1 + bl sub_814A228 + lsls r0, 24 + cmp r0, 0 + beq _081475DC + ldr r0, [r5] + ldrh r1, [r0, 0x2C] + adds r1, 0x10 + strh r1, [r0, 0x2C] + movs r1, 0x28 + ldrsh r0, [r0, r1] + cmp r0, 0x78 + ble _0814762A + ldrh r0, [r7, 0x8] + adds r0, 0x1 + strh r0, [r7, 0x8] +_0814762A: + ldr r0, [r5] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + movs r0, 0 + add sp, 0xC + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81475B0 + + thumb_func_start sub_8147648 +sub_8147648: @ 8147648 + push {lr} + ldr r1, =0x040000b0 + ldrh r2, [r1, 0xA] + ldr r0, =0x0000c5ff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, =0x00007fff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F84 + ldr r0, =sub_8147204 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8147648 + + thumb_func_start sub_8147688 +sub_8147688: @ 8147688 + push {r4,lr} + ldr r4, =0x040000b0 + ldrh r1, [r4, 0xA] + ldr r0, =0x0000c5ff + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r1, [r4, 0xA] + ldr r0, =0x00007fff + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xA] + bl sub_8149F2C + ldr r3, =0x0203aba0 + ldr r0, [r3] + ldrb r0, [r0] + cmp r0, 0 + beq _081476C0 + ldr r1, =0x040000d4 + ldr r0, =0x02038c28 + str r0, [r1] + movs r2, 0xF0 + lsls r2, 3 + adds r0, r2 + str r0, [r1, 0x4] + ldr r0, =0x800000a0 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_081476C0: + ldr r2, =0x04000048 + ldr r1, [r3] + ldrh r0, [r1, 0x2] + strh r0, [r2] + adds r2, 0x2 + ldrh r0, [r1, 0x4] + strh r0, [r2] + subs r2, 0x6 + ldrh r0, [r1, 0x8] + strh r0, [r2] + subs r2, 0x4 + ldr r0, =0x02038c28 + movs r1, 0xF0 + lsls r1, 3 + adds r0, r1 + ldrh r1, [r0] + strh r1, [r2] + str r0, [r4] + str r2, [r4, 0x4] + ldr r0, =0xa2400001 + str r0, [r4, 0x8] + ldr r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8147688 + + thumb_func_start sub_8147718 +sub_8147718: @ 8147718 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8BB8 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814772A: + 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 _0814772A + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8147718 + + thumb_func_start sub_8147750 +sub_8147750: @ 8147750 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + movs r2, 0 + ldr r4, =0x020393a8 + ldr r3, =0x0203aba0 +_08147762: + lsls r1, r2, 1 + adds r1, r4 + ldr r0, [r3] + ldrh r0, [r0, 0x16] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x9F + bls _08147762 + ldr r0, =sub_8147888 + bl SetVBlankCallback + ldr r0, =sub_81478C0 + bl SetHBlankCallback + movs r0, 0x2 + bl EnableInterrupts + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8147750 + + thumb_func_start sub_81477A8 +sub_81477A8: @ 81477A8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r6, r0, 0 + ldr r0, =0x0203aba0 + ldr r1, [r0] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldrh r2, [r6, 0xC] + lsls r1, r2, 16 + asrs r0, r1, 24 + lsls r0, 16 + lsrs r3, r0, 16 + ldrh r4, [r6, 0xA] + movs r0, 0xC0 + lsls r0, 1 + mov r8, r0 + movs r5, 0x80 + lsls r5, 3 + adds r0, r4, r5 + strh r0, [r6, 0xA] + ldr r0, =0x1fff0000 + cmp r1, r0 + bgt _081477E4 + movs r1, 0xC0 + lsls r1, 1 + adds r0, r2, r1 + strh r0, [r6, 0xC] +_081477E4: + movs r5, 0 + lsls r7, r3, 16 +_081477E8: + lsrs r0, r4, 8 + asrs r1, r7, 16 + bl sine + ldr r1, =0x02038c28 + lsls r2, r5, 1 + adds r2, r1 + ldr r1, =0x0203aba0 + ldr r1, [r1] + ldrh r1, [r1, 0x16] + adds r0, r1 + strh r0, [r2] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + mov r1, r8 + adds r0, r4, r1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r5, 0x9F + bls _081477E8 + ldrh r0, [r6, 0xE] + adds r0, 0x1 + strh r0, [r6, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x51 + bne _08147838 + ldrh r0, [r6, 0x10] + adds r0, 0x1 + strh r0, [r6, 0x10] + movs r0, 0x1 + negs r0, r0 + movs r1, 0x2 + negs r1, r1 + movs r2, 0 + str r2, [sp] + movs r3, 0x10 + bl pal_fade_maybe +_08147838: + movs r5, 0x10 + ldrsh r0, [r6, r5] + cmp r0, 0 + beq _0814785A + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0814785A + ldr r0, =sub_8147718 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_0814785A: + ldr r0, =0x0203aba0 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r0, 0 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81477A8 + + thumb_func_start sub_8147888 +sub_8147888: @ 8147888 + push {lr} + bl sub_8149F2C + ldr r0, =0x0203aba0 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0 + beq _081478AC + ldr r1, =0x040000d4 + ldr r0, =0x02038c28 + str r0, [r1] + movs r2, 0xF0 + lsls r2, 3 + adds r0, r2 + str r0, [r1, 0x4] + ldr r0, =0x800000a0 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_081478AC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8147888 + + thumb_func_start sub_81478C0 +sub_81478C0: @ 81478C0 + ldr r1, =0x02038c28 + ldr r0, =0x04000006 + ldrh r0, [r0] + lsls r0, 1 + movs r2, 0xF0 + lsls r2, 3 + adds r1, r2 + adds r0, r1 + ldrh r1, [r0] + ldr r0, =0x04000016 + strh r1, [r0] + adds r0, 0x4 + strh r1, [r0] + adds r0, 0x4 + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_81478C0 + + thumb_func_start sub_81478EC +sub_81478EC: @ 81478EC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8BC0 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_081478FE: + 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 _081478FE + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81478EC + + thumb_func_start sub_8147924 +sub_8147924: @ 8147924 + push {r4,lr} + adds r4, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + ldr r0, =0x0203aba0 + ldr r1, [r0] + movs r2, 0 + movs r0, 0x3F + strh r0, [r1, 0x2] + strh r2, [r1, 0x4] + movs r0, 0xF0 + strh r0, [r1, 0x6] + movs r0, 0xA0 + strh r0, [r1, 0x8] + movs r1, 0 + ldr r3, =0x020393a8 + movs r2, 0xF2 +_0814794A: + lsls r0, r1, 1 + adds r0, r3 + strh r2, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x9F + bls _0814794A + ldr r0, =sub_8147A58 + bl SetVBlankCallback + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8147924 + + thumb_func_start sub_814797C +sub_814797C: @ 814797C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + ldr r0, =0x0203aba0 + ldr r1, [r0] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r7, =0x02038c28 + ldrh r0, [r4, 0xC] + ldrb r5, [r4, 0xC] + adds r0, 0x10 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0xA] + adds r0, 0x8 + strh r0, [r4, 0xA] + movs r6, 0 + movs r0, 0x1 + mov r8, r0 +_081479A4: + adds r0, r5, 0 + movs r1, 0x28 + bl sine + ldrh r1, [r4, 0xA] + adds r0, r1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r0, 0 + bge _081479BA + movs r1, 0 +_081479BA: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xF0 + ble _081479C4 + movs r1, 0xF0 +_081479C4: + lsls r0, r1, 16 + asrs r0, 16 + lsls r1, r0, 8 + movs r2, 0xF1 + orrs r1, r2 + strh r1, [r7] + cmp r0, 0xEF + bgt _081479D8 + movs r0, 0 + mov r8, r0 +_081479D8: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r5, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + adds r7, 0x2 + cmp r6, 0x9F + bls _081479A4 + mov r1, r8 + cmp r1, 0 + beq _081479F6 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_081479F6: + ldr r0, =0x0203aba0 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r0, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814797C + + thumb_func_start sub_8147A18 +sub_8147A18: @ 8147A18 + push {lr} + ldr r1, =0x040000b0 + ldrh r2, [r1, 0xA] + ldr r0, =0x0000c5ff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, =0x00007fff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F84 + ldr r0, =sub_81478EC + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8147A18 + + thumb_func_start sub_8147A58 +sub_8147A58: @ 8147A58 + push {r4,lr} + ldr r4, =0x040000b0 + ldrh r1, [r4, 0xA] + ldr r0, =0x0000c5ff + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r1, [r4, 0xA] + ldr r0, =0x00007fff + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xA] + bl sub_8149F2C + ldr r3, =0x0203aba0 + ldr r0, [r3] + ldrb r0, [r0] + cmp r0, 0 + beq _08147A90 + ldr r1, =0x040000d4 + ldr r0, =0x02038c28 + str r0, [r1] + movs r2, 0xF0 + lsls r2, 3 + adds r0, r2 + str r0, [r1, 0x4] + ldr r0, =0x800000a0 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_08147A90: + ldr r2, =0x04000048 + ldr r1, [r3] + ldrh r0, [r1, 0x2] + strh r0, [r2] + adds r2, 0x2 + ldrh r0, [r1, 0x4] + strh r0, [r2] + subs r2, 0x6 + ldrh r0, [r1, 0x8] + strh r0, [r2] + ldr r0, =0x020393a8 + str r0, [r4] + ldr r0, =0x04000040 + str r0, [r4, 0x4] + ldr r0, =0xa2400001 + str r0, [r4, 0x8] + ldr r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8147A58 + + thumb_func_start sub_8147AE4 +sub_8147AE4: @ 8147AE4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + strh r2, [r1, 0x26] + bl sub_8147B84 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8147AE4 + + thumb_func_start sub_8147B04 +sub_8147B04: @ 8147B04 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x1 + strh r2, [r1, 0x26] + bl sub_8147B84 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8147B04 + + thumb_func_start sub_8147B24 +sub_8147B24: @ 8147B24 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x2 + strh r2, [r1, 0x26] + bl sub_8147B84 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8147B24 + + thumb_func_start sub_8147B44 +sub_8147B44: @ 8147B44 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x3 + strh r2, [r1, 0x26] + bl sub_8147B84 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8147B44 + + thumb_func_start sub_8147B64 +sub_8147B64: @ 8147B64 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x4 + strh r2, [r1, 0x26] + bl sub_8147B84 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8147B64 + + thumb_func_start sub_8147B84 +sub_8147B84: @ 8147B84 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8BCC + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08147B96: + 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 _08147B96 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8147B84 + + thumb_func_start sub_8147BBC +sub_8147BBC: @ 8147BBC + push {r4,lr} + adds r4, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + adds r0, r4, 0 + bl sub_8148218 + movs r0, 0 + strh r0, [r4, 0xA] + movs r0, 0x1 + strh r0, [r4, 0xC] + movs r0, 0xEF + strh r0, [r4, 0xE] + ldr r0, =0x0203aba0 + ldr r1, [r0] + movs r0, 0x3F + strh r0, [r1, 0x2] + movs r0, 0x3E + strh r0, [r1, 0x4] + movs r0, 0xA0 + strh r0, [r1, 0x8] + movs r1, 0 + ldr r3, =0x020393a8 + ldr r2, =0x0000f0f1 +_08147BF0: + lsls r0, r1, 1 + adds r0, r3 + strh r2, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x9F + bls _08147BF0 + ldr r0, =sub_81480CC + bl SetVBlankCallback + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8147BBC + + thumb_func_start sub_8147C24 +sub_8147C24: @ 8147C24 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + mov r8, r0 + ldr r6, =gUnknown_085C94D0 + add r1, sp, 0x4 + mov r0, sp + bl sub_8149F58 + ldr r0, =gUnknown_085B9AF0 + ldr r1, [sp, 0x4] + movs r2, 0xF0 + bl CpuSet + ldr r1, =gUnknown_085C8FDC + mov r2, r8 + movs r3, 0x26 + ldrsh r0, [r2, r3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =gUnknown_085C8FF0 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0xFA + movs r2, 0xC + bl gpu_pal_apply + movs r1, 0 + ldr r5, [sp] + movs r0, 0xF0 + lsls r0, 8 + adds r7, r0, 0 +_08147C78: + movs r0, 0 + lsls r3, r1, 16 + asrs r4, r3, 11 +_08147C7E: + lsls r2, r0, 16 + asrs r2, 16 + adds r1, r4, r2 + lsls r1, 1 + adds r1, r5 + ldrh r0, [r6] + orrs r0, r7 + strh r0, [r1] + adds r2, 0x1 + lsls r2, 16 + adds r6, 0x2 + lsrs r0, r2, 16 + asrs r2, 16 + cmp r2, 0x1F + ble _08147C7E + movs r1, 0x80 + lsls r1, 9 + adds r0, r3, r1 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _08147C78 + movs r0, 0x2 + bl EnableInterrupts + ldr r0, =sub_81481E0 + bl SetHBlankCallback + mov r2, r8 + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + movs r0, 0 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8147C24 + + thumb_func_start sub_8147CE4 +sub_8147CE4: @ 8147CE4 + push {r4-r7,lr} + adds r4, r0, 0 + ldr r0, =0x0203aba0 + ldr r1, [r0] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r7, =0x02038c28 + ldrh r0, [r4, 0xA] + ldrb r5, [r4, 0xA] + adds r0, 0x10 + strh r0, [r4, 0xA] + movs r6, 0 +_08147CFE: + adds r0, r5, 0 + movs r1, 0x10 + bl sine + ldrh r1, [r4, 0xC] + adds r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r0, 0 + bge _08147D14 + movs r2, 0x1 +_08147D14: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0xF0 + ble _08147D1E + movs r2, 0xF0 +_08147D1E: + strh r2, [r7] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r7, 0x2 + adds r0, r5, 0 + adds r0, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r6, 0x4F + bls _08147CFE + cmp r6, 0x9F + bhi _08147D76 +_08147D38: + adds r0, r5, 0 + movs r1, 0x10 + bl sine + ldrh r1, [r4, 0xE] + subs r1, r0 + lsls r1, 16 + lsrs r2, r1, 16 + cmp r1, 0 + bge _08147D4E + movs r2, 0 +_08147D4E: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0xEF + ble _08147D58 + movs r2, 0xEF +_08147D58: + lsls r0, r2, 16 + asrs r0, 8 + movs r1, 0xF0 + orrs r0, r1 + strh r0, [r7] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r7, 0x2 + adds r0, r5, 0 + adds r0, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r6, 0x9F + bls _08147D38 +_08147D76: + ldrh r1, [r4, 0xC] + adds r1, 0x8 + strh r1, [r4, 0xC] + ldrh r0, [r4, 0xE] + subs r0, 0x8 + strh r0, [r4, 0xE] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0xF0 + ble _08147D8E + movs r0, 0xF0 + strh r0, [r4, 0xC] +_08147D8E: + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _08147D9A + movs r0, 0 + strh r0, [r4, 0xE] +_08147D9A: + ldr r0, [r4, 0xC] + cmp r0, 0xF0 + bne _08147DA6 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_08147DA6: + ldr r0, =0x0203aba0 + ldr r1, [r0] + ldrh r0, [r1, 0x18] + subs r0, 0x8 + strh r0, [r1, 0x18] + ldrh r0, [r1, 0x1A] + adds r0, 0x8 + strh r0, [r1, 0x1A] + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8147CE4 + + thumb_func_start sub_8147DD0 +sub_8147DD0: @ 8147DD0 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r2, =0x0203aba0 + ldr r1, [r2] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r1, =0x02038c28 + adds r5, r2, 0 + movs r2, 0xF0 +_08147DE4: + strh r2, [r1] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + adds r1, 0x2 + cmp r0, 0x9F + bls _08147DE4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x8] + strh r1, [r4, 0xA] + strh r1, [r4, 0xC] + strh r1, [r4, 0xE] + ldr r1, [r5] + ldrh r0, [r1, 0x18] + subs r0, 0x8 + strh r0, [r1, 0x18] + ldrh r0, [r1, 0x1A] + adds r0, 0x8 + strh r0, [r1, 0x1A] + movs r1, 0x22 + ldrsh r0, [r4, r1] + movs r1, 0 + bl sub_8148484 + movs r1, 0x24 + ldrsh r0, [r4, r1] + movs r1, 0x1 + bl sub_8148484 + movs r1, 0x22 + ldrsh r0, [r4, r1] + bl sub_814849C + movs r0, 0x68 + bl audio_play + ldr r1, [r5] + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8147DD0 + + thumb_func_start sub_8147E4C +sub_8147E4C: @ 8147E4C + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0203aba0 + ldr r1, [r0] + ldrh r0, [r1, 0x18] + subs r0, 0x8 + strh r0, [r1, 0x18] + ldrh r0, [r1, 0x1A] + adds r0, 0x8 + strh r0, [r1, 0x1A] + movs r1, 0x22 + ldrsh r0, [r4, r1] + bl sub_81484B8 + lsls r0, 16 + cmp r0, 0 + beq _08147E7C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r1, 0x24 + ldrsh r0, [r4, r1] + bl sub_814849C +_08147E7C: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8147E4C + + thumb_func_start sub_8147E88 +sub_8147E88: @ 8147E88 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + ldr r7, =0x0203aba0 + ldr r1, [r7] + ldrh r0, [r1, 0x18] + subs r0, 0x8 + movs r2, 0 + mov r8, r2 + strh r0, [r1, 0x18] + ldrh r0, [r1, 0x1A] + adds r0, 0x8 + strh r0, [r1, 0x1A] + movs r1, 0x24 + ldrsh r0, [r6, r1] + bl sub_81484B8 + lsls r0, 16 + cmp r0, 0 + beq _08147F1C + ldr r1, [r7] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + movs r0, 0 + bl SetVBlankCallback + ldr r1, =0x040000b0 + ldrh r2, [r1, 0xA] + ldr r0, =0x0000c5ff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, =0x00007fff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + ldr r4, =0x02038c28 + movs r5, 0xA0 + lsls r5, 1 + adds r0, r4, 0 + movs r1, 0 + adds r2, r5, 0 + bl memset + movs r2, 0xF0 + lsls r2, 3 + adds r4, r2 + adds r0, r4, 0 + movs r1, 0 + adds r2, r5, 0 + bl memset + movs r0, 0x40 + movs r1, 0xF0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + mov r0, r8 + strh r0, [r6, 0xE] + strh r0, [r6, 0x10] + ldr r1, [r7] + movs r0, 0xBF + strh r0, [r1, 0xE] + ldr r0, =sub_8148160 + bl SetVBlankCallback +_08147F1C: + movs r0, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8147E88 + + thumb_func_start sub_8147F40 +sub_8147F40: @ 8147F40 + push {r4-r7,lr} + adds r4, r0, 0 + ldr r2, =0x0203aba0 + ldr r1, [r2] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + movs r6, 0x1 + ldr r1, [r2] + ldrh r0, [r1, 0x18] + subs r0, 0x8 + strh r0, [r1, 0x18] + ldrh r0, [r1, 0x1A] + adds r0, 0x8 + strh r0, [r1, 0x1A] + ldrh r1, [r4, 0x10] + movs r3, 0x10 + ldrsh r0, [r4, r3] + mov r12, r2 + cmp r0, 0x4F + bgt _08147F6E + adds r0, r1, 0x2 + strh r0, [r4, 0x10] +_08147F6E: + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r0, 0x50 + ble _08147F7A + movs r0, 0x50 + strh r0, [r4, 0x10] +_08147F7A: + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + movs r1, 0x1 + ands r0, r1 + ldrh r3, [r4, 0x10] + cmp r0, 0 + beq _08147FDC + movs r2, 0 + lsls r0, r3, 16 + movs r6, 0 + cmp r0, 0 + blt _08147FDC + movs r7, 0x50 + ldr r5, =0x02038c28 +_08147F98: + lsls r0, r2, 16 + asrs r3, r0, 16 + subs r1, r7, r3 + adds r0, r3, 0 + adds r0, 0x50 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, 16 + asrs r1, 15 + adds r1, r5 + ldrh r0, [r1] + cmp r0, 0xF + bhi _08147FB8 + movs r6, 0x1 + adds r0, 0x1 + strh r0, [r1] +_08147FB8: + lsls r0, r2, 16 + asrs r0, 15 + adds r1, r0, r5 + ldrh r0, [r1] + cmp r0, 0xF + bhi _08147FCA + movs r6, 0x1 + adds r0, 0x1 + strh r0, [r1] +_08147FCA: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + asrs r0, 16 + movs r3, 0x10 + ldrsh r1, [r4, r3] + ldrh r3, [r4, 0x10] + cmp r0, r1 + ble _08147F98 +_08147FDC: + cmp r3, 0x50 + bne _08147FEA + cmp r6, 0 + bne _08147FEA + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_08147FEA: + mov r1, r12 + ldr r0, [r1] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8147F40 + + thumb_func_start sub_8148008 +sub_8148008: @ 8148008 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r5, =0x0203aba0 + ldr r0, [r5] + ldrb r1, [r0] + movs r6, 0 + strb r6, [r0] + movs r0, 0x1 + negs r0, r0 + ldr r2, =0x00007fff + movs r1, 0x10 + bl sub_80A2A20 + ldr r1, [r5] + movs r0, 0xFF + strh r0, [r1, 0xE] + strh r6, [r4, 0xE] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8148008 + + thumb_func_start sub_8148040 +sub_8148040: @ 8148040 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x0203aba0 + ldr r1, [r5] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + ldr r0, =0x02038c28 + movs r2, 0xE + ldrsh r1, [r4, r2] + movs r2, 0xA0 + lsls r2, 1 + bl memset + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0xF + ble _08148070 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_08148070: + ldr r0, [r5] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8148040 + + thumb_func_start sub_814808C +sub_814808C: @ 814808C + push {r4,lr} + adds r4, r0, 0 + ldr r1, =0x040000b0 + ldrh r2, [r1, 0xA] + ldr r0, =0x0000c5ff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, =0x00007fff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F84 + ldr r0, [r4] + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814808C + + thumb_func_start sub_81480CC +sub_81480CC: @ 81480CC + push {r4,lr} + ldr r4, =0x040000b0 + ldrh r1, [r4, 0xA] + ldr r0, =0x0000c5ff + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r1, [r4, 0xA] + ldr r0, =0x00007fff + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xA] + bl sub_8149F2C + ldr r3, =0x0203aba0 + ldr r0, [r3] + ldrb r0, [r0] + cmp r0, 0 + beq _08148104 + ldr r1, =0x040000d4 + ldr r0, =0x02038c28 + str r0, [r1] + movs r2, 0xF0 + lsls r2, 3 + adds r0, r2 + str r0, [r1, 0x4] + ldr r0, =0x800000a0 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_08148104: + ldr r2, =0x04000012 + ldr r1, [r3] + ldrh r0, [r1, 0x1C] + strh r0, [r2] + adds r2, 0x36 + ldrh r0, [r1, 0x2] + strh r0, [r2] + adds r2, 0x2 + ldrh r0, [r1, 0x4] + strh r0, [r2] + subs r2, 0x6 + ldrh r0, [r1, 0x8] + strh r0, [r2] + ldr r0, =0x020393a8 + str r0, [r4] + ldr r0, =0x04000040 + str r0, [r4, 0x4] + ldr r0, =0xa2400001 + str r0, [r4, 0x8] + ldr r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81480CC + + thumb_func_start sub_8148160 +sub_8148160: @ 8148160 + push {r4,lr} + ldr r4, =0x040000b0 + ldrh r1, [r4, 0xA] + ldr r0, =0x0000c5ff + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r1, [r4, 0xA] + ldr r0, =0x00007fff + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xA] + bl sub_8149F2C + ldr r2, =0x0203aba0 + ldr r0, [r2] + ldrb r0, [r0] + cmp r0, 0 + beq _08148198 + ldr r1, =0x040000d4 + ldr r0, =0x02038c28 + str r0, [r1] + movs r3, 0xF0 + lsls r3, 3 + adds r0, r3 + str r0, [r1, 0x4] + ldr r0, =0x800000a0 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_08148198: + ldr r1, =0x04000050 + ldr r0, [r2] + ldrh r0, [r0, 0xE] + strh r0, [r1] + ldr r0, =0x020393a8 + str r0, [r4] + ldr r0, =0x04000054 + str r0, [r4, 0x4] + ldr r0, =0xa2400001 + str r0, [r4, 0x8] + ldr r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8148160 + + thumb_func_start sub_81481E0 +sub_81481E0: @ 81481E0 + push {lr} + ldr r0, =0x04000006 + ldrh r0, [r0] + cmp r0, 0x4F + bhi _08148200 + ldr r1, =0x04000010 + ldr r0, =0x0203aba0 + ldr r0, [r0] + ldrh r0, [r0, 0x18] + b _08148208 + .pool +_08148200: + ldr r1, =0x04000010 + ldr r0, =0x0203aba0 + ldr r0, [r0] + ldrh r0, [r0, 0x1A] +_08148208: + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81481E0 + + thumb_func_start sub_8148218 +sub_8148218: @ 8148218 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r4, r0, 0 + ldr r0, =gUnknown_085C8BF4 + movs r2, 0x26 + ldrsh r1, [r4, r2] + mov r8, r1 + add r0, r8 + ldrb r0, [r0] + ldr r2, =gUnknown_085C8C0E + lsls r1, 2 + mov r8, r1 + adds r1, r2 + ldrh r1, [r1] + subs r1, 0x20 + lsls r1, 16 + asrs r1, 16 + adds r2, 0x2 + add r2, r8 + ldrh r2, [r2] + adds r2, 0x2A + lsls r2, 16 + asrs r2, 16 + ldr r5, =0x0201c000 + str r5, [sp] + movs r3, 0 + bl sub_80B5E6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + bl sub_806F000 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x88 + lsls r1, 1 + str r5, [sp] + movs r2, 0x6A + movs r3, 0 + bl sub_80B5E6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x24] + movs r3, 0x22 + ldrsh r0, [r4, r3] + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + ldr r1, =0x02020630 + adds r5, r1 + movs r2, 0x24 + ldrsh r0, [r4, r2] + lsls r6, r0, 4 + adds r6, r0 + lsls r6, 2 + adds r6, r1 + ldr r0, =sub_8148380 + str r0, [r5, 0x1C] + str r0, [r6, 0x1C] + ldrb r0, [r5, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r5, 0x1] + ldrb r0, [r6, 0x1] + orrs r0, r1 + strb r0, [r6, 0x1] + bl rotscale_alloc_entry + lsls r0, 24 + lsrs r0, 24 + movs r3, 0x1F + mov r9, r3 + mov r4, r9 + ands r0, r4 + lsls r0, 1 + ldrb r2, [r5, 0x3] + movs r4, 0x3F + negs r4, r4 + adds r1, r4, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0x3] + bl rotscale_alloc_entry + lsls r0, 24 + lsrs r0, 24 + mov r1, r9 + ands r0, r1 + lsls r0, 1 + ldrb r1, [r6, 0x3] + ands r4, r1 + orrs r4, r0 + strb r4, [r6, 0x3] + ldrb r2, [r5, 0x1] + movs r1, 0x3F + adds r0, r1, 0 + ands r0, r2 + movs r2, 0x40 + orrs r0, r2 + strb r0, [r5, 0x1] + ldrb r0, [r6, 0x1] + ands r1, r0 + orrs r1, r2 + strb r1, [r6, 0x1] + ldrb r0, [r5, 0x3] + movs r1, 0xC0 + orrs r0, r1 + strb r0, [r5, 0x3] + ldrb r0, [r6, 0x3] + orrs r0, r1 + strb r0, [r6, 0x3] + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0x3 + movs r3, 0x3 + bl CalcVecFromObjectCenterToObjectUpperLeft + adds r0, r6, 0 + movs r1, 0x1 + movs r2, 0x3 + movs r3, 0x3 + bl CalcVecFromObjectCenterToObjectUpperLeft + ldrb r0, [r5, 0x3] + lsls r0, 26 + lsrs r0, 27 + ldr r2, =gUnknown_085C8BFA + mov r3, r8 + adds r1, r3, r2 + movs r4, 0 + ldrsh r1, [r1, r4] + adds r2, 0x2 + add r8, r2 + mov r3, r8 + movs r4, 0 + ldrsh r2, [r3, r4] + movs r3, 0 + bl sub_8008478 + ldrb r0, [r6, 0x3] + lsls r0, 26 + lsrs r0, 27 + ldr r1, =0xfffffe00 + movs r2, 0x80 + lsls r2, 2 + movs r3, 0 + bl sub_8008478 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8148218 + + thumb_func_start sub_8148380 +sub_8148380: @ 8148380 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =gUnknown_085C8C24 +_08148386: + movs r1, 0x2E + 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 _08148386 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8148380 + + thumb_func_start sub_81483A8 +sub_81483A8: @ 81483A8 + movs r0, 0 + bx lr + thumb_func_end sub_81483A8 + + thumb_func_start sub_81483AC +sub_81483AC: @ 81483AC + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r0, 0 + ldr r1, =gUnknown_085C8C40 + mov r0, sp + movs r2, 0x4 + bl memcpy + add r4, sp, 0x4 + ldr r1, =gUnknown_085C8C44 + adds r0, r4, 0 + movs r2, 0x4 + bl memcpy + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + movs r1, 0x3C + ldrsh r0, [r5, r1] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + strh r0, [r5, 0x30] + movs r1, 0x3C + ldrsh r0, [r5, r1] + lsls r0, 1 + adds r4, r0 + ldrh r0, [r4] + strh r0, [r5, 0x32] + movs r0, 0x1 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81483AC + + thumb_func_start sub_81483F8 +sub_81483F8: @ 81483F8 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x30] + ldrh r3, [r1, 0x20] + adds r2, r0, r3 + strh r2, [r1, 0x20] + movs r3, 0x3C + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _08148416 + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x84 + bgt _08148424 + b _0814841E +_08148416: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x67 + ble _08148424 +_0814841E: + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] +_08148424: + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_81483F8 + + thumb_func_start sub_814842C +sub_814842C: @ 814842C + push {lr} + adds r2, r0, 0 + ldrh r3, [r2, 0x32] + ldrh r0, [r2, 0x30] + adds r1, r3, r0 + strh r1, [r2, 0x30] + ldrh r0, [r2, 0x20] + adds r0, r1 + strh r0, [r2, 0x20] + lsls r1, 16 + cmp r1, 0 + bne _08148452 + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + negs r0, r3 + strh r0, [r2, 0x32] + movs r0, 0x1 + strh r0, [r2, 0x3A] +_08148452: + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_814842C + + thumb_func_start sub_8148458 +sub_8148458: @ 8148458 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x32] + ldrh r1, [r2, 0x30] + adds r0, r1 + strh r0, [r2, 0x30] + ldrh r1, [r2, 0x20] + adds r1, r0 + strh r1, [r2, 0x20] + adds r1, 0x1F + lsls r1, 16 + movs r0, 0x97 + lsls r0, 17 + cmp r1, r0 + bls _0814847C + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] +_0814847C: + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_8148458 + + thumb_func_start sub_8148484 +sub_8148484: @ 8148484 + ldr r3, =0x02020630 + lsls r0, 16 + asrs r0, 16 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + strh r1, [r2, 0x3C] + bx lr + .pool + thumb_func_end sub_8148484 + + thumb_func_start sub_814849C +sub_814849C: @ 814849C + ldr r2, =0x02020630 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + bx lr + .pool + thumb_func_end sub_814849C + + thumb_func_start sub_81484B8 +sub_81484B8: @ 81484B8 + ldr r2, =0x02020630 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r2, 0x3A + ldrsh r0, [r1, r2] + bx lr + .pool + thumb_func_end sub_81484B8 + + thumb_func_start sub_81484D0 +sub_81484D0: @ 81484D0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8C48 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_081484E2: + 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 _081484E2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81484D0 + + thumb_func_start sub_8148508 +sub_8148508: @ 8148508 + push {r4-r6,lr} + adds r5, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + movs r4, 0 + movs r3, 0 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r5, 0xC] + movs r0, 0x1 + strh r0, [r5, 0xE] + ldr r2, =0x0203aba0 + ldr r1, [r2] + movs r0, 0x3F + strh r0, [r1, 0x2] + strh r3, [r1, 0x4] + movs r0, 0xA0 + strh r0, [r1, 0x8] + ldrb r0, [r1] + strb r4, [r1] + ldr r4, =0x020393a8 + adds r6, r2, 0 + movs r2, 0xF0 +_0814853A: + lsls r1, r3, 1 + adds r1, r4 + ldr r0, [r6] + ldrh r0, [r0, 0x14] + strh r0, [r1] + adds r0, r3, 0 + adds r0, 0xA0 + lsls r0, 1 + adds r0, r4 + strh r2, [r0] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x9F + bls _0814853A + movs r0, 0x2 + bl EnableInterrupts + movs r0, 0x4 + movs r1, 0x10 + bl SetGpuRegBits + ldr r0, =sub_814869C + bl SetVBlankCallback + ldr r0, =sub_8148728 + bl SetHBlankCallback + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8148508 + + thumb_func_start sub_8148590 +sub_8148590: @ 8148590 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r3, r0, 0 + ldr r2, =0x0203aba0 + ldr r1, [r2] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldrh r0, [r3, 0xC] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r3, 0xA] + adds r0, r1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + mov r8, r2 + cmp r0, 0xF0 + ble _081485BC + movs r0, 0xF0 + strh r0, [r3, 0xA] +_081485BC: + ldrh r4, [r3, 0xC] + movs r0, 0xC + ldrsh r1, [r3, r0] + ldr r0, =0x00000fff + ldrh r2, [r3, 0xE] + cmp r1, r0 + bgt _081485CE + adds r0, r4, r2 + strh r0, [r3, 0xC] +_081485CE: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x7F + bgt _081485DA + lsls r0, r2, 1 + strh r0, [r3, 0xE] +_081485DA: + movs r5, 0 + ldr r7, =0x02038c28 + movs r1, 0xA0 + lsls r1, 1 + adds r1, r7 + mov r12, r1 + mov r6, r8 +_081485E8: + lsls r0, r5, 1 + adds r2, r0, r7 + mov r1, r12 + adds r4, r0, r1 + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + beq _08148618 + ldr r1, [r6] + ldrh r0, [r3, 0xA] + ldrh r1, [r1, 0x14] + adds r0, r1 + strh r0, [r2] + ldrh r1, [r3, 0xA] + movs r0, 0xF0 + subs r0, r1 + b _0814862A + .pool +_08148618: + ldr r0, [r6] + ldrh r0, [r0, 0x14] + ldrh r1, [r3, 0xA] + subs r0, r1 + strh r0, [r2] + ldrh r0, [r3, 0xA] + lsls r0, 8 + movs r1, 0xF1 + orrs r0, r1 +_0814862A: + strh r0, [r4] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x9F + bls _081485E8 + movs r1, 0xA + ldrsh r0, [r3, r1] + cmp r0, 0xEF + ble _08148644 + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_08148644: + mov r1, r8 + ldr r0, [r1] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + movs r0, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8148590 + + thumb_func_start sub_814865C +sub_814865C: @ 814865C + push {lr} + ldr r1, =0x040000b0 + ldrh r2, [r1, 0xA] + ldr r0, =0x0000c5ff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, =0x00007fff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F84 + ldr r0, =sub_81484D0 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_814865C + + thumb_func_start sub_814869C +sub_814869C: @ 814869C + push {r4,lr} + ldr r4, =0x040000b0 + ldrh r1, [r4, 0xA] + ldr r0, =0x0000c5ff + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r1, [r4, 0xA] + ldr r0, =0x00007fff + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xA] + bl sub_8149F2C + ldr r2, =0x04000048 + ldr r0, =0x0203aba0 + ldr r1, [r0] + ldrh r0, [r1, 0x2] + strh r0, [r2] + adds r2, 0x2 + ldrh r0, [r1, 0x4] + strh r0, [r2] + subs r2, 0x6 + ldrh r0, [r1, 0x8] + strh r0, [r2] + ldrb r0, [r1] + cmp r0, 0 + beq _081486E6 + ldr r1, =0x040000d4 + ldr r0, =0x02038c28 + str r0, [r1] + movs r2, 0xF0 + lsls r2, 3 + adds r0, r2 + str r0, [r1, 0x4] + ldr r0, =0x80000140 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_081486E6: + ldr r0, =0x020394e8 + str r0, [r4] + ldr r0, =0x04000040 + str r0, [r4, 0x4] + ldr r0, =0xa2400001 + str r0, [r4, 0x8] + ldr r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814869C + + thumb_func_start sub_8148728 +sub_8148728: @ 8148728 + push {lr} + ldr r2, =0x04000006 + ldrh r0, [r2] + cmp r0, 0x9F + bhi _0814874E + ldr r1, =0x02038c28 + ldrh r0, [r2] + lsls r0, 1 + movs r2, 0xF0 + lsls r2, 3 + adds r1, r2 + adds r0, r1 + ldrh r1, [r0] + ldr r0, =0x04000014 + strh r1, [r0] + adds r0, 0x4 + strh r1, [r0] + adds r0, 0x4 + strh r1, [r0] +_0814874E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8148728 + + thumb_func_start sub_8148760 +sub_8148760: @ 8148760 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8C54 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08148772: + 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 _08148772 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8148760 + + thumb_func_start sub_8148798 +sub_8148798: @ 8148798 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + ldr r0, =0x0203aba0 + ldr r1, [r0] + movs r2, 0 + movs r0, 0x3F + strh r0, [r1, 0x2] + strh r2, [r1, 0x4] + movs r0, 0xA0 + strh r0, [r1, 0x8] + movs r4, 0 + ldr r5, =0x02038c28 + movs r0, 0xF0 + lsls r0, 3 + adds r0, r5 + mov r12, r0 + mov r8, r4 + movs r1, 0xF0 + mov r9, r1 +_081487CC: + lsls r2, r4, 1 + mov r7, r12 + adds r1, r2, r7 + ldr r0, =0x0203aba0 + ldr r3, [r0] + ldrh r0, [r3, 0x14] + strh r0, [r1] + adds r1, r4, 0 + adds r1, 0xA0 + lsls r1, 1 + adds r0, r1, r7 + mov r7, r9 + strh r7, [r0] + adds r2, r5 + ldrh r0, [r3, 0x14] + strh r0, [r2] + adds r1, r5 + mov r0, r9 + strh r0, [r1] + movs r1, 0xA0 + lsls r1, 1 + adds r0, r4, r1 + lsls r0, 1 + adds r0, r5 + mov r7, r8 + strh r7, [r0] + adds r1, 0xA0 + adds r0, r4, r1 + lsls r0, 1 + adds r0, r5 + subs r1, 0xE0 + strh r1, [r0] + movs r7, 0xA0 + lsls r7, 2 + adds r0, r4, r7 + lsls r0, 1 + adds r0, r5 + movs r1, 0x1 + strh r1, [r0] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x9F + bls _081487CC + movs r0, 0 + strh r0, [r6, 0x10] + strh r0, [r6, 0x12] + movs r0, 0x7 + strh r0, [r6, 0x14] + movs r0, 0x2 + bl EnableInterrupts + ldr r0, =sub_814869C + bl SetVBlankCallback + ldr r0, =sub_8148728 + bl SetHBlankCallback + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + movs r0, 0x1 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8148798 + + thumb_func_start sub_8148864 +sub_8148864: @ 8148864 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r9, r0 + ldr r1, =gUnknown_085C8C64 + mov r0, sp + movs r2, 0x2 + bl memcpy + add r4, sp, 0x4 + ldr r1, =gUnknown_085C8C66 + adds r0, r4, 0 + movs r2, 0x4 + bl memcpy + ldr r2, =0x0203aba0 + ldr r1, [r2] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + str r0, [sp, 0x8] + mov r10, r0 + mov r1, r9 + movs r3, 0x12 + ldrsh r0, [r1, r3] + ldr r1, [sp, 0x8] + cmp r1, r0 + ble _081488A4 + b _08148A68 +_081488A4: + movs r7, 0 + mov r2, r10 + negs r2, r2 + str r2, [sp, 0xC] + mov r3, r10 + adds r3, 0x1 + str r3, [sp, 0x10] +_081488B2: + movs r6, 0 + mov r0, sp + adds r0, r7 + mov r12, r0 +_081488BA: + lsls r0, r6, 1 + add r0, sp + adds r0, 0x4 + movs r1, 0 + ldrsh r0, [r0, r1] + ldr r2, [sp, 0xC] + muls r0, r2 + lsls r0, 1 + mov r3, r12 + ldrb r3, [r3] + adds r0, r3 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0 + blt _08148966 + cmp r0, 0x4F + bne _081488E2 + cmp r7, 0x1 + beq _08148966 +_081488E2: + lsls r1, r0, 1 + ldr r0, =0x02038ea8 + adds r4, r1, r0 + movs r2, 0xA0 + lsls r2, 1 + adds r0, r2 + adds r3, r1, r0 + ldr r0, =0x02039128 + adds r1, r0 + ldrh r2, [r4] + cmp r2, 0xEF + bls _08148920 + movs r1, 0xF0 + strh r1, [r4] + ldr r0, [sp, 0x8] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + b _08148940 + .pool +_08148920: + ldrh r0, [r3] + lsrs r0, 8 + adds r0, r2, r0 + strh r0, [r4] + ldrh r0, [r1] + cmp r0, 0x7F + bhi _08148932 + lsls r0, 1 + strh r0, [r1] +_08148932: + ldrh r2, [r3] + ldr r0, =0x00000fff + cmp r2, r0 + bhi _08148940 + ldrh r0, [r1] + adds r0, r2, r0 + strh r0, [r3] +_08148940: + lsls r0, r5, 16 + asrs r0, 15 + ldr r1, =0x02038c28 + adds r2, r0, r1 + ldr r1, =0x02038d68 + adds r3, r0, r1 + ldr r0, =0x0203aba0 + ldr r1, [r0] + ldrh r0, [r4] + ldrh r1, [r1, 0x14] + adds r0, r1 + strh r0, [r2] + ldrh r0, [r4] + movs r1, 0xF0 + subs r0, r1, r0 + strh r0, [r3] + mov r2, r10 + cmp r2, 0 + beq _08148970 +_08148966: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x1 + bls _081488BA +_08148970: + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0x1 + bls _081488B2 + movs r7, 0 + ldr r3, =0x02038ea8 + mov r8, r3 +_08148980: + movs r6, 0 + mov r0, sp + adds r0, r7 + mov r12, r0 + adds r1, r7, 0x1 + str r1, [sp, 0x14] +_0814898C: + mov r2, r12 + ldrb r1, [r2] + adds r1, 0x1 + lsls r0, r6, 1 + add r0, sp + adds r0, 0x4 + movs r3, 0 + ldrsh r0, [r0, r3] + ldr r2, [sp, 0xC] + muls r0, r2 + lsls r0, 1 + adds r1, r0 + lsls r1, 16 + lsrs r5, r1, 16 + asrs r1, 16 + cmp r1, 0xA0 + bgt _08148A40 + cmp r1, 0x50 + bne _081489B6 + cmp r7, 0x1 + beq _08148A40 +_081489B6: + lsls r1, 1 + mov r3, r8 + adds r4, r1, r3 + movs r0, 0xA0 + lsls r0, 1 + add r0, r8 + adds r3, r1, r0 + ldr r0, =0x02039128 + adds r1, r0 + ldrh r2, [r4] + cmp r2, 0xEF + bls _081489F8 + movs r1, 0xF0 + strh r1, [r4] + ldr r0, [sp, 0x8] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + b _08148A18 + .pool +_081489F8: + ldrh r0, [r3] + lsrs r0, 8 + adds r0, r2, r0 + strh r0, [r4] + ldrh r0, [r1] + cmp r0, 0x7F + bhi _08148A0A + lsls r0, 1 + strh r0, [r1] +_08148A0A: + ldrh r2, [r3] + ldr r0, =0x00000fff + cmp r2, r0 + bhi _08148A18 + ldrh r0, [r1] + adds r0, r2, r0 + strh r0, [r3] +_08148A18: + lsls r0, r5, 16 + asrs r0, 15 + ldr r1, =0x02038c28 + adds r2, r0, r1 + ldr r1, =0x02038d68 + adds r3, r0, r1 + ldr r1, =0x0203aba0 + ldr r0, [r1] + ldrh r1, [r0, 0x14] + ldrh r0, [r4] + subs r1, r0 + strh r1, [r2] + ldrh r0, [r4] + lsls r0, 8 + movs r1, 0xF1 + orrs r0, r1 + strh r0, [r3] + mov r2, r10 + cmp r2, 0 + beq _08148A4A +_08148A40: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x1 + bls _0814898C +_08148A4A: + ldr r3, [sp, 0x14] + lsls r0, r3, 16 + lsrs r7, r0, 16 + cmp r7, 0x1 + bls _08148980 + ldr r1, [sp, 0x10] + lsls r0, r1, 16 + lsrs r0, 16 + mov r10, r0 + mov r2, r9 + movs r3, 0x12 + ldrsh r0, [r2, r3] + cmp r10, r0 + bgt _08148A68 + b _081488A4 +_08148A68: + mov r1, r9 + ldrh r0, [r1, 0x10] + subs r0, 0x1 + strh r0, [r1, 0x10] + lsls r0, 16 + cmp r0, 0 + bge _08148A7A + movs r0, 0 + strh r0, [r1, 0x10] +_08148A7A: + mov r2, r9 + movs r3, 0x10 + ldrsh r0, [r2, r3] + cmp r0, 0 + bgt _08148A98 + movs r1, 0x12 + ldrsh r0, [r2, r1] + adds r0, 0x1 + cmp r0, 0x14 + bgt _08148A98 + ldrh r0, [r2, 0x14] + strh r0, [r2, 0x10] + ldrh r0, [r2, 0x12] + adds r0, 0x1 + strh r0, [r2, 0x12] +_08148A98: + ldr r2, [sp, 0x8] + cmp r2, 0x9F + bls _08148AA6 + mov r3, r9 + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_08148AA6: + ldr r0, =0x0203aba0 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r0, 0 + 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_8148864 + + thumb_func_start sub_8148AD4 +sub_8148AD4: @ 8148AD4 + push {r4,r5,lr} + adds r3, r0, 0 + movs r2, 0x1 + ldr r5, =0x0000ff10 + movs r1, 0 + ldr r4, =0x020393a8 +_08148AE0: + lsls r0, r1, 1 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0xF0 + beq _08148AF0 + cmp r0, r5 + beq _08148AF0 + movs r2, 0 +_08148AF0: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x9F + bls _08148AE0 + cmp r2, 0x1 + bne _08148B04 + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_08148B04: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8148AD4 + + thumb_func_start sub_8148B14 +sub_8148B14: @ 8148B14 + push {lr} + ldr r1, =0x040000b0 + ldrh r2, [r1, 0xA] + ldr r0, =0x0000c5ff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, =0x00007fff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F84 + ldr r0, =sub_8148760 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8148B14 + + thumb_func_start sub_8148B54 +sub_8148B54: @ 8148B54 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8C6C + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08148B66: + 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 _08148B66 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8148B54 + + thumb_func_start sub_8148B8C +sub_8148B8C: @ 8148B8C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8C78 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08148B9E: + 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 _08148B9E + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8148B8C + + thumb_func_start sub_8148BC4 +sub_8148BC4: @ 8148BC4 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + ldr r0, =0x0203aba0 + ldr r1, [r0] + movs r0, 0 + strh r0, [r1, 0x2] + movs r0, 0x3F + strh r0, [r1, 0x4] + movs r0, 0xF0 + strh r0, [r1, 0x6] + movs r0, 0xA0 + strh r0, [r1, 0x8] + ldr r0, =0x02038c28 + movs r2, 0 + movs r1, 0x9F + ldr r3, =0x000008be + adds r0, r3 +_08148BEE: + strh r2, [r0] + subs r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08148BEE + movs r4, 0 + ldr r0, =sub_8146F68 + bl SetVBlankCallback + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0x1 + strh r0, [r5, 0xA] + adds r0, 0xFF + strh r0, [r5, 0xC] + strh r4, [r5, 0x16] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8148BC4 + + thumb_func_start sub_8148C28 +sub_8148C28: @ 8148C28 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x16 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _08148C6C + ldr r1, =0x040000b0 + ldrh r2, [r1, 0xA] + ldr r0, =0x0000c5ff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, =0x00007fff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + movs r0, 0 + bl SetVBlankCallback + ldr r0, [r4] + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + b _08148CDE + .pool +_08148C6C: + ldr r5, =0x0203aba0 + ldr r1, [r5] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldrh r2, [r4, 0xC] + movs r0, 0xC + ldrsh r1, [r4, r0] + ldr r0, =0x000003ff + cmp r1, r0 + bgt _08148C88 + adds r0, r2, 0 + adds r0, 0x80 + strh r0, [r4, 0xC] +_08148C88: + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0x9F + bgt _08148C9C + ldrh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 24 + adds r0, r1, r0 + strh r0, [r4, 0xA] +_08148C9C: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0xA0 + ble _08148CA8 + movs r0, 0xA0 + strh r0, [r4, 0xA] +_08148CA8: + ldr r0, =0x02038c28 + movs r2, 0xA + ldrsh r3, [r4, r2] + movs r1, 0x78 + movs r2, 0x50 + bl sub_814A014 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0xA0 + bne _08148CD4 + movs r0, 0x1 + strh r0, [r4, 0x16] + bl sub_8149F84 + b _08148CDE + .pool +_08148CD4: + ldr r0, [r5] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] +_08148CDE: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8148C28 + + thumb_func_start sub_8148CE8 +sub_8148CE8: @ 8148CE8 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r6, =0x0203aba0 + ldr r0, [r6] + ldrb r1, [r0] + movs r5, 0 + strb r5, [r0] + ldrh r1, [r4, 0x16] + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08148D0A + adds r0, r1, 0x1 + strh r0, [r4, 0x16] + movs r0, 0x30 + strh r0, [r4, 0xA] + strh r5, [r4, 0x14] +_08148D0A: + ldr r1, =gUnknown_085C8C80 + movs r2, 0x14 + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + ldrh r1, [r4, 0xA] + adds r0, r1 + strh r0, [r4, 0xA] + movs r2, 0x14 + ldrsh r1, [r4, r2] + adds r1, 0x1 + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r0, 1 + lsls r0, 1 + subs r1, r0 + strh r1, [r4, 0x14] + ldr r0, =0x02038c28 + movs r1, 0xA + ldrsh r3, [r4, r1] + movs r1, 0x78 + movs r2, 0x50 + bl sub_814A014 + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0x8 + bgt _08148D4C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + strh r5, [r4, 0x16] +_08148D4C: + ldr r0, [r6] + ldrb r1, [r0] + adds r1, 0x1 + ldrb r2, [r0] + strb r1, [r0] + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8148CE8 + + thumb_func_start sub_8148D6C +sub_8148D6C: @ 8148D6C + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0203aba0 + ldr r1, [r0] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldrh r1, [r4, 0x16] + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08148D8E + adds r0, r1, 0x1 + strh r0, [r4, 0x16] + movs r0, 0x2 + strh r0, [r4, 0x12] + strh r0, [r4, 0x14] +_08148D8E: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0xA0 + ble _08148D9A + movs r0, 0xA0 + strh r0, [r4, 0xA] +_08148D9A: + ldr r0, =0x02038c28 + movs r2, 0xA + ldrsh r3, [r4, r2] + movs r1, 0x78 + movs r2, 0x50 + bl sub_814A014 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0xA0 + bne _08148DD6 + ldr r1, =0x040000b0 + ldrh r2, [r1, 0xA] + ldr r0, =0x0000c5ff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, =0x00007fff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F84 + ldr r0, [r4] + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_08148DD6: + ldrh r2, [r4, 0x12] + ldrb r0, [r4, 0x12] + cmp r0, 0x80 + bgt _08148DFC + ldrh r1, [r4, 0x14] + adds r0, r2, 0 + adds r0, 0x8 + b _08148E08 + .pool +_08148DFC: + ldrh r0, [r4, 0x14] + subs r0, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + adds r0, r2, 0 + adds r0, 0x10 +_08148E08: + strh r0, [r4, 0x12] + movs r0, 0xFF + ands r2, r0 + lsls r1, 16 + asrs r1, 16 + adds r0, r2, 0 + bl sine + ldrh r2, [r4, 0xA] + adds r0, r2 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bgt _08148E28 + movs r0, 0x1 + strh r0, [r4, 0xA] +_08148E28: + ldrh r0, [r4, 0x12] + lsls r1, r0, 16 + asrs r0, r1, 16 + cmp r0, 0xFE + ble _08148E3C + asrs r0, r1, 24 + strh r0, [r4, 0x12] + ldrh r0, [r4, 0x14] + adds r0, 0x1 + strh r0, [r4, 0x14] +_08148E3C: + ldr r0, =0x0203aba0 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8148D6C + + thumb_func_start sub_8148E54 +sub_8148E54: @ 8148E54 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8C84 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08148E66: + 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 _08148E66 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8148E54 + + thumb_func_start sub_8148E8C +sub_8148E8C: @ 8148E8C + push {r4,r5,lr} + sub sp, 0xC + adds r5, r0, 0 + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + ldr r4, =gUnknown_085BACD0 + ldr r1, [sp, 0x8] + adds r0, r4, 0 + movs r2, 0x10 + bl CpuSet + movs r0, 0xE0 + lsls r0, 1 + adds r4, r0 + ldr r1, [sp, 0x8] + adds r1, 0x40 + adds r0, r4, 0 + movs r2, 0x10 + bl CpuSet + mov r1, sp + movs r2, 0xF0 + lsls r2, 8 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, [sp, 0x4] + ldr r2, =0x01000400 + mov r0, sp + bl CpuSet + ldr r0, =gFieldEffectObjectPalette10 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r1, 0 + movs r4, 0x1 + movs r0, 0x1 + strh r0, [r5, 0xE] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + ldr r5, =0x03001210 + strb r1, [r5] + ldr r0, =0x0000ffff + strh r0, [r5, 0x2] + strb r4, [r5, 0x4] + movs r2, 0x9A + lsls r2, 1 + strh r2, [r5, 0x6] + strb r1, [r5, 0x8] + strb r1, [r5, 0xC] + movs r0, 0x1 + negs r0, r0 + strh r0, [r5, 0xE] + strb r4, [r5, 0x10] + strh r2, [r5, 0x12] + strb r1, [r5, 0x14] + strb r1, [r5, 0x18] + ldr r2, =0x0000fffd + strh r2, [r5, 0x1A] + strb r4, [r5, 0x1C] + ldr r3, =0x00000133 + strh r3, [r5, 0x1E] + adds r0, r5, 0 + adds r0, 0x20 + strb r1, [r0] + adds r0, 0x4 + strb r1, [r0] + strh r2, [r5, 0x26] + adds r0, 0x4 + strb r4, [r0] + strh r3, [r5, 0x2A] + adds r0, 0x4 + strb r1, [r0] + movs r0, 0 + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8148E8C + + thumb_func_start sub_8148F4C +sub_8148F4C: @ 8148F4C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + mov r8, r0 + movs r7, 0x1 + add r1, sp, 0x4 + mov r0, sp + bl sub_8149F58 + movs r0, 0 +_08148F62: + movs r5, 0 + adds r6, r0, 0x1 +_08148F66: + ldr r1, =gUnknown_085C8D38 + lsrs r0, r5, 1 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 2 + ldr r2, =0x03001210 + adds r4, r1, r2 + adds r1, r4, 0 + bl sub_8149048 + lsls r0, 16 + cmp r0, 0 + beq _08148FCA + movs r7, 0 + ldrh r2, [r4, 0x2] + movs r0, 0x1 + ands r0, r5 + cmp r0, 0x1 + bne _08148FA0 + ldr r0, =0x0000027d + adds r1, r0, 0 + lsls r0, r2, 16 + asrs r0, 16 + subs r1, r0 + lsls r1, 16 + lsrs r2, r1, 16 +_08148FA0: + lsls r0, r2, 16 + asrs r1, r0, 16 + adds r0, r1, 0 + cmp r1, 0 + bge _08148FAC + adds r0, 0x1F +_08148FAC: + asrs r2, r0, 5 + lsls r0, r2, 5 + subs r0, r1, r0 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r2, 5 + lsls r0, 16 + asrs r0, 16 + adds r1, r0 + ldr r0, [sp] + lsls r1, 1 + adds r1, r0 + ldr r2, =0x0000f002 + adds r0, r2, 0 + strh r0, [r1] +_08148FCA: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x3 + bls _08148F66 + lsls r0, r6, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _08148F62 + cmp r7, 0x1 + bne _08148FE8 + mov r1, r8 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_08148FE8: + movs r0, 0 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8148F4C + + thumb_func_start sub_8149008 +sub_8149008: @ 8149008 + push {r4,lr} + adds r4, r0, 0 + ldr r1, =0x040000b0 + ldrh r2, [r1, 0xA] + ldr r0, =0x0000c5ff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, =0x00007fff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F84 + ldr r0, [r4] + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8149008 + + thumb_func_start sub_8149048 +sub_8149048: @ 8149048 + push {r4,lr} + adds r2, r1, 0 + ldrb r1, [r2] + lsls r1, 2 + adds r1, r0 + ldr r3, [r1] + ldrb r0, [r2, 0x4] + lsls r0, 1 + adds r0, r3 + movs r4, 0 + ldrsh r1, [r0, r4] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081490CE + ldr r1, =0x03001208 + ldrh r0, [r3] + strh r0, [r1] + ldrh r0, [r3, 0x2] + strh r0, [r1] + ldrh r0, [r3, 0x4] + strh r0, [r1] + ldrh r0, [r3, 0x6] + strh r0, [r1] + movs r1, 0 + ldrsh r0, [r3, r1] + cmp r0, 0x2 + beq _081490A0 + cmp r0, 0x2 + bgt _08149090 + cmp r0, 0x1 + beq _0814909A + b _081490B2 + .pool +_08149090: + cmp r0, 0x3 + beq _081490A6 + cmp r0, 0x4 + beq _081490AC + b _081490B2 +_0814909A: + ldrh r0, [r2, 0x2] + adds r0, 0x1 + b _081490B0 +_081490A0: + ldrh r0, [r2, 0x2] + subs r0, 0x1 + b _081490B0 +_081490A6: + ldrh r0, [r2, 0x2] + subs r0, 0x20 + b _081490B0 +_081490AC: + ldrh r0, [r2, 0x2] + adds r0, 0x20 +_081490B0: + strh r0, [r2, 0x2] +_081490B2: + movs r4, 0x2 + ldrsh r1, [r2, r4] + ldr r0, =0x0000027f + cmp r1, r0 + bgt _081490CE + ldrb r0, [r2, 0x4] + lsls r0, 1 + adds r0, r3 + movs r4, 0 + ldrsh r1, [r0, r4] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _081490D8 +_081490CE: + movs r0, 0 + b _08149138 + .pool +_081490D8: + ldrb r0, [r2, 0x8] + cmp r0, 0 + bne _081490F4 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + bne _081490F4 + movs r0, 0x1 + strb r0, [r2, 0x8] + strb r0, [r2, 0x4] + ldrh r0, [r2, 0x6] + strh r0, [r2, 0x2] + movs r0, 0x4 + strb r0, [r2] +_081490F4: + ldrb r0, [r2, 0x4] + lsls r0, 1 + adds r0, r3 + movs r3, 0x2 + ldrsh r1, [r2, r3] + movs r4, 0 + ldrsh r0, [r0, r4] + cmp r1, r0 + bne _08149136 + ldrb r0, [r2] + adds r1, r0, 0x1 + strb r1, [r2] + ldrb r0, [r2, 0x8] + cmp r0, 0x1 + bne _08149124 + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, 0x7 + bls _08149136 + ldrb r0, [r2, 0x4] + adds r0, 0x1 + strb r0, [r2, 0x4] + movs r0, 0x4 + b _08149134 +_08149124: + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _08149136 + ldrb r0, [r2, 0x4] + adds r0, 0x1 + strb r0, [r2, 0x4] + movs r0, 0 +_08149134: + strb r0, [r2] +_08149136: + movs r0, 0x1 +_08149138: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8149048 + + thumb_func_start sub_8149140 +sub_8149140: @ 8149140 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8D40 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08149152: + 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 _08149152 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8149140 + + thumb_func_start sub_8149178 +sub_8149178: @ 8149178 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, [sp, 0x4] + ldr r2, =0x01000400 + mov r0, sp + bl CpuSet + ldr r0, =gUnknown_085BE51C + ldr r1, [sp, 0x8] + bl LZ77UnCompVram + ldr r0, =gUnknown_085BEA88 + ldr r1, [sp, 0x4] + bl LZ77UnCompVram + ldrh r0, [r4, 0x8] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x8] + strh r1, [r4, 0xA] + movs r0, 0 + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8149178 + + thumb_func_start sub_81491C8 +sub_81491C8: @ 81491C8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xA + ldrsh r5, [r4, r0] + adds r0, r5, 0 + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _08149200 + adds r0, r5, 0 + movs r1, 0x1E + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + lsrs r0, 11 + ldr r1, =gUnknown_085BF0A0 + adds r0, r1 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply +_08149200: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3A + ble _08149218 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + strh r0, [r4, 0xA] +_08149218: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81491C8 + + thumb_func_start sub_8149224 +sub_8149224: @ 8149224 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xA + ldrsh r5, [r4, r0] + adds r0, r5, 0 + movs r1, 0x5 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _08149252 + adds r0, r5, 0 + movs r1, 0x5 + bl __divsi3 + lsls r0, 16 + asrs r0, 11 + ldr r1, =gUnknown_085BF2A0 + adds r0, r1 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply +_08149252: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x44 + ble _0814926E + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + strh r0, [r4, 0xA] + movs r0, 0x1E + strh r0, [r4, 0x18] +_0814926E: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8149224 + + thumb_func_start sub_814927C +sub_814927C: @ 814927C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8D60 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814928E: + 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 _0814928E + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814927C + + thumb_func_start sub_81492B4 +sub_81492B4: @ 81492B4 + push {r4-r6,lr} + sub sp, 0xC + adds r4, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + ldr r1, =0x00009a08 + movs r0, 0x8 + bl SetGpuReg + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, [sp, 0x4] + ldr r2, =0x01000400 + mov r0, sp + bl CpuSet + ldr r0, =gUnknown_085BF6A0 + ldr r1, [sp, 0x8] + movs r2, 0x80 + lsls r2, 5 + bl CpuSet + ldr r0, =0x0203aba0 + ldr r1, [r0] + movs r0, 0 + strh r0, [r1, 0x20] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldr r0, =gUnknown_085BF540 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r2, 0 + ldr r3, =0x02038c28 + movs r6, 0 + movs r0, 0xF0 + lsls r0, 3 + adds r5, r3, r0 + movs r4, 0x80 + lsls r4, 1 +_08149316: + lsls r1, r2, 1 + adds r0, r1, r3 + strh r6, [r0] + adds r1, r5 + strh r4, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x9F + bls _08149316 + ldr r0, =sub_8149508 + bl SetVBlankCallback + movs r0, 0 + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81492B4 + + thumb_func_start sub_8149358 +sub_8149358: @ 8149358 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + add r1, sp, 0x4 + mov r0, sp + bl sub_8149F58 + ldr r0, =gUnknown_085C6BE0 + ldr r1, [sp] + movs r2, 0x80 + lsls r2, 4 + bl CpuSet + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8149358 + + thumb_func_start sub_8149388 +sub_8149388: @ 8149388 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0xA] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081493B4 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _081493A0 + adds r0, 0x3 +_081493A0: + lsls r0, 14 + lsrs r0, 16 + adds r0, 0x5 + lsls r0, 5 + ldr r1, =gUnknown_085BF4A0 + adds r0, r1 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply +_081493B4: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + ble _081493CC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + strh r0, [r4, 0xA] +_081493CC: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8149388 + + thumb_func_start sub_81493D8 +sub_81493D8: @ 81493D8 + push {lr} + sub sp, 0x4 + adds r1, r0, 0 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + movs r2, 0 + strh r0, [r1, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _08149402 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + strh r2, [r1, 0xA] + ldr r0, =0xffff8000 + str r2, [sp] + movs r1, 0x2 + movs r3, 0x10 + bl pal_fade_maybe +_08149402: + movs r0, 0 + add sp, 0x4 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81493D8 + + thumb_func_start sub_8149410 +sub_8149410: @ 8149410 + push {lr} + adds r2, r0, 0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0814942E + ldr r0, =0x0203aba0 + ldr r1, [r0] + movs r0, 0x1 + strh r0, [r1, 0x20] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] +_0814942E: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8149410 + + thumb_func_start sub_814943C +sub_814943C: @ 814943C + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x00007fff + movs r1, 0x8 + movs r2, 0 + bl sub_80A2A20 + ldr r0, =0xffff8000 + movs r1, 0 + movs r2, 0 + bl sub_80A2A20 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814943C + + thumb_func_start sub_814946C +sub_814946C: @ 814946C + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0xA + ldrsh r5, [r4, r0] + adds r0, r5, 0 + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _0814949A + adds r0, r5, 0 + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + lsrs r0, 11 + ldr r1, =gUnknown_085BF4A0 + adds r0, r1 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply +_0814949A: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x27 + ble _081494F0 + ldr r0, =0x0203aba0 + ldr r1, [r0] + movs r0, 0 + strh r0, [r1, 0x2] + movs r0, 0x3F + strh r0, [r1, 0x4] + movs r0, 0xF0 + strh r0, [r1, 0x6] + movs r0, 0xA0 + strh r0, [r1, 0x8] + movs r1, 0 + ldr r5, =sub_8146F68 + ldr r3, =0x020393a8 + movs r2, 0 +_081494C4: + lsls r0, r1, 1 + adds r0, r3 + strh r2, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x9F + bls _081494C4 + adds r0, r5, 0 + bl SetVBlankCallback + ldrh r0, [r4, 0x8] + adds r0, 0x1 + movs r2, 0 + strh r0, [r4, 0x8] + movs r1, 0x80 + lsls r1, 1 + strh r1, [r4, 0xC] + strh r2, [r4, 0x16] + movs r0, 0 + bl ClearGpuRegBits +_081494F0: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814946C + + thumb_func_start sub_8149508 +sub_8149508: @ 8149508 + push {lr} + ldr r1, =0x040000b0 + ldrh r2, [r1, 0xA] + ldr r0, =0x0000c5ff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, =0x00007fff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F2C + ldr r0, =0x0203aba0 + ldr r0, [r0] + movs r1, 0x20 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08149548 + ldr r2, =0x02038c28 + b _08149554 + .pool +_08149548: + ldr r2, =0x02038c28 + cmp r0, 0x1 + bne _08149554 + movs r0, 0xF0 + lsls r0, 3 + adds r2, r0 +_08149554: + ldr r1, =0x040000b0 + str r2, [r1] + ldr r0, =0x04000012 + str r0, [r1, 0x4] + ldr r0, =0xa2400001 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8149508 + + thumb_func_start sub_8149578 +sub_8149578: @ 8149578 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8D8C + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814958A: + 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 _0814958A + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8149578 + + thumb_func_start sub_81495B0 +sub_81495B0: @ 81495B0 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + ldr r0, =0x0203aba0 + ldr r1, [r0] + movs r2, 0 + movs r0, 0xBF + strh r0, [r1, 0xE] + strh r2, [r1, 0x12] + movs r0, 0x1E + strh r0, [r1, 0x2] + movs r0, 0x3F + strh r0, [r1, 0x4] + movs r0, 0xA0 + strh r0, [r1, 0x8] + movs r1, 0 + ldr r2, =0x020393a8 + movs r4, 0 + movs r3, 0xF0 +_081495DC: + lsls r0, r1, 1 + adds r0, r2 + strh r4, [r0] + adds r0, r1, 0 + adds r0, 0xA0 + lsls r0, 1 + adds r0, r2 + strh r3, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x9F + bls _081495DC + movs r0, 0x2 + bl EnableInterrupts + ldr r0, =sub_8149840 + bl SetHBlankCallback + ldr r0, =sub_8149774 + bl SetVBlankCallback + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81495B0 + + thumb_func_start sub_8149628 +sub_8149628: @ 8149628 + push {r4-r6,lr} + sub sp, 0x10 + adds r6, r0, 0 + ldr r1, =gUnknown_085C8DA0 + mov r0, sp + movs r2, 0x10 + bl memcpy + movs r5, 0 + movs r4, 0 +_0814963C: + ldr r0, =sub_8149864 + bl obj_add_empty_with_callback + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r2, r1, r0 + movs r0, 0xF0 + strh r0, [r2, 0x20] + strh r4, [r2, 0x22] + lsls r1, r5, 16 + asrs r1, 16 + lsls r0, r1, 1 + add r0, sp + ldrh r0, [r0] + strh r0, [r2, 0x38] + adds r1, 0x1 + lsls r1, 16 + lsls r0, r4, 16 + movs r3, 0xA0 + lsls r3, 13 + adds r0, r3 + lsrs r4, r0, 16 + lsrs r5, r1, 16 + asrs r1, 16 + cmp r1, 0x7 + ble _0814963C + ldrh r0, [r2, 0x3A] + adds r0, 0x1 + strh r0, [r2, 0x3A] + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + movs r0, 0 + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8149628 + + thumb_func_start sub_814969C +sub_814969C: @ 814969C + push {r4,lr} + adds r4, r0, 0 + ldr r2, =0x0203aba0 + ldr r1, [r2] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + ldr r0, [r2] + movs r1, 0x20 + ldrsh r0, [r0, r1] + cmp r0, 0x7 + ble _081496C6 + movs r0, 0x1 + negs r0, r0 + ldr r2, =0x00007fff + movs r1, 0x10 + bl sub_80A2A20 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_081496C6: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814969C + + thumb_func_start sub_81496D8 +sub_81496D8: @ 81496D8 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r4, =0x0203aba0 + ldr r0, [r4] + ldrb r1, [r0] + movs r5, 0 + strb r5, [r0] + ldr r1, =0x040000b0 + ldrh r2, [r1, 0xA] + ldr r0, =0x0000c5ff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, =0x00007fff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl SetHBlankCallback + ldr r1, [r4] + movs r0, 0xF0 + strh r0, [r1, 0x6] + strh r5, [r1, 0x12] + movs r0, 0xFF + strh r0, [r1, 0xE] + movs r0, 0x3F + strh r0, [r1, 0x2] + ldr r0, =sub_8149804 + bl SetVBlankCallback + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81496D8 + + thumb_func_start sub_8149740 +sub_8149740: @ 8149740 + push {lr} + ldr r0, =0x0203aba0 + ldr r1, [r0] + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x10 + bls _08149766 + bl sub_8149F84 + ldr r0, =sub_8149578 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_08149766: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8149740 + + thumb_func_start sub_8149774 +sub_8149774: @ 8149774 + push {r4,lr} + ldr r4, =0x040000b0 + ldrh r1, [r4, 0xA] + ldr r0, =0x0000c5ff + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r1, [r4, 0xA] + ldr r0, =0x00007fff + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xA] + bl sub_8149F2C + ldr r2, =0x04000050 + ldr r0, =0x0203aba0 + ldr r1, [r0] + ldrh r0, [r1, 0xE] + strh r0, [r2] + subs r2, 0x8 + ldrh r0, [r1, 0x2] + strh r0, [r2] + adds r2, 0x2 + ldrh r0, [r1, 0x4] + strh r0, [r2] + subs r2, 0x6 + ldrh r0, [r1, 0x8] + strh r0, [r2] + ldrb r0, [r1] + cmp r0, 0 + beq _081497C4 + ldr r1, =0x040000d4 + ldr r0, =0x02038c28 + str r0, [r1] + movs r2, 0xF0 + lsls r2, 3 + adds r0, r2 + str r0, [r1, 0x4] + ldr r0, =0x80000140 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_081497C4: + ldr r0, =0x020394e8 + str r0, [r4] + ldr r0, =0x04000040 + str r0, [r4, 0x4] + ldr r0, =0xa2400001 + str r0, [r4, 0x8] + ldr r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8149774 + + thumb_func_start sub_8149804 +sub_8149804: @ 8149804 + push {lr} + bl sub_8149F2C + ldr r1, =0x04000054 + ldr r0, =0x0203aba0 + ldr r2, [r0] + ldrh r0, [r2, 0x12] + strh r0, [r1] + subs r1, 0x4 + ldrh r0, [r2, 0xE] + strh r0, [r1] + subs r1, 0x8 + ldrh r0, [r2, 0x2] + strh r0, [r1] + adds r1, 0x2 + ldrh r0, [r2, 0x4] + strh r0, [r1] + subs r1, 0xA + ldrh r0, [r2, 0x6] + strh r0, [r1] + adds r1, 0x4 + ldrh r0, [r2, 0x8] + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8149804 + + thumb_func_start sub_8149840 +sub_8149840: @ 8149840 + ldr r2, =0x04000054 + ldr r1, =0x02038c28 + ldr r0, =0x04000006 + ldrh r0, [r0] + lsls r0, 1 + movs r3, 0xF0 + lsls r3, 3 + adds r1, r3 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + bx lr + .pool + thumb_func_end sub_8149840 + + thumb_func_start sub_8149864 +sub_8149864: @ 8149864 + push {r4-r6,lr} + adds r3, r0, 0 + ldrh r1, [r3, 0x38] + movs r2, 0x38 + ldrsh r0, [r3, r2] + cmp r0, 0 + beq _08149890 + subs r0, r1, 0x1 + strh r0, [r3, 0x38] + movs r1, 0x3A + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _0814994C + ldr r0, =0x0203aba0 + ldr r1, [r0] + ldrb r0, [r1] + movs r0, 0x1 + strb r0, [r1] + b _0814994C + .pool +_08149890: + movs r2, 0x22 + ldrsh r1, [r3, r2] + lsls r1, 1 + ldr r0, =0x02038c28 + adds r6, r1, r0 + movs r2, 0xA0 + lsls r2, 1 + adds r0, r2 + adds r5, r1, r0 + movs r4, 0 +_081498A4: + lsls r1, r4, 1 + adds r2, r1, r6 + ldrh r0, [r3, 0x2E] + lsls r0, 16 + asrs r0, 24 + strh r0, [r2] + adds r1, r5 + ldrh r0, [r3, 0x20] + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x13 + bls _081498A4 + movs r1, 0x20 + ldrsh r0, [r3, r1] + ldrh r2, [r3, 0x20] + cmp r0, 0 + bne _081498DE + movs r0, 0x2E + ldrsh r1, [r3, r0] + movs r0, 0x80 + lsls r0, 5 + cmp r1, r0 + bne _081498DE + movs r0, 0x1 + strh r0, [r3, 0x30] +_081498DE: + adds r1, r2, 0 + subs r1, 0x10 + strh r1, [r3, 0x20] + ldrh r0, [r3, 0x2E] + adds r0, 0x80 + strh r0, [r3, 0x2E] + lsls r1, 16 + cmp r1, 0 + bge _081498F4 + movs r0, 0 + strh r0, [r3, 0x20] +_081498F4: + movs r1, 0x2E + ldrsh r0, [r3, r1] + movs r1, 0x80 + lsls r1, 5 + cmp r0, r1 + ble _08149902 + strh r1, [r3, 0x2E] +_08149902: + movs r2, 0x3A + ldrsh r0, [r3, r2] + cmp r0, 0 + beq _08149914 + ldr r0, =0x0203aba0 + ldr r1, [r0] + ldrb r0, [r1] + movs r0, 0x1 + strb r0, [r1] +_08149914: + movs r1, 0x30 + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _0814994C + movs r2, 0x3A + ldrsh r0, [r3, r2] + ldr r2, =0x0203aba0 + cmp r0, 0 + beq _0814993E + ldr r0, [r2] + movs r1, 0x20 + ldrsh r0, [r0, r1] + cmp r0, 0x6 + ble _0814994C + ldrh r0, [r3, 0x32] + adds r1, r0, 0x1 + strh r1, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _0814994C +_0814993E: + ldr r1, [r2] + ldrh r0, [r1, 0x20] + adds r0, 0x1 + strh r0, [r1, 0x20] + adds r0, r3, 0 + bl RemoveObjectAndFreeTiles +_0814994C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8149864 + + thumb_func_start sub_814995C +sub_814995C: @ 814995C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8DB0 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814996E: + 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 _0814996E + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814995C + + thumb_func_start sub_8149994 +sub_8149994: @ 8149994 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + ldr r0, =gUnknown_085BACD0 + ldr r1, [sp, 0x8] + movs r2, 0x10 + bl CpuSet + mov r1, sp + movs r2, 0xF0 + lsls r2, 8 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, [sp, 0x4] + ldr r2, =0x01000400 + mov r0, sp + bl CpuSet + ldr r0, =gFieldEffectObjectPalette10 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8149994 + + thumb_func_start sub_81499E8 +sub_81499E8: @ 81499E8 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08149A2A + mov r0, sp + bl sub_8149F40 + movs r0, 0x3 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0xC + ldrsh r0, [r4, r1] + lsls r0, 5 + ldr r1, =gUnknown_085BACD0 + adds r0, r1 + ldr r1, [sp] + movs r2, 0x10 + bl CpuSet + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0xD + ble _08149A2A + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x10 + strh r0, [r4, 0xA] +_08149A2A: + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81499E8 + + thumb_func_start sub_8149A40 +sub_8149A40: @ 8149A40 + push {lr} + ldrh r1, [r0, 0xA] + subs r1, 0x1 + strh r1, [r0, 0xA] + lsls r1, 16 + cmp r1, 0 + bne _08149A60 + bl sub_8149F84 + ldr r0, =sub_814995C + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_08149A60: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8149A40 + + thumb_func_start sub_8149A6C +sub_8149A6C: @ 8149A6C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8DBC + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08149A7E: + 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 _08149A7E + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8149A6C + + thumb_func_start sub_8149AA4 +sub_8149AA4: @ 8149AA4 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + ldr r0, =0x0203aba0 + ldr r1, [r0] + movs r2, 0 + movs r0, 0x3F + strh r0, [r1, 0x2] + strh r2, [r1, 0x4] + movs r0, 0xA0 + strh r0, [r1, 0x8] + movs r1, 0 + ldr r2, =0x02038c28 + movs r3, 0xF0 + adds r4, r2, 0 +_08149AC8: + lsls r0, r1, 1 + adds r0, r2 + strh r3, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x9F + bls _08149AC8 + movs r0, 0xF0 + lsls r0, 3 + adds r1, r4, r0 + adds r0, r4, 0 + movs r2, 0xA0 + bl CpuSet + ldr r0, =sub_8149CE8 + bl SetVBlankCallback + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8149AA4 + + thumb_func_start sub_8149B08 +sub_8149B08: @ 8149B08 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + mov r8, r0 + ldr r0, =0x0203aba0 + ldr r0, [r0] + adds r0, 0x24 + ldr r6, =gUnknown_085C8DD0 + mov r2, r8 + movs r3, 0xA + ldrsh r1, [r2, r3] + lsls r4, r1, 2 + adds r4, r1 + lsls r4, 1 + adds r1, r4, r6 + movs r5, 0 + ldrsh r1, [r1, r5] + adds r2, r6, 0x2 + adds r2, r4, r2 + movs r3, 0 + ldrsh r2, [r2, r3] + adds r3, r6, 0x4 + adds r3, r4, r3 + movs r5, 0 + ldrsh r3, [r3, r5] + adds r5, r6, 0x6 + adds r4, r5 + movs r5, 0 + ldrsh r4, [r4, r5] + str r4, [sp] + movs r4, 0x1 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + bl sub_814A1AC + mov r0, r8 + movs r2, 0xA + ldrsh r1, [r0, r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + adds r6, 0x8 + adds r0, r6 + ldrh r0, [r0] + mov r3, r8 + strh r0, [r3, 0xC] + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] + movs r0, 0x1 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8149B08 + + thumb_func_start sub_8149B84 +sub_8149B84: @ 8149B84 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + ldr r0, =0x0203aba0 + ldr r1, [r0] + ldrb r0, [r1] + movs r0, 0 + strb r0, [r1] + mov r8, r0 + movs r7, 0 + ldr r0, =0x02038c28 + mov r9, r0 +_08149BA0: + ldr r1, =0x02038c28 + ldr r0, =0x0203aba0 + ldr r2, [r0] + movs r3, 0x2A + ldrsh r0, [r2, r3] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + lsrs r3, r0, 8 + movs r5, 0xFF + ands r5, r0 + movs r4, 0xC + ldrsh r0, [r6, r4] + cmp r0, 0 + bne _08149BDC + movs r1, 0x28 + ldrsh r0, [r2, r1] + cmp r3, r0 + bge _08149BC8 + ldrh r3, [r2, 0x28] +_08149BC8: + lsls r0, r3, 16 + lsls r1, r5, 16 + cmp r0, r1 + ble _08149BF4 + lsrs r3, r1, 16 + b _08149BF4 + .pool +_08149BDC: + lsls r0, r5, 16 + asrs r0, 16 + movs r4, 0x28 + ldrsh r1, [r2, r4] + cmp r0, r1 + ble _08149BEA + ldrh r5, [r2, 0x28] +_08149BEA: + lsls r0, r5, 16 + lsls r1, r3, 16 + cmp r0, r1 + bgt _08149BF4 + lsrs r5, r1, 16 +_08149BF4: + ldr r0, =0x0203aba0 + ldr r4, [r0] + movs r0, 0x2A + ldrsh r2, [r4, r0] + lsls r2, 1 + add r2, r9 + lsls r1, r3, 16 + asrs r1, 8 + lsls r0, r5, 16 + asrs r0, 16 + orrs r0, r1 + strh r0, [r2] + cmp r7, 0 + beq _08149C1C + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + b _08149C40 + .pool +_08149C1C: + adds r0, r4, 0 + adds r0, 0x24 + movs r1, 0x1 + movs r2, 0x1 + bl sub_814A228 + lsls r0, 24 + lsrs r7, r0, 24 + mov r1, r8 + lsls r0, r1, 16 + movs r3, 0x80 + lsls r3, 9 + adds r0, r3 + lsrs r4, r0, 16 + mov r8, r4 + asrs r0, 16 + cmp r0, 0xF + ble _08149BA0 +_08149C40: + ldr r0, =0x0203aba0 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r0, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8149B84 + + thumb_func_start sub_8149C60 +sub_8149C60: @ 8149C60 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0xA] + adds r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + ble _08149CAC + ldr r1, =0x040000b0 + ldrh r2, [r1, 0xA] + ldr r0, =0x0000c5ff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, =0x00007fff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + bl sub_8149F84 + ldr r0, =sub_8149A6C + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0 + b _08149CC4 + .pool +_08149CAC: + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + ldr r1, =gUnknown_085C8E16 + movs r3, 0xA + ldrsh r0, [r2, r3] + subs r0, 0x1 + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2, 0xE] + movs r0, 0x1 +_08149CC4: + pop {r1} + bx r1 + .pool + thumb_func_end sub_8149C60 + + thumb_func_start sub_8149CCC +sub_8149CCC: @ 8149CCC + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0xE] + subs r0, 0x1 + strh r0, [r1, 0xE] + lsls r0, 16 + cmp r0, 0 + beq _08149CE0 + movs r0, 0 + b _08149CE4 +_08149CE0: + movs r0, 0x1 + strh r0, [r1, 0x8] +_08149CE4: + pop {r1} + bx r1 + thumb_func_end sub_8149CCC + + thumb_func_start sub_8149CE8 +sub_8149CE8: @ 8149CE8 + push {r4,lr} + ldr r4, =0x040000b0 + ldrh r1, [r4, 0xA] + ldr r0, =0x0000c5ff + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r1, [r4, 0xA] + ldr r0, =0x00007fff + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xA] + bl sub_8149F2C + ldr r3, =0x0203aba0 + ldr r0, [r3] + ldrb r0, [r0] + cmp r0, 0 + beq _08149D20 + ldr r1, =0x040000d4 + ldr r0, =0x02038c28 + str r0, [r1] + movs r2, 0xF0 + lsls r2, 3 + adds r0, r2 + str r0, [r1, 0x4] + ldr r0, =0x800000a0 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_08149D20: + ldr r2, =0x04000048 + ldr r1, [r3] + ldrh r0, [r1, 0x2] + strh r0, [r2] + adds r2, 0x2 + ldrh r0, [r1, 0x4] + strh r0, [r2] + subs r2, 0x6 + ldrh r0, [r1, 0x8] + strh r0, [r2] + subs r2, 0x4 + ldr r0, =0x02038c28 + movs r1, 0xF0 + lsls r1, 3 + adds r0, r1 + ldrh r1, [r0] + strh r1, [r2] + str r0, [r4] + str r2, [r4, 0x4] + ldr r0, =0xa2400001 + str r0, [r4, 0x8] + ldr r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8149CE8 + + thumb_func_start sub_8149D78 +sub_8149D78: @ 8149D78 + 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_8149DFC + movs r1, 0x3 + str r3, [sp] + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + 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_8149D78 + + thumb_func_start sub_8149DDC +sub_8149DDC: @ 8149DDC + push {lr} + ldr r0, =sub_8149DFC + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _08149DF4 + movs r0, 0 + b _08149DF6 + .pool +_08149DF4: + movs r0, 0x1 +_08149DF6: + pop {r1} + bx r1 + thumb_func_end sub_8149DDC + + thumb_func_start sub_8149DFC +sub_8149DFC: @ 8149DFC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C8E24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_08149E0E: + 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 _08149E0E + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8149DFC + + thumb_func_start sub_8149E34 +sub_8149E34: @ 8149E34 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x14] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08149E4C + subs r0, r1, 0x1 + strh r0, [r4, 0x14] + lsls r0, 16 + cmp r0, 0 + bne _08149E70 +_08149E4C: + 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 _08149E64 + movs r0, 0x10 + strh r0, [r4, 0x16] +_08149E64: + movs r0, 0x1 + negs r0, r0 + ldrb r1, [r4, 0x16] + ldr r2, =0x00002d6b + bl sub_80A2A20 +_08149E70: + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0xF + ble _08149E82 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldrh r0, [r4, 0xC] + strh r0, [r4, 0x14] +_08149E82: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8149E34 + + thumb_func_start sub_8149E90 +sub_8149E90: @ 8149E90 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x14] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08149EA8 + subs r0, r1, 0x1 + strh r0, [r4, 0x14] + lsls r0, 16 + cmp r0, 0 + bne _08149ECA +_08149EA8: + 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 _08149EBE + movs r0, 0 + strh r0, [r4, 0x16] +_08149EBE: + movs r0, 0x1 + negs r0, r0 + ldrb r1, [r4, 0x16] + ldr r2, =0x00002d6b + bl sub_80A2A20 +_08149ECA: + movs r0, 0x16 + ldrsh r1, [r4, r0] + cmp r1, 0 + bne _08149EFE + ldrh r0, [r4, 0xE] + subs r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _08149EF8 + ldr r0, =sub_8149DFC + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + b _08149EFE + .pool +_08149EF8: + ldrh r0, [r4, 0xA] + strh r0, [r4, 0x14] + strh r1, [r4, 0x8] +_08149EFE: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8149E90 + + thumb_func_start sub_8149F08 +sub_8149F08: @ 8149F08 + push {r4,lr} + ldr r4, =0x0203aba0 + ldr r0, [r4] + movs r1, 0 + movs r2, 0x3C + bl memset + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x14 + adds r1, 0x16 + bl sub_8089C08 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8149F08 + + thumb_func_start sub_8149F2C +sub_8149F2C: @ 8149F2C + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8149F2C + + thumb_func_start sub_8149F40 +sub_8149F40: @ 8149F40 + ldr r1, =0x04000008 + ldrh r1, [r1] + lsrs r1, 2 + lsls r1, 30 + lsrs r1, 16 + movs r2, 0xC0 + lsls r2, 19 + adds r1, r2 + str r1, [r0] + bx lr + .pool + thumb_func_end sub_8149F40 + + thumb_func_start sub_8149F58 +sub_8149F58: @ 8149F58 + push {r4,lr} + ldr r3, =0x04000008 + ldrh r2, [r3] + lsrs r2, 8 + ldrh r3, [r3] + lsrs r3, 2 + lsls r2, 27 + lsrs r2, 16 + lsls r3, 30 + lsrs r3, 16 + movs r4, 0xC0 + lsls r4, 19 + adds r2, r4 + str r2, [r0] + adds r3, r4 + str r3, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8149F58 + + thumb_func_start sub_8149F84 +sub_8149F84: @ 8149F84 + push {lr} + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + pop {r0} + bx r0 + thumb_func_end sub_8149F84 + + thumb_func_start sub_8149F98 +sub_8149F98: @ 8149F98 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r0 + ldr r0, [sp, 0x20] + ldr r4, [sp, 0x24] + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + lsls r0, 16 + lsrs r1, r0, 16 + lsls r4, 16 + movs r6, 0 + lsrs r5, r4, 16 + cmp r4, 0 + ble _0814A000 + lsls r0, r7, 16 + asrs r0, 16 + mov r9, r0 + lsls r1, 16 + mov r8, r1 + lsls r0, r3, 16 + asrs r7, r0, 16 +_08149FD0: + lsls r4, r2, 16 + asrs r4, 16 + movs r0, 0xFF + ands r0, r4 + mov r2, r8 + asrs r1, r2, 16 + bl sine + lsls r1, r6, 1 + add r1, r10 + add r0, r9 + strh r0, [r1] + lsls r1, r5, 16 + ldr r0, =0xffff0000 + adds r1, r0 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r4, r7 + lsls r4, 16 + lsrs r2, r4, 16 + lsrs r5, r1, 16 + cmp r1, 0 + bgt _08149FD0 +_0814A000: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8149F98 + + thumb_func_start sub_814A014 +sub_814A014: @ 814A014 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + mov r9, r0 + adds r5, r2, 0 + adds r4, r3, 0 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + lsls r5, 16 + lsrs r5, 16 + lsls r4, 16 + lsrs r4, 16 + movs r2, 0xA0 + lsls r2, 1 + movs r1, 0xA + bl memset + movs r1, 0 + lsls r4, 16 + asrs r4, 16 + str r4, [sp, 0x4] + lsls r5, 16 + asrs r5, 16 + str r5, [sp, 0x8] +_0814A04C: + lsls r5, r1, 16 + asrs r0, r5, 16 + mov r10, r0 + ldr r1, [sp, 0x4] + bl sine + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r10 + ldr r1, [sp, 0x4] + bl cosine + ldr r2, [sp] + lsls r1, r2, 16 + asrs r1, 16 + lsls r4, 16 + asrs r4, 16 + subs r2, r1, r4 + lsls r2, 16 + adds r1, r4 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r0, 16 + asrs r0, 16 + ldr r3, [sp, 0x8] + subs r1, r3, r0 + lsls r1, 16 + lsrs r7, r1, 16 + adds r0, r3, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsrs r1, r2, 16 + str r5, [sp, 0x10] + cmp r2, 0 + bge _0814A098 + movs r1, 0 +_0814A098: + lsls r0, r6, 16 + asrs r0, 16 + cmp r0, 0xF0 + ble _0814A0A2 + movs r6, 0xF0 +_0814A0A2: + lsls r0, r7, 16 + cmp r0, 0 + bge _0814A0AA + movs r7, 0 +_0814A0AA: + mov r2, r8 + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x9F + ble _0814A0B8 + movs r3, 0x9F + mov r8, r3 +_0814A0B8: + lsls r0, r1, 24 + lsrs r0, 16 + orrs r6, r0 + lsls r0, r7, 16 + asrs r0, 16 + str r0, [sp, 0xC] + lsls r0, 1 + add r0, r9 + strh r6, [r0] + mov r0, r8 + lsls r4, r0, 16 + asrs r0, r4, 15 + add r0, r9 + strh r6, [r0] + mov r0, r10 + adds r0, 0x1 + lsls r0, 16 + asrs r0, 16 + ldr r1, [sp, 0x4] + bl cosine + lsls r0, 16 + asrs r0, 16 + ldr r2, [sp, 0x8] + subs r1, r2, r0 + lsls r1, 16 + adds r0, r2, r0 + lsls r0, 16 + lsrs r2, r0, 16 + lsrs r3, r1, 16 + cmp r1, 0 + bge _0814A0FA + movs r3, 0 +_0814A0FA: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x9F + ble _0814A104 + movs r2, 0x9F +_0814A104: + lsls r0, r3, 16 + asrs r1, r0, 16 + adds r3, r0, 0 + lsls r5, r2, 16 + ldr r0, [sp, 0xC] + cmp r0, r1 + ble _0814A128 + adds r2, r1, 0 +_0814A114: + lsls r1, r7, 16 + ldr r0, =0xffff0000 + adds r1, r0 + asrs r0, r1, 15 + add r0, r9 + strh r6, [r0] + lsrs r7, r1, 16 + asrs r1, 16 + cmp r1, r2 + bgt _0814A114 +_0814A128: + lsls r1, r7, 16 + asrs r0, r3, 16 + cmp r1, r3 + bge _0814A146 + adds r2, r0, 0 +_0814A132: + movs r3, 0x80 + lsls r3, 9 + adds r0, r1, r3 + asrs r1, r0, 15 + add r1, r9 + strh r6, [r1] + adds r1, r0, 0 + asrs r0, r1, 16 + cmp r0, r2 + blt _0814A132 +_0814A146: + asrs r0, r5, 16 + cmp r4, r5 + ble _0814A164 + adds r1, r0, 0 +_0814A14E: + ldr r2, =0xffff0000 + adds r0, r4, r2 + lsrs r3, r0, 16 + mov r8, r3 + asrs r0, 15 + add r0, r9 + strh r6, [r0] + lsls r4, r3, 16 + asrs r0, r4, 16 + cmp r0, r1 + bgt _0814A14E +_0814A164: + mov r0, r8 + lsls r4, r0, 16 + asrs r0, r5, 16 + cmp r4, r5 + bge _0814A184 + adds r2, r0, 0 +_0814A170: + movs r1, 0x80 + lsls r1, 9 + adds r0, r4, r1 + asrs r1, r0, 15 + add r1, r9 + strh r6, [r1] + adds r4, r0, 0 + asrs r0, r4, 16 + cmp r0, r2 + blt _0814A170 +_0814A184: + ldr r2, [sp, 0x10] + movs r3, 0x80 + lsls r3, 9 + adds r0, r2, r3 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, 0x3F + bgt _0814A196 + b _0814A04C +_0814A196: + 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_814A014 + + thumb_func_start sub_814A1AC +sub_814A1AC: @ 814A1AC + push {r4-r7,lr} + adds r6, r0, 0 + ldr r0, [sp, 0x14] + ldr r5, [sp, 0x18] + ldr r4, [sp, 0x1C] + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + lsls r0, 16 + lsrs r0, 16 + adds r7, r0, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r4, 16 + lsrs r4, 16 + strh r1, [r6] + strh r2, [r6, 0x2] + strh r1, [r6, 0x4] + strh r2, [r6, 0x6] + strh r3, [r6, 0x8] + strh r7, [r6, 0xA] + strh r5, [r6, 0xC] + strh r4, [r6, 0xE] + lsls r3, 16 + asrs r3, 16 + lsls r1, 16 + asrs r1, 16 + subs r3, r1 + strh r3, [r6, 0x10] + lsls r0, r3, 16 + cmp r0, 0 + bge _0814A1FE + negs r0, r3 + strh r0, [r6, 0x10] + lsls r0, r5, 16 + asrs r0, 16 + negs r0, r0 + strh r0, [r6, 0xC] +_0814A1FE: + lsls r0, r7, 16 + asrs r0, 16 + lsls r1, r2, 16 + asrs r1, 16 + subs r1, r0, r1 + strh r1, [r6, 0x12] + lsls r0, r1, 16 + cmp r0, 0 + bge _0814A21C + negs r0, r1 + strh r0, [r6, 0x12] + lsls r0, r4, 16 + asrs r0, 16 + negs r0, r0 + strh r0, [r6, 0xE] +_0814A21C: + movs r0, 0 + strh r0, [r6, 0x14] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_814A1AC + + thumb_func_start sub_814A228 +sub_814A228: @ 814A228 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r3, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + ldrh r0, [r3, 0x10] + mov r8, r0 + movs r1, 0x10 + ldrsh r6, [r3, r1] + ldrh r2, [r3, 0x12] + mov r12, r2 + movs r4, 0x12 + ldrsh r5, [r3, r4] + cmp r6, r5 + ble _0814A278 + ldrh r0, [r3, 0xC] + ldrh r2, [r3, 0x4] + adds r1, r0, r2 + strh r1, [r3, 0x4] + ldrh r2, [r3, 0x14] + add r2, r12 + strh r2, [r3, 0x14] + lsls r1, r2, 16 + asrs r1, 16 + adds r4, r0, 0 + ldrh r7, [r3, 0xE] + cmp r1, r6 + ble _0814A29E + ldrh r1, [r3, 0x6] + adds r0, r7, r1 + strh r0, [r3, 0x6] + mov r1, r8 + b _0814A29A +_0814A278: + ldrh r0, [r3, 0xE] + ldrh r2, [r3, 0x6] + adds r1, r0, r2 + strh r1, [r3, 0x6] + ldrh r2, [r3, 0x14] + add r2, r8 + strh r2, [r3, 0x14] + lsls r1, r2, 16 + asrs r1, 16 + ldrh r4, [r3, 0xC] + adds r7, r0, 0 + cmp r1, r5 + ble _0814A29E + ldrh r1, [r3, 0x4] + adds r0, r4, r1 + strh r0, [r3, 0x4] + mov r1, r12 +_0814A29A: + subs r0, r2, r1 + strh r0, [r3, 0x14] +_0814A29E: + movs r5, 0 + lsls r0, r4, 16 + asrs r2, r0, 16 + cmp r2, 0 + ble _0814A2B6 + movs r4, 0x4 + ldrsh r1, [r3, r4] + movs r4, 0x8 + ldrsh r0, [r3, r4] + ldrh r4, [r3, 0x8] + cmp r1, r0 + bge _0814A2C8 +_0814A2B6: + cmp r2, 0 + bge _0814A2D6 + movs r0, 0x4 + ldrsh r1, [r3, r0] + movs r2, 0x8 + ldrsh r0, [r3, r2] + ldrh r4, [r3, 0x8] + cmp r1, r0 + bgt _0814A2D6 +_0814A2C8: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, r9 + cmp r0, 0 + beq _0814A2D6 + strh r4, [r3, 0x4] +_0814A2D6: + lsls r0, r7, 16 + asrs r2, r0, 16 + cmp r2, 0 + ble _0814A2EC + movs r4, 0x6 + ldrsh r1, [r3, r4] + movs r4, 0xA + ldrsh r0, [r3, r4] + ldrh r4, [r3, 0xA] + cmp r1, r0 + bge _0814A2FE +_0814A2EC: + cmp r2, 0 + bge _0814A30C + movs r0, 0x6 + ldrsh r1, [r3, r0] + movs r2, 0xA + ldrsh r0, [r3, r2] + ldrh r4, [r3, 0xA] + cmp r1, r0 + bgt _0814A30C +_0814A2FE: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, r10 + cmp r0, 0 + beq _0814A30C + strh r4, [r3, 0x6] +_0814A30C: + cmp r5, 0x2 + beq _0814A314 + movs r0, 0 + b _0814A316 +_0814A314: + movs r0, 0x1 +_0814A316: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_814A228 + + thumb_func_start sub_814A324 +sub_814A324: @ 814A324 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + bl sub_814669C + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, [sp, 0x4] + ldr r2, =0x01000400 + mov r0, sp + bl CpuSet + ldr r0, =gUnknown_085C7C00 + ldr r1, [sp, 0x8] + bl LZ77UnCompVram + ldr r0, =gUnknown_085C7BE0 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814A324 + + thumb_func_start sub_814A374 +sub_814A374: @ 814A374 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + add r1, sp, 0xC + add r0, sp, 0x8 + bl sub_8149F58 + ldr r0, =gUnknown_085C828C + ldr r1, [sp, 0x8] + bl LZ77UnCompVram + ldr r0, =0x02038c28 + movs r1, 0x10 + ldrsh r2, [r4, r1] + movs r3, 0x12 + ldrsh r1, [r4, r3] + str r1, [sp] + movs r1, 0xA0 + str r1, [sp, 0x4] + movs r1, 0 + movs r3, 0x84 + bl sub_8149F98 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + add sp, 0x10 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814A374 + + thumb_func_start sub_814A3BC +sub_814A3BC: @ 814A3BC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C99D0 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814A3CE: + 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 _0814A3CE + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814A3BC + + thumb_func_start sub_814A3F4 +sub_814A3F4: @ 814A3F4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C99E8 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814A406: + 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 _0814A406 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814A3F4 + + thumb_func_start sub_814A42C +sub_814A42C: @ 814A42C + push {r4-r6,lr} + sub sp, 0xC + adds r4, r0, 0 + bl sub_8149F08 + bl dp12_8087EA4 + movs r1, 0xC0 + lsls r1, 7 + movs r0, 0 + bl ClearGpuRegBits + movs r5, 0 + movs r0, 0x80 + lsls r0, 6 + strh r0, [r4, 0xC] + ldr r0, =0x00007fff + strh r0, [r4, 0xA] + strh r5, [r4, 0x12] + movs r0, 0x10 + strh r0, [r4, 0x14] + movs r0, 0xA0 + lsls r0, 4 + strh r0, [r4, 0x16] + ldr r6, =0x0203aba0 + ldr r2, [r6] + ldr r3, =0x00003f41 + strh r3, [r2, 0xE] + ldrh r0, [r4, 0x14] + lsls r0, 8 + ldrh r1, [r4, 0x12] + orrs r0, r1 + strh r0, [r2, 0x10] + ldr r0, =0x04000050 + strh r3, [r0] + ldr r1, =0x04000052 + ldrh r0, [r2, 0x10] + strh r0, [r1] + add r0, sp, 0x4 + add r1, sp, 0x8 + bl sub_8149F58 + mov r0, sp + strh r5, [r0] + ldr r1, [sp, 0x4] + ldr r2, =0x01000400 + bl CpuSet + ldr r0, =gUnknown_085C7C00 + ldr r1, [sp, 0x8] + bl LZ77UnCompVram + ldr r0, =gUnknown_085C7BE0 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, [r6] + strh r5, [r0, 0x16] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814A42C + + thumb_func_start sub_814A4D4 +sub_814A4D4: @ 814A4D4 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + add r1, sp, 0x4 + mov r0, sp + bl sub_8149F58 + ldr r0, =gUnknown_085C828C + ldr r1, [sp] + bl LZ77UnCompVram + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814A4D4 + + thumb_func_start sub_814A500 +sub_814A500: @ 814A500 + push {r4-r6,lr} + adds r5, r0, 0 + movs r2, 0 + ldr r6, =sub_814A684 + ldr r4, =0x020393a8 + ldr r3, =0x0203aba0 +_0814A50C: + lsls r1, r2, 1 + adds r1, r4 + ldr r0, [r3] + ldrh r0, [r0, 0x16] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x9F + bls _0814A50C + adds r0, r6, 0 + bl SetVBlankCallback + ldr r0, =sub_814A6CC + bl SetHBlankCallback + movs r0, 0x2 + bl EnableInterrupts + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814A500 + + thumb_func_start sub_814A550 +sub_814A550: @ 814A550 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + ldr r1, =0x0203aba0 + ldr r0, [r1] + ldrb r2, [r0] + movs r3, 0 + strb r3, [r0] + ldrh r2, [r4, 0xC] + lsls r0, r2, 16 + asrs r0, 24 + lsls r0, 16 + lsrs r7, r0, 16 + ldrh r6, [r4, 0xA] + movs r0, 0xC0 + lsls r0, 1 + mov r8, r0 + ldrh r0, [r4, 0x16] + subs r0, r6, r0 + strh r0, [r4, 0xA] + movs r5, 0xE + ldrsh r0, [r4, r5] + adds r5, r1, 0 + cmp r0, 0x45 + ble _0814A5A2 + movs r1, 0xC + ldrsh r0, [r4, r1] + ldr r1, =0xfffffe80 + adds r0, r1 + cmp r0, 0 + blt _0814A5A0 + adds r0, r2, r1 + strh r0, [r4, 0xC] + b _0814A5A2 + .pool +_0814A5A0: + strh r3, [r4, 0xC] +_0814A5A2: + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0 + blt _0814A5E0 + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _0814A5E0 + ldrh r1, [r4, 0x12] + movs r2, 0x12 + ldrsh r0, [r4, r2] + cmp r0, 0xF + bgt _0814A5C6 + adds r0, r1, 0x1 + strh r0, [r4, 0x12] + b _0814A5D4 +_0814A5C6: + ldrh r1, [r4, 0x14] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _0814A5D4 + subs r0, r1, 0x1 + strh r0, [r4, 0x14] +_0814A5D4: + ldr r0, [r5] + ldrh r1, [r4, 0x14] + lsls r1, 8 + ldrh r2, [r4, 0x12] + orrs r1, r2 + strh r1, [r0, 0x10] +_0814A5E0: + movs r5, 0 + lsls r7, 16 +_0814A5E4: + lsrs r0, r6, 8 + asrs r1, r7, 16 + bl sine + ldr r1, =0x02038c28 + lsls r2, r5, 1 + adds r2, r1 + ldr r1, =0x0203aba0 + ldr r1, [r1] + ldrh r1, [r1, 0x16] + adds r0, r1 + strh r0, [r2] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + mov r1, r8 + adds r0, r6, r1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r5, 0x9F + bls _0814A5E4 + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x65 + bne _0814A632 + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe +_0814A632: + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0814A654 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0814A654 + ldr r0, =sub_814A3F4 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_0814A654: + ldrh r0, [r4, 0x16] + subs r0, 0x11 + strh r0, [r4, 0x16] + ldr r0, =0x0203aba0 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + ldrb r2, [r1] + strb r0, [r1] + movs r0, 0 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814A550 + + thumb_func_start sub_814A684 +sub_814A684: @ 814A684 + push {lr} + bl sub_8149F2C + ldr r2, =0x04000050 + ldr r0, =0x0203aba0 + ldr r1, [r0] + ldrh r0, [r1, 0xE] + strh r0, [r2] + adds r2, 0x2 + ldrh r0, [r1, 0x10] + strh r0, [r2] + ldrb r0, [r1] + cmp r0, 0 + beq _0814A6B4 + ldr r1, =0x040000d4 + ldr r0, =0x02038c28 + str r0, [r1] + movs r2, 0xF0 + lsls r2, 3 + adds r0, r2 + str r0, [r1, 0x4] + ldr r0, =0x800000a0 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_0814A6B4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_814A684 + + thumb_func_start sub_814A6CC +sub_814A6CC: @ 814A6CC + ldr r1, =0x02038c28 + ldr r0, =0x04000006 + ldrh r0, [r0] + lsls r0, 1 + movs r2, 0xF0 + lsls r2, 3 + adds r1, r2 + adds r0, r1 + ldrh r1, [r0] + ldr r0, =0x04000012 + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_814A6CC + + thumb_func_start sub_814A6F0 +sub_814A6F0: @ 814A6F0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C99F8 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814A702: + 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 _0814A702 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814A6F0 + + thumb_func_start sub_814A728 +sub_814A728: @ 814A728 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C9A08 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814A73A: + 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 _0814A73A + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814A728 + + thumb_func_start sub_814A760 +sub_814A760: @ 814A760 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085C9A1C + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0814A772: + 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 _0814A772 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814A760 + + thumb_func_start sub_814A798 +sub_814A798: @ 814A798 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x14 + mov r8, r0 + add r1, sp, 0x10 + add r0, sp, 0xC + bl sub_8149F58 + ldr r0, =gUnknown_085C8598 + ldr r1, [sp, 0x10] + bl LZ77UnCompVram + movs r4, 0x20 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r6, 0x1 + str r6, [sp] + str r4, [sp, 0x4] + movs r5, 0xF + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect + str r6, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1D + movs r3, 0 + bl FillBgTilemapBufferRect + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r0, =gUnknown_085C8578 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0 + mov r1, r8 + strh r6, [r1, 0xC] + strh r0, [r1, 0xE] + strh r0, [r1, 0x10] + movs r0, 0xA + strh r0, [r1, 0x16] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0 + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814A798 + + thumb_func_start sub_814A828 +sub_814A828: @ 814A828 + push {r4,r5,lr} + sub sp, 0x24 + adds r4, r0, 0 + ldr r1, =gUnknown_085C8928 + movs r2, 0x4 + str r2, [sp] + str r2, [sp, 0x4] + ldrb r0, [r4, 0xC] + str r0, [sp, 0x8] + ldrb r0, [r4, 0xE] + str r0, [sp, 0xC] + str r2, [sp, 0x10] + str r2, [sp, 0x14] + movs r0, 0xF + str r0, [sp, 0x18] + movs r5, 0 + str r5, [sp, 0x1C] + str r5, [sp, 0x20] + movs r0, 0 + movs r2, 0 + movs r3, 0 + bl CopyRectToBgTilemapBufferRect + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldrh r0, [r4, 0xC] + adds r0, 0x4 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + bne _0814A88A + movs r0, 0x1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0xE] + adds r0, 0x4 + strh r0, [r4, 0xE] + strh r5, [r4, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _0814A88A + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0814A88A: + movs r0, 0 + add sp, 0x24 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814A828 + + thumb_func_start sub_814A898 +sub_814A898: @ 814A898 + push {r4-r6,lr} + sub sp, 0x10 + adds r4, r0, 0 + add r1, sp, 0xC + add r0, sp, 0x8 + bl sub_8149F58 + ldrh r0, [r4, 0x14] + adds r1, r0, 0x1 + strh r1, [r4, 0x14] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x16 + ldrsh r1, [r4, r2] + cmp r0, r1 + blt _0814A956 + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0814A8FC + cmp r0, 0x1 + bgt _0814A8CA + cmp r0, 0 + beq _0814A8D4 + b _0814A92C +_0814A8CA: + cmp r0, 0x2 + beq _0814A914 + cmp r0, 0x3 + beq _0814A91C + b _0814A92C +_0814A8D4: + movs r2, 0xFA + ldr r6, =0x02037714 + movs r3, 0 + ldr r5, =0x02037b14 +_0814A8DC: + lsls r1, r2, 1 + adds r0, r1, r6 + strh r3, [r0] + adds r1, r5 + strh r3, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFE + bls _0814A8DC + b _0814A94C + .pool +_0814A8FC: + ldr r0, =0xffff7fff + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r0, =gUnknown_085C86F4 + b _0814A91E + .pool +_0814A914: + ldr r0, =gUnknown_085C87F4 + b _0814A91E + .pool +_0814A91C: + ldr r0, =gUnknown_085C88A4 +_0814A91E: + ldr r1, [sp, 0xC] + bl LZ77UnCompVram + b _0814A94C + .pool +_0814A92C: + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0814A956 +_0814A94C: + movs r0, 0 + strh r0, [r4, 0x14] + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] +_0814A956: + movs r0, 0 + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_814A898 + + thumb_func_start sub_814A960 +sub_814A960: @ 814A960 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x14 + mov r8, r0 + add r1, sp, 0x10 + add r0, sp, 0xC + bl sub_8149F58 + ldr r0, =gUnknown_085C8598 + ldr r1, [sp, 0x10] + bl LZ77UnCompVram + movs r4, 0x20 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r6, 0x1 + str r6, [sp] + str r4, [sp, 0x4] + movs r5, 0xF + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect + str r6, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1D + movs r3, 0 + bl FillBgTilemapBufferRect + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r4, =gUnknown_085C8578 + adds r0, r4, 0 + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0xE0 + movs r1, 0x10 + movs r2, 0x8 + movs r3, 0 + bl pal_fade_1 + movs r1, 0 + movs r0, 0x22 + mov r2, r8 + strh r0, [r2, 0xC] + strh r1, [r2, 0xE] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + movs r0, 0 + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814A960 + + thumb_func_start sub_814AA04 +sub_814AA04: @ 814AA04 + push {r4-r6,lr} + sub sp, 0x24 + adds r6, r0, 0 + ldr r1, =gUnknown_085C9A30 + movs r2, 0xC + ldrsh r0, [r6, r2] + adds r0, r1 + ldrb r5, [r0] + adds r0, r5, 0 + movs r1, 0x7 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x7 + bl __udivsi3 + ldr r1, =gUnknown_085C8928 + movs r2, 0x4 + str r2, [sp] + str r2, [sp, 0x4] + lsls r4, 2 + adds r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x8] + lsls r0, 26 + lsrs r0, 24 + str r0, [sp, 0xC] + str r2, [sp, 0x10] + str r2, [sp, 0x14] + movs r0, 0xF + str r0, [sp, 0x18] + movs r0, 0 + str r0, [sp, 0x1C] + str r0, [sp, 0x20] + movs r2, 0 + movs r3, 0 + bl CopyRectToBgTilemapBufferRect + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldrh r0, [r6, 0xC] + subs r0, 0x1 + strh r0, [r6, 0xC] + lsls r0, 16 + cmp r0, 0 + bge _0814AA70 + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] +_0814AA70: + movs r0, 0 + add sp, 0x24 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814AA04 + + thumb_func_start sub_814AA84 +sub_814AA84: @ 814AA84 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0xE0 + movs r1, 0x10 + movs r2, 0x3 + movs r3, 0 + bl pal_fade_1 + ldr r0, =0xffff3fff + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + movs r0, 0 + strh r0, [r4, 0xC] + strh r0, [r4, 0xE] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814AA84 + + thumb_func_start sub_814AAB8 +sub_814AAB8: @ 814AAB8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x24 + adds r7, r0, 0 + ldrh r0, [r7, 0xE] + movs r1, 0x1 + eors r0, r1 + movs r6, 0 + strh r0, [r7, 0xE] + cmp r0, 0 + beq _0814AB2C + ldr r0, =gUnknown_085C8928 + mov r8, r0 + movs r4, 0x4 + str r4, [sp] + str r4, [sp, 0x4] + ldr r5, =gUnknown_085C9A30 + movs r1, 0xC + ldrsh r0, [r7, r1] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0x7 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 22 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + movs r2, 0xC + ldrsh r0, [r7, r2] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 26 + lsrs r0, 24 + str r0, [sp, 0xC] + str r4, [sp, 0x10] + str r4, [sp, 0x14] + movs r0, 0xE + str r0, [sp, 0x18] + str r6, [sp, 0x1C] + str r6, [sp, 0x20] + movs r0, 0 + mov r1, r8 + movs r2, 0 + movs r3, 0 + bl CopyRectToBgTilemapBufferRect + b _0814AB78 + .pool +_0814AB2C: + movs r1, 0xC + ldrsh r0, [r7, r1] + cmp r0, 0 + ble _0814AB72 + ldr r1, =gUnknown_085C9A30 + subs r0, 0x1 + adds r0, r1 + ldrb r5, [r0] + adds r0, r5, 0 + movs r1, 0x7 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 22 + adds r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x7 + bl __udivsi3 + adds r3, r0, 0 + lsls r3, 26 + lsrs r3, 24 + movs r0, 0x4 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl FillBgTilemapBufferRect +_0814AB72: + ldrh r0, [r7, 0xC] + adds r0, 0x1 + strh r0, [r7, 0xC] +_0814AB78: + movs r1, 0xC + ldrsh r0, [r7, r1] + cmp r0, 0x22 + ble _0814AB86 + ldrh r0, [r7, 0x8] + adds r0, 0x1 + strh r0, [r7, 0x8] +_0814AB86: + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0 + add sp, 0x24 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814AAB8 + + thumb_func_start sub_814ABA0 +sub_814ABA0: @ 814ABA0 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r0, [r4] + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0 + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_814ABA0 + + thumb_func_start sub_814ABE4 +sub_814ABE4: @ 814ABE4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r6, r1, r2 + ldrh r0, [r6, 0xC] + movs r1, 0x1 + eors r0, r1 + strh r0, [r6, 0xC] + cmp r0, 0 + bne _0814AC24 + ldr r5, =0x02022e14 + ldrh r1, [r5] + movs r0, 0x12 + bl SetGpuReg + ldr r4, =0x02022e16 + ldrh r1, [r4] + movs r0, 0x10 + bl SetGpuReg + ldrh r0, [r6, 0x8] + ldrh r1, [r5] + adds r0, r1 + strh r0, [r5] + ldrh r0, [r6, 0xA] + ldrh r1, [r4] + adds r0, r1 + strh r0, [r4] +_0814AC24: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814ABE4 + + thumb_func_start sub_814AC38 +sub_814AC38: @ 814AC38 + push {r4-r6,lr} + sub sp, 0x10 + adds r6, r0, 0 + movs r5, 0 + add r1, sp, 0xC + add r0, sp, 0x8 + bl sub_8149F58 + ldr r0, =gUnknown_085C8598 + ldr r1, [sp, 0xC] + bl LZ77UnCompVram + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r0, =gUnknown_085C8578 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =0x02022e14 + strh r5, [r0] + ldr r4, =0x02022e16 + strh r5, [r4] + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + ldrh r1, [r4] + movs r0, 0x10 + bl SetGpuReg + strh r5, [r6, 0xC] + ldr r0, =sub_814ABE4 + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r5, r0, 24 + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + lsrs r1, 16 + cmp r1, 0x1 + beq _0814ACE4 + cmp r1, 0x1 + bgt _0814ACC8 + cmp r1, 0 + beq _0814ACCE + b _0814AD1C + .pool +_0814ACC8: + cmp r1, 0x2 + beq _0814AD00 + b _0814AD1C +_0814ACCE: + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x8] + strh r0, [r1, 0xA] + b _0814AD2E + .pool +_0814ACE4: + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =0x0000ffff + strh r1, [r0, 0x8] + movs r1, 0x1 + negs r1, r1 + b _0814AD2C + .pool +_0814AD00: + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x8] + ldr r1, =0x0000ffff + b _0814AD2C + .pool +_0814AD1C: + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =0x0000ffff + strh r1, [r0, 0x8] + movs r1, 0x1 +_0814AD2C: + strh r1, [r0, 0xA] +_0814AD2E: + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + movs r0, 0 + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814AC38 + + thumb_func_start sub_814AD48 +sub_814AD48: @ 814AD48 + push {r4,lr} + sub sp, 0x24 + adds r4, r0, 0 + ldr r1, =gUnknown_085C9A53 + movs r2, 0xC + ldrsh r0, [r4, r2] + adds r0, r1 + ldrb r3, [r0] + lsrs r2, r3, 3 + movs r0, 0x7 + ands r3, r0 + ldr r1, =gUnknown_085C8928 + movs r0, 0x4 + str r0, [sp] + str r0, [sp, 0x4] + lsls r2, 2 + adds r2, 0x1 + str r2, [sp, 0x8] + lsls r3, 2 + str r3, [sp, 0xC] + str r0, [sp, 0x10] + str r0, [sp, 0x14] + movs r0, 0xF + str r0, [sp, 0x18] + movs r0, 0 + str r0, [sp, 0x1C] + str r0, [sp, 0x20] + movs r2, 0 + movs r3, 0 + bl CopyRectToBgTilemapBufferRect + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3F + ble _0814ADA0 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0814ADA0: + movs r0, 0 + add sp, 0x24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814AD48 + + thumb_func_start sub_814ADB4 +sub_814ADB4: @ 814ADB4 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0xffff7fff + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + movs r0, 0 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814ADB4 + + thumb_func_start sub_814ADD8 +sub_814ADD8: @ 814ADD8 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + ldr r1, =gUnknown_085C9A53 + movs r2, 0xC + ldrsh r0, [r4, r2] + adds r0, r1 + ldrb r3, [r0] + lsrs r2, r3, 3 + movs r0, 0x7 + ands r3, r0 + lsls r2, 2 + adds r2, 0x1 + lsls r3, 2 + movs r0, 0x4 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + bl FillBgTilemapBufferRect + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3F + ble _0814AE2E + ldr r0, =sub_814ABE4 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0814AE2E: + movs r0, 0 + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814ADD8 + + thumb_func_start sub_814AE40 +sub_814AE40: @ 814AE40 + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r0, 0 + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r4, =0x02022e16 + strh r1, [r4] + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + ldrh r1, [r4] + movs r0, 0x10 + bl SetGpuReg + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r0, [r5] + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814AE40 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/berry.s b/asm/berry.s new file mode 100644 index 000000000..6b045f362 --- /dev/null +++ b/asm/berry.s @@ -0,0 +1,1120 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80E15B8 +sub_80E15B8: @ 80E15B8 + push {lr} + sub sp, 0x4 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x000031f8 + adds r1, r0 + ldr r2, =0x0100001a + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E15B8 + + thumb_func_start sub_80E15E4 +sub_80E15E4: @ 80E15E4 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000031f8 + adds r3, r0, r1 + movs r2, 0 +_080E15F2: + adds r0, r3, r2 + adds r1, r4, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x33 + bls _080E15F2 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E15E4 + + thumb_func_start sub_80E1610 +sub_80E1610: @ 80E1610 + push {lr} + adds r3, r0, 0 + movs r2, 0 + movs r1, 0 +_080E1618: + adds r0, r3, r1 + ldrb r0, [r0] + adds r2, r0 + adds r1, 0x1 + cmp r1, 0x2F + bls _080E1618 + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_80E1610 + + thumb_func_start sub_80E162C +sub_80E162C: @ 80E162C + push {r4,lr} + ldr r4, =0x03005d8c + ldr r1, [r4] + ldr r2, =0x0000320c + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080E1674 + ldr r2, =0x00003202 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080E1674 + ldr r2, =0x000031f8 + adds r0, r1, r2 + bl sub_80E1610 + ldr r1, [r4] + ldr r2, =0x00003228 + adds r1, r2 + ldr r1, [r1] + cmp r0, r1 + bne _080E1674 + movs r0, 0x1 + b _080E1676 + .pool +_080E1674: + movs r0, 0 +_080E1676: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80E162C + + thumb_func_start GetBerryInfo +@ struct berry_info *GetBerryInfo(u8 berryType) +GetBerryInfo: @ 80E167C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2B + bne _080E16A0 + bl sub_80E162C + cmp r0, 0 + beq _080E16A0 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000031f8 + b _080E16B4 + .pool +_080E16A0: + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2A + bls _080E16AC + movs r4, 0x1 +_080E16AC: + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + ldr r1, =gBerries - 0x1c @ 1-based array +_080E16B4: + adds r0, r1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetBerryInfo + + thumb_func_start GetBerryTreeInfo +@ struct BerryTreeInfo *GetBerryTreeInfo(u8 berryTreeId) +GetBerryTreeInfo: @ 80E16C0 + lsls r0, 24 + ldr r1, =0x03005d8c + lsrs r0, 21 + ldr r2, =0x0000169c + adds r0, r2 + ldr r1, [r1] + adds r1, r0 + adds r0, r1, 0 + bx lr + .pool + thumb_func_end GetBerryTreeInfo + + thumb_func_start FieldObjectInteractionWaterBerryTree +@ bool8 FieldObjectInteractionWaterBerryTree() +FieldObjectInteractionWaterBerryTree: @ 80E16DC + push {lr} + ldr r0, =0x03005df0 + ldrb r0, [r0] + bl FieldObjectGetBerryTreeId + lsls r0, 24 + lsrs r0, 24 + bl GetBerryTreeInfo + adds r2, r0, 0 + ldrb r0, [r2, 0x1] + lsls r0, 25 + lsrs r0, 25 + cmp r0, 0x2 + beq _080E1718 + cmp r0, 0x2 + bgt _080E1708 + cmp r0, 0x1 + beq _080E1712 + b _080E172E + .pool +_080E1708: + cmp r0, 0x3 + beq _080E171E + cmp r0, 0x4 + beq _080E1724 + b _080E172E +_080E1712: + ldrb r0, [r2, 0x5] + movs r1, 0x10 + b _080E1728 +_080E1718: + ldrb r0, [r2, 0x5] + movs r1, 0x20 + b _080E1728 +_080E171E: + ldrb r0, [r2, 0x5] + movs r1, 0x40 + b _080E1728 +_080E1724: + ldrb r0, [r2, 0x5] + movs r1, 0x80 +_080E1728: + orrs r0, r1 + strb r0, [r2, 0x5] + b _080E1732 +_080E172E: + movs r0, 0 + b _080E1734 +_080E1732: + movs r0, 0x1 +_080E1734: + pop {r1} + bx r1 + thumb_func_end FieldObjectInteractionWaterBerryTree + + thumb_func_start IsPlayerFacingPlantedBerryTree +@ bool8 IsPlayerFacingPlantedBerryTree() +IsPlayerFacingPlantedBerryTree: @ 80E1738 + push {lr} + bl GetFieldObjectScriptPointerForComparison + ldr r1, =gUnknown_082742F9 + cmp r0, r1 + bne _080E1768 + ldr r0, =0x03005df0 + ldrb r0, [r0] + bl FieldObjectGetBerryTreeId + lsls r0, 24 + lsrs r0, 24 + bl GetStageByBerryTreeId + lsls r0, 24 + cmp r0, 0 + bne _080E1768 + movs r0, 0x1 + b _080E176A + .pool +_080E1768: + movs r0, 0 +_080E176A: + pop {r1} + bx r1 + thumb_func_end IsPlayerFacingPlantedBerryTree + + thumb_func_start WaterBerryTree +@ bool8 WaterBerryTree() +WaterBerryTree: @ 80E1770 + push {lr} + bl GetFieldObjectScriptPointerForComparison + ldr r1, =gUnknown_082742F9 + cmp r0, r1 + bne _080E178C + bl FieldObjectInteractionWaterBerryTree + lsls r0, 24 + lsrs r0, 24 + b _080E178E + .pool +_080E178C: + movs r0, 0 +_080E178E: + pop {r1} + bx r1 + thumb_func_end WaterBerryTree + + thumb_func_start RemoveAllBerryTrees +@ void RemoveAllBerryTrees() +RemoveAllBerryTrees: @ 80E1794 + push {r4-r6,lr} + movs r2, 0 + ldr r6, =0x03005d8c + ldr r5, =0x0000169c + ldr r0, =gUnknown_0858ABD0 + ldr r3, [r0] + ldr r4, [r0, 0x4] +_080E17A2: + ldr r0, [r6] + lsls r1, r2, 3 + adds r0, r1 + adds r0, r5 + str r3, [r0] + str r4, [r0, 0x4] + adds r2, 0x1 + cmp r2, 0x7F + ble _080E17A2 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end RemoveAllBerryTrees + + thumb_func_start BerryTreeGrow +@ bool8 BerryTreeGrow(struct BerryTreeInfo *berryTree) +BerryTreeGrow: @ 80E17C8 + push {r4,lr} + adds r4, r0, 0 + ldrb r1, [r4, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080E17DA +_080E17D6: + movs r0, 0 + b _080E1866 +_080E17DA: + lsls r0, r1, 25 + lsrs r0, 25 + cmp r0, 0x5 + bhi _080E1864 + lsls r0, 2 + ldr r1, =_080E17F0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080E17F0: + .4byte _080E17D6 + .4byte _080E1810 + .4byte _080E1810 + .4byte _080E1810 + .4byte _080E1808 + .4byte _080E1828 +_080E1808: + adds r0, r4, 0 + bl CalcBerryYield + strb r0, [r4, 0x4] +_080E1810: + ldrb r2, [r4, 0x1] + lsls r1, r2, 25 + lsrs r1, 25 + adds r1, 0x1 + movs r0, 0x7F + ands r1, r0 + movs r0, 0x80 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x1] + b _080E1864 +_080E1828: + ldrb r0, [r4, 0x5] + movs r1, 0x11 + negs r1, r1 + ands r1, r0 + movs r0, 0x21 + negs r0, r0 + ands r1, r0 + subs r0, 0x20 + ands r1, r0 + movs r0, 0x7F + ands r1, r0 + movs r0, 0 + strb r0, [r4, 0x4] + ldrb r2, [r4, 0x1] + subs r0, 0x80 + ands r0, r2 + movs r2, 0x2 + orrs r0, r2 + strb r0, [r4, 0x1] + adds r1, 0x1 + movs r0, 0xF + ands r1, r0 + strb r1, [r4, 0x5] + cmp r1, 0xA + bne _080E1864 + ldr r0, =gUnknown_0858ABD0 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r4] + str r1, [r4, 0x4] +_080E1864: + movs r0, 0x1 +_080E1866: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end BerryTreeGrow + + thumb_func_start BerryTreeTimeUpdate +@ void BerryTreeTimeUpdate(s32 deltaSeconds) +BerryTreeTimeUpdate: @ 80E1870 + push {r4-r7,lr} + adds r6, r0, 0 + movs r2, 0 +_080E1876: + ldr r1, =0x03005d8c + lsls r0, r2, 3 + ldr r3, =0x0000169c + adds r0, r3 + ldr r1, [r1] + adds r4, r1, r0 + ldrb r0, [r4] + adds r7, r2, 0x1 + cmp r0, 0 + beq _080E1910 + ldrb r1, [r4, 0x1] + movs r0, 0x7F + ands r0, r1 + cmp r0, 0 + beq _080E1910 + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080E1910 + ldrb r0, [r4] + bl GetStageDurationByBerryType + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + subs r1, r0 + cmp r6, r1 + blt _080E18CC + ldr r0, =gUnknown_0858ABD0 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r4] + str r1, [r4, 0x4] + b _080E1910 + .pool +_080E18CC: + adds r5, r6, 0 + cmp r5, 0 + beq _080E1910 + ldrh r1, [r4, 0x2] + cmp r1, r5 + ble _080E18DC + subs r0, r1, r5 + b _080E190E +_080E18DC: + subs r5, r1 + ldrb r0, [r4] + bl GetStageDurationByBerryType + strh r0, [r4, 0x2] + adds r0, r4, 0 + bl BerryTreeGrow + cmp r0, 0 + beq _080E1910 + ldrb r1, [r4, 0x1] + movs r0, 0x7F + ands r0, r1 + cmp r0, 0x5 + bne _080E1900 + ldrh r0, [r4, 0x2] + lsls r0, 2 + strh r0, [r4, 0x2] +_080E1900: + cmp r5, 0 + beq _080E1910 + ldrh r0, [r4, 0x2] + adds r1, r0, 0 + cmp r0, r5 + ble _080E18DC + subs r0, r5 +_080E190E: + strh r0, [r4, 0x2] +_080E1910: + adds r2, r7, 0 + cmp r2, 0x7F + ble _080E1876 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end BerryTreeTimeUpdate + + thumb_func_start PlantBerryTree +@ void PlantBerryTree(u8 berryTreeId, u8 berryType, u8 stage, u8 a4) +PlantBerryTree: @ 80E191C + push {r4-r7,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r3, 24 + lsrs r7, r3, 24 + bl GetBerryTreeInfo + adds r6, r0, 0 + ldr r0, =gUnknown_0858ABD0 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r6] + str r1, [r6, 0x4] + strb r4, [r6] + adds r0, r4, 0 + bl GetStageDurationByBerryType + strh r0, [r6, 0x2] + movs r1, 0x7F + ands r1, r5 + ldrb r2, [r6, 0x1] + movs r0, 0x80 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r6, 0x1] + cmp r5, 0x5 + bne _080E196E + adds r0, r6, 0 + bl CalcBerryYield + strb r0, [r6, 0x4] + ldrh r0, [r6, 0x2] + lsls r0, 2 + strh r0, [r6, 0x2] +_080E196E: + cmp r7, 0 + bne _080E197A + ldrb r0, [r6, 0x1] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r6, 0x1] +_080E197A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end PlantBerryTree + + thumb_func_start RemoveBerryTree +@ void RemoveBerryTree(u8 berryTreeId) +RemoveBerryTree: @ 80E1984 + lsls r0, 24 + ldr r1, =0x03005d8c + ldr r2, [r1] + lsrs r0, 21 + adds r2, r0 + ldr r0, =0x0000169c + adds r2, r0 + ldr r0, =gUnknown_0858ABD0 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .pool + thumb_func_end RemoveBerryTree + + thumb_func_start GetBerryTypeByBerryTreeId +@ u8 GetBerryTypeByBerryTreeId(u8 berryTreeId) +GetBerryTypeByBerryTreeId: @ 80E19AC + lsls r0, 24 + ldr r1, =0x03005d8c + ldr r1, [r1] + lsrs r0, 21 + adds r1, r0 + ldr r0, =0x0000169c + adds r1, r0 + ldrb r0, [r1] + bx lr + .pool + thumb_func_end GetBerryTypeByBerryTreeId + + thumb_func_start GetStageByBerryTreeId +@ u8 GetStageByBerryTreeId(u8 berryTreeId) +GetStageByBerryTreeId: @ 80E19C8 + lsls r0, 24 + ldr r1, =0x03005d8c + ldr r1, [r1] + lsrs r0, 21 + adds r1, r0 + ldr r0, =0x0000169d + adds r1, r0 + ldrb r0, [r1] + lsls r0, 25 + lsrs r0, 25 + bx lr + .pool + thumb_func_end GetStageByBerryTreeId + + thumb_func_start ItemIdToBerryType +@ u8 ItemIdToBerryType(u16 itemId) +ItemIdToBerryType: @ 80E19E8 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r2, =0xff7b0000 + adds r0, r2 + lsrs r0, 16 + cmp r0, 0x2A + bhi _080E1A08 + adds r0, r1, 0 + adds r0, 0x7C + lsls r0, 24 + lsrs r0, 24 + b _080E1A0A + .pool +_080E1A08: + movs r0, 0x1 +_080E1A0A: + pop {r1} + bx r1 + thumb_func_end ItemIdToBerryType + + thumb_func_start BerryTypeToItemId +@ u16 BerryTypeToItemId(u16 berryType) +BerryTypeToItemId: @ 80E1A10 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r2, =0xffff0000 + adds r0, r2 + lsrs r0, 16 + cmp r0, 0x2A + bhi _080E1A30 + adds r0, r1, 0 + adds r0, 0x84 + lsls r0, 16 + lsrs r0, 16 + b _080E1A32 + .pool +_080E1A30: + movs r0, 0x85 +_080E1A32: + pop {r1} + bx r1 + thumb_func_end BerryTypeToItemId + + thumb_func_start GetBerryNameByBerryType +@ void GetBerryNameByBerryType(u8 berryType, u8 *dest) +GetBerryNameByBerryType: @ 80E1A38 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + bl GetBerryInfo + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0x6 + bl memcpy + movs r0, 0xFF + strb r0, [r4, 0x6] + pop {r4} + pop {r0} + bx r0 + thumb_func_end GetBerryNameByBerryType + + thumb_func_start GetBerryCountStringByBerryType +@ void GetBerryCountStringByBerryType(u8 berryType, u8 *dest, u32 berryCount) +GetBerryCountStringByBerryType: @ 80E1A58 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsrs r0, 24 + bl GetBerryInfo + adds r1, r0, 0 + adds r0, r4, 0 + adds r2, r5, 0 + bl GetBerryCountString + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end GetBerryCountStringByBerryType + + thumb_func_start ResetBerryTreeSparkleFlag +@ void ResetBerryTreeSparkleFlag(u8 berryTreeId) +ResetBerryTreeSparkleFlag: @ 80E1A78 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl GetBerryTreeInfo + ldrb r2, [r0, 0x1] + movs r1, 0x7F + ands r1, r2 + strb r1, [r0, 0x1] + pop {r0} + bx r0 + thumb_func_end ResetBerryTreeSparkleFlag + + thumb_func_start BerryTreeGetNumStagesWatered +@ u8 BerryTreeGetNumStagesWatered(struct BerryTreeInfo *berryTree) +BerryTreeGetNumStagesWatered: @ 80E1A90 + push {lr} + ldrb r2, [r0, 0x5] + movs r0, 0x10 + ands r0, r2 + lsls r0, 24 + lsrs r0, 24 + negs r0, r0 + lsrs r1, r0, 31 + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + beq _080E1AAA + adds r1, 0x1 +_080E1AAA: + movs r0, 0x40 + ands r0, r2 + cmp r0, 0 + beq _080E1AB8 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 +_080E1AB8: + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _080E1AC6 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 +_080E1AC6: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end BerryTreeGetNumStagesWatered + + thumb_func_start GetNumStagesWateredByBerryTreeId +@ u8 GetNumStagesWateredByBerryTreeId(u8 berryTreeId) +GetNumStagesWateredByBerryTreeId: @ 80E1ACC + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl GetBerryTreeInfo + bl BerryTreeGetNumStagesWatered + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end GetNumStagesWateredByBerryTreeId + + thumb_func_start CalcBerryYieldInternal +@ u8 CalcBerryYieldInternal(u16 max, u16 min, u8 numStagesWatered) +CalcBerryYieldInternal: @ 80E1AE4 + push {r4-r6,lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 24 + lsrs r2, 24 + cmp r2, 0 + bne _080E1AFA + lsls r0, r6, 24 + b _080E1B2E +_080E1AFA: + subs r1, r0, r6 + subs r0, r2, 0x1 + adds r5, r1, 0 + muls r5, r0 + adds r4, r1, 0 + muls r4, r2 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + subs r4, r5 + adds r4, 0x1 + adds r1, r4, 0 + bl __umodsi3 + adds r5, r0 + movs r0, 0x3 + ands r0, r5 + cmp r0, 0x1 + bls _080E1B28 + lsrs r0, r5, 2 + adds r0, 0x1 + b _080E1B2A +_080E1B28: + lsrs r0, r5, 2 +_080E1B2A: + adds r0, r6 + lsls r0, 24 +_080E1B2E: + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end CalcBerryYieldInternal + + thumb_func_start CalcBerryYield +@ u8 CalcBerryYield(struct BerryTreeInfo *berryTree) +CalcBerryYield: @ 80E1B38 + push {r4-r6,lr} + adds r4, r0, 0 + ldrb r0, [r4] + bl GetBerryInfo + ldrb r6, [r0, 0xB] + ldrb r5, [r0, 0xA] + adds r0, r4, 0 + bl BerryTreeGetNumStagesWatered + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r5, 0 + adds r1, r6, 0 + bl CalcBerryYieldInternal + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end CalcBerryYield + + thumb_func_start GetBerryCountByBerryTreeId +@ u8 GetBerryCountByBerryTreeId(u8 berryTreeId) +GetBerryCountByBerryTreeId: @ 80E1B64 + lsls r0, 24 + ldr r1, =0x03005d8c + ldr r1, [r1] + lsrs r0, 21 + adds r1, r0 + movs r0, 0xB5 + lsls r0, 5 + adds r1, r0 + ldrb r0, [r1] + bx lr + .pool + thumb_func_end GetBerryCountByBerryTreeId + + thumb_func_start GetStageDurationByBerryType +@ u16 GetStageDurationByBerryType(u8 berryType) +GetStageDurationByBerryType: @ 80E1B7C + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl GetBerryInfo + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 18 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end GetStageDurationByBerryType + + thumb_func_start FieldObjectInteractionGetBerryTreeData +@ void FieldObjectInteractionGetBerryTreeData() +FieldObjectInteractionGetBerryTreeData: @ 80E1B94 + push {r4-r6,lr} + ldr r0, =0x03005df0 + ldrb r0, [r0] + bl FieldObjectGetBerryTreeId + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl GetBerryTypeByBerryTreeId + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r5, 0 + bl ResetBerryTreeSparkleFlag + ldr r0, =0x020375f2 + ldrb r0, [r0] + ldr r1, =0x03005d8c + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl sub_8092E9C + lsls r0, 24 + cmp r0, 0 + beq _080E1BE0 + ldr r1, =0x020375e0 + movs r0, 0xFF + strh r0, [r1] + b _080E1BEE + .pool +_080E1BE0: + ldr r4, =0x020375e0 + adds r0, r5, 0 + bl GetStageByBerryTreeId + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] +_080E1BEE: + ldr r4, =0x020375e2 + adds r0, r5, 0 + bl GetNumStagesWateredByBerryTreeId + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + ldr r4, =0x020375e4 + adds r0, r5, 0 + bl GetBerryCountByBerryTreeId + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + ldr r1, =0x02021cc4 + ldrh r2, [r4] + adds r0, r6, 0 + bl GetBerryCountStringByBerryType + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectInteractionGetBerryTreeData + + thumb_func_start FieldObjectInteractionGetBerryName +@ void FieldObjectInteractionGetBerryName() +FieldObjectInteractionGetBerryName: @ 80E1C2C + push {lr} + ldr r0, =0x03005df0 + ldrb r0, [r0] + bl FieldObjectGetBerryTreeId + lsls r0, 24 + lsrs r0, 24 + bl GetBerryTypeByBerryTreeId + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02021cc4 + bl GetBerryNameByBerryType + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectInteractionGetBerryName + + thumb_func_start FieldObjectInteractionGetBerryCountString +@ void FieldObjectInteractionGetBerryCountString() +FieldObjectInteractionGetBerryCountString: @ 80E1C54 + push {r4,r5,lr} + ldr r0, =0x03005df0 + ldrb r0, [r0] + bl FieldObjectGetBerryTreeId + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl GetBerryTypeByBerryTreeId + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r4, 0 + bl GetBerryCountByBerryTreeId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r1, =0x02021cc4 + adds r0, r5, 0 + bl GetBerryCountStringByBerryType + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectInteractionGetBerryCountString + + thumb_func_start ChooseBerry +@ void ChooseBerry() +ChooseBerry: @ 80E1C94 + push {lr} + ldr r0, =CB2_ChooseBerry + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end ChooseBerry + + thumb_func_start FieldObjectInteractionPlantBerryTree +@ void FieldObjectInteractionPlantBerryTree() +FieldObjectInteractionPlantBerryTree: @ 80E1CA4 + push {r4,lr} + ldr r0, =0x0203ce7c + ldrh r0, [r0] + bl ItemIdToBerryType + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x03005df0 + ldrb r0, [r0] + bl FieldObjectGetBerryTreeId + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x1 + bl PlantBerryTree + bl FieldObjectInteractionGetBerryTreeData + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectInteractionPlantBerryTree + + thumb_func_start FieldObjectInteractionPickBerryTree +@ void FieldObjectInteractionPickBerryTree() +FieldObjectInteractionPickBerryTree: @ 80E1CDC + push {r4-r6,lr} + ldr r0, =0x03005df0 + ldrb r0, [r0] + bl FieldObjectGetBerryTreeId + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r5, 0 + bl GetBerryTypeByBerryTreeId + lsls r0, 24 + lsrs r0, 24 + ldr r6, =0x020375e0 + bl BerryTypeToItemId + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl GetBerryCountByBerryTreeId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl bag_add_item + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectInteractionPickBerryTree + + thumb_func_start FieldObjectInteractionRemoveBerryTree +@ void FieldObjectInteractionRemoveBerryTree() +FieldObjectInteractionRemoveBerryTree: @ 80E1D28 + push {lr} + ldr r0, =0x03005df0 + ldrb r0, [r0] + bl FieldObjectGetBerryTreeId + lsls r0, 24 + lsrs r0, 24 + bl RemoveBerryTree + ldr r0, =0x020375f2 + ldrb r0, [r0] + ldr r1, =0x03005d8c + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl sub_8092EF0 + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectInteractionRemoveBerryTree + + thumb_func_start PlayerHasBerries +@ bool8 PlayerHasBerries() +PlayerHasBerries: @ 80E1D5C + push {lr} + movs r0, 0x4 + bl IsBagPocketNonEmpty + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end PlayerHasBerries + + thumb_func_start ResetBerryTreeSparkleFlags +@ void ResetBerryTreeSparkleFlags() +ResetBerryTreeSparkleFlags: @ 80E1D6C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl GetCameraCoords + mov r0, sp + ldrh r2, [r0] + ldrh r1, [r4] + adds r1, 0x3 + adds r3, r2, 0 + adds r3, 0xE + lsls r1, 16 + movs r5, 0x80 + lsls r5, 12 + adds r0, r1, r5 + lsrs r0, 16 + mov r10, r0 + mov r5, sp + lsls r2, 16 + asrs r2, 16 + mov r9, r2 + ldr r4, =0x02037350 + lsls r3, 16 + asrs r3, 16 + mov r8, r3 + asrs r7, r1, 16 + movs r6, 0xF +_080E1DB0: + ldrb r0, [r4] + lsls r0, 31 + cmp r0, 0 + beq _080E1DEC + ldrb r0, [r4, 0x6] + cmp r0, 0xC + bne _080E1DEC + ldrh r0, [r4, 0x10] + strh r0, [r5] + ldrh r0, [r4, 0x12] + mov r1, sp + strh r0, [r1, 0x2] + movs r2, 0 + ldrsh r1, [r5, r2] + cmp r9, r1 + bgt _080E1DEC + cmp r1, r8 + bgt _080E1DEC + lsls r0, 16 + asrs r1, r0, 16 + cmp r7, r1 + bgt _080E1DEC + mov r2, r10 + lsls r0, r2, 16 + asrs r0, 16 + cmp r1, r0 + bgt _080E1DEC + ldrb r0, [r4, 0x1D] + bl ResetBerryTreeSparkleFlag +_080E1DEC: + adds r4, 0x24 + subs r6, 0x1 + cmp r6, 0 + bge _080E1DB0 + 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 ResetBerryTreeSparkleFlags + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/berry_blender.s b/asm/berry_blender.s new file mode 100644 index 000000000..549efa90c --- /dev/null +++ b/asm/berry_blender.s @@ -0,0 +1,8788 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_807F738 +sub_807F738: @ 807F738 + push {lr} + ldr r0, =0x03007630 + ldr r1, =0x0000ffff + ldr r2, =0x020322a4 + ldr r2, [r2] + adds r2, 0x4C + movs r3, 0 + ldrsh r2, [r2, r3] + subs r2, 0x80 + lsls r2, 17 + asrs r2, 16 + bl MPlayPitchControl + pop {r0} + bx r0 + .pool + thumb_func_end sub_807F738 + + thumb_func_start sub_807F764 +sub_807F764: @ 807F764 + push {r4,lr} + sub sp, 0x10 + bl sub_8082DF4 + ldr r0, =0x020322a4 + ldr r0, [r0] + mov r12, r0 + movs r0, 0xA0 + lsls r0, 1 + add r0, r12 + ldr r1, [r0] + movs r0, 0xA2 + lsls r0, 1 + add r0, r12 + ldr r2, [r0] + movs r0, 0xA4 + lsls r0, 1 + add r0, r12 + movs r4, 0 + ldrsh r3, [r0, r4] + movs r0, 0xA5 + lsls r0, 1 + add r0, r12 + movs r4, 0 + ldrsh r0, [r0, r4] + str r0, [sp] + movs r0, 0xA6 + lsls r0, 1 + add r0, r12 + movs r4, 0 + ldrsh r0, [r0, r4] + str r0, [sp, 0x4] + movs r0, 0xA7 + lsls r0, 1 + add r0, r12 + movs r4, 0 + ldrsh r0, [r0, r4] + str r0, [sp, 0x8] + movs r0, 0xA8 + lsls r0, 1 + add r0, r12 + ldrh r0, [r0] + str r0, [sp, 0xC] + movs r0, 0x2 + bl SetBgAffine + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807F764 + + thumb_func_start sub_807F7D8 +sub_807F7D8: @ 807F7D8 + push {r4,r5,lr} + ldr r1, =0x020322a4 + ldr r0, [r1] + ldrb r0, [r0, 0x1] + adds r5, r1, 0 + cmp r0, 0x9 + bls _0807F7E8 + b _0807F9C8 +_0807F7E8: + lsls r0, 2 + ldr r1, =_0807F7FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807F7FC: + .4byte _0807F824 + .4byte _0807F854 + .4byte _0807F880 + .4byte _0807F8AC + .4byte _0807F8C8 + .4byte _0807F8F4 + .4byte _0807F910 + .4byte _0807F940 + .4byte _0807F950 + .4byte _0807F980 +_0807F824: + ldr r5, =gUnknown_08D91598 + adds r0, r5, 0 + bl sub_8034974 + adds r0, 0x64 + bl AllocZeroed + adds r1, r0, 0 + ldr r4, =0x020322a4 + ldr r0, [r4] + ldr r2, =0x000011bc + adds r0, r2 + str r1, [r0] + adds r0, r5, 0 + bl LZDecompressWram + ldr r1, [r4] + b _0807F966 + .pool +_0807F854: + ldr r1, =gUnknown_083390F4 + movs r2, 0x80 + lsls r2, 3 + movs r0, 0x2 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + ldr r0, =gUnknown_083390D4 + movs r2, 0x80 + lsls r2, 1 + movs r1, 0 + bl gpu_pal_apply + b _0807F962 + .pool +_0807F880: + ldr r0, [r5] + ldr r1, =0x000011bc + adds r0, r1 + ldr r4, [r0] + ldr r0, =gUnknown_08D91598 + bl sub_8034974 + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x2 + adds r1, r4, 0 + movs r3, 0 + bl LoadBgTiles + ldr r1, [r5] + b _0807F966 + .pool +_0807F8AC: + ldr r0, =gUnknown_08D91DB8 + ldr r1, [r5] + ldr r2, =0x000011bc + adds r1, r2 + ldr r1, [r1] + bl LZDecompressWram + ldr r1, [r5] + b _0807F966 + .pool +_0807F8C8: + ldr r0, [r5] + ldr r1, =0x000011bc + adds r0, r1 + ldr r4, [r0] + ldr r0, =gUnknown_08D91DB8 + bl sub_8034974 + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x1 + adds r1, r4, 0 + movs r3, 0 + bl LoadBgTiles + ldr r1, [r5] + b _0807F966 + .pool +_0807F8F4: + ldr r0, =gUnknown_08D927EC + ldr r1, [r5] + ldr r2, =0x000011bc + adds r1, r2 + ldr r1, [r1] + bl LZDecompressWram + ldr r1, [r5] + b _0807F966 + .pool +_0807F910: + ldr r0, [r5] + ldr r1, =0x000011bc + adds r0, r1 + ldr r4, [r0] + ldr r0, =gUnknown_08D927EC + bl sub_8034974 + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x1 + adds r1, r4, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + ldr r1, [r5] + b _0807F966 + .pool +_0807F940: + ldr r0, =gUnknown_083394F4 + movs r1, 0x80 + movs r2, 0x20 + bl gpu_pal_apply + b _0807F962 + .pool +_0807F950: + ldr r0, =gUnknown_08339AC0 + bl LoadObjectPic + ldr r0, =gUnknown_08339BD8 + bl LoadObjectPic + ldr r0, =gUnknown_08339B38 + bl LoadObjectPic +_0807F962: + ldr r0, =0x020322a4 + ldr r1, [r0] +_0807F966: + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] + b _0807F9C8 + .pool +_0807F980: + ldr r0, =gUnknown_08339C24 + bl LoadObjectPic + ldr r0, =gUnknown_08339C58 + bl LoadObjectPic + ldr r0, =gUnknown_08339AD0 + bl LoadTaggedObjectPalette + ldr r0, =gUnknown_08339AC8 + bl LoadTaggedObjectPalette + ldr r4, =0x020322a4 + ldr r0, [r4] + ldr r2, =0x000011bc + adds r0, r2 + ldr r0, [r0] + bl Free + ldr r1, [r4] + movs r0, 0 + strb r0, [r1, 0x1] + movs r0, 0x1 + b _0807F9CA + .pool +_0807F9C8: + movs r0, 0 +_0807F9CA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_807F7D8 + + thumb_func_start sub_807F9D0 +sub_807F9D0: @ 807F9D0 + push {lr} + sub sp, 0x8 + movs r0, 0x1E + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuRegBits + 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 + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_807F9D0 + + thumb_func_start sub_807FA34 +sub_807FA34: @ 807FA34 + push {r4,lr} + sub sp, 0x8 + ldr r0, =gUnknown_08339980 + bl InitWindows + lsls r0, 16 + cmp r0, 0 + beq _0807FA74 + bl DeactivateAllTextPrinters + movs r4, 0 +_0807FA4A: + lsls r0, r4, 24 + lsrs r0, 24 + movs r1, 0 + bl FillWindowPixelBuffer + adds r4, 0x1 + cmp r4, 0x4 + ble _0807FA4A + movs r0, 0x1E + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0xE0 + bl sub_81978B0 +_0807FA74: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807FA34 + + thumb_func_start sub_807FA80 +sub_807FA80: @ 807FA80 + push {r4,lr} + ldr r4, =0x020322a4 + ldr r0, [r4] + cmp r0, 0 + bne _0807FA94 + movs r0, 0x8F + lsls r0, 5 + bl AllocZeroed + str r0, [r4] +_0807FA94: + ldr r0, [r4] + adds r0, 0x63 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x63 + strb r1, [r0] + ldr r0, =0x020375e0 + ldrb r0, [r0] + bl sub_807FE54 + ldr r0, =sub_807FAC8 + bl SetMainCallback2 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807FA80 + + thumb_func_start sub_807FAC8 +sub_807FAC8: @ 807FAC8 + push {r4-r6,lr} + sub sp, 0x4 + ldr r1, =0x020322a4 + ldr r0, [r1] + ldrb r0, [r0] + adds r6, r1, 0 + cmp r0, 0x6 + bls _0807FADA + b _0807FCE2 +_0807FADA: + lsls r0, 2 + ldr r1, =_0807FAEC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807FAEC: + .4byte _0807FB08 + .4byte _0807FBAC + .4byte _0807FC38 + .4byte _0807FC4E + .4byte _0807FC64 + .4byte _0807FC90 + .4byte _0807FCB0 +_0807FB08: + movs r0, 0 + movs r1, 0 + bl SetGpuReg + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_08339974 + movs r0, 0x1 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r4, =0x020322a4 + ldr r1, [r4] + movs r0, 0xDC + lsls r0, 1 + adds r1, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x000009b8 + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + movs r0, 0 + movs r1, 0x1 + movs r2, 0xD0 + bl sub_809882C + movs r0, 0 + movs r1, 0x14 + movs r2, 0xF0 + bl copy_textbox_border_tile_patterns_to_vram + bl sub_807FA34 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + ldr r3, [r4] + movs r1, 0x8C + lsls r1, 1 + adds r0, r3, r1 + movs r1, 0 + strh r2, [r0] + movs r4, 0x8B + lsls r4, 1 + adds r0, r3, r4 + strh r2, [r0] + movs r0, 0x8D + lsls r0, 1 + adds r4, r3, r0 + movs r0, 0x50 + strh r0, [r4] + movs r4, 0x8E + lsls r4, 1 + adds r0, r3, r4 + strh r2, [r0] + adds r4, 0x2 + adds r0, r3, r4 + strh r2, [r0] + strb r1, [r3, 0x1] + bl sub_8082D28 + b _0807FCE2 + .pool +_0807FBAC: + bl sub_807F7D8 + lsls r0, 24 + cmp r0, 0 + bne _0807FBB8 + b _0807FCE2 +_0807FBB8: + movs r4, 0 + ldr r5, =gUnknown_083399C8 + ldr r6, =0x020322a4 +_0807FBBE: + ldrb r1, [r5] + ldrb r2, [r5, 0x1] + ldr r0, =gUnknown_08339AD8 + movs r3, 0x1 + bl AddObjectToFront + ldr r1, [r6] + adds r1, 0x50 + adds r1, r4 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x50 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + adds r1, r4, 0 + adds r1, 0x8 + lsls r1, 24 + lsrs r1, 24 + bl StartObjectImageAnim + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _0807FBBE + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _0807FC14 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _0807FC14 + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 +_0807FC14: + ldr r0, =sub_807F764 + bl SetVBlankCallback + b _0807FCA0 + .pool +_0807FC38: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + bl sub_8082D28 + b _0807FCA0 +_0807FC4E: + bl sub_807F9D0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0807FCE2 + b _0807FCA0 + .pool +_0807FC64: + ldr r4, [r6] + ldr r0, =0x000011b8 + adds r4, r0 + ldr r5, =gUnknown_0833973A + bl sav2_get_text_speed + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_808417C + cmp r0, 0 + beq _0807FCE2 + ldr r1, [r6] + b _0807FCA4 + .pool +_0807FC90: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe +_0807FCA0: + ldr r0, =0x020322a4 + ldr r1, [r0] +_0807FCA4: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0807FCE2 + .pool +_0807FCB0: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0807FCE2 + bl FreeAllWindowBuffers + movs r0, 0x2 + bl UnsetBgTilemapBuffer + movs r0, 0x1 + bl UnsetBgTilemapBuffer + movs r0, 0 + bl SetVBlankCallback + ldr r0, =sub_807FFA4 + bl sub_81AABF0 + ldr r0, =0x020322a4 + ldr r0, [r0] + strb r4, [r0] +_0807FCE2: + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807FAC8 + + thumb_func_start sub_807FD08 +sub_807FD08: @ 807FD08 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x3A] + ldrh r1, [r4, 0x30] + adds r0, r1 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x32] + ldrh r2, [r4, 0x36] + subs r1, r2 + ldrh r0, [r4, 0x3C] + adds r1, r0 + strh r1, [r4, 0x32] + ldrh r3, [r4, 0x2E] + adds r0, r3 + strh r0, [r4, 0x2E] + subs r2, 0x1 + strh r2, [r4, 0x36] + lsls r0, 16 + lsls r1, 16 + cmp r0, r1 + bge _0807FD56 + ldrh r0, [r4, 0x34] + subs r0, 0x1 + strh r0, [r4, 0x36] + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _0807FD50 + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + b _0807FD56 +_0807FD50: + movs r0, 0x74 + bl audio_play +_0807FD56: + ldrh r0, [r4, 0x30] + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x32] + strh r0, [r4, 0x22] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_807FD08 + + thumb_func_start sub_807FD64 +sub_807FD64: @ 807FD64 + push {r4-r6,lr} + ldr r5, [sp, 0x10] + ldr r6, [sp, 0x14] + lsls r2, 16 + lsrs r2, 16 + movs r4, 0 + strh r2, [r0, 0x2E] + strh r1, [r0, 0x30] + strh r2, [r0, 0x32] + strh r3, [r0, 0x34] + movs r1, 0xA + strh r1, [r0, 0x36] + strh r4, [r0, 0x38] + strh r5, [r0, 0x3A] + strh r6, [r0, 0x3C] + ldr r1, =sub_807FD08 + str r1, [r0, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807FD64 + + thumb_func_start sub_807FD90 +sub_807FD90: @ 807FD90 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x8 + adds r6, r1, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r0, 24 + movs r1, 0xF6 + lsls r1, 23 + adds r0, r1 + lsrs r0, 24 + movs r3, 0x1 + ands r3, r6 + movs r1, 0 + movs r2, 0x50 + bl sub_80D511C + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + mov r8, r2 + add r8, r0 + mov r3, r8 + lsls r3, 2 + mov r8, r3 + ldr r0, =0x02020630 + add r8, r0 + ldr r5, =gUnknown_08339C78 + lsls r4, r6, 2 + adds r4, r6 + lsls r4, 1 + adds r0, r4, r5 + movs r6, 0 + ldrsh r1, [r0, r6] + adds r0, r5, 0x2 + adds r0, r4, r0 + movs r3, 0 + ldrsh r2, [r0, r3] + adds r0, r5, 0x4 + adds r0, r4, r0 + movs r6, 0 + ldrsh r3, [r0, r6] + adds r0, r5, 0x6 + adds r0, r4, r0 + movs r6, 0 + ldrsh r0, [r0, r6] + str r0, [sp] + adds r5, 0x8 + adds r4, r5 + movs r5, 0 + ldrsh r0, [r4, r5] + str r0, [sp, 0x4] + mov r0, r8 + bl sub_807FD64 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807FD90 + + thumb_func_start sub_807FE14 +sub_807FE14: @ 807FE14 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r5, r1, 16 + lsrs r5, 16 + adds r0, r5, 0 + adds r0, 0x7C + lsls r0, 24 + lsrs r0, 24 + bl GetBerryInfo + adds r4, r0, 0 + strh r5, [r6] + adds r0, r6, 0x2 + adds r1, r4, 0 + bl CopyString + ldrb r0, [r4, 0x15] + strb r0, [r6, 0x9] + ldrb r0, [r4, 0x16] + strb r0, [r6, 0xA] + ldrb r0, [r4, 0x17] + strb r0, [r6, 0xB] + ldrb r0, [r4, 0x18] + strb r0, [r6, 0xC] + ldrb r0, [r4, 0x19] + strb r0, [r6, 0xD] + ldrb r0, [r4, 0x1A] + strb r0, [r6, 0xE] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_807FE14 + + thumb_func_start sub_807FE54 +sub_807FE54: @ 807FE54 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + beq _0807FE7C + cmp r5, 0x1 + bgt _0807FE68 + cmp r5, 0 + beq _0807FE72 + b _0807FF88 +_0807FE68: + cmp r5, 0x2 + beq _0807FEE8 + cmp r5, 0x3 + beq _0807FF3C + b _0807FF88 +_0807FE72: + ldr r0, =0x03005d98 + strb r5, [r0] + b _0807FF88 + .pool +_0807FE7C: + ldr r0, =0x03005d98 + strb r5, [r0] + ldr r0, =0x020322a4 + ldr r0, [r0] + adds r0, 0x7C + movs r1, 0x2 + strb r1, [r0] + ldr r4, =0x020229f0 + ldr r0, =0x03005d90 + ldr r1, [r0] + adds r0, r4, 0 + bl CopyString + movs r0, 0xD0 + lsls r0, 2 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _0807FEC8 + adds r0, r4, 0 + adds r0, 0x1C + ldr r1, =gUnknown_083397D0 + ldr r1, [r1, 0xC] + bl CopyString + b _0807FED4 + .pool +_0807FEC8: + adds r0, r4, 0 + adds r0, 0x1C + ldr r1, =gUnknown_083397D0 + ldr r1, [r1] + bl CopyString +_0807FED4: + ldr r1, =0x020229e8 + movs r0, 0x2 + strh r0, [r1, 0x1A] + strh r0, [r1, 0x36] + b _0807FF88 + .pool +_0807FEE8: + ldr r0, =0x03005d98 + strb r5, [r0] + ldr r0, =0x020322a4 + ldr r0, [r0] + adds r0, 0x7C + movs r1, 0x3 + strb r1, [r0] + ldr r6, =0x020229f0 + ldr r0, =0x03005d90 + ldr r1, [r0] + adds r0, r6, 0 + bl CopyString + adds r0, r6, 0 + adds r0, 0x1C + ldr r4, =gUnknown_083397D0 + ldr r1, [r4, 0x10] + bl CopyString + adds r0, r6, 0 + adds r0, 0x38 + ldr r1, [r4, 0x8] + bl CopyString + adds r0, r6, 0 + subs r0, 0x8 + strh r5, [r0, 0x1A] + strh r5, [r0, 0x36] + adds r0, 0x52 + strh r5, [r0] + b _0807FF88 + .pool +_0807FF3C: + ldr r0, =0x03005d98 + strb r5, [r0] + ldr r0, =0x020322a4 + ldr r0, [r0] + adds r0, 0x7C + movs r1, 0x4 + strb r1, [r0] + ldr r5, =0x020229f0 + ldr r0, =0x03005d90 + ldr r1, [r0] + adds r0, r5, 0 + bl CopyString + adds r0, r5, 0 + adds r0, 0x1C + ldr r4, =gUnknown_083397D0 + ldr r1, [r4, 0x14] + bl CopyString + adds r0, r5, 0 + adds r0, 0x38 + ldr r1, [r4, 0x4] + bl CopyString + adds r0, r5, 0 + adds r0, 0x54 + ldr r1, [r4, 0x8] + bl CopyString + adds r0, r5, 0 + subs r0, 0x8 + movs r1, 0x2 + strh r1, [r0, 0x1A] + strh r1, [r0, 0x36] + adds r0, 0x52 + strh r1, [r0] + adds r0, 0x1C + strh r1, [r0] +_0807FF88: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807FE54 + + thumb_func_start sub_807FFA4 +sub_807FFA4: @ 807FFA4 + push {r4,r5,lr} + movs r0, 0 + movs r1, 0 + bl SetGpuReg + ldr r4, =0x020322a4 + ldr r0, [r4] + cmp r0, 0 + bne _0807FFC0 + movs r0, 0x8F + lsls r0, 5 + bl AllocZeroed + str r0, [r4] +_0807FFC0: + ldr r0, [r4] + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + movs r2, 0x86 + lsls r2, 1 + adds r0, r2 + str r1, [r0] + movs r2, 0 + ldr r5, =0x020375e0 + movs r3, 0 +_0807FFD6: + ldr r0, [r4] + lsls r1, r2, 1 + adds r0, 0x74 + adds r0, r1 + strh r3, [r0] + adds r2, 0x1 + cmp r2, 0x3 + ble _0807FFD6 + ldrb r0, [r5] + bl sub_807FE54 + ldrh r0, [r5] + cmp r0, 0 + bne _08080008 + ldr r0, =sub_8080018 + bl SetMainCallback2 + b _0808000E + .pool +_08080008: + ldr r0, =sub_80808D4 + bl SetMainCallback2 +_0808000E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807FFA4 + + thumb_func_start sub_8080018 +sub_8080018: @ 8080018 + push {r4-r7,lr} + sub sp, 0x4 + ldr r1, =0x020322a4 + ldr r0, [r1] + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x15 + bls _0808002A + b _08080546 +_0808002A: + lsls r0, 2 + ldr r1, =_0808003C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0808003C: + .4byte _08080094 + .4byte _08080100 + .4byte _08080120 + .4byte _0808019C + .4byte _080801AE + .4byte _080801C8 + .4byte _08080546 + .4byte _08080546 + .4byte _080801F8 + .4byte _08080248 + .4byte _0808026C + .4byte _08080302 + .4byte _0808035C + .4byte _080803D4 + .4byte _08080408 + .4byte _0808049C + .4byte _080804D0 + .4byte _08080546 + .4byte _080804F8 + .4byte _080804E4 + .4byte _080804EA + .4byte _08080508 +_08080094: + bl sub_8080588 + ldr r1, =0x020229c6 + ldr r2, =0x00004422 + adds r0, r2, 0 + strh r0, [r1] + ldr r2, =0x020322a4 + ldr r0, [r2] + adds r0, 0x72 + movs r1, 0 + strb r1, [r0] + movs r5, 0 + movs r6, 0 + movs r7, 0x92 + lsls r7, 1 +_080800B2: + ldr r0, [r2] + lsls r1, r5, 1 + adds r0, 0x64 + adds r0, r1 + strh r6, [r0] + adds r4, r5, 0x1 + adds r1, r5 + lsls r1, 1 + movs r3, 0x2 +_080800C4: + ldr r0, [r2] + adds r0, r7 + adds r0, r1 + strh r6, [r0] + adds r1, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _080800C4 + adds r5, r4, 0 + cmp r5, 0x3 + ble _080800B2 + ldr r3, =0x020322a4 + ldr r4, [r3] + adds r1, r4, 0 + adds r1, 0x70 + movs r2, 0 + movs r0, 0 + strh r0, [r1] + subs r1, 0x22 + strh r0, [r1] + strb r2, [r4, 0x1] + ldr r1, [r3] + b _080804FC + .pool +_08080100: + bl sub_807F7D8 + lsls r0, 24 + cmp r0, 0 + bne _0808010C + b _08080546 +_0808010C: + ldr r0, =0x020322a4 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bl sub_8082D28 + b _08080546 + .pool +_08080120: + movs r5, 0 + ldr r4, =gUnknown_083399C8 + ldr r6, =0x020322a4 +_08080126: + ldrb r1, [r4] + ldrb r2, [r4, 0x1] + ldr r0, =gUnknown_08339AD8 + movs r3, 0x1 + bl AddObjectToFront + ldr r1, [r6] + adds r1, 0x54 + adds r1, r5 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x54 + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + adds r1, r5, 0 + adds r1, 0x8 + lsls r1, 24 + lsrs r1, 24 + bl StartObjectImageAnim + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _08080126 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0808016A + b _080804F8 +_0808016A: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _08080174 + b _080804F8 +_08080174: + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _080804F8 + .pool +_0808019C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + b _080804F8 +_080801AE: + bl sub_807F9D0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080801C0 + b _08080546 +_080801C0: + b _080804F8 + .pool +_080801C8: + ldr r4, =0x020322a4 + ldr r0, [r4] + ldr r3, =0x000011b8 + adds r0, r3 + ldr r1, =gUnknown_0833981A + movs r2, 0 + bl sub_808417C + ldr r1, [r4] + movs r2, 0 + movs r0, 0x8 + strb r0, [r1] + ldr r0, [r4] + movs r1, 0x84 + lsls r1, 1 + adds r0, r1 + str r2, [r0] + b _08080546 + .pool +_080801F8: + ldr r4, =0x020322a4 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + movs r6, 0 + strb r0, [r1] + ldr r0, [r4] + movs r2, 0x8A + lsls r2, 1 + adds r0, r2 + strb r6, [r0] + ldr r0, [r4] + movs r5, 0xAC + lsls r5, 1 + adds r0, r5 + ldr r1, =0x0203ce7c + ldrh r1, [r1] + bl sub_807FE14 + ldr r0, =0x020228c4 + ldr r1, [r4] + adds r1, r5 + movs r2, 0x10 + bl memcpy + bl sub_800ADF8 + ldr r0, [r4] + movs r3, 0x84 + lsls r3, 1 + adds r0, r3 + str r6, [r0] + b _08080546 + .pool +_08080248: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08080254 + b _08080546 +_08080254: + bl sub_800A5B4 + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + beq _08080264 + b _080804F8 +_08080264: + movs r0, 0x4 + bl sub_800A4D8 + b _080804F8 +_0808026C: + ldr r6, =0x020322a4 + ldr r1, [r6] + movs r0, 0x84 + lsls r0, 1 + adds r1, r0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + cmp r0, 0x14 + bgt _08080282 + b _08080546 +_08080282: + movs r0, 0x4 + movs r1, 0x1 + bl sub_8197DF8 + bl sub_800A550 + adds r4, r0, 0 + bl sub_800A9D8 + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _0808029E + b _08080546 +_0808029E: + movs r5, 0 + adds r7, r6, 0 + movs r6, 0xAC + lsls r6, 1 + b _080802D4 + .pool +_080802AC: + ldr r0, [r7] + lsls r4, r5, 4 + adds r0, r4, r0 + adds r0, r6 + lsls r1, r5, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0x10 + bl memcpy + ldr r0, [r7] + lsls r2, r5, 1 + adds r1, r0, 0 + adds r1, 0x74 + adds r1, r2 + adds r0, r4 + adds r0, r6 + ldrh r0, [r0] + strh r0, [r1] + adds r5, 0x1 +_080802D4: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + blt _080802AC + bl sub_800A5B4 + b _080804F8 + .pool +_080802EC: + ldrb r1, [r4] + lsls r1, 1 + adds r0, r2, 0 + adds r0, 0x74 + adds r0, r1 + ldrh r0, [r0] + lsls r1, r5, 24 + lsrs r1, 24 + bl sub_807FD90 + b _08080336 +_08080302: + bl sub_8009FCC + ldr r2, =0x020322a4 + ldr r1, [r2] + adds r1, 0x7C + strb r0, [r1] + movs r5, 0 + ldr r2, [r2] + movs r1, 0x8A + lsls r1, 1 + adds r4, r2, r1 + ldr r1, =gUnknown_083399D0 + adds r0, r2, 0 + adds r0, 0x7C + ldrb r0, [r0] + subs r0, 0x2 + lsls r0, 2 + ldrb r3, [r4] + adds r0, r1 +_08080328: + ldrb r1, [r0] + cmp r3, r1 + beq _080802EC + adds r0, 0x1 + adds r5, 0x1 + cmp r5, 0x3 + ble _08080328 +_08080336: + ldr r3, =0x020322a4 + ldr r1, [r3] + movs r0, 0x84 + lsls r0, 1 + adds r2, r1, r0 + movs r0, 0 + str r0, [r2] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, [r3] + movs r2, 0x8A + lsls r2, 1 + adds r1, r2 + b _080804FC + .pool +_0808035C: + ldr r3, [r2] + movs r0, 0x84 + lsls r0, 1 + adds r1, r3, r0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + cmp r0, 0x3C + bgt _08080370 + b _08080546 +_08080370: + movs r1, 0x8A + lsls r1, 1 + adds r0, r3, r1 + adds r1, r3, 0 + adds r1, 0x7C + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcc _080803B8 + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + ldr r2, [r2] + ldr r3, =gUnknown_083399DC + ldr r1, =gUnknown_083399E4 + adds r0, r2, 0 + adds r0, 0x7C + ldrb r0, [r0] + subs r0, 0x2 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r3 + ldr r3, =0xffffa800 + adds r1, r3, 0 + ldrh r0, [r0] + adds r1, r0 + adds r2, 0x4A + strh r1, [r2] + b _080803BE + .pool +_080803B8: + ldrb r0, [r3] + subs r0, 0x1 + strb r0, [r3] +_080803BE: + ldr r0, =0x020322a4 + ldr r0, [r0] + movs r1, 0x84 + lsls r1, 1 + adds r0, r1 + movs r1, 0 + str r1, [r0] + b _08080546 + .pool +_080803D4: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _080803E0 + b _08080546 +_080803E0: + ldr r2, =0x020322a4 + ldr r1, [r2] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r2] + movs r2, 0xA0 + lsls r2, 1 + adds r0, r2 + bl sub_8082CB4 + movs r0, 0x2B + bl audio_play + movs r0, 0x2 + bl ShowBg + b _08080546 + .pool +_08080408: + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + bl SetGpuRegBits + ldr r4, =0x020322a4 + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0x4A + movs r3, 0x80 + lsls r3, 2 + adds r0, r3, 0 + ldrh r3, [r1] + adds r0, r3 + strh r0, [r1] + movs r0, 0x8D + lsls r0, 1 + adds r1, r2, r0 + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xFF + bls _0808048C + movs r0, 0xC + movs r1, 0x2 + bl SetGpuRegBits + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r3, [r4] + movs r2, 0x8D + lsls r2, 1 + adds r1, r3, r2 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r1] + ldr r2, =gUnknown_083399DC + ldr r1, =gUnknown_083399E4 + adds r0, r3, 0 + adds r0, 0x7C + ldrb r0, [r0] + subs r0, 0x2 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + adds r1, r3, 0 + adds r1, 0x4A + strh r0, [r1] + movs r0, 0x84 + lsls r0, 1 + adds r1, r3, r0 + movs r0, 0 + str r0, [r1] + movs r0, 0x34 + bl audio_play + bl sub_808074C + bl sub_80807BC +_0808048C: + ldr r0, [r4] + b _080804BE + .pool +_0808049C: + bl sub_8083380 + lsls r0, 24 + cmp r0, 0 + beq _080804BA + ldr r0, =0x020322a4 + ldr r1, [r0] + movs r3, 0x84 + lsls r3, 1 + adds r2, r1, r3 + movs r0, 0 + str r0, [r2] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080804BA: + ldr r0, =0x020322a4 + ldr r0, [r0] +_080804BE: + movs r1, 0xA0 + lsls r1, 1 + adds r0, r1 + bl sub_8082CB4 + b _08080546 + .pool +_080804D0: + ldr r0, =gUnknown_08339C2C + movs r2, 0x10 + negs r2, r2 + movs r1, 0x78 + movs r3, 0x3 + bl AddObjectToFront + b _080804F8 + .pool +_080804E4: + bl sub_800ADF8 + b _080804F8 +_080804EA: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08080546 + bl sub_800A418 +_080804F8: + ldr r0, =0x020322a4 + ldr r1, [r0] +_080804FC: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08080546 + .pool +_08080508: + ldr r5, =0x020322a4 + ldr r3, [r5] + adds r1, r3, 0 + adds r1, 0x4C + movs r2, 0 + movs r0, 0x80 + strh r0, [r1] + movs r1, 0x82 + lsls r1, 1 + adds r0, r3, r1 + str r2, [r0] + ldr r0, =sub_8081898 + bl SetMainCallback2 + bl current_map_music_get + lsls r0, 16 + lsrs r0, 16 + ldr r4, =0x00000193 + cmp r0, r4 + beq _08080540 + bl current_map_music_get + ldr r1, [r5] + movs r2, 0xAA + lsls r2, 1 + adds r1, r2 + strh r0, [r1] +_08080540: + adds r0, r4, 0 + bl song_play_for_text +_08080546: + ldr r0, =0x020322a4 + ldr r1, [r0] + movs r3, 0x8E + lsls r3, 1 + adds r0, r1, r3 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r3, 0x2 + adds r1, r3 + movs r2, 0 + ldrsh r1, [r1, r2] + bl nullsub_31 + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8080018 + + thumb_func_start sub_8080588 +sub_8080588: @ 8080588 + push {r4,lr} + movs r0, 0 + movs r1, 0 + bl SetGpuReg + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + bl ResetTasks + ldr r0, =sub_807F764 + bl SetVBlankCallback + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_08339974 + movs r0, 0x1 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r4, =0x020322a4 + ldr r1, [r4] + movs r0, 0xDC + lsls r0, 1 + adds r1, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r3, =0x000009b8 + adds r1, r3 + movs r0, 0x2 + bl SetBgTilemapBuffer + movs r0, 0 + movs r1, 0x1 + movs r2, 0xD0 + bl sub_809882C + movs r0, 0 + movs r1, 0x14 + movs r2, 0xF0 + bl copy_textbox_border_tile_patterns_to_vram + bl sub_807FA34 + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x44 + movs r1, 0 + strh r1, [r0] + adds r0, 0x8 + strh r1, [r0] + subs r0, 0x2 + strh r1, [r0] + adds r0, 0x4 + strh r1, [r0] + movs r3, 0x8E + lsls r3, 1 + adds r0, r2, r3 + strh r1, [r0] + adds r3, 0x2 + adds r0, r2, r3 + strh r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8080588 + + thumb_func_start task_tutorial_oak_boy_girl +task_tutorial_oak_boy_girl: @ 8080624 + push {lr} + lsls r0, 16 + lsls r1, 24 + lsrs r0, 24 + adds r2, r0, 0 + adds r2, 0x18 + ldr r0, =0x020322a4 + ldr r0, [r0] + lsrs r1, 23 + adds r0, 0x96 + adds r0, r1 + ldrb r0, [r0] + ldr r1, =gUnknown_083399E7 + adds r0, r1 + ldrb r1, [r0] + cmp r2, r1 + bcc _0808066C + adds r0, r1, 0 + adds r0, 0x30 + cmp r2, r0 + bcs _0808066C + subs r0, 0x1C + cmp r2, r0 + bcc _08080668 + adds r0, 0x8 + cmp r2, r0 + bcs _08080668 + movs r0, 0x2 + b _0808066E + .pool +_08080668: + movs r0, 0x1 + b _0808066E +_0808066C: + movs r0, 0 +_0808066E: + pop {r1} + bx r1 + thumb_func_end task_tutorial_oak_boy_girl + + thumb_func_start sub_8080674 +sub_8080674: @ 8080674 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 24 + lsrs r1, 24 + movs r6, 0 + cmp r5, 0xAF + bne _080806AC + movs r4, 0 + subs r7, r1, 0x1 + adds r2, 0x9 +_08080690: + adds r0, r2, r6 + adds r1, r2, r4 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bls _0808069E + adds r6, r4, 0 +_0808069E: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _08080690 + adds r0, r6, 0x5 + b _080806C4 +_080806AC: + adds r0, r5, 0 + subs r0, 0x85 + lsls r0, 16 + lsrs r6, r0, 16 + subs r7, r1, 0x1 + cmp r6, 0x4 + bls _080806C8 + adds r0, r6, 0 + movs r1, 0x5 + bl __umodsi3 + adds r0, 0x5 +_080806C4: + lsls r0, 16 + lsrs r6, r0, 16 +_080806C8: + movs r4, 0 + cmp r4, r7 + bge _08080734 + ldr r0, =gUnknown_08339CA0 + mov r9, r0 + adds r0, r5, 0 + subs r0, 0xA3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 +_080806DC: + lsls r0, r6, 1 + adds r0, r6 + adds r0, r4, r0 + add r0, r9 + ldrb r5, [r0] + movs r0, 0xD0 + lsls r0, 2 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _0808071A + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0x1 + bne _0808071A + adds r0, r6, 0 + movs r1, 0x5 + bl __umodsi3 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =gUnknown_08339CBE + adds r0, r6, r0 + ldrb r5, [r0] + mov r0, r8 + cmp r0, 0x4 + bhi _0808071A + subs r0, r5, 0x5 + lsls r0, 16 + lsrs r5, r0, 16 +_0808071A: + adds r4, 0x1 + lsls r0, r4, 24 + lsrs r0, 24 + adds r1, r5, 0 + adds r1, 0x85 + lsls r1, 16 + lsrs r1, 16 + bl sub_8082FDC + lsls r4, 16 + lsrs r4, 16 + cmp r4, r7 + blt _080806DC +_08080734: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8080674 + + thumb_func_start sub_808074C +sub_808074C: @ 808074C + push {r4-r7,lr} + movs r4, 0 + ldr r7, =0x020322a4 + movs r6, 0xFF + ldr r5, =gUnknown_083399D0 +_08080756: + ldr r3, [r7] + lsls r2, r4, 1 + adds r0, r3, 0 + adds r0, 0x96 + adds r0, r2 + strh r6, [r0] + adds r1, r3, 0 + adds r1, 0x8E + adds r1, r2 + adds r0, r3, 0 + adds r0, 0x7C + ldrb r0, [r0] + subs r0, 0x2 + lsls r0, 2 + adds r0, r4, r0 + adds r0, r5 + ldrb r0, [r0] + strh r0, [r1] + adds r4, 0x1 + cmp r4, 0x3 + ble _08080756 + movs r3, 0 + ldr r7, =0x020322a4 +_08080784: + movs r4, 0 + adds r6, r3, 0x1 + lsls r5, r3, 1 +_0808078A: + ldr r2, [r7] + lsls r0, r4, 1 + adds r1, r2, 0 + adds r1, 0x8E + adds r1, r0 + ldrh r0, [r1] + cmp r0, r3 + bne _080807A2 + adds r0, r2, 0 + adds r0, 0x96 + adds r0, r5 + strh r4, [r0] +_080807A2: + adds r4, 0x1 + cmp r4, 0x3 + ble _0808078A + adds r3, r6, 0 + cmp r3, 0x3 + ble _08080784 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808074C + + thumb_func_start sub_80807BC +sub_80807BC: @ 80807BC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + movs r0, 0 + mov r10, r0 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _080807DE + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 +_080807DE: + movs r6, 0 + ldr r7, =0x020322a4 + mov r8, r6 +_080807E4: + ldr r2, [r7] + lsls r5, r6, 1 + adds r0, r2, 0 + adds r0, 0x8E + adds r3, r0, r5 + ldrh r0, [r3] + cmp r0, 0xFF + beq _080808B6 + adds r1, r2, 0 + adds r1, 0x50 + ldrh r3, [r3] + adds r1, r3 + adds r0, r2, 0 + adds r0, 0x54 + adds r0, r6 + ldrb r0, [r0] + movs r2, 0 + mov r9, r2 + strb r0, [r1] + ldr r0, [r7] + adds r1, r0, 0 + adds r1, 0x8E + adds r1, r5 + adds r0, 0x50 + ldrh r1, [r1] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + mov r1, r8 + lsrs r4, r1, 24 + adds r1, r4, 0 + bl StartObjectImageAnim + add r1, sp, 0x8 + movs r0, 0xFF + strb r0, [r1] + ldr r0, [r7] + adds r0, 0x8E + adds r0, r5 + ldrh r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r0, =0x020229f0 + adds r1, r0 + add r0, sp, 0x8 + bl CopyString + movs r0, 0x1 + add r1, sp, 0x8 + movs r2, 0x38 + bl GetStringCenterAlignXOffset + adds r2, r0, 0 + ldr r0, [r7] + adds r0, 0x8E + adds r0, r5 + mov r5, r8 + ldrh r0, [r0] + cmp r10, r0 + bne _08080890 + lsls r2, 24 + lsrs r2, 24 + mov r0, r9 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + adds r0, r4, 0 + add r1, sp, 0x8 + movs r3, 0x1 + bl sub_80840D4 + b _080808A6 + .pool +_08080890: + lsls r2, 24 + lsrs r2, 24 + mov r1, r9 + str r1, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + adds r0, r4, 0 + add r1, sp, 0x8 + movs r3, 0x1 + bl sub_80840D4 +_080808A6: + lsrs r4, r5, 24 + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram +_080808B6: + movs r2, 0x80 + lsls r2, 17 + add r8, r2 + adds r6, 0x1 + cmp r6, 0x3 + ble _080807E4 + 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_80807BC + + thumb_func_start sub_80808D4 +sub_80808D4: @ 80808D4 + push {r4-r7,lr} + sub sp, 0x4 + ldr r1, =0x020322a4 + ldr r0, [r1] + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x15 + bls _080808E6 + b _08080DAE +_080808E6: + lsls r0, 2 + ldr r1, =_080808F8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080808F8: + .4byte _08080950 + .4byte _080809E4 + .4byte _08080A04 + .4byte _08080A58 + .4byte _08080A84 + .4byte _08080DAE + .4byte _08080DAE + .4byte _08080DAE + .4byte _08080ABC + .4byte _08080DAE + .4byte _08080DAE + .4byte _08080AEC + .4byte _08080B3C + .4byte _08080BB0 + .4byte _08080BDC + .4byte _08080C78 + .4byte _08080CA0 + .4byte _08080DAE + .4byte _08080CAE + .4byte _08080CAE + .4byte _08080CAE + .4byte _08080CC4 +_08080950: + bl sub_800B4C0 + bl sub_8080588 + ldr r4, =0x0203ce7c + ldrh r1, [r4] + movs r0, 0 + bl sub_8082FDC + ldr r5, =0x020322a4 + ldr r0, [r5] + movs r6, 0xAC + lsls r6, 1 + adds r0, r6 + ldrh r1, [r4] + bl sub_807FE14 + ldrh r0, [r4] + ldr r2, [r5] + adds r1, r2, 0 + adds r1, 0x7C + ldrb r1, [r1] + adds r2, r6 + bl sub_8080674 + movs r4, 0 + movs r6, 0 + ldr r0, =0x020229c6 + mov r12, r0 + movs r7, 0x92 + lsls r7, 1 +_0808098E: + ldr r0, [r5] + lsls r1, r4, 1 + adds r0, 0x64 + adds r0, r1 + strh r6, [r0] + adds r3, r4, 0x1 + adds r1, r4 + lsls r1, 1 + movs r2, 0x2 +_080809A0: + ldr r0, [r5] + adds r0, r7 + adds r0, r1 + strh r6, [r0] + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _080809A0 + adds r4, r3, 0 + cmp r4, 0x3 + ble _0808098E + ldr r4, =0x020322a4 + ldr r3, [r4] + adds r1, r3, 0 + adds r1, 0x70 + movs r2, 0 + movs r0, 0 + strh r0, [r1] + strb r2, [r3, 0x1] + ldr r1, =0x00004422 + adds r0, r1, 0 + mov r2, r12 + strh r0, [r2] + ldr r1, [r4] + b _08080CB2 + .pool +_080809E4: + bl sub_807F7D8 + lsls r0, 24 + cmp r0, 0 + bne _080809F0 + b _08080DAE +_080809F0: + ldr r0, =0x020322a4 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bl sub_8082D28 + b _08080DAE + .pool +_08080A04: + movs r4, 0 + ldr r5, =gUnknown_083399C8 + ldr r6, =0x020322a4 +_08080A0A: + ldrb r1, [r5] + ldrb r2, [r5, 0x1] + ldr r0, =gUnknown_08339AD8 + movs r3, 0x1 + bl AddObjectToFront + ldr r1, [r6] + adds r1, 0x54 + adds r1, r4 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x54 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + adds r1, r4, 0 + adds r1, 0x8 + lsls r1, 24 + lsrs r1, 24 + bl StartObjectImageAnim + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _08080A0A + b _08080CAE + .pool +_08080A58: + movs r0, 0x1 + negs r0, r0 + movs r4, 0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r2, =0x020322a4 + ldr r1, [r2] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r2] + movs r3, 0x84 + lsls r3, 1 + adds r0, r3 + str r4, [r0] + b _08080DAE + .pool +_08080A84: + ldr r4, =0x020322a4 + ldr r1, [r4] + movs r5, 0x84 + lsls r5, 1 + adds r1, r5 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + cmp r0, 0x2 + bne _08080A9C + bl sub_807F9D0 +_08080A9C: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08080AAA + b _08080DAE +_08080AAA: + ldr r1, [r4] + movs r0, 0x8 + strb r0, [r1] + b _08080DAE + .pool +_08080ABC: + ldr r2, =0x020322a4 + ldr r1, [r2] + movs r3, 0 + movs r0, 0xB + strb r0, [r1] + ldr r0, [r2] + movs r1, 0x8A + lsls r1, 1 + adds r0, r1 + strb r3, [r0] + b _08080DAE + .pool +_08080AD8: + lsls r1, 1 + adds r0, r3, 0 + adds r0, 0x74 + adds r0, r1 + ldrh r0, [r0] + lsls r1, r4, 24 + lsrs r1, 24 + bl sub_807FD90 + b _08080B16 +_08080AEC: + movs r4, 0 + ldr r2, =gUnknown_083399D0 + ldr r0, =0x020322a4 + ldr r3, [r0] + adds r0, r3, 0 + adds r0, 0x7C + ldrb r0, [r0] + subs r0, 0x2 + lsls r0, 2 + movs r5, 0x8A + lsls r5, 1 + adds r1, r3, r5 + ldrb r1, [r1] + adds r0, r2 +_08080B08: + ldrb r2, [r0] + cmp r1, r2 + beq _08080AD8 + adds r0, 0x1 + adds r4, 0x1 + cmp r4, 0x3 + ble _08080B08 +_08080B16: + ldr r3, =0x020322a4 + ldr r1, [r3] + movs r5, 0x84 + lsls r5, 1 + adds r2, r1, r5 + movs r0, 0 + str r0, [r2] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, [r3] + movs r0, 0x8A + lsls r0, 1 + adds r1, r0 + b _08080CB2 + .pool +_08080B3C: + ldr r3, [r2] + movs r2, 0x84 + lsls r2, 1 + adds r1, r3, r2 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + cmp r0, 0x3C + bgt _08080B50 + b _08080DAE +_08080B50: + movs r5, 0x8A + lsls r5, 1 + adds r0, r3, r5 + adds r4, r3, 0 + adds r4, 0x7C + ldrb r0, [r0] + ldrb r1, [r4] + cmp r0, r1 + bcc _08080B94 + ldr r2, =gUnknown_083399DC + ldr r1, =gUnknown_083399E4 + ldrb r0, [r4] + subs r0, 0x2 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r2 + ldr r2, =0xffffa800 + adds r1, r2, 0 + ldrh r0, [r0] + adds r1, r0 + adds r0, r3, 0 + adds r0, 0x4A + strh r1, [r0] + ldrb r0, [r3] + adds r0, 0x1 + b _08080B98 + .pool +_08080B94: + ldrb r0, [r3] + subs r0, 0x1 +_08080B98: + strb r0, [r3] + ldr r0, =0x020322a4 + ldr r0, [r0] + movs r3, 0x84 + lsls r3, 1 + adds r0, r3 + movs r1, 0 + str r1, [r0] + b _08080DAE + .pool +_08080BB0: + ldr r4, =0x020322a4 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bl sub_808074C + movs r0, 0x2B + bl audio_play + ldr r0, [r4] + movs r5, 0xA0 + lsls r5, 1 + adds r0, r5 + bl sub_8082CB4 + movs r0, 0x2 + bl ShowBg + b _08080DAE + .pool +_08080BDC: + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + bl SetGpuRegBits + ldr r4, =0x020322a4 + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0x4A + movs r3, 0x80 + lsls r3, 2 + adds r0, r3, 0 + ldrh r5, [r1] + adds r0, r5 + strh r0, [r1] + movs r0, 0x8D + lsls r0, 1 + adds r1, r2, r0 + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xFF + bls _08080C5C + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + ldr r3, [r4] + movs r2, 0x8D + lsls r2, 1 + adds r1, r3, r2 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r1] + ldr r2, =gUnknown_083399DC + ldr r1, =gUnknown_083399E4 + adds r0, r3, 0 + adds r0, 0x7C + ldrb r0, [r0] + subs r0, 0x2 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + adds r0, r3, 0 + adds r0, 0x4A + strh r1, [r0] + movs r0, 0xC + movs r1, 0x2 + bl SetGpuRegBits + ldr r0, [r4] + movs r3, 0x84 + lsls r3, 1 + adds r0, r3 + movs r1, 0 + str r1, [r0] + movs r0, 0x34 + bl audio_play + bl sub_80807BC +_08080C5C: + ldr r0, [r4] + movs r5, 0xA0 + lsls r5, 1 + adds r0, r5 + bl sub_8082CB4 + b _08080DAE + .pool +_08080C78: + bl sub_8083380 + lsls r0, 24 + cmp r0, 0 + beq _08080C8C + ldr r0, =0x020322a4 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08080C8C: + ldr r0, =0x020322a4 + ldr r0, [r0] + movs r1, 0xA0 + lsls r1, 1 + adds r0, r1 + bl sub_8082CB4 + b _08080DAE + .pool +_08080CA0: + ldr r0, =gUnknown_08339C2C + movs r2, 0x10 + negs r2, r2 + movs r1, 0x78 + movs r3, 0x3 + bl AddObjectToFront +_08080CAE: + ldr r0, =0x020322a4 + ldr r1, [r0] +_08080CB2: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08080DAE + .pool +_08080CC4: + bl sub_8080DF8 + ldr r5, =0x020322a4 + ldr r4, [r5] + adds r1, r4, 0 + adds r1, 0x4C + movs r3, 0 + movs r2, 0 + movs r0, 0x80 + strh r0, [r1] + movs r1, 0x82 + lsls r1, 1 + adds r0, r4, r1 + str r2, [r0] + ldr r2, =0x00000123 + adds r0, r4, r2 + strb r3, [r0] + ldr r0, [r5] + adds r0, 0x72 + strb r3, [r0] + ldr r0, =sub_8081898 + bl SetMainCallback2 + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0x1 + bne _08080D44 + movs r0, 0xD0 + lsls r0, 2 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08080D30 + ldr r0, =sub_8081224 + movs r1, 0xA + bl CreateTask + ldr r1, [r5] + movs r3, 0x90 + lsls r3, 1 + adds r1, r3 + b _08080D42 + .pool +_08080D30: + ldr r0, =gUnknown_083399EC + ldr r0, [r0] + movs r1, 0xA + bl CreateTask + ldr r1, [r5] + movs r5, 0x90 + lsls r5, 1 + adds r1, r5 +_08080D42: + strb r0, [r1] +_08080D44: + ldr r1, =0x020375e0 + ldrh r0, [r1] + cmp r0, 0x1 + bls _08080D80 + movs r4, 0 + ldrh r1, [r1] + cmp r4, r1 + bge _08080D80 + movs r5, 0xA0 + lsls r5, 20 + ldr r6, =gUnknown_083399EC +_08080D5A: + ldm r6!, {r0} + lsrs r1, r5, 24 + bl CreateTask + ldr r1, =0x020322a4 + ldr r1, [r1] + movs r2, 0x90 + lsls r2, 1 + adds r1, r2 + adds r1, r4 + strb r0, [r1] + movs r3, 0x80 + lsls r3, 17 + adds r5, r3 + adds r4, 0x1 + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r4, r0 + blt _08080D5A +_08080D80: + bl current_map_music_get + lsls r0, 16 + lsrs r0, 16 + ldr r4, =0x00000193 + cmp r0, r4 + beq _08080D9E + bl current_map_music_get + ldr r1, =0x020322a4 + ldr r1, [r1] + movs r5, 0xAA + lsls r5, 1 + adds r1, r5 + strh r0, [r1] +_08080D9E: + adds r0, r4, 0 + bl song_play_for_text + movs r0, 0x35 + bl audio_play + bl sub_807F738 +_08080DAE: + ldr r0, =0x020322a4 + ldr r1, [r0] + movs r2, 0x8E + lsls r2, 1 + adds r0, r1, r2 + movs r3, 0 + ldrsh r0, [r0, r3] + movs r5, 0x8F + lsls r5, 1 + adds r1, r5 + movs r2, 0 + ldrsh r1, [r1, r2] + bl nullsub_31 + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80808D4 + + thumb_func_start sub_8080DF8 +sub_8080DF8: @ 8080DF8 + push {lr} + ldr r3, =0x03003110 + movs r0, 0 + ldr r1, =0x03003090 + movs r2, 0x3 +_08080E02: + strh r0, [r3] + strh r0, [r3, 0x4] + strh r0, [r1] + strh r0, [r1, 0x4] + adds r1, 0x10 + subs r2, 0x1 + cmp r2, 0 + bge _08080E02 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8080DF8 + + thumb_func_start sub_8080E20 +sub_8080E20: @ 8080E20 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r2, r0, r1 + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + lsls r0, 16 + asrs r0, 16 + movs r4, 0xA + ldrsh r1, [r2, r4] + cmp r0, r1 + ble _08080E58 + ldr r0, =0x03003090 + movs r4, 0xC + ldrsh r1, [r2, r4] + lsls r1, 4 + adds r0, 0x4 + adds r1, r0 + ldr r0, =0x00002345 + strh r0, [r1] + adds r0, r3, 0 + bl DestroyTask +_08080E58: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8080E20 + + thumb_func_start sub_8080E6C +sub_8080E6C: @ 8080E6C + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =sub_8080E20 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0xA] + strh r5, [r1, 0xC] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8080E6C + + thumb_func_start sub_8080EA4 +sub_8080EA4: @ 8080EA4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x020322a4 + ldr r0, [r4] + adds r0, 0x4A + ldrh r0, [r0] + movs r1, 0x1 + bl task_tutorial_oak_boy_girl + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _08080EC2 + b _08080FB8 +_08080EC2: + ldr r2, =0x03005e00 + lsls r1, r5, 2 + adds r0, r1, r5 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r6, r1, 0 + cmp r0, 0 + beq _08080ED8 + b _08080FC6 +_08080ED8: + ldr r0, [r4] + ldr r1, =0x00000123 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08080F9A + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x0000028f + bl __udivsi3 + lsls r0, 24 + lsrs r1, r0, 24 + adds r3, r1, 0 + ldr r0, [r4] + adds r0, 0x4C + movs r4, 0 + ldrsh r2, [r0, r4] + ldr r0, =0x000001f3 + cmp r2, r0 + bgt _08080F40 + cmp r1, 0x4B + bls _08080F2C + ldr r1, =0x03003090 + ldr r0, =0x00004523 + b _08080F30 + .pool +_08080F2C: + ldr r1, =0x03003090 + ldr r0, =0x00005432 +_08080F30: + strh r0, [r1, 0x14] + ldr r0, =0x00005432 + b _08080F9E + .pool +_08080F40: + ldr r0, =0x000005db + cmp r2, r0 + bgt _08080F6E + cmp r1, 0x50 + bhi _08080F9A + adds r0, r1, 0 + subs r0, 0x15 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3B + bhi _08080F68 + ldr r1, =0x03003090 + ldr r0, =0x00005432 + b _08080F9E + .pool +_08080F68: + cmp r1, 0x9 + bhi _08080FA0 + b _08080F90 +_08080F6E: + cmp r1, 0x5A + bhi _08080F9A + adds r0, r1, 0 + subs r0, 0x47 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bhi _08080F8C + ldr r1, =0x03003090 + ldr r0, =0x00005432 + b _08080F9E + .pool +_08080F8C: + cmp r3, 0x1D + bhi _08080FA0 +_08080F90: + movs r0, 0x1 + movs r1, 0x5 + bl sub_8080E6C + b _08080FA0 +_08080F9A: + ldr r1, =0x03003090 + ldr r0, =0x00004523 +_08080F9E: + strh r0, [r1, 0x14] +_08080FA0: + ldr r0, =0x03005e00 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + b _08080FC4 + .pool +_08080FB8: + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r0, 0 +_08080FC4: + strh r0, [r1, 0x8] +_08080FC6: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8080EA4 + + thumb_func_start sub_8080FD0 +sub_8080FD0: @ 8080FD0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r6, =0x020322a4 + ldr r3, [r6] + adds r0, r3, 0 + adds r0, 0x4A + ldrh r0, [r0] + movs r1, 0xC0 + lsls r1, 5 + adds r0, r1 + ldr r1, =0x0000ffff + ands r0, r1 + adds r1, r3, 0 + adds r1, 0x9A + ldrb r1, [r1] + lsrs r2, r0, 8 + ldr r0, =gUnknown_083399E7 + adds r1, r0 + ldrb r1, [r1] + adds r0, r1, 0 + adds r0, 0x14 + cmp r2, r0 + bls _080810E0 + adds r0, 0x14 + cmp r2, r0 + bcs _080810E0 + ldr r2, =0x03005e00 + lsls r1, r4, 2 + adds r0, r1, r4 + lsls r0, 3 + adds r2, r0, r2 + movs r5, 0x8 + ldrsh r0, [r2, r5] + adds r5, r1, 0 + cmp r0, 0 + bne _080810EE + ldr r1, =0x00000123 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080810CC + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x0000028f + bl __udivsi3 + lsls r0, 24 + lsrs r2, r0, 24 + adds r3, r2, 0 + ldr r0, [r6] + adds r0, 0x4C + movs r6, 0 + ldrsh r1, [r0, r6] + ldr r0, =0x000001f3 + cmp r1, r0 + bgt _08081088 + cmp r2, 0x42 + bls _08081078 + ldr r1, =0x03003090 + ldr r0, =0x00004523 + strh r0, [r1, 0x24] + b _080810B0 + .pool +_08081078: + ldr r1, =0x03003090 + ldr r0, =0x00005432 + strh r0, [r1, 0x24] + b _080810B0 + .pool +_08081088: + cmp r2, 0x41 + bls _08081092 + ldr r1, =0x03003090 + ldr r0, =0x00004523 + strh r0, [r1, 0x24] +_08081092: + adds r0, r2, 0 + subs r0, 0x29 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x18 + bhi _080810A4 + ldr r1, =0x03003090 + ldr r0, =0x00005432 + strh r0, [r1, 0x24] +_080810A4: + cmp r3, 0x9 + bhi _080810B0 + movs r0, 0x2 + movs r1, 0x5 + bl sub_8080E6C +_080810B0: + ldr r0, =0x03005e00 + adds r1, r5, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + b _080810EC + .pool +_080810CC: + ldr r0, =0x03003090 + ldr r1, =0x00004523 + strh r1, [r0, 0x24] + movs r0, 0x1 + strh r0, [r2, 0x8] + b _080810EE + .pool +_080810E0: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0 +_080810EC: + strh r0, [r1, 0x8] +_080810EE: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8080FD0 + + thumb_func_start sub_80810F8 +sub_80810F8: @ 80810F8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =0x020322a4 + ldr r3, [r5] + adds r0, r3, 0 + adds r0, 0x4A + ldrh r0, [r0] + movs r1, 0xC0 + lsls r1, 5 + adds r0, r1 + ldr r1, =0x0000ffff + ands r0, r1 + adds r1, r3, 0 + adds r1, 0x9C + ldrb r1, [r1] + lsrs r2, r0, 8 + ldr r0, =gUnknown_083399E7 + adds r1, r0 + ldrb r1, [r1] + adds r0, r1, 0 + adds r0, 0x14 + cmp r2, r0 + bls _0808120C + adds r0, 0x14 + cmp r2, r0 + bcs _0808120C + ldr r2, =0x03005e00 + lsls r1, r4, 2 + adds r0, r1, r4 + lsls r0, 3 + adds r2, r0, r2 + movs r6, 0x8 + ldrsh r0, [r2, r6] + adds r6, r1, 0 + cmp r0, 0 + bne _0808121A + ldr r1, =0x00000123 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080811F8 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x0000028f + bl __udivsi3 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, [r5] + adds r0, 0x4C + movs r3, 0 + ldrsh r1, [r0, r3] + ldr r0, =0x000001f3 + cmp r1, r0 + bgt _080811AC + cmp r2, 0x58 + bls _0808119C + ldr r1, =0x03003090 + ldr r0, =0x00004523 + strh r0, [r1, 0x34] + b _080811DE + .pool +_0808119C: + ldr r1, =0x03003090 + ldr r0, =0x00005432 + strh r0, [r1, 0x34] + b _080811DE + .pool +_080811AC: + cmp r2, 0x3C + bls _080811C0 + ldr r1, =0x03003090 + ldr r0, =0x00004523 + b _080811D0 + .pool +_080811C0: + adds r0, r2, 0 + subs r0, 0x38 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _080811D2 + ldr r1, =0x03003090 + ldr r0, =0x00005432 +_080811D0: + strh r0, [r1, 0x34] +_080811D2: + cmp r2, 0x4 + bhi _080811DE + movs r0, 0x3 + movs r1, 0x5 + bl sub_8080E6C +_080811DE: + ldr r0, =0x03005e00 + adds r1, r6, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + b _08081218 + .pool +_080811F8: + ldr r0, =0x03003090 + ldr r1, =0x00004523 + strh r1, [r0, 0x34] + movs r0, 0x1 + strh r0, [r2, 0x8] + b _0808121A + .pool +_0808120C: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0 +_08081218: + strh r0, [r1, 0x8] +_0808121A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80810F8 + + thumb_func_start sub_8081224 +sub_8081224: @ 8081224 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x020322a4 + ldr r0, [r0] + adds r0, 0x4A + ldrh r0, [r0] + movs r1, 0x1 + bl task_tutorial_oak_boy_girl + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08081270 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r2, r1, r0 + movs r1, 0x8 + ldrsh r0, [r2, r1] + cmp r0, 0 + bne _0808127E + ldr r0, =0x03003090 + ldr r1, =0x00004523 + strh r1, [r0, 0x14] + movs r0, 0x1 + strh r0, [r2, 0x8] + b _0808127E + .pool +_08081270: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0 + strh r0, [r1, 0x8] +_0808127E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8081224 + + thumb_func_start sub_8081288 +sub_8081288: @ 8081288 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r7, r0, 16 + mov r8, r7 + lsls r1, 24 + ldr r0, =gUnknown_08339B40 + ldr r4, =gUnknown_083399C8 + lsrs r1, 23 + adds r2, r1, r4 + ldrb r6, [r2] + ldr r5, =gUnknown_083399C0 + adds r2, r1, r5 + movs r3, 0 + ldrsb r3, [r2, r3] + lsls r2, r3, 2 + adds r2, r3 + lsls r2, 1 + subs r6, r2 + adds r4, 0x1 + adds r4, r1, r4 + ldrb r2, [r4] + adds r5, 0x1 + adds r1, r5 + movs r3, 0 + ldrsb r3, [r1, r3] + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 1 + subs r2, r1 + adds r1, r6, 0 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + adds r2, r1, 0 + ldr r0, =0x00004523 + cmp r7, r0 + bne _08081314 + lsls r4, r1, 4 + adds r4, r1 + lsls r4, 2 + ldr r5, =0x02020630 + adds r0, r4, r5 + movs r1, 0x2 + bl StartObjectImageAnim + adds r5, 0x1C + adds r4, r5 + ldr r0, =sub_8082F9C + str r0, [r4] + movs r0, 0x28 + bl audio_play + b _08081358 + .pool +_08081314: + ldr r0, =0x00005432 + cmp r7, r0 + bne _0808133C + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0 + bl StartObjectImageAnim + movs r0, 0x1F + bl audio_play + b _08081358 + .pool +_0808133C: + ldr r0, =0x00002345 + cmp r8, r0 + bne _08081358 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0x1 + bl StartObjectImageAnim + movs r0, 0x20 + bl audio_play +_08081358: + bl sub_8082E84 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8081288 + + thumb_func_start sub_8081370 +sub_8081370: @ 8081370 + push {r4-r7,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl sub_807F738 + ldr r0, =0x00004523 + cmp r4, r0 + beq _080813A4 + cmp r4, r0 + bgt _08081398 + ldr r0, =0x00002345 + cmp r4, r0 + beq _08081474 + b _080814A0 + .pool +_08081398: + ldr r0, =0x00005432 + cmp r5, r0 + beq _0808143C + b _080814A0 + .pool +_080813A4: + ldr r7, =0x020322a4 + ldr r4, [r7] + adds r5, r4, 0 + adds r5, 0x4C + ldrh r6, [r5] + movs r0, 0 + ldrsh r1, [r5, r0] + ldr r0, =0x000005db + cmp r1, r0 + bgt _080813E0 + ldr r1, =gUnknown_08339CC3 + adds r0, r4, 0 + adds r0, 0x7C + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + movs r0, 0xC0 + lsls r0, 1 + bl __divsi3 + adds r0, r6, r0 + strh r0, [r5] + b _080814A0 + .pool +_080813E0: + ldr r1, =gUnknown_08339CC3 + adds r0, r4, 0 + adds r0, 0x7C + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x80 + bl __divsi3 + adds r0, r6, r0 + strh r0, [r5] + movs r1, 0x8E + lsls r1, 1 + adds r4, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + subs r1, 0xA + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_80832BC + ldr r0, [r7] + movs r1, 0x8F + lsls r1, 1 + adds r4, r0, r1 + adds r0, 0x4C + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + subs r1, 0xA + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_80832BC + b _080814A0 + .pool +_0808143C: + ldr r0, =0x020322a4 + ldr r2, [r0] + adds r4, r2, 0 + adds r4, 0x4C + ldrh r5, [r4] + movs r0, 0 + ldrsh r1, [r4, r0] + ldr r0, =0x000005db + cmp r1, r0 + bgt _080814A0 + ldr r1, =gUnknown_08339CC3 + adds r0, r2, 0 + adds r0, 0x7C + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x80 + lsls r0, 1 + bl __divsi3 + adds r0, r5, r0 + b _0808149E + .pool +_08081474: + ldr r0, =0x020322a4 + ldr r0, [r0] + adds r4, r0, 0 + adds r4, 0x4C + ldr r1, =gUnknown_08339CC3 + adds r0, 0x7C + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x80 + lsls r0, 1 + bl __divsi3 + ldrh r1, [r4] + subs r1, r0 + strh r1, [r4] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x7F + bgt _080814A0 + movs r0, 0x80 +_0808149E: + strh r0, [r4] +_080814A0: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8081370 + + thumb_func_start sub_80814B0 +sub_80814B0: @ 80814B0 + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _080814E4 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _080814E4 + movs r0, 0xFF + lsls r0, 8 + ands r0, r3 + cmp r0, r2 + bne _080814EC + movs r0, 0x1 + b _080814EE + .pool +_080814E4: + cmp r3, r1 + bne _080814EC + movs r0, 0x1 + b _080814EE +_080814EC: + movs r0, 0 +_080814EE: + pop {r1} + bx r1 + thumb_func_end sub_80814B0 + + thumb_func_start sub_80814F4 +sub_80814F4: @ 80814F4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0 + beq _0808153C + ldr r3, =0x03003110 + ldrh r0, [r3, 0x4] + ldr r2, =0x03003090 + cmp r0, 0 + beq _0808151C + movs r1, 0 + strh r0, [r2, 0x4] + ldr r0, =0x00004444 + strh r0, [r2] + strh r1, [r3, 0x4] +_0808151C: + ldr r0, =0x03003090 + ldr r3, =0x00004444 + adds r1, r2, 0 + adds r1, 0x10 + adds r2, r0, 0 + adds r2, 0x14 + movs r7, 0x2 +_0808152A: + ldrh r0, [r2] + cmp r0, 0 + beq _08081532 + strh r3, [r1] +_08081532: + adds r1, 0x10 + adds r2, 0x10 + subs r7, 0x1 + cmp r7, 0 + bge _0808152A +_0808153C: + movs r7, 0 + ldr r1, =0x020322a4 + ldr r0, [r1] + adds r0, 0x7C + ldrb r0, [r0] + cmp r7, r0 + blt _0808154C + b _080816F6 +_0808154C: + ldr r0, =0x03003090 + adds r2, r0, 0 + adds r2, 0x20 + str r2, [sp] + movs r1, 0 + mov r9, r1 + movs r2, 0 + str r2, [sp, 0x4] + mov r8, r0 + ldr r0, =0x00005432 + mov r10, r0 +_08081562: + mov r1, r8 + ldrh r0, [r1] + ldr r1, =0x00004444 + movs r2, 0x88 + lsls r2, 7 + bl sub_80814B0 + cmp r0, 0 + bne _08081576 + b _080816D2 +_08081576: + ldr r6, =0x020322a4 + ldr r0, [r6] + adds r0, 0x96 + ldr r2, [sp, 0x4] + adds r0, r2 + ldrh r5, [r0] + mov r0, r8 + ldrh r4, [r0, 0x4] + ldr r1, =0x00004523 + cmp r4, r1 + bne _080815F4 + adds r0, r1, 0 + bl sub_8081370 + ldr r0, [r6] + movs r2, 0x8B + lsls r2, 1 + adds r4, r0, r2 + adds r0, 0x4C + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0x37 + bl __divsi3 + ldrh r1, [r4] + adds r1, r0 + strh r1, [r4] + lsls r1, 16 + ldr r0, =0x03e70000 + cmp r1, r0 + bls _080815BA + movs r0, 0xFA + lsls r0, 2 + strh r0, [r4] +_080815BA: + lsls r1, r5, 24 + lsrs r1, 24 + ldr r0, =0x00004523 + bl sub_8081288 + ldr r1, [r6] + movs r2, 0x92 + lsls r2, 1 + adds r1, r2 + add r1, r9 + ldrh r0, [r1] + adds r0, 0x1 + b _0808165E + .pool +_080815F4: + cmp r4, r10 + bne _08081632 + mov r0, r10 + bl sub_8081370 + ldr r0, [r6] + movs r1, 0x8B + lsls r1, 1 + adds r4, r0, r1 + adds r0, 0x4C + movs r2, 0 + ldrsh r0, [r0, r2] + movs r1, 0x46 + bl __divsi3 + ldrh r1, [r4] + adds r1, r0 + strh r1, [r4] + lsls r1, r5, 24 + lsrs r1, 24 + mov r0, r10 + bl sub_8081288 + ldr r1, [r6] + movs r0, 0x93 + lsls r0, 1 + adds r1, r0 + add r1, r9 + ldrh r0, [r1] + adds r0, 0x1 + b _0808165E +_08081632: + ldr r0, =0x00002345 + cmp r4, r0 + bne _0808166A + lsls r1, r5, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_8081288 + adds r0, r4, 0 + bl sub_8081370 + ldr r0, [r6] + movs r1, 0x94 + lsls r1, 1 + adds r0, r1 + mov r2, r9 + adds r1, r0, r2 + ldrh r2, [r1] + ldr r0, =0x000003e6 + cmp r2, r0 + bhi _08081660 + adds r0, r2, 0x1 +_0808165E: + strh r0, [r1] +_08081660: + mov r0, r8 + ldrh r1, [r0, 0x4] + ldr r0, =0x00002345 + cmp r1, r0 + beq _08081678 +_0808166A: + ldr r1, [sp] + ldrh r0, [r1] + ldr r2, =0x00004523 + cmp r0, r2 + beq _08081678 + cmp r0, r10 + bne _080816D2 +_08081678: + ldr r0, =0x020322a4 + ldr r0, [r0] + adds r2, r0, 0 + adds r2, 0x4C + movs r0, 0 + ldrsh r1, [r2, r0] + ldr r0, =0x000005dc + cmp r1, r0 + ble _080816C8 + adds r0, r1, 0 + ldr r2, =0xfffffd12 + adds r0, r2 + movs r1, 0x14 + bl __divsi3 + adds r1, r0, 0 + movs r0, 0x80 + lsls r0, 1 + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =0x03007420 + bl MPlayTempoControl + b _080816D2 + .pool +_080816C8: + ldr r0, =0x03007420 + movs r1, 0x80 + lsls r1, 1 + bl MPlayTempoControl +_080816D2: + ldr r1, [sp] + adds r1, 0x2 + str r1, [sp] + movs r2, 0x6 + add r9, r2 + ldr r0, [sp, 0x4] + adds r0, 0x2 + str r0, [sp, 0x4] + movs r1, 0x10 + add r8, r1 + adds r7, 0x1 + ldr r0, =0x020322a4 + ldr r0, [r0] + adds r0, 0x7C + ldrb r0, [r0] + cmp r7, r0 + bge _080816F6 + b _08081562 +_080816F6: + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0 + beq _08081722 + movs r7, 0 + ldr r3, =0x020322a4 + ldr r0, [r3] + adds r0, 0x7C + ldrb r0, [r0] + cmp r7, r0 + bge _08081722 + movs r2, 0 + ldr r1, =0x03003090 +_08081710: + strh r2, [r1] + strh r2, [r1, 0x4] + adds r1, 0x10 + adds r7, 0x1 + ldr r0, [r3] + adds r0, 0x7C + ldrb r0, [r0] + cmp r7, r0 + blt _08081710 +_08081722: + 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_80814F4 + + thumb_func_start sub_8081744 +sub_8081744: @ 8081744 + push {r4-r6,lr} + movs r4, 0 + movs r6, 0 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _0808175A + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r6, r0, 24 +_0808175A: + ldr r3, =0x020322a4 + ldr r1, [r3] + lsls r2, r6, 1 + adds r0, r1, 0 + adds r0, 0x96 + adds r0, r2 + ldrb r5, [r0] + adds r1, 0x63 + ldrb r0, [r1] + cmp r0, 0 + bne _0808182C + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x2 + bne _080817A8 + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080817B6 + ldrh r2, [r2, 0x28] + ldr r1, =0x00000201 + adds r0, r1, 0 + ands r0, r2 + cmp r0, r1 + beq _080817B6 + b _080817BA + .pool +_080817A8: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080817B6 + movs r4, 0x1 +_080817B6: + cmp r4, 0 + beq _0808182C +_080817BA: + ldr r4, =0x020322a4 + ldr r1, [r4] + lsls r2, r5, 1 + adds r0, r1, 0 + adds r0, 0x8E + adds r0, r2 + adds r1, 0x50 + ldrh r0, [r0] + adds r1, r0 + ldrb r1, [r1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + adds r1, r5, 0x4 + lsls r1, 24 + lsrs r1, 24 + bl StartObjectImageAnim + ldr r0, [r4] + adds r0, 0x4A + ldrh r0, [r0] + adds r1, r6, 0 + bl task_tutorial_oak_boy_girl + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08081810 + ldr r1, =0x03003110 + ldr r0, =0x00004523 + b _08081828 + .pool +_08081810: + cmp r0, 0x1 + bne _08081824 + ldr r1, =0x03003110 + ldr r0, =0x00005432 + b _08081828 + .pool +_08081824: + ldr r1, =0x03003110 + ldr r0, =0x00002345 +_08081828: + strh r0, [r1, 0x4] + adds r3, r4, 0 +_0808182C: + ldr r1, [r3] + adds r1, 0x72 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bls _0808185A + ldr r0, [r3] + adds r1, r0, 0 + adds r1, 0x4C + ldrh r2, [r1] + movs r4, 0 + ldrsh r0, [r1, r4] + cmp r0, 0x80 + ble _08081852 + subs r0, r2, 0x1 + strh r0, [r1] +_08081852: + ldr r0, [r3] + adds r0, 0x72 + movs r1, 0 + strb r1, [r0] +_0808185A: + ldr r0, =0x020322d5 + ldrb r0, [r0] + cmp r0, 0 + beq _0808187E + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _0808187E + ldr r0, [r3] + ldr r1, =0x00000123 + adds r2, r0, r1 + ldrb r0, [r2] + movs r1, 0x1 + eors r0, r1 + strb r0, [r2] +_0808187E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8081744 + + thumb_func_start sub_8081898 +sub_8081898: @ 8081898 + push {r4-r6,lr} + bl sub_8082D28 + ldr r4, =0x020322a4 + ldr r0, [r4] + movs r1, 0x82 + lsls r1, 1 + adds r2, r0, r1 + ldr r1, [r2] + ldr r0, =0x00057e03 + cmp r1, r0 + bhi _080818B4 + adds r0, r1, 0x1 + str r0, [r2] +_080818B4: + bl sub_8081744 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x4C + ldrh r0, [r0] + movs r5, 0x8B + lsls r5, 1 + adds r1, r5 + ldrh r1, [r1] + bl sub_800A994 + bl sub_80814F4 + ldr r0, [r4] + adds r0, r5 + ldrh r0, [r0] + movs r6, 0xFA + lsls r6, 2 + adds r1, r6, 0 + bl sub_8083140 + ldr r0, [r4] + adds r0, 0x4C + ldrh r0, [r0] + bl sub_8083230 + bl sub_808330C + bl sub_8082AD4 + ldr r2, [r4] + adds r3, r2, 0 + adds r3, 0x63 + ldrb r0, [r3] + cmp r0, 0 + bne _0808191A + movs r1, 0x8C + lsls r1, 1 + adds r0, r2, r1 + ldrh r1, [r0] + ldr r0, =0x000003e7 + cmp r1, r0 + bls _0808191A + adds r0, r2, r5 + strh r6, [r0] + movs r0, 0x1 + strb r0, [r3] + ldr r0, =sub_8081FC8 + bl SetMainCallback2 +_0808191A: + ldr r0, =0x020322a4 + ldr r1, [r0] + movs r2, 0x8E + lsls r2, 1 + adds r0, r1, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0x8F + lsls r2, 1 + adds r1, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + bl nullsub_31 + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8081898 + + thumb_func_start nullsub_31 +nullsub_31: @ 8081960 + bx lr + thumb_func_end nullsub_31 + + thumb_func_start help_system_is_not_first_time +help_system_is_not_first_time: @ 8081964 + push {r4,r5,lr} + lsls r1, 24 + lsls r2, 24 + lsrs r1, 20 + adds r4, r1, r0 + lsrs r2, 20 + adds r5, r2, r0 + ldrh r0, [r4] + ldrh r1, [r5] + cmp r0, r1 + bne _080819A2 + adds r0, r4, 0x2 + adds r1, r5, 0x2 + bl CompareString + cmp r0, 0 + bne _080819B0 + ldr r0, [r4, 0x8] + ldr r2, =0xffffff00 + ands r0, r2 + ldr r1, [r5, 0x8] + ands r1, r2 + cmp r0, r1 + bne _080819B0 + ldr r0, [r4, 0xC] + ldr r2, =0x00ffffff + ands r0, r2 + ldr r1, [r5, 0xC] + ands r1, r2 + cmp r0, r1 + bne _080819B0 +_080819A2: + movs r0, 0x1 + b _080819B2 + .pool +_080819B0: + movs r0, 0 +_080819B2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end help_system_is_not_first_time + + thumb_func_start sub_80819B8 +sub_80819B8: @ 80819B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + mov r10, r0 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x10] + lsls r3, 24 + lsrs r3, 24 + mov r2, sp + movs r4, 0x5 +_080819D4: + ldrh r0, [r1] + strh r0, [r2] + adds r1, 0x2 + adds r2, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _080819D4 + movs r6, 0 + mov r1, sp + movs r4, 0x4 +_080819E8: + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _080819F2 + adds r6, 0x1 +_080819F2: + adds r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _080819E8 + cmp r6, 0x5 + beq _08081A46 + cmp r3, 0x3 + bhi _08081A46 + movs r4, 0 + ldr r3, [sp, 0x10] + cmp r4, r3 + bge _08081A5E + mov r3, r10 +_08081A0C: + movs r6, 0 + ldr r7, [sp, 0x10] + cmp r6, r7 + bge _08081A54 + mov r9, r3 + mov r5, r10 + lsls r0, r4, 24 + mov r8, r0 +_08081A1C: + mov r1, r9 + ldrh r0, [r1] + ldrh r2, [r5] + cmp r0, r2 + bne _08081A4A + cmp r4, r6 + beq _08081A4A + cmp r0, 0xAF + bne _08081A46 + lsls r2, r6, 24 + lsrs r2, 24 + mov r0, r10 + mov r7, r8 + lsrs r1, r7, 24 + str r3, [sp, 0xC] + bl help_system_is_not_first_time + lsls r0, 24 + ldr r3, [sp, 0xC] + cmp r0, 0 + beq _08081A4A +_08081A46: + movs r0, 0xC + b _08081B9E +_08081A4A: + adds r5, 0x10 + adds r6, 0x1 + ldr r0, [sp, 0x10] + cmp r6, r0 + blt _08081A1C +_08081A54: + adds r3, 0x10 + adds r4, 0x1 + ldr r1, [sp, 0x10] + cmp r4, r1 + blt _08081A0C +_08081A5E: + movs r2, 0 + mov r1, sp + movs r4, 0x4 +_08081A64: + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + ble _08081A72 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_08081A72: + adds r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _08081A64 + cmp r2, 0x3 + bls _08081A82 + movs r0, 0xD + b _08081B9E +_08081A82: + cmp r2, 0x3 + bne _08081A8A + movs r0, 0xB + b _08081B9E +_08081A8A: + movs r4, 0 + mov r1, sp +_08081A8E: + movs r7, 0 + ldrsh r0, [r1, r7] + cmp r0, 0x32 + ble _08081A98 + b _08081B98 +_08081A98: + adds r1, 0x2 + adds r4, 0x1 + cmp r4, 0x4 + ble _08081A8E + cmp r2, 0x1 + bne _08081AEA + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + ble _08081AB2 + movs r0, 0x1 + b _08081B9E +_08081AB2: + mov r0, sp + ldrh r0, [r0, 0x2] + lsls r0, 16 + cmp r0, 0 + ble _08081AC0 + movs r0, 0x2 + b _08081B9E +_08081AC0: + mov r0, sp + movs r3, 0x4 + ldrsh r0, [r0, r3] + cmp r0, 0 + ble _08081ACE + movs r0, 0x3 + b _08081B9E +_08081ACE: + mov r0, sp + movs r4, 0x6 + ldrsh r0, [r0, r4] + cmp r0, 0 + ble _08081ADC + movs r0, 0x4 + b _08081B9E +_08081ADC: + mov r0, sp + movs r7, 0x8 + ldrsh r0, [r0, r7] + cmp r0, 0 + ble _08081AEA + movs r0, 0x5 + b _08081B9E +_08081AEA: + cmp r2, 0x2 + bne _08081B9C + movs r4, 0 + ldr r5, =0x03000df8 + mov r1, sp + adds r2, r5, 0 +_08081AF6: + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + ble _08081B02 + strh r4, [r2] + adds r2, 0x2 +_08081B02: + adds r1, 0x2 + adds r4, 0x1 + cmp r4, 0x4 + ble _08081AF6 + movs r4, 0 + ldrsh r3, [r5, r4] + lsls r0, r3, 1 + mov r7, sp + adds r1, r7, r0 + movs r0, 0x2 + ldrsh r2, [r5, r0] + lsls r0, r2, 1 + add r0, sp + movs r4, 0 + ldrsh r1, [r1, r4] + movs r7, 0 + ldrsh r0, [r0, r7] + cmp r1, r0 + blt _08081B58 + adds r0, r3, 0 + cmp r0, 0 + bne _08081B38 + lsls r0, r2, 16 + b _08081B62 + .pool +_08081B38: + cmp r0, 0x1 + bne _08081B40 + lsls r0, r2, 16 + b _08081B6E +_08081B40: + cmp r0, 0x2 + bne _08081B48 + lsls r0, r2, 16 + b _08081B7A +_08081B48: + cmp r0, 0x3 + bne _08081B50 + lsls r0, r2, 16 + b _08081B86 +_08081B50: + cmp r0, 0x4 + bne _08081B9C + lsls r0, r2, 16 + b _08081B92 +_08081B58: + movs r2, 0x2 + ldrsh r0, [r5, r2] + cmp r0, 0 + bne _08081B68 + lsls r0, r3, 16 +_08081B62: + movs r1, 0x6 + orrs r0, r1 + b _08081B9E +_08081B68: + cmp r0, 0x1 + bne _08081B74 + lsls r0, r3, 16 +_08081B6E: + movs r1, 0x7 + orrs r0, r1 + b _08081B9E +_08081B74: + cmp r0, 0x2 + bne _08081B80 + lsls r0, r3, 16 +_08081B7A: + movs r1, 0x8 + orrs r0, r1 + b _08081B9E +_08081B80: + cmp r0, 0x3 + bne _08081B8C + lsls r0, r3, 16 +_08081B86: + movs r1, 0x9 + orrs r0, r1 + b _08081B9E +_08081B8C: + cmp r0, 0x4 + bne _08081B9C + lsls r0, r3, 16 +_08081B92: + movs r1, 0xA + orrs r0, r1 + b _08081B9E +_08081B98: + movs r0, 0xE + b _08081B9E +_08081B9C: + movs r0, 0 +_08081B9E: + 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_80819B8 + + thumb_func_start sub_8081BB0 +sub_8081BB0: @ 8081BB0 + ldr r1, =0x03000e04 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_8081BB0 + + thumb_func_start sub_8081BBC +sub_8081BBC: @ 8081BBC + ldr r0, =0x03000e04 + movs r1, 0 + ldrsh r0, [r0, r1] + bx lr + .pool + thumb_func_end sub_8081BBC + + thumb_func_start sub_8081BC8 +sub_8081BC8: @ 8081BC8 + ldr r1, =0x03000e06 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_8081BC8 + + thumb_func_start sub_8081BD4 +sub_8081BD4: @ 8081BD4 + ldr r0, =0x03000e06 + movs r1, 0 + ldrsh r0, [r0, r1] + bx lr + .pool + thumb_func_end sub_8081BD4 + + thumb_func_start sub_8081BE0 +sub_8081BE0: @ 8081BE0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + str r0, [sp] + mov r8, r1 + str r3, [sp, 0x4] + ldr r0, [sp, 0x30] + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x8] + ldr r7, =0x03000de8 + adds r2, r7, 0 + movs r1, 0 + adds r0, r7, 0 + adds r0, 0xA +_08081C0A: + strh r1, [r0] + subs r0, 0x2 + cmp r0, r2 + bge _08081C0A + movs r6, 0 + cmp r6, r9 + bge _08081C40 + ldr r0, =0x03000de8 + mov r12, r0 + ldr r5, [sp] + adds r5, 0x9 +_08081C20: + movs r3, 0 + adds r4, r5, 0 + mov r2, r12 +_08081C26: + adds r1, r4, r3 + ldrh r0, [r2] + ldrb r1, [r1] + adds r0, r1 + strh r0, [r2] + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x5 + ble _08081C26 + adds r5, 0x10 + adds r6, 0x1 + cmp r6, r9 + blt _08081C20 +_08081C40: + movs r1, 0 + ldrsh r3, [r7, r1] + ldrh r0, [r7] + ldrh r1, [r7, 0x2] + subs r0, r1 + strh r0, [r7] + ldrh r0, [r7, 0x4] + subs r1, r0 + strh r1, [r7, 0x2] + ldrh r1, [r7, 0x6] + subs r0, r1 + strh r0, [r7, 0x4] + ldrh r0, [r7, 0x8] + subs r1, r0 + strh r1, [r7, 0x6] + subs r0, r3 + strh r0, [r7, 0x8] + movs r3, 0 + movs r2, 0 + adds r1, r7, 0 + movs r6, 0x4 +_08081C6A: + movs r4, 0 + ldrsh r0, [r1, r4] + cmp r0, 0 + bge _08081C76 + strh r2, [r1] + adds r3, 0x1 +_08081C76: + adds r1, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _08081C6A + lsls r0, r3, 24 + lsrs r0, 24 + mov r10, r0 + movs r4, 0 + ldr r1, =0x03000de8 + movs r6, 0x4 +_08081C8A: + ldrh r2, [r1] + movs r5, 0 + ldrsh r0, [r1, r5] + cmp r0, 0 + ble _08081CA4 + cmp r0, r3 + bge _08081CA0 + strh r4, [r1] + b _08081CA4 + .pool +_08081CA0: + subs r0, r2, r3 + strh r0, [r1] +_08081CA4: + adds r1, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _08081C8A + ldr r1, =0x03000de8 + ldr r2, =0x020322a8 + movs r6, 0x4 +_08081CB2: + movs r3, 0 + ldrsh r0, [r1, r3] + stm r2!, {r0} + adds r1, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _08081CB2 + ldr r1, =0x0000014d + ldr r0, [sp, 0x8] + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + adds r3, r0, 0 + adds r3, 0x64 + ldr r4, =0x020322d0 + str r3, [r4] + movs r6, 0x4 +_08081CD6: + movs r0, 0 + ldrsh r5, [r7, r0] + adds r0, r5, 0 + muls r0, r3 + movs r1, 0xA + str r3, [sp, 0xC] + bl __divsi3 + adds r5, r0, 0 + movs r1, 0xA + bl __modsi3 + adds r4, r0, 0 + adds r0, r5, 0 + movs r1, 0xA + bl __divsi3 + adds r5, r0, 0 + ldr r3, [sp, 0xC] + cmp r4, 0x4 + ble _08081D02 + adds r5, 0x1 +_08081D02: + strh r5, [r7] + adds r7, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _08081CD6 + ldr r1, =0x03000de8 + ldr r2, =0x020322bc + movs r6, 0x4 +_08081D12: + movs r3, 0 + ldrsh r0, [r1, r3] + stm r2!, {r0} + adds r1, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _08081D12 + ldr r4, =0x03000de8 + ldr r0, [sp] + adds r1, r4, 0 + mov r2, r9 + mov r3, r10 + bl sub_80819B8 + mov r5, r8 + strb r0, [r5] + movs r1, 0xA + ldrsh r0, [r4, r1] + mov r1, r9 + bl __divsi3 + mov r3, r9 + subs r0, r3 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bge _08081D4C + movs r0, 0 + strh r0, [r4, 0xA] +_08081D4C: + mov r5, r8 + ldrb r0, [r5] + cmp r0, 0xC + bne _08081DA6 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r3, r0, 16 + movs r6, 0 + ldr r0, =gUnknown_08339CC8 + adds r0, r3, r0 + ldrb r0, [r0] + adds r1, r4, 0 + movs r4, 0x1 + movs r3, 0x2 +_08081D74: + adds r2, r0, 0 + asrs r2, r6 + ands r2, r4 + cmp r2, 0 + beq _08081D9C + strh r3, [r1] + b _08081D9E + .pool +_08081D9C: + strh r2, [r1] +_08081D9E: + adds r1, 0x2 + adds r6, 0x1 + cmp r6, 0x4 + ble _08081D74 +_08081DA6: + ldr r7, =0x03000de8 + movs r2, 0xFF + adds r1, r7, 0 + movs r6, 0x5 +_08081DAE: + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0xFF + ble _08081DB8 + strh r2, [r1] +_08081DB8: + adds r1, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _08081DAE + ldrh r0, [r7] + mov r4, r8 + strb r0, [r4, 0x1] + ldrh r0, [r7, 0x2] + strb r0, [r4, 0x2] + ldrh r0, [r7, 0x4] + strb r0, [r4, 0x3] + ldrh r0, [r7, 0x6] + strb r0, [r4, 0x4] + ldrh r0, [r7, 0x8] + strb r0, [r4, 0x5] + ldrh r0, [r7, 0xA] + strb r0, [r4, 0x6] + movs r6, 0 + adds r2, r7, 0 +_08081DDE: + ldr r5, [sp, 0x4] + adds r1, r5, r6 + ldrh r0, [r2] + strb r0, [r1] + adds r2, 0x2 + adds r6, 0x1 + cmp r6, 0x5 + ble _08081DDE + 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_8081BE0 + + thumb_func_start sub_8081E04 +sub_8081E04: @ 8081E04 + push {r4,lr} + sub sp, 0x4 + ldr r4, [sp, 0xC] + lsls r2, 24 + lsrs r2, 24 + lsls r4, 16 + lsrs r4, 16 + str r4, [sp] + bl sub_8081BE0 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8081E04 + + thumb_func_start sub_8081E20 +sub_8081E20: @ 8081E20 + push {r4-r6,lr} + ldr r0, =0x020322a4 + ldr r0, [r0] + movs r2, 0x82 + lsls r2, 1 + adds r1, r0, r2 + ldrh r1, [r1] + adds r0, 0x4E + ldrh r4, [r0] + movs r2, 0 + ldr r5, =0x00000383 + cmp r1, r5 + bhi _08081E48 + movs r2, 0x5 + b _08081E9A + .pool +_08081E48: + ldr r3, =0xfffffc7c + adds r0, r1, r3 + lsls r0, 16 + lsrs r0, 16 + ldr r3, =0x00000257 + cmp r0, r3 + bhi _08081E64 + movs r2, 0x4 + b _08081E9A + .pool +_08081E64: + ldr r6, =0xfffffa24 + adds r0, r1, r6 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r3 + bhi _08081E78 + movs r2, 0x3 + b _08081E9A + .pool +_08081E78: + ldr r3, =0xfffff7cc + adds r0, r1, r3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r5 + bhi _08081E8C + movs r2, 0x2 + b _08081E9A + .pool +_08081E8C: + ldr r6, =0xfffff31c + adds r0, r1, r6 + lsls r0, 16 + ldr r1, =0x012b0000 + cmp r0, r1 + bhi _08081E9A + movs r2, 0x1 +_08081E9A: + lsls r0, r2, 16 + asrs r0, 16 + bl sub_8081BC8 + movs r2, 0 + cmp r4, 0x40 + bhi _08081F7C + adds r0, r4, 0 + subs r0, 0x32 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081EC4 + ldr r2, =0x0000ffff + b _08081F7C + .pool +_08081EC4: + adds r0, r4, 0 + subs r0, 0x64 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081ED8 + ldr r2, =0x0000fffe + b _08081F7C + .pool +_08081ED8: + adds r0, r4, 0 + subs r0, 0x96 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081EEC + ldr r2, =0x0000fffd + b _08081F7C + .pool +_08081EEC: + adds r0, r4, 0 + subs r0, 0xC8 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081F00 + ldr r2, =0x0000fffc + b _08081F7C + .pool +_08081F00: + adds r0, r4, 0 + subs r0, 0xFA + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081F14 + ldr r2, =0x0000fffb + b _08081F7C + .pool +_08081F14: + ldr r1, =0xfffffea2 + adds r0, r4, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081F2C + ldr r2, =0x0000fffa + b _08081F7C + .pool +_08081F2C: + ldr r3, =0xfffffe70 + adds r0, r4, r3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081F44 + ldr r2, =0x0000fff9 + b _08081F7C + .pool +_08081F44: + ldr r6, =0xfffffe0c + adds r0, r4, r6 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081F5C + ldr r2, =0x0000fff8 + b _08081F7C + .pool +_08081F5C: + ldr r1, =0xfffffdda + adds r0, r4, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bhi _08081F74 + ldr r2, =0x0000fff7 + b _08081F7C + .pool +_08081F74: + ldr r0, =0x00000257 + cmp r4, r0 + bls _08081F7C + ldr r2, =0x0000fff6 +_08081F7C: + lsls r0, r2, 16 + asrs r0, 16 + bl sub_8081BB0 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8081E20 + + thumb_func_start sub_8081F94 +sub_8081F94: @ 8081F94 + push {lr} + adds r1, r0, 0 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _08081FB8 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08081FB8 + movs r2, 0xBC + lsls r2, 6 + b _08081FBA + .pool +_08081FB8: + ldr r2, =0x00002fff +_08081FBA: + adds r0, r2, 0 + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8081F94 + + thumb_func_start sub_8081FC8 +sub_8081FC8: @ 8081FC8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, =0x020322a4 + ldr r0, [r4] + adds r0, 0x63 + ldrb r0, [r0] + cmp r0, 0x2 + bhi _08081FDE + bl sub_8082D28 +_08081FDE: + bl link_get_multiplayer_id + ldr r0, [r4] + adds r0, 0x63 + ldrb r0, [r0] + subs r0, 0x1 + cmp r0, 0xC + bls _08081FF0 + b _0808249E +_08081FF0: + lsls r0, 2 + ldr r1, =_08082004 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08082004: + .4byte _08082038 + .4byte _08082078 + .4byte _080820D4 + .4byte _080821C8 + .4byte _08082278 + .4byte _08082286 + .4byte _080822B0 + .4byte _08082458 + .4byte _080822E4 + .4byte _08082308 + .4byte _080823B0 + .4byte _08082430 + .4byte _0808246C +_08082038: + ldr r0, =0x03007420 + movs r1, 0x80 + lsls r1, 1 + bl MPlayTempoControl + movs r4, 0 + b _08082064 + .pool +_0808204C: + ldr r0, =0x020322a4 + ldr r0, [r0] + movs r1, 0x90 + lsls r1, 1 + adds r0, r1 + adds r0, r4 + ldrb r0, [r0] + bl DestroyTask + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_08082064: + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r4, r0 + bcc _0808204C + b _08082458 + .pool +_08082078: + ldr r4, =0x020322a4 + ldr r1, [r4] + adds r1, 0x4C + ldrh r0, [r1] + subs r0, 0x20 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + bgt _080820C6 + bl sub_8009F8C + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0x4C + movs r0, 0 + strh r0, [r1] + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _080820B0 + adds r1, 0x17 + ldrb r0, [r1] + adds r0, 0x1 + b _080820B6 + .pool +_080820B0: + adds r1, r2, 0 + adds r1, 0x63 + movs r0, 0x5 +_080820B6: + strb r0, [r1] + ldr r0, =0x020322a4 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1] + ldr r0, =0x03007630 + bl MPlayStop_rev01 +_080820C6: + bl sub_807F738 + b _0808249E + .pool +_080820D4: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + beq _080820E0 + b _08082458 +_080820E0: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _080820EC + b _0808249E +_080820EC: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _0808218C + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _0808218C + ldr r3, =0x020322a4 + ldr r1, [r3] + movs r4, 0x8E + lsls r4, 5 + adds r2, r1, r4 + movs r5, 0x82 + lsls r5, 1 + adds r0, r1, r5 + ldr r0, [r0] + str r0, [r2] + adds r0, r1, 0 + adds r0, 0x4E + ldrh r0, [r0] + ldr r2, =0x000011c4 + adds r1, r2 + strh r0, [r1] + movs r4, 0 + mov r8, r3 + mov r12, r8 + ldr r7, =0x000011c8 + movs r6, 0x92 + lsls r6, 1 +_08082128: + movs r3, 0 + adds r5, r4, 0x1 + lsls r0, r4, 1 + adds r0, r4 + lsls r4, r0, 1 +_08082132: + mov r1, r12 + ldr r0, [r1] + lsls r1, r3, 1 + adds r1, r4 + adds r2, r0, r7 + adds r2, r1 + adds r0, r6 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x2 + bls _08082132 + lsls r0, r5, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _08082128 + mov r2, r8 + ldr r1, [r2] + movs r4, 0x8E + lsls r4, 5 + adds r1, r4 + movs r0, 0 + movs r2, 0x20 + bl link_0800A448 + lsls r0, 24 + cmp r0, 0 + bne _08082172 + b _0808249E +_08082172: + mov r5, r8 + ldr r1, [r5] + b _0808245C + .pool +_0808218C: + ldr r4, =0x020322a4 + ldr r3, [r4] + movs r0, 0xCC + lsls r0, 1 + adds r1, r3, r0 + movs r2, 0x82 + lsls r2, 1 + adds r0, r3, r2 + ldr r0, [r0] + str r0, [r1] + adds r0, r3, 0 + adds r0, 0x4E + ldrh r2, [r0] + movs r5, 0xCE + lsls r5, 1 + adds r0, r3, r5 + strh r2, [r0] + movs r0, 0 + movs r2, 0x28 + bl link_0800A448 + lsls r0, 24 + cmp r0, 0 + bne _080821BE + b _0808249E +_080821BE: + ldr r1, [r4] + b _0808245C + .pool +_080821C8: + bl sub_800A550 + lsls r0, 24 + cmp r0, 0 + bne _080821D4 + b _0808249E +_080821D4: + bl sub_800A5B4 + ldr r5, =0x020322a4 + ldr r1, [r5] + adds r1, 0x63 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _08082254 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08082254 + ldr r2, =0x020223c4 + ldr r3, [r5] + ldrh r0, [r2, 0x4] + adds r1, r3, 0 + adds r1, 0x4E + strh r0, [r1] + movs r0, 0x82 + lsls r0, 1 + adds r1, r3, r0 + ldr r0, [r2] + str r0, [r1] + movs r4, 0 + adds r7, r2, 0 + adds r7, 0x8 + adds r6, r5, 0 + movs r2, 0x92 + lsls r2, 1 +_08082216: + movs r3, 0 + adds r5, r4, 0x1 + lsls r0, r4, 1 + adds r0, r4 + lsls r4, r0, 1 +_08082220: + ldr r1, [r6] + lsls r0, r3, 1 + adds r0, r4 + adds r1, r2 + adds r1, r0 + adds r0, r7, r0 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x2 + bls _08082220 + lsls r0, r5, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _08082216 + b _0808249E + .pool +_08082254: + ldr r2, =0x020223c4 + ldr r0, =0x020322a4 + ldr r3, [r0] + ldrh r0, [r2, 0x4] + adds r1, r3, 0 + adds r1, 0x4E + strh r0, [r1] + movs r4, 0x82 + lsls r4, 1 + adds r1, r3, r4 + ldr r0, [r2] + str r0, [r1] + b _0808249E + .pool +_08082278: + bl sub_8083B08 + lsls r0, 24 + cmp r0, 0 + bne _08082284 + b _0808249E +_08082284: + b _08082458 +_08082286: + bl berry_blender_related + lsls r0, 24 + cmp r0, 0 + bne _08082292 + b _0808249E +_08082292: + ldr r0, =0x03005d98 + ldrb r0, [r0] + cmp r0, 0 + bne _080822A8 + movs r0, 0x22 + bl sav12_xor_increment + b _08082458 + .pool +_080822A8: + movs r0, 0x21 + bl sav12_xor_increment + b _08082458 +_080822B0: + ldr r6, =0x020322a4 + ldr r4, [r6] + ldr r5, =0x000011b8 + adds r4, r5 + ldr r5, =gUnknown_08339831 + bl sav2_get_text_speed + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_808417C + cmp r0, 0 + bne _080822D2 + b _0808249E +_080822D2: + ldr r1, [r6] + b _0808245C + .pool +_080822E4: + ldr r4, =0x020322a4 + ldr r0, [r4] + adds r0, 0x9E + movs r1, 0 + strb r1, [r0] + ldr r0, =gUnknown_083399B8 + movs r1, 0x1 + movs r2, 0xD + movs r3, 0 + bl CreateYesNoMenu + ldr r1, [r4] + b _0808245C + .pool +_08082308: + bl sub_8198C58 + lsls r0, 24 + asrs r2, r0, 24 + cmp r2, 0 + beq _0808236C + cmp r2, 0 + bgt _08082322 + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _08082328 + b _0808249E +_08082322: + cmp r2, 0x1 + beq _08082328 + b _0808249E +_08082328: + ldr r2, =0x020322a4 + ldr r0, [r2] + adds r0, 0x9E + movs r1, 0x1 + strb r1, [r0] + ldr r1, [r2] + adds r1, 0x63 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r4, 0 +_0808233E: + ldr r0, =0x020322a4 + ldr r0, [r0] + lsls r1, r4, 1 + adds r0, 0x8E + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0xFF + beq _0808235C + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram +_0808235C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _0808233E + b _0808249E + .pool +_0808236C: + ldr r1, =0x020322a4 + ldr r0, [r1] + adds r0, 0x9E + strb r2, [r0] + ldr r1, [r1] + adds r1, 0x63 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r4, 0 +_08082380: + ldr r0, =0x020322a4 + ldr r0, [r0] + lsls r1, r4, 1 + adds r0, 0x8E + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0xFF + beq _0808239E + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram +_0808239E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _08082380 + b _0808249E + .pool +_080823B0: + ldr r6, =0x03003110 + adds r0, r6, 0 + bl sub_8081F94 + ldr r4, =0x020322a4 + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x9E + ldrb r5, [r0] + cmp r5, 0 + bne _0808241C + movs r0, 0x4 + bl IsBagPocketNonEmpty + lsls r0, 24 + cmp r0, 0 + bne _080823EC + ldr r0, [r4] + adds r0, 0x70 + movs r1, 0x2 + strh r1, [r0] + ldr r0, =0x00009999 + b _08082414 + .pool +_080823EC: + bl sub_8136EF4 + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0808240C + ldr r0, [r4] + adds r0, 0x70 + movs r1, 0x3 + strh r1, [r0] + ldr r0, =0x0000aaaa + b _08082414 + .pool +_0808240C: + ldr r0, [r4] + adds r0, 0x70 + strh r5, [r0] + ldr r0, =0x00007779 +_08082414: + strh r0, [r6, 0x2] + b _08082458 + .pool +_0808241C: + adds r1, r2, 0 + adds r1, 0x70 + movs r0, 0x1 + strh r0, [r1] + ldr r0, =0x00008888 + strh r0, [r6, 0x2] + subs r1, 0xD + b _0808245E + .pool +_08082430: + ldr r0, =0x03005d98 + ldrb r0, [r0] + cmp r0, 0 + beq _08082458 + ldr r0, =sub_8082924 + bl SetMainCallback2 + ldr r2, =0x020322a4 + ldr r0, [r2] + adds r0, 0x63 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + b _0808249C + .pool +_08082458: + ldr r0, =0x020322a4 + ldr r1, [r0] +_0808245C: + adds r1, 0x63 +_0808245E: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0808249E + .pool +_0808246C: + ldr r6, =0x020322a4 + ldr r4, [r6] + ldr r0, =0x000011b8 + adds r4, r0 + ldr r5, =gUnknown_0833981A + bl sav2_get_text_speed + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_808417C + cmp r0, 0 + beq _0808249E + ldr r0, =sub_8082644 + bl SetMainCallback2 + ldr r0, [r6] + adds r0, 0x63 + movs r1, 0 + strb r1, [r0] + ldr r0, [r6] +_0808249C: + strb r1, [r0] +_0808249E: + bl sub_808330C + ldr r4, =0x020322a4 + ldr r0, [r4] + adds r0, 0x4C + ldrh r0, [r0] + bl sub_8083230 + bl sub_8082AD4 + ldr r1, [r4] + movs r2, 0x8E + lsls r2, 1 + adds r0, r1, r2 + movs r4, 0 + ldrsh r0, [r0, r4] + movs r5, 0x8F + lsls r5, 1 + adds r1, r5 + movs r2, 0 + ldrsh r1, [r1, r2] + bl nullsub_31 + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8081FC8 + + thumb_func_start sub_80824FC +sub_80824FC: @ 80824FC + push {r4,lr} + ldr r1, =0x020322a4 + ldr r0, [r1] + movs r2, 0xD0 + lsls r2, 1 + adds r0, r2 + ldr r0, [r0] + adds r4, r1, 0 + cmp r0, 0x6 + bls _08082512 + b _0808263C +_08082512: + lsls r0, 2 + ldr r1, =_08082524 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08082524: + .4byte _08082540 + .4byte _08082558 + .4byte _08082584 + .4byte _08082594 + .4byte _080825BA + .4byte _08082600 + .4byte _0808261A +_08082540: + bl sub_800ADF8 + ldr r0, =0x020322a4 + ldr r2, [r0] + movs r3, 0xD0 + lsls r3, 1 + adds r1, r2, r3 + movs r0, 0x1 + b _0808260C + .pool +_08082558: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0808263C + ldr r0, =0x020322a4 + ldr r1, [r0] + movs r2, 0xD0 + lsls r2, 1 + adds r1, r2 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r1, =0x03002700 + movs r0, 0x1 + strb r0, [r1] + b _0808263C + .pool +_08082584: + bl sub_8153430 + ldr r0, =0x020322a4 + ldr r2, [r0] + b _08082602 + .pool +_08082594: + ldr r1, [r4] + movs r2, 0x84 + lsls r2, 1 + adds r1, r2 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + cmp r0, 0xA + bne _0808263C + bl sub_800ADF8 + ldr r1, [r4] + movs r3, 0xD0 + lsls r3, 1 + adds r1, r3 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + b _0808263C +_080825BA: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0808263C + bl sub_8153474 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _080825E4 + ldr r0, =0x020322a4 + ldr r0, [r0] + movs r1, 0xD0 + lsls r1, 1 + adds r0, r1 + movs r1, 0x5 + str r1, [r0] + b _0808263C + .pool +_080825E4: + ldr r0, =0x020322a4 + ldr r1, [r0] + movs r3, 0x84 + lsls r3, 1 + adds r0, r1, r3 + str r2, [r0] + movs r0, 0xD0 + lsls r0, 1 + adds r1, r0 + movs r0, 0x3 + str r0, [r1] + b _0808263C + .pool +_08082600: + ldr r2, [r4] +_08082602: + movs r3, 0xD0 + lsls r3, 1 + adds r1, r2, r3 + ldr r0, [r1] + adds r0, 0x1 +_0808260C: + str r0, [r1] + movs r0, 0x84 + lsls r0, 1 + adds r1, r2, r0 + movs r0, 0 + str r0, [r1] + b _0808263C +_0808261A: + ldr r1, [r4] + movs r2, 0x84 + lsls r2, 1 + adds r1, r2 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + cmp r0, 0x5 + ble _0808263C + ldr r1, =0x03002700 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + b _0808263E + .pool +_0808263C: + movs r0, 0 +_0808263E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80824FC + + thumb_func_start sub_8082644 +sub_8082644: @ 8082644 + push {r4-r6,lr} + sub sp, 0x4 + ldr r1, =0x020322a4 + ldr r0, [r1] + adds r0, 0x63 + ldrb r0, [r0] + adds r6, r1, 0 + cmp r0, 0xC + bls _08082658 + b _080828DC +_08082658: + lsls r0, 2 + ldr r1, =_0808266C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0808266C: + .4byte _080826A0 + .4byte _080826EC + .4byte _0808271C + .4byte _08082754 + .4byte _0808278C + .4byte _080827AA + .4byte _080827C8 + .4byte _080827FC + .4byte _08082818 + .4byte _08082828 + .4byte _0808284C + .4byte _080828A4 + .4byte _080828C6 +_080826A0: + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0x64 + ldrh r2, [r0] + ldr r0, =0x00002222 + cmp r2, r0 + bne _080826B0 + b _080827A2 +_080826B0: + ldr r0, =0x00001111 + cmp r2, r0 + beq _080826B8 + b _080828DC +_080826B8: + adds r0, r1, 0 + adds r0, 0x6C + ldrh r2, [r0] + ldr r0, =0x00009999 + cmp r2, r0 + bne _080826D8 + adds r1, 0x63 + movs r0, 0x2 + strb r0, [r1] + b _080828DC + .pool +_080826D8: + ldr r0, =0x0000aaaa + cmp r2, r0 + bne _080827A2 + adds r1, 0x63 + movs r0, 0x1 + strb r0, [r1] + b _080828DC + .pool +_080826EC: + ldr r0, [r6] + adds r0, 0x63 + movs r1, 0x3 + strb r1, [r0] + ldr r4, =0x02021fc4 + ldr r0, [r6] + adds r0, 0x6E + ldrh r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r0, =0x020229f0 + adds r1, r0 + adds r0, r4, 0 + bl CopyString + ldr r1, =gUnknown_083398DD + b _08082740 + .pool +_0808271C: + ldr r1, [r6] + adds r1, 0x63 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r4, =0x02021fc4 + ldr r0, [r6] + adds r0, 0x6E + ldrh r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r0, =0x020229f0 + adds r1, r0 + adds r0, r4, 0 + bl CopyString + ldr r1, =gUnknown_083398B0 +_08082740: + adds r0, r4, 0 + bl AppendString + b _080828DC + .pool +_08082754: + ldr r4, [r6] + ldr r0, =0x000011b8 + adds r4, r0 + ldr r5, =0x02021fc4 + bl sav2_get_text_speed + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_808417C + cmp r0, 0 + bne _08082774 + b _080828DC +_08082774: + ldr r1, [r6] + movs r0, 0x84 + lsls r0, 1 + adds r2, r1, r0 + movs r0, 0 + str r0, [r2] + b _080828BC + .pool +_0808278C: + ldr r4, [r6] + movs r2, 0x84 + lsls r2, 1 + adds r1, r4, r2 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + cmp r0, 0x3C + bgt _080827A0 + b _080828DC +_080827A0: + adds r1, r4, 0 +_080827A2: + adds r1, 0x63 + movs r0, 0x5 + strb r0, [r1] + b _080828DC +_080827AA: + ldr r0, [r6] + ldr r1, =0x000011b8 + adds r0, r1 + ldr r1, =gUnknown_085EE42D + movs r2, 0 + bl sub_808417C + bl sub_800ADF8 + b _080828BA + .pool +_080827C8: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _080827D4 + b _080828DC +_080827D4: + ldr r3, =0x020322a4 + ldr r1, [r3] + movs r2, 0x84 + lsls r2, 1 + adds r0, r1, r2 + movs r2, 0 + str r2, [r0] + adds r1, 0x63 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r3] + movs r1, 0xD0 + lsls r1, 1 + adds r0, r1 + str r2, [r0] + b _080828DC + .pool +_080827FC: + bl sub_80824FC + lsls r0, 24 + cmp r0, 0 + beq _080828DC + movs r0, 0x37 + bl audio_play + ldr r0, =0x020322a4 + ldr r1, [r0] + b _080828BC + .pool +_08082818: + ldr r1, [r6] + adds r1, 0x63 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bl sub_800ADF8 + b _080828DC +_08082828: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080828DC + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x020322a4 + ldr r1, [r0] + b _080828BC + .pool +_0808284C: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080828DC + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0x64 + ldrh r1, [r0] + ldr r0, =0x00002222 + cmp r1, r0 + bne _08082898 + bl FreeAllWindowBuffers + movs r0, 0x2 + bl UnsetBgTilemapBuffer + movs r0, 0x1 + bl UnsetBgTilemapBuffer + ldr r0, [r6] + bl Free + str r4, [r6] + ldr r0, =sub_807FA80 + bl SetMainCallback2 + b _080828DC + .pool +_08082898: + movs r1, 0x84 + lsls r1, 1 + adds r0, r2, r1 + str r4, [r0] + adds r1, r2, 0 + b _080828BC +_080828A4: + ldr r1, [r6] + movs r2, 0x84 + lsls r2, 1 + adds r1, r2 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + cmp r0, 0x1E + ble _080828DC + bl sub_800AC34 +_080828BA: + ldr r1, [r6] +_080828BC: + adds r1, 0x63 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080828DC +_080828C6: + ldr r0, =0x03003124 + ldrb r4, [r0] + cmp r4, 0 + bne _080828DC + ldr r0, [r6] + bl Free + str r4, [r6] + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 +_080828DC: + bl sub_8082AD4 + ldr r0, =0x020322a4 + ldr r1, [r0] + movs r2, 0x8E + lsls r2, 1 + adds r0, r1, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0x8F + lsls r2, 1 + adds r1, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + bl nullsub_31 + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8082644 + + thumb_func_start sub_8082924 +sub_8082924: @ 8082924 + push {r4-r6,lr} + ldr r1, =0x020322a4 + ldr r0, [r1] + adds r0, 0x63 + ldrb r0, [r0] + adds r6, r1, 0 + cmp r0, 0xA + bls _08082936 + b _08082A92 +_08082936: + lsls r0, 2 + ldr r1, =_08082948 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08082948: + .4byte _08082974 + .4byte _080829AA + .4byte _080829D4 + .4byte _08082A00 + .4byte _08082A92 + .4byte _08082A92 + .4byte _08082A92 + .4byte _08082A92 + .4byte _08082A92 + .4byte _08082A30 + .4byte _08082A48 +_08082974: + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0x70 + ldrh r0, [r0] + cmp r0, 0x1 + bhi _08082986 + adds r1, 0x63 + movs r0, 0x9 + strb r0, [r1] +_08082986: + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0x70 + ldrh r1, [r0] + cmp r1, 0x2 + bne _08082996 + subs r0, 0xD + strb r1, [r0] +_08082996: + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0x70 + ldrh r0, [r0] + cmp r0, 0x3 + bne _08082A92 + adds r1, 0x63 + movs r0, 0x1 + strb r0, [r1] + b _08082A92 +_080829AA: + ldr r0, [r6] + adds r0, 0x63 + movs r2, 0 + movs r1, 0x3 + strb r1, [r0] + ldr r0, [r6] + ldr r1, =0x000011b8 + adds r0, r1 + strh r2, [r0] + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_08339896 + bl CopyString + b _08082A92 + .pool +_080829D4: + ldr r1, [r6] + adds r1, 0x63 + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + ldr r0, [r6] + ldr r1, =0x000011b8 + adds r0, r1 + strh r2, [r0] + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_08339858 + bl CopyString + b _08082A92 + .pool +_08082A00: + ldr r4, [r6] + ldr r2, =0x000011b8 + adds r4, r2 + ldr r5, =0x02021fc4 + bl sav2_get_text_speed + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_808417C + cmp r0, 0 + beq _08082A92 + ldr r0, [r6] + adds r0, 0x63 + movs r1, 0x9 + strb r1, [r0] + b _08082A92 + .pool +_08082A30: + movs r0, 0x3 + bl sub_80A2390 + ldr r0, =0x020322a4 + ldr r1, [r0] + adds r1, 0x63 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08082A92 + .pool +_08082A48: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08082A92 + ldr r0, [r6] + adds r0, 0x70 + ldrh r0, [r0] + cmp r0, 0 + bne _08082A70 + ldr r0, =sub_807FA80 + bl SetMainCallback2 + b _08082A76 + .pool +_08082A70: + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 +_08082A76: + bl FreeAllWindowBuffers + movs r0, 0x2 + bl UnsetBgTilemapBuffer + movs r0, 0x1 + bl UnsetBgTilemapBuffer + ldr r4, =0x020322a4 + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] +_08082A92: + bl sub_8082AD4 + ldr r0, =0x020322a4 + ldr r1, [r0] + movs r2, 0x8E + lsls r2, 1 + adds r0, r1, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0x8F + lsls r2, 1 + adds r1, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + bl nullsub_31 + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8082924 + + thumb_func_start sub_8082AD4 +sub_8082AD4: @ 8082AD4 + push {r4-r7,lr} + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08082AE0 + b _08082CA4 +_08082AE0: + ldr r4, =0x03003090 + ldrh r0, [r4] + ldr r1, =0x00002fff + movs r2, 0xBC + lsls r2, 6 + bl sub_80814B0 + cmp r0, 0 + beq _08082B66 + ldrh r1, [r4, 0x2] + ldr r0, =0x00001111 + cmp r1, r0 + bne _08082B58 + ldrh r3, [r4, 0x4] + ldr r0, =0x00009999 + cmp r3, r0 + beq _08082B38 + cmp r3, r0 + bgt _08082B24 + ldr r0, =0x00008888 + b _08082B26 + .pool +_08082B24: + ldr r0, =0x0000aaaa +_08082B26: + cmp r3, r0 + beq _08082B38 + ldr r2, =0x020322a4 + b _08082B48 + .pool +_08082B38: + ldr r2, =0x020322a4 + ldr r0, [r2] + adds r1, r0, 0 + adds r1, 0x6C + strh r3, [r1] + ldrh r1, [r4, 0x6] + adds r0, 0x6E + strh r1, [r0] +_08082B48: + ldr r0, [r2] + adds r0, 0x64 + ldr r1, =0x00001111 + b _08082B64 + .pool +_08082B58: + ldr r0, =0x00002222 + cmp r1, r0 + bne _08082B66 + ldr r0, =0x020322a4 + ldr r0, [r0] + adds r0, 0x64 +_08082B64: + strh r1, [r0] +_08082B66: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + beq _08082B72 + b _08082CA4 +_08082B72: + ldr r2, =0x020322a4 + ldr r0, [r2] + adds r0, 0x64 + ldrh r1, [r0] + ldr r0, =0x00001111 + cmp r1, r0 + bne _08082B82 + b _08082CA4 +_08082B82: + ldr r0, =0x00002222 + cmp r1, r0 + bne _08082B8A + b _08082CA4 +_08082B8A: + movs r5, 0 + adds r7, r2, 0 + b _08082BF4 + .pool +_08082B9C: + ldr r6, =0x03003090 + lsls r4, r5, 4 + adds r0, r4, r6 + ldrh r0, [r0] + ldr r1, =0x00002fff + movs r2, 0xBC + lsls r2, 6 + bl sub_80814B0 + cmp r0, 0 + beq _08082BEE + adds r0, r6, 0x2 + adds r0, r4, r0 + ldrh r2, [r0] + ldr r0, =0x00008888 + cmp r2, r0 + beq _08082BE4 + cmp r2, r0 + bgt _08082BD8 + ldr r0, =0x00007779 + b _08082BE0 + .pool +_08082BD8: + ldr r0, =0x00009999 + cmp r2, r0 + beq _08082BE4 + ldr r0, =0x0000aaaa +_08082BE0: + cmp r2, r0 + bne _08082BEE +_08082BE4: + ldr r0, [r7] + lsls r1, r5, 1 + adds r0, 0x64 + adds r0, r1 + strh r2, [r0] +_08082BEE: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_08082BF4: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bcc _08082B9C + movs r5, 0 + b _08082C12 + .pool +_08082C0C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_08082C12: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bcs _08082C2E + ldr r0, =0x020322a4 + ldr r0, [r0] + lsls r1, r5, 1 + adds r0, 0x64 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _08082C0C +_08082C2E: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bne _08082CA4 + movs r5, 0 + ldr r4, =0x00007779 + b _08082C4E + .pool +_08082C48: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_08082C4E: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bcs _08082C6A + ldr r0, =0x020322a4 + ldr r0, [r0] + lsls r1, r5, 1 + adds r0, 0x64 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r4 + beq _08082C48 +_08082C6A: + ldr r4, =0x03003110 + adds r0, r4, 0 + bl sub_8081F94 + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bne _08082C90 + ldr r0, =0x00002222 + strh r0, [r4, 0x2] + b _08082CA4 + .pool +_08082C90: + ldr r0, =0x00001111 + strh r0, [r4, 0x2] + ldr r0, =0x020322a4 + ldr r0, [r0] + lsls r1, r5, 1 + adds r0, 0x64 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r4, 0x4] + strh r5, [r4, 0x6] +_08082CA4: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8082AD4 + + thumb_func_start sub_8082CB4 +sub_8082CB4: @ 8082CB4 + push {r4,lr} + sub sp, 0x14 + movs r1, 0xF0 + lsls r1, 7 + str r1, [sp] + movs r1, 0xA0 + lsls r1, 7 + str r1, [sp, 0x4] + mov r3, sp + ldr r1, =0x020322a4 + ldr r1, [r1] + mov r12, r1 + movs r1, 0x8E + lsls r1, 1 + add r1, r12 + ldrh r2, [r1] + movs r1, 0x78 + subs r1, r2 + strh r1, [r3, 0x8] + movs r1, 0x8F + lsls r1, 1 + add r1, r12 + ldrh r2, [r1] + movs r1, 0x50 + subs r1, r2 + strh r1, [r3, 0xA] + mov r2, sp + movs r3, 0x8D + lsls r3, 1 + add r3, r12 + ldrh r1, [r3] + strh r1, [r2, 0xC] + ldrh r1, [r3] + strh r1, [r2, 0xE] + mov r1, r12 + adds r1, 0x4A + ldrh r1, [r1] + strh r1, [r2, 0x10] + mov r1, sp + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + ldm r1!, {r2,r3} + stm r0!, {r2,r3} + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8082CB4 + + thumb_func_start sub_8082D18 +sub_8082D18: @ 8082D18 + ldr r0, =0x020322a4 + ldr r0, [r0] + adds r0, 0x4A + ldrh r0, [r0] + bx lr + .pool + thumb_func_end sub_8082D18 + + thumb_func_start sub_8082D28 +sub_8082D28: @ 8082D28 + push {r4,lr} + movs r1, 0 + ldr r4, =0x03003124 + ldrb r0, [r4] + cmp r0, 0 + beq _08082D3C + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r1, r0, 24 +_08082D3C: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08082DCC + ldrb r0, [r4] + cmp r0, 0 + beq _08082DCC + cmp r1, 0 + bne _08082D90 + ldr r0, =0x020322a4 + ldr r3, [r0] + adds r2, r3, 0 + adds r2, 0x4A + adds r0, r3, 0 + adds r0, 0x4C + ldrh r0, [r0] + ldrh r1, [r2] + adds r0, r1 + strh r0, [r2] + ldr r1, =0x03003110 + movs r4, 0x8B + lsls r4, 1 + adds r0, r3, r4 + ldrh r0, [r0] + strh r0, [r1, 0xA] + ldrh r0, [r2] + strh r0, [r1, 0xC] + movs r1, 0xA0 + lsls r1, 1 + adds r0, r3, r1 + bl sub_8082CB4 + b _08082DEA + .pool +_08082D90: + ldr r3, =0x03003090 + ldrh r0, [r3] + movs r1, 0xFF + lsls r1, 8 + ands r1, r0 + movs r0, 0x88 + lsls r0, 7 + cmp r1, r0 + bne _08082DEA + ldr r0, =0x020322a4 + ldr r2, [r0] + ldrh r0, [r3, 0xA] + movs r4, 0x8B + lsls r4, 1 + adds r1, r2, r4 + strh r0, [r1] + ldrh r0, [r3, 0xC] + adds r1, r2, 0 + adds r1, 0x4A + strh r0, [r1] + movs r1, 0xA0 + lsls r1, 1 + adds r0, r2, r1 + bl sub_8082CB4 + b _08082DEA + .pool +_08082DCC: + ldr r0, =0x020322a4 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x4A + adds r0, r1, 0 + adds r0, 0x4C + ldrh r0, [r0] + ldrh r3, [r2] + adds r0, r3 + strh r0, [r2] + movs r4, 0xA0 + lsls r4, 1 + adds r0, r1, r4 + bl sub_8082CB4 +_08082DEA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8082D28 + + thumb_func_start sub_8082DF4 +sub_8082DF4: @ 8082DF4 + push {r4-r6,lr} + ldr r4, =0x020322a4 + ldr r0, [r4] + movs r6, 0x8E + lsls r6, 1 + adds r0, r6 + ldrh r1, [r0] + movs r0, 0x14 + bl SetGpuReg + ldr r0, [r4] + movs r5, 0x8F + lsls r5, 1 + adds r0, r5 + ldrh r1, [r0] + movs r0, 0x16 + bl SetGpuReg + ldr r0, [r4] + adds r0, r6 + ldrh r1, [r0] + movs r0, 0x10 + bl SetGpuReg + ldr r0, [r4] + adds r0, r5 + ldrh r1, [r0] + movs r0, 0x12 + bl SetGpuReg + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8082DF4 + + thumb_func_start sub_8082E3C +sub_8082E3C: @ 8082E3C + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x32] + adds r0, r1 + strh r0, [r2, 0x32] + ldrh r0, [r2, 0x30] + ldrh r1, [r2, 0x34] + adds r0, r1 + strh r0, [r2, 0x34] + movs r1, 0x32 + ldrsh r0, [r2, r1] + cmp r0, 0 + bge _08082E5A + adds r0, 0x7 +_08082E5A: + asrs r0, 3 + strh r0, [r2, 0x24] + movs r1, 0x34 + ldrsh r0, [r2, r1] + cmp r0, 0 + bge _08082E68 + adds r0, 0x7 +_08082E68: + asrs r0, 3 + strh r0, [r2, 0x26] + adds r0, r2, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08082E80 + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles +_08082E80: + pop {r0} + bx r0 + thumb_func_end sub_8082E3C + + thumb_func_start sub_8082E84 +sub_8082E84: @ 8082E84 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r1, r0, 16 + movs r0, 0x1 + ands r1, r0 + adds r0, r1, 0x1 + cmp r0, 0 + beq _08082F40 + ldr r0, =gUnknown_08329F40 + mov r9, r0 + ldr r2, =0x02020630 + mov r10, r2 + adds r6, r1, 0x1 + movs r3, 0x1F + mov r8, r3 + movs r7, 0x10 +_08082EB0: + bl GenerateRandomNumber + ldr r1, =0x020322a4 + ldr r4, [r1] + adds r4, 0x4A + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x14 + bl __umodsi3 + ldrh r1, [r4] + adds r1, r0 + lsls r1, 16 + movs r0, 0xFF + lsls r0, 16 + ands r0, r1 + lsrs r2, r0, 16 + adds r0, r2, 0 + adds r0, 0x40 + lsls r0, 1 + add r0, r9 + movs r3, 0 + ldrsh r1, [r0, r3] + cmp r1, 0 + bge _08082EE4 + adds r1, 0x3 +_08082EE4: + asrs r1, 2 + lsls r0, r2, 1 + add r0, r9 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bge _08082EF4 + adds r0, 0x3 +_08082EF4: + asrs r2, r0, 2 + adds r1, 0x78 + adds r2, 0x50 + ldr r0, =gUnknown_08339BE0 + movs r3, 0x1 + bl AddObjectToFront + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl GenerateRandomNumber + lsls r5, r4, 4 + adds r5, r4 + lsls r5, 2 + mov r3, r10 + adds r4, r5, r3 + lsls r0, 16 + lsrs r0, 16 + mov r1, r8 + ands r0, r1 + subs r0, r7, r0 + strh r0, [r4, 0x2E] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + mov r2, r8 + ands r0, r2 + subs r0, r7, r0 + strh r0, [r4, 0x30] + ldr r3, =0x0202064c + adds r5, r3 + ldr r0, =sub_8082E3C + str r0, [r5] + subs r6, 0x1 + cmp r6, 0 + bne _08082EB0 +_08082F40: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8082E84 + + thumb_func_start sub_8082F68 +sub_8082F68: @ 8082F68 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x3 + bl __divsi3 + negs r0, r0 + strh r0, [r4, 0x26] + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08082F94 + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_08082F94: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8082F68 + + thumb_func_start sub_8082F9C +sub_8082F9C: @ 8082F9C + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + movs r1, 0x2E + ldrsh r0, [r2, r1] + lsls r0, 1 + negs r0, r0 + strh r0, [r2, 0x26] + lsls r0, 16 + asrs r0, 16 + movs r1, 0xC + negs r1, r1 + cmp r0, r1 + bge _08082FC0 + ldr r0, =0x0000fff4 + strh r0, [r2, 0x26] +_08082FC0: + adds r0, r2, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08082FD4 + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles +_08082FD4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8082F9C + + thumb_func_start sub_8082FDC +sub_8082FDC: @ 8082FDC + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + ldr r2, =0x020322a4 + ldr r3, [r2] + lsls r4, r0, 1 + adds r2, r3, 0 + adds r2, 0x74 + adds r2, r4 + strh r1, [r2] + lsls r0, 4 + movs r2, 0xAC + lsls r2, 1 + adds r0, r2 + adds r3, r0 + adds r0, r3, 0 + bl sub_807FE14 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8082FDC + + thumb_func_start sub_8083010 +sub_8083010: @ 8083010 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0808304C + cmp r0, 0x1 + bgt _08083026 + cmp r0, 0 + beq _0808302C + b _080830B2 +_08083026: + cmp r0, 0x2 + beq _08083066 + b _080830B2 +_0808302C: + ldrh r0, [r4, 0x30] + adds r0, 0x8 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x58 + ble _080830B2 + movs r0, 0x58 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0x38 + bl audio_play + b _080830B2 +_0808304C: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _080830B2 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0 + strh r0, [r4, 0x32] + b _080830B2 +_08083066: + ldrh r0, [r4, 0x30] + adds r0, 0x4 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB0 + ble _080830B2 + ldrh r0, [r4, 0x34] + adds r0, 0x1 + adds r1, r0, 0 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _080830A0 + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + ldr r0, =gUnknown_08339C60 + movs r2, 0x14 + negs r2, r2 + movs r1, 0x78 + movs r3, 0x2 + bl AddObjectToFront + b _080830B2 + .pool +_080830A0: + movs r0, 0 + strh r0, [r4, 0x2E] + ldr r0, =0x0000fff0 + strh r0, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim +_080830B2: + ldrh r0, [r4, 0x30] + strh r0, [r4, 0x26] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8083010 + + thumb_func_start sub_80830C0 +sub_80830C0: @ 80830C0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080830FC + cmp r0, 0x1 + bgt _080830D6 + cmp r0, 0 + beq _080830DC + b _08083130 +_080830D6: + cmp r0, 0x2 + beq _08083112 + b _08083130 +_080830DC: + ldrh r0, [r4, 0x30] + adds r0, 0x8 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5C + ble _08083130 + movs r0, 0x5C + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0x15 + bl audio_play + b _08083130 +_080830FC: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _08083130 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _08083130 +_08083112: + ldrh r0, [r4, 0x30] + adds r0, 0x4 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB0 + ble _08083130 + ldr r0, =0x020322a4 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_08083130: + ldrh r0, [r4, 0x30] + strh r0, [r4, 0x26] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80830C0 + + thumb_func_start sub_8083140 +sub_8083140: @ 8083140 + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r3, r1, 16 + ldr r1, =0x020322a4 + ldr r1, [r1] + movs r2, 0x8C + lsls r2, 1 + adds r1, r2 + ldrh r2, [r1] + cmp r2, r0 + bcs _08083166 + adds r0, r2, 0x2 + strh r0, [r1] + ldrh r0, [r1] + adds r1, r3, 0 + bl sub_8083170 +_08083166: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8083140 + + thumb_func_start sub_8083170 +sub_8083170: @ 8083170 + push {r4-r7,lr} + lsls r0, 16 + lsls r1, 16 + lsrs r1, 16 + ldr r7, =0x06006000 + lsrs r0, 10 + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bge _08083188 + adds r0, r1, 0x7 +_08083188: + asrs r4, r0, 3 + movs r3, 0 + cmp r3, r4 + bge _080831B0 + ldr r0, =0x000080e9 + adds r6, r0, 0 + adds r0, 0x10 + adds r5, r0, 0 + adds r2, r7, 0 + adds r2, 0x56 + adds r0, r7, 0 + adds r3, r4, 0 +_080831A0: + strh r6, [r0, 0x16] + strh r5, [r2] + adds r2, 0x2 + adds r0, 0x2 + subs r3, 0x1 + cmp r3, 0 + bne _080831A0 + adds r3, r4, 0 +_080831B0: + adds r0, r1, 0 + cmp r1, 0 + bge _080831B8 + adds r0, r1, 0x7 +_080831B8: + asrs r2, r0, 3 + lsls r0, r2, 3 + subs r2, r1, r0 + cmp r2, 0 + beq _080831D6 + lsls r0, r3, 1 + adds r0, r7 + ldr r4, =0xffff80e1 + adds r1, r2, r4 + strh r1, [r0, 0x16] + adds r0, 0x56 + adds r4, 0x10 + adds r1, r2, r4 + strh r1, [r0] + adds r3, 0x1 +_080831D6: + cmp r3, 0x7 + bgt _080831FA + ldr r0, =0x000080e1 + adds r4, r0, 0 + adds r0, 0x10 + adds r2, r0, 0 + lsls r1, r3, 1 + adds r0, r1, 0 + adds r0, 0x56 + adds r0, r7 + adds r1, r7 +_080831EC: + strh r4, [r1, 0x16] + strh r2, [r0] + adds r0, 0x2 + adds r1, 0x2 + adds r3, 0x1 + cmp r3, 0x7 + ble _080831EC +_080831FA: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8083170 + + thumb_func_start sub_8083210 +sub_8083210: @ 8083210 + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x00057e40 + muls r0, r1 + cmp r0, 0 + bge _08083222 + ldr r1, =0x0000ffff + adds r0, r1 +_08083222: + asrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8083210 + + thumb_func_start sub_8083230 +sub_8083230: @ 8083230 + push {r4-r6,lr} + sub sp, 0x8 + lsls r0, 16 + lsrs r0, 16 + bl sub_8083210 + adds r5, r0, 0 + ldr r0, =0x020322a4 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x4E + ldrh r0, [r1] + cmp r0, r5 + bcs _0808324E + strh r5, [r1] +_0808324E: + movs r6, 0 +_08083250: + mov r0, sp + adds r4, r0, r6 + adds r0, r5, 0 + movs r1, 0xA + bl __umodsi3 + strb r0, [r4] + adds r0, r5, 0 + movs r1, 0xA + bl __udivsi3 + adds r5, r0, 0 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x4 + bls _08083250 + ldr r2, =0x06006458 + mov r0, sp + ldr r3, =0x00008072 + adds r1, r3, 0 + ldrb r0, [r0, 0x4] + adds r0, r1, r0 + strh r0, [r2] + adds r2, 0x2 + mov r0, sp + ldrb r0, [r0, 0x3] + adds r0, r1 + strh r0, [r2] + adds r2, 0x2 + mov r0, sp + ldrb r0, [r0, 0x2] + adds r0, r1 + strh r0, [r2] + adds r2, 0x4 + mov r0, sp + ldrb r0, [r0, 0x1] + adds r0, r1 + strh r0, [r2] + adds r2, 0x2 + mov r0, sp + ldrb r0, [r0] + adds r1, r0 + strh r1, [r2] + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8083230 + + thumb_func_start sub_80832BC +sub_80832BC: @ 80832BC + push {r4-r6,lr} + adds r6, r0, 0 + lsls r4, r1, 16 + lsrs r5, r4, 16 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _080832E0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __umodsi3 + lsrs r1, r4, 17 + subs r0, r1 + strh r0, [r6] +_080832E0: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80832BC + + thumb_func_start sub_80832E8 +sub_80832E8: @ 80832E8 + push {lr} + adds r1, r0, 0 + ldrh r2, [r1] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + bge _080832FA + adds r0, r2, 0x1 + strh r0, [r1] +_080832FA: + ldrh r2, [r1] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + ble _08083308 + subs r0, r2, 0x1 + strh r0, [r1] +_08083308: + pop {r0} + bx r0 + thumb_func_end sub_80832E8 + + thumb_func_start sub_808330C +sub_808330C: @ 808330C + push {r4,lr} + ldr r4, =0x020322a4 + ldr r0, [r4] + movs r1, 0x8E + lsls r1, 1 + adds r0, r1 + bl sub_80832E8 + ldr r0, [r4] + movs r1, 0x8F + lsls r1, 1 + adds r0, r1 + bl sub_80832E8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808330C + + thumb_func_start sub_8083334 +sub_8083334: @ 8083334 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r1, 16 + movs r5, 0x8 + cmp r1, 0x9 + bhi _08083344 + movs r5, 0x10 +_08083344: + ldrh r0, [r4] + movs r2, 0 + ldrsh r1, [r4, r2] + cmp r1, 0 + bne _08083362 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __modsi3 + lsrs r1, r5, 1 + subs r0, r1 + b _08083376 +_08083362: + cmp r1, 0 + bge _0808336A + adds r0, 0x1 + strh r0, [r4] +_0808336A: + ldrh r1, [r4] + movs r2, 0 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _08083378 + subs r0, r1, 0x1 +_08083376: + strh r0, [r4] +_08083378: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8083334 + + thumb_func_start sub_8083380 +sub_8083380: @ 8083380 + push {r4,r5,lr} + ldr r5, =0x020322a4 + ldr r2, [r5] + movs r4, 0x84 + lsls r4, 1 + adds r0, r2, r4 + ldr r1, [r0] + cmp r1, 0 + bne _080833A0 + movs r3, 0x8E + lsls r3, 1 + adds r0, r2, r3 + strh r1, [r0] + adds r3, 0x2 + adds r0, r2, r3 + strh r1, [r0] +_080833A0: + ldr r0, [r5] + adds r2, r0, r4 + ldr r1, [r2] + adds r1, 0x1 + str r1, [r2] + movs r2, 0x8E + lsls r2, 1 + adds r0, r2 + lsls r1, 16 + lsrs r1, 16 + bl sub_8083334 + ldr r1, [r5] + movs r3, 0x8F + lsls r3, 1 + adds r0, r1, r3 + adds r1, r4 + ldrh r1, [r1] + bl sub_8083334 + ldr r2, [r5] + adds r0, r2, r4 + ldr r0, [r0] + cmp r0, 0x14 + beq _080833DC + movs r0, 0 + b _080833F0 + .pool +_080833DC: + movs r1, 0x8E + lsls r1, 1 + adds r0, r2, r1 + movs r1, 0 + strh r1, [r0] + movs r3, 0x8F + lsls r3, 1 + adds r0, r2, r3 + strh r1, [r0] + movs r0, 0x1 +_080833F0: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8083380 + + thumb_func_start sub_80833F8 +sub_80833F8: @ 80833F8 + ldr r1, =0x020322a4 + ldr r2, [r1] + movs r3, 0x8E + lsls r3, 1 + adds r1, r2, r3 + ldrh r1, [r1] + negs r1, r1 + strh r1, [r0, 0x24] + adds r3, 0x2 + adds r1, r2, r3 + ldrh r1, [r1] + negs r1, r1 + strh r1, [r0, 0x26] + bx lr + .pool + thumb_func_end sub_80833F8 + + thumb_func_start UpdateBerryBlenderRecord +@ void UpdateBerryBlenderRecord() +UpdateBerryBlenderRecord: @ 8083418 + push {lr} + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r0, =0x020322a4 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x7C + ldrb r0, [r0] + subs r0, 0x2 + lsls r0, 1 + ldr r3, =0x000009bc + adds r2, r3 + adds r2, r0 + adds r1, 0x4E + ldrh r1, [r1] + ldrh r0, [r2] + cmp r0, r1 + bcs _0808343E + strh r1, [r2] +_0808343E: + pop {r0} + bx r0 + .pool + thumb_func_end UpdateBerryBlenderRecord + + thumb_func_start berry_blender_related +berry_blender_related: @ 8083450 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4C + ldr r1, =0x020322a4 + ldr r0, [r1] + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0x6 + bls _0808346A + b _08083898 +_0808346A: + lsls r0, 2 + ldr r1, =_0808347C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0808347C: + .4byte _08083498 + .4byte _080834AE + .4byte _080834C8 + .4byte _08083518 + .4byte _08083790 + .4byte _080837A8 + .4byte _0808386C +_08083498: + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r4] + movs r1, 0x84 + lsls r1, 1 + adds r0, r1 + movs r1, 0x11 + str r1, [r0] + b _08083898 +_080834AE: + ldr r1, [r4] + movs r3, 0x84 + lsls r3, 1 + adds r2, r1, r3 + ldr r0, [r2] + subs r0, 0xA + str r0, [r2] + cmp r0, 0 + blt _080834C2 + b _08083898 +_080834C2: + movs r0, 0 + str r0, [r2] + b _08083854 +_080834C8: + ldr r1, [r4] + movs r0, 0x84 + lsls r0, 1 + adds r1, r0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + cmp r0, 0x14 + bgt _080834DC + b _08083898 +_080834DC: + movs r6, 0 +_080834DE: + ldr r4, =0x020322a4 + ldr r0, [r4] + adds r0, 0x46 + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x2 + bls _080834DE + ldr r1, [r4] + movs r3, 0x84 + lsls r3, 1 + adds r2, r1, r3 + movs r0, 0 + str r0, [r2] + b _08083854 + .pool +_08083518: + ldr r4, =gUnknown_083398F5 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xA8 + bl GetStringCenterAlignXOffset + lsls r2, r0, 24 + lsrs r2, 24 + movs r0, 0xFF + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + movs r0, 0x5 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_80840D4 + ldr r1, =0x020322a4 + ldr r0, [r1] + adds r2, r0, 0 + adds r2, 0x7C + ldrb r0, [r2] + movs r3, 0x15 + mov r9, r3 + cmp r0, 0x4 + bne _08083550 + movs r0, 0x11 + mov r9, r0 +_08083550: + movs r6, 0 + mov r3, sp + adds r3, 0x10 + str r3, [sp, 0x48] + ldrb r2, [r2] + cmp r6, r2 + bcs _0808361A + adds r7, r1, 0 + movs r0, 0x3 + mov r10, r0 +_08083564: + ldr r0, [r7] + movs r2, 0x9E + lsls r2, 1 + adds r1, r0, r2 + adds r1, r6 + ldrb r5, [r1] + adds r0, 0x9F + adds r6, 0x1 + mov r8, r6 + mov r1, r8 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalString + ldr r0, [r7] + adds r0, 0x9F + ldr r1, =gUnknown_08339941 + bl AppendString + ldr r0, [r7] + adds r0, 0x9F + ldr r1, =gUnknown_085E8D5E + bl AppendString + ldr r0, [r7] + adds r0, 0x9F + lsls r4, r5, 3 + subs r4, r5 + lsls r4, 2 + ldr r3, =0x020229f0 + adds r1, r4, r3 + bl AppendString + ldr r1, [r7] + adds r1, 0x9F + mov r0, r9 + lsls r6, r0, 24 + lsrs r6, 24 + movs r2, 0xFF + str r2, [sp] + mov r3, r10 + str r3, [sp, 0x4] + movs r0, 0x5 + movs r2, 0x8 + adds r3, r6, 0 + bl sub_80840D4 + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0x9F + lsls r5, 4 + adds r5, r1 + movs r1, 0xAD + lsls r1, 1 + adds r5, r1 + adds r1, r5, 0 + bl CopyString + ldr r0, [r7] + adds r0, 0x9F + ldr r2, =0x020229e8 + adds r4, r2 + ldrb r1, [r4, 0x1A] + bl StopMusicWhileStringIsPrinted + ldr r0, [r7] + adds r0, 0x9F + ldr r1, =gUnknown_08339914 + bl AppendString + ldr r1, [r7] + adds r1, 0x9F + movs r3, 0xFF + str r3, [sp] + mov r0, r10 + str r0, [sp, 0x4] + movs r0, 0x5 + movs r2, 0x54 + adds r3, r6, 0 + bl sub_80840D4 + movs r1, 0x10 + add r9, r1 + mov r2, r8 + lsls r2, 16 + lsrs r6, r2, 16 + ldr r0, [r7] + adds r0, 0x7C + ldrb r0, [r0] + cmp r6, r0 + bcc _08083564 +_0808361A: + ldr r1, =gUnknown_0833992E + movs r3, 0xFF + mov r10, r3 + str r3, [sp] + movs r0, 0x3 + mov r9, r0 + str r0, [sp, 0x4] + movs r0, 0x5 + movs r2, 0 + movs r3, 0x51 + bl sub_80840D4 + ldr r6, =0x020322a4 + ldr r0, [r6] + adds r4, r0, 0 + adds r4, 0x9F + adds r0, 0x4E + ldrh r0, [r0] + movs r1, 0x64 + bl __udivsi3 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r0, [r6] + adds r0, 0x9F + ldr r1, =gUnknown_08339941 + bl AppendString + ldr r0, [r6] + adds r0, 0x4E + ldrh r0, [r0] + movs r1, 0x64 + bl __umodsi3 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x48] + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r0, [r6] + adds r0, 0x9F + ldr r1, [sp, 0x48] + bl AppendString + ldr r0, [r6] + adds r0, 0x9F + ldr r1, =gUnknown_0833993C + bl AppendString + ldr r1, [r6] + adds r1, 0x9F + movs r0, 0x1 + movs r2, 0xA8 + bl GetStringRightAlignXOffset + ldr r1, [r6] + adds r1, 0x9F + lsls r2, r0, 24 + lsrs r2, 24 + mov r3, r10 + str r3, [sp] + mov r0, r9 + str r0, [sp, 0x4] + movs r0, 0x5 + movs r3, 0x51 + bl sub_80840D4 + ldr r1, =gUnknown_0833991B + mov r2, r10 + str r2, [sp] + mov r3, r9 + str r3, [sp, 0x4] + movs r0, 0x5 + movs r2, 0 + movs r3, 0x61 + bl sub_80840D4 + ldr r5, [r6] + movs r1, 0x82 + lsls r1, 1 + adds r0, r5, r1 + ldr r0, [r0] + mov r8, r0 + movs r1, 0x3C + bl __udivsi3 + movs r1, 0x3C + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r1, 0xE1 + lsls r1, 4 + mov r0, r8 + bl __udivsi3 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r5, 0x9F + adds r0, r5, 0 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r0, [r6] + adds r0, 0x9F + ldr r1, =gUnknown_08339921 + bl AppendString + adds r1, r4, 0 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r0, [r6] + adds r0, 0x9F + ldr r1, =gUnknown_08339928 + bl AppendString + ldr r1, [r6] + adds r1, 0x9F + movs r0, 0x1 + movs r2, 0xA8 + bl GetStringRightAlignXOffset + ldr r1, [r6] + adds r1, 0x9F + lsls r2, r0, 24 + lsrs r2, 24 + mov r3, r10 + str r3, [sp] + mov r0, r9 + str r0, [sp, 0x4] + movs r0, 0x5 + movs r3, 0x61 + bl sub_80840D4 + ldr r1, [r6] + movs r3, 0x84 + lsls r3, 1 + adds r2, r1, r3 + movs r0, 0 + str r0, [r2] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0x5 + movs r1, 0x2 + bl CopyWindowToVram + b _08083898 + .pool +_08083790: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0808379E + b _08083898 +_0808379E: + ldr r1, [r4] + b _08083854 + .pool +_080837A8: + movs r0, 0x5 + movs r1, 0x1 + bl sub_8198070 + movs r6, 0 + add r7, sp, 0x40 + ldr r5, =0x020322a4 +_080837B6: + ldr r0, [r5] + lsls r2, r6, 1 + adds r0, 0x74 + adds r0, r2 + ldrh r1, [r0] + cmp r1, 0 + beq _080837CC + add r0, sp, 0x38 + adds r0, r2 + subs r1, 0x85 + strh r1, [r0] +_080837CC: + ldr r0, [r5] + adds r0, 0x8E + adds r0, r2 + ldrh r0, [r0] + cmp r0, 0xFF + beq _080837EA + lsls r4, r6, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram +_080837EA: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x3 + bls _080837B6 + bl sub_8081E20 + ldr r4, =0x020322a4 + ldr r3, [r4] + movs r1, 0xAC + lsls r1, 1 + adds r0, r3, r1 + adds r1, r3, 0 + adds r1, 0x7C + ldrb r2, [r1] + subs r1, 0x2E + ldrh r1, [r1] + str r1, [sp] + adds r1, r7, 0 + add r3, sp, 0x8 + bl sub_8081BE0 + ldr r1, [r4] + adds r1, 0x9F + adds r0, r7, 0 + bl sub_80838AC + ldr r1, [r4] + movs r2, 0xD4 + lsls r2, 1 + adds r1, r2 + adds r0, r7, 0 + bl sub_8083F94 + ldr r0, =sub_8083F3C + movs r1, 0x6 + bl CreateTask + bl sub_80EECEC + ldr r0, =0x0203ce7c + ldrh r0, [r0] + movs r1, 0x1 + bl remove_item + adds r0, r7, 0 + bl sub_8136F2C + ldr r1, [r4] + ldr r3, =0x000011b8 + adds r2, r1, r3 + movs r0, 0 + strh r0, [r2] +_08083854: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08083898 + .pool +_0808386C: + ldr r4, [r4] + ldr r0, =0x000011b8 + adds r5, r4, r0 + adds r4, 0x9F + bl sav2_get_text_speed + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_808417C + cmp r0, 0 + beq _08083898 + bl UpdateBerryBlenderRecord + movs r0, 0x1 + b _0808389A + .pool +_08083898: + movs r0, 0 +_0808389A: + add sp, 0x4C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end berry_blender_related + + thumb_func_start sub_80838AC +sub_80838AC: @ 80838AC + push {r4-r6,lr} + sub sp, 0xC + adds r5, r0, 0 + adds r6, r1, 0 + movs r0, 0xFF + strb r0, [r6] + ldr r1, =gUnknown_085B262C + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r6, 0 + bl CopyString + ldr r1, =gUnknown_0833979D + adds r0, r6, 0 + bl AppendString + ldr r1, =gUnknown_08339943 + adds r0, r6, 0 + bl AppendString + adds r0, r5, 0 + bl sub_8136EA4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + bl sub_8136EDC + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =gUnknown_0833994F + adds r0, r6, 0 + bl AppendString + mov r0, sp + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r0, r6, 0 + mov r1, sp + bl AppendString + ldr r1, =gUnknown_0833995D + adds r0, r6, 0 + bl AppendString + mov r0, sp + adds r1, r5, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r0, r6, 0 + mov r1, sp + bl AppendString + ldr r1, =gUnknown_08339970 + adds r0, r6, 0 + bl AppendString + ldr r1, =gUnknown_0833979B + adds r0, r6, 0 + bl AppendString + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80838AC + + thumb_func_start sub_808395C +sub_808395C: @ 808395C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r0 + mov r12, r2 + lsls r1, 24 + lsrs r7, r1, 24 + movs r0, 0 + cmp r0, r7 + bge _080839A8 +_08083972: + movs r5, 0 + adds r1, r0, 0x1 + mov r8, r1 + cmp r5, r7 + bge _080839A2 + mov r1, r9 + adds r6, r1, r0 +_08083980: + ldrb r4, [r6] + lsls r1, r4, 2 + add r1, r12 + mov r0, r9 + adds r2, r0, r5 + ldrb r3, [r2] + lsls r0, r3, 2 + add r0, r12 + ldr r1, [r1] + ldr r0, [r0] + cmp r1, r0 + bls _0808399C + strb r3, [r6] + strb r4, [r2] +_0808399C: + adds r5, 0x1 + cmp r5, r7 + blt _08083980 +_080839A2: + mov r0, r8 + cmp r0, r7 + blt _08083972 +_080839A8: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_808395C + + thumb_func_start sub_80839B4 +sub_80839B4: @ 80839B4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + movs r5, 0 + ldr r2, =0x020322a4 + ldr r0, [r2] + adds r0, 0x7C + adds r1, r2, 0 + add r3, sp, 0x4 + mov r10, r3 + b _080839E4 + .pool +_080839D4: + mov r4, sp + adds r0, r4, r5 + strb r5, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r2] + adds r0, 0x7C +_080839E4: + ldrb r0, [r0] + cmp r5, r0 + bcc _080839D4 + movs r5, 0 + ldr r0, [r1] + adds r1, r0, 0 + adds r1, 0x7C + ldrb r2, [r1] + cmp r5, r2 + bcs _08083A5E + mov r9, r10 + movs r3, 0x92 + lsls r3, 1 + adds r3, r0 + mov r8, r3 + mov r12, r1 + movs r4, 0x93 + lsls r4, 1 + adds r7, r0, r4 + movs r1, 0x94 + lsls r1, 1 + adds r6, r0, r1 +_08083A10: + lsls r4, r5, 2 + add r4, r9 + lsls r3, r5, 1 + adds r3, r5 + lsls r3, 1 + mov r2, r8 + adds r0, r2, r3 + ldrh r2, [r0] + lsls r0, r2, 5 + subs r0, r2 + lsls r1, r0, 6 + subs r1, r0 + lsls r1, 3 + adds r1, r2 + lsls r1, 6 + str r1, [r4] + adds r0, r7, r3 + ldrh r2, [r0] + lsls r0, r2, 5 + subs r0, r2 + lsls r0, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + str r1, [r4] + movs r0, 0xFA + lsls r0, 2 + adds r1, r0 + adds r3, r6, r3 + ldrh r0, [r3] + subs r1, r0 + str r1, [r4] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + mov r1, r12 + ldrb r1, [r1] + cmp r5, r1 + bcc _08083A10 +_08083A5E: + ldr r4, =0x020322a4 + ldr r0, [r4] + adds r0, 0x7C + ldrb r1, [r0] + mov r0, sp + mov r2, r10 + bl sub_808395C + movs r5, 0 + ldr r0, [r4] + adds r0, 0x7C + ldrb r0, [r0] + cmp r5, r0 + bcs _08083A9E + adds r2, r4, 0 + movs r3, 0x9E + lsls r3, 1 +_08083A80: + ldr r1, [r2] + adds r1, r3 + adds r1, r5 + mov r4, sp + adds r0, r4, r5 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r2] + adds r0, 0x7C + ldrb r0, [r0] + cmp r5, r0 + bcc _08083A80 +_08083A9E: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08083AB4 + movs r3, 0 + b _08083ABC + .pool +_08083AB4: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r3, r0, 24 +_08083ABC: + movs r5, 0 + ldr r1, =0x020322a4 + ldr r0, [r1] + adds r0, 0x7C + ldrb r0, [r0] + cmp r5, r0 + bcs _08083AF2 + movs r6, 0x9E + lsls r6, 1 + movs r4, 0xD2 + lsls r4, 1 +_08083AD2: + ldr r2, [r1] + adds r0, r2, r6 + adds r0, r5 + ldrb r0, [r0] + cmp r0, r3 + bne _08083AE2 + adds r0, r2, r4 + strb r5, [r0] +_08083AE2: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r1] + adds r0, 0x7C + ldrb r0, [r0] + cmp r5, r0 + bcc _08083AD2 +_08083AF2: + 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_80839B4 + + thumb_func_start sub_8083B08 +sub_8083B08: @ 8083B08 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldr r1, =0x020322a4 + ldr r0, [r1] + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x6 + bls _08083B22 + b _08083E12 +_08083B22: + lsls r0, 2 + ldr r1, =_08083B34 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08083B34: + .4byte _08083B50 + .4byte _08083B66 + .4byte _08083B80 + .4byte _08083B9A + .4byte _08083DC8 + .4byte _08083DE2 + .4byte _08083E08 +_08083B50: + ldr r1, [r2] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r2] + movs r1, 0x84 + lsls r1, 1 + adds r0, r1 + movs r1, 0xFF + str r1, [r0] + b _08083E12 +_08083B66: + ldr r1, [r2] + movs r3, 0x84 + lsls r3, 1 + adds r2, r1, r3 + ldr r0, [r2] + subs r0, 0xA + str r0, [r2] + cmp r0, 0 + blt _08083B7A + b _08083E12 +_08083B7A: + movs r0, 0 + str r0, [r2] + b _08083DF8 +_08083B80: + ldr r1, [r2] + movs r0, 0x84 + lsls r0, 1 + adds r2, r1, r0 + ldr r0, [r2] + adds r0, 0x1 + str r0, [r2] + cmp r0, 0x14 + bgt _08083B94 + b _08083E12 +_08083B94: + movs r0, 0 + str r0, [r2] + b _08083DF8 +_08083B9A: + movs r0, 0x5 + movs r1, 0 + movs r2, 0x1 + movs r3, 0xD + bl SetWindowBorderStyle + ldr r4, =gUnknown_08339947 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xA8 + bl GetStringCenterAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0xFF + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + movs r0, 0x5 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_80840D4 + ldr r1, =gUnknown_08339B40 + mov r8, r1 + mov r0, r8 + movs r1, 0x80 + movs r2, 0x34 + movs r3, 0 + bl AddObjectToFront + ldr r7, =0x020322a4 + ldr r1, [r7] + adds r1, 0x46 + strb r0, [r1] + ldr r0, [r7] + adds r0, 0x46 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r6, =0x02020630 + adds r0, r6 + movs r1, 0x3 + bl StartObjectImageAnim + ldr r0, [r7] + adds r0, 0x46 + 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, =DummyObjectCallback + str r4, [r0] + mov r0, r8 + movs r1, 0xA0 + movs r2, 0x34 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0x47 + strb r0, [r1] + ldr r0, [r7] + adds r0, 0x47 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + str r4, [r0] + mov r0, r8 + movs r1, 0xC0 + movs r2, 0x34 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0x48 + strb r0, [r1] + ldr r0, [r7] + adds r0, 0x48 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x1 + bl StartObjectImageAnim + ldr r0, [r7] + adds r0, 0x48 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + str r4, [r0] + bl sub_80839B4 + movs r2, 0x29 + str r2, [sp, 0x8] + movs r2, 0 + ldr r0, [r7] + adds r0, 0x7C + ldrb r0, [r0] + cmp r2, r0 + bcc _08083C7C + b _08083D8A +_08083C7C: + movs r3, 0xFF + mov r10, r3 + movs r0, 0x3 + mov r9, r0 +_08083C84: + ldr r0, [r7] + movs r3, 0x9E + lsls r3, 1 + adds r1, r0, r3 + adds r1, r2 + ldrb r5, [r1] + adds r0, 0x9F + adds r2, 0x1 + mov r8, r2 + mov r1, r8 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalString + ldr r0, [r7] + adds r0, 0x9F + ldr r1, =gUnknown_08339941 + bl AppendString + ldr r0, [r7] + adds r0, 0x9F + ldr r1, =gUnknown_085E8D5E + bl AppendString + ldr r0, [r7] + adds r0, 0x9F + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + ldr r2, =0x020229f0 + adds r1, r2 + bl AppendString + ldr r1, [r7] + adds r1, 0x9F + ldr r0, [sp, 0x8] + lsls r6, r0, 24 + lsrs r6, 24 + mov r2, r10 + str r2, [sp] + mov r3, r9 + str r3, [sp, 0x4] + movs r0, 0x5 + movs r2, 0 + adds r3, r6, 0 + bl sub_80840D4 + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0x9F + lsls r4, r5, 1 + adds r4, r5 + lsls r4, 1 + movs r2, 0x92 + lsls r2, 1 + adds r1, r2 + adds r1, r4 + ldrh r1, [r1] + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r1, [r7] + adds r1, 0x9F + mov r3, r10 + str r3, [sp] + mov r0, r9 + str r0, [sp, 0x4] + movs r0, 0x5 + movs r2, 0x4E + adds r3, r6, 0 + bl sub_80840D4 + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0x9F + movs r2, 0x93 + lsls r2, 1 + adds r1, r2 + adds r1, r4 + ldrh r1, [r1] + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r1, [r7] + adds r1, 0x9F + mov r3, r10 + str r3, [sp] + mov r0, r9 + str r0, [sp, 0x4] + movs r0, 0x5 + movs r2, 0x6E + adds r3, r6, 0 + bl sub_80840D4 + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0x9F + movs r2, 0x94 + lsls r2, 1 + adds r1, r2 + adds r1, r4 + ldrh r1, [r1] + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r1, [r7] + adds r1, 0x9F + mov r3, r10 + str r3, [sp] + mov r0, r9 + str r0, [sp, 0x4] + movs r0, 0x5 + movs r2, 0x8E + adds r3, r6, 0 + bl sub_80840D4 + ldr r1, [sp, 0x8] + adds r1, 0x10 + str r1, [sp, 0x8] + mov r2, r8 + lsls r2, 16 + lsrs r2, 16 + ldr r0, [r7] + adds r0, 0x7C + ldrb r0, [r0] + cmp r2, r0 + bcs _08083D8A + b _08083C84 +_08083D8A: + movs r0, 0x5 + bl PutWindowTilemap + movs r0, 0x5 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =0x020322a4 + ldr r1, [r0] + movs r3, 0x84 + lsls r3, 1 + adds r2, r1, r3 + movs r0, 0 + str r0, [r2] + b _08083DF8 + .pool +_08083DC8: + ldr r2, [r2] + movs r0, 0x84 + lsls r0, 1 + adds r1, r2, r0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + cmp r0, 0x14 + ble _08083E12 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + b _08083E12 +_08083DE2: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08083E12 + movs r0, 0x5 + bl audio_play + ldr r0, =0x020322a4 + ldr r1, [r0] +_08083DF8: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08083E12 + .pool +_08083E08: + ldr r1, [r2] + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + b _08083E14 +_08083E12: + movs r0, 0 +_08083E14: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8083B08 + + thumb_func_start ShowBerryBlenderRecordWindow +ShowBerryBlenderRecordWindow: @ 8083E24 + push {r4-r7,lr} + sub sp, 0x34 + ldr r0, =gUnknown_08339D14 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x2C] + str r1, [sp, 0x30] + ldr r5, =0x0203ab74 + add r0, sp, 0x2C + bl AddWindow + strb r0, [r5] + ldrb r0, [r5] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r5] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r6, =gUnknown_085EE44F + movs r0, 0x1 + adds r1, r6, 0 + movs r2, 0x90 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + ldrb r0, [r5] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x1 + str r1, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + adds r2, r6, 0 + bl Print + ldrb r0, [r5] + ldr r2, =gUnknown_085EE473 + movs r1, 0x29 + str r1, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x4 + bl Print + movs r6, 0 + movs r7, 0xA4 + lsls r7, 22 +_08083E8A: + ldr r0, =0x03005d8c + ldr r0, [r0] + lsls r1, r6, 1 + ldr r2, =0x000009bc + adds r0, r2 + adds r0, r1 + ldrh r4, [r0] + adds r0, r4, 0 + movs r1, 0x64 + bl __udivsi3 + adds r1, r0, 0 + add r0, sp, 0xC + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r5, r0, 0 + ldr r1, =gUnknown_08339941 + bl AppendString + adds r5, r0, 0 + adds r0, r4, 0 + movs r1, 0x64 + bl __umodsi3 + adds r1, r0, 0 + adds r0, r5, 0 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + adds r5, r0, 0 + ldr r1, =gUnknown_0833993C + bl AppendString + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x8C + bl GetStringRightAlignXOffset + adds r3, r0, 0 + ldr r4, =0x0203ab74 + ldrb r0, [r4] + lsls r3, 24 + lsrs r3, 24 + lsrs r1, r7, 24 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + add r2, sp, 0xC + bl Print + movs r0, 0x80 + lsls r0, 21 + adds r7, r0 + adds r6, 0x1 + cmp r6, 0x2 + ble _08083E8A + ldrb r0, [r4] + bl PutWindowTilemap + ldrb r0, [r4] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0x34 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ShowBerryBlenderRecordWindow + + thumb_func_start sub_8083F3C +sub_8083F3C: @ 8083F3C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08083F62 + ldr r0, =0x0000016f + bl fanfare_play + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_08083F62: + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + beq _08083F82 + ldr r0, =0x020322a4 + ldr r0, [r0] + movs r1, 0xAA + lsls r1, 1 + adds r0, r1 + ldrh r0, [r0] + bl song_play_for_text + adds r0, r5, 0 + bl DestroyTask +_08083F82: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8083F3C + + thumb_func_start sub_8083F94 +sub_8083F94: @ 8083F94 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r6, r0, 0 + adds r7, r1, 0 + bl sub_8136EA4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + bl sub_8136EDC + adds r1, r0, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 1 + lsls r1, 24 + lsrs r1, 24 + bl __divsi3 + lsls r0, 16 + lsrs r3, r0, 16 + strb r3, [r7, 0xD] + ldrb r0, [r6] + strb r0, [r7, 0xC] + movs r0, 0xFF + strb r0, [r7] + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _080840C4 + ldr r0, =0x020322a4 + ldr r2, [r0] + movs r4, 0xD2 + lsls r4, 1 + adds r1, r2, r4 + ldrb r1, [r1] + mov r8, r0 + cmp r1, 0 + bne _08084058 + cmp r3, 0x14 + bls _08084058 + adds r0, r2, 0 + adds r0, 0x7C + ldrb r1, [r0] + subs r1, 0x1 + movs r0, 0x9E + lsls r0, 1 + mov r9, r0 + adds r0, r2, r0 + adds r0, r1 + ldrb r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r5, =0x020229f0 + adds r1, r5 + adds r0, r7, 0 + bl CopyString + adds r0, r6, 0 + bl sub_81370B4 + strb r0, [r7, 0xB] + ldrb r1, [r7, 0xB] + ldrb r2, [r7, 0xC] + ldrb r3, [r7, 0xD] + mov r6, r8 + ldr r4, [r6] + adds r0, r4, 0 + adds r0, 0x7C + ldrb r0, [r0] + subs r0, 0x1 + add r4, r9 + adds r4, r0 + ldrb r4, [r4] + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r5, r0 + ldrb r0, [r5, 0x12] + str r0, [sp] + adds r0, r7, 0 + bl sub_80ECC04 + lsls r0, 24 + cmp r0, 0 + bne _080840BA + b _080840C4 + .pool +_08084058: + mov r0, r8 + ldr r2, [r0] + movs r1, 0xD2 + lsls r1, 1 + adds r0, r2, r1 + ldrb r1, [r0] + adds r0, r2, 0 + adds r0, 0x7C + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _080840C4 + cmp r3, 0x14 + bhi _080840C4 + movs r4, 0x9E + lsls r4, 1 + adds r0, r2, r4 + ldrb r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r5, =0x020229f0 + adds r1, r5 + adds r0, r7, 0 + bl CopyString + adds r0, r6, 0 + bl sub_81370B4 + strb r0, [r7, 0xB] + ldrb r1, [r7, 0xB] + ldrb r2, [r7, 0xC] + ldrb r3, [r7, 0xD] + mov r6, r8 + ldr r0, [r6] + adds r0, r4 + ldrb r4, [r0] + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r5, r0 + ldrb r0, [r5, 0x12] + str r0, [sp] + adds r0, r7, 0 + bl sub_80ECC04 + lsls r0, 24 + cmp r0, 0 + beq _080840C4 +_080840BA: + movs r0, 0x1 + b _080840C6 + .pool +_080840C4: + movs r0, 0 +_080840C6: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8083F94 + + thumb_func_start sub_80840D4 +sub_80840D4: @ 80840D4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + mov r9, r1 + ldr r4, [sp, 0x38] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r7, r3, 24 + movs r5, 0 + cmp r4, 0x1 + beq _08084116 + cmp r4, 0x1 + bgt _08084100 + cmp r4, 0 + beq _08084108 + b _08084132 +_08084100: + cmp r4, 0x2 + beq _08084124 + cmp r4, 0x3 + bne _08084136 +_08084108: + add r1, sp, 0x14 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + movs r0, 0x3 + b _08084130 +_08084116: + add r0, sp, 0x14 + strb r5, [r0] + adds r1, r0, 0 + movs r0, 0x2 + strb r0, [r1, 0x1] + movs r0, 0x3 + b _08084130 +_08084124: + add r0, sp, 0x14 + strb r5, [r0] + adds r1, r0, 0 + movs r0, 0x4 + strb r0, [r1, 0x1] + movs r0, 0x5 +_08084130: + strb r0, [r1, 0x2] +_08084132: + cmp r4, 0x3 + beq _08084148 +_08084136: + add r0, sp, 0x14 + ldrb r0, [r0] + lsls r1, r0, 4 + orrs r1, r0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl FillWindowPixelBuffer +_08084148: + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + add r0, sp, 0x14 + str r0, [sp, 0x8] + ldr r0, [sp, 0x34] + lsls r0, 24 + asrs r0, 24 + str r0, [sp, 0xC] + mov r0, r9 + str r0, [sp, 0x10] + adds r0, r6, 0 + movs r1, 0x1 + mov r2, r8 + adds r3, r7, 0 + bl AddTextPrinterParametrized2 + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80840D4 + + thumb_func_start sub_808417C +sub_808417C: @ 808417C + push {r4-r7,lr} + sub sp, 0x8 + adds r5, r0, 0 + adds r7, r1, 0 + adds r6, r2, 0 + movs r0, 0 + ldrsh r4, [r5, r0] + cmp r4, 0 + beq _08084194 + cmp r4, 0x1 + beq _080841C6 + b _080841DA +_08084194: + movs r0, 0x4 + movs r1, 0 + movs r2, 0x14 + movs r3, 0xF + bl sub_8197B1C + str r6, [sp] + str r4, [sp, 0x4] + movs r0, 0x4 + adds r1, r7, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_80840D4 + movs r0, 0x4 + bl PutWindowTilemap + movs r0, 0x4 + movs r1, 0x3 + bl CopyWindowToVram + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + b _080841DA +_080841C6: + movs r0, 0x4 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _080841DA + strh r0, [r5] + movs r0, 0x1 + b _080841DC +_080841DA: + movs r0, 0 +_080841DC: + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808417C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/berry_tag_screen.s b/asm/berry_tag_screen.s new file mode 100644 index 000000000..64f8a69e1 --- /dev/null +++ b/asm/berry_tag_screen.s @@ -0,0 +1,1538 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8177C14 +sub_8177C14: @ 8177C14 + push {r4,lr} + ldr r4, =0x0203bcf4 + ldr r0, =0x0000180c + bl AllocZeroed + str r0, [r4] + ldr r0, =0x0203ce7c + ldrh r0, [r0] + bl ItemIdToBerryType + ldr r1, [r4] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0xC0 + lsls r2, 5 + adds r1, r2 + strh r0, [r1] + ldr r0, =sub_8177C84 + bl SetMainCallback2 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8177C14 + + thumb_func_start sub_8177C54 +sub_8177C54: @ 8177C54 + push {lr} + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl do_scheduled_bg_tilemap_copies_to_vram + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_8177C54 + + thumb_func_start sub_8177C70 +sub_8177C70: @ 8177C70 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8177C70 + + thumb_func_start sub_8177C84 +sub_8177C84: @ 8177C84 + push {lr} +_08177C86: + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08177CAA + bl sub_8177CB0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08177CAA + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08177C86 +_08177CAA: + pop {r0} + bx r0 + thumb_func_end sub_8177C84 + + thumb_func_start sub_8177CB0 +sub_8177CB0: @ 8177CB0 + push {lr} + sub sp, 0x4 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xF + bls _08177CC4 + b _08177DF4 +_08177CC4: + lsls r0, 2 + ldr r1, =_08177CD8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08177CD8: + .4byte _08177D18 + .4byte _08177D26 + .4byte _08177D2C + .4byte _08177D40 + .4byte _08177D46 + .4byte _08177D4C + .4byte _08177D5C + .4byte _08177D78 + .4byte _08177D84 + .4byte _08177D8A + .4byte _08177D90 + .4byte _08177D96 + .4byte _08177D9C + .4byte _08177DA6 + .4byte _08177DB4 + .4byte _08177DC2 +_08177D18: + bl SetVBlankHBlankCallbacksToNull + bl sub_8121DA0 + bl clear_scheduled_bg_copies_to_vram + b _08177DDC +_08177D26: + bl remove_some_task + b _08177DDC +_08177D2C: + bl sub_80A1A74 + ldr r2, =0x02037fd4 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + b _08177DDA + .pool +_08177D40: + bl ResetAllObjectData + b _08177DDC +_08177D46: + bl ResetObjectPaletteAllocator + b _08177DDC +_08177D4C: + bl sub_81221AC + lsls r0, 24 + cmp r0, 0 + bne _08177DDC + bl ResetTasks + b _08177DDC +_08177D5C: + bl sub_8177E14 + ldr r0, =0x0203bcf4 + ldr r0, [r0] + ldr r1, =0x00001808 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _08177DDC + .pool +_08177D78: + bl sub_8177E88 + lsls r0, 24 + cmp r0, 0 + beq _08177E0C + b _08177DDC +_08177D84: + bl sub_8178008 + b _08177DDC +_08177D8A: + bl sub_8178090 + b _08177DDC +_08177D90: + bl sub_81780F4 + b _08177DDC +_08177D96: + bl sub_8178338 + b _08177DDC +_08177D9C: + bl sub_817839C + bl sub_8178404 + b _08177DDC +_08177DA6: + ldr r0, =sub_8178654 + movs r1, 0 + bl CreateTask + b _08177DDC + .pool +_08177DB4: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + b _08177DDC +_08177DC2: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 +_08177DDA: + strb r0, [r2, 0x8] +_08177DDC: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08177E0C + .pool +_08177DF4: + ldr r0, =sub_8177C70 + bl SetVBlankCallback + ldr r0, =sub_8177C54 + bl SetMainCallback2 + movs r0, 0x1 + b _08177E0E + .pool +_08177E0C: + movs r0, 0 +_08177E0E: + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_8177CB0 + + thumb_func_start sub_8177E14 +sub_8177E14: @ 8177E14 + push {r4,lr} + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085EFCF0 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r4, =0x0203bcf4 + ldr r1, [r4] + movs r0, 0x2 + bl SetBgTilemapBuffer + ldr r1, [r4] + movs r0, 0x80 + lsls r0, 4 + adds r1, r0 + movs r0, 0x3 + bl SetBgTilemapBuffer + bl sub_8121E10 + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x3 + 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, 0x3 + bl ShowBg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8177E14 + + thumb_func_start sub_8177E88 +sub_8177E88: @ 8177E88 + push {r4-r7,lr} + sub sp, 0x4 + ldr r1, =0x0203bcf4 + ldr r0, [r1] + ldr r2, =0x00001808 + adds r0, r2 + ldrh r0, [r0] + adds r7, r1, 0 + cmp r0, 0x5 + bls _08177E9E + b _08177FEC +_08177E9E: + lsls r0, 2 + ldr r1, =_08177EB4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08177EB4: + .4byte _08177ECC + .4byte _08177EF8 + .4byte _08177F1C + .4byte _08177F3C + .4byte _08177FA8 + .4byte _08177FC8 +_08177ECC: + bl reset_temp_tile_data_buffers + ldr r1, =gUnknown_08D9BB44 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r0, =0x0203bcf4 + ldr r1, [r0] + ldr r0, =0x00001808 + adds r1, r0 + b _08177FD6 + .pool +_08177EF8: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08177F06 + b _08177FFC +_08177F06: + ldr r0, =gUnknown_08D9BF98 + ldr r4, =0x0203bcf4 + ldr r1, [r4] + bl LZDecompressWram + ldr r1, [r4] + b _08177FD2 + .pool +_08177F1C: + ldr r0, =gUnknown_08D9C13C + ldr r1, [r7] + movs r2, 0x80 + lsls r2, 5 + adds r1, r2 + bl LZDecompressWram + ldr r1, [r7] + ldr r0, =0x00001808 + adds r1, r0 + b _08177FD6 + .pool +_08177F3C: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _08177F78 + movs r2, 0 + ldr r6, =0x0203bcf4 + movs r5, 0x80 + lsls r5, 4 + ldr r4, =0x00004042 + ldr r3, =0x000003ff +_08177F52: + ldr r0, [r6] + lsls r1, r2, 1 + adds r0, r5 + adds r0, r1 + strh r4, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, r3 + bls _08177F52 + b _08177F98 + .pool +_08177F78: + movs r2, 0 + ldr r6, =0x0203bcf4 + movs r5, 0x80 + lsls r5, 4 + ldr r4, =0x00005042 + ldr r3, =0x000003ff +_08177F84: + ldr r0, [r6] + lsls r1, r2, 1 + adds r0, r5 + adds r0, r1 + strh r4, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, r3 + bls _08177F84 +_08177F98: + ldr r1, [r7] + b _08177FD2 + .pool +_08177FA8: + ldr r0, =gUnknown_08D9BEF0 + movs r1, 0 + movs r2, 0xC0 + bl decompress_palette + ldr r0, =0x0203bcf4 + ldr r1, [r0] + ldr r0, =0x00001808 + adds r1, r0 + b _08177FD6 + .pool +_08177FC8: + ldr r0, =gUnknown_0857FDEC + bl LoadCompressedObjectPic + ldr r0, =0x0203bcf4 + ldr r1, [r0] +_08177FD2: + ldr r2, =0x00001808 + adds r1, r2 +_08177FD6: + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _08177FFC + .pool +_08177FEC: + ldr r0, =gUnknown_0857FDF4 + bl LoadCompressedObjectPalette + movs r0, 0x1 + b _08177FFE + .pool +_08177FFC: + movs r0, 0 +_08177FFE: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8177E88 + + thumb_func_start sub_8178008 +sub_8178008: @ 8178008 + push {r4,lr} + ldr r0, =gUnknown_085EFD28 + bl InitWindows + bl DeactivateAllTextPrinters + ldr r0, =gUnknown_085EFD00 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r4, 0 +_08178020: + lsls r0, r4, 24 + lsrs r0, 24 + bl PutWindowTilemap + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _08178020 + 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 sub_8178008 + + thumb_func_start sub_817804C +sub_817804C: @ 817804C + push {r4-r6,lr} + sub sp, 0x14 + ldr r6, [sp, 0x24] + ldr r5, [sp, 0x28] + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r5, 24 + lsrs r5, 24 + movs r4, 0 + str r4, [sp] + str r4, [sp, 0x4] + lsls r4, r5, 1 + adds r4, r5 + ldr r5, =gUnknown_085EFD20 + adds r4, r5 + str r4, [sp, 0x8] + lsls r6, 24 + asrs r6, 24 + str r6, [sp, 0xC] + str r1, [sp, 0x10] + movs r1, 0x1 + bl AddTextPrinterParametrized2 + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817804C + + thumb_func_start sub_8178090 +sub_8178090: @ 8178090 + push {r4,lr} + sub sp, 0x8 + movs r0, 0 + bl GetBgTilemapBuffer + ldr r1, =0x0203bcf4 + ldr r1, [r1] + movs r2, 0x80 + lsls r2, 5 + adds r1, r2 + movs r2, 0x80 + lsls r2, 4 + bl memcpy + movs r0, 0x3 + movs r1, 0xFF + bl FillWindowPixelBuffer + ldr r4, =gUnknown_085E926B + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x40 + bl GetStringCenterAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x3 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_817804C + movs r0, 0x3 + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8178090 + + thumb_func_start sub_81780F4 +sub_81780F4: @ 81780F4 + push {lr} + bl sub_8178110 + bl sub_8178174 + bl itemid_copy_name + bl sub_81782D0 + bl sub_8178304 + pop {r0} + bx r0 + thumb_func_end sub_81780F4 + + thumb_func_start sub_8178110 +sub_8178110: @ 8178110 + push {r4-r6,lr} + sub sp, 0x8 + ldr r5, =0x0203bcf4 + ldr r0, [r5] + movs r4, 0xC0 + lsls r4, 5 + adds r0, r4 + ldrb r0, [r0] + bl GetBerryInfo + adds r6, r0, 0 + ldr r0, =0x02021cc4 + ldr r1, [r5] + adds r1, r4 + ldrh r1, [r1] + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r0, =0x02021dc4 + adds r1, r6, 0 + bl CopyString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E9263 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_817804C + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8178110 + + thumb_func_start sub_8178174 +sub_8178174: @ 8178174 + push {r4-r7,lr} + sub sp, 0xC + ldr r0, =0x0203bcf4 + ldr r0, [r0] + movs r1, 0xC0 + lsls r1, 5 + adds r0, r1 + ldrb r0, [r0] + bl GetBerryInfo + adds r4, r0, 0 + ldr r2, =gUnknown_085E9225 + movs r7, 0x1 + str r7, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r6, 0 + str r6, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0 + bl Print + ldrh r0, [r4, 0x8] + cmp r0, 0 + beq _08178230 + adds r1, r0, 0 + lsls r0, r1, 5 + subs r0, r1 + lsls r0, 2 + adds r0, r1 + lsls r0, 3 + movs r1, 0xFE + bl __divsi3 + adds r5, r0, 0 + movs r1, 0xA + bl __umodsi3 + cmp r0, 0x4 + bls _081781C8 + adds r5, 0xA +_081781C8: + adds r0, r5, 0 + movs r1, 0x64 + bl __umodsi3 + movs r1, 0xA + bl __udivsi3 + adds r4, r0, 0 + adds r0, r5, 0 + movs r1, 0x64 + bl __udivsi3 + adds r5, r0, 0 + ldr r0, =0x02021cc4 + adds r1, r5, 0 + movs r2, 0 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r0, =0x02021dc4 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E9233 + adds r0, r4, 0 + bl ExpandStringRefs + str r7, [sp] + str r6, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x28 + bl Print + b _08178242 + .pool +_08178230: + ldr r2, =gUnknown_085E8D34 + str r7, [sp] + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x28 + bl Print +_08178242: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8178174 + + thumb_func_start itemid_copy_name +itemid_copy_name: @ 8178250 + push {r4-r6,lr} + sub sp, 0xC + ldr r0, =0x0203bcf4 + ldr r0, [r0] + movs r1, 0xC0 + lsls r1, 5 + adds r0, r1 + ldrb r0, [r0] + bl GetBerryInfo + adds r6, r0, 0 + ldr r2, =gUnknown_085E922C + movs r5, 0x11 + str r5, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0 + bl Print + ldrb r0, [r6, 0x7] + cmp r0, 0 + beq _081782B0 + ldr r0, =gBerryFirmnessStringPointers + ldrb r1, [r6, 0x7] + subs r1, 0x1 + lsls r1, 2 + adds r1, r0 + ldr r2, [r1] + str r5, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x28 + bl Print + b _081782C2 + .pool +_081782B0: + ldr r2, =gUnknown_085E8D34 + str r5, [sp] + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x28 + bl Print +_081782C2: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end itemid_copy_name + + thumb_func_start sub_81782D0 +sub_81782D0: @ 81782D0 + push {lr} + sub sp, 0xC + ldr r0, =0x0203bcf4 + ldr r0, [r0] + movs r1, 0xC0 + lsls r1, 5 + adds r0, r1 + ldrb r0, [r0] + bl GetBerryInfo + ldr r2, [r0, 0xC] + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0 + bl Print + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81782D0 + + thumb_func_start sub_8178304 +sub_8178304: @ 8178304 + push {lr} + sub sp, 0xC + ldr r0, =0x0203bcf4 + ldr r0, [r0] + movs r1, 0xC0 + lsls r1, 5 + adds r0, r1 + ldrb r0, [r0] + bl GetBerryInfo + ldr r2, [r0, 0x10] + movs r0, 0x11 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0 + bl Print + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_8178304 + + thumb_func_start sub_8178338 +sub_8178338: @ 8178338 + push {r4,lr} + ldr r4, =0x0203bcf4 + ldr r0, [r4] + movs r1, 0xC0 + lsls r1, 5 + adds r0, r1 + ldrb r0, [r0] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x38 + movs r2, 0x40 + bl sub_80D50D4 + ldr r1, [r4] + ldr r2, =0x00001802 + adds r1, r2 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8178338 + + thumb_func_start sub_817836C +sub_817836C: @ 817836C + push {lr} + ldr r0, =0x0203bcf4 + ldr r0, [r0] + ldr r1, =0x00001802 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + bl sub_80D510C + pop {r0} + bx r0 + .pool + thumb_func_end sub_817836C + + thumb_func_start sub_817839C +sub_817839C: @ 817839C + push {r4,lr} + movs r0, 0x40 + bl sub_80D518C + ldr r4, =0x0203bcf4 + ldr r1, [r4] + ldr r2, =0x00001803 + adds r1, r2 + strb r0, [r1] + movs r0, 0x68 + bl sub_80D518C + ldr r1, [r4] + ldr r2, =0x00001804 + adds r1, r2 + strb r0, [r1] + movs r0, 0x90 + bl sub_80D518C + ldr r1, [r4] + ldr r2, =0x00001805 + adds r1, r2 + strb r0, [r1] + movs r0, 0xB8 + bl sub_80D518C + ldr r1, [r4] + ldr r2, =0x00001806 + adds r1, r2 + strb r0, [r1] + movs r0, 0xE0 + bl sub_80D518C + ldr r1, [r4] + ldr r2, =0x00001807 + adds r1, r2 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817839C + + thumb_func_start sub_8178404 +sub_8178404: @ 8178404 + push {r4,r5,lr} + ldr r4, =0x0203bcf4 + ldr r0, [r4] + movs r1, 0xC0 + lsls r1, 5 + adds r0, r1 + ldrb r0, [r0] + bl GetBerryInfo + adds r5, r0, 0 + ldrb r0, [r5, 0x15] + cmp r0, 0 + beq _08178448 + ldr r3, =0x02020630 + ldr r0, [r4] + ldr r1, =0x00001803 + adds r0, r1 + ldrb r1, [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 + b _08178462 + .pool +_08178448: + ldr r3, =0x02020630 + ldr r0, [r4] + ldr r1, =0x00001803 + 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] + movs r2, 0x4 + orrs r1, r2 +_08178462: + strb r1, [r0] + adds r4, r3, 0 + ldrb r0, [r5, 0x16] + cmp r0, 0 + beq _0817849C + ldr r3, =0x0203bcf4 + ldr r0, [r3] + ldr r1, =0x00001804 + adds r0, r1 + ldrb r1, [r0] + 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 + b _081784B6 + .pool +_0817849C: + ldr r3, =0x0203bcf4 + ldr r0, [r3] + ldr r1, =0x00001804 + adds r0, r1 + ldrb r1, [r0] + 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 +_081784B6: + strb r1, [r0] + ldrb r0, [r5, 0x17] + cmp r0, 0 + beq _081784E8 + ldr r0, [r3] + ldr r1, =0x00001805 + adds r0, r1 + ldrb r1, [r0] + 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 + b _08178500 + .pool +_081784E8: + ldr r0, [r3] + ldr r1, =0x00001805 + adds r0, r1 + ldrb r1, [r0] + 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 +_08178500: + strb r1, [r0] + ldrb r0, [r5, 0x18] + cmp r0, 0 + beq _0817852C + ldr r0, [r3] + ldr r1, =0x00001806 + adds r0, r1 + ldrb r1, [r0] + 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 + b _08178544 + .pool +_0817852C: + ldr r0, [r3] + ldr r1, =0x00001806 + adds r0, r1 + ldrb r1, [r0] + 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 +_08178544: + strb r1, [r0] + ldrb r0, [r5, 0x19] + cmp r0, 0 + beq _08178570 + ldr r0, [r3] + ldr r1, =0x00001807 + adds r0, r1 + ldrb r1, [r0] + 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 + b _08178588 + .pool +_08178570: + ldr r0, [r3] + ldr r1, =0x00001807 + adds r0, r1 + ldrb r1, [r0] + 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 +_08178588: + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8178404 + + thumb_func_start sub_8178594 +sub_8178594: @ 8178594 + push {r4,lr} + movs r4, 0 +_08178598: + ldr r0, =0x0203bcf4 + ldr r0, [r0] + ldr r1, =0x00001803 + adds r0, r1 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _08178598 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8178594 + + thumb_func_start sub_81785D0 +sub_81785D0: @ 81785D0 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8178610 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81785D0 + + thumb_func_start sub_8178610 +sub_8178610: @ 8178610 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08178642 + bl sub_817836C + bl sub_8178594 + ldr r0, =0x0203bcf4 + ldr r0, [r0] + bl Free + bl FreeAllWindowBuffers + ldr r0, =bag_menu_mail_related + bl SetMainCallback2 + adds r0, r4, 0 + bl DestroyTask +_08178642: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8178610 + + thumb_func_start sub_8178654 +sub_8178654: @ 8178654 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + adds r4, r2, 0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081786A6 + ldr r3, =0x030022c0 + ldrh r0, [r3, 0x30] + movs r1, 0xF0 + ands r1, r0 + cmp r1, 0x40 + bne _08178688 + movs r1, 0x1 + negs r1, r1 + adds r0, r2, 0 + bl sub_81786AC + b _081786A6 + .pool +_08178688: + cmp r1, 0x80 + bne _08178696 + adds r0, r2, 0 + movs r1, 0x1 + bl sub_81786AC + b _081786A6 +_08178696: + ldrh r1, [r3, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081786A6 + adds r0, r4, 0 + bl sub_81785D0 +_081786A6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8178654 + + thumb_func_start sub_81786AC +sub_81786AC: @ 81786AC + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r2, =0x03005e08 + adds r4, r0, r2 + ldr r2, =0x0203ce58 + ldrh r0, [r2, 0xE] + ldrh r2, [r2, 0x18] + adds r0, r2 + lsls r0, 16 + asrs r0, 16 + lsrs r7, r1, 24 + asrs r6, r1, 24 + adds r0, r6 + cmp r0, 0x2D + bhi _08178718 + lsls r1, r0, 16 + lsrs r1, 16 + movs r0, 0x4 + bl bag_pocket_get_itemid + lsls r0, 16 + cmp r0, 0 + beq _08178718 + cmp r6, 0 + bge _081786F4 + movs r0, 0x2 + b _081786F6 + .pool +_081786F4: + movs r0, 0x1 +_081786F6: + strh r0, [r4, 0x2] + movs r0, 0 + strh r0, [r4] + movs r0, 0x5 + bl audio_play + lsls r0, r7, 24 + asrs r0, 24 + bl sub_8178728 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81787AC + str r1, [r0] +_08178718: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81786AC + + thumb_func_start sub_8178728 +sub_8178728: @ 8178728 + push {r4-r6,lr} + ldr r5, =0x0203ce70 + adds r6, r5, 0 + subs r6, 0xA + lsls r0, 24 + asrs r4, r0, 24 + cmp r4, 0 + ble _08178764 + ldrh r0, [r6] + cmp r0, 0x3 + bls _08178752 + ldrh r1, [r5] + adds r1, 0x8 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x4 + bl bag_pocket_get_itemid + lsls r0, 16 + cmp r0, 0 + bne _08178760 +_08178752: + ldrh r0, [r6] + adds r0, r4 + strh r0, [r6] + b _0817877A + .pool +_08178760: + ldrh r0, [r5] + b _08178776 +_08178764: + ldrh r1, [r6] + cmp r1, 0x3 + bhi _08178770 + ldrh r0, [r5] + cmp r0, 0 + bne _08178776 +_08178770: + adds r0, r1, r4 + strh r0, [r6] + b _0817877A +_08178776: + adds r0, r4 + strh r0, [r5] +_0817877A: + ldrh r1, [r6] + ldrh r5, [r5] + adds r1, r5 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x4 + bl bag_pocket_get_itemid + lsls r0, 16 + lsrs r0, 16 + bl ItemIdToBerryType + ldr r1, =0x0203bcf4 + ldr r1, [r1] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0xC0 + lsls r2, 5 + adds r1, r2 + strh r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8178728 + + thumb_func_start sub_81787AC +sub_81787AC: @ 81787AC + 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, =0x03005e08 + adds r6, r0, r1 + ldrh r0, [r6] + adds r0, 0x10 + movs r1, 0xFF + ands r0, r1 + strh r0, [r6] + movs r1, 0x2 + ldrsh r0, [r6, r1] + cmp r0, 0x1 + bne _08178828 + movs r2, 0 + ldrsh r0, [r6, r2] + cmp r0, 0x70 + beq _08178888 + cmp r0, 0x70 + bgt _081787FE + cmp r0, 0x40 + beq _0817881A + cmp r0, 0x40 + bgt _081787F4 + cmp r0, 0x30 + beq _08178898 + b _081788A6 + .pool +_081787F4: + cmp r0, 0x50 + beq _0817888E + cmp r0, 0x60 + beq _08178820 + b _081788A6 +_081787FE: + cmp r0, 0xA0 + beq _08178824 + cmp r0, 0xA0 + bgt _08178810 + cmp r0, 0x80 + beq _08178882 + cmp r0, 0x90 + beq _08178878 + b _081788A6 +_08178810: + cmp r0, 0xB0 + beq _08178872 + cmp r0, 0xC0 + beq _0817886C + b _081788A6 +_0817881A: + bl sub_8178110 + b _081788A6 +_08178820: + movs r0, 0x1 + b _0817889A +_08178824: + movs r0, 0x2 + b _0817889A +_08178828: + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0x70 + beq _0817887E + cmp r0, 0x70 + bgt _0817884C + cmp r0, 0x40 + beq _0817886C + cmp r0, 0x40 + bgt _08178842 + cmp r0, 0x30 + beq _08178868 + b _081788A6 +_08178842: + cmp r0, 0x50 + beq _08178872 + cmp r0, 0x60 + beq _08178878 + b _081788A6 +_0817884C: + cmp r0, 0xA0 + beq _0817888E + cmp r0, 0xA0 + bgt _0817885E + cmp r0, 0x80 + beq _08178882 + cmp r0, 0x90 + beq _08178888 + b _081788A6 +_0817885E: + cmp r0, 0xB0 + beq _08178898 + cmp r0, 0xC0 + beq _081788A2 + b _081788A6 +_08178868: + movs r0, 0x2 + b _0817889A +_0817886C: + bl sub_8178304 + b _081788A6 +_08178872: + bl sub_81782D0 + b _081788A6 +_08178878: + bl sub_8178404 + b _081788A6 +_0817887E: + movs r0, 0x1 + b _0817889A +_08178882: + bl itemid_copy_name + b _081788A6 +_08178888: + bl sub_8178174 + b _081788A6 +_0817888E: + bl sub_817836C + bl sub_8178338 + b _081788A6 +_08178898: + movs r0, 0 +_0817889A: + movs r1, 0 + bl FillWindowPixelBuffer + b _081788A6 +_081788A2: + bl sub_8178110 +_081788A6: + movs r2, 0x2 + ldrsh r0, [r6, r2] + cmp r0, 0x1 + bne _081788B8 + ldrh r0, [r6] + negs r0, r0 + lsls r0, 16 + lsrs r5, r0, 16 + b _081788BA +_081788B8: + ldrh r5, [r6] +_081788BA: + ldr r2, =0x02020630 + ldr r3, =0x0203bcf4 + ldr r0, [r3] + ldr r1, =0x00001802 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x26] + movs r4, 0 + adds r7, r2, 0 + ldr r2, =0x00001803 +_081788D6: + ldr r0, [r3] + adds r0, r2 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r5, [r0, 0x26] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _081788D6 + movs r4, 0x80 + lsls r4, 5 + ldrb r2, [r6, 0x2] + movs r0, 0x1 + adds r1, r4, 0 + bl ChangeBgY + ldrb r2, [r6, 0x2] + movs r0, 0x2 + adds r1, r4, 0 + bl ChangeBgY + movs r2, 0 + ldrsh r0, [r6, r2] + cmp r0, 0 + bne _08178922 + ldr r0, =0x03005e00 + mov r2, r8 + lsls r1, r2, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8178654 + str r0, [r1] +_08178922: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81787AC + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/gpu_bg.s b/asm/bg.s similarity index 99% rename from asm/gpu_bg.s rename to asm/bg.s index b523c1d2f..8e4e9e8c6 100644 --- a/asm/gpu_bg.s +++ b/asm/bg.s @@ -1,4 +1,5 @@ .include "asm/macros.inc" + .include "constants/constants.inc" .syntax unified diff --git a/asm/big_shroomish_barboach.s b/asm/big_shroomish_barboach.s new file mode 100644 index 000000000..5018d2d5f --- /dev/null +++ b/asm/big_shroomish_barboach.s @@ -0,0 +1,489 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80F97C8 +sub_80F97C8: @ 80F97C8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r5, r0, 0 + movs r1, 0 + bl pokemon_getattr + lsls r0, 16 + str r0, [sp, 0x4] + lsrs r0, 16 + str r0, [sp] + adds r0, r5, 0 + movs r1, 0x27 + bl pokemon_getattr + adds r7, r0, 0 + movs r6, 0xF + ands r7, r6 + adds r0, r5, 0 + movs r1, 0x28 + bl pokemon_getattr + mov r8, r0 + mov r1, r8 + ands r1, r6 + mov r8, r1 + adds r0, r5, 0 + movs r1, 0x29 + bl pokemon_getattr + mov r9, r0 + mov r3, r9 + ands r3, r6 + mov r9, r3 + adds r0, r5, 0 + movs r1, 0x2A + bl pokemon_getattr + mov r10, r0 + ands r0, r6 + mov r10, r0 + adds r0, r5, 0 + movs r1, 0x2B + bl pokemon_getattr + adds r4, r0, 0 + ands r4, r6 + adds r0, r5, 0 + movs r1, 0x2C + bl pokemon_getattr + adds r2, r0, 0 + ands r2, r6 + mov r1, r8 + mov r3, r9 + eors r1, r3 + mov r8, r1 + mov r0, r8 + muls r0, r7 + movs r1, 0xFF + ldr r3, [sp] + ands r3, r1 + eors r0, r3 + eors r4, r2 + mov r1, r10 + muls r1, r4 + ldr r3, [sp, 0x4] + lsrs r2, r3, 24 + eors r1, r2 + lsls r0, 8 + adds r0, r1 + 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_80F97C8 + + thumb_func_start sub_80F986C +sub_80F986C: @ 80F986C + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0x1 + ldr r3, =gUnknown_0858D8F0 +_080F9876: + lsls r0, r1, 3 + adds r0, r3 + ldrh r0, [r0, 0x4] + cmp r2, r0 + bcs _080F988C + subs r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + b _080F9898 + .pool +_080F988C: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xE + bls _080F9876 + adds r0, r1, 0 +_080F9898: + pop {r1} + bx r1 + thumb_func_end sub_80F986C + + thumb_func_start sub_80F989C +sub_80F989C: @ 80F989C + push {r4-r7,lr} + sub sp, 0x8 + adds r6, r1, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r6, 16 + lsrs r6, 16 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl sub_80C0630 + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r6, 0 + bl sub_80F986C + lsls r0, 24 + ldr r1, =gUnknown_0858D8F0 + lsrs r0, 21 + adds r0, r1 + ldrh r1, [r0] + str r1, [sp] + movs r2, 0 + str r2, [sp, 0x4] + ldrb r2, [r0, 0x2] + movs r3, 0 + ldrh r4, [r0, 0x4] + movs r5, 0 + adds r0, r6, 0 + movs r1, 0 + subs r0, r4 + sbcs r1, r5 + bl __udivdi3 + ldr r2, [sp] + ldr r3, [sp, 0x4] + adds r2, r0 + adcs r3, r1 + str r2, [sp] + str r3, [sp, 0x4] + adds r0, r7, 0 + movs r1, 0 + bl __muldi3 + movs r2, 0xA + movs r3, 0 + bl __udivdi3 + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80F989C + + thumb_func_start sub_80F9910 +sub_80F9910: @ 80F9910 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r4, r1, 2 + adds r4, r1 + lsls r4, 1 + adds r0, r4, 0 + bl __floatsidf + cmp r4, 0 + bge _080F992C + ldr r3, _080F9974 + ldr r2, _080F9970 + bl __adddf3 +_080F992C: + ldr r2, _080F9978 + ldr r3, _080F997C + bl __divdf3 + bl __fixunsdfsi + adds r4, r0, 0 + movs r1, 0xA + bl __udivsi3 + adds r1, r0, 0 + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x8 + bl ConvertIntToDecimalString + adds r5, r0, 0 + ldr r1, _080F9980 + bl AppendString + adds r5, r0, 0 + adds r0, r4, 0 + movs r1, 0xA + bl __umodsi3 + adds r1, r0, 0 + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalString + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080F9970: .4byte 0x41f00000 +_080F9974: .4byte 0x00000000 +_080F9978: .4byte 0x40396666 +_080F997C: .4byte 0x66666666 +_080F9980: .4byte gUnknown_085EED24 + thumb_func_end sub_80F9910 + + thumb_func_start sub_80F9984 +sub_80F9984: @ 80F9984 + push {r4-r7,lr} + sub sp, 0x4 + adds r7, r1, 0 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r1, =0x020375f0 + ldrh r0, [r1] + cmp r0, 0xFF + bne _080F99A0 + movs r0, 0 + b _080F9A0A + .pool +_080F99A0: + ldrh r1, [r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0x1 + beq _080F99C2 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, r6 + beq _080F99CC +_080F99C2: + movs r0, 0x1 + b _080F9A0A + .pool +_080F99CC: + mov r4, sp + adds r0, r5, 0 + bl sub_80F97C8 + strh r0, [r4] + mov r0, sp + ldrh r1, [r0] + adds r0, r6, 0 + bl sub_80F989C + adds r5, r0, 0 + ldrh r1, [r7] + adds r0, r6, 0 + bl sub_80F989C + adds r4, r0, 0 + ldr r0, =0x02021dc4 + adds r1, r5, 0 + bl sub_80F9910 + cmp r5, r4 + bls _080F9A08 + mov r0, sp + ldrh r0, [r0] + strh r0, [r7] + movs r0, 0x3 + b _080F9A0A + .pool +_080F9A08: + movs r0, 0x2 +_080F9A0A: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80F9984 + + thumb_func_start sub_80F9A14 +sub_80F9A14: @ 80F9A14 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 16 + lsrs r4, 16 + ldrh r1, [r5] + adds r0, r4, 0 + bl sub_80F989C + adds r1, r0, 0 + ldr r0, =0x02021ec4 + bl sub_80F9910 + ldr r0, =0x02021cc4 + movs r1, 0xB + muls r1, r4 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldrh r1, [r5] + movs r0, 0x80 + lsls r0, 8 + cmp r1, r0 + bne _080F9A64 + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085ECF6B + bl CopyString + b _080F9A6E + .pool +_080F9A64: + ldr r0, =0x02021dc4 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString +_080F9A6E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F9A14 + + thumb_func_start sub_80F9A7C +sub_80F9A7C: @ 80F9A7C + push {lr} + ldr r0, =0x00004047 + movs r1, 0x80 + lsls r1, 8 + bl VarSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F9A7C + + thumb_func_start sub_80F9A90 +sub_80F9A90: @ 80F9A90 + push {lr} + ldr r0, =0x00004047 + bl GetVarPointer + adds r1, r0, 0 + movs r0, 0x95 + lsls r0, 1 + bl sub_80F9A14 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F9A90 + + thumb_func_start sub_80F9AAC +sub_80F9AAC: @ 80F9AAC + push {r4,lr} + ldr r0, =0x00004047 + bl GetVarPointer + adds r1, r0, 0 + ldr r4, =0x020375f0 + movs r0, 0x95 + lsls r0, 1 + bl sub_80F9984 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F9AAC + + thumb_func_start sub_80F9AD4 +sub_80F9AD4: @ 80F9AD4 + push {lr} + ldr r0, =0x0000404f + movs r1, 0x80 + lsls r1, 8 + bl VarSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F9AD4 + + thumb_func_start sub_80F9AE8 +sub_80F9AE8: @ 80F9AE8 + push {lr} + ldr r0, =0x0000404f + bl GetVarPointer + adds r1, r0, 0 + ldr r0, =0x00000127 + bl sub_80F9A14 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F9AE8 + + thumb_func_start sub_80F9B04 +sub_80F9B04: @ 80F9B04 + push {r4,lr} + ldr r0, =0x0000404f + bl GetVarPointer + adds r1, r0, 0 + ldr r4, =0x020375f0 + ldr r0, =0x00000127 + bl sub_80F9984 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F9B04 + + thumb_func_start sub_80F9B30 +sub_80F9B30: @ 80F9B30 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + movs r7, 0 + add r4, sp, 0x8 + movs r0, 0x1 + strb r0, [r4] + ldr r1, =gUnknown_0858D970 + mov r0, sp + movs r2, 0x7 + bl memcpy + mov r8, r4 + cmp r6, 0xA + bhi _080F9BAC + cmp r5, 0x40 + bhi _080F9BAC + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000031a8 + adds r0, r1 + adds r0, r6 + strb r5, [r0] + movs r5, 0 +_080F9B6A: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _080F9B9C + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _080F9B9C + mov r1, sp + adds r0, r1, r6 + ldrb r1, [r0] + adds r0, r4, 0 + mov r2, r8 + bl pokemon_setattr + movs r7, 0x1 +_080F9B9C: + adds r5, 0x1 + cmp r5, 0x5 + ble _080F9B6A + cmp r7, 0 + beq _080F9BAC + ldr r0, =0x0000089b + bl FlagSet +_080F9BAC: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F9B30 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/bike.s b/asm/bike.s new file mode 100644 index 000000000..2ce5fbc78 --- /dev/null +++ b/asm/bike.s @@ -0,0 +1,2199 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start MovePlayerOnBike +@ void MovePlayerOnBike(int dpad_direction, int buttons_new, int buttons_held) +MovePlayerOnBike: @ 8119164 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 16 + lsrs r2, 16 + ldr r0, =0x02037590 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0811918C + adds r0, r3, 0 + adds r1, r4, 0 + bl MovePlayerOnMachBike + b _08119194 + .pool +_0811918C: + adds r0, r3, 0 + adds r1, r4, 0 + bl MovePlayerOnAcroBike +_08119194: + pop {r4} + pop {r0} + bx r0 + thumb_func_end MovePlayerOnBike + + thumb_func_start MovePlayerOnMachBike +MovePlayerOnMachBike: @ 811919C + push {r4,lr} + sub sp, 0x4 + mov r1, sp + strb r0, [r1] + ldr r4, =gUnknown_0859744C + mov r0, sp + bl CheckMovementInputMachBike + lsls r0, 24 + lsrs r0, 22 + adds r0, r4 + mov r1, sp + ldrb r1, [r1] + ldr r2, [r0] + adds r0, r1, 0 + bl _call_via_r2 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end MovePlayerOnMachBike + + thumb_func_start CheckMovementInputMachBike +CheckMovementInputMachBike: @ 81191CC + push {r4,lr} + adds r4, r0, 0 + bl player_get_direction_upper_nybble + lsls r0, 24 + lsrs r0, 24 + adds r3, r0, 0 + ldrb r1, [r4] + cmp r1, 0 + bne _081191F4 + strb r0, [r4] + ldr r2, =0x02037590 + ldrb r0, [r2, 0xB] + cmp r0, 0 + bne _08119208 + strb r1, [r2, 0x2] + movs r0, 0 + b _0811921C + .pool +_081191F4: + ldr r2, =0x02037590 + cmp r1, r3 + beq _08119218 + ldrb r0, [r2, 0x2] + cmp r0, 0x2 + beq _08119218 + ldrb r0, [r2, 0xB] + cmp r0, 0 + beq _08119214 + strb r3, [r4] +_08119208: + movs r0, 0x2 + strb r0, [r2, 0x2] + movs r0, 0x3 + b _0811921C + .pool +_08119214: + movs r0, 0x1 + b _0811921A +_08119218: + movs r0, 0x2 +_0811921A: + strb r0, [r2, 0x2] +_0811921C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end CheckMovementInputMachBike + + thumb_func_start sub_8119224 +sub_8119224: @ 8119224 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl PlayerFaceDirection + bl sub_811A128 + pop {r0} + bx r0 + thumb_func_end sub_8119224 + + thumb_func_start sub_8119238 +sub_8119238: @ 8119238 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + ldrb r1, [r4, 0x1E] + adds r0, r5, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + beq _08119270 + adds r0, r5, 0 + bl PlayerTurnInPlace + bl sub_811A128 + b _0811927A + .pool +_08119270: + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl sub_8119224 +_0811927A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8119238 + + thumb_func_start sub_8119280 +sub_8119280: @ 8119280 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r7, r5, 0 + ldr r6, =0x02037590 + ldrb r1, [r6, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + ldrb r1, [r4, 0x1E] + adds r0, r5, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + bne _081192C6 + ldrb r0, [r6, 0xB] + cmp r0, 0 + beq _081192BC + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl sub_8119344 + b _0811933A + .pool +_081192BC: + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl sub_8119224 + b _0811933A +_081192C6: + adds r0, r5, 0 + bl sub_8119E38 + lsls r0, 24 + lsrs r4, r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0xA + bhi _08119316 + cmp r4, 0x6 + bne _081192E8 + adds r0, r5, 0 + bl PlayerJumpLedge + b _0811933A +_081192E8: + bl sub_811A128 + cmp r4, 0x4 + bne _08119304 + adds r0, r5, 0 + bl IsPlayerCollidingWithFarawayIslandMew + lsls r0, 24 + cmp r0, 0 + beq _08119304 + adds r0, r5, 0 + bl PlayerOnBikeCollideWithFarawayIslandMew + b _0811933A +_08119304: + subs r0, r4, 0x5 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _0811933A + adds r0, r7, 0 + bl PlayerOnBikeCollide + b _0811933A +_08119316: + ldr r1, =gUnknown_0859745C + ldrb r0, [r6, 0xA] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r7, 0 + bl _call_via_r1 + ldrb r2, [r6, 0xA] + lsls r0, r2, 24 + lsrs r1, r0, 24 + lsrs r0, 25 + adds r0, r2, r0 + strb r0, [r6, 0xB] + cmp r1, 0x1 + bhi _0811933A + adds r0, r2, 0x1 + strb r0, [r6, 0xA] +_0811933A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8119280 + + thumb_func_start sub_8119344 +sub_8119344: @ 8119344 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r7, r5, 0 + ldr r6, =0x02037590 + ldrb r0, [r6, 0xB] + cmp r0, 0 + beq _0811935A + subs r0, 0x1 + strb r0, [r6, 0xB] + strb r0, [r6, 0xA] +_0811935A: + adds r0, r5, 0 + bl sub_8119E38 + lsls r0, 24 + lsrs r4, r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0xA + bhi _081193AE + cmp r4, 0x6 + bne _08119380 + adds r0, r5, 0 + bl PlayerJumpLedge + b _081193BE + .pool +_08119380: + bl sub_811A128 + cmp r4, 0x4 + bne _0811939C + adds r0, r5, 0 + bl IsPlayerCollidingWithFarawayIslandMew + lsls r0, 24 + cmp r0, 0 + beq _0811939C + adds r0, r5, 0 + bl PlayerOnBikeCollideWithFarawayIslandMew + b _081193BE +_0811939C: + subs r0, r4, 0x5 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _081193BE + adds r0, r7, 0 + bl PlayerOnBikeCollide + b _081193BE +_081193AE: + ldr r0, =gUnknown_0859745C + ldrb r1, [r6, 0xA] + lsls r1, 2 + adds r1, r0 + ldr r1, [r1] + adds r0, r7, 0 + bl _call_via_r1 +_081193BE: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8119344 + + thumb_func_start MovePlayerOnAcroBike +@ void MovePlayerOnAcroBike(int dpad_direction, int buttons_new, int buttons_held) +MovePlayerOnAcroBike: @ 81193C8 + push {r4,lr} + sub sp, 0x4 + mov r3, sp + strb r0, [r3] + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + ldr r4, =gUnknown_08597468 + mov r0, sp + bl CheckMovementInputAcroBike + lsls r0, 24 + lsrs r0, 22 + adds r0, r4 + mov r1, sp + ldrb r1, [r1] + ldr r2, [r0] + adds r0, r1, 0 + bl _call_via_r2 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end MovePlayerOnAcroBike + + thumb_func_start CheckMovementInputAcroBike +CheckMovementInputAcroBike: @ 8119400 + push {r4,lr} + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + ldr r4, =gUnknown_0859749C + ldr r3, =0x02037590 + ldrb r3, [r3, 0x8] + lsls r3, 2 + adds r3, r4 + ldr r3, [r3] + bl _call_via_r3 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end CheckMovementInputAcroBike + + thumb_func_start CheckMovementInputAcroBikeNormal +CheckMovementInputAcroBikeNormal: @ 811942C + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 16 + lsrs r5, r2, 16 + bl player_get_direction_upper_nybble + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =0x02037590 + movs r0, 0 + strb r0, [r2, 0xA] + ldrb r1, [r4] + cmp r1, 0 + bne _0811946C + movs r0, 0x2 + ands r0, r6 + cmp r0, 0 + beq _08119464 + strb r3, [r4] + strb r1, [r2, 0x2] + movs r0, 0x2 + strb r0, [r2, 0x8] + movs r0, 0x3 + b _081194C0 + .pool +_08119464: + strb r3, [r4] + strb r1, [r2, 0x2] + movs r0, 0 + b _081194C0 +_0811946C: + cmp r1, r3 + bne _08119492 + movs r0, 0x2 + ands r0, r5 + cmp r0, 0 + beq _0811948A + ldrb r0, [r2, 0xB] + cmp r0, 0 + bne _0811948A + adds r0, 0x1 + strb r0, [r2, 0xB] + movs r0, 0x4 + strb r0, [r2, 0x8] + movs r0, 0xB + b _081194C0 +_0811948A: + ldrb r0, [r4] + ldr r2, =0x02037590 + cmp r0, r3 + beq _081194BC +_08119492: + ldr r0, =0x02037590 + ldrb r1, [r0, 0x2] + adds r2, r0, 0 + cmp r1, 0x2 + beq _081194BC + movs r1, 0 + movs r0, 0x1 + strb r0, [r2, 0x8] + ldrb r0, [r4] + strb r0, [r2, 0x9] + strb r1, [r2, 0x2] + adds r0, r4, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl CheckMovementInputAcroBike + lsls r0, 24 + lsrs r0, 24 + b _081194C0 + .pool +_081194BC: + movs r0, 0x2 + strb r0, [r2, 0x2] +_081194C0: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end CheckMovementInputAcroBikeNormal + + thumb_func_start CheckMovementInputAcroBikeChangingDirection +CheckMovementInputAcroBikeChangingDirection: @ 81194C8 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r4, =0x02037590 + ldrb r0, [r4, 0x9] + strb r0, [r5] + ldrb r0, [r4, 0xA] + adds r0, 0x1 + strb r0, [r4, 0xA] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + bls _081194F4 + movs r0, 0x1 + strb r0, [r4, 0x2] + movs r0, 0 + strb r0, [r4, 0x8] + bl sub_811A128 + movs r0, 0x1 + b _0811953A + .pool +_081194F4: + bl player_get_direction_upper_nybble + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_8119D30 + ldrb r1, [r5] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + bne _08119536 + bl sub_811A128 + movs r0, 0x1 + strb r0, [r4, 0xB] + adds r0, r6, 0 + bl GetOppositeDirection + ldrb r1, [r5] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + bne _0811952A + movs r0, 0x6 + strb r0, [r4, 0x8] + movs r0, 0x9 + b _0811953A +_0811952A: + movs r0, 0x2 + strb r0, [r4, 0x2] + movs r0, 0x5 + strb r0, [r4, 0x8] + movs r0, 0x8 + b _0811953A +_08119536: + strb r6, [r5] + movs r0, 0 +_0811953A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end CheckMovementInputAcroBikeChangingDirection + + thumb_func_start CheckMovementInputAcroBikeStandingWheelie +CheckMovementInputAcroBikeStandingWheelie: @ 8119540 + push {r4-r7,lr} + adds r7, r0, 0 + lsls r4, r2, 16 + lsrs r4, 16 + bl player_get_direction_upper_nybble + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, =0x02037590 + ldrb r1, [r5, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r1, r0, r1 + movs r0, 0 + strb r0, [r5, 0x2] + movs r0, 0x2 + ands r4, r0 + lsls r4, 16 + lsrs r4, 16 + cmp r4, 0 + bne _08119594 + strb r4, [r5, 0xA] + ldrb r0, [r1, 0x1E] + bl MetatileBehavior_IsBumpySlope + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0811959A + strb r6, [r7] + strb r0, [r5, 0x8] + bl sub_811A128 + movs r0, 0x4 + b _081195D8 + .pool +_08119594: + ldrb r0, [r5, 0xA] + adds r0, 0x1 + strb r0, [r5, 0xA] +_0811959A: + ldr r1, =0x02037590 + ldrb r0, [r1, 0xA] + cmp r0, 0x27 + bls _081195B4 + strb r6, [r7] + movs r0, 0x3 + strb r0, [r1, 0x8] + bl sub_811A128 + movs r0, 0x6 + b _081195D8 + .pool +_081195B4: + ldrb r0, [r7] + cmp r0, r6 + bne _081195CA + movs r0, 0x2 + strb r0, [r1, 0x2] + movs r0, 0x4 + strb r0, [r1, 0x8] + bl sub_811A128 + movs r0, 0xA + b _081195D8 +_081195CA: + cmp r0, 0 + beq _081195D4 + movs r0, 0x1 + strb r0, [r1, 0x2] + b _081195D6 +_081195D4: + strb r6, [r7] +_081195D6: + movs r0, 0x5 +_081195D8: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end CheckMovementInputAcroBikeStandingWheelie + + thumb_func_start CheckMovementInputAcroBikeBunnyHop +CheckMovementInputAcroBikeBunnyHop: @ 81195E0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + bl player_get_direction_upper_nybble + lsls r0, 24 + lsrs r5, r0, 24 + adds r2, r5, 0 + ldr r4, =0x02037590 + ldrb r1, [r4, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r7, r0, r1 + movs r0, 0x2 + mov r1, r8 + ands r0, r1 + cmp r0, 0 + bne _08119652 + bl sub_811A128 + ldrb r0, [r7, 0x1E] + bl MetatileBehavior_IsBumpySlope + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08119648 + movs r0, 0x2 + strb r0, [r4, 0x8] + adds r0, r6, 0 + mov r1, r9 + mov r2, r8 + bl CheckMovementInputAcroBike + lsls r0, 24 + lsrs r0, 24 + b _08119676 + .pool +_08119648: + strb r5, [r6] + strb r0, [r4, 0x2] + strb r0, [r4, 0x8] + movs r0, 0x4 + b _08119676 +_08119652: + ldrb r0, [r6] + cmp r0, 0 + bne _0811965C + strb r5, [r6] + b _08119668 +_0811965C: + cmp r0, r2 + beq _0811966E + ldrb r0, [r4, 0x2] + cmp r0, 0x2 + beq _0811966E + movs r0, 0x1 +_08119668: + strb r0, [r4, 0x2] + movs r0, 0x6 + b _08119676 +_0811966E: + ldr r1, =0x02037590 + movs r0, 0x2 + strb r0, [r1, 0x2] + movs r0, 0x7 +_08119676: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end CheckMovementInputAcroBikeBunnyHop + + thumb_func_start CheckMovementInputAcroBikeMovingWheelie +CheckMovementInputAcroBikeMovingWheelie: @ 8119688 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r6, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r5, r0, 24 + adds r2, r5, 0 + ldr r4, =0x02037590 + ldrb r1, [r4, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r7, r0, r1 + movs r0, 0x2 + mov r9, r0 + movs r0, 0x2 + mov r1, r8 + ands r0, r1 + cmp r0, 0 + bne _08119720 + bl sub_811A128 + ldrb r0, [r7, 0x1E] + bl MetatileBehavior_IsBumpySlope + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0811970C + strb r1, [r4, 0x8] + ldrb r0, [r6] + cmp r0, 0 + bne _081196EC + strb r5, [r6] + b _081196F6 + .pool +_081196EC: + cmp r0, r5 + beq _081196FC + ldrb r0, [r4, 0x2] + cmp r0, 0x2 + beq _081196FC +_081196F6: + strb r1, [r4, 0x2] + movs r0, 0x4 + b _08119750 +_081196FC: + ldr r1, =0x02037590 + movs r0, 0x2 + strb r0, [r1, 0x2] + movs r0, 0xC + b _08119750 + .pool +_0811970C: + mov r0, r9 + strb r0, [r4, 0x8] + adds r0, r6, 0 + mov r1, r10 + mov r2, r8 + bl CheckMovementInputAcroBike + lsls r0, 24 + lsrs r0, 24 + b _08119750 +_08119720: + ldrb r0, [r6] + cmp r0, 0 + bne _08119736 + strb r5, [r6] + mov r1, r9 + strb r1, [r4, 0x8] + strb r0, [r4, 0x2] + bl sub_811A128 + movs r0, 0x5 + b _08119750 +_08119736: + cmp r2, r0 + beq _08119748 + ldrb r0, [r4, 0x2] + cmp r0, 0x2 + beq _08119748 + movs r0, 0 + strb r0, [r4, 0x2] + movs r0, 0x5 + b _08119750 +_08119748: + ldr r1, =0x02037590 + movs r0, 0x2 + strb r0, [r1, 0x2] + movs r0, 0xA +_08119750: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end CheckMovementInputAcroBikeMovingWheelie + + thumb_func_start CheckMovementInputAcroBikeUnknownMode5 +CheckMovementInputAcroBikeUnknownMode5: @ 8119764 + push {r4-r6,lr} + mov r6, r8 + push {r6} + mov r8, r0 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + ldr r6, =0x02037590 + ldrb r1, [r6, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldrb r2, [r0, 0x1] + movs r1, 0x3 + negs r1, r1 + ands r1, r2 + strb r1, [r0, 0x1] + ldrb r1, [r0, 0x18] + lsls r1, 28 + lsrs r1, 28 + bl FieldObjectSetDirection + movs r0, 0 + strb r0, [r6, 0x8] + mov r0, r8 + adds r1, r4, 0 + adds r2, r5, 0 + bl CheckMovementInputAcroBike + lsls r0, 24 + lsrs r0, 24 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end CheckMovementInputAcroBikeUnknownMode5 + + thumb_func_start CheckMovementInputAcroBikeUnknownMode6 +CheckMovementInputAcroBikeUnknownMode6: @ 81197C0 + push {r4,lr} + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + ldr r4, =0x02037590 + movs r3, 0 + strb r3, [r4, 0x8] + bl CheckMovementInputAcroBike + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end CheckMovementInputAcroBikeUnknownMode6 + + thumb_func_start sub_81197E4 +sub_81197E4: @ 81197E4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl PlayerFaceDirection + pop {r0} + bx r0 + thumb_func_end sub_81197E4 + + thumb_func_start sub_81197F4 +sub_81197F4: @ 81197F4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r5, r0, r1 + ldrb r1, [r5, 0x1E] + adds r0, r4, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + bne _0811981A + ldrb r0, [r5, 0x18] + lsrs r4, r0, 4 +_0811981A: + adds r0, r4, 0 + bl PlayerFaceDirection + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81197F4 + + thumb_func_start sub_8119830 +sub_8119830: @ 8119830 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + ldrb r1, [r4, 0x1E] + adds r0, r5, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + bne _08119868 + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl sub_81197E4 + b _081198BA + .pool +_08119868: + adds r0, r5, 0 + bl sub_8119E38 + lsls r0, 24 + lsrs r4, r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0xA + bhi _081198B4 + cmp r4, 0x6 + bne _0811988A + adds r0, r5, 0 + bl PlayerJumpLedge + b _081198BA +_0811988A: + cmp r4, 0x4 + bne _081198A2 + adds r0, r5, 0 + bl IsPlayerCollidingWithFarawayIslandMew + lsls r0, 24 + cmp r0, 0 + beq _081198A2 + adds r0, r5, 0 + bl PlayerOnBikeCollideWithFarawayIslandMew + b _081198BA +_081198A2: + subs r0, r4, 0x5 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _081198BA + adds r0, r6, 0 + bl PlayerOnBikeCollide + b _081198BA +_081198B4: + adds r0, r6, 0 + bl PlayerGoSpeed2 +_081198BA: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8119830 + + thumb_func_start sub_81198C0 +sub_81198C0: @ 81198C0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r5, r0, r1 + ldrb r1, [r5, 0x1E] + adds r0, r4, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + bne _081198E6 + ldrb r0, [r5, 0x18] + lsrs r4, r0, 4 +_081198E6: + adds r0, r4, 0 + bl sub_808B8C0 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81198C0 + + thumb_func_start sub_81198FC +sub_81198FC: @ 81198FC + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r5, r0, r1 + ldrb r1, [r5, 0x1E] + adds r0, r4, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + bne _08119922 + ldrb r0, [r5, 0x18] + lsrs r4, r0, 4 +_08119922: + adds r0, r4, 0 + bl sub_808B8D8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81198FC + + thumb_func_start sub_8119938 +sub_8119938: @ 8119938 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r5, r0, r1 + ldrb r1, [r5, 0x1E] + adds r0, r4, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + bne _0811995E + ldrb r0, [r5, 0x18] + lsrs r4, r0, 4 +_0811995E: + adds r0, r4, 0 + bl sub_808B8A8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8119938 + + thumb_func_start sub_8119974 +sub_8119974: @ 8119974 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r5, r0, r1 + ldrb r1, [r5, 0x1E] + adds r0, r4, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + bne _0811999A + ldrb r0, [r5, 0x18] + lsrs r4, r0, 4 +_0811999A: + adds r0, r4, 0 + bl sub_808B8F0 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8119974 + + thumb_func_start sub_81199B0 +sub_81199B0: @ 81199B0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r5, r0, r1 + ldrb r1, [r5, 0x1E] + adds r0, r4, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + bne _081199E4 + ldrb r0, [r5, 0x18] + lsrs r0, 4 + bl sub_8119974 + b _08119A1E + .pool +_081199E4: + adds r0, r4, 0 + bl sub_8119E38 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08119A18 + cmp r1, 0x9 + beq _08119A18 + cmp r1, 0x6 + bne _08119A02 + adds r0, r4, 0 + bl sub_808B938 + b _08119A1E +_08119A02: + subs r0, r1, 0x5 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _08119A1E + cmp r1, 0xB + bhi _08119A18 + adds r0, r4, 0 + bl sub_8119974 + b _08119A1E +_08119A18: + adds r0, r4, 0 + bl sub_808B914 +_08119A1E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81199B0 + + thumb_func_start sub_8119A24 +sub_8119A24: @ 8119A24 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl sub_8119E38 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0 + beq _08119A58 + cmp r0, 0x7 + beq _08119A84 + cmp r0, 0x9 + bls _08119A50 + adds r0, r1, 0 + adds r1, r5, 0 + bl sub_8119FC4 + lsls r0, 24 + cmp r0, 0 + bne _08119A58 +_08119A50: + adds r0, r5, 0 + bl sub_81197F4 + b _08119A84 +_08119A58: + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + movs r0, 0x22 + bl audio_play + ldrb r0, [r4, 0x1] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4, 0x1] + adds r0, r5, 0 + bl sub_8093514 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc +_08119A84: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8119A24 + + thumb_func_start sub_8119A94 +sub_8119A94: @ 8119A94 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_808B95C + pop {r0} + bx r0 + thumb_func_end sub_8119A94 + + thumb_func_start sub_8119AA4 +sub_8119AA4: @ 8119AA4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + ldr r7, =0x02037590 + ldrb r1, [r7, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r5, r0, r1 + ldrb r1, [r5, 0x1E] + adds r0, r4, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + bne _08119ADC + ldrb r0, [r5, 0x18] + lsrs r0, 4 + bl sub_808B8A8 + b _08119B2C + .pool +_08119ADC: + adds r0, r4, 0 + bl sub_8119E38 + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xFF + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0xA + bhi _08119B22 + cmp r1, 0x6 + bne _08119AFE + adds r0, r4, 0 + bl sub_808B938 + b _08119B2C +_08119AFE: + cmp r1, 0x9 + beq _08119B12 + cmp r1, 0x4 + bhi _08119B2C + ldrb r0, [r5, 0x1E] + bl MetatileBehavior_IsBumpySlope + lsls r0, 24 + cmp r0, 0 + beq _08119B1A +_08119B12: + adds r0, r4, 0 + bl sub_808B8A8 + b _08119B2C +_08119B1A: + adds r0, r4, 0 + bl sub_808B980 + b _08119B2C +_08119B22: + adds r0, r6, 0 + bl sub_808B9BC + movs r0, 0x2 + strb r0, [r7, 0x2] +_08119B2C: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8119AA4 + + thumb_func_start sub_8119B34 +sub_8119B34: @ 8119B34 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + ldr r7, =0x02037590 + ldrb r1, [r7, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r5, r0, r1 + ldrb r1, [r5, 0x1E] + adds r0, r4, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + bne _08119B6C + ldrb r0, [r5, 0x18] + lsrs r0, 4 + bl sub_808B8C0 + b _08119BBC + .pool +_08119B6C: + adds r0, r4, 0 + bl sub_8119E38 + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xFF + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0xA + bhi _08119BB2 + cmp r1, 0x6 + bne _08119B8E + adds r0, r4, 0 + bl sub_808B938 + b _08119BBC +_08119B8E: + cmp r1, 0x9 + beq _08119BA2 + cmp r1, 0x4 + bhi _08119BBC + ldrb r0, [r5, 0x1E] + bl MetatileBehavior_IsBumpySlope + lsls r0, 24 + cmp r0, 0 + beq _08119BAA +_08119BA2: + adds r0, r4, 0 + bl sub_808B8A8 + b _08119BBC +_08119BAA: + adds r0, r4, 0 + bl sub_808B980 + b _08119BBC +_08119BB2: + adds r0, r6, 0 + bl sub_808B9A4 + movs r0, 0x2 + strb r0, [r7, 0x2] +_08119BBC: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8119B34 + + thumb_func_start sub_8119BC4 +sub_8119BC4: @ 8119BC4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r5, r0, r1 + ldrb r1, [r5, 0x1E] + adds r0, r4, 0 + bl sub_8119F74 + lsls r0, 24 + cmp r0, 0 + bne _08119BFC + ldrb r0, [r5, 0x18] + lsrs r0, 4 + bl sub_808B8D8 + b _08119C36 + .pool +_08119BFC: + adds r0, r4, 0 + bl sub_8119E38 + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xFF + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0xA + bhi _08119C30 + cmp r1, 0x6 + bne _08119C1E + adds r0, r4, 0 + bl PlayerJumpLedge + b _08119C36 +_08119C1E: + subs r0, r1, 0x5 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _08119C36 + adds r0, r4, 0 + bl sub_808B8D8 + b _08119C36 +_08119C30: + adds r0, r6, 0 + bl npc_use_some_d2s +_08119C36: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8119BC4 + + thumb_func_start sub_8119C3C +@ void sub_8119C3C(int buttons_new, int buttons_held) +sub_8119C3C: @ 8119C3C + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 16 + lsrs r2, r1, 16 + ldr r0, =0x02037590 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08119C5A + adds r0, r3, 0 + adds r1, r2, 0 + bl sub_8119C64 +_08119C5A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8119C3C + + thumb_func_start sub_8119C64 +@ void sub_8119C64(int buttons_new, int buttons_held) +sub_8119C64: @ 8119C64 + push {r4,r5,lr} + lsls r1, 16 + lsrs r5, r1, 16 + adds r0, r5, 0 + bl sub_8119DF8 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r4, =0x02037590 + ldr r0, [r4, 0xC] + movs r1, 0xF + ands r0, r1 + cmp r2, r0 + bne _08119C90 + ldrb r0, [r4, 0x14] + cmp r0, 0xFE + bhi _08119C9A + adds r0, 0x1 + strb r0, [r4, 0x14] + b _08119C9A + .pool +_08119C90: + adds r0, r2, 0 + bl sub_8119D80 + movs r0, 0 + strb r0, [r4, 0xB] +_08119C9A: + movs r0, 0xF + adds r2, r5, 0 + ands r2, r0 + ldr r4, =0x02037590 + ldr r0, [r4, 0x10] + movs r1, 0xF + ands r0, r1 + cmp r2, r0 + bne _08119CBC + ldrb r0, [r4, 0x1C] + cmp r0, 0xFE + bhi _08119CC6 + adds r0, 0x1 + strb r0, [r4, 0x1C] + b _08119CC6 + .pool +_08119CBC: + adds r0, r2, 0 + bl sub_8119DBC + movs r0, 0 + strb r0, [r4, 0xB] +_08119CC6: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8119C64 + + thumb_func_start sub_8119CCC +sub_8119CCC: @ 8119CCC + push {r4,r5,lr} + adds r3, r0, 0 + adds r4, r1, 0 + movs r2, 0 + ldrb r0, [r3] + cmp r0, 0 + beq _08119CF6 + ldr r5, =0x020375a4 +_08119CDC: + adds r0, r2, r5 + adds r1, r3, r2 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bhi _08119D0C + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r3, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _08119CDC +_08119CF6: + movs r2, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _08119D26 + ldr r3, =0x020375ac +_08119D00: + adds r0, r2, r3 + adds r1, r4, r2 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bls _08119D18 +_08119D0C: + movs r0, 0 + b _08119D28 + .pool +_08119D18: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r4, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _08119D00 +_08119D26: + movs r0, 0x1 +_08119D28: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8119CCC + + thumb_func_start sub_8119D30 +sub_8119D30: @ 8119D30 + push {r4-r6,lr} + movs r6, 0 + movs r5, 0 +_08119D36: + ldr r0, =gUnknown_085974C0 + adds r4, r5, r0 + ldr r0, =0x02037590 + ldr r1, [r0, 0xC] + ldr r2, [r0, 0x10] + ldr r0, [r4, 0x8] + ands r1, r0 + ldr r0, [r4, 0xC] + ands r2, r0 + ldr r0, [r4] + cmp r1, r0 + bne _08119D70 + ldr r0, [r4, 0x4] + cmp r2, r0 + bne _08119D70 + ldr r0, [r4, 0x10] + ldr r1, [r4, 0x14] + bl sub_8119CCC + lsls r0, 24 + cmp r0, 0 + beq _08119D70 + ldrb r0, [r4, 0x18] + b _08119D7A + .pool +_08119D70: + adds r5, 0x1C + adds r6, 0x1 + cmp r6, 0x3 + bls _08119D36 + movs r0, 0 +_08119D7A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8119D30 + + thumb_func_start sub_8119D80 +sub_8119D80: @ 8119D80 + push {r4,lr} + lsls r0, 24 + ldr r3, =0x02037590 + ldr r2, [r3, 0xC] + lsls r2, 4 + movs r1, 0xF0 + lsls r1, 20 + ands r1, r0 + lsrs r1, 24 + orrs r2, r1 + str r2, [r3, 0xC] + movs r1, 0x7 + adds r4, r3, 0 + adds r3, 0x14 +_08119D9C: + adds r2, r1, r3 + subs r1, 0x1 + adds r0, r1, r3 + ldrb r0, [r0] + strb r0, [r2] + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0 + bne _08119D9C + movs r0, 0x1 + strb r0, [r4, 0x14] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8119D80 + + thumb_func_start sub_8119DBC +sub_8119DBC: @ 8119DBC + push {r4,lr} + lsls r0, 24 + ldr r3, =0x02037590 + ldr r2, [r3, 0x10] + lsls r2, 4 + movs r1, 0xF0 + lsls r1, 20 + ands r1, r0 + lsrs r1, 24 + orrs r2, r1 + str r2, [r3, 0x10] + movs r1, 0x7 + adds r4, r3, 0 + adds r3, 0x1C +_08119DD8: + adds r2, r1, r3 + subs r1, 0x1 + adds r0, r1, r3 + ldrb r0, [r0] + strb r0, [r2] + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0 + bne _08119DD8 + movs r0, 0x1 + strb r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8119DBC + + thumb_func_start sub_8119DF8 +sub_8119DF8: @ 8119DF8 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + adds r2, r1, 0 + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08119E0C + movs r0, 0x2 + b _08119E32 +_08119E0C: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08119E18 + movs r0, 0x1 + b _08119E32 +_08119E18: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08119E24 + movs r0, 0x3 + b _08119E32 +_08119E24: + movs r0, 0x10 + ands r2, r0 + cmp r2, 0 + bne _08119E30 + movs r0, 0 + b _08119E32 +_08119E30: + movs r0, 0x4 +_08119E32: + pop {r1} + bx r1 + thumb_func_end sub_8119DF8 + + thumb_func_start sub_8119E38 +sub_8119E38: @ 8119E38 + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + ldrh r1, [r4, 0x10] + add r0, sp, 0x4 + strh r1, [r0] + ldrh r0, [r4, 0x12] + mov r5, sp + adds r5, 0x6 + strh r0, [r5] + adds r0, r6, 0 + add r1, sp, 0x4 + adds r2, r5, 0 + bl MoveCoords + add r0, sp, 0x4 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + add r1, sp, 0x4 + movs r3, 0 + ldrsh r1, [r1, r3] + movs r3, 0 + ldrsh r2, [r5, r3] + str r0, [sp] + adds r0, r4, 0 + adds r3, r6, 0 + bl sub_8119EA4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8119E38 + + thumb_func_start sub_8119EA4 +sub_8119EA4: @ 8119EA4 + push {r4,r5,lr} + sub sp, 0x4 + ldr r4, [sp, 0x10] + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + adds r5, r4, 0 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + str r5, [sp] + bl CheckForFieldObjectCollision + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bhi _08119EE4 + cmp r4, 0 + bne _08119EE0 + adds r0, r5, 0 + bl IsRunningDisallowedByMetatile + lsls r0, 24 + cmp r0, 0 + beq _08119EDC + movs r4, 0x2 +_08119EDC: + cmp r4, 0 + beq _08119EE4 +_08119EE0: + bl sub_8119F50 +_08119EE4: + adds r0, r4, 0 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8119EA4 + + thumb_func_start sub_8119EF0 +sub_8119EF0: @ 8119EF0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl IsRunningDisallowedByMetatile + lsls r0, 24 + cmp r0, 0 + bne _08119F08 + ldr r0, =0x02037318 + ldrb r0, [r0, 0x17] + cmp r0, 0x8 + bne _08119F10 +_08119F08: + movs r0, 0x1 + b _08119F12 + .pool +_08119F10: + movs r0, 0 +_08119F12: + pop {r1} + bx r1 + thumb_func_end sub_8119EF0 + + thumb_func_start IsRunningDisallowedByMetatile +@ bool8 IsRunningDisallowedByMetatile(u8 metatileBehavior) +IsRunningDisallowedByMetatile: @ 8119F18 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl MetatileBehavior_IsRunningDisallowed + lsls r0, 24 + cmp r0, 0 + bne _08119F42 + adds r0, r4, 0 + bl MetatileBehavior_IsFortreeBridge + lsls r0, 24 + cmp r0, 0 + beq _08119F46 + bl PlayerGetZCoord + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + bne _08119F46 +_08119F42: + movs r0, 0x1 + b _08119F48 +_08119F46: + movs r0, 0 +_08119F48: + pop {r4} + pop {r1} + bx r1 + thumb_func_end IsRunningDisallowedByMetatile + + thumb_func_start sub_8119F50 +sub_8119F50: @ 8119F50 + push {lr} + ldr r0, =0x0203ab54 + ldrb r0, [r0] + cmp r0, 0 + beq _08119F66 + ldr r1, =0x0203ab55 + ldrb r0, [r1] + cmp r0, 0x63 + bhi _08119F66 + adds r0, 0x1 + strb r0, [r1] +_08119F66: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8119F50 + + thumb_func_start sub_8119F74 +sub_8119F74: @ 8119F74 + push {r4,r5,lr} + lsls r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + adds r5, r4, 0 + movs r1, 0xFD + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08119F9E + adds r0, r4, 0 + bl MetatileBehavior_IsIsolatedVerticalRail + lsls r0, 24 + cmp r0, 0 + bne _08119FB6 + adds r0, r4, 0 + bl MetatileBehavior_IsVerticalRail + b _08119FB0 +_08119F9E: + adds r0, r5, 0 + bl MetatileBehavior_IsIsolatedHorizontalRail + lsls r0, 24 + cmp r0, 0 + bne _08119FB6 + adds r0, r5, 0 + bl MetatileBehavior_IsHorizontalRail +_08119FB0: + lsls r0, 24 + cmp r0, 0 + beq _08119FBA +_08119FB6: + movs r0, 0 + b _08119FBC +_08119FBA: + movs r0, 0x1 +_08119FBC: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8119F74 + + thumb_func_start sub_8119FC4 +sub_8119FC4: @ 8119FC4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + lsls r1, 24 + movs r3, 0xFF + lsls r3, 24 + adds r1, r3 + lsrs r1, 24 + cmp r1, 0x1 + bhi _08119FE4 + cmp r0, 0xA + beq _08119FEC + cmp r0, 0xC + bne _08119FF0 + b _08119FEC +_08119FE4: + cmp r2, 0xB + beq _08119FEC + cmp r2, 0xD + bne _08119FF0 +_08119FEC: + movs r0, 0 + b _08119FF2 +_08119FF0: + movs r0, 0x1 +_08119FF2: + pop {r1} + bx r1 + thumb_func_end sub_8119FC4 + + thumb_func_start sub_8119FF8 +sub_8119FF8: @ 8119FF8 + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x02037590 + ldrb r1, [r0] + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + bne _0811A038 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + 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 IsRunningDisallowedByMetatile + lsls r0, 24 + cmp r0, 0 + bne _0811A038 + movs r0, 0 + b _0811A03A + .pool +_0811A038: + movs r0, 0x1 +_0811A03A: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8119FF8 + + thumb_func_start player_should_look_direction_be_enforced_upon_movement +player_should_look_direction_be_enforced_upon_movement: @ 811A044 + push {lr} + movs r0, 0x4 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _0811A078 + ldr r2, =0x02037350 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1E] + bl MetatileBehavior_IsBumpySlope + lsls r0, 24 + cmp r0, 0 + beq _0811A078 + movs r0, 0 + b _0811A07A + .pool +_0811A078: + movs r0, 0x1 +_0811A07A: + pop {r1} + bx r1 + thumb_func_end player_should_look_direction_be_enforced_upon_movement + + thumb_func_start GetOnOffBike +@ void GetOnOffBike(u8 transitionFlags) +GetOnOffBike: @ 811A080 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x02037348 + movs r0, 0 + strb r0, [r1] + ldr r0, =0x02037590 + ldrb r1, [r0] + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + beq _0811A0B0 + movs r0, 0x1 + bl SetPlayerAvatarTransitionFlags + bl sav1_reset_battle_music_maybe + bl sub_8085784 + b _0811A0C4 + .pool +_0811A0B0: + adds r0, r2, 0 + bl SetPlayerAvatarTransitionFlags + ldr r4, =0x00000193 + adds r0, r4, 0 + bl sav1_set_battle_music_maybe + adds r0, r4, 0 + bl sub_80858C4 +_0811A0C4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end GetOnOffBike + + thumb_func_start sub_811A0D0 +sub_811A0D0: @ 811A0D0 + push {lr} + ldr r2, =0x02037590 + movs r3, 0 + strb r3, [r2, 0x8] + strb r3, [r2, 0x9] + strb r3, [r2, 0xA] + strb r3, [r2, 0xB] + str r0, [r2, 0xC] + str r1, [r2, 0x10] + movs r1, 0 + adds r2, 0x14 +_0811A0E6: + adds r0, r1, r2 + strb r3, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x7 + bls _0811A0E6 + movs r1, 0 + ldr r3, =0x020375ac + movs r2, 0 +_0811A0FA: + adds r0, r1, r3 + strb r2, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x7 + bls _0811A0FA + pop {r0} + bx r0 + .pool + thumb_func_end sub_811A0D0 + + thumb_func_start sub_811A114 +sub_811A114: @ 811A114 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02037590 + strb r0, [r2, 0xA] + lsrs r1, r0, 1 + adds r0, r1 + strb r0, [r2, 0xB] + bx lr + .pool + thumb_func_end sub_811A114 + + thumb_func_start sub_811A128 +sub_811A128: @ 811A128 + ldr r1, =0x02037590 + movs r0, 0 + strb r0, [r1, 0xA] + strb r0, [r1, 0xB] + bx lr + .pool + thumb_func_end sub_811A128 + + thumb_func_start sub_811A138 +sub_811A138: @ 811A138 + push {lr} + sub sp, 0x8 + ldr r1, =gUnknown_085974B8 + mov r0, sp + movs r2, 0x6 + bl memcpy + ldr r2, =0x02037590 + ldrb r1, [r2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0811A168 + ldrb r0, [r2, 0xA] + lsls r0, 1 + add r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + b _0811A182 + .pool +_0811A168: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0811A174 + movs r0, 0x3 + b _0811A182 +_0811A174: + movs r0, 0x88 + ands r0, r1 + cmp r0, 0 + bne _0811A180 + movs r0, 0x1 + b _0811A182 +_0811A180: + movs r0, 0x2 +_0811A182: + add sp, 0x8 + pop {r1} + bx r1 + thumb_func_end sub_811A138 + + thumb_func_start sub_811A188 +sub_811A188: @ 811A188 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, =0x02037590 + ldrb r1, [r5] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0811A1D0 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + 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_IsBumpySlope + lsls r0, 24 + cmp r0, 0 + beq _0811A1D0 + movs r0, 0x2 + strb r0, [r5, 0x8] + bl player_get_direction_upper_nybble + lsls r0, 24 + lsrs r0, 24 + bl sub_808C1B4 +_0811A1D0: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811A188 + + thumb_func_start IsRunningDisallowed +@ bool8 IsRunningDisallowed(u8 metatileBehavior) +IsRunningDisallowed: @ 811A1DC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02037318 + ldrb r1, [r0, 0x1A] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0811A1FC + adds r0, r2, 0 + bl IsRunningDisallowedByMetatile + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0811A204 +_0811A1FC: + movs r0, 0x1 + b _0811A206 + .pool +_0811A204: + movs r0, 0 +_0811A206: + pop {r1} + bx r1 + thumb_func_end IsRunningDisallowed + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/blend_palette.s b/asm/blend_palette.s new file mode 100644 index 000000000..dab119a92 --- /dev/null +++ b/asm/blend_palette.s @@ -0,0 +1,90 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start pal_fade_1 +pal_fade_1: @ 806F98C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 16 + lsrs r1, 16 + mov r12, r1 + lsls r2, 24 + lsrs r7, r2, 24 + mov r0, sp + strh r3, [r0] + movs r6, 0 + cmp r6, r12 + bcs _0806FA12 + ldr r0, =0x02037714 + mov r10, r0 + ldr r1, =0x02037b14 + mov r9, r1 +_0806F9BA: + mov r0, r8 + adds r5, r6, r0 + lsls r5, 16 + lsrs r5, 15 + mov r1, r10 + adds r0, r5, r1 + ldr r3, [r0] + lsls r4, r3, 27 + lsls r2, r3, 22 + lsls r3, 17 + add r5, r9 + lsrs r4, 27 + ldr r1, [sp] + lsls r0, r1, 27 + lsrs r0, 27 + subs r0, r4 + muls r0, r7 + asrs r0, 4 + adds r4, r0 + lsrs r2, 27 + lsls r0, r1, 22 + lsrs r0, 27 + subs r0, r2 + muls r0, r7 + asrs r0, 4 + adds r2, r0 + lsls r2, 5 + orrs r4, r2 + lsrs r3, 27 + lsls r1, 17 + lsrs r1, 27 + subs r1, r3 + adds r0, r1, 0 + muls r0, r7 + asrs r0, 4 + adds r3, r0 + lsls r3, 10 + orrs r4, r3 + strh r4, [r5] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, r12 + bcc _0806F9BA +_0806FA12: + 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 pal_fade_1 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/pixel_buffer.s b/asm/blit.s similarity index 99% rename from asm/pixel_buffer.s rename to asm/blit.s index 70229b068..5df45e77e 100644 --- a/asm/pixel_buffer.s +++ b/asm/blit.s @@ -1,4 +1,5 @@ .include "asm/macros.inc" + .include "constants/constants.inc" .syntax unified diff --git a/asm/cable_car.s b/asm/cable_car.s new file mode 100644 index 000000000..e1a9868ec --- /dev/null +++ b/asm/cable_car.s @@ -0,0 +1,2882 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_814FC70 +sub_814FC70: @ 814FC70 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0814FC8E + ldr r0, =sub_814FCC8 + bl SetMainCallback2 + adds r0, r4, 0 + bl DestroyTask +_0814FC8E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814FC70 + + thumb_func_start sub_814FC9C +sub_814FC9C: @ 814FC9C + push {lr} + sub sp, 0x4 + bl script_env_2_enable + ldr r0, =sub_814FC70 + movs r1, 0x1 + bl CreateTask + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_814FC9C + + thumb_func_start sub_814FCC8 +sub_814FCC8: @ 814FCC8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + movs r4, 0 + str r4, [sp, 0x14] + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r6, r1, 0 + cmp r0, 0x9 + bhi _0814FD20 + lsls r0, 2 + ldr r1, =_0814FCF8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0814FCF8: + .4byte _0814FD20 + .4byte _0814FDD8 + .4byte _0814FE90 + .4byte _0814FF50 + .4byte _0814FF7C + .4byte _0814FF98 + .4byte _0814FFF8 + .4byte _08150090 + .4byte _08150190 + .4byte _081501C8 +_0814FD20: + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl sub_8150B6C + bl remove_some_task + movs r3, 0xC0 + lsls r3, 19 + movs r4, 0xC0 + lsls r4, 9 + add r0, sp, 0x10 + mov r9, r0 + add r2, sp, 0xC + movs r6, 0 + ldr r1, =0x040000d4 + movs r5, 0x80 + lsls r5, 5 + ldr r7, =0x81000800 + movs r0, 0x81 + lsls r0, 24 + mov r8, r0 +_0814FD4E: + strh r6, [r2] + add r0, sp, 0xC + str r0, [r1] + str r3, [r1, 0x4] + str r7, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r3, r5 + subs r4, r5 + cmp r4, r5 + bhi _0814FD4E + strh r6, [r2] + add r2, sp, 0xC + str r2, [r1] + str r3, [r1, 0x4] + lsrs r0, r4, 1 + mov r3, r8 + orrs r0, r3 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r0, 0xE0 + lsls r0, 19 + movs r3, 0x80 + lsls r3, 3 + movs r4, 0 + str r4, [sp, 0x10] + ldr r2, =0x040000d4 + mov r1, r9 + str r1, [r2] + str r0, [r2, 0x4] + lsrs r0, r3, 2 + movs r1, 0x85 + lsls r1, 24 + orrs r0, r1 + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + movs r1, 0xA0 + lsls r1, 19 + add r0, sp, 0xC + strh r4, [r0] + str r0, [r2] + str r1, [r2, 0x4] + lsrs r3, 1 + movs r0, 0x81 + lsls r0, 24 + orrs r3, r0 + str r3, [r2, 0x8] + ldr r0, [r2, 0x8] + ldr r4, =0x0203abac + ldr r0, =0x00004110 + bl AllocZeroed + str r0, [r4] + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + b _08150224 + .pool +_0814FDD8: + bl ResetAllObjectData + bl ResetTasks + bl ResetObjectPaletteAllocator + bl sub_80A1A74 + bl reset_temp_tile_data_buffers + bl sub_80AAFA4 + movs r4, 0 + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0xF0 + movs r2, 0 +_0814FDFC: + lsls r0, r4, 2 + adds r0, r1, r0 + str r2, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x13 + bls _0814FDFC + bl sound_sources_off + bl map_music_set_to_zero + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085CD66C + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r4, =0x0203abac + ldr r1, [r4] + adds r1, 0xFC + movs r0, 0 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r3, =0x000010fc + adds r1, r3 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x000020fc + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r2, =0x000030fc + adds r1, r2 + movs r0, 0x3 + bl SetBgTilemapBuffer + ldr r2, =0x02021bbc + ldr r1, =0x02021bbe + movs r0, 0 + strh r0, [r1] + strh r0, [r2] + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + ldrb r0, [r1] + adds r0, 0x1 + b _08150224 + .pool +_0814FE90: + movs r4, 0 + add r5, sp, 0x14 + ldr r6, =gUnknown_085CDB54 +_0814FE96: + lsls r0, r4, 3 + adds r0, r6 + bl LoadCompressedObjectPic + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _0814FE96 + ldr r0, =gUnknown_085CDB74 + bl LoadTaggedObjectPalettes + ldr r0, =gUnknown_085CD67C + adds r1, r5, 0 + bl malloc_and_decompress + ldr r4, =0x0203abac + ldr r1, [r4] + ldr r2, =0x000040fc + adds r1, r2 + str r0, [r1] + ldr r0, =gUnknown_085CD7D4 + adds r1, r5, 0 + bl malloc_and_decompress + ldr r1, [r4] + movs r3, 0x82 + lsls r3, 7 + adds r1, r3 + str r0, [r1] + ldr r0, =gUnknown_085CD958 + adds r1, r5, 0 + bl malloc_and_decompress + ldr r1, [r4] + ldr r2, =0x00004104 + adds r1, r2 + str r0, [r1] + ldr r0, =gUnknown_085CDB30 + adds r1, r5, 0 + bl malloc_and_decompress + ldr r1, [r4] + ldr r3, =0x0000410c + adds r2, r1, r3 + str r0, [r2] + ldr r0, =0x00004108 + adds r1, r0 + ldr r0, =gUnknown_085CDB1C + str r0, [r1] + ldr r1, =gUnknown_08DBA5B8 + movs r0, 0 + str r0, [sp] + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + b _08150224 + .pool +_0814FF50: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + beq _0814FF5C + b _08150226 +_0814FF5C: + ldr r0, =gUnknown_08DBA518 + movs r1, 0 + movs r2, 0x80 + bl gpu_pal_apply + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + ldrb r0, [r1] + adds r0, 0x1 + b _08150224 + .pool +_0814FF7C: + bl sub_8150D28 + bl RunTasks + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + b _08150224 + .pool +_0814FF98: + ldr r0, =0x0203abac + ldr r0, [r0] + ldrb r0, [r0, 0x2] + cmp r0, 0x7 + bne _0814FFB4 + movs r2, 0x87 + lsls r2, 3 + adds r1, r6, r2 + ldrb r0, [r1] + adds r0, 0x1 + b _08150224 + .pool +_0814FFB4: + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0xF0 + ldr r0, [r1] + cmp r0, 0 + bne _0814FFC4 + b _08150226 +_0814FFC4: + movs r4, 0 + adds r3, r1, 0 + movs r5, 0xD + negs r5, r5 +_0814FFCC: + lsls r0, r4, 2 + adds r0, r3, r0 + ldr r2, [r0] + cmp r2, 0 + beq _0814FFDE + ldrb r1, [r2, 0x5] + adds r0, r5, 0 + ands r0, r1 + strb r0, [r2, 0x5] +_0814FFDE: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x13 + bls _0814FFCC + movs r3, 0x87 + lsls r3, 3 + adds r1, r6, r3 + ldrb r0, [r1] + adds r0, 0x1 + b _08150224 + .pool +_0814FFF8: + ldr r6, =0x0203abac + ldr r0, [r6] + movs r1, 0x82 + lsls r1, 7 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x20 + str r0, [sp] + movs r0, 0xF + str r0, [sp, 0x4] + movs r5, 0x11 + str r5, [sp, 0x8] + movs r0, 0x1 + movs r2, 0 + movs r3, 0x11 + bl CopyToBgTilemapBufferRect_ChangePalette + ldr r0, [r6] + ldr r2, =0x00004104 + adds r0, r2 + ldr r1, [r0] + movs r0, 0x1E + str r0, [sp] + movs r3, 0x14 + mov r8, r3 + str r3, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBufferRect_ChangePalette + ldr r0, [r6] + ldr r1, =0x00004108 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x5 + str r0, [sp] + movs r4, 0x2 + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBufferRect_ChangePalette + ldr r0, [r6] + ldr r2, =0x0000410c + adds r0, r2 + ldr r1, [r0] + str r4, [sp] + mov r3, r8 + str r3, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r2, 0 + movs r3, 0x2 + bl CopyToBgTilemapBufferRect_ChangePalette + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + b _08150224 + .pool +_08150090: + ldr r0, =0x020375e0 + ldrb r0, [r0] + bl sub_81514C8 + ldr r1, =0x0203abac + mov r9, r1 + ldr r0, [r1] + ldr r2, =0x000040fc + mov r8, r2 + add r0, r8 + ldr r1, [r0] + adds r1, 0x90 + movs r6, 0xC + str r6, [sp] + movs r5, 0x3 + str r5, [sp, 0x4] + movs r4, 0x11 + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0 + movs r3, 0xE + bl CopyToBgTilemapBufferRect_ChangePalette + mov r3, r9 + ldr r0, [r3] + add r0, r8 + ldr r1, [r0] + adds r1, 0xD8 + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0xC + movs r3, 0x11 + bl CopyToBgTilemapBufferRect_ChangePalette + mov r1, r9 + ldr r0, [r1] + add r0, r8 + ldr r1, [r0] + movs r2, 0x90 + lsls r2, 1 + adds r1, r2 + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0x18 + movs r3, 0x14 + bl CopyToBgTilemapBufferRect_ChangePalette + mov r3, r9 + ldr r0, [r3] + add r0, r8 + ldr r1, [r0] + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0 + movs r3, 0x11 + bl CopyToBgTilemapBufferRect_ChangePalette + mov r1, r9 + ldr r0, [r1] + add r0, r8 + ldr r1, [r0] + adds r1, 0x48 + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0 + movs r3, 0x14 + bl CopyToBgTilemapBufferRect_ChangePalette + mov r2, r9 + ldr r0, [r2] + add r0, r8 + ldr r1, [r0] + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0xC + movs r3, 0x14 + bl CopyToBgTilemapBufferRect_ChangePalette + mov r3, r9 + ldr r0, [r3] + add r0, r8 + ldr r1, [r0] + adds r1, 0x48 + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0xC + movs r3, 0x17 + bl CopyToBgTilemapBufferRect_ChangePalette + mov r1, r9 + ldr r0, [r1] + add r0, r8 + ldr r1, [r0] + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0x18 + movs r3, 0x17 + bl CopyToBgTilemapBufferRect_ChangePalette + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + b _08150224 + .pool +_08150190: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r1, 0x3 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =0x000001a9 + movs r1, 0x1 + bl sub_80A3194 + movs r0, 0x1 + bl sub_8150B6C + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + ldrb r0, [r1] + adds r0, 0x1 + b _08150224 + .pool +_081501C8: + ldr r3, =0x04000208 + ldrh r2, [r3] + movs r0, 0 + strh r0, [r3] + ldr r4, =0x04000200 + ldrh r0, [r4] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r4] + strh r2, [r3] + ldr r0, =sub_8150800 + bl SetVBlankCallback + ldr r0, =mainloop + bl SetMainCallback2 + ldr r0, =sub_81503E4 + movs r1, 0 + bl CreateTask + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0 + bne _08150218 + ldr r0, =sub_8150550 + b _0815021A + .pool +_08150218: + ldr r0, =sub_8150664 +_0815021A: + movs r1, 0x1 + bl CreateTask + ldr r1, =0x0203abac + ldr r1, [r1] +_08150224: + strb r0, [r1] +_08150226: + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814FCC8 + + thumb_func_start mainloop +mainloop: @ 815023C + push {lr} + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + bl sound_something + pop {r0} + bx r0 + thumb_func_end mainloop + + thumb_func_start c2_8011A1C +c2_8011A1C: @ 8150258 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + movs r4, 0 + movs r0, 0 + bl HideBg + movs r0, 0x1 + bl HideBg + movs r0, 0x2 + bl HideBg + movs r0, 0x3 + bl HideBg + movs r0, 0 + bl sub_8150B6C + ldr r0, =0x02021bbc + strh r4, [r0] + movs r0, 0 + bl sub_80AB130 + add r0, sp, 0x4 + mov r8, r0 + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0xF0 + movs r2, 0 +_08150298: + lsls r0, r4, 2 + adds r0, r1, r0 + str r2, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x13 + bls _08150298 + bl ResetTasks + bl ResetAllObjectData + bl sub_80A1A74 + movs r0, 0 + bl UnsetBgTilemapBuffer + movs r0, 0x1 + bl UnsetBgTilemapBuffer + movs r0, 0x2 + bl UnsetBgTilemapBuffer + movs r0, 0x3 + bl UnsetBgTilemapBuffer + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r6, =0x0203abac + ldr r0, [r6] + ldr r2, =0x00004108 + adds r1, r0, r2 + movs r5, 0 + str r5, [r1] + ldr r4, =0x0000410c + adds r0, r4 + ldr r0, [r0] + bl Free + ldr r0, [r6] + adds r4, r0, r4 + str r5, [r4] + ldr r4, =0x00004104 + adds r0, r4 + ldr r0, [r0] + bl Free + ldr r0, [r6] + adds r4, r0, r4 + str r5, [r4] + movs r4, 0x82 + lsls r4, 7 + adds r0, r4 + ldr r0, [r0] + bl Free + ldr r0, [r6] + adds r4, r0, r4 + str r5, [r4] + ldr r4, =0x000040fc + adds r0, r4 + ldr r0, [r0] + bl Free + ldr r0, [r6] + adds r4, r0, r4 + str r5, [r4] + bl Free + str r5, [r6] + movs r2, 0xC0 + lsls r2, 19 + movs r3, 0xC0 + lsls r3, 9 + mov r4, sp + movs r6, 0 + ldr r1, =0x040000d4 + movs r5, 0x80 + lsls r5, 5 + ldr r7, =0x81000800 + movs r0, 0x81 + lsls r0, 24 + mov r12, r0 +_08150340: + strh r6, [r4] + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + str r7, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r2, r5 + subs r3, r5 + cmp r3, r5 + bhi _08150340 + strh r6, [r4] + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + lsrs r0, r3, 1 + mov r2, r12 + orrs r0, r2 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r0, 0xE0 + lsls r0, 19 + movs r3, 0x80 + lsls r3, 3 + movs r4, 0 + str r4, [sp, 0x4] + ldr r2, =0x040000d4 + mov r1, r8 + str r1, [r2] + str r0, [r2, 0x4] + lsrs r0, r3, 2 + movs r1, 0x85 + lsls r1, 24 + orrs r0, r1 + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + movs r1, 0xA0 + lsls r1, 19 + mov r0, sp + strh r4, [r0] + str r0, [r2] + str r1, [r2, 0x4] + lsrs r3, 1 + movs r0, 0x81 + lsls r0, 24 + orrs r3, r0 + str r3, [r2, 0x8] + ldr r0, [r2, 0x8] + bl warp_in + ldr r0, =0x03005dac + str r4, [r0] + ldr r0, =c2_load_new_map + bl SetMainCallback2 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end c2_8011A1C + + thumb_func_start sub_81503E4 +sub_81503E4: @ 81503E4 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + ldr r5, =0x0203abac + ldr r3, [r5] + ldrh r0, [r3, 0x6] + adds r0, 0x1 + strh r0, [r3, 0x6] + ldrb r2, [r3, 0x1] + adds r7, r5, 0 + cmp r2, 0x2 + beq _081504EA + cmp r2, 0x2 + bgt _08150414 + cmp r2, 0 + beq _08150422 + cmp r2, 0x1 + beq _0815043C + b _08150542 + .pool +_08150414: + cmp r2, 0x3 + bne _0815041A + b _08150510 +_0815041A: + cmp r2, 0xFF + bne _08150420 + b _08150528 +_08150420: + b _08150542 +_08150422: + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r3, 0x4] + cmp r0, r1 + beq _0815042E + b _08150542 +_0815042E: + ldrb r0, [r3, 0x2] + bl weather_set + ldr r1, [r5] + movs r0, 0x1 + strb r0, [r1, 0x1] + b _08150542 +_0815043C: + ldrb r0, [r3, 0x2] + cmp r0, 0x2 + beq _08150490 + cmp r0, 0x7 + beq _08150448 + b _08150542 +_08150448: + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + adds r2, r0, 0 + adds r2, 0xF0 + ldr r0, [r2] + cmp r0, 0 + beq _08150542 + ldrb r1, [r0, 0x5] + movs r0, 0xC + ands r0, r1 + cmp r0, 0 + beq _08150542 + adds r3, r2, 0 + movs r5, 0xD + negs r5, r5 +_08150466: + lsls r0, r4, 2 + adds r0, r3, r0 + ldr r2, [r0] + cmp r2, 0 + beq _08150478 + ldrb r1, [r2, 0x5] + adds r0, r5, 0 + ands r0, r1 + strb r0, [r2, 0x5] +_08150478: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x13 + bls _08150466 + ldr r1, [r7] + movs r0, 0x2 + strb r0, [r1, 0x1] + b _08150542 + .pool +_08150490: + ldr r0, =gUnknown_0854C14C + ldr r2, [r0] + movs r1, 0xDA + lsls r1, 3 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x2 + bne _081504A8 + strb r0, [r3, 0x1] + b _08150542 + .pool +_081504A8: + ldrh r1, [r3, 0x6] + ldrh r0, [r3, 0x4] + adds r0, 0x8 + cmp r1, r0 + blt _08150542 + adds r6, r2, 0 + adds r6, 0xF0 + movs r5, 0x1 + movs r7, 0x5 + negs r7, r7 +_081504BC: + lsls r0, r4, 2 + adds r0, r6, r0 + ldr r0, [r0] + cmp r0, 0 + beq _081504DE + adds r3, r0, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsls r1, r2, 29 + lsrs r1, 31 + eors r1, r5 + ands r1, r5 + lsls r1, 2 + adds r0, r7, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_081504DE: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x13 + bls _081504BC + b _08150542 +_081504EA: + lsls r1, r0, 16 + ldr r0, =0x023a0000 + cmp r1, r0 + bne _08150542 + movs r0, 0x3 + strb r0, [r3, 0x1] + subs r0, 0x4 + str r4, [sp] + movs r1, 0x3 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + movs r0, 0x4 + bl play_sound_effect + b _08150542 + .pool +_08150510: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08150542 + movs r0, 0xFF + strb r0, [r3, 0x1] + b _08150542 + .pool +_08150528: + movs r0, 0 + bl SetVBlankCallback + adds r0, r6, 0 + bl DestroyTask + ldr r0, [r5] + ldrb r0, [r0] + bl DestroyTask + ldr r0, =c2_8011A1C + bl SetMainCallback2 +_08150542: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81503E4 + + thumb_func_start sub_8150550 +sub_8150550: @ 8150550 + push {r4-r6,lr} + sub sp, 0xC + ldr r6, =0x0203abac + ldr r1, [r6] + ldrb r0, [r1, 0x1] + cmp r0, 0xFF + beq _08150630 + ldrb r0, [r1, 0x14] + subs r0, 0x1 + strb r0, [r1, 0x14] + ldr r1, [r6] + ldrh r0, [r1, 0x6] + movs r3, 0x1 + ands r0, r3 + cmp r0, 0 + bne _08150576 + ldrb r0, [r1, 0x15] + subs r0, 0x1 + strb r0, [r1, 0x15] +_08150576: + ldr r2, [r6] + ldrh r0, [r2, 0x6] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _08150590 + ldrb r0, [r2, 0xC] + subs r0, 0x1 + strb r0, [r2, 0xC] + ldr r1, [r6] + ldrb r0, [r1, 0xD] + subs r0, 0x1 + strb r0, [r1, 0xD] +_08150590: + ldr r0, [r6] + ldrb r1, [r0, 0x14] + cmp r1, 0x20 + beq _081505DC + cmp r1, 0x20 + bgt _081505A8 + cmp r1, 0x10 + beq _081505F4 + b _08150630 + .pool +_081505A8: + cmp r1, 0x28 + beq _081505CA + cmp r1, 0xAF + bne _08150630 + movs r0, 0x2 + str r0, [sp] + movs r0, 0xA + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + movs r3, 0x16 + bl FillBgTilemapBufferRect + b _08150630 +_081505CA: + movs r0, 0x2 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0 + movs r2, 0x3 + b _081505EC +_081505DC: + str r3, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0 + movs r2, 0x2 +_081505EC: + movs r3, 0 + bl FillBgTilemapBufferRect + b _08150630 +_081505F4: + ldr r1, =0x00004108 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x5 + str r0, [sp] + movs r4, 0x2 + str r4, [sp, 0x4] + movs r5, 0x11 + str r5, [sp, 0x8] + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBufferRect_ChangePalette + ldr r0, [r6] + ldr r1, =0x0000410c + adds r0, r1 + ldr r1, [r0] + str r4, [sp] + movs r0, 0x1E + str r0, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r2, 0 + movs r3, 0x2 + bl CopyToBgTilemapBufferRect_ChangePalette + ldr r1, [r6] + movs r0, 0x40 + strb r0, [r1, 0x15] +_08150630: + bl sub_815115C + ldr r3, =0x02021bbc + movs r0, 0 + ldrsh r2, [r3, r0] + adds r1, r2, 0x1 + adds r0, r1, 0 + cmp r1, 0 + bge _08150646 + adds r0, r2, 0 + adds r0, 0x80 +_08150646: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + strh r0, [r3] + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8150550 + + thumb_func_start sub_8150664 +sub_8150664: @ 8150664 + push {r4-r7,lr} + sub sp, 0xC + ldr r7, =0x0203abac + ldr r1, [r7] + ldrb r0, [r1, 0x1] + cmp r0, 0xFF + bne _08150674 + b _081507B6 +_08150674: + ldrb r0, [r1, 0x14] + adds r0, 0x1 + strb r0, [r1, 0x14] + ldr r1, [r7] + ldrh r0, [r1, 0x6] + movs r6, 0x1 + ands r0, r6 + cmp r0, 0 + bne _0815068C + ldrb r0, [r1, 0x15] + adds r0, 0x1 + strb r0, [r1, 0x15] +_0815068C: + ldr r2, [r7] + ldrh r0, [r2, 0x6] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _081506A6 + ldrb r0, [r2, 0xC] + adds r0, 0x1 + strb r0, [r2, 0xC] + ldr r1, [r7] + ldrb r0, [r1, 0xD] + adds r0, 0x1 + strb r0, [r1, 0xD] +_081506A6: + ldr r0, [r7] + ldrb r1, [r0, 0x14] + cmp r1, 0x20 + beq _0815071A + cmp r1, 0x20 + bgt _081506BC + cmp r1, 0x10 + beq _081506E8 + b _081507B6 + .pool +_081506BC: + cmp r1, 0x28 + beq _08150784 + cmp r1, 0xB0 + bne _081507B6 + ldr r1, =0x0000410c + adds r0, r1 + ldr r1, [r0] + movs r0, 0x2 + str r0, [sp] + movs r0, 0x1E + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r2, 0 + movs r3, 0x2 + bl CopyToBgTilemapBufferRect_ChangePalette + b _081507B6 + .pool +_081506E8: + movs r0, 0x3 + str r0, [sp] + movs r4, 0x2 + str r4, [sp, 0x4] + movs r5, 0x11 + str r5, [sp, 0x8] + movs r1, 0 + movs r2, 0x2 + movs r3, 0 + bl FillBgTilemapBufferRect + str r4, [sp] + movs r0, 0xA + str r0, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + movs r3, 0x16 + bl FillBgTilemapBufferRect + ldr r1, [r7] + movs r0, 0xC0 + strb r0, [r1, 0x15] + b _081507B6 +_0815071A: + ldr r5, =0x00004108 + adds r0, r5 + ldr r0, [r0] + ldrh r1, [r0, 0x4] + str r6, [sp] + str r6, [sp, 0x4] + movs r4, 0x11 + str r4, [sp, 0x8] + movs r0, 0x3 + movs r2, 0x2 + movs r3, 0 + bl FillBgTilemapBufferRect + ldr r0, [r7] + adds r0, r5 + ldr r0, [r0] + ldrh r1, [r0, 0x6] + str r6, [sp] + str r6, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + movs r2, 0x3 + movs r3, 0 + bl FillBgTilemapBufferRect + ldr r0, [r7] + adds r0, r5 + ldr r0, [r0] + ldrh r1, [r0, 0xE] + str r6, [sp] + str r6, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + movs r2, 0x2 + movs r3, 0x1 + bl FillBgTilemapBufferRect + ldr r0, [r7] + adds r0, r5 + ldr r0, [r0] + ldrh r1, [r0, 0x10] + str r6, [sp] + str r6, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + movs r2, 0x3 + movs r3, 0x1 + bl FillBgTilemapBufferRect + b _081507B6 + .pool +_08150784: + ldr r5, =0x00004108 + adds r0, r5 + ldr r0, [r0] + ldrh r1, [r0, 0x8] + str r6, [sp] + str r6, [sp, 0x4] + movs r4, 0x11 + str r4, [sp, 0x8] + movs r0, 0x3 + movs r2, 0x4 + movs r3, 0 + bl FillBgTilemapBufferRect + ldr r0, [r7] + adds r0, r5 + ldr r0, [r0] + ldrh r1, [r0, 0x12] + str r6, [sp] + str r6, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + movs r2, 0x4 + movs r3, 0x1 + bl FillBgTilemapBufferRect +_081507B6: + bl sub_81511B8 + ldr r0, =0x0203abac + ldr r1, [r0] + ldrh r0, [r1, 0x6] + ldrh r1, [r1, 0x4] + cmp r0, r1 + bcs _081507DC + ldr r4, =0x02021bbc + movs r1, 0 + ldrsh r0, [r4, r1] + b _081507E6 + .pool +_081507DC: + ldr r0, =gUnknown_0854C14C + ldr r4, [r0] + ldr r0, =0x000006fc + adds r4, r0 + ldrh r0, [r4] +_081507E6: + adds r0, 0xF7 + movs r1, 0xF8 + bl __modsi3 + strh r0, [r4] + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8150664 + + thumb_func_start sub_8150800 +sub_8150800: @ 8150800 + push {r4,lr} + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + ldr r4, =0x0203abac + ldr r0, [r4] + ldrb r1, [r0, 0x14] + movs r0, 0x1C + bl SetGpuReg + ldr r0, [r4] + ldrb r1, [r0, 0x15] + movs r0, 0x1E + bl SetGpuReg + ldr r0, [r4] + ldrb r1, [r0, 0xC] + movs r0, 0x14 + bl SetGpuReg + ldr r0, [r4] + ldrb r1, [r0, 0xD] + movs r0, 0x16 + bl SetGpuReg + ldr r0, [r4] + ldrb r1, [r0, 0x8] + movs r0, 0x10 + bl SetGpuReg + ldr r0, [r4] + ldrb r1, [r0, 0x9] + movs r0, 0x12 + bl SetGpuReg + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8150800 + + thumb_func_start nullsub_58 +nullsub_58: @ 8150864 + bx lr + thumb_func_end nullsub_58 + + thumb_func_start sub_8150868 +sub_8150868: @ 8150868 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r0, =0x0203abac + ldr r6, [r0] + ldrb r0, [r6, 0x1] + cmp r0, 0xFF + beq _08150934 + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0 + bne _081508E4 + movs r0, 0x6 + ldrsh r4, [r6, r0] + adds r0, r4, 0 + bl __floatsisf + cmp r4, 0 + bge _08150892 + ldr r1, =0x47800000 + bl __addsf3 +_08150892: + ldr r1, =0x3e0f5c29 + bl __mulsf3 + bl __fixunssfsi + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x2E] + subs r1, r0 + strh r1, [r5, 0x20] + movs r1, 0x6 + ldrsh r4, [r6, r1] + adds r0, r4, 0 + bl __floatsisf + cmp r4, 0 + bge _081508BA + ldr r1, =0x47800000 + bl __addsf3 +_081508BA: + ldr r1, =0x3d89374c + bl __mulsf3 + bl __fixunssfsi + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x30] + subs r1, r0 + strh r1, [r5, 0x22] + b _08150934 + .pool +_081508E4: + movs r0, 0x6 + ldrsh r4, [r6, r0] + adds r0, r4, 0 + bl __floatsisf + cmp r4, 0 + bge _081508F8 + ldr r1, =0x47800000 + bl __addsf3 +_081508F8: + ldr r1, =0x3e0f5c29 + bl __mulsf3 + bl __fixunssfsi + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x2E] + adds r0, r1 + strh r0, [r5, 0x20] + movs r0, 0x6 + ldrsh r4, [r6, r0] + adds r0, r4, 0 + bl __floatsisf + cmp r4, 0 + bge _08150920 + ldr r1, =0x47800000 + bl __addsf3 +_08150920: + ldr r1, =0x3d89374c + bl __mulsf3 + bl __fixunssfsi + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x30] + adds r0, r1 + strh r0, [r5, 0x22] +_08150934: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8150868 + + thumb_func_start sub_8150948 +sub_8150948: @ 8150948 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r0, =0x0203abac + ldr r6, [r0] + ldrb r0, [r6, 0x1] + cmp r0, 0xFF + bne _08150958 + b _08150A60 +_08150958: + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0 + bne _081509C8 + movs r0, 0x6 + ldrsh r4, [r6, r0] + adds r0, r4, 0 + bl __floatsisf + cmp r4, 0 + bge _08150974 + ldr r1, =0x47800000 + bl __addsf3 +_08150974: + ldr r1, =0x3e0f5c29 + bl __mulsf3 + bl __fixunssfsi + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x2E] + subs r1, r0 + strh r1, [r5, 0x20] + movs r1, 0x6 + ldrsh r4, [r6, r1] + adds r0, r4, 0 + bl __floatsisf + cmp r4, 0 + bge _0815099C + ldr r1, =0x47800000 + bl __addsf3 +_0815099C: + ldr r1, =0x3d89374c + bl __mulsf3 + bl __fixunssfsi + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x30] + subs r1, r0 + strh r1, [r5, 0x22] + b _08150A18 + .pool +_081509C8: + movs r0, 0x6 + ldrsh r4, [r6, r0] + adds r0, r4, 0 + bl __floatsisf + cmp r4, 0 + bge _081509DC + ldr r1, =0x47800000 + bl __addsf3 +_081509DC: + ldr r1, =0x3e0f5c29 + bl __mulsf3 + bl __fixunssfsi + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x2E] + adds r0, r1 + strh r0, [r5, 0x20] + movs r0, 0x6 + ldrsh r4, [r6, r0] + adds r0, r4, 0 + bl __floatsisf + cmp r4, 0 + bge _08150A04 + ldr r1, =0x47800000 + bl __addsf3 +_08150A04: + ldr r1, =0x3d89374c + bl __mulsf3 + bl __fixunssfsi + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x30] + adds r0, r1 + strh r0, [r5, 0x22] +_08150A18: + movs r0, 0x32 + ldrsh r2, [r5, r0] + cmp r2, 0 + bne _08150A48 + movs r0, 0x11 + strh r0, [r5, 0x26] + ldrh r0, [r5, 0x34] + adds r1, r0, 0x1 + strh r1, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + ble _08150A60 + strh r2, [r5, 0x34] + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] + b _08150A60 + .pool +_08150A48: + movs r2, 0 + movs r0, 0x10 + strh r0, [r5, 0x26] + ldrh r0, [r5, 0x34] + adds r1, r0, 0x1 + strh r1, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + ble _08150A60 + strh r2, [r5, 0x34] + strh r2, [r5, 0x32] +_08150A60: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8150948 + + thumb_func_start sub_8150A68 +sub_8150A68: @ 8150A68 + push {lr} + adds r2, r0, 0 + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0 + bne _08150A98 + adds r0, r2, 0 + adds r0, 0x28 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 1 + ldrh r3, [r2, 0x20] + adds r0, r3 + strh r0, [r2, 0x20] + ldrh r1, [r2, 0x22] + adds r1, 0x10 + adds r0, r2, 0 + adds r0, 0x29 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + strh r0, [r2, 0x22] +_08150A98: + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x32 + ldrsh r1, [r2, r3] + cmp r0, r1 + blt _08150AEE + movs r0, 0x30 + ldrsh r1, [r2, r0] + cmp r1, 0 + beq _08150AB8 + cmp r1, 0x1 + beq _08150AC2 + b _08150AE0 +_08150AB8: + ldrh r0, [r2, 0x20] + adds r0, 0x1 + strh r0, [r2, 0x20] + ldrh r0, [r2, 0x2E] + b _08150AD2 +_08150AC2: + ldrh r0, [r2, 0x2E] + ands r0, r1 + cmp r0, 0 + beq _08150AE0 + ldrh r0, [r2, 0x20] + adds r0, 0x1 + strh r0, [r2, 0x20] + ldrh r0, [r2, 0x20] +_08150AD2: + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08150AE0 + ldrh r0, [r2, 0x22] + adds r0, 0x1 + strh r0, [r2, 0x22] +_08150AE0: + movs r1, 0x22 + ldrsh r0, [r2, r1] + cmp r0, 0xA0 + ble _08150AEE + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles +_08150AEE: + pop {r0} + bx r0 + thumb_func_end sub_8150A68 + + thumb_func_start sub_8150AF4 +sub_8150AF4: @ 8150AF4 + push {lr} + adds r2, r0, 0 + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0 + bne _08150B12 + ldrh r1, [r2, 0x22] + adds r1, 0x10 + adds r0, r2, 0 + adds r0, 0x29 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + strh r0, [r2, 0x22] +_08150B12: + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x32 + ldrsh r1, [r2, r3] + cmp r0, r1 + blt _08150B68 + movs r0, 0x30 + ldrsh r1, [r2, r0] + cmp r1, 0 + beq _08150B32 + cmp r1, 0x1 + beq _08150B3C + b _08150B5A +_08150B32: + ldrh r0, [r2, 0x20] + subs r0, 0x1 + strh r0, [r2, 0x20] + ldrh r0, [r2, 0x2E] + b _08150B4C +_08150B3C: + ldrh r0, [r2, 0x2E] + ands r0, r1 + cmp r0, 0 + beq _08150B5A + ldrh r0, [r2, 0x20] + subs r0, 0x1 + strh r0, [r2, 0x20] + ldrh r0, [r2, 0x20] +_08150B4C: + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08150B5A + ldrh r0, [r2, 0x22] + subs r0, 0x1 + strh r0, [r2, 0x22] +_08150B5A: + movs r1, 0x22 + ldrsh r0, [r2, r1] + cmp r0, 0x4F + bgt _08150B68 + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles +_08150B68: + pop {r0} + bx r0 + thumb_func_end sub_8150AF4 + + thumb_func_start sub_8150B6C +sub_8150B6C: @ 8150B6C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08150B7A + cmp r0, 0x1 + beq _08150C1C +_08150B7A: + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0 + bl SetGpuReg + movs r0, 0x40 + movs r1, 0 + bl SetGpuReg + movs r0, 0x42 + movs r1, 0 + bl SetGpuReg + movs r0, 0x44 + movs r1, 0 + bl SetGpuReg + movs r0, 0x46 + movs r1, 0 + bl SetGpuReg + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0xE + movs r1, 0 + bl SetGpuReg + movs r0, 0xC + movs r1, 0 + bl SetGpuReg + movs r0, 0xA + movs r1, 0 + bl SetGpuReg + movs r0, 0x8 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1C + movs r1, 0 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0 + bl SetGpuReg + movs r0, 0x18 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + movs r0, 0x16 + movs r1, 0 + bl SetGpuReg + movs r0, 0x10 + movs r1, 0 + bl SetGpuReg + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + b _08150D1C +_08150C1C: + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0 + bl SetGpuReg + movs r0, 0x40 + movs r1, 0 + bl SetGpuReg + movs r0, 0x42 + movs r1, 0 + bl SetGpuReg + movs r0, 0x44 + movs r1, 0 + bl SetGpuReg + movs r0, 0x46 + movs r1, 0 + bl SetGpuReg + ldr r0, =0x020375e0 + ldrh r3, [r0] + cmp r3, 0 + bne _08150C74 + ldr r1, =0x0203abac + ldr r2, [r1] + movs r0, 0xB0 + strb r0, [r2, 0x14] + ldr r2, [r1] + movs r0, 0x10 + strb r0, [r2, 0x15] + ldr r0, [r1] + strb r3, [r0, 0xC] + ldr r2, [r1] + movs r0, 0x50 + b _08150C8C + .pool +_08150C74: + ldr r1, =0x0203abac + ldr r2, [r1] + movs r3, 0 + movs r0, 0x60 + strb r0, [r2, 0x14] + ldr r2, [r1] + movs r0, 0xE8 + strb r0, [r2, 0x15] + ldr r0, [r1] + strb r3, [r0, 0xC] + ldr r2, [r1] + movs r0, 0x4 +_08150C8C: + strb r0, [r2, 0xD] + ldr r0, [r1] + strb r3, [r0, 0x9] + ldr r0, [r1] + strb r3, [r0, 0x9] + adds r4, r1, 0 + ldr r0, [r4] + ldrb r1, [r0, 0x14] + movs r0, 0x1C + bl SetGpuReg + ldr r0, [r4] + ldrb r1, [r0, 0x15] + movs r0, 0x1E + bl SetGpuReg + movs r0, 0x18 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg + ldr r0, [r4] + ldrb r1, [r0, 0xC] + movs r0, 0x14 + bl SetGpuReg + ldr r0, [r4] + ldrb r1, [r0, 0xD] + movs r0, 0x16 + bl SetGpuReg + ldr r0, [r4] + ldrb r1, [r0, 0x8] + movs r0, 0x10 + bl SetGpuReg + ldr r0, [r4] + ldrb r1, [r0, 0x9] + movs r0, 0x12 + bl SetGpuReg + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + movs r1, 0xFC + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg +_08150D1C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8150B6C + + thumb_func_start sub_8150D28 +sub_8150D28: @ 8150D28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + ldr r1, =gUnknown_085CDBE4 + add r0, sp, 0xC + movs r2, 0x2 + bl memcpy + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + add r6, sp, 0x10 + ldr r1, =gUnknown_085CDBE6 + adds r0, r6, 0 + movs r2, 0x4 + bl memcpy + add r5, sp, 0x14 + ldr r1, =gUnknown_085CDBEA + adds r0, r5, 0 + movs r2, 0x8 + bl memcpy + add r4, sp, 0x1C + ldr r1, =gUnknown_085CDBF2 + adds r0, r4, 0 + movs r2, 0x4 + bl memcpy + ldr r0, =gUnknown_085CDBF8 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x20] + str r1, [sp, 0x24] + ldr r0, =0x020375e0 + ldrh r0, [r0] + mov r8, r6 + mov r10, r5 + cmp r0, 0 + beq _08150D86 + cmp r0, 0x1 + beq _08150E68 +_08150D86: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + add r0, sp + adds r0, 0xC + ldrb r0, [r0] + ldr r1, =sub_8150948 + movs r2, 0x66 + str r2, [sp] + movs r2, 0xC8 + movs r3, 0x49 + bl AddPseudoFieldObject + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _08150DD0 + ldr r0, =0x02020630 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1, 0x5] + movs r0, 0x8 + strh r0, [r1, 0x24] + movs r0, 0x10 + strh r0, [r1, 0x26] + movs r0, 0xC8 + strh r0, [r1, 0x2E] + movs r0, 0x49 + strh r0, [r1, 0x30] +_08150DD0: + ldr r4, =gUnknown_085CDB9C + adds r0, r4, 0 + movs r1, 0xB0 + movs r2, 0x2B + movs r3, 0x67 + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, =0x02020630 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r5 + movs r1, 0x20 + strh r1, [r0, 0x26] + strh r1, [r0, 0x24] + movs r1, 0xB0 + strh r1, [r0, 0x2E] + movs r1, 0x2B + strh r1, [r0, 0x30] + adds r4, 0x18 + adds r0, r4, 0 + movs r1, 0xC8 + movs r2, 0x63 + movs r3, 0x65 + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r5 + movs r1, 0x8 + strh r1, [r0, 0x24] + movs r1, 0x4 + strh r1, [r0, 0x26] + movs r1, 0xC8 + strh r1, [r0, 0x2E] + movs r1, 0x63 + strh r1, [r0, 0x30] + ldr r2, =0x0203abac + ldr r1, [r2] + movs r0, 0x7 + strb r0, [r1, 0x2] + ldr r1, [r2] + movs r0, 0xAF + lsls r0, 1 + strh r0, [r1, 0x4] + movs r0, 0x2 + bl sub_80AB130 + b _08150F3A + .pool +_08150E68: + ldr r7, =0x0203abac + ldr r0, [r7] + ldr r1, =0x000040fc + adds r0, r1 + ldr r1, [r0] + adds r1, 0x48 + movs r0, 0xC + str r0, [sp] + movs r0, 0x3 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r2, 0x18 + movs r3, 0x1A + bl CopyToBgTilemapBufferRect_ChangePalette + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + add r0, sp + adds r0, 0xC + ldrb r0, [r0] + ldr r1, =sub_8150948 + movs r2, 0x66 + str r2, [sp] + movs r2, 0x80 + movs r3, 0x27 + bl AddPseudoFieldObject + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _08150ED4 + ldr r0, =0x02020630 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1, 0x5] + movs r0, 0x8 + strh r0, [r1, 0x24] + movs r0, 0x10 + strh r0, [r1, 0x26] + movs r0, 0x80 + strh r0, [r1, 0x2E] + movs r0, 0x27 + strh r0, [r1, 0x30] +_08150ED4: + ldr r4, =gUnknown_085CDB9C + adds r0, r4, 0 + movs r1, 0x68 + movs r2, 0x9 + movs r3, 0x67 + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, =0x02020630 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r5 + movs r1, 0x20 + strh r1, [r0, 0x26] + strh r1, [r0, 0x24] + movs r1, 0x68 + strh r1, [r0, 0x2E] + movs r1, 0x9 + strh r1, [r0, 0x30] + adds r4, 0x18 + adds r0, r4, 0 + movs r1, 0x80 + movs r2, 0x41 + movs r3, 0x65 + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r5 + movs r1, 0x8 + strh r1, [r0, 0x24] + movs r1, 0x4 + strh r1, [r0, 0x26] + movs r1, 0x80 + strh r1, [r0, 0x2E] + movs r1, 0x41 + strh r1, [r0, 0x30] + ldr r1, [r7] + movs r0, 0x2 + strb r0, [r1, 0x2] + ldr r1, [r7] + ldr r0, =0x00000109 + strh r0, [r1, 0x4] + movs r0, 0x7 + bl sub_80AB130 +_08150F3A: + movs r4, 0 + ldr r5, =0x02020630 +_08150F3E: + lsls r1, r4, 20 + movs r2, 0xC0 + lsls r2, 15 + adds r1, r2 + asrs r1, 16 + lsls r2, r4, 19 + ldr r3, =0xfff80000 + adds r2, r3 + asrs r2, 16 + ldr r0, =gUnknown_085CDBCC + movs r3, 0x68 + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r5 + movs r1, 0x8 + strh r1, [r0, 0x24] + strh r1, [r0, 0x26] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x8 + bls _08150F3E + movs r0, 0x3F + mov r4, r9 + ands r0, r4 + cmp r0, 0 + bne _08151074 + mov r0, r9 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + add r0, r8 + ldrb r0, [r0] + ldr r5, =0x020375e0 + ldrh r4, [r5] + lsls r4, 2 + add r1, sp, 0x20 + adds r1, r4, r1 + ldr r1, [r1] + mov r3, r10 + adds r2, r3, r4 + movs r3, 0 + ldrsh r2, [r2, r3] + mov r3, sp + adds r3, 0x16 + adds r3, r4 + movs r4, 0 + ldrsh r3, [r3, r4] + movs r4, 0x6A + str r4, [sp] + bl AddPseudoFieldObject + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _08151074 + ldr r1, =0x02020630 + lsls r2, r6, 4 + adds r0, r2, r6 + lsls r0, 2 + adds r4, r0, r1 + ldrb r1, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r4, 0x5] + adds r0, r4, 0 + adds r0, 0x28 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + negs r0, r0 + strh r0, [r4, 0x24] + adds r0, r4, 0 + adds r0, 0x29 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r0, [r5] + mov r8, r2 + cmp r0, 0 + bne _08151036 + movs r7, 0x1 + mov r5, r9 + ands r5, r7 + cmp r5, 0 + beq _08151030 + adds r0, r4, 0 + movs r1, 0x6 + b _08151044 + .pool +_08151030: + adds r0, r4, 0 + movs r1, 0x7 + b _08151056 +_08151036: + movs r7, 0x1 + mov r5, r9 + ands r5, r7 + cmp r5, 0 + beq _08151052 + adds r0, r4, 0 + movs r1, 0x7 +_08151044: + bl StartObjectImageAnim + strh r7, [r4, 0x30] + ldrh r0, [r4, 0x22] + adds r0, 0x2 + strh r0, [r4, 0x22] + b _0815105C +_08151052: + adds r0, r4, 0 + movs r1, 0x6 +_08151056: + bl StartObjectImageAnim + strh r5, [r4, 0x30] +_0815105C: + ldr r0, =0x02020630 + mov r2, r8 + adds r1, r2, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x3 + mov r3, r9 + ands r0, r3 + add r0, sp + adds r0, 0x1C + ldrb r0, [r0] + strh r0, [r1, 0x32] +_08151074: + 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_8150D28 + + thumb_func_start sub_8151088 +sub_8151088: @ 8151088 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + movs r3, 0 + mov r9, r3 + ldr r2, =0x0203abac + ldr r0, [r2] + ldrb r1, [r0, 0x1B] + adds r1, 0x2 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 26 + lsrs r0, 24 + mov r12, r0 +_081510AA: + movs r7, 0 + lsls r0, r3, 1 + adds r1, r3, 0x3 + adds r2, r3, 0x6 + adds r4, r3, 0x1 + str r4, [sp, 0x4] + adds r0, r3 + lsls r0, 3 + str r0, [sp] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + mov r10, r0 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + mov r8, r0 +_081510CC: + ldr r0, =0x0203abac + ldr r6, [r0] + lsls r3, r7, 1 + ldr r1, [sp] + adds r2, r3, r1 + adds r4, r6, 0 + adds r4, 0x22 + adds r2, r4, r2 + mov r1, r12 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + ldr r0, =0x000040fc + adds r5, r6, r0 + ldr r0, [r5] + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + strh r0, [r2] + mov r1, r10 + adds r2, r3, r1 + adds r2, r4, r2 + str r2, [sp, 0x8] + ldr r0, [r5] + mov r2, r9 + lsls r1, r2, 1 + adds r0, r1, r0 + ldrh r0, [r0] + ldr r2, [sp, 0x8] + strh r0, [r2] + add r3, r8 + adds r4, r3 + ldr r0, [r5] + adds r1, r0 + adds r1, 0x48 + ldrh r0, [r1] + strh r0, [r4] + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0xB + bls _081510CC + ldr r4, [sp, 0x4] + lsls r0, r4, 24 + lsrs r3, r0, 24 + cmp r3, 0x2 + bls _081510AA + ldrb r0, [r6, 0x1B] + adds r0, 0x1 + movs r1, 0x3 + bl __modsi3 + strb r0, [r6, 0x1B] + 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_8151088 + + thumb_func_start sub_815115C +sub_815115C: @ 815115C + push {r4,r5,lr} + ldr r5, =0x0203abac + ldr r4, [r5] + ldrb r0, [r4, 0x1C] + adds r0, 0x1 + movs r1, 0x60 + bl __modsi3 + strb r0, [r4, 0x1C] + ldr r1, [r5] + ldrb r0, [r1, 0x1F] + ldrb r2, [r1, 0x1D] + subs r0, r2 + strb r0, [r1, 0x8] + ldr r2, [r5] + adds r0, r2, 0 + adds r0, 0x20 + ldrb r0, [r0] + ldrb r1, [r2, 0x1E] + subs r0, r1 + strb r0, [r2, 0x9] + ldr r1, [r5] + ldrb r0, [r1, 0x1D] + adds r0, 0x1 + strb r0, [r1, 0x1D] + ldr r2, [r5] + ldrb r0, [r2, 0x1D] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081511A0 + ldrb r0, [r2, 0x1E] + adds r0, 0x1 + strb r0, [r2, 0x1E] +_081511A0: + ldr r0, [r5] + ldrb r0, [r0, 0x1D] + cmp r0, 0x10 + bls _081511AC + bl sub_8151214 +_081511AC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815115C + + thumb_func_start sub_81511B8 +sub_81511B8: @ 81511B8 + push {r4,r5,lr} + ldr r5, =0x0203abac + ldr r4, [r5] + ldrb r0, [r4, 0x1C] + adds r0, 0x1 + movs r1, 0x60 + bl __modsi3 + strb r0, [r4, 0x1C] + ldr r1, [r5] + ldrb r0, [r1, 0x1D] + ldrb r2, [r1, 0x1F] + adds r0, r2 + strb r0, [r1, 0x8] + ldr r1, [r5] + adds r2, r1, 0 + adds r2, 0x20 + ldrb r0, [r1, 0x1E] + ldrb r2, [r2] + adds r0, r2 + strb r0, [r1, 0x9] + ldr r1, [r5] + ldrb r0, [r1, 0x1D] + adds r0, 0x1 + strb r0, [r1, 0x1D] + ldr r2, [r5] + ldrb r0, [r2, 0x1D] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081511FC + ldrb r0, [r2, 0x1E] + adds r0, 0x1 + strb r0, [r2, 0x1E] +_081511FC: + ldr r0, [r5] + ldrb r0, [r0, 0x1D] + cmp r0, 0x10 + bls _08151208 + bl sub_8151388 +_08151208: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81511B8 + + thumb_func_start sub_8151214 +sub_8151214: @ 8151214 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + movs r7, 0 + ldr r3, =0x0203abac + ldr r0, [r3] + strb r7, [r0, 0x1E] + strb r7, [r0, 0x1D] + ldr r1, [r3] + ldrb r0, [r1, 0x8] + strb r0, [r1, 0x1F] + ldr r0, [r3] + ldrb r1, [r0, 0x9] + adds r0, 0x20 + strb r1, [r0] + ldr r4, [r3] + ldrb r1, [r4, 0x19] + adds r2, r1, 0 + adds r2, 0x1E + adds r0, r2, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r2, r0 + strb r0, [r4, 0x19] + ldr r1, [r3] + ldrb r0, [r1, 0x18] + subs r0, 0x2 + strb r0, [r1, 0x18] + ldr r4, =0x0203abb2 + ldr r0, [r3] + ldrb r1, [r0, 0x1A] + adds r2, r1, 0 + adds r2, 0x17 + adds r0, r2, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r2, r0 + strb r0, [r4] + ldr r6, =0x0203abb0 + mov r9, r3 + ldr r0, =0x0203abb1 + mov r8, r0 +_0815126E: + mov r1, r9 + ldr r2, [r1] + ldrb r0, [r2, 0x19] + strb r0, [r6] + ldr r0, =0x0203abb2 + ldrb r0, [r0] + adds r1, r0, r7 + adds r0, r1, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r1, r0 + mov r1, r8 + strb r0, [r1] + ldrb r1, [r2, 0x18] + lsls r1, 1 + lsls r0, r7, 1 + adds r0, r7 + lsls r5, r0, 3 + adds r1, r5 + adds r0, r2, 0 + adds r0, 0x22 + adds r0, r1 + ldrh r1, [r0] + ldrb r2, [r6] + mov r0, r8 + ldrb r3, [r0] + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x11 + mov r10, r0 + str r0, [sp, 0x8] + movs r0, 0 + bl FillBgTilemapBufferRect + ldrb r1, [r6] + adds r2, r1, 0x1 + adds r0, r2, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r2, r0 + strb r0, [r6] + mov r0, r9 + ldr r1, [r0] + ldrb r0, [r1, 0x18] + adds r0, 0x1 + lsls r0, 1 + adds r0, r5 + adds r1, 0x22 + adds r1, r0 + ldrh r1, [r1] + ldrb r2, [r6] + mov r0, r8 + ldrb r3, [r0] + str r4, [sp] + str r4, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + movs r0, 0 + bl FillBgTilemapBufferRect + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x8 + bls _0815126E + ldr r5, =0x0203abb0 + ldr r4, =0x0203abac + ldr r0, [r4] + ldrb r1, [r0, 0x19] + adds r2, r1, 0 + adds r2, 0x1E + adds r0, r2, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r2, r0 + strb r0, [r5] + ldrb r2, [r5] + movs r0, 0x2 + str r0, [sp] + movs r6, 0x20 + str r6, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r3, 0 + bl FillBgTilemapBufferRect + ldr r1, [r4] + ldrb r0, [r1, 0x18] + cmp r0, 0 + bne _08151368 + ldrb r2, [r1, 0x1A] + adds r3, r2, 0 + adds r3, 0x1D + adds r0, r3, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r3, r0 + strb r0, [r1, 0x1A] + ldr r1, [r4] + movs r0, 0xC + strb r0, [r1, 0x18] + bl sub_8151088 + ldr r0, [r4] + ldrb r1, [r0, 0x1A] + adds r2, r1, 0x1 + adds r0, r2, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r2, r0 + strb r0, [r5] + ldrb r3, [r5] + str r6, [sp] + movs r0, 0x9 + str r0, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl FillBgTilemapBufferRect +_08151368: + 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_8151214 + + thumb_func_start sub_8151388 +sub_8151388: @ 8151388 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + movs r7, 0 + ldr r2, =0x0203abac + ldr r0, [r2] + strb r7, [r0, 0x1E] + strb r7, [r0, 0x1D] + ldr r1, [r2] + ldrb r0, [r1, 0x8] + strb r0, [r1, 0x1F] + ldr r0, [r2] + ldrb r1, [r0, 0x9] + adds r0, 0x20 + strb r1, [r0] + ldr r4, [r2] + ldrb r1, [r4, 0x19] + adds r3, r1, 0x2 + adds r0, r3, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r3, r0 + strb r0, [r4, 0x19] + ldr r1, [r2] + ldrb r0, [r1, 0x18] + adds r0, 0x2 + strb r0, [r1, 0x18] + ldr r1, =0x0203abb5 + ldr r0, [r2] + ldrb r0, [r0, 0x1A] + strb r0, [r1] + ldr r6, =0x0203abb3 + mov r10, r2 + ldr r0, =0x0203abb4 + mov r9, r0 +_081513D4: + mov r1, r10 + ldr r2, [r1] + ldrb r0, [r2, 0x19] + strb r0, [r6] + ldr r0, =0x0203abb5 + ldrb r0, [r0] + adds r1, r0, r7 + adds r0, r1, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r1, r0 + mov r1, r9 + strb r0, [r1] + ldrb r1, [r2, 0x18] + lsls r1, 1 + lsls r0, r7, 1 + adds r0, r7 + lsls r5, r0, 3 + adds r1, r5 + adds r0, r2, 0 + adds r0, 0x22 + adds r0, r1 + ldrh r1, [r0] + ldrb r2, [r6] + mov r0, r9 + ldrb r3, [r0] + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x11 + mov r8, r0 + str r0, [sp, 0x8] + movs r0, 0 + bl FillBgTilemapBufferRect + ldrb r1, [r6] + adds r2, r1, 0x1 + adds r0, r2, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r2, r0 + strb r0, [r6] + mov r0, r10 + ldr r1, [r0] + ldrb r0, [r1, 0x18] + adds r0, 0x1 + lsls r0, 1 + adds r0, r5 + adds r1, 0x22 + adds r1, r0 + ldrh r1, [r1] + ldrb r2, [r6] + mov r0, r9 + ldrb r3, [r0] + str r4, [sp] + str r4, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + movs r0, 0 + bl FillBgTilemapBufferRect + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x8 + bls _081513D4 + ldr r4, =0x0203abb4 + ldr r5, =0x0203abac + ldr r3, [r5] + ldrb r1, [r3, 0x1A] + adds r2, r1, 0 + adds r2, 0x17 + adds r0, r2, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r2, r0 + strb r0, [r4] + ldrb r2, [r3, 0x19] + ldrb r3, [r4] + movs r0, 0x2 + str r0, [sp] + movs r0, 0x9 + str r0, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r0, 0 + movs r1, 0 + bl FillBgTilemapBufferRect + ldr r1, [r5] + ldrb r0, [r1, 0x18] + cmp r0, 0xA + bne _081514A6 + ldrb r2, [r1, 0x1A] + adds r3, r2, 0x3 + adds r0, r3, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r3, r0 + strb r0, [r1, 0x1A] + ldr r1, [r5] + movs r0, 0xFE + strb r0, [r1, 0x18] + bl sub_8151088 +_081514A6: + 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_8151388 + + thumb_func_start sub_81514C8 +sub_81514C8: @ 81514C8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081514D6 + cmp r0, 0x1 + beq _08151500 +_081514D6: + ldr r1, =0x0203abac + ldr r2, [r1] + movs r3, 0 + movs r0, 0x2 + strb r0, [r2, 0x1B] + ldr r0, [r1] + strb r3, [r0, 0x19] + ldr r2, [r1] + movs r0, 0x14 + strb r0, [r2, 0x1A] + ldr r1, [r1] + movs r0, 0xC + strb r0, [r1, 0x18] + bl sub_8151088 + bl sub_8151214 + b _08151522 + .pool +_08151500: + ldr r1, =0x0203abac + ldr r2, [r1] + movs r0, 0x2 + strb r0, [r2, 0x1B] + ldr r2, [r1] + movs r0, 0x1C + strb r0, [r2, 0x19] + ldr r2, [r1] + movs r0, 0x14 + strb r0, [r2, 0x1A] + ldr r1, [r1] + movs r0, 0x4 + strb r0, [r1, 0x18] + bl sub_8151088 + bl sub_8151388 +_08151522: + ldr r0, =0x0203abac + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x1C] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81514C8 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/cable_car_util.s b/asm/cable_car_util.s new file mode 100644 index 000000000..5503f1184 --- /dev/null +++ b/asm/cable_car_util.s @@ -0,0 +1,762 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_81520A8 +sub_81520A8: @ 81520A8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r10, r0 + ldr r0, [sp, 0x24] + ldr r4, [sp, 0x28] + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp] + lsls r3, 24 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, 24 + lsrs r4, 24 + mov r8, r4 + movs r0, 0 + lsrs r4, r3, 24 + cmp r0, r8 + bcs _08152122 +_081520DA: + ldr r2, [sp] + movs r3, 0 + adds r6, r4, 0x1 + adds r0, 0x1 + mov r12, r0 + cmp r3, r7 + bcs _0815210C + lsls r5, r4, 6 +_081520EA: + lsls r0, r2, 1 + adds r0, r5 + add r0, r10 + mov r1, r9 + strh r1, [r0] + adds r1, r2, 0x1 + adds r0, r1, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r1, r0 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r7 + bcc _081520EA +_0815210C: + adds r0, r6, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r6, r0 + lsls r0, 24 + lsrs r4, r0, 24 + mov r1, r12 + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, r8 + bcc _081520DA +_08152122: + 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_81520A8 + + thumb_func_start sub_8152134 +sub_8152134: @ 8152134 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r10, r0 + ldr r0, [sp, 0x24] + ldr r4, [sp, 0x28] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp] + lsls r3, 24 + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + lsls r4, 24 + lsrs r4, 24 + mov r9, r4 + movs r0, 0 + adds r5, r1, 0 + lsrs r4, r3, 24 + cmp r0, r9 + bcs _081521AE +_08152164: + ldr r2, [sp] + movs r3, 0 + adds r7, r4, 0x1 + adds r0, 0x1 + mov r8, r0 + cmp r3, r12 + bcs _08152198 + lsls r6, r4, 6 +_08152174: + lsls r0, r2, 1 + adds r0, r6 + add r0, r10 + ldrh r1, [r5] + strh r1, [r0] + adds r5, 0x2 + adds r1, r2, 0x1 + adds r0, r1, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r1, r0 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r12 + bcc _08152174 +_08152198: + adds r0, r7, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r7, r0 + lsls r0, 24 + lsrs r4, r0, 24 + mov r1, r8 + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, r9 + bcc _08152164 +_081521AE: + 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_8152134 + + thumb_func_start sub_81521C0 +sub_81521C0: @ 81521C0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r4, r0, 24 + movs r5, 0 + cmp r4, 0 + beq _081521FE + cmp r4, 0x40 + bls _081521D6 + movs r4, 0x40 +_081521D6: + ldr r6, =0x0203abb8 + movs r0, 0x8 + bl AllocZeroed + str r0, [r6] + cmp r0, 0 + beq _081521FE + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 4 + bl AllocZeroed + ldr r1, [r6] + str r0, [r1, 0x4] + cmp r0, 0 + bne _08152208 + adds r0, r1, 0 + bl Free + str r5, [r6] +_081521FE: + movs r0, 0 + b _08152244 + .pool +_08152208: + strb r4, [r1] + cmp r5, r4 + bcs _08152242 + adds r3, r6, 0 + ldr r0, =gDefaultOamAttributes + mov r12, r0 + movs r2, 0x4 + mov r8, r2 +_08152218: + ldr r0, [r3] + ldr r2, [r0, 0x4] + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 4 + adds r2, r1, r2 + mov r0, r12 + ldm r0!, {r6,r7} + stm r2!, {r6,r7} + ldr r0, [r3] + ldr r0, [r0, 0x4] + adds r1, r0 + ldrb r0, [r1, 0x19] + mov r2, r8 + orrs r0, r2 + strb r0, [r1, 0x19] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r4 + bcc _08152218 +_08152242: + movs r0, 0x1 +_08152244: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81521C0 + + thumb_func_start sub_8152254 +sub_8152254: @ 8152254 + push {r4-r7,lr} + movs r3, 0 + ldr r0, =0x0203abb8 + ldr r2, [r0] + adds r5, r0, 0 + cmp r2, 0 + bne _0815226C + movs r0, 0 + b _081522C4 + .pool +_0815226C: + ldrb r2, [r2] + cmp r3, r2 + bcs _08152292 + ldr r0, =0x030024f8 + mov r12, r0 + ldr r4, =gDefaultOamAttributes + adds r2, r5, 0 +_0815227A: + lsls r1, r3, 3 + add r1, r12 + adds r0, r4, 0 + ldm r0!, {r6,r7} + stm r1!, {r6,r7} + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, [r2] + ldrb r0, [r0] + cmp r3, r0 + bcc _0815227A +_08152292: + ldr r1, [r5] + ldrb r0, [r1] + lsls r2, r0, 1 + adds r2, r0 + ldr r0, [r1, 0x4] + lsls r2, 4 + movs r1, 0 + bl memset + ldr r0, [r5] + ldr r0, [r0, 0x4] + bl Free + ldr r0, [r5] + movs r4, 0 + str r4, [r0, 0x4] + movs r1, 0 + movs r2, 0x8 + bl memset + ldr r0, [r5] + bl Free + str r4, [r5] + movs r0, 0x1 +_081522C4: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8152254 + + thumb_func_start sub_81522D4 +sub_81522D4: @ 81522D4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r6, 0 + ldr r0, =0x0203abb8 + ldr r1, [r0] + adds r3, r0, 0 + cmp r1, 0 + beq _081522EC + ldr r0, [r1, 0x4] + cmp r0, 0 + bne _081522F4 +_081522EC: + movs r0, 0 + b _081523D2 + .pool +_081522F4: + ldrb r1, [r1] + cmp r6, r1 + bcs _081523D0 + adds r7, r3, 0 + movs r0, 0x3 + mov r8, r0 +_08152300: + ldr r0, [r7] + ldr r1, [r0, 0x4] + lsls r0, r6, 1 + adds r0, r6 + lsls r5, r0, 4 + adds r2, r5, r1 + ldrb r1, [r2, 0x19] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x3 + bne _081523C2 + ldr r1, [r2, 0x2C] + cmp r1, 0 + beq _08152322 + adds r0, r2, 0 + bl _call_via_r1 +_08152322: + ldr r0, [r7] + ldr r0, [r0, 0x4] + adds r2, r5, r0 + ldrb r1, [r2, 0x19] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08152348 + lsls r0, r6, 3 + ldr r1, =0x030024f8 + adds r0, r1 + ldr r1, =gDefaultOamAttributes + ldm r1!, {r2,r3} + stm r0!, {r2,r3} + b _081523C0 + .pool +_08152348: + ldrb r0, [r2, 0xE] + ldrb r4, [r2, 0xA] + adds r0, r4 + strb r0, [r2] + ldr r4, [r7] + ldr r3, [r4, 0x4] + adds r3, r5, r3 + movs r0, 0x8 + ldrsh r2, [r3, r0] + movs r1, 0xC + ldrsh r0, [r3, r1] + adds r2, r0 + ldr r1, =0x000001ff + adds r0, r1, 0 + ands r2, r0 + ldrh r0, [r3, 0x2] + ldr r1, =0xfffffe00 + mov r12, r1 + mov r1, r12 + ands r0, r1 + orrs r0, r2 + strh r0, [r3, 0x2] + ldr r3, [r4, 0x4] + adds r3, r5, r3 + ldrb r0, [r3, 0x19] + lsls r0, 27 + lsrs r0, 30 + mov r2, r8 + ands r0, r2 + lsls r0, 2 + ldrb r1, [r3, 0x5] + movs r4, 0xD + negs r4, r4 + adds r2, r4, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x5] + ldr r4, [r7] + ldr r2, [r4, 0x4] + adds r2, r5, r2 + ldrh r3, [r2, 0x14] + ldr r1, =0x000003ff + adds r0, r1, 0 + adds r1, r3, 0 + ands r1, r0 + mov r12, r1 + ldrh r0, [r2, 0x4] + ldr r3, =0xfffffc00 + adds r1, r3, 0 + ands r0, r1 + mov r1, r12 + orrs r0, r1 + strh r0, [r2, 0x4] + lsls r1, r6, 3 + ldr r2, =0x030024f8 + ldr r0, [r4, 0x4] + adds r1, r2 + adds r0, r5, r0 + ldm r0!, {r2,r3} + stm r1!, {r2,r3} +_081523C0: + ldr r3, =0x0203abb8 +_081523C2: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, [r3] + ldrb r0, [r0] + cmp r6, r0 + bcc _08152300 +_081523D0: + movs r0, 0x1 +_081523D2: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81522D4 + + thumb_func_start sub_81523F4 +sub_81523F4: @ 81523F4 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + cmp r4, 0 + beq _08152430 + ldrh r0, [r4, 0x10] + bl GetObjectTileRangeStartByTag + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =0x0000ffff + cmp r5, r0 + beq _08152430 + strb r6, [r4, 0x18] + ldrb r0, [r4, 0x1] + lsrs r0, 6 + ldrb r1, [r4, 0x3] + lsrs r1, 6 + bl sub_80355F8 + lsls r0, 24 + lsrs r0, 24 + muls r0, r6 + adds r0, r5, r0 + strh r0, [r4, 0x14] + movs r0, 0x1 + b _08152432 + .pool +_08152430: + movs r0, 0 +_08152432: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81523F4 + + thumb_func_start sub_8152438 +sub_8152438: @ 8152438 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x0203abb8 + ldr r0, [r0] + cmp r0, 0 + beq _0815246C + ldrb r1, [r0] + cmp r2, r1 + bcs _0815246C + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 4 + adds r3, r0, r1 + ldrb r1, [r3, 0x19] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0815246C + str r4, [r3, 0x2C] + adds r0, r2, 0 + b _0815246E + .pool +_0815246C: + movs r0, 0xFF +_0815246E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8152438 + + thumb_func_start sub_8152474 +sub_8152474: @ 8152474 + push {r4,r5,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + lsls r2, 16 + lsrs r5, r2, 16 + ldr r0, =0x0203abb8 + ldr r0, [r0] + cmp r0, 0 + beq _081524A8 + ldrb r1, [r0] + cmp r3, r1 + bcs _081524A8 + ldr r1, [r0, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 4 + adds r2, r0, r1 + ldrb r1, [r2, 0x19] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081524A8 + cmp r4, 0x7 + bls _081524B0 +_081524A8: + movs r0, 0xFF + b _081524BC + .pool +_081524B0: + lsls r1, r4, 1 + adds r0, r2, 0 + adds r0, 0x1A + adds r0, r1 + strh r5, [r0] + adds r0, r3, 0 +_081524BC: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8152474 + + thumb_func_start sub_81524C4 +sub_81524C4: @ 81524C4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + mov r9, r0 + ldr r0, [sp, 0x30] + ldr r4, [sp, 0x34] + ldr r5, [sp, 0x38] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + lsls r3, 16 + lsrs r3, 16 + str r3, [sp, 0x4] + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x8] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0xC] + lsls r5, 24 + lsrs r5, 24 + mov r10, r5 + movs r5, 0 + ldr r0, =0x0203abb8 + ldr r0, [r0] + cmp r0, 0 + beq _0815255E + mov r1, r9 + cmp r1, 0 + bne _08152530 + b _0815255E + .pool +_08152514: + adds r5, r2, 0 + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x30 + bl memset + strb r4, [r5, 0x16] + ldrb r0, [r5, 0x19] + movs r1, 0x1 + orrs r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r5, 0x19] + b _0815255A +_08152530: + movs r4, 0 + ldrb r1, [r0] + cmp r5, r1 + bcs _0815255A + ldr r6, [r0, 0x4] + adds r3, r1, 0 + movs r7, 0x1 +_0815253E: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 4 + adds r2, r0, r6 + ldrb r1, [r2, 0x19] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08152514 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r3 + bcc _0815253E +_0815255A: + cmp r5, 0 + bne _08152562 +_0815255E: + movs r0, 0xFF + b _081525C0 +_08152562: + adds r1, r5, 0 + mov r0, r9 + ldm r0!, {r2,r3} + stm r1!, {r2,r3} + mov r0, sp + ldrh r0, [r0] + strh r0, [r5, 0x10] + mov r1, r8 + strh r1, [r5, 0x12] + mov r2, sp + ldrh r2, [r2, 0x4] + strh r2, [r5, 0x8] + mov r3, sp + ldrh r3, [r3, 0x8] + strh r3, [r5, 0xA] + mov r0, r8 + bl IndexOfObjectPaletteTag + lsls r0, 4 + ldrb r1, [r5, 0x5] + movs r4, 0xF + ands r4, r1 + orrs r4, r0 + strb r4, [r5, 0x5] + mov r0, r10 + cmp r0, 0x3 + bhi _081525B6 + movs r1, 0x3 + ands r1, r0 + lsls r3, r1, 3 + ldrb r2, [r5, 0x19] + movs r0, 0x19 + negs r0, r0 + ands r0, r2 + orrs r0, r3 + strb r0, [r5, 0x19] + lsls r1, 2 + movs r0, 0xD + negs r0, r0 + ands r4, r0 + orrs r4, r1 + strb r4, [r5, 0x5] +_081525B6: + adds r0, r5, 0 + ldr r1, [sp, 0xC] + bl sub_81523F4 + ldrb r0, [r5, 0x16] +_081525C0: + 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_81524C4 + + thumb_func_start sub_81525D0 +sub_81525D0: @ 81525D0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, =0x0203abb8 + ldr r0, [r6] + cmp r0, 0 + beq _081525F2 + ldr r1, [r0, 0x4] + lsls r0, r5, 1 + adds r0, r5 + lsls r4, r0, 4 + adds r2, r4, r1 + ldrb r1, [r2, 0x19] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081525FC +_081525F2: + movs r0, 0xFF + b _0815263C + .pool +_081525FC: + adds r0, r2, 0 + movs r1, 0 + movs r2, 0x30 + bl memset + ldr r0, [r6] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + movs r1, 0xA0 + strb r1, [r0] + ldr r3, [r6] + ldr r2, [r3, 0x4] + adds r2, r4, r2 + ldrh r1, [r2, 0x2] + ldr r0, =0xfffffe00 + ands r0, r1 + movs r1, 0xF0 + orrs r0, r1 + strh r0, [r2, 0x2] + ldr r1, [r3, 0x4] + adds r1, r4, r1 + ldrb r0, [r1, 0x19] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1, 0x19] + lsls r1, r5, 3 + ldr r0, =0x030024f8 + adds r1, r0 + ldr r0, =gDefaultOamAttributes + ldm r0!, {r2,r3} + stm r1!, {r2,r3} + adds r0, r5, 0 +_0815263C: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81525D0 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/cable_club.s b/asm/cable_club.s new file mode 100644 index 000000000..aeabcb8ba --- /dev/null +++ b/asm/cable_club.s @@ -0,0 +1,2842 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80B236C +sub_80B236C: @ 80B236C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r4, =sub_80B2634 + adds r0, r4, 0 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _080B23A0 + adds r0, r4, 0 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r6, [r1, 0xA] + strh r5, [r1, 0xC] +_080B23A0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B236C + + thumb_func_start sub_80B23B0 +sub_80B23B0: @ 80B23B0 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =0x02021cc4 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalString + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl SetStandardWindowBorderStyle + ldr r5, =0x02021fc4 + ldr r1, =gUnknown_085EE667 + adds r0, r5, 0 + bl ExpandStringRefs + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x58 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r5, 0 + bl Print + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B23B0 + + thumb_func_start sub_80B241C +sub_80B241C: @ 80B241C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl sub_819746C + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B241C + + thumb_func_start sub_80B243C +sub_80B243C: @ 80B243C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r4, r1, r0 + movs r1, 0x6 + ldrsh r0, [r4, r1] + cmp r5, r0 + beq _080B2472 + cmp r5, 0x1 + bhi _080B2468 + ldrh r0, [r4, 0xA] + bl sub_80B241C + b _080B2470 + .pool +_080B2468: + ldrh r0, [r4, 0xA] + adds r1, r5, 0 + bl sub_80B23B0 +_080B2470: + strh r5, [r4, 0x6] +_080B2472: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B243C + + thumb_func_start sub_80B2478 +sub_80B2478: @ 80B2478 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + bl sub_800A0C8 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + cmp r0, 0x6 + bhi _080B24F0 + lsls r0, 2 + ldr r1, =_080B24A0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080B24A0: + .4byte _080B24BC + .4byte _080B24F0 + .4byte _080B24C0 + .4byte _080B24C4 + .4byte _080B24C8 + .4byte _080B24CC + .4byte _080B24EC +_080B24BC: + movs r0, 0x1 + b _080B24F2 +_080B24C0: + movs r0, 0x3 + b _080B24F2 +_080B24C4: + movs r0, 0x7 + b _080B24F2 +_080B24C8: + movs r0, 0x9 + b _080B24F2 +_080B24CC: + ldr r4, =0x02021cc4 + bl sub_800ABAC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalString + movs r0, 0x4 + b _080B24F2 + .pool +_080B24EC: + movs r0, 0xA + b _080B24F2 +_080B24F0: + movs r0, 0 +_080B24F2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B2478 + + thumb_func_start sub_80B24F8 +sub_80B24F8: @ 80B24F8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_800B33C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B250E + movs r0, 0 + b _080B251E +_080B250E: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80B2D2C + str r0, [r1] + movs r0, 0x1 +_080B251E: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B24F8 + + thumb_func_start sub_80B252C +sub_80B252C: @ 80B252C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080B2570 + bl sub_800B320 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080B2570 + ldr r0, =0x020229c6 + strh r1, [r0] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80B2CEC + str r1, [r0] + movs r0, 0x1 + b _080B2572 + .pool +_080B2570: + movs r0, 0 +_080B2572: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B252C + + thumb_func_start sub_80B2578 +sub_80B2578: @ 80B2578 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_800B320 + lsls r0, 24 + cmp r0, 0 + beq _080B258E + movs r0, 0x1 + bl sub_800B330 +_080B258E: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080B25A4 + movs r0, 0 + b _080B25BA + .pool +_080B25A4: + ldr r1, =0x020229c6 + movs r0, 0 + strh r0, [r1] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80B2CEC + str r1, [r0] + movs r0, 0x1 +_080B25BA: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B2578 + + thumb_func_start sub_80B25CC +sub_80B25CC: @ 80B25CC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_800B2E8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B25E2 + movs r0, 0 + b _080B25F2 +_080B25E2: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80B2D2C + str r0, [r1] + movs r0, 0x1 +_080B25F2: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B25CC + + thumb_func_start sub_80B2600 +sub_80B2600: @ 80B2600 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _080B262A + movs r0, 0x2 + bl sub_800A4D8 + adds r0, r4, 0 + bl DestroyTask +_080B262A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B2600 + + thumb_func_start sub_80B2634 +sub_80B2634: @ 80B2634 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r4, r1, r0 + movs r3, 0 + ldrsh r2, [r4, r3] + cmp r2, 0 + bne _080B266C + bl sub_800A0AC + bl sub_800AB98 + bl sub_800A2BC + ldr r0, =gUnknown_08550594 + bl AddWindow + strh r0, [r4, 0xA] + b _080B2678 + .pool +_080B266C: + cmp r2, 0x9 + ble _080B2678 + subs r0, 0x8 + adds r0, r1, r0 + ldr r1, =sub_80B2688 + str r1, [r0] +_080B2678: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B2634 + + thumb_func_start sub_80B2688 +sub_80B2688: @ 80B2688 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_800ABAC + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + bl sub_80B252C + cmp r0, 0x1 + beq _080B26FC + adds r0, r4, 0 + bl sub_80B2578 + cmp r0, 0x1 + beq _080B26FC + cmp r5, 0x1 + bls _080B26FC + movs r0, 0x1 + bl sub_800B330 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0 + strh r0, [r4, 0xE] + bl sub_800ABBC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B26EC + movs r0, 0x15 + bl audio_play + ldr r0, =gUnknown_082780B3 + bl box_related_two__3 + ldr r0, =sub_80B270C + b _080B26FA + .pool +_080B26EC: + movs r0, 0x16 + bl audio_play + ldr r0, =gUnknown_08278131 + bl box_related_two__3 + ldr r0, =sub_80B2918 +_080B26FA: + str r0, [r4] +_080B26FC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B2688 + + thumb_func_start sub_80B270C +sub_80B270C: @ 80B270C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_80B252C + cmp r0, 0x1 + beq _080B274C + adds r0, r4, 0 + bl sub_80B25CC + cmp r0, 0x1 + beq _080B274C + adds r0, r4, 0 + bl sub_80B24F8 + cmp r0, 0x1 + beq _080B274C + bl textbox_any_visible + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _080B274C + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + strh r2, [r1, 0xE] + ldr r0, =sub_80B275C + str r0, [r1] +_080B274C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B270C + + thumb_func_start sub_80B275C +sub_80B275C: @ 80B275C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + mov r8, r0 + ldr r0, =0x03005e08 + mov r9, r0 + mov r7, r8 + add r7, r9 + bl sub_800ABAC + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + bl sub_80B252C + cmp r0, 0x1 + beq _080B27E4 + adds r0, r4, 0 + bl sub_80B25CC + cmp r0, 0x1 + beq _080B27E4 + adds r0, r4, 0 + bl sub_80B24F8 + cmp r0, 0x1 + beq _080B27E4 + adds r6, r5, 0 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80B243C + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B27E4 + movs r1, 0x2 + ldrsh r0, [r7, r1] + cmp r5, r0 + blt _080B27E4 + adds r0, r6, 0 + bl sub_800AA04 + ldrh r0, [r7, 0xA] + bl sub_80B241C + ldr r0, =0x02021cc4 + adds r1, r5, 0 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalString + ldr r0, =gUnknown_082780F2 + bl box_related_two__3 + mov r0, r9 + subs r0, 0x8 + add r0, r8 + ldr r1, =sub_80B2804 + str r1, [r0] +_080B27E4: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B275C + + thumb_func_start sub_80B2804 +sub_80B2804: @ 80B2804 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + adds r0, r5, 0 + bl sub_80B252C + cmp r0, 0x1 + beq _080B2898 + adds r0, r5, 0 + bl sub_80B25CC + cmp r0, 0x1 + beq _080B2898 + adds r0, r5, 0 + bl sub_80B24F8 + cmp r0, 0x1 + beq _080B2898 + bl textbox_any_visible + lsls r0, 24 + cmp r0, 0 + bne _080B2898 + bl sub_800AA48 + adds r4, r0, 0 + bl sub_800ABAC + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _080B2852 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2C] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080B2878 +_080B2852: + ldr r0, =gUnknown_082780B3 + bl box_related_two__3 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80B270C + str r1, [r0] + b _080B2898 + .pool +_080B2878: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B2898 + movs r0, 0x5 + bl audio_play + bl sub_800A620 + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80B28A8 + str r0, [r1] +_080B2898: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B2804 + + thumb_func_start sub_80B28A8 +sub_80B28A8: @ 80B28A8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r5, r0, r1 + ldrb r7, [r5, 0xA] + ldrb r6, [r5, 0xC] + adds r0, r4, 0 + bl sub_80B24F8 + cmp r0, 0x1 + beq _080B290A + adds r0, r4, 0 + bl sub_80B2D6C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B290A + bl sub_800ABAC + adds r4, r0, 0 + bl sub_800AA48 + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _080B28F4 + ldr r0, =sub_80B2D2C + b _080B2908 + .pool +_080B28F4: + ldr r4, =0x020375f0 + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_80B2478 + strh r0, [r4] + lsls r0, 16 + cmp r0, 0 + beq _080B290A + ldr r0, =sub_80B2A08 +_080B2908: + str r0, [r5] +_080B290A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B28A8 + + thumb_func_start sub_80B2918 +sub_80B2918: @ 80B2918 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r7, r0, r1 + ldrb r6, [r7, 0xA] + ldrb r5, [r7, 0xC] + adds r0, r4, 0 + bl sub_80B252C + cmp r0, 0x1 + beq _080B29E6 + adds r0, r4, 0 + bl sub_80B24F8 + cmp r0, 0x1 + beq _080B29E6 + ldr r4, =0x020375f0 + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80B2478 + adds r1, r0, 0 + strh r1, [r4] + lsls r0, r1, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _080B29E6 + subs r0, r1, 0x3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _080B297C + bl sub_800AC34 + bl textbox_close + ldr r0, =sub_80B2CB0 + b _080B29E4 + .pool +_080B297C: + cmp r2, 0x7 + beq _080B2984 + cmp r2, 0x9 + bne _080B2994 +_080B2984: + bl sub_80097E8 + bl textbox_close + ldr r0, =sub_80B2CB0 + b _080B29E4 + .pool +_080B2994: + bl sub_800ABAC + ldr r4, =0x03005db8 + strb r0, [r4] + bl link_get_multiplayer_id + ldr r1, =0x03005db4 + strb r0, [r1] + ldrb r0, [r4] + bl sub_800AA04 + ldr r4, =0x020228c4 + adds r0, r4, 0 + bl sub_80C30A4 + ldr r0, =0x0203cef8 + mov r8, r0 + ldrb r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x02024488 + adds r0, r5 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r1, r4, 0 + adds r1, 0x54 + strh r0, [r1] + mov r1, r8 + ldrb r0, [r1, 0x1] + muls r0, r6 + adds r0, r5 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r4, 0x56 + strh r0, [r4] + ldr r0, =sub_80B2C30 +_080B29E4: + str r0, [r7] +_080B29E6: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B2918 + + thumb_func_start sub_80B2A08 +sub_80B2A08: @ 80B2A08 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r7, 0 + bl sub_80B24F8 + cmp r0, 0x1 + beq _080B2ACE + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0x4 + bne _080B2A38 + bl sub_800A064 + cmp r0, 0 + bne _080B2A4A + bl sub_800AC34 + b _080B2A4E + .pool +_080B2A38: + cmp r0, 0x3 + bne _080B2A42 + bl sub_800AC34 + b _080B2A4E +_080B2A42: + cmp r0, 0x7 + beq _080B2A4A + cmp r0, 0x9 + bne _080B2A6C +_080B2A4A: + bl sub_80097E8 +_080B2A4E: + bl textbox_close + ldr r0, =0x03005e00 + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80B2CB0 + str r0, [r1] + b _080B2ACE + .pool +_080B2A6C: + bl sub_800ABAC + ldr r4, =0x03005db8 + strb r0, [r4] + bl link_get_multiplayer_id + ldr r1, =0x03005db4 + strb r0, [r1] + ldrb r0, [r4] + bl sub_800AA04 + ldr r4, =0x020228c4 + adds r0, r4, 0 + bl sub_80C30A4 + ldr r0, =0x0203cef8 + mov r8, r0 + ldrb r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x02024488 + adds r0, r5 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r1, r4, 0 + adds r1, 0x54 + strh r0, [r1] + mov r1, r8 + ldrb r0, [r1, 0x1] + muls r0, r6 + adds r0, r5 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r4, 0x56 + strh r0, [r4] + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80B2C30 + str r1, [r0] + movs r0, 0x2 + bl sub_800A4D8 +_080B2ACE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B2A08 + + thumb_func_start sub_80B2AF4 +sub_80B2AF4: @ 80B2AF4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + str r0, [sp] + str r1, [sp, 0x4] + movs r2, 0 + movs r7, 0 + ldr r1, =0x02021cc4 + movs r0, 0xFF + strb r0, [r1] + ldr r1, =0x02021dc4 + movs r0, 0x1 + negs r0, r0 + strb r0, [r1] + movs r1, 0 + movs r0, 0xB + mov r10, r0 + ldr r0, =gSpeciesNames + mov r9, r0 +_080B2B20: + lsls r0, r1, 1 + adds r1, 0x1 + mov r8, r1 + ldr r1, [sp] + adds r4, r0, r1 + ldr r5, [sp, 0x4] + movs r6, 0x1 +_080B2B2E: + ldrh r0, [r4] + ldrh r1, [r5] + cmp r0, r1 + bne _080B2B5E + cmp r7, 0 + bne _080B2B48 + mov r1, r10 + muls r1, r0 + add r1, r9 + ldr r0, =0x02021cc4 + bl CopyString + movs r2, 0x1 +_080B2B48: + cmp r7, 0x1 + bne _080B2B5C + ldrh r0, [r4] + mov r1, r10 + muls r1, r0 + add r1, r9 + ldr r0, =0x02021dc4 + bl CopyString + movs r2, 0x1 +_080B2B5C: + adds r7, 0x1 +_080B2B5E: + adds r5, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _080B2B2E + mov r1, r8 + cmp r1, 0x1 + ble _080B2B20 + ldr r0, =0x020375e2 + strh r7, [r0] + adds r0, r2, 0 + 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_80B2AF4 + + thumb_func_start task_map_chg_seq_0807EC34 +task_map_chg_seq_0807EC34: @ 80B2B94 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldr r1, =0x02039b58 + ldrh r0, [r5] + cmp r0, 0x1 + bne _080B2C10 + ldr r0, =0x020229c6 + ldrh r2, [r0] + ldr r0, =0x00002266 + cmp r2, r0 + beq _080B2BB2 + adds r0, 0x11 + cmp r2, r0 + bne _080B2BEC +_080B2BB2: + adds r0, r1, 0 + adds r0, 0x54 + adds r1, 0xB8 + bl sub_80B2AF4 + cmp r0, 0 + beq _080B2BEC + movs r0, 0xB + strh r0, [r5] + bl sub_800AC34 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80B2CB0 + str r1, [r0] + b _080B2C22 + .pool +_080B2BEC: + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x12] + bl sub_80B241C + bl script_env_2_enable_and_set_ctx_running + lsls r0, r4, 24 + lsrs r0, 24 + bl DestroyTask + b _080B2C22 + .pool +_080B2C10: + bl sub_800AC34 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80B2CB0 + str r0, [r1] +_080B2C22: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end task_map_chg_seq_0807EC34 + + thumb_func_start sub_80B2C30 +sub_80B2C30: @ 80B2C30 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl sub_80B24F8 + cmp r0, 0x1 + beq _080B2C9C + bl sub_800A550 + adds r4, r0, 0 + bl sub_800A9A8 + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _080B2C9C + movs r4, 0 + ldr r6, =0x020229e8 + b _080B2C7E + .pool +_080B2C5C: + movs r0, 0x64 + muls r0, r4 + ldr r1, =0x02039b58 + adds r0, r1 + lsls r1, r4, 8 + ldr r2, =0x020223c4 + adds r1, r2 + lsls r2, r4, 3 + subs r2, r4 + lsls r2, 2 + adds r2, r6 + ldrb r2, [r2] + bl sub_80C3120 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_080B2C7E: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcc _080B2C5C + movs r0, 0 + bl sub_800B330 + bl sub_800A5B4 + ldr r0, =0x020375f0 + adds r1, r5, 0 + bl task_map_chg_seq_0807EC34 +_080B2C9C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B2C30 + + thumb_func_start sub_80B2CB0 +sub_80B2CB0: @ 80B2CB0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _080B2CDE + ldr r0, =0x03005e00 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r4, 0x12] + bl sub_80B241C + bl script_env_2_enable_and_set_ctx_running + ldrb r0, [r4, 0x12] + bl RemoveWindow + adds r0, r5, 0 + bl DestroyTask +_080B2CDE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B2CB0 + + thumb_func_start sub_80B2CEC +sub_80B2CEC: @ 80B2CEC + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =0x020375f0 + movs r0, 0x5 + strh r0, [r1] + ldr r0, =0x03005e00 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r4, 0x12] + bl sub_80B241C + bl sub_8098374 + ldrb r0, [r4, 0x12] + bl RemoveWindow + bl script_env_2_enable_and_set_ctx_running + adds r0, r5, 0 + bl DestroyTask + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B2CEC + + thumb_func_start sub_80B2D2C +sub_80B2D2C: @ 80B2D2C + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =0x020375f0 + movs r0, 0x6 + strh r0, [r1] + ldr r0, =0x03005e00 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r4, 0x12] + bl sub_80B241C + ldrb r0, [r4, 0x12] + bl RemoveWindow + bl textbox_close + bl script_env_2_enable_and_set_ctx_running + adds r0, r5, 0 + bl DestroyTask + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B2D2C + + thumb_func_start sub_80B2D6C +sub_80B2D6C: @ 80B2D6C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r2, r1, r2 + ldrh r0, [r2, 0x10] + adds r0, 0x1 + strh r0, [r2, 0x10] + lsls r0, 16 + movs r1, 0x96 + lsls r1, 18 + cmp r0, r1 + bgt _080B2D94 + movs r0, 0 + b _080B2D9A + .pool +_080B2D94: + ldr r0, =sub_80B2D2C + str r0, [r2] + movs r0, 0x1 +_080B2D9A: + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B2D6C + + thumb_func_start sub_80B2DA4 +sub_80B2DA4: @ 80B2DA4 + push {r4,lr} + movs r3, 0x2 + movs r2, 0x2 + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0x2 + beq _080B2DDC + cmp r0, 0x2 + bgt _080B2DC0 + cmp r0, 0x1 + beq _080B2DCA + b _080B2E34 + .pool +_080B2DC0: + cmp r0, 0x5 + beq _080B2DEC + cmp r0, 0x9 + beq _080B2E00 + b _080B2E34 +_080B2DCA: + movs r3, 0x2 + ldr r1, =0x020229c6 + ldr r4, =0x00002233 + b _080B2E30 + .pool +_080B2DDC: + movs r3, 0x2 + ldr r1, =0x020229c6 + ldr r4, =0x00002244 + b _080B2E30 + .pool +_080B2DEC: + movs r3, 0x4 + movs r2, 0x4 + ldr r1, =0x020229c6 + ldr r4, =0x00002255 + b _080B2E30 + .pool +_080B2E00: + movs r3, 0x2 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080B2E2C + ldr r1, =0x020229c6 + ldr r4, =0x00002266 + b _080B2E30 + .pool +_080B2E2C: + ldr r1, =0x020229c6 + ldr r4, =0x00002277 +_080B2E30: + adds r0, r4, 0 + strh r0, [r1] +_080B2E34: + adds r0, r3, 0 + adds r1, r2, 0 + bl sub_80B236C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B2DA4 + + thumb_func_start sub_80B2E4C +sub_80B2E4C: @ 80B2E4C + push {lr} + ldr r1, =0x020229c6 + ldr r2, =0x00001133 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, =0x02022fec + movs r0, 0 + str r0, [r1] + movs r0, 0x2 + movs r1, 0x2 + bl sub_80B236C + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B2E4C + + thumb_func_start sub_80B2E74 +sub_80B2E74: @ 80B2E74 + push {lr} + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r1, =0x020229c6 + ldr r2, =0x00003311 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, =0x02022fec + movs r0, 0 + str r0, [r1] + movs r0, 0x2 + movs r1, 0x4 + bl sub_80B236C + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B2E74 + + thumb_func_start sub_80B2EA8 +sub_80B2EA8: @ 80B2EA8 + push {r4,lr} + ldr r4, =sub_80B2EE4 + adds r0, r4, 0 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + bne _080B2ED4 + adds r0, r4, 0 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] +_080B2ED4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B2EA8 + + thumb_func_start sub_80B2EE4 +sub_80B2EE4: @ 80B2EE4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _080B2F0C + cmp r0, 0x1 + beq _080B2FB4 + b _080B2FC6 + .pool +_080B2F0C: + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0x1 + bne _080B2FA8 + movs r7, 0 + movs r0, 0 + mov r8, r0 + mov r9, r0 + bl sub_8009FCC + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + cmp r7, r5 + bge _080B2F74 + ldr r0, =0x020229e8 + ldrb r2, [r0] + ldrh r3, [r0, 0x1A] + subs r1, r2, 0x1 + mov r12, r0 + cmp r1, 0x1 + bhi _080B2F4A + b _080B2F6E + .pool +_080B2F44: + movs r1, 0x1 + mov r8, r1 + b _080B2F56 +_080B2F4A: + cmp r2, 0x3 + bne _080B2F56 + cmp r3, 0x1 + bne _080B2F56 + movs r0, 0x1 + mov r9, r0 +_080B2F56: + adds r4, 0x1 + cmp r4, r5 + bge _080B2F74 + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + add r0, r12 + ldrb r2, [r0] + ldrh r3, [r0, 0x1A] + subs r0, r2, 0x1 + cmp r0, 0x1 + bhi _080B2F4A +_080B2F6E: + cmp r3, 0x1 + bne _080B2F44 + movs r7, 0x1 +_080B2F74: + mov r1, r8 + cmp r1, 0 + beq _080B2F82 + mov r0, r9 + cmp r0, 0 + beq _080B2F82 + movs r7, 0x1 +_080B2F82: + cmp r7, 0 + beq _080B2FA8 + ldr r1, =0x020375f0 + movs r0, 0xC + strh r0, [r1] + bl sub_800AD10 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x8] + b _080B2FC6 + .pool +_080B2FA8: + bl script_env_2_enable_and_set_ctx_running + adds r0, r6, 0 + bl DestroyTask + b _080B2FC6 +_080B2FB4: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _080B2FC6 + bl script_env_2_enable_and_set_ctx_running + adds r0, r6, 0 + bl DestroyTask +_080B2FC6: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B2EE4 + + thumb_func_start sub_80B2FD8 +sub_80B2FD8: @ 80B2FD8 + push {lr} + ldr r1, =0x020229c6 + ldr r2, =0x00004411 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, =0x02022fec + movs r0, 0 + str r0, [r1] + movs r0, 0x2 + movs r1, 0x4 + bl sub_80B236C + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B2FD8 + + thumb_func_start sub_80B3000 +sub_80B3000: @ 80B3000 + push {lr} + ldr r1, =0x020229c6 + ldr r2, =0x00006601 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, =0x02022fec + movs r0, 0 + str r0, [r1] + movs r0, 0x4 + movs r1, 0x4 + bl sub_80B236C + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B3000 + + thumb_func_start sub_80B3028 +sub_80B3028: @ 80B3028 + push {lr} + ldr r1, =0x020229c6 + ldr r2, =0x00006602 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, =0x02022fec + movs r0, 0 + str r0, [r1] + movs r0, 0x2 + movs r1, 0x4 + bl sub_80B236C + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B3028 + + thumb_func_start sub_80B3050 +sub_80B3050: @ 80B3050 + push {lr} + ldr r0, =sub_80B3144 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + beq _080B3068 + movs r0, 0xFF + b _080B3134 + .pool +_080B3068: + ldr r0, =0x020375e0 + ldrh r0, [r0] + subs r0, 0x1 + cmp r0, 0x8 + bhi _080B3128 + lsls r0, 2 + ldr r1, =_080B3084 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080B3084: + .4byte _080B30A8 + .4byte _080B30B8 + .4byte _080B3110 + .4byte _080B3120 + .4byte _080B30C8 + .4byte _080B3128 + .4byte _080B3128 + .4byte _080B3128 + .4byte _080B30D8 +_080B30A8: + ldr r1, =0x020229c6 + ldr r2, =0x00002233 + b _080B3124 + .pool +_080B30B8: + ldr r1, =0x020229c6 + ldr r2, =0x00002244 + b _080B3124 + .pool +_080B30C8: + ldr r1, =0x020229c6 + ldr r2, =0x00002255 + b _080B3124 + .pool +_080B30D8: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080B3100 + ldr r1, =0x020229c6 + ldr r2, =0x00002266 + b _080B3124 + .pool +_080B3100: + ldr r1, =0x020229c6 + ldr r2, =0x00002277 + b _080B3124 + .pool +_080B3110: + ldr r1, =0x020229c6 + ldr r2, =0x00001111 + b _080B3124 + .pool +_080B3120: + ldr r1, =0x020229c6 + ldr r2, =0x00003322 +_080B3124: + adds r0, r2, 0 + strh r0, [r1] +_080B3128: + ldr r0, =sub_80B3144 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 +_080B3134: + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B3050 + + thumb_func_start sub_80B3144 +sub_80B3144: @ 80B3144 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r4, r1, r0 + movs r3, 0 + ldrsh r2, [r4, r3] + cmp r2, 0 + bne _080B3178 + bl sub_8009734 + bl sub_800A2BC + ldr r0, =task00_08081A90 + movs r1, 0x50 + bl CreateTask + b _080B3184 + .pool +_080B3178: + cmp r2, 0x9 + ble _080B3184 + subs r0, 0x8 + adds r0, r1, r0 + ldr r1, =sub_80B3194 + str r1, [r0] +_080B3184: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B3144 + + thumb_func_start sub_80B3194 +sub_80B3194: @ 80B3194 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl sub_800ABAC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _080B31DA + bl sub_800ABBC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B31CC + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80B31E8 + b _080B31D8 + .pool +_080B31CC: + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80B3220 +_080B31D8: + str r0, [r1] +_080B31DA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B3194 + + thumb_func_start sub_80B31E8 +sub_80B31E8: @ 80B31E8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_800AA48 + adds r4, r0, 0 + bl sub_800ABAC + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _080B3212 + bl sub_800A620 + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80B3220 + str r0, [r1] +_080B3212: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B31E8 + + thumb_func_start sub_80B3220 +sub_80B3220: @ 80B3220 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080B3248 + bl sub_800A23C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B3248 + bl sub_800AB18 + bl sub_8009F18 + adds r0, r4, 0 + bl DestroyTask +_080B3248: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B3220 + + thumb_func_start sub_80B3254 +sub_80B3254: @ 80B3254 + push {lr} + bl sub_809FF80 + pop {r0} + bx r0 + thumb_func_end sub_80B3254 + + thumb_func_start sub_80B3260 +sub_80B3260: @ 80B3260 + push {lr} + cmp r0, 0x2 + beq _080B3284 + cmp r0, 0x2 + bgt _080B3270 + cmp r0, 0x1 + beq _080B327A + b _080B32A6 +_080B3270: + cmp r0, 0x5 + beq _080B3290 + cmp r0, 0x9 + beq _080B32A0 + b _080B32A6 +_080B327A: + ldr r1, =0x02022fec + movs r0, 0xA + b _080B32A4 + .pool +_080B3284: + ldr r1, =0x02022fec + movs r0, 0xB + b _080B32A4 + .pool +_080B3290: + bl sub_80F94E8 + ldr r1, =0x02022fec + movs r0, 0x4B + b _080B32A4 + .pool +_080B32A0: + ldr r1, =0x02022fec + ldr r0, =0x0000014b +_080B32A4: + str r0, [r1] +_080B32A6: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B3260 + + thumb_func_start sub_80B32B4 +sub_80B32B4: @ 80B32B4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x5 + bhi _080B33A0 + lsls r0, 2 + ldr r1, =_080B32E0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080B32E0: + .4byte _080B32F8 + .4byte _080B3318 + .4byte _080B3328 + .4byte _080B3338 + .4byte _080B333E + .4byte _080B3354 +_080B32F8: + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r1, =0x020229c6 + ldr r2, =0x00002211 + adds r0, r2, 0 + strh r0, [r1] + bl sub_8009FAC + b _080B3346 + .pool +_080B3318: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + b _080B3342 + .pool +_080B3328: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _080B33A0 + b _080B3346 +_080B3338: + bl sub_800AC34 + b _080B3346 +_080B333E: + ldr r0, =0x03003124 + ldrb r0, [r0] +_080B3342: + cmp r0, 0 + bne _080B33A0 +_080B3346: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080B33A0 + .pool +_080B3354: + ldr r0, =0x020229e8 + ldr r0, [r0, 0x4] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B3370 + ldr r0, =0x000001dd + bl current_map_music_set__default_for_battle + b _080B3378 + .pool +_080B3370: + movs r0, 0xEE + lsls r0, 1 + bl current_map_music_set__default_for_battle +_080B3378: + ldr r0, =0x020375e0 + ldrh r0, [r0] + bl sub_80B3260 + bl overworld_free_bg_tilemaps + ldr r1, =0x02038bca + movs r2, 0x80 + lsls r2, 4 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, =sub_8036760 + bl SetMainCallback2 + ldr r1, =0x030022c0 + ldr r0, =sub_80B360C + str r0, [r1, 0x8] + adds r0, r5, 0 + bl DestroyTask +_080B33A0: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B32B4 + + thumb_func_start sub_80B33BC +sub_80B33BC: @ 80B33BC + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r6, r0, r1 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0x7 + bls _080B33D6 + b _080B3532 +_080B33D6: + lsls r0, 2 + ldr r1, =_080B33E8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080B33E8: + .4byte _080B3408 + .4byte _080B342C + .4byte _080B3444 + .4byte _080B3458 + .4byte _080B34B0 + .4byte _080B34C4 + .4byte _080B34CE + .4byte _080B34DE +_080B3408: + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, =0x020229c6 + ldr r2, =0x00002211 + adds r1, r2, 0 + strh r1, [r0] + bl sub_8009FAC + movs r0, 0x1 + strh r0, [r6] + b _080B3532 + .pool +_080B342C: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080B343A + b _080B3532 +_080B343A: + movs r0, 0x2 + strh r0, [r6] + b _080B3532 + .pool +_080B3444: + ldr r1, =0x020229cc + movs r0, 0 + movs r2, 0x1C + bl link_0800A448 + movs r0, 0x3 + strh r0, [r6] + b _080B3532 + .pool +_080B3458: + bl sub_800A550 + adds r4, r0, 0 + bl sub_800A9D8 + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _080B3532 + movs r4, 0 + ldr r5, =0x020229e8 + b _080B349A + .pool +_080B3474: + lsls r1, r4, 8 + ldr r2, =0x020223c4 + adds r0, r5, 0 + adds r1, r2 + ldm r1!, {r2,r3,r7} + stm r0!, {r2,r3,r7} + ldm r1!, {r2,r3,r7} + stm r0!, {r2,r3,r7} + ldr r1, [r1] + str r1, [r0] + adds r0, r5, 0 + bl sub_800B524 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_800A5EC + adds r5, 0x1C + adds r4, 0x1 +_080B349A: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + blt _080B3474 + movs r0, 0x4 + strh r0, [r6] + b _080B3532 + .pool +_080B34B0: + ldrh r0, [r6, 0x2] + adds r0, 0x1 + strh r0, [r6, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _080B3532 + movs r0, 0x5 + strh r0, [r6] + b _080B3532 +_080B34C4: + bl sub_800ADF8 + movs r0, 0x6 + strh r0, [r6] + b _080B3532 +_080B34CE: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080B3532 + movs r0, 0x7 + strh r0, [r6] + b _080B3532 +_080B34DE: + ldr r0, =0x020229e8 + ldr r0, [r0, 0x4] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B34FC + ldr r0, =0x000001dd + bl current_map_music_set__default_for_battle + b _080B3504 + .pool +_080B34FC: + movs r0, 0xEE + lsls r0, 1 + bl current_map_music_set__default_for_battle +_080B3504: + ldr r1, =0x020229e8 + ldr r0, =0x00002211 + str r0, [r1, 0x14] + ldr r0, =0x020375e0 + ldrh r0, [r0] + bl sub_80B3260 + bl overworld_free_bg_tilemaps + ldr r1, =0x02038bca + movs r3, 0x80 + lsls r3, 4 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, =sub_8036760 + bl SetMainCallback2 + ldr r1, =0x030022c0 + ldr r0, =sub_80B360C + str r0, [r1, 0x8] + adds r0, r4, 0 + bl DestroyTask +_080B3532: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B33BC + + thumb_func_start sub_80B3554 +sub_80B3554: @ 80B3554 + push {r4,lr} + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080B35E0 + cmp r0, 0x1 + bgt _080B3574 + cmp r0, 0 + beq _080B357A + b _080B35FE + .pool +_080B3574: + cmp r0, 0x2 + beq _080B35F8 + b _080B35FE +_080B357A: + bl sub_8009FCC + lsls r0, 24 + lsrs r3, r0, 24 + movs r4, 0 + movs r2, 0 + cmp r4, r3 + bge _080B35AC + ldr r1, =0x020229e8 + ldrb r0, [r1] + subs r0, 0x4 + cmp r0, 0x1 + bls _080B35B0 +_080B3594: + adds r2, 0x1 + cmp r2, r3 + bge _080B35AC + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0] + subs r0, 0x4 + cmp r0, 0x1 + bhi _080B3594 + movs r4, 0x1 +_080B35AC: + cmp r4, 0 + beq _080B35C8 +_080B35B0: + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + b _080B35FE + .pool +_080B35C8: + bl sub_800AC34 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + b _080B35FE + .pool +_080B35E0: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _080B35FE + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + b _080B35FE + .pool +_080B35F8: + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 +_080B35FE: + bl RunTasks + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B3554 + + thumb_func_start sub_80B360C +sub_80B360C: @ 80B360C + push {r4,r5,lr} + ldr r2, =0x02022fec + ldr r0, [r2] + movs r1, 0x21 + negs r1, r1 + ands r0, r1 + str r0, [r2] + bl call_map_music_set_to_zero + bl copy_player_party_from_sav1 + bl copy_bags_and_unk_data_to_save_blocks + bl sub_813BF10 + ldr r0, =0x020375e0 + ldrh r0, [r0] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _080B36B2 + ldr r0, =0x03005db4 + ldrb r0, [r0] + movs r5, 0x1 + eors r0, r5 + bl sub_813C2A0 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _080B36B2 + ldr r0, =0x0202433a + ldrb r0, [r0] + cmp r0, 0x1 + beq _080B3670 + cmp r0, 0x2 + beq _080B3694 + b _080B36B2 + .pool +_080B3670: + ldr r4, =0x020229e8 + bl link_get_multiplayer_id + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r4, 0x4 + adds r1, r4 + ldr r1, [r1] + movs r0, 0 + bl sub_801B990 + b _080B36B2 + .pool +_080B3694: + ldr r4, =0x020229e8 + bl link_get_multiplayer_id + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r4, 0x4 + adds r1, r4 + ldr r1, [r1] + movs r0, 0x1 + bl sub_801B990 +_080B36B2: + bl InUnionRoom + cmp r0, 0x1 + bne _080B36CC + ldr r1, =0x030022c0 + ldr r0, =sub_80B3554 + b _080B36D0 + .pool +_080B36CC: + ldr r1, =0x030022c0 + ldr r0, =c2_8056854 +_080B36D0: + str r0, [r1, 0x8] + ldr r0, =sub_80A0514 + bl SetMainCallback2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B360C + + thumb_func_start sub_80B36EC +sub_80B36EC: @ 80B36EC + push {lr} + ldr r0, =0x020375e0 + ldrh r1, [r0] + subs r0, r1, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _080B3706 + adds r0, r1, 0 + cmp r0, 0x5 + beq _080B3706 + cmp r0, 0x9 + bne _080B370E +_080B3706: + bl copy_player_party_from_sav1 + bl copy_bags_and_unk_data_to_save_blocks +_080B370E: + movs r0, 0x7F + bl copy_saved_warp2_bank_and_enter_x_to_warp1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B36EC + + thumb_func_start sub_80B371C +sub_80B371C: @ 80B371C + push {lr} + bl sub_80872B0 + pop {r0} + bx r0 + thumb_func_end sub_80B371C + + thumb_func_start sub_80B3728 +sub_80B3728: @ 80B3728 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _080B376C + cmp r0, 0x1 + bgt _080B3750 + cmp r0, 0 + beq _080B375A + b _080B37CC + .pool +_080B3750: + cmp r0, 0x2 + beq _080B378C + cmp r0, 0x3 + beq _080B37B8 + b _080B37CC +_080B375A: + ldr r0, =gUnknown_08278091 + bl box_related_two__2 + movs r0, 0x1 + strh r0, [r5, 0x8] + b _080B37CC + .pool +_080B376C: + bl sub_809833C + lsls r0, 24 + cmp r0, 0 + beq _080B37CC + bl sub_8087288 + ldr r0, =0x020375e2 + ldrb r0, [r0] + bl sub_8009628 + movs r0, 0x2 + strh r0, [r5, 0x8] + b _080B37CC + .pool +_080B378C: + bl sub_8087214 + cmp r0, 0x1 + beq _080B379E + cmp r0, 0x1 + bcc _080B37CC + cmp r0, 0x2 + beq _080B37B2 + b _080B37CC +_080B379E: + bl textbox_close + movs r0, 0 + strh r0, [r5, 0x8] + bl sub_80872C4 + adds r0, r4, 0 + bl SwitchTaskToFollowupFunc + b _080B37CC +_080B37B2: + movs r0, 0x3 + strh r0, [r5, 0x8] + b _080B37CC +_080B37B8: + bl sub_808729C + movs r0, 0x1 + bl sub_8197AE8 + adds r0, r4, 0 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running +_080B37CC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B3728 + + thumb_func_start sub_80B37D4 +sub_80B37D4: @ 80B37D4 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =sub_80B3728 + adds r0, r4, 0 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + adds r2, r5, 0 + bl SetTaskFuncWithFollowupFunc + bl script_env_2_set_ctx_paused + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B37D4 + + thumb_func_start sub_80B37FC +sub_80B37FC: @ 80B37FC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080B3840 + cmp r0, 0x1 + bgt _080B3824 + cmp r0, 0 + beq _080B382E + b _080B3884 + .pool +_080B3824: + cmp r0, 0x2 + beq _080B3854 + cmp r0, 0x3 + beq _080B3870 + b _080B3884 +_080B382E: + bl script_env_2_enable + movs r0, 0x1 + movs r1, 0 + bl fade_screen + bl sub_8009FAC + b _080B3864 +_080B3840: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B3884 + b _080B3864 + .pool +_080B3854: + ldr r1, =0x02032298 + movs r0, 0 + strb r0, [r1] + strb r0, [r1, 0x1] + bl m4aMPlayAllStop + bl sub_800AC34 +_080B3864: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080B3884 + .pool +_080B3870: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _080B3884 + ldr r0, =sub_80773AC + bl SetMainCallback2 + adds r0, r5, 0 + bl DestroyTask +_080B3884: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B37FC + + thumb_func_start sub_80B3894 +sub_80B3894: @ 80B3894 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080B38D8 + cmp r0, 0x1 + bgt _080B38BC + cmp r0, 0 + beq _080B38C6 + b _080B391C + .pool +_080B38BC: + cmp r0, 0x2 + beq _080B38EC + cmp r0, 0x3 + beq _080B3908 + b _080B391C +_080B38C6: + bl script_env_2_enable + movs r0, 0x1 + movs r1, 0 + bl fade_screen + bl Rfu_set_zero + b _080B38FC +_080B38D8: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B391C + b _080B38FC + .pool +_080B38EC: + ldr r1, =0x02032298 + movs r0, 0 + strb r0, [r1] + strb r0, [r1, 0x1] + bl m4aMPlayAllStop + bl sub_800ADF8 +_080B38FC: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _080B391C + .pool +_080B3908: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080B391C + bl sub_8013F78 + adds r0, r5, 0 + bl DestroyTask +_080B391C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B3894 + + thumb_func_start sub_80B3924 +sub_80B3924: @ 80B3924 + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _080B3940 + ldr r0, =sub_80B3894 + bl sub_80B37D4 + b _080B3946 + .pool +_080B3940: + ldr r0, =sub_80B37FC + bl sub_80B37D4 +_080B3946: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B3924 + + thumb_func_start sub_80B3950 +sub_80B3950: @ 80B3950 + push {lr} + ldr r0, =sub_80B37FC + movs r1, 0x50 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B3950 + + thumb_func_start nullsub_37 +nullsub_37: @ 80B3964 + bx lr + thumb_func_end nullsub_37 + + thumb_func_start sub_80B3968 +sub_80B3968: @ 80B3968 + push {lr} + ldr r1, =0x020229c6 + ldr r2, =0x00002211 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _080B3994 + ldr r0, =sub_80B33BC + bl sub_80B37D4 + b _080B399A + .pool +_080B3994: + ldr r0, =sub_80B32B4 + bl sub_80B37D4 +_080B399A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B3968 + + thumb_func_start sub_80B39A4 +sub_80B39A4: @ 80B39A4 + push {lr} + ldr r0, =sub_80B3728 + movs r1, 0x50 + bl CreateTask + bl script_env_2_set_ctx_paused + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B39A4 + + thumb_func_start sp02A_crash_sound +sp02A_crash_sound: @ 80B39BC + push {lr} + ldr r0, =0x020375e4 + ldrb r0, [r0] + ldr r1, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl sub_80C4E74 + pop {r0} + bx r0 + .pool + thumb_func_end sp02A_crash_sound + + thumb_func_start sub_80B39D4 +sub_80B39D4: @ 80B39D4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x020375e4 + strh r4, [r0] + ldr r0, =0x02021cc4 + lsls r1, r4, 3 + subs r1, r4 + lsls r1, 2 + ldr r2, =0x020229f0 + adds r1, r2 + bl CopyString + adds r0, r4, 0 + bl sub_80C4904 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _080B3A28 + ldr r0, =0x02021dc4 + ldr r2, =gUnknown_0855059C + subs r1, 0x1 + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl CopyString + movs r0, 0x1 + b _080B3A2A + .pool +_080B3A28: + movs r0, 0 +_080B3A2A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B39D4 + + thumb_func_start task00_08081A90 +task00_08081A90: @ 80B3A30 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r0, r1 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + lsls r1, 16 + movs r0, 0x96 + lsls r0, 17 + cmp r1, r0 + ble _080B3A62 + bl sub_80097E8 + ldr r0, =c2_800ACD4 + bl SetMainCallback2 + adds r0, r4, 0 + bl DestroyTask +_080B3A62: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _080B3AA6 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _080B3AA0 + bl sub_800AA60 + lsls r0, 24 + cmp r0, 0 + bne _080B3A86 + bl sub_80097E8 + ldr r0, =c2_800ACD4 + bl SetMainCallback2 +_080B3A86: + adds r0, r4, 0 + bl DestroyTask + b _080B3AA6 + .pool +_080B3AA0: + adds r0, r5, 0 + bl DestroyTask +_080B3AA6: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task00_08081A90 + + thumb_func_start sub_80B3AAC +sub_80B3AAC: @ 80B3AAC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _080B3AC4 + bl script_env_2_enable_and_set_ctx_running + adds r0, r4, 0 + bl DestroyTask +_080B3AC4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B3AAC + + thumb_func_start sub_80B3AD0 +sub_80B3AD0: @ 80B3AD0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_800AC34 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80B3AAC + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B3AD0 + + thumb_func_start sub_80B3AF8 +sub_80B3AF8: @ 80B3AF8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _080B3B54 + cmp r0, 0x1 + bgt _080B3B20 + cmp r0, 0 + beq _080B3B2A + b _080B3BB8 + .pool +_080B3B20: + cmp r0, 0x2 + beq _080B3B68 + cmp r0, 0x3 + beq _080B3B9E + b _080B3BB8 +_080B3B2A: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _080B3B40 + adds r0, r4, 0 + bl DestroyTask + b _080B3BB8 + .pool +_080B3B40: + bl sub_8009734 + ldr r0, =task00_08081A90 + movs r1, 0x1 + bl CreateTask + b _080B3B96 + .pool +_080B3B54: + ldrh r0, [r5, 0x2] + adds r0, 0x1 + strh r0, [r5, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + ble _080B3BB8 + movs r0, 0 + strh r0, [r5, 0x2] + b _080B3B96 +_080B3B68: + bl sub_800ABAC + adds r4, r0, 0 + bl sub_800AA48 + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bcc _080B3BB8 + bl sub_800ABBC + lsls r0, 24 + cmp r0, 0 + beq _080B3B96 + ldrh r0, [r5, 0x2] + adds r0, 0x1 + strh r0, [r5, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1E + ble _080B3BB8 + bl sub_800A620 +_080B3B96: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + b _080B3BB8 +_080B3B9E: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080B3BB8 + bl sub_800A23C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B3BB8 + adds r0, r4, 0 + bl DestroyTask +_080B3BB8: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B3AF8 + + thumb_func_start sub_80B3BC4 +sub_80B3BC4: @ 80B3BC4 + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _080B3BD6 + ldr r1, =0x020229c6 + ldr r2, =0x00002288 + adds r0, r2, 0 + strh r0, [r1] +_080B3BD6: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B3BC4 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/calculate_base_damage.s b/asm/calculate_base_damage.s new file mode 100644 index 000000000..d82db8d09 --- /dev/null +++ b/asm/calculate_base_damage.s @@ -0,0 +1,1045 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_806957C +sub_806957C: @ 806957C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + adds r6, r0, 0 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + ldr r0, [sp, 0x50] + ldr r1, [sp, 0x54] + ldr r2, [sp, 0x58] + ldr r4, [sp, 0x5C] + lsls r3, 16 + lsrs r3, 16 + str r3, [sp, 0xC] + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x10] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x14] + movs r5, 0 + cmp r3, 0 + bne _080695D4 + ldr r2, =0x020244e0 + ldr r1, =gBattleMoves + ldr r3, [sp, 0x8] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x1] + strh r0, [r2] + b _080695D8 + .pool +_080695D4: + ldr r0, =0x020244e0 + strh r3, [r0] +_080695D8: + cmp r7, 0 + bne _080695F8 + ldr r1, =gBattleMoves + ldr r7, [sp, 0x8] + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x2] + mov r10, r0 + b _08069602 + .pool +_080695F8: + movs r0, 0x3F + mov r10, r0 + mov r1, r10 + ands r1, r7 + mov r10, r1 +_08069602: + ldrh r7, [r6, 0x2] + ldr r2, [sp, 0x4] + ldrh r2, [r2, 0x4] + str r2, [sp, 0x18] + ldrh r3, [r6, 0x8] + mov r8, r3 + ldr r0, [sp, 0x4] + ldrh r0, [r0, 0xA] + str r0, [sp, 0x1C] + ldrh r0, [r6, 0x2E] + cmp r0, 0xAF + bne _08069634 + ldr r1, =0x02024404 + ldr r2, [sp, 0x10] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r3, [r0, 0x7] + mov r9, r3 + ldrb r0, [r0, 0x1A] + b _0806964A + .pool +_08069634: + ldrh r0, [r6, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldrh r0, [r6, 0x2E] + bl itemid_get_quality + lsls r0, 24 + lsrs r0, 24 +_0806964A: + str r0, [sp, 0x24] + ldr r1, [sp, 0x4] + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _0806967E + ldr r1, =0x02024404 + ldr r2, [sp, 0x14] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x7] + str r0, [sp, 0x20] + b _08069694 + .pool +_0806966C: + ldr r0, [sp, 0x24] + adds r0, 0x64 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r7, r0, 16 + b _0806977C +_0806967E: + ldr r3, [sp, 0x4] + ldrh r0, [r3, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x20] + ldr r1, [sp, 0x4] + ldrh r0, [r1, 0x2E] + bl itemid_get_quality +_08069694: + adds r0, r6, 0 + adds r0, 0x20 + ldrb r1, [r0] + str r0, [sp, 0x28] + cmp r1, 0x25 + beq _080696A4 + cmp r1, 0x4A + bne _080696A8 +_080696A4: + lsls r0, r7, 17 + lsrs r7, r0, 16 +_080696A8: + ldr r0, =0x00000867 + ldr r1, [sp, 0x10] + bl sub_8069ED8 + lsls r0, 24 + cmp r0, 0 + beq _080696C4 + movs r0, 0x6E + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r7, r0, 16 +_080696C4: + ldr r0, =0x0000086b + ldr r1, [sp, 0x14] + bl sub_8069ED8 + lsls r0, 24 + cmp r0, 0 + beq _080696E4 + movs r0, 0x6E + ldr r2, [sp, 0x18] + muls r0, r2 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x18] +_080696E4: + ldr r4, =0x0000086d + adds r0, r4, 0 + ldr r1, [sp, 0x10] + bl sub_8069ED8 + lsls r0, 24 + cmp r0, 0 + beq _08069708 + movs r0, 0x6E + mov r3, r8 + muls r3, r0 + adds r0, r3, 0 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 +_08069708: + adds r0, r4, 0 + ldr r1, [sp, 0x14] + bl sub_8069ED8 + lsls r0, 24 + cmp r0, 0 + beq _08069728 + movs r0, 0x6E + ldr r1, [sp, 0x1C] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x1C] +_08069728: + movs r2, 0 + ldr r4, =gUnknown_08329D74 + ldr r3, [sp, 0x4] + adds r3, 0x20 + str r3, [sp, 0x2C] + adds r3, r4, 0 +_08069734: + lsls r1, r2, 1 + ldrb r0, [r3] + cmp r9, r0 + bne _08069774 + adds r0, r4, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + cmp r10, r0 + bne _08069774 + mov r1, r10 + cmp r1, 0x8 + bls _0806966C + ldr r0, [sp, 0x24] + adds r0, 0x64 + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + b _0806977C + .pool +_08069774: + adds r3, 0x2 + adds r2, 0x1 + cmp r2, 0x10 + bls _08069734 +_0806977C: + mov r3, r9 + cmp r3, 0x1D + bne _08069790 + movs r0, 0x96 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r7, r0, 16 +_08069790: + mov r0, r9 + cmp r0, 0x22 + bne _080697C6 + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x003f0100 + ands r0, r1 + cmp r0, 0 + bne _080697C6 + ldr r1, =0xfffffe69 + adds r0, r1, 0 + ldrh r2, [r6] + adds r0, r2 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _080697C6 + movs r0, 0x96 + mov r3, r8 + muls r3, r0 + adds r0, r3, 0 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 +_080697C6: + ldr r0, [sp, 0x20] + cmp r0, 0x22 + bne _080697FC + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x003f0100 + ands r0, r1 + cmp r0, 0 + bne _080697FC + ldr r1, =0xfffffe69 + adds r0, r1, 0 + ldr r2, [sp, 0x4] + ldrh r2, [r2] + adds r0, r2 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _080697FC + movs r0, 0x96 + ldr r3, [sp, 0x1C] + muls r0, r3 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x1C] +_080697FC: + mov r0, r9 + cmp r0, 0x23 + bne _08069812 + ldrh r1, [r6] + ldr r0, =0x00000175 + cmp r1, r0 + bne _08069812 + mov r1, r8 + lsls r0, r1, 17 + lsrs r0, 16 + mov r8, r0 +_08069812: + ldr r2, [sp, 0x20] + cmp r2, 0x24 + bne _0806982A + ldr r3, [sp, 0x4] + ldrh r1, [r3] + ldr r0, =0x00000175 + cmp r1, r0 + bne _0806982A + ldr r1, [sp, 0x1C] + lsls r0, r1, 17 + lsrs r0, 16 + str r0, [sp, 0x1C] +_0806982A: + mov r2, r9 + cmp r2, 0x2D + bne _0806983E + ldrh r0, [r6] + cmp r0, 0x19 + bne _0806983E + mov r3, r8 + lsls r0, r3, 17 + lsrs r0, 16 + mov r8, r0 +_0806983E: + ldr r0, [sp, 0x20] + cmp r0, 0x40 + bne _08069854 + ldr r1, [sp, 0x4] + ldrh r0, [r1] + cmp r0, 0x84 + bne _08069854 + ldr r2, [sp, 0x18] + lsls r0, r2, 17 + lsrs r0, 16 + str r0, [sp, 0x18] +_08069854: + mov r3, r9 + cmp r3, 0x41 + bne _0806986A + ldrh r0, [r6] + subs r0, 0x68 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _0806986A + lsls r0, r7, 17 + lsrs r7, r0, 16 +_0806986A: + ldr r1, [sp, 0x2C] + ldrb r0, [r1] + cmp r0, 0x2F + bne _08069882 + mov r2, r10 + cmp r2, 0xA + beq _0806987C + cmp r2, 0xF + bne _08069882 +_0806987C: + mov r3, r8 + lsrs r3, 1 + mov r8, r3 +_08069882: + ldr r0, [sp, 0x28] + ldrb r4, [r0] + cmp r4, 0x37 + bne _08069898 + movs r0, 0x96 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r7, r0, 16 +_08069898: + cmp r4, 0x39 + bne _080698C6 + movs r0, 0 + str r0, [sp] + movs r0, 0xE + movs r1, 0 + movs r2, 0x3A + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _080698C6 + movs r0, 0x96 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 +_080698C6: + ldr r2, [sp, 0x28] + ldrb r0, [r2] + cmp r0, 0x3A + bne _080698F8 + movs r0, 0 + str r0, [sp] + movs r0, 0xE + movs r1, 0 + movs r2, 0x39 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _080698F8 + movs r0, 0x96 + mov r3, r8 + muls r3, r0 + adds r0, r3, 0 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 +_080698F8: + ldr r1, [sp, 0x28] + ldrb r0, [r1] + cmp r0, 0x3E + bne _08069914 + ldr r0, [r6, 0x4C] + cmp r0, 0 + beq _08069914 + movs r0, 0x96 + muls r0, r7 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r7, r0, 16 +_08069914: + ldr r2, [sp, 0x2C] + ldrb r0, [r2] + cmp r0, 0x3F + bne _08069936 + ldr r3, [sp, 0x4] + ldr r0, [r3, 0x4C] + cmp r0, 0 + beq _08069936 + movs r0, 0x96 + ldr r1, [sp, 0x18] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x18] +_08069936: + mov r2, r10 + cmp r2, 0xD + bne _0806995A + movs r0, 0 + str r0, [sp] + movs r0, 0xE + movs r1, 0 + movs r2, 0 + movs r3, 0xFD + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _0806995A + ldr r1, =0x020244e0 + ldrh r0, [r1] + lsrs r0, 1 + strh r0, [r1] +_0806995A: + mov r3, r10 + cmp r3, 0xA + bne _0806997E + movs r0, 0 + str r0, [sp] + movs r0, 0xE + movs r1, 0 + movs r2, 0 + movs r3, 0xFE + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _0806997E + ldr r1, =0x020244e0 + ldrh r0, [r1] + lsrs r0, 1 + strh r0, [r1] +_0806997E: + mov r0, r10 + cmp r0, 0xC + bne _080699AE + ldr r1, [sp, 0x28] + ldrb r0, [r1] + cmp r0, 0x41 + bne _080699AE + ldrh r0, [r6, 0x2C] + movs r1, 0x3 + bl __udivsi3 + ldrh r1, [r6, 0x28] + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + bhi _080699AE + ldr r4, =0x020244e0 + ldrh r1, [r4] + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + strh r0, [r4] +_080699AE: + mov r2, r10 + cmp r2, 0xA + bne _080699DE + ldr r3, [sp, 0x28] + ldrb r0, [r3] + cmp r0, 0x42 + bne _080699DE + ldrh r0, [r6, 0x2C] + movs r1, 0x3 + bl __udivsi3 + ldrh r1, [r6, 0x28] + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + bhi _080699DE + ldr r4, =0x020244e0 + ldrh r1, [r4] + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + strh r0, [r4] +_080699DE: + mov r0, r10 + cmp r0, 0xB + bne _08069A0E + ldr r1, [sp, 0x28] + ldrb r0, [r1] + cmp r0, 0x43 + bne _08069A0E + ldrh r0, [r6, 0x2C] + movs r1, 0x3 + bl __udivsi3 + ldrh r1, [r6, 0x28] + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + bhi _08069A0E + ldr r4, =0x020244e0 + ldrh r1, [r4] + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + strh r0, [r4] +_08069A0E: + mov r2, r10 + cmp r2, 0x6 + bne _08069A3E + ldr r3, [sp, 0x28] + ldrb r0, [r3] + cmp r0, 0x44 + bne _08069A3E + ldrh r0, [r6, 0x2C] + movs r1, 0x3 + bl __udivsi3 + ldrh r1, [r6, 0x28] + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + bhi _08069A3E + ldr r4, =0x020244e0 + ldrh r1, [r4] + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + strh r0, [r4] +_08069A3E: + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x7 + bne _08069A58 + ldr r0, [sp, 0x18] + lsrs r0, 1 + str r0, [sp, 0x18] +_08069A58: + mov r1, r10 + cmp r1, 0x8 + bls _08069A60 + b _08069BC2 +_08069A60: + ldr r0, =0x02024211 + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0x2 + bne _08069AA0 + movs r0, 0x19 + ldrsb r0, [r6, r0] + cmp r0, 0x6 + ble _08069A9C + ldr r2, =gUnknown_08329D2E + b _08069AA6 + .pool +_08069A9C: + adds r5, r7, 0 + b _08069ABE +_08069AA0: + ldr r2, =gUnknown_08329D2E + movs r0, 0x19 + ldrsb r0, [r6, r0] +_08069AA6: + lsls r0, 1 + adds r1, r0, r2 + ldrb r1, [r1] + adds r5, r7, 0 + muls r5, r1 + adds r2, 0x1 + adds r0, r2 + ldrb r1, [r0] + adds r0, r5, 0 + bl __divsi3 + adds r5, r0, 0 +_08069ABE: + ldr r0, =0x020244e0 + ldrh r0, [r0] + muls r5, r0 + adds r0, r6, 0 + adds r0, 0x2A + ldrb r0, [r0] + lsls r0, 1 + movs r1, 0x5 + bl __divsi3 + adds r0, 0x2 + muls r5, r0 + ldrb r0, [r4] + cmp r0, 0x2 + bne _08069AFC + ldr r2, [sp, 0x4] + movs r0, 0x1A + ldrsb r0, [r2, r0] + cmp r0, 0x5 + bgt _08069AF8 + ldr r2, =gUnknown_08329D2E + ldr r3, [sp, 0x4] + movs r0, 0x1A + ldrsb r0, [r3, r0] + b _08069B04 + .pool +_08069AF8: + ldr r3, [sp, 0x18] + b _08069B1E +_08069AFC: + ldr r2, =gUnknown_08329D2E + ldr r1, [sp, 0x4] + movs r0, 0x1A + ldrsb r0, [r1, r0] +_08069B04: + lsls r0, 1 + adds r1, r0, r2 + ldrb r1, [r1] + ldr r7, [sp, 0x18] + adds r3, r7, 0 + muls r3, r1 + adds r2, 0x1 + adds r0, r2 + ldrb r1, [r0] + adds r0, r3, 0 + bl __divsi3 + adds r3, r0, 0 +_08069B1E: + adds r0, r5, 0 + adds r1, r3, 0 + bl __divsi3 + adds r5, r0, 0 + movs r1, 0x32 + bl __divsi3 + adds r5, r0, 0 + ldr r0, [r6, 0x4C] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08069B48 + ldr r1, [sp, 0x28] + ldrb r0, [r1] + cmp r0, 0x3E + beq _08069B48 + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r5, r0, 1 +_08069B48: + movs r0, 0x1 + ldr r2, [sp, 0xC] + ands r0, r2 + cmp r0, 0 + beq _08069B8A + ldrb r1, [r4] + cmp r1, 0x1 + bne _08069B8A + ldr r0, =0x02022fec + ldr r0, [r0] + ands r0, r1 + cmp r0, 0 + beq _08069B84 + movs r0, 0x2 + bl sub_8069DEC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08069B84 + adds r0, r5, 0 + movs r1, 0x3 + bl __divsi3 + lsls r5, r0, 1 + b _08069B8A + .pool +_08069B84: + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r5, r0, 1 +_08069B8A: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08069BBC + ldr r0, =gBattleMoves + ldr r3, [sp, 0x8] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x6] + cmp r0, 0x8 + bne _08069BBC + movs r0, 0x2 + bl sub_8069DEC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08069BBC + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r5, r0, 1 +_08069BBC: + cmp r5, 0 + bne _08069BC2 + movs r5, 0x1 +_08069BC2: + mov r7, r10 + cmp r7, 0x9 + bne _08069BCA + movs r5, 0 +_08069BCA: + mov r0, r10 + cmp r0, 0x9 + bhi _08069BD2 + b _08069DD4 +_08069BD2: + ldr r0, =0x02024211 + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0x2 + bne _08069BFC + movs r0, 0x1C + ldrsb r0, [r6, r0] + cmp r0, 0x6 + ble _08069BF8 + ldr r2, =gUnknown_08329D2E + b _08069C02 + .pool +_08069BF8: + mov r5, r8 + b _08069C1A +_08069BFC: + ldr r2, =gUnknown_08329D2E + movs r0, 0x1C + ldrsb r0, [r6, r0] +_08069C02: + lsls r0, 1 + adds r1, r0, r2 + ldrb r1, [r1] + mov r5, r8 + muls r5, r1 + adds r2, 0x1 + adds r0, r2 + ldrb r1, [r0] + adds r0, r5, 0 + bl __divsi3 + adds r5, r0, 0 +_08069C1A: + ldr r0, =0x020244e0 + ldrh r0, [r0] + muls r5, r0 + adds r0, r6, 0 + adds r0, 0x2A + ldrb r0, [r0] + lsls r0, 1 + movs r1, 0x5 + bl __divsi3 + adds r0, 0x2 + muls r5, r0 + ldrb r0, [r4] + cmp r0, 0x2 + bne _08069C54 + ldr r1, [sp, 0x4] + movs r0, 0x1D + ldrsb r0, [r1, r0] + cmp r0, 0x5 + bgt _08069C50 + ldr r2, =gUnknown_08329D2E + b _08069C5C + .pool +_08069C50: + ldr r3, [sp, 0x1C] + b _08069C76 +_08069C54: + ldr r2, =gUnknown_08329D2E + ldr r7, [sp, 0x4] + movs r0, 0x1D + ldrsb r0, [r7, r0] +_08069C5C: + lsls r0, 1 + adds r1, r0, r2 + ldrb r1, [r1] + ldr r6, [sp, 0x1C] + adds r3, r6, 0 + muls r3, r1 + adds r2, 0x1 + adds r0, r2 + ldrb r1, [r0] + adds r0, r3, 0 + bl __divsi3 + adds r3, r0, 0 +_08069C76: + adds r0, r5, 0 + adds r1, r3, 0 + bl __divsi3 + adds r5, r0, 0 + movs r1, 0x32 + bl __divsi3 + adds r5, r0, 0 + movs r0, 0x2 + ldr r7, [sp, 0xC] + ands r0, r7 + cmp r0, 0 + beq _08069CCA + ldrb r1, [r4] + cmp r1, 0x1 + bne _08069CCA + ldr r0, =0x02022fec + ldr r0, [r0] + ands r0, r1 + cmp r0, 0 + beq _08069CC4 + movs r0, 0x2 + bl sub_8069DEC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08069CC4 + adds r0, r5, 0 + movs r1, 0x3 + bl __divsi3 + lsls r5, r0, 1 + b _08069CCA + .pool +_08069CC4: + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r5, r0, 1 +_08069CCA: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08069CFC + ldr r0, =gBattleMoves + ldr r2, [sp, 0x8] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x6] + cmp r0, 0x8 + bne _08069CFC + movs r0, 0x2 + bl sub_8069DEC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08069CFC + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r5, r0, 1 +_08069CFC: + movs r0, 0 + str r0, [sp] + movs r0, 0xE + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08069DAC + str r0, [sp] + movs r0, 0xE + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _08069DAC + ldr r2, =0x020243cc + ldrh r1, [r2] + movs r0, 0x1 + ands r0, r1 + adds r4, r2, 0 + cmp r0, 0 + beq _08069D64 + mov r3, r10 + cmp r3, 0xA + beq _08069D50 + cmp r3, 0xB + beq _08069D58 + b _08069D64 + .pool +_08069D50: + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r5, r0, 1 + b _08069D64 +_08069D58: + lsls r0, r5, 4 + subs r0, r5 + movs r1, 0xA + bl __divsi3 + adds r5, r0, 0 +_08069D64: + ldrh r1, [r4] + movs r0, 0x9F + ands r0, r1 + cmp r0, 0 + beq _08069D7C + ldr r0, =0x020241ea + ldrh r0, [r0] + cmp r0, 0x4C + bne _08069D7C + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r5, r0, 1 +_08069D7C: + ldrh r1, [r4] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _08069DAC + mov r6, r10 + cmp r6, 0xA + beq _08069D98 + cmp r6, 0xB + beq _08069DA6 + b _08069DAC + .pool +_08069D98: + lsls r0, r5, 4 + subs r0, r5 + movs r1, 0xA + bl __divsi3 + adds r5, r0, 0 + b _08069DAC +_08069DA6: + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r5, r0, 1 +_08069DAC: + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x4] + ldr r7, [sp, 0x10] + lsls r1, r7, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08069DD4 + mov r0, r10 + cmp r0, 0xA + bne _08069DD4 + lsls r0, r5, 4 + subs r0, r5 + movs r1, 0xA + bl __divsi3 + adds r5, r0, 0 +_08069DD4: + adds r0, r5, 0x2 + 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 sub_806957C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/clear_save_data_screen.s b/asm/clear_save_data_screen.s new file mode 100644 index 000000000..d9b9ad867 --- /dev/null +++ b/asm/clear_save_data_screen.s @@ -0,0 +1,399 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start c2_clear_save_data_screen_2 +c2_clear_save_data_screen_2: @ 817ACC8 + push {lr} + bl sub_817AE00 + lsls r0, 24 + cmp r0, 0 + beq _0817ACDC + ldr r0, =sub_817ACE4 + movs r1, 0 + bl CreateTask +_0817ACDC: + pop {r0} + bx r0 + .pool + thumb_func_end c2_clear_save_data_screen_2 + + thumb_func_start sub_817ACE4 +sub_817ACE4: @ 817ACE4 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0 + movs r2, 0x2 + movs r3, 0xE + bl SetWindowBorderStyle + ldr r2, =gUnknown_085EFA8F + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r0, =gUnknown_085F06D8 + movs r1, 0x2 + movs r2, 0xE + movs r3, 0x1 + bl CreateYesNoMenu + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_817AD40 + str r1, [r0] + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817ACE4 + + thumb_func_start sub_817AD40 +sub_817AD40: @ 817AD40 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r4, r0, 24 + cmp r4, 0 + beq _0817AD68 + cmp r4, 0 + bgt _0817AD62 + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + beq _0817ADA0 + b _0817ADB2 +_0817AD62: + cmp r4, 0x1 + beq _0817ADA0 + b _0817ADB2 +_0817AD68: + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_085EFAAA + movs r0, 0x1 + str r0, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_817ADC0 + str r1, [r0] + b _0817ADB2 + .pool +_0817ADA0: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl DestroyTask + ldr r0, =sub_817AFD4 + bl SetMainCallback2 +_0817ADB2: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817AD40 + + thumb_func_start sub_817ADC0 +sub_817ADC0: @ 817ADC0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl calls_flash_erase_block + adds r0, r4, 0 + bl DestroyTask + ldr r0, =sub_817AFD4 + bl SetMainCallback2 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817ADC0 + + thumb_func_start sub_817ADE4 +sub_817ADE4: @ 817ADE4 + push {lr} + bl RunTasks + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_817ADE4 + + thumb_func_start sub_817ADF4 +sub_817ADF4: @ 817ADF4 + push {lr} + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_817ADF4 + + thumb_func_start sub_817AE00 +sub_817AE00: @ 817AE00 + push {r4,lr} + sub sp, 0xC + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0817AE18 + cmp r0, 0x1 + bne _0817AE18 + b _0817AFA4 +_0817AE18: + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0x10 + movs r1, 0 + bl SetGpuReg + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1C + movs r1, 0 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0 + bl SetGpuReg + movs r0, 0x40 + movs r1, 0 + bl SetGpuReg + movs r0, 0x44 + movs r1, 0 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + add r0, sp, 0x4 + movs r4, 0 + strh r4, [r0] + ldr r1, =0x040000d4 + str r0, [r1] + movs r0, 0xC0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, =0x8100c000 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r2, 0 + str r2, [sp, 0x8] + add r0, sp, 0x8 + str r0, [r1] + movs r0, 0xE0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, =0x85000100 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + add r0, sp, 0x4 + strh r2, [r0] + str r0, [r1] + ldr r0, =0x05000002 + str r0, [r1, 0x4] + ldr r0, =0x810001ff + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + bl sub_80A1A74 + ldr r2, =0x02037714 + ldr r0, =0x00007fff + strh r0, [r2] + ldr r1, =0x02037b14 + strh r0, [r1] + ldr r0, =0x00003945 + strh r0, [r2, 0x2] + strh r0, [r1, 0x2] + movs r1, 0 + ldr r3, =0x06000020 + ldr r0, =0x00001111 + adds r2, r0, 0 +_0817AED4: + lsls r0, r1, 1 + adds r0, r3 + strh r2, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0xF + bls _0817AED4 + movs r1, 0 + ldr r4, =0x0600f000 + movs r3, 0x1 + ldr r2, =0x000003ff +_0817AEEC: + lsls r0, r1, 1 + adds r0, r4 + strh r3, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r2 + bls _0817AEEC + bl ResetTasks + bl ResetAllObjectData + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085F06C0 + movs r0, 0 + movs r2, 0x2 + bl InitBgsFromTemplates + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x3 + bl ShowBg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + bl sub_817B02C + ldr r0, =0x0000ffff + str r0, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r0, 0x1 + bl EnableInterrupts + ldr r0, =sub_817ADF4 + bl SetVBlankCallback + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + b _0817AFC8 + .pool +_0817AFA4: + bl fade_and_return_progress_probably + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0817AFC8 + ldr r0, =sub_817ADE4 + bl SetMainCallback2 + movs r0, 0x1 + b _0817AFCA + .pool +_0817AFC8: + movs r0, 0 +_0817AFCA: + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_817AE00 + + thumb_func_start sub_817AFD4 +sub_817AFD4: @ 817AFD4 + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0 + beq _0817AFEA + cmp r0, 0x1 + beq _0817B008 +_0817AFEA: + ldr r0, =0x0000ffff + str r0, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + movs r0, 0x1 + strb r0, [r4] + b _0817B020 + .pool +_0817B008: + bl fade_and_return_progress_probably + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0817B020 + bl FreeAllWindowBuffers + bl Reset +_0817B020: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817AFD4 + + thumb_func_start sub_817B02C +sub_817B02C: @ 817B02C + push {lr} + ldr r0, =gUnknown_085F06C8 + bl InitWindows + bl DeactivateAllTextPrinters + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0 + movs r1, 0 + movs r2, 0x2 + movs r3, 0xE0 + bl sub_80987D4 + ldr r0, =gUnknown_0860F074 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r0} + bx r0 + .pool + thumb_func_end sub_817B02C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/coins.s b/asm/coins.s new file mode 100644 index 000000000..9e8038c42 --- /dev/null +++ b/asm/coins.s @@ -0,0 +1,214 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start PrintCoinsString +@ void PrintCoinsString(s32 coinAmount) +PrintCoinsString: @ 8145B54 + push {r4,lr} + sub sp, 0xC + adds r1, r0, 0 + ldr r0, =0x02021cc4 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E8DAB + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x40 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + ldr r0, =0x0203ab9c + ldrb r0, [r0] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x1 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + bl Print + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end PrintCoinsString + + thumb_func_start ShowCoinsWindow +@ void ShowCoinsWindow(s32 coinAmount, u8 x, u8 y) +ShowCoinsWindow: @ 8145BAC + push {r4,r5,lr} + sub sp, 0x18 + adds r5, r0, 0 + adds r4, r1, 0 + adds r3, r2, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x8 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + ldr r0, =0x00000141 + str r0, [sp, 0xC] + add r0, sp, 0x10 + movs r1, 0 + adds r2, r4, 0 + bl rbox_template_set + ldr r4, =0x0203ab9c + add r0, sp, 0x10 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl FillWindowPixelBuffer + ldrb r0, [r4] + bl PutWindowTilemap + ldrb r0, [r4] + movs r2, 0x85 + lsls r2, 2 + movs r1, 0 + movs r3, 0xE + bl SetWindowBorderStyle + adds r0, r5, 0 + bl PrintCoinsString + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ShowCoinsWindow + + thumb_func_start HideCoinsWindow +@ void HideCoinsWindow() +HideCoinsWindow: @ 8145C14 + push {r4,lr} + ldr r4, =0x0203ab9c + ldrb r0, [r4] + movs r1, 0x1 + bl sub_819746C + ldrb r0, [r4] + bl RemoveWindow + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end HideCoinsWindow + + thumb_func_start GetCoins +@ u16 GetCoins() +GetCoins: @ 8145C30 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x00000494 + adds r1, r0 + ldr r0, =0x03005d90 + ldr r0, [r0] + adds r0, 0xAC + ldr r0, [r0] + ldrh r1, [r1] + eors r0, r1 + lsls r0, 16 + lsrs r0, 16 + bx lr + .pool + thumb_func_end GetCoins + + thumb_func_start SetCoins +@ void SetCoins(u16 amount) +SetCoins: @ 8145C58 + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x03005d8c + ldr r2, [r1] + ldr r1, =0x03005d90 + ldr r1, [r1] + adds r1, 0xAC + ldr r1, [r1] + eors r0, r1 + ldr r1, =0x00000494 + adds r2, r1 + strh r0, [r2] + bx lr + .pool + thumb_func_end SetCoins + + thumb_func_start AddCoins +@ bool8 AddCoins(u16 amount) +AddCoins: @ 8145C80 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + bl GetCoins + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =0x0000270e + cmp r1, r0 + bls _08145C9C + movs r0, 0 + b _08145CC0 + .pool +_08145C9C: + adds r0, r1, r4 + cmp r1, r0 + ble _08145CAC + ldr r0, =0x0000270f + b _08145CBA + .pool +_08145CAC: + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =0x0000270f + cmp r1, r0 + bls _08145CB8 + adds r1, r0, 0 +_08145CB8: + adds r0, r1, 0 +_08145CBA: + bl SetCoins + movs r0, 0x1 +_08145CC0: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end AddCoins + + thumb_func_start SubtractCoins +@ bool8 SubtractCoins(u16 amount) +SubtractCoins: @ 8145CCC + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + bl GetCoins + lsls r0, 16 + lsrs r0, 16 + cmp r0, r4 + bcs _08145CE2 + movs r0, 0 + b _08145CEE +_08145CE2: + subs r0, r4 + lsls r0, 16 + lsrs r0, 16 + bl SetCoins + movs r0, 0x1 +_08145CEE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end SubtractCoins + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/contest.s b/asm/contest.s new file mode 100644 index 000000000..8b3d98314 --- /dev/null +++ b/asm/contest.s @@ -0,0 +1,15872 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start TaskDummy1 +TaskDummy1: @ 80D7668 + bx lr + thumb_func_end TaskDummy1 + + thumb_func_start sub_80D766C +sub_80D766C: @ 80D766C + ldr r1, =0x02039f2a + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_80D766C + + thumb_func_start sub_80D7678 +sub_80D7678: @ 80D7678 + push {r4,lr} + movs r0, 0 + movs r1, 0x40 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + ldr r4, =0x00003f3f + movs r0, 0x48 + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x4A + adds r1, r4, 0 + bl SetGpuReg + movs r1, 0xFE + lsls r1, 7 + movs r0, 0 + bl SetGpuRegBits + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r0, =0x02022e18 + strh r1, [r0] + ldr r0, =0x02022e1a + strh r1, [r0] + ldr r0, =0x02022e1c + strh r1, [r0] + ldr r0, =0x02022e1e + strh r1, [r0] + ldr r0, =0x02022e20 + strh r1, [r0] + ldr r0, =0x02022e22 + strh r1, [r0] + ldr r0, =0x02022e24 + strh r1, [r0] + ldr r0, =0x02022e26 + strh r1, [r0] + ldr r0, =0x02022e28 + strh r1, [r0] + ldr r0, =0x02022e2a + strh r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D7678 + + thumb_func_start sub_80D7724 +sub_80D7724: @ 80D7724 + push {r4,r5,lr} + ldr r0, =gUnknown_08C17AB0 + movs r1, 0xC0 + lsls r1, 19 + bl LZDecompressVram + ldr r0, =gUnknown_08C1850C + ldr r1, =0x06002000 + bl LZDecompressVram + ldr r1, =gUnknown_08C16FA8 + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + ldr r0, =gUnknown_08C16E90 + movs r2, 0x80 + lsls r2, 2 + movs r1, 0 + bl decompress_palette + bl sub_80D782C + movs r4, 0 + movs r5, 0xA0 +_080D775E: + ldr r0, =0x0201a004 + adds r0, r5, r0 + ldr r1, =0x02039f26 + adds r1, r4, r1 + ldrb r1, [r1] + adds r1, 0x5 + lsls r1, 4 + movs r2, 0x20 + bl gpu_pal_apply + adds r5, 0x20 + adds r4, 0x1 + cmp r4, 0x3 + ble _080D775E + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D7724 + + thumb_func_start sub_80D779C +sub_80D779C: @ 80D779C + push {r4,lr} + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_08587F34 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + movs r0, 0x3 + movs r1, 0x6 + movs r2, 0x1 + bl SetBgAttribute + movs r4, 0 +_080D77BA: + lsls r0, r4, 24 + lsrs r0, 24 + ldr r1, =0x02039f34 + ldr r1, [r1] + lsls r2, r4, 2 + adds r1, 0x24 + adds r1, r2 + ldr r1, [r1] + bl SetBgTilemapBuffer + adds r4, 0x1 + cmp r4, 0x3 + ble _080D77BA + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D779C + + thumb_func_start sub_80D77E4 +sub_80D77E4: @ 80D77E4 + push {lr} + ldr r0, =gUnknown_08587F44 + bl InitWindows + bl DeactivateAllTextPrinters + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080D7818 + ldr r2, =0x03003014 + ldrb r1, [r2] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + b _080D7822 + .pool +_080D7818: + ldr r0, =0x03003014 + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] +_080D7822: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D77E4 + + thumb_func_start sub_80D782C +sub_80D782C: @ 80D782C + push {r4,r5,lr} + ldr r0, =gUnknown_08587C30 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0 + movs r1, 0 + movs r2, 0x2 + bl rboxid_80040B8 + movs r5, 0xA + movs r4, 0xFA + lsls r4, 16 +_080D7848: + lsrs r1, r4, 16 + ldr r0, =0x020378f6 + movs r2, 0x2 + bl gpu_pal_apply + movs r0, 0x80 + lsls r0, 9 + adds r4, r0 + adds r5, 0x1 + cmp r5, 0xD + ble _080D7848 + ldr r0, =0x00007e3f + movs r1, 0xF3 + movs r2, 0x2 + bl rboxid_80040B8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D782C + + thumb_func_start sub_80D787C +sub_80D787C: @ 80D787C + push {r4-r7,lr} + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r0, [r0] + movs r1, 0 + movs r2, 0x5C + bl memset + movs r5, 0 + movs r2, 0xFF +_080D7890: + ldr r0, [r4] + ldr r1, [r0] + adds r1, 0x2 + adds r1, r5 + ldrb r0, [r1] + orrs r0, r2 + strb r0, [r1] + adds r5, 0x1 + cmp r5, 0x3 + ble _080D7890 + movs r4, 0 + ldr r6, =0x02039f34 + movs r5, 0x3 +_080D78AA: + ldr r0, [r6] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + movs r1, 0 + movs r2, 0x1C + bl memset + adds r4, 0x1C + subs r5, 0x1 + cmp r5, 0 + bge _080D78AA + ldr r4, =0x02039f34 + movs r7, 0x4 + negs r7, r7 + movs r6, 0xFF + movs r3, 0 + movs r5, 0x3 +_080D78CC: + ldr r0, [r4] + ldr r1, [r0, 0x4] + adds r1, r3, r1 + ldrb r2, [r1, 0xB] + adds r0, r7, 0 + ands r0, r2 + strb r0, [r1, 0xB] + ldr r0, [r4] + ldr r1, [r0, 0x4] + adds r1, r3, r1 + ldrb r0, [r1, 0x13] + orrs r0, r6 + strb r0, [r1, 0x13] + ldr r0, [r4] + ldr r1, [r0, 0x4] + adds r1, r3, r1 + ldrb r0, [r1, 0x14] + orrs r0, r6 + strb r0, [r1, 0x14] + adds r3, 0x1C + subs r5, 0x1 + cmp r5, 0 + bge _080D78CC + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r0, [r0, 0x8] + movs r1, 0 + movs r2, 0x14 + bl memset + ldr r0, [r4] + ldr r0, [r0, 0xC] + movs r1, 0 + movs r2, 0x44 + bl memset + ldr r2, [r4] + ldr r1, [r2, 0x10] + movs r0, 0 + str r0, [r1] + ldr r0, [r2, 0x14] + movs r1, 0 + movs r2, 0x10 + bl memset + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080D7938 + movs r0, 0 + bl sub_80DCE58 +_080D7938: + movs r5, 0 + adds r2, r4, 0 + movs r6, 0xFF + movs r3, 0 + ldr r4, =0x02039f26 +_080D7942: + ldr r0, [r2] + ldr r1, [r0, 0x4] + adds r1, r3, r1 + ldrb r0, [r1, 0x19] + orrs r0, r6 + strb r0, [r1, 0x19] + ldr r0, [r2] + ldr r1, [r0] + adds r1, 0x14 + adds r1, r5 + adds r0, r5, r4 + ldrb r0, [r0] + strb r0, [r1] + adds r3, 0x1C + adds r5, 0x1 + cmp r5, 0x3 + ble _080D7942 + bl sub_80DD590 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x1C] + movs r1, 0 + movs r2, 0x40 + bl memset + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D787C + + thumb_func_start sub_80D7988 +sub_80D7988: @ 80D7988 + push {r4,r5,lr} + ldr r4, =0x02039f34 + movs r0, 0x40 + bl AllocZeroed + str r0, [r4] + movs r0, 0x5C + bl AllocZeroed + ldr r1, [r4] + str r0, [r1] + movs r0, 0x70 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x4] + movs r0, 0x14 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x8] + movs r0, 0x44 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0xC] + movs r0, 0x10 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x10] + movs r0, 0x10 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x14] + movs r0, 0x14 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x18] + movs r0, 0x40 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x1C] + movs r0, 0xC + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x20] + movs r5, 0x80 + lsls r5, 5 + adds r0, r5, 0 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x24] + adds r0, r5, 0 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x28] + adds r0, r5, 0 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x2C] + adds r0, r5, 0 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x30] + movs r5, 0x80 + lsls r5, 4 + adds r0, r5, 0 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x34] + adds r0, r5, 0 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x38] + movs r0, 0x80 + lsls r0, 6 + bl AllocZeroed + ldr r2, [r4] + str r0, [r2, 0x3C] + ldr r1, =0x0202305c + str r0, [r1] + ldr r1, =0x02023060 + ldr r0, [r2, 0x28] + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D7988 + + thumb_func_start sub_80D7A5C +sub_80D7A5C: @ 80D7A5C + push {r4,r5,lr} + ldr r5, =0x02039f34 + ldr r0, [r5] + ldr r0, [r0] + bl Free + ldr r0, [r5] + movs r4, 0 + str r4, [r0] + ldr r0, [r0, 0x4] + bl Free + ldr r0, [r5] + str r4, [r0, 0x4] + ldr r0, [r0, 0x8] + bl Free + ldr r0, [r5] + str r4, [r0, 0x8] + ldr r0, [r0, 0xC] + bl Free + ldr r0, [r5] + str r4, [r0, 0xC] + ldr r0, [r0, 0x10] + bl Free + ldr r0, [r5] + str r4, [r0, 0x10] + ldr r0, [r0, 0x14] + bl Free + ldr r0, [r5] + str r4, [r0, 0x14] + ldr r0, [r0, 0x18] + bl Free + ldr r0, [r5] + str r4, [r0, 0x18] + ldr r0, [r0, 0x1C] + bl Free + ldr r0, [r5] + str r4, [r0, 0x1C] + ldr r0, [r0, 0x20] + bl Free + ldr r0, [r5] + str r4, [r0, 0x20] + ldr r0, [r0, 0x24] + bl Free + ldr r0, [r5] + str r4, [r0, 0x24] + ldr r0, [r0, 0x28] + bl Free + ldr r0, [r5] + str r4, [r0, 0x28] + ldr r0, [r0, 0x2C] + bl Free + ldr r0, [r5] + str r4, [r0, 0x2C] + ldr r0, [r0, 0x30] + bl Free + ldr r0, [r5] + str r4, [r0, 0x30] + ldr r0, [r0, 0x34] + bl Free + ldr r0, [r5] + str r4, [r0, 0x34] + ldr r0, [r0, 0x38] + bl Free + ldr r0, [r5] + str r4, [r0, 0x38] + ldr r0, [r0, 0x3C] + bl Free + ldr r0, [r5] + str r4, [r0, 0x3C] + bl Free + str r4, [r5] + ldr r0, =0x0202305c + str r4, [r0] + ldr r0, =0x02023060 + str r4, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D7A5C + + thumb_func_start sub_80D7B24 +sub_80D7B24: @ 80D7B24 + push {r4-r6,lr} + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r6, r0, r1 + ldrb r5, [r6] + cmp r5, 0x1 + beq _080D7BD4 + cmp r5, 0x1 + bgt _080D7B44 + cmp r5, 0 + beq _080D7B4E + b _080D7C56 + .pool +_080D7B44: + cmp r5, 0x2 + beq _080D7BDA + cmp r5, 0x3 + beq _080D7C04 + b _080D7C56 +_080D7B4E: + ldr r0, =0x02039f38 + strb r5, [r0] + bl sub_80D7988 + bl init_uns_table_pokemon_copy + ldr r4, =0x020244d4 + ldr r0, [r4] + ldr r0, [r0] + bl Free + ldr r0, [r4] + str r5, [r0] + movs r0, 0x80 + lsls r0, 7 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1] + movs r0, 0 + bl SetVBlankCallback + bl sub_80D779C + bl sub_80D77E4 + bl sub_80D7678 + bl dp12_8087EA4 + bl sub_80A1A74 + ldr r2, =0x02037fd4 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + bl ResetAllObjectData + bl ResetTasks + bl ResetObjectPaletteAllocator + ldr r1, =0x0300301c + movs r0, 0x4 + strb r0, [r1] + ldr r0, =0x02000000 + movs r1, 0xD0 + lsls r1, 9 + adds r0, r1 + strb r5, [r0] + bl sub_806E414 + bl sub_80D787C + b _080D7BF6 + .pool +_080D7BD4: + movs r0, 0x2 + strb r0, [r6] + b _080D7C56 +_080D7BDA: + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r0, [r0] + adds r0, 0x59 + bl sub_80D7E44 + lsls r0, 24 + cmp r0, 0 + beq _080D7C56 + ldr r0, [r4] + ldr r0, [r0] + adds r0, 0x59 + movs r1, 0 + strb r1, [r0] +_080D7BF6: + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + b _080D7C56 + .pool +_080D7C04: + bl sub_80DE224 + ldr r0, =0x02022e18 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e1a + strh r1, [r0] + movs r0, 0x2 + bl sub_80A2390 + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + ldr r0, =vblank_cb_battle + bl SetVBlankCallback + ldr r0, =sub_80D7C7C + movs r1, 0xA + bl CreateTask + ldr r1, =0x02039f34 + ldr r1, [r1] + ldr r1, [r1] + strb r0, [r1, 0x8] + ldr r0, =sub_80D823C + bl SetMainCallback2 + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080D7C56 + bl sub_800E0E8 + movs r0, 0x8 + movs r1, 0x8 + bl sub_800DFB4 +_080D7C56: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D7B24 + + thumb_func_start sub_80D7C7C +sub_80D7C7C: @ 80D7C7C + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _080D7CA2 + ldr r0, =0x03005e00 + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + strh r2, [r1, 0x8] + ldr r0, =sub_80D7CB4 + str r0, [r1] +_080D7CA2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D7C7C + + thumb_func_start sub_80D7CB4 +sub_80D7CB4: @ 80D7CB4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080D7D90 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080D7D3A + ldr r2, =0x03005e00 + lsls r1, r5, 2 + adds r0, r1, r5 + lsls r0, 3 + adds r4, r0, r2 + movs r2, 0x8 + ldrsh r0, [r4, r2] + adds r6, r1, 0 + cmp r0, 0x1 + beq _080D7D04 + cmp r0, 0x1 + bgt _080D7CF4 + cmp r0, 0 + beq _080D7CFA + b _080D7D3A + .pool +_080D7CF4: + cmp r0, 0x2 + beq _080D7D28 + b _080D7D3A +_080D7CFA: + bl sub_80DBF68 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080D7D04: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080D7D9E + bl sub_800ADF8 + ldr r0, =0x03005e00 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _080D7D9E + .pool +_080D7D28: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D7D9E + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080D7D3A: + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080D7D9E + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080D7D62 + bl sub_80DBF68 +_080D7D62: + ldr r0, =sub_80D7DAC + movs r1, 0 + bl CreateTask + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0x8] + ldr r1, =TaskDummy1 + str r1, [r0] + b _080D7D9E + .pool +_080D7D90: + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80D80C8 + str r0, [r1] +_080D7D9E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D7CB4 + + thumb_func_start sub_80D7DAC +sub_80D7DAC: @ 80D7DAC + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =sub_80FC998 + ldr r2, =sub_80D7DC8 + bl SetTaskFuncWithFollowupFunc + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D7DAC + + thumb_func_start sub_80D7DC8 +sub_80D7DC8: @ 80D7DC8 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x1 + strh r0, [r1, 0x8] + ldr r0, =sub_80D7DE8 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_80D7DC8 + + thumb_func_start sub_80D7DE8 +sub_80D7DE8: @ 80D7DE8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r5 + ldrh r1, [r0, 0x8] + subs r1, 0x1 + strh r1, [r0, 0x8] + lsls r1, 16 + cmp r1, 0 + bgt _080D7E2A + bl link_get_multiplayer_id + adds r0, r4, 0 + bl DestroyTask + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0, 0x8] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + ldr r1, =sub_80D80C8 + str r1, [r0] + ldr r1, =0x03005d80 + ldr r0, =0x030060b8 + ldr r0, [r0] + str r0, [r1] +_080D7E2A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D7DE8 + + thumb_func_start sub_80D7E44 +sub_80D7E44: @ 80D7E44 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + mov r10, r0 + ldrb r0, [r0] + cmp r0, 0x6 + bls _080D7E5A + b _080D80A4 +_080D7E5A: + lsls r0, 2 + ldr r1, =_080D7E68 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080D7E68: + .4byte _080D7E84 + .4byte _080D7EC8 + .4byte _080D7ED8 + .4byte _080D7F28 + .4byte _080D7F40 + .4byte _080D7F7C + .4byte _080D8004 +_080D7E84: + ldr r2, =0x02037fd4 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + movs r1, 0xC0 + lsls r1, 19 + movs r4, 0x80 + lsls r4, 8 + movs r0, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl RequestDma3Fill + ldr r1, =0x06008000 + movs r0, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl RequestDma3Fill + ldr r1, =0x06010000 + movs r0, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl RequestDma3Fill + b _080D80AE + .pool +_080D7EC8: + ldr r0, =gUnknown_08C17AB0 + movs r1, 0xC0 + lsls r1, 19 + bl LZDecompressVram + b _080D80AE + .pool +_080D7ED8: + ldr r0, =gUnknown_08C1850C + ldr r4, =0x06002000 + adds r1, r4, 0 + bl LZDecompressVram + ldr r3, =0x02018000 + movs r5, 0x80 + lsls r5, 6 + ldr r1, =0x040000d4 + ldr r6, =0x84000400 + movs r2, 0x80 + lsls r2, 5 + movs r7, 0x84 + lsls r7, 24 +_080D7EF4: + str r4, [r1] + str r3, [r1, 0x4] + str r6, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r4, r2 + adds r3, r2 + subs r5, r2 + cmp r5, r2 + bhi _080D7EF4 + str r4, [r1] + str r3, [r1, 0x4] + lsrs r0, r5, 2 + orrs r0, r7 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + b _080D80AE + .pool +_080D7F28: + ldr r1, =gUnknown_08C16FA8 + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + b _080D80AE + .pool +_080D7F40: + ldr r1, =gUnknown_08C17170 + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0x2C] + ldr r2, =0x0201aa04 + ldr r0, =0x040000d4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, =0x84000200 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + b _080D80AE + .pool +_080D7F7C: + ldr r0, =gUnknown_08C16E90 + movs r2, 0x80 + lsls r2, 2 + movs r1, 0 + bl decompress_palette + ldr r5, =0x02037814 + ldr r6, =0x04000008 + adds r0, r5, 0 + mov r1, sp + adds r2, r6, 0 + bl CpuSet + ldr r0, =0x02039f25 + mov r9, r0 + ldrb r0, [r0] + adds r0, 0x5 + lsls r0, 5 + ldr r1, =0xffffff00 + adds r1, r5 + mov r8, r1 + add r0, r8 + add r4, sp, 0x20 + adds r1, r4, 0 + adds r2, r6, 0 + bl CpuSet + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl CpuSet + mov r2, r9 + ldrb r1, [r2] + adds r1, 0x5 + lsls r1, 5 + add r1, r8 + mov r0, sp + adds r2, r6, 0 + bl CpuSet + ldr r1, =0x0201a004 + ldr r0, =0x040000d4 + mov r2, r8 + str r2, [r0] + str r1, [r0, 0x4] + ldr r1, =0x84000080 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + bl sub_80D782C + b _080D80AE + .pool +_080D8004: + bl sub_80DD04C + bl sub_80DBF90 + bl sub_80DB2BC + bl sub_80DB120 + ldr r1, =0x02039f34 + ldr r1, [r1] + ldr r1, [r1] + movs r4, 0 + strb r0, [r1, 0x12] + bl sub_80DC2BC + bl sub_80DC4F0 + bl sub_80DC594 + bl sub_80DC5E8 + bl sub_80DC7EC + ldr r1, =0x02024076 + strb r4, [r1] + movs r0, 0x1 + strb r0, [r1, 0x1] + movs r3, 0x3 + strb r3, [r1, 0x2] + movs r2, 0x2 + strb r2, [r1, 0x3] + ldr r0, =0x02022fec + str r4, [r0] + ldr r4, =0x0202420b + strb r2, [r4] + ldr r0, =0x0202420c + strb r3, [r0] + bl sub_80DB0C4 + ldr r2, =0x020241e4 + ldrb r1, [r4] + adds r1, r2 + strb r0, [r1] + bl sub_80DEA20 + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x3 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + b _080D80AE + .pool +_080D80A4: + movs r0, 0 + mov r1, r10 + strb r0, [r1] + movs r0, 0x1 + b _080D80B8 +_080D80AE: + mov r2, r10 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + movs r0, 0 +_080D80B8: + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D7E44 + + thumb_func_start sub_80D80C8 +sub_80D80C8: @ 80D80C8 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, =0x02037fd4 + ldrb r2, [r1, 0x8] + movs r0, 0x7F + ands r0, r2 + strb r0, [r1, 0x8] + ldrb r1, [r1, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _080D80F8 + ldr r0, =0x03005e00 + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + strh r2, [r1, 0x8] + strh r2, [r1, 0xA] + ldr r0, =sub_80D8108 + str r0, [r1] +_080D80F8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D80C8 + + thumb_func_start sub_80D8108 +sub_80D8108: @ 80D8108 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x4 + bhi _080D8208 + lsls r0, 2 + ldr r1, =_080D8138 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080D8138: + .4byte _080D814C + .4byte _080D8176 + .4byte _080D8194 + .4byte _080D81B0 + .4byte _080D8208 +_080D814C: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0xA] + adds r1, r0, 0x1 + strh r1, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + ble _080D822C + movs r0, 0 + strh r0, [r4, 0xA] + movs r0, 0x61 + movs r1, 0 + bl audio_play_and_stuff + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080D822C +_080D8176: + ldr r1, =0x02022e1a + ldrh r0, [r1] + adds r0, 0x7 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA0 + ble _080D822C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + b _080D81FA + .pool +_080D8194: + bl sub_80DE350 + ldr r0, =0x03005e00 + 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 _080D822C + .pool +_080D81B0: + movs r0, 0x8 + bl GetGpuReg + mov r1, sp + strh r0, [r1] + movs r0, 0xC + bl GetGpuReg + mov r4, sp + adds r4, 0x2 + strh r0, [r4] + mov r3, sp + ldrb r2, [r3] + movs r1, 0x4 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3] + ldrb r0, [r4] + ands r1, r0 + strb r1, [r4] + mov r0, sp + ldrh r1, [r0] + movs r0, 0x8 + bl SetGpuReg + ldrh r1, [r4] + movs r0, 0xC + bl SetGpuReg + bl sub_80DDB0C + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 +_080D81FA: + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _080D822C + .pool +_080D8208: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0, 0x6] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080D822C + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + strh r1, [r0, 0x8] + strh r1, [r0, 0xA] + ldr r1, =sub_80D833C + str r1, [r0] +_080D822C: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D8108 + + thumb_func_start sub_80D823C +sub_80D823C: @ 80D823C + push {r4,r5,lr} + bl CallObjectCallbacks + bl RunTasks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + movs r4, 0 +_080D8250: + ldr r5, =0x02039f38 + ldrb r0, [r5] + asrs r0, r4 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080D8266 + lsls r0, r4, 24 + lsrs r0, 24 + bl CopyBgTilemapBufferToVram +_080D8266: + adds r4, 0x1 + cmp r4, 0x3 + ble _080D8250 + movs r0, 0 + strb r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D823C + + thumb_func_start vblank_cb_battle +vblank_cb_battle: @ 80D827C + push {lr} + ldr r0, =0x02022e14 + ldrh r1, [r0] + movs r0, 0x10 + bl SetGpuReg + ldr r0, =0x02022e16 + ldrh r1, [r0] + movs r0, 0x12 + bl SetGpuReg + ldr r0, =0x02022e18 + ldrh r1, [r0] + movs r0, 0x14 + bl SetGpuReg + ldr r0, =0x02022e1a + ldrh r1, [r0] + movs r0, 0x16 + bl SetGpuReg + ldr r0, =0x02022e1c + ldrh r1, [r0] + movs r0, 0x18 + bl SetGpuReg + ldr r0, =0x02022e1e + ldrh r1, [r0] + movs r0, 0x1A + bl SetGpuReg + ldr r0, =0x02022e20 + ldrh r1, [r0] + movs r0, 0x1C + bl SetGpuReg + ldr r0, =0x02022e22 + ldrh r1, [r0] + movs r0, 0x1E + bl SetGpuReg + ldr r0, =0x02022e24 + ldrh r1, [r0] + movs r0, 0x40 + bl SetGpuReg + ldr r0, =0x02022e26 + ldrh r1, [r0] + movs r0, 0x44 + bl SetGpuReg + ldr r0, =0x02022e28 + ldrh r1, [r0] + movs r0, 0x42 + bl SetGpuReg + ldr r0, =0x02022e2a + ldrh r1, [r0] + movs r0, 0x46 + bl SetGpuReg + bl copy_pal_bg_faded_to_pal_ram + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl sub_80BA0A8 + pop {r0} + bx r0 + .pool + thumb_func_end vblank_cb_battle + + thumb_func_start sub_80D833C +sub_80D833C: @ 80D833C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0 + bne _080D840C + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r0, =0x02022e1e + strh r1, [r0] + bl sub_80DCD48 + ldr r1, =0x02037714 + ldr r2, =0x0201a204 + ldr r0, =0x040000d4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, =0x84000100 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + ldr r0, =0x02021cc4 + ldr r1, =0x02039f34 + ldr r1, [r1] + ldr r1, [r1] + ldrb r1, [r1, 0x1] + adds r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalString + ldr r0, =0x02039f25 + ldrb r0, [r0] + bl sub_80DBCA8 + lsls r0, 24 + cmp r0, 0 + bne _080D83CC + ldr r0, =0x02022e2c + ldr r1, =gUnknown_0827D507 + bl CopyString + b _080D83D4 + .pool +_080D83CC: + ldr r0, =0x02022e2c + ldr r1, =gUnknown_0827D531 + bl CopyString +_080D83D4: + bl sub_80DB89C + ldr r4, =0x02021fc4 + ldr r1, =0x02022e2c + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80DEC30 + ldr r1, =0x03005e00 + 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 _080D841A + .pool +_080D840C: + bl sub_80DED4C + cmp r0, 0 + bne _080D841A + strh r0, [r4, 0x8] + ldr r0, =sub_80D8424 + str r0, [r4] +_080D841A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D833C + + thumb_func_start sub_80D8424 +sub_80D8424: @ 80D8424 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080D843C + cmp r1, 0x2 + bne _080D8482 +_080D843C: + movs r0, 0x5 + bl audio_play + ldr r0, =0x02039f25 + ldrb r0, [r0] + bl sub_80DBCA8 + lsls r0, 24 + cmp r0, 0 + bne _080D8474 + movs r0, 0x1 + bl sub_80DC490 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80D8490 + b _080D8480 + .pool +_080D8474: + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80D8894 +_080D8480: + str r0, [r1] +_080D8482: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D8424 + + thumb_func_start sub_80D8490 +sub_80D8490: @ 80D8490 + 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 + mov r9, r0 + ldr r0, =0x02022e16 + movs r1, 0xA0 + strh r1, [r0] + ldr r0, =0x02022e1e + strh r1, [r0] + movs r6, 0 + ldr r0, =0x02039f25 + mov r8, r0 + ldr r2, =0x02039e1e + mov r10, r2 + ldr r7, =0x02039f34 +_080D84B8: + lsls r1, r6, 1 + mov r0, r8 + ldrb r2, [r0] + lsls r0, r2, 6 + adds r1, r0 + add r1, r10 + ldrh r4, [r1] + add r5, sp, 0x4 + ldr r0, [r7] + ldr r1, [r0, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x8] + cmp r0, 0 + beq _080D853C + adds r0, r2, 0 + bl sub_80DE1E8 + lsls r0, 24 + cmp r0, 0 + beq _080D853C + ldr r0, [r7] + mov r2, r8 + ldrb r1, [r2] + ldr r2, [r0, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x8] + adds r1, r4, 0 + bl AreMovesContestCombo + lsls r0, 24 + cmp r0, 0 + beq _080D853C + ldr r0, [r7] + mov r2, r8 + ldrb r1, [r2] + ldr r2, [r0, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x15] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080D853C + add r0, sp, 0x4 + ldr r1, =gUnknown_085ED1A0 + b _080D8566 + .pool +_080D853C: + cmp r4, 0 + beq _080D856C + ldr r0, [r7] + mov r2, r8 + ldrb r1, [r2] + ldr r2, [r0, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x8] + cmp r0, r4 + bne _080D856C + ldr r0, =gContestMoves + lsls r1, r4, 3 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x3 + beq _080D856C + add r0, sp, 0x4 + ldr r1, =gUnknown_085ED1A7 +_080D8566: + bl CopyString + adds r5, r0, 0 +_080D856C: + movs r0, 0xD + adds r1, r4, 0 + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + adds r0, r5, 0 + bl CopyString + adds r4, r6, 0x5 + lsls r0, r4, 24 + lsrs r0, 24 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x7 + str r0, [sp] + adds r0, r4, 0 + add r1, sp, 0x4 + movs r2, 0x5 + movs r3, 0x1 + bl sub_80DEBD0 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _080D84B8 + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + bl sub_80D880C + ldr r2, =0x02039e00 + ldr r0, [r4] + ldr r0, [r0] + ldrb r1, [r0] + lsls r1, 1 + ldr r0, =0x02039f25 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r2, 0x1E + adds r1, r2 + ldrh r0, [r1] + bl prints_contest_move_description + ldr r1, =0x03005e00 + mov r2, r9 + lsls r0, r2, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80D8610 + str r1, [r0] + 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_80D8490 + + thumb_func_start sub_80D8610 +sub_80D8610: @ 80D8610 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + movs r6, 0 + ldr r3, =0x030022c0 + ldr r1, =0x02039e00 + ldr r0, =0x02039f25 + ldrb r0, [r0] + lsls r0, 6 + adds r1, 0x1E + adds r1, r0, r1 + movs r2, 0x3 +_080D8628: + ldrh r0, [r1] + cmp r0, 0 + beq _080D8634 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_080D8634: + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _080D8628 + ldrh r0, [r3, 0x2E] + movs r5, 0x1 + ands r5, r0 + cmp r5, 0 + beq _080D8670 + movs r0, 0x5 + bl audio_play + ldr r0, =0x03005e00 + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80D8894 + str r0, [r1] + b _080D87FA + .pool +_080D8670: + ldrh r0, [r3, 0x30] + cmp r0, 0x20 + bne _080D8678 + b _080D87FA +_080D8678: + cmp r0, 0x20 + bgt _080D8682 + cmp r0, 0x2 + beq _080D868E + b _080D87FA +_080D8682: + cmp r0, 0x40 + beq _080D8730 + cmp r0, 0x80 + bne _080D868C + b _080D879C +_080D868C: + b _080D87FA +_080D868E: + movs r0, 0x5 + bl audio_play + movs r0, 0 + bl sub_80DC490 + ldr r0, =0x02021cc4 + ldr r1, =0x02039f34 + ldr r1, [r1] + ldr r1, [r1] + ldrb r1, [r1, 0x1] + adds r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalString + ldr r0, =0x02039f25 + ldrb r0, [r0] + bl sub_80DBCA8 + lsls r0, 24 + cmp r0, 0 + bne _080D86DC + ldr r0, =0x02022e2c + ldr r1, =gUnknown_0827D507 + bl CopyString + b _080D86E4 + .pool +_080D86DC: + ldr r0, =0x02022e2c + ldr r1, =gUnknown_0827D531 + bl CopyString +_080D86E4: + bl sub_80DB89C + ldr r4, =0x02021fc4 + ldr r1, =0x02022e2c + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0 + bl sub_80DEC30 + ldr r0, =0x02022e16 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e1e + strh r1, [r0] + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80D8424 + str r1, [r0] + b _080D87FA + .pool +_080D8730: + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + bl sub_80D883C + ldr r0, [r4] + ldr r1, [r0] + ldrb r0, [r1] + cmp r0, 0 + bne _080D8754 + subs r0, r6, 0x1 + b _080D8756 + .pool +_080D8754: + subs r0, 0x1 +_080D8756: + strb r0, [r1] + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + bl sub_80D880C + ldr r2, =0x02039e00 + ldr r0, [r4] + ldr r0, [r0] + ldrb r1, [r0] + lsls r1, 1 + ldr r0, =0x02039f25 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r2, 0x1E + adds r1, r2 + ldrh r0, [r1] + bl prints_contest_move_description + cmp r6, 0x1 + bls _080D87FA + movs r0, 0x5 + bl audio_play + b _080D87FA + .pool +_080D879C: + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + bl sub_80D883C + ldr r0, [r4] + ldr r1, [r0] + ldrb r2, [r1] + subs r0, r6, 0x1 + cmp r2, r0 + bne _080D87C0 + strb r5, [r1] + b _080D87C4 + .pool +_080D87C0: + adds r0, r2, 0x1 + strb r0, [r1] +_080D87C4: + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + bl sub_80D880C + ldr r2, =0x02039e00 + ldr r0, [r4] + ldr r0, [r0] + ldrb r1, [r0] + lsls r1, 1 + ldr r0, =0x02039f25 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r2, 0x1E + adds r1, r2 + ldrh r0, [r1] + bl prints_contest_move_description + cmp r6, 0x1 + bls _080D87FA + movs r0, 0x5 + bl audio_play +_080D87FA: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D8610 + + thumb_func_start sub_80D880C +sub_80D880C: @ 80D880C + push {lr} + sub sp, 0x10 + adds r3, r0, 0 + lsls r3, 25 + movs r0, 0xF8 + lsls r0, 21 + adds r3, r0 + lsrs r3, 24 + movs r0, 0x2 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + str r0, [sp, 0xC] + movs r0, 0x2 + movs r1, 0x37 + movs r2, 0 + bl sub_80DECB8 + add sp, 0x10 + pop {r0} + bx r0 + thumb_func_end sub_80D880C + + thumb_func_start sub_80D883C +sub_80D883C: @ 80D883C + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x10 + adds r4, r0, 0 + lsls r4, 24 + asrs r4, 23 + adds r3, r4, 0 + adds r3, 0x1F + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x2 + mov r8, r0 + str r0, [sp] + movs r5, 0x1 + str r5, [sp, 0x4] + movs r6, 0x11 + str r6, [sp, 0x8] + str r5, [sp, 0xC] + movs r1, 0xB + movs r2, 0 + bl sub_80DECB8 + adds r4, 0x20 + lsls r4, 24 + lsrs r4, 24 + mov r0, r8 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + str r5, [sp, 0xC] + movs r0, 0x2 + movs r1, 0xB + movs r2, 0 + adds r3, r4, 0 + bl sub_80DECB8 + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80D883C + + thumb_func_start sub_80D8894 +sub_80D8894: @ 80D8894 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080D890C + ldr r4, =0x02039f25 + ldrb r0, [r4] + bl sub_80DB8B8 + ldr r1, =0x02039f34 + ldr r1, [r1] + ldrb r2, [r4] + ldr r3, [r1, 0x4] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r3 + strh r0, [r1, 0x6] + ldr r4, =sub_80FC9F8 + adds r0, r4, 0 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =sub_80D892C + adds r1, r4, 0 + bl SetTaskFuncWithFollowupFunc + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =TaskDummy1 + str r1, [r0] + bl sub_80DBF68 + movs r0, 0 + bl sub_80DC490 + b _080D891E + .pool +_080D890C: + bl sub_80DB918 + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80D895C + str r0, [r1] +_080D891E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D8894 + + thumb_func_start sub_80D892C +sub_80D892C: @ 80D892C + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + ldr r2, =0x03005e00 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0, 0x8] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, =sub_80D895C + str r1, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D892C + + thumb_func_start sub_80D895C +sub_80D895C: @ 80D895C + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + bl sub_80DB89C + ldr r0, =0x02022e16 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e1e + strh r1, [r0] + movs r0, 0 + bl sub_80DC490 + movs r6, 0 + movs r5, 0xA0 + lsls r5, 19 +_080D897C: + lsrs r4, r5, 24 + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x80 + lsls r0, 17 + adds r5, r0 + adds r6, 0x1 + cmp r6, 0x3 + ble _080D897C + movs r0, 0 + bl sub_80DED60 + ldr r1, =0x02037b14 + ldr r0, =0x0201a604 + movs r2, 0x80 + lsls r2, 3 + ldr r4, =0x040000d4 + str r1, [r4] + str r0, [r4, 0x4] + lsrs r1, r2, 2 + movs r3, 0x84 + lsls r3, 24 + orrs r1, r3 + str r1, [r4, 0x8] + ldr r1, [r4, 0x8] + ldr r1, =0xfffffc00 + adds r0, r1 + movs r1, 0 + bl gpu_pal_apply + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] + strh r1, [r0, 0xA] + ldr r1, =sub_80D8A04 + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D895C + + thumb_func_start sub_80D8A04 +sub_80D8A04: @ 80D8A04 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _080D8A42 + movs r0, 0 + strh r0, [r4, 0x8] + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _080D8A42 + bl sub_80DDBE8 + movs r0, 0x1 + bl sub_80DE69C + ldr r0, =sub_80D8A50 + str r0, [r4] +_080D8A42: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D8A04 + + thumb_func_start sub_80D8A50 +sub_80D8A50: @ 80D8A50 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0] + ldrh r1, [r0, 0x6] + movs r0, 0x90 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + bne _080D8A76 + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80D8A88 + str r0, [r1] +_080D8A76: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D8A50 + + thumb_func_start sub_80D8A88 +sub_80D8A88: @ 80D8A88 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x03005e00 + lsls r3, r6, 2 + adds r1, r3, r6 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _080D8B18 + ldr r2, =0x02039f34 + ldr r0, [r2] + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x10] + ldr r0, [r2] + ldr r1, [r0] + ldr r0, =0x03005d80 + ldr r0, [r0] + str r0, [r1, 0x18] + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + adds r7, r3, 0 + cmp r0, 0 + beq _080D8B08 + bl sub_80DA8A4 + lsls r0, 24 + cmp r0, 0 + beq _080D8B08 + movs r4, 0 + ldr r1, =0x02039f30 + ldrb r0, [r1] + cmp r0, 0x3 + bgt _080D8B08 + adds r5, r1, 0 +_080D8ADE: + ldrb r0, [r5] + adds r0, r4 + lsls r0, 24 + lsrs r0, 24 + bl sub_80DB8B8 + ldr r1, =0x02039f34 + ldr r1, [r1] + ldrb r2, [r5] + adds r2, r4 + ldr r3, [r1, 0x4] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r3 + strh r0, [r1, 0x6] + adds r4, 0x1 + ldrb r0, [r5] + adds r0, r4, r0 + cmp r0, 0x3 + ble _080D8ADE +_080D8B08: + ldr r1, =0x03005e00 + adds r0, r7, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] + ldr r1, =sub_80D8B38 + str r1, [r0] +_080D8B18: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D8A88 + + thumb_func_start sub_80D8B38 +sub_80D8B38: @ 80D8B38 + 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 + ldr r2, =0x02039f34 + ldr r0, [r2] + ldr r0, [r0] + ldrb r6, [r0, 0x11] + ldr r1, =0x03005e00 + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r4, 0x8 + ldrsh r0, [r0, r4] + mov r9, r2 + adds r4, r1, 0 + cmp r0, 0x3B + bls _080D8B6E + bl _080DA100 +_080D8B6E: + lsls r0, 2 + ldr r1, =_080D8B84 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080D8B84: + .4byte _080D8C74 + .4byte _080D8D30 + .4byte _080D8D56 + .4byte _080D8DC4 + .4byte _080D8E7C + .4byte _080D8EC8 + .4byte _080D8F84 + .4byte _080D8FB8 + .4byte _080D9010 + .4byte _080D908C + .4byte _080D9FC0 + .4byte _080D9FEC + .4byte _080D9238 + .4byte _080D926C + .4byte _080D9774 + .4byte _080D9864 + .4byte _080D98D4 + .4byte _080D9904 + .4byte _080D99EC + .4byte _080D999E + .4byte _080DA024 + .4byte _080DA0A0 + .4byte _080DA0C2 + .4byte _080D90B4 + .4byte _080D9180 + .4byte _080D9388 + .4byte _080D939E + .4byte _080D947C + .4byte _080D94A0 + .4byte _080D9508 + .4byte _080D95EC + .4byte _080DA038 + .4byte _080DA080 + .4byte _080D9EBC + .4byte _080D9F48 + .4byte _080D929A + .4byte _080D92D0 + .4byte _080D92F6 + .4byte _080D9334 + .4byte _080D955C + .4byte _080D95C4 + .4byte _080D9A2C + .4byte _080DA100 + .4byte _080D9DAC + .4byte _080DA100 + .4byte _080D9830 + .4byte _080D997C + .4byte _080D921A + .4byte _080D91A4 + .4byte _080D91F4 + .4byte _080D935C + .4byte _080D9690 + .4byte _080D971C + .4byte _080D9BAA + .4byte _080D9C68 + .4byte _080D9F68 + .4byte _080D9F84 + .4byte _080D9DD4 + .4byte _080D9E60 + .4byte _080D9EA0 +_080D8C74: + bl sub_80DCD48 + movs r7, 0 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0] + ldr r0, [r0, 0x8] + ldrb r1, [r1, 0x10] + mov r5, r8 + lsls r5, 2 + mov r10, r5 + ldrb r2, [r0] + cmp r1, r2 + beq _080D8C9C + adds r2, r0, 0 +_080D8C92: + adds r7, 0x1 + adds r0, r2, r7 + ldrb r0, [r0] + cmp r1, r0 + bne _080D8C92 +_080D8C9C: + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r0, [r0] + strb r7, [r0, 0x11] + ldr r0, [r4] + ldr r2, [r0] + ldrb r6, [r2, 0x11] + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _080D8D14 + ldrb r0, [r2, 0x7] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x7] + bl sub_80DA8A4 + lsls r0, 24 + cmp r0, 0 + beq _080D8CD4 + ldr r0, [r4] + ldr r0, [r0] + ldrb r0, [r0, 0x11] + bl sub_80DD080 +_080D8CD4: + ldr r4, =sub_80FCC88 + adds r0, r4, 0 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =sub_80DA110 + adds r1, r4, 0 + bl SetTaskFuncWithFollowupFunc + bl sub_80DBF68 + ldr r1, =0x03005e00 + mov r0, r10 + add r0, r8 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x8] + bl _080DA100 + .pool +_080D8D14: + adds r0, r6, 0 + bl sub_80DD080 + ldr r0, =0x03005e00 + mov r1, r10 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x2 + strh r0, [r1, 0x8] + bl _080DA100 + .pool +_080D8D30: + mov r3, r9 + ldr r0, [r3] + ldr r0, [r0] + ldrb r1, [r0, 0x7] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080D8D44 + bl _080DA100 +_080D8D44: + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x8] + bl _080DA100 +_080D8D56: + adds r0, r6, 0 + bl sub_80DF080 + bl sub_80DF750 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r2, r0, r1 + ldrb r1, [r2, 0xC] + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + bne _080D8D86 + ldrb r1, [r2, 0xB] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + beq _080D8DA4 +_080D8D86: + ldr r0, =0x03005e00 + mov r2, r8 + lsls r1, r2, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1F + strh r0, [r1, 0x8] + bl _080DA100 + .pool +_080D8DA4: + bl sub_80DB89C + ldr r0, =0x03005e00 + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + strh r6, [r1, 0x1C] + movs r0, 0x3 + strh r0, [r1, 0x8] + bl _080DA100 + .pool +_080D8DC4: + mov r4, r8 + lsls r4, 2 + mov r10, r4 + ldr r1, =0x020244e4 + movs r2, 0 + adds r0, r1, 0x3 +_080D8DD0: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _080D8DD0 + movs r7, 0x4 + mov r5, r9 + ldr r0, [r5] + ldr r0, [r0, 0x18] + movs r1, 0 + movs r2, 0x14 + bl memset + ldr r0, [r5] + ldr r0, [r0] + ldrb r0, [r0, 0x11] + bl sub_80DE9DC + ldr r4, =0x02039e00 + ldr r0, [r5] + ldr r0, [r0] + ldrb r3, [r0, 0x11] + lsls r2, r3, 6 + adds r0, r2, r4 + ldrh r0, [r0] + adds r1, r4, 0 + adds r1, 0x3C + adds r1, r2, r1 + ldr r1, [r1] + adds r4, 0x38 + adds r2, r4 + ldr r2, [r2] + bl sub_80DB174 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, =0x02020630 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r3, r0, r2 + movs r1, 0x78 + strh r1, [r3, 0x24] + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_80DA134 + str r1, [r0] + ldr r0, =0x03005e00 + mov r4, r10 + add r4, r8 + lsls r4, 3 + adds r4, r0 + strh r5, [r4, 0xC] + ldr r1, =0x020241e4 + ldr r0, =0x0202420b + ldrb r0, [r0] + adds r0, r1 + strb r5, [r0] + mov r1, r9 + ldr r0, [r1] + ldr r0, [r0] + ldrb r0, [r0, 0x11] + bl sub_80DC9EC + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_80DCBE8 + strh r7, [r4, 0x8] + bl _080DA100 + .pool +_080D8E7C: + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r2, r0, r4 + ldrb r5, [r2, 0xC] + ldr r1, =0x02020630 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r1, 0x1C + adds r0, r1 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + beq _080D8EA0 + bl _080DA100 +_080D8EA0: + mov r3, r9 + ldr r0, [r3] + ldr r1, [r0, 0x14] + lsls r0, r6, 2 + adds r0, r1 + ldrb r1, [r0, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080D8EB8 + bl _080DA100 +_080D8EB8: + movs r0, 0x5 + strh r0, [r2, 0x8] + bl _080DA100 + .pool +_080D8EC8: + mov r5, r9 + ldr r0, [r5] + ldr r1, [r0, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r5, r0, 2 + adds r1, r5, r1 + ldrb r1, [r1, 0xC] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080D8EF2 + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0x21 + strh r1, [r0, 0x8] + bl _080DA100 +_080D8EF2: + bl sub_80DB89C + ldr r0, =0x02021cc4 + lsls r1, r6, 6 + ldr r2, =0x02039e02 + adds r1, r2 + bl CopyString + mov r2, r9 + ldr r0, [r2] + ldr r0, [r0, 0x4] + adds r3, r5, r0 + ldrh r1, [r3, 0x6] + movs r0, 0xB1 + lsls r0, 1 + cmp r1, r0 + bhi _080D8F38 + ldr r0, =0x02021dc4 + adds r2, r1, 0 + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + b _080D8F48 + .pool +_080D8F38: + ldr r0, =0x02021dc4 + ldr r2, =gUnknown_08587F1C + ldrb r1, [r3, 0xA] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl CopyString +_080D8F48: + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_0827D55A + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80DEC30 + ldr r1, =0x03005e00 + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x6 + strh r1, [r0, 0x8] + bl _080DA100 + .pool +_080D8F84: + bl sub_80DED4C + adds r1, r0, 0 + cmp r1, 0 + beq _080D8F92 + bl _080DA100 +_080D8F92: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0] + adds r0, 0x5A + strb r1, [r0] + ldr r1, =0x03005e00 + mov r4, r8 + lsls r0, r4, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x7 + strh r1, [r0, 0x8] + bl _080DA100 + .pool +_080D8FB8: + mov r5, r9 + ldr r1, [r5] + ldr r0, [r1] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x6] + bl sub_80DE834 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, [r5] + ldr r0, [r0] + ldrb r0, [r0, 0x11] + bl sub_80DE864 + ldr r0, [r5] + ldr r0, [r0] + ldrb r0, [r0, 0x11] + bl sub_80DE9DC + adds r0, r4, 0 + bl sub_80DEAA8 + adds r0, r4, 0 + bl move_anim_start_t1 + ldr r1, =0x03005e00 + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + strh r1, [r0, 0x8] + bl _080DA100 + .pool +_080D9010: + ldr r0, =0x020383f8 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =0x020383fd + ldrb r4, [r0] + cmp r4, 0 + beq _080D9024 + bl _080DA100 +_080D9024: + adds r0, r6, 0 + bl sub_80DE9B0 + ldr r0, =0x02039f34 + ldr r1, [r0] + ldr r0, [r1] + adds r0, 0x5A + ldrb r0, [r0] + cmp r0, 0 + beq _080D9060 + ldr r0, =0x03005e00 + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + strh r4, [r1, 0x1C] + movs r0, 0x9 + strh r0, [r1, 0x8] + bl _080DA100 + .pool +_080D9060: + ldr r1, [r1, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x15] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _080D907A + adds r0, r6, 0 + bl sub_80DC674 +_080D907A: + bl sub_80DE12C + ldr r0, =0x03005e00 + mov r4, r8 + lsls r1, r4, 2 + b _080D9192 + .pool +_080D908C: + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r2, r0, r4 + ldrh r0, [r2, 0x1C] + adds r1, r0, 0x1 + strh r1, [r2, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1E + bgt _080D90A8 + bl _080DA100 +_080D90A8: + movs r0, 0 + strh r0, [r2, 0x1C] + movs r0, 0x7 + strh r0, [r2, 0x8] + bl _080DA100 +_080D90B4: + mov r0, r8 + lsls r2, r0, 2 + adds r0, r2, r0 + lsls r0, 3 + adds r7, r0, r4 + movs r0, 0 + strh r0, [r7, 0xA] + mov r1, r9 + ldr r0, [r1] + ldr r0, [r0, 0x4] + mov r12, r0 + lsls r1, r6, 3 + subs r0, r1, r6 + lsls r5, r0, 2 + mov r0, r12 + adds r3, r5, r0 + ldrb r0, [r3, 0x13] + mov r10, r2 + str r1, [sp, 0x4] + cmp r0, 0xFF + beq _080D90FA + ldrb r1, [r3, 0x13] + adds r0, r6, 0 + bl sub_80DD45C + mov r1, r9 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r0, r5, r0 + movs r1, 0xFF + strb r1, [r0, 0x13] + movs r0, 0x18 + strh r0, [r7, 0x8] + bl _080DA100 +_080D90FA: + ldrb r0, [r3, 0x14] + cmp r0, 0xFF + beq _080D9178 + movs r7, 0 + cmp r7, r6 + beq _080D910E + mov r2, r12 + ldrb r0, [r2, 0x13] + cmp r0, 0xFF + bne _080D912C +_080D910E: + adds r7, 0x1 + cmp r7, 0x3 + bgt _080D912C + cmp r7, r6 + beq _080D910E + mov r3, r9 + ldr r0, [r3] + ldr r1, [r0, 0x4] + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x13] + cmp r0, 0xFF + beq _080D910E +_080D912C: + cmp r7, 0x4 + bne _080D9168 + mov r4, r9 + ldr r0, [r4] + ldr r0, [r0, 0x4] + ldr r5, [sp, 0x4] + subs r4, r5, r6 + lsls r4, 2 + adds r0, r4, r0 + ldrb r1, [r0, 0x14] + adds r0, r6, 0 + bl sub_80DD45C + mov r1, r9 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r4, r0 + movs r0, 0xFF + strb r0, [r4, 0x14] + ldr r1, =0x03005e00 + mov r0, r10 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x18 + strh r1, [r0, 0x8] + bl _080DA100 + .pool +_080D9168: + mov r0, r10 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0x30 + strh r1, [r0, 0x8] + bl _080DA100 +_080D9178: + movs r0, 0x30 + strh r0, [r7, 0x8] + bl _080DA100 +_080D9180: + bl sub_80DED4C + cmp r0, 0 + beq _080D918C + bl _080DA100 +_080D918C: + ldr r0, =0x03005e00 + mov r2, r8 + lsls r1, r2, 2 +_080D9192: + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x17 + strh r0, [r1, 0x8] + bl _080DA100 + .pool +_080D91A4: + mov r3, r9 + ldr r0, [r3] + ldr r1, [r0, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x11] + movs r3, 0x3 + ands r3, r0 + cmp r3, 0x1 + bne _080D91C4 + movs r0, 0x5 + bl sub_80DD720 + b _080D91DA +_080D91C4: + cmp r3, 0x2 + bne _080D91D0 + movs r0, 0x6 + bl sub_80DD720 + b _080D91DA +_080D91D0: + cmp r3, 0x3 + bne _080D9208 + movs r0, 0x7 + bl sub_80DD720 +_080D91DA: + ldr r0, =0x03005e00 + mov r2, r8 + lsls r1, r2, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x31 + strh r0, [r1, 0x8] + bl _080DA100 + .pool +_080D91F4: + mov r3, r9 + ldr r0, [r3] + ldr r0, [r0] + ldrb r1, [r0, 0x6] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080D9208 + bl _080DA100 +_080D9208: + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0x2F + strh r1, [r0, 0x8] + bl _080DA100 +_080D921A: + movs r0, 0x1 + bl sub_80DE008 + ldr r0, =0x03005e00 + mov r2, r8 + lsls r1, r2, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0xC + strh r0, [r1, 0x8] + bl _080DA100 + .pool +_080D9238: + mov r3, r9 + ldr r0, [r3] + ldr r1, [r0, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r0, r1 + movs r4, 0x2 + ldrsh r1, [r0, r4] + movs r0, 0 + adds r2, r6, 0 + bl sub_80DC028 + ldr r1, =0x03005e00 + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0xD + strh r1, [r0, 0x8] + bl _080DA100 + .pool +_080D926C: + mov r0, r9 + ldr r1, [r0] + ldr r0, [r1] + ldrb r0, [r0, 0x11] + ldr r1, [r1, 0x14] + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080D9288 + bl _080DA100 +_080D9288: + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0x23 + strh r1, [r0, 0x8] + bl _080DA100 +_080D929A: + mov r2, r9 + ldr r0, [r2] + ldr r1, [r0, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x10] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0x10 + bne _080D92B8 + movs r0, 0x8 + bl sub_80DD720 +_080D92B8: + ldr r0, =0x03005e00 + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x24 + strh r0, [r1, 0x8] + bl _080DA100 + .pool +_080D92D0: + mov r5, r9 + ldr r0, [r5] + ldr r0, [r0] + ldrb r1, [r0, 0x6] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080D92E4 + bl _080DA100 +_080D92E4: + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0x25 + strh r1, [r0, 0x8] + bl _080DA100 +_080D92F6: + adds r0, r6, 0 + movs r1, 0x1 + bl sub_80DB5B8 + lsls r0, 24 + cmp r0, 0 + beq _080D9320 + ldr r1, =0x03005e00 + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x1C] + movs r1, 0x26 + strh r1, [r0, 0x8] + bl _080DA100 + .pool +_080D9320: + ldr r0, =0x03005e00 + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + b _080D9354 + .pool +_080D9334: + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r1, r0, r4 + ldrh r0, [r1, 0x1C] + adds r0, 0x1 + strh r0, [r1, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + bgt _080D9350 + bl _080DA100 +_080D9350: + movs r0, 0 + strh r0, [r1, 0x1C] +_080D9354: + movs r0, 0x32 + strh r0, [r1, 0x8] + bl _080DA100 +_080D935C: + adds r0, r6, 0 + bl sub_80DB798 + lsls r0, 24 + cmp r0, 0 + beq _080D936E + movs r0, 0x63 + bl audio_play +_080D936E: + ldr r0, =0x03005e00 + mov r2, r8 + lsls r1, r2, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x19 + strh r0, [r1, 0x8] + bl _080DA100 + .pool +_080D9388: + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0 + strh r1, [r0, 0xA] + movs r1, 0x1A + strh r1, [r0, 0x8] + bl _080DA100 +_080D939E: + movs r3, 0 + movs r5, 0 + str r5, [sp] + mov r0, r8 + lsls r1, r0, 2 + adds r0, r1, r0 + lsls r0, 3 + adds r0, r4 + movs r2, 0xA + ldrsh r7, [r0, r2] + mov r10, r1 + cmp r7, 0x3 + bgt _080D9418 + ldr r5, =0x02039f26 + ldr r2, =0x02039f34 +_080D93BC: + movs r3, 0 + str r3, [sp] + adds r0, r3, 0 + cmp r0, r6 + beq _080D93E4 + ldrb r0, [r5] + cmp r0, r7 + bne _080D93E4 + ldr r0, [r2] + ldr r0, [r0, 0x4] + ldrb r0, [r0, 0x13] + cmp r0, 0xFF + beq _080D93E4 + movs r1, 0x1 + str r1, [sp] + b _080D940C + .pool +_080D93E4: + adds r3, 0x1 + cmp r3, 0x3 + bgt _080D940C + cmp r3, r6 + beq _080D93E4 + adds r0, r3, r5 + ldrb r0, [r0] + cmp r0, r7 + bne _080D93E4 + ldr r0, [r2] + ldr r1, [r0, 0x4] + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x13] + cmp r0, 0xFF + beq _080D93E4 + movs r0, 0x1 + str r0, [sp] +_080D940C: + ldr r1, [sp] + cmp r1, 0 + bne _080D9422 + adds r7, 0x1 + cmp r7, 0x3 + ble _080D93BC +_080D9418: + ldr r2, [sp] + lsls r0, r2, 24 + asrs r2, r0, 24 + cmp r2, 0 + beq _080D9464 +_080D9422: + mov r5, r10 + add r5, r8 + lsls r5, 3 + adds r5, r4 + ldr r0, =0x02039f26 + adds r0, r3, r0 + ldrb r0, [r0] + strh r0, [r5, 0xA] + lsls r0, r3, 24 + lsrs r0, 24 + mov r4, r9 + ldr r1, [r4] + ldr r1, [r1, 0x4] + lsls r4, r3, 3 + subs r4, r3 + lsls r4, 2 + adds r1, r4, r1 + ldrb r1, [r1, 0x13] + bl sub_80DD45C + mov r1, r9 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r4, r0 + movs r0, 0xFF + strb r0, [r4, 0x13] + movs r0, 0x1B + strh r0, [r5, 0x8] + bl _080DA100 + .pool +_080D9464: + mov r0, r10 + add r0, r8 + lsls r0, 3 + adds r0, r4 + strh r2, [r0, 0xA] + strh r2, [r0, 0x1C] + movs r1, 0x33 + strh r1, [r0, 0x8] + bl sub_80DB884 + bl _080DA100 +_080D947C: + bl sub_80DED4C + cmp r0, 0 + beq _080D9488 + bl _080DA100 +_080D9488: + ldr r0, =0x03005e00 + mov r2, r8 + lsls r1, r2, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1C + strh r0, [r1, 0x8] + bl _080DA100 + .pool +_080D94A0: + movs r7, 0 + mov r3, r8 + lsls r0, r3, 2 + adds r1, r0, r3 + lsls r1, 3 + adds r1, r4 + movs r4, 0xA + ldrsh r2, [r1, r4] + ldr r1, =0x02039f26 + mov r10, r0 + adds r5, r1, 0 + ldrb r0, [r5] + cmp r2, r0 + beq _080D94CA + adds r1, r2, 0 + adds r2, r5, 0 +_080D94C0: + adds r7, 0x1 + adds r0, r7, r2 + ldrb r0, [r0] + cmp r1, r0 + bne _080D94C0 +_080D94CA: + mov r1, r9 + ldr r0, [r1] + ldr r1, [r0, 0x4] + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0xE] + ldrh r0, [r0, 0x2] + adds r0, r1 + lsls r0, 16 + asrs r0, 16 + negs r1, r1 + lsls r2, r7, 24 + lsrs r2, 24 + bl sub_80DC028 + ldr r1, =0x03005e00 + mov r0, r10 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1D + strh r1, [r0, 0x8] + bl _080DA100 + .pool +_080D9508: + movs r7, 0 + mov r2, r8 + lsls r0, r2, 2 + adds r1, r0, r2 + lsls r1, 3 + adds r1, r4 + movs r5, 0xA + ldrsh r3, [r1, r5] + ldr r1, =0x02039f26 + mov r10, r0 + adds r5, r1, 0 + ldrb r0, [r5] + cmp r3, r0 + beq _080D952E +_080D9524: + adds r7, 0x1 + adds r0, r7, r1 + ldrb r0, [r0] + cmp r3, r0 + bne _080D9524 +_080D952E: + mov r1, r9 + ldr r0, [r1] + ldr r1, [r0, 0x14] + lsls r0, r7, 2 + adds r0, r1 + ldrb r1, [r0, 0x2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080D9546 + bl _080DA100 +_080D9546: + mov r0, r10 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0x27 + strh r1, [r0, 0x8] + bl _080DA100 + .pool +_080D955C: + movs r7, 0 + mov r2, r8 + lsls r0, r2, 2 + adds r1, r0, r2 + lsls r1, 3 + adds r1, r4 + movs r3, 0xA + ldrsh r2, [r1, r3] + ldr r1, =0x02039f26 + mov r10, r0 + adds r5, r1, 0 + ldrb r4, [r5] + cmp r2, r4 + beq _080D9586 + adds r1, r2, 0 + adds r2, r5, 0 +_080D957C: + adds r7, 0x1 + adds r0, r7, r2 + ldrb r0, [r0] + cmp r1, r0 + bne _080D957C +_080D9586: + lsls r0, r7, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_80DB5B8 + lsls r0, 24 + cmp r0, 0 + beq _080D95B4 + ldr r1, =0x03005e00 + mov r0, r10 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x1C] + movs r1, 0x28 + strh r1, [r0, 0x8] + bl _080DA100 + .pool +_080D95B4: + ldr r0, =0x03005e00 + mov r1, r10 + add r1, r8 + lsls r1, 3 + adds r1, r0 + b _080D95E4 + .pool +_080D95C4: + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r1, r0, r4 + ldrh r0, [r1, 0x1C] + adds r0, 0x1 + strh r0, [r1, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + bgt _080D95E0 + bl _080DA100 +_080D95E0: + movs r0, 0 + strh r0, [r1, 0x1C] +_080D95E4: + movs r0, 0x1E + strh r0, [r1, 0x8] + bl _080DA100 +_080D95EC: + movs r7, 0 + ldr r2, =0x02039f26 + ldrb r3, [r2] + mov r0, r8 + lsls r1, r0, 2 + adds r0, r1, r0 + lsls r0, 3 + adds r4, r0, r4 + movs r5, 0xA + ldrsh r0, [r4, r5] + mov r10, r1 + adds r5, r2, 0 + cmp r3, r0 + beq _080D961E + adds r3, r5, 0 + adds r2, r4, 0 +_080D960C: + adds r7, 0x1 + cmp r7, 0x3 + bgt _080D961E + adds r0, r7, r3 + ldrb r1, [r0] + movs r4, 0xA + ldrsh r0, [r2, r4] + cmp r1, r0 + bne _080D960C +_080D961E: + lsls r4, r7, 24 + lsrs r0, r4, 24 + bl sub_80DB798 + lsls r0, 24 + adds r6, r4, 0 + cmp r0, 0 + beq _080D963C + movs r0, 0x63 + bl audio_play + b _080D9642 + .pool +_080D963C: + movs r0, 0x64 + bl audio_play +_080D9642: + ldr r5, =0x02039f34 + ldr r0, [r5] + ldr r1, [r0, 0x4] + lsls r0, r7, 3 + subs r0, r7 + lsls r4, r0, 2 + adds r1, r4, r1 + ldrb r1, [r1, 0x15] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080D9670 + lsrs r0, r6, 24 + bl sub_80DC674 + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x15] + movs r0, 0x21 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x15] +_080D9670: + ldr r0, =0x03005e00 + mov r1, r10 + add r1, r8 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + movs r0, 0x1A + strh r0, [r1, 0x8] + bl _080DA100 + .pool +_080D9690: + mov r5, r8 + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 3 + adds r4, r0, r4 + ldrh r0, [r4, 0x1C] + adds r1, r0, 0x1 + strh r1, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + mov r10, r2 + cmp r0, 0x9 + bgt _080D96AE + bl _080DA100 +_080D96AE: + movs r0, 0 + strh r0, [r4, 0x1C] + mov r1, r9 + ldr r0, [r1] + ldr r1, [r0, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r2, r0, r1 + ldrb r1, [r2, 0xC] + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + bne _080D96D4 + ldrb r1, [r2, 0x11] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080D96F6 +_080D96D4: + bl sub_80DB89C + ldr r0, =0x02021cc4 + lsls r1, r6, 6 + ldr r2, =0x02039e02 + adds r1, r2 + bl CopyString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_0827E793 + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80DEC30 +_080D96F6: + ldr r0, =0x03005e00 + mov r1, r10 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x34 + strh r0, [r1, 0x8] + bl _080DA100 + .pool +_080D971C: + bl sub_80DED4C + cmp r0, 0 + beq _080D9728 + bl _080DA100 +_080D9728: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x15] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _080D975C + ldr r0, =0x03005e00 + mov r2, r8 + lsls r1, r2, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x11 + strh r0, [r1, 0x8] + bl _080DA100 + .pool +_080D975C: + ldr r0, =0x03005e00 + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0xE + strh r0, [r1, 0x8] + bl _080DA100 + .pool +_080D9774: + mov r4, r9 + ldr r0, [r4] + ldr r1, [r0, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x16] + lsls r4, r0, 24 + lsrs r5, r4, 24 + cmp r5, 0 + beq _080D97DC + bl sub_80DB89C + asrs r0, r4, 24 + cmp r0, 0x1 + bne _080D97A0 + ldr r0, =gUnknown_0827E32E + b _080D97A6 + .pool +_080D97A0: + cmp r0, 0x2 + bne _080D97B4 + ldr r0, =gUnknown_0827E35B +_080D97A6: + movs r1, 0x1 + bl sub_80DEC30 + b _080D97BC + .pool +_080D97B4: + ldr r0, =gUnknown_0827E38D + movs r1, 0x1 + bl sub_80DEC30 +_080D97BC: + movs r0, 0x3 + bl sub_80DD720 + ldr r1, =0x03005e00 + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x1C] + b _080D9812 + .pool +_080D97DC: + bl sub_80DB89C + ldr r0, =0x02021cc4 + lsls r1, r6, 6 + ldr r2, =0x02039e02 + adds r1, r2 + bl CopyString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_0827E2FE + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80DEC30 + movs r0, 0x2 + bl sub_80DD720 + ldr r1, =0x03005e00 + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x1C] +_080D9812: + movs r1, 0x2D + strh r1, [r0, 0x8] + bl _080DA100 + .pool +_080D9830: + mov r3, r9 + ldr r0, [r3] + ldr r2, [r0] + ldrb r1, [r2, 0x6] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080D9844 + bl _080DA100 +_080D9844: + ldrb r0, [r2, 0x11] + bl sub_80DC9B4 + ldr r1, =0x03005e00 + mov r4, r8 + lsls r0, r4, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0xF + strh r1, [r0, 0x8] + bl _080DA100 + .pool +_080D9864: + bl sub_80DED4C + cmp r0, 0 + beq _080D9870 + bl _080DA100 +_080D9870: + ldr r1, =0x03005e00 + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x32 + bgt _080D988E + bl _080DA100 +_080D988E: + ldr r7, =0x02039f34 + ldr r0, [r7] + ldr r1, [r0, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r5, r0, 2 + adds r2, r5, r1 + ldrb r1, [r2, 0x15] + movs r0, 0x10 + mov r8, r0 + ands r0, r1 + cmp r0, 0 + bne _080D98C2 + movs r1, 0x2 + ldrsh r0, [r2, r1] + ldrb r1, [r2, 0x17] + adds r2, r6, 0 + bl sub_80DC028 + ldr r0, [r7] + ldr r1, [r0, 0x4] + adds r1, r5, r1 + ldrh r0, [r1, 0x2] + ldrb r2, [r1, 0x17] + adds r0, r2 + strh r0, [r1, 0x2] +_080D98C2: + mov r3, r8 + strh r3, [r4, 0x8] + bl _080DA100 + .pool +_080D98D4: + mov r5, r9 + ldr r0, [r5] + ldr r1, [r0, 0x14] + lsls r0, r6, 2 + adds r0, r1 + ldrb r1, [r0, 0x2] + movs r0, 0x4 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _080D98F0 + bl _080DA100 +_080D98F0: + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + strh r1, [r0, 0x1C] + movs r1, 0x11 + strh r1, [r0, 0x8] + bl _080DA100 +_080D9904: + mov r3, r9 + ldr r0, [r3] + ldr r1, [r0, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x15] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080D996C + bl sub_80DB89C + ldr r0, =0x02021cc4 + lsls r1, r6, 6 + ldr r2, =0x02039e02 + adds r1, r2 + bl CopyString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_0827E6E3 + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80DEC30 + ldr r0, =0x03005e00 + mov r5, r8 + lsls r4, r5, 2 + add r4, r8 + lsls r4, 3 + adds r4, r0 + movs r0, 0 + strh r0, [r4, 0x1C] + bl sub_80DD720 + movs r0, 0x2E + strh r0, [r4, 0x8] + b _080DA100 + .pool +_080D996C: + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0x29 + strh r1, [r0, 0x8] + b _080DA100 +_080D997C: + mov r2, r9 + ldr r0, [r2] + ldr r0, [r0] + ldrb r1, [r0, 0x6] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080D998E + b _080DA100 +_080D998E: + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0x13 + strh r1, [r0, 0x8] + b _080DA100 +_080D999E: + bl sub_80DED4C + cmp r0, 0 + beq _080D99A8 + b _080DA100 +_080D99A8: + ldr r5, =0x02039f34 + ldr r0, [r5] + ldr r1, [r0, 0x4] + lsls r4, r6, 3 + subs r4, r6 + lsls r4, 2 + adds r1, r4, r1 + movs r2, 0x2 + ldrsh r0, [r1, r2] + ldrb r1, [r1, 0x18] + negs r1, r1 + adds r2, r6, 0 + bl sub_80DC028 + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r4, r0 + ldrb r1, [r4, 0x18] + ldrh r0, [r4, 0x2] + subs r0, r1 + strh r0, [r4, 0x2] + ldr r1, =0x03005e00 + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x12 + strh r1, [r0, 0x8] + b _080DA100 + .pool +_080D99EC: + bl sub_80DCD48 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0x14] + lsls r0, r6, 2 + adds r0, r1 + ldrb r1, [r0, 0x2] + movs r0, 0x4 + ands r0, r1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _080D9A0A + b _080DA100 +_080D9A0A: + ldr r0, =0x03005e00 + mov r5, r8 + lsls r4, r5, 2 + add r4, r8 + lsls r4, 3 + adds r4, r0 + strh r3, [r4, 0x1C] + bl sub_80DB89C + movs r0, 0x29 + strh r0, [r4, 0x8] + b _080DA100 + .pool +_080D9A2C: + mov r1, r9 + ldr r0, [r1] + ldr r2, [r0, 0x10] + ldrb r1, [r2, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080D9A56 + ldr r0, [r2] + lsls r0, 20 + lsrs r0, 29 + cmp r6, r0 + beq _080D9A56 + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0x39 + strh r1, [r0, 0x8] + b _080DA100 +_080D9A56: + mov r3, r9 + ldr r1, [r3] + ldr r0, [r1, 0x10] + ldrb r0, [r0] + str r0, [sp] + ldr r1, [r1, 0x4] + lsls r2, r6, 3 + subs r0, r2, r6 + lsls r0, 2 + adds r5, r0, r1 + ldrb r1, [r5, 0x11] + movs r0, 0x10 + ands r0, r1 + str r2, [sp, 0x4] + cmp r0, 0 + beq _080D9A94 + movs r4, 0x1 + str r4, [sp] + ldr r0, =0x02021ec4 + ldrh r2, [r5, 0x6] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + b _080D9AAE + .pool +_080D9A94: + ldr r0, =0x02021ec4 + ldr r3, =gUnknown_08587F08 + ldr r2, =gContestMoves + ldrh r1, [r5, 0x6] + lsls r1, 3 + adds r1, r2 + ldrb r1, [r1, 0x1] + lsls r1, 29 + lsrs r1, 27 + adds r1, r3 + ldr r1, [r1] + bl CopyString +_080D9AAE: + ldr r5, [sp] + lsls r0, r5, 24 + cmp r0, 0 + ble _080D9AD2 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0x4] + ldr r2, [sp, 0x4] + subs r0, r2, r6 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x15] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080D9AD2 + movs r3, 0 + str r3, [sp] +_080D9AD2: + bl sub_80DB89C + ldr r0, =0x02021cc4 + lsls r1, r6, 6 + ldr r2, =0x02039e02 + adds r1, r2 + bl CopyString + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r1, [r0] + ldrb r0, [r1, 0x13] + ldr r5, [sp] + lsls r2, r5, 24 + asrs r3, r2, 24 + adds r0, r3, r0 + strb r0, [r1, 0x13] + ldr r0, [r4] + ldr r1, [r0] + movs r0, 0x13 + ldrsb r0, [r1, r0] + adds r5, r2, 0 + cmp r0, 0 + bge _080D9B06 + movs r0, 0 + strb r0, [r1, 0x13] +_080D9B06: + cmp r3, 0 + bne _080D9B30 + ldr r0, =0x03005e00 + mov r2, r8 + lsls r1, r2, 2 + b _080D9F58 + .pool +_080D9B30: + cmp r3, 0 + bge _080D9B48 + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_0827E73C + bl ExpandStringRefs + b _080D9B74 + .pool +_080D9B48: + cmp r3, 0 + ble _080D9B6C + ldr r0, [r4] + ldr r0, [r0] + ldrb r0, [r0, 0x13] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x4 + bgt _080D9B6C + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_0827E717 + bl ExpandStringRefs + b _080D9B74 + .pool +_080D9B6C: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_0827E76A + bl ExpandStringRefs +_080D9B74: + ldr r0, =0x02021fc4 + movs r1, 0x1 + bl sub_80DEC30 + ldr r1, =0x03005e00 + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r1, r0, r1 + movs r0, 0 + strh r0, [r1, 0x1C] + strh r0, [r1, 0x1E] + cmp r5, 0 + bge _080D9BA4 + movs r0, 0x35 + strh r0, [r1, 0x8] + b _080DA100 + .pool +_080D9BA4: + movs r0, 0x36 + strh r0, [r1, 0x8] + b _080DA100 +_080D9BAA: + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r4, r0, r4 + movs r0, 0x1C + ldrsh r3, [r4, r0] + cmp r3, 0x1 + beq _080D9BE8 + cmp r3, 0x1 + bgt _080D9BC6 + cmp r3, 0 + beq _080D9BD0 + b _080DA100 +_080D9BC6: + cmp r3, 0x2 + beq _080D9C0C + cmp r3, 0x3 + beq _080D9C46 + b _080DA100 +_080D9BD0: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x1 + bl sub_80DDED0 + ldr r0, =0x00000187 + bl fanfare_play + b _080D9C3E + .pool +_080D9BE8: + mov r1, r9 + ldr r0, [r1] + ldr r0, [r0] + ldrb r0, [r0, 0x7] + ands r3, r0 + cmp r3, 0 + beq _080D9BF8 + b _080DA100 +_080D9BF8: + bl sub_80DED4C + cmp r0, 0 + beq _080D9C02 + b _080DA100 +_080D9C02: + movs r0, 0x1 + negs r0, r0 + bl sub_80DDCDC + b _080D9C3E +_080D9C0C: + mov r2, r9 + ldr r0, [r2] + ldr r0, [r0] + ldrb r1, [r0, 0x6] + movs r0, 0x20 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _080D9C22 + b _080DA100 +_080D9C22: + ldrh r0, [r4, 0x1E] + adds r1, r0, 0x1 + strh r1, [r4, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1D + bgt _080D9C32 + b _080DA100 +_080D9C32: + strh r2, [r4, 0x1E] + movs r1, 0x1 + negs r1, r1 + adds r0, r1, 0 + bl sub_80DDED0 +_080D9C3E: + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + b _080DA100 +_080D9C46: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080D9C58 + b _080DA100 +_080D9C58: + strh r0, [r4, 0x1C] + strh r0, [r4, 0x1E] + movs r0, 0x2B + strh r0, [r4, 0x8] + b _080DA100 + .pool +_080D9C68: + mov r3, r8 + lsls r1, r3, 2 + adds r0, r1, r3 + lsls r0, 3 + adds r0, r4 + movs r5, 0x1C + ldrsh r0, [r0, r5] + mov r10, r1 + cmp r0, 0x4 + bls _080D9C7E + b _080DA100 +_080D9C7E: + lsls r0, 2 + ldr r1, =_080D9C8C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080D9C8C: + .4byte _080D9CA0 + .4byte _080D9CB0 + .4byte _080D9CD4 + .4byte _080D9D3E + .4byte _080D9D84 +_080D9CA0: + bl sub_80DED4C + cmp r0, 0 + beq _080D9CAA + b _080DA100 +_080D9CAA: + movs r0, 0x1 + movs r1, 0x1 + b _080D9D68 +_080D9CB0: + mov r1, r9 + ldr r0, [r1] + ldr r0, [r0] + ldrb r1, [r0, 0x7] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080D9CC2 + b _080DA100 +_080D9CC2: + bl sub_80DDE0C + movs r0, 0xDF + bl audio_play + movs r0, 0x1 + bl sub_80DDCDC + b _080D9D6C +_080D9CD4: + mov r3, r9 + ldr r2, [r3] + ldr r0, [r2] + ldrb r1, [r0, 0x6] + movs r0, 0x20 + ands r0, r1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _080D9CEA + b _080DA100 +_080D9CEA: + mov r0, r10 + add r0, r8 + lsls r0, 3 + adds r5, r0, r4 + ldrh r0, [r5, 0x1E] + adds r1, r0, 0x1 + strh r1, [r5, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1D + bgt _080D9D02 + b _080DA100 +_080D9D02: + strh r3, [r5, 0x1E] + ldr r0, [r2, 0x4] + lsls r4, r6, 3 + subs r4, r6 + lsls r4, 2 + adds r0, r4, r0 + movs r1, 0x2 + ldrsh r0, [r0, r1] + ldr r1, [r2, 0x10] + ldrb r1, [r1, 0x2] + lsls r1, 24 + asrs r1, 24 + adds r2, r6, 0 + bl sub_80DC028 + mov r2, r9 + ldr r1, [r2] + ldr r0, [r1, 0x4] + adds r4, r0 + ldr r0, [r1, 0x10] + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + ldrh r3, [r4, 0x2] + adds r0, r3 + strh r0, [r4, 0x2] + ldrh r0, [r5, 0x1C] + adds r0, 0x1 + strh r0, [r5, 0x1C] + b _080DA100 +_080D9D3E: + mov r4, r9 + ldr r2, [r4] + ldr r1, [r2, 0x14] + lsls r0, r6, 2 + adds r0, r1 + ldrb r1, [r0, 0x2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080D9D54 + b _080DA100 +_080D9D54: + ldr r0, [r2] + ldrb r1, [r0, 0x6] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080D9D62 + b _080DA100 +_080D9D62: + movs r1, 0x1 + negs r1, r1 + movs r0, 0x1 +_080D9D68: + bl sub_80DDED0 +_080D9D6C: + ldr r0, =0x03005e00 + mov r1, r10 + add r1, r8 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x1C] + adds r0, 0x1 + strh r0, [r1, 0x1C] + b _080DA100 + .pool +_080D9D84: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _080D9D96 + b _080DA100 +_080D9D96: + mov r0, r10 + add r0, r8 + lsls r0, 3 + adds r0, r4 + strh r3, [r0, 0x1C] + strh r3, [r0, 0x1E] + movs r1, 0x2B + strh r1, [r0, 0x8] + b _080DA100 + .pool +_080D9DAC: + mov r5, r9 + ldr r0, [r5] + ldr r1, [r0, 0x14] + lsls r0, r6, 2 + adds r0, r1 + ldrb r1, [r0, 0x2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080D9DC2 + b _080DA100 +_080D9DC2: + bl sub_80DB89C + ldr r0, =0x03005e00 + mov r2, r8 + lsls r1, r2, 2 + b _080D9F58 + .pool +_080D9DD4: + bl sub_80DB89C + ldr r0, =0x02021ec4 + ldr r5, =0x02039f34 + ldr r1, [r5] + ldr r1, [r1, 0x10] + ldr r1, [r1] + lsls r1, 20 + lsrs r1, 29 + lsls r1, 6 + ldr r4, =0x02039e02 + adds r1, r4 + bl CopyString + ldr r0, =0x02021cc4 + lsls r1, r6, 6 + adds r1, r4 + bl CopyString + ldr r0, =0x02021dc4 + ldr r1, [r5] + ldr r2, [r1, 0x4] + lsls r1, r6, 3 + subs r1, r6 + lsls r1, 2 + adds r1, r2 + ldrh r2, [r1, 0x6] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_0827E7EA + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80DEC30 + ldr r1, =0x03005e00 + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x3A + strh r1, [r0, 0x8] + b _080DA100 + .pool +_080D9E60: + bl sub_80DED4C + cmp r0, 0 + beq _080D9E6A + b _080DA100 +_080D9E6A: + bl sub_80DB89C + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_0827E817 + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80DEC30 + ldr r1, =0x03005e00 + mov r4, r8 + lsls r0, r4, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x3B + strh r1, [r0, 0x8] + b _080DA100 + .pool +_080D9EA0: + bl sub_80DED4C + cmp r0, 0 + beq _080D9EAA + b _080DA100 +_080D9EAA: + bl sub_80DB89C + ldr r0, =0x03005e00 + mov r5, r8 + lsls r1, r5, 2 + b _080D9F58 + .pool +_080D9EBC: + mov r1, r9 + ldr r0, [r1] + ldr r1, [r0, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r4, r0, 2 + adds r2, r4, r1 + ldrb r1, [r2, 0x15] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080D9EDC + movs r0, 0x11 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x15] +_080D9EDC: + adds r0, r6, 0 + bl sub_80DC9B4 + ldr r0, =0x02021cc4 + lsls r1, r6, 6 + ldr r2, =0x02039e02 + adds r1, r2 + bl CopyString + ldr r0, =0x02021dc4 + mov r2, r9 + ldr r1, [r2] + ldr r1, [r1, 0x4] + adds r1, r4, r1 + ldrh r2, [r1, 0x6] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_0827E58A + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80DEC30 + ldr r1, =0x03005e00 + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x22 + strh r1, [r0, 0x8] + b _080DA100 + .pool +_080D9F48: + bl sub_80DED4C + cmp r0, 0 + beq _080D9F52 + b _080DA100 +_080D9F52: + ldr r0, =0x03005e00 + mov r4, r8 + lsls r1, r4, 2 +_080D9F58: + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x37 + strh r0, [r1, 0x8] + b _080DA100 + .pool +_080D9F68: + bl sub_80DDBE8 + ldr r0, =0x03005e00 + mov r5, r8 + lsls r1, r5, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x38 + strh r0, [r1, 0x8] + b _080DA100 + .pool +_080D9F84: + mov r1, r9 + ldr r0, [r1] + ldr r2, [r0] + ldrb r1, [r2, 0x6] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _080D9F9A + b _080DA100 +_080D9F9A: + movs r0, 0x13 + ldrsb r0, [r2, r0] + cmp r0, 0x4 + ble _080D9FA8 + strb r1, [r2, 0x13] + bl sub_80DD940 +_080D9FA8: + ldr r0, =0x03005e00 + mov r2, r8 + lsls r1, r2, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0xA + strh r0, [r1, 0x8] + b _080DA100 + .pool +_080D9FC0: + mov r3, r8 + lsls r2, r3, 2 + add r2, r8 + lsls r2, 3 + adds r2, r4 + ldrb r5, [r2, 0xC] + ldr r1, =0x02020630 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_80DA164 + str r1, [r0] + movs r0, 0xB + strh r0, [r2, 0x8] + b _080DA100 + .pool +_080D9FEC: + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r4, r0, r4 + ldrb r5, [r4, 0xC] + ldr r1, =0x02020630 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r6, r0, r1 + adds r0, r6, 0 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _080DA100 + adds r0, r6, 0 + bl obj_free_rotscale_entry + adds r0, r6, 0 + bl RemoveObjectAndFreeTiles + movs r0, 0x14 + strh r0, [r4, 0x8] + b _080DA100 + .pool +_080DA024: + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + movs r1, 0 + strh r1, [r0, 0x1C] + movs r1, 0x15 + strh r1, [r0, 0x8] + b _080DA100 +_080DA038: + bl sub_80DB89C + ldr r0, =0x02021cc4 + lsls r1, r6, 6 + ldr r2, =0x02039e02 + adds r1, r2 + bl CopyString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_0827D56F + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80DEC30 + ldr r1, =0x03005e00 + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x20 + strh r1, [r0, 0x8] + b _080DA100 + .pool +_080DA080: + bl sub_80DED4C + cmp r0, 0 + bne _080DA100 + ldr r0, =0x03005e00 + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x15 + strh r0, [r1, 0x8] + b _080DA100 + .pool +_080DA0A0: + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r1, r0, r4 + ldrh r0, [r1, 0x1C] + adds r0, 0x1 + strh r0, [r1, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1D + ble _080DA100 + movs r0, 0 + strh r0, [r1, 0x1C] + movs r0, 0x16 + strh r0, [r1, 0x8] + b _080DA100 +_080DA0C2: + mov r1, r9 + ldr r0, [r1] + ldr r1, [r0] + ldrb r0, [r1, 0x10] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1, 0x10] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _080DA0F4 + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + strh r2, [r0, 0x8] + strh r2, [r0, 0xA] + strh r2, [r0, 0xC] + ldr r1, =sub_80DA198 + str r1, [r0] + b _080DA100 + .pool +_080DA0F4: + mov r5, r8 + lsls r0, r5, 2 + add r0, r8 + lsls r0, 3 + adds r0, r4 + strh r2, [r0, 0x8] +_080DA100: + 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 sub_80D8B38 + + thumb_func_start sub_80DA110 +sub_80DA110: @ 80DA110 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02039f34 + ldr r1, [r1] + ldr r3, [r1] + ldrb r2, [r3, 0x7] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r3, 0x7] + bl DestroyTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA110 + + thumb_func_start sub_80DA134 +sub_80DA134: @ 80DA134 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x24] + movs r3, 0x24 + ldrsh r2, [r1, r3] + cmp r2, 0 + beq _080DA148 + subs r0, 0x2 + strh r0, [r1, 0x24] + b _080DA15C +_080DA148: + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _080DA15C + strh r2, [r1, 0x2E] + ldr r0, =DummyObjectCallback + str r0, [r1, 0x1C] +_080DA15C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA134 + + thumb_func_start sub_80DA164 +sub_80DA164: @ 80DA164 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x24] + subs r0, 0x6 + strh r0, [r2, 0x24] + movs r1, 0x20 + ldrsh r0, [r2, r1] + movs r3, 0x24 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bge _080DA18E + ldr r0, =DummyObjectCallback + str r0, [r2, 0x1C] + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_080DA18E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA164 + + thumb_func_start sub_80DA198 +sub_80DA198: @ 80DA198 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r5, r1, r2 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _080DA22E + cmp r0, 0x1 + bgt _080DA1C0 + cmp r0, 0 + beq _080DA1C6 + b _080DA250 + .pool +_080DA1C0: + cmp r0, 0x2 + beq _080DA248 + b _080DA250 +_080DA1C6: + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _080DA224 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0] + ldrb r0, [r2, 0x7] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x7] + bl sub_80DA8A4 + lsls r0, 24 + cmp r0, 0 + beq _080DA1F4 + bl sub_80DB944 + bl sub_80DBA18 +_080DA1F4: + ldr r4, =sub_80FCC88 + adds r0, r4, 0 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =sub_80DA110 + adds r1, r4, 0 + bl SetTaskFuncWithFollowupFunc + bl sub_80DBF68 + strh r6, [r5, 0x8] + b _080DA250 + .pool +_080DA224: + bl sub_80DB944 + bl sub_80DBA18 + b _080DA23E +_080DA22E: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0, 0x7] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080DA250 +_080DA23E: + movs r0, 0x2 + strh r0, [r5, 0x8] + b _080DA250 + .pool +_080DA248: + movs r0, 0 + strh r0, [r5, 0x8] + ldr r0, =sub_80DA25C + str r0, [r5] +_080DA250: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA198 + + thumb_func_start sub_80DA25C +sub_80DA25C: @ 80DA25C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + bl sub_80DE008 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] + strh r1, [r0, 0xA] + ldr r1, =sub_80DA28C + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA25C + + thumb_func_start sub_80DA28C +sub_80DA28C: @ 80DA28C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + movs r0, 0x8 + ldrsh r5, [r4, r0] + cmp r5, 0x1 + beq _080DA2D2 + cmp r5, 0x1 + bgt _080DA2B4 + cmp r5, 0 + beq _080DA2BA + b _080DA312 + .pool +_080DA2B4: + cmp r5, 0x2 + beq _080DA304 + b _080DA312 +_080DA2BA: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _080DA312 + movs r0, 0x2 + bl sub_80DE69C + strh r5, [r4, 0xA] + b _080DA2F6 +_080DA2D2: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0, 0x7] + movs r0, 0x2 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080DA312 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _080DA312 + strh r1, [r4, 0xA] +_080DA2F6: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080DA312 + .pool +_080DA304: + bl sub_80DC3AC + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0xA] + ldr r0, =sub_80DA31C + str r0, [r4] +_080DA312: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA28C + + thumb_func_start sub_80DA31C +sub_80DA31C: @ 80DA31C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80DC3C4 + lsls r0, 24 + cmp r0, 0 + beq _080DA33A + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80DA348 + str r0, [r1] +_080DA33A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA31C + + thumb_func_start sub_80DA348 +sub_80DA348: @ 80DA348 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x0201a204 + ldr r3, =0x02037714 + ldr r1, =0x040000d4 + str r2, [r1] + str r3, [r1, 0x4] + ldr r2, =0x84000100 + str r2, [r1, 0x8] + ldr r1, [r1, 0x8] + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x8] + movs r0, 0x2 + strh r0, [r1, 0xA] + ldr r0, =sub_80DA38C + str r0, [r1] + bx lr + .pool + thumb_func_end sub_80DA348 + + thumb_func_start sub_80DA38C +sub_80DA38C: @ 80DA38C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _080DA3BE + movs r0, 0 + strh r0, [r1, 0x8] + ldrh r0, [r1, 0xA] + subs r0, 0x1 + strh r0, [r1, 0xA] + lsls r0, 16 + cmp r0, 0 + bne _080DA3BE + ldr r0, =sub_80DA3CC + str r0, [r1] +_080DA3BE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA38C + + thumb_func_start sub_80DA3CC +sub_80DA3CC: @ 80DA3CC + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r6, r1, r2 + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _080DA448 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r5, =0x02039f25 + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r4, [r0, 0x1A] + bl sub_80DB89C + ldr r0, =0x02021cc4 + ldrb r1, [r5] + lsls r1, 6 + ldr r2, =0x02039e02 + adds r1, r2 + bl CopyString + ldr r5, =0x02021fc4 + ldr r0, =gUnknown_08587D90 + lsls r4, 2 + adds r4, r0 + ldr r1, [r4] + adds r0, r5, 0 + bl ExpandStringRefs + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80DEC30 + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + b _080DA45A + .pool +_080DA448: + bl sub_80DED4C + cmp r0, 0 + bne _080DA45A + strh r0, [r6, 0x8] + ldr r0, =sub_80DA464 + str r0, [r6] + bl sub_80DCD48 +_080DA45A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA3CC + + thumb_func_start sub_80DA464 +sub_80DA464: @ 80DA464 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x8] + adds r1, r0, 0x1 + strh r1, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1D + ble _080DA48E + movs r0, 0 + strh r0, [r4, 0x8] + bl sub_80DC3AC + ldr r0, =sub_80DA49C + str r0, [r4] +_080DA48E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA464 + + thumb_func_start sub_80DA49C +sub_80DA49C: @ 80DA49C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80DC3C4 + lsls r0, 24 + cmp r0, 0 + beq _080DA4BE + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] + ldr r1, =sub_80DA4CC + str r1, [r0] +_080DA4BE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA49C + + thumb_func_start sub_80DA4CC +sub_80DA4CC: @ 80DA4CC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_80DE224 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80DE424 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA4CC + + thumb_func_start sub_80DA4F4 +sub_80DA4F4: @ 80DA4F4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_80DE350 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80DA51C + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA4F4 + + thumb_func_start sub_80DA51C +sub_80DA51C: @ 80DA51C + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x8 + bl GetGpuReg + mov r1, sp + strh r0, [r1] + movs r0, 0xC + bl GetGpuReg + mov r4, sp + adds r4, 0x2 + strh r0, [r4] + mov r3, sp + ldrb r2, [r3] + movs r1, 0x4 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3] + ldrb r0, [r4] + ands r1, r0 + strb r1, [r4] + mov r0, sp + ldrh r1, [r0] + movs r0, 0x8 + bl SetGpuReg + ldrh r1, [r4] + movs r0, 0xC + bl SetGpuReg + ldr r2, =0x02039f34 + ldr r0, [r2] + ldr r1, [r0] + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] + ldr r0, [r2] + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x5 + bne _080DA590 + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80DA5E8 + b _080DA5A0 + .pool +_080DA590: + bl sub_80DDB0C + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80DA5B4 +_080DA5A0: + str r0, [r1] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA51C + + thumb_func_start sub_80DA5B4 +sub_80DA5B4: @ 80DA5B4 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0, 0x6] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _080DA5D8 + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80D833C + str r0, [r1] +_080DA5D8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA5B4 + + thumb_func_start sub_80DA5E8 +sub_80DA5E8: @ 80DA5E8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02022e16 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e1e + strh r1, [r0] + ldr r4, =0x02039f34 + movs r3, 0 + ldr r2, =0x02039f10 + movs r1, 0x3 +_080DA600: + ldr r0, [r4] + ldr r0, [r0, 0x4] + adds r0, r3, r0 + ldrh r0, [r0, 0x4] + strh r0, [r2] + adds r3, 0x1C + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _080DA600 + bl sub_80DBD18 + bl sub_80DB89C + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080DA65C + ldr r0, =0x02039f34 + ldr r2, [r0] + ldr r0, =0x02039f25 + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x8] + bl sub_80ED03C + b _080DA668 + .pool +_080DA65C: + bl sub_80DF250 + bl sub_80DF4F8 + bl sub_80DF750 +_080DA668: + ldr r1, =0x030060b8 + ldr r0, =0x03005d80 + ldr r0, [r0] + str r0, [r1] + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_0827D597 + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80DEC30 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xC] + ldr r1, =sub_80DA6B4 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA5E8 + + thumb_func_start sub_80DA6B4 +sub_80DA6B4: @ 80DA6B4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_80DED4C + adds r4, r0, 0 + cmp r4, 0 + bne _080DA6EA + bl sub_80DE224 + ldr r0, =0x02022e18 + strh r4, [r0] + ldr r1, =0x02022e1a + movs r0, 0xA0 + strh r0, [r1] + movs r0, 0x62 + movs r1, 0 + bl audio_play_and_stuff + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0x8] + ldr r1, =sub_80DA700 + str r1, [r0] +_080DA6EA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA6B4 + + thumb_func_start sub_80DA700 +sub_80DA700: @ 80DA700 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, =0x02022e1a + ldrh r0, [r1] + subs r0, 0x7 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + bge _080DA718 + movs r0, 0 + strh r0, [r1] +_080DA718: + ldrh r2, [r1] + cmp r2, 0 + bne _080DA72E + ldr r0, =0x03005e00 + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80DA740 + str r0, [r1] + strh r2, [r1, 0x8] +_080DA72E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA700 + + thumb_func_start sub_80DA740 +sub_80DA740: @ 80DA740 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x8] + adds r1, r0, 0x1 + strh r1, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x31 + ble _080DA794 + movs r0, 0 + strh r0, [r4, 0x8] + ldr r0, =0x02039f2a + ldrb r0, [r0] + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _080DA780 + ldr r0, =sub_80DA7A0 + b _080DA792 + .pool +_080DA780: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_80DA830 +_080DA792: + str r0, [r4] +_080DA794: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA740 + + thumb_func_start sub_80DA7A0 +sub_80DA7A0: @ 80DA7A0 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =sub_80FCACC + adds r0, r5, 0 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =sub_80DA7EC + adds r1, r5, 0 + bl SetTaskFuncWithFollowupFunc + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =TaskDummy1 + str r1, [r0] + bl sub_80DBF68 + movs r0, 0 + bl sub_80DC490 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA7A0 + + thumb_func_start sub_80DA7EC +sub_80DA7EC: @ 80DA7EC + push {lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r2, =0x03005e00 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0, 0x8] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, =sub_80DA830 + str r1, [r0] + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA7EC + + thumb_func_start sub_80DA830 +sub_80DA830: @ 80DA830 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080DA860 + adds r0, r2, 0 + bl DestroyTask + ldr r0, =0x03005dac + ldr r1, =sub_80DA874 + str r1, [r0] + bl FreeAllWindowBuffers + bl sub_80D7A5C + bl sub_805F094 + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 +_080DA860: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA830 + + thumb_func_start sub_80DA874 +sub_80DA874: @ 80DA874 + push {lr} + bl script_env_2_disable + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_80DA874 + + thumb_func_start sub_80DA884 +sub_80DA884: @ 80DA884 + push {lr} + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080DA898 + ldr r1, =0x02039f25 + movs r0, 0x3 + strb r0, [r1] +_080DA898: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA884 + + thumb_func_start sub_80DA8A4 +sub_80DA8A4: @ 80DA8A4 + push {lr} + ldr r0, =0x02039f25 + ldr r1, =0x02039f2b + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + beq _080DA8C0 + movs r0, 0 + b _080DA8C2 + .pool +_080DA8C0: + movs r0, 0x1 +_080DA8C2: + pop {r1} + bx r1 + thumb_func_end sub_80DA8A4 + + thumb_func_start sub_80DA8C8 +sub_80DA8C8: @ 80DA8C8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r6, =0x03005d90 + ldr r1, [r6] + mov r0, sp + bl CopyString + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080DA8F2 + mov r0, sp + bl sub_80DF9D4 +_080DA8F2: + ldr r5, =0x02039f25 + ldrb r0, [r5] + lsls r0, 6 + ldr r4, =0x02039e0d + adds r0, r4 + mov r1, sp + movs r2, 0x8 + bl memcpy + ldr r0, [r6] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _080DA928 + ldrb r0, [r5] + lsls r0, 6 + adds r0, r4, r0 + movs r1, 0xD8 + b _080DA930 + .pool +_080DA928: + ldrb r0, [r5] + lsls r0, 6 + adds r0, r4, r0 + movs r1, 0xD9 +_080DA930: + strb r1, [r0, 0x8] + ldr r7, =0x02039e00 + ldr r6, =0x02039f25 + ldrb r0, [r6] + lsls r0, 6 + adds r1, r7, 0 + adds r1, 0x18 + adds r0, r1 + movs r1, 0 + str r1, [r0] + ldrb r0, [r6] + lsls r0, 6 + adds r0, r7 + adds r0, 0x2C + strb r1, [r0] + movs r0, 0x64 + mov r1, r8 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r1, r7 + strh r0, [r1] + adds r0, r5, 0 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + mov r0, sp + bl GetStringEnd_Limit7 + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080DA994 + adds r0, r5, 0 + movs r1, 0x3 + bl pokemon_getattr + adds r1, r0, 0 + mov r0, sp + bl sub_80DF9E0 +_080DA994: + ldrb r0, [r6] + lsls r0, 6 + adds r4, r7, 0x2 + adds r0, r4 + mov r1, sp + movs r2, 0xB + bl memcpy + ldrb r0, [r6] + lsls r0, 6 + adds r0, r4 + mov r1, sp + bl CopyString + adds r0, r5, 0 + movs r1, 0x16 + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r1, r7 + adds r1, 0x26 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x17 + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r1, r7 + adds r1, 0x27 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x18 + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r1, r7 + adds r1, 0x28 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x21 + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r1, r7 + adds r1, 0x29 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x2F + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r1, r7 + adds r1, 0x2A + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x30 + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r1, r7 + adds r1, 0x2B + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0xD + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r1, r7 + strh r0, [r1, 0x1E] + adds r0, r5, 0 + movs r1, 0xE + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r1, r7 + strh r0, [r1, 0x20] + adds r0, r5, 0 + movs r1, 0xF + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r1, r7 + strh r0, [r1, 0x22] + adds r0, r5, 0 + movs r1, 0x10 + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r1, r7 + strh r0, [r1, 0x24] + adds r0, r5, 0 + movs r1, 0 + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r2, r7, 0 + adds r2, 0x38 + adds r1, r2 + str r0, [r1] + adds r0, r5, 0 + movs r1, 0x1 + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 6 + adds r2, r7, 0 + adds r2, 0x3C + adds r1, r2 + str r0, [r1] + adds r0, r5, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r2, r0, 16 + ldrb r0, [r6] + lsls r0, 6 + adds r1, r0, r7 + adds r0, r1, 0 + adds r0, 0x26 + ldrb r3, [r0] + adds r0, 0x1 + ldrb r5, [r0] + adds r0, 0x1 + ldrb r6, [r0] + adds r0, 0x1 + ldrb r7, [r0] + adds r0, 0x1 + ldrb r4, [r0] + cmp r2, 0xFE + bne _080DAAC4 + adds r3, 0x14 + b _080DAB12 + .pool +_080DAAC4: + cmp r2, 0xFF + bne _080DAAD4 + lsls r0, r5, 16 + movs r1, 0xA0 + lsls r1, 13 + adds r0, r1 + lsrs r5, r0, 16 + b _080DAB12 +_080DAAD4: + movs r0, 0x80 + lsls r0, 1 + cmp r2, r0 + bne _080DAAE8 + lsls r0, r6, 16 + movs r1, 0xA0 + lsls r1, 13 + adds r0, r1 + lsrs r6, r0, 16 + b _080DAB12 +_080DAAE8: + ldr r0, =0x00000101 + cmp r2, r0 + bne _080DAB00 + lsls r0, r7, 16 + movs r1, 0xA0 + lsls r1, 13 + adds r0, r1 + lsrs r7, r0, 16 + b _080DAB12 + .pool +_080DAB00: + movs r0, 0x81 + lsls r0, 1 + cmp r2, r0 + bne _080DAB12 + lsls r0, r4, 16 + movs r1, 0xA0 + lsls r1, 13 + adds r0, r1 + lsrs r4, r0, 16 +_080DAB12: + cmp r3, 0xFF + ble _080DAB18 + movs r3, 0xFF +_080DAB18: + lsls r0, r5, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _080DAB22 + movs r5, 0xFF +_080DAB22: + lsls r0, r6, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _080DAB2C + movs r6, 0xFF +_080DAB2C: + lsls r0, r7, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _080DAB36 + movs r7, 0xFF +_080DAB36: + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _080DAB40 + movs r4, 0xFF +_080DAB40: + ldr r2, =0x02039e00 + ldr r1, =0x02039f25 + ldrb r0, [r1] + lsls r0, 6 + adds r0, r2 + adds r0, 0x26 + strb r3, [r0] + ldrb r0, [r1] + lsls r0, 6 + adds r0, r2 + adds r0, 0x27 + strb r5, [r0] + ldrb r0, [r1] + lsls r0, 6 + adds r0, r2 + adds r0, 0x28 + strb r6, [r0] + ldrb r0, [r1] + lsls r0, 6 + adds r0, r2 + adds r0, 0x29 + strb r7, [r0] + ldrb r0, [r1] + lsls r0, 6 + adds r0, r2 + adds r0, 0x2A + strb r4, [r0] + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DA8C8 + + thumb_func_start sub_80DAB8C +sub_80DAB8C: @ 80DAB8C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x64 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + movs r6, 0 + movs r7, 0 + bl sub_80DA884 + ldr r0, =0x00000864 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _080DABC0 + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080DABC0 + movs r7, 0x1 +_080DABC0: + movs r5, 0 + ldr r2, =gUnknown_085880A4 + ldr r3, =gUnknown_085898A4 +_080DABC6: + ldrb r0, [r2, 0x1C] + lsls r0, 30 + lsrs r0, 30 + cmp r8, r0 + bne _080DAC3A + cmp r7, 0x1 + bne _080DABEC + ldrb r0, [r3] + cmp r0, 0x1 + beq _080DAC3A + b _080DABF2 + .pool +_080DABEC: + ldrb r0, [r3] + cmp r0, 0x2 + beq _080DAC3A +_080DABF2: + cmp r4, 0 + bne _080DABFE + ldrb r0, [r2, 0x1C] + lsls r0, 29 + cmp r0, 0 + blt _080DAC2E +_080DABFE: + cmp r4, 0x1 + bne _080DAC0A + ldrb r0, [r2, 0x1C] + lsls r0, 28 + cmp r0, 0 + blt _080DAC2E +_080DAC0A: + cmp r4, 0x2 + bne _080DAC16 + ldrb r0, [r2, 0x1C] + lsls r0, 27 + cmp r0, 0 + blt _080DAC2E +_080DAC16: + cmp r4, 0x3 + bne _080DAC22 + ldrb r0, [r2, 0x1C] + lsls r0, 26 + cmp r0, 0 + blt _080DAC2E +_080DAC22: + cmp r4, 0x4 + bne _080DAC3A + ldrb r0, [r2, 0x1C] + lsls r0, 25 + cmp r0, 0 + bge _080DAC3A +_080DAC2E: + adds r0, r6, 0 + adds r1, r0, 0x1 + lsls r1, 24 + lsrs r6, r1, 24 + add r0, sp + strb r5, [r0] +_080DAC3A: + adds r2, 0x40 + adds r3, 0x1 + adds r5, 0x1 + cmp r5, 0x5F + bls _080DABC6 + mov r0, sp + adds r1, r0, r6 + movs r0, 0xFF + strb r0, [r1] + movs r5, 0 + ldr r7, =gUnknown_085880A4 +_080DAC50: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x02039e00 + lsls r2, r5, 6 + adds r2, r1 + mov r1, sp + adds r4, r1, r0 + ldrb r1, [r4] + lsls r1, 6 + adds r1, r7 + adds r0, r2, 0 + movs r2, 0x40 + bl memcpy + ldrb r0, [r4] + adds r2, r5, 0x1 + subs r1, r6, 0x1 + cmp r0, 0xFF + beq _080DAC92 + adds r3, r4, 0 +_080DAC86: + ldrb r0, [r3, 0x1] + strb r0, [r3] + adds r3, 0x1 + ldrb r0, [r3] + cmp r0, 0xFF + bne _080DAC86 +_080DAC92: + lsls r0, r1, 24 + lsrs r6, r0, 24 + adds r5, r2, 0 + cmp r5, 0x2 + ble _080DAC50 + ldr r0, =0x02039f24 + ldrb r0, [r0] + bl sub_80DA8C8 + add sp, 0x64 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DAB8C + + thumb_func_start sub_80DACBC +sub_80DACBC: @ 80DACBC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x64 + mov r8, r2 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r2, r1, 24 + movs r7, 0 + ldr r0, =0x02039f30 + ldrb r1, [r0] + mov r9, r0 + cmp r1, 0x4 + bne _080DACDE + b _080DADF6 +_080DACDE: + movs r5, 0 + ldr r3, =gUnknown_085880A4 + ldr r6, =gUnknown_085898A4 +_080DACE4: + ldrb r0, [r3, 0x1C] + lsls r0, 30 + lsrs r0, 30 + cmp r2, r0 + bne _080DAD56 + mov r0, r8 + cmp r0, 0x1 + bne _080DAD08 + ldrb r0, [r6] + cmp r0, 0x1 + beq _080DAD56 + b _080DAD0E + .pool +_080DAD08: + ldrb r0, [r6] + cmp r0, 0x2 + beq _080DAD56 +_080DAD0E: + cmp r4, 0 + bne _080DAD1A + ldrb r0, [r3, 0x1C] + lsls r0, 29 + cmp r0, 0 + blt _080DAD4A +_080DAD1A: + cmp r4, 0x1 + bne _080DAD26 + ldrb r0, [r3, 0x1C] + lsls r0, 28 + cmp r0, 0 + blt _080DAD4A +_080DAD26: + cmp r4, 0x2 + bne _080DAD32 + ldrb r0, [r3, 0x1C] + lsls r0, 27 + cmp r0, 0 + blt _080DAD4A +_080DAD32: + cmp r4, 0x3 + bne _080DAD3E + ldrb r0, [r3, 0x1C] + lsls r0, 26 + cmp r0, 0 + blt _080DAD4A +_080DAD3E: + cmp r4, 0x4 + bne _080DAD56 + ldrb r0, [r3, 0x1C] + lsls r0, 25 + cmp r0, 0 + bge _080DAD56 +_080DAD4A: + adds r0, r7, 0 + adds r1, r0, 0x1 + lsls r1, 24 + lsrs r7, r1, 24 + add r0, sp + strb r5, [r0] +_080DAD56: + adds r3, 0x40 + adds r6, 0x1 + adds r5, 0x1 + cmp r5, 0x5F + bls _080DACE4 + mov r3, sp + adds r1, r3, r7 + movs r0, 0xFF + strb r0, [r1] + movs r5, 0 + mov r0, r9 + ldrb r1, [r0] + movs r0, 0x4 + subs r0, r1 + cmp r5, r0 + bge _080DADF6 + ldr r3, =0x02039e00 + mov r8, r3 + mov r6, r9 + movs r0, 0x2 + add r0, r8 + mov r9, r0 +_080DAD82: + bl sub_80F903C + lsls r0, 16 + lsrs r0, 16 + adds r1, r7, 0 + bl __modsi3 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldrb r0, [r6] + adds r0, r5 + lsls r0, 6 + add r0, r8 + ldr r2, =gUnknown_085880A4 + mov r3, sp + adds r4, r3, r1 + ldrb r1, [r4] + lsls r1, 6 + adds r1, r2 + movs r2, 0x40 + bl memcpy + ldrb r0, [r6] + adds r0, r5 + lsls r0, 6 + mov r1, r8 + adds r1, 0xD + adds r0, r1 + bl sub_80DF9D4 + ldrb r0, [r6] + adds r0, r5 + lsls r0, 6 + add r0, r9 + movs r1, 0x2 + bl sub_80DF9E0 + ldrb r0, [r4] + adds r3, r5, 0x1 + subs r1, r7, 0x1 + cmp r0, 0xFF + beq _080DADE6 + adds r2, r4, 0 +_080DADDA: + ldrb r0, [r2, 0x1] + strb r0, [r2] + adds r2, 0x1 + ldrb r0, [r2] + cmp r0, 0xFF + bne _080DADDA +_080DADE6: + lsls r0, r1, 24 + lsrs r7, r0, 24 + adds r5, r3, 0 + ldrb r1, [r6] + movs r0, 0x4 + subs r0, r1 + cmp r5, r0 + blt _080DAD82 +_080DADF6: + add sp, 0x64 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DACBC + + thumb_func_start sub_80DAE0C +sub_80DAE0C: @ 80DAE0C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + beq _080DAE1E + movs r0, 0x3 + b _080DAE9A +_080DAE1E: + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _080DAE2E + movs r0, 0x4 + b _080DAE9A +_080DAE2E: + ldr r0, =0x02039f2c + ldrh r0, [r0] + cmp r0, 0x4 + bhi _080DAE82 + lsls r0, 2 + ldr r1, =_080DAE48 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080DAE48: + .4byte _080DAE5C + .4byte _080DAE62 + .4byte _080DAE68 + .4byte _080DAE6E + .4byte _080DAE74 +_080DAE5C: + adds r0, r4, 0 + movs r1, 0x32 + b _080DAE78 +_080DAE62: + adds r0, r4, 0 + movs r1, 0x33 + b _080DAE78 +_080DAE68: + adds r0, r4, 0 + movs r1, 0x34 + b _080DAE78 +_080DAE6E: + adds r0, r4, 0 + movs r1, 0x35 + b _080DAE78 +_080DAE74: + adds r0, r4, 0 + movs r1, 0x36 +_080DAE78: + bl pokemon_getattr + lsls r0, 24 + lsrs r1, r0, 24 + b _080DAE86 +_080DAE82: + movs r0, 0 + b _080DAE9A +_080DAE86: + ldr r0, =0x02039f2e + adds r2, r1, 0 + ldrh r1, [r0] + movs r0, 0x2 + cmp r2, r1 + bhi _080DAE9A + movs r0, 0 + cmp r2, r1 + bcc _080DAE9A + movs r0, 0x1 +_080DAE9A: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80DAE0C + + thumb_func_start sub_80DAEA4 +sub_80DAEA4: @ 80DAEA4 + push {r4,r5,lr} + movs r5, 0 +_080DAEA8: + ldr r0, =0x02039f26 + adds r0, r5, r0 + ldrb r0, [r0] + movs r1, 0 + bl FillWindowPixelBuffer + lsls r4, r5, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_80DAF04 + adds r0, r4, 0 + bl sub_80DAF88 + adds r5, 0x1 + cmp r5, 0x3 + ble _080DAEA8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DAEA4 + + thumb_func_start sub_80DAED4 +sub_80DAED4: @ 80DAED4 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r4, r1, 24 + lsrs r4, 24 + ldr r0, =0x02022e2c + ldr r1, =gUnknown_085ED1AB + bl CopyString + adds r1, r0, 0 + subs r0, r1, 0x1 + strb r4, [r0] + adds r0, r1, 0 + adds r1, r5, 0 + bl CopyString + adds r1, r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80DAED4 + + thumb_func_start sub_80DAF04 +sub_80DAF04: @ 80DAF04 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r0, r1, 24 + movs r2, 0xA0 + lsls r2, 20 + adds r1, r2 + lsrs r1, 24 + bl sub_80DAF1C + pop {r0} + bx r0 + thumb_func_end sub_80DAF04 + + thumb_func_start sub_80DAF1C +sub_80DAF1C: @ 80DAF1C + push {r4,r5,lr} + sub sp, 0x24 + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =gUnknown_085E8D3E + add r0, sp, 0x4 + bl CopyString + lsls r1, r5, 6 + ldr r0, =0x02039e0d + adds r1, r0 + add r0, sp, 0x4 + bl AppendString + add r0, sp, 0x4 + adds r1, r4, 0 + bl sub_80DAED4 + ldr r4, =0x02022e2c + movs r0, 0x7 + adds r1, r4, 0 + movs r2, 0x60 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + cmp r2, 0x37 + ble _080DAF5C + movs r2, 0x37 +_080DAF5C: + ldr r0, =0x02039f26 + adds r0, r5, r0 + ldrb r0, [r0] + movs r1, 0x7 + str r1, [sp] + adds r1, r4, 0 + movs r3, 0x1 + bl sub_80DEBD0 + add sp, 0x24 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DAF1C + + thumb_func_start sub_80DAF88 +sub_80DAF88: @ 80DAF88 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r0, r1, 24 + movs r2, 0xA0 + lsls r2, 20 + adds r1, r2 + lsrs r1, 24 + bl sub_80DAFA0 + pop {r0} + bx r0 + thumb_func_end sub_80DAF88 + + thumb_func_start sub_80DAFA0 +sub_80DAFA0: @ 80DAFA0 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r4, 6 + ldr r2, =0x02039e02 + adds r0, r2 + bl sub_80DAED4 + ldr r0, =0x02039f26 + adds r4, r0 + ldrb r0, [r4] + ldr r1, =0x02022e2c + movs r2, 0x7 + str r2, [sp] + movs r2, 0x5 + movs r3, 0x1 + bl sub_80DEBD0 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DAFA0 + + thumb_func_start sub_80DAFE0 +sub_80DAFE0: @ 80DAFE0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r0, r1, 24 + cmp r0, 0x4 + bhi _080DB06C + lsls r0, 2 + ldr r1, =_080DAFFC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080DAFFC: + .4byte _080DB010 + .4byte _080DB028 + .4byte _080DB040 + .4byte _080DB050 + .4byte _080DB06C +_080DB010: + ldr r0, =0x02039e00 + lsls r2, 6 + adds r1, r2, r0 + adds r3, r1, 0 + adds r3, 0x26 + ldrb r5, [r3] + adds r3, 0x4 + ldrb r4, [r3] + adds r1, 0x27 + b _080DB07E + .pool +_080DB028: + ldr r0, =0x02039e00 + lsls r2, 6 + adds r1, r2, r0 + adds r3, r1, 0 + adds r3, 0x27 + ldrb r5, [r3] + subs r3, 0x1 + ldrb r4, [r3] + adds r1, 0x28 + b _080DB07E + .pool +_080DB040: + ldr r1, =0x02039e00 + lsls r2, 6 + adds r3, r2, r1 + adds r0, r3, 0 + adds r0, 0x28 + b _080DB05A + .pool +_080DB050: + ldr r1, =0x02039e00 + lsls r2, 6 + adds r3, r2, r1 + adds r0, r3, 0 + adds r0, 0x29 +_080DB05A: + ldrb r5, [r0] + subs r0, 0x1 + ldrb r4, [r0] + adds r0, 0x2 + ldrb r3, [r0] + adds r0, r1, 0 + b _080DB080 + .pool +_080DB06C: + ldr r0, =0x02039e00 + lsls r2, 6 + adds r1, r2, r0 + adds r3, r1, 0 + adds r3, 0x2A + ldrb r5, [r3] + subs r3, 0x1 + ldrb r4, [r3] + adds r1, 0x26 +_080DB07E: + ldrb r3, [r1] +_080DB080: + adds r1, r2, r0 + adds r1, 0x2B + adds r0, r4, r3 + ldrb r1, [r1] + adds r0, r1 + asrs r0, 1 + adds r0, r5, r0 + lsls r0, 16 + lsrs r0, 16 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80DAFE0 + + thumb_func_start sub_80DB09C +sub_80DB09C: @ 80DB09C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + ldr r5, =0x02039f00 +_080DB0A6: + lsls r0, r4, 24 + lsrs r0, 24 + adds r1, r6, 0 + bl sub_80DAFE0 + strh r0, [r5] + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _080DB0A6 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DB09C + + thumb_func_start sub_80DB0C4 +sub_80DB0C4: @ 80DB0C4 + push {r4,r5,lr} + ldr r0, =gUnknown_08587C00 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_08C1C6B8 + movs r1, 0x88 + lsls r1, 1 + movs r2, 0x20 + bl decompress_palette + ldr r0, =gUnknown_08587BE8 + movs r1, 0x70 + movs r2, 0x24 + movs r3, 0x1E + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r5, r2, r4 + ldrb r3, [r5, 0x5] + movs r1, 0xF + ands r1, r3 + movs r3, 0x10 + orrs r1, r3 + strb r1, [r5, 0x5] + adds r4, 0x1C + adds r2, r4 + ldr r1, =DummyObjectCallback + str r1, [r2] + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80DB0C4 + + thumb_func_start sub_80DB120 +sub_80DB120: @ 80DB120 + push {lr} + ldr r0, =gUnknown_08587C08 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_08587C10 + bl LoadCompressedObjectPalette + ldr r0, =gUnknown_08587C18 + movs r1, 0x60 + movs r2, 0xA + movs r3, 0x1D + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + movs r1, 0x3E + adds r1, r2 + mov r12, r1 + ldrb r1, [r1] + movs r3, 0x4 + orrs r1, r3 + mov r3, r12 + strb r1, [r3] + ldrh r1, [r2, 0x4] + lsls r1, 22 + lsrs r1, 22 + strh r1, [r2, 0x2E] + pop {r1} + bx r1 + .pool + thumb_func_end sub_80DB120 + + thumb_func_start sub_80DB174 +sub_80DB174: @ 80DB174 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r1, 0 + adds r6, r2, 0 + adds r4, r3, 0 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r5, 0 + bl sub_80DE84C + adds r5, r0, 0 + ldr r0, =0x02039f25 + ldrb r0, [r0] + cmp r4, r0 + bne _080DB1B8 + lsls r0, r5, 3 + ldr r1, =gMonBackPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + ldr r1, [r1, 0x4] + adds r2, r5, 0 + adds r3, r6, 0 + bl DecompressMonPic_DetectFrontOrBack_2 + b _080DB1CC + .pool +_080DB1B8: + lsls r0, r5, 3 + ldr r1, =gMonBackPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + ldr r1, [r1, 0x4] + adds r2, r5, 0 + adds r3, r6, 0 + bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack +_080DB1CC: + adds r0, r5, 0 + adds r1, r7, 0 + adds r2, r6, 0 + bl species_and_otid_get_pal + movs r1, 0x90 + lsls r1, 1 + movs r2, 0x20 + bl decompress_palette + adds r0, r5, 0 + movs r1, 0 + bl sub_806A068 + ldr r4, =0x0202499c + movs r0, 0x2 + adds r1, r5, 0 + movs r2, 0 + bl sub_80A600C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + movs r1, 0x70 + movs r3, 0x1E + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02020630 + mov r8, r0 + lsls r0, r7, 4 + adds r0, r7 + lsls r6, r0, 2 + mov r0, r8 + adds r4, r6, r0 + ldrb r1, [r4, 0x5] + movs r0, 0xF + ands r0, r1 + movs r1, 0x20 + orrs r0, r1 + movs r1, 0xD + negs r1, r1 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r4, 0x5] + movs r0, 0x2 + bl sub_80A82E4 + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + mov r0, r8 + adds r0, 0x1C + adds r0, r6, r0 + ldr r1, =DummyObjectCallback + str r1, [r0] + ldrb r0, [r4, 0x5] + lsrs r0, 4 + strh r0, [r4, 0x2E] + strh r5, [r4, 0x32] + adds r0, r5, 0 + bl sub_80DB2A8 + lsls r0, 24 + cmp r0, 0 + beq _080DB278 + mov r0, r8 + adds r0, 0x10 + adds r0, r6, r0 + ldr r1, =gUnknown_082FF6C0 + b _080DB280 + .pool +_080DB278: + mov r0, r8 + adds r0, 0x10 + adds r0, r6, r0 + ldr r1, =gUnknown_082FF694 +_080DB280: + str r1, [r0] + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0 + bl StartObjectRotScalAnim + adds r0, r7, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80DB174 + + thumb_func_start sub_80DB2A8 +sub_80DB2A8: @ 80DB2A8 + push {lr} + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xC9 + beq _080DB2B6 + movs r0, 0x1 + b _080DB2B8 +_080DB2B6: + movs r0, 0 +_080DB2B8: + pop {r1} + bx r1 + thumb_func_end sub_80DB2A8 + + thumb_func_start sub_80DB2BC +sub_80DB2BC: @ 80DB2BC + push {r4-r6,lr} + ldr r5, =0x02039f34 + ldr r0, [r5] + ldr r0, [r0, 0x24] + movs r4, 0xA0 + lsls r4, 3 + adds r1, r0, r4 + movs r6, 0xA0 + lsls r6, 1 + adds r2, r6, 0 + bl CpuSet + ldr r0, [r5] + ldr r0, [r0, 0x2C] + adds r4, r0, r4 + adds r1, r4, 0 + adds r2, r6, 0 + bl CpuSet + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DB2BC + + thumb_func_start sub_80DB2EC +sub_80DB2EC: @ 80DB2EC + push {lr} + lsls r0, 16 + lsls r1, 24 + lsrs r3, r1, 24 + ldr r2, =gContestEffects + ldr r1, =gContestMoves + lsrs r0, 13 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x8 + bhi _080DB354 + lsls r0, 2 + ldr r1, =_080DB320 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080DB320: + .4byte _080DB344 + .4byte _080DB344 + .4byte _080DB34C + .4byte _080DB34C + .4byte _080DB354 + .4byte _080DB354 + .4byte _080DB354 + .4byte _080DB354 + .4byte _080DB344 +_080DB344: + ldr r0, =0x00009082 + b _080DB356 + .pool +_080DB34C: + ldr r0, =0x00009088 + b _080DB356 + .pool +_080DB354: + ldr r0, =0x00009086 +_080DB356: + lsls r1, r3, 12 + movs r2, 0x90 + lsls r2, 8 + adds r1, r2 + lsls r0, 16 + asrs r0, 16 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80DB2EC + + thumb_func_start prints_contest_move_description +prints_contest_move_description: @ 80DB370 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r1, =gContestMoves + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0, 0x1] + lsls r0, 29 + lsrs r0, 29 + ldr r7, =0x00004040 + cmp r0, 0 + beq _080DB3A4 + adds r7, 0x5 + cmp r0, 0x1 + beq _080DB3A4 + adds r7, 0x5 + cmp r0, 0x2 + beq _080DB3A4 + adds r7, 0x40 + cmp r0, 0x3 + bne _080DB3A4 + subs r7, 0x20 +_080DB3A4: + movs r6, 0x5 + str r6, [sp] + movs r4, 0x1 + str r4, [sp, 0x4] + movs r5, 0x11 + str r5, [sp, 0x8] + str r4, [sp, 0xC] + movs r0, 0 + adds r1, r7, 0 + movs r2, 0xB + movs r3, 0x1F + bl sub_80DECB8 + adds r1, r7, 0 + adds r1, 0x10 + str r6, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + str r4, [sp, 0xC] + movs r0, 0 + movs r2, 0xB + movs r3, 0x20 + bl sub_80DECB8 + ldr r2, =gContestEffects + ldr r0, =gContestMoves + mov r3, r8 + lsls r1, r3, 3 + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2, 0x1] + adds r7, r1, 0 + cmp r0, 0xFF + bne _080DB3FC + movs r6, 0 + b _080DB408 + .pool +_080DB3FC: + ldrb r0, [r2, 0x1] + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r6, r0, 24 +_080DB408: + cmp r6, 0x8 + bls _080DB40E + movs r6, 0x8 +_080DB40E: + ldr r1, =0x00005035 + movs r0, 0x8 + str r0, [sp] + movs r5, 0x1 + str r5, [sp, 0x4] + movs r4, 0x11 + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0x15 + movs r3, 0x1F + bl sub_80DED10 + ldr r1, =0x00005012 + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0x15 + movs r3, 0x1F + bl sub_80DED10 + ldr r1, =gContestEffects + ldr r0, =gContestMoves + adds r0, r7, r0 + ldrb r0, [r0] + lsls r0, 2 + adds r1, r0, r1 + ldrb r0, [r1, 0x2] + cmp r0, 0xFF + bne _080DB460 + movs r6, 0 + b _080DB46C + .pool +_080DB460: + ldrb r0, [r1, 0x2] + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r6, r0, 24 +_080DB46C: + cmp r6, 0x8 + bls _080DB472 + movs r6, 0x8 +_080DB472: + ldr r1, =0x00005036 + movs r0, 0x8 + str r0, [sp] + movs r5, 0x1 + str r5, [sp, 0x4] + movs r4, 0x11 + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0x15 + movs r3, 0x20 + bl sub_80DED10 + ldr r1, =0x00005014 + str r6, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r2, 0x15 + movs r3, 0x20 + bl sub_80DED10 + movs r0, 0xA + movs r1, 0 + bl FillWindowPixelBuffer + ldr r1, =gContestEffectDescriptionPointers + ldr r0, =gContestMoves + adds r0, r7, r0 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + movs r0, 0xA + bl sub_80DEB70 + ldr r1, =gUnknown_085E8D3E + movs r0, 0x9 + bl sub_80DEB70 + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end prints_contest_move_description + + thumb_func_start sub_80DB4E0 +sub_80DB4E0: @ 80DB4E0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r0, =0x02039f26 + adds r0, r4, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + adds r0, 0x2 + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r4, 0 + bl sub_80DBCA8 + lsls r0, 24 + cmp r0, 0 + bne _080DB560 + cmp r5, 0 + beq _080DB560 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80DB2EC + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x2 + mov r8, r0 + str r0, [sp] + movs r5, 0x1 + str r5, [sp, 0x4] + movs r6, 0x11 + str r6, [sp, 0x8] + str r5, [sp, 0xC] + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x14 + adds r3, r7, 0 + bl sub_80DECB8 + adds r4, 0x10 + lsls r4, 16 + lsrs r4, 16 + adds r3, r7, 0x1 + lsls r3, 24 + lsrs r3, 24 + mov r0, r8 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + str r5, [sp, 0xC] + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x14 + bl sub_80DECB8 + b _080DB576 + .pool +_080DB560: + movs r0, 0x2 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x14 + adds r3, r7, 0 + bl sub_80DED10 +_080DB576: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80DB4E0 + + thumb_func_start sub_80DB584 +sub_80DB584: @ 80DB584 + push {r4,r5,lr} + movs r4, 0 + movs r5, 0 +_080DB58A: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x4] + adds r0, r5, r0 + ldrh r0, [r0, 0x6] + lsls r1, r4, 24 + lsrs r1, 24 + bl sub_80DB4E0 + adds r5, 0x1C + adds r4, 0x1 + cmp r4, 0x3 + ble _080DB58A + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DB584 + + thumb_func_start sub_80DB5B0 +sub_80DB5B0: @ 80DB5B0 + ldr r0, =0x00002034 + bx lr + .pool + thumb_func_end sub_80DB5B0 + + thumb_func_start sub_80DB5B8 +sub_80DB5B8: @ 80DB5B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + mov r10, r8 + ldr r0, =0x02039f34 + mov r9, r0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r7, r0, 2 + adds r3, r7, r1 + ldrb r0, [r3, 0x10] + movs r5, 0x30 + ands r5, r0 + cmp r5, 0 + bne _080DB5F4 + movs r0, 0 + b _080DB68A + .pool +_080DB5F4: + ldr r0, =0x02039f26 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + adds r0, 0x2 + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0xD + ldrsb r0, [r3, r0] + movs r1, 0xA + bl __divsi3 + lsls r0, 24 + asrs r4, r0, 24 + cmp r5, 0x10 + bne _080DB648 + bl sub_80DB5B0 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1 + str r0, [sp] + lsls r0, r4, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r2, 0x13 + adds r3, r6, 0 + bl sub_80DED10 + mov r1, r8 + cmp r1, 0 + beq _080DB688 + movs r0, 0x5B + b _080DB672 + .pool +_080DB648: + adds r3, r6, r4 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0x3 + subs r0, r4 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x13 + bl sub_80DED10 + mov r0, r10 + cmp r0, 0 + beq _080DB688 + movs r0, 0x26 +_080DB672: + bl audio_play + mov r1, r9 + ldr r0, [r1] + ldr r1, [r0, 0x4] + adds r1, r7, r1 + ldrb r2, [r1, 0x10] + movs r0, 0x31 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x10] +_080DB688: + movs r0, 0x1 +_080DB68A: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80DB5B8 + + thumb_func_start sub_80DB69C +sub_80DB69C: @ 80DB69C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + movs r7, 0 + movs r0, 0x1 + mov r10, r0 + movs r1, 0x11 + mov r9, r1 + movs r0, 0 + mov r8, r0 +_080DB6B6: + ldr r0, =0x02039f26 + adds r0, r7, r0 + ldrb r0, [r0] + lsls r4, r0, 2 + adds r4, r0 + adds r4, 0x2 + lsls r4, 24 + lsrs r4, 24 + bl sub_80DB5B0 + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x4] + add r0, r8 + ldrb r0, [r0, 0xD] + lsls r0, 24 + asrs r0, 24 + movs r1, 0xA + bl __divsi3 + lsls r0, 24 + mov r1, r10 + str r1, [sp] + asrs r6, r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + movs r0, 0 + adds r1, r5, 0 + movs r2, 0x13 + adds r3, r4, 0 + bl sub_80DED10 + adds r4, r6 + lsls r4, 24 + lsrs r4, 24 + mov r1, r10 + str r1, [sp] + movs r0, 0x3 + subs r0, r6 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x13 + adds r3, r4, 0 + bl sub_80DED10 + movs r1, 0x1C + add r8, r1 + adds r7, 0x1 + cmp r7, 0x3 + ble _080DB6B6 + 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_80DB69C + + thumb_func_start sub_80DB748 +sub_80DB748: @ 80DB748 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0 + cmp r1, 0x4 + bhi _080DB78A + lsls r0, r1, 2 + ldr r1, =_080DB764 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080DB764: + .4byte _080DB778 + .4byte _080DB77C + .4byte _080DB780 + .4byte _080DB784 + .4byte _080DB788 +_080DB778: + movs r0, 0x80 + b _080DB78A +_080DB77C: + movs r0, 0x84 + b _080DB78A +_080DB780: + movs r0, 0x86 + b _080DB78A +_080DB784: + movs r0, 0x88 + b _080DB78A +_080DB788: + movs r0, 0x82 +_080DB78A: + movs r1, 0x90 + lsls r1, 8 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_80DB748 + + thumb_func_start sub_80DB798 +sub_80DB798: @ 80DB798 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + mov r9, r1 + movs r1, 0 + mov r8, r1 + ldr r1, =0x02039f26 + adds r1, r0, r1 + ldrb r2, [r1] + lsls r1, r2, 2 + adds r1, r2 + adds r1, 0x2 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r1, =0x02039f34 + ldr r1, [r1] + ldr r2, [r1, 0x4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r2, r1, r2 + ldr r0, [r2, 0x10] + ldr r1, =0x00ff0003 + ands r0, r1 + cmp r0, 0 + bne _080DB7DC + ldrb r0, [r2, 0xF] + cmp r0, 0 + beq _080DB7EC +_080DB7DC: + movs r0, 0 + b _080DB80E + .pool +_080DB7EC: + ldrb r1, [r2, 0xC] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + beq _080DB7FA + movs r0, 0x1 + b _080DB80E +_080DB7FA: + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + bne _080DB80C + ldrb r1, [r2, 0xB] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080DB81A +_080DB80C: + movs r0, 0x2 +_080DB80E: + bl sub_80DB748 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + b _080DB81E +_080DB81A: + movs r0, 0 + mov r9, r0 +_080DB81E: + mov r1, r9 + cmp r1, 0 + beq _080DB85E + movs r6, 0x2 + str r6, [sp] + movs r4, 0x1 + str r4, [sp, 0x4] + movs r5, 0x11 + str r5, [sp, 0x8] + str r4, [sp, 0xC] + movs r0, 0 + mov r1, r8 + movs r2, 0x14 + adds r3, r7, 0 + bl sub_80DECB8 + mov r1, r8 + adds r1, 0x10 + lsls r1, 16 + lsrs r1, 16 + adds r3, r7, 0x1 + lsls r3, 24 + lsrs r3, 24 + str r6, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + str r4, [sp, 0xC] + movs r0, 0 + movs r2, 0x14 + bl sub_80DECB8 + b _080DB874 +_080DB85E: + movs r0, 0x2 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x14 + adds r3, r7, 0 + bl sub_80DED10 +_080DB874: + mov r0, r9 + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80DB798 + + thumb_func_start sub_80DB884 +sub_80DB884: @ 80DB884 + push {r4,lr} + movs r4, 0 +_080DB888: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80DB798 + adds r4, 0x1 + cmp r4, 0x3 + ble _080DB888 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80DB884 + + thumb_func_start sub_80DB89C +sub_80DB89C: @ 80DB89C + push {lr} + movs r0, 0x4 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x4 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0 + bl sub_80DED60 + pop {r0} + bx r0 + thumb_func_end sub_80DB89C + + thumb_func_start sub_80DB8B8 +sub_80DB8B8: @ 80DB8B8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + adds r0, r4, 0 + bl sub_80DBCA8 + lsls r0, 24 + cmp r0, 0 + beq _080DB8D0 + movs r0, 0 + b _080DB90A +_080DB8D0: + ldr r0, =0x02039f25 + ldrb r0, [r0] + cmp r4, r0 + beq _080DB8F4 + adds r0, r4, 0 + bl sub_81562C4 + bl sub_8156324 + lsls r0, 24 + ldr r2, =0x02039e00 + lsrs r0, 23 + lsls r1, r4, 6 + b _080DB902 + .pool +_080DB8F4: + ldr r2, =0x02039e00 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 1 + lsls r1, r5, 6 +_080DB902: + adds r0, r1 + adds r2, 0x1E + adds r0, r2 + ldrh r0, [r0] +_080DB90A: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80DB8B8 + + thumb_func_start sub_80DB918 +sub_80DB918: @ 80DB918 + push {r4,r5,lr} + movs r4, 0 + movs r5, 0 +_080DB91E: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80DB8B8 + ldr r1, =0x02039f34 + ldr r1, [r1] + ldr r1, [r1, 0x4] + adds r1, r5, r1 + strh r0, [r1, 0x6] + adds r5, 0x1C + adds r4, 0x1 + cmp r4, 0x3 + ble _080DB91E + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DB918 + + thumb_func_start sub_80DB944 +sub_80DB944: @ 80DB944 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + ldr r5, =0x02039f34 + mov r4, sp + movs r3, 0 + movs r6, 0x3 +_080DB956: + ldr r2, [r5] + ldr r1, [r2, 0x4] + adds r1, r3, r1 + ldrh r0, [r1, 0x2] + ldrh r7, [r1, 0x4] + adds r0, r7 + strh r0, [r1, 0x4] + ldr r0, [r2, 0x4] + adds r0, r3, r0 + ldrh r0, [r0, 0x4] + strh r0, [r4] + adds r4, 0x2 + adds r3, 0x1C + subs r6, 0x1 + cmp r6, 0 + bge _080DB956 + movs r6, 0 +_080DB978: + movs r4, 0x3 + cmp r4, r6 + ble _080DB9A4 +_080DB97E: + subs r5, r4, 0x1 + lsls r0, r5, 1 + mov r1, sp + adds r3, r1, r0 + lsls r0, r4, 1 + adds r2, r1, r0 + ldrh r4, [r3] + movs r7, 0 + ldrsh r1, [r3, r7] + movs r7, 0 + ldrsh r0, [r2, r7] + cmp r1, r0 + bge _080DB99E + ldrh r0, [r2] + strh r4, [r2] + strh r0, [r3] +_080DB99E: + adds r4, r5, 0 + cmp r4, r6 + bgt _080DB97E +_080DB9A4: + adds r6, 0x1 + cmp r6, 0x2 + ble _080DB978 + movs r6, 0 + movs r0, 0x4 + negs r0, r0 + mov r9, r0 + ldr r1, =0x02039f34 + mov r8, r1 + movs r7, 0x3 + mov r12, r7 +_080DB9BA: + movs r4, 0 + lsls r0, r6, 3 + adds r7, r6, 0x1 + subs r0, r6 + lsls r5, r0, 2 + mov r3, sp +_080DB9C6: + mov r1, r8 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r2, r5, r0 + movs r6, 0x4 + ldrsh r1, [r2, r6] + movs r6, 0 + ldrsh r0, [r3, r6] + cmp r1, r0 + bne _080DB9F0 + mov r0, r12 + ands r4, r0 + ldrb r1, [r2, 0xB] + mov r0, r9 + ands r0, r1 + orrs r0, r4 + strb r0, [r2, 0xB] + b _080DB9F8 + .pool +_080DB9F0: + adds r3, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _080DB9C6 +_080DB9F8: + adds r6, r7, 0 + cmp r6, 0x3 + ble _080DB9BA + movs r0, 0x1 + bl sub_80DCE58 + bl sub_80DD590 + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80DB944 + + thumb_func_start sub_80DBA18 +sub_80DBA18: @ 80DBA18 + push {r4,r5,lr} + ldr r4, =0x02039f34 + movs r2, 0 + movs r3, 0x3 +_080DBA20: + ldr r0, [r4] + ldr r0, [r0, 0x4] + adds r1, r2, r0 + ldrh r0, [r1, 0x6] + cmp r0, 0 + bne _080DBA34 + movs r1, 0x5 + b _080DBA52 + .pool +_080DBA34: + movs r5, 0x2 + ldrsh r0, [r1, r5] + movs r1, 0 + cmp r0, 0 + ble _080DBA52 + movs r1, 0x1 + cmp r0, 0x1D + ble _080DBA52 + movs r1, 0x2 + cmp r0, 0x3B + ble _080DBA52 + movs r1, 0x4 + cmp r0, 0x4F + bgt _080DBA52 + movs r1, 0x3 +_080DBA52: + ldr r0, [r4] + ldr r0, [r0, 0x4] + adds r0, r2, r0 + strb r1, [r0, 0x1A] + adds r2, 0x1C + subs r3, 0x1 + cmp r3, 0 + bge _080DBA20 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80DBA18 + + thumb_func_start sub_80DBA68 +sub_80DBA68: @ 80DBA68 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02039f34 + ldr r1, [r1] + ldr r2, [r1, 0x4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r2, r1, r2 + ldrb r1, [r2, 0xC] + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + bne _080DBA90 + ldrb r1, [r2, 0xB] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080DBA98 +_080DBA90: + movs r0, 0 + b _080DBA9A + .pool +_080DBA98: + movs r0, 0x1 +_080DBA9A: + pop {r1} + bx r1 + thumb_func_end sub_80DBA68 + + thumb_func_start sub_80DBAA0 +sub_80DBAA0: @ 80DBAA0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r5, =0x02039f34 + movs r0, 0 + mov r8, r0 + movs r1, 0x7 + negs r1, r1 + mov r10, r1 + movs r0, 0x2 + negs r0, r0 + mov r9, r0 + movs r4, 0 + movs r6, 0x3 +_080DBAC0: + ldr r1, [r5] + ldr r0, [r1, 0x4] + adds r0, r4, r0 + movs r2, 0 + strh r2, [r0, 0x2] + ldr r0, [r1, 0x4] + adds r0, r4, r0 + strh r2, [r0] + ldr r0, [r1, 0x4] + adds r0, r4, r0 + mov r1, r8 + strb r1, [r0, 0x12] + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r3, r4, r0 + ldrb r2, [r3, 0xC] + movs r0, 0x6 + ands r0, r2 + cmp r0, 0 + beq _080DBAFC + lsls r0, r2, 29 + lsrs r0, 30 + subs r0, 0x1 + movs r1, 0x3 + ands r0, r1 + lsls r0, 1 + mov r1, r10 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xC] +_080DBAFC: + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + mov r1, r8 + strb r1, [r0, 0xE] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x10] + mov r0, r9 + ands r0, r2 + strb r0, [r1, 0x10] + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + mov r1, r8 + strb r1, [r0, 0xF] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x10] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x10] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x10] + movs r7, 0x5 + negs r7, r7 + adds r0, r7, 0 + ands r0, r2 + strb r0, [r1, 0x10] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x10] + movs r0, 0x9 + negs r0, r0 + mov r12, r0 + ands r0, r2 + strb r0, [r1, 0x10] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0xC] + mov r0, r9 + ands r0, r2 + strb r0, [r1, 0xC] + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + movs r1, 0xFF + strb r1, [r0, 0x13] + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0, 0x14] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x10] + movs r0, 0x31 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x10] + ldr r0, [r5] + ldr r2, [r0, 0x4] + adds r2, r4, r2 + ldrb r3, [r2, 0x15] + lsls r1, r3, 31 + lsrs r1, 31 + lsls r1, 2 + adds r0, r7, 0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x15] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x15] + mov r0, r9 + ands r0, r2 + strb r0, [r1, 0x15] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x11] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x11] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x11] + movs r0, 0x21 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x11] + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r2, r4, r0 + ldrb r1, [r2, 0x11] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080DBBF4 + ldrb r1, [r2, 0xC] + mov r0, r10 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0xC] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x11] + adds r0, r7, 0 + ands r0, r2 + strb r0, [r1, 0x11] +_080DBBF4: + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r2, r4, r0 + ldrb r1, [r2, 0x11] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080DBC1A + ldrb r0, [r2, 0xB] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0xB] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x11] + mov r0, r12 + ands r0, r2 + strb r0, [r1, 0x11] +_080DBC1A: + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x11] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x11] + adds r4, 0x1C + subs r6, 0x1 + cmp r6, 0 + blt _080DBC34 + b _080DBAC0 +_080DBC34: + movs r6, 0 + ldr r5, =0x02039f34 + movs r7, 0 + movs r4, 0 +_080DBC3C: + ldr r3, [r5] + ldr r0, [r3, 0x4] + adds r0, r4, r0 + ldrh r1, [r0, 0x6] + strh r1, [r0, 0x8] + ldr r2, [r3] + lsls r1, r6, 1 + ldrb r0, [r2, 0x1] + lsls r0, 3 + adds r1, r0 + adds r2, 0x1C + adds r2, r1 + ldr r0, [r3, 0x4] + adds r0, r4, r0 + ldrh r0, [r0, 0x6] + strh r0, [r2] + ldr r0, [r3, 0x4] + adds r0, r4, r0 + ldrh r0, [r0, 0x6] + bl sub_80DD9F0 + ldr r1, [r5] + ldr r2, [r1] + ldrb r1, [r2, 0x1] + lsls r1, 2 + adds r1, r6, r1 + adds r2, 0x44 + adds r2, r1 + strb r0, [r2] + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + strh r7, [r0, 0x6] + adds r4, 0x1C + adds r6, 0x1 + cmp r6, 0x3 + ble _080DBC3C + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0x10] + ldrb r1, [r2, 0x1] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x1] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DBAA0 + + thumb_func_start sub_80DBCA8 +sub_80DBCA8: @ 80DBCA8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02039f34 + ldr r1, [r1] + ldr r2, [r1, 0x4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r2, r1, r2 + ldrb r1, [r2, 0xC] + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + bne _080DBCD0 + ldrb r1, [r2, 0xB] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080DBCD8 +_080DBCD0: + movs r0, 0x1 + b _080DBCDA + .pool +_080DBCD8: + movs r0, 0 +_080DBCDA: + pop {r1} + bx r1 + thumb_func_end sub_80DBCA8 + + thumb_func_start sub_80DBCE0 +sub_80DBCE0: @ 80DBCE0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_80DBD34 + ldr r1, =0x02039f18 + lsls r4, 1 + adds r1, r4, r1 + strh r0, [r1] + ldr r2, =0x02039f08 + adds r2, r4, r2 + ldr r1, =0x02039f00 + adds r4, r1 + ldrh r4, [r4] + adds r0, r4 + strh r0, [r2] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DBCE0 + + thumb_func_start sub_80DBD18 +sub_80DBD18: @ 80DBD18 + push {r4,lr} + movs r4, 0 +_080DBD1C: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80DBCE0 + adds r4, 0x1 + cmp r4, 0x3 + ble _080DBD1C + bl sub_80DBD4C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80DBD18 + + thumb_func_start sub_80DBD34 +sub_80DBD34: @ 80DBD34 + lsls r0, 24 + ldr r1, =0x02039f10 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + lsls r0, 17 + asrs r0, 16 + bx lr + .pool + thumb_func_end sub_80DBD34 + + thumb_func_start sub_80DBD4C +sub_80DBD4C: @ 80DBD4C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x70 + mov r0, sp + movs r1, 0 + movs r2, 0x8 + bl memset + movs r0, 0 + mov r9, r0 + mov r1, sp + adds r1, 0x8 + str r1, [sp, 0x64] + mov r3, sp + adds r3, 0xC + str r3, [sp, 0x68] + mov r6, sp + adds r6, 0x14 + str r6, [sp, 0x6C] + mov r4, sp +_080DBD7A: + bl GenerateRandomNumber + strh r0, [r4] + movs r2, 0 + cmp r2, r9 + bge _080DBDB8 + mov r1, sp + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r1] + cmp r0, r1 + bne _080DBD9C + subs r4, 0x2 + movs r7, 0x1 + negs r7, r7 + add r9, r7 + b _080DBDB8 +_080DBD9C: + adds r2, 0x1 + cmp r2, r9 + bge _080DBDB8 + lsls r0, r2, 1 + mov r3, sp + adds r1, r3, r0 + ldrh r0, [r4] + ldrh r1, [r1] + cmp r0, r1 + bne _080DBD9C + subs r4, 0x2 + movs r6, 0x1 + negs r6, r6 + add r9, r6 +_080DBDB8: + adds r4, 0x2 + movs r7, 0x1 + add r9, r7 + mov r0, r9 + cmp r0, 0x3 + ble _080DBD7A + movs r1, 0 + mov r9, r1 + mov r4, sp + ldr r6, =0x02039f08 + ldr r2, [sp, 0x64] + ldr r5, =0x02039f00 + ldr r3, [sp, 0x68] +_080DBDD2: + mov r7, r9 + lsls r1, r7, 4 + movs r7, 0 + ldrsh r0, [r6, r7] + str r0, [r2] + movs r7, 0 + ldrsh r0, [r5, r7] + str r0, [r3] + ldrh r0, [r4] + str r0, [r2, 0x8] + ldr r0, [sp, 0x6C] + adds r1, r0, r1 + mov r7, r9 + str r7, [r1] + adds r4, 0x2 + adds r6, 0x2 + adds r2, 0x10 + adds r5, 0x2 + adds r3, 0x10 + movs r0, 0x1 + add r9, r0 + mov r1, r9 + cmp r1, 0x3 + ble _080DBDD2 + movs r3, 0 + mov r9, r3 +_080DBE06: + movs r4, 0x3 + cmp r4, r9 + ble _080DBE90 + add r7, sp, 0x48 + ldr r6, [sp, 0x68] + str r6, [sp, 0x58] + ldr r0, [sp, 0x64] + adds r0, 0x8 + str r0, [sp, 0x5C] + ldr r1, [sp, 0x6C] + str r1, [sp, 0x60] +_080DBE1C: + subs r3, r4, 0x1 + mov r10, r3 + mov r0, r10 + adds r1, r4, 0 + ldr r2, [sp, 0x64] + bl sub_80DBF30 + lsls r0, 24 + cmp r0, 0 + beq _080DBE8A + mov r6, r10 + lsls r2, r6, 4 + ldr r0, [sp, 0x64] + adds r3, r0, r2 + ldr r0, [r3] + str r0, [sp, 0x48] + ldr r1, [sp, 0x58] + adds r6, r1, r2 + ldr r0, [r6] + str r0, [r7, 0x4] + ldr r0, [sp, 0x5C] + adds r0, r2 + mov r8, r0 + ldr r0, [r0] + str r0, [r7, 0x8] + ldr r1, [sp, 0x60] + adds r2, r1, r2 + ldr r0, [r2] + str r0, [r7, 0xC] + lsls r1, r4, 4 + ldr r0, [sp, 0x64] + adds r5, r0, r1 + ldr r0, [r5] + str r0, [r3] + ldr r3, [sp, 0x58] + adds r4, r3, r1 + ldr r0, [r4] + str r0, [r6] + ldr r6, [sp, 0x5C] + adds r3, r6, r1 + ldr r0, [r3] + mov r6, r8 + str r0, [r6] + ldr r0, [sp, 0x60] + adds r1, r0, r1 + ldr r0, [r1] + str r0, [r2] + ldr r0, [sp, 0x48] + str r0, [r5] + ldr r0, [r7, 0x4] + str r0, [r4] + ldr r0, [r7, 0x8] + str r0, [r3] + ldr r0, [r7, 0xC] + str r0, [r1] +_080DBE8A: + mov r4, r10 + cmp r4, r9 + bgt _080DBE1C +_080DBE90: + movs r1, 0x1 + add r9, r1 + mov r3, r9 + cmp r3, 0x2 + ble _080DBE06 + movs r6, 0 + mov r9, r6 + ldr r2, =0x02039f20 + ldr r1, [sp, 0x6C] +_080DBEA2: + ldr r0, [r1] + adds r0, r2 + mov r7, r9 + strb r7, [r0] + adds r1, 0x10 + movs r0, 0x1 + add r9, r0 + mov r3, r9 + cmp r3, 0x3 + ble _080DBEA2 + add sp, 0x70 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DBD4C + + thumb_func_start sub_80DBED4 +sub_80DBED4: @ 80DBED4 + push {lr} + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080DBF0E + ldr r0, =0x03005d90 + ldr r2, [r0] + ldr r1, =0x02039f20 + ldr r0, =0x02039f25 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r1, 1 + ldr r0, =0x02039f2c + ldrh r0, [r0] + lsls r0, 3 + adds r1, r0 + ldr r0, =0x00000624 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + adds r0, 0x1 + ldr r1, =0x0000270f + cmp r0, r1 + ble _080DBF0C + adds r0, r1, 0 +_080DBF0C: + strh r0, [r2] +_080DBF0E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DBED4 + + thumb_func_start sub_80DBF30 +sub_80DBF30: @ 80DBF30 + push {lr} + lsls r0, 4 + adds r0, r2 + lsls r1, 4 + adds r3, r1, r2 + ldr r2, [r0] + ldr r1, [r3] + cmp r2, r1 + blt _080DBF60 + cmp r2, r1 + bgt _080DBF52 + ldr r2, [r0, 0x4] + ldr r1, [r3, 0x4] + cmp r2, r1 + blt _080DBF60 + cmp r2, r1 + ble _080DBF56 +_080DBF52: + movs r2, 0 + b _080DBF62 +_080DBF56: + ldr r1, [r0, 0x8] + ldr r0, [r3, 0x8] + movs r2, 0 + cmp r1, r0 + bge _080DBF62 +_080DBF60: + movs r2, 0x1 +_080DBF62: + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_80DBF30 + + thumb_func_start sub_80DBF68 +sub_80DBF68: @ 80DBF68 + push {lr} + ldr r0, =0x02022e16 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e1e + strh r1, [r0] + bl sub_80DB89C + ldr r0, =gUnknown_0827E8DA + movs r1, 0 + bl sub_80DEC30 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DBF68 + + thumb_func_start sub_80DBF90 +sub_80DBF90: @ 80DBF90 + push {r4,r5,lr} + sub sp, 0xC + movs r5, 0x80 + lsls r5, 18 + movs r4, 0x3 +_080DBF9A: + lsrs r3, r5, 24 + movs r0, 0x8 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x16 + bl sub_80DED10 + movs r0, 0xA0 + lsls r0, 19 + adds r5, r0 + subs r4, 0x1 + cmp r4, 0 + bge _080DBF9A + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80DBF90 + + thumb_func_start sub_80DBFC8 +sub_80DBFC8: @ 80DBFC8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x00005011 + cmp r0, 0 + beq _080DBFE2 + ldr r1, =0x00006011 + cmp r0, 0x1 + beq _080DBFE2 + ldr r1, =0x00008011 + cmp r0, 0x2 + bne _080DBFE2 + ldr r1, =0x00007011 +_080DBFE2: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80DBFC8 + + thumb_func_start sub_80DBFFC +sub_80DBFFC: @ 80DBFFC + push {lr} + lsls r0, 16 + asrs r0, 16 + movs r1, 0xA + bl __divsi3 + lsls r0, 24 + lsrs r1, r0, 24 + asrs r2, r0, 24 + cmp r2, 0x10 + ble _080DC016 + movs r1, 0x10 + b _080DC020 +_080DC016: + movs r0, 0x10 + negs r0, r0 + cmp r2, r0 + bge _080DC020 + movs r1, 0xF0 +_080DC020: + lsls r0, r1, 24 + asrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80DBFFC + + thumb_func_start sub_80DC028 +sub_80DC028: @ 80DC028 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + adds r6, r1, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x14] + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1, 0x2] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1, 0x2] + ldr r0, =sub_80DC0F4 + movs r1, 0x14 + bl CreateTask + lsls r0, 24 + lsrs r7, r0, 24 + lsls r5, 16 + asrs r5, 16 + adds r0, r5, 0 + bl sub_80DBFFC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r6, 16 + asrs r6, 16 + adds r5, r6 + lsls r5, 16 + asrs r5, 16 + adds r0, r5, 0 + bl sub_80DBFFC + lsls r4, 24 + asrs r4, 24 + subs r0, r4 + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, r8 + bl sub_80DBFC8 + ldr r2, =0x03005e00 + lsls r3, r7, 2 + adds r0, r3, r7 + lsls r0, 3 + adds r1, r0, r2 + adds r0, r4, 0 + cmp r4, 0 + bge _080DC0A0 + negs r0, r4 +_080DC0A0: + strh r0, [r1, 0x8] + lsls r0, r5, 24 + asrs r0, 24 + strh r0, [r1, 0xA] + cmp r4, 0 + bgt _080DC0B4 + cmp r4, 0 + bne _080DC0C8 + cmp r0, 0 + ble _080DC0C8 +_080DC0B4: + movs r0, 0x1 + strh r0, [r1, 0xC] + b _080DC0D6 + .pool +_080DC0C8: + ldr r2, =0x03005e00 + lsls r3, r7, 2 + adds r0, r3, r7 + lsls r0, 3 + adds r0, r2 + ldr r1, =0x0000ffff + strh r1, [r0, 0xC] +_080DC0D6: + adds r0, r3, r7 + lsls r0, 3 + adds r0, r2 + mov r1, r8 + strh r1, [r0, 0xE] + adds r0, r7, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80DC028 + + thumb_func_start sub_80DC0F4 +sub_80DC0F4: @ 80DC0F4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r4, r0, r1 + ldrb r0, [r4, 0xE] + mov r9, r0 + ldrh r3, [r4, 0x8] + ldrh r1, [r4, 0xA] + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xE + bgt _080DC126 + b _080DC2A8 +_080DC126: + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r2, [r4, 0xA] + movs r5, 0xA + ldrsh r0, [r4, r5] + cmp r0, 0 + bne _080DC15C + adds r0, r7, 0 + bl DestroyTask + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x14] + mov r2, r9 + lsls r1, r2, 2 + adds r1, r0 + ldrb r2, [r1, 0x2] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x2] + b _080DC2A8 + .pool +_080DC15C: + cmp r3, 0 + bne _080DC1A4 + lsls r0, r1, 16 + mov r8, r0 + cmp r0, 0 + bge _080DC17A + mov r0, r9 + bl sub_80DBFC8 + adds r0, 0x2 + lsls r0, 16 + lsrs r6, r0, 16 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + b _080DC188 +_080DC17A: + mov r0, r9 + bl sub_80DBFC8 + lsls r0, 16 + lsrs r6, r0, 16 + ldrh r0, [r4, 0xA] + subs r0, 0x1 +_080DC188: + strh r0, [r4, 0xA] + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + adds r2, r1, 0x1 + strh r2, [r0, 0x8] + lsls r1, 24 + lsrs r5, r1, 24 + b _080DC210 + .pool +_080DC1A4: + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0 + bge _080DC1DE + lsls r0, r1, 16 + mov r8, r0 + cmp r0, 0 + bge _080DC1CC + ldrh r0, [r4, 0x8] + adds r1, r0, 0x1 + strh r1, [r4, 0x8] + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r2, 0x1 + strh r0, [r4, 0xA] + mov r0, r9 + bl sub_80DBFC8 + adds r0, 0x2 + b _080DC20C +_080DC1CC: + ldrh r0, [r4, 0x8] + subs r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0 + subs r0, r2, 0x1 + strh r0, [r4, 0xA] + b _080DC210 +_080DC1DE: + lsls r0, r1, 16 + mov r8, r0 + cmp r0, 0 + bge _080DC1F8 + ldrh r0, [r4, 0x8] + subs r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0 + adds r0, r2, 0x1 + strh r0, [r4, 0xA] + b _080DC210 +_080DC1F8: + ldrh r0, [r4, 0x8] + adds r1, r0, 0x1 + strh r1, [r4, 0x8] + lsls r0, 24 + lsrs r5, r0, 24 + subs r0, r2, 0x1 + strh r0, [r4, 0xA] + mov r0, r9 + bl sub_80DBFC8 +_080DC20C: + lsls r0, 16 + lsrs r6, r0, 16 +_080DC210: + str r5, [sp, 0xC] + movs r0, 0 + mov r10, r0 + cmp r5, 0x7 + bls _080DC226 + movs r2, 0x1 + mov r10, r2 + adds r0, r5, 0 + subs r0, 0x8 + lsls r0, 24 + lsrs r5, r0, 24 +_080DC226: + adds r2, r5, 0 + adds r2, 0x16 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =0x02039f26 + add r0, r9 + ldrb r0, [r0] + lsls r3, r0, 2 + adds r3, r0 + adds r3, 0x2 + add r3, r10 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + adds r1, r6, 0 + bl sub_80DED10 + mov r3, r8 + cmp r3, 0 + ble _080DC284 + movs r0, 0x60 + bl audio_play + ldr r4, =0x030075f0 + adds r0, r4, 0 + bl m4aMPlayImmInit + ldr r1, =0x0000ffff + ldr r0, [sp, 0xC] + lsls r2, r0, 24 + asrs r2, 16 + adds r0, r4, 0 + bl MPlayPitchControl + b _080DC28A + .pool +_080DC284: + movs r0, 0x16 + bl audio_play +_080DC28A: + mov r2, r10 + cmp r2, 0 + bne _080DC2A8 + cmp r5, 0 + bne _080DC2A8 + cmp r6, 0 + bne _080DC2A8 + ldr r0, =0x03005e00 + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0xC] + negs r0, r0 + strh r0, [r1, 0xC] +_080DC2A8: + 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_80DC0F4 + + thumb_func_start sub_80DC2BC +sub_80DC2BC: @ 80DC2BC + push {r4,r5,lr} + ldr r0, =gUnknown_08587A74 + bl LoadObjectPic + movs r4, 0 + ldr r5, =gUnknown_08587A6C +_080DC2C8: + ldr r0, =0x02039f26 + adds r0, r4, r0 + ldrb r0, [r0] + adds r0, r5 + ldrb r2, [r0] + ldr r0, =gUnknown_08587AD0 + movs r1, 0xB4 + movs r3, 0x1 + bl AddObjectToFront + ldr r1, =0x02039f34 + ldr r1, [r1] + ldr r2, [r1, 0x14] + lsls r1, r4, 2 + adds r1, r2 + strb r0, [r1] + adds r4, 0x1 + cmp r4, 0x3 + ble _080DC2C8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DC2BC + + thumb_func_start sub_80DC308 +sub_80DC308: @ 80DC308 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r2, [r0, 0x14] + lsls r3, r6, 2 + adds r2, r3, r2 + ldrb r0, [r2, 0x2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x2] + ldr r1, [r4] + ldr r0, [r1, 0x14] + adds r3, r0 + ldrb r7, [r3] + ldr r1, [r1, 0x4] + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r0, r1 + movs r1, 0x4 + ldrsh r0, [r0, r1] + movs r1, 0xA + bl __divsi3 + lsls r0, 17 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x38 + ble _080DC350 + movs r5, 0x38 + b _080DC356 + .pool +_080DC350: + cmp r0, 0 + bge _080DC356 + movs r5, 0 +_080DC356: + ldr r2, =0x02020630 + lsls r3, r7, 4 + adds r0, r3, r7 + lsls r0, 2 + adds r4, r0, r2 + movs r0, 0x3E + adds r0, r4 + mov r12, r0 + ldrb r1, [r0] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + mov r1, r12 + strb r0, [r1] + strh r6, [r4, 0x2E] + strh r5, [r4, 0x30] + lsls r0, r5, 16 + asrs r0, 16 + movs r5, 0x24 + ldrsh r1, [r4, r5] + cmp r0, r1 + ble _080DC38C + movs r0, 0x1 + b _080DC38E + .pool +_080DC38C: + ldr r0, =0x0000ffff +_080DC38E: + strh r0, [r4, 0x32] + adds r0, r3, r7 + lsls r0, 2 + adds r1, r2, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_80DC408 + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DC308 + + thumb_func_start sub_80DC3AC +sub_80DC3AC: @ 80DC3AC + push {r4,lr} + movs r4, 0 +_080DC3B0: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80DC308 + adds r4, 0x1 + cmp r4, 0x3 + ble _080DC3B0 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80DC3AC + + thumb_func_start sub_80DC3C4 +sub_80DC3C4: @ 80DC3C4 + push {r4,lr} + movs r2, 0 + ldr r3, =0x02039f34 + ldr r0, [r3] + ldr r0, [r0, 0x14] + ldrb r1, [r0, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080DC3F2 + movs r4, 0x1 +_080DC3DA: + adds r2, 0x1 + cmp r2, 0x3 + bgt _080DC3F2 + ldr r0, [r3] + ldr r1, [r0, 0x14] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0, 0x2] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _080DC3DA +_080DC3F2: + cmp r2, 0x4 + beq _080DC400 + movs r0, 0 + b _080DC402 + .pool +_080DC400: + movs r0, 0x1 +_080DC402: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80DC3C4 + + thumb_func_start sub_80DC408 +sub_80DC408: @ 80DC408 + push {r4,lr} + adds r3, r0, 0 + ldrh r2, [r3, 0x24] + movs r0, 0x24 + ldrsh r1, [r3, r0] + movs r4, 0x30 + ldrsh r0, [r3, r4] + cmp r1, r0 + bne _080DC440 + ldr r0, =0x02039f34 + ldr r0, [r0] + movs r2, 0x2E + ldrsh r1, [r3, r2] + ldr r0, [r0, 0x14] + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x2] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x2] + ldr r0, =DummyObjectCallback + str r0, [r3, 0x1C] + b _080DC446 + .pool +_080DC440: + ldrh r0, [r3, 0x32] + adds r0, r2, r0 + strh r0, [r3, 0x24] +_080DC446: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80DC408 + + thumb_func_start sub_80DC44C +sub_80DC44C: @ 80DC44C + push {r4-r6,lr} + movs r2, 0 + ldr r6, =0x02020630 + ldr r5, =0x02039f34 + ldr r4, =gUnknown_08587A6C + ldr r3, =0x02039f26 +_080DC458: + ldr r0, [r5] + ldr r1, [r0, 0x14] + lsls r0, r2, 2 + adds r0, r1 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + adds r0, r2, r3 + ldrb r0, [r0] + adds r0, r4 + ldrb r0, [r0] + strh r0, [r1, 0x22] + adds r2, 0x1 + cmp r2, 0x3 + ble _080DC458 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DC44C + + thumb_func_start sub_80DC490 +sub_80DC490: @ 80DC490 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r3, 0 + ldr r7, =0x02039f26 + ldr r5, =0x02020630 + ldr r4, =0x02039f34 + movs r2, 0 +_080DC4A0: + adds r0, r3, r7 + ldrb r0, [r0] + cmp r0, 0x1 + bls _080DC4E2 + cmp r6, 0 + bne _080DC4CC + ldr r0, [r4] + ldr r0, [r0, 0x14] + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0xB4 + b _080DC4E0 + .pool +_080DC4CC: + ldr r0, [r4] + ldr r0, [r0, 0x14] + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x80 + lsls r1, 1 +_080DC4E0: + strh r1, [r0, 0x20] +_080DC4E2: + adds r2, 0x4 + adds r3, 0x1 + cmp r3, 0x3 + ble _080DC4A0 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80DC490 + + thumb_func_start sub_80DC4F0 +sub_80DC4F0: @ 80DC4F0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =gUnknown_08587B08 + bl LoadTaggedObjectPalette + movs r5, 0 + ldr r7, =0x02039f34 + ldr r0, =0x02020630 + mov r8, r0 + movs r6, 0 +_080DC506: + lsls r0, r5, 3 + ldr r1, =gUnknown_08587AE8 + adds r0, r1 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_08587B18 + adds r0, r6, r0 + ldr r2, =gUnknown_08587A70 + ldr r1, =0x02039f26 + adds r1, r5, r1 + ldrb r1, [r1] + adds r1, r2 + ldrb r2, [r1] + movs r1, 0xCC + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + ldr r1, [r1, 0x14] + lsls r4, r5, 2 + adds r1, r4, r1 + strb r0, [r1, 0x1] + ldr r0, [r7] + ldr r0, [r0, 0x14] + adds r0, r4, r0 + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldr r1, =gUnknown_08587B80 + bl SetSpriteOamTables_NoPriorityFromTable + ldr r0, [r7] + ldr r0, [r0, 0x14] + adds r4, r0 + ldrb r1, [r4, 0x1] + 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] + adds r6, 0x18 + adds r5, 0x1 + cmp r5, 0x3 + ble _080DC506 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DC4F0 + + thumb_func_start sub_80DC594 +sub_80DC594: @ 80DC594 + push {lr} + ldr r0, =gUnknown_08587BB0 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_08587BB8 + bl LoadTaggedObjectPalette + ldr r0, =gUnknown_08587BC8 + movs r1, 0x1E + movs r2, 0x2C + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x3E + ldrb r2, [r1] + movs r3, 0x4 + orrs r2, r3 + strb r2, [r1] + ldr r1, =0x02039f34 + ldr r1, [r1] + ldr r1, [r1] + adds r1, 0x58 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DC594 + + thumb_func_start sub_80DC5E8 +sub_80DC5E8: @ 80DC5E8 + push {r4,lr} + ldr r0, =sub_80DC728 + movs r1, 0x1E + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02039f34 + ldr r1, [r1] + ldr r1, [r1] + strb r0, [r1, 0xD] + movs r2, 0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r4, =0x03005e08 + movs r3, 0xFF +_080DC60A: + lsls r0, r2, 3 + adds r0, r1 + adds r0, r4 + strh r3, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _080DC60A + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DC5E8 + + thumb_func_start sub_80DC630 +sub_80DC630: @ 80DC630 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x03005e00 + ldr r1, =0x02039f34 + ldr r5, [r1] + ldr r1, [r5] + ldrb r2, [r1, 0xD] + lsls r1, r2, 2 + adds r1, r2 + adds r1, r0 + lsls r1, 3 + adds r3, 0x8 + adds r1, r3 + movs r4, 0 + strh r4, [r1] + lsls r0, 2 + adds r0, 0x1 + lsls r0, 1 + ldr r1, [r5] + ldrb r2, [r1, 0xD] + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r0, r1 + adds r0, r3 + strh r4, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DC630 + + thumb_func_start sub_80DC674 +sub_80DC674: @ 80DC674 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =sub_80DC6A4 + movs r1, 0x1F + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DC674 + + thumb_func_start sub_80DC6A4 +sub_80DC6A4: @ 80DC6A4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r2, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x8] + adds r5, r0, 0 + ldr r0, =0x02039f34 + ldr r4, [r0] + ldr r0, [r4] + ldrb r1, [r0, 0xD] + lsls r0, r1, 2 + adds r0, r1 + adds r0, r5 + lsls r0, 3 + adds r7, r2, 0 + adds r7, 0x8 + adds r1, r0, r7 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _080DC6DC + cmp r0, 0xFF + bne _080DC716 +_080DC6DC: + movs r3, 0 + movs r0, 0xFF + strh r0, [r1] + lsls r1, r5, 2 + adds r1, 0x1 + lsls r1, 1 + ldr r0, [r4] + ldrb r2, [r0, 0xD] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, r7 + strh r3, [r1] + ldr r0, [r4] + adds r0, 0x14 + adds r0, r5 + ldrb r0, [r0] + adds r0, 0x5 + lsls r0, 4 + adds r0, 0x6 + ldr r3, =0x00004bff + movs r1, 0x2 + movs r2, 0 + bl pal_fade_1 + adds r0, r6, 0 + bl DestroyTask +_080DC716: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DC6A4 + + thumb_func_start sub_80DC728 +sub_80DC728: @ 80DC728 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + movs r6, 0 + lsls r1, r0, 2 + adds r1, r0 + mov r9, r1 + lsls r7, r1, 3 + ldr r0, =0x03005e08 + mov r8, r0 + movs r1, 0x8 + negs r1, r1 + add r1, r8 + mov r10, r1 +_080DC74C: + lsls r0, r6, 26 + lsrs r3, r0, 24 + lsls r0, r3, 1 + adds r0, r7 + mov r4, r8 + adds r2, r0, r4 + ldrh r4, [r2] + movs r5, 0 + ldrsh r0, [r2, r5] + cmp r0, 0xFF + beq _080DC7CA + adds r0, r3, 0x1 + lsls r1, r0, 1 + adds r1, r7 + add r1, r8 + movs r5, 0 + ldrsh r1, [r1, r5] + adds r5, r0, 0 + cmp r1, 0 + bne _080DC77C + adds r0, r4, 0x1 + b _080DC77E + .pool +_080DC77C: + subs r0, r4, 0x1 +_080DC77E: + strh r0, [r2] + lsls r1, r3, 1 + mov r0, r9 + lsls r2, r0, 3 + adds r0, r1, r2 + mov r3, r10 + adds r3, 0x8 + adds r0, r3 + movs r4, 0 + ldrsh r0, [r0, r4] + adds r4, r1, 0 + cmp r0, 0x10 + beq _080DC79C + cmp r0, 0 + bne _080DC7AA +_080DC79C: + lsls r0, r5, 1 + adds r0, r2 + adds r0, r3 + ldrh r1, [r0] + movs r2, 0x1 + eors r1, r2 + strh r1, [r0] +_080DC7AA: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0] + adds r0, 0x14 + adds r0, r6 + ldrb r0, [r0] + adds r0, 0x5 + lsls r0, 4 + adds r0, 0x6 + adds r1, r4, r7 + add r1, r8 + ldrb r2, [r1] + movs r1, 0x2 + ldr r3, =0x00004bff + bl pal_fade_1 +_080DC7CA: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _080DC74C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DC728 + + thumb_func_start sub_80DC7EC +sub_80DC7EC: @ 80DC7EC + push {r4,lr} + ldr r0, =sub_80DC8D0 + movs r1, 0x1E + bl CreateTask + ldr r1, =0x02039f34 + ldr r1, [r1] + ldr r1, [r1] + strb r0, [r1, 0xE] + movs r4, 0 +_080DC800: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80DC81C + adds r4, 0x1 + cmp r4, 0x3 + ble _080DC800 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DC7EC + + thumb_func_start sub_80DC81C +sub_80DC81C: @ 80DC81C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x03005e00 + ldr r1, =0x02039f34 + ldr r4, [r1] + ldr r1, [r4] + ldrb r2, [r1, 0xE] + lsls r1, r2, 2 + adds r1, r2 + adds r1, r0 + lsls r1, 3 + adds r3, 0x8 + adds r1, r3 + movs r5, 0 + movs r2, 0xFF + strh r2, [r1] + lsls r0, 2 + adds r0, 0x1 + lsls r0, 1 + ldr r1, [r4] + ldrb r2, [r1, 0xE] + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r0, r1 + adds r0, r3 + strh r5, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DC81C + + thumb_func_start sub_80DC864 +sub_80DC864: @ 80DC864 + push {r4,lr} + movs r4, 0 +_080DC868: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80DC87C + adds r4, 0x1 + cmp r4, 0x3 + ble _080DC868 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80DC864 + + thumb_func_start sub_80DC87C +sub_80DC87C: @ 80DC87C + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_80DC81C + adds r0, r4, 0x5 + lsls r2, r0, 5 + ldr r3, =0x02037728 + adds r6, r2, r3 + ldr r5, =0x02037b28 + adds r2, r5 + ldr r1, =0x040000d4 + str r6, [r1] + str r2, [r1, 0x4] + ldr r2, =0x80000001 + str r2, [r1, 0x8] + ldr r6, [r1, 0x8] + lsls r0, 4 + adds r4, 0xC + adds r0, r4 + lsls r0, 1 + subs r3, 0x14 + adds r3, r0, r3 + subs r5, 0x14 + adds r0, r5 + str r3, [r1] + str r0, [r1, 0x4] + str r2, [r1, 0x8] + ldr r0, [r1, 0x8] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DC87C + + thumb_func_start sub_80DC8D0 +sub_80DC8D0: @ 80DC8D0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + movs r7, 0 + lsls r1, r0, 2 + adds r1, r0 + mov r9, r1 + lsls r6, r1, 3 + ldr r0, =0x03005e08 + mov r8, r0 + ldr r1, =0x00004bff + mov r10, r1 +_080DC8F0: + lsls r0, r7, 26 + lsrs r3, r0, 24 + lsls r0, r3, 1 + adds r0, r6 + mov r4, r8 + adds r2, r0, r4 + movs r5, 0 + ldrsh r0, [r2, r5] + cmp r0, 0xFF + beq _080DC996 + adds r0, r3, 0x2 + lsls r0, 1 + adds r0, r6 + adds r1, r0, r4 + ldrh r0, [r1] + adds r0, 0x1 + movs r4, 0 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _080DC996 + strh r4, [r1] + adds r0, r3, 0x1 + lsls r1, r0, 1 + adds r1, r6 + add r1, r8 + movs r4, 0 + ldrsh r1, [r1, r4] + adds r4, r0, 0 + cmp r1, 0 + bne _080DC940 + ldrh r0, [r2] + adds r0, 0x1 + b _080DC944 + .pool +_080DC940: + ldrh r0, [r2] + subs r0, 0x1 +_080DC944: + strh r0, [r2] + lsls r1, r3, 1 + mov r5, r9 + lsls r2, r5, 3 + adds r0, r1, r2 + ldr r3, =0x03005e00 + adds r3, 0x8 + adds r0, r3 + movs r5, 0 + ldrsh r0, [r0, r5] + adds r5, r1, 0 + cmp r0, 0x10 + beq _080DC962 + cmp r0, 0 + bne _080DC970 +_080DC962: + lsls r0, r4, 1 + adds r0, r2 + adds r0, r3 + ldrh r1, [r0] + movs r2, 0x1 + eors r1, r2 + strh r1, [r0] +_080DC970: + adds r4, r7, 0x5 + lsls r4, 4 + adds r0, r4, 0 + adds r0, 0xA + adds r5, r6 + add r5, r8 + ldrb r2, [r5] + movs r1, 0x1 + mov r3, r10 + bl pal_fade_1 + adds r4, 0xC + adds r4, r7 + ldrb r2, [r5] + adds r0, r4, 0 + movs r1, 0x1 + mov r3, r10 + bl pal_fade_1 +_080DC996: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x3 + bls _080DC8F0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DC8D0 + + thumb_func_start sub_80DC9B4 +sub_80DC9B4: @ 80DC9B4 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x15] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080DC9E0 + adds r0, r2, 0 + bl sub_80DC630 + b _080DC9E6 + .pool +_080DC9E0: + adds r0, r2, 0 + bl sub_80DC674 +_080DC9E6: + pop {r0} + bx r0 + thumb_func_end sub_80DC9B4 + + thumb_func_start sub_80DC9EC +sub_80DC9EC: @ 80DC9EC + 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, 0xC] + ldr r6, =0x02039f26 + adds r6, r0, r6 + ldrb r0, [r6] + lsls r5, r0, 2 + adds r5, r0 + lsls r5, 27 + movs r0, 0x80 + lsls r0, 22 + adds r5, r0 + lsrs r5, 24 + ldr r1, [sp, 0xC] + lsls r4, r1, 3 + ldr r0, =gUnknown_08589904 + adds r0, r4, r0 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_08589924 + adds r4, r0 + adds r0, r4, 0 + bl LoadTaggedObjectPalette + ldr r2, [sp, 0xC] + lsls r4, r2, 1 + adds r4, r2 + lsls r4, 3 + ldr r0, =gUnknown_0858998C + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB8 + adds r2, r5, 0 + movs r3, 0x1D + bl AddObjectToFront + mov r9, r0 + mov r3, r9 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + adds r0, r4, 0 + movs r1, 0xF8 + adds r2, r5, 0 + movs r3, 0x1D + bl AddObjectToFront + mov r8, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r5, r0, 4 + add r5, r8 + lsls r5, 2 + ldr r1, =0x02020630 + adds r5, r1 + ldrh r2, [r5, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x40 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + movs r4, 0xC0 + lsls r4, 19 + ldrb r0, [r6] + lsls r3, r0, 2 + adds r3, r0 + lsls r3, 6 + ldr r0, =0x0600e026 + adds r3, r0 + ldr r7, =0x02039f34 + ldr r0, [r7] + ldr r0, [r0, 0x34] + str r0, [sp] + movs r0, 0 + movs r1, 0x3 + adds r2, r4, 0 + bl rfu_MBOOT_CHILD_inheritanceLinkStatus + ldrb r0, [r6] + lsls r3, r0, 2 + adds r3, r0 + lsls r3, 6 + ldr r1, =0x0600e036 + adds r3, r1 + ldr r0, [r7] + ldr r0, [r0, 0x38] + str r0, [sp] + movs r0, 0 + movs r1, 0x3 + adds r2, r4, 0 + bl rfu_MBOOT_CHILD_inheritanceLinkStatus + movs r4, 0 + str r4, [sp, 0x4] + ldr r0, [r7] + ldr r1, [r0, 0x34] + movs r6, 0xA0 + lsls r6, 3 + adds r1, r6 + ldr r2, =0x050000c0 + mov r10, r2 + add r0, sp, 0x4 + bl CpuSet + str r4, [sp, 0x8] + add r0, sp, 0x8 + ldr r1, [r7] + ldr r1, [r1, 0x38] + adds r1, r6 + mov r2, r10 + bl CpuSet + ldr r0, [r7] + ldr r0, [r0, 0x34] + mov r3, r9 + lsls r4, r3, 4 + add r4, r9 + lsls r4, 2 + ldr r1, =0x02020630 + adds r4, r1 + ldrh r1, [r4, 0x4] + lsls r1, 22 + lsrs r1, 17 + ldr r6, =0x06010000 + adds r1, r6 + movs r2, 0x80 + lsls r2, 4 + mov r10, r2 + movs r3, 0x1 + bl RequestDma3Copy + ldr r0, [r7] + ldr r0, [r0, 0x38] + ldrh r1, [r5, 0x4] + lsls r1, 22 + lsrs r1, 17 + adds r1, r6 + mov r2, r10 + movs r3, 0x1 + bl RequestDma3Copy + mov r3, r8 + strh r3, [r4, 0x2E] + mov r0, r9 + strh r0, [r5, 0x2E] + mov r1, sp + ldrh r1, [r1, 0xC] + strh r1, [r4, 0x30] + mov r2, sp + ldrh r2, [r2, 0xC] + strh r2, [r5, 0x30] + mov r0, r9 + 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_80DC9EC + + thumb_func_start sub_80DCB78 +sub_80DCB78: @ 80DCB78 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02020630 + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + adds r5, r1 + ldrh r0, [r5, 0x2E] + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r4, r1 + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + adds r0, r5, 0 + bl RemoveObjectAndFreeResources + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DCB78 + + thumb_func_start sub_80DCBB4 +sub_80DCBB4: @ 80DCBB4 + push {lr} + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x00000907 + movs r0, 0x52 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DCBB4 + + thumb_func_start sub_80DCBD0 +sub_80DCBD0: @ 80DCBD0 + push {lr} + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + pop {r0} + bx r0 + thumb_func_end sub_80DCBD0 + + thumb_func_start sub_80DCBE8 +sub_80DCBE8: @ 80DCBE8 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + adds r4, r0, 0 + mov r9, r1 + lsls r4, 24 + lsrs r4, 24 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + bl sub_80DCBB4 + ldr r0, =0x02039f34 + ldr r1, [r0] + ldr r2, =0x02020630 + mov r8, r2 + lsls r6, r4, 4 + adds r6, r4 + lsls r6, 2 + adds r0, r6, r2 + movs r3, 0x30 + ldrsh r2, [r0, r3] + ldr r1, [r1, 0x14] + lsls r2, 2 + adds r2, r1 + ldrb r1, [r2, 0x2] + movs r3, 0x2 + orrs r1, r3 + strb r1, [r2, 0x2] + ldrh r5, [r0, 0x2E] + lsls r5, 24 + lsrs r5, 24 + movs r1, 0x1 + bl StartObjectRotScalAnim + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + mov r1, r8 + adds r0, r4, r1 + movs r1, 0x1 + bl StartObjectRotScalAnim + movs r2, 0x1C + add r8, r2 + add r6, r8 + ldr r0, =sub_80DCC84 + str r0, [r6] + add r4, r8 + ldr r0, =DummyObjectCallback + str r0, [r4] + mov r3, r9 + cmp r3, 0 + bne _080DCC70 + movs r0, 0x65 + bl audio_play + b _080DCC76 + .pool +_080DCC70: + movs r0, 0x2 + bl audio_play +_080DCC76: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80DCBE8 + + thumb_func_start sub_80DCC84 +sub_80DCC84: @ 80DCC84 + push {lr} + mov r12, r0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080DCCCC + mov r0, r12 + ldrh r1, [r0, 0x2E] + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x02020630 + 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, 26 + cmp r0, 0 + bge _080DCCCC + mov r3, r12 + adds r3, 0x3E + ldrb r0, [r3] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r3] + adds r1, 0x3E + ldrb r0, [r1] + orrs r0, r2 + strb r0, [r1] + ldr r0, =sub_80DCCD8 + mov r1, r12 + str r0, [r1, 0x1C] +_080DCCCC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DCC84 + + thumb_func_start sub_80DCCD8 +sub_80DCCD8: @ 80DCCD8 + push {lr} + ldr r1, =0x02039f34 + ldr r1, [r1] + movs r3, 0x30 + ldrsh r2, [r0, r3] + ldr r1, [r1, 0x14] + lsls r2, 2 + adds r2, r1 + ldrb r3, [r2, 0x2] + movs r1, 0x3 + negs r1, r1 + ands r1, r3 + strb r1, [r2, 0x2] + ldrh r0, [r0, 0x2E] + lsls r0, 24 + lsrs r0, 24 + bl sub_80DCB78 + bl sub_80DCBD0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DCCD8 + + thumb_func_start sub_80DCD08 +sub_80DCD08: @ 80DCD08 + push {lr} + ldr r0, =0x02000000 + movs r1, 0xD0 + lsls r1, 9 + adds r2, r0, r1 + ldrb r1, [r2] + adds r3, r0, 0 + cmp r1, 0x1 + bne _080DCD24 + movs r0, 0 + b _080DCD26 + .pool +_080DCD24: + movs r0, 0x1 +_080DCD26: + strb r0, [r2] + movs r1, 0xD0 + lsls r1, 9 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080DCD3E + bl sub_80DAEA4 + bl sub_80DB2BC + b _080DCD42 +_080DCD3E: + bl sub_80DCD48 +_080DCD42: + pop {r0} + bx r0 + thumb_func_end sub_80DCD08 + + thumb_func_start sub_80DCD48 +sub_80DCD48: @ 80DCD48 + push {r4,r5,lr} + sub sp, 0xC + ldr r0, =0x020322d5 + ldrb r0, [r0] + cmp r0, 0 + beq _080DCE44 + ldr r0, =0x02000000 + movs r1, 0xD0 + lsls r1, 9 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080DCE44 + cmp r0, 0 + blt _080DCD7C + cmp r0, 0x3 + bgt _080DCD7C + cmp r0, 0x2 + blt _080DCD7C + bl sub_80DF750 + b _080DCE44 + .pool +_080DCD7C: + movs r5, 0 +_080DCD7E: + adds r0, r5, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _080DCD7E + movs r5, 0 +_080DCD92: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r1 + add r2, sp, 0x4 + ldrh r4, [r0, 0x4] + movs r1, 0x4 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _080DCDBC + negs r0, r0 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r2, 0 + ldr r1, =gUnknown_085E8D40 + bl CopyString + adds r2, r0, 0 +_080DCDBC: + lsls r1, r4, 16 + asrs r1, 16 + adds r0, r2, 0 + movs r2, 0 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldr r0, =0x02039f26 + adds r0, r5, r0 + ldrb r0, [r0] + movs r1, 0x7 + str r1, [sp] + add r1, sp, 0x4 + movs r2, 0x37 + movs r3, 0x1 + bl sub_80DEBD0 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _080DCD92 + movs r5, 0 +_080DCDEA: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r1 + add r2, sp, 0x4 + ldrh r4, [r0, 0x2] + movs r1, 0x2 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _080DCE14 + negs r0, r0 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r2, 0 + ldr r1, =gUnknown_085E8D40 + bl CopyString + adds r2, r0, 0 +_080DCE14: + lsls r1, r4, 16 + asrs r1, 16 + adds r0, r2, 0 + movs r2, 0 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldr r0, =0x02039f26 + adds r0, r5, r0 + ldrb r0, [r0] + movs r1, 0x7 + str r1, [sp] + add r1, sp, 0x4 + movs r2, 0x5 + movs r3, 0x1 + bl sub_80DEBD0 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _080DCDEA + bl sub_80DB2BC +_080DCE44: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DCD48 + + thumb_func_start sub_80DCE58 +sub_80DCE58: @ 80DCE58 + 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 r8, r0 + add r4, sp, 0x4 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x8 + bl memset + movs r5, 0 + add r4, sp, 0x4 + adds r6, r4, 0 + movs r7, 0 +_080DCE7E: + bl GenerateRandomNumber + adds r1, r0, 0 + mov r0, sp + adds r0, r7 + adds r0, 0x4 + strh r1, [r0] + movs r2, 0 + cmp r2, r5 + bge _080DCEB6 + lsls r0, r1, 16 + lsrs r0, 16 + mov r1, sp + ldrh r1, [r1, 0x4] + cmp r0, r1 + beq _080DCEB0 +_080DCE9E: + adds r2, 0x1 + cmp r2, r5 + bge _080DCEB6 + lsls r0, r2, 1 + adds r0, r4, r0 + ldrh r1, [r6] + ldrh r0, [r0] + cmp r1, r0 + bne _080DCE9E +_080DCEB0: + subs r6, 0x2 + subs r7, 0x2 + subs r5, 0x1 +_080DCEB6: + adds r6, 0x2 + adds r7, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _080DCE7E + mov r2, r8 + cmp r2, 0 + bne _080DCF80 + movs r5, 0 + ldr r3, =0x02039f26 + mov r8, r3 +_080DCECC: + mov r6, r8 + strb r5, [r6] + movs r4, 0 + cmp r4, r5 + bge _080DCF48 + ldr r7, =0x02039f00 + mov r9, r7 + lsls r0, r5, 1 + adds r1, r0, 0 + add r1, r9 + mov r12, r1 + mov r2, sp + adds r2, 0x4 + str r2, [sp, 0xC] + add r0, sp + adds r0, 0x4 + str r0, [sp, 0x10] + ldr r3, =0x02039f26 + adds r6, r3, 0 + mov r10, r6 +_080DCEF4: + ldrb r0, [r3] + lsls r2, r0, 1 + mov r7, r9 + adds r0, r2, r7 + movs r6, 0 + ldrsh r1, [r0, r6] + mov r7, r12 + movs r6, 0 + ldrsh r0, [r7, r6] + cmp r1, r0 + blt _080DCF1C + cmp r1, r0 + bne _080DCF40 + ldr r7, [sp, 0xC] + adds r0, r7, r2 + ldrh r0, [r0] + ldr r1, [sp, 0x10] + ldrh r1, [r1] + cmp r0, r1 + bcs _080DCF40 +_080DCF1C: + adds r2, r5, 0 + cmp r5, r4 + ble _080DCF34 + subs r0, r5, 0x1 + mov r6, r10 + adds r1, r0, r6 +_080DCF28: + ldrb r0, [r1] + strb r0, [r1, 0x1] + subs r1, 0x1 + subs r2, 0x1 + cmp r2, r4 + bgt _080DCF28 +_080DCF34: + strb r5, [r3] + b _080DCF48 + .pool +_080DCF40: + adds r3, 0x1 + adds r4, 0x1 + cmp r4, r5 + blt _080DCEF4 +_080DCF48: + cmp r4, r5 + bne _080DCF50 + mov r7, r8 + strb r5, [r7] +_080DCF50: + movs r0, 0x1 + add r8, r0 + adds r5, 0x1 + cmp r5, 0x3 + ble _080DCECC + ldr r4, =0x02039f26 + mov r0, sp + adds r1, r4, 0 + movs r2, 0x4 + bl memcpy + movs r5, 0 +_080DCF68: + mov r1, sp + adds r0, r1, r5 + ldrb r0, [r0] + adds r0, r4 + strb r5, [r0] + adds r5, 0x1 + cmp r5, 0x3 + ble _080DCF68 + b _080DD034 + .pool +_080DCF80: + mov r0, sp + movs r1, 0xFF + movs r2, 0x4 + bl memset + movs r5, 0 + ldr r3, =0x02039f26 + movs r6, 0 +_080DCF90: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x4] + adds r0, r6, r0 + ldrb r0, [r0, 0xB] + lsls r0, 30 + lsrs r2, r0, 30 + mov r7, sp + adds r1, r7, r2 + b _080DCFB6 + .pool +_080DCFAC: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + mov r0, sp + adds r1, r0, r2 +_080DCFB6: + ldrb r0, [r1] + cmp r0, 0xFF + bne _080DCFAC + strb r5, [r1] + strb r2, [r3] + adds r3, 0x1 + adds r6, 0x1C + adds r5, 0x1 + cmp r5, 0x3 + ble _080DCF90 + movs r5, 0 +_080DCFCC: + movs r4, 0x3 + adds r1, r5, 0x1 + mov r10, r1 + cmp r4, r5 + ble _080DD02E + mov r9, r4 + ldr r2, =0x02039f26 + mov r8, r2 + add r3, sp, 0x4 + mov r12, r3 +_080DCFE0: + ldr r6, =0x02039f34 + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r1 + adds r1, r0, 0 + subs r1, 0x1C + ldrb r2, [r1, 0xB] + ldrb r3, [r0, 0xB] + mov r1, r9 + ands r1, r2 + mov r0, r9 + ands r0, r3 + subs r3, r4, 0x1 + cmp r1, r0 + bne _080DD028 + mov r0, r8 + adds r7, r3, r0 + adds r2, r4, r0 + ldrb r6, [r7] + ldrb r1, [r2] + cmp r6, r1 + bcs _080DD028 + lsls r0, r3, 1 + add r0, r12 + lsls r1, r4, 1 + add r1, r12 + ldrh r0, [r0] + ldrh r1, [r1] + cmp r0, r1 + bcs _080DD028 + ldrb r0, [r2] + strb r6, [r2] + strb r0, [r7] +_080DD028: + adds r4, r3, 0 + cmp r4, r5 + bgt _080DCFE0 +_080DD02E: + mov r5, r10 + cmp r5, 0x2 + ble _080DCFCC +_080DD034: + 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_80DCE58 + + thumb_func_start sub_80DD04C +sub_80DD04C: @ 80DD04C + push {r4,r5,lr} + movs r4, 0 + movs r5, 0xA0 +_080DD052: + ldr r0, =0x0201a004 + adds r0, r5, r0 + ldr r1, =0x02039f26 + adds r1, r4, r1 + ldrb r1, [r1] + adds r1, 0x5 + lsls r1, 4 + movs r2, 0x20 + bl gpu_pal_apply + adds r5, 0x20 + adds r4, 0x1 + cmp r4, 0x3 + ble _080DD052 + bl sub_80DAEA4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DD04C + + thumb_func_start sub_80DD080 +sub_80DD080: @ 80DD080 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r4, =0x02039f34 + ldr r3, [r4] + ldr r1, [r3, 0x4] + lsls r7, r6, 3 + subs r0, r7, r6 + lsls r5, r0, 2 + adds r1, r5, r1 + movs r2, 0 + strh r2, [r1, 0x2] + ldr r0, [r3, 0x4] + adds r0, r5, r0 + strh r2, [r0] + adds r0, r6, 0 + bl sub_80DBA68 + lsls r0, 24 + mov r8, r4 + cmp r0, 0 + bne _080DD0B4 + b _080DD3C4 +_080DD0B4: + ldr r0, [r4] + ldr r1, [r0, 0x4] + adds r1, r5, r1 + ldrh r0, [r1, 0x6] + ldr r2, =gContestMoves + lsls r0, 3 + adds r0, r2 + ldrb r2, [r0] + mov r9, r2 + ldrb r0, [r0, 0x1] + lsls r0, 29 + lsrs r0, 29 + strb r0, [r1, 0xA] + ldr r0, [r4] + ldr r0, [r0, 0x4] + adds r2, r5, r0 + ldrh r0, [r2, 0x6] + ldrh r1, [r2, 0x8] + cmp r0, r1 + bne _080DD110 + cmp r0, 0 + beq _080DD110 + ldrb r0, [r2, 0x15] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x15] + ldr r0, [r4] + ldr r2, [r0, 0x4] + adds r2, r5, r2 + ldrb r3, [r2, 0xB] + lsls r1, r3, 25 + lsrs r1, 29 + adds r1, 0x1 + movs r0, 0x7 + ands r1, r0 + lsls r1, 4 + movs r0, 0x71 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0xB] + b _080DD12C + .pool +_080DD110: + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r0, [r0, 0x4] + lsls r3, r6, 3 + subs r1, r3, r6 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0xB] + movs r0, 0x71 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0xB] + mov r8, r4 + adds r7, r3, 0 +_080DD12C: + mov r2, r8 + ldr r4, [r2] + ldr r2, [r4, 0x4] + subs r0, r7, r6 + lsls r0, 2 + adds r2, r0, r2 + ldr r3, =gContestEffects + mov r1, r9 + lsls r5, r1, 2 + adds r3, r5, r3 + ldrb r1, [r3, 0x1] + strh r1, [r2] + ldr r1, [r4, 0x4] + adds r0, r1 + ldrh r1, [r0] + strh r1, [r0, 0x2] + ldr r1, [r4, 0x8] + ldrb r0, [r3, 0x2] + strh r0, [r1, 0x4] + ldr r1, [r4, 0x8] + ldrh r0, [r1, 0x4] + strh r0, [r1, 0x6] + ldr r0, [r4, 0x8] + strb r6, [r0, 0x11] + movs r2, 0 + mov r9, r5 + mov r4, r8 + movs r3, 0 + movs r1, 0 +_080DD166: + ldr r0, [r4] + ldr r0, [r0, 0x4] + adds r0, r1, r0 + strb r3, [r0, 0xE] + ldr r0, [r4] + ldr r0, [r0, 0x8] + adds r0, 0xD + adds r0, r2 + strb r3, [r0] + adds r1, 0x1C + adds r2, 0x1 + cmp r2, 0x3 + ble _080DD166 + ldr r5, =0x02039f34 + ldr r0, [r5] + ldr r1, [r0, 0x4] + subs r0, r7, r6 + lsls r4, r0, 2 + adds r2, r4, r1 + ldrb r1, [r2, 0x15] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080DD1B4 + ldrh r0, [r2, 0x8] + ldrh r1, [r2, 0x6] + bl AreMovesContestCombo + lsls r0, 24 + cmp r0, 0 + bne _080DD1B4 + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x15] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x15] +_080DD1B4: + ldr r0, =gContestEffectFunctionTable + add r0, r9 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0x4] + subs r0, r7, r6 + lsls r0, 2 + adds r2, r0, r1 + ldrb r1, [r2, 0x10] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0x10 + bne _080DD1EC + ldrh r1, [r2, 0x2] + subs r1, 0xA + movs r0, 0xD + ldrsb r0, [r2, r0] + b _080DD206 + .pool +_080DD1EC: + ldrb r1, [r2, 0x11] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080DD200 + movs r1, 0xD + ldrsb r1, [r2, r1] + lsls r0, r1, 1 + adds r0, r1 + b _080DD204 +_080DD200: + movs r0, 0xD + ldrsb r0, [r2, r0] +_080DD204: + ldrh r1, [r2, 0x2] +_080DD206: + adds r0, r1 + strh r0, [r2, 0x2] + ldr r5, =0x02039f34 + ldr r0, [r5] + ldr r1, [r0, 0x4] + subs r0, r7, r6 + lsls r4, r0, 2 + adds r1, r4, r1 + movs r0, 0 + strb r0, [r1, 0x16] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x15] + movs r0, 0x41 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x15] + adds r0, r6, 0 + bl sub_80DE1E8 + lsls r0, 24 + cmp r0, 0 + beq _080DD2E2 + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrh r0, [r1, 0x8] + ldrh r1, [r1, 0x6] + bl AreMovesContestCombo + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _080DD29C + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r2, r4, r0 + ldrb r1, [r2, 0x15] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080DD29C + strb r3, [r2, 0x16] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r0, [r1, 0x15] + movs r2, 0x40 + orrs r0, r2 + strb r0, [r1, 0x15] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r2, [r1, 0x15] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x15] + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + movs r1, 0 + ldrsh r2, [r0, r1] + ldrb r1, [r0, 0x16] + muls r1, r2 + strb r1, [r0, 0x17] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r0, [r1, 0x15] + movs r2, 0x8 + b _080DD2C8 + .pool +_080DD29C: + ldr r2, =gContestMoves + ldr r5, =0x02039f34 + ldr r0, [r5] + ldr r1, [r0, 0x4] + subs r0, r7, r6 + lsls r4, r0, 2 + adds r3, r4, r1 + ldrh r0, [r3, 0x6] + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x2] + cmp r0, 0 + beq _080DD2D8 + ldrb r0, [r3, 0x15] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r3, 0x15] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r0, [r1, 0x15] + movs r2, 0x40 +_080DD2C8: + orrs r0, r2 + strb r0, [r1, 0x15] + b _080DD2E2 + .pool +_080DD2D8: + ldrb r1, [r3, 0x15] + movs r0, 0x11 + negs r0, r0 + ands r0, r1 + strb r0, [r3, 0x15] +_080DD2E2: + ldr r5, =0x02039f34 + ldr r0, [r5] + ldr r1, [r0, 0x4] + subs r0, r7, r6 + lsls r4, r0, 2 + adds r2, r4, r1 + ldrb r1, [r2, 0x15] + movs r0, 0x1 + mov r8, r0 + ands r0, r1 + cmp r0, 0 + beq _080DD30A + ldrb r0, [r2, 0xB] + lsls r0, 25 + lsrs r0, 29 + adds r0, 0x1 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 1 + strb r1, [r2, 0x18] +_080DD30A: + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r2, r4, r0 + ldrb r1, [r2, 0xC] + mov r0, r8 + ands r0, r1 + cmp r0, 0 + beq _080DD334 + ldrb r1, [r2, 0x15] + movs r0, 0x11 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x15] + ldr r2, [r5] + ldr r0, [r2, 0x4] + adds r0, r4, r0 + movs r1, 0 + strh r1, [r0, 0x2] + ldr r0, [r2, 0x4] + adds r0, r4, r0 + strh r1, [r0] +_080DD334: + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + ldrh r0, [r0, 0x6] + bl sub_80DD9F0 + ldr r1, [r5] + ldr r1, [r1, 0x10] + strb r0, [r1] + ldr r2, [r5] + ldr r0, [r2, 0x4] + adds r0, r4, r0 + ldrb r1, [r0, 0x11] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080DD35C + ldr r0, [r2, 0x10] + mov r1, r8 + strb r1, [r0] +_080DD35C: + ldr r1, [r5] + ldr r3, [r1, 0x10] + movs r0, 0 + ldrsb r0, [r3, r0] + cmp r0, 0 + ble _080DD388 + ldr r0, [r1] + ldrb r0, [r0, 0x13] + lsls r0, 24 + asrs r0, 24 + movs r1, 0 + ldrsb r1, [r3, r1] + adds r0, r1 + cmp r0, 0x4 + ble _080DD384 + movs r0, 0x3C + b _080DD38A + .pool +_080DD384: + movs r0, 0xA + b _080DD38A +_080DD388: + movs r0, 0 +_080DD38A: + strb r0, [r3, 0x2] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + b _080DD3AE +_080DD3A2: + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 +_080DD3A8: + adds r2, 0x1 + cmp r2, 0x3 + bgt _080DD3B6 +_080DD3AE: + cmp r2, r6 + beq _080DD3A8 + cmp r0, 0 + bne _080DD3A2 +_080DD3B6: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0x4] + subs r0, r7, r6 + lsls r0, 2 + adds r0, r1 + strb r2, [r0, 0x1B] +_080DD3C4: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DD080 + + thumb_func_start sub_80DD3D4 +sub_80DD3D4: @ 80DD3D4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02039f34 + ldr r2, [r2] + ldr r3, [r2, 0x4] + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 2 + adds r2, r3 + strb r1, [r2, 0x13] + bx lr + .pool + thumb_func_end sub_80DD3D4 + + thumb_func_start sub_80DD3F0 +sub_80DD3F0: @ 80DD3F0 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02039f34 + ldr r2, [r2] + ldr r3, [r2, 0x4] + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 2 + adds r2, r3 + strb r1, [r2, 0x14] + bx lr + .pool + thumb_func_end sub_80DD3F0 + + thumb_func_start sub_80DD40C +sub_80DD40C: @ 80DD40C + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r3, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r2, r1, 0 + cmp r1, 0x3B + bls _080DD426 + movs r1, 0x35 + bl sub_80DD3D4 + b _080DD456 +_080DD426: + cmp r1, 0x27 + bls _080DD432 + movs r1, 0x34 + bl sub_80DD3D4 + b _080DD456 +_080DD432: + cmp r1, 0x1D + bls _080DD43E + movs r1, 0x33 + bl sub_80DD3D4 + b _080DD456 +_080DD43E: + cmp r1, 0x13 + bls _080DD44A + movs r1, 0x32 + bl sub_80DD3D4 + b _080DD456 +_080DD44A: + cmp r2, 0x9 + bls _080DD456 + adds r0, r3, 0 + movs r1, 0x31 + bl sub_80DD3D4 +_080DD456: + pop {r0} + bx r0 + thumb_func_end sub_80DD40C + + thumb_func_start sub_80DD45C +sub_80DD45C: @ 80DD45C + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r6, r1, 24 + ldr r0, =0x02021cc4 + lsls r1, r4, 6 + ldr r2, =0x02039e02 + adds r1, r2 + bl CopyString + ldr r0, =0x02021dc4 + ldr r5, =0x02039f34 + ldr r1, [r5] + ldr r2, [r1, 0x4] + lsls r1, r4, 3 + subs r1, r4 + lsls r1, 2 + adds r1, r2 + ldrh r2, [r1, 0x6] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + ldr r3, =gContestMoves + ldr r1, [r5] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x6] + lsls r0, 3 + adds r0, r3 + ldrb r0, [r0, 0x1] + lsls r1, r0, 29 + cmp r1, 0 + bne _080DD4DC + ldr r0, =0x02021ec4 + ldr r1, =gUnknown_0827E837 + bl CopyString + b _080DD52C + .pool +_080DD4DC: + lsrs r0, r1, 29 + cmp r0, 0x1 + bne _080DD4F4 + ldr r0, =0x02021ec4 + ldr r1, =gUnknown_0827E83F + bl CopyString + b _080DD52C + .pool +_080DD4F4: + lsrs r0, r1, 29 + cmp r0, 0x2 + bne _080DD50C + ldr r0, =0x02021ec4 + ldr r1, =gUnknown_0827E847 + bl CopyString + b _080DD52C + .pool +_080DD50C: + lsrs r0, r1, 29 + cmp r0, 0x3 + bne _080DD524 + ldr r0, =0x02021ec4 + ldr r1, =gUnknown_0827E850 + bl CopyString + b _080DD52C + .pool +_080DD524: + ldr r0, =0x02021ec4 + ldr r1, =gUnknown_0827E85A + bl CopyString +_080DD52C: + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_08587E10 + lsls r0, r6, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl ExpandStringRefs + bl sub_80DB89C + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80DEC30 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DD45C + + thumb_func_start sub_80DD560 +sub_80DD560: @ 80DD560 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x02039f34 + ldr r1, [r4] + ldr r3, [r1, 0x4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r3, r1, r3 + ldrb r0, [r3, 0xC] + movs r2, 0x1 + orrs r0, r2 + strb r0, [r3, 0xC] + ldr r0, [r4] + ldr r0, [r0, 0x4] + adds r1, r0 + movs r0, 0 + strh r0, [r1, 0x6] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DD560 + + thumb_func_start sub_80DD590 +sub_80DD590: @ 80DD590 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + movs r0, 0 + mov r12, r0 + movs r4, 0 + ldr r1, =0x02039f26 + mov r9, r1 + add r2, sp, 0x4 + mov r6, r9 + movs r5, 0 + adds r3, r2, 0 +_080DD5AC: + mov r0, sp + adds r1, r0, r4 + adds r0, r4, r6 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, r4 + strb r5, [r0] + adds r4, 0x1 + cmp r4, 0x3 + ble _080DD5AC + movs r4, 0 + ldr r7, =0x02039f34 + ldr r1, [r7] + mov r8, r1 + adds r5, r2, 0 +_080DD5CA: + movs r2, 0 + mov r0, r8 + ldr r1, [r0, 0x4] +_080DD5D0: + ldrb r0, [r1, 0x19] + cmp r0, r4 + beq _080DD604 + adds r1, 0x1C + adds r2, 0x1 + cmp r2, 0x3 + ble _080DD5D0 +_080DD5DE: + cmp r2, 0x4 + bne _080DD684 + movs r2, 0 + ldrb r0, [r5] + cmp r0, 0 + bne _080DD612 + ldr r0, [r7] + ldr r0, [r0, 0x4] + ldrb r0, [r0, 0x19] + cmp r0, 0xFF + bne _080DD612 + mov r12, r2 + movs r2, 0x1 + b _080DD63A + .pool +_080DD604: + mov r1, sp + adds r0, r1, r2 + strb r4, [r0] + adds r1, r5, r2 + movs r0, 0x1 + strb r0, [r1] + b _080DD5DE +_080DD612: + adds r2, 0x1 + cmp r2, 0x3 + bgt _080DD676 + adds r0, r5, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080DD612 + ldr r0, [r7] + ldr r1, [r0, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x19] + cmp r0, 0xFF + bne _080DD612 + lsls r0, r2, 24 + lsrs r0, 24 + mov r12, r0 + adds r2, 0x1 +_080DD63A: + cmp r2, 0x3 + bgt _080DD676 + ldr r6, =0x02039f26 + lsls r0, r2, 3 + subs r0, r2 + lsls r3, r0, 2 +_080DD646: + adds r0, r5, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080DD66E + ldr r0, [r7] + ldr r0, [r0, 0x4] + adds r0, r3, r0 + ldrb r0, [r0, 0x19] + cmp r0, 0xFF + bne _080DD66E + mov r1, r12 + adds r0, r1, r6 + adds r1, r2, r6 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bls _080DD66E + lsls r0, r2, 24 + lsrs r0, 24 + mov r12, r0 +_080DD66E: + adds r3, 0x1C + adds r2, 0x1 + cmp r2, 0x3 + ble _080DD646 +_080DD676: + mov r0, sp + add r0, r12 + strb r4, [r0] + mov r0, r12 + adds r1, r5, r0 + movs r0, 0x1 + strb r0, [r1] +_080DD684: + adds r4, 0x1 + cmp r4, 0x3 + ble _080DD5CA + movs r4, 0 + ldr r6, =0x02039f34 + movs r5, 0 +_080DD690: + ldr r0, [r6] + ldr r1, [r0, 0x8] + adds r1, r4 + mov r0, sp + adds r3, r0, r4 + ldrb r0, [r3] + strb r0, [r1] + ldr r0, [r6] + ldr r0, [r0, 0x4] + adds r0, r5, r0 + movs r1, 0xFF + strb r1, [r0, 0x19] + ldr r0, [r6] + ldr r1, [r0, 0x4] + adds r1, r5, r1 + ldrb r2, [r1, 0x10] + movs r0, 0x3F + ands r0, r2 + strb r0, [r1, 0x10] + mov r0, r9 + adds r1, r4, r0 + ldrb r0, [r3] + strb r0, [r1] + adds r5, 0x1C + adds r4, 0x1 + cmp r4, 0x3 + ble _080DD690 + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DD590 + + thumb_func_start sub_80DD6DC +sub_80DD6DC: @ 80DD6DC + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x30] + adds r1, r0, 0x1 + strh r1, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x54 + ble _080DD712 + movs r0, 0 + strh r0, [r2, 0x30] + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r3] + ldr r0, =DummyObjectCallback + str r0, [r2, 0x1C] + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0] + ldrb r1, [r2, 0x6] + movs r0, 0x11 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x6] +_080DD712: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DD6DC + + thumb_func_start sub_80DD720 +sub_80DD720: @ 80DD720 + push {r4,r5,lr} + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0] + ldrb r5, [r0, 0x12] + cmp r1, 0x8 + bls _080DD734 + b _080DD8D4 +_080DD734: + lsls r0, r1, 2 + ldr r1, =_080DD748 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080DD748: + .4byte _080DD76C + .4byte _080DD76C + .4byte _080DD79C + .4byte _080DD7D0 + .4byte _080DD804 + .4byte _080DD838 + .4byte _080DD86C + .4byte _080DD8D4 + .4byte _080DD8A0 +_080DD76C: + ldr r0, =0x02020630 + lsls r4, r5, 4 + adds r1, r4, r5 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x2E] + ldr r2, =0x000003ff + ands r2, r0 + ldrh r3, [r1, 0x4] + ldr r0, =0xfffffc00 + ands r0, r3 + orrs r0, r2 + strh r0, [r1, 0x4] + movs r0, 0x20 + bl audio_play + b _080DD8F8 + .pool +_080DD79C: + ldr r0, =0x02020630 + lsls r4, r5, 4 + adds r1, r4, r5 + lsls r1, 2 + adds r1, r0 + ldrh r2, [r1, 0x2E] + adds r2, 0x4 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r2, r0 + ldrh r3, [r1, 0x4] + ldr r0, =0xfffffc00 + ands r0, r3 + orrs r0, r2 + strh r0, [r1, 0x4] + movs r0, 0x1F + bl audio_play + b _080DD8F8 + .pool +_080DD7D0: + ldr r0, =0x02020630 + lsls r4, r5, 4 + adds r1, r4, r5 + lsls r1, 2 + adds r1, r0 + ldrh r2, [r1, 0x2E] + adds r2, 0x8 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r2, r0 + ldrh r3, [r1, 0x4] + ldr r0, =0xfffffc00 + ands r0, r3 + orrs r0, r2 + strh r0, [r1, 0x4] + movs r0, 0x1F + bl audio_play + b _080DD8F8 + .pool +_080DD804: + ldr r0, =0x02020630 + lsls r4, r5, 4 + adds r1, r4, r5 + lsls r1, 2 + adds r1, r0 + ldrh r2, [r1, 0x2E] + adds r2, 0xC + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r2, r0 + ldrh r3, [r1, 0x4] + ldr r0, =0xfffffc00 + ands r0, r3 + orrs r0, r2 + strh r0, [r1, 0x4] + movs r0, 0x2D + bl audio_play + b _080DD8F8 + .pool +_080DD838: + ldr r0, =0x02020630 + lsls r4, r5, 4 + adds r1, r4, r5 + lsls r1, 2 + adds r1, r0 + ldrh r2, [r1, 0x2E] + adds r2, 0xC + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r2, r0 + ldrh r3, [r1, 0x4] + ldr r0, =0xfffffc00 + ands r0, r3 + orrs r0, r2 + strh r0, [r1, 0x4] + movs r0, 0x2D + bl audio_play + b _080DD8F8 + .pool +_080DD86C: + ldr r0, =0x02020630 + lsls r4, r5, 4 + adds r1, r4, r5 + lsls r1, 2 + adds r1, r0 + ldrh r2, [r1, 0x2E] + adds r2, 0x10 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r2, r0 + ldrh r3, [r1, 0x4] + ldr r0, =0xfffffc00 + ands r0, r3 + orrs r0, r2 + strh r0, [r1, 0x4] + movs r0, 0x2D + bl audio_play + b _080DD8F8 + .pool +_080DD8A0: + ldr r0, =0x02020630 + lsls r4, r5, 4 + adds r1, r4, r5 + lsls r1, 2 + adds r1, r0 + ldrh r2, [r1, 0x2E] + adds r2, 0x18 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r2, r0 + ldrh r3, [r1, 0x4] + ldr r0, =0xfffffc00 + ands r0, r3 + orrs r0, r2 + strh r0, [r1, 0x4] + movs r0, 0xC3 + bl audio_play + b _080DD8F8 + .pool +_080DD8D4: + ldr r0, =0x02020630 + lsls r4, r5, 4 + adds r1, r4, r5 + lsls r1, 2 + adds r1, r0 + ldrh r2, [r1, 0x2E] + adds r2, 0x14 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r2, r0 + ldrh r3, [r1, 0x4] + ldr r0, =0xfffffc00 + ands r0, r3 + orrs r0, r2 + strh r0, [r1, 0x4] + movs r0, 0x2D + bl audio_play +_080DD8F8: + adds r2, r4, 0 + ldr r4, =0x02020630 + adds r2, r5 + lsls r2, 2 + adds r1, r2, r4 + movs r0, 0 + strh r0, [r1, 0x30] + adds r1, 0x3E + ldrb r3, [r1] + subs r0, 0x5 + ands r0, r3 + strb r0, [r1] + adds r4, 0x1C + adds r2, r4 + ldr r0, =sub_80DD6DC + str r0, [r2] + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0] + ldrb r0, [r2, 0x6] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2, 0x6] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DD720 + + thumb_func_start sub_80DD940 +sub_80DD940: @ 80DD940 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r5, 0 + ldr r6, =0x02039f34 + ldr r0, =0x02020630 + mov r9, r0 + ldr r0, =0x06010000 + mov r8, r0 + ldr r7, =0x04000008 +_080DD956: + ldr r0, [r6] + ldr r1, [r0] + movs r0, 0x13 + ldrsb r0, [r1, r0] + ldr r4, =gUnknown_08D8EC24 + cmp r5, r0 + bge _080DD966 + adds r4, 0x40 +_080DD966: + adds r0, r1, 0 + adds r0, 0x58 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + ldrh r1, [r0, 0x4] + lsls r1, 22 + lsrs r1, 22 + adds r0, r5, 0 + adds r0, 0x11 + adds r1, r0 + lsls r1, 5 + add r1, r8 + adds r0, r4, 0 + adds r2, r7, 0 + bl CpuSet + adds r0, r4, 0 + adds r0, 0x20 + ldr r1, [r6] + ldr r1, [r1] + adds r1, 0x58 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r9 + ldrh r1, [r1, 0x4] + lsls r1, 22 + lsrs r1, 22 + adds r2, r5, 0 + adds r2, 0x19 + adds r1, r2 + lsls r1, 5 + add r1, r8 + adds r2, r7, 0 + bl CpuSet + ldr r0, [r6] + ldr r0, [r0] + ldrb r0, [r0, 0x13] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x4 + ble _080DD9C8 + bl sub_80DDA20 +_080DD9C8: + adds r5, 0x1 + cmp r5, 0x4 + ble _080DD956 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DD940 + + thumb_func_start sub_80DD9F0 +sub_80DD9F0: @ 80DD9F0 + lsls r0, 16 + ldr r3, =gUnknown_085899EC + ldr r1, =gContestMoves + lsrs r0, 13 + adds r0, r1 + ldrb r1, [r0, 0x1] + lsls r1, 29 + lsrs r1, 29 + ldr r0, =0x02039f2c + ldrh r2, [r0] + lsls r0, r2, 2 + adds r0, r2 + adds r1, r0 + adds r1, r3 + movs r0, 0 + ldrsb r0, [r1, r0] + bx lr + .pool + thumb_func_end sub_80DD9F0 + + thumb_func_start sub_80DDA20 +sub_80DDA20: @ 80DDA20 + push {r4,r5,lr} + ldr r0, =c3_08130B10 + movs r1, 0xA + bl CreateTask + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =0x03005e00 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + movs r0, 0x1 + strh r0, [r4, 0xA] + ldr r0, =0x0000abe2 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xC] + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80DDA20 + + thumb_func_start c3_08130B10 +c3_08130B10: @ 80DDA60 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r2, r0, r1 + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _080DDAFE + movs r0, 0 + strh r0, [r2, 0x8] + movs r3, 0xE + ldrsh r0, [r2, r3] + cmp r0, 0 + bne _080DDA94 + ldrh r0, [r2, 0x10] + adds r0, 0x1 + b _080DDA98 + .pool +_080DDA94: + ldrh r0, [r2, 0x10] + subs r0, 0x1 +_080DDA98: + strh r0, [r2, 0x10] + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0xC + ldrsh r0, [r4, r1] + lsls r0, 4 + movs r3, 0x84 + lsls r3, 1 + adds r6, r3, 0 + adds r0, r6 + lsls r0, 16 + lsrs r0, 16 + ldrb r2, [r4, 0x10] + ldr r3, =0x00007fff + movs r1, 0x1 + bl pal_fade_1 + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080DDACA + cmp r0, 0x10 + bne _080DDAFE +_080DDACA: + ldrh r0, [r4, 0xE] + movs r1, 0x1 + eors r0, r1 + strh r0, [r4, 0xE] + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x13] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x4 + bgt _080DDAFE + movs r3, 0xC + ldrsh r0, [r4, r3] + lsls r0, 4 + adds r0, r6 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1F + bl pal_fade_1 + adds r0, r5, 0 + bl DestroyTask +_080DDAFE: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end c3_08130B10 + + thumb_func_start sub_80DDB0C +sub_80DDB0C: @ 80DDB0C + push {r4,lr} + ldr r0, =sub_80DDB6C + movs r1, 0xA + bl CreateTask + ldr r3, =0x02020630 + ldr r4, =0x02039f34 + ldr r2, [r4] + ldr r0, [r2] + adds r0, 0x58 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldr r1, =0x0000ffba + strh r1, [r0, 0x24] + ldr r0, [r2] + adds r0, 0x58 + ldrb r1, [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] + ldr r0, [r4] + ldr r2, [r0] + ldrb r0, [r2, 0x6] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2, 0x6] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DDB0C + + thumb_func_start sub_80DDB6C +sub_80DDB6C: @ 80DDB6C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r3, r0, 0 + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r0, [r0] + adds r0, 0x58 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r2, r0, r1 + ldr r0, =0x03005e00 + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + movs r5, 0xD0 + lsls r5, 3 + adds r0, r5, 0 + ldrh r5, [r1, 0x1C] + adds r0, r5 + strh r0, [r1, 0x1C] + lsls r0, 16 + asrs r0, 24 + ldrh r5, [r2, 0x24] + adds r0, r5 + strh r0, [r2, 0x24] + ldrb r0, [r1, 0x1C] + strh r0, [r1, 0x1C] + movs r1, 0x24 + ldrsh r0, [r2, r1] + cmp r0, 0 + ble _080DDBB8 + movs r0, 0 + strh r0, [r2, 0x24] +_080DDBB8: + movs r5, 0x24 + ldrsh r0, [r2, r5] + cmp r0, 0 + bne _080DDBD4 + ldr r0, [r4] + ldr r2, [r0] + ldrb r1, [r2, 0x6] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x6] + adds r0, r3, 0 + bl DestroyTask +_080DDBD4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DDB6C + + thumb_func_start sub_80DDBE8 +sub_80DDBE8: @ 80DDBE8 + push {r4,r5,lr} + ldr r5, =0x02020630 + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x58 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _080DDC1C + ldrb r1, [r2, 0x6] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + b _080DDC40 + .pool +_080DDC1C: + ldr r0, =task08_080CD1CC + movs r1, 0xA + bl CreateTask + ldr r2, [r4] + ldr r0, [r2] + adds r0, 0x58 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0 + strh r1, [r0, 0x24] + ldr r2, [r2] + ldrb r0, [r2, 0x6] + movs r1, 0x40 + orrs r0, r1 +_080DDC40: + strb r0, [r2, 0x6] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DDBE8 + + thumb_func_start task08_080CD1CC +task08_080CD1CC: @ 80DDC4C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + ldr r5, =0x02039f34 + ldr r0, [r5] + ldr r0, [r0] + adds r0, 0x58 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r3, r0, r1 + ldr r0, =0x03005e00 + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 3 + adds r2, r0 + movs r1, 0xD0 + lsls r1, 3 + adds r0, r1, 0 + ldrh r1, [r2, 0x1C] + adds r0, r1 + strh r0, [r2, 0x1C] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r3, 0x24] + subs r1, r0 + strh r1, [r3, 0x24] + ldrb r0, [r2, 0x1C] + strh r0, [r2, 0x1C] + movs r2, 0x24 + ldrsh r0, [r3, r2] + movs r1, 0x46 + negs r1, r1 + cmp r0, r1 + bge _080DDC9C + ldr r0, =0x0000ffba + strh r0, [r3, 0x24] +_080DDC9C: + movs r2, 0x24 + ldrsh r0, [r3, r2] + cmp r0, r1 + bne _080DDCC4 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, [r5] + ldr r2, [r0] + ldrb r1, [r2, 0x6] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x6] + adds r0, r4, 0 + bl DestroyTask +_080DDCC4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end task08_080CD1CC + + thumb_func_start sub_80DDCDC +sub_80DDCDC: @ 80DDCDC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =sub_80DDD20 + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + lsls r4, 24 + asrs r4, 24 + strh r4, [r1, 0x8] + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0] + ldrb r0, [r2, 0x6] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2, 0x6] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DDCDC + + thumb_func_start sub_80DDD20 +sub_80DDD20: @ 80DDD20 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x1C + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080DDD54 + cmp r0, 0x1 + bgt _080DDD48 + cmp r0, 0 + beq _080DDD4E + b _080DDD9C + .pool +_080DDD48: + cmp r0, 0x2 + beq _080DDD70 + b _080DDD9C +_080DDD4E: + bl sub_80DDB0C + b _080DDD64 +_080DDD54: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0, 0x6] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _080DDD9C +_080DDD64: + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + b _080DDD9C + .pool +_080DDD70: + ldrh r0, [r4, 0x1E] + adds r1, r0, 0x1 + strh r1, [r4, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _080DDD9C + movs r0, 0 + strh r0, [r4, 0x1E] + bl sub_80DD940 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0] + ldrb r1, [r2, 0x6] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x6] + adds r0, r5, 0 + bl DestroyTask +_080DDD9C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DDD20 + + thumb_func_start sub_80DDDA8 +sub_80DDDA8: @ 80DDDA8 + ldr r3, =0x02020630 + ldr r0, =0x02039f34 + ldr r2, [r0] + ldr r0, [r2] + adds r0, 0x58 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x24] + ldr r0, [r2] + adds r0, 0x58 + ldrb r1, [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] + bx lr + .pool + thumb_func_end sub_80DDDA8 + + thumb_func_start sub_80DDDE4 +sub_80DDDE4: @ 80DDDE4 + ldr r2, =0x02020630 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0] + adds r0, 0x58 + 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] + bx lr + .pool + thumb_func_end sub_80DDDE4 + + thumb_func_start sub_80DDE0C +sub_80DDE0C: @ 80DDE0C + push {lr} + ldr r0, =sub_80DDE30 + movs r1, 0xF + bl CreateTask + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0] + ldrb r0, [r2, 0x6] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x6] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DDE0C + + thumb_func_start sub_80DDE30 +sub_80DDE30: @ 80DDE30 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x1C] + adds r1, r0, 0x1 + strh r1, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + ble _080DDEBA + movs r0, 0 + strh r0, [r4, 0x1C] + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080DDE78 + ldr r0, =0x02019000 + ldr r1, =0x06002000 + movs r2, 0x80 + lsls r2, 5 + movs r3, 0x1 + bl RequestDma3Copy + b _080DDE8C + .pool +_080DDE78: + ldr r0, =0x02018000 + ldr r1, =0x06002000 + movs r2, 0x80 + lsls r2, 5 + movs r3, 0x1 + bl RequestDma3Copy + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] +_080DDE8C: + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x1E] + movs r2, 0x1 + eors r1, r2 + strh r1, [r0, 0x1E] + movs r1, 0x20 + ldrsh r0, [r0, r1] + cmp r0, 0x9 + bne _080DDEBA + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0] + ldrb r1, [r2, 0x6] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x6] + adds r0, r5, 0 + bl DestroyTask +_080DDEBA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DDE30 + + thumb_func_start sub_80DDED0 +sub_80DDED0: @ 80DDED0 + push {r4-r7,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, =sub_80DDF80 + movs r1, 0xA + bl CreateTask + lsls r0, 24 + lsrs r6, r0, 24 + lsls r4, 24 + cmp r4, 0 + ble _080DDF38 + ldr r7, =0x0000237e + lsls r0, r5, 24 + adds r4, r0, 0 + cmp r4, 0 + ble _080DDF1C + movs r5, 0 + ldr r2, =0x02039f34 + ldr r0, [r2] + ldr r0, [r0] + movs r1, 0x13 + ldrsb r1, [r0, r1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 24 + lsrs r3, r0, 24 + b _080DDF4E + .pool +_080DDF1C: + ldr r2, =0x02039f34 + ldr r0, [r2] + ldr r0, [r0] + movs r1, 0x13 + ldrsb r1, [r0, r1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + movs r3, 0 + b _080DDF4E + .pool +_080DDF38: + movs r7, 0 + lsls r0, r5, 24 + adds r4, r0, 0 + cmp r4, 0 + ble _080DDF48 + movs r5, 0 + movs r3, 0xC + b _080DDF4C +_080DDF48: + movs r5, 0xC + movs r3, 0 +_080DDF4C: + ldr r2, =0x02039f34 +_080DDF4E: + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + strh r7, [r0, 0x8] + strh r5, [r0, 0xA] + asrs r1, r4, 24 + strh r1, [r0, 0xC] + strh r3, [r0, 0xE] + ldr r0, [r2] + ldr r2, [r0] + ldrb r1, [r2, 0x7] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x7] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DDED0 + + thumb_func_start sub_80DDF80 +sub_80DDF80: @ 80DDF80 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r3, r0, r2 + ldrh r0, [r3, 0x1C] + adds r1, r0, 0x1 + strh r1, [r3, 0x1C] + lsls r0, 16 + cmp r0, 0 + blt _080DDFFC + movs r0, 0 + strh r0, [r3, 0x1C] + movs r1, 0xC + ldrsh r0, [r3, r1] + cmp r0, 0 + ble _080DDFB4 + ldrh r0, [r3, 0xA] + adds r0, 0x1 + b _080DDFB8 + .pool +_080DDFB4: + ldrh r0, [r3, 0xA] + subs r0, 0x1 +_080DDFB8: + strh r0, [r3, 0xA] + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r2 + ldrb r2, [r4, 0xA] + ldrh r3, [r4, 0x8] + movs r0, 0x11 + movs r1, 0x1 + bl pal_fade_1 + ldrb r2, [r4, 0xA] + ldrh r3, [r4, 0x8] + movs r0, 0x1A + movs r1, 0x1 + bl pal_fade_1 + movs r2, 0xA + ldrsh r1, [r4, r2] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _080DDFFC + adds r0, r5, 0 + bl DestroyTask + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0] + ldrb r1, [r2, 0x7] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x7] +_080DDFFC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DDF80 + + thumb_func_start sub_80DE008 +sub_80DE008: @ 80DE008 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + movs r5, 0 + ldr r0, =0x02039f34 + mov r9, r0 + mov r8, r9 + ldr r6, =0x02020630 + movs r4, 0 + movs r7, 0 +_080DE026: + mov r1, r8 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r0, r7, r0 + ldrb r1, [r0, 0x10] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0 + beq _080DE0BC + mov r2, r10 + cmp r2, 0 + beq _080DE0BC + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_80DE0F0 + mov r3, r8 + ldr r1, [r3] + ldr r1, [r1, 0x14] + adds r1, r4, r1 + ldrb r2, [r1, 0x1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r6 + ldrh r1, [r1, 0x4] + lsls r1, 22 + lsrs r1, 17 + ldr r2, =0x060100c0 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + mov r0, r8 + ldr r3, [r0] + ldr r0, [r3, 0x14] + adds r0, r4, r0 + ldrb r0, [r0, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldr r2, =gUnknown_08587A70 + ldr r0, =0x02039f26 + adds r0, r5, r0 + ldrb r0, [r0] + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1, 0x22] + ldr r0, [r3, 0x14] + adds r0, r4, r0 + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + movs r3, 0x5 + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + b _080DE0D6 + .pool +_080DE0BC: + mov r1, r9 + ldr r0, [r1] + ldr r0, [r0, 0x14] + adds r0, r4, r0 + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 +_080DE0D6: + strb r1, [r0] + adds r4, 0x4 + adds r7, 0x1C + adds r5, 0x1 + cmp r5, 0x3 + ble _080DE026 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80DE008 + + thumb_func_start sub_80DE0F0 +sub_80DE0F0: @ 80DE0F0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02039f34 + ldr r1, [r1] + ldr r2, [r1, 0x4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r2, r1, r2 + ldrb r1, [r2, 0x10] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0x40 + bne _080DE120 + ldrb r0, [r2, 0x19] + lsls r0, 5 + ldr r1, =gUnknown_08D8E9B4 + adds r0, r1 + b _080DE122 + .pool +_080DE120: + ldr r0, =gUnknown_08D8EA34 +_080DE122: + pop {r1} + bx r1 + .pool + thumb_func_end sub_80DE0F0 + + thumb_func_start sub_80DE12C +sub_80DE12C: @ 80DE12C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + movs r7, 0 + movs r0, 0x2 + mov r10, r0 + movs r0, 0x1 + mov r8, r0 + movs r0, 0x11 + mov r9, r0 +_080DE146: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + adds r0, 0xD + adds r0, r7 + ldrb r0, [r0] + cmp r0, 0 + beq _080DE1CA + lsls r0, r7, 24 + lsrs r0, 24 + bl sub_80DBCA8 + lsls r0, 24 + cmp r0, 0 + bne _080DE1CA + ldr r0, =0x02039f26 + adds r0, r7, r0 + ldrb r0, [r0] + lsls r5, r0, 2 + adds r5, r0 + adds r6, r5, 0x2 + movs r0, 0x3 + bl sub_80DB748 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r6, 24 + lsrs r6, 24 + mov r0, r10 + str r0, [sp] + mov r0, r8 + str r0, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + mov r0, r8 + str r0, [sp, 0xC] + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x14 + adds r3, r6, 0 + bl sub_80DECB8 + adds r4, 0x10 + lsls r4, 16 + lsrs r4, 16 + adds r5, 0x3 + lsls r5, 24 + lsrs r5, 24 + mov r0, r10 + str r0, [sp] + mov r0, r8 + str r0, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + mov r0, r8 + str r0, [sp, 0xC] + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x14 + adds r3, r5, 0 + bl sub_80DECB8 + movs r0, 0x63 + bl audio_play +_080DE1CA: + adds r7, 0x1 + cmp r7, 0x3 + ble _080DE146 + 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_80DE12C + + thumb_func_start sub_80DE1E8 +sub_80DE1E8: @ 80DE1E8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02039f34 + ldr r1, [r1] + ldr r2, [r1, 0x4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r2, r1, r2 + ldrb r1, [r2, 0x15] + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _080DE212 + ldrb r1, [r2, 0xC] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _080DE21C +_080DE212: + movs r0, 0 + b _080DE21E + .pool +_080DE21C: + movs r0, 0x1 +_080DE21E: + pop {r1} + bx r1 + thumb_func_end sub_80DE1E8 + + thumb_func_start sub_80DE224 +sub_80DE224: @ 80DE224 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + movs r0, 0xA + bl GetGpuReg + mov r1, sp + strh r0, [r1] + mov r2, sp + ldrb r1, [r2] + movs r4, 0x4 + negs r4, r4 + adds r0, r4, 0 + ands r0, r1 + strb r0, [r2] + ldrb r1, [r2, 0x1] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x1] + ldrb r1, [r2, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x1] + ldrb r1, [r2] + movs r0, 0xD + negs r0, r0 + mov r8, r0 + ands r0, r1 + strb r0, [r2] + mov r0, sp + ldrh r1, [r0] + movs r0, 0xA + bl SetGpuReg + movs r0, 0x8 + bl GetGpuReg + mov r6, sp + adds r6, 0x2 + strh r0, [r6] + movs r0, 0xC + bl GetGpuReg + add r5, sp, 0x4 + strh r0, [r5] + ldrb r1, [r6] + adds r0, r4, 0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r6] + ldrb r0, [r5] + ands r4, r0 + orrs r4, r1 + strb r4, [r5] + ldrh r1, [r6] + movs r0, 0x8 + bl SetGpuReg + ldrh r1, [r5] + movs r0, 0xC + bl SetGpuReg + ldr r1, =0x02022e18 + movs r0, 0xF0 + strh r0, [r1] + ldr r4, =0x02022e1a + movs r0, 0xA0 + strh r0, [r4] + movs r0, 0x14 + movs r1, 0xF0 + bl SetGpuReg + ldrh r1, [r4] + movs r0, 0x16 + bl SetGpuReg + movs r0, 0 + str r0, [sp, 0x8] + add r0, sp, 0x8 + ldr r4, =0x02039f34 + ldr r1, [r4] + ldr r1, [r1, 0x28] + ldr r2, =0x05000400 + bl CpuSet + ldr r1, =gUnknown_08C17980 + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x1 + bl sub_80DED60 + movs r5, 0 + ldr r7, =0x02020630 + movs r6, 0x4 +_080DE2F0: + ldr r0, [r4] + ldr r0, [r0, 0x14] + lsls r3, r5, 2 + adds r0, r3, r0 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x5] + mov r0, r8 + ands r0, r2 + orrs r0, r6 + strb r0, [r1, 0x5] + ldr r0, [r4] + ldr r0, [r0, 0x14] + adds r3, r0 + ldrb r0, [r3, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x5] + mov r0, r8 + ands r0, r2 + orrs r0, r6 + strb r0, [r1, 0x5] + adds r5, 0x1 + cmp r5, 0x3 + ble _080DE2F0 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DE224 + + thumb_func_start sub_80DE350 +sub_80DE350: @ 80DE350 + push {r4-r7,lr} + sub sp, 0x8 + ldr r1, =0x06008000 + movs r2, 0x80 + lsls r2, 6 + movs r0, 0 + movs r3, 0x1 + bl RequestDma3Fill + movs r5, 0 + str r5, [sp] + ldr r6, =0x02039f34 + ldr r0, [r6] + ldr r1, [r0, 0x28] + ldr r2, =0x05000400 + mov r0, sp + bl CpuSet + movs r0, 0x1 + bl sub_80DED60 + movs r0, 0xA + bl GetGpuReg + add r3, sp, 0x4 + strh r0, [r3] + ldrb r1, [r3] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r3] + mov r1, sp + adds r1, 0x5 + ldrb r2, [r1] + movs r0, 0x3F + ands r0, r2 + strb r0, [r1] + ldrb r2, [r1] + movs r0, 0x21 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldrb r1, [r3] + movs r4, 0xD + negs r4, r4 + adds r0, r4, 0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r3] + ldrh r1, [r3] + movs r0, 0xA + bl SetGpuReg + ldr r0, =0x02022e18 + strh r5, [r0] + ldr r0, =0x02022e1a + strh r5, [r0] + ldr r7, =0x02020630 +_080DE3CA: + ldr r0, [r6] + ldr r0, [r0, 0x14] + lsls r3, r5, 2 + adds r0, r3, r0 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x5] + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1, 0x5] + ldr r0, [r6] + ldr r0, [r0, 0x14] + adds r3, r0 + ldrb r0, [r3, 0x1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x5] + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1, 0x5] + adds r5, 0x1 + cmp r5, 0x3 + ble _080DE3CA + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DE350 + + thumb_func_start sub_80DE424 +sub_80DE424: @ 80DE424 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =0x02022e18 + movs r0, 0 + strh r0, [r1] + ldr r1, =0x02022e1a + movs r0, 0xA0 + strh r0, [r1] + movs r0, 0x62 + movs r1, 0 + bl audio_play_and_stuff + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80DE464 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DE424 + + thumb_func_start sub_80DE464 +sub_80DE464: @ 80DE464 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, =0x02022e1a + ldrh r0, [r1] + subs r0, 0x7 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + bge _080DE47C + movs r0, 0 + strh r0, [r1] +_080DE47C: + ldrh r2, [r1] + cmp r2, 0 + bne _080DE496 + ldr r0, =0x03005e00 + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + strh r2, [r1, 0x8] + strh r2, [r1, 0xA] + strh r2, [r1, 0xC] + ldr r0, =sub_80DE4A8 + str r0, [r1] +_080DE496: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DE464 + + thumb_func_start sub_80DE4A8 +sub_80DE4A8: @ 80DE4A8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r3, r4, 2 + adds r0, r3, r4 + lsls r0, 3 + adds r5, r0, r1 + movs r0, 0x8 + ldrsh r1, [r5, r0] + cmp r1, 0x1 + beq _080DE52C + cmp r1, 0x1 + bgt _080DE4D0 + cmp r1, 0 + beq _080DE4DA + b _080DE5B4 + .pool +_080DE4D0: + cmp r1, 0x2 + beq _080DE58A + cmp r1, 0x3 + beq _080DE5A4 + b _080DE5B4 +_080DE4DA: + movs r2, 0 + adds r6, r3, 0 + ldr r5, =0x02039f34 + ldr r3, =0x02039f26 +_080DE4E2: + ldr r0, [r5] + ldr r1, [r0] + adds r1, 0x14 + adds r1, r2 + adds r0, r2, r3 + ldrb r0, [r0] + strb r0, [r1] + adds r2, 0x1 + cmp r2, 0x3 + ble _080DE4E2 + bl sub_80DBF90 + bl sub_80DC864 + bl sub_80DB69C + bl sub_80DD04C + movs r0, 0x1 + bl sub_80DE008 + bl sub_80DC44C + ldr r0, =0x03005e00 + adds r1, r6, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x8] + b _080DE5B4 + .pool +_080DE52C: + ldr r0, =0x02039f2a + ldrb r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _080DE584 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0] + ldrb r0, [r2, 0x7] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x7] + bl sub_80DA8A4 + lsls r0, 24 + cmp r0, 0 + beq _080DE552 + bl sub_80DBAA0 +_080DE552: + ldr r4, =sub_80FCC88 + adds r0, r4, 0 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =sub_80DA110 + adds r1, r4, 0 + bl SetTaskFuncWithFollowupFunc + bl sub_80DBF68 + movs r0, 0x2 + strh r0, [r5, 0x8] + b _080DE5B4 + .pool +_080DE584: + bl sub_80DBAA0 + b _080DE59A +_080DE58A: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0, 0x7] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080DE5B4 +_080DE59A: + movs r0, 0x3 + strh r0, [r5, 0x8] + b _080DE5B4 + .pool +_080DE5A4: + bl sub_80DB884 + bl sub_80DB2BC + movs r0, 0 + strh r0, [r5, 0x8] + ldr r0, =sub_80DE5F4 + str r0, [r5] +_080DE5B4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DE4A8 + + thumb_func_start sub_80DE5C0 +sub_80DE5C0: @ 80DE5C0 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x02022e1a + ldrh r0, [r1] + adds r0, 0x7 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA0 + ble _080DE5E4 + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80DA4F4 + str r0, [r1] +_080DE5E4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DE5C0 + + thumb_func_start sub_80DE5F4 +sub_80DE5F4: @ 80DE5F4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r2, [r1, 0xC] + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r0, 0x9 + bgt _080DE618 + adds r0, r2, 0x1 + strh r0, [r1, 0xC] + b _080DE654 + .pool +_080DE618: + ldrh r3, [r1, 0xA] + movs r4, 0xA + ldrsh r0, [r1, r4] + cmp r0, 0 + bne _080DE636 + ldrh r2, [r1, 0x8] + movs r4, 0x8 + ldrsh r0, [r1, r4] + cmp r0, 0x10 + bne _080DE632 + adds r0, r3, 0x1 + strh r0, [r1, 0xA] + b _080DE654 +_080DE632: + adds r0, r2, 0x1 + b _080DE652 +_080DE636: + ldrh r0, [r1, 0x8] + movs r3, 0x8 + ldrsh r2, [r1, r3] + cmp r2, 0 + bne _080DE650 + strh r2, [r1, 0xA] + strh r2, [r1, 0xC] + ldr r0, =sub_80DE65C + str r0, [r1] + b _080DE654 + .pool +_080DE650: + subs r0, 0x1 +_080DE652: + strh r0, [r1, 0x8] +_080DE654: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80DE5F4 + + thumb_func_start sub_80DE65C +sub_80DE65C: @ 80DE65C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r1, [r4, 0xC] + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0x9 + bgt _080DE680 + adds r0, r1, 0x1 + strh r0, [r4, 0xC] + b _080DE690 + .pool +_080DE680: + movs r0, 0 + strh r0, [r4, 0xC] + movs r0, 0x61 + movs r1, 0 + bl audio_play_and_stuff + ldr r0, =sub_80DE5C0 + str r0, [r4] +_080DE690: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DE65C + + thumb_func_start sub_80DE69C +sub_80DE69C: @ 80DE69C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r7, 0 + ldr r6, =0x02020630 + ldr r5, =0x02039f34 +_080DE6AE: + bl rotscale_alloc_entry + ldr r1, [r5] + ldr r1, [r1, 0x14] + lsls r4, r7, 2 + adds r1, r4, r1 + ldrb r1, [r1] + lsls r3, r1, 4 + adds r3, r1 + lsls r3, 2 + adds r3, r6 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1F + ands r0, r1 + lsls r0, 1 + ldrb r1, [r3, 0x3] + movs r2, 0x3F + negs r2, r2 + mov r12, r2 + mov r2, r12 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x3] + ldr r0, [r5] + ldr r0, [r0, 0x14] + adds r0, r4, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r2, [r0, 0x1] + movs r3, 0x4 + negs r3, r3 + adds r1, r3, 0 + ands r2, r1 + movs r1, 0x1 + orrs r2, r1 + strb r2, [r0, 0x1] + ldr r0, [r5] + ldr r0, [r0, 0x14] + adds r0, r4, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r1, r8 + bl StartObjectRotScalAnim + mov r0, r8 + cmp r0, 0x2 + bne _080DE74C + ldr r0, [r5] + ldr r0, [r0, 0x14] + adds r0, r4, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl AnimateObject + ldr r0, [r5] + ldr r0, [r0, 0x14] + adds r0, r4, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + movs r3, 0x5 + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + strb r1, [r0] +_080DE74C: + adds r7, 0x1 + cmp r7, 0x3 + ble _080DE6AE + ldr r0, =sub_80DE794 + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + mov r0, r8 + strh r0, [r1, 0x8] + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0] + ldrb r0, [r2, 0x7] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0x7] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DE69C + + thumb_func_start sub_80DE794 +sub_80DE794: @ 80DE794 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, =0x02020630 + ldr r3, =0x02039f34 + ldr r0, [r3] + ldr r0, [r0, 0x14] + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _080DE822 + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldrb r0, [r1, 0x8] + cmp r0, 0x1 + bne _080DE7EC + movs r4, 0 + adds r5, r2, 0 + movs r2, 0x4 +_080DE7CC: + ldr r0, [r3] + ldr r1, [r0, 0x14] + lsls r0, r4, 2 + adds r0, r1 + 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 r4, 0x1 + cmp r4, 0x3 + ble _080DE7CC +_080DE7EC: + movs r4, 0 +_080DE7EE: + ldr r5, =0x02039f34 + ldr r0, [r5] + ldr r1, [r0, 0x14] + lsls r0, r4, 2 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl obj_free_rotscale_entry + adds r4, 0x1 + cmp r4, 0x3 + ble _080DE7EE + ldr r0, [r5] + ldr r2, [r0] + ldrb r1, [r2, 0x7] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x7] + adds r0, r6, 0 + bl DestroyTask +_080DE822: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DE794 + + thumb_func_start sub_80DE834 +sub_80DE834: @ 80DE834 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + movs r0, 0xB1 + lsls r0, 1 + cmp r1, r0 + bls _080DE844 + movs r1, 0x1 +_080DE844: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_80DE834 + + thumb_func_start sub_80DE84C +sub_80DE84C: @ 80DE84C + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =0x0000019b + cmp r1, r0 + bls _080DE85A + movs r1, 0 +_080DE85A: + adds r0, r1, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80DE84C + + thumb_func_start sub_80DE864 +sub_80DE864: @ 80DE864 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r1, [r0, 0x4] + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x6] + bl sub_80DE834 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r1, =0x02039e00 + lsls r0, r7, 6 + adds r0, r1 + ldrh r0, [r0] + bl sub_80DE84C + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, [r4] + ldr r0, [r0, 0x18] + movs r1, 0 + movs r2, 0x14 + bl memset + bl sub_80A3934 + ldr r1, =0x020244e4 + movs r2, 0 + adds r0, r1, 0x3 +_080DE8A8: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _080DE8A8 + cmp r5, 0x90 + beq _080DE920 + cmp r5, 0x90 + bgt _080DE8DE + cmp r5, 0x4C + beq _080DE978 + cmp r5, 0x4C + bgt _080DE8D4 + cmp r5, 0xD + beq _080DE978 + b _080DE9A2 + .pool +_080DE8D4: + cmp r5, 0x82 + beq _080DE978 + cmp r5, 0x8F + beq _080DE978 + b _080DE9A2 +_080DE8DE: + cmp r5, 0xD8 + beq _080DE960 + cmp r5, 0xD8 + bgt _080DE8EC + cmp r5, 0xAE + beq _080DE8FA + b _080DE9A2 +_080DE8EC: + cmp r5, 0xDA + beq _080DE96C + movs r0, 0x88 + lsls r0, 1 + cmp r5, r0 + beq _080DE920 + b _080DE9A2 +_080DE8FA: + ldr r0, =gBaseStats + lsls r1, r6, 3 + subs r1, r6 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x6] + cmp r0, 0x7 + beq _080DE910 + ldrb r0, [r1, 0x7] + cmp r0, 0x7 + bne _080DE99C +_080DE910: + ldr r1, =0x02038432 + movs r0, 0 + b _080DE9A0 + .pool +_080DE920: + ldr r6, =0x02039f34 + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrb r4, [r0, 0x1B] + ldr r5, =0x02039e00 + lsls r4, 6 + adds r0, r4, r5 + ldrh r0, [r0] + bl sub_80DE84C + ldr r2, [r6] + ldr r1, [r2, 0x18] + strh r0, [r1, 0x2] + ldr r2, [r2, 0x18] + adds r5, 0x38 + adds r4, r5 + ldr r0, [r4] + str r0, [r2, 0x10] + ldrb r0, [r2, 0x4] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x4] + b _080DE9A2 + .pool +_080DE960: + ldr r1, =0x0203841a + movs r0, 0xFF + b _080DE9A0 + .pool +_080DE96C: + ldr r1, =0x0203841a + movs r0, 0 + b _080DE9A0 + .pool +_080DE978: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0] + adds r2, r0, 0 + adds r2, 0x5A + ldrb r1, [r2] + cmp r1, 0 + bne _080DE99C + movs r0, 0x2 + strb r0, [r2] + ldr r0, =0x02038432 + strb r1, [r0] + b _080DE9A2 + .pool +_080DE99C: + ldr r1, =0x02038432 + movs r0, 0x1 +_080DE9A0: + strb r0, [r1] +_080DE9A2: + bl sub_80DEA5C + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DE864 + + thumb_func_start sub_80DE9B0 +sub_80DE9B0: @ 80DE9B0 + push {r4,lr} + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r0, [r0, 0x18] + movs r1, 0 + movs r2, 0x14 + bl memset + ldr r0, [r4] + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x5A + ldrb r0, [r1] + cmp r0, 0 + beq _080DE9D2 + subs r0, 0x1 + strb r0, [r1] +_080DE9D2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DE9B0 + + thumb_func_start sub_80DE9DC +sub_80DE9DC: @ 80DE9DC + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r6, =0x02039f34 + ldr r0, [r6] + ldr r0, [r0, 0x18] + strb r4, [r0, 0x5] + ldr r5, =0x02039e00 + lsls r4, 6 + adds r0, r4, r5 + ldrh r0, [r0] + bl sub_80DE84C + ldr r2, [r6] + ldr r1, [r2, 0x18] + strh r0, [r1] + ldr r1, [r2, 0x18] + adds r0, r5, 0 + adds r0, 0x38 + adds r0, r4, r0 + ldr r0, [r0] + str r0, [r1, 0x8] + adds r5, 0x3C + adds r4, r5 + ldr r0, [r4] + str r0, [r1, 0xC] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DE9DC + + thumb_func_start sub_80DEA20 +sub_80DEA20: @ 80DEA20 + push {lr} + ldr r0, =DummyObjectCallback + bl object_new_hidden_with_callback + ldr r1, =0x020241e4 + strb r0, [r1, 0x3] + ldr r0, =0x0202420c + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl obj_alloc_rotscale_entry + bl sub_80DEA5C + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DEA20 + + thumb_func_start sub_80DEA5C +sub_80DEA5C: @ 80DEA5C + push {r4,lr} + ldr r0, =0x020241e4 + ldrb r0, [r0, 0x3] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + movs r0, 0 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + movs r0, 0x3 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + movs r0, 0x3 + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + adds r4, 0x3E + ldrb r0, [r4] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DEA5C + + thumb_func_start sub_80DEAA8 +sub_80DEAA8: @ 80DEAA8 + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r2, =gBattleMoves + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x6] + cmp r0, 0x20 + bhi _080DEB60 + lsls r0, 2 + ldr r1, =_080DEAD0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080DEAD0: + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB54 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB54 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 + .4byte _080DEB60 +_080DEB54: + ldr r1, =0x0202420c + movs r0, 0x2 + b _080DEB64 + .pool +_080DEB60: + ldr r1, =0x0202420c + movs r0, 0x3 +_080DEB64: + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DEAA8 + + thumb_func_start sub_80DEB70 +sub_80DEB70: @ 80DEB70 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + str r1, [sp] + mov r0, sp + movs r2, 0 + strb r4, [r0, 0x4] + movs r1, 0x1 + strb r1, [r0, 0x5] + strb r2, [r0, 0x6] + strb r1, [r0, 0x7] + strb r2, [r0, 0x8] + strb r1, [r0, 0x9] + strb r2, [r0, 0xA] + strb r2, [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 r0, 0xF0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + strb r1, [r2, 0xD] + mov r1, sp + movs r0, 0x80 + strb r0, [r1, 0xD] + mov r0, sp + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl PutWindowTilemap + movs r0, 0 + bl sub_80DED60 + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80DEB70 + + thumb_func_start sub_80DEBD0 +sub_80DEBD0: @ 80DEBD0 + push {r4,r5,lr} + sub sp, 0x10 + adds r5, r0, 0 + ldr r4, [sp, 0x1C] + str r1, [sp] + mov r0, sp + movs r1, 0 + strb r5, [r0, 0x4] + strb r4, [r0, 0x5] + strb r2, [r0, 0x6] + strb r3, [r0, 0x7] + strb r2, [r0, 0x8] + strb r3, [r0, 0x9] + strb r1, [r0, 0xA] + strb r1, [r0, 0xB] + mov r3, sp + ldrb r2, [r3, 0xC] + subs r1, 0x10 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + mov r2, sp + movs r0, 0xF0 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + strb r1, [r2, 0xD] + mov r1, sp + movs r0, 0x80 + strb r0, [r1, 0xD] + mov r0, sp + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + lsls r5, 24 + lsrs r5, 24 + adds r0, r5, 0 + bl PutWindowTilemap + movs r0, 0 + bl sub_80DED60 + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80DEBD0 + + thumb_func_start sub_80DEC30 +sub_80DEC30: @ 80DEC30 + push {r4,r5,lr} + sub sp, 0x10 + str r0, [sp] + mov r2, sp + movs r3, 0 + movs r0, 0x4 + strb r0, [r2, 0x4] + mov r0, sp + movs r5, 0x1 + strb r5, [r0, 0x5] + strb r3, [r0, 0x6] + strb r5, [r0, 0x7] + strb r3, [r0, 0x8] + strb r5, [r0, 0x9] + strb r3, [r0, 0xA] + strb r3, [r0, 0xB] + mov r4, sp + ldrb r3, [r4, 0xC] + movs r2, 0x10 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r4, 0xC] + mov r3, sp + movs r0, 0x10 + strb r0, [r3, 0xC] + ldrb r0, [r3, 0xD] + ands r2, r0 + strb r2, [r3, 0xD] + mov r2, sp + movs r0, 0x80 + strb r0, [r2, 0xD] + cmp r1, 0 + bne _080DEC80 + mov r0, sp + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + b _080DECA4 +_080DEC80: + ldr r0, =0x02039f2a + ldrb r1, [r0] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _080DEC94 + movs r1, 0x4 + b _080DEC9C + .pool +_080DEC94: + bl sav2_get_text_speed + lsls r0, 24 + lsrs r1, r0, 24 +_080DEC9C: + mov r0, sp + movs r2, 0 + bl AddTextPrinter +_080DECA4: + movs r0, 0x4 + bl PutWindowTilemap + movs r0, 0 + bl sub_80DED60 + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80DEC30 + + thumb_func_start sub_80DECB8 +sub_80DECB8: @ 80DECB8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + mov r8, r0 + ldr r0, [sp, 0x28] + ldr r4, [sp, 0x2C] + ldr r5, [sp, 0x30] + ldr r6, [sp, 0x34] + mov r7, r8 + lsls r7, 24 + lsrs r7, 24 + mov r8, r7 + lsls r1, 16 + lsrs r1, 16 + 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 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + lsls r6, 16 + asrs r6, 16 + str r6, [sp, 0xC] + mov r0, r8 + bl WriteSequenceToBgTilemapBuffer + mov r0, r8 + bl sub_80DED60 + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80DECB8 + + thumb_func_start sub_80DED10 +sub_80DED10: @ 80DED10 + 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, 16 + lsrs r1, 16 + 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_80DECB8 + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80DED10 + + thumb_func_start sub_80DED4C +sub_80DED4C: @ 80DED4C + push {lr} + bl RunTextPrinters + movs r0, 0x4 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_80DED4C + + thumb_func_start sub_80DED60 +sub_80DED60: @ 80DED60 + ldr r2, =0x02039f38 + movs r1, 0x1 + lsls r1, r0 + ldrb r0, [r2] + orrs r1, r0 + strb r1, [r2] + bx lr + .pool + thumb_func_end sub_80DED60 + + thumb_func_start sub_80DED74 +sub_80DED74: @ 80DED74 + push {r4-r6,lr} + movs r0, 0 + ldr r6, =0x03005d90 + ldr r5, =0x00000624 + movs r4, 0 +_080DED7E: + adds r3, r0, 0x1 + lsls r1, r0, 3 + movs r2, 0x3 +_080DED84: + ldr r0, [r6] + adds r0, r5 + adds r0, r1 + strh r4, [r0] + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _080DED84 + adds r0, r3, 0 + cmp r0, 0x4 + ble _080DED7E + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DED74 + + thumb_func_start sub_80DEDA8 +sub_80DEDA8: @ 80DEDA8 + 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] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + ldr r1, =0x02039f20 + ldrb r0, [r1] + cmp r0, 0 + beq _080DEDE6 +_080DEDD8: + adds r5, 0x1 + cmp r5, 0x2 + bgt _080DEDE6 + adds r0, r5, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080DEDD8 +_080DEDE6: + ldr r0, [sp] + cmp r0, 0xFF + bne _080DEE00 + ldr r0, =0x02039f25 + ldrb r0, [r0] + cmp r5, r0 + beq _080DEE00 + movs r0, 0 + b _080DEF90 + .pool +_080DEE00: + ldr r0, =0x02039f2c + ldrh r0, [r0] + cmp r0, 0x4 + bhi _080DEE4C + lsls r0, 2 + ldr r1, =_080DEE1C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080DEE1C: + .4byte _080DEE4C + .4byte _080DEE30 + .4byte _080DEE36 + .4byte _080DEE3C + .4byte _080DEE42 +_080DEE30: + mov r0, r8 + adds r0, 0x3 + b _080DEE46 +_080DEE36: + mov r0, r8 + adds r0, 0x6 + b _080DEE46 +_080DEE3C: + mov r0, r8 + adds r0, 0x9 + b _080DEE46 +_080DEE42: + mov r0, r8 + adds r0, 0xC +_080DEE46: + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 +_080DEE4C: + ldr r1, [sp] + cmp r1, 0xFE + bne _080DEE54 + b _080DEF50 +_080DEE54: + adds r0, r1, 0 + movs r1, 0x1 + bl sub_80DEFA8 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r2, =0x03005d8c + mov r10, r2 + ldr r0, [r2] + mov r3, r9 + lsls r7, r3, 5 + ldr r6, =0x00002e90 + adds r2, r0, r6 + adds r2, r7 + ldr r4, =0x02039e00 + lsls r5, 6 + adds r1, r4, 0 + adds r1, 0x38 + adds r1, r5, r1 + ldr r1, [r1] + str r1, [r2] + adds r1, r0, r7 + adds r2, r5, r4 + ldrh r2, [r2] + ldr r3, =0x00002e98 + adds r1, r3 + strh r2, [r1] + ldr r1, =0x00002e94 + adds r2, r0, r1 + adds r2, r7 + adds r1, r4, 0 + adds r1, 0x3C + adds r1, r5, r1 + ldr r1, [r1] + str r1, [r2] + adds r6, r7, r6 + adds r0, r6 + adds r0, 0xB + adds r1, r4, 0x2 + adds r1, r5, r1 + bl CopyString + mov r2, r10 + ldr r0, [r2] + adds r0, r6 + adds r0, 0x16 + adds r4, 0xD + adds r5, r4 + adds r1, r5, 0 + bl CopyString + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080DEEF4 + mov r3, r10 + ldr r0, [r3] + adds r0, r7 + ldr r1, =0x00002eae + adds r0, r1 + movs r1, 0x4 + b _080DEF02 + .pool +_080DEEF4: + mov r2, r10 + ldr r0, [r2] + adds r0, r7 + ldr r1, =0x02039f2e + ldrh r1, [r1] + ldr r3, =0x00002eae + adds r0, r3 +_080DEF02: + strb r1, [r0] + ldr r0, [sp] + cmp r0, 0xFF + beq _080DEF34 + ldr r0, =0x03005d8c + ldr r0, [r0] + mov r2, r9 + lsls r1, r2, 5 + adds r0, r1 + ldr r1, =0x02039f2c + ldrh r1, [r1] + ldr r3, =0x00002e9a + adds r0, r3 + strb r1, [r0] + b _080DEF8E + .pool +_080DEF34: + ldr r0, =0x03005d8c + ldr r0, [r0] + mov r2, r9 + lsls r1, r2, 5 + adds r0, r1 + ldr r3, =0x00002e9a + adds r0, r3 + mov r1, r8 + strb r1, [r0] + b _080DEF8E + .pool +_080DEF50: + ldr r6, =0x02039f3c + ldr r4, =0x02039e00 + lsls r5, 6 + adds r0, r4, 0 + adds r0, 0x38 + adds r0, r5, r0 + ldr r0, [r0] + str r0, [r6] + adds r0, r4, 0 + adds r0, 0x3C + adds r0, r5, r0 + ldr r0, [r0] + str r0, [r6, 0x4] + adds r0, r5, r4 + ldrh r0, [r0] + strh r0, [r6, 0x8] + adds r0, r6, 0 + adds r0, 0xB + adds r1, r4, 0x2 + adds r1, r5, r1 + bl CopyString + adds r0, r6, 0 + adds r0, 0x16 + adds r4, 0xD + adds r5, r4 + adds r1, r5, 0 + bl CopyString + mov r2, r8 + strb r2, [r6, 0xA] +_080DEF8E: + movs r0, 0x1 +_080DEF90: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80DEDA8 + + thumb_func_start sub_80DEFA8 +sub_80DEFA8: @ 80DEFA8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r0, 0x3 + bgt _080DEFF8 + cmp r0, 0 + blt _080DEFF8 + cmp r1, 0 + beq _080DEFE6 + movs r2, 0x5 + ldr r0, =0x03005d8c + mov r12, r0 + ldr r4, =0x00002e90 + ldr r3, =0x00002e70 +_080DEFC8: + mov r1, r12 + ldr r0, [r1] + lsls r1, r2, 5 + adds r1, r0 + adds r0, r1, r4 + adds r1, r3 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5,r6} + stm r0!, {r5,r6} + subs r2, 0x1 + cmp r2, 0 + bgt _080DEFC8 +_080DEFE6: + movs r0, 0 + b _080DF03A + .pool +_080DEFF8: + ldr r0, =0x02039f2c + ldrh r0, [r0] + cmp r0, 0x4 + bhi _080DF038 + lsls r0, 2 + ldr r1, =_080DF014 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080DF014: + .4byte _080DF028 + .4byte _080DF02C + .4byte _080DF030 + .4byte _080DF034 + .4byte _080DF038 +_080DF028: + movs r0, 0x8 + b _080DF03A +_080DF02C: + movs r0, 0x9 + b _080DF03A +_080DF030: + movs r0, 0xA + b _080DF03A +_080DF034: + movs r0, 0xB + b _080DF03A +_080DF038: + movs r0, 0xC +_080DF03A: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80DEFA8 + + thumb_func_start sub_80DF040 +sub_80DF040: @ 80DF040 + push {r4-r7,lr} + movs r2, 0 + ldr r0, =0x03005d8c + mov r12, r0 + ldr r4, =0x00002e90 + ldr r3, =gUnknown_08587FA4 +_080DF04C: + mov r1, r12 + ldr r0, [r1] + lsls r1, r2, 5 + adds r0, r1 + adds r0, r4 + adds r1, r3, 0 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5,r6} + stm r0!, {r5,r6} + adds r3, 0x20 + adds r2, 0x1 + cmp r2, 0x7 + ble _080DF04C + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80DF040 + + thumb_func_start sub_80DF080 +sub_80DF080: @ 80DF080 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, =0x02039f34 + ldr r3, [r2] + ldr r5, [r3, 0x10] + ldrb r1, [r5, 0x1] + movs r7, 0x1 + adds r0, r7, 0 + ands r0, r1 + adds r6, r2, 0 + cmp r0, 0 + bne _080DF0D2 + movs r0, 0 + ldrsb r0, [r5, r0] + cmp r0, 0 + ble _080DF0D2 + ldr r1, [r3, 0x4] + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x15] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + bne _080DF0D2 + ldr r1, [r3, 0x1C] + lsls r2, r4, 4 + adds r1, r2, r1 + ldrb r3, [r1, 0xC] + movs r0, 0x1 + orrs r0, r3 + strb r0, [r1, 0xC] + ldr r0, [r6] + ldr r0, [r0, 0x1C] + adds r2, r0 + ldrb r0, [r2, 0xE] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0xE] +_080DF0D2: + ldr r3, [r6] + ldr r1, [r3, 0x4] + lsls r2, r4, 3 + subs r0, r2, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0xC] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + adds r7, r2, 0 + cmp r0, 0 + beq _080DF0FA + ldr r0, [r3, 0x1C] + lsls r1, r4, 4 + adds r1, r0 + ldrb r2, [r1, 0xC] + movs r0, 0x2 + orrs r0, r2 + strb r0, [r1, 0xC] +_080DF0FA: + ldr r3, [r6] + ldr r2, [r3, 0x10] + ldrb r1, [r2, 0x1] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _080DF126 + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r0, 0 + beq _080DF126 + movs r0, 0x2 + ldrsb r0, [r2, r0] + cmp r0, 0x3C + bne _080DF126 + ldr r0, [r3, 0x1C] + lsls r1, r4, 4 + adds r1, r0 + ldrb r2, [r1, 0xC] + movs r0, 0x4 + orrs r0, r2 + strb r0, [r1, 0xC] +_080DF126: + ldr r3, [r6] + ldr r1, [r3, 0x4] + subs r0, r7, r4 + lsls r0, 2 + adds r2, r0, r1 + ldrb r1, [r2, 0x15] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080DF14E + ldrb r0, [r2, 0x16] + cmp r0, 0 + beq _080DF14E + ldr r0, [r3, 0x1C] + lsls r1, r4, 4 + adds r1, r0 + ldrb r2, [r1, 0xC] + movs r0, 0x8 + orrs r0, r2 + strb r0, [r1, 0xC] +_080DF14E: + movs r3, 0 + movs r5, 0 +_080DF152: + cmp r3, r4 + beq _080DF180 + ldr r1, [r6] + ldr r0, [r1, 0x4] + adds r0, r5, r0 + ldrb r0, [r0, 0xE] + cmp r0, 0 + beq _080DF180 + ldr r0, [r1, 0x1C] + lsls r2, r4, 4 + adds r2, r0 + ldrb r0, [r2, 0xC] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2, 0xC] + ldr r0, [r6] + ldr r0, [r0, 0x1C] + lsls r2, r3, 4 + adds r2, r0 + ldrb r0, [r2, 0xC] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2, 0xC] +_080DF180: + adds r5, 0x1C + adds r3, 0x1 + cmp r3, 0x3 + ble _080DF152 + ldr r2, [r6] + ldr r1, [r2, 0x4] + subs r0, r7, r4 + lsls r5, r0, 2 + adds r1, r5, r1 + ldrb r3, [r1, 0xC] + movs r0, 0x6 + ands r0, r3 + cmp r0, 0 + bne _080DF1A6 + ldrb r1, [r1, 0xB] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080DF1BC +_080DF1A6: + ldr r0, [r2, 0x1C] + lsls r1, r4, 4 + adds r1, r0 + ldrb r2, [r1, 0xC] + movs r0, 0x20 + orrs r0, r2 + strb r0, [r1, 0xC] + b _080DF1F6 + .pool +_080DF1BC: + movs r0, 0x1 + ands r0, r3 + cmp r0, 0 + bne _080DF1F6 + ldr r2, [r2, 0x1C] + lsls r3, r4, 4 + adds r2, r3, r2 + ldrb r0, [r2, 0xC] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0xC] + ldr r0, [r6] + ldr r1, [r0, 0x1C] + adds r1, r3, r1 + ldrb r0, [r1, 0xE] + movs r2, 0x1 + orrs r0, r2 + strb r0, [r1, 0xE] + ldr r1, [r6] + ldr r0, [r1, 0x1C] + adds r3, r0 + ldr r0, [r1] + ldrb r0, [r0, 0x1] + lsls r0, 1 + adds r3, r0 + ldr r0, [r1, 0x4] + adds r0, r5, r0 + ldrh r0, [r0, 0x6] + strh r0, [r3] +_080DF1F6: + ldr r2, [r6] + ldr r1, [r2, 0x4] + subs r0, r7, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x15] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _080DF21A + ldr r0, [r2, 0x1C] + lsls r1, r4, 4 + adds r1, r0 + ldrb r2, [r1, 0xD] + movs r0, 0x2 + orrs r0, r2 + strb r0, [r1, 0xD] +_080DF21A: + ldr r2, [r6] + ldr r0, [r2] + ldrb r0, [r0, 0x13] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x4 + bne _080DF24A + ldr r3, [r2, 0x10] + ldrb r1, [r3, 0x1] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _080DF24A + movs r0, 0 + ldrsb r0, [r3, r0] + cmp r0, 0 + bge _080DF24A + ldr r0, [r2, 0x1C] + lsls r1, r4, 4 + adds r1, r0 + ldrb r2, [r1, 0xD] + movs r0, 0x20 + orrs r0, r2 + strb r0, [r1, 0xD] +_080DF24A: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80DF080 + + thumb_func_start sub_80DF250 +sub_80DF250: @ 80DF250 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x38 + movs r1, 0 + movs r0, 0 + str r0, [sp, 0x20] + movs r4, 0 + ldr r6, =0x02039f34 + mov r2, sp + adds r2, 0xC + str r2, [sp, 0x28] + mov r3, sp + adds r3, 0x14 + str r3, [sp, 0x2C] + mov r7, sp + adds r7, 0x2 + str r7, [sp, 0x24] + ldr r5, =0x02039f20 + movs r2, 0 + movs r3, 0x80 + lsls r3, 17 +_080DF280: + adds r0, r4, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _080DF298 + lsrs r0, r2, 24 + str r0, [sp, 0x20] + b _080DF29E + .pool +_080DF298: + cmp r0, 0x3 + bne _080DF29E + lsrs r1, r2, 24 +_080DF29E: + adds r2, r3 + adds r4, 0x1 + cmp r4, 0x3 + ble _080DF280 + ldr r0, [r6] + ldr r0, [r0, 0x1C] + lsls r1, 4 + adds r1, r0 + ldrb r2, [r1, 0xD] + movs r0, 0x1 + orrs r0, r2 + strb r0, [r1, 0xD] + movs r4, 0 + ldr r1, [sp, 0x20] + lsls r1, 4 + str r1, [sp, 0x30] + mov r9, r4 + mov r10, r4 +_080DF2C2: + ldr r2, [sp, 0x20] + cmp r4, r2 + beq _080DF2EE + ldr r1, =0x02039f08 + lsls r0, r2, 1 + adds r0, r1 + movs r3, 0 + ldrsh r2, [r0, r3] + add r1, r10 + movs r6, 0 + ldrsh r0, [r1, r6] + subs r2, r0 + cmp r2, 0x32 + bgt _080DF2EE + ldr r7, =0x02039f34 + ldr r0, [r7] + ldr r2, [r0, 0x1C] + add r2, r9 + ldrb r0, [r2, 0xD] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0xD] +_080DF2EE: + ldr r1, =0x02039f34 + ldr r0, [r1] + ldr r0, [r0, 0x1C] + mov r3, r9 + adds r2, r3, r0 + ldrb r1, [r2, 0xE] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080DF30A + ldrb r0, [r2, 0xD] + movs r1, 0x8 + orrs r0, r1 + strb r0, [r2, 0xD] +_080DF30A: + movs r5, 0 + ldr r2, =0x02039f00 + add r2, r10 + movs r6, 0 + ldrsh r1, [r2, r6] + ldr r7, =0x02039f00 + movs r3, 0 + ldrsh r0, [r7, r3] + cmp r1, r0 + blt _080DF336 + adds r3, r2, 0 + adds r2, r7, 0 +_080DF322: + adds r2, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + bgt _080DF336 + movs r6, 0 + ldrsh r1, [r3, r6] + movs r7, 0 + ldrsh r0, [r2, r7] + cmp r1, r0 + bge _080DF322 +_080DF336: + cmp r5, 0x4 + bne _080DF354 + ldr r1, =0x02039f20 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080DF354 + ldr r2, =0x02039f34 + ldr r0, [r2] + ldr r2, [r0, 0x1C] + add r2, r9 + ldrb r0, [r2, 0xD] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2, 0xD] +_080DF354: + movs r3, 0 + mov r12, r3 + mov r8, r3 + movs r5, 0 + ldr r0, =0x02039f00 + add r0, r10 + movs r7, 0 + ldrsh r6, [r0, r7] + str r6, [sp, 0x34] + ldr r2, =0x02039f00 + ldr r0, =0x02039f18 + mov r1, r10 + adds r6, r1, r0 + adds r3, r0, 0 +_080DF370: + movs r7, 0 + ldrsh r0, [r2, r7] + ldr r1, [sp, 0x34] + cmp r1, r0 + ble _080DF37E + movs r7, 0x1 + mov r12, r7 +_080DF37E: + movs r0, 0 + ldrsh r1, [r6, r0] + movs r7, 0 + ldrsh r0, [r3, r7] + cmp r1, r0 + ble _080DF38E + movs r0, 0x1 + mov r8, r0 +_080DF38E: + adds r2, 0x2 + adds r3, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _080DF370 + mov r1, r12 + cmp r1, 0 + bne _080DF3B4 + mov r2, r8 + cmp r2, 0 + bne _080DF3B4 + ldr r3, =0x02039f34 + ldr r0, [r3] + ldr r2, [r0, 0x1C] + add r2, r9 + ldrb r0, [r2, 0xD] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2, 0xD] +_080DF3B4: + ldr r6, =0x02039f34 + ldr r0, [r6] + ldr r0, [r0, 0x1C] + mov r7, r9 + adds r2, r7, r0 + ldrb r1, [r2, 0xE] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080DF3D0 + ldrb r0, [r2, 0xD] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0xD] +_080DF3D0: + movs r0, 0x10 + add r9, r0 + movs r1, 0x2 + add r10, r1 + adds r4, 0x1 + cmp r4, 0x3 + bgt _080DF3E0 + b _080DF2C2 +_080DF3E0: + movs r4, 0 + movs r5, 0 + movs r3, 0 + ldr r2, [sp, 0x28] + mov r1, sp +_080DF3EA: + strh r3, [r1] + adds r0, r2, r4 + strb r5, [r0] + adds r1, 0x2 + adds r4, 0x1 + cmp r4, 0x4 + ble _080DF3EA + mov r1, sp + ldr r0, =0x0000ffff + strh r0, [r1, 0xA] + movs r0, 0 + ldr r2, [sp, 0x28] + strb r0, [r2, 0x5] + movs r4, 0 + ldr r0, =0x02039f34 + ldr r0, [r0] + mov r8, r0 + ldr r7, [sp, 0x30] +_080DF40E: + mov r3, r8 + ldr r0, [r3, 0x1C] + adds r0, r7, r0 + lsls r1, r4, 1 + adds r0, r1 + ldrh r0, [r0] + adds r4, 0x1 + mov r12, r4 + cmp r0, 0 + beq _080DF450 + ldr r0, =0x02039f34 + ldr r6, [r0] + ldr r3, [sp, 0x28] + mov r4, sp + movs r5, 0x4 +_080DF42C: + ldr r0, [r6, 0x1C] + adds r0, r7, r0 + adds r0, r1 + ldrh r0, [r0] + ldrh r2, [r4] + cmp r0, r2 + beq _080DF440 + cmp r2, 0 + bne _080DF446 + strh r0, [r4] +_080DF440: + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] +_080DF446: + adds r3, 0x1 + adds r4, 0x2 + subs r5, 0x1 + cmp r5, 0 + bge _080DF42C +_080DF450: + mov r4, r12 + cmp r4, 0x4 + ble _080DF40E + mov r0, sp + ldrh r0, [r0] + ldr r6, [sp, 0x2C] + strh r0, [r6] + ldr r7, [sp, 0x28] + ldrb r3, [r7] + movs r6, 0 + movs r4, 0x1 + ldr r1, [sp, 0x24] + ldrh r0, [r1] + ldr r1, =0x0000ffff + cmp r0, r1 + beq _080DF4C0 + ldr r5, [sp, 0x2C] + adds r7, r1, 0 + mov r2, sp + adds r2, 0x2 +_080DF478: + ldr r0, [sp, 0x28] + adds r1, r0, r4 + ldrb r0, [r1] + cmp r3, r0 + bcs _080DF4A4 + ldrh r0, [r2] + strh r0, [r5] + ldrb r3, [r1] + movs r6, 0x1 + b _080DF4B6 + .pool +_080DF4A4: + cmp r3, r0 + bne _080DF4B6 + lsls r0, r6, 1 + adds r0, r5, r0 + ldrh r1, [r2] + strh r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_080DF4B6: + adds r2, 0x2 + adds r4, 0x1 + ldrh r0, [r2] + cmp r0, r7 + bne _080DF478 +_080DF4C0: + bl GenerateRandomNumber + ldr r1, =0x02039f34 + ldr r1, [r1] + ldr r4, [r1, 0x1C] + ldr r1, [sp, 0x30] + adds r4, r1, r4 + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + lsls r0, 1 + ldr r2, [sp, 0x2C] + adds r0, r2, r0 + ldrh r0, [r0] + strh r0, [r4, 0xA] + 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 sub_80DF250 + + thumb_func_start sub_80DF4F8 +sub_80DF4F8: @ 80DF4F8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldr r1, =0x02039f20 + ldr r0, =0x02039f25 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080DF514 + b _080DF6EE +_080DF514: + movs r7, 0 + movs r3, 0 + ldr r0, =0x02039f34 + mov r12, r0 +_080DF51C: + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080DF528 + lsls r0, r3, 24 + lsrs r7, r0, 24 +_080DF528: + adds r3, 0x1 + cmp r3, 0x3 + ble _080DF51C + movs r1, 0 + mov r9, r1 + mov r10, r1 + movs r3, 0 + lsls r2, r7, 1 + lsls r4, r7, 4 + mov r8, r4 + ldr r1, =0x02039f00 + adds r0, r2, r1 + movs r6, 0 + ldrsh r5, [r0, r6] + str r5, [sp, 0x8] + adds r5, r1, 0 + ldr r0, =0x02039f18 + adds r2, r0 + adds r4, r0, 0 +_080DF54E: + movs r1, 0 + ldrsh r0, [r5, r1] + ldr r6, [sp, 0x8] + cmp r6, r0 + bge _080DF562 + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080DF562: + movs r0, 0 + ldrsh r1, [r2, r0] + movs r6, 0 + ldrsh r0, [r4, r6] + cmp r1, r0 + bge _080DF578 + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 +_080DF578: + adds r5, 0x2 + adds r4, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _080DF54E + mov r1, r12 + ldr r0, [r1] + ldr r0, [r0, 0x1C] + add r0, r8 + ldrb r1, [r0, 0xC] + movs r4, 0 + movs r2, 0x1 + movs r3, 0x7 +_080DF592: + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + beq _080DF5A0 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_080DF5A0: + lsrs r1, 1 + subs r3, 0x1 + cmp r3, 0 + bge _080DF592 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x1C] + add r0, r8 + ldrb r1, [r0, 0xC] + movs r4, 0 + movs r2, 0 + movs r3, 0 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080DF5DC + cmp r5, 0 + beq _080DF5F6 +_080DF5D6: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_080DF5DC: + lsrs r1, 1 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r3, 0x1 + cmp r3, 0x7 + bgt _080DF5F6 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080DF5DC + cmp r5, r4 + bne _080DF5D6 +_080DF5F6: + movs r1, 0x1 + adds r0, r1, 0 + lsls r0, r2 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r7, 0 + bne _080DF628 + mov r0, sp + strb r1, [r0] + ldr r1, =0x02039f34 + ldr r0, [r1] + ldr r0, [r0, 0x1C] + ldrb r4, [r0, 0x1D] + movs r3, 0x2 + b _080DF638 + .pool +_080DF628: + mov r1, sp + movs r0, 0 + strb r0, [r1] + ldr r1, =0x02039f34 + ldr r0, [r1] + ldr r0, [r0, 0x1C] + ldrb r4, [r0, 0xD] + movs r3, 0x1 +_080DF638: + mov r12, r1 + movs r5, 0x1 + lsls r2, 24 + str r2, [sp, 0x4] + cmp r3, 0x3 + bgt _080DF682 +_080DF644: + cmp r3, r7 + beq _080DF67C + mov r6, r12 + ldr r2, [r6] + ldr r0, [r2, 0x1C] + lsls r1, r3, 4 + adds r0, r1, r0 + ldrb r0, [r0, 0xD] + cmp r4, r0 + bcs _080DF66C + mov r0, sp + strb r3, [r0] + ldr r0, [r2, 0x1C] + adds r0, r1, r0 + ldrb r4, [r0, 0xD] + movs r5, 0x1 + b _080DF67C + .pool +_080DF66C: + cmp r4, r0 + bne _080DF67C + mov r1, sp + adds r0, r1, r5 + strb r3, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080DF67C: + adds r3, 0x1 + cmp r3, 0x3 + ble _080DF644 +_080DF682: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __modsi3 + add r0, sp + ldrb r6, [r0] + movs r2, 0x80 + movs r3, 0 + ldr r5, =0x02039f34 + ldr r0, [r5] + ldr r0, [r0, 0x1C] + lsls r1, r6, 4 + adds r0, r1, r0 + ldrb r0, [r0, 0xD] + ands r0, r2 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080DF6C4 +_080DF6AE: + lsrs r2, 1 + adds r3, 0x1 + cmp r3, 0x7 + bgt _080DF6C4 + ldr r0, [r5] + ldr r0, [r0, 0x1C] + adds r0, r1, r0 + ldrb r4, [r0, 0xD] + ands r4, r2 + cmp r4, 0 + beq _080DF6AE +_080DF6C4: + mov r0, r9 + bl sub_80ECDA4 + mov r0, r10 + bl sub_80ECDF4 + ldr r5, [sp, 0x4] + lsrs r0, r5, 24 + bl sub_80ECE34 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x1C] + add r0, r8 + ldrh r0, [r0, 0xA] + bl sub_80ECE74 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80ECEB4 +_080DF6EE: + 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_80DF4F8 + + thumb_func_start sub_80DF704 +sub_80DF704: @ 80DF704 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, =0x02000000 + movs r1, 0xD0 + lsls r1, 9 + adds r2, r0, r1 + ldrb r1, [r2] + adds r4, r0, 0 + cmp r1, 0 + bne _080DF72C + cmp r3, 0 + bne _080DF728 + movs r0, 0x2 + b _080DF72E + .pool +_080DF728: + movs r0, 0x3 + b _080DF72E +_080DF72C: + movs r0, 0 +_080DF72E: + strb r0, [r2] + movs r1, 0xD0 + lsls r1, 9 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080DF746 + bl sub_80DAEA4 + bl sub_80DB2BC + b _080DF74A +_080DF746: + bl sub_80DF750 +_080DF74A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80DF704 + + thumb_func_start sub_80DF750 +sub_80DF750: @ 80DF750 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + ldr r0, =0x020322d5 + ldrb r0, [r0] + cmp r0, 0 + bne _080DF766 + b _080DF924 +_080DF766: + ldr r0, =0x02000000 + movs r1, 0xD0 + lsls r1, 9 + adds r0, r1 + ldrb r0, [r0] + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _080DF77C + b _080DF924 +_080DF77C: + movs r7, 0 + mov r2, sp + adds r2, 0x18 + str r2, [sp, 0x30] +_080DF784: + adds r0, r7, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x3 + bls _080DF784 + ldr r0, =0x02000000 + movs r1, 0xD0 + lsls r1, 9 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080DF874 + movs r7, 0 + movs r2, 0x7 + mov r10, r2 + ldr r0, [sp, 0x30] + mov r9, r0 +_080DF7AE: + add r0, sp, 0x4 + ldr r1, =gUnknown_085ED1B2 + bl CopyString + adds r5, r0, 0 + ldr r0, =0x02039f26 + adds r0, r7, r0 + ldrb r0, [r0] + mov r1, r10 + str r1, [sp] + add r1, sp, 0x4 + movs r2, 0x5 + movs r3, 0x1 + bl sub_80DEBD0 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0x1C] + lsls r0, r7, 4 + adds r0, r1 + ldrb r4, [r0, 0xC] + movs r6, 0x7 + adds r2, r7, 0x1 + mov r8, r2 +_080DF7DE: + movs r1, 0x1 + ands r1, r4 + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalString + adds r5, r0, 0 + lsrs r4, 1 + lsls r0, r6, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r6, r0, 24 + asrs r0, 24 + movs r2, 0x1 + negs r2, r2 + cmp r0, r2 + bgt _080DF7DE + movs r6, 0 + ldr r4, =0x02039f26 + ldr r3, [sp, 0x30] +_080DF80A: + lsls r0, r6, 24 + asrs r0, 24 + adds r2, r3, r0 + mov r1, sp + adds r1, r0 + adds r1, 0x4 + ldrb r1, [r1] + strb r1, [r2] + adds r0, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + asrs r5, r0, 24 + cmp r5, 0x4 + ble _080DF80A + mov r0, r9 + adds r1, r0, r5 + movs r0, 0xFF + strb r0, [r1] + adds r4, r7, r4 + ldrb r0, [r4] + mov r1, r10 + str r1, [sp] + mov r1, r9 + movs r2, 0x5 + movs r3, 0x1 + bl sub_80DEBD0 + ldrb r0, [r4] + mov r1, sp + adds r1, r5 + adds r1, 0x4 + mov r2, r10 + str r2, [sp] + movs r2, 0x37 + movs r3, 0x1 + bl sub_80DEBD0 + mov r1, r8 + lsls r0, r1, 24 + lsrs r7, r0, 24 + cmp r7, 0x3 + bls _080DF7AE + b _080DF920 + .pool +_080DF874: + movs r7, 0 + mov r2, sp + adds r2, 0x6 + str r2, [sp, 0x2C] + ldr r0, [sp, 0x30] + mov r9, r0 + movs r1, 0x7 + mov r10, r1 +_080DF884: + add r0, sp, 0x4 + ldr r1, =gUnknown_085ED1B5 + bl CopyString + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0x1C] + lsls r0, r7, 4 + adds r0, r1 + ldrb r4, [r0, 0xD] + ldr r5, [sp, 0x2C] + movs r6, 0x7 + adds r2, r7, 0x1 + mov r8, r2 +_080DF8A0: + movs r1, 0x1 + ands r1, r4 + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalString + adds r5, r0, 0 + lsrs r4, 1 + lsls r0, r6, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r6, r0, 24 + asrs r0, 24 + movs r2, 0x1 + negs r2, r2 + cmp r0, r2 + bgt _080DF8A0 + movs r6, 0 + ldr r4, =0x02039f26 + ldr r3, [sp, 0x30] +_080DF8CC: + lsls r0, r6, 24 + asrs r0, 24 + adds r2, r3, r0 + mov r1, sp + adds r1, r0 + adds r1, 0x4 + ldrb r1, [r1] + strb r1, [r2] + adds r0, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + asrs r5, r0, 24 + cmp r5, 0x4 + ble _080DF8CC + mov r0, r9 + adds r1, r0, r5 + movs r0, 0xFF + strb r0, [r1] + adds r4, r7, r4 + ldrb r0, [r4] + mov r1, r10 + str r1, [sp] + mov r1, r9 + movs r2, 0x5 + movs r3, 0x1 + bl sub_80DEBD0 + ldrb r0, [r4] + mov r1, sp + adds r1, r5 + adds r1, 0x4 + mov r2, r10 + str r2, [sp] + movs r2, 0x37 + movs r3, 0x1 + bl sub_80DEBD0 + mov r1, r8 + lsls r0, r1, 24 + lsrs r7, r0, 24 + cmp r7, 0x3 + bls _080DF884 +_080DF920: + bl sub_80DB2BC +_080DF924: + 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_80DF750 + + thumb_func_start sub_80DF940 +sub_80DF940: @ 80DF940 + push {r4,r5,lr} + adds r4, r0, 0 + movs r5, 0x2 + ldrb r0, [r4] + cmp r0, 0xFC + bne _080DF956 + ldrb r0, [r4, 0x1] + cmp r0, 0x15 + bne _080DF956 + movs r0, 0x2 + b _080DF9CC +_080DF956: + adds r0, r4, 0 + bl GetStringLength + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bhi _080DF9CA + ldrb r0, [r4] + cmp r0, 0xFF + beq _080DF9CA +_080DF96A: + ldrb r1, [r4] + adds r0, r1, 0 + adds r0, 0x45 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x33 + bls _080DF9BE + adds r0, r1, 0 + adds r0, 0x5F + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + bls _080DF9BE + adds r0, r1, 0 + cmp r0, 0 + beq _080DF9BE + cmp r0, 0xAD + beq _080DF9BE + cmp r0, 0xB8 + beq _080DF9BE + cmp r0, 0xAB + beq _080DF9BE + cmp r0, 0xAC + beq _080DF9BE + cmp r0, 0xB5 + beq _080DF9BE + cmp r0, 0xB6 + beq _080DF9BE + cmp r0, 0xBA + beq _080DF9BE + cmp r0, 0xAE + beq _080DF9BE + cmp r0, 0xB0 + beq _080DF9BE + cmp r0, 0xB1 + beq _080DF9BE + cmp r0, 0xB2 + beq _080DF9BE + cmp r0, 0xB3 + beq _080DF9BE + cmp r0, 0xB1 + bne _080DF9C8 +_080DF9BE: + adds r4, 0x1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _080DF96A + b _080DF9CA +_080DF9C8: + movs r5, 0x1 +_080DF9CA: + adds r0, r5, 0 +_080DF9CC: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80DF940 + + thumb_func_start sub_80DF9D4 +sub_80DF9D4: @ 80DF9D4 + ldrb r2, [r0, 0x5] + movs r1, 0xFF + strb r1, [r0, 0x5] + strb r2, [r0, 0x7] + bx lr + thumb_func_end sub_80DF9D4 + + thumb_func_start sub_80DF9E0 +sub_80DF9E0: @ 80DF9E0 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + bl StripExtendedControlCodes + cmp r4, 0x1 + bne _080DF9F8 + movs r0, 0xFF + strb r0, [r5, 0x5] + movs r0, 0xFC + strb r0, [r5, 0xA] + b _080DFA00 +_080DF9F8: + ldrb r1, [r5, 0x5] + movs r0, 0xFF + strb r0, [r5, 0x5] + strb r1, [r5, 0xA] +_080DFA00: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80DF9E0 + + thumb_func_start sub_80DFA08 +sub_80DFA08: @ 80DFA08 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + adds r4, r5, 0x2 + cmp r6, 0x1 + bne _080DFA28 + adds r0, r4, 0 + bl sub_80DF940 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StopMusicWhileStringIsPrinted + b _080DFA3E +_080DFA28: + ldrb r0, [r4, 0xA] + cmp r0, 0xFC + bne _080DFA38 + adds r0, r4, 0 + movs r1, 0x1 + bl StopMusicWhileStringIsPrinted + b _080DFA3E +_080DFA38: + strb r0, [r4, 0x5] + movs r0, 0xFF + strb r0, [r4, 0xA] +_080DFA3E: + adds r4, r5, 0 + adds r4, 0xD + cmp r6, 0x1 + bne _080DFA68 + movs r0, 0xFF + strb r0, [r4, 0x7] + ldrb r0, [r4, 0x4] + strb r0, [r4, 0x6] + ldrb r0, [r4, 0x3] + strb r0, [r4, 0x5] + ldrb r0, [r4, 0x2] + strb r0, [r4, 0x4] + ldrb r0, [r4, 0x1] + strb r0, [r4, 0x3] + ldrb r0, [r5, 0xD] + strb r0, [r4, 0x2] + movs r0, 0x15 + strb r0, [r4, 0x1] + movs r0, 0xFC + strb r0, [r5, 0xD] + b _080DFA70 +_080DFA68: + ldrb r0, [r4, 0x7] + strb r0, [r4, 0x5] + movs r0, 0xFF + strb r0, [r4, 0x7] +_080DFA70: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80DFA08 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/contest_ai.s b/asm/contest_ai.s new file mode 100644 index 000000000..1956153df --- /dev/null +++ b/asm/contest_ai.s @@ -0,0 +1,5278 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_81562C4 +sub_81562C4: @ 81562C4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r0, [r0, 0xC] + movs r1, 0 + movs r2, 0x44 + bl memset + movs r1, 0 + movs r3, 0x64 + adds r2, r4, 0 +_081562DE: + ldr r0, [r4] + ldr r0, [r0, 0xC] + adds r0, 0x5 + adds r0, r1 + strb r3, [r0] + adds r1, 0x1 + cmp r1, 0x3 + ble _081562DE + ldr r0, [r2] + ldr r0, [r0, 0xC] + adds r0, 0x41 + movs r1, 0 + strb r5, [r0] + ldr r0, [r2] + ldr r0, [r0, 0xC] + adds r0, 0x40 + strb r1, [r0] + ldr r0, [r2] + ldr r2, [r0, 0xC] + ldr r1, =0x02039e00 + adds r0, r2, 0 + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, 0x18 + adds r0, r1 + ldr r0, [r0] + str r0, [r2, 0x14] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81562C4 + + thumb_func_start sub_8156324 +sub_8156324: @ 8156324 + push {r4-r6,lr} + ldr r1, =0x02039f34 + ldr r0, [r1] + ldr r0, [r0, 0xC] + ldr r0, [r0, 0x14] + cmp r0, 0 + beq _0815636A + adds r4, r1, 0 + movs r5, 0 +_08156336: + ldr r0, [r4] + ldr r2, [r0, 0xC] + ldr r0, [r2, 0x14] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0815634A + strb r5, [r2] + bl sub_81563B0 +_0815634A: + ldr r0, [r4] + ldr r1, [r0, 0xC] + ldr r0, [r1, 0x14] + lsrs r0, 1 + str r0, [r1, 0x14] + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] + ldr r0, [r4] + ldr r0, [r0, 0xC] + strb r5, [r0, 0x4] + ldr r0, [r4] + ldr r0, [r0, 0xC] + ldr r0, [r0, 0x14] + cmp r0, 0 + bne _08156336 +_0815636A: + movs r6, 0x3 +_0815636C: + bl GenerateRandomNumber + adds r5, r0, 0 + ands r5, r6 + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r1, [r0, 0xC] + adds r0, r1, 0x5 + adds r0, r5 + ldrb r3, [r0] + movs r2, 0 + ldrb r1, [r1, 0x5] + cmp r3, r1 + bcc _0815639E + adds r1, r4, 0 +_0815638A: + adds r2, 0x1 + cmp r2, 0x3 + bgt _0815639E + ldr r0, [r1] + ldr r0, [r0, 0xC] + adds r0, 0x5 + adds r0, r2 + ldrb r0, [r0] + cmp r3, r0 + bcs _0815638A +_0815639E: + cmp r2, 0x4 + bne _0815636C + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8156324 + + thumb_func_start sub_81563B0 +sub_81563B0: @ 81563B0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r5, =0x02039f34 + ldr r0, [r5] + ldr r0, [r0, 0xC] + ldrb r0, [r0] + adds r4, r5, 0 + cmp r0, 0x2 + beq _081564A0 + adds r7, r5, 0 + ldr r6, =0x0203ab38 + ldr r0, =0x02039e1e + mov r8, r0 +_081563CC: + ldr r0, [r7] + ldr r2, [r0, 0xC] + ldrb r0, [r2] + cmp r0, 0x1 + beq _08156426 + cmp r0, 0x1 + bgt _08156496 + cmp r0, 0 + bne _08156496 + ldr r1, =gContestAIs + ldrb r0, [r2, 0x10] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r6] + ldrb r1, [r2, 0x4] + lsls r1, 1 + adds r0, r2, 0 + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + add r1, r8 + ldrh r1, [r1] + adds r0, r1, 0 + cmp r0, 0 + bne _08156418 + strh r0, [r2, 0x2] + b _0815641A + .pool +_08156418: + strh r1, [r2, 0x2] +_0815641A: + ldr r0, [r4] + ldr r1, [r0, 0xC] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08156496 +_08156426: + ldrh r1, [r2, 0x2] + cmp r1, 0 + beq _08156444 + ldr r1, =gUnknown_085CDD00 + ldr r0, [r6] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + b _08156458 + .pool +_08156444: + adds r0, r2, 0x5 + ldrb r2, [r2, 0x4] + adds r0, r2 + strb r1, [r0] + ldr r0, [r7] + ldr r2, [r0, 0xC] + ldrb r1, [r2, 0x9] + movs r0, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] +_08156458: + ldr r2, =0x02039f34 + ldr r0, [r2] + ldr r3, [r0, 0xC] + ldrb r1, [r3, 0x9] + movs r0, 0x1 + ands r0, r1 + adds r4, r2, 0 + cmp r0, 0 + beq _08156496 + ldrb r0, [r3, 0x4] + adds r0, 0x1 + movs r2, 0 + strb r0, [r3, 0x4] + ldr r0, [r4] + ldr r1, [r0, 0xC] + ldrb r0, [r1, 0x4] + cmp r0, 0x3 + bhi _08156484 + strb r2, [r1] + b _0815648A + .pool +_08156484: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0815648A: + ldr r0, [r4] + ldr r2, [r0, 0xC] + ldrb r1, [r2, 0x9] + movs r0, 0xFE + ands r0, r1 + strb r0, [r2, 0x9] +_08156496: + ldr r0, [r5] + ldr r0, [r0, 0xC] + ldrb r0, [r0] + cmp r0, 0x2 + bne _081563CC +_081564A0: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81563B0 + + thumb_func_start sub_81564AC +sub_81564AC: @ 81564AC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r3, =0x02039f34 + ldr r0, [r3] + ldr r0, [r0, 0x8] + b _081564CC + .pool +_081564C0: + adds r1, 0x1 + cmp r1, 0x3 + bgt _081564D2 + ldr r0, [r3] + ldr r0, [r0, 0x8] + adds r0, r1 +_081564CC: + ldrb r0, [r0] + cmp r0, r2 + bne _081564C0 +_081564D2: + lsls r0, r1, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_81564AC + + thumb_func_start sub_81564DC +sub_81564DC: @ 81564DC + push {r4,lr} + ldr r3, =0x02039f34 + ldr r0, [r3] + ldr r0, [r0, 0xC] + adds r1, r0, 0x5 + ldrb r0, [r0, 0x4] + adds r1, r0 + ldr r2, =0x0203ab38 + ldr r0, [r2] + ldrb r0, [r0, 0x1] + lsls r0, 24 + asrs r0, 24 + ldrb r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _08156510 + movs r4, 0xFF + b _08156516 + .pool +_08156510: + cmp r0, 0 + bge _08156516 + movs r4, 0 +_08156516: + ldr r0, [r3] + ldr r1, [r0, 0xC] + adds r0, r1, 0x5 + ldrb r1, [r1, 0x4] + adds r0, r1 + strb r4, [r0] + ldr r0, [r2] + adds r0, 0x2 + str r0, [r2] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81564DC + + thumb_func_start sub_8156530 +sub_8156530: @ 8156530 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0xC] + ldr r0, [r0] + ldrb r0, [r0, 0x1] + strh r0, [r1, 0x18] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8156530 + + thumb_func_start sub_8156550 +sub_8156550: @ 8156550 + push {lr} + bl sub_8156530 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bge _0815658C + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08156590 + .pool +_0815658C: + adds r0, r2, 0x5 + str r0, [r3] +_08156590: + pop {r0} + bx r0 + thumb_func_end sub_8156550 + + thumb_func_start sub_8156594 +sub_8156594: @ 8156594 + push {lr} + bl sub_8156530 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + ble _081565D0 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081565D4 + .pool +_081565D0: + adds r0, r2, 0x5 + str r0, [r3] +_081565D4: + pop {r0} + bx r0 + thumb_func_end sub_8156594 + + thumb_func_start sub_81565D8 +sub_81565D8: @ 81565D8 + push {lr} + bl sub_8156530 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _08156614 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08156618 + .pool +_08156614: + adds r0, r2, 0x5 + str r0, [r3] +_08156618: + pop {r0} + bx r0 + thumb_func_end sub_81565D8 + + thumb_func_start sub_815661C +sub_815661C: @ 815661C + push {lr} + bl sub_8156530 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _08156658 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0815665C + .pool +_08156658: + adds r0, r2, 0x5 + str r0, [r3] +_0815665C: + pop {r0} + bx r0 + thumb_func_end sub_815661C + + thumb_func_start sub_8156660 +sub_8156660: @ 8156660 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0xC] + ldr r0, [r0] + ldrb r0, [r0, 0x13] + lsls r0, 24 + asrs r0, 24 + strh r0, [r1, 0x18] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8156660 + + thumb_func_start sub_8156684 +sub_8156684: @ 8156684 + push {lr} + bl sub_8156660 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bge _081566C0 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081566C4 + .pool +_081566C0: + adds r0, r2, 0x5 + str r0, [r3] +_081566C4: + pop {r0} + bx r0 + thumb_func_end sub_8156684 + + thumb_func_start sub_81566C8 +sub_81566C8: @ 81566C8 + push {lr} + bl sub_8156660 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + ble _08156704 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08156708 + .pool +_08156704: + adds r0, r2, 0x5 + str r0, [r3] +_08156708: + pop {r0} + bx r0 + thumb_func_end sub_81566C8 + + thumb_func_start sub_815670C +sub_815670C: @ 815670C + push {lr} + bl sub_8156660 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _08156748 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0815674C + .pool +_08156748: + adds r0, r2, 0x5 + str r0, [r3] +_0815674C: + pop {r0} + bx r0 + thumb_func_end sub_815670C + + thumb_func_start sub_8156750 +sub_8156750: @ 8156750 + push {lr} + bl sub_8156660 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _0815678C + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08156790 + .pool +_0815678C: + adds r0, r2, 0x5 + str r0, [r3] +_08156790: + pop {r0} + bx r0 + thumb_func_end sub_8156750 + + thumb_func_start sub_8156794 +sub_8156794: @ 8156794 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r0, [r0, 0x8] + adds r1, r2, 0 + adds r1, 0x41 + ldrb r1, [r1] + adds r0, r1 + ldrb r0, [r0] + strh r0, [r2, 0x18] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8156794 + + thumb_func_start sub_81567BC +sub_81567BC: @ 81567BC + push {lr} + bl sub_8156794 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bge _081567F8 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081567FC + .pool +_081567F8: + adds r0, r2, 0x5 + str r0, [r3] +_081567FC: + pop {r0} + bx r0 + thumb_func_end sub_81567BC + + thumb_func_start sub_8156800 +sub_8156800: @ 8156800 + push {lr} + bl sub_8156794 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + ble _0815683C + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08156840 + .pool +_0815683C: + adds r0, r2, 0x5 + str r0, [r3] +_08156840: + pop {r0} + bx r0 + thumb_func_end sub_8156800 + + thumb_func_start sub_8156844 +sub_8156844: @ 8156844 + push {lr} + bl sub_8156794 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _08156880 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08156884 + .pool +_08156880: + adds r0, r2, 0x5 + str r0, [r3] +_08156884: + pop {r0} + bx r0 + thumb_func_end sub_8156844 + + thumb_func_start sub_8156888 +sub_8156888: @ 8156888 + push {lr} + bl sub_8156794 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _081568C4 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081568C8 + .pool +_081568C4: + adds r0, r2, 0x5 + str r0, [r3] +_081568C8: + pop {r0} + bx r0 + thumb_func_end sub_8156888 + + thumb_func_start sub_81568CC +sub_81568CC: @ 81568CC + push {r4,lr} + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r4, [r0, 0xC] + adds r1, r4, 0 + adds r1, 0x41 + ldrb r1, [r1] + ldr r2, [r0, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0xD] + lsls r0, 24 + asrs r0, 24 + movs r1, 0xA + bl __divsi3 + lsls r0, 24 + asrs r0, 24 + strh r0, [r4, 0x18] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81568CC + + thumb_func_start sub_815690C +sub_815690C: @ 815690C + push {lr} + bl sub_81568CC + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bge _08156948 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0815694C + .pool +_08156948: + adds r0, r2, 0x5 + str r0, [r3] +_0815694C: + pop {r0} + bx r0 + thumb_func_end sub_815690C + + thumb_func_start sub_8156950 +sub_8156950: @ 8156950 + push {lr} + bl sub_81568CC + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + ble _0815698C + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08156990 + .pool +_0815698C: + adds r0, r2, 0x5 + str r0, [r3] +_08156990: + pop {r0} + bx r0 + thumb_func_end sub_8156950 + + thumb_func_start sub_8156994 +sub_8156994: @ 8156994 + push {lr} + bl sub_81568CC + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _081569D0 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081569D4 + .pool +_081569D0: + adds r0, r2, 0x5 + str r0, [r3] +_081569D4: + pop {r0} + bx r0 + thumb_func_end sub_8156994 + + thumb_func_start sub_81569D8 +sub_81569D8: @ 81569D8 + push {lr} + bl sub_81568CC + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _08156A14 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08156A18 + .pool +_08156A14: + adds r0, r2, 0x5 + str r0, [r3] +_08156A18: + pop {r0} + bx r0 + thumb_func_end sub_81569D8 + + thumb_func_start sub_8156A1C +sub_8156A1C: @ 8156A1C + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r3, [r0, 0xC] + adds r1, r3, 0 + adds r1, 0x41 + ldrb r1, [r1] + ldr r2, [r0, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x4] + strh r0, [r3, 0x18] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8156A1C + + thumb_func_start sub_8156A48 +sub_8156A48: @ 8156A48 + push {r4,r5,lr} + bl sub_8156A1C + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r1, [r3] + ldrb r0, [r3, 0x1] + lsls r0, 8 + orrs r1, r0 + movs r5, 0x18 + ldrsh r0, [r2, r5] + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + bge _08156A8C + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08156A90 + .pool +_08156A8C: + adds r0, r3, 0x6 + str r0, [r4] +_08156A90: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8156A48 + + thumb_func_start sub_8156A98 +sub_8156A98: @ 8156A98 + push {r4,r5,lr} + bl sub_8156A1C + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r1, [r3] + ldrb r0, [r3, 0x1] + lsls r0, 8 + orrs r1, r0 + movs r5, 0x18 + ldrsh r0, [r2, r5] + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + ble _08156ADC + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08156AE0 + .pool +_08156ADC: + adds r0, r3, 0x6 + str r0, [r4] +_08156AE0: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8156A98 + + thumb_func_start sub_8156AE8 +sub_8156AE8: @ 8156AE8 + push {r4,r5,lr} + bl sub_8156A1C + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r1, [r3] + ldrb r0, [r3, 0x1] + lsls r0, 8 + orrs r1, r0 + movs r5, 0x18 + ldrsh r0, [r2, r5] + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + bne _08156B2C + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08156B30 + .pool +_08156B2C: + adds r0, r3, 0x6 + str r0, [r4] +_08156B30: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8156AE8 + + thumb_func_start sub_8156B38 +sub_8156B38: @ 8156B38 + push {r4,r5,lr} + bl sub_8156A1C + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r1, [r3] + ldrb r0, [r3, 0x1] + lsls r0, 8 + orrs r1, r0 + movs r5, 0x18 + ldrsh r0, [r2, r5] + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + beq _08156B7C + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08156B80 + .pool +_08156B7C: + adds r0, r3, 0x6 + str r0, [r4] +_08156B80: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8156B38 + + thumb_func_start sub_8156B88 +sub_8156B88: @ 8156B88 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r1, =0x02039f00 + adds r0, r2, 0 + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2, 0x18] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8156B88 + + thumb_func_start sub_8156BB4 +sub_8156BB4: @ 8156BB4 + push {r4,r5,lr} + bl sub_8156B88 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r1, [r3] + ldrb r0, [r3, 0x1] + lsls r0, 8 + orrs r1, r0 + movs r5, 0x18 + ldrsh r0, [r2, r5] + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + bge _08156BF8 + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08156BFC + .pool +_08156BF8: + adds r0, r3, 0x6 + str r0, [r4] +_08156BFC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8156BB4 + + thumb_func_start sub_8156C04 +sub_8156C04: @ 8156C04 + push {r4,r5,lr} + bl sub_8156B88 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r1, [r3] + ldrb r0, [r3, 0x1] + lsls r0, 8 + orrs r1, r0 + movs r5, 0x18 + ldrsh r0, [r2, r5] + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + ble _08156C48 + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08156C4C + .pool +_08156C48: + adds r0, r3, 0x6 + str r0, [r4] +_08156C4C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8156C04 + + thumb_func_start sub_8156C54 +sub_8156C54: @ 8156C54 + push {r4,r5,lr} + bl sub_8156B88 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r1, [r3] + ldrb r0, [r3, 0x1] + lsls r0, 8 + orrs r1, r0 + movs r5, 0x18 + ldrsh r0, [r2, r5] + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + bne _08156C98 + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08156C9C + .pool +_08156C98: + adds r0, r3, 0x6 + str r0, [r4] +_08156C9C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8156C54 + + thumb_func_start sub_8156CA4 +sub_8156CA4: @ 8156CA4 + push {r4,r5,lr} + bl sub_8156B88 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r1, [r3] + ldrb r0, [r3, 0x1] + lsls r0, 8 + orrs r1, r0 + movs r5, 0x18 + ldrsh r0, [r2, r5] + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + beq _08156CE8 + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08156CEC + .pool +_08156CE8: + adds r0, r3, 0x6 + str r0, [r4] +_08156CEC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8156CA4 + + thumb_func_start sub_8156CF4 +sub_8156CF4: @ 8156CF4 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0xC] + ldr r0, =0x02039f2c + ldrh r0, [r0] + strh r0, [r1, 0x18] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8156CF4 + + thumb_func_start sub_8156D18 +sub_8156D18: @ 8156D18 + push {lr} + bl sub_8156CF4 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _08156D54 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08156D58 + .pool +_08156D54: + adds r0, r2, 0x5 + str r0, [r3] +_08156D58: + pop {r0} + bx r0 + thumb_func_end sub_8156D18 + + thumb_func_start sub_8156D5C +sub_8156D5C: @ 8156D5C + push {lr} + bl sub_8156CF4 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _08156D98 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08156D9C + .pool +_08156D98: + adds r0, r2, 0x5 + str r0, [r3] +_08156D9C: + pop {r0} + bx r0 + thumb_func_end sub_8156D5C + + thumb_func_start sub_8156DA0 +sub_8156DA0: @ 8156DA0 + push {r4,lr} + ldr r2, =0x02039e00 + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r0, [r0, 0xC] + ldrb r1, [r0, 0x4] + lsls r1, 1 + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r2, 0x1E + adds r1, r2 + ldrh r0, [r1] + bl sub_80DD9F0 + ldr r1, [r4] + ldr r1, [r1, 0xC] + lsls r0, 24 + asrs r0, 24 + strh r0, [r1, 0x18] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8156DA0 + + thumb_func_start sub_8156DE4 +sub_8156DE4: @ 8156DE4 + push {r4,lr} + bl sub_8156DA0 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + ldr r3, =0x0203ab38 + ldr r2, [r3] + movs r4, 0x18 + ldrsh r1, [r0, r4] + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r1, r0 + bge _08156E20 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08156E24 + .pool +_08156E20: + adds r0, r2, 0x5 + str r0, [r3] +_08156E24: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8156DE4 + + thumb_func_start sub_8156E2C +sub_8156E2C: @ 8156E2C + push {r4,lr} + bl sub_8156DA0 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + ldr r3, =0x0203ab38 + ldr r2, [r3] + movs r4, 0x18 + ldrsh r1, [r0, r4] + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r1, r0 + ble _08156E68 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08156E6C + .pool +_08156E68: + adds r0, r2, 0x5 + str r0, [r3] +_08156E6C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8156E2C + + thumb_func_start sub_8156E74 +sub_8156E74: @ 8156E74 + push {r4,lr} + bl sub_8156DA0 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + ldr r3, =0x0203ab38 + ldr r2, [r3] + movs r4, 0x18 + ldrsh r1, [r0, r4] + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r1, r0 + bne _08156EB0 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08156EB4 + .pool +_08156EB0: + adds r0, r2, 0x5 + str r0, [r3] +_08156EB4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8156E74 + + thumb_func_start sub_8156EBC +sub_8156EBC: @ 8156EBC + push {r4,lr} + bl sub_8156DA0 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + ldr r3, =0x0203ab38 + ldr r2, [r3] + movs r4, 0x18 + ldrsh r1, [r0, r4] + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r1, r0 + beq _08156EF8 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08156EFC + .pool +_08156EF8: + adds r0, r2, 0x5 + str r0, [r3] +_08156EFC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8156EBC + + thumb_func_start sub_8156F04 +sub_8156F04: @ 8156F04 + ldr r2, =0x02039e00 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r3, [r0, 0xC] + ldrb r1, [r3, 0x4] + lsls r1, 1 + adds r0, r3, 0 + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r2, 0x1E + adds r1, r2 + ldrh r0, [r1] + ldr r1, =gContestMoves + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0] + strh r0, [r3, 0x18] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8156F04 + + thumb_func_start sub_8156F44 +sub_8156F44: @ 8156F44 + push {lr} + bl sub_8156F04 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _08156F80 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08156F84 + .pool +_08156F80: + adds r0, r2, 0x5 + str r0, [r3] +_08156F84: + pop {r0} + bx r0 + thumb_func_end sub_8156F44 + + thumb_func_start sub_8156F88 +sub_8156F88: @ 8156F88 + push {lr} + bl sub_8156F04 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _08156FC4 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08156FC8 + .pool +_08156FC4: + adds r0, r2, 0x5 + str r0, [r3] +_08156FC8: + pop {r0} + bx r0 + thumb_func_end sub_8156F88 + + thumb_func_start sub_8156FCC +sub_8156FCC: @ 8156FCC + ldr r2, =0x02039e00 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r3, [r0, 0xC] + ldrb r1, [r3, 0x4] + lsls r1, 1 + adds r0, r3, 0 + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r2, 0x1E + adds r1, r2 + ldrh r0, [r1] + ldr r2, =gContestEffects + ldr r1, =gContestMoves + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + strh r0, [r3, 0x18] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8156FCC + + thumb_func_start sub_8157018 +sub_8157018: @ 8157018 + push {lr} + bl sub_8156FCC + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _08157054 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157058 + .pool +_08157054: + adds r0, r2, 0x5 + str r0, [r3] +_08157058: + pop {r0} + bx r0 + thumb_func_end sub_8157018 + + thumb_func_start sub_815705C +sub_815705C: @ 815705C + push {lr} + bl sub_8156FCC + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _08157098 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0815709C + .pool +_08157098: + adds r0, r2, 0x5 + str r0, [r3] +_0815709C: + pop {r0} + bx r0 + thumb_func_end sub_815705C + + thumb_func_start sub_81570A0 +sub_81570A0: @ 81570A0 + push {r4-r7,lr} + ldr r2, =0x02039e00 + ldr r5, =0x02039f34 + ldr r0, [r5] + ldr r1, [r0, 0xC] + ldrb r0, [r1, 0x4] + lsls r0, 1 + adds r1, 0x41 + ldrb r1, [r1] + lsls r1, 6 + adds r0, r1 + adds r2, 0x1E + adds r0, r2 + ldrh r0, [r0] + ldr r3, =gContestEffects + ldr r4, =gContestMoves + lsls r0, 3 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r3 + ldrb r7, [r0, 0x1] + movs r6, 0 + ldr r0, =0x0203ab38 + mov r12, r0 + adds r1, r2 +_081570D4: + ldrh r0, [r1] + cmp r0, 0 + beq _081570EA + lsls r0, 3 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x1] + cmp r7, r0 + bcc _081570F2 +_081570EA: + adds r1, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _081570D4 +_081570F2: + cmp r6, 0x4 + bne _08157114 + ldr r0, [r5] + ldr r1, [r0, 0xC] + movs r0, 0x1 + b _0815711A + .pool +_08157114: + ldr r0, [r5] + ldr r1, [r0, 0xC] + movs r0, 0 +_0815711A: + strh r0, [r1, 0x18] + mov r1, r12 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81570A0 + + thumb_func_start sub_815712C +sub_815712C: @ 815712C + push {lr} + bl sub_81570A0 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08157164 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0815716C + .pool +_08157164: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_0815716C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_815712C + + thumb_func_start sub_8157174 +sub_8157174: @ 8157174 + push {r4-r7,lr} + ldr r2, =0x02039e00 + ldr r5, =0x02039f34 + ldr r0, [r5] + ldr r1, [r0, 0xC] + ldrb r0, [r1, 0x4] + lsls r0, 1 + adds r1, 0x41 + ldrb r1, [r1] + lsls r1, 6 + adds r0, r1 + adds r2, 0x1E + adds r0, r2 + ldrh r0, [r0] + ldr r3, =gContestEffects + ldr r4, =gContestMoves + lsls r0, 3 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r3 + ldrb r7, [r0, 0x2] + movs r6, 0 + ldr r0, =0x0203ab38 + mov r12, r0 + adds r1, r2 +_081571A8: + ldrh r0, [r1] + cmp r0, 0 + beq _081571BE + lsls r0, 3 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x2] + cmp r7, r0 + bcc _081571C6 +_081571BE: + adds r1, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _081571A8 +_081571C6: + cmp r6, 0x4 + bne _081571E8 + ldr r0, [r5] + ldr r1, [r0, 0xC] + movs r0, 0x1 + b _081571EE + .pool +_081571E8: + ldr r0, [r5] + ldr r1, [r0, 0xC] + movs r0, 0 +_081571EE: + strh r0, [r1, 0x18] + mov r1, r12 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8157174 + + thumb_func_start sub_8157200 +sub_8157200: @ 8157200 + push {lr} + bl sub_8157174 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08157238 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157240 + .pool +_08157238: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08157240: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157200 + + thumb_func_start sub_8157248 +sub_8157248: @ 8157248 + push {r4,lr} + ldr r2, =0x02039e00 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r4, [r0, 0xC] + ldrb r1, [r4, 0x4] + lsls r1, 1 + adds r0, r4, 0 + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r2, 0x1E + adds r1, r2 + ldrh r0, [r1] + ldr r2, =gContestEffects + ldr r1, =gContestMoves + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x18] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157248 + + thumb_func_start sub_81572A4 +sub_81572A4: @ 81572A4 + push {lr} + bl sub_8157248 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bge _081572E0 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081572E4 + .pool +_081572E0: + adds r0, r2, 0x5 + str r0, [r3] +_081572E4: + pop {r0} + bx r0 + thumb_func_end sub_81572A4 + + thumb_func_start sub_81572E8 +sub_81572E8: @ 81572E8 + push {lr} + bl sub_8157248 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + ble _08157324 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157328 + .pool +_08157324: + adds r0, r2, 0x5 + str r0, [r3] +_08157328: + pop {r0} + bx r0 + thumb_func_end sub_81572E8 + + thumb_func_start sub_815732C +sub_815732C: @ 815732C + push {lr} + bl sub_8157248 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _08157368 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0815736C + .pool +_08157368: + adds r0, r2, 0x5 + str r0, [r3] +_0815736C: + pop {r0} + bx r0 + thumb_func_end sub_815732C + + thumb_func_start sub_8157370 +sub_8157370: @ 8157370 + push {lr} + bl sub_8157248 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _081573AC + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081573B0 + .pool +_081573AC: + adds r0, r2, 0x5 + str r0, [r3] +_081573B0: + pop {r0} + bx r0 + thumb_func_end sub_8157370 + + thumb_func_start sub_81573B4 +sub_81573B4: @ 81573B4 + push {r4,lr} + ldr r2, =0x02039e00 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r4, [r0, 0xC] + ldrb r1, [r4, 0x4] + lsls r1, 1 + adds r0, r4, 0 + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r2, 0x1E + adds r1, r2 + ldrh r0, [r1] + ldr r2, =gContestEffects + ldr r1, =gContestMoves + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x2] + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x18] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81573B4 + + thumb_func_start sub_8157410 +sub_8157410: @ 8157410 + push {lr} + bl sub_81573B4 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bge _0815744C + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157450 + .pool +_0815744C: + adds r0, r2, 0x5 + str r0, [r3] +_08157450: + pop {r0} + bx r0 + thumb_func_end sub_8157410 + + thumb_func_start sub_8157454 +sub_8157454: @ 8157454 + push {lr} + bl sub_81573B4 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + ble _08157490 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157494 + .pool +_08157490: + adds r0, r2, 0x5 + str r0, [r3] +_08157494: + pop {r0} + bx r0 + thumb_func_end sub_8157454 + + thumb_func_start sub_8157498 +sub_8157498: @ 8157498 + push {lr} + bl sub_81573B4 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _081574D4 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081574D8 + .pool +_081574D4: + adds r0, r2, 0x5 + str r0, [r3] +_081574D8: + pop {r0} + bx r0 + thumb_func_end sub_8157498 + + thumb_func_start sub_81574DC +sub_81574DC: @ 81574DC + push {lr} + bl sub_81573B4 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _08157518 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0815751C + .pool +_08157518: + adds r0, r2, 0x5 + str r0, [r3] +_0815751C: + pop {r0} + bx r0 + thumb_func_end sub_81574DC + + thumb_func_start sub_8157520 +sub_8157520: @ 8157520 + push {r4,r5,lr} + ldr r3, =0x02039e00 + ldr r5, =0x02039f34 + ldr r4, [r5] + ldr r1, [r4, 0xC] + ldrb r0, [r1, 0x4] + lsls r0, 1 + adds r1, 0x41 + ldrb r2, [r1] + lsls r1, r2, 6 + adds r0, r1 + adds r3, 0x1E + adds r0, r3 + ldrh r3, [r0] + ldr r1, [r4, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0, 0x8] + cmp r3, r1 + beq _08157558 + movs r1, 0 + b _08157560 + .pool +_08157558: + ldrb r0, [r0, 0xB] + lsls r0, 25 + lsrs r0, 29 + adds r1, r0, 0x1 +_08157560: + ldr r0, [r5] + ldr r0, [r0, 0xC] + strh r1, [r0, 0x18] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157520 + + thumb_func_start sub_8157578 +sub_8157578: @ 8157578 + push {lr} + bl sub_8157520 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bge _081575B4 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081575B8 + .pool +_081575B4: + adds r0, r2, 0x5 + str r0, [r3] +_081575B8: + pop {r0} + bx r0 + thumb_func_end sub_8157578 + + thumb_func_start sub_81575BC +sub_81575BC: @ 81575BC + push {lr} + bl sub_8157520 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + ble _081575F8 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081575FC + .pool +_081575F8: + adds r0, r2, 0x5 + str r0, [r3] +_081575FC: + pop {r0} + bx r0 + thumb_func_end sub_81575BC + + thumb_func_start sub_8157600 +sub_8157600: @ 8157600 + push {lr} + bl sub_8157520 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _0815763C + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157640 + .pool +_0815763C: + adds r0, r2, 0x5 + str r0, [r3] +_08157640: + pop {r0} + bx r0 + thumb_func_end sub_8157600 + + thumb_func_start sub_8157644 +sub_8157644: @ 8157644 + push {lr} + bl sub_8157520 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _08157680 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157684 + .pool +_08157680: + adds r0, r2, 0x5 + str r0, [r3] +_08157684: + pop {r0} + bx r0 + thumb_func_end sub_8157644 + + thumb_func_start sub_8157688 +sub_8157688: @ 8157688 + push {r4-r6,lr} + movs r3, 0 + ldr r2, =0x02039e00 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + ldrb r1, [r0, 0x4] + lsls r1, 1 + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r2, 0x1E + adds r1, r2 + ldrh r5, [r1] + movs r4, 0 + adds r6, r2, 0 +_081576AA: + lsls r1, r4, 1 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r1, r6 + ldrh r0, [r1] + cmp r0, 0 + beq _081576D2 + adds r1, r0, 0 + adds r0, r5, 0 + bl AreMovesContestCombo + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + bne _081576DC +_081576D2: + adds r4, 0x1 + cmp r4, 0x3 + ble _081576AA + cmp r3, 0 + beq _081576DE +_081576DC: + movs r3, 0x1 +_081576DE: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + strh r3, [r0, 0x18] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157688 + + thumb_func_start sub_8157700 +sub_8157700: @ 8157700 + push {lr} + bl sub_8157688 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08157738 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157740 + .pool +_08157738: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157740: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157700 + + thumb_func_start sub_8157748 +sub_8157748: @ 8157748 + push {lr} + bl sub_8157688 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08157780 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157788 + .pool +_08157780: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157788: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157748 + + thumb_func_start sub_8157790 +sub_8157790: @ 8157790 + push {r4-r6,lr} + movs r3, 0 + ldr r2, =0x02039e00 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + ldrb r1, [r0, 0x4] + lsls r1, 1 + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r2, 0x1E + adds r1, r2 + ldrh r5, [r1] + movs r4, 0 + adds r6, r2, 0 +_081577B2: + lsls r1, r4, 1 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r1, r6 + ldrh r0, [r1] + cmp r0, 0 + beq _081577D8 + adds r1, r5, 0 + bl AreMovesContestCombo + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + bne _081577E2 +_081577D8: + adds r4, 0x1 + cmp r4, 0x3 + ble _081577B2 + cmp r3, 0 + beq _081577E4 +_081577E2: + movs r3, 0x1 +_081577E4: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + strh r3, [r0, 0x18] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157790 + + thumb_func_start sub_8157808 +sub_8157808: @ 8157808 + push {lr} + bl sub_8157790 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08157840 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157848 + .pool +_08157840: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157848: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157808 + + thumb_func_start sub_8157850 +sub_8157850: @ 8157850 + push {lr} + bl sub_8157790 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08157888 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157890 + .pool +_08157888: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157890: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157850 + + thumb_func_start sub_8157898 +sub_8157898: @ 8157898 + push {r4-r6,lr} + movs r5, 0 + ldr r3, =0x02039e00 + ldr r6, =0x02039f34 + ldr r4, [r6] + ldr r1, [r4, 0xC] + ldrb r0, [r1, 0x4] + lsls r0, 1 + adds r1, 0x41 + ldrb r2, [r1] + lsls r1, r2, 6 + adds r0, r1 + adds r3, 0x1E + adds r0, r3 + ldrh r3, [r0] + ldr r1, [r4, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x8] + cmp r0, 0 + beq _081578D0 + adds r1, r3, 0 + bl AreMovesContestCombo + lsls r0, 24 + lsrs r5, r0, 24 +_081578D0: + cmp r5, 0 + beq _081578D6 + movs r5, 0x1 +_081578D6: + ldr r0, [r6] + ldr r0, [r0, 0xC] + strh r5, [r0, 0x18] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157898 + + thumb_func_start sub_81578F8 +sub_81578F8: @ 81578F8 + push {lr} + bl sub_8157898 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08157930 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157938 + .pool +_08157930: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157938: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81578F8 + + thumb_func_start sub_8157940 +sub_8157940: @ 8157940 + push {lr} + bl sub_8157898 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08157978 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157980 + .pool +_08157978: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157980: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157940 + + thumb_func_start sub_8157988 +sub_8157988: @ 8157988 + push {r4,r5,lr} + ldr r4, =0x0203ab38 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl sub_81564AC + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02039f34 + ldr r1, [r1] + ldr r5, [r1, 0xC] + ldr r2, [r1, 0x4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0xD + ldrsb r0, [r1, r0] + movs r1, 0xA + bl __divsi3 + lsls r0, 24 + asrs r0, 24 + strh r0, [r5, 0x18] + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157988 + + thumb_func_start sub_81579CC +sub_81579CC: @ 81579CC + push {lr} + bl sub_8157988 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bge _08157A08 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157A0C + .pool +_08157A08: + adds r0, r2, 0x5 + str r0, [r3] +_08157A0C: + pop {r0} + bx r0 + thumb_func_end sub_81579CC + + thumb_func_start sub_8157A10 +sub_8157A10: @ 8157A10 + push {lr} + bl sub_8157988 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + ble _08157A4C + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157A50 + .pool +_08157A4C: + adds r0, r2, 0x5 + str r0, [r3] +_08157A50: + pop {r0} + bx r0 + thumb_func_end sub_8157A10 + + thumb_func_start sub_8157A54 +sub_8157A54: @ 8157A54 + push {lr} + bl sub_8157988 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _08157A90 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157A94 + .pool +_08157A90: + adds r0, r2, 0x5 + str r0, [r3] +_08157A94: + pop {r0} + bx r0 + thumb_func_end sub_8157A54 + + thumb_func_start sub_8157A98 +sub_8157A98: @ 8157A98 + push {lr} + bl sub_8157988 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _08157AD4 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157AD8 + .pool +_08157AD4: + adds r0, r2, 0x5 + str r0, [r3] +_08157AD8: + pop {r0} + bx r0 + thumb_func_end sub_8157A98 + + thumb_func_start sub_8157ADC +sub_8157ADC: @ 8157ADC + push {r4-r6,lr} + movs r6, 0 + ldr r5, =0x0203ab38 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl sub_81564AC + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_80DE1E8 + lsls r0, 24 + cmp r0, 0 + beq _08157B18 + ldr r2, =gContestMoves + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x8] + lsls r0, 3 + adds r0, r2 + ldrb r1, [r0, 0x2] + negs r0, r1 + orrs r0, r1 + lsrs r6, r0, 31 +_08157B18: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + strh r6, [r0, 0x18] + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157ADC + + thumb_func_start sub_8157B38 +sub_8157B38: @ 8157B38 + push {lr} + bl sub_8157ADC + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bge _08157B74 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157B78 + .pool +_08157B74: + adds r0, r2, 0x5 + str r0, [r3] +_08157B78: + pop {r0} + bx r0 + thumb_func_end sub_8157B38 + + thumb_func_start sub_8157B7C +sub_8157B7C: @ 8157B7C + push {lr} + bl sub_8157ADC + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + ble _08157BB8 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157BBC + .pool +_08157BB8: + adds r0, r2, 0x5 + str r0, [r3] +_08157BBC: + pop {r0} + bx r0 + thumb_func_end sub_8157B7C + + thumb_func_start sub_8157BC0 +sub_8157BC0: @ 8157BC0 + push {lr} + bl sub_8157ADC + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _08157BFC + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157C00 + .pool +_08157BFC: + adds r0, r2, 0x5 + str r0, [r3] +_08157C00: + pop {r0} + bx r0 + thumb_func_end sub_8157BC0 + + thumb_func_start sub_8157C04 +sub_8157C04: @ 8157C04 + push {lr} + bl sub_8157ADC + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _08157C40 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157C44 + .pool +_08157C40: + adds r0, r2, 0x5 + str r0, [r3] +_08157C44: + pop {r0} + bx r0 + thumb_func_end sub_8157C04 + + thumb_func_start sub_8157C48 +sub_8157C48: @ 8157C48 + push {lr} + ldr r0, =0x0203ab38 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl sub_81564AC + lsls r0, 24 + lsrs r0, 24 + bl sub_80DBCA8 + lsls r0, 24 + cmp r0, 0 + beq _08157C74 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0xC] + movs r0, 0 + b _08157C7C + .pool +_08157C74: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0xC] + movs r0, 0x1 +_08157C7C: + strh r0, [r1, 0x18] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157C48 + + thumb_func_start sub_8157C94 +sub_8157C94: @ 8157C94 + push {lr} + bl sub_8157C48 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08157CCC + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157CD4 + .pool +_08157CCC: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157CD4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157C94 + + thumb_func_start sub_8157CDC +sub_8157CDC: @ 8157CDC + push {lr} + bl sub_8157C48 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08157D14 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157D1C + .pool +_08157D14: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157D1C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157CDC + + thumb_func_start sub_8157D24 +sub_8157D24: @ 8157D24 + push {r4,lr} + ldr r4, =0x0203ab38 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl sub_81564AC + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02039f34 + ldr r1, [r1] + ldr r3, [r1, 0xC] + ldr r2, [r1, 0x4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x15] + lsls r0, 28 + lsrs r0, 31 + strh r0, [r3, 0x18] + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157D24 + + thumb_func_start sub_8157D60 +sub_8157D60: @ 8157D60 + push {lr} + bl sub_8157D24 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08157D98 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157DA0 + .pool +_08157D98: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157DA0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157D60 + + thumb_func_start sub_8157DA8 +sub_8157DA8: @ 8157DA8 + push {lr} + bl sub_8157D24 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08157DE0 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157DE8 + .pool +_08157DE0: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157DE8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157DA8 + + thumb_func_start sub_8157DF0 +sub_8157DF0: @ 8157DF0 + push {r4,r5,lr} + ldr r4, =0x0203ab38 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl sub_81564AC + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02039f34 + ldr r1, [r1] + ldr r5, [r1, 0xC] + ldr r3, [r1, 0x4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r3 + adds r0, r5, 0 + adds r0, 0x41 + ldrb r2, [r0] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r1, 0x4] + ldrh r0, [r0, 0x4] + subs r1, r0 + strh r1, [r5, 0x18] + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157DF0 + + thumb_func_start sub_8157E3C +sub_8157E3C: @ 8157E3C + push {lr} + bl sub_8157DF0 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _08157E74 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157E7C + .pool +_08157E74: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157E7C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157E3C + + thumb_func_start sub_8157E84 +sub_8157E84: @ 8157E84 + push {lr} + bl sub_8157DF0 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + ble _08157EBC + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157EC4 + .pool +_08157EBC: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157EC4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157E84 + + thumb_func_start sub_8157ECC +sub_8157ECC: @ 8157ECC + push {lr} + bl sub_8157DF0 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08157F04 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157F0C + .pool +_08157F04: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157F0C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157ECC + + thumb_func_start sub_8157F14 +sub_8157F14: @ 8157F14 + push {lr} + bl sub_8157DF0 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08157F4C + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157F54 + .pool +_08157F4C: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157F54: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157F14 + + thumb_func_start sub_8157F5C +sub_8157F5C: @ 8157F5C + push {r4,lr} + ldr r4, =0x0203ab38 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl sub_81564AC + lsls r0, 24 + ldr r1, =0x02039f34 + ldr r1, [r1] + ldr r3, [r1, 0xC] + ldr r2, =0x02039f00 + lsrs r0, 23 + adds r0, r2 + adds r1, r3, 0 + adds r1, 0x41 + ldrb r1, [r1] + lsls r1, 1 + adds r1, r2 + ldrh r0, [r0] + ldrh r1, [r1] + subs r0, r1 + strh r0, [r3, 0x18] + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157F5C + + thumb_func_start sub_8157FA0 +sub_8157FA0: @ 8157FA0 + push {lr} + bl sub_8157F5C + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _08157FD8 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08157FE0 + .pool +_08157FD8: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08157FE0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157FA0 + + thumb_func_start sub_8157FE8 +sub_8157FE8: @ 8157FE8 + push {lr} + bl sub_8157F5C + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + ble _08158020 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08158028 + .pool +_08158020: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08158028: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8157FE8 + + thumb_func_start sub_8158030 +sub_8158030: @ 8158030 + push {lr} + bl sub_8157F5C + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08158068 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08158070 + .pool +_08158068: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08158070: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8158030 + + thumb_func_start sub_8158078 +sub_8158078: @ 8158078 + push {lr} + bl sub_8157F5C + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _081580B0 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081580B8 + .pool +_081580B0: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_081580B8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8158078 + + thumb_func_start sub_81580C0 +sub_81580C0: @ 81580C0 + push {r4,r5,lr} + ldr r5, =0x0203ab38 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl sub_81564AC + lsls r0, 24 + ldr r3, [r5] + ldrb r2, [r3, 0x2] + ldr r1, =0x02039f34 + ldr r4, [r1] + ldr r1, [r4] + lsrs r0, 23 + lsls r2, 3 + adds r0, r2 + adds r1, 0x1C + adds r1, r0 + ldrh r0, [r1] + ldr r2, [r4, 0xC] + ldr r1, =gContestMoves + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0] + strh r0, [r2, 0x18] + adds r3, 0x3 + str r3, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81580C0 + + thumb_func_start sub_8158108 +sub_8158108: @ 8158108 + push {lr} + bl sub_81580C0 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bge _08158144 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08158148 + .pool +_08158144: + adds r0, r2, 0x5 + str r0, [r3] +_08158148: + pop {r0} + bx r0 + thumb_func_end sub_8158108 + + thumb_func_start sub_815814C +sub_815814C: @ 815814C + push {lr} + bl sub_81580C0 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + ble _08158188 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0815818C + .pool +_08158188: + adds r0, r2, 0x5 + str r0, [r3] +_0815818C: + pop {r0} + bx r0 + thumb_func_end sub_815814C + + thumb_func_start sub_8158190 +sub_8158190: @ 8158190 + push {lr} + bl sub_81580C0 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _081581CC + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081581D0 + .pool +_081581CC: + adds r0, r2, 0x5 + str r0, [r3] +_081581D0: + pop {r0} + bx r0 + thumb_func_end sub_8158190 + + thumb_func_start sub_81581D4 +sub_81581D4: @ 81581D4 + push {lr} + bl sub_81580C0 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _08158210 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08158214 + .pool +_08158210: + adds r0, r2, 0x5 + str r0, [r3] +_08158214: + pop {r0} + bx r0 + thumb_func_end sub_81581D4 + + thumb_func_start sub_8158218 +sub_8158218: @ 8158218 + push {r4,r5,lr} + ldr r5, =0x0203ab38 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl sub_81564AC + lsls r0, 24 + lsrs r0, 24 + ldr r3, [r5] + ldrb r2, [r3, 0x2] + ldr r1, =0x02039f34 + ldr r4, [r1] + ldr r1, [r4] + lsls r2, 2 + adds r0, r2 + adds r1, 0x44 + adds r1, r0 + ldr r2, [r4, 0xC] + movs r0, 0 + ldrsb r0, [r1, r0] + strh r0, [r2, 0x18] + adds r3, 0x3 + str r3, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8158218 + + thumb_func_start sub_8158254 +sub_8158254: @ 8158254 + push {lr} + bl sub_8158218 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bge _08158290 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08158294 + .pool +_08158290: + adds r0, r2, 0x5 + str r0, [r3] +_08158294: + pop {r0} + bx r0 + thumb_func_end sub_8158254 + + thumb_func_start sub_8158298 +sub_8158298: @ 8158298 + push {lr} + bl sub_8158218 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + ble _081582D4 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081582D8 + .pool +_081582D4: + adds r0, r2, 0x5 + str r0, [r3] +_081582D8: + pop {r0} + bx r0 + thumb_func_end sub_8158298 + + thumb_func_start sub_81582DC +sub_81582DC: @ 81582DC + push {lr} + bl sub_8158218 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _08158318 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0815831C + .pool +_08158318: + adds r0, r2, 0x5 + str r0, [r3] +_0815831C: + pop {r0} + bx r0 + thumb_func_end sub_81582DC + + thumb_func_start sub_8158320 +sub_8158320: @ 8158320 + push {lr} + bl sub_8158218 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _0815835C + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08158360 + .pool +_0815835C: + adds r0, r2, 0x5 + str r0, [r3] +_08158360: + pop {r0} + bx r0 + thumb_func_end sub_8158320 + + thumb_func_start sub_8158364 +sub_8158364: @ 8158364 + push {r4,r5,lr} + ldr r5, =0x0203ab38 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl sub_81564AC + lsls r0, 24 + ldr r3, [r5] + ldrb r2, [r3, 0x2] + ldr r1, =0x02039f34 + ldr r4, [r1] + ldr r1, [r4] + lsrs r0, 23 + lsls r2, 3 + adds r0, r2 + adds r1, 0x1C + adds r1, r0 + ldrh r0, [r1] + ldr r4, [r4, 0xC] + ldr r2, =gContestEffects + ldr r1, =gContestMoves + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + strh r0, [r4, 0x18] + adds r3, 0x3 + str r3, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8158364 + + thumb_func_start sub_81583B8 +sub_81583B8: @ 81583B8 + push {lr} + bl sub_8158364 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + bne _081583F4 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081583F8 + .pool +_081583F4: + adds r0, r2, 0x5 + str r0, [r3] +_081583F8: + pop {r0} + bx r0 + thumb_func_end sub_81583B8 + + thumb_func_start sub_81583FC +sub_81583FC: @ 81583FC + push {lr} + bl sub_8158364 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + cmp r0, r1 + beq _08158438 + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0815843C + .pool +_08158438: + adds r0, r2, 0x5 + str r0, [r3] +_0815843C: + pop {r0} + bx r0 + thumb_func_end sub_81583FC + + thumb_func_start sub_8158440 +sub_8158440: @ 8158440 + push {r4,lr} + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r3, [r0, 0xC] + ldr r4, =0x0203ab38 + ldr r2, [r4] + ldrb r0, [r2, 0x1] + lsls r0, 1 + adds r1, r3, 0 + adds r1, 0x1A + adds r1, r0 + ldrh r0, [r3, 0x18] + strh r0, [r1] + adds r2, 0x2 + str r2, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8158440 + + thumb_func_start sub_815846C +sub_815846C: @ 815846C + push {r4,lr} + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r3, [r0, 0xC] + ldr r4, =0x0203ab38 + ldr r2, [r4] + ldrb r0, [r2, 0x1] + lsls r0, 1 + adds r3, 0x1A + adds r3, r0 + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + strh r1, [r3] + adds r2, 0x4 + str r2, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815846C + + thumb_func_start sub_815849C +sub_815849C: @ 815849C + push {r4,lr} + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r0, [r3, 0x1] + lsls r0, 1 + adds r2, 0x1A + adds r2, r0 + movs r1, 0x2 + ldrsb r1, [r3, r1] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrh r0, [r2] + adds r1, r0 + strh r1, [r2] + adds r3, 0x4 + str r3, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815849C + + thumb_func_start sub_81584D4 +sub_81584D4: @ 81584D4 + push {r4,lr} + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r1, [r3, 0x1] + lsls r1, 1 + adds r2, 0x1A + adds r1, r2, r1 + ldrb r0, [r3, 0x2] + lsls r0, 1 + adds r2, r0 + ldrh r0, [r2] + ldrh r2, [r1] + adds r0, r2 + strh r0, [r1] + adds r3, 0x3 + str r3, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81584D4 + + thumb_func_start sub_8158508 +sub_8158508: @ 8158508 + push {r4,lr} + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r1, [r3, 0x1] + lsls r1, 1 + adds r2, 0x1A + adds r1, r2, r1 + ldrb r0, [r3, 0x2] + lsls r0, 1 + adds r2, r0 + ldrh r0, [r2] + ldrh r2, [r1] + adds r0, r2 + strh r0, [r1] + adds r3, 0x3 + str r3, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8158508 + + thumb_func_start sub_815853C +sub_815853C: @ 815853C + push {r4,lr} + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0xC] + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r0, [r3, 0x1] + lsls r0, 1 + adds r1, 0x1A + adds r1, r0 + movs r0, 0 + ldrsh r2, [r1, r0] + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + cmp r2, r1 + bge _08158580 + ldrb r1, [r3, 0x4] + ldrb r0, [r3, 0x5] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x6] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x7] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08158586 + .pool +_08158580: + adds r0, r3, 0 + adds r0, 0x8 + str r0, [r4] +_08158586: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815853C + + thumb_func_start sub_815858C +sub_815858C: @ 815858C + push {r4,lr} + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0xC] + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r0, [r3, 0x1] + lsls r0, 1 + adds r1, 0x1A + adds r1, r0 + movs r0, 0 + ldrsh r2, [r1, r0] + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + cmp r2, r1 + ble _081585D0 + ldrb r1, [r3, 0x4] + ldrb r0, [r3, 0x5] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x6] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x7] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _081585D6 + .pool +_081585D0: + adds r0, r3, 0 + adds r0, 0x8 + str r0, [r4] +_081585D6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815858C + + thumb_func_start sub_81585DC +sub_81585DC: @ 81585DC + push {r4,lr} + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0xC] + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r0, [r3, 0x1] + lsls r0, 1 + adds r1, 0x1A + adds r1, r0 + movs r0, 0 + ldrsh r2, [r1, r0] + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + cmp r2, r1 + bne _08158620 + ldrb r1, [r3, 0x4] + ldrb r0, [r3, 0x5] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x6] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x7] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08158626 + .pool +_08158620: + adds r0, r3, 0 + adds r0, 0x8 + str r0, [r4] +_08158626: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81585DC + + thumb_func_start sub_815862C +sub_815862C: @ 815862C + push {r4,lr} + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0xC] + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r0, [r3, 0x1] + lsls r0, 1 + adds r1, 0x1A + adds r1, r0 + movs r0, 0 + ldrsh r2, [r1, r0] + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + cmp r2, r1 + beq _08158670 + ldrb r1, [r3, 0x4] + ldrb r0, [r3, 0x5] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x6] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x7] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08158676 + .pool +_08158670: + adds r0, r3, 0 + adds r0, 0x8 + str r0, [r4] +_08158676: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815862C + + thumb_func_start sub_815867C +sub_815867C: @ 815867C + push {r4,r5,lr} + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r1, [r3, 0x1] + lsls r1, 1 + adds r2, 0x1A + adds r1, r2, r1 + ldrb r0, [r3, 0x2] + lsls r0, 1 + adds r2, r0 + movs r0, 0 + ldrsh r1, [r1, r0] + movs r5, 0 + ldrsh r0, [r2, r5] + cmp r1, r0 + bge _081586C4 + ldrb r1, [r3, 0x3] + ldrb r0, [r3, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _081586C8 + .pool +_081586C4: + adds r0, r3, 0x7 + str r0, [r4] +_081586C8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815867C + + thumb_func_start sub_81586D0 +sub_81586D0: @ 81586D0 + push {r4,r5,lr} + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r1, [r3, 0x1] + lsls r1, 1 + adds r2, 0x1A + adds r1, r2, r1 + ldrb r0, [r3, 0x2] + lsls r0, 1 + adds r2, r0 + movs r0, 0 + ldrsh r1, [r1, r0] + movs r5, 0 + ldrsh r0, [r2, r5] + cmp r1, r0 + ble _08158718 + ldrb r1, [r3, 0x3] + ldrb r0, [r3, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _0815871C + .pool +_08158718: + adds r0, r3, 0x7 + str r0, [r4] +_0815871C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81586D0 + + thumb_func_start sub_8158724 +sub_8158724: @ 8158724 + push {r4,r5,lr} + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r1, [r3, 0x1] + lsls r1, 1 + adds r2, 0x1A + adds r1, r2, r1 + ldrb r0, [r3, 0x2] + lsls r0, 1 + adds r2, r0 + movs r0, 0 + ldrsh r1, [r1, r0] + movs r5, 0 + ldrsh r0, [r2, r5] + cmp r1, r0 + bne _0815876C + ldrb r1, [r3, 0x3] + ldrb r0, [r3, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08158770 + .pool +_0815876C: + adds r0, r3, 0x7 + str r0, [r4] +_08158770: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8158724 + + thumb_func_start sub_8158778 +sub_8158778: @ 8158778 + push {r4,r5,lr} + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r1, [r3, 0x1] + lsls r1, 1 + adds r2, 0x1A + adds r1, r2, r1 + ldrb r0, [r3, 0x2] + lsls r0, 1 + adds r2, r0 + movs r0, 0 + ldrsh r1, [r1, r0] + movs r5, 0 + ldrsh r0, [r2, r5] + cmp r1, r0 + beq _081587C0 + ldrb r1, [r3, 0x3] + ldrb r0, [r3, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _081587C4 + .pool +_081587C0: + adds r0, r3, 0x7 + str r0, [r4] +_081587C4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8158778 + + thumb_func_start sub_81587CC +sub_81587CC: @ 81587CC + push {r4,r5,lr} + bl GenerateRandomNumber + movs r2, 0xFF + ands r2, r0 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0xC] + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r0, [r3, 0x1] + lsls r0, 1 + adds r1, 0x1A + adds r1, r0 + movs r5, 0 + ldrsh r0, [r1, r5] + cmp r2, r0 + bge _08158810 + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08158814 + .pool +_08158810: + adds r0, r3, 0x6 + str r0, [r4] +_08158814: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81587CC + + thumb_func_start sub_815881C +sub_815881C: @ 815881C + push {r4,r5,lr} + bl GenerateRandomNumber + movs r2, 0xFF + ands r2, r0 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0xC] + ldr r4, =0x0203ab38 + ldr r3, [r4] + ldrb r0, [r3, 0x1] + lsls r0, 1 + adds r1, 0x1A + adds r1, r0 + movs r5, 0 + ldrsh r0, [r1, r5] + cmp r2, r0 + ble _08158860 + ldrb r1, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08158864 + .pool +_08158860: + adds r0, r3, 0x6 + str r0, [r4] +_08158864: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815881C + + thumb_func_start sub_815886C +sub_815886C: @ 815886C + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + bx lr + .pool + thumb_func_end sub_815886C + + thumb_func_start dp15_call +dp15_call: @ 815888C + push {r4,lr} + ldr r4, =0x0203ab38 + ldr r0, [r4] + adds r0, 0x5 + bl sub_81588E0 + ldr r2, [r4] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp15_call + + thumb_func_start sub_81588BC +sub_81588BC: @ 81588BC + push {lr} + bl sub_8158908 + lsls r0, 24 + cmp r0, 0 + bne _081588D6 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0xC] + ldrb r1, [r2, 0x9] + movs r0, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] +_081588D6: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81588BC + + thumb_func_start sub_81588E0 +sub_81588E0: @ 81588E0 + push {r4,lr} + ldr r1, =0x02039f34 + ldr r1, [r1] + ldr r3, [r1, 0xC] + adds r4, r3, 0 + adds r4, 0x40 + ldrb r1, [r4] + adds r2, r1, 0x1 + strb r2, [r4] + lsls r1, 24 + lsrs r1, 22 + adds r3, 0x20 + adds r3, r1 + str r0, [r3] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81588E0 + + thumb_func_start sub_8158908 +sub_8158908: @ 8158908 + push {lr} + ldr r3, =0x02039f34 + ldr r0, [r3] + ldr r0, [r0, 0xC] + adds r1, r0, 0 + adds r1, 0x40 + ldrb r0, [r1] + cmp r0, 0 + bne _08158924 + movs r0, 0 + b _08158940 + .pool +_08158924: + subs r0, 0x1 + strb r0, [r1] + ldr r2, =0x0203ab38 + ldr r0, [r3] + ldr r1, [r0, 0xC] + adds r0, r1, 0 + adds r0, 0x40 + ldrb r0, [r0] + lsls r0, 2 + adds r1, 0x20 + adds r1, r0 + ldr r0, [r1] + str r0, [r2] + movs r0, 0x1 +_08158940: + pop {r1} + bx r1 + .pool + thumb_func_end sub_8158908 + + thumb_func_start sub_8158948 +sub_8158948: @ 8158948 + push {r4-r6,lr} + movs r5, 0 + movs r4, 0 + ldr r6, =0x02039e1e +_08158950: + lsls r1, r4, 1 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r1, r6 + ldrh r0, [r1] + cmp r0, 0 + beq _08158980 + bl sub_80DD9F0 + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + bne _08158980 + movs r5, 0x1 + b _08158986 + .pool +_08158980: + adds r4, 0x1 + cmp r4, 0x3 + ble _08158950 +_08158986: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + strh r5, [r0, 0x18] + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8158948 + + thumb_func_start sub_81589A4 +sub_81589A4: @ 81589A4 + push {lr} + bl sub_8158948 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _081589DC + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081589E4 + .pool +_081589DC: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_081589E4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81589A4 + + thumb_func_start sub_81589EC +sub_81589EC: @ 81589EC + push {lr} + bl sub_8158948 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08158A24 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08158A2C + .pool +_08158A24: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08158A2C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81589EC + + thumb_func_start sub_8158A34 +sub_8158A34: @ 8158A34 + push {r4-r6,lr} + movs r6, 0 + ldr r3, =0x0203ab38 + ldr r0, [r3] + ldrb r5, [r0, 0x1] + ldrb r0, [r0, 0x2] + lsls r0, 8 + orrs r5, r0 + movs r4, 0 + ldr r0, =0x02039e00 + mov r12, r0 + ldr r2, =0x02039f34 + ldr r0, [r2] + ldr r0, [r0, 0xC] + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + mov r1, r12 + adds r1, 0x1E + adds r0, r1 + ldrh r0, [r0] + b _08158A88 + .pool +_08158A6C: + adds r4, 0x1 + cmp r4, 0x3 + bgt _08158A8E + lsls r1, r4, 1 + ldr r0, [r2] + ldr r0, [r0, 0xC] + adds r0, 0x41 + ldrb r0, [r0] + lsls r0, 6 + adds r1, r0 + mov r0, r12 + adds r0, 0x1E + adds r1, r0 + ldrh r0, [r1] +_08158A88: + cmp r0, r5 + bne _08158A6C + movs r6, 0x1 +_08158A8E: + ldr r0, [r2] + ldr r0, [r0, 0xC] + strh r6, [r0, 0x18] + ldr r0, [r3] + adds r0, 0x3 + str r0, [r3] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8158A34 + + thumb_func_start sub_8158AA0 +sub_8158AA0: @ 8158AA0 + push {lr} + bl sub_8158A34 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08158AD8 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08158AE0 + .pool +_08158AD8: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08158AE0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8158AA0 + + thumb_func_start sub_8158AE8 +sub_8158AE8: @ 8158AE8 + push {lr} + bl sub_8158A34 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0xC] + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08158B20 + ldr r3, =0x0203ab38 + ldr r2, [r3] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08158B28 + .pool +_08158B20: + ldr r1, =0x0203ab38 + ldr r0, [r1] + adds r0, 0x4 + str r0, [r1] +_08158B28: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8158AE8 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/contest_effect.s b/asm/contest_effect.s new file mode 100644 index 000000000..1736a2330 --- /dev/null +++ b/asm/contest_effect.s @@ -0,0 +1,3175 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start AreMovesContestCombo +@ u8 AreMovesContestCombo(u16 moveId1, u16 moveId2) +AreMovesContestCombo: @ 80E5414 + push {r4,lr} + sub sp, 0x4 + lsls r0, 16 + lsls r1, 16 + ldr r2, =gContestMoves + lsrs r0, 13 + adds r0, r2 + ldrb r4, [r0, 0x2] + mov r3, sp + lsrs r1, 13 + adds r1, r2 + ldrb r0, [r1, 0x3] + strb r0, [r3] + mov r2, sp + ldrb r0, [r1, 0x4] + strb r0, [r2, 0x1] + ldrb r0, [r1, 0x5] + strb r0, [r2, 0x2] + mov r0, sp + ldrb r1, [r1, 0x6] + strb r1, [r0, 0x3] + cmp r4, 0 + beq _080E5470 + mov r0, sp + ldrb r0, [r0] + cmp r4, r0 + beq _080E545E + mov r0, sp + ldrb r0, [r0, 0x1] + cmp r4, r0 + beq _080E545E + mov r0, sp + ldrb r0, [r0, 0x2] + cmp r4, r0 + beq _080E545E + cmp r4, r1 + bne _080E5470 +_080E545E: + ldr r0, =gComboStarterLookupTable + adds r0, r4, r0 + ldrb r0, [r0] + b _080E5472 + .pool +_080E5470: + movs r0, 0 +_080E5472: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end AreMovesContestCombo + + thumb_func_start ContestEffectFunc_080E547C +ContestEffectFunc_080E547C: @ 80E547C + bx lr + thumb_func_end ContestEffectFunc_080E547C + + thumb_func_start ContestEffectFunc_080E5480 +ContestEffectFunc_080E5480: @ 80E5480 + push {lr} + ldr r3, =0x02039f34 + ldr r1, [r3] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x10] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0, 0x10] + ldr r0, [r3] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0 + bl sub_80DD3D4 + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E5480 + + thumb_func_start ContestEffectFunc_080E54B0 +ContestEffectFunc_080E54B0: @ 80E54B0 + push {lr} + ldr r3, =0x02039f34 + ldr r1, [r3] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x11] + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0, 0x11] + ldr r0, [r3] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1 + bl sub_80DD3D4 + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E54B0 + + thumb_func_start ContestEffectFunc_080E54E0 +ContestEffectFunc_080E54E0: @ 80E54E0 + ldr r3, =0x02039f34 + ldr r1, [r3] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x10] + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0, 0x10] + ldr r1, [r3] + ldr r0, [r1, 0x8] + ldrb r0, [r0, 0x11] + ldr r2, [r1, 0x4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x15] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x15] + ldr r1, [r3] + ldr r0, [r1, 0x8] + ldrb r0, [r0, 0x11] + ldr r2, [r1, 0x4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0xB] + movs r0, 0x71 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0xB] + bx lr + .pool + thumb_func_end ContestEffectFunc_080E54E0 + + thumb_func_start ContestEffectFunc_080E5534 +ContestEffectFunc_080E5534: @ 80E5534 + push {lr} + ldr r3, =0x02039f34 + ldr r1, [r3] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0, 0x12] + ldr r0, [r3] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x2 + bl sub_80DD3D4 + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E5534 + + thumb_func_start ContestEffectFunc_080E5560 +ContestEffectFunc_080E5560: @ 80E5560 + push {lr} + ldr r3, =0x02039f34 + ldr r1, [r3] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x10] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0, 0x10] + ldr r0, [r3] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x3 + bl sub_80DD3D4 + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E5560 + + thumb_func_start ContestEffectFunc_080E5590 +ContestEffectFunc_080E5590: @ 80E5590 + push {lr} + ldr r3, =0x02039f34 + ldr r1, [r3] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0x14 + strb r1, [r0, 0xF] + ldr r0, [r3] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x4 + bl sub_80DD3D4 + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E5590 + + thumb_func_start ContestEffectFunc_080E55BC +ContestEffectFunc_080E55BC: @ 80E55BC + push {lr} + ldr r3, =0x02039f34 + ldr r1, [r3] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x10] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0, 0x10] + ldr r0, [r3] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x5 + bl sub_80DD3D4 + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E55BC + + thumb_func_start ContestEffectFunc_080E55EC +ContestEffectFunc_080E55EC: @ 80E55EC + push {r4,r5,lr} + movs r2, 0 + ldr r5, =0x02039f34 + ldr r0, [r5] + ldr r1, [r0, 0x8] + ldrb r4, [r1, 0x11] + adds r3, r1, r4 + ldrb r0, [r3] + cmp r0, 0 + beq _080E563A + subs r0, 0x1 + ldrb r1, [r1] + cmp r0, r1 + beq _080E5622 + adds r3, r5, 0 +_080E560A: + adds r2, 0x1 + cmp r2, 0x3 + bgt _080E5622 + ldr r0, [r3] + ldr r1, [r0, 0x8] + adds r0, r1, r4 + ldrb r0, [r0] + subs r0, 0x1 + adds r1, r2 + ldrb r1, [r1] + cmp r0, r1 + bne _080E560A +_080E5622: + ldr r1, =0x02039f34 + ldr r0, [r1] + ldr r0, [r0, 0x8] + strb r2, [r0, 0x8] + ldr r0, [r1] + ldr r1, [r0, 0x8] + movs r0, 0xFF + strb r0, [r1, 0x9] + bl sub_80E6A2C + lsls r0, 24 + lsrs r2, r0, 24 +_080E563A: + cmp r2, 0 + bne _080E564C + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x36 + bl sub_80DD3F0 +_080E564C: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E55EC + + thumb_func_start ContestEffectFunc_080E5664 +ContestEffectFunc_080E5664: @ 80E5664 + push {r4-r6,lr} + movs r1, 0 + ldr r2, =0x02039f34 + ldr r0, [r2] + ldr r0, [r0, 0x8] + ldrb r5, [r0, 0x11] + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0 + beq _080E56B4 + movs r3, 0 + movs r4, 0 + adds r6, r2, 0 +_080E567E: + ldr r0, [r6] + ldr r2, [r0, 0x8] + adds r0, r2, r5 + adds r1, r2, r3 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bls _080E5698 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r4 + strb r3, [r0] + adds r4, 0x1 +_080E5698: + adds r3, 0x1 + cmp r3, 0x3 + ble _080E567E + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + adds r0, 0x8 + adds r0, r4 + movs r1, 0xFF + strb r1, [r0] + bl sub_80E6A2C + lsls r0, 24 + lsrs r1, r0, 24 +_080E56B4: + cmp r1, 0 + bne _080E56C6 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x36 + bl sub_80DD3F0 +_080E56C6: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E5664 + + thumb_func_start ContestEffectFunc_080E56E0 +ContestEffectFunc_080E56E0: @ 80E56E0 + push {lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x14 + cmp r0, 0x1 + bls _080E5702 + movs r1, 0x3C + cmp r0, 0x7 + bhi _080E5702 + movs r1, 0x28 +_080E5702: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + strh r1, [r0, 0x4] + bl ContestEffectFunc_080E55EC + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E56E0 + + thumb_func_start ContestEffectFunc_080E5718 +ContestEffectFunc_080E5718: @ 80E5718 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r7, 0 + ldr r1, =0x02039f34 + ldr r0, [r1] + ldr r0, [r0, 0x8] + ldrb r5, [r0, 0x11] + adds r0, r5 + ldrb r0, [r0] + mov r8, r1 + cmp r0, 0 + beq _080E579E + movs r4, 0 + mov r6, r8 +_080E5736: + ldr r0, [r6] + ldr r2, [r0, 0x8] + adds r0, r2, r5 + adds r1, r2, r4 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bls _080E5798 + strb r4, [r2, 0x8] + ldr r0, [r6] + ldr r1, [r0, 0x8] + movs r0, 0xFF + strb r0, [r1, 0x9] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + cmp r0, 0 + beq _080E5782 + movs r1, 0xA + cmp r0, 0x2 + bls _080E5782 + movs r1, 0x14 + cmp r0, 0x4 + bls _080E5782 + movs r1, 0x1E + cmp r0, 0x6 + bls _080E5782 + movs r1, 0x3C + cmp r0, 0x8 + bhi _080E5782 + movs r1, 0x28 +_080E5782: + ldr r0, [r6] + ldr r0, [r0, 0x8] + strh r1, [r0, 0x4] + bl sub_80E6A2C + lsls r0, 24 + cmp r0, 0 + beq _080E5798 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 +_080E5798: + adds r4, 0x1 + cmp r4, 0x3 + ble _080E5736 +_080E579E: + mov r1, r8 + ldr r0, [r1] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + cmp r7, 0 + bne _080E57BE + mov r1, r8 + ldr r0, [r1] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x36 + bl sub_80DD3F0 +_080E57BE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E5718 + + thumb_func_start ContestEffectFunc_080E57CC +ContestEffectFunc_080E57CC: @ 80E57CC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r0, 0 + mov r9, r0 + ldr r1, =0x02039f34 + ldr r0, [r1] + ldr r0, [r0, 0x8] + ldrb r2, [r0, 0x11] + mov r8, r2 + add r0, r8 + ldrb r0, [r0] + mov r10, r1 + cmp r0, 0 + beq _080E5858 + movs r6, 0 + mov r7, r10 + movs r5, 0 +_080E57F4: + ldr r2, [r7] + ldr r0, [r2, 0x8] + mov r3, r8 + adds r1, r0, r3 + adds r0, r6 + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + bls _080E5850 + ldr r0, [r2, 0x4] + adds r0, r5, r0 + ldrb r1, [r0, 0x15] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080E5850 + lsls r0, r6, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_80E69C8 + lsls r0, 24 + cmp r0, 0 + beq _080E5850 + ldr r0, [r7] + ldr r2, [r0, 0x4] + adds r2, r5, r2 + ldrb r0, [r2, 0x15] + movs r3, 0x11 + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + strb r0, [r2, 0x15] + ldr r0, [r7] + ldr r2, [r0, 0x4] + adds r2, r5, r2 + ldrb r0, [r2, 0x15] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2, 0x15] + adds r0, r4, 0 + movs r1, 0x8 + bl sub_80DD3D4 + movs r0, 0x1 + mov r9, r0 +_080E5850: + adds r5, 0x1C + adds r6, 0x1 + cmp r6, 0x3 + ble _080E57F4 +_080E5858: + mov r1, r10 + ldr r0, [r1] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x7 + bl sub_80DD3D4 + mov r2, r9 + cmp r2, 0 + bne _080E587A + mov r3, r10 + ldr r0, [r3] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x36 + bl sub_80DD3F0 +_080E587A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E57CC + + thumb_func_start ContestEffectFunc_080E588C +ContestEffectFunc_080E588C: @ 80E588C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r0, 0 + mov r9, r0 + ldr r1, =0x02039f34 + ldr r0, [r1] + ldr r0, [r0, 0x8] + ldrb r7, [r0, 0x11] + adds r0, r7 + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0 + beq _080E590A + movs r5, 0 + movs r6, 0 + mov r8, r4 +_080E58B0: + ldr r3, [r4] + ldr r2, [r3, 0x8] + adds r0, r2, r7 + adds r1, r2, r5 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bls _080E5900 + ldr r0, [r3, 0x4] + adds r0, r6, r0 + ldrb r1, [r0, 0x15] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080E58D8 + movs r0, 0x32 + b _080E58DA + .pool +_080E58D8: + movs r0, 0xA +_080E58DA: + strh r0, [r2, 0x4] + mov r1, r8 + ldr r0, [r1] + ldr r0, [r0, 0x8] + strb r5, [r0, 0x8] + ldr r0, [r1] + ldr r1, [r0, 0x8] + movs r0, 0xFF + strb r0, [r1, 0x9] + bl sub_80E6A2C + lsls r0, 24 + cmp r0, 0 + beq _080E5900 + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080E5900: + adds r6, 0x1C + adds r5, 0x1 + ldr r4, =0x02039f34 + cmp r5, 0x3 + ble _080E58B0 +_080E590A: + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + mov r0, r9 + cmp r0, 0 + bne _080E5928 + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x36 + bl sub_80DD3F0 +_080E5928: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E588C + + thumb_func_start ContestEffectFunc_080E5938 +ContestEffectFunc_080E5938: @ 80E5938 + push {r4,lr} + ldr r4, =0x02039f34 + ldr r1, [r4] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x11] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0, 0x11] + bl ContestEffectFunc_080E5664 + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E5938 + + thumb_func_start ContestEffectFunc_080E5970 +ContestEffectFunc_080E5970: @ 80E5970 + push {r4,lr} + ldr r4, =0x02039f34 + ldr r1, [r4] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x6] + ldr r1, =gContestMoves + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0, 0x1] + lsls r0, 29 + lsrs r0, 29 + bl sub_80E6934 + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E5970 + + thumb_func_start ContestEffectFunc_080E59B0 +ContestEffectFunc_080E59B0: @ 80E59B0 + push {lr} + movs r0, 0 + bl sub_80E6934 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E59B0 + + thumb_func_start ContestEffectFunc_080E59D0 +ContestEffectFunc_080E59D0: @ 80E59D0 + push {lr} + movs r0, 0x1 + bl sub_80E6934 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E59D0 + + thumb_func_start ContestEffectFunc_080E59F0 +ContestEffectFunc_080E59F0: @ 80E59F0 + push {lr} + movs r0, 0x2 + bl sub_80E6934 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E59F0 + + thumb_func_start ContestEffectFunc_080E5A10 +ContestEffectFunc_080E5A10: @ 80E5A10 + push {lr} + movs r0, 0x3 + bl sub_80E6934 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E5A10 + + thumb_func_start ContestEffectFunc_080E5A30 +ContestEffectFunc_080E5A30: @ 80E5A30 + push {lr} + movs r0, 0x4 + bl sub_80E6934 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E5A30 + + thumb_func_start ContestEffectFunc_080E5A50 +ContestEffectFunc_080E5A50: @ 80E5A50 + push {r4-r6,lr} + movs r4, 0 + ldr r2, =0x02039f34 + ldr r0, [r2] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x11] + adds r0, r1 + ldrb r0, [r0] + adds r6, r2, 0 + cmp r0, 0x3 + beq _080E5AB0 + movs r5, 0 +_080E5A68: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r1, [r0, 0x8] + ldrb r0, [r1, 0x11] + adds r0, r1, r0 + ldrb r0, [r0] + adds r0, 0x1 + adds r1, r5 + ldrb r1, [r1] + cmp r0, r1 + bne _080E5AAA + lsls r0, r5, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_80E69C8 + lsls r0, 24 + cmp r0, 0 + beq _080E5AA0 + adds r0, r4, 0 + bl sub_80DD560 + adds r0, r4, 0 + movs r1, 0xA + b _080E5AA4 + .pool +_080E5AA0: + adds r0, r4, 0 + movs r1, 0x3C +_080E5AA4: + bl sub_80DD3D4 + movs r4, 0x1 +_080E5AAA: + adds r5, 0x1 + cmp r5, 0x3 + ble _080E5A68 +_080E5AB0: + ldr r0, [r6] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x9 + bl sub_80DD3D4 + cmp r4, 0 + bne _080E5ACC + ldr r0, [r6] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x36 + bl sub_80DD3F0 +_080E5ACC: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end ContestEffectFunc_080E5A50 + + thumb_func_start ContestEffectFunc_080E5AD4 +ContestEffectFunc_080E5AD4: @ 80E5AD4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + movs r0, 0 + mov r9, r0 + movs r1, 0 + str r1, [sp, 0x18] + mov r0, sp + movs r1, 0xFF + movs r2, 0x5 + bl memset + movs r5, 0 + movs r4, 0 + add r2, sp, 0x10 + mov r8, r2 + add r3, sp, 0x8 + mov r10, r3 + movs r6, 0 +_080E5B00: + ldr r0, =0x02039f34 + ldr r2, [r0] + ldr r1, [r2, 0x8] + ldrb r0, [r1, 0x11] + adds r0, r1, r0 + adds r1, r5 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcs _080E5B38 + ldr r0, [r2, 0x4] + adds r0, r6, r0 + ldrb r1, [r0, 0xC] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080E5B38 + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_80DBCA8 + lsls r0, 24 + cmp r0, 0 + bne _080E5B38 + mov r1, sp + adds r0, r1, r4 + strb r5, [r0] + adds r4, 0x1 +_080E5B38: + adds r6, 0x1C + adds r5, 0x1 + cmp r5, 0x3 + ble _080E5B00 + cmp r4, 0x1 + bne _080E5B50 + movs r0, 0x3C + mov r2, r8 + strh r0, [r2] + b _080E5B7E + .pool +_080E5B50: + cmp r4, 0x2 + bne _080E5B5E + movs r0, 0x1E + mov r3, r8 + strh r0, [r3] + strh r0, [r3, 0x2] + b _080E5B7E +_080E5B5E: + cmp r4, 0x3 + bne _080E5B6E + movs r0, 0x14 + mov r6, r8 + strh r0, [r6] + strh r0, [r6, 0x2] + strh r0, [r6, 0x4] + b _080E5B7E +_080E5B6E: + mov r1, r8 + movs r2, 0 + mov r0, r8 + adds r0, 0x6 +_080E5B76: + strh r2, [r0] + subs r0, 0x2 + cmp r0, r1 + bge _080E5B76 +_080E5B7E: + movs r5, 0 + ldr r7, =0x02039f34 + movs r6, 0 + mov r4, r10 +_080E5B86: + ldr r0, [r7] + ldr r0, [r0, 0x4] + adds r0, r6, r0 + ldrb r1, [r0, 0x15] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080E5BD0 + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_80DE1E8 + lsls r0, 24 + cmp r0, 0 + beq _080E5BD0 + ldr r0, [r7] + ldr r0, [r0, 0x4] + adds r0, r6, r0 + ldrh r0, [r0, 0x8] + lsls r0, 3 + ldr r1, =gContestMoves + adds r0, r1 + ldrb r0, [r0, 0x2] + ldr r2, =gComboStarterLookupTable + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + b _080E5BD2 + .pool +_080E5BD0: + movs r0, 0 +_080E5BD2: + strh r0, [r4] + ldr r0, [r7] + ldr r0, [r0, 0x4] + adds r0, r6, r0 + ldrb r0, [r0, 0xD] + lsls r0, 24 + asrs r0, 24 + movs r1, 0xA + bl __divsi3 + lsls r0, 24 + asrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 1 + ldrh r0, [r4] + subs r0, r1 + strh r0, [r4] + adds r6, 0x1C + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _080E5B86 + mov r3, r8 + movs r6, 0 + ldrsh r0, [r3, r6] + cmp r0, 0 + beq _080E5CA0 + movs r5, 0 + mov r0, sp + ldrb r0, [r0] + cmp r0, 0xFF + beq _080E5CA0 + mov r4, sp +_080E5C16: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r5, 1 + add r1, r8 + movs r3, 0 + ldrsh r2, [r1, r3] + ldrb r3, [r4] + lsls r1, r3, 1 + add r1, r10 + movs r6, 0 + ldrsh r1, [r1, r6] + adds r2, r1 + cmp r0, r2 + bge _080E5C66 + adds r0, r3, 0 + bl sub_80E69C8 + lsls r0, 24 + cmp r0, 0 + beq _080E5C70 + ldrb r0, [r4] + bl sub_80DD560 + ldrb r0, [r4] + movs r1, 0xA + bl sub_80DD3D4 + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + b _080E5C6A +_080E5C66: + movs r0, 0x1 + str r0, [sp, 0x18] +_080E5C6A: + ldr r1, [sp, 0x18] + cmp r1, 0 + beq _080E5C86 +_080E5C70: + movs r2, 0 + str r2, [sp, 0x18] + ldrb r0, [r4] + movs r1, 0x3C + bl sub_80DD3D4 + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080E5C86: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + adds r0, 0xD + ldrb r3, [r4] + adds r0, r3 + movs r1, 0x1 + strb r1, [r0] + adds r4, 0x1 + adds r5, 0x1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _080E5C16 +_080E5CA0: + ldr r6, =0x02039f34 + ldr r0, [r6] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0xB + bl sub_80DD3D4 + mov r0, r9 + cmp r0, 0 + bne _080E5CC0 + ldr r0, [r6] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x36 + bl sub_80DD3F0 +_080E5CC0: + 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 ContestEffectFunc_080E5AD4 + + thumb_func_start ContestEffectFunc_080E5CD4 +ContestEffectFunc_080E5CD4: @ 80E5CD4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r0, 0 + mov r8, r0 + movs r6, 0 + ldr r7, =0x02039f34 + movs r5, 0 +_080E5CE4: + ldr r2, [r7] + ldr r0, [r2, 0x8] + ldrb r1, [r0, 0x11] + adds r1, r0, r1 + adds r0, r6 + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + bls _080E5D46 + ldr r0, [r2, 0x4] + adds r0, r5, r0 + ldrb r0, [r0, 0xD] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + ble _080E5D46 + lsls r0, r6, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_80E69C8 + lsls r0, 24 + cmp r0, 0 + beq _080E5D46 + ldr r0, [r7] + ldr r0, [r0, 0x4] + adds r0, r5, r0 + movs r1, 0 + strb r1, [r0, 0xD] + ldr r0, [r7] + ldr r2, [r0, 0x4] + adds r2, r5, r2 + ldrb r1, [r2, 0x10] + movs r3, 0x31 + negs r3, r3 + adds r0, r3, 0 + ands r1, r0 + movs r0, 0x20 + orrs r1, r0 + strb r1, [r2, 0x10] + adds r0, r4, 0 + movs r1, 0xD + bl sub_80DD3D4 + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 +_080E5D46: + adds r5, 0x1C + adds r6, 0x1 + cmp r6, 0x3 + ble _080E5CE4 + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0xC + bl sub_80DD3D4 + mov r0, r8 + cmp r0, 0 + bne _080E5D6E + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x39 + bl sub_80DD3F0 +_080E5D6E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E5CD4 + + thumb_func_start ContestEffectFunc_080E5D7C +ContestEffectFunc_080E5D7C: @ 80E5D7C + push {r4-r7,lr} + movs r7, 0 + movs r4, 0 + ldr r5, =0x02039f34 + movs r6, 0 +_080E5D86: + ldr r3, [r5] + ldr r2, [r3, 0x8] + ldrb r0, [r2, 0x11] + adds r0, r2, r0 + adds r1, r2, r4 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bls _080E5DD2 + ldr r0, [r3, 0x4] + adds r0, r6, r0 + ldrb r0, [r0, 0xD] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + ble _080E5DB0 + movs r0, 0x28 + b _080E5DB2 + .pool +_080E5DB0: + movs r0, 0xA +_080E5DB2: + strh r0, [r2, 0x4] + ldr r0, [r5] + ldr r0, [r0, 0x8] + strb r4, [r0, 0x8] + ldr r0, [r5] + ldr r1, [r0, 0x8] + movs r0, 0xFF + strb r0, [r1, 0x9] + bl sub_80E6A2C + lsls r0, 24 + cmp r0, 0 + beq _080E5DD2 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 +_080E5DD2: + adds r6, 0x1C + adds r4, 0x1 + cmp r4, 0x3 + ble _080E5D86 + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0xE + bl sub_80DD3D4 + cmp r7, 0 + bne _080E5DF8 + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x39 + bl sub_80DD3F0 +_080E5DF8: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E5D7C + + thumb_func_start ContestEffectFunc_080E5E04 +ContestEffectFunc_080E5E04: @ 80E5E04 + push {r4,lr} + ldr r1, =0x02039f26 + ldr r0, =0x02039f34 + ldr r4, [r0] + ldr r0, [r4, 0x8] + ldrb r2, [r0, 0x11] + adds r1, r2, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _080E5E46 + ldr r0, [r4, 0x4] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x6] + ldr r3, =gContestEffects + ldr r2, =gContestMoves + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x1] + lsls r0, 1 + ldrh r2, [r1, 0x2] + adds r0, r2 + strh r0, [r1, 0x2] + ldr r0, [r4, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0xF + bl sub_80DD3D4 +_080E5E46: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E5E04 + + thumb_func_start ContestEffectFunc_080E5E5C +ContestEffectFunc_080E5E5C: @ 80E5E5C + push {r4,lr} + ldr r1, =0x02039f26 + ldr r0, =0x02039f34 + ldr r4, [r0] + ldr r0, [r4, 0x8] + ldrb r2, [r0, 0x11] + adds r1, r2, r1 + ldrb r0, [r1] + cmp r0, 0x3 + bne _080E5E9E + ldr r0, [r4, 0x4] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x6] + ldr r3, =gContestEffects + ldr r2, =gContestMoves + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x1] + lsls r0, 1 + ldrh r2, [r1, 0x2] + adds r0, r2 + strh r0, [r1, 0x2] + ldr r0, [r4, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x10 + bl sub_80DD3D4 +_080E5E9E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E5E5C + + thumb_func_start ContestEffectFunc_080E5EB4 +ContestEffectFunc_080E5EB4: @ 80E5EB4 + push {r4-r7,lr} + movs r1, 0 + movs r5, 0 + ldr r0, =0x02039f34 + ldr r4, [r0] + ldr r2, [r4, 0x8] + ldrb r0, [r2, 0x11] + adds r0, r2, r0 + ldrb r6, [r0] + movs r3, 0 +_080E5EC8: + adds r0, r2, r1 + ldrb r0, [r0] + cmp r6, r0 + bls _080E5EDA + ldr r0, [r4, 0x4] + adds r0, r3, r0 + movs r7, 0x2 + ldrsh r0, [r0, r7] + adds r5, r0 +_080E5EDA: + adds r3, 0x1C + adds r1, 0x1 + cmp r1, 0x3 + ble _080E5EC8 + cmp r5, 0 + bge _080E5EE8 + movs r5, 0 +_080E5EE8: + ldr r0, =0x02039f34 + ldr r3, [r0] + ldr r0, [r3, 0x8] + ldrb r2, [r0, 0x11] + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080E5EFC + cmp r5, 0 + bne _080E5F0C +_080E5EFC: + adds r0, r2, 0 + movs r1, 0x12 + bl sub_80DD3D4 + b _080E5F2C + .pool +_080E5F0C: + ldr r0, [r3, 0x4] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r0, 1 + ldrh r2, [r1, 0x2] + adds r0, r2 + strh r0, [r1, 0x2] + ldr r0, [r3, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x11 + bl sub_80DD3D4 +_080E5F2C: + ldr r4, =0x02039f34 + ldr r1, [r4] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + movs r7, 0x2 + ldrsh r0, [r0, r7] + bl sub_80E6B70 + ldr r2, [r4] + ldr r1, [r2, 0x8] + ldrb r3, [r1, 0x11] + ldr r2, [r2, 0x4] + lsls r1, r3, 3 + subs r1, r3 + lsls r1, 2 + adds r1, r2 + strh r0, [r1, 0x2] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E5EB4 + + thumb_func_start ContestEffectFunc_080E5F64 +ContestEffectFunc_080E5F64: @ 80E5F64 + push {r4-r7,lr} + movs r6, 0 + ldr r0, =0x02039f34 + ldr r4, [r0] + ldr r2, [r4, 0x8] + ldrb r1, [r2, 0x11] + adds r3, r2, r1 + ldrb r1, [r3] + adds r7, r0, 0 + cmp r1, 0 + beq _080E5FB2 + movs r1, 0 + adds r5, r4, 0 + adds r4, r2, 0 + ldrb r0, [r3] + subs r3, r0, 0x1 + movs r2, 0 +_080E5F86: + adds r0, r4, r1 + ldrb r0, [r0] + cmp r3, r0 + bne _080E5F94 + ldr r0, [r5, 0x4] + adds r0, r2, r0 + ldrh r6, [r0, 0x2] +_080E5F94: + adds r2, 0x1C + adds r1, 0x1 + cmp r1, 0x3 + ble _080E5F86 + ldr r3, [r7] + ldr r0, [r3, 0x8] + ldrb r2, [r0, 0x11] + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080E5FB2 + lsls r0, r6, 16 + asrs r4, r0, 16 + cmp r4, 0 + bgt _080E5FC4 +_080E5FB2: + ldr r0, [r7] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x14 + bl sub_80DD3D4 + b _080E5FDE + .pool +_080E5FC4: + ldr r1, [r3, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0, 0x2] + adds r1, r4, r1 + strh r1, [r0, 0x2] + ldr r0, [r3, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x13 + bl sub_80DD3D4 +_080E5FDE: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end ContestEffectFunc_080E5F64 + + thumb_func_start ContestEffectFunc_080E5FE4 +ContestEffectFunc_080E5FE4: @ 80E5FE4 + push {r4,r5,lr} + ldr r1, =0x02039f34 + ldr r3, [r1] + ldr r0, [r3, 0x8] + ldrb r2, [r0, 0x11] + adds r0, r2 + ldrb r4, [r0] + adds r5, r1, 0 + cmp r4, 0 + bne _080E600C + ldr r0, [r3, 0x4] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + movs r0, 0xA + b _080E601C + .pool +_080E600C: + ldr r0, [r3, 0x4] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 2 +_080E601C: + strh r0, [r1, 0x2] + cmp r4, 0 + bne _080E6030 + ldr r0, [r5] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x15 + bl sub_80DD3D4 + b _080E6060 +_080E6030: + cmp r4, 0x1 + bne _080E6042 + ldr r0, [r5] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x16 + bl sub_80DD3D4 + b _080E6060 +_080E6042: + cmp r4, 0x2 + bne _080E6054 + ldr r0, [r5] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x17 + bl sub_80DD3D4 + b _080E6060 +_080E6054: + ldr r0, [r5] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x18 + bl sub_80DD3D4 +_080E6060: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end ContestEffectFunc_080E5FE4 + + thumb_func_start ContestEffectFunc_080E6068 +ContestEffectFunc_080E6068: @ 80E6068 + push {r4,lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x2 + bhi _080E6098 + movs r4, 0xA + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1A + bl sub_80DD3D4 + b _080E60FC + .pool +_080E6098: + cmp r0, 0x5 + bhi _080E60B4 + movs r4, 0x14 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1B + bl sub_80DD3D4 + b _080E60FC + .pool +_080E60B4: + cmp r0, 0x7 + bhi _080E60D0 + movs r4, 0x28 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1C + bl sub_80DD3D4 + b _080E60FC + .pool +_080E60D0: + cmp r1, 0x8 + bhi _080E60EC + movs r4, 0x3C + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1D + bl sub_80DD3D4 + b _080E60FC + .pool +_080E60EC: + movs r4, 0x50 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1E + bl sub_80DD3D4 +_080E60FC: + ldr r0, =0x02039f34 + ldr r1, [r0] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + strh r4, [r0, 0x2] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E6068 + + thumb_func_start ContestEffectFunc_080E611C +ContestEffectFunc_080E611C: @ 80E611C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r2, =0x02039f34 + ldr r0, [r2] + ldr r3, [r0, 0x8] + ldrb r0, [r3, 0x11] + adds r0, r3, r0 + movs r1, 0 + ldrsb r1, [r0, r1] + subs r0, r1, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + mov r8, r2 + cmp r1, 0 + beq _080E61F8 + mov r7, r8 + ldrb r6, [r3] +_080E6140: + movs r2, 0 + lsls r0, r4, 24 + asrs r1, r0, 24 + adds r5, r0, 0 + cmp r6, r1 + beq _080E616A + ldr r4, =0x02039f34 +_080E614E: + lsls r0, r2, 24 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r2, r0, 24 + asrs r3, r0, 24 + cmp r3, 0x3 + bgt _080E616A + ldr r0, [r4] + ldr r0, [r0, 0x8] + adds r0, r3 + ldrb r0, [r0] + cmp r0, r1 + bne _080E614E +_080E616A: + ldr r0, [r7] + lsls r3, r2, 24 + asrs r1, r3, 24 + ldr r2, [r0, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r2, r0, r2 + ldrb r1, [r2, 0xB] + movs r0, 0x80 + ands r0, r1 + mov r12, r3 + cmp r0, 0 + bne _080E6190 + ldrb r1, [r2, 0xC] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _080E61A4 +_080E6190: + movs r1, 0xFF + lsls r1, 24 + adds r0, r5, r1 + lsrs r4, r0, 24 + cmp r0, 0 + blt _080E61F8 + b _080E6140 + .pool +_080E61A4: + mov r2, r8 + ldr r6, [r2] + ldr r0, [r6, 0x8] + ldrb r1, [r0, 0x11] + ldr r4, [r6, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r5, r0, r4 + ldrh r0, [r5, 0x6] + ldr r3, =gContestMoves + lsls r0, 3 + adds r7, r0, r3 + ldrb r2, [r7, 0x1] + lsls r2, 29 + mov r0, r12 + asrs r1, r0, 24 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x6] + lsls r0, 3 + adds r0, r3 + ldrb r0, [r0, 0x1] + lsls r0, 29 + cmp r2, r0 + bne _080E61F8 + ldr r1, =gContestEffects + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x1] + lsls r0, 1 + ldrh r1, [r5, 0x2] + adds r0, r1 + strh r0, [r5, 0x2] + ldr r0, [r6, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1F + bl sub_80DD3D4 +_080E61F8: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E611C + + thumb_func_start ContestEffectFunc_080E620C +ContestEffectFunc_080E620C: @ 80E620C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =0x02039f34 + ldr r3, [r0] + ldr r1, [r3, 0x8] + ldrb r2, [r1, 0x11] + adds r1, r2 + ldrb r1, [r1] + mov r9, r0 + cmp r1, 0 + beq _080E62AC + ldr r1, [r3, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x6] + mov r8, r0 + movs r6, 0 + ldr r0, =gContestMoves + mov r12, r0 + movs r7, 0 +_080E623C: + mov r1, r9 + ldr r4, [r1] + ldr r0, [r4, 0x8] + ldrb r2, [r0, 0x11] + adds r1, r0, r2 + ldrb r1, [r1] + subs r1, 0x1 + adds r0, r6 + ldrb r0, [r0] + cmp r1, r0 + bne _080E62A4 + mov r1, r8 + lsls r0, r1, 3 + mov r1, r12 + adds r5, r0, r1 + ldrb r1, [r5, 0x1] + lsls r1, 29 + ldr r3, [r4, 0x4] + adds r0, r7, r3 + ldrh r0, [r0, 0x6] + lsls r0, 3 + add r0, r12 + ldrb r0, [r0, 0x1] + lsls r0, 29 + cmp r1, r0 + beq _080E62A4 + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r3 + ldr r2, =gContestEffects + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + lsls r0, 1 + ldrh r2, [r1, 0x2] + adds r0, r2 + strh r0, [r1, 0x2] + ldr r0, [r4, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x20 + bl sub_80DD3D4 + b _080E62AC + .pool +_080E62A4: + adds r7, 0x1C + adds r6, 0x1 + cmp r6, 0x3 + ble _080E623C +_080E62AC: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end ContestEffectFunc_080E620C + + thumb_func_start ContestEffectFunc_080E62B8 +ContestEffectFunc_080E62B8: @ 80E62B8 + push {r4-r7,lr} + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x11] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080E632E + movs r5, 0 + movs r6, 0 +_080E62CE: + ldr r0, =0x02039f34 + ldr r4, [r0] + ldr r1, [r4, 0x8] + ldrb r2, [r1, 0x11] + adds r0, r1, r2 + ldrb r0, [r0] + subs r0, 0x1 + adds r1, r5 + ldrb r1, [r1] + cmp r0, r1 + bne _080E6326 + ldr r1, [r4, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r3, r0, r1 + adds r1, r6, r1 + movs r0, 0x2 + ldrsh r2, [r3, r0] + movs r7, 0x2 + ldrsh r0, [r1, r7] + cmp r2, r0 + ble _080E6314 + adds r0, r2, 0 + lsls r0, 1 + strh r0, [r3, 0x2] + ldr r0, [r4, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x21 + bl sub_80DD3D4 + b _080E6326 + .pool +_080E6314: + cmp r2, r0 + bge _080E6326 + movs r0, 0 + strh r0, [r3, 0x2] + ldr r0, [r4, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x22 + bl sub_80DD3D4 +_080E6326: + adds r6, 0x1C + adds r5, 0x1 + cmp r5, 0x3 + ble _080E62CE +_080E632E: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end ContestEffectFunc_080E62B8 + + thumb_func_start ContestEffectFunc_080E6334 +ContestEffectFunc_080E6334: @ 80E6334 + push {r4,lr} + ldr r4, =0x02039f34 + ldr r1, [r4] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r1, r0, r1 + ldrb r3, [r1, 0xD] + movs r0, 0xD + ldrsb r0, [r1, r0] + cmp r0, 0x1D + bgt _080E6388 + adds r0, r3, 0 + adds r0, 0xA + strb r0, [r1, 0xD] + ldr r1, [r4] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x10] + movs r1, 0x31 + negs r1, r1 + ands r1, r2 + movs r2, 0x10 + orrs r1, r2 + strb r1, [r0, 0x10] + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x23 + bl sub_80DD3D4 + b _080E6390 + .pool +_080E6388: + adds r0, r2, 0 + movs r1, 0x3A + bl sub_80DD3D4 +_080E6390: + pop {r4} + pop {r0} + bx r0 + thumb_func_end ContestEffectFunc_080E6334 + + thumb_func_start ContestEffectFunc_080E6398 +ContestEffectFunc_080E6398: @ 80E6398 + push {lr} + ldr r3, =0x02039f34 + ldr r1, [r3] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x11] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x11] + ldr r1, [r3] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0xD] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + beq _080E63DC + adds r0, r2, 0 + movs r1, 0x24 + bl sub_80DD3D4 + b _080E63E4 + .pool +_080E63DC: + adds r0, r2, 0 + movs r1, 0x3B + bl sub_80DD3D4 +_080E63E4: + pop {r0} + bx r0 + thumb_func_end ContestEffectFunc_080E6398 + + thumb_func_start ContestEffectFunc_080E63E8 +ContestEffectFunc_080E63E8: @ 80E63E8 + push {r4-r7,lr} + sub sp, 0x4 + ldr r0, =0x02039f34 + ldr r2, [r0] + ldr r1, [r2] + ldrb r1, [r1, 0x1] + mov r12, r0 + cmp r1, 0x4 + bne _080E63FC + b _080E6518 +_080E63FC: + movs r6, 0 + adds r4, r2, 0 +_080E6400: + lsls r1, r6, 24 + asrs r1, 24 + mov r0, sp + adds r3, r0, r1 + ldr r2, [r4, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x19] + strb r0, [r3] + adds r1, 0x1 + lsls r1, 24 + lsrs r6, r1, 24 + asrs r1, 24 + cmp r1, 0x3 + ble _080E6400 + mov r1, r12 + ldr r0, [r1] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + mov r2, sp + adds r1, r2, r0 + movs r0, 0xFF + strb r0, [r1] + movs r6, 0 + mov r3, r12 + ldr r7, [r3] +_080E6438: + movs r5, 0 +_080E643A: + lsls r0, r5, 24 + asrs r2, r0, 24 + ldr r0, [r7, 0x8] + ldrb r0, [r0, 0x11] + cmp r2, r0 + beq _080E6474 + lsls r0, r6, 24 + asrs r3, r0, 24 + mov r0, sp + adds r4, r0, r2 + ldrb r1, [r4] + cmp r3, r1 + bne _080E6474 + ldr r0, [r7, 0x4] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + lsls r0, r3, 24 + lsrs r0, 24 + ldrb r1, [r1, 0x19] + cmp r0, r1 + bne _080E6474 + adds r0, r3, 0x1 + strb r0, [r4] + b _080E6484 + .pool +_080E6474: + lsls r0, r5, 24 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r5, r0, 24 + asrs r0, 24 + cmp r0, 0x3 + ble _080E643A +_080E6484: + cmp r5, 0x4 + beq _080E6498 + lsls r0, r6, 24 + movs r3, 0x80 + lsls r3, 17 + adds r0, r3 + lsrs r6, r0, 24 + asrs r0, 24 + cmp r0, 0x3 + ble _080E6438 +_080E6498: + mov r4, r12 + ldr r1, [r4] + ldr r0, [r1, 0x8] + ldrb r0, [r0, 0x11] + mov r3, sp + adds r2, r3, r0 + movs r0, 0 + strb r0, [r2] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x10] + movs r1, 0x3F + ands r1, r2 + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0, 0x10] + movs r6, 0 + mov r3, r12 +_080E64C6: + ldr r0, [r3] + lsls r1, r6, 24 + asrs r1, 24 + ldr r2, [r0, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + mov r4, sp + adds r2, r4, r1 + ldrb r2, [r2] + strb r2, [r0, 0x19] + adds r1, 0x1 + lsls r1, 24 + lsrs r6, r1, 24 + asrs r1, 24 + cmp r1, 0x3 + ble _080E64C6 + mov r0, r12 + ldr r1, [r0] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x11] + movs r1, 0x4 + negs r1, r1 + ands r1, r2 + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0, 0x11] + mov r1, r12 + ldr r0, [r1] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x25 + bl sub_80DD3D4 +_080E6518: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end ContestEffectFunc_080E63E8 + + thumb_func_start ContestEffectFunc_080E6520 +ContestEffectFunc_080E6520: @ 80E6520 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + ldr r0, =0x02039f34 + ldr r2, [r0] + ldr r1, [r2] + ldrb r1, [r1, 0x1] + mov r12, r0 + cmp r1, 0x4 + bne _080E6538 + b _080E6658 +_080E6538: + movs r6, 0 + adds r4, r2, 0 +_080E653C: + lsls r1, r6, 24 + asrs r1, 24 + mov r0, sp + adds r3, r0, r1 + ldr r2, [r4, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x19] + strb r0, [r3] + adds r1, 0x1 + lsls r1, 24 + lsrs r6, r1, 24 + asrs r1, 24 + cmp r1, 0x3 + ble _080E653C + mov r1, r12 + ldr r0, [r1] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + mov r2, sp + adds r1, r2, r0 + movs r0, 0xFF + strb r0, [r1] + movs r6, 0x3 + mov r3, r12 + ldr r7, [r3] + movs r4, 0x1 + negs r4, r4 + mov r8, r4 +_080E657A: + movs r5, 0 +_080E657C: + lsls r0, r5, 24 + asrs r2, r0, 24 + ldr r0, [r7, 0x8] + ldrb r0, [r0, 0x11] + cmp r2, r0 + beq _080E65B4 + lsls r0, r6, 24 + asrs r3, r0, 24 + mov r0, sp + adds r4, r0, r2 + ldrb r1, [r4] + cmp r3, r1 + bne _080E65B4 + ldr r0, [r7, 0x4] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + lsls r0, r3, 24 + lsrs r0, 24 + ldrb r1, [r1, 0x19] + cmp r0, r1 + bne _080E65B4 + subs r0, r3, 0x1 + strb r0, [r4] + b _080E65C4 + .pool +_080E65B4: + lsls r0, r5, 24 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r5, r0, 24 + asrs r0, 24 + cmp r0, 0x3 + ble _080E657C +_080E65C4: + cmp r5, 0x4 + beq _080E65D8 + lsls r0, r6, 24 + movs r3, 0xFF + lsls r3, 24 + adds r0, r3 + lsrs r6, r0, 24 + asrs r0, 24 + cmp r0, r8 + bgt _080E657A +_080E65D8: + mov r4, r12 + ldr r1, [r4] + ldr r0, [r1, 0x8] + ldrb r0, [r0, 0x11] + mov r3, sp + adds r2, r3, r0 + movs r0, 0x3 + strb r0, [r2] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x10] + movs r1, 0x3F + ands r1, r2 + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0, 0x10] + movs r6, 0 + mov r3, r12 +_080E6606: + ldr r0, [r3] + lsls r1, r6, 24 + asrs r1, 24 + ldr r2, [r0, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + mov r4, sp + adds r2, r4, r1 + ldrb r2, [r2] + strb r2, [r0, 0x19] + adds r1, 0x1 + lsls r1, 24 + lsrs r6, r1, 24 + asrs r1, 24 + cmp r1, 0x3 + ble _080E6606 + mov r0, r12 + ldr r1, [r0] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x11] + movs r1, 0x4 + negs r1, r1 + ands r1, r2 + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0, 0x11] + mov r1, r12 + ldr r0, [r1] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x26 + bl sub_80DD3D4 +_080E6658: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end ContestEffectFunc_080E6520 + + thumb_func_start ContestEffectFunc_080E6664 +ContestEffectFunc_080E6664: @ 80E6664 + bx lr + thumb_func_end ContestEffectFunc_080E6664 + + thumb_func_start ContestEffectFunc_080E6668 +ContestEffectFunc_080E6668: @ 80E6668 + push {r4-r7,lr} + sub sp, 0x8 + ldr r0, =0x02039f34 + ldr r1, [r0] + ldr r0, [r1] + ldrb r0, [r0, 0x1] + cmp r0, 0x4 + beq _080E676C + movs r6, 0 + add r5, sp, 0x4 + adds r4, r1, 0 + adds r7, r5, 0 +_080E6680: + lsls r1, r6, 24 + asrs r1, 24 + mov r0, sp + adds r3, r0, r1 + ldr r2, [r4, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x19] + strb r0, [r3] + adds r0, r7, r1 + strb r6, [r0] + adds r1, 0x1 + lsls r1, 24 + lsrs r6, r1, 24 + asrs r1, 24 + cmp r1, 0x3 + ble _080E6680 + movs r6, 0 + adds r7, r5, 0 +_080E66AA: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + lsls r2, r6, 24 + asrs r2, 24 + movs r1, 0x4 + subs r1, r2 + bl __modsi3 + lsls r0, 24 + lsrs r4, r0, 24 + movs r1, 0 +_080E66C4: + lsls r0, r1, 24 + asrs r2, r0, 24 + adds r3, r7, r2 + ldrb r1, [r3] + adds r5, r0, 0 + cmp r1, 0xFF + beq _080E66EE + cmp r4, 0 + bne _080E66E8 + mov r1, sp + adds r0, r1, r2 + strb r6, [r0] + movs r0, 0xFF + strb r0, [r3] + b _080E66FC + .pool +_080E66E8: + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_080E66EE: + movs r1, 0x80 + lsls r1, 17 + adds r0, r5, r1 + lsrs r1, r0, 24 + asrs r0, 24 + cmp r0, 0x3 + ble _080E66C4 +_080E66FC: + lsls r0, r6, 24 + movs r6, 0x80 + lsls r6, 17 + adds r0, r6 + lsrs r6, r0, 24 + asrs r0, 24 + cmp r0, 0x3 + ble _080E66AA + movs r6, 0 + ldr r5, =0x02039f34 + adds r4, r5, 0 +_080E6712: + ldr r0, [r4] + lsls r3, r6, 24 + asrs r3, 24 + ldr r1, [r0, 0x4] + lsls r2, r3, 3 + subs r2, r3 + lsls r2, 2 + adds r1, r2, r1 + mov r6, sp + adds r0, r6, r3 + ldrb r0, [r0] + strb r0, [r1, 0x19] + ldr r0, [r4] + ldr r0, [r0, 0x4] + adds r2, r0 + ldrb r1, [r2, 0x10] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x10] + adds r3, 0x1 + lsls r3, 24 + lsrs r6, r3, 24 + asrs r3, 24 + cmp r3, 0x3 + ble _080E6712 + ldr r1, [r5] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x11] + movs r2, 0x3 + orrs r1, r2 + strb r1, [r0, 0x11] + ldr r0, [r5] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x27 + bl sub_80DD3D4 +_080E676C: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E6668 + + thumb_func_start ContestEffectFunc_080E6778 +ContestEffectFunc_080E6778: @ 80E6778 + push {lr} + ldr r3, =gContestMoves + ldr r0, =0x02039f34 + ldr r1, [r0] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r2, r0, r1 + ldrh r0, [r2, 0x6] + lsls r0, 3 + adds r0, r3 + ldrb r0, [r0, 0x1] + lsls r0, 29 + ldr r1, =0x02039f2c + lsrs r0, 29 + ldrh r1, [r1] + cmp r0, r1 + beq _080E67AA + ldrb r0, [r2, 0x11] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2, 0x11] +_080E67AA: + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E6778 + + thumb_func_start ContestEffectFunc_080E67BC +ContestEffectFunc_080E67BC: @ 80E67BC + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r0, 0 + mov r8, r0 + movs r4, 0 + ldr r5, =0x02039f34 + movs r6, 0 +_080E67CC: + ldr r3, [r5] + ldr r2, [r3, 0x8] + ldrb r0, [r2, 0x11] + adds r0, r2, r0 + adds r1, r2, r4 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bls _080E682E + ldr r0, [r3, 0x4] + adds r1, r6, r0 + movs r7, 0x2 + ldrsh r0, [r1, r7] + cmp r0, 0 + ble _080E6808 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r2, 0x4] + ldr r0, [r3, 0x8] + movs r1, 0x4 + ldrsh r0, [r0, r1] + bl sub_80E6BB4 + ldr r1, [r5] + ldr r1, [r1, 0x8] + strh r0, [r1, 0x4] + b _080E680C + .pool +_080E6808: + movs r0, 0xA + strh r0, [r2, 0x4] +_080E680C: + ldr r0, [r5] + ldr r0, [r0, 0x8] + strb r4, [r0, 0x8] + ldr r0, [r5] + ldr r1, [r0, 0x8] + movs r0, 0xFF + strb r0, [r1, 0x9] + bl sub_80E6A2C + lsls r0, 24 + cmp r0, 0 + beq _080E682E + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 +_080E682E: + adds r6, 0x1C + adds r4, 0x1 + cmp r4, 0x3 + ble _080E67CC + mov r7, r8 + cmp r7, 0 + bne _080E684A + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x36 + bl sub_80DD3F0 +_080E684A: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x30 + bl sub_80DD3D4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E67BC + + thumb_func_start ContestEffectFunc_080E6868 +ContestEffectFunc_080E6868: @ 80E6868 + push {r4,lr} + ldr r0, =0x02039f34 + ldr r1, [r0] + ldr r0, [r1] + ldrb r0, [r0, 0x13] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bne _080E688C + movs r4, 0xA + ldr r0, [r1, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1A + bl sub_80DD3D4 + b _080E68CE + .pool +_080E688C: + cmp r0, 0x1 + bne _080E689E + movs r4, 0x14 + ldr r0, [r1, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1B + bl sub_80DD3D4 + b _080E68CE +_080E689E: + cmp r0, 0x2 + bne _080E68B0 + movs r4, 0x1E + ldr r0, [r1, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1C + bl sub_80DD3D4 + b _080E68CE +_080E68B0: + cmp r0, 0x3 + bne _080E68C2 + movs r4, 0x32 + ldr r0, [r1, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1D + bl sub_80DD3D4 + b _080E68CE +_080E68C2: + movs r4, 0x3C + ldr r0, [r1, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x1E + bl sub_80DD3D4 +_080E68CE: + ldr r0, =0x02039f34 + ldr r1, [r0] + ldr r0, [r1, 0x8] + ldrb r2, [r0, 0x11] + ldr r1, [r1, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + strh r4, [r0, 0x2] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E6868 + + thumb_func_start ContestEffectFunc_080E68EC +ContestEffectFunc_080E68EC: @ 80E68EC + push {r4,lr} + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r2, [r0, 0x10] + ldrb r1, [r2, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080E692A + movs r0, 0x1 + orrs r0, r1 + strb r0, [r2, 0x1] + ldr r0, [r4] + ldr r3, [r0, 0x10] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x7 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3, 0x1] + movs r0, 0xF + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x1] + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x3D + bl sub_80DD3D4 +_080E692A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ContestEffectFunc_080E68EC + + thumb_func_start sub_80E6934 +sub_80E6934: @ 80E6934 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r7, 0 + movs r4, 0 + ldr r6, =0x02039f34 + ldr r0, =gContestMoves + mov r9, r0 + movs r5, 0 +_080E694E: + ldr r3, [r6] + ldr r2, [r3, 0x8] + ldrb r0, [r2, 0x11] + adds r0, r2, r0 + adds r1, r2, r4 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bls _080E699E + ldr r0, [r3, 0x4] + adds r0, r5, r0 + ldrh r0, [r0, 0x6] + lsls r0, 3 + add r0, r9 + ldrb r0, [r0, 0x1] + lsls r0, 29 + lsrs r0, 29 + cmp r8, r0 + bne _080E6980 + movs r0, 0x28 + b _080E6982 + .pool +_080E6980: + movs r0, 0xA +_080E6982: + strh r0, [r2, 0x4] + ldr r0, [r6] + ldr r0, [r0, 0x8] + strb r4, [r0, 0x8] + ldr r0, [r6] + ldr r1, [r0, 0x8] + movs r0, 0xFF + strb r0, [r1, 0x9] + bl sub_80E6A2C + lsls r0, 24 + cmp r0, 0 + beq _080E699E + adds r7, 0x1 +_080E699E: + adds r5, 0x1C + adds r4, 0x1 + cmp r4, 0x3 + ble _080E694E + cmp r7, 0 + bne _080E69B8 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x11] + movs r1, 0x36 + bl sub_80DD3F0 +_080E69B8: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E6934 + + thumb_func_start sub_80E69C8 +sub_80E69C8: @ 80E69C8 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =0x02039f34 + ldr r0, [r2] + ldr r0, [r0, 0x8] + adds r0, 0xD + adds r0, r3 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r2] + ldr r1, [r0, 0x4] + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r2, r0, r1 + ldrb r1, [r2, 0x10] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080E69FC + adds r0, r3, 0 + movs r1, 0x2D + b _080E6A22 + .pool +_080E69FC: + ldrb r0, [r2, 0x12] + cmp r0, 0 + bne _080E6A1A + ldrb r1, [r2, 0xB] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080E6A26 + ldrb r1, [r2, 0xC] + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + bne _080E6A26 + movs r0, 0x1 + b _080E6A28 +_080E6A1A: + subs r0, 0x1 + strb r0, [r2, 0x12] + adds r0, r3, 0 + movs r1, 0x2C +_080E6A22: + bl sub_80DD3D4 +_080E6A26: + movs r0, 0 +_080E6A28: + pop {r1} + bx r1 + thumb_func_end sub_80E69C8 + + thumb_func_start sub_80E6A2C +sub_80E6A2C: @ 80E6A2C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + mov r0, sp + movs r1, 0 + movs r2, 0x8 + bl memset + movs r7, 0 + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x8] + cmp r0, 0xFF + beq _080E6B10 + mov r8, r4 +_080E6A4E: + mov r1, r8 + ldr r0, [r1] + ldr r0, [r0, 0x8] + adds r0, 0x8 + adds r0, r7 + ldrb r5, [r0] + adds r6, r5, 0 + adds r0, r5, 0 + bl sub_80E69C8 + lsls r0, 24 + cmp r0, 0 + beq _080E6AFE + ldr r2, [r4] + ldr r1, [r2, 0x8] + ldrh r0, [r1, 0x4] + strh r0, [r1, 0x6] + ldr r1, [r2, 0x4] + lsls r0, r5, 3 + subs r0, r5 + lsls r4, r0, 2 + adds r1, r4, r1 + ldrb r1, [r1, 0x10] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080E6A8E + ldr r1, [r2, 0x8] + movs r2, 0x6 + ldrsh r0, [r1, r2] + lsls r0, 1 + strh r0, [r1, 0x6] +_080E6A8E: + mov r0, r8 + ldr r3, [r0] + ldr r0, [r3, 0x4] + adds r1, r4, r0 + ldrb r0, [r1, 0x10] + movs r4, 0x1 + ands r4, r0 + cmp r4, 0 + beq _080E6AB4 + ldr r1, [r3, 0x8] + movs r0, 0xA + strh r0, [r1, 0x6] + adds r0, r5, 0 + movs r1, 0x2F + bl sub_80DD3D4 + b _080E6AFE + .pool +_080E6AB4: + ldr r2, [r3, 0x8] + ldrb r1, [r1, 0xF] + ldrh r0, [r2, 0x6] + subs r0, r1 + strh r0, [r2, 0x6] + ldr r2, [r3, 0x8] + ldrh r1, [r2, 0x6] + movs r3, 0x6 + ldrsh r0, [r2, r3] + cmp r0, 0 + bgt _080E6AD6 + strh r4, [r2, 0x6] + adds r0, r5, 0 + movs r1, 0x2E + bl sub_80DD3D4 + b _080E6AFE +_080E6AD6: + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl sub_80E6B3C + mov r1, r8 + ldr r0, [r1] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x6] + adds r0, r6, 0 + bl sub_80DD40C + lsls r0, r6, 1 + mov r2, sp + adds r1, r2, r0 + mov r3, r8 + ldr r0, [r3] + ldr r0, [r0, 0x8] + ldrh r0, [r0, 0x6] + strh r0, [r1] +_080E6AFE: + adds r7, 0x1 + ldr r4, =0x02039f34 + ldr r0, [r4] + ldr r0, [r0, 0x8] + adds r0, 0x8 + adds r0, r7 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080E6A4E +_080E6B10: + movs r7, 0 + mov r1, sp +_080E6B14: + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _080E6B24 + movs r0, 0x1 + b _080E6B2E + .pool +_080E6B24: + adds r1, 0x2 + adds r7, 0x1 + cmp r7, 0x3 + ble _080E6B14 + movs r0, 0 +_080E6B2E: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80E6A2C + + thumb_func_start sub_80E6B3C +sub_80E6B3C: @ 80E6B3C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x02039f34 + ldr r4, [r2] + ldr r3, [r4, 0x4] + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 2 + adds r3, r2, r3 + ldrh r0, [r3, 0x2] + subs r0, r1 + strh r0, [r3, 0x2] + ldr r0, [r4, 0x4] + adds r2, r0 + ldrb r0, [r2, 0xE] + adds r1, r0 + strb r1, [r2, 0xE] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E6B3C + + thumb_func_start sub_80E6B70 +sub_80E6B70: @ 80E6B70 + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + cmp r4, 0 + bge _080E6B80 + negs r0, r4 +_080E6B80: + movs r1, 0xA + bl __modsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r4, 0 + bge _080E6B9E + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + beq _080E6BA8 + adds r0, r4, 0 + subs r0, 0xA + adds r0, r1, r0 + b _080E6BA4 +_080E6B9E: + lsls r0, 16 + asrs r0, 16 + subs r0, r4, r0 +_080E6BA4: + lsls r0, 16 + lsrs r5, r0, 16 +_080E6BA8: + lsls r0, r5, 16 + asrs r0, 16 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80E6B70 + + thumb_func_start sub_80E6BB4 +sub_80E6BB4: @ 80E6BB4 + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + cmp r4, 0 + bge _080E6BC4 + negs r0, r4 +_080E6BC4: + movs r1, 0xA + bl __modsi3 + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + beq _080E6BDC + adds r0, r4, 0 + adds r0, 0xA + subs r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 +_080E6BDC: + lsls r0, r5, 16 + asrs r0, 16 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80E6BB4 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/contest_link_80F57C4.s b/asm/contest_link_80F57C4.s new file mode 100644 index 000000000..9620ec2ab --- /dev/null +++ b/asm/contest_link_80F57C4.s @@ -0,0 +1,5650 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80F57C4 +sub_80F57C4: @ 80F57C4 + push {r4,lr} + movs r0, 0 + movs r1, 0x40 + bl SetGpuReg + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0858D888 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + movs r4, 0 +_080F57E0: + lsls r0, r4, 24 + lsrs r0, 24 + ldr r1, =0x0203a034 + ldr r1, [r1] + lsls r2, r4, 2 + adds r1, 0xC + adds r1, r2 + ldr r1, [r1] + bl SetBgTilemapBuffer + adds r4, 0x1 + cmp r4, 0x3 + ble _080F57E0 + ldr r0, =gUnknown_0858D898 + bl InitWindows + bl DeactivateAllTextPrinters + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + ldr r1, =0x00003f2e + movs r0, 0x4A + 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, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + movs r0, 0x10 + movs r1, 0 + bl SetGpuReg + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + movs r0, 0x16 + movs r1, 0 + bl SetGpuReg + movs r0, 0x18 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg + movs r0, 0x1C + movs r1, 0 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0 + bl SetGpuReg + movs r1, 0xFF + lsls r1, 8 + movs r0, 0 + bl SetGpuRegBits + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r0, =0x02022e18 + strh r1, [r0] + ldr r0, =0x02022e1a + strh r1, [r0] + ldr r0, =0x02022e1c + strh r1, [r0] + ldr r0, =0x02022e1e + strh r1, [r0] + ldr r0, =0x02022e20 + strh r1, [r0] + ldr r0, =0x02022e22 + strh r1, [r0] + ldr r0, =0x02022e24 + strh r1, [r0] + ldr r0, =0x02022e26 + strh r1, [r0] + ldr r0, =0x02022e28 + strh r1, [r0] + ldr r0, =0x02022e2a + strh r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F57C4 + + thumb_func_start sub_80F591C +sub_80F591C: @ 80F591C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + ldr r0, =gUnknown_08C19588 + movs r1, 0xC0 + lsls r1, 19 + bl LZDecompressVram + ldr r1, =gUnknown_08C1A12C + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + ldr r1, =gUnknown_08C1A000 + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + ldr r1, =gUnknown_08C19EEC + movs r0, 0 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + bl sub_80F71C8 + ldr r0, =gUnknown_08C1A2B4 + movs r2, 0x80 + lsls r2, 2 + movs r1, 0 + bl decompress_palette + ldr r0, =gUnknown_0858D6B0 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r7, 0 + movs r0, 0x1 + mov r8, r0 +_080F5976: + lsls r5, r7, 24 + lsrs r5, 24 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80F7310 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80F7364 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + movs r6, 0 + lsls r1, r7, 1 + adds r2, r7, 0x1 + str r2, [sp, 0xC] + lsls r4, 24 + asrs r4, 24 + mov r10, r4 + adds r1, r7 + adds r0, r1, 0x6 + lsls r0, 24 + mov r9, r0 + adds r1, 0x5 + lsls r7, r1, 24 +_080F59B0: + ldr r1, =0x000060b2 + cmp r6, r10 + bge _080F59B8 + adds r1, 0x2 +_080F59B8: + ldr r4, [sp, 0x8] + lsls r0, r4, 24 + asrs r0, 24 + adds r2, r0, 0 + cmp r0, 0 + bge _080F59C6 + negs r2, r0 +_080F59C6: + cmp r6, r2 + bge _080F59F4 + ldr r5, =0x000060a4 + cmp r0, 0 + bge _080F59F6 + adds r5, 0x2 + b _080F59F6 + .pool +_080F59F4: + ldr r5, =0x000060a2 +_080F59F6: + adds r4, r6, 0 + adds r4, 0x13 + lsls r4, 24 + lsrs r4, 24 + mov r0, r8 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x1 + adds r2, r4, 0 + lsrs r3, r7, 24 + bl FillBgTilemapBufferRect_Palette0 + mov r2, r8 + str r2, [sp] + str r2, [sp, 0x4] + movs r0, 0x1 + adds r1, r5, 0 + adds r2, r4, 0 + mov r4, r9 + lsrs r3, r4, 24 + bl FillBgTilemapBufferRect_Palette0 + adds r6, 0x1 + cmp r6, 0x9 + ble _080F59B0 + ldr r7, [sp, 0xC] + cmp r7, 0x3 + ble _080F5976 + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + 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_80F591C + + thumb_func_start sub_80F5A74 +sub_80F5A74: @ 80F5A74 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + lsls r1, r5, 6 + ldr r0, =0x02039e00 + adds r7, r1, r0 + ldr r6, =0x02022e2c + ldr r0, =0x02039f25 + ldrb r0, [r0] + cmp r5, r0 + bne _080F5A96 + ldr r1, =gUnknown_085ED21E + adds r0, r6, 0 + bl CopyString + adds r6, r0, 0 +_080F5A96: + adds r1, r7, 0x2 + adds r0, r6, 0 + bl CopyString + ldr r4, =0x02022e2c + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_80F7ED0 + ldr r1, =gUnknown_085E8D3E + adds r0, r6, 0 + bl CopyString + adds r1, r7, 0 + adds r1, 0xD + adds r0, r6, 0 + bl AppendString + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x32 + bl sub_80F7ED0 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F5A74 + + thumb_func_start sub_80F5AE0 +sub_80F5AE0: @ 80F5AE0 + push {r4,lr} + movs r4, 0 +_080F5AE4: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80F5A74 + adds r4, 0x1 + cmp r4, 0x3 + ble _080F5AE4 + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80F5AE0 + + thumb_func_start sub_80F5B00 +sub_80F5B00: @ 80F5B00 + push {r4-r6,lr} + sub sp, 0x4 + ldr r5, =0x02037fd4 + ldrb r0, [r5, 0x8] + movs r6, 0x80 + orrs r0, r6 + strb r0, [r5, 0x8] + movs r0, 0 + bl SetVBlankCallback + bl sub_80F7DF4 + bl sub_80F57C4 + bl dp12_8087EA4 + bl sub_80A1A74 + bl ResetAllObjectData + bl ResetTasks + bl ResetObjectPaletteAllocator + bl sub_80F591C + bl sub_80F6A9C + movs r0, 0 + movs r1, 0x1 + bl sub_80F6A64 + bl sub_80F5AE0 + ldr r4, =0x0203a034 + ldr r0, [r4] + ldr r0, [r0] + movs r1, 0 + movs r2, 0x18 + bl memset + ldr r0, [r4] + ldr r0, [r0, 0x4] + movs r1, 0 + movs r2, 0x50 + bl memset + bl sub_80F6DC0 + bl sub_80F6AE8 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldrb r1, [r5, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r5, 0x8] + ldr r0, =sub_80F5CE4 + movs r1, 0x5 + bl CreateTask + ldr r1, [r4] + ldr r1, [r1] + strb r0, [r1, 0x2] + ldr r0, =sub_80F5C00 + bl SetMainCallback2 + ldr r1, =0x02022e28 + movs r0, 0xF0 + strh r0, [r1] + ldr r1, =0x02022e2a + ldr r2, =0x000080a0 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, =sub_80F68B4 + movs r1, 0x14 + bl CreateTask + bl sub_80F7880 + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080F5BE4 + ldrb r0, [r5, 0x8] + orrs r0, r6 + strb r0, [r5, 0x8] + b _080F5BEC + .pool +_080F5BE4: + movs r0, 0xDF + lsls r0, 1 + bl song_play_for_text +_080F5BEC: + ldr r0, =sub_80F5C24 + bl SetVBlankCallback + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F5B00 + + thumb_func_start sub_80F5C00 +sub_80F5C00: @ 80F5C00 + push {lr} + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTasks + bl fade_and_return_progress_probably + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + pop {r0} + bx r0 + thumb_func_end sub_80F5C00 + + thumb_func_start sub_80F5C24 +sub_80F5C24: @ 80F5C24 + push {lr} + ldr r0, =0x02022e14 + ldrh r1, [r0] + movs r0, 0x10 + bl SetGpuReg + ldr r0, =0x02022e16 + ldrh r1, [r0] + movs r0, 0x12 + bl SetGpuReg + ldr r0, =0x02022e18 + ldrh r1, [r0] + movs r0, 0x14 + bl SetGpuReg + ldr r0, =0x02022e1a + ldrh r1, [r0] + movs r0, 0x16 + bl SetGpuReg + ldr r0, =0x02022e1c + ldrh r1, [r0] + movs r0, 0x18 + bl SetGpuReg + ldr r0, =0x02022e1e + ldrh r1, [r0] + movs r0, 0x1A + bl SetGpuReg + ldr r0, =0x02022e20 + ldrh r1, [r0] + movs r0, 0x1C + bl SetGpuReg + ldr r0, =0x02022e22 + ldrh r1, [r0] + movs r0, 0x1E + bl SetGpuReg + ldr r0, =0x02022e24 + ldrh r1, [r0] + movs r0, 0x40 + bl SetGpuReg + ldr r0, =0x02022e26 + ldrh r1, [r0] + movs r0, 0x44 + bl SetGpuReg + ldr r0, =0x02022e28 + ldrh r1, [r0] + movs r0, 0x42 + bl SetGpuReg + ldr r0, =0x02022e2a + ldrh r1, [r0] + movs r0, 0x46 + bl SetGpuReg + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + bl sub_80BA0A8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F5C24 + + thumb_func_start sub_80F5CE4 +sub_80F5CE4: @ 80F5CE4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r3, =0x02039f2a + ldrb r1, [r3] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080F5CF8 + b _080F5E2E +_080F5CF8: + ldr r2, =0x03005e00 + lsls r1, r6, 2 + adds r0, r1, r6 + lsls r0, 3 + adds r4, r0, r2 + movs r2, 0x8 + ldrsh r0, [r4, r2] + adds r7, r1, 0 + cmp r0, 0x1 + beq _080F5DE0 + cmp r0, 0x1 + bgt _080F5D20 + cmp r0, 0 + beq _080F5D2A + b _080F5E2E + .pool +_080F5D20: + cmp r0, 0x2 + beq _080F5DF4 + cmp r0, 0x3 + beq _080F5E0A + b _080F5E2E +_080F5D2A: + bl sub_80DBED4 + ldr r1, =0x02039f20 + ldr r0, =0x02039f25 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080F5D58 + movs r0, 0x23 + bl sav12_xor_increment + ldr r1, =0x020375e2 + movs r0, 0x8 + strh r0, [r1] + bl InterviewBefore + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0x1 + beq _080F5D58 + bl InterviewAfter +_080F5D58: + movs r0, 0x2 + bl sub_813BADC + ldr r0, =0x02039f2e + ldrb r0, [r0] + bl sub_80DEDA8 + movs r0, 0xFE + bl sub_80DEDA8 + ldr r1, =0x02039f5c + movs r0, 0x1 + strb r0, [r1] + movs r0, 0xFE + movs r1, 0 + bl sub_80DEFA8 + ldr r1, =0x02039f5d + strb r0, [r1] + ldr r5, =0x00004086 + adds r0, r5, 0 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0 + bl VarSet + bl sub_8076D5C + movs r0, 0x1 + bl save_game_when_memory_present + bl sav2_gender2_inplace_and_xFE + adds r0, r5, 0 + adds r1, r4, 0 + bl VarSet + ldr r0, =0x03005e00 + adds r1, r7, r6 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _080F5E2E + .pool +_080F5DE0: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldrb r1, [r3] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080F5E2E + movs r0, 0x64 + b _080F5E2C +_080F5DF4: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080F5EBA + bl sub_800ADF8 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080F5EBA +_080F5E0A: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080F5EBA + movs r0, 0xDF + lsls r0, 1 + bl song_play_for_text + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + ldrh r0, [r4, 0x8] + adds r0, 0x1 +_080F5E2C: + strh r0, [r4, 0x8] +_080F5E2E: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _080F5EBA + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + strh r2, [r4, 0x8] + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _080F5E78 + ldr r0, =gUnknown_085ED207 + bl sub_80F707C + ldr r0, =sub_80F5ED8 + b _080F5EB8 + .pool +_080F5E78: + movs r0, 0x24 + bl sav12_xor_increment + ldr r1, =0x02039f20 + ldr r0, =0x02039f25 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080F5E92 + movs r0, 0x25 + bl sav12_xor_increment +_080F5E92: + ldr r0, =0x02039f2e + ldrb r0, [r0] + bl sub_80DEDA8 + movs r0, 0xFE + bl sub_80DEDA8 + ldr r0, =0x02039f5c + strb r5, [r0] + movs r0, 0xFE + movs r1, 0 + bl sub_80DEFA8 + ldr r1, =0x02039f5d + strb r0, [r1] + movs r0, 0x2 + bl sub_813BADC + ldr r0, =sub_80F5F74 +_080F5EB8: + str r0, [r4] +_080F5EBA: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F5CE4 + + thumb_func_start sub_80F5ED8 +sub_80F5ED8: @ 80F5ED8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _080F5EFC + ldr r0, =sub_80F5F14 + movs r1, 0 + bl CreateTask + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =TaskDummy + str r1, [r0] +_080F5EFC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F5ED8 + + thumb_func_start sub_80F5F14 +sub_80F5F14: @ 80F5F14 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =sub_80FC998 + ldr r2, =sub_80F5F30 + bl SetTaskFuncWithFollowupFunc + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F5F14 + + thumb_func_start sub_80F5F30 +sub_80F5F30: @ 80F5F30 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080F5F60 + adds r0, r4, 0 + bl DestroyTask + ldr r2, =0x03005e00 + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0, 0x2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, =sub_80F5F74 + str r1, [r0] + bl sub_80F7144 +_080F5F60: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F5F30 + + thumb_func_start sub_80F5F74 +sub_80F5F74: @ 80F5F74 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r1, [r4, 0x8] + movs r2, 0x8 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _080F5FC4 + ldr r0, =sub_80F68F0 + movs r1, 0x14 + bl CreateTask + ldr r0, =gUnknown_085ED1B8 + ldr r1, =0x0203a034 + ldr r1, [r1] + ldr r1, [r1] + ldrb r1, [r1] + bl sub_80F6B78 + lsls r0, 16 + asrs r0, 16 + movs r3, 0x88 + lsls r3, 3 + movs r1, 0x90 + movs r2, 0x78 + b _080F6016 + .pool +_080F5FC4: + cmp r0, 0x1 + bne _080F5FDC + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _080F6048 + b _080F5FF0 + .pool +_080F5FDC: + cmp r0, 0x2 + bne _080F5FF8 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x15 + bne _080F6048 + movs r0, 0 +_080F5FF0: + strh r0, [r4, 0xA] + adds r0, r1, 0x1 + strh r0, [r4, 0x8] + b _080F6048 +_080F5FF8: + cmp r0, 0x3 + bne _080F6030 + ldr r0, =gUnknown_085ED1D0 + ldr r1, =0x0203a034 + ldr r1, [r1] + ldr r1, [r1] + ldrb r1, [r1] + bl sub_80F6B78 + lsls r0, 16 + asrs r0, 16 + ldr r2, =0x0000ffff + movs r3, 0x88 + lsls r3, 3 + movs r1, 0x90 +_080F6016: + bl sub_80F6E9C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080F6048 + .pool +_080F6030: + cmp r0, 0x4 + bne _080F6048 + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0x2 + bne _080F6048 + movs r0, 0 + strh r0, [r4, 0x8] + ldr r0, =sub_80F6058 + str r0, [r4] +_080F6048: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F5F74 + + thumb_func_start sub_80F6058 +sub_80F6058: @ 80F6058 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080F60C0 + cmp r0, 0x1 + bgt _080F6080 + cmp r0, 0 + beq _080F6086 + b _080F60E6 + .pool +_080F6080: + cmp r0, 0x2 + beq _080F60D4 + b _080F60E6 +_080F6086: + ldr r5, =0x0203a034 + ldr r0, [r5] + ldr r0, [r0] + ldrb r0, [r0, 0xA] + cmp r0, 0 + bne _080F60E6 + ldrh r1, [r4, 0xC] + adds r0, r1, 0x1 + strh r0, [r4, 0xC] + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_80F7A80 + ldr r0, [r5] + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _080F60B8 + movs r0, 0x2 + strh r0, [r4, 0x8] + b _080F60E6 + .pool +_080F60B8: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080F60E6 +_080F60C0: + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _080F60E6 + strh r0, [r4, 0x8] + b _080F60E6 + .pool +_080F60D4: + movs r0, 0x88 + lsls r0, 3 + bl sub_80F6EF4 + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0xC] + ldr r0, =sub_80F60F0 + str r0, [r4] +_080F60E6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F6058 + + thumb_func_start sub_80F60F0 +sub_80F60F0: @ 80F60F0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + adds r4, r2, 0 + ldr r0, =0x0203a034 + ldr r5, [r0] + ldr r0, [r5] + ldrb r3, [r0, 0x4] + cmp r3, 0 + bne _080F614C + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r1 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x15 + bne _080F615E + strh r3, [r1, 0xA] + ldr r0, =gUnknown_085ED1E9 + ldr r1, [r5] + ldrb r1, [r1] + bl sub_80F6B78 + lsls r0, 16 + asrs r0, 16 + ldr r2, =0x0000ffff + movs r3, 0x88 + lsls r3, 3 + movs r1, 0x90 + bl sub_80F6E9C + b _080F615E + .pool +_080F614C: + cmp r3, 0x2 + bne _080F615E + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80F616C + str r0, [r1] +_080F615E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F60F0 + + thumb_func_start sub_80F616C +sub_80F616C: @ 80F616C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080F61D4 + cmp r0, 0x1 + bgt _080F6194 + cmp r0, 0 + beq _080F619A + b _080F61F8 + .pool +_080F6194: + cmp r0, 0x2 + beq _080F61E8 + b _080F61F8 +_080F619A: + ldr r5, =0x0203a034 + ldr r0, [r5] + ldr r0, [r0] + ldrb r0, [r0, 0xA] + cmp r0, 0 + bne _080F61F8 + ldrh r1, [r4, 0xC] + adds r0, r1, 0x1 + strh r0, [r4, 0xC] + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1 + bl sub_80F7A80 + ldr r0, [r5] + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _080F61CC + movs r0, 0x2 + strh r0, [r4, 0x8] + b _080F61F8 + .pool +_080F61CC: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080F61F8 +_080F61D4: + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _080F61F8 + strh r0, [r4, 0x8] + b _080F61F8 + .pool +_080F61E8: + movs r0, 0x88 + lsls r0, 3 + bl sub_80F6EF4 + movs r0, 0 + strh r0, [r4, 0x8] + ldr r0, =sub_80F6204 + str r0, [r4] +_080F61F8: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F616C + + thumb_func_start sub_80F6204 +sub_80F6204: @ 80F6204 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x64 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x5 + bls _080F6226 + b _080F63F4 +_080F6226: + lsls r0, 2 + ldr r1, =_080F6238 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F6238: + .4byte _080F6250 + .4byte _080F6274 + .4byte _080F6292 + .4byte _080F62CC + .4byte _080F6334 + .4byte _080F63E4 +_080F6250: + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _080F625E + b _080F63F4 +_080F625E: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _080F63F4 + .pool +_080F6274: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r1, r0, r2 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + beq _080F628C + b _080F63F4 +_080F628C: + movs r0, 0 + strh r0, [r1, 0xA] + b _080F63BC +_080F6292: + movs r4, 0 + lsls r6, r5, 2 + ldr r7, =0x03005e00 +_080F6298: + ldr r0, =sub_80F73DC + movs r1, 0xA + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r7 + ldr r0, =0x02039f20 + adds r0, r4, r0 + ldrb r0, [r0] + strh r0, [r1, 0x8] + strh r4, [r1, 0xA] + adds r4, 0x1 + cmp r4, 0x3 + ble _080F6298 + b _080F63B4 + .pool +_080F62CC: + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x5] + cmp r0, 0x4 + beq _080F62DA + b _080F63F4 +_080F62DA: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + beq _080F62F2 + b _080F63F4 +_080F62F2: + movs r0, 0 + strh r0, [r4, 0xA] + ldr r0, =sub_80F74BC + movs r1, 0xA + bl CreateTask + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r4, 0 + ldr r1, =0x02039f20 + ldrb r0, [r1] + cmp r0, 0 + beq _080F631C +_080F630E: + adds r4, 0x1 + cmp r4, 0x3 + bgt _080F631C + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080F630E +_080F631C: + lsls r0, r4, 24 + lsrs r0, 24 + movs r1, 0xE + bl sub_80F77E0 + b _080F63F4 + .pool +_080F6334: + lsls r1, r5, 2 + adds r0, r1, r5 + lsls r0, 3 + adds r2, r0, r2 + ldrh r0, [r2, 0xA] + adds r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + adds r6, r1, 0 + cmp r0, 0x15 + bne _080F63F4 + movs r0, 0 + strh r0, [r2, 0xA] + movs r4, 0 + ldr r1, =0x02039f20 + ldrb r0, [r1] + ldr r7, =0x02021cc4 + ldr r2, =0x02039e0d + mov r8, r2 + cmp r0, 0 + beq _080F636E +_080F6360: + adds r4, 0x1 + cmp r4, 0x3 + bgt _080F636E + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080F6360 +_080F636E: + lsls r4, 6 + mov r0, r8 + adds r1, r4, r0 + adds r0, r7, 0 + bl CopyString + adds r0, r7, 0 + bl sub_81DB5AC + ldr r0, =0x02021dc4 + mov r1, r8 + subs r1, 0xB + adds r4, r1 + adds r1, r4, 0 + bl CopyString + ldr r1, =gUnknown_085ED1FA + mov r0, sp + bl ExpandStringRefs + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0] + mov r0, sp + bl sub_80F6B78 + lsls r0, 16 + asrs r0, 16 + ldr r2, =0x0000ffff + movs r3, 0x88 + lsls r3, 3 + movs r1, 0x90 + bl sub_80F6E9C +_080F63B4: + ldr r0, =0x03005e00 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 +_080F63BC: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _080F63F4 + .pool +_080F63E4: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0 + strh r1, [r0, 0x8] + ldr r1, =sub_80F6404 + str r1, [r0] +_080F63F4: + add sp, 0x64 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F6204 + + thumb_func_start sub_80F6404 +sub_80F6404: @ 80F6404 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r4, r1, 0 + cmp r0, 0x5 + bls _080F6428 + b _080F669C +_080F6428: + lsls r0, 2 + ldr r1, =_080F643C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F643C: + .4byte _080F6454 + .4byte _080F658C + .4byte _080F65DC + .4byte _080F65F0 + .4byte _080F6638 + .4byte _080F667C +_080F6454: + ldr r1, =0x02022e24 + movs r0, 0xF0 + strh r0, [r1] + ldr r1, =0x02022e26 + ldr r3, =0x00005050 + adds r0, r3, 0 + strh r0, [r1] + movs r2, 0 + ldr r1, =0x02039f20 + ldrb r0, [r1] + lsls r4, r7, 2 + mov r10, r4 + ldr r3, =0x02039e00 + ldr r4, =0x02039f25 + mov r9, r4 + ldr r4, =gMonFrontPicTable + mov r12, r4 + ldr r4, =0x020244d4 + mov r8, r4 + cmp r0, 0 + beq _080F648C +_080F647E: + adds r2, 0x1 + cmp r2, 0x3 + bgt _080F648C + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080F647E +_080F648C: + lsls r1, r2, 6 + adds r0, r1, r3 + ldrh r6, [r0] + adds r0, r3, 0 + adds r0, 0x38 + adds r0, r1, r0 + ldr r4, [r0] + adds r0, r3, 0 + adds r0, 0x3C + adds r1, r0 + ldr r5, [r1] + mov r0, r9 + ldrb r0, [r0] + cmp r2, r0 + bne _080F64E0 + lsls r0, r6, 3 + add r0, r12 + mov r2, r8 + ldr r1, [r2] + ldr r1, [r1, 0x8] + adds r2, r6, 0 + adds r3, r4, 0 + bl DecompressMonPic_DetectFrontOrBack_2 + b _080F64F2 + .pool +_080F64E0: + lsls r0, r6, 3 + add r0, r12 + mov r3, r8 + ldr r1, [r3] + ldr r1, [r1, 0x8] + adds r2, r6, 0 + adds r3, r4, 0 + bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack +_080F64F2: + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_806E7CC + adds r4, r0, 0 + bl LoadCompressedObjectPalette + adds r0, r6, 0 + movs r1, 0x1 + bl sub_806A068 + ldr r0, =0x0202499c + ldrh r1, [r4, 0x4] + strh r1, [r0, 0x2] + movs r1, 0x88 + lsls r1, 1 + movs r2, 0x50 + movs r3, 0xA + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r5, =0x02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r3, r2, r5 + strh r6, [r3, 0x30] + ldrb r4, [r3, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r4 + strb r1, [r3, 0x5] + adds r5, 0x1C + adds r2, r5 + ldr r1, =sub_80F75A8 + str r1, [r2] + ldr r1, =0x0203a034 + ldr r1, [r1] + ldr r1, [r1] + strb r0, [r1, 0x8] + ldr r0, =gUnknown_0858D878 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0858D880 + bl LoadCompressedObjectPalette + ldr r0, =sub_80F7670 + movs r1, 0xA + bl CreateTask + ldr r0, =0x03005e00 + mov r4, r10 + adds r1, r4, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _080F669C + .pool +_080F658C: + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r4, r0, r4 + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + beq _080F65A4 + b _080F669C +_080F65A4: + movs r0, 0 + strh r0, [r4, 0xE] + ldrh r0, [r4, 0xC] + adds r0, 0x2 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x20 + ble _080F65BA + movs r0, 0x20 + strh r0, [r4, 0xC] +_080F65BA: + ldrb r2, [r4, 0xC] + ldr r3, =0x02022e26 + movs r0, 0x50 + subs r0, r2 + lsls r0, 8 + adds r1, r2, 0 + adds r1, 0x50 + orrs r0, r1 + strh r0, [r3] + cmp r2, 0x20 + bne _080F669C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080F669C + .pool +_080F65DC: + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x6] + cmp r0, 0x1 + bne _080F669C + b _080F6664 + .pool +_080F65F0: + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r3, r0, r4 + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x79 + bne _080F669C + movs r0, 0 + strh r0, [r3, 0xA] + ldr r2, =0x02020630 + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r0, [r0] + ldrb r1, [r0, 0x8] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_80F7620 + str r1, [r0] + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] + b _080F669C + .pool +_080F6638: + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x6] + cmp r0, 0x2 + bne _080F669C + ldr r3, =0x02022e26 + ldrh r0, [r3] + lsrs r2, r0, 8 + adds r0, r2, 0x2 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x50 + bls _080F6656 + movs r2, 0x50 +_080F6656: + lsls r1, r2, 8 + movs r0, 0xA0 + subs r0, r2 + orrs r1, r0 + strh r1, [r3] + cmp r2, 0x50 + bne _080F669C +_080F6664: + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r4 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _080F669C + .pool +_080F667C: + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r2, [r0] + ldrb r0, [r2, 0x6] + cmp r0, 0x2 + bne _080F669C + movs r1, 0 + movs r0, 0x1 + strb r0, [r2, 0x9] + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r4 + strh r1, [r0, 0x8] + ldr r1, =sub_80F66B4 + str r1, [r0] +_080F669C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F6404 + + thumb_func_start sub_80F66B4 +sub_80F66B4: @ 80F66B4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _080F6702 + ldr r0, =0x02039f2a + ldrb r1, [r0] + adds r0, r2, 0 + ands r0, r1 + lsls r6, r7, 2 + cmp r0, 0 + bne _080F66F2 + ldr r5, =0x02039e00 + movs r4, 0x3 +_080F66DA: + ldrh r0, [r5] + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2 + bl pokedex_flag_operation + adds r5, 0x40 + subs r4, 0x1 + cmp r4, 0 + bge _080F66DA +_080F66F2: + ldr r1, =0x03005e00 + adds r0, r6, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x1C] + ldr r1, =sub_80F671C + str r1, [r0] +_080F6702: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F66B4 + + thumb_func_start sub_80F671C +sub_80F671C: @ 80F671C + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080F6760 + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r4, r1, r0 + movs r1, 0x1C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080F676E + ldr r0, =gUnknown_085ED207 + bl sub_80F707C + bl sub_800AC34 + ldr r0, =sub_80F677C + str r0, [r4] + b _080F676E + .pool +_080F6760: + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, =task_repel + str r0, [r1] +_080F676E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F671C + + thumb_func_start sub_80F677C +sub_80F677C: @ 80F677C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _080F67AC + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080F679A + bl sub_800E084 +_080F679A: + bl sub_80F7144 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =task_repel + str r0, [r1] +_080F67AC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F677C + + thumb_func_start task_repel +task_repel: @ 80F67C4 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080F67E6 + ldr r1, =0x02039f20 + ldr r0, =0x02039f25 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + bl sub_80ED090 +_080F67E6: + movs r0, 0 + str r0, [sp] + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A27B0 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80F6820 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task_repel + + thumb_func_start sub_80F6820 +sub_80F6820: @ 80F6820 + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + adds r5, r2, 0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080F68A8 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080F6868 + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x3] + bl DestroyTask + ldr r0, =0x0000ffff + b _080F686E + .pool +_080F6868: + cmp r0, 0x1 + bne _080F6884 + ldr r0, =0xffff0000 +_080F686E: + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + b _080F68A8 + .pool +_080F6884: + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + adds r0, r5, 0 + bl DestroyTask + bl FreeAllWindowBuffers + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + bl sub_80F7E64 +_080F68A8: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F6820 + + thumb_func_start sub_80F68B4 +sub_80F68B4: @ 80F68B4 + push {r4,r5,lr} + ldr r2, =0x02022e20 + ldrh r3, [r2] + adds r0, r3, 0x2 + strh r0, [r2] + ldr r4, =0x02022e22 + ldrh r5, [r4] + adds r1, r5, 0x1 + strh r1, [r4] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xFF + bls _080F68D4 + adds r0, r3, 0 + subs r0, 0xFD + strh r0, [r2] +_080F68D4: + lsls r0, r1, 16 + lsrs r0, 16 + cmp r0, 0xFF + bls _080F68E2 + adds r0, r5, 0 + subs r0, 0xFE + strh r0, [r4] +_080F68E2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F68B4 + + thumb_func_start sub_80F68F0 +sub_80F68F0: @ 80F68F0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r2, r0, r1 + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _080F6972 + movs r0, 0 + strh r0, [r2, 0x8] + movs r3, 0xC + ldrsh r0, [r2, r3] + cmp r0, 0 + bne _080F6924 + ldrh r0, [r2, 0xA] + adds r0, 0x1 + b _080F6928 + .pool +_080F6924: + ldrh r0, [r2, 0xA] + subs r0, 0x1 +_080F6928: + strh r0, [r2, 0xA] + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r1, r0, r1 + movs r2, 0xA + ldrsh r0, [r1, r2] + cmp r0, 0x10 + bne _080F693E + movs r0, 0x1 + b _080F6942 +_080F693E: + cmp r0, 0 + bne _080F6944 +_080F6942: + strh r0, [r1, 0xC] +_080F6944: + ldr r0, =0x03005e00 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + ldrb r2, [r4, 0xA] + ldr r3, =0x00002ede + movs r0, 0x6B + movs r1, 0x1 + bl pal_fade_1 + ldrb r2, [r4, 0xA] + ldr r3, =0x00007fff + movs r0, 0x68 + movs r1, 0x1 + bl pal_fade_1 + ldrb r2, [r4, 0xA] + ldr r3, =0x000077be + movs r0, 0x6E + movs r1, 0x1 + bl pal_fade_1 +_080F6972: + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r3, 0xA + ldrsh r4, [r0, r3] + cmp r4, 0 + bne _080F69A4 + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r0, [r0] + strb r4, [r0, 0xA] + b _080F69AE + .pool +_080F69A4: + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0xA] +_080F69AE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F68F0 + + thumb_func_start sub_80F69B8 +sub_80F69B8: @ 80F69B8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + lsls r0, 16 + lsrs r7, r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + mov r8, r4 + lsls r2, 24 + lsrs r5, r2, 24 + lsls r3, 24 + lsrs r6, r3, 24 + ldr r0, =0x02039f25 + movs r2, 0 + ldrb r0, [r0] + cmp r4, r0 + bne _080F69DE + movs r2, 0x1 +_080F69DE: + adds r0, r7, 0 + ldr r1, [sp, 0x28] + bl sub_80D2EDC + adds r3, r0, 0 + lsls r0, r5, 9 + adds r0, 0x80 + adds r3, r0 + cmp r6, 0 + beq _080F6A40 + lsls r1, r4, 9 + ldr r0, =0x06004000 + adds r1, r0 + movs r2, 0xC0 + lsls r2, 1 + adds r0, r3, 0 + movs r3, 0x1 + bl RequestDma3Copy + adds r0, r4, 0 + adds r0, 0xA + lsls r0, 28 + lsls r1, r4, 20 + movs r2, 0x80 + lsls r2, 18 + adds r1, r2 + orrs r1, r0 + lsrs r1, 16 + lsls r3, r4, 1 + adds r3, r4 + adds r3, 0x4 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x4 + str r0, [sp] + movs r0, 0x3 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + str r0, [sp, 0xC] + movs r2, 0x3 + bl WriteSequenceToBgTilemapBuffer + b _080F6A54 + .pool +_080F6A40: + mov r0, r8 + lsls r1, r0, 9 + ldr r2, =0x06004000 + adds r1, r2 + movs r2, 0xC0 + lsls r2, 1 + adds r0, r3, 0 + movs r3, 0x1 + bl RequestDma3Copy +_080F6A54: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F69B8 + + thumb_func_start sub_80F6A64 +sub_80F6A64: @ 80F6A64 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + movs r5, 0 + ldr r4, =0x02039e00 +_080F6A74: + ldrh r0, [r4] + lsls r1, r5, 24 + lsrs r1, 24 + ldr r2, [r4, 0x38] + str r2, [sp] + adds r2, r7, 0 + adds r3, r6, 0 + bl sub_80F69B8 + adds r4, 0x40 + adds r5, 0x1 + cmp r5, 0x3 + ble _080F6A74 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F6A64 + + thumb_func_start sub_80F6A9C +sub_80F6A9C: @ 80F6A9C + push {r4-r6,lr} + movs r4, 0 + ldr r6, =gMonIconPaletteIndices + movs r5, 0xA0 + lsls r5, 16 +_080F6AA6: + ldr r1, =0x02039e00 + lsls r0, r4, 6 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0 + bl mon_icon_convert_unown_species_id + lsls r0, 16 + lsrs r0, 16 + adds r0, r6 + ldrb r0, [r0] + lsls r0, 5 + ldr r1, =gMonIconPalettes + adds r0, r1 + lsrs r1, r5, 16 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0x80 + lsls r0, 13 + adds r5, r0 + adds r4, 0x1 + cmp r4, 0x3 + ble _080F6AA6 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F6A9C + + thumb_func_start sub_80F6AE8 +sub_80F6AE8: @ 80F6AE8 + push {r4,lr} + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080F6B58 + bl sub_800E0E8 + movs r0, 0x8 + movs r1, 0x8 + bl sub_800DFB4 + ldr r4, =0x02020630 + ldr r0, =0x02022b10 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x43 + movs r1, 0x1 + strb r1, [r0] + ldr r0, =gUnknown_0858D8E0 + bl LoadObjectPic + adds r1, r0, 0 + lsls r1, 16 + movs r0, 0x1 + negs r0, r0 + lsrs r1, 11 + ldr r2, =0x06010000 + adds r1, r2 + movs r2, 0x80 + movs r3, 0x1 + bl RequestDma3Fill + ldr r0, =gUnknown_0858D8C8 + movs r1, 0x8 + movs r2, 0x8 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r1, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1, 0x1] +_080F6B58: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F6AE8 + + thumb_func_start sub_80F6B78 +sub_80F6B78: @ 80F6B78 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x44 + adds r5, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + add r4, sp, 0x20 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x8 + bl memset + movs r0, 0x1E + strb r0, [r4, 0x3] + movs r0, 0x2 + strb r0, [r4, 0x4] + adds r0, r4, 0 + bl AddWindow + lsls r6, r0, 24 + lsrs r4, r6, 24 + adds r0, r4, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0 + bl GetStringWidth + adds r2, r0, 0 + adds r2, 0x9 + cmp r2, 0 + bge _080F6BC4 + adds r2, 0x7 +_080F6BC4: + asrs r2, 3 + mov r10, r2 + cmp r2, 0x1E + ble _080F6BD0 + movs r1, 0x1E + mov r10, r1 +_080F6BD0: + mov r1, r10 + lsls r2, r1, 3 + subs r2, r0 + lsrs r0, r2, 31 + adds r2, r0 + asrs r2, 1 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_0858D8E8 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + str r5, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + adds r0, r4, 0 + movs r1, 0x7 + bl GetWindowAttribute + mov r9, r0 + ldr r2, =gUnknown_0858D6D0 + mov r8, r2 + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + ldr r3, =0x02020630 + adds r1, r3 + ldrh r0, [r1, 0x4] + lsls r0, 22 + lsrs r0, 17 + ldr r2, =0x06010000 + adds r0, r2 + str r0, [sp, 0xC] + str r6, [sp, 0x38] + mov r7, sp + adds r7, 0x1C + str r7, [sp, 0x2C] + mov r0, r10 + adds r0, 0x2 + str r0, [sp, 0x30] + movs r5, 0 + add r7, sp, 0x10 + mov r12, r7 + adds r6, r1, 0 + adds r6, 0x2E + movs r4, 0x2 +_080F6C34: + adds r0, r6, r5 + movs r7, 0 + ldrsh r1, [r0, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x4] + lsls r0, 22 + lsrs r0, 17 + adds r0, r2 + mov r1, r12 + adds r1, 0x4 + mov r12, r1 + subs r1, 0x4 + stm r1!, {r0} + adds r5, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _080F6C34 + mov r7, r8 + adds r7, 0x80 + mov r2, r8 + adds r2, 0x40 + str r2, [sp, 0x28] + mov r0, r8 + adds r0, 0x20 + str r0, [sp, 0x3C] + mov r1, r8 + adds r1, 0xA0 + str r1, [sp, 0x40] + adds r2, 0x20 + str r2, [sp, 0x34] + add r5, sp, 0xC + movs r6, 0 + movs r4, 0x3 +_080F6C7C: + str r6, [sp, 0x1C] + ldm r5!, {r1} + ldr r0, [sp, 0x2C] + ldr r2, =0x05000100 + bl CpuSet + subs r4, 0x1 + cmp r4, 0 + bge _080F6C7C + ldr r5, [sp, 0xC] + ldr r6, =0x04000008 + mov r0, r8 + adds r1, r5, 0 + adds r2, r6, 0 + bl CpuSet + movs r0, 0x80 + lsls r0, 1 + adds r1, r5, r0 + adds r0, r7, 0 + adds r2, r6, 0 + bl CpuSet + movs r2, 0x80 + lsls r2, 2 + adds r1, r5, r2 + adds r0, r7, 0 + adds r2, r6, 0 + bl CpuSet + movs r7, 0xC0 + lsls r7, 2 + adds r1, r5, r7 + ldr r0, [sp, 0x28] + adds r2, r6, 0 + bl CpuSet + movs r4, 0 + cmp r4, r10 + bge _080F6D32 + adds r7, r6, 0 +_080F6CCE: + adds r6, r4, 0x1 + adds r0, r6, 0 + cmp r6, 0 + bge _080F6CDA + adds r0, r4, 0 + adds r0, 0x8 +_080F6CDA: + asrs r0, 3 + lsls r1, r0, 2 + add r1, sp + adds r1, 0xC + lsls r0, 3 + subs r0, r6, r0 + lsls r0, 5 + ldr r1, [r1] + adds r5, r1, r0 + mov r0, r8 + adds r0, 0xC0 + adds r1, r5, 0 + adds r2, r7, 0 + bl CpuSet + movs r0, 0x80 + lsls r0, 1 + adds r1, r5, r0 + mov r0, r9 + adds r2, r7, 0 + bl CpuSet + movs r0, 0xF0 + lsls r0, 2 + add r0, r9 + movs r2, 0x80 + lsls r2, 2 + adds r1, r5, r2 + adds r2, r7, 0 + bl CpuSet + movs r0, 0xC0 + lsls r0, 2 + adds r1, r5, r0 + mov r0, r8 + adds r0, 0xE0 + adds r2, r7, 0 + bl CpuSet + movs r1, 0x20 + add r9, r1 + adds r4, r6, 0 + cmp r4, r10 + blt _080F6CCE +_080F6D32: + adds r2, r4, 0x1 + adds r0, r2, 0 + cmp r2, 0 + bge _080F6D3E + adds r0, r4, 0 + adds r0, 0x8 +_080F6D3E: + asrs r0, 3 + lsls r1, r0, 2 + add r1, sp + adds r1, 0xC + lsls r0, 3 + subs r0, r2, r0 + lsls r0, 5 + ldr r1, [r1] + adds r5, r1, r0 + ldr r4, =0x04000008 + ldr r0, [sp, 0x3C] + adds r1, r5, 0 + adds r2, r4, 0 + bl CpuSet + movs r2, 0x80 + lsls r2, 1 + adds r1, r5, r2 + ldr r0, [sp, 0x40] + adds r2, r4, 0 + bl CpuSet + movs r7, 0x80 + lsls r7, 2 + adds r1, r5, r7 + ldr r0, [sp, 0x40] + adds r2, r4, 0 + bl CpuSet + movs r0, 0xC0 + lsls r0, 2 + adds r1, r5, r0 + ldr r0, [sp, 0x34] + adds r2, r4, 0 + bl CpuSet + ldr r1, [sp, 0x38] + lsrs r0, r1, 24 + bl RemoveWindow + ldr r2, [sp, 0x30] + lsls r1, r2, 3 + movs r0, 0xF0 + subs r0, r1 + asrs r0, 1 + add sp, 0x44 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80F6B78 + + thumb_func_start sub_80F6DC0 +sub_80F6DC0: @ 80F6DC0 + push {r4-r6,lr} + sub sp, 0x20 + mov r1, sp + ldr r0, =gUnknown_0858D7F8 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + add r5, sp, 0x18 + ldr r6, =gUnknown_0858D810 + movs r4, 0x7 +_080F6DD6: + adds r0, r6, 0 + bl LoadObjectPic + adds r6, 0x8 + subs r4, 0x1 + cmp r4, 0 + bge _080F6DD6 + ldr r0, =gUnknown_0858D850 + bl LoadTaggedObjectPalette + movs r4, 0 + mov r6, sp +_080F6DEE: + mov r0, sp + movs r1, 0x88 + lsls r1, 1 + movs r2, 0x90 + movs r3, 0xA + bl AddObjectToFront + adds r1, r5, r4 + strb r0, [r1] + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] + adds r4, 0x1 + cmp r4, 0x7 + ble _080F6DEE + ldr r2, =0x02020630 + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r5, 0x1] + movs r3, 0 + strh r1, [r0, 0x2E] + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r5, 0x2] + strh r1, [r0, 0x30] + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r5, 0x3] + strh r1, [r0, 0x32] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r5, 0x5] + strh r1, [r0, 0x2E] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r5, 0x6] + strh r1, [r0, 0x30] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r5, 0x7] + strh r1, [r0, 0x32] + ldr r1, =0x0203a034 + ldr r0, [r1] + ldr r2, [r0] + ldrb r0, [r5] + strb r0, [r2] + ldr r0, [r1] + ldr r0, [r0] + strb r3, [r0, 0x4] + ldr r0, [r1] + ldr r1, [r0] + ldrb r0, [r5, 0x4] + strb r0, [r1, 0x1] + bl sub_80F7144 + add sp, 0x20 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F6DC0 + + thumb_func_start sub_80F6E9C +sub_80F6E9C: @ 80F6E9C + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r4, =0x0203a034 + ldr r4, [r4] + mov r8, r4 + ldr r4, [r4] + ldrb r5, [r4] + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + ldr r5, =0x02020630 + adds r4, r5 + movs r6, 0 + movs r5, 0x88 + lsls r5, 1 + strh r5, [r4, 0x20] + strh r1, [r4, 0x22] + strh r6, [r4, 0x24] + strh r6, [r4, 0x26] + lsls r0, 16 + asrs r0, 16 + adds r0, 0x20 + strh r0, [r4, 0x36] + strh r2, [r4, 0x38] + strh r3, [r4, 0x3A] + strh r6, [r4, 0x3C] + ldr r0, =sub_80F6F68 + str r0, [r4, 0x1C] + mov r0, r8 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x4] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F6E9C + + thumb_func_start sub_80F6EF4 +sub_80F6EF4: @ 80F6EF4 + push {r4,r5,lr} + ldr r1, =0x0203a034 + ldr r4, [r1] + ldr r1, [r4] + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + ldr r2, =0x02020630 + adds r1, r2 + ldrh r2, [r1, 0x24] + ldrh r3, [r1, 0x20] + adds r2, r3 + movs r3, 0 + strh r2, [r1, 0x20] + ldrh r2, [r1, 0x26] + ldrh r5, [r1, 0x22] + adds r2, r5 + strh r2, [r1, 0x22] + strh r3, [r1, 0x26] + strh r3, [r1, 0x24] + strh r0, [r1, 0x3A] + strh r3, [r1, 0x3C] + ldr r0, =sub_80F7014 + str r0, [r1, 0x1C] + ldr r1, [r4] + movs r0, 0x3 + strb r0, [r1, 0x4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F6EF4 + + thumb_func_start sub_80F6F40 +sub_80F6F40: @ 80F6F40 + movs r3, 0 + movs r2, 0 + movs r1, 0x88 + lsls r1, 1 + strh r1, [r0, 0x20] + movs r1, 0x90 + strh r1, [r0, 0x22] + strh r2, [r0, 0x26] + strh r2, [r0, 0x24] + ldr r1, =DummyObjectCallback + str r1, [r0, 0x1C] + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r0, [r0] + strb r3, [r0, 0x4] + bx lr + .pool + thumb_func_end sub_80F6F40 + + thumb_func_start sub_80F6F68 +sub_80F6F68: @ 80F6F68 + push {r4-r7,lr} + adds r3, r0, 0 + ldrh r2, [r3, 0x3A] + ldrh r0, [r3, 0x3C] + adds r2, r0 + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r3, 0x20] + subs r0, r1 + strh r0, [r3, 0x20] + movs r1, 0xFF + ands r2, r1 + strh r2, [r3, 0x3C] + lsls r0, 16 + asrs r0, 16 + ldrh r2, [r3, 0x36] + movs r4, 0x36 + ldrsh r1, [r3, r4] + cmp r0, r1 + bge _080F6F92 + strh r2, [r3, 0x20] +_080F6F92: + movs r4, 0 + ldr r6, =0x02020630 + movs r5, 0x40 + adds r2, r3, 0 + adds r2, 0x2E +_080F6F9C: + movs r7, 0 + ldrsh r0, [r2, r7] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r0, [r3, 0x24] + ldrh r7, [r3, 0x20] + adds r0, r7 + adds r0, r5 + strh r0, [r1, 0x20] + adds r5, 0x40 + adds r2, 0x2 + adds r4, 0x1 + cmp r4, 0x2 + ble _080F6F9C + movs r0, 0x20 + ldrsh r1, [r3, r0] + movs r2, 0x36 + ldrsh r0, [r3, r2] + cmp r1, r0 + bne _080F6FCC + ldr r0, =sub_80F6FDC + str r0, [r3, 0x1C] +_080F6FCC: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F6F68 + + thumb_func_start sub_80F6FDC +sub_80F6FDC: @ 80F6FDC + push {lr} + adds r2, r0, 0 + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r1, [r0] + movs r0, 0x2 + strb r0, [r1, 0x4] + ldrh r3, [r2, 0x38] + ldr r1, =0xffff0000 + lsrs r0, r1, 16 + cmp r3, r0 + beq _080F7008 + subs r0, r3, 0x1 + strh r0, [r2, 0x38] + lsls r0, 16 + asrs r0, 16 + asrs r1, 16 + cmp r0, r1 + bne _080F7008 + ldrh r0, [r2, 0x3A] + bl sub_80F6EF4 +_080F7008: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F6FDC + + thumb_func_start sub_80F7014 +sub_80F7014: @ 80F7014 + push {r4-r7,lr} + adds r3, r0, 0 + ldrh r2, [r3, 0x3A] + ldrh r0, [r3, 0x3C] + adds r2, r0 + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r3, 0x20] + subs r0, r1 + strh r0, [r3, 0x20] + movs r0, 0xFF + ands r2, r0 + strh r2, [r3, 0x3C] + movs r4, 0 + ldr r6, =0x02020630 + movs r5, 0x40 + adds r2, r3, 0 + adds r2, 0x2E +_080F7038: + movs r1, 0 + ldrsh r0, [r2, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r0, [r3, 0x24] + ldrh r7, [r3, 0x20] + adds r0, r7 + adds r0, r5 + strh r0, [r1, 0x20] + adds r5, 0x40 + adds r2, 0x2 + adds r4, 0x1 + cmp r4, 0x2 + ble _080F7038 + movs r1, 0x20 + ldrsh r0, [r3, r1] + movs r2, 0x24 + ldrsh r1, [r3, r2] + adds r0, r1 + movs r1, 0xE0 + negs r1, r1 + cmp r0, r1 + bge _080F7070 + adds r0, r3, 0 + bl sub_80F6F40 +_080F7070: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F7014 + + thumb_func_start sub_80F707C +sub_80F707C: @ 80F707C + push {r4-r7,lr} + ldr r4, =0x0203a034 + ldr r1, [r4] + ldr r1, [r1] + ldrb r1, [r1, 0x1] + bl sub_80F6B78 + lsls r0, 16 + lsrs r0, 16 + ldr r1, [r4] + ldr r1, [r1] + ldrb r2, [r1, 0x1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + ldr r3, =0x02020630 + adds r4, r1, r3 + adds r0, 0x20 + strh r0, [r4, 0x20] + movs r0, 0x50 + strh r0, [r4, 0x22] + adds r5, r4, 0 + adds r5, 0x3E + ldrb r1, [r5] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r1 + strb r0, [r5] + movs r5, 0 + adds r6, r3, 0 + mov r12, r2 + movs r3, 0x40 +_080F70BE: + lsls r0, r5, 1 + adds r2, r4, 0 + adds r2, 0x2E + adds r2, r0 + movs r1, 0 + ldrsh r0, [r2, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r0, [r4, 0x24] + ldrh r7, [r4, 0x20] + adds r0, r7 + adds r0, r3 + strh r0, [r1, 0x20] + movs r0, 0 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrh r1, [r4, 0x22] + strh r1, [r0, 0x22] + movs r1, 0 + ldrsh r0, [r2, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + adds r1, 0x3E + ldrb r2, [r1] + mov r0, r12 + ands r0, r2 + strb r0, [r1] + adds r3, 0x40 + adds r5, 0x1 + cmp r5, 0x2 + ble _080F70BE + ldr r1, =0x02022e24 + movs r0, 0xF0 + strh r0, [r1] + ldr r2, =0x02022e26 + ldrh r1, [r4, 0x22] + adds r0, r1, 0 + subs r0, 0x10 + lsls r0, 8 + adds r1, 0x10 + orrs r0, r1 + strh r0, [r2] + ldr r1, =0x00003f3e + movs r0, 0x48 + bl SetGpuReg + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F707C + + thumb_func_start sub_80F7144 +sub_80F7144: @ 80F7144 + push {r4-r7,lr} + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x1] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r3, =0x02020630 + adds r2, r3 + movs r0, 0x3E + adds r0, r2 + mov r12, r0 + ldrb r0, [r0] + movs r1, 0x4 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + ldr r7, =0x02022e24 + ldr r6, =0x02022e26 + adds r5, r3, 0 + movs r4, 0x4 + adds r2, 0x2E + movs r3, 0x2 +_080F7174: + movs r1, 0 + ldrsh r0, [r2, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r0, [r1] + orrs r0, r4 + strb r0, [r1] + adds r2, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _080F7174 + movs r0, 0 + strh r0, [r7] + strh r0, [r6] + movs r0, 0x40 + movs r1, 0 + bl SetGpuReg + ldrh r1, [r6] + movs r0, 0x44 + bl SetGpuReg + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F7144 + + thumb_func_start sub_80F71C8 +sub_80F71C8: @ 80F71C8 + push {r4-r6,lr} + sub sp, 0xC + movs r5, 0x5 + movs r4, 0x1 + ldr r0, =0x02039f2a + ldrb r1, [r0] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _080F71F8 + ldr r1, =gUnknown_08DC6498 + str r5, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r2, 0x5 + movs r3, 0x1 + bl CopyToBgTilemapBufferRect + movs r5, 0xA + b _080F7240 + .pool +_080F71F8: + ldr r0, =0x02039f2e + ldrh r2, [r0] + cmp r2, 0 + bne _080F720C + ldr r1, =gUnknown_08DC63F8 + b _080F722E + .pool +_080F720C: + cmp r2, 0x1 + bne _080F7218 + ldr r1, =gUnknown_08DC6420 + b _080F722E + .pool +_080F7218: + cmp r2, 0x2 + bne _080F722C + ldr r1, =gUnknown_08DC6448 + movs r0, 0xA + str r0, [sp] + str r2, [sp, 0x4] + movs r0, 0x2 + b _080F7236 + .pool +_080F722C: + ldr r1, =gUnknown_08DC6470 +_080F722E: + movs r0, 0xA + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] +_080F7236: + movs r2, 0x5 + movs r3, 0x1 + bl CopyToBgTilemapBufferRect + movs r5, 0xF +_080F7240: + ldr r0, =0x02039f2c + ldrh r0, [r0] + cmp r0, 0 + bne _080F725C + movs r6, 0 + ldr r1, =gUnknown_08DC64AC + b _080F7298 + .pool +_080F725C: + cmp r0, 0x1 + bne _080F726C + movs r6, 0x1 + ldr r1, =gUnknown_08DC64C0 + b _080F7298 + .pool +_080F726C: + cmp r0, 0x2 + bne _080F7290 + movs r6, 0x2 + ldr r1, =gUnknown_08DC64D4 + lsls r2, r5, 24 + lsrs r2, 24 + lsls r4, 24 + lsrs r3, r4, 24 + movs r0, 0x5 + str r0, [sp] + str r6, [sp, 0x4] + movs r0, 0x2 + bl CopyToBgTilemapBufferRect + b _080F72CC + .pool +_080F7290: + cmp r0, 0x3 + bne _080F72B4 + movs r6, 0x3 + ldr r1, =gUnknown_08DC64E8 +_080F7298: + lsls r2, r5, 24 + lsrs r2, 24 + lsls r4, 24 + lsrs r3, r4, 24 + movs r0, 0x5 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + bl CopyToBgTilemapBufferRect + b _080F72CC + .pool +_080F72B4: + movs r6, 0x4 + ldr r1, =gUnknown_08DC64FC + lsls r2, r5, 24 + lsrs r2, 24 + lsls r4, 24 + lsrs r3, r4, 24 + movs r0, 0x5 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + bl CopyToBgTilemapBufferRect +_080F72CC: + adds r5, 0x5 + ldr r1, =gUnknown_08DC6510 + lsls r2, r5, 24 + lsrs r2, 24 + lsrs r3, r4, 24 + movs r0, 0x6 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + bl CopyToBgTilemapBufferRect + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r1, [r0, 0x14] + movs r0, 0x20 + str r0, [sp] + movs r0, 0x4 + str r0, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBufferRect_ChangePalette + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F71C8 + + thumb_func_start sub_80F7310 +sub_80F7310: @ 80F7310 + push {r4,r5,lr} + lsls r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r1, =0x02039f00 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + lsls r4, r0, 16 + adds r0, r4, 0 + movs r1, 0x3F + bl __udivsi3 + adds r1, r0, 0 + ldr r0, =0x0000ffff + ands r0, r1 + cmp r0, 0 + beq _080F733C + movs r0, 0x80 + lsls r0, 9 + adds r1, r0 +_080F733C: + lsrs r1, 16 + cmp r1, 0 + bne _080F7348 + cmp r4, 0 + beq _080F7348 + movs r1, 0x1 +_080F7348: + cmp r5, 0 + beq _080F7352 + cmp r1, 0xA + bls _080F7352 + movs r1, 0xA +_080F7352: + lsls r0, r1, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80F7310 + + thumb_func_start sub_80F7364 +sub_80F7364: @ 80F7364 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + ldr r1, =0x02039f18 + lsls r0, r5, 1 + adds r0, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r7, r1, 0 + cmp r0, 0 + bge _080F7380 + negs r0, r0 +_080F7380: + lsls r4, r0, 16 + adds r0, r4, 0 + movs r1, 0x50 + bl __udivsi3 + adds r2, r0, 0 + ldr r0, =0x0000ffff + ands r0, r2 + cmp r0, 0 + beq _080F739A + movs r0, 0x80 + lsls r0, 9 + adds r2, r0 +_080F739A: + lsrs r2, 16 + cmp r2, 0 + bne _080F73A6 + cmp r4, 0 + beq _080F73A6 + movs r2, 0x1 +_080F73A6: + cmp r6, 0 + beq _080F73B0 + cmp r2, 0xA + bls _080F73B0 + movs r2, 0xA +_080F73B0: + lsls r0, r5, 1 + adds r0, r7 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _080F73CC + negs r0, r2 + lsls r0, 24 + b _080F73CE + .pool +_080F73CC: + lsls r0, r2, 24 +_080F73CE: + lsrs r0, 24 + lsls r0, 24 + asrs r0, 24 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80F7364 + + thumb_func_start sub_80F73DC +sub_80F73DC: @ 80F73DC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =0x03005e00 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r7, r0, r1 + ldrh r2, [r7, 0x1C] + movs r0, 0x1C + ldrsh r6, [r7, r0] + cmp r6, 0 + bne _080F741C + movs r1, 0x8 + ldrsh r0, [r7, r1] + movs r1, 0x3 + subs r1, r0 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + strh r0, [r7, 0x1E] + adds r0, r2, 0x1 + strh r0, [r7, 0x1C] + b _080F74A4 + .pool +_080F741C: + cmp r6, 0x1 + bne _080F74A4 + ldrh r0, [r7, 0x1E] + subs r0, 0x1 + strh r0, [r7, 0x1E] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _080F74A4 + movs r2, 0x8 + ldrsh r4, [r7, r2] + lsls r4, 17 + ldr r0, =0x50430000 + adds r4, r0 + lsrs r4, 16 + movs r1, 0xA + ldrsh r0, [r7, r1] + lsls r3, r0, 1 + adds r3, r0 + adds r3, 0x5 + lsls r3, 24 + lsrs r3, 24 + movs r2, 0x2 + mov r9, r2 + str r2, [sp] + str r6, [sp, 0x4] + movs r5, 0x11 + str r5, [sp, 0x8] + str r6, [sp, 0xC] + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0x1 + bl WriteSequenceToBgTilemapBuffer + adds r4, 0x10 + lsls r4, 16 + lsrs r4, 16 + movs r1, 0xA + ldrsh r0, [r7, r1] + lsls r3, r0, 1 + adds r3, r0 + adds r3, 0x6 + lsls r3, 24 + lsrs r3, 24 + mov r2, r9 + str r2, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + str r6, [sp, 0xC] + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0x1 + bl WriteSequenceToBgTilemapBuffer + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r1, [r0] + ldrb r0, [r1, 0x5] + adds r0, 0x1 + strb r0, [r1, 0x5] + mov r0, r8 + bl DestroyTask + movs r0, 0x18 + bl audio_play +_080F74A4: + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F73DC + + thumb_func_start sub_80F74BC +sub_80F74BC: @ 80F74BC + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r1, =0x02039f20 + ldrb r0, [r1] + ldr r6, =0x0203a034 + cmp r0, 0 + beq _080F74DE +_080F74D0: + adds r4, 0x1 + cmp r4, 0x3 + bgt _080F74DE + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080F74D0 +_080F74DE: + ldr r1, [r6] + lsls r3, r4, 1 + adds r3, r4 + lsls r0, r3, 6 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2 + ldr r1, [r1, 0x14] + adds r1, r0 + adds r3, 0x4 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x20 + str r0, [sp] + movs r0, 0x3 + str r0, [sp, 0x4] + movs r0, 0x9 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r2, 0 + bl CopyToBgTilemapBufferRect_ChangePalette + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0x1C] + movs r1, 0x1 + strh r1, [r0, 0x20] + ldr r1, =sub_80F753C + str r1, [r0] + ldr r0, [r6] + ldr r0, [r0] + strb r5, [r0, 0x3] + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F74BC + + thumb_func_start sub_80F753C +sub_80F753C: @ 80F753C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + strh r0, [r4, 0x1E] + lsls r0, 16 + asrs r5, r0, 16 + cmp r5, 0x1 + bne _080F75A0 + movs r0, 0 + strh r0, [r4, 0x1E] + ldrh r2, [r4, 0x20] + lsls r2, 24 + lsrs r2, 24 + ldr r3, =0x00006f8d + movs r0, 0x91 + movs r1, 0x1 + bl pal_fade_1 + movs r1, 0x22 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080F7590 + ldrh r0, [r4, 0x20] + adds r0, 0x1 + strh r0, [r4, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + bne _080F75A0 + strh r5, [r4, 0x22] + b _080F75A0 + .pool +_080F7590: + ldrh r0, [r4, 0x20] + subs r0, 0x1 + strh r0, [r4, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bne _080F75A0 + strh r0, [r4, 0x22] +_080F75A0: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80F753C + + thumb_func_start sub_80F75A8 +sub_80F75A8: @ 80F75A8 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0x9 + bgt _080F75D0 + adds r0, r1, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _080F7610 + ldrh r0, [r4, 0x30] + movs r1, 0 + bl cry_related + movs r0, 0 + strh r0, [r4, 0x30] + b _080F7610 +_080F75D0: + movs r0, 0xC0 + lsls r0, 3 + adds r2, r0, 0 + ldrh r1, [r4, 0x30] + adds r2, r1 + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r4, 0x20] + subs r0, r1 + strh r0, [r4, 0x20] + movs r1, 0xFF + ands r2, r1 + strh r2, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x77 + bgt _080F75F6 + movs r0, 0x78 + strh r0, [r4, 0x20] +_080F75F6: + movs r2, 0x20 + ldrsh r0, [r4, r2] + cmp r0, 0x78 + bne _080F7610 + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x30] + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x6] +_080F7610: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F75A8 + + thumb_func_start sub_80F7620 +sub_80F7620: @ 80F7620 + push {lr} + adds r3, r0, 0 + movs r0, 0xC0 + lsls r0, 3 + adds r2, r0, 0 + ldrh r0, [r3, 0x30] + adds r2, r0 + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r3, 0x20] + subs r0, r1 + strh r0, [r3, 0x20] + movs r1, 0xFF + ands r2, r1 + strh r2, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bge _080F7664 + ldr r0, =DummyObjectCallback + str r0, [r3, 0x1C] + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r1, [r0] + movs r0, 0x2 + strb r0, [r1, 0x6] +_080F7664: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F7620 + + thumb_func_start sub_80F7670 +sub_80F7670: @ 80F7670 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r1, r0, r1 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _080F7732 + movs r0, 0 + strh r0, [r1, 0x8] + ldr r0, =0x0203a034 + mov r8, r0 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x7] + cmp r0, 0x27 + bhi _080F7732 + ldr r4, =gUnknown_0858D860 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF0 + bl __umodsi3 + adds r1, r0, 0 + subs r1, 0x14 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + movs r2, 0x2C + movs r3, 0x5 + bl AddObjectToFront + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl GenerateRandomNumber + ldr r1, =0x02020630 + lsls r5, r4, 4 + adds r5, r4 + lsls r5, 2 + adds r5, r1 + lsls r0, 23 + lsrs r0, 23 + strh r0, [r5, 0x2E] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x18 + bl __umodsi3 + adds r0, 0x10 + strh r0, [r5, 0x30] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xFF + ands r0, r1 + adds r0, 0x30 + strh r0, [r5, 0x32] + bl GenerateRandomNumber + ldrh r6, [r5, 0x4] + lsls r4, r6, 22 + lsrs r4, 22 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x11 + bl __umodsi3 + adds r4, r0 + ldr r1, =0x000003ff + adds r0, r1, 0 + ands r4, r0 + ldr r0, =0xfffffc00 + ands r0, r6 + orrs r0, r4 + strh r0, [r5, 0x4] + mov r1, r8 + ldr r0, [r1] + ldr r1, [r0] + ldrb r0, [r1, 0x7] + adds r0, 0x1 + strb r0, [r1, 0x7] +_080F7732: + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r0, [r0] + ldrb r0, [r0, 0x9] + cmp r0, 0 + beq _080F7744 + adds r0, r7, 0 + bl DestroyTask +_080F7744: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F7670 + + thumb_func_start sub_80F7768 +sub_80F7768: @ 80F7768 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + ldrh r1, [r4, 0x34] + adds r0, r1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 24 + movs r2, 0x30 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + ldrh r1, [r4, 0x32] + ldrh r0, [r4, 0x36] + adds r1, r0 + lsls r0, r1, 16 + asrs r0, 24 + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + movs r0, 0xFF + ands r1, r0 + strh r1, [r4, 0x36] + ldrh r0, [r4, 0x22] + adds r0, 0x1 + strh r0, [r4, 0x22] + ldr r5, =0x0203a034 + ldr r0, [r5] + ldr r0, [r0] + ldrb r0, [r0, 0x9] + cmp r0, 0 + beq _080F77B6 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_080F77B6: + movs r1, 0x20 + ldrsh r0, [r4, r1] + cmp r0, 0xF8 + bgt _080F77C6 + movs r2, 0x22 + ldrsh r0, [r4, r2] + cmp r0, 0x74 + ble _080F77D6 +_080F77C6: + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + ldr r0, [r5] + ldr r1, [r0] + ldrb r0, [r1, 0x7] + subs r0, 0x1 + strb r0, [r1, 0x7] +_080F77D6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F7768 + + thumb_func_start sub_80F77E0 +sub_80F77E0: @ 80F77E0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =sub_80F7824 + movs r1, 0x8 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + strh r5, [r1, 0xA] + ldr r0, =0x02039e00 + lsls r4, 6 + adds r4, r0 + ldrh r0, [r4] + strh r0, [r1, 0xC] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F77E0 + + thumb_func_start sub_80F7824 +sub_80F7824: @ 80F7824 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrb r5, [r4, 0x8] + ldrh r0, [r4, 0x1C] + adds r1, r0, 0x1 + strh r1, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + movs r2, 0xA + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _080F786E + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r0, [r4, 0xC] + ldrb r2, [r4, 0x1E] + ldr r1, =0x02039e00 + lsls r3, r5, 6 + adds r1, 0x38 + adds r3, r1 + ldr r1, [r3] + str r1, [sp] + adds r1, r5, 0 + movs r3, 0 + bl sub_80F69B8 + ldrh r0, [r4, 0x1E] + movs r1, 0x1 + eors r0, r1 + strh r0, [r4, 0x1E] +_080F786E: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F7824 + + thumb_func_start sub_80F7880 +sub_80F7880: @ 80F7880 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r0, =0x02039f08 + ldrh r2, [r0] + adds r4, r0, 0 + adds r3, r4, 0x2 + movs r0, 0x2 + mov r8, r0 +_080F7898: + lsls r0, r2, 16 + asrs r0, 16 + movs r5, 0 + ldrsh r1, [r3, r5] + cmp r0, r1 + bge _080F78A6 + ldrh r2, [r3] +_080F78A6: + adds r3, 0x2 + movs r0, 0x1 + negs r0, r0 + add r8, r0 + mov r1, r8 + cmp r1, 0 + bge _080F7898 + lsls r0, r2, 16 + str r0, [sp] + cmp r0, 0 + bge _080F78E4 + ldrh r2, [r4] + adds r3, r4, 0x2 + movs r4, 0x2 + mov r8, r4 +_080F78C4: + lsls r0, r2, 16 + asrs r0, 16 + movs r5, 0 + ldrsh r1, [r3, r5] + cmp r0, r1 + ble _080F78D2 + ldrh r2, [r3] +_080F78D2: + adds r3, 0x2 + movs r0, 0x1 + negs r0, r0 + add r8, r0 + lsls r1, r2, 16 + str r1, [sp] + mov r4, r8 + cmp r4, 0 + bge _080F78C4 +_080F78E4: + movs r5, 0 + mov r8, r5 + mov r10, r5 +_080F78EA: + ldr r0, =0x02039f00 + mov r1, r8 + lsls r7, r1, 1 + adds r0, r7, r0 + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r0, r1, 5 + subs r0, r1 + lsls r0, 2 + adds r0, r1 + lsls r0, 3 + ldr r4, [sp] + asrs r5, r4, 16 + adds r1, r5, 0 + cmp r5, 0 + bge _080F790C + negs r1, r5 +_080F790C: + bl __divsi3 + adds r4, r0, 0 + movs r1, 0xA + bl __modsi3 + cmp r0, 0x4 + ble _080F791E + adds r4, 0xA +_080F791E: + ldr r0, =0x0203a034 + mov r9, r0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + mov r1, r10 + adds r6, r1, r0 + adds r0, r4, 0 + movs r1, 0xA + bl __divsi3 + str r0, [r6] + ldr r0, =0x02039f18 + adds r7, r0 + movs r2, 0 + ldrsh r1, [r7, r2] + cmp r1, 0 + bge _080F7942 + negs r1, r1 +_080F7942: + lsls r0, r1, 5 + subs r0, r1 + lsls r0, 2 + adds r0, r1 + lsls r0, 3 + adds r1, r5, 0 + cmp r1, 0 + bge _080F7954 + negs r1, r1 +_080F7954: + bl __divsi3 + adds r4, r0, 0 + movs r1, 0xA + bl __modsi3 + cmp r0, 0x4 + ble _080F7966 + adds r4, 0xA +_080F7966: + adds r0, r4, 0 + movs r1, 0xA + bl __divsi3 + str r0, [r6, 0x4] + movs r4, 0 + ldrsh r0, [r7, r4] + cmp r0, 0 + bge _080F797C + movs r0, 0x1 + strb r0, [r6, 0x10] +_080F797C: + mov r5, r9 + ldr r0, [r5] + ldr r0, [r0, 0x4] + mov r1, r10 + adds r4, r1, r0 + ldr r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + subs r0, r1 + lsls r0, 11 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + movs r5, 0xFF + ands r0, r5 + cmp r0, 0x7F + bls _080F79A8 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2 +_080F79A8: + lsrs r0, r1, 8 + str r0, [r4, 0x8] + ldr r1, [r4, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + subs r0, r1 + lsls r0, 11 + movs r1, 0x64 + bl __divsi3 + adds r1, r0, 0 + ands r0, r5 + cmp r0, 0x7F + bls _080F79CC + movs r5, 0x80 + lsls r5, 1 + adds r1, r5 +_080F79CC: + lsrs r0, r1, 8 + str r0, [r4, 0xC] + mov r0, r8 + lsls r4, r0, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80F7310 + mov r2, r9 + ldr r1, [r2] + ldr r1, [r1, 0x4] + add r1, r10 + strb r0, [r1, 0x11] + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80F7364 + mov r4, r9 + ldr r1, [r4] + ldr r1, [r1, 0x4] + add r1, r10 + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bge _080F7A02 + negs r0, r0 +_080F7A02: + strb r0, [r1, 0x12] + ldr r0, =0x02039f20 + add r0, r8 + ldrb r0, [r0] + cmp r0, 0 + beq _080F7A60 + mov r5, r9 + ldr r0, [r5] + ldr r0, [r0, 0x4] + mov r2, r10 + adds r1, r2, r0 + ldr r5, [r1, 0x8] + ldrh r3, [r1, 0x8] + ldr r4, [r1, 0xC] + ldrh r2, [r1, 0xC] + ldrb r0, [r1, 0x10] + cmp r0, 0 + beq _080F7A2C + lsls r0, r2, 16 + negs r0, r0 + lsrs r2, r0, 16 +_080F7A2C: + lsls r0, r3, 16 + asrs r3, r0, 16 + lsls r0, r2, 16 + asrs r2, r0, 16 + adds r0, r3, r2 + cmp r0, 0x58 + bne _080F7A60 + cmp r2, 0 + ble _080F7A58 + subs r0, r4, 0x1 + str r0, [r1, 0xC] + b _080F7A60 + .pool +_080F7A58: + cmp r3, 0 + ble _080F7A60 + subs r0, r5, 0x1 + str r0, [r1, 0x8] +_080F7A60: + movs r4, 0x14 + add r10, r4 + movs r5, 0x1 + add r8, r5 + mov r0, r8 + cmp r0, 0x3 + bgt _080F7A70 + b _080F78EA +_080F7A70: + 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_80F7880 + + thumb_func_start sub_80F7A80 +sub_80F7A80: @ 80F7A80 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + movs r1, 0 + str r1, [sp, 0x8] + movs r3, 0 + str r3, [sp, 0xC] + cmp r0, 0 + bne _080F7B5C + mov r9, r3 + ldr r4, =0x0203a034 + mov r10, r4 + movs r7, 0xA0 + lsls r7, 19 + movs r6, 0 +_080F7AAC: + mov r1, r10 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r0, r6, r0 + ldrb r2, [r0, 0x11] + cmp r8, r2 + bcs _080F7B2E + adds r2, 0x13 + mov r3, r8 + subs r2, r3 + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + lsrs r3, r7, 24 + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + ldr r1, =0x000060b3 + bl FillBgTilemapBufferRect_Palette0 + ldr r0, =sub_80F7CA8 + movs r1, 0xA + bl CreateTask + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, r10 + ldr r4, [r0] + ldr r1, [r4, 0x4] + adds r1, r6, r1 + ldr r0, [r1, 0x8] + lsls r0, 16 + ldrb r1, [r1, 0x11] + bl __udivsi3 + mov r1, r8 + adds r1, 0x1 + adds r3, r0, 0 + muls r3, r1 + ldr r0, =0x0000ffff + ands r0, r3 + ldr r1, =0x00007fff + cmp r0, r1 + bls _080F7B0A + movs r1, 0x80 + lsls r1, 9 + adds r3, r1 +_080F7B0A: + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + mov r1, r9 + strh r1, [r0, 0x8] + lsrs r1, r3, 16 + strh r1, [r0, 0xA] + ldr r1, [r4] + ldrb r0, [r1, 0x14] + adds r0, 0x1 + strb r0, [r1, 0x14] + ldr r0, [sp, 0x8] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] +_080F7B2E: + movs r3, 0xC0 + lsls r3, 18 + adds r7, r3 + adds r6, 0x14 + movs r4, 0x1 + add r9, r4 + mov r0, r9 + cmp r0, 0x3 + ble _080F7AAC + b _080F7C7E + .pool +_080F7B5C: + movs r1, 0 + mov r9, r1 + mov r10, r1 + movs r3, 0xC0 + lsls r3, 19 + str r3, [sp, 0x10] +_080F7B68: + ldr r4, =0x0203a034 + ldr r0, [r4] + ldr r0, [r0, 0x4] + add r0, r10 + ldrb r2, [r0, 0x12] + ldrb r0, [r0, 0x10] + ldr r1, =0x000060a3 + cmp r0, 0 + beq _080F7B7C + adds r1, 0x2 +_080F7B7C: + lsls r0, r2, 24 + asrs r0, 24 + cmp r8, r0 + bge _080F7C64 + mov r3, r8 + lsls r2, r3, 24 + asrs r2, 24 + subs r2, 0x13 + subs r2, r0, r2 + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldr r4, [sp, 0x10] + lsrs r3, r4, 24 + movs r7, 0x1 + str r7, [sp] + str r7, [sp, 0x4] + movs r0, 0x1 + bl FillBgTilemapBufferRect_Palette0 + ldr r0, =sub_80F7CA8 + movs r1, 0xA + bl CreateTask + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x0203a034 + ldr r6, [r0] + ldr r1, [r6, 0x4] + add r1, r10 + ldr r0, [r1, 0xC] + lsls r0, 16 + ldrb r1, [r1, 0x12] + bl __udivsi3 + mov r1, r8 + adds r1, 0x1 + adds r3, r0, 0 + muls r3, r1 + ldr r0, =0x0000ffff + ands r0, r3 + ldr r1, =0x00007fff + cmp r0, r1 + bls _080F7BDA + movs r1, 0x80 + lsls r1, 9 + adds r3, r1 +_080F7BDA: + ldr r1, =0x03005e00 + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 3 + adds r4, r0, r1 + mov r0, r9 + strh r0, [r4, 0x8] + ldr r0, [r6, 0x4] + add r0, r10 + ldrb r0, [r0, 0x10] + adds r6, r1, 0 + cmp r0, 0 + beq _080F7C1C + strh r7, [r4, 0xC] + ldr r0, [sp, 0xC] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0xC] + b _080F7C26 + .pool +_080F7C1C: + ldr r0, [sp, 0x8] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] +_080F7C26: + ldr r1, =0x0203a034 + ldr r0, [r1] + ldr r0, [r0, 0x4] + mov r4, r10 + adds r1, r4, r0 + ldrb r0, [r1, 0x10] + ldr r4, =0x0203a034 + cmp r0, 0 + beq _080F7C4C + adds r0, r2, r5 + lsls r0, 3 + adds r0, r6 + lsrs r2, r3, 16 + ldr r1, [r1, 0x8] + subs r1, r2 + b _080F7C58 + .pool +_080F7C4C: + adds r0, r2, r5 + lsls r0, 3 + adds r0, r6 + lsrs r2, r3, 16 + ldr r1, [r1, 0x8] + adds r1, r2 +_080F7C58: + strh r1, [r0, 0xA] + ldr r0, [r4] + ldr r1, [r0] + ldrb r0, [r1, 0x14] + adds r0, 0x1 + strb r0, [r1, 0x14] +_080F7C64: + movs r0, 0x14 + add r10, r0 + ldr r1, [sp, 0x10] + movs r3, 0xC0 + lsls r3, 18 + adds r1, r3 + str r1, [sp, 0x10] + movs r4, 0x1 + add r9, r4 + mov r0, r9 + cmp r0, 0x3 + bgt _080F7C7E + b _080F7B68 +_080F7C7E: + ldr r1, [sp, 0xC] + cmp r1, 0 + beq _080F7C8A + movs r0, 0x16 + bl audio_play +_080F7C8A: + ldr r3, [sp, 0x8] + cmp r3, 0 + beq _080F7C96 + movs r0, 0x15 + bl audio_play +_080F7C96: + 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_80F7A80 + + thumb_func_start sub_80F7CA8 +sub_80F7CA8: @ 80F7CA8 + 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 + movs r4, 0 + mov r9, r4 + ldr r1, =0x03005e00 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r6, [r0, 0x8] + ldrh r7, [r0, 0xA] + ldrh r1, [r0, 0xC] + mov r12, r1 + movs r2, 0xC + ldrsh r0, [r0, r2] + cmp r0, 0 + beq _080F7CF8 + ldr r2, =0x0203a034 + ldr r0, [r2] + ldr r0, [r0] + lsls r1, r6, 1 + adds r0, 0xC + adds r0, r1 + movs r3, 0 + ldrsh r0, [r0, r3] + adds r5, r1, 0 + cmp r0, 0 + bgt _080F7D10 + b _080F7D0E + .pool +_080F7CF8: + ldr r2, =0x0203a034 + ldr r0, [r2] + ldr r0, [r0] + lsls r1, r6, 1 + adds r0, 0xC + adds r0, r1 + movs r3, 0 + ldrsh r0, [r0, r3] + adds r5, r1, 0 + cmp r0, 0x57 + ble _080F7D10 +_080F7D0E: + movs r4, 0x1 +_080F7D10: + ldr r0, [r2] + ldr r0, [r0] + adds r0, 0xC + adds r2, r0, r5 + ldrh r3, [r2] + movs r0, 0 + ldrsh r1, [r2, r0] + lsls r0, r7, 16 + asrs r0, 16 + cmp r1, r0 + bne _080F7D2A + movs r1, 0x1 + mov r9, r1 +_080F7D2A: + mov r0, r9 + cmp r0, 0 + bne _080F7D4A + cmp r4, 0 + beq _080F7D3C + strh r7, [r2] + b _080F7D4A + .pool +_080F7D3C: + mov r1, r12 + cmp r1, 0 + beq _080F7D46 + subs r0, r3, 0x1 + b _080F7D48 +_080F7D46: + adds r0, r3, 0x1 +_080F7D48: + strh r0, [r2] +_080F7D4A: + cmp r4, 0 + bne _080F7DC4 + mov r2, r9 + cmp r2, 0 + bne _080F7DCA + movs r2, 0 +_080F7D56: + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r0, [r0] + adds r0, 0xC + adds r0, r5 + movs r1, 0 + ldrsh r3, [r0, r1] + adds r0, r2, 0x1 + lsls r1, r0, 3 + adds r4, r0, 0 + cmp r3, r1 + blt _080F7D78 + movs r0, 0x8 + b _080F7D94 + .pool +_080F7D78: + lsls r0, r2, 3 + cmp r3, r0 + blt _080F7D92 + adds r0, r3, 0 + cmp r3, 0 + bge _080F7D86 + adds r0, r3, 0x7 +_080F7D86: + asrs r0, 3 + lsls r0, 3 + subs r0, r3, r0 + lsls r0, 24 + lsrs r0, 24 + b _080F7D94 +_080F7D92: + movs r0, 0 +_080F7D94: + cmp r0, 0x3 + bhi _080F7DA0 + ldr r3, =0x0000504c + b _080F7DA2 + .pool +_080F7DA0: + ldr r3, =0x00005057 +_080F7DA2: + adds r1, r0, r3 + adds r2, 0x7 + lsls r2, 24 + lsrs r2, 24 + adds r3, r5, r6 + adds r3, 0x6 + lsls r3, 24 + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x2 + lsrs r3, 24 + bl FillBgTilemapBufferRect_Palette0 + adds r2, r4, 0 + cmp r2, 0xA + ble _080F7D56 +_080F7DC4: + mov r0, r9 + cmp r0, 0 + beq _080F7DDC +_080F7DCA: + ldr r0, =0x0203a034 + ldr r0, [r0] + ldr r1, [r0] + ldrb r0, [r1, 0x14] + subs r0, 0x1 + strb r0, [r1, 0x14] + mov r0, r8 + bl DestroyTask +_080F7DDC: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F7CA8 + + thumb_func_start sub_80F7DF4 +sub_80F7DF4: @ 80F7DF4 + push {r4,r5,lr} + ldr r4, =0x0203a034 + movs r0, 0x20 + bl AllocZeroed + str r0, [r4] + movs r0, 0x18 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1] + movs r0, 0x50 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x4] + movs r5, 0x80 + lsls r5, 4 + adds r0, r5, 0 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x8] + adds r0, r5, 0 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0xC] + adds r0, r5, 0 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x10] + adds r0, r5, 0 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x14] + adds r0, r5, 0 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x18] + movs r0, 0x80 + lsls r0, 5 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x1C] + bl init_uns_table_pokemon_copy + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F7DF4 + + thumb_func_start sub_80F7E64 +sub_80F7E64: @ 80F7E64 + push {r4,r5,lr} + ldr r5, =0x0203a034 + ldr r0, [r5] + ldr r0, [r0] + bl Free + ldr r0, [r5] + movs r4, 0 + str r4, [r0] + ldr r0, [r0, 0x4] + bl Free + ldr r0, [r5] + str r4, [r0, 0x4] + ldr r0, [r0, 0x8] + bl Free + ldr r0, [r5] + str r4, [r0, 0x8] + ldr r0, [r0, 0xC] + bl Free + ldr r0, [r5] + str r4, [r0, 0xC] + ldr r0, [r0, 0x10] + bl Free + ldr r0, [r5] + str r4, [r0, 0x10] + ldr r0, [r0, 0x14] + bl Free + ldr r0, [r5] + str r4, [r0, 0x14] + ldr r0, [r0, 0x18] + bl Free + ldr r0, [r5] + str r4, [r0, 0x18] + ldr r0, [r0, 0x1C] + bl Free + ldr r0, [r5] + str r4, [r0, 0x1C] + bl Free + str r4, [r5] + bl sub_805F094 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F7E64 + + thumb_func_start sub_80F7ED0 +sub_80F7ED0: @ 80F7ED0 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + str r1, [sp] + mov r0, sp + movs r3, 0 + strb r4, [r0, 0x4] + mov r1, sp + movs r0, 0x7 + strb r0, [r1, 0x5] + mov r0, sp + strb r2, [r0, 0x6] + movs r1, 0x2 + 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, 0x12 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + mov r2, sp + movs r0, 0x10 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + strb r1, [r2, 0xD] + mov r1, sp + movs r0, 0x80 + strb r0, [r1, 0xD] + mov r0, sp + movs r1, 0 + movs r2, 0 + bl AddTextPrinter + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl PutWindowTilemap + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80F7ED0 + + thumb_func_start sub_80F7F30 +sub_80F7F30: @ 80F7F30 + push {r4,r5,lr} + ldr r0, =0x02039f24 + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + bl sub_80DAE0C + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + cmp r5, 0 + beq _080F7F5E + ldr r4, =0x02039f2c + ldrb r0, [r4] + ldr r1, =0x02039f2e + ldrb r1, [r1] + bl sub_80DAB8C + ldrb r0, [r4] + bl sub_80DB09C +_080F7F5E: + ldr r0, =0x020375f0 + strh r5, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F7F30 + + thumb_func_start sub_80F7F7C +sub_80F7F7C: @ 80F7F7C + push {r4,lr} + movs r4, 0 + ldr r0, =0x02039f24 + ldrb r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r2, r1, r0 + ldr r0, =0x02039f2c + ldrh r0, [r0] + cmp r0, 0x4 + bhi _080F7FEE + lsls r0, 2 + ldr r1, =_080F7FB0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F7FB0: + .4byte _080F7FC4 + .4byte _080F7FCA + .4byte _080F7FD0 + .4byte _080F7FD6 + .4byte _080F7FDC +_080F7FC4: + adds r0, r2, 0 + movs r1, 0x32 + b _080F7FE0 +_080F7FCA: + adds r0, r2, 0 + movs r1, 0x33 + b _080F7FE0 +_080F7FD0: + adds r0, r2, 0 + movs r1, 0x34 + b _080F7FE0 +_080F7FD6: + adds r0, r2, 0 + movs r1, 0x35 + b _080F7FE0 +_080F7FDC: + adds r0, r2, 0 + movs r1, 0x36 +_080F7FE0: + bl pokemon_getattr + ldr r1, =0x02039f2e + ldrh r1, [r1] + cmp r0, r1 + bls _080F7FEE + movs r4, 0x1 +_080F7FEE: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80F7F7C + + thumb_func_start sub_80F7FFC +sub_80F7FFC: @ 80F7FFC + push {r4-r7,lr} + sub sp, 0x4 + ldr r1, =0x02039f20 + ldr r0, =0x02039f25 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080F8010 + b _080F8250 +_080F8010: + ldr r0, =0x02039f2c + ldrh r0, [r0] + cmp r0, 0x4 + bls _080F801A + b _080F8250 +_080F801A: + lsls r0, 2 + ldr r1, =_080F8034 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F8034: + .4byte _080F8048 + .4byte _080F80B8 + .4byte _080F8124 + .4byte _080F8190 + .4byte _080F81F8 +_080F8048: + ldr r6, =0x02039f24 + ldrb r0, [r6] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + movs r1, 0x32 + bl pokemon_getattr + lsls r0, 24 + lsrs r1, r0, 24 + mov r0, sp + strb r1, [r0] + ldr r0, =0x02039f2e + ldrh r0, [r0] + cmp r1, r0 + bls _080F806C + b _080F8250 +_080F806C: + adds r0, r1, 0 + cmp r0, 0x3 + bls _080F8074 + b _080F8250 +_080F8074: + adds r1, r0, 0x1 + mov r0, sp + strb r1, [r0] + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0x32 + mov r2, sp + bl pokemon_setattr + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + bl sub_80EE5A4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _080F809C + b _080F8250 +_080F809C: + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0x32 + bl sub_80EE4DC + b _080F8250 + .pool +_080F80B8: + mov r4, sp + ldr r7, =0x02039f24 + ldrb r0, [r7] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + movs r1, 0x33 + bl pokemon_getattr + strb r0, [r4] + mov r0, sp + ldrb r2, [r0] + ldr r0, =0x02039f2e + ldrh r0, [r0] + cmp r2, r0 + bls _080F80DC + b _080F8250 +_080F80DC: + cmp r2, 0x3 + bls _080F80E2 + b _080F8250 +_080F80E2: + mov r1, sp + adds r0, r2, 0x1 + strb r0, [r1] + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + movs r1, 0x33 + mov r2, sp + bl pokemon_setattr + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + bl sub_80EE5A4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _080F810A + b _080F8250 +_080F810A: + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + movs r1, 0x33 + bl sub_80EE4DC + b _080F8250 + .pool +_080F8124: + mov r4, sp + ldr r7, =0x02039f24 + ldrb r0, [r7] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + movs r1, 0x34 + bl pokemon_getattr + strb r0, [r4] + mov r0, sp + ldrb r2, [r0] + ldr r0, =0x02039f2e + ldrh r0, [r0] + cmp r2, r0 + bls _080F8148 + b _080F8250 +_080F8148: + cmp r2, 0x3 + bls _080F814E + b _080F8250 +_080F814E: + mov r1, sp + adds r0, r2, 0x1 + strb r0, [r1] + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + movs r1, 0x34 + mov r2, sp + bl pokemon_setattr + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + bl sub_80EE5A4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bls _080F8250 + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + movs r1, 0x34 + bl sub_80EE4DC + b _080F8250 + .pool +_080F8190: + mov r4, sp + ldr r7, =0x02039f24 + ldrb r0, [r7] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + movs r1, 0x35 + bl pokemon_getattr + strb r0, [r4] + mov r0, sp + ldrb r2, [r0] + ldr r0, =0x02039f2e + ldrh r0, [r0] + cmp r2, r0 + bhi _080F8250 + cmp r2, 0x3 + bhi _080F8250 + mov r1, sp + adds r0, r2, 0x1 + strb r0, [r1] + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + movs r1, 0x35 + mov r2, sp + bl pokemon_setattr + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + bl sub_80EE5A4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bls _080F8250 + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + movs r1, 0x35 + bl sub_80EE4DC + b _080F8250 + .pool +_080F81F8: + mov r4, sp + ldr r7, =0x02039f24 + ldrb r0, [r7] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + movs r1, 0x36 + bl pokemon_getattr + strb r0, [r4] + mov r0, sp + ldrb r2, [r0] + ldr r0, =0x02039f2e + ldrh r0, [r0] + cmp r2, r0 + bhi _080F8250 + cmp r2, 0x3 + bhi _080F8250 + mov r1, sp + adds r0, r2, 0x1 + strb r0, [r1] + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + movs r1, 0x36 + mov r2, sp + bl pokemon_setattr + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + bl sub_80EE5A4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bls _080F8250 + ldrb r0, [r7] + muls r0, r6 + adds r0, r5 + movs r1, 0x36 + bl sub_80EE4DC +_080F8250: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F7FFC + + thumb_func_start sub_80F8264 +sub_80F8264: @ 80F8264 + push {r4,lr} + ldr r4, =0x02021cc4 + ldr r0, =0x020375e4 + ldrh r1, [r0] + lsls r1, 6 + ldr r0, =0x02039e0d + adds r1, r0 + adds r0, r4, 0 + bl CopyString + adds r0, r4, 0 + bl sub_81DB5AC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F8264 + + thumb_func_start sub_80F8290 +sub_80F8290: @ 80F8290 + push {lr} + ldr r0, =0x02021ec4 + ldr r1, =0x020375e4 + ldrh r1, [r1] + lsls r1, 6 + ldr r2, =0x02039e02 + adds r1, r2 + bl CopyString + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F8290 + + thumb_func_start sub_80F82B4 +sub_80F82B4: @ 80F82B4 + push {r4-r6,lr} + movs r1, 0 + movs r2, 0 + ldr r5, =0x020375e0 + ldr r4, =0x02039f00 + ldr r0, =0x020375e4 + ldrh r0, [r0] + lsls r0, 1 + adds r0, r4 + movs r6, 0 + ldrsh r3, [r0, r6] +_080F82CA: + lsls r0, r1, 1 + adds r0, r4 + movs r6, 0 + ldrsh r0, [r0, r6] + cmp r3, r0 + bge _080F82DC + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_080F82DC: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _080F82CA + strh r2, [r5] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F82B4 + + thumb_func_start sub_80F82FC +sub_80F82FC: @ 80F82FC + ldr r2, =0x020375e0 + ldr r1, =0x02039f00 + ldr r0, =0x020375e4 + ldrh r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + bx lr + .pool + thumb_func_end sub_80F82FC + + thumb_func_start sub_80F831C +sub_80F831C: @ 80F831C + push {lr} + movs r1, 0 + ldr r2, =0x02039f20 + ldrb r0, [r2] + ldr r3, =0x020375e2 + cmp r0, 0 + beq _080F833C +_080F832A: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bhi _080F833C + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080F832A +_080F833C: + strh r1, [r3] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F831C + + thumb_func_start sub_80F834C +sub_80F834C: @ 80F834C + push {r4,lr} + movs r1, 0 + ldr r2, =0x02039f20 + ldrb r0, [r2] + ldr r4, =0x02021ec4 + ldr r3, =0x02039e0d + cmp r0, 0 + beq _080F836E +_080F835C: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bhi _080F836E + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080F835C +_080F836E: + lsls r1, 6 + adds r1, r3 + adds r0, r4, 0 + bl CopyString + adds r0, r4, 0 + bl sub_81DB5AC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F834C + + thumb_func_start sub_80F8390 +sub_80F8390: @ 80F8390 + push {r4,lr} + movs r1, 0 + ldr r2, =0x02039f20 + ldrb r0, [r2] + ldr r4, =0x02021cc4 + ldr r3, =0x02039e02 + cmp r0, 0 + beq _080F83B2 +_080F83A0: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bhi _080F83B2 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080F83A0 +_080F83B2: + lsls r1, 6 + adds r1, r3 + adds r0, r4, 0 + bl CopyString + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F8390 + + thumb_func_start sub_80F83D0 +sub_80F83D0: @ 80F83D0 + push {lr} + ldr r0, =sub_80D7B24 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F83D0 + + thumb_func_start sub_80F83E0 +sub_80F83E0: @ 80F83E0 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080F83FE + adds r0, r2, 0 + bl DestroyTask + ldr r0, =sub_80F83D0 + bl SetMainCallback2 +_080F83FE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F83E0 + + thumb_func_start sub_80F840C +sub_80F840C: @ 80F840C + push {lr} + sub sp, 0x4 + bl script_env_2_enable + ldr r0, =sub_80F83E0 + movs r1, 0xA + bl CreateTask + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F840C + + thumb_func_start sub_80F8438 +sub_80F8438: @ 80F8438 + ldr r2, =0x020375e0 + ldr r1, =0x02039e00 + ldr r0, =0x020375e4 + ldrh r0, [r0] + lsls r0, 6 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + bx lr + .pool + thumb_func_end sub_80F8438 + + thumb_func_start sub_80F8458 +sub_80F8458: @ 80F8458 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080F8476 + adds r0, r2, 0 + bl DestroyTask + ldr r0, =sub_80F5B00 + bl SetMainCallback2 +_080F8476: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F8458 + + thumb_func_start sub_80F8484 +sub_80F8484: @ 80F8484 + push {lr} + sub sp, 0x4 + bl script_env_2_enable + ldr r0, =sub_80F8458 + movs r1, 0xA + bl CreateTask + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F8484 + + thumb_func_start sub_80F84B0 +sub_80F84B0: @ 80F84B0 + ldr r0, =0x020375e0 + ldr r1, =0x02039f25 + ldrb r1, [r1] + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_80F84B0 + + thumb_func_start sub_80F84C4 +sub_80F84C4: @ 80F84C4 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + bl script_env_2_enable + ldr r6, =sub_80FC580 + adds r0, r6, 0 + movs r1, 0 + bl CreateTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r2, =sub_80F8508 + adds r0, r4, 0 + adds r1, r6, 0 + bl SetTaskFuncWithFollowupFunc + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x1A] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F84C4 + + thumb_func_start sub_80F8508 +sub_80F8508: @ 80F8508 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080F8540 + ldr r0, =0x02039f24 + ldrb r0, [r0] + bl sub_80DA8C8 + ldr r1, =sub_80FC6BC + ldr r2, =sub_80F8568 + adds r0, r4, 0 + bl SetTaskFuncWithFollowupFunc + b _080F8556 + .pool +_080F8540: + ldr r0, =0x02039f24 + ldrb r0, [r0] + bl sub_80DA8C8 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81D9DE4 + str r1, [r0] +_080F8556: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F8508 + + thumb_func_start sub_80F8568 +sub_80F8568: @ 80F8568 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =sub_80FC804 + ldr r2, =sub_80F8584 + bl SetTaskFuncWithFollowupFunc + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F8568 + + thumb_func_start sub_80F8584 +sub_80F8584: @ 80F8584 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =sub_80FCE48 + ldr r2, =sub_80F85A0 + bl SetTaskFuncWithFollowupFunc + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F8584 + + thumb_func_start sub_80F85A0 +sub_80F85A0: @ 80F85A0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =sub_80FC894 + ldr r2, =sub_80F85BC + bl SetTaskFuncWithFollowupFunc + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F85A0 + + thumb_func_start sub_80F85BC +sub_80F85BC: @ 80F85BC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + movs r3, 0 + ldr r5, =0x02039f30 + mov r12, r5 + ldr r0, =0x020375e0 + mov r9, r0 + add r1, sp, 0x4 + mov r8, r1 + ldrb r0, [r5] + cmp r3, r0 + bcs _080F8606 + lsls r0, r6, 2 + adds r0, r6 + lsls r4, r0, 3 + ldr r7, =0x03005e08 +_080F85EC: + mov r1, sp + adds r2, r1, r3 + adds r1, r3, 0x1 + lsls r0, r1, 1 + adds r0, r4 + adds r0, r7 + ldrh r0, [r0] + strb r0, [r2] + lsls r1, 24 + lsrs r3, r1, 24 + ldrb r0, [r5] + cmp r3, r0 + bcc _080F85EC +_080F8606: + movs r3, 0 + mov r1, r12 + ldrb r0, [r1] + cmp r3, r0 + bcs _080F862A + adds r4, r0, 0 + mov r2, sp +_080F8614: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r4 + bcs _080F862A + mov r0, sp + adds r1, r0, r3 + ldrb r0, [r2] + ldrb r1, [r1] + cmp r0, r1 + beq _080F8614 +_080F862A: + mov r1, r12 + ldrb r1, [r1] + cmp r3, r1 + bne _080F8644 + movs r0, 0 + b _080F8646 + .pool +_080F8644: + movs r0, 0x1 +_080F8646: + mov r1, r9 + strh r0, [r1] + movs r3, 0 + mov r4, r12 + ldrb r0, [r4] + cmp r3, r0 + bcs _080F8678 + mov r5, r8 + lsls r0, r6, 2 + adds r0, r6 + lsls r2, r0, 3 + ldr r7, =0x03005e08 +_080F865E: + adds r1, r5, r3 + adds r0, r3, 0x5 + lsls r0, 1 + adds r0, r2 + adds r0, r7 + ldrh r0, [r0] + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldrb r1, [r4] + cmp r3, r1 + bcc _080F865E +_080F8678: + mov r0, r8 + bl sub_80F86E0 + ldr r1, =0x02039f2b + strb r0, [r1] + ldr r0, =0x02039f2c + ldrb r0, [r0] + bl sub_80DB09C + ldr r1, =sub_80FCF40 + ldr r2, =sub_80F86B8 + adds r0, r6, 0 + bl SetTaskFuncWithFollowupFunc + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F85BC + + thumb_func_start sub_80F86B8 +sub_80F86B8: @ 80F86B8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + bl sub_80DCE58 + ldr r1, =sub_80FCFD0 + ldr r2, =sub_80F8714 + adds r0, r4, 0 + bl SetTaskFuncWithFollowupFunc + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F86B8 + + thumb_func_start sub_80F86E0 +sub_80F86E0: @ 80F86E0 + push {r4,r5,lr} + adds r3, r0, 0 + movs r4, 0 + movs r2, 0x1 + ldr r0, =0x02039f30 + ldrb r0, [r0] + cmp r2, r0 + bge _080F8708 + adds r5, r0, 0 +_080F86F2: + adds r0, r3, r4 + adds r1, r3, r2 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcs _080F8702 + lsls r0, r2, 24 + lsrs r4, r0, 24 +_080F8702: + adds r2, 0x1 + cmp r2, r5 + blt _080F86F2 +_080F8708: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80F86E0 + + thumb_func_start sub_80F8714 +sub_80F8714: @ 80F8714 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0x1 + bne _080F8748 + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080F877E + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80F878C + str r0, [r1] + b _080F877E + .pool +_080F8748: + ldr r5, =0x02039e02 + movs r4, 0x3 +_080F874C: + adds r0, r5, 0 + bl GetStringEnd_Limit7 + adds r5, 0x40 + subs r4, 0x1 + cmp r4, 0 + bge _080F874C + adds r0, r6, 0 + bl DestroyTask + ldr r0, =0x03005d8c + 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 + bl script_env_2_disable + bl script_env_2_enable_and_set_ctx_running +_080F877E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F8714 + + thumb_func_start sub_80F878C +sub_80F878C: @ 80F878C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_800AC34 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80F87B4 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F878C + + thumb_func_start sub_80F87B4 +sub_80F87B4: @ 80F87B4 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _080F87D0 + adds r0, r1, 0 + bl DestroyTask + bl script_env_2_disable + bl script_env_2_enable_and_set_ctx_running +_080F87D0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F87B4 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/contest_link_80FC4F4.s b/asm/contest_link_80FC4F4.s new file mode 100644 index 000000000..98ffdf441 --- /dev/null +++ b/asm/contest_link_80FC4F4.s @@ -0,0 +1,1362 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80FC4F4 +sub_80FC4F4: @ 80FC4F4 + push {r4,r5,lr} + adds r2, r0, 0 + lsls r4, r1, 16 + lsrs r4, 16 + ldr r5, =0x0201c000 + adds r0, r5, 0 + adds r1, r2, 0 + adds r2, r4, 0 + bl memcpy + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + adds r1, r5, 0 + adds r2, r4, 0 + bl link_0800A448 + lsls r0, 24 + cmp r0, 0 + bne _080FC528 + movs r0, 0 + b _080FC52A + .pool +_080FC528: + movs r0, 0x1 +_080FC52A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80FC4F4 + + thumb_func_start sub_80FC530 +sub_80FC530: @ 80FC530 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0x80 + lsls r4, 17 + lsls r4, r5 + lsrs r4, 24 + bl sub_800A550 + ands r4, r0 + cmp r4, 0 + beq _080FC552 + adds r0, r5, 0 + bl sub_800A5EC + movs r0, 0x1 + b _080FC554 +_080FC552: + movs r0, 0 +_080FC554: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80FC530 + + thumb_func_start sub_80FC55C +sub_80FC55C: @ 80FC55C + push {r4,lr} + bl sub_800A550 + adds r4, r0, 0 + bl sub_800A9D8 + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _080FC574 + movs r0, 0 + b _080FC57A +_080FC574: + bl sub_800A5B4 + movs r0, 0x1 +_080FC57A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80FC55C + + thumb_func_start sub_80FC580 +sub_80FC580: @ 80FC580 + push {r4-r6,lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r5, =0x03005e00 + ldr r6, =sub_80FC5C0 + ldr r4, =0x020223c4 + movs r3, 0xFF +_080FC590: + lsls r0, r1, 8 + adds r0, r4 + strh r3, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _080FC590 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r5 + movs r1, 0 + strh r1, [r0, 0x8] + str r6, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FC580 + + thumb_func_start sub_80FC5C0 +sub_80FC5C0: @ 80FC5C0 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =sub_80FC5DC + str r0, [r1] + bx lr + .pool + thumb_func_end sub_80FC5C0 + + thumb_func_start sub_80FC5DC +sub_80FC5DC: @ 80FC5DC + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _080FC650 + bl link_get_multiplayer_id + ldr r1, =0x02039f25 + strb r0, [r1] + bl sub_8009FCC + ldr r4, =0x02039f30 + strb r0, [r4] + ldr r1, =0x02039f2a + movs r0, 0x1 + strb r0, [r1] + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0x1 + bne _080FC60C + movs r0, 0x3 + strb r0, [r1] +_080FC60C: + movs r3, 0 + ldrb r2, [r4] + cmp r3, r2 + bge _080FC64A + ldr r1, =0x020229e8 + ldrb r0, [r1] + subs r0, 0x1 + adds r6, r4, 0 + cmp r0, 0x1 + bls _080FC63A + adds r4, r2, 0 + adds r2, r1, 0 + movs r5, 0xFF +_080FC626: + adds r2, 0x1C + adds r3, 0x1 + cmp r3, r4 + bge _080FC64A + ldrh r1, [r2] + adds r0, r5, 0 + ands r0, r1 + subs r0, 0x1 + cmp r0, 0x1 + bhi _080FC626 +_080FC63A: + ldrb r6, [r6] + cmp r3, r6 + bge _080FC64A + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080FC64A: + adds r0, r7, 0 + bl SwitchTaskToFollowupFunc +_080FC650: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FC5DC + + thumb_func_start sub_80FC670 +sub_80FC670: @ 80FC670 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080FC698 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080FC6A0 + cmp r0, 0x1 + beq _080FC6AE + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FC6B4 +_080FC698: + movs r0, 0x1 + b _080FC6B6 + .pool +_080FC6A0: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FC6B4 + bl sub_800ADF8 +_080FC6AE: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_080FC6B4: + movs r0, 0 +_080FC6B6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80FC670 + + thumb_func_start sub_80FC6BC +sub_80FC6BC: @ 80FC6BC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r6, r7, 2 + adds r0, r6, r7 + lsls r4, r0, 3 + ldr r5, =0x03005e08 + adds r0, r4, r5 + adds r0, 0x18 + bl sub_80FC670 + cmp r0, 0 + bne _080FC6DC + b _080FC7F4 +_080FC6DC: + adds r0, r5, 0 + subs r0, 0x8 + adds r4, r0 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080FC758 + cmp r0, 0x1 + bgt _080FC6F8 + cmp r0, 0 + beq _080FC6FE + b _080FC7DC + .pool +_080FC6F8: + cmp r0, 0xA + beq _080FC7C0 + b _080FC7DC +_080FC6FE: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _080FC738 + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FC7F4 + ldr r0, =0x020228c4 + ldr r1, =0x02039f25 + ldrb r1, [r1] + lsls r1, 6 + ldr r2, =0x02039e00 + adds r1, r2 + movs r2, 0x40 + bl memcpy + movs r0, 0xA + strh r0, [r4, 0x8] + b _080FC7F4 + .pool +_080FC738: + ldr r0, =0x020228c4 + ldr r1, =0x02039f25 + ldrb r1, [r1] + lsls r1, 6 + ldr r2, =0x02039e00 + adds r1, r2 + movs r2, 0x40 + bl memcpy + b _080FC7D6 + .pool +_080FC758: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FC7F4 + movs r5, 0 + ldr r0, =0x02039f30 + mov r8, r6 + ldrb r0, [r0] + cmp r5, r0 + bge _080FC798 + ldr r6, =0x020229e8 +_080FC770: + lsls r4, r5, 6 + ldr r0, =0x02039e00 + adds r4, r0 + lsls r1, r5, 8 + ldr r0, =0x020223c4 + adds r1, r0 + adds r0, r4, 0 + movs r2, 0x40 + bl memcpy + ldrh r1, [r6, 0x1A] + adds r0, r4, 0 + bl sub_80DFA08 + adds r6, 0x1C + adds r5, 0x1 + ldr r0, =0x02039f30 + ldrb r0, [r0] + cmp r5, r0 + blt _080FC770 +_080FC798: + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _080FC7F4 + .pool +_080FC7C0: + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + strh r0, [r4, 0x1E] + lsls r0, 16 + movs r1, 0x96 + lsls r1, 17 + cmp r0, r1 + ble _080FC7F4 + movs r0, 0x2 + bl sub_800A4D8 +_080FC7D6: + movs r0, 0x1 + strh r0, [r4, 0x8] + b _080FC7F4 +_080FC7DC: + ldr r0, =0x03005e00 + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r1, r0 + movs r0, 0 + strh r0, [r1, 0x8] + strh r0, [r1, 0x1E] + strh r0, [r1, 0x20] + adds r0, r7, 0 + bl SwitchTaskToFollowupFunc +_080FC7F4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FC6BC + + thumb_func_start sub_80FC804 +sub_80FC804: @ 80FC804 + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _080FC830 + cmp r0, 0x1 + beq _080FC858 + movs r0, 0 + strh r0, [r5, 0x8] + adds r0, r2, 0 + bl SwitchTaskToFollowupFunc + b _080FC880 + .pool +_080FC830: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _080FC87A + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FC880 + ldr r0, =0x03005d80 + movs r1, 0x4 + bl sub_80FC4F4 + cmp r0, 0x1 + bne _080FC880 + b _080FC87A + .pool +_080FC858: + movs r0, 0 + bl sub_80FC530 + lsls r0, 24 + cmp r0, 0 + beq _080FC880 + ldr r0, =0x03005d80 + ldr r4, =0x020223c4 + adds r1, r4, 0 + movs r2, 0x4 + bl memcpy + ldr r0, =0x030060b8 + adds r1, r4, 0 + movs r2, 0x4 + bl memcpy +_080FC87A: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_080FC880: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FC804 + + thumb_func_start sub_80FC894 +sub_80FC894: @ 80FC894 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + mov r8, r0 + adds r0, r6 + lsls r5, r0, 3 + ldr r7, =0x03005e08 + adds r0, r5, r7 + adds r0, 0x18 + bl sub_80FC670 + cmp r0, 0 + beq _080FC986 + movs r1, 0x8 + negs r1, r1 + adds r1, r7 + mov r9, r1 + adds r4, r5, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080FC90C + cmp r0, 0x1 + bgt _080FC8D8 + cmp r0, 0 + beq _080FC8DE + b _080FC96E + .pool +_080FC8D8: + cmp r0, 0xA + beq _080FC954 + b _080FC96E +_080FC8DE: + ldr r1, =0x020228c4 + ldrh r0, [r4, 0x1A] + strb r0, [r1] + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _080FC904 + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FC986 + movs r0, 0xA + strh r0, [r4, 0x8] + b _080FC986 + .pool +_080FC904: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080FC986 +_080FC90C: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FC986 + movs r3, 0 + ldr r1, =0x02039f30 + ldrb r0, [r1] + cmp r3, r0 + bge _080FC93A + ldr r4, =0x020223c4 + adds r0, r7, 0x2 + adds r2, r5, r0 + movs r5, 0x80 + lsls r5, 1 +_080FC92A: + ldrh r0, [r4] + strh r0, [r2] + adds r4, r5 + adds r2, 0x2 + adds r3, 0x1 + ldrb r0, [r1] + cmp r3, r0 + blt _080FC92A +_080FC93A: + mov r0, r8 + adds r1, r0, r6 + lsls r1, 3 + add r1, r9 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _080FC986 + .pool +_080FC954: + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + strh r0, [r4, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + ble _080FC986 + movs r0, 0x2 + bl sub_800A4D8 + movs r0, 0x1 + strh r0, [r4, 0x8] + b _080FC986 +_080FC96E: + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + movs r0, 0 + strh r0, [r1, 0x8] + strh r0, [r1, 0x1E] + strh r0, [r1, 0x20] + adds r0, r6, 0 + bl SwitchTaskToFollowupFunc +_080FC986: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FC894 + + thumb_func_start sub_80FC998 +sub_80FC998: @ 80FC998 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080FC9C4 + cmp r0, 0x1 + beq _080FC9E0 + movs r0, 0 + strh r0, [r4, 0x8] + adds r0, r2, 0 + bl SwitchTaskToFollowupFunc + b _080FC9F0 + .pool +_080FC9C4: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FC9F0 + ldr r0, =0x02039f25 + movs r1, 0x1 + bl sub_80FC4F4 + cmp r0, 0x1 + bne _080FC9F0 + b _080FC9EA + .pool +_080FC9E0: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FC9F0 +_080FC9EA: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080FC9F0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FC998 + + thumb_func_start sub_80FC9F8 +sub_80FC9F8: @ 80FC9F8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x03005e00 + mov r8, r0 + lsls r7, r5, 2 + adds r0, r7, r5 + lsls r0, 3 + mov r1, r8 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080FCA30 + cmp r0, 0x1 + beq _080FCA68 + movs r0, 0 + strh r0, [r4, 0x8] + adds r0, r5, 0 + bl SwitchTaskToFollowupFunc + b _080FCAB2 + .pool +_080FCA30: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FCAB2 + ldr r0, =0x02039f34 + ldr r2, [r0] + ldr r0, =0x02039f25 + ldrb r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r0, [r2, 0x4] + adds r0, r1 + adds r0, 0x6 + movs r1, 0x2 + bl sub_80FC4F4 + cmp r0, 0x1 + bne _080FCAB2 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080FCAB2 + .pool +_080FCA68: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FCAB2 + movs r2, 0 + ldr r6, =0x02039f30 + mov r9, r8 + mov r12, r7 + ldrb r0, [r6] + cmp r2, r0 + bge _080FCAA4 + ldr r1, =0x02039f34 + mov r8, r1 + ldr r4, =0x020223c4 + movs r3, 0 + movs r7, 0x80 + lsls r7, 1 +_080FCA8C: + mov r1, r8 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r0, r3, r0 + ldrh r1, [r4] + strh r1, [r0, 0x6] + adds r4, r7 + adds r3, 0x1C + adds r2, 0x1 + ldrb r0, [r6] + cmp r2, r0 + blt _080FCA8C +_080FCAA4: + mov r0, r12 + adds r1, r0, r5 + lsls r1, 3 + add r1, r9 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_080FCAB2: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FC9F8 + + thumb_func_start sub_80FCACC +sub_80FCACC: @ 80FCACC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + movs r3, 0x8 + ldrsh r0, [r2, r3] + adds r3, r1, 0 + cmp r0, 0xB + bls _080FCAE8 + b _080FCC78 +_080FCAE8: + lsls r0, 2 + ldr r1, =_080FCAFC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080FCAFC: + .4byte _080FCB2C + .4byte _080FCB44 + .4byte _080FCB6C + .4byte _080FCB90 + .4byte _080FCBA4 + .4byte _080FCB6C + .4byte _080FCBCC + .4byte _080FCBE0 + .4byte _080FCB6C + .4byte _080FCC08 + .4byte _080FCC38 + .4byte _080FCB6C +_080FCB2C: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _080FCB38 + b _080FCC82 +_080FCB38: + ldr r0, =0x02039f08 + movs r1, 0x8 + b _080FCC16 + .pool +_080FCB44: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + bne _080FCB50 + b _080FCC82 +_080FCB50: + ldr r0, =0x02039f08 + ldr r1, =0x02039f2b + ldrb r1, [r1] + lsls r1, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0x8 + b _080FCC50 + .pool +_080FCB6C: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r3 + ldrh r0, [r2, 0xA] + adds r1, r0, 0x1 + strh r1, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bgt _080FCB84 + b _080FCC82 +_080FCB84: + movs r0, 0 + strh r0, [r2, 0xA] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + b _080FCC82 +_080FCB90: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FCC82 + ldr r0, =0x02039f10 + movs r1, 0x8 + b _080FCC16 + .pool +_080FCBA4: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FCC82 + ldr r0, =0x02039f10 + ldr r1, =0x02039f2b + ldrb r1, [r1] + lsls r1, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0x8 + b _080FCC50 + .pool +_080FCBCC: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FCC82 + ldr r0, =0x02039f18 + movs r1, 0x8 + b _080FCC16 + .pool +_080FCBE0: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FCC82 + ldr r0, =0x02039f18 + ldr r1, =0x02039f2b + ldrb r1, [r1] + lsls r1, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0x8 + b _080FCC50 + .pool +_080FCC08: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FCC82 + ldr r0, =0x02039f20 + movs r1, 0x4 +_080FCC16: + bl sub_80FC4F4 + cmp r0, 0x1 + bne _080FCC82 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _080FCC82 + .pool +_080FCC38: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FCC82 + ldr r0, =0x02039f20 + ldr r1, =0x02039f2b + ldrb r1, [r1] + lsls r1, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0x4 +_080FCC50: + bl memcpy + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _080FCC82 + .pool +_080FCC78: + movs r0, 0 + strh r0, [r2, 0x8] + adds r0, r4, 0 + bl SwitchTaskToFollowupFunc +_080FCC82: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FCACC + + thumb_func_start sub_80FCC88 +sub_80FCC88: @ 80FCC88 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + movs r3, 0x8 + ldrsh r0, [r2, r3] + adds r3, r1, 0 + cmp r0, 0xB + bls _080FCCA4 + b _080FCE38 +_080FCCA4: + lsls r0, 2 + ldr r1, =_080FCCB8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080FCCB8: + .4byte _080FCCE8 + .4byte _080FCD04 + .4byte _080FCD30 + .4byte _080FCD54 + .4byte _080FCD6C + .4byte _080FCD30 + .4byte _080FCD98 + .4byte _080FCDB0 + .4byte _080FCD30 + .4byte _080FCDC8 + .4byte _080FCDF8 + .4byte _080FCD30 +_080FCCE8: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _080FCCF4 + b _080FCE42 +_080FCCF4: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x4] + movs r1, 0x70 + b _080FCDD6 + .pool +_080FCD04: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + bne _080FCD10 + b _080FCE42 +_080FCD10: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x4] + ldr r1, =0x02039f2b + ldrb r1, [r1] + lsls r1, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0x70 + b _080FCE10 + .pool +_080FCD30: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r3 + ldrh r0, [r2, 0xA] + adds r1, r0, 0x1 + strh r1, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bgt _080FCD48 + b _080FCE42 +_080FCD48: + movs r0, 0 + strh r0, [r2, 0xA] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + b _080FCE42 +_080FCD54: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FCE42 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + movs r1, 0x14 + b _080FCDD6 + .pool +_080FCD6C: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FCE42 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldr r1, =0x02039f2b + ldrb r1, [r1] + lsls r1, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0x14 + b _080FCE10 + .pool +_080FCD98: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FCE42 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x10] + b _080FCDD4 + .pool +_080FCDB0: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FCE42 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x10] + b _080FCE04 + .pool +_080FCDC8: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FCE42 + ldr r0, =0x02039f26 +_080FCDD4: + movs r1, 0x4 +_080FCDD6: + bl sub_80FC4F4 + cmp r0, 0x1 + bne _080FCE42 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _080FCE42 + .pool +_080FCDF8: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FCE42 + ldr r0, =0x02039f26 +_080FCE04: + ldr r1, =0x02039f2b + ldrb r1, [r1] + lsls r1, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0x4 +_080FCE10: + bl memcpy + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _080FCE42 + .pool +_080FCE38: + movs r0, 0 + strh r0, [r2, 0x8] + adds r0, r4, 0 + bl SwitchTaskToFollowupFunc +_080FCE42: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FCC88 + + thumb_func_start sub_80FCE48 +sub_80FCE48: @ 80FCE48 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + mov r8, r0 + adds r0, r6 + lsls r5, r0, 3 + ldr r7, =0x03005e08 + adds r0, r5, r7 + adds r0, 0x18 + bl sub_80FC670 + cmp r0, 0 + beq _080FCF2E + movs r1, 0x8 + negs r1, r1 + adds r1, r7 + mov r9, r1 + adds r4, r5, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080FCEC0 + cmp r0, 0x1 + bgt _080FCE8C + cmp r0, 0 + beq _080FCE92 + b _080FCF16 + .pool +_080FCE8C: + cmp r0, 0xA + beq _080FCEFC + b _080FCF16 +_080FCE92: + ldr r1, =0x020228c4 + movs r0, 0x6E + strb r0, [r1] + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _080FCEB8 + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FCF2E + movs r0, 0xA + strh r0, [r4, 0x8] + b _080FCF2E + .pool +_080FCEB8: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080FCF2E +_080FCEC0: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FCF2E + mov r1, r8 + mov r8, r9 + ldr r4, =0x020223c4 + adds r0, r7, 0 + adds r0, 0xA + adds r2, r5, r0 + movs r5, 0x80 + lsls r5, 1 + movs r3, 0x3 +_080FCEDC: + ldrh r0, [r4] + strh r0, [r2] + adds r4, r5 + adds r2, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _080FCEDC + adds r1, r6 + lsls r1, 3 + add r1, r8 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _080FCF2E + .pool +_080FCEFC: + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + strh r0, [r4, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + ble _080FCF2E + movs r0, 0x2 + bl sub_800A4D8 + movs r0, 0x1 + strh r0, [r4, 0x8] + b _080FCF2E +_080FCF16: + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + movs r0, 0 + strh r0, [r1, 0x8] + strh r0, [r1, 0x1E] + strh r0, [r1, 0x20] + adds r0, r6, 0 + bl SwitchTaskToFollowupFunc +_080FCF2E: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FCE48 + + thumb_func_start sub_80FCF40 +sub_80FCF40: @ 80FCF40 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r4, r0, 3 + ldr r6, =0x03005e08 + adds r0, r4, r6 + adds r0, 0x18 + bl sub_80FC670 + cmp r0, 0 + beq _080FCFBE + adds r0, r6, 0 + subs r0, 0x8 + adds r4, r0 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080FCF80 + cmp r0, 0x1 + beq _080FCF9C + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0x20] + adds r0, r5, 0 + bl SwitchTaskToFollowupFunc + b _080FCFBE + .pool +_080FCF80: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FCFBE + ldr r0, =0x02039f00 + movs r1, 0x8 + bl sub_80FC4F4 + cmp r0, 0x1 + bne _080FCFBE + b _080FCFB8 + .pool +_080FCF9C: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FCFBE + ldr r0, =0x02039f00 + ldr r1, =0x02039f2b + ldrb r1, [r1] + lsls r1, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0x8 + bl memcpy +_080FCFB8: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080FCFBE: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FCF40 + + thumb_func_start sub_80FCFD0 +sub_80FCFD0: @ 80FCFD0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r4, r0, 3 + ldr r6, =0x03005e08 + adds r0, r4, r6 + adds r0, 0x18 + bl sub_80FC670 + cmp r0, 0 + beq _080FD04E + adds r0, r6, 0 + subs r0, 0x8 + adds r4, r0 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080FD010 + cmp r0, 0x1 + beq _080FD02C + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0x20] + adds r0, r5, 0 + bl SwitchTaskToFollowupFunc + b _080FD04E + .pool +_080FD010: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080FD04E + ldr r0, =0x02039f26 + movs r1, 0x4 + bl sub_80FC4F4 + cmp r0, 0x1 + bne _080FD04E + b _080FD048 + .pool +_080FD02C: + bl sub_80FC55C + lsls r0, 24 + cmp r0, 0 + beq _080FD04E + ldr r0, =0x02039f26 + ldr r1, =0x02039f2b + ldrb r1, [r1] + lsls r1, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0x4 + bl memcpy +_080FD048: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080FD04E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FCFD0 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/contest_painting.s b/asm/contest_painting.s new file mode 100644 index 000000000..fd789b0d4 --- /dev/null +++ b/asm/contest_painting.s @@ -0,0 +1,1197 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_812FDA8 +sub_812FDA8: @ 812FDA8 + push {r4-r7,lr} + ldr r3, =0x02039f5d + ldr r4, =0x02039f5c + ldr r1, =0x03005d8c + ldr r2, [r1] + subs r0, 0x1 + lsls r1, r0, 5 + adds r2, r1 + ldr r1, =0x02039f3c + ldr r5, =0x00002e90 + adds r2, r5 + ldm r2!, {r5-r7} + stm r1!, {r5-r7} + ldm r2!, {r5-r7} + stm r1!, {r5-r7} + ldm r2!, {r6,r7} + stm r1!, {r6,r7} + strb r0, [r3] + movs r0, 0 + strb r0, [r4] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812FDA8 + + thumb_func_start sub_812FDEC +sub_812FDEC: @ 812FDEC + push {lr} + bl sub_812FE58 + pop {r0} + bx r0 + thumb_func_end sub_812FDEC + + thumb_func_start sub_812FDF8 +sub_812FDF8: @ 812FDF8 + push {lr} + bl sub_812FFC8 + bl RunTextPrinters + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_812FDF8 + + thumb_func_start sub_812FE0C +sub_812FE0C: @ 812FE0C + push {r4,r5,lr} + ldr r0, =0x030022c0 + ldr r0, [r0, 0x8] + bl SetMainCallback2 + ldr r4, =0x030061c4 + ldr r0, [r4] + bl Free + movs r5, 0 + str r5, [r4] + ldr r4, =0x03006190 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r0, =0x030011f7 + ldrb r0, [r0] + bl RemoveWindow + movs r0, 0x1 + bl GetBgTilemapBuffer + bl Free + bl sub_805F094 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812FE0C + + thumb_func_start sub_812FE58 +sub_812FE58: @ 812FE58 + push {r4-r7,lr} + sub sp, 0x4 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0x4 + bls _0812FE6E + b _0812FFA0 +_0812FE6E: + lsls r0, 2 + ldr r1, =_0812FE80 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0812FE80: + .4byte _0812FE94 + .4byte _0812FEC8 + .4byte _0812FF14 + .4byte _0812FF2A + .4byte _0812FF54 +_0812FE94: + bl remove_some_task + movs r0, 0 + bl SetVBlankCallback + bl init_uns_table_pokemon_copy + ldr r1, =0x030061c0 + ldr r0, =0x02039f3c + str r0, [r1] + movs r0, 0x1 + bl sub_8130238 + bl sub_81301EC + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0812FF3E + .pool +_0812FEC8: + bl sub_80A1A74 + movs r2, 0xC0 + lsls r2, 19 + movs r3, 0xC0 + lsls r3, 9 + movs r5, 0 + ldr r1, =0x040000d4 + movs r4, 0x80 + lsls r4, 5 + ldr r6, =0x85000400 + movs r7, 0x85 + lsls r7, 24 +_0812FEE2: + str r5, [sp] + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + str r6, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r2, r4 + subs r3, r4 + cmp r3, r4 + bhi _0812FEE2 + str r5, [sp] + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + lsrs r0, r3, 2 + orrs r0, r7 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + bl ResetAllObjectData + b _0812FF36 + .pool +_0812FF14: + ldrh r0, [r4, 0x20] + bl SeedRng + bl InitKeypadData + bl sub_8130098 + movs r0, 0x87 + lsls r0, 3 + adds r1, r4, r0 + b _0812FF3E +_0812FF2A: + ldr r0, =0x02039f5d + ldrb r0, [r0] + ldr r1, =0x02039f5c + ldrb r1, [r1] + bl sub_8130884 +_0812FF36: + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_0812FF3E: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0812FFA0 + .pool +_0812FF54: + ldr r0, =0x02039f5d + ldrb r0, [r0] + ldr r1, =0x02039f5c + ldrb r1, [r1] + bl sub_813010C + ldr r0, =gUnknown_085B0838 + movs r1, 0 + movs r2, 0x2 + bl gpu_pal_apply + movs r1, 0xA0 + lsls r1, 19 + movs r4, 0 + str r4, [sp] + ldr r0, =0x040000d4 + mov r2, sp + str r2, [r0] + str r1, [r0, 0x4] + ldr r1, =0x85000100 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + movs r0, 0x2 + bl sub_80A2390 + ldr r0, =sub_81302D0 + bl SetVBlankCallback + ldr r0, =0x030011f0 + strb r4, [r0] + movs r1, 0x9A + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r0, =sub_812FDF8 + bl SetMainCallback2 +_0812FFA0: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812FE58 + + thumb_func_start sub_812FFC8 +sub_812FFC8: @ 812FFC8 + push {lr} + sub sp, 0x4 + ldr r3, =0x030011f0 + ldrb r1, [r3] + cmp r1, 0x1 + beq _0813001C + cmp r1, 0x1 + bgt _0812FFE4 + cmp r1, 0 + beq _0812FFEA + b _08130082 + .pool +_0812FFE4: + cmp r1, 0x2 + beq _0813005C + b _08130082 +_0812FFEA: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0812FFFA + movs r0, 0x1 + strb r0, [r3] +_0812FFFA: + ldr r0, =0x030011f6 + ldrb r0, [r0] + cmp r0, 0 + beq _08130082 + ldr r1, =0x030011f4 + ldrh r0, [r1] + cmp r0, 0 + beq _08130082 + subs r0, 0x1 + b _08130080 + .pool +_0813001C: + ldr r0, =0x030022c0 + ldrh r2, [r0, 0x2E] + ands r1, r2 + cmp r1, 0 + bne _0813002E + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _08130040 +_0813002E: + movs r0, 0x2 + strb r0, [r3] + subs r0, 0x3 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe +_08130040: + ldr r0, =0x030011f6 + ldrb r0, [r0] + cmp r0, 0 + beq _08130082 + ldr r1, =0x030011f4 + movs r0, 0 + b _08130080 + .pool +_0813005C: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0813006E + ldr r0, =sub_812FE0C + bl SetMainCallback2 +_0813006E: + ldr r0, =0x030011f6 + ldrb r0, [r0] + cmp r0, 0 + beq _08130082 + ldr r1, =0x030011f4 + ldrh r0, [r1] + cmp r0, 0x1D + bhi _08130082 + adds r0, 0x1 +_08130080: + strh r0, [r1] +_08130082: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_812FFC8 + + thumb_func_start sub_8130098 +sub_8130098: @ 8130098 + push {r4,lr} + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085B07E8 + movs r0, 0 + movs r2, 0x1 + bl InitBgsFromTemplates + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x80 + lsls r0, 4 + bl AllocZeroed + adds r1, r0, 0 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r4, =0x030011f7 + ldr r0, =gUnknown_085B07EC + bl AddWindow + strb r0, [r4] + bl DeactivateAllTextPrinters + ldrb r0, [r4] + movs r1, 0 + bl FillWindowPixelBuffer + ldrb r0, [r4] + bl PutWindowTilemap + ldrb r0, [r4] + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0x1 + bl ShowBg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8130098 + + thumb_func_start sub_813010C +sub_813010C: @ 813010C + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + beq _081301D4 + ldr r6, =0x030061c0 + ldr r1, [r6] + ldrb r5, [r1, 0xA] + cmp r0, 0x7 + bhi _08130190 + ldr r4, =0x02021cc4 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_818E868 + ldr r1, =gUnknown_085E8D5E + adds r0, r4, 0 + bl AppendString + ldr r1, =gUnknown_085B07D4 + ldr r0, [r6] + ldrb r0, [r0, 0x1E] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl AppendString + ldr r4, =0x02021dc4 + ldr r1, [r6] + adds r1, 0x16 + adds r0, r4, 0 + bl CopyString + adds r0, r4, 0 + bl sub_81DB5AC + ldr r0, =0x02021ec4 + ldr r1, [r6] + adds r1, 0xB + bl CopyString + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_0827EA0C + bl ExpandStringRefs + b _081301A6 + .pool +_08130190: + ldr r0, =0x02021cc4 + adds r1, 0xB + bl CopyString + ldr r0, =0x02021fc4 + ldr r2, =gUnknown_085B07F4 + lsls r1, r5, 2 + adds r1, r2 + ldr r1, [r1] + bl ExpandStringRefs +_081301A6: + ldr r4, =0x02021fc4 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xD0 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + ldr r0, =0x030011f7 + ldrb r0, [r0] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x1 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + bl Print + movs r0, 0x1 + bl CopyBgTilemapBufferToVram +_081301D4: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813010C + + thumb_func_start sub_81301EC +sub_81301EC: @ 81301EC + push {lr} + movs r0, 0 + movs r1, 0 + bl SetGpuReg + ldr r2, =0x04000200 + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + ldr r1, =0x00000c42 + movs r0, 0x8 + bl SetGpuReg + ldr r1, =0x00000a45 + movs r0, 0xA + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end sub_81301EC + + thumb_func_start sub_8130238 +sub_8130238: @ 8130238 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0813025C + ldr r0, =0x030011f6 + strb r1, [r0] + ldr r0, =0x030011f2 + strh r1, [r0] + ldr r0, =0x030011f4 + strh r1, [r0] + b _0813026E + .pool +_0813025C: + ldr r1, =0x030011f6 + movs r0, 0x1 + strb r0, [r1] + ldr r1, =0x030011f2 + movs r0, 0xF + strh r0, [r1] + ldr r1, =0x030011f4 + movs r0, 0x1E + strh r0, [r1] +_0813026E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8130238 + + thumb_func_start sub_8130280 +sub_8130280: @ 8130280 + push {lr} + ldr r0, =0x030011f6 + ldrb r0, [r0] + cmp r0, 0 + bne _08130298 + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + b _081302C0 + .pool +_08130298: + ldr r1, =0x00000a45 + movs r0, 0xA + bl SetGpuReg + ldr r1, =0x030011f2 + ldr r0, =0x030011f4 + ldrh r0, [r0] + lsrs r0, 1 + strh r0, [r1] + lsls r1, r0, 12 + lsls r2, r0, 8 + orrs r1, r2 + lsls r2, r0, 4 + orrs r1, r2 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x4C + bl SetGpuReg +_081302C0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8130280 + + thumb_func_start sub_81302D0 +sub_81302D0: @ 81302D0 + push {lr} + bl sub_8130280 + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_81302D0 + + thumb_func_start sub_81302E8 +sub_81302E8: @ 81302E8 + push {r4-r7,lr} + adds r4, r1, 0 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r4, 24 + lsrs r4, 24 + ldr r6, =0x030061c0 + ldr r0, [r6] + ldr r1, [r0, 0x4] + ldr r2, [r0] + adds r0, r5, 0 + bl species_and_otid_get_pal + ldr r7, =0x030061c4 + ldr r1, [r7] + bl LZDecompressVram + cmp r4, 0 + bne _08130348 + lsls r0, r5, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r4, =0x020244d4 + ldr r1, [r4] + ldr r1, [r1, 0x8] + ldr r2, [r6] + ldr r3, [r2] + adds r2, r5, 0 + bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldr r1, [r7] + ldr r2, =0x03006190 + ldr r2, [r2] + bl sub_8130380 + b _0813036C + .pool +_08130348: + lsls r0, r5, 3 + ldr r1, =gMonBackPicTable + adds r0, r1 + ldr r4, =0x020244d4 + ldr r1, [r4] + ldr r1, [r1, 0x4] + ldr r2, [r6] + ldr r3, [r2] + adds r2, r5, 0 + bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack + ldr r0, [r4] + ldr r0, [r0, 0x4] + ldr r1, [r7] + ldr r2, =0x03006190 + ldr r2, [r2] + bl sub_8130380 +_0813036C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81302E8 + + thumb_func_start sub_8130380 +sub_8130380: @ 8130380 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r10, r0 + mov r9, r1 + str r2, [sp] + movs r0, 0 +_08130394: + movs r3, 0 + adds r1, r0, 0x1 + str r1, [sp, 0x4] + lsls r0, 3 + str r0, [sp, 0x8] +_0813039E: + movs r1, 0 + adds r2, r3, 0x1 + mov r8, r2 + ldr r7, [sp, 0x8] + adds r0, r7, r3 + lsls r0, 5 + mov r12, r0 + lsls r4, r3, 3 +_081303AE: + movs r3, 0 + lsls r0, r1, 2 + adds r6, r1, 0x1 + mov r2, r12 + adds r5, r2, r0 + ldr r7, [sp, 0x8] + adds r0, r7, r1 + lsls r0, 7 + ldr r1, [sp] + adds r2, r0, r1 +_081303C2: + lsrs r0, r3, 1 + adds r0, r5, r0 + add r0, r10 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r3 + cmp r0, 0 + beq _081303D6 + lsrs r1, 4 + b _081303DA +_081303D6: + movs r0, 0xF + ands r1, r0 +_081303DA: + cmp r1, 0 + bne _081303EC + adds r0, r4, r3 + lsls r0, 1 + adds r0, r2 + movs r7, 0x80 + lsls r7, 8 + adds r1, r7, 0 + b _081303F8 +_081303EC: + adds r0, r4, r3 + lsls r0, 1 + adds r0, r2 + lsls r1, 1 + add r1, r9 + ldrh r1, [r1] +_081303F8: + strh r1, [r0] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x7 + bls _081303C2 + lsls r0, r6, 16 + lsrs r1, r0, 16 + cmp r1, 0x7 + bls _081303AE + mov r1, r8 + lsls r0, r1, 16 + lsrs r3, r0, 16 + cmp r3, 0x7 + bls _0813039E + ldr r2, [sp, 0x4] + lsls r0, r2, 16 + lsrs r0, 16 + cmp r0, 0x7 + bls _08130394 + 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_8130380 + + thumb_func_start sub_8130430 +sub_8130430: @ 8130430 + push {r4-r7,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_085A989C + movs r2, 0x80 + lsls r2, 1 + movs r1, 0 + bl gpu_pal_apply + cmp r4, 0x1 + beq _0813044E + b _081305A4 +_0813044E: + ldr r0, =0x030061c0 + ldr r0, [r0] + ldrb r0, [r0, 0xA] + movs r1, 0x3 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _0813050C + lsls r0, 2 + ldr r1, =_08130478 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08130478: + .4byte _0813048C + .4byte _081304A4 + .4byte _081304BC + .4byte _081304D4 + .4byte _081304F8 +_0813048C: + ldr r0, =gUnknown_085A9A9C + movs r1, 0xC0 + lsls r1, 19 + bl RLUnCompVram + ldr r0, =gUnknown_085AE974 + b _081304E0 + .pool +_081304A4: + ldr r0, =gUnknown_085AAB20 + movs r1, 0xC0 + lsls r1, 19 + bl RLUnCompVram + ldr r0, =gUnknown_085AEE80 + b _081304E0 + .pool +_081304BC: + ldr r0, =gUnknown_085AB750 + movs r1, 0xC0 + lsls r1, 19 + bl RLUnCompVram + ldr r0, =gUnknown_085AF38C + b _081304E0 + .pool +_081304D4: + ldr r0, =gUnknown_085AC288 + movs r1, 0xC0 + lsls r1, 19 + bl RLUnCompVram + ldr r0, =gUnknown_085AF898 +_081304E0: + ldr r1, =0x03006190 + ldr r1, [r1] + bl RLUnCompWram + b _0813050C + .pool +_081304F8: + ldr r0, =gUnknown_085AD240 + movs r1, 0xC0 + lsls r1, 19 + bl RLUnCompVram + ldr r0, =gUnknown_085AFDA4 + ldr r1, =0x03006190 + ldr r1, [r1] + bl RLUnCompWram +_0813050C: + movs r1, 0 + ldr r5, =0x06006000 + ldr r0, =0x00001015 + adds r4, r0, 0 +_08130514: + movs r3, 0 + lsls r2, r1, 5 +_08130518: + adds r0, r2, r3 + lsls r0, 1 + adds r0, r5 + strh r4, [r0] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x1F + bls _08130518 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x13 + bls _08130514 + movs r1, 0 + ldr r0, =0x0600608c + mov r12, r0 + ldr r7, =0x03006190 +_0813053C: + movs r3, 0 + adds r6, r1, 0x1 + lsls r5, r1, 5 + lsls r4, r1, 6 +_08130544: + adds r2, r5, r3 + lsls r2, 1 + add r2, r12 + ldr r0, [r7] + adds r0, r4, r0 + lsls r1, r3, 1 + adds r0, r1 + adds r0, 0x8C + ldrh r0, [r0] + strh r0, [r2] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x11 + bls _08130544 + lsls r0, r6, 24 + lsrs r1, r0, 24 + cmp r1, 0x9 + bls _0813053C + movs r3, 0 + ldr r4, =0x0600608e + ldr r2, =0x03006190 +_08130570: + lsls r1, r3, 1 + adds r1, r4 + ldr r0, [r2] + adds r0, 0x8E + ldrh r0, [r0] + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xF + bls _08130570 + b _08130676 + .pool +_081305A4: + cmp r5, 0x7 + bhi _081305C0 + ldr r0, =gUnknown_085AE370 + movs r1, 0xC0 + lsls r1, 19 + bl RLUnCompVram + ldr r0, =gUnknown_085B02B0 + b _08130650 + .pool +_081305C0: + ldr r0, =0x030061c0 + ldr r0, [r0] + ldrb r0, [r0, 0xA] + movs r1, 0x3 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _08130676 + lsls r0, 2 + ldr r1, =_081305E8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081305E8: + .4byte _081305FC + .4byte _08130614 + .4byte _0813062C + .4byte _08130644 + .4byte _08130664 +_081305FC: + ldr r0, =gUnknown_085A9A9C + movs r1, 0xC0 + lsls r1, 19 + bl RLUnCompVram + ldr r0, =gUnknown_085AE974 + b _08130650 + .pool +_08130614: + ldr r0, =gUnknown_085AAB20 + movs r1, 0xC0 + lsls r1, 19 + bl RLUnCompVram + ldr r0, =gUnknown_085AEE80 + b _08130650 + .pool +_0813062C: + ldr r0, =gUnknown_085AB750 + movs r1, 0xC0 + lsls r1, 19 + bl RLUnCompVram + ldr r0, =gUnknown_085AF38C + b _08130650 + .pool +_08130644: + ldr r0, =gUnknown_085AC288 + movs r1, 0xC0 + lsls r1, 19 + bl RLUnCompVram + ldr r0, =gUnknown_085AF898 +_08130650: + ldr r1, =0x06006000 + bl RLUnCompVram + b _08130676 + .pool +_08130664: + ldr r0, =gUnknown_085AD240 + movs r1, 0xC0 + lsls r1, 19 + bl RLUnCompVram + ldr r0, =gUnknown_085AFDA4 + ldr r1, =0x06006000 + bl RLUnCompVram +_08130676: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8130430 + + thumb_func_start sub_8130688 +sub_8130688: @ 8130688 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x030022c0 + ldr r1, =gUnknown_085B0830 + ldr r2, [r1, 0x4] + ldr r1, [r1] + str r1, [r3, 0x38] + str r2, [r3, 0x3C] + ldrh r2, [r3, 0x3C] + ldr r1, =0xfffffc00 + ands r1, r2 + strh r1, [r3, 0x3C] + ldrh r1, [r3, 0x3A] + ldr r0, =0xfffffe00 + ands r0, r1 + movs r1, 0x58 + orrs r0, r1 + strh r0, [r3, 0x3A] + adds r1, r3, 0 + adds r1, 0x38 + movs r0, 0x18 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8130688 + + thumb_func_start sub_81306CC +sub_81306CC: @ 81306CC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x7 + bhi _081306E4 + ldr r0, =0x030061c0 + ldr r0, [r0] + ldrb r0, [r0, 0xA] + b _081306F4 + .pool +_081306E4: + ldr r0, =0x030061c0 + ldr r0, [r0] + ldrb r0, [r0, 0xA] + movs r1, 0x3 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 +_081306F4: + cmp r0, 0x4 + bhi _08130732 + lsls r0, 2 + ldr r1, =_0813070C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0813070C: + .4byte _08130720 + .4byte _08130724 + .4byte _08130728 + .4byte _0813072C + .4byte _08130730 +_08130720: + movs r0, 0x9 + b _08130732 +_08130724: + movs r0, 0xD + b _08130732 +_08130728: + movs r0, 0x2 + b _08130732 +_0813072C: + movs r0, 0x24 + b _08130732 +_08130730: + movs r0, 0x6 +_08130732: + pop {r1} + bx r1 + thumb_func_end sub_81306CC + + thumb_func_start sub_8130738 +sub_8130738: @ 8130738 + push {r4,lr} + ldr r4, =0x030061c4 + movs r0, 0x80 + lsls r0, 2 + bl AllocZeroed + str r0, [r4] + ldr r4, =0x03006190 + movs r0, 0x80 + lsls r0, 6 + bl AllocZeroed + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8130738 + + thumb_func_start sub_8130760 +sub_8130760: @ 8130760 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, =0x030061a0 + ldr r0, =0x03006190 + ldr r0, [r0] + str r0, [r1, 0x4] + ldr r0, =0x030061c4 + ldr r0, [r0] + str r0, [r1, 0x8] + movs r2, 0 + strb r2, [r1, 0x18] + ldr r0, =0x030061c0 + ldr r0, [r0] + ldrb r0, [r0] + strb r0, [r1, 0x1F] + strb r2, [r1, 0x19] + strb r2, [r1, 0x1A] + movs r0, 0x40 + strb r0, [r1, 0x1B] + strb r0, [r1, 0x1C] + strb r0, [r1, 0x1D] + strb r0, [r1, 0x1E] + subs r0, r3, 0x2 + adds r4, r1, 0 + cmp r0, 0x22 + bhi _08130844 + lsls r0, 2 + ldr r1, =_081307B4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081307B4: + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130840 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130844 + .4byte _08130840 +_08130840: + movs r0, 0x3 + b _08130846 +_08130844: + movs r0, 0x1 +_08130846: + strh r0, [r4, 0x14] + movs r0, 0x2 + strh r0, [r4, 0x16] + strb r3, [r4] + ldr r0, =0x06010000 + str r0, [r4, 0x10] + adds r0, r4, 0 + bl sub_8124F2C + adds r0, r4, 0 + bl sub_81261A4 + adds r0, r4, 0 + bl sub_8126058 + ldr r0, =0x030061c4 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 1 + movs r2, 0x80 + lsls r2, 2 + bl gpu_pal_apply + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8130760 + + thumb_func_start sub_8130884 +sub_8130884: @ 8130884 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + bl sub_8130738 + ldr r0, =0x030061c0 + ldr r0, [r0] + ldrh r0, [r0, 0x8] + movs r1, 0 + bl sub_81302E8 + adds r0, r4, 0 + bl sub_81306CC + lsls r0, 24 + lsrs r0, 24 + bl sub_8130760 + adds r0, r4, 0 + bl sub_8130688 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8130430 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8130884 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/cute_sketch.s b/asm/cute_sketch.s new file mode 100644 index 000000000..a66c78c9f --- /dev/null +++ b/asm/cute_sketch.s @@ -0,0 +1,3331 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8124F2C +sub_8124F2C: @ 8124F2C + push {lr} + ldr r2, =0x03006168 + ldr r1, [r0, 0x4] + str r1, [r2] + ldr r2, =0x0300617c + ldrb r1, [r0, 0x1F] + strb r1, [r2] + ldr r2, =0x03006164 + ldrb r1, [r0, 0x19] + strb r1, [r2] + ldr r2, =0x03006178 + ldrb r1, [r0, 0x1A] + strb r1, [r2] + ldr r2, =0x03006174 + ldrb r1, [r0, 0x1B] + strb r1, [r2] + ldr r2, =0x0300616c + ldrb r1, [r0, 0x1C] + strb r1, [r2] + ldr r2, =0x03006180 + ldrb r1, [r0, 0x1D] + strb r1, [r2] + ldr r2, =0x03006170 + ldrb r1, [r0, 0x1E] + strb r1, [r2] + ldrb r0, [r0] + subs r0, 0x2 + cmp r0, 0x22 + bls _08124F68 + b _081250B4 +_08124F68: + lsls r0, 2 + ldr r1, =_08124F98 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08124F98: + .4byte _08125024 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _08125084 + .4byte _081250B4 + .4byte _0812502A + .4byte _08125030 + .4byte _08125044 + .4byte _08125056 + .4byte _081250B4 + .4byte _0812506C + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _081250B4 + .4byte _08125072 + .4byte _08125050 + .4byte _08125078 + .4byte _0812507E + .4byte _081250B4 + .4byte _081250B4 + .4byte _08125090 +_08125024: + bl sub_8125230 + b _081250B4 +_0812502A: + bl sub_81252E8 + b _081250B4 +_08125030: + bl sub_81254E0 + ldr r0, =0x0300617c + ldrb r0, [r0] + bl sub_81253A4 + b _081250B4 + .pool +_08125044: + bl sub_81254E0 + bl sub_8125630 + bl sub_8125448 +_08125050: + bl sub_8125630 + b _081250B4 +_08125056: + bl sub_81254E0 + bl sub_81257F8 + bl sub_81257F8 + bl sub_81258A0 + bl sub_8125448 + b _081250B4 +_0812506C: + bl sub_81256C8 + b _081250B4 +_08125072: + bl sub_81254E0 + b _081250B4 +_08125078: + bl sub_81257F8 + b _081250B4 +_0812507E: + bl sub_81258A0 + b _081250B4 +_08125084: + bl sub_8125250 + movs r0, 0x3 + bl sub_81250B8 + b _081250B4 +_08125090: + bl sub_81254E0 + bl sub_81257F8 + bl sub_81258A0 + bl sub_8125448 + bl sub_81252E8 + bl sub_81252E8 + movs r0, 0x2 + bl sub_81250B8 + movs r0, 0x4 + bl sub_8125170 +_081250B4: + pop {r0} + bx r0 + thumb_func_end sub_8124F2C + + thumb_func_start sub_81250B8 +sub_81250B8: @ 81250B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r7, r0, 24 + movs r2, 0 + ldr r0, =0x0300616c + mov r8, r0 + ldrb r0, [r0] + cmp r2, r0 + bcs _0812514A + ldr r1, =0x03006174 + mov r12, r1 + ldr r3, =0x03006180 + mov r10, r3 + ldr r0, =0x03006164 + mov r9, r0 +_081250DE: + ldr r1, =0x03006178 + ldrb r0, [r1] + adds r0, r2 + mov r3, r10 + ldrb r1, [r3] + muls r0, r1 + lsls r0, 1 + ldr r3, =0x03006168 + ldr r1, [r3] + adds r1, r0 + mov r3, r9 + ldrb r0, [r3] + lsls r0, 1 + adds r3, r1, r0 + movs r4, 0 + adds r5, r2, 0x1 + mov r0, r12 + ldrb r0, [r0] + cmp r4, r0 + bcs _0812513E + movs r6, 0x80 + lsls r6, 8 +_0812510A: + ldrh r1, [r3] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _0812512E + movs r0, 0x1F + ands r0, r1 + adds r0, r7 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x1F + bls _08125124 + movs r2, 0x1F +_08125124: + lsls r0, r2, 10 + lsls r1, r2, 5 + orrs r0, r1 + orrs r0, r2 + strh r0, [r3] +_0812512E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r3, 0x2 + mov r1, r12 + ldrb r1, [r1] + cmp r4, r1 + bcc _0812510A +_0812513E: + lsls r0, r5, 24 + lsrs r2, r0, 24 + mov r3, r8 + ldrb r3, [r3] + cmp r2, r3 + bcc _081250DE +_0812514A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81250B8 + + thumb_func_start sub_8125170 +sub_8125170: @ 8125170 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r2, 0 + ldr r0, =0x0300616c + ldrb r0, [r0] + cmp r2, r0 + bcs _08125208 + ldr r1, =0x03006174 + mov r10, r1 +_0812518E: + ldr r3, =0x03006178 + ldrb r0, [r3] + adds r0, r2 + ldr r3, =0x03006180 + ldrb r1, [r3] + muls r0, r1 + lsls r0, 1 + ldr r3, =0x03006168 + ldr r1, [r3] + adds r1, r0 + ldr r3, =0x03006164 + ldrb r0, [r3] + lsls r0, 1 + adds r3, r1, r0 + movs r5, 0 + adds r7, r2, 0x1 + mov r0, r10 + ldrb r0, [r0] + cmp r5, r0 + bcs _081251FC + movs r1, 0x80 + lsls r1, 8 + mov r9, r1 + movs r0, 0x1F + mov r12, r0 + mov r1, r8 + subs r6, r0, r1 +_081251C4: + ldrh r1, [r3] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + bne _081251EC + movs r4, 0x1F + mov r2, r12 + ands r2, r1 + cmp r2, r6 + ble _081251E2 + mov r1, r8 + lsrs r0, r1, 1 + subs r0, r4, r0 + lsls r0, 24 + lsrs r2, r0, 24 +_081251E2: + lsls r0, r2, 10 + lsls r1, r2, 5 + orrs r0, r1 + orrs r0, r2 + strh r0, [r3] +_081251EC: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r3, 0x2 + mov r0, r10 + ldrb r0, [r0] + cmp r5, r0 + bcc _081251C4 +_081251FC: + lsls r0, r7, 24 + lsrs r2, r0, 24 + ldr r1, =0x0300616c + ldrb r1, [r1] + cmp r2, r1 + bcc _0812518E +_08125208: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8125170 + + thumb_func_start sub_8125230 +sub_8125230: @ 8125230 + push {r4,r5,lr} + movs r4, 0 + ldr r5, =0x00000c7f +_08125236: + lsls r0, r4, 16 + lsrs r0, 16 + bl sub_8125954 + adds r4, 0x1 + cmp r4, r5 + bls _08125236 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8125230 + + thumb_func_start sub_8125250 +sub_8125250: @ 8125250 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + movs r2, 0 + ldr r0, =0x0300616c + ldrb r0, [r0] + cmp r2, r0 + bcs _081252C2 + ldr r0, =0x03006168 + mov r8, r0 + ldr r3, =0x03006174 +_08125268: + ldr r0, =0x03006178 + ldrb r1, [r0] + adds r1, r2 + ldr r0, =0x03006180 + ldrb r0, [r0] + muls r0, r1 + lsls r0, 1 + mov r4, r8 + ldr r1, [r4] + adds r1, r0 + ldr r0, =0x03006164 + ldrb r0, [r0] + lsls r0, 1 + adds r4, r1, r0 + movs r5, 0 + adds r6, r2, 0x1 + ldrb r0, [r3] + cmp r5, r0 + bcs _081252B6 + movs r0, 0x80 + lsls r0, 8 + adds r7, r0, 0 +_08125294: + ldrh r0, [r4] + ands r0, r7 + cmp r0, 0 + bne _081252A8 + adds r0, r4, 0 + str r3, [sp] + bl sub_8125B28 + strh r0, [r4] + ldr r3, [sp] +_081252A8: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x2 + ldrb r0, [r3] + cmp r5, r0 + bcc _08125294 +_081252B6: + lsls r0, r6, 24 + lsrs r2, r0, 24 + ldr r0, =0x0300616c + ldrb r0, [r0] + cmp r2, r0 + bcc _08125268 +_081252C2: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8125250 + + thumb_func_start sub_81252E8 +sub_81252E8: @ 81252E8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + movs r2, 0 + ldr r0, =0x03006174 + ldrb r0, [r0] + cmp r2, r0 + bcs _0812537E + ldr r0, =0x03006168 + mov r8, r0 + ldr r3, =0x03006180 +_08125300: + ldr r0, =0x03006178 + ldrb r1, [r0] + ldrb r0, [r3] + muls r0, r1 + lsls r0, 1 + mov r4, r8 + ldr r1, [r4] + adds r1, r0 + ldr r0, =0x03006164 + ldrb r0, [r0] + adds r0, r2 + lsls r0, 1 + adds r4, r1, r0 + ldrh r1, [r4] + mov r0, sp + strh r1, [r0] + movs r5, 0x1 + ldrb r0, [r3] + lsls r0, 1 + adds r4, r0 + ldr r0, =0x0300616c + ldrb r0, [r0] + subs r0, 0x1 + adds r7, r2, 0x1 + cmp r5, r0 + bge _08125372 + ldr r6, =0x03006180 +_08125336: + ldrh r0, [r4] + movs r2, 0x80 + lsls r2, 8 + adds r1, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _0812535C + ldrb r2, [r6] + lsls r2, 1 + adds r2, r4, r2 + mov r0, sp + adds r1, r4, 0 + str r3, [sp, 0x4] + bl sub_8125E18 + strh r0, [r4] + mov r1, sp + strh r0, [r1] + ldr r3, [sp, 0x4] +_0812535C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r0, [r6] + lsls r0, 1 + adds r4, r0 + ldr r0, =0x0300616c + ldrb r0, [r0] + subs r0, 0x1 + cmp r5, r0 + blt _08125336 +_08125372: + lsls r0, r7, 24 + lsrs r2, r0, 24 + ldr r0, =0x03006174 + ldrb r0, [r0] + cmp r2, r0 + bcc _08125300 +_0812537E: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81252E8 + + thumb_func_start sub_81253A4 +sub_81253A4: @ 81253A4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r2, 0 + ldr r0, =0x0300616c + ldrb r0, [r0] + cmp r2, r0 + bcs _08125420 + ldr r0, =0x03006168 + mov r9, r0 + ldr r3, =0x03006174 +_081253C4: + ldr r0, =0x03006178 + ldrb r1, [r0] + adds r1, r2 + ldr r0, =0x03006180 + ldrb r0, [r0] + muls r0, r1 + lsls r0, 1 + mov r4, r9 + ldr r1, [r4] + adds r1, r0 + ldr r0, =0x03006164 + ldrb r0, [r0] + lsls r0, 1 + adds r4, r1, r0 + movs r5, 0 + adds r6, r2, 0x1 + ldrb r0, [r3] + cmp r5, r0 + bcs _08125414 + movs r0, 0x80 + lsls r0, 8 + adds r7, r0, 0 +_081253F0: + ldrh r0, [r4] + ands r0, r7 + cmp r0, 0 + bne _08125406 + adds r0, r4, 0 + mov r1, r8 + str r3, [sp] + bl sub_8125B5C + strh r0, [r4] + ldr r3, [sp] +_08125406: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x2 + ldrb r0, [r3] + cmp r5, r0 + bcc _081253F0 +_08125414: + lsls r0, r6, 24 + lsrs r2, r0, 24 + ldr r0, =0x0300616c + ldrb r0, [r0] + cmp r2, r0 + bcc _081253C4 +_08125420: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81253A4 + + thumb_func_start sub_8125448 +sub_8125448: @ 8125448 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + movs r2, 0 + ldr r0, =0x0300616c + ldrb r0, [r0] + cmp r2, r0 + bcs _081254BA + ldr r0, =0x03006168 + mov r8, r0 + ldr r3, =0x03006174 +_08125460: + ldr r0, =0x03006178 + ldrb r1, [r0] + adds r1, r2 + ldr r0, =0x03006180 + ldrb r0, [r0] + muls r0, r1 + lsls r0, 1 + mov r4, r8 + ldr r1, [r4] + adds r1, r0 + ldr r0, =0x03006164 + ldrb r0, [r0] + lsls r0, 1 + adds r4, r1, r0 + movs r5, 0 + adds r6, r2, 0x1 + ldrb r0, [r3] + cmp r5, r0 + bcs _081254AE + movs r0, 0x80 + lsls r0, 8 + adds r7, r0, 0 +_0812548C: + ldrh r0, [r4] + ands r0, r7 + cmp r0, 0 + bne _081254A0 + adds r0, r4, 0 + str r3, [sp] + bl sub_8125C68 + strh r0, [r4] + ldr r3, [sp] +_081254A0: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x2 + ldrb r0, [r3] + cmp r5, r0 + bcc _0812548C +_081254AE: + lsls r0, r6, 24 + lsrs r2, r0, 24 + ldr r0, =0x0300616c + ldrb r0, [r0] + cmp r2, r0 + bcc _08125460 +_081254BA: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8125448 + + thumb_func_start sub_81254E0 +sub_81254E0: @ 81254E0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r7, 0 + ldr r0, =0x0300616c + ldrb r0, [r0] + cmp r7, r0 + bcs _0812556C + ldr r0, =0x03006168 + mov r8, r0 +_081254F6: + ldr r0, =0x03006178 + ldrb r1, [r0] + adds r1, r7 + ldr r0, =0x03006180 + ldrb r0, [r0] + muls r0, r1 + lsls r0, 1 + mov r2, r8 + ldr r1, [r2] + adds r1, r0 + ldr r0, =0x03006164 + ldrb r0, [r0] + lsls r0, 1 + adds r5, r1, r0 + adds r4, r5, 0x2 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8125C98 + strh r0, [r5] + movs r6, 0x1 + adds r5, r4, 0 + ldr r0, =0x03006174 + ldrb r0, [r0] + subs r0, 0x1 + adds r7, 0x1 + cmp r6, r0 + bge _08125556 +_0812552E: + adds r4, r5, 0x2 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8125C98 + strh r0, [r5] + subs r1, r5, 0x2 + adds r0, r5, 0 + bl sub_8125C98 + strh r0, [r5] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r5, r4, 0 + ldr r0, =0x03006174 + ldrb r0, [r0] + subs r0, 0x1 + cmp r6, r0 + blt _0812552E +_08125556: + subs r1, r5, 0x2 + adds r0, r5, 0 + bl sub_8125C98 + strh r0, [r5] + lsls r0, r7, 24 + lsrs r7, r0, 24 + ldr r0, =0x0300616c + ldrb r0, [r0] + cmp r7, r0 + bcc _081254F6 +_0812556C: + movs r6, 0 + ldr r0, =0x03006174 + ldrb r0, [r0] + cmp r6, r0 + bcs _0812560C + ldr r3, =0x03006168 + mov r9, r3 + ldr r0, =0x03006180 + mov r8, r0 +_0812557E: + ldr r0, =0x03006178 + ldrb r0, [r0] + mov r2, r8 + ldrb r1, [r2] + muls r0, r1 + lsls r0, 1 + mov r3, r9 + ldr r2, [r3] + adds r2, r0 + ldr r0, =0x03006164 + ldrb r0, [r0] + adds r0, r6 + lsls r0, 1 + adds r5, r2, r0 + lsls r1, 1 + adds r1, r5, r1 + adds r0, r5, 0 + bl sub_8125C98 + strh r0, [r5] + movs r7, 0x1 + mov r1, r8 + ldrb r0, [r1] + lsls r0, 1 + adds r5, r0 + ldr r0, =0x0300616c + ldrb r0, [r0] + subs r0, 0x1 + adds r6, 0x1 + cmp r7, r0 + bge _081255F0 + ldr r4, =0x03006180 +_081255BE: + ldrb r1, [r4] + lsls r1, 1 + adds r1, r5, r1 + adds r0, r5, 0 + bl sub_8125C98 + strh r0, [r5] + ldrb r1, [r4] + lsls r1, 1 + subs r1, r5, r1 + adds r0, r5, 0 + bl sub_8125C98 + strh r0, [r5] + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r4] + lsls r0, 1 + adds r5, r0 + ldr r0, =0x0300616c + ldrb r0, [r0] + subs r0, 0x1 + cmp r7, r0 + blt _081255BE +_081255F0: + mov r2, r8 + ldrb r1, [r2] + lsls r1, 1 + subs r1, r5, r1 + adds r0, r5, 0 + bl sub_8125C98 + strh r0, [r5] + lsls r0, r6, 24 + lsrs r6, r0, 24 + ldr r0, =0x03006174 + ldrb r0, [r0] + cmp r6, r0 + bcc _0812557E +_0812560C: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81254E0 + + thumb_func_start sub_8125630 +sub_8125630: @ 8125630 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + movs r2, 0 + ldr r0, =0x0300616c + ldrb r0, [r0] + cmp r2, r0 + bcs _081256A2 + ldr r0, =0x03006168 + mov r8, r0 + ldr r3, =0x03006174 +_08125648: + ldr r0, =0x03006178 + ldrb r1, [r0] + adds r1, r2 + ldr r0, =0x03006180 + ldrb r0, [r0] + muls r0, r1 + lsls r0, 1 + mov r4, r8 + ldr r1, [r4] + adds r1, r0 + ldr r0, =0x03006164 + ldrb r0, [r0] + lsls r0, 1 + adds r4, r1, r0 + movs r5, 0 + adds r6, r2, 0x1 + ldrb r0, [r3] + cmp r5, r0 + bcs _08125696 + movs r0, 0x80 + lsls r0, 8 + adds r7, r0, 0 +_08125674: + ldrh r0, [r4] + ands r0, r7 + cmp r0, 0 + bne _08125688 + adds r0, r4, 0 + str r3, [sp] + bl sub_8125CC8 + strh r0, [r4] + ldr r3, [sp] +_08125688: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x2 + ldrb r0, [r3] + cmp r5, r0 + bcc _08125674 +_08125696: + lsls r0, r6, 24 + lsrs r2, r0, 24 + ldr r0, =0x0300616c + ldrb r0, [r0] + cmp r2, r0 + bcc _08125648 +_081256A2: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8125630 + + thumb_func_start sub_81256C8 +sub_81256C8: @ 81256C8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r0, =0x03006168 + ldr r4, [r0] + movs r6, 0 + movs r0, 0x80 + lsls r0, 8 + adds r5, r0, 0 +_081256E0: + movs r7, 0 +_081256E2: + ldrh r0, [r4] + ands r0, r5 + cmp r0, 0 + bne _081256F2 + adds r0, r4, 0 + bl sub_8125CC8 + strh r0, [r4] +_081256F2: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + adds r4, 0x2 + cmp r7, 0x3F + bls _081256E2 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x3F + bls _081256E0 + movs r7, 0 + ldr r1, =0x03006168 + mov r10, r1 + mov r3, sp + movs r2, 0x80 + lsls r2, 8 + mov r9, r2 +_08125716: + lsls r0, r7, 1 + mov r2, r10 + ldr r1, [r2] + adds r4, r1, r0 + ldrh r1, [r4] + strh r1, [r3] + mov r1, r9 + strh r1, [r4] + movs r6, 0x1 + adds r4, 0x80 + adds r5, r0, 0 +_0812572C: + ldrh r0, [r4] + movs r2, 0x80 + lsls r2, 8 + ands r0, r2 + cmp r0, 0 + bne _0812574C + adds r2, r4, 0 + adds r2, 0x80 + mov r0, sp + adds r1, r4, 0 + str r3, [sp, 0x4] + bl sub_8125F38 + strh r0, [r4] + ldr r3, [sp, 0x4] + strh r0, [r3] +_0812574C: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r4, 0x80 + cmp r6, 0x3E + bls _0812572C + mov r0, r9 + strh r0, [r4] + mov r1, r10 + ldr r0, [r1] + adds r4, r0, r5 + ldrh r0, [r4] + strh r0, [r3] + mov r2, r9 + strh r2, [r4] + movs r6, 0x1 + adds r4, 0x80 + movs r0, 0x80 + lsls r0, 8 + mov r8, r0 +_08125774: + ldrh r0, [r4] + mov r1, r8 + ands r0, r1 + adds r5, r4, 0 + adds r5, 0x80 + cmp r0, 0 + bne _08125794 + mov r0, sp + adds r1, r4, 0 + adds r2, r5, 0 + str r3, [sp, 0x4] + bl sub_8125F38 + strh r0, [r4] + ldr r3, [sp, 0x4] + strh r0, [r3] +_08125794: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r4, r5, 0 + cmp r6, 0x3E + bls _08125774 + mov r2, r9 + strh r2, [r4] + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x3F + bls _08125716 + ldr r0, =0x03006168 + ldr r4, [r0] + movs r6, 0 + movs r0, 0x80 + lsls r0, 8 + mov r8, r0 +_081257BA: + movs r7, 0 + adds r5, r6, 0x1 +_081257BE: + ldrh r0, [r4] + mov r1, r8 + ands r0, r1 + cmp r0, 0 + bne _081257D0 + adds r0, r4, 0 + bl sub_8125CC8 + strh r0, [r4] +_081257D0: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + adds r4, 0x2 + cmp r7, 0x3F + bls _081257BE + lsls r0, r5, 24 + lsrs r6, r0, 24 + cmp r6, 0x3F + bls _081257BA + 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_81256C8 + + thumb_func_start sub_81257F8 +sub_81257F8: @ 81257F8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + movs r2, 0 + ldr r0, =0x0300616c + ldrb r0, [r0] + cmp r2, r0 + bcs _0812587A + ldr r0, =0x03006168 + mov r8, r0 +_0812580E: + ldr r0, =0x03006178 + ldrb r1, [r0] + adds r1, r2 + ldr r0, =0x03006180 + ldrb r0, [r0] + muls r0, r1 + lsls r0, 1 + mov r3, r8 + ldr r1, [r3] + adds r1, r0 + ldr r0, =0x03006164 + ldrb r0, [r0] + lsls r0, 1 + adds r4, r1, r0 + ldrh r1, [r4] + mov r0, sp + strh r1, [r0] + movs r5, 0x1 + adds r4, 0x2 + ldr r0, =0x03006174 + ldrb r0, [r0] + subs r0, 0x1 + adds r6, r2, 0x1 + cmp r5, r0 + bge _0812586E + movs r0, 0x80 + lsls r0, 8 + adds r7, r0, 0 +_08125846: + ldrh r0, [r4] + ands r0, r7 + cmp r0, 0 + bne _0812585C + mov r0, sp + adds r1, r4, 0 + bl sub_8125CF4 + strh r0, [r4] + mov r1, sp + strh r0, [r1] +_0812585C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x2 + ldr r0, =0x03006174 + ldrb r0, [r0] + subs r0, 0x1 + cmp r5, r0 + blt _08125846 +_0812586E: + lsls r0, r6, 24 + lsrs r2, r0, 24 + ldr r0, =0x0300616c + ldrb r0, [r0] + cmp r2, r0 + bcc _0812580E +_0812587A: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81257F8 + + thumb_func_start sub_81258A0 +sub_81258A0: @ 81258A0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + movs r2, 0 + ldr r0, =0x03006174 + ldrb r0, [r0] + cmp r2, r0 + bcs _0812592E + ldr r0, =0x03006168 + mov r8, r0 + ldr r7, =0x03006180 +_081258B8: + ldr r0, =0x03006178 + ldrb r1, [r0] + ldrb r0, [r7] + muls r0, r1 + lsls r0, 1 + mov r3, r8 + ldr r1, [r3] + adds r1, r0 + ldr r0, =0x03006164 + ldrb r0, [r0] + adds r0, r2 + lsls r0, 1 + adds r4, r1, r0 + ldrh r1, [r4] + mov r0, sp + strh r1, [r0] + movs r5, 0x1 + ldrb r0, [r7] + lsls r0, 1 + adds r4, r0 + ldr r0, =0x0300616c + ldrb r0, [r0] + subs r0, 0x1 + adds r6, r2, 0x1 + cmp r5, r0 + bge _08125922 + movs r0, 0x80 + lsls r0, 8 + adds r2, r0, 0 +_081258F2: + ldrh r0, [r4] + ands r0, r2 + cmp r0, 0 + bne _0812590C + mov r0, sp + adds r1, r4, 0 + str r2, [sp, 0x4] + bl sub_8125CF4 + strh r0, [r4] + mov r1, sp + strh r0, [r1] + ldr r2, [sp, 0x4] +_0812590C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r0, [r7] + lsls r0, 1 + adds r4, r0 + ldr r0, =0x0300616c + ldrb r0, [r0] + subs r0, 0x1 + cmp r5, r0 + blt _081258F2 +_08125922: + lsls r0, r6, 24 + lsrs r2, r0, 24 + ldr r0, =0x03006174 + ldrb r0, [r0] + cmp r2, r0 + bcc _081258B8 +_0812592E: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81258A0 + + thumb_func_start sub_8125954 +sub_8125954: @ 8125954 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + mov r2, sp + ldr r3, =gUnknown_085A1F94 + lsls r1, r0, 1 + add r1, r10 + adds r0, r1, r3 + ldrb r0, [r0] + strb r0, [r2] + adds r0, r3, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + strb r0, [r2, 0x1] + mov r5, sp + adds r0, r3, 0x2 + adds r1, r0 + ldrb r4, [r1] + lsls r2, r4, 24 + lsrs r1, r2, 27 + movs r0, 0x7 + ands r1, r0 + strh r1, [r5, 0x2] + lsrs r2, 25 + mov r9, r2 + movs r0, 0x3 + ands r2, r0 + mov r9, r2 + movs r5, 0x1 + ands r5, r4 + movs r4, 0x1 + mov r8, r4 + cmp r8, r1 + bcs _08125A06 + mov r3, sp +_081259A6: + cmp r5, 0 + bne _081259C4 + mov r0, r8 + lsls r2, r0, 2 + mov r4, sp + adds r1, r4, r2 + ldrb r0, [r3] + mov r4, r8 + subs r0, r4 + strb r0, [r1] + ldrb r0, [r3, 0x1] + add r0, r8 + b _081259D6 + .pool +_081259C4: + mov r0, r8 + lsls r2, r0, 2 + mov r4, sp + adds r1, r4, r2 + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r1] + ldrb r0, [r3, 0x1] + subs r0, 0x1 +_081259D6: + strb r0, [r1, 0x1] + add r2, sp + ldrb r0, [r2] + cmp r0, 0x3F + bhi _081259E6 + ldrb r0, [r2, 0x1] + cmp r0, 0x3F + bls _081259EE +_081259E6: + mov r0, r8 + subs r0, 0x1 + strh r0, [r3, 0x2] + b _08125A06 +_081259EE: + ldrh r0, [r3, 0x2] + mov r1, r8 + subs r0, r1 + strh r0, [r2, 0x2] + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrh r0, [r3, 0x2] + cmp r8, r0 + bcc _081259A6 +_08125A06: + movs r2, 0 + mov r8, r2 + mov r0, sp + ldrh r0, [r0, 0x2] + cmp r8, r0 + bcc _08125A14 + b _08125B16 +_08125A14: + movs r3, 0x1F +_08125A16: + ldr r1, =0x03006168 + mov r4, r8 + lsls r0, r4, 2 + mov r2, sp + adds r6, r2, r0 + ldrb r0, [r6, 0x1] + lsls r0, 7 + ldr r1, [r1] + adds r1, r0 + ldrb r0, [r6] + lsls r0, 1 + adds r2, r1, r0 + ldrh r1, [r2] + movs r4, 0x80 + lsls r4, 8 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _08125B02 + movs r7, 0x1F + ands r7, r1 + lsls r0, r1, 16 + lsrs r5, r0, 21 + ands r5, r3 + lsrs r4, r0, 26 + ands r4, r3 + mov r0, r9 + cmp r0, 0 + blt _08125AF8 + cmp r0, 0x1 + ble _08125A78 + cmp r0, 0x3 + bgt _08125AF8 + ldrh r0, [r6, 0x2] + adds r1, r7, r0 + lsls r1, 16 + lsrs r7, r1, 16 + adds r1, r5, r0 + lsls r1, 16 + lsrs r5, r1, 16 + adds r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r7, 0x1F + bls _08125AEC + movs r7, 0x1F + b _08125AEC + .pool +_08125A78: + mov r1, r10 + lsls r0, r1, 1 + add r0, r10 + ldr r1, =gUnknown_085A1F94 + adds r1, 0x2 + adds r0, r1 + ldrb r0, [r0] + lsrs r0, 3 + movs r1, 0x7 + ands r0, r1 + movs r1, 0x3 + str r2, [sp, 0x18] + str r3, [sp, 0x1C] + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x18] + ldr r3, [sp, 0x1C] + cmp r0, 0x1 + beq _08125AC8 + cmp r0, 0x1 + bgt _08125AB0 + cmp r0, 0 + beq _08125AB6 + b _08125AF8 + .pool +_08125AB0: + cmp r0, 0x2 + beq _08125ADA + b _08125AF8 +_08125AB6: + ldrh r0, [r6, 0x2] + cmp r7, r0 + bcc _08125AC4 + subs r0, r7, r0 + lsls r0, 16 + lsrs r7, r0, 16 + b _08125AF8 +_08125AC4: + movs r7, 0 + b _08125AF8 +_08125AC8: + ldrh r0, [r6, 0x2] + cmp r5, r0 + bcc _08125AD6 + subs r0, r5, r0 + lsls r0, 16 + lsrs r5, r0, 16 + b _08125AF8 +_08125AD6: + movs r5, 0 + b _08125AF8 +_08125ADA: + ldrh r0, [r6, 0x2] + cmp r4, r0 + bcc _08125AE8 + subs r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 + b _08125AF8 +_08125AE8: + movs r4, 0 + b _08125AF8 +_08125AEC: + cmp r5, 0x1F + bls _08125AF2 + movs r5, 0x1F +_08125AF2: + cmp r4, 0x1F + bls _08125AF8 + movs r4, 0x1F +_08125AF8: + lsls r0, r4, 10 + lsls r1, r5, 5 + orrs r0, r1 + orrs r7, r0 + strh r7, [r2] +_08125B02: + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r0, sp + ldrh r0, [r0, 0x2] + cmp r8, r0 + bcs _08125B16 + b _08125A16 +_08125B16: + 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_8125954 + + thumb_func_start sub_8125B28 +sub_8125B28: @ 8125B28 + ldrh r2, [r0] + movs r0, 0x1F + adds r1, r2, 0 + ands r1, r0 + asrs r3, r2, 5 + ands r3, r0 + asrs r2, 10 + ands r2, r0 + movs r0, 0x4C + muls r1, r0 + movs r0, 0x97 + muls r0, r3 + adds r1, r0 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r2 + adds r1, r0 + asrs r1, 8 + lsls r0, r1, 10 + lsls r2, r1, 5 + orrs r0, r2 + orrs r0, r1 + lsls r0, 16 + lsrs r0, 16 + bx lr + thumb_func_end sub_8125B28 + + thumb_func_start sub_8125B5C +sub_8125B5C: @ 8125B5C + push {r4,lr} + lsls r1, 24 + lsrs r4, r1, 24 + ldrh r0, [r0] + movs r2, 0x1F + movs r1, 0x1F + ands r1, r0 + lsls r0, 16 + lsrs r3, r0, 21 + ands r3, r2 + lsrs r0, 26 + ands r0, r2 + cmp r1, 0x10 + bhi _08125B8C + cmp r3, 0x10 + bhi _08125B8C + cmp r0, 0x10 + bhi _08125B8C + adds r0, r4, 0 + bl sub_8125B98 + lsls r0, 16 + lsrs r0, 16 + b _08125B8E +_08125B8C: + ldr r0, =0x00007fff +_08125B8E: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8125B5C + + thumb_func_start sub_8125B98 +sub_8125B98: @ 8125B98 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + mov r8, r0 + movs r6, 0 + movs r7, 0 + adds r0, r4, 0 + movs r1, 0x6 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bhi _08125C50 + lsls r0, 2 + ldr r1, =_08125BE0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08125BE0: + .4byte _08125BF8 + .4byte _08125C08 + .4byte _08125C18 + .4byte _08125C26 + .4byte _08125C34 + .4byte _08125C42 +_08125BF8: + movs r0, 0x15 + subs r0, r5 + lsls r0, 16 + lsrs r6, r0, 16 + adds r7, r6, 0 + movs r1, 0 + mov r8, r1 + b _08125C50 +_08125C08: + movs r7, 0 + movs r0, 0x15 + subs r0, r5 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + mov r6, r8 + b _08125C50 +_08125C18: + movs r0, 0x15 + subs r0, r5 + lsls r0, 16 + lsrs r7, r0, 16 + movs r6, 0 + mov r8, r7 + b _08125C50 +_08125C26: + movs r7, 0 + movs r6, 0 + movs r0, 0x17 + subs r0, r5 + lsls r0, 16 + lsrs r0, 16 + b _08125C4E +_08125C34: + movs r0, 0x17 + subs r0, r5 + lsls r0, 16 + lsrs r7, r0, 16 + movs r6, 0 + mov r8, r6 + b _08125C50 +_08125C42: + movs r7, 0 + movs r0, 0x17 + subs r0, r5 + lsls r0, 16 + lsrs r6, r0, 16 + movs r0, 0 +_08125C4E: + mov r8, r0 +_08125C50: + lsls r0, r7, 10 + lsls r1, r6, 5 + orrs r0, r1 + mov r1, r8 + orrs r1, r0 + lsls r0, r1, 16 + lsrs r0, 16 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8125B98 + + thumb_func_start sub_8125C68 +sub_8125C68: @ 8125C68 + push {lr} + ldrh r0, [r0] + movs r2, 0x1F + movs r1, 0x1F + ands r1, r0 + lsls r0, 16 + lsrs r3, r0, 21 + ands r3, r2 + lsrs r0, 26 + ands r0, r2 + cmp r1, 0x10 + bhi _08125C8C + cmp r3, 0x10 + bhi _08125C8C + cmp r0, 0x10 + bhi _08125C8C + movs r0, 0 + b _08125C8E +_08125C8C: + ldr r0, =0x00007fff +_08125C8E: + pop {r1} + bx r1 + .pool + thumb_func_end sub_8125C68 + + thumb_func_start sub_8125C98 +sub_8125C98: @ 8125C98 + push {r4,lr} + adds r4, r0, 0 + ldrh r3, [r4] + cmp r3, 0 + beq _08125CC0 + movs r2, 0x80 + lsls r2, 8 + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + beq _08125CB2 + adds r0, r2, 0 + b _08125CC2 +_08125CB2: + ldrh r1, [r1] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08125CC0 + ldrh r0, [r4] + b _08125CC2 +_08125CC0: + movs r0, 0 +_08125CC2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8125C98 + + thumb_func_start sub_8125CC8 +sub_8125CC8: @ 8125CC8 + push {r4,lr} + ldrh r1, [r0] + movs r0, 0x1F + movs r3, 0x1F + ands r3, r1 + lsls r1, 16 + lsrs r2, r1, 21 + lsrs r1, 26 + subs r3, r0, r3 + adds r4, r0, 0 + bics r4, r2 + adds r2, r4, 0 + bics r0, r1 + lsls r0, 10 + lsls r2, 5 + orrs r0, r2 + orrs r0, r3 + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8125CC8 + + thumb_func_start sub_8125CF4 +sub_8125CF4: @ 8125CF4 + push {r4-r7,lr} + sub sp, 0x14 + adds r7, r1, 0 + ldrh r4, [r0] + ldrh r5, [r7] + lsls r6, r4, 16 + lsls r0, r5, 16 + mov r12, r0 + cmp r4, r5 + beq _08125D66 + mov r2, sp + movs r3, 0x1F + movs r1, 0x1F + adds r0, r1, 0 + ands r0, r4 + strh r0, [r2] + lsrs r0, r6, 21 + ands r0, r3 + strh r0, [r2, 0x2] + lsrs r0, r6, 26 + ands r0, r3 + strh r0, [r2, 0x4] + mov r0, sp + ands r1, r5 + strh r1, [r0, 0x6] + mov r1, sp + mov r2, r12 + lsrs r0, r2, 21 + ands r0, r3 + strh r0, [r1, 0x8] + lsrs r0, r2, 26 + ands r0, r3 + strh r0, [r1, 0xA] + mov r0, sp + ldrh r0, [r0] + cmp r0, 0x19 + bls _08125D4E + mov r0, sp + ldrh r0, [r0, 0x2] + cmp r0, 0x19 + bls _08125D4E + mov r0, sp + ldrh r0, [r0, 0x4] + cmp r0, 0x19 + bhi _08125D66 +_08125D4E: + mov r0, sp + ldrh r0, [r0, 0x6] + cmp r0, 0x19 + bls _08125D6A + mov r0, sp + ldrh r0, [r0, 0x8] + cmp r0, 0x19 + bls _08125D6A + mov r0, sp + ldrh r0, [r0, 0xA] + cmp r0, 0x19 + bls _08125D6A +_08125D66: + ldrh r0, [r7] + b _08125E10 +_08125D6A: + movs r4, 0 + add r6, sp, 0xC + mov r7, sp + adds r7, 0x6 + adds r5, r6, 0 +_08125D74: + lsls r2, r4, 1 + mov r1, sp + adds r0, r1, r2 + adds r1, r7, r2 + ldrh r3, [r0] + ldrh r0, [r1] + cmp r3, r0 + bls _08125D8A + adds r1, r5, r2 + subs r0, r3, r0 + b _08125D8E +_08125D8A: + adds r1, r5, r2 + subs r0, r3 +_08125D8E: + strh r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _08125D74 + adds r1, r6, 0 + ldrh r0, [r1, 0x2] + ldrh r3, [r1] + cmp r3, r0 + bcc _08125DB4 + ldrh r2, [r1, 0x4] + cmp r3, r2 + bcc _08125DAE + adds r2, r3, 0 + b _08125DC8 +_08125DAE: + cmp r0, r2 + bcs _08125DBA + b _08125DC2 +_08125DB4: + ldrh r2, [r1, 0x4] + cmp r0, r2 + bcc _08125DBE +_08125DBA: + ldrh r2, [r1, 0x2] + b _08125DC8 +_08125DBE: + cmp r2, r3 + bcc _08125DC6 +_08125DC2: + ldrh r2, [r1, 0x4] + b _08125DC8 +_08125DC6: + ldrh r2, [r6] +_08125DC8: + mov r0, sp + ldrh r1, [r0, 0x6] + lsrs r0, r2, 1 + movs r6, 0x1F + subs r6, r0 + adds r0, r1, 0 + muls r0, r6 + movs r1, 0x1F + bl __divsi3 + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + mov r0, sp + ldrh r0, [r0, 0x8] + muls r0, r6 + movs r1, 0x1F + bl __divsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, sp + ldrh r0, [r0, 0xA] + muls r0, r6 + movs r1, 0x1F + bl __divsi3 + lsls r0, 16 + lsrs r0, 6 + lsls r4, 5 + orrs r0, r4 + orrs r5, r0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r5, 0 +_08125E10: + add sp, 0x14 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8125CF4 + + thumb_func_start sub_8125E18 +sub_8125E18: @ 8125E18 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r3, r0, 0 + mov r10, r1 + str r2, [sp] + ldrh r1, [r3] + mov r0, r10 + ldrh r0, [r0] + cmp r1, r0 + bne _08125E40 + ldrh r0, [r2] + cmp r0, r1 + bne _08125E40 + mov r1, r10 + ldrh r0, [r1] + b _08125F28 +_08125E40: + mov r2, r10 + ldrh r0, [r2] + movs r1, 0x1F + mov r9, r1 + movs r4, 0x1F + adds r5, r4, 0 + ands r5, r0 + lsls r0, 16 + lsrs r2, r0, 21 + mov r1, r9 + ands r1, r2 + mov r8, r1 + lsrs r0, 26 + mov r2, r9 + ands r2, r0 + str r2, [sp, 0x4] + ldrh r2, [r3] + adds r0, r4, 0 + ands r0, r2 + lsls r2, 16 + lsrs r1, r2, 21 + mov r3, r9 + ands r1, r3 + adds r0, r1 + lsrs r2, 26 + ands r2, r3 + adds r0, r2 + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + lsrs r7, r0, 16 + mov r1, r8 + adds r0, r5, r1 + ldr r2, [sp, 0x4] + adds r0, r2 + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r3, [sp] + ldrh r1, [r3] + ands r4, r1 + lsls r1, 16 + lsrs r0, r1, 21 + mov r2, r9 + ands r0, r2 + adds r4, r0 + lsrs r1, 26 + ands r1, r2 + adds r4, r1 + adds r0, r4, 0 + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r7, r6 + bne _08125EC2 + cmp r1, r6 + bne _08125EC2 + mov r3, r10 + ldrh r0, [r3] + b _08125F28 +_08125EC2: + cmp r7, r6 + bls _08125ECA + subs r0, r7, r6 + b _08125ECC +_08125ECA: + subs r0, r6, r7 +_08125ECC: + lsls r0, 16 + lsrs r2, r0, 16 + cmp r1, r6 + bls _08125ED8 + subs r0, r1, r6 + b _08125EDA +_08125ED8: + subs r0, r6, r1 +_08125EDA: + lsls r0, 16 + lsrs r0, 16 + cmp r2, r0 + bcc _08125EE4 + adds r0, r2, 0 +_08125EE4: + lsrs r0, 1 + movs r4, 0x1F + subs r4, r0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + muls r0, r4 + movs r1, 0x1F + bl __divsi3 + lsls r0, 16 + lsrs r5, r0, 16 + mov r0, r8 + muls r0, r4 + movs r1, 0x1F + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r1, [sp, 0x4] + adds r0, r1, 0 + muls r0, r4 + movs r1, 0x1F + bl __divsi3 + lsls r0, 16 + lsrs r0, 6 + mov r2, r8 + lsls r1, r2, 5 + orrs r0, r1 + orrs r5, r0 + lsls r0, r5, 16 + lsrs r0, 16 +_08125F28: + 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_8125E18 + + thumb_func_start sub_8125F38 +sub_8125F38: @ 8125F38 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r3, r0, 0 + mov r10, r1 + str r2, [sp] + ldrh r1, [r3] + mov r0, r10 + ldrh r0, [r0] + cmp r1, r0 + bne _08125F60 + ldrh r0, [r2] + cmp r0, r1 + bne _08125F60 + mov r1, r10 + ldrh r0, [r1] + b _08126046 +_08125F60: + mov r2, r10 + ldrh r0, [r2] + movs r1, 0x1F + mov r9, r1 + movs r4, 0x1F + adds r5, r4, 0 + ands r5, r0 + lsls r0, 16 + lsrs r2, r0, 21 + mov r1, r9 + ands r1, r2 + mov r8, r1 + lsrs r0, 26 + mov r2, r9 + ands r2, r0 + str r2, [sp, 0x4] + ldrh r2, [r3] + adds r0, r4, 0 + ands r0, r2 + lsls r2, 16 + lsrs r1, r2, 21 + mov r3, r9 + ands r1, r3 + adds r0, r1 + lsrs r2, 26 + ands r2, r3 + adds r0, r2 + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + lsrs r7, r0, 16 + mov r1, r8 + adds r0, r5, r1 + ldr r2, [sp, 0x4] + adds r0, r2 + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r3, [sp] + ldrh r1, [r3] + ands r4, r1 + lsls r1, 16 + lsrs r0, r1, 21 + mov r2, r9 + ands r0, r2 + adds r4, r0 + lsrs r1, 26 + ands r1, r2 + adds r4, r1 + adds r0, r4, 0 + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r7, r6 + bne _08125FE2 + cmp r1, r6 + bne _08125FE2 + mov r3, r10 + ldrh r0, [r3] + b _08126046 +_08125FE2: + cmp r7, r6 + bls _08125FEA + subs r0, r7, r6 + b _08125FEC +_08125FEA: + subs r0, r6, r7 +_08125FEC: + lsls r0, 16 + lsrs r2, r0, 16 + cmp r1, r6 + bls _08125FF8 + subs r0, r1, r6 + b _08125FFA +_08125FF8: + subs r0, r6, r1 +_08125FFA: + lsls r0, 16 + lsrs r0, 16 + cmp r2, r0 + bcc _08126004 + adds r0, r2, 0 +_08126004: + movs r4, 0x1F + subs r4, r0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + muls r0, r4 + movs r1, 0x1F + bl __divsi3 + lsls r0, 16 + lsrs r5, r0, 16 + mov r0, r8 + muls r0, r4 + movs r1, 0x1F + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r1, [sp, 0x4] + adds r0, r1, 0 + muls r0, r4 + movs r1, 0x1F + bl __divsi3 + lsls r0, 16 + lsrs r0, 6 + mov r2, r8 + lsls r1, r2, 5 + orrs r0, r1 + orrs r5, r0 + lsls r0, r5, 16 + lsrs r0, 16 +_08126046: + 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_8125F38 + + thumb_func_start sub_8126058 +sub_8126058: @ 8126058 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldrb r1, [r0, 0x1D] + lsrs r5, r1, 3 + ldrb r1, [r0, 0x1E] + lsrs r1, 3 + str r1, [sp, 0x8] + ldr r1, [r0, 0x4] + str r1, [sp] + ldr r2, [r0, 0x10] + str r2, [sp, 0x4] + ldrh r0, [r0, 0x16] + cmp r0, 0x2 + bne _08126108 + movs r1, 0 + ldr r0, [sp, 0x8] + cmp r1, r0 + bcc _08126086 + b _08126194 +_08126086: + movs r0, 0 + adds r2, r1, 0x1 + mov r10, r2 + cmp r0, r5 + bcs _081260FA + adds r2, r1, 0 + muls r2, r5 + mov r9, r2 + lsls r1, 3 + mov r8, r1 +_0812609A: + movs r4, 0 + lsls r6, r0, 4 + adds r7, r0, 0x1 + add r0, r9 + lsls r0, 6 + ldr r1, [sp, 0x4] + adds r1, r0 + mov r12, r1 +_081260AA: + lsls r0, r4, 3 + mov r2, r12 + adds r3, r2, r0 + mov r1, r8 + adds r0, r1, r4 + lsls r0, 3 + muls r0, r5 + lsls r0, 1 + ldr r2, [sp] + adds r0, r2, r0 + adds r2, r0, r6 + ldrh r0, [r2, 0x2] + lsls r0, 8 + ldrh r1, [r2] + orrs r0, r1 + strh r0, [r3] + ldrh r0, [r2, 0x6] + lsls r0, 8 + ldrh r1, [r2, 0x4] + orrs r0, r1 + strh r0, [r3, 0x2] + ldrh r0, [r2, 0xA] + lsls r0, 8 + ldrh r1, [r2, 0x8] + orrs r0, r1 + strh r0, [r3, 0x4] + ldrh r0, [r2, 0xE] + lsls r0, 8 + ldrh r1, [r2, 0xC] + orrs r0, r1 + strh r0, [r3, 0x6] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x7 + bls _081260AA + lsls r0, r7, 16 + lsrs r0, 16 + cmp r0, r5 + bcc _0812609A +_081260FA: + mov r1, r10 + lsls r0, r1, 16 + lsrs r1, r0, 16 + ldr r2, [sp, 0x8] + cmp r1, r2 + bcc _08126086 + b _08126194 +_08126108: + movs r1, 0 + ldr r0, [sp, 0x8] + cmp r1, r0 + bcs _08126194 +_08126110: + movs r0, 0 + adds r2, r1, 0x1 + mov r10, r2 + cmp r0, r5 + bcs _08126188 + adds r2, r1, 0 + muls r2, r5 + mov r9, r2 + lsls r1, 3 + mov r8, r1 +_08126124: + movs r4, 0 + lsls r6, r0, 4 + adds r7, r0, 0x1 + add r0, r9 + lsls r0, 5 + ldr r1, [sp, 0x4] + adds r1, r0 + mov r12, r1 +_08126134: + lsls r0, r4, 2 + mov r2, r12 + adds r3, r2, r0 + mov r1, r8 + adds r0, r1, r4 + lsls r0, 3 + muls r0, r5 + lsls r0, 1 + ldr r2, [sp] + adds r0, r2, r0 + adds r2, r0, r6 + ldrh r1, [r2, 0x2] + lsls r1, 4 + ldrh r0, [r2] + orrs r1, r0 + ldrh r0, [r2, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrh r0, [r2, 0x6] + lsls r0, 12 + orrs r1, r0 + strh r1, [r3] + ldrh r1, [r2, 0xA] + lsls r1, 4 + ldrh r0, [r2, 0x8] + orrs r1, r0 + ldrh r0, [r2, 0xC] + lsls r0, 8 + orrs r1, r0 + ldrh r0, [r2, 0xE] + lsls r0, 12 + orrs r1, r0 + strh r1, [r3, 0x2] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x7 + bls _08126134 + lsls r0, r7, 16 + lsrs r0, 16 + cmp r0, r5 + bcc _08126124 +_08126188: + mov r1, r10 + lsls r0, r1, 16 + lsrs r1, r0, 16 + ldr r2, [sp, 0x8] + cmp r1, r2 + bcc _08126110 +_08126194: + 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_8126058 + + thumb_func_start sub_81261A4 +sub_81261A4: @ 81261A4 + push {lr} + ldr r2, =0x03006188 + ldrb r1, [r0, 0x18] + lsls r1, 4 + strh r1, [r2] + ldr r3, =0x03006184 + ldrh r2, [r2] + lsls r2, 1 + ldr r1, [r0, 0x8] + adds r1, r2 + str r1, [r3] + ldr r2, =0x03006168 + ldr r1, [r0, 0x4] + str r1, [r2] + ldr r2, =0x03006164 + ldrb r1, [r0, 0x19] + strb r1, [r2] + ldr r2, =0x03006178 + ldrb r1, [r0, 0x1A] + strb r1, [r2] + ldr r2, =0x03006174 + ldrb r1, [r0, 0x1B] + strb r1, [r2] + ldr r2, =0x0300616c + ldrb r1, [r0, 0x1C] + strb r1, [r2] + ldr r2, =0x03006180 + ldrb r1, [r0, 0x1D] + strb r1, [r2] + ldr r2, =0x03006170 + ldrb r1, [r0, 0x1E] + strb r1, [r2] + ldrh r0, [r0, 0x14] + cmp r0, 0x5 + bhi _0812626A + lsls r0, 2 + ldr r1, =_0812621C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0812621C: + .4byte _08126234 + .4byte _0812623C + .4byte _08126244 + .4byte _0812624E + .4byte _08126258 + .4byte _08126262 +_08126234: + movs r0, 0 + bl sub_81263A4 + b _0812626A +_0812623C: + movs r0, 0x1 + bl sub_81263A4 + b _0812626A +_08126244: + bl sub_8126270 + bl sub_8126714 + b _0812626A +_0812624E: + bl sub_8126370 + bl sub_8126664 + b _0812626A +_08126258: + bl sub_8126334 + bl sub_81265B4 + b _0812626A +_08126262: + bl sub_8126318 + bl sub_81264FC +_0812626A: + pop {r0} + bx r0 + thumb_func_end sub_81261A4 + + thumb_func_start sub_8126270 +sub_8126270: @ 8126270 + ldr r2, =0x03006184 + ldr r1, [r2] + movs r0, 0 + strh r0, [r1] + ldr r0, [r2] + ldr r2, =0x000018c6 + adds r1, r2, 0 + strh r1, [r0, 0x2] + ldr r2, =0x000077bd + adds r1, r2, 0 + strh r1, [r0, 0x4] + ldr r2, =0x00002d6b + adds r1, r2, 0 + strh r1, [r0, 0x6] + ldr r2, =0x000018dd + adds r1, r2, 0 + strh r1, [r0, 0x8] + ldr r2, =0x00001ba6 + adds r1, r2, 0 + strh r1, [r0, 0xA] + ldr r2, =0x000074c6 + adds r1, r2, 0 + strh r1, [r0, 0xC] + ldr r2, =0x00001bbd + adds r1, r2, 0 + strh r1, [r0, 0xE] + ldr r2, =0x000074dd + adds r1, r2, 0 + strh r1, [r0, 0x10] + ldr r2, =0x000077a6 + adds r1, r2, 0 + strh r1, [r0, 0x12] + ldr r2, =0x0000197d + adds r1, r2, 0 + strh r1, [r0, 0x14] + ldr r2, =0x00001bab + adds r1, r2, 0 + strh r1, [r0, 0x16] + ldr r2, =0x00007566 + adds r1, r2, 0 + strh r1, [r0, 0x18] + ldr r2, =0x00002cdd + adds r1, r2, 0 + strh r1, [r0, 0x1A] + ldr r2, =0x00002fa6 + adds r1, r2, 0 + strh r1, [r0, 0x1C] + ldr r2, =0x000074cb + adds r1, r2, 0 + strh r1, [r0, 0x1E] + bx lr + .pool + thumb_func_end sub_8126270 + + thumb_func_start sub_8126318 +sub_8126318: @ 8126318 + ldr r2, =0x03006184 + ldr r0, [r2] + movs r1, 0 + strh r1, [r0] + ldr r2, [r2] + strh r1, [r2, 0x2] + ldr r1, =0x00007fff + adds r0, r1, 0 + strh r0, [r2, 0x4] + bx lr + .pool + thumb_func_end sub_8126318 + + thumb_func_start sub_8126334 +sub_8126334: @ 8126334 + push {r4,r5,lr} + ldr r1, =0x03006184 + ldr r0, [r1] + movs r2, 0 + strh r2, [r0] + ldr r0, [r1] + strh r2, [r0, 0x2] + movs r4, 0 + adds r5, r1, 0 +_08126346: + ldr r0, [r5] + lsls r2, r4, 1 + adds r2, r0 + adds r0, r4, 0x2 + lsls r3, r0, 1 + lsls r1, r0, 11 + lsls r0, 6 + orrs r1, r0 + orrs r1, r3 + strh r1, [r2, 0x4] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xD + bls _08126346 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8126334 + + thumb_func_start sub_8126370 +sub_8126370: @ 8126370 + push {r4,lr} + ldr r2, =0x03006184 + ldr r1, [r2] + movs r0, 0 + strh r0, [r1] + movs r3, 0 + adds r4, r2, 0 +_0812637E: + ldr r0, [r4] + lsls r2, r3, 1 + adds r2, r0 + lsls r0, r3, 10 + lsls r1, r3, 5 + orrs r0, r1 + orrs r0, r3 + strh r0, [r2, 0x2] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x1F + bls _0812637E + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8126370 + + thumb_func_start sub_81263A4 +sub_81263A4: @ 81263A4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + movs r1, 0xDF + mov r9, r1 + cmp r0, 0 + bne _081263BC + movs r2, 0xFF + mov r9, r2 +_081263BC: + movs r6, 0 + ldr r3, =0x03006184 + mov r12, r3 + mov r0, r9 + lsls r4, r0, 1 + ldr r5, =0x0300616c + cmp r6, r9 + bcs _081263E0 + movs r2, 0 +_081263CE: + ldr r0, [r3] + lsls r1, r6, 1 + adds r1, r0 + strh r2, [r1] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, r9 + bcc _081263CE +_081263E0: + mov r1, r12 + ldr r0, [r1] + adds r0, r4, r0 + ldr r2, =0x00003def + adds r1, r2, 0 + strh r1, [r0] + movs r3, 0 + ldrb r5, [r5] + cmp r3, r5 + bcs _081264E4 +_081263F4: + ldr r2, =0x03006168 + ldr r0, =0x03006178 + ldrb r1, [r0] + adds r1, r3 + ldr r0, =0x03006180 + ldrb r0, [r0] + muls r0, r1 + lsls r0, 1 + ldr r1, [r2] + adds r1, r0 + ldr r0, =0x03006164 + ldrb r0, [r0] + lsls r0, 1 + adds r4, r1, r0 + movs r6, 0 + ldr r0, =0x03006174 + adds r2, r0, 0 + adds r3, 0x1 + mov r10, r3 + ldrb r3, [r2] + cmp r6, r3 + bcs _081264D6 + ldr r0, =0x03006188 + mov r8, r0 +_08126424: + ldrh r0, [r4] + movs r3, 0x80 + lsls r3, 8 + adds r1, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08126464 + mov r1, r8 + ldrh r0, [r1] + strh r0, [r4] + adds r6, 0x1 + adds r7, r4, 0x2 + b _081264CA + .pool +_08126464: + adds r0, r4, 0 + bl sub_81267C4 + lsls r0, 16 + lsrs r5, r0, 16 + movs r3, 0x1 + adds r6, 0x1 + adds r7, r4, 0x2 + cmp r3, r9 + bcs _081264C0 + ldr r0, =0x03006184 + ldr r2, [r0] + ldrh r1, [r2, 0x2] + mov r12, r0 + cmp r1, 0 + bne _08126494 + strh r5, [r2, 0x2] + mov r2, r8 + ldrh r0, [r2] + adds r0, 0x1 + b _081264BE + .pool +_08126494: + mov r2, r12 + ldr r1, [r2] + lsls r0, r3, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r5 + beq _081264B8 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r9 + bcs _081264C0 + lsls r0, r3, 1 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, 0 + bne _08126494 + strh r5, [r1] +_081264B8: + mov r1, r8 + ldrh r0, [r1] + adds r0, r3 +_081264BE: + strh r0, [r4] +_081264C0: + ldr r2, =0x03006174 + cmp r3, r9 + bne _081264CA + mov r3, r9 + strh r3, [r4] +_081264CA: + lsls r0, r6, 24 + lsrs r6, r0, 24 + adds r4, r7, 0 + ldrb r0, [r2] + cmp r6, r0 + bcc _08126424 +_081264D6: + mov r1, r10 + lsls r0, r1, 24 + lsrs r3, r0, 24 + ldr r0, =0x0300616c + ldrb r0, [r0] + cmp r3, r0 + bcc _081263F4 +_081264E4: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81263A4 + + thumb_func_start sub_81264FC +sub_81264FC: @ 81264FC + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r2, 0 + ldr r0, =0x0300616c + ldrb r0, [r0] + cmp r2, r0 + bcs _081265A0 + ldr r0, =0x03006168 + mov r8, r0 +_08126510: + ldr r0, =0x03006178 + ldrb r1, [r0] + adds r1, r2 + ldr r0, =0x03006180 + ldrb r0, [r0] + muls r0, r1 + lsls r0, 1 + mov r3, r8 + ldr r1, [r3] + adds r1, r0 + ldr r0, =0x03006164 + ldrb r0, [r0] + lsls r0, 1 + adds r4, r1, r0 + movs r6, 0 + ldr r0, =0x03006174 + adds r3, r0, 0 + adds r7, r2, 0x1 + ldrb r0, [r3] + cmp r6, r0 + bcs _08126594 + ldr r5, =0x03006188 +_0812653C: + ldrh r0, [r4] + movs r2, 0x80 + lsls r2, 8 + adds r1, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0812656C + ldrh r0, [r5] + strh r0, [r4] + b _08126586 + .pool +_0812656C: + adds r0, r4, 0 + bl sub_8125C68 + lsls r0, 16 + cmp r0, 0 + bne _0812657E + ldrh r0, [r5] + adds r0, 0x1 + b _08126582 +_0812657E: + ldrh r0, [r5] + adds r0, 0x2 +_08126582: + strh r0, [r4] + ldr r3, =0x03006174 +_08126586: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r4, 0x2 + ldrb r0, [r3] + cmp r6, r0 + bcc _0812653C +_08126594: + lsls r0, r7, 24 + lsrs r2, r0, 24 + ldr r0, =0x0300616c + ldrb r0, [r0] + cmp r2, r0 + bcc _08126510 +_081265A0: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81264FC + + thumb_func_start sub_81265B4 +sub_81265B4: @ 81265B4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + movs r2, 0 + ldr r0, =0x0300616c + ldrb r0, [r0] + cmp r2, r0 + bcs _08126650 + ldr r0, =0x03006168 + mov r8, r0 +_081265CA: + ldr r0, =0x03006178 + ldrb r1, [r0] + adds r1, r2 + ldr r0, =0x03006180 + ldrb r0, [r0] + muls r0, r1 + lsls r0, 1 + mov r3, r8 + ldr r1, [r3] + adds r1, r0 + ldr r0, =0x03006164 + ldrb r0, [r0] + lsls r0, 1 + adds r4, r1, r0 + movs r5, 0 + ldr r0, =0x03006174 + adds r7, r2, 0x1 + ldrb r0, [r0] + cmp r5, r0 + bcs _08126644 + ldr r6, =0x03006188 + movs r0, 0x80 + lsls r0, 8 + adds r2, r0, 0 +_081265FA: + ldrh r0, [r4] + ands r0, r2 + cmp r0, 0 + beq _08126624 + ldrh r0, [r6] + strh r0, [r4] + b _08126634 + .pool +_08126624: + adds r0, r4, 0 + str r2, [sp] + bl sub_8126908 + ldrh r1, [r6] + adds r0, r1 + strh r0, [r4] + ldr r2, [sp] +_08126634: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x2 + ldr r0, =0x03006174 + ldrb r0, [r0] + cmp r5, r0 + bcc _081265FA +_08126644: + lsls r0, r7, 24 + lsrs r2, r0, 24 + ldr r0, =0x0300616c + ldrb r0, [r0] + cmp r2, r0 + bcc _081265CA +_08126650: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81265B4 + + thumb_func_start sub_8126664 +sub_8126664: @ 8126664 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + movs r2, 0 + ldr r0, =0x0300616c + ldrb r0, [r0] + cmp r2, r0 + bcs _08126700 + ldr r0, =0x03006168 + mov r8, r0 +_0812667A: + ldr r0, =0x03006178 + ldrb r1, [r0] + adds r1, r2 + ldr r0, =0x03006180 + ldrb r0, [r0] + muls r0, r1 + lsls r0, 1 + mov r3, r8 + ldr r1, [r3] + adds r1, r0 + ldr r0, =0x03006164 + ldrb r0, [r0] + lsls r0, 1 + adds r4, r1, r0 + movs r5, 0 + ldr r0, =0x03006174 + adds r7, r2, 0x1 + ldrb r0, [r0] + cmp r5, r0 + bcs _081266F4 + ldr r6, =0x03006188 + movs r0, 0x80 + lsls r0, 8 + adds r2, r0, 0 +_081266AA: + ldrh r0, [r4] + ands r0, r2 + cmp r0, 0 + beq _081266D4 + ldrh r0, [r6] + strh r0, [r4] + b _081266E4 + .pool +_081266D4: + adds r0, r4, 0 + str r2, [sp] + bl sub_812693C + ldrh r1, [r6] + adds r0, r1 + strh r0, [r4] + ldr r2, [sp] +_081266E4: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x2 + ldr r0, =0x03006174 + ldrb r0, [r0] + cmp r5, r0 + bcc _081266AA +_081266F4: + lsls r0, r7, 24 + lsrs r2, r0, 24 + ldr r0, =0x0300616c + ldrb r0, [r0] + cmp r2, r0 + bcc _0812667A +_08126700: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8126664 + + thumb_func_start sub_8126714 +sub_8126714: @ 8126714 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + movs r2, 0 + ldr r0, =0x0300616c + ldrb r0, [r0] + cmp r2, r0 + bcs _081267B0 + ldr r0, =0x03006168 + mov r8, r0 +_0812672A: + ldr r0, =0x03006178 + ldrb r1, [r0] + adds r1, r2 + ldr r0, =0x03006180 + ldrb r0, [r0] + muls r0, r1 + lsls r0, 1 + mov r3, r8 + ldr r1, [r3] + adds r1, r0 + ldr r0, =0x03006164 + ldrb r0, [r0] + lsls r0, 1 + adds r4, r1, r0 + movs r5, 0 + ldr r0, =0x03006174 + adds r7, r2, 0x1 + ldrb r0, [r0] + cmp r5, r0 + bcs _081267A4 + ldr r6, =0x03006188 + movs r0, 0x80 + lsls r0, 8 + adds r2, r0, 0 +_0812675A: + ldrh r0, [r4] + ands r0, r2 + cmp r0, 0 + beq _08126784 + ldrh r0, [r6] + strh r0, [r4] + b _08126794 + .pool +_08126784: + adds r0, r4, 0 + str r2, [sp] + bl sub_8126838 + ldrh r1, [r6] + adds r0, r1 + strh r0, [r4] + ldr r2, [sp] +_08126794: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x2 + ldr r0, =0x03006174 + ldrb r0, [r0] + cmp r5, r0 + bcc _0812675A +_081267A4: + lsls r0, r7, 24 + lsrs r2, r0, 24 + ldr r0, =0x0300616c + ldrb r0, [r0] + cmp r2, r0 + bcc _0812672A +_081267B0: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8126714 + + thumb_func_start sub_81267C4 +sub_81267C4: @ 81267C4 + push {r4,lr} + ldrh r0, [r0] + movs r1, 0x1F + movs r4, 0x1F + ands r4, r0 + lsls r0, 16 + lsrs r3, r0, 21 + ands r3, r1 + lsrs r2, r0, 26 + ands r2, r1 + movs r1, 0x3 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _081267E8 + movs r0, 0x1C + ands r0, r4 + adds r4, r0, 0x4 +_081267E8: + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _081267F6 + movs r0, 0x1C + ands r0, r3 + adds r3, r0, 0x4 +_081267F6: + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _08126804 + movs r0, 0x1C + ands r0, r2 + adds r2, r0, 0x4 +_08126804: + cmp r4, 0x5 + bhi _0812680A + movs r4, 0x6 +_0812680A: + cmp r4, 0x1E + bls _08126810 + movs r4, 0x1E +_08126810: + cmp r3, 0x5 + bhi _08126816 + movs r3, 0x6 +_08126816: + cmp r3, 0x1E + bls _0812681C + movs r3, 0x1E +_0812681C: + cmp r2, 0x5 + bhi _08126822 + movs r2, 0x6 +_08126822: + cmp r2, 0x1E + bls _08126828 + movs r2, 0x1E +_08126828: + lsls r0, r2, 10 + lsls r1, r3, 5 + orrs r0, r1 + orrs r4, r0 + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81267C4 + + thumb_func_start sub_8126838 +sub_8126838: @ 8126838 + push {lr} + ldrh r0, [r0] + movs r1, 0x1F + movs r3, 0x1F + ands r3, r0 + lsls r0, 16 + lsrs r2, r0, 21 + ands r2, r1 + lsrs r0, 26 + ands r0, r1 + cmp r3, 0xB + bhi _0812685C + cmp r2, 0xA + bhi _0812685C + cmp r0, 0xA + bhi _0812685C + movs r0, 0x1 + b _08126902 +_0812685C: + cmp r3, 0x13 + bls _08126880 + cmp r2, 0x13 + bls _08126868 + cmp r0, 0x13 + bhi _0812688C +_08126868: + cmp r3, 0x13 + bls _08126880 + cmp r2, 0x13 + bls _08126876 + cmp r0, 0xE + bhi _0812688C + b _081268C4 +_08126876: + cmp r0, 0x13 + bls _08126880 + cmp r2, 0xE + bhi _0812688C + b _081268A0 +_08126880: + cmp r2, 0x13 + bls _08126890 + cmp r0, 0x13 + bls _08126890 + cmp r3, 0xE + bls _081268E8 +_0812688C: + movs r0, 0x2 + b _08126902 +_08126890: + cmp r3, 0x13 + bls _081268B4 + cmp r2, 0xB + bls _081268A8 + cmp r0, 0xB + bls _081268A4 + cmp r2, r0 + bcs _081268C4 +_081268A0: + movs r0, 0x8 + b _08126902 +_081268A4: + movs r0, 0xA + b _08126902 +_081268A8: + cmp r0, 0xB + bls _081268B0 + movs r0, 0xD + b _08126902 +_081268B0: + movs r0, 0x4 + b _08126902 +_081268B4: + cmp r2, 0x13 + bls _081268D8 + cmp r3, 0xB + bls _081268CC + cmp r0, 0xB + bls _081268C8 + cmp r3, r0 + bcc _081268E8 +_081268C4: + movs r0, 0x7 + b _08126902 +_081268C8: + movs r0, 0xB + b _08126902 +_081268CC: + cmp r0, 0xB + bls _081268D4 + movs r0, 0xE + b _08126902 +_081268D4: + movs r0, 0x5 + b _08126902 +_081268D8: + cmp r0, 0x13 + bls _08126900 + cmp r3, 0xB + bls _081268EC + cmp r2, 0xB + bls _081268F4 + cmp r3, r2 + bcs _081268A0 +_081268E8: + movs r0, 0x9 + b _08126902 +_081268EC: + cmp r2, 0xB + bls _081268F4 + movs r0, 0xC + b _08126902 +_081268F4: + cmp r0, 0xB + bls _081268FC + movs r0, 0xF + b _08126902 +_081268FC: + movs r0, 0x6 + b _08126902 +_08126900: + movs r0, 0x3 +_08126902: + pop {r1} + bx r1 + thumb_func_end sub_8126838 + + thumb_func_start sub_8126908 +sub_8126908: @ 8126908 + push {lr} + ldrh r1, [r0] + movs r3, 0x1F + movs r0, 0x1F + ands r0, r1 + lsls r1, 16 + lsrs r2, r1, 21 + ands r2, r3 + lsrs r1, 26 + ands r1, r3 + adds r0, r2 + adds r0, r1 + movs r1, 0x3 + bl __divsi3 + movs r1, 0x1E + ands r0, r1 + lsls r0, 16 + cmp r0, 0 + beq _08126934 + lsrs r0, 17 + b _08126936 +_08126934: + movs r0, 0x1 +_08126936: + pop {r1} + bx r1 + thumb_func_end sub_8126908 + + thumb_func_start sub_812693C +sub_812693C: @ 812693C + push {lr} + ldrh r1, [r0] + movs r3, 0x1F + movs r0, 0x1F + ands r0, r1 + lsls r1, 16 + lsrs r2, r1, 21 + ands r2, r3 + lsrs r1, 26 + ands r1, r3 + adds r0, r2 + adds r0, r1 + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_812693C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/daycare.s b/asm/daycare.s new file mode 100644 index 000000000..40b212c95 --- /dev/null +++ b/asm/daycare.s @@ -0,0 +1,3193 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start pokemon_get_nick +pokemon_get_nick: @ 806FA2C + push {r4,lr} + sub sp, 0x14 + adds r4, r1, 0 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + adds r0, r4, 0 + mov r1, sp + bl CopyString_Limit10 + add sp, 0x14 + pop {r4} + pop {r1} + bx r1 + thumb_func_end pokemon_get_nick + + thumb_func_start pokemon_get_nick_ +pokemon_get_nick_: @ 806FA4C + push {r4,lr} + sub sp, 0x14 + adds r4, r1, 0 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr_encrypted + adds r0, r4, 0 + mov r1, sp + bl CopyString_Limit10 + add sp, 0x14 + pop {r4} + pop {r1} + bx r1 + thumb_func_end pokemon_get_nick_ + + thumb_func_start daycare_count_pokemon +daycare_count_pokemon: @ 806FA6C + push {r4-r6,lr} + adds r6, r0, 0 + movs r5, 0 + movs r4, 0 +_0806FA74: + movs r0, 0x8C + muls r0, r4 + adds r0, r6, r0 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _0806FA8A + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_0806FA8A: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0806FA74 + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end daycare_count_pokemon + + thumb_func_start sub_806FA9C +sub_806FA9C: @ 806FA9C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r0 + mov r10, r1 + movs r7, 0 + movs r5, 0 + mov r6, r10 + adds r6, 0x74 + movs r0, 0x1 + mov r8, r0 +_0806FAB6: + movs r0, 0x8C + muls r0, r5 + mov r1, r9 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _0806FAE4 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr_encrypted + adds r1, r0, 0 + cmp r1, 0 + bne _0806FAE4 + lsls r0, r5, 1 + adds r0, r6, r0 + b _0806FAEA +_0806FAE4: + lsls r0, r5, 1 + adds r0, r6, r0 + mov r1, r8 +_0806FAEA: + strh r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bls _0806FAB6 + mov r0, r10 + str r7, [r0, 0x70] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_806FA9C + + thumb_func_start daycare_empty_slot +@ u8 daycare_empty_slot(struct daycare_mon *dayCareMons) +daycare_empty_slot: @ 806FB08 + push {r4,r5,lr} + adds r5, r0, 0 + movs r4, 0 +_0806FB0E: + movs r0, 0x8C + muls r0, r4 + adds r0, r5, r0 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _0806FB24 + lsls r0, r4, 24 + asrs r0, 24 + b _0806FB32 +_0806FB24: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0806FB0E + movs r0, 0x1 + negs r0, r0 +_0806FB32: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end daycare_empty_slot + + thumb_func_start sub_806FB38 +@ void sub_806FB38(struct pokemon *mon, struct daycare_mon *dayCareMon) +sub_806FB38: @ 806FB38 + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + bl sub_80D43F0 + lsls r0, 24 + cmp r0, 0 + beq _0806FBBC + adds r0, r5, 0 + adds r0, 0x74 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + adds r4, r5, 0 + adds r4, 0x7C + adds r0, r6, 0 + adds r1, r4, 0 + bl pokemon_get_nick + adds r0, r4, 0 + bl StripExtendedControlCodes + adds r4, 0xB + ldrb r1, [r4] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + adds r0, r6, 0 + movs r1, 0x3 + bl pokemon_getattr + lsls r0, 4 + ldrb r2, [r4] + movs r1, 0xF + ands r1, r2 + orrs r1, r0 + strb r1, [r4] + adds r0, r6, 0 + movs r1, 0x40 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005d8c + ldr r1, [r1] + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + adds r1, r2 + adds r0, r5, 0 + adds r0, 0x50 + ldr r2, =0x00002be0 + adds r1, r2 + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + adds r0, r6, 0 + bl sub_80D4680 +_0806FBBC: + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x50 + bl memcpy + adds r0, r5, 0 + bl pokemon_restore_pp + adds r1, r5, 0 + adds r1, 0x88 + movs r0, 0 + str r0, [r1] + adds r0, r6, 0 + bl zero_pokemon_struct + bl party_compaction + bl calc_player_party_count + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806FB38 + + thumb_func_start daycare_send +@ void daycare_send(struct pokemon *mon, struct daycare_mon *dayCareMons) +daycare_send: @ 806FBF4 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl daycare_empty_slot + lsls r0, 24 + asrs r0, 24 + movs r1, 0x8C + muls r0, r1 + adds r4, r0 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_806FB38 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end daycare_send + + thumb_func_start daycare_send_selected_pokemon +daycare_send_selected_pokemon: @ 806FC18 + push {lr} + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x03005d8c + ldr r1, [r1] + ldr r2, =0x00003030 + adds r1, r2 + bl daycare_send + pop {r0} + bx r0 + .pool + thumb_func_end daycare_send_selected_pokemon + + thumb_func_start sub_806FC48 +sub_806FC48: @ 806FC48 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r5, 0 + adds r4, 0x8C + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _0806FC9E + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr_encrypted + adds r6, r0, 0 + cmp r6, 0 + bne _0806FC9E + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x50 + bl memcpy + adds r0, r4, 0 + bl zero_pokemon_boxed_data + adds r4, 0x50 + adds r0, r5, 0 + adds r0, 0x50 + adds r1, r4, 0 + movs r2, 0x38 + bl memcpy + adds r2, r5, 0 + adds r2, 0x88 + movs r0, 0x8A + lsls r0, 1 + adds r1, r5, r0 + ldr r0, [r1] + str r0, [r2] + str r6, [r1] + adds r0, r4, 0 + bl sub_806FF80 +_0806FC9E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_806FC48 + + thumb_func_start sub_806FCA4 +sub_806FCA4: @ 806FCA4 + push {r4-r7,lr} + adds r4, r0, 0 + movs r5, 0 + ldr r7, =0x0000ffff +_0806FCAC: + adds r0, r4, 0 + bl sub_806DF74 + lsls r0, 24 + cmp r0, 0 + beq _0806FCE8 + movs r6, 0x1 + adds r5, 0x1 + b _0806FCD4 + .pool +_0806FCC4: + movs r6, 0 + cmp r0, r7 + bne _0806FCD4 + ldr r0, =0x020244e2 + ldrh r1, [r0] + adds r0, r4, 0 + bl sub_8069424 +_0806FCD4: + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_8069318 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _0806FCC4 + cmp r5, 0x63 + ble _0806FCAC +_0806FCE8: + adds r0, r4, 0 + bl pokemon_calc_effective_stats + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806FCA4 + + thumb_func_start sub_806FCF8 +sub_806FCF8: @ 806FCF8 + push {r4-r7,lr} + sub sp, 0x68 + adds r5, r0, 0 + ldr r1, =0x02021cc4 + bl pokemon_get_nick_ + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr_encrypted + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r5, 0 + mov r1, sp + bl sub_8069004 + mov r0, sp + movs r1, 0x38 + bl pokemon_getattr + cmp r0, 0x64 + beq _0806FD46 + mov r0, sp + movs r1, 0x19 + bl pokemon_getattr + adds r1, r5, 0 + adds r1, 0x88 + ldr r1, [r1] + adds r0, r1 + str r0, [sp, 0x64] + add r2, sp, 0x64 + mov r0, sp + movs r1, 0x19 + bl pokemon_setattr + mov r0, sp + bl sub_806FCA4 +_0806FD46: + ldr r0, =0x020244ec + movs r1, 0xFA + lsls r1, 1 + adds r6, r0, r1 + adds r0, r6, 0 + mov r1, sp + movs r2, 0x64 + bl memcpy + adds r0, r5, 0 + adds r0, 0x70 + ldrh r0, [r0] + cmp r0, 0 + beq _0806FD74 + adds r4, r5, 0 + adds r4, 0x50 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80D460C + adds r0, r4, 0 + bl sub_806FF80 +_0806FD74: + adds r0, r5, 0 + bl zero_pokemon_boxed_data + adds r1, r5, 0 + adds r1, 0x88 + movs r0, 0 + str r0, [r1] + bl party_compaction + bl calc_player_party_count + adds r0, r7, 0 + add sp, 0x68 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806FCF8 + + thumb_func_start sub_806FD9C +sub_806FD9C: @ 806FD9C + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x8C + muls r0, r1 + adds r0, r5, r0 + bl sub_806FCF8 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl sub_806FC48 + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_806FD9C + + thumb_func_start sub_806FDC4 +sub_806FDC4: @ 806FDC4 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003030 + adds r0, r1 + ldr r1, =0x020375e0 + ldrb r1, [r1] + bl sub_806FD9C + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end sub_806FDC4 + + thumb_func_start sub_806FDEC +sub_806FDEC: @ 806FDEC + push {r4,r5,lr} + sub sp, 0x54 + adds r4, r0, 0 + adds r5, r1, 0 + mov r0, sp + adds r1, r4, 0 + movs r2, 0x50 + bl memcpy + adds r0, r4, 0 + movs r1, 0x19 + bl pokemon_getattr_encrypted + adds r0, r5 + str r0, [sp, 0x50] + add r2, sp, 0x50 + mov r0, sp + movs r1, 0x19 + bl pokemon_setattr_encrypted + mov r0, sp + bl sub_80690C0 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x54 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_806FDEC + + thumb_func_start sub_806FE28 +sub_806FE28: @ 806FE28 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_80690C0 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + adds r0, 0x88 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_806FDEC + lsls r0, 24 + lsrs r0, 24 + subs r0, r4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_806FE28 + + thumb_func_start sub_806FE54 +sub_806FE54: @ 806FE54 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_806FE28 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x02021dc4 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r1, =0x02021cc4 + adds r0, r5, 0 + bl pokemon_get_nick_ + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806FE54 + + thumb_func_start sub_806FE88 +sub_806FE88: @ 806FE88 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_806FE28 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =0x02021cc4 + adds r0, r5, 0 + bl pokemon_get_nick_ + movs r0, 0x64 + muls r4, r0 + adds r4, 0x64 + ldr r0, =0x02021dc4 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x5 + bl ConvertIntToDecimalString + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806FE88 + + thumb_func_start sub_806FEC0 +sub_806FEC0: @ 806FEC0 + push {lr} + lsls r1, 24 + lsrs r1, 24 + movs r2, 0x8C + muls r1, r2 + adds r0, r1 + bl sub_806FE88 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_806FEC0 + + thumb_func_start sub_806FED8 +sub_806FED8: @ 806FED8 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003030 + adds r0, r1 + ldr r1, =0x020375e0 + ldrb r1, [r1] + bl sub_806FEC0 + ldr r1, =0x020375e2 + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_806FED8 + + thumb_func_start sub_806FF04 +sub_806FF04: @ 806FF04 + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x03005d8c + ldr r2, [r1] + ldr r1, =0x000030b8 + adds r3, r2, r1 + ldr r1, [r3] + adds r1, r0 + str r1, [r3] + ldr r1, =0x00003144 + adds r2, r1 + ldr r1, [r2] + adds r1, r0 + str r1, [r2] + bx lr + .pool + thumb_func_end sub_806FF04 + + thumb_func_start sub_806FF30 +sub_806FF30: @ 806FF30 + push {r4-r6,lr} + ldr r6, =0x03005d8c + ldr r5, =0x020375e0 + ldrh r0, [r5] + movs r4, 0x8C + adds r1, r0, 0 + muls r1, r4 + ldr r0, =0x00003030 + adds r1, r0 + ldr r0, [r6] + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _0806FF60 + movs r0, 0 + b _0806FF76 + .pool +_0806FF60: + ldrh r0, [r5] + adds r1, r0, 0 + muls r1, r4 + ldr r0, =0x00003030 + adds r1, r0 + ldr r0, [r6] + adds r0, r1 + bl sub_806FE54 + lsls r0, 24 + lsrs r0, 24 +_0806FF76: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806FF30 + + thumb_func_start sub_806FF80 +sub_806FF80: @ 806FF80 + push {lr} + movs r3, 0 + movs r2, 0x7 + adds r1, r0, 0 + adds r1, 0x2B +_0806FF8A: + strb r3, [r1] + subs r1, 0x1 + subs r2, 0x1 + cmp r2, 0 + bge _0806FF8A + adds r2, r0, 0 + adds r2, 0x2C + movs r3, 0 + adds r1, r0, 0 + adds r1, 0x36 +_0806FF9E: + strb r3, [r1] + subs r1, 0x1 + cmp r1, r2 + bge _0806FF9E + bl sub_80D439C + pop {r0} + bx r0 + thumb_func_end sub_806FF80 + + thumb_func_start sub_806FFB0 +sub_806FFB0: @ 806FFB0 + push {r4,lr} + adds r4, r0, 0 + bl zero_pokemon_boxed_data + adds r1, r4, 0 + adds r1, 0x88 + movs r0, 0 + str r0, [r1] + adds r4, 0x50 + adds r0, r4, 0 + bl sub_806FF80 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_806FFB0 + + thumb_func_start sub_806FFD0 +sub_806FFD0: @ 806FFD0 + push {r4-r6,lr} + adds r5, r0, 0 + movs r4, 0 + movs r6, 0x8C +_0806FFD8: + adds r0, r4, 0 + muls r0, r6 + adds r0, r5, r0 + bl sub_806FFB0 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0806FFD8 + movs r1, 0x8C + lsls r1, 1 + adds r0, r5, r1 + movs r1, 0 + str r1, [r0] + movs r2, 0x8E + lsls r2, 1 + adds r0, r5, r2 + strb r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_806FFD0 + + thumb_func_start sub_8070004 +sub_8070004: @ 8070004 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r2, r0, 16 + movs r0, 0 + mov r8, r0 + ldr r0, =gEvolutionTable + mov r12, r0 +_08070016: + movs r7, 0 + movs r6, 0x1 + movs r4, 0x80 + lsls r4, 9 + movs r5, 0x28 + mov r3, r12 + adds r3, 0x28 +_08070024: + movs r1, 0 + ldrh r0, [r3, 0x4] + cmp r0, r2 + bne _08070034 + lsrs r2, r4, 16 + b _08070060 + .pool +_08070034: + adds r1, 0x1 + cmp r1, 0x4 + bgt _0807004A + lsls r0, r1, 3 + adds r0, r5 + add r0, r12 + ldrh r0, [r0, 0x4] + cmp r0, r2 + bne _08070034 + lsrs r2, r4, 16 + movs r7, 0x1 +_0807004A: + cmp r7, 0 + bne _08070060 + movs r0, 0x80 + lsls r0, 9 + adds r4, r0 + adds r5, 0x28 + adds r3, 0x28 + adds r6, 0x1 + ldr r0, =0x0000019b + cmp r6, r0 + ble _08070024 +_08070060: + movs r0, 0xCE + lsls r0, 1 + cmp r6, r0 + beq _08070072 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x4 + ble _08070016 +_08070072: + adds r0, r2, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8070004 + + thumb_func_start sub_8070084 +sub_8070084: @ 8070084 + push {r4-r7,lr} + sub sp, 0x8 + adds r6, r0, 0 + movs r7, 0x1 + negs r7, r7 + movs r4, 0 +_08070090: + movs r0, 0x8C + muls r0, r4 + adds r0, r6, r0 + bl pokemon_roll_gender + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFE + bne _080700A4 + adds r7, r4, 0 +_080700A4: + adds r4, 0x1 + cmp r4, 0x1 + ble _08070090 + movs r5, 0 + movs r4, 0 +_080700AE: + movs r0, 0x8C + muls r0, r4 + adds r0, r6, r0 + movs r1, 0xB + bl pokemon_getattr_encrypted + lsls r1, r4, 2 + add r1, sp + str r0, [r1] + cmp r0, 0x84 + bne _080700C8 + adds r5, 0x1 + adds r7, r4, 0 +_080700C8: + adds r4, 0x1 + cmp r4, 0x1 + ble _080700AE + cmp r5, 0x2 + bne _080700E2 + bl GenerateRandomNumber + lsls r0, 16 + ldr r1, =0x7ffe0000 + movs r7, 0x1 + cmp r0, r1 + bls _080700E2 + movs r7, 0 +_080700E2: + movs r0, 0x8C + muls r0, r7 + adds r0, r6, r0 + movs r1, 0xC + bl pokemon_getattr_encrypted + cmp r0, 0xC3 + bne _080700FE + bl GenerateRandomNumber + lsls r0, 16 + ldr r1, =0x7ffe0000 + cmp r0, r1 + bls _08070108 +_080700FE: + movs r0, 0x1 + negs r0, r0 + b _0807010A + .pool +_08070108: + adds r0, r7, 0 +_0807010A: + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8070084 + + thumb_func_start sub_8070114 +sub_8070114: @ 8070114 + push {r4-r7,lr} + adds r5, r0, 0 + movs r6, 0 + ldr r0, =0x030022c0 + ldrh r0, [r0, 0x24] + bl SeedRng2 + adds r0, r5, 0 + bl sub_8070084 + adds r1, r0, 0 + cmp r1, 0 + bge _08070160 + bl GenerateRandomNumber2 + adds r4, r0, 0 + bl GenerateRandomNumber + movs r1, 0x8C + lsls r1, 1 + adds r5, r1 + lsls r4, 16 + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x0000fffe + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r0, 0x1 + orrs r4, r0 + str r4, [r5] + b _080701AC + .pool +_08070160: + movs r0, 0x8C + muls r0, r1 + adds r0, r5, r0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr_encrypted + bl GetNatureFromPersonality + lsls r0, 24 + lsrs r7, r0, 24 +_08070176: + bl GenerateRandomNumber2 + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsls r0, 16 + lsrs r0, 16 + orrs r4, r0 + adds r0, r4, 0 + bl GetNatureFromPersonality + lsls r0, 24 + lsrs r0, 24 + cmp r7, r0 + bne _0807019A + cmp r4, 0 + bne _080701A4 +_0807019A: + adds r6, 0x1 + movs r0, 0x96 + lsls r0, 4 + cmp r6, r0 + ble _08070176 +_080701A4: + movs r1, 0x8C + lsls r1, 1 + adds r0, r5, r1 + str r4, [r0] +_080701AC: + movs r0, 0x86 + bl FlagSet + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8070114 + + thumb_func_start sub_80701B8 +sub_80701B8: @ 80701B8 + push {r4,lr} + adds r4, r0, 0 + bl GenerateRandomNumber + movs r1, 0x8C + lsls r1, 1 + adds r4, r1 + movs r2, 0x80 + lsls r2, 8 + adds r1, r2, 0 + orrs r0, r1 + lsls r0, 16 + lsrs r0, 16 + str r0, [r4] + movs r0, 0x86 + bl FlagSet + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80701B8 + + thumb_func_start sub_80701E0 +sub_80701E0: @ 80701E0 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003030 + adds r0, r1 + bl sub_8070114 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80701E0 + + thumb_func_start sub_80701FC +sub_80701FC: @ 80701FC + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003030 + adds r0, r1 + bl sub_80701B8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80701FC + + thumb_func_start sub_8070218 +sub_8070218: @ 8070218 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r1, r4, r1 + movs r0, 0xFF + strb r0, [r1] + movs r2, 0 +_0807022A: + mov r1, sp + adds r0, r1, r2 + adds r1, r4, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x5 + ble _0807022A + movs r3, 0 + movs r2, 0 +_0807023E: + mov r1, sp + adds r0, r1, r2 + ldrb r1, [r0] + adds r0, r1, 0 + cmp r0, 0xFF + beq _08070250 + adds r0, r4, r3 + strb r1, [r0] + adds r3, 0x1 +_08070250: + adds r2, 0x1 + cmp r2, 0x5 + ble _0807023E + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8070218 + + thumb_func_start sub_8070260 +sub_8070260: @ 8070260 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + mov r9, r0 + mov r8, r1 + movs r5, 0 + add r1, sp, 0x4 + add r7, sp, 0xC + adds r2, r1, 0 +_08070276: + adds r0, r2, r5 + strb r5, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _08070276 + movs r5, 0 + adds r6, r1, 0 +_08070288: + bl GenerateRandomNumber + mov r1, sp + adds r4, r1, r5 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + subs r1, r5 + bl __modsi3 + adds r0, r6, r0 + ldrb r0, [r0] + strb r0, [r4] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_8070218 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _08070288 + movs r5, 0 + movs r4, 0x1 +_080702B8: + bl GenerateRandomNumber + adds r1, r7, r5 + lsls r0, 16 + lsrs r0, 16 + ands r0, r4 + strb r0, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _080702B8 + movs r5, 0 +_080702D2: + mov r1, sp + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0x5 + bhi _080703AE + lsls r0, 2 + ldr r1, =_080702EC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080702EC: + .4byte _08070304 + .4byte _08070322 + .4byte _0807033C + .4byte _08070356 + .4byte _08070370 + .4byte _08070390 +_08070304: + adds r0, r7, r5 + ldrb r1, [r0] + movs r0, 0x8C + muls r0, r1 + add r0, r8 + movs r1, 0x27 + bl pokemon_getattr_encrypted + add r2, sp, 0x10 + strb r0, [r2] + mov r0, r9 + movs r1, 0x27 + bl pokemon_setattr + b _080703AE +_08070322: + add r4, sp, 0x10 + adds r0, r7, r5 + ldrb r1, [r0] + movs r0, 0x8C + muls r0, r1 + add r0, r8 + movs r1, 0x28 + bl pokemon_getattr_encrypted + strb r0, [r4] + mov r0, r9 + movs r1, 0x28 + b _08070388 +_0807033C: + add r4, sp, 0x10 + adds r0, r7, r5 + ldrb r1, [r0] + movs r0, 0x8C + muls r0, r1 + add r0, r8 + movs r1, 0x29 + bl pokemon_getattr_encrypted + strb r0, [r4] + mov r0, r9 + movs r1, 0x29 + b _08070388 +_08070356: + add r4, sp, 0x10 + adds r0, r7, r5 + ldrb r1, [r0] + movs r0, 0x8C + muls r0, r1 + add r0, r8 + movs r1, 0x2A + bl pokemon_getattr_encrypted + strb r0, [r4] + mov r0, r9 + movs r1, 0x2A + b _08070388 +_08070370: + add r4, sp, 0x10 + adds r0, r7, r5 + ldrb r1, [r0] + movs r0, 0x8C + muls r0, r1 + add r0, r8 + movs r1, 0x2B + bl pokemon_getattr_encrypted + strb r0, [r4] + mov r0, r9 + movs r1, 0x2B +_08070388: + adds r2, r4, 0 + bl pokemon_setattr + b _080703AE +_08070390: + add r4, sp, 0x10 + adds r0, r7, r5 + ldrb r1, [r0] + movs r0, 0x8C + muls r0, r1 + add r0, r8 + movs r1, 0x2C + bl pokemon_getattr_encrypted + strb r0, [r4] + mov r0, r9 + movs r1, 0x2C + adds r2, r4, 0 + bl pokemon_setattr +_080703AE: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _080702D2 + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8070260 + + thumb_func_start pokemon_get_eggmoves +pokemon_get_eggmoves: @ 80703C8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r1 + movs r6, 0 + movs r4, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r5, =gEggMoves + ldrh r1, [r5] + ldr r7, =0x00004e20 + adds r0, r3, r7 + cmp r1, r0 + bne _080703F8 + movs r4, 0x1 + b _0807041A + .pool +_080703F8: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =0x00000471 + ldr r5, =gEggMoves + cmp r2, r0 + bhi _0807041A + lsls r0, r2, 1 + adds r0, r5 + ldrh r1, [r0] + ldr r7, =0x00004e20 + adds r0, r3, r7 + cmp r1, r0 + bne _080703F8 + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_0807041A: + movs r2, 0 + lsls r0, r4, 1 + adds r0, r5 + ldrh r0, [r0] + ldr r1, =0x00004e20 + cmp r0, r1 + bhi _08070456 + adds r7, r5, 0 + adds r3, r1, 0 +_0807042C: + lsls r1, r2, 1 + add r1, r8 + adds r0, r4, r2 + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x9 + bhi _08070456 + adds r0, r4, r2 + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + cmp r0, r3 + bls _0807042C +_08070456: + lsls r0, r6, 24 + lsrs r0, 24 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end pokemon_get_eggmoves + + thumb_func_start daycare_build_child_moveset +daycare_build_child_moveset: @ 8070470 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + adds r7, r0, 0 + mov r10, r1 + mov r9, r2 + movs r0, 0 + str r0, [sp] + movs r6, 0 + ldr r5, =0x02024a4c + movs r2, 0 + ldr r4, =0x02024a28 + ldr r3, =0x02024a30 +_08070490: + lsls r1, r6, 1 + adds r0, r1, r5 + strh r2, [r0] + adds r0, r1, r4 + strh r2, [r0] + adds r1, r3 + strh r2, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x3 + bls _08070490 + movs r6, 0 + ldr r2, =0x02024a38 + movs r1, 0 +_080704AE: + lsls r0, r6, 1 + adds r0, r2 + strh r1, [r0] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x9 + bls _080704AE + movs r6, 0 + ldr r2, =0x020249c4 + movs r1, 0 +_080704C4: + lsls r0, r6, 1 + adds r0, r2 + strh r1, [r0] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x31 + bls _080704C4 + adds r0, r7, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x020249c4 + bl sub_806E204 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + movs r6, 0 + ldr r1, =0x02024a28 + mov r8, r1 +_080704F2: + adds r5, r6, 0 + adds r5, 0xD + mov r0, r10 + adds r1, r5, 0 + bl pokemon_getattr_encrypted + lsls r4, r6, 1 + mov r2, r8 + adds r1, r4, r2 + strh r0, [r1] + mov r0, r9 + adds r1, r5, 0 + bl pokemon_getattr_encrypted + ldr r1, =0x02024a4c + adds r4, r1 + strh r0, [r4] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x3 + bls _080704F2 + ldr r1, =0x02024a38 + adds r0, r7, 0 + bl pokemon_get_eggmoves + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r6, 0 +_0807052E: + ldr r0, =0x02024a28 + lsls r1, r6, 1 + adds r2, r1, r0 + ldrh r1, [r2] + mov r9, r0 + cmp r1, 0 + beq _080705A4 + movs r5, 0 + cmp r5, r8 + bcs _08070596 + adds r4, r2, 0 + ldr r2, =0x0000ffff +_08070546: + ldr r0, =0x02024a38 + lsls r1, r5, 1 + adds r1, r0 + ldrh r0, [r4] + ldrh r1, [r1] + cmp r0, r1 + bne _0807058C + adds r1, r0, 0 + adds r0, r7, 0 + str r2, [sp, 0x8] + bl pokemon_moveset_pad_ + lsls r0, 16 + lsrs r0, 16 + ldr r2, [sp, 0x8] + cmp r0, r2 + bne _08070596 + ldrh r1, [r4] + adds r0, r7, 0 + bl sub_8069424 + b _08070596 + .pool +_0807058C: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r8 + bcc _08070546 +_08070596: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r3, =0x02024a28 + mov r9, r3 + cmp r6, 0x3 + bls _0807052E +_080705A4: + movs r6, 0 +_080705A6: + lsls r0, r6, 1 + mov r2, r9 + adds r1, r0, r2 + ldrh r1, [r1] + adds r2, r0, 0 + adds r6, 0x1 + mov r8, r6 + cmp r1, 0 + beq _08070608 + movs r5, 0 + ldr r0, =0x02024a28 + adds r4, r2, r0 + ldr r6, =0x0000ffff + mov r9, r0 +_080705C2: + ldr r3, =0x00000121 + adds r0, r5, r3 + lsls r0, 16 + lsrs r0, 16 + bl ItemIdToBattleMoveId + ldrh r1, [r4] + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + bne _080705FE + lsls r1, r5, 24 + lsrs r1, 24 + adds r0, r7, 0 + bl sub_806E00C + cmp r0, 0 + beq _080705FE + ldrh r1, [r4] + adds r0, r7, 0 + bl pokemon_moveset_pad_ + lsls r0, 16 + lsrs r0, 16 + cmp r0, r6 + bne _080705FE + ldrh r1, [r4] + adds r0, r7, 0 + bl sub_8069424 +_080705FE: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x39 + bls _080705C2 +_08070608: + mov r1, r8 + lsls r0, r1, 16 + lsrs r6, r0, 16 + cmp r6, 0x3 + bls _080705A6 + movs r6, 0 + mov r2, r9 + ldrh r0, [r2] + ldr r3, =0x02024a30 + mov r10, r3 + cmp r0, 0 + beq _08070672 + mov r4, r9 + ldr r0, =0x02024a4c + mov r9, r0 + mov r12, r10 +_08070628: + movs r5, 0 + lsls r2, r6, 1 + adds r6, 0x1 + mov r8, r6 + adds r3, r2, r4 +_08070632: + lsls r0, r5, 1 + add r0, r9 + ldrh r2, [r3] + adds r1, r2, 0 + ldrh r0, [r0] + cmp r1, r0 + bne _08070654 + cmp r1, 0 + beq _08070654 + ldr r1, [sp] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + lsls r1, 1 + add r1, r12 + strh r2, [r1] +_08070654: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x3 + bls _08070632 + mov r1, r8 + lsls r0, r1, 16 + lsrs r6, r0, 16 + cmp r6, 0x3 + bhi _08070672 + lsls r0, r6, 1 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0 + bne _08070628 +_08070672: + movs r6, 0 + mov r2, r10 + ldrh r0, [r2] + cmp r0, 0 + beq _080706FC +_0807067C: + movs r5, 0 + adds r3, r6, 0x1 + mov r8, r3 + ldr r0, [sp, 0x4] + cmp r5, r0 + bcs _080706E4 + ldr r2, =0x0000ffff +_0807068A: + ldr r1, =0x020249c4 + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + cmp r1, 0 + beq _080706D8 + lsls r0, r6, 1 + mov r3, r10 + adds r4, r0, r3 + ldrh r0, [r4] + cmp r0, r1 + bne _080706D8 + adds r1, r0, 0 + adds r0, r7, 0 + str r2, [sp, 0x8] + bl pokemon_moveset_pad_ + lsls r0, 16 + lsrs r0, 16 + ldr r2, [sp, 0x8] + cmp r0, r2 + bne _080706E4 + ldrh r1, [r4] + adds r0, r7, 0 + bl sub_8069424 + b _080706E4 + .pool +_080706D8: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, [sp, 0x4] + cmp r5, r0 + bcc _0807068A +_080706E4: + mov r1, r8 + lsls r0, r1, 16 + lsrs r6, r0, 16 + cmp r6, 0x3 + bhi _080706FC + ldr r0, =0x02024a30 + lsls r1, r6, 1 + adds r1, r0 + ldrh r1, [r1] + mov r10, r0 + cmp r1, 0 + bne _0807067C +_080706FC: + 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 daycare_build_child_moveset + + thumb_func_start sub_8070710 +sub_8070710: @ 8070710 + adds r2, r0, 0 + movs r1, 0x8C + lsls r1, 1 + adds r0, r2, r1 + movs r1, 0 + str r1, [r0] + movs r3, 0x8E + lsls r3, 1 + adds r0, r2, r3 + strb r1, [r0] + bx lr + thumb_func_end sub_8070710 + + thumb_func_start sub_8070728 +sub_8070728: @ 8070728 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003030 + adds r0, r1 + bl sub_8070710 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8070728 + + thumb_func_start incense_effects +incense_effects: @ 8070744 + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrh r1, [r4] + movs r7, 0xB4 + lsls r7, 1 + cmp r1, r7 + beq _0807075C + movs r0, 0xAF + lsls r0, 1 + cmp r1, r0 + bne _0807079E +_0807075C: + adds r0, r5, 0 + movs r1, 0xC + bl pokemon_getattr_encrypted + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r5, 0 + adds r0, 0x8C + movs r1, 0xC + bl pokemon_getattr_encrypted + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r0, [r4] + cmp r0, r7 + bne _08070788 + cmp r6, 0xDD + beq _08070788 + cmp r2, 0xDD + beq _08070788 + movs r0, 0xCA + strh r0, [r4] +_08070788: + ldrh r1, [r4] + movs r0, 0xAF + lsls r0, 1 + cmp r1, r0 + bne _0807079E + cmp r6, 0xDC + beq _0807079E + cmp r2, 0xDC + beq _0807079E + movs r0, 0xB7 + strh r0, [r4] +_0807079E: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end incense_effects + + thumb_func_start sub_80707A4 +sub_80707A4: @ 80707A4 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr_encrypted + adds r5, r0, 0 + adds r4, 0x8C + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr_encrypted + cmp r5, 0xCA + beq _080707C6 + cmp r0, 0xCA + bne _080707E2 +_080707C6: + movs r4, 0xAC + lsls r4, 1 + adds r0, r6, 0 + adds r1, r4, 0 + bl pokemon_moveset_pad_ + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + bne _080707E2 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8069424 +_080707E2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80707A4 + + thumb_func_start sub_80707EC +sub_80707EC: @ 80707EC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r7, r0, 0 + adds r6, r1, 0 + movs r4, 0 + movs r0, 0x1 + mov r8, r0 +_080707FE: + movs r0, 0x8C + muls r0, r4 + adds r5, r7, r0 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr_encrypted + lsls r1, r4, 1 + add r1, sp + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x84 + bne _08070826 + adds r0, r4, 0 + mov r1, r8 + eors r0, r1 + strb r0, [r6] + strb r4, [r6, 0x1] + b _0807083E +_08070826: + adds r0, r5, 0 + bl pokemon_roll_gender + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFE + bne _0807083E + strb r4, [r6] + adds r0, r4, 0 + mov r1, r8 + eors r0, r1 + strb r0, [r6, 0x1] +_0807083E: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1 + bls _080707FE + ldrb r0, [r6] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + bl sub_8070004 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1D + bne _08070870 + movs r1, 0x8C + lsls r1, 1 + adds r0, r7, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _08070870 + movs r4, 0x20 +_08070870: + ldr r0, =0x00000183 + cmp r4, r0 + bne _0807088C + movs r1, 0x8C + lsls r1, 1 + adds r0, r7, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0807088C + movs r4, 0xC1 + lsls r4, 1 +_0807088C: + ldrb r0, [r6, 0x1] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + cmp r0, 0x84 + bne _080708B4 + ldrb r1, [r6] + movs r0, 0x8C + muls r0, r1 + adds r0, r7, r0 + bl pokemon_roll_gender + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFE + beq _080708B4 + ldrb r1, [r6, 0x1] + ldrb r0, [r6] + strb r0, [r6, 0x1] + strb r1, [r6] +_080708B4: + adds r0, r4, 0 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80707EC + + thumb_func_start sub_80708C8 +sub_80708C8: @ 80708C8 + push {r4-r6,lr} + sub sp, 0x6C + adds r6, r0, 0 + add r5, sp, 0x64 + adds r1, r5, 0 + bl sub_80707EC + add r4, sp, 0x68 + strh r0, [r4] + adds r0, r4, 0 + adds r1, r6, 0 + bl incense_effects + ldrh r1, [r4] + mov r0, sp + adds r2, r6, 0 + bl sub_8070A0C + mov r0, sp + adds r1, r6, 0 + bl sub_8070260 + ldrb r0, [r5, 0x1] + movs r2, 0x8C + adds r1, r0, 0 + muls r1, r2 + adds r1, r6, r1 + ldrb r0, [r5] + muls r2, r0 + adds r2, r6, r2 + mov r0, sp + bl daycare_build_child_moveset + ldrh r0, [r4] + cmp r0, 0xAC + bne _08070918 + mov r0, sp + adds r1, r6, 0 + bl sub_80707A4 +_08070918: + mov r2, sp + adds r2, 0x6A + movs r0, 0x1 + strb r0, [r2] + mov r0, sp + movs r1, 0x2D + bl pokemon_setattr + ldr r0, =0x020244ec + movs r1, 0xFA + lsls r1, 1 + adds r0, r1 + mov r1, sp + movs r2, 0x64 + bl memcpy + bl party_compaction + bl calc_player_party_count + adds r0, r6, 0 + bl sub_8070710 + add sp, 0x6C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80708C8 + + thumb_func_start sub_8070954 +sub_8070954: @ 8070954 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + adds r7, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 24 + lsrs r6, 24 + movs r4, 0 + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + str r4, [sp, 0xC] + adds r1, r5, 0 + movs r2, 0x5 + movs r3, 0x20 + bl create_pokemon_set_level + movs r0, 0x12 + add r0, sp + mov r8, r0 + strb r4, [r0] + movs r1, 0x4 + add r0, sp, 0x10 + strh r1, [r0] + mov r4, sp + adds r4, 0x13 + movs r0, 0x1 + mov r9, r0 + mov r0, r9 + strb r0, [r4] + adds r0, r7, 0 + movs r1, 0x26 + add r2, sp, 0x10 + bl pokemon_setattr + ldr r2, =gEggName + adds r0, r7, 0 + movs r1, 0x2 + bl pokemon_setattr + lsls r2, r5, 3 + subs r2, r5 + lsls r2, 2 + ldr r0, =gBaseStats + 0x11 @ egg cycles offset + adds r2, r0 + adds r0, r7, 0 + movs r1, 0x20 + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x24 + mov r2, r8 + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x3 + adds r2, r4, 0 + bl pokemon_setattr + cmp r6, 0 + beq _080709E6 + add r2, sp, 0x14 + movs r0, 0xFD + strb r0, [r2] + adds r0, r7, 0 + movs r1, 0x23 + bl pokemon_setattr +_080709E6: + mov r2, sp + adds r2, 0x15 + mov r0, r9 + strb r0, [r2] + adds r0, r7, 0 + movs r1, 0x2D + bl pokemon_setattr + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8070954 + + thumb_func_start sub_8070A0C +sub_8070A0C: @ 8070A0C + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x14 + adds r6, r0, 0 + adds r5, r1, 0 + lsls r5, 16 + lsrs r5, 16 + movs r0, 0x8C + lsls r0, 1 + adds r2, r0 + ldr r0, [r2] + movs r1, 0x1 + mov r8, r1 + str r1, [sp] + str r0, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + str r4, [sp, 0xC] + adds r0, r6, 0 + adds r1, r5, 0 + movs r2, 0x5 + movs r3, 0x20 + bl create_pokemon_set_level + movs r0, 0x12 + add r0, sp + mov r9, r0 + strb r4, [r0] + movs r1, 0x4 + add r0, sp, 0x10 + strh r1, [r0] + mov r4, sp + adds r4, 0x13 + mov r1, r8 + strb r1, [r4] + adds r0, r6, 0 + movs r1, 0x26 + add r2, sp, 0x10 + bl pokemon_setattr + ldr r2, =gEggName + adds r0, r6, 0 + movs r1, 0x2 + bl pokemon_setattr + lsls r2, r5, 3 + subs r2, r5 + lsls r2, 2 + ldr r0, =gBaseStats + 0x11 @ egg cycles offset + adds r2, r0 + adds r0, r6, 0 + movs r1, 0x20 + bl pokemon_setattr + adds r0, r6, 0 + movs r1, 0x24 + mov r2, r9 + bl pokemon_setattr + adds r0, r6, 0 + movs r1, 0x3 + adds r2, r4, 0 + bl pokemon_setattr + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8070A0C + + thumb_func_start sp0B8_daycare +sp0B8_daycare: @ 8070AA8 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003030 + adds r0, r1 + bl sub_80708C8 + pop {r0} + bx r0 + .pool + thumb_func_end sp0B8_daycare + + thumb_func_start sub_8070AC4 +sub_8070AC4: @ 8070AC4 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + movs r7, 0 + movs r5, 0 +_08070ACE: + movs r0, 0x8C + adds r4, r5, 0 + muls r4, r0 + adds r0, r6, r4 + movs r1, 0x5 + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _08070AEE + adds r1, r6, 0 + adds r1, 0x88 + adds r1, r4 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + adds r7, 0x1 +_08070AEE: + adds r5, 0x1 + cmp r5, 0x1 + bls _08070ACE + movs r1, 0x8C + lsls r1, 1 + adds r0, r6, r1 + ldr r0, [r0] + cmp r0, 0 + bne _08070B34 + cmp r7, 0x2 + bne _08070B34 + subs r1, 0x4 + adds r0, r6, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _08070B34 + adds r0, r6, 0 + bl daycare_relationship_score + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x0000ffff + bl __udivsi3 + cmp r4, r0 + bls _08070B34 + bl sub_80701E0 +_08070B34: + movs r0, 0x8E + lsls r0, 1 + adds r1, r6, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _08070BC0 + bl sub_807228C + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + ldr r0, =0x020244e9 + ldrb r0, [r0] + cmp r5, r0 + bcs _08070BC0 + ldr r4, =0x020244ec +_08070B5C: + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + beq _08070BB4 + adds r0, r4, 0 + movs r1, 0x4 + bl pokemon_getattr + cmp r0, 0 + bne _08070BB4 + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + adds r1, r0, 0 + str r1, [sp] + cmp r0, 0 + beq _08070BA8 + cmp r0, r6 + bcc _08070B98 + subs r0, r6 + b _08070B9A + .pool +_08070B98: + subs r0, r1, 0x1 +_08070B9A: + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x20 + mov r2, sp + bl pokemon_setattr + b _08070BB4 +_08070BA8: + ldr r0, =0x020375e0 + strh r5, [r0] + movs r0, 0x1 + b _08070BC2 + .pool +_08070BB4: + adds r4, 0x64 + adds r5, 0x1 + ldr r0, =0x020244e9 + ldrb r0, [r0] + cmp r5, r0 + bcc _08070B5C +_08070BC0: + movs r0, 0 +_08070BC2: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8070AC4 + + thumb_func_start sub_8070BD0 +sub_8070BD0: @ 8070BD0 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003030 + adds r0, r1 + bl sub_8070AC4 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8070BD0 + + thumb_func_start sub_8070BF0 +sub_8070BF0: @ 8070BF0 + push {lr} + movs r1, 0x8C + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _08070C00 + movs r0, 0x1 +_08070C00: + pop {r1} + bx r1 + thumb_func_end sub_8070BF0 + + thumb_func_start sub_8070C04 +sub_8070C04: @ 8070C04 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _08070C2E + ldr r1, =0x02021cc4 + adds r0, r4, 0 + bl pokemon_get_nick_ + adds r0, r4, 0 + movs r1, 0x7 + mov r2, sp + bl pokemon_getattr_encrypted + ldr r0, =0x02021ec4 + mov r1, sp + bl CopyString +_08070C2E: + adds r4, 0x8C + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _08070C44 + ldr r1, =0x02021dc4 + adds r0, r4, 0 + bl pokemon_get_nick_ +_08070C44: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8070C04 + + thumb_func_start sub_8070C58 +sub_8070C58: @ 8070C58 + push {r4,r5,lr} + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + ldr r1, =0x02021cc4 + bl pokemon_get_nick_ + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + muls r0, r5 + adds r0, r4 + movs r1, 0xB + bl pokemon_getattr_encrypted + lsls r0, 16 + lsrs r0, 16 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8070C58 + + thumb_func_start sp0B5_daycare +sp0B5_daycare: @ 8070C94 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003030 + adds r0, r1 + bl sub_8070C04 + pop {r0} + bx r0 + .pool + thumb_func_end sp0B5_daycare + + thumb_func_start sp0B6_daycare +sp0B6_daycare: @ 8070CB0 + push {r4,lr} + ldr r4, =0x03005d8c + ldr r0, [r4] + ldr r1, =0x00003030 + adds r0, r1 + bl sub_8070BF0 + lsls r0, 24 + cmp r0, 0 + beq _08070CD0 + movs r0, 0x1 + b _08070CF2 + .pool +_08070CD0: + ldr r0, [r4] + ldr r1, =0x00003030 + adds r0, r1 + bl daycare_count_pokemon + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08070CEC + movs r0, 0 + b _08070CF2 + .pool +_08070CEC: + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 +_08070CF2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sp0B6_daycare + + thumb_func_start sub_8070CF8 +sub_8070CF8: @ 8070CF8 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003030 + adds r0, r1 + bl daycare_count_pokemon + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08070D10 + movs r0, 0 +_08070D10: + pop {r1} + bx r1 + .pool + thumb_func_end sub_8070CF8 + + thumb_func_start sub_8070D1C +sub_8070D1C: @ 8070D1C + push {r4-r6,lr} + adds r5, r1, 0 + movs r4, 0 + adds r1, r0, 0 +_08070D24: + movs r3, 0 + ldrh r0, [r1] + adds r2, r5, 0 +_08070D2A: + ldrh r6, [r2] + cmp r0, r6 + bne _08070D34 + movs r0, 0x1 + b _08070D46 +_08070D34: + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x1 + ble _08070D2A + adds r1, 0x2 + adds r4, 0x1 + cmp r4, 0x1 + ble _08070D24 + movs r0, 0 +_08070D46: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8070D1C + + thumb_func_start daycare_relationship_score +daycare_relationship_score: @ 8070D4C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + str r0, [sp, 0x1C] + movs r7, 0 + mov r0, sp + adds r0, 0x8 + str r0, [sp, 0x20] + add r1, sp, 0xC + mov r9, r1 + mov r2, sp + adds r2, 0x14 + str r2, [sp, 0x24] + subs r0, 0x6 + ldr r1, =gBaseStats + mov r10, r1 + ldr r5, [sp, 0x20] + mov r8, r0 + mov r6, sp + str r2, [sp, 0x28] + mov r2, r9 + str r2, [sp, 0x2C] +_08070D7E: + movs r0, 0x8C + adds r4, r7, 0 + muls r4, r0 + ldr r0, [sp, 0x1C] + adds r4, r0, r4 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr_encrypted + strh r0, [r5] + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr_encrypted + ldr r1, [sp, 0x2C] + stm r1!, {r0} + str r1, [sp, 0x2C] + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr_encrypted + adds r1, r0, 0 + ldrh r0, [r5] + bl pokemon_species_get_gender_info + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x28] + stm r2!, {r0} + str r2, [sp, 0x28] + ldrh r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r10 + ldrb r0, [r0, 0x14] + strh r0, [r6] + ldrh r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r10 + ldrb r0, [r0, 0x15] + mov r1, r8 + strh r0, [r1] + adds r5, 0x2 + movs r2, 0x4 + add r8, r2 + adds r6, 0x4 + adds r7, 0x1 + cmp r7, 0x1 + bls _08070D7E + mov r0, sp + ldrh r1, [r0] + cmp r1, 0xF + beq _08070DFC + ldrh r0, [r0, 0x4] + cmp r0, 0xF + beq _08070DFC + cmp r1, 0xD + bne _08070E04 + cmp r0, 0xD + bne _08070E08 +_08070DFC: + movs r0, 0 + b _08070E5C + .pool +_08070E04: + cmp r0, 0xD + bne _08070E14 +_08070E08: + ldr r1, [sp, 0xC] + mov r2, r9 + ldr r0, [r2, 0x4] + cmp r1, r0 + beq _08070E56 + b _08070E5A +_08070E14: + ldr r0, [sp, 0x14] + ldr r2, [sp, 0x24] + ldr r1, [r2, 0x4] + cmp r0, r1 + beq _08070DFC + cmp r0, 0xFF + beq _08070DFC + cmp r1, 0xFF + beq _08070DFC + add r1, sp, 0x4 + mov r0, sp + bl sub_8070D1C + lsls r0, 24 + cmp r0, 0 + beq _08070DFC + ldr r0, [sp, 0x20] + ldrh r1, [r0, 0x2] + ldrh r0, [r0] + cmp r0, r1 + bne _08070E4C + ldr r1, [sp, 0xC] + mov r2, r9 + ldr r0, [r2, 0x4] + cmp r1, r0 + beq _08070E5A + movs r0, 0x46 + b _08070E5C +_08070E4C: + ldr r1, [sp, 0xC] + mov r2, r9 + ldr r0, [r2, 0x4] + cmp r1, r0 + bne _08070E5A +_08070E56: + movs r0, 0x14 + b _08070E5C +_08070E5A: + movs r0, 0x32 +_08070E5C: + add sp, 0x30 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end daycare_relationship_score + + thumb_func_start daycare_relationship_score_from_savegame +daycare_relationship_score_from_savegame: @ 8070E6C + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003030 + adds r0, r1 + bl daycare_relationship_score + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end daycare_relationship_score_from_savegame + + thumb_func_start sp0B9_daycare_relationship_comment +sp0B9_daycare_relationship_comment: @ 8070E8C + push {lr} + bl daycare_relationship_score_from_savegame + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + movs r1, 0 + cmp r0, 0 + bne _08070EA0 + movs r1, 0x3 +_08070EA0: + cmp r0, 0x14 + bne _08070EA6 + movs r1, 0x2 +_08070EA6: + cmp r0, 0x32 + bne _08070EAC + movs r1, 0x1 +_08070EAC: + cmp r2, 0x46 + bne _08070EB2 + movs r1, 0 +_08070EB2: + ldr r0, =0x02021fc4 + ldr r2, =gUnknown_0832B6F8 + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl CopyString + pop {r0} + bx r0 + .pool + thumb_func_end sp0B9_daycare_relationship_comment + + thumb_func_start sub_8070ECC +sub_8070ECC: @ 8070ECC + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + mov r2, sp + mov r1, sp + movs r0, 0 + strb r0, [r1, 0x1] + strb r0, [r2] + movs r3, 0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _08070F10 +_08070EE8: + adds r1, r4, r3 + ldrb r0, [r1] + cmp r0, 0xB5 + bne _08070EF6 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] +_08070EF6: + ldrb r0, [r1] + cmp r0, 0xB6 + bne _08070F02 + ldrb r0, [r2, 0x1] + adds r0, 0x1 + strb r0, [r2, 0x1] +_08070F02: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + adds r0, r4, r3 + ldrb r0, [r0] + cmp r0, 0xFF + bne _08070EE8 +_08070F10: + cmp r5, 0 + bne _08070F24 + mov r0, sp + ldrb r0, [r0] + cmp r0, 0 + beq _08070F24 + mov r0, sp + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _08070F38 +_08070F24: + cmp r5, 0xFE + bne _08070F3C + mov r0, sp + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _08070F3C + mov r0, sp + ldrb r0, [r0] + cmp r0, 0 + bne _08070F3C +_08070F38: + movs r0, 0x1 + b _08070F3E +_08070F3C: + movs r0, 0 +_08070F3E: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8070ECC + + thumb_func_start sub_8070F48 +sub_8070F48: @ 8070F48 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0 + bne _08070F68 + movs r1, 0 + bl sub_8070ECC + lsls r0, 24 + cmp r0, 0 + bne _08070F84 + ldr r1, =gUnknown_0832DAC7 + b _08070F86 + .pool +_08070F68: + cmp r1, 0xFE + bne _08070F84 + adds r0, r4, 0 + movs r1, 0xFE + bl sub_8070ECC + lsls r0, 24 + cmp r0, 0 + bne _08070F84 + ldr r1, =gUnknown_0832DAC9 + b _08070F86 + .pool +_08070F84: + ldr r1, =gUnknown_0832DACB +_08070F86: + adds r0, r4, 0 + bl AppendString + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8070F48 + + thumb_func_start sub_8070F98 +sub_8070F98: @ 8070F98 + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + bl pokemon_roll_gender + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_8070F48 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8070F98 + + thumb_func_start sub_8070FB4 +sub_8070FB4: @ 8070FB4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x28 + mov r8, r0 + adds r7, r1, 0 + movs r0, 0xFF + strb r0, [r7] + movs r6, 0 + add r0, sp, 0x14 + mov r9, r0 +_08070FCC: + movs r0, 0x8C + adds r4, r6, 0 + muls r4, r0 + add r4, r8 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 2 + mov r1, sp + adds r5, r1, r0 + adds r0, r4, 0 + adds r1, r5, 0 + bl pokemon_get_nick_ + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8070F98 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x1 + bls _08070FCC + adds r0, r7, 0 + mov r1, sp + bl CopyString + ldr r4, =gUnknown_085EF881 + adds r0, r7, 0 + adds r1, r4, 0 + bl AppendString + adds r0, r7, 0 + mov r1, r9 + bl AppendString + adds r0, r7, 0 + adds r1, r4, 0 + bl AppendString + ldr r1, =gUnknown_085EF883 + adds r0, r7, 0 + bl AppendString + add sp, 0x28 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8070FB4 + + thumb_func_start sub_8071038 +sub_8071038: @ 8071038 + push {r4-r6,lr} + sub sp, 0x14 + adds r6, r0, 0 + adds r4, r1, 0 + movs r0, 0xFF + strb r0, [r4] + movs r5, 0 +_08071046: + adds r0, r4, 0 + ldr r1, =gUnknown_085EF888 + bl AppendString + movs r0, 0x8C + adds r2, r5, 0 + muls r2, r0 + adds r0, r6, r2 + adds r1, r6, 0 + adds r1, 0x88 + adds r1, r2 + ldr r1, [r1] + bl sub_806FDEC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r0, r4, 0 + mov r1, sp + bl AppendString + adds r0, r4, 0 + ldr r1, =gUnknown_085EF881 + bl AppendString + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bls _08071046 + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8071038 + + thumb_func_start sub_807109C +sub_807109C: @ 807109C + push {r4-r6,lr} + sub sp, 0x10 + str r1, [sp] + mov r1, sp + movs r5, 0 + strb r0, [r1, 0x4] + mov r0, sp + movs r6, 0x1 + movs r4, 0x1 + strb r4, [r0, 0x5] + strb r2, [r0, 0x6] + strb r3, [r0, 0x7] + strb r2, [r0, 0x8] + strb r3, [r0, 0x9] + mov r3, sp + ldrb r1, [r3, 0xC] + movs r2, 0x10 + negs r2, r2 + adds r0, r2, 0 + ands r0, r1 + strb r0, [r3, 0xC] + ldr r3, =0x03003014 + ldrb r1, [r3] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + mov r0, sp + strb r5, [r0, 0xA] + strb r4, [r0, 0xB] + mov r3, sp + ldrb r1, [r3, 0xC] + movs r4, 0xF + adds r0, r4, 0 + ands r0, r1 + movs r1, 0x20 + orrs r0, r1 + strb r0, [r3, 0xC] + mov r1, sp + ldrb r0, [r1, 0xD] + ands r2, r0 + orrs r2, r6 + strb r2, [r1, 0xD] + ands r2, r4 + movs r0, 0x30 + orrs r2, r0 + strb r2, [r1, 0xD] + mov r0, sp + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807109C + + thumb_func_start sub_8071110 +sub_8071110: @ 8071110 + push {r4-r6,lr} + sub sp, 0x14 + adds r5, r0, 0 + adds r4, r1, 0 + adds r6, r3, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x8C + muls r0, r2 + adds r5, r0 + adds r0, r5, 0 + mov r1, sp + bl pokemon_get_nick_ + mov r0, sp + adds r1, r5, 0 + bl sub_8070F98 + adds r0, r4, 0 + mov r1, sp + movs r2, 0x8 + adds r3, r6, 0 + bl sub_807109C + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8071110 + + thumb_func_start sub_8071148 +sub_8071148: @ 8071148 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x14 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + mov r8, r3 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =gUnknown_085EF888 + mov r0, sp + bl CopyString + movs r0, 0x8C + adds r1, r6, 0 + muls r1, r0 + adds r0, r4, r1 + adds r4, 0x88 + adds r4, r1 + ldr r1, [r4] + bl sub_806FDEC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + add r4, sp, 0xC + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + mov r0, sp + adds r1, r4, 0 + bl AppendString + movs r0, 0x1 + mov r1, sp + movs r2, 0x70 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + adds r0, r5, 0 + mov r1, sp + mov r3, r8 + bl sub_807109C + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8071148 + + thumb_func_start sub_80711B8 +sub_80711B8: @ 80711B8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r1, 0 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r2, 24 + lsrs r5, r2, 24 + cmp r6, 0x1 + bhi _080711F0 + ldr r0, =0x03005d8c + mov r8, r0 + ldr r0, [r0] + ldr r4, =0x00003030 + adds r0, r4 + adds r1, r7, 0 + adds r2, r6, 0 + adds r3, r5, 0 + bl sub_8071110 + mov r1, r8 + ldr r0, [r1] + adds r0, r4 + adds r1, r7, 0 + adds r2, r6, 0 + adds r3, r5, 0 + bl sub_8071148 +_080711F0: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80711B8 + + thumb_func_start c3_080469FC +c3_080469FC: @ 8071204 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrb r0, [r4, 0x8] + bl ListMenuHandleInput + adds r1, r0, 0 + ldr r0, =0x030022c0 + ldrh r2, [r0, 0x2E] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _08071284 + cmp r1, 0x1 + bls _0807123C + cmp r1, 0x5 + beq _08071248 + b _0807124E + .pool +_0807123C: + ldr r0, =0x020375f0 + strh r1, [r0] + b _0807124E + .pool +_08071248: + ldr r1, =0x020375f0 + movs r0, 0x2 + strh r0, [r1] +_0807124E: + ldr r0, =0x03005e00 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + ldrb r0, [r4, 0x8] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldrb r0, [r4, 0xA] + movs r1, 0x1 + bl sub_819746C + ldrb r0, [r4, 0xA] + bl RemoveWindow + adds r0, r5, 0 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running + b _080712B4 + .pool +_08071284: + movs r1, 0x2 + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + beq _080712B4 + ldr r0, =0x020375f0 + strh r1, [r0] + ldrb r0, [r4, 0x8] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldrb r0, [r4, 0xA] + movs r1, 0x1 + bl sub_819746C + ldrb r0, [r4, 0xA] + bl RemoveWindow + adds r0, r5, 0 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running +_080712B4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end c3_080469FC + + thumb_func_start sub_80712C0 +sub_80712C0: @ 80712C0 + push {r4,r5,lr} + sub sp, 0x18 + ldr r0, =gUnknown_0832B6C0 + bl AddWindow + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl sub_81973FC + mov r1, sp + ldr r0, =gUnknown_0832B6E0 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + mov r0, sp + strb r4, [r0, 0x10] + movs r1, 0 + movs r2, 0 + bl ListMenuInit + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =c3_080469FC + movs r1, 0x3 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r5, [r1, 0x8] + strh r4, [r1, 0xA] + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80712C0 + + thumb_func_start sub_8071330 +sub_8071330: @ 8071330 + push {lr} + bl sub_81B9328 + ldr r1, =0x030022c0 + ldr r0, =c2_exit_to_overworld_2_switch + str r0, [r1, 0x8] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8071330 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/decompress.s b/asm/decompress.s new file mode 100644 index 000000000..19f8b8626 --- /dev/null +++ b/asm/decompress.s @@ -0,0 +1,1019 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start LZDecompressWram +@ void LZDecompressWram(void *src, void *dest) +LZDecompressWram: @ 8034518 + push {lr} + bl LZ77UnCompWram + pop {r0} + bx r0 + thumb_func_end LZDecompressWram + + thumb_func_start LZDecompressVram +@ void LZDecompressVram(void *src, void *dest) +LZDecompressVram: @ 8034524 + push {lr} + bl LZ77UnCompVram + pop {r0} + bx r0 + thumb_func_end LZDecompressVram + + thumb_func_start LoadCompressedObjectPic +@ u16 LoadCompressedObjectPic(struct obj_tiles *pic) +LoadCompressedObjectPic: @ 8034530 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r0, [r4] + ldr r5, =0x0201c000 + adds r1, r5, 0 + bl LZ77UnCompWram + str r5, [sp] + ldrh r1, [r4, 0x6] + lsls r1, 16 + ldrh r0, [r4, 0x4] + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl LoadObjectPic + lsls r0, 16 + lsrs r0, 16 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end LoadCompressedObjectPic + + thumb_func_start LoadCompressedObjectPicOverrideBuffer +@ void LoadCompressedObjectPicOverrideBuffer(struct obj_tiles *pic, void *tempBuffer) +LoadCompressedObjectPicOverrideBuffer: @ 8034564 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, [r4] + bl LZ77UnCompWram + str r5, [sp] + ldrh r1, [r4, 0x6] + lsls r1, 16 + ldrh r0, [r4, 0x4] + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl LoadObjectPic + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end LoadCompressedObjectPicOverrideBuffer + + thumb_func_start LoadCompressedObjectPalette +@ void LoadCompressedObjectPalette(struct TaggedObjectPalette *palette) +LoadCompressedObjectPalette: @ 803458C + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r0, 0 + ldr r0, [r5] + ldr r4, =0x0201c000 + adds r1, r4, 0 + bl LZ77UnCompWram + str r4, [sp] + ldrh r2, [r5, 0x4] + ldr r1, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x4] + mov r0, sp + bl LoadTaggedObjectPalette + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end LoadCompressedObjectPalette + + thumb_func_start LoadCompressedObjectPaletteOverrideBuffer +@ void LoadCompressedObjectPaletteOverrideBuffer(struct TaggedObjectPalette *palette, void *tempBuffer) +LoadCompressedObjectPaletteOverrideBuffer: @ 80345C0 + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r0, 0 + adds r4, r1, 0 + ldr r0, [r5] + bl LZ77UnCompWram + str r4, [sp] + ldrh r2, [r5, 0x4] + ldr r1, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x4] + mov r0, sp + bl LoadTaggedObjectPalette + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end LoadCompressedObjectPaletteOverrideBuffer + + thumb_func_start DecompressPicFromTable +@ void DecompressPicFromTable(void **picTable, void *dest, u32 index) +DecompressPicFromTable: @ 80345F0 + push {r4,r5,lr} + adds r3, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + movs r0, 0xCE + lsls r0, 1 + cmp r5, r0 + ble _08034610 + ldr r0, =gMonFrontPicTable + ldr r0, [r0] + bl LZ77UnCompWram + b _08034618 + .pool +_08034610: + ldr r0, [r3] + adds r1, r4, 0 + bl LZ77UnCompWram +_08034618: + adds r0, r4, 0 + adds r1, r5, 0 + bl DuplicateDeoxysTiles + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end DecompressPicFromTable + + thumb_func_start DecompressMonPic_DetectFrontOrBack +@ void DecompressMonPic_DetectFrontOrBack(void **picTable, void *dest, u32 speciesId, u32 personality) +DecompressMonPic_DetectFrontOrBack: @ 8034628 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r0, r2, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + movs r1, 0 + cmp r4, r0 + bne _0803463E + movs r1, 0x1 +_0803463E: + str r1, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + bl DecompressMonPic_2 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DecompressMonPic_DetectFrontOrBack + + thumb_func_start DecompressMonPic +@ void DecompressMonPic(void **picTable, void *dest, u32 speciesId, u32 personality, bool8 isFrontPic) +DecompressMonPic: @ 8034654 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r4, r1, 0 + adds r7, r2, 0 + adds r5, r3, 0 + ldr r0, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r7, 0xC9 + bne _080346D0 + movs r0, 0xC0 + lsls r0, 18 + ands r0, r5 + lsrs r0, 18 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r5 + lsrs r1, 12 + orrs r0, r1 + movs r1, 0xC0 + lsls r1, 2 + ands r1, r5 + lsrs r1, 6 + orrs r0, r1 + movs r1, 0x3 + ands r1, r5 + orrs r0, r1 + movs r1, 0x1C + bl __umodsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _080346A2 + movs r1, 0xC9 + b _080346AC +_080346A2: + movs r2, 0xCE + lsls r2, 1 + adds r0, r1, r2 + lsls r0, 16 + lsrs r1, r0, 16 +_080346AC: + mov r0, r8 + cmp r0, 0 + bne _080346C0 + ldr r0, =gMonBackPicTable + lsls r1, 3 + adds r1, r0 + ldr r0, [r1] + b _080346DC + .pool +_080346C0: + ldr r0, =gMonFrontPicTable + lsls r1, 3 + adds r1, r0 + ldr r0, [r1] + b _080346DC + .pool +_080346D0: + movs r0, 0xCE + lsls r0, 1 + cmp r7, r0 + ble _080346E8 + ldr r0, =gMonFrontPicTable + ldr r0, [r0] +_080346DC: + adds r1, r4, 0 + bl LZ77UnCompWram + b _080346F0 + .pool +_080346E8: + ldr r0, [r6] + adds r1, r4, 0 + bl LZ77UnCompWram +_080346F0: + adds r0, r4, 0 + adds r1, r7, 0 + bl DuplicateDeoxysTiles + lsls r0, r7, 16 + lsrs r0, 16 + adds r1, r5, 0 + adds r2, r4, 0 + mov r3, r8 + bl DrawSpindaSpots + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end DecompressMonPic + + thumb_func_start Unused_LZDecompressWramIndirect +@ void Unused_LZDecompressWramIndirect(void **src) +Unused_LZDecompressWramIndirect: @ 8034710 + push {lr} + ldr r0, [r0] + bl LZ77UnCompWram + pop {r0} + bx r0 + thumb_func_end Unused_LZDecompressWramIndirect + + thumb_func_start sub_803471C +sub_803471C: @ 803471C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + mov r9, r0 + str r1, [sp] + str r2, [sp, 0x4] + adds r5, r3, 0 + movs r0, 0x1 + mov r1, r9 + ands r0, r1 + cmp r0, 0 + bne _0803473C + b _080348D4 +_0803473C: + asrs r0, r1, 1 + adds r0, 0x4 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + movs r0, 0 + ldr r2, [sp] + cmp r0, r2 + blt _08034750 + b _08034964 +_08034750: + movs r4, 0x8 + subs r1, r4, r1 + str r1, [sp, 0x10] +_08034756: + movs r7, 0 + adds r0, 0x1 + str r0, [sp, 0x14] + ldr r0, [sp, 0x10] + cmp r7, r0 + bge _080347D2 + ldr r1, [sp, 0x8] + lsls r1, 8 + str r1, [sp, 0x18] + movs r2, 0 + mov r10, r2 + mov r0, r9 + movs r4, 0x8 + subs r0, r4, r0 + str r0, [sp, 0xC] +_08034774: + movs r3, 0 + asrs r0, r7, 1 + adds r1, r7, 0 + movs r2, 0x1 + ands r1, r2 + str r1, [sp, 0x20] + lsls r0, 8 + mov r8, r0 + mov r12, r5 +_08034786: + lsls r1, r3, 5 + ldr r4, [sp, 0x18] + adds r0, r5, r4 + adds r0, r1 + mov r1, r8 + adds r2, r0, r1 + mov r1, r12 + add r1, r8 + movs r6, 0xF +_08034798: + ldr r4, [sp, 0x20] + cmp r4, 0 + bne _080347A8 + strb r4, [r1] + add r4, sp, 0x20 + ldrb r4, [r4] + strb r4, [r2, 0x10] + b _080347B6 +_080347A8: + mov r0, r10 + strb r0, [r1, 0x10] + movs r4, 0x80 + lsls r4, 1 + adds r4, r2, r4 + str r4, [sp, 0x1C] + strb r0, [r4] +_080347B6: + adds r2, 0x1 + adds r1, 0x1 + subs r6, 0x1 + cmp r6, 0 + bge _08034798 + movs r0, 0x20 + add r12, r0 + adds r3, 0x1 + cmp r3, 0x7 + ble _08034786 + adds r7, 0x1 + ldr r1, [sp, 0xC] + cmp r7, r1 + blt _08034774 +_080347D2: + movs r7, 0 + movs r2, 0 +_080347D6: + movs r6, 0 + adds r4, r7, 0x1 + mov r8, r4 + lsls r4, r7, 5 +_080347DE: + adds r0, r6, 0x1 + mov r10, r0 + lsls r1, r6, 8 + adds r0, r1, 0 + adds r0, 0xC0 + adds r0, r5, r0 + adds r0, r4 + adds r1, r5, r1 + adds r1, r4 + movs r3, 0x1F +_080347F2: + strb r2, [r1] + strb r2, [r0] + adds r0, 0x1 + adds r1, 0x1 + subs r3, 0x1 + cmp r3, 0 + bge _080347F2 + mov r6, r10 + cmp r6, 0x7 + ble _080347DE + mov r7, r8 + cmp r7, 0x1 + ble _080347D6 + mov r1, r9 + cmp r1, 0x5 + bne _08034818 + movs r2, 0x90 + lsls r2, 1 + adds r5, r2 +_08034818: + movs r7, 0 + cmp r7, r9 + bge _080348AE +_0803481E: + movs r3, 0 + adds r7, 0x1 + mov r8, r7 + cmp r3, r9 + bge _0803488E +_08034828: + adds r3, 0x1 + mov r10, r3 + ldr r4, [sp, 0x4] + adds r4, 0x20 + adds r7, r5, 0 + adds r7, 0x20 + movs r0, 0x12 + adds r0, r5 + mov r12, r0 + ldr r2, [sp, 0x4] + adds r3, r5, 0 + movs r6, 0x3 +_08034840: + ldrb r0, [r2] + mov r1, r12 + strb r0, [r1] + ldrb r0, [r2, 0x1] + strb r0, [r1, 0x1] + ldrb r0, [r2, 0x2] + strb r0, [r1, 0x1E] + ldrb r0, [r2, 0x3] + strb r0, [r1, 0x1F] + movs r0, 0x81 + lsls r0, 1 + adds r1, r3, r0 + ldrb r0, [r2, 0x10] + strb r0, [r1] + ldr r0, =0x00000103 + adds r1, r3, r0 + ldrb r0, [r2, 0x11] + strb r0, [r1] + movs r0, 0x90 + lsls r0, 1 + adds r1, r3, r0 + ldrb r0, [r2, 0x12] + strb r0, [r1] + ldr r0, =0x00000121 + adds r1, r3, r0 + ldrb r0, [r2, 0x13] + strb r0, [r1] + movs r1, 0x4 + add r12, r1 + adds r2, 0x4 + adds r3, 0x4 + subs r6, 0x1 + cmp r6, 0 + bge _08034840 + str r4, [sp, 0x4] + adds r5, r7, 0 + mov r3, r10 + cmp r3, r9 + blt _08034828 +_0803488E: + mov r2, r9 + cmp r2, 0x7 + bne _080348A0 + adds r5, 0x20 + b _080348A8 + .pool +_080348A0: + mov r4, r9 + cmp r4, 0x5 + bne _080348A8 + adds r5, 0x60 +_080348A8: + mov r7, r8 + cmp r7, r9 + blt _0803481E +_080348AE: + mov r0, r9 + cmp r0, 0x7 + bne _080348BC + movs r1, 0x80 + lsls r1, 1 + adds r5, r1 + b _080348C8 +_080348BC: + mov r2, r9 + cmp r2, 0x5 + bne _080348C8 + movs r4, 0xF0 + lsls r4, 1 + adds r5, r4 +_080348C8: + ldr r0, [sp, 0x14] + ldr r1, [sp] + cmp r0, r1 + bge _080348D2 + b _08034756 +_080348D2: + b _08034964 +_080348D4: + movs r6, 0 + ldr r2, [sp] + cmp r6, r2 + bge _08034964 +_080348DC: + adds r6, 0x1 + mov r10, r6 + mov r4, r9 + cmp r4, 0x6 + bne _080348F4 + movs r0, 0 + movs r3, 0xFF +_080348EA: + strb r0, [r5] + adds r5, 0x1 + subs r3, 0x1 + cmp r3, 0 + bge _080348EA +_080348F4: + movs r7, 0 + cmp r7, r9 + bge _08034948 +_080348FA: + adds r7, 0x1 + mov r8, r7 + mov r1, r9 + lsls r0, r1, 5 + cmp r1, 0x6 + bne _08034914 + movs r1, 0 + movs r3, 0x1F +_0803490A: + strb r1, [r5] + adds r5, 0x1 + subs r3, 0x1 + cmp r3, 0 + bge _0803490A +_08034914: + adds r1, r0, 0 + cmp r1, 0 + ble _0803492E + adds r3, r1, 0 +_0803491C: + ldr r2, [sp, 0x4] + ldrb r0, [r2] + strb r0, [r5] + adds r2, 0x1 + str r2, [sp, 0x4] + adds r5, 0x1 + subs r3, 0x1 + cmp r3, 0 + bne _0803491C +_0803492E: + mov r4, r9 + cmp r4, 0x6 + bne _08034942 + movs r0, 0 + movs r3, 0x1F +_08034938: + strb r0, [r5] + adds r5, 0x1 + subs r3, 0x1 + cmp r3, 0 + bge _08034938 +_08034942: + mov r7, r8 + cmp r7, r9 + blt _080348FA +_08034948: + mov r0, r9 + cmp r0, 0x6 + bne _0803495C + movs r0, 0 + movs r3, 0xFF +_08034952: + strb r0, [r5] + adds r5, 0x1 + subs r3, 0x1 + cmp r3, 0 + bge _08034952 +_0803495C: + mov r6, r10 + ldr r1, [sp] + cmp r6, r1 + blt _080348DC +_08034964: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_803471C + + thumb_func_start sub_8034974 +sub_8034974: @ 8034974 + adds r2, r0, 0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + ldrb r1, [r2, 0x2] + lsls r1, 8 + orrs r0, r1 + ldrb r1, [r2, 0x1] + orrs r0, r1 + bx lr + thumb_func_end sub_8034974 + + thumb_func_start LoadCompressedObjectPicUsingHeap +@ u32 LoadCompressedObjectPicUsingHeap(struct obj_tiles *pic) +LoadCompressedObjectPicUsingHeap: @ 8034988 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r0, [r4] + ldr r0, [r0] + lsrs r0, 8 + bl AllocZeroed + adds r5, r0, 0 + ldr r0, [r4] + adds r1, r5, 0 + bl LZ77UnCompWram + str r5, [sp] + ldrh r1, [r4, 0x6] + lsls r1, 16 + ldrh r0, [r4, 0x4] + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl LoadObjectPic + adds r0, r5, 0 + bl Free + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end LoadCompressedObjectPicUsingHeap + + thumb_func_start LoadCompressedObjectPaletteUsingHeap +@ u32 LoadCompressedObjectPaletteUsingHeap(struct TaggedObjectPalette *palette) +LoadCompressedObjectPaletteUsingHeap: @ 80349C4 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r0, [r4] + ldr r0, [r0] + lsrs r0, 8 + bl AllocZeroed + adds r5, r0, 0 + ldr r0, [r4] + adds r1, r5, 0 + bl LZ77UnCompWram + str r5, [sp] + ldrh r2, [r4, 0x4] + ldr r1, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x4] + mov r0, sp + bl LoadTaggedObjectPalette + adds r0, r5, 0 + bl Free + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end LoadCompressedObjectPaletteUsingHeap + + thumb_func_start DecompressPicFromTable_2 +@ void DecompressPicFromTable_2(void **picTable, void *dest, u32 index) +DecompressPicFromTable_2: @ 8034A08 + push {r4,r5,lr} + adds r3, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + movs r0, 0xCE + lsls r0, 1 + cmp r5, r0 + ble _08034A28 + ldr r0, =gMonFrontPicTable + ldr r0, [r0] + bl LZ77UnCompWram + b _08034A30 + .pool +_08034A28: + ldr r0, [r3] + adds r1, r4, 0 + bl LZ77UnCompWram +_08034A30: + adds r0, r4, 0 + adds r1, r5, 0 + bl DuplicateDeoxysTiles + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end DecompressPicFromTable_2 + + thumb_func_start DecompressMonPic_2 +@ void DecompressMonPic_2(void **picTable, void *dest, u32 speciesId, u32 personality, bool8 isFrontPic) +DecompressMonPic_2: @ 8034A40 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r4, r1, 0 + adds r7, r2, 0 + adds r5, r3, 0 + ldr r0, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r7, 0xC9 + bne _08034ABC + movs r0, 0xC0 + lsls r0, 18 + ands r0, r5 + lsrs r0, 18 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r5 + lsrs r1, 12 + orrs r0, r1 + movs r1, 0xC0 + lsls r1, 2 + ands r1, r5 + lsrs r1, 6 + orrs r0, r1 + movs r1, 0x3 + ands r1, r5 + orrs r0, r1 + movs r1, 0x1C + bl __umodsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _08034A8E + movs r1, 0xC9 + b _08034A98 +_08034A8E: + movs r2, 0xCE + lsls r2, 1 + adds r0, r1, r2 + lsls r0, 16 + lsrs r1, r0, 16 +_08034A98: + mov r0, r8 + cmp r0, 0 + bne _08034AAC + ldr r0, =gMonBackPicTable + lsls r1, 3 + adds r1, r0 + ldr r0, [r1] + b _08034AC8 + .pool +_08034AAC: + ldr r0, =gMonFrontPicTable + lsls r1, 3 + adds r1, r0 + ldr r0, [r1] + b _08034AC8 + .pool +_08034ABC: + movs r0, 0xCE + lsls r0, 1 + cmp r7, r0 + ble _08034AD4 + ldr r0, =gMonFrontPicTable + ldr r0, [r0] +_08034AC8: + adds r1, r4, 0 + bl LZ77UnCompWram + b _08034ADC + .pool +_08034AD4: + ldr r0, [r6] + adds r1, r4, 0 + bl LZ77UnCompWram +_08034ADC: + adds r0, r4, 0 + adds r1, r7, 0 + bl DuplicateDeoxysTiles + lsls r0, r7, 16 + lsrs r0, 16 + adds r1, r5, 0 + adds r2, r4, 0 + mov r3, r8 + bl DrawSpindaSpots + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end DecompressMonPic_2 + + thumb_func_start DecompressMonPic_DetectFrontOrBack_2 +@ void DecompressMonPic_DetectFrontOrBack_2(void **picTable, void *dest, u32 speciesId, u32 personality) +DecompressMonPic_DetectFrontOrBack_2: @ 8034AFC + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r0, r2, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + movs r1, 0 + cmp r4, r0 + bne _08034B12 + movs r1, 0x1 +_08034B12: + str r1, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + bl DecompressMonPic_2 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DecompressMonPic_DetectFrontOrBack_2 + + thumb_func_start sub_8034B28 +sub_8034B28: @ 8034B28 + push {lr} + adds r3, r0, 0 + movs r0, 0xCE + lsls r0, 1 + cmp r2, r0 + ble _08034B44 + ldr r0, =gMonFrontPicTable + ldr r0, [r0] + bl LZ77UnCompWram + b _08034B4A + .pool +_08034B44: + ldr r0, [r3] + bl LZ77UnCompWram +_08034B4A: + pop {r0} + bx r0 + thumb_func_end sub_8034B28 + + thumb_func_start DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack +@ void DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack(void **picTable, void *dest, u32 speciesId, u32 personality) +DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack: @ 8034B50 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r0, r2, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + movs r1, 0 + cmp r4, r0 + bne _08034B66 + movs r1, 0x1 +_08034B66: + str r1, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + bl DecompressMonPicWithoutDuplicatingDeoxysTiles + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack + + thumb_func_start DecompressMonPicWithoutDuplicatingDeoxysTiles +@ void DecompressMonPicWithoutDuplicatingDeoxysTiles(void **picTable, void *dest, u32 speciesId, u32 personality, bool8 isFrontPic) +DecompressMonPicWithoutDuplicatingDeoxysTiles: @ 8034B7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r5, r1, 0 + adds r7, r2, 0 + adds r4, r3, 0 + ldr r0, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r7, 0xC9 + bne _08034BF8 + movs r0, 0xC0 + lsls r0, 18 + ands r0, r4 + lsrs r0, 18 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r4 + lsrs r1, 12 + orrs r0, r1 + movs r1, 0xC0 + lsls r1, 2 + ands r1, r4 + lsrs r1, 6 + orrs r0, r1 + movs r1, 0x3 + ands r1, r4 + orrs r0, r1 + movs r1, 0x1C + bl __umodsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _08034BCA + movs r1, 0xC9 + b _08034BD4 +_08034BCA: + movs r2, 0xCE + lsls r2, 1 + adds r0, r1, r2 + lsls r0, 16 + lsrs r1, r0, 16 +_08034BD4: + mov r0, r8 + cmp r0, 0 + bne _08034BE8 + ldr r0, =gMonBackPicTable + lsls r1, 3 + adds r1, r0 + ldr r0, [r1] + b _08034C04 + .pool +_08034BE8: + ldr r0, =gMonFrontPicTable + lsls r1, 3 + adds r1, r0 + ldr r0, [r1] + b _08034C04 + .pool +_08034BF8: + movs r0, 0xCE + lsls r0, 1 + cmp r7, r0 + ble _08034C10 + ldr r0, =gMonFrontPicTable + ldr r0, [r0] +_08034C04: + adds r1, r5, 0 + bl LZ77UnCompWram + b _08034C18 + .pool +_08034C10: + ldr r0, [r6] + adds r1, r5, 0 + bl LZ77UnCompWram +_08034C18: + lsls r0, r7, 16 + lsrs r0, 16 + adds r1, r4, 0 + adds r2, r5, 0 + mov r3, r8 + bl DrawSpindaSpots + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end DecompressMonPicWithoutDuplicatingDeoxysTiles + + thumb_func_start DuplicateDeoxysTiles +@ void DuplicateDeoxysTiles(void *pointer, u32 speciesId) +DuplicateDeoxysTiles: @ 8034C30 + push {lr} + adds r3, r0, 0 + movs r0, 0xCD + lsls r0, 1 + cmp r1, r0 + bne _08034C4A + movs r1, 0x80 + lsls r1, 4 + adds r0, r3, r1 + ldr r2, =0x04000200 + adds r1, r3, 0 + bl CpuSet +_08034C4A: + pop {r0} + bx r0 + .pool + thumb_func_end DuplicateDeoxysTiles + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/decoration.s b/asm/decoration.s new file mode 100644 index 000000000..bb667241c --- /dev/null +++ b/asm/decoration.s @@ -0,0 +1,7167 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8126968 +sub_8126968: @ 8126968 + push {lr} + ldr r3, =0x0203a173 + ldrb r0, [r3] + cmp r0, 0x7 + bhi _0812697E + ldr r2, =0x0203a14c + ldr r1, =0x0203bc40 + lsls r0, 3 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] +_0812697E: + ldr r2, =0x0203a17c + ldrb r0, [r2, 0x9] + cmp r0, 0 + bne _08126996 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r3, =0x00001aae + adds r1, r0, r3 + str r1, [r2] + ldr r1, =0x00001abe + adds r0, r1 + str r0, [r2, 0x4] +_08126996: + ldrb r0, [r2, 0x9] + cmp r0, 0x1 + bne _081269AC + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r3, =0x0000271c + adds r1, r0, r3 + str r1, [r2] + ldr r1, =0x00002728 + adds r0, r1 + str r0, [r2, 0x4] +_081269AC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8126968 + + thumb_func_start sub_81269D4 +sub_81269D4: @ 81269D4 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, =0x0203a188 + adds r4, r1, r0 + cmp r1, 0 + bne _08126A28 + ldr r0, =gUnknown_085A6B90 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, =gUnknown_085A6B48 + movs r1, 0x4 + bl GetMaxWidthInMenuTable + lsls r0, 24 + ldr r2, =0x00ffffff + ldr r1, [sp] + ands r1, r2 + orrs r1, r0 + str r1, [sp] + lsrs r0, r1, 24 + cmp r0, 0x12 + bls _08126A14 + adds r0, r2, 0 + ands r0, r1 + movs r1, 0x90 + lsls r1, 21 + orrs r0, r1 + str r0, [sp] +_08126A14: + mov r0, sp + b _08126A2E + .pool +_08126A28: + lsls r0, r1, 3 + ldr r1, =gUnknown_085A6B90 + adds r0, r1 +_08126A2E: + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r2, 0x85 + lsls r2, 2 + movs r1, 0 + movs r3, 0xE + bl SetWindowBorderStyle + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldrb r0, [r4] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81269D4 + + thumb_func_start sub_8126A58 +sub_8126A58: @ 8126A58 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x0203a188 + adds r4, r0 + ldrb r0, [r4] + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + bl ClearWindowTilemap + ldrb r0, [r4] + bl RemoveWindow + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8126A58 + + thumb_func_start sub_8126A88 +sub_8126A88: @ 8126A88 + push {r4,lr} + movs r0, 0 + bl sub_81269D4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r2, =gUnknown_085A6B48 + adds r0, r4, 0 + movs r1, 0x4 + bl PrintMenuTable + ldr r0, =0x0203a150 + ldrb r2, [r0] + adds r0, r4, 0 + movs r1, 0x4 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8126A88 + + thumb_func_start sub_8126ABC +sub_8126ABC: @ 8126ABC + push {lr} + ldr r1, =0x0203a150 + movs r0, 0 + strb r0, [r1] + bl script_env_2_enable + bl sub_8126A88 + bl sub_8126C08 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8126ABC + + thumb_func_start sub_8126AD8 +sub_8126AD8: @ 8126AD8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8126ABC + ldr r2, =0x0203a17c + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r3, =0x00001aae + adds r1, r0, r3 + str r1, [r2] + ldr r1, =0x00001abe + adds r0, r1 + str r0, [r2, 0x4] + movs r1, 0 + movs r0, 0x10 + strb r0, [r2, 0x8] + strb r1, [r2, 0x9] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8126B80 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8126AD8 + + thumb_func_start sub_8126B2C +sub_8126B2C: @ 8126B2C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8126ABC + ldr r2, =0x0203a17c + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r3, =0x0000271c + adds r1, r0, r3 + str r1, [r2] + ldr r1, =0x00002728 + adds r0, r1 + str r0, [r2, 0x4] + movs r0, 0xC + strb r0, [r2, 0x8] + movs r0, 0x1 + strb r0, [r2, 0x9] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8126B80 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8126B2C + + thumb_func_start sub_8126B80 +sub_8126B80: @ 8126B80 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08126C00 + bl GetMenuCursorPos + lsls r0, 24 + lsrs r4, r0, 24 + bl ProcessMenuInput + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _08126BD8 + adds r0, 0x1 + cmp r1, r0 + beq _08126BF4 + movs r0, 0x5 + bl audio_play + ldr r1, =gUnknown_085A6B48 + ldr r0, =0x0203a150 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r1, [r0] + adds r0, r5, 0 + bl _call_via_r1 + b _08126C00 + .pool +_08126BD8: + bl GetMenuCursorPos + ldr r1, =0x0203a150 + strb r0, [r1] + lsls r0, r4, 24 + asrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + beq _08126C00 + bl sub_8126C08 + b _08126C00 + .pool +_08126BF4: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_8126D6C +_08126C00: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8126B80 + + thumb_func_start sub_8126C08 +sub_8126C08: @ 8126C08 + push {lr} + sub sp, 0x10 + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r1, =gUnknown_085A6B68 + ldr r0, =0x0203a150 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + 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, 0 + movs r1, 0x1 + movs r3, 0 + bl AddTextPrinterParametrized + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8126C08 + + thumb_func_start sub_8126C48 +sub_8126C48: @ 8126C48 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_8161B10 + lsls r0, 24 + cmp r0, 0 + bne _08126C7C + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EA83D + adds r0, r4, 0 + bl ExpandStringRefs + ldr r2, =sub_8126DA4 + adds r0, r5, 0 + adds r1, r4, 0 + bl DisplayItemMessageOnField + b _08126C96 + .pool +_08126C7C: + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0 + strh r1, [r0, 0x1E] + ldr r0, =0x0203a173 + strb r2, [r0] + adds r0, r5, 0 + bl sub_8126DCC +_08126C96: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8126C48 + + thumb_func_start sub_8126CA4 +sub_8126CA4: @ 8126CA4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl sub_81299AC + lsls r0, 24 + cmp r0, 0 + bne _08126CD8 + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EAAEC + adds r0, r4, 0 + bl ExpandStringRefs + ldr r2, =sub_8126DA4 + adds r0, r5, 0 + adds r1, r4, 0 + bl DisplayItemMessageOnField + b _08126D00 + .pool +_08126CD8: + movs r0, 0 + bl sub_8126A58 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xC] + ldr r1, =sub_8129ABC + str r1, [r0] +_08126D00: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8126CA4 + + thumb_func_start sub_8126D10 +sub_8126D10: @ 8126D10 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_8161B10 + lsls r0, 24 + cmp r0, 0 + bne _08126D44 + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EA83D + adds r0, r4, 0 + bl ExpandStringRefs + ldr r2, =sub_8126DA4 + adds r0, r5, 0 + adds r1, r4, 0 + bl DisplayItemMessageOnField + b _08126D5E + .pool +_08126D44: + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x1 + strh r1, [r0, 0x1E] + ldr r0, =0x0203a173 + strb r2, [r0] + adds r0, r5, 0 + bl sub_8126DCC +_08126D5E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8126D10 + + thumb_func_start sub_8126D6C +sub_8126D6C: @ 8126D6C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0 + bl sub_8126A58 + ldr r0, =0x0203a17c + ldrb r0, [r0, 0x9] + cmp r0, 0 + bne _08126D98 + ldr r0, =gUnknown_0823B4E8 + bl script_env_1_execute_new_script + adds r0, r4, 0 + bl DestroyTask + b _08126D9E + .pool +_08126D98: + adds r0, r4, 0 + bl sub_816B060 +_08126D9E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8126D6C + + thumb_func_start sub_8126DA4 +sub_8126DA4: @ 8126DA4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8126C08 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8126B80 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8126DA4 + + thumb_func_start sub_8126DCC +sub_8126DCC: @ 8126DCC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_085A6BB0 + movs r1, 0xD0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0 + movs r1, 0 + bl sub_8197434 + movs r0, 0 + bl sub_8126A58 + adds r0, r4, 0 + bl sub_8126DFC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8126DCC + + thumb_func_start sub_8126DFC +sub_8126DFC: @ 8126DFC + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x1 + bl sub_81269D4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + bl sub_8126E8C + ldr r0, =0x0203a173 + ldrb r2, [r0] + adds r0, r4, 0 + movs r1, 0x9 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8127088 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8126DFC + + thumb_func_start sub_8126E44 +sub_8126E44: @ 8126E44 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =0x0203a188 + ldrb r0, [r5, 0x1] + movs r1, 0x11 + bl FillWindowPixelBuffer + adds r0, r4, 0 + bl sub_8126E8C + ldrb r0, [r5, 0x1] + ldr r1, =0x0203a173 + ldrb r2, [r1] + movs r1, 0x9 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8127088 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8126E44 + + thumb_func_start sub_8126E8C +sub_8126E8C: @ 8126E8C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r1, r0, r1 + ldr r0, =0x0203a188 + ldrb r5, [r0, 0x1] + ldr r0, =0x0203a17c + ldrb r0, [r0, 0x9] + movs r2, 0 + mov r8, r2 + cmp r0, 0x1 + bne _08126EC0 + movs r2, 0x16 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08126EC0 + movs r0, 0x1 + mov r8, r0 +_08126EC0: + movs r4, 0 + lsls r2, r6, 2 + mov r9, r2 + movs r7, 0xFF +_08126EC8: + mov r0, r8 + cmp r0, 0x1 + bne _08126EF8 + cmp r4, 0x6 + beq _08126EF8 + cmp r4, 0x7 + beq _08126EF8 + lsls r3, r4, 28 + lsrs r3, 24 + str r0, [sp] + str r7, [sp, 0x4] + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x8 + bl sub_8126F68 + b _08126F0C + .pool +_08126EF8: + lsls r3, r4, 28 + lsrs r3, 24 + movs r0, 0 + str r0, [sp] + str r7, [sp, 0x4] + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x8 + bl sub_8126F68 +_08126F0C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _08126EC8 + ldr r0, =0x03005e00 + mov r2, r9 + adds r1, r2, r6 + lsls r1, 3 + adds r1, r0 + movs r2, 0x1E + ldrsh r0, [r1, r2] + ldr r2, =gUnknown_085E8CF0 + cmp r0, 0x2 + bne _08126F2C + ldr r2, =gUnknown_085EB7EA +_08126F2C: + lsls r0, r4, 4 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x1 + movs r3, 0x8 + bl Print + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8126E8C + + thumb_func_start sub_8126F68 +sub_8126F68: @ 8126F68 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + ldr r4, [sp, 0x38] + ldr r6, [sp, 0x3C] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0xC] + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r5, r3, 24 + lsls r4, 24 + lsrs r1, r4, 24 + lsls r6, 24 + lsrs r6, 24 + mov r9, r6 + movs r0, 0x60 + str r0, [sp, 0x14] + cmp r7, 0x8 + bne _08126FA2 + movs r2, 0x68 + str r2, [sp, 0x14] +_08126FA2: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x02021fc4 + adds r0, r4, 0 + bl sub_8127058 + adds r0, r4, 0 + bl GetStringLength + lsls r0, 16 + lsrs r0, 16 + adds r6, r0, r4 + ldr r1, =gUnknown_085A6B28 + mov r2, r8 + lsls r0, r2, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r6, 0 + bl CopyString + str r5, [sp] + mov r0, r9 + str r0, [sp, 0x4] + movs r2, 0 + mov r10, r2 + str r2, [sp, 0x8] + ldr r0, [sp, 0xC] + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r7, 0 + bl Print + mov r0, r8 + bl sub_8161AD0 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + adds r6, r0, 0 + movs r0, 0xBA + strb r0, [r6] + adds r6, 0x1 + ldr r1, =0x0203bc40 + mov r2, r8 + lsls r0, r2, 3 + adds r0, r1 + ldrb r1, [r0, 0x4] + adds r0, r6, 0 + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + movs r0, 0x1 + adds r1, r4, 0 + ldr r2, [sp, 0x14] + bl GetStringRightAlignXOffset + lsls r0, 24 + lsrs r7, r0, 24 + str r5, [sp] + mov r0, r9 + str r0, [sp, 0x4] + mov r2, r10 + str r2, [sp, 0x8] + ldr r0, [sp, 0xC] + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r7, 0 + 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_8126F68 + + thumb_func_start sub_8127058 +sub_8127058: @ 8127058 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r4, r1, 24 + lsrs r4, 24 + ldr r1, =gUnknown_085EA7C8 + bl CopyString + cmp r4, 0x1 + bne _08127078 + movs r0, 0x4 + strb r0, [r5, 0x2] + movs r0, 0x5 + b _0812707E + .pool +_08127078: + movs r0, 0x2 + strb r0, [r5, 0x2] + movs r0, 0x3 +_0812707E: + strb r0, [r5, 0x5] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8127058 + + thumb_func_start sub_8127088 +sub_8127088: @ 8127088 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081270DE + bl ProcessMenuInput + lsls r0, 24 + lsrs r4, r0, 24 + asrs r1, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _081270C0 + cmp r1, r0 + bgt _081270BC + subs r0, 0x1 + cmp r1, r0 + beq _081270DE + b _081270CE + .pool +_081270BC: + cmp r1, 0x8 + bne _081270CE +_081270C0: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_812719C + b _081270DE +_081270CE: + movs r0, 0x5 + bl audio_play + ldr r0, =0x0203a173 + strb r4, [r0] + adds r0, r5, 0 + bl sub_81270E8 +_081270DE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8127088 + + thumb_func_start sub_81270E8 +sub_81270E8: @ 81270E8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x0203a173 + ldrb r0, [r4] + bl sub_8161AD0 + ldr r1, =0x0203a151 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + beq _08127154 + ldrb r0, [r4] + bl sub_8161A38 + ldr r2, =0x0203a14c + ldr r1, =0x0203bc40 + ldrb r0, [r4] + lsls r0, 3 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + adds r0, r5, 0 + bl sub_81279B4 + ldr r0, =0x0203a170 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x0203a16e + strh r1, [r0] + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8127620 + str r1, [r0] + b _0812716E + .pool +_08127154: + movs r0, 0x1 + bl sub_8126A58 + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EA83D + adds r0, r4, 0 + bl ExpandStringRefs + ldr r2, =sub_8127180 + adds r0, r5, 0 + adds r1, r4, 0 + bl DisplayItemMessageOnField +_0812716E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81270E8 + + thumb_func_start sub_8127180 +sub_8127180: @ 8127180 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + adds r0, r4, 0 + bl sub_8126DFC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8127180 + + thumb_func_start sub_812719C +sub_812719C: @ 812719C + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1E + ldrsh r0, [r0, r1] + cmp r0, 0x2 + beq _081271C0 + adds r0, r2, 0 + bl sub_81271CC + b _081271C6 + .pool +_081271C0: + adds r0, r2, 0 + bl sub_8127268 +_081271C6: + pop {r0} + bx r0 + thumb_func_end sub_812719C + + thumb_func_start sub_81271CC +sub_81271CC: @ 81271CC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl sub_8126A58 + bl sub_8126A88 + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + bl sub_8126C08 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8126B80 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81271CC + + thumb_func_start sub_8127208 +sub_8127208: @ 8127208 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_085A6BB0 + movs r1, 0xD0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0 + movs r1, 0 + bl sub_8197434 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x2 + strh r1, [r0, 0x1E] + ldr r0, =0x0203a173 + strb r2, [r0] + adds r0, r4, 0 + bl sub_8126DFC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8127208 + + thumb_func_start sub_8127250 +sub_8127250: @ 8127250 + push {lr} + lsls r1, 24 + ldr r2, =gUnknown_085A6B28 + lsrs r1, 22 + adds r1, r2 + ldr r1, [r1] + bl CopyString + pop {r0} + bx r0 + .pool + thumb_func_end sub_8127250 + + thumb_func_start sub_8127268 +sub_8127268: @ 8127268 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl sub_8126A58 + adds r0, r4, 0 + bl sub_8133E1C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8127268 + + thumb_func_start sub_8127284 +sub_8127284: @ 8127284 + push {lr} + ldr r3, =0x0203a18c + ldr r2, [r3] + ldr r0, =0x0203a151 + ldrb r0, [r0] + adds r0, 0x1 + movs r1, 0xA4 + lsls r1, 3 + adds r2, r1 + strb r0, [r2] + ldr r0, [r3] + adds r1, r0, r1 + ldrb r1, [r1] + cmp r1, 0x8 + bls _081272B8 + ldr r2, =0x00000521 + adds r1, r0, r2 + movs r0, 0x8 + strb r0, [r1] + b _081272BE + .pool +_081272B8: + ldr r2, =0x00000521 + adds r0, r2 + strb r1, [r0] +_081272BE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8127284 + + thumb_func_start sub_81272C8 +sub_81272C8: @ 81272C8 + push {r4,lr} + ldr r0, =0x0203a170 + ldr r1, =0x0203a16e + ldr r2, =0x0203a18c + ldr r3, [r2] + ldr r4, =0x00000521 + adds r2, r3, r4 + ldrb r2, [r2] + subs r4, 0x1 + adds r3, r4 + ldrb r3, [r3] + bl sub_812225C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81272C8 + + thumb_func_start sub_81272F8 +sub_81272F8: @ 81272F8 + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x0203a170 + ldr r1, =0x0203a16e + ldr r2, =0x0203a18c + ldr r3, [r2] + ldr r4, =0x00000521 + adds r2, r3, r4 + ldrb r2, [r2] + subs r4, 0x1 + adds r3, r4 + ldrb r3, [r3] + movs r4, 0x8 + str r4, [sp] + bl sub_8122298 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81272F8 + + thumb_func_start sub_8127330 +sub_8127330: @ 8127330 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r1, r0 + ldr r0, =0x0203a173 + ldrb r0, [r0] + subs r0, 0x6 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _08127378 + ldr r0, =0x0203a17c + ldrb r0, [r0, 0x9] + cmp r0, 0x1 + bne _08127378 + movs r2, 0x16 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08127378 + ldr r0, =0x02021cc4 + movs r1, 0x1 + bl sub_8127058 + b _08127380 + .pool +_08127378: + ldr r0, =0x02021cc4 + movs r1, 0 + bl sub_8127058 +_08127380: + movs r6, 0 + ldr r1, =0x0203a18c + ldr r0, [r1] + movs r3, 0xA4 + lsls r3, 3 + adds r0, r3 + ldrb r0, [r0] + subs r0, 0x1 + cmp r6, r0 + bge _081273D6 + adds r5, r1, 0 +_08127396: + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + movs r0, 0xA4 + lsls r0, 1 + adds r4, r0 + ldr r0, [r5] + adds r0, r4 + ldr r1, =0x0203a14c + ldr r1, [r1] + adds r1, r6 + ldrb r1, [r1] + bl sub_8127454 + ldr r1, [r5] + lsls r2, r6, 3 + adds r0, r1, r2 + adds r4, r1, r4 + str r4, [r0] + adds r0, r1, 0x4 + adds r0, r2 + str r6, [r0] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + movs r2, 0xA4 + lsls r2, 3 + adds r1, r2 + ldrb r0, [r1] + subs r0, 0x1 + cmp r6, r0 + blt _08127396 +_081273D6: + ldr r5, =0x0203a18c + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + movs r3, 0xA4 + lsls r3, 1 + adds r4, r3 + ldr r0, [r5] + adds r0, r4 + ldr r1, =gUnknown_085E8CF0 + bl CopyString + ldr r0, [r5] + lsls r2, r6, 3 + adds r1, r0, r2 + adds r4, r0, r4 + str r4, [r1] + adds r0, 0x4 + adds r0, r2 + movs r1, 0x2 + negs r1, r1 + str r1, [r0] + ldr r2, =0x03006310 + adds r1, r2, 0 + ldr r0, =gUnknown_085A6BD0 + ldm r0!, {r3,r4,r6} + stm r1!, {r3,r4,r6} + ldm r0!, {r3,r4,r6} + stm r1!, {r3,r4,r6} + ldr r0, =0x0203a188 + ldrb r0, [r0, 0x1] + strb r0, [r2, 0x10] + ldr r0, [r5] + movs r4, 0xA4 + lsls r4, 3 + adds r1, r0, r4 + ldrb r1, [r1] + strh r1, [r2, 0xC] + str r0, [r2] + ldr r6, =0x00000521 + adds r0, r6 + ldrb r0, [r0] + strh r0, [r2, 0xE] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8127330 + + thumb_func_start sub_8127454 +sub_8127454: @ 8127454 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r4, r1, 16 + lsrs r4, 16 + ldr r1, =0x02021cc4 + bl CopyString + lsls r4, 5 + ldr r0, =gUnknown_085A5C09 + adds r4, r0 + adds r0, r5, 0 + adds r1, r4, 0 + bl AppendString + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8127454 + + thumb_func_start sub_8127480 +sub_8127480: @ 8127480 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + beq _08127492 + movs r0, 0x5 + bl audio_play +_08127492: + adds r0, r4, 0 + bl sub_8127744 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8127480 + + thumb_func_start sub_81274A0 +sub_81274A0: @ 81274A0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + mov r8, r6 + lsls r2, 24 + lsrs r5, r2, 24 + adds r7, r5, 0 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _081274F6 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_81277BC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081274DC + adds r3, r5, 0x2 + adds r0, r6, 0 + movs r1, 0x18 + movs r2, 0x5C + bl blit_move_info_icon + b _081274F6 +_081274DC: + adds r0, r4, 0 + bl sub_81277E8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081274F6 + adds r3, r7, 0x2 + mov r0, r8 + movs r1, 0x19 + movs r2, 0x5C + bl blit_move_info_icon +_081274F6: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81274A0 + + thumb_func_start sub_8127500 +sub_8127500: @ 8127500 + push {r4,lr} + sub sp, 0x10 + ldr r4, =0x0203a18c + ldr r1, [r4] + ldr r2, =0x00000522 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _08127540 + subs r2, 0x2 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + subs r0, r1 + str r0, [sp] + movs r0, 0x6E + str r0, [sp, 0x4] + str r0, [sp, 0x8] + ldr r0, =0x0203a170 + str r0, [sp, 0xC] + movs r0, 0x2 + movs r1, 0x3C + movs r2, 0xC + movs r3, 0x94 + bl AddScrollIndicatorArrowPairParametrized + ldr r1, [r4] + ldr r2, =0x00000522 + adds r1, r2 + strb r0, [r1] +_08127540: + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8127500 + + thumb_func_start sub_8127554 +sub_8127554: @ 8127554 + push {r4,lr} + ldr r4, =0x0203a18c + ldr r0, [r4] + ldr r2, =0x00000522 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08127572 + bl RemoveScrollIndicatorArrowPair + ldr r0, [r4] + ldr r1, =0x00000522 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] +_08127572: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8127554 + + thumb_func_start sub_8127580 +sub_8127580: @ 8127580 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl sub_81269D4 + adds r0, r4, 0 + bl sub_812759C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8127580 + + thumb_func_start sub_812759C +sub_812759C: @ 812759C + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + ldr r0, =0x03005e08 + adds r5, r0 + movs r0, 0x3 + bl sub_81269D4 + ldr r0, =0x0203a173 + ldrb r0, [r0] + bl sub_8127718 + ldr r6, =0x0203a18c + ldr r0, =0x00000524 + bl AllocZeroed + str r0, [r6] + ldr r1, =0x00000522 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + bl sub_8127284 + bl sub_81272C8 + bl sub_81272F8 + adds r0, r4, 0 + bl sub_8127330 + ldr r0, =0x03006310 + ldr r1, =0x0203a170 + ldrh r1, [r1] + ldr r2, =0x0203a16e + ldrh r2, [r2] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x1A] + bl sub_8127500 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812759C + + thumb_func_start sub_8127620 +sub_8127620: @ 8127620 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_812759C + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_812764C + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8127620 + + thumb_func_start sub_812764C +sub_812764C: @ 812764C + 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, =0x03005e08 + adds r5, r0, r1 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08127700 + ldrb r0, [r5, 0x1A] + bl ListMenuHandleInput + adds r4, r0, 0 + ldrb r0, [r5, 0x1A] + ldr r7, =0x0203a170 + ldr r1, =0x0203a16e + mov r8, r1 + adds r1, r7, 0 + mov r2, r8 + bl get_coro_args_x18_x1A + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _081276A4 + adds r0, 0x1 + cmp r4, r0 + bne _081276C4 + b _08127700 + .pool +_081276A4: + movs r0, 0x5 + bl audio_play + ldr r0, =gUnknown_085A6B78 + movs r2, 0x16 + ldrsh r1, [r5, r2] + lsls r1, 3 + adds r0, 0x4 + adds r1, r0 + ldr r1, [r1] + adds r0, r6, 0 + bl _call_via_r1 + b _08127700 + .pool +_081276C4: + movs r0, 0x5 + bl audio_play + ldr r0, =0x0203a172 + strb r4, [r0] + bl sub_8127554 + ldrb r0, [r5, 0x1A] + adds r1, r7, 0 + mov r2, r8 + bl sub_81AE6C8 + movs r0, 0x1 + bl sub_8126A58 + bl sub_81277A8 + ldr r0, =0x0203a18c + ldr r0, [r0] + bl Free + ldr r1, =gUnknown_085A6B78 + movs r2, 0x16 + ldrsh r0, [r5, r2] + lsls r0, 3 + adds r0, r1 + ldr r1, [r0] + adds r0, r6, 0 + bl _call_via_r1 +_08127700: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812764C + + thumb_func_start sub_8127718 +sub_8127718: @ 8127718 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x2 + bl sub_81269D4 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl sub_8126F68 + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8127718 + + thumb_func_start sub_8127744 +sub_8127744: @ 8127744 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + ldr r0, =0x0203a188 + ldrb r5, [r0, 0x3] + adds r0, r5, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, =0x0203a151 + ldrb r0, [r0] + cmp r4, r0 + bcc _08127770 + ldr r2, =gUnknown_085E8D62 + b _08127782 + .pool +_08127770: + ldr r1, =gUnknown_085A5C08 + ldr r0, =0x0203a14c + ldr r0, [r0] + adds r0, r4 + ldrb r0, [r0] + lsls r0, 5 + adds r1, 0x18 + adds r0, r1 + ldr r2, [r0] +_08127782: + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x1 + movs r3, 0 + bl Print + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8127744 + + thumb_func_start sub_81277A8 +sub_81277A8: @ 81277A8 + push {lr} + movs r0, 0x3 + bl sub_8126A58 + movs r0, 0x2 + bl sub_8126A58 + pop {r0} + bx r0 + thumb_func_end sub_81277A8 + + thumb_func_start sub_81277BC +sub_81277BC: @ 81277BC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r3, =0x0203a152 +_081277C6: + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081277D8 + movs r0, 0x1 + b _081277E4 + .pool +_081277D8: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bls _081277C6 + movs r0, 0 +_081277E4: + pop {r1} + bx r1 + thumb_func_end sub_81277BC + + thumb_func_start sub_81277E8 +sub_81277E8: @ 81277E8 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r3, =0x0203a162 +_081277F2: + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _08127804 + movs r0, 0x1 + b _08127810 + .pool +_08127804: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xB + bls _081277F2 + movs r0, 0 +_08127810: + pop {r1} + bx r1 + thumb_func_end sub_81277E8 + + thumb_func_start sub_8127814 +sub_8127814: @ 8127814 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r5, 0 + ldr r0, =0x0203a152 + movs r1, 0 + movs r2, 0x10 + bl memset + ldr r0, =0x0203a162 + movs r1, 0 + movs r2, 0xC + bl memset + movs r6, 0 + ldr r0, =0x03005d8c + mov r10, r0 + ldr r1, =0x00001aae + mov r9, r1 + ldr r3, =0x0203a173 + mov r8, r3 +_08127842: + mov r1, r10 + ldr r0, [r1] + add r0, r9 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0 + beq _081278E2 + movs r2, 0 + mov r3, r8 + ldrb r0, [r3] + lsls r0, 3 + ldr r1, =0x0203bc40 + adds r0, r1 + ldrb r0, [r0, 0x4] + cmp r2, r0 + bcs _081278E2 + ldr r7, =0x0203a152 + adds r3, r1, 0 + mov r12, r3 +_08127868: + ldr r0, =0x0203a14c + ldr r1, [r0] + adds r1, r2 + mov r3, r10 + ldr r0, [r3] + add r0, r9 + adds r0, r6 + ldrb r1, [r1] + adds r4, r2, 0x1 + ldrb r0, [r0] + cmp r1, r0 + bne _081278D0 + movs r1, 0 + cmp r1, r5 + bcs _081278A2 + ldrb r0, [r7] + cmp r0, r4 + beq _081278A2 + ldr r3, =0x0203a152 + adds r2, r4, 0 +_08127890: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r5 + bcs _081278A2 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _08127890 +_081278A2: + cmp r1, r5 + bne _081278D0 + adds r0, r5, r7 + strb r4, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + b _081278E2 + .pool +_081278D0: + lsls r0, r4, 16 + lsrs r2, r0, 16 + mov r1, r8 + ldrb r0, [r1] + lsls r0, 3 + add r0, r12 + ldrb r0, [r0, 0x4] + cmp r2, r0 + bcc _08127868 +_081278E2: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0xF + bls _08127842 + movs r5, 0 + movs r6, 0 + ldr r3, =0x0203bc40 + mov r8, r3 +_081278F4: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x0000271c + adds r0, r1 + adds r0, r6 + ldrb r0, [r0] + adds r7, r6, 0x1 + cmp r0, 0 + beq _0812799A + movs r2, 0 + b _0812798C + .pool +_08127918: + ldr r0, =0x0203a14c + ldr r1, [r0] + adds r1, r2 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r3, =0x0000271c + adds r0, r3 + adds r0, r6 + ldrb r1, [r1] + adds r4, r2, 0x1 + ldrb r0, [r0] + cmp r1, r0 + bne _08127988 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_81277BC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08127988 + movs r1, 0 + cmp r1, r5 + bcs _08127966 + ldr r2, =0x0203a162 + ldrb r0, [r2] + cmp r0, r4 + beq _08127966 + adds r3, r2, 0 + adds r2, r4, 0 +_08127954: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r5 + bcs _08127966 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _08127954 +_08127966: + cmp r1, r5 + bne _08127988 + ldr r0, =0x0203a162 + adds r0, r5, r0 + strb r4, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + b _0812799A + .pool +_08127988: + lsls r0, r4, 16 + lsrs r2, r0, 16 +_0812798C: + ldr r0, =0x0203a173 + ldrb r0, [r0] + lsls r0, 3 + add r0, r8 + ldrb r0, [r0, 0x4] + cmp r2, r0 + bcc _08127918 +_0812799A: + lsls r0, r7, 16 + lsrs r6, r0, 16 + cmp r6, 0xB + bls _081278F4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8127814 + + thumb_func_start sub_81279B4 +sub_81279B4: @ 81279B4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_8127814 + pop {r0} + bx r0 + thumb_func_end sub_81279B4 + + thumb_func_start sub_81279C4 +sub_81279C4: @ 81279C4 + push {r4,lr} + movs r2, 0 + ldr r0, =0x0203a170 + ldrh r0, [r0] + ldr r1, =0x0203a16e + ldrh r1, [r1] + adds r0, r1 + adds r1, r0, 0x1 + ldr r4, =0x0203a152 + ldr r3, =0x0203a162 +_081279D8: + adds r0, r2, r4 + ldrb r0, [r0] + cmp r0, r1 + beq _081279EC + cmp r2, 0xB + bhi _08127A00 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r0, r1 + bne _08127A00 +_081279EC: + movs r0, 0 + b _08127A0C + .pool +_08127A00: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0xF + bls _081279D8 + movs r0, 0x1 +_08127A0C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81279C4 + + thumb_func_start sub_8127A14 +sub_8127A14: @ 8127A14 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl sub_81269D4 + adds r0, r4, 0 + bl sub_8127620 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8127A14 + + thumb_func_start sub_8127A30 +sub_8127A30: @ 8127A30 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8127A14 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8127A30 + + thumb_func_start sub_8127A5C +sub_8127A5C: @ 8127A5C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08127A82 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + movs r0, 0x1 + bl sub_81269D4 + adds r0, r4, 0 + bl sub_8127620 +_08127A82: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8127A5C + + thumb_func_start sub_8127A8C +sub_8127A8C: @ 8127A8C + 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, =0x03005e08 + adds r4, r0 + bl sub_8127554 + bl sub_81277A8 + ldrb r0, [r4, 0x1A] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldr r0, =0x0203a18c + ldr r0, [r0] + bl Free + adds r0, r5, 0 + bl sub_8126E44 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8127A8C + + thumb_func_start sub_8127ACC +sub_8127ACC: @ 8127ACC + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x03005e00 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r4, r2, r3 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldrh r0, [r1] + strh r0, [r4, 0xE] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x10] + adds r3, 0x8 + adds r2, r3 + adds r1, r2, 0x2 + adds r0, r2, 0 + bl PlayerGetDestCoords + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8127ACC + + thumb_func_start sub_8127B04 +sub_8127B04: @ 8127B04 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + bl DrawWholeMapView + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r0, 0x4 + ldrsb r0, [r1, r0] + ldrb r1, [r1, 0x5] + lsls r1, 24 + asrs r1, 24 + movs r2, 0x1 + negs r2, r2 + ldr r3, =0x03005e00 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r3 + movs r3, 0xE + ldrsb r3, [r4, r3] + ldrb r4, [r4, 0x10] + lsls r4, 24 + asrs r4, 24 + str r4, [sp] + bl warp1_set + bl warp_in + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8127B04 + + thumb_func_start sub_8127B54 +sub_8127B54: @ 8127B54 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =0x0000ffff + cmp r2, 0x22 + beq _08127B7C + cmp r2, 0x26 + bne _08127B86 + ldr r0, =gUnknown_085A72E4 + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 28 + lsrs r0, 16 + b _08127B86 + .pool +_08127B7C: + ldr r0, =gUnknown_085A72EC + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 28 + lsrs r0, 16 +_08127B86: + pop {r1} + bx r1 + .pool + thumb_func_end sub_8127B54 + + thumb_func_start sub_8127B90 +sub_8127B90: @ 8127B90 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + ldr r4, [sp, 0x54] + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x4] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x8] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0xC] + lsls r4, 16 + lsrs r4, 16 + str r4, [sp, 0x10] + movs r2, 0 + lsls r0, r3, 16 + cmp r2, r3 + bcc _08127BC6 + b _08127D28 +_08127BC6: + ldr r1, [sp, 0x8] + str r1, [sp, 0x28] + str r0, [sp, 0x2C] +_08127BCC: + ldr r3, [sp, 0x4] + ldr r4, [sp, 0xC] + subs r1, r3, r4 + lsls r0, r2, 16 + asrs r0, 16 + adds r0, 0x1 + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x14] + movs r0, 0 + mov r10, r0 + adds r1, r2, 0x1 + str r1, [sp, 0x30] + ldr r3, [sp, 0x28] + cmp r10, r3 + bcc _08127BF0 + b _08127D18 +_08127BF0: + ldr r4, [sp, 0x10] + lsls r4, 5 + str r4, [sp, 0x18] + ldr r0, =gUnknown_085A5C24 + adds r0, r4, r0 + str r0, [sp, 0x1C] + ldr r0, =gUnknown_085A5C08 + adds r0, r4, r0 + str r0, [sp, 0x24] + ldr r3, [sp, 0x8] + adds r1, r2, 0 + muls r1, r3 + str r1, [sp, 0x20] +_08127C0A: + ldr r0, [sp] + add r0, r10 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r1, [sp, 0x20] + add r1, r10 + ldr r4, [sp, 0x1C] + ldr r0, [r4] + lsls r1, 1 + adds r1, r0 + movs r2, 0x80 + lsls r2, 2 + adds r0, r2, 0 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bl GetBehaviorByMetatileId + lsls r4, r0, 16 + lsls r0, r4, 8 + lsrs r0, 24 + bl sub_80892D8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08127C50 + ldr r3, [sp, 0x24] + ldrb r0, [r3, 0x11] + cmp r0, 0x1 + beq _08127C60 + lsrs r0, r4, 28 + cmp r0, 0 + beq _08127C60 +_08127C50: + movs r4, 0xC0 + lsls r4, 4 + mov r8, r4 + b _08127C64 + .pool +_08127C60: + movs r0, 0 + mov r8, r0 +_08127C64: + ldr r1, [sp, 0x24] + ldrb r0, [r1, 0x11] + lsls r7, r5, 16 + ldr r2, [sp, 0x14] + lsls r2, 16 + mov r9, r2 + cmp r0, 0x3 + beq _08127C8E + asrs r0, r7, 16 + asrs r1, r2, 16 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl sub_8089328 + lsls r0, 24 + lsrs r0, 24 + movs r6, 0x1 + cmp r0, 0x1 + beq _08127C90 +_08127C8E: + movs r6, 0 +_08127C90: + ldr r3, [sp, 0x18] + ldr r4, =gUnknown_085A5C08 + adds r0, r3, r4 + ldrb r0, [r0] + ldr r4, [sp, 0x20] + add r4, r10 + lsls r1, r4, 24 + lsrs r1, 24 + bl sub_8127B54 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =0x0000ffff + cmp r5, r0 + beq _08127CE0 + asrs r0, r7, 16 + mov r2, r9 + asrs r1, r2, 16 + ldr r3, [sp, 0x1C] + ldr r2, [r3] + lsls r3, r4, 1 + adds r3, r2 + movs r4, 0x80 + lsls r4, 2 + adds r2, r4, 0 + orrs r6, r2 + ldrh r3, [r3] + adds r2, r6, r3 + mov r3, r8 + orrs r3, r2 + orrs r3, r5 + lsls r2, r3, 16 + lsrs r2, 16 + bl MapGridSetMetatileEntryAt + b _08127D06 + .pool +_08127CE0: + asrs r0, r7, 16 + mov r2, r9 + asrs r1, r2, 16 + ldr r3, [sp, 0x1C] + ldr r2, [r3] + lsls r3, r4, 1 + adds r3, r2 + movs r4, 0x80 + lsls r4, 2 + adds r2, r4, 0 + orrs r6, r2 + ldrh r3, [r3] + adds r2, r6, r3 + mov r3, r8 + orrs r3, r2 + lsls r2, r3, 16 + lsrs r2, 16 + bl MapGridSetMetatileIdAt +_08127D06: + mov r0, r10 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + ldr r4, [sp, 0x28] + cmp r10, r4 + bcs _08127D18 + b _08127C0A +_08127D18: + ldr r1, [sp, 0x30] + lsls r0, r1, 16 + lsrs r2, r0, 16 + ldr r3, [sp, 0x2C] + lsrs r0, r3, 16 + cmp r2, r0 + bcs _08127D28 + b _08127BCC +_08127D28: + 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_8127B90 + + thumb_func_start sub_8127D38 +sub_8127D38: @ 8127D38 + push {r4,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 16 + lsrs r2, 16 + ldr r1, =gUnknown_085A5C08 + lsls r0, r2, 5 + adds r0, r1 + ldrb r0, [r0, 0x12] + cmp r0, 0x9 + bhi _08127E10 + lsls r0, 2 + ldr r1, =_08127D68 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08127D68: + .4byte _08127D90 + .4byte _08127D9A + .4byte _08127DA4 + .4byte _08127DB4 + .4byte _08127DBE + .4byte _08127DC8 + .4byte _08127DD8 + .4byte _08127DE2 + .4byte _08127DF2 + .4byte _08127E02 +_08127D90: + str r2, [sp] + adds r0, r3, 0 + adds r1, r4, 0 + movs r2, 0x1 + b _08127DAC +_08127D9A: + str r2, [sp] + adds r0, r3, 0 + adds r1, r4, 0 + movs r2, 0x2 + b _08127DAC +_08127DA4: + str r2, [sp] + adds r0, r3, 0 + adds r1, r4, 0 + movs r2, 0x3 +_08127DAC: + movs r3, 0x1 + bl sub_8127B90 + b _08127E10 +_08127DB4: + str r2, [sp] + adds r0, r3, 0 + adds r1, r4, 0 + movs r2, 0x4 + b _08127DD0 +_08127DBE: + str r2, [sp] + adds r0, r3, 0 + adds r1, r4, 0 + movs r2, 0x2 + b _08127DD0 +_08127DC8: + str r2, [sp] + adds r0, r3, 0 + adds r1, r4, 0 + movs r2, 0x1 +_08127DD0: + movs r3, 0x2 + bl sub_8127B90 + b _08127E10 +_08127DD8: + str r2, [sp] + adds r0, r3, 0 + adds r1, r4, 0 + movs r2, 0x1 + b _08127DFA +_08127DE2: + str r2, [sp] + adds r0, r3, 0 + adds r1, r4, 0 + movs r2, 0x2 + movs r3, 0x4 + bl sub_8127B90 + b _08127E10 +_08127DF2: + str r2, [sp] + adds r0, r3, 0 + adds r1, r4, 0 + movs r2, 0x3 +_08127DFA: + movs r3, 0x3 + bl sub_8127B90 + b _08127E10 +_08127E02: + str r2, [sp] + adds r0, r3, 0 + adds r1, r4, 0 + movs r2, 0x3 + movs r3, 0x2 + bl sub_8127B90 +_08127E10: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8127D38 + + thumb_func_start sub_8127E18 +sub_8127E18: @ 8127E18 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r6, 0 + ldr r7, =0x02037318 + ldr r0, =0x020375e2 + mov r8, r0 + ldr r1, =0x020375e4 + mov r10, r1 + ldr r2, =0x03005d8c + mov r9, r2 +_08127E34: + adds r5, r6, 0 + adds r5, 0xAE + adds r4, r5, 0 + adds r0, r4, 0 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08127F1C + adds r0, r4, 0 + bl FlagReset + movs r2, 0 + ldr r0, [r7, 0x4] + ldrb r4, [r0] + cmp r2, r4 + bcs _08127E82 + ldr r0, [r0, 0x4] + ldrh r0, [r0, 0x14] + cmp r0, r5 + beq _08127E82 + ldr r0, =0x02037318 + ldr r3, [r0, 0x4] + ldrb r6, [r3] + adds r4, r5, 0 +_08127E68: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r6 + bcs _08127E82 + ldr r0, [r3, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + cmp r0, r4 + bne _08127E68 +_08127E82: + ldr r0, [r7, 0x4] + ldr r1, [r0, 0x4] + lsls r4, r2, 1 + adds r4, r2 + lsls r4, 3 + adds r1, r4, r1 + ldr r5, =0x00003f20 + adds r0, r5, 0 + ldrb r1, [r1, 0x1] + adds r0, r1 + ldr r1, =0x0203a190 + ldr r1, [r1] + ldr r1, [r1, 0x1C] + ldrh r1, [r1] + bl VarSet + ldr r0, [r7, 0x4] + ldr r0, [r0, 0x4] + adds r4, r0 + ldrb r0, [r4] + mov r6, r8 + strh r0, [r6] + ldr r1, =0x0203aa34 + ldrh r1, [r1] + mov r2, r10 + strh r1, [r2] + ldr r1, =0x0203aa36 + ldrh r1, [r1] + ldr r4, =0x020375e6 + strh r1, [r4] + mov r5, r9 + ldr r2, [r5] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl show_sprite + ldrb r0, [r6] + ldr r2, [r5] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + mov r6, r10 + movs r4, 0 + ldrsh r3, [r6, r4] + ldr r5, =0x020375e6 + movs r6, 0 + ldrsh r4, [r5, r6] + str r4, [sp] + bl sub_808EBA8 + mov r1, r8 + ldrb r0, [r1] + mov r4, r9 + ldr r2, [r4] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl sub_808F254 + b _08127F26 + .pool +_08127F1C: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0xD + bls _08127E34 +_08127F26: + 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_8127E18 + + thumb_func_start sub_8127F38 +sub_8127F38: @ 8127F38 + push {lr} + movs r1, 0 + ldr r0, =0x0203a17c + ldrb r2, [r0, 0x8] + cmp r1, r2 + bcs _08127F62 + ldr r3, [r0] +_08127F46: + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08127F58 + movs r0, 0x1 + b _08127F64 + .pool +_08127F58: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r2 + bcc _08127F46 +_08127F62: + movs r0, 0 +_08127F64: + pop {r1} + bx r1 + thumb_func_end sub_8127F38 + + thumb_func_start sub_8127F68 +sub_8127F68: @ 8127F68 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x0203a17c + ldrb r0, [r0, 0x9] + cmp r0, 0x1 + bne _08127FAC + ldr r0, =0x0203a173 + ldrb r0, [r0] + cmp r0, 0x6 + beq _08127FAC + cmp r0, 0x7 + beq _08127FAC + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EA9AE + adds r0, r4, 0 + bl ExpandStringRefs + ldr r2, =sub_8127A5C + adds r0, r5, 0 + adds r1, r4, 0 + bl DisplayItemMessageOnField + b _0812804C + .pool +_08127FAC: + bl sub_81279C4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08128038 + bl sub_8127F38 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08127FE8 + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xC] + ldr r1, =sub_8128060 + str r1, [r0] + b _0812804C + .pool +_08127FE8: + ldr r0, =0x02021cc4 + ldr r4, =0x0203a17c + ldrb r1, [r4, 0x8] + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldrb r0, [r4, 0x9] + cmp r0, 0 + bne _08128018 + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085EA8EA + bl ExpandStringRefs + b _08128020 + .pool +_08128018: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085EA931 + bl ExpandStringRefs +_08128020: + ldr r1, =0x02021fc4 + ldr r2, =sub_8127A5C + adds r0, r5, 0 + bl DisplayItemMessageOnField + b _0812804C + .pool +_08128038: + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EA8D2 + adds r0, r4, 0 + bl ExpandStringRefs + ldr r2, =sub_8127A5C + adds r0, r5, 0 + adds r1, r4, 0 + bl DisplayItemMessageOnField +_0812804C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8127F68 + + thumb_func_start sub_8128060 +sub_8128060: @ 8128060 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r7, r0, r1 + movs r1, 0xC + ldrsh r0, [r7, r1] + cmp r0, 0x1 + beq _081280AC + cmp r0, 0x1 + bgt _08128088 + cmp r0, 0 + beq _0812808E + b _08128112 + .pool +_08128088: + cmp r0, 0x2 + beq _081280FC + b _08128112 +_0812808E: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08128112 + adds r0, r6, 0 + bl sub_8127ACC + movs r0, 0x1 + strh r0, [r7, 0xC] + b _08128112 + .pool +_081280AC: + ldr r4, =0x02037fd4 + ldrb r0, [r4, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r4, 0x8] + ldr r5, =0x0203a190 + ldr r0, =0x0203a172 + ldrb r1, [r0] + ldr r0, =0x0203a14c + ldr r0, [r0] + adds r0, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl ConfigureCameraObjectForPlacingDecoration + adds r0, r6, 0 + bl sub_812826C + adds r0, r6, 0 + adds r1, r5, 0 + bl SetUpPlacingDecorationPlayerAvatar + bl pal_fill_black + ldrb r1, [r4, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r4, 0x8] + movs r0, 0x2 + strh r0, [r7, 0xC] + b _08128112 + .pool +_081280FC: + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08128112 + movs r0, 0 + strh r0, [r7, 0x20] + adds r0, r6, 0 + bl sub_8128FD8 +_08128112: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8128060 + + thumb_func_start ConfigureCameraObjectForPlacingDecoration +ConfigureCameraObjectForPlacingDecoration: @ 8128118 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =0x0203aa38 + ldr r4, =0x02020630 + ldr r5, =0x03005dd0 + ldr r2, [r5, 0x4] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x2E] + strb r0, [r3] + adds r0, r6, 0 + bl gpu_pal_decompress_alloc_tag_and_upload + lsls r0, 24 + lsrs r0, 24 + str r0, [r5, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r0, [r5, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r0, r4, 0 + adds r0, 0x1C + adds r0, r2, r0 + ldr r1, =sub_81292D0 + str r1, [r0] + adds r2, r4 + ldr r3, =gUnknown_085A7250 + ldr r0, [r6] + ldrb r0, [r0, 0x12] + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x2] + strh r0, [r2, 0x20] + ldr r0, [r5, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldr r0, [r6] + ldrb r0, [r0, 0x12] + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x3] + strh r0, [r1, 0x22] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ConfigureCameraObjectForPlacingDecoration + + thumb_func_start SetUpPlacingDecorationPlayerAvatar +SetUpPlacingDecorationPlayerAvatar: @ 81281A8 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x03005e00 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r3 + ldrb r2, [r2, 0x12] + ldr r3, =gUnknown_085A7250 + ldr r0, [r1] + ldrb r4, [r0, 0x12] + lsls r1, r4, 2 + adds r1, r3 + lsls r0, r2, 4 + ldrb r1, [r1, 0x2] + adds r0, r1 + subs r2, 0x1 + lsls r2, 3 + subs r0, r2 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r4, 0x2 + beq _081281E2 + cmp r4, 0x8 + beq _081281E2 + cmp r4, 0x9 + bne _081281EA +_081281E2: + adds r0, r2, 0 + subs r0, 0x8 + lsls r0, 24 + lsrs r2, r0, 24 +_081281EA: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _0812820C + ldr r1, =DummyObjectCallback + str r0, [sp] + movs r0, 0xC1 + b _08128214 + .pool +_0812820C: + ldr r1, =DummyObjectCallback + movs r0, 0 + str r0, [sp] + movs r0, 0xC2 +_08128214: + movs r3, 0x48 + bl AddPseudoFieldObject + ldr r1, =0x0203aa39 + strb r0, [r1] + ldr r3, =0x02020630 + ldr r0, =0x0203aa39 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0, 0x5] + ldr r4, =0x0203aa38 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + bl RemoveObjectAndFreeTiles + ldr r0, =0x03005dd0 + ldr r0, [r0, 0x4] + strb r0, [r4] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end SetUpPlacingDecorationPlayerAvatar + + thumb_func_start sub_812826C +sub_812826C: @ 812826C + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =gUnknown_085A5C08 + ldr r0, =0x0203a172 + ldrb r1, [r0] + ldr r0, =0x0203a14c + ldr r0, [r0] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 5 + adds r0, r2 + ldrb r0, [r0, 0x12] + cmp r0, 0x9 + bls _0812828C + b _081283B2 +_0812828C: + lsls r0, 2 + ldr r1, =_081282A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081282A8: + .4byte _081282D0 + .4byte _081282E4 + .4byte _081282FC + .4byte _08128314 + .4byte _08128328 + .4byte _0812833C + .4byte _08128350 + .4byte _08128370 + .4byte _08128388 + .4byte _081283A0 +_081282D0: + ldr r0, =0x03005e00 + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + b _08128394 + .pool +_081282E4: + ldr r1, =0x03005e00 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r1 + movs r1, 0x2 + strh r1, [r0, 0x12] + movs r1, 0x1 + b _081283B0 + .pool +_081282FC: + ldr r1, =0x03005e00 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r1 + movs r1, 0x3 + strh r1, [r0, 0x12] + movs r1, 0x1 + b _081283B0 + .pool +_08128314: + ldr r1, =0x03005e00 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r1 + movs r1, 0x4 + b _081283AC + .pool +_08128328: + ldr r0, =0x03005e00 + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + movs r0, 0x2 + b _08128394 + .pool +_0812833C: + ldr r1, =0x03005e00 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + b _081283AC + .pool +_08128350: + ldr r0, =0x03005e00 + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x12] + movs r0, 0x3 + strh r0, [r1, 0x14] + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + b _081283B2 + .pool +_08128370: + ldr r1, =0x03005e00 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r1 + movs r1, 0x2 + strh r1, [r0, 0x12] + movs r1, 0x4 + b _081283B0 + .pool +_08128388: + ldr r0, =0x03005e00 + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + movs r0, 0x3 +_08128394: + strh r0, [r1, 0x12] + strh r0, [r1, 0x14] + b _081283B2 + .pool +_081283A0: + ldr r1, =0x03005e00 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r1 + movs r1, 0x3 +_081283AC: + strh r1, [r0, 0x12] + movs r1, 0x2 +_081283B0: + strh r1, [r0, 0x14] +_081283B2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_812826C + + thumb_func_start sub_81283BC +sub_81283BC: @ 81283BC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x1C] + ldr r3, =0x02020630 + ldr r0, =0x0203aa38 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r2, 0x1 + strh r2, [r0, 0x3C] + ldr r0, =0x0203aa39 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r2, [r0, 0x3C] + bl sub_8128DE0 + adds r0, r4, 0 + bl sub_8128950 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81283BC + + thumb_func_start sub_8128414 +sub_8128414: @ 8128414 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x1C] + ldr r3, =0x02020630 + ldr r0, =0x0203aa38 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r2, 0x1 + strh r2, [r0, 0x3C] + ldr r0, =0x0203aa39 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r2, [r0, 0x3C] + bl sub_8128DE0 + ldr r5, =0x02021fc4 + ldr r1, =gUnknown_085EA8BF + adds r0, r5, 0 + bl ExpandStringRefs + ldr r2, =sub_8128B80 + adds r0, r4, 0 + adds r1, r5, 0 + bl DisplayItemMessageOnField + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8128414 + + thumb_func_start sub_8128484 +sub_8128484: @ 8128484 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r4, r1, 16 + bl sub_80892C4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0812849E + cmp r4, 0 + beq _081284A2 +_0812849E: + movs r0, 0 + b _081284A4 +_081284A2: + movs r0, 0x1 +_081284A4: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8128484 + + thumb_func_start sub_81284AC +sub_81284AC: @ 81284AC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + lsrs r4, r2, 16 + lsls r3, 16 + lsrs r5, r3, 16 + lsls r1, 16 + asrs r1, 16 + ldr r3, =0x03005e00 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r3 + movs r3, 0xE + ldrsh r0, [r2, r3] + adds r0, 0x7 + cmp r1, r0 + bne _081284EC + lsls r1, r4, 16 + asrs r1, 16 + movs r3, 0x10 + ldrsh r0, [r2, r3] + adds r0, 0x7 + cmp r1, r0 + bne _081284EC + cmp r5, 0 + beq _081284EC + movs r0, 0 + b _081284EE + .pool +_081284EC: + movs r0, 0x1 +_081284EE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81284AC + + thumb_func_start sub_81284F4 +sub_81284F4: @ 81284F4 + push {r4-r6,lr} + adds r5, r1, 0 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r0, r6, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_80892C4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08128534 + ldrb r0, [r5] + cmp r0, 0x21 + bne _08128522 + adds r0, r4, 0 + bl sub_8089378 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08128530 +_08128522: + lsls r0, r6, 24 + lsrs r0, 24 + bl sub_8089314 + lsls r0, 24 + cmp r0, 0 + beq _08128534 +_08128530: + movs r0, 0x1 + b _08128536 +_08128534: + movs r0, 0 +_08128536: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81284F4 + + thumb_func_start sub_812853C +sub_812853C: @ 812853C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + str r1, [sp] + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r1, =0x03005e00 + lsls r0, 2 + add r0, r10 + lsls r0, 3 + adds r0, r1 + ldrb r2, [r0, 0x14] + str r2, [sp, 0x4] + ldrb r0, [r0, 0x12] + str r0, [sp, 0x8] + ldr r3, [sp] + ldrb r0, [r3, 0x11] + adds r2, r1, 0 + cmp r0, 0x4 + bls _0812856E + b _0812893C +_0812856E: + lsls r0, 2 + ldr r1, =_08128580 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08128580: + .4byte _08128594 + .4byte _08128594 + .4byte _08128680 + .4byte _08128834 + .4byte _081288B8 +_08128594: + movs r6, 0 + ldr r0, [sp, 0x4] + cmp r6, r0 + bcc _0812859E + b _0812893C +_0812859E: + mov r1, r10 + lsls r1, 2 + str r1, [sp, 0x1C] +_081285A4: + mov r2, r10 + lsls r0, r2, 2 + add r0, r10 + lsls r0, 3 + ldr r3, =0x03005e00 + adds r0, r3 + ldrh r0, [r0, 0xA] + subs r0, r6 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + movs r7, 0 + adds r6, 0x1 + str r6, [sp, 0x14] + ldr r0, [sp, 0x8] + cmp r7, r0 + bcs _0812866E + mov r1, r9 + lsls r1, 16 + str r1, [sp, 0xC] + asrs r1, 16 + mov r9, r1 +_081285D0: + ldr r0, [sp, 0x1C] + add r0, r10 + lsls r0, 3 + ldr r2, =0x03005e00 + adds r0, r2 + ldrh r0, [r0, 0x8] + adds r0, r7 + lsls r0, 16 + mov r8, r0 + asrs r6, r0, 16 + adds r0, r6, 0 + mov r1, r9 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, [sp, 0x4] + ldr r1, [sp, 0x14] + subs r0, r3, r1 + ldr r2, [sp, 0x8] + adds r1, r0, 0 + muls r1, r2 + adds r1, r7 + ldr r3, [sp] + ldr r0, [r3, 0x1C] + lsls r1, 1 + adds r1, r0 + movs r2, 0x80 + lsls r2, 2 + adds r0, r2, 0 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bl GetBehaviorByMetatileId + movs r3, 0xF0 + lsls r3, 8 + adds r1, r3, 0 + adds r5, r1, 0 + ands r5, r0 + adds r0, r4, 0 + ldr r1, [sp] + bl sub_81284F4 + lsls r0, 24 + cmp r0, 0 + bne _08128632 + b _0812890C +_08128632: + mov r0, r10 + adds r1, r6, 0 + mov r2, r9 + adds r3, r5, 0 + bl sub_81284AC + lsls r0, 24 + cmp r0, 0 + bne _08128646 + b _0812890C +_08128646: + mov r1, r8 + lsrs r0, r1, 16 + ldr r2, [sp, 0xC] + lsrs r1, r2, 16 + movs r2, 0 + bl GetFieldObjectIdByXYZ + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _08128662 + cmp r4, 0x10 + beq _08128662 + b _0812890C +_08128662: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r3, [sp, 0x8] + cmp r7, r3 + bcc _081285D0 +_0812866E: + ldr r1, [sp, 0x14] + lsls r0, r1, 24 + lsrs r6, r0, 24 + ldr r2, [sp, 0x4] + cmp r6, r2 + bcc _081285A4 + b _0812893C + .pool +_08128680: + movs r6, 0 + mov r3, r10 + lsls r3, 2 + str r3, [sp, 0x1C] + ldr r0, [sp, 0x4] + subs r0, 0x1 + str r0, [sp, 0x18] + cmp r6, r0 + bge _0812876C + adds r0, r3, 0 + add r0, r10 + lsls r0, 3 + str r0, [sp, 0x10] +_0812869A: + ldr r1, [sp, 0x10] + adds r0, r1, r2 + ldrh r0, [r0, 0xA] + subs r0, r6 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + movs r7, 0 + adds r6, 0x1 + str r6, [sp, 0x14] + ldr r3, [sp, 0x8] + cmp r7, r3 + bcs _08128760 + lsls r0, 16 + str r0, [sp, 0x20] +_081286B8: + ldr r1, [sp, 0x10] + adds r0, r1, r2 + ldrh r0, [r0, 0x8] + adds r0, r7 + lsls r0, 16 + mov r8, r0 + asrs r6, r0, 16 + mov r2, r9 + lsls r1, r2, 16 + adds r0, r6, 0 + asrs r1, 16 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, [sp, 0x4] + ldr r1, [sp, 0x14] + subs r0, r3, r1 + ldr r2, [sp, 0x8] + adds r1, r0, 0 + muls r1, r2 + adds r1, r7 + ldr r3, [sp] + ldr r0, [r3, 0x1C] + lsls r1, 1 + adds r1, r0 + movs r2, 0x80 + lsls r2, 2 + adds r0, r2, 0 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bl GetBehaviorByMetatileId + movs r3, 0xF0 + lsls r3, 8 + adds r1, r3, 0 + adds r5, r1, 0 + ands r5, r0 + adds r0, r4, 0 + bl sub_8089314 + lsls r0, 24 + cmp r0, 0 + bne _08128724 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8128484 + lsls r0, 24 + cmp r0, 0 + bne _08128724 + b _0812890C +_08128724: + mov r0, r10 + adds r1, r6, 0 + ldr r3, [sp, 0x20] + asrs r2, r3, 16 + adds r3, r5, 0 + bl sub_81284AC + lsls r0, 24 + cmp r0, 0 + bne _0812873A + b _0812890C +_0812873A: + mov r1, r8 + lsrs r0, r1, 16 + ldr r2, [sp, 0x20] + lsrs r1, r2, 16 + movs r2, 0 + bl GetFieldObjectIdByXYZ + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + beq _08128752 + b _0812890C +_08128752: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, =0x03005e00 + ldr r3, [sp, 0x8] + cmp r7, r3 + bcc _081286B8 +_08128760: + ldr r1, [sp, 0x14] + lsls r0, r1, 24 + lsrs r6, r0, 24 + ldr r3, [sp, 0x18] + cmp r6, r3 + blt _0812869A +_0812876C: + ldr r0, [sp, 0x1C] + add r0, r10 + lsls r0, 3 + adds r0, r2 + ldrh r0, [r0, 0xA] + ldr r1, [sp, 0x4] + subs r0, r1 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + movs r7, 0 + ldr r3, [sp, 0x8] + cmp r7, r3 + bcc _0812878C + b _0812893C +_0812878C: + lsls r0, 16 + str r0, [sp, 0x20] +_08128790: + ldr r0, [sp, 0x1C] + add r0, r10 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r0, r1 + ldrh r0, [r0, 0x8] + adds r0, r7 + lsls r0, 16 + mov r8, r0 + asrs r6, r0, 16 + mov r2, r9 + lsls r1, r2, 16 + adds r0, r6, 0 + asrs r1, 16 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, [sp] + ldr r0, [r3, 0x1C] + lsls r1, r7, 1 + adds r1, r0 + movs r2, 0x80 + lsls r2, 2 + adds r0, r2, 0 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bl GetBehaviorByMetatileId + movs r3, 0xF0 + lsls r3, 8 + adds r1, r3, 0 + adds r5, r1, 0 + ands r5, r0 + adds r0, r4, 0 + bl sub_8089314 + lsls r0, 24 + cmp r0, 0 + bne _081287F2 + adds r0, r4, 0 + bl sub_8089328 + lsls r0, 24 + cmp r0, 0 + bne _081287F2 + b _0812890C +_081287F2: + mov r0, r10 + adds r1, r6, 0 + ldr r3, [sp, 0x20] + asrs r2, r3, 16 + adds r3, r5, 0 + bl sub_81284AC + lsls r0, 24 + cmp r0, 0 + bne _08128808 + b _0812890C +_08128808: + mov r1, r8 + lsrs r0, r1, 16 + ldr r2, [sp, 0x20] + lsrs r1, r2, 16 + movs r2, 0 + bl GetFieldObjectIdByXYZ + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _08128822 + cmp r4, 0x10 + bne _0812890C +_08128822: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r3, [sp, 0x8] + cmp r7, r3 + bcc _08128790 + b _0812893C + .pool +_08128834: + movs r6, 0 + ldr r0, [sp, 0x4] + cmp r6, r0 + bcc _0812883E + b _0812893C +_0812883E: + mov r1, r10 + lsls r0, r1, 2 + add r0, r10 + lsls r1, r0, 3 + ldr r2, =0x03005e00 + adds r0, r1, r2 + ldrh r0, [r0, 0xA] + subs r0, r6 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + movs r7, 0 + ldr r3, [sp, 0x8] + cmp r7, r3 + bcs _081288A4 + adds r0, r2, 0 + adds r1, r0 + mov r8, r1 + mov r1, r9 + lsls r0, r1, 16 + asrs r5, r0, 16 +_08128868: + mov r2, r8 + ldrh r0, [r2, 0x8] + adds r0, r7 + lsls r0, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl sub_8089328 + lsls r0, 24 + cmp r0, 0 + beq _0812890C + adds r0, r4, 0 + adds r1, r5, 0x1 + bl MapGridGetMetatileIdAt + movs r1, 0xA3 + lsls r1, 2 + cmp r0, r1 + beq _0812890C + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r3, [sp, 0x8] + cmp r7, r3 + bcc _08128868 +_081288A4: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, [sp, 0x4] + cmp r6, r0 + bcc _0812883E + b _0812893C + .pool +_081288B8: + mov r3, r10 + lsls r1, r3, 2 + adds r0, r1, r3 + lsls r0, 3 + adds r0, r2 + ldrh r0, [r0, 0xA] + mov r9, r0 + movs r7, 0 + str r1, [sp, 0x1C] + ldr r0, [sp, 0x8] + cmp r7, r0 + bcs _0812893C + adds r6, r2, 0 + mov r1, r9 + lsls r1, 16 + str r1, [sp, 0x20] +_081288D8: + ldr r0, [sp, 0x1C] + add r0, r10 + lsls r0, 3 + adds r0, r6 + ldrh r0, [r0, 0x8] + adds r0, r7 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + mov r2, r9 + lsls r1, r2, 16 + asrs r1, 16 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, [sp] + ldrb r0, [r3, 0x12] + cmp r0, 0x5 + bne _08128910 +_08128900: + adds r0, r4, 0 + bl sub_8089364 + lsls r0, 24 + cmp r0, 0 + bne _0812891C +_0812890C: + movs r0, 0 + b _0812893E +_08128910: + adds r0, r4, 0 + bl sub_8089350 + lsls r0, 24 + cmp r0, 0 + beq _08128900 +_0812891C: + adds r0, r5, 0 + ldr r2, [sp, 0x20] + lsrs r1, r2, 16 + movs r2, 0 + bl GetFieldObjectIdByXYZ + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + bne _0812890C + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r3, [sp, 0x8] + cmp r7, r3 + bcc _081288D8 +_0812893C: + movs r0, 0x1 +_0812893E: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_812853C + + thumb_func_start sub_8128950 +sub_8128950: @ 8128950 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x0203a172 + ldrb r1, [r0] + ldr r0, =0x0203a14c + ldr r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r1, 5 + ldr r0, =gUnknown_085A5C08 + adds r1, r0 + adds r0, r5, 0 + bl sub_812853C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081289A4 + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EA897 + adds r0, r4, 0 + bl ExpandStringRefs + ldr r2, =sub_81289D0 + adds r0, r5, 0 + adds r1, r4, 0 + bl DisplayItemMessageOnField + b _081289BE + .pool +_081289A4: + movs r0, 0x20 + bl audio_play + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EA8A6 + adds r0, r4, 0 + bl ExpandStringRefs + ldr r2, =sub_8129020 + adds r0, r5, 0 + adds r1, r4, 0 + bl DisplayItemMessageOnField +_081289BE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8128950 + + thumb_func_start sub_81289D0 +sub_81289D0: @ 81289D0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8197930 + ldr r1, =gUnknown_085A72C4 + adds r0, r4, 0 + bl sub_8121F68 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81289D0 + + thumb_func_start sub_81289F0 +sub_81289F0: @ 81289F0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + adds r0, r4, 0 + bl sub_8128AAC + ldr r2, =gUnknown_085A5C08 + ldr r0, =0x0203a172 + ldrb r1, [r0] + ldr r0, =0x0203a14c + ldr r0, [r0] + adds r0, r1 + ldrb r3, [r0] + lsls r0, r3, 5 + adds r0, r2 + ldrb r0, [r0, 0x11] + cmp r0, 0x4 + beq _08128A44 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + ldrh r1, [r1, 0xA] + adds r2, r3, 0 + bl sub_8127D38 + b _08128A64 + .pool +_08128A44: + ldr r2, =0x0203aa34 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + subs r0, 0x7 + strh r0, [r2] + ldr r2, =0x0203aa36 + ldrh r0, [r1, 0xA] + subs r0, 0x7 + strh r0, [r2] + ldr r0, =gUnknown_08275D1F + bl script_env_1_execute_new_script +_08128A64: + ldr r2, =0x02020630 + ldr r0, =0x0203aa38 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + adds r1, 0x2 + strh r1, [r0, 0x22] + ldr r0, =0x02037318 + ldrb r0, [r0, 0x14] + cmp r0, 0x56 + bne _08128A84 + bl sub_80EE104 +_08128A84: + adds r0, r4, 0 + bl sub_8128BBC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81289F0 + + thumb_func_start sub_8128AAC +sub_8128AAC: @ 8128AAC + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r3, 0 + ldr r0, =0x0203a17c + ldrb r1, [r0, 0x8] + adds r5, r0, 0 + cmp r3, r1 + bcs _08128AD2 + ldr r4, [r5] +_08128AC0: + adds r2, r4, r3 + ldrb r0, [r2] + cmp r0, 0 + beq _08128AF0 + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r1 + bcc _08128AC0 +_08128AD2: + ldrb r0, [r5, 0x9] + cmp r0, 0 + bne _08128B3C + movs r3, 0 + ldr r0, =0x0203a152 + ldrb r1, [r0] + adds r2, r0, 0 + cmp r1, 0 + bne _08128B28 + b _08128B48 + .pool +_08128AF0: + ldr r0, =0x0203a172 + ldrb r1, [r0] + ldr r0, =0x0203a14c + ldr r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r2, [r5, 0x4] + adds r2, r3 + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldrb r0, [r1, 0x8] + subs r0, 0x7 + lsls r0, 4 + ldrb r1, [r1, 0xA] + subs r1, 0x7 + adds r0, r1 + strb r0, [r2] + b _08128AD2 + .pool +_08128B28: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0xF + bhi _08128B76 + adds r1, r3, r2 + ldrb r0, [r1] + cmp r0, 0 + bne _08128B28 + b _08128B6E +_08128B3C: + movs r3, 0 + ldr r0, =0x0203a162 + ldrb r1, [r0] + adds r2, r0, 0 + cmp r1, 0 + bne _08128B5C +_08128B48: + ldr r0, =0x0203a172 + ldrb r0, [r0] + adds r0, 0x1 + strb r0, [r2] + b _08128B76 + .pool +_08128B5C: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0xB + bhi _08128B76 + adds r1, r3, r2 + ldrb r0, [r1] + cmp r0, 0 + bne _08128B5C +_08128B6E: + ldr r0, =0x0203a172 + ldrb r0, [r0] + adds r0, 0x1 + strb r0, [r1] +_08128B76: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8128AAC + + thumb_func_start sub_8128B80 +sub_8128B80: @ 8128B80 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8197930 + ldr r1, =gUnknown_085A72CC + adds r0, r4, 0 + bl sub_8121F68 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8128B80 + + thumb_func_start sub_8128BA0 +sub_8128BA0: @ 8128BA0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + adds r0, r4, 0 + bl sub_8128BBC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8128BA0 + + thumb_func_start sub_8128BBC +sub_8128BBC: @ 8128BBC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xC] + ldr r1, =c1_overworld_prev_quest + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8128BBC + + thumb_func_start c1_overworld_prev_quest +c1_overworld_prev_quest: @ 8128BEC + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0xC + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08128C10 + cmp r0, 0x1 + beq _08128C30 + b _08128C4C + .pool +_08128C10: + bl script_env_2_enable + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08128C4C + adds r0, r4, 0 + bl sub_8127B04 + movs r0, 0x1 + strh r0, [r5, 0xC] + b _08128C4C + .pool +_08128C30: + bl sub_812A3C8 + ldr r0, =0x00000be5 + bl FreeObjectPaletteByTag + ldr r1, =0x03005dac + ldr r0, =sub_8128CD4 + str r0, [r1] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + adds r0, r4, 0 + bl DestroyTask +_08128C4C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end c1_overworld_prev_quest + + thumb_func_start sub_8128C64 +sub_8128C64: @ 8128C64 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r5, r1, 3 + ldr r6, =0x03005e08 + adds r4, r5, r6 + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08128C9C + cmp r0, 0x1 + bgt _08128C8C + cmp r0, 0 + beq _08128C96 + b _08128CCA + .pool +_08128C8C: + cmp r0, 0x2 + beq _08128CA8 + cmp r0, 0x3 + beq _08128CB4 + b _08128CCA +_08128C96: + bl sub_80E9578 + b _08128CAC +_08128C9C: + ldr r0, =gUnknown_08275D0C + bl script_env_1_execute_new_script + b _08128CAC + .pool +_08128CA8: + bl script_env_2_enable +_08128CAC: + ldrh r0, [r4, 0x4] + adds r0, 0x1 + strh r0, [r4, 0x4] + b _08128CCA +_08128CB4: + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08128CCA + adds r0, r6, 0 + subs r0, 0x8 + adds r0, r5, r0 + ldr r1, =sub_812764C + str r1, [r0] +_08128CCA: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8128C64 + + thumb_func_start sub_8128CD4 +sub_8128CD4: @ 8128CD4 + push {r4,lr} + bl script_env_2_enable + bl pal_fill_black + ldr r0, =sub_8128C64 + movs r1, 0x8 + bl CreateTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_8127580 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xC] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8128CD4 + + thumb_func_start sub_8128D10 +sub_8128D10: @ 8128D10 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r2, r1, r0 + ldr r0, =0x0203aa3a + ldrb r1, [r0] + adds r3, r0, 0 + cmp r1, 0x1 + bne _08128D48 + movs r1, 0x2 + ldrsh r0, [r2, r1] + movs r4, 0xC + ldrsh r1, [r2, r4] + subs r0, r1 + subs r0, 0x6 + cmp r0, 0 + bge _08128D48 + ldrh r0, [r2, 0x2] + adds r0, 0x1 + b _08128D62 + .pool +_08128D48: + ldrb r0, [r3] + cmp r0, 0x2 + bne _08128D6C + movs r0, 0x2 + ldrsh r1, [r2, r0] + subs r1, 0x7 + ldr r0, =0x02037318 + ldr r0, [r0] + ldr r0, [r0, 0x4] + cmp r1, r0 + blt _08128D6C + ldrh r0, [r2, 0x2] + subs r0, 0x1 +_08128D62: + strh r0, [r2, 0x2] + movs r0, 0 + b _08128DAE + .pool +_08128D6C: + ldrb r0, [r3] + cmp r0, 0x3 + bne _08128D82 + movs r1, 0 + ldrsh r0, [r2, r1] + subs r0, 0x7 + cmp r0, 0 + bge _08128D82 + ldrh r0, [r2] + adds r0, 0x1 + b _08128DA2 +_08128D82: + ldrb r0, [r3] + cmp r0, 0x4 + bne _08128DAC + movs r3, 0 + ldrsh r1, [r2, r3] + movs r4, 0xA + ldrsh r0, [r2, r4] + adds r1, r0 + subs r1, 0x8 + ldr r0, =0x02037318 + ldr r0, [r0] + ldr r0, [r0] + cmp r1, r0 + blt _08128DAC + ldrh r0, [r2] + subs r0, 0x1 +_08128DA2: + strh r0, [r2] + movs r0, 0 + b _08128DAE + .pool +_08128DAC: + movs r0, 0x1 +_08128DAE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8128D10 + + thumb_func_start sub_8128DB4 +sub_8128DB4: @ 8128DB4 + push {lr} + ldr r0, =0x030022c0 + ldrh r0, [r0, 0x2C] + movs r1, 0xF0 + ands r1, r0 + cmp r1, 0x40 + beq _08128DD8 + cmp r1, 0x80 + beq _08128DD8 + cmp r1, 0x20 + beq _08128DD8 + cmp r1, 0x10 + beq _08128DD8 + movs r0, 0 + b _08128DDA + .pool +_08128DD8: + movs r0, 0x1 +_08128DDA: + pop {r1} + bx r1 + thumb_func_end sub_8128DB4 + + thumb_func_start sub_8128DE0 +sub_8128DE0: @ 8128DE0 + push {r4,lr} + ldr r1, =0x0203aa3a + movs r0, 0 + strb r0, [r1] + ldr r4, =0x02020630 + ldr r3, =0x0203aa38 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r2, 0 + strh r2, [r0, 0x32] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r2, [r0, 0x34] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8128DE0 + + thumb_func_start sub_8128E18 +sub_8128E18: @ 8128E18 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r2, r0, 24 + mov r8, r2 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldr r5, =0x02020630 + ldr r3, =0x0203aa38 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x36 + ldrsh r6, [r0, r1] + cmp r6, 0 + beq _08128E46 + b _08128F66 +_08128E46: + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _08128E68 + ldr r0, =gUnknown_085A72D4 + movs r3, 0x18 + ldrsh r1, [r4, r3] + lsls r1, 3 + b _08128E76 + .pool +_08128E68: + cmp r0, 0x2 + bne _08128E88 + ldr r0, =gUnknown_085A72D4 + movs r3, 0x18 + ldrsh r1, [r4, r3] + lsls r1, 3 + adds r0, 0x4 +_08128E76: + adds r1, r0 + ldr r1, [r1] + adds r0, r2, 0 + bl _call_via_r1 + b _08128FBA + .pool +_08128E88: + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2C] + movs r7, 0xF0 + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0x40 + bne _08128EBC + ldr r1, =0x0203aa3a + movs r0, 0x1 + strb r0, [r1] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x32] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x0000fffe + strh r1, [r0, 0x34] + ldrh r0, [r4, 0x2] + subs r0, 0x1 + strh r0, [r4, 0x2] +_08128EBC: + ldrh r1, [r2, 0x2C] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0x80 + bne _08128EEC + ldr r1, =0x0203aa3a + movs r0, 0x2 + strb r0, [r1] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x32] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x2 + strh r1, [r0, 0x34] + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] +_08128EEC: + ldrh r1, [r2, 0x2C] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0x20 + bne _08128F1C + ldr r1, =0x0203aa3a + movs r0, 0x3 + strb r0, [r1] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x0000fffe + strh r1, [r0, 0x32] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x34] + ldrh r0, [r4] + subs r0, 0x1 + strh r0, [r4] +_08128F1C: + ldrh r1, [r2, 0x2C] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0x10 + bne _08128F4C + ldr r1, =0x0203aa3a + movs r0, 0x4 + strb r0, [r1] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x2 + strh r1, [r0, 0x32] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r6, [r0, 0x34] + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_08128F4C: + bl sub_8128DB4 + lsls r0, 24 + cmp r0, 0 + beq _08128F62 + mov r0, r8 + bl sub_8128D10 + lsls r0, 24 + cmp r0, 0 + bne _08128F66 +_08128F62: + bl sub_8128DE0 +_08128F66: + ldr r0, =0x0203aa3a + ldrb r0, [r0] + cmp r0, 0 + beq _08128F94 + ldr r3, =0x02020630 + ldr r2, =0x0203aa38 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x36] + adds r1, 0x1 + strh r1, [r0, 0x36] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r2, [r1, 0x36] + movs r0, 0x7 + ands r0, r2 + strh r0, [r1, 0x36] +_08128F94: + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08128FBA + ldr r3, =0x030022c0 + ldrh r1, [r3, 0x2E] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _08128FAC + strh r2, [r4, 0x14] +_08128FAC: + ldrh r1, [r3, 0x2E] + movs r2, 0x2 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _08128FBA + strh r2, [r4, 0x14] +_08128FBA: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8128E18 + + thumb_func_start sub_8128FD8 +sub_8128FD8: @ 8128FD8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + ldr r2, =0x02020630 + ldr r0, =0x0203aa38 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r2, 0 + strh r2, [r0, 0x3C] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r2, [r0, 0x1C] + ldr r1, =sub_8128E18 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8128FD8 + + thumb_func_start sub_8129020 +sub_8129020: @ 8129020 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0812903A + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08129040 +_0812903A: + adds r0, r2, 0 + bl sub_8128FD8 +_08129040: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8129020 + + thumb_func_start sub_8129048 +sub_8129048: @ 8129048 + push {lr} + sub sp, 0x4 + adds r1, r0, 0 + mov r2, sp + movs r0, 0 + strh r0, [r2] + ldr r2, =0x01000452 + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8129048 + + thumb_func_start sub_8129068 +sub_8129068: @ 8129068 + push {lr} + adds r2, r0, 0 + lsls r1, 16 + ldr r0, =gTilesetPointer_SecretBase + ldr r0, [r0] + lsrs r1, 11 + ldr r0, [r0, 0x8] + adds r0, r1 + adds r1, r2, 0 + movs r2, 0x8 + bl CpuFastSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_8129068 + + thumb_func_start sub_8129088 +sub_8129088: @ 8129088 + push {r4-r7,lr} + sub sp, 0x20 + adds r7, r0, 0 + lsls r1, 16 + lsrs r2, r1, 16 + lsrs r4, r1, 26 + adds r5, r4, 0 + cmp r2, 0 + beq _0812909E + ldr r0, =0x000003ff + ands r2, r0 +_0812909E: + ldr r0, =gTilesetPointer_SecretBase + ldr r0, [r0] + lsls r1, r2, 5 + ldr r0, [r0, 0x4] + adds r0, r1 + mov r1, sp + movs r2, 0x8 + bl CpuFastSet + cmp r4, 0x1 + beq _081290DE + cmp r4, 0x1 + bgt _081290C8 + cmp r4, 0 + beq _081290D2 + b _0812919A + .pool +_081290C8: + cmp r5, 0x2 + beq _0812913E + cmp r5, 0x3 + beq _08129176 + b _0812919A +_081290D2: + mov r0, sp + adds r1, r7, 0 + movs r2, 0x8 + bl CpuFastSet + b _0812919A +_081290DE: + movs r5, 0 + movs r6, 0xF +_081290E2: + lsls r4, r5, 2 + adds r4, r7 + adds r5, 0x1 + lsls r3, r5, 2 + subs r0, r3, 0x1 + add r0, sp + ldrb r2, [r0] + lsrs r1, r2, 4 + adds r0, r6, 0 + ands r0, r2 + lsls r0, 4 + adds r1, r0 + strb r1, [r4] + subs r0, r3, 0x2 + add r0, sp + ldrb r2, [r0] + lsrs r1, r2, 4 + adds r0, r6, 0 + ands r0, r2 + lsls r0, 4 + adds r1, r0 + strb r1, [r4, 0x1] + subs r0, r3, 0x3 + add r0, sp + ldrb r2, [r0] + lsrs r1, r2, 4 + adds r0, r6, 0 + ands r0, r2 + lsls r0, 4 + adds r1, r0 + strb r1, [r4, 0x2] + subs r3, 0x4 + mov r1, sp + adds r0, r1, r3 + ldrb r2, [r0] + lsrs r1, r2, 4 + adds r0, r6, 0 + ands r0, r2 + lsls r0, 4 + adds r1, r0 + strb r1, [r4, 0x3] + lsls r5, 16 + lsrs r5, 16 + cmp r5, 0x7 + bls _081290E2 + b _0812919A +_0812913E: + movs r5, 0 + movs r3, 0x7 +_08129142: + lsls r2, r5, 2 + adds r2, r7 + subs r1, r3, r5 + lsls r1, 2 + mov r4, sp + adds r0, r4, r1 + ldrb r0, [r0] + strb r0, [r2] + adds r0, r1, 0x1 + add r0, sp + ldrb r0, [r0] + strb r0, [r2, 0x1] + adds r0, r1, 0x2 + add r0, sp + ldrb r0, [r0] + strb r0, [r2, 0x2] + adds r1, 0x3 + adds r0, r4, r1 + ldrb r0, [r0] + strb r0, [r2, 0x3] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x7 + bls _08129142 + b _0812919A +_08129176: + movs r5, 0 + movs r4, 0x1F + movs r6, 0xF +_0812917C: + adds r3, r7, r5 + subs r0, r4, r5 + add r0, sp + ldrb r2, [r0] + lsrs r1, r2, 4 + adds r0, r6, 0 + ands r0, r2 + lsls r0, 4 + adds r1, r0 + strb r1, [r3] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x1F + bls _0812917C +_0812919A: + add sp, 0x20 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8129088 + + thumb_func_start sub_81291A4 +sub_81291A4: @ 81291A4 + push {r4,r5,lr} + adds r5, r0, 0 + movs r4, 0 +_081291AA: + lsls r0, r4, 5 + adds r0, 0x84 + adds r0, r5, r0 + lsls r2, r4, 1 + adds r1, r5, 0x4 + adds r1, r2 + ldrh r1, [r1] + bl sub_8129088 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3F + bls _081291AA + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81291A4 + + thumb_func_start sub_81291CC +sub_81291CC: @ 81291CC + lsls r0, 16 + ldr r1, =gTilesetPointer_SecretBaseRedCave + ldr r1, [r1] + ldr r1, [r1, 0xC] + lsrs r0, 15 + adds r0, r1 + ldrh r1, [r0] + ldr r0, =0x00000fff + ands r0, r1 + bx lr + .pool + thumb_func_end sub_81291CC + + thumb_func_start sub_81291E8 +sub_81291E8: @ 81291E8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + ldr r0, [r0] + ldrb r0, [r0, 0x12] + movs r6, 0 + ldr r1, =gUnknown_085A71B0 + lsls r5, r0, 4 + adds r0, r5, r1 + ldrb r0, [r0, 0xC] + cmp r6, r0 + bcs _0812924C + adds r7, r1, 0 +_08129204: + mov r4, r8 + ldm r4!, {r1} + adds r0, r7, 0x4 + adds r0, r5, r0 + ldr r0, [r0] + adds r0, r6 + ldrb r0, [r0] + ldr r1, [r1, 0x1C] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + adds r1, r7, 0 + adds r1, 0x8 + adds r1, r5, r1 + ldr r1, [r1] + adds r1, r6 + lsls r0, 3 + ldrb r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bl sub_81291CC + adds r2, r5, r7 + ldr r1, [r2] + adds r1, r6 + ldrb r1, [r1] + lsls r1, 1 + adds r4, r1 + strh r0, [r4] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r2, [r2, 0xC] + cmp r6, r2 + bcc _08129204 +_0812924C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81291E8 + + thumb_func_start sub_812925C +sub_812925C: @ 812925C + push {r4,r5,lr} + lsls r0, 24 + ldr r3, =0x0203aa3c + movs r1, 0 + strb r1, [r3] + ldrb r2, [r3, 0x1] + subs r1, 0x4 + ands r1, r2 + movs r5, 0xD + negs r5, r5 + ands r1, r5 + movs r2, 0x11 + negs r2, r2 + ands r1, r2 + subs r2, 0x10 + ands r1, r2 + strb r1, [r3, 0x1] + ldr r1, =gUnknown_085A7250 + lsrs r0, 22 + adds r0, r1 + ldrb r1, [r0] + movs r4, 0x3F + lsls r1, 6 + strb r1, [r3, 0x1] + ldrh r2, [r3, 0x2] + ldr r1, =0xfffffe00 + ands r1, r2 + strh r1, [r3, 0x2] + ldrb r2, [r3, 0x3] + movs r1, 0x3F + negs r1, r1 + ands r1, r2 + strb r1, [r3, 0x3] + ldrb r0, [r0, 0x1] + lsls r0, 6 + ands r4, r1 + orrs r4, r0 + strb r4, [r3, 0x3] + ldrh r1, [r3, 0x4] + ldr r0, =0xfffffc00 + ands r0, r1 + strh r0, [r3, 0x4] + ldrb r0, [r3, 0x5] + ands r5, r0 + movs r0, 0xF + ands r5, r0 + strb r5, [r3, 0x5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812925C + + thumb_func_start sub_81292D0 +sub_81292D0: @ 81292D0 + movs r1, 0 + strh r1, [r0, 0x32] + strh r1, [r0, 0x34] + strh r1, [r0, 0x36] + strh r1, [r0, 0x38] + strh r1, [r0, 0x3A] + strh r1, [r0, 0x3C] + ldr r1, =sub_81292E8 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_81292D0 + + thumb_func_start sub_81292E8 +sub_81292E8: @ 81292E8 + push {lr} + adds r2, r0, 0 + movs r1, 0x3C + ldrsh r0, [r2, r1] + cmp r0, 0 + bne _08129322 + movs r1, 0x3A + ldrsh r0, [r2, r1] + cmp r0, 0xE + bgt _0812930A + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + b _08129314 +_0812930A: + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 +_08129314: + strb r0, [r3] + ldrh r0, [r2, 0x3A] + adds r0, 0x1 + movs r1, 0x1F + ands r0, r1 + strh r0, [r2, 0x3A] + b _0812932E +_08129322: + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_0812932E: + pop {r0} + bx r0 + thumb_func_end sub_81292E8 + + thumb_func_start gpu_pal_decompress_alloc_tag_and_upload +gpu_pal_decompress_alloc_tag_and_upload: @ 8129334 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + lsls r4, r1, 24 + lsrs r4, 24 + bl sub_8129048 + lsls r4, 5 + ldr r0, =gUnknown_085A5C08 + adds r4, r0 + str r4, [r5] + ldrb r0, [r4, 0x11] + cmp r0, 0x4 + beq _081293B4 + ldr r0, =0x00000be5 + bl FreeObjectPaletteByTag + adds r0, r5, 0 + bl sub_81291E8 + ldr r0, [r5] + ldrb r0, [r0, 0x12] + bl sub_812925C + adds r0, r5, 0 + bl sub_81291A4 + ldr r1, =0x00000884 + adds r0, r5, r1 + ldr r1, =gTilesetPointer_SecretBaseRedCave + ldr r2, [r1] + ldr r1, [r5] + ldr r1, [r1, 0x1C] + ldrh r1, [r1] + ldr r2, [r2, 0xC] + lsls r1, 4 + adds r1, r2 + ldrh r1, [r1, 0xE] + lsrs r1, 12 + bl sub_8129068 + ldr r0, =gUnknown_085A72BC + bl LoadTaggedObjectPalette + ldr r0, =gUnknown_085A728C + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AddObjectToFront + b _081293C6 + .pool +_081293B4: + ldr r0, [r4, 0x1C] + ldrh r0, [r0] + ldr r1, =DummyObjectCallback + movs r2, 0x1 + str r2, [sp] + movs r2, 0 + movs r3, 0 + bl AddPseudoFieldObject +_081293C6: + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end gpu_pal_decompress_alloc_tag_and_upload + + thumb_func_start AddDecorationIconObjectFromIconTable +@ u8 AddDecorationIconObjectFromIconTable(u16 tilesTag, u16 paletteTag, u8 decorationId) +AddDecorationIconObjectFromIconTable: @ 81293D8 + push {r4-r7,lr} + sub sp, 0x10 + lsls r0, 16 + lsrs r7, r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 24 + lsrs r5, r2, 24 + bl AllocItemIconTemporaryBuffers + lsls r0, 24 + cmp r0, 0 + beq _08129490 + adds r0, r5, 0 + movs r1, 0 + bl GetDecorationIconPicOrPalette + ldr r4, =0x0203cebc + ldr r1, [r4] + bl LZDecompressWram + ldr r0, [r4] + ldr r4, =0x0203cec0 + 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 LoadObjectPic + adds r0, r5, 0 + movs r1, 0x1 + bl GetDecorationIconPicOrPalette + 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 + adds r1, r5, 0 + ldr r0, =gUnknown_08614FF4 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + strh r7, [r5] + strh r6, [r5, 0x2] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AddObjectToFront + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl FreeItemIconTemporaryBuffers + adds r0, r5, 0 + bl Free + adds r0, r4, 0 + b _08129492 + .pool +_08129490: + movs r0, 0x40 +_08129492: + add sp, 0x10 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end AddDecorationIconObjectFromIconTable + + thumb_func_start GetDecorationIconPicOrPalette +@ u32 GetDecorationIconPicOrPalette(u16 decorationId, u8 which) +GetDecorationIconPicOrPalette: @ 812949C + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 24 + lsrs r0, r1, 24 + cmp r3, 0x78 + bls _081294AC + movs r3, 0 +_081294AC: + ldr r2, =gUnknown_085A6BE8 + lsls r0, 2 + lsls r1, r3, 3 + adds r0, r1 + adds r0, r2 + ldr r0, [r0] + pop {r1} + bx r1 + .pool + thumb_func_end GetDecorationIconPicOrPalette + + thumb_func_start AddDecorationIconObjectFromFieldObject +@ u8 AddDecorationIconObjectFromFieldObject(u16 tilesTag, u16 paletteTag, u8 decorationId) +AddDecorationIconObjectFromFieldObject: @ 81294C0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + adds r4, r2, 0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r4, 24 + lsrs r4, 24 + ldr r6, =0x0203a190 + adds r0, r6, 0 + bl sub_8129048 + lsls r4, 5 + ldr r0, =gUnknown_085A5C08 + adds r4, r0 + str r4, [r6] + ldrb r0, [r4, 0x11] + cmp r0, 0x4 + beq _081295A4 + adds r0, r6, 0 + bl sub_81291E8 + ldr r0, [r6] + ldrb r0, [r0, 0x12] + bl sub_812925C + adds r0, r6, 0 + bl sub_81291A4 + ldr r0, =0x00000884 + adds r5, r6, r0 + ldr r0, =gTilesetPointer_SecretBaseRedCave + ldr r1, [r0] + ldr r0, [r6] + ldr r0, [r0, 0x1C] + ldrh r0, [r0] + ldr r1, [r1, 0xC] + lsls r0, 4 + adds r0, r1 + ldrh r1, [r0, 0xE] + lsrs r1, 12 + adds r0, r5, 0 + bl sub_8129068 + adds r0, r6, 0 + adds r0, 0x84 + str r0, [sp, 0x4] + ldr r1, =gUnknown_085A72F4 + ldr r0, [r6] + ldrb r0, [r0, 0x12] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 21 + ldr r4, =0xffff0000 + mov r2, r8 + lsls r1, r2, 16 + lsrs r0, 16 + orrs r0, r1 + str r0, [sp, 0x8] + add r0, sp, 0x4 + bl LoadObjectPic + str r5, [sp, 0xC] + add r0, sp, 0xC + ldr r1, [r0, 0x4] + ands r1, r4 + orrs r1, r7 + str r1, [r0, 0x4] + bl LoadTaggedObjectPalette + movs r0, 0x18 + bl Alloc + adds r4, r0, 0 + adds r1, r4, 0 + ldr r0, =gUnknown_085A72A4 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + mov r3, r8 + strh r3, [r4] + strh r7, [r4, 0x2] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + bl Free + b _081295BA + .pool +_081295A4: + ldr r0, [r4, 0x1C] + ldrh r0, [r0] + ldr r1, =DummyObjectCallback + movs r2, 0x1 + str r2, [sp] + movs r2, 0 + movs r3, 0 + bl AddPseudoFieldObject + lsls r0, 24 + lsrs r5, r0, 24 +_081295BA: + adds r0, r5, 0 + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end AddDecorationIconObjectFromFieldObject + + thumb_func_start AddDecorationIconObject +@ u8 AddDecorationIconObject(u8 decorationId, u16 x, u16 y, u8 priority, u16 tilesTag, u16 paletteTag) +AddDecorationIconObject: @ 81295CC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r4, [sp, 0x24] + ldr r5, [sp, 0x28] + lsls r0, 24 + lsrs r6, r0, 24 + mov r12, r6 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + mov r9, r8 + lsls r2, 16 + lsrs r7, r2, 16 + mov r10, r7 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp] + lsls r4, 16 + lsrs r4, 16 + adds r3, r4, 0 + lsls r5, 16 + lsrs r5, 16 + adds r2, r5, 0 + cmp r6, 0x78 + bls _08129634 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl AddDecorationIconObjectFromIconTable + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x40 + beq _08129696 + ldr r2, =0x02020630 + lsls r3, r4, 4 + adds r1, r3, r4 + lsls r1, 2 + adds r1, r2 + mov r5, r8 + lsls r0, r5, 16 + asrs r0, 16 + adds r0, 0x4 + strh r0, [r1, 0x24] + lsls r0, r7, 16 + b _081296B2 + .pool +_08129634: + ldr r0, =gUnknown_085A6BE8 + lsls r1, r6, 3 + adds r1, r0 + ldr r0, [r1] + cmp r0, 0 + bne _08129684 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl AddDecorationIconObjectFromFieldObject + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x40 + beq _08129696 + ldr r1, =0x02020630 + lsls r2, r4, 4 + adds r0, r2, r4 + lsls r0, 2 + adds r5, r0, r1 + mov r0, r8 + strh r0, [r5, 0x24] + adds r0, r6, 0 + subs r0, 0x2A + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08129680 + lsls r0, r7, 16 + asrs r0, 16 + subs r0, 0x4 + strh r0, [r5, 0x26] + b _081296BC + .pool +_08129680: + strh r7, [r5, 0x26] + b _081296BC +_08129684: + adds r0, r3, 0 + adds r1, r2, 0 + mov r2, r12 + bl AddDecorationIconObjectFromIconTable + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x40 + bne _0812969A +_08129696: + movs r0, 0x40 + b _081296D8 +_0812969A: + ldr r2, =0x02020630 + lsls r3, r4, 4 + adds r1, r3, r4 + lsls r1, 2 + adds r1, r2 + mov r5, r9 + lsls r0, r5, 16 + asrs r0, 16 + adds r0, 0x4 + strh r0, [r1, 0x24] + mov r5, r10 + lsls r0, r5, 16 +_081296B2: + asrs r0, 16 + adds r0, 0x4 + strh r0, [r1, 0x26] + adds r1, r2, 0 + adds r2, r3, 0 +_081296BC: + adds r2, r4 + lsls r2, 2 + adds r2, r1 + movs r0, 0x3 + ldr r1, [sp] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + adds r0, r4, 0 +_081296D8: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end AddDecorationIconObject + + thumb_func_start sub_81296EC +sub_81296EC: @ 81296EC + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x0203a17c + ldr r1, [r3] + adds r1, r0 + movs r2, 0 + strb r2, [r1] + ldr r1, [r3, 0x4] + adds r1, r0 + strb r2, [r1] + bx lr + .pool + thumb_func_end sub_81296EC + + thumb_func_start sub_8129708 +sub_8129708: @ 8129708 + push {r4-r6,lr} + ldr r6, =0x020375e2 + movs r0, 0 + strh r0, [r6] + ldr r2, =0x020375f0 + strh r0, [r2] + ldr r4, =0x020375e0 + ldr r1, =0x0203aac4 + ldrh r0, [r4] + ldrb r1, [r1] + cmp r0, r1 + bne _08129744 + movs r0, 0x1 + strh r0, [r2] + b _08129796 + .pool +_08129738: + ldr r1, =0x020375e4 + ldrb r0, [r2] + strh r0, [r1] + b _08129796 + .pool +_08129744: + ldr r3, =gUnknown_085A5C08 + ldr r2, =0x0203a17c + ldr r1, =0x0203aa44 + ldrh r0, [r4] + lsls r0, 3 + adds r4, r0, r1 + ldrb r1, [r4] + ldr r0, [r2] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 5 + adds r0, r3 + ldrb r0, [r0, 0x11] + cmp r0, 0x4 + bne _08129796 + ldrh r0, [r4, 0x4] + strh r0, [r6] + ldrb r0, [r4] + bl sub_81296EC + movs r1, 0 + ldr r0, =0x02037318 + ldr r0, [r0, 0x4] + ldrb r2, [r0] + cmp r1, r2 + bcs _08129796 + ldr r5, [r0, 0x4] + ldrh r4, [r6] + adds r3, r2, 0 +_0812977E: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r2, r0, r5 + ldrh r0, [r2, 0x14] + cmp r0, r4 + beq _08129738 + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r3 + bcc _0812977E +_08129796: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8129708 + + thumb_func_start sub_81297AC +sub_81297AC: @ 81297AC + push {r4-r6,lr} + movs r2, 0 + ldr r0, =0x02037318 + ldr r0, [r0, 0x4] + ldrb r1, [r0] + cmp r2, r1 + bcs _081297F0 + adds r3, r0, 0 + ldr r5, [r3, 0x4] + ldr r0, =0x020375e0 + ldrh r4, [r0] + ldr r6, =0x020375e2 +_081297C4: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r5 + ldrh r0, [r1, 0x14] + cmp r0, r4 + bne _081297E4 + ldrb r0, [r1] + strh r0, [r6] + b _081297F0 + .pool +_081297E4: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + ldrb r0, [r3] + cmp r2, r0 + bcc _081297C4 +_081297F0: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81297AC + + thumb_func_start sub_81297F8 +sub_81297F8: @ 81297F8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + movs r6, 0 + b _081298BE +_08129808: + ldr r3, =0x0203aa44 + lsls r5, r6, 3 + adds r4, r5, r3 + ldrb r1, [r4] + ldr r2, =0x0203a17c + ldr r0, [r2] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 5 + ldr r7, =gUnknown_085A5C08 + adds r0, r7 + ldrb r2, [r0, 0x11] + ldr r7, =0x0203a17c + ldr r0, [r7, 0x4] + adds r0, r1 + ldrb r0, [r0] + lsrs r1, r0, 4 + mov r8, r1 + movs r7, 0xF + adds r1, r7, 0 + ands r1, r0 + str r1, [sp] + adds r7, r5, 0 + adds r6, 0x1 + str r6, [sp, 0x4] + cmp r2, 0x4 + beq _081298B8 + movs r6, 0 + ldrb r4, [r4, 0x2] + cmp r6, r4 + bcs _081298AE +_08129846: + movs r4, 0 + adds r0, r5, r3 + adds r2, r6, 0x1 + mov r10, r2 + ldrb r0, [r0, 0x1] + cmp r4, r0 + bcs _0812989C + ldr r3, =0x0203aa44 + adds r3, r7 + mov r9, r3 + subs r5, r6, 0x7 + str r5, [sp, 0x8] +_0812985E: + adds r0, r4, 0x7 + add r0, r8 + ldr r1, =0x02037318 + ldr r3, [r1] + ldr r1, [sp] + subs r2, r1, r6 + ldr r1, [r3] + muls r2, r1 + mov r5, r8 + adds r1, r5, r4 + adds r1, r2 + ldr r2, [r3, 0xC] + lsls r1, 1 + adds r1, r2 + ldrh r1, [r1] + movs r3, 0xC0 + lsls r3, 6 + adds r2, r3, 0 + orrs r2, r1 + ldr r5, [sp] + ldr r3, [sp, 0x8] + subs r1, r5, r3 + bl MapGridSetMetatileEntryAt + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + mov r5, r9 + ldrb r5, [r5, 0x1] + cmp r4, r5 + bcc _0812985E +_0812989C: + mov r1, r10 + lsls r0, r1, 24 + lsrs r6, r0, 24 + ldr r3, =0x0203aa44 + adds r5, r7, 0 + adds r0, r7, r3 + ldrb r0, [r0, 0x2] + cmp r6, r0 + bcc _08129846 +_081298AE: + ldr r2, =0x0203aa44 + adds r0, r7, r2 + ldrb r0, [r0] + bl sub_81296EC +_081298B8: + ldr r3, [sp, 0x4] + lsls r0, r3, 24 + lsrs r6, r0, 24 +_081298BE: + ldr r0, =0x0203aac4 + ldrb r0, [r0] + cmp r6, r0 + bcc _08129808 + 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_81297F8 + + thumb_func_start sub_81298EC +sub_81298EC: @ 81298EC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08129928 + cmp r0, 0x1 + bgt _08129914 + cmp r0, 0 + beq _0812991E + b _08129994 + .pool +_08129914: + cmp r0, 0x2 + beq _08129954 + cmp r0, 0x3 + beq _08129968 + b _08129994 +_0812991E: + bl sub_81297F8 + movs r0, 0x1 + strh r0, [r4, 0xC] + b _08129994 +_08129928: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08129994 + bl DrawWholeMapView + ldr r0, =gUnknown_08275D2E + bl script_env_1_execute_new_script + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + movs r0, 0x2 + strh r0, [r4, 0xC] + b _08129994 + .pool +_08129954: + bl script_env_2_enable + adds r0, r5, 0 + bl sub_8127814 + bl pal_fill_black + movs r0, 0x3 + strh r0, [r4, 0xC] + b _08129994 +_08129968: + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08129994 + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EAAC5 + adds r0, r4, 0 + bl ExpandStringRefs + ldr r2, =sub_8129D64 + adds r0, r5, 0 + adds r1, r4, 0 + bl DisplayItemMessageOnField + ldr r0, =0x02037318 + ldrb r0, [r0, 0x14] + cmp r0, 0x56 + bne _08129994 + bl sub_80EE104 +_08129994: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81298EC + + thumb_func_start sub_81299AC +sub_81299AC: @ 81299AC + push {lr} + movs r1, 0 + ldr r0, =0x0203a17c + ldrb r2, [r0, 0x8] + cmp r1, r2 + bcs _081299D6 + ldr r3, [r0] +_081299BA: + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _081299CC + movs r0, 0x1 + b _081299D8 + .pool +_081299CC: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r2 + bcc _081299BA +_081299D6: + movs r0, 0 +_081299D8: + pop {r1} + bx r1 + thumb_func_end sub_81299AC + + thumb_func_start SetUpPuttingAwayDecorationPlayerAvatar +SetUpPuttingAwayDecorationPlayerAvatar: @ 81299DC + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + bl player_get_direction_lower_nybble + ldr r3, =0x0203aa38 + ldr r2, =0x02020630 + ldr r4, =0x03005dd0 + ldr r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x2E] + strb r0, [r3] + bl sub_812A39C + ldr r0, =gUnknown_085A7404 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + str r0, [r4, 0x4] + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _08129A3C + ldr r1, =DummyObjectCallback + str r0, [sp] + movs r0, 0xC1 + b _08129A44 + .pool +_08129A3C: + ldr r1, =DummyObjectCallback + movs r0, 0 + str r0, [sp] + movs r0, 0xC2 +_08129A44: + movs r2, 0x88 + movs r3, 0x48 + bl AddPseudoFieldObject + ldr r1, =0x0203aa39 + strb r0, [r1] + ldr r6, =0x02020630 + ldr r0, =0x0203aa39 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r2, [r1, 0x5] + movs r4, 0xD + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + movs r2, 0x4 + mov r8, r2 + mov r2, r8 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r5, =0x0203aa38 + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl RemoveObjectAndFreeTiles + ldr r0, =0x03005dd0 + ldr r0, [r0, 0x4] + strb r0, [r5] + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0, 0x5] + ands r4, r1 + mov r1, r8 + orrs r4, r1 + strb r4, [r0, 0x5] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end SetUpPuttingAwayDecorationPlayerAvatar + + thumb_func_start sub_8129ABC +sub_8129ABC: @ 8129ABC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08129B0C + cmp r0, 0x1 + bgt _08129AE4 + cmp r0, 0 + beq _08129AEA + b _08129B2E + .pool +_08129AE4: + cmp r0, 0x2 + beq _08129B1A + b _08129B2E +_08129AEA: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08129B2E + adds r0, r5, 0 + bl sub_8127ACC + movs r0, 0x1 + strh r0, [r4, 0x4] + strh r0, [r4, 0xC] + strh r0, [r4, 0xA] + b _08129B2E + .pool +_08129B0C: + bl SetUpPuttingAwayDecorationPlayerAvatar + bl pal_fill_black + movs r0, 0x2 + strh r0, [r4, 0x4] + b _08129B2E +_08129B1A: + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08129B2E + strh r0, [r4, 0x18] + adds r0, r5, 0 + bl sub_8129B34 +_08129B2E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8129ABC + + thumb_func_start sub_8129B34 +sub_8129B34: @ 8129B34 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + ldr r4, =0x02020630 + ldr r3, =0x0203aa38 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r6, 0 + strh r6, [r0, 0x3C] + ldrb r1, [r3] + 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] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_812A36C + str r1, [r0] + ldr r2, =0x0203aa39 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x88 + strh r1, [r0, 0x20] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x48 + strh r1, [r0, 0x22] + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0x1C] + ldr r1, =sub_8128E18 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8129B34 + + thumb_func_start sub_8129BCC +sub_8129BCC: @ 8129BCC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x1C] + bl sub_8128DE0 + adds r0, r4, 0 + bl sub_8129C74 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8129BCC + + thumb_func_start sub_8129BF8 +sub_8129BF8: @ 8129BF8 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x1C] + bl sub_8128DE0 + ldr r3, =0x02020630 + ldr r5, =0x0203aa38 + ldrb r1, [r5] + 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, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, 0x1C + adds r0, r3 + ldr r1, =DummyObjectCallback + str r1, [r0] + ldr r5, =0x02021fc4 + ldr r1, =gUnknown_085EAA62 + adds r0, r5, 0 + bl ExpandStringRefs + ldr r2, =sub_812A1F0 + adds r0, r4, 0 + adds r1, r5, 0 + bl DisplayItemMessageOnField + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8129BF8 + + thumb_func_start sub_8129C74 +sub_8129C74: @ 8129C74 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl sub_812A0E8 + ldr r0, =0x0203aac4 + ldrb r0, [r0] + cmp r0, 0 + beq _08129CA8 + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EAAA3 + adds r0, r4, 0 + bl ExpandStringRefs + ldr r2, =sub_812A1A0 + b _08129D14 + .pool +_08129CA8: + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r1, r0 + movs r2, 0 + ldrsh r0, [r1, r2] + movs r2, 0x2 + ldrsh r1, [r1, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8089288 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08129CDE + adds r0, r4, 0 + bl sub_8089404 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08129D3C +_08129CDE: + ldr r3, =0x02020630 + ldr r4, =0x0203aa38 + ldrb r1, [r4] + 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] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, 0x1C + adds r0, r3 + ldr r1, =DummyObjectCallback + str r1, [r0] + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EAA62 + adds r0, r4, 0 + bl ExpandStringRefs + ldr r2, =sub_812A1F0 +_08129D14: + adds r0, r5, 0 + adds r1, r4, 0 + bl DisplayItemMessageOnField + b _08129D50 + .pool +_08129D3C: + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EAA81 + adds r0, r4, 0 + bl ExpandStringRefs + ldr r2, =sub_8129D64 + adds r0, r5, 0 + adds r1, r4, 0 + bl DisplayItemMessageOnField +_08129D50: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8129C74 + + thumb_func_start sub_8129D64 +sub_8129D64: @ 8129D64 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08129D7E + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08129D84 +_08129D7E: + adds r0, r2, 0 + bl sub_8129B34 +_08129D84: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8129D64 + + thumb_func_start sub_8129D8C +sub_8129D8C: @ 8129D8C + push {lr} + adds r2, r1, 0 + lsls r0, 24 + ldr r1, =gUnknown_085A5C08 + lsrs r0, 19 + adds r0, r1 + ldrb r1, [r0, 0x12] + cmp r1, 0 + bne _08129DA8 + movs r0, 0x1 + strb r0, [r2, 0x1] + b _08129E06 + .pool +_08129DA8: + cmp r1, 0x1 + bne _08129DB4 + movs r0, 0x2 + strb r0, [r2, 0x1] + strb r1, [r2, 0x2] + b _08129E08 +_08129DB4: + cmp r1, 0x2 + bne _08129DC0 + movs r0, 0x3 + strb r0, [r2, 0x1] + movs r0, 0x1 + b _08129E06 +_08129DC0: + cmp r1, 0x3 + bne _08129DC8 + movs r0, 0x4 + b _08129E02 +_08129DC8: + cmp r1, 0x4 + bne _08129DD2 + movs r0, 0x2 + strb r0, [r2, 0x1] + b _08129E06 +_08129DD2: + cmp r1, 0x5 + bne _08129DDA + movs r0, 0x1 + b _08129E02 +_08129DDA: + cmp r1, 0x6 + bne _08129DE6 + movs r0, 0x1 + strb r0, [r2, 0x1] + movs r0, 0x3 + b _08129E06 +_08129DE6: + cmp r1, 0x7 + bne _08129DF2 + movs r0, 0x2 + strb r0, [r2, 0x1] + movs r0, 0x4 + b _08129E06 +_08129DF2: + cmp r1, 0x8 + bne _08129DFC + movs r0, 0x3 + strb r0, [r2, 0x1] + b _08129E06 +_08129DFC: + cmp r1, 0x9 + bne _08129E08 + movs r0, 0x3 +_08129E02: + strb r0, [r2, 0x1] + movs r0, 0x2 +_08129E06: + strb r0, [r2, 0x2] +_08129E08: + pop {r0} + bx r0 + thumb_func_end sub_8129D8C + + thumb_func_start sub_8129E0C +sub_8129E0C: @ 8129E0C + push {r4-r6,lr} + lsls r0, 24 + lsls r1, 24 + ldr r5, =0x02020630 + ldr r6, =0x0203aa38 + ldrb r3, [r6] + lsls r2, r3, 4 + adds r2, r3 + lsls r2, 2 + adds r2, r5 + adds r2, 0x3E + ldrb r3, [r2] + movs r4, 0x4 + orrs r3, r4 + strb r3, [r2] + ldrb r3, [r6] + lsls r2, r3, 4 + adds r2, r3 + lsls r2, 2 + adds r3, r5, 0 + adds r3, 0x1C + adds r2, r3 + ldr r3, =DummyObjectCallback + str r3, [r2] + ldr r4, =0x0203aa39 + ldrb r3, [r4] + lsls r2, r3, 4 + adds r2, r3 + lsls r2, 2 + adds r2, r5 + lsrs r0, 20 + adds r0, 0x88 + strh r0, [r2, 0x20] + ldrb r2, [r4] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + lsrs r1, 20 + adds r1, 0x48 + strh r1, [r0, 0x22] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8129E0C + + thumb_func_start sub_8129E74 +sub_8129E74: @ 8129E74 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r2 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =0x03005e00 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r3 + ldrb r0, [r2, 0x8] + subs r0, 0x7 + lsls r0, 24 + lsrs r7, r0, 24 + ldrb r0, [r2, 0xA] + subs r0, 0x7 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r2, =0x0203a17c + ldr r0, [r2, 0x4] + adds r0, r1 + ldrb r0, [r0] + lsrs r5, r0, 4 + movs r6, 0xF + ands r6, r0 + mov r0, r9 + ldrb r4, [r0, 0x2] + ldr r0, [r2] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x29 + bne _08129ED4 + adds r0, r5, 0x7 + adds r1, r6, 0x7 + bl MapGridGetMetatileIdAt + movs r1, 0xA3 + lsls r1, 2 + cmp r0, r1 + bne _08129ED4 + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_08129ED4: + cmp r7, r5 + bcc _08129F10 + mov r0, r9 + ldrb r2, [r0, 0x1] + adds r0, r5, r2 + cmp r7, r0 + bge _08129F10 + subs r0, r6, r4 + cmp r8, r0 + ble _08129F10 + cmp r8, r6 + bhi _08129F10 + subs r0, r7, r5 + adds r0, 0x1 + subs r0, r2, r0 + lsls r0, 24 + lsrs r0, 24 + mov r2, r8 + subs r1, r6, r2 + lsls r1, 24 + lsrs r1, 24 + bl sub_8129E0C + movs r0, 0x1 + b _08129F12 + .pool +_08129F10: + movs r0, 0 +_08129F12: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8129E74 + + thumb_func_start sub_8129F20 +sub_8129F20: @ 8129F20 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r2, =0x0203a17c + ldr r3, =0x0203aa44 + ldr r0, =0x0203aac4 + ldrb r0, [r0] + lsls r0, 3 + adds r0, r3 + ldrb r1, [r0] + ldr r0, [r2, 0x4] + adds r0, r1 + ldrb r0, [r0] + lsrs r1, r0, 4 + mov r8, r1 + movs r6, 0xF + ands r6, r0 + movs r4, 0 + ldr r7, =0x03005d8c + mov r9, r3 +_08129F4A: + ldr r1, [r7] + lsls r0, r4, 1 + adds r0, r4 + lsls r5, r0, 3 + adds r1, r5 + ldr r2, =0x00000c74 + adds r0, r1, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, r8 + bne _08129FB0 + ldr r2, =0x00000c76 + adds r0, r1, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, r6 + bne _08129FB0 + ldr r2, =0x00000c84 + adds r0, r1, r2 + ldrh r0, [r0] + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08129FB0 + ldr r0, =0x0203aac4 + ldrb r1, [r0] + lsls r1, 3 + add r1, r9 + ldr r0, [r7] + adds r0, r5 + ldr r2, =0x00000c84 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1, 0x4] + b _08129FBA + .pool +_08129FB0: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3F + bls _08129F4A +_08129FBA: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8129F20 + + thumb_func_start sub_8129FC8 +sub_8129FC8: @ 8129FC8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + movs r6, 0 + b _0812A02A +_08129FD2: + ldr r0, [r0] + adds r1, r0, r6 + ldrb r0, [r1] + cmp r0, 0 + beq _0812A024 + ldr r0, =gUnknown_085A5C08 + ldrb r2, [r1] + lsls r1, r2, 5 + adds r1, r0 + ldrb r0, [r1, 0x11] + cmp r0, 0x4 + bne _0812A024 + ldr r5, =0x0203aa44 + adds r0, r2, 0 + adds r1, r5, 0 + bl sub_8129D8C + lsls r1, r6, 24 + lsrs r1, 24 + adds r0, r7, 0 + adds r2, r5, 0 + bl sub_8129E74 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bne _0812A024 + strb r6, [r5] + bl sub_8129F20 + ldr r0, =0x0203aac4 + strb r4, [r0] + movs r0, 0x1 + b _0812A034 + .pool +_0812A024: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_0812A02A: + ldr r0, =0x0203a17c + ldrb r1, [r0, 0x8] + cmp r6, r1 + bcc _08129FD2 + movs r0, 0 +_0812A034: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8129FC8 + + thumb_func_start sub_812A040 +sub_812A040: @ 812A040 + 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 r3, 24 + mov r8, r3 + movs r4, 0 + ldr r7, =0x0203a17c + ldrb r0, [r7, 0x8] + cmp r4, r0 + bcs _0812A0C6 + adds r6, r7, 0 + ldr r5, =0x0203aac4 +_0812A072: + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + ldr r0, [r6, 0x4] + adds r0, r4 + ldrb r0, [r0] + lsrs r3, r0, 4 + movs r2, 0xF + ands r2, r0 + cmp r1, 0 + beq _0812A0BA + ldr r0, =gUnknown_085A5C08 + lsls r1, 5 + adds r1, r0 + ldrb r0, [r1, 0x11] + cmp r0, 0x4 + bne _0812A0BA + ldr r0, [sp] + cmp r0, r3 + bhi _0812A0BA + cmp r10, r2 + bhi _0812A0BA + cmp r9, r3 + bcc _0812A0BA + cmp r8, r2 + bcc _0812A0BA + ldr r0, =0x0203aa44 + ldrb r1, [r5] + lsls r1, 3 + adds r1, r0 + strb r4, [r1] + bl sub_8129F20 + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] +_0812A0BA: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r0, [r7, 0x8] + cmp r4, r0 + bcc _0812A072 +_0812A0C6: + 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_812A040 + + thumb_func_start sub_812A0E8 +sub_812A0E8: @ 812A0E8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r4, =0x0203aac4 + movs r0, 0 + strb r0, [r4] + adds r0, r6, 0 + bl sub_8129FC8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0812A18C + movs r5, 0 + ldr r0, =0x0203a17c + ldrb r1, [r0, 0x8] + cmp r5, r1 + bcs _0812A15A + adds r7, r4, 0 +_0812A10E: + ldr r0, [r0] + adds r0, r5 + ldrb r1, [r0] + cmp r1, 0 + beq _0812A14C + ldr r4, =0x0203aa44 + adds r0, r1, 0 + adds r1, r4, 0 + bl sub_8129D8C + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_8129E74 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0812A14C + strb r5, [r4] + ldrb r0, [r7] + adds r0, 0x1 + strb r0, [r7] + b _0812A15A + .pool +_0812A14C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x0203a17c + ldrb r1, [r0, 0x8] + cmp r5, r1 + bcc _0812A10E +_0812A15A: + ldr r0, =0x0203aac4 + ldrb r0, [r0] + cmp r0, 0 + beq _0812A18C + ldr r0, =0x0203a17c + ldr r2, =0x0203aa44 + ldrb r1, [r2] + ldr r0, [r0, 0x4] + adds r0, r1 + ldrb r1, [r0] + lsrs r0, r1, 4 + movs r3, 0xF + ands r3, r1 + ldrb r1, [r2, 0x2] + subs r1, r3, r1 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r2, 0x1] + adds r2, r0 + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + bl sub_812A040 +_0812A18C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A0E8 + + thumb_func_start sub_812A1A0 +sub_812A1A0: @ 812A1A0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8197930 + ldr r1, =gUnknown_085A7348 + adds r0, r4, 0 + bl sub_8121F68 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A1A0 + + thumb_func_start sub_812A1C0 +sub_812A1C0: @ 812A1C0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xC] + ldr r1, =sub_81298EC + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A1C0 + + thumb_func_start sub_812A1F0 +sub_812A1F0: @ 812A1F0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8197930 + ldr r1, =gUnknown_085A7350 + adds r0, r4, 0 + bl sub_8121F68 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A1F0 + + thumb_func_start sub_812A210 +sub_812A210: @ 812A210 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + adds r0, r4, 0 + bl sub_812A22C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812A210 + + thumb_func_start sub_812A22C +sub_812A22C: @ 812A22C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xC] + ldr r1, =sub_812A25C + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A22C + + thumb_func_start sub_812A25C +sub_812A25C: @ 812A25C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0xC + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _0812A280 + cmp r0, 0x1 + beq _0812A29C + b _0812A2B2 + .pool +_0812A280: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0812A2B2 + adds r0, r4, 0 + bl sub_8127B04 + movs r0, 0x1 + strh r0, [r5, 0xC] + b _0812A2B2 + .pool +_0812A29C: + bl sub_812A3C8 + ldr r0, =0x03005dac + ldr r1, =sub_812A334 + str r1, [r0] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + adds r0, r4, 0 + bl DestroyTask +_0812A2B2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A25C + + thumb_func_start sub_812A2C4 +sub_812A2C4: @ 812A2C4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r5, r1, 3 + ldr r6, =0x03005e08 + adds r4, r5, r6 + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0812A2FC + cmp r0, 0x1 + bgt _0812A2EC + cmp r0, 0 + beq _0812A2F6 + b _0812A32A + .pool +_0812A2EC: + cmp r0, 0x2 + beq _0812A308 + cmp r0, 0x3 + beq _0812A314 + b _0812A32A +_0812A2F6: + bl sub_80E9578 + b _0812A30C +_0812A2FC: + ldr r0, =gUnknown_08275D0C + bl script_env_1_execute_new_script + b _0812A30C + .pool +_0812A308: + bl script_env_2_enable +_0812A30C: + ldrh r0, [r4, 0x4] + adds r0, 0x1 + strh r0, [r4, 0x4] + b _0812A32A +_0812A314: + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0812A32A + adds r0, r6, 0 + subs r0, 0x8 + adds r0, r5, r0 + ldr r1, =sub_8126B80 + str r1, [r0] +_0812A32A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A2C4 + + thumb_func_start sub_812A334 +sub_812A334: @ 812A334 + push {lr} + bl pal_fill_black + movs r0, 0 + movs r1, 0x1 + bl sub_81973C4 + bl sub_8126ABC + ldr r0, =sub_812A2C4 + movs r1, 0x8 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0xC] + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A334 + + thumb_func_start sub_812A36C +sub_812A36C: @ 812A36C + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + movs r1, 0x1F + ands r0, r1 + strh r0, [r2, 0x2E] + cmp r0, 0xF + ble _0812A38C + adds r0, r2, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _0812A398 +_0812A38C: + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_0812A398: + pop {r0} + bx r0 + thumb_func_end sub_812A36C + + thumb_func_start sub_812A39C +sub_812A39C: @ 812A39C + push {lr} + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _0812A3B8 + ldr r0, =gUnknown_085A73D8 + bl LoadTaggedObjectPalette + b _0812A3BE + .pool +_0812A3B8: + ldr r0, =gUnknown_085A73E0 + bl LoadTaggedObjectPalette +_0812A3BE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A39C + + thumb_func_start sub_812A3C8 +sub_812A3C8: @ 812A3C8 + push {lr} + movs r0, 0x8 + bl FreeObjectPaletteByTag + pop {r0} + bx r0 + thumb_func_end sub_812A3C8 + + thumb_func_start sub_812A3D4 +sub_812A3D4: @ 812A3D4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_81279C4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0812A430 + ldr r0, =0x02021cc4 + ldr r1, =0x0203a172 + ldrb r2, [r1] + ldr r1, =0x0203a14c + ldr r1, [r1] + adds r1, r2 + ldrb r1, [r1] + lsls r1, 5 + ldr r2, =gUnknown_085A5C09 + adds r1, r2 + bl CopyString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EAA14 + adds r0, r4, 0 + bl ExpandStringRefs + ldr r2, =sub_812A458 + adds r0, r5, 0 + adds r1, r4, 0 + bl DisplayItemMessageOnField + b _0812A444 + .pool +_0812A430: + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EA9E0 + adds r0, r4, 0 + bl ExpandStringRefs + ldr r2, =sub_8127A5C + adds r0, r5, 0 + adds r1, r4, 0 + bl DisplayItemMessageOnField +_0812A444: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A3D4 + + thumb_func_start sub_812A458 +sub_812A458: @ 812A458 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8197930 + ldr r1, =gUnknown_085A741C + adds r0, r4, 0 + bl sub_8121F68 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A458 + + thumb_func_start sub_812A478 +sub_812A478: @ 812A478 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x0203a172 + ldrb r1, [r0] + ldr r0, =0x0203a14c + ldr r0, [r0] + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r5, =0x0203a173 + ldrb r0, [r5] + bl sub_8161AD0 + ldr r1, =0x0203a151 + strb r0, [r1] + ldrb r0, [r5] + bl sub_8161A38 + adds r0, r4, 0 + bl sub_8127814 + ldr r5, =0x02021fc4 + ldr r1, =gUnknown_085EAA3D + adds r0, r5, 0 + bl ExpandStringRefs + ldr r2, =sub_8127A5C + adds r0, r4, 0 + adds r1, r5, 0 + bl DisplayItemMessageOnField + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A478 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/dewford_trend.s b/asm/dewford_trend.s new file mode 100644 index 000000000..601f39a10 --- /dev/null +++ b/asm/dewford_trend.s @@ -0,0 +1,975 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_81224D4 +sub_81224D4: @ 81224D4 + push {r4-r7,lr} + movs r6, 0 + ldr r5, =0x03005d8c +_081224DA: + movs r0, 0xA + bl sub_811EE38 + ldr r1, [r5] + lsls r4, r6, 3 + adds r1, r4 + ldr r2, =0x00002e6c + adds r1, r2 + strh r0, [r1] + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _08122514 + movs r0, 0xC + bl sub_811EE38 + ldr r1, [r5] + adds r1, r4 + ldr r7, =0x00002e6e + adds r1, r7 + b _08122522 + .pool +_08122514: + movs r0, 0xD + bl sub_811EE38 + ldr r1, [r5] + adds r1, r4 + ldr r2, =0x00002e6e + adds r1, r2 +_08122522: + strh r0, [r1] + bl GenerateRandomNumber + ldr r3, [r5] + adds r3, r4 + movs r2, 0x1 + ands r2, r0 + ldr r7, =0x00002e69 + adds r3, r7 + lsls r2, 6 + ldrb r0, [r3] + movs r7, 0x41 + negs r7, r7 + adds r1, r7, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3] + ldr r0, =0x00002e68 + adds r1, r4, r0 + ldr r0, [r5] + adds r0, r1 + bl sub_8122B28 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x4 + bls _081224DA + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002e68 + adds r0, r1 + movs r1, 0x5 + movs r2, 0 + bl sub_8122804 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81224D4 + + thumb_func_start sub_8122580 +sub_8122580: @ 8122580 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _08122596 + b _081226BE +_08122596: + lsls r0, r1, 2 + adds r0, r1 + str r0, [sp] + movs r0, 0 + mov r10, r0 + movs r1, 0x7F + mov r9, r1 + movs r2, 0x80 + negs r2, r2 + mov r8, r2 +_081225AA: + ldr r2, [sp] + mov r3, r10 + lsls r0, r3, 3 + ldr r4, =0x00002e68 + adds r0, r4 + ldr r3, =0x03005d8c + ldr r1, [r3] + adds r5, r1, r0 + ldrb r6, [r5, 0x1] + movs r0, 0x40 + ands r0, r6 + cmp r0, 0 + bne _08122608 + ldrb r4, [r5] + lsls r3, r4, 25 + lsrs r1, r3, 25 + lsls r0, r2, 16 + lsrs r0, 16 + cmp r1, r0 + bcc _081225F8 + adds r0, r1, 0 + subs r0, r2 + mov r1, r9 + ands r0, r1 + mov r1, r8 + ands r1, r4 + orrs r1, r0 + strb r1, [r5] + movs r0, 0x7F + ands r1, r0 + cmp r1, 0 + bne _0812269E + movs r0, 0x40 + orrs r0, r6 + b _0812269C + .pool +_081225F8: + lsrs r0, r3, 25 + subs r2, r0 + mov r0, r8 + ands r0, r4 + strb r0, [r5] + movs r0, 0x40 + orrs r0, r6 + strb r0, [r5, 0x1] +_08122608: + ldrb r7, [r5] + lsls r0, r7, 25 + lsrs r0, 25 + adds r4, r0, r2 + ldrh r0, [r5] + lsls r6, r0, 18 + lsls r0, r4, 16 + lsrs r0, 16 + lsrs r1, r6, 25 + cmp r0, r1 + bls _08122678 + adds r0, r4, 0 + bl __umodsi3 + adds r3, r0, 0 + lsrs r1, r6, 25 + adds r0, r4, 0 + str r3, [sp, 0x4] + bl __udivsi3 + adds r4, r0, 0 + movs r0, 0x1 + eors r4, r0 + ands r4, r0 + lsls r2, r4, 6 + ldrb r0, [r5, 0x1] + movs r4, 0x41 + negs r4, r4 + adds r1, r4, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x1] + movs r1, 0x40 + ands r0, r1 + ldr r3, [sp, 0x4] + cmp r0, 0 + beq _08122662 + adds r1, r3, 0 + mov r0, r9 + ands r1, r0 + mov r0, r8 + ands r0, r7 + orrs r0, r1 + strb r0, [r5] + b _0812269E +_08122662: + ldrh r0, [r5] + lsls r0, 18 + lsrs r0, 25 + subs r0, r3 + mov r1, r9 + ands r0, r1 + mov r1, r8 + ands r1, r7 + orrs r1, r0 + strb r1, [r5] + b _0812269E +_08122678: + mov r2, r9 + ands r4, r2 + mov r0, r8 + ands r0, r7 + orrs r0, r4 + strb r0, [r5] + lsls r0, 25 + ldrh r1, [r5] + lsls r1, 18 + lsrs r0, 25 + lsrs r1, 25 + cmp r0, r1 + bne _0812269E + ldrb r0, [r5, 0x1] + movs r3, 0x41 + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 +_0812269C: + strb r0, [r5, 0x1] +_0812269E: + mov r0, r10 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + cmp r0, 0x4 + bhi _081226AE + b _081225AA +_081226AE: + ldr r4, =0x03005d8c + ldr r0, [r4] + ldr r1, =0x00002e68 + adds r0, r1 + movs r1, 0x5 + movs r2, 0 + bl sub_8122804 +_081226BE: + 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_8122580 + + thumb_func_start sub_81226D8 +sub_81226D8: @ 81226D8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + mov r8, r0 + movs r0, 0 + movs r1, 0 + str r0, [sp] + str r1, [sp, 0x4] + mov r0, r8 + bl sub_8122BB0 + lsls r0, 24 + cmp r0, 0 + beq _081226F8 + b _081227F2 +_081226F8: + ldr r4, =0x00000893 + adds r0, r4, 0 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08122744 + adds r0, r4, 0 + bl FlagSet + ldr r0, =0x00000894 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08122744 + ldr r0, =0x03005d8c + ldr r1, [r0] + mov r0, r8 + ldrh r2, [r0] + ldr r3, =0x00002e6c + adds r0, r1, r3 + strh r2, [r0] + mov r2, r8 + ldrh r0, [r2, 0x2] + adds r3, 0x2 + adds r1, r3 + strh r0, [r1] + movs r0, 0x1 + b _081227F4 + .pool +_08122744: + mov r0, r8 + ldrh r1, [r0, 0x2] + lsls r1, 16 + ldrh r0, [r0] + orrs r0, r1 + str r0, [sp, 0x4] + movs r1, 0x80 + lsls r1, 7 + ldr r0, [sp] + orrs r0, r1 + str r0, [sp] + mov r0, sp + bl sub_8122B28 + movs r5, 0 +_08122762: + ldr r6, =0x03005d8c + lsls r4, r5, 3 + ldr r1, =0x00002e68 + adds r0, r4, r1 + ldr r1, [r6] + adds r1, r0 + mov r0, sp + movs r2, 0 + bl atk90_changetypestoenemyattacktype + lsls r0, 24 + adds r7, r4, 0 + cmp r0, 0 + beq _081227D4 + movs r2, 0x4 + mov r12, r6 + cmp r2, r5 + bls _081227A6 + ldr r4, =0x00002e68 +_08122788: + ldr r0, [r6] + lsls r3, r2, 3 + adds r0, r4 + adds r3, r0, r3 + subs r2, 0x1 + lsls r1, r2, 3 + adds r0, r1 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r3] + str r1, [r3, 0x4] + lsls r2, 16 + lsrs r2, 16 + cmp r2, r5 + bhi _08122788 +_081227A6: + mov r3, r12 + ldr r2, [r3] + ldr r0, =0x00002e68 + adds r2, r0 + adds r2, r7 + ldr r0, [sp] + ldr r1, [sp, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + cmp r5, 0x4 + bne _081227C2 + mov r0, r8 + bl sub_80EDC60 +_081227C2: + movs r0, 0 + cmp r5, 0 + bne _081227F4 + movs r0, 0x1 + b _081227F4 + .pool +_081227D4: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x4 + bls _08122762 + ldr r2, [r6] + ldr r1, =0x00002e88 + adds r2, r1 + ldr r0, [sp] + ldr r1, [sp, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + mov r0, r8 + bl sub_80EDC60 +_081227F2: + movs r0, 0 +_081227F4: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81226D8 + + thumb_func_start sub_8122804 +sub_8122804: @ 8122804 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r0 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + movs r2, 0 + cmp r2, r7 + bcs _0812286C +_08122820: + adds r1, r2, 0x1 + lsls r0, r1, 16 + lsrs r5, r0, 16 + mov r8, r1 + cmp r5, r7 + bcs _08122862 + lsls r0, r2, 3 + mov r1, r9 + adds r6, r1, r0 +_08122832: + lsls r0, r5, 3 + mov r1, r9 + adds r4, r1, r0 + adds r0, r4, 0 + adds r1, r6, 0 + mov r2, r10 + bl atk90_changetypestoenemyattacktype + lsls r0, 24 + cmp r0, 0 + beq _08122858 + ldr r2, [r4] + ldr r3, [r4, 0x4] + ldr r0, [r6] + ldr r1, [r6, 0x4] + str r0, [r4] + str r1, [r4, 0x4] + str r2, [r6] + str r3, [r6, 0x4] +_08122858: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r7 + bcc _08122832 +_08122862: + mov r1, r8 + lsls r0, r1, 16 + lsrs r2, r0, 16 + cmp r2, r7 + bcc _08122820 +_0812286C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8122804 + + thumb_func_start sub_812287C +sub_812287C: @ 812287C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r0 + adds r6, r1, 0 + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + bl Alloc + mov r10, r0 + cmp r0, 0 + beq _08122980 + adds r0, r4, 0 + bl Alloc + adds r7, r0, 0 + cmp r7, 0 + bne _081228B0 + mov r0, r10 + bl Free + b _08122980 +_081228B0: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r5, 0 + cmp r5, r9 + bcs _081228DE +_081228C0: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + add r0, r10 + adds r1, r5, 0 + muls r1, r6 + add r1, r8 + movs r2, 0x28 + bl memcpy + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r9 + bcc _081228C0 +_081228DE: + mov r4, r10 + mov r8, r7 + movs r3, 0 + movs r5, 0 + cmp r5, r9 + bcs _08122946 +_081228EA: + movs r6, 0 +_081228EC: + adds r0, r7, 0 + adds r1, r4, 0 + adds r2, r3, 0 + str r3, [sp] + bl sub_8122C1C + lsls r0, 16 + asrs r0, 16 + ldr r3, [sp] + cmp r0, 0 + bge _08122918 + ldr r0, [r4] + ldr r1, [r4, 0x4] + mov r2, r8 + adds r2, 0x8 + mov r8, r2 + subs r2, 0x8 + stm r2!, {r0,r1} + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + b _08122930 +_08122918: + lsls r0, 3 + adds r2, r7, r0 + ldrb r1, [r2] + lsls r1, 25 + ldrb r0, [r4] + lsls r0, 25 + cmp r1, r0 + bcs _08122930 + ldr r0, [r4] + ldr r1, [r4, 0x4] + str r0, [r2] + str r1, [r2, 0x4] +_08122930: + adds r4, 0x8 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x4 + bls _081228EC + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r9 + bcc _081228EA +_08122946: + adds r0, r7, 0 + adds r1, r3, 0 + movs r2, 0x2 + bl sub_8122804 + adds r4, r7, 0 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002e68 + adds r1, r0 + mov r8, r1 + movs r5, 0 +_0812295E: + ldm r4!, {r0,r1} + mov r2, r8 + adds r2, 0x8 + mov r8, r2 + subs r2, 0x8 + stm r2!, {r0,r1} + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x4 + bls _0812295E + mov r0, r10 + bl Free + adds r0, r7, 0 + bl Free +_08122980: + 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_812287C + + thumb_func_start sub_8122998 +sub_8122998: @ 8122998 + push {lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r1, 3 + ldr r0, [r2] + adds r1, r0 + ldr r0, =0x02021cc4 + ldr r2, =0x00002e6c + adds r1, r2 + movs r2, 0x2 + movs r3, 0x1 + bl ConvertEasyChatWordsToString + pop {r0} + bx r0 + .pool + thumb_func_end sub_8122998 + + thumb_func_start sub_81229C8 +sub_81229C8: @ 81229C8 + push {r4,lr} + movs r4, 0 + ldr r0, =0x03005d8c + ldr r3, [r0] + ldr r1, =0x00002e68 + adds r0, r3, r1 + ldrb r1, [r0] + lsls r1, 25 + lsrs r1, 25 + ldr r2, =0x00002e70 + adds r0, r3, r2 + ldrb r0, [r0] + lsls r0, 25 + lsrs r0, 25 + subs r1, r0 + cmp r1, 0x1 + bgt _08122A0C + ldr r1, =0x00002e69 + adds r0, r3, r1 + ldrb r1, [r0] + movs r2, 0x40 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08122A0C + ldr r1, =0x00002e71 + adds r0, r3, r1 + ldrb r1, [r0] + adds r0, r2, 0 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + negs r0, r0 + lsrs r4, r0, 31 +_08122A0C: + ldr r0, =0x020375f0 + strh r4, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81229C8 + + thumb_func_start sub_8122A30 +sub_8122A30: @ 8122A30 + ldr r2, =0x020375f0 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r3, =0x00002e6c + adds r1, r0, r3 + adds r3, 0x2 + adds r0, r3 + ldrh r0, [r0] + ldrh r1, [r1] + adds r0, r1 + movs r1, 0x7 + ands r0, r1 + strh r0, [r2] + bx lr + .pool + thumb_func_end sub_8122A30 + + thumb_func_start atk90_changetypestoenemyattacktype +atk90_changetypestoenemyattacktype: @ 8122A58 + push {r4,r5,lr} + adds r3, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r2, 0 + cmp r2, 0x1 + beq _08122A9E + cmp r2, 0x1 + bgt _08122A72 + cmp r2, 0 + beq _08122A78 + b _08122B1A +_08122A72: + cmp r0, 0x2 + beq _08122ACA + b _08122B1A +_08122A78: + ldrb r0, [r3] + lsls r1, r0, 25 + ldrb r0, [r5] + lsls r0, 25 + cmp r1, r0 + bhi _08122B16 + cmp r1, r0 + bcc _08122AC6 + ldrh r0, [r3] + lsls r3, r0, 18 + ldrh r0, [r5] + lsls r2, r0, 18 + lsrs r1, r3, 25 + lsrs r0, r2, 25 + cmp r1, r0 + bhi _08122B16 + lsrs r1, r3, 25 + lsrs r0, r2, 25 + b _08122AC2 +_08122A9E: + ldrh r0, [r3] + lsls r4, r0, 18 + ldrh r0, [r5] + lsls r2, r0, 18 + lsrs r1, r4, 25 + lsrs r0, r2, 25 + cmp r1, r0 + bhi _08122B16 + lsrs r1, r4, 25 + lsrs r0, r2, 25 + cmp r1, r0 + bcc _08122AC6 + ldrb r0, [r3] + lsls r1, r0, 25 + ldrb r0, [r5] + lsls r0, 25 + cmp r1, r0 + bhi _08122B16 +_08122AC2: + cmp r1, r0 + bcs _08122B1A +_08122AC6: + movs r0, 0 + b _08122B22 +_08122ACA: + ldrb r0, [r3] + lsls r1, r0, 25 + ldrb r0, [r5] + lsls r0, 25 + cmp r1, r0 + bhi _08122B16 + cmp r1, r0 + bcc _08122AC6 + ldrh r0, [r3] + lsls r4, r0, 18 + ldrh r0, [r5] + lsls r2, r0, 18 + lsrs r1, r4, 25 + lsrs r0, r2, 25 + cmp r1, r0 + bhi _08122B16 + lsrs r1, r4, 25 + lsrs r0, r2, 25 + cmp r1, r0 + bcc _08122AC6 + ldrh r1, [r3, 0x2] + ldrh r0, [r5, 0x2] + cmp r1, r0 + bhi _08122B16 + cmp r1, r0 + bcc _08122AC6 + ldrh r1, [r3, 0x4] + ldrh r0, [r5, 0x4] + cmp r1, r0 + bhi _08122B16 + cmp r1, r0 + bcc _08122AC6 + ldrh r1, [r3, 0x6] + ldrh r0, [r5, 0x6] + cmp r1, r0 + bhi _08122B16 + cmp r1, r0 + bcc _08122AC6 +_08122B16: + movs r0, 0x1 + b _08122B22 +_08122B1A: + bl GenerateRandomNumber + movs r1, 0x1 + ands r0, r1 +_08122B22: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end atk90_changetypestoenemyattacktype + + thumb_func_start sub_8122B28 +sub_8122B28: @ 8122B28 + push {r4,r5,lr} + adds r5, r0, 0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x62 + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x32 + bls _08122B6A + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x62 + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x50 + bls _08122B6A + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x62 + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 +_08122B6A: + adds r1, r4, 0 + adds r1, 0x1E + movs r0, 0x7F + ands r1, r0 + lsls r1, 7 + ldrh r2, [r5] + ldr r0, =0xffffc07f + ands r0, r2 + orrs r0, r1 + strh r0, [r5] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0x1 + bl __modsi3 + adds r0, 0x1E + movs r1, 0x7F + ands r0, r1 + ldrb r2, [r5] + movs r1, 0x80 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r5] + bl GenerateRandomNumber + strh r0, [r5, 0x2] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8122B28 + + thumb_func_start sub_8122BB0 +sub_8122BB0: @ 8122BB0 + push {r4-r6,lr} + adds r5, r0, 0 + movs r4, 0 + ldr r6, =0x03005d8c +_08122BB8: + lsls r1, r4, 3 + ldr r0, [r6] + adds r1, r0 + ldr r0, =0x00002e6c + adds r1, r0 + adds r0, r5, 0 + bl sub_8122BF0 + lsls r0, 24 + cmp r0, 0 + beq _08122BDC + movs r0, 0x1 + b _08122BE8 + .pool +_08122BDC: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _08122BB8 + movs r0, 0 +_08122BE8: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8122BB0 + + thumb_func_start sub_8122BF0 +sub_8122BF0: @ 8122BF0 + push {r4,lr} + adds r3, r0, 0 + adds r2, r1, 0 + movs r4, 0 +_08122BF8: + ldrh r1, [r3] + ldrh r0, [r2] + adds r2, 0x2 + adds r3, 0x2 + cmp r1, r0 + beq _08122C08 + movs r0, 0 + b _08122C14 +_08122C08: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1 + bls _08122BF8 + movs r0, 0x1 +_08122C14: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8122BF0 + + thumb_func_start sub_8122C1C +sub_8122C1C: @ 8122C1C + push {r4-r7,lr} + adds r5, r0, 0 + adds r7, r1, 0 + lsls r2, 16 + lsrs r6, r2, 16 + movs r4, 0 + cmp r4, r6 + bge _08122C52 +_08122C2C: + adds r1, r5, 0x4 + adds r0, r7, 0x4 + bl sub_8122BF0 + lsls r0, 24 + cmp r0, 0 + beq _08122C40 + lsls r0, r4, 16 + asrs r0, 16 + b _08122C56 +_08122C40: + adds r5, 0x8 + lsls r0, r4, 16 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, r6 + blt _08122C2C +_08122C52: + movs r0, 0x1 + negs r0, r0 +_08122C56: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8122C1C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/diploma.s b/asm/diploma.s new file mode 100644 index 000000000..4c728416a --- /dev/null +++ b/asm/diploma.s @@ -0,0 +1,387 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8177874 +sub_8177874: @ 8177874 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8177874 + + thumb_func_start sub_8177888 +sub_8177888: @ 8177888 + push {r4,r5,lr} + sub sp, 0xC + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0xE + movs r1, 0 + bl SetGpuReg + movs r0, 0xC + movs r1, 0 + bl SetGpuReg + movs r0, 0xA + movs r1, 0 + bl SetGpuReg + movs r0, 0x8 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1C + movs r1, 0 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0 + bl SetGpuReg + movs r0, 0x18 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + movs r0, 0x16 + movs r1, 0 + bl SetGpuReg + movs r0, 0x10 + movs r1, 0 + bl SetGpuReg + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + add r1, sp, 0x4 + movs r0, 0 + strh r0, [r1] + ldr r1, =0x040000d4 + add r0, sp, 0x4 + str r0, [r1] + movs r0, 0xC0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, =0x8100c000 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r5, 0 + str r5, [sp, 0x8] + add r0, sp, 0x8 + str r0, [r1] + movs r0, 0xE0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, =0x85000100 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + add r0, sp, 0x4 + strh r5, [r0] + str r0, [r1] + movs r0, 0xA0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, =0x81000200 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + bl remove_some_task + bl ResetTasks + bl ResetAllObjectData + bl sub_80A1A74 + bl ResetObjectPaletteAllocator + ldr r0, =gUnknown_085E7088 + movs r1, 0 + movs r2, 0x40 + bl gpu_pal_apply + ldr r4, =0x0203bcf0 + movs r0, 0x80 + lsls r0, 5 + bl Alloc + str r0, [r4] + bl sub_8177B44 + bl sub_8177B9C + bl reset_temp_tile_data_buffers + ldr r1, =gUnknown_085E7804 + str r5, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram +_0817797C: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0817797C + ldr r0, =gUnknown_085E70C8 + ldr r1, =0x0203bcf0 + ldr r1, [r1] + bl LZDecompressWram + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + bl pokedex_diploma_something + movs r4, 0x1 + negs r4, r4 + adds r0, r4, 0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + str r5, [sp] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r0, 0x1 + bl EnableInterrupts + ldr r0, =sub_8177874 + bl SetVBlankCallback + ldr r0, =sub_8177A08 + bl SetMainCallback2 + ldr r0, =sub_8177A20 + movs r1, 0 + bl CreateTask + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8177888 + + thumb_func_start sub_8177A08 +sub_8177A08: @ 8177A08 + push {lr} + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_8177A08 + + thumb_func_start sub_8177A20 +sub_8177A20: @ 8177A20 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08177A40 + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8177A50 + str r0, [r1] +_08177A40: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8177A20 + + thumb_func_start sub_8177A50 +sub_8177A50: @ 8177A50 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08177A82 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8177A98 + str r1, [r0] +_08177A82: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8177A50 + + thumb_func_start sub_8177A98 +sub_8177A98: @ 8177A98 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08177AC2 + ldr r0, =0x0203bcf0 + ldr r0, [r0] + bl Free + bl FreeAllWindowBuffers + adds r0, r4, 0 + bl DestroyTask + ldr r0, =sub_80861E8 + bl SetMainCallback2 +_08177AC2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8177A98 + + thumb_func_start pokedex_diploma_something +pokedex_diploma_something: @ 8177AD4 + push {r4,lr} + bl sub_80C0944 + lsls r0, 16 + cmp r0, 0 + beq _08177AFC + movs r1, 0x80 + lsls r1, 1 + movs r0, 0x14 + bl SetGpuReg + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EE855 + bl CopyString + b _08177B0C + .pool +_08177AFC: + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EE84F + bl CopyString +_08177B0C: + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EE85E + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x1 + bl sub_8177BCC + movs r0, 0 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokedex_diploma_something + + thumb_func_start sub_8177B44 +sub_8177B44: @ 8177B44 + push {lr} + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085E81FC + movs r0, 0 + movs r2, 0x2 + bl InitBgsFromTemplates + ldr r0, =0x0203bcf0 + ldr r1, [r0] + movs r0, 0x1 + bl SetBgTilemapBuffer + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end sub_8177B44 + + thumb_func_start sub_8177B9C +sub_8177B9C: @ 8177B9C + push {lr} + ldr r0, =gUnknown_085E8204 + bl InitWindows + bl DeactivateAllTextPrinters + ldr r0, =gUnknown_0860F074 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0 + bl PutWindowTilemap + pop {r0} + bx r0 + .pool + thumb_func_end sub_8177B9C + + thumb_func_start sub_8177BCC +sub_8177BCC: @ 8177BCC + push {r4-r6,lr} + sub sp, 0x18 + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =gUnknown_085E8214 + add r0, sp, 0x14 + movs r2, 0x3 + bl memcpy + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + add r0, sp, 0x14 + str r0, [sp, 0x8] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0xC] + str r6, [sp, 0x10] + movs r0, 0 + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r5, 0 + bl AddTextPrinterParametrized2 + add sp, 0x18 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8177BCC + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/dma3_manager.s b/asm/dma3_manager.s index 5ab41b675..1c6beda2f 100644 --- a/asm/dma3_manager.s +++ b/asm/dma3_manager.s @@ -1,5 +1,5 @@ .include "asm/macros.inc" - .include "constants/gba_constants.inc" + .include "constants/constants.inc" .syntax unified diff --git a/asm/easy_chat.s b/asm/easy_chat.s new file mode 100644 index 000000000..5abcc25f8 --- /dev/null +++ b/asm/easy_chat.s @@ -0,0 +1,11183 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_811A20C +sub_811A20C: @ 811A20C + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + adds r6, r0, 0 + mov r8, r1 + mov r9, r2 + adds r5, r3, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r5, 24 + lsrs r5, 24 + bl ResetTasks + ldr r0, =sub_811A2C0 + movs r1, 0 + bl CreateTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0xA] + strh r5, [r0, 0x16] + adds r0, r4, 0 + movs r1, 0x2 + mov r2, r8 + bl SetWordTaskArg + adds r0, r4, 0 + movs r1, 0x4 + mov r2, r9 + bl SetWordTaskArg + ldr r0, =sub_811A278 + bl SetMainCallback2 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811A20C + + thumb_func_start sub_811A278 +sub_811A278: @ 811A278 + push {lr} + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_811A278 + + thumb_func_start sub_811A290 +sub_811A290: @ 811A290 + push {lr} + bl copy_pal_bg_faded_to_pal_ram + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + pop {r0} + bx r0 + thumb_func_end sub_811A290 + + thumb_func_start sub_811A2A4 +sub_811A2A4: @ 811A2A4 + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x03005e00 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r3 + str r1, [r2] + movs r0, 0 + strh r0, [r2, 0x8] + bx lr + .pool + thumb_func_end sub_811A2A4 + + thumb_func_start sub_811A2C0 +sub_811A2C0: @ 811A2C0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl is_c1_link_related_active + cmp r0, 0 + bne _0811A2DC +_0811A2CE: + adds r0, r4, 0 + bl sub_811A428 + lsls r0, 24 + cmp r0, 0 + bne _0811A2CE + b _0811A2EA +_0811A2DC: + adds r0, r4, 0 + bl sub_811A428 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0811A2F2 +_0811A2EA: + ldr r1, =sub_811A2FC + adds r0, r4, 0 + bl sub_811A2A4 +_0811A2F2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811A2C0 + + thumb_func_start sub_811A2FC +sub_811A2FC: @ 811A2FC + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x5 + bls _0811A318 + b _0811A41C +_0811A318: + lsls r0, 2 + ldr r1, =_0811A32C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0811A32C: + .4byte _0811A344 + .4byte _0811A370 + .4byte _0811A3CC + .4byte _0811A3D4 + .4byte _0811A3EC + .4byte _0811A40C +_0811A344: + ldr r0, =sub_811A290 + bl SetVBlankCallback + movs r4, 0x1 + negs r4, r4 + adds r0, r4, 0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r0, 0x5 + b _0811A41A + .pool +_0811A370: + bl sub_811AAAC + lsls r0, 16 + lsrs r4, r0, 16 + adds r6, r4, 0 + adds r0, r4, 0 + bl sub_811A88C + cmp r0, 0 + beq _0811A39E + movs r0, 0x1 + negs r0, r0 + movs r1, 0x2 + negs r1, r1 + movs r2, 0 + str r2, [sp] + movs r3, 0x10 + bl pal_fade_maybe + movs r0, 0x3 + strh r0, [r5] + strh r4, [r5, 0xC] + b _0811A41C +_0811A39E: + cmp r4, 0x18 + bne _0811A3B6 + movs r1, 0x1 + negs r1, r1 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + movs r0, 0x4 + b _0811A41A +_0811A3B6: + cmp r6, 0 + beq _0811A41C + movs r0, 0x5 + bl audio_play + adds r0, r6, 0 + bl sub_811C158 + ldrh r0, [r5] + adds r0, 0x1 + b _0811A41A +_0811A3CC: + bl sub_811C170 + lsls r0, 24 + b _0811A414 +_0811A3D4: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0811A41C + ldrh r0, [r5, 0xC] + bl sub_811A8A4 + b _0811A41C + .pool +_0811A3EC: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0811A41C + adds r0, r2, 0 + movs r1, 0x4 + bl GetWordTaskArg + bl sub_811A4D0 + b _0811A41C + .pool +_0811A40C: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 +_0811A414: + cmp r0, 0 + bne _0811A41C + movs r0, 0x1 +_0811A41A: + strh r0, [r5] +_0811A41C: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811A2FC + + thumb_func_start sub_811A428 +sub_811A428: @ 811A428 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r6, r0, r1 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0x4 + bhi _0811A4BC + lsls r0, 2 + ldr r1, =_0811A454 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0811A454: + .4byte _0811A468 + .4byte _0811A47C + .4byte _0811A482 + .4byte _0811A498 + .4byte _0811A4B0 +_0811A468: + movs r0, 0 + bl SetVBlankCallback + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + bl sub_80A1A74 + b _0811A4C0 +_0811A47C: + bl sub_811F28C + b _0811A49C +_0811A482: + ldrb r4, [r6, 0x2] + adds r0, r5, 0 + movs r1, 0x2 + bl GetWordTaskArg + adds r1, r0, 0 + ldrb r2, [r6, 0xE] + adds r0, r4, 0 + bl sub_811A95C + b _0811A49C +_0811A498: + bl sub_811BF8C +_0811A49C: + lsls r0, 24 + cmp r0, 0 + bne _0811A4C0 + adds r0, r5, 0 + movs r1, 0x4 + bl GetWordTaskArg + bl sub_811A4D0 + b _0811A4C0 +_0811A4B0: + bl sub_811BFA4 + lsls r0, 24 + cmp r0, 0 + beq _0811A4C0 + b _0811A4C6 +_0811A4BC: + movs r0, 0 + b _0811A4C8 +_0811A4C0: + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] +_0811A4C6: + movs r0, 0x1 +_0811A4C8: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_811A428 + + thumb_func_start sub_811A4D0 +sub_811A4D0: @ 811A4D0 + push {r4,lr} + adds r4, r0, 0 + bl sub_811C13C + bl sub_811AA90 + bl sub_811F2B8 + bl FreeAllWindowBuffers + adds r0, r4, 0 + bl SetMainCallback2 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811A4D0 + + thumb_func_start easy_chat_input_maybe +easy_chat_input_maybe: @ 811A4F0 + push {r4,r5,lr} + movs r5, 0x3 + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0x14 + bls _0811A4FE + b _0811A7D4 +_0811A4FE: + lsls r0, 2 + ldr r1, =_0811A510 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0811A510: + .4byte _0811A564 + .4byte _0811A578 + .4byte _0811A58C + .4byte _0811A5A0 + .4byte _0811A5B4 + .4byte _0811A604 + .4byte _0811A5D8 + .4byte _0811A630 + .4byte _0811A664 + .4byte _0811A688 + .4byte _0811A6B4 + .4byte _0811A6D4 + .4byte _0811A708 + .4byte _0811A72C + .4byte _0811A73C + .4byte _0811A770 + .4byte _0811A7D4 + .4byte _0811A784 + .4byte _0811A798 + .4byte _0811A7AC + .4byte _0811A7BC +_0811A564: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002bb0 + adds r4, r0, r1 + b _0811A7C2 + .pool +_0811A578: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00002bbc + adds r4, r0, r2 + b _0811A7C2 + .pool +_0811A58C: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r3, =0x00002bc8 + adds r4, r0, r3 + b _0811A7C2 + .pool +_0811A5A0: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002bd4 + adds r4, r0, r1 + b _0811A7C2 + .pool +_0811A5B4: + ldr r2, =0x03005d8c + ldr r0, =0x020375e2 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r3, =0x00002be0 + adds r0, r3 + ldr r1, [r2] + adds r4, r1, r0 + b _0811A7C2 + .pool +_0811A5D8: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00002e36 + adds r1, r0, r2 + ldr r3, =0x00002e2a + adds r2, r0, r3 + movs r3, 0x5 +_0811A5E6: + ldrh r0, [r2] + strh r0, [r2, 0xC] + adds r2, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _0811A5E6 + adds r4, r1, 0 + b _0811A7C2 + .pool +_0811A604: + ldr r2, =0x03005d8c + ldr r0, =0x020375e2 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r0, r1 + ldr r1, =0x000027d0 + adds r4, r0, r1 + ldr r0, =0x020375e4 + ldrb r5, [r0] + b _0811A7C2 + .pool +_0811A630: + ldr r2, =0x03005d8c + ldr r0, =0x020375e2 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r3, =0x000027cc + adds r0, r3 + ldr r1, [r2] + adds r1, r0 + ldr r0, =0x020375e4 + ldrh r0, [r0] + lsls r0, 1 + adds r0, 0x1C + adds r4, r1, r0 + movs r5, 0x1 + b _0811A7C2 + .pool +_0811A664: + ldr r2, =0x03005d8c + ldr r0, =0x020375e2 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r0, r1 + ldr r1, =0x000027ce + adds r4, r0, r1 + movs r5, 0 + b _0811A7C2 + .pool +_0811A688: + ldr r4, =0x02021ec4 + ldr r1, =0x03005d8c + ldr r0, [r1] + ldr r2, =0x00002e6c + adds r0, r2 + ldrh r0, [r0] + strh r0, [r4] + ldr r0, [r1] + ldr r3, =0x00002e6e + adds r0, r3 + ldrh r0, [r0] + strh r0, [r4, 0x2] + b _0811A7C2 + .pool +_0811A6B4: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002baa + adds r4, r0, r1 + ldr r2, =0x0000ffff + adds r0, r2, 0 + strh r0, [r4] + movs r5, 0x1 + b _0811A7C2 + .pool +_0811A6D4: + ldr r2, =0x03005d8c + ldr r0, =0x020375e2 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r3, =0x000027cc + adds r0, r3 + ldr r1, [r2] + adds r1, r0 + ldr r0, =0x020375e4 + ldrh r0, [r0] + lsls r0, 1 + adds r0, 0x4 + adds r4, r1, r0 + movs r5, 0 + b _0811A7C2 + .pool +_0811A708: + ldr r2, =0x03005d8c + ldr r0, =0x020375e2 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r0, r1 + ldr r1, =0x000027e4 + adds r4, r0, r1 + movs r5, 0x1 + b _0811A7C2 + .pool +_0811A72C: + ldr r4, =0x02021ec4 + adds r0, r4, 0 + movs r1, 0x2 + bl sub_811F88C + b _0811A7C2 + .pool +_0811A73C: + ldr r2, =0x03005d8c + ldr r0, =0x020375e2 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r3, =0x000027cc + adds r0, r3 + ldr r1, [r2] + adds r1, r0 + adds r4, r1, 0 + adds r4, 0x14 + ldr r2, =0x0000ffff + adds r0, r2, 0 + strh r0, [r1, 0x14] + movs r5, 0x2 + b _0811A7C2 + .pool +_0811A770: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r3, =0x00003b6e + adds r4, r0, r3 + b _0811A7C2 + .pool +_0811A784: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003b5a + adds r4, r0, r1 + b _0811A7C2 + .pool +_0811A798: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00003b6c + adds r4, r0, r2 + b _0811A7C2 + .pool +_0811A7AC: + ldr r0, =0x03005d90 + ldr r0, [r0] + movs r3, 0x82 + lsls r3, 1 + adds r4, r0, r3 + b _0811A7C2 + .pool +_0811A7BC: + bl sub_801B058 + adds r4, r0, 0 +_0811A7C2: + bl overworld_free_bg_tilemaps + ldr r0, =0x020375e0 + ldrb r0, [r0] + ldr r2, =sub_80861B0 + adds r1, r4, 0 + adds r3, r5, 0 + bl sub_811A20C +_0811A7D4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end easy_chat_input_maybe + + thumb_func_start sub_811A7E4 +sub_811A7E4: @ 811A7E4 + push {lr} + bl fade_and_return_progress_probably + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0811A804 + cmp r0, 0x1 + beq _0811A80E + b _0811A840 + .pool +_0811A804: + movs r0, 0x1 + movs r1, 0 + bl fade_screen + b _0811A840 +_0811A80E: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0811A84E + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + ldr r1, =0x0000ffff + strh r1, [r0, 0x16] + bl overworld_free_bg_tilemaps + bl sub_811A8F0 + b _0811A84E + .pool +_0811A840: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0811A84E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_811A7E4 + + thumb_func_start sub_811A858 +sub_811A858: @ 811A858 + push {lr} + ldr r0, =sub_811A7E4 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_811A858 + + thumb_func_start sub_811A868 +sub_811A868: @ 811A868 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + movs r0, 0 + ldr r1, =gUnknown_08597530 +_0811A872: + ldrh r3, [r1] + cmp r2, r3 + beq _0811A884 + adds r1, 0x8 + adds r0, 0x1 + cmp r0, 0x3 + bls _0811A872 + movs r0, 0x1 + negs r0, r0 +_0811A884: + pop {r1} + bx r1 + .pool + thumb_func_end sub_811A868 + + thumb_func_start sub_811A88C +sub_811A88C: @ 811A88C + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_811A868 + adds r1, r0, 0 + mvns r1, r1 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + pop {r1} + bx r1 + thumb_func_end sub_811A88C + + thumb_func_start sub_811A8A4 +sub_811A8A4: @ 811A8A4 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_811A868 + adds r4, r0, 0 + bl ResetTasks + ldr r0, =gUnknown_08597530 + lsls r4, 3 + adds r0, 0x4 + adds r4, r0 + ldr r0, [r4] + bl sub_811A4D0 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811A8A4 + + thumb_func_start sub_811A8CC +sub_811A8CC: @ 811A8CC + push {lr} + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x00003b6e + adds r1, r0 + ldr r2, =sub_80861B0 + movs r0, 0xF + movs r3, 0x3 + bl sub_811A20C + pop {r0} + bx r0 + .pool + thumb_func_end sub_811A8CC + + thumb_func_start sub_811A8F0 +sub_811A8F0: @ 811A8F0 + push {lr} + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x00003b5a + adds r1, r0 + ldr r2, =sub_80861B0 + movs r0, 0x10 + movs r3, 0x3 + bl sub_811A20C + pop {r0} + bx r0 + .pool + thumb_func_end sub_811A8F0 + + thumb_func_start sub_811A914 +sub_811A914: @ 811A914 + push {lr} + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x00003b6c + adds r1, r0 + ldr r2, =sub_80861B0 + movs r0, 0x12 + movs r3, 0x3 + bl sub_811A20C + pop {r0} + bx r0 + .pool + thumb_func_end sub_811A914 + + thumb_func_start sub_811A938 +sub_811A938: @ 811A938 + push {lr} + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x00003b5a + adds r1, r0 + ldr r2, =sub_80861B0 + movs r0, 0x11 + movs r3, 0x3 + bl sub_811A20C + pop {r0} + bx r0 + .pool + thumb_func_end sub_811A938 + + thumb_func_start sub_811A95C +sub_811A95C: @ 811A95C + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r1 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r4, =0x0203a118 + movs r0, 0x50 + bl Alloc + str r0, [r4] + cmp r0, 0 + bne _0811A984 + movs r0, 0 + b _0811AA7E + .pool +_0811A984: + movs r7, 0 + strb r5, [r0] + ldr r0, [r4] + mov r1, r8 + str r1, [r0, 0x38] + strb r7, [r0, 0x5] + ldr r0, [r4] + strb r7, [r0, 0x6] + ldr r0, [r4] + strb r7, [r0, 0x9] + ldr r0, [r4] + strb r6, [r0, 0x12] + ldr r0, [r4] + strb r7, [r0, 0x13] + adds r0, r5, 0 + bl sub_811BCC8 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r5, 0x10 + bne _0811A9C6 + ldr r0, [r4] + adds r0, 0x14 + bl sub_811BDF0 + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0x14 + str r1, [r0, 0x34] + movs r1, 0x7 + strb r1, [r0, 0x4] + lsls r0, r6, 1 + b _0811A9DE +_0811A9C6: + ldr r0, [r4] + strb r7, [r0, 0x4] + ldr r3, [r4] + ldr r1, =gUnknown_08597550 + lsls r2, r6, 1 + adds r0, r2, r6 + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + str r0, [r3, 0x34] + adds r0, r2, 0 +_0811A9DE: + ldr r3, =0x0203a118 + ldr r2, [r3] + ldr r1, =gUnknown_08597550 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x1] + strb r1, [r2, 0x2] + ldr r1, [r3] + ldrb r0, [r0, 0x2] + strb r0, [r1, 0x3] + ldr r0, [r3] + ldrb r2, [r0, 0x2] + ldrb r1, [r0, 0x3] + adds r4, r2, 0 + muls r4, r1 + adds r1, r4, 0 + strb r1, [r0, 0x7] + ldr r0, [r3] + strb r6, [r0, 0x1] + ldr r1, [r3] + ldrb r0, [r1, 0x7] + adds r4, r3, 0 + cmp r0, 0x9 + bls _0811AA14 + movs r0, 0x9 + strb r0, [r1, 0x7] +_0811AA14: + mov r0, r8 + cmp r0, 0 + beq _0811AA34 + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0x3C + ldrb r2, [r0, 0x7] + mov r0, r8 + bl CpuSet + b _0811AA64 + .pool +_0811AA34: + movs r3, 0 + ldr r0, [r4] + ldrb r0, [r0, 0x7] + cmp r3, r0 + bge _0811AA5C + adds r6, r4, 0 + ldr r1, =0x0000ffff + adds r5, r1, 0 +_0811AA44: + ldr r2, [r6] + lsls r0, r3, 1 + adds r1, r2, 0 + adds r1, 0x3C + adds r1, r0 + ldrh r0, [r1] + orrs r0, r5 + strh r0, [r1] + adds r3, 0x1 + ldrb r2, [r2, 0x7] + cmp r3, r2 + blt _0811AA44 +_0811AA5C: + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x3C + str r0, [r1, 0x38] +_0811AA64: + bl sub_811F3AC + ldr r1, =0x0203a118 + ldr r2, [r1] + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r0, 0x1 + strb r0, [r2, 0xD] + movs r0, 0x1 +_0811AA7E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_811A95C + + thumb_func_start sub_811AA90 +sub_811AA90: @ 811AA90 + push {r4,lr} + ldr r4, =0x0203a118 + ldr r0, [r4] + cmp r0, 0 + beq _0811AAA2 + bl Free + movs r0, 0 + str r0, [r4] +_0811AAA2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811AA90 + + thumb_func_start sub_811AAAC +sub_811AAAC: @ 811AAAC + push {lr} + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0xA + bhi _0811AB3E + lsls r0, 2 + ldr r1, =_0811AACC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0811AACC: + .4byte _0811AAF8 + .4byte _0811AAFE + .4byte _0811AB04 + .4byte _0811AB0A + .4byte _0811AB10 + .4byte _0811AB16 + .4byte _0811AB1C + .4byte _0811AB22 + .4byte _0811AB28 + .4byte _0811AB2E + .4byte _0811AB34 +_0811AAF8: + bl sub_811AB68 + b _0811AB38 +_0811AAFE: + bl sub_811ACDC + b _0811AB38 +_0811AB04: + bl sub_811AE44 + b _0811AB38 +_0811AB0A: + bl sub_811AF00 + b _0811AB38 +_0811AB10: + bl sub_811AF8C + b _0811AB38 +_0811AB16: + bl sub_811B040 + b _0811AB38 +_0811AB1C: + bl sub_811AFEC + b _0811AB38 +_0811AB22: + bl sub_811B08C + b _0811AB38 +_0811AB28: + bl sub_811B0BC + b _0811AB38 +_0811AB2E: + bl sub_811B0E8 + b _0811AB38 +_0811AB34: + bl sub_811B0F8 +_0811AB38: + lsls r0, 16 + lsrs r0, 16 + b _0811AB40 +_0811AB3E: + movs r0, 0 +_0811AB40: + pop {r1} + bx r1 + thumb_func_end sub_811AAAC + + thumb_func_start sub_811AB44 +sub_811AB44: @ 811AB44 + push {lr} + bl sub_811BA68 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _0811AB5E + cmp r0, 0x2 + blt _0811AB62 + cmp r0, 0x8 + bgt _0811AB62 + cmp r0, 0x7 + blt _0811AB62 +_0811AB5E: + movs r0, 0x1 + b _0811AB64 +_0811AB62: + movs r0, 0 +_0811AB64: + pop {r1} + bx r1 + thumb_func_end sub_811AB44 + + thumb_func_start sub_811AB68 +sub_811AB68: @ 811AB68 + push {r4-r7,lr} + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0811ABB8 + bl sub_811BF78 + ldr r1, =0x0203a118 + ldr r3, [r1] + movs r2, 0 + movs r0, 0x2 + strb r0, [r3, 0x4] + ldr r0, [r1] + strb r2, [r0, 0xA] + ldr r0, [r1] + strb r2, [r0, 0xB] + ldr r0, [r1] + strb r2, [r0, 0xC] + movs r0, 0x9 + b _0811ACCC + .pool +_0811AB9C: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0811AC68 + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0811AC58 + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0811AC48 + movs r0, 0 + b _0811ACCC +_0811ABB8: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0811AC78 + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0811AC7E + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0811AB9C + ldr r2, =0x0203a118 + ldr r1, [r2] + ldrb r0, [r1, 0x6] + subs r0, 0x1 +_0811ABD8: + strb r0, [r1, 0x6] +_0811ABDA: + adds r7, r2, 0 + adds r4, r7, 0 + ldr r2, [r4] + movs r0, 0x6 + ldrsb r0, [r2, r0] + ldr r6, =gUnknown_08597550 + cmp r0, 0 + bge _0811ABF8 + ldrb r0, [r2, 0x1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r6 + ldrb r0, [r1, 0x2] + strb r0, [r2, 0x6] +_0811ABF8: + ldr r3, [r4] + movs r2, 0x6 + ldrsb r2, [r3, r2] + adds r5, r6, 0 + ldrb r1, [r3, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + ldrb r0, [r0, 0x2] + cmp r2, r0 + ble _0811AC14 + movs r0, 0 + strb r0, [r3, 0x6] +_0811AC14: + ldr r3, [r4] + movs r2, 0x6 + ldrsb r2, [r3, r2] + ldrb r1, [r3, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r1, r0, r5 + ldrb r0, [r1, 0x2] + cmp r2, r0 + bne _0811AC88 + movs r0, 0x5 + ldrsb r0, [r3, r0] + cmp r0, 0x2 + ble _0811AC36 + movs r0, 0x2 + strb r0, [r3, 0x5] +_0811AC36: + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x4] + movs r0, 0x3 + b _0811ACCC + .pool +_0811AC48: + ldr r2, =0x0203a118 + ldr r1, [r2] + ldrb r0, [r1, 0x5] + adds r0, 0x1 + strb r0, [r1, 0x5] + b _0811ABDA + .pool +_0811AC58: + ldr r2, =0x0203a118 + ldr r1, [r2] + ldrb r0, [r1, 0x6] + adds r0, 0x1 + b _0811ABD8 + .pool +_0811AC68: + ldr r2, =0x0203a118 + ldr r1, [r2] + ldrb r0, [r1, 0x5] + subs r0, 0x1 + strb r0, [r1, 0x5] + b _0811ABDA + .pool +_0811AC78: + bl sub_811B150 + b _0811AC82 +_0811AC7E: + bl sub_811B1B4 +_0811AC82: + lsls r0, 16 + lsrs r0, 16 + b _0811ACCC +_0811AC88: + movs r0, 0x5 + ldrsb r0, [r3, r0] + cmp r0, 0 + bge _0811AC96 + ldrb r0, [r1, 0x1] + subs r0, 0x1 + strb r0, [r3, 0x5] +_0811AC96: + ldr r3, [r4] + movs r2, 0x5 + ldrsb r2, [r3, r2] + ldrb r1, [r3, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + ldrb r0, [r0, 0x1] + cmp r2, r0 + blt _0811ACB0 + movs r0, 0 + strb r0, [r3, 0x5] +_0811ACB0: + bl sub_811AB44 + cmp r0, 0 + beq _0811ACCA + ldr r2, [r7] + ldr r0, [r2, 0x4] + ldr r1, =0x00ffff00 + ands r0, r1 + ldr r1, =0x00040100 + cmp r0, r1 + bne _0811ACCA + movs r0, 0 + strb r0, [r2, 0x5] +_0811ACCA: + movs r0, 0x2 +_0811ACCC: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_811AB68 + + thumb_func_start sub_811ACDC +sub_811ACDC: @ 811ACDC + push {r4-r6,lr} + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0811AD4A + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r0, [r0, 0x5] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + beq _0811AD3E + b _0811AD24 + .pool +_0811AD04: + movs r0, 0x20 + ands r0, r2 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0 + bne _0811ADE0 + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + bne _0811ADD0 + movs r0, 0x10 + ands r0, r2 + cmp r0, 0 + bne _0811ADC0 + movs r0, 0 + b _0811AE32 +_0811AD24: + cmp r0, 0x1 + bgt _0811AD2E + cmp r0, 0 + beq _0811AD38 + b _0811AD4A +_0811AD2E: + cmp r0, 0x2 + beq _0811ADF6 + cmp r0, 0x3 + beq _0811AD44 + b _0811AD4A +_0811AD38: + bl sub_811B184 + b _0811ADFA +_0811AD3E: + bl sub_811B150 + b _0811ADFA +_0811AD44: + bl sub_811B264 + b _0811ADFA +_0811AD4A: + ldrh r2, [r2, 0x2E] + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + bne _0811ADF0 + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + bne _0811ADF6 + movs r0, 0x40 + ands r0, r2 + cmp r0, 0 + beq _0811AD04 + ldr r2, =0x0203a118 + ldr r1, [r2] + ldrb r0, [r1, 0x6] + subs r0, 0x1 + strb r0, [r1, 0x6] +_0811AD6E: + adds r6, r2, 0 +_0811AD70: + adds r5, r6, 0 + ldr r4, [r5] + movs r3, 0x6 + ldrsb r3, [r4, r3] + ldr r2, =gUnknown_08597550 + ldrb r1, [r4, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r1, r0, r2 + ldrb r0, [r1, 0x2] + cmp r3, r0 + bne _0811AE00 + bl sub_811BA3C + movs r2, 0x3 + cmp r0, 0 + beq _0811AD96 + movs r2, 0x4 +_0811AD96: + ldr r1, [r5] + movs r0, 0x5 + ldrsb r0, [r1, r0] + cmp r0, 0 + bge _0811ADA4 + subs r0, r2, 0x1 + strb r0, [r1, 0x5] +_0811ADA4: + ldr r1, [r5] + movs r0, 0x5 + ldrsb r0, [r1, r0] + cmp r0, r2 + blt _0811ADB2 + movs r0, 0 + strb r0, [r1, 0x5] +_0811ADB2: + movs r0, 0x3 + b _0811AE32 + .pool +_0811ADC0: + ldr r2, =0x0203a118 + ldr r1, [r2] + ldrb r0, [r1, 0x5] + adds r0, 0x1 + strb r0, [r1, 0x5] + b _0811AD6E + .pool +_0811ADD0: + ldr r1, =0x0203a118 + ldr r0, [r1] + strb r3, [r0, 0x6] + adds r6, r1, 0 + b _0811AD70 + .pool +_0811ADE0: + ldr r2, =0x0203a118 + ldr r1, [r2] + ldrb r0, [r1, 0x5] + subs r0, 0x1 + strb r0, [r1, 0x5] + b _0811AD6E + .pool +_0811ADF0: + bl sub_811B150 + b _0811ADFA +_0811ADF6: + bl sub_811B1B4 +_0811ADFA: + lsls r0, 16 + lsrs r0, 16 + b _0811AE32 +_0811AE00: + movs r0, 0x5 + ldrsb r0, [r4, r0] + ldrb r1, [r1, 0x1] + cmp r0, r1 + blt _0811AE0E + subs r0, r1, 0x1 + strb r0, [r4, 0x5] +_0811AE0E: + bl sub_811AB44 + cmp r0, 0 + beq _0811AE28 + ldr r2, [r6] + ldr r0, [r2, 0x4] + ldr r1, =0x00ffff00 + ands r0, r1 + ldr r1, =0x00040100 + cmp r0, r1 + bne _0811AE28 + movs r0, 0 + strb r0, [r2, 0x5] +_0811AE28: + ldr r0, =0x0203a118 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x4] + movs r0, 0x2 +_0811AE32: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_811ACDC + + thumb_func_start sub_811AE44 +sub_811AE44: @ 811AE44 + push {lr} + ldr r1, =0x030022c0 + ldrh r2, [r1, 0x2E] + movs r0, 0x2 + ands r0, r2 + adds r3, r1, 0 + cmp r0, 0 + beq _0811AE60 + bl sub_811B32C + b _0811AEF6 + .pool +_0811AE60: + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _0811AEAE + ldr r0, =0x0203a118 + ldr r2, [r0] + movs r1, 0xA + ldrsb r1, [r2, r1] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0811AE84 + bl sub_811B2B0 + b _0811AEF6 + .pool +_0811AE84: + movs r0, 0xB + ldrsb r0, [r2, r0] + cmp r0, 0x1 + beq _0811AEA2 + cmp r0, 0x1 + bgt _0811AE96 + cmp r0, 0 + beq _0811AE9C + b _0811AEAE +_0811AE96: + cmp r0, 0x2 + beq _0811AEA8 + b _0811AEAE +_0811AE9C: + bl sub_811B33C + b _0811AEF6 +_0811AEA2: + bl sub_811B368 + b _0811AEF6 +_0811AEA8: + bl sub_811B32C + b _0811AEF6 +_0811AEAE: + ldrh r1, [r3, 0x2E] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0811AEBE + bl sub_811B33C + b _0811AEF6 +_0811AEBE: + ldrh r1, [r3, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0811AECC + movs r0, 0x2 + b _0811AEF2 +_0811AECC: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0811AED8 + movs r0, 0x3 + b _0811AEF2 +_0811AED8: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0811AEE4 + movs r0, 0x1 + b _0811AEF2 +_0811AEE4: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0811AEF0 + movs r0, 0 + b _0811AEFA +_0811AEF0: + movs r0, 0 +_0811AEF2: + bl sub_811B528 +_0811AEF6: + lsls r0, 16 + lsrs r0, 16 +_0811AEFA: + pop {r1} + bx r1 + thumb_func_end sub_811AE44 + + thumb_func_start sub_811AF00 +sub_811AF00: @ 811AF00 + push {lr} + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0811AF24 + ldr r0, =0x0203a118 + ldr r1, [r0] + movs r0, 0x2 + strb r0, [r1, 0x4] + movs r0, 0xE + b _0811AF86 + .pool +_0811AF24: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0811AF32 + bl sub_811B394 + b _0811AF82 +_0811AF32: + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0811AF3E + movs r0, 0x4 + b _0811AF7E +_0811AF3E: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0811AF4A + movs r0, 0x5 + b _0811AF7E +_0811AF4A: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0811AF58 + movs r0, 0x2 + b _0811AF7E +_0811AF58: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0811AF64 + movs r0, 0x3 + b _0811AF7E +_0811AF64: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0811AF70 + movs r0, 0x1 + b _0811AF7E +_0811AF70: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0811AF7C + movs r0, 0 + b _0811AF86 +_0811AF7C: + movs r0, 0 +_0811AF7E: + bl sub_811B794 +_0811AF82: + lsls r0, 16 + lsrs r0, 16 +_0811AF86: + pop {r1} + bx r1 + thumb_func_end sub_811AF00 + + thumb_func_start sub_811AF8C +sub_811AF8C: @ 811AF8C + push {lr} + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _0811AFC0 + cmp r1, 0 + bgt _0811AFA8 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0811AFAC + b _0811AFE4 +_0811AFA8: + cmp r1, 0x1 + bne _0811AFE4 +_0811AFAC: + bl sub_811B2A4 + ldr r1, =0x0203a118 + ldr r1, [r1] + strb r0, [r1, 0x4] + movs r0, 0x7 + b _0811AFE6 + .pool +_0811AFC0: + ldr r0, =0x020375f0 + strh r1, [r0] + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r0, [r0] + subs r0, 0x11 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0811AFD8 + bl sub_811B3E4 +_0811AFD8: + movs r0, 0x18 + b _0811AFE6 + .pool +_0811AFE4: + movs r0, 0 +_0811AFE6: + pop {r1} + bx r1 + thumb_func_end sub_811AF8C + + thumb_func_start sub_811AFEC +sub_811AFEC: @ 811AFEC + push {r4,lr} + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _0811B020 + cmp r1, 0 + bgt _0811B008 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0811B00C + b _0811B038 +_0811B008: + cmp r1, 0x1 + bne _0811B038 +_0811B00C: + bl sub_811B2A4 + ldr r1, =0x0203a118 + ldr r1, [r1] + strb r0, [r1, 0x4] + movs r0, 0x7 + b _0811B03A + .pool +_0811B020: + bl sub_811BE9C + ldr r4, =0x020375f0 + bl sub_811B4EC + strh r0, [r4] + bl sub_811B3E4 + movs r0, 0x18 + b _0811B03A + .pool +_0811B038: + movs r0, 0 +_0811B03A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811AFEC + + thumb_func_start sub_811B040 +sub_811B040: @ 811B040 + push {lr} + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _0811B070 + cmp r1, 0 + bgt _0811B05C + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0811B060 + b _0811B084 +_0811B05C: + cmp r1, 0x1 + bne _0811B084 +_0811B060: + ldr r0, =0x0203a118 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x4] + movs r0, 0x7 + b _0811B086 + .pool +_0811B070: + bl sub_811B418 + ldr r0, =0x0203a118 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x4] + movs r0, 0x8 + b _0811B086 + .pool +_0811B084: + movs r0, 0 +_0811B086: + pop {r1} + bx r1 + thumb_func_end sub_811B040 + + thumb_func_start sub_811B08C +sub_811B08C: @ 811B08C + push {lr} + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0811B0A4 + movs r0, 0x1A + b _0811B0B8 + .pool +_0811B0A4: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0811B0B0 + movs r0, 0 + b _0811B0B8 +_0811B0B0: + bl sub_811B150 + lsls r0, 16 + lsrs r0, 16 +_0811B0B8: + pop {r1} + bx r1 + thumb_func_end sub_811B08C + + thumb_func_start sub_811B0BC +sub_811B0BC: @ 811B0BC + push {lr} + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0811B0D4 + movs r0, 0 + b _0811B0E0 + .pool +_0811B0D4: + bl sub_811B2A4 + ldr r1, =0x0203a118 + ldr r1, [r1] + strb r0, [r1, 0x4] + movs r0, 0x7 +_0811B0E0: + pop {r1} + bx r1 + .pool + thumb_func_end sub_811B0BC + + thumb_func_start sub_811B0E8 +sub_811B0E8: @ 811B0E8 + ldr r0, =0x0203a118 + ldr r1, [r0] + movs r0, 0xA + strb r0, [r1, 0x4] + movs r0, 0x6 + bx lr + .pool + thumb_func_end sub_811B0E8 + + thumb_func_start sub_811B0F8 +sub_811B0F8: @ 811B0F8 + push {r4,lr} + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _0811B134 + cmp r1, 0 + bgt _0811B114 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0811B118 + b _0811B148 +_0811B114: + cmp r1, 0x1 + bne _0811B148 +_0811B118: + bl sub_811B454 + ldr r2, =0x0203a118 + ldr r1, [r2] + movs r0, 0 + strb r0, [r1, 0x8] + ldr r1, [r2] + movs r0, 0x8 + strb r0, [r1, 0x4] + movs r0, 0x1F + b _0811B14A + .pool +_0811B134: + ldr r4, =0x020375f0 + bl sub_811B4EC + strh r0, [r4] + bl sub_811B3E4 + movs r0, 0x18 + b _0811B14A + .pool +_0811B148: + movs r0, 0 +_0811B14A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811B0F8 + + thumb_func_start sub_811B150 +sub_811B150: @ 811B150 + push {lr} + ldr r1, =0x0203a118 + ldr r2, [r1] + ldrb r0, [r2] + cmp r0, 0x13 + beq _0811B160 + cmp r0, 0xB + bne _0811B174 +_0811B160: + ldrb r0, [r2, 0x4] + strb r0, [r2, 0x8] + ldr r1, [r1] + movs r0, 0x8 + strb r0, [r1, 0x4] + movs r0, 0x22 + b _0811B180 + .pool +_0811B174: + ldrb r0, [r2, 0x4] + strb r0, [r2, 0x8] + ldr r1, [r1] + movs r0, 0x4 + strb r0, [r1, 0x4] + movs r0, 0x5 +_0811B180: + pop {r1} + bx r1 + thumb_func_end sub_811B150 + + thumb_func_start sub_811B184 +sub_811B184: @ 811B184 + push {lr} + ldr r2, =0x0203a118 + ldr r0, [r2] + ldrb r1, [r0, 0x4] + strb r1, [r0, 0x8] + ldr r1, [r2] + ldrb r0, [r1] + cmp r0, 0x6 + bne _0811B1A8 + ldrb r0, [r1, 0x4] + strb r0, [r1, 0x8] + ldr r1, [r2] + movs r0, 0x8 + strb r0, [r1, 0x4] + movs r0, 0x20 + b _0811B1AE + .pool +_0811B1A8: + movs r0, 0x5 + strb r0, [r1, 0x4] + movs r0, 0x4 +_0811B1AE: + pop {r1} + bx r1 + thumb_func_end sub_811B184 + + thumb_func_start sub_811B1B4 +sub_811B1B4: @ 811B1B4 + push {r4,lr} + ldr r4, =0x0203a118 + ldr r1, [r4] + ldrb r0, [r1, 0x4] + strb r0, [r1, 0x8] + ldr r1, [r4] + ldrb r0, [r1] + cmp r0, 0x11 + bne _0811B1DC + bl sub_811BD64 + cmp r0, 0 + bne _0811B1FA + bl sub_811BDB0 + cmp r0, 0 + bne _0811B1E8 + b _0811B256 + .pool +_0811B1DC: + cmp r0, 0x12 + bne _0811B204 + bl sub_811BDB0 + cmp r0, 0 + beq _0811B1F2 +_0811B1E8: + ldr r1, [r4] + movs r0, 0x8 + strb r0, [r1, 0x4] + movs r0, 0x1E + b _0811B25C +_0811B1F2: + bl sub_811BD64 + cmp r0, 0 + beq _0811B256 +_0811B1FA: + ldr r1, [r4] + movs r0, 0x8 + strb r0, [r1, 0x4] + movs r0, 0x1D + b _0811B25C +_0811B204: + cmp r0, 0x9 + beq _0811B20C + cmp r0, 0xD + bne _0811B21E +_0811B20C: + bl sub_811BD2C + cmp r0, 0 + bne _0811B256 + ldr r1, [r4] + movs r0, 0x8 + strb r0, [r1, 0x4] + movs r0, 0x21 + b _0811B25C +_0811B21E: + cmp r0, 0x13 + beq _0811B226 + cmp r0, 0xB + bne _0811B238 +_0811B226: + bl sub_811BCF4 + cmp r0, 0 + beq _0811B256 + ldr r1, [r4] + movs r0, 0x8 + strb r0, [r1, 0x4] + movs r0, 0x22 + b _0811B25C +_0811B238: + cmp r0, 0x14 + beq _0811B258 + bl sub_811BCF4 + cmp r0, 0x1 + beq _0811B24C + bl sub_811B4EC + cmp r0, 0 + bne _0811B256 +_0811B24C: + ldr r1, [r4] + movs r0, 0x4 + strb r0, [r1, 0x4] + movs r0, 0x5 + b _0811B25C +_0811B256: + ldr r1, [r4] +_0811B258: + movs r0, 0x6 + strb r0, [r1, 0x4] +_0811B25C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811B1B4 + + thumb_func_start sub_811B264 +sub_811B264: @ 811B264 + push {lr} + ldr r2, =0x0203a118 + ldr r1, [r2] + ldrb r0, [r1, 0x4] + strb r0, [r1, 0x8] + ldr r0, [r2] + ldrb r0, [r0] + cmp r0, 0x11 + beq _0811B28E + cmp r0, 0x11 + bgt _0811B284 + cmp r0, 0xF + beq _0811B28A + b _0811B29E + .pool +_0811B284: + cmp r0, 0x12 + beq _0811B296 + b _0811B29E +_0811B28A: + movs r0, 0x19 + b _0811B2A0 +_0811B28E: + bl sub_811B3E4 + movs r0, 0x1C + b _0811B2A0 +_0811B296: + bl sub_811B3E4 + movs r0, 0x1B + b _0811B2A0 +_0811B29E: + movs r0, 0 +_0811B2A0: + pop {r1} + bx r1 + thumb_func_end sub_811B264 + + thumb_func_start sub_811B2A4 +sub_811B2A4: @ 811B2A4 + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + bx lr + .pool + thumb_func_end sub_811B2A4 + + thumb_func_start sub_811B2B0 +sub_811B2B0: @ 811B2B0 + push {lr} + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r0, [r0, 0x9] + cmp r0, 0 + bne _0811B2DC + bl sub_811B8E8 + lsls r0, 24 + lsrs r0, 24 + bl sub_811F3B8 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_811F548 + b _0811B2EC + .pool +_0811B2DC: + bl sub_811B908 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1 + bl sub_811F548 +_0811B2EC: + bl sub_811F5B0 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _0811B324 + ldr r2, =0x0203a118 + ldr r3, [r2] + subs r0, 0x1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + movs r1, 0 + strb r0, [r3, 0xF] + ldr r0, [r2] + strb r1, [r0, 0xE] + ldr r0, [r2] + strb r1, [r0, 0x10] + ldr r0, [r2] + strb r1, [r0, 0x11] + ldr r1, [r2] + movs r0, 0x3 + strb r0, [r1, 0x4] + movs r0, 0xB + b _0811B326 + .pool +_0811B324: + movs r0, 0 +_0811B326: + pop {r1} + bx r1 + thumb_func_end sub_811B2B0 + + thumb_func_start sub_811B32C +sub_811B32C: @ 811B32C + ldr r0, =0x0203a118 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x4] + movs r0, 0xA + bx lr + .pool + thumb_func_end sub_811B32C + + thumb_func_start sub_811B33C +sub_811B33C: @ 811B33C + push {lr} + ldr r1, =0x0203a118 + ldr r0, [r1] + movs r2, 0 + strb r2, [r0, 0xA] + ldr r0, [r1] + strb r2, [r0, 0xB] + ldr r0, [r1] + strb r2, [r0, 0xC] + ldr r1, [r1] + ldrb r0, [r1, 0x9] + cmp r0, 0 + bne _0811B360 + movs r0, 0x1 + strb r0, [r1, 0x9] + b _0811B362 + .pool +_0811B360: + strb r2, [r1, 0x9] +_0811B362: + movs r0, 0x17 + pop {r1} + bx r1 + thumb_func_end sub_811B33C + + thumb_func_start sub_811B368 +sub_811B368: @ 811B368 + push {lr} + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x6 + beq _0811B388 + ldr r0, =0x0000ffff + bl sub_811B488 + movs r0, 0x1 + b _0811B390 + .pool +_0811B388: + movs r0, 0x20 + bl audio_play + movs r0, 0 +_0811B390: + pop {r1} + bx r1 + thumb_func_end sub_811B368 + + thumb_func_start sub_811B394 +sub_811B394: @ 811B394 + push {r4,r5,lr} + bl sub_811B940 + lsls r0, 16 + lsrs r0, 16 + bl sub_811F578 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl sub_811BF88 + adds r5, r0, 0 + cmp r5, 0 + beq _0811B3BC + movs r0, 0x20 + bl audio_play + movs r0, 0 + b _0811B3DC +_0811B3BC: + adds r0, r4, 0 + bl sub_811B488 + ldr r0, =0x0203a118 + ldr r1, [r0] + ldrb r0, [r1] + cmp r0, 0x6 + bne _0811B3D8 + movs r0, 0x9 + strb r0, [r1, 0x4] + movs r0, 0xD + b _0811B3DC + .pool +_0811B3D8: + strb r5, [r1, 0x4] + movs r0, 0xC +_0811B3DC: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_811B394 + + thumb_func_start sub_811B3E4 +sub_811B3E4: @ 811B3E4 + push {r4,r5,lr} + movs r4, 0 + ldr r3, =0x0203a118 + ldr r0, [r3] + ldrb r0, [r0, 0x7] + cmp r4, r0 + bge _0811B40E + adds r5, r3, 0 +_0811B3F4: + ldr r3, [r5] + ldr r1, [r3, 0x38] + lsls r2, r4, 1 + adds r1, r2, r1 + adds r0, r3, 0 + adds r0, 0x3C + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + adds r4, 0x1 + ldrb r3, [r3, 0x7] + cmp r4, r3 + blt _0811B3F4 +_0811B40E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811B3E4 + + thumb_func_start sub_811B418 +sub_811B418: @ 811B418 + push {r4,r5,lr} + movs r3, 0 + ldr r2, =0x0203a118 + ldr r0, [r2] + ldrb r0, [r0, 0x7] + cmp r3, r0 + bge _0811B444 + adds r5, r2, 0 + ldr r0, =0x0000ffff + adds r4, r0, 0 +_0811B42C: + ldr r2, [r5] + lsls r0, r3, 1 + adds r1, r2, 0 + adds r1, 0x3C + adds r1, r0 + ldrh r0, [r1] + orrs r0, r4 + strh r0, [r1] + adds r3, 0x1 + ldrb r2, [r2, 0x7] + cmp r3, r2 + blt _0811B42C +_0811B444: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811B418 + + thumb_func_start sub_811B454 +sub_811B454: @ 811B454 + push {r4,r5,lr} + movs r4, 0 + ldr r3, =0x0203a118 + ldr r0, [r3] + ldrb r0, [r0, 0x7] + cmp r4, r0 + bge _0811B47E + adds r5, r3, 0 +_0811B464: + ldr r3, [r5] + lsls r1, r4, 1 + adds r2, r3, 0 + adds r2, 0x3C + adds r2, r1 + ldr r0, [r3, 0x38] + adds r1, r0 + ldrh r0, [r1] + strh r0, [r2] + adds r4, 0x1 + ldrb r3, [r3, 0x7] + cmp r4, r3 + blt _0811B464 +_0811B47E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811B454 + + thumb_func_start sub_811B488 +sub_811B488: @ 811B488 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_811B8C8 + lsls r0, 16 + ldr r1, =0x0203a118 + ldr r1, [r1] + lsrs r0, 15 + adds r1, 0x3C + adds r1, r0 + strh r4, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811B488 + + thumb_func_start sub_811B4AC +sub_811B4AC: @ 811B4AC + push {r4,r5,lr} + movs r2, 0 + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r1, [r0, 0x7] + cmp r2, r1 + bcs _0811B4E2 + adds r5, r1, 0 + adds r4, r0, 0 + adds r4, 0x3C + ldr r3, [r0, 0x38] +_0811B4C2: + lsls r0, r2, 1 + adds r1, r4, r0 + adds r0, r3 + ldrh r1, [r1] + ldrh r0, [r0] + cmp r1, r0 + beq _0811B4D8 + movs r0, 0x1 + b _0811B4E4 + .pool +_0811B4D8: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, r5 + bcc _0811B4C2 +_0811B4E2: + movs r0, 0 +_0811B4E4: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_811B4AC + + thumb_func_start sub_811B4EC +sub_811B4EC: @ 811B4EC + push {lr} + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r0, [r0] + subs r0, 0x11 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0811B51C + bl sub_811BD64 + cmp r0, 0 + bne _0811B50E + bl sub_811BDB0 + cmp r0, 0 + beq _0811B518 +_0811B50E: + movs r0, 0 + b _0811B524 + .pool +_0811B518: + movs r0, 0x1 + b _0811B524 +_0811B51C: + bl sub_811B4AC + lsls r0, 24 + lsrs r0, 24 +_0811B524: + pop {r1} + bx r1 + thumb_func_end sub_811B4EC + + thumb_func_start sub_811B528 +sub_811B528: @ 811B528 + push {lr} + adds r2, r0, 0 + ldr r0, =0x0203a118 + ldr r3, [r0] + movs r1, 0xA + ldrsb r1, [r3, r1] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0811B558 + ldrb r0, [r3, 0x9] + cmp r0, 0 + bne _0811B550 + adds r0, r2, 0 + bl sub_811B568 + b _0811B55E + .pool +_0811B550: + adds r0, r2, 0 + bl sub_811B634 + b _0811B55E +_0811B558: + adds r0, r2, 0 + bl sub_811B6C4 +_0811B55E: + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_811B528 + + thumb_func_start sub_811B568 +sub_811B568: @ 811B568 + push {r4,lr} + cmp r0, 0x1 + beq _0811B5DE + cmp r0, 0x1 + bcc _0811B5FE + cmp r0, 0x2 + beq _0811B57C + cmp r0, 0x3 + beq _0811B5A4 + b _0811B62A +_0811B57C: + ldr r0, =0x0203a118 + ldr r1, [r0] + movs r0, 0xB + ldrsb r0, [r1, r0] + ldrb r3, [r1, 0xC] + cmn r0, r3 + beq _0811B62A + ldrb r2, [r1, 0xB] + cmp r0, 0 + beq _0811B59C + subs r0, r2, 0x1 + strb r0, [r1, 0xB] +_0811B594: + movs r0, 0xF + b _0811B62C + .pool +_0811B59C: + subs r0, r3, 0x1 + strb r0, [r1, 0xC] + movs r0, 0x11 + b _0811B62C +_0811B5A4: + ldr r0, =0x0203a118 + ldr r2, [r0] + movs r1, 0xB + ldrsb r1, [r2, r1] + ldrb r3, [r2, 0xC] + adds r1, r3 + ldrb r0, [r2, 0xD] + subs r0, 0x1 + cmp r1, r0 + bge _0811B62A + ldrb r1, [r2, 0xB] + movs r0, 0xB + ldrsb r0, [r2, r0] + cmp r0, 0x2 + bgt _0811B5D0 + adds r0, r1, 0x1 + strb r0, [r2, 0xB] + movs r4, 0xF + b _0811B5D6 + .pool +_0811B5D0: + adds r0, r3, 0x1 + strb r0, [r2, 0xC] + movs r4, 0x10 +_0811B5D6: + bl sub_811B978 + adds r0, r4, 0 + b _0811B62C +_0811B5DE: + ldr r0, =0x0203a118 + ldr r1, [r0] + ldrb r2, [r1, 0xA] + movs r0, 0xA + ldrsb r0, [r1, r0] + cmp r0, 0 + beq _0811B5F8 + subs r0, r2, 0x1 + strb r0, [r1, 0xA] + b _0811B594 + .pool +_0811B5F8: + bl sub_811B744 + b _0811B594 +_0811B5FE: + ldr r0, =0x0203a118 + ldr r1, [r0] + ldrb r2, [r1, 0xA] + movs r0, 0xA + ldrsb r0, [r1, r0] + cmp r0, 0 + bgt _0811B624 + adds r0, r2, 0x1 + strb r0, [r1, 0xA] + bl sub_811B9C8 + lsls r0, 24 + cmp r0, 0 + beq _0811B594 + bl sub_811B744 + b _0811B594 + .pool +_0811B624: + bl sub_811B744 + b _0811B594 +_0811B62A: + movs r0, 0 +_0811B62C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811B568 + + thumb_func_start sub_811B634 +sub_811B634: @ 811B634 + push {lr} + cmp r0, 0x1 + beq _0811B6A0 + cmp r0, 0x1 + bcc _0811B684 + cmp r0, 0x2 + beq _0811B64A + cmp r0, 0x3 + beq _0811B66A + movs r0, 0 + b _0811B6BC +_0811B64A: + ldr r0, =0x0203a118 + ldr r1, [r0] + ldrb r2, [r1, 0xB] + movs r0, 0xB + ldrsb r0, [r1, r0] + cmp r0, 0 + ble _0811B660 + subs r0, r2, 0x1 + b _0811B662 + .pool +_0811B660: + movs r0, 0x3 +_0811B662: + strb r0, [r1, 0xB] + bl sub_811B978 + b _0811B6BA +_0811B66A: + ldr r0, =0x0203a118 + ldr r1, [r0] + ldrb r2, [r1, 0xB] + movs r0, 0xB + ldrsb r0, [r1, r0] + cmp r0, 0x2 + bgt _0811B680 + adds r0, r2, 0x1 + b _0811B662 + .pool +_0811B680: + movs r0, 0 + b _0811B662 +_0811B684: + ldr r0, =0x0203a118 + ldr r1, [r0] + ldrb r0, [r1, 0xA] + adds r0, 0x1 + strb r0, [r1, 0xA] + bl sub_811B9C8 + lsls r0, 24 + cmp r0, 0 + beq _0811B6BA + b _0811B6B6 + .pool +_0811B6A0: + ldr r2, =0x0203a118 + ldr r1, [r2] + ldrb r0, [r1, 0xA] + subs r0, 0x1 + strb r0, [r1, 0xA] + ldr r0, [r2] + ldrb r0, [r0, 0xA] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bge _0811B6BA +_0811B6B6: + bl sub_811B744 +_0811B6BA: + movs r0, 0xF +_0811B6BC: + pop {r1} + bx r1 + .pool + thumb_func_end sub_811B634 + + thumb_func_start sub_811B6C4 +sub_811B6C4: @ 811B6C4 + push {lr} + adds r2, r0, 0 + cmp r2, 0x1 + beq _0811B714 + cmp r2, 0x1 + bcc _0811B728 + cmp r2, 0x2 + beq _0811B6DC + cmp r2, 0x3 + beq _0811B6F8 + movs r0, 0 + b _0811B73A +_0811B6DC: + ldr r0, =0x0203a118 + ldr r1, [r0] + ldrb r3, [r1, 0xB] + movs r0, 0xB + ldrsb r0, [r1, r0] + cmp r0, 0 + beq _0811B6F4 + subs r0, r3, 0x1 + b _0811B736 + .pool +_0811B6F4: + strb r2, [r1, 0xB] + b _0811B738 +_0811B6F8: + ldr r0, =0x0203a118 + ldr r1, [r0] + ldrb r2, [r1, 0xB] + movs r0, 0xB + ldrsb r0, [r1, r0] + cmp r0, 0x1 + bgt _0811B710 + adds r0, r2, 0x1 + b _0811B736 + .pool +_0811B710: + movs r0, 0 + b _0811B736 +_0811B714: + ldr r0, =0x0203a118 + ldr r1, [r0] + ldrb r0, [r1, 0xB] + adds r0, 0x1 + strb r0, [r1, 0xB] + bl sub_811B768 + b _0811B738 + .pool +_0811B728: + ldr r2, =0x0203a118 + ldr r1, [r2] + movs r0, 0 + strb r0, [r1, 0xA] + ldr r1, [r2] + ldrb r0, [r1, 0xB] + adds r0, 0x1 +_0811B736: + strb r0, [r1, 0xB] +_0811B738: + movs r0, 0xF +_0811B73A: + pop {r1} + bx r1 + .pool + thumb_func_end sub_811B6C4 + + thumb_func_start sub_811B744 +sub_811B744: @ 811B744 + push {lr} + ldr r2, =0x0203a118 + ldr r1, [r2] + movs r0, 0xFF + strb r0, [r1, 0xA] + ldr r2, [r2] + ldrb r1, [r2, 0xB] + movs r0, 0xB + ldrsb r0, [r2, r0] + cmp r0, 0 + beq _0811B75E + subs r0, r1, 0x1 + strb r0, [r2, 0xB] +_0811B75E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_811B744 + + thumb_func_start sub_811B768 +sub_811B768: @ 811B768 + push {r4,lr} + ldr r4, =0x0203a118 + ldr r1, [r4] + ldrb r0, [r1, 0x9] + cmp r0, 0 + bne _0811B784 + movs r0, 0x1 + strb r0, [r1, 0xA] + bl sub_811B978 + b _0811B78E + .pool +_0811B784: + ldrb r0, [r1, 0xB] + bl sub_811B960 + ldr r1, [r4] + strb r0, [r1, 0xA] +_0811B78E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811B768 + + thumb_func_start sub_811B794 +sub_811B794: @ 811B794 + push {r4,lr} + cmp r0, 0x5 + bls _0811B79C + b _0811B8C0 +_0811B79C: + lsls r0, 2 + ldr r1, =_0811B7AC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0811B7AC: + .4byte _0811B848 + .4byte _0811B826 + .4byte _0811B7C4 + .4byte _0811B7F0 + .4byte _0811B870 + .4byte _0811B890 +_0811B7C4: + ldr r0, =0x0203a118 + ldr r1, [r0] + movs r0, 0x11 + ldrsb r0, [r1, r0] + ldrb r3, [r1, 0xE] + adds r0, r3 + cmp r0, 0 + bgt _0811B7D6 + b _0811B8C0 +_0811B7D6: + ldrb r2, [r1, 0x11] + movs r0, 0x11 + ldrsb r0, [r1, r0] + cmp r0, 0 + ble _0811B7E8 + subs r0, r2, 0x1 + b _0811B80E + .pool +_0811B7E8: + subs r0, r3, 0x1 + strb r0, [r1, 0xE] + movs r4, 0x13 + b _0811B81E +_0811B7F0: + ldr r0, =0x0203a118 + ldr r1, [r0] + movs r0, 0x11 + ldrsb r0, [r1, r0] + ldrb r3, [r1, 0xE] + adds r0, r3 + ldrb r2, [r1, 0xF] + cmp r0, r2 + bge _0811B8C0 + ldrb r2, [r1, 0x11] + movs r0, 0x11 + ldrsb r0, [r1, r0] + cmp r0, 0x2 + bgt _0811B818 + adds r0, r2, 0x1 +_0811B80E: + strb r0, [r1, 0x11] + movs r4, 0x12 + b _0811B81E + .pool +_0811B818: + adds r0, r3, 0x1 + strb r0, [r1, 0xE] + movs r4, 0x14 +_0811B81E: + bl sub_811B9A0 + adds r0, r4, 0 + b _0811B8C2 +_0811B826: + ldr r0, =0x0203a118 + ldr r1, [r0] + ldrb r2, [r1, 0x10] + movs r0, 0x10 + ldrsb r0, [r1, r0] + cmp r0, 0 + ble _0811B83C + subs r0, r2, 0x1 + b _0811B83E + .pool +_0811B83C: + movs r0, 0x1 +_0811B83E: + strb r0, [r1, 0x10] + bl sub_811B9A0 +_0811B844: + movs r0, 0x12 + b _0811B8C2 +_0811B848: + ldr r4, =0x0203a118 + ldr r1, [r4] + ldrb r2, [r1, 0x10] + movs r0, 0x10 + ldrsb r0, [r1, r0] + cmp r0, 0 + bgt _0811B866 + adds r0, r2, 0x1 + strb r0, [r1, 0x10] + bl sub_811BA1C + lsls r0, 24 + cmp r0, 0 + beq _0811B844 + ldr r1, [r4] +_0811B866: + movs r0, 0 + strb r0, [r1, 0x10] + b _0811B844 + .pool +_0811B870: + ldr r0, =0x0203a118 + ldr r2, [r0] + ldrb r0, [r2, 0xE] + adds r1, r0, 0 + cmp r1, 0 + beq _0811B8C0 + cmp r1, 0x3 + bls _0811B888 + subs r0, 0x4 + b _0811B88A + .pool +_0811B888: + movs r0, 0 +_0811B88A: + strb r0, [r2, 0xE] + movs r0, 0x15 + b _0811B8C2 +_0811B890: + ldr r3, =0x0203a118 + ldr r1, [r3] + ldrb r2, [r1, 0xE] + ldrb r0, [r1, 0xF] + subs r0, 0x4 + cmp r2, r0 + bgt _0811B8C0 + adds r0, r2, 0x4 + strb r0, [r1, 0xE] + ldr r2, [r3] + ldrb r1, [r2, 0xE] + ldrb r3, [r2, 0xF] + subs r0, r3, 0x3 + cmp r1, r0 + ble _0811B8B4 + adds r0, r3, 0 + adds r0, 0xFD + strb r0, [r2, 0xE] +_0811B8B4: + bl sub_811B9A0 + movs r0, 0x16 + b _0811B8C2 + .pool +_0811B8C0: + movs r0, 0 +_0811B8C2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811B794 + + thumb_func_start sub_811B8C8 +sub_811B8C8: @ 811B8C8 + ldr r0, =0x0203a118 + ldr r0, [r0] + movs r2, 0x6 + ldrsb r2, [r0, r2] + ldrb r1, [r0, 0x2] + muls r1, r2 + ldrb r0, [r0, 0x5] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bx lr + .pool + thumb_func_end sub_811B8C8 + + thumb_func_start sub_811B8E8 +sub_811B8E8: @ 811B8E8 + ldr r0, =0x0203a118 + ldr r0, [r0] + movs r1, 0xB + ldrsb r1, [r0, r1] + ldrb r2, [r0, 0xC] + adds r1, r2 + lsls r1, 1 + ldrb r0, [r0, 0xA] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bx lr + .pool + thumb_func_end sub_811B8E8 + + thumb_func_start sub_811B908 +sub_811B908: @ 811B908 + push {lr} + ldr r0, =0x0203a118 + ldr r1, [r0] + ldrb r0, [r1, 0xA] + movs r3, 0 + cmp r0, 0x6 + bhi _0811B91A + movs r3, 0xA + ldrsb r3, [r1, r3] +_0811B91A: + ldrb r0, [r1, 0xB] + movs r2, 0 + cmp r0, 0x3 + bhi _0811B926 + movs r2, 0xB + ldrsb r2, [r1, r2] +_0811B926: + ldr r0, =gUnknown_08597748 + lsls r1, r2, 3 + subs r1, r2 + adds r1, r3, r1 + adds r1, r0 + ldrb r0, [r1] + pop {r1} + bx r1 + .pool + thumb_func_end sub_811B908 + + thumb_func_start sub_811B940 +sub_811B940: @ 811B940 + ldr r0, =0x0203a118 + ldr r0, [r0] + movs r1, 0x11 + ldrsb r1, [r0, r1] + ldrb r2, [r0, 0xE] + adds r1, r2 + lsls r1, 1 + ldrb r0, [r0, 0x10] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bx lr + .pool + thumb_func_end sub_811B940 + + thumb_func_start sub_811B960 +sub_811B960: @ 811B960 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _0811B96E + cmp r0, 0x1 + beq _0811B972 +_0811B96E: + movs r0, 0x6 + b _0811B974 +_0811B972: + movs r0, 0x5 +_0811B974: + pop {r1} + bx r1 + thumb_func_end sub_811B960 + + thumb_func_start sub_811B978 +sub_811B978: @ 811B978 + push {lr} + b _0811B98E +_0811B97C: + ldr r0, =0x0203a118 + ldr r1, [r0] + ldrb r2, [r1, 0xA] + movs r0, 0xA + ldrsb r0, [r1, r0] + cmp r0, 0 + beq _0811B998 + subs r0, r2, 0x1 + strb r0, [r1, 0xA] +_0811B98E: + bl sub_811B9C8 + lsls r0, 24 + cmp r0, 0 + bne _0811B97C +_0811B998: + pop {r0} + bx r0 + .pool + thumb_func_end sub_811B978 + + thumb_func_start sub_811B9A0 +sub_811B9A0: @ 811B9A0 + push {lr} + b _0811B9B6 +_0811B9A4: + ldr r0, =0x0203a118 + ldr r1, [r0] + ldrb r2, [r1, 0x10] + movs r0, 0x10 + ldrsb r0, [r1, r0] + cmp r0, 0 + beq _0811B9C0 + subs r0, r2, 0x1 + strb r0, [r1, 0x10] +_0811B9B6: + bl sub_811BA1C + lsls r0, 24 + cmp r0, 0 + bne _0811B9A4 +_0811B9C0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_811B9A0 + + thumb_func_start sub_811B9C8 +sub_811B9C8: @ 811B9C8 + push {r4,lr} + ldr r4, =0x0203a118 + ldr r1, [r4] + ldrb r0, [r1, 0x9] + cmp r0, 0 + bne _0811B9F8 + bl sub_811B8E8 + adds r4, r0, 0 + bl sub_811F3AC + movs r1, 0 + lsls r0, 24 + lsls r4, 16 + lsrs r4, 16 + lsrs r0, 24 + cmp r4, r0 + bcc _0811B9EE + movs r1, 0x1 +_0811B9EE: + adds r0, r1, 0 + b _0811BA14 + .pool +_0811B9F8: + ldrb r0, [r1, 0xB] + bl sub_811B960 + movs r2, 0 + ldr r1, [r4] + ldrb r1, [r1, 0xA] + lsls r1, 24 + asrs r1, 24 + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + ble _0811BA12 + movs r2, 0x1 +_0811BA12: + adds r0, r2, 0 +_0811BA14: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811B9C8 + + thumb_func_start sub_811BA1C +sub_811BA1C: @ 811BA1C + push {r4,lr} + bl sub_811B940 + adds r4, r0, 0 + bl sub_811F5B0 + movs r1, 0 + lsls r4, 16 + lsls r0, 16 + cmp r4, r0 + bcc _0811BA34 + movs r1, 0x1 +_0811BA34: + adds r0, r1, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811BA1C + + thumb_func_start sub_811BA3C +sub_811BA3C: @ 811BA3C + ldr r2, =gUnknown_08597550 + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x3] + lsrs r0, 7 + bx lr + .pool + thumb_func_end sub_811BA3C + + thumb_func_start sub_811BA5C +sub_811BA5C: @ 811BA5C + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_811BA5C + + thumb_func_start sub_811BA68 +sub_811BA68: @ 811BA68 + ldr r2, =gUnknown_08597550 + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r1, [r0, 0x1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x3] + lsls r0, 25 + lsrs r0, 25 + bx lr + .pool + thumb_func_end sub_811BA68 + + thumb_func_start sub_811BA88 +sub_811BA88: @ 811BA88 + ldr r0, =0x0203a118 + ldr r0, [r0] + ldr r0, [r0, 0x34] + bx lr + .pool + thumb_func_end sub_811BA88 + + thumb_func_start sub_811BA94 +sub_811BA94: @ 811BA94 + ldr r0, =0x0203a118 + ldr r0, [r0] + adds r0, 0x3C + bx lr + .pool + thumb_func_end sub_811BA94 + + thumb_func_start sub_811BAA0 +sub_811BAA0: @ 811BAA0 + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r0, [r0, 0x3] + bx lr + .pool + thumb_func_end sub_811BAA0 + + thumb_func_start sub_811BAAC +sub_811BAAC: @ 811BAAC + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r0, [r0, 0x2] + bx lr + .pool + thumb_func_end sub_811BAAC + + thumb_func_start sub_811BAB8 +sub_811BAB8: @ 811BAB8 + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r0, [r0, 0x5] + bx lr + .pool + thumb_func_end sub_811BAB8 + + thumb_func_start sub_811BAC4 +sub_811BAC4: @ 811BAC4 + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r0, [r0, 0x6] + bx lr + .pool + thumb_func_end sub_811BAC4 + + thumb_func_start sub_811BAD0 +sub_811BAD0: @ 811BAD0 + push {r4,r5,lr} + ldr r4, =gUnknown_08597550 + ldr r2, =0x0203a118 + ldr r5, [r2] + ldrb r3, [r5, 0x1] + lsls r2, r3, 1 + adds r2, r3 + lsls r2, 3 + adds r3, r4, 0 + adds r3, 0x8 + adds r2, r3 + ldr r2, [r2] + str r2, [r0] + ldrb r2, [r5, 0x1] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r4, 0xC + adds r0, r4 + ldr r0, [r0] + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811BAD0 + + thumb_func_start sub_811BB08 +sub_811BB08: @ 811BB08 + push {r4,r5,lr} + ldr r4, =gUnknown_08597550 + ldr r2, =0x0203a118 + ldr r5, [r2] + ldrb r3, [r5, 0x1] + lsls r2, r3, 1 + adds r2, r3 + lsls r2, 3 + adds r3, r4, 0 + adds r3, 0x10 + adds r2, r3 + ldr r2, [r2] + str r2, [r0] + ldrb r2, [r5, 0x1] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r4, 0x14 + adds r0, r4 + ldr r0, [r0] + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811BB08 + + thumb_func_start sub_811BB40 +sub_811BB40: @ 811BB40 + push {lr} + adds r2, r0, 0 + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x4 + bne _0811BB5C + ldr r0, =gUnknown_085EC3B4 + b _0811BB7A + .pool +_0811BB5C: + cmp r0, 0x4 + blt _0811BB78 + cmp r0, 0x10 + bgt _0811BB78 + cmp r0, 0xF + blt _0811BB78 + ldr r0, =gUnknown_085EC706 + str r0, [r2] + ldr r0, =gUnknown_085EC727 + b _0811BB7E + .pool +_0811BB78: + ldr r0, =gUnknown_085EC3A6 +_0811BB7A: + str r0, [r2] + movs r0, 0 +_0811BB7E: + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_811BB40 + + thumb_func_start sub_811BB88 +sub_811BB88: @ 811BB88 + ldr r2, =gUnknown_085EC410 + str r2, [r0] + ldr r0, =gUnknown_085EC42F + str r0, [r1] + bx lr + .pool + thumb_func_end sub_811BB88 + + thumb_func_start sub_811BB9C +sub_811BB9C: @ 811BB9C + ldr r2, =0x0203a118 + ldr r3, [r2] + ldrb r2, [r3, 0xA] + strb r2, [r0] + ldrb r0, [r3, 0xB] + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_811BB9C + + thumb_func_start sub_811BBB0 +sub_811BBB0: @ 811BBB0 + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r0, [r0, 0x9] + bx lr + .pool + thumb_func_end sub_811BBB0 + + thumb_func_start sub_811BBBC +sub_811BBBC: @ 811BBBC + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r0, [r0, 0xC] + bx lr + .pool + thumb_func_end sub_811BBBC + + thumb_func_start sub_811BBC8 +sub_811BBC8: @ 811BBC8 + ldr r2, =0x0203a118 + ldr r3, [r2] + ldrb r2, [r3, 0x10] + strb r2, [r0] + ldrb r0, [r3, 0x11] + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_811BBC8 + + thumb_func_start sub_811BBDC +sub_811BBDC: @ 811BBDC + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r0, [r0, 0xE] + bx lr + .pool + thumb_func_end sub_811BBDC + + thumb_func_start sub_811BBE8 +sub_811BBE8: @ 811BBE8 + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r0, [r0, 0xF] + bx lr + .pool + thumb_func_end sub_811BBE8 + + thumb_func_start sub_811BBF4 +sub_811BBF4: @ 811BBF4 + movs r0, 0 + bx lr + thumb_func_end sub_811BBF4 + + thumb_func_start sub_811BBF8 +sub_811BBF8: @ 811BBF8 + push {lr} + ldr r0, =0x0203a118 + ldr r1, [r0] + ldrb r0, [r1, 0x4] + cmp r0, 0x2 + beq _0811BC10 + cmp r0, 0x3 + beq _0811BC1A + b _0811BC24 + .pool +_0811BC10: + ldrb r0, [r1, 0x9] + cmp r0, 0 + bne _0811BC24 + ldrb r0, [r1, 0xC] + b _0811BC1C +_0811BC1A: + ldrb r0, [r1, 0xE] +_0811BC1C: + cmp r0, 0 + beq _0811BC24 + movs r0, 0x1 + b _0811BC26 +_0811BC24: + movs r0, 0 +_0811BC26: + pop {r1} + bx r1 + thumb_func_end sub_811BBF8 + + thumb_func_start sub_811BC2C +sub_811BC2C: @ 811BC2C + push {lr} + ldr r0, =0x0203a118 + ldr r2, [r0] + ldrb r0, [r2, 0x4] + cmp r0, 0x2 + beq _0811BC44 + cmp r0, 0x3 + beq _0811BC5A + b _0811BC68 + .pool +_0811BC44: + ldrb r0, [r2, 0x9] + cmp r0, 0 + bne _0811BC68 + ldrb r1, [r2, 0xC] + adds r1, 0x4 + ldrb r0, [r2, 0xD] + subs r0, 0x1 + cmp r1, r0 + bgt _0811BC68 + movs r0, 0x1 + b _0811BC6A +_0811BC5A: + ldrb r0, [r2, 0xE] + adds r0, 0x4 + ldrb r2, [r2, 0xF] + cmp r0, r2 + bgt _0811BC68 + movs r0, 0x1 + b _0811BC6A +_0811BC68: + movs r0, 0 +_0811BC6A: + pop {r1} + bx r1 + thumb_func_end sub_811BC2C + + thumb_func_start sub_811BC70 +sub_811BC70: @ 811BC70 + push {lr} + bl sub_811BA3C + pop {r1} + bx r1 + thumb_func_end sub_811BC70 + + thumb_func_start sub_811BC7C +sub_811BC7C: @ 811BC7C + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r3, r1, 24 + movs r2, 0 + cmp r2, r3 + bcs _0811BCB2 + ldr r0, =0x0203a118 + ldr r0, [r0] + adds r4, r0, 0 + adds r4, 0x3C +_0811BC92: + lsls r0, r2, 1 + adds r1, r0, r5 + adds r0, r4, r0 + ldrh r1, [r1] + ldrh r0, [r0] + cmp r1, r0 + beq _0811BCA8 + movs r0, 0x1 + b _0811BCB4 + .pool +_0811BCA8: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r3 + bcc _0811BC92 +_0811BCB2: + movs r0, 0 +_0811BCB4: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_811BC7C + + thumb_func_start sub_811BCBC +sub_811BCBC: @ 811BCBC + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r0, [r0, 0x12] + bx lr + .pool + thumb_func_end sub_811BCBC + + thumb_func_start sub_811BCC8 +sub_811BCC8: @ 811BCC8 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + movs r1, 0 + ldr r2, =gUnknown_08597550 +_0811BCD2: + ldrb r0, [r2] + cmp r0, r3 + bne _0811BCE4 + lsls r0, r1, 24 + lsrs r0, 24 + b _0811BCEE + .pool +_0811BCE4: + adds r2, 0x18 + adds r1, 0x1 + cmp r1, 0x14 + bls _0811BCD2 + movs r0, 0 +_0811BCEE: + pop {r1} + bx r1 + thumb_func_end sub_811BCC8 + + thumb_func_start sub_811BCF4 +sub_811BCF4: @ 811BCF4 + push {r4,lr} + movs r2, 0 + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r1, [r0, 0x7] + cmp r2, r1 + bge _0811BD24 + ldr r4, =0x0000ffff + adds r3, r1, 0 + adds r1, r0, 0 + adds r1, 0x3C +_0811BD0A: + ldrh r0, [r1] + cmp r0, r4 + beq _0811BD1C + movs r0, 0 + b _0811BD26 + .pool +_0811BD1C: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, r3 + blt _0811BD0A +_0811BD24: + movs r0, 0x1 +_0811BD26: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811BCF4 + + thumb_func_start sub_811BD2C +sub_811BD2C: @ 811BD2C + push {r4,lr} + movs r2, 0 + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r1, [r0, 0x7] + cmp r2, r1 + bge _0811BD5C + ldr r4, =0x0000ffff + adds r3, r1, 0 + adds r1, r0, 0 + adds r1, 0x3C +_0811BD42: + ldrh r0, [r1] + cmp r0, r4 + bne _0811BD54 + movs r0, 0 + b _0811BD5E + .pool +_0811BD54: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, r3 + blt _0811BD42 +_0811BD5C: + movs r0, 0x1 +_0811BD5E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811BD2C + + thumb_func_start sub_811BD64 +sub_811BD64: @ 811BD64 + push {r4,lr} + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x11 + bne _0811BD80 + bl sub_811BCF4 + b _0811BD9C + .pool +_0811BD7C: + movs r0, 0 + b _0811BD9C +_0811BD80: + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r2, 0 + ldr r3, =0x0000ffff + ldr r4, =0x00003b5a + adds r1, r0, r4 +_0811BD8C: + ldrh r0, [r1] + cmp r0, r3 + bne _0811BD7C + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x8 + ble _0811BD8C + movs r0, 0x1 +_0811BD9C: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_811BD64 + + thumb_func_start sub_811BDB0 +sub_811BDB0: @ 811BDB0 + push {lr} + ldr r0, =0x0203a118 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x12 + bne _0811BDC8 + bl sub_811BCF4 + b _0811BDDE + .pool +_0811BDC8: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + movs r2, 0 + ldrh r1, [r0, 0x14] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _0811BDDC + movs r2, 0x1 +_0811BDDC: + adds r0, r2, 0 +_0811BDDE: + pop {r1} + bx r1 + .pool + thumb_func_end sub_811BDB0 + + thumb_func_start sub_811BDF0 +sub_811BDF0: @ 811BDF0 + push {r4-r6,lr} + sub sp, 0x20 + adds r6, r0, 0 + ldr r0, =0x03005d8c + ldr r4, [r0] + bl sub_81AFBF0 + ldr r0, =0x00003b70 + adds r5, r4, r0 + adds r0, r5, 0 + bl GetStringLength + lsls r0, 16 + cmp r0, 0 + beq _0811BE34 + ldr r1, =0x00003b85 + adds r0, r4, r1 + ldrb r2, [r0] + mov r0, sp + adds r1, r5, 0 + bl sub_81DB5E8 + movs r0, 0 + mov r1, sp + bl sub_81AFC0C + b _0811BE3C + .pool +_0811BE34: + ldr r1, =gUnknown_085EC6B2 + movs r0, 0 + bl sub_81AFC0C +_0811BE3C: + ldr r1, =gUnknown_085EC6A8 + adds r0, r6, 0 + bl sub_81AFC28 + add sp, 0x20 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811BDF0 + + thumb_func_start sub_811BE54 +sub_811BE54: @ 811BE54 + push {r4,r5,lr} + ldr r0, =0x0203a118 + ldr r0, [r0] + adds r4, r0, 0 + adds r4, 0x3C + ldr r2, =0x02021dc4 + movs r5, 0 + b _0811BE86 + .pool +_0811BE6C: + ldrh r1, [r4] + adds r0, r2, 0 + movs r2, 0 + bl CopyEasyChatWordPadded + adds r2, r0, 0 + movs r0, 0 + strb r0, [r2] + adds r2, 0x1 + adds r4, 0x2 + adds r5, 0x1 + ldr r0, =0x0203a118 + ldr r0, [r0] +_0811BE86: + ldrb r0, [r0, 0x7] + cmp r5, r0 + blt _0811BE6C + subs r2, 0x1 + movs r0, 0xFF + strb r0, [r2] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811BE54 + + thumb_func_start sub_811BE9C +sub_811BE9C: @ 811BE9C + push {r4,r5,lr} + ldr r5, =0x0203a118 + ldr r0, [r5] + ldrb r0, [r0] + cmp r0, 0x9 + beq _0811BEF0 + cmp r0, 0x9 + bgt _0811BEB8 + cmp r0, 0 + beq _0811BEC2 + b _0811BF14 + .pool +_0811BEB8: + cmp r0, 0xD + beq _0811BF0C + cmp r0, 0x14 + beq _0811BED0 + b _0811BF14 +_0811BEC2: + ldr r0, =0x00000865 + bl FlagSet + b _0811BF14 + .pool +_0811BED0: + bl sub_811BF20 + adds r1, r0, 0 + cmp r1, 0 + beq _0811BEE4 + ldr r1, =0x020375e0 + movs r0, 0x2 + b _0811BF12 + .pool +_0811BEE4: + ldr r0, =0x020375e0 + strh r1, [r0] + b _0811BF14 + .pool +_0811BEF0: + bl sub_811BE54 + ldr r4, =0x020375e0 + ldr r0, [r5] + adds r0, 0x3C + bl sub_81226D8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + b _0811BF14 + .pool +_0811BF0C: + bl sub_811BF40 + ldr r1, =0x020375e0 +_0811BF12: + strh r0, [r1] +_0811BF14: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811BE9C + + thumb_func_start sub_811BF20 +sub_811BF20: @ 811BF20 + push {lr} + ldr r0, =gUnknown_08597764 + movs r1, 0x4 + bl sub_811BC7C + movs r1, 0 + lsls r0, 24 + cmp r0, 0 + bne _0811BF34 + movs r1, 0x1 +_0811BF34: + adds r0, r1, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_811BF20 + + thumb_func_start sub_811BF40 +sub_811BF40: @ 811BF40 + push {r4,r5,lr} + movs r4, 0 + movs r5, 0x80 + lsls r5, 9 +_0811BF48: + lsls r0, r4, 2 + ldr r1, =gUnknown_0859776C + adds r0, r1 + movs r1, 0x2 + bl sub_811BC7C + lsls r0, 24 + cmp r0, 0 + bne _0811BF64 + lsrs r0, r5, 16 + b _0811BF72 + .pool +_0811BF64: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r4, 0x1 + cmp r4, 0x4 + ble _0811BF48 + movs r0, 0 +_0811BF72: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_811BF40 + + thumb_func_start sub_811BF78 +sub_811BF78: @ 811BF78 + ldr r0, =0x0203a118 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x13] + bx lr + .pool + thumb_func_end sub_811BF78 + + thumb_func_start sub_811BF88 +sub_811BF88: @ 811BF88 + movs r0, 0 + bx lr + thumb_func_end sub_811BF88 + + thumb_func_start sub_811BF8C +sub_811BF8C: @ 811BF8C + push {lr} + bl sub_811CE94 + lsls r0, 24 + cmp r0, 0 + beq _0811BF9C + movs r0, 0x1 + b _0811BF9E +_0811BF9C: + movs r0, 0 +_0811BF9E: + pop {r1} + bx r1 + thumb_func_end sub_811BF8C + + thumb_func_start sub_811BFA4 +sub_811BFA4: @ 811BFA4 + push {r4,lr} + sub sp, 0x8 + ldr r0, =0x0203a11c + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0x5 + bls _0811BFB4 + b _0811C120 +_0811BFB4: + lsls r0, 2 + ldr r1, =_0811BFC8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0811BFC8: + .4byte _0811BFE0 + .4byte _0811C044 + .4byte _0811C090 + .4byte _0811C0AC + .4byte _0811C0BE + .4byte _0811C0D4 +_0811BFE0: + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_08597C54 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r4, =0x0203a11c + ldr r1, [r4] + movs r0, 0xB0 + lsls r0, 4 + adds r1, r0 + movs r0, 0x3 + bl SetBgTilemapBuffer + ldr r1, [r4] + movs r0, 0xC0 + lsls r0, 2 + adds r1, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r0, =gUnknown_08597C64 + bl InitWindows + bl DeactivateAllTextPrinters + bl sub_811CF64 + bl sub_811CF04 + movs r0, 0 + str r0, [sp, 0x4] + movs r1, 0xE0 + lsls r1, 19 + ldr r2, =0x01000100 + add r0, sp, 0x4 + bl CpuFastSet + b _0811C124 + .pool +_0811C044: + ldr r1, =gUnknown_08DCBDD0 + movs r0, 0 + str r0, [sp] + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_08DCBF10 + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + bl sub_811D60C + ldr r0, =0x0203a11c + ldr r0, [r0] + movs r1, 0xC0 + lsls r1, 2 + adds r0, r1 + bl sub_811D424 + bl sub_811D230 + bl sub_811E948 + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + b _0811C124 + .pool +_0811C090: + ldr r1, =gUnknown_08597B54 + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + b _0811C124 + .pool +_0811C0AC: + bl sub_811CFCC + bl sub_811D0BC + bl sub_811D2C8 + bl sub_811D684 + b _0811C124 +_0811C0BE: + bl sub_811DE90 + bl sub_811BA5C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + beq _0811C124 + bl sub_811DEC4 + b _0811C124 +_0811C0D4: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0811C12E + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_811DE5C + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x3B + bl SetGpuReg + movs r0, 0x3 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0 + bl ShowBg + bl sub_811E5D4 + bl sub_811E720 + bl sub_811E828 + b _0811C124 +_0811C120: + movs r0, 0 + b _0811C130 +_0811C124: + ldr r0, =0x0203a11c + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811C12E: + movs r0, 0x1 +_0811C130: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_811BFA4 + + thumb_func_start sub_811C13C +sub_811C13C: @ 811C13C + push {r4,lr} + ldr r4, =0x0203a11c + ldr r0, [r4] + cmp r0, 0 + beq _0811C14E + bl Free + movs r0, 0 + str r0, [r4] +_0811C14E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811C13C + + thumb_func_start sub_811C158 +sub_811C158: @ 811C158 + push {lr} + ldr r1, =0x0203a11c + ldr r1, [r1] + movs r2, 0 + strh r0, [r1, 0x4] + strh r2, [r1] + bl sub_811C170 + pop {r0} + bx r0 + .pool + thumb_func_end sub_811C158 + + thumb_func_start sub_811C170 +sub_811C170: @ 811C170 + push {lr} + ldr r0, =0x0203a11c + ldr r0, [r0] + ldrh r0, [r0, 0x4] + cmp r0, 0x22 + bls _0811C17E + b _0811C2CE +_0811C17E: + lsls r0, 2 + ldr r1, =_0811C190 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0811C190: + .4byte _0811C2CE + .4byte _0811C21C + .4byte _0811C222 + .4byte _0811C228 + .4byte _0811C22E + .4byte _0811C234 + .4byte _0811C23A + .4byte _0811C240 + .4byte _0811C246 + .4byte _0811C24C + .4byte _0811C252 + .4byte _0811C258 + .4byte _0811C25E + .4byte _0811C264 + .4byte _0811C26A + .4byte _0811C270 + .4byte _0811C276 + .4byte _0811C27C + .4byte _0811C282 + .4byte _0811C288 + .4byte _0811C28E + .4byte _0811C294 + .4byte _0811C29A + .4byte _0811C2A0 + .4byte _0811C2CE + .4byte _0811C2CE + .4byte _0811C2CE + .4byte _0811C2CE + .4byte _0811C2CE + .4byte _0811C2A6 + .4byte _0811C2AC + .4byte _0811C2B2 + .4byte _0811C2B8 + .4byte _0811C2BE + .4byte _0811C2C4 +_0811C21C: + bl sub_811C2D4 + b _0811C2C8 +_0811C222: + bl sub_811C30C + b _0811C2C8 +_0811C228: + bl sub_811C3E4 + b _0811C2C8 +_0811C22E: + bl sub_811C48C + b _0811C2C8 +_0811C234: + bl sub_811C404 + b _0811C2C8 +_0811C23A: + bl sub_811C448 + b _0811C2C8 +_0811C240: + bl sub_811C4D0 + b _0811C2C8 +_0811C246: + bl sub_811C518 + b _0811C2C8 +_0811C24C: + bl sub_811C554 + b _0811C2C8 +_0811C252: + bl sub_811C620 + b _0811C2C8 +_0811C258: + bl sub_811C830 + b _0811C2C8 +_0811C25E: + bl sub_811C8F0 + b _0811C2C8 +_0811C264: + bl sub_811C99C + b _0811C2C8 +_0811C26A: + bl sub_811CA5C + b _0811C2C8 +_0811C270: + bl sub_811C780 + b _0811C2C8 +_0811C276: + bl sub_811C78C + b _0811C2C8 +_0811C27C: + bl sub_811C7D4 + b _0811C2C8 +_0811C282: + bl sub_811CB18 + b _0811C2C8 +_0811C288: + bl sub_811CB98 + b _0811C2C8 +_0811C28E: + bl sub_811CB24 + b _0811C2C8 +_0811C294: + bl sub_811CC90 + b _0811C2C8 +_0811C29A: + bl sub_811CC08 + b _0811C2C8 +_0811C2A0: + bl sub_811C6C0 + b _0811C2C8 +_0811C2A6: + bl sub_811CD14 + b _0811C2C8 +_0811C2AC: + bl sub_811CD54 + b _0811C2C8 +_0811C2B2: + bl sub_811CD94 + b _0811C2C8 +_0811C2B8: + bl sub_811CDD4 + b _0811C2C8 +_0811C2BE: + bl sub_811CE14 + b _0811C2C8 +_0811C2C4: + bl sub_811CE54 +_0811C2C8: + lsls r0, 24 + lsrs r0, 24 + b _0811C2D0 +_0811C2CE: + movs r0, 0 +_0811C2D0: + pop {r1} + bx r1 + thumb_func_end sub_811C170 + + thumb_func_start sub_811C2D4 +sub_811C2D4: @ 811C2D4 + push {r4,lr} + ldr r4, =0x0203a11c + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811C2EC + cmp r0, 0x1 + beq _0811C2FA + b _0811C304 + .pool +_0811C2EC: + bl sub_811D2C8 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811C304 +_0811C2FA: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + b _0811C306 +_0811C304: + movs r0, 0x1 +_0811C306: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811C2D4 + + thumb_func_start sub_811C30C +sub_811C30C: @ 811C30C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + bl sub_811BA94 + adds r4, r0, 0 + bl sub_811BA68 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + bl sub_811BAB8 + lsls r0, 24 + lsrs r7, r0, 24 + bl sub_811BAC4 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + bl sub_811BAAC + lsls r0, 24 + lsrs r0, 24 + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + lsls r0, 1 + adds r4, r0 + ldr r1, =gUnknown_08597C30 + mov r2, r10 + lsls r0, r2, 2 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 8 + movs r1, 0xD0 + lsls r1, 12 + adds r0, r1 + lsrs r6, r0, 16 + movs r5, 0 + cmp r5, r7 + bcs _0811C3AA + ldr r2, =0x0000ffff + mov r8, r2 +_0811C36C: + ldrh r0, [r4] + cmp r0, r8 + bne _0811C380 + movs r0, 0x48 + b _0811C392 + .pool +_0811C380: + ldrh r1, [r4] + mov r0, sp + bl CopyEasyChatWord + movs r0, 0x1 + mov r1, sp + movs r2, 0 + bl GetStringWidth +_0811C392: + adds r0, 0x11 + lsls r1, r6, 16 + asrs r1, 16 + adds r1, r0 + lsls r1, 16 + lsrs r6, r1, 16 + adds r4, 0x2 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r7 + bcc _0811C36C +_0811C3AA: + ldr r1, =gUnknown_08597C30 + mov r2, r10 + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + lsrs r1, 5 + mov r2, r9 + lsls r0, r2, 1 + adds r1, r0 + lsls r1, 27 + lsls r0, r6, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 20 + adds r1, r2 + lsrs r1, 24 + bl sub_811DF60 + movs r0, 0 + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_811C30C + + thumb_func_start sub_811C3E4 +sub_811C3E4: @ 811C3E4 + push {lr} + bl sub_811BAB8 + lsls r0, 24 + lsrs r0, 24 + bl sub_811E920 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x60 + bl sub_811DF60 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_811C3E4 + + thumb_func_start sub_811C404 +sub_811C404: @ 811C404 + push {r4,lr} + ldr r4, =0x0203a11c + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811C41C + cmp r0, 0x1 + beq _0811C436 + b _0811C440 + .pool +_0811C41C: + bl sub_811DF90 + movs r0, 0x2 + bl sub_811D104 + movs r0, 0x1 + bl sub_811D214 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811C440 +_0811C436: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + b _0811C442 +_0811C440: + movs r0, 0x1 +_0811C442: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811C404 + + thumb_func_start sub_811C448 +sub_811C448: @ 811C448 + push {r4,lr} + ldr r4, =0x0203a11c + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811C460 + cmp r0, 0x1 + beq _0811C47A + b _0811C484 + .pool +_0811C460: + bl sub_811DF90 + movs r0, 0x3 + bl sub_811D104 + movs r0, 0 + bl sub_811D214 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811C484 +_0811C47A: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + b _0811C486 +_0811C484: + movs r0, 0x1 +_0811C486: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811C448 + + thumb_func_start sub_811C48C +sub_811C48C: @ 811C48C + push {r4,lr} + ldr r4, =0x0203a11c + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811C4A4 + cmp r0, 0x1 + beq _0811C4BE + b _0811C4C8 + .pool +_0811C4A4: + bl sub_811DF90 + movs r0, 0x1 + bl sub_811D104 + movs r0, 0x1 + bl sub_811D214 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811C4C8 +_0811C4BE: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + b _0811C4CA +_0811C4C8: + movs r0, 0x1 +_0811C4CA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811C48C + + thumb_func_start sub_811C4D0 +sub_811C4D0: @ 811C4D0 + push {r4,lr} + ldr r4, =0x0203a11c + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811C4E8 + cmp r0, 0x1 + beq _0811C506 + b _0811C510 + .pool +_0811C4E8: + bl sub_811DFB0 + movs r0, 0 + bl sub_811D104 + bl sub_811D2C8 + movs r0, 0 + bl ShowBg + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811C510 +_0811C506: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + b _0811C512 +_0811C510: + movs r0, 0x1 +_0811C512: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811C4D0 + + thumb_func_start sub_811C518 +sub_811C518: @ 811C518 + push {r4,lr} + ldr r4, =0x0203a11c + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811C530 + cmp r0, 0x1 + beq _0811C546 + movs r0, 0x1 + b _0811C54E + .pool +_0811C530: + bl sub_811DFB0 + movs r0, 0 + bl sub_811D104 + bl sub_811D2C8 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811C546: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 +_0811C54E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811C518 + + thumb_func_start sub_811C554 +sub_811C554: @ 811C554 + push {lr} + ldr r0, =0x0203a11c + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0x4 + bhi _0811C60E + lsls r0, 2 + ldr r1, =_0811C574 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0811C574: + .4byte _0811C588 + .4byte _0811C5A4 + .4byte _0811C5B6 + .4byte _0811C5CC + .4byte _0811C5EC +_0811C588: + bl sub_811DF90 + movs r0, 0 + bl HideBg + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_811DE5C + bl sub_811D6D4 + b _0811C5DA +_0811C5A4: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0811C618 + movs r0, 0 + bl sub_811D9CC + b _0811C5DA +_0811C5B6: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0811C618 + bl sub_811DAA4 + lsls r0, 24 + cmp r0, 0 + bne _0811C618 + b _0811C5DA +_0811C5CC: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0811C618 + bl sub_811E3AC +_0811C5DA: + ldr r0, =0x0203a11c + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811C618 + .pool +_0811C5EC: + bl sub_811E418 + lsls r0, 24 + cmp r0, 0 + bne _0811C618 + bl sub_811DFC8 + movs r0, 0 + bl sub_811E6E0 + bl sub_811E64C + ldr r0, =0x0203a11c + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811C60E: + movs r0, 0 + b _0811C61A + .pool +_0811C618: + movs r0, 0x1 +_0811C61A: + pop {r1} + bx r1 + thumb_func_end sub_811C554 + + thumb_func_start sub_811C620 +sub_811C620: @ 811C620 + push {lr} + ldr r0, =0x0203a11c + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0x4 + bhi _0811C6B8 + lsls r0, 2 + ldr r1, =_0811C640 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0811C640: + .4byte _0811C654 + .4byte _0811C662 + .4byte _0811C67E + .4byte _0811C690 + .4byte _0811C6B4 +_0811C654: + bl sub_811E050 + bl sub_811E4AC + bl sub_811E6B0 + b _0811C6A4 +_0811C662: + bl sub_811E4D0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0811C6B8 + movs r0, 0x1 + bl sub_811D9CC + ldr r0, =0x0203a11c + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811C67E: + bl sub_811DAA4 + lsls r0, 24 + cmp r0, 0 + bne _0811C6B8 + b _0811C6A4 + .pool +_0811C690: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0811C6B8 + bl sub_811DFB0 + movs r0, 0 + bl ShowBg +_0811C6A4: + ldr r0, =0x0203a11c + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811C6B8 + .pool +_0811C6B4: + movs r0, 0 + b _0811C6BA +_0811C6B8: + movs r0, 0x1 +_0811C6BA: + pop {r1} + bx r1 + thumb_func_end sub_811C620 + + thumb_func_start sub_811C6C0 +sub_811C6C0: @ 811C6C0 + push {lr} + ldr r0, =0x0203a11c + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0x4 + bhi _0811C778 + lsls r0, 2 + ldr r1, =_0811C6E0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0811C6E0: + .4byte _0811C6F4 + .4byte _0811C708 + .4byte _0811C722 + .4byte _0811C748 + .4byte _0811C76E +_0811C6F4: + bl sub_811E050 + bl sub_811E6B0 + bl sub_811E55C + movs r0, 0x5 + bl sub_811D9CC + b _0811C736 +_0811C708: + bl sub_811DAA4 + lsls r0, 24 + cmp r0, 0 + bne _0811C778 + bl sub_811E5B8 + lsls r0, 24 + cmp r0, 0 + bne _0811C778 + bl sub_811D6D4 + b _0811C736 +_0811C722: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0811C778 + movs r0, 0x6 + bl sub_811D9CC + bl sub_811E578 +_0811C736: + ldr r0, =0x0203a11c + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811C778 + .pool +_0811C748: + bl sub_811DAA4 + lsls r0, 24 + cmp r0, 0 + bne _0811C778 + bl sub_811E5B8 + lsls r0, 24 + cmp r0, 0 + bne _0811C778 + bl sub_811E64C + bl sub_811DFC8 + ldr r0, =0x0203a11c + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811C76E: + movs r0, 0 + b _0811C77A + .pool +_0811C778: + movs r0, 0x1 +_0811C77A: + pop {r1} + bx r1 + thumb_func_end sub_811C6C0 + + thumb_func_start sub_811C780 +sub_811C780: @ 811C780 + push {lr} + bl sub_811E088 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_811C780 + + thumb_func_start sub_811C78C +sub_811C78C: @ 811C78C + push {r4,lr} + ldr r4, =0x0203a11c + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811C7A4 + cmp r0, 0x1 + beq _0811C7B4 + b _0811C7CA + .pool +_0811C7A4: + movs r0, 0x1 + movs r1, 0x4 + bl sub_811DDAC + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811C7B4: + bl sub_811DE10 + lsls r0, 24 + cmp r0, 0 + bne _0811C7CA + bl sub_811E088 + bl sub_811E64C + movs r0, 0 + b _0811C7CC +_0811C7CA: + movs r0, 0x1 +_0811C7CC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811C78C + + thumb_func_start sub_811C7D4 +sub_811C7D4: @ 811C7D4 + push {r4,lr} + ldr r4, =0x0203a11c + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0x1 + beq _0811C808 + cmp r0, 0x1 + bgt _0811C7F0 + cmp r0, 0 + beq _0811C7F6 + b _0811C828 + .pool +_0811C7F0: + cmp r0, 0x2 + beq _0811C820 + b _0811C828 +_0811C7F6: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x4 + bl sub_811DDAC + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811C808: + bl sub_811DE10 + lsls r0, 24 + cmp r0, 0 + bne _0811C828 + bl sub_811E64C + ldr r0, =0x0203a11c + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811C820: + movs r0, 0 + b _0811C82A + .pool +_0811C828: + movs r0, 0x1 +_0811C82A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811C7D4 + + thumb_func_start sub_811C830 +sub_811C830: @ 811C830 + push {lr} + ldr r0, =0x0203a11c + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0x5 + bhi _0811C8E8 + lsls r0, 2 + ldr r1, =_0811C850 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0811C850: + .4byte _0811C868 + .4byte _0811C876 + .4byte _0811C886 + .4byte _0811C898 + .4byte _0811C8B8 + .4byte _0811C8DE +_0811C868: + bl sub_811E050 + bl sub_811E4AC + bl sub_811E6B0 + b _0811C8A8 +_0811C876: + bl sub_811E4D0 + lsls r0, 24 + cmp r0, 0 + bne _0811C8E8 + bl sub_811D9B4 + b _0811C8A8 +_0811C886: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0811C8E8 + movs r0, 0x2 + bl sub_811D9CC + b _0811C8A8 +_0811C898: + bl sub_811DAA4 + lsls r0, 24 + cmp r0, 0 + bne _0811C8E8 + movs r0, 0x2 + bl sub_811D698 +_0811C8A8: + ldr r0, =0x0203a11c + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811C8E8 + .pool +_0811C8B8: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0811C8E8 + bl sub_811E288 + movs r0, 0x1 + bl sub_811E6E0 + bl sub_811E64C + bl sub_811E794 + ldr r0, =0x0203a11c + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811C8DE: + movs r0, 0 + b _0811C8EA + .pool +_0811C8E8: + movs r0, 0x1 +_0811C8EA: + pop {r1} + bx r1 + thumb_func_end sub_811C830 + + thumb_func_start sub_811C8F0 +sub_811C8F0: @ 811C8F0 + push {lr} + ldr r0, =0x0203a11c + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0x5 + bhi _0811C994 + lsls r0, 2 + ldr r1, =_0811C910 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0811C910: + .4byte _0811C928 + .4byte _0811C92E + .4byte _0811C940 + .4byte _0811C952 + .4byte _0811C974 + .4byte _0811C98C +_0811C928: + bl sub_811D2C8 + b _0811C962 +_0811C92E: + bl sub_811E380 + bl sub_811E6B0 + bl sub_811E7F8 + bl sub_811D9B4 + b _0811C962 +_0811C940: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0811C994 + movs r0, 0x3 + bl sub_811D9CC + b _0811C962 +_0811C952: + bl sub_811DAA4 + lsls r0, 24 + cmp r0, 0 + bne _0811C994 + movs r0, 0 + bl ShowBg +_0811C962: + ldr r0, =0x0203a11c + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811C994 + .pool +_0811C974: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0811C994 + bl sub_811DFB0 + ldr r0, =0x0203a11c + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811C98C: + movs r0, 0 + b _0811C996 + .pool +_0811C994: + movs r0, 0x1 +_0811C996: + pop {r1} + bx r1 + thumb_func_end sub_811C8F0 + + thumb_func_start sub_811C99C +sub_811C99C: @ 811C99C + push {lr} + ldr r0, =0x0203a11c + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0x6 + bhi _0811CA54 + lsls r0, 2 + ldr r1, =_0811C9BC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0811C9BC: + .4byte _0811C9D8 + .4byte _0811C9DE + .4byte _0811C9F0 + .4byte _0811CA02 + .4byte _0811CA14 + .4byte _0811CA34 + .4byte _0811CA4C +_0811C9D8: + bl sub_811D2C8 + b _0811CA24 +_0811C9DE: + bl sub_811E380 + bl sub_811E6B0 + bl sub_811E7F8 + bl sub_811D9B4 + b _0811CA24 +_0811C9F0: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0811CA54 + movs r0, 0x3 + bl sub_811D9CC + b _0811CA24 +_0811CA02: + bl sub_811DAA4 + lsls r0, 24 + cmp r0, 0 + bne _0811CA54 + movs r0, 0x3 + bl sub_811D104 + b _0811CA24 +_0811CA14: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0811CA54 + movs r0, 0 + bl ShowBg +_0811CA24: + ldr r0, =0x0203a11c + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CA54 + .pool +_0811CA34: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0811CA54 + bl sub_811DFB0 + ldr r0, =0x0203a11c + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811CA4C: + movs r0, 0 + b _0811CA56 + .pool +_0811CA54: + movs r0, 0x1 +_0811CA56: + pop {r1} + bx r1 + thumb_func_end sub_811C99C + + thumb_func_start sub_811CA5C +sub_811CA5C: @ 811CA5C + push {lr} + ldr r0, =0x0203a11c + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0x4 + bhi _0811CB10 + lsls r0, 2 + ldr r1, =_0811CA7C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0811CA7C: + .4byte _0811CA90 + .4byte _0811CAA2 + .4byte _0811CAB4 + .4byte _0811CAC4 + .4byte _0811CAE4 +_0811CA90: + bl sub_811E380 + bl sub_811E6B0 + bl sub_811E7F8 + bl sub_811D9B4 + b _0811CAD2 +_0811CAA2: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0811CB10 + movs r0, 0x4 + bl sub_811D9CC + b _0811CAD2 +_0811CAB4: + bl sub_811DAA4 + lsls r0, 24 + cmp r0, 0 + bne _0811CB10 + bl sub_811D6D4 + b _0811CAD2 +_0811CAC4: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0811CB10 + bl sub_811E3AC +_0811CAD2: + ldr r0, =0x0203a11c + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CB10 + .pool +_0811CAE4: + bl sub_811E418 + lsls r0, 24 + cmp r0, 0 + bne _0811CB10 + bl sub_811DFC8 + movs r0, 0 + bl sub_811E6E0 + bl sub_811E64C + ldr r0, =0x0203a11c + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + movs r0, 0 + b _0811CB12 + .pool +_0811CB10: + movs r0, 0x1 +_0811CB12: + pop {r1} + bx r1 + thumb_func_end sub_811CA5C + + thumb_func_start sub_811CB18 +sub_811CB18: @ 811CB18 + push {lr} + bl sub_811E30C + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_811CB18 + + thumb_func_start sub_811CB24 +sub_811CB24: @ 811CB24 + push {r4,lr} + ldr r4, =0x0203a11c + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0x1 + beq _0811CB50 + cmp r0, 0x1 + bgt _0811CB40 + cmp r0, 0 + beq _0811CB4A + b _0811CB8E + .pool +_0811CB40: + cmp r0, 0x2 + beq _0811CB6C + cmp r0, 0x3 + beq _0811CB8A + b _0811CB8E +_0811CB4A: + bl sub_811D7A4 + b _0811CB62 +_0811CB50: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0811CB8E + movs r0, 0x1 + movs r1, 0x4 + bl sub_811DDAC +_0811CB62: + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CB8E +_0811CB6C: + bl sub_811DE10 + lsls r0, 24 + cmp r0, 0 + bne _0811CB8E + bl sub_811E30C + bl sub_811E64C + bl sub_811E794 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811CB8A: + movs r0, 0 + b _0811CB90 +_0811CB8E: + movs r0, 0x1 +_0811CB90: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811CB24 + + thumb_func_start sub_811CB98 +sub_811CB98: @ 811CB98 + push {r4,lr} + ldr r4, =0x0203a11c + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0x1 + beq _0811CBC4 + cmp r0, 0x1 + bgt _0811CBB4 + cmp r0, 0 + beq _0811CBBE + b _0811CC00 + .pool +_0811CBB4: + cmp r0, 0x2 + beq _0811CBE2 + cmp r0, 0x3 + beq _0811CBFC + b _0811CC00 +_0811CBBE: + bl sub_811D7C8 + b _0811CBD8 +_0811CBC4: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0811CC00 + movs r0, 0x1 + negs r0, r0 + movs r1, 0x4 + bl sub_811DDAC +_0811CBD8: + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CC00 +_0811CBE2: + bl sub_811DE10 + lsls r0, 24 + cmp r0, 0 + bne _0811CC00 + bl sub_811E64C + bl sub_811E794 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811CBFC: + movs r0, 0 + b _0811CC02 +_0811CC00: + movs r0, 0x1 +_0811CC02: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811CB98 + + thumb_func_start sub_811CC08 +sub_811CC08: @ 811CC08 + push {r4,r5,lr} + ldr r5, =0x0203a11c + ldr r0, [r5] + ldrh r0, [r0] + cmp r0, 0x1 + beq _0811CC34 + cmp r0, 0x1 + bgt _0811CC24 + cmp r0, 0 + beq _0811CC2E + b _0811CC86 + .pool +_0811CC24: + cmp r0, 0x2 + beq _0811CC64 + cmp r0, 0x3 + beq _0811CC82 + b _0811CC86 +_0811CC2E: + bl sub_811D7EC + b _0811CC5A +_0811CC34: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0811CC86 + bl sub_811BBDC + adds r4, r0, 0 + bl sub_811DE48 + lsls r4, 24 + lsrs r4, 24 + subs r4, r0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + movs r1, 0x8 + bl sub_811DDAC +_0811CC5A: + ldr r1, [r5] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CC86 +_0811CC64: + bl sub_811DE10 + lsls r0, 24 + cmp r0, 0 + bne _0811CC86 + bl sub_811E30C + bl sub_811E64C + bl sub_811E794 + ldr r1, [r5] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811CC82: + movs r0, 0 + b _0811CC88 +_0811CC86: + movs r0, 0x1 +_0811CC88: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_811CC08 + + thumb_func_start sub_811CC90 +sub_811CC90: @ 811CC90 + push {r4,r5,lr} + ldr r5, =0x0203a11c + ldr r0, [r5] + ldrh r0, [r0] + cmp r0, 0x1 + beq _0811CCBC + cmp r0, 0x1 + bgt _0811CCAC + cmp r0, 0 + beq _0811CCB6 + b _0811CD0A + .pool +_0811CCAC: + cmp r0, 0x2 + beq _0811CCEC + cmp r0, 0x3 + beq _0811CD06 + b _0811CD0A +_0811CCB6: + bl sub_811D830 + b _0811CCE2 +_0811CCBC: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0811CD0A + bl sub_811BBDC + adds r4, r0, 0 + bl sub_811DE48 + lsls r4, 24 + lsrs r4, 24 + subs r4, r0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + movs r1, 0x8 + bl sub_811DDAC +_0811CCE2: + ldr r1, [r5] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CD0A +_0811CCEC: + bl sub_811DE10 + lsls r0, 24 + cmp r0, 0 + bne _0811CD0A + bl sub_811E64C + bl sub_811E794 + ldr r1, [r5] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0811CD06: + movs r0, 0 + b _0811CD0C +_0811CD0A: + movs r0, 0x1 +_0811CD0C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_811CC90 + + thumb_func_start sub_811CD14 +sub_811CD14: @ 811CD14 + push {r4,lr} + ldr r4, =0x0203a11c + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811CD2C + cmp r0, 0x1 + beq _0811CD40 + b _0811CD4A + .pool +_0811CD2C: + bl sub_811DF90 + movs r0, 0x4 + bl sub_811D104 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CD4A +_0811CD40: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + b _0811CD4C +_0811CD4A: + movs r0, 0x1 +_0811CD4C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811CD14 + + thumb_func_start sub_811CD54 +sub_811CD54: @ 811CD54 + push {r4,lr} + ldr r4, =0x0203a11c + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811CD6C + cmp r0, 0x1 + beq _0811CD80 + b _0811CD8A + .pool +_0811CD6C: + bl sub_811DF90 + movs r0, 0x5 + bl sub_811D104 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CD8A +_0811CD80: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + b _0811CD8C +_0811CD8A: + movs r0, 0x1 +_0811CD8C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811CD54 + + thumb_func_start sub_811CD94 +sub_811CD94: @ 811CD94 + push {r4,lr} + ldr r4, =0x0203a11c + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811CDAC + cmp r0, 0x1 + beq _0811CDC0 + b _0811CDCA + .pool +_0811CDAC: + bl sub_811DF90 + movs r0, 0x6 + bl sub_811D104 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CDCA +_0811CDC0: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + b _0811CDCC +_0811CDCA: + movs r0, 0x1 +_0811CDCC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811CD94 + + thumb_func_start sub_811CDD4 +sub_811CDD4: @ 811CDD4 + push {r4,lr} + ldr r4, =0x0203a11c + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811CDEC + cmp r0, 0x1 + beq _0811CE00 + b _0811CE0A + .pool +_0811CDEC: + bl sub_811DF90 + movs r0, 0x7 + bl sub_811D104 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CE0A +_0811CE00: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + b _0811CE0C +_0811CE0A: + movs r0, 0x1 +_0811CE0C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811CDD4 + + thumb_func_start sub_811CE14 +sub_811CE14: @ 811CE14 + push {r4,lr} + ldr r4, =0x0203a11c + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811CE2C + cmp r0, 0x1 + beq _0811CE40 + b _0811CE4A + .pool +_0811CE2C: + bl sub_811DF90 + movs r0, 0x8 + bl sub_811D104 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CE4A +_0811CE40: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + b _0811CE4C +_0811CE4A: + movs r0, 0x1 +_0811CE4C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811CE14 + + thumb_func_start sub_811CE54 +sub_811CE54: @ 811CE54 + push {r4,lr} + ldr r4, =0x0203a11c + ldr r0, [r4] + ldrh r0, [r0] + cmp r0, 0 + beq _0811CE6C + cmp r0, 0x1 + beq _0811CE80 + b _0811CE8A + .pool +_0811CE6C: + bl sub_811DF90 + movs r0, 0x9 + bl sub_811D104 + ldr r1, [r4] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0811CE8A +_0811CE80: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + b _0811CE8C +_0811CE8A: + movs r0, 0x1 +_0811CE8C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811CE54 + + thumb_func_start sub_811CE94 +sub_811CE94: @ 811CE94 + push {r4,lr} + ldr r4, =0x0203a11c + movs r0, 0x98 + lsls r0, 5 + bl Alloc + adds r2, r0, 0 + str r2, [r4] + cmp r2, 0 + beq _0811CEFC + movs r1, 0 + strh r1, [r2] + movs r3, 0xB6 + lsls r3, 2 + adds r0, r2, r3 + str r1, [r0] + adds r3, 0x4 + adds r0, r2, r3 + str r1, [r0] + adds r3, 0x4 + adds r0, r2, r3 + str r1, [r0] + adds r3, 0x4 + adds r0, r2, r3 + str r1, [r0] + adds r3, 0x4 + adds r0, r2, r3 + str r1, [r0] + adds r3, 0x4 + adds r0, r2, r3 + str r1, [r0] + adds r3, 0x4 + adds r0, r2, r3 + str r1, [r0] + adds r3, 0x4 + adds r0, r2, r3 + str r1, [r0] + adds r3, 0x4 + adds r0, r2, r3 + str r1, [r0] + adds r3, 0x4 + adds r0, r2, r3 + str r1, [r0] + bl sub_811BC70 + ldr r1, [r4] + strb r0, [r1, 0xA] + movs r0, 0x1 + b _0811CEFE + .pool +_0811CEFC: + movs r0, 0 +_0811CEFE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811CE94 + + thumb_func_start sub_811CF04 +sub_811CF04: @ 811CF04 + push {lr} + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x3 + 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, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r1, 0xC1 + lsls r1, 6 + movs r0, 0 + bl SetGpuReg + pop {r0} + bx r0 + thumb_func_end sub_811CF04 + + thumb_func_start sub_811CF64 +sub_811CF64: @ 811CF64 + push {r4,lr} + bl sub_80A1A74 + ldr r0, =gUnknown_08DCBDB0 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_08597B14 + movs r1, 0x10 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_08597B34 + movs r1, 0x40 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_08597C1C + movs r1, 0xA0 + movs r2, 0x8 + bl gpu_pal_apply + ldr r4, =gUnknown_08597C24 + adds r0, r4, 0 + movs r1, 0xB0 + movs r2, 0xC + bl gpu_pal_apply + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xC + bl gpu_pal_apply + adds r0, r4, 0 + movs r1, 0x30 + movs r2, 0xC + bl gpu_pal_apply + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811CF64 + + thumb_func_start sub_811CFCC +sub_811CFCC: @ 811CFCC + push {r4,r5,lr} + sub sp, 0x14 + bl sub_811BA88 + adds r5, r0, 0 + cmp r5, 0 + beq _0811D020 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x90 + bl GetStringCenterAlignXOffset + adds r4, r0, 0 + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r0, 0x2 + str r0, [sp, 0xC] + movs r0, 0x3 + str r0, [sp, 0x10] + movs r0, 0 + movs r1, 0x1 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_811D058 + movs r0, 0 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram +_0811D020: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_811CFCC + + thumb_func_start sub_811D028 +sub_811D028: @ 811D028 + push {r4-r6,lr} + sub sp, 0xC + ldr r4, [sp, 0x1C] + ldr r5, [sp, 0x20] + ldr r6, [sp, 0x24] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + 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] + str r6, [sp, 0x8] + bl Print + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_811D028 + + thumb_func_start sub_811D058 +sub_811D058: @ 811D058 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + mov r9, r3 + ldr r3, [sp, 0x30] + ldr r4, [sp, 0x34] + mov r8, r4 + ldr r7, [sp, 0x38] + mov r10, r7 + ldr r5, [sp, 0x3C] + ldr r6, [sp, 0x40] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r4, r9 + lsls r4, 24 + lsrs r4, 24 + mov r9, r4 + lsls r3, 24 + lsrs r3, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + add r4, sp, 0xC + mov r7, r10 + strb r7, [r4] + strb r5, [r4, 0x1] + strb r6, [r4, 0x2] + str r4, [sp] + mov r4, r8 + lsls r4, 24 + asrs r4, 24 + str r4, [sp, 0x4] + str r2, [sp, 0x8] + mov r2, r9 + bl box_print + 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_811D058 + + thumb_func_start sub_811D0BC +sub_811D0BC: @ 811D0BC + push {lr} + sub sp, 0xC + movs r0, 0x20 + str r0, [sp] + movs r0, 0x14 + 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 + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0xE0 + bl sub_809882C + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0xE + bl sub_8098858 + movs r0, 0 + bl sub_811D104 + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0xC + pop {r0} + bx r0 + thumb_func_end sub_811D0BC + + thumb_func_start sub_811D104 +sub_811D104: @ 811D104 + push {lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0 + str r0, [sp, 0x10] + str r0, [sp, 0xC] + cmp r1, 0x9 + bhi _0811D1BC + lsls r0, r1, 2 + ldr r1, =_0811D124 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0811D124: + .4byte _0811D14C + .4byte _0811D16A + .4byte _0811D156 + .4byte _0811D160 + .4byte _0811D174 + .4byte _0811D180 + .4byte _0811D18C + .4byte _0811D19C + .4byte _0811D1A8 + .4byte _0811D1B4 +_0811D14C: + add r1, sp, 0x10 + add r0, sp, 0xC + bl sub_811BAD0 + b _0811D1BC +_0811D156: + add r1, sp, 0x10 + add r0, sp, 0xC + bl sub_811BB40 + b _0811D1BC +_0811D160: + add r1, sp, 0x10 + add r0, sp, 0xC + bl sub_811BB08 + b _0811D1BC +_0811D16A: + add r1, sp, 0x10 + add r0, sp, 0xC + bl sub_811BB88 + b _0811D1BC +_0811D174: + ldr r0, =gUnknown_085EC743 + str r0, [sp, 0xC] + b _0811D1BC + .pool +_0811D180: + ldr r0, =gUnknown_085EC752 + str r0, [sp, 0xC] + b _0811D1BC + .pool +_0811D18C: + ldr r0, =gUnknown_085EC4C9 + str r0, [sp, 0xC] + ldr r0, =gUnknown_085EC4E9 + b _0811D1BA + .pool +_0811D19C: + ldr r0, =gUnknown_085EC765 + str r0, [sp, 0xC] + b _0811D1BC + .pool +_0811D1A8: + ldr r0, =gUnknown_085EC520 + str r0, [sp, 0xC] + b _0811D1BC + .pool +_0811D1B4: + ldr r0, =gUnknown_085EC672 + str r0, [sp, 0xC] + ldr r0, =gUnknown_085EC688 +_0811D1BA: + str r0, [sp, 0x10] +_0811D1BC: + movs r0, 0x1 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, [sp, 0xC] + cmp r2, 0 + beq _0811D1E0 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0 + bl sub_811D028 +_0811D1E0: + ldr r2, [sp, 0x10] + cmp r2, 0 + beq _0811D1FC + movs r0, 0x11 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0 + bl sub_811D028 +_0811D1FC: + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0x14 + pop {r0} + bx r0 + .pool + thumb_func_end sub_811D104 + + thumb_func_start sub_811D214 +sub_811D214: @ 811D214 + push {lr} + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =gUnknown_08597C84 + movs r1, 0x1 + movs r2, 0xE + bl CreateYesNoMenu + pop {r0} + bx r0 + .pool + thumb_func_end sub_811D214 + + thumb_func_start sub_811D230 +sub_811D230: @ 811D230 + push {r4-r6,lr} + sub sp, 0x8 + bl sub_811BA68 + lsls r0, 24 + ldr r6, =0xffffff00 + ldr r4, [sp] + ands r4, r6 + movs r1, 0x3 + orrs r4, r1 + str r4, [sp] + ldr r1, =gUnknown_08597C30 + lsrs r0, 22 + adds r0, r1 + ldrb r3, [r0] + lsls r1, r3, 27 + lsrs r1, 19 + ldr r5, =0xffff00ff + adds r2, r5, 0 + ands r2, r4 + orrs r2, r1 + lsrs r3, 5 + lsls r3, 16 + ldr r1, =0xff00ffff + ands r2, r1 + orrs r2, r3 + str r2, [sp] + ldrb r3, [r0, 0x1] + lsls r3, 24 + ldr r1, =0x00ffffff + ands r1, r2 + orrs r1, r3 + str r1, [sp] + ldrb r1, [r0, 0x2] + ldr r0, [sp, 0x4] + ands r0, r6 + orrs r0, r1 + ands r0, r5 + movs r1, 0xB0 + lsls r1, 4 + orrs r0, r1 + ldr r1, =0x0000ffff + ands r0, r1 + movs r1, 0xD8 + lsls r1, 15 + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl AddWindow + ldr r1, =0x0203a11c + ldr r1, [r1] + strh r0, [r1, 0x2] + lsls r0, 24 + lsrs r0, 24 + bl PutWindowTilemap + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811D230 + + thumb_func_start sub_811D2C8 +sub_811D2C8: @ 811D2C8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + bl sub_811BA94 + adds r4, r0, 0 + bl sub_811BAAC + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + bl sub_811BAA0 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + bl sub_811BA68 + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0 + mov r8, r0 + cmp r6, 0x7 + bne _0811D302 + movs r1, 0x1 + mov r8, r1 +_0811D302: + ldr r0, =0x0203a11c + ldr r0, [r0] + ldrb r0, [r0, 0x2] + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r7, 0 + ldr r0, [sp, 0x14] + cmp r7, r0 + bge _0811D402 +_0811D316: + add r0, sp, 0xC + ldr r1, =gUnknown_08597C8C + movs r2, 0x4 + bl memcpy + mov r1, r8 + cmp r1, 0 + beq _0811D32C + add r1, sp, 0xC + movs r0, 0x6 + strb r0, [r1, 0x2] +_0811D32C: + ldr r0, =0x0203a11c + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0xB + movs r0, 0xFF + strb r0, [r1, 0xB] + adds r0, r2, 0 + add r1, sp, 0xC + bl AppendString + adds r2, r0, 0 + movs r5, 0 + lsls r0, r7, 4 + mov r9, r0 + adds r1, r7, 0x1 + mov r10, r1 + b _0811D3CE + .pool +_0811D358: + ldrh r0, [r4] + ldr r1, =0x0000ffff + cmp r0, r1 + beq _0811D374 + adds r1, r0, 0 + adds r0, r2, 0 + bl CopyEasyChatWord + adds r2, r0, 0 + adds r4, 0x2 + b _0811D3A2 + .pool +_0811D374: + adds r4, 0x2 + mov r0, r8 + cmp r0, 0 + bne _0811D3A8 + adds r0, r2, 0 + movs r1, 0 + movs r2, 0x4 + bl WriteColorChangeControlCode + adds r2, r0, 0 + movs r1, 0xAE + movs r0, 0xB +_0811D38C: + strb r1, [r2] + adds r2, 0x1 + subs r0, 0x1 + cmp r0, 0 + bge _0811D38C + adds r0, r2, 0 + movs r1, 0 + movs r2, 0x2 + bl WriteColorChangeControlCode + adds r2, r0, 0 +_0811D3A2: + mov r1, r8 + cmp r1, 0 + beq _0811D3AE +_0811D3A8: + add r1, sp, 0xC + movs r0, 0x3 + strb r0, [r1, 0x2] +_0811D3AE: + adds r0, r2, 0 + add r1, sp, 0xC + bl AppendString + adds r2, r0, 0 + cmp r6, 0x2 + beq _0811D3C4 + cmp r6, 0x7 + beq _0811D3C4 + cmp r6, 0x8 + bne _0811D3CC +_0811D3C4: + cmp r5, 0 + bne _0811D3CC + cmp r7, 0x4 + beq _0811D3D4 +_0811D3CC: + adds r5, 0x1 +_0811D3CE: + ldr r0, [sp, 0x10] + cmp r5, r0 + blt _0811D358 +_0811D3D4: + movs r0, 0xFF + strb r0, [r2] + ldr r0, =0x0203a11c + ldr r2, [r0] + ldrb r0, [r2, 0x2] + adds r2, 0xB + mov r1, r9 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl sub_811D028 + mov r7, r10 + ldr r1, [sp, 0x14] + cmp r7, r1 + blt _0811D316 +_0811D402: + ldr r0, =0x0203a11c + ldr r0, [r0] + ldrb r0, [r0, 0x2] + movs r1, 0x3 + bl CopyWindowToVram + 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_811D2C8 + + thumb_func_start sub_811D424 +sub_811D424: @ 811D424 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r0 + bl sub_811BA68 + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0 + str r0, [sp] + ldr r2, =0x01000200 + mov r0, sp + mov r1, r8 + bl CpuFastSet + cmp r6, 0x2 + beq _0811D450 + cmp r6, 0x8 + bne _0811D4D4 +_0811D450: + ldr r0, =gUnknown_08597C30 + lsls r2, r6, 2 + adds r2, r0 + ldrb r1, [r2] + lsls r3, r1, 27 + lsrs r0, r3, 27 + ldrb r4, [r2, 0x1] + adds r5, r0, r4 + lsls r1, 24 + lsrs r0, r1, 29 + ldrb r2, [r2, 0x2] + adds r2, r0 + mov r12, r2 + adds r6, r0, 0 + cmp r6, r12 + blt _0811D472 + b _0811D5D6 +_0811D472: + mov r9, r3 +_0811D474: + mov r0, r9 + lsrs r3, r0, 27 + subs r7, r3, 0x1 + lsls r2, r6, 5 + adds r0, r2, r7 + lsls r0, 1 + add r0, r8 + ldr r4, =0x00001005 + adds r1, r4, 0 + strh r1, [r0] + adds r7, r3, 0 + adds r3, r2, 0 + adds r4, r6, 0x1 + cmp r7, r5 + bge _0811D4AE + movs r0, 0x80 + lsls r0, 5 + adds r2, r0, 0 + lsls r1, r7, 1 + lsls r0, r6, 6 + add r0, r8 + adds r0, r1, r0 + subs r7, r5, r7 +_0811D4A2: + strh r2, [r0] + adds r0, 0x2 + subs r7, 0x1 + cmp r7, 0 + bne _0811D4A2 + adds r7, r5, 0 +_0811D4AE: + adds r0, r3, r7 + lsls r0, 1 + add r0, r8 + ldr r2, =0x00001007 + adds r1, r2, 0 + strh r1, [r0] + adds r6, r4, 0 + cmp r6, r12 + blt _0811D474 + b _0811D5D6 + .pool +_0811D4D4: + ldr r4, =gUnknown_08597C30 + mov r10, r4 + lsls r6, 2 + mov r9, r6 + mov r3, r9 + add r3, r10 + ldrb r0, [r3] + lsls r2, r0, 24 + lsrs r1, r2, 29 + subs r6, r1, 0x1 + lsls r0, 27 + lsrs r4, r0, 27 + subs r7, r4, 0x1 + adds r0, r4, 0 + ldrb r1, [r3, 0x1] + adds r5, r0, r1 + lsrs r2, 29 + ldrb r3, [r3, 0x2] + adds r3, r2 + mov r12, r3 + lsls r0, r6, 5 + adds r0, r7 + lsls r0, 1 + add r0, r8 + ldr r2, =0x00001001 + adds r1, r2, 0 + strh r1, [r0] + adds r7, r4, 0 + cmp r7, r5 + bge _0811D52A + ldr r4, =0x00001002 + adds r2, r4, 0 + lsls r1, r7, 1 + lsls r0, r6, 6 + add r0, r8 + adds r1, r0 + subs r7, r5, r7 +_0811D51E: + strh r2, [r1] + adds r1, 0x2 + subs r7, 0x1 + cmp r7, 0 + bne _0811D51E + adds r7, r5, 0 +_0811D52A: + lsls r0, r6, 5 + adds r0, r7 + lsls r0, 1 + add r0, r8 + ldr r2, =0x00001003 + adds r1, r2, 0 + strh r1, [r0] + adds r6, 0x1 + cmp r6, r12 + bge _0811D590 + ldr r0, =gUnknown_08597C30 + add r0, r9 + ldrb r0, [r0] + lsls r3, r0, 27 +_0811D546: + lsrs r0, r3, 27 + subs r7, r0, 0x1 + lsls r1, r6, 5 + adds r1, r7 + lsls r1, 1 + add r1, r8 + ldr r4, =0x00001005 + adds r2, r4, 0 + strh r2, [r1] + adds r7, r0, 0 + adds r4, r6, 0x1 + cmp r7, r5 + bge _0811D57C + movs r0, 0x80 + lsls r0, 5 + adds r2, r0, 0 + lsls r1, r7, 1 + lsls r0, r6, 6 + add r0, r8 + adds r1, r0 + subs r7, r5, r7 +_0811D570: + strh r2, [r1] + adds r1, 0x2 + subs r7, 0x1 + cmp r7, 0 + bne _0811D570 + adds r7, r5, 0 +_0811D57C: + lsls r0, r6, 5 + adds r0, r7 + lsls r0, 1 + add r0, r8 + ldr r2, =0x00001007 + adds r1, r2, 0 + strh r1, [r0] + adds r6, r4, 0 + cmp r6, r12 + blt _0811D546 +_0811D590: + mov r0, r9 + add r0, r10 + ldrb r2, [r0] + lsls r2, 27 + lsrs r2, 27 + subs r7, r2, 0x1 + lsls r3, r6, 5 + adds r0, r3, r7 + lsls r0, 1 + add r0, r8 + ldr r4, =0x00001009 + adds r1, r4, 0 + strh r1, [r0] + adds r7, r2, 0 + cmp r7, r5 + bge _0811D5CA + ldr r0, =0x0000100a + adds r2, r0, 0 + lsls r1, r7, 1 + lsls r0, r6, 6 + add r0, r8 + adds r0, r1, r0 + subs r7, r5, r7 +_0811D5BE: + strh r2, [r0] + adds r0, 0x2 + subs r7, 0x1 + cmp r7, 0 + bne _0811D5BE + adds r7, r5, 0 +_0811D5CA: + adds r0, r3, r7 + lsls r0, 1 + add r0, r8 + ldr r2, =0x0000100b + adds r1, r2, 0 + strh r1, [r0] +_0811D5D6: + 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_811D424 + + thumb_func_start sub_811D60C +sub_811D60C: @ 811D60C + push {r4,lr} + sub sp, 0x8 + movs r0, 0x3 + bl GetBgTilemapBuffer + adds r4, r0, 0 + bl sub_811BA68 + lsls r0, 24 + ldr r1, =gUnknown_08597C30 + lsrs r0, 22 + adds r0, r1 + ldrb r1, [r0, 0x3] + cmp r1, 0x2 + beq _0811D63E + cmp r1, 0x2 + bgt _0811D638 + cmp r1, 0x1 + beq _0811D64C + b _0811D67C + .pool +_0811D638: + cmp r1, 0x3 + beq _0811D668 + b _0811D67C +_0811D63E: + movs r0, 0xA8 + lsls r0, 3 + adds r4, r0 + movs r0, 0x20 + str r0, [sp] + str r1, [sp, 0x4] + b _0811D65A +_0811D64C: + movs r0, 0xC0 + lsls r0, 3 + adds r4, r0 + movs r0, 0x20 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] +_0811D65A: + movs r0, 0x3 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0xB + bl CopyToBgTilemapBufferRect + b _0811D67C +_0811D668: + movs r0, 0x20 + str r0, [sp] + movs r0, 0x4 + str r0, [sp, 0x4] + movs r0, 0x3 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0xA + bl CopyToBgTilemapBufferRect +_0811D67C: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811D60C + + thumb_func_start sub_811D684 +sub_811D684: @ 811D684 + push {lr} + movs r0, 0x2 + bl PutWindowTilemap + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + pop {r0} + bx r0 + thumb_func_end sub_811D684 + + thumb_func_start sub_811D698 +sub_811D698: @ 811D698 + push {r4,lr} + adds r4, r0, 0 + bl sub_811DD84 + movs r0, 0x2 + movs r1, 0x11 + bl FillWindowPixelBuffer + cmp r4, 0x1 + beq _0811D6BC + cmp r4, 0x1 + bcc _0811D6B6 + cmp r4, 0x2 + beq _0811D6C2 + b _0811D6C6 +_0811D6B6: + bl sub_811D6F4 + b _0811D6C6 +_0811D6BC: + bl sub_811D758 + b _0811D6C6 +_0811D6C2: + bl sub_811D794 +_0811D6C6: + movs r0, 0x2 + movs r1, 0x2 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811D698 + + thumb_func_start sub_811D6D4 +sub_811D6D4: @ 811D6D4 + push {lr} + bl sub_811BBB0 + lsls r0, 24 + cmp r0, 0 + bne _0811D6E8 + movs r0, 0 + bl sub_811D698 + b _0811D6EE +_0811D6E8: + movs r0, 0x1 + bl sub_811D698 +_0811D6EE: + pop {r0} + bx r0 + thumb_func_end sub_811D6D4 + + thumb_func_start sub_811D6F4 +sub_811D6F4: @ 811D6F4 + push {r4-r7,lr} + sub sp, 0xC + movs r5, 0 + movs r7, 0x61 +_0811D6FC: + movs r4, 0 + lsls r0, r7, 24 + lsrs r6, r0, 24 +_0811D702: + lsls r0, r5, 24 + lsrs r0, 24 + adds r5, 0x1 + bl sub_811F3B8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x16 + beq _0811D742 + bl sub_811F424 + adds r2, r0, 0 + movs r0, 0x54 + adds r3, r4, 0 + muls r3, r0 + adds r3, 0xA + lsls r3, 24 + lsrs r3, 24 + str r6, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + bl sub_811D028 + adds r4, 0x1 + cmp r4, 0x1 + ble _0811D702 + adds r7, 0x10 + b _0811D6FC +_0811D742: + bl sub_811BBBC + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_811DDAC + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_811D6F4 + + thumb_func_start sub_811D758 +sub_811D758: @ 811D758 + push {r4-r6,lr} + sub sp, 0xC + movs r5, 0 + movs r4, 0xC2 + lsls r4, 23 + ldr r6, =gUnknown_08597C90 +_0811D764: + ldm r6!, {r2} + lsrs r0, r4, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0xA + bl sub_811D028 + movs r0, 0x80 + lsls r0, 21 + adds r4, r0 + adds r5, 0x1 + cmp r5, 0x3 + bls _0811D764 + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811D758 + + thumb_func_start sub_811D794 +sub_811D794: @ 811D794 + push {lr} + movs r0, 0 + movs r1, 0x4 + bl sub_811D864 + pop {r0} + bx r0 + thumb_func_end sub_811D794 + + thumb_func_start sub_811D7A4 +sub_811D7A4: @ 811D7A4 + push {r4,lr} + bl sub_811BBDC + adds r4, r0, 0 + adds r4, 0x3 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_811D950 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_811D864 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811D7A4 + + thumb_func_start sub_811D7C8 +sub_811D7C8: @ 811D7C8 + push {r4,lr} + bl sub_811BBDC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_811D950 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_811D864 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811D7C8 + + thumb_func_start sub_811D7EC +sub_811D7EC: @ 811D7EC + push {r4,r5,lr} + bl sub_811BBDC + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + adds r0, r5, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_811BBE8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bls _0811D80E + adds r4, r0, 0 +_0811D80E: + cmp r5, r4 + bcs _0811D828 + subs r4, r5 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_811D950 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_811D864 +_0811D828: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_811D7EC + + thumb_func_start sub_811D830 +sub_811D830: @ 811D830 + push {r4,r5,lr} + bl sub_811BBDC + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_811DE48 + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bcs _0811D85C + subs r4, r0, r5 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_811D950 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_811D864 +_0811D85C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_811D830 + + thumb_func_start sub_811D864 +sub_811D864: @ 811D864 + 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 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x14] + lsls r1, r0, 1 + mov r8, r1 + lsls r0, 4 + adds r1, r0, 0 + adds r1, 0x60 + movs r0, 0xFF + ands r1, r0 + adds r1, 0x1 + movs r0, 0 + b _0811D930 +_0811D88E: + movs r6, 0 + movs r2, 0x10 + adds r2, r1 + mov r9, r2 + adds r0, 0x1 + mov r10, r0 + lsls r0, r1, 24 + lsrs r7, r0, 24 +_0811D89E: + mov r1, r8 + lsls r0, r1, 16 + lsrs r0, 16 + movs r2, 0x1 + add r8, r2 + bl sub_811F578 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x0000ffff + cmp r4, r0 + beq _0811D926 + ldr r5, =0x0203a11c + ldr r0, [r5] + adds r0, 0xCC + adds r1, r4, 0 + movs r2, 0 + bl CopyEasyChatWordPadded + adds r0, r4, 0 + bl sub_811BF88 + adds r1, r0, 0 + cmp r1, 0 + bne _0811D8FC + ldr r2, [r5] + adds r2, 0xCC + movs r0, 0xD + adds r3, r6, 0 + muls r3, r0 + adds r3, 0x3 + lsls r3, 27 + lsrs r3, 24 + str r7, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + str r1, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + bl sub_811D028 + b _0811D926 + .pool +_0811D8FC: + ldr r2, [r5] + adds r2, 0xCC + movs r0, 0xD + adds r3, r6, 0 + muls r3, r0 + adds r3, 0x3 + lsls r3, 27 + lsrs r3, 24 + str r7, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x5 + str r0, [sp, 0xC] + movs r0, 0x3 + str r0, [sp, 0x10] + movs r0, 0x2 + movs r1, 0x1 + bl sub_811D058 +_0811D926: + adds r6, 0x1 + cmp r6, 0x1 + ble _0811D89E + mov r1, r9 + mov r0, r10 +_0811D930: + ldr r2, [sp, 0x14] + cmp r0, r2 + blt _0811D88E + movs r0, 0x2 + 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_811D864 + + thumb_func_start sub_811D950 +sub_811D950: @ 811D950 + push {r4,r5,lr} + sub sp, 0x8 + lsls r0, 24 + lsls r1, 24 + lsrs r0, 20 + adds r3, r0, 0 + adds r3, 0x60 + movs r0, 0xFF + ands r3, r0 + lsrs r0, r1, 20 + adds r1, r3, r0 + cmp r1, 0xFF + ble _0811D97C + ldr r0, =0xffffff00 + adds r4, r1, r0 + movs r0, 0x80 + lsls r0, 1 + subs r0, r3 + b _0811D97E + .pool +_0811D97C: + movs r4, 0 +_0811D97E: + movs r5, 0xE0 + str r5, [sp] + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x4] + movs r0, 0x2 + movs r1, 0x11 + movs r2, 0 + bl FillWindowPixelRect + cmp r4, 0 + beq _0811D9AA + str r5, [sp] + lsls r0, r4, 16 + lsrs r0, 16 + str r0, [sp, 0x4] + movs r0, 0x2 + movs r1, 0x11 + movs r2, 0 + movs r3, 0 + bl FillWindowPixelRect +_0811D9AA: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_811D950 + + thumb_func_start sub_811D9B4 +sub_811D9B4: @ 811D9B4 + push {lr} + movs r0, 0x2 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0x2 + movs r1, 0x2 + bl CopyWindowToVram + pop {r0} + bx r0 + thumb_func_end sub_811D9B4 + + thumb_func_start sub_811D9CC +sub_811D9CC: @ 811D9CC + push {lr} + ldr r1, =0x0203a11c + cmp r0, 0x6 + bhi _0811DA86 + lsls r0, 2 + ldr r1, =_0811D9E8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0811D9E8: + .4byte _0811DA04 + .4byte _0811DA18 + .4byte _0811DA28 + .4byte _0811DA3C + .4byte _0811DA50 + .4byte _0811DA64 + .4byte _0811DA78 +_0811DA04: + ldr r1, =0x0203a11c + ldr r2, [r1] + movs r0, 0 + strb r0, [r2, 0x6] + ldr r2, [r1] + movs r0, 0xA + b _0811DA84 + .pool +_0811DA18: + ldr r1, =0x0203a11c + ldr r2, [r1] + movs r3, 0 + movs r0, 0x9 + b _0811DA44 + .pool +_0811DA28: + ldr r1, =0x0203a11c + ldr r2, [r1] + movs r0, 0xB + strb r0, [r2, 0x6] + ldr r2, [r1] + movs r0, 0x11 + b _0811DA84 + .pool +_0811DA3C: + ldr r1, =0x0203a11c + ldr r2, [r1] + movs r3, 0 + movs r0, 0x11 +_0811DA44: + strb r0, [r2, 0x6] + ldr r0, [r1] + strb r3, [r0, 0x7] + b _0811DA86 + .pool +_0811DA50: + ldr r1, =0x0203a11c + ldr r2, [r1] + movs r0, 0x11 + strb r0, [r2, 0x6] + ldr r2, [r1] + movs r0, 0xA + b _0811DA84 + .pool +_0811DA64: + ldr r1, =0x0203a11c + ldr r2, [r1] + movs r0, 0x12 + strb r0, [r2, 0x6] + ldr r2, [r1] + movs r0, 0x16 + b _0811DA84 + .pool +_0811DA78: + ldr r1, =0x0203a11c + ldr r2, [r1] + movs r0, 0x16 + strb r0, [r2, 0x6] + ldr r2, [r1] + movs r0, 0x12 +_0811DA84: + strb r0, [r2, 0x7] +_0811DA86: + ldr r1, [r1] + ldrb r0, [r1, 0x6] + movs r3, 0x1 + negs r3, r3 + adds r2, r3, 0 + ldrb r3, [r1, 0x7] + cmp r0, r3 + bcs _0811DA98 + movs r2, 0x1 +_0811DA98: + strb r2, [r1, 0x8] + pop {r0} + bx r0 + .pool + thumb_func_end sub_811D9CC + + thumb_func_start sub_811DAA4 +sub_811DAA4: @ 811DAA4 + push {r4,lr} + ldr r4, =0x0203a11c + ldr r1, [r4] + ldrb r2, [r1, 0x6] + ldrb r0, [r1, 0x7] + cmp r2, r0 + beq _0811DAD4 + ldrb r0, [r1, 0x8] + adds r0, r2, r0 + strb r0, [r1, 0x6] + ldr r0, [r4] + ldrb r0, [r0, 0x6] + bl sub_811DADC + ldr r0, [r4] + ldrb r1, [r0, 0x6] + ldrb r0, [r0, 0x7] + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + b _0811DAD6 + .pool +_0811DAD4: + movs r0, 0 +_0811DAD6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811DAA4 + + thumb_func_start sub_811DADC +sub_811DADC: @ 811DADC + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x1E + str r0, [sp] + movs r0, 0xA + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0xA + bl FillBgTilemapBufferRect_Palette0 + cmp r4, 0x16 + bls _0811DAFE + b _0811DC1A +_0811DAFE: + lsls r0, r4, 2 + ldr r1, =_0811DB0C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0811DB0C: + .4byte _0811DC1A + .4byte _0811DB68 + .4byte _0811DB70 + .4byte _0811DB78 + .4byte _0811DB80 + .4byte _0811DB88 + .4byte _0811DB90 + .4byte _0811DC00 + .4byte _0811DBF2 + .4byte _0811DBE4 + .4byte _0811DBD6 + .4byte _0811DB9E + .4byte _0811DBA6 + .4byte _0811DBAE + .4byte _0811DBB6 + .4byte _0811DBBE + .4byte _0811DBC6 + .4byte _0811DBCE + .4byte _0811DBD6 + .4byte _0811DBE4 + .4byte _0811DBF2 + .4byte _0811DC00 + .4byte _0811DC0E +_0811DB68: + movs r0, 0xB + movs r1, 0xE + movs r2, 0x3 + b _0811DB96 +_0811DB70: + movs r0, 0x9 + movs r1, 0xE + movs r2, 0x7 + b _0811DB96 +_0811DB78: + movs r0, 0x7 + movs r1, 0xE + movs r2, 0xB + b _0811DB96 +_0811DB80: + movs r0, 0x5 + movs r1, 0xE + movs r2, 0xF + b _0811DB96 +_0811DB88: + movs r0, 0x3 + movs r1, 0xE + movs r2, 0x13 + b _0811DB96 +_0811DB90: + movs r0, 0x1 + movs r1, 0xE + movs r2, 0x17 +_0811DB96: + movs r3, 0x2 + bl sub_811DC28 + b _0811DC1A +_0811DB9E: + movs r0, 0x1 + movs r1, 0xA + movs r2, 0x18 + b _0811DBDC +_0811DBA6: + movs r0, 0x1 + movs r1, 0xA + movs r2, 0x19 + b _0811DBDC +_0811DBAE: + movs r0, 0x1 + movs r1, 0xA + movs r2, 0x1A + b _0811DBDC +_0811DBB6: + movs r0, 0x1 + movs r1, 0xA + movs r2, 0x1B + b _0811DBDC +_0811DBBE: + movs r0, 0x1 + movs r1, 0xA + movs r2, 0x1C + b _0811DBDC +_0811DBC6: + movs r0, 0x1 + movs r1, 0xA + movs r2, 0x1D + b _0811DBDC +_0811DBCE: + movs r0, 0 + movs r1, 0xA + movs r2, 0x1E + b _0811DBDC +_0811DBD6: + movs r0, 0x1 + movs r1, 0xA + movs r2, 0x17 +_0811DBDC: + movs r3, 0xA + bl sub_811DC28 + b _0811DC1A +_0811DBE4: + movs r0, 0x1 + movs r1, 0xB + movs r2, 0x17 + movs r3, 0x8 + bl sub_811DC28 + b _0811DC1A +_0811DBF2: + movs r0, 0x1 + movs r1, 0xC + movs r2, 0x17 + movs r3, 0x6 + bl sub_811DC28 + b _0811DC1A +_0811DC00: + movs r0, 0x1 + movs r1, 0xD + movs r2, 0x17 + movs r3, 0x4 + bl sub_811DC28 + b _0811DC1A +_0811DC0E: + movs r0, 0x1 + movs r1, 0xE + movs r2, 0x17 + movs r3, 0x2 + bl sub_811DC28 +_0811DC1A: + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811DADC + + thumb_func_start sub_811DC28 +sub_811DC28: @ 811DC28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r12, r0 + adds r7, r1, 0 + mov r9, r2 + mov r10, r3 + ldr r0, =0x0203a11c + ldr r0, [r0] + movs r1, 0xC0 + lsls r1, 2 + adds r6, r0, r1 + mov r0, r12 + add r0, r9 + subs r5, r0, 0x1 + adds r0, r7, r3 + subs r0, 0x1 + mov r8, r0 + mov r2, r12 + adds r3, r7, 0 + lsls r0, r3, 5 + adds r0, r2 + lsls r0, 1 + adds r0, r6 + ldr r4, =0x00004001 + adds r1, r4, 0 + strh r1, [r0] + adds r2, 0x1 + cmp r2, r5 + bge _0811DC84 + ldr r0, =0x00004002 + adds r4, r0, 0 + lsls r1, r2, 1 + lsls r0, r3, 6 + adds r0, r6 + adds r1, r0 + subs r2, r5, r2 +_0811DC78: + strh r4, [r1] + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bne _0811DC78 + adds r2, r5, 0 +_0811DC84: + lsls r0, r3, 5 + adds r0, r2 + lsls r0, 1 + adds r0, r6 + ldr r2, =0x00004003 + adds r1, r2, 0 + strh r1, [r0] + adds r3, 0x1 + mov r4, r12 + adds r4, 0x1 + adds r0, r7, 0x1 + str r0, [sp, 0x4] + mov r1, r9 + subs r1, 0x2 + str r1, [sp] + movs r2, 0x2 + negs r2, r2 + add r10, r2 + cmp r3, r8 + bge _0811DCF4 + lsls r7, r4, 1 + mov r9, r7 +_0811DCB0: + lsls r0, r3, 5 + add r0, r12 + lsls r0, 1 + adds r0, r6 + ldr r2, =0x00004005 + adds r1, r2, 0 + strh r1, [r0] + adds r2, r4, 0 + adds r7, r3, 0x1 + cmp r4, r5 + bge _0811DCE0 + movs r0, 0x80 + lsls r0, 7 + adds r1, r0, 0 + lsls r0, r3, 6 + adds r0, r6 + add r0, r9 + subs r2, r5, r4 +_0811DCD4: + strh r1, [r0] + adds r0, 0x2 + subs r2, 0x1 + cmp r2, 0 + bne _0811DCD4 + adds r2, r5, 0 +_0811DCE0: + lsls r0, r3, 5 + adds r0, r2 + lsls r0, 1 + adds r0, r6 + ldr r2, =0x00004007 + adds r1, r2, 0 + strh r1, [r0] + adds r3, r7, 0 + cmp r3, r8 + blt _0811DCB0 +_0811DCF4: + lsls r0, r3, 5 + mov r7, r12 + adds r1, r0, r7 + lsls r1, 1 + adds r1, r6 + ldr r7, =0x00004009 + adds r2, r7, 0 + strh r2, [r1] + adds r2, r4, 0 + mov r12, r0 + cmp r4, r5 + bge _0811DD26 + ldr r0, =0x0000400a + adds r7, r0, 0 + lsls r1, r4, 1 + lsls r0, r3, 6 + adds r0, r6 + adds r0, r1, r0 + subs r2, r5, r4 +_0811DD1A: + strh r7, [r0] + adds r0, 0x2 + subs r2, 0x1 + cmp r2, 0 + bne _0811DD1A + adds r2, r5, 0 +_0811DD26: + mov r1, r12 + adds r0, r1, r2 + lsls r0, 1 + adds r0, r6 + ldr r2, =0x0000400b + adds r1, r2, 0 + strh r1, [r0] + lsls r0, r4, 27 + lsrs r0, 24 + ldr r3, [sp, 0x4] + lsls r1, r3, 27 + lsrs r1, 24 + ldr r4, [sp] + lsls r2, r4, 27 + lsrs r2, 24 + mov r7, r10 + lsls r3, r7, 27 + lsrs r3, 24 + bl sub_811DE5C + 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_811DC28 + + thumb_func_start sub_811DD84 +sub_811DD84: @ 811DD84 + push {lr} + movs r1, 0x80 + lsls r1, 4 + movs r0, 0x2 + movs r2, 0 + bl ChangeBgY + ldr r0, =0x0203a11c + ldr r0, [r0] + ldr r1, =0x000002ce + adds r0, r1 + movs r1, 0 + strh r1, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end sub_811DD84 + + thumb_func_start sub_811DDAC +sub_811DDAC: @ 811DDAC + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r1, 24 + lsrs r5, r1, 24 + movs r0, 0x2 + bl GetBgY + adds r2, r0, 0 + ldr r0, =0x0203a11c + ldr r3, [r0] + ldr r0, =0x000002ce + adds r1, r3, r0 + ldrh r0, [r1] + adds r0, r4 + strh r0, [r1] + lsls r4, 20 + asrs r4, 16 + lsls r0, r4, 8 + adds r2, r0 + cmp r5, 0 + beq _0811DE00 + movs r1, 0xB4 + lsls r1, 2 + adds r0, r3, r1 + str r2, [r0] + movs r0, 0xB5 + lsls r0, 2 + adds r1, r3, r0 + lsls r0, r5, 8 + str r0, [r1] + cmp r4, 0 + bge _0811DE0A + negs r0, r0 + str r0, [r1] + b _0811DE0A + .pool +_0811DE00: + movs r0, 0x2 + adds r1, r2, 0 + movs r2, 0 + bl ChangeBgY +_0811DE0A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_811DDAC + + thumb_func_start sub_811DE10 +sub_811DE10: @ 811DE10 + push {lr} + movs r0, 0x2 + bl GetBgY + ldr r1, =0x0203a11c + ldr r2, [r1] + movs r3, 0xB4 + lsls r3, 2 + adds r1, r2, r3 + ldr r1, [r1] + cmp r0, r1 + beq _0811DE40 + movs r1, 0xB5 + lsls r1, 2 + adds r0, r2, r1 + ldr r1, [r0] + movs r0, 0x2 + movs r2, 0x1 + bl ChangeBgY + movs r0, 0x1 + b _0811DE42 + .pool +_0811DE40: + movs r0, 0 +_0811DE42: + pop {r1} + bx r1 + thumb_func_end sub_811DE10 + + thumb_func_start sub_811DE48 +sub_811DE48: @ 811DE48 + ldr r0, =0x0203a11c + ldr r0, [r0] + ldr r1, =0x000002ce + adds r0, r1 + ldrh r0, [r0] + bx lr + .pool + thumb_func_end sub_811DE48 + + thumb_func_start sub_811DE5C +sub_811DE5C: @ 811DE5C + push {r4,r5,lr} + 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, r0, 8 + adds r0, r2 + orrs r4, r0 + lsls r5, r1, 8 + adds r1, r3 + orrs r5, r1 + movs r0, 0x40 + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x44 + adds r1, r5, 0 + bl SetGpuReg + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_811DE5C + + thumb_func_start sub_811DE90 +sub_811DE90: @ 811DE90 + push {r4,r5,lr} + ldr r0, =gUnknown_08597CA0 + bl LoadObjectPics + ldr r0, =gUnknown_08597CC0 + bl LoadTaggedObjectPalettes + movs r5, 0 + ldr r4, =gUnknown_08597CE8 +_0811DEA2: + adds r0, r4, 0 + bl LoadCompressedObjectPic + adds r4, 0x8 + adds r5, 0x1 + cmp r5, 0x3 + bls _0811DEA2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811DE90 + + thumb_func_start sub_811DEC4 +sub_811DEC4: @ 811DEC4 + push {lr} + bl sub_811BA68 + lsls r0, 24 + ldr r1, =gUnknown_08597C30 + lsrs r0, 22 + adds r0, r1 + ldrb r2, [r0] + lsls r1, r2, 27 + lsrs r1, 8 + lsrs r2, 5 + lsls r2, 19 + ldr r0, =gUnknown_08597D18 + movs r3, 0xD0 + lsls r3, 12 + adds r1, r3 + asrs r1, 16 + movs r3, 0x80 + lsls r3, 12 + adds r2, r3 + asrs r2, 16 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0203a11c + ldr r2, [r1] + movs r1, 0xB6 + lsls r1, 2 + adds r2, r1 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + str r1, [r2] + movs r0, 0x1 + strh r0, [r1, 0x30] + pop {r0} + bx r0 + .pool + thumb_func_end sub_811DEC4 + + thumb_func_start sub_811DF28 +sub_811DF28: @ 811DF28 + push {lr} + adds r1, r0, 0 + movs r2, 0x30 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _0811DF56 + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _0811DF56 + movs r0, 0 + strh r0, [r1, 0x2E] + ldrh r0, [r1, 0x24] + adds r0, 0x1 + strh r0, [r1, 0x24] + lsls r0, 16 + cmp r0, 0 + ble _0811DF56 + ldr r0, =0x0000fffa + strh r0, [r1, 0x24] +_0811DF56: + pop {r0} + bx r0 + .pool + thumb_func_end sub_811DF28 + + thumb_func_start sub_811DF60 +sub_811DF60: @ 811DF60 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x0203a11c + ldr r2, [r2] + movs r3, 0xB6 + lsls r3, 2 + adds r2, r3 + ldr r3, [r2] + movs r4, 0 + strh r0, [r3, 0x20] + ldr r0, [r2] + strh r1, [r0, 0x22] + ldr r0, [r2] + strh r4, [r0, 0x24] + ldr r0, [r2] + strh r4, [r0, 0x2E] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811DF60 + + thumb_func_start sub_811DF90 +sub_811DF90: @ 811DF90 + ldr r0, =0x0203a11c + ldr r1, [r0] + movs r0, 0xB6 + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + movs r2, 0 + strh r2, [r0, 0x2E] + ldr r0, [r1] + strh r2, [r0, 0x30] + ldr r0, [r1] + strh r2, [r0, 0x24] + bx lr + .pool + thumb_func_end sub_811DF90 + + thumb_func_start sub_811DFB0 +sub_811DFB0: @ 811DFB0 + ldr r0, =0x0203a11c + ldr r0, [r0] + movs r1, 0xB6 + lsls r1, 2 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x1 + strh r0, [r1, 0x30] + bx lr + .pool + thumb_func_end sub_811DFB0 + + thumb_func_start sub_811DFC8 +sub_811DFC8: @ 811DFC8 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r6, =gUnknown_08597D68 + adds r0, r6, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x3 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r5, =0x0203a11c + ldr r2, [r5] + movs r1, 0xB7 + lsls r1, 2 + mov r8, r1 + add r2, r8 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r4, =0x02020630 + adds r1, r4 + str r1, [r2] + movs r0, 0x20 + strh r0, [r1, 0x24] + adds r0, r6, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x3 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r2, [r5] + movs r1, 0xB8 + lsls r1, 2 + adds r3, r2, r1 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + str r1, [r3] + ldr r0, =0x0000ffe0 + strh r0, [r1, 0x24] + add r2, r8 + ldr r1, [r2] + adds r1, 0x3F + ldrb r0, [r1] + movs r2, 0x1 + orrs r0, r2 + strb r0, [r1] + bl sub_811E088 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811DFC8 + + thumb_func_start sub_811E050 +sub_811E050: @ 811E050 + push {r4-r6,lr} + ldr r5, =0x0203a11c + ldr r0, [r5] + movs r4, 0xB7 + lsls r4, 2 + adds r0, r4 + ldr r0, [r0] + bl RemoveObjectAndFreeTiles + ldr r0, [r5] + adds r4, r0, r4 + movs r6, 0 + str r6, [r4] + movs r4, 0xB8 + lsls r4, 2 + adds r0, r4 + ldr r0, [r0] + bl RemoveObjectAndFreeTiles + ldr r0, [r5] + adds r0, r4 + str r6, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811E050 + + thumb_func_start sub_811E088 +sub_811E088: @ 811E088 + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x0203a11c + ldr r1, [r0] + movs r2, 0xB7 + lsls r2, 2 + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, 0 + beq _0811E0E4 + adds r2, 0x4 + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, 0 + beq _0811E0E4 + mov r4, sp + adds r4, 0x1 + mov r0, sp + adds r1, r4, 0 + bl sub_811BB9C + bl sub_811BBB0 + lsls r0, 24 + cmp r0, 0 + bne _0811E0D4 + mov r0, sp + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + movs r1, 0 + ldrsb r1, [r4, r1] + bl sub_811E0EC + b _0811E0E4 + .pool +_0811E0D4: + mov r0, sp + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + movs r1, 0 + ldrsb r1, [r4, r1] + bl sub_811E1A4 +_0811E0E4: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811E088 + + thumb_func_start sub_811E0EC +sub_811E0EC: @ 811E0EC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r1, 24 + lsrs r7, r1, 24 + lsls r0, 24 + asrs r5, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + beq _0811E150 + ldr r0, =0x0203a11c + mov r8, r0 + ldr r0, [r0] + movs r4, 0xB7 + lsls r4, 2 + adds r0, r4 + ldr r0, [r0] + movs r1, 0 + bl StartObjectImageAnim + mov r2, r8 + ldr r1, [r2] + adds r4, r1, r4 + ldr r2, [r4] + movs r0, 0x54 + muls r5, r0 + adds r5, 0x3A + strh r5, [r2, 0x20] + ldr r0, [r4] + lsls r4, r7, 24 + asrs r4, 20 + adds r4, 0x60 + strh r4, [r0, 0x22] + movs r6, 0xB8 + lsls r6, 2 + adds r1, r6 + ldr r0, [r1] + movs r1, 0 + bl StartObjectImageAnim + mov r1, r8 + ldr r0, [r1] + adds r0, r6 + ldr r1, [r0] + strh r5, [r1, 0x20] + b _0811E192 + .pool +_0811E150: + ldr r6, =0x0203a11c + ldr r0, [r6] + movs r4, 0xB7 + lsls r4, 2 + adds r0, r4 + ldr r0, [r0] + movs r1, 0x1 + bl StartObjectImageAnim + ldr r1, [r6] + adds r4, r1, r4 + ldr r0, [r4] + movs r2, 0xD8 + mov r8, r2 + mov r2, r8 + strh r2, [r0, 0x20] + ldr r0, [r4] + lsls r4, r7, 24 + asrs r4, 20 + adds r4, 0x70 + strh r4, [r0, 0x22] + movs r5, 0xB8 + lsls r5, 2 + adds r1, r5 + ldr r0, [r1] + movs r1, 0x1 + bl StartObjectImageAnim + ldr r0, [r6] + adds r0, r5 + ldr r1, [r0] + mov r2, r8 + strh r2, [r1, 0x20] +_0811E192: + ldr r0, [r0] + strh r4, [r0, 0x22] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811E0EC + + thumb_func_start sub_811E1A4 +sub_811E1A4: @ 811E1A4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsrs r4, r0, 24 + asrs r2, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _0811E234 + lsls r0, r5, 24 + asrs r1, r0, 24 + lsls r0, r1, 4 + adds r0, 0x60 + mov r8, r0 + movs r7, 0x20 + cmp r2, 0x6 + bne _0811E1D6 + cmp r1, 0 + bne _0811E1D6 + movs r7, 0x9E + movs r6, 0x2 + b _0811E1EC +_0811E1D6: + ldr r3, =gUnknown_08597D08 + lsls r1, r4, 24 + lsrs r0, r1, 24 + movs r2, 0 + cmp r0, 0x6 + bhi _0811E1E4 + asrs r2, r1, 24 +_0811E1E4: + adds r0, r2, r3 + ldrb r0, [r0] + adds r7, r0 + movs r6, 0x3 +_0811E1EC: + ldr r5, =0x0203a11c + ldr r0, [r5] + movs r4, 0xB7 + lsls r4, 2 + adds r0, r4 + ldr r0, [r0] + adds r1, r6, 0 + bl StartObjectImageAnim + ldr r1, [r5] + adds r4, r1, r4 + ldr r0, [r4] + strh r7, [r0, 0x20] + ldr r0, [r4] + mov r2, r8 + strh r2, [r0, 0x22] + movs r4, 0xB8 + lsls r4, 2 + adds r1, r4 + ldr r0, [r1] + adds r1, r6, 0 + bl StartObjectImageAnim + ldr r0, [r5] + adds r0, r4 + ldr r1, [r0] + strh r7, [r1, 0x20] + ldr r0, [r0] + mov r1, r8 + strh r1, [r0, 0x22] + b _0811E27A + .pool +_0811E234: + ldr r6, =0x0203a11c + ldr r0, [r6] + movs r4, 0xB7 + lsls r4, 2 + adds r0, r4 + ldr r0, [r0] + movs r1, 0x1 + bl StartObjectImageAnim + ldr r1, [r6] + adds r4, r1, r4 + ldr r0, [r4] + movs r2, 0xD8 + mov r8, r2 + mov r2, r8 + strh r2, [r0, 0x20] + ldr r0, [r4] + lsls r4, r5, 24 + asrs r4, 20 + adds r4, 0x70 + strh r4, [r0, 0x22] + movs r5, 0xB8 + lsls r5, 2 + adds r1, r5 + ldr r0, [r1] + movs r1, 0x1 + bl StartObjectImageAnim + ldr r0, [r6] + adds r0, r5 + ldr r1, [r0] + mov r2, r8 + strh r2, [r1, 0x20] + ldr r0, [r0] + strh r4, [r0, 0x22] +_0811E27A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811E1A4 + + thumb_func_start sub_811E288 +sub_811E288: @ 811E288 + push {lr} + ldr r0, =gUnknown_08597D18 + movs r1, 0 + movs r2, 0 + movs r3, 0x4 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0203a11c + ldr r2, [r1] + movs r1, 0xB9 + lsls r1, 2 + adds r2, r1 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + str r1, [r2] + ldr r0, =sub_811E2DC + str r0, [r1, 0x1C] + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1, 0x5] + bl sub_811E30C + pop {r0} + bx r0 + .pool + thumb_func_end sub_811E288 + + thumb_func_start sub_811E2DC +sub_811E2DC: @ 811E2DC + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _0811E302 + movs r0, 0 + strh r0, [r1, 0x2E] + ldrh r0, [r1, 0x24] + adds r0, 0x1 + strh r0, [r1, 0x24] + lsls r0, 16 + cmp r0, 0 + ble _0811E302 + ldr r0, =0x0000fffa + strh r0, [r1, 0x24] +_0811E302: + pop {r0} + bx r0 + .pool + thumb_func_end sub_811E2DC + + thumb_func_start sub_811E30C +sub_811E30C: @ 811E30C + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x1 + mov r0, sp + adds r1, r4, 0 + bl sub_811BBC8 + mov r0, sp + movs r1, 0 + ldrsb r1, [r0, r1] + movs r0, 0xD + muls r0, r1 + lsls r0, 27 + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r1, 28 + movs r2, 0xE0 + lsls r2, 21 + adds r0, r2 + lsrs r0, 24 + movs r2, 0xC0 + lsls r2, 23 + adds r1, r2 + lsrs r1, 24 + bl sub_811E34C + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_811E30C + + thumb_func_start sub_811E34C +sub_811E34C: @ 811E34C + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r0, =0x0203a11c + ldr r0, [r0] + movs r1, 0xB9 + lsls r1, 2 + adds r2, r0, r1 + ldr r0, [r2] + cmp r0, 0 + beq _0811E376 + movs r1, 0 + strh r3, [r0, 0x20] + ldr r0, [r2] + strh r4, [r0, 0x22] + ldr r0, [r2] + strh r1, [r0, 0x24] + ldr r0, [r2] + strh r1, [r0, 0x2E] +_0811E376: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811E34C + + thumb_func_start sub_811E380 +sub_811E380: @ 811E380 + push {r4,lr} + ldr r4, =0x0203a11c + ldr r0, [r4] + movs r1, 0xB9 + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _0811E3A2 + bl RemoveObjectAndFreeTiles + ldr r0, [r4] + movs r1, 0xB9 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + str r1, [r0] +_0811E3A2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811E380 + + thumb_func_start sub_811E3AC +sub_811E3AC: @ 811E3AC + push {r4-r6,lr} + ldr r0, =gUnknown_08597DF0 + movs r1, 0xD0 + movs r2, 0x80 + movs r3, 0x6 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r5, =0x0203a11c + ldr r2, [r5] + movs r1, 0xBA + lsls r1, 2 + adds r2, r1 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r4, =0x02020630 + adds r1, r4 + str r1, [r2] + movs r6, 0 + ldr r0, =0x0000ffc0 + strh r0, [r1, 0x24] + ldr r0, =gUnknown_08597DD0 + movs r1, 0xD0 + movs r2, 0x50 + movs r3, 0x5 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r2, [r5] + movs r1, 0xBB + lsls r1, 2 + adds r3, r2, r1 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + str r1, [r3] + strb r6, [r2, 0x9] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811E3AC + + thumb_func_start sub_811E418 +sub_811E418: @ 811E418 + push {r4,lr} + ldr r4, =0x0203a11c + ldr r2, [r4] + ldrb r3, [r2, 0x9] + cmp r3, 0 + beq _0811E430 + cmp r3, 0x1 + beq _0811E488 + movs r0, 0 + b _0811E4A6 + .pool +_0811E430: + movs r0, 0xBA + lsls r0, 2 + adds r2, r0 + ldr r1, [r2] + ldrh r0, [r1, 0x24] + adds r0, 0x8 + strh r0, [r1, 0x24] + ldr r2, [r2] + movs r1, 0x24 + ldrsh r0, [r2, r1] + cmp r0, 0 + blt _0811E4A4 + strh r3, [r2, 0x24] + bl sub_811BBB0 + lsls r0, 24 + cmp r0, 0 + bne _0811E466 + ldr r0, [r4] + movs r1, 0xBB + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x1 + bl StartObjectImageAnim + b _0811E476 +_0811E466: + ldr r0, [r4] + movs r1, 0xBB + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x2 + bl StartObjectImageAnim +_0811E476: + ldr r0, =0x0203a11c + ldr r1, [r0] + ldrb r0, [r1, 0x9] + adds r0, 0x1 + strb r0, [r1, 0x9] + b _0811E4A4 + .pool +_0811E488: + movs r1, 0xBB + lsls r1, 2 + adds r0, r2, r1 + ldr r0, [r0] + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0811E4A4 + movs r0, 0x2 + strb r0, [r2, 0x9] + movs r0, 0 + b _0811E4A6 +_0811E4A4: + movs r0, 0x1 +_0811E4A6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811E418 + + thumb_func_start sub_811E4AC +sub_811E4AC: @ 811E4AC + push {lr} + ldr r2, =0x0203a11c + ldr r1, [r2] + movs r0, 0 + strb r0, [r1, 0x9] + ldr r0, [r2] + movs r1, 0xBB + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x3 + bl StartObjectImageAnim + pop {r0} + bx r0 + .pool + thumb_func_end sub_811E4AC + + thumb_func_start sub_811E4D0 +sub_811E4D0: @ 811E4D0 + push {r4-r6,lr} + ldr r5, =0x0203a11c + ldr r3, [r5] + ldrb r0, [r3, 0x9] + cmp r0, 0 + beq _0811E4E8 + cmp r0, 0x1 + beq _0811E502 + movs r0, 0 + b _0811E554 + .pool +_0811E4E8: + movs r1, 0xBB + lsls r1, 2 + adds r0, r3, r1 + ldr r0, [r0] + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0811E552 + movs r0, 0x1 + strb r0, [r3, 0x9] + b _0811E552 +_0811E502: + movs r0, 0xBA + lsls r0, 2 + adds r2, r3, r0 + ldr r1, [r2] + ldrh r0, [r1, 0x24] + subs r0, 0x8 + movs r6, 0 + strh r0, [r1, 0x24] + ldr r0, [r2] + movs r2, 0x24 + ldrsh r1, [r0, r2] + movs r0, 0x40 + negs r0, r0 + cmp r1, r0 + bgt _0811E552 + movs r4, 0xBB + lsls r4, 2 + adds r0, r3, r4 + ldr r0, [r0] + bl RemoveObjectAndFreeTiles + ldr r0, [r5] + movs r1, 0xBA + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + bl RemoveObjectAndFreeTiles + ldr r1, [r5] + adds r4, r1, r4 + str r6, [r4] + movs r2, 0xBA + lsls r2, 2 + adds r0, r1, r2 + str r6, [r0] + ldrb r0, [r1, 0x9] + adds r0, 0x1 + strb r0, [r1, 0x9] + movs r0, 0 + b _0811E554 +_0811E552: + movs r0, 0x1 +_0811E554: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_811E4D0 + + thumb_func_start sub_811E55C +sub_811E55C: @ 811E55C + push {lr} + ldr r0, =0x0203a11c + ldr r0, [r0] + movs r1, 0xBB + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x4 + bl StartObjectImageAnim + pop {r0} + bx r0 + .pool + thumb_func_end sub_811E55C + + thumb_func_start sub_811E578 +sub_811E578: @ 811E578 + push {lr} + bl sub_811BBB0 + lsls r0, 24 + cmp r0, 0 + bne _0811E59C + ldr r0, =0x0203a11c + ldr r0, [r0] + movs r1, 0xBB + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x1 + bl StartObjectImageAnim + b _0811E5AE + .pool +_0811E59C: + ldr r0, =0x0203a11c + ldr r0, [r0] + movs r1, 0xBB + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x2 + bl StartObjectImageAnim +_0811E5AE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_811E578 + + thumb_func_start sub_811E5B8 +sub_811E5B8: @ 811E5B8 + ldr r0, =0x0203a11c + ldr r0, [r0] + movs r1, 0xBB + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + adds r0, 0x3F + ldrb r1, [r0] + lsrs r1, 4 + movs r0, 0x1 + bics r0, r1 + bx lr + .pool + thumb_func_end sub_811E5B8 + + thumb_func_start sub_811E5D4 +sub_811E5D4: @ 811E5D4 + push {r4,lr} + ldr r4, =gUnknown_08597E48 + adds r0, r4, 0 + movs r1, 0x60 + movs r2, 0x50 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _0811E602 + ldr r0, =0x0203a11c + ldr r2, [r0] + movs r0, 0xBC + lsls r0, 2 + adds r2, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + str r0, [r2] +_0811E602: + adds r0, r4, 0 + movs r1, 0x60 + movs r2, 0x9C + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _0811E636 + ldr r0, =0x0203a11c + ldr r2, [r0] + movs r0, 0xBD + lsls r0, 2 + adds r2, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + str r0, [r2] + adds r0, 0x3F + ldrb r1, [r0] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0] +_0811E636: + bl sub_811E6B0 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811E5D4 + + thumb_func_start sub_811E64C +sub_811E64C: @ 811E64C + push {r4-r6,lr} + bl sub_811BBF8 + ldr r6, =0x0203a11c + ldr r1, [r6] + movs r2, 0xBC + lsls r2, 2 + adds r1, r2 + ldr r1, [r1] + movs r2, 0 + cmp r0, 0 + bne _0811E666 + movs r2, 0x1 +_0811E666: + adds r3, r1, 0 + adds r3, 0x3E + movs r4, 0x1 + lsls r2, 2 + ldrb r1, [r3] + movs r5, 0x5 + negs r5, r5 + adds r0, r5, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3] + bl sub_811BC2C + ldr r1, [r6] + movs r2, 0xBD + lsls r2, 2 + adds r1, r2 + ldr r1, [r1] + movs r2, 0 + cmp r0, 0 + bne _0811E692 + movs r2, 0x1 +_0811E692: + adds r3, r1, 0 + adds r3, 0x3E + adds r1, r4, 0 + ands r1, r2 + lsls r1, 2 + ldrb r2, [r3] + adds r0, r5, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811E64C + + thumb_func_start sub_811E6B0 +sub_811E6B0: @ 811E6B0 + ldr r3, =0x0203a11c + ldr r0, [r3] + movs r1, 0xBC + lsls r1, 2 + adds r0, r1 + ldr r1, [r0] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldr r0, [r3] + movs r1, 0xBD + lsls r1, 2 + adds r0, r1 + ldr r1, [r0] + adds r1, 0x3E + ldrb r0, [r1] + orrs r0, r2 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_811E6B0 + + thumb_func_start sub_811E6E0 +sub_811E6E0: @ 811E6E0 + push {lr} + cmp r0, 0 + bne _0811E6FC + ldr r0, =0x0203a11c + ldr r2, [r0] + movs r1, 0xBC + lsls r1, 2 + adds r0, r2, r1 + ldr r0, [r0] + movs r1, 0x60 + b _0811E70A + .pool +_0811E6FC: + ldr r0, =0x0203a11c + ldr r2, [r0] + movs r1, 0xBC + lsls r1, 2 + adds r0, r2, r1 + ldr r0, [r0] + movs r1, 0x78 +_0811E70A: + strh r1, [r0, 0x20] + movs r3, 0xBD + lsls r3, 2 + adds r0, r2, r3 + ldr r0, [r0] + strh r1, [r0, 0x20] + pop {r0} + bx r0 + .pool + thumb_func_end sub_811E6E0 + + thumb_func_start sub_811E720 +sub_811E720: @ 811E720 + push {r4,lr} + ldr r4, =gUnknown_08597E30 + adds r0, r4, 0 + movs r1, 0xDC + movs r2, 0x54 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _0811E74E + ldr r0, =0x0203a11c + ldr r2, [r0] + movs r0, 0xBE + lsls r0, 2 + adds r2, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + str r0, [r2] +_0811E74E: + adds r0, r4, 0 + movs r1, 0xDC + movs r2, 0x9C + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _0811E77E + ldr r0, =0x0203a11c + ldr r2, [r0] + movs r0, 0xBF + lsls r0, 2 + adds r2, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + str r0, [r2] + movs r1, 0x1 + bl StartObjectImageAnim +_0811E77E: + bl sub_811E7F8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811E720 + + thumb_func_start sub_811E794 +sub_811E794: @ 811E794 + push {r4-r6,lr} + bl sub_811BBF8 + ldr r6, =0x0203a11c + ldr r1, [r6] + movs r2, 0xBE + lsls r2, 2 + adds r1, r2 + ldr r1, [r1] + movs r2, 0 + cmp r0, 0 + bne _0811E7AE + movs r2, 0x1 +_0811E7AE: + adds r3, r1, 0 + adds r3, 0x3E + movs r4, 0x1 + lsls r2, 2 + ldrb r1, [r3] + movs r5, 0x5 + negs r5, r5 + adds r0, r5, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3] + bl sub_811BC2C + ldr r1, [r6] + movs r2, 0xBF + lsls r2, 2 + adds r1, r2 + ldr r1, [r1] + movs r2, 0 + cmp r0, 0 + bne _0811E7DA + movs r2, 0x1 +_0811E7DA: + adds r3, r1, 0 + adds r3, 0x3E + adds r1, r4, 0 + ands r1, r2 + lsls r1, 2 + ldrb r2, [r3] + adds r0, r5, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811E794 + + thumb_func_start sub_811E7F8 +sub_811E7F8: @ 811E7F8 + ldr r3, =0x0203a11c + ldr r0, [r3] + movs r1, 0xBE + lsls r1, 2 + adds r0, r1 + ldr r1, [r0] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldr r0, [r3] + movs r1, 0xBF + lsls r1, 2 + adds r0, r1 + ldr r1, [r0] + adds r1, 0x3E + ldrb r0, [r1] + orrs r0, r2 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_811E7F8 + + thumb_func_start sub_811E828 +sub_811E828: @ 811E828 + push {r4,r5,lr} + sub sp, 0x4 + bl sub_811BCBC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0811E84C + cmp r0, 0x1 + bgt _0811E842 + cmp r0, 0 + beq _0811E848 + b _0811E8D0 +_0811E842: + cmp r0, 0x2 + beq _0811E850 + b _0811E8D0 +_0811E848: + movs r4, 0x43 + b _0811E852 +_0811E84C: + movs r4, 0x44 + b _0811E852 +_0811E850: + movs r4, 0x7 +_0811E852: + bl sub_811BA68 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _0811E8D0 + adds r0, r4, 0 + ldr r5, =DummyObjectCallback + movs r4, 0 + str r4, [sp] + adds r1, r5, 0 + movs r2, 0x4C + movs r3, 0x28 + bl AddPseudoFieldObject + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _0811E892 + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + strb r1, [r0, 0x5] + movs r1, 0x2 + bl StartObjectImageAnim +_0811E892: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + movs r1, 0x69 + cmp r0, 0 + bne _0811E8A0 + movs r1, 0x64 +_0811E8A0: + str r4, [sp] + adds r0, r1, 0 + adds r1, r5, 0 + movs r2, 0x34 + movs r3, 0x28 + bl AddPseudoFieldObject + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _0811E8D0 + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + strb r1, [r0, 0x5] + movs r1, 0x3 + bl StartObjectImageAnim +_0811E8D0: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811E828 + + thumb_func_start sub_811E8E4 +sub_811E8E4: @ 811E8E4 + push {lr} + bl sub_811BA68 + lsls r0, 24 + ldr r1, =gUnknown_08597C30 + lsrs r0, 22 + adds r0, r1 + ldrb r0, [r0, 0x3] + cmp r0, 0x1 + beq _0811E90E + cmp r0, 0x1 + bgt _0811E908 + cmp r0, 0 + beq _0811E916 + b _0811E91A + .pool +_0811E908: + cmp r0, 0x2 + beq _0811E912 + b _0811E91A +_0811E90E: + movs r0, 0x1 + b _0811E91C +_0811E912: + movs r0, 0x2 + b _0811E91C +_0811E916: + movs r0, 0 + b _0811E91C +_0811E91A: + movs r0, 0x3 +_0811E91C: + pop {r1} + bx r1 + thumb_func_end sub_811E8E4 + + thumb_func_start sub_811E920 +sub_811E920: @ 811E920 + push {r4,lr} + adds r4, r0, 0 + bl sub_811E8E4 + adds r1, r0, 0 + cmp r1, 0x2 + ble _0811E932 + movs r0, 0 + b _0811E93E +_0811E932: + ldr r0, =gUnknown_08597E60 + lsls r1, 2 + adds r1, r4, r1 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x4 +_0811E93E: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_811E920 + + thumb_func_start sub_811E948 +sub_811E948: @ 811E948 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + bl sub_811E8E4 + mov r8, r0 + cmp r0, 0x3 + beq _0811E9FA + ldr r3, =0xffffff00 + ldr r0, [sp, 0xC] + ands r0, r3 + movs r1, 0x3 + orrs r0, r1 + ldr r2, =0xffff00ff + ands r0, r2 + adds r1, 0xFD + orrs r0, r1 + ldr r1, =0xff00ffff + ands r0, r1 + movs r1, 0xB0 + lsls r1, 12 + orrs r0, r1 + ldr r1, =0x00ffffff + ands r0, r1 + movs r1, 0xE0 + lsls r1, 21 + orrs r0, r1 + str r0, [sp, 0xC] + ldr r0, [sp, 0x10] + ands r0, r3 + movs r1, 0x2 + orrs r0, r1 + ands r0, r2 + movs r1, 0xB0 + lsls r1, 4 + orrs r0, r1 + ldr r1, =0x0000ffff + ands r0, r1 + movs r1, 0xD0 + lsls r1, 14 + orrs r0, r1 + str r0, [sp, 0x10] + add r0, sp, 0xC + bl AddWindow + lsls r0, 16 + lsrs r7, r0, 16 + lsls r4, r7, 24 + lsrs r0, r4, 24 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r6, 0 + mov r0, r8 + lsls r1, r0, 4 + ldr r0, =gUnknown_08597E6C + adds r5, r1, r0 + ldr r1, =gUnknown_08597E60 + mov r10, r1 + mov r9, r4 +_0811E9C6: + ldr r2, [r5] + lsls r4, r7, 24 + cmp r2, 0 + beq _0811E9EC + mov r1, r8 + lsls r0, r1, 2 + adds r0, r6, r0 + add r0, r10 + ldrb r3, [r0] + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + mov r1, r9 + lsrs r0, r1, 24 + movs r1, 0x1 + bl sub_811D028 +_0811E9EC: + adds r5, 0x4 + adds r6, 0x1 + cmp r6, 0x3 + ble _0811E9C6 + lsrs r0, r4, 24 + bl PutWindowTilemap +_0811E9FA: + 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_811E948 + + thumb_func_start sub_811EA28 +sub_811EA28: @ 811EA28 + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x14 + beq _0811EA4E + cmp r0, 0x14 + bgt _0811EA48 + cmp r0, 0x11 + blt _0811EA66 + ldr r0, =0x00000864 + bl FlagGet + b _0811EA60 + .pool +_0811EA48: + cmp r1, 0x15 + beq _0811EA5C + b _0811EA66 +_0811EA4E: + ldr r0, =0x00000866 + bl FlagGet + b _0811EA60 + .pool +_0811EA5C: + bl sub_811F0F8 +_0811EA60: + lsls r0, 24 + lsrs r0, 24 + b _0811EA68 +_0811EA66: + movs r0, 0x1 +_0811EA68: + pop {r1} + bx r1 + thumb_func_end sub_811EA28 + + thumb_func_start start_menu_is_selected_item_valid +start_menu_is_selected_item_valid: @ 811EA6C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + cmp r0, 0 + bne _0811EA84 + movs r0, 0 + bl pokedex_count + lsls r0, 16 + lsrs r0, 16 + b _0811EA9A +_0811EA84: + bl sub_811EA28 + lsls r0, 24 + cmp r0, 0 + bne _0811EA92 + movs r0, 0 + b _0811EA9A +_0811EA92: + ldr r0, =gEasyChatGroups + lsls r1, r4, 3 + adds r1, r0 + ldrh r0, [r1, 0x6] +_0811EA9A: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end start_menu_is_selected_item_valid + + thumb_func_start sub_811EAA4 +sub_811EAA4: @ 811EAA4 + push {r4,r5,lr} + lsls r2, r0, 16 + lsrs r1, r2, 16 + ldr r0, =0x0000ffff + cmp r1, r0 + beq _0811EB04 + lsrs r3, r2, 25 + ldr r5, =0x000001ff + ands r5, r1 + cmp r3, 0x15 + bhi _0811EB08 + ldr r0, =gEasyChatGroups + lsls r2, r3, 3 + adds r1, r2, r0 + ldrh r4, [r1, 0x4] + cmp r3, 0x13 + bgt _0811EADC + cmp r3, 0x12 + bge _0811EAE0 + cmp r3, 0 + beq _0811EAE0 + b _0811EB00 + .pool +_0811EADC: + cmp r3, 0x15 + bne _0811EB00 +_0811EAE0: + adds r0, r2, r0 + ldr r2, [r0] + movs r1, 0 + cmp r1, r4 + bcs _0811EB08 +_0811EAEA: + lsls r0, r1, 1 + adds r0, r2 + ldrh r0, [r0] + cmp r5, r0 + beq _0811EB04 + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r4 + bcc _0811EAEA + b _0811EB08 +_0811EB00: + cmp r5, r4 + bcs _0811EB08 +_0811EB04: + movs r0, 0 + b _0811EB0A +_0811EB08: + movs r0, 0x1 +_0811EB0A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_811EAA4 + + thumb_func_start sub_811EB10 +sub_811EB10: @ 811EB10 + push {lr} + lsls r0, 16 + lsrs r2, r0, 25 + lsls r0, 7 + lsrs r3, r0, 23 + cmp r2, 0x15 + bhi _0811EB5C + cmp r2, 0x13 + bgt _0811EB2C + cmp r2, 0x12 + bge _0811EB3C + cmp r2, 0 + beq _0811EB30 + b _0811EB48 +_0811EB2C: + cmp r2, 0x15 + bne _0811EB48 +_0811EB30: + ldr r0, =gUnknown_085F5490 + ldrh r0, [r0] + b _0811EB50 + .pool +_0811EB3C: + ldr r0, =gUnknown_085FA1D4 + ldrh r0, [r0] + b _0811EB50 + .pool +_0811EB48: + ldr r1, =gEasyChatGroups + lsls r0, r2, 3 + adds r0, r1 + ldrh r0, [r0, 0x4] +_0811EB50: + cmp r0, r3 + bls _0811EB5C + movs r0, 0 + b _0811EB5E + .pool +_0811EB5C: + movs r0, 0x1 +_0811EB5E: + pop {r1} + bx r1 + thumb_func_end sub_811EB10 + + thumb_func_start GetEasyChatWord +@ char *GetEasyChatWord(u8 groupId, u16 wordId) +GetEasyChatWord: @ 811EB64 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r2, r1, 16 + cmp r0, 0x13 + bgt _0811EB7C + cmp r0, 0x12 + bge _0811EB90 + cmp r0, 0 + beq _0811EB80 + b _0811EBA0 +_0811EB7C: + cmp r0, 0x15 + bne _0811EBA0 +_0811EB80: + movs r0, 0xB + muls r0, r2 + ldr r1, =gSpeciesNames + adds r0, r1 + b _0811EBB2 + .pool +_0811EB90: + movs r0, 0xD + muls r0, r2 + ldr r1, =gMoveNames + adds r0, r1 + b _0811EBB2 + .pool +_0811EBA0: + ldr r1, =gEasyChatGroups + lsls r0, 3 + adds r0, r1 + ldr r1, [r0] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] +_0811EBB2: + pop {r1} + bx r1 + .pool + thumb_func_end GetEasyChatWord + + thumb_func_start CopyEasyChatWord +@ char *CopyEasyChatWord(char *dest, u16 groupIdWordIdPair) +CopyEasyChatWord: @ 811EBBC + push {r4-r6,lr} + adds r5, r0, 0 + lsls r6, r1, 16 + lsrs r0, r6, 16 + adds r4, r0, 0 + bl sub_811EAA4 + lsls r0, 24 + cmp r0, 0 + beq _0811EBD8 + ldr r1, =gUnknown_085EEA42 + b _0811EBEA + .pool +_0811EBD8: + ldr r0, =0x0000ffff + cmp r4, r0 + beq _0811EBFC + ldr r1, =0x000001ff + ands r1, r4 + lsrs r0, r6, 25 + bl GetEasyChatWord + adds r1, r0, 0 +_0811EBEA: + adds r0, r5, 0 + bl CopyString + b _0811EC02 + .pool +_0811EBFC: + movs r0, 0xFF + strb r0, [r5] + adds r0, r5, 0 +_0811EC02: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end CopyEasyChatWord + + thumb_func_start ConvertEasyChatWordsToString +ConvertEasyChatWordsToString: @ 811EC08 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r2, 16 + lsls r3, 16 + lsrs r3, 16 + mov r9, r3 + ldr r0, =0xffff0000 + adds r2, r0 + lsrs r7, r2, 16 + movs r0, 0 + cmp r0, r9 + bcs _0811EC78 +_0811EC2A: + movs r6, 0 + adds r0, 0x1 + mov r8, r0 + cmp r6, r7 + bcs _0811EC5C + ldr r2, =0x0000ffff +_0811EC36: + ldrh r1, [r5] + adds r0, r4, 0 + str r2, [sp] + bl CopyEasyChatWord + adds r4, r0, 0 + ldrh r0, [r5] + ldr r2, [sp] + cmp r0, r2 + beq _0811EC50 + movs r0, 0 + strb r0, [r4] + adds r4, 0x1 +_0811EC50: + adds r5, 0x2 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, r7 + bcc _0811EC36 +_0811EC5C: + ldrh r1, [r5] + adds r5, 0x2 + adds r0, r4, 0 + bl CopyEasyChatWord + adds r4, r0, 0 + movs r0, 0xFE + strb r0, [r4] + adds r4, 0x1 + mov r1, r8 + lsls r0, r1, 16 + lsrs r0, 16 + cmp r0, r9 + bcc _0811EC2A +_0811EC78: + subs r4, 0x1 + movs r0, 0xFF + strb r0, [r4] + adds r0, r4, 0 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end ConvertEasyChatWordsToString + + thumb_func_start sub_811EC98 +sub_811EC98: @ 811EC98 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + adds r4, r0, 0 + adds r5, r1, 0 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + lsls r3, 16 + lsrs r3, 16 + str r3, [sp] + mov r7, r8 + movs r0, 0 + str r0, [sp, 0x4] + subs r0, r7, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + movs r0, 0 + cmp r0, r3 + bcs _0811ED62 +_0811ECC8: + adds r3, r5, 0 + movs r2, 0 + movs r1, 0 + adds r0, 0x1 + mov r10, r0 + cmp r2, r7 + bcs _0811ECEE + ldr r6, =0x0000ffff +_0811ECD8: + lsls r0, r1, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r6 + beq _0811ECE4 + movs r2, 0x1 +_0811ECE4: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r7 + bcc _0811ECD8 +_0811ECEE: + cmp r2, 0 + bne _0811ECFC + lsls r0, r7, 1 + adds r5, r0 + b _0811ED56 + .pool +_0811ECFC: + movs r6, 0 + ldr r1, [sp, 0x4] + adds r1, 0x1 + mov r9, r1 + cmp r6, r8 + bcs _0811ED30 + ldr r2, =0x0000ffff +_0811ED0A: + ldrh r1, [r5] + adds r0, r4, 0 + str r2, [sp, 0x8] + bl CopyEasyChatWord + adds r4, r0, 0 + ldrh r0, [r5] + ldr r2, [sp, 0x8] + cmp r0, r2 + beq _0811ED24 + movs r0, 0 + strb r0, [r4] + adds r4, 0x1 +_0811ED24: + adds r5, 0x2 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, r8 + bcc _0811ED0A +_0811ED30: + ldrh r1, [r5] + adds r5, 0x2 + adds r0, r4, 0 + bl CopyEasyChatWord + adds r4, r0, 0 + ldr r0, [sp, 0x4] + cmp r0, 0 + bne _0811ED4C + movs r0, 0xFE + b _0811ED4E + .pool +_0811ED4C: + movs r0, 0xFA +_0811ED4E: + strb r0, [r4] + adds r4, 0x1 + mov r1, r9 + str r1, [sp, 0x4] +_0811ED56: + mov r1, r10 + lsls r0, r1, 16 + lsrs r0, 16 + ldr r1, [sp] + cmp r0, r1 + bcc _0811ECC8 +_0811ED62: + subs r4, 0x1 + movs r0, 0xFF + strb r0, [r4] + adds r0, r4, 0 + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_811EC98 + + thumb_func_start sub_811ED7C +sub_811ED7C: @ 811ED7C + push {r4,r5,lr} + lsls r5, r0, 16 + lsrs r0, r5, 16 + adds r4, r0, 0 + ldr r0, =0x0000ffff + cmp r4, r0 + bne _0811ED94 + movs r0, 0 + b _0811EDBA + .pool +_0811ED94: + adds r0, r4, 0 + bl sub_811EAA4 + lsls r0, 24 + cmp r0, 0 + bne _0811EDB0 + ldr r1, =0x000001ff + ands r1, r4 + lsrs r0, r5, 25 + bl GetEasyChatWord + b _0811EDB2 + .pool +_0811EDB0: + ldr r0, =gUnknown_085EEA42 +_0811EDB2: + bl GetStringLength + lsls r0, 16 + lsrs r0, 16 +_0811EDBA: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_811ED7C + + thumb_func_start sub_811EDC4 +sub_811EDC4: @ 811EDC4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 16 + lsrs r3, 16 + mov r10, r3 + movs r7, 0 + cmp r7, r8 + bcs _0811EE26 + subs r0, r1, 0x1 + lsls r0, 16 + mov r9, r0 +_0811EDEE: + mov r0, r9 + lsrs r4, r0, 16 + movs r5, 0 + cmp r5, r1 + bcs _0811EE14 +_0811EDF8: + ldrh r0, [r6] + adds r6, 0x2 + str r1, [sp] + bl sub_811ED7C + adds r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, [sp] + cmp r5, r1 + bcc _0811EDF8 +_0811EE14: + cmp r4, r10 + bls _0811EE1C + movs r0, 0x1 + b _0811EE28 +_0811EE1C: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, r8 + bcc _0811EDEE +_0811EE26: + movs r0, 0 +_0811EE28: + 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_811EDC4 + + thumb_func_start sub_811EE38 +sub_811EE38: @ 811EE38 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + bl GenerateRandomNumber + ldr r2, =gEasyChatGroups + lsls r1, r4, 3 + adds r1, r2 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r1, 0x4] + bl __umodsi3 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r4, 0 + beq _0811EE66 + cmp r4, 0x15 + beq _0811EE66 + cmp r4, 0x12 + beq _0811EE66 + cmp r4, 0x13 + bne _0811EE74 +_0811EE66: + ldr r1, =gEasyChatGroups + lsls r0, r4, 3 + adds r0, r1 + ldr r1, [r0] + lsls r0, r2, 1 + adds r0, r1 + ldrh r2, [r0] +_0811EE74: + movs r0, 0x7F + ands r0, r4 + lsls r0, 9 + ldr r1, =0x000001ff + ands r2, r1 + orrs r0, r2 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_811EE38 + + thumb_func_start sub_811EE90 +sub_811EE90: @ 811EE90 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + adds r4, r0, 0 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_811EA28 + lsls r0, 24 + cmp r0, 0 + bne _0811EEB0 + ldr r0, =0x0000ffff + b _0811EEC4 + .pool +_0811EEB0: + cmp r4, 0 + beq _0811EEBC + adds r0, r4, 0 + bl sub_811EE38 + b _0811EEC0 +_0811EEBC: + bl sub_811F108 +_0811EEC0: + lsls r0, 16 + lsrs r0, 16 +_0811EEC4: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811EE90 + + thumb_func_start sub_811EECC +sub_811EECC: @ 811EECC + push {r4,r5,lr} + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0x1 + beq _0811EF04 + cmp r0, 0x1 + bgt _0811EEE4 + cmp r0, 0 + beq _0811EEEE + b _0811EF58 + .pool +_0811EEE4: + cmp r0, 0x2 + beq _0811EF2C + cmp r0, 0x3 + beq _0811EF3C + b _0811EF58 +_0811EEEE: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002bb0 + adds r5, r0, r1 + movs r2, 0x2 + b _0811EF46 + .pool +_0811EF04: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002bbc + adds r5, r0, r1 + adds r0, r5, 0 + movs r1, 0x3 + movs r2, 0x2 + movs r3, 0x12 + bl sub_811EDC4 + lsls r0, 24 + cmp r0, 0 + beq _0811EF44 + movs r2, 0x2 + movs r3, 0x3 + b _0811EF48 + .pool +_0811EF2C: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002bc8 + b _0811EF42 + .pool +_0811EF3C: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002bd4 +_0811EF42: + adds r5, r0, r1 +_0811EF44: + movs r2, 0x3 +_0811EF46: + movs r3, 0x2 +_0811EF48: + ldr r4, =0x02021fc4 + adds r0, r4, 0 + adds r1, r5, 0 + bl ConvertEasyChatWordsToString + adds r0, r4, 0 + bl box_related_two__3 +_0811EF58: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811EECC + + thumb_func_start sub_811EF6C +sub_811EF6C: @ 811EF6C + push {lr} + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + movs r0, 0xC + cmp r1, 0 + beq _0811EF7E + movs r0, 0xD +_0811EF7E: + bl sub_811EE90 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =0x02021dc4 + bl CopyEasyChatWord + pop {r0} + bx r0 + .pool + thumb_func_end sub_811EF6C + + thumb_func_start sub_811EF98 +sub_811EF98: @ 811EF98 + lsls r0, 24 + lsrs r2, r0, 27 + movs r1, 0xE0 + lsls r1, 19 + ands r1, r0 + lsrs r1, 24 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r3, =0x00002e20 + adds r0, r3 + adds r0, r2 + ldrb r0, [r0] + asrs r0, r1 + movs r1, 0x1 + ands r0, r1 + bx lr + .pool + thumb_func_end sub_811EF98 + + thumb_func_start sub_811EFC0 +sub_811EFC0: @ 811EFC0 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x20 + bhi _0811EFE4 + lsrs r3, r0, 27 + movs r2, 0x7 + ands r2, r1 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x00002e20 + adds r1, r0 + adds r1, r3 + movs r0, 0x1 + lsls r0, r2 + ldrb r2, [r1] + orrs r0, r2 + strb r0, [r1] +_0811EFE4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_811EFC0 + + thumb_func_start sub_811EFF0 +sub_811EFF0: @ 811EFF0 + push {r4,r5,lr} + movs r4, 0 + movs r5, 0 +_0811EFF6: + adds r0, r4, 0 + bl sub_811EF98 + lsls r0, 24 + cmp r0, 0 + beq _0811F008 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_0811F008: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x20 + bls _0811EFF6 + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_811EFF0 + + thumb_func_start sub_811F01C +sub_811F01C: @ 811F01C + push {r4-r6,lr} + bl sub_811EFF0 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x21 + bne _0811F048 + b _0811F082 +_0811F02C: + adds r0, r5, 0 + bl sub_811EFC0 + ldr r0, =0x000001ff + ands r4, r0 + movs r1, 0xA0 + lsls r1, 6 + adds r0, r1, 0 + orrs r4, r0 + adds r0, r4, 0 + b _0811F084 + .pool +_0811F048: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x21 + subs r1, r4 + bl __modsi3 + lsls r0, 16 + lsrs r6, r0, 16 + movs r4, 0 +_0811F05E: + lsls r0, r4, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl sub_811EF98 + lsls r0, 24 + cmp r0, 0 + bne _0811F078 + cmp r6, 0 + beq _0811F02C + subs r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_0811F078: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x20 + bls _0811F05E +_0811F082: + ldr r0, =0x0000ffff +_0811F084: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_811F01C + + thumb_func_start sub_811F090 +sub_811F090: @ 811F090 + push {r4,r5,lr} + bl sub_811EFF0 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0811F0B4 + b _0811F0EA +_0811F0A0: + ldr r0, =0x000001ff + ands r4, r0 + movs r1, 0xA0 + lsls r1, 6 + adds r0, r1, 0 + orrs r4, r0 + adds r0, r4, 0 + b _0811F0EC + .pool +_0811F0B4: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __umodsi3 + lsls r0, 16 + lsrs r5, r0, 16 + movs r4, 0 +_0811F0C8: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_811EF98 + lsls r0, 24 + cmp r0, 0 + beq _0811F0E0 + cmp r5, 0 + beq _0811F0A0 + subs r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_0811F0E0: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x20 + bls _0811F0C8 +_0811F0EA: + ldr r0, =0x0000ffff +_0811F0EC: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_811F090 + + thumb_func_start sub_811F0F8 +sub_811F0F8: @ 811F0F8 + push {lr} + bl sub_809D42C + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_811F0F8 + + thumb_func_start sub_811F108 +sub_811F108: @ 811F108 + push {r4-r7,lr} + movs r0, 0 + bl start_menu_is_selected_item_valid + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + bne _0811F128 + b _0811F172 +_0811F11A: + ldrh r1, [r5] + ldr r0, =0x000001ff + ands r0, r1 + b _0811F174 + .pool +_0811F128: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =gEasyChatGroups + ldr r5, [r0] + ldrh r7, [r0, 0x4] + movs r6, 0 + cmp r6, r7 + bcs _0811F172 +_0811F146: + ldrh r0, [r5] + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _0811F166 + cmp r4, 0 + beq _0811F11A + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_0811F166: + adds r5, 0x2 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, r7 + bcc _0811F146 +_0811F172: + ldr r0, =0x0000ffff +_0811F174: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_811F108 + + thumb_func_start sub_811F184 +sub_811F184: @ 811F184 + push {r4-r7,lr} + movs r2, 0 + ldr r5, =0x03005d8c + ldr r4, =0x00002bb0 + ldr r3, =gUnknown_0859E62C +_0811F18E: + ldr r1, [r5] + lsls r0, r2, 1 + adds r1, r4 + adds r1, r0 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x3 + bls _0811F18E + movs r2, 0 + ldr r5, =0x03005d8c + ldr r4, =0x00002bbc + ldr r3, =gUnknown_0859E634 +_0811F1AE: + ldr r1, [r5] + lsls r0, r2, 1 + adds r1, r4 + adds r1, r0 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x5 + bls _0811F1AE + movs r2, 0 + ldr r5, =0x03005d8c + ldr r4, =0x00002bc8 + ldr r3, =gUnknown_0859E640 +_0811F1CE: + ldr r1, [r5] + lsls r0, r2, 1 + adds r1, r4 + adds r1, r0 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x5 + bls _0811F1CE + movs r2, 0 + ldr r5, =0x03005d8c + ldr r4, =0x00002bd4 + ldr r3, =gUnknown_0859E64C +_0811F1EE: + ldr r1, [r5] + lsls r0, r2, 1 + adds r1, r4 + adds r1, r0 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x5 + bls _0811F1EE + movs r2, 0 + ldr r7, =0x03005d8c + ldr r6, =0x00002be0 + ldr r0, =0x0000ffff + adds r5, r0, 0 +_0811F210: + movs r3, 0 + lsls r0, r2, 3 + adds r0, r2 + lsls r4, r0, 2 +_0811F218: + ldr r1, [r7] + lsls r0, r3, 1 + adds r0, r4 + adds r1, r6 + adds r1, r0 + ldrh r0, [r1] + orrs r0, r5 + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x8 + bls _0811F218 + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0xF + bls _0811F210 + movs r2, 0 + ldr r4, =0x03005d8c + ldr r3, =0x00002e20 + movs r1, 0 +_0811F244: + ldr r0, [r4] + adds r0, r3 + adds r0, r2 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x3F + bls _0811F244 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811F184 + + thumb_func_start sub_811F28C +sub_811F28C: @ 811F28C + push {r4,lr} + ldr r4, =0x0203a120 + ldr r0, =0x00003ba4 + bl Alloc + str r0, [r4] + cmp r0, 0 + beq _0811F2B0 + bl sub_811F2D4 + bl sub_811F46C + movs r0, 0x1 + b _0811F2B2 + .pool +_0811F2B0: + movs r0, 0 +_0811F2B2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811F28C + + thumb_func_start sub_811F2B8 +sub_811F2B8: @ 811F2B8 + push {r4,lr} + ldr r4, =0x0203a120 + ldr r0, [r4] + cmp r0, 0 + beq _0811F2CA + bl Free + movs r0, 0 + str r0, [r4] +_0811F2CA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811F2B8 + + thumb_func_start sub_811F2D4 +sub_811F2D4: @ 811F2D4 + push {r4,r5,lr} + ldr r4, =0x0203a120 + ldr r0, [r4] + movs r5, 0 + strh r5, [r0] + movs r0, 0 + bl pokedex_count + lsls r0, 16 + cmp r0, 0 + beq _0811F2FC + ldr r0, [r4] + ldrh r1, [r0] + adds r2, r1, 0x1 + strh r2, [r0] + lsls r1, 16 + lsrs r1, 15 + adds r0, 0x2 + adds r0, r1 + strh r5, [r0] +_0811F2FC: + movs r3, 0x1 +_0811F2FE: + ldr r0, [r4] + ldrh r2, [r0] + adds r1, r2, 0x1 + strh r1, [r0] + lsls r2, 16 + lsrs r2, 15 + adds r0, 0x2 + adds r0, r2 + strh r3, [r0] + adds r3, 0x1 + cmp r3, 0x10 + ble _0811F2FE + ldr r0, =0x00000864 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0811F358 + ldr r0, =0x0203a120 + ldr r2, [r0] + ldrh r0, [r2] + adds r1, r0, 0x1 + strh r1, [r2] + lsls r0, 16 + lsrs r0, 15 + adds r3, r2, 0x2 + adds r0, r3, r0 + movs r1, 0x11 + strh r1, [r0] + ldrh r0, [r2] + adds r1, r0, 0x1 + strh r1, [r2] + lsls r0, 16 + lsrs r0, 15 + adds r0, r3, r0 + movs r1, 0x12 + strh r1, [r0] + ldrh r0, [r2] + adds r1, r0, 0x1 + strh r1, [r2] + lsls r0, 16 + lsrs r0, 15 + adds r3, r0 + movs r0, 0x13 + strh r0, [r3] +_0811F358: + ldr r0, =0x00000866 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0811F37A + ldr r0, =0x0203a120 + ldr r0, [r0] + ldrh r1, [r0] + adds r2, r1, 0x1 + strh r2, [r0] + lsls r1, 16 + lsrs r1, 15 + adds r0, 0x2 + adds r0, r1 + movs r1, 0x14 + strh r1, [r0] +_0811F37A: + bl sub_809D42C + cmp r0, 0 + beq _0811F398 + ldr r0, =0x0203a120 + ldr r0, [r0] + ldrh r1, [r0] + adds r2, r1, 0x1 + strh r2, [r0] + lsls r1, 16 + lsrs r1, 15 + adds r0, 0x2 + adds r0, r1 + movs r1, 0x15 + strh r1, [r0] +_0811F398: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811F2D4 + + thumb_func_start sub_811F3AC +sub_811F3AC: @ 811F3AC + ldr r0, =0x0203a120 + ldr r0, [r0] + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_811F3AC + + thumb_func_start sub_811F3B8 +sub_811F3B8: @ 811F3B8 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x0203a120 + ldr r1, [r0] + ldrh r0, [r1] + cmp r2, r0 + bcs _0811F3D8 + lsls r0, r2, 1 + adds r1, 0x2 + adds r1, r0 + ldrb r0, [r1] + b _0811F3DA + .pool +_0811F3D8: + movs r0, 0x16 +_0811F3DA: + pop {r1} + bx r1 + thumb_func_end sub_811F3B8 + + thumb_func_start sub_811F3E0 +sub_811F3E0: @ 811F3E0 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 24 + lsls r2, 16 + lsrs r5, r2, 16 + ldr r0, =gEasyChatGroupNamePointers + lsrs r1, 22 + adds r1, r0 + ldr r1, [r1] + adds r0, r4, 0 + bl CopyString + adds r1, r0, 0 + subs r4, r1, r4 + lsls r4, 16 + lsrs r0, r4, 16 + cmp r0, r5 + bcs _0811F414 + movs r2, 0 +_0811F406: + strb r2, [r1] + adds r1, 0x1 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r5 + bcc _0811F406 +_0811F414: + movs r0, 0xFF + strb r0, [r1] + adds r0, r1, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_811F3E0 + + thumb_func_start sub_811F424 +sub_811F424: @ 811F424 + lsls r0, 24 + ldr r1, =gEasyChatGroupNamePointers + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bx lr + .pool + thumb_func_end sub_811F424 + + thumb_func_start CopyEasyChatWordPadded +@ char *CopyEasyChatWordPadded(char *dest, u16 groupIdWordIdPair, u16 minLength) +CopyEasyChatWordPadded: @ 811F434 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r5, r2, 16 + bl CopyEasyChatWord + adds r1, r0, 0 + subs r4, r1, r4 + lsls r4, 16 + lsrs r0, r4, 16 + cmp r0, r5 + bcs _0811F460 + movs r2, 0 +_0811F452: + strb r2, [r1] + adds r1, 0x1 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r5 + bcc _0811F452 +_0811F460: + movs r0, 0xFF + strb r0, [r1] + adds r0, r1, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end CopyEasyChatWordPadded + + thumb_func_start sub_811F46C +sub_811F46C: @ 811F46C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + movs r3, 0 +_0811F47A: + ldr r2, =gEasyChatWordsByLetterPointers + lsls r1, r3, 3 + adds r0, r2, 0x4 + adds r0, r1, r0 + ldr r0, [r0] + str r0, [sp] + adds r1, r2 + ldr r7, [r1] + ldr r0, =0x0203a120 + ldr r1, [r0] + lsls r2, r3, 1 + adds r1, 0x2E + adds r1, r2 + movs r0, 0 + strh r0, [r1] + mov r10, r0 + movs r1, 0 + str r2, [sp, 0x4] + adds r0, r3, 0x1 + str r0, [sp, 0x8] + ldr r2, [sp] + cmp r1, r2 + bge _0811F530 +_0811F4A8: + ldrh r0, [r7] + ldr r2, =0x0000ffff + cmp r0, r2 + bne _0811F4FC + adds r7, 0x2 + ldrh r4, [r7] + adds r7, 0x2 + adds r0, r1, 0x1 + adds r1, r0, r4 + b _0811F4FE + .pool +_0811F4C8: + ldr r0, =0x0203a120 + ldr r2, [r0] + mov r0, r10 + lsls r1, r0, 1 + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 3 + subs r0, r3 + lsls r0, 2 + adds r1, r0 + adds r0, r2, 0 + adds r0, 0x64 + adds r0, r1 + ldrh r1, [r5] + strh r1, [r0] + movs r0, 0x1 + add r10, r0 + adds r2, 0x2E + ldr r0, [sp, 0x4] + adds r2, r0 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + b _0811F526 + .pool +_0811F4FC: + movs r4, 0x1 +_0811F4FE: + movs r6, 0 + adds r1, 0x1 + mov r9, r1 + lsls r2, r4, 1 + mov r8, r2 + cmp r6, r4 + bge _0811F526 + adds r5, r7, 0 +_0811F50E: + ldrh r0, [r5] + str r3, [sp, 0xC] + bl sub_811F860 + lsls r0, 24 + ldr r3, [sp, 0xC] + cmp r0, 0 + bne _0811F4C8 + adds r5, 0x2 + adds r6, 0x1 + cmp r6, r4 + blt _0811F50E +_0811F526: + add r7, r8 + mov r1, r9 + ldr r0, [sp] + cmp r1, r0 + blt _0811F4A8 +_0811F530: + ldr r3, [sp, 0x8] + cmp r3, 0x1A + ble _0811F47A + 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_811F46C + + thumb_func_start sub_811F548 +sub_811F548: @ 811F548 + push {lr} + lsls r1, 16 + lsrs r1, 16 + cmp r0, 0 + bne _0811F55A + adds r0, r1, 0 + bl sub_811F5C4 + b _0811F560 +_0811F55A: + adds r0, r1, 0 + bl sub_811F6B8 +_0811F560: + ldr r1, =0x0203a120 + ldr r1, [r1] + ldr r2, =0x00003ba0 + adds r1, r2 + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_811F548 + + thumb_func_start sub_811F578 +sub_811F578: @ 811F578 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =0x0203a120 + ldr r1, [r0] + ldr r3, =0x00003ba0 + adds r0, r1, r3 + ldrh r0, [r0] + cmp r2, r0 + bcs _0811F5A4 + lsls r0, r2, 1 + ldr r2, =0x00003984 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + b _0811F5A6 + .pool +_0811F5A4: + ldr r0, =0x0000ffff +_0811F5A6: + pop {r1} + bx r1 + .pool + thumb_func_end sub_811F578 + + thumb_func_start sub_811F5B0 +sub_811F5B0: @ 811F5B0 + ldr r0, =0x0203a120 + ldr r0, [r0] + ldr r1, =0x00003ba0 + adds r0, r1 + ldrh r0, [r0] + bx lr + .pool + thumb_func_end sub_811F5B0 + + thumb_func_start sub_811F5C4 +sub_811F5C4: @ 811F5C4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, =gEasyChatGroups + lsls r0, r2, 3 + adds r0, r1 + ldrh r3, [r0, 0x4] + mov r8, r3 + cmp r2, 0 + beq _0811F5EC + cmp r2, 0x15 + beq _0811F5EC + cmp r2, 0x12 + beq _0811F5EC + cmp r2, 0x13 + bne _0811F64C +_0811F5EC: + lsls r0, r2, 3 + adds r0, r1 + ldr r1, [r0] + movs r7, 0 + movs r5, 0 + cmp r5, r8 + bcs _0811F698 + movs r0, 0x7F + ands r0, r2 + lsls r0, 9 + mov r9, r0 + adds r4, r1, 0 + lsls r6, r2, 24 +_0811F606: + ldrh r0, [r4] + lsrs r1, r6, 24 + bl sub_811F764 + lsls r0, 24 + cmp r0, 0 + beq _0811F630 + ldr r0, =0x0203a120 + ldr r2, [r0] + lsls r0, r5, 1 + ldr r1, =0x00003984 + adds r2, r1 + adds r2, r0 + ldrh r0, [r4] + ldr r3, =0x000001ff + adds r1, r3, 0 + ands r0, r1 + mov r1, r9 + orrs r0, r1 + strh r0, [r2] + adds r5, 0x1 +_0811F630: + adds r4, 0x2 + adds r7, 0x1 + cmp r7, r8 + bcc _0811F606 + b _0811F698 + .pool +_0811F64C: + ldr r1, [r0] + movs r7, 0 + movs r5, 0 + cmp r5, r8 + bcs _0811F698 + movs r0, 0x7F + ands r0, r2 + lsls r0, 9 + mov r10, r0 + adds r6, r1, 0 + lsls r2, 24 + mov r9, r2 +_0811F664: + ldrh r4, [r6, 0x4] + adds r0, r4, 0 + mov r2, r9 + lsrs r1, r2, 24 + bl sub_811F764 + lsls r0, 24 + cmp r0, 0 + beq _0811F690 + ldr r0, =0x0203a120 + ldr r1, [r0] + lsls r0, r5, 1 + ldr r3, =0x00003984 + adds r1, r3 + adds r1, r0 + ldr r2, =0x000001ff + adds r0, r2, 0 + ands r4, r0 + mov r3, r10 + orrs r4, r3 + strh r4, [r1] + adds r5, 0x1 +_0811F690: + adds r6, 0xC + adds r7, 0x1 + cmp r7, r8 + bcc _0811F664 +_0811F698: + lsls r0, r5, 16 + lsrs r0, 16 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_811F5C4 + + thumb_func_start sub_811F6B8 +sub_811F6B8: @ 811F6B8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r1, r0, 16 + movs r4, 0 + movs r6, 0 + ldr r3, =0x0203a120 + ldr r0, [r3] + lsls r5, r1, 1 + adds r0, 0x2E + adds r0, r5 + ldrh r0, [r0] + cmp r6, r0 + bcs _0811F718 + mov r8, r3 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 3 + subs r0, r1 + lsls r7, r0, 2 + ldr r0, =0x00003984 + mov r12, r0 +_0811F6E6: + mov r0, r8 + ldr r3, [r0] + adds r1, r6, 0 + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 1 + mov r0, r12 + adds r2, r3, r0 + adds r2, r1 + lsls r1, r4, 1 + adds r1, r7 + adds r0, r3, 0 + adds r0, 0x64 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r3, 0x2E + adds r3, r5 + ldrh r3, [r3] + cmp r4, r3 + bcc _0811F6E6 +_0811F718: + adds r0, r6, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_811F6B8 + + thumb_func_start sub_811F72C +sub_811F72C: @ 811F72C + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + movs r2, 0 + ldr r0, =0x0203a120 + ldr r0, [r0] + ldrh r1, [r0] + cmp r2, r1 + bge _0811F75C + adds r4, r3, 0 + adds r3, r1, 0 + adds r1, r0, 0x2 +_0811F744: + ldrh r0, [r1] + cmp r0, r4 + bne _0811F754 + movs r0, 0x1 + b _0811F75E + .pool +_0811F754: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, r3 + blt _0811F744 +_0811F75C: + movs r0, 0 +_0811F75E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_811F72C + + thumb_func_start sub_811F764 +sub_811F764: @ 811F764 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 24 + lsrs r2, r1, 24 + cmp r2, 0x15 + bhi _0811F81A + lsls r0, r2, 2 + ldr r1, =_0811F780 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0811F780: + .4byte _0811F7D8 + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F81A + .4byte _0811F808 + .4byte _0811F808 + .4byte _0811F80C + .4byte _0811F7EE +_0811F7D8: + adds r0, r4, 0 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl pokedex_flag_operation + lsls r0, 24 + lsrs r0, 24 + b _0811F82C +_0811F7EE: + adds r0, r4, 0 + bl sub_811F838 + cmp r0, 0 + beq _0811F808 + adds r0, r4, 0 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl pokedex_flag_operation +_0811F808: + movs r0, 0x1 + b _0811F82C +_0811F80C: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_811EF98 + lsls r0, 24 + lsrs r0, 24 + b _0811F82C +_0811F81A: + ldr r1, =gEasyChatGroups + lsls r0, r2, 3 + adds r0, r1 + ldr r1, [r0] + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x8] +_0811F82C: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_811F764 + + thumb_func_start sub_811F838 +sub_811F838: @ 811F838 + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r1, =gUnknown_0859E658 +_0811F842: + ldrh r0, [r1] + cmp r0, r3 + bne _0811F850 + movs r0, 0x1 + b _0811F85A + .pool +_0811F850: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0 + beq _0811F842 + movs r0, 0 +_0811F85A: + pop {r1} + bx r1 + thumb_func_end sub_811F838 + + thumb_func_start sub_811F860 +sub_811F860: @ 811F860 + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 25 + lsls r0, 7 + lsrs r4, r0, 23 + adds r0, r5, 0 + bl sub_811F72C + lsls r0, 24 + cmp r0, 0 + beq _0811F884 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_811F764 + lsls r0, 24 + lsrs r0, 24 + b _0811F886 +_0811F884: + movs r0, 0 +_0811F886: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_811F860 + + thumb_func_start sub_811F88C +sub_811F88C: @ 811F88C + push {lr} + adds r2, r0, 0 + lsls r1, 16 + ldr r0, =0xffff0000 + adds r1, r0 + lsrs r0, r1, 16 + ldr r1, =0x0000ffff + cmp r0, r1 + beq _0811F8AE + adds r3, r1, 0 +_0811F8A0: + strh r3, [r2] + adds r2, 0x2 + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r1 + bne _0811F8A0 +_0811F8AE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_811F88C + + thumb_func_start sub_811F8BC +sub_811F8BC: @ 811F8BC + push {lr} + bl sub_801B058 + ldr r1, =0x0000ffff + adds r2, r1, 0 + adds r1, r0, 0x6 +_0811F8C8: + strh r2, [r1] + subs r1, 0x2 + cmp r1, r0 + bge _0811F8C8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_811F8BC + + thumb_func_start sub_811F8D8 +sub_811F8D8: @ 811F8D8 + push {r4,r5,lr} + asrs r4, r0, 9 + movs r1, 0x7F + ldr r5, =0x000001ff + ands r5, r0 + ands r4, r1 + adds r0, r4, 0 + bl sub_811EA28 + lsls r0, 24 + cmp r0, 0 + beq _0811F904 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_811F764 + lsls r0, 24 + lsrs r0, 24 + b _0811F906 + .pool +_0811F904: + movs r0, 0 +_0811F906: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_811F8D8 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/egg_hatch.s b/asm/egg_hatch.s new file mode 100644 index 000000000..767e98876 --- /dev/null +++ b/asm/egg_hatch.s @@ -0,0 +1,1801 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8071348 +sub_8071348: @ 8071348 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x50 + adds r5, r0, 0 + adds r6, r1, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x3C] + movs r4, 0 + add r7, sp, 0x18 + add r0, sp, 0x30 + mov r8, r0 + movs r1, 0x31 + add r1, sp + mov r10, r1 + mov r0, sp + adds r0, 0x32 + str r0, [sp, 0x40] + mov r1, sp + adds r1, 0x34 + str r1, [sp, 0x48] + adds r0, 0x1 + str r0, [sp, 0x44] + adds r1, 0x4 + str r1, [sp, 0x4C] +_08071386: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r5, 0 + bl pokemon_getattr + lsls r1, r4, 1 + add r1, sp + adds r1, 0x10 + strh r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _08071386 + adds r0, r5, 0 + movs r1, 0 + bl pokemon_getattr + mov r9, r0 + movs r4, 0 +_080713AE: + adds r1, r4, 0 + adds r1, 0x27 + adds r0, r5, 0 + bl pokemon_getattr + lsls r1, r4, 2 + adds r1, r7, r1 + str r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _080713AE + adds r0, r5, 0 + movs r1, 0x3 + bl pokemon_getattr + mov r1, r8 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x25 + bl pokemon_getattr + mov r1, r10 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x8 + bl pokemon_getattr + ldr r1, [sp, 0x40] + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x22 + bl pokemon_getattr + str r0, [sp, 0x38] + adds r0, r5, 0 + movs r1, 0x50 + bl pokemon_getattr + ldr r1, [sp, 0x48] + strb r0, [r1] + movs r0, 0x1 + str r0, [sp] + mov r0, r9 + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + str r0, [sp, 0xC] + adds r0, r6, 0 + ldr r1, [sp, 0x3C] + movs r2, 0x5 + movs r3, 0x20 + bl create_pokemon_set_level + movs r4, 0 +_0807141E: + adds r1, r4, 0 + adds r1, 0xD + lsls r0, r4, 1 + mov r2, sp + adds r2, r0 + adds r2, 0x10 + adds r0, r6, 0 + bl pokemon_setattr + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _0807141E + movs r4, 0 +_0807143C: + adds r1, r4, 0 + adds r1, 0x27 + lsls r2, r4, 2 + adds r2, r7, r2 + adds r0, r6, 0 + bl pokemon_setattr + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _0807143C + movs r0, 0x2 + mov r1, r8 + strb r0, [r1] + adds r0, r6, 0 + movs r1, 0x3 + mov r2, r8 + bl pokemon_setattr + adds r0, r6, 0 + movs r1, 0x25 + mov r2, r10 + bl pokemon_setattr + adds r0, r6, 0 + movs r1, 0x8 + ldr r2, [sp, 0x40] + bl pokemon_setattr + movs r0, 0x78 + ldr r1, [sp, 0x44] + strb r0, [r1] + adds r0, r6, 0 + movs r1, 0x20 + ldr r2, [sp, 0x44] + bl pokemon_setattr + adds r0, r6, 0 + movs r1, 0x22 + ldr r2, [sp, 0x4C] + bl pokemon_setattr + adds r0, r6, 0 + movs r1, 0x50 + ldr r2, [sp, 0x48] + bl pokemon_setattr + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x64 + bl memcpy + add sp, 0x50 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8071348 + + thumb_func_start sub_80714B8 +sub_80714B8: @ 80714B8 + push {r4,r5,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + add r4, sp, 0xC + movs r1, 0x46 + strb r1, [r4] + movs r1, 0x64 + adds r5, r0, 0 + muls r5, r1 + ldr r0, =0x020244ec + adds r5, r0 + ldr r1, =0x02024744 + adds r0, r5, 0 + bl sub_8071348 + adds r0, r5, 0 + movs r1, 0x2D + adds r2, r4, 0 + bl pokemon_setattr + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, sp + adds r1, r4, 0 + bl GetSpeciesName + adds r0, r5, 0 + movs r1, 0x2 + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + bl SpeciesToNationalPokedexNum + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + movs r1, 0x2 + bl pokedex_flag_operation + adds r0, r4, 0 + movs r1, 0x3 + bl pokedex_flag_operation + ldr r1, =0x02021cc4 + adds r0, r5, 0 + bl pokemon_get_nick + mov r2, sp + adds r2, 0xE + movs r0, 0x4 + strh r0, [r2] + adds r0, r5, 0 + movs r1, 0x26 + bl pokemon_setattr + add r2, sp, 0x10 + movs r0, 0 + strh r0, [r2] + adds r0, r5, 0 + movs r1, 0x24 + bl pokemon_setattr + bl sav1_map_get_name + mov r2, sp + adds r2, 0x12 + strb r0, [r2] + adds r0, r5, 0 + movs r1, 0x23 + bl pokemon_setattr + adds r0, r5, 0 + bl sub_806E924 + adds r0, r5, 0 + bl pokemon_calc_effective_stats + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80714B8 + + thumb_func_start sub_8071578 +sub_8071578: @ 8071578 + push {lr} + ldr r0, =0x020375e0 + ldrb r0, [r0] + bl sub_80714B8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8071578 + + thumb_func_start sub_807158C +sub_807158C: @ 807158C + push {r4-r6,lr} + sub sp, 0x20 + lsls r1, 24 + lsrs r1, 24 + movs r2, 0x8C + muls r1, r2 + adds r4, r0, r1 + adds r0, r4, 0 + mov r1, sp + bl pokemon_get_nick_ + adds r0, r4, 0 + adds r0, 0x70 + ldrh r0, [r0] + cmp r0, 0 + beq _08071608 + adds r6, r4, 0 + adds r6, 0x7C + mov r0, sp + adds r1, r6, 0 + bl CompareStringWithoutExtendedControlCodes + adds r5, r4, 0 + adds r5, 0x74 + cmp r0, 0 + bne _080715CE + ldr r0, =0x03005d90 + ldr r0, [r0] + adds r1, r5, 0 + bl CompareStringWithoutExtendedControlCodes + cmp r0, 0 + beq _08071608 +_080715CE: + ldr r0, =0x02021cc4 + mov r1, sp + bl CopyString + ldr r0, =0x02021dc4 + adds r4, 0x87 + ldrb r2, [r4] + lsls r2, 28 + lsrs r2, 28 + adds r1, r5, 0 + bl sub_81DB5E8 + ldr r0, =0x02021ec4 + ldrb r2, [r4] + lsrs r2, 4 + adds r1, r6, 0 + bl sub_81DB5E8 + movs r0, 0x1 + b _0807160A + .pool +_08071608: + movs r0, 0 +_0807160A: + add sp, 0x20 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_807158C + + thumb_func_start sub_8071614 +sub_8071614: @ 8071614 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003030 + adds r0, r1 + ldr r1, =0x020375e0 + ldrb r1, [r1] + bl sub_807158C + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8071614 + + thumb_func_start sub_807163C +sub_807163C: @ 807163C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r3 + lsls r0, 24 + lsrs r3, r0, 24 + mov r8, r3 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r1, r2, 24 + adds r2, r1, 0 + movs r4, 0 + movs r7, 0 + movs r5, 0 + cmp r3, 0 + bne _0807166A + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + movs r4, 0x1 +_0807166A: + cmp r3, 0x1 + bne _0807167A + movs r0, 0x64 + adds r1, r2, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + movs r4, 0x3 +_0807167A: + cmp r6, 0 + beq _08071688 + cmp r6, 0x1 + beq _080716D8 + b _08071712 + .pool +_08071688: + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0 + bl pokemon_getattr + adds r3, r0, 0 + lsls r0, r4, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r2, [r1] + mov r6, r8 + lsls r1, r6, 1 + adds r1, 0x1 + lsls r1, 2 + adds r2, 0x4 + adds r2, r1 + ldr r1, [r2] + adds r2, r4, 0 + bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack + adds r0, r5, 0 + bl sub_806E794 + bl LoadCompressedObjectPalette + mov r0, r9 + strh r4, [r0] + b _08071712 + .pool +_080716D8: + adds r0, r5, 0 + bl sub_806E794 + ldrh r0, [r0, 0x4] + adds r1, r4, 0 + bl sub_806A068 + ldr r0, =0x0202499c + movs r1, 0x78 + movs r2, 0x4B + movs r3, 0x6 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =0x02020630 + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + adds r2, r1, r4 + adds r2, 0x3E + ldrb r0, [r2] + movs r3, 0x4 + orrs r0, r3 + strb r0, [r2] + adds r4, 0x1C + adds r1, r4 + ldr r0, =DummyObjectCallback + str r0, [r1] +_08071712: + adds r0, r7, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_807163C + + thumb_func_start sub_807172C +sub_807172C: @ 807172C + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_807172C + + thumb_func_start sub_8071740 +sub_8071740: @ 8071740 + push {lr} + bl script_env_2_enable + ldr r0, =sub_8071760 + movs r1, 0xA + bl CreateTask + movs r0, 0x1 + movs r1, 0 + bl fade_screen + pop {r0} + bx r0 + .pool + thumb_func_end sub_8071740 + + thumb_func_start sub_8071760 +sub_8071760: @ 8071760 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08071788 + bl overworld_free_bg_tilemaps + ldr r0, =c1_hatching_egg + bl SetMainCallback2 + ldr r1, =0x03005dac + ldr r0, =sub_80AF168 + str r0, [r1] + adds r0, r4, 0 + bl DestroyTask +_08071788: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8071760 + + thumb_func_start c1_hatching_egg +c1_hatching_egg: @ 80717A0 + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x8 + bls _080717B4 + b _080719D6 +_080717B4: + lsls r0, 2 + ldr r1, =_080717C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080717C8: + .4byte _080717EC + .4byte _080718B8 + .4byte _080718D0 + .4byte _08071904 + .4byte _08071924 + .4byte _0807193C + .4byte _08071954 + .4byte _08071970 + .4byte _080719C8 +_080717EC: + movs r0, 0 + movs r1, 0 + bl SetGpuReg + ldr r4, =0x03000de0 + movs r0, 0x14 + bl Alloc + str r0, [r4] + bl init_uns_table_pokemon_copy + ldr r2, [r4] + ldr r0, =0x020375e0 + ldrh r0, [r0] + movs r1, 0 + strb r0, [r2, 0x4] + ldr r0, [r4] + strb r1, [r0, 0x7] + ldr r0, =sub_807172C + bl SetVBlankCallback + bl current_map_music_get + ldr r1, =0x020375e2 + strh r0, [r1] + bl reset_temp_tile_data_buffers + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0832C064 + movs r0, 0 + movs r2, 0x2 + bl InitBgsFromTemplates + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + 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, 0x7 + movs r2, 0x2 + bl SetBgAttribute + movs r0, 0x80 + lsls r0, 5 + bl Alloc + adds r1, r0, 0 + movs r0, 0x1 + bl SetBgTilemapBuffer + movs r0, 0x80 + lsls r0, 6 + bl Alloc + adds r1, r0, 0 + movs r0, 0 + bl SetBgTilemapBuffer + bl DeactivateAllTextPrinters + bl sub_80A1A74 + bl ResetObjectPaletteAllocator + bl ResetAllObjectData + bl ResetTasks + bl remove_some_task + bl SoundVSyncOn_rev01 + b _080719A6 + .pool +_080718B8: + ldr r0, =gUnknown_0832C06C + bl InitWindows + ldr r0, =0x03000de0 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x8] + b _080719A6 + .pool +_080718D0: + ldr r1, =gUnknown_08C00000 + movs r0, 0 + str r0, [sp] + movs r2, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_08C00524 + movs r0, 0 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + ldr r0, =gUnknown_08C004E0 + movs r1, 0 + movs r2, 0x20 + bl decompress_palette + b _080719A6 + .pool +_08071904: + ldr r0, =gUnknown_0832BFE4 + bl LoadObjectPic + ldr r0, =gUnknown_0832BFEC + bl LoadObjectPic + ldr r0, =gUnknown_0832BFF4 + bl LoadTaggedObjectPalette + b _080719A6 + .pool +_08071924: + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r0, =0x03000de0 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + bl sub_80714B8 + b _080719A6 + .pool +_0807193C: + ldr r0, =0x03000de0 + ldr r3, [r0] + ldrb r2, [r3, 0x4] + adds r3, 0xC + movs r0, 0 + movs r1, 0 + bl sub_807163C + b _080719A6 + .pool +_08071954: + ldr r4, =0x03000de0 + ldr r3, [r4] + ldrb r2, [r3, 0x4] + adds r3, 0xC + movs r0, 0 + movs r1, 0x1 + bl sub_807163C + ldr r1, [r4] + strb r0, [r1, 0x1] + b _080719A6 + .pool +_08071970: + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r0, =gUnknown_08DD7300 + movs r1, 0x10 + movs r2, 0xA0 + bl gpu_pal_apply + ldr r1, =gUnknown_08DD7360 + movs r2, 0xA1 + lsls r2, 5 + movs r0, 0x1 + movs r3, 0 + bl LoadBgTiles + ldr r1, =gUnknown_08331F60 + movs r2, 0x80 + lsls r2, 5 + movs r0, 0x1 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x1 + bl CopyBgTilemapBufferToVram +_080719A6: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080719D6 + .pool +_080719C8: + ldr r0, =sub_8071A94 + bl SetMainCallback2 + ldr r0, =0x03000de0 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x2] +_080719D6: + bl RunTasks + bl RunTextPrinters + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end c1_hatching_egg + + thumb_func_start sub_80719FC +sub_80719FC: @ 80719FC + push {lr} + ldr r0, =0x020375e0 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r2, =0x02021ec4 + movs r1, 0x2 + bl pokemon_setattr + bl sub_805F094 + ldr r0, =0x03000de0 + ldr r0, [r0] + bl Free + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80719FC + + thumb_func_start c3_080472E4 +c3_080472E4: @ 8071A3C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08071A5C + bl sub_80A2F30 + bl play_some_sound +_08071A5C: + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _08071A6C + movs r0, 0xBC + lsls r0, 1 + bl song_play_for_text +_08071A6C: + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x3C + ble _08071A80 + ldr r0, =0x00000179 + bl song_play_for_text + adds r0, r5, 0 + bl DestroyTask +_08071A80: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end c3_080472E4 + + thumb_func_start sub_8071A94 +sub_8071A94: @ 8071A94 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + ldr r1, =0x03000de0 + ldr r0, [r1] + ldrb r0, [r0, 0x2] + adds r5, r1, 0 + cmp r0, 0xC + bls _08071AAC + b _08071E06 +_08071AAC: + lsls r0, 2 + ldr r1, =_08071AC0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08071AC0: + .4byte _08071AF4 + .4byte _08071B40 + .4byte _08071B68 + .4byte _08071BA0 + .4byte _08071BF8 + .4byte _08071C24 + .4byte _08071C88 + .4byte _08071C96 + .4byte _08071CA4 + .4byte _08071CE8 + .4byte _08071D1C + .4byte _08071DB4 + .4byte _08071DD4 +_08071AF4: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =gUnknown_0832BFFC + movs r1, 0x78 + movs r2, 0x4B + movs r3, 0x5 + bl AddObjectToFront + ldr r4, =0x03000de0 + ldr r1, [r4] + strb r0, [r1] + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + ldr r1, [r4] + ldrb r0, [r1, 0x2] + adds r0, 0x1 + strb r0, [r1, 0x2] + ldr r0, =c3_080472E4 + movs r1, 0x5 + bl CreateTask + b _08071E06 + .pool +_08071B40: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _08071B52 + b _08071E06 +_08071B52: + ldr r0, [r5] + ldrb r0, [r0, 0x8] + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, [r5] + strb r4, [r0, 0x3] + ldr r1, [r5] + b _08071DC8 + .pool +_08071B68: + ldr r1, [r5] + ldrb r0, [r1, 0x3] + adds r0, 0x1 + strb r0, [r1, 0x3] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1E + bhi _08071B7A + b _08071E06 +_08071B7A: + ldr r1, [r5] + ldrb r0, [r1, 0x2] + adds r0, 0x1 + strb r0, [r1, 0x2] + ldr r2, =0x02020630 + ldr r0, [r5] + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_8071E34 + str r1, [r0] + b _08071E06 + .pool +_08071BA0: + ldr r4, =0x02020630 + ldr r2, [r5] + ldrb r1, [r2] + 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, =DummyObjectCallback + cmp r1, r0 + beq _08071BBC + b _08071E06 +_08071BBC: + ldrb r1, [r2, 0x4] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, [r5] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r1, r7, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_806ED40 + ldr r1, [r5] + b _08071DC8 + .pool +_08071BF8: + ldr r2, =0x02020630 + ldr r3, [r5] + ldrb r1, [r3, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + beq _08071C12 + b _08071E06 +_08071C12: + ldrb r0, [r3, 0x2] + adds r0, 0x1 + strb r0, [r3, 0x2] + b _08071E06 + .pool +_08071C24: + ldr r0, [r5] + ldrb r1, [r0, 0x4] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02021cc4 + bl pokemon_get_nick + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085ED5A5 + adds r0, r4, 0 + bl ExpandStringRefs + ldr r0, [r5] + ldrb r0, [r0, 0x8] + movs r1, 0xFF + str r1, [sp] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl sub_8072214 + ldr r0, =0x00000173 + bl fanfare_play + ldr r1, [r5] + ldrb r0, [r1, 0x2] + adds r0, 0x1 + strb r0, [r1, 0x2] + ldr r0, [r5] + ldrb r0, [r0, 0x8] + bl PutWindowTilemap + ldr r0, [r5] + ldrb r0, [r0, 0x8] + movs r1, 0x3 + bl CopyWindowToVram + b _08071E06 + .pool +_08071C88: + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + bne _08071C94 + b _08071E06 +_08071C94: + b _08071DC4 +_08071C96: + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + bne _08071CA2 + b _08071E06 +_08071CA2: + b _08071DC4 +_08071CA4: + ldr r0, [r5] + ldrb r1, [r0, 0x4] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02021cc4 + bl pokemon_get_nick + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085ED5BE + adds r0, r4, 0 + bl ExpandStringRefs + ldr r0, [r5] + ldrb r0, [r0, 0x8] + movs r1, 0x1 + str r1, [sp] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x2 + bl sub_8072214 + ldr r1, [r5] + b _08071DC8 + .pool +_08071CE8: + ldr r0, [r5] + ldrb r0, [r0, 0x8] + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + beq _08071CF8 + b _08071E06 +_08071CF8: + ldr r0, [r5] + ldrb r0, [r0, 0x8] + movs r4, 0xA0 + lsls r4, 1 + adds r1, r4, 0 + movs r2, 0xE0 + bl sub_809882C + ldr r0, =gUnknown_0832C07C + adds r1, r4, 0 + movs r2, 0xE + movs r3, 0 + bl CreateYesNoMenu + ldr r1, [r5] + b _08071DC8 + .pool +_08071D1C: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _08071D3C + cmp r1, 0 + bgt _08071D36 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08071DC4 + b _08071E06 +_08071D36: + cmp r1, 0x1 + beq _08071DC4 + b _08071E06 +_08071D3C: + ldr r0, =0x03000de0 + mov r8, r0 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + ldr r1, =0x02021ec4 + mov r9, r1 + bl pokemon_get_nick + mov r1, r8 + ldr r0, [r1] + ldrb r0, [r0, 0x4] + muls r0, r6 + adds r0, r5 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + mov r1, r8 + ldr r0, [r1] + ldrb r0, [r0, 0x4] + muls r0, r6 + adds r0, r5 + bl pokemon_get_gender + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r1, r8 + ldr r0, [r1] + ldrb r0, [r0, 0x4] + muls r0, r6 + adds r0, r5 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + str r0, [sp] + ldr r0, =sub_80719FC + str r0, [sp, 0x4] + movs r0, 0x3 + mov r1, r9 + adds r2, r7, 0 + adds r3, r4, 0 + bl do_choose_name_or_words_screen + b _08071E06 + .pool +_08071DB4: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe +_08071DC4: + ldr r0, =0x03000de0 + ldr r1, [r0] +_08071DC8: + ldrb r0, [r1, 0x2] + adds r0, 0x1 + strb r0, [r1, 0x2] + b _08071E06 + .pool +_08071DD4: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08071E06 + bl sub_805F094 + ldr r4, =0x03000de0 + ldr r0, [r4] + ldrb r0, [r0, 0x8] + bl RemoveWindow + movs r0, 0 + bl UnsetBgTilemapBuffer + movs r0, 0x1 + bl UnsetBgTilemapBuffer + ldr r0, [r4] + bl Free + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 +_08071E06: + bl RunTasks + bl RunTextPrinters + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8071A94 + + thumb_func_start sub_8071E34 +sub_8071E34: @ 8071E34 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _08071E54 + ldr r0, =sub_8071E8C + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x2E] + b _08071E84 + .pool +_08071E54: + ldrh r0, [r4, 0x30] + adds r0, 0x14 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x1 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0xF + bne _08071E84 + movs r0, 0x17 + bl audio_play + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnim + bl sub_8072140 +_08071E84: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8071E34 + + thumb_func_start sub_8071E8C +sub_8071E8C: @ 8071E8C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1E + ble _08071EE8 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _08071EBC + ldr r0, =sub_8071EF0 + str r0, [r4, 0x1C] + strh r1, [r4, 0x2E] + strh r1, [r4, 0x32] + b _08071EE8 + .pool +_08071EBC: + ldrh r0, [r4, 0x30] + adds r0, 0x14 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x2 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0xF + bne _08071EE8 + movs r0, 0x17 + bl audio_play + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectImageAnim +_08071EE8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8071E8C + + thumb_func_start sub_8071EF0 +sub_8071EF0: @ 8071EF0 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + movs r5, 0 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1E + ble _08071F9E + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x26 + ble _08071F5C + ldr r0, =sub_8071FA4 + str r0, [r4, 0x1C] + strh r5, [r4, 0x2E] + ldr r4, =0x03000de0 + ldr r0, [r4] + ldrb r1, [r0, 0x4] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + ldr r3, =0x02020630 + ldr r2, [r4] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r5, [r0, 0x24] + ldrb r1, [r2, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r5, [r0, 0x26] + b _08071F9E + .pool +_08071F5C: + ldrh r0, [r4, 0x30] + adds r0, 0x14 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x2 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0xF + bne _08071F90 + movs r0, 0x17 + bl audio_play + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectImageAnim + bl sub_8072140 + bl sub_8072140 +_08071F90: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1E + bne _08071F9E + movs r0, 0x17 + bl audio_play +_08071F9E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8071EF0 + + thumb_func_start sub_8071FA4 +sub_8071FA4: @ 8071FA4 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x32 + ble _08071FBE + ldr r0, =sub_8071FC8 + str r0, [r1, 0x1C] + movs r0, 0 + strh r0, [r1, 0x2E] +_08071FBE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8071FA4 + + thumb_func_start sub_8071FC8 +sub_8071FC8: @ 8071FC8 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08071FE8 + movs r1, 0x1 + negs r1, r1 + ldr r0, =0x0000ffff + str r0, [sp] + adds r0, r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe +_08071FE8: + ldrh r0, [r5, 0x2E] + cmp r0, 0x3 + bhi _08072004 + movs r4, 0 +_08071FF0: + bl sub_8072140 + lsls r0, r4, 16 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _08071FF0 +_08072004: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _08072032 + movs r0, 0x71 + bl audio_play + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_8072048 + str r0, [r5, 0x1C] + strh r4, [r5, 0x2E] +_08072032: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8071FC8 + + thumb_func_start sub_8072048 +sub_8072048: @ 8072048 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08072084 + ldr r4, =0x02020630 + ldr r3, =0x03000de0 + ldr r0, [r3] + ldrb r1, [r0, 0x1] + 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] + ldr r0, [r3] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartObjectRotScalAnim +_08072084: + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0x8 + bne _0807209E + movs r1, 0x1 + negs r1, r1 + ldr r0, =0x0000ffff + str r0, [sp] + adds r0, r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe +_0807209E: + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x9 + bgt _080720BC + ldr r2, =0x02020630 + ldr r0, =0x03000de0 + ldr r0, [r0] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + subs r1, 0x1 + strh r1, [r0, 0x22] +_080720BC: + ldrh r1, [r5, 0x2E] + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0x28 + ble _080720CA + ldr r0, =DummyObjectCallback + str r0, [r5, 0x1C] +_080720CA: + adds r0, r1, 0x1 + strh r0, [r5, 0x2E] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8072048 + + thumb_func_start sub_80720E8 +sub_80720E8: @ 80720E8 + push {r4,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x30] + ldrh r1, [r2, 0x36] + adds r0, r1 + strh r0, [r2, 0x36] + ldrh r1, [r2, 0x32] + ldrh r3, [r2, 0x38] + adds r0, r1, r3 + strh r0, [r2, 0x38] + movs r4, 0x36 + ldrsh r0, [r2, r4] + cmp r0, 0 + bge _08072106 + adds r0, 0xFF +_08072106: + asrs r0, 8 + strh r0, [r2, 0x24] + movs r3, 0x38 + ldrsh r0, [r2, r3] + cmp r0, 0 + bge _08072114 + adds r0, 0xFF +_08072114: + asrs r0, 8 + strh r0, [r2, 0x26] + ldrh r0, [r2, 0x34] + adds r3, r1, r0 + strh r3, [r2, 0x32] + movs r4, 0x22 + ldrsh r1, [r2, r4] + movs r4, 0x26 + ldrsh r0, [r2, r4] + adds r0, r1, r0 + adds r1, 0x14 + cmp r0, r1 + ble _0807213A + lsls r0, r3, 16 + cmp r0, 0 + ble _0807213A + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles +_0807213A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80720E8 + + thumb_func_start sub_8072140 +sub_8072140: @ 8072140 + push {r4-r6,lr} + sub sp, 0x8 + ldr r2, =gUnknown_0832C084 + ldr r0, =0x03000de0 + ldr r6, [r0] + ldrb r3, [r6, 0x7] + lsls r0, r3, 2 + adds r1, r0, r2 + ldrh r5, [r1] + adds r2, 0x2 + adds r0, r2 + ldrh r4, [r0] + adds r3, 0x1 + strb r3, [r6, 0x7] + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + lsls r5, 16 + asrs r5, 16 + lsls r4, 16 + asrs r4, 16 + movs r0, 0x64 + str r0, [sp] + lsrs r1, 16 + str r1, [sp, 0x4] + movs r0, 0x78 + movs r1, 0x3C + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_8072194 + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8072140 + + thumb_func_start sub_8072194 +sub_8072194: @ 8072194 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + mov r8, r3 + ldr r0, [sp, 0x1C] + mov r9, r0 + ldr r1, [sp, 0x20] + mov r10, r1 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 16 + lsrs r6, 16 + mov r0, r8 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + mov r1, r9 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r0, =gUnknown_0832C04C + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0x4 + bl AddObjectToFront + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r6, [r0, 0x30] + mov r1, r8 + strh r1, [r0, 0x32] + mov r1, r9 + strh r1, [r0, 0x34] + mov r1, r10 + bl StartObjectImageAnim + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8072194 + + thumb_func_start sub_8072214 +sub_8072214: @ 8072214 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x14 + adds r5, r0, 0 + mov r9, r1 + adds r6, r2, 0 + mov r8, r3 + ldr r4, [sp, 0x2C] + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0xFF + bl FillWindowPixelBuffer + ldr r3, =0x03000de0 + ldr r0, [r3] + movs r2, 0 + strb r2, [r0, 0xE] + ldr r1, [r3] + movs r0, 0x5 + strb r0, [r1, 0xF] + ldr r1, [r3] + movs r0, 0x6 + strb r0, [r1, 0x10] + str r2, [sp] + str r2, [sp, 0x4] + ldr r0, [r3] + adds r0, 0xE + str r0, [sp, 0x8] + lsls r4, 24 + asrs r4, 24 + str r4, [sp, 0xC] + mov r0, r9 + str r0, [sp, 0x10] + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r6, 0 + mov r3, r8 + bl AddTextPrinterParametrized2 + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8072214 + + thumb_func_start sub_807228C +sub_807228C: @ 807228C + push {r4-r6,lr} + bl calc_player_party_count + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + cmp r5, r6 + bcs _080722D6 +_0807229C: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _080722CC + adds r0, r4, 0 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x28 + beq _080722C4 + cmp r0, 0x31 + bne _080722CC +_080722C4: + movs r0, 0x2 + b _080722D8 + .pool +_080722CC: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r6 + bcc _0807229C +_080722D6: + movs r0, 0x1 +_080722D8: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_807228C + + thumb_func_start sub_80722E0 +sub_80722E0: @ 80722E0 + push {r4,lr} + bl sub_80D22D0 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x6 + bl sub_80C7050 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80722E0 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/evolution_scene.s b/asm/evolution_scene.s new file mode 100644 index 000000000..b29497636 --- /dev/null +++ b/asm/evolution_scene.s @@ -0,0 +1,4216 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_813D9B0 +sub_813D9B0: @ 813D9B0 + push {lr} + bl fade_and_return_progress_probably + bl RunTasks + pop {r0} + bx r0 + thumb_func_end sub_813D9B0 + + thumb_func_start sub_813D9C0 +sub_813D9C0: @ 813D9C0 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + movs r7, 0 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r6, r0, r1 + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _0813D9E8 + cmp r0, 0x1 + beq _0813DA00 + b _0813DA30 + .pool +_0813D9E8: + movs r0, 0x1 + negs r0, r0 + str r7, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + b _0813DA30 +_0813DA00: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0813DA30 + movs r0, 0x1C + ldrsh r1, [r6, r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r7, r1, r0 + ldrh r4, [r6, 0xC] + ldrb r5, [r6, 0xE] + ldrb r6, [r6, 0x1C] + adds r0, r2, 0 + bl DestroyTask + adds r0, r7, 0 + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl evolution_cutscene +_0813DA30: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813D9C0 + + thumb_func_start sub_813DA40 +sub_813DA40: @ 813DA40 + push {r4-r6,lr} + 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 r0, =sub_813D9C0 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x8] + strh r4, [r1, 0xC] + strh r5, [r1, 0xE] + strh r6, [r1, 0x1C] + ldr r0, =sub_813D9B0 + bl SetMainCallback2 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813DA40 + + thumb_func_start evolution_cutscene +evolution_cutscene: @ 813DA8C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + adds r4, r0, 0 + mov r10, r1 + mov r0, r10 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x18] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x1C] + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r1, 0 + str r1, [sp, 0x14] + add r0, sp, 0x14 + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + bl CpuSet + 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 + bl sub_80A1A74 + ldr r0, =0x02022e14 + movs r2, 0 + strh r2, [r0] + ldr r0, =0x02022e16 + strh r2, [r0] + ldr r0, =0x02022e18 + strh r2, [r0] + ldr r0, =0x02022e1a + strh r2, [r0] + ldr r0, =0x02022e1c + strh r2, [r0] + ldr r0, =0x02022e1e + strh r2, [r0] + ldr r1, =0x02022e20 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, =0x02022e22 + movs r1, 0 + strh r1, [r0] + ldr r1, =0x02022ff0 + movs r0, 0x9 + strb r0, [r1] + bl c2_berry_program_update_menu + bl sub_8035AA4 + bl ResetAllObjectData + bl remove_some_task + bl ResetTasks + bl ResetObjectPaletteAllocator + ldr r0, =0x0300301c + movs r2, 0x4 + strb r2, [r0] + movs r0, 0x64 + bl AllocZeroed + ldr r1, =0x0203ab80 + str r0, [r1] + bl init_uns_table_pokemon_copy + adds r0, r4, 0 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + ldr r0, =0x02021cc4 + mov r1, sp + bl CopyString_Limit10 + ldr r0, =0x02021dc4 + movs r1, 0xB + mov r2, r10 + muls r2, r1 + adds r1, r2, 0 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr + str r0, [sp, 0x20] + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + mov r9, r0 + lsls r0, r5, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r2, =0x020244d4 + ldr r1, [r2] + ldr r1, [r1, 0x8] + adds r2, r5, 0 + bl DecompressPicFromTable_2 + adds r0, r5, 0 + ldr r1, [sp, 0x20] + mov r2, r9 + bl sub_806E7CC + ldr r0, [r0] + movs r1, 0x88 + lsls r1, 1 + movs r2, 0x20 + bl decompress_palette + adds r0, r5, 0 + movs r1, 0x1 + bl sub_806A068 + ldr r0, =0x0202499c + mov r8, r0 + ldr r1, =gDummyObjectRotScalAnimTable + str r1, [r0, 0x10] + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1E + bl AddObjectToFront + ldr r1, =0x0203ab80 + ldr r2, [r1] + lsls r1, r0, 24 + lsrs r3, r1, 24 + strb r0, [r2] + ldr r7, =0x02020630 + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r6, r7, 0 + adds r6, 0x1C + adds r0, r1, r6 + ldr r2, =nullsub_18 + str r2, [r0] + adds r1, r7 + ldrb r2, [r1, 0x5] + movs r4, 0xF + adds r0, r4, 0 + ands r0, r2 + movs r2, 0x10 + orrs r0, r2 + strb r0, [r1, 0x5] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + mov r1, r10 + lsls r0, r1, 3 + ldr r2, =gMonFrontPicTable + adds r0, r2 + ldr r2, =0x020244d4 + ldr r1, [r2] + ldr r1, [r1, 0x10] + mov r2, r10 + bl DecompressPicFromTable_2 + mov r0, r10 + ldr r1, [sp, 0x20] + mov r2, r9 + bl sub_806E7CC + ldr r0, [r0] + movs r1, 0x90 + lsls r1, 1 + movs r2, 0x20 + bl decompress_palette + mov r0, r10 + movs r1, 0x3 + bl sub_806A068 + ldr r0, =gDummyObjectRotScalAnimTable + mov r1, r8 + str r0, [r1, 0x10] + mov r0, r8 + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1E + bl AddObjectToFront + ldr r1, =0x0203ab80 + ldr r2, [r1] + lsls r1, r0, 24 + lsrs r3, r1, 24 + strb r0, [r2, 0x1] + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r6, r1, r6 + ldr r2, =nullsub_18 + str r2, [r6] + adds r1, r7 + ldrb r0, [r1, 0x5] + ands r4, r0 + movs r0, 0x20 + orrs r4, r0 + strb r4, [r1, 0x5] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_817BE78 + ldr r0, =evovle_mon_maybe + movs r1, 0 + bl CreateTask + ldr r1, =0x0203ab80 + ldr r2, [r1] + lsls r1, r0, 24 + lsrs r3, r1, 24 + strb r0, [r2, 0x2] + ldr r1, =0x03005e00 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + strh r2, [r0, 0x8] + strh r5, [r0, 0xA] + mov r1, r10 + strh r1, [r0, 0xC] + mov r2, sp + ldrh r2, [r2, 0x18] + strh r2, [r0, 0xE] + movs r1, 0x1 + strh r1, [r0, 0x10] + movs r1, 0 + strh r1, [r0, 0x1A] + mov r2, sp + ldrh r2, [r2, 0x1C] + strh r2, [r0, 0x1C] + ldr r1, =0x0203ab80 + ldr r0, [r1] + ldr r1, =0x02037754 + adds r0, 0x4 + movs r2, 0x60 + bl memcpy + movs r1, 0xFA + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r0, =nullsub_83 + bl SetHBlankCallback + ldr r0, =sub_813FCDC + bl SetVBlankCallback + bl m4aMPlayAllStop + ldr r0, =sub_813E3A4 + bl SetMainCallback2 + 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 evolution_cutscene + + thumb_func_start sub_813DD7C +sub_813DD7C: @ 813DD7C + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x8 + ldr r2, =0x03005e00 + ldr r0, =0x0203ab80 + mov r8, r0 + ldr r0, [r0] + ldrb r1, [r0, 0x2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x1C + ldrsh r2, [r0, r1] + movs r1, 0x64 + adds r4, r2, 0 + muls r4, r1 + ldr r1, =0x020244ec + adds r4, r1 + ldrh r5, [r0, 0xC] + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr + mov r9, r0 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + adds r6, r0, 0 + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r4, 0 + str r4, [sp, 0x4] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + add r0, sp, 0x4 + bl CpuSet + 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 + bl sub_80A1A74 + ldr r0, =0x02022e14 + strh r4, [r0] + ldr r0, =0x02022e16 + strh r4, [r0] + ldr r0, =0x02022e18 + strh r4, [r0] + ldr r0, =0x02022e1a + strh r4, [r0] + ldr r0, =0x02022e1c + strh r4, [r0] + ldr r0, =0x02022e1e + strh r4, [r0] + ldr r1, =0x02022e20 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, =0x02022e22 + strh r4, [r0] + ldr r1, =0x02022ff0 + movs r0, 0x9 + strb r0, [r1] + bl c2_berry_program_update_menu + bl sub_8035AA4 + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + ldr r1, =0x0300301c + movs r0, 0x4 + strb r0, [r1] + lsls r0, r5, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + ldr r1, [r1, 0x10] + adds r2, r5, 0 + bl DecompressPicFromTable_2 + adds r0, r5, 0 + mov r1, r9 + adds r2, r6, 0 + bl sub_806E7CC + ldr r0, [r0] + movs r1, 0x90 + lsls r1, 1 + movs r2, 0x20 + bl decompress_palette + adds r0, r5, 0 + movs r1, 0x3 + bl sub_806A068 + ldr r0, =0x0202499c + ldr r1, =gDummyObjectRotScalAnimTable + str r1, [r0, 0x10] + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1E + bl AddObjectToFront + mov r2, r8 + ldr r1, [r2] + lsls r2, r0, 24 + lsrs r2, 24 + strb r0, [r1, 0x1] + ldr r3, =0x02020630 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x1C + adds r0, r1, r0 + ldr r2, =nullsub_18 + str r2, [r0] + adds r1, r3 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + movs r2, 0x20 + orrs r0, r2 + strb r0, [r1, 0x5] + movs r1, 0xFA + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r0, =nullsub_83 + bl SetHBlankCallback + ldr r0, =sub_813FCDC + bl SetVBlankCallback + ldr r0, =sub_813E3A4 + bl SetMainCallback2 + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813DD7C + + thumb_func_start sub_813DF70 +sub_813DF70: @ 813DF70 + push {r4-r6,lr} + sub sp, 0xC + ldr r2, =0x03005e00 + ldr r0, =0x0203ab80 + ldr r0, [r0] + ldrb r1, [r0, 0x2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x1C + ldrsh r2, [r0, r1] + movs r1, 0x64 + muls r2, r1 + ldr r1, =0x020244ec + adds r4, r2, r1 + ldrh r6, [r0, 0xC] + ldr r0, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0x7 + bls _0813DFA2 + b _0813E1C8 +_0813DFA2: + lsls r0, 2 + ldr r1, =_0813DFC0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0813DFC0: + .4byte _0813DFE0 + .4byte _0813E050 + .4byte _0813E078 + .4byte _0813E07E + .4byte _0813E0A8 + .4byte _0813E0F0 + .4byte _0813E160 + .4byte _0813E198 +_0813DFE0: + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + ldr r1, =0x0300301c + movs r0, 0x4 + strb r0, [r1] + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r0, =0x02022e18 + strh r1, [r0] + ldr r0, =0x02022e1a + strh r1, [r0] + ldr r0, =0x02022e1c + strh r1, [r0] + ldr r0, =0x02022e1e + strh r1, [r0] + ldr r2, =0x02022e20 + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + strh r0, [r2] + ldr r0, =0x02022e22 + strh r1, [r0] + b _0813E180 + .pool +_0813E050: + bl sub_80A1A74 + ldr r0, =nullsub_83 + bl SetHBlankCallback + ldr r0, =sub_813FD64 + bl SetVBlankCallback + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _0813E188 + .pool +_0813E078: + bl sub_807F19C + b _0813E180 +_0813E07E: + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _0813E188 + .pool +_0813E0A8: + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr + adds r5, r0, 0 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r0, r6, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + ldr r1, [r1, 0x10] + adds r2, r6, 0 + bl DecompressPicFromTable_2 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_806E7CC + ldr r0, [r0] + movs r1, 0x90 + lsls r1, 1 + movs r2, 0x20 + bl decompress_palette + b _0813E180 + .pool +_0813E0F0: + adds r0, r6, 0 + movs r1, 0x1 + bl sub_806A068 + ldr r0, =0x0202499c + ldr r1, =gDummyObjectRotScalAnimTable + str r1, [r0, 0x10] + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1E + bl AddObjectToFront + ldr r1, =0x0203ab80 + ldr r1, [r1] + lsls r2, r0, 24 + lsrs r2, 24 + strb r0, [r1, 0x1] + ldr r3, =0x02020630 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x1C + adds r0, r1, r0 + ldr r2, =nullsub_18 + str r2, [r0] + adds r1, r3 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + movs r2, 0x20 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bl sub_807B154 + b _0813E1C8 + .pool +_0813E160: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _0813E174 + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 +_0813E174: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 +_0813E180: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_0813E188: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0813E1C8 + .pool +_0813E198: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + bl sub_807B140 + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + ldr r0, =sub_813E3C0 + bl SetMainCallback2 + movs r1, 0x9A + lsls r1, 5 + movs r0, 0 + bl SetGpuReg +_0813E1C8: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813DF70 + + thumb_func_start sub_813E1D4 +sub_813E1D4: @ 813E1D4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 24 + lsrs r6, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x14] + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + ldr r0, =0x02021cc4 + mov r1, sp + bl CopyString_Limit10 + ldr r0, =0x02021dc4 + movs r1, 0xB + muls r1, r5 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r1, =0x02021cc0 + movs r0, 0x1 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + adds r7, r0, 0 + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr + mov r10, r0 + ldr r1, =0x0203ab80 + mov r9, r1 + movs r0, 0x64 + bl AllocZeroed + mov r2, r9 + str r0, [r2] + movs r4, 0 + strb r6, [r0] + lsls r0, r5, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + ldr r1, [r1, 0x8] + adds r2, r5, 0 + bl DecompressPicFromTable_2 + adds r0, r5, 0 + mov r1, r10 + adds r2, r7, 0 + bl sub_806E7CC + ldr r0, [r0] + movs r1, 0x90 + lsls r1, 1 + movs r2, 0x20 + bl decompress_palette + adds r0, r5, 0 + movs r1, 0x1 + bl sub_806A068 + ldr r0, =0x0202499c + ldr r1, =gDummyObjectRotScalAnimTable + str r1, [r0, 0x10] + movs r1, 0x78 + movs r2, 0x40 + movs r3, 0x1E + bl AddObjectToFront + mov r1, r9 + ldr r2, [r1] + lsls r1, r0, 24 + lsrs r6, r1, 24 + strb r0, [r2, 0x1] + ldr r3, =0x02020630 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x1C + adds r0, r1, r0 + ldr r2, =nullsub_18 + str r2, [r0] + adds r1, r3 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + movs r2, 0x20 + orrs r0, r2 + strb r0, [r1, 0x5] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bl sub_817BE78 + ldr r0, =sub_813F1B8 + movs r1, 0 + bl CreateTask + mov r1, r9 + ldr r2, [r1] + lsls r1, r0, 24 + lsrs r6, r1, 24 + strb r0, [r2, 0x2] + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0x8] + mov r2, r8 + strh r2, [r0, 0xA] + strh r5, [r0, 0xC] + movs r1, 0x1 + strh r1, [r0, 0x10] + strh r4, [r0, 0x1A] + mov r1, sp + ldrh r1, [r1, 0x14] + strh r1, [r0, 0x1C] + ldr r0, =0x02022e14 + strh r4, [r0] + ldr r0, =0x02022e16 + strh r4, [r0] + ldr r0, =0x02022e18 + strh r4, [r0] + ldr r0, =0x02022e1a + strh r4, [r0] + ldr r0, =0x02022e1c + strh r4, [r0] + ldr r0, =0x02022e1e + strh r4, [r0] + ldr r1, =0x02022e20 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, =0x02022e22 + strh r4, [r0] + ldr r2, =0x03003014 + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_813FD64 + bl SetVBlankCallback + ldr r0, =sub_813E3C0 + bl SetMainCallback2 + 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_813E1D4 + + thumb_func_start sub_813E3A4 +sub_813E3A4: @ 813E3A4 + push {lr} + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + bl RunTasks + pop {r0} + bx r0 + thumb_func_end sub_813E3A4 + + thumb_func_start sub_813E3C0 +sub_813E3C0: @ 813E3C0 + push {lr} + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + bl RunTasks + pop {r0} + bx r0 + thumb_func_end sub_813E3C0 + + thumb_func_start evovle_mon_internal_maybe +evovle_mon_internal_maybe: @ 813E3DC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + str r1, [sp, 0x4] + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + movs r0, 0 + str r0, [sp] + mov r0, r10 + lsls r0, 2 + str r0, [sp, 0x8] + add r0, r10 + lsls r7, r0, 3 + ldr r1, =gEvolutionTable + adds r1, r7 + mov r8, r1 + ldrh r0, [r1] + cmp r0, 0xD + beq _0813E40C + b _0813E546 +_0813E40C: + ldr r6, =0x020244e9 + ldrb r0, [r6] + cmp r0, 0x5 + bls _0813E416 + b _0813E546 +_0813E416: + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + mov r9, r0 + ldr r1, [sp, 0x4] + movs r2, 0x64 + bl memcpy_pokemon + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + ldr r1, =gEvolutionTable + adds r2, r1, r7 + adds r2, 0xC + movs r1, 0xB + bl pokemon_setattr + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + mov r1, r8 + ldrh r2, [r1, 0xC] + movs r1, 0xB + muls r2, r1 + ldr r1, =gSpeciesNames + adds r2, r1 + movs r1, 0x2 + bl pokemon_setattr + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0x8 + mov r2, sp + bl pokemon_setattr + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0xA + mov r2, sp + bl pokemon_setattr + movs r4, 0x32 + ldr r0, [sp, 0x8] + mov r8, r0 + adds r5, r6, 0 +_0813E484: + ldrb r1, [r5] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + adds r1, r4, 0 + mov r2, sp + bl pokemon_setattr + adds r4, 0x1 + cmp r4, 0x36 + ble _0813E484 + movs r4, 0x43 + ldr r7, =0x020244e9 +_0813E4A0: + ldrb r0, [r7] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + adds r1, r4, 0 + mov r2, sp + bl pokemon_setattr + adds r4, 0x1 + cmp r4, 0x4F + ble _0813E4A0 + ldr r4, =0x020244e9 + ldrb r0, [r4] + muls r0, r6 + adds r0, r5 + movs r1, 0x37 + mov r2, sp + bl pokemon_setattr + movs r0, 0xFF + str r0, [sp] + ldrb r0, [r4] + muls r0, r6 + adds r0, r5 + movs r1, 0x40 + mov r2, sp + bl pokemon_setattr + ldrb r0, [r4] + muls r0, r6 + adds r0, r5 + bl pokemon_calc_effective_stats + bl calc_player_party_count + ldr r0, =gEvolutionTable + mov r4, r8 + add r4, r10 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r4, 0xC] + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2 + bl pokedex_flag_operation + ldrh r0, [r4, 0xC] + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl pokedex_flag_operation + mov r0, r9 + movs r1, 0xB + bl pokemon_getattr + ldr r1, =0x0000012f + cmp r0, r1 + bne _0813E546 + mov r0, r9 + movs r1, 0x3 + bl pokemon_getattr + cmp r0, 0x1 + bne _0813E546 + ldr r0, [sp, 0x4] + movs r1, 0xB + bl pokemon_getattr + movs r1, 0x97 + lsls r1, 1 + cmp r0, r1 + bne _0813E546 + ldr r2, =gUnknown_085B58C4 + mov r0, r9 + movs r1, 0x2 + bl pokemon_setattr +_0813E546: + 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 evovle_mon_internal_maybe + + thumb_func_start evovle_mon_maybe +evovle_mon_maybe: @ 813E570 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r3, r0, r2 + movs r0, 0x1C + ldrsh r1, [r3, r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r1, r0 + mov r9, r1 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2C] + adds r5, r2, 0 + adds r6, r0, 0 + cmp r1, 0x2 + bne _0813E5F0 + movs r1, 0x8 + ldrsh r0, [r3, r1] + cmp r0, 0x8 + bne _0813E5F0 + ldr r4, =0x02024332 + ldrb r0, [r4, 0x2] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _0813E5F0 + ldrh r1, [r3, 0xE] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0813E5F0 + movs r0, 0x11 + strh r0, [r3, 0x8] + ldrb r1, [r4, 0x2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r2, [r0, 0x18] + bl sub_8140134 + bl _0813F1A4 + .pool +_0813E5F0: + lsls r1, r7, 2 + adds r0, r1, r7 + lsls r0, 3 + adds r0, r5 + movs r2, 0x8 + ldrsh r0, [r0, r2] + mov r8, r1 + cmp r0, 0x16 + bls _0813E606 + bl _0813F1A4 +_0813E606: + lsls r0, 2 + ldr r1, =_0813E614 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0813E614: + .4byte _0813E670 + .4byte _0813E6D4 + .4byte _0813E714 + .4byte _0813E740 + .4byte _0813E770 + .4byte _0813E7B0 + .4byte _0813E7E8 + .4byte _0813E828 + .4byte _0813E860 + .4byte _0813E8A4 + .4byte _0813E8C0 + .4byte _0813E8EC + .4byte _0813E918 + .4byte _0813E964 + .4byte _0813E990 + .4byte _0813EA1C + .4byte _0813EAC8 + .4byte _0813EB34 + .4byte _0813EB74 + .4byte _0813EBA8 + .4byte _0813EC10 + .4byte _0813EC6C + .4byte _0813ECA8 +_0813E670: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r2, =0x02020630 + ldr r0, =0x0203ab80 + ldr r0, [r0] + ldrb r1, [r0] + 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] + ldr r0, =0x03005e00 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + bl _0813F1A4 + .pool +_0813E6D4: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0813E6E4 + bl _0813F1A4 +_0813E6E4: + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085CC990 + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0 + bl battle_show_message_maybe + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + b _0813EC52 + .pool +_0813E714: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + beq _0813E724 + bl _0813F1A4 +_0813E724: + ldr r0, =0x0203ab80 + ldr r0, [r0] + ldrb r0, [r0] + ldr r1, =0x03005e00 + mov r3, r8 + adds r4, r3, r7 + lsls r4, 3 + adds r4, r1 + b _0813EB90 + .pool +_0813E740: + ldr r0, =0x0203ab80 + ldr r0, [r0] + ldrb r0, [r0] + bl sub_8140208 + cmp r0, 0 + bne _0813E752 + bl _0813F1A4 +_0813E752: + movs r0, 0xBC + lsls r0, 1 + bl audio_play + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + b _0813EC52 + .pool +_0813E770: + bl mplay_has_finished_maybe + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0813E780 + bl _0813F1A4 +_0813E780: + ldr r0, =0x00000179 + bl current_map_music_set + ldr r0, =0x03005e00 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + str r4, [sp] + movs r0, 0x1C + movs r1, 0x4 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + bl _0813F1A4 + .pool +_0813E7B0: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0813E7C0 + bl _0813F1A4 +_0813E7C0: + movs r0, 0 + bl sub_8140000 + movs r0, 0x11 + bl sub_817BE94 + ldr r1, =0x02024332 + strb r0, [r1, 0x2] + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + b _0813EC52 + .pool +_0813E7E8: + ldr r4, =0x02024332 + ldrb r0, [r4, 0x2] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _0813E7FE + bl _0813F1A4 +_0813E7FE: + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r5 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + ldr r0, =0x0203ab80 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x3] + bl sub_817BFB4 + strb r0, [r4, 0x2] + bl _0813F1A4 + .pool +_0813E828: + ldr r4, =0x02024332 + ldrb r0, [r4, 0x2] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _0813E83E + bl _0813F1A4 +_0813E83E: + ldr r0, =0x0203ab80 + ldr r1, [r0] + ldrb r0, [r1] + ldrb r1, [r1, 0x1] + bl sub_817C3A0 + strb r0, [r4, 0x2] + mov r0, r8 + adds r1, r0, r7 + lsls r1, 3 + adds r1, r5 + b _0813EC52 + .pool +_0813E860: + ldr r2, =0x0203ab80 + ldr r1, [r2] + ldrb r0, [r1, 0x3] + subs r0, 0x1 + strb r0, [r1, 0x3] + lsls r0, 24 + cmp r0, 0 + beq _0813E874 + bl _0813F1A4 +_0813E874: + ldr r1, [r2] + movs r0, 0x3 + strb r0, [r1, 0x3] + ldr r0, =0x02024332 + ldrb r1, [r0, 0x2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _0813E890 + bl _0813F1A4 +_0813E890: + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r5 + b _0813EC52 + .pool +_0813E8A4: + bl sub_817C068 + ldr r1, =0x02024332 + strb r0, [r1, 0x2] + ldr r0, =0x03005e00 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + b _0813EC52 + .pool +_0813E8C0: + ldr r6, =0x02024332 + ldrb r0, [r6, 0x2] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _0813E8D6 + bl _0813F1A4 +_0813E8D6: + mov r0, r8 + adds r4, r0, r7 + lsls r4, 3 + adds r4, r5 + ldrh r0, [r4, 0xC] + bl sub_817C144 + strb r0, [r6, 0x2] + b _0813EB96 + .pool +_0813E8EC: + ldr r0, =0x02024332 + ldrb r1, [r0, 0x2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _0813E902 + bl _0813F1A4 +_0813E902: + movs r0, 0x21 + bl audio_play + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r5 + b _0813EC52 + .pool +_0813E918: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _0813E926 + bl _0813F1A4 +_0813E926: + bl m4aMPlayAllStop + ldr r0, =0x02037754 + ldr r1, =0x0203ab80 + ldr r1, [r1] + adds r1, 0x4 + movs r2, 0x60 + bl memcpy + bl sub_8140174 + movs r0, 0 + str r0, [sp] + movs r0, 0x1C + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =0x03005e00 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + b _0813EC52 + .pool +_0813E964: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0813E974 + bl _0813F1A4 +_0813E974: + ldr r0, =0x0203ab80 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + mov r1, r8 + adds r4, r1, r7 + lsls r4, 3 + adds r4, r5 + ldrh r1, [r4, 0xC] + b _0813EB92 + .pool +_0813E990: + bl sub_80A3678 + lsls r0, 24 + cmp r0, 0 + bne _0813E99E + bl _0813F1A4 +_0813E99E: + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085CC9A6 + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0 + bl battle_show_message_maybe + ldr r0, =0x00000173 + bl song_play_for_text + ldr r2, =0x03005e00 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + adds r2, r1 + adds r2, 0xC + mov r0, r9 + movs r1, 0xB + bl pokemon_setattr + mov r0, r9 + bl pokemon_calc_effective_stats + ldrh r1, [r4, 0xA] + ldrh r2, [r4, 0xC] + mov r0, r9 + bl sub_806D778 + ldrh r0, [r4, 0xC] + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2 + bl pokedex_flag_operation + ldrh r0, [r4, 0xC] + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl pokedex_flag_operation + movs r0, 0xE + bl sav12_xor_increment + b _0813F1A4 + .pool +_0813EA1C: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + beq _0813EA2A + b _0813F1A4 +_0813EA2A: + ldr r1, =0x03005e00 + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r4, r0, r1 + ldrb r1, [r4, 0x10] + mov r0, r9 + bl sub_8069318 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0 + beq _0813EAA8 + movs r3, 0x1A + ldrsh r5, [r4, r3] + cmp r5, 0 + bne _0813EAA8 + ldrh r1, [r4, 0xE] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0813EA5E + bl sub_80A2F30 + bl sub_8085784 +_0813EA5E: + ldrh r0, [r4, 0xE] + movs r1, 0x80 + orrs r0, r1 + strh r0, [r4, 0xE] + strh r5, [r4, 0x10] + strh r5, [r4, 0x14] + mov r0, r9 + movs r1, 0x2 + add r2, sp, 0x4 + bl pokemon_getattr + ldr r0, =0x02022f58 + add r1, sp, 0x4 + bl CopyString_Limit10 + ldr r0, =0x0000ffff + cmp r6, r0 + bne _0813EA94 + movs r0, 0x16 + strh r0, [r4, 0x8] + b _0813F1A4 + .pool +_0813EA94: + ldr r0, =0x0000fffe + cmp r6, r0 + bne _0813EA9C + b _0813F1A4 +_0813EA9C: + movs r0, 0x14 + strh r0, [r4, 0x8] + b _0813F1A4 + .pool +_0813EAA8: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + b _0813EC52 + .pool +_0813EAC8: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r2, 0x80 + adds r0, r2, 0 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + beq _0813EADC + b _0813F1A4 +_0813EADC: + mov r3, r8 + adds r0, r3, r7 + lsls r0, 3 + adds r4, r0, r5 + ldrh r1, [r4, 0xE] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _0813EAF6 + bl sub_80A2F30 + bl sub_8085784 +_0813EAF6: + movs r1, 0x1A + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0813EB06 + ldrh r0, [r4, 0xA] + mov r1, r9 + bl evovle_mon_internal_maybe +_0813EB06: + adds r0, r7, 0 + bl DestroyTask + bl sub_805F094 + ldr r4, =0x0203ab80 + ldr r0, [r4] + bl Free + str r6, [r4] + bl FreeAllWindowBuffers + ldr r0, =0x030061e8 + ldr r0, [r0] + bl SetMainCallback2 + b _0813F1A4 + .pool +_0813EB34: + ldr r0, =0x02024332 + ldrb r1, [r0, 0x2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _0813EB48 + b _0813F1A4 +_0813EB48: + bl m4aMPlayAllStop + ldr r0, =0x0006001c + ldr r1, =0x00007fff + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r5 + b _0813EC52 + .pool +_0813EB74: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0813EB82 + b _0813F1A4 +_0813EB82: + ldr r0, =0x0203ab80 + ldr r0, [r0] + ldrb r0, [r0] + mov r3, r8 + adds r4, r3, r7 + lsls r4, 3 + adds r4, r5 +_0813EB90: + ldrh r1, [r4, 0xA] +_0813EB92: + bl sub_81401E0 +_0813EB96: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0813F1A4 + .pool +_0813EBA8: + ldr r0, =0x0203ab80 + ldr r0, [r0] + ldrb r0, [r0] + bl sub_8140208 + cmp r0, 0 + bne _0813EBB8 + b _0813F1A4 +_0813EBB8: + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + movs r3, 0x1A + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _0813EBE4 + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085CC9EE + bl ExpandStringRefs + b _0813EBEC + .pool +_0813EBE4: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085CC9D3 + bl ExpandStringRefs +_0813EBEC: + ldr r0, =0x02021fc4 + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =0x03005e00 + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x1A] + b _0813F16E + .pool +_0813EC10: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + beq _0813EC1E + b _0813F1A4 +_0813EC1E: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _0813EC2A + b _0813F1A4 +_0813EC2A: + bl sub_804F574 + ldr r0, =0x0000016f + bl fanfare_play + ldr r0, =gUnknown_085CC270 + ldr r0, [r0, 0xC] + bl get_battle_strings_ + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + ldr r0, =0x03005e00 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + movs r0, 0x40 + strh r0, [r1, 0x10] +_0813EC52: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0813F1A4 + .pool +_0813EC6C: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + beq _0813EC7A + b _0813F1A4 +_0813EC7A: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _0813EC86 + b _0813F1A4 +_0813EC86: + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x10] + subs r0, 0x1 + strh r0, [r1, 0x10] + lsls r0, 16 + cmp r0, 0 + beq _0813EC9E + b _0813F1A4 +_0813EC9E: + movs r0, 0xF + strh r0, [r1, 0x8] + b _0813F1A4 + .pool +_0813ECA8: + mov r3, r8 + adds r0, r3, r7 + lsls r0, 3 + adds r0, r5 + movs r1, 0x14 + ldrsh r0, [r0, r1] + cmp r0, 0xC + bls _0813ECBA + b _0813F1A4 +_0813ECBA: + lsls r0, 2 + ldr r1, =_0813ECC8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0813ECC8: + .4byte _0813ECFC + .4byte _0813ED48 + .4byte _0813ED90 + .4byte _0813EDCE + .4byte _0813EE34 + .4byte _0813EF30 + .4byte _0813EF88 + .4byte _0813F05C + .4byte _0813F090 + .4byte _0813F0D8 + .4byte _0813F120 + .4byte _0813F154 + .4byte _0813F180 +_0813ECFC: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + beq _0813ED0A + b _0813F1A4 +_0813ED0A: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _0813ED16 + b _0813F1A4 +_0813ED16: + bl sub_804F574 + ldr r0, =gUnknown_085CC270 + ldr r0, [r0, 0x10] + bl get_battle_strings_ + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + b _0813F1A2 + .pool +_0813ED48: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + beq _0813ED56 + b _0813F1A4 +_0813ED56: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _0813ED62 + b _0813F1A4 +_0813ED62: + ldr r0, =gUnknown_085CC270 + ldr r0, [r0, 0x14] + bl get_battle_strings_ + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + ldr r0, =0x03005e00 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + b _0813F1A2 + .pool +_0813ED90: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _0813EDCE + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _0813EDCE + ldr r0, =gUnknown_085CC270 + ldr r0, [r0, 0x18] + bl get_battle_strings_ + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + movs r0, 0x5 + strh r0, [r1, 0x16] + movs r0, 0xA + strh r0, [r1, 0x18] + ldrh r0, [r1, 0x14] + adds r0, 0x1 + strh r0, [r1, 0x14] +_0813EDCE: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + beq _0813EDDC + b _0813F1A4 +_0813EDDC: + bl mplay_has_finished_maybe + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _0813EDEA + b _0813F1A4 +_0813EDEA: + str r0, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r0, =gUnknown_085CCABB + movs r1, 0xC + bl battle_show_message_maybe + ldr r0, =0x03005e00 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + movs r2, 0 + strh r0, [r1, 0x14] + ldr r0, =0x02024332 + strb r2, [r0, 0x1] + movs r0, 0 + bl sub_8056B74 + b _0813F1A4 + .pool +_0813EE34: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0813EE5C + ldr r4, =0x02024332 + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _0813EE5C + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0 + strb r0, [r4, 0x1] + bl sub_8056B74 +_0813EE5C: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0813EE84 + ldr r4, =0x02024332 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _0813EE84 + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0x1 + strb r0, [r4, 0x1] + bl sub_8056B74 +_0813EE84: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0813EEF2 + str r2, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + movs r0, 0x5 + bl audio_play + ldr r0, =0x02024332 + ldrb r2, [r0, 0x1] + cmp r2, 0 + beq _0813EECC + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x18] + strh r0, [r1, 0x14] + b _0813EEF2 + .pool +_0813EECC: + ldr r0, =0x03005e00 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x16] + strh r0, [r1, 0x14] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _0813EEF2 + movs r0, 0x1 + negs r0, r0 + str r2, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe +_0813EEF2: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0813EF00 + b _0813F1A4 +_0813EF00: + movs r0, 0x1 + str r0, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + movs r0, 0x5 + bl audio_play + ldr r1, =0x03005e00 + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x18] + strh r1, [r0, 0x14] + b _0813F1A4 + .pool +_0813EF30: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0813EF3E + b _0813F1A4 +_0813EF3E: + bl FreeAllWindowBuffers + ldr r0, =0x020244ec + ldr r1, =0x03005e00 + mov r3, r8 + adds r5, r3, r7 + lsls r5, 3 + adds r5, r1 + ldrb r1, [r5, 0x1C] + ldr r2, =0x020244e9 + ldrb r2, [r2] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldr r3, =sub_813DD7C + ldr r4, =0x020244e2 + ldrh r4, [r4] + str r4, [sp] + bl sub_81BFA38 + ldrh r0, [r5, 0x14] + adds r0, 0x1 + strh r0, [r5, 0x14] + b _0813F1A4 + .pool +_0813EF88: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0813EF96 + b _0813F1A4 +_0813EF96: + ldr r1, [r6, 0x4] + ldr r0, =sub_813E3A4 + cmp r1, r0 + beq _0813EFA0 + b _0813F1A4 +_0813EFA0: + bl sub_81C1B94 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x4 + bne _0813EFC8 + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + movs r0, 0xA + b _0813F1A2 + .pool +_0813EFC8: + adds r1, r6, 0 + adds r1, 0xD + mov r0, r9 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl sub_806E804 + cmp r0, 0 + beq _0813F014 + ldr r0, =gUnknown_085CC270 + ldr r3, =0x000004cc + adds r0, r3 + ldr r0, [r0] + bl get_battle_strings_ + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =0x03005e00 + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0xC + strh r1, [r0, 0x14] + b _0813F1A4 + .pool +_0813F014: + ldr r1, =0x02022f68 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + strb r4, [r1, 0x2] + lsrs r0, r4, 8 + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + lsls r4, r6, 24 + lsrs r4, 24 + mov r0, r9 + adds r1, r4, 0 + bl sub_806B9A8 + ldr r0, =0x020244e2 + ldrh r1, [r0] + mov r0, r9 + adds r2, r4, 0 + bl sub_80691F4 + ldr r0, =0x03005e00 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + b _0813F1A2 + .pool +_0813F05C: + ldr r0, =gUnknown_085CC270 + movs r1, 0xCF + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + bl get_battle_strings_ + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + b _0813F1A2 + .pool +_0813F090: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + beq _0813F09E + b _0813F1A4 +_0813F09E: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _0813F0AA + b _0813F1A4 +_0813F0AA: + ldr r0, =gUnknown_085CC270 + ldr r0, [r0, 0x1C] + bl get_battle_strings_ + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + ldr r0, =0x03005e00 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + b _0813F1A2 + .pool +_0813F0D8: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _0813F1A4 + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _0813F1A4 + ldr r0, =gUnknown_085CC270 + movs r1, 0xD0 + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + bl get_battle_strings_ + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =0x03005e00 + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0x14 + strh r1, [r0, 0x8] + b _0813F1A4 + .pool +_0813F120: + ldr r0, =gUnknown_085CC270 + ldr r0, [r0, 0x20] + bl get_battle_strings_ + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =0x03005e00 + mov r3, r8 + adds r0, r3, r7 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0xB + strh r1, [r0, 0x16] + strh r2, [r0, 0x18] + movs r1, 0x3 + strh r1, [r0, 0x14] + b _0813F1A4 + .pool +_0813F154: + ldr r0, =gUnknown_085CC270 + ldr r0, [r0, 0x24] + bl get_battle_strings_ + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =0x03005e00 + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 +_0813F16E: + movs r1, 0xF + strh r1, [r0, 0x8] + b _0813F1A4 + .pool +_0813F180: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _0813F1A4 + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _0813F1A4 + ldr r0, =0x03005e00 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + movs r0, 0x5 +_0813F1A2: + strh r0, [r1, 0x14] +_0813F1A4: + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end evovle_mon_maybe + + thumb_func_start sub_813F1B8 +sub_813F1B8: @ 813F1B8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r3, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r3 + movs r1, 0x1C + ldrsh r2, [r0, r1] + movs r1, 0x64 + muls r2, r1 + ldr r1, =0x020244ec + adds r2, r1 + mov r9, r2 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r5, r3, 0 + cmp r0, 0x14 + bls _0813F1EC + bl _0813FCC4 +_0813F1EC: + lsls r0, 2 + ldr r1, =_0813F204 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0813F204: + .4byte _0813F258 + .4byte _0813F284 + .4byte _0813F2AC + .4byte _0813F2DC + .4byte _0813F314 + .4byte _0813F380 + .4byte _0813F3C0 + .4byte _0813F3F0 + .4byte _0813F42C + .4byte _0813F448 + .4byte _0813F474 + .4byte _0813F498 + .4byte _0813F4E4 + .4byte _0813F570 + .4byte _0813F624 + .4byte _0813F668 + .4byte _0813F6D0 + .4byte _0813F704 + .4byte _0813F748 + .4byte _0813F7A4 + .4byte _0813F7E4 +_0813F258: + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085CC990 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + b _0813F6B4 + .pool +_0813F284: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + beq _0813F294 + bl _0813FCC4 +_0813F294: + ldr r0, =0x03005e00 + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r4, 0xA] + movs r1, 0 + bl cry_related + b _0813F6F2 + .pool +_0813F2AC: + bl sub_80A3678 + lsls r0, 24 + cmp r0, 0 + bne _0813F2BA + bl _0813FCC4 +_0813F2BA: + ldr r0, =0x00000179 + bl m4aSongNumStop + movs r0, 0xBC + lsls r0, 1 + bl audio_play + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + b _0813F6B4 + .pool +_0813F2DC: + bl mplay_has_finished_maybe + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _0813F2EC + bl _0813FCC4 +_0813F2EC: + ldr r0, =0x00000179 + bl song_play_for_text + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + str r5, [sp] + movs r0, 0x1C + movs r1, 0x4 + b _0813F9C8 + .pool +_0813F314: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0813F324 + bl _0813FCC4 +_0813F324: + movs r0, 0x1 + bl sub_8140000 + ldr r2, =0x02020630 + ldr r0, =0x0203ab80 + ldr r0, [r0] + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + adds r6, r0, 0 + adds r6, 0x10 + adds r0, r6, 0 + bl sub_817BE94 + ldr r1, =0x02024332 + strb r0, [r1, 0x2] + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + ldr r1, =0x00000603 + movs r0, 0xE + bl SetGpuReg + bl _0813FCC4 + .pool +_0813F380: + ldr r4, =0x02024332 + ldrb r0, [r4, 0x2] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _0813F396 + bl _0813FCC4 +_0813F396: + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r5 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + ldr r0, =0x0203ab80 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x3] + bl sub_817BFB4 + strb r0, [r4, 0x2] + bl _0813FCC4 + .pool +_0813F3C0: + ldr r4, =0x02024332 + ldrb r0, [r4, 0x2] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _0813F3D6 + bl _0813FCC4 +_0813F3D6: + ldr r0, =0x0203ab80 + ldr r1, [r0] + ldrb r0, [r1] + ldrb r1, [r1, 0x1] + bl sub_817C3A0 + strb r0, [r4, 0x2] + b _0813F6AC + .pool +_0813F3F0: + ldr r2, =0x0203ab80 + ldr r1, [r2] + ldrb r0, [r1, 0x3] + subs r0, 0x1 + strb r0, [r1, 0x3] + lsls r0, 24 + cmp r0, 0 + beq _0813F404 + bl _0813FCC4 +_0813F404: + ldr r1, [r2] + movs r0, 0x3 + strb r0, [r1, 0x3] + ldr r0, =0x02024332 + ldrb r1, [r0, 0x2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _0813F420 + bl _0813FCC4 +_0813F420: + b _0813F6AC + .pool +_0813F42C: + bl sub_817C068 + ldr r1, =0x02024332 + strb r0, [r1, 0x2] + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + b _0813F6B4 + .pool +_0813F448: + ldr r6, =0x02024332 + ldrb r0, [r6, 0x2] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _0813F45E + bl _0813FCC4 +_0813F45E: + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r5 + ldrh r0, [r4, 0xC] + bl sub_817C280 + strb r0, [r6, 0x2] + b _0813F6F2 + .pool +_0813F474: + ldr r0, =0x02024332 + ldrb r1, [r0, 0x2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _0813F48A + bl _0813FCC4 +_0813F48A: + movs r0, 0x21 + bl audio_play + b _0813F6AC + .pool +_0813F498: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _0813F4A6 + bl _0813FCC4 +_0813F4A6: + ldr r0, =0x0203ab84 + ldr r0, [r0] + bl Free + ldr r5, =0x0203ab80 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + ldr r1, =0x03005e00 + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r1 + ldrh r1, [r4, 0xC] + bl sub_81401E0 + ldr r0, =0x02037754 + ldr r1, [r5] + adds r1, 0x4 + movs r2, 0x60 + bl memcpy + b _0813F6F2 + .pool +_0813F4E4: + bl sub_80A3678 + lsls r0, 24 + cmp r0, 0 + bne _0813F4F2 + bl _0813FCC4 +_0813F4F2: + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085CC9A6 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r0, =0x00000173 + bl fanfare_play + ldr r2, =0x03005e00 + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + adds r2, r1 + adds r2, 0xC + mov r0, r9 + movs r1, 0xB + bl pokemon_setattr + mov r0, r9 + bl pokemon_calc_effective_stats + ldrh r1, [r4, 0xA] + ldrh r2, [r4, 0xC] + mov r0, r9 + bl sub_806D778 + ldrh r0, [r4, 0xC] + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2 + bl pokedex_flag_operation + ldrh r0, [r4, 0xC] + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl pokedex_flag_operation + movs r0, 0xE + bl sav12_xor_increment + b _0813FCC4 + .pool +_0813F570: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + beq _0813F57E + b _0813FCC4 +_0813F57E: + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0813F58C + b _0813FCC4 +_0813F58C: + ldr r1, =0x03005e00 + lsls r4, r7, 2 + adds r0, r4, r7 + lsls r0, 3 + adds r5, r0, r1 + ldrb r1, [r5, 0x10] + mov r0, r9 + bl sub_8069318 + lsls r0, 16 + lsrs r6, r0, 16 + mov r8, r4 + cmp r6, 0 + beq _0813F5FC + movs r0, 0x1A + ldrsh r2, [r5, r0] + cmp r2, 0 + bne _0813F5FC + ldrh r1, [r5, 0xE] + movs r0, 0x80 + orrs r0, r1 + strh r0, [r5, 0xE] + strh r2, [r5, 0x10] + strh r2, [r5, 0x14] + mov r0, r9 + movs r1, 0x2 + add r2, sp, 0x4 + bl pokemon_getattr + ldr r0, =0x02022f58 + add r1, sp, 0x4 + bl CopyString_Limit10 + ldr r0, =0x0000ffff + cmp r6, r0 + bne _0813F5E8 + movs r0, 0x14 + strh r0, [r5, 0x8] + b _0813FCC4 + .pool +_0813F5E8: + ldr r0, =0x0000fffe + cmp r6, r0 + bne _0813F5F0 + b _0813FCC4 +_0813F5F0: + movs r0, 0x12 + strh r0, [r5, 0x8] + b _0813FCC4 + .pool +_0813F5FC: + ldr r0, =0x00000179 + bl song_play_for_text + ldr r1, =gUnknown_085EF6D2 + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + b _0813F78C + .pool +_0813F624: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + beq _0813F634 + b _0813FCC4 +_0813F634: + adds r0, r7, 0 + bl DestroyTask + ldr r4, =0x0203ab80 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r2, =0x03003014 + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, =0x030061e8 + ldr r0, [r0] + bl SetMainCallback2 + b _0813FCC4 + .pool +_0813F668: + ldr r0, =0x02024332 + ldrb r1, [r0, 0x2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _0813F67C + b _0813FCC4 +_0813F67C: + bl m4aMPlayAllStop + ldr r2, =0x02020630 + ldr r0, =0x0203ab80 + ldr r0, [r0] + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x5] + lsrs r1, 4 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + ldr r1, =0x0004001c + orrs r0, r1 + ldr r1, =0x00007fff + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe +_0813F6AC: + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r5 +_0813F6B4: + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _0813FCC4 + .pool +_0813F6D0: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0813F6DE + b _0813FCC4 +_0813F6DE: + ldr r0, =0x0203ab80 + ldr r0, [r0] + ldrb r0, [r0] + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r5 + ldrh r1, [r4, 0xA] + bl sub_81401E0 +_0813F6F2: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0813FCC4 + .pool +_0813F704: + ldr r0, =0x0203ab80 + ldr r0, [r0] + ldrb r0, [r0] + bl sub_8140208 + cmp r0, 0 + bne _0813F714 + b _0813FCC4 +_0813F714: + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085CC9EE + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x1A] + b _0813FC8C + .pool +_0813F748: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + beq _0813F756 + b _0813FCC4 +_0813F756: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _0813F762 + b _0813FCC4 +_0813F762: + bl sub_804F574 + ldr r0, =0x0000016f + bl fanfare_play + ldr r0, =gUnknown_085CC270 + ldr r0, [r0, 0xC] + bl get_battle_strings_ + ldr r1, =0x02022e2c + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r0, =0x03005e00 + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r1, r0 + movs r0, 0x40 + strh r0, [r1, 0x10] +_0813F78C: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0813FCC4 + .pool +_0813F7A4: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + beq _0813F7B2 + b _0813FCC4 +_0813F7B2: + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0813F7C0 + b _0813FCC4 +_0813F7C0: + ldr r0, =0x03005e00 + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x10] + subs r0, 0x1 + strh r0, [r1, 0x10] + lsls r0, 16 + cmp r0, 0 + beq _0813F7D8 + b _0813FCC4 +_0813F7D8: + movs r0, 0xD + strh r0, [r1, 0x8] + b _0813FCC4 + .pool +_0813F7E4: + lsls r1, r7, 2 + adds r0, r1, r7 + lsls r0, 3 + adds r0, r5 + movs r2, 0x14 + ldrsh r0, [r0, r2] + mov r8, r1 + cmp r0, 0xB + bls _0813F7F8 + b _0813FCC4 +_0813F7F8: + lsls r0, 2 + ldr r1, =_0813F808 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0813F808: + .4byte _0813F838 + .4byte _0813F884 + .4byte _0813F8CC + .4byte _0813F90C + .4byte _0813F96C + .4byte _0813FA24 + .4byte _0813FAA8 + .4byte _0813FBA4 + .4byte _0813FBEC + .4byte _0813FC38 + .4byte _0813FC70 + .4byte _0813FCA0 +_0813F838: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + beq _0813F846 + b _0813FCC4 +_0813F846: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _0813F852 + b _0813FCC4 +_0813F852: + bl sub_804F574 + ldr r0, =gUnknown_085CC270 + ldr r0, [r0, 0x10] + bl get_battle_strings_ + ldr r1, =0x02022e2c + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + b _0813FCC2 + .pool +_0813F884: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + beq _0813F892 + b _0813FCC4 +_0813F892: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _0813F89E + b _0813FCC4 +_0813F89E: + ldr r0, =gUnknown_085CC270 + ldr r0, [r0, 0x14] + bl get_battle_strings_ + ldr r1, =0x02022e2c + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + b _0813FCC2 + .pool +_0813F8CC: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _0813F90C + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _0813F90C + ldr r0, =gUnknown_085CC270 + ldr r0, [r0, 0x18] + bl get_battle_strings_ + ldr r1, =0x02022e2c + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + movs r0, 0x5 + strh r0, [r1, 0x16] + movs r0, 0x9 + strh r0, [r1, 0x18] + ldrh r0, [r1, 0x14] + adds r0, 0x1 + strh r0, [r1, 0x14] +_0813F90C: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + beq _0813F91A + b _0813FCC4 +_0813F91A: + bl mplay_has_finished_maybe + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0813F928 + b _0813FCC4 +_0813F928: + movs r0, 0 + movs r1, 0xA8 + movs r2, 0xE0 + bl sub_809882C + ldr r0, =gUnknown_0833900C + movs r1, 0xA8 + movs r2, 0xE + movs r3, 0 + bl CreateYesNoMenu + ldr r3, =0x02024332 + strb r4, [r3, 0x1] + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + movs r2, 0 + strh r0, [r1, 0x14] + strb r2, [r3, 0x1] + b _0813FCC4 + .pool +_0813F96C: + bl sub_8198C58 + lsls r0, 24 + asrs r6, r0, 24 + cmp r6, 0 + beq _0813F98C + cmp r6, 0 + bgt _0813F986 + movs r0, 0x1 + negs r0, r0 + cmp r6, r0 + beq _0813F9E4 + b _0813FCC4 +_0813F986: + cmp r6, 0x1 + beq _0813F9E4 + b _0813FCC4 +_0813F98C: + ldr r0, =0x02024332 + strb r6, [r0, 0x1] + ldr r0, =gUnknown_085CC270 + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + bl get_battle_strings_ + ldr r1, =0x02022e2c + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r1, =0x03005e00 + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x16] + strh r1, [r0, 0x14] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x5 + beq _0813F9C0 + b _0813FCC4 +_0813F9C0: + movs r0, 0x1 + negs r0, r0 + str r6, [sp] + movs r1, 0 +_0813F9C8: + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _0813FCC4 + .pool +_0813F9E4: + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x1] + ldr r0, =gUnknown_085CC270 + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + bl get_battle_strings_ + ldr r1, =0x02022e2c + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r1, =0x03005e00 + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x18] + strh r1, [r0, 0x14] + b _0813FCC4 + .pool +_0813FA24: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0813FA32 + b _0813FCC4 +_0813FA32: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _0813FA3E + bl sub_800E084 +_0813FA3E: + movs r0, 0x3 + bl GetBgTilemapBuffer + bl Free + movs r0, 0x1 + bl GetBgTilemapBuffer + bl Free + movs r0, 0 + bl GetBgTilemapBuffer + bl Free + bl FreeAllWindowBuffers + ldr r0, =0x020244ec + ldr r1, =0x03005e00 + mov r2, r8 + adds r5, r2, r7 + lsls r5, 3 + adds r5, r1 + ldrb r1, [r5, 0x1C] + ldr r2, =0x020244e9 + ldrb r2, [r2] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldr r3, =sub_813DF70 + ldr r4, =0x020244e2 + ldrh r4, [r4] + str r4, [sp] + bl sub_81BFA38 + ldrh r0, [r5, 0x14] + adds r0, 0x1 + strh r0, [r5, 0x14] + b _0813FCC4 + .pool +_0813FAA8: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0813FAB6 + b _0813FCC4 +_0813FAB6: + ldr r0, =0x030022c0 + ldr r1, [r0, 0x4] + ldr r0, =sub_813E3C0 + cmp r1, r0 + beq _0813FAC2 + b _0813FCC4 +_0813FAC2: + bl sub_81C1B94 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x4 + bne _0813FAEC + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + movs r0, 0x9 + b _0813FCC2 + .pool +_0813FAEC: + adds r1, r6, 0 + adds r1, 0xD + mov r0, r9 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl sub_806E804 + cmp r0, 0 + beq _0813FB3C + ldr r0, =gUnknown_085CC270 + ldr r1, =0x000004cc + adds r0, r1 + ldr r0, [r0] + bl get_battle_strings_ + ldr r1, =0x02022e2c + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r1, =0x03005e00 + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0xB + strh r1, [r0, 0x14] + b _0813FCC4 + .pool +_0813FB3C: + ldr r1, =0x02022f68 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + strb r4, [r1, 0x2] + lsrs r0, r4, 8 + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + lsls r4, r6, 24 + lsrs r4, 24 + mov r0, r9 + adds r1, r4, 0 + bl sub_806B9A8 + ldr r0, =0x020244e2 + ldrh r1, [r0] + mov r0, r9 + adds r2, r4, 0 + bl sub_80691F4 + ldr r0, =gUnknown_085CC270 + movs r1, 0xCF + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + bl get_battle_strings_ + ldr r1, =0x02022e2c + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + b _0813FCC2 + .pool +_0813FBA4: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + beq _0813FBB2 + b _0813FCC4 +_0813FBB2: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _0813FBBE + b _0813FCC4 +_0813FBBE: + ldr r0, =gUnknown_085CC270 + ldr r0, [r0, 0x1C] + bl get_battle_strings_ + ldr r1, =0x02022e2c + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + b _0813FCC2 + .pool +_0813FBEC: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _0813FCC4 + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _0813FCC4 + ldr r0, =gUnknown_085CC270 + movs r1, 0xD0 + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + bl get_battle_strings_ + ldr r1, =0x02022e2c + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r1, =0x03005e00 + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0x12 + strh r1, [r0, 0x8] + b _0813FCC4 + .pool +_0813FC38: + ldr r0, =gUnknown_085CC270 + ldr r0, [r0, 0x20] + bl get_battle_strings_ + ldr r1, =0x02022e2c + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r1, =0x03005e00 + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0xA + strh r1, [r0, 0x16] + strh r2, [r0, 0x18] + movs r1, 0x3 + strh r1, [r0, 0x14] + b _0813FCC4 + .pool +_0813FC70: + ldr r0, =gUnknown_085CC270 + ldr r0, [r0, 0x24] + bl get_battle_strings_ + ldr r1, =0x02022e2c + movs r0, 0 + movs r2, 0x1 + bl sub_807F1A8 + ldr r1, =0x03005e00 + mov r2, r8 + adds r0, r2, r7 + lsls r0, 3 + adds r0, r1 +_0813FC8C: + movs r1, 0xD + strh r1, [r0, 0x8] + b _0813FCC4 + .pool +_0813FCA0: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _0813FCC4 + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _0813FCC4 + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + movs r0, 0x5 +_0813FCC2: + strh r0, [r1, 0x14] +_0813FCC4: + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813F1B8 + + thumb_func_start nullsub_83 +nullsub_83: @ 813FCD8 + bx lr + thumb_func_end nullsub_83 + + thumb_func_start sub_813FCDC +sub_813FCDC: @ 813FCDC + push {lr} + ldr r0, =0x02022e14 + ldrh r1, [r0] + movs r0, 0x10 + bl SetGpuReg + ldr r0, =0x02022e16 + ldrh r1, [r0] + movs r0, 0x12 + bl SetGpuReg + ldr r0, =0x02022e18 + ldrh r1, [r0] + movs r0, 0x14 + bl SetGpuReg + ldr r0, =0x02022e1a + ldrh r1, [r0] + movs r0, 0x16 + bl SetGpuReg + ldr r0, =0x02022e1c + ldrh r1, [r0] + movs r0, 0x18 + bl SetGpuReg + ldr r0, =0x02022e1e + ldrh r1, [r0] + movs r0, 0x1A + bl SetGpuReg + ldr r0, =0x02022e20 + ldrh r1, [r0] + movs r0, 0x1C + bl SetGpuReg + ldr r0, =0x02022e22 + ldrh r1, [r0] + movs r0, 0x1E + bl SetGpuReg + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + bl sub_80BA0A8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_813FCDC + + thumb_func_start sub_813FD64 +sub_813FD64: @ 813FD64 + push {lr} + ldr r0, =0x02022e14 + ldrh r1, [r0] + movs r0, 0x10 + bl SetGpuReg + ldr r0, =0x02022e16 + ldrh r1, [r0] + movs r0, 0x12 + bl SetGpuReg + ldr r0, =0x02022e18 + ldrh r1, [r0] + movs r0, 0x14 + bl SetGpuReg + ldr r0, =0x02022e1a + ldrh r1, [r0] + movs r0, 0x16 + bl SetGpuReg + ldr r0, =0x02022e1c + ldrh r1, [r0] + movs r0, 0x18 + bl SetGpuReg + ldr r0, =0x02022e1e + ldrh r1, [r0] + movs r0, 0x1A + bl SetGpuReg + ldr r0, =0x02022e20 + ldrh r1, [r0] + movs r0, 0x1C + bl SetGpuReg + ldr r0, =0x02022e22 + ldrh r1, [r0] + movs r0, 0x1E + bl SetGpuReg + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + bl sub_80BA0A8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_813FD64 + + thumb_func_start sub_813FDEC +sub_813FDEC: @ 813FDEC + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + movs r0, 0xC + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _0813FE9A + ldrh r0, [r4, 0xA] + adds r1, r0, 0x1 + strh r1, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _0813FE9A + ldrh r1, [r4] + adds r0, r1, 0x1 + strh r0, [r4] + lsls r1, 16 + asrs r1, 16 + ldr r3, =gUnknown_085B58C9 + movs r2, 0x4 + ldrsh r0, [r4, r2] + lsls r2, r0, 2 + adds r0, r3, 0x3 + adds r0, r2, r0 + ldrb r0, [r0] + cmp r1, r0 + ble _0813FE8C + adds r0, r3, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + movs r2, 0x2 + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _0813FE74 + ldrh r0, [r4, 0x6] + adds r0, 0x1 + strh r0, [r4, 0x6] + movs r0, 0x6 + ldrsh r2, [r4, r0] + movs r1, 0x4 + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r1, r3, 0x2 + adds r0, r1 + ldrb r0, [r0] + cmp r2, r0 + bne _0813FE5E + strh r5, [r4, 0x6] + ldrh r0, [r4, 0x4] + adds r0, 0x1 + strh r0, [r4, 0x4] +_0813FE5E: + movs r2, 0x4 + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0] + b _0813FE8A + .pool +_0813FE74: + ldr r0, =0x0203ab84 + lsls r1, 5 + ldr r0, [r0] + adds r0, r1 + movs r1, 0xA0 + movs r2, 0x20 + bl gpu_pal_apply + strh r5, [r4] + ldrh r0, [r4, 0x2] + adds r0, 0x1 +_0813FE8A: + strh r0, [r4, 0x2] +_0813FE8C: + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bne _0813FE9A + adds r0, r6, 0 + bl DestroyTask +_0813FE9A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813FDEC + + thumb_func_start sub_813FEA4 +sub_813FEA4: @ 813FEA4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =sub_813FEE8 + movs r1, 0x7 + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + cmp r4, 0 + bne _0813FED0 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0xC] + b _0813FEDE + .pool +_0813FED0: + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0xC] +_0813FEDE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813FEA4 + + thumb_func_start sub_813FEE8 +sub_813FEE8: @ 813FEE8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02022e18 + mov r8, r0 + ldr r1, =0x02022e1a + mov r9, r1 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0xC + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _0813FF28 + ldr r7, =0x02022e1c + ldr r6, =0x02022e1e + b _0813FF2C + .pool +_0813FF28: + ldr r7, =0x02022e20 + ldr r6, =0x02022e22 +_0813FF2C: + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r1 + ldrh r0, [r4, 0x8] + adds r0, 0x5 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x8] + adds r0, 0x80 + ands r0, r1 + strh r0, [r4, 0xA] + movs r1, 0x8 + ldrsh r0, [r4, r1] + movs r1, 0x4 + bl cosine + adds r0, 0x8 + mov r2, r8 + strh r0, [r2] + movs r1, 0x8 + ldrsh r0, [r4, r1] + movs r1, 0x4 + bl sine + adds r0, 0x10 + mov r2, r9 + strh r0, [r2] + movs r1, 0xA + ldrsh r0, [r4, r1] + movs r1, 0x4 + bl cosine + adds r0, 0x8 + strh r0, [r7] + movs r2, 0xA + ldrsh r0, [r4, r2] + movs r1, 0x4 + bl sine + adds r0, 0x10 + strh r0, [r6] + ldr r0, =sub_813FDEC + bl FuncIsActiveTask + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0813FFA6 + adds r0, r5, 0 + bl DestroyTask + mov r0, r8 + strh r4, [r0] + mov r1, r9 + strh r4, [r1] + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r7] + strh r4, [r6] +_0813FFA6: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813FEE8 + + thumb_func_start sub_813FFC0 +sub_813FFC0: @ 813FFC0 + push {r4-r7,lr} + adds r6, r0, 0 + movs r1, 0 + ldr r5, =gUnknown_085B5884 + ldr r7, =gUnknown_085B58D9 +_0813FFCA: + lsls r0, r1, 4 + adds r4, r1, 0x1 + adds r2, r0, r7 + lsls r0, r1, 5 + adds r1, r0, r6 + movs r3, 0xF +_0813FFD6: + ldrb r0, [r2] + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + strh r0, [r1] + adds r2, 0x1 + adds r1, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _0813FFD6 + adds r1, r4, 0 + cmp r1, 0x31 + ble _0813FFCA + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813FFC0 + + thumb_func_start sub_8140000 +sub_8140000: @ 8140000 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x0203ab84 + movs r0, 0xC8 + lsls r0, 3 + bl AllocZeroed + str r0, [r4] + bl sub_813FFC0 + cmp r5, 0 + bne _08140028 + movs r6, 0x1 + movs r4, 0x2 + b _0814002C + .pool +_08140028: + movs r6, 0x1 + movs r4, 0x3 +_0814002C: + ldr r0, =gUnknown_085B51E4 + movs r1, 0xA0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =gUnknown_085B4134 + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_085B482C + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + ldr r1, =gUnknown_085B4D10 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + adds r0, r4, 0 + bl CopyBgTilemapBufferToVram + cmp r5, 0 + bne _081400C4 + ldr r1, =0x00000442 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x00000808 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0xBA + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + adds r0, r6, 0 + movs r1, 0x7 + movs r2, 0x2 + bl SetBgAttribute + adds r0, r4, 0 + movs r1, 0x7 + movs r2, 0x2 + bl SetBgAttribute + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + b _081400DE + .pool +_081400C4: + ldr r1, =0x00000842 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x00000808 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0xDA + lsls r1, 5 + movs r0, 0 + bl SetGpuReg +_081400DE: + ldr r0, =sub_813FDEC + movs r1, 0x5 + bl CreateTask + adds r0, r5, 0 + bl sub_813FEA4 + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8140000 + + thumb_func_start sub_8140100 +sub_8140100: @ 8140100 + push {lr} + ldr r0, =sub_813FDEC + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _0814011E + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x14] +_0814011E: + movs r0, 0 + movs r1, 0xA0 + movs r2, 0x20 + bl rboxid_80040B8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8140100 + + thumb_func_start sub_8140134 +sub_8140134: @ 8140134 + push {lr} + ldr r0, =sub_813FDEC + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _08140148 + bl DestroyTask +_08140148: + ldr r0, =sub_813FEE8 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _0814015A + bl DestroyTask +_0814015A: + movs r0, 0 + movs r1, 0xA0 + movs r2, 0x20 + bl rboxid_80040B8 + bl sub_8140174 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8140134 + + thumb_func_start sub_8140174 +sub_8140174: @ 8140174 + push {lr} + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + ldr r0, =0x02022e18 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e1a + strh r1, [r0] + ldr r0, =0x02022e1c + strh r1, [r0] + movs r0, 0x1 + movs r1, 0x5 + bl sub_80391E0 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1 + movs r1, 0x7 + bl SetBgAttribute + movs r0, 0x2 + movs r1, 0x5 + bl sub_80391E0 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x2 + movs r1, 0x7 + bl SetBgAttribute + movs r1, 0xCA + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r0, =0x0203ab84 + ldr r0, [r0] + bl Free + pop {r0} + bx r0 + .pool + thumb_func_end sub_8140174 + + thumb_func_start sub_81401E0 +sub_81401E0: @ 81401E0 + push {lr} + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02020630 + adds r0, r2 + movs r2, 0 + movs r3, 0 + bl sub_806ED40 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81401E0 + + thumb_func_start sub_8140208 +sub_8140208: @ 8140208 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r2, 0x1C + adds r1, r2 + ldr r1, [r1] + ldr r0, =DummyObjectCallback + cmp r1, r0 + beq _08140230 + movs r0, 0 + b _08140232 + .pool +_08140230: + movs r0, 0x1 +_08140232: + pop {r1} + bx r1 + thumb_func_end sub_8140208 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/field_camera.s b/asm/field_camera.s new file mode 100644 index 000000000..47761244d --- /dev/null +++ b/asm/field_camera.s @@ -0,0 +1,1153 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start move_tilemap_camera_to_upper_left_corner_ +@ void move_tilemap_camera_to_upper_left_corner_(struc_28 *a1) +move_tilemap_camera_to_upper_left_corner_: @ 8089B58 + movs r1, 0 + strb r1, [r0, 0x2] + strb r1, [r0, 0x3] + strb r1, [r0] + strb r1, [r0, 0x1] + movs r1, 0x1 + strb r1, [r0, 0x4] + bx lr + thumb_func_end move_tilemap_camera_to_upper_left_corner_ + + thumb_func_start tilemap_move_something +@ void tilemap_move_something(struct struc_28 *, u8 deltaX, u8 deltaY) +tilemap_move_something: @ 8089B68 + ldrb r3, [r0, 0x2] + adds r3, r1 + strb r3, [r0, 0x2] + ldrb r1, [r0, 0x2] + movs r3, 0x1F + ands r1, r3 + strb r1, [r0, 0x2] + ldrb r1, [r0, 0x3] + adds r1, r2 + strb r1, [r0, 0x3] + ldrb r1, [r0, 0x3] + ands r1, r3 + strb r1, [r0, 0x3] + bx lr + thumb_func_end tilemap_move_something + + thumb_func_start coords8_add +@ void coords8_add(struct coords8 *coords, u8 x, u8 y) +coords8_add: @ 8089B84 + ldrb r3, [r0] + adds r3, r1 + strb r3, [r0] + ldrb r1, [r0, 0x1] + adds r1, r2 + strb r1, [r0, 0x1] + bx lr + thumb_func_end coords8_add + + thumb_func_start move_tilemap_camera_to_upper_left_corner +@ void move_tilemap_camera_to_upper_left_corner() +move_tilemap_camera_to_upper_left_corner: @ 8089B94 + push {lr} + ldr r0, =0x03000e20 + bl move_tilemap_camera_to_upper_left_corner_ + pop {r0} + bx r0 + .pool + thumb_func_end move_tilemap_camera_to_upper_left_corner + + thumb_func_start FieldUpdateBgTilemapScroll +@ void FieldUpdateBgTilemapScroll() +FieldUpdateBgTilemapScroll: @ 8089BA4 + push {r4,r5,lr} + ldr r1, =0x03000e20 + ldr r0, =0x03000e28 + movs r2, 0 + ldrsh r5, [r0, r2] + ldrb r0, [r1] + adds r5, r0 + ldr r0, =0x03000e2a + movs r2, 0 + ldrsh r4, [r0, r2] + ldrb r1, [r1, 0x1] + adds r4, r1 + adds r4, 0x8 + lsls r5, 16 + lsrs r5, 16 + movs r0, 0x14 + adds r1, r5, 0 + bl SetGpuReg + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x16 + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x18 + adds r1, r5, 0 + bl SetGpuReg + movs r0, 0x1A + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x1C + adds r1, r5, 0 + bl SetGpuReg + movs r0, 0x1E + adds r1, r4, 0 + bl SetGpuReg + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end FieldUpdateBgTilemapScroll + + thumb_func_start sub_8089C08 +sub_8089C08: @ 8089C08 + push {r4,lr} + ldr r3, =0x03000e20 + ldr r2, =0x03000e28 + ldrh r2, [r2] + ldrb r4, [r3] + adds r2, r4 + strh r2, [r0] + ldr r0, =0x03000e2a + ldrh r0, [r0] + ldrb r3, [r3, 0x1] + adds r0, r3 + adds r0, 0x8 + strh r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8089C08 + + thumb_func_start DrawWholeMapView +@ void DrawWholeMapView() +DrawWholeMapView: @ 8089C34 + push {lr} + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r2, 0 + ldrsh r0, [r1, r2] + movs r2, 0x2 + ldrsh r1, [r1, r2] + ldr r2, =0x02037318 + ldr r2, [r2] + bl DrawWholeMapViewInternal + ldr r1, =0x03000e20 + movs r0, 0x1 + strb r0, [r1, 0x4] + pop {r0} + bx r0 + .pool + thumb_func_end DrawWholeMapView + + thumb_func_start DrawWholeMapViewInternal +@ void DrawWholeMapViewInternal(s32 x, s32 y, struct mapdata_header *mapGrid) +DrawWholeMapViewInternal: @ 8089C60 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r10, r0 + mov r9, r1 + mov r8, r2 + movs r1, 0 +_08089C74: + ldr r2, =0x03000e20 + ldrb r0, [r2, 0x3] + adds r0, r1, r0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1F + bls _08089C88 + subs r0, 0x20 + lsls r0, 24 + lsrs r0, 24 +_08089C88: + lsls r6, r0, 5 + movs r4, 0 + adds r7, r1, 0x2 + str r7, [sp] + lsrs r5, r1, 1 +_08089C92: + ldr r1, =0x03000e20 + ldrb r0, [r1, 0x2] + adds r0, r4, r0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1F + bls _08089CA6 + subs r0, 0x20 + lsls r0, 24 + lsrs r0, 24 +_08089CA6: + adds r1, r6, r0 + lsls r1, 16 + lsrs r1, 16 + lsrs r2, r4, 1 + add r2, r10 + mov r0, r8 + mov r7, r9 + adds r3, r7, r5 + bl DrawMetatileAt + adds r0, r4, 0x2 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1F + bls _08089C92 + ldr r1, [sp] + lsls r0, r1, 24 + lsrs r1, r0, 24 + cmp r1, 0x1F + bls _08089C74 + 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 DrawWholeMapViewInternal + + thumb_func_start RedrawMapSlicesForCameraUpdate +@ void RedrawMapSlicesForCameraUpdate(struct struc_28 *, u8 deltaX, u8 deltaY) +RedrawMapSlicesForCameraUpdate: @ 8089CE4 + push {r4-r7,lr} + adds r5, r0, 0 + adds r6, r1, 0 + adds r7, r2, 0 + ldr r0, =0x02037318 + ldr r4, [r0] + cmp r6, 0 + ble _08089CFC + adds r0, r5, 0 + adds r1, r4, 0 + bl RedrawMapSliceWest +_08089CFC: + cmp r6, 0 + bge _08089D08 + adds r0, r5, 0 + adds r1, r4, 0 + bl RedrawMapSliceEast +_08089D08: + cmp r7, 0 + ble _08089D14 + adds r0, r5, 0 + adds r1, r4, 0 + bl RedrawMapSliceNorth +_08089D14: + cmp r7, 0 + bge _08089D20 + adds r0, r5, 0 + adds r1, r4, 0 + bl RedrawMapSliceSouth +_08089D20: + movs r0, 0x1 + strb r0, [r5, 0x4] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end RedrawMapSlicesForCameraUpdate + + thumb_func_start RedrawMapSliceNorth +@ void RedrawMapSliceNorth(struct struc_28 *, struct mapdata_header *mapGrid) +RedrawMapSliceNorth: @ 8089D30 + push {r4-r7,lr} + adds r5, r0, 0 + adds r7, r1, 0 + ldrb r0, [r5, 0x3] + adds r0, 0x1C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1F + bls _08089D48 + subs r0, 0x20 + lsls r0, 24 + lsrs r0, 24 +_08089D48: + lsls r6, r0, 5 + movs r4, 0 +_08089D4C: + ldrb r0, [r5, 0x2] + adds r0, r4, r0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1F + bls _08089D5E + subs r0, 0x20 + lsls r0, 24 + lsrs r0, 24 +_08089D5E: + adds r1, r6, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =0x03005d8c + ldr r3, [r0] + movs r0, 0 + ldrsh r2, [r3, r0] + lsrs r0, r4, 1 + adds r2, r0 + movs r0, 0x2 + ldrsh r3, [r3, r0] + adds r3, 0xE + adds r0, r7, 0 + bl DrawMetatileAt + adds r0, r4, 0x2 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1F + bls _08089D4C + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end RedrawMapSliceNorth + + thumb_func_start RedrawMapSliceSouth +@ void RedrawMapSliceSouth(struct struc_28 *, struct mapdata_header *mapGrid) +RedrawMapSliceSouth: @ 8089D90 + push {r4-r7,lr} + adds r5, r0, 0 + adds r7, r1, 0 + ldrb r0, [r5, 0x3] + lsls r6, r0, 5 + movs r4, 0 +_08089D9C: + ldrb r0, [r5, 0x2] + adds r0, r4, r0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1F + bls _08089DAE + subs r0, 0x20 + lsls r0, 24 + lsrs r0, 24 +_08089DAE: + adds r1, r6, r0 + ldr r0, =0x03005d8c + ldr r3, [r0] + movs r0, 0 + ldrsh r2, [r3, r0] + lsrs r0, r4, 1 + adds r2, r0 + movs r0, 0x2 + ldrsh r3, [r3, r0] + adds r0, r7, 0 + bl DrawMetatileAt + adds r0, r4, 0x2 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1F + bls _08089D9C + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end RedrawMapSliceSouth + + thumb_func_start RedrawMapSliceEast +@ void RedrawMapSliceEast(struct struc_28 *, struct mapdata_header *mapGrid) +RedrawMapSliceEast: @ 8089DDC + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + mov r8, r1 + ldrb r6, [r5, 0x2] + movs r4, 0 +_08089DEA: + ldrb r0, [r5, 0x3] + adds r0, r4, r0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1F + bls _08089DFC + subs r0, 0x20 + lsls r0, 24 + lsrs r0, 24 +_08089DFC: + lsls r1, r0, 5 + adds r1, r6 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r3, 0 + ldrsh r2, [r0, r3] + movs r7, 0x2 + ldrsh r3, [r0, r7] + lsrs r0, r4, 1 + adds r3, r0 + mov r0, r8 + bl DrawMetatileAt + adds r0, r4, 0x2 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1F + bls _08089DEA + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end RedrawMapSliceEast + + thumb_func_start RedrawMapSliceWest +@ void RedrawMapSliceWest(struct struc_28 *, struct mapdata_header *mapGrid) +RedrawMapSliceWest: @ 8089E34 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + mov r8, r1 + ldrb r0, [r6, 0x2] + adds r0, 0x1C + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1F + bls _08089E52 + adds r0, r5, 0 + subs r0, 0x20 + lsls r0, 24 + lsrs r5, r0, 24 +_08089E52: + movs r4, 0 +_08089E54: + ldrb r0, [r6, 0x3] + adds r0, r4, r0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1F + bls _08089E66 + subs r0, 0x20 + lsls r0, 24 + lsrs r0, 24 +_08089E66: + lsls r1, r0, 5 + adds r1, r5 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r3, 0 + ldrsh r2, [r0, r3] + adds r2, 0xE + movs r7, 0x2 + ldrsh r3, [r0, r7] + lsrs r0, r4, 1 + adds r3, r0 + mov r0, r8 + bl DrawMetatileAt + adds r0, r4, 0x2 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1F + bls _08089E54 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end RedrawMapSliceWest + + thumb_func_start CurrentMapDrawMetatileAt +@ void CurrentMapDrawMetatileAt(u32 x, u32 y) +CurrentMapDrawMetatileAt: @ 8089EA0 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r6, =0x03000e20 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl MapPosToBgTilemapOffset + adds r1, r0, 0 + cmp r1, 0 + blt _08089ECC + ldr r0, =0x02037318 + ldr r0, [r0] + lsls r1, 16 + lsrs r1, 16 + adds r2, r4, 0 + adds r3, r5, 0 + bl DrawMetatileAt + movs r0, 0x1 + strb r0, [r6, 0x4] +_08089ECC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end CurrentMapDrawMetatileAt + + thumb_func_start DrawDoorMetatileAt +@ void DrawDoorMetatileAt(u32 x, u32 y, u16 *metatile) +DrawDoorMetatileAt: @ 8089EDC + push {r4-r6,lr} + adds r3, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + ldr r6, =0x03000e20 + adds r0, r6, 0 + adds r1, r3, 0 + adds r2, r4, 0 + bl MapPosToBgTilemapOffset + cmp r0, 0 + blt _08089F04 + lsls r2, r0, 16 + lsrs r2, 16 + movs r0, 0x1 + adds r1, r5, 0 + bl DrawMetatile + movs r0, 0x1 + strb r0, [r6, 0x4] +_08089F04: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end DrawDoorMetatileAt + + thumb_func_start DrawMetatileAt +@ void DrawMetatileAt(struct mapdata_header *mapGrid, u16 offset, s32 x, s32 y) +DrawMetatileAt: @ 8089F10 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + adds r6, r2, 0 + adds r7, r3, 0 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + adds r0, r6, 0 + adds r1, r7, 0 + bl MapGridGetMetatileIdAt + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x80 + lsls r0, 3 + cmp r4, r0 + bls _08089F38 + movs r4, 0 +_08089F38: + ldr r0, =0x000001ff + cmp r4, r0 + bhi _08089F48 + ldr r0, [r5, 0x10] + ldr r5, [r0, 0xC] + b _08089F54 + .pool +_08089F48: + ldr r0, [r5, 0x14] + ldr r5, [r0, 0xC] + ldr r1, =0xfffffe00 + adds r0, r4, r1 + lsls r0, 16 + lsrs r4, r0, 16 +_08089F54: + adds r0, r6, 0 + adds r1, r7, 0 + bl MapGridGetMetatileLayerTypeAt + lsls r0, 24 + lsrs r0, 24 + lsls r1, r4, 4 + adds r1, r5, r1 + mov r2, r8 + bl DrawMetatile + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end DrawMetatileAt + + thumb_func_start DrawMetatile +@ void DrawMetatile(u32 layerType, u16 *metatile, u16 offset) +DrawMetatile: @ 8089F78 + push {r4,lr} + adds r4, r1, 0 + lsls r2, 16 + lsrs r2, 16 + cmp r0, 0x1 + beq _08089FD0 + cmp r0, 0x1 + bgt _08089F8E + cmp r0, 0 + beq _0808A030 + b _0808A082 +_08089F8E: + cmp r0, 0x2 + bne _0808A082 + ldr r0, =0x03005da4 + ldr r0, [r0] + lsls r3, r2, 1 + adds r0, r3, r0 + ldrh r1, [r4] + strh r1, [r0] + ldrh r1, [r4, 0x2] + strh r1, [r0, 0x2] + adds r2, r0, 0 + adds r2, 0x40 + ldrh r1, [r4, 0x4] + strh r1, [r2] + adds r0, 0x42 + ldrh r1, [r4, 0x6] + strh r1, [r0] + ldr r0, =0x03005d9c + ldr r0, [r0] + adds r0, r3, r0 + movs r2, 0 + strh r2, [r0] + strh r2, [r0, 0x2] + adds r1, r0, 0 + adds r1, 0x40 + strh r2, [r1] + adds r0, 0x42 + strh r2, [r0] + b _0808A066 + .pool +_08089FD0: + ldr r0, =0x03005da4 + ldr r0, [r0] + lsls r3, r2, 1 + adds r0, r3, r0 + ldrh r1, [r4] + strh r1, [r0] + ldrh r1, [r4, 0x2] + strh r1, [r0, 0x2] + adds r2, r0, 0 + adds r2, 0x40 + ldrh r1, [r4, 0x4] + strh r1, [r2] + adds r0, 0x42 + ldrh r1, [r4, 0x6] + strh r1, [r0] + ldr r0, =0x03005d9c + ldr r0, [r0] + adds r0, r3, r0 + ldrh r1, [r4, 0x8] + strh r1, [r0] + ldrh r1, [r4, 0xA] + strh r1, [r0, 0x2] + adds r2, r0, 0 + adds r2, 0x40 + ldrh r1, [r4, 0xC] + strh r1, [r2] + adds r0, 0x42 + ldrh r1, [r4, 0xE] + strh r1, [r0] + ldr r0, =0x03005da0 + ldr r0, [r0] + adds r3, r0 + movs r1, 0 + strh r1, [r3] + strh r1, [r3, 0x2] + adds r0, r3, 0 + adds r0, 0x40 + strh r1, [r0] + adds r3, 0x42 + strh r1, [r3] + b _0808A082 + .pool +_0808A030: + ldr r0, =0x03005da4 + ldr r0, [r0] + lsls r3, r2, 1 + adds r0, r3, r0 + ldr r1, =0x00003014 + adds r2, r1, 0 + strh r2, [r0] + strh r2, [r0, 0x2] + adds r1, r0, 0 + adds r1, 0x40 + strh r2, [r1] + adds r0, 0x42 + strh r2, [r0] + ldr r0, =0x03005d9c + ldr r0, [r0] + adds r0, r3, r0 + ldrh r1, [r4] + strh r1, [r0] + ldrh r1, [r4, 0x2] + strh r1, [r0, 0x2] + adds r2, r0, 0 + adds r2, 0x40 + ldrh r1, [r4, 0x4] + strh r1, [r2] + adds r0, 0x42 + ldrh r1, [r4, 0x6] + strh r1, [r0] +_0808A066: + ldr r0, =0x03005da0 + ldr r0, [r0] + adds r3, r0 + ldrh r0, [r4, 0x8] + strh r0, [r3] + ldrh r0, [r4, 0xA] + strh r0, [r3, 0x2] + adds r1, r3, 0 + adds r1, 0x40 + ldrh r0, [r4, 0xC] + strh r0, [r1] + adds r3, 0x42 + ldrh r0, [r4, 0xE] + strh r0, [r3] +_0808A082: + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x3 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end DrawMetatile + + thumb_func_start MapPosToBgTilemapOffset +@ u32 MapPosToBgTilemapOffset(struct struc_28 *, u32 x, u32 y) +MapPosToBgTilemapOffset: @ 808A0AC + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, =0x03005d8c + ldr r3, [r0] + movs r5, 0 + ldrsh r0, [r3, r5] + subs r1, r0 + lsls r1, 1 + cmp r1, 0x1F + bhi _0808A0D6 + ldrb r0, [r4, 0x2] + adds r1, r0 + cmp r1, 0x1F + ble _0808A0CA + subs r1, 0x20 +_0808A0CA: + movs r5, 0x2 + ldrsh r0, [r3, r5] + subs r0, r2, r0 + lsls r2, r0, 1 + cmp r2, 0x1F + bls _0808A0E0 +_0808A0D6: + movs r0, 0x1 + negs r0, r0 + b _0808A0EE + .pool +_0808A0E0: + ldrb r0, [r4, 0x3] + adds r2, r0 + cmp r2, 0x1F + ble _0808A0EA + subs r2, 0x20 +_0808A0EA: + lsls r0, r2, 5 + adds r0, r1 +_0808A0EE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end MapPosToBgTilemapOffset + + thumb_func_start CameraUpdateCallback +@ void CameraUpdateCallback(struct CameraUpdateInfo *info) +CameraUpdateCallback: @ 808A0F4 + push {lr} + adds r3, r0, 0 + ldr r2, [r3, 0x4] + cmp r2, 0 + beq _0808A114 + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r2, 0x32 + ldrsh r1, [r0, r2] + str r1, [r3, 0x8] + movs r1, 0x34 + ldrsh r0, [r0, r1] + str r0, [r3, 0xC] +_0808A114: + pop {r0} + bx r0 + .pool + thumb_func_end CameraUpdateCallback + + thumb_func_start ResetCameraUpdateInfo +@ void ResetCameraUpdateInfo() +ResetCameraUpdateInfo: @ 808A11C + ldr r1, =0x03005dd0 + movs r0, 0 + str r0, [r1, 0x8] + str r0, [r1, 0xC] + str r0, [r1, 0x10] + str r0, [r1, 0x14] + str r0, [r1, 0x4] + str r0, [r1] + bx lr + .pool + thumb_func_end ResetCameraUpdateInfo + + thumb_func_start InitCameraUpdateCallback +@ u8 InitCameraUpdateCallback(u8 followedObjectId) +InitCameraUpdateCallback: @ 808A134 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x03005dd0 + ldr r1, [r4, 0x4] + cmp r1, 0 + beq _0808A150 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles +_0808A150: + adds r0, r5, 0 + bl AddCameraObject + lsls r0, 24 + lsrs r0, 24 + str r0, [r4, 0x4] + ldr r0, =CameraUpdateCallback + str r0, [r4] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end InitCameraUpdateCallback + + thumb_func_start CameraUpdate +@ void CameraUpdate() +CameraUpdate: @ 808A174 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r6, =0x03005dd0 + ldr r1, [r6] + cmp r1, 0 + beq _0808A188 + adds r0, r6, 0 + bl _call_via_r1 +_0808A188: + ldr r7, [r6, 0x8] + ldr r0, [r6, 0xC] + mov r8, r0 + movs r4, 0 + movs r5, 0 + ldr r1, [r6, 0x10] + ldr r0, [r6, 0x14] + cmp r1, 0 + bne _0808A1A6 + cmp r7, 0 + beq _0808A1A6 + subs r4, 0x1 + cmp r7, 0 + ble _0808A1A6 + movs r4, 0x1 +_0808A1A6: + cmp r0, 0 + bne _0808A1BA + mov r2, r8 + cmp r2, 0 + beq _0808A1BA + movs r5, 0x1 + negs r5, r5 + cmp r2, 0 + ble _0808A1BA + movs r5, 0x1 +_0808A1BA: + cmp r1, 0 + beq _0808A1CC + cmn r1, r7 + bne _0808A1CC + movs r4, 0x1 + negs r4, r4 + cmp r7, 0 + ble _0808A1CC + movs r4, 0x1 +_0808A1CC: + cmp r0, 0 + beq _0808A1E0 + mov r3, r8 + cmn r0, r3 + bne _0808A1E0 + movs r4, 0x1 + negs r4, r4 + cmp r3, 0 + ble _0808A1E0 + movs r4, 0x1 +_0808A1E0: + ldr r2, =0x03005dd0 + ldr r0, [r2, 0x10] + adds r1, r0, r7 + str r1, [r2, 0x10] + adds r0, r1, 0 + cmp r1, 0 + bge _0808A1F0 + adds r0, 0xF +_0808A1F0: + asrs r0, 4 + lsls r0, 4 + subs r0, r1, r0 + str r0, [r2, 0x10] + ldr r0, [r2, 0x14] + mov r3, r8 + adds r1, r0, r3 + str r1, [r2, 0x14] + adds r0, r1, 0 + cmp r1, 0 + bge _0808A208 + adds r0, 0xF +_0808A208: + asrs r0, 4 + lsls r0, 4 + subs r0, r1, r0 + str r0, [r2, 0x14] + cmp r4, 0 + bne _0808A218 + cmp r5, 0 + beq _0808A24E +_0808A218: + adds r0, r4, 0 + adds r1, r5, 0 + bl CameraMove + adds r0, r4, 0 + adds r1, r5, 0 + bl UpdateFieldObjectsForCameraUpdate + adds r0, r4, 0 + adds r1, r5, 0 + bl RotatingGatePuzzleCameraUpdate + bl ResetBerryTreeSparkleFlags + ldr r6, =0x03000e20 + lsls r4, 1 + lsls r5, 1 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl tilemap_move_something + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl RedrawMapSlicesForCameraUpdate +_0808A24E: + ldr r0, =0x03000e20 + adds r1, r7, 0 + mov r2, r8 + bl coords8_add + ldr r1, =0x03005dec + ldrh r0, [r1] + subs r0, r7 + strh r0, [r1] + ldr r1, =0x03005de8 + ldrh r0, [r1] + mov r2, r8 + subs r0, r2 + strh r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end CameraUpdate + + thumb_func_start sub_808A284 +sub_808A284: @ 808A284 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl CameraMove + lsls r0, r4, 16 + asrs r0, 16 + lsls r1, r5, 16 + asrs r1, 16 + bl UpdateFieldObjectsForCameraUpdate + bl DrawWholeMapView + ldr r1, =0x03005dec + lsls r4, 4 + ldrh r0, [r1] + subs r0, r4 + strh r0, [r1] + ldr r1, =0x03005de8 + lsls r5, 4 + ldrh r0, [r1] + subs r0, r5 + strh r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808A284 + + thumb_func_start SetCameraPanningCallback +@ void SetCameraPanningCallback(void ( *callback)()) +SetCameraPanningCallback: @ 808A2C0 + ldr r1, =0x03000e30 + str r0, [r1] + bx lr + .pool + thumb_func_end SetCameraPanningCallback + + thumb_func_start SetCameraPanning +@ void SetCameraPanning(s16 x, s16 y) +SetCameraPanning: @ 808A2CC + ldr r2, =0x03000e28 + strh r0, [r2] + ldr r0, =0x03000e2a + lsls r1, 16 + asrs r1, 16 + adds r1, 0x20 + strh r1, [r0] + bx lr + .pool + thumb_func_end SetCameraPanning + + thumb_func_start InstallCameraPanAheadCallback +@ void InstallCameraPanAheadCallback() +InstallCameraPanAheadCallback: @ 808A2E4 + ldr r1, =0x03000e30 + ldr r0, =CameraPanningCB_PanAhead + str r0, [r1] + ldr r1, =0x03000e2c + movs r0, 0 + strb r0, [r1] + ldr r1, =0x03000e28 + movs r0, 0 + strh r0, [r1] + ldr r1, =0x03000e2a + movs r0, 0x20 + strh r0, [r1] + bx lr + .pool + thumb_func_end InstallCameraPanAheadCallback + + thumb_func_start UpdateCameraPanning +@ void UpdateCameraPanning() +UpdateCameraPanning: @ 808A314 + push {lr} + ldr r0, =0x03000e30 + ldr r0, [r0] + cmp r0, 0 + beq _0808A322 + bl _call_via_r0 +_0808A322: + ldr r2, =0x02021bbc + ldr r0, =0x03005dec + ldr r1, =0x03000e28 + ldrh r0, [r0] + ldrh r1, [r1] + subs r0, r1 + strh r0, [r2] + ldr r2, =0x02021bbe + ldr r0, =0x03005de8 + ldr r1, =0x03000e2a + ldrh r0, [r0] + ldrh r1, [r1] + subs r0, r1 + subs r0, 0x8 + strh r0, [r2] + pop {r0} + bx r0 + .pool + thumb_func_end UpdateCameraPanning + + thumb_func_start CameraPanningCB_PanAhead +@ void CameraPanningCB_PanAhead() +CameraPanningCB_PanAhead: @ 808A360 + push {lr} + ldr r0, =0x02037348 + ldrb r0, [r0] + cmp r0, 0 + bne _0808A374 + bl InstallCameraPanAheadCallback + b _0808A3FC + .pool +_0808A374: + ldr r0, =0x02037590 + ldrb r0, [r0, 0x3] + cmp r0, 0x1 + bne _0808A394 + ldr r0, =0x03000e2c + ldrb r1, [r0] + movs r2, 0x1 + eors r1, r2 + strb r1, [r0] + cmp r1, 0 + beq _0808A3FC + b _0808A39A + .pool +_0808A394: + ldr r1, =0x03000e2c + movs r0, 0 + strb r0, [r1] +_0808A39A: + bl player_get_direction_upper_nybble + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0808A3C4 + ldr r2, =0x03000e2a + ldrh r3, [r2] + movs r0, 0 + ldrsh r1, [r2, r0] + movs r0, 0x8 + negs r0, r0 + cmp r1, r0 + ble _0808A3FC + subs r0, r3, 0x2 + b _0808A3FA + .pool +_0808A3C4: + cmp r0, 0x1 + bne _0808A3E0 + ldr r1, =0x03000e2a + ldrh r2, [r1] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0x47 + bgt _0808A3FC + adds r0, r2, 0x2 + strh r0, [r1] + b _0808A3FC + .pool +_0808A3E0: + ldr r2, =0x03000e2a + ldrh r0, [r2] + movs r3, 0 + ldrsh r1, [r2, r3] + cmp r1, 0x1F + bgt _0808A3F4 + adds r0, 0x2 + b _0808A3FA + .pool +_0808A3F4: + cmp r1, 0x20 + ble _0808A3FC + subs r0, 0x2 +_0808A3FA: + strh r0, [r2] +_0808A3FC: + pop {r0} + bx r0 + thumb_func_end CameraPanningCB_PanAhead + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/field_door.s b/asm/field_door.s new file mode 100644 index 000000000..652137b3b --- /dev/null +++ b/asm/field_door.s @@ -0,0 +1,754 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_808A400 +sub_808A400: @ 808A400 + push {lr} + adds r2, r0, 0 + ldrb r0, [r2, 0x3] + cmp r0, 0x2 + bne _0808A420 + ldrh r1, [r1, 0x2] + ldr r0, [r2, 0x4] + adds r0, r1 + ldr r1, =0x06007e00 + movs r2, 0x80 + bl CpuFastSet + b _0808A42E + .pool +_0808A420: + ldrh r1, [r1, 0x2] + ldr r0, [r2, 0x4] + adds r0, r1 + ldr r1, =0x06007f00 + movs r2, 0x40 + bl CpuFastSet +_0808A42E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_808A400 + + thumb_func_start door_build_blockdef +door_build_blockdef: @ 808A438 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + movs r4, 0 + adds r1, r6, 0 +_0808A444: + ldrb r0, [r2] + lsls r0, 28 + lsrs r3, r0, 16 + adds r2, 0x1 + adds r0, r5, r4 + orrs r3, r0 + strh r3, [r1] + adds r1, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _0808A444 + cmp r4, 0x7 + bgt _0808A472 + lsls r0, r4, 1 + adds r1, r0, r6 +_0808A462: + ldrb r0, [r2] + lsls r3, r0, 12 + adds r2, 0x1 + strh r3, [r1] + adds r1, 0x2 + adds r4, 0x1 + cmp r4, 0x7 + ble _0808A462 +_0808A472: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end door_build_blockdef + + thumb_func_start door_patch_tilemap +door_patch_tilemap: @ 808A478 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x30 + adds r7, r1, 0 + mov r9, r2 + adds r5, r3, 0 + ldrb r0, [r0, 0x3] + cmp r0, 0x2 + bne _0808A4F4 + add r4, sp, 0x10 + movs r1, 0xFC + lsls r1, 2 + adds r0, r4, 0 + adds r2, r5, 0 + bl door_build_blockdef + mov r6, r9 + subs r6, 0x1 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r4, 0 + bl DrawDoorMetatileAt + movs r1, 0xFD + lsls r1, 2 + adds r0, r5, 0x4 + mov r8, r0 + adds r0, r4, 0 + mov r2, r8 + bl door_build_blockdef + adds r0, r7, 0 + mov r1, r9 + adds r2, r4, 0 + bl DrawDoorMetatileAt + movs r1, 0xFE + lsls r1, 2 + adds r0, r4, 0 + adds r2, r5, 0 + bl door_build_blockdef + adds r5, r7, 0x1 + adds r0, r5, 0 + adds r1, r6, 0 + adds r2, r4, 0 + bl DrawDoorMetatileAt + movs r1, 0xFF + lsls r1, 2 + adds r0, r4, 0 + mov r2, r8 + bl door_build_blockdef + adds r0, r5, 0 + mov r1, r9 + adds r2, r4, 0 + bl DrawDoorMetatileAt + b _0808A522 +_0808A4F4: + movs r1, 0xFE + lsls r1, 2 + mov r0, sp + adds r2, r5, 0 + bl door_build_blockdef + mov r1, r9 + subs r1, 0x1 + adds r0, r7, 0 + mov r2, sp + bl DrawDoorMetatileAt + movs r1, 0xFF + lsls r1, 2 + adds r2, r5, 0x4 + mov r0, sp + bl door_build_blockdef + adds r0, r7, 0 + mov r1, r9 + mov r2, sp + bl DrawDoorMetatileAt +_0808A522: + add sp, 0x30 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end door_patch_tilemap + + thumb_func_start sub_808A530 +sub_808A530: @ 808A530 + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + subs r7, r6, 0x1 + adds r0, r5, 0 + adds r1, r7, 0 + bl CurrentMapDrawMetatileAt + adds r0, r5, 0 + adds r1, r6, 0 + bl CurrentMapDrawMetatileAt + ldrb r0, [r4, 0x3] + cmp r0, 0x2 + bne _0808A562 + adds r4, r5, 0x1 + adds r0, r4, 0 + adds r1, r7, 0 + bl CurrentMapDrawMetatileAt + adds r0, r4, 0 + adds r1, r6, 0 + bl CurrentMapDrawMetatileAt +_0808A562: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_808A530 + + thumb_func_start sub_808A568 +sub_808A568: @ 808A568 + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + adds r7, r3, 0 + ldrh r1, [r5, 0x2] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _0808A5B0 + adds r0, r4, 0 + adds r1, r6, 0 + adds r2, r7, 0 + bl sub_808A530 + bl sub_808A964 + lsls r0, 24 + cmp r0, 0 + beq _0808A5E2 + ldr r0, =0x020375e0 + ldrh r1, [r0] + adds r1, 0x7 + ldr r0, =0x020375e2 + ldrh r2, [r0] + adds r2, 0x7 + adds r0, r4, 0 + bl sub_808A530 + b _0808A5E2 + .pool +_0808A5B0: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_808A400 + ldr r3, [r4, 0x8] + adds r0, r4, 0 + adds r1, r6, 0 + adds r2, r7, 0 + bl door_patch_tilemap + bl sub_808A964 + lsls r0, 24 + cmp r0, 0 + beq _0808A5E2 + ldr r0, =0x020375e0 + ldrh r1, [r0] + adds r1, 0x7 + ldr r0, =0x020375e2 + ldrh r2, [r0] + adds r2, 0x7 + ldr r3, [r4, 0x8] + adds r0, r4, 0 + bl door_patch_tilemap +_0808A5E2: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808A568 + + thumb_func_start sub_808A5F0 +sub_808A5F0: @ 808A5F0 + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + adds r4, r2, 0 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0808A616 + movs r2, 0x8 + ldrsh r1, [r4, r2] + lsls r1, 2 + adds r1, r5, r1 + movs r0, 0xC + ldrsh r2, [r4, r0] + movs r0, 0xE + ldrsh r3, [r4, r0] + adds r0, r6, 0 + bl sub_808A568 +_0808A616: + movs r2, 0xA + ldrsh r1, [r4, r2] + movs r2, 0x8 + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0] + cmp r1, r0 + bne _0808A644 + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _0808A64A + movs r0, 0 + b _0808A64C +_0808A644: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] +_0808A64A: + movs r0, 0x1 +_0808A64C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808A5F0 + + thumb_func_start task50_overworld_door +task50_overworld_door: @ 808A654 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 3 + ldr r0, =0x03005e08 + adds r2, r0 + ldrh r1, [r2] + lsls r1, 16 + ldrh r0, [r2, 0x2] + orrs r1, r0 + ldrh r0, [r2, 0x4] + lsls r0, 16 + ldrh r3, [r2, 0x6] + orrs r0, r3 + bl sub_808A5F0 + cmp r0, 0 + bne _0808A682 + adds r0, r4, 0 + bl DestroyTask +_0808A682: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task50_overworld_door + + thumb_func_start door_frame_last +door_frame_last: @ 808A68C + push {lr} + adds r1, r0, 0 + b _0808A694 +_0808A692: + adds r1, 0x4 +_0808A694: + ldrb r0, [r1] + cmp r0, 0 + bne _0808A692 + subs r0, r1, 0x4 + pop {r1} + bx r1 + thumb_func_end door_frame_last + + thumb_func_start door_find +door_find: @ 808A6A0 + push {lr} + adds r2, r0, 0 + lsls r1, 16 + lsrs r1, 16 + b _0808A6B6 +_0808A6AA: + ldrh r0, [r2] + cmp r0, r1 + bne _0808A6B4 + adds r0, r2, 0 + b _0808A6BE +_0808A6B4: + adds r2, 0xC +_0808A6B6: + ldr r0, [r2, 0x4] + cmp r0, 0 + bne _0808A6AA + movs r0, 0 +_0808A6BE: + pop {r1} + bx r1 + thumb_func_end door_find + + thumb_func_start task_overworld_door_add_if_inactive +task_overworld_door_add_if_inactive: @ 808A6C4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r5, r1, 0 + adds r7, r2, 0 + mov r8, r3 + ldr r4, =task50_overworld_door + adds r0, r4, 0 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0808A718 + adds r0, r4, 0 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r2, =0x03005e08 + adds r1, r2 + strh r7, [r1, 0xC] + mov r2, r8 + strh r2, [r1, 0xE] + strh r5, [r1, 0x2] + lsrs r2, r5, 16 + strh r2, [r1] + strh r6, [r1, 0x6] + lsrs r2, r6, 16 + strh r2, [r1, 0x4] + lsls r0, 24 + asrs r0, 24 + b _0808A71C + .pool +_0808A718: + movs r0, 0x1 + negs r0, r0 +_0808A71C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end task_overworld_door_add_if_inactive + + thumb_func_start sub_808A728 +sub_808A728: @ 808A728 + push {lr} + bl sub_808A530 + pop {r0} + bx r0 + thumb_func_end sub_808A728 + + thumb_func_start sub_808A734 +sub_808A734: @ 808A734 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + adds r0, r5, 0 + adds r1, r6, 0 + bl MapGridGetMetatileIdAt + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl door_find + adds r4, r0, 0 + cmp r4, 0 + beq _0808A76A + ldr r1, =gUnknown_08496F8C + adds r0, r1, 0 + bl door_frame_last + adds r1, r0, 0 + adds r0, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_808A568 +_0808A76A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808A734 + + thumb_func_start task_overworld_door_add_for_opening_door_at +@ s32 task_overworld_door_add_for_opening_door_at(void *a1, s32 x, s32 y) +task_overworld_door_add_for_opening_door_at: @ 808A774 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + adds r0, r5, 0 + adds r1, r6, 0 + bl MapGridGetMetatileIdAt + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl door_find + adds r2, r0, 0 + adds r4, r2, 0 + cmp r2, 0 + bne _0808A79E + movs r0, 0x1 + negs r0, r0 + b _0808A7C0 +_0808A79E: + ldrb r0, [r2, 0x3] + cmp r0, 0x2 + beq _0808A7B0 + ldr r1, =gUnknown_08496F8C + adds r0, r2, 0 + b _0808A7B4 + .pool +_0808A7B0: + ldr r1, =gUnknown_08496FB4 + adds r0, r4, 0 +_0808A7B4: + adds r2, r5, 0 + adds r3, r6, 0 + bl task_overworld_door_add_if_inactive + lsls r0, 24 + asrs r0, 24 +_0808A7C0: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end task_overworld_door_add_for_opening_door_at + + thumb_func_start sub_808A7CC +sub_808A7CC: @ 808A7CC + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + adds r0, r5, 0 + adds r1, r6, 0 + bl MapGridGetMetatileIdAt + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl door_find + cmp r0, 0 + beq _0808A800 + ldr r1, =gUnknown_08496FA0 + adds r2, r5, 0 + adds r3, r6, 0 + bl task_overworld_door_add_if_inactive + lsls r0, 24 + asrs r0, 24 + b _0808A804 + .pool +_0808A800: + movs r0, 0x1 + negs r0, r0 +_0808A804: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808A7CC + + thumb_func_start cur_mapdata_get_door_x2_at +cur_mapdata_get_door_x2_at: @ 808A80C + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + adds r1, r2, 0 + bl MapGridGetMetatileIdAt + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl door_find + cmp r0, 0 + beq _0808A830 + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + b _0808A834 +_0808A830: + movs r0, 0x1 + negs r0, r0 +_0808A834: + pop {r4} + pop {r1} + bx r1 + thumb_func_end cur_mapdata_get_door_x2_at + + thumb_func_start sub_808A83C +sub_808A83C: @ 808A83C + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + ldr r0, =gUnknown_08497174 + adds r1, r3, 0 + bl task_overworld_door_add_for_opening_door_at + pop {r0} + bx r0 + .pool + thumb_func_end sub_808A83C + + thumb_func_start sub_808A854 +sub_808A854: @ 808A854 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl sub_8088EFC + lsls r0, 24 + cmp r0, 0 + beq _0808A876 + ldr r0, =gUnknown_08497174 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_808A734 +_0808A876: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808A854 + + thumb_func_start sub_808A880 +sub_808A880: @ 808A880 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl sub_8088EFC + lsls r0, 24 + cmp r0, 0 + beq _0808A8A2 + ldr r0, =gUnknown_08497174 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_808A728 +_0808A8A2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808A880 + + thumb_func_start sub_808A8AC +sub_808A8AC: @ 808A8AC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl sub_8088EFC + lsls r0, 24 + cmp r0, 0 + beq _0808A8D8 + ldr r0, =gUnknown_08497174 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_808A7CC + lsls r0, 24 + asrs r0, 24 + b _0808A8DC + .pool +_0808A8D8: + movs r0, 0x1 + negs r0, r0 +_0808A8DC: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808A8AC + + thumb_func_start task_overworld_door_add_if_role_69_for_opening_door_at +task_overworld_door_add_if_role_69_for_opening_door_at: @ 808A8E4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl sub_8088EFC + lsls r0, 24 + cmp r0, 0 + beq _0808A910 + ldr r0, =gUnknown_08497174 + adds r1, r4, 0 + adds r2, r5, 0 + bl task_overworld_door_add_for_opening_door_at + lsls r0, 24 + asrs r0, 24 + b _0808A914 + .pool +_0808A910: + movs r0, 0x1 + negs r0, r0 +_0808A914: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end task_overworld_door_add_if_role_69_for_opening_door_at + + thumb_func_start sub_808A91C +sub_808A91C: @ 808A91C + push {lr} + ldr r0, =task50_overworld_door + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_808A91C + + thumb_func_start cur_mapdata_get_door_sound_at +cur_mapdata_get_door_sound_at: @ 808A930 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + ldr r0, =gUnknown_08497174 + adds r1, r3, 0 + bl cur_mapdata_get_door_x2_at + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + beq _0808A958 + cmp r0, 0x1 + bne _0808A954 + movs r0, 0x12 + b _0808A95E + .pool +_0808A954: + cmp r0, 0x2 + beq _0808A95C +_0808A958: + movs r0, 0x8 + b _0808A95E +_0808A95C: + movs r0, 0x2F +_0808A95E: + pop {r1} + bx r1 + thumb_func_end cur_mapdata_get_door_sound_at + + thumb_func_start sub_808A964 +sub_808A964: @ 808A964 + push {lr} + ldr r0, =0x00004002 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0808A990 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, =0x0000101a + cmp r1, r0 + bne _0808A990 + movs r0, 0x1 + b _0808A992 + .pool +_0808A990: + movs r0, 0 +_0808A992: + pop {r1} + bx r1 + thumb_func_end sub_808A964 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/field_effect.s b/asm/field_effect.s new file mode 100644 index 000000000..c4deb8d98 --- /dev/null +++ b/asm/field_effect.s @@ -0,0 +1,501 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start FieldEffectStart +@ u8 FieldEffectStart(u8 id) +FieldEffectStart: @ 80B5B18 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl FieldEffectActiveListAdd + ldr r0, =gFieldEffectScriptPointers + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + str r0, [sp] + add r4, sp, 0x4 + ldr r5, =gUnknown_0855C1F0 +_080B5B36: + ldr r0, [sp] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r5 + ldr r2, [r0] + mov r0, sp + adds r1, r4, 0 + bl _call_via_r2 + lsls r0, 24 + cmp r0, 0 + bne _080B5B36 + ldr r0, [sp, 0x4] + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end FieldEffectStart + + thumb_func_start FieldEffectCmd_loadtiles +@ bool8 FieldEffectCmd_loadtiles(u8 **script, u8 *returnValue) +FieldEffectCmd_loadtiles: @ 80B5B60 + push {lr} + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + bl FieldEffectScript_LoadTiles + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end FieldEffectCmd_loadtiles + + thumb_func_start FieldEffectCmd_loadfadedpal +@ bool8 FieldEffectCmd_loadfadedpal(u8 **script, u8 *returnValue) +FieldEffectCmd_loadfadedpal: @ 80B5B74 + push {lr} + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + bl FieldEffectScript_LoadFadedPalette + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end FieldEffectCmd_loadfadedpal + + thumb_func_start FieldEffectCmd_loadpal +@ bool8 FieldEffectCmd_loadpal(u8 **script, u8 *returnValue) +FieldEffectCmd_loadpal: @ 80B5B88 + push {lr} + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + bl FieldEffectScript_LoadPalette + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end FieldEffectCmd_loadpal + + thumb_func_start FieldEffectCmd_callnative +@ bool8 FieldEffectCmd_callnative(u8 **script, u8 *returnValue) +FieldEffectCmd_callnative: @ 80B5B9C + push {lr} + ldr r2, [r0] + adds r2, 0x1 + str r2, [r0] + bl FieldEffectScript_CallNative + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end FieldEffectCmd_callnative + + thumb_func_start FieldEffectCmd_end +@ bool8 FieldEffectCmd_end(u8 **script, u8 *returnValue) +FieldEffectCmd_end: @ 80B5BB0 + movs r0, 0 + bx lr + thumb_func_end FieldEffectCmd_end + + thumb_func_start FieldEffectCmd_loadgfx_callnative +@ bool8 FieldEffectCmd_loadgfx_callnative(u8 **script, u8 *returnValue) +FieldEffectCmd_loadgfx_callnative: @ 80B5BB4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, [r4] + adds r0, 0x1 + str r0, [r4] + adds r0, r4, 0 + bl FieldEffectScript_LoadTiles + adds r0, r4, 0 + bl FieldEffectScript_LoadFadedPalette + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldEffectScript_CallNative + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end FieldEffectCmd_loadgfx_callnative + + thumb_func_start FieldEffectCmd_loadtiles_callnative +@ bool8 FieldEffectCmd_loadtiles_callnative(u8 **script, u8 *returnValue) +FieldEffectCmd_loadtiles_callnative: @ 80B5BDC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, [r4] + adds r0, 0x1 + str r0, [r4] + adds r0, r4, 0 + bl FieldEffectScript_LoadTiles + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldEffectScript_CallNative + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end FieldEffectCmd_loadtiles_callnative + + thumb_func_start FieldEffectCmd_loadfadedpal_callnative +@ bool8 FieldEffectCmd_loadfadedpal_callnative(u8 **script, u8 *returnValue) +FieldEffectCmd_loadfadedpal_callnative: @ 80B5C00 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, [r4] + adds r0, 0x1 + str r0, [r4] + adds r0, r4, 0 + bl FieldEffectScript_LoadFadedPalette + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldEffectScript_CallNative + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end FieldEffectCmd_loadfadedpal_callnative + + thumb_func_start FieldEffectScript_ReadWord +@ u32 FieldEffectScript_ReadWord(u8 **script) +FieldEffectScript_ReadWord: @ 80B5C24 + ldr r2, [r0] + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + lsls r1, 8 + adds r0, r1 + ldrb r1, [r2, 0x2] + lsls r1, 16 + adds r0, r1 + ldrb r1, [r2, 0x3] + lsls r1, 24 + adds r0, r1 + bx lr + thumb_func_end FieldEffectScript_ReadWord + + thumb_func_start FieldEffectScript_LoadTiles +@ void FieldEffectScript_LoadTiles(u8 **script) +FieldEffectScript_LoadTiles: @ 80B5C3C + push {r4,r5,lr} + adds r4, r0, 0 + bl FieldEffectScript_ReadWord + adds r5, r0, 0 + ldrh r0, [r5, 0x6] + bl GetObjectTileRangeStartByTag + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + bne _080B5C5A + adds r0, r5, 0 + bl LoadObjectPic +_080B5C5A: + ldr r0, [r4] + adds r0, 0x4 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end FieldEffectScript_LoadTiles + + thumb_func_start FieldEffectScript_LoadFadedPalette +@ void FieldEffectScript_LoadFadedPalette(u8 **script) +FieldEffectScript_LoadFadedPalette: @ 80B5C6C + push {r4,r5,lr} + adds r5, r0, 0 + bl FieldEffectScript_ReadWord + adds r4, r0, 0 + bl LoadTaggedObjectPalette + ldrh r0, [r4, 0x4] + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + bl sub_80ABE18 + ldr r0, [r5] + adds r0, 0x4 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end FieldEffectScript_LoadFadedPalette + + thumb_func_start FieldEffectScript_LoadPalette +@ void FieldEffectScript_LoadPalette(u8 **script) +FieldEffectScript_LoadPalette: @ 80B5C94 + push {r4,lr} + adds r4, r0, 0 + bl FieldEffectScript_ReadWord + bl LoadTaggedObjectPalette + ldr r0, [r4] + adds r0, 0x4 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + thumb_func_end FieldEffectScript_LoadPalette + + thumb_func_start FieldEffectScript_CallNative +@ void FieldEffectScript_CallNative(u8 **script, u8 *returnValue) +FieldEffectScript_CallNative: @ 80B5CAC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl FieldEffectScript_ReadWord + bl _call_via_r0 + str r0, [r5] + ldr r0, [r4] + adds r0, 0x4 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end FieldEffectScript_CallNative + + thumb_func_start FieldEffectFreeGraphicsResources +@ void FieldEffectFreeGraphicsResources(struct obj *object) +FieldEffectFreeGraphicsResources: @ 80B5CC8 + push {r4,r5,lr} + adds r1, r0, 0 + adds r1, 0x40 + ldrh r5, [r1] + ldrb r4, [r0, 0x5] + lsrs r4, 4 + bl RemoveObjectAndFreeTiles + adds r0, r5, 0 + bl FieldEffectFreeTilesIfUnused + adds r0, r4, 0 + bl FieldEffectFreePaletteIfUnused + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end FieldEffectFreeGraphicsResources + + thumb_func_start FieldEffectStop +@ void FieldEffectStop(struct obj *object, u8 id) +FieldEffectStop: @ 80B5CEC + push {r4,lr} + lsls r4, r1, 24 + lsrs r4, 24 + bl FieldEffectFreeGraphicsResources + adds r0, r4, 0 + bl FieldEffectActiveListRemove + pop {r4} + pop {r0} + bx r0 + thumb_func_end FieldEffectStop + + thumb_func_start FieldEffectFreeTilesIfUnused +@ void FieldEffectFreeTilesIfUnused(u16 tileRangeStart) +FieldEffectFreeTilesIfUnused: @ 80B5D04 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl GetTagByObjectTileRangeStart + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, =0x0000ffff + cmp r3, r0 + beq _080B5D58 + movs r2, 0 + ldr r5, =0x02020630 +_080B5D1E: + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r5 + adds r0, r1, 0 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + beq _080B5D48 + adds r0, r1, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 25 + cmp r0, 0 + bge _080B5D48 + adds r0, r1, 0 + adds r0, 0x40 + ldrh r0, [r0] + cmp r4, r0 + beq _080B5D58 +_080B5D48: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3F + bls _080B5D1E + adds r0, r3, 0 + bl FreeObjectTilesByTag +_080B5D58: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end FieldEffectFreeTilesIfUnused + + thumb_func_start FieldEffectFreePaletteIfUnused +@ void FieldEffectFreePaletteIfUnused(u8 paletteSlot) +FieldEffectFreePaletteIfUnused: @ 80B5D68 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl GetObjectPaletteTagBySlot + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =0x0000ffff + cmp r5, r0 + beq _080B5DB0 + movs r2, 0 + ldr r6, =0x02020630 + adds r3, r4, 0 +_080B5D84: + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r6 + adds r0, r1, 0 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + beq _080B5DA0 + ldrb r0, [r1, 0x5] + lsrs r0, 4 + cmp r0, r3 + beq _080B5DB0 +_080B5DA0: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3F + bls _080B5D84 + adds r0, r5, 0 + bl FreeObjectPaletteByTag +_080B5DB0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end FieldEffectFreePaletteIfUnused + + thumb_func_start FieldEffectActiveListClear +@ void FieldEffectActiveListClear() +FieldEffectActiveListClear: @ 80B5DC0 + push {r4,lr} + movs r2, 0 + ldr r4, =0x03000f58 + movs r3, 0xFF +_080B5DC8: + adds r0, r2, r4 + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x1F + bls _080B5DC8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end FieldEffectActiveListClear + + thumb_func_start FieldEffectActiveListAdd +@ void FieldEffectActiveListAdd(u8 id) +FieldEffectActiveListAdd: @ 80B5DE4 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + movs r2, 0 + ldr r4, =0x03000f58 +_080B5DEE: + adds r1, r2, r4 + ldrb r0, [r1] + cmp r0, 0xFF + bne _080B5E00 + strb r3, [r1] + b _080B5E0A + .pool +_080B5E00: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x1F + bls _080B5DEE +_080B5E0A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end FieldEffectActiveListAdd + + thumb_func_start FieldEffectActiveListRemove +@ void FieldEffectActiveListRemove(u8 id) +FieldEffectActiveListRemove: @ 80B5E10 + push {r4,r5,lr} + lsls r0, 24 + lsrs r3, r0, 24 + movs r2, 0 + ldr r4, =0x03000f58 + movs r5, 0xFF +_080B5E1C: + adds r1, r2, r4 + ldrb r0, [r1] + cmp r0, r3 + bne _080B5E30 + orrs r0, r5 + strb r0, [r1] + b _080B5E3A + .pool +_080B5E30: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x1F + bls _080B5E1C +_080B5E3A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end FieldEffectActiveListRemove + + thumb_func_start FieldEffectActiveListContains +@ void FieldEffectActiveListContains(u8 id) +FieldEffectActiveListContains: @ 80B5E40 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r3, =0x03000f58 +_080B5E4A: + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _080B5E5C + movs r0, 0x1 + b _080B5E68 + .pool +_080B5E5C: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1F + bls _080B5E4A + movs r0, 0 +_080B5E68: + pop {r1} + bx r1 + thumb_func_end FieldEffectActiveListContains + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/field_effect_helpers.s b/asm/field_effect_helpers.s new file mode 100644 index 000000000..28c4c5e9d --- /dev/null +++ b/asm/field_effect_helpers.s @@ -0,0 +1,4603 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start SetUpReflection +SetUpReflection: @ 8153ED4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r4, r1, 0 + lsls r5, r2, 24 + lsrs r5, 24 + movs r0, 0x20 + ldrsh r1, [r4, r0] + movs r0, 0x22 + ldrsh r2, [r4, r0] + adds r0, r4, 0 + movs r3, 0x98 + bl obj_unfreeze + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r7, r1, r0 + ldr r0, =objc_reflection_maybe + str r0, [r7, 0x1C] + ldrb r1, [r7, 0x5] + movs r0, 0xC + orrs r1, r0 + strb r1, [r7, 0x5] + ldr r2, =gUnknown_084975C4 + lsrs r0, r1, 4 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 4 + movs r2, 0xF + ands r1, r2 + orrs r1, r0 + strb r1, [r7, 0x5] + movs r1, 0x3F + adds r1, r7 + mov r8, r1 + ldrb r0, [r1] + movs r1, 0x40 + orrs r0, r1 + mov r1, r8 + strb r0, [r1] + ldr r0, =gDummyObjectImageAnimTable + str r0, [r7, 0x8] + adds r0, r7, 0 + movs r1, 0 + bl StartObjectImageAnim + ldr r0, =gDummyObjectRotScalAnimTable + str r0, [r7, 0x10] + mov r1, r8 + ldrb r0, [r1] + movs r1, 0x8 + orrs r0, r1 + mov r1, r8 + strb r0, [r1] + adds r2, r7, 0 + adds r2, 0x42 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x2E] + strh r0, [r7, 0x2E] + ldrb r0, [r6, 0x8] + strh r0, [r7, 0x30] + strh r5, [r7, 0x3C] + adds r0, r6, 0 + adds r1, r7, 0 + bl npc_pal_op + cmp r5, 0 + bne _08153F7A + ldrb r0, [r7, 0x1] + movs r1, 0x4 + negs r1, r1 + ands r1, r0 + movs r0, 0x1 + orrs r1, r0 + strb r1, [r7, 0x1] +_08153F7A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end SetUpReflection + + thumb_func_start sub_8153F98 +sub_8153F98: @ 8153F98 + push {lr} + ldrb r0, [r0, 0x5] + bl GetFieldObjectGraphicsInfo + ldrh r0, [r0, 0xA] + subs r0, 0x2 + lsls r0, 16 + asrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_8153F98 + + thumb_func_start npc_pal_op +@ void npc_pal_op(struct npc_state *npcState, struct obj *obj) +npc_pal_op: @ 8153FAC + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r0, 0 + adds r4, r1, 0 + ldr r1, =gUnknown_085CDC38 + mov r0, sp + movs r2, 0x6 + bl memcpy + movs r0, 0 + strh r0, [r4, 0x32] + ldrb r0, [r5, 0x5] + bl GetFieldObjectGraphicsInfo + ldrb r1, [r0, 0xC] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08154008 + ldrb r0, [r5, 0x1F] + bl sub_80894D4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08153FEE + ldrb r0, [r5, 0x1E] + bl sub_80894D4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08154008 +_08153FEE: + subs r0, 0x1 + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + strh r0, [r4, 0x32] + ldrb r1, [r4, 0x5] + lsrs r1, 4 + adds r0, r5, 0 + bl npc_pal_op_A + b _08154012 + .pool +_08154008: + ldrb r1, [r4, 0x5] + lsrs r1, 4 + adds r0, r5, 0 + bl npc_pal_op_B +_08154012: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end npc_pal_op + + thumb_func_start npc_pal_op_B +@ void npc_pal_op_B(void *a1, u8 slot) +npc_pal_op_B: @ 815401C + push {r4,lr} + lsls r1, 24 + lsrs r4, r1, 24 + ldrb r0, [r0, 0x5] + bl GetFieldObjectGraphicsInfo + adds r2, r0, 0 + ldrh r1, [r2, 0x4] + ldr r0, =0x000011ff + cmp r1, r0 + beq _08154070 + ldrb r0, [r2, 0xC] + movs r1, 0xF + ands r1, r0 + cmp r1, 0 + bne _0815404C + ldrh r0, [r2, 0x2] + adds r1, r4, 0 + bl npc_load_two_palettes__no_record + b _0815406A + .pool +_0815404C: + cmp r1, 0xA + bne _0815405A + ldrh r0, [r2, 0x2] + adds r1, r4, 0 + bl npc_load_two_palettes__and_record + b _0815406A +_0815405A: + adds r0, r4, 0 + bl npc_paltag_by_palslot + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl pal_patch_for_npc +_0815406A: + adds r0, r4, 0 + bl sub_80ABE18 +_08154070: + pop {r4} + pop {r0} + bx r0 + thumb_func_end npc_pal_op_B + + thumb_func_start npc_pal_op_A +npc_pal_op_A: @ 8154078 + push {r4,lr} + lsls r1, 24 + lsrs r4, r1, 24 + ldrb r0, [r0, 0x5] + bl GetFieldObjectGraphicsInfo + adds r2, r0, 0 + ldrh r1, [r2, 0x4] + ldr r0, =0x000011ff + cmp r1, r0 + beq _0815409C + adds r0, r1, 0 + adds r1, r4, 0 + bl pal_patch_for_npc + adds r0, r4, 0 + bl sub_80ABE18 +_0815409C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end npc_pal_op_A + + thumb_func_start objc_reflection_maybe +@ void objc_reflection_maybe(struct obj *object) +objc_reflection_maybe: @ 81540A8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r4, r0, 0 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r7, r0, r1 + ldrb r1, [r7, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r5, r0, r1 + ldr r0, [r7] + ldr r1, =0x00020001 + ands r0, r1 + cmp r0, r1 + bne _081540E0 + ldrb r1, [r7, 0x8] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r1, r0 + beq _081540FC +_081540E0: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + b _08154214 + .pool +_081540FC: + ldr r1, =gUnknown_084975C4 + ldrb r0, [r5, 0x5] + lsrs r0, 4 + adds r0, r1 + ldrb r1, [r0] + lsls r1, 4 + ldrb r2, [r4, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x5] + ldrb r1, [r5, 0x1] + lsrs r1, 6 + lsls r1, 6 + ldrb r2, [r4, 0x1] + movs r3, 0x3F + adds r0, r3, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r5, 0x3] + lsrs r0, 6 + lsls r0, 6 + ldrb r2, [r4, 0x3] + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x3] + ldrb r0, [r5, 0x3] + lsls r0, 26 + lsrs r0, 27 + movs r2, 0x10 + orrs r0, r2 + lsls r0, 1 + subs r2, 0x4F + mov r9, r2 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x3] + ldrh r1, [r5, 0x4] + lsls r1, 22 + lsrs r1, 22 + ldrh r2, [r4, 0x4] + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + ldr r0, [r5, 0x18] + str r0, [r4, 0x18] + adds r0, r5, 0 + adds r0, 0x42 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 26 + adds r2, r4, 0 + adds r2, 0x42 + ands r3, r0 + ldrb r1, [r2] + movs r0, 0x40 + negs r0, r0 + ands r0, r1 + orrs r0, r3 + strb r0, [r2] + movs r0, 0x3E + adds r0, r5 + mov r8, r0 + ldrb r0, [r0] + adds r6, r4, 0 + adds r6, 0x3E + movs r1, 0x4 + ands r1, r0 + ldrb r2, [r6] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r6] + ldrh r0, [r5, 0x20] + strh r0, [r4, 0x20] + adds r0, r7, 0 + bl sub_8153F98 + ldrh r1, [r5, 0x22] + adds r0, r1 + ldrh r1, [r4, 0x32] + adds r1, r0 + strh r1, [r4, 0x22] + adds r0, r5, 0 + adds r0, 0x28 + ldrb r1, [r0] + adds r0, r4, 0 + adds r0, 0x28 + strb r1, [r0] + adds r0, r5, 0 + adds r0, 0x29 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x29 + strb r0, [r1] + ldrh r0, [r5, 0x24] + strh r0, [r4, 0x24] + ldrh r0, [r5, 0x26] + negs r0, r0 + strh r0, [r4, 0x26] + mov r2, r8 + ldrb r1, [r2] + movs r0, 0x2 + ands r0, r1 + ldrb r1, [r6] + movs r2, 0x3 + negs r2, r2 + ands r2, r1 + orrs r2, r0 + strb r2, [r6] + ldrb r0, [r7, 0x3] + lsls r0, 28 + cmp r0, 0 + bge _081541EE + movs r0, 0x4 + orrs r2, r0 + strb r2, [r6] +_081541EE: + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08154214 + ldrb r0, [r4, 0x3] + mov r2, r9 + ands r2, r0 + strb r2, [r4, 0x3] + ldrb r0, [r5, 0x3] + lsls r0, 26 + lsrs r0, 27 + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08154214 + movs r1, 0x2 + adds r0, r2, 0 + orrs r0, r1 + strb r0, [r4, 0x3] +_08154214: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end objc_reflection_maybe + + thumb_func_start sub_8154228 +sub_8154228: @ 8154228 + push {r4,lr} + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x20] + movs r1, 0 + movs r2, 0 + movs r3, 0x52 + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + cmp r0, 0x40 + beq _08154266 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + movs r3, 0x4 + orrs r0, r3 + strb r0, [r1, 0x5] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x2 + orrs r0, r2 + orrs r0, r3 + strb r0, [r1] +_08154266: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8154228 + + thumb_func_start objid_set_invisible +objid_set_invisible: @ 8154278 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + bx lr + .pool + thumb_func_end objid_set_invisible + + thumb_func_start sub_8154298 +sub_8154298: @ 8154298 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r2, 16 + lsrs r7, r2, 16 + lsls r3, 16 + lsrs r6, r3, 16 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r1, =0x02020630 + adds r2, r0, r1 + adds r0, r2, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _081542E2 + movs r0, 0x2E + ldrsh r1, [r2, r0] + lsls r0, r7, 16 + asrs r0, 16 + cmp r1, r0 + bne _081542E2 + movs r0, 0x30 + ldrsh r1, [r2, r0] + lsls r0, r6, 16 + asrs r0, 16 + cmp r1, r0 + beq _0815432E +_081542E2: + lsls r0, r7, 16 + asrs r0, 16 + lsls r1, r6, 16 + asrs r1, 16 + mov r4, sp + adds r4, 0x2 + mov r2, sp + adds r3, r4, 0 + bl sub_8093038 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r1, =0x02020630 + adds r2, r0, r1 + mov r0, sp + ldrh r0, [r0] + adds r0, 0x8 + strh r0, [r2, 0x20] + ldrh r0, [r4] + adds r0, 0x8 + strh r0, [r2, 0x22] + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + strh r7, [r2, 0x2E] + strh r6, [r2, 0x30] + mov r1, r8 + subs r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + adds r0, r2, 0 + bl StartObjectImageAnim +_0815432E: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8154298 + + thumb_func_start oei_shadow +oei_shadow: @ 8154340 + push {r4,r5,lr} + ldr r5, =0x02038c08 + ldrb r0, [r5] + ldrb r1, [r5, 0x4] + ldrb r2, [r5, 0x8] + bl GetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02037350 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x5] + bl GetFieldObjectGraphicsInfo + adds r4, r0, 0 + ldr r2, =gFieldEffectObjectTemplatePointers + ldr r1, =gUnknown_085CDC3E + ldrb r0, [r4, 0xC] + lsls r0, 26 + lsrs r0, 30 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + movs r1, 0 + movs r2, 0 + movs r3, 0x94 + bl AddObjectToBack + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _081543C4 + ldr r0, =0x02020630 + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + ldr r0, [r5] + strh r0, [r2, 0x2E] + ldr r0, [r5, 0x4] + strh r0, [r2, 0x30] + ldr r0, [r5, 0x8] + strh r0, [r2, 0x32] + ldrh r1, [r4, 0xA] + lsls r1, 16 + asrs r1, 17 + ldr r3, =gUnknown_085CDC42 + ldrb r0, [r4, 0xC] + lsls r0, 26 + lsrs r0, 30 + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + subs r1, r0 + strh r1, [r2, 0x34] +_081543C4: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end oei_shadow + + thumb_func_start oamc_shadow +oamc_shadow: @ 81543E4 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + ldrh r0, [r5, 0x2E] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x30] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r5, 0x32] + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + beq _08154412 + adds r0, r5, 0 + movs r1, 0x3 + bl FieldEffectStop + b _08154498 +_08154412: + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + ldrb r0, [r4, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + ldrb r0, [r1, 0x5] + movs r2, 0xC + ands r2, r0 + ldrb r3, [r5, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r5, 0x5] + ldrh r0, [r1, 0x20] + strh r0, [r5, 0x20] + ldrh r0, [r5, 0x34] + ldrh r1, [r1, 0x22] + adds r0, r1 + strh r0, [r5, 0x22] + ldr r0, [r4] + ldr r1, =0x00400001 + ands r0, r1 + cmp r0, r1 + bne _08154490 + ldrb r0, [r4, 0x1E] + bl sub_8088E64 + lsls r0, 24 + cmp r0, 0 + bne _08154490 + ldrb r0, [r4, 0x1E] + bl MetatileBehavior_IsSurfableWaterOrUnderwater + lsls r0, 24 + cmp r0, 0 + bne _08154490 + ldrb r0, [r4, 0x1F] + bl MetatileBehavior_IsSurfableWaterOrUnderwater + lsls r0, 24 + cmp r0, 0 + bne _08154490 + ldrb r0, [r4, 0x1E] + bl MetatileBehavior_IsReflective + lsls r0, 24 + cmp r0, 0 + bne _08154490 + ldrb r0, [r4, 0x1F] + bl MetatileBehavior_IsReflective + lsls r0, 24 + cmp r0, 0 + beq _08154498 +_08154490: + adds r0, r5, 0 + movs r1, 0x3 + bl FieldEffectStop +_08154498: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end oamc_shadow + + thumb_func_start oei_grass_normal +oei_grass_normal: @ 81544AC + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, =0x02038c08 + ldrh r1, [r5] + mov r0, sp + strh r1, [r0] + ldrh r0, [r5, 0x4] + mov r4, sp + adds r4, 0x2 + strh r0, [r4] + mov r0, sp + adds r1, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x10] + mov r1, sp + movs r2, 0 + ldrsh r1, [r1, r2] + movs r3, 0 + ldrsh r2, [r4, r3] + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _08154538 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r3, r0, r1 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x3 + ldrb r1, [r5, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x5] + ldr r0, [r5, 0x8] + strh r0, [r3, 0x2E] + ldr r0, [r5] + strh r0, [r3, 0x30] + ldr r0, [r5, 0x4] + strh r0, [r3, 0x32] + ldr r0, [r5, 0x10] + strh r0, [r3, 0x34] + ldr r0, [r5, 0x14] + strh r0, [r3, 0x36] + ldr r0, [r5, 0x18] + strh r0, [r3, 0x38] + ldr r0, [r5, 0x1C] + cmp r0, 0 + beq _08154538 + adds r0, r3, 0 + movs r1, 0x4 + bl SeekObjectImageAnim +_08154538: + movs r0, 0 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end oei_grass_normal + + thumb_func_start unc_grass_normal +unc_grass_normal: @ 8154550 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r5, r0, 0 + ldrh r0, [r5, 0x38] + lsrs r4, r0, 8 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r3, =0x02037334 + ldrb r1, [r3] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0815459C + ldr r0, =0x03005d8c + ldr r2, [r0] + movs r0, 0x5 + ldrsb r0, [r2, r0] + cmp r0, r4 + bne _08154582 + movs r0, 0x4 + ldrsb r0, [r2, r0] + cmp r0, r7 + beq _0815459C +_08154582: + ldr r1, [r3, 0x4] + ldrh r0, [r5, 0x30] + subs r0, r1 + strh r0, [r5, 0x30] + ldr r1, [r3, 0x8] + ldrh r0, [r5, 0x32] + subs r0, r1 + strh r0, [r5, 0x32] + ldrb r1, [r2, 0x5] + lsls r1, 8 + ldrb r0, [r2, 0x4] + orrs r0, r1 + strh r0, [r5, 0x38] +_0815459C: + ldrh r0, [r5, 0x34] + lsrs r1, r0, 8 + mov r8, r1 + lsls r0, 24 + lsrs r4, r0, 24 + ldrh r0, [r5, 0x36] + lsls r0, 24 + lsrs r7, r0, 24 + movs r2, 0x30 + ldrsh r0, [r5, r2] + movs r2, 0x32 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r6, r0, 24 + mov r0, r8 + adds r1, r4, 0 + adds r2, r7, 0 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _081545F0 + adds r0, r6, 0 + bl MetatileBehavior_IsTallGrass + lsls r0, 24 + cmp r0, 0 + beq _081545F0 + movs r1, 0x3C + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08154604 + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08154604 +_081545F0: + adds r0, r5, 0 + movs r1, 0x4 + bl FieldEffectStop + b _08154648 + .pool +_08154604: + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r2, r0, r1 + ldr r0, [r2, 0x10] + ldr r1, [r5, 0x30] + cmp r0, r1 + beq _08154624 + ldr r0, [r2, 0x14] + cmp r0, r1 + beq _08154624 + movs r0, 0x1 + strh r0, [r5, 0x3C] +_08154624: + movs r6, 0 + adds r0, r5, 0 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0 + bne _08154632 + movs r6, 0x4 +_08154632: + adds r0, r5, 0 + movs r1, 0 + bl sub_80979D4 + ldrh r1, [r5, 0x2E] + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + adds r2, r6, 0 + bl sub_81561FC +_08154648: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end unc_grass_normal + + thumb_func_start sub_8154658 +sub_8154658: @ 8154658 + push {r4,lr} + ldr r4, =0x02038c08 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0xC + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x28] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _081546B4 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x02020630 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r4, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, [r4, 0x8] + strh r0, [r2, 0x2E] + movs r0, 0xC + strh r0, [r2, 0x30] +_081546B4: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8154658 + + thumb_func_start sub_81546C8 +sub_81546C8: @ 81546C8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + movs r5, 0 + ldr r0, =0x02020630 + mov r8, r0 + lsls r3, 16 + asrs r3, 16 + lsls r4, 16 + asrs r4, 16 +_081546EC: + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + mov r1, r8 + adds r2, r0, r1 + adds r0, r2, 0 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + beq _08154740 + ldr r1, [r2, 0x1C] + ldr r0, =unc_grass_normal + cmp r1, r0 + bne _08154740 + movs r1, 0x30 + ldrsh r0, [r2, r1] + cmp r3, r0 + bne _08154740 + movs r1, 0x32 + ldrsh r0, [r2, r1] + cmp r4, r0 + bne _08154740 + ldrh r1, [r2, 0x34] + lsrs r0, r1, 8 + cmp r12, r0 + bne _08154740 + movs r0, 0xFF + ands r0, r1 + cmp r7, r0 + bne _08154740 + movs r1, 0x36 + ldrsh r0, [r2, r1] + cmp r6, r0 + bne _08154740 + adds r0, r5, 0 + b _0815474C + .pool +_08154740: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3F + bls _081546EC + movs r0, 0x40 +_0815474C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81546C8 + + thumb_func_start sub_8154758 +sub_8154758: @ 8154758 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, =0x02038c08 + ldrh r1, [r5] + mov r0, sp + strh r1, [r0] + ldrh r0, [r5, 0x4] + mov r4, sp + adds r4, 0x2 + strh r0, [r4] + mov r0, sp + adds r1, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x3C] + mov r1, sp + movs r2, 0 + ldrsh r1, [r1, r2] + movs r3, 0 + ldrsh r2, [r4, r3] + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _081547E8 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r4, r0, r1 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r5, 0x8] + bl ZCoordToPriority + movs r1, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x5] + ldr r0, [r5, 0x8] + strh r0, [r4, 0x2E] + ldr r0, [r5] + strh r0, [r4, 0x30] + ldr r0, [r5, 0x4] + strh r0, [r4, 0x32] + ldr r0, [r5, 0x10] + strh r0, [r4, 0x34] + ldr r0, [r5, 0x14] + strh r0, [r4, 0x36] + ldr r0, [r5, 0x18] + strh r0, [r4, 0x38] + ldr r0, [r5, 0x1C] + cmp r0, 0 + beq _081547E8 + adds r0, r4, 0 + movs r1, 0x6 + bl SeekObjectImageAnim +_081547E8: + movs r0, 0 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8154758 + + thumb_func_start unc_grass_tall +unc_grass_tall: @ 8154800 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r5, r0, 0 + ldrh r0, [r5, 0x38] + lsrs r7, r0, 8 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r3, =0x02037334 + ldrb r1, [r3] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0815484C + ldr r0, =0x03005d8c + ldr r2, [r0] + movs r0, 0x5 + ldrsb r0, [r2, r0] + cmp r0, r7 + bne _08154832 + movs r0, 0x4 + ldrsb r0, [r2, r0] + cmp r0, r6 + beq _0815484C +_08154832: + ldr r1, [r3, 0x4] + ldrh r0, [r5, 0x30] + subs r0, r1 + strh r0, [r5, 0x30] + ldr r1, [r3, 0x8] + ldrh r0, [r5, 0x32] + subs r0, r1 + strh r0, [r5, 0x32] + ldrb r1, [r2, 0x5] + lsls r1, 8 + ldrb r0, [r2, 0x4] + orrs r0, r1 + strh r0, [r5, 0x38] +_0815484C: + ldrh r0, [r5, 0x34] + lsrs r1, r0, 8 + mov r8, r1 + lsls r0, 24 + lsrs r7, r0, 24 + ldrh r0, [r5, 0x36] + lsls r0, 24 + lsrs r6, r0, 24 + movs r2, 0x30 + ldrsh r0, [r5, r2] + movs r2, 0x32 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r4, r0, 24 + mov r0, r8 + adds r1, r7, 0 + adds r2, r6, 0 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _081548A0 + adds r0, r4, 0 + bl MetatileBehavior_IsLongGrass + lsls r0, 24 + cmp r0, 0 + beq _081548A0 + movs r1, 0x3C + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _081548B4 + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081548B4 +_081548A0: + adds r0, r5, 0 + movs r1, 0x11 + bl FieldEffectStop + b _081548EA + .pool +_081548B4: + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r2, r0, r1 + ldr r0, [r2, 0x10] + ldr r1, [r5, 0x30] + cmp r0, r1 + beq _081548D4 + ldr r0, [r2, 0x14] + cmp r0, r1 + beq _081548D4 + movs r0, 0x1 + strh r0, [r5, 0x3C] +_081548D4: + adds r0, r5, 0 + movs r1, 0 + bl sub_80979D4 + ldrh r1, [r5, 0x2E] + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + movs r2, 0 + bl sub_81561FC +_081548EA: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end unc_grass_tall + + thumb_func_start sub_81548FC +sub_81548FC: @ 81548FC + push {r4,lr} + ldr r4, =0x02038c08 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x40] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08154958 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x02020630 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r4, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, [r4, 0x8] + strh r0, [r2, 0x2E] + movs r0, 0x12 + strh r0, [r2, 0x30] +_08154958: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81548FC + + thumb_func_start sub_815496C +sub_815496C: @ 815496C + push {r4-r6,lr} + ldr r6, =0x02038c08 + ldrb r0, [r6] + ldrb r1, [r6, 0x4] + ldrb r2, [r6, 0x8] + bl GetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02037350 + adds r5, r1, r0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x78] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _081549F8 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r4, =0x02020630 + adds r2, r4 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x5] + movs r1, 0xC + ands r1, r0 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, [r6] + strh r0, [r2, 0x2E] + ldr r0, [r6, 0x4] + strh r0, [r2, 0x30] + ldr r0, [r6, 0x8] + strh r0, [r2, 0x32] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x20] + strh r0, [r2, 0x34] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x22] + strh r0, [r2, 0x36] +_081549F8: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_815496C + + thumb_func_start sub_8154A10 +sub_8154A10: @ 8154A10 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r4, 0x32] + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _08154A4E + ldr r5, =0x02037350 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r5 + ldrb r0, [r1, 0x2] + lsls r0, 29 + cmp r0, 0 + blt _08154A5C +_08154A4E: + adds r0, r4, 0 + movs r1, 0x29 + bl FieldEffectStop + b _08154AF2 + .pool +_08154A5C: + ldrb r0, [r1, 0x5] + bl GetFieldObjectGraphicsInfo + mov r8, r0 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r6, r0, r1 + ldrh r5, [r6, 0x22] + ldrh r7, [r6, 0x20] + movs r0, 0x20 + ldrsh r1, [r6, r0] + movs r2, 0x34 + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _08154A98 + lsls r0, r5, 16 + asrs r0, 16 + movs r2, 0x36 + ldrsh r1, [r4, r2] + cmp r0, r1 + beq _08154AB2 +_08154A98: + strh r7, [r4, 0x34] + strh r5, [r4, 0x36] + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08154AB2 + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnim +_08154AB2: + strh r7, [r4, 0x20] + strh r5, [r4, 0x22] + mov r1, r8 + ldrh r0, [r1, 0xA] + lsls r0, 16 + asrs r0, 17 + subs r0, 0x8 + strh r0, [r4, 0x26] + adds r0, r6, 0 + adds r0, 0x43 + ldrb r0, [r0] + subs r0, 0x1 + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + ldrb r0, [r6, 0x5] + movs r1, 0xC + ands r1, r0 + ldrb r2, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x5] + adds r0, r6, 0 + adds r0, 0x3E + ldrb r1, [r0] + lsls r1, 29 + lsrs r1, 31 + adds r0, r4, 0 + bl sub_80979D4 +_08154AF2: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8154A10 + + thumb_func_start sub_8154B04 +sub_8154B04: @ 8154B04 + push {r4,lr} + ldr r4, =0x02038c08 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x2C] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl AddObjectToBack + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _08154B62 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r3] + movs r1, 0x3 + ldrb r2, [r4, 0xC] + ands r2, r1 + lsls r2, 2 + ldrb r3, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0, 0x5] + movs r1, 0xD + strh r1, [r0, 0x3C] + ldrb r1, [r4, 0x10] + bl StartObjectImageAnim +_08154B62: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8154B04 + + thumb_func_start sub_8154B78 +sub_8154B78: @ 8154B78 + push {r4,r5,lr} + ldr r4, =0x02038c08 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x5C] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl AddObjectToBack + lsls r0, 24 + lsrs r1, r0, 24 + adds r5, r1, 0 + cmp r1, 0x40 + beq _08154BD8 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r3] + movs r1, 0x3 + ldrb r2, [r4, 0xC] + ands r2, r1 + lsls r2, 2 + ldrb r3, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0, 0x5] + movs r1, 0x18 + strh r1, [r0, 0x3C] + ldrb r1, [r4, 0x10] + bl StartObjectImageAnim +_08154BD8: + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8154B78 + + thumb_func_start sub_8154BEC +sub_8154BEC: @ 8154BEC + push {r4,r5,lr} + ldr r4, =0x02038c08 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x6C] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl AddObjectToBack + lsls r0, 24 + lsrs r1, r0, 24 + adds r5, r1, 0 + cmp r1, 0x40 + beq _08154C4C + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r3] + movs r1, 0x3 + ldrb r2, [r4, 0xC] + ands r2, r1 + lsls r2, 2 + ldrb r3, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0, 0x5] + movs r1, 0x23 + strh r1, [r0, 0x3C] + ldrb r1, [r4, 0x10] + bl StartObjectImageAnim +_08154C4C: + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8154BEC + + thumb_func_start sub_8154C60 +sub_8154C60: @ 8154C60 + push {lr} + ldr r2, =gUnknown_085CDC4C + movs r3, 0x2E + ldrsh r1, [r0, r3] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8154C60 + + thumb_func_start sub_8154C7C +sub_8154C7C: @ 8154C7C + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x30] + adds r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x28 + ble _08154C92 + movs r0, 0x1 + strh r0, [r1, 0x2E] +_08154C92: + adds r0, r1, 0 + movs r1, 0 + bl sub_80979D4 + pop {r0} + bx r0 + thumb_func_end sub_8154C7C + + thumb_func_start sub_8154CA0 +sub_8154CA0: @ 8154CA0 + push {r4,lr} + adds r4, r0, 0 + 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] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + ldrb r1, [r3] + lsls r1, 29 + lsrs r1, 31 + adds r0, r4, 0 + bl sub_80979D4 + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x38 + ble _08154CE4 + ldrh r1, [r4, 0x3C] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldEffectStop +_08154CE4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8154CA0 + + thumb_func_start sub_8154CEC +sub_8154CEC: @ 8154CEC + push {r4-r6,lr} + ldr r6, =0x02038c08 + ldrb r0, [r6] + ldrb r1, [r6, 0x4] + ldrb r2, [r6, 0x8] + bl GetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02037350 + adds r5, r1, r0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x34] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x40 + beq _08154D76 + ldrb r0, [r5, 0x5] + bl GetFieldObjectGraphicsInfo + lsls r3, r4, 4 + adds r3, r4 + lsls r3, 2 + ldr r4, =0x02020630 + adds r3, r4 + movs r1, 0x3E + adds r1, r3 + mov r12, r1 + ldrb r1, [r1] + movs r2, 0x2 + orrs r1, r2 + mov r2, r12 + strb r1, [r2] + ldrb r2, [r5, 0x4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrb r1, [r1, 0x5] + movs r2, 0xC + ands r2, r1 + ldrb r4, [r3, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r4 + orrs r1, r2 + strb r1, [r3, 0x5] + ldr r1, [r6] + strh r1, [r3, 0x2E] + ldr r1, [r6, 0x4] + strh r1, [r3, 0x30] + ldr r1, [r6, 0x8] + strh r1, [r3, 0x32] + ldrh r0, [r0, 0xA] + lsls r0, 16 + asrs r0, 17 + subs r0, 0x4 + strh r0, [r3, 0x26] + movs r0, 0x46 + bl audio_play +_08154D76: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8154CEC + + thumb_func_start sub_8154D90 +sub_8154D90: @ 8154D90 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08154DC0 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r4, 0x32] + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + beq _08154DCA +_08154DC0: + adds r0, r4, 0 + movs r1, 0xF + bl FieldEffectStop + b _08154E0A +_08154DCA: + ldr r3, =0x02020630 + ldr r2, =0x02037350 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x20] + strh r0, [r4, 0x20] + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x22] + strh r0, [r4, 0x22] + adds r0, r4, 0 + movs r1, 0 + bl sub_80979D4 +_08154E0A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8154D90 + + thumb_func_start sub_8154E1C +sub_8154E1C: @ 8154E1C + push {r4,lr} + ldr r4, =0x02038c08 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0xC + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x38] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08154E78 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x02020630 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r4, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, [r4, 0x8] + strh r0, [r2, 0x2E] + movs r0, 0x10 + strh r0, [r2, 0x30] +_08154E78: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8154E1C + + thumb_func_start oei_water_drop_tall +oei_water_drop_tall: @ 8154E8C + push {r4,lr} + ldr r4, =0x02038c08 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x30] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08154EE8 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x02020630 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r4, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, [r4, 0x8] + strh r0, [r2, 0x2E] + movs r0, 0xE + strh r0, [r2, 0x30] +_08154EE8: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end oei_water_drop_tall + + thumb_func_start sub_8154EFC +sub_8154EFC: @ 8154EFC + push {r4-r7,lr} + ldr r7, =0x02038c08 + ldrb r0, [r7] + ldrb r1, [r7, 0x4] + ldrb r2, [r7, 0x8] + bl GetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02037350 + adds r6, r1, r0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x34] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x40 + beq _08154F92 + ldrb r0, [r6, 0x5] + bl GetFieldObjectGraphicsInfo + adds r4, r0, 0 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r3, =0x02020630 + adds r0, r3 + ldr r1, =sub_8154FB4 + str r1, [r0, 0x1C] + adds r5, r0, 0 + adds r5, 0x3E + ldrb r1, [r5] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r5] + ldrb r2, [r6, 0x4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r3 + ldrb r1, [r1, 0x5] + movs r2, 0xC + ands r2, r1 + ldrb r3, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0, 0x5] + ldr r1, [r7] + strh r1, [r0, 0x2E] + ldr r1, [r7, 0x4] + strh r1, [r0, 0x30] + ldr r1, [r7, 0x8] + strh r1, [r0, 0x32] + ldr r1, =0x0000ffff + strh r1, [r0, 0x34] + movs r1, 0x1 + negs r1, r1 + strh r1, [r0, 0x36] + ldrh r1, [r4, 0xA] + lsls r1, 16 + asrs r1, 17 + subs r1, 0x4 + strh r1, [r0, 0x26] + movs r1, 0x1 + bl StartObjectImageAnim +_08154F92: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8154EFC + + thumb_func_start sub_8154FB4 +sub_8154FB4: @ 8154FB4 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r4, 0x32] + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _08154FEE + ldr r2, =0x02037350 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r5, r0, r2 + ldrb r0, [r5, 0x2] + lsls r0, 28 + cmp r0, 0 + blt _08154FFC +_08154FEE: + adds r0, r4, 0 + movs r1, 0x22 + bl FieldEffectStop + b _08155046 + .pool +_08154FFC: + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + ldrh r1, [r0, 0x20] + strh r1, [r4, 0x20] + ldrh r1, [r0, 0x22] + strh r1, [r4, 0x22] + adds r0, 0x43 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0 + bl sub_80979D4 + ldr r1, [r5, 0x10] + ldr r0, [r4, 0x34] + cmp r1, r0 + beq _08155046 + ldrh r0, [r5, 0x10] + strh r0, [r4, 0x34] + ldrh r0, [r5, 0x12] + strh r0, [r4, 0x36] + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _08155046 + movs r0, 0x46 + bl audio_play +_08155046: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8154FB4 + + thumb_func_start oei_ripples +oei_ripples: @ 8155054 + push {r4,lr} + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x14] + ldr r4, =0x02038c08 + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _081550A0 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x02020630 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r4, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + movs r0, 0x5 + strh r0, [r2, 0x2E] +_081550A0: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end oei_ripples + + thumb_func_start sub_81550B4 +sub_81550B4: @ 81550B4 + push {r4-r6,lr} + ldr r6, =0x02038c08 + ldrb r0, [r6] + ldrb r1, [r6, 0x4] + ldrb r2, [r6, 0x8] + bl GetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02037350 + adds r5, r1, r0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x7C] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08155140 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r4, =0x02020630 + adds r2, r4 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x5] + movs r1, 0xC + ands r1, r0 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, [r6] + strh r0, [r2, 0x2E] + ldr r0, [r6, 0x4] + strh r0, [r2, 0x30] + ldr r0, [r6, 0x8] + strh r0, [r2, 0x32] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x20] + strh r0, [r2, 0x34] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x22] + strh r0, [r2, 0x36] +_08155140: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81550B4 + + thumb_func_start sub_8155158 +sub_8155158: @ 8155158 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r4, 0x32] + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _08155192 + ldr r5, =0x02037350 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r5 + ldrb r0, [r1, 0x2] + lsls r0, 26 + cmp r0, 0 + blt _081551A0 +_08155192: + adds r0, r4, 0 + movs r1, 0x2A + bl FieldEffectStop + b _081551E4 + .pool +_081551A0: + ldrb r0, [r1, 0x5] + bl GetFieldObjectGraphicsInfo + mov r1, sp + ldrb r2, [r1] + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r1, r5 + ldrb r2, [r1, 0x4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + ldr r2, =0x02020630 + adds r1, r2 + ldrh r2, [r1, 0x20] + strh r2, [r4, 0x20] + ldrh r0, [r0, 0xA] + lsls r0, 16 + asrs r0, 17 + ldrh r2, [r1, 0x22] + adds r0, r2 + subs r0, 0x8 + strh r0, [r4, 0x22] + adds r1, 0x43 + ldrb r0, [r1] + subs r0, 0x1 + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0 + bl sub_80979D4 +_081551E4: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8155158 + + thumb_func_start sub_81551F0 +sub_81551F0: @ 81551F0 + push {r4,lr} + ldr r4, =0x02038c08 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x44] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08155248 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x02020630 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r4, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + movs r0, 0x13 + strh r0, [r2, 0x2E] +_08155248: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81551F0 + + thumb_func_start sub_815525C +sub_815525C: @ 815525C + push {r4,lr} + ldr r4, =0x02038c08 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x48] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _081552B4 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x02020630 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r4, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + movs r0, 0x14 + strh r0, [r2, 0x2E] +_081552B4: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_815525C + + thumb_func_start sub_81552C8 +sub_81552C8: @ 81552C8 + push {r4,lr} + ldr r4, =0x02038c08 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x4C] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08155320 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x02020630 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r4, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + movs r0, 0x15 + strh r0, [r2, 0x2E] +_08155320: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81552C8 + + thumb_func_start sub_8155334 +sub_8155334: @ 8155334 + push {r4,lr} + ldr r4, =0x02038c08 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x50] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _0815538C + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x02020630 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r4, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + movs r0, 0x16 + strh r0, [r2, 0x2E] +_0815538C: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8155334 + + thumb_func_start ash +ash: @ 81553A0 + push {r4,lr} + lsls r2, 16 + lsrs r2, 16 + ldr r4, =0x02038c08 + lsls r0, 16 + asrs r0, 16 + str r0, [r4] + lsls r1, 16 + asrs r1, 16 + str r1, [r4, 0x4] + movs r0, 0x52 + str r0, [r4, 0x8] + movs r0, 0x1 + str r0, [r4, 0xC] + str r2, [r4, 0x10] + lsls r3, 16 + asrs r3, 16 + str r3, [r4, 0x14] + movs r0, 0x7 + bl FieldEffectStart + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ash + + thumb_func_start oei_ash +oei_ash: @ 81553D4 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, =0x02038c08 + ldrh r1, [r5] + mov r0, sp + strh r1, [r0] + ldrh r0, [r5, 0x4] + mov r4, sp + adds r4, 0x2 + strh r0, [r4] + mov r0, sp + adds r1, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x18] + mov r1, sp + movs r2, 0 + ldrsh r1, [r1, r2] + movs r3, 0 + ldrsh r2, [r4, r3] + ldrb r3, [r5, 0x8] + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _0815544A + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x02020630 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r5, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, [r5] + strh r0, [r2, 0x30] + ldr r0, [r5, 0x4] + strh r0, [r2, 0x32] + ldr r0, [r5, 0x10] + strh r0, [r2, 0x34] + ldr r0, [r5, 0x14] + strh r0, [r2, 0x36] +_0815544A: + movs r0, 0 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end oei_ash + + thumb_func_start sub_8155460 +sub_8155460: @ 8155460 + push {lr} + ldr r2, =gUnknown_085CDC54 + movs r3, 0x2E + ldrsh r1, [r0, r3] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8155460 + + thumb_func_start sub_815547C +sub_815547C: @ 815547C + push {lr} + adds r3, r0, 0 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + subs r2, 0x12 + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r3, 0x36] + subs r0, 0x1 + strh r0, [r3, 0x36] + lsls r0, 16 + cmp r0, 0 + bne _081554A6 + movs r0, 0x1 + strh r0, [r3, 0x2E] +_081554A6: + pop {r0} + bx r0 + thumb_func_end sub_815547C + + thumb_func_start sub_81554AC +sub_81554AC: @ 81554AC + push {r4,lr} + adds r4, r0, 0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + subs r2, 0x12 + ldrb r1, [r2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r2, 0x32 + ldrsh r1, [r4, r2] + ldrh r2, [r4, 0x34] + bl MapGridSetMetatileIdAt + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r2, 0x32 + ldrsh r1, [r4, r2] + bl CurrentMapDrawMetatileAt + ldr r2, =0x02037350 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + movs r0, 0x2 + strh r0, [r4, 0x2E] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81554AC + + thumb_func_start sub_815550C +sub_815550C: @ 815550C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + bl sub_80979D4 + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0815552C + adds r0, r4, 0 + movs r1, 0x7 + bl FieldEffectStop +_0815552C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815550C + + thumb_func_start sub_8155534 +sub_8155534: @ 8155534 + push {r4,r5,lr} + ldr r4, =0x02038c08 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x1C] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r3, 0x96 + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + cmp r0, 0x40 + beq _0815558E + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + adds r3, r1, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r3] + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + strb r0, [r1, 0x5] + ldr r0, [r4, 0x8] + strh r0, [r1, 0x32] + ldr r0, =0x0000ffff + strh r0, [r1, 0x34] + movs r0, 0x1 + negs r0, r0 + strh r0, [r1, 0x3A] + strh r0, [r1, 0x3C] +_0815558E: + movs r0, 0x8 + bl FieldEffectActiveListRemove + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8155534 + + thumb_func_start sub_81555AC +sub_81555AC: @ 81555AC + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + ldr r3, =0x02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + ldrh r0, [r2, 0x2E] + movs r3, 0x10 + negs r3, r3 + ands r3, r0 + movs r0, 0xF0 + lsls r0, 20 + ands r0, r1 + lsrs r0, 24 + orrs r0, r3 + strh r0, [r2, 0x2E] + bx lr + .pool + thumb_func_end sub_81555AC + + thumb_func_start sub_81555D8 +sub_81555D8: @ 81555D8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + ldr r3, =0x02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + ldrh r0, [r2, 0x2E] + movs r3, 0xF1 + negs r3, r3 + ands r3, r0 + movs r0, 0xF0 + lsls r0, 20 + ands r0, r1 + lsrs r0, 20 + orrs r3, r0 + strh r3, [r2, 0x2E] + bx lr + .pool + thumb_func_end sub_81555D8 + + thumb_func_start sub_8155604 +sub_8155604: @ 8155604 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + ldr r4, =0x02020630 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r3, r4 + ldrh r0, [r3, 0x2E] + ldr r4, =0xfffff0ff + ands r4, r0 + movs r0, 0xF0 + lsls r0, 20 + ands r0, r1 + lsrs r0, 16 + orrs r4, r0 + strh r4, [r3, 0x2E] + strh r2, [r3, 0x30] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8155604 + + thumb_func_start sub_8155638 +sub_8155638: @ 8155638 + ldrh r1, [r0, 0x2E] + movs r0, 0xF + ands r0, r1 + bx lr + thumb_func_end sub_8155638 + + thumb_func_start sub_8155640 +sub_8155640: @ 8155640 + ldrh r1, [r0, 0x2E] + movs r0, 0xF0 + ands r0, r1 + lsrs r0, 4 + bx lr + thumb_func_end sub_8155640 + + thumb_func_start sub_815564C +sub_815564C: @ 815564C + ldrh r1, [r0, 0x2E] + movs r0, 0xF0 + lsls r0, 4 + ands r0, r1 + lsrs r0, 8 + bx lr + thumb_func_end sub_815564C + + thumb_func_start sub_8155658 +sub_8155658: @ 8155658 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x32 + ldrsh r0, [r6, r1] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + ldrb r0, [r4, 0x4] + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + ldr r0, =0x02020630 + adds r5, r0 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_81556B0 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_81556E8 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_815577C + ldrb r0, [r5, 0x5] + movs r1, 0xC + ands r1, r0 + ldrb r2, [r6, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r6, 0x5] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8155658 + + thumb_func_start sub_81556B0 +sub_81556B0: @ 81556B0 + push {r4,r5,lr} + sub sp, 0xC + adds r5, r0, 0 + adds r4, r1, 0 + ldr r1, =gUnknown_085CDC60 + mov r0, sp + movs r2, 0x9 + bl memcpy + adds r0, r4, 0 + bl sub_8155640 + lsls r0, 24 + cmp r0, 0 + bne _081556DC + ldrb r0, [r5, 0x18] + lsrs r0, 4 + add r0, sp + ldrb r1, [r0] + adds r0, r4, 0 + bl StartObjectImageAnimIfDifferent +_081556DC: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81556B0 + + thumb_func_start sub_81556E8 +sub_81556E8: @ 81556E8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r1, 0 + ldrh r2, [r0, 0x10] + mov r1, sp + strh r2, [r1] + ldrh r1, [r0, 0x12] + mov r0, sp + adds r0, 0x2 + strh r1, [r0] + movs r2, 0x26 + ldrsh r3, [r4, r2] + mov r8, r0 + cmp r3, 0 + bne _08155770 + mov r0, sp + movs r5, 0 + ldrsh r2, [r0, r5] + movs r5, 0x3A + ldrsh r0, [r4, r5] + cmp r2, r0 + bne _08155724 + lsls r0, r1, 16 + asrs r0, 16 + movs r5, 0x3C + ldrsh r1, [r4, r5] + cmp r0, r1 + beq _08155770 +_08155724: + strh r3, [r4, 0x38] + strh r2, [r4, 0x3A] + mov r1, r8 + movs r2, 0 + ldrsh r0, [r1, r2] + strh r0, [r4, 0x3C] + movs r5, 0x1 + mov r7, r8 + mov r6, sp +_08155736: + adds r0, r5, 0 + mov r1, sp + adds r2, r7, 0 + bl MoveCoords + movs r1, 0 + ldrsh r0, [r6, r1] + movs r2, 0 + ldrsh r1, [r7, r2] + bl MapGridGetZCoordAt + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0815575C + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + b _08155770 +_0815575C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldrh r0, [r4, 0x3A] + strh r0, [r6] + ldrh r0, [r4, 0x3C] + mov r1, r8 + strh r0, [r1] + cmp r5, 0x4 + bls _08155736 +_08155770: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81556E8 + + thumb_func_start sub_815577C +sub_815577C: @ 815577C + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r1, 0 + adds r4, r2, 0 + ldr r1, =gUnknown_085CDC6A + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r0, r4, 0 + bl sub_8155638 + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + cmp r2, 0 + beq _081557F6 + ldrh r1, [r4, 0x36] + adds r1, 0x1 + strh r1, [r4, 0x36] + movs r3, 0x38 + ldrsh r0, [r4, r3] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _081557BC + ldrh r0, [r4, 0x34] + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] +_081557BC: + ldrh r1, [r4, 0x36] + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + bne _081557CC + ldrh r0, [r4, 0x34] + negs r0, r0 + strh r0, [r4, 0x34] +_081557CC: + cmp r2, 0x2 + beq _081557F6 + adds r0, r4, 0 + bl sub_815564C + lsls r0, 24 + cmp r0, 0 + bne _081557E4 + ldrh r0, [r4, 0x26] + b _081557EA + .pool +_081557E4: + ldrh r0, [r4, 0x26] + ldrh r3, [r4, 0x30] + adds r0, r3 +_081557EA: + strh r0, [r5, 0x26] + ldrh r0, [r5, 0x20] + strh r0, [r4, 0x20] + ldrh r0, [r5, 0x22] + adds r0, 0x8 + strh r0, [r4, 0x22] +_081557F6: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815577C + + thumb_func_start sub_8155800 +sub_8155800: @ 8155800 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_082EC6AC + movs r1, 0 + movs r2, 0 + movs r3, 0xFF + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r1, =0x02020630 + adds r2, r1 + ldr r1, =sub_8155850 + str r1, [r2, 0x1C] + movs r1, 0x3E + adds r1, r2 + mov r12, r1 + ldrb r1, [r1] + movs r3, 0x4 + orrs r1, r3 + mov r3, r12 + strb r1, [r3] + strh r4, [r2, 0x2E] + movs r1, 0x1 + strh r1, [r2, 0x30] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8155800 + + thumb_func_start sub_8155850 +sub_8155850: @ 8155850 + push {lr} + adds r2, r0, 0 + movs r0, 0x2E + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r3, r0, r1 + ldrh r1, [r2, 0x32] + adds r0, r1, 0x1 + strh r0, [r2, 0x32] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08155878 + ldrh r0, [r2, 0x30] + ldrh r1, [r3, 0x26] + adds r0, r1 + strh r0, [r3, 0x26] +_08155878: + ldrh r1, [r2, 0x32] + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + bne _08155888 + ldrh r0, [r2, 0x30] + negs r0, r0 + strh r0, [r2, 0x30] +_08155888: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8155850 + + thumb_func_start sub_8155890 +sub_8155890: @ 8155890 + push {r4,lr} + ldr r4, =0x02038c08 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0xC + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x24] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _081558EC + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x02020630 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r4, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, [r4, 0x8] + strh r0, [r2, 0x2E] + movs r0, 0xA + strh r0, [r2, 0x30] +_081558EC: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8155890 + + thumb_func_start sub_8155900 +sub_8155900: @ 8155900 + push {r4-r7,lr} + ldr r7, =0x02038c08 + ldrb r0, [r7] + ldrb r1, [r7, 0x4] + ldrb r2, [r7, 0x8] + bl GetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02037350 + adds r6, r1, r0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x74] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x40 + beq _081559A4 + ldrb r0, [r6, 0x5] + bl GetFieldObjectGraphicsInfo + adds r5, r0, 0 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r3] + ldrb r2, [r6, 0x4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrb r1, [r1, 0x5] + movs r2, 0xC + ands r2, r1 + ldrb r3, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0, 0x5] + ldr r1, [r7] + strh r1, [r0, 0x2E] + ldr r1, [r7, 0x4] + strh r1, [r0, 0x30] + ldr r1, [r7, 0x8] + strh r1, [r0, 0x32] + ldrb r2, [r6, 0x4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x20] + strh r1, [r0, 0x34] + ldrb r2, [r6, 0x4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x22] + strh r1, [r0, 0x36] + ldrh r1, [r5, 0xA] + lsls r1, 16 + asrs r1, 17 + subs r1, 0x2 + strh r1, [r0, 0x26] + movs r1, 0x2 + bl SeekObjectImageAnim +_081559A4: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8155900 + + thumb_func_start sub_81559BC +sub_81559BC: @ 81559BC + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r4, 0x32] + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _081559F6 + ldr r2, =0x02037350 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + ldrb r0, [r1, 0x2] + lsls r0, 27 + cmp r0, 0 + blt _08155A04 +_081559F6: + adds r0, r4, 0 + movs r1, 0x27 + bl FieldEffectStop + b _08155A76 + .pool +_08155A04: + ldr r2, =0x02020630 + ldrb r1, [r1, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r5, [r0, 0x22] + ldrh r6, [r0, 0x20] + movs r2, 0x20 + ldrsh r1, [r0, r2] + movs r2, 0x34 + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _08155A2C + lsls r0, r5, 16 + asrs r0, 16 + movs r2, 0x36 + ldrsh r1, [r4, r2] + cmp r0, r1 + beq _08155A46 +_08155A2C: + strh r6, [r4, 0x34] + strh r5, [r4, 0x36] + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08155A46 + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnim +_08155A46: + strh r6, [r4, 0x20] + strh r5, [r4, 0x22] + ldr r3, =0x02020630 + ldr r2, =0x02037350 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x43 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0 + bl sub_80979D4 +_08155A76: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81559BC + + thumb_func_start sub_8155A88 +sub_8155A88: @ 8155A88 + push {r4,lr} + ldr r4, =0x02038c08 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0 + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + adds r0, 0x88 + ldr r0, [r0] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r3, 0x52 + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08155AD8 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + adds r3, r1, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r3] + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1, 0x5] +_08155AD8: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8155A88 + + thumb_func_start sub_8155AEC +sub_8155AEC: @ 8155AEC + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x80 + movs r1, 0x80 + lsls r1, 1 + ands r0, r1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r4, 0x22] + subs r1, r0 + strh r1, [r4, 0x22] + adds r0, r4, 0 + movs r1, 0 + bl sub_80979D4 + ldrh r1, [r4, 0x3E] + ldr r0, =0x00001004 + ands r0, r1 + cmp r0, 0 + beq _08155B20 + adds r0, r4, 0 + movs r1, 0x35 + bl FieldEffectStop +_08155B20: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8155AEC + + thumb_func_start sub_8155B2C +sub_8155B2C: @ 8155B2C + push {r4,lr} + ldr r4, =0x02038c08 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x4 + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x58] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08155B8C + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x02020630 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x3 + ldrb r1, [r4, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r1 + movs r1, 0xF + ands r0, r1 + movs r1, 0x50 + orrs r0, r1 + strb r0, [r2, 0x5] + movs r0, 0x17 + strh r0, [r2, 0x2E] +_08155B8C: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8155B2C + + thumb_func_start ShowTreeDisguiseFieldEffect +@ u8 ShowTreeDisguiseFieldEffect() +ShowTreeDisguiseFieldEffect: @ 8155BA0 + push {lr} + movs r0, 0x1C + movs r1, 0x18 + movs r2, 0x4 + bl ShowDisguiseFieldEffect + pop {r1} + bx r1 + thumb_func_end ShowTreeDisguiseFieldEffect + + thumb_func_start ShowMountainDisguiseFieldEffect +@ u8 ShowMountainDisguiseFieldEffect() +ShowMountainDisguiseFieldEffect: @ 8155BB0 + push {lr} + movs r0, 0x1D + movs r1, 0x19 + movs r2, 0x3 + bl ShowDisguiseFieldEffect + pop {r1} + bx r1 + thumb_func_end ShowMountainDisguiseFieldEffect + + thumb_func_start ShowSandDisguiseFieldEffect +@ u8 ShowSandDisguiseFieldEffect() +ShowSandDisguiseFieldEffect: @ 8155BC0 + push {lr} + movs r0, 0x24 + movs r1, 0x1C + movs r2, 0x2 + bl ShowDisguiseFieldEffect + pop {r1} + bx r1 + thumb_func_end ShowSandDisguiseFieldEffect + + thumb_func_start ShowDisguiseFieldEffect +@ u8 ShowDisguiseFieldEffect(u8 fieldEffectId, u8 fieldEffectObjectId, u8 paletteSlot) +ShowDisguiseFieldEffect: @ 8155BD0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + mov r8, r4 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r7, r2, 24 + ldr r5, =0x02038c08 + ldrb r0, [r5] + ldrb r1, [r5, 0x4] + ldrb r2, [r5, 0x8] + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + beq _08155C08 + adds r0, r4, 0 + bl FieldEffectActiveListRemove + movs r0, 0x40 + b _08155C74 + .pool +_08155C08: + ldr r1, =gFieldEffectObjectTemplatePointers + lsls r0, r6, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AddObjectToBack + mov r1, sp + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08155C70 + mov r0, sp + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x02020630 + adds r2, r0 + movs r0, 0x3E + adds r0, r2 + mov r12, r0 + ldrb r3, [r0] + lsls r1, r3, 30 + lsrs r1, 31 + adds r1, 0x1 + movs r0, 0x1 + ands r1, r0 + lsls r1, 1 + movs r0, 0x3 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + lsls r3, r7, 4 + ldrb r1, [r2, 0x5] + movs r0, 0xF + ands r0, r1 + orrs r0, r3 + strb r0, [r2, 0x5] + mov r0, r8 + strh r0, [r2, 0x30] + ldr r0, [r5] + strh r0, [r2, 0x32] + ldr r0, [r5, 0x4] + strh r0, [r2, 0x34] + ldr r0, [r5, 0x8] + strh r0, [r2, 0x36] +_08155C70: + mov r0, sp + ldrb r0, [r0] +_08155C74: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end ShowDisguiseFieldEffect + + thumb_func_start sub_8155C88 +sub_8155C88: @ 8155C88 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + ldrh r0, [r5, 0x32] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x34] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r5, 0x36] + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + beq _08155CB8 + ldrh r1, [r5, 0x30] + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl FieldEffectStop +_08155CB8: + ldr r4, =0x02037350 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x5] + bl GetFieldObjectGraphicsInfo + mov r1, sp + ldrb r2, [r1] + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrb r1, [r1, 0x4] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + ldr r1, =0x02020630 + adds r2, r1 + adds r1, r2, 0 + adds r1, 0x3E + ldrb r1, [r1] + movs r3, 0x3E + adds r3, r5 + mov r12, r3 + movs r3, 0x4 + ands r3, r1 + mov r1, r12 + ldrb r4, [r1] + movs r1, 0x5 + negs r1, r1 + ands r1, r4 + orrs r1, r3 + mov r3, r12 + strb r1, [r3] + ldrh r1, [r2, 0x20] + strh r1, [r5, 0x20] + ldrh r0, [r0, 0xA] + lsls r0, 16 + asrs r0, 17 + ldrh r1, [r2, 0x22] + adds r0, r1 + subs r0, 0x10 + strh r0, [r5, 0x22] + adds r2, 0x43 + ldrb r0, [r2] + subs r0, 0x1 + adds r1, r5, 0 + adds r1, 0x43 + strb r0, [r1] + ldrh r1, [r5, 0x2E] + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0x1 + bne _08155D38 + adds r0, r1, 0x1 + strh r0, [r5, 0x2E] + adds r0, r5, 0 + movs r1, 0x1 + bl StartObjectImageAnim +_08155D38: + movs r3, 0x2E + ldrsh r0, [r5, r3] + ldrh r2, [r5, 0x2E] + cmp r0, 0x2 + bne _08155D54 + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08155D54 + movs r0, 0x1 + strh r0, [r5, 0x3C] +_08155D54: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _08155D68 + ldrh r1, [r5, 0x30] + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl FieldEffectStop +_08155D68: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8155C88 + + thumb_func_start sub_8155D78 +sub_8155D78: @ 8155D78 + push {lr} + adds r1, r0, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08155D96 + ldr r2, =0x02020630 + ldrb r1, [r1, 0x1A] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x2E] + adds r1, 0x1 + strh r1, [r0, 0x2E] +_08155D96: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8155D78 + + thumb_func_start sub_8155DA0 +sub_8155DA0: @ 8155DA0 + push {lr} + adds r2, r0, 0 + adds r2, 0x21 + ldrb r1, [r2] + cmp r1, 0x2 + beq _08155DD6 + cmp r1, 0 + beq _08155DD6 + ldrb r1, [r0, 0x1A] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r1, r0, r1 + movs r3, 0x3C + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _08155DCC + movs r0, 0 + b _08155DD8 + .pool +_08155DCC: + movs r0, 0x2 + strb r0, [r2] + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] +_08155DD6: + movs r0, 0x1 +_08155DD8: + pop {r1} + bx r1 + thumb_func_end sub_8155DA0 + + thumb_func_start sub_8155DDC +sub_8155DDC: @ 8155DDC + push {r4,lr} + ldr r4, =0x02038c08 + ldr r0, [r4] + adds r0, 0x7 + str r0, [r4] + ldr r0, [r4, 0x4] + adds r0, 0x7 + str r0, [r4, 0x4] + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + adds r0, 0x8C + ldr r0, [r0] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r3, 0x52 + bl AddObjectToBack + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _08155E3C + ldr r0, =0x02020630 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + movs r0, 0x3 + ldrb r2, [r4, 0x8] + 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] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r1] +_08155E3C: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8155DDC + + thumb_func_start sub_8155E50 +sub_8155E50: @ 8155E50 + push {lr} + adds r2, r0, 0 + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0 + bne _08155E84 + adds r0, r2, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08155E7C + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r3] + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] +_08155E7C: + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _08155E9A +_08155E84: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x22 + ble _08155E9A + adds r0, r2, 0 + movs r1, 0x36 + bl FieldEffectStop +_08155E9A: + pop {r0} + bx r0 + thumb_func_end sub_8155E50 + + thumb_func_start sub_8155EA0 +sub_8155EA0: @ 8155EA0 + movs r1, 0 + strh r1, [r0, 0x3A] + strh r1, [r0, 0x3C] + bx lr + thumb_func_end sub_8155EA0 + + thumb_func_start sub_8155EA8 +sub_8155EA8: @ 8155EA8 + push {r4-r6,lr} + adds r5, r0, 0 + movs r6, 0 + movs r1, 0x3C + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _08155EDE + cmp r0, 0x1 + bgt _08155EC0 + cmp r0, 0 + beq _08155ECA + b _08155F42 +_08155EC0: + cmp r0, 0x2 + beq _08155F06 + cmp r0, 0x3 + beq _08155F1A + b _08155F42 +_08155ECA: + movs r2, 0x3A + ldrsh r0, [r5, r2] + bl sub_809773C + ldrh r1, [r5, 0x24] + adds r0, r1 + strh r0, [r5, 0x24] + movs r2, 0x3A + ldrsh r0, [r5, r2] + b _08155F38 +_08155EDE: + ldrh r0, [r5, 0x3A] + movs r4, 0x47 + subs r0, r4, r0 + lsls r0, 16 + asrs r0, 16 + bl sub_809773C + ldrh r1, [r5, 0x24] + subs r1, r0 + strh r1, [r5, 0x24] + ldrh r0, [r5, 0x3A] + subs r4, r0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + bl sub_8097728 + ldrh r2, [r5, 0x26] + adds r0, r2 + b _08155F40 +_08155F06: + movs r1, 0x3A + ldrsh r0, [r5, r1] + bl sub_809773C + ldrh r1, [r5, 0x24] + subs r1, r0 + strh r1, [r5, 0x24] + movs r2, 0x3A + ldrsh r0, [r5, r2] + b _08155F38 +_08155F1A: + ldrh r0, [r5, 0x3A] + movs r4, 0x47 + subs r0, r4, r0 + lsls r0, 16 + asrs r0, 16 + bl sub_809773C + ldrh r2, [r5, 0x24] + adds r0, r2 + strh r0, [r5, 0x24] + ldrh r0, [r5, 0x3A] + subs r4, r0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 +_08155F38: + bl sub_8097728 + ldrh r1, [r5, 0x26] + adds r0, r1 +_08155F40: + strh r0, [r5, 0x26] +_08155F42: + ldrh r1, [r5, 0x24] + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x10 + bl SetGpuReg + ldrh r0, [r5, 0x3A] + adds r0, 0x1 + movs r1, 0 + strh r0, [r5, 0x3A] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x48 + bne _08155F68 + strh r1, [r5, 0x3A] + ldrh r0, [r5, 0x3C] + adds r0, 0x1 + strh r0, [r5, 0x3C] +_08155F68: + movs r2, 0x3C + ldrsh r0, [r5, r2] + cmp r0, 0x4 + bne _08155F76 + strh r1, [r5, 0x26] + strh r1, [r5, 0x24] + movs r6, 0x1 +_08155F76: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8155EA8 + + thumb_func_start sub_8155F80 +sub_8155F80: @ 8155F80 + push {r4-r7,lr} + adds r5, r0, 0 + movs r1, 0x32 + ldrsh r0, [r5, r1] + cmp r0, 0x8 + bls _08155F8E + b _08156156 +_08155F8E: + lsls r0, 2 + ldr r1, =_08155F9C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08155F9C: + .4byte _08155FC0 + .4byte _08156034 + .4byte _0815606C + .4byte _08156090 + .4byte _081560C0 + .4byte _081560D4 + .4byte _081560E0 + .4byte _0815610E + .4byte _08156120 +_08155FC0: + movs r2, 0x2E + ldrsh r0, [r5, r2] + movs r1, 0x3 + bl __divsi3 + movs r1, 0x78 + subs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x12 + bl SetGpuReg + movs r3, 0x2E + ldrsh r0, [r5, r3] + cmp r0, 0x60 + bne _08156016 + movs r1, 0 + ldr r4, =0x0600f800 + mov r12, r4 + ldr r0, =0x0000bff4 + adds r7, r0, 0 +_08155FEA: + movs r2, 0xC + lsls r0, r1, 1 + adds r3, r1, 0x1 + lsls r6, r1, 5 + adds r0, r1 + lsls r4, r0, 1 +_08155FF6: + adds r0, r6, r2 + lsls r0, 1 + add r0, r12 + adds r1, r2, r7 + adds r1, r4, r1 + adds r1, 0x1 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x11 + bls _08155FF6 + lsls r0, r3, 24 + lsrs r1, r0, 24 + cmp r1, 0x2 + bls _08155FEA +_08156016: + movs r2, 0x2E + ldrsh r1, [r5, r2] + ldr r0, =0x00000137 + cmp r1, r0 + bgt _08156022 + b _08156156 +_08156022: + movs r1, 0 + movs r0, 0x1 + b _0815611A + .pool +_08156034: + ldr r4, =gUnknown_08329F40 + movs r3, 0x2E + ldrsh r0, [r5, r3] + movs r1, 0x3 + bl __divsi3 + lsls r0, 16 + asrs r0, 15 + adds r0, r4 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 18 + ldrh r4, [r5, 0x36] + adds r0, r4 + movs r1, 0 + strh r0, [r5, 0x22] + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0xBD + bne _08156156 + movs r0, 0x2 + strh r0, [r5, 0x32] + strh r1, [r5, 0x38] + strh r1, [r5, 0x2E] + b _08156156 + .pool +_0815606C: + movs r3, 0x2E + ldrsh r0, [r5, r3] + cmp r0, 0x3C + bne _0815607E + ldrh r0, [r5, 0x38] + adds r0, 0x1 + movs r1, 0 + strh r0, [r5, 0x38] + strh r1, [r5, 0x2E] +_0815607E: + movs r4, 0x38 + ldrsh r0, [r5, r4] + cmp r0, 0x7 + bne _08156156 + movs r0, 0 + strh r0, [r5, 0x38] + movs r0, 0x3 + strh r0, [r5, 0x32] + b _08156156 +_08156090: + ldrh r2, [r5, 0x26] + movs r0, 0x26 + ldrsh r1, [r5, r0] + adds r3, r2, 0 + cmp r1, 0 + bne _081560A4 + strh r1, [r5, 0x2E] + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] +_081560A4: + movs r4, 0x2E + ldrsh r0, [r5, r4] + cmp r0, 0x5 + bne _08156156 + movs r0, 0 + strh r0, [r5, 0x2E] + cmp r1, 0 + ble _081560BA + subs r0, r3, 0x1 + strh r0, [r5, 0x26] + b _08156156 +_081560BA: + adds r0, r2, 0x1 + strh r0, [r5, 0x26] + b _08156156 +_081560C0: + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x3C + bne _08156156 + movs r1, 0 + movs r0, 0x5 + strh r0, [r5, 0x32] + strh r1, [r5, 0x2E] + strh r1, [r5, 0x38] + b _08156156 +_081560D4: + adds r0, r5, 0 + bl sub_8155EA0 + movs r1, 0 + movs r0, 0x6 + b _0815611A +_081560E0: + adds r0, r5, 0 + bl sub_8155EA8 + lsls r0, 24 + cmp r0, 0 + beq _08156156 + movs r1, 0 + strh r1, [r5, 0x2E] + ldrh r0, [r5, 0x38] + adds r0, 0x1 + strh r0, [r5, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bgt _08156106 + adds r0, r5, 0 + bl sub_8155EA0 + b _08156156 +_08156106: + strh r1, [r5, 0x38] + movs r0, 0x7 + strh r0, [r5, 0x32] + b _08156156 +_0815610E: + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0x1E + bne _08156156 + movs r1, 0 + movs r0, 0x8 +_0815611A: + strh r0, [r5, 0x32] + strh r1, [r5, 0x2E] + b _08156156 +_08156120: + movs r1, 0 + ldr r6, =0x0600f800 + movs r4, 0 +_08156126: + movs r2, 0xC + adds r3, r1, 0x1 + lsls r1, 5 +_0815612C: + adds r0, r1, r2 + lsls r0, 1 + adds r0, r6 + strh r4, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x11 + bls _0815612C + lsls r0, r3, 24 + lsrs r1, r0, 24 + cmp r1, 0xE + bls _08156126 + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + adds r0, r5, 0 + movs r1, 0x40 + bl FieldEffectStop +_08156156: + movs r3, 0x32 + ldrsh r0, [r5, r3] + cmp r0, 0x1 + bne _08156184 + ldrh r1, [r5, 0x30] + movs r0, 0x7 + ands r0, r1 + adds r2, r1, 0 + cmp r0, 0 + bne _08156172 + ldrh r0, [r5, 0x34] + ldrh r4, [r5, 0x26] + adds r0, r4 + strh r0, [r5, 0x26] +_08156172: + movs r0, 0xF + ands r0, r2 + cmp r0, 0 + bne _08156180 + ldrh r0, [r5, 0x34] + negs r0, r0 + strh r0, [r5, 0x34] +_08156180: + adds r0, r1, 0x1 + strh r0, [r5, 0x30] +_08156184: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8155F80 + + thumb_func_start sub_8156194 +sub_8156194: @ 8156194 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081561B2 + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldEffectStop + b _081561C8 +_081561B2: + adds r0, r4, 0 + movs r1, 0 + bl sub_80979D4 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + movs r2, 0 + bl SetObjectSubpriorityByZCoord +_081561C8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8156194 + + thumb_func_start sub_81561D0 +sub_81561D0: @ 81561D0 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081561EE + ldrh r1, [r2, 0x2E] + lsls r1, 24 + lsrs r1, 24 + adds r0, r2, 0 + bl FieldEffectStop + b _081561F6 +_081561EE: + adds r0, r2, 0 + movs r1, 0 + bl sub_80979D4 +_081561F6: + pop {r0} + bx r0 + thumb_func_end sub_81561D0 + + thumb_func_start sub_81561FC +sub_81561FC: @ 81561FC + push {r4-r7,lr} + adds r6, r0, 0 + adds r0, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + adds r1, r6, 0 + bl SetObjectSubpriorityByZCoord + movs r7, 0 +_08156212: + lsls r0, r7, 3 + adds r0, r7 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + ldrb r0, [r4] + lsls r0, 31 + cmp r0, 0 + beq _081562B4 + ldrb r0, [r4, 0x5] + bl GetFieldObjectGraphicsInfo + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r5, r0, r1 + adds r0, r6, 0 + adds r0, 0x28 + movs r2, 0 + ldrsb r2, [r0, r2] + ldrh r0, [r6, 0x20] + adds r1, r0, r2 + subs r0, r2 + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x20 + ldrsh r2, [r5, r0] + cmp r1, r2 + bge _081562B4 + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, r2 + ble _081562B4 + adds r0, r5, 0 + adds r0, 0x29 + movs r3, 0 + ldrsb r3, [r0, r3] + ldrh r2, [r5, 0x22] + adds r2, r3 + ldrh r4, [r5, 0x22] + adds r0, r6, 0 + adds r0, 0x29 + movs r1, 0 + ldrsb r1, [r0, r1] + ldrh r0, [r6, 0x22] + subs r0, r1 + lsls r0, 16 + asrs r0, 16 + adds r3, r0, r3 + lsls r2, 16 + asrs r2, 16 + lsls r3, 16 + asrs r3, 16 + cmp r2, r3 + blt _0815628C + cmp r2, r0 + bge _081562B4 +_0815628C: + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, r3 + ble _081562B4 + adds r2, r6, 0 + adds r2, 0x43 + adds r0, r5, 0 + adds r0, 0x43 + ldrb r1, [r0] + ldrb r0, [r2] + cmp r0, r1 + bhi _081562B4 + adds r0, r1, 0x2 + strb r0, [r2] + b _081562BE + .pool +_081562B4: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0xF + bls _08156212 +_081562BE: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81561FC + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/field_ground_effect.s b/asm/field_ground_effect.s new file mode 100644 index 000000000..a635a90cc --- /dev/null +++ b/asm/field_ground_effect.s @@ -0,0 +1,1929 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start GetAllGroundEffectFlags_OnSpawn +@ void GetAllGroundEffectFlags_OnSpawn(struct npc_state *fieldObject, u32 *flags) +GetAllGroundEffectFlags_OnSpawn: @ 8096638 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl FieldObjectUpdateMetatileBehaviors + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_Reflection + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_TallGrassOnSpawn + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_LongGrassOnSpawn + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_SandHeap + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_ShallowFlowingWater + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_ShortGrass + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_HotSprings + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end GetAllGroundEffectFlags_OnSpawn + + thumb_func_start GetAllGroundEffectFlags_OnBeginStep +@ void GetAllGroundEffectFlags_OnBeginStep(struct npc_state *fieldObject, u32 *flags) +GetAllGroundEffectFlags_OnBeginStep: @ 8096680 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl FieldObjectUpdateMetatileBehaviors + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_Reflection + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_TallGrassOnBeginStep + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_LongGrassOnBeginStep + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_Tracks + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_SandHeap + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_ShallowFlowingWater + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_Puddle + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_ShortGrass + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_HotSprings + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end GetAllGroundEffectFlags_OnBeginStep + + thumb_func_start GetAllGroundEffectFlags_OnFinishStep +@ void GetAllGroundEffectFlags_OnFinishStep(struct npc_state *fieldObject, u32 *flags) +GetAllGroundEffectFlags_OnFinishStep: @ 80966D8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl FieldObjectUpdateMetatileBehaviors + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_ShallowFlowingWater + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_SandHeap + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_Puddle + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_Ripple + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_ShortGrass + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_HotSprings + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_Seaweed + adds r0, r4, 0 + adds r1, r5, 0 + bl GetGroundEffectFlags_JumpLanding + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end GetAllGroundEffectFlags_OnFinishStep + + thumb_func_start FieldObjectUpdateMetatileBehaviors +@ void FieldObjectUpdateMetatileBehaviors(struct npc_state *fieldObject) +FieldObjectUpdateMetatileBehaviors: @ 8096728 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x14 + ldrsh r0, [r4, r1] + movs r2, 0x16 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + strb r0, [r4, 0x1F] + movs r1, 0x10 + ldrsh r0, [r4, r1] + movs r2, 0x12 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + strb r0, [r4, 0x1E] + pop {r4} + pop {r0} + bx r0 + thumb_func_end FieldObjectUpdateMetatileBehaviors + + thumb_func_start GetGroundEffectFlags_Reflection +@ void GetGroundEffectFlags_Reflection(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_Reflection: @ 8096750 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, =gUnknown_0850E5DC + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + adds r0, r4, 0 + bl FieldObjectCheckForReflectiveSurface + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _08096798 + ldrb r1, [r4, 0x2] + lsls r0, r1, 30 + cmp r0, 0 + blt _080967A2 + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4, 0x2] + subs r0, r2, 0x1 + lsls r0, 2 + add r0, sp + ldr r1, [r5] + ldr r0, [r0] + orrs r1, r0 + str r1, [r5] + b _080967A2 + .pool +_08096798: + ldrb r1, [r4, 0x2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x2] +_080967A2: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_Reflection + + thumb_func_start GetGroundEffectFlags_TallGrassOnSpawn +@ void GetGroundEffectFlags_TallGrassOnSpawn(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_TallGrassOnSpawn: @ 80967AC + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r0, 0x1E] + bl MetatileBehavior_IsTallGrass + lsls r0, 24 + cmp r0, 0 + beq _080967C4 + ldr r0, [r4] + movs r1, 0x1 + orrs r0, r1 + str r0, [r4] +_080967C4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_TallGrassOnSpawn + + thumb_func_start GetGroundEffectFlags_TallGrassOnBeginStep +@ void GetGroundEffectFlags_TallGrassOnBeginStep(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_TallGrassOnBeginStep: @ 80967CC + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r0, 0x1E] + bl MetatileBehavior_IsTallGrass + lsls r0, 24 + cmp r0, 0 + beq _080967E4 + ldr r0, [r4] + movs r1, 0x2 + orrs r0, r1 + str r0, [r4] +_080967E4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_TallGrassOnBeginStep + + thumb_func_start GetGroundEffectFlags_LongGrassOnSpawn +@ void GetGroundEffectFlags_LongGrassOnSpawn(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_LongGrassOnSpawn: @ 80967EC + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r0, 0x1E] + bl MetatileBehavior_IsLongGrass + lsls r0, 24 + cmp r0, 0 + beq _08096804 + ldr r0, [r4] + movs r1, 0x4 + orrs r0, r1 + str r0, [r4] +_08096804: + pop {r4} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_LongGrassOnSpawn + + thumb_func_start GetGroundEffectFlags_LongGrassOnBeginStep +@ void GetGroundEffectFlags_LongGrassOnBeginStep(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_LongGrassOnBeginStep: @ 809680C + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r0, 0x1E] + bl MetatileBehavior_IsLongGrass + lsls r0, 24 + cmp r0, 0 + beq _08096824 + ldr r0, [r4] + movs r1, 0x8 + orrs r0, r1 + str r0, [r4] +_08096824: + pop {r4} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_LongGrassOnBeginStep + + thumb_func_start GetGroundEffectFlags_Tracks +@ void GetGroundEffectFlags_Tracks(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_Tracks: @ 809682C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x1F] + bl MetatileBehavior_IsDeepSand + lsls r0, 24 + cmp r0, 0 + beq _08096846 + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 1 + b _08096862 +_08096846: + ldrb r0, [r4, 0x1F] + bl MetatileBehavior_IsSandOrDeepSand + lsls r0, 24 + cmp r0, 0 + bne _0809685E + ldrb r0, [r4, 0x1F] + bl MetatileBehavior_IsUnusedFootprintMetatile + lsls r0, 24 + cmp r0, 0 + beq _08096866 +_0809685E: + ldr r0, [r5] + movs r1, 0x80 +_08096862: + orrs r0, r1 + str r0, [r5] +_08096866: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_Tracks + + thumb_func_start GetGroundEffectFlags_SandHeap +@ void GetGroundEffectFlags_SandHeap(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_SandHeap: @ 809686C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x1E] + bl MetatileBehavior_IsDeepSand + lsls r0, 24 + cmp r0, 0 + beq _080968AA + ldrb r0, [r4, 0x1F] + bl MetatileBehavior_IsDeepSand + lsls r0, 24 + cmp r0, 0 + beq _080968AA + ldrb r1, [r4, 0x2] + lsls r0, r1, 27 + cmp r0, 0 + blt _080968B4 + movs r0, 0x11 + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r4, 0x2] + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 4 + orrs r0, r1 + str r0, [r5] + b _080968B4 +_080968AA: + ldrb r1, [r4, 0x2] + movs r0, 0x11 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x2] +_080968B4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_SandHeap + + thumb_func_start GetGroundEffectFlags_ShallowFlowingWater +@ void GetGroundEffectFlags_ShallowFlowingWater(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_ShallowFlowingWater: @ 80968BC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x1E] + bl MetatileBehavior_IsShallowFlowingWater + lsls r0, 24 + cmp r0, 0 + beq _080968DA + ldrb r0, [r4, 0x1F] + bl MetatileBehavior_IsShallowFlowingWater + lsls r0, 24 + cmp r0, 0 + bne _080968F2 +_080968DA: + ldrb r0, [r4, 0x1E] + bl MetatileBehavior_IsPacifidlogLog + lsls r0, 24 + cmp r0, 0 + beq _08096910 + ldrb r0, [r4, 0x1F] + bl MetatileBehavior_IsPacifidlogLog + lsls r0, 24 + cmp r0, 0 + beq _08096910 +_080968F2: + ldrb r1, [r4, 0x2] + lsls r0, r1, 28 + cmp r0, 0 + blt _0809691A + movs r0, 0x9 + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r4, 0x2] + ldr r0, [r5] + movs r1, 0x40 + orrs r0, r1 + str r0, [r5] + b _0809691A +_08096910: + ldrb r1, [r4, 0x2] + movs r0, 0x9 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x2] +_0809691A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_ShallowFlowingWater + + thumb_func_start GetGroundEffectFlags_Puddle +@ void GetGroundEffectFlags_Puddle(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_Puddle: @ 8096920 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x1E] + bl MetatileBehavior_IsPuddle + lsls r0, 24 + cmp r0, 0 + beq _08096948 + ldrb r0, [r4, 0x1F] + bl MetatileBehavior_IsPuddle + lsls r0, 24 + cmp r0, 0 + beq _08096948 + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 3 + orrs r0, r1 + str r0, [r5] +_08096948: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_Puddle + + thumb_func_start GetGroundEffectFlags_Ripple +@ void GetGroundEffectFlags_Ripple(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_Ripple: @ 8096950 + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r0, 0x1E] + bl MetatileBehavior_HasRipples + lsls r0, 24 + cmp r0, 0 + beq _0809696A + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 2 + orrs r0, r1 + str r0, [r4] +_0809696A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_Ripple + + thumb_func_start GetGroundEffectFlags_ShortGrass +@ void GetGroundEffectFlags_ShortGrass(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_ShortGrass: @ 8096970 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x1E] + bl MetatileBehavior_IsShortGrass + lsls r0, 24 + cmp r0, 0 + beq _080969AE + ldrb r0, [r4, 0x1F] + bl MetatileBehavior_IsShortGrass + lsls r0, 24 + cmp r0, 0 + beq _080969AE + ldrb r1, [r4, 0x2] + lsls r0, r1, 29 + cmp r0, 0 + blt _080969B8 + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4, 0x2] + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 10 + orrs r0, r1 + str r0, [r5] + b _080969B8 +_080969AE: + ldrb r1, [r4, 0x2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x2] +_080969B8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_ShortGrass + + thumb_func_start GetGroundEffectFlags_HotSprings +@ void GetGroundEffectFlags_HotSprings(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_HotSprings: @ 80969C0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x1E] + bl MetatileBehavior_IsHotSprings + lsls r0, 24 + cmp r0, 0 + beq _080969FE + ldrb r0, [r4, 0x1F] + bl MetatileBehavior_IsHotSprings + lsls r0, 24 + cmp r0, 0 + beq _080969FE + ldrb r1, [r4, 0x2] + lsls r0, r1, 26 + cmp r0, 0 + blt _08096A08 + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + movs r1, 0x20 + orrs r0, r1 + strb r0, [r4, 0x2] + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 11 + orrs r0, r1 + str r0, [r5] + b _08096A08 +_080969FE: + ldrb r1, [r4, 0x2] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x2] +_08096A08: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_HotSprings + + thumb_func_start GetGroundEffectFlags_Seaweed +@ void GetGroundEffectFlags_Seaweed(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_Seaweed: @ 8096A10 + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r0, 0x1E] + bl MetatileBehavior_IsSeaweed + lsls r0, 24 + cmp r0, 0 + beq _08096A2A + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r4] +_08096A2A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_Seaweed + + thumb_func_start GetGroundEffectFlags_JumpLanding +@ void GetGroundEffectFlags_JumpLanding(struct npc_state *fieldObject, u32 *flags) +GetGroundEffectFlags_JumpLanding: @ 8096A30 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + adds r6, r1, 0 + ldr r0, [r7] + ldr r1, =0x02000020 + ands r0, r1 + cmp r0, 0x20 + bne _08096A82 + movs r5, 0 + ldr r0, =gUnknown_0850E5E4 + mov r8, r0 +_08096A4A: + lsls r4, r5, 2 + mov r0, r8 + adds r1, r4, r0 + ldrb r0, [r7, 0x1E] + ldr r1, [r1] + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + beq _08096A78 + ldr r0, =gUnknown_0850E5FC + adds r0, r4, r0 + ldr r1, [r6] + ldr r0, [r0] + orrs r1, r0 + str r1, [r6] + b _08096A82 + .pool +_08096A78: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _08096A4A +_08096A82: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end GetGroundEffectFlags_JumpLanding + + thumb_func_start FieldObjectCheckForReflectiveSurface +@ u8 FieldObjectCheckForReflectiveSurface(struct npc_state *fieldObject) +FieldObjectCheckForReflectiveSurface: @ 8096A8C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r5, r0, 0 + ldrb r0, [r5, 0x5] + bl GetFieldObjectGraphicsInfo + movs r2, 0x8 + ldrsh r1, [r0, r2] + adds r1, 0x8 + lsls r1, 12 + lsrs r1, 16 + str r1, [sp] + movs r1, 0xA + ldrsh r0, [r0, r1] + adds r0, 0x8 + lsls r0, 12 + movs r4, 0 + lsrs r2, r0, 16 + str r2, [sp, 0x4] + asrs r0, 16 + cmp r4, r0 + blt _08096AC2 + b _08096BC8 +_08096AC2: + movs r0, 0x1 + mov r10, r0 +_08096AC6: + movs r1, 0x10 + ldrsh r0, [r5, r1] + movs r2, 0x12 + ldrsh r1, [r5, r2] + add r1, r10 + lsls r4, 16 + asrs r6, r4, 16 + adds r1, r6 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl GetReflectionTypeByMetatileBehavior + lsls r0, 24 + lsrs r0, 24 + mov r9, r4 + cmp r0, 0 + bne _08096BCA + movs r1, 0x14 + ldrsh r0, [r5, r1] + movs r2, 0x16 + ldrsh r1, [r5, r2] + add r1, r10 + adds r1, r6 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl GetReflectionTypeByMetatileBehavior + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08096BCA + movs r2, 0x1 + ldr r1, [sp] + lsls r0, r1, 16 + asrs r1, r0, 16 + mov r8, r0 + cmp r2, r1 + bge _08096BB6 + movs r0, 0x80 + lsls r0, 9 + asrs r7, r0, 16 +_08096B20: + movs r1, 0x10 + ldrsh r0, [r5, r1] + lsls r1, r2, 16 + asrs r4, r1, 16 + adds r0, r4 + movs r2, 0x12 + ldrsh r1, [r5, r2] + adds r1, r7 + adds r1, r6 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl GetReflectionTypeByMetatileBehavior + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08096BCA + movs r1, 0x10 + ldrsh r0, [r5, r1] + subs r0, r4 + movs r2, 0x12 + ldrsh r1, [r5, r2] + adds r1, r7 + adds r1, r6 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl GetReflectionTypeByMetatileBehavior + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08096BCA + movs r1, 0x14 + ldrsh r0, [r5, r1] + adds r0, r4 + movs r2, 0x16 + ldrsh r1, [r5, r2] + adds r1, r7 + adds r1, r6 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl GetReflectionTypeByMetatileBehavior + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08096BCA + movs r1, 0x14 + ldrsh r0, [r5, r1] + subs r0, r4 + movs r2, 0x16 + ldrsh r1, [r5, r2] + adds r1, r7 + adds r1, r6 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl GetReflectionTypeByMetatileBehavior + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08096BCA + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r0, r8 + blt _08096B20 +_08096BB6: + movs r1, 0x80 + lsls r1, 9 + add r1, r9 + lsrs r4, r1, 16 + ldr r2, [sp, 0x4] + lsls r0, r2, 16 + cmp r1, r0 + bge _08096BC8 + b _08096AC6 +_08096BC8: + movs r0, 0 +_08096BCA: + 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 FieldObjectCheckForReflectiveSurface + + thumb_func_start GetReflectionTypeByMetatileBehavior +@ u8 GetReflectionTypeByMetatileBehavior(u8 metatileBehavior) +GetReflectionTypeByMetatileBehavior: @ 8096BDC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl MetatileBehavior_IsIce + lsls r0, 24 + cmp r0, 0 + beq _08096BF2 + movs r0, 0x1 + b _08096C04 +_08096BF2: + adds r0, r4, 0 + bl MetatileBehavior_IsReflective + lsls r0, 24 + cmp r0, 0 + bne _08096C02 + movs r0, 0 + b _08096C04 +_08096C02: + movs r0, 0x2 +_08096C04: + pop {r4} + pop {r1} + bx r1 + thumb_func_end GetReflectionTypeByMetatileBehavior + + thumb_func_start GetLedgeJumpDirection +@ u8 GetLedgeJumpDirection(u16 x, u16 y, u8 direction) +GetLedgeJumpDirection: @ 8096C0C + push {r4,lr} + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r4, r2, 24 + cmp r4, 0 + beq _08096C52 + cmp r4, 0x4 + bls _08096C28 + subs r0, r4, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 +_08096C28: + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r3, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_0850E614 + lsls r1, r4, 2 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08096C5C +_08096C52: + movs r0, 0 + b _08096C62 + .pool +_08096C5C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r0, 24 +_08096C62: + pop {r4} + pop {r1} + bx r1 + thumb_func_end GetLedgeJumpDirection + + thumb_func_start FieldObjectSetSpriteOamTableForLongGrass +@ void FieldObjectSetSpriteOamTableForLongGrass(struct npc_state *fieldObject, struct obj *object) +FieldObjectSetSpriteOamTableForLongGrass: @ 8096C68 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldrb r0, [r5] + lsls r0, 27 + cmp r0, 0 + blt _08096CBC + ldrb r0, [r5, 0x1E] + bl MetatileBehavior_IsLongGrass + lsls r0, 24 + cmp r0, 0 + beq _08096CBC + ldrb r0, [r5, 0x1F] + bl MetatileBehavior_IsLongGrass + lsls r0, 24 + cmp r0, 0 + beq _08096CBC + adds r4, 0x42 + ldrb r1, [r4] + movs r6, 0x40 + negs r6, r6 + adds r0, r6, 0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] + ldrb r0, [r5, 0xB] + lsrs r0, 4 + bl ZCoordToPriority + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08096CBC + ldrb r0, [r4] + adds r1, r6, 0 + ands r1, r0 + movs r0, 0x5 + orrs r1, r0 + strb r1, [r4] +_08096CBC: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end FieldObjectSetSpriteOamTableForLongGrass + + thumb_func_start IsZCoordMismatchAt +@ bool8 IsZCoordMismatchAt(u8 z, u16 x, u16 y) +IsZCoordMismatchAt: @ 8096CC4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsrs r0, r1, 16 + lsls r2, 16 + lsrs r1, r2, 16 + cmp r4, 0 + beq _08096CF2 + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl MapGridGetZCoordAt + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08096CF2 + cmp r0, 0xF + beq _08096CF2 + cmp r0, r4 + bne _08096CF6 +_08096CF2: + movs r0, 0 + b _08096CF8 +_08096CF6: + movs r0, 0x1 +_08096CF8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end IsZCoordMismatchAt + + thumb_func_start FieldObjectUpdateZCoordAndPriority +@ void FieldObjectUpdateZCoordAndPriority(struct npc_state *fieldObject, struct obj *object) +FieldObjectUpdateZCoordAndPriority: @ 8096D00 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x3] + lsls r0, 29 + cmp r0, 0 + blt _08096D4E + adds r0, r4, 0 + bl FieldObjectUpdateZCoord + ldr r1, =gUnknown_0850E644 + ldrb r2, [r4, 0xB] + lsls r2, 24 + lsrs r0, r2, 28 + adds r0, r1 + ldrb r0, [r0] + adds r4, r5, 0 + adds r4, 0x42 + movs r1, 0x3F + ands r1, r0 + ldrb r3, [r4] + movs r0, 0x40 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + ldr r0, =gUnknown_0850E634 + lsrs r2, 28 + adds r2, r0 + movs r0, 0x3 + ldrb r1, [r2] + ands r1, r0 + lsls r1, 2 + ldrb r2, [r5, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] +_08096D4E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectUpdateZCoordAndPriority + + thumb_func_start InitObjectPriorityByZCoord +@ void InitObjectPriorityByZCoord(struct obj *object, u8 z) +InitObjectPriorityByZCoord: @ 8096D5C + push {r4,lr} + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_0850E644 + adds r2, r1, r2 + ldrb r2, [r2] + movs r3, 0x42 + adds r3, r0 + mov r12, r3 + movs r3, 0x3F + ands r3, r2 + mov r2, r12 + ldrb r4, [r2] + movs r2, 0x40 + negs r2, r2 + ands r2, r4 + orrs r2, r3 + mov r3, r12 + strb r2, [r3] + ldr r2, =gUnknown_0850E634 + adds r1, r2 + movs r3, 0x3 + ldrb r2, [r1] + ands r2, r3 + lsls r2, 2 + ldrb r3, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0, 0x5] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end InitObjectPriorityByZCoord + + thumb_func_start ZCoordToPriority +@ u8 ZCoordToPriority(u8 z) +ZCoordToPriority: @ 8096DA8 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850E634 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end ZCoordToPriority + + thumb_func_start FieldObjectUpdateZCoord +@ void FieldObjectUpdateZCoord(struct npc_state *fieldObject) +FieldObjectUpdateZCoord: @ 8096DB8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x10 + ldrsh r0, [r4, r1] + movs r2, 0x12 + ldrsh r1, [r4, r2] + bl MapGridGetZCoordAt + lsls r0, 24 + lsrs r5, r0, 24 + movs r1, 0x14 + ldrsh r0, [r4, r1] + movs r2, 0x16 + ldrsh r1, [r4, r2] + bl MapGridGetZCoordAt + lsls r0, 24 + lsrs r0, 24 + cmp r5, 0xF + beq _08096E06 + cmp r0, 0xF + beq _08096E06 + movs r3, 0xF + adds r0, r5, 0 + ands r0, r3 + ldrb r1, [r4, 0xB] + movs r2, 0x10 + negs r2, r2 + ands r2, r1 + orrs r2, r0 + strb r2, [r4, 0xB] + cmp r5, 0 + beq _08096E06 + cmp r5, 0xF + beq _08096E06 + lsls r0, r5, 4 + ands r2, r3 + orrs r2, r0 + strb r2, [r4, 0xB] +_08096E06: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end FieldObjectUpdateZCoord + + thumb_func_start SetObjectSubpriorityByZCoord +@ void SetObjectSubpriorityByZCoord(u8 z, struct obj *object, u8 offset) +SetObjectSubpriorityByZCoord: @ 8096E0C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + adds r3, r1, 0 + adds r3, 0x29 + movs r5, 0 + ldrsb r5, [r3, r5] + ldrh r4, [r1, 0x22] + ldr r3, =0x02021bbe + subs r4, r5 + ldrh r3, [r3] + adds r4, r3 + adds r4, 0x8 + movs r3, 0xFF + ands r4, r3 + lsrs r4, 4 + movs r3, 0x10 + subs r3, r4 + lsls r3, 17 + ldr r4, =gUnknown_0850E624 + adds r0, r4 + lsrs r3, 16 + ldrb r0, [r0] + adds r3, r0 + adds r2, r3 + adds r1, 0x43 + strb r2, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end SetObjectSubpriorityByZCoord + + thumb_func_start FieldObjectUpdateSubpriority +@ void FieldObjectUpdateSubpriority(struct npc_state *fieldObject, struct obj *object) +FieldObjectUpdateSubpriority: @ 8096E54 + push {lr} + adds r2, r0, 0 + ldrb r0, [r2, 0x3] + lsls r0, 29 + cmp r0, 0 + blt _08096E6A + ldrb r0, [r2, 0xB] + lsrs r0, 4 + movs r2, 0x1 + bl SetObjectSubpriorityByZCoord +_08096E6A: + pop {r0} + bx r0 + thumb_func_end FieldObjectUpdateSubpriority + + thumb_func_start AreZCoordsCompatible +@ bool8 AreZCoordsCompatible(u8 z1, u8 z2) +AreZCoordsCompatible: @ 8096E70 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r0, 0 + beq _08096E86 + cmp r1, 0 + beq _08096E86 + cmp r0, r1 + bne _08096E8A +_08096E86: + movs r0, 0x1 + b _08096E8C +_08096E8A: + movs r0, 0 +_08096E8C: + pop {r1} + bx r1 + thumb_func_end AreZCoordsCompatible + + thumb_func_start GroundEffect_SpawnOnTallGrass +@ void GroundEffect_SpawnOnTallGrass(struct npc_state *fieldObject, struct obj *object) +GroundEffect_SpawnOnTallGrass: @ 8096E90 + push {lr} + ldr r3, =0x02038c08 + movs r2, 0x10 + ldrsh r1, [r0, r2] + str r1, [r3] + movs r2, 0x12 + ldrsh r1, [r0, r2] + str r1, [r3, 0x4] + ldrb r1, [r0, 0xB] + lsrs r1, 4 + str r1, [r3, 0x8] + movs r1, 0x2 + str r1, [r3, 0xC] + ldrb r1, [r0, 0x8] + lsls r1, 8 + ldrb r2, [r0, 0x9] + orrs r1, r2 + str r1, [r3, 0x10] + ldrb r0, [r0, 0xA] + str r0, [r3, 0x14] + ldr r0, =0x03005d8c + ldr r1, [r0] + ldrb r0, [r1, 0x5] + lsls r0, 8 + ldrb r1, [r1, 0x4] + orrs r0, r1 + str r0, [r3, 0x18] + movs r0, 0x1 + str r0, [r3, 0x1C] + movs r0, 0x4 + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_SpawnOnTallGrass + + thumb_func_start GroundEffect_StepOnTallGrass +@ void GroundEffect_StepOnTallGrass(struct npc_state *fieldObject, struct obj *object) +GroundEffect_StepOnTallGrass: @ 8096EDC + push {lr} + ldr r3, =0x02038c08 + movs r2, 0x10 + ldrsh r1, [r0, r2] + str r1, [r3] + movs r2, 0x12 + ldrsh r1, [r0, r2] + str r1, [r3, 0x4] + ldrb r1, [r0, 0xB] + lsrs r1, 4 + str r1, [r3, 0x8] + movs r1, 0x2 + str r1, [r3, 0xC] + ldrb r1, [r0, 0x8] + lsls r1, 8 + ldrb r2, [r0, 0x9] + orrs r1, r2 + str r1, [r3, 0x10] + ldrb r0, [r0, 0xA] + str r0, [r3, 0x14] + ldr r0, =0x03005d8c + ldr r1, [r0] + ldrb r0, [r1, 0x5] + lsls r0, 8 + ldrb r1, [r1, 0x4] + orrs r0, r1 + str r0, [r3, 0x18] + movs r0, 0 + str r0, [r3, 0x1C] + movs r0, 0x4 + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_StepOnTallGrass + + thumb_func_start GroundEffect_SpawnOnLongGrass +@ void GroundEffect_SpawnOnLongGrass(struct npc_state *fieldObject, struct obj *object) +GroundEffect_SpawnOnLongGrass: @ 8096F28 + push {lr} + ldr r3, =0x02038c08 + movs r2, 0x10 + ldrsh r1, [r0, r2] + str r1, [r3] + movs r2, 0x12 + ldrsh r1, [r0, r2] + str r1, [r3, 0x4] + ldrb r1, [r0, 0xB] + lsrs r1, 4 + str r1, [r3, 0x8] + movs r1, 0x2 + str r1, [r3, 0xC] + ldrb r1, [r0, 0x8] + lsls r1, 8 + ldrb r2, [r0, 0x9] + orrs r1, r2 + str r1, [r3, 0x10] + ldrb r0, [r0, 0xA] + str r0, [r3, 0x14] + ldr r0, =0x03005d8c + ldr r1, [r0] + ldrb r0, [r1, 0x5] + lsls r0, 8 + ldrb r1, [r1, 0x4] + orrs r0, r1 + str r0, [r3, 0x18] + movs r0, 0x1 + str r0, [r3, 0x1C] + movs r0, 0x11 + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_SpawnOnLongGrass + + thumb_func_start GroundEffect_StepOnLongGrass +@ void GroundEffect_StepOnLongGrass(struct npc_state *fieldObject, struct obj *object) +GroundEffect_StepOnLongGrass: @ 8096F74 + push {lr} + ldr r3, =0x02038c08 + movs r2, 0x10 + ldrsh r1, [r0, r2] + str r1, [r3] + movs r2, 0x12 + ldrsh r1, [r0, r2] + str r1, [r3, 0x4] + ldrb r1, [r0, 0xB] + lsrs r1, 4 + str r1, [r3, 0x8] + movs r1, 0x2 + str r1, [r3, 0xC] + ldrb r1, [r0, 0x8] + lsls r1, 8 + ldrb r2, [r0, 0x9] + orrs r1, r2 + str r1, [r3, 0x10] + ldrb r0, [r0, 0xA] + str r0, [r3, 0x14] + ldr r0, =0x03005d8c + ldr r1, [r0] + ldrb r0, [r1, 0x5] + lsls r0, 8 + ldrb r1, [r1, 0x4] + orrs r0, r1 + str r0, [r3, 0x18] + movs r0, 0 + str r0, [r3, 0x1C] + movs r0, 0x11 + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_StepOnLongGrass + + thumb_func_start GroundEffect_WaterReflection +@ void GroundEffect_WaterReflection(struct npc_state *fieldObject, struct obj *object) +GroundEffect_WaterReflection: @ 8096FC0 + push {lr} + movs r2, 0 + bl SetUpReflection + pop {r0} + bx r0 + thumb_func_end GroundEffect_WaterReflection + + thumb_func_start GroundEffect_IceReflection +@ void GroundEffect_IceReflection(struct npc_state *fieldObject, struct obj *object) +GroundEffect_IceReflection: @ 8096FCC + push {lr} + movs r2, 0x1 + bl SetUpReflection + pop {r0} + bx r0 + thumb_func_end GroundEffect_IceReflection + + thumb_func_start GroundEffect_FlowingWater +@ void GroundEffect_FlowingWater(struct npc_state *fieldObject, struct obj *object) +GroundEffect_FlowingWater: @ 8096FD8 + push {lr} + adds r1, r0, 0 + movs r0, 0x22 + bl oe_exec_and_other_stuff + pop {r0} + bx r0 + thumb_func_end GroundEffect_FlowingWater + + thumb_func_start GroundEffect_SandTracks +@ void GroundEffect_SandTracks(struct npc_state *fieldObject, struct obj *object) +GroundEffect_SandTracks: @ 8096FE8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x5] + bl GetFieldObjectGraphicsInfo + ldr r1, =gUnknown_0850E654 + ldrb r0, [r0, 0xD] + lsls r0, 2 + adds r0, r1 + ldr r3, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl _call_via_r3 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_SandTracks + + thumb_func_start GroundEffect_DeepSandTracks +@ void GroundEffect_DeepSandTracks(struct npc_state *fieldObject, struct obj *object) +GroundEffect_DeepSandTracks: @ 8097014 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x5] + bl GetFieldObjectGraphicsInfo + ldr r1, =gUnknown_0850E654 + ldrb r0, [r0, 0xD] + lsls r0, 2 + adds r0, r1 + ldr r3, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl _call_via_r3 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_DeepSandTracks + + thumb_func_start DoTracksGroundEffect_None +@ void DoTracksGroundEffect_None(struct npc_state *fieldObject, struct obj *object) +DoTracksGroundEffect_None: @ 8097040 + bx lr + thumb_func_end DoTracksGroundEffect_None + + thumb_func_start DoTracksGroundEffect_Footprints +@ void DoTracksGroundEffect_Footprints(struct npc_state *fieldObject, struct obj *object) +DoTracksGroundEffect_Footprints: @ 8097044 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + lsls r4, r2, 24 + lsrs r4, 24 + ldr r1, =gUnknown_0850E660 + mov r0, sp + movs r2, 0x4 + bl memcpy + ldr r1, =0x02038c08 + movs r2, 0x14 + ldrsh r0, [r5, r2] + str r0, [r1] + movs r2, 0x16 + ldrsh r0, [r5, r2] + str r0, [r1, 0x4] + movs r0, 0x95 + str r0, [r1, 0x8] + movs r0, 0x2 + str r0, [r1, 0xC] + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + str r0, [r1, 0x10] + lsls r4, 1 + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + bl FieldEffectStart + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DoTracksGroundEffect_Footprints + + thumb_func_start DoTracksGroundEffect_BikeTireTracks +@ void DoTracksGroundEffect_BikeTireTracks(struct npc_state *fieldObject, struct obj *object) +DoTracksGroundEffect_BikeTireTracks: @ 8097094 + push {r4,lr} + adds r4, r0, 0 + ldr r1, [r4, 0x10] + ldr r0, [r4, 0x14] + cmp r1, r0 + beq _080970D6 + ldr r2, =0x02038c08 + movs r1, 0x14 + ldrsh r0, [r4, r1] + str r0, [r2] + movs r1, 0x16 + ldrsh r0, [r4, r1] + str r0, [r2, 0x4] + movs r0, 0x95 + str r0, [r2, 0x8] + movs r0, 0x2 + str r0, [r2, 0xC] + ldr r3, =gUnknown_0850E664 + ldrb r1, [r4, 0x18] + lsls r1, 28 + lsrs r1, 28 + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + lsls r0, 2 + subs r0, 0x5 + adds r1, r0 + adds r1, r3 + ldrb r0, [r1] + str r0, [r2, 0x10] + movs r0, 0x23 + bl FieldEffectStart +_080970D6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end DoTracksGroundEffect_BikeTireTracks + + thumb_func_start GroundEffect_Ripple +@ void GroundEffect_Ripple(struct npc_state *fieldObject, struct obj *object) +GroundEffect_Ripple: @ 80970E4 + push {lr} + bl DoRippleFieldEffect + pop {r0} + bx r0 + thumb_func_end GroundEffect_Ripple + + thumb_func_start GroundEffect_StepOnPuddle +@ void GroundEffect_StepOnPuddle(struct npc_state *fieldObject, struct obj *object) +GroundEffect_StepOnPuddle: @ 80970F0 + push {lr} + adds r1, r0, 0 + movs r0, 0xF + bl oe_exec_and_other_stuff + pop {r0} + bx r0 + thumb_func_end GroundEffect_StepOnPuddle + + thumb_func_start GroundEffect_SandHeap +@ void GroundEffect_SandHeap(struct npc_state *fieldObject, struct obj *object) +GroundEffect_SandHeap: @ 8097100 + push {lr} + adds r1, r0, 0 + movs r0, 0x27 + bl oe_exec_and_other_stuff + pop {r0} + bx r0 + thumb_func_end GroundEffect_SandHeap + + thumb_func_start GroundEffect_JumpOnTallGrass +@ void GroundEffect_JumpOnTallGrass(struct npc_state *fieldObject, struct obj *object) +GroundEffect_JumpOnTallGrass: @ 8097110 + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + ldr r1, =0x02038c08 + movs r2, 0x10 + ldrsh r0, [r5, r2] + str r0, [r1] + movs r4, 0x12 + ldrsh r0, [r5, r4] + str r0, [r1, 0x4] + ldrb r0, [r5, 0xB] + lsrs r0, 4 + str r0, [r1, 0x8] + movs r0, 0x2 + str r0, [r1, 0xC] + movs r0, 0xC + bl FieldEffectStart + ldrb r0, [r5, 0x8] + ldrb r1, [r5, 0x9] + ldrb r2, [r5, 0xA] + movs r7, 0x10 + ldrsh r3, [r5, r7] + movs r7, 0x12 + ldrsh r4, [r5, r7] + str r4, [sp] + bl sub_81546C8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + bne _0809715A + adds r0, r5, 0 + adds r1, r6, 0 + bl GroundEffect_SpawnOnTallGrass +_0809715A: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_JumpOnTallGrass + + thumb_func_start GroundEffect_JumpOnLongGrass +@ void GroundEffect_JumpOnLongGrass(struct npc_state *fieldObject, struct obj *object) +GroundEffect_JumpOnLongGrass: @ 8097168 + push {lr} + ldr r2, =0x02038c08 + movs r3, 0x10 + ldrsh r1, [r0, r3] + str r1, [r2] + movs r3, 0x12 + ldrsh r1, [r0, r3] + str r1, [r2, 0x4] + ldrb r0, [r0, 0xB] + lsrs r0, 4 + str r0, [r2, 0x8] + movs r0, 0x2 + str r0, [r2, 0xC] + movs r0, 0x12 + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_JumpOnLongGrass + + thumb_func_start GroundEffect_JumpOnShallowWater +@ void GroundEffect_JumpOnShallowWater(struct npc_state *fieldObject, struct obj *object) +GroundEffect_JumpOnShallowWater: @ 8097190 + push {r4,lr} + ldr r3, =0x02038c08 + movs r4, 0x10 + ldrsh r2, [r0, r4] + str r2, [r3] + movs r4, 0x12 + ldrsh r2, [r0, r4] + str r2, [r3, 0x4] + ldrb r0, [r0, 0xB] + lsrs r0, 4 + str r0, [r3, 0x8] + ldrb r0, [r1, 0x5] + lsls r0, 28 + lsrs r0, 30 + str r0, [r3, 0xC] + movs r0, 0x10 + bl FieldEffectStart + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_JumpOnShallowWater + + thumb_func_start GroundEffect_JumpOnWater +@ void GroundEffect_JumpOnWater(struct npc_state *fieldObject, struct obj *object) +GroundEffect_JumpOnWater: @ 80971C0 + push {r4,lr} + ldr r3, =0x02038c08 + movs r4, 0x10 + ldrsh r2, [r0, r4] + str r2, [r3] + movs r4, 0x12 + ldrsh r2, [r0, r4] + str r2, [r3, 0x4] + ldrb r0, [r0, 0xB] + lsrs r0, 4 + str r0, [r3, 0x8] + ldrb r0, [r1, 0x5] + lsls r0, 28 + lsrs r0, 30 + str r0, [r3, 0xC] + movs r0, 0xE + bl FieldEffectStart + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_JumpOnWater + + thumb_func_start GroundEffect_JumpLandingDust +@ void GroundEffect_JumpLandingDust(struct npc_state *fieldObject, struct obj *object) +GroundEffect_JumpLandingDust: @ 80971F0 + push {r4,lr} + ldr r3, =0x02038c08 + movs r4, 0x10 + ldrsh r2, [r0, r4] + str r2, [r3] + movs r4, 0x12 + ldrsh r2, [r0, r4] + str r2, [r3, 0x4] + ldrb r0, [r0, 0xB] + lsrs r0, 4 + str r0, [r3, 0x8] + ldrb r0, [r1, 0x5] + lsls r0, 28 + lsrs r0, 30 + str r0, [r3, 0xC] + movs r0, 0xA + bl FieldEffectStart + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_JumpLandingDust + + thumb_func_start GroundEffect_ShortGrass +@ void GroundEffect_ShortGrass(struct npc_state *fieldObject, struct obj *object) +GroundEffect_ShortGrass: @ 8097220 + push {lr} + adds r1, r0, 0 + movs r0, 0x29 + bl oe_exec_and_other_stuff + pop {r0} + bx r0 + thumb_func_end GroundEffect_ShortGrass + + thumb_func_start GroundEffect_HotSprings +@ void GroundEffect_HotSprings(struct npc_state *fieldObject, struct obj *object) +GroundEffect_HotSprings: @ 8097230 + push {lr} + adds r1, r0, 0 + movs r0, 0x2A + bl oe_exec_and_other_stuff + pop {r0} + bx r0 + thumb_func_end GroundEffect_HotSprings + + thumb_func_start GroundEffect_Seaweed +@ void GroundEffect_Seaweed(struct npc_state *fieldObject, struct obj *object) +GroundEffect_Seaweed: @ 8097240 + push {lr} + ldr r2, =0x02038c08 + movs r3, 0x10 + ldrsh r1, [r0, r3] + str r1, [r2] + movs r1, 0x12 + ldrsh r0, [r0, r1] + str r0, [r2, 0x4] + movs r0, 0x35 + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end GroundEffect_Seaweed + + thumb_func_start DoFlaggedGroundEffects +@ void DoFlaggedGroundEffects(struct npc_state *fieldObject, struct obj *object, u32 flags) +DoFlaggedGroundEffects: @ 8097260 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r7, r1, 0 + adds r5, r2, 0 + bl FieldObjectIsFarawayIslandMew + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08097284 + adds r0, r6, 0 + bl sub_81D4A58 + lsls r0, 24 + cmp r0, 0 + beq _080972AC +_08097284: + movs r4, 0 + ldr r0, =gUnknown_0850E674 + mov r8, r0 +_0809728A: + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + beq _080972A0 + lsls r0, r4, 2 + add r0, r8 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r7, 0 + bl _call_via_r2 +_080972A0: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + lsrs r5, 1 + cmp r4, 0x13 + bls _0809728A +_080972AC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end DoFlaggedGroundEffects + + thumb_func_start filters_out_some_ground_effects +@ void filters_out_some_ground_effects(struct npc_state *fieldObject, u32 *flags) +filters_out_some_ground_effects: @ 80972BC + push {lr} + adds r2, r0, 0 + adds r3, r1, 0 + ldrb r0, [r2] + lsls r0, 27 + cmp r0, 0 + bge _080972EA + ldrb r1, [r2, 0x2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + adds r1, 0x8 + ands r0, r1 + subs r1, 0x18 + ands r0, r1 + strb r0, [r2, 0x2] + ldr r0, [r3] + ldr r1, =0xfff9f7bd + ands r0, r1 + str r0, [r3] +_080972EA: + pop {r0} + bx r0 + .pool + thumb_func_end filters_out_some_ground_effects + + thumb_func_start FilterOutStepOnPuddleGroundEffectIfJumping +@ void FilterOutStepOnPuddleGroundEffectIfJumping(struct npc_state *fieldObject, u32 *flags) +FilterOutStepOnPuddleGroundEffectIfJumping: @ 80972F4 + push {lr} + adds r2, r1, 0 + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _08097308 + ldr r0, [r2] + ldr r1, =0xfffffbff + ands r0, r1 + str r0, [r2] +_08097308: + pop {r0} + bx r0 + .pool + thumb_func_end FilterOutStepOnPuddleGroundEffectIfJumping + + thumb_func_start DoGroundEffects_OnSpawn +@ void DoGroundEffects_OnSpawn(struct npc_state *fieldObject, struct obj *object) +DoGroundEffects_OnSpawn: @ 8097310 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4] + lsls r0, 29 + cmp r0, 0 + bge _08097354 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + bl FieldObjectUpdateZCoordAndPriority + adds r0, r4, 0 + mov r1, sp + bl GetAllGroundEffectFlags_OnSpawn + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetSpriteOamTableForLongGrass + ldr r2, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + bl DoFlaggedGroundEffects + ldrb r1, [r4] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + strb r0, [r4] +_08097354: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end DoGroundEffects_OnSpawn + + thumb_func_start DoGroundEffects_OnBeginStep +@ void DoGroundEffects_OnBeginStep(struct npc_state *fieldObject, struct obj *object) +DoGroundEffects_OnBeginStep: @ 809735C + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4] + lsls r0, 29 + cmp r0, 0 + bge _080973A8 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + bl FieldObjectUpdateZCoordAndPriority + adds r0, r4, 0 + mov r1, sp + bl GetAllGroundEffectFlags_OnBeginStep + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetSpriteOamTableForLongGrass + adds r0, r4, 0 + mov r1, sp + bl filters_out_some_ground_effects + ldr r2, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + bl DoFlaggedGroundEffects + ldrb r1, [r4] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + strb r0, [r4] +_080973A8: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end DoGroundEffects_OnBeginStep + + thumb_func_start DoGroundEffects_OnFinishStep +@ void DoGroundEffects_OnFinishStep(struct npc_state *fieldObject, struct obj *object) +DoGroundEffects_OnFinishStep: @ 80973B0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4] + lsls r0, 28 + cmp r0, 0 + bge _080973FC + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + bl FieldObjectUpdateZCoordAndPriority + adds r0, r4, 0 + mov r1, sp + bl GetAllGroundEffectFlags_OnFinishStep + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetSpriteOamTableForLongGrass + adds r0, r4, 0 + mov r1, sp + bl FilterOutStepOnPuddleGroundEffectIfJumping + ldr r2, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + bl DoFlaggedGroundEffects + ldrb r1, [r4] + movs r0, 0x9 + negs r0, r0 + ands r0, r1 + movs r1, 0x21 + negs r1, r1 + ands r0, r1 + strb r0, [r4] +_080973FC: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end DoGroundEffects_OnFinishStep + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/field_map_obj.s b/asm/field_map_obj.s new file mode 100644 index 000000000..a84b7d256 --- /dev/null +++ b/asm/field_map_obj.s @@ -0,0 +1,20270 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start npc_clear_ids_and_state +npc_clear_ids_and_state: @ 808D3F0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + movs r2, 0x24 + bl memset + movs r0, 0xFF + strb r0, [r4, 0x8] + movs r0, 0x1 + negs r0, r0 + strb r0, [r4, 0x9] + strb r0, [r4, 0xA] + strb r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + thumb_func_end npc_clear_ids_and_state + + thumb_func_start npcs_clear_ids_and_state +npcs_clear_ids_and_state: @ 808D410 + push {r4,r5,lr} + movs r4, 0 + ldr r5, =0x02037350 +_0808D416: + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + adds r0, r5 + bl npc_clear_ids_and_state + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _0808D416 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end npcs_clear_ids_and_state + + thumb_func_start sub_808D438 +sub_808D438: @ 808D438 + push {lr} + bl strange_npc_table_clear + bl npcs_clear_ids_and_state + bl ClearPlayerAvatarInfo + bl sub_808D450 + pop {r0} + bx r0 + thumb_func_end sub_808D438 + + thumb_func_start sub_808D450 +sub_808D450: @ 808D450 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x54] + mov r9, r0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1F + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02020630 + mov r10, r1 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + add r4, r10 + ldrb r1, [r4, 0x1] + movs r5, 0x4 + negs r5, r5 + adds r0, r5, 0 + ands r0, r1 + movs r1, 0x1 + mov r8, r1 + mov r1, r8 + orrs r0, r1 + strb r0, [r4, 0x1] + adds r0, r4, 0 + bl obj_alloc_rotscale_entry + adds r0, r4, 0 + movs r1, 0 + bl StartObjectRotScalAnim + adds r4, 0x3E + ldrb r0, [r4] + movs r6, 0x4 + orrs r0, r6 + strb r0, [r4] + mov r0, r9 + movs r1, 0 + movs r2, 0 + movs r3, 0x1F + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + add r4, r10 + ldrb r0, [r4, 0x1] + ands r5, r0 + mov r0, r8 + orrs r5, r0 + strb r5, [r4, 0x1] + adds r0, r4, 0 + bl obj_alloc_rotscale_entry + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + adds r4, 0x3E + ldrb r0, [r4] + orrs r0, r6 + strb r0, [r4] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808D450 + + thumb_func_start sub_808D4F4 +sub_808D4F4: @ 808D4F4 + push {lr} + movs r1, 0 + ldr r2, =0x02037350 + ldrb r0, [r2] + b _0808D518 + .pool +_0808D504: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bhi _0808D51E + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] +_0808D518: + lsls r0, 31 + cmp r0, 0 + bne _0808D504 +_0808D51E: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_808D4F4 + + thumb_func_start GetFieldObjectIdByLocalIdAndMap +@ u8 GetFieldObjectIdByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) +GetFieldObjectIdByLocalIdAndMap: @ 808D524 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + cmp r0, 0xFE + bls _0808D53C + bl GetFieldObjectIdByLocalId + b _0808D540 +_0808D53C: + bl GetFieldObjectIdByLocalIdAndMapInternal +_0808D540: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end GetFieldObjectIdByLocalIdAndMap + + thumb_func_start TryGetFieldObjectIdByLocalIdAndMap +@ bool8 TryGetFieldObjectIdByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId, u8 *fieldObjectId) +TryGetFieldObjectIdByLocalIdAndMap: @ 808D548 + push {r4,lr} + adds r4, r3, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + bl GetFieldObjectIdByLocalIdAndMap + strb r0, [r4] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + beq _0808D56A + movs r0, 0 + b _0808D56C +_0808D56A: + movs r0, 0x1 +_0808D56C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end TryGetFieldObjectIdByLocalIdAndMap + + thumb_func_start GetFieldObjectIdByXY +@ u8 GetFieldObjectIdByXY(s16 x, s16 y) +GetFieldObjectIdByXY: @ 808D574 + push {r4-r6,lr} + movs r3, 0 + ldr r5, =0x02037350 + lsls r0, 16 + asrs r4, r0, 16 + lsls r1, 16 + asrs r1, 16 +_0808D582: + lsls r0, r3, 3 + adds r0, r3 + lsls r0, 2 + adds r2, r0, r5 + ldrb r0, [r2] + lsls r0, 31 + cmp r0, 0 + beq _0808D5A2 + movs r6, 0x10 + ldrsh r0, [r2, r6] + cmp r0, r4 + bne _0808D5A2 + movs r6, 0x12 + ldrsh r0, [r2, r6] + cmp r0, r1 + beq _0808D5AC +_0808D5A2: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xF + bls _0808D582 +_0808D5AC: + adds r0, r3, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end GetFieldObjectIdByXY + + thumb_func_start GetFieldObjectIdByLocalIdAndMapInternal +@ u8 GetFieldObjectIdByLocalIdAndMapInternal(u8 localId, u8 mapId, u8 mapGroupId) +GetFieldObjectIdByLocalIdAndMapInternal: @ 808D5B8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + lsls r2, 24 + lsrs r2, 24 + movs r1, 0 + ldr r6, =0x02037350 +_0808D5CA: + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r3, r0, r6 + ldrb r0, [r3] + lsls r0, 31 + cmp r0, 0 + beq _0808D5F4 + ldrb r0, [r3, 0x8] + cmp r0, r5 + bne _0808D5F4 + ldrb r0, [r3, 0x9] + cmp r0, r4 + bne _0808D5F4 + ldrb r0, [r3, 0xA] + cmp r0, r2 + bne _0808D5F4 + adds r0, r1, 0 + b _0808D600 + .pool +_0808D5F4: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bls _0808D5CA + movs r0, 0x10 +_0808D600: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end GetFieldObjectIdByLocalIdAndMapInternal + + thumb_func_start GetFieldObjectIdByLocalId +@ u8 GetFieldObjectIdByLocalId(u8 localId) +GetFieldObjectIdByLocalId: @ 808D608 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + movs r2, 0 + ldr r4, =0x02037350 +_0808D612: + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r4 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + beq _0808D630 + ldrb r0, [r1, 0x8] + cmp r0, r3 + bne _0808D630 + adds r0, r2, 0 + b _0808D63C + .pool +_0808D630: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _0808D612 + movs r0, 0x10 +_0808D63C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end GetFieldObjectIdByLocalId + + thumb_func_start InitFieldObjectStateFromTemplate +@ u8 InitFieldObjectStateFromTemplate(struct FieldObjectTemplate *fieldObjectTemplate, u8 mapId, u8 mapGroupId) +InitFieldObjectStateFromTemplate: @ 808D644 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r5, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r7, r2, 24 + ldrb r0, [r5] + adds r1, r6, 0 + adds r2, r7, 0 + mov r3, sp + bl GetAvailableFieldObjectSlot + lsls r0, 24 + cmp r0, 0 + beq _0808D66E + movs r0, 0x10 + b _0808D762 +_0808D66E: + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + adds r0, r4, 0 + bl npc_clear_ids_and_state + ldrh r3, [r5, 0x4] + adds r3, 0x7 + lsls r3, 16 + lsrs r3, 16 + ldrh r2, [r5, 0x6] + adds r2, 0x7 + lsls r2, 16 + lsrs r2, 16 + ldrb r0, [r4] + movs r1, 0x1 + orrs r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] + ldrb r0, [r5, 0x1] + strb r0, [r4, 0x5] + ldrb r0, [r5, 0x9] + strb r0, [r4, 0x6] + ldrb r0, [r5] + strb r0, [r4, 0x8] + strb r6, [r4, 0x9] + strb r7, [r4, 0xA] + strh r3, [r4, 0xC] + strh r2, [r4, 0xE] + strh r3, [r4, 0x10] + strh r2, [r4, 0x12] + strh r3, [r4, 0x14] + strh r2, [r4, 0x16] + ldrb r0, [r5, 0x8] + movs r7, 0xF + adds r1, r7, 0 + ands r1, r0 + ldrb r2, [r4, 0xB] + movs r0, 0x10 + negs r0, r0 + mov r8, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0xB] + ldrb r1, [r5, 0x8] + lsls r1, 4 + ands r0, r7 + orrs r0, r1 + strb r0, [r4, 0xB] + ldrb r1, [r5, 0xA] + lsls r1, 28 + movs r0, 0xF + mov r9, r0 + lsrs r1, 28 + ldrb r2, [r4, 0x19] + mov r0, r8 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x19] + ldrb r1, [r5, 0xA] + lsrs r1, 4 + lsls r1, 4 + ands r0, r7 + orrs r0, r1 + strb r0, [r4, 0x19] + ldrh r0, [r5, 0xC] + strb r0, [r4, 0x7] + ldrh r0, [r5, 0xE] + strb r0, [r4, 0x1D] + ldr r1, =gUnknown_085055CD + ldrb r0, [r5, 0x9] + adds r0, r1 + ldrb r1, [r0] + adds r0, r4, 0 + adds r0, 0x20 + strb r1, [r0] + ldrb r1, [r0] + adds r0, r4, 0 + bl FieldObjectSetDirection + adds r0, r4, 0 + bl FieldObjectHandleDynamicGraphicsId + ldr r1, =gUnknown_0850557C + ldrb r0, [r4, 0x6] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0808D75E + ldrb r2, [r4, 0x19] + adds r0, r7, 0 + ands r0, r2 + cmp r0, 0 + bne _0808D746 + lsls r0, r2, 28 + lsrs r0, 28 + adds r0, 0x1 + mov r1, r9 + ands r0, r1 + mov r1, r8 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x19] +_0808D746: + ldrb r2, [r4, 0x19] + movs r0, 0xF0 + ands r0, r2 + cmp r0, 0 + bne _0808D75E + lsrs r1, r2, 4 + adds r1, 0x1 + lsls r1, 4 + adds r0, r7, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x19] +_0808D75E: + mov r0, sp + ldrb r0, [r0] +_0808D762: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end InitFieldObjectStateFromTemplate + + thumb_func_start sub_808D77C +sub_808D77C: @ 808D77C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r4, =0x02037318 + ldr r0, [r4, 0x4] + cmp r0, 0 + beq _0808D7FE + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _0808D7A8 + bl sub_81AAA40 + lsls r0, 24 + lsrs r6, r0, 24 + b _0808D7CA + .pool +_0808D7A8: + bl InTrainerHill + cmp r0, 0 + beq _0808D7C6 + movs r6, 0x2 + b _0808D7CA +_0808D7B4: + ldr r0, [r7] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + adds r0, r4, 0 + bl InitFieldObjectStateFromTemplate + lsls r0, 24 + lsrs r0, 24 + b _0808D800 +_0808D7C6: + ldr r0, [r4, 0x4] + ldrb r6, [r0] +_0808D7CA: + movs r5, 0 + cmp r5, r6 + bcs _0808D7FE + ldr r7, =0x03005d8c +_0808D7D2: + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 3 + movs r1, 0xC7 + lsls r1, 4 + adds r0, r1 + ldr r1, [r7] + adds r4, r1, r0 + ldrb r0, [r4] + cmp r0, r8 + bne _0808D7F4 + ldrh r0, [r4, 0x14] + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0808D7B4 +_0808D7F4: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r6 + bcc _0808D7D2 +_0808D7FE: + movs r0, 0x10 +_0808D800: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808D77C + + thumb_func_start GetAvailableFieldObjectSlot +@ bool8 GetAvailableFieldObjectSlot(u16 localId, u8 mapId, u8 mapGroupId, u8 *fieldObjectId) +GetAvailableFieldObjectSlot: @ 808D810 + push {r4-r7,lr} + mov r12, r3 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r4, r2, 24 + movs r2, 0 + ldr r1, =0x02037350 + ldrb r0, [r1] + lsls r0, 31 + adds r7, r1, 0 + cmp r0, 0 + beq _0808D864 + adds r3, r1, 0 +_0808D830: + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r3 + ldrb r0, [r1, 0x8] + cmp r0, r6 + bne _0808D84A + ldrb r0, [r1, 0x9] + cmp r0, r5 + bne _0808D84A + ldrb r0, [r1, 0xA] + cmp r0, r4 + beq _0808D868 +_0808D84A: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bhi _0808D868 + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r0, r7 + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + bne _0808D830 +_0808D864: + cmp r2, 0xF + bls _0808D870 +_0808D868: + movs r0, 0x1 + b _0808D8A4 + .pool +_0808D870: + mov r0, r12 + strb r2, [r0] + ldr r1, =0x02037350 +_0808D876: + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r3, r0, r1 + ldrb r0, [r3] + lsls r0, 31 + cmp r0, 0 + beq _0808D898 + ldrb r0, [r3, 0x8] + cmp r0, r6 + bne _0808D898 + ldrb r0, [r3, 0x9] + cmp r0, r5 + bne _0808D898 + ldrb r0, [r3, 0xA] + cmp r0, r4 + beq _0808D868 +_0808D898: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _0808D876 + movs r0, 0 +_0808D8A4: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end GetAvailableFieldObjectSlot + + thumb_func_start RemoveFieldObject +@ void RemoveFieldObject(npc_state *fieldObject) +RemoveFieldObject: @ 808D8B0 + push {lr} + ldrb r2, [r0] + movs r1, 0x2 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + bl RemoveFieldObjectInternal + pop {r0} + bx r0 + thumb_func_end RemoveFieldObject + + thumb_func_start RemoveFieldObjectByLocalIdAndMap +@ void RemoveFieldObjectByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapBank) +RemoveFieldObjectByLocalIdAndMap: @ 808D8C4 + push {lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808D902 + mov r0, sp + ldrb r0, [r0] + bl GetFieldObjectFlagIdByFieldObjectId + lsls r0, 16 + lsrs r0, 16 + bl FlagSet + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + bl RemoveFieldObject +_0808D902: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end RemoveFieldObjectByLocalIdAndMap + + thumb_func_start RemoveFieldObjectInternal +@ void RemoveFieldObjectInternal(npc_state *fieldObject) +RemoveFieldObjectInternal: @ 808D90C + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldrb r0, [r4, 0x5] + bl GetFieldObjectGraphicsInfo + ldrh r2, [r0, 0x6] + ldr r1, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x4] + ldr r2, =0x02020630 + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r2, 0 + adds r1, 0xC + adds r0, r1 + mov r1, sp + str r1, [r0] + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + bl RemoveObjectAndFreeTiles + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end RemoveFieldObjectInternal + + thumb_func_start sub_808D958 +sub_808D958: @ 808D958 + push {r4,lr} + movs r4, 0 +_0808D95C: + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + cmp r4, r0 + beq _0808D972 + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + bl RemoveFieldObject +_0808D972: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _0808D95C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808D958 + + thumb_func_start SpawnFieldObjectInternal +@ u8 SpawnFieldObjectInternal(struct FieldObjectTemplate *romFieldObject, struct objtemplate *template, int mapId, int mapGroupId, u16 movingCameraOffsetX, u16 movingCameraOffsetY) +SpawnFieldObjectInternal: @ 808D98C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r1 + adds r1, r2, 0 + adds r2, r3, 0 + ldr r3, [sp, 0x24] + ldr r4, [sp, 0x28] + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 16 + lsrs r3, 16 + mov r10, r3 + lsls r4, 16 + lsrs r4, 16 + str r4, [sp] + bl InitFieldObjectStateFromTemplate + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + cmp r0, 0x10 + bne _0808D9C8 + movs r0, 0x10 + b _0808DB2C +_0808D9C8: + mov r0, r9 + lsls r4, r0, 3 + adds r0, r4, r0 + lsls r0, 2 + ldr r1, =0x02037350 + adds r6, r0, r1 + ldrb r0, [r6, 0x5] + bl GetFieldObjectGraphicsInfo + adds r7, r0, 0 + ldrb r0, [r7, 0xC] + lsls r0, 28 + lsrs r5, r0, 28 + cmp r5, 0 + bne _0808D9F4 + ldrh r0, [r7, 0x2] + movs r1, 0 + bl npc_load_two_palettes__no_record + b _0808DA16 + .pool +_0808D9F4: + cmp r5, 0xA + bne _0808DA02 + ldrh r0, [r7, 0x2] + movs r1, 0xA + bl npc_load_two_palettes__and_record + b _0808DA16 +_0808DA02: + cmp r5, 0xF + bls _0808DA16 + adds r0, r5, 0 + subs r0, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + ldrh r0, [r7, 0x2] + adds r1, r5, 0 + bl sub_808EAB0 +_0808DA16: + ldrb r0, [r6, 0x6] + cmp r0, 0x4C + bne _0808DA24 + ldrb r0, [r6, 0x1] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r6, 0x1] +_0808DA24: + ldr r1, =0x0000ffff + adds r0, r1, 0 + mov r2, r8 + strh r0, [r2, 0x2] + mov r0, r8 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x40 + bne _0808DA64 + ldr r0, =0x02037350 + mov r2, r9 + adds r1, r4, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + movs r0, 0x10 + b _0808DB2C + .pool +_0808DA64: + mov r1, r8 + lsls r0, r1, 4 + add r0, r8 + lsls r0, 2 + ldr r1, =0x02020630 + adds r4, r0, r1 + mov r2, r10 + lsls r0, r2, 16 + asrs r0, 16 + ldrh r1, [r6, 0x10] + adds r0, r1 + lsls r0, 16 + asrs r0, 16 + ldr r2, [sp] + lsls r1, r2, 16 + asrs r1, 16 + ldrh r2, [r6, 0x12] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + adds r2, r4, 0 + adds r2, 0x20 + adds r3, r4, 0 + adds r3, 0x22 + bl sub_8092FF0 + ldrh r0, [r7, 0x8] + lsls r0, 16 + asrs r0, 17 + negs r0, r0 + adds r1, r4, 0 + adds r1, 0x28 + strb r0, [r1] + ldrh r0, [r7, 0xA] + lsls r0, 16 + asrs r0, 17 + negs r0, r0 + adds r2, r4, 0 + adds r2, 0x29 + strb r0, [r2] + ldrh r0, [r4, 0x20] + adds r0, 0x8 + strh r0, [r4, 0x20] + ldrh r1, [r4, 0x22] + adds r1, 0x10 + movs r0, 0 + ldrsb r0, [r2, r0] + adds r0, r1 + strh r0, [r4, 0x22] + lsls r2, r5, 4 + ldrb r1, [r4, 0x5] + movs r0, 0xF + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x5] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + mov r0, r9 + strh r0, [r4, 0x2E] + mov r1, r8 + strb r1, [r6, 0x4] + ldrb r1, [r7, 0xC] + lsls r1, 25 + lsrs r1, 31 + lsls r1, 4 + ldrb r2, [r6, 0x1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r6, 0x1] + lsls r0, 27 + cmp r0, 0 + blt _0808DB16 + ldrb r0, [r6, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl FieldObjectDirectionToImageAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim +_0808DB16: + ldrb r0, [r6, 0xB] + lsrs r0, 4 + adds r1, r4, 0 + movs r2, 0x1 + bl SetObjectSubpriorityByZCoord + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8096518 + mov r0, r9 +_0808DB2C: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end SpawnFieldObjectInternal + + thumb_func_start SpawnFieldObject +@ u8 SpawnFieldObject(struct FieldObjectTemplate *romNpc, u8 mapId, u8 mapGroupId, u16 movingCameraOffsetX, u16 movingCameraOffsetY) +SpawnFieldObject: @ 808DB40 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x2C + mov r9, r0 + adds r6, r1, 0 + mov r8, r2 + adds r4, r3, 0 + ldr r5, [sp, 0x48] + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + movs r0, 0 + str r0, [sp, 0x20] + mov r1, r9 + ldrb r0, [r1, 0x1] + bl GetFieldObjectGraphicsInfo + adds r7, r0, 0 + add r2, sp, 0x20 + mov r0, r9 + add r1, sp, 0x8 + bl MakeObjectTemplateFromFieldObjectTemplate + ldrh r3, [r7, 0x6] + ldr r2, =0xffff0000 + add r1, sp, 0x24 + ldr r0, [r1, 0x4] + ands r0, r2 + orrs r0, r3 + str r0, [r1, 0x4] + str r1, [sp, 0x14] + lsls r4, 16 + asrs r4, 16 + str r4, [sp] + lsls r5, 16 + asrs r5, 16 + str r5, [sp, 0x4] + mov r0, r9 + add r1, sp, 0x8 + adds r2, r6, 0 + mov r3, r8 + bl SpawnFieldObjectInternal + lsls r0, 24 + lsrs r2, r0, 24 + adds r5, r2, 0 + cmp r2, 0x10 + bne _0808DBBC + movs r0, 0x10 + b _0808DBF2 + .pool +_0808DBBC: + ldr r4, =0x02020630 + ldr r1, =0x02037350 + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r3, r0, r1 + ldrb r1, [r3, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0xC + adds r0, r1 + ldr r1, [r7, 0x1C] + str r1, [r0] + ldr r2, [sp, 0x20] + cmp r2, 0 + beq _0808DBF0 + ldrb r1, [r3, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r1, r2, 0 + bl SetSpriteOamTables_NoPriorityFromTable +_0808DBF0: + adds r0, r5, 0 +_0808DBF2: + add sp, 0x2C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end SpawnFieldObject + + thumb_func_start SpawnSpecialFieldObject +@ u8 SpawnSpecialFieldObject(struct FieldObjectTemplate *romFieldObject) +SpawnSpecialFieldObject: @ 808DC08 + push {r4-r6,lr} + sub sp, 0x8 + adds r5, r0, 0 + mov r4, sp + adds r4, 0x6 + add r0, sp, 0x4 + adds r1, r4, 0 + bl GetFieldObjectMovingCameraOffset + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + add r0, sp, 0x4 + movs r6, 0 + ldrsh r3, [r0, r6] + movs r6, 0 + ldrsh r0, [r4, r6] + str r0, [sp] + adds r0, r5, 0 + bl SpawnFieldObject + lsls r0, 24 + lsrs r0, 24 + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end SpawnSpecialFieldObject + + thumb_func_start SpawnSpecialFieldObjectParametrized +@ u8 SpawnSpecialFieldObjectParametrized(u8 graphicsId, u8 movementBehavior, u8 localId, u16 x, u16 y, u8 z) +SpawnSpecialFieldObjectParametrized: @ 808DC44 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x18 + ldr r4, [sp, 0x2C] + ldr r5, [sp, 0x30] + mov r8, r5 + lsls r0, 24 + lsrs r0, 24 + lsls r3, 16 + ldr r5, =0xfff90000 + adds r3, r5 + lsrs r3, 16 + lsls r4, 16 + adds r4, r5 + lsrs r4, 16 + mov r5, sp + movs r6, 0 + strb r2, [r5] + mov r2, sp + strb r0, [r2, 0x1] + mov r0, sp + strb r6, [r0, 0x2] + movs r5, 0 + strh r3, [r0, 0x4] + strh r4, [r0, 0x6] + mov r2, r8 + strb r2, [r0, 0x8] + strb r1, [r0, 0x9] + mov r2, sp + ldrb r1, [r2, 0xA] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0xA] + mov r0, sp + strb r5, [r0, 0xA] + strh r6, [r0, 0xC] + strh r6, [r0, 0xE] + bl SpawnSpecialFieldObject + lsls r0, 24 + lsrs r0, 24 + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end SpawnSpecialFieldObjectParametrized + + thumb_func_start show_sprite +show_sprite: @ 808DCAC + push {r4-r7,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + adds r1, r7, 0 + adds r2, r6, 0 + bl GetFieldObjectTemplateByLocalIdAndMap + adds r5, r0, 0 + cmp r5, 0 + beq _0808DCF2 + mov r4, sp + adds r4, 0x6 + add r0, sp, 0x4 + adds r1, r4, 0 + bl GetFieldObjectMovingCameraOffset + add r0, sp, 0x4 + movs r1, 0 + ldrsh r3, [r0, r1] + movs r1, 0 + ldrsh r0, [r4, r1] + str r0, [sp] + adds r0, r5, 0 + adds r1, r7, 0 + adds r2, r6, 0 + bl SpawnFieldObject + lsls r0, 24 + lsrs r0, 24 + b _0808DCF4 +_0808DCF2: + movs r0, 0x10 +_0808DCF4: + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end show_sprite + + thumb_func_start MakeObjectTemplateFromFieldObjectGraphicsInfo +@ void MakeObjectTemplateFromFieldObjectGraphicsInfo(u8 graphicsId, void ( *callback)(), struct objtemplate *objectTemplate, SpriteOamTable **spriteOamTables) +MakeObjectTemplateFromFieldObjectGraphicsInfo: @ 808DCFC + push {r4-r6,lr} + adds r5, r1, 0 + adds r4, r2, 0 + adds r6, r3, 0 + lsls r0, 24 + lsrs r0, 24 + bl GetFieldObjectGraphicsInfo + ldrh r1, [r0] + strh r1, [r4] + ldrh r1, [r0, 0x2] + strh r1, [r4, 0x2] + ldr r1, [r0, 0x10] + str r1, [r4, 0x4] + ldr r1, [r0, 0x18] + str r1, [r4, 0x8] + ldr r1, [r0, 0x1C] + str r1, [r4, 0xC] + ldr r1, [r0, 0x20] + str r1, [r4, 0x10] + str r5, [r4, 0x14] + ldr r0, [r0, 0x14] + str r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end MakeObjectTemplateFromFieldObjectGraphicsInfo + + thumb_func_start MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex +@ void MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex(u16 graphicsId, u16 callbackIndex, struct objtemplate *objectTemplate, SpriteOamTable **spriteOamTables) +MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex: @ 808DD30 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + ldr r4, =gUnknown_08505438 + lsrs r1, 14 + adds r1, r4 + ldr r1, [r1] + bl MakeObjectTemplateFromFieldObjectGraphicsInfo + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex + + thumb_func_start MakeObjectTemplateFromFieldObjectTemplate +@ void MakeObjectTemplateFromFieldObjectTemplate(struct FieldObjectTemplate *fieldObjectTemplate, struct objtemplate *objectTemplate, SpriteOamTable **spriteOamTables) +MakeObjectTemplateFromFieldObjectTemplate: @ 808DD50 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r3, r2, 0 + ldrb r0, [r4, 0x1] + ldrb r1, [r4, 0x9] + adds r2, r5, 0 + bl MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end MakeObjectTemplateFromFieldObjectTemplate + + thumb_func_start AddPseudoFieldObject +@ void AddPseudoFieldObject(u8 graphicsId, void ( *callback)(), u16 x, u16 y, u8 subpriority) +AddPseudoFieldObject: @ 808DD68 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, [sp, 0x20] + lsls r4, 16 + lsrs r4, 16 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + lsls r3, 16 + lsrs r7, r3, 16 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r0, 0x18 + bl Alloc + adds r6, r0, 0 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + mov r3, sp + bl MakeObjectTemplateFromFieldObjectGraphicsInfo + ldrh r1, [r6, 0x2] + ldr r0, =0x0000ffff + cmp r1, r0 + beq _0808DDAE + adds r0, r1, 0 + bl sub_808E894 +_0808DDAE: + mov r0, r8 + lsls r1, r0, 16 + asrs r1, 16 + lsls r2, r7, 16 + asrs r2, 16 + adds r0, r6, 0 + mov r3, r9 + bl AddObjectToFront + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r6, 0 + bl Free + cmp r5, 0x40 + beq _0808DDF2 + ldr r1, [sp] + cmp r1, 0 + beq _0808DDF2 + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + adds r0, r4, 0 + bl SetSpriteOamTables_NoPriorityFromTable + adds r4, 0x42 + ldrb r1, [r4] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r4] +_0808DDF2: + adds r0, r5, 0 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end AddPseudoFieldObject + + thumb_func_start sprite_new +sprite_new: @ 808DE0C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + adds r5, r0, 0 + ldr r0, [sp, 0x40] + ldr r4, [sp, 0x44] + lsls r5, 24 + lsrs r5, 24 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + add r1, sp, 0x18 + mov r8, r1 + strh r2, [r1] + mov r6, sp + adds r6, 0x1A + strh r3, [r6] + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, 24 + lsrs r4, 24 + mov r10, r4 + adds r0, r5, 0 + bl GetFieldObjectGraphicsInfo + adds r4, r0, 0 + ldr r1, =sub_8097AC8 + add r3, sp, 0x1C + adds r0, r5, 0 + mov r2, sp + bl MakeObjectTemplateFromFieldObjectGraphicsInfo + mov r1, sp + ldr r2, =0x0000ffff + adds r0, r2, 0 + strh r0, [r1, 0x2] + mov r1, r8 + movs r2, 0 + ldrsh r0, [r1, r2] + adds r0, 0x7 + strh r0, [r1] + movs r1, 0 + ldrsh r0, [r6, r1] + adds r0, 0x7 + strh r0, [r6] + mov r0, r8 + adds r1, r6, 0 + movs r2, 0x8 + movs r3, 0x10 + bl sub_80930E0 + mov r2, r8 + movs r0, 0 + ldrsh r1, [r2, r0] + movs r0, 0 + ldrsh r2, [r6, r0] + mov r0, sp + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _0808DF6C + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + ldr r1, =0x02020630 + adds r5, r0, r1 + ldrh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 17 + negs r0, r0 + adds r1, r5, 0 + adds r1, 0x28 + strb r0, [r1] + ldrh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 17 + negs r0, r0 + adds r1, 0x1 + strb r0, [r1] + movs r0, 0 + ldrsb r0, [r1, r0] + ldrh r1, [r5, 0x22] + adds r0, r1 + strh r0, [r5, 0x22] + ldrb r0, [r4, 0xC] + lsls r0, 28 + lsrs r0, 24 + ldrb r1, [r5, 0x5] + movs r3, 0xF + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + strb r2, [r5, 0x5] + lsls r1, r2, 24 + lsrs r0, r1, 28 + cmp r0, 0xF + bls _0808DEE4 + subs r0, 0x10 + lsls r0, 4 + ands r2, r3 + orrs r2, r0 + strb r2, [r5, 0x5] +_0808DEE4: + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + mov r2, r9 + strh r2, [r5, 0x2E] + strh r7, [r5, 0x30] + ldrb r1, [r4, 0xC] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0xA + bne _0808DF18 + ldrh r0, [r4, 0x2] + lsls r1, 28 + lsrs r1, 28 + bl npc_load_two_palettes__and_record + b _0808DF2C + .pool +_0808DF18: + lsls r1, 28 + lsrs r0, r1, 28 + cmp r0, 0xF + bls _0808DF2C + ldrh r0, [r4, 0x2] + lsrs r2, r1, 28 + movs r1, 0xF0 + orrs r1, r2 + bl sub_808EAB0 +_0808DF2C: + ldr r1, [sp, 0x1C] + cmp r1, 0 + beq _0808DF48 + adds r0, r5, 0 + bl SetSpriteOamTables_NoPriorityFromTable + adds r2, r5, 0 + adds r2, 0x42 + ldrb r0, [r2] + movs r1, 0x3F + ands r1, r0 + movs r0, 0x80 + orrs r1, r0 + strb r1, [r2] +_0808DF48: + adds r0, r5, 0 + adds r1, r7, 0 + bl InitObjectPriorityByZCoord + adds r0, r7, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl SetObjectSubpriorityByZCoord + mov r0, r10 + bl FieldObjectDirectionToImageAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl StartObjectImageAnim +_0808DF6C: + adds r0, r6, 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 sprite_new + + thumb_func_start SpawnFieldObjectsInView +@ void SpawnFieldObjectsInView(u16 movingCameraOffsetX, u16 movingCameraOffsetY) +SpawnFieldObjectsInView: @ 808DF80 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x4] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x8] + ldr r5, =0x02037318 + ldr r0, [r5, 0x4] + cmp r0, 0 + beq _0808E078 + ldr r0, =0x03005d8c + ldr r2, [r0] + ldrh r1, [r2] + subs r0, r1, 0x2 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r1, 0x11 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0xC] + ldrh r4, [r2, 0x2] + adds r0, r4, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _0808DFE0 + bl sub_81AAA40 + lsls r0, 24 + lsrs r6, r0, 24 + b _0808DFF0 + .pool +_0808DFE0: + bl InTrainerHill + cmp r0, 0 + beq _0808DFEC + movs r6, 0x2 + b _0808DFF0 +_0808DFEC: + ldr r0, [r5, 0x4] + ldrb r6, [r0] +_0808DFF0: + movs r5, 0 + cmp r5, r6 + bcs _0808E078 + lsls r0, r4, 16 + asrs r0, 16 + mov r9, r0 + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + mov r8, r0 +_0808E004: + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 3 + movs r2, 0xC7 + lsls r2, 4 + adds r0, r2 + ldr r3, =0x03005d8c + ldr r1, [r3] + adds r4, r1, r0 + ldrh r0, [r4, 0x4] + adds r0, 0x7 + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r0, [r4, 0x6] + adds r0, 0x7 + lsls r0, 16 + asrs r1, r0, 16 + cmp r9, r1 + bgt _0808E06E + mov r7, r10 + lsls r0, r7, 16 + asrs r0, 16 + cmp r0, r1 + blt _0808E06E + lsls r0, r2, 16 + asrs r1, r0, 16 + cmp r8, r1 + bgt _0808E06E + ldr r2, [sp, 0xC] + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, r1 + blt _0808E06E + ldrh r0, [r4, 0x14] + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _0808E06E + ldr r3, =0x03005d8c + ldr r0, [r3] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + ldr r7, [sp, 0x4] + lsls r3, r7, 16 + ldr r7, [sp, 0x8] + lsls r0, r7, 16 + asrs r0, 16 + str r0, [sp] + adds r0, r4, 0 + asrs r3, 16 + bl SpawnFieldObject +_0808E06E: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r6 + bcc _0808E004 +_0808E078: + 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 SpawnFieldObjectsInView + + thumb_func_start RemoveFieldObjectsOutsideView +@ void RemoveFieldObjectsOutsideView() +RemoveFieldObjectsOutsideView: @ 808E08C + push {r4-r6,lr} + movs r3, 0 + ldr r6, =0x02032308 +_0808E092: + movs r2, 0 + movs r4, 0 + adds r5, r3, 0x1 +_0808E098: + lsls r0, r2, 2 + adds r1, r0, r6 + ldrb r0, [r1] + cmp r0, 0 + beq _0808E0AA + ldrb r1, [r1, 0x2] + cmp r3, r1 + bne _0808E0AA + movs r4, 0x1 +_0808E0AA: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _0808E098 + cmp r4, 0 + bne _0808E0D2 + lsls r0, r3, 3 + adds r0, r3 + lsls r0, 2 + ldr r1, =0x02037350 + adds r2, r0, r1 + ldr r0, [r2] + ldr r1, =0x00010001 + ands r0, r1 + cmp r0, 0x1 + bne _0808E0D2 + adds r0, r2, 0 + bl RemoveFieldObjectIfOutsideView +_0808E0D2: + lsls r0, r5, 24 + lsrs r3, r0, 24 + cmp r3, 0xF + bls _0808E092 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end RemoveFieldObjectsOutsideView + + thumb_func_start RemoveFieldObjectIfOutsideView +@ void RemoveFieldObjectIfOutsideView(npc_state *fieldObject) +RemoveFieldObjectIfOutsideView: @ 808E0EC + push {r4-r7,lr} + adds r3, r0, 0 + ldr r0, =0x03005d8c + ldr r2, [r0] + ldrh r0, [r2] + subs r1, r0, 0x2 + lsls r1, 16 + adds r0, 0x11 + lsls r0, 16 + lsrs r5, r0, 16 + ldrh r4, [r2, 0x2] + adds r0, r4, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r6, r0, 16 + movs r0, 0x10 + ldrsh r2, [r3, r0] + lsrs r7, r1, 16 + asrs r1, 16 + cmp r2, r1 + blt _0808E132 + lsls r0, r5, 16 + asrs r0, 16 + cmp r2, r0 + bgt _0808E132 + movs r0, 0x12 + ldrsh r1, [r3, r0] + lsls r0, r4, 16 + asrs r0, 16 + cmp r1, r0 + blt _0808E132 + lsls r0, r6, 16 + asrs r0, 16 + cmp r1, r0 + ble _0808E160 +_0808E132: + movs r0, 0xC + ldrsh r1, [r3, r0] + lsls r0, r7, 16 + asrs r0, 16 + cmp r1, r0 + blt _0808E15A + lsls r0, r5, 16 + asrs r0, 16 + cmp r1, r0 + bgt _0808E15A + movs r0, 0xE + ldrsh r1, [r3, r0] + lsls r0, r4, 16 + asrs r0, 16 + cmp r1, r0 + blt _0808E15A + lsls r0, r6, 16 + asrs r0, 16 + cmp r1, r0 + ble _0808E160 +_0808E15A: + adds r0, r3, 0 + bl RemoveFieldObject +_0808E160: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end RemoveFieldObjectIfOutsideView + + thumb_func_start sub_808E16C +sub_808E16C: @ 808E16C + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + bl ClearPlayerAvatarInfo + movs r6, 0 + ldr r7, =0x02037350 + lsls r4, 16 + lsls r5, 16 +_0808E186: + lsls r0, r6, 3 + adds r0, r6 + lsls r0, 2 + adds r0, r7 + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + beq _0808E1A0 + adds r0, r6, 0 + asrs r1, r4, 16 + asrs r2, r5, 16 + bl sub_808E1B8 +_0808E1A0: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0xF + bls _0808E186 + bl sub_808D450 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808E16C + + thumb_func_start sub_808E1B8 +sub_808E1B8: @ 808E1B8 + 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 r9, r0 + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0x24] + movs r7, 0 + ldr r2, =0x02032308 +_0808E1DA: + lsls r0, r7, 2 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _0808E1EC + ldrb r1, [r1, 0x2] + cmp r9, r1 + bne _0808E1EC + b _0808E374 +_0808E1EC: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x3 + bls _0808E1DA + mov r1, r9 + lsls r0, r1, 3 + add r0, r9 + lsls r0, 2 + ldr r1, =0x02037350 + adds r6, r0, r1 + movs r0, 0 + str r0, [sp, 0x20] + ldrb r0, [r6, 0x5] + bl GetFieldObjectGraphicsInfo + adds r5, r0, 0 + ldrh r2, [r5, 0x6] + ldr r1, =0xffff0000 + add r4, sp, 0x18 + ldr r0, [r4, 0x4] + ands r0, r1 + orrs r0, r2 + str r0, [r4, 0x4] + ldrb r0, [r6, 0x5] + ldrb r1, [r6, 0x6] + add r3, sp, 0x20 + mov r2, sp + bl MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex + str r4, [sp, 0xC] + mov r1, sp + ldr r2, =0x0000ffff + adds r0, r2, 0 + strh r0, [r1, 0x2] + ldrb r0, [r5, 0xC] + lsls r1, r0, 28 + lsrs r0, r1, 28 + mov r8, r0 + cmp r0, 0 + bne _0808E258 + ldrh r0, [r5, 0x2] + lsrs r1, 28 + bl npc_load_two_palettes__no_record + b _0808E27E + .pool +_0808E258: + mov r2, r8 + cmp r2, 0xA + bne _0808E268 + ldrh r0, [r5, 0x2] + lsrs r1, 28 + bl npc_load_two_palettes__and_record + b _0808E27E +_0808E268: + mov r0, r8 + cmp r0, 0xF + bls _0808E27E + subs r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrh r0, [r5, 0x2] + mov r1, r8 + bl sub_808EAB0 +_0808E27E: + mov r1, sp + ldr r2, =0x0000ffff + adds r0, r2, 0 + strh r0, [r1, 0x2] + mov r0, sp + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x40 + beq _0808E374 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, =0x02020630 + adds r4, r0, r1 + mov r1, r10 + lsls r0, r1, 16 + asrs r0, 16 + ldrh r2, [r6, 0x10] + adds r0, r2 + lsls r0, 16 + asrs r0, 16 + ldr r2, [sp, 0x24] + lsls r1, r2, 16 + asrs r1, 16 + ldrh r2, [r6, 0x12] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + adds r2, r4, 0 + adds r2, 0x20 + adds r3, r4, 0 + adds r3, 0x22 + bl sub_8092FF0 + ldrh r0, [r5, 0x8] + lsls r0, 16 + asrs r0, 17 + negs r0, r0 + adds r1, r4, 0 + adds r1, 0x28 + strb r0, [r1] + ldrh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 17 + negs r0, r0 + adds r2, r4, 0 + adds r2, 0x29 + strb r0, [r2] + ldrh r0, [r4, 0x20] + adds r0, 0x8 + strh r0, [r4, 0x20] + ldrh r1, [r4, 0x22] + adds r1, 0x10 + movs r0, 0 + ldrsb r0, [r2, r0] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r0, [r5, 0x1C] + str r0, [r4, 0xC] + ldrb r0, [r6, 0x6] + cmp r0, 0xB + bne _0808E312 + mov r0, r9 + adds r1, r7, 0 + bl SetPlayerAvatarFieldObjectIdAndObjectId + bl sub_8154228 + strb r0, [r6, 0x1B] +_0808E312: + ldr r1, [sp, 0x20] + cmp r1, 0 + beq _0808E31E + adds r0, r4, 0 + bl SetSpriteOamTables_NoPriorityFromTable +_0808E31E: + mov r0, r8 + lsls r2, r0, 4 + ldrb r1, [r4, 0x5] + movs r0, 0xF + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x5] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + mov r1, r9 + strh r1, [r4, 0x2E] + strb r7, [r6, 0x4] + ldrb r0, [r6, 0x1] + lsls r0, 27 + cmp r0, 0 + blt _0808E362 + ldrb r0, [r6, 0x6] + cmp r0, 0xB + beq _0808E362 + ldrb r0, [r6, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl FieldObjectDirectionToImageAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim +_0808E362: + adds r0, r6, 0 + bl sub_808E38C + ldrb r0, [r6, 0xB] + lsrs r0, 4 + adds r1, r4, 0 + movs r2, 0x1 + bl SetObjectSubpriorityByZCoord +_0808E374: + 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_808E1B8 + + thumb_func_start sub_808E38C +@ void sub_808E38C(struct npc_state *fieldObject) +sub_808E38C: @ 808E38C + push {lr} + ldrb r2, [r0] + movs r3, 0x3 + negs r3, r3 + adds r1, r3, 0 + ands r1, r2 + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldrb r2, [r0, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r2 + ands r1, r3 + movs r2, 0x5 + negs r2, r2 + ands r1, r2 + subs r2, 0x4 + ands r1, r2 + subs r2, 0x8 + ands r1, r2 + subs r2, 0x10 + ands r1, r2 + strb r1, [r0, 0x2] + bl FieldObjectClearAnim + pop {r0} + bx r0 + thumb_func_end sub_808E38C + + thumb_func_start SetPlayerAvatarFieldObjectIdAndObjectId +@ void SetPlayerAvatarFieldObjectIdAndObjectId(u8 fieldObjectId, u8 objectId) +SetPlayerAvatarFieldObjectIdAndObjectId: @ 808E3C4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =0x02037590 + strb r0, [r5, 0x5] + strb r1, [r5, 0x4] + ldr r1, =0x02037350 + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + adds r4, r1 + ldrb r0, [r4, 0x5] + bl GetPlayerAvatarGenderByGraphicsId + strb r0, [r5, 0x7] + ldrb r0, [r4, 0x5] + movs r1, 0x20 + bl SetPlayerAvatarExtraStateTransition + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end SetPlayerAvatarFieldObjectIdAndObjectId + + thumb_func_start FieldObjectSetGraphicsId +@ void FieldObjectSetGraphicsId(npc_state *npcState, u8 graphicsId) +FieldObjectSetGraphicsId: @ 808E3F8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + mov r0, r8 + bl GetFieldObjectGraphicsInfo + adds r6, r0, 0 + ldrb r1, [r7, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r4, r0, r1 + ldrb r0, [r6, 0xC] + lsls r1, r0, 28 + lsrs r5, r1, 28 + cmp r5, 0 + bne _0808E434 + ldrh r0, [r6, 0x2] + adds r1, r5, 0 + bl pal_patch_for_npc + b _0808E456 + .pool +_0808E434: + cmp r5, 0xA + bne _0808E442 + ldrh r0, [r6, 0x2] + lsrs r1, 28 + bl npc_load_two_palettes__and_record + b _0808E456 +_0808E442: + cmp r5, 0xF + bls _0808E456 + adds r0, r5, 0 + subs r0, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + ldrh r0, [r6, 0x2] + adds r1, r5, 0 + bl sub_808EAB0 +_0808E456: + ldr r0, [r6, 0x10] + ldrb r2, [r0, 0x1] + lsrs r2, 6 + lsls r2, 6 + ldrb r3, [r4, 0x1] + movs r1, 0x3F + adds r0, r1, 0 + ands r0, r3 + orrs r0, r2 + strb r0, [r4, 0x1] + ldr r0, [r6, 0x10] + ldrb r0, [r0, 0x3] + lsrs r0, 6 + lsls r0, 6 + ldrb r2, [r4, 0x3] + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x3] + ldr r0, [r6, 0x1C] + str r0, [r4, 0xC] + ldr r0, [r6, 0x18] + str r0, [r4, 0x8] + ldr r0, [r6, 0x14] + str r0, [r4, 0x18] + lsls r2, r5, 4 + ldrb r1, [r4, 0x5] + movs r0, 0xF + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x5] + ldrb r1, [r6, 0xC] + lsls r1, 25 + lsrs r1, 31 + lsls r1, 4 + ldrb r2, [r7, 0x1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r7, 0x1] + mov r0, r8 + strb r0, [r7, 0x5] + movs r1, 0x10 + ldrsh r0, [r7, r1] + movs r2, 0x12 + ldrsh r1, [r7, r2] + adds r2, r4, 0 + adds r2, 0x20 + adds r3, r4, 0 + adds r3, 0x22 + bl sub_8093038 + ldrh r0, [r6, 0x8] + lsls r0, 16 + asrs r0, 17 + negs r0, r0 + adds r1, r4, 0 + adds r1, 0x28 + strb r0, [r1] + ldrh r0, [r6, 0xA] + lsls r0, 16 + asrs r0, 17 + negs r0, r0 + adds r2, r4, 0 + adds r2, 0x29 + strb r0, [r2] + ldrh r0, [r4, 0x20] + adds r0, 0x8 + strh r0, [r4, 0x20] + ldrh r1, [r4, 0x22] + adds r1, 0x10 + movs r0, 0 + ldrsb r0, [r2, r0] + adds r0, r1 + strh r0, [r4, 0x22] + ldrb r0, [r7, 0x1] + lsrs r0, 7 + cmp r0, 0 + beq _0808E4F8 + bl CameraObjectReset1 +_0808E4F8: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end FieldObjectSetGraphicsId + + thumb_func_start sub_808E504 +sub_808E504: @ 808E504 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r4, r3, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808E538 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + adds r1, r4, 0 + bl FieldObjectSetGraphicsId +_0808E538: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808E504 + + thumb_func_start FieldObjectTurn +@ void FieldObjectTurn(struct npc_state *fieldObject, u8 direction) +FieldObjectTurn: @ 808E544 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + bl FieldObjectSetDirection + ldrb r0, [r6, 0x1] + lsls r0, 27 + cmp r0, 0 + blt _0808E58A + ldrb r0, [r6, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r5, =0x02020630 + adds r4, r5 + ldrb r0, [r6, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl FieldObjectDirectionToImageAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + ldrb r1, [r6, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0 + bl SeekObjectImageAnim +_0808E58A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectTurn + + thumb_func_start FieldObjectTurnByLocalIdAndMap +@ void FieldObjectTurnByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) +FieldObjectTurnByLocalIdAndMap: @ 808E594 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r4, r3, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808E5C8 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + adds r1, r4, 0 + bl FieldObjectTurn +_0808E5C8: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectTurnByLocalIdAndMap + + thumb_func_start sub_808E5D4 +sub_808E5D4: @ 808E5D4 + push {lr} + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r0, 0x5] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + bl FieldObjectTurn + pop {r0} + bx r0 + .pool + thumb_func_end sub_808E5D4 + + thumb_func_start get_berry_tree_graphics +@ void get_berry_tree_graphics(npc_state *npcState, struct obj *obj) +get_berry_tree_graphics: @ 808E5F4 + push {r4-r7,lr} + adds r5, r0, 0 + adds r7, r1, 0 + ldrb r0, [r5, 0x1] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r5, 0x1] + adds r4, r7, 0 + adds r4, 0x3E + ldrb r0, [r4] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] + ldrb r0, [r5, 0x1D] + bl GetStageByBerryTreeId + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + beq _0808E680 + ldrb r1, [r5, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r5, 0x1] + ldrb r1, [r4] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r4] + ldrb r0, [r5, 0x1D] + bl GetBerryTypeByBerryTreeId + subs r0, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + subs r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r4, 0x2B + bls _0808E648 + movs r4, 0 +_0808E648: + ldr r0, =gBerryTreeFieldObjectGraphicsIdTablePointers + lsls r4, 2 + adds r0, r4, r0 + ldr r0, [r0] + adds r0, r6 + ldrb r1, [r0] + adds r0, r5, 0 + bl FieldObjectSetGraphicsId + ldr r0, =gBerryTreePicTablePointers + adds r0, r4, r0 + ldr r0, [r0] + str r0, [r7, 0xC] + ldr r0, =gBerryTreePaletteSlotTablePointers + adds r4, r0 + ldr r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r1, 4 + ldrb r2, [r7, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r1 + strb r0, [r7, 0x5] + adds r0, r7, 0 + adds r1, r6, 0 + bl StartObjectImageAnim +_0808E680: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end get_berry_tree_graphics + + thumb_func_start GetFieldObjectGraphicsInfo +@ FieldObjectGraphicsInfo *GetFieldObjectGraphicsInfo(u8 graphicsId) +GetFieldObjectGraphicsInfo: @ 808E694 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xEF + bls _0808E6AC + adds r0, r1, 0 + adds r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + bl VarGetFieldObjectGraphicsId + adds r1, r0, 0 +_0808E6AC: + cmp r1, 0x45 + bne _0808E6C4 + bl sub_81201C8 + lsls r0, 24 + ldr r1, =gMauvilleOldManGraphicsInfoPointers + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + b _0808E6D2 + .pool +_0808E6C4: + cmp r1, 0xEE + bls _0808E6CA + movs r1, 0x5 +_0808E6CA: + ldr r0, =gFieldObjectGraphicsInfoPointers + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] +_0808E6D2: + pop {r1} + bx r1 + .pool + thumb_func_end GetFieldObjectGraphicsInfo + + thumb_func_start FieldObjectHandleDynamicGraphicsId +@ void FieldObjectHandleDynamicGraphicsId(struct npc_state *fieldObject) +FieldObjectHandleDynamicGraphicsId: @ 808E6DC + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x5] + cmp r0, 0xEF + bls _0808E6F2 + adds r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + bl VarGetFieldObjectGraphicsId + strb r0, [r4, 0x5] +_0808E6F2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end FieldObjectHandleDynamicGraphicsId + + thumb_func_start npc_by_local_id_and_map_set_field_1_bit_x20 +npc_by_local_id_and_map_set_field_1_bit_x20: @ 808E6F8 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r4, r3, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808E73A + ldr r2, =0x02037350 + mov r0, sp + ldrb r0, [r0] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x1 + adds r2, r4, 0 + ands r2, r0 + lsls r2, 5 + ldrb r3, [r1, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x1] +_0808E73A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end npc_by_local_id_and_map_set_field_1_bit_x20 + + thumb_func_start FieldObjectGetLocalIdAndMap +@ void FieldObjectGetLocalIdAndMap(struct npc_state *fieldObject, u8 *localId, u8 *mapId, u8 *mapGroupId) +FieldObjectGetLocalIdAndMap: @ 808E748 + push {r4,lr} + ldrb r4, [r0, 0x8] + strb r4, [r1] + ldrb r1, [r0, 0x9] + strb r1, [r2] + ldrb r0, [r0, 0xA] + strb r0, [r3] + pop {r4} + pop {r0} + bx r0 + thumb_func_end FieldObjectGetLocalIdAndMap + + thumb_func_start sub_808E75C +sub_808E75C: @ 808E75C + push {lr} + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl GetFieldObjectIdByXY + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x10 + beq _0808E784 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_0808E784: + pop {r0} + bx r0 + .pool + thumb_func_end sub_808E75C + + thumb_func_start sub_808E78C +sub_808E78C: @ 808E78C + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r4, r3, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808E7D2 + mov r0, sp + ldrb r0, [r0] + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x02037350 + adds r2, r0 + ldrb r1, [r2, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + ldrb r1, [r2, 0x3] + movs r3, 0x4 + orrs r1, r3 + strb r1, [r2, 0x3] + adds r0, 0x43 + strb r4, [r0] +_0808E7D2: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808E78C + + thumb_func_start sub_808E7E4 +sub_808E7E4: @ 808E7E4 + push {lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808E820 + mov r0, sp + ldrb r0, [r0] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02037350 + adds r1, r0 + ldrb r2, [r1, 0x3] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x3] + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] +_0808E820: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_808E7E4 + + thumb_func_start sub_808E82C +sub_808E82C: @ 808E82C + push {r4,r5,lr} + sub sp, 0x4 + ldr r4, [sp, 0x10] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 16 + lsrs r5, r3, 16 + lsls r4, 16 + lsrs r4, 16 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808E870 + ldr r2, =0x02037350 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + strh r5, [r0, 0x24] + strh r4, [r0, 0x26] +_0808E870: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808E82C + + thumb_func_start gpu_pal_allocator_reset__manage_upper_four +gpu_pal_allocator_reset__manage_upper_four: @ 808E880 + push {lr} + bl ResetObjectPaletteAllocator + ldr r1, =0x0300301c + movs r0, 0xC + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end gpu_pal_allocator_reset__manage_upper_four + + thumb_func_start sub_808E894 +sub_808E894: @ 808E894 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl FindFieldObjectPaletteIndexByTag + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, =0x000011ff + cmp r1, r0 + beq _0808E8B2 + lsls r0, r1, 3 + ldr r1, =gUnknown_0850BBC8 + adds r0, r1 + bl sub_808E8F4 +_0808E8B2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_808E894 + + thumb_func_start sub_808E8C0 +sub_808E8C0: @ 808E8C0 + push {r4-r6,lr} + adds r5, r0, 0 + movs r4, 0 + ldrh r0, [r5] + ldr r1, =0x000011ff + cmp r0, r1 + beq _0808E8EA + adds r6, r1, 0 +_0808E8D0: + lsls r0, r4, 1 + adds r0, r5 + ldrh r0, [r0] + bl sub_808E894 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 1 + adds r0, r5 + ldrh r0, [r0] + cmp r0, r6 + bne _0808E8D0 +_0808E8EA: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808E8C0 + + thumb_func_start sub_808E8F4 +@ u8 sub_808E8F4(struct TaggedObjectPalette *taggedPalette) +sub_808E8F4: @ 808E8F4 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x4] + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _0808E912 + adds r0, r4, 0 + bl LoadTaggedObjectPalette + lsls r0, 24 + lsrs r0, 24 + b _0808E914 +_0808E912: + movs r0, 0xFF +_0808E914: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808E8F4 + + thumb_func_start pal_patch_for_npc +@ void pal_patch_for_npc(u16 tag, u8 slot) +pal_patch_for_npc: @ 808E91C + push {r4,lr} + adds r4, r1, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 24 + lsrs r4, 24 + bl FindFieldObjectPaletteIndexByTag + lsls r0, 24 + ldr r1, =gUnknown_0850BBC8 + lsrs r0, 21 + adds r0, r1 + ldr r0, [r0] + lsls r4, 20 + movs r1, 0x80 + lsls r1, 17 + adds r4, r1 + lsrs r4, 16 + adds r1, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pal_patch_for_npc + + thumb_func_start pal_patch_for_npc_range +@ void pal_patch_for_npc_range(u16 *tags, u8 minSlot, u8 maxSlot) +pal_patch_for_npc_range: @ 808E954 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + cmp r4, r6 + bcs _0808E978 +_0808E964: + ldrh r0, [r5] + adds r1, r4, 0 + bl pal_patch_for_npc + adds r5, 0x2 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r6 + bcc _0808E964 +_0808E978: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end pal_patch_for_npc_range + + thumb_func_start FindFieldObjectPaletteIndexByTag +@ u8 FindFieldObjectPaletteIndexByTag(u16 tag) +FindFieldObjectPaletteIndexByTag: @ 808E980 + push {r4-r6,lr} + lsls r0, 16 + lsrs r5, r0, 16 + movs r2, 0 + ldr r0, =gUnknown_0850BBC8 + ldrh r1, [r0, 0x4] + ldr r3, =0x000011ff + adds r4, r0, 0 + cmp r1, r3 + beq _0808E9C0 + adds r6, r4, 0 + adds r1, r3, 0 +_0808E998: + lsls r0, r2, 3 + adds r0, r6 + ldrh r0, [r0, 0x4] + cmp r0, r5 + bne _0808E9B0 + adds r0, r2, 0 + b _0808E9C2 + .pool +_0808E9B0: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 3 + adds r0, r4 + ldrh r0, [r0, 0x4] + cmp r0, r1 + bne _0808E998 +_0808E9C0: + movs r0, 0xFF +_0808E9C2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end FindFieldObjectPaletteIndexByTag + + thumb_func_start npc_load_two_palettes__no_record +@ void npc_load_two_palettes__no_record(u16 tag, u8 slot) +npc_load_two_palettes__no_record: @ 808E9C8 + push {r4-r6,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 24 + lsrs r5, r1, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl pal_patch_for_npc + movs r3, 0 + ldr r1, =gUnknown_0850BD00 + ldrh r0, [r1] + ldr r2, =0x000011ff + cmp r0, r2 + beq _0808EA30 + ldr r0, =gUnknown_084975C4 + adds r5, r0 + adds r6, r2, 0 +_0808E9EC: + lsls r2, r3, 3 + adds r0, r2, r1 + ldrh r0, [r0] + cmp r0, r4 + bne _0808EA20 + adds r1, 0x4 + adds r1, r2, r1 + ldr r0, =0x020375b4 + ldrb r0, [r0] + ldr r1, [r1] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + ldrb r1, [r5] + bl pal_patch_for_npc + b _0808EA30 + .pool +_0808EA20: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 3 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r6 + bne _0808E9EC +_0808EA30: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end npc_load_two_palettes__no_record + + thumb_func_start npc_load_two_palettes__and_record +@ void npc_load_two_palettes__and_record(u16 tag, u8 slot) +npc_load_two_palettes__and_record: @ 808EA38 + push {r4-r6,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, =0x020375b6 + strh r4, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl pal_patch_for_npc + movs r3, 0 + ldr r1, =gUnknown_0850BD78 + ldrh r0, [r1] + ldr r2, =0x000011ff + cmp r0, r2 + beq _0808EAA8 + ldr r0, =gUnknown_084975C4 + adds r5, r0 + adds r6, r2, 0 +_0808EA60: + lsls r2, r3, 3 + adds r0, r2, r1 + ldrh r0, [r0] + cmp r0, r4 + bne _0808EA98 + adds r1, 0x4 + adds r1, r2, r1 + ldr r0, =0x020375b4 + ldrb r0, [r0] + ldr r1, [r1] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + ldrb r1, [r5] + bl pal_patch_for_npc + b _0808EAA8 + .pool +_0808EA98: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 3 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r6 + bne _0808EA60 +_0808EAA8: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end npc_load_two_palettes__and_record + + thumb_func_start sub_808EAB0 +sub_808EAB0: @ 808EAB0 + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 24 + lsrs r1, 24 + bl pal_patch_for_npc + pop {r0} + bx r0 + thumb_func_end sub_808EAB0 + + thumb_func_start sub_808EAC4 +sub_808EAC4: @ 808EAC4 + push {r4,lr} + ldrh r3, [r0, 0x10] + strh r3, [r0, 0x14] + ldrh r4, [r0, 0x12] + strh r4, [r0, 0x16] + lsls r1, 16 + asrs r1, 16 + adds r1, r3 + strh r1, [r0, 0x10] + lsls r2, 16 + asrs r2, 16 + adds r2, r4 + strh r2, [r0, 0x12] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808EAC4 + + thumb_func_start npc_coords_shift +@ void npc_coords_shift(struct npc_state *fieldObject, u16 x, u16 y) +npc_coords_shift: @ 808EAE4 + ldrh r3, [r0, 0x10] + strh r3, [r0, 0x14] + ldrh r3, [r0, 0x12] + strh r3, [r0, 0x16] + strh r1, [r0, 0x10] + strh r2, [r0, 0x12] + bx lr + thumb_func_end npc_coords_shift + + thumb_func_start npc_coords_set +@ void npc_coords_set(struct npc_state *fieldObject, u16 x, u16 y) +npc_coords_set: @ 808EAF4 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + strh r1, [r0, 0x14] + strh r2, [r0, 0x16] + strh r1, [r0, 0x10] + strh r2, [r0, 0x12] + bx lr + thumb_func_end npc_coords_set + + thumb_func_start sub_808EB08 +sub_808EB08: @ 808EB08 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + ldrb r1, [r6, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r7, r0, r1 + ldrb r0, [r6, 0x5] + bl GetFieldObjectGraphicsInfo + mov r8, r0 + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl npc_coords_set + movs r1, 0x10 + ldrsh r0, [r6, r1] + movs r2, 0x12 + ldrsh r1, [r6, r2] + adds r2, r7, 0 + adds r2, 0x20 + adds r3, r7, 0 + adds r3, 0x22 + bl sub_8093038 + mov r1, r8 + ldrh r0, [r1, 0x8] + lsls r0, 16 + asrs r0, 17 + negs r0, r0 + adds r1, r7, 0 + adds r1, 0x28 + strb r0, [r1] + mov r2, r8 + ldrh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 17 + negs r0, r0 + adds r2, r7, 0 + adds r2, 0x29 + strb r0, [r2] + ldrh r0, [r7, 0x20] + adds r0, 0x8 + strh r0, [r7, 0x20] + ldrh r1, [r7, 0x22] + adds r1, 0x10 + movs r0, 0 + ldrsb r0, [r2, r0] + adds r0, r1 + strh r0, [r7, 0x22] + adds r0, r6, 0 + bl sub_808E38C + ldrb r0, [r6, 0x1] + lsrs r0, 7 + cmp r0, 0 + beq _0808EB9A + bl CameraObjectReset1 +_0808EB9A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808EB08 + + thumb_func_start sub_808EBA8 +sub_808EBA8: @ 808EBA8 + push {r4,r5,lr} + sub sp, 0x4 + ldr r4, [sp, 0x10] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 16 + lsrs r5, r3, 16 + lsls r4, 16 + lsrs r4, 16 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808EBF0 + lsls r1, r5, 16 + lsls r2, r4, 16 + mov r0, sp + ldrb r3, [r0] + lsls r0, r3, 3 + adds r0, r3 + lsls r0, 2 + ldr r3, =0x02037350 + adds r0, r3 + movs r3, 0xE0 + lsls r3, 11 + adds r1, r3 + asrs r1, 16 + adds r2, r3 + asrs r2, 16 + bl sub_808EB08 +_0808EBF0: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808EBA8 + + thumb_func_start npc_coords_shift_still +@ void npc_coords_shift_still(struct npc_state *fieldObject) +npc_coords_shift_still: @ 808EBFC + push {lr} + movs r2, 0x10 + ldrsh r1, [r0, r2] + movs r3, 0x12 + ldrsh r2, [r0, r3] + bl npc_coords_shift + pop {r0} + bx r0 + thumb_func_end npc_coords_shift_still + + thumb_func_start UpdateFieldObjectCoordsForCameraUpdate +@ void UpdateFieldObjectCoordsForCameraUpdate() +UpdateFieldObjectCoordsForCameraUpdate: @ 808EC10 + push {r4,r5,lr} + ldr r2, =0x02037334 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0808EC68 + movs r3, 0 + ldr r5, =0x02037350 + movs r0, 0x4 + ldrsh r4, [r2, r0] + movs r0, 0x8 + ldrsh r1, [r2, r0] +_0808EC2A: + lsls r0, r3, 3 + adds r0, r3 + lsls r0, 2 + adds r2, r0, r5 + ldrb r0, [r2] + lsls r0, 31 + cmp r0, 0 + beq _0808EC5E + ldrh r0, [r2, 0xC] + subs r0, r4 + strh r0, [r2, 0xC] + ldrh r0, [r2, 0xE] + subs r0, r1 + strh r0, [r2, 0xE] + ldrh r0, [r2, 0x10] + subs r0, r4 + strh r0, [r2, 0x10] + ldrh r0, [r2, 0x12] + subs r0, r1 + strh r0, [r2, 0x12] + ldrh r0, [r2, 0x14] + subs r0, r4 + strh r0, [r2, 0x14] + ldrh r0, [r2, 0x16] + subs r0, r1 + strh r0, [r2, 0x16] +_0808EC5E: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xF + bls _0808EC2A +_0808EC68: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end UpdateFieldObjectCoordsForCameraUpdate + + thumb_func_start GetFieldObjectIdByXYZ +@ u8 GetFieldObjectIdByXYZ(u16 x, u16 y, u8 z) +GetFieldObjectIdByXYZ: @ 808EC78 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r7, r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 24 + lsrs r5, r2, 24 + movs r4, 0 + ldr r0, =0x02037350 + mov r8, r0 +_0808EC90: + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + mov r2, r8 + adds r1, r0, r2 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + beq _0808ECC8 + movs r2, 0x10 + ldrsh r0, [r1, r2] + cmp r0, r7 + bne _0808ECC8 + movs r2, 0x12 + ldrsh r0, [r1, r2] + cmp r0, r6 + bne _0808ECC8 + adds r0, r1, 0 + adds r1, r5, 0 + bl FieldObjectDoesZCoordMatch + lsls r0, 24 + cmp r0, 0 + beq _0808ECC8 + adds r0, r4, 0 + b _0808ECD4 + .pool +_0808ECC8: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _0808EC90 + movs r0, 0x10 +_0808ECD4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end GetFieldObjectIdByXYZ + + thumb_func_start FieldObjectDoesZCoordMatch +@ bool8 FieldObjectDoesZCoordMatch(struct npc_state *fieldObject) +FieldObjectDoesZCoordMatch: @ 808ECE0 + push {lr} + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r0, 0xB] + movs r0, 0xF + ands r0, r2 + cmp r0, 0 + beq _0808ED00 + cmp r1, 0 + beq _0808ED00 + lsls r0, r2, 28 + lsrs r0, 28 + cmp r0, r1 + beq _0808ED00 + movs r0, 0 + b _0808ED02 +_0808ED00: + movs r0, 0x1 +_0808ED02: + pop {r1} + bx r1 + thumb_func_end FieldObjectDoesZCoordMatch + + thumb_func_start UpdateFieldObjectsForCameraUpdate +@ void UpdateFieldObjectsForCameraUpdate(u16 movingCameraOffsetX, u16 movingCameraOffsetY) +UpdateFieldObjectsForCameraUpdate: @ 808ED08 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + bl UpdateFieldObjectCoordsForCameraUpdate + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl SpawnFieldObjectsInView + bl RemoveFieldObjectsOutsideView + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end UpdateFieldObjectsForCameraUpdate + + thumb_func_start AddCameraObject +@ u8 AddCameraObject(u8 followedObjectId) +AddCameraObject: @ 808ED34 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_084975D4 + movs r1, 0 + movs r2, 0 + movs r3, 0x4 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r2, 0x3E + adds r2, r1 + mov r12, r2 + ldrb r2, [r2] + movs r3, 0x4 + orrs r2, r3 + mov r3, r12 + strb r2, [r3] + strh r4, [r1, 0x2E] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end AddCameraObject + + thumb_func_start ObjectCB_CameraObject +@ void ObjectCB_CameraObject(struct obj *object) +ObjectCB_CameraObject: @ 808ED78 + push {r4,r5,lr} + sub sp, 0xC + mov r2, sp + ldr r1, =gUnknown_084975EC + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + movs r2, 0x30 + ldrsh r1, [r0, r2] + lsls r1, 2 + add r1, sp + ldr r1, [r1] + bl _call_via_r1 + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ObjectCB_CameraObject + + thumb_func_start CameraObject_0 +@ void CameraObject_0(struct obj *object) +CameraObject_0: @ 808EDA0 + push {lr} + ldr r3, =0x02020630 + movs r1, 0x2E + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r3 + ldrh r1, [r1, 0x20] + strh r1, [r0, 0x20] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r3 + ldrh r1, [r1, 0x22] + strh r1, [r0, 0x22] + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r3] + movs r1, 0x1 + strh r1, [r0, 0x30] + bl CameraObject_1 + pop {r0} + bx r0 + .pool + thumb_func_end CameraObject_0 + + thumb_func_start CameraObject_1 +@ void CameraObject_1(struct obj *object) +CameraObject_1: @ 808EDDC + push {r4,r5,lr} + ldr r3, =0x02020630 + movs r1, 0x2E + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r3 + ldrh r3, [r1, 0x22] + ldrh r2, [r0, 0x20] + ldrh r4, [r1, 0x20] + movs r5, 0x20 + ldrsh r1, [r1, r5] + subs r1, r2 + strh r1, [r0, 0x32] + ldrh r2, [r0, 0x22] + lsls r1, r3, 16 + asrs r1, 16 + subs r1, r2 + strh r1, [r0, 0x34] + strh r4, [r0, 0x20] + strh r3, [r0, 0x22] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end CameraObject_1 + + thumb_func_start CameraObject_2 +@ void CameraObject_2(struct obj *object) +CameraObject_2: @ 808EE14 + push {r4,lr} + ldr r4, =0x02020630 + movs r1, 0x2E + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x20] + movs r3, 0 + strh r1, [r0, 0x20] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x22] + strh r1, [r0, 0x22] + strh r3, [r0, 0x32] + strh r3, [r0, 0x34] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end CameraObject_2 + + thumb_func_start FindCameraObject +@ struct obj *FindCameraObject() +FindCameraObject: @ 808EE44 + push {r4,r5,lr} + movs r3, 0 + ldr r4, =0x02020630 + adds r5, r4, 0 + adds r5, 0x1C +_0808EE4E: + lsls r0, r3, 4 + adds r0, r3 + lsls r1, r0, 2 + adds r2, r1, r4 + adds r0, r2, 0 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + beq _0808EE78 + adds r0, r1, r5 + ldr r1, [r0] + ldr r0, =ObjectCB_CameraObject + cmp r1, r0 + bne _0808EE78 + adds r0, r2, 0 + b _0808EE84 + .pool +_0808EE78: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3F + bls _0808EE4E + movs r0, 0 +_0808EE84: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end FindCameraObject + + thumb_func_start CameraObjectReset1 +@ void CameraObjectReset1() +CameraObjectReset1: @ 808EE8C + push {lr} + bl FindCameraObject + adds r2, r0, 0 + cmp r2, 0 + beq _0808EEA4 + movs r0, 0 + strh r0, [r2, 0x30] + ldr r1, [r2, 0x1C] + adds r0, r2, 0 + bl _call_via_r1 +_0808EEA4: + pop {r0} + bx r0 + thumb_func_end CameraObjectReset1 + + thumb_func_start CameraObjectSetFollowedObjectId +@ void CameraObjectSetFollowedObjectId(u8 objectId) +CameraObjectSetFollowedObjectId: @ 808EEA8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl FindCameraObject + cmp r0, 0 + beq _0808EEBC + strh r4, [r0, 0x2E] + bl CameraObjectReset1 +_0808EEBC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end CameraObjectSetFollowedObjectId + + thumb_func_start CameraObjectGetFollowedObjectId +@ u8 CameraObjectGetFollowedObjectId() +CameraObjectGetFollowedObjectId: @ 808EEC4 + push {lr} + bl FindCameraObject + cmp r0, 0 + beq _0808EED6 + ldrh r0, [r0, 0x2E] + lsls r0, 24 + lsrs r0, 24 + b _0808EED8 +_0808EED6: + movs r0, 0x40 +_0808EED8: + pop {r1} + bx r1 + thumb_func_end CameraObjectGetFollowedObjectId + + thumb_func_start CameraObjectReset2 +@ void CameraObjectReset2() +CameraObjectReset2: @ 808EEDC + push {lr} + bl FindCameraObject + movs r1, 0x2 + strh r1, [r0, 0x30] + pop {r0} + bx r0 + thumb_func_end CameraObjectReset2 + + thumb_func_start sub_808EEEC +sub_808EEEC: @ 808EEEC + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r12, r0 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + lsls r2, 16 + lsrs r6, r2, 16 + lsls r3, 24 + lsrs r7, r3, 24 + movs r5, 0 + ldr r1, =0x02020630 +_0808EF06: + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r4, r0, r1 + adds r0, r4, 0 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + bne _0808EF38 + adds r0, r4, 0 + mov r1, r12 + movs r2, 0x44 + bl memcpy + mov r0, r8 + strh r0, [r4, 0x20] + strh r6, [r4, 0x22] + adds r0, r4, 0 + adds r0, 0x43 + strb r7, [r0] + b _0808EF42 + .pool +_0808EF38: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3F + bls _0808EF06 +_0808EF42: + adds r0, r5, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808EEEC + + thumb_func_start obj_unfreeze +obj_unfreeze: @ 808EF50 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r12, r0 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + lsls r2, 16 + lsrs r6, r2, 16 + lsls r3, 24 + lsrs r7, r3, 24 + movs r5, 0x3F + ldr r3, =0x02020630 + movs r2, 0x1 + negs r2, r2 +_0808EF6E: + lsls r0, r5, 16 + asrs r1, r0, 16 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r3 + adds r0, r4, 0 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + bne _0808EFA8 + adds r0, r4, 0 + mov r1, r12 + movs r2, 0x44 + bl memcpy + mov r0, r8 + strh r0, [r4, 0x20] + strh r6, [r4, 0x22] + adds r0, r4, 0 + adds r0, 0x43 + strb r7, [r0] + lsls r0, r5, 24 + lsrs r0, 24 + b _0808EFB6 + .pool +_0808EFA8: + subs r0, r1, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, r2 + bgt _0808EF6E + movs r0, 0x40 +_0808EFB6: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end obj_unfreeze + + thumb_func_start FieldObjectSetDirection +@ void FieldObjectSetDirection(struct npc_state *fieldObject, u8 direction) +FieldObjectSetDirection: @ 808EFC0 + push {r4,lr} + adds r3, r0, 0 + lsls r1, 24 + lsrs r2, r1, 24 + adds r4, r2, 0 + ldrb r0, [r3, 0x18] + lsls r0, 28 + lsrs r0, 28 + adds r1, r3, 0 + adds r1, 0x20 + strb r0, [r1] + ldrb r0, [r3, 0x1] + lsls r0, 30 + cmp r0, 0 + blt _0808EFF0 + movs r0, 0xF + adds r1, r2, 0 + ands r1, r0 + ldrb r2, [r3, 0x18] + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x18] +_0808EFF0: + lsls r2, r4, 4 + ldrb r1, [r3, 0x18] + movs r0, 0xF + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x18] + pop {r4} + pop {r0} + bx r0 + thumb_func_end FieldObjectSetDirection + + thumb_func_start GetFieldObjectScriptPointerByLocalIdAndMap +@ u32 GetFieldObjectScriptPointerByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) +GetFieldObjectScriptPointerByLocalIdAndMap: @ 808F004 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + bl GetFieldObjectTemplateByLocalIdAndMap + ldr r0, [r0, 0x10] + pop {r1} + bx r1 + thumb_func_end GetFieldObjectScriptPointerByLocalIdAndMap + + thumb_func_start GetFieldObjectScriptPointerByFieldObjectId +@ u32 GetFieldObjectScriptPointerByFieldObjectId(u8 fieldObjectId) +GetFieldObjectScriptPointerByFieldObjectId: @ 808F01C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02037350 + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + ldrb r0, [r2, 0x8] + ldrb r1, [r2, 0x9] + ldrb r2, [r2, 0xA] + bl GetFieldObjectScriptPointerByLocalIdAndMap + pop {r1} + bx r1 + .pool + thumb_func_end GetFieldObjectScriptPointerByFieldObjectId + + thumb_func_start GetFieldObjectFlagIdByLocalIdAndMap +@ u16 GetFieldObjectFlagIdByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) +GetFieldObjectFlagIdByLocalIdAndMap: @ 808F040 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + bl GetFieldObjectTemplateByLocalIdAndMap + ldrh r0, [r0, 0x14] + pop {r1} + bx r1 + thumb_func_end GetFieldObjectFlagIdByLocalIdAndMap + + thumb_func_start GetFieldObjectFlagIdByFieldObjectId +@ u16 GetFieldObjectFlagIdByFieldObjectId(u8 fieldObjectId) +GetFieldObjectFlagIdByFieldObjectId: @ 808F058 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02037350 + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + ldrb r0, [r2, 0x8] + ldrb r1, [r2, 0x9] + ldrb r2, [r2, 0xA] + bl GetFieldObjectFlagIdByLocalIdAndMap + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end GetFieldObjectFlagIdByFieldObjectId + + thumb_func_start sub_808F080 +sub_808F080: @ 808F080 + push {lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808F0B4 + ldr r2, =0x02037350 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x7] + b _0808F0B6 + .pool +_0808F0B4: + movs r0, 0xFF +_0808F0B6: + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_808F080 + + thumb_func_start sub_808F0BC +sub_808F0BC: @ 808F0BC + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02037350 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x7] + bx lr + .pool + thumb_func_end sub_808F0BC + + thumb_func_start sub_808F0D4 +sub_808F0D4: @ 808F0D4 + push {lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808F108 + ldr r2, =0x02037350 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1D] + b _0808F10A + .pool +_0808F108: + movs r0, 0xFF +_0808F10A: + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_808F0D4 + + thumb_func_start FieldObjectGetBerryTreeId +@ u8 FieldObjectGetBerryTreeId(u8 fieldObjectId) +FieldObjectGetBerryTreeId: @ 808F110 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02037350 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x1D] + bx lr + .pool + thumb_func_end FieldObjectGetBerryTreeId + + thumb_func_start GetFieldObjectTemplateByLocalIdAndMap +@ struct FieldObjectTemplate *GetFieldObjectTemplateByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) +GetFieldObjectTemplateByLocalIdAndMap: @ 808F128 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r0, 0x5 + ldrsb r0, [r1, r0] + cmp r0, r3 + bne _0808F160 + movs r0, 0x4 + ldrsb r0, [r1, r0] + cmp r0, r2 + bne _0808F160 + movs r0, 0xC7 + lsls r0, 4 + adds r1, r0 + ldr r0, =0x02037318 + ldr r0, [r0, 0x4] + b _0808F16C + .pool +_0808F160: + adds r0, r2, 0 + adds r1, r3, 0 + bl get_mapheader_by_bank_and_number + ldr r0, [r0, 0x4] + ldr r1, [r0, 0x4] +_0808F16C: + ldrb r2, [r0] + adds r0, r4, 0 + bl FindFieldObjectTemplateInArrayByLocalId + pop {r4} + pop {r1} + bx r1 + thumb_func_end GetFieldObjectTemplateByLocalIdAndMap + + thumb_func_start FindFieldObjectTemplateInArrayByLocalId +@ struct FieldObjectTemplate *FindFieldObjectTemplateInArrayByLocalId(u8 localId, struct FieldObjectTemplate *templates, u8 numTemplates) +FindFieldObjectTemplateInArrayByLocalId: @ 808F17C + push {r4,r5,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r2, 24 + lsrs r2, 24 + movs r1, 0 + cmp r1, r2 + bcs _0808F1AA +_0808F18E: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r3, r0, r5 + ldrb r0, [r3] + cmp r0, r4 + bne _0808F1A0 + adds r0, r3, 0 + b _0808F1AC +_0808F1A0: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, r2 + bcc _0808F18E +_0808F1AA: + movs r0, 0 +_0808F1AC: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end FindFieldObjectTemplateInArrayByLocalId + + thumb_func_start sub_808F1B4 +@ int sub_808F1B4(struct npc_state *fieldObject) +sub_808F1B4: @ 808F1B4 + push {r4,r5,lr} + adds r3, r0, 0 + ldrb r0, [r3, 0x9] + ldr r1, =0x03005d8c + ldr r2, [r1] + movs r1, 0x5 + ldrsb r1, [r2, r1] + cmp r0, r1 + bne _0808F200 + ldrb r1, [r3, 0xA] + movs r0, 0x4 + ldrsb r0, [r2, r0] + cmp r1, r0 + beq _0808F1E2 + b _0808F200 + .pool +_0808F1D8: + movs r1, 0xC7 + lsls r1, 4 + adds r0, r1 + adds r0, r4, r0 + b _0808F202 +_0808F1E2: + movs r1, 0 + adds r4, r2, 0 + ldrb r3, [r3, 0x8] + movs r5, 0xC7 + lsls r5, 4 + adds r2, r4, r5 + movs r0, 0 +_0808F1F0: + ldrb r5, [r2] + cmp r3, r5 + beq _0808F1D8 + adds r2, 0x18 + adds r0, 0x18 + adds r1, 0x1 + cmp r1, 0x3F + ble _0808F1F0 +_0808F200: + movs r0, 0 +_0808F202: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808F1B4 + + thumb_func_start sub_808F208 +@ void sub_808F208(struct npc_state *fieldObject) +sub_808F208: @ 808F208 + push {r4,lr} + adds r4, r0, 0 + bl sub_808F1B4 + adds r1, r0, 0 + cmp r1, 0 + beq _0808F222 + ldrh r0, [r4, 0x10] + subs r0, 0x7 + strh r0, [r1, 0x4] + ldrh r0, [r4, 0x12] + subs r0, 0x7 + strh r0, [r1, 0x6] +_0808F222: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808F208 + + thumb_func_start sub_808F228 +sub_808F228: @ 808F228 + push {r4,lr} + adds r4, r1, 0 + bl sub_808F1B4 + cmp r0, 0 + beq _0808F236 + str r4, [r0, 0x10] +_0808F236: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808F228 + + thumb_func_start sub_808F23C +sub_808F23C: @ 808F23C + push {r4,lr} + lsls r1, 24 + lsrs r4, r1, 24 + bl sub_808F1B4 + cmp r0, 0 + beq _0808F24C + strb r4, [r0, 0x9] +_0808F24C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808F23C + + thumb_func_start sub_808F254 +@ void sub_808F254(u8 localId, u8 mapId, u8 mapGroupId) +sub_808F254: @ 808F254 + push {lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808F282 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + bl sub_808F208 +_0808F282: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_808F254 + + thumb_func_start sub_808F28C +sub_808F28C: @ 808F28C + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r4, r3, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _0808F2E8 + cmp r4, 0x6 + beq _0808F2B6 + cmp r4, 0x7 + beq _0808F2D4 + b _0808F2E8 +_0808F2B6: + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldr r1, =gUnknown_082766A2 + bl sub_808F228 + b _0808F2E8 + .pool +_0808F2D4: + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldr r1, =gUnknown_082766A6 + bl sub_808F228 +_0808F2E8: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808F28C + + thumb_func_start npc_paltag_set_load +npc_paltag_set_load: @ 808F2F8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl gpu_pal_allocator_reset__manage_upper_four + ldr r1, =0x020375b6 + ldr r2, =0x000011ff + adds r0, r2, 0 + strh r0, [r1] + ldr r2, =0x020375b4 + strb r4, [r2] + cmp r4, 0x1 + bne _0808F344 + ldr r1, =gUnknown_0850BE38 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + movs r2, 0x6 + bl pal_patch_for_npc_range + ldr r1, =0x0300301c + movs r0, 0x8 + strb r0, [r1] + b _0808F356 + .pool +_0808F344: + ldr r0, =gUnknown_0850BE38 + ldrb r1, [r2] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + movs r1, 0 + movs r2, 0xA + bl pal_patch_for_npc_range +_0808F356: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end npc_paltag_set_load + + thumb_func_start npc_paltag_by_palslot +npc_paltag_by_palslot: @ 808F360 + push {r4-r6,lr} + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x9 + bhi _0808F39C + ldr r1, =gUnknown_0850BE38 + ldr r0, =0x020375b4 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + lsls r0, r2, 1 + b _0808F390 + .pool +_0808F384: + adds r1, r4, 0x4 + adds r1, r2, r1 + ldr r0, =0x020375b4 + ldrb r0, [r0] + ldr r1, [r1] + lsls r0, 1 +_0808F390: + adds r0, r1 + ldrh r0, [r0] + b _0808F3CE + .pool +_0808F39C: + movs r3, 0 + ldr r0, =gUnknown_0850BD78 + ldrh r1, [r0] + ldr r2, =0x000011ff + adds r4, r0, 0 + cmp r1, r2 + beq _0808F3CC + adds r6, r4, 0 + ldr r0, =0x020375b6 + ldrh r1, [r0] + adds r5, r2, 0 +_0808F3B2: + lsls r2, r3, 3 + adds r0, r2, r6 + ldrh r0, [r0] + cmp r0, r1 + beq _0808F384 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 3 + adds r0, r4 + ldrh r0, [r0] + cmp r0, r5 + bne _0808F3B2 +_0808F3CC: + ldr r0, =0x000011ff +_0808F3CE: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end npc_paltag_by_palslot + + thumb_func_start FieldObjectCB_NoMovement1 +FieldObjectCB_NoMovement1: @ 808F3E0 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =FieldObjectCB2_NoMovement1 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_NoMovement1 + + thumb_func_start FieldObjectCB2_NoMovement1 +FieldObjectCB2_NoMovement1: @ 808F404 + movs r0, 0 + bx lr + thumb_func_end FieldObjectCB2_NoMovement1 + + thumb_func_start FieldObjectCB_GoRandomDirections +FieldObjectCB_GoRandomDirections: @ 808F408 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =FieldObjectCB2_GoRandomDirections + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoRandomDirections + + thumb_func_start FieldObjectCB2_GoRandomDirections +FieldObjectCB2_GoRandomDirections: @ 808F42C + push {r4,lr} + ldr r3, =gUnknown_0850D6F4 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end FieldObjectCB2_GoRandomDirections + + thumb_func_start sub_808F44C +sub_808F44C: @ 808F44C + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808F44C + + thumb_func_start sub_808F460 +sub_808F460: @ 808F460 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808F460 + + thumb_func_start sub_808F48C +sub_808F48C: @ 808F48C + push {r4-r6,lr} + adds r6, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0808F4C0 + ldr r5, =gUnknown_0850D6DC + bl GenerateRandomNumber + movs r4, 0x3 + adds r1, r4, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r5 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r6, 0 + bl sub_8097978 + strh r4, [r6, 0x30] + movs r0, 0x1 + b _0808F4C2 + .pool +_0808F4C0: + movs r0, 0 +_0808F4C2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808F48C + + thumb_func_start sub_808F4C8 +sub_808F4C8: @ 808F4C8 + push {r4,lr} + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _0808F4DC + movs r0, 0 + b _0808F4E2 +_0808F4DC: + movs r0, 0x4 + strh r0, [r4, 0x30] + movs r0, 0x1 +_0808F4E2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808F4C8 + + thumb_func_start sub_808F4E8 +sub_808F4E8: @ 808F4E8 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + ldr r1, =gUnknown_0850D710 + mov r0, sp + movs r2, 0x4 + bl memcpy + bl GenerateRandomNumber + movs r1, 0x3 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r4, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x5 + strh r0, [r6, 0x30] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8092B88 + lsls r0, 24 + cmp r0, 0 + beq _0808F526 + movs r0, 0x1 + strh r0, [r6, 0x30] +_0808F526: + movs r0, 0x1 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808F4E8 + + thumb_func_start sub_808F534 +sub_808F534: @ 808F534 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl GetGoSpeed0AnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x6 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808F534 + + thumb_func_start sub_808F564 +sub_808F564: @ 808F564 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0808F582 + ldrb r0, [r4] + movs r1, 0x3 + negs r1, r1 + ands r1, r0 + strb r1, [r4] + movs r0, 0x1 + strh r0, [r5, 0x30] +_0808F582: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808F564 + + thumb_func_start FieldObjectIsTrainerAndCloseToPlayer +@ bool8 FieldObjectIsTrainerAndCloseToPlayer(struct npc_state *fieldObject) +FieldObjectIsTrainerAndCloseToPlayer: @ 808F58C + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r0, 0x80 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _0808F5F8 + ldrb r0, [r5, 0x7] + cmp r0, 0x1 + beq _0808F5A8 + cmp r0, 0x3 + bne _0808F5F8 +_0808F5A8: + mov r7, sp + adds r7, 0x2 + mov r0, sp + adds r1, r7, 0 + bl PlayerGetDestCoords + ldrh r2, [r5, 0x10] + ldrh r4, [r5, 0x12] + ldrb r1, [r5, 0x1D] + subs r3, r2, r1 + subs r0, r4, r1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r2, r1, r2 + lsls r2, 16 + lsrs r2, 16 + adds r1, r4 + lsls r1, 16 + lsrs r6, r1, 16 + mov r0, sp + lsls r3, 16 + asrs r3, 16 + movs r1, 0 + ldrsh r4, [r0, r1] + cmp r3, r4 + bgt _0808F5F8 + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, r4 + blt _0808F5F8 + lsls r0, r5, 16 + asrs r0, 16 + movs r2, 0 + ldrsh r1, [r7, r2] + cmp r0, r1 + bgt _0808F5F8 + lsls r0, r6, 16 + asrs r0, 16 + cmp r0, r1 + bge _0808F5FC +_0808F5F8: + movs r0, 0 + b _0808F5FE +_0808F5FC: + movs r0, 0x1 +_0808F5FE: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end FieldObjectIsTrainerAndCloseToPlayer + + thumb_func_start sub_808F608 +sub_808F608: @ 808F608 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 16 + lsrs r0, r1, 16 + lsls r2, 16 + lsls r3, 16 + cmp r2, r3 + ble _0808F626 + movs r2, 0x4 + lsls r0, r4, 16 + cmp r0, 0 + bge _0808F630 + movs r2, 0x3 + b _0808F630 +_0808F626: + movs r2, 0x1 + lsls r0, 16 + cmp r0, 0 + bge _0808F630 + movs r2, 0x2 +_0808F630: + adds r0, r2, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808F608 + + thumb_func_start sub_808F638 +sub_808F638: @ 808F638 + push {lr} + movs r0, 0x1 + lsls r1, 16 + cmp r1, 0 + bge _0808F644 + movs r0, 0x2 +_0808F644: + pop {r1} + bx r1 + thumb_func_end sub_808F638 + + thumb_func_start sub_808F648 +sub_808F648: @ 808F648 + push {lr} + movs r1, 0x4 + lsls r0, 16 + cmp r0, 0 + bge _0808F654 + movs r1, 0x3 +_0808F654: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_808F648 + + thumb_func_start sub_808F65C +sub_808F65C: @ 808F65C + push {r4-r7,lr} + lsls r0, 16 + asrs r4, r0, 16 + lsls r1, 16 + asrs r5, r1, 16 + lsls r2, 16 + asrs r6, r2, 16 + lsls r3, 16 + asrs r7, r3, 16 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F608 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0808F698 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F648 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _0808F6B2 + b _0808F6B0 +_0808F698: + cmp r0, 0x4 + bne _0808F6B2 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F638 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0808F6B2 +_0808F6B0: + movs r0, 0x2 +_0808F6B2: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808F65C + + thumb_func_start sub_808F6B8 +sub_808F6B8: @ 808F6B8 + push {r4-r7,lr} + lsls r0, 16 + asrs r4, r0, 16 + lsls r1, 16 + asrs r5, r1, 16 + lsls r2, 16 + asrs r6, r2, 16 + lsls r3, 16 + asrs r7, r3, 16 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F608 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0808F6F4 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F648 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0808F70E + b _0808F70C +_0808F6F4: + cmp r0, 0x3 + bne _0808F70E + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F638 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0808F70E +_0808F70C: + movs r0, 0x2 +_0808F70E: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808F6B8 + + thumb_func_start sub_808F714 +sub_808F714: @ 808F714 + push {r4-r7,lr} + lsls r0, 16 + asrs r4, r0, 16 + lsls r1, 16 + asrs r5, r1, 16 + lsls r2, 16 + asrs r6, r2, 16 + lsls r3, 16 + asrs r7, r3, 16 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F608 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0808F750 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F648 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _0808F76A + b _0808F768 +_0808F750: + cmp r0, 0x4 + bne _0808F76A + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F638 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0808F76A +_0808F768: + movs r0, 0x1 +_0808F76A: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808F714 + + thumb_func_start sub_808F770 +sub_808F770: @ 808F770 + push {r4-r7,lr} + lsls r0, 16 + asrs r4, r0, 16 + lsls r1, 16 + asrs r5, r1, 16 + lsls r2, 16 + asrs r6, r2, 16 + lsls r3, 16 + asrs r7, r3, 16 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F608 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0808F7AC + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F648 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0808F7C6 + b _0808F7C4 +_0808F7AC: + cmp r0, 0x3 + bne _0808F7C6 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_808F638 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0808F7C6 +_0808F7C4: + movs r0, 0x1 +_0808F7C6: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808F770 + + thumb_func_start sub_808F7CC +sub_808F7CC: @ 808F7CC + push {r4-r7,lr} + lsls r0, 16 + asrs r7, r0, 16 + lsls r1, 16 + asrs r6, r1, 16 + lsls r2, 16 + asrs r5, r2, 16 + lsls r3, 16 + asrs r4, r3, 16 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_808F608 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _0808F802 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_808F638 + lsls r0, 24 + lsrs r0, 24 +_0808F802: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808F7CC + + thumb_func_start sub_808F808 +sub_808F808: @ 808F808 + push {r4-r7,lr} + lsls r0, 16 + asrs r7, r0, 16 + lsls r1, 16 + asrs r6, r1, 16 + lsls r2, 16 + asrs r5, r2, 16 + lsls r3, 16 + asrs r4, r3, 16 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_808F608 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0808F83E + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_808F638 + lsls r0, 24 + lsrs r0, 24 +_0808F83E: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808F808 + + thumb_func_start sub_808F844 +sub_808F844: @ 808F844 + push {r4-r7,lr} + lsls r0, 16 + asrs r7, r0, 16 + lsls r1, 16 + asrs r6, r1, 16 + lsls r2, 16 + asrs r5, r2, 16 + lsls r3, 16 + asrs r4, r3, 16 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_808F608 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0808F87A + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_808F648 + lsls r0, 24 + lsrs r0, 24 +_0808F87A: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808F844 + + thumb_func_start sub_808F880 +sub_808F880: @ 808F880 + push {r4-r7,lr} + lsls r0, 16 + asrs r7, r0, 16 + lsls r1, 16 + asrs r6, r1, 16 + lsls r2, 16 + asrs r5, r2, 16 + lsls r3, 16 + asrs r4, r3, 16 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_808F608 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0808F8B6 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_808F648 + lsls r0, 24 + lsrs r0, 24 +_0808F8B6: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808F880 + + thumb_func_start sub_808F8BC +sub_808F8BC: @ 808F8BC + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + bne _0808F8D4 + movs r0, 0 + b _0808F938 +_0808F8D4: + mov r5, sp + adds r5, 0x2 + mov r0, sp + adds r1, r5, 0 + bl PlayerGetDestCoords + mov r2, sp + mov r0, sp + ldrh r0, [r0] + ldrh r1, [r4, 0x10] + subs r0, r1 + strh r0, [r2] + ldrh r0, [r5] + ldrh r1, [r4, 0x12] + subs r0, r1 + strh r0, [r5] + mov r0, sp + ldrh r3, [r5] + ldrh r2, [r0] + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _0808F908 + negs r0, r0 + lsls r0, 16 + lsrs r2, r0, 16 +_0808F908: + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, 0 + bge _0808F916 + negs r0, r0 + lsls r0, 16 + lsrs r3, r0, 16 +_0808F916: + ldr r0, =gUnknown_0850D714 + lsls r4, r6, 2 + adds r4, r0 + mov r0, sp + movs r6, 0 + ldrsh r0, [r0, r6] + movs r6, 0 + ldrsh r1, [r5, r6] + lsls r2, 16 + asrs r2, 16 + lsls r3, 16 + asrs r3, 16 + ldr r4, [r4] + bl _call_via_r4 + lsls r0, 24 + lsrs r0, 24 +_0808F938: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808F8BC + + thumb_func_start FieldObjectCB_LookRandomDirections +FieldObjectCB_LookRandomDirections: @ 808F944 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =FieldObjectCB2_LookRandomDirections + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_LookRandomDirections + + thumb_func_start FieldObjectCB2_LookRandomDirections +@ bool8 FieldObjectCB2_LookRandomDirections(struct npc_state *fieldObject, struct obj *object) +FieldObjectCB2_LookRandomDirections: @ 808F968 + push {r4,lr} + ldr r3, =gUnknown_0850D740 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end FieldObjectCB2_LookRandomDirections + + thumb_func_start sub_808F988 +@ bool8 sub_808F988(struct npc_state *fieldObject, struct obj *object) +sub_808F988: @ 808F988 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808F988 + + thumb_func_start sub_808F99C +@ bool8 sub_808F99C(struct npc_state *fieldObject, struct obj *object) +sub_808F99C: @ 808F99C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808F99C + + thumb_func_start sub_808F9C8 +@ bool8 sub_808F9C8(struct npc_state *fieldObject, struct obj *object) +sub_808F9C8: @ 808F9C8 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0808F9FE + ldr r4, =gUnknown_0850D6DC + bl GenerateRandomNumber + movs r5, 0x3 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r7, 0 + bl sub_8097978 + ldrb r1, [r6] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + strh r5, [r7, 0x30] +_0808F9FE: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808F9C8 + + thumb_func_start sub_808FA0C +@ bool8 sub_808FA0C(struct npc_state *fieldObject, struct obj *object) +sub_808FA0C: @ 808FA0C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _0808FA2A + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _0808FA32 +_0808FA2A: + movs r0, 0x4 + strh r0, [r5, 0x30] + movs r0, 0x1 + b _0808FA34 +_0808FA32: + movs r0, 0 +_0808FA34: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808FA0C + + thumb_func_start sub_808FA3C +@ bool8 sub_808FA3C(struct npc_state *fieldObject, struct obj *object) +sub_808FA3C: @ 808FA3C + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D710 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r0, r4, 0 + movs r1, 0 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0808FA6C + bl GenerateRandomNumber + movs r1, 0x3 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r1, [r0] +_0808FA6C: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808FA3C + + thumb_func_start FieldObjectCB_RandomlyGoNorthOrSouth +FieldObjectCB_RandomlyGoNorthOrSouth: @ 808FA84 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =FieldObjectCB2_RandomlyGoNorthOrSouth + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyGoNorthOrSouth + + thumb_func_start FieldObjectCB2_RandomlyGoNorthOrSouth +FieldObjectCB2_RandomlyGoNorthOrSouth: @ 808FAA8 + push {r4,lr} + ldr r3, =gUnknown_0850D754 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end FieldObjectCB2_RandomlyGoNorthOrSouth + + thumb_func_start sub_808FAC8 +sub_808FAC8: @ 808FAC8 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808FAC8 + + thumb_func_start sub_808FADC +sub_808FADC: @ 808FADC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808FADC + + thumb_func_start sub_808FB08 +@ bool8 sub_808FB08(struct npc_state *fieldObject, struct obj *object) +sub_808FB08: @ 808FB08 + push {r4-r6,lr} + adds r6, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0808FB3C + ldr r5, =gUnknown_0850D6DC + bl GenerateRandomNumber + movs r4, 0x3 + adds r1, r4, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r5 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r6, 0 + bl sub_8097978 + strh r4, [r6, 0x30] + movs r0, 0x1 + b _0808FB3E + .pool +_0808FB3C: + movs r0, 0 +_0808FB3E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808FB08 + + thumb_func_start sub_808FB44 +@ bool8 sub_808FB44(struct npc_state *fieldObject, struct obj *object) +sub_808FB44: @ 808FB44 + push {r4,lr} + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _0808FB58 + movs r0, 0 + b _0808FB5E +_0808FB58: + movs r0, 0x4 + strh r0, [r4, 0x30] + movs r0, 0x1 +_0808FB5E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808FB44 + + thumb_func_start sub_808FB64 +@ bool8 sub_808FB64(struct npc_state *fieldObject, struct obj *object) +sub_808FB64: @ 808FB64 + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + ldr r1, =gUnknown_0850D770 + mov r0, sp + movs r2, 0x2 + bl memcpy + bl GenerateRandomNumber + movs r7, 0x1 + adds r1, r7, 0 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r4, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x5 + strh r0, [r6, 0x30] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8092B88 + lsls r0, 24 + cmp r0, 0 + beq _0808FBA2 + strh r7, [r6, 0x30] +_0808FBA2: + movs r0, 0x1 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808FB64 + + thumb_func_start sub_808FBB0 +sub_808FBB0: @ 808FBB0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl GetGoSpeed0AnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x6 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808FBB0 + + thumb_func_start sub_808FBE0 +sub_808FBE0: @ 808FBE0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0808FBFE + ldrb r0, [r4] + movs r1, 0x3 + negs r1, r1 + ands r1, r0 + strb r1, [r4] + movs r0, 0x1 + strh r0, [r5, 0x30] +_0808FBFE: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808FBE0 + + thumb_func_start FieldObjectCB_RandomlyGoEastOrWest +FieldObjectCB_RandomlyGoEastOrWest: @ 808FC08 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =FieldObjectCB2_RandomlyGoEastOrWest + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyGoEastOrWest + + thumb_func_start FieldObjectCB2_RandomlyGoEastOrWest +FieldObjectCB2_RandomlyGoEastOrWest: @ 808FC2C + push {r4,lr} + ldr r3, =gUnknown_0850D774 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end FieldObjectCB2_RandomlyGoEastOrWest + + thumb_func_start sub_808FC4C +sub_808FC4C: @ 808FC4C + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808FC4C + + thumb_func_start sub_808FC60 +sub_808FC60: @ 808FC60 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808FC60 + + thumb_func_start sub_808FC8C +sub_808FC8C: @ 808FC8C + push {r4-r6,lr} + adds r6, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0808FCC0 + ldr r5, =gUnknown_0850D6DC + bl GenerateRandomNumber + movs r4, 0x3 + adds r1, r4, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r5 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r6, 0 + bl sub_8097978 + strh r4, [r6, 0x30] + movs r0, 0x1 + b _0808FCC2 + .pool +_0808FCC0: + movs r0, 0 +_0808FCC2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808FC8C + + thumb_func_start sub_808FCC8 +sub_808FCC8: @ 808FCC8 + push {r4,lr} + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _0808FCDC + movs r0, 0 + b _0808FCE2 +_0808FCDC: + movs r0, 0x4 + strh r0, [r4, 0x30] + movs r0, 0x1 +_0808FCE2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808FCC8 + + thumb_func_start sub_808FCE8 +sub_808FCE8: @ 808FCE8 + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + ldr r1, =gUnknown_0850D790 + mov r0, sp + movs r2, 0x2 + bl memcpy + bl GenerateRandomNumber + movs r7, 0x1 + adds r1, r7, 0 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r4, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x5 + strh r0, [r6, 0x30] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8092B88 + lsls r0, 24 + cmp r0, 0 + beq _0808FD26 + strh r7, [r6, 0x30] +_0808FD26: + movs r0, 0x1 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808FCE8 + + thumb_func_start sub_808FD34 +sub_808FD34: @ 808FD34 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl GetGoSpeed0AnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x6 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808FD34 + + thumb_func_start sub_808FD64 +sub_808FD64: @ 808FD64 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0808FD82 + ldrb r0, [r4] + movs r1, 0x3 + negs r1, r1 + ands r1, r0 + strb r1, [r4] + movs r0, 0x1 + strh r0, [r5, 0x30] +_0808FD82: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808FD64 + + thumb_func_start FieldObjectCB_FaceFixedDirection +FieldObjectCB_FaceFixedDirection: @ 808FD8C + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =FieldObjectCB2_FaceFixedDirection + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_FaceFixedDirection + + thumb_func_start FieldObjectCB2_FaceFixedDirection +@ bool8 FieldObjectCB2_FaceFixedDirection(struct npc_state *fieldObject, struct obj *object) +FieldObjectCB2_FaceFixedDirection: @ 808FDB0 + push {r4,lr} + ldr r3, =gUnknown_0850D794 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end FieldObjectCB2_FaceFixedDirection + + thumb_func_start sub_808FDD0 +@ bool8 sub_808FDD0(struct npc_state *fieldObject, struct obj *object) +sub_808FDD0: @ 808FDD0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_reset + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x1 + strh r0, [r5, 0x30] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808FDD0 + + thumb_func_start sub_808FDFC +@ bool8 sub_808FDFC(struct npc_state *fieldObject, struct obj *object) +sub_808FDFC: @ 808FDFC + push {r4,lr} + adds r4, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + bne _0808FE0E + movs r0, 0 + b _0808FE14 +_0808FE0E: + movs r0, 0x2 + strh r0, [r4, 0x30] + movs r0, 0x1 +_0808FE14: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808FDFC + + thumb_func_start sub_808FE1C +@ bool8 sub_808FE1C(struct npc_state *fieldObject, struct obj *object) +sub_808FE1C: @ 808FE1C + ldrb r2, [r0] + movs r1, 0x3 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + movs r0, 0 + bx lr + thumb_func_end sub_808FE1C + + thumb_func_start FieldObjectCB_BerryTree +FieldObjectCB_BerryTree: @ 808FE2C + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r5, r0, r1 + ldrh r1, [r4, 0x3C] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0808FE58 + adds r0, r5, 0 + adds r1, r4, 0 + bl get_berry_tree_graphics + ldrh r1, [r4, 0x3C] + movs r0, 0x1 + orrs r0, r1 + strh r0, [r4, 0x3C] +_0808FE58: + ldr r2, =FieldObjectCB2_BerryTree + adds r0, r5, 0 + adds r1, r4, 0 + bl FieldObjectStep + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_BerryTree + + thumb_func_start FieldObjectCB2_BerryTree +FieldObjectCB2_BerryTree: @ 808FE70 + push {r4,lr} + ldr r3, =gUnknown_0850D7A0 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end FieldObjectCB2_BerryTree + + thumb_func_start do_berry_tree_growth_sparkle_1 +@ bool8 do_berry_tree_growth_sparkle_1(struct npc_state *fieldObject, struct obj *object) +do_berry_tree_growth_sparkle_1: @ 808FE90 + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_reset + ldrb r0, [r4, 0x1] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r4, 0x1] + adds r6, r5, 0 + adds r6, 0x3E + ldrb r0, [r6] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r6] + ldrb r0, [r4, 0x1D] + bl GetStageByBerryTreeId + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0 + bne _0808FF00 + ldrh r1, [r5, 0x3C] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _0808FEF6 + subs r6, 0x14 + ldrb r0, [r6] + cmp r0, 0x4 + bne _0808FEF6 + ldr r1, =0x02038c08 + movs r2, 0x10 + ldrsh r0, [r4, r2] + str r0, [r1] + movs r2, 0x12 + ldrsh r0, [r4, r2] + str r0, [r1, 0x4] + adds r0, r5, 0 + adds r0, 0x43 + ldrb r0, [r0] + subs r0, 0x1 + str r0, [r1, 0x8] + ldrb r0, [r5, 0x5] + lsls r0, 28 + lsrs r0, 30 + str r0, [r1, 0xC] + movs r0, 0x17 + bl FieldEffectStart + strb r7, [r6] +_0808FEF6: + movs r0, 0 + b _0808FF42 + .pool +_0808FF00: + ldrb r1, [r4, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] + ldrb r1, [r6] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + subs r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r5, 0 + adds r0, 0x2A + ldrb r0, [r0] + cmp r0, r7 + bne _0808FF3C + adds r0, r4, 0 + adds r1, r5, 0 + bl get_berry_tree_graphics + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x39 + bl FieldObjectSetRegularAnim + movs r0, 0x1 + strh r0, [r5, 0x30] + b _0808FF42 +_0808FF3C: + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 +_0808FF42: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end do_berry_tree_growth_sparkle_1 + + thumb_func_start sub_808FF48 +@ bool8 sub_808FF48(struct npc_state *fieldObject, struct obj *object) +sub_808FF48: @ 808FF48 + push {r4,lr} + adds r4, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + bne _0808FF5A + movs r0, 0 + b _0808FF60 +_0808FF5A: + movs r0, 0 + strh r0, [r4, 0x30] + movs r0, 0x1 +_0808FF60: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808FF48 + + thumb_func_start do_berry_tree_growth_sparkle_2 +@ bool8 do_berry_tree_growth_sparkle_2(struct npc_state *fieldObject, struct obj *object) +do_berry_tree_growth_sparkle_2: @ 808FF68 + push {r4,lr} + ldrb r2, [r0] + movs r3, 0x2 + orrs r2, r3 + strb r2, [r0] + movs r3, 0 + movs r2, 0x3 + strh r2, [r1, 0x30] + strh r3, [r1, 0x32] + ldrh r3, [r1, 0x3C] + movs r2, 0x2 + orrs r2, r3 + strh r2, [r1, 0x3C] + ldr r3, =0x02038c08 + movs r4, 0x10 + ldrsh r2, [r0, r4] + str r2, [r3] + movs r2, 0x12 + ldrsh r0, [r0, r2] + str r0, [r3, 0x4] + adds r0, r1, 0 + adds r0, 0x43 + ldrb r0, [r0] + subs r0, 0x1 + str r0, [r3, 0x8] + ldrb r0, [r1, 0x5] + lsls r0, 28 + lsrs r0, 30 + str r0, [r3, 0xC] + movs r0, 0x17 + bl FieldEffectStart + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end do_berry_tree_growth_sparkle_2 + + thumb_func_start sub_808FFB4 +@ bool8 sub_808FFB4(struct npc_state *fieldObject, struct obj *object) +sub_808FFB4: @ 808FFB4 + push {r4,lr} + adds r3, r0, 0 + adds r4, r1, 0 + ldrh r1, [r4, 0x32] + adds r1, 0x1 + strh r1, [r4, 0x32] + movs r0, 0x2 + ands r1, r0 + lsls r1, 16 + lsrs r1, 17 + lsls r1, 5 + ldrb r2, [r3, 0x1] + subs r0, 0x23 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x1] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x40 + bgt _0808FFEC + movs r0, 0 + b _0808FFFE +_0808FFEC: + adds r0, r3, 0 + adds r1, r4, 0 + bl get_berry_tree_graphics + movs r0, 0x4 + strh r0, [r4, 0x30] + movs r0, 0 + strh r0, [r4, 0x32] + movs r0, 0x1 +_0808FFFE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808FFB4 + + thumb_func_start sub_8090004 +@ bool8 sub_8090004(struct npc_state *fieldObject, struct obj *object) +sub_8090004: @ 8090004 + push {r4,lr} + adds r4, r1, 0 + ldrh r2, [r4, 0x32] + adds r2, 0x1 + strh r2, [r4, 0x32] + movs r1, 0x2 + ands r2, r1 + lsls r2, 16 + lsrs r2, 17 + lsls r2, 5 + ldrb r3, [r0, 0x1] + subs r1, 0x23 + ands r1, r3 + orrs r1, r2 + strb r1, [r0, 0x1] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x40 + bgt _0809003A + movs r0, 0 + b _08090048 +_0809003A: + movs r0, 0 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x3C] + subs r0, 0x3 + ands r0, r1 + strh r0, [r4, 0x3C] + movs r0, 0x1 +_08090048: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090004 + + thumb_func_start FieldObjectCB_RandomlyLookNorthOrSouth +FieldObjectCB_RandomlyLookNorthOrSouth: @ 8090050 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =FieldObjectCB2_RandomlyLookNorthOrSouth + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyLookNorthOrSouth + + thumb_func_start FieldObjectCB2_RandomlyLookNorthOrSouth +FieldObjectCB2_RandomlyLookNorthOrSouth: @ 8090074 + push {r4,lr} + ldr r3, =gUnknown_0850D7B4 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end FieldObjectCB2_RandomlyLookNorthOrSouth + + thumb_func_start sub_8090094 +sub_8090094: @ 8090094 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090094 + + thumb_func_start sub_80900A8 +sub_80900A8: @ 80900A8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80900A8 + + thumb_func_start sub_80900D4 +sub_80900D4: @ 80900D4 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0809010A + ldr r4, =gUnknown_0850D6DC + bl GenerateRandomNumber + movs r5, 0x3 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r7, 0 + bl sub_8097978 + ldrb r1, [r6] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + strh r5, [r7, 0x30] +_0809010A: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80900D4 + + thumb_func_start sub_8090118 +sub_8090118: @ 8090118 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _08090136 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _0809013E +_08090136: + movs r0, 0x4 + strh r0, [r5, 0x30] + movs r0, 0x1 + b _08090140 +_0809013E: + movs r0, 0 +_08090140: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090118 + + thumb_func_start sub_8090148 +sub_8090148: @ 8090148 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D770 + mov r0, sp + movs r2, 0x2 + bl memcpy + adds r0, r4, 0 + movs r1, 0x1 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08090178 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r1, [r0] +_08090178: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090148 + + thumb_func_start FieldObjectCB_RandomlyLookEastOrWest +FieldObjectCB_RandomlyLookEastOrWest: @ 8090190 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =FieldObjectCB2_RandomlyLookEastOrWest + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyLookEastOrWest + + thumb_func_start FieldObjectCB2_RandomlyLookEastOrWest +FieldObjectCB2_RandomlyLookEastOrWest: @ 80901B4 + push {r4,lr} + ldr r3, =gUnknown_0850D7C8 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end FieldObjectCB2_RandomlyLookEastOrWest + + thumb_func_start sub_80901D4 +sub_80901D4: @ 80901D4 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80901D4 + + thumb_func_start sub_80901E8 +sub_80901E8: @ 80901E8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80901E8 + + thumb_func_start sub_8090214 +sub_8090214: @ 8090214 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0809024A + ldr r4, =gUnknown_0850D6DC + bl GenerateRandomNumber + movs r5, 0x3 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r7, 0 + bl sub_8097978 + ldrb r1, [r6] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + strh r5, [r7, 0x30] +_0809024A: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090214 + + thumb_func_start sub_8090258 +sub_8090258: @ 8090258 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _08090276 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _0809027E +_08090276: + movs r0, 0x4 + strh r0, [r5, 0x30] + movs r0, 0x1 + b _08090280 +_0809027E: + movs r0, 0 +_08090280: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090258 + + thumb_func_start sub_8090288 +sub_8090288: @ 8090288 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D790 + mov r0, sp + movs r2, 0x2 + bl memcpy + adds r0, r4, 0 + movs r1, 0x2 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080902B8 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r1, [r0] +_080902B8: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090288 + + thumb_func_start FieldObjectCB_RandomlyLookNorthOrWest +FieldObjectCB_RandomlyLookNorthOrWest: @ 80902D0 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =FieldObjectCB2_RandomlyLookNorthOrWest + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyLookNorthOrWest + + thumb_func_start FieldObjectCB2_RandomlyLookNorthOrWest +FieldObjectCB2_RandomlyLookNorthOrWest: @ 80902F4 + push {r4,lr} + ldr r3, =gUnknown_0850D7DC + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end FieldObjectCB2_RandomlyLookNorthOrWest + + thumb_func_start sub_8090314 +sub_8090314: @ 8090314 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090314 + + thumb_func_start sub_8090328 +sub_8090328: @ 8090328 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090328 + + thumb_func_start sub_8090354 +sub_8090354: @ 8090354 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0809038A + ldr r4, =gUnknown_0850D6EC + bl GenerateRandomNumber + movs r5, 0x3 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r7, 0 + bl sub_8097978 + ldrb r1, [r6] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + strh r5, [r7, 0x30] +_0809038A: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090354 + + thumb_func_start sub_8090398 +sub_8090398: @ 8090398 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _080903B6 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _080903BE +_080903B6: + movs r0, 0x4 + strh r0, [r5, 0x30] + movs r0, 0x1 + b _080903C0 +_080903BE: + movs r0, 0 +_080903C0: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090398 + + thumb_func_start sub_80903C8 +sub_80903C8: @ 80903C8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D7F0 + mov r0, sp + movs r2, 0x2 + bl memcpy + adds r0, r4, 0 + movs r1, 0x3 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080903F8 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r1, [r0] +_080903F8: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80903C8 + + thumb_func_start FieldObjectCB_RandomlyLookNorthOrEast +FieldObjectCB_RandomlyLookNorthOrEast: @ 8090410 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8090434 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyLookNorthOrEast + + thumb_func_start sub_8090434 +sub_8090434: @ 8090434 + push {r4,lr} + ldr r3, =gUnknown_0850D7F4 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090434 + + thumb_func_start sub_8090454 +sub_8090454: @ 8090454 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090454 + + thumb_func_start sub_8090468 +sub_8090468: @ 8090468 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090468 + + thumb_func_start sub_8090494 +sub_8090494: @ 8090494 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _080904CA + ldr r4, =gUnknown_0850D6EC + bl GenerateRandomNumber + movs r5, 0x3 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r7, 0 + bl sub_8097978 + ldrb r1, [r6] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + strh r5, [r7, 0x30] +_080904CA: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090494 + + thumb_func_start sub_80904D8 +sub_80904D8: @ 80904D8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _080904F6 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _080904FE +_080904F6: + movs r0, 0x4 + strh r0, [r5, 0x30] + movs r0, 0x1 + b _08090500 +_080904FE: + movs r0, 0 +_08090500: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80904D8 + + thumb_func_start sub_8090508 +sub_8090508: @ 8090508 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D808 + mov r0, sp + movs r2, 0x2 + bl memcpy + adds r0, r4, 0 + movs r1, 0x4 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08090538 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r1, [r0] +_08090538: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090508 + + thumb_func_start FieldObjectCB_RandomlyLookSouthOrWest +FieldObjectCB_RandomlyLookSouthOrWest: @ 8090550 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8090574 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyLookSouthOrWest + + thumb_func_start sub_8090574 +sub_8090574: @ 8090574 + push {r4,lr} + ldr r3, =gUnknown_0850D80C + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090574 + + thumb_func_start sub_8090594 +sub_8090594: @ 8090594 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090594 + + thumb_func_start sub_80905A8 +sub_80905A8: @ 80905A8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80905A8 + + thumb_func_start sub_80905D4 +sub_80905D4: @ 80905D4 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0809060A + ldr r4, =gUnknown_0850D6EC + bl GenerateRandomNumber + movs r5, 0x3 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r7, 0 + bl sub_8097978 + ldrb r1, [r6] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + strh r5, [r7, 0x30] +_0809060A: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80905D4 + + thumb_func_start sub_8090618 +sub_8090618: @ 8090618 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _08090636 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _0809063E +_08090636: + movs r0, 0x4 + strh r0, [r5, 0x30] + movs r0, 0x1 + b _08090640 +_0809063E: + movs r0, 0 +_08090640: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090618 + + thumb_func_start sub_8090648 +sub_8090648: @ 8090648 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D820 + mov r0, sp + movs r2, 0x2 + bl memcpy + adds r0, r4, 0 + movs r1, 0x5 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08090678 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r1, [r0] +_08090678: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090648 + + thumb_func_start FieldObjectCB_RandomlyLookSouthOrEast +FieldObjectCB_RandomlyLookSouthOrEast: @ 8090690 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_80906B4 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyLookSouthOrEast + + thumb_func_start sub_80906B4 +sub_80906B4: @ 80906B4 + push {r4,lr} + ldr r3, =gUnknown_0850D824 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80906B4 + + thumb_func_start sub_80906D4 +sub_80906D4: @ 80906D4 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80906D4 + + thumb_func_start sub_80906E8 +sub_80906E8: @ 80906E8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80906E8 + + thumb_func_start sub_8090714 +sub_8090714: @ 8090714 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0809074A + ldr r4, =gUnknown_0850D6EC + bl GenerateRandomNumber + movs r5, 0x3 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r7, 0 + bl sub_8097978 + ldrb r1, [r6] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + strh r5, [r7, 0x30] +_0809074A: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090714 + + thumb_func_start sub_8090758 +sub_8090758: @ 8090758 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _08090776 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _0809077E +_08090776: + movs r0, 0x4 + strh r0, [r5, 0x30] + movs r0, 0x1 + b _08090780 +_0809077E: + movs r0, 0 +_08090780: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090758 + + thumb_func_start sub_8090788 +sub_8090788: @ 8090788 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D838 + mov r0, sp + movs r2, 0x2 + bl memcpy + adds r0, r4, 0 + movs r1, 0x6 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080907B8 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r1, [r0] +_080907B8: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090788 + + thumb_func_start FieldObjectCB_RandomlyLookNorthOrSouthOrWest +FieldObjectCB_RandomlyLookNorthOrSouthOrWest: @ 80907D0 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_80907F4 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyLookNorthOrSouthOrWest + + thumb_func_start sub_80907F4 +sub_80907F4: @ 80907F4 + push {r4,lr} + ldr r3, =gUnknown_0850D83C + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80907F4 + + thumb_func_start sub_8090814 +sub_8090814: @ 8090814 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090814 + + thumb_func_start sub_8090828 +sub_8090828: @ 8090828 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090828 + + thumb_func_start sub_8090854 +sub_8090854: @ 8090854 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0809088A + ldr r4, =gUnknown_0850D6EC + bl GenerateRandomNumber + movs r5, 0x3 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r7, 0 + bl sub_8097978 + ldrb r1, [r6] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + strh r5, [r7, 0x30] +_0809088A: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090854 + + thumb_func_start sub_8090898 +sub_8090898: @ 8090898 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _080908B6 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _080908BE +_080908B6: + movs r0, 0x4 + strh r0, [r5, 0x30] + movs r0, 0x1 + b _080908C0 +_080908BE: + movs r0, 0 +_080908C0: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090898 + + thumb_func_start sub_80908C8 +sub_80908C8: @ 80908C8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D850 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r0, r4, 0 + movs r1, 0x7 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080908F8 + bl GenerateRandomNumber + movs r1, 0x3 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r1, [r0] +_080908F8: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80908C8 + + thumb_func_start FieldObjectCB_RandomlyLookNorthOrSouthOrEast +FieldObjectCB_RandomlyLookNorthOrSouthOrEast: @ 8090910 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8090934 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyLookNorthOrSouthOrEast + + thumb_func_start sub_8090934 +sub_8090934: @ 8090934 + push {r4,lr} + ldr r3, =gUnknown_0850D854 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090934 + + thumb_func_start sub_8090954 +sub_8090954: @ 8090954 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090954 + + thumb_func_start sub_8090968 +sub_8090968: @ 8090968 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090968 + + thumb_func_start sub_8090994 +sub_8090994: @ 8090994 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _080909CA + ldr r4, =gUnknown_0850D6EC + bl GenerateRandomNumber + movs r5, 0x3 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r7, 0 + bl sub_8097978 + ldrb r1, [r6] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + strh r5, [r7, 0x30] +_080909CA: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090994 + + thumb_func_start sub_80909D8 +sub_80909D8: @ 80909D8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _080909F6 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _080909FE +_080909F6: + movs r0, 0x4 + strh r0, [r5, 0x30] + movs r0, 0x1 + b _08090A00 +_080909FE: + movs r0, 0 +_08090A00: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80909D8 + + thumb_func_start sub_8090A08 +sub_8090A08: @ 8090A08 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D868 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r0, r4, 0 + movs r1, 0x8 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08090A38 + bl GenerateRandomNumber + movs r1, 0x3 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r1, [r0] +_08090A38: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090A08 + + thumb_func_start FieldObjectCB_RandomlyLookNorthOrEastOrWest +FieldObjectCB_RandomlyLookNorthOrEastOrWest: @ 8090A50 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8090A74 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyLookNorthOrEastOrWest + + thumb_func_start sub_8090A74 +sub_8090A74: @ 8090A74 + push {r4,lr} + ldr r3, =gUnknown_0850D86C + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090A74 + + thumb_func_start sub_8090A94 +sub_8090A94: @ 8090A94 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090A94 + + thumb_func_start sub_8090AA8 +sub_8090AA8: @ 8090AA8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090AA8 + + thumb_func_start sub_8090AD4 +sub_8090AD4: @ 8090AD4 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _08090B0A + ldr r4, =gUnknown_0850D6EC + bl GenerateRandomNumber + movs r5, 0x3 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r7, 0 + bl sub_8097978 + ldrb r1, [r6] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + strh r5, [r7, 0x30] +_08090B0A: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090AD4 + + thumb_func_start sub_8090B18 +sub_8090B18: @ 8090B18 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _08090B36 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _08090B3E +_08090B36: + movs r0, 0x4 + strh r0, [r5, 0x30] + movs r0, 0x1 + b _08090B40 +_08090B3E: + movs r0, 0 +_08090B40: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090B18 + + thumb_func_start sub_8090B48 +sub_8090B48: @ 8090B48 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D880 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r0, r4, 0 + movs r1, 0x9 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08090B78 + bl GenerateRandomNumber + movs r1, 0x3 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r1, [r0] +_08090B78: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090B48 + + thumb_func_start FieldObjectCB_RandomlyLookSouthOrEastOrWest +FieldObjectCB_RandomlyLookSouthOrEastOrWest: @ 8090B90 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8090BB4 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_RandomlyLookSouthOrEastOrWest + + thumb_func_start sub_8090BB4 +sub_8090BB4: @ 8090BB4 + push {r4,lr} + ldr r3, =gUnknown_0850D884 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090BB4 + + thumb_func_start sub_8090BD4 +sub_8090BD4: @ 8090BD4 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090BD4 + + thumb_func_start sub_8090BE8 +sub_8090BE8: @ 8090BE8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090BE8 + + thumb_func_start sub_8090C14 +sub_8090C14: @ 8090C14 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _08090C4A + ldr r4, =gUnknown_0850D6EC + bl GenerateRandomNumber + movs r5, 0x3 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r7, 0 + bl sub_8097978 + ldrb r1, [r6] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r6] + strh r5, [r7, 0x30] +_08090C4A: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090C14 + + thumb_func_start sub_8090C58 +sub_8090C58: @ 8090C58 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _08090C76 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _08090C7E +_08090C76: + movs r0, 0x4 + strh r0, [r5, 0x30] + movs r0, 0x1 + b _08090C80 +_08090C7E: + movs r0, 0 +_08090C80: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090C58 + + thumb_func_start sub_8090C88 +sub_8090C88: @ 8090C88 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D898 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r0, r4, 0 + movs r1, 0xA + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08090CB8 + bl GenerateRandomNumber + movs r1, 0x3 + ands r1, r0 + mov r2, sp + adds r0, r2, r1 + ldrb r1, [r0] +_08090CB8: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x30] + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090C88 + + thumb_func_start FieldObjectCB_LookAroundCounterclockwise +FieldObjectCB_LookAroundCounterclockwise: @ 8090CD0 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8090CF4 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_LookAroundCounterclockwise + + thumb_func_start sub_8090CF4 +sub_8090CF4: @ 8090CF4 + push {r4,lr} + ldr r3, =gUnknown_0850D89C + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090CF4 + + thumb_func_start sub_8090D14 +sub_8090D14: @ 8090D14 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_reset + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x1 + strh r0, [r5, 0x30] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090D14 + + thumb_func_start sub_8090D40 +sub_8090D40: @ 8090D40 + push {r4,lr} + adds r4, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _08090D5A + adds r0, r4, 0 + movs r1, 0x30 + bl sub_8097978 + movs r0, 0x2 + strh r0, [r4, 0x30] +_08090D5A: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090D40 + + thumb_func_start sub_8090D64 +sub_8090D64: @ 8090D64 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _08090D82 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _08090D86 +_08090D82: + movs r0, 0x3 + strh r0, [r5, 0x30] +_08090D86: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090D64 + + thumb_func_start sub_8090D90 +@ bool8 sub_8090D90(struct npc_state *fieldObject, struct obj *object) +sub_8090D90: @ 8090D90 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D8AC + mov r0, sp + movs r2, 0x5 + bl memcpy + adds r0, r4, 0 + movs r1, 0 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08090DBC + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + add r0, sp + ldrb r1, [r0] +_08090DBC: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0 + strh r0, [r5, 0x30] + movs r0, 0x1 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090D90 + + thumb_func_start FieldObjectCB_LookAroundClockwise +FieldObjectCB_LookAroundClockwise: @ 8090DD4 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8090DF8 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_LookAroundClockwise + + thumb_func_start sub_8090DF8 +sub_8090DF8: @ 8090DF8 + push {r4,lr} + ldr r3, =gUnknown_0850D8B4 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090DF8 + + thumb_func_start sub_8090E18 +sub_8090E18: @ 8090E18 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_reset + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x1 + strh r0, [r5, 0x30] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090E18 + + thumb_func_start sub_8090E44 +sub_8090E44: @ 8090E44 + push {r4,lr} + adds r4, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _08090E5E + adds r0, r4, 0 + movs r1, 0x30 + bl sub_8097978 + movs r0, 0x2 + strh r0, [r4, 0x30] +_08090E5E: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090E44 + + thumb_func_start sub_8090E68 +sub_8090E68: @ 8090E68 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + bne _08090E86 + adds r0, r4, 0 + bl FieldObjectIsTrainerAndCloseToPlayer + lsls r0, 24 + cmp r0, 0 + beq _08090E8A +_08090E86: + movs r0, 0x3 + strh r0, [r5, 0x30] +_08090E8A: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8090E68 + + thumb_func_start sub_8090E94 +sub_8090E94: @ 8090E94 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D8C4 + mov r0, sp + movs r2, 0x5 + bl memcpy + adds r0, r4, 0 + movs r1, 0 + bl sub_808F8BC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08090EC0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + add r0, sp + ldrb r1, [r0] +_08090EC0: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0 + strh r0, [r5, 0x30] + movs r0, 0x1 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090E94 + + thumb_func_start FieldObjectCB_AlternatelyGoInOppositeDirections +FieldObjectCB_AlternatelyGoInOppositeDirections: @ 8090ED8 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8090EFC + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_AlternatelyGoInOppositeDirections + + thumb_func_start sub_8090EFC +sub_8090EFC: @ 8090EFC + push {r4,lr} + ldr r3, =gUnknown_0850D8CC + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090EFC + + thumb_func_start sub_8090F1C +sub_8090F1C: @ 8090F1C + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090F1C + + thumb_func_start sub_8090F30 +@ bool8 sub_8090F30(struct npc_state *fieldObject, struct obj *object) +sub_8090F30: @ 8090F30 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, =gUnknown_085055CD + ldrb r1, [r4, 0x6] + adds r1, r0 + ldrb r1, [r1] + adds r0, r4, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0 + beq _08090F52 + adds r0, r1, 0 + bl GetOppositeDirection + lsls r0, 24 + lsrs r1, r0, 24 +_08090F52: + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8090F30 + + thumb_func_start sub_8090F68 +@ bool8 sub_8090F68(struct npc_state *fieldObject, struct obj *object) +sub_8090F68: @ 8090F68 + push {r4-r7,lr} + adds r4, r0, 0 + adds r7, r1, 0 + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0 + beq _08090F98 + ldr r1, [r4, 0xC] + ldr r0, [r4, 0x10] + cmp r1, r0 + bne _08090F98 + movs r0, 0 + strb r0, [r2] + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl GetOppositeDirection + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetDirection +_08090F98: + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl sub_8092B88 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl GetGoSpeed0AnimId + lsls r0, 24 + lsrs r6, r0, 24 + cmp r5, 0x1 + bne _08090FEE + adds r1, r4, 0 + adds r1, 0x21 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl GetOppositeDirection + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetDirection + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl GetGoSpeed0AnimId + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl sub_8092B88 + lsls r0, 24 + lsrs r5, r0, 24 +_08090FEE: + cmp r5, 0 + beq _08091000 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetStepInPlaceDelay16AnimId + lsls r0, 24 + lsrs r6, r0, 24 +_08091000: + adds r0, r4, 0 + adds r1, r7, 0 + adds r2, r6, 0 + bl FieldObjectSetRegularAnim + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x3 + strh r0, [r7, 0x30] + movs r0, 0x1 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8090F68 + + thumb_func_start sub_8091020 +@ bool8 sub_8091020(struct npc_state *fieldObject, struct obj *object) +sub_8091020: @ 8091020 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0809103E + ldrb r0, [r4] + movs r1, 0x3 + negs r1, r1 + ands r1, r0 + strb r1, [r4] + movs r0, 0x1 + strh r0, [r5, 0x30] +_0809103E: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8091020 + + thumb_func_start sub_8091048 +@ bool8 sub_8091048(struct npc_state *fieldObject, struct obj *object) +sub_8091048: @ 8091048 + push {r4,lr} + adds r4, r1, 0 + bl npc_reset + movs r0, 0x1 + strh r0, [r4, 0x30] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8091048 + + thumb_func_start MoveFieldObjectInNextDirectionInSequence +@ bool8 MoveFieldObjectInNextDirectionInSequence(struct npc_state *fieldObject, struct obj *object, u8 *directions) +MoveFieldObjectInNextDirectionInSequence: @ 809105C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + mov r8, r1 + adds r7, r2, 0 + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x3 + bne _0809107E + ldr r1, [r4, 0xC] + ldr r0, [r4, 0x10] + cmp r1, r0 + bne _0809107E + movs r0, 0 + strb r0, [r2] +_0809107E: + adds r5, r4, 0 + adds r5, 0x21 + ldrb r0, [r5] + adds r0, r7, r0 + ldrb r1, [r0] + adds r0, r4, 0 + bl FieldObjectSetDirection + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl GetGoSpeed0AnimId + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl sub_8092B88 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080910D8 + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + ldrb r0, [r5] + adds r0, r7, r0 + ldrb r1, [r0] + adds r0, r4, 0 + bl FieldObjectSetDirection + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl GetGoSpeed0AnimId + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl sub_8092B88 + lsls r0, 24 + lsrs r0, 24 +_080910D8: + cmp r0, 0 + beq _080910EA + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetStepInPlaceDelay16AnimId + lsls r0, 24 + lsrs r6, r0, 24 +_080910EA: + adds r0, r4, 0 + mov r1, r8 + adds r2, r6, 0 + bl FieldObjectSetRegularAnim + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x2 + mov r1, r8 + strh r0, [r1, 0x30] + movs r0, 0x1 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end MoveFieldObjectInNextDirectionInSequence + + thumb_func_start sub_8091110 +@ bool8 sub_8091110(struct npc_state *fieldObject, struct obj *object) +sub_8091110: @ 8091110 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _0809112E + ldrb r0, [r4] + movs r1, 0x3 + negs r1, r1 + ands r1, r0 + strb r1, [r4] + movs r0, 0x1 + strh r0, [r5, 0x30] +_0809112E: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8091110 + + thumb_func_start FieldObjectCB_GoInDirectionSequence1 +FieldObjectCB_GoInDirectionSequence1: @ 8091138 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_809115C + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence1 + + thumb_func_start sub_809115C +sub_809115C: @ 809115C + push {r4,lr} + ldr r3, =gUnknown_0850D8DC + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809115C + + thumb_func_start sub_809117C +sub_809117C: @ 809117C + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D8E8 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _080911A8 + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _080911A8 + movs r0, 0x3 + strb r0, [r2] +_080911A8: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809117C + + thumb_func_start FieldObjectCB_GoInDirectionSequence2 +FieldObjectCB_GoInDirectionSequence2: @ 80911C4 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_80911E8 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence2 + + thumb_func_start sub_80911E8 +sub_80911E8: @ 80911E8 + push {r4,lr} + ldr r3, =gUnknown_0850D8EC + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80911E8 + + thumb_func_start sub_8091208 +sub_8091208: @ 8091208 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D8F8 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x1 + bne _08091234 + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091234 + movs r0, 0x2 + strb r0, [r2] +_08091234: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091208 + + thumb_func_start FieldObjectCB_GoInDirectionSequence3 +FieldObjectCB_GoInDirectionSequence3: @ 8091250 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091274 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence3 + + thumb_func_start sub_8091274 +sub_8091274: @ 8091274 + push {r4,lr} + ldr r3, =gUnknown_0850D8FC + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091274 + + thumb_func_start sub_8091294 +sub_8091294: @ 8091294 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D908 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x1 + bne _080912C0 + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _080912C0 + movs r0, 0x2 + strb r0, [r2] +_080912C0: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091294 + + thumb_func_start FieldObjectCB_GoInDirectionSequence4 +FieldObjectCB_GoInDirectionSequence4: @ 80912DC + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091300 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence4 + + thumb_func_start sub_8091300 +sub_8091300: @ 8091300 + push {r4,lr} + ldr r3, =gUnknown_0850D90C + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091300 + + thumb_func_start sub_8091320 +sub_8091320: @ 8091320 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D918 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _0809134C + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _0809134C + movs r0, 0x3 + strb r0, [r2] +_0809134C: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091320 + + thumb_func_start FieldObjectCB_GoInDirectionSequence5 +FieldObjectCB_GoInDirectionSequence5: @ 8091368 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_809138C + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence5 + + thumb_func_start sub_809138C +sub_809138C: @ 809138C + push {r4,lr} + ldr r3, =gUnknown_0850D91C + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809138C + + thumb_func_start sub_80913AC +@ bool8 sub_80913AC(struct npc_state *fieldObject, struct obj *object) +sub_80913AC: @ 80913AC + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D928 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _080913D8 + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _080913D8 + movs r0, 0x3 + strb r0, [r2] +_080913D8: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80913AC + + thumb_func_start FieldObjectCB_GoInDirectionSequence6 +FieldObjectCB_GoInDirectionSequence6: @ 80913F4 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091418 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence6 + + thumb_func_start sub_8091418 +sub_8091418: @ 8091418 + push {r4,lr} + ldr r3, =gUnknown_0850D92C + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091418 + + thumb_func_start sub_8091438 +sub_8091438: @ 8091438 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D938 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x1 + bne _08091464 + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091464 + movs r0, 0x2 + strb r0, [r2] +_08091464: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091438 + + thumb_func_start FieldObjectCB_GoInDirectionSequence7 +FieldObjectCB_GoInDirectionSequence7: @ 8091480 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_80914A4 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence7 + + thumb_func_start sub_80914A4 +sub_80914A4: @ 80914A4 + push {r4,lr} + ldr r3, =gUnknown_0850D93C + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80914A4 + + thumb_func_start sub_80914C4 +sub_80914C4: @ 80914C4 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D710 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x1 + bne _080914F0 + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _080914F0 + movs r0, 0x2 + strb r0, [r2] +_080914F0: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80914C4 + + thumb_func_start FieldObjectCB_GoInDirectionSequence8 +FieldObjectCB_GoInDirectionSequence8: @ 809150C + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091530 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence8 + + thumb_func_start sub_8091530 +sub_8091530: @ 8091530 + push {r4,lr} + ldr r3, =gUnknown_0850D948 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091530 + + thumb_func_start sub_8091550 +sub_8091550: @ 8091550 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D954 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _0809157C + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _0809157C + movs r0, 0x3 + strb r0, [r2] +_0809157C: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091550 + + thumb_func_start FieldObjectCB_GoInDirectionSequence9 +FieldObjectCB_GoInDirectionSequence9: @ 8091598 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_80915BC + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence9 + + thumb_func_start sub_80915BC +sub_80915BC: @ 80915BC + push {r4,lr} + ldr r3, =gUnknown_0850D958 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80915BC + + thumb_func_start sub_80915DC +sub_80915DC: @ 80915DC + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D964 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _08091608 + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091608 + movs r0, 0x3 + strb r0, [r2] +_08091608: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80915DC + + thumb_func_start FieldObjectCB_GoInDirectionSequence10 +FieldObjectCB_GoInDirectionSequence10: @ 8091624 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091648 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence10 + + thumb_func_start sub_8091648 +sub_8091648: @ 8091648 + push {r4,lr} + ldr r3, =gUnknown_0850D968 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091648 + + thumb_func_start sub_8091668 +sub_8091668: @ 8091668 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D974 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x1 + bne _08091694 + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091694 + movs r0, 0x2 + strb r0, [r2] +_08091694: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091668 + + thumb_func_start FieldObjectCB_GoInDirectionSequence11 +FieldObjectCB_GoInDirectionSequence11: @ 80916B0 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_80916D4 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence11 + + thumb_func_start sub_80916D4 +sub_80916D4: @ 80916D4 + push {r4,lr} + ldr r3, =gUnknown_0850D978 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80916D4 + + thumb_func_start sub_80916F4 +sub_80916F4: @ 80916F4 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D984 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x1 + bne _08091720 + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091720 + movs r0, 0x2 + strb r0, [r2] +_08091720: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80916F4 + + thumb_func_start FieldObjectCB_GoInDirectionSequence12 +FieldObjectCB_GoInDirectionSequence12: @ 809173C + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091760 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence12 + + thumb_func_start sub_8091760 +sub_8091760: @ 8091760 + push {r4,lr} + ldr r3, =gUnknown_0850D988 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091760 + + thumb_func_start sub_8091780 +sub_8091780: @ 8091780 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D994 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _080917AC + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _080917AC + movs r0, 0x3 + strb r0, [r2] +_080917AC: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091780 + + thumb_func_start FieldObjectCB_GoInDirectionSequence13 +FieldObjectCB_GoInDirectionSequence13: @ 80917C8 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_80917EC + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence13 + + thumb_func_start sub_80917EC +sub_80917EC: @ 80917EC + push {r4,lr} + ldr r3, =gUnknown_0850D998 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80917EC + + thumb_func_start sub_809180C +sub_809180C: @ 809180C + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D9A4 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _08091838 + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091838 + movs r0, 0x3 + strb r0, [r2] +_08091838: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809180C + + thumb_func_start FieldObjectCB_GoInDirectionSequence14 +FieldObjectCB_GoInDirectionSequence14: @ 8091854 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091878 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence14 + + thumb_func_start sub_8091878 +sub_8091878: @ 8091878 + push {r4,lr} + ldr r3, =gUnknown_0850D9A8 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091878 + + thumb_func_start sub_8091898 +sub_8091898: @ 8091898 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D9B4 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x1 + bne _080918C4 + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _080918C4 + movs r0, 0x2 + strb r0, [r2] +_080918C4: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091898 + + thumb_func_start FieldObjectCB_GoInDirectionSequence15 +FieldObjectCB_GoInDirectionSequence15: @ 80918E0 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091904 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence15 + + thumb_func_start sub_8091904 +sub_8091904: @ 8091904 + push {r4,lr} + ldr r3, =gUnknown_0850D9B8 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091904 + + thumb_func_start sub_8091924 +sub_8091924: @ 8091924 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D9C4 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x1 + bne _08091950 + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091950 + movs r0, 0x2 + strb r0, [r2] +_08091950: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091924 + + thumb_func_start FieldObjectCB_GoInDirectionSequence16 +FieldObjectCB_GoInDirectionSequence16: @ 809196C + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091990 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence16 + + thumb_func_start sub_8091990 +sub_8091990: @ 8091990 + push {r4,lr} + ldr r3, =gUnknown_0850D9C8 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091990 + + thumb_func_start sub_80919B0 +sub_80919B0: @ 80919B0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D9D4 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _080919DC + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _080919DC + movs r0, 0x3 + strb r0, [r2] +_080919DC: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80919B0 + + thumb_func_start FieldObjectCB_GoInDirectionSequence17 +FieldObjectCB_GoInDirectionSequence17: @ 80919F8 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091A1C + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence17 + + thumb_func_start sub_8091A1C +sub_8091A1C: @ 8091A1C + push {r4,lr} + ldr r3, =gUnknown_0850D9D8 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091A1C + + thumb_func_start sub_8091A3C +sub_8091A3C: @ 8091A3C + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D9E4 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _08091A68 + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091A68 + movs r0, 0x3 + strb r0, [r2] +_08091A68: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091A3C + + thumb_func_start FieldObjectCB_GoInDirectionSequence18 +FieldObjectCB_GoInDirectionSequence18: @ 8091A84 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091AA8 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence18 + + thumb_func_start sub_8091AA8 +sub_8091AA8: @ 8091AA8 + push {r4,lr} + ldr r3, =gUnknown_0850D9E8 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091AA8 + + thumb_func_start sub_8091AC8 +sub_8091AC8: @ 8091AC8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850D9F4 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _08091AF4 + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091AF4 + movs r0, 0x3 + strb r0, [r2] +_08091AF4: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091AC8 + + thumb_func_start FieldObjectCB_GoInDirectionSequence19 +FieldObjectCB_GoInDirectionSequence19: @ 8091B10 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091B34 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence19 + + thumb_func_start sub_8091B34 +sub_8091B34: @ 8091B34 + push {r4,lr} + ldr r3, =gUnknown_0850D9F8 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091B34 + + thumb_func_start sub_8091B54 +sub_8091B54: @ 8091B54 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850DA04 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _08091B80 + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091B80 + movs r0, 0x3 + strb r0, [r2] +_08091B80: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091B54 + + thumb_func_start FieldObjectCB_GoInDirectionSequence20 +FieldObjectCB_GoInDirectionSequence20: @ 8091B9C + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091BC0 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence20 + + thumb_func_start sub_8091BC0 +sub_8091BC0: @ 8091BC0 + push {r4,lr} + ldr r3, =gUnknown_0850DA08 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091BC0 + + thumb_func_start sub_8091BE0 +sub_8091BE0: @ 8091BE0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850DA14 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _08091C0C + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091C0C + movs r0, 0x3 + strb r0, [r2] +_08091C0C: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091BE0 + + thumb_func_start FieldObjectCB_GoInDirectionSequence21 +FieldObjectCB_GoInDirectionSequence21: @ 8091C28 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091C4C + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence21 + + thumb_func_start sub_8091C4C +sub_8091C4C: @ 8091C4C + push {r4,lr} + ldr r3, =gUnknown_0850DA18 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091C4C + + thumb_func_start sub_8091C6C +sub_8091C6C: @ 8091C6C + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850DA24 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _08091C98 + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091C98 + movs r0, 0x3 + strb r0, [r2] +_08091C98: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091C6C + + thumb_func_start FieldObjectCB_GoInDirectionSequence22 +FieldObjectCB_GoInDirectionSequence22: @ 8091CB4 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091CD8 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence22 + + thumb_func_start sub_8091CD8 +sub_8091CD8: @ 8091CD8 + push {r4,lr} + ldr r3, =gUnknown_0850DA28 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091CD8 + + thumb_func_start sub_8091CF8 +sub_8091CF8: @ 8091CF8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850DA34 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _08091D24 + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r3, 0x12 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091D24 + movs r0, 0x3 + strb r0, [r2] +_08091D24: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091CF8 + + thumb_func_start FieldObjectCB_GoInDirectionSequence23 +FieldObjectCB_GoInDirectionSequence23: @ 8091D40 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091D64 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence23 + + thumb_func_start sub_8091D64 +sub_8091D64: @ 8091D64 + push {r4,lr} + ldr r3, =gUnknown_0850DA38 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091D64 + + thumb_func_start sub_8091D84 +sub_8091D84: @ 8091D84 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850DA44 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _08091DB0 + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091DB0 + movs r0, 0x3 + strb r0, [r2] +_08091DB0: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091D84 + + thumb_func_start FieldObjectCB_GoInDirectionSequence24 +FieldObjectCB_GoInDirectionSequence24: @ 8091DCC + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091DF0 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_GoInDirectionSequence24 + + thumb_func_start sub_8091DF0 +sub_8091DF0: @ 8091DF0 + push {r4,lr} + ldr r3, =gUnknown_0850DA48 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091DF0 + + thumb_func_start sub_8091E10 +sub_8091E10: @ 8091E10 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850DA54 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0x2 + bne _08091E3C + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _08091E3C + movs r0, 0x3 + strb r0, [r2] +_08091E3C: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl MoveFieldObjectInNextDirectionInSequence + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091E10 + + thumb_func_start FieldObjectCB_CopyPlayer1 +FieldObjectCB_CopyPlayer1: @ 8091E58 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8091E7C + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_CopyPlayer1 + + thumb_func_start sub_8091E7C +sub_8091E7C: @ 8091E7C + push {r4,lr} + ldr r3, =gUnknown_0850DA58 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091E7C + + thumb_func_start mss_npc_reset_oampriv3_1_unk2_unk3 +@ bool8 mss_npc_reset_oampriv3_1_unk2_unk3(struct npc_state *fieldObject, struct obj *object) +mss_npc_reset_oampriv3_1_unk2_unk3: @ 8091E9C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_reset + adds r4, 0x21 + ldrb r0, [r4] + cmp r0, 0 + bne _08091EB4 + bl player_get_direction_lower_nybble + strb r0, [r4] +_08091EB4: + movs r0, 0x1 + strh r0, [r5, 0x30] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end mss_npc_reset_oampriv3_1_unk2_unk3 + + thumb_func_start sub_8091EC0 +@ bool8 sub_8091EC0(struct npc_state *fieldObject, struct obj *object) +sub_8091EC0: @ 8091EC0 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + ldr r2, =0x02037350 + ldr r3, =0x02037590 + ldrb r1, [r3, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1C] + cmp r0, 0xFF + beq _08091EE0 + ldrb r0, [r3, 0x3] + cmp r0, 0x2 + bne _08091EEC +_08091EE0: + movs r0, 0 + b _08091F14 + .pool +_08091EEC: + ldr r5, =gUnknown_0850DA64 + bl player_get_x22 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 22 + adds r4, r5 + bl player_get_direction_upper_nybble + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r4, [r4] + adds r0, r6, 0 + adds r1, r7, 0 + movs r3, 0 + bl _call_via_r4 + lsls r0, 24 + lsrs r0, 24 +_08091F14: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091EC0 + + thumb_func_start sub_8091F20 +sub_8091F20: @ 8091F20 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _08091F3E + ldrb r0, [r4] + movs r1, 0x3 + negs r1, r1 + ands r1, r0 + strb r1, [r4] + movs r0, 0x1 + strh r0, [r5, 0x30] +_08091F3E: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8091F20 + + thumb_func_start sub_8091F48 +sub_8091F48: @ 8091F48 + movs r0, 0 + bx lr + thumb_func_end sub_8091F48 + + thumb_func_start sub_8091F4C +sub_8091F4C: @ 8091F4C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r1, =gUnknown_085055CD + ldrb r0, [r4, 0x6] + adds r0, r1 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x21 + ldrb r1, [r1] + bl state_to_direction + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091F4C + + thumb_func_start sub_8091F94 +sub_8091F94: @ 8091F94 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r7, r1, 0 + mov r8, r3 + lsls r2, 24 + lsrs r5, r2, 24 + adds r6, r5, 0 + bl FieldObjectIsFarawayIslandMew + lsls r0, 24 + cmp r0, 0 + beq _08091FFC + bl sub_81D427C + adds r5, r0, 0 + cmp r5, 0 + bne _08092012 + adds r5, r6, 0 + ldr r1, =gUnknown_085055CD + ldrb r0, [r4, 0x6] + adds r0, r1 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x21 + ldrb r1, [r1] + adds r2, r5, 0 + bl state_to_direction + adds r5, r0, 0 + mov r3, sp + adds r3, 0x2 + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + bl FieldObjectMoveDestCoords + adds r0, r5, 0 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim + b _08092084 + .pool +_08091FFC: + ldr r1, =gUnknown_085055CD + ldrb r0, [r4, 0x6] + adds r0, r1 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x21 + ldrb r1, [r1] + adds r2, r5, 0 + bl state_to_direction + adds r5, r0, 0 +_08092012: + mov r6, sp + adds r6, 0x2 + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + adds r3, r6, 0 + bl FieldObjectMoveDestCoords + adds r0, r5, 0 + bl GetGoSpeed0AnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r6, r0] + adds r0, r4, 0 + adds r3, r5, 0 + bl npc_block_way + lsls r0, 24 + cmp r0, 0 + bne _08092070 + mov r1, r8 + cmp r1, 0 + beq _08092084 + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0 + ldrsh r1, [r6, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r8 + lsls r0, 24 + cmp r0, 0 + bne _08092084 +_08092070: + adds r0, r5, 0 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim +_08092084: + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x2 + strh r0, [r7, 0x30] + movs r0, 0x1 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8091F94 + + thumb_func_start sub_80920A4 +sub_80920A4: @ 80920A4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r7, r1, 0 + mov r8, r3 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r1, =gUnknown_085055CD + ldrb r0, [r4, 0x6] + adds r0, r1 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x21 + ldrb r1, [r1] + adds r2, r6, 0 + bl state_to_direction + adds r6, r0, 0 + mov r5, sp + adds r5, 0x2 + adds r0, r4, 0 + adds r1, r6, 0 + mov r2, sp + adds r3, r5, 0 + bl FieldObjectMoveDestCoords + adds r0, r6, 0 + bl GetGoSpeed1AnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r5, r0] + adds r0, r4, 0 + adds r3, r6, 0 + bl npc_block_way + lsls r0, 24 + cmp r0, 0 + bne _0809212A + mov r1, r8 + cmp r1, 0 + beq _0809213E + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r8 + lsls r0, 24 + cmp r0, 0 + bne _0809213E +_0809212A: + adds r0, r6, 0 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim +_0809213E: + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x2 + strh r0, [r7, 0x30] + movs r0, 0x1 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80920A4 + + thumb_func_start sub_809215C +sub_809215C: @ 809215C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r7, r1, 0 + mov r8, r3 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r1, =gUnknown_085055CD + ldrb r0, [r4, 0x6] + adds r0, r1 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x21 + ldrb r1, [r1] + adds r2, r6, 0 + bl state_to_direction + adds r6, r0, 0 + mov r5, sp + adds r5, 0x2 + adds r0, r4, 0 + adds r1, r6, 0 + mov r2, sp + adds r3, r5, 0 + bl FieldObjectMoveDestCoords + adds r0, r6, 0 + bl GetGoSpeed3AnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r5, r0] + adds r0, r4, 0 + adds r3, r6, 0 + bl npc_block_way + lsls r0, 24 + cmp r0, 0 + bne _080921E2 + mov r1, r8 + cmp r1, 0 + beq _080921F6 + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r8 + lsls r0, 24 + cmp r0, 0 + bne _080921F6 +_080921E2: + adds r0, r6, 0 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim +_080921F6: + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x2 + strh r0, [r7, 0x30] + movs r0, 0x1 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809215C + + thumb_func_start sub_8092214 +sub_8092214: @ 8092214 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r7, r1, 0 + mov r8, r3 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r1, =gUnknown_085055CD + ldrb r0, [r4, 0x6] + adds r0, r1 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x21 + ldrb r1, [r1] + adds r2, r6, 0 + bl state_to_direction + adds r6, r0, 0 + mov r5, sp + adds r5, 0x2 + adds r0, r4, 0 + adds r1, r6, 0 + mov r2, sp + adds r3, r5, 0 + bl FieldObjectMoveDestCoords + adds r0, r6, 0 + bl sub_8093438 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r5, r0] + adds r0, r4, 0 + adds r3, r6, 0 + bl npc_block_way + lsls r0, 24 + cmp r0, 0 + bne _0809229A + mov r1, r8 + cmp r1, 0 + beq _080922AE + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r8 + lsls r0, 24 + cmp r0, 0 + bne _080922AE +_0809229A: + adds r0, r6, 0 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim +_080922AE: + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x2 + strh r0, [r7, 0x30] + movs r0, 0x1 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8092214 + + thumb_func_start cph_IM_DIFFERENT +cph_IM_DIFFERENT: @ 80922CC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r1, =gUnknown_085055CD + ldrb r0, [r4, 0x6] + adds r0, r1 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x21 + ldrb r1, [r1] + bl state_to_direction + bl sub_80934BC + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x2 + strh r0, [r5, 0x30] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end cph_IM_DIFFERENT + + thumb_func_start sub_8092314 +sub_8092314: @ 8092314 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r7, r1, 0 + mov r8, r3 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r1, =gUnknown_085055CD + ldrb r0, [r4, 0x6] + adds r0, r1 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x21 + ldrb r1, [r1] + adds r2, r6, 0 + bl state_to_direction + adds r6, r0, 0 + mov r5, sp + adds r5, 0x2 + adds r0, r4, 0 + adds r1, r6, 0 + mov r2, sp + adds r3, r5, 0 + bl FieldObjectMoveDestCoords + adds r0, r6, 0 + bl sub_8093514 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r5, r0] + adds r0, r4, 0 + adds r3, r6, 0 + bl npc_block_way + lsls r0, 24 + cmp r0, 0 + bne _0809239A + mov r1, r8 + cmp r1, 0 + beq _080923AE + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r8 + lsls r0, 24 + cmp r0, 0 + bne _080923AE +_0809239A: + adds r0, r6, 0 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim +_080923AE: + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x2 + strh r0, [r7, 0x30] + movs r0, 0x1 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8092314 + + thumb_func_start oac_hopping +oac_hopping: @ 80923CC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r4, r0, 0 + adds r7, r1, 0 + mov r8, r3 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r1, =gUnknown_085055CD + ldrb r0, [r4, 0x6] + adds r0, r1 + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x21 + ldrb r1, [r1] + adds r2, r6, 0 + bl state_to_direction + adds r6, r0, 0 + ldrh r1, [r4, 0x10] + add r0, sp, 0x4 + strh r1, [r0] + ldrh r0, [r4, 0x12] + mov r5, sp + adds r5, 0x6 + strh r0, [r5] + movs r0, 0x2 + str r0, [sp] + adds r0, r6, 0 + add r1, sp, 0x4 + adds r2, r5, 0 + movs r3, 0x2 + bl sub_8092F88 + adds r0, r6, 0 + bl GetJumpLedgeAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim + add r0, sp, 0x4 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r5, r0] + adds r0, r4, 0 + adds r3, r6, 0 + bl npc_block_way + lsls r0, 24 + cmp r0, 0 + bne _08092460 + mov r1, r8 + cmp r1, 0 + beq _08092474 + add r0, sp, 0x4 + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r8 + lsls r0, 24 + cmp r0, 0 + bne _08092474 +_08092460: + adds r0, r6, 0 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r7, 0 + bl FieldObjectSetRegularAnim +_08092474: + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x2 + strh r0, [r7, 0x30] + movs r0, 0x1 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end oac_hopping + + thumb_func_start FieldObjectCB_CopyPlayer2 +FieldObjectCB_CopyPlayer2: @ 8092494 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_80924B8 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_CopyPlayer2 + + thumb_func_start sub_80924B8 +sub_80924B8: @ 80924B8 + push {r4,lr} + ldr r3, =gUnknown_0850DA90 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80924B8 + + thumb_func_start mss_08062EA4 +mss_08062EA4: @ 80924D8 + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + ldr r2, =0x02037350 + ldr r3, =0x02037590 + ldrb r1, [r3, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1C] + cmp r0, 0xFF + beq _080924F8 + ldrb r0, [r3, 0x3] + cmp r0, 0x2 + bne _08092504 +_080924F8: + movs r0, 0 + b _0809252C + .pool +_08092504: + ldr r5, =gUnknown_0850DA64 + bl player_get_x22 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 22 + adds r4, r5 + bl player_get_direction_upper_nybble + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r3, =sub_8088E64 + ldr r4, [r4] + adds r0, r6, 0 + adds r1, r7, 0 + bl _call_via_r4 + lsls r0, 24 + lsrs r0, 24 +_0809252C: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end mss_08062EA4 + + thumb_func_start FieldObjectCB_TreeDisguise +@ void FieldObjectCB_TreeDisguise(struct obj *object) +FieldObjectCB_TreeDisguise: @ 809253C + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02037350 + adds r4, r1, r0 + adds r6, r4, 0 + adds r6, 0x21 + ldrb r0, [r6] + cmp r0, 0 + beq _08092564 + cmp r0, 0x1 + bne _08092584 + movs r1, 0x3C + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08092584 +_08092564: + ldr r1, =0x02038c08 + adds r2, r1, 0x4 + adds r3, r1, 0 + adds r3, 0x8 + adds r0, r4, 0 + bl FieldObjectGetLocalIdAndMap + movs r0, 0x1C + bl FieldEffectStart + strb r0, [r4, 0x1A] + movs r0, 0x1 + strb r0, [r6] + ldrh r0, [r5, 0x3C] + adds r0, 0x1 + strh r0, [r5, 0x3C] +_08092584: + movs r0, 0x2E + ldrsh r1, [r5, r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldr r2, =sub_80925AC + adds r1, r5, 0 + bl FieldObjectStep + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_TreeDisguise + + thumb_func_start sub_80925AC +sub_80925AC: @ 80925AC + push {lr} + bl npc_reset + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_80925AC + + thumb_func_start FieldObjectCB_MountainDisguise +FieldObjectCB_MountainDisguise: @ 80925B8 + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02037350 + adds r4, r1, r0 + adds r6, r4, 0 + adds r6, 0x21 + ldrb r0, [r6] + cmp r0, 0 + beq _080925E0 + cmp r0, 0x1 + bne _08092600 + movs r1, 0x3C + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08092600 +_080925E0: + ldr r1, =0x02038c08 + adds r2, r1, 0x4 + adds r3, r1, 0 + adds r3, 0x8 + adds r0, r4, 0 + bl FieldObjectGetLocalIdAndMap + movs r0, 0x1D + bl FieldEffectStart + strb r0, [r4, 0x1A] + movs r0, 0x1 + strb r0, [r6] + ldrh r0, [r5, 0x3C] + adds r0, 0x1 + strh r0, [r5, 0x3C] +_08092600: + movs r0, 0x2E + ldrsh r1, [r5, r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldr r2, =sub_80925AC + adds r1, r5, 0 + bl FieldObjectStep + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_MountainDisguise + + thumb_func_start FieldObjectCB_Hidden1 +@ void FieldObjectCB_Hidden1(struct obj *object) +FieldObjectCB_Hidden1: @ 8092628 + push {r4,lr} + adds r3, r0, 0 + movs r1, 0x3C + ldrsh r0, [r3, r1] + ldr r4, =0x02037350 + cmp r0, 0 + bne _08092668 + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x3] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0, 0x3] + adds r2, r3, 0 + adds r2, 0x42 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r3, 0x5] + movs r1, 0xC + orrs r0, r1 + strb r0, [r3, 0x5] + ldrh r0, [r3, 0x3C] + adds r0, 0x1 + strh r0, [r3, 0x3C] +_08092668: + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r2, =sub_809268C + adds r1, r3, 0 + bl FieldObjectStep + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_Hidden1 + + thumb_func_start sub_809268C +sub_809268C: @ 809268C + push {r4,lr} + ldr r3, =gUnknown_0850DA9C + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809268C + + thumb_func_start sub_80926AC +sub_80926AC: @ 80926AC + push {lr} + bl npc_reset + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_80926AC + + thumb_func_start sub_80926B8 +@ bool8 sub_80926B8(struct npc_state *fieldObject, struct obj *object) +sub_80926B8: @ 80926B8 + push {r4,lr} + adds r4, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + beq _080926CA + movs r0, 0 + strh r0, [r4, 0x30] +_080926CA: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80926B8 + + thumb_func_start FieldObjectCB_WalkInPlace1 +FieldObjectCB_WalkInPlace1: @ 80926D4 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_80926F8 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_WalkInPlace1 + + thumb_func_start sub_80926F8 +sub_80926F8: @ 80926F8 + push {r4,lr} + ldr r3, =gUnknown_0850DAA0 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80926F8 + + thumb_func_start sub_8092718 +sub_8092718: @ 8092718 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_reset + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetStepInPlaceDelay16AnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x1 + strh r0, [r5, 0x30] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8092718 + + thumb_func_start FieldObjectCB_WalkInPlace4 +FieldObjectCB_WalkInPlace4: @ 8092744 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8092768 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_WalkInPlace4 + + thumb_func_start sub_8092768 +sub_8092768: @ 8092768 + push {r4,lr} + ldr r3, =gUnknown_0850DAA8 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8092768 + + thumb_func_start sub_8092788 +sub_8092788: @ 8092788 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_reset + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetStepInPlaceDelay32AnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x1 + strh r0, [r5, 0x30] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8092788 + + thumb_func_start FieldObjectCB_WalkInPlace2 +FieldObjectCB_WalkInPlace2: @ 80927B4 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_80927D8 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_WalkInPlace2 + + thumb_func_start sub_80927D8 +sub_80927D8: @ 80927D8 + push {r4,lr} + ldr r3, =gUnknown_0850DAB0 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80927D8 + + thumb_func_start sub_80927F8 +@ bool8 sub_80927F8(struct npc_state *fieldObject, struct obj *object) +sub_80927F8: @ 80927F8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_reset + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetStepInPlaceDelay8AnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x1 + strh r0, [r5, 0x30] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80927F8 + + thumb_func_start FieldObjectCB_WalkInPlace3 +FieldObjectCB_WalkInPlace3: @ 8092824 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_8092848 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_WalkInPlace3 + + thumb_func_start sub_8092848 +sub_8092848: @ 8092848 + push {r4,lr} + ldr r3, =gUnknown_0850DAB8 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8092848 + + thumb_func_start sub_8092868 +sub_8092868: @ 8092868 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_reset + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetStepInPlaceDelay4AnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + movs r0, 0x1 + strh r0, [r5, 0x30] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8092868 + + thumb_func_start FieldObjectCB_Hidden2 +FieldObjectCB_Hidden2: @ 8092894 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =sub_80928B8 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_Hidden2 + + thumb_func_start sub_80928B8 +sub_80928B8: @ 80928B8 + push {r4,lr} + ldr r3, =gUnknown_0850DAC0 + movs r4, 0x30 + ldrsh r2, [r1, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80928B8 + + thumb_func_start sub_80928D8 +sub_80928D8: @ 80928D8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl npc_reset + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectSetRegularAnim + ldrb r0, [r4, 0x1] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r4, 0x1] + movs r0, 0x1 + strh r0, [r5, 0x30] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80928D8 + + thumb_func_start sub_809290C +sub_809290C: @ 809290C + push {r4,lr} + adds r4, r1, 0 + bl FieldObjectExecRegularAnim + lsls r0, 24 + cmp r0, 0 + bne _0809291E + movs r0, 0 + b _08092924 +_0809291E: + movs r0, 0x2 + strh r0, [r4, 0x30] + movs r0, 0x1 +_08092924: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809290C + + thumb_func_start sub_809292C +sub_809292C: @ 809292C + ldrb r2, [r0] + movs r1, 0x3 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + movs r0, 0 + bx lr + thumb_func_end sub_809292C + + thumb_func_start npc_reset +@ void npc_reset(struct npc_state *fieldObject, struct obj *object) +npc_reset: @ 809293C + ldrb r3, [r0] + movs r2, 0x3 + negs r2, r2 + ands r2, r3 + movs r3, 0x41 + negs r3, r3 + ands r2, r3 + movs r3, 0x7F + ands r2, r3 + strb r2, [r0] + movs r2, 0xFF + strb r2, [r0, 0x1C] + movs r0, 0 + strh r0, [r1, 0x30] + bx lr + thumb_func_end npc_reset + + thumb_func_start FieldObjectDirectionToImageAnimId +@ u8 FieldObjectDirectionToImageAnimId(u8 direction) +FieldObjectDirectionToImageAnimId: @ 809295C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DACC + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end FieldObjectDirectionToImageAnimId + + thumb_func_start get_go_image_anim_num +get_go_image_anim_num: @ 809296C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DAD5 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end get_go_image_anim_num + + thumb_func_start get_go_fast_image_anim_num +get_go_fast_image_anim_num: @ 809297C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DADE + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end get_go_fast_image_anim_num + + thumb_func_start get_go_faster_image_anim_num +get_go_faster_image_anim_num: @ 809298C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DAE7 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end get_go_faster_image_anim_num + + thumb_func_start get_go_fastest_image_anim_num +get_go_fastest_image_anim_num: @ 809299C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DAF0 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end get_go_fastest_image_anim_num + + thumb_func_start sub_80929AC +sub_80929AC: @ 80929AC + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DAF9 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80929AC + + thumb_func_start sub_80929BC +sub_80929BC: @ 80929BC + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DB02 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80929BC + + thumb_func_start sub_80929CC +sub_80929CC: @ 80929CC + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DB0B + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80929CC + + thumb_func_start sub_80929DC +sub_80929DC: @ 80929DC + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DB14 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80929DC + + thumb_func_start sub_80929EC +sub_80929EC: @ 80929EC + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DB1D + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80929EC + + thumb_func_start sub_80929FC +sub_80929FC: @ 80929FC + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DB26 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80929FC + + thumb_func_start sub_8092A0C +sub_8092A0C: @ 8092A0C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DB2F + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8092A0C + + thumb_func_start sub_8092A1C +sub_8092A1C: @ 8092A1C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DB38 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8092A1C + + thumb_func_start sub_8092A2C +sub_8092A2C: @ 8092A2C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DB41 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8092A2C + + thumb_func_start get_run_image_anim_num +get_run_image_anim_num: @ 8092A3C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DB4A + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end get_run_image_anim_num + + thumb_func_start sub_8092A4C +sub_8092A4C: @ 8092A4C + push {lr} + adds r2, r0, 0 + ldr r1, =gUnknown_085094AC + b _08092A64 + .pool +_08092A58: + ldr r0, [r1] + cmp r0, r2 + bne _08092A62 + adds r0, r1, 0 + b _08092A6C +_08092A62: + adds r1, 0x8 +_08092A64: + ldr r0, [r1] + cmp r0, 0 + bne _08092A58 + movs r0, 0 +_08092A6C: + pop {r1} + bx r1 + thumb_func_end sub_8092A4C + + thumb_func_start npc_apply_anim_looping +@ void npc_apply_anim_looping(struct npc_state *fieldObject, struct obj *object, u8 anim) +npc_apply_anim_looping: @ 8092A70 + push {r4,lr} + adds r4, r1, 0 + lsls r2, 24 + lsrs r2, 24 + ldrb r0, [r0, 0x1] + lsls r0, 27 + cmp r0, 0 + blt _08092AB2 + adds r0, r4, 0 + adds r0, 0x2A + strb r2, [r0] + ldr r0, [r4, 0x8] + bl sub_8092A4C + adds r1, r4, 0 + adds r1, 0x2B + cmp r0, 0 + beq _08092AAA + ldrb r2, [r1] + ldrb r3, [r0, 0x4] + cmp r2, r3 + bne _08092AA0 + ldrb r0, [r0, 0x7] + b _08092AA8 +_08092AA0: + ldrb r3, [r0, 0x5] + cmp r2, r3 + bne _08092AAA + ldrb r0, [r0, 0x6] +_08092AA8: + strb r0, [r1] +_08092AAA: + ldrb r1, [r1] + adds r0, r4, 0 + bl SeekObjectImageAnim +_08092AB2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end npc_apply_anim_looping + + thumb_func_start obj_npc_animation_step +@ void obj_npc_animation_step(struct npc_state *fieldObject, struct obj *object, u8 anim) +obj_npc_animation_step: @ 8092AB8 + push {r4,lr} + adds r4, r1, 0 + lsls r2, 24 + lsrs r2, 24 + ldrb r0, [r0, 0x1] + lsls r0, 27 + cmp r0, 0 + blt _08092AF0 + adds r0, r4, 0 + adds r0, 0x2A + strb r2, [r0] + ldr r0, [r4, 0x8] + bl sub_8092A4C + adds r2, r0, 0 + cmp r2, 0 + beq _08092AF0 + ldrb r1, [r2, 0x5] + adds r0, r4, 0 + adds r0, 0x2B + ldrb r0, [r0] + ldrb r3, [r2, 0x4] + cmp r0, r3 + bhi _08092AEA + ldrb r1, [r2, 0x4] +_08092AEA: + adds r0, r4, 0 + bl SeekObjectImageAnim +_08092AF0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end obj_npc_animation_step + + thumb_func_start sub_8092AF8 +sub_8092AF8: @ 8092AF8 + push {lr} + lsls r1, 16 + lsrs r1, 16 + lsls r3, 16 + lsrs r3, 16 + lsls r0, 16 + asrs r0, 16 + lsls r2, 16 + asrs r2, 16 + cmp r0, r2 + ble _08092B12 + movs r0, 0x3 + b _08092B28 +_08092B12: + cmp r0, r2 + bge _08092B1A + movs r0, 0x4 + b _08092B28 +_08092B1A: + lsls r1, 16 + lsls r0, r3, 16 + cmp r1, r0 + bgt _08092B26 + movs r0, 0x1 + b _08092B28 +_08092B26: + movs r0, 0x2 +_08092B28: + pop {r1} + bx r1 + thumb_func_end sub_8092AF8 + + thumb_func_start npc_set_running_behaviour_etc +npc_set_running_behaviour_etc: @ 8092B2C + push {r4,lr} + mov r12, r0 + lsls r1, 24 + lsrs r1, 24 + movs r3, 0 + strb r1, [r0, 0x6] + adds r0, 0x21 + strb r3, [r0] + adds r0, 0x1 + strb r3, [r0] + ldr r4, =0x02020630 + mov r0, r12 + ldrb r2, [r0, 0x4] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r2, r4, 0 + adds r2, 0x1C + adds r0, r2 + ldr r2, =gUnknown_08505438 + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + str r1, [r0] + mov r0, r12 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r3, [r0, 0x30] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end npc_set_running_behaviour_etc + + thumb_func_start npc_running_behaviour_by_direction +npc_running_behaviour_by_direction: @ 8092B78 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0850DB53 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end npc_running_behaviour_by_direction + + thumb_func_start sub_8092B88 +sub_8092B88: @ 8092B88 + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + lsls r5, r1, 24 + lsrs r5, 24 + ldrh r1, [r6, 0x10] + mov r0, sp + strh r1, [r0] + ldrh r0, [r6, 0x12] + mov r4, sp + adds r4, 0x2 + strh r0, [r4] + adds r0, r5, 0 + mov r1, sp + adds r2, r4, 0 + bl MoveCoords + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r4, r0] + adds r0, r6, 0 + adds r3, r5, 0 + bl npc_block_way + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8092B88 + + thumb_func_start npc_block_way +@ u8 npc_block_way(struct npc_state *fieldObject, u16 x, u16 y, u8 direction) +npc_block_way: @ 8092BC8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r6, r0, 0 + lsls r1, 16 + lsls r2, 16 + lsls r3, 24 + lsrs r7, r3, 24 + mov r8, r7 + lsrs r0, r1, 16 + mov r9, r0 + asrs r5, r1, 16 + lsrs r0, r2, 16 + mov r10, r0 + asrs r4, r2, 16 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl IsCoordOutsideFieldObjectMovementRect + lsls r0, 24 + cmp r0, 0 + beq _08092BFE + movs r0, 0x1 + b _08092C7E +_08092BFE: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridIsImpassableAt + lsls r0, 24 + cmp r0, 0 + bne _08092C40 + adds r0, r5, 0 + adds r1, r4, 0 + bl GetMapBorderIdAt + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _08092C40 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + adds r3, r7, 0 + bl IsMetatileDirectionallyImpassable + lsls r0, 24 + cmp r0, 0 + bne _08092C40 + ldrb r0, [r6, 0x1] + lsrs r0, 7 + cmp r0, 0 + beq _08092C44 + mov r0, r8 + bl CanCameraMoveInDirection + cmp r0, 0 + bne _08092C44 +_08092C40: + movs r0, 0x2 + b _08092C7E +_08092C44: + ldrb r0, [r6, 0xB] + lsls r0, 28 + lsrs r0, 28 + mov r2, r9 + lsls r1, r2, 16 + asrs r5, r1, 16 + mov r2, r10 + lsls r1, r2, 16 + asrs r4, r1, 16 + adds r1, r5, 0 + adds r2, r4, 0 + bl IsZCoordMismatchAt + lsls r0, 24 + cmp r0, 0 + beq _08092C68 + movs r0, 0x3 + b _08092C7E +_08092C68: + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl CheckForCollisionBetweenFieldObjects + lsls r0, 24 + cmp r0, 0 + bne _08092C7C + movs r0, 0 + b _08092C7E +_08092C7C: + movs r0, 0x4 +_08092C7E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end npc_block_way + + thumb_func_start sub_8092C8C +sub_8092C8C: @ 8092C8C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r7, r0, 0 + lsls r1, 16 + lsls r2, 16 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + lsrs r0, r1, 16 + mov r9, r0 + asrs r6, r1, 16 + lsrs r0, r2, 16 + mov r10, r0 + asrs r5, r2, 16 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl IsCoordOutsideFieldObjectMovementRect + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r4, r1, 31 + adds r0, r6, 0 + adds r1, r5, 0 + bl MapGridIsImpassableAt + lsls r0, 24 + cmp r0, 0 + bne _08092D04 + adds r0, r6, 0 + adds r1, r5, 0 + bl GetMapBorderIdAt + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _08092D04 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + mov r3, r8 + bl IsMetatileDirectionallyImpassable + lsls r0, 24 + cmp r0, 0 + bne _08092D04 + ldrb r0, [r7, 0x1] + lsrs r0, 7 + cmp r0, 0 + beq _08092D08 + mov r0, r8 + bl CanCameraMoveInDirection + cmp r0, 0 + bne _08092D08 +_08092D04: + movs r0, 0x2 + orrs r4, r0 +_08092D08: + ldrb r0, [r7, 0xB] + lsls r0, 28 + lsrs r0, 28 + mov r2, r9 + lsls r1, r2, 16 + asrs r6, r1, 16 + mov r2, r10 + lsls r1, r2, 16 + asrs r5, r1, 16 + adds r1, r6, 0 + adds r2, r5, 0 + bl IsZCoordMismatchAt + lsls r0, 24 + cmp r0, 0 + beq _08092D30 + movs r0, 0x4 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_08092D30: + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl CheckForCollisionBetweenFieldObjects + lsls r0, 24 + cmp r0, 0 + beq _08092D48 + movs r0, 0x8 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_08092D48: + 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_8092C8C + + thumb_func_start IsCoordOutsideFieldObjectMovementRect +@ bool8 IsCoordOutsideFieldObjectMovementRect(struct npc_state *fieldObject, u16 x, u16 y) +IsCoordOutsideFieldObjectMovementRect: @ 8092D58 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r3, r1, 16 + lsls r2, 16 + lsrs r5, r2, 16 + ldrb r1, [r4, 0x19] + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + beq _08092D90 + lsls r1, 28 + lsrs r2, r1, 28 + ldrh r0, [r4, 0xC] + subs r2, r0, r2 + lsrs r1, 28 + adds r0, r1 + lsls r0, 16 + lsrs r1, r0, 16 + lsls r2, 16 + lsls r0, r3, 16 + asrs r3, r0, 16 + cmp r2, r0 + bgt _08092DBC + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, r3 + blt _08092DBC +_08092D90: + ldrb r1, [r4, 0x19] + movs r0, 0xF0 + ands r0, r1 + cmp r0, 0 + beq _08092DC0 + lsls r1, 24 + lsrs r2, r1, 28 + ldrh r0, [r4, 0xE] + subs r2, r0, r2 + lsrs r1, 28 + adds r0, r1 + lsls r0, 16 + lsrs r1, r0, 16 + lsls r2, 16 + lsls r0, r5, 16 + asrs r3, r0, 16 + cmp r2, r0 + bgt _08092DBC + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, r3 + bge _08092DC0 +_08092DBC: + movs r0, 0x1 + b _08092DC2 +_08092DC0: + movs r0, 0 +_08092DC2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end IsCoordOutsideFieldObjectMovementRect + + thumb_func_start IsMetatileDirectionallyImpassable +@ bool8 IsMetatileDirectionallyImpassable(struct npc_state *fieldObject, u16 x, u16 y, u8 direction) +IsMetatileDirectionallyImpassable: @ 8092DC8 + push {r4-r7,lr} + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 16 + lsrs r7, r2, 16 + lsls r3, 24 + ldr r1, =gUnknown_0850DB5C + lsrs r3, 22 + subs r5, r3, 0x4 + adds r1, r5, r1 + ldrb r0, [r0, 0x1E] + ldr r1, [r1] + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + bne _08092E0A + ldr r4, =gUnknown_0850DB6C + adds r4, r5, r4 + lsls r0, r6, 16 + asrs r0, 16 + lsls r1, r7, 16 + asrs r1, 16 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r4] + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + beq _08092E18 +_08092E0A: + movs r0, 0x1 + b _08092E1A + .pool +_08092E18: + movs r0, 0 +_08092E1A: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end IsMetatileDirectionallyImpassable + + thumb_func_start CheckForCollisionBetweenFieldObjects +@ bool8 CheckForCollisionBetweenFieldObjects(struct npc_state *fieldObject, u16 x, u16 y) +CheckForCollisionBetweenFieldObjects: @ 8092E20 + push {r4-r7,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r7, r1, 16 + movs r4, 0 + lsls r2, 16 + asrs r5, r2, 16 +_08092E2E: + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + ldr r1, =0x02037350 + adds r2, r0, r1 + ldrb r0, [r2] + lsls r0, 31 + cmp r0, 0 + beq _08092E88 + cmp r2, r6 + beq _08092E88 + movs r0, 0x10 + ldrsh r1, [r2, r0] + lsls r0, r7, 16 + asrs r3, r0, 16 + cmp r1, r3 + bne _08092E58 + movs r1, 0x12 + ldrsh r0, [r2, r1] + cmp r0, r5 + beq _08092E68 +_08092E58: + movs r1, 0x14 + ldrsh r0, [r2, r1] + cmp r0, r3 + bne _08092E88 + movs r1, 0x16 + ldrsh r0, [r2, r1] + cmp r0, r5 + bne _08092E88 +_08092E68: + ldrb r0, [r6, 0xB] + lsls r0, 28 + lsrs r0, 28 + ldrb r1, [r2, 0xB] + lsls r1, 28 + lsrs r1, 28 + bl AreZCoordsCompatible + lsls r0, 24 + cmp r0, 0 + beq _08092E88 + movs r0, 0x1 + b _08092E94 + .pool +_08092E88: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _08092E2E + movs r0, 0 +_08092E94: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end CheckForCollisionBetweenFieldObjects + + thumb_func_start sub_8092E9C +sub_8092E9C: @ 8092E9C + push {lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _08092EE8 + ldr r3, =0x02020630 + ldr r2, =0x02037350 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x3C] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08092EE8 + movs r0, 0x1 + b _08092EEA + .pool +_08092EE8: + movs r0, 0 +_08092EEA: + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_8092E9C + + thumb_func_start sub_8092EF0 +sub_8092EF0: @ 8092EF0 + push {lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _08092F2E + ldr r3, =0x02020630 + ldr r2, =0x02037350 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r2, [r1, 0x3C] + movs r0, 0x4 + orrs r0, r2 + strh r0, [r1, 0x3C] +_08092F2E: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8092EF0 + + thumb_func_start MoveCoords +@ void MoveCoords(u8 direction, u16 *x, u16 *y) +MoveCoords: @ 8092F3C + push {r4,lr} + lsls r0, 24 + ldr r3, =gUnknown_0850DB7C + lsrs r0, 22 + adds r0, r3 + ldrh r3, [r0] + ldrh r4, [r1] + adds r3, r4 + strh r3, [r1] + ldrh r0, [r0, 0x2] + ldrh r1, [r2] + adds r0, r1 + strh r0, [r2] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end MoveCoords + + thumb_func_start sub_8092F60 +sub_8092F60: @ 8092F60 + push {r4,lr} + lsls r0, 24 + ldr r3, =gUnknown_0850DB7C + lsrs r0, 22 + adds r0, r3 + ldrh r3, [r0] + lsls r3, 4 + ldrh r4, [r1] + adds r3, r4 + strh r3, [r1] + ldrh r0, [r0, 0x2] + lsls r0, 4 + ldrh r1, [r2] + adds r0, r1 + strh r0, [r2] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8092F60 + + thumb_func_start sub_8092F88 +sub_8092F88: @ 8092F88 + push {r4-r7,lr} + adds r4, r1, 0 + ldr r1, [sp, 0x14] + lsls r0, 24 + lsls r3, 16 + lsrs r3, 16 + adds r7, r3, 0 + lsls r1, 16 + lsrs r6, r1, 16 + mov r12, r6 + ldr r1, =gUnknown_0850DB7C + lsrs r0, 22 + adds r5, r0, r1 + movs r0, 0 + ldrsh r1, [r5, r0] + cmp r1, 0 + ble _08092FB4 + lsls r0, r3, 16 + asrs r0, 16 + ldrh r3, [r4] + adds r0, r3 + strh r0, [r4] +_08092FB4: + cmp r1, 0 + bge _08092FC2 + ldrh r1, [r4] + lsls r0, r7, 16 + asrs r0, 16 + subs r1, r0 + strh r1, [r4] +_08092FC2: + movs r0, 0x2 + ldrsh r1, [r5, r0] + cmp r1, 0 + ble _08092FD4 + lsls r0, r6, 16 + asrs r0, 16 + ldrh r3, [r2] + adds r0, r3 + strh r0, [r2] +_08092FD4: + cmp r1, 0 + bge _08092FE4 + ldrh r1, [r2] + mov r3, r12 + lsls r0, r3, 16 + asrs r0, 16 + subs r1, r0 + strh r1, [r2] +_08092FE4: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8092F88 + + thumb_func_start sub_8092FF0 +sub_8092FF0: @ 8092FF0 + push {r4,r5,lr} + ldr r5, =0x03005d8c + ldr r4, [r5] + ldrh r4, [r4] + lsls r0, 16 + asrs r0, 16 + subs r0, r4 + lsls r0, 4 + strh r0, [r2] + ldr r0, [r5] + ldrh r0, [r0, 0x2] + lsls r1, 16 + asrs r1, 16 + subs r1, r0 + lsls r1, 4 + strh r1, [r3] + ldr r1, =0x03005dec + ldrh r0, [r2] + ldrh r1, [r1] + subs r0, r1 + strh r0, [r2] + ldr r1, =0x03005de8 + ldrh r0, [r3] + ldrh r1, [r1] + subs r0, r1 + strh r0, [r3] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8092FF0 + + thumb_func_start sub_8093038 +sub_8093038: @ 8093038 + push {r4-r7,lr} + adds r7, r2, 0 + mov r12, r3 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + ldr r0, =0x03005dec + ldrh r0, [r0] + negs r0, r0 + ldr r1, =0x03005dd0 + ldr r2, [r1, 0x10] + subs r0, r2 + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, =0x03005de8 + ldrh r0, [r0] + negs r0, r0 + ldr r1, [r1, 0x14] + subs r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r2, 0 + ble _08093072 + lsls r0, r3, 16 + movs r3, 0x80 + lsls r3, 13 + adds r0, r3 + lsrs r3, r0, 16 +_08093072: + cmp r2, 0 + bge _0809307E + lsls r0, r3, 16 + ldr r2, =0xfff00000 + adds r0, r2 + lsrs r3, r0, 16 +_0809307E: + cmp r1, 0 + ble _0809308C + lsls r0, r4, 16 + movs r2, 0x80 + lsls r2, 13 + adds r0, r2 + lsrs r4, r0, 16 +_0809308C: + cmp r1, 0 + bge _08093098 + lsls r0, r4, 16 + ldr r1, =0xfff00000 + adds r0, r1 + lsrs r4, r0, 16 +_08093098: + ldr r2, =0x03005d8c + ldr r0, [r2] + ldrh r1, [r0] + lsls r0, r5, 16 + asrs r0, 16 + subs r0, r1 + lsls r0, 4 + lsls r1, r3, 16 + asrs r1, 16 + adds r1, r0 + strh r1, [r7] + ldr r0, [r2] + ldrh r1, [r0, 0x2] + lsls r0, r6, 16 + asrs r0, 16 + subs r0, r1 + lsls r0, 4 + lsls r1, r4, 16 + asrs r1, 16 + adds r1, r0 + mov r2, r12 + strh r1, [r2] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8093038 + + thumb_func_start sub_80930E0 +sub_80930E0: @ 80930E0 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r6, r0, 0 + mov r8, r1 + adds r4, r2, 0 + adds r5, r3, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + movs r1, 0 + ldrsh r0, [r6, r1] + mov r2, r8 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r2, r6, 0 + mov r3, r8 + bl sub_8093038 + lsls r4, 16 + asrs r4, 16 + ldrh r0, [r6] + adds r4, r0 + strh r4, [r6] + lsls r5, 16 + asrs r5, 16 + mov r1, r8 + ldrh r1, [r1] + adds r5, r1 + mov r2, r8 + strh r5, [r2] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80930E0 + + thumb_func_start GetFieldObjectMovingCameraOffset +@ void GetFieldObjectMovingCameraOffset(s16 *x, s16 *y) +GetFieldObjectMovingCameraOffset: @ 809312C + push {lr} + adds r2, r0, 0 + movs r0, 0 + strh r0, [r2] + strh r0, [r1] + ldr r3, =0x03005dd0 + ldr r0, [r3, 0x10] + cmp r0, 0 + ble _08093142 + movs r0, 0x1 + strh r0, [r2] +_08093142: + ldr r0, [r3, 0x10] + cmp r0, 0 + bge _0809314E + ldrh r0, [r2] + subs r0, 0x1 + strh r0, [r2] +_0809314E: + ldr r2, [r3, 0x14] + cmp r2, 0 + ble _0809315A + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0809315A: + cmp r2, 0 + bge _08093164 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] +_08093164: + pop {r0} + bx r0 + .pool + thumb_func_end GetFieldObjectMovingCameraOffset + + thumb_func_start FieldObjectMoveDestCoords +@ void FieldObjectMoveDestCoords(struct npc_state *fieldObject, u8 direction) +FieldObjectMoveDestCoords: @ 809316C + push {r4,lr} + lsls r1, 24 + lsrs r1, 24 + ldrh r4, [r0, 0x10] + strh r4, [r2] + ldrh r0, [r0, 0x12] + strh r0, [r3] + adds r0, r1, 0 + adds r1, r2, 0 + adds r2, r3, 0 + bl MoveCoords + pop {r4} + pop {r0} + bx r0 + thumb_func_end FieldObjectMoveDestCoords + + thumb_func_start FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive +@ bool8 FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive(struct npc_state *fieldObject) +FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive: @ 809318C + push {lr} + ldrb r1, [r0] + movs r0, 0x42 + ands r0, r1 + cmp r0, 0 + bne _0809319C + movs r0, 0 + b _0809319E +_0809319C: + movs r0, 0x1 +_0809319E: + pop {r1} + bx r1 + thumb_func_end FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + + thumb_func_start FieldObjectIsSpecialAnimActive +@ bool8 FieldObjectIsSpecialAnimActive(struct npc_state *fieldObject) +FieldObjectIsSpecialAnimActive: @ 80931A4 + push {lr} + adds r1, r0, 0 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + bge _080931BA + ldrb r0, [r1, 0x1C] + cmp r0, 0xFF + beq _080931BA + movs r0, 0x1 + b _080931BC +_080931BA: + movs r0, 0 +_080931BC: + pop {r1} + bx r1 + thumb_func_end FieldObjectIsSpecialAnimActive + + thumb_func_start FieldObjectSetSpecialAnim +@ bool8 FieldObjectSetSpecialAnim(struct npc_state *fieldObject, u8 animId) +FieldObjectSetSpecialAnim: @ 80931C0 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _08093200 + adds r0, r4, 0 + bl npc_sync_anim_pause_bits + strb r5, [r4, 0x1C] + ldrb r0, [r4] + movs r1, 0x40 + orrs r0, r1 + movs r1, 0x7F + ands r0, r1 + strb r0, [r4] + ldr r2, =0x02020630 + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r6, [r0, 0x32] + movs r0, 0 + b _08093202 + .pool +_08093200: + movs r0, 0x1 +_08093202: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end FieldObjectSetSpecialAnim + + thumb_func_start FieldObjectForceSetSpecialAnim +@ void FieldObjectForceSetSpecialAnim(struct npc_state *fieldObject, u8 animId) +FieldObjectForceSetSpecialAnim: @ 8093208 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r4, r1, 24 + lsrs r4, 24 + bl FieldObjectClearAnimIfSpecialAnimActive + adds r0, r5, 0 + adds r1, r4, 0 + bl FieldObjectSetSpecialAnim + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end FieldObjectForceSetSpecialAnim + + thumb_func_start FieldObjectClearAnimIfSpecialAnimActive +@ void FieldObjectClearAnimIfSpecialAnimActive(struct npc_state *fieldObject) +FieldObjectClearAnimIfSpecialAnimActive: @ 8093224 + push {lr} + adds r1, r0, 0 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + bge _08093236 + adds r0, r1, 0 + bl FieldObjectClearAnim +_08093236: + pop {r0} + bx r0 + thumb_func_end FieldObjectClearAnimIfSpecialAnimActive + + thumb_func_start FieldObjectClearAnim +@ void FieldObjectClearAnim(struct npc_state *fieldObject) +FieldObjectClearAnim: @ 809323C + movs r1, 0xFF + strb r1, [r0, 0x1C] + ldrb r2, [r0] + movs r1, 0x41 + negs r1, r1 + ands r1, r2 + movs r2, 0x7F + ands r1, r2 + strb r1, [r0] + ldr r3, =0x02020630 + ldrb r2, [r0, 0x4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r3 + movs r2, 0 + strh r2, [r1, 0x30] + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + strh r2, [r0, 0x32] + bx lr + .pool + thumb_func_end FieldObjectClearAnim + + thumb_func_start FieldObjectCheckIfSpecialAnimFinishedOrInactive +@ u8 FieldObjectCheckIfSpecialAnimFinishedOrInactive(struct npc_state *fieldObject) +FieldObjectCheckIfSpecialAnimFinishedOrInactive: @ 8093270 + push {lr} + ldrb r1, [r0] + lsls r0, r1, 25 + cmp r0, 0 + blt _0809327E + movs r0, 0x10 + b _08093280 +_0809327E: + lsrs r0, r1, 7 +_08093280: + pop {r1} + bx r1 + thumb_func_end FieldObjectCheckIfSpecialAnimFinishedOrInactive + + thumb_func_start FieldObjectClearAnimIfSpecialAnimFinished +@ u8 FieldObjectClearAnimIfSpecialAnimFinished(struct npc_state *fieldObject) +FieldObjectClearAnimIfSpecialAnimFinished: @ 8093284 + push {r4,r5,lr} + adds r5, r0, 0 + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0809329E + cmp r4, 0x10 + beq _0809329E + adds r0, r5, 0 + bl FieldObjectClearAnimIfSpecialAnimActive +_0809329E: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end FieldObjectClearAnimIfSpecialAnimFinished + + thumb_func_start FieldObjectGetSpecialAnim +@ u8 FieldObjectGetSpecialAnim(struct npc_state *fieldObject) +FieldObjectGetSpecialAnim: @ 80932A8 + push {lr} + adds r1, r0, 0 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + blt _080932B8 + movs r0, 0xFF + b _080932BA +_080932B8: + ldrb r0, [r1, 0x1C] +_080932BA: + pop {r1} + bx r1 + thumb_func_end FieldObjectGetSpecialAnim + + thumb_func_start FieldObjectStep +@ void FieldObjectStep(struct npc_state *fieldObject, struct obj *object, bool8 ( *callback)(struct npc_state *fieldObject, struct obj *object)) +FieldObjectStep: @ 80932C0 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + bl DoGroundEffects_OnSpawn + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80964E8 + adds r0, r4, 0 + bl FieldObjectIsSpecialAnimActive + lsls r0, 24 + cmp r0, 0 + beq _080932EA + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectExecSpecialAnim + b _08093300 +_080932EA: + ldrb r0, [r4, 0x1] + lsls r0, 31 + cmp r0, 0 + bne _08093300 +_080932F2: + adds r0, r4, 0 + adds r1, r5, 0 + bl _call_via_r6 + lsls r0, 24 + cmp r0, 0 + bne _080932F2 +_08093300: + adds r0, r4, 0 + adds r1, r5, 0 + bl DoGroundEffects_OnBeginStep + adds r0, r4, 0 + adds r1, r5, 0 + bl DoGroundEffects_OnFinishStep + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_obj_transfer_image_anim_pause_flag + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8096518 + adds r0, r4, 0 + adds r1, r5, 0 + bl FieldObjectUpdateSubpriority + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end FieldObjectStep + + thumb_func_start GetFaceDirectionAnimId +@ u8 GetFaceDirectionAnimId(u8 direction) +GetFaceDirectionAnimId: @ 8093330 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBA0 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093348 + movs r4, 0 +_08093348: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetFaceDirectionAnimId + + thumb_func_start GetSimpleGoAnimId +@ u8 GetSimpleGoAnimId(u8 direction) +GetSimpleGoAnimId: @ 809335C + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBA5 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093374 + movs r4, 0 +_08093374: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetSimpleGoAnimId + + thumb_func_start GetGoSpeed0AnimId +@ u8 GetGoSpeed0AnimId(u8 direction) +GetGoSpeed0AnimId: @ 8093388 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBAA + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _080933A0 + movs r4, 0 +_080933A0: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetGoSpeed0AnimId + + thumb_func_start GetGoSpeed1AnimId +@ u8 GetGoSpeed1AnimId(u8 direction) +GetGoSpeed1AnimId: @ 80933B4 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBAF + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _080933CC + movs r4, 0 +_080933CC: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetGoSpeed1AnimId + + thumb_func_start GetGoSpeed2AnimId +@ u8 GetGoSpeed2AnimId(u8 direction) +GetGoSpeed2AnimId: @ 80933E0 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBB4 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _080933F8 + movs r4, 0 +_080933F8: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetGoSpeed2AnimId + + thumb_func_start GetGoSpeed3AnimId +@ u8 GetGoSpeed3AnimId(u8 direction) +GetGoSpeed3AnimId: @ 809340C + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBB9 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093424 + movs r4, 0 +_08093424: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetGoSpeed3AnimId + + thumb_func_start sub_8093438 +@ u8 sub_8093438(u8 direction) +sub_8093438: @ 8093438 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBBE + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093450 + movs r4, 0 +_08093450: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8093438 + + thumb_func_start GetRunAnimId +@ u8 GetRunAnimId(u8 direction) +GetRunAnimId: @ 8093464 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBC3 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _0809347C + movs r4, 0 +_0809347C: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetRunAnimId + + thumb_func_start GetJumpLedgeAnimId +@ u8 GetJumpLedgeAnimId(u8 direction) +GetJumpLedgeAnimId: @ 8093490 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBC8 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _080934A8 + movs r4, 0 +_080934A8: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetJumpLedgeAnimId + + thumb_func_start sub_80934BC +@ u8 sub_80934BC(u8 direction) +sub_80934BC: @ 80934BC + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBCD + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _080934D4 + movs r4, 0 +_080934D4: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80934BC + + thumb_func_start sub_80934E8 +@ u8 sub_80934E8(u8 direction) +sub_80934E8: @ 80934E8 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBD2 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093500 + movs r4, 0 +_08093500: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80934E8 + + thumb_func_start sub_8093514 +@ u8 sub_8093514(u8 direction) +sub_8093514: @ 8093514 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBD7 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _0809352C + movs r4, 0 +_0809352C: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8093514 + + thumb_func_start sub_8093540 +@ u8 sub_8093540(u8 direction) +sub_8093540: @ 8093540 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBDC + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093558 + movs r4, 0 +_08093558: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8093540 + + thumb_func_start GetStepInPlaceDelay32AnimId +@ u8 GetStepInPlaceDelay32AnimId(u8 direction) +GetStepInPlaceDelay32AnimId: @ 809356C + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBE1 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093584 + movs r4, 0 +_08093584: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetStepInPlaceDelay32AnimId + + thumb_func_start GetStepInPlaceDelay16AnimId +@ u8 GetStepInPlaceDelay16AnimId(u8 direction) +GetStepInPlaceDelay16AnimId: @ 8093598 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBE6 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _080935B0 + movs r4, 0 +_080935B0: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetStepInPlaceDelay16AnimId + + thumb_func_start GetStepInPlaceDelay8AnimId +@ u8 GetStepInPlaceDelay8AnimId(u8 direction) +GetStepInPlaceDelay8AnimId: @ 80935C4 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBEB + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _080935DC + movs r4, 0 +_080935DC: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetStepInPlaceDelay8AnimId + + thumb_func_start GetStepInPlaceDelay4AnimId +@ u8 GetStepInPlaceDelay4AnimId(u8 direction) +GetStepInPlaceDelay4AnimId: @ 80935F0 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBF0 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093608 + movs r4, 0 +_08093608: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetStepInPlaceDelay4AnimId + + thumb_func_start FieldObjectFaceOppositeDirection +@ bool8 FieldObjectFaceOppositeDirection(struct npc_state *fieldObject, u8 direction) +FieldObjectFaceOppositeDirection: @ 809361C + push {r4,lr} + adds r4, r0, 0 + lsls r0, r1, 24 + lsrs r0, 24 + bl GetOppositeDirection + lsls r0, 24 + lsrs r0, 24 + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + thumb_func_end FieldObjectFaceOppositeDirection + + thumb_func_start sub_8093648 +sub_8093648: @ 8093648 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBF5 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093660 + movs r4, 0 +_08093660: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8093648 + + thumb_func_start sub_8093674 +sub_8093674: @ 8093674 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBFA + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _0809368C + movs r4, 0 +_0809368C: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8093674 + + thumb_func_start sub_80936A0 +sub_80936A0: @ 80936A0 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DBFF + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _080936B8 + movs r4, 0 +_080936B8: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80936A0 + + thumb_func_start sub_80936CC +sub_80936CC: @ 80936CC + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DC04 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _080936E4 + movs r4, 0 +_080936E4: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80936CC + + thumb_func_start sub_80936F8 +sub_80936F8: @ 80936F8 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DC09 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093710 + movs r4, 0 +_08093710: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80936F8 + + thumb_func_start sub_8093724 +sub_8093724: @ 8093724 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DC0E + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _0809373C + movs r4, 0 +_0809373C: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8093724 + + thumb_func_start sub_8093750 +sub_8093750: @ 8093750 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DC13 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093768 + movs r4, 0 +_08093768: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8093750 + + thumb_func_start sub_809377C +sub_809377C: @ 809377C + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DC18 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _08093794 + movs r4, 0 +_08093794: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809377C + + thumb_func_start sub_80937A8 +sub_80937A8: @ 80937A8 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DC1D + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _080937C0 + movs r4, 0 +_080937C0: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80937A8 + + thumb_func_start d2s_08064034 +d2s_08064034: @ 80937D4 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DC22 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x4 + bls _080937EC + movs r4, 0 +_080937EC: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end d2s_08064034 + + thumb_func_start GetOppositeDirection +@ u8 GetOppositeDirection(u8 direction) +GetOppositeDirection: @ 8093800 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_0850DC27 + mov r0, sp + movs r2, 0x8 + bl memcpy + subs r1, r4, 0x1 + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, 0x7 + bhi _08093828 + mov r2, sp + adds r0, r2, r1 + ldrb r0, [r0] + b _0809382A + .pool +_08093828: + adds r0, r4, 0 +_0809382A: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end GetOppositeDirection + + thumb_func_start zffu_offset_calc +zffu_offset_calc: @ 8093834 + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_0850DC2F + lsrs r0, 22 + subs r0, 0x5 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + bx lr + .pool + thumb_func_end zffu_offset_calc + + thumb_func_start state_to_direction +state_to_direction: @ 809384C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + adds r0, r1, 0 + lsls r2, 24 + lsrs r2, 24 + cmp r1, 0 + beq _0809386C + cmp r2, 0 + beq _0809386C + cmp r1, 0x4 + bhi _0809386C + cmp r2, 0x4 + bls _08093870 +_0809386C: + movs r0, 0 + b _08093882 +_08093870: + adds r1, r2, 0 + bl zffu_offset_calc + ldr r2, =gUnknown_0850DC3F + lsls r1, r4, 2 + subs r1, 0x5 + adds r0, r1 + adds r0, r2 + ldrb r0, [r0] +_08093882: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end state_to_direction + + thumb_func_start FieldObjectExecSpecialAnim +@ void FieldObjectExecSpecialAnim(struct npc_state *fieldObject, struct obj *object) +FieldObjectExecSpecialAnim: @ 809388C + push {r4,lr} + adds r4, r0, 0 + ldr r2, =gUnknown_0850DC50 + ldrb r0, [r4, 0x1C] + lsls r0, 2 + adds r0, r2 + movs r3, 0x32 + ldrsh r2, [r1, r3] + ldr r0, [r0] + lsls r2, 2 + adds r2, r0 + ldr r2, [r2] + adds r0, r4, 0 + bl _call_via_r2 + lsls r0, 24 + cmp r0, 0 + beq _080938B8 + ldrb r0, [r4] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r4] +_080938B8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectExecSpecialAnim + + thumb_func_start FieldObjectExecRegularAnim +@ bool8 FieldObjectExecRegularAnim(struct npc_state *fieldObject, struct obj *object) +FieldObjectExecRegularAnim: @ 80938C4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_0850DC50 + ldrb r0, [r4, 0x1C] + lsls r0, 2 + adds r0, r1 + movs r2, 0x32 + ldrsh r1, [r5, r2] + ldr r0, [r0] + lsls r1, 2 + adds r1, r0 + ldr r2, [r1] + adds r0, r4, 0 + adds r1, r5, 0 + bl _call_via_r2 + lsls r0, 24 + cmp r0, 0 + bne _080938F4 + movs r0, 0 + b _080938FE + .pool +_080938F4: + movs r0, 0xFF + strb r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r5, 0x32] + movs r0, 0x1 +_080938FE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end FieldObjectExecRegularAnim + + thumb_func_start FieldObjectSetRegularAnim +@ void FieldObjectSetRegularAnim(struct npc_state *fieldObject, struct obj *object, u8 animState) +FieldObjectSetRegularAnim: @ 8093904 + movs r3, 0 + strb r2, [r0, 0x1C] + strh r3, [r1, 0x32] + bx lr + thumb_func_end FieldObjectSetRegularAnim + + thumb_func_start an_look_any +@ void an_look_any(struct npc_state *fieldObject, struct obj *object, u8 direction) +an_look_any: @ 809390C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r1, r2, 24 + lsrs r1, 24 + bl FieldObjectSetDirection + adds r0, r4, 0 + bl npc_coords_shift_still + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl get_go_image_anim_num + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl obj_npc_animation_step + adds r2, r5, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x1 + strh r0, [r5, 0x32] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end an_look_any + + thumb_func_start sub_8093950 +sub_8093950: @ 8093950 + push {lr} + movs r2, 0x1 + bl an_look_any + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8093950 + + thumb_func_start sub_8093960 +sub_8093960: @ 8093960 + push {lr} + movs r2, 0x2 + bl an_look_any + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8093960 + + thumb_func_start sub_8093970 +sub_8093970: @ 8093970 + push {lr} + movs r2, 0x3 + bl an_look_any + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8093970 + + thumb_func_start sub_8093980 +sub_8093980: @ 8093980 + push {lr} + movs r2, 0x4 + bl an_look_any + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8093980 + + thumb_func_start npc_apply_direction +@ void npc_apply_direction(struct npc_state *fieldObject, struct obj *object, u8 direction, u8 speed) +npc_apply_direction: @ 8093990 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r7, r0, 0 + mov r8, r1 + adds r4, r2, 0 + adds r6, r3, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r6, 24 + lsrs r6, 24 + ldrh r1, [r7, 0x10] + mov r0, sp + strh r1, [r0] + ldrh r0, [r7, 0x12] + mov r5, sp + adds r5, 0x2 + strh r0, [r5] + adds r0, r7, 0 + adds r1, r4, 0 + bl FieldObjectSetDirection + adds r0, r4, 0 + mov r1, sp + adds r2, r5, 0 + bl MoveCoords + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r5, r0] + adds r0, r7, 0 + bl npc_coords_shift + mov r0, r8 + adds r1, r4, 0 + adds r2, r6, 0 + bl oamt_npc_ministep_reset + mov r4, r8 + adds r4, 0x2C + ldrb r1, [r4] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r4] + ldr r0, =0x020375b8 + ldr r0, [r0] + cmp r0, 0 + beq _08093A0E + adds r0, r7, 0 + bl sub_8097F78 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + beq _08093A0E + ldrb r0, [r4] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r4] +_08093A0E: + ldrb r0, [r7] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r7] + movs r0, 0x1 + mov r1, r8 + strh r0, [r1, 0x32] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end npc_apply_direction + + thumb_func_start do_go_anim +@ void do_go_anim(struct npc_state *fieldObject, struct obj *object, u8 direction, u8 speed) +do_go_anim: @ 8093A2C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + adds r5, r0, 0 + mov r8, r1 + adds r4, r3, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r4, 24 + lsrs r4, 24 + mov r1, sp + ldr r0, =gUnknown_0850DEE8 + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + ldm r0!, {r3,r6} + stm r1!, {r3,r6} + adds r0, r5, 0 + mov r1, r8 + adds r3, r4, 0 + bl npc_apply_direction + lsls r4, 2 + mov r7, sp + adds r1, r7, r4 + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + ldr r1, [r1] + bl _call_via_r1 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r5, 0 + mov r1, r8 + bl npc_apply_anim_looping + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end do_go_anim + + thumb_func_start do_run_anim +@ void do_run_anim(struct npc_state *fieldObject, struct obj *object, u8 direction) +do_run_anim: @ 8093A88 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r2, 24 + movs r3, 0x1 + bl npc_apply_direction + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl get_run_image_anim_num + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_apply_anim_looping + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end do_run_anim + + thumb_func_start npc_obj_ministep_stop_on_arrival +@ bool8 npc_obj_ministep_stop_on_arrival(struct npc_state *fieldObject, struct obj *object) +npc_obj_ministep_stop_on_arrival: @ 8093AB8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl obj_npc_ministep + lsls r0, 24 + cmp r0, 0 + bne _08093ACE + movs r0, 0 + b _08093AEA +_08093ACE: + adds r0, r4, 0 + bl npc_coords_shift_still + ldrb r0, [r4] + movs r1, 0x8 + orrs r0, r1 + strb r0, [r4] + adds r2, r5, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x1 +_08093AEA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end npc_obj_ministep_stop_on_arrival + + thumb_func_start sub_8093AF0 +@ void sub_8093AF0(struct npc_state *fieldObject, struct obj *object, u8 direction) +sub_8093AF0: @ 8093AF0 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + adds r6, r0, 0 + mov r8, r1 + lsls r5, r2, 24 + lsrs r5, 24 + ldrh r1, [r6, 0x10] + mov r0, sp + strh r1, [r0] + ldrh r0, [r6, 0x12] + mov r4, sp + adds r4, 0x2 + strh r0, [r4] + adds r0, r6, 0 + adds r1, r5, 0 + bl FieldObjectSetDirection + adds r0, r5, 0 + mov r1, sp + adds r2, r4, 0 + bl MoveCoords + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r4, r0] + adds r0, r6, 0 + bl npc_coords_shift + mov r0, r8 + adds r1, r5, 0 + bl sub_80976DC + mov r2, r8 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldrb r0, [r6] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r6] + movs r0, 0x1 + mov r1, r8 + strh r0, [r1, 0x32] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8093AF0 + + thumb_func_start sub_8093B60 +@ void sub_8093B60(struct npc_state *fieldObject, struct obj *object, u8 direction) +sub_8093B60: @ 8093B60 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r2, 24 + bl sub_8093AF0 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl get_go_image_anim_num + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_apply_anim_looping + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8093B60 + + thumb_func_start an_walk_any_2 +@ bool8 an_walk_any_2(struct npc_state *fieldObject, struct obj *object) +an_walk_any_2: @ 8093B8C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_80976EC + lsls r0, 24 + cmp r0, 0 + bne _08093BA2 + movs r0, 0 + b _08093BBE +_08093BA2: + adds r0, r4, 0 + bl npc_coords_shift_still + ldrb r0, [r4] + movs r1, 0x8 + orrs r0, r1 + strb r0, [r4] + adds r2, r5, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x1 +_08093BBE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end an_walk_any_2 + + thumb_func_start sub_8093BC4 +sub_8093BC4: @ 8093BC4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x7 + bl sub_8093B60 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093BE4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093BC4 + + thumb_func_start sub_8093BE4 +sub_8093BE4: @ 8093BE4 + push {r4,lr} + adds r4, r1, 0 + bl an_walk_any_2 + lsls r0, 24 + cmp r0, 0 + bne _08093BF6 + movs r0, 0 + b _08093BFC +_08093BF6: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093BFC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093BE4 + + thumb_func_start sub_8093C04 +sub_8093C04: @ 8093C04 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x8 + bl sub_8093B60 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093C24 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093C04 + + thumb_func_start sub_8093C24 +sub_8093C24: @ 8093C24 + push {r4,lr} + adds r4, r1, 0 + bl an_walk_any_2 + lsls r0, 24 + cmp r0, 0 + bne _08093C36 + movs r0, 0 + b _08093C3C +_08093C36: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093C3C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093C24 + + thumb_func_start sub_8093C44 +sub_8093C44: @ 8093C44 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x5 + bl sub_8093B60 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093C64 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093C44 + + thumb_func_start sub_8093C64 +sub_8093C64: @ 8093C64 + push {r4,lr} + adds r4, r1, 0 + bl an_walk_any_2 + lsls r0, 24 + cmp r0, 0 + bne _08093C76 + movs r0, 0 + b _08093C7C +_08093C76: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093C7C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093C64 + + thumb_func_start sub_8093C84 +sub_8093C84: @ 8093C84 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x6 + bl sub_8093B60 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093CA4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093C84 + + thumb_func_start sub_8093CA4 +sub_8093CA4: @ 8093CA4 + push {r4,lr} + adds r4, r1, 0 + bl an_walk_any_2 + lsls r0, 24 + cmp r0, 0 + bne _08093CB6 + movs r0, 0 + b _08093CBC +_08093CB6: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093CBC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093CA4 + + thumb_func_start sub_8093CC4 +@ bool8 sub_8093CC4(struct npc_state *fieldObject, struct obj *object) +sub_8093CC4: @ 8093CC4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + bl sub_8093B60 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093CE4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093CC4 + + thumb_func_start sub_8093CE4 +@ bool8 sub_8093CE4(struct npc_state *fieldObject, struct obj *object) +sub_8093CE4: @ 8093CE4 + push {r4,lr} + adds r4, r1, 0 + bl an_walk_any_2 + lsls r0, 24 + cmp r0, 0 + bne _08093CF6 + movs r0, 0 + b _08093CFC +_08093CF6: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093CFC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093CE4 + + thumb_func_start sub_8093D04 +sub_8093D04: @ 8093D04 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x2 + bl sub_8093B60 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093D24 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093D04 + + thumb_func_start sub_8093D24 +sub_8093D24: @ 8093D24 + push {r4,lr} + adds r4, r1, 0 + bl an_walk_any_2 + lsls r0, 24 + cmp r0, 0 + bne _08093D36 + movs r0, 0 + b _08093D3C +_08093D36: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093D3C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093D24 + + thumb_func_start sub_8093D44 +sub_8093D44: @ 8093D44 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x3 + bl sub_8093B60 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093D64 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093D44 + + thumb_func_start sub_8093D64 +sub_8093D64: @ 8093D64 + push {r4,lr} + adds r4, r1, 0 + bl an_walk_any_2 + lsls r0, 24 + cmp r0, 0 + bne _08093D76 + movs r0, 0 + b _08093D7C +_08093D76: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093D7C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093D64 + + thumb_func_start sub_8093D84 +sub_8093D84: @ 8093D84 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + bl sub_8093B60 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093DA4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093D84 + + thumb_func_start sub_8093DA4 +sub_8093DA4: @ 8093DA4 + push {r4,lr} + adds r4, r1, 0 + bl an_walk_any_2 + lsls r0, 24 + cmp r0, 0 + bne _08093DB6 + movs r0, 0 + b _08093DBC +_08093DB6: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093DBC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093DA4 + + thumb_func_start sub_8093DC4 +sub_8093DC4: @ 8093DC4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x7 + movs r3, 0 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093DE4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093DC4 + + thumb_func_start sub_8093DE4 +@ bool8 sub_8093DE4(struct npc_state *fieldObject, struct obj *object) +sub_8093DE4: @ 8093DE4 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08093DF6 + movs r0, 0 + b _08093DFC +_08093DF6: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093DFC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093DE4 + + thumb_func_start sub_8093E04 +sub_8093E04: @ 8093E04 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x8 + movs r3, 0 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093E24 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093E04 + + thumb_func_start sub_8093E24 +sub_8093E24: @ 8093E24 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08093E36 + movs r0, 0 + b _08093E3C +_08093E36: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093E3C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093E24 + + thumb_func_start sub_8093E44 +sub_8093E44: @ 8093E44 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x5 + movs r3, 0 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093E64 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093E44 + + thumb_func_start sub_8093E64 +sub_8093E64: @ 8093E64 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08093E76 + movs r0, 0 + b _08093E7C +_08093E76: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093E7C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093E64 + + thumb_func_start sub_8093E84 +sub_8093E84: @ 8093E84 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x6 + movs r3, 0 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093EA4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093E84 + + thumb_func_start sub_8093EA4 +sub_8093EA4: @ 8093EA4 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08093EB6 + movs r0, 0 + b _08093EBC +_08093EB6: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093EBC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093EA4 + + thumb_func_start sub_8093EC4 +sub_8093EC4: @ 8093EC4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + movs r3, 0 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093EE4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093EC4 + + thumb_func_start sub_8093EE4 +sub_8093EE4: @ 8093EE4 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08093EF6 + movs r0, 0 + b _08093EFC +_08093EF6: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093EFC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093EE4 + + thumb_func_start sub_8093F04 +sub_8093F04: @ 8093F04 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x2 + movs r3, 0 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093F24 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093F04 + + thumb_func_start sub_8093F24 +sub_8093F24: @ 8093F24 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08093F36 + movs r0, 0 + b _08093F3C +_08093F36: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093F3C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093F24 + + thumb_func_start sub_8093F44 +sub_8093F44: @ 8093F44 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x3 + movs r3, 0 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093F64 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093F44 + + thumb_func_start sub_8093F64 +sub_8093F64: @ 8093F64 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08093F76 + movs r0, 0 + b _08093F7C +_08093F76: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093F7C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093F64 + + thumb_func_start sub_8093F84 +sub_8093F84: @ 8093F84 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + movs r3, 0 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093FA4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8093F84 + + thumb_func_start sub_8093FA4 +sub_8093FA4: @ 8093FA4 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08093FB6 + movs r0, 0 + b _08093FBC +_08093FB6: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08093FBC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093FA4 + + thumb_func_start sub_8093FC4 +sub_8093FC4: @ 8093FC4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r7, r0, 0 + mov r10, r1 + adds r4, r2, 0 + mov r8, r3 + ldr r0, [sp, 0x30] + lsls r4, 24 + lsrs r4, 24 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r1, =gUnknown_0850DFBC + add r0, sp, 0x4 + movs r2, 0x6 + bl memcpy + add r5, sp, 0xC + movs r0, 0 + strh r0, [r5] + mov r6, sp + adds r6, 0xE + strh r0, [r6] + adds r0, r7, 0 + adds r1, r4, 0 + bl FieldObjectSetDirection + mov r1, r8 + lsls r0, r1, 1 + add r0, sp + adds r0, 0x4 + movs r1, 0 + ldrsh r3, [r0, r1] + str r3, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_8092F88 + ldrh r1, [r5] + ldrh r0, [r7, 0x10] + adds r1, r0 + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r6] + ldrh r0, [r7, 0x12] + adds r2, r0 + lsls r2, 16 + asrs r2, 16 + adds r0, r7, 0 + bl npc_coords_shift + mov r0, r10 + adds r1, r4, 0 + mov r2, r8 + mov r3, r9 + bl sub_809783C + movs r0, 0x1 + mov r1, r10 + strh r0, [r1, 0x32] + movs r0, 0x2C + add r10, r0 + mov r0, r10 + ldrb r1, [r0] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + mov r1, r10 + strb r0, [r1] + ldrb r0, [r7] + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r7] + 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_8093FC4 + + thumb_func_start maybe_shadow_1 +maybe_shadow_1: @ 8094080 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, [sp, 0x10] + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + adds r0, r4, 0 + bl sub_8093FC4 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl get_go_image_anim_num + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_apply_anim_looping + adds r0, r4, 0 + bl DoShadowFieldEffect + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end maybe_shadow_1 + + thumb_func_start sub_80940C4 +@ int sub_80940C4(int a1, int a2, int a3) +sub_80940C4: @ 80940C4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + adds r6, r0, 0 + adds r7, r1, 0 + adds r4, r2, 0 + ldr r1, =gUnknown_0850DFC2 + add r0, sp, 0x4 + movs r2, 0x6 + bl memcpy + adds r0, r7, 0 + bl _call_via_r4 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x1 + bne _08094154 + movs r1, 0x36 + ldrsh r0, [r7, r1] + lsls r0, 1 + add r0, sp + adds r0, 0x4 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + beq _08094154 + add r4, sp, 0xC + movs r0, 0 + strh r0, [r4] + mov r5, sp + adds r5, 0xE + strh r0, [r5] + ldrb r0, [r6, 0x18] + lsrs r0, 4 + movs r2, 0x36 + ldrsh r1, [r7, r2] + lsls r1, 1 + add r1, sp + adds r1, 0x4 + movs r2, 0 + ldrsh r3, [r1, r2] + str r3, [sp] + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_8092F88 + ldrh r1, [r4] + ldrh r0, [r6, 0x10] + adds r1, r0 + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r5] + ldrh r0, [r6, 0x12] + adds r2, r0 + lsls r2, 16 + asrs r2, 16 + adds r0, r6, 0 + bl npc_coords_shift + ldrb r0, [r6] + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r6] + b _08094178 + .pool +_08094154: + mov r1, r8 + cmp r1, 0xFF + bne _08094178 + adds r0, r6, 0 + bl npc_coords_shift_still + ldrb r0, [r6] + movs r1, 0x8 + orrs r0, r1 + movs r1, 0x20 + orrs r0, r1 + strb r0, [r6] + adds r2, r7, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] +_08094178: + mov r0, r8 + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80940C4 + + thumb_func_start sub_8094188 +sub_8094188: @ 8094188 + push {lr} + ldr r2, =sub_809785C + bl sub_80940C4 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8094188 + + thumb_func_start sub_809419C +sub_809419C: @ 809419C + push {lr} + ldr r2, =sub_80978E4 + bl sub_80940C4 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809419C + + thumb_func_start sub_80941B0 +sub_80941B0: @ 80941B0 + push {lr} + bl sub_8094188 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _080941C2 + movs r0, 0 + b _080941C4 +_080941C2: + movs r0, 0x1 +_080941C4: + pop {r1} + bx r1 + thumb_func_end sub_80941B0 + + thumb_func_start sub_80941C8 +sub_80941C8: @ 80941C8 + push {lr} + bl sub_809419C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _080941DA + movs r0, 0 + b _080941DC +_080941DA: + movs r0, 0x1 +_080941DC: + pop {r1} + bx r1 + thumb_func_end sub_80941C8 + + thumb_func_start sub_80941E0 +sub_80941E0: @ 80941E0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_8094188 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080941FA + cmp r0, 0xFF + bne _08094226 + movs r0, 0x1 + b _08094228 +_080941FA: + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl GetOppositeDirection + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetDirection + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl get_go_image_anim_num + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl obj_npc_animation_step +_08094226: + movs r0, 0 +_08094228: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80941E0 + + thumb_func_start sub_8094230 +sub_8094230: @ 8094230 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x2 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809425C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094230 + + thumb_func_start sub_809425C +sub_809425C: @ 809425C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08094270 + movs r0, 0 + b _08094280 +_08094270: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08094280: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809425C + + thumb_func_start sub_8094288 +sub_8094288: @ 8094288 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0x2 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80942B4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094288 + + thumb_func_start sub_80942B4 +sub_80942B4: @ 80942B4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _080942C8 + movs r0, 0 + b _080942D8 +_080942C8: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_080942D8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80942B4 + + thumb_func_start sub_80942E0 +sub_80942E0: @ 80942E0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x3 + movs r3, 0x2 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809430C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80942E0 + + thumb_func_start sub_809430C +sub_809430C: @ 809430C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08094320 + movs r0, 0 + b _08094330 +_08094320: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08094330: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809430C + + thumb_func_start sub_8094338 +sub_8094338: @ 8094338 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x4 + movs r3, 0x2 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094364 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094338 + + thumb_func_start sub_8094364 +sub_8094364: @ 8094364 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08094378 + movs r0, 0 + b _08094388 +_08094378: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08094388: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094364 + + thumb_func_start sub_8094390 +sub_8094390: @ 8094390 + movs r2, 0x1 + strh r2, [r0, 0x32] + strh r1, [r0, 0x34] + bx lr + thumb_func_end sub_8094390 + + thumb_func_start sub_8094398 +sub_8094398: @ 8094398 + push {lr} + ldrh r0, [r1, 0x34] + subs r0, 0x1 + strh r0, [r1, 0x34] + lsls r0, 16 + cmp r0, 0 + beq _080943AA + movs r0, 0 + b _080943B0 +_080943AA: + movs r0, 0x2 + strh r0, [r1, 0x32] + movs r0, 0x1 +_080943B0: + pop {r1} + bx r1 + thumb_func_end sub_8094398 + + thumb_func_start sub_80943B4 +sub_80943B4: @ 80943B4 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8094390 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8094398 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80943B4 + + thumb_func_start sub_80943D4 +sub_80943D4: @ 80943D4 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + movs r1, 0x2 + bl sub_8094390 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8094398 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80943D4 + + thumb_func_start sub_80943F4 +sub_80943F4: @ 80943F4 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + movs r1, 0x4 + bl sub_8094390 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8094398 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80943F4 + + thumb_func_start sub_8094414 +sub_8094414: @ 8094414 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + movs r1, 0x8 + bl sub_8094390 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8094398 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094414 + + thumb_func_start sub_8094434 +sub_8094434: @ 8094434 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + movs r1, 0x10 + bl sub_8094390 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8094398 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094434 + + thumb_func_start sub_8094454 +sub_8094454: @ 8094454 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + movs r3, 0x1 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094474 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094454 + + thumb_func_start sub_8094474 +sub_8094474: @ 8094474 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094486 + movs r0, 0 + b _0809448C +_08094486: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_0809448C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094474 + + thumb_func_start sub_8094494 +sub_8094494: @ 8094494 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x2 + movs r3, 0x1 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80944B4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094494 + + thumb_func_start sub_80944B4 +sub_80944B4: @ 80944B4 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _080944C6 + movs r0, 0 + b _080944CC +_080944C6: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080944CC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80944B4 + + thumb_func_start sub_80944D4 +sub_80944D4: @ 80944D4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x3 + movs r3, 0x1 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80944F4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80944D4 + + thumb_func_start sub_80944F4 +sub_80944F4: @ 80944F4 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094506 + movs r0, 0 + b _0809450C +_08094506: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_0809450C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80944F4 + + thumb_func_start sub_8094514 +sub_8094514: @ 8094514 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + movs r3, 0x1 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094534 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094514 + + thumb_func_start sub_8094534 +sub_8094534: @ 8094534 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094546 + movs r0, 0 + b _0809454C +_08094546: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_0809454C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094534 + + thumb_func_start sub_8094554 +sub_8094554: @ 8094554 + push {r4-r6,lr} + mov r6, r8 + push {r6} + mov r8, r0 + adds r6, r1, 0 + adds r1, r2, 0 + adds r4, r3, 0 + ldr r5, [sp, 0x14] + lsls r1, 24 + lsrs r1, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 16 + lsrs r5, 16 + bl FieldObjectSetDirection + mov r0, r8 + adds r1, r6, 0 + adds r2, r4, 0 + bl npc_apply_anim_looping + adds r2, r6, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + movs r0, 0x1 + strh r0, [r6, 0x32] + strh r5, [r6, 0x34] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8094554 + + thumb_func_start sub_809459C +@ signed int sub_809459C(int a1, obj *a2) +sub_809459C: @ 809459C + push {lr} + ldrh r0, [r1, 0x34] + subs r0, 0x1 + strh r0, [r1, 0x34] + lsls r0, 16 + cmp r0, 0 + beq _080945AE + movs r0, 0 + b _080945C0 +_080945AE: + movs r0, 0x2 + strh r0, [r1, 0x32] + adds r2, r1, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x1 +_080945C0: + pop {r1} + bx r1 + thumb_func_end sub_809459C + + thumb_func_start sub_80945C4 +@ int sub_80945C4(int a1, obj *a2) +sub_80945C4: @ 80945C4 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldrh r1, [r4, 0x34] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080945EE + adds r3, r4, 0 + adds r3, 0x2C + ldrb r2, [r3] + lsls r1, r2, 26 + lsrs r1, 26 + adds r1, 0x1 + movs r0, 0x3F + ands r1, r0 + movs r0, 0x40 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_080945EE: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80945C4 + + thumb_func_start sub_8094600 +sub_8094600: @ 8094600 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + bl get_go_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x20 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80945C4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094600 + + thumb_func_start sub_8094638 +sub_8094638: @ 8094638 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + bl get_go_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x20 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80945C4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094638 + + thumb_func_start sub_8094670 +sub_8094670: @ 8094670 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x3 + bl get_go_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x20 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80945C4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094670 + + thumb_func_start sub_80946A8 +sub_80946A8: @ 80946A8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x4 + bl get_go_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x20 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x4 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80945C4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80946A8 + + thumb_func_start sub_80946E0 +sub_80946E0: @ 80946E0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + bl get_go_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x10 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80946E0 + + thumb_func_start sub_8094718 +sub_8094718: @ 8094718 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + bl get_go_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x10 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094718 + + thumb_func_start sub_8094750 +sub_8094750: @ 8094750 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x3 + bl get_go_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x10 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094750 + + thumb_func_start sub_8094788 +sub_8094788: @ 8094788 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x4 + bl get_go_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x10 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x4 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094788 + + thumb_func_start sub_80947C0 +sub_80947C0: @ 80947C0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + bl get_go_fast_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x8 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80947C0 + + thumb_func_start sub_80947F8 +sub_80947F8: @ 80947F8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + bl get_go_fast_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x8 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80947F8 + + thumb_func_start sub_8094830 +sub_8094830: @ 8094830 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x3 + bl get_go_fast_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x8 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094830 + + thumb_func_start sub_8094868 +sub_8094868: @ 8094868 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x4 + bl get_go_fast_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x8 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x4 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094868 + + thumb_func_start sub_80948A0 +sub_80948A0: @ 80948A0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + bl get_go_faster_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x4 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80948A0 + + thumb_func_start sub_80948D8 +sub_80948D8: @ 80948D8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + bl get_go_faster_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x4 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80948D8 + + thumb_func_start sub_8094910 +sub_8094910: @ 8094910 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x3 + bl get_go_faster_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x4 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094910 + + thumb_func_start sub_8094948 +sub_8094948: @ 8094948 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x4 + bl get_go_faster_image_anim_num + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x4 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x4 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094948 + + thumb_func_start sub_8094980 +sub_8094980: @ 8094980 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + movs r3, 0x2 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80949A0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094980 + + thumb_func_start sub_80949A0 +sub_80949A0: @ 80949A0 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _080949B2 + movs r0, 0 + b _080949B8 +_080949B2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080949B8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80949A0 + + thumb_func_start sub_80949C0 +sub_80949C0: @ 80949C0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x2 + movs r3, 0x2 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80949E0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80949C0 + + thumb_func_start sub_80949E0 +sub_80949E0: @ 80949E0 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _080949F2 + movs r0, 0 + b _080949F8 +_080949F2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080949F8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80949E0 + + thumb_func_start sub_8094A00 +sub_8094A00: @ 8094A00 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x3 + movs r3, 0x2 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094A20 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094A00 + + thumb_func_start sub_8094A20 +sub_8094A20: @ 8094A20 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094A32 + movs r0, 0 + b _08094A38 +_08094A32: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094A38: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094A20 + + thumb_func_start sub_8094A40 +sub_8094A40: @ 8094A40 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + movs r3, 0x2 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094A60 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094A40 + + thumb_func_start sub_8094A60 +sub_8094A60: @ 8094A60 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094A72 + movs r0, 0 + b _08094A78 +_08094A72: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094A78: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094A60 + + thumb_func_start sub_8094A80 +sub_8094A80: @ 8094A80 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + movs r3, 0x3 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094AA0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094A80 + + thumb_func_start sub_8094AA0 +sub_8094AA0: @ 8094AA0 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094AB2 + movs r0, 0 + b _08094AB8 +_08094AB2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094AB8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094AA0 + + thumb_func_start sub_8094AC0 +sub_8094AC0: @ 8094AC0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x2 + movs r3, 0x3 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094AE0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094AC0 + + thumb_func_start sub_8094AE0 +sub_8094AE0: @ 8094AE0 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094AF2 + movs r0, 0 + b _08094AF8 +_08094AF2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094AF8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094AE0 + + thumb_func_start sub_8094B00 +sub_8094B00: @ 8094B00 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x3 + movs r3, 0x3 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094B20 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094B00 + + thumb_func_start sub_8094B20 +sub_8094B20: @ 8094B20 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094B32 + movs r0, 0 + b _08094B38 +_08094B32: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094B38: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094B20 + + thumb_func_start sub_8094B40 +sub_8094B40: @ 8094B40 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + movs r3, 0x3 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094B60 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094B40 + + thumb_func_start sub_8094B60 +sub_8094B60: @ 8094B60 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094B72 + movs r0, 0 + b _08094B78 +_08094B72: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094B78: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094B60 + + thumb_func_start sub_8094B80 +sub_8094B80: @ 8094B80 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + movs r3, 0x4 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094BA0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094B80 + + thumb_func_start sub_8094BA0 +sub_8094BA0: @ 8094BA0 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094BB2 + movs r0, 0 + b _08094BB8 +_08094BB2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094BB8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094BA0 + + thumb_func_start sub_8094BC0 +sub_8094BC0: @ 8094BC0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x2 + movs r3, 0x4 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094BE0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094BC0 + + thumb_func_start sub_8094BE0 +sub_8094BE0: @ 8094BE0 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094BF2 + movs r0, 0 + b _08094BF8 +_08094BF2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094BF8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094BE0 + + thumb_func_start sub_8094C00 +sub_8094C00: @ 8094C00 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x3 + movs r3, 0x4 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094C20 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094C00 + + thumb_func_start sub_8094C20 +sub_8094C20: @ 8094C20 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094C32 + movs r0, 0 + b _08094C38 +_08094C32: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094C38: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094C20 + + thumb_func_start sub_8094C40 +sub_8094C40: @ 8094C40 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + movs r3, 0x4 + bl do_go_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094C60 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094C40 + + thumb_func_start sub_8094C60 +sub_8094C60: @ 8094C60 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094C72 + movs r0, 0 + b _08094C78 +_08094C72: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094C78: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094C60 + + thumb_func_start do_run_south_anim +@ bool8 do_run_south_anim(struct npc_state *fieldObject, struct obj *object) +do_run_south_anim: @ 8094C80 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + bl do_run_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094CA0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end do_run_south_anim + + thumb_func_start sub_8094CA0 +@ bool8 sub_8094CA0(struct npc_state *fieldObject, struct obj *object) +sub_8094CA0: @ 8094CA0 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094CB2 + movs r0, 0 + b _08094CB8 +_08094CB2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094CB8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094CA0 + + thumb_func_start do_run_north_anim +do_run_north_anim: @ 8094CC0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x2 + bl do_run_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094CE0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end do_run_north_anim + + thumb_func_start sub_8094CE0 +sub_8094CE0: @ 8094CE0 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094CF2 + movs r0, 0 + b _08094CF8 +_08094CF2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094CF8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094CE0 + + thumb_func_start do_run_west_anim +do_run_west_anim: @ 8094D00 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x3 + bl do_run_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094D20 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end do_run_west_anim + + thumb_func_start sub_8094D20 +sub_8094D20: @ 8094D20 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094D32 + movs r0, 0 + b _08094D38 +_08094D32: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094D38: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094D20 + + thumb_func_start do_run_east_anim +do_run_east_anim: @ 8094D40 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + bl do_run_anim + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094D60 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end do_run_east_anim + + thumb_func_start sub_8094D60 +sub_8094D60: @ 8094D60 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08094D72 + movs r0, 0 + b _08094D78 +_08094D72: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094D78: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094D60 + + thumb_func_start npc_set_direction_and_anim__an_proceed +npc_set_direction_and_anim__an_proceed: @ 8094D80 + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + adds r4, r2, 0 + adds r1, r3, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + movs r2, 0 + bl obj_anim_image_set_and_seek + adds r0, r6, 0 + adds r1, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x1 + strh r0, [r5, 0x32] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end npc_set_direction_and_anim__an_proceed + + thumb_func_start sub_8094DAC +sub_8094DAC: @ 8094DAC + push {lr} + ldrb r2, [r0, 0x18] + lsrs r2, 4 + adds r3, r1, 0 + adds r3, 0x2A + ldrb r3, [r3] + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_8094DAC + + thumb_func_start sub_8094DC4 +sub_8094DC4: @ 8094DC4 + push {r4,lr} + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80979BC + lsls r0, 24 + cmp r0, 0 + bne _08094DD8 + movs r0, 0 + b _08094DDE +_08094DD8: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08094DDE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094DC4 + + thumb_func_start sub_8094DE4 +sub_8094DE4: @ 8094DE4 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r1, 0 + lsls r4, r2, 24 + lsrs r4, 24 + movs r1, 0 + str r1, [sp] + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8093FC4 + adds r0, r4, 0 + bl sub_80929AC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl StartObjectImageAnim + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8094DE4 + + thumb_func_start sub_8094E18 +sub_8094E18: @ 8094E18 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + bl sub_8094DE4 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094E38 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094E18 + + thumb_func_start sub_8094E38 +sub_8094E38: @ 8094E38 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941C8 + lsls r0, 24 + cmp r0, 0 + bne _08094E4C + movs r0, 0 + b _08094E5A +_08094E4C: + movs r0, 0x2 + strh r0, [r5, 0x32] + ldrb r1, [r4] + subs r0, 0x23 + ands r0, r1 + strb r0, [r4] + movs r0, 0x1 +_08094E5A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094E38 + + thumb_func_start sub_8094E60 +sub_8094E60: @ 8094E60 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x2 + bl sub_8094DE4 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094E80 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094E60 + + thumb_func_start sub_8094E80 +sub_8094E80: @ 8094E80 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941C8 + lsls r0, 24 + cmp r0, 0 + bne _08094E94 + movs r0, 0 + b _08094EA2 +_08094E94: + movs r0, 0x2 + strh r0, [r5, 0x32] + ldrb r1, [r4] + subs r0, 0x23 + ands r0, r1 + strb r0, [r4] + movs r0, 0x1 +_08094EA2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094E80 + + thumb_func_start sub_8094EA8 +sub_8094EA8: @ 8094EA8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x3 + bl sub_8094DE4 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094EC8 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094EA8 + + thumb_func_start sub_8094EC8 +sub_8094EC8: @ 8094EC8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941C8 + lsls r0, 24 + cmp r0, 0 + bne _08094EDC + movs r0, 0 + b _08094EEA +_08094EDC: + movs r0, 0x2 + strh r0, [r5, 0x32] + ldrb r1, [r4] + subs r0, 0x23 + ands r0, r1 + strb r0, [r4] + movs r0, 0x1 +_08094EEA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094EC8 + + thumb_func_start sub_8094EF0 +sub_8094EF0: @ 8094EF0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + bl sub_8094DE4 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8094F10 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094EF0 + + thumb_func_start sub_8094F10 +sub_8094F10: @ 8094F10 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941C8 + lsls r0, 24 + cmp r0, 0 + bne _08094F24 + movs r0, 0 + b _08094F32 +_08094F24: + movs r0, 0x2 + strh r0, [r5, 0x32] + ldrb r1, [r4] + subs r0, 0x23 + ands r0, r1 + strb r0, [r4] + movs r0, 0x1 +_08094F32: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8094F10 + + thumb_func_start sub_8094F38 +sub_8094F38: @ 8094F38 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _08094F82 + movs r1, 0x10 + ldrsh r0, [r5, r1] + movs r2, 0x12 + ldrsh r1, [r5, r2] + ldr r4, =0x02037350 + mov r2, sp + ldrb r2, [r2] + lsls r3, r2, 3 + adds r3, r2 + lsls r3, 2 + adds r3, r4 + movs r4, 0x10 + ldrsh r2, [r3, r4] + movs r4, 0x12 + ldrsh r3, [r3, r4] + bl sub_8092AF8 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r5, 0 + adds r1, r6, 0 + bl an_look_any +_08094F82: + movs r0, 0x1 + strh r0, [r6, 0x32] + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8094F38 + + thumb_func_start sub_8094F94 +sub_8094F94: @ 8094F94 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _08094FE6 + movs r1, 0x10 + ldrsh r0, [r5, r1] + movs r2, 0x12 + ldrsh r1, [r5, r2] + ldr r4, =0x02037350 + mov r2, sp + ldrb r2, [r2] + lsls r3, r2, 3 + adds r3, r2 + lsls r3, 2 + adds r3, r4 + movs r4, 0x10 + ldrsh r2, [r3, r4] + movs r4, 0x12 + ldrsh r3, [r3, r4] + bl sub_8092AF8 + lsls r0, 24 + lsrs r0, 24 + bl GetOppositeDirection + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r5, 0 + adds r1, r6, 0 + bl an_look_any +_08094FE6: + movs r0, 0x1 + strh r0, [r6, 0x32] + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8094F94 + + thumb_func_start sub_8094FF8 +sub_8094FF8: @ 8094FF8 + ldrb r2, [r0, 0x1] + movs r3, 0x2 + orrs r2, r3 + strb r2, [r0, 0x1] + movs r0, 0x1 + strh r0, [r1, 0x32] + bx lr + thumb_func_end sub_8094FF8 + + thumb_func_start sub_8095008 +sub_8095008: @ 8095008 + ldrb r3, [r0, 0x1] + movs r2, 0x3 + negs r2, r2 + ands r2, r3 + strb r2, [r0, 0x1] + movs r0, 0x1 + strh r0, [r1, 0x32] + bx lr + thumb_func_end sub_8095008 + + thumb_func_start sub_8095018 +sub_8095018: @ 8095018 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x1 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095044 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095018 + + thumb_func_start sub_8095044 +sub_8095044: @ 8095044 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095058 + movs r0, 0 + b _08095068 +_08095058: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095068: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095044 + + thumb_func_start sub_8095070 +sub_8095070: @ 8095070 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0x1 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809509C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095070 + + thumb_func_start sub_809509C +sub_809509C: @ 809509C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _080950B0 + movs r0, 0 + b _080950C0 +_080950B0: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_080950C0: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809509C + + thumb_func_start sub_80950C8 +sub_80950C8: @ 80950C8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x3 + movs r3, 0x1 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80950F4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80950C8 + + thumb_func_start sub_80950F4 +sub_80950F4: @ 80950F4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095108 + movs r0, 0 + b _08095118 +_08095108: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095118: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80950F4 + + thumb_func_start sub_8095120 +sub_8095120: @ 8095120 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x4 + movs r3, 0x1 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809514C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095120 + + thumb_func_start sub_809514C +sub_809514C: @ 809514C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095160 + movs r0, 0 + b _08095170 +_08095160: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095170: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809514C + + thumb_func_start sub_8095178 +sub_8095178: @ 8095178 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80951A4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095178 + + thumb_func_start sub_80951A4 +sub_80951A4: @ 80951A4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _080951B8 + movs r0, 0 + b _080951C8 +_080951B8: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_080951C8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80951A4 + + thumb_func_start sub_80951D0 +sub_80951D0: @ 80951D0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80951FC + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80951D0 + + thumb_func_start sub_80951FC +sub_80951FC: @ 80951FC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095210 + movs r0, 0 + b _08095220 +_08095210: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095220: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80951FC + + thumb_func_start sub_8095228 +sub_8095228: @ 8095228 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x3 + movs r3, 0 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095254 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095228 + + thumb_func_start sub_8095254 +sub_8095254: @ 8095254 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095268 + movs r0, 0 + b _08095278 +_08095268: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095278: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095254 + + thumb_func_start sub_8095280 +sub_8095280: @ 8095280 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x4 + movs r3, 0 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80952AC + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095280 + + thumb_func_start sub_80952AC +sub_80952AC: @ 80952AC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _080952C0 + movs r0, 0 + b _080952D0 +_080952C0: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_080952D0: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80952AC + + thumb_func_start sub_80952D8 +sub_80952D8: @ 80952D8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095304 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80952D8 + + thumb_func_start sub_8095304 +sub_8095304: @ 8095304 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941E0 + lsls r0, 24 + cmp r0, 0 + bne _08095318 + movs r0, 0 + b _08095328 +_08095318: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095328: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095304 + + thumb_func_start sub_8095330 +sub_8095330: @ 8095330 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809535C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095330 + + thumb_func_start sub_809535C +sub_809535C: @ 809535C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941E0 + lsls r0, 24 + cmp r0, 0 + bne _08095370 + movs r0, 0 + b _08095380 +_08095370: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095380: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809535C + + thumb_func_start sub_8095388 +sub_8095388: @ 8095388 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x3 + movs r3, 0 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80953B4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095388 + + thumb_func_start sub_80953B4 +sub_80953B4: @ 80953B4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941E0 + lsls r0, 24 + cmp r0, 0 + bne _080953C8 + movs r0, 0 + b _080953D8 +_080953C8: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_080953D8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80953B4 + + thumb_func_start sub_80953E0 +sub_80953E0: @ 80953E0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x4 + movs r3, 0 + bl maybe_shadow_1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809540C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80953E0 + + thumb_func_start sub_809540C +sub_809540C: @ 809540C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941E0 + lsls r0, 24 + cmp r0, 0 + bne _08095420 + movs r0, 0 + b _08095430 +_08095420: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095430: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809540C + + thumb_func_start sub_8095438 +sub_8095438: @ 8095438 + push {lr} + ldr r3, =gUnknown_085055CD + ldrb r2, [r0, 0x6] + adds r2, r3 + ldrb r2, [r2] + bl an_look_any + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8095438 + + thumb_func_start sub_8095450 +sub_8095450: @ 8095450 + push {lr} + movs r2, 0x1 + movs r3, 0x14 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_8095450 + + thumb_func_start sub_8095460 +sub_8095460: @ 8095460 + ldrb r3, [r0, 0x3] + movs r2, 0x3 + negs r2, r2 + ands r2, r3 + strb r2, [r0, 0x3] + movs r0, 0x1 + strh r0, [r1, 0x32] + bx lr + thumb_func_end sub_8095460 + + thumb_func_start sub_8095470 +sub_8095470: @ 8095470 + ldrb r2, [r0, 0x3] + movs r3, 0x2 + orrs r2, r3 + strb r2, [r0, 0x3] + movs r0, 0x1 + strh r0, [r1, 0x32] + bx lr + thumb_func_end sub_8095470 + + thumb_func_start sub_8095480 +sub_8095480: @ 8095480 + ldrb r2, [r0, 0x1] + movs r3, 0x10 + orrs r2, r3 + strb r2, [r0, 0x1] + movs r0, 0x1 + strh r0, [r1, 0x32] + bx lr + thumb_func_end sub_8095480 + + thumb_func_start sub_8095490 +@ int sub_8095490(npc_state *npcState, int a2) +sub_8095490: @ 8095490 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x5] + bl GetFieldObjectGraphicsInfo + ldrb r1, [r0, 0xC] + lsls r1, 25 + lsrs r1, 31 + lsls r1, 4 + ldrb r2, [r4, 0x1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x1] + movs r0, 0x1 + strh r0, [r5, 0x32] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095490 + + thumb_func_start sub_80954BC +sub_80954BC: @ 80954BC + ldrb r2, [r0, 0x1] + movs r3, 0x20 + orrs r2, r3 + strb r2, [r0, 0x1] + movs r0, 0x1 + strh r0, [r1, 0x32] + bx lr + thumb_func_end sub_80954BC + + thumb_func_start sub_80954CC +sub_80954CC: @ 80954CC + ldrb r3, [r0, 0x1] + movs r2, 0x21 + negs r2, r2 + ands r2, r3 + strb r2, [r0, 0x1] + movs r0, 0x1 + strh r0, [r1, 0x32] + bx lr + thumb_func_end sub_80954CC + + thumb_func_start do_exclamation_mark_bubble_1 +do_exclamation_mark_bubble_1: @ 80954DC + push {r4,lr} + adds r4, r1, 0 + ldr r1, =0x02038c08 + adds r2, r1, 0x4 + adds r3, r1, 0 + adds r3, 0x8 + bl FieldObjectGetLocalIdAndMap + movs r0, 0 + bl FieldEffectStart + movs r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end do_exclamation_mark_bubble_1 + + thumb_func_start do_exclamation_mark_bubble_2 +do_exclamation_mark_bubble_2: @ 8095500 + push {r4,lr} + adds r4, r1, 0 + ldr r1, =0x02038c08 + adds r2, r1, 0x4 + adds r3, r1, 0 + adds r3, 0x8 + bl FieldObjectGetLocalIdAndMap + movs r0, 0x21 + bl FieldEffectStart + movs r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end do_exclamation_mark_bubble_2 + + thumb_func_start do_heart_bubble +do_heart_bubble: @ 8095524 + push {r4,lr} + adds r4, r1, 0 + ldr r1, =0x02038c08 + adds r2, r1, 0x4 + adds r3, r1, 0 + adds r3, 0x8 + bl FieldObjectGetLocalIdAndMap + movs r0, 0x2E + bl FieldEffectStart + movs r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end do_heart_bubble + + thumb_func_start sub_8095548 +sub_8095548: @ 8095548 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4, 0x6] + cmp r0, 0x3F + bne _0809555E + adds r0, r4, 0 + bl sub_80B4578 + movs r0, 0 + b _08095586 +_0809555E: + subs r0, 0x39 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08095580 + adds r0, r4, 0 + bl sub_8155D78 + movs r0, 0x1 + strh r0, [r5, 0x32] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809558C + lsls r0, 24 + lsrs r0, 24 + b _08095586 +_08095580: + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095586: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095548 + + thumb_func_start sub_809558C +sub_809558C: @ 809558C + push {r4,lr} + adds r4, r1, 0 + bl sub_8155DA0 + lsls r0, 24 + cmp r0, 0 + bne _0809559E + movs r0, 0 + b _080955A4 +_0809559E: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080955A4: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809558C + + thumb_func_start sub_80955AC +sub_80955AC: @ 80955AC + push {r4,lr} + adds r4, r1, 0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl obj_anim_image_set_and_seek + movs r0, 0x1 + strh r0, [r4, 0x32] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80955AC + + thumb_func_start sub_80955C8 +sub_80955C8: @ 80955C8 + push {r4,lr} + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80979BC + lsls r0, 24 + cmp r0, 0 + beq _080955E4 + adds r0, r4, 0 + movs r1, 0x20 + bl sub_8097978 + movs r0, 0x2 + strh r0, [r4, 0x32] +_080955E4: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80955C8 + + thumb_func_start sub_80955EC +sub_80955EC: @ 80955EC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r2, [r4, 0x1] + lsls r1, r2, 26 + lsrs r1, 31 + movs r0, 0x1 + eors r1, r0 + lsls r1, 5 + subs r0, 0x22 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x1] + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + beq _0809561E + ldrb r0, [r4, 0x1] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r4, 0x1] + movs r0, 0x3 + strh r0, [r5, 0x32] +_0809561E: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80955EC + + thumb_func_start sub_8095628 +sub_8095628: @ 8095628 + push {r4,lr} + adds r4, r1, 0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl obj_anim_image_set_and_seek + movs r0, 0x1 + strh r0, [r4, 0x32] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8095628 + + thumb_func_start sub_8095644 +sub_8095644: @ 8095644 + push {r4,lr} + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80979BC + lsls r0, 24 + cmp r0, 0 + beq _08095660 + adds r0, r4, 0 + movs r1, 0x20 + bl sub_8097978 + movs r0, 0x2 + strh r0, [r4, 0x32] +_08095660: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8095644 + + thumb_func_start sub_8095668 +sub_8095668: @ 8095668 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r2, [r4, 0x1] + lsls r1, r2, 26 + lsrs r1, 31 + movs r0, 0x1 + eors r1, r0 + lsls r1, 5 + subs r0, 0x22 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x1] + adds r0, r5, 0 + bl sub_809797C + lsls r0, 24 + cmp r0, 0 + beq _0809569A + ldrb r0, [r4, 0x1] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r4, 0x1] + movs r0, 0x3 + strh r0, [r5, 0x32] +_0809569A: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095668 + + thumb_func_start sub_80956A4 +sub_80956A4: @ 80956A4 + ldrb r2, [r0, 0x3] + movs r3, 0x4 + orrs r2, r3 + strb r2, [r0, 0x3] + movs r0, 0x1 + strh r0, [r1, 0x32] + bx lr + thumb_func_end sub_80956A4 + + thumb_func_start sub_80956B4 +sub_80956B4: @ 80956B4 + ldrb r3, [r0, 0x3] + movs r2, 0x5 + negs r2, r2 + ands r2, r3 + strb r2, [r0, 0x3] + movs r0, 0x1 + strh r0, [r1, 0x32] + bx lr + thumb_func_end sub_80956B4 + + thumb_func_start sub_80956C4 +sub_80956C4: @ 80956C4 + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r4, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r4, 0x1] + adds r0, r4, 0 + bl obj_alloc_rotscale_entry + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + adds r4, 0x42 + ldrb r1, [r4] + movs r0, 0x3F + ands r0, r1 + strb r0, [r4] + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80956C4 + + thumb_func_start sub_80956F4 +sub_80956F4: @ 80956F4 + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldrb r0, [r4, 0x1] + movs r1, 0x4 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x1] + lsrs r1, 6 + ldrb r2, [r4, 0x3] + lsrs r2, 6 + movs r3, 0 + adds r0, r4, 0 + bl CalcVecFromObjectCenterToObjectUpperLeft + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80956F4 + + thumb_func_start sub_8095724 +sub_8095724: @ 8095724 + ldrb r1, [r0, 0x3] + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0, 0x3] + movs r0, 0x1 + bx lr + thumb_func_end sub_8095724 + + thumb_func_start sub_8095730 +sub_8095730: @ 8095730 + ldrb r2, [r0, 0x3] + movs r1, 0x9 + negs r1, r1 + ands r1, r2 + strb r1, [r0, 0x3] + movs r0, 0x1 + bx lr + thumb_func_end sub_8095730 + + thumb_func_start sub_8095740 +sub_8095740: @ 8095740 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x1 + bl sub_8093B60 + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0 + bl StartObjectRotScalAnimIfDifferent + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8095774 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095740 + + thumb_func_start sub_8095774 +sub_8095774: @ 8095774 + push {r4,lr} + adds r4, r1, 0 + bl an_walk_any_2 + lsls r0, 24 + cmp r0, 0 + bne _08095786 + movs r0, 0 + b _08095798 +_08095786: + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08095798: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8095774 + + thumb_func_start sub_80957A0 +sub_80957A0: @ 80957A0 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x1 + bl sub_8093B60 + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80082F0 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80957D4 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80957A0 + + thumb_func_start sub_80957D4 +sub_80957D4: @ 80957D4 + push {r4,lr} + adds r4, r1, 0 + bl an_walk_any_2 + lsls r0, 24 + cmp r0, 0 + bne _080957E6 + movs r0, 0 + b _080957F8 +_080957E6: + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080957F8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80957D4 + + thumb_func_start sub_8095800 +sub_8095800: @ 8095800 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x3 + movs r3, 0x1 + bl do_go_anim + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80082F0 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8095834 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095800 + + thumb_func_start sub_8095834 +sub_8095834: @ 8095834 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08095846 + movs r0, 0 + b _08095858 +_08095846: + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08095858: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8095834 + + thumb_func_start sub_8095860 +sub_8095860: @ 8095860 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x4 + movs r3, 0x1 + bl do_go_anim + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x3 + bl sub_80082F0 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8095894 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095860 + + thumb_func_start sub_8095894 +sub_8095894: @ 8095894 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _080958A6 + movs r0, 0 + b _080958B8 +_080958A6: + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080958B8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8095894 + + thumb_func_start sub_80958C0 +sub_80958C0: @ 80958C0 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + lsls r4, r2, 24 + lsrs r4, 24 + adds r1, r4, 0 + bl FieldObjectSetDirection + adds r0, r5, 0 + bl npc_coords_shift_still + adds r0, r4, 0 + bl sub_80929FC + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r5, 0 + adds r1, r6, 0 + bl obj_npc_animation_step + adds r2, r6, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x1 + strh r0, [r6, 0x32] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80958C0 + + thumb_func_start sub_8095900 +sub_8095900: @ 8095900 + push {lr} + movs r2, 0x1 + bl sub_80958C0 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8095900 + + thumb_func_start sub_8095910 +sub_8095910: @ 8095910 + push {lr} + movs r2, 0x2 + bl sub_80958C0 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8095910 + + thumb_func_start sub_8095920 +sub_8095920: @ 8095920 + push {lr} + movs r2, 0x3 + bl sub_80958C0 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8095920 + + thumb_func_start sub_8095930 +sub_8095930: @ 8095930 + push {lr} + movs r2, 0x4 + bl sub_80958C0 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8095930 + + thumb_func_start sub_8095940 +sub_8095940: @ 8095940 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + bl sub_80929BC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095940 + + thumb_func_start sub_8095964 +sub_8095964: @ 8095964 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + bl sub_80929BC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095964 + + thumb_func_start sub_8095988 +sub_8095988: @ 8095988 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x3 + bl sub_80929BC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095988 + + thumb_func_start sub_80959AC +sub_80959AC: @ 80959AC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x4 + bl sub_80929BC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x4 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80959AC + + thumb_func_start sub_80959D0 +sub_80959D0: @ 80959D0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + bl sub_80929DC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80959D0 + + thumb_func_start sub_80959F4 +sub_80959F4: @ 80959F4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + bl sub_80929DC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80959F4 + + thumb_func_start sub_8095A18 +sub_8095A18: @ 8095A18 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x3 + bl sub_80929DC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095A18 + + thumb_func_start sub_8095A3C +sub_8095A3C: @ 8095A3C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x4 + bl sub_80929DC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x4 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095A3C + + thumb_func_start sub_8095A60 +sub_8095A60: @ 8095A60 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + bl sub_80929EC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095A60 + + thumb_func_start sub_8095A84 +sub_8095A84: @ 8095A84 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + bl sub_80929EC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095A84 + + thumb_func_start sub_8095AA8 +sub_8095AA8: @ 8095AA8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x3 + bl sub_80929EC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095AA8 + + thumb_func_start sub_8095ACC +sub_8095ACC: @ 8095ACC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x4 + bl sub_80929EC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x4 + bl npc_set_direction_and_anim__an_proceed + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095ACC + + thumb_func_start sub_8095AF0 +sub_8095AF0: @ 8095AF0 + push {r4,lr} + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_8097750 + adds r4, 0x2C + ldrb r1, [r4] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r4] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8095AF0 + + thumb_func_start sub_8095B0C +sub_8095B0C: @ 8095B0C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_8097758 + lsls r0, 24 + cmp r0, 0 + bne _08095B22 + movs r0, 0 + b _08095B3E +_08095B22: + adds r0, r4, 0 + bl npc_coords_shift_still + ldrb r0, [r4] + movs r1, 0x8 + orrs r0, r1 + strb r0, [r4] + adds r2, r5, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x1 +_08095B3E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095B0C + + thumb_func_start sub_8095B44 +sub_8095B44: @ 8095B44 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + bl sub_8095AF0 + movs r0, 0x1 + strh r0, [r4, 0x32] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8095B64 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095B44 + + thumb_func_start sub_8095B64 +sub_8095B64: @ 8095B64 + push {r4,lr} + adds r4, r1, 0 + bl sub_8095B0C + lsls r0, 24 + cmp r0, 0 + bne _08095B76 + movs r0, 0 + b _08095B7C +_08095B76: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08095B7C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8095B64 + + thumb_func_start sub_8095B84 +sub_8095B84: @ 8095B84 + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + adds r5, r1, 0 + adds r4, r2, 0 + ldr r0, [sp, 0x14] + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + adds r0, r6, 0 + adds r2, r4, 0 + bl sub_8093FC4 + adds r0, r4, 0 + bl sub_80929BC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl StartObjectImageAnimIfDifferent + adds r0, r6, 0 + bl DoShadowFieldEffect + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8095B84 + + thumb_func_start sub_8095BC8 +sub_8095BC8: @ 8095BC8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095BF4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095BC8 + + thumb_func_start sub_8095BF4 +sub_8095BF4: @ 8095BF4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095C08 + movs r0, 0 + b _08095C18 +_08095C08: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095C18: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095BF4 + + thumb_func_start sub_8095C20 +sub_8095C20: @ 8095C20 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095C4C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095C20 + + thumb_func_start sub_8095C4C +sub_8095C4C: @ 8095C4C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095C60 + movs r0, 0 + b _08095C70 +_08095C60: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095C70: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095C4C + + thumb_func_start sub_8095C78 +sub_8095C78: @ 8095C78 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x3 + movs r3, 0 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095CA4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095C78 + + thumb_func_start sub_8095CA4 +sub_8095CA4: @ 8095CA4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095CB8 + movs r0, 0 + b _08095CC8 +_08095CB8: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095CC8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095CA4 + + thumb_func_start sub_8095CD0 +sub_8095CD0: @ 8095CD0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x4 + movs r3, 0 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095CFC + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095CD0 + + thumb_func_start sub_8095CFC +sub_8095CFC: @ 8095CFC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095D10 + movs r0, 0 + b _08095D20 +_08095D10: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095D20: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095CFC + + thumb_func_start sub_8095D28 +sub_8095D28: @ 8095D28 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095D54 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095D28 + + thumb_func_start sub_8095D54 +sub_8095D54: @ 8095D54 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095D68 + movs r0, 0 + b _08095D78 +_08095D68: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095D78: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095D54 + + thumb_func_start sub_8095D80 +sub_8095D80: @ 8095D80 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0x1 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095DAC + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095D80 + + thumb_func_start sub_8095DAC +sub_8095DAC: @ 8095DAC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095DC0 + movs r0, 0 + b _08095DD0 +_08095DC0: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095DD0: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095DAC + + thumb_func_start sub_8095DD8 +sub_8095DD8: @ 8095DD8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x3 + movs r3, 0x1 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095E04 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095DD8 + + thumb_func_start sub_8095E04 +sub_8095E04: @ 8095E04 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095E18 + movs r0, 0 + b _08095E28 +_08095E18: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095E28: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095E04 + + thumb_func_start sub_8095E30 +sub_8095E30: @ 8095E30 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x4 + movs r3, 0x1 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095E5C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095E30 + + thumb_func_start sub_8095E5C +sub_8095E5C: @ 8095E5C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095E70 + movs r0, 0 + b _08095E80 +_08095E70: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095E80: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095E5C + + thumb_func_start sub_8095E88 +sub_8095E88: @ 8095E88 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x2 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095EB4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095E88 + + thumb_func_start sub_8095EB4 +sub_8095EB4: @ 8095EB4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095EC8 + movs r0, 0 + b _08095ED8 +_08095EC8: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095ED8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095EB4 + + thumb_func_start sub_8095EE0 +sub_8095EE0: @ 8095EE0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0x2 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095F0C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095EE0 + + thumb_func_start sub_8095F0C +sub_8095F0C: @ 8095F0C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095F20 + movs r0, 0 + b _08095F30 +_08095F20: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095F30: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095F0C + + thumb_func_start sub_8095F38 +sub_8095F38: @ 8095F38 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x3 + movs r3, 0x2 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095F64 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095F38 + + thumb_func_start sub_8095F64 +sub_8095F64: @ 8095F64 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095F78 + movs r0, 0 + b _08095F88 +_08095F78: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095F88: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095F64 + + thumb_func_start sub_8095F90 +sub_8095F90: @ 8095F90 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x4 + movs r3, 0x2 + bl sub_8095B84 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095FBC + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095F90 + + thumb_func_start sub_8095FBC +sub_8095FBC: @ 8095FBC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80941B0 + lsls r0, 24 + cmp r0, 0 + bne _08095FD0 + movs r0, 0 + b _08095FE0 +_08095FD0: + ldrb r0, [r4, 0x2] + movs r1, 0x41 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x32] + movs r0, 0x1 +_08095FE0: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095FBC + + thumb_func_start sub_8095FE8 +sub_8095FE8: @ 8095FE8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x1 + bl sub_80929FC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x8 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095FE8 + + thumb_func_start sub_8096020 +sub_8096020: @ 8096020 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x2 + bl sub_80929FC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x8 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096020 + + thumb_func_start sub_8096058 +sub_8096058: @ 8096058 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x3 + bl sub_80929FC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x8 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096058 + + thumb_func_start sub_8096090 +sub_8096090: @ 8096090 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x4 + bl sub_80929FC + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x8 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x4 + bl sub_8094554 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809459C + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096090 + + thumb_func_start sub_80960C8 +sub_80960C8: @ 80960C8 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + bl npc_apply_direction + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl sub_80929BC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + adds r0, r4, 0 + movs r1, 0 + bl SeekObjectImageAnim + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80960C8 + + thumb_func_start sub_8096100 +sub_8096100: @ 8096100 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_80960C8 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8096120 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096100 + + thumb_func_start sub_8096120 +sub_8096120: @ 8096120 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08096132 + movs r0, 0 + b _08096138 +_08096132: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08096138: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8096120 + + thumb_func_start sub_8096140 +sub_8096140: @ 8096140 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x2 + movs r3, 0x1 + bl sub_80960C8 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8096160 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096140 + + thumb_func_start sub_8096160 +sub_8096160: @ 8096160 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08096172 + movs r0, 0 + b _08096178 +_08096172: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08096178: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8096160 + + thumb_func_start sub_8096180 +sub_8096180: @ 8096180 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x3 + movs r3, 0x1 + bl sub_80960C8 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80961A0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096180 + + thumb_func_start sub_80961A0 +sub_80961A0: @ 80961A0 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _080961B2 + movs r0, 0 + b _080961B8 +_080961B2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080961B8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80961A0 + + thumb_func_start sub_80961C0 +sub_80961C0: @ 80961C0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + movs r3, 0x1 + bl sub_80960C8 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80961E0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80961C0 + + thumb_func_start sub_80961E0 +sub_80961E0: @ 80961E0 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _080961F2 + movs r0, 0 + b _080961F8 +_080961F2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080961F8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80961E0 + + thumb_func_start sub_8096200 +sub_8096200: @ 8096200 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + bl npc_apply_direction + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl sub_80929FC + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_apply_anim_looping + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8096200 + + thumb_func_start sub_8096230 +sub_8096230: @ 8096230 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_8096200 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8096250 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096230 + + thumb_func_start sub_8096250 +sub_8096250: @ 8096250 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08096262 + movs r0, 0 + b _08096268 +_08096262: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08096268: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8096250 + + thumb_func_start sub_8096270 +sub_8096270: @ 8096270 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x2 + movs r3, 0x1 + bl sub_8096200 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8096290 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096270 + + thumb_func_start sub_8096290 +sub_8096290: @ 8096290 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _080962A2 + movs r0, 0 + b _080962A8 +_080962A2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080962A8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8096290 + + thumb_func_start sub_80962B0 +sub_80962B0: @ 80962B0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x3 + movs r3, 0x1 + bl sub_8096200 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80962D0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80962B0 + + thumb_func_start sub_80962D0 +sub_80962D0: @ 80962D0 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _080962E2 + movs r0, 0 + b _080962E8 +_080962E2: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080962E8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80962D0 + + thumb_func_start sub_80962F0 +sub_80962F0: @ 80962F0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + movs r3, 0x1 + bl sub_8096200 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8096310 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80962F0 + + thumb_func_start sub_8096310 +sub_8096310: @ 8096310 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _08096322 + movs r0, 0 + b _08096328 +_08096322: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08096328: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8096310 + + thumb_func_start sub_8096330 +sub_8096330: @ 8096330 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + bl npc_apply_direction + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl sub_80929DC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + adds r0, r4, 0 + movs r1, 0 + bl SeekObjectImageAnim + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8096330 + + thumb_func_start sub_8096368 +sub_8096368: @ 8096368 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_8096330 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8096388 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096368 + + thumb_func_start sub_8096388 +sub_8096388: @ 8096388 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _0809639A + movs r0, 0 + b _080963A0 +_0809639A: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080963A0: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8096388 + + thumb_func_start sub_80963A8 +sub_80963A8: @ 80963A8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x2 + movs r3, 0x1 + bl sub_8096330 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80963C8 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80963A8 + + thumb_func_start sub_80963C8 +sub_80963C8: @ 80963C8 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _080963DA + movs r0, 0 + b _080963E0 +_080963DA: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_080963E0: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80963C8 + + thumb_func_start sub_80963E8 +sub_80963E8: @ 80963E8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x3 + movs r3, 0x1 + bl sub_8096330 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8096408 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80963E8 + + thumb_func_start sub_8096408 +sub_8096408: @ 8096408 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _0809641A + movs r0, 0 + b _08096420 +_0809641A: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08096420: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8096408 + + thumb_func_start sub_8096428 +sub_8096428: @ 8096428 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + movs r3, 0x1 + bl sub_8096330 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8096448 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096428 + + thumb_func_start sub_8096448 +sub_8096448: @ 8096448 + push {r4,lr} + adds r4, r1, 0 + bl npc_obj_ministep_stop_on_arrival + lsls r0, 24 + cmp r0, 0 + bne _0809645A + movs r0, 0 + b _08096460 +_0809645A: + movs r0, 0x2 + strh r0, [r4, 0x32] + movs r0, 0x1 +_08096460: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8096448 + + thumb_func_start sub_8096468 +sub_8096468: @ 8096468 + push {r4,lr} + adds r4, r1, 0 + bl sub_8097FA4 + movs r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8096468 + + thumb_func_start sub_809647C +sub_809647C: @ 809647C + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r0, 0x1B] + bl sub_8098044 + movs r0, 0 + strh r0, [r4, 0x26] + movs r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809647C + + thumb_func_start sub_8096494 +sub_8096494: @ 8096494 + push {r4,lr} + adds r2, r0, 0 + adds r4, r1, 0 + movs r1, 0x26 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080964A6 + movs r0, 0 + b _080964B0 +_080964A6: + ldrb r0, [r2, 0x1B] + bl sub_8098044 + movs r0, 0x1 + strh r0, [r4, 0x32] +_080964B0: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8096494 + + thumb_func_start sub_80964B8 +sub_80964B8: @ 80964B8 + movs r0, 0x1 + bx lr + thumb_func_end sub_80964B8 + + thumb_func_start sub_80964BC +@ bool8 sub_80964BC(struct npc_state *fieldObject, struct obj *object) +sub_80964BC: @ 80964BC + adds r1, 0x2C + ldrb r0, [r1] + movs r2, 0x40 + orrs r0, r2 + strb r0, [r1] + movs r0, 0x1 + bx lr + thumb_func_end sub_80964BC + + thumb_func_start npc_obj_transfer_image_anim_pause_flag +@ void npc_obj_transfer_image_anim_pause_flag(struct npc_state *fieldObject, struct obj *object) +npc_obj_transfer_image_anim_pause_flag: @ 80964CC + push {lr} + ldrb r0, [r0, 0x1] + lsls r0, 29 + cmp r0, 0 + bge _080964E2 + adds r0, r1, 0 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] +_080964E2: + pop {r0} + bx r0 + thumb_func_end npc_obj_transfer_image_anim_pause_flag + + thumb_func_start sub_80964E8 +@ void sub_80964E8(struct npc_state *fieldObject, struct obj *object) +sub_80964E8: @ 80964E8 + push {r4,lr} + adds r4, r0, 0 + ldrb r3, [r4, 0x1] + lsls r0, r3, 28 + cmp r0, 0 + bge _08096510 + adds r2, r1, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + movs r1, 0x9 + negs r1, r1 + ands r0, r1 + strb r0, [r4, 0x1] +_08096510: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80964E8 + + thumb_func_start sub_8096518 +@ void sub_8096518(struct npc_state *fieldObject, struct obj *object) +sub_8096518: @ 8096518 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_8096530 + adds r0, r4, 0 + adds r1, r5, 0 + bl npc_update_obj_anim_flag + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8096518 + + thumb_func_start sub_8096530 +sub_8096530: @ 8096530 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldrb r1, [r5, 0x1] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r5, 0x1] + ldrb r0, [r5, 0x5] + bl GetFieldObjectGraphicsInfo + adds r6, r0, 0 + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08096594 + ldrh r1, [r4, 0x24] + ldrh r0, [r4, 0x20] + adds r1, r0 + adds r0, r4, 0 + adds r0, 0x28 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldr r2, =0x02021bbc + adds r0, r1 + ldrh r2, [r2] + adds r0, r2 + lsls r0, 16 + lsrs r3, r0, 16 + ldrh r1, [r4, 0x26] + ldrh r0, [r4, 0x22] + adds r1, r0 + adds r0, r4, 0 + adds r0, 0x29 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldr r2, =0x02021bbe + adds r0, r1 + ldrh r2, [r2] + adds r0, r2 + b _080965BC + .pool +_08096594: + ldrh r1, [r4, 0x24] + ldrh r0, [r4, 0x20] + adds r1, r0 + adds r0, r4, 0 + adds r0, 0x28 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + lsls r0, 16 + lsrs r3, r0, 16 + ldrh r1, [r4, 0x26] + ldrh r0, [r4, 0x22] + adds r1, r0 + adds r0, r4, 0 + adds r0, 0x29 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 +_080965BC: + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r0, [r6, 0x8] + adds r0, r3 + lsls r0, 16 + lsrs r1, r0, 16 + ldrh r0, [r6, 0xA] + adds r0, r2 + lsls r0, 16 + lsrs r4, r0, 16 + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, 0xFF + bgt _080965E4 + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bge _080965EC +_080965E4: + ldrb r0, [r5, 0x1] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r5, 0x1] +_080965EC: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0xAF + bgt _08096600 + lsls r0, r4, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bge _08096608 +_08096600: + ldrb r0, [r5, 0x1] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r5, 0x1] +_08096608: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8096530 + + thumb_func_start npc_update_obj_anim_flag +@ void npc_update_obj_anim_flag(struct npc_state *fieldObject, struct obj *object) +npc_update_obj_anim_flag: @ 8096610 + push {lr} + adds r2, r1, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r3, 0x5 + negs r3, r3 + ands r3, r1 + strb r3, [r2] + ldrb r1, [r0, 0x1] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _08096632 + movs r1, 0x4 + adds r0, r3, 0 + orrs r0, r1 + strb r0, [r2] +_08096632: + pop {r0} + bx r0 + thumb_func_end npc_update_obj_anim_flag + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/field_message_box.s b/asm/field_message_box.s new file mode 100644 index 000000000..36276fb76 --- /dev/null +++ b/asm/field_message_box.s @@ -0,0 +1,337 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8098128 +sub_8098128: @ 8098128 + ldr r1, =0x020375bc + movs r0, 0 + strb r0, [r1] + ldr r2, =0x03003014 + ldrb r1, [r2] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + movs r1, 0x3 + negs r1, r1 + ands r0, r1 + subs r1, 0x2 + ands r0, r1 + subs r1, 0x4 + ands r0, r1 + strb r0, [r2] + bx lr + .pool + thumb_func_end sub_8098128 + + thumb_func_start sub_8098154 +sub_8098154: @ 8098154 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08098188 + cmp r0, 0x1 + bgt _0809817C + cmp r0, 0 + beq _08098182 + b _080981B0 + .pool +_0809817C: + cmp r0, 0x2 + beq _08098198 + b _080981B0 +_08098182: + bl sub_81973A4 + b _08098190 +_08098188: + movs r0, 0 + movs r1, 0x1 + bl sub_81973C4 +_08098190: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080981B0 +_08098198: + bl sub_8197224 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + beq _080981B0 + ldr r1, =0x020375bc + movs r0, 0 + strb r0, [r1] + adds r0, r5, 0 + bl DestroyTask +_080981B0: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8098154 + + thumb_func_start task_add_textbox +task_add_textbox: @ 80981BC + push {lr} + ldr r0, =sub_8098154 + movs r1, 0x50 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end task_add_textbox + + thumb_func_start task_del_textbox +task_del_textbox: @ 80981D0 + push {lr} + ldr r0, =sub_8098154 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _080981E4 + bl DestroyTask +_080981E4: + pop {r0} + bx r0 + .pool + thumb_func_end task_del_textbox + + thumb_func_start box_related_two__2 +box_related_two__2: @ 80981EC + push {r4,lr} + adds r1, r0, 0 + ldr r4, =0x020375bc + ldrb r0, [r4] + cmp r0, 0 + bne _0809820C + adds r0, r1, 0 + movs r1, 0x1 + bl textbox_fdecode_auto_and_task_add + movs r0, 0x2 + strb r0, [r4] + movs r0, 0x1 + b _0809820E + .pool +_0809820C: + movs r0, 0 +_0809820E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end box_related_two__2 + + thumb_func_start sub_8098214 +sub_8098214: @ 8098214 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8196094 + adds r1, r0, 0 + cmp r1, 0 + bne _0809822E + ldr r0, =0x020375bc + strb r1, [r0] + adds r0, r4, 0 + bl DestroyTask +_0809822E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8098214 + + thumb_func_start sub_8098238 +sub_8098238: @ 8098238 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x020375bc + ldrb r0, [r5] + cmp r0, 0 + bne _08098270 + ldr r0, =0x02021fc4 + adds r1, r4, 0 + bl ExpandStringRefs + ldr r0, =sub_8098214 + movs r1, 0 + bl CreateTask + adds r0, r4, 0 + bl sub_8196080 + movs r0, 0x2 + strb r0, [r5] + movs r0, 0x1 + b _08098272 + .pool +_08098270: + movs r0, 0 +_08098272: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8098238 + + thumb_func_start box_related_two__3 +box_related_two__3: @ 8098278 + push {lr} + adds r1, r0, 0 + ldr r2, =0x020375bc + ldrb r0, [r2] + cmp r0, 0 + bne _08098298 + movs r0, 0x3 + strb r0, [r2] + adds r0, r1, 0 + movs r1, 0 + bl textbox_fdecode_auto_and_task_add + movs r0, 0x1 + b _0809829A + .pool +_08098298: + movs r0, 0 +_0809829A: + pop {r1} + bx r1 + thumb_func_end box_related_two__3 + + thumb_func_start sub_80982A0 +sub_80982A0: @ 80982A0 + push {lr} + ldr r2, =0x020375bc + movs r1, 0x3 + strb r1, [r2] + movs r1, 0x1 + bl textbox_fdecode_auto_and_task_add + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80982A0 + + thumb_func_start sub_80982B8 +sub_80982B8: @ 80982B8 + push {lr} + ldr r1, =0x020375bc + ldrb r0, [r1] + cmp r0, 0 + bne _080982D4 + movs r0, 0x2 + strb r0, [r1] + bl textbox_auto_and_task_add + movs r0, 0x1 + b _080982D6 + .pool +_080982D4: + movs r0, 0 +_080982D6: + pop {r1} + bx r1 + thumb_func_end sub_80982B8 + + thumb_func_start textbox_fdecode_auto_and_task_add +textbox_fdecode_auto_and_task_add: @ 80982DC + push {r4,lr} + adds r2, r0, 0 + adds r4, r1, 0 + ldr r0, =0x02021fc4 + adds r1, r2, 0 + bl ExpandStringRefs + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl AddTextPrinterForMessage + bl task_add_textbox + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end textbox_fdecode_auto_and_task_add + + thumb_func_start textbox_auto_and_task_add +textbox_auto_and_task_add: @ 8098304 + push {lr} + movs r0, 0x1 + bl AddTextPrinterForMessage + bl task_add_textbox + pop {r0} + bx r0 + thumb_func_end textbox_auto_and_task_add + + thumb_func_start textbox_close +textbox_close: @ 8098314 + push {lr} + bl task_del_textbox + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + ldr r1, =0x020375bc + movs r0, 0 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end textbox_close + + thumb_func_start textbox_any_visible +textbox_any_visible: @ 8098330 + ldr r0, =0x020375bc + ldrb r0, [r0] + bx lr + .pool + thumb_func_end textbox_any_visible + + thumb_func_start sub_809833C +sub_809833C: @ 809833C + push {lr} + ldr r0, =0x020375bc + ldrb r0, [r0] + cmp r0, 0 + beq _08098350 + movs r0, 0 + b _08098352 + .pool +_08098350: + movs r0, 0x1 +_08098352: + pop {r1} + bx r1 + thumb_func_end sub_809833C + + thumb_func_start sub_8098358 +sub_8098358: @ 8098358 + push {lr} + bl task_del_textbox + movs r0, 0 + movs r1, 0x1 + bl sub_81973FC + ldr r1, =0x020375bc + movs r0, 0 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8098358 + + thumb_func_start sub_8098374 +sub_8098374: @ 8098374 + push {lr} + bl task_del_textbox + ldr r1, =0x020375bc + movs r0, 0 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8098374 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/field_player_avatar.s b/asm/field_player_avatar.s new file mode 100644 index 000000000..38c27072b --- /dev/null +++ b/asm/field_player_avatar.s @@ -0,0 +1,5452 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start FieldObjectCB_NoMovement2 +@ void FieldObjectCB_NoMovement2(struct obj *object) +FieldObjectCB_NoMovement2: @ 808A998 + push {lr} + adds r1, r0, 0 + movs r0, 0x2E + ldrsh r2, [r1, r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldr r2, =FieldObjectCB2_NoMovement2 + bl FieldObjectStep + pop {r0} + bx r0 + .pool + thumb_func_end FieldObjectCB_NoMovement2 + + thumb_func_start FieldObjectCB2_NoMovement2 +FieldObjectCB2_NoMovement2: @ 808A9BC + movs r0, 0 + bx lr + thumb_func_end FieldObjectCB2_NoMovement2 + + thumb_func_start player_step +@ void player_step(int dpad_direction, int buttons_new, int buttons_held) +player_step: @ 808A9C0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 16 + lsrs r6, r2, 16 + ldr r4, =0x02037590 + ldrb r1, [r4, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r5, r0, r1 + adds r0, r5, 0 + bl sub_808C280 + ldrb r0, [r4, 0x6] + cmp r0, 0 + bne _0808AA26 + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_8119C3C + adds r0, r5, 0 + mov r1, r8 + bl TryInterruptFieldObjectSpecialAnim + lsls r0, 24 + cmp r0, 0 + bne _0808AA26 + adds r0, r5, 0 + bl npc_clear_strange_bits + bl DoPlayerAvatarTransition + bl TryDoMetatileBehaviorForcedMovment + lsls r0, 24 + cmp r0, 0 + bne _0808AA26 + mov r0, r8 + adds r1, r7, 0 + adds r2, r6, 0 + bl MovePlayerAvatarUsingKeypadInput + bl PlayerAllowForcedMovementIfMovingSameDirection +_0808AA26: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end player_step + + thumb_func_start TryInterruptFieldObjectSpecialAnim +@ bool8 TryInterruptFieldObjectSpecialAnim(struct npc_state *fieldObject, u8 direction) +TryInterruptFieldObjectSpecialAnim: @ 808AA38 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + adds r6, r5, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _0808AA92 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + bne _0808AA92 + adds r0, r4, 0 + bl FieldObjectGetSpecialAnim + lsls r0, 24 + movs r1, 0xE7 + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x3 + bhi _0808AA70 + cmp r5, 0 + bne _0808AA74 +_0808AA70: + movs r0, 0x1 + b _0808AA94 +_0808AA74: + ldrb r0, [r4, 0x18] + lsrs r0, 4 + cmp r0, r5 + beq _0808AA84 +_0808AA7C: + adds r0, r4, 0 + bl FieldObjectClearAnim + b _0808AA92 +_0808AA84: + adds r0, r6, 0 + bl sub_808B028 + lsls r0, 24 + cmp r0, 0 + beq _0808AA7C + b _0808AA70 +_0808AA92: + movs r0, 0 +_0808AA94: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end TryInterruptFieldObjectSpecialAnim + + thumb_func_start npc_clear_strange_bits +@ void npc_clear_strange_bits(struct npc_state *fieldObject) +npc_clear_strange_bits: @ 808AA9C + ldrb r2, [r0, 0x1] + movs r1, 0x11 + negs r1, r1 + ands r1, r2 + movs r2, 0x5 + negs r2, r2 + ands r1, r2 + adds r2, 0x2 + ands r1, r2 + strb r1, [r0, 0x1] + ldr r2, =0x02037590 + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + bx lr + .pool + thumb_func_end npc_clear_strange_bits + + thumb_func_start MovePlayerAvatarUsingKeypadInput +@ void MovePlayerAvatarUsingKeypadInput(int dpad_direction, int buttons_new, int buttons_held) +MovePlayerAvatarUsingKeypadInput: @ 808AAC0 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 16 + lsrs r2, 16 + ldr r0, =0x02037590 + ldrb r1, [r0] + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + beq _0808AAE8 + adds r0, r3, 0 + adds r1, r4, 0 + bl MovePlayerOnBike + b _0808AAF0 + .pool +_0808AAE8: + adds r0, r3, 0 + adds r1, r2, 0 + bl MovePlayerNotOnBike +_0808AAF0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end MovePlayerAvatarUsingKeypadInput + + thumb_func_start PlayerAllowForcedMovementIfMovingSameDirection +@ void PlayerAllowForcedMovementIfMovingSameDirection() +PlayerAllowForcedMovementIfMovingSameDirection: @ 808AAF8 + push {lr} + ldr r2, =0x02037590 + ldrb r0, [r2, 0x2] + cmp r0, 0x2 + bne _0808AB0A + ldrb r1, [r2] + movs r0, 0xDF + ands r0, r1 + strb r0, [r2] +_0808AB0A: + pop {r0} + bx r0 + .pool + thumb_func_end PlayerAllowForcedMovementIfMovingSameDirection + + thumb_func_start TryDoMetatileBehaviorForcedMovment +@ bool8 TryDoMetatileBehaviorForcedMovment() +TryDoMetatileBehaviorForcedMovment: @ 808AB14 + push {r4,lr} + ldr r4, =gUnknown_08497444 + bl GetForcedMovementByMetatileBehavior + lsls r0, 24 + lsrs r0, 22 + adds r0, r4 + ldr r0, [r0] + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end TryDoMetatileBehaviorForcedMovment + + thumb_func_start GetForcedMovementByMetatileBehavior +@ u8 GetForcedMovementByMetatileBehavior() +GetForcedMovementByMetatileBehavior: @ 808AB38 + push {r4-r6,lr} + ldr r3, =0x02037590 + ldrb r1, [r3] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0808AB8A + ldr r2, =0x02037350 + ldrb r1, [r3, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r5, [r0, 0x1E] + movs r4, 0 + ldr r6, =gUnknown_084973FC +_0808AB58: + lsls r0, r4, 2 + adds r0, r6 + ldr r1, [r0] + adds r0, r5, 0 + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + beq _0808AB80 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r0, 24 + b _0808AB8C + .pool +_0808AB80: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x11 + bls _0808AB58 +_0808AB8A: + movs r0, 0 +_0808AB8C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end GetForcedMovementByMetatileBehavior + + thumb_func_start ForcedMovement_None +ForcedMovement_None: @ 808AB94 + push {r4,lr} + ldr r4, =0x02037590 + ldrb r1, [r4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0808ABCE + ldrb r1, [r4, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldrb r2, [r0, 0x1] + movs r1, 0x3 + negs r1, r1 + ands r1, r2 + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0, 0x1] + ldrb r1, [r0, 0x18] + lsls r1, 28 + lsrs r1, 28 + bl FieldObjectSetDirection + ldrb r1, [r4] + movs r0, 0xBF + ands r0, r1 + strb r0, [r4] +_0808ABCE: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_None + + thumb_func_start DoForcedMovement +DoForcedMovement: @ 808ABE0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, =0x02037590 + adds r0, r5, 0 + bl CheckForPlayerAvatarCollision + lsls r0, 24 + lsrs r4, r0, 24 + adds r7, r4, 0 + ldrb r0, [r6] + movs r1, 0x40 + mov r10, r1 + movs r1, 0 + mov r8, r1 + mov r1, r10 + orrs r0, r1 + strb r0, [r6] + cmp r4, 0 + beq _0808AC3C + bl ForcedMovement_None + cmp r4, 0x4 + bhi _0808AC24 + movs r0, 0 + b _0808AC48 + .pool +_0808AC24: + cmp r7, 0x6 + bne _0808AC2E + adds r0, r5, 0 + bl PlayerJumpLedge +_0808AC2E: + ldrb r0, [r6] + mov r1, r10 + orrs r0, r1 + strb r0, [r6] + movs r0, 0x2 + strb r0, [r6, 0x2] + b _0808AC46 +_0808AC3C: + movs r0, 0x2 + strb r0, [r6, 0x2] + adds r0, r5, 0 + bl _call_via_r9 +_0808AC46: + movs r0, 0x1 +_0808AC48: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end DoForcedMovement + + thumb_func_start DoForcedMovementInCurrentDirection +DoForcedMovementInCurrentDirection: @ 808AC58 + push {lr} + adds r1, r0, 0 + ldr r0, =0x02037590 + ldrb r2, [r0, 0x5] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + ldrb r2, [r0, 0x1] + movs r3, 0x4 + orrs r2, r3 + strb r2, [r0, 0x1] + ldrb r0, [r0, 0x18] + lsrs r0, 4 + bl DoForcedMovement + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end DoForcedMovementInCurrentDirection + + thumb_func_start ForcedMovement_Slip +ForcedMovement_Slip: @ 808AC8C + push {lr} + ldr r0, =PlayerGoSpeed1 + bl DoForcedMovementInCurrentDirection + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_Slip + + thumb_func_start ForcedMovement_WalkSouth +ForcedMovement_WalkSouth: @ 808ACA0 + push {lr} + ldr r1, =PlayerGoSpeed0 + movs r0, 0x1 + bl DoForcedMovement + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_WalkSouth + + thumb_func_start ForcedMovement_WalkNorth +ForcedMovement_WalkNorth: @ 808ACB8 + push {lr} + ldr r1, =PlayerGoSpeed0 + movs r0, 0x2 + bl DoForcedMovement + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_WalkNorth + + thumb_func_start ForcedMovement_WalkWest +ForcedMovement_WalkWest: @ 808ACD0 + push {lr} + ldr r1, =PlayerGoSpeed0 + movs r0, 0x3 + bl DoForcedMovement + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_WalkWest + + thumb_func_start ForcedMovement_WalkEast +ForcedMovement_WalkEast: @ 808ACE8 + push {lr} + ldr r1, =PlayerGoSpeed0 + movs r0, 0x4 + bl DoForcedMovement + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_WalkEast + + thumb_func_start ForcedMovement_PushedSouthByCurrent +ForcedMovement_PushedSouthByCurrent: @ 808AD00 + push {lr} + ldr r1, =PlayerGoSpeed2 + movs r0, 0x1 + bl DoForcedMovement + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_PushedSouthByCurrent + + thumb_func_start ForcedMovement_PushedNorthByCurrent +ForcedMovement_PushedNorthByCurrent: @ 808AD18 + push {lr} + ldr r1, =PlayerGoSpeed2 + movs r0, 0x2 + bl DoForcedMovement + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_PushedNorthByCurrent + + thumb_func_start ForcedMovement_PushedWestByCurrent +ForcedMovement_PushedWestByCurrent: @ 808AD30 + push {lr} + ldr r1, =PlayerGoSpeed2 + movs r0, 0x3 + bl DoForcedMovement + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_PushedWestByCurrent + + thumb_func_start ForcedMovement_PushedEastByCurrent +ForcedMovement_PushedEastByCurrent: @ 808AD48 + push {lr} + ldr r1, =PlayerGoSpeed2 + movs r0, 0x4 + bl DoForcedMovement + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_PushedEastByCurrent + + thumb_func_start ForcedMovement_Slide +ForcedMovement_Slide: @ 808AD60 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02037590 + ldrb r3, [r2, 0x5] + lsls r2, r3, 3 + adds r2, r3 + lsls r2, 2 + ldr r3, =0x02037350 + adds r2, r3 + ldrb r3, [r2, 0x1] + movs r4, 0x4 + orrs r3, r4 + movs r4, 0x2 + orrs r3, r4 + strb r3, [r2, 0x1] + bl DoForcedMovement + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_Slide + + thumb_func_start ForcedMovement_SlideSouth +ForcedMovement_SlideSouth: @ 808AD98 + push {lr} + ldr r1, =PlayerGoSpeed1 + movs r0, 0x1 + bl ForcedMovement_Slide + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_SlideSouth + + thumb_func_start ForcedMovement_SlideNorth +ForcedMovement_SlideNorth: @ 808ADB0 + push {lr} + ldr r1, =PlayerGoSpeed1 + movs r0, 0x2 + bl ForcedMovement_Slide + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_SlideNorth + + thumb_func_start ForcedMovement_SlideWest +ForcedMovement_SlideWest: @ 808ADC8 + push {lr} + ldr r1, =PlayerGoSpeed1 + movs r0, 0x3 + bl ForcedMovement_Slide + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_SlideWest + + thumb_func_start ForcedMovement_SlideEast +ForcedMovement_SlideEast: @ 808ADE0 + push {lr} + ldr r1, =PlayerGoSpeed1 + movs r0, 0x4 + bl ForcedMovement_Slide + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end ForcedMovement_SlideEast + + thumb_func_start ForcedMovement_0xBB +ForcedMovement_0xBB: @ 808ADF8 + push {lr} + bl sub_808C4D8 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end ForcedMovement_0xBB + + thumb_func_start ForcedMovement_0xBC +ForcedMovement_0xBC: @ 808AE04 + push {lr} + bl sub_808C5B0 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end ForcedMovement_0xBC + + thumb_func_start ForcedMovement_MuddySlope +ForcedMovement_MuddySlope: @ 808AE10 + push {r4,lr} + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + ldrb r1, [r4, 0x18] + movs r0, 0xF0 + ands r0, r1 + cmp r0, 0x20 + bne _0808AE36 + bl sub_811A138 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bgt _0808AE60 +_0808AE36: + movs r0, 0 + bl sub_811A114 + ldrb r0, [r4, 0x1] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4, 0x1] + ldr r1, =PlayerGoSpeed1 + movs r0, 0x1 + bl DoForcedMovement + lsls r0, 24 + lsrs r0, 24 + b _0808AE62 + .pool +_0808AE60: + movs r0, 0 +_0808AE62: + pop {r4} + pop {r1} + bx r1 + thumb_func_end ForcedMovement_MuddySlope + + thumb_func_start MovePlayerNotOnBike +@ void MovePlayerNotOnBike(u8 direction, u8 heldKeys) +MovePlayerNotOnBike: @ 808AE68 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 16 + lsrs r5, 16 + ldr r6, =gUnknown_08497490 + adds r0, r4, 0 + bl CheckMovementInputNotOnBike + lsls r0, 24 + lsrs r0, 22 + adds r0, r6 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl _call_via_r2 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end MovePlayerNotOnBike + + thumb_func_start CheckMovementInputNotOnBike +@ u8 CheckMovementInputNotOnBike(u8 direction) +CheckMovementInputNotOnBike: @ 808AE98 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0808AEB0 + ldr r0, =0x02037590 + strb r4, [r0, 0x2] + movs r0, 0 + b _0808AED2 + .pool +_0808AEB0: + bl player_get_direction_upper_nybble + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + beq _0808AECC + ldr r1, =0x02037590 + ldrb r0, [r1, 0x2] + cmp r0, 0x2 + beq _0808AECC + movs r0, 0x1 + b _0808AED0 + .pool +_0808AECC: + ldr r1, =0x02037590 + movs r0, 0x2 +_0808AED0: + strb r0, [r1, 0x2] +_0808AED2: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end CheckMovementInputNotOnBike + + thumb_func_start PlayerNotOnBikeNotMoving +@ void PlayerNotOnBikeNotMoving(u8 direction, u8 heldKeys) +PlayerNotOnBikeNotMoving: @ 808AEDC + push {lr} + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + bl PlayerFaceDirection + pop {r0} + bx r0 + thumb_func_end PlayerNotOnBikeNotMoving + + thumb_func_start PlayerNotOnBikeTurningInPlace +@ void PlayerNotOnBikeTurningInPlace(u8 direction, u8 heldKeys) +PlayerNotOnBikeTurningInPlace: @ 808AEF0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl PlayerTurnInPlace + pop {r0} + bx r0 + thumb_func_end PlayerNotOnBikeTurningInPlace + + thumb_func_start PlayerNotOnBikeMoving +@ void PlayerNotOnBikeMoving(u8 direction, u8 heldKeys) +PlayerNotOnBikeMoving: @ 808AF00 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 16 + lsrs r6, r1, 16 + adds r0, r5, 0 + bl CheckForPlayerAvatarCollision + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0808AF4E + cmp r4, 0x6 + bne _0808AF24 + adds r0, r5, 0 + bl PlayerJumpLedge + b _0808AFB6 +_0808AF24: + cmp r4, 0x4 + bne _0808AF3C + adds r0, r5, 0 + bl IsPlayerCollidingWithFarawayIslandMew + lsls r0, 24 + cmp r0, 0 + beq _0808AF3C + adds r0, r5, 0 + bl PlayerNotOnBikeCollideWithFarawayIslandMew + b _0808AFB6 +_0808AF3C: + subs r0, r4, 0x5 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _0808AFB6 + adds r0, r5, 0 + bl PlayerNotOnBikeCollide + b _0808AFB6 +_0808AF4E: + ldr r4, =0x02037590 + ldrb r1, [r4] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0808AF68 + adds r0, r5, 0 + bl PlayerGoSpeed1 + b _0808AFB6 + .pool +_0808AF68: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0808AFB0 + movs r0, 0x2 + ands r6, r0 + cmp r6, 0 + beq _0808AFB0 + movs r0, 0x8C + lsls r0, 4 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0808AFB0 + ldr r2, =0x02037350 + ldrb r1, [r4, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1E] + bl IsRunningDisallowed + cmp r0, 0 + bne _0808AFB0 + adds r0, r5, 0 + bl PlayerRun + ldrb r1, [r4] + movs r0, 0x80 + orrs r0, r1 + strb r0, [r4] + b _0808AFB6 + .pool +_0808AFB0: + adds r0, r5, 0 + bl PlayerGoSpeed0 +_0808AFB6: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end PlayerNotOnBikeMoving + + thumb_func_start CheckForPlayerAvatarCollision +CheckForPlayerAvatarCollision: @ 808AFBC + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + ldrh r1, [r4, 0x10] + add r0, sp, 0x4 + strh r1, [r0] + ldrh r0, [r4, 0x12] + mov r5, sp + adds r5, 0x6 + strh r0, [r5] + adds r0, r6, 0 + add r1, sp, 0x4 + adds r2, r5, 0 + bl MoveCoords + add r0, sp, 0x4 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + add r1, sp, 0x4 + movs r3, 0 + ldrsh r1, [r1, r3] + movs r3, 0 + ldrsh r2, [r5, r3] + str r0, [sp] + adds r0, r4, 0 + adds r3, r6, 0 + bl CheckForFieldObjectCollision + lsls r0, 24 + lsrs r0, 24 + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end CheckForPlayerAvatarCollision + + thumb_func_start sub_808B028 +sub_808B028: @ 808B028 + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + ldrh r1, [r4, 0x10] + add r0, sp, 0x4 + strh r1, [r0] + ldrh r0, [r4, 0x12] + mov r5, sp + adds r5, 0x6 + strh r0, [r5] + adds r0, r6, 0 + add r1, sp, 0x4 + adds r2, r5, 0 + bl MoveCoords + add r0, sp, 0x4 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + add r1, sp, 0x4 + movs r3, 0 + ldrsh r1, [r1, r3] + movs r3, 0 + ldrsh r2, [r5, r3] + str r0, [sp] + adds r0, r4, 0 + adds r3, r6, 0 + bl sub_808B164 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808B028 + + thumb_func_start CheckForFieldObjectCollision +@ u8 CheckForFieldObjectCollision(struct npc_state *fieldObject, u16 x, u16 y, u8 direction, u8 metatileBehavior) +CheckForFieldObjectCollision: @ 808B094 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r4, [sp, 0x24] + lsls r1, 16 + lsls r2, 16 + lsls r3, 24 + lsrs r6, r3, 24 + lsls r4, 24 + lsrs r4, 24 + mov r10, r4 + lsrs r7, r1, 16 + asrs r5, r1, 16 + lsrs r1, r2, 16 + mov r9, r1 + asrs r4, r2, 16 + adds r1, r5, 0 + adds r2, r4, 0 + adds r3, r6, 0 + bl npc_block_way + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + strb r0, [r1] + cmp r0, 0x3 + bne _0808B0E4 + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_808B1BC + lsls r0, 24 + cmp r0, 0 + beq _0808B0E4 + movs r0, 0x5 + b _0808B152 +_0808B0E4: + lsls r5, r7, 16 + asrs r0, r5, 16 + mov r8, r0 + mov r1, r9 + lsls r4, r1, 16 + asrs r7, r4, 16 + adds r1, r7, 0 + adds r2, r6, 0 + bl ShouldJumpLedge + lsls r0, 24 + cmp r0, 0 + beq _0808B108 + movs r0, 0x2B + bl sav12_xor_increment + movs r0, 0x6 + b _0808B152 +_0808B108: + mov r0, sp + ldrb r0, [r0] + cmp r0, 0x4 + bne _0808B124 + mov r0, r8 + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_808B238 + lsls r0, 24 + cmp r0, 0 + beq _0808B124 + movs r0, 0x7 + b _0808B152 +_0808B124: + mov r0, sp + ldrb r0, [r0] + cmp r0, 0 + bne _0808B14E + asrs r5, 16 + asrs r4, 16 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl CheckForRotatingGatePuzzleCollision + cmp r0, 0 + beq _0808B142 + movs r0, 0x8 + b _0808B152 +_0808B142: + adds r0, r5, 0 + adds r1, r4, 0 + mov r2, r10 + mov r3, sp + bl check_acro_bike_metatile +_0808B14E: + mov r0, sp + ldrb r0, [r0] +_0808B152: + 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 CheckForFieldObjectCollision + + thumb_func_start sub_808B164 +sub_808B164: @ 808B164 + push {r4-r7,lr} + sub sp, 0x4 + ldr r4, [sp, 0x18] + lsls r3, 24 + lsrs r6, r3, 24 + lsls r4, 24 + lsrs r7, r4, 24 + lsls r1, 16 + asrs r5, r1, 16 + lsls r2, 16 + asrs r4, r2, 16 + adds r1, r5, 0 + adds r2, r4, 0 + adds r3, r6, 0 + bl npc_block_way + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + strb r0, [r1] + cmp r0, 0 + bne _0808B1AE + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_80FBFD4 + cmp r0, 0 + beq _0808B1A2 + movs r0, 0x8 + b _0808B1B2 +_0808B1A2: + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r7, 0 + mov r3, sp + bl check_acro_bike_metatile +_0808B1AE: + mov r0, sp + ldrb r0, [r0] +_0808B1B2: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808B164 + + thumb_func_start sub_808B1BC +@ bool8 sub_808B1BC(u16 x, u16 y, u8 direction) +sub_808B1BC: @ 808B1BC + push {r4-r6,lr} + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r0, =0x02037590 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0808B20C + lsls r5, r3, 16 + asrs r0, r5, 16 + lsls r4, 16 + asrs r1, r4, 16 + bl MapGridGetZCoordAt + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0808B20C + lsrs r0, r5, 16 + lsrs r1, r4, 16 + movs r2, 0x3 + bl GetFieldObjectIdByXYZ + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + bne _0808B20C + adds r0, r6, 0 + bl sub_808C750 + movs r0, 0x1 + b _0808B20E + .pool +_0808B20C: + movs r0, 0 +_0808B20E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808B1BC + + thumb_func_start ShouldJumpLedge +@ bool8 ShouldJumpLedge(s16 x, s16 y, u8 direction) +ShouldJumpLedge: @ 808B214 + push {lr} + lsls r2, 24 + lsrs r2, 24 + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl GetLedgeJumpDirection + lsls r0, 24 + cmp r0, 0 + bne _0808B230 + movs r0, 0 + b _0808B232 +_0808B230: + movs r0, 0x1 +_0808B232: + pop {r1} + bx r1 + thumb_func_end ShouldJumpLedge + + thumb_func_start sub_808B238 +sub_808B238: @ 808B238 + push {r4-r7,lr} + sub sp, 0x4 + mov r3, sp + strh r0, [r3] + mov r5, sp + adds r5, 0x2 + strh r1, [r5] + lsls r2, 24 + lsrs r7, r2, 24 + ldr r0, =0x00000889 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0808B2D8 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + bl GetFieldObjectIdByXY + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x10 + beq _0808B2D8 + ldr r0, =0x02037350 + lsls r1, r6, 3 + adds r1, r6 + lsls r1, 2 + adds r4, r1, r0 + ldrb r0, [r4, 0x5] + cmp r0, 0x57 + bne _0808B2D8 + ldrh r1, [r4, 0x10] + mov r0, sp + strh r1, [r0] + ldrh r0, [r4, 0x12] + strh r0, [r5] + adds r0, r7, 0 + mov r1, sp + adds r2, r5, 0 + bl MoveCoords + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r5, r0] + adds r0, r4, 0 + adds r3, r7, 0 + bl npc_block_way + lsls r0, 24 + cmp r0, 0 + bne _0808B2D8 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl sub_8088F58 + lsls r0, 24 + cmp r0, 0 + bne _0808B2D8 + adds r0, r6, 0 + adds r1, r7, 0 + bl task_add_bump_boulder + movs r0, 0x1 + b _0808B2DA + .pool +_0808B2D8: + movs r0, 0 +_0808B2DA: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808B238 + + thumb_func_start check_acro_bike_metatile +@ void check_acro_bike_metatile(s16 x, s16 y, u8 metatileBehavior, u8 *returnValue) +check_acro_bike_metatile: @ 808B2E4 + push {r4-r7,lr} + adds r6, r3, 0 + lsls r2, 24 + lsrs r5, r2, 24 + movs r4, 0 + ldr r7, =gUnknown_0849749C +_0808B2F0: + lsls r0, r4, 2 + adds r0, r7 + ldr r1, [r0] + adds r0, r5, 0 + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + beq _0808B314 + ldr r0, =gUnknown_084974B0 + adds r0, r4, r0 + ldrb r0, [r0] + strb r0, [r6] + b _0808B31E + .pool +_0808B314: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _0808B2F0 +_0808B31E: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end check_acro_bike_metatile + + thumb_func_start IsPlayerCollidingWithFarawayIslandMew +@ bool8 IsPlayerCollidingWithFarawayIslandMew(u8 direction) +IsPlayerCollidingWithFarawayIslandMew: @ 808B324 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02037590 + ldrb r2, [r1, 0x5] + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + ldr r5, =0x02037350 + adds r3, r1, r5 + ldrh r2, [r3, 0x10] + mov r1, sp + strh r2, [r1] + ldrh r1, [r3, 0x12] + mov r4, sp + adds r4, 0x2 + strh r1, [r4] + mov r1, sp + adds r2, r4, 0 + bl MoveCoords + movs r0, 0x1 + movs r1, 0x39 + movs r2, 0x1A + bl GetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + lsrs r1, r0, 24 + adds r6, r4, 0 + cmp r1, 0x10 + beq _0808B3C0 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r3, r0, r5 + mov r0, sp + movs r1, 0x14 + ldrsh r2, [r3, r1] + movs r4, 0 + ldrsh r0, [r0, r4] + cmp r2, r0 + bne _0808B3C0 + movs r5, 0x16 + ldrsh r1, [r3, r5] + movs r4, 0 + ldrsh r0, [r6, r4] + ldrh r4, [r3, 0x16] + cmp r1, r0 + bne _0808B398 + movs r5, 0x10 + ldrsh r0, [r3, r5] + cmp r0, r2 + bne _0808B398 + movs r2, 0x12 + ldrsh r0, [r3, r2] + cmp r0, r1 + beq _0808B3C0 +_0808B398: + mov r0, sp + movs r5, 0x14 + ldrsh r1, [r3, r5] + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r1, r0 + bne _0808B3C0 + lsls r0, r4, 16 + asrs r0, 16 + movs r4, 0 + ldrsh r1, [r6, r4] + cmp r0, r1 + bne _0808B3C0 + movs r0, 0x1 + b _0808B3C2 + .pool +_0808B3C0: + movs r0, 0 +_0808B3C2: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end IsPlayerCollidingWithFarawayIslandMew + + thumb_func_start SetPlayerAvatarTransitionFlags +@ void SetPlayerAvatarTransitionFlags(u16 transitionFlags) +SetPlayerAvatarTransitionFlags: @ 808B3CC + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r2, =0x02037590 + ldrb r1, [r2, 0x1] + orrs r0, r1 + strb r0, [r2, 0x1] + bl DoPlayerAvatarTransition + pop {r0} + bx r0 + .pool + thumb_func_end SetPlayerAvatarTransitionFlags + + thumb_func_start DoPlayerAvatarTransition +@ void DoPlayerAvatarTransition() +DoPlayerAvatarTransition: @ 808B3E8 + push {r4,r5,lr} + ldr r0, =0x02037590 + ldrb r4, [r0, 0x1] + cmp r4, 0 + beq _0808B428 + movs r5, 0 +_0808B3F4: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0808B416 + ldr r0, =gUnknown_084974B8 + lsls r2, r5, 2 + adds r2, r0 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldr r1, [r2] + bl _call_via_r1 +_0808B416: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + lsrs r4, 1 + cmp r5, 0x7 + bls _0808B3F4 + ldr r1, =0x02037590 + movs r0, 0 + strb r0, [r1, 0x1] +_0808B428: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DoPlayerAvatarTransition + + thumb_func_start PlayerAvatarTransition_Dummy +@ void PlayerAvatarTransition_Dummy(struct npc_state *fieldObject) +PlayerAvatarTransition_Dummy: @ 808B43C + bx lr + thumb_func_end PlayerAvatarTransition_Dummy + + thumb_func_start PlayerAvatarTransition_Normal +@ void PlayerAvatarTransition_Normal(struct npc_state *fieldObject) +PlayerAvatarTransition_Normal: @ 808B440 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl FieldObjectTurn + movs r0, 0x1 + bl SetPlayerAvatarStateMask + pop {r4} + pop {r0} + bx r0 + thumb_func_end PlayerAvatarTransition_Normal + + thumb_func_start PlayerAvatarTransition_MachBike +@ void PlayerAvatarTransition_MachBike(struct npc_state *fieldObject) +PlayerAvatarTransition_MachBike: @ 808B46C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl FieldObjectTurn + movs r0, 0x2 + bl SetPlayerAvatarStateMask + movs r0, 0 + movs r1, 0 + bl sub_811A0D0 + pop {r4} + pop {r0} + bx r0 + thumb_func_end PlayerAvatarTransition_MachBike + + thumb_func_start PlayerAvatarTransition_AcroBike +@ void PlayerAvatarTransition_AcroBike(struct npc_state *fieldObject) +PlayerAvatarTransition_AcroBike: @ 808B4A0 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x2 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl FieldObjectTurn + movs r0, 0x4 + bl SetPlayerAvatarStateMask + movs r0, 0 + movs r1, 0 + bl sub_811A0D0 + bl sub_811A188 + pop {r4} + pop {r0} + bx r0 + thumb_func_end PlayerAvatarTransition_AcroBike + + thumb_func_start PlayerAvatarTransition_Surfing +@ void PlayerAvatarTransition_Surfing(struct npc_state *fieldObject) +PlayerAvatarTransition_Surfing: @ 808B4D8 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x3 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl FieldObjectTurn + movs r0, 0x8 + bl SetPlayerAvatarStateMask + ldr r1, =0x02038c08 + movs r2, 0x10 + ldrsh r0, [r4, r2] + str r0, [r1] + movs r2, 0x12 + ldrsh r0, [r4, r2] + str r0, [r1, 0x4] + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + str r0, [r1, 0x8] + movs r0, 0x8 + bl FieldEffectStart + lsls r0, 24 + lsrs r0, 24 + strb r0, [r4, 0x1A] + movs r1, 0x1 + bl sub_81555AC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end PlayerAvatarTransition_Surfing + + thumb_func_start PlayerAvatarTransition_Underwater +@ void PlayerAvatarTransition_Underwater(struct npc_state *fieldObject) +PlayerAvatarTransition_Underwater: @ 808B534 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x4 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl FieldObjectTurn + movs r0, 0x10 + bl SetPlayerAvatarStateMask + ldrb r0, [r4, 0x4] + bl sub_8155800 + strb r0, [r4, 0x1A] + pop {r4} + pop {r0} + bx r0 + thumb_func_end PlayerAvatarTransition_Underwater + + thumb_func_start PlayerAvatarTransition_ReturnToField +@ void PlayerAvatarTransition_ReturnToField(struct npc_state *fieldObject) +PlayerAvatarTransition_ReturnToField: @ 808B568 + ldr r2, =0x02037590 + ldrb r1, [r2] + movs r0, 0x20 + orrs r0, r1 + strb r0, [r2] + bx lr + .pool + thumb_func_end PlayerAvatarTransition_ReturnToField + + thumb_func_start sub_808B578 +sub_808B578: @ 808B578 + push {r4,lr} + ldr r4, =0x02037590 + movs r0, 0 + strb r0, [r4, 0x3] + bl PlayerIsAnimActive + lsls r0, 24 + cmp r0, 0 + beq _0808B5B6 + bl PlayerCheckIfAnimFinishedOrInactive + lsls r0, 24 + cmp r0, 0 + bne _0808B5A8 + bl player_is_anim_in_certain_ranges + lsls r0, 24 + cmp r0, 0 + bne _0808B5B6 + movs r0, 0x1 + b _0808B5B4 + .pool +_0808B5A8: + bl sub_808B618 + lsls r0, 24 + cmp r0, 0 + bne _0808B5B6 + movs r0, 0x2 +_0808B5B4: + strb r0, [r4, 0x3] +_0808B5B6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808B578 + + thumb_func_start player_is_anim_in_certain_ranges +player_is_anim_in_certain_ranges: @ 808B5BC + push {lr} + ldr r2, =0x02037350 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1C] + cmp r1, 0x3 + bls _0808B602 + adds r0, r1, 0 + subs r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bls _0808B602 + adds r0, r1, 0 + subs r0, 0x19 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xF + bls _0808B602 + adds r0, r1, 0 + subs r0, 0x64 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB + bls _0808B602 + adds r0, r1, 0 + subs r0, 0x7C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bhi _0808B610 +_0808B602: + movs r0, 0x1 + b _0808B612 + .pool +_0808B610: + movs r0, 0 +_0808B612: + pop {r1} + bx r1 + thumb_func_end player_is_anim_in_certain_ranges + + thumb_func_start sub_808B618 +sub_808B618: @ 808B618 + push {lr} + bl player_is_anim_in_certain_ranges + lsls r0, 24 + cmp r0, 0 + beq _0808B634 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x2] + cmp r0, 0x1 + beq _0808B634 + movs r0, 0x1 + b _0808B636 + .pool +_0808B634: + movs r0, 0 +_0808B636: + pop {r1} + bx r1 + thumb_func_end sub_808B618 + + thumb_func_start PlayerIsAnimActive +@ bool8 PlayerIsAnimActive() +PlayerIsAnimActive: @ 808B63C + push {lr} + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end PlayerIsAnimActive + + thumb_func_start PlayerCheckIfAnimFinishedOrInactive +@ bool8 PlayerCheckIfAnimFinishedOrInactive() +PlayerCheckIfAnimFinishedOrInactive: @ 808B660 + push {lr} + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end PlayerCheckIfAnimFinishedOrInactive + + thumb_func_start player_set_x22 +player_set_x22: @ 808B684 + ldr r3, =0x02037350 + ldr r1, =0x02037590 + ldrb r2, [r1, 0x5] + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r1, r3 + adds r1, 0x22 + strb r0, [r1] + bx lr + .pool + thumb_func_end player_set_x22 + + thumb_func_start player_get_x22 +player_get_x22: @ 808B6A0 + ldr r2, =0x02037350 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x22 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end player_get_x22 + + thumb_func_start sub_808B6BC +sub_808B6BC: @ 808B6BC + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =0x02037590 + ldrb r2, [r0, 0x5] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02037350 + adds r0, r2 + bl FieldObjectForceSetSpecialAnim + pop {r0} + bx r0 + .pool + thumb_func_end sub_808B6BC + + thumb_func_start player_npc_set_state_and_x22_etc +@ void player_npc_set_state_and_x22_etc(u8 animState, u8 a2) +player_npc_set_state_and_x22_etc: @ 808B6E4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + bl PlayerIsAnimActive + lsls r0, 24 + cmp r0, 0 + bne _0808B712 + adds r0, r4, 0 + bl player_set_x22 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + adds r1, r5, 0 + bl FieldObjectSetSpecialAnim +_0808B712: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end player_npc_set_state_and_x22_etc + + thumb_func_start PlayerGoSpeed0 +@ void PlayerGoSpeed0(u8 direction) +PlayerGoSpeed0: @ 808B720 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl GetGoSpeed0AnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end PlayerGoSpeed0 + + thumb_func_start PlayerGoSpeed1 +@ void PlayerGoSpeed1(u8 direction) +PlayerGoSpeed1: @ 808B738 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl GetGoSpeed1AnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end PlayerGoSpeed1 + + thumb_func_start PlayerGoSpeed2 +@ void PlayerGoSpeed2(u8 direction) +PlayerGoSpeed2: @ 808B750 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl GetGoSpeed2AnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end PlayerGoSpeed2 + + thumb_func_start PlayerGoSpeed3 +@ void PlayerGoSpeed3(u8 direction) +PlayerGoSpeed3: @ 808B768 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl GetGoSpeed3AnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end PlayerGoSpeed3 + + thumb_func_start PlayerRun +@ void PlayerRun(u8 direction) +PlayerRun: @ 808B780 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl GetRunAnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end PlayerRun + + thumb_func_start PlayerOnBikeCollide +@ void PlayerOnBikeCollide(u8 direction) +PlayerOnBikeCollide: @ 808B798 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl PlayCollisionSoundIfNotFacingWarp + adds r0, r4, 0 + bl GetStepInPlaceDelay16AnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r4} + pop {r0} + bx r0 + thumb_func_end PlayerOnBikeCollide + + thumb_func_start PlayerOnBikeCollideWithFarawayIslandMew +@ void PlayerOnBikeCollideWithFarawayIslandMew(u8 direction) +PlayerOnBikeCollideWithFarawayIslandMew: @ 808B7BC + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl GetStepInPlaceDelay16AnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end PlayerOnBikeCollideWithFarawayIslandMew + + thumb_func_start PlayerNotOnBikeCollide +@ void PlayerNotOnBikeCollide(u8 direction) +PlayerNotOnBikeCollide: @ 808B7D4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl PlayCollisionSoundIfNotFacingWarp + adds r0, r4, 0 + bl GetStepInPlaceDelay32AnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r4} + pop {r0} + bx r0 + thumb_func_end PlayerNotOnBikeCollide + + thumb_func_start PlayerNotOnBikeCollideWithFarawayIslandMew +@ void PlayerNotOnBikeCollideWithFarawayIslandMew(u8 direction) +PlayerNotOnBikeCollideWithFarawayIslandMew: @ 808B7F8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl GetStepInPlaceDelay32AnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end PlayerNotOnBikeCollideWithFarawayIslandMew + + thumb_func_start PlayerFaceDirection +@ void PlayerFaceDirection(u8 direction) +PlayerFaceDirection: @ 808B810 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl GetFaceDirectionAnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end PlayerFaceDirection + + thumb_func_start PlayerTurnInPlace +@ void PlayerTurnInPlace(u8 direction) +PlayerTurnInPlace: @ 808B828 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl GetStepInPlaceDelay8AnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end PlayerTurnInPlace + + thumb_func_start PlayerJumpLedge +@ void PlayerJumpLedge(u8 direction) +PlayerJumpLedge: @ 808B840 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0xA + bl audio_play + adds r0, r4, 0 + bl GetJumpLedgeAnimId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x8 + bl player_npc_set_state_and_x22_etc + pop {r4} + pop {r0} + bx r0 + thumb_func_end PlayerJumpLedge + + thumb_func_start sub_808B864 +sub_808B864: @ 808B864 + push {r4,lr} + ldr r4, =0x02037590 + ldrb r0, [r4, 0x3] + cmp r0, 0x2 + beq _0808B872 + cmp r0, 0 + bne _0808B89A +_0808B872: + bl player_should_look_direction_be_enforced_upon_movement + lsls r0, 24 + cmp r0, 0 + beq _0808B89A + ldr r2, =0x02037350 + ldrb r1, [r4, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + lsls r0, 24 + lsrs r0, 24 + bl sub_808B6BC +_0808B89A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808B864 + + thumb_func_start sub_808B8A8 +sub_808B8A8: @ 808B8A8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_8093648 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end sub_808B8A8 + + thumb_func_start sub_808B8C0 +sub_808B8C0: @ 808B8C0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_8093674 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end sub_808B8C0 + + thumb_func_start sub_808B8D8 +sub_808B8D8: @ 808B8D8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_80936A0 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end sub_808B8D8 + + thumb_func_start sub_808B8F0 +sub_808B8F0: @ 808B8F0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x22 + bl audio_play + adds r0, r4, 0 + bl sub_80936CC + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl player_npc_set_state_and_x22_etc + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808B8F0 + + thumb_func_start sub_808B914 +sub_808B914: @ 808B914 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x22 + bl audio_play + adds r0, r4, 0 + bl sub_80936F8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808B914 + + thumb_func_start sub_808B938 +sub_808B938: @ 808B938 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x22 + bl audio_play + adds r0, r4, 0 + bl sub_8093724 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x8 + bl player_npc_set_state_and_x22_etc + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808B938 + + thumb_func_start sub_808B95C +sub_808B95C: @ 808B95C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x22 + bl audio_play + adds r0, r4, 0 + bl sub_80934E8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl player_npc_set_state_and_x22_etc + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808B95C + + thumb_func_start sub_808B980 +sub_808B980: @ 808B980 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x7 + bl audio_play + adds r0, r4, 0 + bl sub_8093750 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808B980 + + thumb_func_start sub_808B9A4 +sub_808B9A4: @ 808B9A4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_809377C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end sub_808B9A4 + + thumb_func_start sub_808B9BC +sub_808B9BC: @ 808B9BC + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_80937A8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end sub_808B9BC + + thumb_func_start npc_use_some_d2s +npc_use_some_d2s: @ 808B9D4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl d2s_08064034 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl player_npc_set_state_and_x22_etc + pop {r0} + bx r0 + thumb_func_end npc_use_some_d2s + + thumb_func_start PlayCollisionSoundIfNotFacingWarp +@ void PlayCollisionSoundIfNotFacingWarp(u8 direction) +PlayCollisionSoundIfNotFacingWarp: @ 808B9EC + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, =0x02037350 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1E] + ldr r2, =gUnknown_084974D8 + subs r1, r4, 0x1 + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + bne _0808BA54 + cmp r4, 0x2 + bne _0808BA4E + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + movs r0, 0x2 + mov r1, sp + adds r2, r4, 0 + bl MoveCoords + 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 is_tile_x69_2_warp_door + lsls r0, 24 + cmp r0, 0 + bne _0808BA54 +_0808BA4E: + movs r0, 0x7 + bl audio_play +_0808BA54: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end PlayCollisionSoundIfNotFacingWarp + + thumb_func_start GetXYCoordsOneStepInFrontOfPlayer +GetXYCoordsOneStepInFrontOfPlayer: @ 808BA68 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r3, =0x02037350 + ldr r2, =0x02037590 + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x10] + strh r0, [r4] + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x12] + strh r0, [r5] + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + adds r2, r5, 0 + bl MoveCoords + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end GetXYCoordsOneStepInFrontOfPlayer + + thumb_func_start PlayerGetDestCoords +@ void PlayerGetDestCoords(u16 *x, u16 *y) +PlayerGetDestCoords: @ 808BAAC + push {r4,r5,lr} + ldr r5, =0x02037350 + ldr r4, =0x02037590 + ldrb r3, [r4, 0x5] + lsls r2, r3, 3 + adds r2, r3 + lsls r2, 2 + adds r2, r5 + ldrh r2, [r2, 0x10] + strh r2, [r0] + ldrb r2, [r4, 0x5] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + ldrh r0, [r0, 0x12] + strh r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end PlayerGetDestCoords + + thumb_func_start plaer_get_pos_including_state_based_drift +plaer_get_pos_including_state_based_drift: @ 808BADC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r3, r0, r1 + ldrb r1, [r3] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0x40 + beq _0808BAFC + b _0808BC24 +_0808BAFC: + ldr r2, =0x02020630 + ldrb r1, [r3, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x32 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _0808BB12 + b _0808BC24 +_0808BB12: + ldrh r0, [r3, 0x10] + strh r0, [r4] + ldrh r0, [r3, 0x12] + strh r0, [r5] + ldrb r0, [r3, 0x1C] + subs r0, 0x8 + cmp r0, 0x30 + bls _0808BB24 + b _0808BC24 +_0808BB24: + lsls r0, 2 + ldr r1, =_0808BB40 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0808BB40: + .4byte _0808BC04 + .4byte _0808BC0A + .4byte _0808BC14 + .4byte _0808BC1A + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC24 + .4byte _0808BC04 + .4byte _0808BC0A + .4byte _0808BC14 + .4byte _0808BC1A +_0808BC04: + ldrh r0, [r5] + adds r0, 0x1 + b _0808BC0E +_0808BC0A: + ldrh r0, [r5] + subs r0, 0x1 +_0808BC0E: + strh r0, [r5] + movs r0, 0x1 + b _0808BC30 +_0808BC14: + ldrh r0, [r4] + subs r0, 0x1 + b _0808BC1E +_0808BC1A: + ldrh r0, [r4] + adds r0, 0x1 +_0808BC1E: + strh r0, [r4] + movs r0, 0x1 + b _0808BC30 +_0808BC24: + movs r1, 0x1 + negs r1, r1 + adds r0, r1, 0 + strh r0, [r4] + strh r0, [r5] + movs r0, 0 +_0808BC30: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end plaer_get_pos_including_state_based_drift + + thumb_func_start player_get_direction_lower_nybble +@ u8 player_get_direction_lower_nybble() +player_get_direction_lower_nybble: @ 808BC38 + ldr r2, =0x02037350 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x18] + lsls r0, 28 + lsrs r0, 28 + bx lr + .pool + thumb_func_end player_get_direction_lower_nybble + + thumb_func_start player_get_direction_upper_nybble +@ u8 player_get_direction_upper_nybble() +player_get_direction_upper_nybble: @ 808BC58 + ldr r2, =0x02037350 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x18] + lsrs r0, 4 + bx lr + .pool + thumb_func_end player_get_direction_upper_nybble + + thumb_func_start PlayerGetZCoord +@ u8 PlayerGetZCoord() +PlayerGetZCoord: @ 808BC74 + ldr r2, =0x02037350 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0xB] + lsrs r0, 4 + bx lr + .pool + thumb_func_end PlayerGetZCoord + + thumb_func_start sub_808BC90 +sub_808BC90: @ 808BC90 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + lsls r3, 16 + asrs r3, 16 + lsls r2, 16 + asrs r2, 16 + adds r1, r3, 0 + bl sub_808EB08 + pop {r0} + bx r0 + .pool + thumb_func_end sub_808BC90 + + thumb_func_start TestPlayerAvatarFlags +@ u32 TestPlayerAvatarFlags(u32 mask) +TestPlayerAvatarFlags: @ 808BCC0 + ldr r1, =0x02037590 + ldrb r1, [r1] + ands r1, r0 + adds r0, r1, 0 + bx lr + .pool + thumb_func_end TestPlayerAvatarFlags + + thumb_func_start sub_808BCD0 +sub_808BCD0: @ 808BCD0 + ldr r0, =0x02037590 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_808BCD0 + + thumb_func_start GetPlayerAvatarObjectId +@ u8 GetPlayerAvatarObjectId() +GetPlayerAvatarObjectId: @ 808BCDC + ldr r0, =0x02037590 + ldrb r0, [r0, 0x4] + bx lr + .pool + thumb_func_end GetPlayerAvatarObjectId + + thumb_func_start sub_808BCE8 +sub_808BCE8: @ 808BCE8 + push {lr} + bl ForcedMovement_None + pop {r0} + bx r0 + thumb_func_end sub_808BCE8 + + thumb_func_start sub_808BCF4 +sub_808BCF4: @ 808BCF4 + push {r4,lr} + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + adds r0, r4, 0 + bl npc_clear_strange_bits + ldrb r1, [r4, 0x18] + lsls r1, 28 + lsrs r1, 28 + adds r0, r4, 0 + bl FieldObjectSetDirection + movs r0, 0x6 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _0808BD2C + bl sub_811A188 + movs r0, 0 + bl sub_811A114 +_0808BD2C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808BCF4 + + thumb_func_start sub_808BD3C +sub_808BD3C: @ 808BD3C + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_084974E8 + lsrs r0, 23 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + bx lr + .pool + thumb_func_end sub_808BD3C + + thumb_func_start GetPlayerAvatarGraphicsIdByStateIdAndGender +@ u8 GetPlayerAvatarGraphicsIdByStateIdAndGender(u8 stateId, u8 gender) +GetPlayerAvatarGraphicsIdByStateIdAndGender: @ 808BD54 + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_084974F8 + lsrs r0, 23 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + bx lr + .pool + thumb_func_end GetPlayerAvatarGraphicsIdByStateIdAndGender + + thumb_func_start sub_808BD6C +sub_808BD6C: @ 808BD6C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_08497508 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_808BD6C + + thumb_func_start sub_808BD7C +sub_808BD7C: @ 808BD7C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0849750A + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_808BD7C + + thumb_func_start GetPlayerAvatarGraphicsIdByStateId +@ u8 GetPlayerAvatarGraphicsIdByStateId(u8 stateId) +GetPlayerAvatarGraphicsIdByStateId: @ 808BD8C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02037590 + ldrb r1, [r1, 0x7] + bl GetPlayerAvatarGraphicsIdByStateIdAndGender + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end GetPlayerAvatarGraphicsIdByStateId + + thumb_func_start sub_808BDA8 +sub_808BDA8: @ 808BDA8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x70 + beq _0808BDCA + cmp r0, 0x70 + bgt _0808BDC2 + cmp r0, 0x6D + bgt _0808BDCE + cmp r0, 0x69 + blt _0808BDCE + b _0808BDCA +_0808BDC2: + cmp r1, 0x8A + beq _0808BDCA + cmp r1, 0xC0 + bne _0808BDCE +_0808BDCA: + movs r0, 0x1 + b _0808BDD0 +_0808BDCE: + movs r0, 0 +_0808BDD0: + pop {r1} + bx r1 + thumb_func_end sub_808BDA8 + + thumb_func_start GetPlayerAvatarGenderByGraphicsId +@ u8 GetPlayerAvatarGenderByGraphicsId(u8 graphicsId) +GetPlayerAvatarGenderByGraphicsId: @ 808BDD4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x70 + beq _0808BDF6 + cmp r0, 0x70 + bgt _0808BDEE + cmp r0, 0x5D + bgt _0808BDFA + cmp r0, 0x59 + blt _0808BDFA + b _0808BDF6 +_0808BDEE: + cmp r1, 0x8A + beq _0808BDF6 + cmp r1, 0xC0 + bne _0808BDFA +_0808BDF6: + movs r0, 0x1 + b _0808BDFC +_0808BDFA: + movs r0, 0 +_0808BDFC: + pop {r1} + bx r1 + thumb_func_end GetPlayerAvatarGenderByGraphicsId + + thumb_func_start PartyHasMonWithSurf +@ bool8 PartyHasMonWithSurf() +PartyHasMonWithSurf: @ 808BE00 + push {r4,r5,lr} + movs r0, 0x8 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + bne _0808BE44 + movs r5, 0 + b _0808BE2A +_0808BE12: + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_has_move + lsls r0, 24 + cmp r0, 0 + beq _0808BE24 + movs r0, 0x1 + b _0808BE46 +_0808BE24: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_0808BE2A: + cmp r5, 0x5 + bhi _0808BE44 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + bne _0808BE12 +_0808BE44: + movs r0, 0 +_0808BE46: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end PartyHasMonWithSurf + + thumb_func_start IsPlayerSurfingNorth +@ bool8 IsPlayerSurfingNorth() +IsPlayerSurfingNorth: @ 808BE50 + push {lr} + bl player_get_direction_upper_nybble + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0808BE6E + movs r0, 0x8 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _0808BE6E + movs r0, 0x1 + b _0808BE70 +_0808BE6E: + movs r0, 0 +_0808BE70: + pop {r1} + bx r1 + thumb_func_end IsPlayerSurfingNorth + + thumb_func_start IsPlayerFacingSurfableFishableWater +@ bool8 IsPlayerFacingSurfableFishableWater() +IsPlayerFacingSurfableFishableWater: @ 808BE74 + push {r4,r5,lr} + sub sp, 0x4 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + ldrh r1, [r4, 0x10] + mov r0, sp + strh r1, [r0] + ldrh r0, [r4, 0x12] + mov r5, sp + adds r5, 0x2 + strh r0, [r5] + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + mov r1, sp + adds r2, r5, 0 + bl MoveCoords + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r5, r0] + ldrb r3, [r4, 0x18] + lsls r3, 28 + lsrs r3, 28 + adds r0, r4, 0 + bl npc_block_way + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0808BEF4 + bl PlayerGetZCoord + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0808BEF4 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsSurfableFishableWater + lsls r0, 24 + cmp r0, 0 + beq _0808BEF4 + movs r0, 0x1 + b _0808BEF6 + .pool +_0808BEF4: + movs r0, 0 +_0808BEF6: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end IsPlayerFacingSurfableFishableWater + + thumb_func_start ClearPlayerAvatarInfo +@ void ClearPlayerAvatarInfo() +ClearPlayerAvatarInfo: @ 808BF00 + push {lr} + ldr r0, =0x02037590 + movs r1, 0 + movs r2, 0x24 + bl memset + pop {r0} + bx r0 + .pool + thumb_func_end ClearPlayerAvatarInfo + + thumb_func_start SetPlayerAvatarStateMask +@ void SetPlayerAvatarStateMask(u8 stateMask) +SetPlayerAvatarStateMask: @ 808BF14 + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x02037590 + ldrb r2, [r3] + movs r1, 0xE0 + ands r1, r2 + orrs r0, r1 + strb r0, [r3] + bx lr + .pool + thumb_func_end SetPlayerAvatarStateMask + + thumb_func_start GetPlayerAvatarStateTransitionByGraphicsId +@ u8 GetPlayerAvatarStateTransitionByGraphicsId(u8 graphicsId, u8 gender) +GetPlayerAvatarStateTransitionByGraphicsId: @ 808BF2C + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r2, 0 + ldr r3, =gUnknown_0849750C + lsls r0, r1, 2 + adds r0, r1 + lsls r4, r0, 1 + adds r6, r3, 0x1 +_0808BF42: + lsls r0, r2, 1 + adds r1, r0, r4 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r5 + bne _0808BF58 + adds r0, r1, r6 + ldrb r0, [r0] + b _0808BF64 + .pool +_0808BF58: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x4 + bls _0808BF42 + movs r0, 0x1 +_0808BF64: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end GetPlayerAvatarStateTransitionByGraphicsId + + thumb_func_start GetPlayerAvatarGraphicsIdByCurrentState +@ u8 GetPlayerAvatarGraphicsIdByCurrentState() +GetPlayerAvatarGraphicsIdByCurrentState: @ 808BF6C + push {r4-r6,lr} + ldr r0, =0x02037590 + ldrb r5, [r0] + movs r2, 0 + ldr r3, =gUnknown_0849750C + ldrb r1, [r0, 0x7] + lsls r0, r1, 2 + adds r0, r1 + lsls r4, r0, 1 + adds r6, r3, 0x1 +_0808BF80: + lsls r0, r2, 1 + adds r1, r0, r4 + adds r0, r1, r6 + ldrb r0, [r0] + ands r0, r5 + cmp r0, 0 + beq _0808BF9C + adds r0, r1, r3 + ldrb r0, [r0] + b _0808BFA8 + .pool +_0808BF9C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x4 + bls _0808BF80 + movs r0, 0 +_0808BFA8: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end GetPlayerAvatarGraphicsIdByCurrentState + + thumb_func_start SetPlayerAvatarExtraStateTransition +@ void SetPlayerAvatarExtraStateTransition(u8 graphicsId, u8 state) +SetPlayerAvatarExtraStateTransition: @ 808BFB0 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =0x02037590 + ldrb r1, [r5, 0x7] + bl GetPlayerAvatarStateTransitionByGraphicsId + lsls r0, 24 + lsrs r0, 24 + orrs r0, r4 + ldrb r1, [r5, 0x1] + orrs r0, r1 + strb r0, [r5, 0x1] + bl DoPlayerAvatarTransition + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end SetPlayerAvatarExtraStateTransition + + thumb_func_start InitPlayerAvatar +@ void InitPlayerAvatar(u16 x, u16 y, u8 direction, u8 gender) +InitPlayerAvatar: @ 808BFE0 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x18 + adds r4, r0, 0 + adds r5, r1, 0 + mov r9, r2 + mov r8, r3 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + mov r1, sp + movs r0, 0xFF + strb r0, [r1] + movs r0, 0 + mov r1, r8 + bl GetPlayerAvatarGraphicsIdByStateIdAndGender + mov r1, sp + movs r3, 0 + strb r0, [r1, 0x1] + mov r0, sp + lsls r4, 16 + asrs r4, 16 + subs r4, 0x7 + movs r6, 0 + strh r4, [r0, 0x4] + lsls r5, 16 + asrs r5, 16 + subs r5, 0x7 + strh r5, [r0, 0x6] + strb r6, [r0, 0x8] + movs r0, 0xB + strb r0, [r1, 0x9] + mov r2, sp + ldrb r1, [r2, 0xA] + subs r0, 0x1B + ands r0, r1 + strb r0, [r2, 0xA] + mov r0, sp + strb r6, [r0, 0xA] + strh r3, [r0, 0xC] + strh r3, [r0, 0xE] + str r3, [sp, 0x10] + strh r3, [r0, 0x14] + bl SpawnSpecialFieldObject + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 3 + adds r4, r5 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + ldrb r0, [r4, 0x2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4, 0x2] + bl sub_8154228 + strb r0, [r4, 0x1B] + adds r0, r4, 0 + mov r1, r9 + bl FieldObjectTurn + bl ClearPlayerAvatarInfo + ldr r0, =0x02037590 + strb r6, [r0, 0x2] + strb r6, [r0, 0x3] + strb r5, [r0, 0x5] + ldrb r1, [r4, 0x4] + strb r1, [r0, 0x4] + mov r1, r8 + strb r1, [r0, 0x7] + movs r0, 0x21 + bl SetPlayerAvatarStateMask + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end InitPlayerAvatar + + thumb_func_start sub_808C0A8 +sub_808C0A8: @ 808C0A8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r6, =0x02037350 + ldr r5, =0x02037590 + ldrb r0, [r5, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + movs r0, 0x1 + ands r4, r0 + lsls r3, r4, 5 + ldrb r2, [r1, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x1] + movs r0, 0x8 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _0808C100 + ldr r2, =0x02020630 + ldrb r1, [r5, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x1A] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x3E + lsls r3, r4, 2 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r3 + strb r0, [r1] +_0808C100: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808C0A8 + + thumb_func_start sub_808C114 +sub_808C114: @ 808C114 + push {r4,r5,lr} + ldr r5, =0x02037590 + ldrb r0, [r5, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + movs r0, 0x5 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0 + bl StartObjectImageAnim + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808C114 + + thumb_func_start sub_808C15C +sub_808C15C: @ 808C15C + push {r4-r6,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r6, =0x02037590 + ldrb r0, [r6, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + movs r0, 0x6 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r0, [r6, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + adds r0, r5, 0 + bl sub_8092A0C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808C15C + + thumb_func_start sub_808C1B4 +sub_808C1B4: @ 808C1B4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r6, =0x02037590 + ldrb r0, [r6, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + movs r0, 0x2 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r0, [r6, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + mov r8, r0 + add r4, r8 + adds r0, r5, 0 + bl sub_80929BC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + ldrb r1, [r6, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + movs r1, 0x1 + bl SeekObjectImageAnim + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808C1B4 + + thumb_func_start sub_808C228 +sub_808C228: @ 808C228 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r6, =0x02037590 + ldrb r0, [r6, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + movs r0, 0x7 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r0, [r6, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + adds r0, r5, 0 + bl FieldObjectDirectionToImageAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808C228 + + thumb_func_start sub_808C280 +sub_808C280: @ 808C280 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r5, r0, 0 + ldrb r0, [r5, 0x1E] + mov r8, r0 + movs r1, 0 + mov r0, sp + strh r1, [r0] + movs r6, 0x1 + ldr r1, =gUnknown_08497520 + mov r9, r1 + mov r4, sp + mov r7, sp + adds r7, 0x2 +_0808C2A2: + movs r1, 0 + ldrsh r0, [r4, r1] + lsls r0, 2 + add r0, r9 + ldr r1, [r0] + mov r0, r8 + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + beq _0808C2E8 + ldrb r0, [r5, 0x18] + lsrs r0, 4 + cmp r6, r0 + bne _0808C2E8 + ldrh r0, [r5, 0x10] + strh r0, [r4] + ldrh r0, [r5, 0x12] + strh r0, [r7] + adds r0, r6, 0 + mov r1, sp + adds r2, r7, 0 + bl MoveCoords + ldrb r0, [r5, 0x1B] + movs r1, 0 + ldrsh r2, [r4, r1] + movs r1, 0 + ldrsh r3, [r7, r1] + adds r1, r6, 0 + bl sub_8154298 + b _0808C302 + .pool +_0808C2E8: + ldrh r1, [r4] + adds r1, 0x1 + strh r1, [r4] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x3 + ble _0808C2A2 + ldrb r0, [r5, 0x1B] + bl objid_set_invisible +_0808C302: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_808C280 + + thumb_func_start task_add_bump_boulder +task_add_bump_boulder: @ 808C310 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r6, =taskFF_bump_boulder + adds r0, r6, 0 + movs r1, 0xFF + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0xA] + strh r5, [r1, 0xC] + bl _call_via_r6 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end task_add_bump_boulder + + thumb_func_start taskFF_bump_boulder +taskFF_bump_boulder: @ 808C34C + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r6, =gUnknown_08497530 + ldr r2, =0x03005e00 + ldr r5, =0x02037350 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0808C360: + movs r0, 0x8 + ldrsh r3, [r4, r0] + lsls r3, 2 + adds r3, r6 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 2 + adds r2, r5 + ldr r3, [r3] + adds r0, r4, 0 + bl _call_via_r3 + lsls r0, 24 + cmp r0, 0 + bne _0808C360 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end taskFF_bump_boulder + + thumb_func_start sub_808C3A4 +sub_808C3A4: @ 808C3A4 + push {r4,lr} + adds r4, r0, 0 + bl script_env_2_enable + ldr r1, =0x02037590 + movs r0, 0x1 + strb r0, [r1, 0x6] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808C3A4 + + thumb_func_start do_boulder_dust +@ int do_boulder_dust(int a1, struct npc_state *a2, struct npc_state *a3) +do_boulder_dust: @ 808C3C4 + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + adds r4, r2, 0 + adds r0, r5, 0 + bl FieldObjectIsSpecialAnimActive + lsls r0, 24 + cmp r0, 0 + beq _0808C3DE + adds r0, r5, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished +_0808C3DE: + adds r0, r4, 0 + bl FieldObjectIsSpecialAnimActive + lsls r0, 24 + cmp r0, 0 + beq _0808C3F0 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished +_0808C3F0: + adds r0, r5, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + bne _0808C472 + adds r0, r4, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + bne _0808C472 + adds r0, r5, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + ldrb r0, [r6, 0xC] + bl GetStepInPlaceDelay16AnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl FieldObjectSetSpecialAnim + ldrb r0, [r6, 0xC] + bl GetSimpleGoAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + ldr r2, =0x02038c08 + movs r1, 0x10 + ldrsh r0, [r4, r1] + str r0, [r2] + movs r1, 0x12 + ldrsh r0, [r4, r1] + str r0, [r2, 0x4] + ldrb r0, [r4, 0xB] + lsrs r0, 4 + str r0, [r2, 0x8] + ldr r3, =0x02020630 + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x5] + lsls r0, 28 + lsrs r0, 30 + str r0, [r2, 0xC] + movs r0, 0xA + bl FieldEffectStart + movs r0, 0xD6 + bl audio_play + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] +_0808C472: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end do_boulder_dust + + thumb_func_start sub_808C484 +sub_808C484: @ 808C484 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + adds r0, r4, 0 + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive + lsls r0, 24 + cmp r0, 0 + beq _0808C4C6 + adds r0, r5, 0 + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive + lsls r0, 24 + cmp r0, 0 + beq _0808C4C6 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + adds r0, r5, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + ldr r1, =0x02037590 + movs r0, 0 + strb r0, [r1, 0x6] + bl script_env_2_disable + ldr r0, =taskFF_bump_boulder + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_0808C4C6: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808C484 + + thumb_func_start sub_808C4D8 +sub_808C4D8: @ 808C4D8 + push {r4,lr} + ldr r4, =sub_808C4F8 + adds r0, r4, 0 + movs r1, 0xFF + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808C4D8 + + thumb_func_start sub_808C4F8 +sub_808C4F8: @ 808C4F8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_0849753C + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0808C50A: + movs r0, 0x8 + ldrsh r2, [r4, r0] + lsls r2, 2 + adds r2, r5 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02037350 + adds r1, r0 + ldr r2, [r2] + adds r0, r4, 0 + bl _call_via_r2 + lsls r0, 24 + cmp r0, 0 + bne _0808C50A + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808C4F8 + + thumb_func_start sub_808C544 +sub_808C544: @ 808C544 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + ldr r5, =0x02037590 + movs r0, 0x1 + strb r0, [r5, 0x6] + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _0808C5A0 + movs r0, 0xA + bl audio_play + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl sub_80934BC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + ldrh r0, [r6, 0xA] + adds r0, 0x1 + strh r0, [r6, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0808C5A0 + movs r0, 0 + strb r0, [r5, 0x6] + ldrb r0, [r5, 0x1] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r5, 0x1] + ldr r0, =sub_808C4F8 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_0808C5A0: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808C544 + + thumb_func_start sub_808C5B0 +sub_808C5B0: @ 808C5B0 + push {r4,lr} + ldr r4, =sub_808C5D0 + adds r0, r4, 0 + movs r1, 0xFF + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808C5B0 + + thumb_func_start sub_808C5D0 +sub_808C5D0: @ 808C5D0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_08497540 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0808C5E2: + movs r0, 0x8 + ldrsh r2, [r4, r0] + lsls r2, 2 + adds r2, r5 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02037350 + adds r1, r0 + ldr r2, [r2] + adds r0, r4, 0 + bl _call_via_r2 + lsls r0, 24 + cmp r0, 0 + bne _0808C5E2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808C5D0 + + thumb_func_start sub_808C61C +sub_808C61C: @ 808C61C + push {lr} + ldrh r2, [r0, 0x8] + adds r2, 0x1 + strh r2, [r0, 0x8] + ldrb r1, [r1, 0x18] + lsrs r1, 4 + strh r1, [r0, 0xA] + ldr r1, =0x02037590 + movs r0, 0x1 + strb r0, [r1, 0x6] + bl script_env_2_enable + movs r0, 0x2D + bl audio_play + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_808C61C + + thumb_func_start sub_808C644 +sub_808C644: @ 808C644 + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_08497550 + mov r0, sp + movs r2, 0x4 + bl memcpy + adds r0, r5, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _0808C6AC + ldrb r0, [r5, 0x18] + lsrs r0, 4 + subs r0, 0x1 + add r0, sp + ldrb r6, [r0] + adds r0, r6, 0 + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl FieldObjectSetSpecialAnim + ldrb r0, [r4, 0xA] + cmp r6, r0 + bne _0808C68A + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] +_0808C68A: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x3 + ble _0808C6AC + ldrb r0, [r4, 0xA] + bl GetOppositeDirection + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + bne _0808C6AC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0808C6AC: + movs r0, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808C644 + + thumb_func_start sub_808C6BC +sub_808C6BC: @ 808C6BC + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r0, 0 + adds r4, r1, 0 + ldr r1, =gUnknown_08497554 + mov r0, sp + movs r2, 0x5 + bl memcpy + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _0808C6EC + movs r1, 0xC + ldrsh r0, [r5, r1] + add r0, sp + ldrb r1, [r0] + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + movs r0, 0x1 + strh r0, [r5, 0x8] +_0808C6EC: + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808C6BC + + thumb_func_start sub_808C6FC +sub_808C6FC: @ 808C6FC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _0808C740 + ldrb r0, [r4, 0xA] + bl GetOppositeDirection + lsls r0, 24 + lsrs r0, 24 + bl GetSimpleGoAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl FieldObjectSetSpecialAnim + bl script_env_2_disable + ldr r1, =0x02037590 + movs r0, 0 + strb r0, [r1, 0x6] + ldr r0, =sub_808C5D0 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_0808C740: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808C6FC + + thumb_func_start sub_808C750 +sub_808C750: @ 808C750 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl script_env_2_enable + bl sav1_reset_battle_music_maybe + bl sub_8085898 + ldr r2, =0x02037590 + ldrb r1, [r2] + movs r0, 0xF7 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x1 + strb r0, [r2, 0x6] + ldr r5, =taskFF_0805D1D4 + adds r0, r5, 0 + movs r1, 0xFF + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + bl _call_via_r5 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808C750 + + thumb_func_start taskFF_0805D1D4 +taskFF_0805D1D4: @ 808C7A8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r5, r0, r1 + adds r0, r5, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _0808C7D4 + adds r0, r5, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _0808C7FC +_0808C7D4: + ldrb r0, [r5, 0x1A] + movs r1, 0x2 + bl sub_81555AC + ldr r0, =0x03005e00 + lsls r4, r6, 2 + adds r4, r6 + lsls r4, 3 + adds r4, r0 + ldrb r0, [r4, 0x8] + bl sub_8093540 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl FieldObjectSetSpecialAnim + ldr r0, =sub_808C814 + str r0, [r4] +_0808C7FC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end taskFF_0805D1D4 + + thumb_func_start sub_808C814 +sub_808C814: @ 808C814 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, =0x02037590 + ldrb r1, [r6, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _0808C87A + movs r0, 0 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + movs r0, 0 + strb r0, [r6, 0x6] + bl script_env_2_disable + ldrb r1, [r4, 0x1A] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + adds r0, r5, 0 + bl DestroyTask +_0808C87A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808C814 + + thumb_func_start StartFishing +StartFishing: @ 808C88C + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =Task_Fish + adds r0, r5, 0 + movs r1, 0xFF + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x26] + bl _call_via_r5 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end StartFishing + + thumb_func_start Task_Fish +Task_Fish: @ 808C8C0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_0849755C + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0808C8D2: + 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 _0808C8D2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end Task_Fish + + thumb_func_start fish0 +fish0: @ 808C8F8 + push {r4,lr} + adds r4, r0, 0 + bl script_env_2_enable + ldr r1, =0x02037590 + movs r0, 0x1 + strb r0, [r1, 0x6] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end fish0 + + thumb_func_start fish1 +fish1: @ 808C918 + push {r4-r6,lr} + sub sp, 0x10 + adds r5, r0, 0 + ldr r1, =gUnknown_0849759C + mov r0, sp + movs r2, 0x6 + bl memcpy + add r4, sp, 0x8 + ldr r1, =gUnknown_084975A2 + adds r0, r4, 0 + movs r2, 0x6 + bl memcpy + movs r0, 0 + strh r0, [r5, 0x20] + bl GenerateRandomNumber + movs r2, 0x26 + ldrsh r1, [r5, r2] + lsls r1, 1 + mov r2, sp + adds r6, r2, r1 + lsls r0, 16 + lsrs r0, 16 + adds r4, r1 + movs r2, 0 + ldrsh r1, [r4, r2] + bl __modsi3 + ldrh r1, [r6] + adds r1, r0 + strh r1, [r5, 0x22] + ldr r3, =0x02037350 + ldr r2, =0x02037590 + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x5] + strh r0, [r5, 0x24] + ldrb r0, [r2, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + adds r4, r3 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimActive + ldrb r0, [r4, 0x1] + movs r1, 0x8 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl sub_808C15C + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end fish1 + + thumb_func_start fish2 +fish2: @ 808C9B0 + push {r4,lr} + adds r4, r0, 0 + bl sub_808CF78 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3B + ble _0808C9CC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0808C9CC: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end fish2 + + thumb_func_start fish3 +fish3: @ 808C9D4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0 + movs r1, 0x1 + bl sub_819786C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x8] + strh r1, [r4, 0xA] + strh r1, [r4, 0xC] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + adds r1, r0, 0 + adds r0, r1, 0x1 + strh r0, [r4, 0xE] + movs r2, 0x20 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0808CA0C + adds r0, r1, 0x4 + strh r0, [r4, 0xE] +_0808CA0C: + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0x9 + ble _0808CA18 + movs r0, 0xA + strh r0, [r4, 0xE] +_0808CA18: + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + thumb_func_end fish3 + + thumb_func_start fish4 +fish4: @ 808CA20 + push {r4,r5,lr} + sub sp, 0x10 + adds r4, r0, 0 + ldr r1, =gUnknown_084975A8 + add r0, sp, 0xC + movs r2, 0x2 + bl memcpy + bl sub_808CF78 + ldrh r0, [r4, 0xA] + adds r1, r0, 0x1 + strh r1, [r4, 0xA] + ldr r0, =0x030022c0 + ldrh r0, [r0, 0x2E] + movs r5, 0x1 + adds r2, r5, 0 + ands r2, r0 + cmp r2, 0 + beq _0808CA64 + movs r0, 0xB + strh r0, [r4, 0x8] + movs r1, 0x20 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0808CA58 + movs r0, 0xC + strh r0, [r4, 0x8] +_0808CA58: + movs r0, 0x1 + b _0808CAB4 + .pool +_0808CA64: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _0808CAB2 + strh r2, [r4, 0xA] + movs r3, 0xC + ldrsh r1, [r4, r3] + movs r3, 0xE + ldrsh r0, [r4, r3] + cmp r1, r0 + blt _0808CA94 + ldrh r0, [r4, 0x8] + adds r1, r0, 0x1 + strh r1, [r4, 0x8] + ldrh r2, [r4, 0x20] + movs r3, 0x20 + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _0808CA8E + adds r0, r1, 0x1 + strh r0, [r4, 0x8] +_0808CA8E: + adds r0, r2, 0x1 + strh r0, [r4, 0x20] + b _0808CAB2 +_0808CA94: + movs r0, 0xC + ldrsh r3, [r4, r0] + lsls r3, 27 + lsrs r3, 24 + str r5, [sp] + str r2, [sp, 0x4] + str r2, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + add r2, sp, 0xC + bl Print + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] +_0808CAB2: + movs r0, 0 +_0808CAB4: + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end fish4 + + thumb_func_start fish5 +fish5: @ 808CABC + push {r4-r6,lr} + adds r5, r0, 0 + bl sub_808CF78 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r6, 0 + bl GetFishingWildMonListHeader + lsls r0, 24 + cmp r0, 0 + bne _0808CADC + movs r0, 0xB + strh r0, [r5, 0x8] + b _0808CB5C +_0808CADC: + ldr r4, =0x020244ec + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _0808CB14 + adds r0, r4, 0 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x15 + beq _0808CAFC + cmp r0, 0x3C + bne _0808CB14 +_0808CAFC: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xE + bls _0808CB14 + movs r6, 0x1 +_0808CB14: + cmp r6, 0 + bne _0808CB32 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0808CB30 + movs r0, 0xB + strh r0, [r5, 0x8] + b _0808CB32 + .pool +_0808CB30: + movs r6, 0x1 +_0808CB32: + cmp r6, 0x1 + bne _0808CB5C + ldr r0, =0x02037590 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + bl sub_8092A2C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim +_0808CB5C: + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end fish5 + + thumb_func_start fish6 +fish6: @ 808CB6C + push {r4,r5,lr} + sub sp, 0xC + adds r5, r0, 0 + bl sub_808CF78 + ldr r2, =gUnknown_085EE8F7 + movs r0, 0x11 + str r0, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl Print + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + strh r4, [r5, 0xA] + movs r0, 0 + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end fish6 + + thumb_func_start fish7 +fish7: @ 808CBA4 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, =gUnknown_084975AA + mov r0, sp + movs r2, 0x6 + bl memcpy + bl sub_808CF78 + ldrh r1, [r4, 0xA] + adds r1, 0x1 + strh r1, [r4, 0xA] + movs r2, 0x26 + ldrsh r0, [r4, r2] + lsls r0, 1 + add r0, sp + lsls r1, 16 + asrs r1, 16 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r1, r0 + blt _0808CBDC + movs r0, 0xC + b _0808CBEC + .pool +_0808CBDC: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0808CBEE + ldrh r0, [r4, 0x8] + adds r0, 0x1 +_0808CBEC: + strh r0, [r4, 0x8] +_0808CBEE: + movs r0, 0 + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end fish7 + + thumb_func_start fish8 +fish8: @ 808CBFC + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + ldr r1, =gUnknown_084975B0 + mov r0, sp + movs r2, 0xC + bl memcpy + bl sub_808CF78 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x20 + ldrsh r1, [r4, r0] + movs r2, 0x22 + ldrsh r0, [r4, r2] + cmp r1, r0 + blt _0808CC52 + cmp r1, 0x1 + bgt _0808CC56 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + movs r3, 0x20 + ldrsh r2, [r4, r3] + lsls r2, 1 + movs r3, 0x26 + ldrsh r1, [r4, r3] + lsls r1, 2 + adds r2, r1 + mov r3, sp + adds r1, r3, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + lsls r0, 16 + asrs r0, 16 + cmp r1, r0 + ble _0808CC56 +_0808CC52: + movs r0, 0x3 + strh r0, [r4, 0x8] +_0808CC56: + movs r0, 0 + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end fish8 + + thumb_func_start fish9 +fish9: @ 808CC64 + push {r4,r5,lr} + sub sp, 0x10 + adds r4, r0, 0 + bl sub_808CF78 + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_085EE903 + movs r5, 0 + str r5, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + movs r3, 0x1 + bl AddTextPrinterParametrized + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + strh r5, [r4, 0xA] + movs r0, 0 + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end fish9 + + thumb_func_start fishA_wait_for_a_pressed +fishA_wait_for_a_pressed: @ 808CCA8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0808CCBC + bl sub_808CF78 +_0808CCBC: + bl RunTextPrinters + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0808CD58 + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0 + bne _0808CD50 + ldr r7, =0x02037590 + ldrb r0, [r7, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + mov r8, r0 + add r4, r8 + ldrh r1, [r5, 0x24] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl FieldObjectTurn + ldrb r1, [r7] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0808CD1A + ldrb r0, [r7, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrb r0, [r1, 0x1A] + movs r1, 0 + movs r2, 0 + bl sub_8155604 +_0808CD1A: + ldr r2, =0x02020630 + ldrb r1, [r7, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r6, [r0, 0x24] + ldrb r1, [r7, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r6, [r0, 0x26] + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + b _0808CD80 + .pool +_0808CD50: + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _0808CD80 +_0808CD58: + ldr r1, =0x02037590 + movs r0, 0 + strb r0, [r1, 0x6] + bl script_env_2_disable + ldrh r0, [r5, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80B5734 + movs r0, 0x1 + bl sub_80ED950 + ldr r0, =Task_Fish + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_0808CD80: + movs r0, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end fishA_wait_for_a_pressed + + thumb_func_start fishB +fishB: @ 808CD94 + push {r4,r5,lr} + sub sp, 0x10 + adds r5, r0, 0 + bl sub_808CF78 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + bl sub_8092A1C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_085EE91E + 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, 0 + movs r1, 0x1 + movs r3, 0x1 + bl AddTextPrinterParametrized + movs r0, 0xD + strh r0, [r5, 0x8] + movs r0, 0x1 + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end fishB + + thumb_func_start fishC +fishC: @ 808CE04 + push {r4,r5,lr} + sub sp, 0x10 + adds r5, r0, 0 + bl sub_808CF78 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + bl sub_8092A1C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_085EE933 + 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, 0 + movs r1, 0x1 + movs r3, 0x1 + bl AddTextPrinterParametrized + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0x1 + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end fishC + + thumb_func_start fishD +fishD: @ 808CE74 + push {r4,lr} + adds r4, r0, 0 + bl sub_808CF78 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end fishD + + thumb_func_start fishE +fishE: @ 808CE8C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + bl sub_808CF78 + ldr r7, =0x02020630 + ldr r5, =0x02037590 + ldrb r0, [r5, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + adds r1, 0x3F + ldrb r0, [r1] + lsls r0, 27 + cmp r0, 0 + bge _0808CF12 + ldrb r0, [r5, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + mov r8, r0 + add r4, r8 + ldrh r1, [r6, 0x24] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r1, [r4, 0x18] + lsrs r1, 4 + adds r0, r4, 0 + bl FieldObjectTurn + ldrb r1, [r5] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0808CEF2 + ldrb r0, [r5, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrb r0, [r1, 0x1A] + movs r1, 0 + movs r2, 0 + bl sub_8155604 +_0808CEF2: + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + movs r2, 0 + strh r2, [r0, 0x24] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] +_0808CF12: + movs r0, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end fishE + + thumb_func_start fishF +fishF: @ 808CF2C + push {lr} + bl RunTextPrinters + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _0808CF68 + ldr r0, =0x02037590 + strb r1, [r0, 0x6] + bl script_env_2_disable + bl sub_809757C + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + movs r0, 0 + bl sub_80ED950 + ldr r0, =Task_Fish + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_0808CF68: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end fishF + + thumb_func_start sub_808CF78 +sub_808CF78: @ 808CF78 + push {r4-r7,lr} + ldr r0, =0x02037590 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r4, r0, r1 + adds r0, r4, 0 + bl AnimateObject + movs r0, 0 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + adds r0, r4, 0 + adds r0, 0x2B + ldrb r5, [r0] + movs r0, 0x2A + adds r0, r4 + mov r12, r0 + ldrb r0, [r0] + ldr r1, [r4, 0x8] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + lsls r6, r5, 2 + adds r0, r6, r0 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r7, 0x1 + negs r7, r7 + cmp r0, r7 + beq _0808CFEA + adds r3, r4, 0 + adds r3, 0x2C + ldrb r2, [r3] + lsls r1, r2, 26 + lsrs r1, 26 + adds r1, 0x1 + movs r0, 0x3F + ands r1, r0 + movs r0, 0x40 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + mov r1, r12 + ldrb r0, [r1] + ldr r1, [r4, 0x8] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + adds r0, r6, r0 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, r7 + bne _0808CFF0 +_0808CFEA: + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_0808CFF0: + adds r0, r4, 0 + adds r0, 0x2A + ldrb r0, [r0] + ldr r1, [r4, 0x8] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + lsls r0, r5, 2 + adds r0, r1 + ldrb r5, [r0] + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bhi _0808D022 + movs r0, 0x8 + strh r0, [r4, 0x24] + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0808D022 + ldr r0, =0x0000fff8 + strh r0, [r4, 0x24] +_0808D022: + cmp r5, 0x5 + bne _0808D02A + ldr r0, =0x0000fff8 + strh r0, [r4, 0x26] +_0808D02A: + adds r0, r5, 0 + subs r0, 0xA + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0808D03A + movs r0, 0x8 + strh r0, [r4, 0x26] +_0808D03A: + ldr r3, =0x02037590 + ldrb r1, [r3] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0808D05E + ldr r2, =0x02037350 + ldrb r1, [r3, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1A] + movs r1, 0x26 + ldrsh r2, [r4, r1] + movs r1, 0x1 + bl sub_8155604 +_0808D05E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808CF78 + + thumb_func_start sub_808D074 +sub_808D074: @ 808D074 + ldr r1, =0x0203734c + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_808D074 + + thumb_func_start sub_808D080 +sub_808D080: @ 808D080 + push {lr} + ldr r1, =0x0203734c + ldrb r0, [r1] + cmp r0, 0 + bne _0808D08C + movs r0, 0x1 +_0808D08C: + pop {r1} + bx r1 + .pool + thumb_func_end sub_808D080 + + thumb_func_start sub_808D094 +sub_808D094: @ 808D094 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r7, r0, r1 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + movs r0, 0 + ldrsh r6, [r5, r0] + cmp r6, 0x1 + beq _0808D14A + cmp r6, 0x1 + bgt _0808D0E8 + cmp r6, 0 + beq _0808D0EE + b _0808D18A + .pool +_0808D0E8: + cmp r6, 0x2 + beq _0808D184 + b _0808D18A +_0808D0EE: + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _0808D18A + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl sub_808D074 + movs r1, 0 + mov r8, r1 + strh r6, [r5, 0x2] + movs r0, 0x1 + strh r0, [r5, 0x4] + ldrh r0, [r7, 0x26] + ldrh r2, [r7, 0x22] + adds r0, r2 + lsls r0, 4 + strh r0, [r5, 0x6] + strh r6, [r7, 0x26] + bl CameraObjectReset2 + ldrb r0, [r4, 0x3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4, 0x3] + ldrb r1, [r7, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + strb r0, [r7, 0x5] + adds r0, r7, 0 + adds r0, 0x43 + mov r1, r8 + strb r1, [r0] + adds r2, r7, 0 + adds r2, 0x42 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_0808D14A: + adds r1, r5, 0x2 + adds r0, r4, 0 + bl sub_808D38C + ldrh r0, [r5, 0x6] + ldrh r1, [r5, 0x4] + subs r0, r1 + strh r0, [r5, 0x6] + adds r1, 0x3 + strh r1, [r5, 0x4] + lsls r0, 16 + asrs r0, 20 + strh r0, [r7, 0x22] + movs r2, 0x22 + ldrsh r1, [r7, r2] + ldr r0, =0x03005de8 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r1, r0 + movs r0, 0x20 + negs r0, r0 + cmp r1, r0 + bge _0808D18A + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + b _0808D18A + .pool +_0808D184: + adds r0, r2, 0 + bl DestroyTask +_0808D18A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_808D094 + + thumb_func_start sub_808D194 +sub_808D194: @ 808D194 + push {r4,lr} + ldr r4, =sub_808D1FC + adds r0, r4, 0 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808D194 + + thumb_func_start sub_808D1B4 +sub_808D1B4: @ 808D1B4 + push {lr} + ldr r0, =sub_808D1FC + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_808D1B4 + + thumb_func_start sub_808D1C8 +sub_808D1C8: @ 808D1C8 + push {r4,lr} + ldr r4, =sub_808D094 + adds r0, r4, 0 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808D1C8 + + thumb_func_start sub_808D1E8 +sub_808D1E8: @ 808D1E8 + push {lr} + ldr r0, =sub_808D094 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_808D1E8 + + thumb_func_start sub_808D1FC +sub_808D1FC: @ 808D1FC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r7, r0, r1 + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + movs r2, 0 + ldrsh r6, [r5, r2] + cmp r6, 0x1 + beq _0808D2DE + cmp r6, 0x1 + bgt _0808D254 + cmp r6, 0 + beq _0808D25E + b _0808D37E + .pool +_0808D254: + cmp r6, 0x2 + beq _0808D31C + cmp r6, 0x3 + beq _0808D33A + b _0808D37E +_0808D25E: + bl sub_808D080 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xA] + ldr r1, =gUnknown_084975BC + movs r3, 0xA + ldrsh r0, [r5, r3] + adds r0, r1 + ldrb r0, [r0] + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectForceSetSpecialAnim + movs r0, 0 + mov r9, r0 + strh r6, [r5, 0x2] + movs r0, 0x74 + strh r0, [r5, 0x4] + ldrh r0, [r7, 0x22] + strh r0, [r5, 0x8] + ldrb r0, [r7, 0x5] + lsls r0, 28 + lsrs r0, 30 + strh r0, [r5, 0xC] + movs r1, 0x43 + adds r1, r7 + mov r8, r1 + ldrb r0, [r1] + strh r0, [r5, 0xE] + ldrh r0, [r7, 0x26] + adds r0, 0x20 + negs r0, r0 + lsls r0, 4 + strh r0, [r5, 0x6] + strh r6, [r7, 0x26] + bl CameraObjectReset2 + ldrb r0, [r4, 0x3] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r4, 0x3] + ldrb r1, [r7, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + orrs r0, r2 + strb r0, [r7, 0x5] + mov r3, r9 + mov r2, r8 + strb r3, [r2] + adds r2, r7, 0 + adds r2, 0x42 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_0808D2DE: + adds r1, r5, 0x2 + adds r0, r4, 0 + bl sub_808D38C + ldrh r0, [r5, 0x4] + ldrh r2, [r5, 0x6] + adds r1, r0, r2 + strh r1, [r5, 0x6] + subs r0, 0x3 + strh r0, [r5, 0x4] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bgt _0808D2FE + movs r0, 0x4 + strh r0, [r5, 0x4] +_0808D2FE: + ldrh r0, [r5, 0x6] + lsls r0, 16 + asrs r0, 20 + strh r0, [r7, 0x22] + ldrh r2, [r5, 0x8] + movs r3, 0x8 + ldrsh r1, [r5, r3] + cmp r0, r1 + blt _0808D37E + strh r2, [r7, 0x22] + movs r0, 0 + strh r0, [r5, 0x10] + b _0808D332 + .pool +_0808D31C: + adds r1, r5, 0x2 + adds r0, r4, 0 + bl sub_808D38C + ldrh r0, [r5, 0x10] + adds r0, 0x1 + strh r0, [r5, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _0808D37E +_0808D332: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + b _0808D37E +_0808D33A: + movs r0, 0xA + ldrsh r6, [r5, r0] + adds r1, r5, 0x2 + adds r0, r4, 0 + bl sub_808D38C + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + bne _0808D37E + ldrb r1, [r4, 0x3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x3] + movs r0, 0x3 + ldrb r1, [r5, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r2, [r7, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r7, 0x5] + ldrh r1, [r5, 0xE] + adds r0, r7, 0 + adds r0, 0x43 + strb r1, [r0] + bl CameraObjectReset1 + mov r0, r8 + bl DestroyTask +_0808D37E: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_808D1FC + + thumb_func_start sub_808D38C +sub_808D38C: @ 808D38C + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + ldrh r1, [r6] + movs r2, 0 + ldrsh r0, [r6, r2] + cmp r0, 0x7 + bgt _0808D3A8 + adds r0, r1, 0x1 + strh r0, [r6] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _0808D3E4 +_0808D3A8: + adds r0, r5, 0 + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive + lsls r0, 24 + cmp r0, 0 + beq _0808D3E4 + ldr r4, =gUnknown_084975BC + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + adds r0, r4 + ldrb r0, [r0] + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl FieldObjectForceSetSpecialAnim + movs r0, 0 + strh r0, [r6] + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + adds r0, r4 + ldrb r0, [r0] + b _0808D3EA + .pool +_0808D3E4: + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 +_0808D3EA: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808D38C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/field_poison.s b/asm/field_poison.s new file mode 100644 index 000000000..31e72c615 --- /dev/null +++ b/asm/field_poison.s @@ -0,0 +1,323 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80F9568 +sub_80F9568: @ 80F9568 + push {lr} + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _080F9580 + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + bne _080F9584 +_080F9580: + movs r0, 0 + b _080F9586 +_080F9584: + movs r0, 0x1 +_080F9586: + pop {r1} + bx r1 + thumb_func_end sub_80F9568 + + thumb_func_start sub_80F958C +sub_80F958C: @ 80F958C + push {r4,r5,lr} + ldr r4, =0x020244ec + movs r5, 0 +_080F9592: + adds r0, r4, 0 + bl sub_80F9568 + cmp r0, 0 + beq _080F95B0 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _080F95B0 + movs r0, 0 + b _080F95BA + .pool +_080F95B0: + adds r5, 0x1 + adds r4, 0x64 + cmp r5, 0x5 + ble _080F9592 + movs r0, 0x1 +_080F95BA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80F958C + + thumb_func_start sub_80F95C0 +sub_80F95C0: @ 80F95C0 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + adds r4, r0, 0 + muls r4, r1 + ldr r0, =0x020244ec + adds r4, r0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x7 + bl happiness_algorithm + adds r0, r4, 0 + movs r1, 0x37 + mov r2, sp + bl pokemon_setattr + ldr r5, =0x02021cc4 + adds r0, r4, 0 + movs r1, 0x2 + adds r2, r5, 0 + bl pokemon_getattr + adds r0, r5, 0 + bl GetStringEnd_Limit7 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F95C0 + + thumb_func_start sub_80F960C +sub_80F960C: @ 80F960C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + bl sub_80F9568 + cmp r0, 0 + beq _080F964C + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _080F964C + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + bl pokemon_ailments_get_primary + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080F964C + movs r0, 0x1 + b _080F964E + .pool +_080F964C: + movs r0, 0 +_080F964E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80F960C + + thumb_func_start sub_80F9654 +sub_80F9654: @ 80F9654 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + movs r0, 0 + ldrsh r5, [r4, r0] + cmp r5, 0x1 + beq _080F96AE + cmp r5, 0x1 + bgt _080F967C + cmp r5, 0 + beq _080F9682 + b _080F9722 + .pool +_080F967C: + cmp r5, 0x2 + beq _080F96C0 + b _080F9722 +_080F9682: + ldrh r1, [r4, 0x2] + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, 0x5 + bgt _080F96A8 +_080F968C: + lsls r0, r1, 24 + lsrs r0, 24 + bl sub_80F960C + cmp r0, 0 + bne _080F96FC + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + adds r1, r0, 0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _080F968C +_080F96A8: + movs r0, 0x2 + strh r0, [r4] + b _080F9722 +_080F96AE: + bl sub_809833C + lsls r0, 24 + cmp r0, 0 + beq _080F9722 + ldrh r0, [r4] + subs r0, 0x1 + strh r0, [r4] + b _080F9722 +_080F96C0: + bl sub_80F958C + adds r1, r0, 0 + cmp r1, 0 + beq _080F9714 + bl InBattlePyramid + adds r4, r0, 0 + bl InBattlePike + orrs r4, r0 + lsls r4, 24 + cmp r4, 0 + bne _080F96E6 + bl sub_81D5C18 + lsls r0, 24 + cmp r0, 0 + beq _080F96F0 +_080F96E6: + ldr r0, =0x020375f0 + strh r5, [r0] + b _080F9718 + .pool +_080F96F0: + ldr r1, =0x020375f0 + movs r0, 0x1 + strh r0, [r1] + b _080F9718 + .pool +_080F96FC: + ldrb r0, [r4, 0x2] + bl sub_80F95C0 + ldr r0, =gUnknown_085ECF5D + bl box_related_two__2 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _080F9722 + .pool +_080F9714: + ldr r0, =0x020375f0 + strh r1, [r0] +_080F9718: + bl script_env_2_enable_and_set_ctx_running + adds r0, r6, 0 + bl DestroyTask +_080F9722: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F9654 + + thumb_func_start sub_80F972C +sub_80F972C: @ 80F972C + push {lr} + ldr r0, =sub_80F9654 + movs r1, 0x50 + bl CreateTask + bl script_env_2_set_ctx_paused + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F972C + + thumb_func_start overworld_poison +overworld_poison: @ 80F9744 + push {r4-r7,lr} + sub sp, 0x4 + ldr r4, =0x020244ec + movs r7, 0 + movs r6, 0 + movs r5, 0x5 +_080F9750: + adds r0, r4, 0 + movs r1, 0x5 + bl pokemon_getattr + cmp r0, 0 + beq _080F9794 + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + bl pokemon_ailments_get_primary + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080F9794 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + str r0, [sp] + cmp r0, 0 + beq _080F9786 + subs r0, 0x1 + str r0, [sp] + cmp r0, 0 + bne _080F9788 +_080F9786: + adds r6, 0x1 +_080F9788: + adds r0, r4, 0 + movs r1, 0x39 + mov r2, sp + bl pokemon_setattr + adds r7, 0x1 +_080F9794: + adds r4, 0x64 + subs r5, 0x1 + cmp r5, 0 + bge _080F9750 + cmp r6, 0 + bne _080F97A4 + cmp r7, 0 + beq _080F97A8 +_080F97A4: + bl overworld_posion_effect +_080F97A8: + cmp r6, 0 + beq _080F97B4 + movs r0, 0x2 + b _080F97BE + .pool +_080F97B4: + cmp r7, 0 + bne _080F97BC + movs r0, 0 + b _080F97BE +_080F97BC: + movs r0, 0x1 +_080F97BE: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end overworld_poison + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/fieldmap.s b/asm/fieldmap.s new file mode 100644 index 000000000..3da569a02 --- /dev/null +++ b/asm/fieldmap.s @@ -0,0 +1,2285 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start mapconnection_get_mapheader +mapconnection_get_mapheader: @ 8087D44 + push {lr} + ldrb r2, [r0, 0x8] + ldrb r1, [r0, 0x9] + adds r0, r2, 0 + bl get_mapheader_by_bank_and_number + pop {r1} + bx r1 + thumb_func_end mapconnection_get_mapheader + + thumb_func_start not_trainer_hill_battle_pyramid +not_trainer_hill_battle_pyramid: @ 8087D54 + push {r4,lr} + ldr r4, =0x02037318 + adds r0, r4, 0 + bl mapheader_copy_mapdata_with_padding + ldr r0, [r4, 0x4] + bl sub_80E8EE0 + bl mapheader_run_script_with_tag_x1 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end not_trainer_hill_battle_pyramid + + thumb_func_start sub_8087D74 +sub_8087D74: @ 8087D74 + push {r4,lr} + ldr r4, =0x02037318 + adds r0, r4, 0 + bl mapheader_copy_mapdata_with_padding + movs r0, 0 + bl sub_80E9238 + ldr r0, [r4, 0x4] + bl sub_80E8EE0 + bl mapdata_from_sav2 + bl mapheader_run_script_with_tag_x1 + ldr r1, =0x03005dc0 + ldr r0, [r1] + ldr r1, [r1, 0x4] + bl UpdateTVScreensOnMap + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8087D74 + + thumb_func_start battle_pyramid_map_load_related +battle_pyramid_map_load_related: @ 8087DAC + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x03ff03ff + str r0, [sp] + ldr r5, =0x02032318 + ldr r2, =0x01001400 + mov r0, sp + adds r1, r5, 0 + bl CpuFastSet + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81AA078 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end battle_pyramid_map_load_related + + thumb_func_start trainer_hill_map_load_related +trainer_hill_map_load_related: @ 8087DE4 + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x03ff03ff + str r0, [sp] + ldr r4, =0x02032318 + ldr r2, =0x01001400 + mov r0, sp + adds r1, r4, 0 + bl CpuFastSet + adds r0, r4, 0 + bl sub_81D5FB4 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end trainer_hill_map_load_related + + thumb_func_start mapheader_copy_mapdata_with_padding +@ void mapheader_copy_mapdata_with_padding(struct mapheader *mapHeader) +mapheader_copy_mapdata_with_padding: @ 8087E14 + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + ldr r5, [r6] + ldr r0, =0x03ff03ff + str r0, [sp] + ldr r4, =0x02032318 + ldr r2, =0x01001400 + mov r0, sp + adds r1, r4, 0 + bl CpuFastSet + ldr r2, =0x03005dc0 + str r4, [r2, 0x8] + ldr r1, [r5] + adds r1, 0xF + str r1, [r2] + ldr r0, [r5, 0x4] + adds r0, 0xE + str r0, [r2, 0x4] + muls r1, r0 + movs r0, 0xA0 + lsls r0, 6 + cmp r1, r0 + bgt _08087E56 + ldr r0, [r5, 0xC] + ldrh r1, [r5] + ldrh r2, [r5, 0x4] + bl map_copy_with_padding + adds r0, r6, 0 + bl mapheader_copy_mapdata_of_adjacent_maps +_08087E56: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end mapheader_copy_mapdata_with_padding + + thumb_func_start map_copy_with_padding +@ int map_copy_with_padding(void *src) +map_copy_with_padding: @ 8087E70 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + lsls r2, 16 + lsrs r2, 16 + ldr r0, =0x03005dc0 + ldr r4, [r0, 0x8] + ldr r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 1 + adds r0, 0xE + adds r4, r0 + cmp r2, 0 + beq _08087EB8 + mov r0, r8 + lsls r6, r0, 1 + adds r5, r2, 0 + movs r0, 0x1E + adds r0, r6 + mov r9, r0 +_08087EA4: + adds r0, r7, 0 + adds r1, r4, 0 + mov r2, r8 + bl CpuSet + add r4, r9 + adds r7, r6 + subs r5, 0x1 + cmp r5, 0 + bne _08087EA4 +_08087EB8: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end map_copy_with_padding + + thumb_func_start mapheader_copy_mapdata_of_adjacent_maps +@ void mapheader_copy_mapdata_of_adjacent_maps(struct mapheader *mapHeader) +mapheader_copy_mapdata_of_adjacent_maps: @ 8087EC8 + push {r4-r7,lr} + adds r6, r0, 0 + ldr r0, [r6, 0xC] + cmp r0, 0 + beq _08087F4C + ldr r1, [r0] + ldr r5, [r0, 0x4] + ldr r2, =0x02037340 + ldr r0, =gUnknown_08486EF8 + ldr r0, [r0] + str r0, [r2] + cmp r1, 0 + ble _08087F4C + adds r4, r2, 0 + adds r7, r1, 0 +_08087EE6: + adds r0, r5, 0 + bl mapconnection_get_mapheader + adds r1, r0, 0 + ldr r2, [r5, 0x4] + ldrb r0, [r5] + cmp r0, 0x2 + beq _08087F1E + cmp r0, 0x2 + bgt _08087F08 + cmp r0, 0x1 + beq _08087F12 + b _08087F44 + .pool +_08087F08: + cmp r0, 0x3 + beq _08087F2A + cmp r0, 0x4 + beq _08087F36 + b _08087F44 +_08087F12: + adds r0, r6, 0 + bl sub_8087FB8 + ldrb r0, [r4] + movs r1, 0x1 + b _08087F40 +_08087F1E: + adds r0, r6, 0 + bl sub_8088020 + ldrb r0, [r4] + movs r1, 0x2 + b _08087F40 +_08087F2A: + adds r0, r6, 0 + bl sub_8088080 + ldrb r0, [r4] + movs r1, 0x4 + b _08087F40 +_08087F36: + adds r0, r6, 0 + bl sub_80880E0 + ldrb r0, [r4] + movs r1, 0x8 +_08087F40: + orrs r0, r1 + strb r0, [r4] +_08087F44: + subs r7, 0x1 + adds r5, 0xC + cmp r7, 0 + bne _08087EE6 +_08087F4C: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end mapheader_copy_mapdata_of_adjacent_maps + + thumb_func_start sub_8087F54 +sub_8087F54: @ 8087F54 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r5, [sp, 0x18] + ldr r4, [r2] + ldr r7, [r4] + adds r2, r7, 0 + muls r2, r5 + adds r2, r3 + lsls r2, 1 + ldr r3, [r4, 0xC] + adds r6, r3, r2 + ldr r3, =0x03005dc0 + ldr r2, [r3] + muls r1, r2 + adds r1, r0 + lsls r1, 1 + ldr r0, [r3, 0x8] + adds r5, r0, r1 + ldr r0, [sp, 0x20] + cmp r0, 0 + ble _08087FA6 + adds r4, r0, 0 + ldr r3, =0x001fffff + mov r8, r3 +_08087F86: + adds r0, r6, 0 + adds r1, r5, 0 + ldr r2, [sp, 0x1C] + mov r3, r8 + ands r2, r3 + bl CpuSet + ldr r0, =0x03005dc0 + ldr r0, [r0] + lsls r0, 1 + adds r5, r0 + lsls r0, r7, 1 + adds r6, r0 + subs r4, 0x1 + cmp r4, 0 + bne _08087F86 +_08087FA6: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8087F54 + + thumb_func_start sub_8087FB8 +sub_8087FB8: @ 8087FB8 + push {r4-r7,lr} + sub sp, 0xC + adds r3, r0, 0 + adds r5, r1, 0 + cmp r5, 0 + beq _08088012 + ldr r0, [r5] + ldr r4, [r0] + adds r2, 0x7 + ldr r0, [r3] + ldr r0, [r0, 0x4] + adds r7, r0, 0x7 + cmp r2, 0 + bge _08087FEC + negs r6, r2 + adds r2, r4 + ldr r0, =0x03005dc0 + ldr r3, [r0] + cmp r2, r3 + bge _08087FE2 + adds r3, r2, 0 +_08087FE2: + movs r2, 0 + b _08087FFC + .pool +_08087FEC: + movs r6, 0 + adds r0, r2, r4 + ldr r1, =0x03005dc0 + ldr r1, [r1] + subs r3, r1, r2 + cmp r0, r1 + bge _08087FFC + adds r3, r4, 0 +_08087FFC: + movs r0, 0 + str r0, [sp] + str r3, [sp, 0x4] + movs r0, 0x7 + str r0, [sp, 0x8] + adds r0, r2, 0 + adds r1, r7, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_8087F54 +_08088012: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8087FB8 + + thumb_func_start sub_8088020 +sub_8088020: @ 8088020 + push {r4-r7,lr} + sub sp, 0xC + adds r5, r1, 0 + cmp r5, 0 + beq _08088074 + ldr r0, [r5] + ldr r4, [r0] + ldr r0, [r0, 0x4] + adds r2, 0x7 + subs r7, r0, 0x7 + cmp r2, 0 + bge _08088050 + negs r6, r2 + adds r2, r4 + ldr r0, =0x03005dc0 + ldr r3, [r0] + cmp r2, r3 + bge _08088046 + adds r3, r2, 0 +_08088046: + movs r2, 0 + b _08088060 + .pool +_08088050: + movs r6, 0 + adds r0, r2, r4 + ldr r1, =0x03005dc0 + ldr r1, [r1] + subs r3, r1, r2 + cmp r0, r1 + bge _08088060 + adds r3, r4, 0 +_08088060: + str r7, [sp] + str r3, [sp, 0x4] + movs r0, 0x7 + str r0, [sp, 0x8] + adds r0, r2, 0 + movs r1, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_8087F54 +_08088074: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8088020 + + thumb_func_start sub_8088080 +sub_8088080: @ 8088080 + push {r4-r7,lr} + sub sp, 0xC + adds r5, r1, 0 + cmp r5, 0 + beq _080880D4 + ldr r0, [r5] + ldr r1, [r0] + ldr r4, [r0, 0x4] + adds r2, 0x7 + subs r7, r1, 0x7 + cmp r2, 0 + bge _080880B0 + negs r6, r2 + adds r1, r2, r4 + ldr r0, =0x03005dc0 + ldr r3, [r0, 0x4] + cmp r1, r3 + bge _080880A6 + adds r3, r1, 0 +_080880A6: + movs r2, 0 + b _080880C0 + .pool +_080880B0: + movs r6, 0 + adds r0, r2, r4 + ldr r1, =0x03005dc0 + ldr r1, [r1, 0x4] + subs r3, r1, r2 + cmp r0, r1 + bge _080880C0 + adds r3, r4, 0 +_080880C0: + str r6, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + str r3, [sp, 0x8] + movs r0, 0 + adds r1, r2, 0 + adds r2, r5, 0 + adds r3, r7, 0 + bl sub_8087F54 +_080880D4: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8088080 + + thumb_func_start sub_80880E0 +sub_80880E0: @ 80880E0 + push {r4-r7,lr} + sub sp, 0xC + adds r3, r0, 0 + adds r5, r1, 0 + cmp r5, 0 + beq _08088138 + ldr r0, [r5] + ldr r4, [r0, 0x4] + ldr r0, [r3] + ldr r0, [r0] + adds r7, r0, 0x7 + adds r2, 0x7 + cmp r2, 0 + bge _08088114 + negs r6, r2 + adds r1, r2, r4 + ldr r0, =0x03005dc0 + ldr r3, [r0, 0x4] + cmp r1, r3 + bge _0808810A + adds r3, r1, 0 +_0808810A: + movs r2, 0 + b _08088124 + .pool +_08088114: + movs r6, 0 + adds r0, r2, r4 + ldr r1, =0x03005dc0 + ldr r1, [r1, 0x4] + subs r3, r1, r2 + cmp r0, r1 + bge _08088124 + adds r3, r4, 0 +_08088124: + str r6, [sp] + movs r0, 0x8 + str r0, [sp, 0x4] + str r3, [sp, 0x8] + adds r0, r7, 0 + adds r1, r2, 0 + adds r2, r5, 0 + movs r3, 0 + bl sub_8087F54 +_08088138: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80880E0 + + thumb_func_start MapGridGetZCoordAt +@ u8 MapGridGetZCoordAt(s32 x, s32 y) +MapGridGetZCoordAt: @ 8088144 + push {r4,lr} + adds r2, r0, 0 + adds r4, r1, 0 + cmp r2, 0 + blt _08088174 + ldr r1, =0x03005dc0 + ldr r3, [r1] + cmp r2, r3 + bge _08088174 + cmp r4, 0 + blt _08088174 + ldr r0, [r1, 0x4] + cmp r4, r0 + bge _08088174 + adds r0, r3, 0 + muls r0, r4 + adds r0, r2, r0 + ldr r1, [r1, 0x8] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + b _08088196 + .pool +_08088174: + ldr r0, =0x02037318 + ldr r3, [r0] + adds r1, r2, 0x1 + movs r2, 0x1 + ands r1, r2 + adds r0, r4, 0x1 + ands r0, r2 + lsls r0, 1 + adds r1, r0 + ldr r0, [r3, 0x8] + lsls r1, 1 + adds r1, r0 + ldrh r1, [r1] + movs r2, 0xC0 + lsls r2, 4 + adds r0, r2, 0 + orrs r1, r0 +_08088196: + ldr r0, =0x000003ff + cmp r1, r0 + beq _080881A8 + lsrs r0, r1, 12 + b _080881AA + .pool +_080881A8: + movs r0, 0 +_080881AA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end MapGridGetZCoordAt + + thumb_func_start MapGridIsImpassableAt +@ u8 MapGridIsImpassableAt(s32 x, s32 y) +MapGridIsImpassableAt: @ 80881B0 + push {r4,lr} + adds r2, r0, 0 + adds r4, r1, 0 + cmp r2, 0 + blt _080881E0 + ldr r1, =0x03005dc0 + ldr r3, [r1] + cmp r2, r3 + bge _080881E0 + cmp r4, 0 + blt _080881E0 + ldr r0, [r1, 0x4] + cmp r4, r0 + bge _080881E0 + adds r0, r3, 0 + muls r0, r4 + adds r0, r2, r0 + ldr r1, [r1, 0x8] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + b _08088202 + .pool +_080881E0: + ldr r0, =0x02037318 + ldr r3, [r0] + adds r1, r2, 0x1 + movs r2, 0x1 + ands r1, r2 + adds r0, r4, 0x1 + ands r0, r2 + lsls r0, 1 + adds r1, r0 + ldr r0, [r3, 0x8] + lsls r1, 1 + adds r1, r0 + ldrh r1, [r1] + movs r2, 0xC0 + lsls r2, 4 + adds r0, r2, 0 + orrs r1, r0 +_08088202: + ldr r0, =0x000003ff + cmp r1, r0 + beq _0808821C + movs r0, 0xC0 + lsls r0, 4 + ands r1, r0 + lsrs r0, r1, 10 + b _0808821E + .pool +_0808821C: + movs r0, 0x1 +_0808821E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end MapGridIsImpassableAt + + thumb_func_start MapGridGetMetatileIdAt +@ u16 MapGridGetMetatileIdAt(s32 x, s32 y) +MapGridGetMetatileIdAt: @ 8088224 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + cmp r5, 0 + blt _08088254 + ldr r1, =0x03005dc0 + ldr r2, [r1] + cmp r5, r2 + bge _08088254 + cmp r6, 0 + blt _08088254 + ldr r0, [r1, 0x4] + cmp r6, r0 + bge _08088254 + adds r0, r2, 0 + muls r0, r6 + adds r0, r5, r0 + ldr r1, [r1, 0x8] + lsls r0, 1 + adds r0, r1 + ldrh r4, [r0] + b _08088278 + .pool +_08088254: + ldr r0, =0x02037318 + ldr r3, [r0] + adds r1, r5, 0x1 + movs r2, 0x1 + ands r1, r2 + adds r0, r6, 0x1 + ands r0, r2 + lsls r0, 1 + adds r1, r0 + ldr r0, [r3, 0x8] + lsls r1, 1 + adds r1, r0 + ldrh r1, [r1] + movs r2, 0xC0 + lsls r2, 4 + adds r0, r2, 0 + adds r4, r0, 0 + orrs r4, r1 +_08088278: + ldr r0, =0x000003ff + cmp r4, r0 + beq _0808828C + ands r4, r0 + adds r0, r4, 0 + b _080882B0 + .pool +_0808828C: + ldr r0, =0x02037318 + ldr r3, [r0] + adds r1, r5, 0x1 + movs r2, 0x1 + ands r1, r2 + adds r0, r6, 0x1 + ands r0, r2 + lsls r0, 1 + adds r1, r0 + ldr r0, [r3, 0x8] + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + movs r2, 0xC0 + lsls r2, 4 + adds r1, r2, 0 + orrs r0, r1 + ands r0, r4 +_080882B0: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end MapGridGetMetatileIdAt + + thumb_func_start MapGridGetMetatileBehaviorAt +@ u8 MapGridGetMetatileBehaviorAt(s32 x, s32 y) +MapGridGetMetatileBehaviorAt: @ 80882BC + push {lr} + bl MapGridGetMetatileIdAt + lsls r0, 16 + lsrs r0, 16 + bl GetBehaviorByMetatileId + adds r1, r0, 0 + movs r0, 0xFF + ands r0, r1 + pop {r1} + bx r1 + thumb_func_end MapGridGetMetatileBehaviorAt + + thumb_func_start MapGridGetMetatileLayerTypeAt +@ u8 MapGridGetMetatileLayerTypeAt(s32 x, s32 y) +MapGridGetMetatileLayerTypeAt: @ 80882D4 + push {lr} + bl MapGridGetMetatileIdAt + lsls r0, 16 + lsrs r0, 16 + bl GetBehaviorByMetatileId + adds r1, r0, 0 + movs r0, 0xF0 + lsls r0, 8 + ands r0, r1 + lsrs r0, 12 + pop {r1} + bx r1 + thumb_func_end MapGridGetMetatileLayerTypeAt + + thumb_func_start MapGridSetMetatileIdAt +@ void MapGridSetMetatileIdAt(s32 x, s32 y, u16 metatileId) +MapGridSetMetatileIdAt: @ 80882F0 + push {r4,r5,lr} + adds r3, r0, 0 + lsls r2, 16 + lsrs r5, r2, 16 + cmp r3, 0 + blt _08088328 + ldr r2, =0x03005dc0 + ldr r4, [r2] + cmp r3, r4 + bge _08088328 + cmp r1, 0 + blt _08088328 + ldr r0, [r2, 0x4] + cmp r1, r0 + bge _08088328 + muls r1, r4 + adds r1, r3, r1 + ldr r0, [r2, 0x8] + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + movs r2, 0xF0 + lsls r2, 8 + ands r2, r0 + ldr r0, =0x00000fff + ands r0, r5 + orrs r2, r0 + strh r2, [r1] +_08088328: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end MapGridSetMetatileIdAt + + thumb_func_start MapGridSetMetatileEntryAt +@ void MapGridSetMetatileEntryAt(s32 x, s32 y, u16 metatileEntry) +MapGridSetMetatileEntryAt: @ 8088338 + push {r4,r5,lr} + adds r3, r0, 0 + lsls r2, 16 + lsrs r5, r2, 16 + cmp r3, 0 + blt _08088364 + ldr r2, =0x03005dc0 + ldr r4, [r2] + cmp r3, r4 + bge _08088364 + cmp r1, 0 + blt _08088364 + ldr r0, [r2, 0x4] + cmp r1, r0 + bge _08088364 + adds r0, r4, 0 + muls r0, r1 + adds r0, r3, r0 + ldr r1, [r2, 0x8] + lsls r0, 1 + adds r0, r1 + strh r5, [r0] +_08088364: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end MapGridSetMetatileEntryAt + + thumb_func_start GetBehaviorByMetatileId +@ u16 GetBehaviorByMetatileId(u16 metatileId) +GetBehaviorByMetatileId: @ 8088370 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + adds r3, r2, 0 + ldr r0, =0x000001ff + cmp r2, r0 + bhi _08088394 + ldr r0, =0x02037318 + ldr r0, [r0] + ldr r0, [r0, 0x10] + ldr r1, [r0, 0x10] + lsls r0, r2, 1 + b _080883B2 + .pool +_08088394: + ldr r0, =0x000003ff + cmp r2, r0 + bls _080883A4 + movs r0, 0xFF + b _080883B6 + .pool +_080883A4: + ldr r0, =0x02037318 + ldr r0, [r0] + ldr r0, [r0, 0x14] + ldr r1, [r0, 0x10] + lsls r0, r3, 1 + adds r0, r1 + ldr r1, =0xfffffc00 +_080883B2: + adds r0, r1 + ldrh r0, [r0] +_080883B6: + pop {r1} + bx r1 + .pool + thumb_func_end GetBehaviorByMetatileId + + thumb_func_start save_serialize_map +save_serialize_map: @ 80883C4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =0x03005d8c + ldr r1, [r0] + adds r4, r1, 0 + adds r4, 0x34 + ldr r0, =0x03005dc0 + ldr r0, [r0] + mov r8, r0 + movs r0, 0 + ldrsh r6, [r1, r0] + movs r2, 0x2 + ldrsh r0, [r1, r2] + adds r1, r0, 0 + adds r1, 0xE + cmp r0, r1 + bge _08088420 + mov r12, r1 + ldr r1, =0x02032318 + mov r9, r1 + lsls r7, r6, 1 +_080883F2: + adds r1, r6, 0 + adds r3, r1, 0 + adds r3, 0xF + adds r5, r0, 0x1 + cmp r1, r3 + bge _0808841A + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + lsls r0, 1 + add r0, r9 + adds r2, r7, r0 + subs r1, r3, r1 +_0808840C: + ldrh r0, [r2] + strh r0, [r4] + adds r4, 0x2 + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bne _0808840C +_0808841A: + adds r0, r5, 0 + cmp r0, r12 + blt _080883F2 +_08088420: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end save_serialize_map + + thumb_func_start sub_8088438 +sub_8088438: @ 8088438 + push {r4,lr} + movs r2, 0 + movs r1, 0 + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r3, r0, 0 + adds r3, 0x34 + ldr r4, =0x000001ff +_08088448: + lsls r0, r1, 1 + adds r0, r3, r0 + ldrh r0, [r0] + orrs r2, r0 + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r4 + bls _08088448 + cmp r2, 0 + beq _0808846C + movs r0, 0 + b _0808846E + .pool +_0808846C: + movs r0, 0x1 +_0808846E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8088438 + + thumb_func_start sav2_mapdata_clear +sav2_mapdata_clear: @ 8088474 + push {lr} + sub sp, 0x4 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r0, =0x03005d8c + ldr r1, [r0] + adds r1, 0x34 + ldr r2, =0x01000100 + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sav2_mapdata_clear + + thumb_func_start mapdata_from_sav2 +mapdata_from_sav2: @ 808849C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + ldr r4, =0x03005d8c + ldr r0, [r4] + adds r7, r0, 0 + adds r7, 0x34 + bl sub_8088438 + cmp r0, 0 + bne _080885AC + ldr r0, =0x03005dc0 + ldr r0, [r0] + str r0, [sp] + ldr r0, [r4] + movs r2, 0 + ldrsh r1, [r0, r2] + mov r10, r1 + movs r2, 0x2 + ldrsh r1, [r0, r2] + mov r8, r1 + mov r6, r8 + adds r0, r6, 0 + adds r0, 0xE + cmp r6, r0 + bge _0808855A +_080884D6: + cmp r6, r8 + bne _080884EC + cmp r6, 0 + beq _080884EC + movs r0, 0 + mov r9, r0 + b _08088508 + .pool +_080884EC: + mov r0, r8 + adds r0, 0xD + movs r1, 0xFF + mov r9, r1 + cmp r6, r0 + bne _08088508 + ldr r0, =0x02037318 + ldr r0, [r0] + ldr r0, [r0, 0x4] + subs r0, 0x1 + cmp r6, r0 + beq _08088508 + movs r2, 0x1 + mov r9, r2 +_08088508: + mov r5, r10 + adds r0, r5, 0 + adds r0, 0xF + mov r1, r8 + adds r1, 0xE + str r1, [sp, 0x8] + adds r2, r6, 0x1 + str r2, [sp, 0x4] + cmp r5, r0 + bge _08088552 + ldr r0, [sp] + lsls r3, r0, 16 +_08088520: + ldr r1, [sp] + adds r0, r1, 0 + muls r0, r6 + adds r0, r5, r0 + lsls r0, 1 + ldr r1, =0x02032318 + adds r4, r0, r1 + adds r0, r4, 0 + lsrs r1, r3, 16 + mov r2, r9 + str r3, [sp, 0xC] + bl sub_8088BF0 + lsls r0, 24 + ldr r3, [sp, 0xC] + cmp r0, 0 + bne _08088546 + ldrh r0, [r7] + strh r0, [r4] +_08088546: + adds r7, 0x2 + adds r5, 0x1 + mov r0, r10 + adds r0, 0xF + cmp r5, r0 + blt _08088520 +_08088552: + ldr r6, [sp, 0x4] + ldr r2, [sp, 0x8] + cmp r6, r2 + blt _080884D6 +_0808855A: + mov r5, r10 + adds r0, r5, 0 + adds r0, 0xF + cmp r5, r0 + bge _080885A8 + mov r0, r8 + subs r0, 0x1 + lsls r0, 16 + mov r9, r0 + lsls r4, r5, 16 + mov r0, r8 + adds r0, 0xD + lsls r7, r0, 16 +_08088574: + mov r0, r8 + cmp r0, 0 + beq _08088584 + asrs r0, r4, 16 + mov r2, r9 + asrs r1, r2, 16 + bl sub_80D423C +_08088584: + ldr r0, =0x02037318 + ldr r0, [r0] + ldr r0, [r0, 0x4] + subs r0, 0x1 + cmp r6, r0 + bge _08088598 + asrs r0, r4, 16 + asrs r1, r7, 16 + bl sub_80D42B8 +_08088598: + movs r0, 0x80 + lsls r0, 9 + adds r4, r0 + adds r5, 0x1 + mov r0, r10 + adds r0, 0xF + cmp r5, r0 + blt _08088574 +_080885A8: + bl sav2_mapdata_clear +_080885AC: + 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 mapdata_from_sav2 + + thumb_func_start sub_80885C4 +sub_80885C4: @ 80885C4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r3, r0, 24 + adds r2, r3, 0 + ldr r0, =0x03005d8c + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x34 + str r0, [sp, 0x4] + ldr r0, =0x03005dc0 + ldr r0, [r0] + str r0, [sp] + movs r4, 0 + mov r9, r4 + mov r8, r4 + movs r0, 0 + ldrsh r6, [r1, r0] + str r6, [sp, 0x8] + movs r4, 0x2 + ldrsh r5, [r1, r4] + movs r7, 0xF + movs r6, 0xE + mov r12, r6 + cmp r3, 0x2 + beq _0808861E + cmp r3, 0x2 + bgt _08088614 + cmp r3, 0x1 + beq _08088626 + b _0808863E + .pool +_08088614: + cmp r2, 0x3 + beq _08088630 + cmp r2, 0x4 + beq _08088638 + b _0808863E +_0808861E: + adds r5, 0x1 + movs r0, 0xD + mov r12, r0 + b _0808863E +_08088626: + movs r1, 0x1 + mov r8, r1 + movs r3, 0xD + mov r12, r3 + b _0808863E +_08088630: + ldr r4, [sp, 0x8] + adds r4, 0x1 + str r4, [sp, 0x8] + b _0808863C +_08088638: + movs r6, 0x1 + mov r9, r6 +_0808863C: + movs r7, 0xE +_0808863E: + movs r1, 0 + cmp r1, r12 + bge _08088682 + ldr r0, =0x02032318 + mov r10, r0 +_08088648: + adds r4, r1, 0x1 + cmp r7, 0 + beq _0808867C + adds r0, r1, r5 + ldr r3, [sp] + adds r2, r3, 0 + muls r2, r0 + add r1, r8 + lsls r0, r1, 4 + subs r0, r1 + add r0, r9 + ldr r6, [sp, 0x8] + adds r2, r6, r2 + adds r3, r7, 0 + lsls r2, 1 + add r2, r10 + lsls r0, 1 + ldr r6, [sp, 0x4] + adds r1, r0, r6 +_0808866E: + ldrh r0, [r1] + strh r0, [r2] + adds r1, 0x2 + adds r2, 0x2 + subs r3, 0x1 + cmp r3, 0 + bne _0808866E +_0808867C: + adds r1, r4, 0 + cmp r1, r12 + blt _08088648 +_08088682: + bl sav2_mapdata_clear + 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_80885C4 + + thumb_func_start GetMapBorderIdAt +@ u32 GetMapBorderIdAt(s32 x, s32 y) +GetMapBorderIdAt: @ 808869C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + cmp r4, 0 + blt _080886D8 + ldr r1, =0x03005dc0 + ldr r2, [r1] + cmp r4, r2 + bge _080886D8 + cmp r5, 0 + blt _080886D8 + ldr r0, [r1, 0x4] + cmp r5, r0 + bge _080886D8 + adds r0, r2, 0 + muls r0, r5 + adds r0, r4, r0 + ldr r1, [r1, 0x8] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + ldr r0, =0x000003ff + cmp r1, r0 + beq _08088770 + b _08088700 + .pool +_080886D8: + ldr r0, =0x02037318 + ldr r3, [r0] + adds r1, r4, 0x1 + movs r2, 0x1 + ands r1, r2 + adds r0, r5, 0x1 + ands r0, r2 + lsls r0, 1 + adds r1, r0 + ldr r0, [r3, 0x8] + lsls r1, 1 + adds r1, r0 + ldrh r1, [r1] + movs r2, 0xC0 + lsls r2, 4 + adds r0, r2, 0 + orrs r0, r1 + ldr r1, =0x000003ff + cmp r0, r1 + beq _08088770 +_08088700: + ldr r1, =0x03005dc0 + ldr r0, [r1] + subs r0, 0x8 + cmp r4, r0 + blt _0808872C + ldr r0, =0x02037340 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08088770 + movs r0, 0x4 + b _08088782 + .pool +_0808872C: + cmp r4, 0x6 + bgt _08088744 + ldr r0, =0x02037340 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08088770 + movs r0, 0x3 + b _08088782 + .pool +_08088744: + ldr r0, [r1, 0x4] + subs r0, 0x7 + cmp r5, r0 + blt _08088760 + ldr r0, =0x02037340 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08088770 + movs r0, 0x1 + b _08088782 + .pool +_08088760: + cmp r5, 0x6 + bgt _08088780 + ldr r0, =0x02037340 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0808877C +_08088770: + movs r0, 0x1 + negs r0, r0 + b _08088782 + .pool +_0808877C: + movs r0, 0x2 + b _08088782 +_08088780: + movs r0, 0 +_08088782: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end GetMapBorderIdAt + + thumb_func_start GetPostCameraMoveMapBorderId +@ u32 GetPostCameraMoveMapBorderId(s32 deltaX, s32 deltaY) +GetPostCameraMoveMapBorderId: @ 8088788 + push {r4,lr} + adds r3, r1, 0 + ldr r1, =0x03005d8c + ldr r1, [r1] + movs r4, 0 + ldrsh r2, [r1, r4] + adds r0, 0x7 + adds r2, r0 + movs r0, 0x2 + ldrsh r1, [r1, r0] + adds r3, 0x7 + adds r1, r3 + adds r0, r2, 0 + bl GetMapBorderIdAt + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetPostCameraMoveMapBorderId + + thumb_func_start CanCameraMoveInDirection +@ bool32 CanCameraMoveInDirection(u8 direction) +CanCameraMoveInDirection: @ 80887B0 + push {r4,r5,lr} + ldr r1, =0x03005d8c + ldr r4, [r1] + movs r1, 0 + ldrsh r3, [r4, r1] + ldr r2, =gUnknown_08339D64 + lsls r0, 3 + adds r1, r0, r2 + ldr r1, [r1] + adds r1, 0x7 + adds r3, r1 + movs r5, 0x2 + ldrsh r1, [r4, r5] + adds r2, 0x4 + adds r0, r2 + ldr r0, [r0] + adds r0, 0x7 + adds r1, r0 + adds r0, r3, 0 + bl GetMapBorderIdAt + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080887F0 + movs r0, 0x1 + b _080887F2 + .pool +_080887F0: + movs r0, 0 +_080887F2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end CanCameraMoveInDirection + + thumb_func_start sub_80887F8 +sub_80887F8: @ 80887F8 + push {r4-r7,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r6, r2, 0 + adds r7, r3, 0 + bl mapconnection_get_mapheader + adds r3, r0, 0 + cmp r4, 0x2 + beq _08088860 + cmp r4, 0x2 + bgt _08088816 + cmp r4, 0x1 + beq _0808884C + b _08088872 +_08088816: + cmp r4, 0x3 + beq _08088834 + cmp r4, 0x4 + bne _08088872 + ldr r0, =0x03005d8c + ldr r1, [r0] + negs r0, r6 + strh r0, [r1] + ldr r2, [r5, 0x4] + ldrh r0, [r1, 0x2] + subs r0, r2 + b _08088870 + .pool +_08088834: + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, [r3] + ldr r0, [r0] + strh r0, [r1] + ldr r2, [r5, 0x4] + ldrh r0, [r1, 0x2] + subs r0, r2 + b _08088870 + .pool +_0808884C: + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r2, [r5, 0x4] + ldrh r0, [r1] + subs r0, r2 + strh r0, [r1] + negs r0, r7 + b _08088870 + .pool +_08088860: + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r2, [r5, 0x4] + ldrh r0, [r1] + subs r0, r2 + strh r0, [r1] + ldr r0, [r3] + ldr r0, [r0, 0x4] +_08088870: + strh r0, [r1, 0x2] +_08088872: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80887F8 + + thumb_func_start CameraMove +@ u8 CameraMove(s32 deltaX, s32 deltaY) +CameraMove: @ 808887C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r0 + mov r9, r1 + ldr r1, =0x02037334 + ldrb r0, [r1] + movs r1, 0x2 + negs r1, r1 + ands r1, r0 + ldr r2, =0x02037334 + strb r1, [r2] + mov r0, r10 + mov r1, r9 + bl GetPostCameraMoveMapBorderId + adds r7, r0, 0 + adds r0, r7, 0x1 + cmp r0, 0x1 + bhi _080888C4 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldrh r0, [r1] + add r0, r10 + strh r0, [r1] + ldrh r0, [r1, 0x2] + add r0, r9 + strh r0, [r1, 0x2] + b _08088932 + .pool +_080888C4: + bl save_serialize_map + bl sub_81BE72C + ldr r1, =0x03005d8c + ldr r0, [r1] + movs r2, 0 + ldrsh r5, [r0, r2] + movs r1, 0x2 + ldrsh r6, [r0, r1] + lsls r2, r7, 24 + lsrs r2, 24 + mov r8, r2 + mov r0, r8 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_8088950 + adds r4, r0, 0 + adds r1, r7, 0 + mov r2, r10 + mov r3, r9 + bl sub_80887F8 + ldrb r0, [r4, 0x8] + ldrb r1, [r4, 0x9] + bl mliX_load_map + ldr r1, =0x02037334 + ldrb r0, [r1] + movs r1, 0x1 + orrs r0, r1 + ldr r2, =0x02037334 + strb r0, [r2] + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r2, 0 + ldrsh r0, [r1, r2] + subs r5, r0 + ldr r0, =0x02037334 + str r5, [r0, 0x4] + movs r2, 0x2 + ldrsh r0, [r1, r2] + subs r6, r0 + ldr r0, =0x02037334 + str r6, [r0, 0x8] + ldrh r0, [r1] + add r0, r10 + strh r0, [r1] + ldrh r0, [r1, 0x2] + add r0, r9 + strh r0, [r1, 0x2] + mov r0, r8 + bl sub_80885C4 +_08088932: + ldr r0, =0x02037334 + ldrb r0, [r0] + lsls r0, 31 + lsrs r0, 31 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end CameraMove + + thumb_func_start sub_8088950 +sub_8088950: @ 8088950 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r1 + mov r8, r2 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x02037318 + ldr r0, [r0, 0xC] + ldr r7, [r0] + ldr r4, [r0, 0x4] + movs r5, 0 + cmp r5, r7 + bge _08088998 +_0808896E: + ldrb r0, [r4] + cmp r0, r6 + bne _08088990 + adds r0, r6, 0 + mov r1, r9 + mov r2, r8 + adds r3, r4, 0 + bl sub_80889A8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08088990 + adds r0, r4, 0 + b _0808899A + .pool +_08088990: + adds r5, 0x1 + adds r4, 0xC + cmp r5, r7 + blt _0808896E +_08088998: + movs r0, 0 +_0808899A: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8088950 + + thumb_func_start sub_80889A8 +sub_80889A8: @ 80889A8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r1, 0 + mov r8, r2 + adds r5, r3, 0 + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + adds r0, r5, 0 + bl mapconnection_get_mapheader + adds r2, r0, 0 + cmp r4, 0x1 + blt _08088A00 + cmp r4, 0x2 + bgt _080889E0 + ldr r0, =0x02037318 + ldr r0, [r0] + ldr r1, [r0] + ldr r0, [r2] + ldr r2, [r0] + ldr r3, [r5, 0x4] + adds r0, r7, 0 + b _080889F2 + .pool +_080889E0: + cmp r6, 0x4 + bgt _08088A00 + ldr r0, =0x02037318 + ldr r0, [r0] + ldr r1, [r0, 0x4] + ldr r0, [r2] + ldr r2, [r0, 0x4] + ldr r3, [r5, 0x4] + mov r0, r8 +_080889F2: + bl sub_8088A0C + lsls r0, 24 + lsrs r0, 24 + b _08088A02 + .pool +_08088A00: + movs r0, 0 +_08088A02: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80889A8 + + thumb_func_start sub_8088A0C +sub_8088A0C: @ 8088A0C + push {r4,lr} + adds r4, r0, 0 + adds r0, r2, 0 + adds r2, r3, 0 + cmp r3, 0 + bge _08088A1A + movs r3, 0 +_08088A1A: + adds r2, r0, r2 + cmp r2, r1 + bge _08088A22 + adds r1, r2, 0 +_08088A22: + cmp r3, r4 + bgt _08088A2E + cmp r4, r1 + bgt _08088A2E + movs r0, 0x1 + b _08088A30 +_08088A2E: + movs r0, 0 +_08088A30: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8088A0C + + thumb_func_start sub_8088A38 +sub_8088A38: @ 8088A38 + push {lr} + cmp r0, 0 + blt _08088A46 + cmp r0, r1 + bge _08088A46 + movs r0, 0x1 + b _08088A48 +_08088A46: + movs r0, 0 +_08088A48: + pop {r1} + bx r1 + thumb_func_end sub_8088A38 + + thumb_func_start sub_8088A4C +sub_8088A4C: @ 8088A4C + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + bl mapconnection_get_mapheader + adds r1, r0, 0 + ldrb r0, [r4] + cmp r0, 0x1 + blt _08088A84 + cmp r0, 0x2 + bgt _08088A72 + ldr r0, [r4, 0x4] + subs r0, r5, r0 + ldr r1, [r1] + ldr r1, [r1] + bl sub_8088A38 + b _08088A86 +_08088A72: + cmp r0, 0x4 + bgt _08088A84 + ldr r0, [r4, 0x4] + subs r0, r6, r0 + ldr r1, [r1] + ldr r1, [r1, 0x4] + bl sub_8088A38 + b _08088A86 +_08088A84: + movs r0, 0 +_08088A86: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8088A4C + + thumb_func_start sub_8088A8C +sub_8088A8C: @ 8088A8C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r2, =0x02037318 + ldr r0, [r2, 0xC] + cmp r0, 0 + bne _08088AB4 + b _08088B2A + .pool +_08088AB0: + adds r0, r4, 0 + b _08088B2C +_08088AB4: + ldr r7, [r0] + ldr r4, [r0, 0x4] + movs r6, 0 + cmp r6, r7 + bge _08088B2A + lsls r0, r1, 16 + asrs r5, r0, 16 + mov r9, r2 + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + mov r10, r0 +_08088ACC: + ldrb r1, [r4] + adds r3, r1, 0 + subs r0, r1, 0x5 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _08088B22 + cmp r1, 0x2 + bne _08088AE2 + cmp r5, 0x6 + bgt _08088B22 +_08088AE2: + cmp r1, 0x1 + bne _08088AF2 + mov r2, r9 + ldr r0, [r2] + ldr r0, [r0, 0x4] + adds r0, 0x7 + cmp r5, r0 + blt _08088B22 +_08088AF2: + mov r0, r8 + lsls r2, r0, 16 + cmp r1, 0x3 + bne _08088B00 + mov r1, r10 + cmp r1, 0x6 + bgt _08088B22 +_08088B00: + cmp r3, 0x4 + bne _08088B12 + asrs r1, r2, 16 + mov r3, r9 + ldr r0, [r3] + ldr r0, [r0] + adds r0, 0x7 + cmp r1, r0 + blt _08088B22 +_08088B12: + asrs r1, r2, 16 + subs r1, 0x7 + adds r0, r4, 0 + subs r2, r5, 0x7 + bl sub_8088A4C + cmp r0, 0x1 + beq _08088AB0 +_08088B22: + adds r6, 0x1 + adds r4, 0xC + cmp r6, r7 + blt _08088ACC +_08088B2A: + movs r0, 0 +_08088B2C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8088A8C + + thumb_func_start sub_8088B3C +sub_8088B3C: @ 8088B3C + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + ldr r2, =0x03005d8c + ldr r2, [r2] + subs r0, 0x7 + strh r0, [r2] + subs r1, 0x7 + strh r1, [r2, 0x2] + bx lr + .pool + thumb_func_end sub_8088B3C + + thumb_func_start sav1_camera_get_focus_coords +sav1_camera_get_focus_coords: @ 8088B58 + ldr r2, =0x03005d8c + ldr r3, [r2] + ldrh r2, [r3] + adds r2, 0x7 + strh r2, [r0] + ldrh r0, [r3, 0x2] + adds r0, 0x7 + strh r0, [r1] + bx lr + .pool + thumb_func_end sav1_camera_get_focus_coords + + thumb_func_start SetCameraCoords +@ void SetCameraCoords(u16 x, u16 y) +SetCameraCoords: @ 8088B70 + ldr r2, =0x03005d8c + ldr r2, [r2] + strh r0, [r2] + strh r1, [r2, 0x2] + bx lr + .pool + thumb_func_end SetCameraCoords + + thumb_func_start GetCameraCoords +@ void GetCameraCoords(u16 *x, u16 *y) +GetCameraCoords: @ 8088B80 + ldr r2, =0x03005d8c + ldr r3, [r2] + ldrh r2, [r3] + strh r2, [r0] + ldrh r0, [r3, 0x2] + strh r0, [r1] + bx lr + .pool + thumb_func_end GetCameraCoords + + thumb_func_start sub_8088B94 +sub_8088B94: @ 8088B94 + push {r4,r5,lr} + adds r4, r0, 0 + adds r3, r1, 0 + adds r5, r2, 0 + cmp r4, 0 + blt _08088BE6 + ldr r2, =0x03005dc0 + ldr r1, [r2] + cmp r4, r1 + bge _08088BE6 + cmp r3, 0 + blt _08088BE6 + ldr r0, [r2, 0x4] + cmp r3, r0 + bge _08088BE6 + cmp r5, 0 + beq _08088BD4 + adds r0, r1, 0 + muls r0, r3 + adds r0, r4, r0 + ldr r1, [r2, 0x8] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r3, 0xC0 + lsls r3, 4 + adds r2, r3, 0 + orrs r1, r2 + strh r1, [r0] + b _08088BE6 + .pool +_08088BD4: + muls r1, r3 + adds r1, r4, r1 + ldr r0, [r2, 0x8] + lsls r1, 1 + adds r1, r0 + ldrh r2, [r1] + ldr r0, =0x0000f3ff + ands r0, r2 + strh r0, [r1] +_08088BE6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8088B94 + + thumb_func_start sub_8088BF0 +sub_8088BF0: @ 8088BF0 + push {lr} + adds r3, r0, 0 + lsls r1, 16 + lsrs r0, r1, 16 + adds r1, r0, 0 + lsls r2, 24 + lsrs r2, 24 + cmp r2, 0xFF + beq _08088C24 + cmp r2, 0 + bne _08088C0C + lsls r0, 1 + subs r3, r0 + b _08088C10 +_08088C0C: + lsls r0, r1, 1 + adds r3, r0 +_08088C10: + ldrh r1, [r3] + ldr r0, =0x000003ff + ands r0, r1 + adds r1, r2, 0 + bl sub_80FADE4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08088C2C +_08088C24: + movs r0, 0 + b _08088C2E + .pool +_08088C2C: + movs r0, 0x1 +_08088C2E: + pop {r1} + bx r1 + thumb_func_end sub_8088BF0 + + thumb_func_start copy_tileset_patterns_to_vram +@ void copy_tileset_patterns_to_vram(tileset *tileset, int num_tiles, int offset) +copy_tileset_patterns_to_vram: @ 8088C34 + push {r4-r7,lr} + sub sp, 0x4 + adds r3, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + adds r6, r4, 0 + lsls r2, 16 + lsrs r5, r2, 16 + adds r7, r5, 0 + cmp r3, 0 + beq _08088C70 + ldrb r0, [r3] + cmp r0, 0 + bne _08088C60 + ldr r1, [r3, 0x4] + lsls r2, r4, 21 + lsrs r2, 16 + movs r0, 0x2 + adds r3, r5, 0 + bl LoadBgTiles + b _08088C70 +_08088C60: + ldr r1, [r3, 0x4] + lsls r2, r6, 5 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + adds r3, r7, 0 + bl decompress_and_copy_tile_data_to_vram +_08088C70: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end copy_tileset_patterns_to_vram + + thumb_func_start copy_tileset_patterns_to_vram2 +@ void copy_tileset_patterns_to_vram2(tileset *tileset, int num_tiles, int offset) +copy_tileset_patterns_to_vram2: @ 8088C78 + push {r4-r7,lr} + sub sp, 0x4 + adds r3, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + adds r6, r4, 0 + lsls r2, 16 + lsrs r5, r2, 16 + adds r7, r5, 0 + cmp r3, 0 + beq _08088CB4 + ldrb r0, [r3] + cmp r0, 0 + bne _08088CA4 + ldr r1, [r3, 0x4] + lsls r2, r4, 21 + lsrs r2, 16 + movs r0, 0x2 + adds r3, r5, 0 + bl LoadBgTiles + b _08088CB4 +_08088CA4: + ldr r1, [r3, 0x4] + lsls r2, r6, 5 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + adds r3, r7, 0 + bl copy_decompressed_tile_data_to_vram_autofree +_08088CB4: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end copy_tileset_patterns_to_vram2 + + thumb_func_start nullsub_3 +nullsub_3: @ 8088CBC + bx lr + thumb_func_end nullsub_3 + + thumb_func_start nullsub_90 +nullsub_90: @ 8088CC0 + bx lr + thumb_func_end nullsub_90 + + thumb_func_start apply_map_tileset_palette +@ void apply_map_tileset_palette(tileset *tileset, int dest_offset, int size) +apply_map_tileset_palette: @ 8088CC4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + mov r8, r5 + lsls r6, r2, 16 + lsrs r7, r6, 16 + adds r2, r7, 0 + movs r1, 0 + mov r0, sp + strh r1, [r0] + cmp r4, 0 + beq _08088D42 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _08088D18 + mov r0, sp + adds r1, r5, 0 + movs r2, 0x2 + bl gpu_pal_apply + ldr r0, [r4, 0x8] + adds r0, 0x2 + adds r5, 0x1 + lsls r5, 16 + lsrs r5, 16 + subs r4, r7, 0x2 + lsls r2, r4, 16 + lsrs r2, 16 + adds r1, r5, 0 + bl gpu_pal_apply + lsls r4, 15 + lsrs r4, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl nullsub_3 + b _08088D42 +_08088D18: + cmp r0, 0x1 + bne _08088D32 + ldr r0, [r4, 0x8] + adds r0, 0xC0 + adds r1, r5, 0 + adds r2, r7, 0 + bl gpu_pal_apply + lsrs r1, r6, 17 + adds r0, r5, 0 + bl nullsub_3 + b _08088D42 +_08088D32: + ldr r0, [r4, 0x8] + mov r1, r8 + bl decompress_palette + lsrs r1, r6, 17 + mov r0, r8 + bl nullsub_3 +_08088D42: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end apply_map_tileset_palette + + thumb_func_start copy_map_tileset1_to_vram +@ void copy_map_tileset1_to_vram(mapdata_header *a1) +copy_map_tileset1_to_vram: @ 8088D50 + push {lr} + ldr r0, [r0, 0x10] + movs r1, 0x80 + lsls r1, 2 + movs r2, 0 + bl copy_tileset_patterns_to_vram + pop {r0} + bx r0 + thumb_func_end copy_map_tileset1_to_vram + + thumb_func_start copy_map_tileset2_to_vram +@ void copy_map_tileset2_to_vram(mapdata_header *a1) +copy_map_tileset2_to_vram: @ 8088D64 + push {lr} + ldr r0, [r0, 0x14] + movs r2, 0x80 + lsls r2, 2 + adds r1, r2, 0 + bl copy_tileset_patterns_to_vram + pop {r0} + bx r0 + thumb_func_end copy_map_tileset2_to_vram + + thumb_func_start copy_map_tileset2_to_vram_2 +@ void copy_map_tileset2_to_vram_2(mapdata_header *a1) +copy_map_tileset2_to_vram_2: @ 8088D78 + push {lr} + ldr r0, [r0, 0x14] + movs r2, 0x80 + lsls r2, 2 + adds r1, r2, 0 + bl copy_tileset_patterns_to_vram2 + pop {r0} + bx r0 + thumb_func_end copy_map_tileset2_to_vram_2 + + thumb_func_start apply_map_tileset1_palette +@ void apply_map_tileset1_palette(mapdata_header *a1) +apply_map_tileset1_palette: @ 8088D8C + push {lr} + ldr r0, [r0, 0x10] + movs r1, 0 + movs r2, 0xC0 + bl apply_map_tileset_palette + pop {r0} + bx r0 + thumb_func_end apply_map_tileset1_palette + + thumb_func_start apply_map_tileset2_palette +@ void apply_map_tileset2_palette(mapdata_header *a1) +apply_map_tileset2_palette: @ 8088D9C + push {lr} + ldr r0, [r0, 0x14] + movs r1, 0x60 + movs r2, 0xE0 + bl apply_map_tileset_palette + pop {r0} + bx r0 + thumb_func_end apply_map_tileset2_palette + + thumb_func_start copy_map_tileset1_tileset2_to_vram +@ void copy_map_tileset1_tileset2_to_vram(mapdata_header *a1) +copy_map_tileset1_tileset2_to_vram: @ 8088DAC + push {r4,r5,lr} + adds r5, r0, 0 + cmp r5, 0 + beq _08088DCC + ldr r0, [r5, 0x10] + movs r4, 0x80 + lsls r4, 2 + adds r1, r4, 0 + movs r2, 0 + bl copy_tileset_patterns_to_vram2 + ldr r0, [r5, 0x14] + adds r1, r4, 0 + adds r2, r4, 0 + bl copy_tileset_patterns_to_vram2 +_08088DCC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end copy_map_tileset1_tileset2_to_vram + + thumb_func_start apply_map_tileset1_tileset2_palette +@ void apply_map_tileset1_tileset2_palette(mapdata_header *a1) +apply_map_tileset1_tileset2_palette: @ 8088DD4 + push {r4,lr} + adds r4, r0, 0 + cmp r4, 0 + beq _08088DE6 + bl apply_map_tileset1_palette + adds r0, r4, 0 + bl apply_map_tileset2_palette +_08088DE6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end apply_map_tileset1_tileset2_palette + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/flag.s b/asm/flag.s new file mode 100644 index 000000000..b4ef7bfa4 --- /dev/null +++ b/asm/flag.s @@ -0,0 +1,126 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start GetFlagPointer +@ u8 *GetFlagPointer(u16 flagId) +GetFlagPointer: @ 809D6EC + push {lr} + lsls r1, r0, 16 + lsrs r2, r1, 16 + adds r3, r2, 0 + cmp r2, 0 + bne _0809D6FC + movs r0, 0 + b _0809D72E +_0809D6FC: + ldr r0, =0x00003fff + cmp r2, r0 + bhi _0809D71C + ldr r0, =0x03005d8c + lsrs r1, 19 + ldr r2, =0x00001270 + adds r1, r2 + ldr r0, [r0] + b _0809D72C + .pool +_0809D71C: + ldr r1, =0xffffc000 + adds r0, r3, r1 + cmp r0, 0 + bge _0809D728 + ldr r2, =0xffffc007 + adds r0, r3, r2 +_0809D728: + asrs r0, 3 + ldr r1, =0x020375fc +_0809D72C: + adds r0, r1 +_0809D72E: + pop {r1} + bx r1 + .pool + thumb_func_end GetFlagPointer + + thumb_func_start FlagSet +@ bool8 FlagSet(u16 flagId) +FlagSet: @ 809D740 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl GetFlagPointer + adds r2, r0, 0 + cmp r2, 0 + beq _0809D760 + movs r0, 0x7 + ands r0, r4 + movs r1, 0x1 + lsls r1, r0 + ldrb r0, [r2] + orrs r1, r0 + strb r1, [r2] +_0809D760: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end FlagSet + + thumb_func_start FlagReset +@ bool8 FlagReset(u16 flagId) +FlagReset: @ 809D768 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl GetFlagPointer + adds r2, r0, 0 + cmp r2, 0 + beq _0809D788 + movs r0, 0x7 + ands r0, r4 + movs r1, 0x1 + lsls r1, r0 + ldrb r0, [r2] + bics r0, r1 + strb r0, [r2] +_0809D788: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end FlagReset + + thumb_func_start FlagGet +@ bool8 FlagGet(u16 flagId) +FlagGet: @ 809D790 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl GetFlagPointer + cmp r0, 0 + beq _0809D7B4 + ldrb r0, [r0] + movs r1, 0x7 + ands r1, r4 + asrs r0, r1 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0809D7B4 + movs r0, 0x1 + b _0809D7B6 +_0809D7B4: + movs r0, 0 +_0809D7B6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end FlagGet + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/fldeff_80F9BCC.s b/asm/fldeff_80F9BCC.s new file mode 100644 index 000000000..f31fc9771 --- /dev/null +++ b/asm/fldeff_80F9BCC.s @@ -0,0 +1,2514 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80F9BCC +sub_80F9BCC: @ 80F9BCC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r3, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =sub_80F9C90 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_80F9C44 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F9BCC + + thumb_func_start sub_80F9BF4 +sub_80F9BF4: @ 80F9BF4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r3, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =sub_80F9DFC + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_80F9C44 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F9BF4 + + thumb_func_start sub_80F9C1C +sub_80F9C1C: @ 80F9C1C + push {lr} + ldr r0, =sub_80F9C90 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80F9C1C + + thumb_func_start sub_80F9C30 +sub_80F9C30: @ 80F9C30 + push {lr} + ldr r0, =sub_80F9DFC + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80F9C30 + + thumb_func_start sub_80F9C44 +sub_80F9C44: @ 80F9C44 + push {r4,r5,lr} + lsls r1, 16 + lsrs r4, r1, 16 + adds r5, r4, 0 + lsls r3, 24 + lsrs r3, 24 + adds r1, r3, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r1 + movs r0, 0 + strh r0, [r1, 0x8] + movs r0, 0x10 + cmp r4, 0 + beq _080F9C72 + adds r0, r4, 0 +_080F9C72: + strh r0, [r1, 0xA] + movs r0, 0x14 + cmp r5, 0 + beq _080F9C7C + adds r0, r5, 0 +_080F9C7C: + strh r0, [r1, 0xC] + ldr r1, [r1] + adds r0, r2, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F9C44 + + thumb_func_start sub_80F9C90 +sub_80F9C90: @ 80F9C90 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080F9D10 + cmp r0, 0x1 + bgt _080F9CB8 + cmp r0, 0 + beq _080F9CC2 + b _080F9DDE + .pool +_080F9CB8: + cmp r0, 0x2 + beq _080F9D32 + cmp r0, 0x3 + beq _080F9D94 + b _080F9DDE +_080F9CC2: + movs r0, 0x78 + strh r0, [r4, 0xE] + strh r0, [r4, 0x10] + movs r0, 0x50 + strh r0, [r4, 0x12] + movs r0, 0x51 + strh r0, [r4, 0x14] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl SetGpuRegBits + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x10] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl SetGpuReg + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x14] + 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, 0 + bl SetGpuReg + b _080F9DEE +_080F9D10: + movs r0, 0x50 + bl GetGpuReg + strh r0, [r4, 0x16] + movs r0, 0x54 + bl GetGpuReg + strh r0, [r4, 0x18] + movs r0, 0x50 + movs r1, 0xBF + bl SetGpuReg + movs r0, 0x54 + movs r1, 0x10 + bl SetGpuReg + b _080F9DEE +_080F9D32: + ldrh r0, [r4, 0xE] + ldrh r1, [r4, 0xA] + subs r0, r1 + movs r5, 0 + strh r0, [r4, 0xE] + ldrh r2, [r4, 0x10] + adds r1, r2 + strh r1, [r4, 0x10] + lsls r0, 16 + cmp r0, 0 + ble _080F9D50 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xEF + ble _080F9D76 +_080F9D50: + strh r5, [r4, 0xE] + movs r0, 0xF0 + strh r0, [r4, 0x10] + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + ldrh r1, [r4, 0x16] + movs r0, 0x50 + bl SetGpuReg + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + movs r2, 0 + bl sub_80A2A20 + ldr r0, =0x02037b14 + strh r5, [r0] +_080F9D76: + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x10] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl SetGpuReg + movs r1, 0xE + ldrsh r0, [r4, r1] + b _080F9DD8 + .pool +_080F9D94: + ldrh r0, [r4, 0x12] + ldrh r1, [r4, 0xC] + subs r0, r1 + strh r0, [r4, 0x12] + ldrh r2, [r4, 0x14] + adds r1, r2 + strh r1, [r4, 0x14] + lsls r0, 16 + cmp r0, 0 + ble _080F9DB0 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x9F + ble _080F9DC2 +_080F9DB0: + movs r0, 0 + strh r0, [r4, 0x12] + movs r0, 0xA0 + strh r0, [r4, 0x14] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl ClearGpuRegBits +_080F9DC2: + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x14] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r1, 0x12 + ldrsh r0, [r4, r1] +_080F9DD8: + cmp r0, 0 + bne _080F9DF4 + b _080F9DEE +_080F9DDE: + ldrh r1, [r4, 0x16] + movs r0, 0x50 + bl SetGpuReg + adds r0, r5, 0 + bl DestroyTask + b _080F9DF4 +_080F9DEE: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080F9DF4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80F9C90 + + thumb_func_start sub_80F9DFC +sub_80F9DFC: @ 80F9DFC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _080F9E38 + cmp r1, 0x1 + bgt _080F9E24 + cmp r1, 0 + beq _080F9E2E + b _080F9F2C + .pool +_080F9E24: + cmp r1, 0x2 + beq _080F9E86 + cmp r1, 0x3 + beq _080F9ED8 + b _080F9F2C +_080F9E2E: + ldr r0, =0x02037b14 + strh r1, [r0] + b _080F9F4E + .pool +_080F9E38: + movs r1, 0 + strh r1, [r4, 0xE] + movs r0, 0xF0 + strh r0, [r4, 0x10] + strh r1, [r4, 0x12] + movs r0, 0xA0 + strh r0, [r4, 0x14] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl SetGpuRegBits + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x10] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl SetGpuReg + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x14] + 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, 0 + bl SetGpuReg + b _080F9F4E +_080F9E86: + ldrh r0, [r4, 0xC] + ldrh r2, [r4, 0x12] + adds r1, r0, r2 + strh r1, [r4, 0x12] + ldrh r2, [r4, 0x14] + subs r0, r2, r0 + strh r0, [r4, 0x14] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x4F + bgt _080F9EA4 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x51 + bgt _080F9EBC +_080F9EA4: + movs r0, 0x50 + strh r0, [r4, 0x12] + movs r0, 0x51 + strh r0, [r4, 0x14] + movs r0, 0x50 + movs r1, 0xBF + bl SetGpuReg + movs r0, 0x54 + movs r1, 0x10 + bl SetGpuReg +_080F9EBC: + ldrh r1, [r4, 0x12] + lsls r1, 8 + ldrh r0, [r4, 0x14] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0x50 + bne _080F9F54 + b _080F9F4E +_080F9ED8: + ldrh r0, [r4, 0xA] + ldrh r2, [r4, 0xE] + adds r1, r0, r2 + strh r1, [r4, 0xE] + ldrh r2, [r4, 0x10] + subs r0, r2, r0 + strh r0, [r4, 0x10] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x77 + bgt _080F9EF6 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x78 + bgt _080F9F0C +_080F9EF6: + movs r0, 0x78 + strh r0, [r4, 0xE] + strh r0, [r4, 0x10] + subs r0, 0x79 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r1, =0x02037b14 + movs r0, 0 + strh r0, [r1] +_080F9F0C: + ldrh r1, [r4, 0xE] + lsls r1, 8 + ldrh r0, [r4, 0x10] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x40 + bl SetGpuReg + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0x78 + bne _080F9F54 + b _080F9F4E + .pool +_080F9F2C: + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl ClearGpuRegBits + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + adds r0, r5, 0 + bl DestroyTask + b _080F9F54 +_080F9F4E: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080F9F54: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80F9DFC + + thumb_func_start sub_80F9F5C +sub_80F9F5C: @ 80F9F5C + push {lr} + ldr r0, =0x0203ab40 + ldr r1, =0x02037318 + ldr r1, [r1, 0x4] + bl sub_80E9608 + bl sub_80E8B6C + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F9F5C + + thumb_func_start sub_80F9F78 +sub_80F9F78: @ 80F9F78 + push {lr} + ldr r0, =0x02037590 + ldrb r1, [r0] + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + beq _080F9FC0 + ldr r1, =0x02038c08 + ldr r0, [r1, 0x4] + cmp r0, 0x2 + beq _080F9FAE + cmp r0, 0x2 + bgt _080F9FA0 + cmp r0, 0x1 + beq _080F9FA6 + b _080F9FFE + .pool +_080F9FA0: + cmp r0, 0x3 + beq _080F9FB6 + b _080F9FDC +_080F9FA6: + movs r0, 0x10 + str r0, [r1, 0x14] + movs r0, 0x28 + b _080F9FFC +_080F9FAE: + movs r0, 0x10 + str r0, [r1, 0x14] + movs r0, 0x8 + b _080F9FFC +_080F9FB6: + movs r0, 0x8 + negs r0, r0 + str r0, [r1, 0x14] + movs r0, 0x18 + b _080F9FFC +_080F9FC0: + ldr r1, =0x02038c08 + ldr r0, [r1, 0x4] + cmp r0, 0x2 + beq _080F9FEA + cmp r0, 0x2 + bgt _080F9FD8 + cmp r0, 0x1 + beq _080F9FE2 + b _080F9FFE + .pool +_080F9FD8: + cmp r0, 0x3 + beq _080F9FEE +_080F9FDC: + cmp r0, 0x4 + beq _080F9FF8 + b _080F9FFE +_080F9FE2: + movs r0, 0x8 + str r0, [r1, 0x14] + movs r0, 0x28 + b _080F9FFC +_080F9FEA: + movs r0, 0x8 + b _080F9FFA +_080F9FEE: + movs r0, 0x8 + negs r0, r0 + str r0, [r1, 0x14] + movs r0, 0x18 + b _080F9FFC +_080F9FF8: + movs r0, 0x18 +_080F9FFA: + str r0, [r1, 0x14] +_080F9FFC: + str r0, [r1, 0x18] +_080F9FFE: + pop {r0} + bx r0 + thumb_func_end sub_80F9F78 + + thumb_func_start sub_80FA004 +sub_80FA004: @ 80FA004 + push {r4,lr} + bl sub_80E8BC8 + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0x1 + beq _080FA0AE + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _080FA0AE + ldr r4, =0x0203ab40 + adds r1, r4, 0x2 + adds r0, r4, 0 + bl GetXYCoordsOneStepInFrontOfPlayer + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_808923C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FA070 + bl sub_80F9F5C + ldr r1, =0x03005db0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =0x0203ceec + ldr r0, =sub_80FA0DC + b _080FA0C0 + .pool +_080FA070: + adds r0, r4, 0 + bl sub_808925C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FA0A0 + bl sub_80F9F5C + ldr r1, =0x03005db0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =0x0203ceec + ldr r0, =sub_80FA1E8 + b _080FA0C0 + .pool +_080FA0A0: + adds r0, r4, 0 + bl is_tile_x98 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080FA0B2 +_080FA0AE: + movs r0, 0 + b _080FA0C4 +_080FA0B2: + bl sub_80F9F5C + ldr r1, =0x03005db0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =0x0203ceec + ldr r0, =sub_80FA34C +_080FA0C0: + str r0, [r1] + movs r0, 0x1 +_080FA0C4: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80FA004 + + thumb_func_start sub_80FA0DC +sub_80FA0DC: @ 80FA0DC + push {lr} + bl brm_get_pokemon_selection + ldr r1, =0x02038c08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + ldr r0, =gUnknown_08275A86 + bl script_env_1_execute_new_script + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FA0DC + + thumb_func_start oei_sweet_scent +oei_sweet_scent: @ 80FA0FC + push {lr} + bl oei_task_add + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =sub_80FA128 + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end oei_sweet_scent + + thumb_func_start sub_80FA128 +sub_80FA128: @ 80FA128 + push {lr} + movs r0, 0xB + bl FieldEffectActiveListRemove + movs r0, 0x37 + bl FieldEffectStart + pop {r0} + bx r0 + thumb_func_end sub_80FA128 + + thumb_func_start sub_80FA13C +sub_80FA13C: @ 80FA13C + push {r4,lr} + bl sub_80F9F78 + ldr r0, =gUnknown_0858E600 + ldr r3, =0x02020630 + ldr r1, =0x02037590 + ldrb r1, [r1, 0x4] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r2, 0x2] + lsls r1, 23 + lsrs r1, 23 + ldr r4, =0x02038c08 + ldr r3, [r4, 0x14] + adds r1, r3 + lsls r1, 16 + asrs r1, 16 + ldrb r2, [r2] + ldr r3, [r4, 0x18] + adds r2, r3 + lsls r2, 16 + asrs r2, 16 + movs r3, 0x94 + bl AddObjectToFront + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80FA13C + + thumb_func_start sub_80FA18C +sub_80FA18C: @ 80FA18C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x83 + bl audio_play + movs r0, 0 + strh r0, [r4, 0x2E] + ldr r0, =sub_80FA1A8 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FA18C + + thumb_func_start sub_80FA1A8 +sub_80FA1A8: @ 80FA1A8 + push {lr} + adds r1, r0, 0 + ldrh r2, [r1, 0x2E] + movs r3, 0x2E + ldrsh r0, [r1, r3] + cmp r0, 0x27 + bgt _080FA1C8 + adds r0, r2, 0x1 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + bne _080FA1D0 + bl sub_80E8D4C + b _080FA1D0 +_080FA1C8: + movs r0, 0 + strh r0, [r1, 0x2E] + ldr r0, =sub_80FA1D8 + str r0, [r1, 0x1C] +_080FA1D0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FA1A8 + + thumb_func_start sub_80FA1D8 +sub_80FA1D8: @ 80FA1D8 + push {lr} + movs r1, 0x37 + bl FieldEffectStop + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_80FA1D8 + + thumb_func_start sub_80FA1E8 +sub_80FA1E8: @ 80FA1E8 + push {lr} + bl brm_get_pokemon_selection + ldr r1, =0x02038c08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + ldr r0, =gUnknown_08275ADF + bl script_env_1_execute_new_script + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FA1E8 + + thumb_func_start sub_80FA208 +sub_80FA208: @ 80FA208 + push {lr} + bl oei_task_add + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =sub_80FA234 + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80FA208 + + thumb_func_start sub_80FA234 +sub_80FA234: @ 80FA234 + push {lr} + movs r0, 0x1A + bl FieldEffectActiveListRemove + movs r0, 0x38 + bl FieldEffectStart + pop {r0} + bx r0 + thumb_func_end sub_80FA234 + + thumb_func_start sub_80FA248 +sub_80FA248: @ 80FA248 + push {r4,lr} + ldr r1, =0x0203ab40 + movs r2, 0 + ldrsh r0, [r1, r2] + movs r2, 0x2 + ldrsh r1, [r1, r2] + bl MapGridGetMetatileBehaviorAt + adds r2, r0, 0 + ldr r1, =0x00000fff + adds r0, r1, 0 + ands r2, r0 + cmp r2, 0x96 + bne _080FA26A + ldr r1, =0x02038c08 + movs r0, 0 + str r0, [r1, 0x1C] +_080FA26A: + cmp r2, 0x9C + bne _080FA274 + ldr r1, =0x02038c08 + movs r0, 0x2 + str r0, [r1, 0x1C] +_080FA274: + bl sub_80F9F78 + ldr r0, =gUnknown_0858E618 + ldr r3, =0x02020630 + ldr r1, =0x02037590 + ldrb r1, [r1, 0x4] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r2, 0x2] + lsls r1, 23 + lsrs r1, 23 + ldr r4, =0x02038c08 + ldr r3, [r4, 0x14] + adds r1, r3 + lsls r1, 16 + asrs r1, 16 + ldrb r2, [r2] + ldr r3, [r4, 0x18] + adds r2, r3 + lsls r2, 16 + asrs r2, 16 + movs r3, 0x94 + bl AddObjectToFront + ldr r0, [r4, 0x1C] + cmp r0, 0x1 + beq _080FA2B2 + cmp r0, 0x3 + bne _080FA2B6 +_080FA2B2: + bl sub_80E8D4C +_080FA2B6: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80FA248 + + thumb_func_start sub_80FA2D8 +sub_80FA2D8: @ 80FA2D8 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x9B + bl audio_play + ldr r0, =0x02038c08 + ldr r1, [r0, 0x1C] + adds r2, r4, 0 + adds r2, 0x2A + movs r0, 0 + strb r1, [r2] + strh r0, [r4, 0x2E] + ldr r0, =sub_80FA304 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FA2D8 + + thumb_func_start sub_80FA304 +sub_80FA304: @ 80FA304 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x27 + ble _080FA32E + ldr r0, =0x02038c08 + ldr r0, [r0, 0x1C] + cmp r0, 0 + beq _080FA322 + cmp r0, 0x2 + bne _080FA326 +_080FA322: + bl sub_80E8D4C +_080FA326: + movs r0, 0 + strh r0, [r4, 0x2E] + ldr r0, =sub_80FA33C + str r0, [r4, 0x1C] +_080FA32E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FA304 + + thumb_func_start sub_80FA33C +sub_80FA33C: @ 80FA33C + push {lr} + movs r1, 0x38 + bl FieldEffectStop + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_80FA33C + + thumb_func_start sub_80FA34C +sub_80FA34C: @ 80FA34C + push {lr} + bl brm_get_pokemon_selection + ldr r1, =0x02038c08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + ldr r0, =gUnknown_08275B38 + bl script_env_1_execute_new_script + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FA34C + + thumb_func_start sub_80FA36C +sub_80FA36C: @ 80FA36C + push {lr} + bl oei_task_add + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =sub_80FA398 + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80FA36C + + thumb_func_start sub_80FA398 +sub_80FA398: @ 80FA398 + push {lr} + movs r0, 0x1B + bl FieldEffectActiveListRemove + movs r0, 0x39 + bl FieldEffectStart + pop {r0} + bx r0 + thumb_func_end sub_80FA398 + + thumb_func_start sub_80FA3AC +sub_80FA3AC: @ 80FA3AC + push {r4,lr} + bl sub_80F9F78 + ldr r0, =gUnknown_0858E630 + ldr r3, =0x02020630 + ldr r1, =0x02037590 + ldrb r1, [r1, 0x4] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r2, 0x2] + lsls r1, 23 + lsrs r1, 23 + ldr r4, =0x02038c08 + ldr r3, [r4, 0x14] + adds r1, r3 + lsls r1, 16 + asrs r1, 16 + ldrb r2, [r2] + ldr r3, [r4, 0x18] + adds r2, r3 + lsls r2, 16 + asrs r2, 16 + movs r3, 0x94 + bl AddObjectToFront + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80FA3AC + + thumb_func_start sub_80FA3FC +sub_80FA3FC: @ 80FA3FC + push {r4,lr} + adds r4, r0, 0 + movs r0, 0xA9 + bl audio_play + movs r0, 0 + strh r0, [r4, 0x2E] + ldr r0, =sub_80FA418 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FA3FC + + thumb_func_start sub_80FA418 +sub_80FA418: @ 80FA418 + push {lr} + adds r1, r0, 0 + ldrh r2, [r1, 0x2E] + movs r3, 0x2E + ldrsh r0, [r1, r3] + cmp r0, 0x27 + bgt _080FA438 + adds r0, r2, 0x1 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + bne _080FA440 + bl sub_80E8D4C + b _080FA440 +_080FA438: + movs r0, 0 + strh r0, [r1, 0x2E] + ldr r0, =sub_80FA448 + str r0, [r1, 0x1C] +_080FA440: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FA418 + + thumb_func_start sub_80FA448 +sub_80FA448: @ 80FA448 + push {lr} + movs r1, 0x39 + bl FieldEffectStop + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_80FA448 + + thumb_func_start sub_80FA458 +sub_80FA458: @ 80FA458 + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl GetXYCoordsOneStepInFrontOfPlayer + ldr r0, =sub_80FA4A0 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + mov r0, sp + ldrh r0, [r0] + movs r2, 0 + strh r0, [r1, 0x8] + ldrh r0, [r4] + strh r0, [r1, 0xA] + strh r2, [r1, 0xC] + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80FA458 + + thumb_func_start sub_80FA4A0 +sub_80FA4A0: @ 80FA4A0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldrh r0, [r4, 0x4] + subs r0, 0x4 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + bhi _080FA56E + lsls r0, 2 + ldr r1, =_080FA4D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080FA4D0: + .4byte _080FA514 + .4byte _080FA56E + .4byte _080FA56E + .4byte _080FA56E + .4byte _080FA522 + .4byte _080FA56E + .4byte _080FA56E + .4byte _080FA56E + .4byte _080FA514 + .4byte _080FA56E + .4byte _080FA56E + .4byte _080FA56E + .4byte _080FA522 + .4byte _080FA56E + .4byte _080FA56E + .4byte _080FA56E + .4byte _080FA540 +_080FA514: + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + movs r2, 0x89 + lsls r2, 2 + b _080FA52E +_080FA522: + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + movs r2, 0x88 + lsls r2, 2 +_080FA52E: + bl MapGridSetMetatileIdAt + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl CurrentMapDrawMetatileAt + b _080FA56E +_080FA540: + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + movs r2, 0x89 + lsls r2, 2 + bl MapGridSetMetatileIdAt + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl CurrentMapDrawMetatileAt + movs r0, 0x3D + bl FieldEffectActiveListRemove + bl script_env_2_enable_and_set_ctx_running + adds r0, r5, 0 + bl DestroyTask + b _080FA574 +_080FA56E: + ldrh r0, [r4, 0x4] + adds r0, 0x1 + strh r0, [r4, 0x4] +_080FA574: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80FA4A0 + + thumb_func_start sub_80FA57C +sub_80FA57C: @ 80FA57C + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl GetXYCoordsOneStepInFrontOfPlayer + movs r0, 0x3 + bl audio_play + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + bne _080FA5B8 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r2, 0xE2 + lsls r2, 4 + bl MapGridSetMetatileIdAt + b _080FA5C8 + .pool +_080FA5B8: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + ldr r2, =0x00000e21 + bl MapGridSetMetatileIdAt +_080FA5C8: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl CurrentMapDrawMetatileAt + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FA57C + + thumb_func_start sub_80FA5E4 +sub_80FA5E4: @ 80FA5E4 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + ldr r0, =sub_80FA62C + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r4, [r1, 0x8] + strh r5, [r1, 0xA] + strh r6, [r1, 0xC] + strh r0, [r1, 0xE] + movs r0, 0x1 + strh r0, [r1, 0x10] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FA5E4 + + thumb_func_start sub_80FA62C +sub_80FA62C: @ 80FA62C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldrh r1, [r4, 0x6] + movs r2, 0x6 + ldrsh r0, [r4, r2] + cmp r0, 0x6 + bne _080FA650 + movs r0, 0 + b _080FA652 + .pool +_080FA650: + adds r0, r1, 0x1 +_080FA652: + strh r0, [r4, 0x6] + movs r3, 0x6 + ldrsh r0, [r4, r3] + cmp r0, 0 + bne _080FA6A4 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x2 + bne _080FA66C + movs r2, 0 + ldrsh r0, [r4, r2] + bl sub_80FA6AC +_080FA66C: + movs r3, 0x2 + ldrsh r0, [r4, r3] + movs r2, 0x4 + ldrsh r1, [r4, r2] + ldrh r2, [r4, 0x8] + ldrh r3, [r4] + adds r2, r3 + lsls r2, 16 + lsrs r2, 16 + bl MapGridSetMetatileIdAt + movs r1, 0x2 + ldrsh r0, [r4, r1] + movs r2, 0x4 + ldrsh r1, [r4, r2] + bl CurrentMapDrawMetatileAt + ldrh r1, [r4, 0x8] + movs r3, 0x8 + ldrsh r0, [r4, r3] + cmp r0, 0x3 + bne _080FA6A0 + adds r0, r5, 0 + bl DestroyTask + b _080FA6A4 +_080FA6A0: + adds r0, r1, 0x1 + strh r0, [r4, 0x8] +_080FA6A4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80FA62C + + thumb_func_start sub_80FA6AC +sub_80FA6AC: @ 80FA6AC + push {lr} + lsls r0, 16 + asrs r1, r0, 16 + movs r0, 0xCE + lsls r0, 2 + cmp r1, r0 + beq _080FA6D8 + cmp r1, r0 + bgt _080FA6C8 + movs r0, 0x8A + lsls r0, 2 + cmp r1, r0 + beq _080FA6F0 + b _080FA6F6 +_080FA6C8: + movs r0, 0xCF + lsls r0, 2 + cmp r1, r0 + beq _080FA6E0 + adds r0, 0x4 + cmp r1, r0 + beq _080FA6E8 + b _080FA6F6 +_080FA6D8: + movs r0, 0x4A + bl audio_play + b _080FA6F6 +_080FA6E0: + movs r0, 0x4B + bl audio_play + b _080FA6F6 +_080FA6E8: + movs r0, 0x4C + bl audio_play + b _080FA6F6 +_080FA6F0: + movs r0, 0x4E + bl audio_play +_080FA6F6: + pop {r0} + bx r0 + thumb_func_end sub_80FA6AC + + thumb_func_start sub_80FA6FC +sub_80FA6FC: @ 80FA6FC + movs r0, 0 + bx lr + thumb_func_end sub_80FA6FC + + thumb_func_start sub_80FA700 +sub_80FA700: @ 80FA700 + movs r0, 0 + bx lr + thumb_func_end sub_80FA700 + + thumb_func_start sub_80FA704 +sub_80FA704: @ 80FA704 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x4D + bl audio_play + lsls r5, 16 + asrs r5, 16 + lsls r4, 16 + asrs r4, 16 + ldr r2, =0x00000276 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt + subs r6, r4, 0x1 + ldr r2, =0x0000026e + adds r0, r5, 0 + adds r1, r6, 0 + bl MapGridSetMetatileIdAt + adds r0, r5, 0 + adds r1, r4, 0 + bl CurrentMapDrawMetatileAt + adds r0, r5, 0 + adds r1, r6, 0 + bl CurrentMapDrawMetatileAt + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FA704 + + thumb_func_start sub_80FA754 +sub_80FA754: @ 80FA754 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + 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, 0x7 + bne _080FA788 + movs r2, 0xA + ldrsh r0, [r1, r2] + movs r3, 0xC + ldrsh r1, [r1, r3] + bl sub_80FA704 + adds r0, r4, 0 + bl DestroyTask + b _080FA78C + .pool +_080FA788: + adds r0, r2, 0x1 + strh r0, [r1, 0x8] +_080FA78C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FA754 + + thumb_func_start sub_80FA794 +sub_80FA794: @ 80FA794 + push {r4-r7,lr} + lsls r0, 16 + lsrs r5, r0, 16 + adds r7, r5, 0 + lsls r1, 16 + lsrs r4, r1, 16 + adds r6, r4, 0 + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FA7BC + lsls r0, r5, 16 + asrs r0, 16 + lsls r1, r4, 16 + asrs r1, 16 + bl sub_80FA704 + b _080FA7DE +_080FA7BC: + cmp r0, 0x2 + bne _080FA7DE + ldr r0, =sub_80FA754 + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x8] + strh r7, [r1, 0xA] + strh r6, [r1, 0xC] +_080FA7DE: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FA794 + + thumb_func_start sub_80FA7EC +sub_80FA7EC: @ 80FA7EC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0xA] + movs r3, 0xA + ldrsh r0, [r1, r3] + cmp r0, 0x7 + beq _080FA808 + b _080FA966 +_080FA808: + ldr r2, =0xfffffd88 + adds r0, r2, 0 + ldrh r1, [r1, 0x8] + adds r0, r1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3B + bls _080FA81A + b _080FA95E +_080FA81A: + lsls r0, 2 + ldr r1, =_080FA830 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080FA830: + .4byte _080FA920 + .4byte _080FA928 + .4byte _080FA930 + .4byte _080FA938 + .4byte _080FA940 + .4byte _080FA948 + .4byte _080FA950 + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA95E + .4byte _080FA958 +_080FA920: + movs r0, 0x3E + bl audio_play + b _080FA95E +_080FA928: + movs r0, 0x3F + bl audio_play + b _080FA95E +_080FA930: + movs r0, 0x40 + bl audio_play + b _080FA95E +_080FA938: + movs r0, 0x41 + bl audio_play + b _080FA95E +_080FA940: + movs r0, 0x42 + bl audio_play + b _080FA95E +_080FA948: + movs r0, 0x43 + bl audio_play + b _080FA95E +_080FA950: + movs r0, 0x44 + bl audio_play + b _080FA95E +_080FA958: + movs r0, 0x45 + bl audio_play +_080FA95E: + adds r0, r4, 0 + bl DestroyTask + b _080FA96A +_080FA966: + adds r0, r2, 0x1 + strh r0, [r1, 0xA] +_080FA96A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FA7EC + + thumb_func_start sub_80FA970 +sub_80FA970: @ 80FA970 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =sub_80FA7EC + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r4, [r1, 0x8] + strh r0, [r1, 0xA] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FA970 + + thumb_func_start sub_80FA9A4 +sub_80FA9A4: @ 80FA9A4 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + bne _080FA9BC + movs r0, 0xC3 + bl audio_play +_080FA9BC: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1F + ble _080FA9CA + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_080FA9CA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FA9A4 + + thumb_func_start sub_80FA9D0 +sub_80FA9D0: @ 80FA9D0 + push {r4,lr} + sub sp, 0x4 + ldr r3, =0x02037350 + ldr r2, =0x02037590 + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x10] + mov r0, sp + strh r1, [r0] + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x12] + mov r4, sp + adds r4, 0x2 + strh r0, [r4] + mov r0, sp + adds r1, r4, 0 + movs r2, 0x8 + movs r3, 0x4 + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x58] + mov r1, sp + movs r2, 0 + ldrsh r1, [r1, r2] + movs r3, 0 + ldrsh r2, [r4, r3] + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _080FAA5E + ldr r3, =0x02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r4, r2, r3 + movs r0, 0x3E + adds r0, r4 + mov r12, r0 + ldrb r0, [r0] + movs r1, 0x2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + ldrb r1, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + movs r1, 0xF + ands r0, r1 + movs r1, 0x50 + orrs r0, r1 + strb r0, [r4, 0x5] + adds r3, 0x1C + adds r2, r3 + ldr r0, =sub_80FA9A4 + str r0, [r2] + movs r0, 0 + strh r0, [r4, 0x2E] +_080FAA5E: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FA9D0 + + thumb_func_start sub_80FAA7C +sub_80FAA7C: @ 80FAA7C + push {r4,lr} + sub sp, 0x4 + bl script_env_2_enable + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl GetXYCoordsOneStepInFrontOfPlayer + ldr r1, =0x02038c08 + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + str r0, [r1, 0x14] + movs r3, 0 + ldrsh r0, [r4, r3] + str r0, [r1, 0x18] + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _080FAAFC + cmp r0, 0x2 + bgt _080FAABC + cmp r0, 0x1 + beq _080FAAC6 + b _080FAB8C + .pool +_080FAABC: + cmp r0, 0x3 + beq _080FAB2C + cmp r0, 0x4 + beq _080FAB64 + b _080FAB8C +_080FAAC6: + ldr r0, =gUnknown_0858E68C + ldr r3, =0x02020630 + ldr r1, =0x02037590 + ldrb r1, [r1, 0x4] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r2, 0x2] + lsls r1, 23 + lsrs r1, 7 + movs r3, 0x80 + lsls r3, 12 + adds r1, r3 + asrs r1, 16 + ldrb r2, [r2] + adds r2, 0x20 + movs r3, 0 + bl AddObjectToFront + b _080FAB8C + .pool +_080FAAFC: + ldr r0, =gUnknown_0858E68C + ldr r3, =0x02020630 + ldr r1, =0x02037590 + ldrb r1, [r1, 0x4] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r2, 0x2] + lsls r1, 23 + lsrs r1, 7 + movs r3, 0x80 + lsls r3, 12 + adds r1, r3 + asrs r1, 16 + ldrb r2, [r2] + b _080FAB4C + .pool +_080FAB2C: + ldr r0, =gUnknown_0858E68C + ldr r3, =0x02020630 + ldr r1, =0x02037590 + ldrb r1, [r1, 0x4] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r2, 0x2] + lsls r1, 23 + lsrs r1, 7 + ldr r3, =0xfff80000 + adds r1, r3 + asrs r1, 16 + ldrb r2, [r2] + adds r2, 0x10 +_080FAB4C: + movs r3, 0x94 + bl AddObjectToFront + b _080FAB8C + .pool +_080FAB64: + ldr r0, =gUnknown_0858E68C + ldr r3, =0x02020630 + ldr r1, =0x02037590 + ldrb r1, [r1, 0x4] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r2, 0x2] + lsls r1, 23 + lsrs r1, 7 + movs r3, 0xC0 + lsls r3, 13 + adds r1, r3 + asrs r1, 16 + ldrb r2, [r2] + adds r2, 0x10 + movs r3, 0x94 + bl AddObjectToFront +_080FAB8C: + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80FAA7C + + thumb_func_start door_restore_tilemap +door_restore_tilemap: @ 80FABA4 + push {r4,r5,lr} + adds r5, r0, 0 + movs r0, 0x83 + bl audio_play + ldr r4, =0x02038c08 + ldr r0, [r4, 0x14] + ldr r1, [r4, 0x18] + subs r1, 0x1 + bl MapGridGetMetatileIdAt + ldr r1, =0x00000286 + cmp r0, r1 + bne _080FABDC + ldr r0, [r4, 0x14] + ldr r1, [r4, 0x18] + subs r1, 0x1 + ldr r2, =0x00000e02 + bl MapGridSetMetatileIdAt + b _080FABEA + .pool +_080FABDC: + ldr r0, [r4, 0x14] + ldr r1, [r4, 0x18] + subs r1, 0x1 + movs r2, 0xA1 + lsls r2, 2 + bl MapGridSetMetatileIdAt +_080FABEA: + ldr r4, =0x02038c08 + ldr r0, [r4, 0x14] + ldr r1, [r4, 0x18] + ldr r2, =0x0000020a + bl MapGridSetMetatileIdAt + ldr r0, [r4, 0x14] + ldr r1, [r4, 0x18] + subs r1, 0x1 + bl CurrentMapDrawMetatileAt + ldr r0, [r4, 0x14] + ldr r1, [r4, 0x18] + bl CurrentMapDrawMetatileAt + movs r0, 0 + strh r0, [r5, 0x2E] + ldr r0, =sub_80FAC24 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end door_restore_tilemap + + thumb_func_start sub_80FAC24 +sub_80FAC24: @ 80FAC24 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r1, [r5, 0x2E] + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0x11 + bgt _080FAC38 + adds r0, r1, 0x1 + strh r0, [r5, 0x2E] + b _080FAC54 +_080FAC38: + ldr r4, =0x02038c08 + ldr r0, [r4, 0x14] + ldr r1, [r4, 0x18] + ldr r2, =0x00000e8c + bl MapGridSetMetatileIdAt + ldr r0, [r4, 0x14] + ldr r1, [r4, 0x18] + bl CurrentMapDrawMetatileAt + movs r0, 0 + strh r0, [r5, 0x2E] + ldr r0, =sub_80FAC68 + str r0, [r5, 0x1C] +_080FAC54: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FAC24 + + thumb_func_start sub_80FAC68 +sub_80FAC68: @ 80FAC68 + push {lr} + movs r1, 0x34 + bl FieldEffectStop + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_80FAC68 + + thumb_func_start sub_80FAC78 +sub_80FAC78: @ 80FAC78 + 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 MapGridGetMetatileIdAt + adds r1, r0, 0 + ldr r0, =0x000002f5 + cmp r1, r0 + beq _080FAD6C + cmp r1, r0 + bgt _080FACB4 + subs r0, 0x17 + cmp r1, r0 + beq _080FAD14 + adds r0, 0x16 + cmp r1, r0 + beq _080FAD60 + b _080FADCE + .pool +_080FACB4: + ldr r0, =0x000002f6 + cmp r1, r0 + beq _080FADA4 + adds r0, 0x40 + cmp r1, r0 + beq _080FACC2 + b _080FADCE +_080FACC2: + ldr r0, =0x02021cc4 + movs r1, 0x64 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085EA88B + bl CopyString + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080FADCE + ldr r4, =0x000040ee + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r0, 0x10 + b _080FAD8A + .pool +_080FAD14: + ldr r0, =0x02021cc4 + movs r1, 0x32 + movs r2, 0 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085EA890 + bl CopyString + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080FADCE + ldr r4, =0x000040ee + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r0, 0x20 + b _080FAD8A + .pool +_080FAD60: + ldr r1, =0x020375f0 + movs r0, 0x1 + b _080FAD70 + .pool +_080FAD6C: + ldr r1, =0x020375f0 + movs r0, 0x2 +_080FAD70: + strh r0, [r1] + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080FADCE + ldr r4, =0x000040ee + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r0, 0x80 +_080FAD8A: + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet + b _080FADCE + .pool +_080FADA4: + ldr r1, =0x020375f0 + movs r0, 0x3 + strh r0, [r1] + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080FADCE + ldr r4, =0x000040ee + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r0, 0x80 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet +_080FADCE: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FAC78 + + thumb_func_start sub_80FADE4 +sub_80FADE4: @ 80FADE4 + push {r4-r6,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r6, r4, 0 + lsls r1, 24 + lsrs r5, r1, 24 + bl CurrentMapIsSecretBase + lsls r0, 24 + cmp r0, 0 + beq _080FAE28 + cmp r5, 0 + bne _080FAE1C + ldr r1, =0xfffffd7b + adds r0, r4, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _080FAE10 + ldr r0, =0x00000237 + cmp r4, r0 + bne _080FAE28 +_080FAE10: + movs r0, 0x1 + b _080FAE2A + .pool +_080FAE1C: + ldr r0, =0x0000028d + cmp r4, r0 + beq _080FAE10 + ldr r0, =0x0000023f + cmp r6, r0 + beq _080FAE10 +_080FAE28: + movs r0, 0 +_080FAE2A: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80FADE4 + + thumb_func_start task50_overworld_posion_effect +task50_overworld_posion_effect: @ 80FAE38 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r1, r0, r1 + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0x1 + beq _080FAE76 + cmp r0, 0x1 + bgt _080FAE60 + cmp r0, 0 + beq _080FAE66 + b _080FAE92 + .pool +_080FAE60: + cmp r0, 0x2 + beq _080FAE8A + b _080FAE92 +_080FAE66: + ldrh r0, [r1, 0x2] + adds r0, 0x2 + strh r0, [r1, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _080FAE92 + b _080FAE82 +_080FAE76: + ldrh r0, [r1, 0x2] + subs r0, 0x2 + strh r0, [r1, 0x2] + lsls r0, 16 + cmp r0, 0 + bne _080FAE92 +_080FAE82: + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _080FAE92 +_080FAE8A: + adds r0, r2, 0 + bl DestroyTask + b _080FAEA2 +_080FAE92: + ldrh r0, [r1, 0x2] + lsls r1, r0, 4 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x4C + bl SetGpuReg +_080FAEA2: + pop {r0} + bx r0 + thumb_func_end task50_overworld_posion_effect + + thumb_func_start overworld_posion_effect +overworld_posion_effect: @ 80FAEA8 + push {lr} + movs r0, 0x4F + bl audio_play + ldr r0, =task50_overworld_posion_effect + movs r1, 0x50 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end overworld_posion_effect + + thumb_func_start c3_80A0DD8_is_running +c3_80A0DD8_is_running: @ 80FAEC0 + push {lr} + ldr r0, =task50_overworld_posion_effect + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end c3_80A0DD8_is_running + + thumb_func_start sub_80FAED4 +sub_80FAED4: @ 80FAED4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =sub_80FAEF0 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_80FAED4 + + thumb_func_start sub_80FAEF0 +sub_80FAEF0: @ 80FAEF0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + adds r0, r4, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _080FAF1C + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080FAF4E +_080FAF1C: + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + bl sub_808C228 + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + bl GetStepInPlaceDelay16AnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80FAF64 + str r1, [r0] +_080FAF4E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FAEF0 + + thumb_func_start sub_80FAF64 +sub_80FAF64: @ 80FAF64 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r5, r0, r1 + adds r0, r5, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080FAFC8 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + ldrh r0, [r2, 0xA] + adds r1, r0, 0x1 + strh r1, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + bgt _080FAFC4 + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + bl GetStepInPlaceDelay16AnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl FieldObjectSetSpecialAnim + b _080FAFC8 + .pool +_080FAFC4: + ldr r0, =sub_80FAFD4 + str r0, [r2] +_080FAFC8: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FAF64 + + thumb_func_start sub_80FAFD4 +sub_80FAFD4: @ 80FAFD4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_808BCD0 + lsls r0, 24 + lsrs r0, 24 + bl SetPlayerAvatarTransitionFlags + adds r0, r4, 0 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FAFD4 + + thumb_func_start sub_80FAFF8 +sub_80FAFF8: @ 80FAFF8 + push {lr} + ldr r0, =sub_80FAED4 + movs r1, 0x50 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FAFF8 + + thumb_func_start sub_80FB00C +sub_80FB00C: @ 80FB00C + push {r4,r5,lr} + ldr r0, =gUnknown_0858E864 + bl LoadTaggedObjectPalette + ldr r0, =gUnknown_0858E880 + movs r1, 0 + movs r2, 0 + movs r3, 0x52 + bl AddObjectToFront + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x40 + beq _080FB06C + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r1, =0x02020630 + adds r4, r0, r1 + adds r2, r4, 0 + adds r2, 0x20 + adds r3, r4, 0 + adds r3, 0x22 + movs r0, 0x10 + movs r1, 0xD + bl sub_8092FF0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x20] + adds r0, 0x10 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x22] + adds r0, 0x2 + strh r0, [r4, 0x22] + adds r0, r5, 0 + b _080FB06E + .pool +_080FB06C: + movs r0, 0x40 +_080FB06E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80FB00C + + thumb_func_start sub_80FB074 +sub_80FB074: @ 80FB074 + push {r4-r7,lr} + ldr r4, =0x02020630 + adds r7, r4, 0 + movs r6, 0 + movs r5, 0x3F +_080FB07E: + adds r0, r7, 0 + adds r0, 0x14 + adds r0, r6, r0 + ldr r1, [r0] + ldr r0, =gUnknown_0858E880 + cmp r1, r0 + bne _080FB098 + adds r0, r4, 0 + bl FreeObjectPalette + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_080FB098: + adds r4, 0x44 + adds r6, 0x44 + subs r5, 0x1 + cmp r5, 0 + bge _080FB07E + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FB074 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/fldeff_emotion.s b/asm/fldeff_emotion.s new file mode 100644 index 000000000..13c4d14be --- /dev/null +++ b/asm/fldeff_emotion.s @@ -0,0 +1,328 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start oei_exclamation_mark +oei_exclamation_mark: @ 80B4620 + push {lr} + ldr r0, =gUnknown_085507B4 + movs r1, 0 + movs r2, 0 + movs r3, 0x53 + bl AddObjectToBack + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _080B4648 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0 + movs r2, 0 + bl sub_80B46D8 +_080B4648: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end oei_exclamation_mark + + thumb_func_start sub_80B4658 +sub_80B4658: @ 80B4658 + push {lr} + ldr r0, =gUnknown_085507B4 + movs r1, 0 + movs r2, 0 + movs r3, 0x52 + bl AddObjectToBack + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _080B4680 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0x21 + movs r2, 0x1 + bl sub_80B46D8 +_080B4680: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B4658 + + thumb_func_start sub_80B4690 +sub_80B4690: @ 80B4690 + push {r4,lr} + ldr r0, =gUnknown_085507CC + movs r1, 0 + movs r2, 0 + movs r3, 0x52 + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _080B46C6 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x2E + movs r2, 0 + bl sub_80B46D8 + ldrb r1, [r4, 0x5] + movs r0, 0xF + ands r0, r1 + movs r1, 0x20 + orrs r0, r1 + strb r0, [r4, 0x5] +_080B46C6: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B4690 + + thumb_func_start sub_80B46D8 +@ void sub_80B46D8(struct obj *object, s16 a2, u8 a3) +sub_80B46D8: @ 80B46D8 + push {r4,lr} + lsls r2, 24 + lsrs r2, 24 + ldrb r4, [r0, 0x5] + movs r3, 0xD + negs r3, r3 + ands r3, r4 + movs r4, 0x4 + orrs r3, r4 + strb r3, [r0, 0x5] + movs r3, 0x3E + adds r3, r0 + mov r12, r3 + ldrb r3, [r3] + movs r4, 0x2 + orrs r3, r4 + mov r4, r12 + strb r3, [r4] + ldr r4, =0x02038c08 + ldr r3, [r4] + strh r3, [r0, 0x2E] + ldr r3, [r4, 0x4] + strh r3, [r0, 0x30] + ldr r3, [r4, 0x8] + strh r3, [r0, 0x32] + ldr r3, =0x0000fffb + strh r3, [r0, 0x34] + strh r1, [r0, 0x3C] + adds r1, r2, 0 + bl StartObjectImageAnim + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B46D8 + + thumb_func_start objc_exclamation_mark_probably +objc_exclamation_mark_probably: @ 80B4724 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r4, 0x32] + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _080B4756 + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080B4764 +_080B4756: + ldrh r1, [r4, 0x3C] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldEffectStop + b _080B47B2 +_080B4764: + ldr r2, =0x02037350 + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + ldrh r3, [r4, 0x34] + ldrh r0, [r4, 0x36] + adds r2, r3, r0 + strh r2, [r4, 0x36] + ldrh r0, [r1, 0x20] + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x22] + subs r0, 0x10 + strh r0, [r4, 0x22] + ldrh r0, [r1, 0x24] + strh r0, [r4, 0x24] + ldrh r0, [r1, 0x26] + adds r0, r2 + strh r0, [r4, 0x26] + lsls r2, 16 + asrs r2, 16 + cmp r2, 0 + beq _080B47B0 + adds r0, r3, 0x1 + strh r0, [r4, 0x34] + b _080B47B2 + .pool +_080B47B0: + strh r2, [r4, 0x34] +_080B47B2: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end objc_exclamation_mark_probably + + thumb_func_start sub_80B47BC +sub_80B47BC: @ 80B47BC + push {lr} + ldr r0, =0x02038bfc + ldrb r0, [r0] + cmp r0, 0 + beq _080B47D4 + ldr r0, =0x03006090 + ldrb r0, [r0, 0xC] + b _080B47D8 + .pool +_080B47D4: + ldr r0, =0x03006090 + ldrb r0, [r0] +_080B47D8: + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B47BC + + thumb_func_start sub_80B47E0 +sub_80B47E0: @ 80B47E0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _080B47EE + movs r0, 0 + b _080B4800 +_080B47EE: + cmp r0, 0 + beq _080B47FC + ldr r0, =0x03006090 + ldrb r0, [r0, 0xC] + b _080B4800 + .pool +_080B47FC: + ldr r0, =0x03006090 + ldrb r0, [r0] +_080B4800: + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B47E0 + + thumb_func_start sub_80B4808 +sub_80B4808: @ 80B4808 + push {lr} + ldr r0, =0x030060ac + ldrb r0, [r0] + cmp r0, 0x1 + bne _080B4870 + ldr r2, =0x03006090 + ldr r0, =0x03006080 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldrb r0, [r0, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetOppositeDirection + lsls r0, 24 + lsrs r0, 24 + bl GetFaceDirectionAnimId + ldr r3, =0x03006084 + strb r0, [r3] + movs r0, 0xFE + strb r0, [r3, 0x1] + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + movs r0, 0xFF + bl exec_movement + b _080B489E + .pool +_080B4870: + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldrb r0, [r0, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + ldr r3, =0x03006084 + strb r0, [r3] + movs r0, 0xFE + strb r0, [r3, 0x1] + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + movs r0, 0xFF + bl exec_movement +_080B489E: + movs r0, 0xFF + bl sub_809BE48 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B4808 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/fldeff_strength.s b/asm/fldeff_strength.s new file mode 100644 index 000000000..9bd3f1bec --- /dev/null +++ b/asm/fldeff_strength.s @@ -0,0 +1,93 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start hm_prepare_rocksmash +hm_prepare_rocksmash: @ 8145DC4 + push {r4,lr} + movs r0, 0x57 + bl npc_before_player_of_type + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08145DD8 + movs r0, 0 + b _08145DF2 +_08145DD8: + ldr r4, =0x020375f0 + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + ldr r1, =0x03005db0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =0x0203ceec + ldr r0, =sub_8145E0C + str r0, [r1] + movs r0, 0x1 +_08145DF2: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end hm_prepare_rocksmash + + thumb_func_start sub_8145E0C +sub_8145E0C: @ 8145E0C + push {lr} + bl brm_get_pokemon_selection + ldr r1, =0x02038c08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + ldr r0, =gUnknown_082908FD + bl script_env_1_execute_new_script + pop {r0} + bx r0 + .pool + thumb_func_end sub_8145E0C + + thumb_func_start sub_8145E2C +sub_8145E2C: @ 8145E2C + push {lr} + bl oei_task_add + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =sub_8145E74 + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + ldr r0, =0x02038c08 + ldr r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02021cc4 + bl GetMonNickname + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8145E2C + + thumb_func_start sub_8145E74 +sub_8145E74: @ 8145E74 + push {lr} + movs r0, 0x28 + bl FieldEffectActiveListRemove + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_8145E74 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/front_pic_anim.s b/asm/front_pic_anim.s new file mode 100644 index 000000000..b9f5a790f --- /dev/null +++ b/asm/front_pic_anim.s @@ -0,0 +1,11688 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_817F498 +sub_817F498: @ 817F498 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r6, r5, 2 + adds r0, r6, r5 + lsls r0, 3 + adds r2, r0, r1 + movs r3, 0xA + ldrsh r0, [r2, r3] + lsls r3, r0, 16 + movs r4, 0xC + ldrsh r0, [r2, r4] + orrs r3, r0 + movs r0, 0x8 + ldrsh r4, [r2, r0] + mov r8, r1 + ldr r0, =DummyObjectCallback + mov r12, r0 + cmp r4, 0 + bne _0817F508 + ldrh r0, [r3, 0x2E] + strh r0, [r2, 0x10] + ldrh r0, [r3, 0x32] + strh r0, [r2, 0x12] + movs r0, 0x1 + strh r0, [r3, 0x30] + strh r4, [r3, 0x2E] + movs r0, 0x2 + adds r1, r6, 0 + ldr r6, =gUnknown_0860AA88 + ldr r7, =0x03001274 + movs r4, 0 + adds r2, r3, 0 + adds r2, 0x32 +_0817F4E2: + strh r4, [r2] + adds r2, 0x2 + adds r0, 0x1 + cmp r0, 0x7 + bls _0817F4E2 + adds r1, r5 + lsls r1, 3 + add r1, r8 + movs r2, 0xE + ldrsh r0, [r1, r2] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + str r0, [r3, 0x1C] + movs r0, 0 + str r0, [r7] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_0817F508: + ldr r0, [r3, 0x1C] + cmp r0, r12 + bne _0817F528 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + add r0, r8 + ldrh r1, [r0, 0x10] + movs r2, 0 + strh r1, [r3, 0x2E] + ldrh r0, [r0, 0x12] + strh r0, [r3, 0x32] + strh r2, [r3, 0x30] + adds r0, r5, 0 + bl DestroyTask +_0817F528: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817F498 + + thumb_func_start sub_817F544 +sub_817F544: @ 817F544 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r4, r1, 24 + lsrs r4, 24 + ldr r0, =sub_817F498 + movs r1, 0x80 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + lsrs r0, r5, 16 + strh r0, [r1, 0xA] + strh r5, [r1, 0xC] + strh r4, [r1, 0xE] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817F544 + + thumb_func_start sub_817F578 +sub_817F578: @ 817F578 + lsls r1, 24 + ldr r3, =0x03001274 + movs r2, 0x1 + str r2, [r3] + ldr r2, =gUnknown_0860AA88 + lsrs r1, 22 + adds r1, r2 + ldr r1, [r1] + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_817F578 + + thumb_func_start sub_817F594 +sub_817F594: @ 817F594 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r6, r1, 24 + lsrs r6, 24 + ldr r0, =sub_817F498 + movs r1, 0x80 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + lsrs r0, r5, 16 + strh r0, [r4, 0xA] + strh r5, [r4, 0xC] + ldrh r0, [r5, 0x2E] + lsls r0, 24 + ldr r1, =0x0202406e + lsrs r0, 23 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + bl GetNature + lsls r0, 24 + lsrs r0, 24 + lsls r1, r6, 1 + ldr r2, =gUnknown_0860AD2F + adds r0, r2 + adds r1, r6 + ldrb r0, [r0] + adds r1, r0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =gUnknown_0860ACE4 + adds r1, r0 + ldrb r0, [r1] + strh r0, [r4, 0xE] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817F594 + + thumb_func_start sub_817F60C +sub_817F60C: @ 817F60C + ldr r1, =nullsub_69 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_817F60C + + thumb_func_start sub_817F618 +sub_817F618: @ 817F618 + push {r4,r5,lr} + sub sp, 0x10 + lsls r1, 16 + lsls r3, 16 + lsrs r3, 16 + ldr r4, =0xffff0000 + lsls r2, 16 + lsrs r1, 16 + orrs r1, r2 + str r1, [sp] + ldr r1, [sp, 0x4] + ands r1, r4 + orrs r1, r3 + str r1, [sp, 0x4] + ldrb r4, [r0, 0x3] + lsls r4, 26 + lsrs r4, 27 + add r5, sp, 0x8 + mov r0, sp + adds r1, r5, 0 + movs r2, 0x1 + movs r3, 0x2 + bl ObjAffineSet + ldr r0, =0x02021bc0 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r5] + strh r0, [r4] + ldrh r0, [r5, 0x2] + strh r0, [r4, 0x2] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x4] + ldrh r0, [r5, 0x6] + strh r0, [r4, 0x6] + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817F618 + + thumb_func_start sub_817F670 +sub_817F670: @ 817F670 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r4, 0x1] + ldr r0, =gUnknown_0860AD68 + str r0, [r4, 0x10] + ldr r0, =0x03001274 + ldr r0, [r0] + cmp r0, 0x1 + bne _0817F68E + adds r0, r4, 0 + bl obj_alloc_rotscale_entry +_0817F68E: + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0817F6A8 + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + b _0817F6B0 + .pool +_0817F6A8: + adds r0, r4, 0 + movs r1, 0 + bl StartObjectRotScalAnim +_0817F6B0: + ldrb r3, [r4, 0x1] + lsrs r1, r3, 6 + ldrb r2, [r4, 0x3] + lsrs r2, 6 + lsls r3, 30 + lsrs r3, 30 + adds r0, r4, 0 + bl CalcVecFromObjectCenterToObjectUpperLeft + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817F670 + + thumb_func_start sub_817F6D4 +sub_817F6D4: @ 817F6D4 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + movs r5, 0x30 + ldrsh r0, [r4, r5] + cmp r0, 0 + bne _0817F6F8 + lsls r0, r1, 16 + negs r0, r0 + lsrs r1, r0, 16 + negs r0, r3 + lsls r0, 16 + lsrs r3, r0, 16 +_0817F6F8: + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + adds r0, r4, 0 + bl sub_817F618 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_817F6D4 + + thumb_func_start sub_817F70C +sub_817F70C: @ 817F70C + push {lr} + adds r1, r0, 0 + movs r2, 0x30 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0817F720 + movs r2, 0x24 + ldrsh r0, [r1, r2] + negs r0, r0 + strh r0, [r1, 0x24] +_0817F720: + pop {r0} + bx r0 + thumb_func_end sub_817F70C + + thumb_func_start sub_817F724 +sub_817F724: @ 817F724 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bhi _0817F750 + ldr r1, =0x03001240 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r2, 0 + strh r2, [r0, 0x6] + strh r2, [r0] + movs r1, 0x1 + strh r1, [r0, 0x4] + strh r2, [r0, 0x2] + strh r2, [r0, 0x8] + movs r0, 0x1 + b _0817F752 + .pool +_0817F750: + movs r0, 0 +_0817F752: + pop {r1} + bx r1 + thumb_func_end sub_817F724 + + thumb_func_start sub_817F758 +sub_817F758: @ 817F758 + push {r4,lr} + ldr r4, =0x03001270 + ldrb r1, [r4] + adds r2, r1, 0x1 + adds r0, r2, 0 + asrs r0, 2 + lsls r0, 2 + subs r0, r2, r0 + strb r0, [r4] + ldrb r0, [r4] + bl sub_817F724 + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817F758 + + thumb_func_start sub_817F77C +sub_817F77C: @ 817F77C + push {r4,r5,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x1] + movs r3, 0x4 + negs r3, r3 + ands r3, r0 + movs r5, 0x1 + orrs r3, r5 + strb r3, [r4, 0x1] + lsrs r1, r3, 6 + ldrb r2, [r4, 0x3] + lsrs r2, 6 + lsls r3, 30 + lsrs r3, 30 + adds r0, r4, 0 + bl CalcVecFromObjectCenterToObjectUpperLeft + ldr r0, =0x03001274 + ldr r0, [r0] + cmp r0, 0x1 + bne _0817F800 + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0817F7C0 + adds r1, r4, 0 + adds r1, 0x3F + ldrb r0, [r1] + orrs r0, r5 + strb r0, [r1] + adds r5, r1, 0 + b _0817F7D0 + .pool +_0817F7C0: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r2, [r0] + movs r1, 0x2 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + adds r5, r0, 0 +_0817F7D0: + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldrb r2, [r4, 0x3] + lsls r1, r2, 26 + lsrs r1, 27 + ldrb r0, [r5] + lsls r0, 31 + lsrs r0, 31 + lsls r0, 3 + orrs r1, r0 + lsls r1, 1 + movs r0, 0x3F + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x3] + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] +_0817F800: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_817F77C + + thumb_func_start pokemonanimfunc_01 +pokemonanimfunc_01: @ 817F808 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0817F81A + adds r0, r6, 0 + bl sub_817F670 +_0817F81A: + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0x28 + ble _0817F840 + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r6, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r6, 0x1C] + b _0817F88C + .pool +_0817F840: + movs r1, 0x32 + ldrsh r0, [r6, r1] + lsls r0, 9 + movs r1, 0x28 + bl __divsi3 + adds r4, r0, 0 + cmp r0, 0 + bge _0817F854 + adds r4, 0xFF +_0817F854: + asrs r4, 8 + lsls r4, 8 + subs r4, r0, r4 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + movs r1, 0x20 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r5, r1, 0 + adds r0, r5 + strh r0, [r6, 0x36] + adds r0, r4, 0 + movs r1, 0x20 + bl cosine + adds r0, r5 + strh r0, [r6, 0x38] + movs r0, 0x36 + ldrsh r1, [r6, r0] + movs r0, 0x38 + ldrsh r2, [r6, r0] + adds r0, r6, 0 + movs r3, 0 + bl sub_817F6D4 +_0817F88C: + ldrh r0, [r6, 0x32] + adds r0, 0x1 + strh r0, [r6, 0x32] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_01 + + thumb_func_start pokemonanimfunc_02 +pokemonanimfunc_02: @ 817F898 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x32] + movs r2, 0x32 + ldrsh r0, [r4, r2] + cmp r0, 0x28 + ble _0817F8B4 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + movs r0, 0 + b _0817F8EE + .pool +_0817F8B4: + movs r0, 0x1 + ands r0, r1 + movs r5, 0xFF + cmp r0, 0 + bne _0817F8C0 + movs r5, 0x1 +_0817F8C0: + movs r1, 0x32 + ldrsh r0, [r4, r1] + lsls r0, 7 + movs r1, 0x28 + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bge _0817F8D4 + adds r0, 0xFF +_0817F8D4: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x6 + bl sine + lsls r1, r5, 24 + asrs r1, 24 + adds r2, r0, 0 + muls r2, r1 + adds r0, r2, 0 +_0817F8EE: + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_02 + + thumb_func_start sub_817F8FC +sub_817F8FC: @ 817F8FC + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r1, r0 + ble _0817F91C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + movs r0, 0 + b _0817F946 + .pool +_0817F91C: + movs r0, 0x32 + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 7 + movs r2, 0x2E + ldrsh r1, [r4, r2] + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bge _0817F936 + adds r0, 0xFF +_0817F936: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x6 + bl sine +_0817F946: + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817F8FC + + thumb_func_start pokemonanimfunc_03 +pokemonanimfunc_03: @ 817F95C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x28 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_817F8FC + ldr r0, =sub_817F8FC + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_03 + + thumb_func_start sub_817F978 +sub_817F978: @ 817F978 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r1, r0 + ble _0817F998 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + movs r0, 0 + b _0817F9C4 + .pool +_0817F998: + movs r0, 0x32 + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 7 + movs r2, 0x2E + ldrsh r1, [r4, r2] + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bge _0817F9B2 + adds r0, 0xFF +_0817F9B2: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x6 + bl sine + negs r0, r0 +_0817F9C4: + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817F978 + + thumb_func_start pokemonanimfunc_04 +pokemonanimfunc_04: @ 817F9D8 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x28 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_817F978 + ldr r0, =sub_817F978 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_04 + + thumb_func_start sub_817F9F4 +sub_817F9F4: @ 817F9F4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r0, 0xC0 + lsls r0, 1 + cmp r1, r0 + ble _0817FA14 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x24] + b _0817FA5E + .pool +_0817FA14: + adds r0, r1, 0 + cmp r1, 0 + bge _0817FA1C + adds r0, 0x7F +_0817FA1C: + asrs r2, r0, 7 + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0 + blt _0817FA60 + cmp r0, 0x1 + ble _0817FA48 + cmp r0, 0x3 + bgt _0817FA60 + ldr r2, =0xffffff00 + adds r1, r2 + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x2E + ldrsh r2, [r4, r1] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 16 + b _0817FA56 + .pool +_0817FA48: + lsls r0, r2, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x2E + ldrsh r1, [r4, r2] + lsls r1, 17 +_0817FA56: + asrs r1, 16 + bl sine + negs r0, r0 +_0817FA5E: + strh r0, [r4, 0x26] +_0817FA60: + ldrh r0, [r4, 0x32] + adds r0, 0xC + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817F9F4 + + thumb_func_start pokemonanimfunc_1E +pokemonanimfunc_1E: @ 817FA6C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x4 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_817F9F4 + ldr r0, =sub_817F9F4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_1E + + thumb_func_start pokemonanimfunc_06 +pokemonanimfunc_06: @ 817FA88 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r0, 0xC0 + lsls r0, 2 + cmp r2, r0 + ble _0817FAA8 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x24] + b _0817FB56 + .pool +_0817FAA8: + adds r0, r2, 0 + cmp r2, 0 + bge _0817FAB0 + adds r0, 0x7F +_0817FAB0: + lsls r0, 9 + asrs r0, 16 + cmp r0, 0x5 + bhi _0817FB3C + lsls r0, 2 + ldr r1, =_0817FAC8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0817FAC8: + .4byte _0817FAE0 + .4byte _0817FAE0 + .4byte _0817FAE4 + .4byte _0817FAE8 + .4byte _0817FB04 + .4byte _0817FB1E +_0817FAE0: + movs r0, 0 + b _0817FB3A +_0817FAE4: + movs r2, 0 + b _0817FB3C +_0817FAE8: + adds r0, r2, 0 + cmp r2, 0 + bge _0817FAF0 + adds r0, 0x7F +_0817FAF0: + asrs r0, 7 + lsls r0, 7 + subs r0, r2, r0 + lsls r0, 3 + negs r0, r0 + cmp r0, 0 + bge _0817FB00 + adds r0, 0x7F +_0817FB00: + asrs r0, 7 + b _0817FB3A +_0817FB04: + adds r0, r2, 0 + cmp r2, 0 + bge _0817FB0C + adds r0, 0x7F +_0817FB0C: + asrs r0, 7 + lsls r0, 7 + subs r0, r2, r0 + cmp r0, 0 + bge _0817FB18 + adds r0, 0x7 +_0817FB18: + asrs r0, 3 + subs r0, 0x8 + b _0817FB3A +_0817FB1E: + adds r0, r2, 0 + cmp r2, 0 + bge _0817FB26 + adds r0, 0x7F +_0817FB26: + asrs r0, 7 + lsls r0, 7 + subs r0, r2, r0 + lsls r0, 3 + negs r0, r0 + cmp r0, 0 + bge _0817FB36 + adds r0, 0x7F +_0817FB36: + asrs r0, 7 + adds r0, 0x8 +_0817FB3A: + strh r0, [r4, 0x24] +_0817FB3C: + adds r0, r2, 0 + cmp r2, 0 + bge _0817FB44 + adds r0, 0x7F +_0817FB44: + asrs r0, 7 + lsls r0, 7 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + negs r0, r0 +_0817FB56: + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0xC + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_06 + + thumb_func_start pokemonanimfunc_09 +pokemonanimfunc_09: @ 817FB64 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0817FB76 + adds r0, r6, 0 + bl sub_817F670 +_0817FB76: + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0x28 + ble _0817FB9C + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r6, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r6, 0x1C] + b _0817FC12 + .pool +_0817FB9C: + movs r1, 0x32 + ldrsh r0, [r6, r1] + lsls r0, 8 + movs r1, 0x28 + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bge _0817FBB0 + adds r0, 0xFF +_0817FBB0: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + lsrs r4, r0, 16 + ldrh r0, [r6, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0817FBE0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + movs r1, 0x20 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r5, r1, 0 + adds r0, r5 + strh r0, [r6, 0x36] + adds r0, r4, 0 + movs r1, 0x20 + b _0817FBFA +_0817FBE0: + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + movs r1, 0x8 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r5, r1, 0 + adds r0, r5 + strh r0, [r6, 0x36] + adds r0, r4, 0 + movs r1, 0x8 +_0817FBFA: + bl sine + adds r0, r5 + strh r0, [r6, 0x38] + movs r0, 0x36 + ldrsh r1, [r6, r0] + movs r0, 0x38 + ldrsh r2, [r6, r0] + adds r0, r6, 0 + movs r3, 0 + bl sub_817F6D4 +_0817FC12: + ldrh r0, [r6, 0x32] + adds r0, 0x1 + strh r0, [r6, 0x32] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_09 + + thumb_func_start sub_817FC20 +sub_817FC20: @ 817FC20 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0817FC32 + strh r0, [r4, 0x34] +_0817FC32: + ldr r2, =gUnknown_0860AD70 + movs r5, 0x34 + ldrsh r1, [r4, r5] + lsls r0, r1, 1 + adds r0, r1 + adds r1, r2, 0x2 + adds r3, r0, r1 + movs r1, 0 + ldrsb r1, [r3, r1] + movs r5, 0x32 + ldrsh r0, [r4, r5] + cmp r1, r0 + bne _0817FC6A + adds r0, r1, 0 + cmp r0, 0 + bne _0817FC60 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _0817FC6A + .pool +_0817FC60: + ldrh r0, [r4, 0x34] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x34] + strh r1, [r4, 0x32] +_0817FC6A: + movs r0, 0x34 + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r1, r0, r1 + adds r0, r2, 0x2 + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bne _0817FC8C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _0817FCBE + .pool +_0817FC8C: + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + movs r5, 0x34 + ldrsh r1, [r4, r5] + lsls r0, r1, 1 + adds r0, r1 + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F70C +_0817FCBE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_817FC20 + + thumb_func_start pokemonanimfunc_0A +pokemonanimfunc_0A: @ 817FCC4 + push {r4,lr} + adds r4, r0, 0 + bl sub_817FC20 + ldr r0, =sub_817FC20 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_0A + + thumb_func_start sub_817FCDC +sub_817FCDC: @ 817FCDC + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r0, 0x90 + lsls r0, 4 + cmp r1, r0 + ble _0817FCF8 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + movs r0, 0 + b _0817FD12 + .pool +_0817FCF8: + adds r0, r1, 0 + cmp r1, 0 + bge _0817FD00 + adds r0, 0xFF +_0817FD00: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x3C + ldrsh r1, [r4, r2] + bl sine +_0817FD12: + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x2E] + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817FCDC + + thumb_func_start pokemonanimfunc_0F +pokemonanimfunc_0F: @ 817FD24 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x3C + strh r0, [r4, 0x2E] + movs r0, 0x3 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_817FCDC + ldr r0, =sub_817FCDC + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_0F + + thumb_func_start sub_817FD44 +sub_817FD44: @ 817FD44 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r0, 0x90 + lsls r0, 4 + cmp r1, r0 + ble _0817FD60 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + movs r0, 0 + b _0817FD78 + .pool +_0817FD60: + adds r0, r1, 0 + cmp r1, 0 + bge _0817FD68 + adds r0, 0xFF +_0817FD68: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x3 + bl sine +_0817FD78: + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x2E] + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817FD44 + + thumb_func_start pokemonanimfunc_10 +pokemonanimfunc_10: @ 817FD88 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x3C + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_817FD44 + ldr r0, =sub_817FD44 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_10 + + thumb_func_start pokemonanimfunc_11 +pokemonanimfunc_11: @ 817FDA4 + push {r4-r7,lr} + adds r7, r0, 0 + ldrh r2, [r7, 0x32] + movs r0, 0x32 + ldrsh r1, [r7, r0] + movs r0, 0x80 + lsls r0, 2 + cmp r1, r0 + ble _0817FDC8 + ldr r0, =sub_8184D88 + str r0, [r7, 0x1C] + movs r0, 0 + strh r0, [r7, 0x24] + strh r0, [r7, 0x26] + b _0817FE24 + .pool +_0817FDC8: + movs r0, 0x1 + ands r0, r2 + movs r5, 0xFF + cmp r0, 0 + bne _0817FDD4 + movs r5, 0x1 +_0817FDD4: + movs r1, 0x32 + ldrsh r0, [r7, r1] + cmp r0, 0 + bge _0817FDDE + adds r0, 0x3 +_0817FDDE: + asrs r0, 2 + movs r1, 0x8 + bl sine + lsls r0, 16 + asrs r6, r0, 16 + movs r0, 0x32 + ldrsh r1, [r7, r0] + adds r4, r1, 0 + cmp r1, 0 + bge _0817FDF6 + adds r4, 0xFF +_0817FDF6: + asrs r4, 8 + lsls r4, 8 + subs r4, r1, r4 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + adds r1, r6, 0 + bl sine + lsls r5, 24 + asrs r5, 24 + adds r1, r0, 0 + muls r1, r5 + adds r0, r1, 0 + strh r0, [r7, 0x26] + adds r0, r4, 0 + adds r1, r6, 0 + bl cosine + adds r1, r0, 0 + muls r1, r5 + adds r0, r1, 0 + strh r0, [r7, 0x24] +_0817FE24: + ldrh r0, [r7, 0x32] + adds r0, 0x9 + strh r0, [r7, 0x32] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_11 + + thumb_func_start sub_817FE30 +sub_817FE30: @ 817FE30 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r2, =0x03001240 + ldrh r6, [r4, 0x2E] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r5, r0, r2 + ldrh r0, [r5] + cmp r0, 0 + beq _0817FE54 + subs r0, 0x1 + strh r0, [r5] + b _0817FEF8 + .pool +_0817FE54: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0817FE70 + movs r2, 0x8 + ldrsh r0, [r5, r2] + cmp r0, 0 + bne _0817FE70 + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_0817FE70: + ldr r2, =0x03001240 + lsls r1, r6, 16 + asrs r1, 16 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r5, r0, r2 + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r2, 0x6 + ldrsh r0, [r5, r2] + cmp r1, r0 + ble _0817FEC4 + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + ldrh r1, [r5, 0x4] + movs r2, 0x4 + ldrsh r0, [r5, r2] + cmp r0, 0x1 + ble _0817FEB4 + subs r0, r1, 0x1 + movs r1, 0 + strh r0, [r5, 0x4] + movs r0, 0xA + strh r0, [r5] + strh r1, [r4, 0x32] + b _0817FEF2 + .pool +_0817FEB4: + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _0817FEF2 + .pool +_0817FEC4: + movs r0, 0x32 + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _0817FED0 + adds r0, 0xFF +_0817FED0: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x80 + lsls r1, 5 + bl sine + strh r0, [r4, 0x3A] + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x3A] + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 +_0817FEF2: + ldrh r0, [r4, 0x32] + adds r0, 0x10 + strh r0, [r4, 0x32] +_0817FEF8: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_817FE30 + + thumb_func_start pokemonanimfunc_12 +pokemonanimfunc_12: @ 817FF00 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + movs r3, 0 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x80 + lsls r0, 2 + strh r0, [r1, 0x6] + strh r3, [r1] + adds r0, r4, 0 + bl sub_817FE30 + ldr r0, =sub_817FE30 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_12 + + thumb_func_start sub_817FF3C +sub_817FF3C: @ 817FF3C + push {r4-r6,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r5, r0, 24 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0817FF54 + adds r0, r4, 0 + bl sub_817F670 +_0817FF54: + movs r2, 0x32 + ldrsh r6, [r4, r2] + ldr r1, =0x03001240 + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0] + cmp r6, r1 + ble _0817FF8C + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _0817FFAA + .pool +_0817FF8C: + movs r2, 0x8 + ldrsh r1, [r0, r2] + movs r0, 0x80 + lsls r0, 9 + bl __divsi3 + muls r0, r6 + strh r0, [r4, 0x3A] + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x3A] + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 +_0817FFAA: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_817FF3C + + thumb_func_start pokemonanimfunc_1F +pokemonanimfunc_1F: @ 817FFB8 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x3C + strh r0, [r1] + movs r0, 0x14 + strh r0, [r1, 0x8] + adds r0, r4, 0 + bl sub_817FF3C + ldr r0, =sub_817FF3C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_1F + + thumb_func_start sub_817FFF0 +sub_817FFF0: @ 817FFF0 + push {r4-r7,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x2E] + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r5, 0 + bl sub_817F70C + ldr r1, =0x03001240 + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 2 + adds r6, r0, r1 + movs r0, 0x32 + ldrsh r1, [r5, r0] + movs r2, 0x6 + ldrsh r0, [r6, r2] + cmp r1, r0 + ble _0818002C + movs r0, 0 + strh r0, [r5, 0x24] + strh r0, [r5, 0x26] + ldr r0, =sub_8184D88 + str r0, [r5, 0x1C] + b _0818006A + .pool +_0818002C: + movs r0, 0x32 + ldrsh r1, [r5, r0] + adds r0, r1, 0 + adds r0, 0xC0 + adds r4, r0, 0 + cmp r0, 0 + bge _0818003E + ldr r2, =0x000001bf + adds r4, r1, r2 +_0818003E: + asrs r4, 8 + lsls r4, 8 + subs r4, r0, r4 + lsls r4, 16 + asrs r4, 16 + movs r0, 0x8 + ldrsh r1, [r6, r0] + lsls r1, 17 + asrs r1, 16 + adds r0, r4, 0 + bl cosine + negs r0, r0 + strh r0, [r5, 0x24] + movs r2, 0x8 + ldrsh r1, [r6, r2] + adds r0, r4, 0 + bl sine + ldrh r1, [r6, 0x8] + adds r0, r1 + strh r0, [r5, 0x26] +_0818006A: + ldr r0, =0x03001240 + lsls r1, r7, 1 + adds r1, r7 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x2] + ldrh r1, [r5, 0x32] + adds r0, r1 + strh r0, [r5, 0x32] + adds r0, r5, 0 + bl sub_817F70C + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817FFF0 + + thumb_func_start pokemonanimfunc_14 +pokemonanimfunc_14: @ 8180090 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x80 + lsls r0, 2 + strh r0, [r1, 0x6] + movs r0, 0x6 + strh r0, [r1, 0x8] + movs r0, 0x18 + strh r0, [r1, 0x2] + adds r0, r4, 0 + bl sub_817FFF0 + ldr r0, =sub_817FFF0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_14 + + thumb_func_start pokemonanimfunc_15 +pokemonanimfunc_15: @ 81800D0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081800EC + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + adds r0, r1 + strh r0, [r4, 0x3C] +_081800EC: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x80 + ble _0818010C + ldrh r0, [r4, 0x3C] + movs r1, 0x10 + movs r2, 0 + movs r3, 0 + bl pal_fade_1 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _08180128 + .pool +_0818010C: + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0x10 + bl sine + adds r2, r0, 0 + strh r2, [r4, 0x3A] + ldrh r0, [r4, 0x3C] + lsls r2, 24 + lsrs r2, 24 + movs r1, 0x10 + movs r3, 0 + bl pal_fade_1 +_08180128: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_15 + + thumb_func_start pokemonanimfunc_16 +pokemonanimfunc_16: @ 8180134 + push {r4-r7,lr} + adds r6, r0, 0 + movs r7, 0 + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _08180148 + adds r0, r6, 0 + bl sub_817F670 +_08180148: + ldrh r5, [r6, 0x32] + movs r2, 0x32 + ldrsh r0, [r6, r2] + cmp r0, 0x28 + ble _08180170 + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r6, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r6, 0x1C] + b _08180204 + .pool +_08180170: + movs r1, 0x32 + ldrsh r0, [r6, r1] + lsls r0, 7 + movs r1, 0x28 + bl __divsi3 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r5, 0 + subs r0, 0xA + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x13 + bhi _08180196 + ldrh r0, [r6, 0x3C] + adds r0, 0x33 + strh r0, [r6, 0x3C] + movs r7, 0xFF + ands r7, r0 +_08180196: + movs r2, 0x30 + ldrsh r0, [r6, r2] + cmp r0, 0 + bne _081801C4 + lsls r5, r4, 16 + asrs r0, r5, 16 + movs r1, 0x28 + bl sine + adds r4, r0, 0 + adds r0, r7, 0 + movs r1, 0x10 + bl sine + ldr r1, =0xffffff00 + adds r0, r1 + adds r4, r0 + strh r4, [r6, 0x36] + adds r4, r5, 0 + b _081801E4 + .pool +_081801C4: + adds r0, r7, 0 + movs r1, 0x10 + bl sine + adds r5, r0, 0 + lsls r4, 16 + asrs r0, r4, 16 + movs r1, 0x28 + bl sine + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + subs r1, r5 + subs r1, r0 + strh r1, [r6, 0x36] +_081801E4: + asrs r0, r4, 16 + movs r1, 0x10 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r0, [r6, 0x38] + movs r2, 0x36 + ldrsh r1, [r6, r2] + movs r0, 0x38 + ldrsh r2, [r6, r0] + adds r0, r6, 0 + movs r3, 0 + bl sub_817F618 +_08180204: + ldrh r0, [r6, 0x32] + adds r0, 0x1 + strh r0, [r6, 0x32] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_16 + + thumb_func_start pokemonanimfunc_17 +pokemonanimfunc_17: @ 8180210 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + movs r0, 0 + mov r8, r0 + movs r7, 0 + movs r1, 0x32 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0818022C + adds r0, r5, 0 + bl sub_817F670 +_0818022C: + ldrh r6, [r5, 0x32] + movs r2, 0x32 + ldrsh r0, [r5, r2] + cmp r0, 0x28 + ble _08180258 + movs r2, 0x80 + lsls r2, 1 + adds r0, r5, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r5, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r5, 0x1C] + mov r0, r8 + strh r0, [r5, 0x26] + b _0818030A + .pool +_08180258: + movs r1, 0x32 + ldrsh r0, [r5, r1] + lsls r0, 7 + movs r1, 0x28 + bl __divsi3 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r6, 0 + subs r0, 0xA + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x13 + bhi _0818027E + ldrh r0, [r5, 0x3C] + adds r0, 0x33 + strh r0, [r5, 0x3C] + movs r7, 0xFF + ands r7, r0 +_0818027E: + movs r2, 0x30 + ldrsh r0, [r5, r2] + cmp r0, 0 + bne _081802A0 + lsls r4, 16 + asrs r0, r4, 16 + movs r1, 0x10 + bl sine + ldr r2, =0xffffff00 + adds r1, r2, 0 + subs r1, r0 + strh r1, [r5, 0x36] + b _081802B2 + .pool +_081802A0: + lsls r4, 16 + asrs r0, r4, 16 + movs r1, 0x10 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r0, [r5, 0x36] +_081802B2: + adds r6, r4, 0 + adds r0, r7, 0 + movs r1, 0x8 + bl sine + adds r4, r0, 0 + asrs r0, r6, 16 + movs r1, 0x28 + bl sine + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + subs r4, r1, r4 + subs r4, r0 + strh r4, [r5, 0x38] + lsls r4, 16 + asrs r4, 16 + lsls r1, 16 + asrs r1, 16 + cmp r4, r1 + beq _081802F0 + movs r2, 0x38 + ldrsh r0, [r5, r2] + subs r0, r1, r0 + cmp r0, 0 + bge _081802EA + adds r0, 0x7 +_081802EA: + lsls r0, 13 + lsrs r0, 16 + mov r8, r0 +_081802F0: + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + negs r0, r0 + strh r0, [r5, 0x26] + movs r2, 0x36 + ldrsh r1, [r5, r2] + movs r0, 0x38 + ldrsh r2, [r5, r0] + adds r0, r5, 0 + movs r3, 0 + bl sub_817F618 +_0818030A: + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_17 + + thumb_func_start sub_818031C +sub_818031C: @ 818031C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + ldrh r0, [r4, 0x32] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, =gUnknown_0860AA80 + movs r1, 0x38 + ldrsh r0, [r4, r1] + lsls r0, 1 + adds r1, r0, r2 + ldrb r5, [r1] + adds r2, 0x1 + adds r0, r2 + ldrb r6, [r0] + movs r1, 0 + cmp r5, 0xFE + beq _08180358 + subs r0, r6, r7 + muls r0, r5 + adds r1, r6, 0 + bl __divsi3 + lsls r0, 24 + lsrs r1, r0, 24 +_08180358: + cmp r5, 0xFF + bne _08180370 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x26] + b _08180394 + .pool +_08180370: + mov r0, r8 + bl sine + strh r0, [r4, 0x26] + cmp r7, r6 + bne _08180386 + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + movs r0, 0 + b _08180392 +_08180386: + ldrh r0, [r4, 0x2E] + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x3A] + adds r0, 0x1 +_08180392: + strh r0, [r4, 0x3A] +_08180394: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_818031C + + thumb_func_start pokemonanimfunc_19 +pokemonanimfunc_19: @ 81803A0 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x30 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_818031C + ldr r0, =sub_818031C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_19 + + thumb_func_start pokemonanimfunc_1A +pokemonanimfunc_1A: @ 81803BC + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x32] + lsls r7, r0, 24 + lsrs r5, r7, 24 + mov r8, r5 + cmp r0, 0 + bne _081803DA + adds r0, r4, 0 + bl sub_817F670 +_081803DA: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x23 + ble _08180404 + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x24] + b _0818045E + .pool +_08180404: + adds r6, r5, 0 + subs r6, 0xA + lsls r0, r6, 7 + movs r1, 0x14 + bl __divsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r5, 0x9 + bhi _0818042A + movs r2, 0x80 + lsls r2, 1 + lsrs r3, r7, 25 + lsls r3, 9 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + b _0818045E +_0818042A: + lsls r0, r6, 24 + lsrs r0, 24 + cmp r0, 0x13 + bhi _08180442 + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x5 + bl sine + negs r0, r0 + strh r0, [r4, 0x24] + b _0818045E +_08180442: + movs r2, 0x80 + lsls r2, 1 + movs r3, 0x23 + mov r0, r8 + subs r3, r0 + lsrs r0, r3, 31 + adds r3, r0 + asrs r3, 1 + lsls r3, 26 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 +_0818045E: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F70C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_1A + + thumb_func_start pokemonanimfunc_1B +pokemonanimfunc_1B: @ 8180474 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _08180486 + adds r0, r6, 0 + bl sub_817F670 +_08180486: + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0x64 + ble _081804B0 + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + movs r0, 0 + strh r0, [r6, 0x26] + adds r0, r6, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r6, 0x1C] + b _081804E8 + .pool +_081804B0: + movs r1, 0x32 + ldrsh r0, [r6, r1] + lsls r0, 8 + movs r1, 0x64 + bl __divsi3 + adds r4, r0, 0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + movs r1, 0xA + bl sine + strh r0, [r6, 0x26] + movs r5, 0x80 + lsls r5, 1 + ldr r1, =0x00000ccc + adds r0, r4, 0 + bl sine + adds r3, r0, 0 + lsls r3, 16 + lsrs r3, 16 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r5, 0 + bl sub_817F6D4 +_081804E8: + ldrh r0, [r6, 0x32] + adds r0, 0x1 + strh r0, [r6, 0x32] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_1B + + thumb_func_start sub_81804F8 +sub_81804F8: @ 81804F8 + push {r4-r6,lr} + adds r6, r0, 0 + movs r5, 0 + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0818050C + adds r0, r6, 0 + bl sub_817F670 +_0818050C: + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0x64 + ble _08180534 + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + strh r5, [r6, 0x26] + adds r0, r6, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r6, 0x1C] + b _08180582 + .pool +_08180534: + movs r0, 0x32 + ldrsh r5, [r6, r0] + lsls r0, r5, 8 + movs r1, 0x64 + bl __divsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 9 + adds r0, r5, 0 + movs r1, 0x64 + bl __divsi3 + adds r5, r0, 0 + movs r0, 0xFF + ands r5, r0 + lsls r4, 16 + asrs r4, 16 + movs r0, 0x2E + ldrsh r1, [r6, r0] + adds r0, r4, 0 + bl sine + strh r0, [r6, 0x26] + movs r4, 0x80 + lsls r4, 1 + adds r0, r5, 0 + ldr r1, =0x00000ccc + bl sine + adds r3, r0, 0 + lsls r3, 16 + lsrs r3, 16 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r4, 0 + bl sub_817F6D4 +_08180582: + ldrh r0, [r6, 0x32] + adds r0, 0x1 + strh r0, [r6, 0x32] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81804F8 + + thumb_func_start pokemonanimfunc_1C +pokemonanimfunc_1C: @ 8180594 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0xA + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_81804F8 + ldr r0, =sub_81804F8 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_1C + + thumb_func_start sub_81805B0 +sub_81805B0: @ 81805B0 + push {r4-r6,lr} + adds r6, r0, 0 + movs r5, 0 + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _081805C4 + adds r0, r6, 0 + bl sub_817F670 +_081805C4: + movs r2, 0x32 + ldrsh r0, [r6, r2] + cmp r0, 0x64 + ble _081805EC + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + strh r5, [r6, 0x26] + adds r0, r6, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r6, 0x1C] + b _08180644 + .pool +_081805EC: + movs r0, 0x32 + ldrsh r5, [r6, r0] + lsls r0, r5, 8 + movs r1, 0x64 + bl __divsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 9 + adds r0, r5, 0 + movs r1, 0x64 + bl __divsi3 + adds r5, r0, 0 + movs r0, 0xFF + ands r5, r0 + lsls r4, 16 + asrs r0, r4, 16 + lsrs r4, 31 + adds r0, r4 + asrs r0, 1 + movs r2, 0x2E + ldrsh r1, [r6, r2] + lsls r1, 17 + asrs r1, 16 + bl sine + negs r0, r0 + strh r0, [r6, 0x26] + movs r4, 0x80 + lsls r4, 1 + adds r0, r5, 0 + ldr r1, =0x00000ccc + bl sine + adds r3, r0, 0 + lsls r3, 16 + lsrs r3, 16 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r4, 0 + bl sub_817F6D4 +_08180644: + ldrh r0, [r6, 0x32] + adds r0, 0x1 + strh r0, [r6, 0x32] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81805B0 + + thumb_func_start pokemonanimfunc_18 +pokemonanimfunc_18: @ 8180654 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x5 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_81805B0 + ldr r0, =sub_81805B0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_18 + + thumb_func_start pokemonanimfunc_1D +pokemonanimfunc_1D: @ 8180670 + push {r4-r6,lr} + adds r6, r0, 0 + bl sub_817F70C + movs r5, 0 + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _08180688 + adds r0, r6, 0 + bl sub_817F670 +_08180688: + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0x64 + ble _081806B0 + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + strh r5, [r6, 0x24] + adds r0, r6, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r6, 0x1C] + b _081806FC + .pool +_081806B0: + movs r0, 0x32 + ldrsh r5, [r6, r0] + lsls r0, r5, 8 + movs r1, 0x64 + bl __divsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 9 + adds r0, r5, 0 + movs r1, 0x64 + bl __divsi3 + adds r5, r0, 0 + movs r0, 0xFF + ands r5, r0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + movs r1, 0x8 + bl sine + strh r0, [r6, 0x24] + movs r4, 0x80 + lsls r4, 1 + adds r0, r5, 0 + ldr r1, =0x00000ccc + bl sine + adds r3, r0, 0 + lsls r3, 16 + lsrs r3, 16 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r4, 0 + bl sub_817F6D4 +_081806FC: + ldrh r0, [r6, 0x32] + adds r0, 0x1 + strh r0, [r6, 0x32] + adds r0, r6, 0 + bl sub_817F70C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_1D + + thumb_func_start sub_8180714 +sub_8180714: @ 8180714 + push {r4-r6,lr} + adds r4, r0, 0 + movs r6, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0818072A + adds r0, r4, 0 + bl sub_817F670 + strh r6, [r4, 0x34] +_0818072A: + adds r0, r4, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + cmp r2, r0 + ble _08180760 + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + strh r6, [r4, 0x26] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _081807FE + .pool +_08180760: + movs r1, 0x36 + ldrsh r0, [r4, r1] + movs r1, 0x20 + bl sine + movs r2, 0x80 + lsls r2, 1 + adds r0, r2 + lsls r0, 16 + lsrs r5, r0, 16 + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r1, r0 + ble _08180796 + adds r2, r0, 0 + lsls r0, r2, 1 + cmp r1, r0 + bge _08180796 + movs r0, 0x80 + adds r1, r2, 0 + bl __divsi3 + ldrh r1, [r4, 0x34] + adds r1, r0 + strh r1, [r4, 0x34] +_08180796: + lsls r0, r5, 16 + asrs r1, r0, 16 + movs r2, 0x80 + lsls r2, 1 + adds r5, r0, 0 + cmp r1, r2 + ble _081807B0 + subs r0, r2, r1 + cmp r0, 0 + bge _081807AC + adds r0, 0x7 +_081807AC: + lsls r0, 13 + lsrs r6, r0, 16 +_081807B0: + movs r1, 0x34 + ldrsh r0, [r4, r1] + movs r1, 0xA + bl sine + negs r0, r0 + lsls r1, r6, 16 + asrs r1, 16 + subs r0, r1 + strh r0, [r4, 0x26] + movs r2, 0x36 + ldrsh r0, [r4, r2] + movs r1, 0x20 + bl sine + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + asrs r2, r5, 16 + adds r0, r4, 0 + movs r3, 0 + bl sub_817F6D4 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + movs r0, 0x2E + ldrsh r1, [r4, r0] + movs r0, 0x80 + bl __divsi3 + ldrh r1, [r4, 0x36] + adds r1, r0 + movs r0, 0xFF + ands r1, r0 + strh r1, [r4, 0x36] +_081807FE: + adds r0, r4, 0 + bl sub_817F70C + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8180714 + + thumb_func_start pokemonanimfunc_00 +pokemonanimfunc_00: @ 818080C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x10 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_8180714 + ldr r0, =sub_8180714 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_00 + + thumb_func_start sub_8180828 +sub_8180828: @ 8180828 + push {r4-r6,lr} + adds r5, r0, 0 + movs r6, 0 + movs r0, 0x32 + ldrsh r4, [r5, r0] + movs r2, 0x3A + ldrsh r1, [r5, r2] + movs r0, 0x80 + bl __divsi3 + movs r2, 0x3C + ldrsh r1, [r5, r2] + muls r0, r1 + cmp r4, r0 + ble _08180868 + movs r2, 0x80 + lsls r2, 1 + adds r0, r5, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + strh r6, [r5, 0x26] + adds r0, r5, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r5, 0x1C] + b _081808D0 + .pool +_08180868: + movs r1, 0x36 + ldrsh r0, [r5, r1] + movs r1, 0x20 + bl sine + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + adds r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + ble _08180894 + subs r0, r1, r0 + cmp r0, 0 + bge _08180890 + adds r0, 0x7 +_08180890: + lsls r0, 13 + lsrs r6, r0, 16 +_08180894: + lsls r0, r6, 16 + asrs r0, 16 + negs r0, r0 + strh r0, [r5, 0x26] + movs r1, 0x36 + ldrsh r0, [r5, r1] + movs r1, 0x30 + bl sine + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + lsls r2, r4, 16 + asrs r2, 16 + adds r0, r5, 0 + movs r3, 0 + bl sub_817F6D4 + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x3A] + ldrh r1, [r5, 0x36] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x36] +_081808D0: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8180828 + + thumb_func_start pokemonanimfunc_13 +pokemonanimfunc_13: @ 81808D8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081808F2 + adds r0, r4, 0 + bl sub_817F670 + movs r0, 0x3 + strh r0, [r4, 0x3C] + movs r0, 0x8 + strh r0, [r4, 0x3A] +_081808F2: + adds r0, r4, 0 + bl sub_8180828 + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_13 + + thumb_func_start sub_8180900 +sub_8180900: @ 8180900 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x2E] + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x03001240 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x6] + str r1, [sp] + ldr r5, =gUnknown_0860AD8E + movs r3, 0x36 + ldrsh r2, [r4, r3] + lsls r1, r2, 1 + adds r1, r2 + movs r3, 0x8 + ldrsh r2, [r0, r3] + lsls r0, r2, 1 + adds r0, r2 + lsls r6, r0, 3 + adds r1, r6 + adds r2, r1, r5 + adds r0, r5, 0x1 + adds r1, r0 + movs r0, 0 + ldrsb r0, [r1, r0] + ldrb r2, [r2] + lsls r2, 24 + asrs r2, 24 + mov r9, r2 + subs r0, r2 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + ldrh r7, [r4, 0x34] + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0818096C + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] +_0818096C: + movs r2, 0x36 + ldrsh r1, [r4, r2] + lsls r0, r1, 1 + adds r0, r1 + adds r0, r6 + adds r5, 0x2 + mov r8, r5 + adds r1, r0, r5 + movs r5, 0 + ldrsb r5, [r1, r5] + cmp r5, 0 + bne _081809B0 + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + strh r5, [r4, 0x24] + strh r5, [r4, 0x26] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _08180A3A + .pool +_081809B0: + lsls r0, r7, 16 + asrs r5, r0, 16 + lsls r0, r5, 7 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + movs r1, 0xA + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + mov r3, r10 + lsls r0, r3, 16 + asrs r0, 16 + muls r0, r5 + movs r1, 0x36 + ldrsh r2, [r4, r1] + lsls r1, r2, 1 + adds r1, r2 + adds r1, r6 + add r1, r8 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + bl __divsi3 + add r0, r9 + strh r0, [r4, 0x24] + ldr r2, [sp] + lsls r0, r2, 16 + asrs r0, 16 + movs r3, 0x24 + ldrsh r1, [r4, r3] + muls r0, r1 + negs r0, r0 + cmp r0, 0 + bge _08180A04 + adds r0, 0x7 +_08180A04: + lsls r3, r0, 13 + lsrs r3, 16 + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + movs r0, 0x36 + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + adds r0, r6 + add r0, r8 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r5, r0 + bne _08180A34 + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + movs r0, 0 + b _08180A38 +_08180A34: + ldrh r0, [r4, 0x34] + adds r0, 0x1 +_08180A38: + strh r0, [r4, 0x34] +_08180A3A: + adds r0, r4, 0 + bl sub_817F70C + 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_8180900 + + thumb_func_start pokemonanimfunc_05 +pokemonanimfunc_05: @ 8180A50 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x80 + lsls r0, 5 + strh r0, [r1, 0x6] + ldrh r0, [r4, 0x3A] + strh r0, [r1, 0x8] + adds r0, r4, 0 + bl sub_8180900 + ldr r0, =sub_8180900 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_05 + + thumb_func_start pokemonanimfunc_20 +pokemonanimfunc_20: @ 8180A8C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08180AA8 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + adds r0, r1 + strh r0, [r4, 0x3C] +_08180AA8: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x80 + ble _08180ACC + ldrh r0, [r4, 0x3C] + ldr r3, =0x000002df + movs r1, 0x10 + movs r2, 0 + bl pal_fade_1 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _08180AE8 + .pool +_08180ACC: + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0xC + bl sine + adds r2, r0, 0 + strh r2, [r4, 0x3A] + ldrh r0, [r4, 0x3C] + lsls r2, 24 + lsrs r2, 24 + ldr r3, =0x000002df + movs r1, 0x10 + bl pal_fade_1 +_08180AE8: + ldrh r0, [r4, 0x32] + adds r0, 0x2 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_20 + + thumb_func_start pokemonanimfunc_21 +pokemonanimfunc_21: @ 8180AF8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08180B14 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + adds r0, r1 + strh r0, [r4, 0x3C] +_08180B14: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x80 + ble _08180B34 + ldrh r0, [r4, 0x3C] + movs r1, 0x10 + movs r2, 0 + movs r3, 0x1F + bl pal_fade_1 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _08180B50 + .pool +_08180B34: + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0xC + bl sine + adds r2, r0, 0 + strh r2, [r4, 0x3A] + ldrh r0, [r4, 0x3C] + lsls r2, 24 + lsrs r2, 24 + movs r1, 0x10 + movs r3, 0x1F + bl pal_fade_1 +_08180B50: + ldrh r0, [r4, 0x32] + adds r0, 0x2 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_21 + + thumb_func_start pokemonanimfunc_22 +pokemonanimfunc_22: @ 8180B5C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08180B78 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + adds r0, r1 + strh r0, [r4, 0x3C] +_08180B78: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x80 + ble _08180B98 + ldrh r0, [r4, 0x3C] + movs r3, 0xF8 + lsls r3, 7 + movs r1, 0x10 + movs r2, 0 + bl pal_fade_1 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _08180BB6 + .pool +_08180B98: + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0xC + bl sine + adds r2, r0, 0 + strh r2, [r4, 0x3A] + ldrh r0, [r4, 0x3C] + lsls r2, 24 + lsrs r2, 24 + movs r3, 0xF8 + lsls r3, 7 + movs r1, 0x10 + bl pal_fade_1 +_08180BB6: + ldrh r0, [r4, 0x32] + adds r0, 0x2 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_22 + + thumb_func_start pokemonanimfunc_23 +pokemonanimfunc_23: @ 8180BC4 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08180BE0 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + adds r0, r1 + strh r0, [r4, 0x3C] +_08180BE0: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x80 + ble _08180C04 + ldrh r0, [r4, 0x3C] + ldr r3, =0x000003ff + movs r1, 0x10 + movs r2, 0 + bl pal_fade_1 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _08180C20 + .pool +_08180C04: + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0xC + bl sine + adds r2, r0, 0 + strh r2, [r4, 0x3A] + ldrh r0, [r4, 0x3C] + lsls r2, 24 + lsrs r2, 24 + ldr r3, =0x000003ff + movs r1, 0x10 + bl pal_fade_1 +_08180C20: + ldrh r0, [r4, 0x32] + adds r0, 0x2 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_23 + + thumb_func_start pokemonanimfunc_24 +pokemonanimfunc_24: @ 8180C30 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08180C4C + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + adds r0, r1 + strh r0, [r4, 0x3C] +_08180C4C: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x80 + ble _08180C70 + ldrh r0, [r4, 0x3C] + ldr r3, =0x00006018 + movs r1, 0x10 + movs r2, 0 + bl pal_fade_1 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _08180C8C + .pool +_08180C70: + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0xC + bl sine + adds r2, r0, 0 + strh r2, [r4, 0x3A] + ldrh r0, [r4, 0x3C] + lsls r2, 24 + lsrs r2, 24 + ldr r3, =0x00006018 + movs r1, 0x10 + bl pal_fade_1 +_08180C8C: + ldrh r0, [r4, 0x32] + adds r0, 0x2 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_24 + + thumb_func_start pokemonanimfunc_25 +pokemonanimfunc_25: @ 8180C9C + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + ldr r0, =sub_8180CB4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_25 + + thumb_func_start sub_8180CB4 +sub_8180CB4: @ 8180CB4 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x24] + adds r0, 0x1 + strh r0, [r4, 0x24] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _08180CD6 + movs r0, 0x8 + strh r0, [r4, 0x24] + movs r0, 0x2 + strh r0, [r4, 0x3C] + ldr r0, =sub_8180CE8 + str r0, [r4, 0x1C] +_08180CD6: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8180CB4 + + thumb_func_start sub_8180CE8 +sub_8180CE8: @ 8180CE8 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x24] + ldrh r0, [r4, 0x3C] + subs r1, r0 + strh r1, [r4, 0x24] + adds r0, 0x1 + adds r2, r0, 0 + strh r0, [r4, 0x3C] + lsls r1, 16 + cmp r1, 0 + bgt _08180D32 + lsls r0, r2, 24 + lsrs r2, r0, 24 + movs r0, 0 + strh r0, [r4, 0x3A] + ldrh r1, [r4, 0x24] + ldr r5, =sub_8180D44 + movs r3, 0x8 + negs r3, r3 +_08180D14: + subs r0, r1, r2 + lsls r0, 16 + ldrh r1, [r4, 0x3A] + adds r1, 0x1 + strh r1, [r4, 0x3A] + adds r1, r2, 0x1 + lsls r1, 24 + lsrs r2, r1, 24 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, r3 + bgt _08180D14 + movs r0, 0x1 + strh r0, [r4, 0x38] + str r5, [r4, 0x1C] +_08180D32: + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8180CE8 + + thumb_func_start sub_8180D44 +sub_8180D44: @ 8180D44 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x3C] + subs r0, r1 + strh r0, [r4, 0x24] + adds r1, 0x1 + strh r1, [r4, 0x3C] + movs r0, 0x38 + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + movs r2, 0x3A + ldrsh r1, [r4, r2] + bl __divsi3 + lsls r0, 24 + lsrs r5, r0, 24 + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + ldrh r2, [r4, 0x3A] + movs r3, 0x3A + ldrsh r1, [r4, r3] + cmp r0, r1 + ble _08180D84 + strh r2, [r4, 0x38] +_08180D84: + movs r2, 0x80 + lsls r2, 1 + lsls r3, r5, 8 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + movs r1, 0x24 + ldrsh r0, [r4, r1] + movs r1, 0x8 + negs r1, r1 + cmp r0, r1 + bge _08180DAE + strh r1, [r4, 0x24] + movs r0, 0x2 + strh r0, [r4, 0x36] + movs r0, 0 + strh r0, [r4, 0x34] + strh r5, [r4, 0x32] + ldr r0, =sub_8180DC0 + str r0, [r4, 0x1C] +_08180DAE: + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8180D44 + + thumb_func_start sub_8180DC0 +sub_8180DC0: @ 8180DC0 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x34] + movs r2, 0x34 + ldrsh r0, [r4, r2] + cmp r0, 0xB + ble _08180E08 + ldrh r0, [r4, 0x32] + subs r0, 0x2 + strh r0, [r4, 0x32] + lsls r0, 16 + cmp r0, 0 + bge _08180DE2 + movs r0, 0 + strh r0, [r4, 0x32] +_08180DE2: + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x32] + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08180E1C + ldr r0, =sub_8180E28 + str r0, [r4, 0x1C] + b _08180E1C + .pool +_08180E08: + ldrh r0, [r4, 0x36] + ldrh r2, [r4, 0x24] + adds r0, r2 + strh r0, [r4, 0x24] + movs r2, 0x36 + ldrsh r0, [r4, r2] + negs r0, r0 + strh r0, [r4, 0x36] + adds r0, r1, 0x1 + strh r0, [r4, 0x34] +_08180E1C: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8180DC0 + + thumb_func_start sub_8180E28 +sub_8180E28: @ 8180E28 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x24] + adds r0, 0x2 + strh r0, [r4, 0x24] + lsls r0, 16 + cmp r0, 0 + ble _08180E4A + movs r0, 0 + strh r0, [r4, 0x24] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] +_08180E4A: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8180E28 + + thumb_func_start pokemonanimfunc_26 +pokemonanimfunc_26: @ 8180E5C + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + movs r0, 0 + strh r0, [r4, 0x34] + ldr r0, =sub_8180E78 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_26 + + thumb_func_start sub_8180E78 +sub_8180E78: @ 8180E78 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x24] + adds r0, 0x1 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x26] + subs r0, 0x1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x24] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08180EA2 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + bgt _08180EA2 + movs r0, 0xA + strh r0, [r4, 0x34] +_08180EA2: + movs r1, 0x24 + ldrsh r0, [r4, r1] + cmp r0, 0x7 + ble _08180EBA + movs r1, 0 + movs r0, 0x8 + strh r0, [r4, 0x24] + ldr r0, =0x0000fff8 + strh r0, [r4, 0x26] + strh r1, [r4, 0x36] + ldr r0, =sub_8180ED0 + str r0, [r4, 0x1C] +_08180EBA: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8180E78 + + thumb_func_start sub_8180ED0 +sub_8180ED0: @ 8180ED0 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r1, 0x36 + ldrsh r0, [r4, r1] + movs r1, 0x10 + bl cosine + subs r0, 0x8 + strh r0, [r4, 0x24] + movs r1, 0x36 + ldrsh r0, [r4, r1] + movs r1, 0x10 + bl sine + subs r0, 0x8 + strh r0, [r4, 0x26] + movs r1, 0x36 + ldrsh r0, [r4, r1] + cmp r0, 0x3F + ble _08180F08 + movs r0, 0xA0 + strh r0, [r4, 0x32] + movs r0, 0xA + strh r0, [r4, 0x34] + ldr r0, =sub_8180F2C + str r0, [r4, 0x1C] +_08180F08: + ldrh r0, [r4, 0x36] + adds r0, 0x8 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + ble _08180F1A + movs r0, 0x40 + strh r0, [r4, 0x36] +_08180F1A: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8180ED0 + + thumb_func_start sub_8180F2C +sub_8180F2C: @ 8180F2C + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x34] + movs r2, 0x34 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _08180F44 + subs r0, r1, 0x1 + strh r0, [r4, 0x34] + b _08180F96 +_08180F44: + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r1, 0x5 + bl cosine + subs r0, 0x4 + movs r5, 0 + strh r0, [r4, 0x24] + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0x5 + bl sine + negs r0, r0 + adds r0, 0x4 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + subs r0, 0x4 + strh r0, [r4, 0x32] + movs r0, 0x32 + ldrsh r3, [r4, r0] + subs r3, 0x20 + movs r2, 0x80 + lsls r2, 1 + lsls r3, 25 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x20 + bgt _08180F96 + strh r5, [r4, 0x24] + strh r5, [r4, 0x26] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] +_08180F96: + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8180F2C + + thumb_func_start pokemonanimfunc_27 +pokemonanimfunc_27: @ 8180FA8 + push {r4,lr} + adds r3, r0, 0 + ldrh r1, [r3, 0x34] + movs r2, 0x34 + ldrsh r0, [r3, r2] + cmp r0, 0 + ble _08180FBA + subs r0, r1, 0x1 + b _08180FFE +_08180FBA: + movs r2, 0 + movs r1, 0x36 + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _08180FC6 + movs r2, 0x1 +_08180FC6: + strh r2, [r3, 0x36] + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + lsls r2, 2 + ldrb r1, [r0] + movs r4, 0x5 + negs r4, r4 + adds r0, r4, 0 + ands r0, r1 + orrs r0, r2 + mov r1, r12 + strb r0, [r1] + ldrh r0, [r3, 0x32] + adds r0, 0x1 + strh r0, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _08180FFC + ldrb r0, [r1] + adds r1, r4, 0 + ands r1, r0 + mov r2, r12 + strb r1, [r2] + ldr r0, =sub_8184D88 + str r0, [r3, 0x1C] +_08180FFC: + movs r0, 0x2 +_08180FFE: + strh r0, [r3, 0x34] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_27 + + thumb_func_start pokemonanimfunc_28 +pokemonanimfunc_28: @ 818100C + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + ldr r0, =sub_8181024 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_28 + + thumb_func_start sub_8181024 +sub_8181024: @ 8181024 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x24] + subs r0, 0x1 + strh r0, [r4, 0x24] + ldrh r1, [r4, 0x26] + adds r1, 0x1 + strh r1, [r4, 0x26] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bgt _08181054 + ldr r0, =0x0000fff0 + strh r0, [r4, 0x24] + movs r0, 0x10 + strh r0, [r4, 0x26] + ldr r0, =sub_8181068 + str r0, [r4, 0x1C] + movs r0, 0xA0 + strh r0, [r4, 0x32] +_08181054: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8181024 + + thumb_func_start sub_8181068 +sub_8181068: @ 8181068 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x32] + subs r0, 0x4 + strh r0, [r4, 0x32] + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r1, 0x16 + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r1, 0x16 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + movs r0, 0x32 + ldrsh r3, [r4, r0] + subs r3, 0x20 + movs r2, 0x80 + lsls r2, 1 + lsls r3, 25 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x20 + bgt _081810B2 + ldr r0, =sub_81810C4 + str r0, [r4, 0x1C] +_081810B2: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8181068 + + thumb_func_start sub_81810C4 +sub_81810C4: @ 81810C4 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x24] + subs r1, 0x1 + strh r1, [r4, 0x24] + ldrh r0, [r4, 0x26] + adds r0, 0x1 + strh r0, [r4, 0x26] + lsls r1, 16 + cmp r1, 0 + bgt _081810E8 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] +_081810E8: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81810C4 + + thumb_func_start pokemonanimfunc_29 +pokemonanimfunc_29: @ 81810F8 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + ldr r0, =sub_8181110 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_29 + + thumb_func_start sub_8181110 +sub_8181110: @ 8181110 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x24] + adds r1, 0x1 + strh r1, [r4, 0x24] + ldrh r0, [r4, 0x26] + subs r0, 0x1 + strh r0, [r4, 0x26] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0xF + ble _08181134 + movs r0, 0 + strh r0, [r4, 0x32] + ldr r0, =sub_8181144 + str r0, [r4, 0x1C] +_08181134: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8181110 + + thumb_func_start sub_8181144 +sub_8181144: @ 8181144 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x32] + adds r0, 0x10 + strh r0, [r4, 0x32] + ldrh r2, [r4, 0x24] + movs r0, 0x24 + ldrsh r1, [r4, r0] + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + bgt _0818117C + ldr r0, =0x0000fff0 + strh r0, [r4, 0x24] + movs r0, 0x10 + strh r0, [r4, 0x26] + movs r0, 0 + strh r0, [r4, 0x32] + ldr r0, =sub_81811A4 + str r0, [r4, 0x1C] + b _08181186 + .pool +_0818117C: + subs r0, r2, 0x2 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x26] + adds r0, 0x2 + strh r0, [r4, 0x26] +_08181186: + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x32] + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8181144 + + thumb_func_start sub_81811A4 +sub_81811A4: @ 81811A4 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x24] + adds r1, 0x1 + movs r2, 0 + strh r1, [r4, 0x24] + ldrh r0, [r4, 0x26] + subs r0, 0x1 + strh r0, [r4, 0x26] + lsls r1, 16 + cmp r1, 0 + blt _081811CE + strh r2, [r4, 0x24] + strh r2, [r4, 0x26] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] +_081811CE: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81811A4 + + thumb_func_start pokemonanimfunc_2A +pokemonanimfunc_2A: @ 81811E0 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x2 + strh r0, [r1, 0x2] + adds r0, r4, 0 + bl sub_8181214 + ldr r0, =sub_8181214 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_2A + + thumb_func_start sub_8181214 +sub_8181214: @ 8181214 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r6, =0x03001240 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r6 + ldrh r0, [r1] + cmp r0, 0 + beq _08181238 + subs r0, 0x1 + strh r0, [r1] + b _0818134A + .pool +_08181238: + adds r0, r4, 0 + bl sub_817F70C + ldrh r0, [r4, 0x32] + movs r1, 0x32 + ldrsh r5, [r4, r1] + cmp r5, 0 + bne _08181270 + adds r0, 0x1 + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F670 + movs r2, 0x2E + ldrsh r1, [r4, r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrh r0, [r0, 0x2] + strh r0, [r4, 0x3C] + ldr r0, =0x0000ffff + strh r0, [r4, 0x34] + movs r0, 0x1 + negs r0, r0 + strh r0, [r4, 0x36] + strh r5, [r4, 0x38] + strh r5, [r4, 0x3A] +_08181270: + movs r3, 0x3C + ldrsh r1, [r4, r3] + movs r6, 0x34 + ldrsh r0, [r4, r6] + lsls r0, 1 + muls r1, r0 + ldrh r0, [r4, 0x24] + adds r1, r0 + strh r1, [r4, 0x24] + ldrh r2, [r4, 0x3C] + ldrh r0, [r4, 0x36] + adds r3, r0, 0 + muls r3, r2 + adds r0, r3, 0 + ldrh r6, [r4, 0x26] + adds r2, r0, r6 + strh r2, [r4, 0x26] + ldrh r0, [r4, 0x3A] + adds r0, 0x8 + strh r0, [r4, 0x3A] + adds r1, 0xF + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0x1E + bls _081812B8 + movs r1, 0x34 + ldrsh r0, [r4, r1] + lsls r0, 4 + strh r0, [r4, 0x24] + movs r2, 0x34 + ldrsh r0, [r4, r2] + negs r0, r0 + strh r0, [r4, 0x34] + b _081812D4 + .pool +_081812B8: + adds r0, r2, 0 + adds r0, 0xF + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1E + bls _081812DA + movs r3, 0x36 + ldrsh r0, [r4, r3] + lsls r0, 4 + strh r0, [r4, 0x26] + movs r6, 0x36 + ldrsh r0, [r4, r6] + negs r0, r0 + strh r0, [r4, 0x36] +_081812D4: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] +_081812DA: + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x5 + ble _08181332 + movs r2, 0x24 + ldrsh r0, [r4, r2] + cmp r0, 0 + bgt _08181332 + movs r3, 0 + strh r3, [r4, 0x24] + strh r3, [r4, 0x26] + ldr r5, =0x03001240 + movs r6, 0x2E + ldrsh r0, [r4, r6] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrh r2, [r1, 0x4] + movs r6, 0x4 + ldrsh r0, [r1, r6] + cmp r0, 0x1 + ble _08181328 + subs r0, r2, 0x1 + strh r0, [r1, 0x4] + strh r3, [r4, 0x38] + strh r3, [r4, 0x3A] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0xA + strh r1, [r0] + b _08181332 + .pool +_08181328: + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] +_08181332: + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x3A] + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F70C +_0818134A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8181214 + + thumb_func_start pokemonanimfunc_2B +pokemonanimfunc_2B: @ 8181354 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + movs r0, 0 + strh r0, [r4, 0x3A] + strh r0, [r4, 0x3C] + ldr r0, =sub_8181370 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_2B + + thumb_func_start sub_8181370 +sub_8181370: @ 8181370 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x3A] + adds r0, 0x4 + strh r0, [r4, 0x3A] + movs r1, 0x3A + ldrsh r0, [r4, r1] + movs r1, 0x10 + bl sine + negs r0, r0 + strh r0, [r4, 0x24] + movs r1, 0x3A + ldrsh r0, [r4, r1] + lsls r0, 1 + movs r1, 0xFF + ands r0, r1 + movs r1, 0x8 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0xC0 + ble _081813BA + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _081813BA + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + b _081813D2 +_081813BA: + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0x40 + ble _081813DE + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081813DE + ldr r1, =0xffffff00 + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 +_081813D2: + movs r3, 0 + bl sub_817F6D4 + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] +_081813DE: + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0xFF + ble _08181404 + movs r0, 0 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] +_08181404: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8181370 + + thumb_func_start pokemonanimfunc_2C +pokemonanimfunc_2C: @ 8181418 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + movs r2, 0 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _08181442 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + adds r0, r1 + strh r0, [r4, 0x3C] + strh r2, [r4, 0x3A] + strh r2, [r4, 0x38] + strh r2, [r4, 0x36] +_08181442: + ldr r1, =gUnknown_0860AA64 + movs r2, 0x3A + ldrsh r0, [r4, r2] + lsls r2, r0, 1 + adds r0, r1, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + cmp r0, 0xFF + bne _08181464 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _081814CE + .pool +_08181464: + movs r3, 0x36 + ldrsh r0, [r4, r3] + cmp r0, 0x1 + bne _0818149A + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08181488 + ldrh r0, [r4, 0x3C] + ldr r3, =0x000003ff + movs r1, 0x10 + movs r2, 0x10 + bl pal_fade_1 + b _08181494 + .pool +_08181488: + ldrh r0, [r4, 0x3C] + ldr r3, =0x000003ff + movs r1, 0x10 + movs r2, 0 + bl pal_fade_1 +_08181494: + movs r0, 0 + strh r0, [r4, 0x36] + ldr r1, =gUnknown_0860AA64 +_0818149A: + movs r2, 0x3A + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r1, 0x1 + adds r0, r1 + ldrb r1, [r0] + movs r3, 0x38 + ldrsh r0, [r4, r3] + cmp r1, r0 + bne _081814C8 + movs r1, 0 + movs r0, 0x1 + strh r0, [r4, 0x36] + strh r1, [r4, 0x38] + ldrh r0, [r4, 0x3A] + adds r0, 0x1 + strh r0, [r4, 0x3A] + b _081814CE + .pool +_081814C8: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] +_081814CE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_2C + + thumb_func_start sub_81814D4 +sub_81814D4: @ 81814D4 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _081814E6 + adds r0, r6, 0 + bl sub_817F670 +_081814E6: + adds r0, r6, 0 + bl sub_817F70C + ldr r4, =0x03001240 + movs r3, 0x2E + ldrsh r1, [r6, r3] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r4 + movs r0, 0x32 + ldrsh r1, [r6, r0] + movs r3, 0x8 + ldrsh r0, [r2, r3] + cmp r1, r0 + ble _0818154C + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + movs r3, 0 + strh r3, [r6, 0x24] + movs r0, 0x2E + ldrsh r1, [r6, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r4 + ldrh r2, [r1, 0x4] + movs r4, 0x4 + ldrsh r0, [r1, r4] + cmp r0, 0x1 + ble _0818153C + subs r0, r2, 0x1 + strh r0, [r1, 0x4] + strh r3, [r6, 0x32] + b _08181588 + .pool +_0818153C: + adds r0, r6, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r6, 0x1C] + b _08181588 + .pool +_0818154C: + movs r1, 0x32 + ldrsh r0, [r6, r1] + lsls r0, 8 + movs r3, 0x8 + ldrsh r1, [r2, r3] + bl __divsi3 + adds r4, r0, 0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + movs r1, 0xA + bl sine + negs r0, r0 + strh r0, [r6, 0x24] + movs r5, 0x80 + lsls r5, 1 + ldr r1, =0x00000ccc + adds r0, r4, 0 + bl sine + adds r3, r0, 0 + lsls r3, 16 + lsrs r3, 16 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r5, 0 + bl sub_817F6D4 +_08181588: + ldrh r0, [r6, 0x32] + adds r0, 0x1 + strh r0, [r6, 0x32] + adds r0, r6, 0 + bl sub_817F70C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81814D4 + + thumb_func_start pokemonanimfunc_2D +pokemonanimfunc_2D: @ 81815A0 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x32 + strh r0, [r1, 0x8] + adds r0, r4, 0 + bl sub_81814D4 + ldr r0, =sub_81814D4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_2D + + thumb_func_start sub_81815D4 +sub_81815D4: @ 81815D4 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _081815E6 + adds r0, r6, 0 + bl sub_817F670 +_081815E6: + adds r0, r6, 0 + bl sub_817F70C + ldr r4, =0x03001240 + movs r3, 0x2E + ldrsh r1, [r6, r3] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r4 + movs r0, 0x32 + ldrsh r1, [r6, r0] + movs r3, 0x8 + ldrsh r0, [r2, r3] + cmp r1, r0 + ble _0818164C + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + movs r3, 0 + strh r3, [r6, 0x24] + movs r0, 0x2E + ldrsh r1, [r6, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r4 + ldrh r2, [r1, 0x4] + movs r4, 0x4 + ldrsh r0, [r1, r4] + cmp r0, 0x1 + ble _0818163C + subs r0, r2, 0x1 + strh r0, [r1, 0x4] + strh r3, [r6, 0x32] + b _0818168A + .pool +_0818163C: + adds r0, r6, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r6, 0x1C] + b _0818168A + .pool +_0818164C: + movs r1, 0x32 + ldrsh r0, [r6, r1] + lsls r0, 8 + movs r3, 0x8 + ldrsh r1, [r2, r3] + bl __divsi3 + adds r4, r0, 0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + movs r1, 0xA + bl sine + negs r0, r0 + strh r0, [r6, 0x24] + movs r5, 0x80 + lsls r5, 1 + ldr r1, =0x00000ccc + adds r0, r4, 0 + bl sine + adds r3, r0, 0 + negs r3, r3 + lsls r3, 16 + lsrs r3, 16 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r5, 0 + bl sub_817F6D4 +_0818168A: + ldrh r0, [r6, 0x32] + adds r0, 0x1 + strh r0, [r6, 0x32] + adds r0, r6, 0 + bl sub_817F70C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81815D4 + + thumb_func_start pokemonanimfunc_2E +pokemonanimfunc_2E: @ 81816A0 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x32 + strh r0, [r1, 0x8] + adds r0, r4, 0 + bl sub_81815D4 + ldr r0, =sub_81815D4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_2E + + thumb_func_start pokemonanimfunc_2F +pokemonanimfunc_2F: @ 81816D4 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + adds r0, r4, 0 + adds r0, 0x28 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 1 + movs r1, 0xA + bl __divsi3 + negs r0, r0 + strh r0, [r4, 0x3A] + movs r0, 0x80 + strh r0, [r4, 0x3C] + ldr r0, =sub_8181708 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_2F + + thumb_func_start sub_8181708 +sub_8181708: @ 8181708 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x3C] + subs r0, 0x1 + strh r0, [r4, 0x3C] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r2, 0x3A + ldrsh r1, [r4, r2] + bl cosine + ldrh r1, [r4, 0x3A] + adds r0, r1 + strh r0, [r4, 0x24] + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r2, 0x3A + ldrsh r1, [r4, r2] + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x3C] + subs r3, 0x80 + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x78 + bgt _08181760 + movs r0, 0x78 + strh r0, [r4, 0x3C] + movs r0, 0 + strh r0, [r4, 0x34] + ldr r0, =sub_8181770 + str r0, [r4, 0x1C] +_08181760: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8181708 + + thumb_func_start sub_8181770 +sub_8181770: @ 8181770 + push {lr} + adds r1, r0, 0 + movs r2, 0x34 + ldrsh r0, [r1, r2] + cmp r0, 0x14 + bne _08181784 + ldr r0, =sub_8181794 + str r0, [r1, 0x1C] + movs r0, 0 + strh r0, [r1, 0x34] +_08181784: + ldrh r0, [r1, 0x34] + adds r0, 0x1 + strh r0, [r1, 0x34] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8181770 + + thumb_func_start sub_8181794 +sub_8181794: @ 8181794 + push {r4-r6,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x3C] + adds r0, 0x2 + movs r6, 0 + strh r0, [r4, 0x3C] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r2, 0x3A + ldrsh r1, [r4, r2] + bl cosine + ldrh r1, [r4, 0x3A] + adds r0, r1 + strh r0, [r4, 0x24] + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r2, 0x3A + ldrsh r1, [r4, r2] + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + movs r5, 0x80 + lsls r5, 1 + ldrh r3, [r4, 0x3C] + subs r3, 0x80 + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r5, 0 + bl sub_817F6D4 + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x7F + ble _08181800 + strh r6, [r4, 0x24] + strh r6, [r4, 0x26] + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r5, 0 + movs r3, 0 + bl sub_817F6D4 + strh r6, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =pokemonanimfunc_10 + str r0, [r4, 0x1C] +_08181800: + adds r0, r4, 0 + bl sub_817F70C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8181794 + + thumb_func_start sub_8181810 +sub_8181810: @ 8181810 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r4, =0x03001240 + movs r0, 0x2E + ldrsh r1, [r5, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r4 + ldrh r0, [r1] + adds r6, r0, 0 + cmp r6, 0 + beq _08181834 + subs r0, 0x1 + strh r0, [r1] + b _08181950 + .pool +_08181834: + movs r1, 0x32 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0818184A + adds r0, r5, 0 + bl sub_817F670 + strh r6, [r5, 0x36] + strh r6, [r5, 0x38] + movs r0, 0x1 + strh r0, [r5, 0x32] +_0818184A: + movs r3, 0x38 + ldrsh r0, [r5, r3] + cmp r0, 0 + bne _081818A2 + movs r1, 0x36 + ldrsh r0, [r5, r1] + movs r4, 0x80 + lsls r4, 1 + adds r1, r4, 0 + bl sine + strh r0, [r5, 0x3C] + movs r3, 0x36 + ldrsh r0, [r5, r3] + movs r1, 0x10 + bl sine + strh r0, [r5, 0x26] + movs r1, 0x36 + ldrsh r0, [r5, r1] + movs r1, 0x20 + bl sine + adds r1, r0, 0 + strh r1, [r5, 0x3A] + subs r1, r4, r1 + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r5, 0x3C] + adds r2, r4 + lsls r2, 16 + asrs r2, 16 + adds r0, r5, 0 + movs r3, 0 + bl sub_817F6D4 + movs r3, 0x36 + ldrsh r0, [r5, r3] + cmp r0, 0x80 + bne _0818193A + strh r6, [r5, 0x36] + movs r0, 0x1 + strh r0, [r5, 0x38] + b _0818193A +_081818A2: + cmp r0, 0x1 + bne _0818193A + movs r1, 0x36 + ldrsh r0, [r5, r1] + movs r1, 0x20 + bl sine + strh r0, [r5, 0x3C] + movs r3, 0x36 + ldrsh r0, [r5, r3] + movs r1, 0x8 + bl sine + negs r0, r0 + strh r0, [r5, 0x26] + movs r1, 0x36 + ldrsh r0, [r5, r1] + movs r1, 0x80 + bl sine + adds r1, r0, 0 + strh r1, [r5, 0x3A] + movs r3, 0x80 + lsls r3, 1 + adds r2, r3, 0 + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + ldrh r0, [r5, 0x3C] + subs r2, r0 + lsls r2, 16 + asrs r2, 16 + adds r0, r5, 0 + movs r3, 0 + bl sub_817F6D4 + movs r1, 0x36 + ldrsh r0, [r5, r1] + cmp r0, 0x80 + bne _0818193A + movs r3, 0x2E + ldrsh r0, [r5, r3] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r2, [r1, 0x4] + movs r3, 0x4 + ldrsh r0, [r1, r3] + cmp r0, 0x1 + ble _08181922 + subs r0, r2, 0x1 + strh r0, [r1, 0x4] + movs r0, 0x2E + ldrsh r1, [r5, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xA + strh r1, [r0] + strh r6, [r5, 0x36] + strh r6, [r5, 0x38] + b _0818193A +_08181922: + movs r2, 0x80 + lsls r2, 1 + adds r0, r5, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r5, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r5, 0x1C] +_0818193A: + ldr r2, =0x03001240 + movs r3, 0x2E + ldrsh r1, [r5, r3] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x6] + ldrh r1, [r5, 0x36] + adds r0, r1 + strh r0, [r5, 0x36] +_08181950: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8181810 + + thumb_func_start pokemonanimfunc_30 +pokemonanimfunc_30: @ 8181960 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x4 + strh r0, [r1, 0x6] + adds r0, r4, 0 + bl sub_8181810 + ldr r0, =sub_8181810 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_30 + + thumb_func_start pokemonanimfunc_31 +pokemonanimfunc_31: @ 8181994 + push {r4,r5,lr} + adds r5, r0, 0 + movs r0, 0x32 + ldrsh r4, [r5, r0] + adds r0, r5, 0 + bl sub_817F70C + movs r0, 0x80 + lsls r0, 2 + cmp r4, r0 + ble _081819B8 + ldr r0, =sub_8184D88 + str r0, [r5, 0x1C] + movs r0, 0 + strh r0, [r5, 0x24] + b _08181A62 + .pool +_081819B8: + movs r1, 0x32 + ldrsh r0, [r5, r1] + cmp r0, 0 + bge _081819C2 + adds r0, 0x7F +_081819C2: + asrs r0, 7 + cmp r0, 0x1 + beq _081819F8 + cmp r0, 0x1 + bgt _081819D2 + cmp r0, 0 + beq _081819DC + b _08181A48 +_081819D2: + cmp r0, 0x2 + beq _08181A12 + cmp r0, 0x3 + beq _08181A2A + b _08181A48 +_081819DC: + adds r0, r4, 0 + cmp r4, 0 + bge _081819E4 + adds r0, 0x7F +_081819E4: + asrs r0, 7 + lsls r0, 7 + subs r0, r4, r0 + lsls r0, 3 + negs r0, r0 + cmp r0, 0 + bge _081819F4 + adds r0, 0x7F +_081819F4: + asrs r0, 7 + b _08181A46 +_081819F8: + adds r0, r4, 0 + cmp r4, 0 + bge _08181A00 + adds r0, 0x7F +_08181A00: + asrs r0, 7 + lsls r0, 7 + subs r0, r4, r0 + cmp r0, 0 + bge _08181A0C + adds r0, 0xF +_08181A0C: + asrs r0, 4 + subs r0, 0x8 + b _08181A46 +_08181A12: + adds r0, r4, 0 + cmp r4, 0 + bge _08181A1A + adds r0, 0x7F +_08181A1A: + asrs r0, 7 + lsls r0, 7 + subs r0, r4, r0 + cmp r0, 0 + bge _08181A26 + adds r0, 0xF +_08181A26: + asrs r0, 4 + b _08181A46 +_08181A2A: + adds r0, r4, 0 + cmp r4, 0 + bge _08181A32 + adds r0, 0x7F +_08181A32: + asrs r0, 7 + lsls r0, 7 + subs r0, r4, r0 + lsls r0, 3 + negs r0, r0 + cmp r0, 0 + bge _08181A42 + adds r0, 0x7F +_08181A42: + asrs r0, 7 + adds r0, 0x8 +_08181A46: + strh r0, [r5, 0x24] +_08181A48: + adds r0, r4, 0 + cmp r4, 0 + bge _08181A50 + adds r0, 0x7F +_08181A50: + asrs r0, 7 + lsls r0, 7 + subs r0, r4, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + negs r0, r0 +_08181A62: + strh r0, [r5, 0x26] + ldrh r0, [r5, 0x32] + adds r0, 0xC + strh r0, [r5, 0x32] + adds r0, r5, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_31 + + thumb_func_start pokemonanimfunc_32 +pokemonanimfunc_32: @ 8181A78 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldr r0, =0x0000ffff + strh r0, [r1, 0x8] + adds r0, r4, 0 + bl sub_817F670 + strh r5, [r4, 0x34] + adds r0, r4, 0 + bl sub_8181ABC + ldr r0, =sub_8181ABC + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_32 + + thumb_func_start sub_8181ABC +sub_8181ABC: @ 8181ABC + push {r4-r6,lr} + adds r4, r0, 0 + ldr r6, =0x03001240 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r6 + ldrh r0, [r1] + adds r5, r0, 0 + cmp r5, 0 + beq _08181AE0 + subs r0, 0x1 + strh r0, [r1] + b _08181B44 + .pool +_08181AE0: + adds r0, r4, 0 + bl sub_817F70C + movs r1, 0x32 + ldrsh r2, [r4, r1] + adds r0, r2, 0 + cmp r0, 0x80 + ble _08181AFC + strh r5, [r4, 0x32] + ldr r0, =sub_8181B4C + str r0, [r4, 0x1C] + b _08181B3E + .pool +_08181AFC: + movs r1, 0x2E + ldrsh r0, [r4, r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + movs r3, 0x8 + ldrsh r0, [r1, r3] + lsls r3, r0, 3 + adds r0, r2, 0 + cmp r2, 0 + bge _08181B16 + adds r0, 0x7F +_08181B16: + asrs r0, 7 + lsls r0, 7 + subs r1, r2, r0 + adds r0, r3, 0 + muls r0, r1 + cmp r0, 0 + bge _08181B26 + adds r0, 0x7F +_08181B26: + asrs r0, 7 + strh r0, [r4, 0x24] + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0xC + strh r0, [r4, 0x32] +_08181B3E: + adds r0, r4, 0 + bl sub_817F70C +_08181B44: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8181ABC + + thumb_func_start sub_8181B4C +sub_8181B4C: @ 8181B4C + push {r4-r6,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x30 + ble _08181B7C + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + movs r0, 0 + strh r0, [r4, 0x26] + strh r0, [r4, 0x32] + ldr r0, =sub_8181C2C + str r0, [r4, 0x1C] + b _08181C1A + .pool +_08181B7C: + movs r2, 0x36 + ldrsh r0, [r4, r2] + movs r1, 0x40 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r6, r1, 0 + adds r0, r6 + lsls r0, 16 + lsrs r3, r0, 16 + ldrh r0, [r4, 0x32] + subs r0, 0x10 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xF + bhi _08181BBA + ldrh r0, [r4, 0x34] + adds r0, 0x8 + strh r0, [r4, 0x34] + ldr r2, =0x03001240 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x24] + ldrh r0, [r0, 0x8] + subs r1, r0 + strh r1, [r4, 0x24] +_08181BBA: + movs r5, 0 + lsls r1, r3, 16 + asrs r2, r1, 16 + lsls r0, r6, 16 + asrs r0, 16 + adds r6, r1, 0 + cmp r2, r0 + ble _08181BD6 + subs r0, r2 + cmp r0, 0 + bge _08181BD2 + adds r0, 0x7 +_08181BD2: + lsls r0, 13 + lsrs r5, r0, 16 +_08181BD6: + movs r1, 0x34 + ldrsh r0, [r4, r1] + movs r1, 0x14 + bl sine + negs r0, r0 + lsls r1, r5, 16 + asrs r1, 16 + subs r0, r1 + strh r0, [r4, 0x26] + movs r2, 0x36 + ldrsh r0, [r4, r2] + movs r1, 0x20 + bl sine + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + asrs r2, r6, 16 + adds r0, r4, 0 + movs r3, 0 + bl sub_817F6D4 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x36] + adds r0, 0x8 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x36] +_08181C1A: + adds r0, r4, 0 + bl sub_817F70C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8181B4C + + thumb_func_start sub_8181C2C +sub_8181C2C: @ 8181C2C + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r3, [r4, r0] + cmp r3, 0x80 + ble _08181C90 + ldr r3, =0x03001240 + movs r1, 0x2E + ldrsh r0, [r4, r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrh r2, [r1, 0x4] + movs r5, 0x4 + ldrsh r0, [r1, r5] + cmp r0, 0x1 + ble _08181C7C + subs r0, r2, 0x1 + movs r2, 0 + strh r0, [r1, 0x4] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0xA + strh r1, [r0] + strh r2, [r4, 0x34] + strh r2, [r4, 0x32] + strh r2, [r4, 0x36] + ldr r0, =sub_8181ABC + b _08181C84 + .pool +_08181C7C: + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 +_08181C84: + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x24] + b _08181CD0 + .pool +_08181C90: + ldr r2, =0x03001240 + movs r5, 0x2E + ldrsh r1, [r4, r5] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x8 + ldrsh r5, [r0, r1] + lsls r1, r5, 3 + adds r0, r3, 0 + cmp r3, 0 + bge _08181CAC + adds r0, 0x7F +_08181CAC: + asrs r0, 7 + lsls r0, 7 + subs r2, r3, r0 + adds r0, r1, 0 + muls r0, r2 + cmp r0, 0 + bge _08181CBC + adds r0, 0x7F +_08181CBC: + asrs r0, 7 + lsls r1, r5, 3 + subs r0, r1 + strh r0, [r4, 0x24] + lsls r0, r2, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + negs r0, r0 +_08181CD0: + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0xC + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8181C2C + + thumb_func_start sub_8181CE8 +sub_8181CE8: @ 8181CE8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08181D00 + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] +_08181D00: + adds r0, r4, 0 + bl sub_817F70C + movs r3, 0x3C + ldrsh r0, [r4, r3] + cmp r0, 0xFE + ble _08181D60 + movs r5, 0 + strh r5, [r4, 0x24] + strh r5, [r4, 0x26] + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + ldr r2, =0x03001240 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + ldrh r2, [r1, 0x4] + movs r3, 0x4 + ldrsh r0, [r1, r3] + cmp r0, 0x1 + ble _08181D48 + subs r0, r2, 0x1 + strh r0, [r1, 0x4] + strh r5, [r4, 0x32] + strh r5, [r4, 0x3C] + b _08181D52 + .pool +_08181D48: + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] +_08181D52: + adds r0, r4, 0 + bl sub_817F70C + b _08181DA6 + .pool +_08181D60: + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x10 + bl sine + negs r0, r0 + strh r0, [r4, 0x24] + movs r3, 0x3C + ldrsh r0, [r4, r3] + movs r1, 0x20 + bl sine + adds r3, r0, 0 + movs r2, 0x80 + lsls r2, 1 + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + ldr r2, =0x03001240 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x6] + ldrh r1, [r4, 0x3C] + adds r0, r1 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_817F70C +_08181DA6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8181CE8 + + thumb_func_start pokemonanimfunc_33 +pokemonanimfunc_33: @ 8181DB0 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x4 + strh r0, [r1, 0x6] + adds r0, r4, 0 + bl sub_8181CE8 + ldr r0, =sub_8181CE8 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_33 + + thumb_func_start pokemonanimfunc_34 +pokemonanimfunc_34: @ 8181DE4 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08181DFC + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] +_08181DFC: + adds r0, r4, 0 + bl sub_817F70C + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0xFE + ble _08181E34 + movs r0, 0 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + adds r0, r4, 0 + bl sub_817F70C + b _08181E8A + .pool +_08181E34: + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x10 + bl sine + negs r0, r0 + strh r0, [r4, 0x24] + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08181E4E + adds r0, 0x7F +_08181E4E: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x10 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x20 + bl sine + adds r3, r0, 0 + movs r2, 0x80 + lsls r2, 1 + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + ldrh r0, [r4, 0x3C] + adds r0, 0x8 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_817F70C +_08181E8A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_34 + + thumb_func_start pokemonanimfunc_35 +pokemonanimfunc_35: @ 8181E90 + push {r4,r5,lr} + adds r3, r0, 0 + movs r1, 0x32 + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _08181E9E + strh r0, [r3, 0x3C] +_08181E9E: + ldrh r4, [r3, 0x32] + movs r5, 0x32 + ldrsh r1, [r3, r5] + ldrh r2, [r3, 0x3C] + movs r5, 0x3C + ldrsh r0, [r3, r5] + cmp r1, r0 + bne _08181EC8 + movs r0, 0 + strh r0, [r3, 0x3C] + adds r0, r4, 0x1 + strh r0, [r3, 0x32] + adds r1, r3, 0 + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + adds r2, r1, 0 + b _08181ED8 +_08181EC8: + adds r0, r2, 0x1 + strh r0, [r3, 0x3C] + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_08181ED8: + movs r1, 0x32 + ldrsh r0, [r3, r1] + cmp r0, 0xA + ble _08181EEE + ldrb r0, [r2] + movs r1, 0x5 + negs r1, r1 + ands r1, r0 + strb r1, [r2] + ldr r0, =sub_8184D88 + str r0, [r3, 0x1C] +_08181EEE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_35 + + thumb_func_start pokemonanimfunc_36 +pokemonanimfunc_36: @ 8181EF8 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + movs r0, 0 + strh r0, [r4, 0x3C] + ldr r0, =sub_8181F14 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_36 + + thumb_func_start sub_8181F14 +sub_8181F14: @ 8181F14 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x3C] + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0x1F + ble _08181F34 + movs r0, 0 + movs r1, 0x20 + strh r1, [r4, 0x3C] + strh r0, [r4, 0x32] + ldr r0, =sub_8181F50 + str r0, [r4, 0x1C] + b _08181F38 + .pool +_08181F34: + adds r0, r1, 0x4 + strh r0, [r4, 0x3C] +_08181F38: + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x3C] + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8181F14 + + thumb_func_start sub_8181F50 +sub_8181F50: @ 8181F50 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r0, 0x80 + lsls r0, 2 + cmp r1, r0 + ble _08181F74 + ldr r0, =sub_8181FC0 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x3A] + b _08181FAE + .pool +_08181F74: + movs r1, 0x32 + ldrsh r0, [r4, r1] + lsls r0, 4 + negs r0, r0 + cmp r0, 0 + bge _08181F84 + ldr r1, =0x000001ff + adds r0, r1 +_08181F84: + asrs r0, 9 + strh r0, [r4, 0x24] + movs r0, 0x32 + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08181F94 + adds r0, 0x7F +_08181F94: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x4 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0xC + strh r0, [r4, 0x32] +_08181FAE: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8181F50 + + thumb_func_start sub_8181FC0 +sub_8181FC0: @ 8181FC0 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x3C] + subs r0, 0x2 + movs r1, 0 + strh r0, [r4, 0x3C] + lsls r0, 16 + cmp r0, 0 + bge _08181FEC + strh r1, [r4, 0x3C] + strh r1, [r4, 0x24] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _08181FFE + .pool +_08181FEC: + movs r1, 0x3C + ldrsh r0, [r4, r1] + lsls r0, 17 + asrs r0, 16 + movs r1, 0x10 + bl sine + negs r0, r0 + strh r0, [r4, 0x24] +_08181FFE: + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x3C] + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8181FC0 + + thumb_func_start pokemonanimfunc_37 +pokemonanimfunc_37: @ 818201C + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08182036 + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] +_08182036: + adds r0, r4, 0 + bl sub_817F70C + ldrh r1, [r4, 0x3C] + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0xFF + ble _08182060 + movs r0, 0 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _081820A6 + .pool +_08182060: + adds r0, r1, 0 + adds r0, 0x10 + strh r0, [r4, 0x3C] + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08182072 + adds r0, 0x7F +_08182072: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + negs r0, r0 + strh r0, [r4, 0x24] + movs r2, 0x3C + ldrsh r1, [r4, r2] + adds r0, r1, 0 + cmp r1, 0 + bge _08182092 + adds r0, 0x7F +_08182092: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] +_081820A6: + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _081820B2 + adds r0, 0x7F +_081820B2: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x10 + bl sine + adds r3, r0, 0 + movs r2, 0x80 + lsls r2, 1 + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_37 + + thumb_func_start pokemonanimfunc_38 +pokemonanimfunc_38: @ 81820E0 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + movs r0, 0 + strh r0, [r4, 0x3C] + strh r0, [r4, 0x36] + ldr r0, =sub_81820FC + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_38 + + thumb_func_start sub_81820FC +sub_81820FC: @ 81820FC + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x3C] + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0x18 + ble _0818212C + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0818214A + movs r0, 0 + strh r0, [r4, 0x36] + ldr r0, =sub_818216C + str r0, [r4, 0x1C] + b _0818214A + .pool +_0818212C: + adds r0, r1, 0x2 + strh r0, [r4, 0x3C] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl sine + strh r0, [r4, 0x24] + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r1, 0x8 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] +_0818214A: + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x3C] + negs r3, r3 + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81820FC + + thumb_func_start sub_818216C +sub_818216C: @ 818216C + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x3C] + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0x20 + ble _0818218C + movs r0, 0x1 + strh r0, [r4, 0x3A] + ldr r0, =sub_81821CC + str r0, [r4, 0x1C] + b _081821AA + .pool +_0818218C: + adds r0, r1, 0x2 + strh r0, [r4, 0x3C] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl sine + strh r0, [r4, 0x24] + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r1, 0x8 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] +_081821AA: + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x3C] + negs r3, r3 + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_818216C + + thumb_func_start sub_81821CC +sub_81821CC: @ 81821CC + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r1, 0x3A + ldrsh r0, [r4, r1] + lsls r0, 2 + ldrh r1, [r4, 0x3C] + adds r0, r1 + strh r0, [r4, 0x3C] + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x9 + ble _081821F0 + movs r0, 0x20 + strh r0, [r4, 0x3C] + ldr r0, =sub_8182248 + str r0, [r4, 0x1C] +_081821F0: + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3C] + subs r0, 0x1D + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bls _08182224 + movs r1, 0x3A + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0x3A] + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] +_08182224: + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x3C] + negs r3, r3 + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81821CC + + thumb_func_start sub_8182248 +sub_8182248: @ 8182248 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x3C] + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0 + bgt _08182270 + movs r0, 0 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _0818228E + .pool +_08182270: + subs r0, r1, 0x2 + strh r0, [r4, 0x3C] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl sine + strh r0, [r4, 0x24] + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r1, 0x8 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] +_0818228E: + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x3C] + negs r3, r3 + lsls r3, 24 + lsrs r3, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8182248 + + thumb_func_start pokemonanimfunc_39 +pokemonanimfunc_39: @ 81822B0 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x32] + movs r2, 0x32 + ldrsh r0, [r4, r2] + cmp r0, 0x28 + ble _081822D0 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x24] + b _0818235C + .pool +_081822D0: + movs r0, 0x1 + ands r0, r1 + movs r5, 0xFF + cmp r0, 0 + bne _081822DC + movs r5, 0x1 +_081822DC: + movs r0, 0x32 + ldrsh r2, [r4, r0] + adds r0, r2, 0 + cmp r2, 0 + bge _081822E8 + adds r0, r2, 0x3 +_081822E8: + asrs r0, 2 + lsls r0, 2 + subs r0, r2, r0 + lsls r0, 16 + asrs r1, r0, 16 + lsrs r0, 31 + adds r1, r0 + asrs r1, 1 + cmp r1, 0 + bne _0818232C + lsls r0, r2, 7 + movs r1, 0x28 + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bge _0818230C + adds r0, 0xFF +_0818230C: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x10 + bl sine + lsls r1, r5, 24 + asrs r1, 24 + adds r2, r0, 0 + muls r2, r1 + adds r0, r2, 0 + strh r0, [r4, 0x24] + negs r0, r0 + b _0818235A +_0818232C: + lsls r0, r2, 7 + movs r1, 0x28 + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bge _0818233C + adds r0, 0xFF +_0818233C: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x10 + bl sine + lsls r0, 16 + asrs r0, 16 + negs r0, r0 + lsls r1, r5, 24 + asrs r1, 24 + muls r0, r1 + strh r0, [r4, 0x24] +_0818235A: + strh r0, [r4, 0x26] +_0818235C: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_39 + + thumb_func_start pokemonanimfunc_3A +pokemonanimfunc_3A: @ 8182370 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08182392 + adds r0, r4, 0 + bl sub_817F670 + strh r5, [r4, 0x38] + strh r5, [r4, 0x3A] + strh r5, [r4, 0x3C] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] +_08182392: + ldrh r1, [r4, 0x3A] + movs r2, 0x3A + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _081823E4 + subs r0, r1, 0x1 + strh r0, [r4, 0x3A] + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x3 + beq _08182494 + movs r2, 0x3A + ldrsh r0, [r4, r2] + lsls r0, 3 + movs r1, 0x14 + bl __divsi3 + adds r1, r0, 0 + ldrh r0, [r4, 0x3C] + lsls r1, 16 + asrs r1, 16 + subs r0, r1 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x40 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r2, r1, 0 + lsls r0, 16 + asrs r0, 16 + subs r2, r0 + lsls r2, 16 + asrs r2, 16 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + b _08182494 +_081823E4: + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmp r0, 0x3 + bne _08182424 + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x3F + ble _08182410 + movs r0, 0x40 + strh r0, [r4, 0x3C] + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] +_08182410: + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r1, 0x40 + bl cosine + lsls r0, 16 + lsrs r3, r0, 16 + b _08182474 + .pool +_08182424: + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x40 + bl sine + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0x3F + ble _08182448 + movs r0, 0 + movs r1, 0x3 + strh r1, [r4, 0x38] + movs r1, 0xA + strh r1, [r4, 0x3A] + strh r0, [r4, 0x3C] + b _08182474 +_08182448: + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, 0x30 + ble _0818245C + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _0818245C + movs r0, 0x2 + b _0818246E +_0818245C: + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _08182474 + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08182474 + movs r0, 0x1 +_0818246E: + strh r0, [r4, 0x38] + movs r0, 0x14 + strh r0, [r4, 0x3A] +_08182474: + ldrh r0, [r4, 0x3C] + adds r0, 0x2 + strh r0, [r4, 0x3C] + movs r0, 0x80 + lsls r0, 1 + adds r2, r0, 0 + lsls r0, r3, 16 + asrs r0, 16 + subs r2, r0 + lsls r2, 16 + asrs r2, 16 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 +_08182494: + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_3A + + thumb_func_start pokemonanimfunc_3B +pokemonanimfunc_3B: @ 81824A0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _081824BA + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] +_081824BA: + movs r0, 0x3C + ldrsh r1, [r4, r0] + movs r0, 0x80 + lsls r0, 2 + cmp r1, r0 + ble _081824E8 + movs r0, 0 + strh r0, [r4, 0x26] + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _08182540 + .pool +_081824E8: + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _081824F4 + adds r0, 0xFF +_081824F4: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3C] + adds r0, 0x8 + strh r0, [r4, 0x3C] + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08182518 + adds r0, 0x7F +_08182518: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x60 + bl sine + adds r2, r0, 0 + movs r1, 0x80 + lsls r1, 1 + lsls r2, 16 + asrs r2, 16 + adds r2, r1 + lsls r2, 16 + asrs r2, 16 + adds r0, r4, 0 + movs r3, 0 + bl sub_817F6D4 +_08182540: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_3B + + thumb_func_start pokemonanimfunc_3C +pokemonanimfunc_3C: @ 8182548 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08182562 + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] +_08182562: + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r5, 0x80 + lsls r5, 1 + cmp r0, r5 + ble _08182590 + movs r0, 0 + strh r0, [r4, 0x26] + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r5, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _081825D4 + .pool +_08182590: + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x10 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3C] + adds r0, 0x4 + strh r0, [r4, 0x3C] + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _081825AE + adds r0, 0x3F +_081825AE: + asrs r0, 6 + lsls r0, 6 + subs r0, r1, r0 + lsls r0, 17 + asrs r0, 16 + movs r1, 0x80 + bl sine + adds r2, r0, 0 + lsls r2, 16 + asrs r2, 16 + adds r2, r5 + lsls r2, 16 + asrs r2, 16 + adds r0, r4, 0 + adds r1, r5, 0 + movs r3, 0 + bl sub_817F6D4 +_081825D4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_3C + + thumb_func_start pokemonanimfunc_3D +pokemonanimfunc_3D: @ 81825DC + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + ldr r0, =sub_81825F8 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x3C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_3D + + thumb_func_start sub_81825F8 +sub_81825F8: @ 81825F8 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x3C] + adds r0, 0x8 + movs r1, 0 + strh r0, [r4, 0x3C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3F + ble _0818261C + strh r1, [r4, 0x3C] + strh r1, [r4, 0x3A] + ldr r0, =sub_8182648 + str r0, [r4, 0x1C] + movs r0, 0x40 + b _08182620 + .pool +_0818261C: + movs r1, 0x3C + ldrsh r0, [r4, r1] +_08182620: + movs r1, 0x80 + bl sine + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x80 + lsls r1, 1 + lsls r2, r0, 16 + asrs r2, 16 + adds r2, r1 + lsls r2, 16 + asrs r2, 16 + adds r0, r4, 0 + movs r3, 0 + bl sub_817F6D4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81825F8 + + thumb_func_start sub_8182648 +sub_8182648: @ 8182648 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x3C] + adds r0, 0x4 + strh r0, [r4, 0x3C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5F + ble _08182672 + movs r0, 0 + movs r1, 0x80 + bl cosine + lsls r0, 16 + lsrs r2, r0, 16 + movs r0, 0 + strh r0, [r4, 0x3C] + ldrh r0, [r4, 0x3A] + adds r0, 0x1 + strh r0, [r4, 0x3A] + b _081826C8 +_08182672: + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl sine + movs r2, 0x3A + ldrsh r1, [r4, r2] + lsls r1, 2 + negs r1, r1 + subs r1, r0 + strh r1, [r4, 0x26] + ldrh r1, [r4, 0x3C] + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0x3F + ble _081826A4 + ldr r5, =0x0000ffff + adds r0, r1, 0 + subs r0, 0x40 + lsls r0, 16 + lsrs r0, 16 + b _081826A8 + .pool +_081826A4: + movs r5, 0x1 + movs r0, 0 +_081826A8: + lsls r0, 16 + asrs r0, 15 + ldrh r1, [r4, 0x3C] + adds r0, r1 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x80 + bl cosine + lsls r1, r5, 16 + asrs r1, 16 + adds r2, r1, 0 + muls r2, r0 + adds r0, r2, 0 + lsls r0, 16 + lsrs r2, r0, 16 +_081826C8: + movs r1, 0x80 + lsls r1, 1 + lsls r2, 16 + asrs r2, 16 + adds r2, r1 + lsls r2, 16 + asrs r2, 16 + adds r0, r4, 0 + movs r3, 0 + bl sub_817F6D4 + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0x3 + bne _081826EE + movs r0, 0 + strh r0, [r4, 0x3C] + ldr r0, =sub_81826F8 + str r0, [r4, 0x1C] +_081826EE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8182648 + + thumb_func_start sub_81826F8 +sub_81826F8: @ 81826F8 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x3C] + adds r0, 0x8 + strh r0, [r4, 0x3C] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x80 + bl cosine + lsls r0, 16 + lsrs r5, r0, 16 + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0xC + bl cosine + negs r0, r0 + strh r0, [r4, 0x26] + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x3F + ble _08182742 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x26] + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 +_08182742: + movs r1, 0x80 + lsls r1, 1 + lsls r2, r5, 16 + asrs r2, 16 + adds r2, r1 + lsls r2, 16 + asrs r2, 16 + adds r0, r4, 0 + movs r3, 0 + bl sub_817F6D4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81826F8 + + thumb_func_start sub_8182764 +sub_8182764: @ 8182764 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x3C + ldrsh r1, [r4, r0] + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmp r1, r0 + ble _08182798 + movs r0, 0 + strh r0, [r4, 0x24] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + b _081827F4 + .pool +_08182798: + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _081827A4 + adds r0, 0xFF +_081827A4: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x3A] + ldrh r1, [r4, 0x3C] + adds r0, r1 + strh r0, [r4, 0x3C] + movs r2, 0x3C + ldrsh r1, [r4, r2] + adds r0, r1, 0 + cmp r1, 0 + bge _081827CC + adds r0, 0x7F +_081827CC: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x60 + bl sine + adds r1, r0, 0 + lsls r1, 16 + movs r0, 0x80 + lsls r0, 17 + adds r1, r0 + asrs r1, 16 + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + movs r3, 0 + bl sub_817F6D4 +_081827F4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8182764 + + thumb_func_start pokemonanimfunc_3E +pokemonanimfunc_3E: @ 81827FC + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08182822 + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] + movs r1, 0x8 + strh r1, [r4, 0x3A] + movs r0, 0x80 + lsls r0, 2 + strh r0, [r4, 0x38] + strh r1, [r4, 0x36] +_08182822: + adds r0, r4, 0 + bl sub_8182764 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_3E + + thumb_func_start sub_8182830 +sub_8182830: @ 8182830 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x3C + ldrsh r1, [r4, r0] + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmp r1, r0 + ble _08182864 + movs r0, 0 + strh r0, [r4, 0x24] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + b _081828C0 + .pool +_08182864: + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08182870 + adds r0, 0xFF +_08182870: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x3A] + ldrh r1, [r4, 0x3C] + adds r0, r1 + strh r0, [r4, 0x3C] + movs r2, 0x3C + ldrsh r1, [r4, r2] + adds r0, r1, 0 + cmp r1, 0 + bge _08182898 + adds r0, 0x3F +_08182898: + asrs r0, 6 + lsls r0, 6 + subs r0, r1, r0 + lsls r0, 17 + asrs r0, 16 + movs r1, 0x80 + bl sine + adds r1, r0, 0 + lsls r1, 16 + movs r0, 0x80 + lsls r0, 17 + adds r1, r0 + asrs r1, 16 + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + movs r3, 0 + bl sub_817F6D4 +_081828C0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8182830 + + thumb_func_start pokemonanimfunc_3F +pokemonanimfunc_3F: @ 81828C8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _081828EE + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] + movs r0, 0x4 + strh r0, [r4, 0x3A] + adds r0, 0xFC + strh r0, [r4, 0x38] + movs r0, 0x10 + strh r0, [r4, 0x36] +_081828EE: + adds r0, r4, 0 + bl sub_8182830 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_3F + + thumb_func_start pokemonanimfunc_40 +pokemonanimfunc_40: @ 81828FC + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _0818291A + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] +_0818291A: + movs r0, 0x3C + ldrsh r1, [r4, r0] + movs r0, 0x80 + lsls r0, 2 + cmp r1, r0 + ble _08182948 + movs r0, 0 + strh r0, [r4, 0x24] + adds r0, r4, 0 + bl sub_817F77C + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _0818299E + .pool +_08182948: + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08182954 + adds r0, 0xFF +_08182954: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x3C] + adds r0, 0x8 + strh r0, [r4, 0x3C] + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08182978 + adds r0, 0x7F +_08182978: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x60 + bl sine + adds r2, r0, 0 + lsls r2, 16 + movs r0, 0x80 + lsls r0, 17 + adds r2, r0 + asrs r2, 16 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 +_0818299E: + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_40 + + thumb_func_start pokemonanimfunc_41 +pokemonanimfunc_41: @ 81829AC + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _081829CA + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] +_081829CA: + movs r0, 0x3C + ldrsh r1, [r4, r0] + movs r0, 0x80 + lsls r0, 2 + cmp r1, r0 + ble _081829F8 + movs r0, 0 + strh r0, [r4, 0x24] + adds r0, r4, 0 + bl sub_817F77C + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _08182A5E + .pool +_081829F8: + movs r1, 0x3C + ldrsh r0, [r4, r1] + adds r1, r0, 0 + cmp r0, 0 + bge _08182A04 + adds r1, 0xFF +_08182A04: + asrs r1, 8 + lsls r1, 8 + subs r1, r0, r1 + lsls r1, 16 + asrs r0, r1, 16 + lsrs r1, 31 + adds r0, r1 + asrs r0, 1 + movs r1, 0x10 + bl sine + negs r0, r0 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x3C] + adds r0, 0x8 + strh r0, [r4, 0x3C] + movs r1, 0x3C + ldrsh r0, [r4, r1] + adds r1, r0, 0 + cmp r0, 0 + bge _08182A30 + adds r1, 0xFF +_08182A30: + asrs r1, 8 + lsls r1, 8 + subs r1, r0, r1 + lsls r1, 16 + asrs r0, r1, 16 + lsrs r1, 31 + adds r0, r1 + asrs r0, 1 + movs r1, 0x40 + bl sine + adds r2, r0, 0 + negs r2, r2 + lsls r2, 16 + movs r0, 0x80 + lsls r0, 17 + adds r2, r0 + asrs r2, 16 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 +_08182A5E: + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_41 + + thumb_func_start pokemonanimfunc_42 +pokemonanimfunc_42: @ 8182A6C + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08182A8A + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] +_08182A8A: + movs r0, 0x3C + ldrsh r1, [r4, r0] + movs r0, 0x80 + lsls r0, 2 + cmp r1, r0 + ble _08182AB8 + movs r0, 0 + strh r0, [r4, 0x24] + adds r0, r4, 0 + bl sub_817F77C + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _08182B16 + .pool +_08182AB8: + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08182AC4 + adds r0, 0xFF +_08182AC4: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + negs r0, r0 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x3C] + adds r0, 0x8 + strh r0, [r4, 0x3C] + movs r1, 0x3C + ldrsh r0, [r4, r1] + adds r1, r0, 0 + cmp r0, 0 + bge _08182AEA + adds r1, 0xFF +_08182AEA: + asrs r1, 8 + lsls r1, 8 + subs r1, r0, r1 + lsls r1, 16 + asrs r0, r1, 16 + lsrs r1, 31 + adds r0, r1 + asrs r0, 1 + movs r1, 0x60 + bl sine + adds r2, r0, 0 + lsls r2, 16 + movs r0, 0x80 + lsls r0, 17 + adds r2, r0 + asrs r2, 16 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 +_08182B16: + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_42 + + thumb_func_start pokemonanimfunc_43 +pokemonanimfunc_43: @ 8182B24 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r0, 0x80 + lsls r0, 4 + cmp r1, r0 + ble _08182B48 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x3A] + b _08182C08 + .pool +_08182B48: + movs r1, 0x32 + ldrsh r2, [r4, r1] + adds r0, r2, 0 + cmp r2, 0 + bge _08182B56 + ldr r1, =0x000001ff + adds r0, r2, r1 +_08182B56: + asrs r3, r0, 9 + adds r1, r3, 0 + adds r0, r1, 0 + cmp r1, 0 + bge _08182B62 + adds r0, r1, 0x3 +_08182B62: + asrs r0, 2 + lsls r0, 2 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + beq _08182BA4 + cmp r0, 0x1 + bgt _08182B80 + cmp r0, 0 + beq _08182B8A + b _08182BE2 + .pool +_08182B80: + cmp r0, 0x2 + beq _08182BB8 + cmp r0, 0x3 + beq _08182BCA + b _08182BE2 +_08182B8A: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 12 + negs r0, r0 + cmp r0, 0 + bge _08182B9C + ldr r1, =0x000001ff + adds r0, r1 +_08182B9C: + asrs r0, 9 + b _08182BE0 + .pool +_08182BA4: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08182BB2 + adds r0, 0x1F +_08182BB2: + asrs r0, 5 + subs r0, 0x10 + b _08182BE0 +_08182BB8: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08182BC6 + adds r0, 0x1F +_08182BC6: + asrs r0, 5 + b _08182BE0 +_08182BCA: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 12 + negs r0, r0 + cmp r0, 0 + bge _08182BDC + ldr r1, =0x000001ff + adds r0, r1 +_08182BDC: + asrs r0, 9 + adds r0, 0x10 +_08182BE0: + strh r0, [r4, 0x24] +_08182BE2: + movs r0, 0x32 + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08182BEE + adds r0, 0x7F +_08182BEE: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x4 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x18 + strh r0, [r4, 0x32] +_08182C08: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_43 + + thumb_func_start pokemonanimfunc_44 +pokemonanimfunc_44: @ 8182C18 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r1, [r4, 0x32] + movs r2, 0x32 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _08182C34 + strh r0, [r4, 0x3A] + movs r0, 0x40 + strh r0, [r4, 0x3C] + adds r0, r1, 0x1 + strh r0, [r4, 0x32] +_08182C34: + ldrh r0, [r4, 0x3C] + adds r1, r0, 0 + adds r1, 0x8 + movs r3, 0 + strh r1, [r4, 0x3C] + ldrh r2, [r4, 0x3A] + movs r5, 0x3A + ldrsh r0, [r4, r5] + cmp r0, 0x4 + bne _08182C52 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x3F + ble _08182C60 + b _08182C5A +_08182C52: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x7F + ble _08182C60 +_08182C5A: + strh r3, [r4, 0x3C] + adds r0, r2, 0x1 + strh r0, [r4, 0x3A] +_08182C60: + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bhi _08182D08 + lsls r0, 2 + ldr r1, =_08182C78 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08182C78: + .4byte _08182CEC + .4byte _08182C8C + .4byte _08182CAA + .4byte _08182CCC + .4byte _08182CEC +_08182C8C: + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r1, 0x8 + bl cosine + negs r0, r0 + strh r0, [r4, 0x24] + movs r5, 0x3C + ldrsh r0, [r4, r5] + movs r1, 0x8 + bl sine + subs r0, 0x8 + strh r0, [r4, 0x26] + b _08182D12 +_08182CAA: + ldrh r0, [r4, 0x3C] + adds r0, 0x80 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + adds r0, 0x8 + strh r0, [r4, 0x24] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl cosine + negs r0, r0 + strh r0, [r4, 0x26] + b _08182D12 +_08182CCC: + movs r2, 0x3C + ldrsh r0, [r4, r2] + movs r1, 0x8 + bl cosine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x3C] + adds r0, 0x80 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + adds r0, 0x8 + strh r0, [r4, 0x26] + b _08182D12 +_08182CEC: + movs r5, 0x3C + ldrsh r0, [r4, r5] + movs r1, 0x8 + bl sine + subs r0, 0x8 + strh r0, [r4, 0x24] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl cosine + strh r0, [r4, 0x26] + b _08182D12 +_08182D08: + movs r0, 0 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] +_08182D12: + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_44 + + thumb_func_start pokemonanimfunc_45 +pokemonanimfunc_45: @ 8182D24 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x20 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_8180714 + ldr r0, =sub_8180714 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_45 + + thumb_func_start pokemonanimfunc_46 +pokemonanimfunc_46: @ 8182D40 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x50 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_817F8FC + ldr r0, =sub_817F8FC + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_46 + + thumb_func_start pokemonanimfunc_47 +pokemonanimfunc_47: @ 8182D5C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x50 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_817F978 + ldr r0, =sub_817F978 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_47 + + thumb_func_start pokemonanimfunc_48 +pokemonanimfunc_48: @ 8182D78 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x80 + lsls r0, 4 + strh r0, [r1, 0x6] + ldrh r0, [r4, 0x3A] + strh r0, [r1, 0x8] + adds r0, r4, 0 + bl sub_8180900 + ldr r0, =sub_8180900 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_48 + + thumb_func_start pokemonanimfunc_49 +pokemonanimfunc_49: @ 8182DB4 + push {lr} + movs r1, 0x1 + strh r1, [r0, 0x3A] + bl pokemonanimfunc_05 + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_49 + + thumb_func_start pokemonanimfunc_4A +pokemonanimfunc_4A: @ 8182DC4 + push {lr} + movs r1, 0x1 + strh r1, [r0, 0x3A] + bl pokemonanimfunc_48 + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_4A + + thumb_func_start pokemonanimfunc_4B +pokemonanimfunc_4B: @ 8182DD4 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08182DE2 + strh r0, [r4, 0x2E] +_08182DE2: + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + bgt _08182DF6 + adds r0, r4, 0 + bl sub_817FC20 + movs r0, 0x1 + b _08182DF8 +_08182DF6: + subs r0, r1, 0x1 +_08182DF8: + strh r0, [r4, 0x2E] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_4B + + thumb_func_start pokemonanimfunc_4C +pokemonanimfunc_4C: @ 8182E00 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1E + strh r0, [r4, 0x2E] + movs r0, 0x3 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_817FCDC + ldr r0, =sub_817FCDC + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_4C + + thumb_func_start pokemonanimfunc_4D +pokemonanimfunc_4D: @ 8182E20 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1E + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_817FD44 + ldr r0, =sub_817FD44 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_4D + + thumb_func_start pokemonanimfunc_4E +pokemonanimfunc_4E: @ 8182E3C + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + movs r3, 0 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x80 + lsls r0, 3 + strh r0, [r1, 0x6] + strh r3, [r1] + movs r0, 0x2 + strh r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_817FE30 + ldr r0, =sub_817FE30 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_4E + + thumb_func_start pokemonanimfunc_4F +pokemonanimfunc_4F: @ 8182E7C + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x80 + lsls r0, 2 + strh r0, [r1, 0x6] + movs r0, 0x3 + strh r0, [r1, 0x8] + movs r0, 0xC + strh r0, [r1, 0x2] + adds r0, r4, 0 + bl sub_817FFF0 + ldr r0, =sub_817FFF0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_4F + + thumb_func_start pokemonanimfunc_50 +pokemonanimfunc_50: @ 8182EBC + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x18 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_818031C + ldr r0, =sub_818031C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_50 + + thumb_func_start pokemonanimfunc_51 +pokemonanimfunc_51: @ 8182ED8 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x5 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_81804F8 + ldr r0, =sub_81804F8 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_51 + + thumb_func_start pokemonanimfunc_52 +pokemonanimfunc_52: @ 8182EF4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x3 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_817F9F4 + ldr r0, =sub_817F9F4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_52 + + thumb_func_start pokemonanimfunc_53 +pokemonanimfunc_53: @ 8182F10 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x3C + strh r0, [r1] + movs r0, 0x1E + strh r0, [r1, 0x8] + adds r0, r4, 0 + bl sub_817FF3C + ldr r0, =sub_817FF3C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_53 + + thumb_func_start pokemonanimfunc_54 +pokemonanimfunc_54: @ 8182F48 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x1 + strh r0, [r1, 0x2] + movs r0, 0x2 + strh r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_8181214 + ldr r0, =sub_8181214 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_54 + + thumb_func_start pokemonanimfunc_55 +pokemonanimfunc_55: @ 8182F80 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x4 + strh r0, [r1, 0x6] + movs r0, 0x2 + strh r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_8181810 + ldr r0, =sub_8181810 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_55 + + thumb_func_start pokemonanimfunc_56 +pokemonanimfunc_56: @ 8182FB8 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0x2 + strh r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_817F670 + strh r5, [r4, 0x34] + adds r0, r4, 0 + bl sub_8181ABC + ldr r0, =sub_8181ABC + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_56 + + thumb_func_start pokemonanimfunc_07 +pokemonanimfunc_07: @ 8182FFC + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x2 + strh r0, [r1, 0x6] + adds r0, r4, 0 + bl sub_8181CE8 + ldr r0, =sub_8181CE8 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_07 + + thumb_func_start pokemonanimfunc_08 +pokemonanimfunc_08: @ 8183030 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x4 + strh r0, [r1, 0x6] + movs r0, 0x2 + strh r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_8181CE8 + ldr r0, =sub_8181CE8 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_08 + + thumb_func_start pokemonanimfunc_0B +pokemonanimfunc_0B: @ 8183068 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x64 + strh r0, [r1, 0x8] + adds r0, r4, 0 + bl sub_81814D4 + ldr r0, =sub_81814D4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_0B + + thumb_func_start pokemonanimfunc_0C +pokemonanimfunc_0C: @ 818309C + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x32 + strh r0, [r1, 0x8] + movs r0, 0x2 + strh r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81814D4 + ldr r0, =sub_81814D4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_0C + + thumb_func_start pokemonanimfunc_0D +pokemonanimfunc_0D: @ 81830D4 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x64 + strh r0, [r1, 0x8] + adds r0, r4, 0 + bl sub_81815D4 + ldr r0, =sub_81815D4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_0D + + thumb_func_start pokemonanimfunc_0E +pokemonanimfunc_0E: @ 8183108 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x32 + strh r0, [r1, 0x8] + movs r0, 0x2 + strh r0, [r1, 0x4] + adds r0, r4, 0 + bl sub_81815D4 + ldr r0, =sub_81815D4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_0E + + thumb_func_start sub_8183140 +sub_8183140: @ 8183140 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r0, 0x90 + lsls r0, 4 + cmp r2, r0 + ble _0818315C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + movs r0, 0 + b _08183180 + .pool +_0818315C: + adds r1, r2, 0 + adds r1, 0xC0 + adds r0, r1, 0 + cmp r1, 0 + bge _0818316A + ldr r3, =0x000001bf + adds r0, r2, r3 +_0818316A: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x3C + ldrsh r1, [r4, r2] + bl sine + ldrh r1, [r4, 0x3C] + adds r0, r1 +_08183180: + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x2E] + ldrh r3, [r4, 0x32] + adds r0, r3 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8183140 + + thumb_func_start pokemonanimfunc_57 +pokemonanimfunc_57: @ 8183194 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x3C + strh r0, [r4, 0x2E] + movs r0, 0x3 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_8183140 + ldr r0, =sub_8183140 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_57 + + thumb_func_start pokemonanimfunc_58 +pokemonanimfunc_58: @ 81831B4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1E + strh r0, [r4, 0x2E] + movs r0, 0x3 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_8183140 + ldr r0, =sub_8183140 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_58 + + thumb_func_start pokemonanimfunc_59 +pokemonanimfunc_59: @ 81831D4 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r0, 0x80 + lsls r0, 4 + cmp r1, r0 + ble _081831F8 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x3A] + b _081832BC + .pool +_081831F8: + movs r1, 0x32 + ldrsh r2, [r4, r1] + adds r0, r2, 0 + cmp r2, 0 + bge _08183206 + ldr r1, =0x000001ff + adds r0, r2, r1 +_08183206: + asrs r3, r0, 9 + adds r1, r3, 0 + adds r0, r1, 0 + cmp r1, 0 + bge _08183212 + adds r0, r1, 0x3 +_08183212: + asrs r0, 2 + lsls r0, 2 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + beq _08183268 + cmp r0, 0x1 + bgt _08183230 + cmp r0, 0 + beq _0818323A + b _08183298 + .pool +_08183230: + cmp r0, 0x2 + beq _0818324C + cmp r0, 0x3 + beq _08183284 + b _08183298 +_0818323A: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08183248 + adds r0, 0x1F +_08183248: + asrs r0, 5 + b _08183296 +_0818324C: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 12 + negs r0, r0 + cmp r0, 0 + bge _0818325E + ldr r1, =0x000001ff + adds r0, r1 +_0818325E: + asrs r0, 9 + b _08183296 + .pool +_08183268: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 12 + negs r0, r0 + cmp r0, 0 + bge _0818327A + ldr r1, =0x000001ff + adds r0, r1 +_0818327A: + asrs r0, 9 + adds r0, 0x10 + b _08183296 + .pool +_08183284: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08183292 + adds r0, 0x1F +_08183292: + asrs r0, 5 + subs r0, 0x10 +_08183296: + strh r0, [r4, 0x24] +_08183298: + movs r0, 0x32 + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _081832A4 + adds r0, 0x7F +_081832A4: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x4 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x18 + strh r0, [r4, 0x32] +_081832BC: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_59 + + thumb_func_start sub_81832C8 +sub_81832C8: @ 81832C8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + movs r0, 0 + mov r8, r0 + movs r2, 0x38 + ldrsh r1, [r6, r2] + movs r2, 0x3A + ldrsh r0, [r6, r2] + cmp r1, r0 + ble _0818331A + mov r0, r8 + strh r0, [r6, 0x26] + strh r0, [r6, 0x38] + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + ldrh r1, [r6, 0x36] + movs r2, 0x36 + ldrsh r0, [r6, r2] + cmp r0, 0x1 + bgt _08183310 + adds r0, r6, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r6, 0x1C] + b _081833DC + .pool +_08183310: + subs r0, r1, 0x1 + strh r0, [r6, 0x36] + mov r0, r8 + strh r0, [r6, 0x3C] + b _081833DC +_0818331A: + movs r1, 0x38 + ldrsh r5, [r6, r1] + lsls r0, r5, 7 + movs r2, 0x3A + ldrsh r4, [r6, r2] + adds r1, r4, 0 + bl __divsi3 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r4, 0 + bge _08183334 + adds r4, 0x3 +_08183334: + asrs r1, r4, 2 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r5, r1 + blt _08183358 + cmp r5, r0 + bge _08183358 + ldrh r0, [r6, 0x3C] + adds r0, 0x33 + strh r0, [r6, 0x3C] + movs r1, 0xFF + mov r8, r1 + ands r1, r0 + mov r8, r1 +_08183358: + movs r1, 0x30 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0818337C + lsls r4, r2, 16 + asrs r0, r4, 16 + movs r1, 0x10 + bl sine + ldr r2, =0xffffff00 + adds r1, r2, 0 + subs r1, r0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + b _08183392 + .pool +_0818337C: + lsls r4, r2, 16 + asrs r0, r4, 16 + movs r1, 0x10 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 +_08183392: + adds r7, r4, 0 + ldrh r4, [r6, 0x34] + lsls r4, 24 + lsrs r4, 24 + mov r5, r8 + adds r0, r4, 0 + movs r1, 0x5 + bl __udivsi3 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sine + adds r5, r0, 0 + asrs r0, r7, 16 + adds r1, r4, 0 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r2, r1, 0 + subs r2, r5 + subs r2, r0 + mov r0, r9 + lsls r1, r0, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + adds r0, r6, 0 + movs r3, 0 + bl sub_817F618 + ldrh r0, [r6, 0x38] + adds r0, 0x1 + strh r0, [r6, 0x38] +_081833DC: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81832C8 + + thumb_func_start pokemonanimfunc_5A +pokemonanimfunc_5A: @ 81833E8 + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0x32 + ldrsh r6, [r5, r0] + cmp r6, 0 + bne _0818340A + movs r4, 0x1 + strh r4, [r5, 0x32] + adds r0, r5, 0 + bl sub_817F670 + strh r4, [r5, 0x36] + movs r0, 0x28 + strh r0, [r5, 0x3A] + strh r0, [r5, 0x34] + strh r6, [r5, 0x38] + strh r6, [r5, 0x3C] +_0818340A: + adds r0, r5, 0 + bl sub_81832C8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_5A + + thumb_func_start sub_8183418 +sub_8183418: @ 8183418 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + movs r0, 0 + mov r8, r0 + movs r2, 0x38 + ldrsh r1, [r6, r2] + movs r2, 0x3A + ldrsh r0, [r6, r2] + cmp r1, r0 + ble _0818346A + mov r0, r8 + strh r0, [r6, 0x38] + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + ldrh r1, [r6, 0x36] + movs r2, 0x36 + ldrsh r0, [r6, r2] + cmp r0, 0x1 + bgt _08183460 + adds r0, r6, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r6, 0x1C] + b _08183538 + .pool +_08183460: + subs r0, r1, 0x1 + strh r0, [r6, 0x36] + mov r0, r8 + strh r0, [r6, 0x3C] + b _08183538 +_0818346A: + movs r1, 0x38 + ldrsh r5, [r6, r1] + lsls r0, r5, 7 + movs r2, 0x3A + ldrsh r4, [r6, r2] + adds r1, r4, 0 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + cmp r4, 0 + bge _08183486 + adds r4, 0x3 +_08183486: + asrs r1, r4, 2 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r5, r1 + blt _081834AC + cmp r5, r0 + bge _081834AC + ldrh r0, [r6, 0x3C] + adds r0, 0x33 + strh r0, [r6, 0x3C] + movs r1, 0xFF + mov r8, r1 + mov r2, r8 + ands r2, r0 + mov r8, r2 +_081834AC: + ldrh r0, [r6, 0x34] + lsls r0, 24 + lsrs r7, r0, 24 + movs r1, 0x30 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _081834F0 + mov r2, r9 + lsls r0, r2, 16 + asrs r0, 16 + adds r1, r7, 0 + bl sine + adds r4, r0, 0 + mov r5, r8 + adds r0, r7, 0 + movs r1, 0x5 + bl __udivsi3 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 23 + adds r0, r5, 0 + bl sine + ldr r1, =0xffffff00 + adds r0, r1 + adds r4, r0 + lsls r4, 16 + lsrs r1, r4, 16 + b _08183522 + .pool +_081834F0: + mov r4, r8 + adds r0, r7, 0 + movs r1, 0x5 + bl __udivsi3 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 23 + adds r0, r4, 0 + bl sine + adds r4, r0, 0 + mov r2, r9 + lsls r0, r2, 16 + asrs r0, 16 + adds r1, r7, 0 + bl sine + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + subs r1, r4 + subs r1, r0 + lsls r1, 16 + lsrs r1, 16 +_08183522: + lsls r1, 16 + asrs r1, 16 + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + movs r3, 0 + bl sub_817F618 + ldrh r0, [r6, 0x38] + adds r0, 0x1 + strh r0, [r6, 0x38] +_08183538: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8183418 + + thumb_func_start pokemonanimfunc_5B +pokemonanimfunc_5B: @ 8183544 + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0x32 + ldrsh r6, [r5, r0] + cmp r6, 0 + bne _08183566 + movs r4, 0x1 + strh r4, [r5, 0x32] + adds r0, r5, 0 + bl sub_817F670 + strh r4, [r5, 0x36] + movs r0, 0x28 + strh r0, [r5, 0x3A] + strh r0, [r5, 0x34] + strh r6, [r5, 0x38] + strh r6, [r5, 0x3C] +_08183566: + adds r0, r5, 0 + bl sub_8183418 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_5B + + thumb_func_start sub_8183574 +sub_8183574: @ 8183574 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r4, r0, 0 + ldrh r0, [r4, 0x32] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r3, =gUnknown_0860AA80 + movs r1, 0x38 + ldrsh r0, [r4, r1] + lsls r1, r0, 1 + adds r0, r1, r3 + ldrb r5, [r0] + adds r2, r5, 0 + cmp r5, 0xFF + beq _081835A6 + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r5, r0, 24 +_081835A6: + adds r0, r3, 0x1 + adds r0, r1, r0 + ldrb r6, [r0] + movs r7, 0 + cmp r2, 0xFE + beq _081835C2 + mov r1, r9 + subs r0, r6, r1 + muls r0, r5 + adds r1, r6, 0 + bl __divsi3 + lsls r0, 24 + lsrs r7, r0, 24 +_081835C2: + cmp r5, 0xFF + bne _081835D8 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x26] + b _0818360A + .pool +_081835D8: + mov r1, r8 + adds r1, 0xC0 + adds r0, r1, 0 + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + adds r1, r7, 0 + bl sine + adds r0, r7 + strh r0, [r4, 0x26] + cmp r9, r6 + bne _081835FC + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + movs r0, 0 + b _08183608 +_081835FC: + ldrh r0, [r4, 0x2E] + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x3A] + adds r0, 0x1 +_08183608: + strh r0, [r4, 0x3A] +_0818360A: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8183574 + + thumb_func_start pokemonanimfunc_5C +pokemonanimfunc_5C: @ 8183618 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x28 + strh r0, [r4, 0x2E] + movs r0, 0x6 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_8183574 + ldr r0, =sub_8183574 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_5C + + thumb_func_start pokemonanimfunc_5D +pokemonanimfunc_5D: @ 8183638 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x46 + strh r0, [r4, 0x2E] + movs r0, 0x6 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_817FCDC + ldr r0, =sub_817FCDC + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_5D + + thumb_func_start pokemonanimfunc_5E +pokemonanimfunc_5E: @ 8183658 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x14 + strh r0, [r4, 0x2E] + adds r0, r4, 0 + bl sub_817F8FC + ldr r0, =sub_817F8FC + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_5E + + thumb_func_start pokemonanimfunc_5F +pokemonanimfunc_5F: @ 8183674 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x32] + movs r2, 0x32 + ldrsh r0, [r4, r2] + cmp r0, 0x28 + ble _08183690 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + movs r0, 0 + b _081836CA + .pool +_08183690: + movs r0, 0x1 + ands r0, r1 + movs r5, 0xFF + cmp r0, 0 + bne _0818369C + movs r5, 0x1 +_0818369C: + movs r1, 0x32 + ldrsh r0, [r4, r1] + lsls r0, 7 + movs r1, 0x28 + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bge _081836B0 + adds r0, 0xFF +_081836B0: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x9 + bl sine + lsls r1, r5, 24 + asrs r1, 24 + adds r2, r0, 0 + muls r2, r1 + adds r0, r2, 0 +_081836CA: + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_5F + + thumb_func_start pokemonanimfunc_60 +pokemonanimfunc_60: @ 81836D8 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x32] + movs r2, 0x32 + ldrsh r0, [r4, r2] + cmp r0, 0x28 + ble _081836F4 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + movs r0, 0 + b _0818372E + .pool +_081836F4: + movs r0, 0x1 + ands r0, r1 + movs r5, 0xFF + cmp r0, 0 + bne _08183700 + movs r5, 0x1 +_08183700: + movs r1, 0x32 + ldrsh r0, [r4, r1] + lsls r0, 7 + movs r1, 0x28 + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bge _08183714 + adds r0, 0xFF +_08183714: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0xC + bl sine + lsls r1, r5, 24 + asrs r1, 24 + adds r2, r0, 0 + muls r2, r1 + adds r0, r2, 0 +_0818372E: + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_60 + + thumb_func_start pokemonanimfunc_61 +pokemonanimfunc_61: @ 818373C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x46 + strh r0, [r4, 0x2E] + movs r0, 0x6 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_8183140 + ldr r0, =sub_8183140 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_61 + + thumb_func_start pokemonanimfunc_62 +pokemonanimfunc_62: @ 818375C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x18 + strh r0, [r4, 0x2E] + movs r0, 0x6 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_8183574 + ldr r0, =sub_8183574 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_62 + + thumb_func_start pokemonanimfunc_63 +pokemonanimfunc_63: @ 818377C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x38 + strh r0, [r4, 0x2E] + movs r0, 0x9 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + bl sub_8183574 + ldr r0, =sub_8183574 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_63 + + thumb_func_start pokemonanimfunc_64 +pokemonanimfunc_64: @ 818379C + push {r4,lr} + adds r4, r0, 0 + bl sub_817F758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2E] + ldr r2, =0x03001240 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x80 + lsls r0, 3 + strh r0, [r1, 0x6] + movs r0, 0x6 + strh r0, [r1, 0x8] + movs r0, 0x18 + strh r0, [r1, 0x2] + adds r0, r4, 0 + bl sub_817FFF0 + ldr r0, =sub_817FFF0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_64 + + thumb_func_start sub_81837DC +sub_81837DC: @ 81837DC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r7, r0, 0 + movs r5, 0 + movs r0, 0x38 + ldrsh r1, [r7, r0] + movs r2, 0x3A + ldrsh r0, [r7, r2] + cmp r1, r0 + ble _0818382C + strh r5, [r7, 0x26] + strh r5, [r7, 0x38] + movs r2, 0x80 + lsls r2, 1 + adds r0, r7, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + ldrh r1, [r7, 0x36] + movs r2, 0x36 + ldrsh r0, [r7, r2] + cmp r0, 0x1 + bgt _08183824 + adds r0, r7, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r7, 0x1C] + b _0818392C + .pool +_08183824: + subs r0, r1, 0x1 + strh r0, [r7, 0x36] + strh r5, [r7, 0x3C] + b _0818392C +_0818382C: + movs r0, 0x38 + ldrsh r6, [r7, r0] + lsls r0, r6, 7 + movs r1, 0x3A + ldrsh r4, [r7, r1] + adds r1, r4, 0 + bl __divsi3 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r4, 0 + bge _08183846 + adds r4, 0x3 +_08183846: + asrs r1, r4, 2 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r6, r1 + blt _08183866 + cmp r6, r0 + bge _08183866 + ldrh r0, [r7, 0x3C] + adds r0, 0x33 + strh r0, [r7, 0x3C] + movs r5, 0xFF + ands r5, r0 +_08183866: + ldrh r0, [r7, 0x34] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r1, 0x30 + ldrsh r0, [r7, r1] + cmp r0, 0 + bne _081838B0 + lsls r2, 16 + mov r8, r2 + asrs r0, r2, 16 + mov r1, r9 + bl sine + adds r4, r0, 0 + lsls r6, r5, 16 + asrs r5, r6, 16 + mov r0, r9 + movs r1, 0x5 + bl __udivsi3 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 23 + adds r0, r5, 0 + bl sine + ldr r2, =0xffffff00 + adds r4, r2 + adds r0, r4 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + mov r0, r8 + b _081838EA + .pool +_081838B0: + lsls r2, 16 + mov r8, r2 + asrs r0, r2, 16 + mov r1, r9 + bl sine + adds r6, r0, 0 + lsls r5, 16 + asrs r4, r5, 16 + mov r0, r9 + movs r1, 0x5 + bl __udivsi3 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 23 + adds r0, r4, 0 + bl sine + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + subs r1, r6 + subs r1, r0 + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + mov r0, r8 + adds r6, r5, 0 +_081838EA: + asrs r0, 16 + mov r1, r9 + bl sine + adds r5, r0, 0 + asrs r4, r6, 16 + mov r0, r9 + movs r1, 0x5 + bl __udivsi3 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r2, r1, 0 + subs r2, r5 + subs r2, r0 + mov r0, r10 + lsls r1, r0, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + adds r0, r7, 0 + movs r3, 0 + bl sub_817F618 + ldrh r0, [r7, 0x38] + adds r0, 0x1 + strh r0, [r7, 0x38] +_0818392C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81837DC + + thumb_func_start pokemonanimfunc_65 +pokemonanimfunc_65: @ 818393C + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0x32 + ldrsh r6, [r5, r0] + cmp r6, 0 + bne _0818395E + movs r4, 0x1 + strh r4, [r5, 0x32] + adds r0, r5, 0 + bl sub_817F670 + strh r4, [r5, 0x36] + movs r0, 0x28 + strh r0, [r5, 0x3A] + strh r0, [r5, 0x34] + strh r6, [r5, 0x38] + strh r6, [r5, 0x3C] +_0818395E: + adds r0, r5, 0 + bl sub_81837DC + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_65 + + thumb_func_start pokemonanimfunc_66 +pokemonanimfunc_66: @ 818396C + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r0, 0x80 + lsls r0, 4 + cmp r1, r0 + ble _08183990 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x3A] + b _08183A54 + .pool +_08183990: + movs r1, 0x32 + ldrsh r2, [r4, r1] + adds r0, r2, 0 + cmp r2, 0 + bge _0818399E + ldr r1, =0x000001ff + adds r0, r2, r1 +_0818399E: + asrs r3, r0, 9 + adds r1, r3, 0 + adds r0, r1, 0 + cmp r1, 0 + bge _081839AA + adds r0, r1, 0x3 +_081839AA: + asrs r0, 2 + lsls r0, 2 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + beq _08183A00 + cmp r0, 0x1 + bgt _081839C8 + cmp r0, 0 + beq _081839D2 + b _08183A30 + .pool +_081839C8: + cmp r0, 0x2 + beq _081839E4 + cmp r0, 0x3 + beq _08183A1C + b _08183A30 +_081839D2: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _081839E0 + adds r0, 0x1F +_081839E0: + asrs r0, 5 + b _08183A2E +_081839E4: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 12 + negs r0, r0 + cmp r0, 0 + bge _081839F6 + ldr r1, =0x000001ff + adds r0, r1 +_081839F6: + asrs r0, 9 + b _08183A2E + .pool +_08183A00: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 12 + negs r0, r0 + cmp r0, 0 + bge _08183A12 + ldr r1, =0x000001ff + adds r0, r1 +_08183A12: + asrs r0, 9 + adds r0, 0x10 + b _08183A2E + .pool +_08183A1C: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08183A2A + adds r0, 0x1F +_08183A2A: + asrs r0, 5 + subs r0, 0x10 +_08183A2E: + strh r0, [r4, 0x24] +_08183A30: + movs r0, 0x32 + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08183A3C + adds r0, 0x7F +_08183A3C: + asrs r0, 7 + lsls r0, 7 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x4 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x30 + strh r0, [r4, 0x32] +_08183A54: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_66 + + thumb_func_start pokemonanimfunc_67 +pokemonanimfunc_67: @ 8183A60 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r1, [r4, r0] + movs r0, 0x80 + lsls r0, 4 + cmp r1, r0 + ble _08183A84 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x3A] + b _08183B40 + .pool +_08183A84: + movs r1, 0x32 + ldrsh r2, [r4, r1] + adds r0, r2, 0 + cmp r2, 0 + bge _08183A92 + ldr r1, =0x000001ff + adds r0, r2, r1 +_08183A92: + asrs r3, r0, 9 + adds r1, r3, 0 + adds r0, r1, 0 + cmp r1, 0 + bge _08183A9E + adds r0, r1, 0x3 +_08183A9E: + asrs r0, 2 + lsls r0, 2 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + beq _08183AF4 + cmp r0, 0x1 + bgt _08183ABC + cmp r0, 0 + beq _08183AC6 + b _08183B24 + .pool +_08183ABC: + cmp r0, 0x2 + beq _08183AD8 + cmp r0, 0x3 + beq _08183B10 + b _08183B24 +_08183AC6: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08183AD4 + adds r0, 0x1F +_08183AD4: + asrs r0, 5 + b _08183B22 +_08183AD8: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 12 + negs r0, r0 + cmp r0, 0 + bge _08183AEA + ldr r1, =0x000001ff + adds r0, r1 +_08183AEA: + asrs r0, 9 + b _08183B22 + .pool +_08183AF4: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 12 + negs r0, r0 + cmp r0, 0 + bge _08183B06 + ldr r1, =0x000001ff + adds r0, r1 +_08183B06: + asrs r0, 9 + adds r0, 0x10 + b _08183B22 + .pool +_08183B10: + lsls r0, r3, 9 + subs r0, r2, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08183B1E + adds r0, 0x1F +_08183B1E: + asrs r0, 5 + subs r0, 0x10 +_08183B22: + strh r0, [r4, 0x24] +_08183B24: + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r1, 0x60 + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x4 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x40 + strh r0, [r4, 0x32] +_08183B40: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_67 + + thumb_func_start sub_8183B4C +sub_8183B4C: @ 8183B4C + push {r4-r7,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08183B5E + strh r0, [r4, 0x34] +_08183B5E: + ldr r7, =gUnknown_0860ADBE + movs r2, 0x34 + ldrsh r1, [r4, r2] + lsls r0, r1, 1 + adds r0, r1 + adds r5, r7, 0x2 + adds r0, r5 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl __divsi3 + movs r2, 0x32 + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _08183B8C + ldrh r0, [r4, 0x34] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x34] + strh r1, [r4, 0x32] +_08183B8C: + movs r0, 0x34 + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r6, r0, r1 + adds r0, r6, r5 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x38 + ldrsh r5, [r4, r1] + adds r1, r5, 0 + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bne _08183BCC + ldrh r0, [r4, 0x3A] + subs r0, 0x1 + strh r0, [r4, 0x3A] + lsls r0, 16 + cmp r0, 0 + bne _08183BC8 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _08183C06 + .pool +_08183BC8: + strh r1, [r4, 0x32] + b _08183C06 +_08183BCC: + adds r0, r6, r7 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + muls r0, r5 + ldrh r2, [r4, 0x24] + adds r0, r2 + strh r0, [r4, 0x24] + movs r0, 0x34 + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + adds r1, r7, 0x1 + adds r0, r1 + movs r1, 0 + ldrsb r1, [r0, r1] + ldrh r0, [r4, 0x38] + adds r2, r0, 0 + muls r2, r1 + adds r0, r2, 0 + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F70C +_08183C06: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8183B4C + + thumb_func_start pokemonanimfunc_68 +pokemonanimfunc_68: @ 8183C0C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1 + strh r0, [r4, 0x38] + strh r0, [r4, 0x3A] + adds r0, r4, 0 + bl sub_8183B4C + ldr r0, =sub_8183B4C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_68 + + thumb_func_start pokemonanimfunc_69 +pokemonanimfunc_69: @ 8183C2C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x2 + strh r0, [r4, 0x38] + movs r0, 0x1 + strh r0, [r4, 0x3A] + adds r0, r4, 0 + bl sub_8183B4C + ldr r0, =sub_8183B4C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_69 + + thumb_func_start pokemonanimfunc_6A +pokemonanimfunc_6A: @ 8183C4C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x2 + strh r0, [r4, 0x38] + strh r0, [r4, 0x3A] + adds r0, r4, 0 + bl sub_8183B4C + ldr r0, =sub_8183B4C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_6A + + thumb_func_start sub_8183C6C +sub_8183C6C: @ 8183C6C + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x3C] + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0xFF + ble _08183CAE + ldrh r1, [r4, 0x38] + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmp r0, 0x1 + bgt _08183CA4 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + b _08183CE8 + .pool +_08183CA4: + subs r0, r1, 0x1 + movs r1, 0 + strh r0, [r4, 0x38] + strh r1, [r4, 0x3C] + b _08183CE8 +_08183CAE: + ldrh r0, [r4, 0x3A] + adds r0, r1, r0 + strh r0, [r4, 0x3C] + lsls r0, 16 + asrs r0, 16 + movs r5, 0x80 + lsls r5, 1 + cmp r0, r5 + ble _08183CC2 + strh r5, [r4, 0x3C] +_08183CC2: + movs r1, 0x3C + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + movs r1, 0x40 + bl sine + adds r2, r0, 0 + lsls r2, 16 + asrs r2, 16 + subs r2, r5, r2 + lsls r2, 16 + asrs r2, 16 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 +_08183CE8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8183C6C + + thumb_func_start pokemonanimfunc_6B +pokemonanimfunc_6B: @ 8183CF0 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08183D16 + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] + movs r0, 0x4 + strh r0, [r4, 0x3A] + movs r0, 0x1 + strh r0, [r4, 0x38] +_08183D16: + adds r0, r4, 0 + bl sub_8183C6C + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_6B + + thumb_func_start pokemonanimfunc_6C +pokemonanimfunc_6C: @ 8183D28 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_817F70C + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08183D4E + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] + movs r0, 0x8 + strh r0, [r4, 0x3A] + movs r0, 0x2 + strh r0, [r4, 0x38] +_08183D4E: + adds r0, r4, 0 + bl sub_8183C6C + adds r0, r4, 0 + bl sub_817F70C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_6C + + thumb_func_start pokemonanimfunc_6D +pokemonanimfunc_6D: @ 8183D60 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08183D88 + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] + movs r0, 0x8 + strh r0, [r4, 0x3A] + movs r0, 0x80 + lsls r0, 2 + strh r0, [r4, 0x38] + movs r0, 0x10 + strh r0, [r4, 0x36] +_08183D88: + adds r0, r4, 0 + bl sub_8182764 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_6D + + thumb_func_start pokemonanimfunc_6E +pokemonanimfunc_6E: @ 8183D94 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08183DBA + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] + movs r0, 0x4 + strh r0, [r4, 0x3A] + adds r0, 0xFC + strh r0, [r4, 0x38] + movs r0, 0x10 + strh r0, [r4, 0x36] +_08183DBA: + adds r0, r4, 0 + bl sub_8182764 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_6E + + thumb_func_start pokemonanimfunc_6F +pokemonanimfunc_6F: @ 8183DC8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08183DF0 + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] + movs r0, 0x8 + strh r0, [r4, 0x3A] + movs r0, 0x80 + lsls r0, 2 + strh r0, [r4, 0x38] + movs r0, 0x10 + strh r0, [r4, 0x36] +_08183DF0: + adds r0, r4, 0 + bl sub_8182830 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_6F + + thumb_func_start pokemonanimfunc_70 +pokemonanimfunc_70: @ 8183DFC + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08183E22 + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + strh r5, [r4, 0x3C] + movs r1, 0x8 + strh r1, [r4, 0x3A] + movs r0, 0x80 + lsls r0, 2 + strh r0, [r4, 0x38] + strh r1, [r4, 0x36] +_08183E22: + adds r0, r4, 0 + bl sub_8182830 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_70 + + thumb_func_start pokemonanimfunc_71 +pokemonanimfunc_71: @ 8183E30 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08183E4A + adds r0, r4, 0 + bl sub_817F670 + movs r0, 0x5 + strh r0, [r4, 0x3C] + movs r0, 0x8 + strh r0, [r4, 0x3A] +_08183E4A: + adds r0, r4, 0 + bl sub_8180828 + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_71 + + thumb_func_start pokemonanimfunc_72 +pokemonanimfunc_72: @ 8183E58 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08183E72 + adds r0, r4, 0 + bl sub_817F670 + movs r0, 0x3 + strh r0, [r4, 0x3C] + movs r0, 0x4 + strh r0, [r4, 0x3A] +_08183E72: + adds r0, r4, 0 + bl sub_8180828 + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_72 + + thumb_func_start pokemonanimfunc_73 +pokemonanimfunc_73: @ 8183E80 + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0x32 + ldrsh r6, [r5, r0] + cmp r6, 0 + bne _08183EA2 + movs r4, 0x1 + strh r4, [r5, 0x32] + adds r0, r5, 0 + bl sub_817F670 + strh r4, [r5, 0x36] + movs r0, 0x1E + strh r0, [r5, 0x3A] + movs r0, 0x3C + strh r0, [r5, 0x34] + strh r6, [r5, 0x3C] +_08183EA2: + adds r0, r5, 0 + bl sub_81832C8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_73 + + thumb_func_start pokemonanimfunc_74 +pokemonanimfunc_74: @ 8183EB0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08183ED4 + movs r0, 0x1 + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F670 + movs r0, 0x2 + strh r0, [r4, 0x36] + movs r0, 0x14 + strh r0, [r4, 0x3A] + movs r0, 0x46 + strh r0, [r4, 0x34] + strh r5, [r4, 0x3C] +_08183ED4: + adds r0, r4, 0 + bl sub_81832C8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_74 + + thumb_func_start pokemonanimfunc_75 +pokemonanimfunc_75: @ 8183EE0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08183F06 + movs r0, 0x1 + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F670 + movs r0, 0x2 + strh r0, [r4, 0x36] + movs r0, 0x14 + strh r0, [r4, 0x3A] + movs r0, 0x46 + strh r0, [r4, 0x34] + strh r5, [r4, 0x38] + strh r5, [r4, 0x3C] +_08183F06: + adds r0, r4, 0 + bl sub_8183418 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_75 + + thumb_func_start pokemonanimfunc_76 +pokemonanimfunc_76: @ 8183F14 + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0x32 + ldrsh r6, [r5, r0] + cmp r6, 0 + bne _08183F38 + movs r4, 0x1 + strh r4, [r5, 0x32] + adds r0, r5, 0 + bl sub_817F670 + strh r4, [r5, 0x36] + movs r0, 0x1E + strh r0, [r5, 0x3A] + movs r0, 0x3C + strh r0, [r5, 0x34] + strh r6, [r5, 0x38] + strh r6, [r5, 0x3C] +_08183F38: + adds r0, r5, 0 + bl sub_8183418 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_76 + + thumb_func_start pokemonanimfunc_77 +pokemonanimfunc_77: @ 8183F44 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08183F6A + movs r0, 0x1 + strh r0, [r4, 0x32] + adds r0, r4, 0 + bl sub_817F670 + movs r0, 0x2 + strh r0, [r4, 0x36] + movs r0, 0x14 + strh r0, [r4, 0x3A] + movs r0, 0x46 + strh r0, [r4, 0x34] + strh r5, [r4, 0x38] + strh r5, [r4, 0x3C] +_08183F6A: + adds r0, r4, 0 + bl sub_81837DC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_77 + + thumb_func_start pokemonanimfunc_78 +pokemonanimfunc_78: @ 8183F78 + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0x32 + ldrsh r6, [r5, r0] + cmp r6, 0 + bne _08183F9C + movs r4, 0x1 + strh r4, [r5, 0x32] + adds r0, r5, 0 + bl sub_817F670 + strh r4, [r5, 0x36] + movs r0, 0x1E + strh r0, [r5, 0x3A] + movs r0, 0x3C + strh r0, [r5, 0x34] + strh r6, [r5, 0x38] + strh r6, [r5, 0x3C] +_08183F9C: + adds r0, r5, 0 + bl sub_81837DC + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_78 + + thumb_func_start sub_8183FA8 +sub_8183FA8: @ 8183FA8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0xFF + ble _08183FEA + ldrh r2, [r4, 0x3A] + movs r3, 0x3A + ldrsh r0, [r4, r3] + cmp r0, 0x1 + bgt _08183FD0 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + b _0818403E + .pool +_08183FD0: + movs r0, 0x3C + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08183FDC + adds r0, 0xFF +_08183FDC: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + strh r0, [r4, 0x3C] + subs r0, r2, 0x1 + strh r0, [r4, 0x3A] + b _0818403E +_08183FEA: + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + negs r0, r0 + strh r0, [r4, 0x24] + movs r3, 0x3C + ldrsh r2, [r4, r3] + adds r1, r2, 0 + adds r1, 0xC0 + adds r0, r1, 0 + cmp r1, 0 + bge _0818400C + ldr r3, =0x000001bf + adds r0, r2, r3 +_0818400C: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x26] + lsls r0, 16 + cmp r0, 0 + ble _0818402E + movs r3, 0x26 + ldrsh r0, [r4, r3] + negs r0, r0 + strh r0, [r4, 0x26] +_0818402E: + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x34] + ldrh r2, [r4, 0x3C] + adds r0, r2 + strh r0, [r4, 0x3C] +_0818403E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8183FA8 + + thumb_func_start pokemonanimfunc_79 +pokemonanimfunc_79: @ 8184048 + push {lr} + adds r1, r0, 0 + movs r0, 0x32 + ldrsh r2, [r1, r0] + cmp r2, 0 + bne _08184066 + movs r0, 0x1 + strh r0, [r1, 0x32] + strh r0, [r1, 0x3A] + strh r2, [r1, 0x3C] + movs r0, 0xC + strh r0, [r1, 0x38] + strh r0, [r1, 0x36] + movs r0, 0x4 + strh r0, [r1, 0x34] +_08184066: + adds r0, r1, 0 + bl sub_8183FA8 + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_79 + + thumb_func_start pokemonanimfunc_7A +pokemonanimfunc_7A: @ 8184070 + push {lr} + adds r1, r0, 0 + movs r0, 0x32 + ldrsh r2, [r1, r0] + cmp r2, 0 + bne _0818408E + movs r0, 0x1 + strh r0, [r1, 0x32] + strh r0, [r1, 0x3A] + strh r2, [r1, 0x3C] + movs r0, 0xC + strh r0, [r1, 0x38] + strh r0, [r1, 0x36] + movs r0, 0x6 + strh r0, [r1, 0x34] +_0818408E: + adds r0, r1, 0 + bl sub_8183FA8 + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_7A + + thumb_func_start pokemonanimfunc_7B +pokemonanimfunc_7B: @ 8184098 + push {lr} + adds r1, r0, 0 + movs r0, 0x32 + ldrsh r2, [r1, r0] + cmp r2, 0 + bne _081840B8 + movs r0, 0x1 + strh r0, [r1, 0x32] + movs r0, 0x2 + strh r0, [r1, 0x3A] + strh r2, [r1, 0x3C] + movs r0, 0xC + strh r0, [r1, 0x38] + strh r0, [r1, 0x36] + movs r0, 0x8 + strh r0, [r1, 0x34] +_081840B8: + adds r0, r1, 0 + bl sub_8183FA8 + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_7B + + thumb_func_start sub_81840C4 +sub_81840C4: @ 81840C4 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x3C + ldrsh r0, [r5, r1] + movs r1, 0x80 + lsls r1, 1 + cmp r0, r1 + ble _081840FC + movs r2, 0x3A + ldrsh r1, [r5, r2] + ldrh r2, [r5, 0x36] + movs r3, 0x36 + ldrsh r0, [r5, r3] + cmp r1, r0 + bgt _081840EC + ldr r0, =sub_8184D88 + str r0, [r5, 0x1C] + b _081840F4 + .pool +_081840EC: + adds r0, r2, 0x1 + movs r1, 0 + strh r0, [r5, 0x36] + strh r1, [r5, 0x3C] +_081840F4: + movs r0, 0 + strh r0, [r5, 0x24] + strh r0, [r5, 0x26] + b _08184188 +_081840FC: + cmp r0, 0x9F + ble _08184126 + cmp r0, r1 + ble _08184106 + strh r1, [r5, 0x3C] +_08184106: + movs r0, 0x3C + ldrsh r1, [r5, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08184112 + adds r0, 0xFF +_08184112: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x8 + bl sine + negs r0, r0 + b _08184154 +_08184126: + cmp r0, 0x5F + ble _0818414A + movs r0, 0x60 + movs r1, 0x6 + bl sine + adds r4, r0, 0 + movs r1, 0x3C + ldrsh r0, [r5, r1] + subs r0, 0x60 + lsls r0, 17 + asrs r0, 16 + movs r1, 0x4 + bl sine + subs r4, r0 + strh r4, [r5, 0x26] + b _08184156 +_0818414A: + movs r2, 0x3C + ldrsh r0, [r5, r2] + movs r1, 0x6 + bl sine +_08184154: + strh r0, [r5, 0x26] +_08184156: + movs r3, 0x3C + ldrsh r0, [r5, r3] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + movs r2, 0x38 + ldrsh r1, [r5, r2] + bl sine + negs r0, r0 + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r0, [r5, 0x36] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0818417E + lsls r0, r2, 16 + negs r0, r0 + lsrs r2, r0, 16 +_0818417E: + strh r2, [r5, 0x24] + ldrh r0, [r5, 0x34] + ldrh r3, [r5, 0x3C] + adds r0, r3 + strh r0, [r5, 0x3C] +_08184188: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81840C4 + + thumb_func_start pokemonanimfunc_7C +pokemonanimfunc_7C: @ 8184190 + push {lr} + adds r2, r0, 0 + movs r0, 0x32 + ldrsh r3, [r2, r0] + cmp r3, 0 + bne _081841B0 + movs r1, 0x1 + strh r1, [r2, 0x32] + movs r0, 0x2 + strh r0, [r2, 0x3A] + strh r3, [r2, 0x3C] + movs r0, 0x10 + strh r0, [r2, 0x38] + strh r1, [r2, 0x36] + movs r0, 0x4 + strh r0, [r2, 0x34] +_081841B0: + adds r0, r2, 0 + bl sub_81840C4 + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_7C + + thumb_func_start pokemonanimfunc_7D +pokemonanimfunc_7D: @ 81841BC + push {lr} + adds r2, r0, 0 + movs r0, 0x32 + ldrsh r3, [r2, r0] + cmp r3, 0 + bne _081841DC + movs r1, 0x1 + strh r1, [r2, 0x32] + movs r0, 0x2 + strh r0, [r2, 0x3A] + strh r3, [r2, 0x3C] + movs r0, 0x10 + strh r0, [r2, 0x38] + strh r1, [r2, 0x36] + movs r0, 0x6 + strh r0, [r2, 0x34] +_081841DC: + adds r0, r2, 0 + bl sub_81840C4 + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_7D + + thumb_func_start pokemonanimfunc_7E +pokemonanimfunc_7E: @ 81841E8 + push {lr} + adds r2, r0, 0 + movs r0, 0x32 + ldrsh r3, [r2, r0] + cmp r3, 0 + bne _08184208 + movs r1, 0x1 + strh r1, [r2, 0x32] + movs r0, 0x3 + strh r0, [r2, 0x3A] + strh r3, [r2, 0x3C] + movs r0, 0x10 + strh r0, [r2, 0x38] + strh r1, [r2, 0x36] + movs r0, 0x8 + strh r0, [r2, 0x34] +_08184208: + adds r0, r2, 0 + bl sub_81840C4 + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_7E + + thumb_func_start pokemonanimfunc_7F +pokemonanimfunc_7F: @ 8184214 + push {lr} + adds r2, r0, 0 + movs r0, 0x32 + ldrsh r1, [r2, r0] + cmp r1, 0 + bne _08184232 + movs r0, 0x1 + strh r0, [r2, 0x32] + strh r0, [r2, 0x3A] + strh r1, [r2, 0x3C] + movs r1, 0x4 + strh r1, [r2, 0x38] + movs r0, 0x6 + strh r0, [r2, 0x36] + strh r1, [r2, 0x34] +_08184232: + adds r0, r2, 0 + bl sub_8183FA8 + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_7F + + thumb_func_start pokemonanimfunc_80 +pokemonanimfunc_80: @ 818423C + push {lr} + adds r1, r0, 0 + movs r0, 0x32 + ldrsh r2, [r1, r0] + cmp r2, 0 + bne _0818425A + movs r0, 0x1 + strh r0, [r1, 0x32] + strh r0, [r1, 0x3A] + strh r2, [r1, 0x3C] + movs r0, 0x4 + strh r0, [r1, 0x38] + movs r0, 0x6 + strh r0, [r1, 0x36] + strh r0, [r1, 0x34] +_0818425A: + adds r0, r1, 0 + bl sub_8183FA8 + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_80 + + thumb_func_start pokemonanimfunc_81 +pokemonanimfunc_81: @ 8184264 + push {lr} + adds r1, r0, 0 + movs r0, 0x32 + ldrsh r2, [r1, r0] + cmp r2, 0 + bne _08184286 + movs r0, 0x1 + strh r0, [r1, 0x32] + movs r0, 0x2 + strh r0, [r1, 0x3A] + strh r2, [r1, 0x3C] + movs r0, 0x4 + strh r0, [r1, 0x38] + movs r0, 0x6 + strh r0, [r1, 0x36] + movs r0, 0x8 + strh r0, [r1, 0x34] +_08184286: + adds r0, r1, 0 + bl sub_8183FA8 + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_81 + + thumb_func_start sub_8184290 +sub_8184290: @ 8184290 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + lsls r0, 7 + movs r2, 0x3C + ldrsh r1, [r4, r2] + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + lsls r0, r1, 8 + negs r0, r0 + strh r0, [r4, 0x3A] + movs r0, 0x36 + ldrsh r2, [r4, r0] + adds r0, r4, 0 + movs r3, 0 + bl sub_817F3F0 + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0x3A] + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_817F6D4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8184290 + + thumb_func_start pokemonanimfunc_82 +pokemonanimfunc_82: @ 81842DC + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08184300 + adds r0, r4, 0 + bl sub_817F670 + movs r0, 0x3C + strh r0, [r4, 0x3C] + movs r0, 0x8 + strh r0, [r4, 0x38] + ldr r0, =0x0000ffe0 + strh r0, [r4, 0x36] + movs r0, 0x1 + strh r0, [r4, 0x34] + strh r5, [r4, 0x2E] +_08184300: + movs r2, 0x32 + ldrsh r1, [r4, r2] + movs r3, 0x3C + ldrsh r0, [r4, r3] + cmp r1, r0 + ble _0818434C + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + movs r2, 0 + strh r2, [r4, 0x24] + strh r2, [r4, 0x26] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r3, 0x34 + ldrsh r1, [r4, r3] + lsls r0, 16 + asrs r0, 16 + cmp r1, r0 + bgt _08184348 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _08184358 + .pool +_08184348: + strh r2, [r4, 0x32] + b _08184352 +_0818434C: + adds r0, r4, 0 + bl sub_8184290 +_08184352: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] +_08184358: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_82 + + thumb_func_start pokemonanimfunc_83 +pokemonanimfunc_83: @ 8184360 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08184384 + adds r0, r4, 0 + bl sub_817F670 + movs r0, 0x5A + strh r0, [r4, 0x3C] + movs r0, 0x8 + strh r0, [r4, 0x38] + ldr r0, =0x0000ffe0 + strh r0, [r4, 0x36] + movs r0, 0x1 + strh r0, [r4, 0x34] + strh r5, [r4, 0x2E] +_08184384: + movs r2, 0x32 + ldrsh r1, [r4, r2] + movs r3, 0x3C + ldrsh r0, [r4, r3] + cmp r1, r0 + ble _081843D0 + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + movs r2, 0 + strh r2, [r4, 0x24] + strh r2, [r4, 0x26] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r3, 0x34 + ldrsh r1, [r4, r3] + lsls r0, 16 + asrs r0, 16 + cmp r1, r0 + bgt _081843CC + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _081843DC + .pool +_081843CC: + strh r2, [r4, 0x32] + b _081843D6 +_081843D0: + adds r0, r4, 0 + bl sub_8184290 +_081843D6: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] +_081843DC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_83 + + thumb_func_start pokemonanimfunc_84 +pokemonanimfunc_84: @ 81843E4 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _08184408 + adds r0, r4, 0 + bl sub_817F670 + movs r0, 0x1E + strh r0, [r4, 0x3C] + movs r0, 0x8 + strh r0, [r4, 0x38] + ldr r0, =0x0000ffe0 + strh r0, [r4, 0x36] + movs r0, 0x2 + strh r0, [r4, 0x34] + strh r5, [r4, 0x2E] +_08184408: + movs r2, 0x32 + ldrsh r1, [r4, r2] + movs r3, 0x3C + ldrsh r0, [r4, r3] + cmp r1, r0 + ble _08184454 + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + movs r2, 0 + strh r2, [r4, 0x24] + strh r2, [r4, 0x26] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r3, 0x34 + ldrsh r1, [r4, r3] + lsls r0, 16 + asrs r0, 16 + cmp r1, r0 + bgt _08184450 + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _08184460 + .pool +_08184450: + strh r2, [r4, 0x32] + b _0818445A +_08184454: + adds r0, r4, 0 + bl sub_8184290 +_0818445A: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] +_08184460: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_84 + + thumb_func_start sub_8184468 +sub_8184468: @ 8184468 + push {r4-r6,lr} + adds r6, r0, 0 + movs r0, 0x32 + ldrsh r1, [r6, r0] + movs r2, 0x3C + ldrsh r0, [r6, r2] + cmp r1, r0 + ble _0818449C + movs r0, 0 + strh r0, [r6, 0x26] + movs r2, 0x80 + lsls r2, 1 + adds r0, r6, 0 + adds r1, r2, 0 + movs r3, 0 + bl sub_817F6D4 + adds r0, r6, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r6, 0x1C] + b _08184544 + .pool +_0818449C: + movs r1, 0x32 + ldrsh r0, [r6, r1] + movs r2, 0x3A + ldrsh r4, [r6, r2] + adds r1, r4, 0 + bl __modsi3 + lsls r0, 24 + lsrs r0, 16 + adds r1, r4, 0 + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bge _081844BC + adds r0, 0xFF +_081844BC: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + lsrs r4, r0, 16 + ldrh r0, [r6, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081844F8 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + movs r1, 0x20 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r5, r1, 0 + adds r0, r5 + strh r0, [r6, 0x36] + adds r0, r4, 0 + movs r1, 0x20 + bl sine + adds r0, r5 + strh r0, [r6, 0x38] + adds r0, r4, 0 + movs r1, 0x20 + b _0818451E +_081844F8: + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + movs r1, 0x8 + bl sine + movs r2, 0x80 + lsls r2, 1 + adds r5, r2, 0 + adds r0, r5 + strh r0, [r6, 0x36] + adds r0, r4, 0 + movs r1, 0x8 + bl sine + adds r0, r5 + strh r0, [r6, 0x38] + adds r0, r4, 0 + movs r1, 0x8 +_0818451E: + bl sine + lsls r0, 24 + lsrs r0, 24 + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bge _08184530 + adds r0, 0x7 +_08184530: + lsrs r0, 3 + strh r0, [r6, 0x26] + movs r0, 0x36 + ldrsh r1, [r6, r0] + movs r0, 0x38 + ldrsh r2, [r6, r0] + adds r0, r6, 0 + movs r3, 0 + bl sub_817F6D4 +_08184544: + ldrh r0, [r6, 0x32] + adds r0, 0x1 + strh r0, [r6, 0x32] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8184468 + + thumb_func_start pokemonanimfunc_85 +pokemonanimfunc_85: @ 8184550 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08184570 + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x26] + adds r0, 0x2 + strh r0, [r4, 0x26] + movs r0, 0x28 + strh r0, [r4, 0x3A] + movs r0, 0x50 + strh r0, [r4, 0x3C] +_08184570: + adds r0, r4, 0 + bl sub_8184468 + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_85 + + thumb_func_start pokemonanimfunc_86 +pokemonanimfunc_86: @ 818457C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0818459A + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x26] + adds r0, 0x2 + strh r0, [r4, 0x26] + movs r0, 0x28 + strh r0, [r4, 0x3A] + strh r0, [r4, 0x3C] +_0818459A: + adds r0, r4, 0 + bl sub_8184468 + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_86 + + thumb_func_start pokemonanimfunc_87 +pokemonanimfunc_87: @ 81845A8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081845C6 + adds r0, r4, 0 + bl sub_817F670 + ldrh r0, [r4, 0x26] + adds r0, 0x2 + strh r0, [r4, 0x26] + movs r0, 0x50 + strh r0, [r4, 0x3A] + strh r0, [r4, 0x3C] +_081845C6: + adds r0, r4, 0 + bl sub_8184468 + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_87 + + thumb_func_start sub_81845D4 +sub_81845D4: @ 81845D4 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x32] + subs r0, r1 + strh r0, [r4, 0x24] + movs r0, 0x24 + ldrsh r1, [r4, r0] + movs r2, 0x3A + ldrsh r0, [r4, r2] + cmn r1, r0 + bgt _081845FE + ldrh r0, [r4, 0x3A] + negs r0, r0 + strh r0, [r4, 0x24] + movs r0, 0x2 + strh r0, [r4, 0x3C] + ldr r0, =sub_8184610 + str r0, [r4, 0x1C] +_081845FE: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81845D4 + + thumb_func_start sub_8184610 +sub_8184610: @ 8184610 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x3C] + ldrh r2, [r4, 0x24] + adds r1, r0, r2 + strh r1, [r4, 0x24] + adds r0, 0x1 + strh r0, [r4, 0x3C] + lsls r1, 16 + cmp r1, 0 + blt _0818462E + ldr r0, =sub_8184640 + str r0, [r4, 0x1C] +_0818462E: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8184610 + + thumb_func_start sub_8184640 +sub_8184640: @ 8184640 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x3C] + ldrh r2, [r4, 0x24] + adds r1, r0, r2 + strh r1, [r4, 0x24] + adds r0, 0x1 + strh r0, [r4, 0x3C] + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r4, 0x3A] + movs r3, 0x3A + ldrsh r0, [r4, r3] + cmp r1, r0 + ble _08184668 + strh r2, [r4, 0x24] + ldr r0, =sub_8184678 + str r0, [r4, 0x1C] +_08184668: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8184640 + + thumb_func_start sub_8184678 +sub_8184678: @ 8184678 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r2, [r4, 0x34] + movs r0, 0x34 + ldrsh r1, [r4, r0] + movs r3, 0x38 + ldrsh r0, [r4, r3] + cmp r1, r0 + blt _08184698 + ldr r0, =sub_81846B8 + str r0, [r4, 0x1C] + b _081846AC + .pool +_08184698: + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + movs r3, 0x36 + ldrsh r0, [r4, r3] + negs r0, r0 + strh r0, [r4, 0x36] + adds r0, r2, 0x1 + strh r0, [r4, 0x34] +_081846AC: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8184678 + + thumb_func_start sub_81846B8 +sub_81846B8: @ 81846B8 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F70C + ldrh r0, [r4, 0x24] + subs r0, 0x2 + strh r0, [r4, 0x24] + lsls r0, 16 + cmp r0, 0 + bgt _081846DA + movs r0, 0 + strh r0, [r4, 0x24] + adds r0, r4, 0 + bl sub_817F77C + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] +_081846DA: + adds r0, r4, 0 + bl sub_817F70C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81846B8 + + thumb_func_start pokemonanimfunc_88 +pokemonanimfunc_88: @ 81846EC + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + movs r2, 0 + movs r1, 0x4 + strh r1, [r4, 0x3C] + movs r0, 0xC + strh r0, [r4, 0x3A] + movs r0, 0x10 + strh r0, [r4, 0x38] + strh r1, [r4, 0x36] + strh r2, [r4, 0x34] + movs r0, 0x2 + strh r0, [r4, 0x32] + ldr r0, =sub_81845D4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_88 + + thumb_func_start pokemonanimfunc_89 +pokemonanimfunc_89: @ 8184718 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + movs r2, 0 + movs r1, 0x2 + strh r1, [r4, 0x3C] + movs r0, 0x8 + strh r0, [r4, 0x3A] + movs r0, 0xC + strh r0, [r4, 0x38] + strh r1, [r4, 0x36] + strh r2, [r4, 0x34] + movs r0, 0x1 + strh r0, [r4, 0x32] + ldr r0, =sub_81845D4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_89 + + thumb_func_start pokemonanimfunc_8A +pokemonanimfunc_8A: @ 8184744 + push {r4,lr} + adds r4, r0, 0 + bl sub_817F670 + movs r1, 0 + strh r1, [r4, 0x3C] + movs r0, 0x6 + strh r0, [r4, 0x3A] + strh r0, [r4, 0x38] + movs r0, 0x2 + strh r0, [r4, 0x36] + strh r1, [r4, 0x34] + movs r0, 0x1 + strh r0, [r4, 0x32] + ldr r0, =sub_81845D4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pokemonanimfunc_8A + + thumb_func_start sub_8184770 +sub_8184770: @ 8184770 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x30] + strh r0, [r1, 0x24] + ldrh r2, [r1, 0x2E] + movs r3, 0x2E + ldrsh r0, [r1, r3] + cmp r0, 0x1 + ble _0818478E + movs r2, 0x30 + ldrsh r0, [r1, r2] + negs r0, r0 + strh r0, [r1, 0x30] + movs r0, 0 + b _08184790 +_0818478E: + adds r0, r2, 0x1 +_08184790: + strh r0, [r1, 0x2E] + pop {r0} + bx r0 + thumb_func_end sub_8184770 + + thumb_func_start sub_8184798 +sub_8184798: @ 8184798 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r1, =gUnknown_0860AE7C + movs r2, 0x34 + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + ldr r5, [r0] + adds r0, r4, 0 + bl sub_8184770 + movs r1, 0x3A + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r1, r0, r5 + ldrb r0, [r1, 0x1] + cmp r0, 0xFF + bne _081847D0 + movs r0, 0 + strh r0, [r4, 0x24] + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _0818482E + .pool +_081847D0: + movs r2, 0x36 + ldrsh r0, [r4, r2] + cmp r0, 0x1 + bne _08184800 + ldrb r0, [r1] + cmp r0, 0 + beq _081847F0 + ldrh r0, [r4, 0x3C] + ldr r3, =0x000003ff + movs r1, 0x10 + movs r2, 0x10 + bl pal_fade_1 + b _081847FC + .pool +_081847F0: + ldrh r0, [r4, 0x3C] + ldr r3, =0x000003ff + movs r1, 0x10 + movs r2, 0 + bl pal_fade_1 +_081847FC: + movs r0, 0 + strh r0, [r4, 0x36] +_08184800: + movs r1, 0x3A + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r5 + ldrb r1, [r0, 0x1] + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _08184828 + movs r1, 0 + movs r0, 0x1 + strh r0, [r4, 0x36] + strh r1, [r4, 0x38] + ldrh r0, [r4, 0x3A] + adds r0, 0x1 + strh r0, [r4, 0x3A] + b _0818482E + .pool +_08184828: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] +_0818482E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8184798 + + thumb_func_start pokemonanimfunc_8B +pokemonanimfunc_8B: @ 8184834 + push {r4,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x32] + adds r0, 0x1 + movs r3, 0 + strh r0, [r2, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _08184860 + ldrb r0, [r2, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r4, 0x80 + lsls r4, 1 + adds r1, r4, 0 + adds r0, r1 + strh r0, [r2, 0x3C] + strh r3, [r2, 0x3A] + strh r3, [r2, 0x38] + strh r3, [r2, 0x36] + strh r3, [r2, 0x34] +_08184860: + adds r0, r2, 0 + bl sub_8184798 + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_8B + + thumb_func_start pokemonanimfunc_8C +pokemonanimfunc_8C: @ 818486C + push {r4,r5,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x32] + adds r0, 0x1 + movs r3, 0 + strh r0, [r2, 0x32] + lsls r0, 16 + asrs r4, r0, 16 + cmp r4, 0x1 + bne _08184898 + ldrb r0, [r2, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r5, 0x80 + lsls r5, 1 + adds r1, r5, 0 + adds r0, r1 + strh r0, [r2, 0x3C] + strh r3, [r2, 0x3A] + strh r3, [r2, 0x38] + strh r3, [r2, 0x36] + strh r4, [r2, 0x34] +_08184898: + adds r0, r2, 0 + bl sub_8184798 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_8C + + thumb_func_start pokemonanimfunc_8D +pokemonanimfunc_8D: @ 81848A4 + push {r4,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x32] + adds r0, 0x1 + movs r3, 0 + strh r0, [r2, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _081848D2 + ldrb r0, [r2, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r4, 0x80 + lsls r4, 1 + adds r1, r4, 0 + adds r0, r1 + strh r0, [r2, 0x3C] + strh r3, [r2, 0x3A] + strh r3, [r2, 0x38] + strh r3, [r2, 0x36] + movs r0, 0x2 + strh r0, [r2, 0x34] +_081848D2: + adds r0, r2, 0 + bl sub_8184798 + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_8D + + thumb_func_start sub_81848E0 +sub_81848E0: @ 81848E0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x7F + ble _08184904 + ldrh r0, [r4, 0x3C] + movs r1, 0x10 + movs r2, 0 + movs r3, 0x1F + bl pal_fade_1 + ldr r0, =sub_8184D88 + str r0, [r4, 0x1C] + b _0818492A + .pool +_08184904: + movs r5, 0x32 + ldrsh r0, [r4, r5] + movs r1, 0xC + bl sine + adds r2, r0, 0 + strh r2, [r4, 0x3A] + ldrh r0, [r4, 0x3C] + lsls r2, 24 + lsrs r2, 24 + ldr r3, =gUnknown_0860AE88 + movs r5, 0x30 + ldrsh r1, [r4, r5] + lsls r1, 1 + adds r1, r3 + ldrh r3, [r1] + movs r1, 0x10 + bl pal_fade_1 +_0818492A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81848E0 + + thumb_func_start sub_8184934 +sub_8184934: @ 8184934 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x34 + ldrsh r1, [r4, r0] + movs r2, 0x36 + ldrsh r0, [r4, r2] + cmp r1, r0 + bge _081849CC + adds r0, r4, 0 + bl sub_817F70C + movs r3, 0x38 + ldrsh r1, [r4, r3] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r1, r0 + ble _08184970 + ldrh r0, [r4, 0x34] + adds r0, 0x1 + movs r2, 0 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x36 + ldrsh r1, [r4, r3] + cmp r0, r1 + bge _0818496C + strh r2, [r4, 0x38] +_0818496C: + strh r2, [r4, 0x24] + b _081849C6 +_08184970: + movs r0, 0x34 + ldrsh r1, [r4, r0] + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r0, 1 + lsls r0, 1 + subs r1, r0 + lsls r1, 16 + asrs r1, 15 + movs r0, 0x1 + subs r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 7 + movs r3, 0x2E + ldrsh r1, [r4, r3] + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0 + bge _081849A4 + adds r0, 0xFF +_081849A4: + asrs r0, 8 + lsls r0, 8 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x6 + bl sine + lsls r1, r5, 24 + asrs r1, 24 + adds r2, r1, 0 + muls r2, r0 + adds r0, r2, 0 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] +_081849C6: + adds r0, r4, 0 + bl sub_817F70C +_081849CC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8184934 + + thumb_func_start pokemonanimfunc_8E +pokemonanimfunc_8E: @ 81849D4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r2, [r4, r0] + cmp r2, 0 + bne _081849FE + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + adds r0, r1 + strh r0, [r4, 0x3C] + movs r0, 0xA + strh r0, [r4, 0x2E] + strh r2, [r4, 0x38] + movs r0, 0x2 + strh r0, [r4, 0x36] + strh r2, [r4, 0x34] + strh r2, [r4, 0x30] +_081849FE: + ldrh r0, [r4, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08184A0E + adds r0, r4, 0 + bl sub_81848E0 +_08184A0E: + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r3, 0x2E + ldrsh r1, [r4, r3] + movs r3, 0x36 + ldrsh r0, [r4, r3] + muls r1, r0 + movs r0, 0x80 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + cmp r2, r0 + blt _08184A30 + adds r0, r4, 0 + bl sub_8184934 +_08184A30: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_8E + + thumb_func_start pokemonanimfunc_8F +pokemonanimfunc_8F: @ 8184A3C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r2, [r4, r0] + cmp r2, 0 + bne _08184A66 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + adds r0, r1 + strh r0, [r4, 0x3C] + movs r0, 0x14 + strh r0, [r4, 0x2E] + strh r2, [r4, 0x38] + movs r0, 0x1 + strh r0, [r4, 0x36] + strh r2, [r4, 0x34] + strh r2, [r4, 0x30] +_08184A66: + ldrh r0, [r4, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08184A76 + adds r0, r4, 0 + bl sub_81848E0 +_08184A76: + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r3, 0x2E + ldrsh r1, [r4, r3] + movs r3, 0x36 + ldrsh r0, [r4, r3] + muls r1, r0 + movs r0, 0x80 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + cmp r2, r0 + blt _08184A98 + adds r0, r4, 0 + bl sub_8184934 +_08184A98: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_8F + + thumb_func_start pokemonanimfunc_90 +pokemonanimfunc_90: @ 8184AA4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r2, [r4, r0] + cmp r2, 0 + bne _08184ACE + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + adds r0, r1 + strh r0, [r4, 0x3C] + movs r0, 0x50 + strh r0, [r4, 0x2E] + strh r2, [r4, 0x38] + movs r0, 0x1 + strh r0, [r4, 0x36] + strh r2, [r4, 0x34] + strh r2, [r4, 0x30] +_08184ACE: + ldrh r0, [r4, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08184ADE + adds r0, r4, 0 + bl sub_81848E0 +_08184ADE: + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r3, 0x2E + ldrsh r1, [r4, r3] + movs r3, 0x36 + ldrsh r0, [r4, r3] + muls r1, r0 + movs r0, 0x80 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + cmp r2, r0 + blt _08184B00 + adds r0, r4, 0 + bl sub_8184934 +_08184B00: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_90 + + thumb_func_start pokemonanimfunc_91 +pokemonanimfunc_91: @ 8184B0C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r2, [r4, r0] + cmp r2, 0 + bne _08184B38 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + adds r0, r1 + strh r0, [r4, 0x3C] + movs r0, 0xA + strh r0, [r4, 0x2E] + strh r2, [r4, 0x38] + movs r0, 0x2 + strh r0, [r4, 0x36] + strh r2, [r4, 0x34] + movs r0, 0x1 + strh r0, [r4, 0x30] +_08184B38: + ldrh r0, [r4, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08184B48 + adds r0, r4, 0 + bl sub_81848E0 +_08184B48: + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r3, 0x2E + ldrsh r1, [r4, r3] + movs r3, 0x36 + ldrsh r0, [r4, r3] + muls r1, r0 + movs r0, 0x80 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + cmp r2, r0 + blt _08184B6A + adds r0, r4, 0 + bl sub_8184934 +_08184B6A: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_91 + + thumb_func_start pokemonanimfunc_92 +pokemonanimfunc_92: @ 8184B78 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r2, [r4, r0] + cmp r2, 0 + bne _08184BA2 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + adds r0, r1 + strh r0, [r4, 0x3C] + movs r0, 0x14 + strh r0, [r4, 0x2E] + strh r2, [r4, 0x38] + movs r0, 0x1 + strh r0, [r4, 0x36] + strh r2, [r4, 0x34] + strh r0, [r4, 0x30] +_08184BA2: + ldrh r0, [r4, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08184BB2 + adds r0, r4, 0 + bl sub_81848E0 +_08184BB2: + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r3, 0x2E + ldrsh r1, [r4, r3] + movs r3, 0x36 + ldrsh r0, [r4, r3] + muls r1, r0 + movs r0, 0x80 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + cmp r2, r0 + blt _08184BD4 + adds r0, r4, 0 + bl sub_8184934 +_08184BD4: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_92 + + thumb_func_start pokemonanimfunc_93 +pokemonanimfunc_93: @ 8184BE0 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r2, [r4, r0] + cmp r2, 0 + bne _08184C0A + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + adds r0, r1 + strh r0, [r4, 0x3C] + movs r0, 0x50 + strh r0, [r4, 0x2E] + strh r2, [r4, 0x38] + movs r0, 0x1 + strh r0, [r4, 0x36] + strh r2, [r4, 0x34] + strh r0, [r4, 0x30] +_08184C0A: + ldrh r0, [r4, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08184C1A + adds r0, r4, 0 + bl sub_81848E0 +_08184C1A: + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r3, 0x2E + ldrsh r1, [r4, r3] + movs r3, 0x36 + ldrsh r0, [r4, r3] + muls r1, r0 + movs r0, 0x80 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + cmp r2, r0 + blt _08184C3C + adds r0, r4, 0 + bl sub_8184934 +_08184C3C: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_93 + + thumb_func_start pokemonanimfunc_94 +pokemonanimfunc_94: @ 8184C48 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r2, [r4, r0] + cmp r2, 0 + bne _08184C72 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + adds r0, r1 + strh r0, [r4, 0x3C] + movs r0, 0xA + strh r0, [r4, 0x2E] + strh r2, [r4, 0x38] + movs r0, 0x2 + strh r0, [r4, 0x36] + strh r2, [r4, 0x34] + strh r0, [r4, 0x30] +_08184C72: + ldrh r0, [r4, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08184C82 + adds r0, r4, 0 + bl sub_81848E0 +_08184C82: + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r3, 0x2E + ldrsh r1, [r4, r3] + movs r3, 0x36 + ldrsh r0, [r4, r3] + muls r1, r0 + movs r0, 0x80 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + cmp r2, r0 + blt _08184CA4 + adds r0, r4, 0 + bl sub_8184934 +_08184CA4: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_94 + + thumb_func_start pokemonanimfunc_95 +pokemonanimfunc_95: @ 8184CB0 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r2, [r4, r0] + cmp r2, 0 + bne _08184CDC + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + adds r0, r1 + strh r0, [r4, 0x3C] + movs r0, 0x14 + strh r0, [r4, 0x2E] + strh r2, [r4, 0x38] + movs r0, 0x1 + strh r0, [r4, 0x36] + strh r2, [r4, 0x34] + movs r0, 0x2 + strh r0, [r4, 0x30] +_08184CDC: + ldrh r0, [r4, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08184CEC + adds r0, r4, 0 + bl sub_81848E0 +_08184CEC: + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r3, 0x2E + ldrsh r1, [r4, r3] + movs r3, 0x36 + ldrsh r0, [r4, r3] + muls r1, r0 + movs r0, 0x80 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + cmp r2, r0 + blt _08184D0E + adds r0, r4, 0 + bl sub_8184934 +_08184D0E: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_95 + + thumb_func_start pokemonanimfunc_96 +pokemonanimfunc_96: @ 8184D1C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r2, [r4, r0] + cmp r2, 0 + bne _08184D48 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + adds r0, r1 + strh r0, [r4, 0x3C] + movs r0, 0x50 + strh r0, [r4, 0x2E] + strh r2, [r4, 0x38] + movs r0, 0x1 + strh r0, [r4, 0x36] + strh r2, [r4, 0x34] + movs r0, 0x2 + strh r0, [r4, 0x30] +_08184D48: + ldrh r0, [r4, 0x32] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08184D58 + adds r0, r4, 0 + bl sub_81848E0 +_08184D58: + movs r0, 0x32 + ldrsh r2, [r4, r0] + movs r3, 0x2E + ldrsh r1, [r4, r3] + movs r3, 0x36 + ldrsh r0, [r4, r3] + muls r1, r0 + movs r0, 0x80 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + cmp r2, r0 + blt _08184D7A + adds r0, r4, 0 + bl sub_8184934 +_08184D7A: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemonanimfunc_96 + + thumb_func_start sub_8184D88 +sub_8184D88: @ 8184D88 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08184D9C + ldr r0, =DummyObjectCallback + str r0, [r2, 0x1C] +_08184D9C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8184D88 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/heal_location.s b/asm/heal_location.s new file mode 100644 index 000000000..f7947d34e --- /dev/null +++ b/asm/heal_location.s @@ -0,0 +1,83 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8122C5C +sub_8122C5C: @ 8122C5C + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 16 + lsrs r1, 16 + movs r3, 0 + ldr r2, =gUnknown_0859F53C +_08122C6A: + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r0, r4 + bne _08122C84 + movs r0, 0x1 + ldrsb r0, [r2, r0] + cmp r0, r1 + bne _08122C84 + adds r0, r3, 0x1 + b _08122C8E + .pool +_08122C84: + adds r2, 0x8 + adds r3, 0x1 + cmp r3, 0x15 + bls _08122C6A + movs r0, 0 +_08122C8E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8122C5C + + thumb_func_start sub_8122C94 +sub_8122C94: @ 8122C94 + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + bl sub_8122C5C + cmp r0, 0 + beq _08122CB4 + lsls r0, 3 + ldr r1, =gUnknown_0859F534 + adds r0, r1 + b _08122CB6 + .pool +_08122CB4: + movs r0, 0 +_08122CB6: + pop {r1} + bx r1 + thumb_func_end sub_8122C94 + + thumb_func_start sub_8122CBC +@ warpdata *sub_8122CBC(int a1) +sub_8122CBC: @ 8122CBC + push {lr} + cmp r0, 0 + beq _08122CD4 + cmp r0, 0x16 + bhi _08122CD4 + lsls r0, 3 + ldr r1, =gUnknown_0859F534 + adds r0, r1 + b _08122CD6 + .pool +_08122CD4: + movs r0, 0 +_08122CD6: + pop {r1} + bx r1 + thumb_func_end sub_8122CBC + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/intro.s b/asm/intro.s new file mode 100644 index 000000000..bcc5fc8f2 --- /dev/null +++ b/asm/intro.s @@ -0,0 +1,4490 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_816CBE8 +sub_816CBE8: @ 816CBE8 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + bl sub_80BA0A8 + pop {r0} + bx r0 + thumb_func_end sub_816CBE8 + + thumb_func_start sub_816CC00 +sub_816CC00: @ 816CC00 + push {lr} + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + ldr r0, =0x030022c0 + ldrh r0, [r0, 0x2E] + cmp r0, 0 + beq _0816CC3C + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0816CC3C + ldr r0, =sub_816CC54 + bl SetMainCallback2 + b _0816CC4C + .pool +_0816CC3C: + ldr r2, =0x030062a0 + ldr r1, [r2] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0816CC4C + adds r0, r1, 0x1 + str r0, [r2] +_0816CC4C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_816CC00 + + thumb_func_start sub_816CC54 +sub_816CC54: @ 816CC54 + push {lr} + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _0816CC66 + ldr r0, =c2_title_screen_1 + bl SetMainCallback2 +_0816CC66: + pop {r0} + bx r0 + .pool + thumb_func_end sub_816CC54 + + thumb_func_start load_copyright_graphics +@ void load_copyright_graphics(u16 tile_patterns_dest, u16 tilemap_dest, u16 unknown_dest) +load_copyright_graphics: @ 816CC70 + push {r4-r6,lr} + adds r3, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r3, 16 + lsrs r3, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + ldr r0, =gIntroCopyright_Gfx + movs r6, 0xC0 + lsls r6, 19 + adds r3, r6 + adds r1, r3, 0 + bl LZ77UnCompVram + ldr r0, =gIntroCopyright_Tilemap + adds r4, r6 + adds r1, r4, 0 + bl LZ77UnCompVram + ldr r0, =gIntroCopyright_Pal + adds r1, r5, 0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end load_copyright_graphics + + thumb_func_start SerialCb_CopyrightScreen +SerialCb_CopyrightScreen: @ 816CCB8 + push {lr} + ldr r0, =0x030062b0 + bl GameCubeMultiBoot_HandleSerialInterrupt + pop {r0} + bx r0 + .pool + thumb_func_end SerialCb_CopyrightScreen + + thumb_func_start do_copyright_screen +do_copyright_screen: @ 816CCC8 + push {r4-r6,lr} + sub sp, 0x10 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r5, r0, r1 + ldrb r4, [r5] + cmp r4, 0x8C + bne _0816CCDC + b _0816CE00 +_0816CCDC: + cmp r4, 0x8C + bgt _0816CCEC + cmp r4, 0 + beq _0816CCF4 + b _0816CDBC + .pool +_0816CCEC: + cmp r4, 0x8D + bne _0816CCF2 + b _0816CE2C +_0816CCF2: + b _0816CDBC +_0816CCF4: + movs r0, 0 + bl SetVBlankCallback + 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 r1, 0xA0 + lsls r1, 19 + ldr r2, =0x00007fff + adds r0, r2, 0 + strh r0, [r1] + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0x10 + movs r1, 0 + bl SetGpuReg + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + str r4, [sp, 0x4] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + add r0, sp, 0x4 + bl CpuSet + str r4, [sp, 0x8] + add r0, sp, 0x8 + movs r1, 0xE0 + lsls r1, 19 + ldr r2, =0x05000100 + bl CpuSet + add r0, sp, 0xC + strh r4, [r0] + ldr r1, =0x05000002 + ldr r2, =0x010001ff + bl CpuSet + bl sub_80A1A74 + movs r1, 0xE0 + lsls r1, 6 + movs r0, 0 + movs r2, 0 + bl load_copyright_graphics + bl remove_some_task + bl ResetTasks + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + movs r0, 0x1 + negs r0, r0 + ldr r1, =0x0000ffff + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r1, 0xE0 + lsls r1, 3 + movs r0, 0x8 + bl SetGpuReg + movs r0, 0x1 + bl EnableInterrupts + ldr r0, =sub_816CBE8 + bl SetVBlankCallback + movs r1, 0x80 + lsls r1, 19 + movs r2, 0xA0 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, =SerialCb_CopyrightScreen + bl SetSerialCallback + ldr r0, =0x030062b0 + bl GameCubeMultiBoot_Init +_0816CDBC: + bl fade_and_return_progress_probably + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r0, =0x030062b0 + bl GameCubeMultiBoot_Main + b _0816CEA0 + .pool +_0816CE00: + ldr r4, =0x030062b0 + adds r0, r4, 0 + bl GameCubeMultiBoot_Main + ldrb r0, [r4, 0x2] + cmp r0, 0x1 + beq _0816CEA0 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + b _0816CEA0 + .pool +_0816CE2C: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _0816CEA0 + ldr r0, =task_intro_1 + movs r1, 0 + bl CreateTask + ldr r0, =sub_816CC00 + bl SetMainCallback2 + ldr r5, =0x030062b0 + ldrb r0, [r5, 0x2] + cmp r0, 0 + beq _0816CE8C + ldrb r0, [r5, 0x2] + cmp r0, 0x2 + bne _0816CE96 + ldr r6, =0x020000ac + ldr r4, [r6] + ldr r0, =0x65366347 + cmp r4, r0 + bne _0816CE6C + ldr r0, =gMultiBootProgram_PokemonColosseum_Start + movs r1, 0x80 + lsls r1, 18 + movs r2, 0xA0 + lsls r2, 9 + bl CpuSet + str r4, [r6] +_0816CE6C: + adds r0, r5, 0 + bl GameCubeMultiBoot_ExecuteProgram + b _0816CE96 + .pool +_0816CE8C: + bl GameCubeMultiBoot_Quit + ldr r0, =sub_800BA38 + bl SetSerialCallback +_0816CE96: + movs r0, 0 + b _0816CEA2 + .pool +_0816CEA0: + movs r0, 0x1 +_0816CEA2: + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end do_copyright_screen + + thumb_func_start c2_copyright_1 +c2_copyright_1: @ 816CEAC + push {lr} + bl do_copyright_screen + lsls r0, 24 + cmp r0, 0 + bne _0816CEFA + bl sub_815355C + lsls r0, 16 + lsrs r0, 16 + bl InitSaveBlockPointersWithRandomOffset + bl sub_808447C + bl sub_8152680 + movs r0, 0 + bl sub_81534D0 + ldr r0, =0x03006210 + ldrh r0, [r0] + cmp r0, 0 + beq _0816CEDE + cmp r0, 0x2 + bne _0816CEE2 +_0816CEDE: + bl init_sav2 +_0816CEE2: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + lsls r0, 31 + lsrs r0, 31 + bl sub_82E1810 + ldr r0, =0x02000000 + movs r1, 0xE0 + lsls r1, 9 + bl InitHeap +_0816CEFA: + pop {r0} + bx r0 + .pool + thumb_func_end c2_copyright_1 + + thumb_func_start c2_show_copyright_and_intro_again_2 +c2_show_copyright_and_intro_again_2: @ 816CF0C + push {lr} + bl do_copyright_screen + pop {r0} + bx r0 + thumb_func_end c2_show_copyright_and_intro_again_2 + + thumb_func_start task_intro_1 +@ void task_intro_1(int task_id) +task_intro_1: @ 816CF18 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + mov r8, r0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0 + bl SetVBlankCallback + ldr r4, =0x0203bcc8 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + strh r1, [r4] + bl intro_reset_and_hide_bgs + movs r0, 0x1E + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0x50 + bl SetGpuReg + movs r0, 0x16 + movs r1, 0x18 + bl SetGpuReg + movs r0, 0x12 + movs r1, 0x28 + bl SetGpuReg + ldr r0, =gUnknown_085E13B4 + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, =gUnknown_085E07C4 + ldr r1, =0x06008000 + bl LZ77UnCompVram + ldr r1, =0x06008800 + add r0, sp, 0x8 + movs r6, 0 + strh r6, [r0] + ldr r4, =0x040000d4 + str r0, [r4] + str r1, [r4, 0x4] + ldr r5, =0x81000400 + str r5, [r4, 0x8] + ldr r0, [r4, 0x8] + ldr r0, =gUnknown_085E0B78 + ldr r1, =0x06009000 + bl LZ77UnCompVram + ldr r1, =0x06009800 + add r0, sp, 0x8 + strh r6, [r0] + str r0, [r4] + str r1, [r4, 0x4] + str r5, [r4, 0x8] + ldr r0, [r4, 0x8] + ldr r0, =gUnknown_085E0EAC + ldr r1, =0x0600a000 + bl LZ77UnCompVram + ldr r1, =0x0600a800 + add r0, sp, 0x8 + strh r6, [r0] + str r0, [r4] + str r1, [r4, 0x4] + str r5, [r4, 0x8] + ldr r0, [r4, 0x8] + ldr r0, =gUnknown_085E119C + ldr r1, =0x0600b000 + bl LZ77UnCompVram + ldr r1, =0x0600b800 + add r0, sp, 0x8 + strh r6, [r0] + str r0, [r4] + str r1, [r4, 0x4] + str r5, [r4, 0x8] + ldr r0, [r4, 0x8] + ldr r0, =gUnknown_085E05C4 + movs r5, 0x80 + lsls r5, 2 + movs r1, 0 + adds r2, r5, 0 + bl gpu_pal_apply + ldr r1, =0x00009603 + movs r0, 0xE + bl SetGpuReg + ldr r1, =0x00009402 + movs r0, 0xC + bl SetGpuReg + ldr r1, =0x00009201 + movs r0, 0xA + bl SetGpuReg + movs r1, 0x90 + lsls r1, 8 + movs r0, 0x8 + bl SetGpuReg + ldr r0, =gUnknown_085E4FDC + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085E4FEC + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085E4FFC + bl LoadTaggedObjectPalettes + ldr r0, =gUnknown_085E4A74 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085E4A84 + bl LoadTaggedObjectPalettes + ldr r4, =0x02037914 + movs r3, 0xF0 + lsls r3, 1 + adds r1, r4, r3 + adds r0, r4, 0 + movs r2, 0x10 + bl CpuSet + movs r0, 0xE1 + lsls r0, 1 + adds r1, r4, r0 + adds r0, r4, 0 + movs r2, 0xF + bl CpuSet + movs r3, 0xD2 + lsls r3, 1 + adds r1, r4, r3 + adds r0, r4, 0 + movs r2, 0xE + bl CpuSet + movs r0, 0xC3 + lsls r0, 1 + adds r1, r4, r0 + adds r0, r4, 0 + movs r2, 0xD + bl CpuSet + movs r3, 0xB4 + lsls r3, 1 + adds r1, r4, r3 + adds r0, r4, 0 + movs r2, 0xC + bl CpuSet + movs r0, 0xA5 + lsls r0, 1 + adds r1, r4, r0 + adds r0, r4, 0 + movs r2, 0xB + bl CpuSet + movs r3, 0x96 + lsls r3, 1 + adds r1, r4, r3 + adds r0, r4, 0 + movs r2, 0xA + bl CpuSet + movs r0, 0x78 + movs r1, 0x50 + movs r2, 0 + bl sub_816FDB8 + movs r1, 0xE + negs r1, r1 + movs r0, 0x78 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + movs r0, 0xEC + adds r2, r5, 0 + movs r3, 0x1 + bl sub_816F7D0 + ldr r2, =0x03005e00 + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x8] + ldr r0, =task_intro_2 + str r0, [r1] + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_1 + + thumb_func_start task_intro_2 +task_intro_2: @ 816D12C + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + negs r0, r0 + movs r5, 0 + str r5, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =sub_816CBE8 + bl SetVBlankCallback + movs r1, 0xFA + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =task_intro_3 + str r1, [r0] + ldr r0, =0x030062a0 + str r5, [r0] + movs r0, 0xCF + lsls r0, 1 + bl m4aSongNumStart + bl sub_800B628 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_2 + + thumb_func_start task_intro_3 +task_intro_3: @ 816D190 + push {r4-r6,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + ldr r5, =0x030062a0 + ldr r0, [r5] + cmp r0, 0x4C + bne _0816D1BE + ldr r2, =0x02020630 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r3, 0x8 + ldrsh r1, [r0, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strh r1, [r0, 0x2E] +_0816D1BE: + ldr r0, [r5] + cmp r0, 0x80 + bne _0816D1CC + ldr r0, =task_intro_3_1 + movs r1, 0 + bl CreateTask +_0816D1CC: + ldr r0, [r5] + cmp r0, 0xFB + bne _0816D1EE + ldr r2, =0x02020630 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r3, 0x8 + ldrsh r1, [r0, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2 + strh r1, [r0, 0x2E] +_0816D1EE: + ldr r1, [r5] + movs r0, 0x80 + lsls r0, 1 + cmp r1, r0 + bne _0816D200 + ldr r0, =task_intro_3_2 + movs r1, 0 + bl CreateTask +_0816D200: + ldr r1, [r5] + movs r0, 0xB8 + lsls r0, 1 + cmp r1, r0 + bne _0816D220 + movs r2, 0x80 + lsls r2, 3 + movs r0, 0x70 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x30 + movs r1, 0 + movs r3, 0x5 + bl sub_816F7D0 +_0816D220: + ldr r1, [r5] + movs r0, 0xC0 + lsls r0, 1 + cmp r1, r0 + bne _0816D240 + movs r2, 0x80 + lsls r2, 3 + movs r0, 0x80 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0xC8 + movs r1, 0x3C + movs r3, 0x9 + bl sub_816F7D0 +_0816D240: + ldr r0, [r5] + movs r4, 0x8C + lsls r4, 2 + cmp r0, r4 + bne _0816D252 + ldr r0, =task_intro_3_3 + movs r1, 0 + bl CreateTask +_0816D252: + ldr r0, [r5] + cmp r0, r4 + bls _0816D27A + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x50 + strh r1, [r0, 0xA] + strh r2, [r0, 0xC] + movs r1, 0x18 + strh r1, [r0, 0xE] + strh r2, [r0, 0x10] + movs r1, 0x28 + strh r1, [r0, 0x12] + strh r2, [r0, 0x14] + ldr r1, =task_intro_4 + str r1, [r0] +_0816D27A: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_3 + + thumb_func_start task_intro_3_3 +task_intro_3_3: @ 816D2A0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldrh r0, [r4, 0x4] + adds r0, 0x1 + strh r0, [r4, 0x4] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0816D2C4 + ldrh r0, [r4, 0x6] + adds r0, 0x1 + strh r0, [r4, 0x6] +_0816D2C4: + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0816D2D8 + cmp r0, 0x1 + beq _0816D314 + b _0816D324 + .pool +_0816D2D8: + ldr r0, =gUnknown_085E4AB8 + ldr r2, =gUnknown_085E4AD0 + movs r1, 0x8 + ldrsh r3, [r4, r1] + lsls r3, 1 + adds r1, r3, r2 + ldrb r1, [r1] + adds r2, 0x1 + adds r3, r2 + ldrh r2, [r4, 0x6] + ldrb r3, [r3] + adds r2, r3 + lsls r2, 16 + asrs r2, 16 + movs r3, 0 + bl AddObjectToFront + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + movs r0, 0xC + strh r0, [r4, 0x2] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0816D324 + .pool +_0816D314: + ldrh r0, [r4, 0x2] + subs r0, 0x1 + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bne _0816D324 + strh r0, [r4] +_0816D324: + movs r1, 0x6 + ldrsh r0, [r4, r1] + cmp r0, 0x3C + ble _0816D332 + adds r0, r5, 0 + bl DestroyTask +_0816D332: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task_intro_3_3 + + thumb_func_start sub_816D338 +sub_816D338: @ 816D338 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + bne _0816D350 + adds r0, r1, 0 + bl RemoveObjectAndFreeTiles +_0816D350: + pop {r0} + bx r0 + thumb_func_end sub_816D338 + + thumb_func_start task_intro_4 +task_intro_4: @ 816D354 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r1, r0, 24 + adds r4, r1, 0 + ldr r5, =0x030062a0 + ldr r2, [r5] + ldr r0, =0x00000387 + cmp r2, r0 + bhi _0816D418 + ldr r0, =0x03005e00 + lsls r4, r1, 2 + adds r4, r1 + lsls r4, 3 + adds r4, r0 + movs r1, 0xA + ldrsh r0, [r4, r1] + lsls r0, 16 + ldrh r1, [r4, 0xC] + adds r1, r0, r1 + ldr r0, =0xffffa000 + adds r1, r0 + asrs r0, r1, 16 + strh r0, [r4, 0xA] + strh r1, [r4, 0xC] + ldrh r1, [r4, 0xA] + movs r0, 0x1A + bl SetGpuReg + movs r1, 0xE + ldrsh r0, [r4, r1] + lsls r0, 16 + ldrh r1, [r4, 0x10] + adds r1, r0, r1 + ldr r0, =0xffff8000 + adds r1, r0 + asrs r0, r1, 16 + strh r0, [r4, 0xE] + strh r1, [r4, 0x10] + ldrh r1, [r4, 0xE] + movs r0, 0x16 + bl SetGpuReg + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r0, 16 + ldrh r1, [r4, 0x14] + adds r1, r0, r1 + ldr r0, =0xffff4000 + adds r1, r0 + asrs r0, r1, 16 + strh r0, [r4, 0x12] + strh r1, [r4, 0x14] + ldrh r1, [r4, 0x12] + movs r0, 0x12 + bl SetGpuReg + ldr r1, [r5] + movs r0, 0xD0 + lsls r0, 2 + cmp r1, r0 + bne _0816D43E + ldr r0, =gUnknown_085E4FC4 + movs r1, 0x78 + movs r2, 0xA0 + movs r3, 0xA + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + b _0816D43E + .pool +_0816D418: + ldr r0, =0x000003ef + cmp r2, r0 + bls _0816D43E + movs r0, 0x1 + negs r0, r0 + ldr r1, =0x0000ffff + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =task_intro_5 + str r1, [r0] +_0816D43E: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_4 + + thumb_func_start task_intro_5 +task_intro_5: @ 816D458 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x030062a0 + ldr r1, [r0] + ldr r0, =0x00000402 + cmp r1, r0 + bls _0816D476 + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, =task_intro_6 + str r0, [r1] +_0816D476: + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_5 + + thumb_func_start task_intro_6 +task_intro_6: @ 816D48C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl intro_reset_and_hide_bgs + movs r0, 0 + bl SetVBlankCallback + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + ldr r0, =0x0203bd24 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x0203bd26 + strh r1, [r0] + ldr r0, =0x0203bccc + strh r1, [r0] + movs r0, 0x1 + bl load_intro_part2_graphics + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =task_intro_7 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_6 + + thumb_func_start task_intro_7 +task_intro_7: @ 816D4E4 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0203bcc8 + ldrh r0, [r0] + cmp r0, 0 + bne _0816D504 + ldr r0, =gUnknown_085F52BC + bl LoadCompressedObjectPic + b _0816D50A + .pool +_0816D504: + ldr r0, =gUnknown_085F52CC + bl LoadCompressedObjectPic +_0816D50A: + ldr r0, =gUnknown_085F52DC + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085F52FC + bl LoadCompressedObjectPic + movs r6, 0 + lsls r7, r4, 2 + ldr r5, =gUnknown_085E4AE8 +_0816D51C: + lsls r0, r6, 3 + adds r0, r5 + bl LoadCompressedObjectPic + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _0816D51C + ldr r0, =gUnknown_085F530C + bl LoadTaggedObjectPalettes + ldr r0, =gUnknown_085E4B08 + bl LoadTaggedObjectPalettes + ldr r0, =gUnknown_085E4BDC + movs r5, 0x88 + lsls r5, 1 + adds r1, r5, 0 + movs r2, 0x80 + movs r3, 0 + bl AddObjectToFront + ldr r0, =gUnknown_085E4BA4 + movs r1, 0x90 + lsls r1, 1 + movs r2, 0x6E + movs r3, 0x1 + bl AddObjectToFront + ldr r0, =0x0203bcc8 + ldrh r0, [r0] + cmp r0, 0 + bne _0816D590 + adds r0, r5, 0 + movs r1, 0x64 + bl sub_817B834 + b _0816D598 + .pool +_0816D590: + adds r0, r5, 0 + movs r1, 0x64 + bl sub_817B88C +_0816D598: + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, =0x02020630 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r5, r2, 0 + adds r5, 0x1C + adds r3, r0, r5 + ldr r1, =sub_816F9D4 + str r1, [r3] + adds r2, 0x8 + adds r0, r2 + ldr r1, =gUnknown_085E4DC4 + str r1, [r0] + ldr r0, =0x03005e00 + adds r4, r7, r4 + lsls r4, 3 + adds r4, r0 + strh r6, [r4, 0xA] + ldr r0, =gUnknown_085E4B40 + movs r1, 0x88 + lsls r1, 1 + movs r2, 0x50 + movs r3, 0x4 + bl AddObjectToFront + movs r0, 0x40 + negs r0, r0 + movs r1, 0x3C + bl sub_817B9C4 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r5 + ldr r1, =sub_816FAB0 + str r1, [r0] + strh r6, [r4, 0xC] + movs r0, 0x1 + negs r0, r0 + ldr r1, =0x0000ffff + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =sub_816CBE8 + bl SetVBlankCallback + movs r1, 0x80 + lsls r1, 7 + movs r2, 0x80 + lsls r2, 3 + movs r0, 0x1 + movs r3, 0x10 + bl sub_817B3DC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x8] + movs r0, 0x1 + bl sub_817B150 + ldr r0, =task_intro_8 + str r0, [r4] + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_7 + + thumb_func_start task_intro_8 +@ void task_intro_8(int task_id) +task_intro_8: @ 816D650 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + ldr r5, =0x030062a0 + ldr r1, [r5] + movs r0, 0xE8 + lsls r0, 3 + cmp r1, r0 + bne _0816D67C + ldr r1, =0x0203bd28 + movs r0, 0x2 + strh r0, [r1] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0, 0x8] + bl DestroyTask +_0816D67C: + ldr r1, [r5] + ldr r0, =0x0000079a + cmp r1, r0 + bls _0816D6A4 + movs r0, 0x1 + negs r0, r0 + ldr r1, =0x0000ffff + str r1, [sp] + movs r1, 0x8 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =task_intro_9 + str r1, [r0] +_0816D6A4: + ldr r1, [r5] + ldr r0, =0x00000455 + ldr r3, =0x03005e00 + cmp r1, r0 + bne _0816D6C8 + ldr r2, =0x02020630 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + movs r7, 0xA + ldrsh r1, [r0, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strh r1, [r0, 0x2E] +_0816D6C8: + ldr r1, [r5] + ldr r0, =0x000004be + cmp r1, r0 + bne _0816D6EA + ldr r2, =0x02020630 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + movs r7, 0xA + ldrsh r1, [r0, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strh r1, [r0, 0x2E] +_0816D6EA: + ldr r1, [r5] + ldr r0, =0x00000572 + cmp r1, r0 + bne _0816D70C + ldr r2, =0x02020630 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + movs r7, 0xC + ldrsh r1, [r0, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strh r1, [r0, 0x2E] +_0816D70C: + ldr r1, [r5] + ldr r0, =0x00000576 + cmp r1, r0 + bne _0816D72E + ldr r2, =0x02020630 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + movs r7, 0xA + ldrsh r1, [r0, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2 + strh r1, [r0, 0x2E] +_0816D72E: + ldr r1, [r5] + movs r0, 0xC5 + lsls r0, 3 + cmp r1, r0 + bne _0816D752 + ldr r2, =0x02020630 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + movs r7, 0xA + ldrsh r1, [r0, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3 + strh r1, [r0, 0x2E] +_0816D752: + ldr r1, [r5] + ldr r0, =0x000006bf + cmp r1, r0 + bne _0816D774 + ldr r2, =0x02020630 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + movs r4, 0xA + ldrsh r1, [r0, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x4 + strh r1, [r0, 0x2E] +_0816D774: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r3 + ldrh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 18 + movs r1, 0x7F + ands r0, r1 + movs r1, 0x30 + bl sine + ldr r1, =0x0203bccc + strh r0, [r1] + ldrh r2, [r4, 0xE] + movs r7, 0xE + ldrsh r1, [r4, r7] + ldr r0, =0x000001ff + cmp r1, r0 + bgt _0816D7A0 + adds r0, r2, 0x1 + strh r0, [r4, 0xE] +_0816D7A0: + movs r0, 0 + bl sub_817B540 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_8 + + thumb_func_start task_intro_9 +task_intro_9: @ 816D7E8 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x030062a0 + ldr r1, [r0] + ldr r0, =0x00000814 + cmp r1, r0 + bls _0816D806 + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, =task_intro_10 + str r0, [r1] +_0816D806: + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_9 + + thumb_func_start sub_816D81C +sub_816D81C: @ 816D81C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x34] + adds r0, 0x4 + strh r0, [r4, 0x34] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x8 + bls _0816D830 + b _0816D9BA +_0816D830: + lsls r0, 2 + ldr r1, =_0816D840 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0816D840: + .4byte _0816D864 + .4byte _0816D87A + .4byte _0816D898 + .4byte _0816D8BC + .4byte _0816D8D8 + .4byte _0816D8FA + .4byte _0816D912 + .4byte _0816D96E + .4byte _0816D99C +_0816D864: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB3 + bgt _0816D874 + b _0816D9BA +_0816D874: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_0816D87A: + ldrh r0, [r4, 0x20] + subs r0, 0x4 + strh r0, [r4, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + beq _0816D88A + b _0816D9BA +_0816D88A: + movs r0, 0x8 + strh r0, [r4, 0x2E] + movs r0, 0x14 + strh r0, [r4, 0x30] + movs r0, 0x2 + strh r0, [r4, 0x32] + b _0816D9BA +_0816D898: + ldrh r1, [r4, 0x20] + adds r1, 0x8 + strh r1, [r4, 0x20] + ldrh r0, [r4, 0x22] + subs r0, 0x2 + strh r0, [r4, 0x22] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x7C + beq _0816D8AE + b _0816D9BA +_0816D8AE: + movs r0, 0x8 + strh r0, [r4, 0x2E] + movs r0, 0x14 + strh r0, [r4, 0x30] + movs r0, 0x3 + strh r0, [r4, 0x32] + b _0816D9BA +_0816D8BC: + ldrh r0, [r4, 0x22] + adds r0, 0x4 + strh r0, [r4, 0x22] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x50 + bne _0816D9BA + movs r0, 0x8 + strh r0, [r4, 0x2E] + movs r0, 0xA + strh r0, [r4, 0x30] + movs r0, 0x4 + strh r0, [r4, 0x32] + b _0816D9BA +_0816D8D8: + ldrh r1, [r4, 0x20] + subs r1, 0x8 + strh r1, [r4, 0x20] + ldrh r0, [r4, 0x22] + subs r0, 0x2 + strh r0, [r4, 0x22] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x3C + bne _0816D9BA + movs r0, 0x8 + strh r0, [r4, 0x2E] + movs r0, 0xA + strh r0, [r4, 0x30] + movs r0, 0x5 + strh r0, [r4, 0x32] + b _0816D9BA +_0816D8FA: + ldrh r0, [r4, 0x20] + adds r0, 0x3C + strh r0, [r4, 0x20] + movs r0, 0xC0 + strh r0, [r4, 0x36] + movs r0, 0x80 + strh r0, [r4, 0x38] + movs r0, 0x3 + strh r0, [r4, 0x3A] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_0816D912: + ldrh r0, [r4, 0x36] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3C + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x38] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x14 + bl sine + strh r0, [r4, 0x26] + ldrh r1, [r4, 0x36] + adds r1, 0x2 + strh r1, [r4, 0x36] + ldrh r0, [r4, 0x38] + adds r0, 0x4 + strh r0, [r4, 0x38] + movs r0, 0xFF + ands r1, r0 + cmp r1, 0x40 + bne _0816D9BA + adds r2, r4, 0 + adds r2, 0x3F + ldrb r0, [r2] + movs r1, 0x2 + negs r1, r1 + ands r1, r0 + strb r1, [r2] + ldrh r0, [r4, 0x3A] + subs r0, 0x1 + strh r0, [r4, 0x3A] + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + bne _0816D9BA + ldrh r0, [r4, 0x24] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + strh r1, [r4, 0x24] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + b _0816D9B8 +_0816D96E: + ldrh r0, [r4, 0x20] + subs r0, 0x2 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x38] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x14 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x38] + adds r0, 0x4 + strh r0, [r4, 0x38] + movs r0, 0x20 + ldrsh r1, [r4, r0] + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + bge _0816D9BA + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + b _0816D9BA +_0816D99C: + ldrh r0, [r4, 0x34] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + subs r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _0816D9BA + ldrh r0, [r4, 0x32] +_0816D9B8: + strh r0, [r4, 0x2E] +_0816D9BA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816D81C + + thumb_func_start sub_816D9C0 +sub_816D9C0: @ 816D9C0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x5 + bls _0816D9CE + b _0816DADA +_0816D9CE: + lsls r0, 2 + ldr r1, =_0816D9DC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0816D9DC: + .4byte _0816D9F4 + .4byte _0816DA08 + .4byte _0816DA20 + .4byte _0816DA64 + .4byte _0816DA9A + .4byte _0816DACA +_0816D9F4: + ldr r0, =0x030062a0 + ldr r1, [r0] + movs r0, 0x99 + lsls r0, 3 + cmp r1, r0 + bne _0816DADA + b _0816DABA + .pool +_0816DA08: + ldr r0, =0x030062a0 + ldr r1, [r0] + movs r0, 0xC5 + lsls r0, 3 + cmp r1, r0 + bne _0816DA70 + adds r0, r4, 0 + movs r1, 0 + b _0816DABE + .pool +_0816DA20: + ldr r0, =0x030062a0 + ldr r1, [r0] + ldr r0, =0x000006c7 + cmp r1, r0 + beq _0816DA50 + ldrh r0, [r4, 0x30] + adds r2, r0, 0 + adds r2, 0x20 + strh r2, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0816DADA + ldrh r0, [r4, 0x20] + adds r0, 0x1 + b _0816DA8A + .pool +_0816DA50: + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnim + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0x50 + strh r0, [r4, 0x32] + b _0816DADA +_0816DA64: + ldrh r0, [r4, 0x32] + subs r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + cmp r0, 0 + beq _0816DA94 +_0816DA70: + ldrh r0, [r4, 0x30] + adds r2, r0, 0 + adds r2, 0x40 + strh r2, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0816DADA + ldrh r0, [r4, 0x20] + subs r0, 0x1 +_0816DA8A: + strh r0, [r4, 0x20] + movs r0, 0xFF + ands r2, r0 + strh r2, [r4, 0x30] + b _0816DADA +_0816DA94: + adds r0, r4, 0 + movs r1, 0x2 + b _0816DABE +_0816DA9A: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0816DAAE + ldrh r0, [r4, 0x20] + adds r0, 0x4 + strh r0, [r4, 0x20] +_0816DAAE: + movs r0, 0x20 + ldrsh r1, [r4, r0] + movs r0, 0xA8 + lsls r0, 1 + cmp r1, r0 + ble _0816DADA +_0816DABA: + adds r0, r4, 0 + movs r1, 0x1 +_0816DABE: + bl StartObjectImageAnim + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0816DADA +_0816DACA: + ldr r0, =0x030062a0 + ldr r1, [r0] + ldr r0, =0x0000073f + cmp r1, r0 + bls _0816DADA + ldrh r0, [r4, 0x20] + subs r0, 0x2 + strh r0, [r4, 0x20] +_0816DADA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816D9C0 + + thumb_func_start sub_816DAE8 +sub_816DAE8: @ 816DAE8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0816DB1C + cmp r0, 0x1 + bgt _0816DAFE + cmp r0, 0 + beq _0816DB04 + b _0816DBA4 +_0816DAFE: + cmp r0, 0x2 + beq _0816DB42 + b _0816DBA4 +_0816DB04: + ldr r0, =0x030062a0 + ldr r1, [r0] + movs r0, 0x88 + lsls r0, 3 + cmp r1, r0 + bne _0816DBA4 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0816DBA4 + .pool +_0816DB1C: + ldrh r0, [r4, 0x20] + subs r0, 0x2 + strh r0, [r4, 0x20] + ldr r0, =0x030062a0 + ldr r1, [r0] + movs r0, 0x92 + lsls r0, 3 + cmp r1, r0 + bne _0816DBA4 + ldrh r0, [r4, 0x22] + subs r0, 0xC + strh r0, [r4, 0x22] + movs r0, 0x80 + strh r0, [r4, 0x30] + movs r0, 0 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_0816DB42: + movs r2, 0x20 + ldrsh r0, [r4, r2] + movs r2, 0x24 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bgt _0816DB60 + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + b _0816DBA4 + .pool +_0816DB60: + ldrh r0, [r4, 0x30] + movs r1, 0xFF + ands r1, r0 + cmp r1, 0x3F + bgt _0816DB72 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x10 + b _0816DB84 +_0816DB72: + cmp r1, 0x40 + bne _0816DB7C + ldrh r0, [r4, 0x20] + subs r0, 0x30 + strh r0, [r4, 0x20] +_0816DB7C: + ldrh r0, [r4, 0x30] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x40 +_0816DB84: + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x32] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0xC + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] +_0816DBA4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816DAE8 + + thumb_func_start task_intro_10 +task_intro_10: @ 816DBAC + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + bl intro_reset_and_hide_bgs + ldr r0, =gUnknown_085E3854 + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, =gUnknown_085E3724 + ldr r1, =0x06004000 + bl LZ77UnCompVram + ldr r0, =gUnknown_085E3524 + movs r2, 0x80 + lsls r2, 2 + movs r1, 0 + bl gpu_pal_apply + ldr r0, =0x03005e00 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + movs r5, 0 + strh r5, [r4, 0x8] + strh r5, [r4, 0xA] + strh r5, [r4, 0xC] + strh r5, [r4, 0xE] + movs r0, 0x78 + movs r1, 0x50 + movs r2, 0 + movs r3, 0 + bl sub_816F2A8 + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + movs r0, 0x1 + negs r0, r0 + ldr r1, =0x0000ffff + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r1, =0x00004883 + movs r0, 0xC + bl SetGpuReg + ldr r1, =0x00001441 + movs r0, 0 + bl SetGpuReg + ldr r0, =task_intro_11 + str r0, [r4] + ldr r0, =0x030062a0 + str r5, [r0] + movs r0, 0xDD + lsls r0, 1 + bl m4aSongNumStart + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_10 + + thumb_func_start task_intro_11 +task_intro_11: @ 816DC64 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r3, r0, r2 + movs r1, 0x80 + lsls r1, 3 + adds r0, r1, 0 + ldrh r1, [r3, 0x8] + adds r0, r1 + strh r0, [r3, 0x8] + ldrh r4, [r3, 0xA] + movs r0, 0xA + ldrsh r1, [r3, r0] + ldr r0, =0x000006bf + cmp r1, r0 + bgt _0816DCA4 + ldrh r0, [r3, 0xC] + adds r1, r4, r0 + strh r1, [r3, 0xA] + adds r0, 0x2 + strh r0, [r3, 0xC] + b _0816DCA8 + .pool +_0816DCA4: + ldr r0, =task_intro_12 + str r0, [r3] +_0816DCA8: + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r2 + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0x80 + lsls r0, 9 + bl __divsi3 + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + ldrh r3, [r4, 0x8] + movs r0, 0x78 + movs r1, 0x50 + bl sub_816F2A8 + ldr r0, =0x030062a0 + ldr r0, [r0] + cmp r0, 0x1C + bne _0816DCE6 + movs r0, 0x1 + negs r0, r0 + ldr r1, =0x0000ffff + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe +_0816DCE6: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_11 + + thumb_func_start task_intro_12 +task_intro_12: @ 816DCFC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x030062a0 + ldr r0, [r0] + cmp r0, 0x2B + bls _0816DD18 + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, =task_intro_13 + str r0, [r1] +_0816DD18: + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_12 + + thumb_func_start task_intro_13 +task_intro_13: @ 816DD28 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0816DD94 + bl intro_reset_and_hide_bgs + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + ldr r1, =0x0300301c + movs r0, 0x8 + strb r0, [r1] + ldr r0, =gUnknown_08D88494 + movs r1, 0xC0 + lsls r1, 19 + bl LZDecompressVram + ldr r0, =gUnknown_08D88D40 + ldr r1, =0x0600c000 + bl LZDecompressVram + ldr r0, =gUnknown_08D89F7C + ldr r1, =0x06004000 + bl LZDecompressVram + ldr r0, =gUnknown_08D8A818 + ldr r1, =0x0600e000 + bl LZDecompressVram + ldr r0, =gUnknown_08524D14 + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_0852561C + bl LoadCompressedObjectPaletteUsingHeap + ldr r0, =gUnknown_08D85CD0 + ldr r1, =0x02037714 + movs r2, 0x80 + lsls r2, 1 + bl CpuSet + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =task_intro_14 + str r1, [r0] +_0816DD94: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_13 + + thumb_func_start task_intro_14 +task_intro_14: @ 816DDD8 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x40 + movs r1, 0xF0 + bl SetGpuReg + movs r0, 0x44 + movs r1, 0xA0 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0 + bl SetGpuReg + ldr r1, =0x0000b880 + movs r0, 0xC + bl SetGpuReg + ldr r1, =0x00001c05 + movs r0, 0xA + bl SetGpuReg + ldr r1, =0x00003641 + movs r0, 0 + bl SetGpuReg + movs r0, 0x1 + negs r0, r0 + ldr r1, =0x0000ffff + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =0x03005e00 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + movs r0, 0 + strh r0, [r4, 0x8] + ldr r0, =0x0000ffa0 + strh r0, [r4, 0xA] + ldr r1, =0x0000ff51 + strh r1, [r4, 0xC] + movs r2, 0x80 + lsls r2, 1 + strh r2, [r4, 0xE] + movs r3, 0 + bl sub_816F2A8 + ldr r0, =task_intro_15 + str r0, [r4] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_14 + + thumb_func_start task_intro_15 +task_intro_15: @ 816DE7C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r2, [r4, 0x8] + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x20 + beq _0816DEB8 + adds r0, r2, 0x4 + strh r0, [r4, 0x8] + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r1, 8 + adds r0, r2, 0 + subs r0, 0x9C + subs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + b _0816DEC6 + .pool +_0816DEB8: + movs r1, 0x82 + lsls r1, 6 + movs r0, 0x44 + bl SetGpuReg + ldr r0, =task_intro_16 + str r0, [r4] +_0816DEC6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_15 + + thumb_func_start task_intro_16 +task_intro_16: @ 816DED0 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =task_intro_17 + str r0, [r1] + bx lr + .pool + thumb_func_end task_intro_16 + + thumb_func_start task_intro_17 +task_intro_17: @ 816DEEC + push {lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + strh r2, [r1, 0x8] + ldr r0, =task_intro_18 + str r0, [r1] + movs r0, 0x1 + str r0, [sp] + movs r0, 0x4 + str r0, [sp, 0x4] + str r2, [sp, 0x8] + movs r0, 0 + movs r1, 0xA0 + movs r2, 0x4 + movs r3, 0x4 + bl sub_80BA384 + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_17 + + thumb_func_start task_intro_18 +task_intro_18: @ 816DF2C + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + ldrh r0, [r4] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bhi _0816DF62 + ldrh r0, [r4, 0xA] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0816DF62 + ldrh r0, [r4, 0x8] + movs r1, 0x3 + eors r0, r1 + strh r0, [r4, 0x8] +_0816DF62: + ldrh r0, [r4, 0x2] + ldrh r1, [r4, 0x8] + ldrh r2, [r4, 0x4] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + ldrh r2, [r4, 0x6] + movs r3, 0 + bl sub_816F2A8 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x9 + bls _0816DF80 + b _0816E176 +_0816DF80: + lsls r0, 2 + ldr r1, =_0816DF94 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0816DF94: + .4byte _0816DFBC + .4byte _0816DFE6 + .4byte _0816E024 + .4byte _0816E038 + .4byte _0816E07C + .4byte _0816E09A + .4byte _0816E0C8 + .4byte _0816E0DE + .4byte _0816E13C + .4byte _0816E156 +_0816DFBC: + ldrh r0, [r4, 0x2] + adds r0, 0x10 + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA0 + beq _0816DFCC + b _0816E176 +_0816DFCC: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + movs r0, 0x2 + strh r0, [r4, 0xC] + movs r2, 0xF1 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r4, 0xE] + adds r0, r5, 0 + bl sub_816E190 + b _0816E176 +_0816DFE6: + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0816DFF4 + b _0816E176 +_0816DFF4: + movs r0, 0x2 + strh r0, [r4, 0xC] + movs r1, 0xE + ldrsh r0, [r4, r1] + ldr r1, =gUnknown_08D85CD0 + adds r0, r1 + ldr r1, =0x02037b52 + movs r2, 0x1 + bl CpuSet + ldrh r0, [r4, 0xE] + adds r0, 0x2 + strh r0, [r4, 0xE] + lsls r0, 16 + movs r1, 0xF6 + lsls r1, 17 + cmp r0, r1 + beq _0816E01A + b _0816E176 +_0816E01A: + b _0816E14E + .pool +_0816E024: + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0816E032 + b _0816E176 +_0816E032: + movs r0, 0x2 + strh r0, [r4, 0xC] + b _0816E14E +_0816E038: + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0816E046 + b _0816E176 +_0816E046: + movs r0, 0x2 + strh r0, [r4, 0xC] + movs r2, 0xE + ldrsh r0, [r4, r2] + ldr r1, =gUnknown_08D85CD0 + adds r0, r1 + ldr r1, =0x02037b52 + movs r2, 0x1 + bl CpuSet + ldrh r0, [r4, 0xE] + subs r0, 0x2 + strh r0, [r4, 0xE] + lsls r0, 16 + movs r1, 0xF0 + lsls r1, 17 + cmp r0, r1 + beq _0816E06C + b _0816E176 +_0816E06C: + movs r0, 0x8 + strh r0, [r4, 0xC] + b _0816E14E + .pool +_0816E07C: + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _0816E176 + movs r1, 0x60 + negs r1, r1 + adds r0, r1, 0 + strh r0, [r4, 0x2] + movs r0, 0xA9 + strh r0, [r4, 0x4] + movs r0, 0x3 + strh r0, [r4, 0xC] + b _0816E14E +_0816E09A: + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + bne _0816E176 + movs r0, 0x50 + strh r0, [r4, 0x2] + movs r0, 0x29 + strh r0, [r4, 0x4] + movs r0, 0x10 + strh r0, [r4, 0xC] + ldr r0, =0x00000195 + str r1, [sp] + movs r1, 0 + movs r2, 0x64 + movs r3, 0xA + bl sub_80A344C + b _0816E14E + .pool +_0816E0C8: + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _0816E176 + movs r0, 0x50 + strh r0, [r4, 0x2] + movs r0, 0x28 + strh r0, [r4, 0x4] + b _0816E14E +_0816E0DE: + ldrh r0, [r4, 0x2] + adds r0, 0x4 + strh r0, [r4, 0x2] + ldrh r0, [r4, 0x4] + adds r0, 0x4 + strh r0, [r4, 0x4] + ldr r2, =0x00000666 + adds r0, r2, 0 + ldrh r1, [r4, 0xC] + adds r0, r1 + strh r0, [r4, 0xC] + movs r2, 0xC + ldrsh r0, [r4, r2] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + lsrs r0, 8 + movs r1, 0x40 + bl sine + movs r1, 0x80 + lsls r1, 1 + adds r5, r1, 0 + adds r0, r5 + strh r0, [r4, 0x6] + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, 0x78 + bne _0816E176 + movs r0, 0x2 + negs r0, r0 + ldr r1, =0x00007fff + str r1, [sp] + movs r1, 0x3 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + strh r5, [r4, 0x6] + movs r0, 0 + strh r0, [r4, 0x8] + b _0816E14E + .pool +_0816E13C: + ldrh r1, [r4, 0x6] + movs r2, 0x6 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0816E14E + adds r0, r1, 0 + subs r0, 0x8 + strh r0, [r4, 0x6] + b _0816E176 +_0816E14E: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _0816E176 +_0816E156: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0816E176 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =task_intro_19 + str r1, [r0] + ldr r1, =0x02039b28 + movs r0, 0x3 + strb r0, [r1, 0x15] +_0816E176: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_18 + + thumb_func_start sub_816E190 +sub_816E190: @ 816E190 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + movs r4, 0 + ldr r6, =0x02020630 + ldr r5, =gUnknown_085E4C64 +_0816E19C: + movs r0, 0 + ldrsh r1, [r5, r0] + lsls r3, r4, 24 + lsrs r3, 24 + ldr r0, =gUnknown_08596C10 + movs r2, 0xA0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r0, r6, 0 + adds r0, 0x1C + adds r0, r2, r0 + ldr r1, =sub_816E1F8 + str r1, [r0] + adds r2, r6 + ldrb r0, [r2, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + strb r0, [r2, 0x5] + strh r4, [r2, 0x30] + strh r7, [r2, 0x36] + ldrb r1, [r5, 0x2] + adds r0, r2, 0 + bl StartObjectImageAnim + adds r5, 0x6 + adds r4, 0x1 + cmp r4, 0x5 + ble _0816E19C + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816E190 + + thumb_func_start sub_816E1F8 +sub_816E1F8: @ 816E1F8 + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x34] + adds r0, 0x1 + strh r0, [r3, 0x34] + ldrh r0, [r3, 0x34] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0816E214 + ldrh r0, [r3, 0x26] + movs r1, 0x3 + eors r0, r1 + strh r0, [r3, 0x26] +_0816E214: + movs r1, 0x2E + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _0816E222 + cmp r0, 0x1 + beq _0816E278 + b _0816E29C +_0816E222: + ldr r2, =gUnknown_085E4C64 + movs r0, 0x30 + ldrsh r1, [r3, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + adds r2, 0x4 + adds r0, r2 + ldrh r2, [r0] + ldrh r1, [r3, 0x32] + adds r2, r1 + strh r2, [r3, 0x32] + movs r0, 0x32 + ldrsh r1, [r3, r0] + movs r0, 0xFF + lsls r0, 8 + ands r1, r0 + asrs r1, 8 + ldrh r0, [r3, 0x22] + subs r0, r1 + strh r0, [r3, 0x22] + movs r0, 0xFF + ands r2, r0 + strh r2, [r3, 0x32] + ldr r2, =0x03005e00 + movs r0, 0x36 + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0x7 + ble _0816E29C + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + b _0816E29C + .pool +_0816E278: + ldrh r1, [r3, 0x20] + movs r2, 0x20 + ldrsh r0, [r3, r2] + cmp r0, 0x77 + bgt _0816E286 + subs r0, r1, 0x2 + b _0816E288 +_0816E286: + adds r0, r1, 0x2 +_0816E288: + strh r0, [r3, 0x20] + ldrh r1, [r3, 0x22] + movs r2, 0x22 + ldrsh r0, [r3, r2] + cmp r0, 0x4F + bgt _0816E298 + subs r0, r1, 0x2 + b _0816E29A +_0816E298: + adds r0, r1, 0x2 +_0816E29A: + strh r0, [r3, 0x22] +_0816E29C: + pop {r0} + bx r0 + thumb_func_end sub_816E1F8 + + thumb_func_start task_intro_19 +task_intro_19: @ 816E2A0 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl ResetAllObjectData + ldr r0, =gUnknown_08D89224 + movs r1, 0xC0 + lsls r1, 19 + bl LZDecompressVram + ldr r0, =gUnknown_08D89ABC + ldr r1, =0x0600c000 + bl LZDecompressVram + ldr r0, =gUnknown_08D8A934 + ldr r1, =0x0600e000 + bl LZDecompressVram + ldr r0, =gUnknown_085E4C88 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085E4C98 + bl LoadTaggedObjectPalette + movs r0, 0x2 + negs r0, r0 + ldr r1, =0x0000ffff + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =task_intro_20 + str r0, [r1] + movs r4, 0 + strh r4, [r1, 0x8] + movs r0, 0xA8 + lsls r0, 1 + strh r0, [r1, 0xA] + movs r2, 0x50 + strh r2, [r1, 0xC] + movs r2, 0x10 + strh r2, [r1, 0x14] + adds r2, 0xF0 + strh r2, [r1, 0xE] + movs r1, 0x50 + movs r3, 0 + bl sub_816F2A8 + movs r0, 0x1 + str r0, [sp] + movs r0, 0x6 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0xA0 + movs r2, 0x4 + movs r3, 0x4 + bl sub_80BA384 + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_19 + + thumb_func_start task_intro_20 +task_intro_20: @ 816E358 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + ldrh r0, [r5, 0x2] + ldrh r1, [r5, 0x4] + ldrh r2, [r5, 0x6] + movs r3, 0 + bl sub_816F2A8 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0xD + bls _0816E380 + b _0816E6BC +_0816E380: + lsls r0, 2 + ldr r1, =_0816E394 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0816E394: + .4byte _0816E3CC + .4byte _0816E3E0 + .4byte _0816E43C + .4byte _0816E488 + .4byte _0816E4C4 + .4byte _0816E4EC + .4byte _0816E544 + .4byte _0816E560 + .4byte _0816E5A0 + .4byte _0816E5BC + .4byte _0816E5FC + .4byte _0816E61A + .4byte _0816E664 + .4byte _0816E69C +_0816E3CC: + ldrh r0, [r5, 0xC] + subs r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0816E3DA + b _0816E6BC +_0816E3DA: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_0816E3E0: + ldrh r0, [r5, 0xC] + adds r0, 0x4 + strh r0, [r5, 0xC] + movs r2, 0xC + ldrsh r0, [r5, r2] + movs r1, 0x80 + lsls r1, 1 + bl sine + ldr r1, =0x03005e00 + lsls r4, r6, 2 + adds r4, r6 + lsls r4, 3 + adds r4, r1 + movs r2, 0xAC + lsls r2, 1 + adds r1, r2, 0 + subs r1, r0 + strh r1, [r4, 0xA] + movs r1, 0xC + ldrsh r0, [r5, r1] + movs r1, 0x40 + bl cosine + movs r1, 0x54 + subs r1, r0 + strh r1, [r4, 0xC] + movs r2, 0xC + ldrsh r0, [r5, r2] + cmp r0, 0x40 + beq _0816E420 + b _0816E6BC +_0816E420: + movs r0, 0x19 + strh r0, [r5, 0xC] + movs r0, 0x1 + strh r0, [r5, 0xE] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + movs r0, 0 + bl sub_816E6D4 + b _0816E6BC + .pool +_0816E43C: + ldrh r0, [r5, 0xC] + subs r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0816E44A + b _0816E6BC +_0816E44A: + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + ldrh r2, [r1, 0xA] + adds r0, r2 + strh r0, [r1, 0xA] + ldr r2, =0xfffffefe + adds r0, r2, 0 + ldrh r2, [r1, 0xC] + adds r0, r2 + strh r0, [r1, 0xC] + movs r0, 0x8 + strh r0, [r5, 0xC] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + movs r0, 0 + bl sub_816E6D4 + bl sub_816E74C + b _0816E6BC + .pool +_0816E488: + ldrh r0, [r5, 0xC] + subs r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0816E496 + b _0816E6BC +_0816E496: + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r2, =0xffffff00 + adds r0, r2, 0 + ldrh r2, [r1, 0xA] + adds r0, r2 + strh r0, [r1, 0xA] + movs r2, 0x81 + lsls r2, 1 + adds r0, r2, 0 + ldrh r2, [r1, 0xC] + adds r0, r2 + strh r0, [r1, 0xC] + movs r0, 0x8 + strh r0, [r5, 0xC] + b _0816E690 + .pool +_0816E4C4: + ldrh r0, [r5, 0xC] + subs r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0816E4D2 + b _0816E6BC +_0816E4D2: + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0xC] + subs r1, 0xFC + strh r1, [r0, 0xC] + movs r0, 0x8 + strh r0, [r5, 0xC] + b _0816E690 + .pool +_0816E4EC: + ldrh r0, [r5, 0xC] + subs r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0816E4FA + b _0816E6BC +_0816E4FA: + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0xC] + adds r0, 0xFC + strh r0, [r1, 0xC] + ldrh r2, [r5, 0xE] + movs r0, 0xE + ldrsh r1, [r5, r0] + cmp r1, 0 + beq _0816E528 + movs r0, 0xC + strh r0, [r5, 0xC] + subs r0, r2, 0x1 + strh r0, [r5, 0xE] + movs r0, 0x2 + strh r0, [r5] + b _0816E6BC + .pool +_0816E528: + movs r0, 0x1 + strh r0, [r5, 0xC] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + movs r0, 0xCA + lsls r0, 1 + str r1, [sp] + movs r1, 0 + movs r2, 0x78 + movs r3, 0xA + bl sub_80A344C + b _0816E6BC +_0816E544: + ldrh r0, [r5, 0xC] + subs r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0816E552 + b _0816E6BC +_0816E552: + movs r0, 0x4 + strh r0, [r5, 0xC] + movs r1, 0xF5 + lsls r1, 1 + adds r0, r1, 0 + strh r0, [r5, 0xE] + b _0816E690 +_0816E560: + ldrh r0, [r5, 0xC] + subs r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0816E56E + b _0816E6BC +_0816E56E: + movs r0, 0x4 + strh r0, [r5, 0xC] + movs r2, 0xE + ldrsh r0, [r5, r2] + ldr r1, =gUnknown_08D85CD0 + adds r0, r1 + ldr r1, =0x02037b72 + movs r2, 0x1 + bl CpuSet + ldrh r0, [r5, 0xE] + subs r0, 0x2 + strh r0, [r5, 0xE] + lsls r0, 16 + movs r1, 0xF0 + lsls r1, 17 + cmp r0, r1 + beq _0816E594 + b _0816E6BC +_0816E594: + b _0816E690 + .pool +_0816E5A0: + ldrh r0, [r5, 0xC] + subs r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + beq _0816E5AE + b _0816E6BC +_0816E5AE: + movs r0, 0x4 + strh r0, [r5, 0xC] + movs r1, 0xF1 + lsls r1, 1 + adds r0, r1, 0 + strh r0, [r5, 0xE] + b _0816E690 +_0816E5BC: + ldrh r0, [r5, 0xC] + subs r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _0816E6BC + movs r0, 0x4 + strh r0, [r5, 0xC] + movs r2, 0xE + ldrsh r0, [r5, r2] + ldr r1, =gUnknown_08D85CD0 + adds r0, r1 + ldr r1, =0x02037b72 + movs r2, 0x1 + bl CpuSet + ldrh r0, [r5, 0xE] + adds r0, 0x2 + strh r0, [r5, 0xE] + lsls r0, 16 + movs r1, 0xF7 + lsls r1, 17 + cmp r0, r1 + bne _0816E6BC + movs r0, 0x10 + strh r0, [r5, 0xC] + b _0816E690 + .pool +_0816E5FC: + ldrh r0, [r5, 0xC] + subs r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bne _0816E6BC + strh r0, [r5, 0xC] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + adds r0, r6, 0 + bl sub_816E6D4 + b _0816E6BC +_0816E61A: + ldrh r0, [r5, 0xC] + adds r0, 0x4 + strh r0, [r5, 0xC] + ldrh r0, [r5, 0x6] + subs r0, 0x8 + strh r0, [r5, 0x6] + movs r1, 0xC + ldrsh r0, [r5, r1] + movs r1, 0x3C + bl sine + ldr r2, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r2 + adds r0, 0x58 + strh r0, [r1, 0xA] + movs r2, 0xC + ldrsh r0, [r5, r2] + cmp r0, 0x40 + bne _0816E6BC + movs r0, 0x2 + negs r0, r0 + ldr r1, =0x00007fff + str r1, [sp] + movs r1, 0x3 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _0816E690 + .pool +_0816E664: + ldrh r0, [r5, 0xC] + adds r0, 0x4 + strh r0, [r5, 0xC] + ldrh r0, [r5, 0x6] + subs r0, 0x8 + strh r0, [r5, 0x6] + movs r1, 0xC + ldrsh r0, [r5, r1] + movs r1, 0x14 + bl sine + ldr r2, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r2 + adds r0, 0x80 + strh r0, [r1, 0xA] + movs r2, 0xC + ldrsh r0, [r5, r2] + cmp r0, 0x80 + bne _0816E6BC +_0816E690: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + b _0816E6BC + .pool +_0816E69C: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0816E6BC + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =task_intro_21 + str r1, [r0] + ldr r1, =0x02039b28 + movs r0, 0x3 + strb r0, [r1, 0x15] +_0816E6BC: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_20 + + thumb_func_start sub_816E6D4 +sub_816E6D4: @ 816E6D4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + ldr r7, =gUnknown_085E4CA8 + ldr r0, =0x02020630 + mov r9, r0 + adds r4, r7, 0 + movs r6, 0 +_0816E6EE: + movs r3, 0 + ldrsh r1, [r4, r3] + adds r0, r7, 0x2 + adds r0, r6, r0 + movs r3, 0 + ldrsh r2, [r0, r3] + lsls r3, r5, 24 + lsrs r3, 24 + ldr r0, =gUnknown_085E4D14 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r9 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r3] + mov r0, r8 + strh r0, [r2, 0x38] + ldrh r0, [r4, 0x4] + strh r0, [r2, 0x3A] + movs r0, 0x40 + strh r0, [r2, 0x3C] + adds r4, 0x6 + adds r6, 0x6 + adds r5, 0x1 + cmp r5, 0x5 + ble _0816E6EE + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816E6D4 + + thumb_func_start sub_816E74C +sub_816E74C: @ 816E74C + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r5, 0 + ldr r7, =gUnknown_085E4CA8 + adds r4, r7, 0x4 + movs r6, 0x24 + ldr r0, =0x02020630 + mov r8, r0 +_0816E75E: + movs r3, 0x20 + ldrsh r1, [r4, r3] + adds r0, r7, 0x2 + adds r0, r6, r0 + movs r3, 0 + ldrsh r2, [r0, r3] + lsls r3, r5, 24 + lsrs r3, 24 + ldr r0, =gUnknown_085E4D14 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r8 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r3] + ldrh r0, [r4] + strh r0, [r2, 0x3A] + movs r0, 0x40 + strh r0, [r2, 0x3C] + adds r4, 0x6 + adds r6, 0x6 + adds r5, 0x1 + cmp r5, 0x5 + ble _0816E75E + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816E74C + + thumb_func_start sub_816E7B4 +sub_816E7B4: @ 816E7B4 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0816E7C6 + cmp r0, 0x1 + beq _0816E84C + b _0816E882 +_0816E7C6: + ldrh r1, [r4, 0x3A] + movs r2, 0x3A + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0816E80A + ldrh r0, [r4, 0x30] + adds r0, 0xB + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x4 + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + adds r0, 0x30 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 24 + negs r0, r0 + strh r0, [r4, 0x26] + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0816E82A + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + b _0816E82A +_0816E80A: + subs r0, r1, 0x1 + strh r0, [r4, 0x3A] + lsls r0, 16 + cmp r0, 0 + bne _0816E82A + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnim + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_0816E82A: + ldr r2, =0x03005e00 + movs r0, 0x38 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0xB + ble _0816E882 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0816E882 + .pool +_0816E84C: + ldrh r1, [r4, 0x20] + movs r2, 0x20 + ldrsh r0, [r4, r2] + cmp r0, 0x77 + bgt _0816E85A + subs r0, r1, 0x3 + b _0816E85C +_0816E85A: + adds r0, r1, 0x3 +_0816E85C: + strh r0, [r4, 0x20] + ldrh r1, [r4, 0x22] + movs r2, 0x22 + ldrsh r0, [r4, r2] + cmp r0, 0x4F + bgt _0816E86C + subs r0, r1, 0x3 + b _0816E86E +_0816E86C: + adds r0, r1, 0x3 +_0816E86E: + strh r0, [r4, 0x22] + ldrh r0, [r4, 0x22] + subs r0, 0x14 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8C + bls _0816E882 + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0816E882: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816E7B4 + + thumb_func_start task_intro_21 +task_intro_21: @ 816E888 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x50 + movs r1, 0x87 + bl SetGpuReg + ldr r1, =0x00001f1f + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0x1F + bl SetGpuReg + movs r1, 0xB0 + lsls r1, 7 + movs r0, 0x8 + bl SetGpuReg + ldr r1, =0x00005a04 + movs r0, 0xA + bl SetGpuReg + ldr r1, =0x00001c06 + movs r0, 0xC + bl SetGpuReg + movs r1, 0xDD + lsls r1, 6 + movs r0, 0 + bl SetGpuReg + movs r0, 0x10 + movs r1, 0x50 + bl SetGpuReg + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + ldr r1, =0x0000ffb0 + movs r0, 0x14 + bl SetGpuReg + movs r0, 0x16 + movs r1, 0 + bl SetGpuReg + movs r0, 0x18 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg + ldr r4, =gUnknown_08D8AA54 + movs r1, 0xC0 + lsls r1, 19 + adds r0, r4, 0 + bl LZDecompressVram + ldr r1, =0x06004000 + adds r0, r4, 0 + bl LZDecompressVram + ldr r0, =gUnknown_08D8B6E8 + ldr r1, =0x0600e000 + bl LZDecompressVram + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =task_intro_22 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_21 + + thumb_func_start task_intro_22 +task_intro_22: @ 816E954 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_08D8B180 + ldr r1, =0x0600c000 + bl LZDecompressVram + ldr r0, =gUnknown_08D8B440 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =task_intro_23 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_22 + + thumb_func_start task_intro_23 +task_intro_23: @ 816E998 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =task_intro_24 + str r1, [r0] + movs r1, 0 + strh r1, [r0, 0x8] + movs r1, 0x10 + strh r1, [r0, 0x14] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_23 + + thumb_func_start task_intro_24 +task_intro_24: @ 816E9DC + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r5, r1, 3 + ldr r6, =0x03005e08 + adds r4, r5, r6 + ldrh r1, [r4, 0xC] + lsls r1, 16 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x10 + bl SetGpuReg + ldrh r1, [r4, 0xC] + lsls r1, 16 + asrs r1, 24 + negs r1, r1 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x14 + bl SetGpuReg + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0816EA24 + cmp r0, 0x1 + beq _0816EA58 + b _0816EAA6 + .pool +_0816EA24: + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _0816EAA6 + movs r0, 0x2 + negs r0, r0 + ldr r1, =0x0000ffff + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r2, 0xA0 + lsls r2, 7 + adds r0, r2, 0 + strh r0, [r4, 0xC] + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _0816EAA6 + .pool +_0816EA58: + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r0, 0xA0 + lsls r0, 6 + cmp r1, r0 + bne _0816EA74 + ldr r0, =0x0000fffe + ldr r1, =0x00002949 + str r1, [sp] + movs r1, 0x3 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe +_0816EA74: + ldrh r1, [r4, 0xC] + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0816EA90 + adds r0, r1, 0 + subs r0, 0x80 + strh r0, [r4, 0xC] + b _0816EAA6 + .pool +_0816EA90: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0816EAA6 + adds r0, r6, 0 + subs r0, 0x8 + adds r0, r5, r0 + ldr r1, =task_intro_25 + str r1, [r0] +_0816EAA6: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_24 + + thumb_func_start task_intro_25 +task_intro_25: @ 816EAB8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_08D8C16C + ldr r1, =0x0600e000 + bl LZDecompressVram + ldr r0, =gUnknown_08D8CCC8 + ldr r1, =0x0600c000 + bl LZDecompressVram + ldr r0, =gUnknown_08D8BA74 + ldr r1, =0x06004000 + bl LZDecompressVram + ldr r0, =gUnknown_08D8C838 + movs r1, 0xC0 + lsls r1, 19 + bl LZDecompressVram + movs r1, 0xD5 + lsls r1, 6 + movs r0, 0 + bl SetGpuReg + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =task_intro_26 + str r1, [r0] + movs r2, 0 + strh r2, [r0, 0x8] + movs r1, 0x1 + strh r1, [r0, 0x14] + strh r2, [r0, 0x16] + ldr r0, =gUnknown_085E4BF4 + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_085E4C04 + bl LoadTaggedObjectPalettes + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_25 + + thumb_func_start task_intro_26 +task_intro_26: @ 816EB44 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r2, =0x03005e08 + adds r6, r1, r2 + movs r3, 0 + ldrsh r0, [r6, r3] + cmp r0, 0x1 + beq _0816EBE0 + cmp r0, 0x1 + bgt _0816EB6C + cmp r0, 0 + beq _0816EB72 + b _0816EC62 + .pool +_0816EB6C: + cmp r0, 0x2 + beq _0816EC4C + b _0816EC62 +_0816EB72: + ldrh r0, [r6, 0xC] + subs r0, 0x1 + strh r0, [r6, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _0816EC62 + ldr r4, =gUnknown_085E4C4C + adds r0, r4, 0 + movs r1, 0xC8 + movs r2, 0x30 + movs r3, 0 + bl AddObjectToFront + adds r0, r4, 0 + movs r1, 0xC8 + movs r2, 0x50 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =0x02020630 + adds r0, r5 + movs r1, 0x1 + bl StartObjectImageAnim + adds r0, r4, 0 + movs r1, 0xC8 + movs r2, 0x70 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x2 + bl StartObjectImageAnim + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] + movs r0, 0x48 + strh r0, [r6, 0xC] + b _0816EC62 + .pool +_0816EBE0: + ldrh r0, [r6, 0xC] + subs r0, 0x1 + strh r0, [r6, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _0816EC62 + ldr r4, =gUnknown_085E4C4C + adds r0, r4, 0 + movs r1, 0x28 + movs r2, 0x30 + movs r3, 0 + bl AddObjectToFront + adds r0, r4, 0 + movs r1, 0x28 + movs r2, 0x50 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =0x02020630 + adds r0, r5 + movs r1, 0x1 + bl StartObjectImageAnim + adds r0, r4, 0 + movs r1, 0x28 + movs r2, 0x70 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x2 + bl StartObjectImageAnim + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] + movs r0, 0x30 + strh r0, [r6, 0xC] + b _0816EC62 + .pool +_0816EC4C: + ldrh r0, [r6, 0xC] + subs r0, 0x1 + strh r0, [r6, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _0816EC62 + adds r0, r2, 0 + subs r0, 0x8 + adds r0, r1, r0 + ldr r1, =task_intro_27 + str r1, [r0] +_0816EC62: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_26 + + thumb_func_start sub_816EC6C +sub_816EC6C: @ 816EC6C + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0816EC88 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_0816EC88: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0816ECAC + cmp r0, 0x1 + bgt _0816EC9A + cmp r0, 0 + beq _0816ECA0 + b _0816ED12 +_0816EC9A: + cmp r0, 0x2 + beq _0816ECDC + b _0816ED12 +_0816ECA0: + movs r0, 0xE1 + lsls r0, 1 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_0816ECAC: + movs r1, 0x30 + ldrsh r0, [r4, r1] + ldr r1, =gUnknown_08D85CD0 + adds r0, r1 + ldr r1, =0x02037bce + movs r2, 0x1 + bl CpuSet + ldrh r0, [r4, 0x30] + adds r0, 0x2 + strh r0, [r4, 0x30] + lsls r0, 16 + movs r1, 0xE7 + lsls r1, 17 + cmp r0, r1 + bne _0816ED12 + movs r0, 0xE6 + lsls r0, 1 + strh r0, [r4, 0x30] + movs r0, 0x4 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_0816ECDC: + ldrh r0, [r4, 0x32] + subs r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + cmp r0, 0 + bne _0816ED12 + movs r0, 0x4 + strh r0, [r4, 0x32] + movs r1, 0x30 + ldrsh r0, [r4, r1] + ldr r1, =gUnknown_08D85CD0 + adds r0, r1 + ldr r1, =0x02037bce + movs r2, 0x1 + bl CpuSet + ldrh r0, [r4, 0x30] + subs r0, 0x2 + strh r0, [r4, 0x30] + lsls r0, 16 + movs r1, 0xE0 + lsls r1, 17 + cmp r0, r1 + bne _0816ED12 + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0816ED12: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816EC6C + + thumb_func_start task_intro_27 +task_intro_27: @ 816ED20 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_085E5048 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085E5058 + bl LoadTaggedObjectPalettes + movs r1, 0xD5 + lsls r1, 6 + movs r0, 0 + bl SetGpuReg + ldr r6, =0x03005e00 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r6 + ldr r0, =task_intro_28 + str r0, [r4] + ldr r0, =0x0000ffde + ldr r1, =0x00002949 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r0, 0 + strh r0, [r4, 0x8] + movs r0, 0xA8 + strh r0, [r4, 0xA] + ldr r1, =0x0000fff0 + strh r1, [r4, 0xC] + ldr r0, =0x0000ff78 + strh r0, [r4, 0xE] + strh r1, [r4, 0x10] + ldr r0, =sub_816EEA8 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r6 + strh r5, [r1, 0x10] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_27 + + thumb_func_start task_intro_28 +task_intro_28: @ 816EDB4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r4, r1, 3 + ldr r5, =0x03005e08 + adds r2, r4, r5 + ldrh r0, [r2, 0xE] + movs r3, 0x1 + ands r0, r3 + cmp r0, 0 + bne _0816EDD6 + ldrh r0, [r2, 0xC] + movs r1, 0x2 + eors r0, r1 + strh r0, [r2, 0xC] +_0816EDD6: + ldrh r0, [r2, 0xE] + adds r0, 0x1 + strh r0, [r2, 0xE] + movs r6, 0 + ldrsh r1, [r2, r6] + cmp r1, 0x1 + beq _0816EE2E + cmp r1, 0x1 + bgt _0816EDF4 + cmp r1, 0 + beq _0816EDFE + b _0816EE86 + .pool +_0816EDF4: + cmp r1, 0x2 + beq _0816EE3A + cmp r1, 0x3 + beq _0816EE70 + b _0816EE86 +_0816EDFE: + ands r0, r3 + cmp r0, 0 + beq _0816EE1C + ldrh r0, [r2, 0x2] + subs r0, 0x2 + strh r0, [r2, 0x2] + ldrh r0, [r2, 0x4] + adds r0, 0x1 + strh r0, [r2, 0x4] + ldrh r0, [r2, 0x6] + adds r0, 0x2 + strh r0, [r2, 0x6] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] +_0816EE1C: + movs r1, 0x2 + ldrsh r0, [r2, r1] + cmp r0, 0x68 + bne _0816EE86 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + strh r3, [r2, 0xA] + b _0816EE86 +_0816EE2E: + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + movs r0, 0x4 + strh r0, [r2, 0xA] + b _0816EE86 +_0816EE3A: + ldrh r0, [r2, 0x2] + adds r0, 0x4 + strh r0, [r2, 0x2] + ldrh r0, [r2, 0x4] + subs r0, 0x2 + strh r0, [r2, 0x4] + ldrh r0, [r2, 0x6] + subs r0, 0x4 + strh r0, [r2, 0x6] + ldrh r0, [r2, 0x8] + subs r0, 0x2 + strh r0, [r2, 0x8] + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0816EE86 + movs r0, 0x8C + strh r0, [r2, 0xA] + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + b _0816EE86 + .pool +_0816EE70: + ldrh r0, [r2, 0xA] + subs r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + cmp r0, 0 + bne _0816EE86 + adds r0, r5, 0 + subs r0, 0x8 + adds r0, r4, r0 + ldr r1, =task_intro_29 + str r1, [r0] +_0816EE86: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_28 + + thumb_func_start task_intro_29 +task_intro_29: @ 816EE90 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + ldr r0, =sub_816CC54 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end task_intro_29 + + thumb_func_start sub_816EEA8 +sub_816EEA8: @ 816EEA8 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + ldrh r0, [r5, 0x4] + adds r0, 0x1 + strh r0, [r5, 0x4] + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x5 + bls _0816EECA + b _0816F0B2 +_0816EECA: + lsls r0, 2 + ldr r1, =_0816EEDC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0816EEDC: + .4byte _0816EEF4 + .4byte _0816EF34 + .4byte _0816EF80 + .4byte _0816F00A + .4byte _0816F074 + .4byte _0816F0A0 +_0816EEF4: + ldrh r1, [r5, 0x4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0816EF16 + movs r2, 0x2 + ldrsh r0, [r5, r2] + lsls r0, 1 + ldr r1, =gUnknown_08D85E72 + adds r0, r1 + ldr r1, =0x02037bd0 + movs r2, 0x1 + bl CpuSet + ldrh r0, [r5, 0x2] + adds r0, 0x1 + strh r0, [r5, 0x2] +_0816EF16: + movs r1, 0x2 + ldrsh r0, [r5, r1] + cmp r0, 0x6 + beq _0816EF20 + b _0816F0B2 +_0816EF20: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + movs r0, 0 + strh r0, [r5, 0x2] + b _0816EF70 + .pool +_0816EF34: + ldrh r1, [r5, 0x6] + movs r2, 0x6 + ldrsh r0, [r5, r2] + cmp r0, 0 + bne _0816F004 + ldrh r1, [r5, 0x4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0816EF60 + movs r1, 0x2 + ldrsh r0, [r5, r1] + lsls r0, 1 + ldr r1, =gUnknown_08D85E72 + adds r0, r1 + ldr r1, =0x02037bc4 + movs r2, 0x1 + bl CpuSet + ldrh r0, [r5, 0x2] + adds r0, 0x1 + strh r0, [r5, 0x2] +_0816EF60: + movs r2, 0x2 + ldrsh r0, [r5, r2] + cmp r0, 0x6 + beq _0816EF6A + b _0816F0B2 +_0816EF6A: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_0816EF70: + movs r0, 0xA + strh r0, [r5, 0x6] + b _0816F0B2 + .pool +_0816EF80: + ldrh r1, [r5, 0x6] + movs r2, 0x6 + ldrsh r0, [r5, r2] + cmp r0, 0 + bne _0816F004 + ldrh r1, [r5, 0x4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0816EFAC + movs r1, 0x2 + ldrsh r0, [r5, r1] + lsls r0, 1 + ldr r1, =gUnknown_08D85E52 + adds r0, r1 + ldr r1, =0x02037bcc + movs r2, 0x1 + bl CpuSet + ldrh r0, [r5, 0x2] + adds r0, 0x1 + strh r0, [r5, 0x2] +_0816EFAC: + movs r2, 0x2 + ldrsh r0, [r5, r2] + cmp r0, 0x6 + beq _0816EFB6 + b _0816F0B2 +_0816EFB6: + ldr r0, =gUnknown_085E5030 + movs r1, 0x78 + movs r2, 0x58 + movs r3, 0xF + bl AddObjectToFront + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x67 + bl audio_play + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r3] + ldrh r1, [r5, 0x8] + strh r1, [r0, 0x34] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + movs r0, 0x10 + strh r0, [r5, 0x6] + b _0816F0B2 + .pool +_0816F004: + subs r0, r1, 0x1 + strh r0, [r5, 0x6] + b _0816F0B2 +_0816F00A: + ldrh r1, [r5, 0x4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0816F0B2 + ldrh r0, [r5, 0x6] + subs r0, 0x1 + adds r2, r0, 0 + strh r0, [r5, 0x6] + lsls r0, 16 + cmp r0, 0 + beq _0816F068 + lsls r2, 24 + lsrs r2, 24 + ldr r3, =0x00002949 + movs r0, 0x50 + movs r1, 0x10 + bl pal_fade_1 + ldr r4, =gUnknown_08D85E7C + ldr r5, =0x02037bd0 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl CpuSet + adds r1, r5, 0 + subs r1, 0xC + adds r0, r4, 0 + movs r2, 0x1 + bl CpuSet + subs r4, 0x20 + subs r5, 0x4 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl CpuSet + b _0816F0B2 + .pool +_0816F068: + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + movs r0, 0x35 + strh r0, [r5, 0x6] + b _0816F0B2 +_0816F074: + ldrh r0, [r5, 0x6] + subs r0, 0x1 + strh r0, [r5, 0x6] + lsls r0, 16 + cmp r0, 0 + bne _0816F0B2 + movs r0, 0x1 + negs r0, r0 + ldr r1, =0x00007fff + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + b _0816F0B2 + .pool +_0816F0A0: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0816F0B2 + adds r0, r2, 0 + bl DestroyTask +_0816F0B2: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816EEA8 + + thumb_func_start intro_reset_and_hide_bgs +@ void intro_reset_and_hide_bgs() +intro_reset_and_hide_bgs: @ 816F0C0 + push {lr} + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1C + movs r1, 0 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0 + bl SetGpuReg + movs r0, 0x18 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + movs r0, 0x16 + movs r1, 0 + bl SetGpuReg + movs r0, 0x10 + movs r1, 0 + bl SetGpuReg + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + pop {r0} + bx r0 + thumb_func_end intro_reset_and_hide_bgs + + thumb_func_start task_intro_3_1 +task_intro_3_1: @ 816F128 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0816F170 + cmp r0, 0x1 + ble _0816F148 + cmp r0, 0x2 + beq _0816F1BC +_0816F148: + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + ldr r0, =gUnknown_0853FF70 + ldrh r1, [r0, 0x3E] + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + movs r0, 0x40 + b _0816F1AC + .pool +_0816F170: + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0816F1A0 + subs r0, r1, 0x1 + strh r0, [r4, 0xA] + movs r1, 0xA + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + movs r1, 0xFF + lsls r1, 1 + ldr r2, =gUnknown_0853FF70 + ands r0, r1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x52 + bl SetGpuReg + b _0816F1DA + .pool +_0816F1A0: + ldr r0, =gUnknown_0853FF70 + ldrh r1, [r0] + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x10 +_0816F1AC: + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0816F1DA + .pool +_0816F1BC: + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + adds r0, r5, 0 + bl DestroyTask +_0816F1DA: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task_intro_3_1 + + thumb_func_start task_intro_3_2 +task_intro_3_2: @ 816F1E0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0816F228 + cmp r0, 0x1 + ble _0816F200 + cmp r0, 0x2 + beq _0816F274 +_0816F200: + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + ldr r0, =gUnknown_0853FF70 + ldrh r1, [r0] + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + movs r0, 0 + b _0816F264 + .pool +_0816F228: + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0x3D + bgt _0816F258 + adds r0, r1, 0x1 + strh r0, [r4, 0xA] + movs r1, 0xA + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + movs r1, 0xFF + lsls r1, 1 + ldr r2, =gUnknown_0853FF70 + ands r0, r1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x52 + bl SetGpuReg + b _0816F2A2 + .pool +_0816F258: + ldr r0, =gUnknown_0853FF70 + ldrh r1, [r0, 0x3E] + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x10 +_0816F264: + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0816F2A2 + .pool +_0816F274: + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0816F284 + subs r0, r1, 0x1 + strh r0, [r4, 0xA] + b _0816F2A2 +_0816F284: + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + adds r0, r5, 0 + bl DestroyTask +_0816F2A2: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task_intro_3_2 + + thumb_func_start sub_816F2A8 +sub_816F2A8: @ 816F2A8 + push {r4,lr} + sub sp, 0x24 + lsls r2, 16 + lsrs r2, 16 + movs r4, 0x80 + lsls r4, 8 + str r4, [sp] + str r4, [sp, 0x4] + mov r4, sp + strh r0, [r4, 0x8] + mov r0, sp + strh r1, [r0, 0xA] + strh r2, [r0, 0xC] + strh r2, [r0, 0xE] + strh r3, [r0, 0x10] + add r4, sp, 0x14 + adds r1, r4, 0 + movs r2, 0x1 + bl BgAffineSet + ldrh r1, [r4] + movs r0, 0x20 + bl SetGpuReg + ldrh r1, [r4, 0x2] + movs r0, 0x22 + bl SetGpuReg + ldrh r1, [r4, 0x4] + movs r0, 0x24 + bl SetGpuReg + ldrh r1, [r4, 0x6] + movs r0, 0x26 + bl SetGpuReg + ldrh r1, [r4, 0x8] + movs r0, 0x28 + bl SetGpuReg + ldrh r1, [r4, 0xA] + movs r0, 0x2A + bl SetGpuReg + ldrh r1, [r4, 0xC] + movs r0, 0x2C + bl SetGpuReg + ldrh r1, [r4, 0xE] + movs r0, 0x2E + bl SetGpuReg + add sp, 0x24 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816F2A8 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/item.s b/asm/item.s new file mode 100644 index 000000000..ca4baebd4 --- /dev/null +++ b/asm/item.s @@ -0,0 +1,2299 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start decrypt_bag_item_quantity +decrypt_bag_item_quantity: @ 80D6554 + adds r1, r0, 0 + ldr r0, =0x03005d90 + ldr r0, [r0] + adds r0, 0xAC + ldr r0, [r0] + ldrh r1, [r1] + eors r0, r1 + lsls r0, 16 + lsrs r0, 16 + bx lr + .pool + thumb_func_end decrypt_bag_item_quantity + + thumb_func_start encrypt_bag_item_quantity +encrypt_bag_item_quantity: @ 80D656C + lsls r1, 16 + lsrs r1, 16 + ldr r2, =0x03005d90 + ldr r2, [r2] + adds r2, 0xAC + ldr r2, [r2] + eors r1, r2 + strh r1, [r0] + bx lr + .pool + thumb_func_end encrypt_bag_item_quantity + + thumb_func_start sub_80D6584 +sub_80D6584: @ 80D6584 + ldrh r0, [r0] + bx lr + thumb_func_end sub_80D6584 + + thumb_func_start sub_80D6588 +sub_80D6588: @ 80D6588 + strh r1, [r0] + bx lr + thumb_func_end sub_80D6588 + + thumb_func_start encrypt_decrypt_all_item_quantities +encrypt_decrypt_all_item_quantities: @ 80D658C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + mov r8, r0 + movs r1, 0 + ldr r0, =0x02039dd8 + mov r9, r0 +_080D659E: + movs r6, 0 + lsls r5, r1, 3 + mov r2, r9 + adds r0, r5, r2 + adds r7, r1, 0x1 + ldrb r0, [r0, 0x4] + cmp r6, r0 + bcs _080D65CC + ldr r2, =0x02039dd8 +_080D65B0: + adds r4, r5, r2 + lsls r1, r6, 2 + ldr r0, [r4] + adds r0, r1 + adds r0, 0x2 + mov r1, r8 + str r2, [sp] + bl apply_u16_xor_crypto + adds r6, 0x1 + ldr r2, [sp] + ldrb r4, [r4, 0x4] + cmp r6, r4 + bcc _080D65B0 +_080D65CC: + adds r1, r7, 0 + cmp r1, 0x4 + bls _080D659E + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end encrypt_decrypt_all_item_quantities + + thumb_func_start call_encrypt_decrypt_all_item_quantities +call_encrypt_decrypt_all_item_quantities: @ 80D65E4 + push {lr} + bl encrypt_decrypt_all_item_quantities + pop {r0} + bx r0 + thumb_func_end call_encrypt_decrypt_all_item_quantities + + thumb_func_start init_bag_pockets +@ void init_bag_pockets() +init_bag_pockets: @ 80D65F0 + push {r4,lr} + ldr r1, =0x02039dd8 + ldr r0, =0x03005d8c + ldr r2, [r0] + movs r3, 0xAC + lsls r3, 3 + adds r0, r2, r3 + str r0, [r1] + movs r3, 0x1E + strb r3, [r1, 0x4] + movs r4, 0xBB + lsls r4, 3 + adds r0, r2, r4 + str r0, [r1, 0x20] + adds r0, r1, 0 + adds r0, 0x24 + strb r3, [r0] + movs r3, 0xCA + lsls r3, 3 + adds r0, r2, r3 + str r0, [r1, 0x8] + movs r0, 0x10 + strb r0, [r1, 0xC] + adds r4, 0xB8 + adds r0, r2, r4 + str r0, [r1, 0x10] + movs r0, 0x40 + strb r0, [r1, 0x14] + movs r0, 0xF2 + lsls r0, 3 + adds r2, r0 + str r2, [r1, 0x18] + movs r0, 0x2E + strb r0, [r1, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end init_bag_pockets + + thumb_func_start itemid_get_name +@ void itemid_get_name(int item_id, char *dest) +itemid_get_name: @ 80D6644 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 16 + lsrs r0, 16 + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + pop {r4} + pop {r0} + bx r0 + thumb_func_end itemid_get_name + + thumb_func_start sub_80D6660 +sub_80D6660: @ 80D6660 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 16 + lsrs r3, r0, 16 + adds r1, r3, 0 + cmp r3, 0x4 + bne _080D668C + cmp r2, 0x1 + bhi _080D667C + movs r0, 0x4 + bl itemid_get_item + adds r1, r0, 0 + b _080D667E +_080D667C: + ldr r1, =gUnknown_085EFCD4 +_080D667E: + adds r0, r4, 0 + bl CopyString + b _080D66BE + .pool +_080D668C: + adds r0, r3, 0 + subs r0, 0x85 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2A + bhi _080D66B0 + lsls r1, r3, 3 + subs r1, r3 + lsls r1, 2 + ldr r0, =gUnknown_085897E4 + adds r1, r0 + adds r0, r4, 0 + bl GetBerryCountString + b _080D66BE + .pool +_080D66B0: + adds r0, r1, 0 + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString +_080D66BE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80D6660 + + thumb_func_start GetBerryCountString +@ void GetBerryCountString(struct berry_info *berryInfo, u8 *dest, u32 berryCount) +GetBerryCountString: @ 80D66C4 + push {r4,lr} + ldr r4, =gUnknown_085EFCE5 + cmp r2, 0x1 + bhi _080D66CE + ldr r4, =gUnknown_085EFCDF +_080D66CE: + bl CopyString + movs r1, 0 + strb r1, [r0] + adds r0, 0x1 + adds r1, r4, 0 + bl CopyString + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end GetBerryCountString + + thumb_func_start IsBagPocketNonEmpty +@ bool8 IsBagPocketNonEmpty(u8 pocketId) +IsBagPocketNonEmpty: @ 80D66EC + push {lr} + lsls r0, 24 + movs r2, 0 + ldr r1, =0x02039dd8 + lsrs r0, 21 + subs r0, 0x8 + adds r0, r1 + ldrb r1, [r0, 0x4] + cmp r2, r1 + bcs _080D671E + ldr r3, [r0] +_080D6702: + lsls r0, r2, 2 + adds r0, r3 + ldrh r0, [r0] + cmp r0, 0 + beq _080D6714 + movs r0, 0x1 + b _080D6720 + .pool +_080D6714: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r1 + bcc _080D6702 +_080D671E: + movs r0, 0 +_080D6720: + pop {r1} + bx r1 + thumb_func_end IsBagPocketNonEmpty + + thumb_func_start sub_80D6724 +sub_80D6724: @ 80D6724 + push {r4-r7,lr} + lsls r0, 16 + lsrs r7, r0, 16 + lsls r1, 16 + lsrs r5, r1, 16 + adds r0, r7, 0 + bl itemid_get_pocket_number + lsls r0, 24 + cmp r0, 0 + beq _080D67B6 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _080D6752 + ldr r0, =0x00004004 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D6768 +_080D6752: + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80D710C + lsls r0, 24 + lsrs r0, 24 + b _080D67B8 + .pool +_080D6764: + movs r0, 0x1 + b _080D67B8 +_080D6768: + adds r0, r7, 0 + bl itemid_get_pocket_number + subs r0, 0x1 + lsls r0, 24 + movs r6, 0 + ldr r1, =0x02039dd8 + lsrs r4, r0, 21 + b _080D67AE + .pool +_080D6780: + adds r0, r4, r1 + ldr r1, [r0] + lsls r0, r6, 2 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, r7 + bne _080D67A6 + adds r0, r1, 0x2 + bl decrypt_bag_item_quantity + lsls r0, 16 + lsrs r0, 16 + cmp r0, r5 + bcs _080D6764 + subs r0, r5, r0 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + beq _080D6764 +_080D67A6: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x02039dd8 +_080D67AE: + adds r0, r4, r1 + ldrb r0, [r0, 0x4] + cmp r6, r0 + bcc _080D6780 +_080D67B6: + movs r0, 0 +_080D67B8: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D6724 + + thumb_func_start sub_80D67C4 +sub_80D67C4: @ 80D67C4 + push {r4,lr} + movs r4, 0x85 +_080D67C8: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80D6724 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + bne _080D67E4 + ldr r0, =0x020375f0 + strh r1, [r0] + movs r0, 0x1 + b _080D67F6 + .pool +_080D67E4: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0xB2 + bls _080D67C8 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + movs r0, 0 +_080D67F6: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D67C4 + + thumb_func_start sub_80D6800 +sub_80D6800: @ 80D6800 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 16 + lsrs r5, r1, 16 + bl itemid_get_pocket_number + lsls r0, 24 + cmp r0, 0 + beq _080D6906 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _080D6838 + ldr r0, =0x00004004 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D684C +_080D6838: + mov r0, r8 + adds r1, r5, 0 + bl sub_80D7184 + lsls r0, 24 + lsrs r0, 24 + b _080D6916 + .pool +_080D684C: + mov r0, r8 + bl itemid_get_pocket_number + subs r0, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r7, =0x000003e7 + cmp r2, 0x3 + beq _080D6860 + movs r7, 0x63 +_080D6860: + movs r6, 0 + ldr r1, =0x02039dd8 + lsls r4, r2, 3 + adds r0, r4, r1 + mov r9, r4 + ldrb r0, [r0, 0x4] + cmp r6, r0 + bcs _080D68BC + subs r0, r2, 0x2 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 +_080D6878: + adds r0, r4, r1 + ldr r1, [r0] + lsls r0, r6, 2 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, r8 + bne _080D68AC + adds r0, r1, 0x2 + str r2, [sp] + bl decrypt_bag_item_quantity + lsls r0, 16 + lsrs r1, r0, 16 + adds r0, r1, r5 + ldr r2, [sp] + cmp r0, r7 + ble _080D6914 + mov r0, r10 + cmp r0, 0x1 + bls _080D6906 + subs r0, r7, r1 + subs r0, r5, r0 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + beq _080D6914 +_080D68AC: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x02039dd8 + adds r0, r4, r1 + ldrb r0, [r0, 0x4] + cmp r6, r0 + bcc _080D6878 +_080D68BC: + cmp r5, 0 + beq _080D6914 + movs r6, 0 + ldr r3, =0x02039dd8 + mov r1, r9 + adds r0, r1, r3 + ldrb r0, [r0, 0x4] + cmp r6, r0 + bcs _080D6902 + adds r4, r3, 0 + subs r0, r2, 0x2 + lsls r0, 24 + lsrs r2, r0, 24 +_080D68D6: + adds r0, r1, r4 + ldr r1, [r0] + lsls r0, r6, 2 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _080D68F2 + cmp r5, r7 + bls _080D6914 + cmp r2, 0x1 + bls _080D6906 + subs r0, r5, r7 + lsls r0, 16 + lsrs r5, r0, 16 +_080D68F2: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + mov r1, r9 + adds r0, r1, r3 + ldrb r0, [r0, 0x4] + cmp r6, r0 + bcc _080D68D6 +_080D6902: + cmp r5, 0 + beq _080D6914 +_080D6906: + movs r0, 0 + b _080D6916 + .pool +_080D6914: + movs r0, 0x1 +_080D6916: + 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_80D6800 + + thumb_func_start bag_add_item +@ int bag_add_item(int item_id, int quantity) +bag_add_item: @ 80D6928 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + lsls r1, 16 + lsrs r5, r1, 16 + bl itemid_get_pocket_number + lsls r0, 24 + cmp r0, 0 + bne _080D694C + movs r0, 0 + b _080D6A92 +_080D694C: + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _080D6964 + ldr r0, =0x00004004 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D6978 +_080D6964: + mov r0, r9 + adds r1, r5, 0 + bl sub_80D7204 + lsls r0, 24 + lsrs r0, 24 + b _080D6A92 + .pool +_080D6978: + mov r0, r9 + bl itemid_get_pocket_number + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r1, r0, 3 + ldr r0, =0x02039dd8 + adds r7, r1, r0 + ldrb r0, [r7, 0x4] + lsls r0, 2 + bl AllocZeroed + mov r8, r0 + ldr r1, [r7] + ldrb r2, [r7, 0x4] + lsls r2, 2 + bl memcpy + ldr r2, =0x000003e7 + mov r0, r10 + cmp r0, 0x3 + beq _080D69AA + movs r2, 0x63 +_080D69AA: + movs r6, 0 + ldrb r0, [r7, 0x4] + cmp r6, r0 + bcs _080D6A06 + mov r0, r10 + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] +_080D69BC: + lsls r0, r6, 2 + mov r3, r8 + adds r1, r0, r3 + ldrh r0, [r1] + cmp r0, r9 + bne _080D69FA + adds r4, r1, 0x2 + adds r0, r4, 0 + str r2, [sp, 0x4] + bl decrypt_bag_item_quantity + lsls r0, 16 + lsrs r0, 16 + adds r1, r0, r5 + ldr r2, [sp, 0x4] + cmp r1, r2 + ble _080D6A68 + ldr r1, [sp] + cmp r1, 0x1 + bls _080D6A74 + subs r0, r2, r0 + subs r0, r5, r0 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + adds r1, r2, 0 + bl encrypt_bag_item_quantity + ldr r2, [sp, 0x4] + cmp r5, 0 + beq _080D6A7E +_080D69FA: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r0, [r7, 0x4] + cmp r6, r0 + bcc _080D69BC +_080D6A06: + cmp r5, 0 + beq _080D6A7E + movs r6, 0 + cmp r6, r0 + bcs _080D6A62 + mov r0, r10 + subs r0, 0x2 + lsls r0, 24 + lsrs r4, r0, 24 +_080D6A18: + lsls r0, r6, 2 + mov r3, r8 + adds r1, r0, r3 + ldrh r0, [r1] + cmp r0, 0 + bne _080D6A56 + mov r0, r9 + strh r0, [r1] + cmp r5, r2 + bhi _080D6A40 + adds r0, r1, 0x2 + adds r1, r5, 0 + bl encrypt_bag_item_quantity + b _080D6A7E + .pool +_080D6A40: + cmp r4, 0x1 + bls _080D6A74 + subs r0, r5, r2 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r1, 0x2 + adds r1, r2, 0 + str r2, [sp, 0x4] + bl encrypt_bag_item_quantity + ldr r2, [sp, 0x4] +_080D6A56: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r1, [r7, 0x4] + cmp r6, r1 + bcc _080D6A18 +_080D6A62: + cmp r5, 0 + beq _080D6A7E + b _080D6A74 +_080D6A68: + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl encrypt_bag_item_quantity + b _080D6A7E +_080D6A74: + mov r0, r8 + bl Free + movs r0, 0 + b _080D6A92 +_080D6A7E: + ldr r0, [r7] + ldrb r2, [r7, 0x4] + lsls r2, 2 + mov r1, r8 + bl memcpy + mov r0, r8 + bl Free + movs r0, 0x1 +_080D6A92: + 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 bag_add_item + + thumb_func_start remove_item +@ pokescrcmd +remove_item: @ 80D6AA4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 16 + lsrs r7, r1, 16 + movs r4, 0 + bl itemid_get_pocket_number + lsls r0, 24 + cmp r0, 0 + beq _080D6B38 + mov r0, r8 + cmp r0, 0 + beq _080D6B38 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _080D6AE0 + ldr r0, =0x00004004 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D6AF4 +_080D6AE0: + mov r0, r8 + adds r1, r7, 0 + bl sub_80D7334 + lsls r0, 24 + lsrs r0, 24 + b _080D6C5A + .pool +_080D6AF4: + mov r0, r8 + bl itemid_get_pocket_number + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, r0, 3 + ldr r0, =0x02039dd8 + adds r5, r1, r0 + movs r6, 0 + ldrb r2, [r5, 0x4] + cmp r6, r2 + bcs _080D6B34 +_080D6B10: + ldr r0, [r5] + lsls r1, r6, 2 + adds r1, r0 + ldrh r0, [r1] + cmp r0, r8 + bne _080D6B28 + adds r0, r1, 0x2 + bl decrypt_bag_item_quantity + adds r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 +_080D6B28: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r0, [r5, 0x4] + cmp r6, r0 + bcc _080D6B10 +_080D6B34: + cmp r4, r7 + bcs _080D6B40 +_080D6B38: + movs r0, 0 + b _080D6C5A + .pool +_080D6B40: + bl CurrentMapIsSecretBase + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D6B70 + ldr r4, =0x000040ee + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 2 + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet + ldr r0, =0x000040ed + mov r1, r8 + bl VarSet +_080D6B70: + mov r0, r9 + bl sub_81ABB2C + lsls r0, 24 + lsrs r1, r0, 24 + ldrb r0, [r5, 0x4] + cmp r0, r1 + bls _080D6BE6 + ldr r0, [r5] + lsls r1, 2 + adds r2, r1, r0 + ldrh r0, [r2] + adds r4, r1, 0 + cmp r0, r8 + bne _080D6BE6 + adds r0, r2, 0x2 + bl decrypt_bag_item_quantity + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r7 + bcc _080D6BB8 + ldr r0, [r5] + adds r0, r4 + adds r0, 0x2 + subs r1, r7 + lsls r1, 16 + lsrs r1, 16 + bl encrypt_bag_item_quantity + movs r7, 0 + b _080D6BCA + .pool +_080D6BB8: + subs r0, r7, r1 + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, [r5] + adds r0, r4 + adds r0, 0x2 + movs r1, 0 + bl encrypt_bag_item_quantity +_080D6BCA: + ldr r0, [r5] + adds r0, r4 + adds r0, 0x2 + bl decrypt_bag_item_quantity + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + bne _080D6BE2 + ldr r0, [r5] + adds r0, r4, r0 + strh r2, [r0] +_080D6BE2: + cmp r7, 0 + beq _080D6C58 +_080D6BE6: + movs r6, 0 + ldrb r0, [r5, 0x4] + cmp r6, r0 + bcs _080D6C58 +_080D6BEE: + ldr r0, [r5] + lsls r1, r6, 2 + adds r2, r1, r0 + ldrh r0, [r2] + adds r4, r1, 0 + cmp r0, r8 + bne _080D6C4C + adds r0, r2, 0x2 + bl decrypt_bag_item_quantity + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r7 + bcc _080D6C1E + ldr r0, [r5] + adds r0, r4 + adds r0, 0x2 + subs r1, r7 + lsls r1, 16 + lsrs r1, 16 + bl encrypt_bag_item_quantity + movs r7, 0 + b _080D6C30 +_080D6C1E: + subs r0, r7, r1 + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, [r5] + adds r0, r4 + adds r0, 0x2 + movs r1, 0 + bl encrypt_bag_item_quantity +_080D6C30: + ldr r0, [r5] + adds r0, r4 + adds r0, 0x2 + bl decrypt_bag_item_quantity + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + bne _080D6C48 + ldr r0, [r5] + adds r0, r4, r0 + strh r2, [r0] +_080D6C48: + cmp r7, 0 + beq _080D6C58 +_080D6C4C: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r2, [r5, 0x4] + cmp r6, r2 + bcc _080D6BEE +_080D6C58: + movs r0, 0x1 +_080D6C5A: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end remove_item + + thumb_func_start sub_80D6C68 +sub_80D6C68: @ 80D6C68 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl itemid_get_pocket_number + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80D6C68 + + thumb_func_start sub_80D6C7C +sub_80D6C7C: @ 80D6C7C + push {r4-r7,lr} + adds r6, r0, 0 + lsls r1, 24 + movs r4, 0 + lsrs r1, 24 + cmp r4, r1 + bcs _080D6CA6 + adds r5, r1, 0 + movs r7, 0 +_080D6C8E: + lsls r0, r4, 2 + adds r0, r6 + strh r7, [r0] + adds r0, 0x2 + movs r1, 0 + bl encrypt_bag_item_quantity + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r5 + bcc _080D6C8E +_080D6CA6: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80D6C7C + + thumb_func_start sub_80D6CAC +sub_80D6CAC: @ 80D6CAC + push {lr} + movs r1, 0 + ldr r0, =0x03005d8c + ldr r2, [r0] + movs r3, 0x93 + lsls r3, 3 +_080D6CB8: + lsls r0, r1, 24 + asrs r1, r0, 24 + lsls r0, r1, 2 + adds r0, r2, r0 + adds r0, r3 + ldrh r0, [r0] + cmp r0, 0 + bne _080D6CD0 + adds r0, r1, 0 + b _080D6CE0 + .pool +_080D6CD0: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + asrs r0, 24 + cmp r0, 0x31 + ble _080D6CB8 + movs r0, 0x1 + negs r0, r0 +_080D6CE0: + pop {r1} + bx r1 + thumb_func_end sub_80D6CAC + + thumb_func_start sub_80D6CE4 +sub_80D6CE4: @ 80D6CE4 + push {r4,lr} + movs r2, 0 + movs r1, 0 + ldr r0, =0x03005d8c + ldr r3, [r0] + movs r4, 0x93 + lsls r4, 3 +_080D6CF2: + lsls r0, r1, 2 + adds r0, r3, r0 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0 + beq _080D6D04 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_080D6D04: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x31 + bls _080D6CF2 + adds r0, r2, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D6CE4 + + thumb_func_start sub_80D6D1C +sub_80D6D1C: @ 80D6D1C + push {r4-r6,lr} + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 16 + lsrs r5, r1, 16 + movs r4, 0 +_080D6D28: + ldr r0, =0x03005d8c + ldr r2, [r0] + lsls r1, r4, 2 + adds r0, r2, r1 + movs r3, 0x93 + lsls r3, 3 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r6 + bne _080D6D5C + adds r0, r1, r2 + ldr r1, =0x0000049a + adds r0, r1 + bl sub_80D6584 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r5 + bcc _080D6D5C + movs r0, 0x1 + b _080D6D68 + .pool +_080D6D5C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x31 + bls _080D6D28 + movs r0, 0 +_080D6D68: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80D6D1C + + thumb_func_start sub_80D6D70 +sub_80D6D70: @ 80D6D70 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 16 + lsrs r5, r1, 16 + movs r0, 0xC8 + bl AllocZeroed + adds r7, r0, 0 + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r0, 0x93 + lsls r0, 3 + adds r1, r0 + adds r0, r7, 0 + movs r2, 0xC8 + bl memcpy + movs r6, 0 +_080D6D9C: + lsls r0, r6, 2 + adds r1, r0, r7 + ldrh r0, [r1] + cmp r0, r8 + bne _080D6DD0 + adds r4, r1, 0x2 + adds r0, r4, 0 + bl sub_80D6584 + lsls r0, 16 + lsrs r2, r0, 16 + adds r1, r2, r5 + ldr r3, =0x000003e7 + cmp r1, r3 + ble _080D6E04 + ldr r1, =0x0000fc19 + adds r0, r5, r1 + adds r0, r2, r0 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + adds r1, r3, 0 + bl sub_80D6588 + cmp r5, 0 + beq _080D6E20 +_080D6DD0: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x31 + bls _080D6D9C + cmp r5, 0 + beq _080D6E20 + bl sub_80D6CAC + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080D6E10 + adds r0, r7, 0 + bl Free + movs r0, 0 + b _080D6E3A + .pool +_080D6E04: + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_80D6588 + b _080D6E20 +_080D6E10: + lsls r0, r1, 2 + adds r0, r7 + mov r1, r8 + strh r1, [r0] + adds r0, 0x2 + adds r1, r5, 0 + bl sub_80D6588 +_080D6E20: + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x93 + lsls r1, 3 + adds r0, r1 + adds r1, r7, 0 + movs r2, 0xC8 + bl memcpy + adds r0, r7, 0 + bl Free + movs r0, 0x1 +_080D6E3A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D6D70 + + thumb_func_start sub_80D6E48 +sub_80D6E48: @ 80D6E48 + push {lr} + lsls r0, 24 + lsls r1, 16 + lsrs r1, 16 + ldr r2, =0x03005d8c + ldr r2, [r2] + lsrs r0, 22 + adds r3, r2, r0 + ldr r0, =0x0000049a + adds r2, r3, r0 + ldrh r0, [r2] + subs r0, r1 + strh r0, [r2] + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _080D6E76 + movs r2, 0x93 + lsls r2, 3 + adds r0, r3, r2 + strh r1, [r0] + bl sub_80D6E84 +_080D6E76: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D6E48 + + thumb_func_start sub_80D6E84 +sub_80D6E84: @ 80D6E84 + push {r4-r7,lr} + movs r2, 0 +_080D6E88: + adds r1, r2, 0x1 + lsls r0, r1, 16 + lsrs r4, r0, 16 + adds r6, r1, 0 + cmp r4, 0x31 + bhi _080D6ECA + ldr r0, =0x03005d8c + mov r12, r0 + lsls r5, r2, 2 + movs r7, 0x93 + lsls r7, 3 +_080D6E9E: + mov r0, r12 + ldr r1, [r0] + adds r0, r1, r5 + adds r0, r7 + ldrh r0, [r0] + cmp r0, 0 + bne _080D6EC0 + movs r0, 0x93 + lsls r0, 3 + adds r1, r0 + adds r2, r1, r5 + ldr r3, [r2] + lsls r0, r4, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2] + str r3, [r1] +_080D6EC0: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x31 + bls _080D6E9E +_080D6ECA: + lsls r0, r6, 16 + lsrs r2, r0, 16 + cmp r2, 0x30 + bls _080D6E88 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D6E84 + + thumb_func_start sub_80D6EDC +sub_80D6EDC: @ 80D6EDC + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00000496 + adds r1, r0, r2 + ldrh r2, [r1] + ldr r3, =0x00000103 + cmp r2, r3 + beq _080D6F04 + movs r0, 0x88 + lsls r0, 1 + cmp r2, r0 + beq _080D6F0C + b _080D6F0E + .pool +_080D6F04: + movs r0, 0x88 + lsls r0, 1 + strh r0, [r1] + b _080D6F0E +_080D6F0C: + strh r3, [r1] +_080D6F0E: + pop {r0} + bx r0 + thumb_func_end sub_80D6EDC + + thumb_func_start bag_pocket_get_itemid +@ int bag_pocket_get_itemid(int pocket_id_plus_1, int item_index_in_pocket) +bag_pocket_get_itemid: @ 80D6F14 + lsls r0, 24 + lsls r1, 16 + ldr r2, =0x02039dd8 + lsrs r0, 21 + subs r0, 0x8 + adds r0, r2 + ldr r0, [r0] + lsrs r1, 14 + adds r1, r0 + ldrh r0, [r1] + bx lr + .pool + thumb_func_end bag_pocket_get_itemid + + thumb_func_start bag_pocket_get_item_quantity +@ int bag_pocket_get_item_quantity(int pocket_id_plus_1, int item_index_in_pocket) +bag_pocket_get_item_quantity: @ 80D6F30 + push {lr} + lsls r0, 24 + lsls r1, 16 + ldr r2, =0x02039dd8 + lsrs r0, 21 + subs r0, 0x8 + adds r0, r2 + lsrs r1, 14 + ldr r0, [r0] + adds r0, r1 + adds r0, 0x2 + bl decrypt_bag_item_quantity + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end bag_pocket_get_item_quantity + + thumb_func_start swap32 +swap32: @ 80D6F58 + ldr r3, [r0] + ldr r2, [r1] + str r2, [r0] + str r3, [r1] + bx lr + thumb_func_end swap32 + + thumb_func_start sub_80D6F64 +sub_80D6F64: @ 80D6F64 + push {r4-r7,lr} + adds r6, r0, 0 + movs r3, 0 + b _080D6FA6 +_080D6F6C: + adds r1, r3, 0x1 + lsls r0, r1, 16 + lsrs r4, r0, 16 + adds r7, r1, 0 + cmp r4, r2 + bcs _080D6FA2 + lsls r5, r3, 2 +_080D6F7A: + ldr r0, [r6] + adds r0, r5 + adds r0, 0x2 + bl decrypt_bag_item_quantity + lsls r0, 16 + cmp r0, 0 + bne _080D6F96 + ldr r1, [r6] + adds r0, r1, r5 + lsls r2, r4, 2 + adds r1, r2 + bl swap32 +_080D6F96: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldrb r0, [r6, 0x4] + cmp r4, r0 + bcc _080D6F7A +_080D6FA2: + lsls r0, r7, 16 + lsrs r3, r0, 16 +_080D6FA6: + ldrb r2, [r6, 0x4] + subs r0, r2, 0x1 + cmp r3, r0 + blt _080D6F6C + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80D6F64 + + thumb_func_start sub_80D6FB4 +sub_80D6FB4: @ 80D6FB4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + movs r3, 0 + b _080D701A +_080D6FC0: + adds r1, r3, 0x1 + lsls r0, r1, 16 + lsrs r5, r0, 16 + mov r8, r1 + cmp r5, r2 + bcs _080D7014 + lsls r7, r3, 2 +_080D6FCE: + ldr r0, [r6] + adds r0, r7 + adds r0, 0x2 + bl decrypt_bag_item_quantity + lsls r0, 16 + lsls r4, r5, 2 + cmp r0, 0 + beq _080D6FFE + ldr r0, [r6] + adds r0, r4 + adds r0, 0x2 + bl decrypt_bag_item_quantity + lsls r0, 16 + cmp r0, 0 + beq _080D7008 + ldr r0, [r6] + adds r1, r7, r0 + adds r0, r4, r0 + ldrh r1, [r1] + ldrh r0, [r0] + cmp r1, r0 + bls _080D7008 +_080D6FFE: + ldr r1, [r6] + adds r0, r1, r7 + adds r1, r4 + bl swap32 +_080D7008: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldrb r0, [r6, 0x4] + cmp r5, r0 + bcc _080D6FCE +_080D7014: + mov r1, r8 + lsls r0, r1, 16 + lsrs r3, r0, 16 +_080D701A: + ldrb r2, [r6, 0x4] + subs r0, r2, 0x1 + cmp r3, r0 + blt _080D6FC0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80D6FB4 + + thumb_func_start sub_80D702C +sub_80D702C: @ 80D702C + push {r4-r6,lr} + adds r4, r0, 0 + adds r3, r2, 0 + cmp r1, r3 + beq _080D708C + lsls r0, r1, 2 + adds r0, r4 + ldr r6, [r0] + cmp r3, r1 + bls _080D7064 + subs r3, 0x1 + lsls r1, 16 + lsls r0, r3, 16 + asrs r2, r0, 16 + cmp r1, r0 + bge _080D7086 + adds r5, r2, 0 +_080D704E: + asrs r2, r1, 16 + lsls r0, r2, 2 + adds r0, r4 + ldr r1, [r0, 0x4] + str r1, [r0] + adds r2, 0x1 + lsls r1, r2, 16 + asrs r0, r1, 16 + cmp r0, r5 + blt _080D704E + b _080D7086 +_080D7064: + lsls r1, 16 + lsls r0, r3, 16 + asrs r2, r0, 16 + cmp r1, r0 + ble _080D7086 + adds r5, r2, 0 +_080D7070: + asrs r2, r1, 16 + lsls r1, r2, 2 + adds r1, r4 + subs r0, r1, 0x4 + ldr r0, [r0] + str r0, [r1] + subs r2, 0x1 + lsls r1, r2, 16 + asrs r0, r1, 16 + cmp r0, r5 + bgt _080D7070 +_080D7086: + lsls r0, r3, 2 + adds r0, r4 + str r6, [r0] +_080D708C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80D702C + + thumb_func_start sub_80D7094 +sub_80D7094: @ 80D7094 + push {r4,r5,lr} + movs r4, 0 + ldr r5, =0x02039dd8 +_080D709A: + lsls r1, r4, 3 + adds r1, r5 + ldr r0, [r1] + ldrb r1, [r1, 0x4] + bl sub_80D6C7C + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _080D709A + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D7094 + + thumb_func_start CountTotalItemQuantityInBag +@ u16 CountTotalItemQuantityInBag(u16 itemId) +CountTotalItemQuantityInBag: @ 80D70BC + push {r4-r7,lr} + lsls r0, 16 + lsrs r6, r0, 16 + movs r7, 0 + adds r0, r6, 0 + bl itemid_get_pocket_number + lsls r0, 24 + lsrs r0, 21 + ldr r1, =0x02039dd0 + adds r5, r0, r1 + movs r4, 0 + ldrb r0, [r5, 0x4] + cmp r7, r0 + bcs _080D70FE +_080D70DA: + ldr r0, [r5] + lsls r1, r4, 2 + adds r1, r0 + ldrh r0, [r1] + cmp r0, r6 + bne _080D70F2 + adds r0, r1, 0x2 + bl decrypt_bag_item_quantity + adds r0, r7, r0 + lsls r0, 16 + lsrs r7, r0, 16 +_080D70F2: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldrb r0, [r5, 0x4] + cmp r4, r0 + bcc _080D70DA +_080D70FE: + adds r0, r7, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end CountTotalItemQuantityInBag + + thumb_func_start sub_80D710C +sub_80D710C: @ 80D710C + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + ldr r0, =0x03005d90 + ldr r3, [r0] + ldr r1, =0x00000ca9 + adds r0, r3, r1 + ldrb r1, [r0] + lsls r1, 30 + lsrs r2, r1, 30 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x00000e2c + adds r0, r2 + adds r2, r3, r0 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + ldr r1, =0x00000e54 + adds r0, r1 + adds r3, r0 + movs r1, 0 +_080D7140: + lsls r0, r1, 1 + adds r0, r2 + ldrh r0, [r0] + cmp r0, r5 + bne _080D7170 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, r4 + bcs _080D715C + subs r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + bne _080D7170 +_080D715C: + movs r0, 0x1 + b _080D717C + .pool +_080D7170: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x9 + bls _080D7140 + movs r0, 0 +_080D717C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80D710C + + thumb_func_start sub_80D7184 +sub_80D7184: @ 80D7184 + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + ldr r0, =0x03005d90 + ldr r3, [r0] + ldr r1, =0x00000ca9 + adds r0, r3, r1 + ldrb r1, [r0] + lsls r1, 30 + lsrs r2, r1, 30 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x00000e2c + adds r0, r2 + adds r2, r3, r0 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + ldr r1, =0x00000e54 + adds r0, r1 + adds r3, r0 + movs r1, 0 +_080D71B8: + lsls r0, r1, 1 + adds r0, r2 + ldrh r0, [r0] + cmp r0, r5 + beq _080D71C6 + cmp r0, 0 + bne _080D71F0 +_080D71C6: + adds r0, r3, r1 + ldrb r0, [r0] + adds r0, r4 + cmp r0, 0x63 + ble _080D71DA + subs r0, 0x63 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + bne _080D71F0 +_080D71DA: + movs r0, 0x1 + b _080D71FC + .pool +_080D71F0: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x9 + bls _080D71B8 + movs r0, 0 +_080D71FC: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80D7184 + + thumb_func_start sub_80D7204 +sub_80D7204: @ 80D7204 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 16 + lsrs r7, r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + ldr r0, =0x03005d90 + ldr r3, [r0] + ldr r1, =0x00000ca9 + adds r0, r3, r1 + ldrb r1, [r0] + lsls r1, 30 + lsrs r2, r1, 30 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x00000e2c + adds r0, r2 + adds r0, r3 + mov r9, r0 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + ldr r1, =0x00000e54 + adds r0, r1 + adds r3, r0 + mov r8, r3 + movs r0, 0x14 + bl Alloc + adds r5, r0, 0 + movs r0, 0xA + bl Alloc + adds r6, r0, 0 + adds r0, r5, 0 + mov r1, r9 + movs r2, 0x14 + bl memcpy + adds r0, r6, 0 + mov r1, r8 + movs r2, 0xA + bl memcpy + movs r2, 0 +_080D7266: + lsls r0, r2, 1 + adds r0, r5 + ldrh r0, [r0] + cmp r0, r7 + bne _080D72AA + adds r1, r6, r2 + ldrb r0, [r1] + cmp r0, 0x62 + bhi _080D72AA + adds r0, r4 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x63 + bls _080D72A4 + ldrb r0, [r1] + subs r0, 0x63 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x63 + strb r0, [r1] + b _080D72A6 + .pool +_080D72A4: + movs r4, 0 +_080D72A6: + cmp r4, 0 + beq _080D7304 +_080D72AA: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x9 + bls _080D7266 + cmp r4, 0 + beq _080D7304 + movs r2, 0 +_080D72BA: + lsls r0, r2, 1 + adds r1, r0, r5 + ldrh r0, [r1] + cmp r0, 0 + bne _080D72E6 + strh r7, [r1] + adds r1, r6, r2 + strb r4, [r1] + lsls r0, r4, 24 + lsrs r0, 24 + cmp r0, 0x63 + bls _080D72E0 + ldrb r0, [r1] + subs r0, 0x63 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x63 + strb r0, [r1] + b _080D72E2 +_080D72E0: + movs r4, 0 +_080D72E2: + cmp r4, 0 + beq _080D7304 +_080D72E6: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x9 + bls _080D72BA + cmp r4, 0 + beq _080D7304 + adds r0, r5, 0 + bl Free + adds r0, r6, 0 + bl Free + movs r0, 0 + b _080D7326 +_080D7304: + mov r0, r9 + adds r1, r5, 0 + movs r2, 0x14 + bl memcpy + mov r0, r8 + adds r1, r6, 0 + movs r2, 0xA + bl memcpy + adds r0, r5, 0 + bl Free + adds r0, r6, 0 + bl Free + movs r0, 0x1 +_080D7326: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D7204 + + thumb_func_start sub_80D7334 +sub_80D7334: @ 80D7334 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + lsls r1, 16 + lsrs r4, r1, 16 + ldr r0, =0x03005d90 + ldr r3, [r0] + ldr r1, =0x00000ca9 + adds r0, r3, r1 + ldrb r1, [r0] + lsls r1, 30 + lsrs r2, r1, 30 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x00000e2c + adds r0, r2 + adds r0, r3 + mov r8, r0 + lsrs r1, 30 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + ldr r1, =0x00000e54 + adds r0, r1 + adds r7, r3, r0 + ldr r1, =0x0203cf30 + ldrh r0, [r1, 0x8] + ldrh r1, [r1, 0x6] + adds r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r0, r2, 1 + mov r1, r8 + adds r3, r0, r1 + ldrh r0, [r3] + cmp r0, r9 + bne _080D73B4 + adds r1, r7, r2 + ldrb r0, [r1] + cmp r0, r4 + bcc _080D73B4 + subs r0, r4 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _080D744C + strh r0, [r3] + b _080D744C + .pool +_080D73B4: + movs r0, 0x14 + bl Alloc + adds r5, r0, 0 + movs r0, 0xA + bl Alloc + adds r6, r0, 0 + adds r0, r5, 0 + mov r1, r8 + movs r2, 0x14 + bl memcpy + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0xA + bl memcpy + movs r2, 0 +_080D73DA: + lsls r0, r2, 1 + adds r3, r0, r5 + ldrh r0, [r3] + cmp r0, r9 + bne _080D740E + adds r1, r6, r2 + ldrb r0, [r1] + cmp r0, r4 + bcc _080D73FC + subs r0, r4 + strb r0, [r1] + movs r4, 0 + lsls r0, 24 + cmp r0, 0 + bne _080D740A + strh r4, [r3] + b _080D740A +_080D73FC: + subs r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0 + strb r0, [r1] + movs r0, 0 + strh r0, [r3] +_080D740A: + cmp r4, 0 + beq _080D742C +_080D740E: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x9 + bls _080D73DA + cmp r4, 0 + beq _080D742C + adds r0, r5, 0 + bl Free + adds r0, r6, 0 + bl Free + movs r0, 0 + b _080D744E +_080D742C: + mov r0, r8 + adds r1, r5, 0 + movs r2, 0x14 + bl memcpy + adds r0, r7, 0 + adds r1, r6, 0 + movs r2, 0xA + bl memcpy + adds r0, r5, 0 + bl Free + adds r0, r6, 0 + bl Free +_080D744C: + movs r0, 0x1 +_080D744E: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D7334 + + thumb_func_start itemid_sanitize +itemid_sanitize: @ 80D745C + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + movs r0, 0xBC + lsls r0, 1 + cmp r1, r0 + bhi _080D746E + adds r0, r1, 0 + b _080D7470 +_080D746E: + movs r0, 0 +_080D7470: + pop {r1} + bx r1 + thumb_func_end itemid_sanitize + + thumb_func_start itemid_get_item +@ item *itemid_get_item(s16 itemId) +itemid_get_item: @ 80D7474 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + ldr r1, =gItems + adds r0, r1 + pop {r1} + bx r1 + .pool + thumb_func_end itemid_get_item + + thumb_func_start itemid_get_number +itemid_get_number: @ 80D7494 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, =gItems + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r0, r4 + ldrh r0, [r0, 0xE] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end itemid_get_number + + thumb_func_start itemid_get_market_price +itemid_get_market_price: @ 80D74B8 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, =gItems + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r0, r4 + ldrh r0, [r0, 0x10] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end itemid_get_market_price + + thumb_func_start itemid_get_x12 +itemid_get_x12: @ 80D74DC + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, =gItems + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r0, r4 + ldrb r0, [r0, 0x12] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end itemid_get_x12 + + thumb_func_start itemid_get_quality +itemid_get_quality: @ 80D7500 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, =gItems + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r0, r4 + ldrb r0, [r0, 0x13] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end itemid_get_quality + + thumb_func_start itemid_get_description +itemid_get_description: @ 80D7524 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, =gItems + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r4, 0x14 + adds r0, r4 + ldr r0, [r0] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end itemid_get_description + + thumb_func_start itemid_is_unique +itemid_is_unique: @ 80D7548 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, =gItems + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r0, r4 + ldrb r0, [r0, 0x18] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end itemid_is_unique + + thumb_func_start itemid_get_x19 +itemid_get_x19: @ 80D756C + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, =gItems + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r0, r4 + ldrb r0, [r0, 0x19] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end itemid_get_x19 + + thumb_func_start itemid_get_pocket_number +itemid_get_pocket_number: @ 80D7590 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, =gItems + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r0, r4 + ldrb r0, [r0, 0x1A] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end itemid_get_pocket_number + + thumb_func_start itemid_get_type +itemid_get_type: @ 80D75B4 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, =gItems + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r0, r4 + ldrb r0, [r0, 0x1B] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end itemid_get_type + + thumb_func_start itemid_get_overworld_function +itemid_get_overworld_function: @ 80D75D8 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, =gItems + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r4, 0x1C + adds r0, r4 + ldr r0, [r0] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end itemid_get_overworld_function + + thumb_func_start itemid_get_usage +itemid_get_usage: @ 80D75FC + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, =gItems + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r0, r4 + adds r0, 0x20 + ldrb r0, [r0] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end itemid_get_usage + + thumb_func_start itemid_get_battle_function +itemid_get_battle_function: @ 80D7620 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, =gItems + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r4, 0x24 + adds r0, r4 + ldr r0, [r0] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end itemid_get_battle_function + + thumb_func_start itemid_get_x28 +itemid_get_x28: @ 80D7644 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, =gItems + bl itemid_sanitize + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x2C + muls r0, r1 + adds r0, r4 + adds r0, 0x28 + ldrb r0, [r0] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end itemid_get_x28 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/item_use.s b/asm/item_use.s new file mode 100644 index 000000000..46e5e6eb4 --- /dev/null +++ b/asm/item_use.s @@ -0,0 +1,2863 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start SetUpItemUseCallback +@ void SetUpItemUseCallback(u8 taskId) +SetUpItemUseCallback: @ 80FD060 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x0203ce7c + ldrh r0, [r1] + cmp r0, 0xAF + bne _080FD084 + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrb r0, [r1, 0x10] + b _080FD08A + .pool +_080FD084: + ldrh r0, [r1] + bl itemid_get_type +_080FD08A: + subs r0, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _080FD0B8 + ldr r0, =0x0203ce54 + ldr r2, [r0] + ldr r1, =gUnknown_085920D8 + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + adds r0, r5, 0 + bl unknown_ItemMenu_Confirm + b _080FD0CC + .pool +_080FD0B8: + ldr r0, =0x0203cf2c + ldr r2, [r0] + ldr r1, =gUnknown_085920D8 + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + adds r0, r5, 0 + bl sub_81C5B14 +_080FD0CC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end SetUpItemUseCallback + + thumb_func_start SetUpItemUseOnFieldCallback +@ void SetUpItemUseOnFieldCallback() +SetUpItemUseOnFieldCallback: @ 80FD0DC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r1, 0xE + ldrsh r0, [r0, r1] + cmp r0, 0x1 + beq _080FD110 + ldr r1, =0x03005dac + ldr r0, =MapPostLoadHook_UseItem + str r0, [r1] + adds r0, r2, 0 + bl SetUpItemUseCallback + b _080FD11A + .pool +_080FD110: + ldr r0, =0x0203a0f4 + ldr r1, [r0] + adds r0, r2, 0 + bl _call_via_r1 +_080FD11A: + pop {r0} + bx r0 + .pool + thumb_func_end SetUpItemUseOnFieldCallback + + thumb_func_start MapPostLoadHook_UseItem +@ void MapPostLoadHook_UseItem() +MapPostLoadHook_UseItem: @ 80FD124 + push {lr} + bl pal_fill_black + ldr r0, =Task_CallItemUseOnFieldCallback + movs r1, 0x8 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end MapPostLoadHook_UseItem + + thumb_func_start Task_CallItemUseOnFieldCallback +@ void Task_CallItemUseOnFieldCallback(u8 taskId) +Task_CallItemUseOnFieldCallback: @ 80FD13C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FD158 + ldr r0, =0x0203a0f4 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 +_080FD158: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end Task_CallItemUseOnFieldCallback + + thumb_func_start DisplayCannotUseItemMessage +@ void DisplayCannotUseItemMessage(u8 taskId, bool8 isUsingRegisteredKeyItemOnField, u8 *str) +DisplayCannotUseItemMessage: @ 80FD164 + push {r4-r6,lr} + adds r4, r1, 0 + adds r1, r2, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r6, =0x02021fc4 + adds r0, r6, 0 + bl ExpandStringRefs + cmp r4, 0 + bne _080FD1B4 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _080FD1A0 + ldr r3, =bag_menu_inits_lists_menu + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r6, 0 + bl DisplayItemMessage + b _080FD1BE + .pool +_080FD1A0: + ldr r1, =gUnknown_085E8F31 + ldr r2, =sub_81C6714 + adds r0, r5, 0 + bl DisplayItemMessageInBattlePyramid + b _080FD1BE + .pool +_080FD1B4: + ldr r2, =CleanUpAfterFailingToUseRegisteredKeyItemOnField + adds r0, r5, 0 + adds r1, r6, 0 + bl DisplayItemMessageOnField +_080FD1BE: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end DisplayCannotUseItemMessage + + thumb_func_start DisplayDadsAdviceCannotUseItemMessage +@ void DisplayDadsAdviceCannotUseItemMessage(u8 taskId, bool8 isUsingRegisteredKeyItemOnField) +DisplayDadsAdviceCannotUseItemMessage: @ 80FD1C8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_085E8F31 + bl DisplayCannotUseItemMessage + pop {r0} + bx r0 + .pool + thumb_func_end DisplayDadsAdviceCannotUseItemMessage + + thumb_func_start DisplayCannotDismountBikeMessage +@ void DisplayCannotDismountBikeMessage(u8 taskId, bool8 isUsingRegisteredKeyItemOnField) +DisplayCannotDismountBikeMessage: @ 80FD1E0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_085E8F6E + bl DisplayCannotUseItemMessage + pop {r0} + bx r0 + .pool + thumb_func_end DisplayCannotDismountBikeMessage + + thumb_func_start CleanUpAfterFailingToUseRegisteredKeyItemOnField +@ void CleanUpAfterFailingToUseRegisteredKeyItemOnField(u8 taskId) +CleanUpAfterFailingToUseRegisteredKeyItemOnField: @ 80FD1F8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + adds r0, r4, 0 + bl DestroyTask + bl sub_80984F4 + bl script_env_2_disable + pop {r4} + pop {r0} + bx r0 + thumb_func_end CleanUpAfterFailingToUseRegisteredKeyItemOnField + + thumb_func_start CheckIfItemIsTMHMOrEvolutionStone +@ u8 CheckIfItemIsTMHMOrEvolutionStone(u16 itemId) +CheckIfItemIsTMHMOrEvolutionStone: @ 80FD21C + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl itemid_get_overworld_function + ldr r1, =ItemUseOutOfBattle_TMHM + cmp r0, r1 + bne _080FD238 + movs r0, 0x1 + b _080FD24E + .pool +_080FD238: + adds r0, r4, 0 + bl itemid_get_overworld_function + ldr r1, =ItemUseOutOfBattle_EvolutionStone + cmp r0, r1 + beq _080FD24C + movs r0, 0 + b _080FD24E + .pool +_080FD24C: + movs r0, 0x2 +_080FD24E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end CheckIfItemIsTMHMOrEvolutionStone + + thumb_func_start sub_80FD254 +sub_80FD254: @ 80FD254 + push {lr} + sub sp, 0x24 + mov r1, sp + ldr r0, =0x0203ce7c + ldrh r0, [r0] + strh r0, [r1, 0x20] + ldr r1, =bag_menu_mail_related + mov r0, sp + movs r2, 0 + bl sub_8121478 + add sp, 0x24 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FD254 + + thumb_func_start ItemUseOutOfBattle_Mail +@ void ItemUseOutOfBattle_Mail(int taskId) +ItemUseOutOfBattle_Mail: @ 80FD278 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0203ce54 + ldr r2, [r1] + ldr r1, =sub_80FD254 + str r1, [r2] + bl unknown_ItemMenu_Confirm + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseOutOfBattle_Mail + + thumb_func_start ItemUseOutOfBattle_Bike +@ void ItemUseOutOfBattle_Bike(int taskId) +ItemUseOutOfBattle_Bike: @ 80FD298 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r6, r0, r1 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0000088b + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080FD30E + adds r0, r4, 0 + bl MetatileBehavior_IsVerticalRail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080FD30E + adds r0, r4, 0 + bl MetatileBehavior_IsHorizontalRail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080FD30E + adds r0, r4, 0 + bl MetatileBehavior_IsIsolatedVerticalRail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080FD30E + adds r0, r4, 0 + bl MetatileBehavior_IsIsolatedHorizontalRail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FD320 +_080FD30E: + ldrb r1, [r6, 0x6] + adds r0, r5, 0 + bl DisplayCannotDismountBikeMessage + b _080FD350 + .pool +_080FD320: + bl sav1_map_is_biking_allowed + cmp r0, 0x1 + bne _080FD348 + bl sub_8119FF8 + lsls r0, 24 + cmp r0, 0 + bne _080FD348 + ldr r1, =0x0203a0f4 + ldr r0, =ItemUseOnFieldCB_Bike + str r0, [r1] + adds r0, r5, 0 + bl SetUpItemUseOnFieldCallback + b _080FD350 + .pool +_080FD348: + ldrb r1, [r6, 0x6] + adds r0, r5, 0 + bl DisplayDadsAdviceCannotUseItemMessage +_080FD350: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end ItemUseOutOfBattle_Bike + + thumb_func_start ItemUseOnFieldCB_Bike +ItemUseOnFieldCB_Bike: @ 80FD358 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0203ce7c + ldrh r0, [r0] + bl itemid_get_x28 + lsls r0, 24 + cmp r0, 0 + bne _080FD378 + movs r0, 0x2 + bl GetOnOffBike + b _080FD37E + .pool +_080FD378: + movs r0, 0x4 + bl GetOnOffBike +_080FD37E: + bl sub_80984F4 + bl script_env_2_disable + adds r0, r4, 0 + bl DestroyTask + pop {r4} + pop {r0} + bx r0 + thumb_func_end ItemUseOnFieldCB_Bike + + thumb_func_start CanFish +@ bool8 CanFish() +CanFish: @ 80FD394 + push {r4-r6,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, 16 + lsrs r6, r0, 16 + lsls r0, r6, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl MetatileBehavior_IsWaterfall + lsls r0, 24 + cmp r0, 0 + bne _080FD41C + movs r0, 0x10 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + bne _080FD41C + movs r0, 0x8 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + bne _080FD3EC + bl IsPlayerFacingSurfableFishableWater + lsls r0, 24 + cmp r0, 0 + beq _080FD41C +_080FD3E8: + movs r0, 0x1 + b _080FD41E +_080FD3EC: + adds r0, r5, 0 + bl MetatileBehavior_IsSurfableWaterOrUnderwater + lsls r0, 24 + cmp r0, 0 + beq _080FD40C + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridIsImpassableAt + lsls r0, 24 + cmp r0, 0 + beq _080FD3E8 +_080FD40C: + lsls r0, r6, 24 + lsrs r0, 24 + bl sub_8089510 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080FD3E8 +_080FD41C: + movs r0, 0 +_080FD41E: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end CanFish + + thumb_func_start ItemUseOutOfBattle_Rod +ItemUseOutOfBattle_Rod: @ 80FD428 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl CanFish + cmp r0, 0x1 + bne _080FD44C + ldr r1, =0x0203a0f4 + ldr r0, =ItemUseOnFieldCB_Rod + str r0, [r1] + adds r0, r4, 0 + bl SetUpItemUseOnFieldCallback + b _080FD45E + .pool +_080FD44C: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrb r1, [r1, 0xE] + adds r0, r4, 0 + bl DisplayDadsAdviceCannotUseItemMessage +_080FD45E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseOutOfBattle_Rod + + thumb_func_start ItemUseOnFieldCB_Rod +ItemUseOnFieldCB_Rod: @ 80FD468 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x0203ce7c + ldrh r0, [r0] + bl itemid_get_x28 + lsls r0, 24 + lsrs r0, 24 + bl StartFishing + adds r0, r4, 0 + bl DestroyTask + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseOnFieldCB_Rod + + thumb_func_start ItemUseOutOfBattle_Itemfinder +ItemUseOutOfBattle_Itemfinder: @ 80FD490 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x27 + bl sav12_xor_increment + ldr r1, =0x0203a0f4 + ldr r0, =ItemUseOnFieldCB_Itemfinder + str r0, [r1] + adds r0, r4, 0 + bl SetUpItemUseOnFieldCallback + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseOutOfBattle_Itemfinder + + thumb_func_start ItemUseOnFieldCB_Itemfinder +ItemUseOnFieldCB_Itemfinder: @ 80FD4B8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037318 + ldr r0, [r0, 0x4] + adds r1, r4, 0 + bl ItemfinderCheckForHiddenItems + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FD4EC + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80FD504 + str r0, [r1] + b _080FD4F6 + .pool +_080FD4EC: + ldr r1, =gUnknown_085E9002 + ldr r2, =sub_80FD5CC + adds r0, r4, 0 + bl DisplayItemMessageOnField +_080FD4F6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseOnFieldCB_Itemfinder + + thumb_func_start sub_80FD504 +sub_80FD504: @ 80FD504 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r6, r5, 2 + adds r0, r6, r5 + lsls r7, r0, 3 + ldr r0, =0x03005e08 + mov r8, r0 + adds r4, r7, r0 + movs r1, 0x6 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080FD5B8 + movs r2, 0x8 + ldrsh r0, [r4, r2] + cmp r0, 0x4 + bne _080FD5AC + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl sub_80FD9B0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080FD564 + ldr r1, =gUnknown_085920E4 + subs r0, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl sub_80FDA24 + mov r0, r8 + subs r0, 0x8 + adds r0, r7, r0 + ldr r1, =sub_80FDA94 + str r1, [r0] + b _080FD5C2 + .pool +_080FD564: + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + adds r3, r6, 0 + ldr r7, =gUnknown_085920E4 + movs r6, 0x3 +_080FD574: + adds r0, r1, r7 + adds r1, 0x1 + ldrb r0, [r0] + cmp r2, r0 + bne _080FD584 + adds r0, r1, 0 + ands r0, r6 + strh r0, [r4, 0xA] +_080FD584: + lsls r0, r1, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _080FD574 + ldr r1, =0x03005e00 + adds r0, r3, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80FDADC + str r1, [r0] + movs r0, 0 + strh r0, [r4, 0x6] + strh r0, [r4, 0x4] + b _080FD5C2 + .pool +_080FD5AC: + movs r0, 0x48 + bl audio_play + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080FD5B8: + ldrh r0, [r4, 0x6] + adds r0, 0x1 + movs r1, 0x1F + ands r0, r1 + strh r0, [r4, 0x6] +_080FD5C2: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80FD504 + + thumb_func_start sub_80FD5CC +sub_80FD5CC: @ 80FD5CC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + bl sub_80984F4 + bl script_env_2_disable + adds r0, r4, 0 + bl DestroyTask + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FD5CC + + thumb_func_start ItemfinderCheckForHiddenItems +@ bool8 ItemfinderCheckForHiddenItems(struct map_events *events, u8 taskId) +ItemfinderCheckForHiddenItems: @ 80FD5F0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r5, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xC] + movs r3, 0 + mov r9, r4 + ldrb r0, [r5, 0x3] + cmp r3, r0 + bge _080FD6A4 + subs r1, 0x5 + mov r8, r1 +_080FD628: + lsls r3, 16 + asrs r1, r3, 16 + ldr r2, [r5, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r4, r0, 2 + adds r1, r4, r2 + ldrb r0, [r1, 0x5] + adds r7, r3, 0 + cmp r0, 0x7 + bne _080FD694 + movs r2, 0xFA + lsls r2, 1 + adds r0, r2, 0 + ldrh r1, [r1, 0xA] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _080FD694 + ldr r1, [r5, 0x10] + adds r1, r4, r1 + ldrh r2, [r1] + adds r2, 0x7 + mov r0, sp + ldrh r0, [r0] + subs r2, r0 + ldrh r0, [r1, 0x2] + adds r0, 0x7 + mov r3, r9 + ldrh r1, [r3] + subs r0, r1 + lsls r0, 16 + lsrs r0, 16 + lsls r2, 16 + asrs r1, r2, 16 + movs r3, 0xE0 + lsls r3, 11 + adds r2, r3 + lsrs r2, 16 + cmp r2, 0xE + bhi _080FD694 + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, r8 + blt _080FD694 + cmp r2, 0x5 + bgt _080FD694 + adds r0, r6, 0 + bl sub_80FD8E0 +_080FD694: + movs r1, 0x80 + lsls r1, 9 + adds r0, r7, r1 + lsrs r3, r0, 16 + asrs r0, 16 + ldrb r2, [r5, 0x3] + cmp r0, r2 + blt _080FD628 +_080FD6A4: + adds r0, r6, 0 + bl sub_80FD7C8 + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r0, 0x1 + beq _080FD6C4 + movs r0, 0 + b _080FD6C6 + .pool +_080FD6C4: + movs r0, 0x1 +_080FD6C6: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end ItemfinderCheckForHiddenItems + + thumb_func_start sub_80FD6D4 +sub_80FD6D4: @ 80FD6D4 + push {r4-r6,lr} + lsls r1, 16 + lsrs r3, r1, 16 + lsls r2, 16 + lsrs r4, r2, 16 + ldrb r2, [r0, 0x3] + ldr r5, [r0, 0x10] + movs r1, 0 + cmp r1, r2 + bge _080FD728 + lsls r0, r3, 16 + asrs r6, r0, 16 + lsls r0, r4, 16 + asrs r4, r0, 16 + adds r3, r5, 0 +_080FD6F2: + ldrb r0, [r3, 0x5] + cmp r0, 0x7 + bne _080FD720 + ldrh r0, [r3] + cmp r6, r0 + bne _080FD720 + ldrh r0, [r3, 0x2] + cmp r4, r0 + bne _080FD720 + movs r1, 0xFA + lsls r1, 1 + adds r0, r1, 0 + ldrh r3, [r3, 0xA] + adds r0, r3 + lsls r0, 16 + lsrs r0, 16 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _080FD728 + movs r0, 0x1 + b _080FD72A +_080FD720: + adds r3, 0xC + adds r1, 0x1 + cmp r1, r2 + blt _080FD6F2 +_080FD728: + movs r0, 0 +_080FD72A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80FD6D4 + + thumb_func_start sub_80FD730 +sub_80FD730: @ 80FD730 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + bl mapconnection_get_mapheader + adds r3, r0, 0 + ldrb r0, [r4] + cmp r0, 0x2 + beq _080FD758 + cmp r0, 0x2 + bgt _080FD74E + cmp r0, 0x1 + beq _080FD76C + b _080FD7AC +_080FD74E: + cmp r0, 0x3 + beq _080FD784 + cmp r0, 0x4 + beq _080FD78E + b _080FD7AC +_080FD758: + ldr r0, [r4, 0x4] + adds r0, 0x7 + subs r0, r5, r0 + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, [r3] + ldr r0, [r0, 0x4] + subs r0, 0x7 + adds r0, r6 + b _080FD7A2 +_080FD76C: + ldr r0, [r4, 0x4] + adds r0, 0x7 + subs r0, r5, r0 + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =0x02037318 + ldr r0, [r0] + ldr r0, [r0, 0x4] + b _080FD79E + .pool +_080FD784: + ldr r0, [r3] + ldr r0, [r0] + subs r0, 0x7 + adds r0, r5 + b _080FD798 +_080FD78E: + ldr r0, =0x02037318 + ldr r0, [r0] + ldr r0, [r0] + adds r0, 0x7 + subs r0, r5, r0 +_080FD798: + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, [r4, 0x4] +_080FD79E: + adds r0, 0x7 + subs r0, r6, r0 +_080FD7A2: + lsls r0, 16 + lsrs r2, r0, 16 + b _080FD7B0 + .pool +_080FD7AC: + movs r0, 0 + b _080FD7C2 +_080FD7B0: + ldr r0, [r3, 0x4] + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + bl sub_80FD6D4 + lsls r0, 24 + lsrs r0, 24 +_080FD7C2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80FD730 + + thumb_func_start sub_80FD7C8 +sub_80FD7C8: @ 80FD7C8 + 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, 0x4] + ldr r0, =0x02037318 + ldr r1, [r0] + ldr r0, [r1] + adds r0, 0x7 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x8] + ldr r0, [r1, 0x4] + adds r0, 0x7 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0xC] + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + mov r0, sp + ldrh r0, [r0] + subs r0, 0x7 + lsls r0, 16 + lsrs r3, r0, 16 + asrs r0, 16 + mov r1, sp + movs r2, 0 + ldrsh r1, [r1, r2] + adds r1, 0x7 + cmp r0, r1 + bgt _080FD8CC +_080FD816: + mov r5, sp + ldrh r0, [r5, 0x2] + subs r0, 0x5 + lsls r0, 16 + lsrs r4, r0, 16 + lsls r2, r4, 16 + asrs r1, r2, 16 + movs r6, 0x2 + ldrsh r0, [r5, r6] + adds r0, 0x5 + lsls r3, 16 + mov r8, r3 + cmp r1, r0 + bgt _080FD8B6 + movs r0, 0x7 + str r0, [sp, 0x10] + mov r1, r8 + asrs r1, 16 + mov r9, r1 + mov r10, r0 +_080FD83E: + ldr r3, [sp, 0x10] + cmp r3, r9 + bgt _080FD860 + ldr r5, [sp, 0x8] + lsls r0, r5, 16 + asrs r0, 16 + cmp r9, r0 + bge _080FD860 + asrs r1, r2, 16 + cmp r10, r1 + bgt _080FD860 + ldr r6, [sp, 0xC] + lsls r0, r6, 16 + asrs r0, 16 + lsls r7, r4, 16 + cmp r1, r0 + blt _080FD89E +_080FD860: + mov r0, r8 + asrs r5, r0, 16 + lsls r4, 16 + asrs r6, r4, 16 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8088A8C + adds r7, r4, 0 + cmp r0, 0 + beq _080FD89E + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_80FD730 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FD89E + mov r0, sp + ldrh r1, [r0] + subs r1, r5, r1 + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r0, 0x2] + subs r2, r6, r2 + lsls r2, 16 + asrs r2, 16 + ldr r0, [sp, 0x4] + bl sub_80FD8E0 +_080FD89E: + movs r1, 0x80 + lsls r1, 9 + adds r0, r7, r1 + lsrs r4, r0, 16 + lsls r2, r4, 16 + asrs r1, r2, 16 + mov r3, sp + movs r5, 0x2 + ldrsh r0, [r3, r5] + adds r0, 0x5 + cmp r1, r0 + ble _080FD83E +_080FD8B6: + movs r1, 0x80 + lsls r1, 9 + add r1, r8 + lsrs r3, r1, 16 + asrs r1, 16 + mov r0, sp + movs r6, 0 + ldrsh r0, [r0, r6] + adds r0, 0x7 + cmp r1, r0 + ble _080FD816 +_080FD8CC: + 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_80FD7C8 + + thumb_func_start sub_80FD8E0 +sub_80FD8E0: @ 80FD8E0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 16 + lsrs r2, 16 + mov r12, r2 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r3, r1, r0 + movs r1, 0x4 + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _080FD918 + strh r7, [r3] + mov r0, r12 + strh r0, [r3, 0x2] + movs r0, 0x1 + strh r0, [r3, 0x4] + b _080FD9A2 + .pool +_080FD918: + movs r1, 0 + ldrsh r0, [r3, r1] + cmp r0, 0 + bge _080FD928 + negs r0, r0 + lsls r0, 16 + lsrs r4, r0, 16 + b _080FD92A +_080FD928: + ldrh r4, [r3] +_080FD92A: + movs r1, 0x2 + ldrsh r0, [r3, r1] + ldrh r1, [r3, 0x2] + mov r9, r1 + cmp r0, 0 + bge _080FD93E + negs r0, r0 + lsls r0, 16 + lsrs r2, r0, 16 + b _080FD940 +_080FD93E: + ldrh r2, [r3, 0x2] +_080FD940: + lsls r1, r7, 16 + asrs r0, r1, 16 + cmp r0, 0 + bge _080FD950 + negs r0, r0 + lsls r0, 16 + lsrs r6, r0, 16 + b _080FD952 +_080FD950: + lsrs r6, r1, 16 +_080FD952: + mov r1, r12 + lsls r0, r1, 16 + asrs r1, r0, 16 + mov r8, r0 + cmp r1, 0 + bge _080FD964 + negs r0, r1 + lsls r0, 16 + b _080FD966 +_080FD964: + mov r0, r8 +_080FD966: + lsrs r5, r0, 16 + lsls r0, r4, 16 + asrs r0, 16 + lsls r1, r2, 16 + asrs r2, r1, 16 + adds r4, r0, r2 + lsls r0, r6, 16 + asrs r0, 16 + lsls r1, r5, 16 + asrs r1, 16 + adds r0, r1 + cmp r4, r0 + ble _080FD988 + strh r7, [r3] + mov r1, r12 + strh r1, [r3, 0x2] + b _080FD9A2 +_080FD988: + cmp r4, r0 + bne _080FD9A2 + cmp r2, r1 + bgt _080FD99C + cmp r2, r1 + bne _080FD9A2 + mov r1, r9 + lsls r0, r1, 16 + cmp r0, r8 + bge _080FD9A2 +_080FD99C: + strh r7, [r3] + mov r0, r12 + strh r0, [r3, 0x2] +_080FD9A2: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80FD8E0 + + thumb_func_start sub_80FD9B0 +sub_80FD9B0: @ 80FD9B0 + push {r4,r5,lr} + lsls r0, 16 + lsls r1, 16 + lsrs r1, 16 + lsrs r2, r0, 16 + cmp r0, 0 + bne _080FD9C2 + cmp r1, 0 + beq _080FDA1C +_080FD9C2: + lsls r0, r2, 16 + asrs r2, r0, 16 + adds r5, r0, 0 + cmp r2, 0 + bge _080FD9D4 + negs r0, r2 + lsls r0, 16 + lsrs r4, r0, 16 + b _080FD9D6 +_080FD9D4: + lsrs r4, r5, 16 +_080FD9D6: + lsls r0, r1, 16 + asrs r2, r0, 16 + adds r1, r0, 0 + cmp r2, 0 + bge _080FD9E8 + negs r0, r2 + lsls r0, 16 + lsrs r3, r0, 16 + b _080FD9EA +_080FD9E8: + lsrs r3, r1, 16 +_080FD9EA: + lsls r0, r4, 16 + asrs r2, r0, 16 + lsls r0, r3, 16 + asrs r0, 16 + cmp r2, r0 + ble _080FDA02 + cmp r5, 0 + bge _080FD9FE + movs r0, 0x4 + b _080FDA1E +_080FD9FE: + movs r0, 0x2 + b _080FDA1E +_080FDA02: + cmp r2, r0 + bge _080FDA0C + cmp r1, 0 + blt _080FDA14 + b _080FDA18 +_080FDA0C: + cmp r2, r0 + bne _080FDA1C + cmp r1, 0 + bge _080FDA18 +_080FDA14: + movs r0, 0x1 + b _080FDA1E +_080FDA18: + movs r0, 0x3 + b _080FDA1E +_080FDA1C: + movs r0, 0 +_080FDA1E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80FD9B0 + + thumb_func_start sub_80FDA24 +sub_80FDA24: @ 80FDA24 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + 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 r4, =0x02037350 + adds r0, r4 + bl FieldObjectClearAnimIfSpecialAnimFinished + 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 + adds r0, r4 + bl FieldObjectClearAnim + 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 + adds r0, r4 + bl npc_sync_anim_pause_bits + adds r0, r5, 0 + bl PlayerTurnInPlace + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FDA24 + + thumb_func_start sub_80FDA94 +sub_80FDA94: @ 80FDA94 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + 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, =0x02037350 + adds r0, r1 + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FDACA + ldr r1, =gUnknown_085E8F93 + ldr r2, =sub_80FD5CC + adds r0, r4, 0 + bl DisplayItemMessageOnField +_080FDACA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FDA94 + + thumb_func_start sub_80FDADC +sub_80FDADC: @ 80FDADC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + 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, =0x02037350 + adds r0, r1 + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080FDB1C + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080FDB50 +_080FDB1C: + ldr r1, =gUnknown_085920E4 + movs r2, 0xA + ldrsh r0, [r4, r2] + adds r0, r1 + ldrb r0, [r0] + bl sub_80FDA24 + movs r0, 0x1 + strh r0, [r4, 0x4] + ldrh r0, [r4, 0xA] + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x6] + adds r0, 0x1 + strh r0, [r4, 0x6] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _080FDB50 + ldr r1, =gUnknown_085E8FDB + ldr r2, =sub_80FD5CC + adds r0, r5, 0 + bl DisplayItemMessageOnField +_080FDB50: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FDADC + + thumb_func_start ItemUseOutOfBattle_PokeblockCase +ItemUseOutOfBattle_PokeblockCase: @ 80FDB6C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FDB98 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrb r1, [r1, 0xE] + adds r0, r4, 0 + bl DisplayDadsAdviceCannotUseItemMessage + b _080FDBDA + .pool +_080FDB98: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r5, r1, r0 + movs r1, 0xE + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _080FDBC8 + ldr r0, =0x0203ce54 + ldr r1, [r0] + ldr r0, =sub_80FDBEC + str r0, [r1] + adds r0, r4, 0 + bl unknown_ItemMenu_Confirm + b _080FDBDA + .pool +_080FDBC8: + ldr r0, =0x03005dac + ldr r1, =sub_80AF6D4 + str r1, [r0] + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, =sub_80FDC00 + str r0, [r5] +_080FDBDA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseOutOfBattle_PokeblockCase + + thumb_func_start sub_80FDBEC +sub_80FDBEC: @ 80FDBEC + push {lr} + ldr r1, =bag_menu_mail_related + movs r0, 0 + bl sub_81357FC + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FDBEC + + thumb_func_start sub_80FDC00 +sub_80FDC00: @ 80FDC00 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080FDC24 + bl overworld_free_bg_tilemaps + ldr r1, =c2_exit_to_overworld_2_switch + movs r0, 0 + bl sub_81357FC + adds r0, r4, 0 + bl DestroyTask +_080FDC24: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FDC00 + + thumb_func_start ItemUseOutOfBattle_CoinCase +ItemUseOutOfBattle_CoinCase: @ 80FDC34 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x02021cc4 + bl GetCoins + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E9026 + adds r0, r4, 0 + bl ExpandStringRefs + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0xE + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _080FDC90 + ldr r3, =bag_menu_inits_lists_menu + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl DisplayItemMessage + b _080FDC9A + .pool +_080FDC90: + ldr r2, =CleanUpAfterFailingToUseRegisteredKeyItemOnField + adds r0, r5, 0 + adds r1, r4, 0 + bl DisplayItemMessageOnField +_080FDC9A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseOutOfBattle_CoinCase + + thumb_func_start ItemUseOutOfBattle_PowderJar +ItemUseOutOfBattle_PowderJar: @ 80FDCA4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x02021cc4 + bl sub_80247BC + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x5 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E9138 + adds r0, r4, 0 + bl ExpandStringRefs + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0xE + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _080FDCFC + ldr r3, =bag_menu_inits_lists_menu + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl DisplayItemMessage + b _080FDD06 + .pool +_080FDCFC: + ldr r2, =CleanUpAfterFailingToUseRegisteredKeyItemOnField + adds r0, r5, 0 + adds r1, r4, 0 + bl DisplayItemMessageOnField +_080FDD06: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseOutOfBattle_PowderJar + + thumb_func_start sub_80FDD10 +sub_80FDD10: @ 80FDD10 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl IsPlayerFacingPlantedBerryTree + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FDD58 + ldr r1, =0x0203a0f4 + ldr r0, =sub_80FDD74 + str r0, [r1] + ldr r1, =0x03005dac + ldr r0, =MapPostLoadHook_UseItem + str r0, [r1] + ldr r0, =0x0203ce54 + ldr r1, [r0] + ldr r0, =c2_exit_to_overworld_2_switch + str r0, [r1] + adds r0, r4, 0 + bl unknown_ItemMenu_Confirm + b _080FDD68 + .pool +_080FDD58: + ldr r0, =0x0203ce7c + ldrh r0, [r0] + bl itemid_get_overworld_function + adds r1, r0, 0 + adds r0, r4, 0 + bl _call_via_r1 +_080FDD68: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FDD10 + + thumb_func_start sub_80FDD74 +sub_80FDD74: @ 80FDD74 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x0203ce7c + ldrh r0, [r0] + movs r1, 0x1 + bl remove_item + bl script_env_2_enable + ldr r0, =gUnknown_08274482 + bl script_env_1_execute_new_script + adds r0, r4, 0 + bl DestroyTask + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FDD74 + + thumb_func_start ItemUseOutOfBattle_WailmerPail +ItemUseOutOfBattle_WailmerPail: @ 80FDDA4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl sub_80FDE2C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FDDC8 + ldr r1, =0x0203a0f4 + ldr r0, =sub_80FDE7C + b _080FDDD8 + .pool +_080FDDC8: + bl WaterBerryTree + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FDDEC + ldr r1, =0x0203a0f4 + ldr r0, =sub_80FDE08 +_080FDDD8: + str r0, [r1] + adds r0, r4, 0 + bl SetUpItemUseOnFieldCallback + b _080FDDFE + .pool +_080FDDEC: + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrb r1, [r1, 0xE] + adds r0, r5, 0 + bl DisplayDadsAdviceCannotUseItemMessage +_080FDDFE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseOutOfBattle_WailmerPail + + thumb_func_start sub_80FDE08 +sub_80FDE08: @ 80FDE08 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl script_env_2_enable + ldr r0, =gUnknown_082744C0 + bl script_env_1_execute_new_script + adds r0, r4, 0 + bl DestroyTask + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FDE08 + + thumb_func_start sub_80FDE2C +sub_80FDE2C: @ 80FDE2C + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl GetXYCoordsOneStepInFrontOfPlayer + bl PlayerGetZCoord + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + mov r0, sp + ldrh r0, [r0] + ldrh r1, [r4] + bl GetFieldObjectIdByXYZ + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x10 + beq _080FDE68 + ldr r0, =0x02037350 + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x5] + cmp r0, 0xE4 + beq _080FDE70 +_080FDE68: + movs r0, 0 + b _080FDE72 + .pool +_080FDE70: + movs r0, 0x1 +_080FDE72: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80FDE2C + + thumb_func_start sub_80FDE7C +sub_80FDE7C: @ 80FDE7C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl script_env_2_enable + ldr r0, =gUnknown_08242CFC + bl script_env_1_execute_new_script + adds r0, r4, 0 + bl DestroyTask + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FDE7C + + thumb_func_start ItemUseOutOfBattle_Medicine +ItemUseOutOfBattle_Medicine: @ 80FDEA0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03006328 + ldr r1, =ItemUseCB_Medicine + str r1, [r2] + bl SetUpItemUseCallback + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseOutOfBattle_Medicine + + thumb_func_start ItemUseOutOfBattle_ReduceEV +ItemUseOutOfBattle_ReduceEV: @ 80FDEBC + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03006328 + ldr r1, =sub_81B67C8 + str r1, [r2] + bl SetUpItemUseCallback + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseOutOfBattle_ReduceEV + + thumb_func_start ItemUseOutOfBattle_SacredAsh +ItemUseOutOfBattle_SacredAsh: @ 80FDED8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03006328 + ldr r1, =sub_81B79E8 + str r1, [r2] + bl SetUpItemUseCallback + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseOutOfBattle_SacredAsh + + thumb_func_start ItemUseOutOfBattle_PPRecovery +ItemUseOutOfBattle_PPRecovery: @ 80FDEF4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03006328 + ldr r1, =dp05_ether + str r1, [r2] + bl SetUpItemUseCallback + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseOutOfBattle_PPRecovery + + thumb_func_start ItemUseOutOfBattle_PPUp +ItemUseOutOfBattle_PPUp: @ 80FDF10 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03006328 + ldr r1, =dp05_pp_up + str r1, [r2] + bl SetUpItemUseCallback + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseOutOfBattle_PPUp + + thumb_func_start ItemUseOutOfBattle_RareCandy +ItemUseOutOfBattle_RareCandy: @ 80FDF2C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03006328 + ldr r1, =dp05_rare_candy + str r1, [r2] + bl SetUpItemUseCallback + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseOutOfBattle_RareCandy + + thumb_func_start ItemUseOutOfBattle_TMHM +ItemUseOutOfBattle_TMHM: @ 80FDF48 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0203ce7c + ldrh r1, [r0] + movs r0, 0xA9 + lsls r0, 1 + cmp r1, r0 + bls _080FDF74 + ldr r2, =gUnknown_085E9047 + ldr r3, =sub_80FDF90 + adds r0, r4, 0 + movs r1, 0x1 + bl DisplayItemMessage + b _080FDF80 + .pool +_080FDF74: + ldr r2, =gUnknown_085E9037 + ldr r3, =sub_80FDF90 + adds r0, r4, 0 + movs r1, 0x1 + bl DisplayItemMessage +_080FDF80: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseOutOfBattle_TMHM + + thumb_func_start sub_80FDF90 +sub_80FDF90: @ 80FDF90 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x2 + bl audio_play + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =task08_0809AD8C + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FDF90 + + thumb_func_start task08_0809AD8C +task08_0809AD8C: @ 80FDFBC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _080FE000 + ldr r4, =0x02021cc4 + ldr r0, =0x0203ce7c + ldrh r0, [r0] + 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 CopyString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E9058 + adds r0, r4, 0 + bl ExpandStringRefs + ldr r3, =sub_80FE024 + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl DisplayItemMessage +_080FE000: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end task08_0809AD8C + + thumb_func_start sub_80FE024 +sub_80FE024: @ 80FE024 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_085920E8 + movs r1, 0x6 + bl bag_menu_yes_no + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FE024 + + thumb_func_start sub_80FE03C +sub_80FE03C: @ 80FE03C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03006328 + ldr r1, =sub_81B6DC4 + str r1, [r2] + bl SetUpItemUseCallback + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FE03C + + thumb_func_start sub_80FE058 +sub_80FE058: @ 80FE058 + push {r4,lr} + ldr r4, =0x0203ce7c + ldrh r0, [r4] + movs r1, 0x1 + bl remove_item + ldrh r0, [r4] + ldr r1, =0x02021dc4 + bl itemid_get_name + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E9080 + bl ExpandStringRefs + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _080FE0AC + ldrh r0, [r4] + bl itemid_get_pocket_number + lsls r0, 24 + lsrs r0, 24 + bl sub_81AB9A8 + ldrh r0, [r4] + bl itemid_get_pocket_number + lsls r0, 24 + lsrs r0, 24 + bl sub_81ABA88 + b _080FE0B4 + .pool +_080FE0AC: + bl sub_81C5924 + bl sub_81C59BC +_080FE0B4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FE058 + + thumb_func_start ItemUseOutOfBattle_Repel +ItemUseOutOfBattle_Repel: @ 80FE0BC + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + ldr r0, =0x00004021 + bl VarGet + lsls r0, 16 + cmp r0, 0 + bne _080FE0EC + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80FE124 + str r0, [r1] + b _080FE116 + .pool +_080FE0EC: + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _080FE10C + ldr r2, =gUnknown_085E9092 + ldr r3, =bag_menu_inits_lists_menu + adds r0, r4, 0 + movs r1, 0x1 + bl DisplayItemMessage + b _080FE116 + .pool +_080FE10C: + ldr r1, =gUnknown_085E9092 + ldr r2, =sub_81C6714 + adds r0, r5, 0 + bl DisplayItemMessageInBattlePyramid +_080FE116: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseOutOfBattle_Repel + + thumb_func_start sub_80FE124 +sub_80FE124: @ 80FE124 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r4, r1, 3 + ldr r5, =0x03005e08 + adds r1, r4, r5 + ldrh r0, [r1, 0x10] + adds r0, 0x1 + strh r0, [r1, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _080FE156 + movs r0, 0 + strh r0, [r1, 0x10] + movs r0, 0x2F + bl audio_play + adds r0, r5, 0 + subs r0, 0x8 + adds r0, r4, r0 + ldr r1, =sub_80FE164 + str r1, [r0] +_080FE156: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FE124 + + thumb_func_start sub_80FE164 +sub_80FE164: @ 80FE164 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _080FE1C2 + ldr r4, =0x00004021 + ldr r0, =0x0203ce7c + ldrh r0, [r0] + bl itemid_get_quality + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl VarSet + bl sub_80FE058 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _080FE1B8 + ldr r2, =0x02021fc4 + ldr r3, =bag_menu_inits_lists_menu + adds r0, r5, 0 + movs r1, 0x1 + bl DisplayItemMessage + b _080FE1C2 + .pool +_080FE1B8: + ldr r1, =0x02021fc4 + ldr r2, =sub_81C6714 + adds r0, r6, 0 + bl DisplayItemMessageInBattlePyramid +_080FE1C2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FE164 + + thumb_func_start sub_80FE1D0 +sub_80FE1D0: @ 80FE1D0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x18] + adds r0, 0x1 + strh r0, [r1, 0x18] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _080FE226 + movs r0, 0x75 + bl audio_play + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _080FE21C + ldr r2, =0x02021fc4 + ldr r3, =bag_menu_inits_lists_menu + adds r0, r4, 0 + movs r1, 0x1 + bl DisplayItemMessage + b _080FE226 + .pool +_080FE21C: + ldr r1, =0x02021fc4 + ldr r2, =sub_81C6714 + adds r0, r5, 0 + bl DisplayItemMessageInBattlePyramid +_080FE226: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FE1D0 + + thumb_func_start ItemUseOutOfBattle_BlackWhiteFlute +ItemUseOutOfBattle_BlackWhiteFlute: @ 80FE234 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x0203ce7c + ldrh r0, [r4] + ldr r1, =0x02021dc4 + bl itemid_get_name + ldrh r0, [r4] + cmp r0, 0x2B + bne _080FE278 + ldr r0, =0x000008ad + bl FlagSet + ldr r0, =0x000008ae + bl FlagReset + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E90C6 + bl ExpandStringRefs + b _080FE28C + .pool +_080FE278: + ldr r0, =0x000008ae + bl FlagSet + ldr r0, =0x000008ad + bl FlagReset + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E90F4 + bl ExpandStringRefs +_080FE28C: + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x18] + ldr r1, =sub_80FE1D0 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseOutOfBattle_BlackWhiteFlute + + thumb_func_start task08_080A1C44 +task08_080A1C44: @ 80FE2BC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl player_avatar_init_params_reset + bl sub_80B7CC8 + adds r0, r4, 0 + bl DestroyTask + pop {r4} + pop {r0} + bx r0 + thumb_func_end task08_080A1C44 + + thumb_func_start re_escape_rope +re_escape_rope: @ 80FE2D8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl flagmods_08054D70 + bl sub_80FE058 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] + ldr r1, =0x02021fc4 + ldr r2, =task08_080A1C44 + adds r0, r4, 0 + bl DisplayItemMessageOnField + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end re_escape_rope + + thumb_func_start sub_80FE314 +sub_80FE314: @ 80FE314 + push {lr} + ldr r0, =0x02037318 + ldrb r1, [r0, 0x1A] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080FE32C + movs r0, 0 + b _080FE32E + .pool +_080FE32C: + movs r0, 0x1 +_080FE32E: + pop {r1} + bx r1 + thumb_func_end sub_80FE314 + + thumb_func_start ItemUseOutOfBattle_EscapeRope +ItemUseOutOfBattle_EscapeRope: @ 80FE334 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80FE314 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080FE35C + ldr r1, =0x0203a0f4 + ldr r0, =re_escape_rope + str r0, [r1] + adds r0, r4, 0 + bl SetUpItemUseOnFieldCallback + b _080FE36E + .pool +_080FE35C: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrb r1, [r1, 0xE] + adds r0, r4, 0 + bl DisplayDadsAdviceCannotUseItemMessage +_080FE36E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseOutOfBattle_EscapeRope + + thumb_func_start ItemUseOutOfBattle_EvolutionStone +ItemUseOutOfBattle_EvolutionStone: @ 80FE378 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03006328 + ldr r1, =sub_81B7C74 + str r1, [r2] + bl SetUpItemUseCallback + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseOutOfBattle_EvolutionStone + + thumb_func_start ItemUseInBattle_PokeBall +ItemUseInBattle_PokeBall: @ 80FE394 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl sub_806B8B0 + lsls r0, 24 + cmp r0, 0 + bne _080FE3D0 + ldr r0, =0x0203ce7c + ldrh r0, [r0] + movs r1, 0x1 + bl remove_item + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _080FE3C8 + adds r0, r4, 0 + bl unknown_ItemMenu_Confirm + b _080FE3FA + .pool +_080FE3C8: + adds r0, r4, 0 + bl sub_81C5B14 + b _080FE3FA +_080FE3D0: + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _080FE3F0 + ldr r2, =gUnknown_085E9125 + ldr r3, =bag_menu_inits_lists_menu + adds r0, r4, 0 + movs r1, 0x1 + bl DisplayItemMessage + b _080FE3FA + .pool +_080FE3F0: + ldr r1, =gUnknown_085E9125 + ldr r2, =sub_81C6714 + adds r0, r5, 0 + bl DisplayItemMessageInBattlePyramid +_080FE3FA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseInBattle_PokeBall + + thumb_func_start sub_80FE408 +sub_80FE408: @ 80FE408 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _080FE43A + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _080FE434 + adds r0, r4, 0 + bl unknown_ItemMenu_Confirm + b _080FE43A + .pool +_080FE434: + adds r0, r5, 0 + bl sub_81C5B14 +_080FE43A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80FE408 + + thumb_func_start sub_80FE440 +sub_80FE440: @ 80FE440 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x18] + adds r0, 0x1 + strh r0, [r1, 0x18] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _080FE4AC + movs r0, 0x1 + bl audio_play + ldr r4, =0x0203ce7c + ldrh r0, [r4] + movs r1, 0x1 + bl remove_item + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _080FE49C + ldrh r0, [r4] + bl sub_806CF78 + adds r2, r0, 0 + ldr r3, =sub_80FE408 + adds r0, r5, 0 + movs r1, 0x1 + bl DisplayItemMessage + b _080FE4AC + .pool +_080FE49C: + ldrh r0, [r4] + bl sub_806CF78 + adds r1, r0, 0 + ldr r2, =sub_80FE408 + adds r0, r6, 0 + bl DisplayItemMessageInBattlePyramid +_080FE4AC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FE440 + + thumb_func_start ItemUseInBattle_StatIncrease +ItemUseInBattle_StatIncrease: @ 80FE4B8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x0202406e + ldr r0, =0x020244b8 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x0203ce7c + ldrh r1, [r1] + lsls r2, 24 + lsrs r2, 24 + movs r3, 0 + bl ExecuteTableBasedItemEffect_ + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _080FE52C + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _080FE518 + ldr r2, =gUnknown_085E96F6 + ldr r3, =bag_menu_inits_lists_menu + adds r0, r4, 0 + movs r1, 0x1 + bl DisplayItemMessage + b _080FE53C + .pool +_080FE518: + ldr r1, =gUnknown_085E96F6 + ldr r2, =sub_81C6714 + adds r0, r4, 0 + bl DisplayItemMessageInBattlePyramid + b _080FE53C + .pool +_080FE52C: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80FE440 + str r0, [r1] + strh r2, [r1, 0x18] +_080FE53C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseInBattle_StatIncrease + + thumb_func_start sub_80FE54C +sub_80FE54C: @ 80FE54C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _080FE574 + ldr r0, =0x0203ce54 + ldr r1, [r0] + ldr r0, =sub_81B89F0 + str r0, [r1] + adds r0, r4, 0 + bl unknown_ItemMenu_Confirm + b _080FE582 + .pool +_080FE574: + ldr r0, =0x0203cf2c + ldr r1, [r0] + ldr r0, =sub_81B89F0 + str r0, [r1] + adds r0, r4, 0 + bl sub_81C5B14 +_080FE582: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FE54C + + thumb_func_start ItemUseInBattle_Medicine +ItemUseInBattle_Medicine: @ 80FE590 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03006328 + ldr r1, =ItemUseCB_Medicine + str r1, [r2] + bl sub_80FE54C + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseInBattle_Medicine + + thumb_func_start sub_80FE5AC +sub_80FE5AC: @ 80FE5AC + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03006328 + ldr r1, =sub_81B79E8 + str r1, [r2] + bl sub_80FE54C + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FE5AC + + thumb_func_start ItemUseInBattle_PPRecovery +ItemUseInBattle_PPRecovery: @ 80FE5C8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03006328 + ldr r1, =dp05_ether + str r1, [r2] + bl sub_80FE54C + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseInBattle_PPRecovery + + thumb_func_start ItemUseInBattle_Escape +ItemUseInBattle_Escape: @ 80FE5E4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + bne _080FE634 + bl sub_80FE058 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _080FE620 + ldr r2, =0x02021fc4 + ldr r3, =unknown_ItemMenu_Confirm + adds r0, r4, 0 + movs r1, 0x1 + bl DisplayItemMessage + b _080FE646 + .pool +_080FE620: + ldr r1, =0x02021fc4 + ldr r2, =sub_81C5B14 + adds r0, r4, 0 + bl DisplayItemMessageInBattlePyramid + b _080FE646 + .pool +_080FE634: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrb r1, [r1, 0xE] + adds r0, r4, 0 + bl DisplayDadsAdviceCannotUseItemMessage +_080FE646: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseInBattle_Escape + + thumb_func_start ItemUseOutOfBattle_EnigmaBerry +ItemUseOutOfBattle_EnigmaBerry: @ 80FE650 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0203ce7c + ldrh r0, [r0] + bl GetItemEffectType + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + cmp r0, 0x14 + bls _080FE66A + b _080FE75C +_080FE66A: + lsls r0, 2 + ldr r1, =_080FE67C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080FE67C: + .4byte _080FE708 + .4byte _080FE6D0 + .4byte _080FE6D0 + .4byte _080FE6D0 + .4byte _080FE6D0 + .4byte _080FE6D0 + .4byte _080FE6D0 + .4byte _080FE75C + .4byte _080FE75C + .4byte _080FE6EC + .4byte _080FE6D0 + .4byte _080FE6D0 + .4byte _080FE6D0 + .4byte _080FE6D0 + .4byte _080FE6D0 + .4byte _080FE6D0 + .4byte _080FE6D0 + .4byte _080FE75C + .4byte _080FE724 + .4byte _080FE724 + .4byte _080FE740 +_080FE6D0: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x10] + adds r0, r4, 0 + bl ItemUseOutOfBattle_Medicine + b _080FE770 + .pool +_080FE6EC: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x10] + adds r0, r4, 0 + bl ItemUseOutOfBattle_SacredAsh + b _080FE770 + .pool +_080FE708: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x10] + adds r0, r4, 0 + bl ItemUseOutOfBattle_RareCandy + b _080FE770 + .pool +_080FE724: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x10] + adds r0, r4, 0 + bl ItemUseOutOfBattle_PPUp + b _080FE770 + .pool +_080FE740: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x10] + adds r0, r4, 0 + bl ItemUseOutOfBattle_PPRecovery + b _080FE770 + .pool +_080FE75C: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x4 + strh r0, [r1, 0x10] + adds r0, r4, 0 + bl ItemUseOutOfBattle_CannotUse +_080FE770: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseOutOfBattle_EnigmaBerry + + thumb_func_start ItemUseInBattle_EnigmaBerry +ItemUseInBattle_EnigmaBerry: @ 80FE77C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0203ce7c + ldrh r0, [r0] + bl GetItemEffectType + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x15 + bhi _080FE814 + lsls r0, 2 + ldr r1, =_080FE7A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080FE7A4: + .4byte _080FE7FC + .4byte _080FE814 + .4byte _080FE804 + .4byte _080FE804 + .4byte _080FE804 + .4byte _080FE804 + .4byte _080FE804 + .4byte _080FE804 + .4byte _080FE804 + .4byte _080FE804 + .4byte _080FE814 + .4byte _080FE804 + .4byte _080FE814 + .4byte _080FE814 + .4byte _080FE814 + .4byte _080FE814 + .4byte _080FE814 + .4byte _080FE814 + .4byte _080FE814 + .4byte _080FE814 + .4byte _080FE814 + .4byte _080FE80C +_080FE7FC: + adds r0, r4, 0 + bl ItemUseInBattle_StatIncrease + b _080FE81A +_080FE804: + adds r0, r4, 0 + bl ItemUseInBattle_Medicine + b _080FE81A +_080FE80C: + adds r0, r4, 0 + bl ItemUseInBattle_PPRecovery + b _080FE81A +_080FE814: + adds r0, r4, 0 + bl ItemUseOutOfBattle_CannotUse +_080FE81A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end ItemUseInBattle_EnigmaBerry + + thumb_func_start ItemUseOutOfBattle_CannotUse +ItemUseOutOfBattle_CannotUse: @ 80FE820 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r1, [r1, 0xE] + bl DisplayDadsAdviceCannotUseItemMessage + pop {r0} + bx r0 + .pool + thumb_func_end ItemUseOutOfBattle_CannotUse + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/landmark.s b/asm/landmark.s new file mode 100644 index 000000000..12bb39885 --- /dev/null +++ b/asm/landmark.s @@ -0,0 +1,128 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8145CF4 +sub_8145CF4: @ 8145CF4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + bl sub_8145D48 + adds r4, r0, 0 + cmp r4, 0 + bne _08145D10 +_08145D0C: + movs r0, 0 + b _08145D42 +_08145D10: + ldr r6, =0x0000ffff + b _08145D26 + .pool +_08145D18: + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_08145D1E: + adds r4, 0x4 + ldr r0, [r4] + cmp r0, 0 + beq _08145D0C +_08145D26: + ldr r1, [r4] + ldrh r0, [r1, 0x4] + cmp r0, r6 + beq _08145D3A + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08145D1E +_08145D3A: + cmp r5, 0 + bne _08145D18 + ldr r0, [r4] + ldr r0, [r0] +_08145D42: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8145CF4 + + thumb_func_start sub_8145D48 +sub_8145D48: @ 8145D48 + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + movs r2, 0 + ldr r0, =gUnknown_085B91B8 + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0xD5 + beq _08145DB8 + adds r1, r4, 0 +_08145D60: + lsls r0, r2, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, r3 + bhi _08145DB8 + cmp r0, r3 + beq _08145D7E + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r0, r2, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xD5 + bne _08145D60 +_08145D7E: + lsls r0, r2, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xD5 + bne _08145D98 + b _08145DB8 + .pool +_08145D90: + adds r0, r4, 0x4 + adds r0, r1, r0 + ldr r0, [r0] + b _08145DBA +_08145D98: + cmp r0, r3 + bne _08145DB8 + ldr r5, =gUnknown_085B91B8 +_08145D9E: + lsls r1, r2, 3 + adds r0, r1, r5 + ldrb r0, [r0, 0x1] + cmp r0, r6 + beq _08145D90 + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r0, r2, 3 + adds r0, r4 + ldrb r0, [r0] + cmp r0, r3 + beq _08145D9E +_08145DB8: + movs r0, 0 +_08145DBA: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8145D48 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_80093CC.s b/asm/link.s similarity index 100% rename from asm/rom_80093CC.s rename to asm/link.s diff --git a/asm/load_save.s b/asm/load_save.s new file mode 100644 index 000000000..5a353c701 --- /dev/null +++ b/asm/load_save.s @@ -0,0 +1,757 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start CheckForFlashMemory +@ void CheckForFlashMemory() +CheckForFlashMemory: @ 8076B68 + push {lr} + bl IdentifyFlash + lsls r0, 16 + cmp r0, 0 + bne _08076B84 + ldr r1, =0x03005d88 + movs r0, 0x1 + str r0, [r1] + bl StartFlashMemoryTimer + b _08076B8A + .pool +_08076B84: + ldr r1, =0x03005d88 + movs r0, 0 + str r0, [r1] +_08076B8A: + pop {r0} + bx r0 + .pool + thumb_func_end CheckForFlashMemory + + thumb_func_start memclr_stdsav2 +memclr_stdsav2: @ 8076B94 + push {lr} + sub sp, 0x4 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, =0x02024a54 + ldr r2, =0x010007d6 + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end memclr_stdsav2 + + thumb_func_start clear_sav1 +clear_sav1: @ 8076BB8 + push {lr} + sub sp, 0x4 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, =0x02025a00 + ldr r2, =0x01001f04 + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end clear_sav1 + + thumb_func_start InitSaveBlockPointersWithRandomOffset +@ void InitSaveBlockPointersWithRandomOffset(u8 offset) +InitSaveBlockPointersWithRandomOffset: @ 8076BDC + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r5, =0x03005d8c + bl GenerateRandomNumber + adds r4, r0 + movs r0, 0x7C + ands r4, r0 + ldr r1, =0x03005d90 + ldr r0, =0x02024a54 + adds r0, r4, r0 + str r0, [r1] + ldr r0, =0x02025a00 + adds r0, r4, r0 + str r0, [r5] + ldr r1, =0x03005d94 + ldr r0, =0x02029808 + adds r4, r0 + str r4, [r1] + bl init_bag_pockets + bl sub_81617F4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end InitSaveBlockPointersWithRandomOffset + + thumb_func_start saveblock_randomize_and_relocate +saveblock_randomize_and_relocate: @ 8076C2C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r5, =0x030022c0 + ldr r0, [r5, 0xC] + str r0, [sp] + ldr r1, [r5, 0x10] + str r1, [sp, 0x4] + movs r0, 0 + str r0, [r5, 0xC] + str r0, [r5, 0x10] + ldr r1, =0x0203cf5c + str r0, [r1] + ldr r4, =0x02000000 + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r6, =0x00000f2c + adds r0, r4, 0 + adds r2, r6, 0 + bl memcpy + ldr r1, =0x03005d8c + mov r10, r1 + ldr r1, [r1] + ldr r7, =0x00003d88 + ldr r0, =0x02000f2c + adds r2, r7, 0 + bl memcpy + ldr r0, =0x03005d94 + mov r8, r0 + ldr r1, [r0] + ldr r0, =0x000083d0 + mov r9, r0 + ldr r0, =0x02004cb4 + mov r2, r9 + bl memcpy + ldrb r1, [r4, 0xA] + ldrb r0, [r4, 0xB] + adds r1, r0 + ldrb r0, [r4, 0xC] + adds r1, r0 + ldrb r0, [r4, 0xD] + adds r0, r1 + bl InitSaveBlockPointersWithRandomOffset + ldr r1, =0x03005d90 + ldr r0, [r1] + adds r1, r4, 0 + adds r2, r6, 0 + bl memcpy + mov r1, r10 + ldr r0, [r1] + ldr r1, =0x02000f2c + adds r2, r7, 0 + bl memcpy + mov r1, r8 + ldr r0, [r1] + ldr r1, =0x02004cb4 + mov r2, r9 + bl memcpy + movs r1, 0xE0 + lsls r1, 9 + adds r0, r4, 0 + bl InitHeap + ldr r0, [sp, 0x4] + str r0, [r5, 0x10] + ldr r1, [sp] + str r1, [r5, 0xC] + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsls r0, 16 + lsrs r0, 16 + adds r4, r0 + adds r0, r4, 0 + bl saveblock_apply_crypto + ldr r1, =0x03005d90 + ldr r0, [r1] + adds r0, 0xAC + str r4, [r0] + 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 saveblock_randomize_and_relocate + + thumb_func_start sav2_x1_query_bit1 +sav2_x1_query_bit1: @ 8076D24 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r1, [r0, 0x9] + movs r0, 0x1 + ands r0, r1 + bx lr + .pool + thumb_func_end sav2_x1_query_bit1 + + thumb_func_start sav2_x9_clear_bit1 +sav2_x9_clear_bit1: @ 8076D34 + ldr r0, =0x03005d90 + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0xFE + ands r0, r1 + strb r0, [r2, 0x9] + bx lr + .pool + thumb_func_end sav2_x9_clear_bit1 + + thumb_func_start sub_8076D48 +sub_8076D48: @ 8076D48 + ldr r0, =0x03005d90 + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] + bx lr + .pool + thumb_func_end sub_8076D48 + + thumb_func_start sub_8076D5C +sub_8076D5C: @ 8076D5C + push {lr} + movs r0, 0 + bl sub_8084FAC + ldr r0, =0x03005d90 + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8076D5C + + thumb_func_start sav2_gender2_inplace_and_xFE +sav2_gender2_inplace_and_xFE: @ 8076D78 + ldr r0, =0x03005d90 + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0xFE + ands r0, r1 + strb r0, [r2, 0x9] + bx lr + .pool + thumb_func_end sav2_gender2_inplace_and_xFE + + thumb_func_start copy_player_party_to_sav1 +@ void copy_player_party_to_sav1() +copy_player_party_to_sav1: @ 8076D8C + push {r4,lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x020244e9 + ldrb r1, [r1] + movs r2, 0x8D + lsls r2, 2 + adds r0, r2 + strb r1, [r0] + movs r4, 0 +_08076DA0: + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x64 + muls r1, r4 + adds r0, r1 + movs r2, 0x8E + lsls r2, 2 + adds r0, r2 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0x64 + bl memcpy + adds r4, 0x1 + cmp r4, 0x5 + ble _08076DA0 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end copy_player_party_to_sav1 + + thumb_func_start copy_player_party_from_sav1 +copy_player_party_from_sav1: @ 8076DD4 + push {r4,r5,lr} + ldr r1, =0x020244e9 + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r2, 0x8D + lsls r2, 2 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + movs r4, 0 + ldr r5, =0x020244ec +_08076DEA: + movs r0, 0x64 + adds r2, r4, 0 + muls r2, r0 + adds r0, r2, r5 + ldr r1, =0x03005d8c + ldr r1, [r1] + adds r1, r2 + movs r2, 0x8E + lsls r2, 2 + adds r1, r2 + movs r2, 0x64 + bl memcpy + adds r4, 0x1 + cmp r4, 0x5 + ble _08076DEA + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end copy_player_party_from_sav1 + + thumb_func_start save_serialize_npcs +save_serialize_npcs: @ 8076E1C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x03005d8c + mov r12, r0 + movs r5, 0xA3 + lsls r5, 4 + mov r8, r5 + ldr r4, =0x02037350 + movs r3, 0 + movs r2, 0xF +_08076E32: + mov r6, r12 + ldr r1, [r6] + adds r1, r3 + add r1, r8 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r4, 0x24 + adds r3, 0x24 + subs r2, 0x1 + cmp r2, 0 + bge _08076E32 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end save_serialize_npcs + + thumb_func_start save_deserialize_npcs +save_deserialize_npcs: @ 8076E64 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x03005d8c + mov r12, r0 + movs r5, 0xA3 + lsls r5, 4 + mov r8, r5 + ldr r4, =0x02037350 + movs r3, 0 + movs r2, 0xF +_08076E7A: + mov r6, r12 + ldr r1, [r6] + adds r1, r3 + adds r0, r4, 0 + add r1, r8 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + adds r4, 0x24 + adds r3, 0x24 + subs r2, 0x1 + cmp r2, 0 + bge _08076E7A + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end save_deserialize_npcs + + thumb_func_start save_serialize_game +save_serialize_game: @ 8076EAC + push {lr} + bl copy_player_party_to_sav1 + bl save_serialize_npcs + pop {r0} + bx r0 + thumb_func_end save_serialize_game + + thumb_func_start save_deserialize_game +save_deserialize_game: @ 8076EBC + push {lr} + bl copy_player_party_from_sav1 + bl save_deserialize_npcs + pop {r0} + bx r0 + thumb_func_end save_deserialize_game + + thumb_func_start copy_bags_and_unk_data_from_save_blocks +copy_bags_and_unk_data_from_save_blocks: @ 8076ECC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r2, 0 + ldr r0, =0x02032180 + mov r12, r0 + ldr r1, =0x03005d90 + mov r10, r1 + ldr r5, =0x03005d8c + movs r3, 0xAC + lsls r3, 3 + ldr r4, =0x02031c58 +_08076EE8: + lsls r0, r2, 2 + ldr r1, [r5] + adds r1, r3 + adds r1, r0 + ldr r0, [r1] + stm r4!, {r0} + adds r2, 0x1 + cmp r2, 0x1D + ble _08076EE8 + movs r2, 0 + ldr r0, =0x02031c58 + ldr r5, =0x03005d8c + movs r3, 0xBB + lsls r3, 3 + adds r4, r0, 0 + adds r4, 0x78 +_08076F08: + lsls r0, r2, 2 + ldr r1, [r5] + adds r1, r3 + adds r1, r0 + ldr r0, [r1] + stm r4!, {r0} + adds r2, 0x1 + cmp r2, 0x1D + ble _08076F08 + movs r2, 0 + ldr r0, =0x02031c58 + ldr r5, =0x03005d8c + movs r3, 0xCA + lsls r3, 3 + adds r4, r0, 0 + adds r4, 0xF0 +_08076F28: + lsls r0, r2, 2 + ldr r1, [r5] + adds r1, r3 + adds r1, r0 + ldr r0, [r1] + stm r4!, {r0} + adds r2, 0x1 + cmp r2, 0xF + ble _08076F28 + movs r2, 0 + ldr r0, =0x02031c58 + ldr r5, =0x03005d8c + movs r6, 0x98 + lsls r6, 1 + adds r4, r0, r6 + movs r3, 0xD2 + lsls r3, 3 +_08076F4A: + lsls r0, r2, 2 + ldr r1, [r5] + adds r1, r3 + adds r1, r0 + ldr r0, [r1] + stm r4!, {r0} + adds r2, 0x1 + cmp r2, 0x3F + ble _08076F4A + movs r2, 0 + ldr r0, =0x02031c58 + ldr r5, =0x03005d8c + movs r7, 0x8C + lsls r7, 2 + adds r4, r0, r7 + movs r3, 0xF2 + lsls r3, 3 +_08076F6C: + lsls r0, r2, 2 + ldr r1, [r5] + adds r1, r3 + adds r1, r0 + ldr r0, [r1] + stm r4!, {r0} + adds r2, 0x1 + cmp r2, 0x2D + ble _08076F6C + ldr r0, =0x02031c58 + ldr r1, =0x03005d8c + mov r8, r1 + movs r5, 0xBA + lsls r5, 2 + adds r4, r0, r5 + movs r3, 0 + ldr r6, =0x00002be0 + mov r9, r6 + movs r2, 0xF +_08076F92: + mov r7, r8 + ldr r1, [r7] + adds r1, r3 + adds r0, r4, 0 + add r1, r9 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + adds r4, 0x24 + adds r3, 0x24 + subs r2, 0x1 + cmp r2, 0 + bge _08076F92 + mov r1, r10 + ldr r0, [r1] + adds r0, 0xAC + ldr r0, [r0] + mov r5, r12 + str r0, [r5] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end copy_bags_and_unk_data_from_save_blocks + + thumb_func_start copy_bags_and_unk_data_to_save_blocks +copy_bags_and_unk_data_to_save_blocks: @ 8076FE0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r2, 0 + ldr r0, =0x03005d90 + mov r8, r0 + ldr r1, =0x02032180 + mov r12, r1 + ldr r5, =0x03005d8c + movs r3, 0xAC + lsls r3, 3 + ldr r4, =0x02031c58 +_08076FFC: + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r3 + adds r0, r1 + ldm r4!, {r1} + str r1, [r0] + adds r2, 0x1 + cmp r2, 0x1D + ble _08076FFC + movs r2, 0 + ldr r5, =0x03005d8c + movs r4, 0xBB + lsls r4, 3 + ldr r0, =0x02031c58 + adds r3, r0, 0 + adds r3, 0x78 +_0807701C: + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r4 + adds r0, r1 + ldm r3!, {r1} + str r1, [r0] + adds r2, 0x1 + cmp r2, 0x1D + ble _0807701C + movs r2, 0 + ldr r5, =0x03005d8c + movs r4, 0xCA + lsls r4, 3 + ldr r0, =0x02031c58 + adds r3, r0, 0 + adds r3, 0xF0 +_0807703C: + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r4 + adds r0, r1 + ldm r3!, {r1} + str r1, [r0] + adds r2, 0x1 + cmp r2, 0xF + ble _0807703C + movs r2, 0 + ldr r5, =0x03005d8c + movs r4, 0xD2 + lsls r4, 3 + ldr r0, =0x02031c58 + movs r6, 0x98 + lsls r6, 1 + adds r3, r0, r6 +_0807705E: + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r4 + adds r0, r1 + ldm r3!, {r1} + str r1, [r0] + adds r2, 0x1 + cmp r2, 0x3F + ble _0807705E + movs r2, 0 + ldr r5, =0x03005d8c + movs r4, 0xF2 + lsls r4, 3 + ldr r0, =0x02031c58 + movs r7, 0x8C + lsls r7, 2 + adds r3, r0, r7 +_08077080: + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r4 + adds r0, r1 + ldm r3!, {r1} + str r1, [r0] + adds r2, 0x1 + cmp r2, 0x2D + ble _08077080 + ldr r0, =0x03005d8c + mov r9, r0 + ldr r1, =0x00002be0 + mov r10, r1 + ldr r4, =0x02031c58 + movs r3, 0 + movs r2, 0xF +_080770A0: + mov r5, r9 + ldr r1, [r5] + adds r1, r3 + add r1, r10 + movs r6, 0xBA + lsls r6, 2 + adds r0, r4, r6 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r4, 0x24 + adds r3, 0x24 + subs r2, 0x1 + cmp r2, 0 + bge _080770A0 + mov r7, r8 + ldr r0, [r7] + adds r0, 0xAC + ldr r4, [r0] + mov r2, r12 + ldr r1, [r2] + str r1, [r0] + adds r0, r4, 0 + bl encrypt_decrypt_all_item_quantities + ldr r0, [r7] + adds r0, 0xAC + str r4, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end copy_bags_and_unk_data_to_save_blocks + + thumb_func_start apply_u16_xor_crypto +apply_u16_xor_crypto: @ 8077100 + ldr r2, =0x03005d90 + ldr r2, [r2] + adds r2, 0xAC + ldr r2, [r2] + ldrh r3, [r0] + eors r2, r3 + eors r2, r1 + strh r2, [r0] + bx lr + .pool + thumb_func_end apply_u16_xor_crypto + + thumb_func_start apply_u32_xor_crypto +apply_u32_xor_crypto: @ 8077118 + ldr r2, =0x03005d90 + ldr r3, [r2] + adds r3, 0xAC + ldr r2, [r0] + ldr r3, [r3] + eors r2, r3 + eors r2, r1 + str r2, [r0] + bx lr + .pool + thumb_func_end apply_u32_xor_crypto + + thumb_func_start saveblock_apply_crypto +saveblock_apply_crypto: @ 8077130 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_8084864 + adds r0, r4, 0 + bl call_encrypt_decrypt_all_item_quantities + adds r0, r4, 0 + bl sub_8024690 + ldr r5, =0x03005d8c + ldr r0, [r5] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + adds r1, r4, 0 + bl apply_u32_xor_crypto + ldr r0, [r5] + ldr r1, =0x00000494 + adds r0, r1 + adds r1, r4, 0 + bl apply_u16_xor_crypto + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end saveblock_apply_crypto + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/lottery_corner.s b/asm/lottery_corner.s new file mode 100644 index 000000000..25415a498 --- /dev/null +++ b/asm/lottery_corner.s @@ -0,0 +1,381 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8177558 +sub_8177558: @ 8177558 + push {r4,lr} + bl GenerateRandomNumber + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl GenerateRandomNumber + lsls r0, 16 + orrs r0, r4 + bl sub_8177814 + ldr r0, =0x00004045 + movs r1, 0 + bl VarSet + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8177558 + + thumb_func_start sub_8177584 +sub_8177584: @ 8177584 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r1, r0, 16 + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x0000ffff + cmp r4, r0 + beq _081775B4 + ldr r5, =0x41c64e6d + ldr r3, =0x00003039 + adds r2, r0, 0 +_081775A4: + adds r0, r1, 0 + muls r0, r5 + adds r1, r0, r3 + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r2 + bne _081775A4 +_081775B4: + adds r0, r1, 0 + bl sub_8177814 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8177584 + + thumb_func_start sub_81775CC +sub_81775CC: @ 81775CC + push {lr} + bl sub_817783C + ldr r1, =0x020375f0 + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_81775CC + + thumb_func_start sub_81775E0 +sub_81775E0: @ 81775E0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r1, =0x020375e0 + movs r0, 0 + strh r0, [r1] + movs r0, 0 + str r0, [sp, 0x4] + movs r1, 0 + str r1, [sp] + movs r7, 0 +_081775FC: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _08177658 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0817764E + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr + adds r1, r0, 0 + ldr r0, =0x020375f0 + ldrh r0, [r0] + lsls r1, 16 + lsrs r1, 16 + bl sub_817778C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020375e0 + ldrh r2, [r1] + cmp r0, r2 + bls _0817764E + cmp r0, 0x1 + bls _0817764E + subs r0, 0x1 + strh r0, [r1] + movs r0, 0xE + str r0, [sp] + str r7, [sp, 0x4] +_0817764E: + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0x5 + bls _081775FC +_08177658: + movs r7, 0 + ldr r1, =0x03005d94 + mov r9, r1 +_0817765E: + movs r6, 0 + adds r2, r7, 0x1 + mov r10, r2 + lsls r0, r7, 2 + adds r0, r7 + mov r8, r0 +_0817766A: + mov r1, r8 + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 5 + adds r5, r0, 0x4 + mov r2, r9 + ldr r0, [r2] + adds r0, r5 + lsls r1, r6, 2 + adds r1, r6 + lsls r4, r1, 4 + adds r0, r4 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _081776D2 + mov r1, r9 + ldr r0, [r1] + adds r0, r5 + adds r0, r4 + movs r1, 0x2D + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _081776D2 + mov r2, r9 + ldr r0, [r2] + adds r0, r5 + adds r0, r4 + movs r1, 0x1 + bl pokemon_getattr_encrypted + adds r1, r0, 0 + ldr r0, =0x020375f0 + ldrh r0, [r0] + lsls r1, 16 + lsrs r1, 16 + bl sub_817778C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020375e0 + ldrh r2, [r1] + cmp r0, r2 + bls _081776D2 + cmp r0, 0x1 + bls _081776D2 + subs r0, 0x1 + strh r0, [r1] + str r7, [sp] + str r6, [sp, 0x4] +_081776D2: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x1D + bls _0817766A + mov r1, r10 + lsls r0, r1, 16 + lsrs r7, r0, 16 + cmp r7, 0xD + bls _0817765E + ldr r3, =0x020375e0 + ldrh r0, [r3] + cmp r0, 0 + beq _0817776E + ldr r2, =0x020375e2 + ldr r1, =gUnknown_085E7080 + subs r0, 0x1 + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + ldr r2, [sp] + cmp r2, 0xE + bne _0817773C + ldr r1, =0x020375e4 + movs r0, 0 + strh r0, [r1] + movs r0, 0x64 + ldr r1, [sp, 0x4] + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r2, =0x02021cc4 + movs r1, 0x2 + bl pokemon_getattr + b _08177768 + .pool +_0817773C: + ldr r1, =0x020375e4 + movs r0, 0x1 + strh r0, [r1] + ldr r2, =0x03005d94 + ldr r1, [sp] + lsls r0, r1, 2 + adds r0, r1 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 5 + adds r1, 0x4 + ldr r0, [r2] + adds r0, r1 + ldr r2, [sp, 0x4] + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 4 + adds r0, r1 + ldr r2, =0x02021cc4 + movs r1, 0x2 + bl pokemon_getattr_encrypted +_08177768: + ldr r0, =0x02021cc4 + bl GetStringEnd_Limit7 +_0817776E: + 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_81775E0 + + thumb_func_start sub_817778C +sub_817778C: @ 817778C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 16 + lsrs r5, r1, 16 + movs r0, 0 + mov r8, r0 + movs r7, 0 + ldr r1, =0x0203bcec + mov r10, r1 + ldr r0, =0x0203bcee + mov r9, r0 +_081777AC: + adds r0, r6, 0 + movs r1, 0xA + bl __umodsi3 + adds r4, r0, 0 + mov r1, r10 + strh r4, [r1] + adds r0, r5, 0 + movs r1, 0xA + bl __umodsi3 + mov r1, r9 + strh r0, [r1] + lsls r4, 16 + lsls r0, 16 + cmp r4, r0 + bne _081777FA + adds r0, r6, 0 + movs r1, 0xA + bl __udivsi3 + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r5, 0 + movs r1, 0xA + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x4 + bls _081777AC +_081777FA: + mov r0, r8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817778C + + thumb_func_start sub_8177814 +sub_8177814: @ 8177814 + push {r4,lr} + adds r1, r0, 0 + lsrs r4, r1, 16 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =0x0000404b + bl VarSet + ldr r0, =0x0000404c + adds r1, r4, 0 + bl VarSet + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8177814 + + thumb_func_start sub_817783C +sub_817783C: @ 817783C + push {r4,lr} + ldr r0, =0x0000404b + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =0x0000404c + bl VarGet + lsls r0, 16 + orrs r0, r4 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817783C + + thumb_func_start sub_8177864 +sub_8177864: @ 8177864 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_8177814 + pop {r0} + bx r0 + thumb_func_end sub_8177864 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/mail.s b/asm/mail.s new file mode 100644 index 000000000..a3dfd57a3 --- /dev/null +++ b/asm/mail.s @@ -0,0 +1,1035 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8121478 +sub_8121478: @ 8121478 + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r4, =0x0203a134 + ldr r0, =0x0000222c + bl AllocZeroed + str r0, [r4] + ldr r1, =0x0000021d + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r4] + ldr r2, =0x0000021e + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] + ldr r4, [r4] + movs r3, 0x88 + lsls r3, 2 + adds r1, r4, r3 + ldr r0, =CopyEasyChatWord + str r0, [r1] + movs r0, 0x89 + lsls r0, 2 + adds r1, r4, r0 + ldr r0, =ConvertEasyChatWordsToString + str r0, [r1] + ldrh r1, [r5, 0x20] + adds r0, r1, 0 + subs r0, 0x79 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xB + bhi _081214E8 + subs r1, 0x79 + subs r2, 0x4 + adds r0, r4, r2 + strb r1, [r0] + b _081214F2 + .pool +_081214E8: + ldr r3, =0x0000021a + adds r1, r4, r3 + movs r0, 0 + strb r0, [r1] + movs r6, 0 +_081214F2: + ldr r0, =0x0203a134 + ldr r1, [r0] + ldr r2, =0x0000021e + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _08121504 + cmp r0, 0x1 + beq _0812152C +_08121504: + movs r3, 0x8A + lsls r3, 2 + adds r2, r1, r3 + subs r3, 0xE + adds r0, r1, r3 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_0859F3B4 + b _08121540 + .pool +_0812152C: + movs r0, 0x8A + lsls r0, 2 + adds r2, r1, r0 + ldr r3, =0x0000021a + adds r0, r1, r3 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_0859F458 +_08121540: + adds r0, r1 + str r0, [r2] + ldrh r0, [r5, 0x1E] + mov r1, sp + bl sub_80D45E8 + lsls r0, 16 + ldr r1, =0xffff0000 + adds r0, r1 + movs r1, 0xCD + lsls r1, 17 + cmp r0, r1 + bhi _081215AC + ldr r1, =0x0203a134 + ldr r2, [r1] + ldr r3, =0x0000021a + adds r0, r2, r3 + ldrb r0, [r0] + adds r3, r1, 0 + cmp r0, 0x6 + beq _0812158C + cmp r0, 0x9 + beq _0812159C + ldr r0, =0x0000021b + adds r1, r2, r0 + movs r0, 0 + strb r0, [r1] + b _081215BA + .pool +_0812158C: + ldr r0, =0x0000021b + adds r1, r2, r0 + movs r0, 0x1 + strb r0, [r1] + b _081215BA + .pool +_0812159C: + ldr r0, =0x0000021b + adds r1, r2, r0 + movs r0, 0x2 + strb r0, [r1] + b _081215BA + .pool +_081215AC: + ldr r0, =0x0203a134 + ldr r1, [r0] + ldr r2, =0x0000021b + adds r1, r2 + movs r2, 0 + strb r2, [r1] + adds r3, r0, 0 +_081215BA: + ldr r1, [r3] + movs r3, 0x85 + lsls r3, 2 + adds r0, r1, r3 + str r5, [r0] + movs r2, 0x83 + lsls r2, 2 + adds r0, r1, r2 + str r7, [r0] + adds r3, 0x4 + adds r0, r1, r3 + strb r6, [r0] + ldr r0, =sub_81219F0 + bl SetMainCallback2 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8121478 + + thumb_func_start sub_81215EC +sub_81215EC: @ 81215EC + push {r4-r6,lr} + sub sp, 0xC + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x12 + bls _08121600 + b _081219E2 +_08121600: + lsls r0, 2 + ldr r1, =_08121614 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08121614: + .4byte _08121660 + .4byte _0812166E + .4byte _08121688 + .4byte _0812168E + .4byte _08121694 + .4byte _0812169A + .4byte _081216F4 + .4byte _08121730 + .4byte _08121740 + .4byte _08121774 + .4byte _08121782 + .4byte _081217D8 + .4byte _081217EC + .4byte _081218B0 + .4byte _081218CC + .4byte _081218EC + .4byte _081218F6 + .4byte _08121910 + .4byte _08121980 +_08121660: + movs r0, 0 + bl SetVBlankCallback + bl remove_some_task + movs r0, 0 + b _081216EC +_0812166E: + add r1, sp, 0x8 + movs r0, 0 + strh r0, [r1] + movs r1, 0xE0 + lsls r1, 19 + ldr r2, =0x01000200 + add r0, sp, 0x8 + bl CpuSet + b _081219D4 + .pool +_08121688: + bl sub_80A1A74 + b _081219D4 +_0812168E: + bl ResetTasks + b _081219D4 +_08121694: + bl ResetAllObjectData + b _081219D4 +_0812169A: + bl ResetObjectPaletteAllocator + bl reset_temp_tile_data_buffers + movs r0, 0x10 + movs r1, 0 + bl SetGpuReg + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + movs r0, 0x16 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg + movs r0, 0x18 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1C + movs r1, 0 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 +_081216EC: + movs r1, 0 + bl SetGpuReg + b _081219D4 +_081216F4: + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0859F290 + movs r0, 0 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r4, =0x0203a134 + ldr r1, [r4] + movs r2, 0x8B + lsls r2, 2 + adds r1, r2 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x0000122c + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + b _081219D4 + .pool +_08121730: + ldr r0, =gUnknown_0859F29C + bl InitWindows + bl DeactivateAllTextPrinters + b _081219D4 + .pool +_08121740: + ldr r2, =gUnknown_0859F2B8 + ldr r0, =0x0203a134 + ldr r0, [r0] + ldr r1, =0x0000021a + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x4 + adds r0, r2 + ldr r1, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _081219D4 + .pool +_08121774: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _08121780 + b _081219D4 +_08121780: + b _081219E2 +_08121782: + movs r5, 0x1E + str r5, [sp] + movs r4, 0x14 + str r4, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + ldr r2, =gUnknown_0859F2B8 + ldr r0, =0x0203a134 + ldr r0, [r0] + ldr r1, =0x0000021a + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x8 + adds r0, r2 + ldr r1, [r0] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + b _081219D4 + .pool +_081217D8: + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + b _081219D4 +_081217EC: + bl sub_8098C64 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r6, =0x02037714 + ldr r4, =gUnknown_0859F2B8 + ldr r0, =0x0203a134 + ldr r3, [r0] + ldr r2, =0x0000021a + adds r3, r2 + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x10] + subs r2, 0x26 + adds r0, r6, r2 + strh r1, [r0] + ldr r5, =0x02037b14 + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x10] + adds r2, r5, r2 + strh r0, [r2] + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x12] + movs r2, 0xFB + lsls r2, 1 + adds r0, r6, r2 + strh r1, [r0] + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x12] + adds r2, r5, r2 + strh r0, [r2] + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =gUnknown_0859F2B0 + ldr r0, =0x03005d90 + ldr r2, [r0] + ldrb r0, [r2, 0x8] + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r6, 0x14] + ldrb r0, [r2, 0x8] + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r5, 0x14] + ldrb r0, [r2, 0x8] + lsls r0, 2 + adds r1, 0x2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r6, 0x16] + ldrb r0, [r2, 0x8] + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r5, 0x16] + b _081219D4 + .pool +_081218B0: + ldr r0, =0x0203a134 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081218C2 + b _081219D4 +_081218C2: + bl sub_8121A1C + b _081219D4 + .pool +_081218CC: + ldr r0, =0x0203a134 + ldr r0, [r0] + movs r2, 0x86 + lsls r2, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _081218DE + b _081219D4 +_081218DE: + bl sub_8121B1C + bl RunTextPrinters + b _081219D4 + .pool +_081218EC: + bl sub_8087598 + cmp r0, 0x1 + bne _081219D4 + b _081219E2 +_081218F6: + ldr r0, =sub_8121C50 + bl SetVBlankCallback + ldr r2, =0x02037fd4 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + b _081219D4 + .pool +_08121910: + ldr r5, =0x0203a134 + ldr r0, [r5] + movs r1, 0x85 + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + ldrh r0, [r0, 0x1E] + bl sub_80D2E84 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, [r5] + ldr r2, =0x0000021b + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08121940 + cmp r0, 0x2 + beq _08121958 + b _081219D4 + .pool +_08121940: + adds r0, r4, 0 + bl sub_80D2F68 + ldr r1, =DummyObjectCallback + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r2, 0x60 + b _0812196A + .pool +_08121958: + adds r0, r4, 0 + bl sub_80D2F68 + ldr r1, =DummyObjectCallback + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r2, 0x28 +_0812196A: + movs r3, 0x80 + bl sub_80D2D78 + ldr r1, [r5] + movs r2, 0x87 + lsls r2, 2 + adds r1, r2 + strb r0, [r1] + b _081219D4 + .pool +_08121980: + 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, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + ldr r0, =0x0203a134 + ldr r0, [r0] + movs r1, 0x84 + lsls r1, 2 + adds r0, r1 + ldr r1, =sub_8121C98 + str r1, [r0] + movs r0, 0x1 + b _081219E4 + .pool +_081219D4: + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081219E2: + movs r0, 0 +_081219E4: + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81215EC + + thumb_func_start sub_81219F0 +sub_81219F0: @ 81219F0 + push {lr} +_081219F2: + bl sub_81215EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08121A0C + ldr r0, =sub_8121C64 + bl SetMainCallback2 + b _08121A18 + .pool +_08121A0C: + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081219F2 +_08121A18: + pop {r0} + bx r0 + thumb_func_end sub_81219F0 + + thumb_func_start sub_8121A1C +sub_8121A1C: @ 8121A1C + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r6, 0 + movs r5, 0 + ldr r2, =0x0203a134 + ldr r0, [r2] + movs r1, 0x8A + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + ldrb r0, [r0] + cmp r5, r0 + bcs _08121A8A + mov r8, r2 + adds r7, r1, 0 +_08121A3C: + lsls r0, r5, 6 + mov r1, r8 + ldr r2, [r1] + adds r0, r2, r0 + movs r3, 0x85 + lsls r3, 2 + adds r1, r2, r3 + lsls r3, r6, 1 + ldr r1, [r1] + adds r1, r3 + adds r2, r7 + ldr r2, [r2] + ldr r2, [r2, 0x8] + lsls r4, r5, 2 + adds r2, r4, r2 + ldr r2, [r2] + lsls r2, 30 + lsrs r2, 30 + movs r3, 0x1 + bl ConvertEasyChatWordsToString + mov r1, r8 + ldr r0, [r1] + adds r0, r7 + ldr r1, [r0] + ldr r0, [r1, 0x8] + adds r4, r0 + ldr r0, [r4] + lsls r0, 30 + lsrs r0, 30 + adds r0, r6, r0 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldrb r1, [r1] + cmp r5, r1 + bcc _08121A3C +_08121A8A: + ldr r4, =0x0203a134 + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 2 + adds r0, r1, r2 + movs r3, 0x85 + lsls r3, 2 + adds r1, r3 + ldr r1, [r1] + adds r1, 0x12 + bl CopyString + adds r2, r0, 0 + ldr r1, [r4] + ldr r3, =0x0000021e + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _08121AF0 + ldr r1, =gUnknown_085EEA78 + adds r0, r2, 0 + bl CopyString + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 2 + adds r0, r1 + bl GetStringLength + ldr r2, [r4] + movs r3, 0x8A + lsls r3, 2 + adds r1, r2, r3 + ldr r1, [r1] + lsls r0, 16 + lsrs r0, 13 + subs r0, 0x60 + ldrb r1, [r1, 0x2] + subs r1, r0 + ldr r0, =0x00000219 + adds r2, r0 + strb r1, [r2] + b _08121B0C + .pool +_08121AF0: + movs r2, 0x80 + lsls r2, 2 + adds r0, r1, r2 + bl sub_81DB52C + ldr r0, [r4] + movs r3, 0x8A + lsls r3, 2 + adds r1, r0, r3 + ldr r1, [r1] + ldrb r1, [r1, 0x2] + ldr r2, =0x00000219 + adds r0, r2 + strb r1, [r0] +_08121B0C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8121A1C + + thumb_func_start sub_8121B1C +sub_8121B1C: @ 8121B1C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + movs r7, 0 + movs r0, 0 + bl PutWindowTilemap + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r6, 0 + ldr r1, =0x0203a134 + ldr r0, [r1] + movs r2, 0x8A + lsls r2, 2 + mov r10, r2 + add r0, r10 + ldr r0, [r0] + ldrb r0, [r0] + cmp r6, r0 + bcs _08121BCC + mov r9, r1 + mov r8, r10 +_08121B60: + mov r0, r9 + ldr r1, [r0] + lsls r0, r6, 6 + adds r5, r1, r0 + ldrb r0, [r5] + cmp r0, 0xFF + beq _08121BB8 + cmp r0, 0 + beq _08121BB8 + mov r2, r8 + adds r0, r1, r2 + ldr r1, [r0] + ldr r0, [r1, 0x8] + lsls r4, r6, 2 + adds r0, r4, r0 + ldr r2, [r0] + lsls r2, 24 + lsrs r2, 26 + ldrb r0, [r1, 0x4] + adds r2, r0 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r1, 0x3] + adds r3, r7, r3 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =gUnknown_0859F2AC + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x1 + bl box_print + mov r1, r9 + ldr r0, [r1] + add r0, r8 + ldr r0, [r0] + ldr r0, [r0, 0x8] + adds r4, r0 + ldrb r0, [r4, 0x1] + adds r0, r7, r0 + lsls r0, 24 + lsrs r7, r0, 24 +_08121BB8: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r2, =0x0203a134 + ldr r0, [r2] + add r0, r10 + ldr r0, [r0] + ldrb r0, [r0] + cmp r6, r0 + bcc _08121B60 +_08121BCC: + ldr r1, =gUnknown_085EEA78 + add r0, sp, 0xC + bl CopyString + ldr r4, =0x0203a134 + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 2 + adds r1, r2 + bl CopyString + ldr r0, [r4] + ldr r1, =0x00000219 + adds r0, r1 + ldrb r2, [r0] + movs r0, 0x1 + add r1, sp, 0xC + bl GetStringCenterAlignXOffset + adds r2, r0, 0 + adds r2, 0x68 + ldr r0, [r4] + movs r1, 0x8A + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + ldrb r3, [r0, 0x1] + adds r3, 0x58 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =gUnknown_0859F2AC + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + bl box_print + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram + 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_8121B1C + + thumb_func_start sub_8121C50 +sub_8121C50: @ 8121C50 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8121C50 + + thumb_func_start sub_8121C64 +sub_8121C64: @ 8121C64 + push {r4,lr} + ldr r4, =0x0203a134 + ldr r0, [r4] + ldr r1, =0x0000021b + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08121C7C + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad +_08121C7C: + ldr r0, [r4] + movs r1, 0x84 + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8121C64 + + thumb_func_start sub_8121C98 +sub_8121C98: @ 8121C98 + push {lr} + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _08121CB2 + ldr r0, =0x0203a134 + ldr r0, [r0] + movs r1, 0x84 + lsls r1, 2 + adds r0, r1 + ldr r1, =sub_8121CC0 + str r1, [r0] +_08121CB2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8121C98 + + thumb_func_start sub_8121CC0 +sub_8121CC0: @ 8121CC0 + push {lr} + sub sp, 0x4 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08121CEE + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x0203a134 + ldr r0, [r0] + movs r1, 0x84 + lsls r1, 2 + adds r0, r1 + ldr r1, =sub_8121D00 + str r1, [r0] +_08121CEE: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8121CC0 + + thumb_func_start sub_8121D00 +sub_8121D00: @ 8121D00 + push {r4,lr} + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _08121D88 + ldr r4, =0x0203a134 + ldr r0, [r4] + movs r1, 0x83 + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + bl SetMainCallback2 + ldr r1, [r4] + ldr r2, =0x0000021b + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x2 + bgt _08121D58 + cmp r0, 0x1 + blt _08121D58 + subs r2, 0x7 + adds r0, r1, r2 + ldr r0, [r0] + ldrh r0, [r0, 0x1E] + bl sub_80D2E84 + lsls r0, 16 + lsrs r0, 16 + bl sub_80D2FF0 + ldr r0, [r4] + movs r1, 0x87 + lsls r1, 2 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl sub_80D2EF8 +_08121D58: + ldr r4, =0x0203a134 + ldr r0, [r4] + ldr r2, =0x0000222c + movs r1, 0 + bl memset + bl sub_80A1A74 + movs r0, 0 + bl UnsetBgTilemapBuffer + movs r0, 0x1 + bl UnsetBgTilemapBuffer + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + bl FreeAllWindowBuffers + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] +_08121D88: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8121D00 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/main.s b/asm/main.s index c1561f851..ffb6fec9d 100644 --- a/asm/main.s +++ b/asm/main.s @@ -1,4 +1,5 @@ .include "asm/macros.inc" + .include "constants/constants.inc" .syntax unified diff --git a/asm/main_menu.s b/asm/main_menu.s index 3ae2788c7..b908bc68f 100644 --- a/asm/main_menu.s +++ b/asm/main_menu.s @@ -1,4 +1,5 @@ .include "asm/macros.inc" + .include "constants/constants.inc" .syntax unified diff --git a/asm/map_obj_8097404.s b/asm/map_obj_8097404.s new file mode 100644 index 000000000..c2a2d6091 --- /dev/null +++ b/asm/map_obj_8097404.s @@ -0,0 +1,1861 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8097404 +@ bool8 sub_8097404(struct npc_state *fieldObject) +sub_8097404: @ 8097404 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r1, [r5] + movs r0, 0xA0 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + bne _0809748C + ldrb r0, [r5, 0x1] + movs r4, 0x1 + orrs r0, r4 + strb r0, [r5, 0x1] + ldr r3, =0x02020630 + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x2C + ldrb r1, [r0] + lsls r1, 25 + lsrs r1, 31 + lsls r1, 7 + ldrb r2, [r5, 0x2] + movs r0, 0x7F + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x2] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x2C + ldrb r1, [r0] + lsrs r1, 7 + ands r1, r4 + ldrb r2, [r5, 0x3] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x3] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] + movs r0, 0 + b _0809748E + .pool +_0809748C: + movs r0, 0x1 +_0809748E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8097404 + + thumb_func_start player_bitmagic +@ void player_bitmagic() +player_bitmagic: @ 8097494 + push {r4,r5,lr} + movs r4, 0 + ldr r5, =0x02037350 +_0809749A: + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + adds r1, r0, r5 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + beq _080974B8 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + cmp r4, r0 + beq _080974B8 + adds r0, r1, 0 + bl sub_8097404 +_080974B8: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _0809749A + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end player_bitmagic + + thumb_func_start sub_80974D0 +sub_80974D0: @ 80974D0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r6, =0x02037350 +_080974DA: + cmp r4, r5 + beq _080974FC + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + adds r1, r0, r6 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + beq _080974FC + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + cmp r4, r0 + beq _080974FC + adds r0, r1, 0 + bl sub_8097404 +_080974FC: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _080974DA + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80974D0 + + thumb_func_start npc_sync_anim_pause_bits +@ void npc_sync_anim_pause_bits(struct npc_state *fieldObject) +npc_sync_anim_pause_bits: @ 8097514 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r2, [r5] + ldr r1, =0x00000101 + adds r0, r1, 0 + ands r0, r2 + cmp r0, r1 + bne _0809756C + ldrb r1, [r5, 0x1] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r5, 0x1] + ldr r4, =0x02020630 + ldrb r0, [r5, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r5, 0x2] + adds r1, 0x2C + lsrs r2, 7 + lsls r2, 6 + ldrb r3, [r1] + movs r0, 0x41 + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1] + ldrb r0, [r5, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + ldrb r1, [r5, 0x3] + lsls r1, 31 + lsrs r1, 31 + adds r2, 0x2C + lsls r1, 7 + ldrb r3, [r2] + movs r0, 0x7F + ands r0, r3 + orrs r0, r1 + strb r0, [r2] +_0809756C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end npc_sync_anim_pause_bits + + thumb_func_start sub_809757C +sub_809757C: @ 809757C + push {r4,r5,lr} + movs r4, 0 + ldr r5, =0x02037350 +_08097582: + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + adds r1, r0, r5 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + beq _08097598 + adds r0, r1, 0 + bl npc_sync_anim_pause_bits +_08097598: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _08097582 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809757C + + thumb_func_start little_step +@ void little_step(struct obj *object, u8 direction) +little_step: @ 80975AC + lsls r1, 24 + ldr r2, =gUnknown_0850DB7C + lsrs r1, 22 + adds r1, r2 + ldrh r2, [r1] + ldrh r3, [r0, 0x20] + adds r2, r3 + strh r2, [r0, 0x20] + ldrh r1, [r1, 0x2] + ldrh r2, [r0, 0x22] + adds r1, r2 + strh r1, [r0, 0x22] + bx lr + .pool + thumb_func_end little_step + + thumb_func_start double_little_steps +double_little_steps: @ 80975CC + lsls r1, 24 + ldr r2, =gUnknown_0850DB7C + lsrs r1, 22 + adds r1, r2 + ldrh r2, [r1] + lsls r2, 1 + ldrh r3, [r0, 0x20] + adds r2, r3 + strh r2, [r0, 0x20] + ldrh r1, [r1, 0x2] + lsls r1, 1 + ldrh r2, [r0, 0x22] + adds r1, r2 + strh r1, [r0, 0x22] + bx lr + .pool + thumb_func_end double_little_steps + + thumb_func_start triple_little_steps +triple_little_steps: @ 80975F0 + lsls r1, 24 + ldr r2, =gUnknown_0850DB7C + lsrs r1, 22 + adds r1, r2 + ldrh r2, [r1] + lsls r3, r2, 1 + adds r2, r3 + ldrh r3, [r0, 0x20] + adds r2, r3 + strh r2, [r0, 0x20] + ldrh r1, [r1, 0x2] + lsls r2, r1, 1 + adds r1, r2 + ldrh r2, [r0, 0x22] + adds r1, r2 + strh r1, [r0, 0x22] + bx lr + .pool + thumb_func_end triple_little_steps + + thumb_func_start quad_little_steps +quad_little_steps: @ 8097618 + lsls r1, 24 + ldr r2, =gUnknown_0850DB7C + lsrs r1, 22 + adds r1, r2 + ldrh r2, [r1] + lsls r2, 2 + ldrh r3, [r0, 0x20] + adds r2, r3 + strh r2, [r0, 0x20] + ldrh r1, [r1, 0x2] + lsls r1, 2 + ldrh r2, [r0, 0x22] + adds r1, r2 + strh r1, [r0, 0x22] + bx lr + .pool + thumb_func_end quad_little_steps + + thumb_func_start oct_little_steps +@ void oct_little_steps(struct obj *object, u8 direction) +oct_little_steps: @ 809763C + lsls r1, 24 + ldr r2, =gUnknown_0850DB7C + lsrs r1, 22 + adds r1, r2 + ldrh r2, [r1] + lsls r2, 3 + ldrh r3, [r0, 0x20] + adds r2, r3 + strh r2, [r0, 0x20] + ldrh r1, [r1, 0x2] + lsls r1, 3 + ldrh r2, [r0, 0x22] + adds r1, r2 + strh r1, [r0, 0x22] + bx lr + .pool + thumb_func_end oct_little_steps + + thumb_func_start oamt_npc_ministep_reset +@ void oamt_npc_ministep_reset(struct obj *object, u8 direction, u8 speed) +oamt_npc_ministep_reset: @ 8097660 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + movs r3, 0 + strh r1, [r0, 0x34] + strh r2, [r0, 0x36] + strh r3, [r0, 0x38] + bx lr + thumb_func_end oamt_npc_ministep_reset + + thumb_func_start obj_npc_ministep +@ bool8 obj_npc_ministep(struct obj *object) +obj_npc_ministep: @ 8097674 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =gUnknown_0850E768 + movs r0, 0x36 + ldrsh r2, [r4, r0] + lsls r0, r2, 1 + adds r0, r5 + movs r3, 0x38 + ldrsh r1, [r4, r3] + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r1, r0 + bge _080976D4 + ldr r1, =gUnknown_0850E754 + lsls r0, r2, 2 + adds r0, r1 + movs r1, 0x38 + ldrsh r2, [r4, r1] + ldr r0, [r0] + lsls r2, 2 + adds r2, r0 + ldrh r1, [r4, 0x34] + lsls r1, 24 + lsrs r1, 24 + ldr r2, [r2] + adds r0, r4, 0 + bl _call_via_r2 + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + movs r2, 0x36 + ldrsh r1, [r4, r2] + lsls r1, 1 + adds r1, r5 + lsls r0, 16 + asrs r0, 16 + movs r3, 0 + ldrsh r1, [r1, r3] + cmp r0, r1 + blt _080976D4 + movs r0, 0x1 + b _080976D6 + .pool +_080976D4: + movs r0, 0 +_080976D6: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end obj_npc_ministep + + thumb_func_start sub_80976DC +@ void sub_80976DC(struct obj *object, u8 direction) +sub_80976DC: @ 80976DC + lsls r1, 24 + lsrs r1, 24 + movs r2, 0 + strh r1, [r0, 0x34] + strh r2, [r0, 0x36] + strh r2, [r0, 0x38] + bx lr + thumb_func_end sub_80976DC + + thumb_func_start sub_80976EC +@ bool8 sub_80976EC(struct obj *object) +sub_80976EC: @ 80976EC + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x36] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0809770C + ldrh r1, [r4, 0x34] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl little_step + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] +_0809770C: + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0xF + bgt _0809771E + movs r0, 0 + b _08097720 +_0809771E: + movs r0, 0x1 +_08097720: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80976EC + + thumb_func_start sub_8097728 +sub_8097728: @ 8097728 + ldr r1, =gUnknown_0850E7BA + lsls r0, 16 + asrs r0, 16 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + bx lr + .pool + thumb_func_end sub_8097728 + + thumb_func_start sub_809773C +sub_809773C: @ 809773C + ldr r1, =gUnknown_0850E772 + lsls r0, 16 + asrs r0, 16 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + bx lr + .pool + thumb_func_end sub_809773C + + thumb_func_start sub_8097750 +sub_8097750: @ 8097750 + movs r1, 0 + strh r1, [r0, 0x3A] + strh r1, [r0, 0x3C] + bx lr + thumb_func_end sub_8097750 + + thumb_func_start sub_8097758 +sub_8097758: @ 8097758 + push {r4-r6,lr} + adds r5, r0, 0 + movs r6, 0 + movs r1, 0x3C + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _0809778E + cmp r0, 0x1 + bgt _08097770 + cmp r0, 0 + beq _0809777A + b _080977F2 +_08097770: + cmp r0, 0x2 + beq _080977B6 + cmp r0, 0x3 + beq _080977CA + b _080977F2 +_0809777A: + movs r2, 0x3A + ldrsh r0, [r5, r2] + bl sub_809773C + ldrh r1, [r5, 0x24] + adds r0, r1 + strh r0, [r5, 0x24] + movs r2, 0x3A + ldrsh r0, [r5, r2] + b _080977E8 +_0809778E: + ldrh r0, [r5, 0x3A] + movs r4, 0x47 + subs r0, r4, r0 + lsls r0, 16 + asrs r0, 16 + bl sub_809773C + ldrh r1, [r5, 0x24] + subs r1, r0 + strh r1, [r5, 0x24] + ldrh r0, [r5, 0x3A] + subs r4, r0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + bl sub_8097728 + ldrh r2, [r5, 0x26] + adds r0, r2 + b _080977F0 +_080977B6: + movs r1, 0x3A + ldrsh r0, [r5, r1] + bl sub_809773C + ldrh r1, [r5, 0x24] + subs r1, r0 + strh r1, [r5, 0x24] + movs r2, 0x3A + ldrsh r0, [r5, r2] + b _080977E8 +_080977CA: + ldrh r0, [r5, 0x3A] + movs r4, 0x47 + subs r0, r4, r0 + lsls r0, 16 + asrs r0, 16 + bl sub_809773C + ldrh r2, [r5, 0x24] + adds r0, r2 + strh r0, [r5, 0x24] + ldrh r0, [r5, 0x3A] + subs r4, r0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 +_080977E8: + bl sub_8097728 + ldrh r1, [r5, 0x26] + adds r0, r1 +_080977F0: + strh r0, [r5, 0x26] +_080977F2: + ldrh r0, [r5, 0x3A] + adds r0, 0x1 + movs r1, 0 + strh r0, [r5, 0x3A] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x48 + bne _0809780A + strh r1, [r5, 0x3A] + ldrh r0, [r5, 0x3C] + adds r0, 0x1 + strh r0, [r5, 0x3C] +_0809780A: + movs r2, 0x3C + ldrsh r0, [r5, r2] + cmp r0, 0x4 + bne _08097818 + strh r1, [r5, 0x26] + strh r1, [r5, 0x24] + movs r6, 0x1 +_08097818: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8097758 + + thumb_func_start sub_8097820 +sub_8097820: @ 8097820 + lsls r1, 24 + ldr r2, =gUnknown_0850E834 + lsrs r1, 22 + adds r1, r2 + lsls r0, 16 + asrs r0, 16 + ldr r1, [r1] + adds r1, r0 + movs r0, 0 + ldrsb r0, [r1, r0] + bx lr + .pool + thumb_func_end sub_8097820 + + thumb_func_start sub_809783C +sub_809783C: @ 809783C + push {r4,lr} + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + movs r4, 0 + strh r1, [r0, 0x34] + strh r2, [r0, 0x36] + strh r3, [r0, 0x38] + strh r4, [r0, 0x3A] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_809783C + + thumb_func_start sub_809785C +sub_809785C: @ 809785C + push {r4-r6,lr} + sub sp, 0xC + adds r4, r0, 0 + ldr r1, =gUnknown_0850E840 + mov r0, sp + movs r2, 0x6 + bl memcpy + add r5, sp, 0x8 + ldr r1, =gUnknown_0850E846 + adds r0, r5, 0 + movs r2, 0x3 + bl memcpy + movs r6, 0 + movs r1, 0x36 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0809788E + ldrh r1, [r4, 0x34] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl little_step +_0809788E: + movs r2, 0x3A + ldrsh r0, [r4, r2] + movs r2, 0x36 + ldrsh r1, [r4, r2] + adds r1, r5, r1 + ldrb r1, [r1] + asrs r0, r1 + ldrh r1, [r4, 0x38] + lsls r1, 24 + lsrs r1, 24 + bl sub_8097820 + strh r0, [r4, 0x26] + ldrh r1, [r4, 0x3A] + adds r1, 0x1 + strh r1, [r4, 0x3A] + movs r2, 0x36 + ldrsh r0, [r4, r2] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + lsls r0, 16 + asrs r2, r0, 16 + lsls r1, 16 + asrs r1, 16 + asrs r0, 17 + cmp r1, r0 + bne _080978C8 + movs r6, 0x1 +_080978C8: + cmp r1, r2 + blt _080978D2 + movs r0, 0 + strh r0, [r4, 0x26] + movs r6, 0xFF +_080978D2: + adds r0, r6, 0 + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809785C + + thumb_func_start sub_80978E4 +sub_80978E4: @ 80978E4 + push {r4-r6,lr} + sub sp, 0xC + adds r5, r0, 0 + ldr r1, =gUnknown_0850E84A + mov r0, sp + movs r2, 0x6 + bl memcpy + add r4, sp, 0x8 + ldr r1, =gUnknown_0850E850 + adds r0, r4, 0 + movs r2, 0x3 + bl memcpy + movs r6, 0 + movs r1, 0x36 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08097920 + ldrh r1, [r5, 0x3A] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08097920 + ldrh r1, [r5, 0x34] + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl little_step +_08097920: + movs r2, 0x3A + ldrsh r0, [r5, r2] + movs r2, 0x36 + ldrsh r1, [r5, r2] + adds r1, r4, r1 + ldrb r1, [r1] + asrs r0, r1 + ldrh r1, [r5, 0x38] + lsls r1, 24 + lsrs r1, 24 + bl sub_8097820 + strh r0, [r5, 0x26] + ldrh r1, [r5, 0x3A] + adds r1, 0x1 + strh r1, [r5, 0x3A] + movs r2, 0x36 + ldrsh r0, [r5, r2] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + lsls r0, 16 + asrs r2, r0, 16 + lsls r1, 16 + asrs r1, 16 + asrs r0, 17 + cmp r1, r0 + bne _0809795A + movs r6, 0x1 +_0809795A: + cmp r1, r2 + blt _08097964 + movs r0, 0 + strh r0, [r5, 0x26] + movs r6, 0xFF +_08097964: + adds r0, r6, 0 + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80978E4 + + thumb_func_start sub_8097978 +@ void sub_8097978(struct obj *object, u16 a2) +sub_8097978: @ 8097978 + strh r1, [r0, 0x34] + bx lr + thumb_func_end sub_8097978 + + thumb_func_start sub_809797C +@ bool8 sub_809797C(struct obj *object) +sub_809797C: @ 809797C + push {lr} + ldrh r1, [r0, 0x34] + subs r1, 0x1 + strh r1, [r0, 0x34] + lsls r1, 16 + cmp r1, 0 + beq _0809798E + movs r0, 0 + b _08097990 +_0809798E: + movs r0, 0x1 +_08097990: + pop {r1} + bx r1 + thumb_func_end sub_809797C + + thumb_func_start obj_anim_image_set_and_seek +obj_anim_image_set_and_seek: @ 8097994 + push {r4,lr} + lsls r2, 24 + lsrs r2, 24 + adds r3, r0, 0 + adds r3, 0x2A + strb r1, [r3] + adds r4, r0, 0 + adds r4, 0x2C + ldrb r3, [r4] + movs r1, 0x41 + negs r1, r1 + ands r1, r3 + strb r1, [r4] + adds r1, r2, 0 + bl SeekObjectImageAnim + pop {r4} + pop {r0} + bx r0 + thumb_func_end obj_anim_image_set_and_seek + + thumb_func_start sub_80979BC +sub_80979BC: @ 80979BC + push {lr} + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _080979CE + movs r0, 0 + b _080979D0 +_080979CE: + movs r0, 0x1 +_080979D0: + pop {r1} + bx r1 + thumb_func_end sub_80979BC + + thumb_func_start sub_80979D4 +sub_80979D4: @ 80979D4 + push {r4-r6,lr} + mov r12, r0 + lsls r1, 24 + lsrs r1, 24 + mov r3, r12 + adds r3, 0x3E + movs r0, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08097A3C + mov r0, r12 + ldrh r1, [r0, 0x24] + ldrh r2, [r0, 0x20] + adds r1, r2 + mov r4, r12 + adds r4, 0x28 + movs r0, 0 + ldrsb r0, [r4, r0] + ldr r2, =0x02021bbc + adds r0, r1 + ldrh r2, [r2] + adds r0, r2 + lsls r0, 16 + lsrs r6, r0, 16 + mov r0, r12 + ldrh r1, [r0, 0x26] + ldrh r2, [r0, 0x22] + adds r1, r2 + subs r3, 0x15 + movs r0, 0 + ldrsb r0, [r3, r0] + ldr r2, =0x02021bbe + adds r0, r1 + ldrh r2, [r2] + adds r0, r2 + lsls r0, 16 + lsrs r5, r0, 16 + adds r2, r3, 0 + b _08097A6A + .pool +_08097A3C: + mov r0, r12 + ldrh r1, [r0, 0x24] + ldrh r2, [r0, 0x20] + adds r1, r2 + mov r3, r12 + adds r3, 0x28 + movs r0, 0 + ldrsb r0, [r3, r0] + adds r0, r1 + lsls r0, 16 + lsrs r6, r0, 16 + mov r0, r12 + ldrh r1, [r0, 0x26] + ldrh r2, [r0, 0x22] + adds r1, r2 + mov r2, r12 + adds r2, 0x29 + movs r0, 0 + ldrsb r0, [r2, r0] + adds r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r4, r3, 0 +_08097A6A: + ldrb r0, [r4] + lsls r0, 24 + asrs r0, 25 + subs r0, r6, r0 + lsls r0, 16 + lsrs r3, r0, 16 + ldrb r0, [r2] + lsls r0, 24 + asrs r0, 25 + subs r0, r5, r0 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r0, r6, 16 + asrs r0, 16 + cmp r0, 0xFF + bgt _08097A96 + lsls r0, r3, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bge _08097AA2 +_08097A96: + mov r4, r12 + adds r4, 0x3E + ldrb r0, [r4] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] +_08097AA2: + lsls r0, r5, 16 + asrs r0, 16 + cmp r0, 0xAF + bgt _08097AB6 + lsls r0, r2, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bge _08097AC2 +_08097AB6: + mov r0, r12 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_08097AC2: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80979D4 + + thumb_func_start sub_8097AC8 +sub_8097AC8: @ 8097AC8 + push {r4,lr} + adds r4, r0, 0 + bl sub_8097D68 + ldrh r0, [r4, 0x30] + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + movs r2, 0x1 + bl SetObjectSubpriorityByZCoord + ldrh r1, [r4, 0x32] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80979D4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8097AC8 + + thumb_func_start sub_8097AF0 +sub_8097AF0: @ 8097AF0 + push {r4,r5,lr} + movs r5, 0 + movs r4, 0x3F +_08097AF6: + ldr r0, =0x02020630 + adds r2, r5, r0 + adds r0, r2, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08097B16 + ldr r1, [r2, 0x1C] + ldr r0, =sub_8097AC8 + cmp r1, r0 + bne _08097B16 + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles +_08097B16: + adds r5, 0x44 + subs r4, 0x1 + cmp r4, 0 + bge _08097AF6 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8097AF0 + + thumb_func_start sub_8097B2C +sub_8097B2C: @ 8097B2C + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r3, 0 + ldr r6, =0x02020630 + movs r4, 0 +_08097B38: + adds r2, r4, r6 + adds r0, r2, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08097B68 + ldr r1, [r2, 0x1C] + ldr r0, =sub_8097AC8 + cmp r1, r0 + bne _08097B68 + ldrh r0, [r2, 0x2E] + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + bne _08097B68 + adds r0, r3, 0 + b _08097B72 + .pool +_08097B68: + adds r4, 0x44 + adds r3, 0x1 + cmp r3, 0x3F + ble _08097B38 + movs r0, 0x40 +_08097B72: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8097B2C + + thumb_func_start sub_8097B78 +sub_8097B78: @ 8097B78 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + bl sub_8097B2C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08097BAA + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + adds r0, r5, 0 + bl FieldObjectDirectionToImageAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim +_08097BAA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8097B78 + + thumb_func_start sub_8097BB4 +sub_8097BB4: @ 8097BB4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + bl sub_8097B2C + adds r1, r0, 0 + cmp r1, 0x40 + beq _08097C3E + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r4, r0, r1 + adds r0, r5, 0 + bl GetFieldObjectGraphicsInfo + ldrh r3, [r4, 0x4] + lsls r3, 22 + ldr r1, [r0, 0x10] + ldr r2, [r1, 0x4] + ldr r1, [r1] + str r1, [r4] + str r2, [r4, 0x4] + lsrs r3, 22 + ldrh r2, [r4, 0x4] + ldr r1, =0xfffffc00 + ands r1, r2 + orrs r1, r3 + strh r1, [r4, 0x4] + ldrb r2, [r0, 0xC] + lsls r2, 28 + lsrs r2, 24 + ldrb r3, [r4, 0x5] + movs r1, 0xF + ands r1, r3 + orrs r1, r2 + strb r1, [r4, 0x5] + ldr r1, [r0, 0x1C] + str r1, [r4, 0xC] + ldr r1, [r0, 0x14] + cmp r1, 0 + bne _08097C20 + str r1, [r4, 0x18] + adds r0, r4, 0 + adds r0, 0x42 + strb r1, [r0] + b _08097C36 + .pool +_08097C20: + adds r0, r4, 0 + bl SetSpriteOamTables_NoPriorityFromTable + adds r2, r4, 0 + adds r2, 0x42 + ldrb r0, [r2] + movs r1, 0x3F + ands r1, r0 + movs r0, 0x80 + orrs r1, r0 + strb r1, [r2] +_08097C36: + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnim +_08097C3E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8097BB4 + + thumb_func_start sub_8097C44 +sub_8097C44: @ 8097C44 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + bl sub_8097B2C + lsls r0, 24 + lsrs r2, r0, 24 + adds r3, r2, 0 + cmp r2, 0x40 + beq _08097C80 + cmp r4, 0 + beq _08097C74 + ldr r0, =0x02020630 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x32] + b _08097C80 + .pool +_08097C74: + ldr r1, =0x02020630 + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + strh r4, [r0, 0x32] +_08097C80: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8097C44 + + thumb_func_start sub_8097C8C +sub_8097C8C: @ 8097C8C + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_8097B2C + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + bne _08097CA2 + movs r0, 0 + b _08097CBA +_08097CA2: + movs r3, 0 + ldr r0, =0x02020630 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + movs r2, 0x32 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _08097CB8 + movs r3, 0x1 +_08097CB8: + adds r0, r3, 0 +_08097CBA: + pop {r1} + bx r1 + .pool + thumb_func_end sub_8097C8C + + thumb_func_start sub_8097CC4 +sub_8097CC4: @ 8097CC4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + bl sub_8097B2C + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _08097CEA + ldr r0, =0x02020630 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + movs r0, 0 + strh r4, [r1, 0x34] + strh r0, [r1, 0x36] +_08097CEA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8097CC4 + + thumb_func_start sub_8097CF4 +sub_8097CF4: @ 8097CF4 + push {lr} + adds r2, r0, 0 + movs r1, 0x36 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _08097D06 + cmp r0, 0x1 + beq _08097D0E + b _08097D2C +_08097D06: + strh r0, [r2, 0x26] + ldrh r0, [r2, 0x36] + adds r0, 0x1 + strh r0, [r2, 0x36] +_08097D0E: + ldrh r0, [r2, 0x26] + subs r0, 0x8 + movs r3, 0 + strh r0, [r2, 0x26] + lsls r0, 16 + asrs r0, 16 + movs r1, 0xA0 + negs r1, r1 + cmp r0, r1 + bne _08097D2C + strh r3, [r2, 0x26] + movs r0, 0x1 + strh r0, [r2, 0x32] + strh r3, [r2, 0x34] + strh r3, [r2, 0x36] +_08097D2C: + pop {r0} + bx r0 + thumb_func_end sub_8097CF4 + + thumb_func_start sub_8097D30 +sub_8097D30: @ 8097D30 + push {lr} + adds r1, r0, 0 + movs r2, 0x36 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _08097D42 + cmp r0, 0x1 + beq _08097D4C + b _08097D5E +_08097D42: + ldr r0, =0x0000ff60 + strh r0, [r1, 0x26] + ldrh r0, [r1, 0x36] + adds r0, 0x1 + strh r0, [r1, 0x36] +_08097D4C: + ldrh r0, [r1, 0x26] + adds r0, 0x8 + strh r0, [r1, 0x26] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bne _08097D5E + strh r0, [r1, 0x34] + strh r0, [r1, 0x36] +_08097D5E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8097D30 + + thumb_func_start sub_8097D68 +sub_8097D68: @ 8097D68 + push {lr} + adds r1, r0, 0 + movs r2, 0x34 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + beq _08097D84 + cmp r0, 0x1 + bgt _08097D7E + cmp r0, 0 + beq _08097D98 + b _08097D94 +_08097D7E: + cmp r0, 0x2 + beq _08097D8C + b _08097D94 +_08097D84: + adds r0, r1, 0 + bl sub_8097D30 + b _08097D98 +_08097D8C: + adds r0, r1, 0 + bl sub_8097CF4 + b _08097D98 +_08097D94: + movs r0, 0 + strh r0, [r1, 0x34] +_08097D98: + pop {r0} + bx r0 + thumb_func_end sub_8097D68 + + thumb_func_start sub_8097D9C +sub_8097D9C: @ 8097D9C + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_8097B2C + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _08097DC0 + ldr r0, =0x02020630 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + movs r2, 0x34 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08097DC8 +_08097DC0: + movs r0, 0 + b _08097DCA + .pool +_08097DC8: + movs r0, 0x1 +_08097DCA: + pop {r1} + bx r1 + thumb_func_end sub_8097D9C + + thumb_func_start oe_exec_and_other_stuff +oe_exec_and_other_stuff: @ 8097DD0 + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =0x02038c08 + adds r2, r1, 0x4 + adds r3, r1, 0 + adds r3, 0x8 + bl FieldObjectGetLocalIdAndMap + adds r0, r4, 0 + bl FieldEffectStart + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end oe_exec_and_other_stuff + + thumb_func_start DoShadowFieldEffect +DoShadowFieldEffect: @ 8097DF8 + push {lr} + adds r1, r0, 0 + ldrb r2, [r1, 0x2] + lsls r0, r2, 25 + cmp r0, 0 + blt _08097E10 + movs r0, 0x40 + orrs r0, r2 + strb r0, [r1, 0x2] + movs r0, 0x3 + bl oe_exec_and_other_stuff +_08097E10: + pop {r0} + bx r0 + thumb_func_end DoShadowFieldEffect + + thumb_func_start DoRippleFieldEffect +@ void DoRippleFieldEffect(struct npc_state *fieldObject, struct obj *object) +DoRippleFieldEffect: @ 8097E14 + push {r4,lr} + adds r4, r1, 0 + ldrb r0, [r0, 0x5] + bl GetFieldObjectGraphicsInfo + ldr r2, =0x02038c08 + movs r3, 0x20 + ldrsh r1, [r4, r3] + str r1, [r2] + movs r3, 0x22 + ldrsh r1, [r4, r3] + ldrh r0, [r0, 0xA] + lsls r0, 16 + asrs r0, 17 + adds r1, r0 + subs r1, 0x2 + str r1, [r2, 0x4] + movs r0, 0x97 + str r0, [r2, 0x8] + movs r0, 0x3 + str r0, [r2, 0xC] + movs r0, 0x5 + bl FieldEffectStart + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end DoRippleFieldEffect + + thumb_func_start sub_8097E50 +sub_8097E50: @ 8097E50 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + mov r8, r1 + movs r0, 0 + mov r12, r0 + ldr r0, =0x020375b8 + ldr r1, [r0] + adds r6, r0, 0 + cmp r1, 0 + bne _08097E80 + movs r0, 0x14 + bl AllocZeroed + str r0, [r6] + ldrb r1, [r4, 0x8] + strb r1, [r0] + ldr r1, [r6] + movs r0, 0x1 + strb r0, [r1, 0x10] + b _08097ECC + .pool +_08097E80: + movs r2, 0x10 + movs r5, 0 + movs r1, 0 + adds r3, r6, 0 + b _08097E90 +_08097E8A: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 +_08097E90: + cmp r1, 0xF + bhi _08097EB2 + cmp r2, 0x10 + bne _08097EA4 + ldr r0, [r3] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08097EA4 + adds r2, r1, 0 +_08097EA4: + ldr r0, [r3] + adds r0, r1 + ldrb r0, [r0] + ldrb r7, [r4, 0x8] + cmp r0, r7 + bne _08097E8A + movs r5, 0x1 +_08097EB2: + cmp r5, 0 + bne _08097ECE + cmp r2, 0x10 + beq _08097ECE + ldr r0, [r6] + adds r0, r2 + ldrb r1, [r4, 0x8] + strb r1, [r0] + ldr r1, [r6] + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] + movs r0, 0x1 +_08097ECC: + mov r12, r0 +_08097ECE: + mov r1, r12 + cmp r1, 0x1 + bne _08097EE0 + ldrb r0, [r4, 0x1] + movs r1, 0x10 + orrs r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4, 0x1] +_08097EE0: + movs r0, 0x1 + mov r7, r8 + strh r0, [r7, 0x32] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8097E50 + + thumb_func_start sub_8097EF0 +sub_8097EF0: @ 8097EF0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + mov r8, r1 + movs r0, 0x1 + strh r0, [r1, 0x32] + ldr r5, =0x020375b8 + ldr r0, [r5] + cmp r0, 0 + beq _08097F68 + movs r7, 0 + adds r0, r6, 0 + bl sub_8097F78 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x10 + beq _08097F28 + ldr r0, [r5] + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r1, [r5] + ldrb r0, [r1, 0x10] + subs r0, 0x1 + strb r0, [r1, 0x10] + movs r7, 0x1 +_08097F28: + ldr r0, [r5] + ldrb r4, [r0, 0x10] + cmp r4, 0 + bne _08097F36 + bl Free + str r4, [r5] +_08097F36: + cmp r7, 0x1 + bne _08097F68 + ldrb r0, [r6, 0x5] + bl GetFieldObjectGraphicsInfo + ldrb r1, [r0, 0xC] + lsls r1, 25 + lsrs r1, 31 + lsls r1, 4 + ldrb r2, [r6, 0x1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + movs r1, 0x3 + negs r1, r1 + ands r0, r1 + strb r0, [r6, 0x1] + mov r2, r8 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08097F68: + movs r0, 0x1 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8097EF0 + + thumb_func_start sub_8097F78 +@ signed int sub_8097F78(npc_state *a1) +sub_8097F78: @ 8097F78 + push {lr} + movs r2, 0 + ldr r1, =0x020375b8 + ldr r1, [r1] + ldrb r3, [r0, 0x8] +_08097F82: + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, r3 + bne _08097F94 + adds r0, r2, 0 + b _08097FA0 + .pool +_08097F94: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _08097F82 + movs r0, 0x10 +_08097FA0: + pop {r1} + bx r1 + thumb_func_end sub_8097F78 + + thumb_func_start sub_8097FA4 +sub_8097FA4: @ 8097FA4 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r0, =sub_8097FE4 + movs r1, 0xFF + bl CreateTask + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + adds r0, r4, 0 + adds r0, 0x8 + adds r1, r6, 0 + bl sub_806F67C + strb r5, [r6, 0x1B] + ldr r0, =0x0000ffff + strh r0, [r4, 0xE] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8097FA4 + + thumb_func_start sub_8097FE4 +sub_8097FE4: @ 8097FE4 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r4, r1, r0 + adds r0, r4, 0 + adds r0, 0x8 + mov r1, sp + bl sub_806F684 + ldr r0, [sp] + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r2, r0, r1 + ldrh r1, [r4, 0xC] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08098020 + ldrh r0, [r4, 0xE] + ldrh r1, [r2, 0x26] + adds r0, r1 + strh r0, [r2, 0x26] +_08098020: + ldrh r1, [r4, 0xC] + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + bne _08098030 + ldrh r0, [r4, 0xE] + negs r0, r0 + strh r0, [r4, 0xE] +_08098030: + adds r0, r1, 0x1 + strh r0, [r4, 0xC] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8097FE4 + + thumb_func_start sub_8098044 +sub_8098044: @ 8098044 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r0, r1 + adds r0, 0x8 + mov r1, sp + bl sub_806F684 + adds r0, r4, 0 + bl DestroyTask + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8098044 + + thumb_func_start sub_8098074 +sub_8098074: @ 8098074 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + movs r4, 0 + ldr r7, =0x02037350 +_08098082: + cmp r4, r6 + beq _080980A8 + cmp r4, r5 + beq _080980A8 + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + adds r1, r0, r7 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + beq _080980A8 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + cmp r4, r0 + beq _080980A8 + adds r0, r1, 0 + bl sub_8097404 +_080980A8: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _08098082 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8098074 + + thumb_func_start sub_80980C0 +sub_80980C0: @ 80980C0 + movs r0, 0 + strh r0, [r1, 0x26] + ldrh r0, [r1, 0x32] + adds r0, 0x1 + strh r0, [r1, 0x32] + movs r0, 0 + bx lr + thumb_func_end sub_80980C0 + + thumb_func_start sub_80980D0 +sub_80980D0: @ 80980D0 + push {lr} + adds r2, r1, 0 + ldrh r0, [r2, 0x26] + subs r0, 0x8 + strh r0, [r2, 0x26] + lsls r0, 16 + asrs r0, 16 + movs r1, 0xA0 + negs r1, r1 + cmp r0, r1 + bne _080980EC + ldrh r0, [r2, 0x32] + adds r0, 0x1 + strh r0, [r2, 0x32] +_080980EC: + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_80980D0 + + thumb_func_start sub_80980F4 +sub_80980F4: @ 80980F4 + ldr r0, =0x0000ff60 + strh r0, [r1, 0x26] + ldrh r0, [r1, 0x32] + adds r0, 0x1 + strh r0, [r1, 0x32] + movs r0, 0 + bx lr + .pool + thumb_func_end sub_80980F4 + + thumb_func_start sub_8098108 +sub_8098108: @ 8098108 + push {lr} + ldrh r0, [r1, 0x26] + adds r0, 0x8 + strh r0, [r1, 0x26] + lsls r0, 16 + cmp r0, 0 + bne _0809811C + ldrh r0, [r1, 0x32] + adds r0, 0x1 + strh r0, [r1, 0x32] +_0809811C: + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_8098108 + + thumb_func_start sub_8098124 +sub_8098124: @ 8098124 + movs r0, 0x1 + bx lr + thumb_func_end sub_8098124 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/map_obj_lock.s b/asm/map_obj_lock.s new file mode 100644 index 000000000..787cb5167 --- /dev/null +++ b/asm/map_obj_lock.s @@ -0,0 +1,474 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start walkrun_is_standing_still +walkrun_is_standing_still: @ 8098388 + push {lr} + ldr r0, =0x02037590 + ldrb r0, [r0, 0x3] + cmp r0, 0x1 + beq _0809839C + movs r0, 0x1 + b _0809839E + .pool +_0809839C: + movs r0, 0 +_0809839E: + pop {r1} + bx r1 + thumb_func_end walkrun_is_standing_still + + thumb_func_start sub_80983A4 +sub_80983A4: @ 80983A4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl walkrun_is_standing_still + lsls r0, 24 + cmp r0, 0 + beq _080983BE + bl sub_808B864 + adds r0, r4, 0 + bl DestroyTask +_080983BE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80983A4 + + thumb_func_start sub_80983C4 +sub_80983C4: @ 80983C4 + push {lr} + ldr r0, =sub_80983A4 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + bne _080983E0 + bl sub_808BCF4 + movs r0, 0x1 + b _080983E2 + .pool +_080983E0: + movs r0, 0 +_080983E2: + pop {r1} + bx r1 + thumb_func_end sub_80983C4 + + thumb_func_start sub_80983E8 +sub_80983E8: @ 80983E8 + push {lr} + bl player_bitmagic + ldr r0, =sub_80983A4 + movs r1, 0x50 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80983E8 + + thumb_func_start sub_8098400 +sub_8098400: @ 8098400 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0809842A + bl walkrun_is_standing_still + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bne _0809842A + bl sub_808B864 + strh r4, [r5, 0x8] +_0809842A: + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08098452 + ldr r2, =0x02037350 + ldr r0, =0x03005df0 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + ldrb r0, [r1] + lsls r0, 30 + cmp r0, 0 + blt _08098452 + adds r0, r1, 0 + bl sub_8097404 + movs r0, 0x1 + strh r0, [r5, 0xA] +_08098452: + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08098468 + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08098468 + adds r0, r6, 0 + bl DestroyTask +_08098468: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8098400 + + thumb_func_start sub_809847C +sub_809847C: @ 809847C + push {lr} + ldr r0, =sub_8098400 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + bne _08098498 + bl sub_808BCF4 + movs r0, 0x1 + b _0809849A + .pool +_08098498: + movs r0, 0 +_0809849A: + pop {r1} + bx r1 + thumb_func_end sub_809847C + + thumb_func_start sub_80984A0 +sub_80984A0: @ 80984A0 + push {r4,r5,lr} + ldr r4, =0x03005df0 + ldrb r0, [r4] + bl sub_80974D0 + ldr r0, =sub_8098400 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, =0x02037350 + ldrb r1, [r4] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + ldrb r0, [r1] + lsls r0, 30 + cmp r0, 0 + blt _080984DE + adds r0, r1, 0 + bl sub_8097404 + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0xA] +_080984DE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80984A0 + + thumb_func_start sub_80984F4 +sub_80984F4: @ 80984F4 + push {lr} + 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, =0x02037350 + adds r0, r1 + bl FieldObjectClearAnimIfSpecialAnimFinished + bl sub_80D338C + bl sub_809757C + pop {r0} + bx r0 + .pool + thumb_func_end sub_80984F4 + + thumb_func_start sub_8098524 +sub_8098524: @ 8098524 + push {r4,lr} + ldr r4, =0x02037350 + ldr r0, =0x03005df0 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r4 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + beq _08098542 + adds r0, r1, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished +_08098542: + 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 + adds r0, r4 + bl FieldObjectClearAnimIfSpecialAnimFinished + bl sub_80D338C + bl sub_809757C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8098524 + + thumb_func_start sub_8098574 +sub_8098574: @ 8098574 + push {lr} + ldr r0, =0x03005df0 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldr r1, =0x020375f4 + ldrb r1, [r1] + bl FieldObjectFaceOppositeDirection + pop {r0} + bx r0 + .pool + thumb_func_end sub_8098574 + + thumb_func_start sub_809859C +sub_809859C: @ 809859C + push {lr} + ldr r0, =0x03005df0 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + bl FieldObjectClearAnimIfSpecialAnimActive + pop {r0} + bx r0 + .pool + thumb_func_end sub_809859C + + thumb_func_start sub_80985BC +sub_80985BC: @ 80985BC + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r5, r0, r1 + ldrb r7, [r5, 0xC] + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _080985E8 + bl walkrun_is_standing_still + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bne _080985E8 + bl sub_808B864 + strh r4, [r5, 0x8] +_080985E8: + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0809860C + ldr r0, =0x02037350 + lsls r1, r7, 3 + adds r1, r7 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 30 + cmp r0, 0 + blt _0809860C + adds r0, r1, 0 + bl sub_8097404 + movs r0, 0x1 + strh r0, [r5, 0xA] +_0809860C: + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08098622 + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08098622 + adds r0, r6, 0 + bl DestroyTask +_08098622: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80985BC + + thumb_func_start sub_8098630 +sub_8098630: @ 8098630 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r0, 0 + bl sub_80B47E0 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x030060a8 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080986E0 + movs r0, 0x1 + bl sub_80B47E0 + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8098074 + ldr r7, =sub_80985BC + adds r0, r7, 0 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x03005e00 + mov r9, r0 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + mov r1, r9 + adds r6, r0, r1 + strh r4, [r6, 0xC] + ldr r2, =0x02037350 + mov r8, r2 + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + adds r1, r0, r2 + ldrb r0, [r1] + lsls r0, 30 + cmp r0, 0 + blt _0809869A + adds r0, r1, 0 + bl sub_8097404 + movs r0, 0x1 + strh r0, [r6, 0xA] +_0809869A: + adds r0, r7, 0 + movs r1, 0x51 + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + mov r1, r9 + adds r4, r0, r1 + strh r5, [r4, 0xC] + lsls r0, r5, 3 + adds r0, r5 + lsls r0, 2 + mov r2, r8 + adds r1, r0, r2 + ldrb r0, [r1] + lsls r0, 30 + cmp r0, 0 + blt _0809871A + adds r0, r1, 0 + bl sub_8097404 + movs r0, 0x1 + strh r0, [r4, 0xA] + b _0809871A + .pool +_080986E0: + adds r0, r4, 0 + bl sub_80974D0 + ldr r0, =sub_80985BC + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r5, r0, r1 + strh r4, [r5, 0xC] + ldr r1, =0x02037350 + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + adds r1, r0, r1 + ldrb r0, [r1] + lsls r0, 30 + cmp r0, 0 + blt _0809871A + adds r0, r1, 0 + bl sub_8097404 + movs r0, 0x1 + strh r0, [r5, 0xA] +_0809871A: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8098630 + + thumb_func_start sub_8098734 +sub_8098734: @ 8098734 + push {lr} + ldr r0, =sub_80985BC + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + bne _08098750 + bl sub_808BCF4 + movs r0, 0x1 + b _08098752 + .pool +_08098750: + movs r0, 0 +_08098752: + pop {r1} + bx r1 + thumb_func_end sub_8098734 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/mauville_old_man.s b/asm/mauville_old_man.s new file mode 100644 index 000000000..3f9798d80 --- /dev/null +++ b/asm/mauville_old_man.s @@ -0,0 +1,2519 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_81200A0 +sub_81200A0: @ 81200A0 + push {r4,lr} + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r1, =0x00002e28 + adds r0, r2, r1 + movs r1, 0 + strb r1, [r0] + ldr r3, =0x00002e51 + adds r0, r2, r3 + strb r1, [r0] + ldr r0, =gUnknown_82E9531 + ldrb r1, [r0] + adds r3, 0x1 + adds r0, r2, r3 + strb r1, [r0] + movs r3, 0 + ldr r0, =0x00002e2a + adds r2, r0 + ldr r4, =gUnknown_0859EFE4 +_081200C6: + lsls r0, r3, 1 + adds r1, r2, r0 + adds r0, r4 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x5 + bls _081200C6 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81200A0 + + thumb_func_start sub_81200F8 +sub_81200F8: @ 81200F8 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x00002e28 + adds r1, r0 + movs r2, 0 + movs r0, 0x1 + strb r0, [r1] + strb r2, [r1, 0x1] + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r1, 0x2] + bx lr + .pool + thumb_func_end sub_81200F8 + + thumb_func_start sub_812011C +sub_812011C: @ 812011C + push {lr} + bl sub_8120E08 + pop {r0} + bx r0 + thumb_func_end sub_812011C + + thumb_func_start sub_8120128 +sub_8120128: @ 8120128 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x00002e28 + adds r2, r1, r0 + movs r3, 0 + movs r0, 0x4 + strb r0, [r2] + strb r3, [r2, 0x1] + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + ldr r2, =0x00002e48 + adds r1, r2 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_8120128 + + thumb_func_start sub_8120154 +sub_8120154: @ 8120154 + push {lr} + bl sub_81339F8 + pop {r0} + bx r0 + thumb_func_end sub_8120154 + + thumb_func_start sub_8120160 +sub_8120160: @ 8120160 + push {lr} + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r1, [r0, 0xB] + lsls r1, 8 + ldrb r0, [r0, 0xA] + orrs r0, r1 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r0, 17 + cmp r0, 0x4 + bhi _081201C0 + lsls r0, 2 + ldr r1, =_08120190 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08120190: + .4byte _081201A4 + .4byte _081201AA + .4byte _081201B0 + .4byte _081201B6 + .4byte _081201BC +_081201A4: + bl sub_81200A0 + b _081201C0 +_081201AA: + bl sub_81200F8 + b _081201C0 +_081201B0: + bl sub_8120154 + b _081201C0 +_081201B6: + bl sub_812011C + b _081201C0 +_081201BC: + bl sub_8120128 +_081201C0: + bl sub_8120B5C + pop {r0} + bx r0 + thumb_func_end sub_8120160 + + thumb_func_start sub_81201C8 +sub_81201C8: @ 81201C8 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002e28 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_81201C8 + + thumb_func_start sub_81201DC +sub_81201DC: @ 81201DC + push {r4,lr} + ldr r4, =0x020375f0 + bl sub_81201C8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81201DC + + thumb_func_start sub_81201F4 +sub_81201F4: @ 81201F4 + ldr r1, =0x020375f0 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00002e51 + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81201F4 + + thumb_func_start sub_8120210 +sub_8120210: @ 8120210 + push {r4-r6,lr} + ldr r0, =0x03005d8c + ldr r4, [r0] + ldr r0, =0x00002e28 + adds r6, r4, r0 + ldr r1, =0x00002e42 + adds r0, r4, r1 + ldr r5, =0x03005d90 + ldr r1, [r5] + bl CopyString + movs r2, 0 + ldr r0, =0x00002e4d + adds r4, r0 +_0812022C: + adds r1, r4, r2 + ldr r0, [r5] + adds r0, 0xA + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x3 + bls _0812022C + movs r2, 0 + adds r5, r6, 0 + adds r5, 0x29 + adds r3, r6, 0x2 + adds r4, r6, 0 + adds r4, 0xE +_0812024E: + lsls r0, r2, 1 + adds r1, r3, r0 + adds r0, r4, r0 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x5 + bls _0812024E + movs r0, 0x1 + strb r0, [r5] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8120210 + + thumb_func_start sub_8120280 +sub_8120280: @ 8120280 + push {r4-r7,lr} + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x020375e0 + ldrh r0, [r0] + ldr r2, =0x00002e36 + adds r5, r1, r2 + cmp r0, 0 + bne _08120296 + ldr r0, =0x00002e2a + adds r5, r1, r0 +_08120296: + ldr r2, =0x02021fc4 + adds r4, r2, 0 + movs r6, 0 +_0812029C: + ldrh r1, [r5] + adds r5, 0x2 + adds r0, r2, 0 + bl CopyEasyChatWord + adds r2, r0, 0 + adds r7, r6, 0x1 + cmp r2, r4 + beq _081202BE + movs r1, 0x37 +_081202B0: + ldrb r0, [r4] + cmp r0, 0 + bne _081202B8 + strb r1, [r4] +_081202B8: + adds r4, 0x1 + cmp r2, r4 + bne _081202B0 +_081202BE: + adds r4, 0x1 + movs r0, 0 + strb r0, [r2] + adds r2, 0x1 + ldrh r1, [r5] + adds r5, 0x2 + adds r0, r2, 0 + bl CopyEasyChatWord + adds r2, r0, 0 + cmp r2, r4 + beq _081202E6 + movs r1, 0x37 +_081202D8: + ldrb r0, [r4] + cmp r0, 0 + bne _081202E0 + strb r1, [r4] +_081202E0: + adds r4, 0x1 + cmp r2, r4 + bne _081202D8 +_081202E6: + adds r4, 0x1 + movs r0, 0xFE + strb r0, [r2] + adds r2, 0x1 + ldrh r1, [r5] + adds r5, 0x2 + adds r0, r2, 0 + bl CopyEasyChatWord + adds r2, r0, 0 + cmp r2, r4 + beq _0812030E + movs r1, 0x37 +_08120300: + ldrb r0, [r4] + cmp r0, 0 + bne _08120308 + strb r1, [r4] +_08120308: + adds r4, 0x1 + cmp r2, r4 + bne _08120300 +_0812030E: + cmp r6, 0 + bne _0812031E + movs r0, 0xFC + strb r0, [r2] + adds r2, 0x1 + movs r0, 0xF + strb r0, [r2] + adds r2, 0x1 +_0812031E: + lsls r0, r7, 16 + lsrs r6, r0, 16 + cmp r6, 0x1 + bls _0812029C + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8120280 + + thumb_func_start sub_8120340 +sub_8120340: @ 8120340 + push {lr} + ldr r0, =0x020375e0 + ldrb r0, [r0] + bl sub_81206C0 + bl script_env_2_set_ctx_paused + pop {r0} + bx r0 + .pool + thumb_func_end sub_8120340 + + thumb_func_start sub_8120358 +sub_8120358: @ 8120358 + ldr r1, =0x020375f0 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00002e28 + adds r0, r2 + ldrb r0, [r0, 0x1] + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_8120358 + + thumb_func_start sub_8120374 +sub_8120374: @ 8120374 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002e28 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0, 0x1] + bx lr + .pool + thumb_func_end sub_8120374 + + thumb_func_start sub_812038C +sub_812038C: @ 812038C + push {lr} + bl sub_811F01C + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =0x0000ffff + cmp r1, r0 + bne _081203AC + ldr r1, =0x020375f0 + movs r0, 0 + b _081203B6 + .pool +_081203AC: + ldr r0, =0x02021cc4 + bl CopyEasyChatWord + ldr r1, =0x020375f0 + movs r0, 0x1 +_081203B6: + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_812038C + + thumb_func_start sub_81203C4 +sub_81203C4: @ 81203C4 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002e28 + adds r2, r0, r1 + ldrb r0, [r2, 0x1] + cmp r0, 0xA + bne _081203EC + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + strb r0, [r2, 0x1] + b _081203F2 + .pool +_081203EC: + ldr r1, =0x020375f0 + movs r0, 0x1 + strh r0, [r1] +_081203F2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81203C4 + + thumb_func_start sub_81203FC +sub_81203FC: @ 81203FC + push {r4-r6,lr} + ldr r0, =0x03005d8c + ldr r4, [r0] + ldr r0, =0x00002e28 + adds r5, r4, r0 + ldrb r0, [r5, 0x1] + cmp r0, 0 + bne _08120410 + bl sub_81204DC +_08120410: + ldrb r0, [r5, 0x1] + lsls r0, 1 + ldr r1, =0x00002e2c + adds r6, r4, r1 + adds r0, r6, r0 + ldrh r1, [r0] + ldr r0, =0x0000ffff + cmp r1, r0 + beq _08120480 + bl GenerateRandomNumber + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x7 + ands r4, r0 + ldr r0, =0x02021fc4 + ldrb r1, [r5, 0x1] + lsls r1, 1 + adds r1, r6, r1 + ldrh r1, [r1] + bl CopyEasyChatWord + adds r2, r0, 0 + ldr r1, =gUnknown_082942FD + bl CopyString + adds r2, r0, 0 + ldr r0, =gUnknown_0859EFF0 + lsls r4, 2 + adds r4, r0 + ldr r1, [r4] + adds r0, r2, 0 + bl CopyString + adds r2, r0, 0 + ldr r1, =gUnknown_08294301 + bl CopyString + b _081204A2 + .pool +_08120480: + ldr r0, =0x02021fc4 + ldr r3, =gUnknown_0859F010 + ldrb r2, [r5, 0x2] + adds r1, r2, 0x1 + strb r1, [r5, 0x2] + lsls r2, 24 + lsrs r2, 24 + movs r6, 0xB9 + lsls r6, 6 + adds r1, r4, r6 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl CopyString +_081204A2: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _081204C4 + movs r0, 0xA + b _081204C8 + .pool +_081204C4: + ldrb r0, [r5, 0x1] + adds r0, 0x1 +_081204C8: + strb r0, [r5, 0x1] + ldr r1, =0x020375f0 + movs r0, 0x1 + strh r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81203FC + + thumb_func_start sub_81204DC +sub_81204DC: @ 81204DC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + ldr r0, =0x03005d8c + ldr r4, [r0] + ldr r0, =0x00002e28 + adds r0, r4, r0 + str r0, [sp, 0x18] + ldr r1, =gUnknown_0859F030 + mov r0, sp + movs r2, 0x18 + bl memcpy + movs r5, 0 + movs r1, 0x2 + add r1, sp + mov r8, r1 + movs r2, 0xB9 + lsls r2, 6 + adds r3, r4, r2 + adds r1, r3, 0 +_0812050C: + adds r0, r3, r5 + strb r5, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x7 + bls _0812050C + movs r5, 0 + ldr r3, [sp, 0x18] + adds r3, 0x4 + mov r9, r3 + adds r6, r1, 0 +_08120524: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r4, r5, 0x1 + adds r1, r4, 0 + bl __modsi3 + lsls r0, 16 + lsrs r1, r0, 16 + adds r2, r6, r5 + ldrb r7, [r2] + adds r1, r6, r1 + ldrb r0, [r1] + strb r0, [r2] + strb r7, [r1] + lsls r4, 16 + lsrs r5, r4, 16 + cmp r5, 0x7 + bls _08120524 + movs r0, 0 + mov r10, r0 + movs r5, 0 +_08120552: + lsls r4, r5, 2 + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + bl start_menu_is_selected_item_valid + add r4, r8 + strh r0, [r4] + add r0, r10 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x5 + bls _08120552 + movs r0, 0 + ldr r2, [sp, 0x18] + strb r0, [r2, 0x2] + movs r7, 0 + movs r5, 0 +_0812057E: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x2 + bhi _081205BC + cmp r7, 0x7 + bhi _081205BC + lsls r0, r5, 1 + add r0, r9 + ldr r1, =0x0000ffff + strh r1, [r0] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + adds r4, r5, 0x1 + b _0812060E + .pool +_081205BC: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + mov r1, r10 + bl __umodsi3 + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0 + adds r4, r5, 0x1 + lsls r6, r5, 1 + cmp r5, 0x5 + bhi _081205F8 + mov r3, r8 + ldrh r0, [r3] + b _081205EE +_081205DE: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r5, 0x5 + bhi _081205F8 + lsls r0, r1, 2 + adds r0, r3, r0 + ldrh r0, [r0] +_081205EE: + subs r0, r2, r0 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r0, 0 + bgt _081205DE +_081205F8: + cmp r1, 0x6 + bne _081205FE + movs r1, 0 +_081205FE: + lsls r0, r1, 2 + add r0, sp + ldrh r0, [r0] + bl sub_811EE90 + mov r2, r9 + adds r1, r2, r6 + strh r0, [r1] +_0812060E: + lsls r0, r4, 16 + lsrs r5, r0, 16 + cmp r5, 0x9 + bls _0812057E + 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_81204DC + + thumb_func_start sub_8120628 +sub_8120628: @ 8120628 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002e51 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_8120628 + + thumb_func_start sub_8120640 +sub_8120640: @ 8120640 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002e28 + adds r0, r1 + movs r1, 0 + strb r1, [r0, 0x1] + bx lr + .pool + thumb_func_end sub_8120640 + + thumb_func_start sub_8120658 +sub_8120658: @ 8120658 + push {lr} + bl sub_8133A60 + pop {r0} + bx r0 + thumb_func_end sub_8120658 + + thumb_func_start sub_8120664 +sub_8120664: @ 8120664 + push {lr} + bl sub_8120E50 + pop {r0} + bx r0 + thumb_func_end sub_8120664 + + thumb_func_start sub_8120670 +sub_8120670: @ 8120670 + push {lr} + bl sub_81201C8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _081206B6 + lsls r0, 2 + ldr r1, =_0812068C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0812068C: + .4byte _081206A0 + .4byte _081206A6 + .4byte _081206B2 + .4byte _081206AC + .4byte _081206B6 +_081206A0: + bl sub_8120628 + b _081206B6 +_081206A6: + bl sub_8120640 + b _081206B6 +_081206AC: + bl sub_8120664 + b _081206B6 +_081206B2: + bl sub_8120658 +_081206B6: + bl sub_8120B5C + pop {r0} + bx r0 + thumb_func_end sub_8120670 + + thumb_func_start sub_81206C0 +sub_81206C0: @ 81206C0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =sub_8120944 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x12] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81206C0 + + thumb_func_start sub_81206F0 +sub_81206F0: @ 81206F0 + ldr r1, =0x03002f84 + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_81206F0 + + thumb_func_start sub_81206FC +sub_81206FC: @ 81206FC + ldr r1, =0x03002f84 + movs r0, 0x1 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_81206FC + + thumb_func_start sub_8120708 +sub_8120708: @ 8120708 + push {r4,r5,lr} + sub sp, 0xC + adds r5, r0, 0 + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + ldr r0, =sub_81206FC + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0 + bl Print + ldr r0, =0x03002f84 + strb r4, [r0] + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8120708 + + thumb_func_start sub_8120748 +sub_8120748: @ 8120748 + push {r4-r6,lr} + adds r6, r1, 0 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0x5 + bls _08120756 + b _08120938 +_08120756: + lsls r0, 2 + ldr r1, =_08120764 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08120764: + .4byte _0812077C + .4byte _08120938 + .4byte _081207BC + .4byte _081207F8 + .4byte _081207F8 + .4byte _08120938 +_0812077C: + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r0, =0x020375e0 + ldrh r0, [r0] + ldr r3, =0x00002e36 + adds r1, r2, r3 + cmp r0, 0 + bne _08120790 + ldr r0, =0x00002e2a + adds r1, r2, r0 +_08120790: + adds r2, r1, 0 + adds r1, r6, 0 + adds r1, 0xC + movs r3, 0x5 +_08120798: + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _08120798 + movs r0, 0 + strb r0, [r6] + b _08120938 + .pool +_081207BC: + ldrb r1, [r6] + lsls r1, 1 + adds r0, r6, 0 + adds r0, 0xC + adds r0, r1 + ldrh r4, [r0] + adds r0, r4, 0 + bl sub_817C7F4 + str r0, [r6, 0x30] + movs r1, 0x3 + ands r1, r4 + lsrs r4, 3 + movs r0, 0x1 + ands r4, r0 + adds r1, r4 + adds r0, r6, 0 + bl sub_817C858 + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + ldr r0, [r6, 0x30] + ldrb r0, [r0] + cmp r0, 0xFF + beq _081207F4 + movs r0, 0 + b _08120936 +_081207F4: + movs r0, 0x3 + b _0812091A +_081207F8: + ldrb r3, [r6, 0x1] + lsls r1, r3, 3 + ldr r0, [r6, 0x30] + adds r2, r0, r1 + ldrb r1, [r6, 0x3] + cmp r1, 0x1 + beq _081208A0 + cmp r1, 0x1 + bgt _08120810 + cmp r1, 0 + beq _0812081C + b _08120938 +_08120810: + cmp r1, 0x2 + beq _08120850 + cmp r1, 0x3 + bne _0812081A + b _08120922 +_0812081A: + b _08120938 +_0812081C: + lsls r0, r3, 2 + adds r0, r6, r0 + ldrh r0, [r0, 0x18] + strb r0, [r6, 0x2] + ldrb r0, [r2] + cmp r0, 0x32 + bhi _08120844 + movs r1, 0x3 + bl __udivsi3 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 1 + adds r0, r1 + movs r1, 0x8C + lsls r1, 2 + adds r0, r1 + bl m4aSongNumStart +_08120844: + movs r0, 0x2 + strb r0, [r6, 0x3] + ldrb r0, [r6, 0x2] + subs r0, 0x1 + strb r0, [r6, 0x2] + b _08120938 +_08120850: + movs r0, 0x1 + strb r0, [r6, 0x3] + ldrb r0, [r2] + cmp r0, 0x32 + bhi _08120938 + movs r3, 0x4 + ldrsh r0, [r2, r3] + lsls r0, 4 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r0, [r6, 0x6] + ldr r4, =0x03007630 + ldr r5, =0x0000ffff + ldrh r2, [r6, 0x6] + adds r0, r4, 0 + adds r1, r5, 0 + bl MPlayVolumeControl + ldrb r1, [r6, 0x1] + lsls r1, 2 + adds r1, r6, r1 + movs r2, 0x80 + lsls r2, 2 + adds r0, r2, 0 + ldrh r1, [r1, 0x1A] + adds r0, r1 + strh r0, [r6, 0x8] + movs r3, 0x8 + ldrsh r2, [r6, r3] + adds r0, r4, 0 + adds r1, r5, 0 + bl MPlayPitchControl + b _08120938 + .pool +_081208A0: + ldrh r2, [r6, 0xA] + movs r3, 0xA + ldrsh r0, [r6, r3] + cmp r0, 0xA + ble _081208B0 + ldrh r0, [r6, 0x6] + subs r0, 0x2 + strh r0, [r6, 0x6] +_081208B0: + ands r1, r2 + cmp r1, 0 + beq _081208BC + ldrh r0, [r6, 0x8] + adds r0, 0x40 + b _081208C0 +_081208BC: + ldrh r0, [r6, 0x8] + subs r0, 0x40 +_081208C0: + strh r0, [r6, 0x8] + ldr r4, =0x03007630 + ldr r5, =0x0000ffff + ldrh r2, [r6, 0x6] + adds r0, r4, 0 + adds r1, r5, 0 + bl MPlayVolumeControl + movs r0, 0x8 + ldrsh r2, [r6, r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl MPlayPitchControl + ldrh r0, [r6, 0xA] + adds r0, 0x1 + strh r0, [r6, 0xA] + ldrb r0, [r6, 0x2] + subs r0, 0x1 + strb r0, [r6, 0x2] + lsls r0, 24 + cmp r0, 0 + bne _08120938 + ldrb r0, [r6, 0x1] + adds r0, 0x1 + strb r0, [r6, 0x1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + beq _08120918 + ldrb r0, [r6, 0x1] + ldr r1, [r6, 0x30] + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xFF + beq _08120918 + movs r0, 0 + b _08120936 + .pool +_08120918: + movs r0, 0x3 +_0812091A: + strb r0, [r6, 0x3] + movs r0, 0x2 + strb r0, [r6, 0x2] + b _08120938 +_08120922: + ldrb r0, [r6, 0x2] + subs r0, 0x1 + strb r0, [r6, 0x2] + lsls r0, 24 + cmp r0, 0 + bne _08120938 + ldr r0, =0x03007630 + bl MPlayStop_rev01 + movs r0, 0x4 +_08120936: + strb r0, [r6, 0x3] +_08120938: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8120748 + + thumb_func_start sub_8120944 +sub_8120944: @ 8120944 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r5, r0, r1 + ldr r1, =0x03006130 + adds r0, r5, 0 + bl sub_8120748 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x5 + bls _08120966 + b _08120B50 +_08120966: + lsls r0, 2 + ldr r1, =_0812097C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0812097C: + .4byte _08120994 + .4byte _081209B8 + .4byte _081209C8 + .4byte _08120A7E + .4byte _08120B40 + .4byte _08120A6E +_08120994: + bl sub_8120280 + ldr r0, =0x02021fc4 + bl sub_8120708 + movs r0, 0 + strh r0, [r5, 0xA] + strh r0, [r5, 0xC] + strh r0, [r5, 0xE] + strh r0, [r5, 0x10] + movs r0, 0x4 + bl sub_80A31E8 + movs r0, 0x1 + b _08120B4E + .pool +_081209B8: + bl sub_80A3200 + lsls r0, 24 + cmp r0, 0 + bne _081209C4 + b _08120B50 +_081209C4: + movs r0, 0x2 + b _08120B4E +_081209C8: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00002e28 + adds r4, r0, r2 + movs r0, 0xE + ldrsh r1, [r5, r0] + ldr r0, =0x02021fc4 + adds r1, r0 + movs r3, 0 + ldrb r0, [r1] + ldr r7, =0x03006130 + ldrh r2, [r5, 0x12] + ldr r6, =0x0203a128 + b _08120A02 + .pool +_081209F8: + adds r1, 0x1 + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + ldrb r0, [r1] +_08120A02: + cmp r0, 0 + beq _08120A12 + cmp r0, 0xFE + beq _08120A12 + cmp r0, 0xFC + beq _08120A12 + cmp r0, 0xFF + bne _081209F8 +_08120A12: + cmp r2, 0 + bne _08120A20 + movs r2, 0x10 + ldrsh r1, [r5, r2] + lsls r1, 1 + adds r0, r4, 0x2 + b _08120A2A +_08120A20: + movs r0, 0x10 + ldrsh r1, [r5, r0] + lsls r1, 1 + adds r0, r4, 0 + adds r0, 0xE +_08120A2A: + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x3 + ands r1, r0 + lsrs r0, 3 + movs r2, 0x1 + ands r0, r2 + adds r1, r0 + strh r1, [r6] + movs r1, 0x4 + ldrsh r0, [r7, r1] + adds r1, r3, 0 + bl __divsi3 + movs r1, 0 + strh r0, [r7, 0x4] + lsls r0, 16 + cmp r0, 0 + bgt _08120A54 + movs r0, 0x1 + strh r0, [r7, 0x4] +_08120A54: + ldrh r0, [r5, 0x10] + adds r0, 0x1 + strh r0, [r5, 0x10] + movs r2, 0xC + ldrsh r0, [r5, r2] + cmp r0, 0 + bne _08120A66 + movs r0, 0x3 + b _08120A68 +_08120A66: + movs r0, 0x5 +_08120A68: + strh r0, [r5, 0x8] + strh r1, [r5, 0xA] + b _08120B50 +_08120A6E: + ldrh r1, [r5, 0xC] + movs r2, 0xC + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _08120B4C + subs r0, r1, 0x1 + strh r0, [r5, 0xC] + b _08120B50 +_08120A7E: + ldr r1, =0x02021fc4 + movs r2, 0xE + ldrsh r0, [r5, r2] + adds r0, r1 + ldrb r4, [r0] + cmp r4, 0xFF + bne _08120AB0 + movs r0, 0x6 + bl sub_80A3228 + ldr r0, =0x03007630 + movs r1, 0x2 + bl sub_82E0308 + bl script_env_2_enable_and_set_ctx_running + adds r0, r6, 0 + bl DestroyTask + b _08120B50 + .pool +_08120AB0: + cmp r4, 0 + bne _08120AC6 + bl sub_81206F0 + ldrh r0, [r5, 0xE] + adds r0, 0x1 + strh r0, [r5, 0xE] + movs r0, 0x2 + strh r0, [r5, 0x8] + strh r4, [r5, 0xC] + b _08120B50 +_08120AC6: + cmp r4, 0xFE + bne _08120ADA + ldrh r0, [r5, 0xE] + adds r0, 0x1 + movs r1, 0 + strh r0, [r5, 0xE] + movs r0, 0x2 + strh r0, [r5, 0x8] + strh r1, [r5, 0xC] + b _08120B50 +_08120ADA: + cmp r4, 0xFC + bne _08120AEE + ldrh r0, [r5, 0xE] + adds r0, 0x2 + strh r0, [r5, 0xE] + movs r0, 0x2 + strh r0, [r5, 0x8] + movs r0, 0x8 + strh r0, [r5, 0xC] + b _08120B50 +_08120AEE: + cmp r4, 0x37 + bne _08120B04 + movs r4, 0 + strb r4, [r0] + bl sub_81206F0 + ldrh r0, [r5, 0xE] + adds r0, 0x1 + strh r0, [r5, 0xE] + strh r4, [r5, 0xC] + b _08120B50 +_08120B04: + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _08120B20 + cmp r0, 0x1 + bgt _08120B16 + cmp r0, 0 + beq _08120B1C + b _08120B50 +_08120B16: + cmp r0, 0x2 + beq _08120B28 + b _08120B50 +_08120B1C: + bl sub_81206F0 +_08120B20: + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + b _08120B50 +_08120B28: + ldrh r0, [r5, 0xE] + adds r0, 0x1 + movs r1, 0 + strh r0, [r5, 0xE] + strh r1, [r5, 0xA] + ldr r0, =0x03006130 + ldrh r0, [r0, 0x4] + strh r0, [r5, 0xC] + movs r0, 0x4 + b _08120B4E + .pool +_08120B40: + ldrh r0, [r5, 0xC] + subs r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _08120B50 +_08120B4C: + movs r0, 0x3 +_08120B4E: + strh r0, [r5, 0x8] +_08120B50: + bl sub_8197224 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8120944 + + thumb_func_start sub_8120B5C +sub_8120B5C: @ 8120B5C + push {lr} + ldr r0, =0x00004010 + movs r1, 0x45 + bl VarSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_8120B5C + + thumb_func_start sub_8120B70 +sub_8120B70: @ 8120B70 + push {r4-r7,lr} + sub sp, 0x8 + ldrb r1, [r0] + cmp r1, 0x2 + beq _08120B80 + cmp r1, 0x3 + beq _08120BA6 + b _08120C00 +_08120B80: + adds r5, r0, 0 + movs r4, 0 +_08120B84: + adds r0, r5, 0 + adds r0, 0x32 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08120B9E + movs r0, 0xB + muls r0, r4 + adds r0, 0x5 + adds r0, r5, r0 + movs r1, 0x1 + bl StopMusicWhileStringIsPrinted +_08120B9E: + adds r4, 0x1 + cmp r4, 0x3 + ble _08120B84 + b _08120C00 +_08120BA6: + adds r6, r0, 0 + movs r4, 0 + mov r7, sp + adds r5, r6, 0 + adds r5, 0x8 +_08120BB0: + adds r0, r6, 0x4 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _08120BF8 + mov r0, sp + adds r1, r5, 0 + movs r2, 0x7 + bl memcpy + movs r0, 0xFF + strb r0, [r7, 0x7] + mov r0, sp + bl sub_8009228 + cmp r0, 0 + beq _08120BF8 + mov r0, sp + movs r1, 0 + movs r2, 0x8 + bl memset + mov r0, sp + ldr r1, =gUnknown_085EDFB0 + bl CopyString + adds r0, r5, 0 + mov r1, sp + movs r2, 0x7 + bl memcpy + adds r0, r6, 0 + adds r0, 0x34 + adds r0, r4 + movs r1, 0x2 + strb r1, [r0] +_08120BF8: + adds r5, 0x7 + adds r4, 0x1 + cmp r4, 0x3 + ble _08120BB0 +_08120C00: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8120B70 + + thumb_func_start sub_8120C0C +sub_8120C0C: @ 8120C0C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + mov r8, r1 + adds r7, r2, 0 + ldrb r0, [r5] + cmp r0, 0x4 + bhi _08120CC4 + lsls r0, 2 + ldr r1, =_08120C2C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08120C2C: + .4byte _08120C92 + .4byte _08120CA2 + .4byte _08120C40 + .4byte _08120C6A + .4byte _08120CB0 +_08120C40: + adds r6, r5, 0 + movs r5, 0 + adds r4, r6, 0 + adds r4, 0x32 +_08120C48: + movs r0, 0xB + muls r0, r5 + adds r0, 0x5 + adds r0, r6, r0 + bl sub_8009228 + cmp r0, 0 + beq _08120C5E + mov r0, r8 + strb r0, [r4] + b _08120C60 +_08120C5E: + strb r7, [r4] +_08120C60: + adds r4, 0x1 + adds r5, 0x1 + cmp r5, 0x3 + ble _08120C48 + b _08120CC4 +_08120C6A: + adds r4, r5, 0 + adds r4, 0x34 + adds r6, r5, 0 + adds r6, 0x8 + movs r5, 0x3 +_08120C74: + adds r0, r6, 0 + bl sub_8009228 + cmp r0, 0 + beq _08120C84 + mov r1, r8 + strb r1, [r4] + b _08120C86 +_08120C84: + strb r7, [r4] +_08120C86: + adds r4, 0x1 + adds r6, 0x7 + subs r5, 0x1 + cmp r5, 0 + bge _08120C74 + b _08120CC4 +_08120C92: + cmp r3, 0x1 + bne _08120C9C + adds r0, r5, 0 + adds r0, 0x2A + b _08120CB8 +_08120C9C: + adds r0, r5, 0 + adds r0, 0x2A + b _08120CC2 +_08120CA2: + cmp r3, 0x1 + bne _08120CAC + mov r0, r8 + strb r0, [r5, 0x2] + b _08120CC4 +_08120CAC: + strb r7, [r5, 0x2] + b _08120CC4 +_08120CB0: + cmp r3, 0x1 + bne _08120CBE + adds r0, r5, 0 + adds r0, 0x20 +_08120CB8: + mov r1, r8 + strb r1, [r0] + b _08120CC4 +_08120CBE: + adds r0, r5, 0 + adds r0, 0x20 +_08120CC2: + strb r7, [r0] +_08120CC4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8120C0C + + thumb_func_start sub_8120CD0 +sub_8120CD0: @ 8120CD0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r1, r0, 0 + ldrb r0, [r1] + cmp r0, 0x3 + bne _08120D28 + cmp r2, 0x1 + bne _08120D28 + adds r7, r1, 0 + movs r6, 0 + mov r8, sp + adds r4, r7, 0 + adds r4, 0x34 + adds r5, r7, 0 + adds r5, 0x8 +_08120CF2: + adds r0, r7, 0x4 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0 + beq _08120D1E + mov r0, sp + adds r1, r5, 0 + movs r2, 0x7 + bl memcpy + movs r0, 0xFF + mov r1, r8 + strb r0, [r1, 0x7] + mov r0, sp + bl sub_8009228 + cmp r0, 0 + beq _08120D1A + movs r0, 0x1 + b _08120D1C +_08120D1A: + movs r0, 0x2 +_08120D1C: + strb r0, [r4] +_08120D1E: + adds r4, 0x1 + adds r5, 0x7 + adds r6, 0x1 + cmp r6, 0x3 + ble _08120CF2 +_08120D28: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8120CD0 + + thumb_func_start sub_8120D34 +sub_8120D34: @ 8120D34 + push {r4-r7,lr} + adds r3, r0, 0 + adds r6, r2, 0 + movs r2, 0 + subs r1, 0x1 + cmp r1, 0x1 + bhi _08120D44 + movs r2, 0x1 +_08120D44: + ldrb r0, [r3] + cmp r0, 0x4 + bhi _08120E02 + lsls r0, 2 + ldr r1, =_08120D58 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08120D58: + .4byte _08120DE6 + .4byte _08120DF0 + .4byte _08120D6C + .4byte _08120DC6 + .4byte _08120DF8 +_08120D6C: + adds r7, r3, 0 + cmp r2, 0 + beq _08120DA4 + movs r5, 0 + adds r4, r3, 0 + adds r4, 0x32 +_08120D78: + movs r0, 0xB + muls r0, r5 + adds r0, 0x5 + adds r1, r7, r0 + ldrb r0, [r1] + cmp r0, 0xFC + bne _08120D98 + ldrb r0, [r1, 0x1] + cmp r0, 0x15 + bne _08120D98 + adds r0, r1, 0 + bl StripExtendedControlCodes + movs r0, 0x1 + strb r0, [r4] + b _08120D9A +_08120D98: + strb r6, [r4] +_08120D9A: + adds r4, 0x1 + adds r5, 0x1 + cmp r5, 0x3 + ble _08120D78 + b _08120E02 +_08120DA4: + movs r5, 0 + adds r4, r3, 0 + adds r4, 0x32 +_08120DAA: + adds r0, r4, r5 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08120DBE + movs r0, 0xB + muls r0, r5 + adds r0, 0x5 + adds r0, r7, r0 + bl StripExtendedControlCodes +_08120DBE: + adds r5, 0x1 + cmp r5, 0x3 + ble _08120DAA + b _08120E02 +_08120DC6: + cmp r2, 0 + beq _08120E02 + movs r1, 0 + adds r4, r3, 0x4 + adds r2, r3, 0 + adds r2, 0x34 +_08120DD2: + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08120DDE + adds r0, r2, r1 + strb r6, [r0] +_08120DDE: + adds r1, 0x1 + cmp r1, 0x3 + ble _08120DD2 + b _08120E02 +_08120DE6: + cmp r2, 0 + beq _08120E02 + adds r0, r3, 0 + adds r0, 0x2A + b _08120E00 +_08120DF0: + cmp r2, 0 + beq _08120E02 + strb r6, [r3, 0x2] + b _08120E02 +_08120DF8: + cmp r2, 0 + beq _08120E02 + adds r0, r3, 0 + adds r0, 0x20 +_08120E00: + strb r6, [r0] +_08120E02: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8120D34 + + thumb_func_start sub_8120E08 +sub_8120E08: @ 8120E08 + push {r4,r5,lr} + ldr r2, =0x0203a12c + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002e28 + adds r0, r1 + str r0, [r2] + movs r3, 0 + movs r1, 0x3 + strb r1, [r0] + ldr r0, [r2] + strb r3, [r0, 0x1] + movs r5, 0 + movs r4, 0xFF +_08120E24: + ldr r0, [r2] + adds r0, 0x4 + adds r0, r3 + strb r5, [r0] + ldr r1, [r2] + adds r1, 0x8 + adds r1, r3 + ldrb r0, [r1] + orrs r0, r4 + strb r0, [r1] + adds r3, 0x1 + cmp r3, 0x3 + ble _08120E24 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8120E08 + + thumb_func_start sub_8120E50 +sub_8120E50: @ 8120E50 + ldr r3, =0x0203a12c + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002e28 + adds r0, r1 + str r0, [r3] + movs r2, 0 + movs r1, 0x3 + strb r1, [r0] + ldr r0, [r3] + strb r2, [r0, 0x1] + bx lr + .pool + thumb_func_end sub_8120E50 + + thumb_func_start sub_8120E74 +sub_8120E74: @ 8120E74 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x32 + bne _08120E80 + movs r0, 0 +_08120E80: + bl sub_80847F8 + pop {r1} + bx r1 + thumb_func_end sub_8120E74 + + thumb_func_start sub_8120E88 +sub_8120E88: @ 8120E88 + push {lr} + adds r3, r0, 0 + movs r2, 0 + ldr r1, =gUnknown_0859F048 +_08120E90: + ldrb r0, [r1] + cmp r0, r3 + bne _08120EA0 + adds r0, r1, 0 + b _08120EAA + .pool +_08120EA0: + adds r1, 0x10 + adds r2, 0x1 + cmp r2, 0x23 + ble _08120E90 + ldr r0, =gUnknown_0859F278 +_08120EAA: + pop {r1} + bx r1 + .pool + thumb_func_end sub_8120E88 + + thumb_func_start sub_8120EB4 +sub_8120EB4: @ 8120EB4 + push {lr} + bl sub_8120E88 + ldr r0, [r0, 0x4] + pop {r1} + bx r1 + thumb_func_end sub_8120EB4 + + thumb_func_start sub_8120EC0 +sub_8120EC0: @ 8120EC0 + push {lr} + bl sub_8120E88 + ldr r0, [r0, 0xC] + pop {r1} + bx r1 + thumb_func_end sub_8120EC0 + + thumb_func_start sub_8120ECC +sub_8120ECC: @ 8120ECC + push {lr} + bl sub_8120E88 + ldr r0, [r0, 0x8] + pop {r1} + bx r1 + thumb_func_end sub_8120ECC + + thumb_func_start sub_8120ED8 +sub_8120ED8: @ 8120ED8 + push {lr} + movs r1, 0 + ldr r2, =0x0203a12c + ldr r0, [r2] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _08120EFC +_08120EE6: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bhi _08120EFC + ldr r0, [r2] + adds r0, 0x4 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08120EE6 +_08120EFC: + adds r0, r1, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8120ED8 + + thumb_func_start sub_8120F08 +sub_8120F08: @ 8120F08 + ldr r1, =0x0203a12c + lsls r0, 2 + adds r0, 0x24 + ldr r2, [r1] + adds r2, r0 + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + lsls r1, 8 + orrs r0, r1 + ldrb r1, [r2, 0x2] + lsls r1, 16 + orrs r0, r1 + ldrb r1, [r2, 0x3] + lsls r1, 24 + orrs r0, r1 + bx lr + .pool + thumb_func_end sub_8120F08 + + thumb_func_start sub_8120F2C +sub_8120F2C: @ 8120F2C + ldr r2, =0x0203a12c + lsls r0, 2 + adds r0, 0x24 + ldr r2, [r2] + adds r2, r0 + strb r1, [r2] + lsrs r0, r1, 8 + strb r0, [r2, 0x1] + lsrs r0, r1, 16 + strb r0, [r2, 0x2] + lsrs r1, 24 + strb r1, [r2, 0x3] + bx lr + .pool + thumb_func_end sub_8120F2C + + thumb_func_start sub_8120F4C +sub_8120F4C: @ 8120F4C + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x0203a12c + ldr r0, [r0] + adds r0, 0x4 + adds r0, r5 + ldrb r0, [r0] + bl sub_8120E74 + adds r4, r0, 0 + adds r0, r5, 0 + bl sub_8120F08 + cmp r4, r0 + bhi _08120F74 + movs r0, 0 + b _08120F76 + .pool +_08120F74: + movs r0, 0x1 +_08120F76: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8120F4C + + thumb_func_start sub_8120F7C +sub_8120F7C: @ 8120F7C + push {r4,r5,lr} + adds r5, r1, 0 + ldr r2, =0x0203a12c + lsls r1, r0, 3 + subs r1, r0 + adds r1, 0x8 + ldr r4, [r2] + adds r4, r1 + adds r0, r5, 0 + movs r1, 0xFF + movs r2, 0x8 + bl memset + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x7 + bl memcpy + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8120F7C + + thumb_func_start sub_8120FAC +sub_8120FAC: @ 8120FAC + push {r4,r5,lr} + adds r5, r1, 0 + ldr r2, =0x0203a12c + lsls r1, r0, 3 + subs r1, r0 + adds r1, 0x8 + ldr r4, [r2] + adds r4, r1 + adds r0, r4, 0 + movs r1, 0xFF + movs r2, 0x7 + bl memset + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x7 + bl memcpy + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8120FAC + + thumb_func_start sub_8120FDC +sub_8120FDC: @ 8120FDC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + mov r8, r0 + adds r6, r1, 0 + ldr r0, =0x0203a12c + mov r9, r0 + ldr r0, [r0] + adds r0, 0x4 + add r0, r8 + strb r6, [r0] + ldr r0, =0x03005d90 + ldr r1, [r0] + mov r0, r8 + bl sub_8120FAC + lsls r4, r6, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_8120E74 + adds r1, r0, 0 + mov r0, r8 + bl sub_8120F2C + ldr r5, =0x02021cc4 + adds r0, r4, 0 + bl sub_8120E74 + adds r1, r0, 0 + adds r0, r5, 0 + movs r2, 0 + movs r3, 0xA + bl ConvertIntToDecimalString + ldr r4, =0x02021dc4 + adds r0, r6, 0 + bl sub_8120ECC + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + mov r1, r9 + ldr r0, [r1] + adds r0, 0x34 + add r0, r8 + ldr r1, =gUnknown_82E9531 + ldrb r1, [r1] + strb r1, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8120FDC + + thumb_func_start sub_8121064 +sub_8121064: @ 8121064 + push {r4-r7,lr} + adds r7, r0, 0 + adds r6, r1, 0 + movs r5, 0 + cmp r5, r6 + bge _0812107A +_08121070: + adds r0, r7, r5 + strb r5, [r0] + adds r5, 0x1 + cmp r5, r6 + blt _08121070 +_0812107A: + cmp r6, 0 + ble _081210B0 + adds r5, r6, 0 +_08121080: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + adds r4, r7, r4 + ldrb r2, [r4] + adds r0, r7, r0 + ldrb r1, [r0] + strb r1, [r4] + strb r2, [r0] + subs r5, 0x1 + cmp r5, 0 + bne _08121080 +_081210B0: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8121064 + + thumb_func_start sub_81210B8 +sub_81210B8: @ 81210B8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r7, sp + mov r8, sp + ldr r0, =gUnknown_0859F288 + ldr r0, [r0] + lsls r0, 3 + lsrs r0, 3 + adds r0, 0x3 + lsrs r0, 2 + lsls r0, 2 + mov r1, sp + subs r1, r0 + mov sp, r1 + mov r9, sp + mov r0, sp + movs r1, 0x24 + bl sub_8121064 + movs r5, 0 +_081210E4: + ldr r1, =gUnknown_0859F048 + mov r2, r9 + adds r0, r2, r5 + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r4, [r0] + ldrb r6, [r0, 0x1] + movs r1, 0 + ldr r2, =0x0203a12c + ldr r0, [r2] + ldrb r0, [r0, 0x4] + cmp r0, r4 + beq _08121112 +_08121100: + adds r1, 0x1 + cmp r1, 0x3 + bgt _08121112 + ldr r0, [r2] + adds r0, 0x4 + adds r0, r1 + ldrb r0, [r0] + cmp r0, r4 + bne _08121100 +_08121112: + cmp r1, 0x4 + bne _08121162 + adds r0, r4, 0 + bl sub_8120E74 + cmp r0, r6 + bcc _08121162 + ldr r0, =0x0203a12c + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x1] + bl sub_8120ED8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _08121150 + ldr r0, =0x03001178 + ldrb r0, [r0] + adds r1, r4, 0 + bl sub_8120FDC + b _0812115E + .pool +_08121150: + bl sub_8120ED8 + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl sub_8120FDC +_0812115E: + movs r0, 0x1 + b _0812116A +_08121162: + adds r5, 0x1 + cmp r5, 0x23 + ble _081210E4 + movs r0, 0 +_0812116A: + mov sp, r8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81210B8 + + thumb_func_start sub_8121178 +sub_8121178: @ 8121178 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r5, r0, 0 + ldr r6, =0x0203a12c + ldr r0, [r6] + adds r0, 0x4 + adds r0, r5 + ldrb r0, [r0] + mov r8, r0 + ldr r4, =0x02021cc4 + adds r0, r5, 0 + bl sub_8120F08 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0xA + bl ConvertIntToDecimalString + ldr r4, =0x02021dc4 + mov r0, r8 + bl sub_8120ECC + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + ldr r4, =0x02021ec4 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8120F7C + ldr r0, [r6] + adds r0, 0x34 + adds r0, r5 + ldrb r1, [r0] + adds r0, r4, 0 + bl StopMusicWhileStringIsPrinted + mov r0, r8 + bl sub_8120EC0 + bl box_related_two__2 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8121178 + + thumb_func_start sub_81211EC +sub_81211EC: @ 81211EC + push {r4,r5,lr} + sub sp, 0xC + ldr r1, =gUnknown_085EB7EA + movs r0, 0x1 + movs r2, 0 + bl GetStringWidth + adds r5, r0, 0 + movs r4, 0 + ldr r0, =0x0203a12c + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _08121230 +_08121208: + bl sub_8120EB4 + adds r1, r0, 0 + movs r0, 0x1 + movs r2, 0 + bl GetStringWidth + cmp r0, r5 + ble _0812121C + adds r5, r0, 0 +_0812121C: + adds r4, 0x1 + cmp r4, 0x3 + bgt _08121230 + ldr r0, =0x0203a12c + ldr r0, [r0] + adds r0, 0x4 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _08121208 +_08121230: + adds r0, r5, 0 + bl convert_pixel_width_to_tile_width + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8120ED8 + adds r3, r0, 0 + lsls r3, 25 + movs r0, 0x80 + lsls r0, 18 + adds r3, r0 + lsrs r3, 24 + movs r0, 0 + movs r1, 0 + adds r2, r4, 0 + bl CreateWindowFromRect + ldr r1, =0x0203a130 + strb r0, [r1] + ldrb r0, [r1] + movs r1, 0 + bl SetStandardWindowBorderStyle + movs r4, 0 + ldr r0, =0x0203a12c + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _081212AA + movs r5, 0x80 + lsls r5, 17 +_08121272: + bl sub_8120EB4 + adds r2, r0, 0 + ldr r0, =0x0203a130 + ldrb r0, [r0] + lsrs r1, r5, 24 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + movs r0, 0x80 + lsls r0, 21 + adds r5, r0 + adds r4, 0x1 + cmp r4, 0x3 + bgt _081212AA + ldr r0, =0x0203a12c + ldr r0, [r0] + adds r0, 0x4 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _08121272 +_081212AA: + ldr r5, =0x0203a130 + ldrb r0, [r5] + ldr r2, =gUnknown_085EB7EA + lsls r1, r4, 4 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldrb r4, [r5] + bl sub_8120ED8 + adds r1, r0, 0 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + ldrb r0, [r5] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81211EC + + thumb_func_start sub_81212FC +sub_81212FC: @ 81212FC + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r5, [r4, r0] + cmp r5, 0 + beq _08121320 + cmp r5, 0x1 + beq _0812132C + b _08121376 + .pool +_08121320: + bl sub_81211EC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08121376 +_0812132C: + bl ProcessMenuInput + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _08121376 + adds r0, 0x1 + cmp r4, r0 + beq _0812134E + bl sub_8120ED8 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _0812135C +_0812134E: + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + b _08121364 + .pool +_0812135C: + ldr r0, =0x020375f0 + strh r5, [r0] + ldr r0, =0x03001178 + strb r4, [r0] +_08121364: + ldr r0, =0x0203a130 + ldrb r0, [r0] + bl sub_80E2A78 + adds r0, r6, 0 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running +_08121376: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81212FC + + thumb_func_start sub_8121388 +sub_8121388: @ 8121388 + push {lr} + ldr r0, =sub_81212FC + movs r1, 0x50 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_8121388 + + thumb_func_start sub_812139C +sub_812139C: @ 812139C + push {lr} + ldr r0, =0x03001178 + ldrb r0, [r0] + bl sub_8121178 + pop {r0} + bx r0 + .pool + thumb_func_end sub_812139C + + thumb_func_start sub_81213B0 +sub_81213B0: @ 81213B0 + push {lr} + ldr r1, =0x0203a12c + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00002e28 + adds r0, r2 + str r0, [r1] + bl sub_8120ED8 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81213B0 + + thumb_func_start sub_81213D8 +sub_81213D8: @ 81213D8 + push {r4,r5,lr} + ldr r2, =0x0203a12c + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r3, =0x00002e28 + adds r0, r1, r3 + str r0, [r2] + ldr r5, =0x03001178 + ldrb r0, [r5] + ldr r2, =0x00002e2c + adds r1, r2 + adds r1, r0 + ldrb r4, [r1] + bl sub_8120F4C + cmp r0, 0x1 + beq _08121414 + movs r0, 0 + b _0812141E + .pool +_08121414: + ldrb r0, [r5] + adds r1, r4, 0 + bl sub_8120FDC + movs r0, 0x1 +_0812141E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81213D8 + + thumb_func_start sub_8121424 +sub_8121424: @ 8121424 + push {lr} + ldr r1, =0x0203a12c + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00002e28 + adds r0, r2 + str r0, [r1] + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _08121448 + movs r0, 0x1 + b _0812144A + .pool +_08121448: + movs r0, 0 +_0812144A: + pop {r1} + bx r1 + thumb_func_end sub_8121424 + + thumb_func_start sub_8121450 +sub_8121450: @ 8121450 + push {lr} + ldr r1, =0x0203a12c + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00002e28 + adds r0, r2 + str r0, [r1] + bl sub_81210B8 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8121450 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/menu_helpers.s b/asm/menu_helpers.s new file mode 100644 index 000000000..aaa9c2e24 --- /dev/null +++ b/asm/menu_helpers.s @@ -0,0 +1,986 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8121DA0 +sub_8121DA0: @ 8121DA0 + push {r4,lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0xE + movs r1, 0 + bl SetGpuReg + movs r0, 0xC + movs r1, 0 + bl SetGpuReg + movs r0, 0xA + movs r1, 0 + bl SetGpuReg + movs r0, 0x8 + movs r1, 0 + bl SetGpuReg + mov r1, sp + movs r0, 0 + strh r0, [r1] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x0100c000 + mov r0, sp + bl CpuSet + movs r4, 0 + str r4, [sp, 0x4] + add r0, sp, 0x4 + movs r1, 0xE0 + lsls r1, 19 + ldr r2, =0x05000100 + bl CpuSet + add r0, sp, 0x8 + strh r4, [r0] + movs r1, 0xA0 + lsls r1, 19 + ldr r2, =0x01000200 + bl CpuSet + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8121DA0 + + thumb_func_start sub_8121E10 +sub_8121E10: @ 8121E10 + push {lr} + 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 + pop {r0} + bx r0 + thumb_func_end sub_8121E10 + + thumb_func_start SetVBlankHBlankCallbacksToNull +@ void SetVBlankHBlankCallbacksToNull() +SetVBlankHBlankCallbacksToNull: @ 8121E68 + push {lr} + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl SetHBlankCallback + pop {r0} + bx r0 + thumb_func_end SetVBlankHBlankCallbacksToNull + + thumb_func_start DisplayMessageAndContinueTask +@ void DisplayMessageAndContinueTask(u8 taskId, u8 windowId, u16 windowBorderFirstTileNum, u8 windowBorderPalette, u8 fontId, u8 speed, u8 *str, void ( *callback)(u8 taskId)) +DisplayMessageAndContinueTask: @ 8121E7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + ldr r4, [sp, 0x28] + ldr r5, [sp, 0x2C] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r1, 24 + adds r6, r1, 0 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r7, r4, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =0x0203a140 + strb r6, [r0] + adds r0, r6, 0 + movs r1, 0x1 + bl sub_8197B1C + ldr r4, =0x02021fc4 + ldr r0, [sp, 0x30] + cmp r0, r4 + beq _08121EC0 + adds r0, r4, 0 + ldr r1, [sp, 0x30] + bl ExpandStringRefs +_08121EC0: + ldr r2, =0x03003014 + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + 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] + adds r0, r6, 0 + adds r1, r7, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl AddTextPrinterParametrized + ldr r1, =0x0300117c + ldr r0, [sp, 0x34] + str r0, [r1] + ldr r1, =0x03005e00 + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldr r1, =Task_ContinueTaskAfterMessagePrints + str r1, [r0] + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end DisplayMessageAndContinueTask + + thumb_func_start sub_8121F20 +sub_8121F20: @ 8121F20 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl RunTextPrinters + adds r0, r4, 0 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8121F20 + + thumb_func_start Task_ContinueTaskAfterMessagePrints +@ void Task_ContinueTaskAfterMessagePrints(u8 taskId) +Task_ContinueTaskAfterMessagePrints: @ 8121F3C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0203a140 + ldrb r0, [r0] + bl sub_8121F20 + lsls r0, 16 + cmp r0, 0 + bne _08121F5A + ldr r0, =0x0300117c + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 +_08121F5A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end Task_ContinueTaskAfterMessagePrints + + thumb_func_start sub_8121F68 +sub_8121F68: @ 8121F68 + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x0203a138 + ldr r2, [r1, 0x4] + ldr r1, [r1] + str r1, [r3] + str r2, [r3, 0x4] + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =Task_CallYesOrNoCallback + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8121F68 + + thumb_func_start CreateYesNoMenuWithCallbacks +@ void CreateYesNoMenuWithCallbacks(u8 taskId, struct WindowTemplate *windowTemplate, int a3, int a4, int a5, u16 borderFirstTileNum, u8 borderPalette, void ( **callbacks)(u8 taskId)) +CreateYesNoMenuWithCallbacks: @ 8121F94 + push {r4,r5,lr} + adds r4, r0, 0 + adds r0, r1, 0 + ldr r1, [sp, 0x10] + ldr r2, [sp, 0x14] + ldr r5, [sp, 0x18] + lsls r4, 24 + lsrs r4, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + movs r3, 0 + bl CreateYesNoMenu + ldr r2, =0x0203a138 + ldr r0, [r5] + ldr r1, [r5, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =Task_CallYesOrNoCallback + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end CreateYesNoMenuWithCallbacks + + thumb_func_start Task_CallYesOrNoCallback +@ void Task_CallYesOrNoCallback(u8 taskId) +Task_CallYesOrNoCallback: @ 8121FDC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _08122002 + cmp r1, 0 + bgt _08121FFC + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08122018 + b _08122028 +_08121FFC: + cmp r1, 0x1 + beq _08122018 + b _08122028 +_08122002: + movs r0, 0x5 + bl audio_play + ldr r0, =0x0203a138 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + b _08122028 + .pool +_08122018: + movs r0, 0x5 + bl audio_play + ldr r0, =0x0203a138 + ldr r1, [r0, 0x4] + adds r0, r4, 0 + bl _call_via_r1 +_08122028: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end Task_CallYesOrNoCallback + + thumb_func_start AdjustQuantityAccordingToDPadInput +@ bool8 AdjustQuantityAccordingToDPadInput(u16 *quantity, u16 maxQuantity) +AdjustQuantityAccordingToDPadInput: @ 8122034 + push {r4-r6,lr} + adds r2, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r5, r1, 0 + ldrh r4, [r2] + adds r6, r4, 0 + ldr r0, =0x030022c0 + ldrh r0, [r0, 0x30] + movs r3, 0xF0 + ands r3, r0 + cmp r3, 0x40 + bne _0812206C + adds r0, r4, 0x1 + strh r0, [r2] + movs r3, 0 + ldrsh r0, [r2, r3] + cmp r0, r1 + ble _0812205E + movs r0, 0x1 + strh r0, [r2] +_0812205E: + movs r0, 0 + ldrsh r1, [r2, r0] +_08122062: + lsls r0, r4, 16 + b _081220B6 + .pool +_0812206C: + cmp r3, 0x80 + bne _08122082 + subs r0, r4, 0x1 + strh r0, [r2] + lsls r0, 16 + cmp r0, 0 + bgt _0812207C + strh r1, [r2] +_0812207C: + movs r3, 0 + ldrsh r1, [r2, r3] + b _08122062 +_08122082: + cmp r3, 0x10 + bne _0812209C + adds r0, r4, 0 + adds r0, 0xA + strh r0, [r2] + movs r1, 0 + ldrsh r0, [r2, r1] + cmp r0, r5 + ble _08122096 + strh r5, [r2] +_08122096: + movs r3, 0 + ldrsh r1, [r2, r3] + b _08122062 +_0812209C: + cmp r3, 0x20 + bne _081220C6 + adds r0, r4, 0 + subs r0, 0xA + strh r0, [r2] + lsls r0, 16 + cmp r0, 0 + bgt _081220B0 + movs r0, 0x1 + strh r0, [r2] +_081220B0: + movs r0, 0 + ldrsh r1, [r2, r0] + lsls r0, r6, 16 +_081220B6: + asrs r0, 16 + cmp r1, r0 + beq _081220C6 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + b _081220C8 +_081220C6: + movs r0, 0 +_081220C8: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end AdjustQuantityAccordingToDPadInput + + thumb_func_start GetLRKeysState +GetLRKeysState: @ 81220D0 + push {lr} + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x1 + bne _08122106 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _081220F8 + movs r0, 0x1 + b _08122108 + .pool +_081220F8: + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _08122106 + movs r0, 0x2 + b _08122108 +_08122106: + movs r0, 0 +_08122108: + pop {r1} + bx r1 + thumb_func_end GetLRKeysState + + thumb_func_start sub_812210C +sub_812210C: @ 812210C + push {lr} + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x1 + bne _08122142 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x30] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _08122134 + movs r0, 0x1 + b _08122144 + .pool +_08122134: + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _08122142 + movs r0, 0x2 + b _08122144 +_08122142: + movs r0, 0 +_08122144: + pop {r1} + bx r1 + thumb_func_end sub_812210C + + thumb_func_start sub_8122148 +sub_8122148: @ 8122148 + push {lr} + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _08122174 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, =0x00001919 + cmp r1, r0 + beq _08122166 + bl InUnionRoom + cmp r0, 0x1 + bne _08122174 +_08122166: + movs r0, 0 + b _08122176 + .pool +_08122174: + movs r0, 0x1 +_08122176: + pop {r1} + bx r1 + thumb_func_end sub_8122148 + + thumb_func_start itemid_80BF6D8_mail_related +itemid_80BF6D8_mail_related: @ 812217C + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + bl is_c1_link_related_active + cmp r0, 0x1 + beq _08122192 + bl InUnionRoom + cmp r0, 0x1 + bne _081221A4 +_08122192: + adds r0, r4, 0 + bl itemid_is_mail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081221A4 + movs r0, 0 + b _081221A6 +_081221A4: + movs r0, 0x1 +_081221A6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end itemid_80BF6D8_mail_related + + thumb_func_start sub_81221AC +sub_81221AC: @ 81221AC + push {lr} + bl is_c1_link_related_active + cmp r0, 0x1 + beq _081221BE + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081221C8 +_081221BE: + movs r0, 0x1 + b _081221CA + .pool +_081221C8: + movs r0, 0 +_081221CA: + pop {r1} + bx r1 + thumb_func_end sub_81221AC + + thumb_func_start sub_81221D0 +sub_81221D0: @ 81221D0 + push {lr} + bl sub_81221AC + lsls r0, 24 + cmp r0, 0 + beq _081221E6 + bl sub_8087598 + lsls r0, 24 + lsrs r0, 24 + b _081221E8 +_081221E6: + movs r0, 0 +_081221E8: + pop {r1} + bx r1 + thumb_func_end sub_81221D0 + + thumb_func_start sub_81221EC +sub_81221EC: @ 81221EC + push {lr} + bl sub_81221D0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08122202 + bl sub_800B504 + cmp r0, 0x1 + bne _08122206 +_08122202: + movs r0, 0x1 + b _08122208 +_08122206: + movs r0, 0 +_08122208: + pop {r1} + bx r1 + thumb_func_end sub_81221EC + + thumb_func_start atk2D_jumpifarraynotequal +atk2D_jumpifarraynotequal: @ 812220C + push {r4-r6,lr} + adds r6, r2, 0 + ldr r2, [sp, 0x10] + lsls r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + adds r4, r0, 0 + movs r0, 0 + strb r0, [r3] + movs r2, 0 + lsrs r1, 24 + cmp r2, r1 + bcs _08122240 +_08122226: + lsls r0, r2, 2 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0 + beq _08122236 + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] +_08122236: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, r1 + bcc _08122226 +_08122240: + ldrb r0, [r3] + adds r1, r0, 0x1 + strb r1, [r3] + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, r5 + bls _08122252 + strb r5, [r6] + b _08122254 +_08122252: + strb r1, [r6] +_08122254: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end atk2D_jumpifarraynotequal + + thumb_func_start sub_812225C +sub_812225C: @ 812225C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + ldrh r0, [r4] + cmp r0, 0 + beq _0812227A + adds r0, r2 + cmp r0, r3 + ble _0812227A + subs r0, r3, r2 + strh r0, [r4] +_0812227A: + ldrh r0, [r4] + ldrh r1, [r5] + adds r0, r1 + cmp r0, r3 + blt _08122290 + cmp r3, 0 + bne _0812228C + strh r3, [r5] + b _08122290 +_0812228C: + subs r0, r3, 0x1 + strh r0, [r5] +_08122290: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_812225C + + thumb_func_start sub_8122298 +sub_8122298: @ 8122298 + push {r4-r7,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldr r0, [sp, 0x14] + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r6, r3, 24 + lsls r2, r0, 24 + lsrs r0, r2, 24 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081222F0 + lsrs r2, 25 + ldrh r0, [r4] + cmp r0, r2 + bcc _08122322 + movs r1, 0 + subs r0, r2 + cmp r1, r0 + bge _08122322 + ldrh r0, [r5] + adds r0, r7 + cmp r0, r6 + beq _08122322 +_081222CC: + ldrh r0, [r4] + subs r0, 0x1 + strh r0, [r4] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + ldrh r0, [r4] + subs r0, r2 + cmp r1, r0 + bge _08122322 + ldrh r0, [r5] + adds r0, r7 + cmp r0, r6 + bne _081222CC + b _08122322 +_081222F0: + ldrh r3, [r4] + lsrs r2, 25 + adds r0, r2, 0x1 + cmp r3, r0 + blt _08122322 + movs r1, 0 + subs r0, r3, r2 + b _08122316 +_08122300: + ldrh r0, [r4] + subs r0, 0x1 + strh r0, [r4] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + ldrh r0, [r4] + subs r0, r2 +_08122316: + cmp r1, r0 + bgt _08122322 + ldrh r0, [r5] + adds r0, r7 + cmp r0, r6 + bne _08122300 +_08122322: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8122298 + + thumb_func_start sub_8122328 +sub_8122328: @ 8122328 + push {lr} + ldr r0, =gUnknown_0859F514 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0859F51C + bl LoadCompressedObjectPalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_8122328 + + thumb_func_start sub_8122344 +sub_8122344: @ 8122344 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + lsls r1, 24 + lsrs r6, r1, 24 + movs r5, 0 + cmp r5, r6 + bcs _0812239C + ldr r7, =0x02020630 +_08122358: + lsls r1, r5, 4 + ldr r0, =gUnknown_0859F524 + movs r2, 0 + movs r3, 0 + bl AddObjectToFront + mov r1, r8 + adds r4, r1, r5 + strb r0, [r4] + cmp r5, 0 + beq _0812237E + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + movs r1, 0x1 + bl StartObjectImageAnim +_0812237E: + ldrb r1, [r4] + 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] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r6 + bcc _08122358 +_0812239C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8122344 + + thumb_func_start sub_81223B0 +sub_81223B0: @ 81223B0 + push {r4-r7,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + movs r4, 0 + cmp r4, r5 + bcs _081223F6 + ldr r7, =0x02020630 +_081223C0: + subs r0, r5, 0x1 + cmp r4, r0 + bne _081223DC + adds r0, r6, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + bl RemoveObjectAndFreeResources + b _081223EC + .pool +_081223DC: + adds r0, r6, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + bl RemoveObjectAndFreeTiles +_081223EC: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _081223C0 +_081223F6: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81223B0 + + thumb_func_start sub_81223FC +sub_81223FC: @ 81223FC + push {r4-r7,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + lsls r2, 24 + lsrs r0, r2, 24 + movs r3, 0 + cmp r3, r4 + bcs _0812243E + ldr r1, =0x02020630 + mov r12, r1 + movs r1, 0x1 + ands r0, r1 + lsls r5, r0, 2 + movs r7, 0x5 + negs r7, r7 +_0812241C: + adds r0, r6, r3 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r12 + adds r1, 0x3E + ldrb r2, [r1] + adds r0, r7, 0 + ands r0, r2 + orrs r0, r5 + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r4 + bcc _0812241C +_0812243E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81223FC + + thumb_func_start sub_8122448 +@ void sub_8122448(int a1, u8 a2, u16 x, u16 y) +sub_8122448: @ 8122448 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + lsls r2, 16 + lsrs r7, r2, 16 + lsls r3, 16 + lsrs r3, 16 + mov r9, r3 + movs r0, 0x80 + ands r0, r4 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0x7F + ands r4, r0 + movs r3, 0 + cmp r3, r4 + bcs _081224C8 + ldr r5, =0x02020630 + lsls r0, r7, 16 + asrs r0, 16 + subs r0, 0x8 + mov r12, r0 +_0812247E: + subs r0, r4, 0x1 + cmp r3, r0 + bne _081224A0 + mov r0, r8 + cmp r0, 0 + beq _081224A0 + adds r2, r6, r3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r12 + strh r1, [r0, 0x24] + b _081224AE + .pool +_081224A0: + adds r2, r6, r3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r7, [r0, 0x24] +_081224AE: + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r9 + adds r1, 0x1 + strh r1, [r0, 0x22] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r4 + bcc _0812247E +_081224C8: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8122448 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/metatile_behavior.s b/asm/metatile_behavior.s new file mode 100644 index 000000000..30b0f4348 --- /dev/null +++ b/asm/metatile_behavior.s @@ -0,0 +1,2610 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start ShouldDoJumpLandingDustEffect +ShouldDoJumpLandingDustEffect: @ 8088DEC + movs r0, 0x1 + bx lr + thumb_func_end ShouldDoJumpLandingDustEffect + + thumb_func_start sub_8088DF0 +sub_8088DF0: @ 8088DF0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_08486EFC + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08088E0C + movs r0, 0 + b _08088E0E + .pool +_08088E0C: + movs r0, 0x1 +_08088E0E: + pop {r1} + bx r1 + thumb_func_end sub_8088DF0 + + thumb_func_start MetatileBehavior_IsJumpEast +MetatileBehavior_IsJumpEast: @ 8088E14 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x38 + beq _08088E22 + movs r0, 0 + b _08088E24 +_08088E22: + movs r0, 0x1 +_08088E24: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsJumpEast + + thumb_func_start MetatileBehavior_IsJumpWest +MetatileBehavior_IsJumpWest: @ 8088E28 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x39 + beq _08088E36 + movs r0, 0 + b _08088E38 +_08088E36: + movs r0, 0x1 +_08088E38: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsJumpWest + + thumb_func_start MetatileBehavior_IsJumpNorth +MetatileBehavior_IsJumpNorth: @ 8088E3C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3A + beq _08088E4A + movs r0, 0 + b _08088E4C +_08088E4A: + movs r0, 0x1 +_08088E4C: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsJumpNorth + + thumb_func_start MetatileBehavior_IsJumpSouth +MetatileBehavior_IsJumpSouth: @ 8088E50 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3B + beq _08088E5E + movs r0, 0 + b _08088E60 +_08088E5E: + movs r0, 0x1 +_08088E60: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsJumpSouth + + thumb_func_start sub_8088E64 +sub_8088E64: @ 8088E64 + push {lr} + lsls r0, 24 + movs r1, 0xFE + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _08088E78 + movs r0, 0 + b _08088E7A +_08088E78: + movs r0, 0x1 +_08088E7A: + pop {r1} + bx r1 + thumb_func_end sub_8088E64 + + thumb_func_start MetatileBehavior_IsSandOrDeepSand +MetatileBehavior_IsSandOrDeepSand: @ 8088E80 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x21 + beq _08088E8E + cmp r0, 0x6 + bne _08088E92 +_08088E8E: + movs r0, 0x1 + b _08088E94 +_08088E92: + movs r0, 0 +_08088E94: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsSandOrDeepSand + + thumb_func_start MetatileBehavior_IsDeepSand +MetatileBehavior_IsDeepSand: @ 8088E98 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + beq _08088EA6 + movs r0, 0 + b _08088EA8 +_08088EA6: + movs r0, 0x1 +_08088EA8: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsDeepSand + + thumb_func_start MetatileBehavior_IsReflective +MetatileBehavior_IsReflective: @ 8088EAC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + beq _08088ECA + cmp r0, 0x16 + beq _08088ECA + cmp r0, 0x1A + beq _08088ECA + cmp r0, 0x20 + beq _08088ECA + cmp r0, 0x14 + beq _08088ECA + cmp r0, 0x2B + bne _08088ECE +_08088ECA: + movs r0, 0x1 + b _08088ED0 +_08088ECE: + movs r0, 0 +_08088ED0: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsReflective + + thumb_func_start MetatileBehavior_IsIce +MetatileBehavior_IsIce: @ 8088ED4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x20 + beq _08088EE2 + movs r0, 0 + b _08088EE4 +_08088EE2: + movs r0, 0x1 +_08088EE4: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsIce + + thumb_func_start is_tile_x69_2_warp_door +is_tile_x69_2_warp_door: @ 8088EE8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x69 + beq _08088EF6 + movs r0, 0 + b _08088EF8 +_08088EF6: + movs r0, 0x1 +_08088EF8: + pop {r1} + bx r1 + thumb_func_end is_tile_x69_2_warp_door + + thumb_func_start sub_8088EFC +sub_8088EFC: @ 8088EFC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8D + beq _08088F0A + cmp r0, 0x69 + bne _08088F0E +_08088F0A: + movs r0, 0x1 + b _08088F10 +_08088F0E: + movs r0, 0 +_08088F10: + pop {r1} + bx r1 + thumb_func_end sub_8088EFC + + thumb_func_start MetatileBehavior_IsEscalator +MetatileBehavior_IsEscalator: @ 8088F14 + push {lr} + lsls r0, 24 + movs r1, 0x96 + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _08088F28 + movs r0, 0 + b _08088F2A +_08088F28: + movs r0, 0x1 +_08088F2A: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsEscalator + + thumb_func_start sub_8088F30 +sub_8088F30: @ 8088F30 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + beq _08088F3E + movs r0, 0 + b _08088F40 +_08088F3E: + movs r0, 0x1 +_08088F40: + pop {r1} + bx r1 + thumb_func_end sub_8088F30 + + thumb_func_start MetatileBehavior_IsLadder +MetatileBehavior_IsLadder: @ 8088F44 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x61 + beq _08088F52 + movs r0, 0 + b _08088F54 +_08088F52: + movs r0, 0x1 +_08088F54: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsLadder + + thumb_func_start sub_8088F58 +sub_8088F58: @ 8088F58 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x60 + beq _08088F6A + cmp r0, 0x6C + beq _08088F6A + cmp r0, 0x6E + bne _08088F6E +_08088F6A: + movs r0, 0x1 + b _08088F70 +_08088F6E: + movs r0, 0 +_08088F70: + pop {r1} + bx r1 + thumb_func_end sub_8088F58 + + thumb_func_start sub_8088F74 +sub_8088F74: @ 8088F74 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6E + beq _08088F82 + movs r0, 0 + b _08088F84 +_08088F82: + movs r0, 0x1 +_08088F84: + pop {r1} + bx r1 + thumb_func_end sub_8088F74 + + thumb_func_start MetatileBehavior_IsSurfableWaterOrUnderwater +MetatileBehavior_IsSurfableWaterOrUnderwater: @ 8088F88 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_08486EFC + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08088FA4 + movs r0, 0 + b _08088FA6 + .pool +_08088FA4: + movs r0, 0x1 +_08088FA6: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsSurfableWaterOrUnderwater + + thumb_func_start MetatileBehavior_IsEastArrowWarp +MetatileBehavior_IsEastArrowWarp: @ 8088FAC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x62 + beq _08088FBA + movs r0, 0 + b _08088FBC +_08088FBA: + movs r0, 0x1 +_08088FBC: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsEastArrowWarp + + thumb_func_start MetatileBehavior_IsWestArrowWarp +MetatileBehavior_IsWestArrowWarp: @ 8088FC0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x63 + beq _08088FCE + movs r0, 0 + b _08088FD0 +_08088FCE: + movs r0, 0x1 +_08088FD0: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsWestArrowWarp + + thumb_func_start MetatileBehavior_IsNorthArrowWarp +MetatileBehavior_IsNorthArrowWarp: @ 8088FD4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x64 + beq _08088FE2 + cmp r0, 0x1B + bne _08088FE6 +_08088FE2: + movs r0, 0x1 + b _08088FE8 +_08088FE6: + movs r0, 0 +_08088FE8: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsNorthArrowWarp + + thumb_func_start MetatileBehavior_IsSouthArrowWarp +MetatileBehavior_IsSouthArrowWarp: @ 8088FEC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x65 + beq _08088FFE + cmp r0, 0x6D + beq _08088FFE + cmp r0, 0x1C + bne _08089002 +_08088FFE: + movs r0, 0x1 + b _08089004 +_08089002: + movs r0, 0 +_08089004: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsSouthArrowWarp + + thumb_func_start sub_8089008 +sub_8089008: @ 8089008 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r5, 0 + adds r0, r4, 0 + bl MetatileBehavior_IsEastArrowWarp + lsls r0, 24 + cmp r0, 0 + bne _08089040 + adds r0, r4, 0 + bl MetatileBehavior_IsWestArrowWarp + lsls r0, 24 + cmp r0, 0 + bne _08089040 + adds r0, r4, 0 + bl MetatileBehavior_IsNorthArrowWarp + lsls r0, 24 + cmp r0, 0 + bne _08089040 + adds r0, r4, 0 + bl MetatileBehavior_IsSouthArrowWarp + lsls r0, 24 + cmp r0, 0 + beq _08089042 +_08089040: + movs r5, 0x1 +_08089042: + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8089008 + + thumb_func_start sub_808904C +sub_808904C: @ 808904C + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xC0 + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0x8 + bls _08089082 + adds r0, r1, 0 + subs r0, 0x50 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _08089082 + cmp r1, 0xD0 + beq _08089082 + cmp r1, 0xD2 + beq _08089082 + cmp r1, 0x13 + beq _08089082 + cmp r1, 0x20 + beq _08089082 + cmp r1, 0xBB + beq _08089082 + cmp r1, 0xBC + bne _08089086 +_08089082: + movs r0, 0x1 + b _08089088 +_08089086: + movs r0, 0 +_08089088: + pop {r1} + bx r1 + thumb_func_end sub_808904C + + thumb_func_start MetatileBehavior_IsIce_2 +@ bool8 MetatileBehavior_IsIce_2(u8 metatileBehavior) +MetatileBehavior_IsIce_2: @ 808908C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x20 + beq _0808909A + movs r0, 0 + b _0808909C +_0808909A: + movs r0, 0x1 +_0808909C: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsIce_2 + + thumb_func_start MetatileBehavior_IsTrickHouseSlipperyFloor +@ bool8 MetatileBehavior_IsTrickHouseSlipperyFloor(u8 metatileBehavior) +MetatileBehavior_IsTrickHouseSlipperyFloor: @ 80890A0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x48 + beq _080890AE + movs r0, 0 + b _080890B0 +_080890AE: + movs r0, 0x1 +_080890B0: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsTrickHouseSlipperyFloor + + thumb_func_start MetatileBehavior_0x05 +MetatileBehavior_0x05: @ 80890B4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + beq _080890C2 + movs r0, 0 + b _080890C4 +_080890C2: + movs r0, 0x1 +_080890C4: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_0x05 + + thumb_func_start MetatileBehavior_IsWalkNorth +@ bool8 MetatileBehavior_IsWalkNorth(u8 metatileBehavior) +MetatileBehavior_IsWalkNorth: @ 80890C8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x42 + beq _080890D6 + movs r0, 0 + b _080890D8 +_080890D6: + movs r0, 0x1 +_080890D8: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsWalkNorth + + thumb_func_start MetatileBehavior_IsWalkSouth +@ bool8 MetatileBehavior_IsWalkSouth(u8 metatileBehavior) +MetatileBehavior_IsWalkSouth: @ 80890DC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x43 + beq _080890EA + movs r0, 0 + b _080890EC +_080890EA: + movs r0, 0x1 +_080890EC: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsWalkSouth + + thumb_func_start MetatileBehavior_IsWalkWest +@ bool8 MetatileBehavior_IsWalkWest(u8 metatileBehavior) +MetatileBehavior_IsWalkWest: @ 80890F0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x41 + beq _080890FE + movs r0, 0 + b _08089100 +_080890FE: + movs r0, 0x1 +_08089100: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsWalkWest + + thumb_func_start MetatileBehavior_IsWalkEast +@ bool8 MetatileBehavior_IsWalkEast(u8 metatileBehavior) +MetatileBehavior_IsWalkEast: @ 8089104 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08089112 + movs r0, 0 + b _08089114 +_08089112: + movs r0, 0x1 +_08089114: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsWalkEast + + thumb_func_start MetatileBehavior_IsNorthwardCurrent +@ bool8 MetatileBehavior_IsNorthwardCurrent(u8 metatileBehavior) +MetatileBehavior_IsNorthwardCurrent: @ 8089118 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x52 + beq _08089126 + movs r0, 0 + b _08089128 +_08089126: + movs r0, 0x1 +_08089128: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsNorthwardCurrent + + thumb_func_start MetatileBehavior_IsSouthwardCurrent +@ bool8 MetatileBehavior_IsSouthwardCurrent(u8 metatileBehavior) +MetatileBehavior_IsSouthwardCurrent: @ 808912C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x53 + beq _0808913A + movs r0, 0 + b _0808913C +_0808913A: + movs r0, 0x1 +_0808913C: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsSouthwardCurrent + + thumb_func_start MetatileBehavior_IsWestwardCurrent +@ bool8 MetatileBehavior_IsWestwardCurrent(u8 metatileBehavior) +MetatileBehavior_IsWestwardCurrent: @ 8089140 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x51 + beq _0808914E + movs r0, 0 + b _08089150 +_0808914E: + movs r0, 0x1 +_08089150: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsWestwardCurrent + + thumb_func_start MetatileBehavior_IsEastwardCurrent +@ bool8 MetatileBehavior_IsEastwardCurrent(u8 metatileBehavior) +MetatileBehavior_IsEastwardCurrent: @ 8089154 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x50 + beq _08089162 + movs r0, 0 + b _08089164 +_08089162: + movs r0, 0x1 +_08089164: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsEastwardCurrent + + thumb_func_start MetatileBehavior_IsSlideNorth +@ bool8 MetatileBehavior_IsSlideNorth(u8 metatileBehavior) +MetatileBehavior_IsSlideNorth: @ 8089168 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x46 + beq _08089176 + movs r0, 0 + b _08089178 +_08089176: + movs r0, 0x1 +_08089178: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsSlideNorth + + thumb_func_start MetatileBehavior_IsSlideSouth +@ bool8 MetatileBehavior_IsSlideSouth(u8 metatileBehavior) +MetatileBehavior_IsSlideSouth: @ 808917C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x47 + beq _0808918A + movs r0, 0 + b _0808918C +_0808918A: + movs r0, 0x1 +_0808918C: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsSlideSouth + + thumb_func_start MetatileBehavior_IsSlideWest +@ bool8 MetatileBehavior_IsSlideWest(u8 metatileBehavior) +MetatileBehavior_IsSlideWest: @ 8089190 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x45 + beq _0808919E + movs r0, 0 + b _080891A0 +_0808919E: + movs r0, 0x1 +_080891A0: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsSlideWest + + thumb_func_start MetatileBehavior_IsSlideEast +@ bool8 MetatileBehavior_IsSlideEast(u8 metatileBehavior) +MetatileBehavior_IsSlideEast: @ 80891A4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x44 + beq _080891B2 + movs r0, 0 + b _080891B4 +_080891B2: + movs r0, 0x1 +_080891B4: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsSlideEast + + thumb_func_start MetatileBehavior_IsCounter +MetatileBehavior_IsCounter: @ 80891B8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x80 + beq _080891C6 + movs r0, 0 + b _080891C8 +_080891C6: + movs r0, 0x1 +_080891C8: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsCounter + + thumb_func_start MetatileBehavior_IsPlayerFacingTVScreen +@ bool8 MetatileBehavior_IsPlayerFacingTVScreen(u8 behavior, u8 direction) +MetatileBehavior_IsPlayerFacingTVScreen: @ 80891CC + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x2 + bne _080891DE + cmp r0, 0x86 + beq _080891E2 +_080891DE: + movs r0, 0 + b _080891E4 +_080891E2: + movs r0, 0x1 +_080891E4: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsPlayerFacingTVScreen + + thumb_func_start MetatileBehavior_IsPC +MetatileBehavior_IsPC: @ 80891E8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x83 + beq _080891F6 + movs r0, 0 + b _080891F8 +_080891F6: + movs r0, 0x1 +_080891F8: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsPC + + thumb_func_start is_tile_x84 +is_tile_x84: @ 80891FC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x84 + beq _0808920A + movs r0, 0 + b _0808920C +_0808920A: + movs r0, 0x1 +_0808920C: + pop {r1} + bx r1 + thumb_func_end is_tile_x84 + + thumb_func_start sub_8089210 +sub_8089210: @ 8089210 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x91 + beq _08089232 + cmp r0, 0x93 + beq _08089232 + cmp r0, 0x95 + beq _08089232 + cmp r0, 0x97 + beq _08089232 + cmp r0, 0x99 + beq _08089232 + cmp r0, 0x9B + beq _08089232 + cmp r0, 0x9D + bne _08089236 +_08089232: + movs r0, 0x1 + b _08089238 +_08089236: + movs r0, 0 +_08089238: + pop {r1} + bx r1 + thumb_func_end sub_8089210 + + thumb_func_start sub_808923C +sub_808923C: @ 808923C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x90 + beq _08089252 + cmp r0, 0x92 + beq _08089252 + cmp r0, 0x94 + beq _08089252 + cmp r0, 0x9A + bne _08089256 +_08089252: + movs r0, 0x1 + b _08089258 +_08089256: + movs r0, 0 +_08089258: + pop {r1} + bx r1 + thumb_func_end sub_808923C + + thumb_func_start sub_808925C +sub_808925C: @ 808925C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x96 + beq _0808926A + cmp r0, 0x9C + bne _0808926E +_0808926A: + movs r0, 0x1 + b _08089270 +_0808926E: + movs r0, 0 +_08089270: + pop {r1} + bx r1 + thumb_func_end sub_808925C + + thumb_func_start is_tile_x98 +is_tile_x98: @ 8089274 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x98 + beq _08089282 + movs r0, 0 + b _08089284 +_08089282: + movs r0, 0x1 +_08089284: + pop {r1} + bx r1 + thumb_func_end is_tile_x98 + + thumb_func_start sub_8089288 +sub_8089288: @ 8089288 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB0 + beq _08089296 + movs r0, 0 + b _08089298 +_08089296: + movs r0, 0x1 +_08089298: + pop {r1} + bx r1 + thumb_func_end sub_8089288 + + thumb_func_start sub_808929C +sub_808929C: @ 808929C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB1 + beq _080892AA + movs r0, 0 + b _080892AC +_080892AA: + movs r0, 0x1 +_080892AC: + pop {r1} + bx r1 + thumb_func_end sub_808929C + + thumb_func_start sub_80892B0 +sub_80892B0: @ 80892B0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB2 + beq _080892BE + movs r0, 0 + b _080892C0 +_080892BE: + movs r0, 0x1 +_080892C0: + pop {r1} + bx r1 + thumb_func_end sub_80892B0 + + thumb_func_start sub_80892C4 +sub_80892C4: @ 80892C4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB3 + beq _080892D2 + movs r0, 0 + b _080892D4 +_080892D2: + movs r0, 0x1 +_080892D4: + pop {r1} + bx r1 + thumb_func_end sub_80892C4 + + thumb_func_start sub_80892D8 +sub_80892D8: @ 80892D8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB9 + beq _080892E6 + movs r0, 0 + b _080892E8 +_080892E6: + movs r0, 0x1 +_080892E8: + pop {r1} + bx r1 + thumb_func_end sub_80892D8 + + thumb_func_start sub_80892EC +sub_80892EC: @ 80892EC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xC6 + beq _080892FA + movs r0, 0 + b _080892FC +_080892FA: + movs r0, 0x1 +_080892FC: + pop {r1} + bx r1 + thumb_func_end sub_80892EC + + thumb_func_start sub_8089300 +sub_8089300: @ 8089300 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xC7 + beq _0808930E + movs r0, 0 + b _08089310 +_0808930E: + movs r0, 0x1 +_08089310: + pop {r1} + bx r1 + thumb_func_end sub_8089300 + + thumb_func_start sub_8089314 +sub_8089314: @ 8089314 + push {lr} + lsls r0, 24 + cmp r0, 0 + beq _08089320 + movs r0, 0 + b _08089322 +_08089320: + movs r0, 0x1 +_08089322: + pop {r1} + bx r1 + thumb_func_end sub_8089314 + + thumb_func_start sub_8089328 +sub_8089328: @ 8089328 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB7 + beq _08089336 + movs r0, 0 + b _08089338 +_08089336: + movs r0, 0x1 +_08089338: + pop {r1} + bx r1 + thumb_func_end sub_8089328 + + thumb_func_start sub_808933C +sub_808933C: @ 808933C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB2 + beq _0808934A + movs r0, 0 + b _0808934C +_0808934A: + movs r0, 0x1 +_0808934C: + pop {r1} + bx r1 + thumb_func_end sub_808933C + + thumb_func_start sub_8089350 +sub_8089350: @ 8089350 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB5 + beq _0808935E + movs r0, 0 + b _08089360 +_0808935E: + movs r0, 0x1 +_08089360: + pop {r1} + bx r1 + thumb_func_end sub_8089350 + + thumb_func_start sub_8089364 +sub_8089364: @ 8089364 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xC3 + beq _08089372 + movs r0, 0 + b _08089374 +_08089372: + movs r0, 0x1 +_08089374: + pop {r1} + bx r1 + thumb_func_end sub_8089364 + + thumb_func_start sub_8089378 +sub_8089378: @ 8089378 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xC2 + beq _08089386 + movs r0, 0 + b _08089388 +_08089386: + movs r0, 0x1 +_08089388: + pop {r1} + bx r1 + thumb_func_end sub_8089378 + + thumb_func_start sub_808938C +sub_808938C: @ 808938C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB8 + beq _0808939A + movs r0, 0 + b _0808939C +_0808939A: + movs r0, 0x1 +_0808939C: + pop {r1} + bx r1 + thumb_func_end sub_808938C + + thumb_func_start sub_80893A0 +sub_80893A0: @ 80893A0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xBE + beq _080893AE + movs r0, 0 + b _080893B0 +_080893AE: + movs r0, 0x1 +_080893B0: + pop {r1} + bx r1 + thumb_func_end sub_80893A0 + + thumb_func_start sub_80893B4 +sub_80893B4: @ 80893B4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xBD + beq _080893C2 + movs r0, 0 + b _080893C4 +_080893C2: + movs r0, 0x1 +_080893C4: + pop {r1} + bx r1 + thumb_func_end sub_80893B4 + + thumb_func_start sub_80893C8 +sub_80893C8: @ 80893C8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xBA + beq _080893D6 + movs r0, 0 + b _080893D8 +_080893D6: + movs r0, 0x1 +_080893D8: + pop {r1} + bx r1 + thumb_func_end sub_80893C8 + + thumb_func_start sub_80893DC +sub_80893DC: @ 80893DC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xBF + beq _080893EA + movs r0, 0 + b _080893EC +_080893EA: + movs r0, 0x1 +_080893EC: + pop {r1} + bx r1 + thumb_func_end sub_80893DC + + thumb_func_start sub_80893F0 +sub_80893F0: @ 80893F0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xC4 + beq _080893FE + movs r0, 0 + b _08089400 +_080893FE: + movs r0, 0x1 +_08089400: + pop {r1} + bx r1 + thumb_func_end sub_80893F0 + + thumb_func_start sub_8089404 +sub_8089404: @ 8089404 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xC5 + beq _08089412 + movs r0, 0 + b _08089414 +_08089412: + movs r0, 0x1 +_08089414: + pop {r1} + bx r1 + thumb_func_end sub_8089404 + + thumb_func_start MetatileBehavior_HasRipples +MetatileBehavior_HasRipples: @ 8089418 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + beq _0808942A + cmp r0, 0x16 + beq _0808942A + cmp r0, 0x14 + bne _0808942E +_0808942A: + movs r0, 0x1 + b _08089430 +_0808942E: + movs r0, 0 +_08089430: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_HasRipples + + thumb_func_start MetatileBehavior_IsPuddle +MetatileBehavior_IsPuddle: @ 8089434 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x16 + beq _08089442 + movs r0, 0 + b _08089444 +_08089442: + movs r0, 0x1 +_08089444: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsPuddle + + thumb_func_start MetatileBehavior_IsTallGrass +MetatileBehavior_IsTallGrass: @ 8089448 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _08089456 + movs r0, 0 + b _08089458 +_08089456: + movs r0, 0x1 +_08089458: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsTallGrass + + thumb_func_start MetatileBehavior_IsLongGrass +MetatileBehavior_IsLongGrass: @ 808945C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _0808946A + movs r0, 0 + b _0808946C +_0808946A: + movs r0, 0x1 +_0808946C: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsLongGrass + + thumb_func_start MetatileBehavior_IsBerryTreeSoil +MetatileBehavior_IsBerryTreeSoil: @ 8089470 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xA0 + beq _0808947E + movs r0, 0 + b _08089480 +_0808947E: + movs r0, 0x1 +_08089480: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsBerryTreeSoil + + thumb_func_start MetatileBehavior_IsAsh +MetatileBehavior_IsAsh: @ 8089484 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x24 + beq _08089492 + movs r0, 0 + b _08089494 +_08089492: + movs r0, 0x1 +_08089494: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsAsh + + thumb_func_start MetatileBehavior_IsUnusedFootprintMetatile +MetatileBehavior_IsUnusedFootprintMetatile: @ 8089498 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x25 + beq _080894A6 + movs r0, 0 + b _080894A8 +_080894A6: + movs r0, 0x1 +_080894A8: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsUnusedFootprintMetatile + + thumb_func_start sub_80894AC +sub_80894AC: @ 80894AC + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0x90 + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0x3 + bls _080894CA + adds r0, r1, 0 + subs r0, 0x7C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bhi _080894CE +_080894CA: + movs r0, 0x1 + b _080894D0 +_080894CE: + movs r0, 0 +_080894D0: + pop {r1} + bx r1 + thumb_func_end sub_80894AC + + thumb_func_start sub_80894D4 +sub_80894D4: @ 80894D4 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + adds r2, r1, 0 + adds r0, r1, 0 + subs r0, 0x70 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _0808950A + adds r0, r1, 0 + subs r0, 0x7A + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _080894F8 + movs r0, 0x2 + b _0808950A +_080894F8: + adds r0, r2, 0 + subs r0, 0x7C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _08089508 + movs r0, 0 + b _0808950A +_08089508: + movs r0, 0x3 +_0808950A: + pop {r1} + bx r1 + thumb_func_end sub_80894D4 + + thumb_func_start sub_8089510 +sub_8089510: @ 8089510 + push {lr} + lsls r0, 24 + movs r1, 0x90 + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x3 + bls _08089524 + movs r0, 0 + b _08089526 +_08089524: + movs r0, 0x1 +_08089526: + pop {r1} + bx r1 + thumb_func_end sub_8089510 + + thumb_func_start sub_808952C +sub_808952C: @ 808952C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl MetatileBehavior_IsSurfableWaterOrUnderwater + lsls r0, 24 + cmp r0, 0 + bne _08089550 + adds r0, r4, 0 + bl sub_8088DF0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08089550 + movs r0, 0x1 + b _08089552 +_08089550: + movs r0, 0 +_08089552: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808952C + + thumb_func_start sub_8089558 +sub_8089558: @ 8089558 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl MetatileBehavior_IsSurfableWaterOrUnderwater + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0808957E + adds r0, r4, 0 + bl sub_8088DF0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0808957E + movs r0, 0x1 + b _08089580 +_0808957E: + movs r0, 0 +_08089580: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8089558 + + thumb_func_start sub_8089588 +sub_8089588: @ 8089588 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB + beq _08089596 + movs r0, 0 + b _08089598 +_08089596: + movs r0, 0x1 +_08089598: + pop {r1} + bx r1 + thumb_func_end sub_8089588 + + thumb_func_start sub_808959C +sub_808959C: @ 808959C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xC + beq _080895AA + movs r0, 0 + b _080895AC +_080895AA: + movs r0, 0x1 +_080895AC: + pop {r1} + bx r1 + thumb_func_end sub_808959C + + thumb_func_start sub_80895B0 +sub_80895B0: @ 80895B0 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xEF + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0x1 + bls _080895C6 + cmp r1, 0x14 + bne _080895CA +_080895C6: + movs r0, 0x1 + b _080895CC +_080895CA: + movs r0, 0 +_080895CC: + pop {r1} + bx r1 + thumb_func_end sub_80895B0 + + thumb_func_start sub_80895D0 +sub_80895D0: @ 80895D0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x19 + beq _080895DE + cmp r0, 0x2A + bne _080895E2 +_080895DE: + movs r0, 0x1 + b _080895E4 +_080895E2: + movs r0, 0 +_080895E4: + pop {r1} + bx r1 + thumb_func_end sub_80895D0 + + thumb_func_start MetatileBehavior_IsShallowFlowingWater +MetatileBehavior_IsShallowFlowingWater: @ 80895E8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x17 + beq _080895FA + cmp r0, 0x1B + beq _080895FA + cmp r0, 0x1C + bne _080895FE +_080895FA: + movs r0, 0x1 + b _08089600 +_080895FE: + movs r0, 0 +_08089600: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsShallowFlowingWater + + thumb_func_start sub_8089604 +sub_8089604: @ 8089604 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x26 + beq _08089612 + movs r0, 0 + b _08089614 +_08089612: + movs r0, 0x1 +_08089614: + pop {r1} + bx r1 + thumb_func_end sub_8089604 + + thumb_func_start sub_8089618 +sub_8089618: @ 8089618 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x27 + beq _08089626 + movs r0, 0 + b _08089628 +_08089626: + movs r0, 0x1 +_08089628: + pop {r1} + bx r1 + thumb_func_end sub_8089618 + + thumb_func_start sub_808962C +sub_808962C: @ 808962C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x15 + beq _0808963E + cmp r0, 0x11 + beq _0808963E + cmp r0, 0x12 + bne _08089642 +_0808963E: + movs r0, 0x1 + b _08089644 +_08089642: + movs r0, 0 +_08089644: + pop {r1} + bx r1 + thumb_func_end sub_808962C + + thumb_func_start sub_8089648 +sub_8089648: @ 8089648 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x18 + beq _08089656 + cmp r0, 0x1A + bne _0808965A +_08089656: + movs r0, 0x1 + b _0808965C +_0808965A: + movs r0, 0 +_0808965C: + pop {r1} + bx r1 + thumb_func_end sub_8089648 + + thumb_func_start sub_8089660 +sub_8089660: @ 8089660 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl MetatileBehavior_IsSurfableWaterOrUnderwater + lsls r0, 24 + cmp r0, 0 + beq _08089682 + adds r0, r4, 0 + bl MetatileBehavior_IsWaterfall + lsls r0, 24 + cmp r0, 0 + bne _08089682 + movs r0, 0x1 + b _08089684 +_08089682: + movs r0, 0 +_08089684: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8089660 + + thumb_func_start MetatileBehavior_IsEastBlocked +MetatileBehavior_IsEastBlocked: @ 808968C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x30 + beq _080896A6 + cmp r0, 0x34 + beq _080896A6 + cmp r0, 0x36 + beq _080896A6 + cmp r0, 0xC1 + beq _080896A6 + cmp r0, 0xBE + bne _080896AA +_080896A6: + movs r0, 0x1 + b _080896AC +_080896AA: + movs r0, 0 +_080896AC: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsEastBlocked + + thumb_func_start MetatileBehavior_IsWestBlocked +MetatileBehavior_IsWestBlocked: @ 80896B0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x31 + beq _080896CA + cmp r0, 0x35 + beq _080896CA + cmp r0, 0x37 + beq _080896CA + cmp r0, 0xC1 + beq _080896CA + cmp r0, 0xBE + bne _080896CE +_080896CA: + movs r0, 0x1 + b _080896D0 +_080896CE: + movs r0, 0 +_080896D0: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsWestBlocked + + thumb_func_start MetatileBehavior_IsNorthBlocked +MetatileBehavior_IsNorthBlocked: @ 80896D4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x32 + beq _080896EA + cmp r0, 0x34 + beq _080896EA + cmp r0, 0x35 + beq _080896EA + cmp r0, 0xC0 + bne _080896EE +_080896EA: + movs r0, 0x1 + b _080896F0 +_080896EE: + movs r0, 0 +_080896F0: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsNorthBlocked + + thumb_func_start MetatileBehavior_IsSouthBlocked +MetatileBehavior_IsSouthBlocked: @ 80896F4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x33 + beq _0808970A + cmp r0, 0x36 + beq _0808970A + cmp r0, 0x37 + beq _0808970A + cmp r0, 0xC0 + bne _0808970E +_0808970A: + movs r0, 0x1 + b _08089710 +_0808970E: + movs r0, 0 +_08089710: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsSouthBlocked + + thumb_func_start MetatileBehavior_IsShortGrass +MetatileBehavior_IsShortGrass: @ 8089714 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x7 + beq _08089722 + movs r0, 0 + b _08089724 +_08089722: + movs r0, 0x1 +_08089724: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsShortGrass + + thumb_func_start MetatileBehavior_IsHotSprings +MetatileBehavior_IsHotSprings: @ 8089728 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x28 + beq _08089736 + movs r0, 0 + b _08089738 +_08089736: + movs r0, 0x1 +_08089738: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsHotSprings + + thumb_func_start MetatileBehavior_IsWaterfall +@ bool8 MetatileBehavior_IsWaterfall(u8 metatileBehavior) +MetatileBehavior_IsWaterfall: @ 808973C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + beq _0808974A + movs r0, 0 + b _0808974C +_0808974A: + movs r0, 0x1 +_0808974C: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsWaterfall + + thumb_func_start MetatileBehavior_IsFortreeBridge +MetatileBehavior_IsFortreeBridge: @ 8089750 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x78 + beq _0808975E + movs r0, 0 + b _08089760 +_0808975E: + movs r0, 0x1 +_08089760: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsFortreeBridge + + thumb_func_start sub_8089764 +sub_8089764: @ 8089764 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x74 + beq _08089772 + movs r0, 0 + b _08089774 +_08089772: + movs r0, 0x1 +_08089774: + pop {r1} + bx r1 + thumb_func_end sub_8089764 + + thumb_func_start sub_8089778 +sub_8089778: @ 8089778 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x75 + beq _08089786 + movs r0, 0 + b _08089788 +_08089786: + movs r0, 0x1 +_08089788: + pop {r1} + bx r1 + thumb_func_end sub_8089778 + + thumb_func_start sub_808978C +sub_808978C: @ 808978C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x76 + beq _0808979A + movs r0, 0 + b _0808979C +_0808979A: + movs r0, 0x1 +_0808979C: + pop {r1} + bx r1 + thumb_func_end sub_808978C + + thumb_func_start sub_80897A0 +sub_80897A0: @ 80897A0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x77 + beq _080897AE + movs r0, 0 + b _080897B0 +_080897AE: + movs r0, 0x1 +_080897B0: + pop {r1} + bx r1 + thumb_func_end sub_80897A0 + + thumb_func_start MetatileBehavior_IsPacifidlogLog +MetatileBehavior_IsPacifidlogLog: @ 80897B4 + push {lr} + lsls r0, 24 + movs r1, 0x8C + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x3 + bls _080897C8 + movs r0, 0 + b _080897CA +_080897C8: + movs r0, 0x1 +_080897CA: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsPacifidlogLog + + thumb_func_start is_tile_x8C +is_tile_x8C: @ 80897D0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8C + beq _080897DE + movs r0, 0 + b _080897E0 +_080897DE: + movs r0, 0x1 +_080897E0: + pop {r1} + bx r1 + thumb_func_end is_tile_x8C + + thumb_func_start is_tile_x85 +is_tile_x85: @ 80897E4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x85 + beq _080897F2 + movs r0, 0 + b _080897F4 +_080897F2: + movs r0, 0x1 +_080897F4: + pop {r1} + bx r1 + thumb_func_end is_tile_x85 + + thumb_func_start is_tile_x8B +is_tile_x8B: @ 80897F8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8B + beq _08089806 + movs r0, 0 + b _08089808 +_08089806: + movs r0, 0x1 +_08089808: + pop {r1} + bx r1 + thumb_func_end is_tile_x8B + + thumb_func_start is_tile_xEA +is_tile_xEA: @ 808980C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xEA + beq _0808981A + movs r0, 0 + b _0808981C +_0808981A: + movs r0, 0x1 +_0808981C: + pop {r1} + bx r1 + thumb_func_end is_tile_xEA + + thumb_func_start is_tile_x8A +is_tile_x8A: @ 8089820 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8A + beq _0808982E + movs r0, 0 + b _08089830 +_0808982E: + movs r0, 0x1 +_08089830: + pop {r1} + bx r1 + thumb_func_end is_tile_x8A + + thumb_func_start is_tile_x87 +is_tile_x87: @ 8089834 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x87 + beq _08089842 + movs r0, 0 + b _08089844 +_08089842: + movs r0, 0x1 +_08089844: + pop {r1} + bx r1 + thumb_func_end is_tile_x87 + + thumb_func_start MetatileBehavior_0xBB +@ bool8 MetatileBehavior_0xBB(u8 metatileBehavior) +MetatileBehavior_0xBB: @ 8089848 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xBB + beq _08089856 + movs r0, 0 + b _08089858 +_08089856: + movs r0, 0x1 +_08089858: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_0xBB + + thumb_func_start MetatileBehavior_0xBC +@ bool8 MetatileBehavior_0xBC(u8 metatileBehavior) +MetatileBehavior_0xBC: @ 808985C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xBC + beq _0808986A + movs r0, 0 + b _0808986C +_0808986A: + movs r0, 0x1 +_0808986C: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_0xBC + + thumb_func_start sub_8089870 +sub_8089870: @ 8089870 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x29 + beq _0808987E + movs r0, 0 + b _08089880 +_0808987E: + movs r0, 0x1 +_08089880: + pop {r1} + bx r1 + thumb_func_end sub_8089870 + + thumb_func_start is_role_x68 +is_role_x68: @ 8089884 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x68 + beq _08089892 + movs r0, 0 + b _08089894 +_08089892: + movs r0, 0x1 +_08089894: + pop {r1} + bx r1 + thumb_func_end is_role_x68 + + thumb_func_start MetatileBehavior_IsAquaHideoutWarp +MetatileBehavior_IsAquaHideoutWarp: @ 8089898 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x67 + beq _080898A6 + movs r0, 0 + b _080898A8 +_080898A6: + movs r0, 0x1 +_080898A8: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsAquaHideoutWarp + + thumb_func_start sub_80898AC +sub_80898AC: @ 80898AC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x70 + beq _080898BA + movs r0, 0 + b _080898BC +_080898BA: + movs r0, 0x1 +_080898BC: + pop {r1} + bx r1 + thumb_func_end sub_80898AC + + thumb_func_start sub_80898C0 +sub_80898C0: @ 80898C0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE + beq _080898CE + movs r0, 0 + b _080898D0 +_080898CE: + movs r0, 0x1 +_080898D0: + pop {r1} + bx r1 + thumb_func_end sub_80898C0 + + thumb_func_start MetatileBehavior_IsSurfableFishableWater +MetatileBehavior_IsSurfableFishableWater: @ 80898D4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + beq _080898F8 + cmp r0, 0x15 + beq _080898F8 + cmp r0, 0x11 + beq _080898F8 + cmp r0, 0x12 + beq _080898F8 + cmp r0, 0x14 + beq _080898F8 + subs r0, 0x50 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bhi _080898FC +_080898F8: + movs r0, 0x1 + b _080898FE +_080898FC: + movs r0, 0 +_080898FE: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsSurfableFishableWater + + thumb_func_start sub_8089904 +sub_8089904: @ 8089904 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xF + beq _08089912 + movs r0, 0 + b _08089914 +_08089912: + movs r0, 0x1 +_08089914: + pop {r1} + bx r1 + thumb_func_end sub_8089904 + + thumb_func_start sub_8089918 +sub_8089918: @ 8089918 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x66 + beq _08089926 + movs r0, 0 + b _08089928 +_08089926: + movs r0, 0x1 +_08089928: + pop {r1} + bx r1 + thumb_func_end sub_8089918 + + thumb_func_start sub_808992C +sub_808992C: @ 808992C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD2 + beq _0808993A + movs r0, 0 + b _0808993C +_0808993A: + movs r0, 0x1 +_0808993C: + pop {r1} + bx r1 + thumb_func_end sub_808992C + + thumb_func_start MetatileBehavior_IsMuddySlope +@ bool8 MetatileBehavior_IsMuddySlope(u8 metatileBehavior) +MetatileBehavior_IsMuddySlope: @ 8089940 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD0 + beq _0808994E + movs r0, 0 + b _08089950 +_0808994E: + movs r0, 0x1 +_08089950: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsMuddySlope + + thumb_func_start MetatileBehavior_IsBumpySlope +MetatileBehavior_IsBumpySlope: @ 8089954 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD1 + beq _08089962 + movs r0, 0 + b _08089964 +_08089962: + movs r0, 0x1 +_08089964: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsBumpySlope + + thumb_func_start MetatileBehavior_IsIsolatedVerticalRail +MetatileBehavior_IsIsolatedVerticalRail: @ 8089968 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD3 + beq _08089976 + movs r0, 0 + b _08089978 +_08089976: + movs r0, 0x1 +_08089978: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsIsolatedVerticalRail + + thumb_func_start MetatileBehavior_IsIsolatedHorizontalRail +MetatileBehavior_IsIsolatedHorizontalRail: @ 808997C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD4 + beq _0808998A + movs r0, 0 + b _0808998C +_0808998A: + movs r0, 0x1 +_0808998C: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsIsolatedHorizontalRail + + thumb_func_start MetatileBehavior_IsVerticalRail +MetatileBehavior_IsVerticalRail: @ 8089990 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD5 + beq _0808999E + movs r0, 0 + b _080899A0 +_0808999E: + movs r0, 0x1 +_080899A0: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsVerticalRail + + thumb_func_start MetatileBehavior_IsHorizontalRail +MetatileBehavior_IsHorizontalRail: @ 80899A4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD6 + beq _080899B2 + movs r0, 0 + b _080899B4 +_080899B2: + movs r0, 0x1 +_080899B4: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsHorizontalRail + + thumb_func_start MetatileBehavior_IsSeaweed +MetatileBehavior_IsSeaweed: @ 80899B8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x22 + beq _080899C6 + cmp r0, 0x2A + bne _080899CA +_080899C6: + movs r0, 0x1 + b _080899CC +_080899CA: + movs r0, 0 +_080899CC: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsSeaweed + + thumb_func_start MetatileBehavior_IsRunningDisallowed +MetatileBehavior_IsRunningDisallowed: @ 80899D0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xA + beq _080899EC + cmp r0, 0x3 + beq _080899EC + cmp r0, 0x28 + beq _080899EC + bl MetatileBehavior_IsPacifidlogLog + lsls r0, 24 + cmp r0, 0 + beq _080899F0 +_080899EC: + movs r0, 0x1 + b _080899F2 +_080899F0: + movs r0, 0 +_080899F2: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsRunningDisallowed + + thumb_func_start sub_80899F8 +sub_80899F8: @ 80899F8 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xFE + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0x1 + bls _08089A12 + cmp r1, 0x24 + beq _08089A12 + cmp r1, 0x9 + bne _08089A16 +_08089A12: + movs r0, 0x1 + b _08089A18 +_08089A16: + movs r0, 0 +_08089A18: + pop {r1} + bx r1 + thumb_func_end sub_80899F8 + + thumb_func_start sub_8089A1C +sub_8089A1C: @ 8089A1C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8E + beq _08089A2A + movs r0, 0 + b _08089A2C +_08089A2A: + movs r0, 0x1 +_08089A2C: + pop {r1} + bx r1 + thumb_func_end sub_8089A1C + + thumb_func_start sub_8089A30 +sub_8089A30: @ 8089A30 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE0 + beq _08089A3E + movs r0, 0 + b _08089A40 +_08089A3E: + movs r0, 0x1 +_08089A40: + pop {r1} + bx r1 + thumb_func_end sub_8089A30 + + thumb_func_start sub_8089A44 +sub_8089A44: @ 8089A44 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE1 + beq _08089A52 + movs r0, 0 + b _08089A54 +_08089A52: + movs r0, 0x1 +_08089A54: + pop {r1} + bx r1 + thumb_func_end sub_8089A44 + + thumb_func_start sub_8089A58 +sub_8089A58: @ 8089A58 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE2 + beq _08089A66 + movs r0, 0 + b _08089A68 +_08089A66: + movs r0, 0x1 +_08089A68: + pop {r1} + bx r1 + thumb_func_end sub_8089A58 + + thumb_func_start sub_8089A6C +sub_8089A6C: @ 8089A6C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE3 + beq _08089A7A + movs r0, 0 + b _08089A7C +_08089A7A: + movs r0, 0x1 +_08089A7C: + pop {r1} + bx r1 + thumb_func_end sub_8089A6C + + thumb_func_start sub_8089A80 +sub_8089A80: @ 8089A80 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE4 + beq _08089A8E + movs r0, 0 + b _08089A90 +_08089A8E: + movs r0, 0x1 +_08089A90: + pop {r1} + bx r1 + thumb_func_end sub_8089A80 + + thumb_func_start sub_8089A94 +sub_8089A94: @ 8089A94 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE5 + beq _08089AA2 + movs r0, 0 + b _08089AA4 +_08089AA2: + movs r0, 0x1 +_08089AA4: + pop {r1} + bx r1 + thumb_func_end sub_8089A94 + + thumb_func_start sub_8089AA8 +sub_8089AA8: @ 8089AA8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE6 + beq _08089AB6 + movs r0, 0 + b _08089AB8 +_08089AB6: + movs r0, 0x1 +_08089AB8: + pop {r1} + bx r1 + thumb_func_end sub_8089AA8 + + thumb_func_start sub_8089ABC +sub_8089ABC: @ 8089ABC + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD + beq _08089ACA + movs r0, 0 + b _08089ACC +_08089ACA: + movs r0, 0x1 +_08089ACC: + pop {r1} + bx r1 + thumb_func_end sub_8089ABC + + thumb_func_start sub_8089AD0 +sub_8089AD0: @ 8089AD0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x2 + bne _08089AE2 + cmp r0, 0xE8 + beq _08089AE6 +_08089AE2: + movs r0, 0 + b _08089AE8 +_08089AE6: + movs r0, 0x1 +_08089AE8: + pop {r1} + bx r1 + thumb_func_end sub_8089AD0 + + thumb_func_start sub_8089AEC +sub_8089AEC: @ 8089AEC + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x2 + bne _08089AFE + cmp r0, 0xE7 + beq _08089B02 +_08089AFE: + movs r0, 0 + b _08089B04 +_08089B02: + movs r0, 0x1 +_08089B04: + pop {r1} + bx r1 + thumb_func_end sub_8089AEC + + thumb_func_start MetatileBehavior_IsQuestionnaire +MetatileBehavior_IsQuestionnaire: @ 8089B08 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8F + beq _08089B16 + movs r0, 0 + b _08089B18 +_08089B16: + movs r0, 0x1 +_08089B18: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsQuestionnaire + + thumb_func_start MetatileBehavior_IsLongGrass2 +MetatileBehavior_IsLongGrass2: @ 8089B1C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _08089B2A + movs r0, 0 + b _08089B2C +_08089B2A: + movs r0, 0x1 +_08089B2C: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsLongGrass2 + + thumb_func_start MetatileBehavior_IsLongGrassSouthEdge +MetatileBehavior_IsLongGrassSouthEdge: @ 8089B30 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + beq _08089B3E + movs r0, 0 + b _08089B40 +_08089B3E: + movs r0, 0x1 +_08089B40: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsLongGrassSouthEdge + + thumb_func_start MetatileBehavior_IsTrainerHillTimer +MetatileBehavior_IsTrainerHillTimer: @ 8089B44 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE9 + beq _08089B52 + movs r0, 0 + b _08089B54 +_08089B52: + movs r0, 0x1 +_08089B54: + pop {r1} + bx r1 + thumb_func_end MetatileBehavior_IsTrainerHillTimer + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/mon_markings.s b/asm/mon_markings.s new file mode 100644 index 000000000..02955ab4e --- /dev/null +++ b/asm/mon_markings.s @@ -0,0 +1,946 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_811F90C +sub_811F90C: @ 811F90C + ldr r1, =0x0203a124 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_811F90C + + thumb_func_start sub_811F918 +sub_811F918: @ 811F918 + push {lr} + sub sp, 0x4 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + lsrs r0, 3 + bl sub_8098758 + ldr r3, =0x0203a124 + ldr r2, [r3] + ldr r1, [r0] + str r1, [r2, 0x2C] + ldr r0, [r0, 0x4] + str r0, [r2, 0x30] + ldr r0, =0x000010b4 + adds r2, r0 + movs r1, 0 + strb r1, [r2] + mov r0, sp + strh r1, [r0] + ldr r1, [r3] + adds r1, 0x34 + ldr r2, =0x01000800 + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_811F918 + + thumb_func_start sub_811F960 +sub_811F960: @ 811F960 + push {r4-r7,lr} + ldr r0, =0x0203a124 + ldr r1, [r0] + ldr r2, =0x000010b4 + adds r0, r1, r2 + ldrb r2, [r0] + lsls r0, r2, 8 + adds r0, 0x34 + adds r5, r1, r0 + cmp r2, 0xD + beq _0811FA30 + cmp r2, 0xD + bgt _0811F988 + cmp r2, 0 + beq _0811F98E + b _0811F9D8 + .pool +_0811F988: + cmp r2, 0xE + beq _0811FA7C + b _0811F9D8 +_0811F98E: + ldr r0, [r1, 0x2C] + adds r1, r5, 0 + movs r2, 0x8 + bl CpuFastSet + movs r4, 0 + adds r7, r5, 0 + adds r7, 0xE0 +_0811F99E: + ldr r6, =0x0203a124 + ldr r0, [r6] + ldr r0, [r0, 0x2C] + adds r0, 0x20 + adds r4, 0x1 + lsls r1, r4, 5 + adds r1, r5, r1 + movs r2, 0x8 + bl CpuFastSet + lsls r4, 16 + lsrs r4, 16 + cmp r4, 0x5 + bls _0811F99E + ldr r0, [r6] + ldr r0, [r0, 0x2C] + adds r0, 0x40 + adds r1, r7, 0 + movs r2, 0x8 + bl CpuFastSet + ldr r1, [r6] + ldr r0, =0x000010b4 + adds r1, r0 + b _0811FA1E + .pool +_0811F9D8: + ldr r0, =0x0203a124 + ldr r0, [r0] + ldr r0, [r0, 0x2C] + adds r0, 0x60 + adds r1, r5, 0 + movs r2, 0x8 + bl CpuFastSet + movs r4, 0 + adds r7, r5, 0 + adds r7, 0xE0 +_0811F9EE: + ldr r6, =0x0203a124 + ldr r0, [r6] + ldr r0, [r0, 0x2C] + adds r0, 0x80 + adds r4, 0x1 + lsls r1, r4, 5 + adds r1, r5, r1 + movs r2, 0x8 + bl CpuFastSet + lsls r4, 16 + lsrs r4, 16 + cmp r4, 0x5 + bls _0811F9EE + ldr r0, [r6] + ldr r0, [r0, 0x2C] + adds r0, 0xA0 + adds r1, r7, 0 + movs r2, 0x8 + bl CpuFastSet + ldr r1, [r6] + ldr r2, =0x000010b4 + adds r1, r2 +_0811FA1E: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0811FA88 + .pool +_0811FA30: + ldr r0, [r1, 0x2C] + adds r0, 0xC0 + adds r1, r5, 0 + movs r2, 0x8 + bl CpuFastSet + movs r4, 0 + adds r7, r5, 0 + adds r7, 0xE0 +_0811FA42: + ldr r6, =0x0203a124 + ldr r0, [r6] + ldr r0, [r0, 0x2C] + adds r0, 0xE0 + adds r4, 0x1 + lsls r1, r4, 5 + adds r1, r5, r1 + movs r2, 0x8 + bl CpuFastSet + lsls r4, 16 + lsrs r4, 16 + cmp r4, 0x5 + bls _0811FA42 + ldr r0, [r6] + ldr r0, [r0, 0x2C] + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + adds r1, r7, 0 + movs r2, 0x8 + bl CpuFastSet + ldr r1, [r6] + ldr r2, =0x000010b4 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0811FA7C: + movs r0, 0 + b _0811FA8A + .pool +_0811FA88: + movs r0, 0x1 +_0811FA8A: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_811F960 + + thumb_func_start sub_811FA90 +sub_811FA90: @ 811FA90 + push {lr} + bl sub_811F918 +_0811FA96: + bl sub_811F960 + lsls r0, 24 + cmp r0, 0 + bne _0811FA96 + pop {r0} + bx r0 + thumb_func_end sub_811FA90 + + thumb_func_start sub_811FAA4 +sub_811FAA4: @ 811FAA4 + push {r4-r7,lr} + lsls r1, 16 + lsrs r5, r1, 16 + lsls r2, 16 + lsrs r6, r2, 16 + ldr r2, =0x0203a124 + ldr r3, [r2] + movs r1, 0 + strb r1, [r3, 0x5] + ldr r1, [r2] + strb r0, [r1, 0x4] + movs r3, 0 + adds r7, r2, 0 + adds r4, r7, 0 + movs r2, 0x1 +_0811FAC2: + ldr r0, [r4] + adds r1, r0, 0x6 + adds r1, r3 + ldrb r0, [r0, 0x4] + asrs r0, r3 + ands r0, r2 + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x3 + bls _0811FAC2 + lsls r0, r5, 16 + asrs r0, 16 + lsls r1, r6, 16 + asrs r1, 16 + ldr r3, [r7] + ldrh r2, [r3] + ldrh r3, [r3, 0x2] + bl sub_811FC80 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811FAA4 + + thumb_func_start sub_811FAF8 +sub_811FAF8: @ 811FAF8 + push {r4-r7,lr} + movs r5, 0 + ldr r4, =0x0203a124 +_0811FAFE: + ldr r0, [r4] + ldrh r0, [r0] + adds r0, r5, r0 + lsls r0, 16 + lsrs r0, 16 + bl FreeObjectTilesByTag + ldr r0, [r4] + ldrh r0, [r0, 0x2] + adds r0, r5, r0 + lsls r0, 16 + lsrs r0, 16 + bl FreeObjectPaletteByTag + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x1 + bls _0811FAFE + movs r5, 0 + ldr r6, =0x0203a124 +_0811FB28: + ldr r0, [r6] + lsls r4, r5, 2 + adds r0, 0xC + adds r0, r4 + ldr r0, [r0] + cmp r0, 0 + beq _0811FB9A + bl RemoveObjectAndFreeTiles + ldr r0, [r6] + adds r0, 0xC + adds r0, r4 + movs r1, 0 + str r1, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x1 + bls _0811FB28 + movs r5, 0 + ldr r6, =0x0203a124 +_0811FB52: + ldr r0, [r6] + lsls r4, r5, 2 + adds r0, 0x14 + adds r0, r4 + ldr r0, [r0] + cmp r0, 0 + beq _0811FB9A + bl RemoveObjectAndFreeTiles + ldr r0, [r6] + adds r0, 0x14 + adds r0, r4 + movs r7, 0 + str r7, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x3 + bls _0811FB52 + ldr r4, =0x0203a124 + ldr r0, [r4] + ldr r0, [r0, 0x24] + cmp r0, 0 + beq _0811FB8A + bl RemoveObjectAndFreeTiles + ldr r0, [r4] + str r7, [r0, 0x24] +_0811FB8A: + ldr r0, [r4] + ldr r0, [r0, 0x28] + cmp r0, 0 + beq _0811FB9A + bl RemoveObjectAndFreeTiles + ldr r0, [r4] + str r7, [r0, 0x28] +_0811FB9A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811FAF8 + + thumb_func_start sub_811FBA4 +sub_811FBA4: @ 811FBA4 + push {r4,r5,lr} + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + beq _0811FBDC + movs r0, 0x5 + bl audio_play + ldr r2, =0x0203a124 + ldr r1, [r2] + ldrb r0, [r1, 0x5] + subs r0, 0x1 + strb r0, [r1, 0x5] + lsls r0, 24 + cmp r0, 0 + bge _0811FC64 + ldr r1, [r2] + movs r0, 0x5 + strb r0, [r1, 0x5] + b _0811FC64 + .pool +_0811FBDC: + movs r0, 0x80 + ands r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _0811FC0C + movs r0, 0x5 + bl audio_play + ldr r2, =0x0203a124 + ldr r1, [r2] + ldrb r0, [r1, 0x5] + adds r0, 0x1 + strb r0, [r1, 0x5] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x5 + ble _0811FC64 + ldr r0, [r2] + strb r5, [r0, 0x5] + b _0811FC64 + .pool +_0811FC0C: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0811FC68 + movs r0, 0x5 + bl audio_play + ldr r2, =0x0203a124 + ldr r0, [r2] + movs r1, 0x5 + ldrsb r1, [r0, r1] + cmp r1, 0x4 + beq _0811FC40 + cmp r1, 0x5 + beq _0811FC76 + adds r0, 0x6 + adds r1, r0, r1 + movs r2, 0 + ldrb r0, [r1] + cmp r0, 0 + bne _0811FC62 + movs r2, 0x1 + b _0811FC62 + .pool +_0811FC40: + strb r4, [r0, 0x4] + movs r3, 0 + adds r4, r2, 0 +_0811FC46: + ldr r2, [r4] + adds r0, r2, 0x6 + adds r0, r3 + ldrb r0, [r0] + lsls r0, r3 + ldrb r1, [r2, 0x4] + orrs r0, r1 + strb r0, [r2, 0x4] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x3 + bls _0811FC46 + b _0811FC76 +_0811FC62: + strb r2, [r1] +_0811FC64: + movs r0, 0x1 + b _0811FC78 +_0811FC68: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0811FC64 + movs r0, 0x5 + bl audio_play +_0811FC76: + movs r0, 0 +_0811FC78: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_811FBA4 + + thumb_func_start sub_811FC80 +sub_811FC80: @ 811FC80 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x50 + mov r8, r0 + mov r9, r1 + adds r5, r2, 0 + adds r6, r3, 0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + ldr r4, =0x0203a124 + ldr r0, [r4] + adds r0, 0x34 + str r0, [sp, 0x18] + add r1, sp, 0x1C + movs r7, 0 + movs r0, 0x80 + lsls r0, 5 + strh r0, [r1] + mov r0, sp + adds r0, 0x1E + strh r5, [r0] + add r1, sp, 0x20 + ldr r0, =gUnknown_08DC9628 + str r0, [sp, 0x20] + movs r0, 0xC8 + lsls r0, 2 + strh r0, [r1, 0x4] + adds r0, r5, 0x1 + strh r0, [r1, 0x6] + add r0, sp, 0x28 + movs r1, 0 + movs r2, 0x8 + bl memset + add r2, sp, 0x18 + mov r10, r2 + mov r0, sp + mov r1, r10 + movs r2, 0x18 + bl memcpy + ldr r0, [r4] + ldr r0, [r0, 0x30] + str r0, [sp, 0x30] + add r0, sp, 0x34 + strh r6, [r0] + add r1, sp, 0x38 + ldr r0, =gUnknown_08DC9608 + str r0, [sp, 0x38] + adds r0, r6, 0x1 + strh r0, [r1, 0x4] + add r0, sp, 0x40 + movs r1, 0 + movs r2, 0x8 + bl memset + add r4, sp, 0x30 + mov r0, r10 + adds r1, r4, 0 + movs r2, 0x18 + bl memcpy + strh r5, [r4] + strh r6, [r4, 0x2] + ldr r0, =gUnknown_0859EE7C + str r0, [r4, 0x4] + ldr r0, =gUnknown_0859EF14 + str r0, [r4, 0x8] + str r7, [r4, 0xC] + ldr r0, =gDummyObjectRotScalAnimTable + str r0, [r4, 0x10] + ldr r0, =TaskDummy7 + str r0, [r4, 0x14] + mov r0, sp + bl LoadObjectPics + mov r0, r10 + bl LoadTaggedObjectPalettes + movs r5, 0 + mov r3, r8 + lsls r3, 16 + mov r8, r3 + movs r0, 0x80 + lsls r0, 14 + add r0, r8 + mov r10, r0 + mov r1, r8 + str r1, [sp, 0x48] + mov r2, r9 + lsls r2, 16 + mov r9, r2 + movs r7, 0x80 + lsls r7, 14 + add r7, r9 + mov r3, r9 + str r3, [sp, 0x4C] +_0811FD58: + adds r0, r4, 0 + mov r2, r10 + asrs r1, r2, 16 + asrs r2, r7, 16 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + bne _0811FD70 + b _0811FEFC +_0811FD70: + ldr r6, =0x0203a124 + ldr r2, [r6] + lsls r0, r5, 2 + adds r2, 0xC + adds r2, r0 + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + str r0, [r2] + lsls r1, r5, 24 + lsrs r1, 24 + bl StartObjectImageAnim + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x1 + bls _0811FD58 + ldr r0, [r6] + ldr r1, [r0, 0x10] + ldr r3, [sp, 0x4C] + asrs r0, r3, 16 + adds r0, 0x60 + strh r0, [r1, 0x22] + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + ldr r0, =gUnknown_0859EEDC + str r0, [r4, 0x8] + ldr r0, =sub_811FF40 + str r0, [r4, 0x14] + ldr r0, =gUnknown_0859EE84 + str r0, [r4, 0x4] + movs r5, 0 + ldr r0, [sp, 0x48] + movs r1, 0x80 + lsls r1, 14 + adds r0, r1 + mov r9, r0 +_0811FDC8: + lsls r2, r5, 4 + adds r2, 0x10 + ldr r3, [sp, 0x4C] + asrs r3, 16 + mov r8, r3 + add r2, r8 + lsls r2, 16 + asrs r2, 16 + adds r0, r4, 0 + mov r3, r9 + asrs r1, r3, 16 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + bne _0811FDEE + b _0811FF0C +_0811FDEE: + ldr r6, =0x0203a124 + ldr r1, [r6] + lsls r0, r5, 2 + adds r1, 0x14 + adds r1, r0 + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + ldr r7, =0x02020630 + adds r0, r7 + str r0, [r1] + strh r5, [r0, 0x2E] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x3 + bls _0811FDC8 + ldr r0, =DummyObjectCallback + str r0, [r4, 0x14] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _0811FEA8 + ldr r0, [r6] + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r1, r7 + str r1, [r0, 0x28] + ldrb r3, [r1, 0x1] + movs r2, 0x3F + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1, 0x1] + ldr r0, [r6] + ldr r1, [r0, 0x28] + ldrb r0, [r1, 0x3] + ands r2, r0 + movs r0, 0x80 + orrs r2, r0 + strb r2, [r1, 0x3] + ldr r0, [r6] + ldr r0, [r0, 0x28] + movs r1, 0x9 + bl StartObjectImageAnim + ldr r1, [r6] + ldr r2, [r1, 0x28] + ldr r3, [sp, 0x48] + asrs r0, r3, 16 + adds r0, 0x20 + strh r0, [r2, 0x20] + ldr r2, [r1, 0x28] + mov r0, r8 + adds r0, 0x50 + strh r0, [r2, 0x22] + ldr r0, [r1, 0x28] + movs r1, 0x1 + movs r2, 0x2 + movs r3, 0 + bl CalcVecFromObjectCenterToObjectUpperLeft + b _0811FEAE + .pool +_0811FEA8: + ldr r1, [r6] + movs r0, 0 + str r0, [r1, 0x28] +_0811FEAE: + ldr r0, =sub_811FF7C + str r0, [r4, 0x14] + ldr r0, [sp, 0x48] + movs r2, 0xC0 + lsls r2, 12 + adds r1, r0, r2 + asrs r1, 16 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _0811FF20 + ldr r0, =0x0203a124 + ldr r2, [r0] + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + str r1, [r2, 0x24] + ldr r3, [sp, 0x4C] + asrs r0, r3, 16 + adds r0, 0x10 + strh r0, [r1, 0x2E] + ldr r0, [r2, 0x24] + movs r1, 0x8 + bl StartObjectImageAnim + b _0811FF28 + .pool +_0811FEFC: + ldr r0, =0x0203a124 + ldr r0, [r0] + lsls r1, r5, 2 + adds r0, 0xC + b _0811FF14 + .pool +_0811FF0C: + ldr r0, =0x0203a124 + ldr r0, [r0] + lsls r1, r5, 2 + adds r0, 0x14 +_0811FF14: + adds r0, r1 + movs r1, 0 + str r1, [r0] + b _0811FF28 + .pool +_0811FF20: + ldr r0, =0x0203a124 + ldr r1, [r0] + movs r0, 0 + str r0, [r1, 0x24] +_0811FF28: + add sp, 0x50 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_811FC80 + + thumb_func_start TaskDummy7 +TaskDummy7: @ 811FF3C + bx lr + thumb_func_end TaskDummy7 + + thumb_func_start sub_811FF40 +sub_811FF40: @ 811FF40 + push {lr} + adds r2, r0, 0 + ldr r0, =0x0203a124 + ldr r0, [r0] + movs r3, 0x2E + ldrsh r1, [r2, r3] + adds r0, 0x6 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0811FF6C + lsls r1, 1 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + adds r0, r2, 0 + bl StartObjectImageAnim + b _0811FF76 + .pool +_0811FF6C: + lsls r1, 25 + lsrs r1, 24 + adds r0, r2, 0 + bl StartObjectImageAnim +_0811FF76: + pop {r0} + bx r0 + thumb_func_end sub_811FF40 + + thumb_func_start sub_811FF7C +sub_811FF7C: @ 811FF7C + ldr r1, =0x0203a124 + ldr r1, [r1] + ldrb r1, [r1, 0x5] + lsls r1, 24 + asrs r1, 24 + lsls r1, 4 + ldrh r2, [r0, 0x2E] + adds r1, r2 + strh r1, [r0, 0x22] + bx lr + .pool + thumb_func_end sub_811FF7C + + thumb_func_start sub_811FF94 +sub_811FF94: @ 811FF94 + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + cmp r2, 0 + bne _0811FFA4 + ldr r2, =gUnknown_0859E65C +_0811FFA4: + movs r3, 0x10 + bl sub_811FFD4 + pop {r1} + bx r1 + .pool + thumb_func_end sub_811FF94 + + thumb_func_start sub_811FFB4 +sub_811FFB4: @ 811FFB4 + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + cmp r2, 0 + bne _0811FFC4 + ldr r2, =gUnknown_0859E65C +_0811FFC4: + movs r3, 0x1 + bl sub_811FFD4 + pop {r1} + bx r1 + .pool + thumb_func_end sub_811FFB4 + + thumb_func_start sub_811FFD4 +sub_811FFD4: @ 811FFD4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x28 + lsls r0, 16 + lsls r1, 16 + lsrs r1, 16 + ldr r4, =gUnknown_0859E67C + str r4, [sp, 0x18] + movs r4, 0x80 + add r5, sp, 0x18 + lsrs r6, r0, 16 + orrs r0, r4 + str r0, [r5, 0x4] + str r2, [sp, 0x20] + ldr r0, =0xffff0000 + mov r8, r0 + add r4, sp, 0x20 + ldr r0, [r4, 0x4] + mov r2, r8 + ands r0, r2 + orrs r0, r1 + str r0, [r4, 0x4] + mov r0, sp + movs r2, 0 + strh r6, [r0] + strh r1, [r0, 0x2] + ldr r0, =gUnknown_0859EF1C + str r0, [sp, 0x4] + ldr r0, =gUnknown_0859EFA4 + str r0, [sp, 0x8] + str r2, [sp, 0xC] + ldr r0, =gDummyObjectRotScalAnimTable + str r0, [sp, 0x10] + ldr r0, =TaskDummy7 + str r0, [sp, 0x14] + lsls r3, 23 + lsrs r3, 16 + ldr r0, [r5, 0x4] + mov r1, r8 + ands r0, r1 + orrs r0, r3 + str r0, [r5, 0x4] + adds r0, r5, 0 + bl LoadObjectPic + adds r0, r4, 0 + bl LoadTaggedObjectPalette + mov r0, sp + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + bne _08120068 + movs r0, 0 + b _08120072 + .pool +_08120068: + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 +_08120072: + add sp, 0x28 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_811FFD4 + + thumb_func_start sub_8120084 +sub_8120084: @ 8120084 + push {lr} + lsls r0, 24 + lsrs r0, 17 + ldr r2, =gUnknown_0859E67C + adds r0, r2 + movs r2, 0x80 + movs r3, 0x10 + bl RequestDma3Copy + pop {r0} + bx r0 + .pool + thumb_func_end sub_8120084 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/money.s b/asm/money.s new file mode 100644 index 000000000..572e4e978 --- /dev/null +++ b/asm/money.s @@ -0,0 +1,402 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start DecryptMoney +@ int DecryptMoney(u32 *moneyPointer) +DecryptMoney: @ 80E5114 + ldr r1, =0x03005d90 + ldr r1, [r1] + adds r1, 0xAC + ldr r0, [r0] + ldr r1, [r1] + eors r0, r1 + bx lr + .pool + thumb_func_end DecryptMoney + + thumb_func_start EncryptMoney +@ void EncryptMoney(u32 *moneyPointer, u32 moneyAmount) +EncryptMoney: @ 80E5128 + ldr r2, =0x03005d90 + ldr r2, [r2] + adds r2, 0xAC + ldr r2, [r2] + eors r2, r1 + str r2, [r0] + bx lr + .pool + thumb_func_end EncryptMoney + + thumb_func_start IsEnoughMoney +@ bool8 IsEnoughMoney(u32 *moneyPointer, u32 price) +IsEnoughMoney: @ 80E513C + push {r4,lr} + adds r4, r1, 0 + bl DecryptMoney + cmp r0, r4 + bcs _080E514C + movs r0, 0 + b _080E514E +_080E514C: + movs r0, 0x1 +_080E514E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end IsEnoughMoney + + thumb_func_start add_money +@ void add_money(int *money_ptr, int amount) +add_money: @ 80E5154 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + bl DecryptMoney + adds r5, r0, 0 + adds r0, r5, r4 + ldr r5, =0x000f423f + adds r4, r5, 0 + cmp r0, r5 + bhi _080E5178 + adds r5, r0, 0 + adds r0, r6, 0 + bl DecryptMoney + cmp r5, r0 + bcs _080E5178 + adds r5, r4, 0 +_080E5178: + adds r0, r6, 0 + adds r1, r5, 0 + bl EncryptMoney + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end add_money + + thumb_func_start subtract_money +@ void subtract_money(int *money_ptr, int amount) +subtract_money: @ 80E518C + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + bl DecryptMoney + adds r1, r0, 0 + cmp r1, r4 + bcs _080E51A0 + movs r1, 0 + b _080E51A2 +_080E51A0: + subs r1, r4 +_080E51A2: + adds r0, r5, 0 + bl EncryptMoney + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end subtract_money + + thumb_func_start sub_80E51B0 +sub_80E51B0: @ 80E51B0 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + ldr r1, =0x020375e2 + ldrh r1, [r1] + bl IsEnoughMoney + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E51B0 + + thumb_func_start sub_80E51D4 +sub_80E51D4: @ 80E51D4 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + ldr r1, =0x020375e2 + ldrh r1, [r1] + bl subtract_money + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E51D4 + + thumb_func_start PrintMoneyAmountInMoneyBox +@ void PrintMoneyAmountInMoneyBox(u8 windowId, int amount, s8 a3) +PrintMoneyAmountInMoneyBox: @ 80E51F4 + push {lr} + sub sp, 0x4 + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp] + movs r1, 0x26 + movs r2, 0x1 + bl PrintMoneyAmount + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end PrintMoneyAmountInMoneyBox + + thumb_func_start PrintMoneyAmount +@ void PrintMoneyAmount(u8 windowId, char x, char y, int amount, u8 a5) +PrintMoneyAmount: @ 80E5214 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + ldr r4, [sp, 0x24] + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r2, 24 + lsrs r6, r2, 24 + lsls r4, 24 + lsrs r5, r4, 24 + ldr r4, =0x02021cc4 + adds r0, r4, 0 + adds r1, r3, 0 + movs r2, 0 + movs r3, 0x6 + bl ConvertIntToDecimalString + adds r0, r4, 0 + bl GetStringLength + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + subs r1, r0 + ldr r2, =0x02021fc4 + adds r0, r1, 0 + subs r1, 0x1 + cmp r0, 0 + ble _080E5264 + movs r3, 0x77 +_080E5258: + strb r3, [r2] + adds r2, 0x1 + adds r0, r1, 0 + subs r1, 0x1 + cmp r0, 0 + bgt _080E5258 +_080E5264: + ldr r1, =gUnknown_085E969C + adds r0, r2, 0 + bl ExpandStringRefs + ldr r2, =0x02021fc4 + str r6, [sp] + str r5, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r7, 0 + movs r1, 0x1 + mov r3, r8 + bl Print + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end PrintMoneyAmount + + thumb_func_start set_window_border_style_and_print_money_box +@ void set_window_border_style_and_print_money_box(u8 windowId, u16 tileStart, u8 palette, int amount) +set_window_border_style_and_print_money_box: @ 80E5298 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + mov r8, r3 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + adds r0, r6, 0 + movs r1, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl SetWindowBorderStyle + adds r0, r6, 0 + mov r1, r8 + movs r2, 0 + bl PrintMoneyAmountInMoneyBox + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end set_window_border_style_and_print_money_box + + thumb_func_start sub_80E52D4 +sub_80E52D4: @ 80E52D4 + push {lr} + adds r1, r0, 0 + ldr r0, =0x02039f98 + ldrb r0, [r0] + movs r2, 0 + bl PrintMoneyAmountInMoneyBox + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E52D4 + + thumb_func_start sub_80E52EC +@ void sub_80E52EC(int money, int x, int y) +sub_80E52EC: @ 80E52EC + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x18 + mov r8, r0 + adds r4, r1, 0 + adds r3, r2, 0 + lsls r4, 24 + lsls r3, 24 + lsrs r6, r4, 24 + movs r0, 0x80 + lsls r0, 17 + adds r4, r0 + lsrs r4, 24 + lsrs r5, r3, 24 + adds r3, r0 + lsrs r3, 24 + movs r0, 0xA + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0x8 + str r0, [sp, 0xC] + add r0, sp, 0x10 + movs r1, 0 + adds r2, r4, 0 + bl rbox_template_set + ldr r4, =0x02039f98 + add r0, sp, 0x10 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl FillWindowPixelBuffer + ldrb r0, [r4] + bl PutWindowTilemap + ldrb r0, [r4] + movs r1, 0x1 + bl CopyWindowToVram + ldrb r0, [r4] + movs r1, 0x85 + lsls r1, 2 + movs r2, 0xE + mov r3, r8 + bl set_window_border_style_and_print_money_box + lsls r6, 19 + movs r0, 0x98 + lsls r0, 13 + adds r6, r0 + lsrs r6, 16 + lsls r5, 19 + movs r0, 0xB0 + lsls r0, 12 + adds r5, r0 + lsrs r5, 16 + adds r0, r6, 0 + adds r1, r5, 0 + bl AddMoneyLabelObject + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E52EC + + thumb_func_start sub_80E5384 +sub_80E5384: @ 80E5384 + push {r4,lr} + bl RemoveMoneyLabelObject + ldr r4, =0x02039f98 + ldrb r0, [r4] + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + movs r1, 0x2 + bl CopyWindowToVram + ldrb r0, [r4] + bl RemoveWindow + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E5384 + + thumb_func_start AddMoneyLabelObject +AddMoneyLabelObject: @ 80E53AC + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + ldr r0, =gUnknown_0858C2A4 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0858C2AC + bl LoadCompressedObjectPalette + ldr r0, =gUnknown_0858C28C + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0 + bl AddObjectToFront + ldr r1, =0x02039f99 + strb r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end AddMoneyLabelObject + + thumb_func_start RemoveMoneyLabelObject +RemoveMoneyLabelObject: @ 80E53F4 + push {lr} + ldr r0, =0x02039f99 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeResources + pop {r0} + bx r0 + .pool + thumb_func_end RemoveMoneyLabelObject + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/multiboot.s b/asm/multiboot.s index 6d752c882..6af71ca8e 100644 --- a/asm/multiboot.s +++ b/asm/multiboot.s @@ -1,4 +1,5 @@ .include "asm/macros.inc" + .include "constants/constants.inc" .syntax unified diff --git a/asm/mystery_event_menu.s b/asm/mystery_event_menu.s new file mode 100644 index 000000000..e5f443045 --- /dev/null +++ b/asm/mystery_event_menu.s @@ -0,0 +1,669 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8178944 +sub_8178944: @ 8178944 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8178944 + + thumb_func_start sub_8178958 +sub_8178958: @ 8178958 + push {lr} + movs r2, 0 + ldr r1, =0x020229e8 + ldrh r0, [r1, 0x1A] + ldrh r1, [r1, 0x36] + cmp r0, r1 + bne _08178968 + movs r2, 0x1 +_08178968: + adds r0, r2, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8178958 + + thumb_func_start sub_8178974 +sub_8178974: @ 8178974 + push {r4,lr} + sub sp, 0x8 + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + bl ResetTasks + ldr r0, =sub_8178944 + bl SetVBlankCallback + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085EFD64 + movs r0, 0 + movs r2, 0x1 + bl InitBgsFromTemplates + ldr r0, =gUnknown_085EFD68 + bl InitWindows + lsls r0, 16 + cmp r0, 0 + beq _08178A22 + bl DeactivateAllTextPrinters + movs r4, 0 +_081789AC: + lsls r0, r4, 24 + lsrs r0, 24 + movs r1, 0 + bl FillWindowPixelBuffer + adds r4, 0x1 + cmp r4, 0x1 + ble _081789AC + movs r0, 0x1E + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + movs r1, 0x1 + movs r2, 0xD0 + bl sub_809882C + movs r0, 0xE0 + bl sub_81978B0 + movs r1, 0xA0 + lsls r1, 1 + movs r0, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + ldr r0, =sub_8009404 + movs r1, 0 + bl CreateTask + bl sub_80A2F30 + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + movs r0, 0 + movs r1, 0 + movs r2, 0x2 + bl rboxid_80040B8 + ldr r0, =sub_8178A78 + bl SetMainCallback2 +_08178A22: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8178974 + + thumb_func_start sub_8178A40 +sub_8178A40: @ 8178A40 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + movs r5, 0x1 + cmp r4, 0 + bne _08178A54 + ldr r1, =gUnknown_085EE80A + bl CopyString + movs r5, 0 +_08178A54: + cmp r4, 0x2 + bne _08178A5A + movs r5, 0 +_08178A5A: + cmp r4, 0x1 + bne _08178A66 + ldr r1, =gUnknown_085EE827 + adds r0, r6, 0 + bl CopyString +_08178A66: + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8178A40 + + thumb_func_start sub_8178A78 +sub_8178A78: @ 8178A78 + push {r4-r6,lr} + sub sp, 0x8 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0x10 + bls _08178A8E + b _08178E58 +_08178A8E: + lsls r0, 2 + ldr r1, =_08178AA0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08178AA0: + .4byte _08178AE4 + .4byte _08178B12 + .4byte _08178B48 + .4byte _08178B80 + .4byte _08178BCC + .4byte _08178BDC + .4byte _08178C54 + .4byte _08178D28 + .4byte _08178D38 + .4byte _08178D58 + .4byte _08178D60 + .4byte _08178D74 + .4byte _08178DBC + .4byte _08178DE0 + .4byte _08178E0C + .4byte _08178E24 + .4byte _08178E48 +_08178AE4: + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + movs r3, 0xD + bl SetWindowBorderStyle + movs r0, 0 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0 + bl ShowBg + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + b _08178E30 +_08178B12: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08178B20 + b _08178E58 +_08178B20: + ldr r1, =gUnknown_085EE765 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + movs r2, 0x1 + movs r3, 0x2 + bl sub_8178EC4 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _08178E3C + .pool +_08178B48: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + beq _08178B56 + b _08178E58 +_08178B56: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, =0x020229c6 + ldr r2, =0x00005501 + adds r0, r2, 0 + strh r0, [r1] + bl sub_8009734 + b _08178E58 + .pool +_08178B80: + ldr r0, =0x030030e0 + ldr r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _08178B8E + b _08178D00 +_08178B8E: + movs r0, 0x1C + ands r1, r0 + cmp r1, 0x4 + bhi _08178B98 + b _08178D00 +_08178B98: + movs r0, 0x15 + bl audio_play + ldr r1, =gUnknown_085EE788 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + movs r2, 0x1 + movs r3, 0x2 + bl sub_8178EC4 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08178D00 + .pool +_08178BCC: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + beq _08178BDA + b _08178E58 +_08178BDA: + b _08178E34 +_08178BDC: + bl sub_800ABAC + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bne _08178CD0 + ldr r4, =0x030022c0 + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08178C38 + movs r0, 0x5 + bl audio_play + bl sub_800A620 + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x1 + movs r3, 0xD + bl SetWindowBorderStyle + ldr r1, =gUnknown_085EE7BF + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0x1 + movs r3, 0x2 + bl sub_8178EC4 + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram + movs r2, 0x87 + lsls r2, 3 + adds r1, r4, r2 + b _08178E3C + .pool +_08178C38: + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08178C42 + b _08178E58 +_08178C42: + movs r0, 0x5 + bl audio_play + bl sub_80097E8 + movs r0, 0x87 + lsls r0, 3 + adds r1, r4, r0 + b _08178D1E +_08178C54: + bl sub_800B320 + lsls r0, 24 + cmp r0, 0 + beq _08178D00 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08178C68 + b _08178E58 +_08178C68: + movs r0, 0x2 + movs r1, 0x2 + bl sub_800A0C8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _08178CAC + bl sub_800AC34 + ldr r4, =0x02021fc4 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8178A40 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x2 + bl sub_8178EC4 + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + b _08178CF2 + .pool +_08178CAC: + bl sub_8178958 + lsls r0, 24 + cmp r0, 0 + beq _08178CCC + ldr r1, =gUnknown_085EE7CE + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + movs r2, 0x1 + movs r3, 0x2 + bl sub_8178EC4 + b _08178E34 + .pool +_08178CCC: + bl sub_80097E8 +_08178CD0: + ldr r4, =0x02021fc4 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8178A40 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x2 + bl sub_8178EC4 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 +_08178CF2: + movs r1, 0xD + strb r1, [r0] + b _08178E58 + .pool +_08178D00: + ldr r4, =0x030022c0 + ldrh r1, [r4, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08178D0E + b _08178E58 +_08178D0E: + movs r0, 0x5 + bl audio_play + bl sub_80097E8 + movs r2, 0x87 + lsls r2, 3 + adds r1, r4, r2 +_08178D1E: + movs r0, 0xF + strb r0, [r1] + b _08178E58 + .pool +_08178D28: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + beq _08178D36 + b _08178E58 +_08178D36: + b _08178E34 +_08178D38: + bl sub_800A550 + lsls r0, 24 + cmp r0, 0 + bne _08178D44 + b _08178E58 +_08178D44: + bl sub_800A5B4 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _08178E3C + .pool +_08178D58: + movs r0, 0x87 + lsls r0, 3 + adds r1, r4, r0 + b _08178E3C +_08178D60: + bl sub_800AC34 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _08178E3C + .pool +_08178D74: + ldr r0, =0x03003124 + ldrb r6, [r0] + cmp r6, 0 + bne _08178E58 + ldr r5, =0x0201c000 + adds r0, r5, 0 + bl sub_81538A0 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + str r6, [sp, 0x4] + ldr r2, =0x050001f5 + add r0, sp, 0x4 + adds r1, r5, 0 + bl CpuSet + ldr r0, =0x02021fc4 + adds r1, r4, 0 + bl sub_8178A40 + lsls r0, 24 + cmp r0, 0 + bne _08178E34 + movs r0, 0 + bl save_game_when_memory_present + b _08178E34 + .pool +_08178DBC: + ldr r1, =0x02021fc4 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + movs r2, 0x1 + movs r3, 0x2 + bl sub_8178EC4 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _08178E3C + .pool +_08178DE0: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + bne _08178E58 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r0, =0x0203bcf8 + strb r2, [r0] + b _08178E58 + .pool +_08178E0C: + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08178E58 + movs r0, 0x5 + bl audio_play + movs r2, 0x87 + lsls r2, 3 + adds r1, r4, r2 + b _08178E3C +_08178E24: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 +_08178E30: + bl pal_fade_maybe +_08178E34: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_08178E3C: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08178E58 + .pool +_08178E48: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08178E58 + bl Reset +_08178E58: + ldr r0, =0x030030e0 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08178E98 + bl sub_800ABBC + lsls r0, 24 + cmp r0, 0 + bne _08178E98 + bl sub_80097E8 + ldr r4, =0x02021fc4 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8178A40 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x2 + bl sub_8178EC4 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0xD + strb r1, [r0] +_08178E98: + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8178A78 + + thumb_func_start sub_8178EC4 +sub_8178EC4: @ 8178EC4 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x1C + adds r5, r0, 0 + mov r10, r1 + adds r6, r2, 0 + ldr r4, [sp, 0x38] + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0 + mov r9, r0 + movs r1, 0x1 + mov r8, r1 + add r0, sp, 0x14 + mov r1, r8 + strb r1, [r0] + adds r1, r0, 0 + movs r0, 0x2 + strb r0, [r1, 0x1] + movs r0, 0x3 + strb r0, [r1, 0x2] + adds r0, r1, 0 + ldrb r0, [r0] + lsls r1, r0, 4 + orrs r1, r0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + str r3, [sp, 0x18] + bl FillWindowPixelBuffer + mov r0, r9 + str r0, [sp] + mov r1, r8 + str r1, [sp, 0x4] + add r0, sp, 0x14 + str r0, [sp, 0x8] + lsls r4, 24 + asrs r4, 24 + str r4, [sp, 0xC] + mov r1, r10 + str r1, [sp, 0x10] + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r6, 0 + ldr r3, [sp, 0x18] + bl AddTextPrinterParametrized2 + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8178EC4 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/mystery_event_script.s b/asm/mystery_event_script.s new file mode 100644 index 000000000..93cfe3e39 --- /dev/null +++ b/asm/mystery_event_script.s @@ -0,0 +1,870 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_81537CC +sub_81537CC: @ 81537CC + push {r4,lr} + adds r4, r3, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r2, 16 + lsrs r2, 16 + movs r3, 0x1 + ands r0, r3 + cmp r0, 0 + beq _081537FC + ands r1, r3 + cmp r1, 0 + beq _081537FC + movs r0, 0x4 + ands r2, r0 + cmp r2, 0 + beq _081537FC + movs r0, 0x80 + lsls r0, 2 + ands r0, r4 + cmp r0, 0 + beq _081537FC + movs r0, 0x1 + b _081537FE +_081537FC: + movs r0, 0 +_081537FE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81537CC + + thumb_func_start sub_8153804 +sub_8153804: @ 8153804 + push {lr} + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_08674C86 + bl ExpandStringRefs + movs r0, 0x3 + bl sub_81538C4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8153804 + + thumb_func_start sub_8153820 +sub_8153820: @ 8153820 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, =gUnknown_082DED2C + ldr r2, =gUnknown_082DED2C + 0x44 + bl script_env_init + adds r0, r4, 0 + adds r1, r5, 0 + bl script_setup_bytecode_script + str r5, [r4, 0x64] + movs r0, 0 + str r0, [r4, 0x68] + str r0, [r4, 0x6C] + str r0, [r4, 0x70] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8153820 + + thumb_func_start sub_8153850 +sub_8153850: @ 8153850 + push {r4,lr} + adds r4, r0, 0 + bl script_main_handler + lsls r0, 24 + cmp r0, 0 + beq _08153868 + ldr r0, [r4, 0x70] + cmp r0, 0 + beq _08153868 + movs r0, 0x1 + b _0815386A +_08153868: + movs r0, 0 +_0815386A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8153850 + + thumb_func_start sub_8153870 +sub_8153870: @ 8153870 + push {lr} + adds r1, r0, 0 + ldr r0, =0x0203bbc0 + bl sub_8153820 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8153870 + + thumb_func_start sub_8153884 +sub_8153884: @ 8153884 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x0203bbc0 + adds r0, r4, 0 + bl sub_8153850 + ldr r1, [r4, 0x6C] + str r1, [r5] + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8153884 + + thumb_func_start sub_81538A0 +sub_81538A0: @ 81538A0 + push {r4,lr} + adds r1, r0, 0 + ldr r4, =0x0203bbc0 + adds r0, r4, 0 + bl sub_8153820 +_081538AC: + adds r0, r4, 0 + bl sub_8153850 + cmp r0, 0 + bne _081538AC + ldr r0, [r4, 0x6C] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81538A0 + + thumb_func_start sub_81538C4 +sub_81538C4: @ 81538C4 + ldr r1, =0x0203bbc0 + str r0, [r1, 0x6C] + bx lr + .pool + thumb_func_end sub_81538C4 + + thumb_func_start sub_81538D0 +sub_81538D0: @ 81538D0 + push {lr} + movs r2, 0 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003b18 + adds r3, r0, r1 + movs r1, 0 +_081538DE: + adds r0, r3, r1 + ldrb r0, [r0] + adds r2, r0 + adds r1, 0x1 + cmp r1, 0xB + bls _081538DE + adds r0, r2, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81538D0 + + thumb_func_start sub_81538F8 +sub_81538F8: @ 81538F8 + push {r4,r5,lr} + ldr r5, =0x03005d8c + ldr r0, [r5] + ldr r1, =0x00003b18 + adds r4, r0, r1 + bl sub_81538D0 + adds r1, r0, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _0815392A + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _0815392A + ldrh r0, [r4, 0x2] + cmp r0, 0 + beq _0815392A + cmp r1, 0 + beq _0815392A + ldr r0, [r5] + ldr r2, =0x00003b14 + adds r0, r2 + ldr r0, [r0] + cmp r1, r0 + beq _0815393C +_0815392A: + movs r0, 0 + b _0815393E + .pool +_0815393C: + movs r0, 0x1 +_0815393E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81538F8 + + thumb_func_start sub_8153944 +sub_8153944: @ 8153944 + push {lr} + sub sp, 0x4 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x00003b14 + adds r1, r0 + ldr r2, =0x01000008 + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8153944 + + thumb_func_start sub_8153970 +sub_8153970: @ 8153970 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r3, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r5, r1, 0 + lsls r2, 16 + lsrs r2, 16 + adds r6, r2, 0 + cmp r3, 0 + beq _08153990 + cmp r1, 0 + beq _08153990 + cmp r2, 0 + bne _08153996 +_08153990: + bl sub_8153944 + b _081539BC +_08153996: + ldr r4, =0x03005d8c + ldr r0, [r4] + ldr r1, =0x00003b18 + adds r0, r1 + strb r3, [r0] + ldr r0, [r4] + ldr r2, =0x00003b19 + adds r0, r2 + strb r5, [r0] + ldr r0, [r4] + adds r1, 0x2 + adds r0, r1 + strh r6, [r0] + bl sub_81538D0 + ldr r1, [r4] + ldr r2, =0x00003b14 + adds r1, r2 + str r0, [r1] +_081539BC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8153970 + + thumb_func_start sub_81539D4 +sub_81539D4: @ 81539D4 + push {r4-r6,lr} + ldr r6, =0x03005d8c + ldr r0, [r6] + ldr r1, =0x00003b18 + adds r4, r0, r1 + bl sub_81538F8 + cmp r0, 0 + bne _081539F8 + bl sub_8153944 + movs r0, 0 + b _08153A1A + .pool +_081539F8: + ldrh r5, [r4, 0x2] + ldrb r0, [r4, 0x1] + subs r0, 0x1 + strb r0, [r4, 0x1] + lsls r0, 24 + cmp r0, 0 + bne _08153A0C + bl sub_8153944 + b _08153A18 +_08153A0C: + bl sub_81538D0 + ldr r1, [r6] + ldr r2, =0x00003b14 + adds r1, r2 + str r0, [r1] +_08153A18: + adds r0, r5, 0 +_08153A1A: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81539D4 + + thumb_func_start script_status_stop_and_ret_1 +script_status_stop_and_ret_1: @ 8153A24 + push {lr} + bl script_stop + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end script_status_stop_and_ret_1 + + thumb_func_start sub_8153A30 +sub_8153A30: @ 8153A30 + push {r4-r7,lr} + adds r7, r0, 0 + bl script_read_word + str r0, [r7, 0x68] + adds r0, r7, 0 + bl script_read_halfword + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r7, 0 + bl script_read_word + adds r6, r0, 0 + adds r0, r7, 0 + bl script_read_halfword + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r7, 0 + bl script_read_word + adds r3, r0, 0 + adds r0, r5, 0 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_81537CC + cmp r0, 0x1 + bne _08153A74 + str r0, [r7, 0x70] + b _08153A78 +_08153A74: + bl sub_8153804 +_08153A78: + movs r0, 0x1 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8153A30 + + thumb_func_start sub_8153A80 +sub_8153A80: @ 8153A80 + movs r0, 0 + bx lr + thumb_func_end sub_8153A80 + + thumb_func_start sub_8153A84 +sub_8153A84: @ 8153A84 + ldr r1, [r0, 0x8] + ldrb r2, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + str r2, [r0, 0x6C] + movs r0, 0 + bx lr + thumb_func_end sub_8153A84 + + thumb_func_start sub_8153A94 +sub_8153A94: @ 8153A94 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x8] + ldrb r5, [r0] + adds r0, 0x1 + str r0, [r4, 0x8] + adds r0, r4, 0 + bl script_read_word + ldr r1, [r4, 0x68] + subs r0, r1 + ldr r1, [r4, 0x64] + adds r1, r0, r1 + cmp r5, 0xFF + beq _08153AB8 + ldr r0, [r4, 0x6C] + cmp r5, r0 + bne _08153ABE +_08153AB8: + ldr r0, =0x02021fc4 + bl ExpandStringRefs +_08153ABE: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8153A94 + + thumb_func_start sub_8153ACC +sub_8153ACC: @ 8153ACC + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + ldr r1, [r4, 0x68] + subs r0, r1 + ldr r1, [r4, 0x64] + adds r0, r1 + bl script_env_2_execute_new_script + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8153ACC + + thumb_func_start sub_8153AE8 +sub_8153AE8: @ 8153AE8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + bl sub_80E162C + mov r8, r0 + adds r0, r7, 0 + bl script_read_word + adds r4, r0, 0 + ldr r0, [r7, 0x68] + subs r4, r0 + ldr r0, [r7, 0x64] + adds r4, r0 + ldr r0, =0x02021cc4 + mov r9, r0 + ldr r6, =0x03005d8c + ldr r1, [r6] + ldr r5, =0x000031f8 + adds r1, r5 + movs r2, 0x7 + bl CopyString_LimitN + adds r0, r4, 0 + bl sub_80E15E4 + ldr r4, =0x02021dc4 + ldr r1, [r6] + adds r1, r5 + adds r0, r4, 0 + movs r2, 0x7 + bl CopyString_LimitN + mov r0, r8 + cmp r0, 0 + bne _08153B54 + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_08674AE4 + b _08153B74 + .pool +_08153B54: + mov r0, r9 + adds r1, r4, 0 + bl CompareString + cmp r0, 0 + beq _08153B70 + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_08674B16 + b _08153B74 + .pool +_08153B70: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_08674B42 +_08153B74: + bl ExpandStringRefs + movs r0, 0x2 + str r0, [r7, 0x6C] + bl sub_80E162C + cmp r0, 0x1 + bne _08153B9C + ldr r0, =0x0000402d + movs r1, 0x1 + bl VarSet + b _08153BA0 + .pool +_08153B9C: + movs r0, 0x1 + str r0, [r7, 0x6C] +_08153BA0: + movs r0, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8153AE8 + + thumb_func_start sub_8153BB0 +sub_8153BB0: @ 8153BB0 + push {r4,lr} + adds r4, r0, 0 + ldr r2, [r4, 0x8] + ldrb r0, [r2] + adds r2, 0x1 + str r2, [r4, 0x8] + ldrb r1, [r2] + adds r2, 0x1 + str r2, [r4, 0x8] + bl sub_80F9B30 + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_08674B6A + bl ExpandStringRefs + movs r0, 0x2 + str r0, [r4, 0x6C] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8153BB0 + + thumb_func_start sub_8153BE4 +sub_8153BE4: @ 8153BE4 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r4, r0, 0 + ldr r0, [r4, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r4, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r4, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r4, 0x8] + adds r0, r4, 0 + bl script_read_word + adds r5, r0, 0 + ldr r0, [r4, 0x68] + subs r5, r0 + ldr r0, [r4, 0x64] + adds r5, r0 + adds r0, r4, 0 + bl script_read_word + adds r1, r0, 0 + ldr r0, [r4, 0x68] + subs r1, r0 + ldr r0, [r4, 0x64] + adds r1, r0 + subs r1, r5 + lsls r1, 16 + lsrs r1, 16 + str r6, [sp] + adds r0, r5, 0 + mov r2, r9 + mov r3, r8 + bl sub_80990FC + movs r0, 0 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8153BE4 + + thumb_func_start sub_8153C4C +sub_8153C4C: @ 8153C4C + push {r4,lr} + adds r4, r0, 0 + bl sub_809D3E8 + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_08674B9E + bl ExpandStringRefs + movs r0, 0x2 + str r0, [r4, 0x6C] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8153C4C + + thumb_func_start sub_8153C70 +sub_8153C70: @ 8153C70 + push {r4,lr} + adds r4, r0, 0 + ldr r1, [r4, 0x8] + ldrb r0, [r1] + adds r1, 0x1 + str r1, [r4, 0x8] + bl sub_811EFC0 + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_08674BD4 + bl ExpandStringRefs + movs r0, 0x2 + str r0, [r4, 0x6C] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8153C70 + + thumb_func_start sub_8153C9C +sub_8153C9C: @ 8153C9C + push {r4,r5,lr} + ldr r1, [r0, 0x8] + ldrb r5, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8153970 + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8153C9C + + thumb_func_start sub_8153CC8 +sub_8153CC8: @ 8153CC8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x88 + adds r6, r0, 0 + bl script_read_word + ldr r1, [r6, 0x68] + subs r0, r1 + ldr r1, [r6, 0x64] + adds r5, r0, r1 + movs r0, 0x64 + adds r0, r5 + mov r8, r0 + add r4, sp, 0x24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x64 + bl memcpy + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + bne _08153D18 + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085E8264 + movs r2, 0xB + bl CopyString_LimitN + b _08153D22 + .pool +_08153D18: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085E8268 + movs r2, 0xB + bl CopyString_LimitN +_08153D22: + ldr r0, =0x020244e9 + ldrb r0, [r0] + cmp r0, 0x6 + bne _08153D4C + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_08674C02 + bl ExpandStringRefs + movs r0, 0x3 + b _08153DB6 + .pool +_08153D4C: + ldr r7, =0x020246e0 + adds r0, r7, 0 + adds r1, r5, 0 + movs r2, 0x64 + bl memcpy + mov r0, sp + mov r1, r8 + movs r2, 0x24 + bl memcpy + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + beq _08153D86 + adds r0, r4, 0 + bl SpeciesToNationalPokedexNum + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + movs r1, 0x2 + bl pokedex_flag_operation + adds r0, r4, 0 + movs r1, 0x3 + bl pokedex_flag_operation +_08153D86: + adds r0, r7, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _08153DA4 + adds r0, r7, 0 + mov r1, sp + bl sub_80D460C +_08153DA4: + bl party_compaction + bl calc_player_party_count + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_08674BF0 + bl ExpandStringRefs + movs r0, 0x2 +_08153DB6: + str r0, [r6, 0x6C] + movs r0, 0 + add sp, 0x88 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8153CC8 + + thumb_func_start sub_8153DD4 +sub_8153DD4: @ 8153DD4 + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + adds r1, r0, 0 + ldr r0, [r4, 0x68] + subs r1, r0 + ldr r0, [r4, 0x64] + adds r1, r0 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r2, =0x00000bec + adds r0, r2 + movs r2, 0xBC + bl memcpy + bl sub_81652B4 + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_08674C31 + bl ExpandStringRefs + movs r0, 0x2 + str r0, [r4, 0x6C] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8153DD4 + + thumb_func_start sub_8153E1C +sub_8153E1C: @ 8153E1C + push {r4,lr} + adds r4, r0, 0 + bl sub_809D5F4 + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085ECAD8 + bl ExpandStringRefs + movs r0, 0x2 + str r0, [r4, 0x6C] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8153E1C + + thumb_func_start sub_8153E40 +sub_8153E40: @ 8153E40 + push {r4-r6,lr} + adds r6, r0, 0 + bl script_read_word + adds r5, r0, 0 + adds r0, r6, 0 + bl script_read_word + adds r4, r0, 0 + ldr r0, [r6, 0x68] + subs r4, r0 + ldr r0, [r6, 0x64] + adds r4, r0 + adds r0, r6, 0 + bl script_read_word + adds r1, r0, 0 + ldr r0, [r6, 0x68] + subs r1, r0 + ldr r0, [r6, 0x64] + adds r1, r0 + subs r1, r4 + adds r0, r4, 0 + bl sub_806F96C + cmp r5, r0 + beq _08153E7E + movs r0, 0 + str r0, [r6, 0x70] + movs r0, 0x1 + str r0, [r6, 0x6C] +_08153E7E: + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8153E40 + + thumb_func_start sub_8153E88 +sub_8153E88: @ 8153E88 + push {r4-r6,lr} + adds r6, r0, 0 + bl script_read_word + adds r5, r0, 0 + adds r0, r6, 0 + bl script_read_word + adds r4, r0, 0 + ldr r0, [r6, 0x68] + subs r4, r0 + ldr r0, [r6, 0x64] + adds r4, r0 + adds r0, r6, 0 + bl script_read_word + adds r1, r0, 0 + ldr r0, [r6, 0x68] + subs r1, r0 + ldr r0, [r6, 0x64] + adds r1, r0 + subs r1, r4 + adds r0, r4, 0 + bl sub_806F8D0 + lsls r0, 16 + lsrs r0, 16 + cmp r5, r0 + beq _08153ECA + movs r0, 0 + str r0, [r6, 0x70] + movs r0, 0x1 + str r0, [r6, 0x6C] +_08153ECA: + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8153E88 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/naming_screen.s b/asm/naming_screen.s new file mode 100644 index 000000000..8bf21a473 --- /dev/null +++ b/asm/naming_screen.s @@ -0,0 +1,4267 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start do_choose_name_or_words_screen +@ int do_choose_name_or_words_screen(u8 type, sav2 *sav2_ptr, s16 player_gender, s16 a4, int a5, void ( *after_finishing_callback)()) +do_choose_name_or_words_screen: @ 80E2D78 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r1 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r2, 16 + lsrs r5, r2, 16 + lsls r3, 16 + lsrs r6, r3, 16 + ldr r4, =0x02039f94 + movs r0, 0xF2 + lsls r0, 5 + bl Alloc + str r0, [r4] + cmp r0, 0 + bne _080E2DA8 + ldr r0, [sp, 0x1C] + bl SetMainCallback2 + b _080E2DE2 + .pool +_080E2DA8: + ldr r1, =0x00001e2c + adds r0, r1 + strb r7, [r0] + ldr r0, [r4] + ldr r2, =0x00001e34 + adds r1, r0, r2 + strh r5, [r1] + adds r2, 0x2 + adds r1, r0, r2 + strh r6, [r1] + ldr r1, =0x00001e38 + adds r2, r0, r1 + ldr r1, [sp, 0x18] + str r1, [r2] + ldr r2, =0x00001e30 + adds r1, r0, r2 + mov r2, r8 + str r2, [r1] + ldr r1, =0x00001e3c + adds r0, r1 + ldr r2, [sp, 0x1C] + str r2, [r0] + cmp r7, 0 + bne _080E2DDC + bl StartTimer1 +_080E2DDC: + ldr r0, =c2_choose_name_or_words_screen + bl SetMainCallback2 +_080E2DE2: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end do_choose_name_or_words_screen + + thumb_func_start c2_choose_name_or_words_screen +c2_choose_name_or_words_screen: @ 80E2E04 + push {lr} + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x7 + bhi _080E2E9C + lsls r0, 2 + ldr r1, =_080E2E28 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080E2E28: + .4byte _080E2E48 + .4byte _080E2E52 + .4byte _080E2E58 + .4byte _080E2E5E + .4byte _080E2E68 + .4byte _080E2E6E + .4byte _080E2E74 + .4byte _080E2E7A +_080E2E48: + bl sub_80E4F70 + bl choose_name_or_words_screen_setup + b _080E2E86 +_080E2E52: + bl choose_name_or_words_screen_init_bgs + b _080E2E86 +_080E2E58: + bl sub_80A1A74 + b _080E2E86 +_080E2E5E: + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + b _080E2E86 +_080E2E68: + bl ResetTasks + b _080E2E86 +_080E2E6E: + bl choose_name_or_words_screen_apply_bg_pals + b _080E2E86 +_080E2E74: + bl choose_name_or_words_screen_load_bg_tile_patterns + b _080E2E86 +_080E2E7A: + bl sub_80E3CC8 + bl fade_and_return_progress_probably + bl sub_80E501C +_080E2E86: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080E2EA4 + .pool +_080E2E9C: + bl sub_80E4CB8 + bl sub_80E3194 +_080E2EA4: + pop {r0} + bx r0 + thumb_func_end c2_choose_name_or_words_screen + + thumb_func_start choose_name_or_words_screen_setup +@ void choose_name_or_words_screen_setup() +choose_name_or_words_screen_setup: @ 80E2EA8 + push {r4-r7,lr} + ldr r5, =0x02039f94 + ldr r0, [r5] + ldr r1, =0x00001e10 + adds r0, r1 + movs r2, 0 + strb r2, [r0] + ldr r1, [r5] + ldr r3, =0x00001e18 + adds r0, r1, r3 + movs r4, 0 + strh r2, [r0] + ldr r7, =0x00001e1a + adds r0, r1, r7 + strh r2, [r0] + ldr r0, =0x00001e1c + adds r2, r1, r0 + movs r3, 0x1 + movs r0, 0x1 + strh r0, [r2] + adds r7, 0x4 + adds r2, r1, r7 + movs r0, 0x2 + strh r0, [r2] + movs r0, 0xF1 + lsls r0, 5 + adds r1, r0 + strb r4, [r1] + ldr r0, [r5] + ldr r1, =0x00001e21 + adds r0, r1 + strb r3, [r0] + ldr r1, [r5] + ldr r6, =0x00001e28 + adds r3, r1, r6 + ldr r2, =gUnknown_0858BFD8 + ldr r4, =0x00001e2c + adds r0, r1, r4 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + str r0, [r3] + ldrb r0, [r0, 0x4] + ldr r2, =0x00001e22 + adds r1, r2 + strb r0, [r1] + ldr r2, [r5] + adds r0, r2, r6 + ldr r0, [r0] + ldrb r1, [r0, 0x1] + lsls r1, 3 + movs r0, 0xF0 + subs r0, r1 + asrs r3, r0, 1 + adds r0, r3, 0x6 + subs r7, 0x8 + adds r1, r2, r7 + strh r0, [r1] + adds r2, r4 + ldrb r0, [r2] + cmp r0, 0x4 + bne _080E2F2C + adds r0, r3, 0 + adds r0, 0x11 + strh r0, [r1] +_080E2F2C: + ldr r0, [r5] + ldr r4, =0x030022b0 + ldrh r1, [r4] + ldr r2, =0x00001e25 + adds r0, r2 + strb r1, [r0] + ldr r0, [r5] + movs r3, 0xC0 + lsls r3, 5 + adds r0, r3 + movs r1, 0xFF + movs r2, 0x10 + bl memset + ldr r1, [r5] + adds r0, r1, r6 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0 + beq _080E2F64 + movs r7, 0xC0 + lsls r7, 5 + adds r0, r1, r7 + ldr r2, =0x00001e30 + adds r1, r2 + ldr r1, [r1] + bl CopyString +_080E2F64: + movs r0, 0x10 + strh r0, [r4] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end choose_name_or_words_screen_setup + + thumb_func_start sub_80E2FA4 +sub_80E2FA4: @ 80E2FA4 + push {r4,r5,lr} + movs r3, 0 + ldr r4, =0x02020630 + movs r5, 0x5 + negs r5, r5 +_080E2FAE: + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + adds r0, r4 + adds r2, r0, 0 + adds r2, 0x3E + ldrb r1, [r2] + lsls r0, r1, 31 + cmp r0, 0 + beq _080E2FC8 + adds r0, r5, 0 + ands r0, r1 + strb r0, [r2] +_080E2FC8: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3F + bls _080E2FAE + movs r0, 0 + bl sub_80E3E3C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E2FA4 + + thumb_func_start choose_name_or_words_screen_init_bgs +choose_name_or_words_screen_init_bgs: @ 80E2FE4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + movs r3, 0xC0 + lsls r3, 19 + movs r4, 0xC0 + lsls r4, 9 + add r0, sp, 0xC + mov r8, r0 + add r2, sp, 0x8 + movs r6, 0 + ldr r1, =0x040000d4 + movs r5, 0x80 + lsls r5, 5 + ldr r7, =0x81000800 + movs r0, 0x81 + lsls r0, 24 + mov r12, r0 +_080E300A: + strh r6, [r2] + add r0, sp, 0x8 + str r0, [r1] + str r3, [r1, 0x4] + str r7, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r3, r5 + subs r4, r5 + cmp r4, r5 + bhi _080E300A + strh r6, [r2] + add r2, sp, 0x8 + str r2, [r1] + str r3, [r1, 0x4] + lsrs r0, r4, 1 + mov r2, r12 + orrs r0, r2 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r0, 0xE0 + lsls r0, 19 + movs r3, 0x80 + lsls r3, 3 + movs r4, 0 + str r4, [sp, 0xC] + ldr r2, =0x040000d4 + mov r1, r8 + str r1, [r2] + str r0, [r2, 0x4] + lsrs r0, r3, 2 + movs r1, 0x85 + lsls r1, 24 + orrs r0, r1 + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + movs r1, 0xA0 + lsls r1, 19 + add r0, sp, 0x8 + strh r4, [r0] + str r0, [r2] + str r1, [r2, 0x4] + lsrs r3, 1 + movs r0, 0x81 + lsls r0, 24 + orrs r3, r0 + str r3, [r2, 0x8] + ldr r0, [r2, 0x8] + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0858BE00 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + 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 + bl sub_81971D0 + bl sub_8197200 +_080E30D8: + lsls r0, r4, 3 + ldr r1, =gUnknown_0858BE10 + adds r0, r1 + bl AddWindow + ldr r5, =0x02039f94 + ldr r1, [r5] + ldr r2, =0x00001e11 + adds r1, r2 + adds r1, r4 + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _080E30D8 + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r1, 0xC8 + lsls r1, 3 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x0000080c + movs r0, 0x52 + bl SetGpuReg + ldr r1, [r5] + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r5] + movs r0, 0x80 + lsls r0, 4 + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + ldr r1, [r5] + movs r2, 0x80 + lsls r2, 5 + adds r1, r2 + movs r0, 0x3 + bl SetBgTilemapBuffer + movs r4, 0x20 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end choose_name_or_words_screen_init_bgs + + thumb_func_start sub_80E3194 +sub_80E3194: @ 80E3194 + push {lr} + ldr r0, =sub_80E31B0 + movs r1, 0x2 + bl CreateTask + ldr r0, =sub_80E4F58 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E3194 + + thumb_func_start sub_80E31B0 +sub_80E31B0: @ 80E31B0 + push {lr} + ldr r0, =0x02039f94 + ldr r0, [r0] + ldr r1, =0x00001e10 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x9 + bhi _080E3240 + lsls r0, 2 + ldr r1, =_080E31D8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080E31D8: + .4byte _080E3200 + .4byte _080E320E + .4byte _080E3218 + .4byte _080E3214 + .4byte _080E321E + .4byte _080E3224 + .4byte _080E322A + .4byte _080E3230 + .4byte _080E3236 + .4byte _080E323C +_080E3200: + bl sub_80E3294 + bl sub_80E2FA4 + bl sub_80E4F84 + b _080E3240 +_080E320E: + bl sub_80E335C + b _080E3240 +_080E3214: + bl sub_80E33A8 +_080E3218: + bl sub_80E3398 + b _080E3240 +_080E321E: + bl sub_80E3640 + b _080E3240 +_080E3224: + bl sub_80E3680 + b _080E3240 +_080E322A: + bl pokemon_store + b _080E3240 +_080E3230: + bl sub_80E3604 + b _080E3240 +_080E3236: + bl sub_80E3448 + b _080E3240 +_080E323C: + bl sub_80E347C +_080E3240: + pop {r0} + bx r0 + thumb_func_end sub_80E31B0 + + thumb_func_start sub_80E3244 +sub_80E3244: @ 80E3244 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_0858BEBB + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80E3244 + + thumb_func_start sub_80E3254 +sub_80E3254: @ 80E3254 + ldr r1, =gUnknown_0858BEBE + ldr r0, =0x02039f94 + ldr r0, [r0] + ldr r2, =0x00001e22 + adds r0, r2 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80E3254 + + thumb_func_start sub_80E3274 +sub_80E3274: @ 80E3274 + ldr r1, =gUnknown_0858BEC1 + ldr r0, =0x02039f94 + ldr r0, [r0] + ldr r2, =0x00001e22 + adds r0, r2 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80E3274 + + thumb_func_start sub_80E3294 +sub_80E3294: @ 80E3294 + push {r4-r6,lr} + sub sp, 0x4 + ldr r1, =gUnknown_08DD4544 + movs r0, 0x3 + bl sub_80E4CF8 + ldr r5, =0x02039f94 + ldr r0, [r5] + ldr r1, =0x00001e22 + adds r0, r1 + movs r6, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r1, =gUnknown_08DD46E0 + movs r0, 0x2 + bl sub_80E4CF8 + ldr r1, =gUnknown_08DD4620 + movs r0, 0x1 + bl sub_80E4CF8 + ldr r0, [r5] + ldr r1, =0x00001e12 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_80E4DE4 + ldr r0, [r5] + ldr r1, =0x00001e11 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x1 + bl sub_80E4DE4 + movs r0, 0x2 + movs r1, 0 + bl nullsub_10 + movs r0, 0x1 + movs r1, 0x1 + bl nullsub_10 + bl sub_80E4D10 + bl sub_80E4964 + bl sub_80E4EF0 + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + movs r4, 0x1 + negs r4, r4 + adds r0, r4, 0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + str r6, [sp] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r1, [r5] + ldr r0, =0x00001e10 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E3294 + + thumb_func_start sub_80E335C +sub_80E335C: @ 80E335C + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080E3384 + movs r0, 0x1 + bl sub_80E4630 + movs r0, 0x1 + bl sub_80E3E94 + ldr r0, =0x02039f94 + ldr r1, [r0] + ldr r0, =0x00001e10 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080E3384: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E335C + + thumb_func_start sub_80E3398 +sub_80E3398: @ 80E3398 + push {lr} + bl sub_80E44BC + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80E3398 + + thumb_func_start sub_80E33A8 +sub_80E33A8: @ 80E33A8 + push {lr} + bl sub_80E3F04 + lsls r0, 24 + cmp r0, 0 + beq _080E33CA + movs r0, 0x1 + bl sub_80E4630 + bl sub_80E3E28 + ldr r0, =0x02039f94 + ldr r0, [r0] + ldr r1, =0x00001e10 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] +_080E33CA: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E33A8 + + thumb_func_start pokemon_store +pokemon_store: @ 80E33D8 + push {r4,lr} + bl sub_80E4BE4 + movs r0, 0 + bl sub_80E4630 + movs r0, 0 + bl sub_80E3E94 + movs r0, 0x3 + movs r1, 0 + movs r2, 0x1 + bl sub_80E3948 + ldr r4, =0x02039f94 + ldr r0, [r4] + ldr r1, =0x00001e2c + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080E342C + bl calc_player_party_count + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bls _080E342C + bl pokemon_transfer_to_pc_with_message + ldr r0, [r4] + ldr r1, =0x00001e10 + adds r0, r1 + movs r1, 0x7 + strb r1, [r0] + movs r0, 0 + b _080E343A + .pool +_080E342C: + ldr r0, =0x02039f94 + ldr r0, [r0] + ldr r1, =0x00001e10 + adds r0, r1 + movs r1, 0x8 + strb r1, [r0] + movs r0, 0x1 +_080E343A: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end pokemon_store + + thumb_func_start sub_80E3448 +sub_80E3448: @ 80E3448 + push {lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x02039f94 + ldr r1, [r0] + ldr r0, =0x00001e10 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0 + add sp, 0x4 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E3448 + + thumb_func_start sub_80E347C +sub_80E347C: @ 80E347C + push {r4,r5,lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _080E34C6 + ldr r4, =0x02039f94 + ldr r0, [r4] + ldr r1, =0x00001e2c + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080E34A0 + bl SeedRngAndSetTrainerId +_080E34A0: + ldr r0, [r4] + ldr r1, =0x00001e3c + adds r0, r1 + ldr r0, [r0] + bl SetMainCallback2 + ldr r0, =sub_80E31B0 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + bl FreeAllWindowBuffers + ldr r0, [r4] + bl Free + str r5, [r4] +_080E34C6: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E347C + + thumb_func_start pokemon_transfer_to_pc_with_message +pokemon_transfer_to_pc_with_message: @ 80E34E4 + push {r4,r5,lr} + sub sp, 0x10 + movs r5, 0 + bl sub_813B260 + lsls r0, 24 + cmp r0, 0 + bne _080E3534 + ldr r4, =0x02021cc4 + ldr r0, =0x00004036 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + bl sav3_get_box_name + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + ldr r0, =0x02021dc4 + ldr r1, =0x02039f94 + ldr r1, [r1] + ldr r2, =0x00001e30 + adds r1, r2 + ldr r1, [r1] + bl CopyString + b _080E3574 + .pool +_080E3534: + ldr r4, =0x02021cc4 + ldr r0, =0x00004036 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + bl sav3_get_box_name + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + ldr r0, =0x02021dc4 + ldr r1, =0x02039f94 + ldr r1, [r1] + ldr r2, =0x00001e30 + adds r1, r2 + ldr r1, [r1] + bl CopyString + ldr r4, =0x02021ec4 + bl get_unknown_box_id + lsls r0, 24 + lsrs r0, 24 + bl sav3_get_box_name + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + movs r5, 0x2 +_080E3574: + ldr r0, =0x000008ab + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _080E3586 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080E3586: + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_0858BDB8 + lsls r0, r5, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + ldr r2, =0x03003014 + 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, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl AddTextPrinterParametrized + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end pokemon_transfer_to_pc_with_message + + thumb_func_start sub_80E3604 +sub_80E3604: @ 80E3604 + push {lr} + bl RunTextPrinters + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _080E362E + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080E362E + ldr r0, =0x02039f94 + ldr r0, [r0] + ldr r1, =0x00001e10 + adds r0, r1 + movs r1, 0x8 + strb r1, [r0] +_080E362E: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E3604 + + thumb_func_start sub_80E3640 +sub_80E3640: @ 80E3640 + push {lr} + movs r0, 0 + bl sub_80E4630 + bl sub_80E4050 + bl sub_80E373C + movs r0, 0x1 + bl sub_80E3E3C + movs r0, 0 + movs r1, 0 + movs r2, 0x1 + bl sub_80E3948 + movs r0, 0x6 + bl audio_play + ldr r0, =0x02039f94 + ldr r0, [r0] + ldr r1, =0x00001e10 + adds r0, r1 + movs r1, 0x5 + strb r1, [r0] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E3640 + + thumb_func_start sub_80E3680 +sub_80E3680: @ 80E3680 + push {r4-r6,lr} + sub sp, 0x4 + bl sub_80E3794 + lsls r0, 24 + cmp r0, 0 + beq _080E3732 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl sub_80E3DFC + bl sub_80E3F70 + movs r5, 0 + mov r1, sp + movs r2, 0 + ldrsh r1, [r1, r2] + lsls r0, 24 + lsrs r0, 24 + adds r6, r4, 0 + cmp r1, r0 + bne _080E36B2 + movs r5, 0x1 +_080E36B2: + ldr r2, =0x02039f94 + ldr r0, [r2] + ldr r1, =0x00001e10 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + ldr r1, [r2] + ldr r3, =0x00001e22 + adds r1, r3 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r4, [r2] + adds r4, r3 + ldrb r0, [r4] + movs r1, 0x3 + bl __umodsi3 + strb r0, [r4] + cmp r5, 0 + beq _080E36F4 + mov r4, sp + bl sub_80E3F70 + lsls r0, 24 + lsrs r0, 24 + b _080E3712 + .pool +_080E36F4: + mov r0, sp + movs r2, 0 + ldrsh r4, [r0, r2] + bl sub_80E3F70 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + blt _080E3714 + mov r4, sp + bl sub_80E3F70 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 +_080E3712: + strh r0, [r4] +_080E3714: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r6, r2] + bl sub_80E3D78 + bl sub_80E4E5C + movs r0, 0x1 + bl sub_80E4630 + movs r0, 0 + bl sub_80E3E3C +_080E3732: + movs r0, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80E3680 + + thumb_func_start sub_80E373C +sub_80E373C: @ 80E373C + push {r4,lr} + ldr r4, =sub_80E375C + adds r0, r4, 0 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E373C + + thumb_func_start sub_80E375C +sub_80E375C: @ 80E375C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_0858BEC4 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_080E376E: + 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 _080E376E + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E375C + + thumb_func_start sub_80E3794 +sub_80E3794: @ 80E3794 + push {lr} + ldr r0, =sub_80E375C + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _080E37AC + movs r0, 0 + b _080E37AE + .pool +_080E37AC: + movs r0, 0x1 +_080E37AE: + pop {r1} + bx r1 + thumb_func_end sub_80E3794 + + thumb_func_start sub_80E37B4 +sub_80E37B4: @ 80E37B4 + ldr r1, =0x02039f94 + ldr r1, [r1] + ldr r3, =0x00001e18 + adds r2, r1, r3 + movs r3, 0 + strh r3, [r2] + ldr r2, =0x00001e1a + adds r1, r2 + strh r3, [r1] + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + movs r0, 0 + bx lr + .pool + thumb_func_end sub_80E37B4 + + thumb_func_start sub_80E37DC +sub_80E37DC: @ 80E37DC + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r5, =0x02039f94 + ldr r0, [r5] + ldr r2, =0x00001e1a + adds r1, r0, r2 + str r1, [sp] + ldr r1, =0x00001e18 + adds r0, r1 + str r0, [sp, 0x4] + ldrh r0, [r4, 0xA] + adds r0, 0x4 + strh r0, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + movs r1, 0x28 + bl sine + ldr r1, [r5] + movs r2, 0xF1 + lsls r2, 5 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 2 + add r1, sp + ldr r1, [r1] + strh r0, [r1] + ldrh r0, [r4, 0xA] + adds r0, 0x80 + movs r1, 0xFF + ands r0, r1 + movs r1, 0x28 + bl sine + ldr r1, [r5] + ldr r2, =0x00001e21 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 2 + add r1, sp + ldr r1, [r1] + strh r0, [r1] + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x3F + ble _080E3852 + ldr r0, [r5] + ldr r1, =0x00001e1c + adds r2, r0, r1 + ldrb r3, [r2] + adds r1, 0x2 + adds r0, r1 + ldrh r1, [r0] + strh r1, [r2] + strh r3, [r0] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080E3852: + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E37DC + + thumb_func_start sub_80E3870 +sub_80E3870: @ 80E3870 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r5, =0x02039f94 + ldr r0, [r5] + ldr r2, =0x00001e1a + adds r1, r0, r2 + str r1, [sp] + ldr r3, =0x00001e18 + adds r0, r3 + str r0, [sp, 0x4] + ldrh r0, [r4, 0xA] + adds r0, 0x4 + strh r0, [r4, 0xA] + movs r1, 0xA + ldrsh r0, [r4, r1] + movs r1, 0x28 + bl sine + ldr r1, [r5] + movs r2, 0xF1 + lsls r2, 5 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 2 + add r1, sp + ldr r1, [r1] + strh r0, [r1] + ldrh r0, [r4, 0xA] + adds r0, 0x80 + movs r1, 0xFF + ands r0, r1 + movs r1, 0x28 + bl sine + ldr r1, [r5] + ldr r3, =0x00001e21 + adds r1, r3 + ldrb r1, [r1] + lsls r1, 2 + add r1, sp + ldr r1, [r1] + strh r0, [r1] + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x7F + ble _080E38EA + ldr r0, [r5] + movs r2, 0xF1 + lsls r2, 5 + adds r1, r0, r2 + ldrb r2, [r1] + adds r0, r3 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, [r5] + adds r0, r3 + strb r2, [r0] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080E38EA: + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E3870 + + thumb_func_start sub_80E3904 +sub_80E3904: @ 80E3904 + push {lr} + ldr r0, =sub_80E375C + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E3904 + + thumb_func_start sub_80E3920 +sub_80E3920: @ 80E3920 + push {lr} + ldr r0, =c3_0809E58C + movs r1, 0x3 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x3 + strh r0, [r1, 0x8] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E3920 + + thumb_func_start sub_80E3948 +sub_80E3948: @ 80E3948 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r0, =c3_0809E58C + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r4, r1, r0 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r5, r0 + bne _080E3988 + cmp r6, 0 + bne _080E3988 + strh r7, [r4, 0xA] + movs r0, 0x1 + strh r0, [r4, 0xC] + b _080E39B4 + .pool +_080E3988: + cmp r5, 0x3 + bne _080E3998 + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _080E3998 + cmp r6, 0 + beq _080E39B4 +_080E3998: + ldrh r1, [r4, 0x8] + movs r2, 0x8 + ldrsh r0, [r4, r2] + cmp r0, 0x3 + beq _080E39AA + lsls r0, r1, 24 + lsrs r0, 24 + bl sub_80E3AE8 +_080E39AA: + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r7, 0 + bl sub_80E3B10 +_080E39B4: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E3948 + + thumb_func_start c3_0809E58C +c3_0809E58C: @ 80E39BC + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r4, r1, r0 + ldrh r1, [r4, 0x8] + movs r2, 0x8 + ldrsh r0, [r4, r2] + cmp r0, 0x3 + beq _080E3A6E + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _080E3A6E + lsls r0, r1, 24 + lsrs r0, 24 + bl sub_80E3A74 + lsls r0, 16 + lsrs r0, 16 + ldrb r3, [r4, 0xE] + adds r1, r3, 0 + adds r2, r3, 0 + bl sub_80B609C + ldrh r1, [r4, 0x12] + movs r2, 0x12 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080E3A08 + subs r0, r1, 0x1 + strh r0, [r4, 0x12] + lsls r0, 16 + cmp r0, 0 + bne _080E3A6E +_080E3A08: + movs r0, 0x2 + strh r0, [r4, 0x12] + ldrh r1, [r4, 0x10] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r0, 0 + blt _080E3A32 + ldrh r2, [r4, 0xE] + movs r3, 0xE + ldrsh r0, [r4, r3] + cmp r0, 0xD + bgt _080E3A28 + adds r0, r2, r1 + b _080E3A36 + .pool +_080E3A28: + movs r0, 0x10 + strh r0, [r4, 0xE] + ldrh r0, [r4, 0x14] + adds r0, 0x1 + b _080E3A3C +_080E3A32: + ldrh r3, [r4, 0xE] + adds r0, r1, r3 +_080E3A36: + strh r0, [r4, 0xE] + ldrh r2, [r4, 0x14] + adds r0, r1, r2 +_080E3A3C: + strh r0, [r4, 0x14] + movs r3, 0xE + ldrsh r0, [r4, r3] + ldrh r1, [r4, 0xE] + cmp r0, 0x10 + bne _080E3A5C + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0x16 + bne _080E3A5C + ldr r0, =0x0000fffc + strh r0, [r4, 0x10] + b _080E3A6E + .pool +_080E3A5C: + lsls r0, r1, 16 + asrs r1, r0, 16 + cmp r1, 0 + bne _080E3A6E + ldrh r0, [r4, 0xA] + strh r0, [r4, 0xC] + movs r0, 0x2 + strh r0, [r4, 0x10] + strh r1, [r4, 0x14] +_080E3A6E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end c3_0809E58C + + thumb_func_start sub_80E3A74 +sub_80E3A74: @ 80E3A74 + push {r4-r6,lr} + sub sp, 0x10 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x4 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 20 + movs r1, 0x87 + lsls r1, 1 + adds r5, r1, 0 + adds r0, r5 + add r6, sp, 0x8 + strh r0, [r6] + movs r0, 0x6 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 20 + adds r0, r5 + mov r1, sp + adds r1, 0xA + strh r0, [r1] + movs r0, 0x7 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 20 + adds r0, r5 + add r1, sp, 0xC + strh r0, [r1] + movs r0, 0x7 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 20 + ldr r1, =0x00000101 + adds r0, r1 + mov r1, sp + adds r1, 0xE + strh r0, [r1] + mov r0, sp + adds r1, r6, 0 + movs r2, 0x8 + bl memcpy + lsls r4, 1 + mov r1, sp + adds r0, r1, r4 + ldrh r0, [r0] + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E3A74 + + thumb_func_start sub_80E3AE8 +sub_80E3AE8: @ 80E3AE8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_80E3A74 + lsls r0, 16 + ldr r2, =0x02037b14 + lsrs r0, 15 + adds r2, r0, r2 + ldr r1, =0x02037714 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E3AE8 + + thumb_func_start sub_80E3B10 +sub_80E3B10: @ 80E3B10 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + movs r3, 0 + strh r1, [r0, 0x8] + strh r2, [r0, 0xA] + movs r1, 0x1 + strh r1, [r0, 0xC] + movs r2, 0x4 + strh r2, [r0, 0xE] + movs r1, 0x2 + strh r1, [r0, 0x10] + strh r3, [r0, 0x12] + strh r2, [r0, 0x14] + bx lr + thumb_func_end sub_80E3B10 + + thumb_func_start sub_80E3B30 +sub_80E3B30: @ 80E3B30 + push {r4-r6,lr} + adds r5, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080E3B48 + adds r0, r5, 0 + movs r1, 0 + bl StartObjectImageAnim +_080E3B48: + ldrh r0, [r5, 0x36] + movs r1, 0xFF + ands r1, r0 + adds r6, r5, 0 + adds r6, 0x3E + movs r0, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r6] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r6] + movs r0, 0x2E + ldrsh r4, [r5, r0] + bl sub_80E3F70 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _080E3B7C + ldrb r0, [r6] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r6] +_080E3B7C: + ldrb r1, [r6] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080E3BAC + movs r1, 0x36 + ldrsh r0, [r5, r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _080E3BAC + movs r2, 0x2E + ldrsh r1, [r5, r2] + movs r2, 0x32 + ldrsh r0, [r5, r2] + cmp r1, r0 + bne _080E3BAC + movs r0, 0x30 + ldrsh r1, [r5, r0] + movs r2, 0x34 + ldrsh r0, [r5, r2] + cmp r1, r0 + beq _080E3BB6 +_080E3BAC: + movs r0, 0 + strh r0, [r5, 0x38] + movs r0, 0x2 + strh r0, [r5, 0x3A] + strh r0, [r5, 0x3C] +_080E3BB6: + ldrh r0, [r5, 0x3C] + subs r0, 0x1 + strh r0, [r5, 0x3C] + lsls r0, 16 + cmp r0, 0 + bne _080E3BDE + ldrh r1, [r5, 0x3A] + ldrh r2, [r5, 0x38] + adds r0, r1, r2 + strh r0, [r5, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + beq _080E3BD6 + cmp r0, 0 + bne _080E3BDA +_080E3BD6: + negs r0, r1 + strh r0, [r5, 0x3A] +_080E3BDA: + movs r0, 0x2 + strh r0, [r5, 0x3C] +_080E3BDE: + movs r1, 0x36 + ldrsh r0, [r5, r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _080E3C14 + ldrh r4, [r5, 0x38] + lsls r5, r4, 24 + lsrs r5, 24 + lsls r4, 16 + asrs r4, 17 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 4 + ldr r2, =0x01010000 + adds r0, r2 + lsrs r0, 16 + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r5, 0 + bl sub_80B609C +_080E3C14: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E3B30 + + thumb_func_start sub_80E3C20 +sub_80E3C20: @ 80E3C20 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, =gUnknown_0858BED4 + mov r0, sp + movs r2, 0x8 + bl memcpy + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080E3C44 + subs r0, r1, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + bne _080E3C52 +_080E3C44: + movs r0, 0x8 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + strh r0, [r4, 0x30] +_080E3C52: + movs r1, 0x30 + ldrsh r0, [r4, r1] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + strh r0, [r4, 0x24] + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E3C20 + + thumb_func_start sub_80E3C6C +sub_80E3C6C: @ 80E3C6C + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, =gUnknown_0858BEDC + mov r0, sp + movs r2, 0x8 + bl memcpy + bl sub_80E4A60 + lsls r0, 24 + ldrh r1, [r4, 0x2E] + lsls r1, 24 + cmp r0, r1 + beq _080E3C98 + movs r0, 0 + strh r0, [r4, 0x26] + strh r0, [r4, 0x30] + b _080E3CBE + .pool +_080E3C98: + movs r1, 0x30 + ldrsh r0, [r4, r1] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _080E3CC0 + ldrh r0, [r4, 0x30] + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + strh r0, [r4, 0x30] + movs r0, 0 +_080E3CBE: + strh r0, [r4, 0x32] +_080E3CC0: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80E3C6C + + thumb_func_start sub_80E3CC8 +sub_80E3CC8: @ 80E3CC8 + push {lr} + bl sub_80E3CE4 + bl sub_80E3F8C + bl sub_80E4218 + bl sub_80E4290 + bl sub_80E4354 + pop {r0} + bx r0 + thumb_func_end sub_80E3CC8 + + thumb_func_start sub_80E3CE4 +sub_80E3CE4: @ 80E3CE4 + push {r4-r6,lr} + ldr r0, =gUnknown_0858C138 + movs r1, 0x26 + movs r2, 0x58 + movs r3, 0x1 + bl AddObjectToFront + ldr r5, =0x02039f94 + ldr r1, [r5] + ldr r4, =0x00001e23 + adds r1, r4 + strb r0, [r1] + movs r0, 0x1 + bl sub_80E3E3C + ldr r6, =0x02020630 + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r3, [r1, 0x5] + movs r2, 0xD + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + movs r3, 0x4 + orrs r0, r3 + strb r0, [r1, 0x5] + ldr r0, [r5] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0, 0x1] + ands r2, r1 + orrs r2, r3 + strb r2, [r0, 0x1] + ldr r2, [r5] + adds r2, r4 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x1 + strh r1, [r0, 0x3A] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x2 + strh r1, [r0, 0x3A] + movs r0, 0 + movs r1, 0 + bl sub_80E3D78 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E3CE4 + + thumb_func_start sub_80E3D78 +sub_80E3D78: @ 80E3D78 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsls r1, 16 + lsrs r7, r1, 16 + ldr r1, =0x02039f94 + ldr r1, [r1] + ldr r2, =0x00001e23 + adds r1, r2 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + ldr r2, =0x02020630 + adds r5, r1, r2 + lsrs r1, r0, 16 + mov r8, r1 + asrs r6, r0, 16 + ldr r4, =gUnknown_0858BEA0 + bl sub_80E3274 + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r0, [r0] + cmp r6, r0 + bge _080E3DD8 + bl sub_80E3274 + ldr r1, =gUnknown_0858BEA3 + lsls r0, 24 + lsrs r0, 21 + adds r0, r6, r0 + adds r0, r1 + ldrb r0, [r0] + adds r0, 0x26 + b _080E3DDA + .pool +_080E3DD8: + movs r0, 0 +_080E3DDA: + strh r0, [r5, 0x20] + lsls r0, r7, 16 + asrs r0, 12 + adds r0, 0x58 + strh r0, [r5, 0x22] + ldrh r0, [r5, 0x2E] + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x30] + strh r0, [r5, 0x34] + mov r2, r8 + strh r2, [r5, 0x2E] + strh r7, [r5, 0x30] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E3D78 + + thumb_func_start sub_80E3DFC +sub_80E3DFC: @ 80E3DFC + ldr r2, =0x02039f94 + ldr r2, [r2] + ldr r3, =0x00001e23 + adds r2, r3 + ldrb r3, [r2] + lsls r2, r3, 4 + adds r2, r3 + lsls r2, 2 + ldr r3, =0x02020630 + adds r2, r3 + ldrh r3, [r2, 0x2E] + strh r3, [r0] + ldrh r0, [r2, 0x30] + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_80E3DFC + + thumb_func_start sub_80E3E28 +sub_80E3E28: @ 80E3E28 + push {lr} + bl sub_80E3F70 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl sub_80E3D78 + pop {r0} + bx r0 + thumb_func_end sub_80E3E28 + + thumb_func_start sub_80E3E3C +sub_80E3E3C: @ 80E3E3C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =0x02020630 + ldr r1, =0x02039f94 + ldr r4, [r1] + ldr r1, =0x00001e23 + adds r4, r1 + ldrb r1, [r4] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r5 + ldrh r3, [r2, 0x36] + ldr r1, =0xffffff00 + ands r1, r3 + strh r1, [r2, 0x36] + ldrb r2, [r4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r5 + ldrh r2, [r1, 0x36] + orrs r0, r2 + strh r0, [r1, 0x36] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0 + bl StartObjectImageAnim + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E3E3C + + thumb_func_start sub_80E3E94 +sub_80E3E94: @ 80E3E94 + push {r4,r5,lr} + lsls r0, 24 + ldr r5, =0x02020630 + ldr r1, =0x02039f94 + ldr r4, [r1] + ldr r1, =0x00001e23 + adds r4, r1 + ldrb r1, [r4] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r5 + ldrh r3, [r2, 0x36] + movs r1, 0xFF + ands r1, r3 + strh r1, [r2, 0x36] + ldrb r2, [r4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r5 + lsrs r0, 16 + ldrh r2, [r1, 0x36] + orrs r0, r2 + strh r0, [r1, 0x36] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E3E94 + + thumb_func_start sub_80E3ED8 +sub_80E3ED8: @ 80E3ED8 + push {lr} + ldr r0, =0x02039f94 + ldr r0, [r0] + ldr r1, =0x00001e23 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0x1 + bl StartObjectImageAnim + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E3ED8 + + thumb_func_start sub_80E3F04 +sub_80E3F04: @ 80E3F04 + ldr r2, =0x02020630 + ldr r0, =0x02039f94 + ldr r0, [r0] + ldr r1, =0x00001e23 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 31 + bx lr + .pool + thumb_func_end sub_80E3F04 + + thumb_func_start sub_80E3F30 +sub_80E3F30: @ 80E3F30 + push {r4,r5,lr} + sub sp, 0x4 + mov r5, sp + adds r5, 0x2 + mov r0, sp + adds r1, r5, 0 + bl sub_80E3DFC + mov r0, sp + movs r1, 0 + ldrsh r4, [r0, r1] + bl sub_80E3F70 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + blt _080E3F64 + ldr r0, =gUnknown_0858BEE4 + movs r2, 0 + ldrsh r1, [r5, r2] + adds r1, r0 + ldrb r0, [r1] + b _080E3F66 + .pool +_080E3F64: + movs r0, 0 +_080E3F66: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80E3F30 + + thumb_func_start sub_80E3F70 +sub_80E3F70: @ 80E3F70 + push {r4,lr} + ldr r4, =gUnknown_0858BEA0 + bl sub_80E3274 + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r0, [r0] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E3F70 + + thumb_func_start sub_80E3F8C +sub_80E3F8C: @ 80E3F8C + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =gUnknown_0858C0C0 + movs r1, 0xCC + movs r2, 0x58 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02039f94 + ldr r1, [r1] + ldr r2, =0x00001e24 + adds r1, r2 + strb r0, [r1] + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + ldr r0, =0x02020630 + mov r8, r0 + add r5, r8 + ldr r1, =gUnknown_0858C050 + adds r0, r5, 0 + bl SetSpriteOamTables_NoPriorityFromTable + adds r1, r5, 0 + adds r1, 0x3E + ldrb r0, [r1] + movs r6, 0x4 + orrs r0, r6 + strb r0, [r1] + ldr r0, =gUnknown_0858C0F0 + movs r1, 0xCC + movs r2, 0x54 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x3A] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + add r4, r8 + ldr r1, =gUnknown_0858C058 + adds r0, r4, 0 + bl SetSpriteOamTables_NoPriorityFromTable + adds r4, 0x3E + ldrb r0, [r4] + orrs r0, r6 + strb r0, [r4] + ldr r0, =gUnknown_0858C0D8 + movs r1, 0xCC + movs r2, 0x53 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r8 + ldrb r3, [r2, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r3 + orrs r1, r6 + strb r1, [r2, 0x5] + strh r0, [r5, 0x3C] + adds r2, 0x3E + ldrb r0, [r2] + orrs r0, r6 + strb r0, [r2] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E3F8C + + thumb_func_start sub_80E4050 +sub_80E4050: @ 80E4050 + ldr r0, =0x02039f94 + ldr r2, [r0] + ldr r1, =0x00001e24 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0x2 + strh r1, [r0, 0x2E] + ldr r1, =0x00001e22 + adds r2, r1 + ldrb r1, [r2] + strh r1, [r0, 0x30] + bx lr + .pool + thumb_func_end sub_80E4050 + + thumb_func_start sub_80E4084 +sub_80E4084: @ 80E4084 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =gUnknown_0858BEE8 +_080E408A: + movs r1, 0x2E + 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 _080E408A + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E4084 + + thumb_func_start sub_80E40AC +sub_80E40AC: @ 80E40AC + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x3A + ldrsh r0, [r6, r1] + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + ldr r1, =0x02020630 + adds r5, r1 + movs r2, 0x3C + ldrsh r0, [r6, r2] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r4, r1 + ldr r0, =0x02039f94 + ldr r0, [r0] + ldr r1, =0x00001e22 + adds r0, r1 + ldrb r0, [r0] + bl sub_80E3244 + lsls r0, 24 + lsrs r0, 24 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_80E41B8 + ldrh r0, [r6, 0x2E] + adds r0, 0x1 + strh r0, [r6, 0x2E] + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E40AC + + thumb_func_start sub_80E4100 +sub_80E4100: @ 80E4100 + movs r0, 0 + bx lr + thumb_func_end sub_80E4100 + + thumb_func_start sub_80E4104 +sub_80E4104: @ 80E4104 + push {r4,r5,lr} + adds r3, r0, 0 + movs r0, 0x3A + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r2, =0x02020630 + adds r4, r0, r2 + movs r0, 0x3C + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r5, r0, r2 + ldrh r0, [r4, 0x26] + adds r0, 0x1 + strh r0, [r4, 0x26] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _080E4168 + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + ldr r0, =0x0000fffc + strh r0, [r4, 0x26] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r3, 0x30] + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1 + movs r1, 0x3 + bl __modsi3 + lsls r0, 24 + lsrs r0, 24 + bl sub_80E3244 + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_80E41B8 +_080E4168: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E4104 + + thumb_func_start sub_80E4178 +sub_80E4178: @ 80E4178 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x3A + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r2, r0, r1 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + ldrh r0, [r2, 0x26] + adds r0, 0x1 + strh r0, [r2, 0x26] + lsls r0, 16 + cmp r0, 0 + blt _080E41AC + movs r0, 0 + strh r0, [r2, 0x26] + movs r0, 0x1 + strh r0, [r4, 0x2E] +_080E41AC: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E4178 + + thumb_func_start sub_80E41B8 +sub_80E41B8: @ 80E41B8 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r5, r0, 0 + adds r6, r1, 0 + mov r8, r2 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0858BEF8 + lsls r4, r5, 1 + adds r0, r4, r0 + ldrh r0, [r0] + bl IndexOfObjectPaletteTag + lsls r0, 4 + mov r1, r8 + ldrb r2, [r1, 0x5] + movs r1, 0xF + ands r1, r2 + orrs r1, r0 + mov r0, r8 + strb r1, [r0, 0x5] + ldr r0, =gUnknown_0858BEFE + adds r4, r0 + ldrh r0, [r4] + bl GetObjectTileRangeStartByTag + adds r1, r6, 0 + adds r1, 0x40 + strh r0, [r1] + adds r6, 0x42 + movs r1, 0x3F + ands r1, r5 + ldrb r2, [r6] + movs r0, 0x40 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r6] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E41B8 + + thumb_func_start sub_80E4218 +sub_80E4218: @ 80E4218 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =gUnknown_0858C108 + movs r1, 0xCC + movs r2, 0x74 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r6, =0x02020630 + adds r4, r6 + ldr r0, =gUnknown_0858C070 + mov r8, r0 + adds r0, r4, 0 + mov r1, r8 + bl SetSpriteOamTables_NoPriorityFromTable + adds r4, 0x3E + ldrb r0, [r4] + movs r5, 0x4 + orrs r0, r5 + strb r0, [r4] + ldr r0, =gUnknown_0858C120 + movs r1, 0xCC + movs r2, 0x8C + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r4, r6 + adds r0, r4, 0 + mov r1, r8 + bl SetSpriteOamTables_NoPriorityFromTable + adds r4, 0x3E + ldrb r0, [r4] + orrs r0, r5 + strb r0, [r4] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E4218 + + thumb_func_start sub_80E4290 +sub_80E4290: @ 80E4290 + push {r4-r6,lr} + ldr r5, =0x02039f94 + ldr r0, [r5] + ldr r4, =0x00001e16 + adds r0, r4 + ldrh r1, [r0] + subs r1, 0x5 + ldr r0, =gUnknown_0858C150 + lsls r1, 16 + asrs r1, 16 + movs r2, 0x38 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + ldr r3, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0, 0x5] + movs r2, 0xC + orrs r1, r2 + strb r1, [r0, 0x5] + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r5] + adds r4, r0, r4 + ldrh r1, [r4] + movs r5, 0 + ldr r2, =0x00001e28 + adds r0, r2 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r5, r0 + bcs _080E4334 + adds r6, r3, 0 +_080E42E2: + lsls r1, 16 + asrs r4, r1, 16 + movs r0, 0xC0 + lsls r0, 10 + adds r1, r0 + asrs r1, 16 + ldr r0, =gUnknown_0858C168 + movs r2, 0x3C + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0, 0x5] + movs r2, 0xC + orrs r1, r2 + strb r1, [r0, 0x5] + strh r5, [r0, 0x2E] + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x8 + lsls r4, 16 + lsrs r1, r4, 16 + ldr r0, =0x02039f94 + ldr r0, [r0] + ldr r2, =0x00001e28 + adds r0, r2 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r5, r0 + bcc _080E42E2 +_080E4334: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E4290 + + thumb_func_start sub_80E4354 +sub_80E4354: @ 80E4354 + push {lr} + ldr r1, =gUnknown_0858BF04 + ldr r0, =0x02039f94 + ldr r0, [r0] + ldr r2, =0x00001e28 + adds r0, r2 + ldr r0, [r0] + ldrb r0, [r0, 0x2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E4354 + + thumb_func_start TaskDummy2 +TaskDummy2: @ 80E4380 + bx lr + thumb_func_end TaskDummy2 + + thumb_func_start sub_80E4384 +sub_80E4384: @ 80E4384 + push {lr} + sub sp, 0x4 + ldr r0, =0x02039f94 + ldr r0, [r0] + ldr r1, =0x00001e34 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0 + bl sub_808BD3C + lsls r0, 24 + lsrs r0, 24 + ldr r1, =DummyObjectCallback + movs r2, 0 + str r2, [sp] + movs r2, 0x38 + movs r3, 0x25 + bl AddPseudoFieldObject + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x5] + movs r2, 0xC + orrs r1, r2 + strb r1, [r0, 0x5] + movs r1, 0x4 + bl StartObjectImageAnim + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E4384 + + thumb_func_start sub_80E43E0 +sub_80E43E0: @ 80E43E0 + push {r4,lr} + ldr r0, =gUnknown_0858C180 + movs r1, 0x38 + movs r2, 0x29 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + ldr r1, =gUnknown_0858C078 + adds r0, r4, 0 + bl SetSpriteOamTables_NoPriorityFromTable + ldrb r0, [r4, 0x5] + movs r1, 0xC + orrs r0, r1 + strb r0, [r4, 0x5] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E43E0 + + thumb_func_start sub_80E4420 +sub_80E4420: @ 80E4420 + push {lr} + sub sp, 0xC + bl sub_80D2F04 + ldr r0, =0x02039f94 + ldr r3, [r0] + ldr r1, =0x00001e34 + adds r0, r3, r1 + ldrh r0, [r0] + ldr r1, =DummyObjectCallback + movs r2, 0 + str r2, [sp] + ldr r2, =0x00001e38 + adds r3, r2 + ldr r2, [r3] + str r2, [sp, 0x4] + movs r2, 0x1 + str r2, [sp, 0x8] + movs r2, 0x38 + movs r3, 0x28 + bl sub_80D2CC4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x5] + movs r2, 0xC + orrs r0, r2 + strb r0, [r1, 0x5] + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E4420 + + thumb_func_start sub_80E447C +sub_80E447C: @ 80E447C + push {lr} + sub sp, 0x4 + ldr r1, =DummyObjectCallback + movs r0, 0 + str r0, [sp] + movs r0, 0x13 + movs r2, 0x38 + movs r3, 0x25 + bl AddPseudoFieldObject + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x5] + movs r2, 0xC + orrs r1, r2 + strb r1, [r0, 0x5] + movs r1, 0x4 + bl StartObjectImageAnim + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E447C + + thumb_func_start sub_80E44BC +sub_80E44BC: @ 80E44BC + push {r4,r5,lr} + bl sub_80E460C + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl sub_80E3F30 + lsls r0, 24 + lsrs r0, 24 + cmp r4, 0x8 + bne _080E44DA + bl sub_80E45E0 + b _080E44F6 +_080E44DA: + cmp r4, 0x6 + bne _080E44E4 + bl sub_80E4AF8 + b _080E4504 +_080E44E4: + cmp r5, 0x9 + beq _080E4500 + ldr r1, =gUnknown_0858BF18 + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r5, 0 + bl _call_via_r1 +_080E44F6: + lsls r0, 24 + lsrs r0, 24 + b _080E4506 + .pool +_080E4500: + bl sub_80E3E28 +_080E4504: + movs r0, 0 +_080E4506: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80E44BC + + thumb_func_start sub_80E450C +sub_80E450C: @ 80E450C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl sub_80E3948 + cmp r4, 0x5 + bne _080E4546 + bl sub_80E4B54 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_80E3ED8 + cmp r4, 0 + beq _080E4546 + movs r0, 0x2 + bl sub_80E4630 + ldr r0, =0x02039f94 + ldr r0, [r0] + ldr r1, =0x00001e10 + adds r0, r1 + movs r1, 0x3 + strb r1, [r0] +_080E4546: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E450C + + thumb_func_start sub_80E4558 +sub_80E4558: @ 80E4558 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + bl sub_80E3948 + cmp r4, 0x5 + beq _080E4572 + movs r0, 0 + b _080E457A +_080E4572: + bl sub_80E45E0 + lsls r0, 24 + lsrs r0, 24 +_080E457A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80E4558 + + thumb_func_start sub_80E4580 +sub_80E4580: @ 80E4580 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl sub_80E3948 + cmp r4, 0x5 + bne _080E459A + bl sub_80E4AF8 +_080E459A: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80E4580 + + thumb_func_start sub_80E45A4 +sub_80E45A4: @ 80E45A4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + bl sub_80E3948 + cmp r4, 0x5 + beq _080E45BE + movs r0, 0 + b _080E45D2 +_080E45BE: + movs r0, 0x5 + bl audio_play + ldr r0, =0x02039f94 + ldr r0, [r0] + ldr r1, =0x00001e10 + adds r0, r1 + movs r1, 0x6 + strb r1, [r0] + movs r0, 0x1 +_080E45D2: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E45A4 + + thumb_func_start sub_80E45E0 +sub_80E45E0: @ 80E45E0 + ldr r0, =0x02039f94 + ldr r0, [r0] + ldr r1, =0x00001e10 + adds r0, r1 + movs r1, 0x4 + strb r1, [r0] + movs r0, 0x1 + bx lr + .pool + thumb_func_end sub_80E45E0 + + thumb_func_start sub_80E45F8 +sub_80E45F8: @ 80E45F8 + push {lr} + ldr r0, =sub_80E465C + movs r1, 0x1 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E45F8 + + thumb_func_start sub_80E460C +sub_80E460C: @ 80E460C + push {lr} + ldr r0, =sub_80E465C + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0xA] + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E460C + + thumb_func_start sub_80E4630 +sub_80E4630: @ 80E4630 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =sub_80E465C + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E4630 + + thumb_func_start sub_80E465C +sub_80E465C: @ 80E465C + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_0858BF28 + ldr r2, =0x03005e00 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E465C + + thumb_func_start sub_80E468C +sub_80E468C: @ 80E468C + movs r1, 0 + strh r1, [r0, 0xA] + bx lr + thumb_func_end sub_80E468C + + thumb_func_start sub_80E4692 +sub_80E4692: @ 80E4692 + push {lr} + adds r2, r0, 0 + movs r0, 0 + strh r0, [r2, 0xA] + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080E46B4 + movs r0, 0x5 + strh r0, [r2, 0xA] + b _080E46E4 + .pool +_080E46B4: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080E46C2 + movs r0, 0x6 + strh r0, [r2, 0xA] + b _080E46E4 +_080E46C2: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080E46D0 + movs r0, 0x8 + strh r0, [r2, 0xA] + b _080E46E4 +_080E46D0: + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080E46DE + movs r0, 0x9 + strh r0, [r2, 0xA] + b _080E46E4 +_080E46DE: + adds r0, r2, 0 + bl sub_80E46F0 +_080E46E4: + pop {r0} + bx r0 + thumb_func_end sub_80E4692 + + thumb_func_start sub_80E46E8 +sub_80E46E8: @ 80E46E8 + movs r1, 0 + strh r1, [r0, 0xA] + bx lr + thumb_func_end sub_80E46E8 + + thumb_func_start sub_80E46F0 +sub_80E46F0: @ 80E46F0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + mov r9, r0 + ldr r1, =gUnknown_0858BF34 + mov r0, sp + movs r2, 0xA + bl memcpy + add r0, sp, 0xC + mov r10, r0 + ldr r1, =gUnknown_0858BF3E + movs r2, 0xA + bl memcpy + mov r1, sp + adds r1, 0x18 + str r1, [sp, 0x2C] + ldr r1, =gUnknown_0858BF48 + ldr r0, [sp, 0x2C] + movs r2, 0x8 + bl memcpy + mov r2, sp + adds r2, 0x20 + str r2, [sp, 0x30] + ldr r1, =gUnknown_0858BF50 + adds r0, r2, 0 + movs r2, 0x6 + bl memcpy + add r4, sp, 0x28 + mov r5, sp + adds r5, 0x2A + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80E3DFC + ldr r0, =0x030022c0 + ldrh r2, [r0, 0x30] + movs r0, 0x40 + ands r0, r2 + lsls r0, 16 + lsrs r0, 16 + negs r0, r0 + lsrs r1, r0, 31 + movs r0, 0x80 + ands r0, r2 + adds r6, r4, 0 + cmp r0, 0 + beq _080E475E + movs r1, 0x2 +_080E475E: + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + beq _080E4768 + movs r1, 0x3 +_080E4768: + movs r0, 0x10 + ands r0, r2 + cmp r0, 0 + beq _080E4772 + movs r1, 0x4 +_080E4772: + ldrh r0, [r6] + mov r8, r0 + lsls r1, 1 + mov r2, sp + adds r7, r2, r1 + ldrh r0, [r7] + add r0, r8 + strh r0, [r6] + add r1, r10 + ldrh r0, [r1] + ldrh r1, [r5] + adds r0, r1 + strh r0, [r5] + movs r2, 0 + ldrsh r0, [r6, r2] + cmp r0, 0 + bge _080E479E + bl sub_80E3F70 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6] +_080E479E: + movs r0, 0 + ldrsh r4, [r6, r0] + bl sub_80E3F70 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + ble _080E47B2 + movs r0, 0 + strh r0, [r6] +_080E47B2: + movs r1, 0 + ldrsh r0, [r7, r1] + cmp r0, 0 + beq _080E481E + movs r2, 0 + ldrsh r4, [r6, r2] + bl sub_80E3F70 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _080E47F0 + ldrh r0, [r5] + mov r1, r9 + strh r0, [r1, 0xC] + movs r2, 0 + ldrsh r0, [r5, r2] + lsls r0, 1 + ldr r1, [sp, 0x2C] + adds r0, r1, r0 + b _080E481A + .pool +_080E47F0: + mov r2, r8 + lsls r4, r2, 16 + asrs r4, 16 + bl sub_80E3F70 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _080E481E + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _080E4810 + mov r2, r9 + ldrh r0, [r2, 0xC] + b _080E481C +_080E4810: + movs r1, 0 + ldrsh r0, [r5, r1] + lsls r0, 1 + ldr r2, [sp, 0x30] + adds r0, r2, r0 +_080E481A: + ldrh r0, [r0] +_080E481C: + strh r0, [r5] +_080E481E: + movs r0, 0 + ldrsh r4, [r6, r0] + bl sub_80E3F70 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _080E4860 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0 + bge _080E483A + movs r0, 0x2 + strh r0, [r5] +_080E483A: + movs r2, 0 + ldrsh r0, [r5, r2] + cmp r0, 0x2 + ble _080E4846 + movs r0, 0 + strh r0, [r5] +_080E4846: + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _080E4856 + movs r0, 0x1 + mov r2, r9 + strh r0, [r2, 0xC] + b _080E4878 +_080E4856: + cmp r0, 0x2 + bne _080E4878 + mov r1, r9 + strh r0, [r1, 0xC] + b _080E4878 +_080E4860: + movs r2, 0 + ldrsh r0, [r5, r2] + cmp r0, 0 + bge _080E486C + movs r0, 0x3 + strh r0, [r5] +_080E486C: + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x3 + ble _080E4878 + movs r0, 0 + strh r0, [r5] +_080E4878: + movs r2, 0 + ldrsh r0, [r6, r2] + movs r2, 0 + ldrsh r1, [r5, r2] + bl sub_80E3D78 + 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_80E46F0 + + thumb_func_start sub_80E4894 +sub_80E4894: @ 80E4894 + push {r4,r5,lr} + sub sp, 0xC + ldr r5, =0x02039f94 + ldr r0, [r5] + ldr r4, =0x00001e14 + adds r0, r4 + ldrb r0, [r0] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r1, [r5] + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, =0x00001e28 + adds r1, r2 + ldr r1, [r1] + ldr r2, [r1, 0x8] + movs r1, 0x1 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + bl PutWindowTilemap + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E4894 + + thumb_func_start sub_80E48E8 +sub_80E48E8: @ 80E48E8 + push {r4,r5,lr} + sub sp, 0x2C + ldr r5, =0x02039f94 + ldr r0, [r5] + ldr r1, =0x00001e34 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + add r0, sp, 0xC + bl CopyString + ldr r0, [r5] + ldr r1, =0x00001e28 + adds r0, r1 + ldr r0, [r0] + ldr r1, [r0, 0x8] + add r0, sp, 0xC + movs r2, 0xF + bl AppendString_LimitN + ldr r0, [r5] + ldr r4, =0x00001e14 + adds r0, r4 + ldrb r0, [r0] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + movs r1, 0x1 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + add r2, sp, 0xC + movs r3, 0x8 + bl Print + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + bl PutWindowTilemap + add sp, 0x2C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E48E8 + + thumb_func_start sub_80E4964 +sub_80E4964: @ 80E4964 + push {lr} + ldr r1, =gUnknown_0858BF58 + ldr r0, =0x02039f94 + ldr r0, [r0] + ldr r2, =0x00001e2c + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E4964 + + thumb_func_start sub_80E498C +sub_80E498C: @ 80E498C + push {lr} + ldr r1, =gUnknown_0858BF6C + ldr r0, =0x02039f94 + ldr r0, [r0] + ldr r2, =0x00001e28 + adds r0, r2 + ldr r0, [r0] + ldrb r0, [r0, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E498C + + thumb_func_start TaskDummy3 +TaskDummy3: @ 80E49B8 + bx lr + thumb_func_end TaskDummy3 + + thumb_func_start sub_80E49BC +sub_80E49BC: @ 80E49BC + push {r4,r5,lr} + sub sp, 0x10 + movs r4, 0 + ldr r1, =gUnknown_085E8D49 + add r0, sp, 0xC + bl CopyString + ldr r5, =0x02039f94 + ldr r0, [r5] + ldr r1, =0x00001e36 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0xFF + beq _080E4A0C + cmp r0, 0xFE + bne _080E49E6 + ldr r1, =gUnknown_085E8D4B + add r0, sp, 0xC + bl CopyString + movs r4, 0x1 +_080E49E6: + ldr r0, [r5] + ldr r1, =0x00001e13 + adds r0, r1 + ldrb r0, [r0] + lsls r1, r4, 1 + adds r1, r4 + ldr r2, =gUnknown_0858BF74 + adds r1, r2 + str r1, [sp] + movs r1, 0x1 + negs r1, r1 + str r1, [sp, 0x4] + add r1, sp, 0xC + str r1, [sp, 0x8] + movs r1, 0x1 + movs r2, 0x68 + movs r3, 0x1 + bl box_print +_080E4A0C: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E49BC + + thumb_func_start sub_80E4A2C +sub_80E4A2C: @ 80E4A2C + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + ldr r6, =gUnknown_0858BE40 + bl sub_80E3274 + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 13 + adds r4, r5 + lsls r0, 24 + lsrs r0, 19 + adds r4, r0 + adds r4, r6 + ldrb r0, [r4] + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E4A2C + + thumb_func_start sub_80E4A60 +sub_80E4A60: @ 80E4A60 + push {r4,r5,lr} + movs r2, 0 + ldr r0, =0x02039f94 + ldr r4, [r0] + ldr r3, =0x00001e28 + adds r1, r4, r3 + ldr r1, [r1] + ldrb r3, [r1, 0x1] + adds r5, r0, 0 + cmp r2, r3 + bcs _080E4A9A + movs r0, 0xC0 + lsls r0, 5 + adds r1, r4, r0 +_080E4A7C: + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080E4A90 + adds r0, r2, 0 + b _080E4AAA + .pool +_080E4A90: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r3 + bcc _080E4A7C +_080E4A9A: + ldr r0, [r5] + ldr r1, =0x00001e28 + adds r0, r1 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 +_080E4AAA: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E4A60 + + thumb_func_start sub_80E4AB4 +sub_80E4AB4: @ 80E4AB4 + push {lr} + ldr r0, =0x02039f94 + ldr r2, [r0] + ldr r1, =0x00001e28 + adds r0, r2, r1 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + subs r0, 0x1 + lsls r1, r0, 24 + cmp r1, 0 + ble _080E4AF0 + movs r0, 0xC0 + lsls r0, 5 + adds r3, r2, r0 +_080E4AD0: + asrs r2, r1, 24 + adds r0, r3, r2 + ldrb r0, [r0] + cmp r0, 0xFF + beq _080E4AE8 + lsrs r0, r1, 24 + b _080E4AF2 + .pool +_080E4AE8: + subs r0, r2, 0x1 + lsls r1, r0, 24 + cmp r1, 0 + bgt _080E4AD0 +_080E4AF0: + movs r0, 0 +_080E4AF2: + pop {r1} + bx r1 + thumb_func_end sub_80E4AB4 + + thumb_func_start sub_80E4AF8 +sub_80E4AF8: @ 80E4AF8 + push {r4-r6,lr} + bl sub_80E4AB4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r6, =0x02039f94 + ldr r0, [r6] + movs r5, 0xC0 + lsls r5, 5 + adds r0, r5 + adds r0, r4 + movs r1, 0 + strb r1, [r0] + bl sub_80E4D10 + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + movs r1, 0xFF + strb r1, [r0] + bl sub_80E3F30 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080E4B38 + cmp r0, 0x2 + bne _080E4B42 +_080E4B38: + movs r0, 0x1 + movs r1, 0 + movs r2, 0x1 + bl sub_80E3948 +_080E4B42: + movs r0, 0x17 + bl audio_play + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E4AF8 + + thumb_func_start sub_80E4B54 +sub_80E4B54: @ 80E4B54 + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl sub_80E3DFC + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl sub_80E4A2C + lsls r0, 24 + lsrs r0, 24 + bl sub_80E4BBC + bl sub_80E4D10 + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + movs r0, 0x5 + bl audio_play + bl sub_80E4AB4 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02039f94 + ldr r1, [r1] + ldr r2, =0x00001e28 + adds r1, r2 + ldr r1, [r1] + ldrb r1, [r1, 0x1] + subs r1, 0x1 + cmp r0, r1 + bne _080E4BB0 + movs r0, 0x1 + b _080E4BB2 + .pool +_080E4BB0: + movs r0, 0 +_080E4BB2: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80E4B54 + + thumb_func_start sub_80E4BBC +sub_80E4BBC: @ 80E4BBC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_80E4A60 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02039f94 + ldr r1, [r1] + movs r2, 0xC0 + lsls r2, 5 + adds r1, r2 + adds r1, r0 + strb r4, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E4BBC + + thumb_func_start sub_80E4BE4 +sub_80E4BE4: @ 80E4BE4 + push {r4,r5,lr} + movs r2, 0 + ldr r1, =0x02039f94 + ldr r0, [r1] + ldr r4, =0x00001e28 + adds r0, r4 + ldr r0, [r0] + adds r5, r1, 0 + b _080E4C44 + .pool +_080E4C00: + ldr r1, [r1] + movs r0, 0xC0 + lsls r0, 5 + adds r3, r1, r0 + adds r0, r3, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080E4C34 + cmp r0, 0xFF + beq _080E4C34 + ldr r2, =0x00001e30 + adds r0, r1, r2 + ldr r0, [r0] + adds r1, r4 + ldr r1, [r1] + ldrb r2, [r1, 0x1] + adds r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r1, r3, 0 + bl CopyString_LimitN + b _080E4C4A + .pool +_080E4C34: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r1, r5, 0 + ldr r0, [r1] + ldr r4, =0x00001e28 + adds r0, r4 + ldr r0, [r0] +_080E4C44: + ldrb r0, [r0, 0x1] + cmp r2, r0 + bcc _080E4C00 +_080E4C4A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E4BE4 + + thumb_func_start choose_name_or_words_screen_load_bg_tile_patterns +choose_name_or_words_screen_load_bg_tile_patterns: @ 80E4C54 + push {r4-r6,lr} + ldr r0, =gUnknown_08DD3838 + ldr r6, =0x02039f94 + ldr r1, [r6] + ldr r4, =0x00001810 + adds r1, r4 + bl LZ77UnCompWram + ldr r1, [r6] + adds r1, r4 + movs r5, 0xC0 + lsls r5, 3 + movs r0, 0x1 + adds r2, r5, 0 + movs r3, 0 + bl LoadBgTiles + ldr r1, [r6] + adds r1, r4 + movs r0, 0x2 + adds r2, r5, 0 + movs r3, 0 + bl LoadBgTiles + ldr r1, [r6] + adds r1, r4 + movs r0, 0x3 + adds r2, r5, 0 + movs r3, 0 + bl LoadBgTiles + ldr r0, =gUnknown_0858C1C8 + bl LoadObjectPics + ldr r0, =gUnknown_0858C230 + bl LoadTaggedObjectPalettes + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end choose_name_or_words_screen_load_bg_tile_patterns + + thumb_func_start sub_80E4CB8 +sub_80E4CB8: @ 80E4CB8 + push {lr} + bl sub_80E45F8 + bl sub_80E3920 + pop {r0} + bx r0 + thumb_func_end sub_80E4CB8 + + thumb_func_start choose_name_or_words_screen_apply_bg_pals +choose_name_or_words_screen_apply_bg_pals: @ 80E4CC8 + push {lr} + ldr r0, =gUnknown_08DD3778 + movs r1, 0 + movs r2, 0xC0 + bl gpu_pal_apply + ldr r0, =gUnknown_0858BD78 + movs r1, 0xA0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0x2 + bl stdpal_get + movs r1, 0xB0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r0} + bx r0 + .pool + thumb_func_end choose_name_or_words_screen_apply_bg_pals + + thumb_func_start sub_80E4CF8 +sub_80E4CF8: @ 80E4CF8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + pop {r0} + bx r0 + thumb_func_end sub_80E4CF8 + + thumb_func_start nullsub_10 +nullsub_10: @ 80E4D0C + bx lr + thumb_func_end nullsub_10 + + thumb_func_start sub_80E4D10 +sub_80E4D10: @ 80E4D10 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + ldr r7, =0x02039f94 + ldr r1, [r7] + ldr r2, =0x00001e28 + adds r0, r1, r2 + ldr r0, [r0] + ldrb r6, [r0, 0x1] + subs r2, 0x12 + adds r0, r1, r2 + ldrh r0, [r0] + subs r0, 0x40 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + ldr r0, =0x00001e13 + adds r1, r0 + ldrb r0, [r1] + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r4, 0 + cmp r4, r6 + bcs _080E4DA6 + add r5, sp, 0xC + mov r10, r4 + ldr r0, =gUnknown_085E8218 + ldrb r0, [r0] + mov r8, r0 +_080E4D52: + ldr r0, [r7] + movs r1, 0xC0 + lsls r1, 5 + adds r0, r1 + adds r0, r4 + ldrb r0, [r0] + strb r0, [r5] + mov r2, r8 + strb r2, [r5, 0x1] + ldrb r0, [r5] + bl sub_80E503C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + cmp r0, 0x1 + bne _080E4D76 + movs r1, 0x2 +_080E4D76: + ldr r0, [r7] + ldr r2, =0x00001e13 + adds r0, r2 + ldrb r0, [r0] + lsls r3, r4, 3 + add r3, r9 + adds r3, r1 + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + movs r1, 0x1 + add r2, sp, 0xC + bl Print + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r6 + bcc _080E4D52 +_080E4DA6: + bl sub_80E498C + ldr r5, =0x02039f94 + ldr r0, [r5] + ldr r4, =0x00001e13 + adds r0, r4 + ldrb r0, [r0] + movs r1, 0x2 + bl CopyWindowToVram + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + bl PutWindowTilemap + 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_80E4D10 + + thumb_func_start sub_80E4DE4 +sub_80E4DE4: @ 80E4DE4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, =gUnknown_0858BF88 + adds r0, r5, r0 + ldrb r1, [r0] + adds r0, r6, 0 + bl FillWindowPixelBuffer + movs r4, 0 + ldr r1, =gUnknown_0858BF8C + lsls r0, r5, 2 + adds r0, r1 + ldr r7, [r0] + ldr r0, =gUnknown_0858C198 + mov r8, r0 +_080E4E0E: + lsls r3, r4, 4 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + str r7, [sp] + movs r0, 0 + str r0, [sp, 0x4] + lsls r0, r4, 2 + lsls r1, r5, 4 + adds r0, r1 + add r0, r8 + ldr r0, [r0] + str r0, [sp, 0x8] + adds r0, r6, 0 + movs r1, 0x1 + movs r2, 0 + bl box_print + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _080E4E0E + adds r0, r6, 0 + bl PutWindowTilemap + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E4DE4 + + thumb_func_start sub_80E4E5C +sub_80E4E5C: @ 80E4E5C + push {r4-r6,lr} + movs r0, 0xA + bl GetGpuReg + adds r4, r0, 0 + movs r5, 0x3 + ands r4, r5 + movs r0, 0xC + bl GetGpuReg + ands r0, r5 + cmp r4, r0 + bls _080E4E8C + movs r5, 0x1 + movs r6, 0x1 + ldr r1, =0x02039f94 + ldr r0, [r1] + ldr r2, =0x00001e11 + b _080E4E96 + .pool +_080E4E8C: + movs r5, 0x2 + movs r6, 0x2 + ldr r1, =0x02039f94 + ldr r0, [r1] + ldr r2, =0x00001e12 +_080E4E96: + adds r0, r2 + ldrb r4, [r0] + adds r0, r1, 0 + ldr r1, =gUnknown_0858BF98 + ldr r0, [r0] + ldr r2, =0x00001e22 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80E4CF8 + bl sub_80E3254 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80E4DE4 + bl sub_80E3254 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl nullsub_10 + adds r0, r6, 0 + bl CopyBgTilemapBufferToVram + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E4E5C + + thumb_func_start sub_80E4EF0 +sub_80E4EF0: @ 80E4EF0 + push {r4,r5,lr} + sub sp, 0x10 + ldr r1, =gUnknown_0858BFA4 + add r0, sp, 0xC + movs r2, 0x3 + bl memcpy + ldr r5, =0x02039f94 + ldr r0, [r5] + ldr r4, =0x00001e15 + adds r0, r4 + ldrb r0, [r0] + movs r1, 0xFF + bl FillWindowPixelBuffer + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + add r1, sp, 0xC + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + ldr r1, =gUnknown_085EEAF6 + str r1, [sp, 0x8] + movs r1, 0 + movs r2, 0x2 + movs r3, 0x1 + bl box_print + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + bl PutWindowTilemap + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E4EF0 + + thumb_func_start sub_80E4F58 +sub_80E4F58: @ 80E4F58 + push {lr} + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_80E4F58 + + thumb_func_start sub_80E4F70 +sub_80E4F70: @ 80E4F70 + push {lr} + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl SetHBlankCallback + pop {r0} + bx r0 + thumb_func_end sub_80E4F70 + + thumb_func_start sub_80E4F84 +sub_80E4F84: @ 80E4F84 + push {lr} + ldr r0, =sub_80E4F94 + bl SetVBlankCallback + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E4F84 + + thumb_func_start sub_80E4F94 +sub_80E4F94: @ 80E4F94 + push {r4,r5,lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + ldr r5, =0x02039f94 + ldr r0, [r5] + ldr r1, =0x00001e18 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x16 + bl SetGpuReg + ldr r0, [r5] + ldr r1, =0x00001e1a + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x1A + bl SetGpuReg + movs r0, 0xA + bl GetGpuReg + ldr r4, =0x0000fffc + adds r1, r4, 0 + ands r1, r0 + movs r0, 0xA + bl SetGpuReg + ldr r0, [r5] + ldr r1, =0x00001e1c + adds r0, r1 + ldrh r1, [r0] + movs r0, 0xA + bl SetGpuRegBits + movs r0, 0xC + bl GetGpuReg + ands r4, r0 + movs r0, 0xC + adds r1, r4, 0 + bl SetGpuReg + ldr r0, [r5] + ldr r1, =0x00001e1e + adds r0, r1 + ldrh r1, [r0] + movs r0, 0xC + bl SetGpuRegBits + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E4F94 + + thumb_func_start sub_80E501C +sub_80E501C: @ 80E501C + push {lr} + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + pop {r0} + bx r0 + thumb_func_end sub_80E501C + + thumb_func_start sub_80E503C +sub_80E503C: @ 80E503C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r2, 0 + ldr r0, =gUnknown_0858BDC8 + ldrb r1, [r0] + adds r3, r0, 0 + cmp r1, 0xFF + beq _080E5066 + adds r1, r3, 0 +_080E5050: + adds r0, r2, r1 + ldrb r0, [r0] + cmp r4, r0 + beq _080E5066 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080E5050 +_080E5066: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E503C + + thumb_func_start sub_80E5074 +sub_80E5074: @ 80E5074 + push {lr} + sub sp, 0x8 + ldr r0, =0x03005d90 + ldr r1, [r0] + ldrb r2, [r1, 0x8] + movs r0, 0 + str r0, [sp] + ldr r0, =sub_8086194 + str r0, [sp, 0x4] + movs r0, 0 + movs r3, 0 + bl do_choose_name_or_words_screen + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E5074 + + thumb_func_start sub_80E509C +sub_80E509C: @ 80E509C + push {lr} + sub sp, 0x8 + ldr r0, =0x03005d90 + ldr r1, [r0] + ldrb r2, [r1, 0x8] + movs r0, 0 + str r0, [sp] + ldr r0, =sub_8086194 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r3, 0 + bl do_choose_name_or_words_screen + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E509C + + thumb_func_start sub_80E50C4 +sub_80E50C4: @ 80E50C4 + push {lr} + sub sp, 0x8 + ldr r0, =0x03005d90 + ldr r1, [r0] + ldrb r2, [r1, 0x8] + movs r0, 0 + str r0, [sp] + ldr r0, =sub_8086194 + str r0, [sp, 0x4] + movs r0, 0x2 + movs r3, 0 + bl do_choose_name_or_words_screen + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E50C4 + + thumb_func_start sub_80E50EC +sub_80E50EC: @ 80E50EC + push {lr} + sub sp, 0x8 + ldr r0, =0x03005d90 + ldr r1, [r0] + ldrb r2, [r1, 0x8] + movs r0, 0 + str r0, [sp] + ldr r0, =sub_8086194 + str r0, [sp, 0x4] + movs r0, 0x3 + movs r3, 0 + bl do_choose_name_or_words_screen + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E50EC + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/new_game.s b/asm/new_game.s new file mode 100644 index 000000000..aae9fa7dc --- /dev/null +++ b/asm/new_game.s @@ -0,0 +1,380 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start write_word_to_mem +@ void write_word_to_mem(int value, int *mem) +write_word_to_mem: @ 80842CC + strb r0, [r1] + lsrs r2, r0, 8 + strb r2, [r1, 0x1] + lsrs r2, r0, 16 + strb r2, [r1, 0x2] + lsrs r0, 24 + strb r0, [r1, 0x3] + bx lr + thumb_func_end write_word_to_mem + + thumb_func_start sub_80842DC +sub_80842DC: @ 80842DC + adds r2, r0, 0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + ldrb r1, [r2, 0x2] + lsls r1, 16 + orrs r0, r1 + ldrb r1, [r2, 0x1] + lsls r1, 8 + orrs r0, r1 + ldrb r1, [r2] + orrs r0, r1 + bx lr + thumb_func_end sub_80842DC + + thumb_func_start sub_80842F4 +sub_80842F4: @ 80842F4 + push {r4,lr} + adds r4, r0, 0 + adds r3, r1, 0 + movs r2, 0 +_080842FC: + adds r0, r4, r2 + adds r1, r3, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x3 + ble _080842FC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80842F4 + + thumb_func_start set_player_trainer_id +set_player_trainer_id: @ 8084310 + push {r4,lr} + bl GenerateRandomNumber + adds r4, r0, 0 + bl GetTrainerId + lsls r4, 16 + lsls r0, 16 + lsrs r0, 16 + orrs r4, r0 + ldr r0, =0x03005d90 + ldr r1, [r0] + adds r1, 0xA + adds r0, r4, 0 + bl write_word_to_mem + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end set_player_trainer_id + + thumb_func_start init_options +init_options: @ 808433C + ldr r3, =0x03005d90 + ldr r2, [r3] + ldrb r1, [r2, 0x14] + movs r0, 0x8 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x14] + ldr r2, [r3] + ldrb r1, [r2, 0x14] + movs r0, 0x7 + ands r0, r1 + strb r0, [r2, 0x14] + ldr r2, [r3] + ldrb r1, [r2, 0x15] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x15] + ldr r2, [r3] + ldrb r1, [r2, 0x15] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x15] + ldr r2, [r3] + ldrb r1, [r2, 0x15] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x15] + ldr r2, [r3] + ldrb r1, [r2, 0x15] + movs r0, 0x9 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x15] + bx lr + .pool + thumb_func_end init_options + + thumb_func_start sub_8084390 +sub_8084390: @ 8084390 + push {r4,lr} + ldr r1, =0x030060b0 + movs r0, 0 + strb r0, [r1] + ldr r4, =0x03005d90 + ldr r0, [r4] + adds r0, 0x28 + movs r1, 0 + movs r2, 0x34 + bl memset + ldr r0, [r4] + adds r0, 0x5C + movs r1, 0 + movs r2, 0x34 + bl memset + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084390 + + thumb_func_start sub_80843C0 +sub_80843C0: @ 80843C0 + push {r4-r7,lr} + bl sub_80DF040 + movs r2, 0x8 + ldr r0, =0x03005d8c + mov r12, r0 + ldr r4, =0x00002e90 + ldr r3, =gUnknown_08339D1C +_080843D0: + mov r1, r12 + ldr r0, [r1] + lsls r1, r2, 5 + adds r0, r1 + adds r0, r4 + adds r1, r3, 0 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5,r6} + stm r0!, {r5,r6} + adds r2, 0x1 + cmp r2, 0xC + ble _080843D0 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80843C0 + + thumb_func_start sub_8084400 +sub_8084400: @ 8084400 + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + ldr r4, =0x03005d90 + ldr r1, [r4] + ldr r0, =0x0000064c + adds r1, r0 + ldr r2, =0x05000238 + mov r0, sp + bl CpuSet + ldr r0, [r4] + ldr r1, =0x00000ee1 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r4] + ldr r1, =0x00000ee9 + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084400 + + thumb_func_start sub_808444C +sub_808444C: @ 808444C + push {lr} + sub sp, 0x4 + movs r3, 0x1 + negs r3, r3 + str r3, [sp] + movs r0, 0x19 + movs r1, 0x28 + adds r2, r3, 0 + bl warp1_set + bl warp_in + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_808444C + + thumb_func_start init_sav2 +init_sav2: @ 808446C + push {lr} + bl memclr_stdsav2 + bl init_options + pop {r0} + bx r0 + thumb_func_end init_sav2 + + thumb_func_start sub_808447C +sub_808447C: @ 808447C + push {lr} + ldr r1, =0x020322d4 + movs r0, 0 + strb r0, [r1] + bl sub_80BB358 + bl zero_player_party_data + bl zero_enemy_party_data + bl sub_81AAB70 + bl sub_813624C + pop {r0} + bx r0 + .pool + thumb_func_end sub_808447C + + thumb_func_start NewGameInitData +@ void NewGameInitData() +NewGameInitData: @ 80844A0 + push {r4,r5,lr} + ldr r0, =0x03006210 + ldrh r0, [r0] + cmp r0, 0 + beq _080844AE + cmp r0, 0x2 + bne _080844B2 +_080844AE: + bl GameFreakRTC_Reset +_080844B2: + ldr r1, =0x020322d4 + movs r0, 0x1 + strb r0, [r1] + ldr r4, =0x03005d90 + ldr r0, [r4] + adds r0, 0xAC + movs r5, 0 + str r5, [r0] + bl zero_player_party_data + bl zero_enemy_party_data + bl sub_80BB2D0 + bl sub_8084400 + bl clear_sav1 + bl sub_80D436C + ldr r0, [r4] + strb r5, [r0, 0x9] + ldr r0, [r4] + adds r0, 0xA8 + str r5, [r0] + bl set_player_trainer_id + bl reset_playtime + bl sub_8084390 + bl sub_809D300 + bl sub_80EBEE0 + bl GabbyAndTyNewGameInitData + bl sub_80E8B28 + bl RemoveAllBerryTrees + ldr r4, =0x03005d8c + ldr r0, [r4] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + ldr r1, =0x00000bb8 + bl EncryptMoney + movs r0, 0 + bl SetCoins + bl sub_80D766C + bl sub_80847A8 + bl sub_80843C0 + bl sub_813C1F8 + bl sub_80F9A7C + bl sub_80F9AD4 + ldr r0, =0x020244e9 + strb r5, [r0] + bl zero_player_party_data + bl sub_80C7770 + bl sub_8161B34 + bl sub_8161B60 + ldr r0, [r4] + ldr r1, =0x00000496 + adds r0, r1 + strh r5, [r0] + bl sub_80D7094 + bl sub_816ADF4 + bl sub_8136E88 + bl sub_81618B4 + bl sub_811F184 + bl sub_8120160 + bl sub_81224D4 + bl sub_813BA10 + bl sub_8177558 + bl sub_808444C + ldr r0, =gUnknown_082715DE + bl script_env_2_execute_new_script + bl sub_80845CC + bl copy_strings_to_sav1 + bl sub_818DA30 + bl sub_819FAA0 + bl sub_81A4B14 + bl sub_8195E10 + bl sub_801AFD8 + bl sub_800E5AC + bl sub_81D54BC + bl sub_80DED74 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end NewGameInitData + + thumb_func_start sub_80845CC +sub_80845CC: @ 80845CC + push {r4-r6,lr} + sub sp, 0x4 + mov r0, sp + movs r5, 0 + strh r5, [r0] + ldr r4, =0x03005d90 + ldr r1, [r4] + movs r0, 0xF6 + lsls r0, 1 + adds r1, r0 + ldr r6, =0x01000008 + mov r0, sp + adds r2, r6, 0 + bl CpuSet + ldr r0, [r4] + movs r1, 0xFA + lsls r1, 1 + adds r0, r1 + movs r1, 0 + bl sub_802467C + bl sub_802E33C + mov r0, sp + adds r0, 0x2 + strh r5, [r0] + ldr r1, [r4] + movs r2, 0x83 + lsls r2, 2 + adds r1, r2 + adds r2, r6, 0 + bl CpuSet + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80845CC + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/option_menu.s b/asm/option_menu.s new file mode 100644 index 000000000..4ab6f2ec8 --- /dev/null +++ b/asm/option_menu.s @@ -0,0 +1,1694 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80BA4B0 +sub_80BA4B0: @ 80BA4B0 + push {lr} + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_80BA4B0 + + thumb_func_start sub_80BA4C8 +sub_80BA4C8: @ 80BA4C8 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_80BA4C8 + + thumb_func_start CB2_OptionsMenu +CB2_OptionsMenu: @ 80BA4DC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0xB + bhi _080BA538 + lsls r0, 2 + ldr r1, =_080BA508 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080BA508: + .4byte _080BA538 + .4byte _080BA54C + .4byte _080BA69C + .4byte _080BA6BC + .4byte _080BA6E0 + .4byte _080BA718 + .4byte _080BA728 + .4byte _080BA740 + .4byte _080BA748 + .4byte _080BA760 + .4byte _080BA774 + .4byte _080BA80C +_080BA538: + movs r0, 0 + bl SetVBlankCallback + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080BA7F4 + .pool +_080BA54C: + movs r3, 0xC0 + lsls r3, 19 + movs r4, 0xC0 + lsls r4, 9 + add r1, sp, 0x8 + mov r8, r1 + add r2, sp, 0x4 + movs r6, 0 + ldr r1, =0x040000d4 + movs r5, 0x80 + lsls r5, 5 + ldr r7, =0x81000800 + movs r0, 0x81 + lsls r0, 24 + mov r12, r0 +_080BA56A: + strh r6, [r2] + add r0, sp, 0x4 + str r0, [r1] + str r3, [r1, 0x4] + str r7, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r3, r5 + subs r4, r5 + cmp r4, r5 + bhi _080BA56A + strh r6, [r2] + add r2, sp, 0x4 + str r2, [r1] + str r3, [r1, 0x4] + lsrs r0, r4, 1 + mov r2, r12 + orrs r0, r2 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r0, 0xE0 + lsls r0, 19 + movs r3, 0x80 + lsls r3, 3 + movs r4, 0 + str r4, [sp, 0x8] + ldr r2, =0x040000d4 + mov r1, r8 + str r1, [r2] + str r0, [r2, 0x4] + lsrs r0, r3, 2 + movs r1, 0x85 + lsls r1, 24 + orrs r0, r1 + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + movs r1, 0xA0 + lsls r1, 19 + add r0, sp, 0x4 + strh r4, [r0] + str r0, [r2] + str r1, [r2, 0x4] + lsrs r3, 1 + movs r0, 0x81 + lsls r0, 24 + orrs r3, r0 + str r3, [r2, 0x8] + ldr r0, [r2, 0x8] + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0855C698 + movs r0, 0 + movs r2, 0x2 + bl InitBgsFromTemplates + 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 + ldr r0, =gUnknown_0855C680 + bl InitWindows + bl DeactivateAllTextPrinters + movs r0, 0x40 + movs r1, 0 + bl SetGpuReg + movs r0, 0x44 + movs r1, 0 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x1 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x23 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0xC1 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0x4 + bl SetGpuReg + movs r1, 0xC1 + lsls r1, 6 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + b _080BA7EC + .pool +_080BA69C: + bl sub_80A1A74 + bl remove_some_task + bl ResetTasks + bl ResetAllObjectData + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080BA7F4 + .pool +_080BA6BC: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + lsrs r0, 3 + bl sub_8098758 + ldr r1, [r0] + movs r2, 0x90 + lsls r2, 1 + movs r3, 0xD1 + lsls r3, 1 + movs r0, 0x1 + bl LoadBgTiles + b _080BA7EC + .pool +_080BA6E0: + ldr r0, =gUnknown_0855C6A0 + movs r1, 0 + movs r2, 0x2 + bl gpu_pal_apply + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x14] + lsrs r0, 3 + bl sub_8098758 + ldr r0, [r0, 0x4] + movs r1, 0x70 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080BA7F4 + .pool +_080BA718: + ldr r0, =gUnknown_0855C604 + movs r1, 0x10 + movs r2, 0x20 + bl gpu_pal_apply + b _080BA7EC + .pool +_080BA728: + movs r0, 0 + bl PutWindowTilemap + bl sub_80BB0D0 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080BA7F4 + .pool +_080BA740: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _080BA7F4 +_080BA748: + movs r0, 0x1 + bl PutWindowTilemap + bl sub_80BB104 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080BA760: + bl sub_80BB154 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080BA7F4 + .pool +_080BA774: + ldr r0, =sub_80BA83C + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r0, 0 + strh r0, [r4, 0x8] + ldr r0, =0x03005d90 + ldr r2, [r0] + ldrb r0, [r2, 0x14] + lsls r0, 29 + lsrs r0, 29 + strh r0, [r4, 0xA] + ldrb r1, [r2, 0x15] + lsls r1, 29 + lsrs r1, 31 + strh r1, [r4, 0xC] + ldrb r1, [r2, 0x15] + lsls r1, 30 + lsrs r1, 31 + strh r1, [r4, 0xE] + ldrb r1, [r2, 0x15] + lsls r1, 31 + lsrs r1, 31 + strh r1, [r4, 0x10] + ldrb r1, [r2, 0x13] + strh r1, [r4, 0x12] + ldrb r1, [r2, 0x14] + lsrs r1, 3 + strh r1, [r4, 0x14] + bl sub_80BAC38 + ldrb r0, [r4, 0xC] + bl sub_80BAD08 + ldrb r0, [r4, 0xE] + bl sub_80BAD84 + ldrb r0, [r4, 0x10] + bl sub_80BAE08 + ldrb r0, [r4, 0x12] + bl sub_80BB028 + ldrb r0, [r4, 0x14] + bl sub_80BAF0C + ldrb r0, [r4, 0x8] + bl sub_80BAB38 + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram +_080BA7EC: + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_080BA7F4: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080BA828 + .pool +_080BA80C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =sub_80BA4C8 + bl SetVBlankCallback + ldr r0, =sub_80BA4B0 + bl SetMainCallback2 +_080BA828: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end CB2_OptionsMenu + + thumb_func_start sub_80BA83C +sub_80BA83C: @ 80BA83C + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BA85C + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80BA86C + str r0, [r1] +_080BA85C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BA83C + + thumb_func_start sub_80BA86C +sub_80BA86C: @ 80BA86C + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080BA89C + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0x6 + beq _080BA892 + b _080BAA5A +_080BA892: + b _080BA8AE + .pool +_080BA89C: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080BA8BC + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 +_080BA8AE: + ldr r0, =sub_80BAA64 + str r0, [r1] + b _080BAA5A + .pool +_080BA8BC: + movs r0, 0x40 + ands r0, r1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0 + beq _080BA8EC + ldr r1, =0x03005e00 + lsls r2, r4, 2 + adds r0, r2, r4 + lsls r0, 3 + adds r3, r0, r1 + ldrh r5, [r3, 0x8] + movs r6, 0x8 + ldrsh r0, [r3, r6] + adds r7, r1, 0 + cmp r0, 0 + ble _080BA8E8 + subs r0, r5, 0x1 + b _080BA90C + .pool +_080BA8E8: + movs r0, 0x6 + b _080BA90C +_080BA8EC: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080BA924 + ldr r1, =0x03005e00 + lsls r2, r4, 2 + adds r0, r2, r4 + lsls r0, 3 + adds r3, r0, r1 + ldrh r5, [r3, 0x8] + movs r7, 0x8 + ldrsh r0, [r3, r7] + adds r7, r1, 0 + cmp r0, 0x5 + bgt _080BA914 + adds r0, r5, 0x1 +_080BA90C: + strh r0, [r3, 0x8] + b _080BA916 + .pool +_080BA914: + strh r6, [r3, 0x8] +_080BA916: + adds r0, r2, r4 + lsls r0, 3 + adds r0, r7 + ldrb r0, [r0, 0x8] + bl sub_80BAB38 + b _080BAA5A +_080BA924: + ldr r0, =0x03005e00 + lsls r2, r4, 2 + adds r1, r2, r4 + lsls r1, 3 + adds r1, r0 + movs r3, 0x8 + ldrsh r1, [r1, r3] + adds r7, r0, 0 + cmp r1, 0x5 + bls _080BA93A + b _080BAA5A +_080BA93A: + lsls r0, r1, 2 + ldr r1, =_080BA94C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080BA94C: + .4byte _080BA964 + .4byte _080BA98A + .4byte _080BA9B0 + .4byte _080BA9D6 + .4byte _080BA9FC + .4byte _080BAA22 +_080BA964: + adds r4, r2, r4 + lsls r4, 3 + adds r4, r7 + ldrb r5, [r4, 0xA] + adds r0, r5, 0 + bl sub_80BABDC + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + strh r0, [r4, 0xA] + movs r6, 0xA + ldrsh r0, [r4, r6] + cmp r5, r0 + beq _080BAA46 + adds r0, r1, 0 + bl sub_80BAC38 + b _080BAA46 +_080BA98A: + adds r4, r2, r4 + lsls r4, 3 + adds r4, r7 + ldrb r5, [r4, 0xC] + adds r0, r5, 0 + bl sub_80BACE0 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + strh r0, [r4, 0xC] + movs r7, 0xC + ldrsh r0, [r4, r7] + cmp r5, r0 + beq _080BAA46 + adds r0, r1, 0 + bl sub_80BAD08 + b _080BAA46 +_080BA9B0: + adds r4, r2, r4 + lsls r4, 3 + adds r4, r7 + ldrb r5, [r4, 0xE] + adds r0, r5, 0 + bl sub_80BAD5C + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + strh r0, [r4, 0xE] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r5, r0 + beq _080BAA46 + adds r0, r1, 0 + bl sub_80BAD84 + b _080BAA46 +_080BA9D6: + adds r4, r2, r4 + lsls r4, 3 + adds r4, r7 + ldrb r5, [r4, 0x10] + adds r0, r5, 0 + bl sub_80BADD8 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + strh r0, [r4, 0x10] + movs r3, 0x10 + ldrsh r0, [r4, r3] + cmp r5, r0 + beq _080BAA46 + adds r0, r1, 0 + bl sub_80BAE08 + b _080BAA46 +_080BA9FC: + adds r4, r2, r4 + lsls r4, 3 + adds r4, r7 + ldrb r5, [r4, 0x12] + adds r0, r5, 0 + bl sub_80BAFCC + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + strh r0, [r4, 0x12] + movs r6, 0x12 + ldrsh r0, [r4, r6] + cmp r5, r0 + beq _080BAA46 + adds r0, r1, 0 + bl sub_80BB028 + b _080BAA46 +_080BAA22: + adds r4, r2, r4 + lsls r4, 3 + adds r4, r7 + ldrb r5, [r4, 0x14] + adds r0, r5, 0 + bl sub_80BAE5C + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + strh r0, [r4, 0x14] + movs r7, 0x14 + ldrsh r0, [r4, r7] + cmp r5, r0 + beq _080BAA46 + adds r0, r1, 0 + bl sub_80BAF0C +_080BAA46: + ldr r1, =0x02039b48 + ldrb r0, [r1] + cmp r0, 0 + beq _080BAA5A + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram +_080BAA5A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BA86C + + thumb_func_start sub_80BAA64 +sub_80BAA64: @ 80BAA64 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r6, =0x03005d90 + ldr r3, [r6] + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r0, 0x7 + ldrb r1, [r4, 0xA] + ands r1, r0 + ldrb r2, [r3, 0x14] + movs r0, 0x8 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x14] + ldr r3, [r6] + movs r5, 0x1 + ldrb r1, [r4, 0xC] + ands r1, r5 + lsls r1, 2 + ldrb r2, [r3, 0x15] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x15] + ldr r3, [r6] + ldrb r1, [r4, 0xE] + ands r1, r5 + lsls r1, 1 + ldrb r2, [r3, 0x15] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x15] + ldr r3, [r6] + ldrb r1, [r4, 0x10] + ands r1, r5 + ldrb r2, [r3, 0x15] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x15] + ldr r1, [r6] + ldrh r0, [r4, 0x12] + movs r5, 0 + strb r0, [r1, 0x13] + ldr r3, [r6] + ldrb r1, [r4, 0x14] + lsls r1, 3 + ldrb r2, [r3, 0x14] + movs r0, 0x7 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x14] + movs r0, 0x1 + negs r0, r0 + str r5, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_80BAB08 + str r0, [r4] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BAA64 + + thumb_func_start sub_80BAB08 +sub_80BAB08: @ 80BAB08 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BAB2C + adds r0, r2, 0 + bl DestroyTask + bl FreeAllWindowBuffers + ldr r0, =0x030022c0 + ldr r0, [r0, 0x8] + bl SetMainCallback2 +_080BAB2C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BAB08 + + thumb_func_start sub_80BAB38 +sub_80BAB38: @ 80BAB38 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r1, 0x87 + lsls r1, 5 + movs r0, 0x40 + bl SetGpuReg + lsls r4, 4 + adds r1, r4, 0 + adds r1, 0x28 + lsls r1, 8 + adds r4, 0x38 + orrs r1, r4 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80BAB38 + + thumb_func_start sub_80BAB68 +sub_80BAB68: @ 80BAB68 + push {r4-r6,lr} + sub sp, 0x1C + adds r4, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + lsls r3, 24 + lsrs r3, 24 + movs r2, 0 + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + beq _080BABA0 +_080BAB84: + mov r0, sp + adds r0, r2 + adds r0, 0xC + strb r1, [r0] + adds r4, 0x1 + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + beq _080BABA0 + cmp r2, 0xE + bls _080BAB84 +_080BABA0: + cmp r3, 0 + beq _080BABAE + add r1, sp, 0xC + movs r0, 0x4 + strb r0, [r1, 0x2] + movs r0, 0x5 + strb r0, [r1, 0x5] +_080BABAE: + mov r1, sp + adds r1, r2 + adds r1, 0xC + movs r0, 0xFF + strb r0, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + add r2, sp, 0xC + adds r3, r6, 0 + bl Print + add sp, 0x1C + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80BAB68 + + thumb_func_start sub_80BABDC +sub_80BABDC: @ 80BABDC + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080BAC08 + cmp r3, 0x1 + bhi _080BAC00 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + b _080BAC02 + .pool +_080BAC00: + movs r3, 0 +_080BAC02: + ldr r1, =0x02039b48 + movs r0, 0x1 + strb r0, [r1] +_080BAC08: + ldrh r1, [r2, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080BAC2C + cmp r3, 0 + beq _080BAC24 + subs r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + b _080BAC26 + .pool +_080BAC24: + movs r3, 0x2 +_080BAC26: + ldr r1, =0x02039b48 + movs r0, 0x1 + strb r0, [r1] +_080BAC2C: + adds r0, r3, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80BABDC + + thumb_func_start sub_80BAC38 +sub_80BAC38: @ 80BAC38 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + movs r2, 0 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + ldr r4, =gUnknown_085EE5D4 + mov r0, sp + ldrb r3, [r0] + adds r0, r4, 0 + movs r1, 0x68 + bl sub_80BAB68 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0 + bl GetStringWidth + adds r4, r0, 0 + ldr r0, =gUnknown_085EE5DF + mov r8, r0 + movs r0, 0x1 + mov r1, r8 + movs r2, 0 + bl GetStringWidth + adds r5, r0, 0 + ldr r6, =gUnknown_085EE5E9 + movs r0, 0x1 + adds r1, r6, 0 + movs r2, 0 + bl GetStringWidth + subs r5, 0x5E + subs r4, r5 + subs r4, r0 + lsrs r0, r4, 31 + adds r4, r0 + asrs r4, 1 + adds r4, 0x68 + lsls r4, 24 + lsrs r4, 24 + mov r0, sp + ldrb r3, [r0, 0x1] + mov r0, r8 + adds r1, r4, 0 + movs r2, 0 + bl sub_80BAB68 + movs r0, 0x1 + adds r1, r6, 0 + movs r2, 0xC6 + bl GetStringRightAlignXOffset + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + ldrb r3, [r0, 0x2] + adds r0, r6, 0 + movs r2, 0 + bl sub_80BAB68 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BAC38 + + thumb_func_start sub_80BACE0 +sub_80BACE0: @ 80BACE0 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0 + beq _080BACFA + movs r1, 0x1 + eors r2, r1 + ldr r0, =0x02039b48 + strb r1, [r0] +_080BACFA: + adds r0, r2, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80BACE0 + + thumb_func_start sub_80BAD08 +sub_80BAD08: @ 80BAD08 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + movs r2, 0 + strb r2, [r1] + strb r2, [r1, 0x1] + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + ldr r0, =gUnknown_085EE5F4 + mov r1, sp + ldrb r3, [r1] + movs r1, 0x68 + movs r2, 0x10 + bl sub_80BAB68 + ldr r4, =gUnknown_085EE5FD + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xC6 + bl GetStringRightAlignXOffset + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + ldrb r3, [r0, 0x1] + adds r0, r4, 0 + movs r2, 0x10 + bl sub_80BAB68 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BAD08 + + thumb_func_start sub_80BAD5C +sub_80BAD5C: @ 80BAD5C + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0 + beq _080BAD76 + movs r1, 0x1 + eors r2, r1 + ldr r0, =0x02039b48 + strb r1, [r0] +_080BAD76: + adds r0, r2, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80BAD5C + + thumb_func_start sub_80BAD84 +sub_80BAD84: @ 80BAD84 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + movs r2, 0 + strb r2, [r1] + strb r2, [r1, 0x1] + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + ldr r0, =gUnknown_085EE607 + mov r1, sp + ldrb r3, [r1] + movs r1, 0x68 + movs r2, 0x20 + bl sub_80BAB68 + ldr r4, =gUnknown_085EE613 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xC6 + bl GetStringRightAlignXOffset + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + ldrb r3, [r0, 0x1] + adds r0, r4, 0 + movs r2, 0x20 + bl sub_80BAB68 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BAD84 + + thumb_func_start sub_80BADD8 +sub_80BADD8: @ 80BADD8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0 + beq _080BADF8 + movs r4, 0x1 + eors r5, r4 + adds r0, r5, 0 + bl sub_82E1810 + ldr r0, =0x02039b48 + strb r4, [r0] +_080BADF8: + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80BADD8 + + thumb_func_start sub_80BAE08 +sub_80BAE08: @ 80BAE08 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + movs r2, 0 + strb r2, [r1] + strb r2, [r1, 0x1] + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + ldr r0, =gUnknown_085EE61D + mov r1, sp + ldrb r3, [r1] + movs r1, 0x68 + movs r2, 0x30 + bl sub_80BAB68 + ldr r4, =gUnknown_085EE628 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xC6 + bl GetStringRightAlignXOffset + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + ldrb r3, [r0, 0x1] + adds r0, r4, 0 + movs r2, 0x30 + bl sub_80BAB68 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BAE08 + + thumb_func_start sub_80BAE5C +sub_80BAE5C: @ 80BAE5C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080BAEAE + cmp r4, 0x12 + bhi _080BAE80 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + b _080BAE82 + .pool +_080BAE80: + movs r4, 0 +_080BAE82: + adds r0, r4, 0 + bl sub_8098758 + ldr r1, [r0] + movs r2, 0x90 + lsls r2, 1 + movs r3, 0xD1 + lsls r3, 1 + movs r0, 0x1 + bl LoadBgTiles + adds r0, r4, 0 + bl sub_8098758 + ldr r0, [r0, 0x4] + movs r1, 0x70 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =0x02039b48 + movs r0, 0x1 + strb r0, [r1] +_080BAEAE: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080BAEFE + cmp r4, 0 + beq _080BAED0 + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + b _080BAED2 + .pool +_080BAED0: + movs r4, 0x13 +_080BAED2: + adds r0, r4, 0 + bl sub_8098758 + ldr r1, [r0] + movs r2, 0x90 + lsls r2, 1 + movs r3, 0xD1 + lsls r3, 1 + movs r0, 0x1 + bl LoadBgTiles + adds r0, r4, 0 + bl sub_8098758 + ldr r0, [r0, 0x4] + movs r1, 0x70 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =0x02039b48 + movs r0, 0x1 + strb r0, [r1] +_080BAEFE: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80BAE5C + + thumb_func_start sub_80BAF0C +sub_80BAF0C: @ 80BAF0C + push {r4-r7,lr} + sub sp, 0x10 + lsls r0, 24 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r6, r0, 24 + movs r5, 0 + ldr r1, =gUnknown_085EE640 + ldrb r0, [r1] + ldr r7, =gUnknown_085EE635 + cmp r0, 0xFF + beq _080BAF44 + adds r2, r1, 0 +_080BAF28: + mov r0, sp + adds r1, r0, r5 + adds r0, r5, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r5, r2 + ldrb r0, [r0] + cmp r0, 0xFF + beq _080BAF44 + cmp r5, 0x5 + bls _080BAF28 +_080BAF44: + adds r0, r6, 0 + movs r1, 0xA + bl __udivsi3 + adds r2, r0, 0 + lsls r0, r2, 24 + cmp r0, 0 + beq _080BAF80 + mov r0, sp + adds r1, r0, r5 + adds r0, r2, 0 + adds r0, 0xA1 + strb r0, [r1] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + mov r1, sp + adds r4, r1, r5 + adds r0, r6, 0 + movs r1, 0xA + bl __umodsi3 + adds r0, 0xA1 + strb r0, [r4] + b _080BAF9E + .pool +_080BAF80: + mov r0, sp + adds r4, r0, r5 + adds r0, r6, 0 + movs r1, 0xA + bl __umodsi3 + adds r0, 0xA1 + strb r0, [r4] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + mov r0, sp + adds r1, r0, r5 + movs r0, 0x77 + strb r0, [r1] +_080BAF9E: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + mov r0, sp + adds r1, r0, r5 + movs r0, 0xFF + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x68 + movs r2, 0x50 + movs r3, 0 + bl sub_80BAB68 + mov r0, sp + movs r1, 0x80 + movs r2, 0x50 + movs r3, 0x1 + bl sub_80BAB68 + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80BAF0C + + thumb_func_start sub_80BAFCC +sub_80BAFCC: @ 80BAFCC + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080BAFF8 + cmp r3, 0x1 + bhi _080BAFF0 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + b _080BAFF2 + .pool +_080BAFF0: + movs r3, 0 +_080BAFF2: + ldr r1, =0x02039b48 + movs r0, 0x1 + strb r0, [r1] +_080BAFF8: + ldrh r1, [r2, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080BB01C + cmp r3, 0 + beq _080BB014 + subs r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + b _080BB016 + .pool +_080BB014: + movs r3, 0x2 +_080BB016: + ldr r1, =0x02039b48 + movs r0, 0x1 + strb r0, [r1] +_080BB01C: + adds r0, r3, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80BAFCC + + thumb_func_start sub_80BB028 +sub_80BB028: @ 80BB028 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + movs r2, 0 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + ldr r4, =gUnknown_085EE647 + mov r0, sp + ldrb r3, [r0] + adds r0, r4, 0 + movs r1, 0x68 + movs r2, 0x40 + bl sub_80BAB68 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0 + bl GetStringWidth + adds r4, r0, 0 + ldr r0, =gUnknown_085EE654 + mov r8, r0 + movs r0, 0x1 + mov r1, r8 + movs r2, 0 + bl GetStringWidth + adds r5, r0, 0 + ldr r6, =gUnknown_085EE65D + movs r0, 0x1 + adds r1, r6, 0 + movs r2, 0 + bl GetStringWidth + subs r5, 0x5E + subs r4, r5 + subs r4, r0 + lsrs r0, r4, 31 + adds r4, r0 + asrs r4, 1 + adds r4, 0x68 + lsls r4, 24 + lsrs r4, 24 + mov r0, sp + ldrb r3, [r0, 0x1] + mov r0, r8 + adds r1, r4, 0 + movs r2, 0x40 + bl sub_80BAB68 + movs r0, 0x1 + adds r1, r6, 0 + movs r2, 0xC6 + bl GetStringRightAlignXOffset + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + ldrb r3, [r0, 0x2] + adds r0, r6, 0 + movs r2, 0x40 + bl sub_80BAB68 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BB028 + + thumb_func_start sub_80BB0D0 +sub_80BB0D0: @ 80BB0D0 + push {lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_085EE589 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BB0D0 + + thumb_func_start sub_80BB104 +sub_80BB104: @ 80BB104 + push {r4,r5,lr} + sub sp, 0xC + movs r0, 0x1 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r4, 0 + ldr r5, =gUnknown_0855C664 +_080BB114: + lsls r0, r4, 2 + adds r0, r5 + 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] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x8 + bl Print + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _080BB114 + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BB104 + + thumb_func_start sub_80BB154 +sub_80BB154: @ 80BB154 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + movs r5, 0x7 + str r5, [sp, 0x8] + movs r0, 0x1 + movs r1, 0xD1 + lsls r1, 1 + movs r2, 0x1 + movs r3, 0 + bl FillBgTilemapBufferRect + movs r0, 0x1B + mov r8, r0 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + ldr r1, =0x000001a3 + movs r2, 0x2 + movs r3, 0 + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + movs r1, 0xD2 + lsls r1, 1 + movs r2, 0x1C + movs r3, 0 + bl FillBgTilemapBufferRect + str r4, [sp] + movs r6, 0x2 + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + ldr r1, =0x000001a5 + movs r2, 0x1 + movs r3, 0x1 + bl FillBgTilemapBufferRect + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + ldr r1, =0x000001a7 + movs r2, 0x1C + movs r3, 0x1 + bl FillBgTilemapBufferRect + movs r7, 0xD4 + lsls r7, 1 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x1 + movs r3, 0x3 + bl FillBgTilemapBufferRect + ldr r0, =0x000001a9 + mov r10, r0 + mov r0, r8 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + mov r1, r10 + movs r2, 0x2 + movs r3, 0x3 + bl FillBgTilemapBufferRect + movs r0, 0xD5 + lsls r0, 1 + mov r9, r0 + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + mov r1, r9 + movs r2, 0x1C + movs r3, 0x3 + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + movs r1, 0xD1 + lsls r1, 1 + movs r2, 0x1 + movs r3, 0x4 + bl FillBgTilemapBufferRect + movs r0, 0x1A + mov r8, r0 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + ldr r1, =0x000001a3 + movs r2, 0x2 + movs r3, 0x4 + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + movs r1, 0xD2 + lsls r1, 1 + movs r2, 0x1C + movs r3, 0x4 + bl FillBgTilemapBufferRect + str r4, [sp] + movs r6, 0x12 + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + ldr r1, =0x000001a5 + movs r2, 0x1 + movs r3, 0x5 + bl FillBgTilemapBufferRect + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + ldr r1, =0x000001a7 + movs r2, 0x1C + movs r3, 0x5 + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0x1 + movs r3, 0x13 + bl FillBgTilemapBufferRect + mov r0, r8 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + mov r1, r10 + movs r2, 0x2 + movs r3, 0x13 + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x1 + mov r1, r9 + movs r2, 0x1C + movs r3, 0x13 + bl FillBgTilemapBufferRect + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + 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_80BB154 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/palette.s b/asm/palette.s new file mode 100644 index 000000000..bead76986 --- /dev/null +++ b/asm/palette.s @@ -0,0 +1,2831 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80A1818 +sub_80A1818: @ 80A1818 + push {lr} + lsls r0, 16 + ldr r2, =gUnknown_0852487C + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + lsrs r1, 14 + adds r1, r2 + ldr r0, [r1] + ldr r1, =0x02037814 + movs r2, 0x10 + bl CpuSet + ldr r0, =0x02037fd4 + ldrh r2, [r0, 0x4] + lsls r2, 21 + lsrs r2, 27 + ldrh r3, [r0, 0x6] + lsls r3, 17 + lsrs r3, 17 + movs r0, 0x80 + movs r1, 0x10 + bl pal_fade_1 + ldr r0, =sub_8149DFC + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _080A1862 + ldr r1, =0x03000f44 + ldr r0, =sub_80A1670 + str r0, [r1] + ldr r1, =0x03000f3c + movs r0, 0x20 + strh r0, [r1] +_080A1862: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A1818 + + thumb_func_start sub_80A1884 +sub_80A1884: @ 80A1884 + push {lr} + lsls r0, 16 + ldr r2, =gUnknown_0852487C + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + lsrs r1, 14 + adds r1, r2 + ldr r0, [r1] + ldr r1, =0x02037814 + movs r2, 0x10 + bl CpuSet + ldr r0, =sub_8149DFC + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _080A18D6 + ldr r0, =0x02037fd4 + ldrh r2, [r0, 0x4] + lsls r2, 21 + lsrs r2, 27 + ldrh r3, [r0, 0x6] + lsls r3, 17 + lsrs r3, 17 + movs r0, 0x80 + movs r1, 0x10 + bl pal_fade_1 + ldr r1, =0x03000f3c + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _080A18D6 + ldr r0, =0x03000f44 + str r1, [r0] +_080A18D6: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A1884 + + thumb_func_start decompress_palette +@ void decompress_palette(void *src, u16 offset, u16 size) +decompress_palette: @ 80A18F4 + push {r4-r6,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + ldr r6, =0x02037fe8 + adds r1, r6, 0 + bl LZDecompressWram + lsls r4, 1 + ldr r1, =0x02037714 + adds r1, r4, r1 + lsrs r5, 17 + adds r0, r6, 0 + adds r2, r5, 0 + bl CpuSet + ldr r0, =0x02037b14 + adds r4, r0 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl CpuSet + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end decompress_palette + + thumb_func_start gpu_pal_apply +@ void gpu_pal_apply(void *src, int dest_offset, int mode) +gpu_pal_apply: @ 80A1938 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsls r5, 16 + lsrs r4, 15 + ldr r1, =0x02037714 + adds r1, r4, r1 + lsrs r5, 17 + adds r2, r5, 0 + bl CpuSet + ldr r0, =0x02037b14 + adds r4, r0 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl CpuSet + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end gpu_pal_apply + + thumb_func_start rboxid_80040B8 +rboxid_80040B8: @ 80A1970 + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r6, 16 + lsrs r6, 16 + lsls r4, 16 + lsls r5, 16 + mov r0, sp + strh r6, [r0] + lsrs r4, 15 + ldr r1, =0x02037714 + adds r1, r4, r1 + lsrs r5, 17 + movs r0, 0x80 + lsls r0, 17 + orrs r5, r0 + mov r0, sp + adds r2, r5, 0 + bl CpuSet + mov r0, sp + adds r0, 0x2 + strh r6, [r0] + ldr r1, =0x02037b14 + adds r4, r1 + adds r1, r4, 0 + adds r2, r5, 0 + bl CpuSet + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end rboxid_80040B8 + + thumb_func_start copy_pal_bg_faded_to_pal_ram +@ void copy_pal_bg_faded_to_pal_ram() +copy_pal_bg_faded_to_pal_ram: @ 80A19C0 + push {r4,r5,lr} + ldr r4, =0x02037fd4 + ldrb r1, [r4, 0x8] + movs r5, 0x80 + adds r0, r5, 0 + ands r0, r1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + bne _080A1A02 + ldr r1, =0x02037b14 + movs r2, 0xA0 + lsls r2, 19 + ldr r0, =0x040000d4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, =0x80000200 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + ldr r0, =0x02037fe4 + str r3, [r0] + ldrb r1, [r4, 0x9] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + bne _080A1A02 + ldrb r1, [r4, 0x7] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _080A1A02 + bl sub_80A2968 +_080A1A02: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end copy_pal_bg_faded_to_pal_ram + + thumb_func_start fade_and_return_progress_probably +@ int fade_and_return_progress_probably() +fade_and_return_progress_probably: @ 80A1A1C + push {lr} + ldr r0, =0x02037fe4 + ldr r0, [r0] + cmp r0, 0 + beq _080A1A30 + movs r0, 0xFF + b _080A1A68 + .pool +_080A1A30: + ldr r0, =0x02037fd4 + ldrb r0, [r0, 0x9] + movs r1, 0x3 + ands r1, r0 + cmp r1, 0 + bne _080A1A48 + bl pal_fade__0 + b _080A1A56 + .pool +_080A1A48: + cmp r1, 0x1 + bne _080A1A52 + bl pal_fade__1 + b _080A1A56 +_080A1A52: + bl pal_fade__2 +_080A1A56: + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =0x02037fe4 + ldr r0, =0x02037fd4 + ldr r0, [r0] + movs r1, 0 + orrs r0, r1 + str r0, [r2] + adds r0, r3, 0 +_080A1A68: + pop {r1} + bx r1 + .pool + thumb_func_end fade_and_return_progress_probably + + thumb_func_start sub_80A1A74 +sub_80A1A74: @ 80A1A74 + push {r4,lr} + movs r4, 0 +_080A1A78: + adds r0, r4, 0 + bl palslot_dead_struct_update + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _080A1A78 + bl pal_fade_control_reset_maybe + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A1A74 + + thumb_func_start sub_80A1A94 +sub_80A1A94: @ 80A1A94 + push {r4-r7,lr} + movs r0, 0xA0 + lsls r0, 19 + mov r12, r0 + movs r4, 0 + ldr r7, =0x02037714 + ldr r6, =0x02037b14 + ldr r5, =0x000001ff +_080A1AA4: + lsls r1, r4, 1 + adds r3, r1, r7 + mov r0, r12 + adds r2, r1, r0 + ldrh r0, [r2] + strh r0, [r3] + adds r1, r6 + ldrh r0, [r2] + strh r0, [r1] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r5 + bls _080A1AA4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A1A94 + + thumb_func_start pal_fade_maybe +pal_fade_maybe: @ 80A1AD4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + ldr r0, [sp, 0x18] + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r12, r2 + lsls r3, 24 + lsrs r7, r3, 24 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r5, =0x02037fd4 + ldrb r1, [r5, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080A1B08 + movs r0, 0 + b _080A1C00 + .pool +_080A1B08: + ldrb r0, [r5, 0xA] + movs r3, 0x79 + negs r3, r3 + adds r2, r3, 0 + ands r2, r0 + movs r0, 0x10 + orrs r2, r0 + strb r2, [r5, 0xA] + lsls r0, r6, 24 + asrs r1, r0, 24 + cmp r1, 0 + bge _080A1B36 + lsls r0, r2, 25 + lsrs r0, 28 + negs r1, r1 + adds r0, r1 + movs r1, 0xF + ands r0, r1 + lsls r0, 3 + ands r2, r3 + orrs r2, r0 + strb r2, [r5, 0xA] + movs r6, 0 +_080A1B36: + str r4, [r5] + movs r4, 0x3F + adds r1, r6, 0 + ands r1, r4 + ldrb r2, [r5, 0x4] + movs r3, 0x40 + negs r3, r3 + adds r0, r3, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x4] + ands r6, r4 + ldrb r0, [r5, 0x8] + ands r3, r0 + orrs r3, r6 + strb r3, [r5, 0x8] + movs r0, 0x1F + mov r1, r12 + ands r1, r0 + lsls r1, 6 + ldrh r2, [r5, 0x4] + ldr r0, =0xfffff83f + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + lsls r2, r7, 3 + ldrb r1, [r5, 0x5] + movs r0, 0x7 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + ldr r1, =0x00007fff + mov r0, r8 + ands r1, r0 + ldrh r2, [r5, 0x6] + ldr r0, =0xffff8000 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x6] + ldrb r0, [r5, 0x7] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r5, 0x7] + ldrb r1, [r5, 0x9] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r5, 0x9] + cmp r12, r7 + bcs _080A1BB0 + movs r0, 0x41 + negs r0, r0 + ands r3, r0 + b _080A1BB4 + .pool +_080A1BB0: + movs r0, 0x40 + orrs r3, r0 +_080A1BB4: + strb r3, [r5, 0x8] + bl fade_and_return_progress_probably + ldr r4, =0x02037fd4 + ldrb r1, [r4, 0x8] + lsrs r5, r1, 7 + movs r0, 0x7F + ands r0, r1 + strb r0, [r4, 0x8] + ldr r0, =0x02037b14 + movs r1, 0xA0 + lsls r1, 19 + ldr r2, =0x04000100 + bl CpuSet + ldr r1, =0x02037fe4 + movs r0, 0 + str r0, [r1] + ldrb r1, [r4, 0x9] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + bne _080A1BF0 + ldrb r1, [r4, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080A1BF0 + bl sub_80A2968 +_080A1BF0: + ldr r2, =0x02037fd4 + lsls r3, r5, 7 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + orrs r0, r3 + strb r0, [r2, 0x8] + movs r0, 0x1 +_080A1C00: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end pal_fade_maybe + + thumb_func_start sub_80A1C1C +sub_80A1C1C: @ 80A1C1C + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x8 + mov r8, r0 + adds r4, r1, 0 + adds r6, r2, 0 + ldr r5, [sp, 0x1C] + lsls r4, 24 + lsrs r4, 24 + lsls r6, 24 + lsrs r6, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r5, 16 + lsrs r5, 16 + str r3, [sp, 0x4] + bl sub_80A1A94 + lsls r4, 24 + asrs r4, 24 + str r5, [sp] + mov r0, r8 + adds r1, r4, 0 + adds r2, r6, 0 + ldr r3, [sp, 0x4] + bl pal_fade_maybe + lsls r0, 24 + lsrs r0, 24 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80A1C1C + + thumb_func_start sub_80A1C64 +sub_80A1C64: @ 80A1C64 + push {r4-r7,lr} + adds r6, r1, 0 + lsls r0, 24 + lsrs r7, r0, 24 + movs r5, 0 +_080A1C6E: + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + ldr r1, =0x02037f14 + adds r4, r0, r1 + ldrb r0, [r4, 0x4] + lsls r0, 31 + cmp r0, 0 + beq _080A1CCC + ldr r2, [r4] + ldrb r0, [r2, 0x8] + lsls r0, 31 + lsrs r0, 31 + cmp r0, r7 + bne _080A1CCC + ldrh r1, [r4, 0x6] + lsls r1, 20 + lsrs r1, 25 + ldrb r0, [r2, 0xB] + lsls r0, 27 + lsrs r0, 27 + cmp r1, r0 + bne _080A1CAA + adds r0, r4, 0 + bl sub_80A1F00 + ldrb r0, [r4, 0x4] + lsls r0, 31 + cmp r0, 0 + beq _080A1CCC +_080A1CAA: + ldrb r0, [r4, 0x8] + cmp r0, 0 + bne _080A1CC0 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80A1CDC + b _080A1CC4 + .pool +_080A1CC0: + subs r0, 0x1 + strb r0, [r4, 0x8] +_080A1CC4: + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80A1E40 +_080A1CCC: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xF + bls _080A1C6E + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A1C64 + + thumb_func_start sub_80A1CDC +sub_80A1CDC: @ 80A1CDC + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + mov r8, r1 + movs r6, 0 + ldrh r1, [r4, 0x6] + lsls r1, 20 + lsrs r1, 25 + ldr r3, [r4] + ldrb r0, [r3, 0x9] + lsls r2, r0, 25 + lsrs r0, r2, 27 + adds r5, r1, 0 + muls r5, r0 + ldrb r1, [r3, 0x8] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080A1D78 + lsrs r0, r2, 27 + cmp r6, r0 + bcs _080A1DC4 + ldr r0, =0x02037714 + mov r12, r0 + ldr r7, =0x02037b14 +_080A1D10: + ldr r0, [r4, 0x4] + lsls r0, 11 + lsrs r0, 22 + lsls r0, 1 + add r0, r12 + ldr r1, [r3, 0x4] + lsls r2, r5, 1 + adds r1, r2, r1 + ldrh r1, [r1] + strh r1, [r0] + ldr r0, [r4, 0x4] + lsls r0, 11 + lsrs r0, 22 + lsls r0, 1 + adds r0, r7 + ldr r1, [r4] + ldr r1, [r1, 0x4] + adds r2, r1 + ldrh r1, [r2] + strh r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, [r4, 0x4] + lsls r1, r2, 11 + lsrs r1, 22 + adds r1, 0x1 + ldr r0, =0x000003ff + ands r1, r0 + lsls r1, 11 + ldr r0, =0xffe007ff + ands r0, r2 + orrs r0, r1 + str r0, [r4, 0x4] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r3, [r4] + ldrb r0, [r3, 0x9] + lsls r0, 25 + lsrs r0, 27 + cmp r6, r0 + bcc _080A1D10 + b _080A1DC4 + .pool +_080A1D78: + lsrs r0, r2, 27 + cmp r6, r0 + bcs _080A1DC4 + ldr r3, =0x02037b14 +_080A1D80: + ldr r1, [r4, 0x4] + lsls r1, 11 + lsrs r1, 22 + lsls r1, 1 + adds r1, r3 + ldr r0, [r4] + ldr r2, [r0, 0x4] + lsls r0, r5, 1 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, [r4, 0x4] + lsls r1, r2, 11 + lsrs r1, 22 + adds r1, 0x1 + ldr r0, =0x000003ff + ands r1, r0 + lsls r1, 11 + ldr r0, =0xffe007ff + ands r0, r2 + orrs r0, r1 + str r0, [r4, 0x4] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, [r4] + ldrb r0, [r0, 0x9] + lsls r0, 25 + lsrs r0, 27 + cmp r6, r0 + bcc _080A1D80 +_080A1DC4: + ldrh r0, [r4, 0x4] + lsls r0, 21 + lsrs r0, 23 + lsls r0, 11 + ldr r1, [r4, 0x4] + ldr r2, =0xffe007ff + ands r1, r2 + orrs r1, r0 + str r1, [r4, 0x4] + ldr r3, [r4] + ldrb r0, [r3, 0xA] + strb r0, [r4, 0x8] + ldrh r2, [r4, 0x6] + lsls r0, r2, 20 + lsrs r0, 25 + adds r0, 0x1 + movs r1, 0x7F + ands r0, r1 + lsls r0, 5 + ldr r5, =0xfffff01f + adds r1, r5, 0 + ands r1, r2 + orrs r1, r0 + strh r1, [r4, 0x6] + lsls r1, 20 + lsrs r1, 25 + ldrb r0, [r3, 0xB] + lsls r0, 27 + lsrs r0, 27 + cmp r1, r0 + blt _080A1E14 + ldrb r0, [r4, 0x9] + cmp r0, 0 + beq _080A1E0C + subs r0, 0x1 + strb r0, [r4, 0x9] +_080A1E0C: + ldrh r1, [r4, 0x6] + adds r0, r5, 0 + ands r0, r1 + strh r0, [r4, 0x6] +_080A1E14: + ldrh r0, [r4, 0x4] + lsls r0, 21 + lsrs r0, 27 + movs r1, 0x1 + lsls r1, r0 + mov r2, r8 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A1CDC + + thumb_func_start sub_80A1E40 +sub_80A1E40: @ 80A1E40 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r3, =0x02037fd4 + ldrb r1, [r3, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080A1EF4 + ldrh r0, [r4, 0x4] + lsls r0, 21 + lsrs r6, r0, 23 + asrs r1, r6, 4 + movs r5, 0x1 + adds r0, r5, 0 + lsls r0, r1 + ldr r1, [r3] + ands r0, r1 + cmp r0, 0 + beq _080A1EF4 + ldr r2, [r4] + ldrb r1, [r2, 0x8] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _080A1E9C + ldrb r1, [r3, 0x4] + lsls r1, 26 + ldrb r0, [r3, 0x8] + lsls r0, 26 + cmp r1, r0 + beq _080A1EF4 + adds r0, r6, 0 + ldrb r1, [r2, 0x9] + lsls r1, 25 + lsrs r1, 27 + ldrh r2, [r3, 0x4] + lsls r2, 21 + lsrs r2, 27 + ldrh r3, [r3, 0x6] + lsls r3, 17 + lsrs r3, 17 + bl pal_fade_1 + b _080A1EF4 + .pool +_080A1E9C: + ldrb r1, [r3, 0x4] + movs r0, 0x3F + ands r0, r1 + cmp r0, 0 + bne _080A1EF4 + ldrb r0, [r4, 0x8] + ldrb r1, [r2, 0xA] + cmp r0, r1 + beq _080A1EF4 + ldrh r0, [r4, 0x6] + lsls r0, 20 + lsrs r0, 25 + ldrb r1, [r2, 0x9] + lsls r1, 25 + lsrs r2, r1, 27 + adds r5, r0, 0 + muls r5, r2 + movs r3, 0 + adds r1, r2, 0 + cmp r3, r1 + bcs _080A1EF4 + ldr r6, =0x02037b14 +_080A1EC8: + ldrh r1, [r4, 0x4] + lsls r1, 21 + lsrs r1, 23 + adds r1, r3 + lsls r1, 1 + adds r1, r6 + ldr r2, [r4] + adds r0, r5, r3 + ldr r2, [r2, 0x4] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, [r4] + ldrb r0, [r0, 0x9] + lsls r0, 25 + lsrs r0, 27 + cmp r3, r0 + bcc _080A1EC8 +_080A1EF4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A1E40 + + thumb_func_start sub_80A1F00 +sub_80A1F00: @ 80A1F00 + push {lr} + adds r3, r0, 0 + ldrb r0, [r3, 0x9] + cmp r0, 0 + bne _080A1F50 + ldr r2, [r3] + ldrb r0, [r2, 0xB] + lsrs r0, 5 + cmp r0, 0 + bne _080A1F40 + ldrh r1, [r3, 0x6] + ldr r0, =0xfffff01f + ands r0, r1 + strh r0, [r3, 0x6] + ldrb r0, [r2, 0xA] + strb r0, [r3, 0x8] + ldrb r0, [r2, 0xC] + strb r0, [r3, 0x9] + ldrh r0, [r3, 0x4] + lsls r0, 21 + lsrs r0, 23 + lsls r0, 11 + ldr r1, [r3, 0x4] + ldr r2, =0xffe007ff + ands r1, r2 + orrs r1, r0 + str r1, [r3, 0x4] + b _080A1F54 + .pool +_080A1F40: + cmp r0, 0 + blt _080A1F54 + cmp r0, 0x2 + bgt _080A1F54 + ldrh r0, [r2] + bl sub_80A1F58 + b _080A1F54 +_080A1F50: + subs r0, 0x1 + strb r0, [r3, 0x9] +_080A1F54: + pop {r0} + bx r0 + thumb_func_end sub_80A1F00 + + thumb_func_start sub_80A1F58 +sub_80A1F58: @ 80A1F58 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_80A20A4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + beq _080A1F6E + bl palslot_dead_struct_update +_080A1F6E: + pop {r0} + bx r0 + thumb_func_end sub_80A1F58 + + thumb_func_start palslot_dead_struct_update +palslot_dead_struct_update: @ 80A1F74 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02037f14 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldr r0, =gUnknown_0852488C + str r0, [r1] + ldrb r2, [r1, 0x4] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x4] + ldrh r2, [r1, 0x4] + ldr r0, =0xfffff803 + ands r0, r2 + strh r0, [r1, 0x4] + ldr r0, [r1, 0x4] + ldr r2, =0xffe007ff + ands r0, r2 + str r0, [r1, 0x4] + ldrh r2, [r1, 0x6] + ldr r0, =0xfffff01f + ands r0, r2 + strh r0, [r1, 0x6] + ldrb r2, [r1, 0x4] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x4] + movs r0, 0 + strb r0, [r1, 0x8] + strb r0, [r1, 0x9] + bx lr + .pool + thumb_func_end palslot_dead_struct_update + + thumb_func_start pal_fade_control_reset_maybe +pal_fade_control_reset_maybe: @ 80A1FD0 + ldr r2, =0x02037fd4 + movs r0, 0 + str r0, [r2] + subs r0, 0x40 + ldrb r1, [r2, 0x4] + ands r0, r1 + strb r0, [r2, 0x4] + ldrh r1, [r2, 0x4] + ldr r0, =0xfffff83f + ands r0, r1 + strh r0, [r2, 0x4] + ldrb r1, [r2, 0x5] + movs r0, 0x7 + ands r0, r1 + strb r0, [r2, 0x5] + ldrh r1, [r2, 0x6] + ldr r0, =0xffff8000 + ands r0, r1 + strh r0, [r2, 0x6] + ldrb r1, [r2, 0x7] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x7] + movs r0, 0 + strb r0, [r2, 0x8] + ldrb r1, [r2, 0x9] + movs r3, 0x5 + negs r3, r3 + adds r0, r3, 0 + ands r0, r1 + movs r1, 0x9 + negs r1, r1 + ands r0, r1 + strb r0, [r2, 0x9] + ldrb r1, [r2, 0xA] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0xA] + ldr r0, [r2, 0x8] + ldr r1, =0xfffe0fff + ands r0, r1 + str r0, [r2, 0x8] + ldrb r0, [r2, 0xA] + ands r3, r0 + movs r0, 0x79 + negs r0, r0 + ands r3, r0 + movs r0, 0x10 + orrs r3, r0 + strb r3, [r2, 0xA] + bx lr + .pool + thumb_func_end pal_fade_control_reset_maybe + + thumb_func_start sub_80A2048 +sub_80A2048: @ 80A2048 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_80A20A4 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x10 + beq _080A206C + ldr r1, =0x02037f14 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x4] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0, 0x4] +_080A206C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2048 + + thumb_func_start sub_80A2074 +sub_80A2074: @ 80A2074 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_80A20A4 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x10 + beq _080A209A + ldr r0, =0x02037f14 + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x4] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x4] +_080A209A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2074 + + thumb_func_start sub_80A20A4 +sub_80A20A4: @ 80A20A4 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0 + ldr r3, =0x02037f14 +_080A20AE: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, r2 + bne _080A20C8 + adds r0, r1, 0 + b _080A20D4 + .pool +_080A20C8: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bls _080A20AE + movs r0, 0x10 +_080A20D4: + pop {r1} + bx r1 + thumb_func_end sub_80A20A4 + + thumb_func_start pal_fade__0 +pal_fade__0: @ 80A20D8 + push {r4-r7,lr} + ldr r4, =0x02037fd4 + ldrb r1, [r4, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080A20F0 + movs r0, 0 + b _080A220C + .pool +_080A20F0: + bl sub_80A29BC + lsls r0, 24 + cmp r0, 0 + beq _080A20FE + ldrb r0, [r4, 0x7] + b _080A220A +_080A20FE: + ldrb r1, [r4, 0xA] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080A2132 + ldrb r2, [r4, 0x4] + lsls r1, r2, 26 + ldrb r0, [r4, 0x8] + lsls r0, 26 + cmp r1, r0 + bcs _080A212A + lsrs r0, r1, 26 + adds r0, 0x1 + movs r1, 0x3F + ands r0, r1 + movs r1, 0x40 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x4] + movs r0, 0x2 + b _080A220C +_080A212A: + movs r0, 0x40 + negs r0, r0 + ands r0, r2 + strb r0, [r4, 0x4] +_080A2132: + movs r5, 0 + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0xA] + movs r0, 0x4 + ands r0, r1 + adds r7, r2, 0 + cmp r0, 0 + bne _080A214C + ldrh r4, [r7] + b _080A2152 + .pool +_080A214C: + ldrh r4, [r7, 0x2] + movs r5, 0x80 + lsls r5, 1 +_080A2152: + cmp r4, 0 + beq _080A2184 + ldr r7, =0x02037fd4 + adds r6, r7, 0 +_080A215A: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _080A2176 + ldrh r2, [r6, 0x4] + lsls r2, 21 + lsrs r2, 27 + ldrh r3, [r6, 0x6] + lsls r3, 17 + lsrs r3, 17 + adds r0, r5, 0 + movs r1, 0x10 + bl pal_fade_1 +_080A2176: + lsrs r4, 1 + adds r0, r5, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r4, 0 + bne _080A215A +_080A2184: + ldrb r2, [r7, 0xA] + lsls r0, r2, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r4, 0x5 + negs r4, r4 + ands r4, r2 + orrs r4, r1 + strb r4, [r7, 0xA] + movs r0, 0x4 + ands r0, r4 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + bne _080A2208 + ldrh r6, [r7, 0x4] + lsls r2, r6, 21 + ldrb r0, [r7, 0x5] + lsls r5, r0, 24 + lsrs r1, r2, 27 + lsrs r0, r5, 27 + cmp r1, r0 + bne _080A21C4 + str r3, [r7] + movs r0, 0x2 + orrs r4, r0 + strb r4, [r7, 0xA] + b _080A2208 + .pool +_080A21C4: + ldrb r1, [r7, 0x8] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _080A21E0 + lsrs r3, r2, 27 + lsls r0, r4, 25 + lsrs r0, 28 + adds r3, r0, r3 + lsrs r0, r5, 27 + cmp r3, r0 + ble _080A21F6 + adds r3, r0, 0 + b _080A21F6 +_080A21E0: + lsrs r3, r2, 27 + lsls r0, r4, 25 + lsrs r0, 28 + subs r0, r3, r0 + lsls r0, 24 + lsrs r3, r0, 24 + asrs r0, 24 + lsrs r1, r5, 27 + cmp r0, r1 + bge _080A21F6 + adds r3, r1, 0 +_080A21F6: + lsls r0, r3, 24 + asrs r0, 24 + movs r1, 0x1F + ands r0, r1 + lsls r0, 6 + ldr r1, =0xfffff83f + ands r1, r6 + orrs r1, r0 + strh r1, [r7, 0x4] +_080A2208: + ldrb r0, [r7, 0x7] +_080A220A: + lsrs r0, 7 +_080A220C: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end pal_fade__0 + + thumb_func_start sub_80A2218 +sub_80A2218: @ 80A2218 + push {r4-r7,lr} + adds r1, r0, 0 + movs r3, 0 + cmp r1, 0 + beq _080A2256 + ldr r7, =0x02037b14 +_080A2224: + movs r0, 0x1 + ands r0, r1 + lsrs r4, r1, 1 + adds r5, r3, 0 + adds r5, 0x10 + cmp r0, 0 + beq _080A224C + movs r2, 0 + adds r6, r7, 0 +_080A2236: + adds r0, r3, r2 + lsls r0, 1 + adds r0, r6 + ldrh r1, [r0] + mvns r1, r1 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _080A2236 +_080A224C: + adds r1, r4, 0 + lsls r0, r5, 16 + lsrs r3, r0, 16 + cmp r1, 0 + bne _080A2224 +_080A2256: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2218 + + thumb_func_start sub_80A2260 +sub_80A2260: @ 80A2260 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x4] + movs r0, 0 + mov r9, r0 + cmp r4, 0 + beq _080A231C + lsls r1, 24 + str r1, [sp, 0x8] +_080A228A: + movs r0, 0x1 + ands r0, r4 + lsrs r4, 1 + str r4, [sp, 0xC] + movs r1, 0x10 + add r1, r9 + mov r10, r1 + cmp r0, 0 + beq _080A230E + movs r4, 0 + ldr r2, =0x02037b14 + mov r8, r2 + ldr r1, [sp] + lsls r0, r1, 24 + ldr r2, [sp, 0x4] + lsls r1, r2, 24 + ldr r2, [sp, 0x8] + asrs r2, 24 + mov r12, r2 + movs r5, 0x1F + asrs r7, r0, 24 + asrs r6, r1, 24 +_080A22B6: + mov r0, r9 + adds r2, r0, r4 + lsls r2, 1 + add r2, r8 + ldr r1, [r2] + lsls r1, 27 + lsrs r1, 27 + add r1, r12 + ands r1, r5 + ldrb r3, [r2] + movs r0, 0x20 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r1, [r2] + lsls r1, 22 + lsrs r1, 27 + adds r1, r7 + movs r0, 0x1F + ands r1, r0 + lsls r1, 5 + ldrh r3, [r2] + ldr r0, =0xfffffc1f + ands r0, r3 + orrs r0, r1 + strh r0, [r2] + ldr r1, [r2] + lsls r1, 17 + lsrs r1, 27 + adds r1, r6 + ands r1, r5 + lsls r1, 2 + ldrb r3, [r2, 0x1] + movs r0, 0x7D + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _080A22B6 +_080A230E: + ldr r4, [sp, 0xC] + mov r1, r10 + lsls r0, r1, 16 + lsrs r0, 16 + mov r9, r0 + cmp r4, 0 + bne _080A228A +_080A231C: + 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_80A2260 + + thumb_func_start sub_80A2334 +sub_80A2334: @ 80A2334 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r1, r0, 0 + movs r3, 0 + cmp r1, 0 + beq _080A237E + ldr r0, =0x02037b14 + mov r8, r0 + ldr r0, =0x02037714 + mov r12, r0 +_080A234A: + movs r0, 0x1 + ands r0, r1 + lsrs r4, r1, 1 + adds r5, r3, 0 + adds r5, 0x10 + cmp r0, 0 + beq _080A2374 + movs r2, 0 + mov r7, r8 + mov r6, r12 +_080A235E: + adds r0, r3, r2 + lsls r0, 1 + adds r1, r0, r7 + adds r0, r6 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _080A235E +_080A2374: + adds r1, r4, 0 + lsls r0, r5, 16 + lsrs r3, r0, 16 + cmp r1, 0 + bne _080A234A +_080A237E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2334 + + thumb_func_start sub_80A2390 +sub_80A2390: @ 80A2390 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x02037fd4 + ldrb r2, [r3, 0xA] + movs r1, 0x79 + negs r1, r1 + ands r1, r2 + movs r2, 0x10 + orrs r1, r2 + strb r1, [r3, 0xA] + bl sub_80A23B4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2390 + + thumb_func_start sub_80A23B4 +sub_80A23B4: @ 80A23B4 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + ldr r2, =0x02037fd4 + ldrh r0, [r2, 0x4] + movs r3, 0xF8 + lsls r3, 3 + adds r1, r3, 0 + orrs r0, r1 + strh r0, [r2, 0x4] + movs r1, 0x3F + ands r1, r4 + ldrb r3, [r2, 0x8] + movs r0, 0x40 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x8] + ldrb r0, [r2, 0x7] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x7] + ldrb r1, [r2, 0x9] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] + cmp r4, 0x2 + bne _080A2406 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, =0x02037b14 + ldr r2, =0x01000200 + mov r0, sp + bl CpuSet +_080A2406: + cmp r4, 0 + bne _080A241C + mov r0, sp + adds r0, 0x2 + ldr r2, =0x00007fff + adds r1, r2, 0 + strh r1, [r0] + ldr r1, =0x02037b14 + ldr r2, =0x01000200 + bl CpuSet +_080A241C: + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A23B4 + + thumb_func_start pal_fade__1 +pal_fade__1: @ 80A2438 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r4, =0x02037fd4 + ldrb r1, [r4, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080A2458 + movs r0, 0 + b _080A2792 + .pool +_080A2458: + bl sub_80A29BC + lsls r0, 24 + cmp r0, 0 + beq _080A2466 + ldrb r0, [r4, 0x7] + b _080A2790 +_080A2466: + ldrb r1, [r4, 0xA] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080A247C + movs r2, 0x80 + lsls r2, 1 + movs r0, 0x80 + lsls r0, 2 + mov r10, r0 + b _080A2484 +_080A247C: + movs r2, 0 + movs r1, 0x80 + lsls r1, 1 + mov r10, r1 +_080A2484: + ldr r1, =0x02037fd4 + ldrb r0, [r1, 0x8] + lsls r0, 26 + lsrs r0, 26 + cmp r0, 0x1 + beq _080A2544 + cmp r0, 0x1 + bgt _080A24A0 + cmp r0, 0 + beq _080A24AE + b _080A2694 + .pool +_080A24A0: + cmp r0, 0x2 + bne _080A24A6 + b _080A25A8 +_080A24A6: + cmp r0, 0x3 + bne _080A24AC + b _080A2630 +_080A24AC: + b _080A2694 +_080A24AE: + adds r7, r2, 0 + cmp r7, r10 + bcc _080A24B6 + b _080A2694 +_080A24B6: + lsls r2, r7, 1 + ldr r0, =0x02037714 + adds r0, r2, r0 + ldr r1, [r0] + lsls r3, r1, 27 + lsls r0, r1, 22 + lsrs r0, 27 + mov r12, r0 + lsls r1, 17 + lsrs r1, 27 + mov r8, r1 + ldr r0, =0x02037b14 + adds r2, r0 + mov r9, r2 + ldr r1, [r2] + lsls r2, r1, 27 + lsrs r2, 3 + movs r4, 0xFE + lsls r4, 24 + adds r2, r4 + lsls r0, r1, 22 + lsrs r0, 27 + subs r0, 0x2 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 17 + lsrs r1, 27 + subs r1, 0x2 + lsls r1, 24 + lsrs r4, r1, 24 + lsrs r6, r2, 24 + asrs r2, 24 + lsrs r3, 3 + asrs r0, r3, 24 + cmp r2, r0 + bge _080A2500 + lsrs r6, r3, 24 +_080A2500: + lsls r0, r5, 24 + asrs r0, 24 + mov r2, r12 + lsls r1, r2, 24 + cmp r0, r12 + bge _080A250E + lsrs r5, r1, 24 +_080A250E: + lsls r0, r4, 24 + asrs r0, 24 + mov r3, r8 + lsls r1, r3, 24 + cmp r0, r8 + bge _080A251C + lsrs r4, r1, 24 +_080A251C: + lsls r1, r6, 24 + asrs r1, 24 + lsls r0, r5, 24 + asrs r0, 19 + orrs r1, r0 + lsls r0, r4, 24 + asrs r0, 14 + orrs r1, r0 + mov r4, r9 + strh r1, [r4] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, r10 + bcc _080A24B6 + b _080A2694 + .pool +_080A2544: + adds r7, r2, 0 + cmp r7, r10 + bcc _080A254C + b _080A2694 +_080A254C: + lsls r1, r7, 1 + ldr r0, =0x02037b14 + adds r2, r1, r0 + ldr r1, [r2] + lsls r0, r1, 27 + lsrs r0, 3 + movs r3, 0x80 + lsls r3, 18 + adds r0, r3 + lsrs r6, r0, 24 + lsls r0, r1, 22 + lsrs r0, 27 + adds r5, r0, 0x2 + lsls r1, 17 + lsrs r1, 27 + adds r4, r1, 0x2 + cmp r6, 0x1F + ble _080A2572 + movs r6, 0x1F +_080A2572: + lsls r0, r5, 24 + asrs r0, 24 + cmp r0, 0x1F + ble _080A257C + movs r5, 0x1F +_080A257C: + lsls r0, r4, 24 + asrs r0, 24 + cmp r0, 0x1F + ble _080A2586 + movs r4, 0x1F +_080A2586: + lsls r1, r6, 24 + asrs r1, 24 + lsls r0, r5, 24 + asrs r0, 19 + orrs r1, r0 + lsls r0, r4, 24 + asrs r0, 14 + orrs r1, r0 + strh r1, [r2] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, r10 + bcc _080A254C + b _080A2694 + .pool +_080A25A8: + adds r7, r2, 0 + cmp r7, r10 + bcs _080A2694 +_080A25AE: + lsls r2, r7, 1 + ldr r0, =0x02037714 + adds r0, r2, r0 + ldr r1, [r0] + lsls r3, r1, 27 + lsls r0, r1, 22 + lsrs r0, 27 + mov r12, r0 + lsls r1, 17 + lsrs r1, 27 + mov r8, r1 + ldr r0, =0x02037b14 + adds r2, r0 + ldr r1, [r2] + lsls r0, r1, 27 + lsrs r0, 3 + movs r4, 0x80 + lsls r4, 18 + adds r0, r4 + lsrs r6, r0, 24 + lsls r0, r1, 22 + lsrs r0, 27 + adds r5, r0, 0x2 + lsls r1, 17 + lsrs r1, 27 + adds r4, r1, 0x2 + lsrs r3, 3 + asrs r0, r3, 24 + cmp r6, r0 + ble _080A25EC + lsrs r6, r3, 24 +_080A25EC: + lsls r0, r5, 24 + asrs r0, 24 + mov r3, r12 + lsls r1, r3, 24 + cmp r0, r12 + ble _080A25FA + lsrs r5, r1, 24 +_080A25FA: + lsls r0, r4, 24 + asrs r0, 24 + mov r3, r8 + lsls r1, r3, 24 + cmp r0, r8 + ble _080A2608 + lsrs r4, r1, 24 +_080A2608: + lsls r1, r6, 24 + asrs r1, 24 + lsls r0, r5, 24 + asrs r0, 19 + orrs r1, r0 + lsls r0, r4, 24 + asrs r0, 14 + orrs r1, r0 + strh r1, [r2] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, r10 + bcc _080A25AE + b _080A2694 + .pool +_080A2630: + adds r7, r2, 0 + cmp r7, r10 + bcs _080A2694 + ldr r4, =0x02037b14 + mov r8, r4 +_080A263A: + lsls r0, r7, 1 + mov r1, r8 + adds r3, r0, r1 + ldr r1, [r3] + lsls r2, r1, 27 + lsrs r2, 3 + movs r4, 0xFE + lsls r4, 24 + adds r2, r4 + lsls r0, r1, 22 + lsrs r0, 27 + subs r0, 0x2 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 17 + lsrs r1, 27 + subs r1, 0x2 + lsls r1, 24 + lsrs r4, r1, 24 + lsrs r6, r2, 24 + cmp r2, 0 + bge _080A2668 + movs r6, 0 +_080A2668: + lsls r0, r5, 24 + cmp r0, 0 + bge _080A2670 + movs r5, 0 +_080A2670: + lsls r0, r4, 24 + cmp r0, 0 + bge _080A2678 + movs r4, 0 +_080A2678: + lsls r1, r6, 24 + asrs r1, 24 + lsls r0, r5, 24 + asrs r0, 19 + orrs r1, r0 + lsls r0, r4, 24 + asrs r0, 14 + orrs r1, r0 + strh r1, [r3] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, r10 + bcc _080A263A +_080A2694: + ldr r0, =0x02037fd4 + ldrb r2, [r0, 0xA] + lsls r0, r2, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r3, 0x5 + negs r3, r3 + ands r3, r2 + orrs r3, r1 + ldr r1, =0x02037fd4 + strb r3, [r1, 0xA] + movs r0, 0x4 + ands r0, r3 + cmp r0, 0 + beq _080A26C4 + ldrb r0, [r1, 0x7] + b _080A2790 + .pool +_080A26C4: + ldr r2, =0x02037fd4 + ldrh r4, [r2, 0x4] + lsls r5, r4, 21 + lsrs r0, r5, 27 + lsls r2, r3, 25 + lsrs r1, r2, 28 + subs r0, r1 + cmp r0, 0 + bge _080A26E8 + ldr r0, =0xfffff83f + ands r0, r4 + ldr r3, =0x02037fd4 + strh r0, [r3, 0x4] + b _080A26FE + .pool +_080A26E8: + lsrs r1, r5, 27 + lsrs r0, r2, 28 + subs r1, r0 + movs r0, 0x1F + ands r1, r0 + lsls r1, 6 + ldr r0, =0xfffff83f + ands r0, r4 + orrs r0, r1 + ldr r4, =0x02037fd4 + strh r0, [r4, 0x4] +_080A26FE: + ldr r1, =0x02037fd4 + ldrh r0, [r1, 0x4] + movs r1, 0xF8 + lsls r1, 3 + ands r1, r0 + cmp r1, 0 + bne _080A278C + ldr r2, =0x02037fd4 + ldrb r0, [r2, 0x8] + lsls r0, 26 + lsrs r0, 26 + cmp r0, 0x1 + beq _080A2750 + cmp r0, 0x1 + bgt _080A272C + cmp r0, 0 + beq _080A2736 + b _080A2778 + .pool +_080A272C: + cmp r0, 0x2 + beq _080A2736 + cmp r0, 0x3 + beq _080A276C + b _080A2778 +_080A2736: + ldr r0, =0x02037714 + ldr r1, =0x02037b14 + ldr r2, =0x04000100 + bl CpuSet + b _080A2778 + .pool +_080A2750: + movs r0, 0x1 + negs r0, r0 + str r0, [sp] + ldr r1, =0x02037b14 + ldr r2, =0x05000100 + mov r0, sp + bl CpuSet + b _080A2778 + .pool +_080A276C: + str r1, [sp, 0x4] + add r0, sp, 0x4 + ldr r1, =0x02037b14 + ldr r2, =0x05000100 + bl CpuSet +_080A2778: + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x9] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x9] + ldrb r0, [r2, 0xA] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0xA] +_080A278C: + ldr r3, =0x02037fd4 + ldrb r0, [r3, 0x7] +_080A2790: + lsrs r0, 7 +_080A2792: + 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 pal_fade__1 + + thumb_func_start sub_80A27B0 +sub_80A27B0: @ 80A27B0 + push {r4-r7,lr} + ldr r5, [sp, 0x14] + 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 r5, 24 + lsrs r5, 24 + ldr r7, =0x02037fd4 + str r0, [r7] + movs r0, 0x3F + ands r1, r0 + ldrb r4, [r7, 0x4] + movs r6, 0x40 + negs r6, r6 + adds r0, r6, 0 + ands r0, r4 + orrs r0, r1 + strb r0, [r7, 0x4] + ldrb r0, [r7, 0x8] + ands r6, r0 + orrs r6, r1 + strb r6, [r7, 0x8] + movs r0, 0x1F + adds r1, r2, 0 + ands r1, r0 + lsls r1, 6 + ldrh r4, [r7, 0x4] + ldr r0, =0xfffff83f + ands r0, r4 + orrs r0, r1 + strh r0, [r7, 0x4] + lsls r4, r3, 3 + ldrb r1, [r7, 0x5] + movs r0, 0x7 + ands r0, r1 + orrs r0, r4 + strb r0, [r7, 0x5] + ldrb r0, [r7, 0x7] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r7, 0x7] + ldrb r1, [r7, 0x9] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + movs r1, 0x1 + ands r5, r1 + lsls r5, 2 + subs r1, 0x6 + ands r0, r1 + orrs r0, r5 + subs r1, 0x4 + ands r0, r1 + strb r0, [r7, 0x9] + cmp r2, r3 + bcs _080A2840 + movs r0, 0x41 + negs r0, r0 + ands r6, r0 + b _080A2844 + .pool +_080A2840: + movs r0, 0x40 + orrs r6, r0 +_080A2844: + strb r6, [r7, 0x8] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A27B0 + + thumb_func_start pal_fade__2 +pal_fade__2: @ 80A284C + push {r4-r7,lr} + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x7] + movs r0, 0x80 + ands r0, r1 + adds r4, r2, 0 + cmp r0, 0 + bne _080A2864 + movs r0, 0 + b _080A295C + .pool +_080A2864: + ldrb r2, [r4, 0x4] + lsls r1, r2, 26 + ldrb r3, [r4, 0x8] + lsls r0, r3, 26 + cmp r1, r0 + bcs _080A2886 + lsrs r0, r1, 26 + adds r0, 0x1 + movs r1, 0x3F + ands r0, r1 + movs r1, 0x40 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x4] + movs r0, 0x2 + b _080A295C +_080A2886: + movs r0, 0x40 + negs r0, r0 + ands r0, r2 + strb r0, [r4, 0x4] + movs r0, 0x40 + ands r0, r3 + cmp r0, 0 + bne _080A28E4 + ldrh r1, [r4, 0x4] + lsls r0, r1, 21 + lsrs r0, 27 + adds r0, 0x1 + movs r7, 0x1F + ands r0, r7 + lsls r0, 6 + ldr r6, =0xfffff83f + adds r3, r6, 0 + ands r3, r1 + orrs r3, r0 + strh r3, [r4, 0x4] + lsls r5, r3, 21 + ldrb r0, [r4, 0x5] + lsrs r1, r5, 27 + lsrs r0, 3 + cmp r1, r0 + bls _080A2930 + ldrb r2, [r4, 0x9] + lsls r1, r2, 28 + lsrs r1, 31 + adds r1, 0x1 + movs r0, 0x1 + ands r1, r0 + lsls r1, 3 + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x9] + lsrs r0, r5, 27 + subs r0, 0x1 + ands r0, r7 + lsls r0, 6 + ands r3, r6 + b _080A292C + .pool +_080A28E4: + ldrh r2, [r4, 0x4] + lsls r1, r2, 21 + lsrs r0, r1, 27 + subs r0, 0x1 + movs r6, 0x1F + ands r0, r6 + lsls r0, 6 + ldr r5, =0xfffff83f + adds r3, r5, 0 + ands r3, r2 + orrs r3, r0 + strh r3, [r4, 0x4] + lsrs r1, 27 + subs r1, 0x1 + ldrb r0, [r4, 0x5] + lsrs r0, 3 + cmp r1, r0 + bge _080A2930 + ldrb r2, [r4, 0x9] + lsls r1, r2, 28 + lsrs r1, 31 + adds r1, 0x1 + movs r0, 0x1 + ands r1, r0 + lsls r1, 3 + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x9] + lsls r0, r3, 21 + lsrs r0, 27 + adds r0, 0x1 + ands r0, r6 + lsls r0, 6 + ands r3, r5 +_080A292C: + orrs r3, r0 + strh r3, [r4, 0x4] +_080A2930: + ldrb r1, [r4, 0x9] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080A2958 + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080A294E + movs r0, 0 + str r0, [r4] + ldrh r1, [r4, 0x4] + ldr r0, =0xfffff83f + ands r0, r1 + strh r0, [r4, 0x4] +_080A294E: + ldrb r1, [r4, 0x9] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x9] +_080A2958: + ldrb r0, [r4, 0x7] + lsrs r0, 7 +_080A295C: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end pal_fade__2 + + thumb_func_start sub_80A2968 +sub_80A2968: @ 80A2968 + push {r4,lr} + ldr r4, =0x02037fd4 + ldrh r1, [r4] + movs r0, 0x50 + bl SetGpuReg + ldrh r1, [r4, 0x4] + lsls r1, 21 + lsrs r1, 27 + movs r0, 0x54 + bl SetGpuReg + ldrb r1, [r4, 0x9] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080A29AC + movs r0, 0x9 + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + negs r1, r1 + ands r0, r1 + strb r0, [r4, 0x9] + movs r0, 0 + str r0, [r4] + ldrh r1, [r4, 0x4] + ldr r0, =0xfffff83f + ands r0, r1 + strh r0, [r4, 0x4] + ldrb r1, [r4, 0x7] + movs r0, 0x7F + ands r0, r1 + strb r0, [r4, 0x7] +_080A29AC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2968 + + thumb_func_start sub_80A29BC +sub_80A29BC: @ 80A29BC + push {r4,lr} + ldr r3, =0x02037fd4 + ldrb r4, [r3, 0xA] + movs r0, 0x2 + ands r0, r4 + cmp r0, 0 + beq _080A2A18 + ldr r2, [r3, 0x8] + movs r0, 0xF8 + lsls r0, 9 + ands r0, r2 + movs r1, 0x80 + lsls r1, 7 + cmp r0, r1 + bne _080A29FC + ldrb r1, [r3, 0x7] + movs r0, 0x7F + ands r0, r1 + strb r0, [r3, 0x7] + movs r0, 0x3 + negs r0, r0 + ands r0, r4 + strb r0, [r3, 0xA] + ldr r0, [r3, 0x8] + ldr r1, =0xfffe0fff + ands r0, r1 + str r0, [r3, 0x8] + b _080A2A10 + .pool +_080A29FC: + lsls r0, r2, 15 + lsrs r0, 27 + adds r0, 0x1 + movs r1, 0x1F + ands r0, r1 + lsls r0, 12 + ldr r1, =0xfffe0fff + ands r1, r2 + orrs r1, r0 + str r1, [r3, 0x8] +_080A2A10: + movs r0, 0x1 + b _080A2A1A + .pool +_080A2A18: + movs r0, 0 +_080A2A1A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80A29BC + + thumb_func_start sub_80A2A20 +sub_80A2A20: @ 80A2A20 + push {r4-r7,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 16 + lsrs r6, r2, 16 + movs r5, 0 + cmp r4, 0 + beq _080A2A54 +_080A2A32: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _080A2A46 + adds r0, r5, 0 + movs r1, 0x10 + adds r2, r7, 0 + adds r3, r6, 0 + bl pal_fade_1 +_080A2A46: + lsrs r4, 1 + adds r0, r5, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r4, 0 + bne _080A2A32 +_080A2A54: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A2A20 + + thumb_func_start sub_80A2A5C +sub_80A2A5C: @ 80A2A5C + push {r4,r5,lr} + lsls r1, 24 + lsrs r1, 24 + lsls r2, 16 + lsrs r2, 16 + ldr r4, =0x02037714 + ldr r5, =0x02037b14 + ldr r3, =0x040000d4 + str r4, [r3] + str r5, [r3, 0x4] + ldr r4, =0x84000100 + str r4, [r3, 0x8] + ldr r3, [r3, 0x8] + bl sub_80A2A20 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2A5C + + thumb_func_start TintPalette_GrayScale +TintPalette_GrayScale: @ 80A2A90 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0 + beq _080A2AD8 + movs r6, 0x1F + adds r5, r1, 0 +_080A2AA0: + ldrh r1, [r4] + movs r2, 0x1F + ands r2, r1 + lsls r1, 16 + lsrs r3, r1, 21 + ands r3, r6 + lsrs r1, 26 + ands r1, r6 + movs r0, 0x4C + muls r2, r0 + movs r0, 0x97 + muls r0, r3 + adds r2, r0 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r1 + adds r2, r0 + asrs r2, 8 + lsls r0, r2, 10 + lsls r1, r2, 5 + orrs r0, r1 + orrs r0, r2 + strh r0, [r4] + adds r4, 0x2 + subs r5, 0x1 + cmp r5, 0 + bne _080A2AA0 +_080A2AD8: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end TintPalette_GrayScale + + thumb_func_start sub_80A2AE0 +sub_80A2AE0: @ 80A2AE0 + push {r4-r7,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0 + beq _080A2B34 + movs r6, 0x1F + ldr r7, =gUnknown_0852489C + adds r5, r1, 0 +_080A2AF2: + ldrh r1, [r4] + movs r2, 0x1F + ands r2, r1 + lsls r1, 16 + lsrs r3, r1, 21 + ands r3, r6 + lsrs r1, 26 + ands r1, r6 + movs r0, 0x4C + muls r2, r0 + movs r0, 0x97 + muls r0, r3 + adds r2, r0 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r1 + adds r2, r0 + asrs r2, 8 + cmp r2, 0x1F + bls _080A2B1E + movs r2, 0x1F +_080A2B1E: + adds r0, r2, r7 + ldrb r2, [r0] + lsls r0, r2, 10 + lsls r1, r2, 5 + orrs r0, r1 + orrs r0, r2 + strh r0, [r4] + adds r4, 0x2 + subs r5, 0x1 + cmp r5, 0 + bne _080A2AF2 +_080A2B34: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2AE0 + + thumb_func_start TintPalette_SepiaTone +TintPalette_SepiaTone: @ 80A2B40 + push {r4-r7,lr} + adds r5, r0, 0 + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0 + beq _080A2BA2 + movs r7, 0x1F + adds r6, r1, 0 +_080A2B50: + ldrh r0, [r5] + movs r1, 0x1F + ands r1, r0 + lsls r0, 16 + lsrs r2, r0, 21 + ands r2, r7 + lsrs r3, r0, 26 + ands r3, r7 + movs r0, 0x4C + muls r1, r0 + movs r0, 0x97 + muls r0, r2 + adds r1, r0 + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r3 + adds r1, r0 + asrs r1, 8 + ldr r0, =0x00000133 + muls r0, r1 + lsls r0, 16 + lsrs r2, r0, 24 + lsls r0, r1, 24 + lsrs r4, r0, 24 + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 20 + lsrs r3, r0, 24 + cmp r2, 0x1F + ble _080A2B90 + movs r2, 0x1F +_080A2B90: + lsls r0, r3, 10 + lsls r1, r4, 5 + orrs r0, r1 + orrs r0, r2 + strh r0, [r5] + adds r5, 0x2 + subs r6, 0x1 + cmp r6, 0 + bne _080A2B50 +_080A2BA2: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end TintPalette_SepiaTone + + thumb_func_start sub_80A2BAC +sub_80A2BAC: @ 80A2BAC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r5, r0, 0 + ldr r0, [sp, 0x1C] + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + mov r9, r2 + lsls r3, 16 + lsrs r3, 16 + mov r8, r3 + lsls r0, 16 + lsrs r0, 16 + mov r12, r0 + cmp r1, 0 + beq _080A2C38 + movs r7, 0x1F + adds r6, r1, 0 +_080A2BD6: + ldrh r0, [r5] + movs r1, 0x1F + ands r1, r0 + lsls r0, 16 + lsrs r2, r0, 21 + ands r2, r7 + lsrs r3, r0, 26 + ands r3, r7 + movs r0, 0x4C + muls r1, r0 + movs r0, 0x97 + muls r0, r2 + adds r1, r0 + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r3 + adds r1, r0 + asrs r1, 8 + mov r0, r9 + muls r0, r1 + lsls r0, 16 + lsrs r4, r0, 24 + mov r0, r8 + muls r0, r1 + lsls r0, 16 + lsrs r2, r0, 24 + mov r0, r12 + muls r0, r1 + lsls r0, 16 + lsrs r3, r0, 24 + cmp r4, 0x1F + ble _080A2C1A + movs r4, 0x1F +_080A2C1A: + cmp r2, 0x1F + ble _080A2C20 + movs r2, 0x1F +_080A2C20: + cmp r3, 0x1F + ble _080A2C26 + movs r3, 0x1F +_080A2C26: + lsls r0, r3, 10 + lsls r1, r2, 5 + orrs r0, r1 + orrs r0, r4 + strh r0, [r5] + adds r5, 0x2 + subs r6, 0x1 + cmp r6, 0 + bne _080A2BD6 +_080A2C38: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A2BAC + + thumb_func_start sub_80A2C44 +sub_80A2C44: @ 80A2C44 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r0 + adds r4, r1, 0 + ldr r0, [sp, 0x20] + ldr r1, [sp, 0x24] + ldr r5, [sp, 0x28] + lsls r4, 24 + lsrs r4, 24 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r6, r3, 24 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + lsls r1, 24 + lsrs r1, 24 + lsls r5, 24 + lsrs r5, 24 + mov r8, r5 + ldr r0, =sub_80A2D54 + bl CreateTask + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r1, r0, r1 + strh r7, [r1, 0x8] + strh r6, [r1, 0xA] + lsls r4, 24 + asrs r4, 24 + cmp r4, 0 + blt _080A2CA4 + strh r4, [r1, 0xE] + movs r0, 0x1 + b _080A2CAC + .pool +_080A2CA4: + movs r0, 0 + strh r0, [r1, 0xE] + negs r0, r4 + adds r0, 0x1 +_080A2CAC: + strh r0, [r1, 0xC] + lsls r4, r5, 2 + cmp r6, r7 + bcs _080A2CC4 + ldr r0, =0x03005e00 + adds r1, r4, r5 + lsls r1, 3 + adds r1, r0 + movs r2, 0xC + ldrsh r0, [r1, r2] + negs r0, r0 + strh r0, [r1, 0xC] +_080A2CC4: + adds r0, r5, 0 + movs r1, 0x5 + mov r2, r10 + bl SetWordTaskArg + ldr r0, =0x03005e00 + adds r1, r4, r5 + lsls r1, 3 + adds r1, r0 + mov r0, r9 + strh r0, [r1, 0x16] + mov r2, r8 + strh r2, [r1, 0x18] + ldr r1, [r1] + adds r0, r5, 0 + bl _call_via_r1 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2C44 + + thumb_func_start sub_80A2CF8 +sub_80A2CF8: @ 80A2CF8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r3, r0, 24 + movs r2, 0 + ldr r4, =sub_80A2D54 + ldr r1, =0x03005e00 +_080A2D04: + ldrb r0, [r1, 0x4] + cmp r0, 0x1 + bne _080A2D24 + ldr r0, [r1] + cmp r0, r4 + bne _080A2D24 + movs r5, 0x18 + ldrsh r0, [r1, r5] + cmp r0, r3 + bne _080A2D24 + movs r0, 0x1 + b _080A2D2E + .pool +_080A2D24: + adds r1, 0x28 + adds r2, 0x1 + cmp r2, 0xF + ble _080A2D04 + movs r0, 0 +_080A2D2E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80A2CF8 + + thumb_func_start sub_80A2D34 +sub_80A2D34: @ 80A2D34 + push {lr} + b _080A2D3C +_080A2D38: + bl DestroyTask +_080A2D3C: + ldr r0, =sub_80A2D54 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _080A2D38 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2D34 + + thumb_func_start sub_80A2D54 +sub_80A2D54: @ 80A2D54 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + adds r0, r5, 0 + movs r1, 0x5 + bl GetWordTaskArg + adds r3, r0, 0 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x6 + ldrsh r1, [r4, r2] + cmp r0, r1 + ble _080A2DCC + movs r0, 0 + strh r0, [r4, 0x8] + ldrb r1, [r4] + ldrh r2, [r4, 0xE] + adds r0, r3, 0 + bl sub_80A2A20 + ldrh r1, [r4] + movs r6, 0 + ldrsh r0, [r4, r6] + ldrh r3, [r4, 0x2] + movs r6, 0x2 + ldrsh r2, [r4, r6] + cmp r0, r2 + bne _080A2DAC + adds r0, r5, 0 + bl DestroyTask + b _080A2DCC + .pool +_080A2DAC: + ldrh r0, [r4, 0x4] + adds r1, r0 + strh r1, [r4] + lsls r0, 16 + cmp r0, 0 + blt _080A2DC2 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, r2 + blt _080A2DCC + b _080A2DCA +_080A2DC2: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, r2 + bgt _080A2DCC +_080A2DCA: + strh r3, [r4] +_080A2DCC: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80A2D54 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/play_time.s b/asm/play_time.s new file mode 100644 index 000000000..e1b4b6ad0 --- /dev/null +++ b/asm/play_time.s @@ -0,0 +1,125 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start reset_playtime +reset_playtime: @ 80841E4 + ldr r1, =0x03000e08 + movs r0, 0 + strb r0, [r1] + ldr r2, =0x03005d90 + ldr r3, [r2] + movs r1, 0 + movs r0, 0 + strh r0, [r3, 0xE] + strb r1, [r3, 0x10] + ldr r0, [r2] + strb r1, [r0, 0x11] + ldr r0, [r2] + strb r1, [r0, 0x12] + bx lr + .pool + thumb_func_end reset_playtime + + thumb_func_start set_max_playtime_if_appropriate +set_max_playtime_if_appropriate: @ 8084208 + push {lr} + ldr r1, =0x03000e08 + movs r0, 0x1 + strb r0, [r1] + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrh r1, [r0, 0xE] + ldr r0, =0x000003e7 + cmp r1, r0 + bls _08084220 + bl set_max_playtime +_08084220: + pop {r0} + bx r0 + .pool + thumb_func_end set_max_playtime_if_appropriate + + thumb_func_start sub_8084230 +sub_8084230: @ 8084230 + ldr r1, =0x03000e08 + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_8084230 + + thumb_func_start gametime_increment +gametime_increment: @ 808423C + push {lr} + ldr r0, =0x03000e08 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08084294 + ldr r2, =0x03005d90 + ldr r0, [r2] + ldrb r1, [r0, 0x12] + adds r1, 0x1 + movs r3, 0 + strb r1, [r0, 0x12] + ldr r1, [r2] + ldrb r0, [r1, 0x12] + cmp r0, 0x3B + bls _08084294 + strb r3, [r1, 0x12] + ldr r0, [r2] + ldrb r1, [r0, 0x11] + adds r1, 0x1 + strb r1, [r0, 0x11] + ldr r1, [r2] + ldrb r0, [r1, 0x11] + cmp r0, 0x3B + bls _08084294 + strb r3, [r1, 0x11] + ldr r0, [r2] + ldrb r1, [r0, 0x10] + adds r1, 0x1 + strb r1, [r0, 0x10] + ldr r1, [r2] + ldrb r0, [r1, 0x10] + cmp r0, 0x3B + bls _08084294 + strb r3, [r1, 0x10] + ldr r0, [r2] + ldrh r1, [r0, 0xE] + adds r1, 0x1 + strh r1, [r0, 0xE] + lsls r1, 16 + ldr r0, =0x03e70000 + cmp r1, r0 + bls _08084294 + bl set_max_playtime +_08084294: + pop {r0} + bx r0 + .pool + thumb_func_end gametime_increment + + thumb_func_start set_max_playtime +set_max_playtime: @ 80842A4 + ldr r1, =0x03000e08 + movs r0, 0x2 + strb r0, [r1] + ldr r2, =0x03005d90 + ldr r3, [r2] + ldr r0, =0x000003e7 + strh r0, [r3, 0xE] + movs r1, 0x3B + strb r1, [r3, 0x10] + ldr r0, [r2] + strb r1, [r0, 0x11] + ldr r0, [r2] + strb r1, [r0, 0x12] + bx lr + .pool + thumb_func_end set_max_playtime + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/player_pc.s b/asm/player_pc.s new file mode 100644 index 000000000..c5bd32370 --- /dev/null +++ b/asm/player_pc.s @@ -0,0 +1,3436 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_816ADF4 +sub_816ADF4: @ 816ADF4 + push {r4-r6,lr} + movs r4, 0 + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x93 + lsls r1, 3 + adds r0, r1 + movs r1, 0x32 + bl sub_80D6C7C + ldr r1, =gUnknown_085DFEFC + ldrh r0, [r1] + cmp r0, 0 + beq _0816AE48 + ldrh r0, [r1, 0x2] + cmp r0, 0 + beq _0816AE48 + adds r5, r1, 0 + adds r6, r5, 0x2 +_0816AE1A: + lsls r1, r4, 2 + adds r0, r1, r5 + ldrh r0, [r0] + adds r1, r6 + ldrh r1, [r1] + bl sub_80D6D70 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0816AE48 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, r4, 2 + adds r0, r1, r5 + ldrh r0, [r0] + cmp r0, 0 + beq _0816AE48 + adds r0, r1, r6 + ldrh r0, [r0] + cmp r0, 0 + bne _0816AE1A +_0816AE48: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816ADF4 + + thumb_func_start sub_816AE58 +sub_816AE58: @ 816AE58 + push {lr} + ldr r1, =0x0203bcb0 + ldr r0, =gUnknown_085DFED4 + str r0, [r1] + ldr r1, =0x0203bcb4 + movs r0, 0x4 + strb r0, [r1] + ldr r0, =TaskDummy + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_085E8D80 + ldr r2, =sub_816AED8 + bl DisplayItemMessageOnField + pop {r0} + bx r0 + .pool + thumb_func_end sub_816AE58 + + thumb_func_start sub_816AE98 +sub_816AE98: @ 816AE98 + push {lr} + ldr r1, =0x0203bcb0 + ldr r0, =gUnknown_085DFED8 + str r0, [r1] + ldr r1, =0x0203bcb4 + movs r0, 0x3 + strb r0, [r1] + ldr r0, =TaskDummy + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_085E8D80 + ldr r2, =sub_816AED8 + bl DisplayItemMessageOnField + pop {r0} + bx r0 + .pool + thumb_func_end sub_816AE98 + + thumb_func_start sub_816AED8 +sub_816AED8: @ 816AED8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r6, r0, r1 + ldr r0, =0x0203bcb4 + ldrb r1, [r0] + mov r8, r0 + cmp r1, 0x3 + bne _0816AF0C + ldr r0, =gUnknown_085DFF24 + ldr r1, [r0, 0x4] + ldr r0, [r0] + b _0816AF12 + .pool +_0816AF0C: + ldr r0, =gUnknown_085DFF24 + ldr r1, [r0, 0xC] + ldr r0, [r0, 0x8] +_0816AF12: + str r0, [sp] + str r1, [sp, 0x4] + ldr r5, =gUnknown_085DFEB4 + ldr r4, =0x0203bcb0 + ldr r1, [r4] + mov r0, r8 + ldrb r2, [r0] + adds r0, r5, 0 + bl sub_81DB3D8 + lsls r0, 24 + ldr r2, =0x00ffffff + ldr r1, [sp] + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + bl AddWindow + strh r0, [r6, 0x8] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl SetStandardWindowBorderStyle + ldrb r0, [r6, 0x8] + mov r2, r8 + ldrb r1, [r2] + ldr r3, [r4] + adds r2, r5, 0 + bl sub_81995E4 + ldrb r0, [r6, 0x8] + mov r2, r8 + ldrb r1, [r2] + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_816AF98 + str r1, [r0] + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816AED8 + + thumb_func_start sub_816AF98 +sub_816AF98: @ 816AF98 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldr r0, =0x0203bcb4 + ldrb r0, [r0] + cmp r0, 0x3 + bls _0816AFC0 + bl ProcessMenuInput + b _0816AFC4 + .pool +_0816AFC0: + bl ProcessMenuInputNoWrapAround +_0816AFC4: + lsls r0, 24 + lsrs r0, 24 + lsls r0, 24 + asrs r5, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r5, r0 + beq _0816B04C + adds r0, 0x1 + cmp r5, r0 + bne _0816B014 + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x8] + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4, 0x8] + bl ClearWindowTilemap + ldrb r0, [r4, 0x8] + bl RemoveWindow + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_816B148 + str r1, [r0] + b _0816B04C + .pool +_0816B014: + ldrb r0, [r4, 0x8] + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4, 0x8] + bl ClearWindowTilemap + ldrb r0, [r4, 0x8] + bl RemoveWindow + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r2, =gUnknown_085DFEB4 + ldr r0, =0x0203bcb0 + ldr r0, [r0] + adds r0, r5 + ldrb r0, [r0] + lsls r0, 3 + adds r2, 0x4 + adds r0, r2 + ldr r0, [r0] + str r0, [r1] +_0816B04C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816AF98 + + thumb_func_start sub_816B060 +sub_816B060: @ 816B060 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_085E8D80 + ldr r2, =sub_816AED8 + bl DisplayItemMessageOnField + pop {r0} + bx r0 + .pool + thumb_func_end sub_816B060 + + thumb_func_start task_pc_itemstorage +task_pc_itemstorage: @ 816B07C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl sub_816B190 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_816B248 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task_pc_itemstorage + + thumb_func_start sub_816B0A8 +sub_816B0A8: @ 816B0A8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + bl sub_816B510 + ldr r5, =0x0203bcb8 + movs r1, 0 + strb r0, [r5, 0x5] + lsls r0, 24 + cmp r0, 0 + bne _0816B0D8 + ldr r1, =gUnknown_085EAC4B + ldr r2, =sub_816B060 + adds r0, r4, 0 + bl DisplayItemMessageOnField + b _0816B12A + .pool +_0816B0D8: + strh r1, [r5] + strh r1, [r5, 0x2] + movs r0, 0xFF + strb r0, [r5, 0x9] + bl sub_816B54C + adds r0, r4, 0 + bl sub_816B4C0 + ldrb r0, [r5, 0x5] + bl sub_81D1C44 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0816B120 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + adds r0, r4, 0 + bl sub_816B5F8 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_816B674 + str r0, [r1] + b _0816B12A + .pool +_0816B120: + ldr r1, =gUnknown_085EAC4B + ldr r2, =sub_816B060 + adds r0, r6, 0 + bl DisplayItemMessageOnField +_0816B12A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816B0A8 + + thumb_func_start sub_816B138 +sub_816B138: @ 816B138 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_8126B2C + pop {r0} + bx r0 + thumb_func_end sub_816B138 + + thumb_func_start sub_816B148 +sub_816B148: @ 816B148 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0203bcb4 + ldrb r0, [r0] + cmp r0, 0x4 + bne _0816B180 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _0816B174 + ldr r0, =gUnknown_081F863F + bl script_env_1_execute_new_script + b _0816B184 + .pool +_0816B174: + ldr r0, =gUnknown_081F958F + bl script_env_1_execute_new_script + b _0816B184 + .pool +_0816B180: + bl script_env_2_enable_and_set_ctx_running +_0816B184: + adds r0, r4, 0 + bl DestroyTask + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816B148 + + thumb_func_start sub_816B190 +sub_816B190: @ 816B190 + push {r4-r6,lr} + sub sp, 0x8 + adds r5, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e08 + adds r4, r0 + ldr r0, =gUnknown_085DFF24 + ldr r1, [r0, 0x14] + ldr r0, [r0, 0x10] + str r0, [sp] + str r1, [sp, 0x4] + ldr r6, =gUnknown_085DFEDC + adds r0, r6, 0 + movs r1, 0x4 + bl GetMaxWidthInMenuTable + lsls r0, 24 + ldr r2, =0x00ffffff + ldr r1, [sp] + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + bl AddWindow + strh r0, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl SetStandardWindowBorderStyle + ldrb r0, [r4, 0x8] + movs r1, 0x4 + adds r2, r6, 0 + bl PrintMenuTable + ldrb r0, [r4, 0x8] + movs r1, 0x4 + adds r2, r5, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =gUnknown_085DFEA4 + lsls r5, 2 + adds r5, r0 + ldr r0, [r5] + bl sub_816B21C + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816B190 + + thumb_func_start sub_816B21C +sub_816B21C: @ 816B21C + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl Print + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816B21C + + thumb_func_start sub_816B248 +sub_816B248: @ 816B248 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + bl GetMenuCursorPos + lsls r0, 24 + lsrs r5, r0, 24 + bl ProcessMenuInput + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl GetMenuCursorPos + lsls r0, 24 + lsrs r2, r0, 24 + lsls r4, 24 + asrs r4, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _0816B298 + adds r0, 0x1 + cmp r4, r0 + beq _0816B2B4 + movs r0, 0x5 + bl audio_play + ldr r0, =gUnknown_085DFEDC + lsls r1, r4, 3 + adds r0, 0x4 + adds r1, r0 + ldr r1, [r1] + adds r0, r6, 0 + bl _call_via_r1 + b _0816B2C0 + .pool +_0816B298: + lsls r1, r5, 24 + lsls r0, r2, 24 + asrs r2, r0, 24 + cmp r1, r0 + beq _0816B2C0 + ldr r0, =gUnknown_085DFEA4 + lsls r1, r2, 2 + adds r1, r0 + ldr r0, [r1] + bl sub_816B21C + b _0816B2C0 + .pool +_0816B2B4: + movs r0, 0x5 + bl audio_play + adds r0, r6, 0 + bl sub_816B4A4 +_0816B2C0: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_816B248 + + thumb_func_start sub_816B2C8 +sub_816B2C8: @ 816B2C8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =sub_816B2F0 + str r0, [r1] + movs r0, 0x1 + movs r1, 0 + bl fade_screen + pop {r0} + bx r0 + .pool + thumb_func_end sub_816B2C8 + + thumb_func_start sub_816B2F0 +sub_816B2F0: @ 816B2F0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0816B310 + bl overworld_free_bg_tilemaps + bl sub_81AAC14 + adds r0, r4, 0 + bl DestroyTask +_0816B310: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816B2F0 + + thumb_func_start sub_816B31C +sub_816B31C: @ 816B31C + push {lr} + ldr r0, =0x03005dac + ldr r1, =mapldr_080EBC0C + str r1, [r0] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_816B31C + + thumb_func_start mapldr_080EBC0C +mapldr_080EBC0C: @ 816B33C + push {lr} + bl sub_81973A4 + movs r0, 0 + movs r1, 0x1 + bl sub_81973C4 + ldr r0, =sub_816B368 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_816B190 + bl pal_fill_black + pop {r0} + bx r0 + .pool + thumb_func_end mapldr_080EBC0C + + thumb_func_start sub_816B368 +sub_816B368: @ 816B368 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0816B388 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_816B248 + str r0, [r1] +_0816B388: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816B368 + + thumb_func_start sub_816B398 +sub_816B398: @ 816B398 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =0x03005e08 + adds r4, r0 + bl sub_80D6CE4 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2] + cmp r0, 0 + beq _0816B3C4 + adds r0, r5, 0 + movs r1, 0 + bl sub_816B430 + b _0816B3D4 + .pool +_0816B3C4: + adds r0, r5, 0 + bl sub_816B4DC + ldr r1, =gUnknown_085EABD1 + ldr r2, =task_pc_itemstorage + adds r0, r5, 0 + bl DisplayItemMessageOnField +_0816B3D4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816B398 + + thumb_func_start sub_816B3E4 +sub_816B3E4: @ 816B3E4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =0x03005e08 + adds r4, r0 + bl sub_80D6CE4 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x2] + cmp r0, 0 + beq _0816B410 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_816B430 + b _0816B420 + .pool +_0816B410: + adds r0, r5, 0 + bl sub_816B4DC + ldr r1, =gUnknown_085EABD1 + ldr r2, =task_pc_itemstorage + adds r0, r5, 0 + bl DisplayItemMessageOnField +_0816B420: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816B3E4 + + thumb_func_start sub_816B430 +sub_816B430: @ 816B430 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + ldr r6, =0x03005e08 + adds r0, r5, r6 + strh r1, [r0, 0x6] + adds r0, r4, 0 + bl sub_816B4DC + ldr r1, =0x0203bcb8 + movs r0, 0 + strh r0, [r1] + strh r0, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x9] + adds r0, r4, 0 + bl sub_816B4C0 + bl sub_816BC14 + bl gpu_pal_allocator_reset__manage_upper_four + bl sub_8122328 + ldr r0, =0x0203bcc4 + ldr r0, [r0] + movs r1, 0xCD + lsls r1, 3 + adds r0, r1 + movs r1, 0x7 + bl sub_8122344 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + subs r6, 0x8 + adds r5, r6 + ldr r0, =sub_816C158 + str r0, [r5] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816B430 + + thumb_func_start sub_816B4A4 +sub_816B4A4: @ 816B4A4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_816B4DC + adds r0, r4, 0 + bl sub_816B060 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816B4A4 + + thumb_func_start sub_816B4C0 +sub_816B4C0: @ 816B4C0 + push {lr} + ldr r1, =0x0203bcb8 + ldrb r0, [r1, 0x5] + cmp r0, 0x7 + bls _0816B4D4 + movs r0, 0x8 + b _0816B4D6 + .pool +_0816B4D4: + adds r0, 0x1 +_0816B4D6: + strb r0, [r1, 0x4] + pop {r0} + bx r0 + thumb_func_end sub_816B4C0 + + thumb_func_start sub_816B4DC +sub_816B4DC: @ 816B4DC + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e08 + adds r4, r0 + ldrb r0, [r4, 0x8] + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4, 0x8] + bl ClearWindowTilemap + ldrb r0, [r4, 0x8] + bl RemoveWindow + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816B4DC + + thumb_func_start sub_816B510 +sub_816B510: @ 816B510 + push {r4,lr} + movs r2, 0 + movs r1, 0x6 + ldr r0, =0x03005d8c + ldr r3, [r0] + movs r4, 0xB0 + lsls r4, 6 +_0816B51E: + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r3, r0 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0 + beq _0816B534 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_0816B534: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bls _0816B51E + adds r0, r2, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_816B510 + + thumb_func_start sub_816B54C +sub_816B54C: @ 816B54C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + movs r2, 0x6 +_0816B55A: + adds r1, r2, 0x1 + lsls r0, r1, 24 + lsrs r4, r0, 24 + mov r8, r1 + cmp r4, 0xF + bhi _0816B5D4 + ldr r0, =0x03005d8c + mov r10, r0 + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + mov r12, r0 + ldr r6, =0x00002be0 +_0816B574: + mov r1, r10 + ldr r1, [r1] + mov r9, r1 + mov r2, r9 + add r2, r12 + movs r3, 0xB0 + lsls r3, 6 + adds r0, r2, r3 + ldrh r0, [r0] + cmp r0, 0 + bne _0816B5CA + adds r2, r6 + mov r1, sp + adds r0, r2, 0 + ldm r0!, {r3,r5,r7} + stm r1!, {r3,r5,r7} + ldm r0!, {r3,r5,r7} + stm r1!, {r3,r5,r7} + ldm r0!, {r3,r5,r7} + stm r1!, {r3,r5,r7} + lsls r3, r4, 3 + adds r3, r4 + lsls r3, 2 + mov r5, r9 + adds r0, r5, r3 + adds r0, r6 + ldm r0!, {r1,r5,r7} + stm r2!, {r1,r5,r7} + ldm r0!, {r1,r5,r7} + stm r2!, {r1,r5,r7} + ldm r0!, {r1,r5,r7} + stm r2!, {r1,r5,r7} + mov r7, r10 + ldr r1, [r7] + adds r1, r3 + adds r1, r6 + mov r0, sp + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r5,r7} + stm r1!, {r2,r5,r7} +_0816B5CA: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _0816B574 +_0816B5D4: + mov r3, r8 + lsls r0, r3, 24 + lsrs r2, r0, 24 + cmp r2, 0xE + bls _0816B55A + 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_816B54C + + thumb_func_start sub_816B5F8 +sub_816B5F8: @ 816B5F8 + push {r4-r6,lr} + sub sp, 0xC + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0 + bl sub_81D1C84 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl sub_81D1C84 + ldr r6, =gUnknown_085EAB4E + movs r0, 0x1 + adds r1, r6, 0 + movs r2, 0x40 + bl GetStringCenterAlignXOffset + 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] + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r6, 0 + bl Print + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r4, =0x0203bcb8 + adds r0, r4, 0 + bl sub_81D1DC0 + ldr r2, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x12] + adds r0, r4, 0 + bl sub_81D1E90 + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816B5F8 + + thumb_func_start sub_816B674 +sub_816B674: @ 816B674 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + mov r9, r0 + ldr r0, =0x03005e08 + mov r10, r0 + mov r4, r9 + add r4, r10 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0816B71E + ldrb r0, [r4, 0xA] + bl ListMenuHandleInput + adds r6, r0, 0 + ldrb r0, [r4, 0xA] + ldr r7, =0x0203bcba + subs r1, r7, 0x2 + mov r8, r1 + adds r1, r7, 0 + mov r2, r8 + bl get_coro_args_x18_x1A + movs r0, 0x2 + negs r0, r0 + cmp r6, r0 + beq _0816B6D4 + adds r0, 0x1 + cmp r6, r0 + bne _0816B6EA + b _0816B71E + .pool +_0816B6D4: + movs r0, 0x5 + bl audio_play + mov r1, r8 + ldrb r0, [r1, 0x9] + bl RemoveScrollIndicatorArrowPair + adds r0, r5, 0 + bl sub_816B798 + b _0816B71E +_0816B6EA: + movs r0, 0x5 + bl audio_play + movs r0, 0 + bl sub_81D1D04 + movs r0, 0x1 + bl sub_81D1D04 + ldrb r0, [r4, 0xA] + adds r1, r7, 0 + mov r2, r8 + bl sub_81AE6C8 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + mov r1, r8 + ldrb r0, [r1, 0x9] + bl RemoveScrollIndicatorArrowPair + mov r0, r10 + subs r0, 0x8 + add r0, r9 + ldr r1, =sub_816B730 + str r1, [r0] +_0816B71E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816B674 + + thumb_func_start sub_816B730 +sub_816B730: @ 816B730 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =0x02021cc4 + ldr r2, =0x03005d8c + ldr r1, =0x0203bcb8 + ldrh r0, [r1] + adds r0, 0x6 + ldrh r1, [r1, 0x2] + adds r0, r1 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, [r2] + adds r1, r0 + ldr r0, =0x00002bf2 + adds r1, r0 + adds r0, r5, 0 + bl CopyString + adds r0, r5, 0 + movs r1, 0 + bl sub_81DB554 + ldr r5, =0x02021fc4 + ldr r1, =gUnknown_085EAC63 + adds r0, r5, 0 + bl ExpandStringRefs + ldr r2, =sub_816B7DC + adds r0, r4, 0 + adds r1, r5, 0 + bl DisplayItemMessageOnField + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816B730 + + thumb_func_start sub_816B798 +sub_816B798: @ 816B798 + 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, =0x03005e08 + adds r4, r0 + movs r0, 0 + bl sub_81D1D04 + movs r0, 0x1 + bl sub_81D1D04 + ldrb r0, [r4, 0xA] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + bl sub_81D1EC0 + adds r0, r5, 0 + bl sub_816B060 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816B798 + + thumb_func_start sub_816B7DC +sub_816B7DC: @ 816B7DC + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x2 + bl sub_81D1C84 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r2, =gUnknown_085DFF04 + adds r0, r4, 0 + movs r1, 0x4 + bl PrintMenuTable + adds r0, r4, 0 + movs r1, 0x4 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_816B82C + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816B7DC + + thumb_func_start sub_816B82C +sub_816B82C: @ 816B82C + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + bl ProcessMenuInput_other + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _0816B86E + adds r0, 0x1 + cmp r4, r0 + bne _0816B858 + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_816BBD4 + b _0816B86E +_0816B858: + movs r0, 0x5 + bl audio_play + ldr r0, =gUnknown_085DFF04 + lsls r1, r4, 3 + adds r0, 0x4 + adds r1, r0 + ldr r1, [r1] + adds r0, r6, 0 + bl _call_via_r1 +_0816B86E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816B82C + + thumb_func_start sub_816B878 +sub_816B878: @ 816B878 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_816B8A4 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816B878 + + thumb_func_start sub_816B8A4 +sub_816B8A4: @ 816B8A4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0816B8E6 + bl sub_81D1EC0 + bl overworld_free_bg_tilemaps + ldr r2, =0x03005d8c + ldr r1, =0x0203bcb8 + ldrh r0, [r1] + adds r0, 0x6 + ldrh r1, [r1, 0x2] + adds r0, r1 + 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_816B900 + movs r2, 0x1 + bl sub_8121478 + adds r0, r4, 0 + bl DestroyTask +_0816B8E6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816B8A4 + + thumb_func_start sub_816B900 +sub_816B900: @ 816B900 + push {lr} + ldr r0, =0x03005dac + ldr r1, =pal_fill_for_maplights_or_black + str r1, [r0] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_816B900 + + thumb_func_start pal_fill_for_maplights_or_black +pal_fill_for_maplights_or_black: @ 816B920 + push {r4,lr} + bl sub_81973A4 + ldr r0, =task00_080EBBDC + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0203bcb8 + ldrb r0, [r0, 0x5] + bl sub_81D1C44 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0816B954 + adds r0, r4, 0 + bl sub_816B5F8 + b _0816B95A + .pool +_0816B954: + adds r0, r4, 0 + bl DestroyTask +_0816B95A: + bl pal_fill_black + pop {r4} + pop {r0} + bx r0 + thumb_func_end pal_fill_for_maplights_or_black + + thumb_func_start task00_080EBBDC +task00_080EBBDC: @ 816B964 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0816B984 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_816B674 + str r0, [r1] +_0816B984: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task00_080EBBDC + + thumb_func_start sub_816B994 +sub_816B994: @ 816B994 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_085EAC8D + ldr r2, =sub_816B9B0 + bl DisplayItemMessageOnField + pop {r0} + bx r0 + .pool + thumb_func_end sub_816B994 + + thumb_func_start sub_816B9B0 +sub_816B9B0: @ 816B9B0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8197930 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_816B9D8 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816B9B0 + + thumb_func_start sub_816B9D8 +sub_816B9D8: @ 816B9D8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _0816BA04 + cmp r0, r1 + ble _0816BA10 + cmp r0, 0 + beq _0816B9FC + cmp r0, 0x1 + beq _0816BA0A + b _0816BA10 +_0816B9FC: + adds r0, r4, 0 + bl sub_816BA18 + b _0816BA10 +_0816BA04: + movs r0, 0x5 + bl audio_play +_0816BA0A: + adds r0, r4, 0 + bl sub_816BAAC +_0816BA10: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816B9D8 + + thumb_func_start sub_816BA18 +sub_816BA18: @ 816BA18 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, =0x03005d8c + ldr r4, =0x0203bcb8 + ldrh r1, [r4] + adds r1, 0x6 + ldrh r0, [r4, 0x2] + adds r1, r0 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x00002be0 + adds r0, r1 + ldr r1, [r2] + adds r5, r1, r0 + ldrh r0, [r5, 0x20] + movs r1, 0x1 + bl bag_add_item + lsls r0, 24 + cmp r0, 0 + bne _0816BA68 + ldr r1, =gUnknown_085EACB5 + ldr r2, =sub_816BBD4 + adds r0, r6, 0 + bl DisplayItemMessageOnField + b _0816BA9C + .pool +_0816BA68: + ldr r1, =gUnknown_085EACC8 + ldr r2, =sub_816BBD4 + adds r0, r6, 0 + bl DisplayItemMessageOnField + adds r0, r5, 0 + bl sub_80D439C + bl sub_816B54C + ldrb r0, [r4, 0x5] + subs r0, 0x1 + strb r0, [r4, 0x5] + ldrb r1, [r4, 0x5] + ldrb r0, [r4, 0x4] + ldrh r2, [r4, 0x2] + adds r0, r2 + cmp r1, r0 + bge _0816BA96 + cmp r2, 0 + beq _0816BA96 + subs r0, r2, 0x1 + strh r0, [r4, 0x2] +_0816BA96: + adds r0, r6, 0 + bl sub_816B4C0 +_0816BA9C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816BA18 + + thumb_func_start sub_816BAAC +sub_816BAAC: @ 816BAAC + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_816BBD4 + pop {r0} + bx r0 + thumb_func_end sub_816BAAC + + thumb_func_start sub_816BABC +sub_816BABC: @ 816BABC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl calc_player_party_count + lsls r0, 24 + cmp r0, 0 + bne _0816BAD4 + adds r0, r4, 0 + bl sub_816BBB8 + b _0816BAEA +_0816BAD4: + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_816BAF8 + str r0, [r1] +_0816BAEA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816BABC + + thumb_func_start sub_816BAF8 +sub_816BAF8: @ 816BAF8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0816BB1C + bl sub_81D1EC0 + bl overworld_free_bg_tilemaps + bl sub_81B8448 + adds r0, r4, 0 + bl DestroyTask +_0816BB1C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816BAF8 + + thumb_func_start sub_816BB28 +sub_816BB28: @ 816BB28 + push {lr} + ldr r0, =0x03005dac + ldr r1, =sub_816BB48 + str r1, [r0] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_816BB28 + + thumb_func_start sub_816BB48 +sub_816BB48: @ 816BB48 + push {r4-r6,lr} + ldr r0, =task00_080EBBDC + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, =0x0203bcb8 + ldrb r4, [r5, 0x5] + bl sub_816B510 + strb r0, [r5, 0x5] + bl sub_816B54C + ldrb r0, [r5, 0x5] + cmp r4, r0 + beq _0816BB7E + ldrb r1, [r5, 0x5] + ldrb r0, [r5, 0x4] + ldrh r2, [r5, 0x2] + adds r0, r2 + cmp r1, r0 + bge _0816BB7E + cmp r2, 0 + beq _0816BB7E + subs r0, r2, 0x1 + strh r0, [r5, 0x2] +_0816BB7E: + adds r0, r6, 0 + bl sub_816B4C0 + bl sub_81973A4 + ldr r0, =0x0203bcb8 + ldrb r0, [r0, 0x5] + bl sub_81D1C44 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0816BBA8 + adds r0, r6, 0 + bl sub_816B5F8 + b _0816BBAE + .pool +_0816BBA8: + adds r0, r6, 0 + bl DestroyTask +_0816BBAE: + bl pal_fill_black + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_816BB48 + + thumb_func_start sub_816BBB8 +sub_816BBB8: @ 816BBB8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_085E8DE9 + ldr r2, =sub_816BBD4 + bl DisplayItemMessageOnField + pop {r0} + bx r0 + .pool + thumb_func_end sub_816BBB8 + + thumb_func_start sub_816BBD4 +sub_816BBD4: @ 816BBD4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x2 + bl sub_81D1D04 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + adds r0, r4, 0 + bl sub_816B5F8 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_816B674 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816BBD4 + + thumb_func_start sub_816BC14 +sub_816BC14: @ 816BC14 + push {r4,lr} + ldr r4, =0x0203bcc4 + movs r0, 0xCE + lsls r0, 3 + bl AllocZeroed + str r0, [r4] + movs r1, 0xCC + lsls r1, 3 + adds r0, r1 + movs r1, 0xFF + movs r2, 0x6 + bl memset + ldr r0, [r4] + ldr r1, =0x00000666 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r4] + ldr r1, =0x00000667 + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816BC14 + + thumb_func_start sub_816BC58 +sub_816BC58: @ 816BC58 + push {r4,lr} + movs r4, 0 +_0816BC5C: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_816BCC4 + adds r4, 0x1 + cmp r4, 0x5 + bls _0816BC5C + ldr r0, =0x0203bcc4 + ldr r0, [r0] + bl Free + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816BC58 + + thumb_func_start sub_816BC7C +sub_816BC7C: @ 816BC7C + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x0203bcc4 + movs r3, 0xCC + lsls r3, 3 + adds r1, r2, r3 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _0816BCB4 + lsls r0, r2, 3 + ldr r1, =gUnknown_085DFF5C + adds r0, r1 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r2, 0x85 + lsls r2, 2 + movs r1, 0 + movs r3, 0xE + bl SetWindowBorderStyle + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram +_0816BCB4: + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_816BC7C + + thumb_func_start sub_816BCC4 +sub_816BCC4: @ 816BCC4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0203bcc4 + movs r2, 0xCC + lsls r2, 3 + adds r0, r2 + ldr r1, [r1] + adds r4, r1, r0 + ldrb r0, [r4] + cmp r0, 0xFF + beq _0816BCF8 + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + bl ClearWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldrb r0, [r4] + bl RemoveWindow + movs r0, 0xFF + strb r0, [r4] +_0816BCF8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816BCC4 + + thumb_func_start sub_816BD04 +sub_816BD04: @ 816BD04 + push {r4-r6,lr} + movs r6, 0 + ldr r0, =0x0203bcb8 + ldrb r0, [r0, 0x5] + subs r0, 0x1 + cmp r6, r0 + bge _0816BD58 + ldr r5, =0x0203bcc4 +_0816BD14: + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + movs r0, 0xCC + lsls r0, 1 + adds r4, r0 + ldr r0, [r5] + adds r0, r4 + ldr r1, =0x03005d8c + ldr r1, [r1] + lsls r2, r6, 2 + adds r1, r2 + movs r2, 0x93 + lsls r2, 3 + adds r1, r2 + ldrh r1, [r1] + bl sub_816BDC8 + ldr r0, [r5] + lsls r2, r6, 3 + adds r1, r0, r2 + adds r4, r0, r4 + str r4, [r1] + adds r0, 0x4 + adds r0, r2 + str r6, [r0] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =0x0203bcb8 + ldrb r0, [r0, 0x5] + subs r0, 0x1 + cmp r6, r0 + blt _0816BD14 +_0816BD58: + ldr r5, =0x0203bcc4 + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + movs r3, 0xCC + lsls r3, 1 + adds r4, r3 + ldr r0, [r5] + adds r0, r4 + ldr r1, =gUnknown_085E8CF7 + bl CopyString + ldr r0, [r5] + lsls r2, r6, 3 + adds r1, r0, r2 + adds r4, r0, r4 + str r4, [r1] + adds r0, 0x4 + adds r0, r2 + movs r1, 0x2 + negs r1, r1 + str r1, [r0] + ldr r4, =0x03006310 + adds r1, r4, 0 + ldr r0, =gUnknown_085DFF44 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + movs r0, 0 + bl sub_816BC7C + strb r0, [r4, 0x10] + ldr r1, =0x0203bcb8 + ldrb r0, [r1, 0x5] + strh r0, [r4, 0xC] + ldr r0, [r5] + str r0, [r4] + ldrb r0, [r1, 0x4] + strh r0, [r4, 0xE] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816BD04 + + thumb_func_start sub_816BDC8 +sub_816BDC8: @ 816BDC8 + push {lr} + adds r2, r0, 0 + lsls r0, r1, 16 + lsrs r0, 16 + adds r1, r2, 0 + bl itemid_get_name + pop {r0} + bx r0 + thumb_func_end sub_816BDC8 + + thumb_func_start sub_816BDDC +sub_816BDDC: @ 816BDDC + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + beq _0816BDEE + movs r0, 0x5 + bl audio_play +_0816BDEE: + ldr r0, =0x0203bcc4 + ldr r0, [r0] + ldr r1, =0x00000666 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _0816BE38 + bl sub_816C0C8 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _0816BE2C + ldr r0, =0x03005d8c + ldr r0, [r0] + lsls r1, r4, 2 + adds r0, r1 + movs r1, 0x93 + lsls r1, 3 + adds r0, r1 + ldrh r0, [r0] + bl sub_816C060 + b _0816BE32 + .pool +_0816BE2C: + ldr r0, =0x0000ffff + bl sub_816C060 +_0816BE32: + adds r0, r4, 0 + bl sub_816BEF0 +_0816BE38: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816BDDC + + thumb_func_start fish4_goto_x5_or_x6 +fish4_goto_x5_or_x6: @ 816BE44 + push {r4-r6,lr} + sub sp, 0xC + adds r4, r1, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r2, 24 + lsrs r5, r2, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _0816BED4 + ldr r0, =0x0203bcc4 + ldr r0, [r0] + ldr r1, =0x00000666 + adds r0, r1 + ldrb r1, [r0] + cmp r1, 0xFF + beq _0816BE8E + lsls r0, r4, 24 + lsrs r0, 24 + cmp r1, r0 + bne _0816BE84 + adds r0, r5, 0 + movs r1, 0 + movs r2, 0xFF + bl sub_816BFE0 + b _0816BE8E + .pool +_0816BE84: + adds r0, r5, 0 + movs r1, 0xFF + movs r2, 0xFF + bl sub_816BFE0 +_0816BE8E: + ldr r0, =0x02021cc4 + ldr r1, =0x03005d8c + ldr r1, [r1] + lsls r2, r4, 2 + adds r1, r2 + ldr r2, =0x0000049a + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E8DA0 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0x7 + adds r1, r4, 0 + movs r2, 0x68 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + str r5, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r6, 0 + movs r1, 0x7 + adds r2, r4, 0 + bl Print +_0816BED4: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end fish4_goto_x5_or_x6 + + thumb_func_start sub_816BEF0 +sub_816BEF0: @ 816BEF0 + push {r4,r5,lr} + sub sp, 0xC + adds r1, r0, 0 + ldr r0, =0x0203bcc4 + ldr r0, [r0] + ldr r2, =0x00000661 + adds r0, r2 + ldrb r5, [r0] + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _0816BF2C + ldr r0, =0x03005d8c + ldr r0, [r0] + lsls r1, 2 + adds r0, r1 + movs r1, 0x93 + lsls r1, 3 + adds r0, r1 + ldrh r0, [r0] + bl itemid_get_description + b _0816BF32 + .pool +_0816BF2C: + ldr r0, =0x0000ffff + bl sub_816C228 +_0816BF32: + adds r4, r0, 0 + adds r0, r5, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0x1 + 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 + movs r3, 0 + bl Print + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816BEF0 + + thumb_func_start sub_816BF60 +sub_816BF60: @ 816BF60 + push {r4,lr} + sub sp, 0x10 + ldr r4, =0x0203bcb8 + ldrb r0, [r4, 0x9] + cmp r0, 0xFF + bne _0816BF8C + ldrb r0, [r4, 0x5] + ldrb r1, [r4, 0x4] + subs r0, r1 + str r0, [sp] + ldr r0, =0x000013f8 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + adds r0, r4, 0x2 + str r0, [sp, 0xC] + movs r0, 0x2 + movs r1, 0xB0 + movs r2, 0xC + movs r3, 0x94 + bl AddScrollIndicatorArrowPairParametrized + strb r0, [r4, 0x9] +_0816BF8C: + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816BF60 + + thumb_func_start sub_816BF9C +sub_816BF9C: @ 816BF9C + push {r4,lr} + ldr r4, =0x0203bcb8 + ldrb r0, [r4, 0x9] + cmp r0, 0xFF + beq _0816BFAE + bl RemoveScrollIndicatorArrowPair + movs r0, 0xFF + strb r0, [r4, 0x9] +_0816BFAE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816BF9C + + thumb_func_start sub_816BFB8 +sub_816BFB8: @ 816BFB8 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + bl ListMenuGetYCoordForPrintingArrowCursor + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_816BFE0 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_816BFB8 + + thumb_func_start sub_816BFE0 +sub_816BFE0: @ 816BFE0 + push {r4-r6,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =0x0203bcc4 + ldr r0, [r0] + movs r3, 0xCC + lsls r3, 3 + adds r0, r3 + ldrb r5, [r0] + cmp r1, 0xFF + bne _0816C030 + 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] + adds r0, r5, 0 + movs r1, 0x11 + movs r2, 0 + adds r3, r6, 0 + bl FillWindowPixelRect + b _0816C050 + .pool +_0816C030: + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + ldr r0, =gUnknown_085DFF8C + str r0, [sp, 0x8] + lsls r0, r2, 24 + asrs r0, 24 + str r0, [sp, 0xC] + ldr r0, =gUnknown_085E8D60 + str r0, [sp, 0x10] + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0 + adds r3, r6, 0 + bl AddTextPrinterParametrized2 +_0816C050: + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816BFE0 + + thumb_func_start sub_816C060 +sub_816C060: @ 816C060 + push {r4-r6,lr} + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =0x0203bcc4 + ldr r0, [r0] + ldr r1, =0x00000667 + adds r5, r0, r1 + ldrb r0, [r5] + cmp r0, 0xFF + bne _0816C0B2 + ldr r4, =0x000013f6 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r6, 0 + bl AddItemIconObject + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _0816C0B2 + strb r2, [r5] + ldr r0, =0x02020630 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] + movs r0, 0x18 + strh r0, [r1, 0x24] + movs r0, 0x50 + strh r0, [r1, 0x26] +_0816C0B2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816C060 + + thumb_func_start sub_816C0C8 +sub_816C0C8: @ 816C0C8 + push {r4,r5,lr} + ldr r0, =0x0203bcc4 + ldr r0, [r0] + ldr r1, =0x00000667 + adds r5, r0, r1 + ldrb r0, [r5] + cmp r0, 0xFF + beq _0816C0FA + ldr r4, =0x000013f6 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + movs r0, 0xFF + strb r0, [r5] +_0816C0FA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816C0C8 + + thumb_func_start sub_816C110 +sub_816C110: @ 816C110 + push {lr} + sub sp, 0x4 + bl sub_80D6E84 + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x93 + lsls r1, 3 + adds r0, r1 + ldr r2, =0x0203bcbc + adds r3, r2, 0x1 + movs r1, 0x8 + str r1, [sp] + movs r1, 0x32 + bl atk2D_jumpifarraynotequal + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_816C110 + + thumb_func_start sub_816C140 +sub_816C140: @ 816C140 + push {lr} + ldr r0, =0x0203bcba + subs r1, r0, 0x2 + ldrb r2, [r1, 0x4] + ldrb r3, [r1, 0x5] + bl sub_812225C + pop {r0} + bx r0 + .pool + thumb_func_end sub_816C140 + + thumb_func_start sub_816C158 +sub_816C158: @ 816C158 + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r7, r0, r1 + movs r4, 0 +_0816C16C: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_816BC7C + adds r4, 0x1 + cmp r4, 0x3 + bls _0816C16C + movs r1, 0x6 + ldrsh r0, [r7, r1] + ldr r5, =gUnknown_085EAB71 + cmp r0, 0 + bne _0816C186 + ldr r5, =gUnknown_085EAB63 +_0816C186: + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x68 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + ldr r4, =0x0203bcc4 + ldr r0, [r4] + ldr r1, =0x00000663 + adds r0, r1 + ldrb r0, [r0] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x1 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + bl Print + ldr r0, [r4] + ldr r1, =0x00000662 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x2 + bl CopyWindowToVram + bl sub_816C110 + bl sub_816C140 + bl sub_816BD04 + ldr r0, =0x03006310 + ldr r2, =0x0203bcb8 + ldrh r1, [r2, 0x2] + ldrh r2, [r2] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0xA] + bl sub_816BF60 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_816C30C + str r1, [r0] + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816C158 + + thumb_func_start sub_816C228 +sub_816C228: @ 816C228 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r2, =0xffff0009 + adds r0, r1, r2 + cmp r0, 0x8 + bhi _0816C2B4 + lsls r0, 2 + ldr r1, =_0816C248 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0816C248: + .4byte _0816C2AC + .4byte _0816C2A4 + .4byte _0816C29C + .4byte _0816C294 + .4byte _0816C28C + .4byte _0816C284 + .4byte _0816C27C + .4byte _0816C274 + .4byte _0816C26C +_0816C26C: + ldr r0, =gUnknown_085E8D62 + b _0816C2BA + .pool +_0816C274: + ldr r0, =gUnknown_085EAC09 + b _0816C2BA + .pool +_0816C27C: + ldr r0, =gUnknown_085EAC22 + b _0816C2BA + .pool +_0816C284: + ldr r0, =gUnknown_085E8EE0 + b _0816C2BA + .pool +_0816C28C: + ldr r0, =gUnknown_085E8EF9 + b _0816C2BA + .pool +_0816C294: + ldr r0, =gUnknown_085EABE7 + b _0816C2BA + .pool +_0816C29C: + ldr r0, =gUnknown_085E8EB9 + b _0816C2BA + .pool +_0816C2A4: + ldr r0, =gUnknown_085E8F0E + b _0816C2BA + .pool +_0816C2AC: + ldr r0, =gUnknown_085E8DFE + b _0816C2BA + .pool +_0816C2B4: + adds r0, r1, 0 + bl itemid_get_description +_0816C2BA: + pop {r1} + bx r1 + thumb_func_end sub_816C228 + + thumb_func_start sub_816C2C0 +sub_816C2C0: @ 816C2C0 + push {r4-r6,lr} + sub sp, 0xC + adds r6, r0, 0 + ldr r0, =0x0203bcc4 + ldr r0, [r0] + ldr r1, =0x00000661 + adds r0, r1 + ldrb r5, [r0] + adds r0, r5, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r4, =0x02021fc4 + adds r0, r4, 0 + adds r1, r6, 0 + bl ExpandStringRefs + movs r0, 0x1 + 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 + movs r3, 0 + bl Print + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816C2C0 + + thumb_func_start sub_816C30C +sub_816C30C: @ 816C30C + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0816C35C + ldrb r0, [r4, 0xA] + ldr r1, =0x0203bcba + subs r4, r1, 0x2 + adds r2, r4, 0 + bl get_coro_args_x18_x1A + ldrh r1, [r4, 0x2] + ldrh r0, [r4] + adds r1, r0 + ldrb r0, [r4, 0x5] + subs r0, 0x1 + cmp r1, r0 + beq _0816C39E + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_816C450 + b _0816C39E + .pool +_0816C35C: + ldrb r0, [r4, 0xA] + bl ListMenuHandleInput + adds r6, r0, 0 + ldrb r0, [r4, 0xA] + ldr r1, =0x0203bcba + subs r2, r1, 0x2 + bl get_coro_args_x18_x1A + movs r0, 0x2 + negs r0, r0 + cmp r6, r0 + beq _0816C384 + adds r0, 0x1 + cmp r6, r0 + bne _0816C392 + b _0816C39E + .pool +_0816C384: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_816C400 + b _0816C39E +_0816C392: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_816C71C +_0816C39E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_816C30C + + thumb_func_start bx_battle_menu_t3 +bx_battle_menu_t3: @ 816C3A4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0816C3F2 + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + movs r1, 0x6 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0816C3DC + adds r0, r4, 0 + movs r1, 0 + bl sub_816B190 + b _0816C3E4 + .pool +_0816C3DC: + adds r0, r4, 0 + movs r1, 0x2 + bl sub_816B190 +_0816C3E4: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_816B248 + str r0, [r1] +_0816C3F2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end bx_battle_menu_t3 + + thumb_func_start sub_816C400 +sub_816C400: @ 816C400 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r6, =0x03005e08 + adds r5, r4, r6 + bl sub_816C0C8 + bl sub_816BF9C + ldrb r0, [r5, 0xA] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldr r0, =0x0203bcc4 + ldr r0, [r0] + movs r1, 0xCD + lsls r1, 3 + adds r0, r1 + movs r1, 0x7 + bl sub_81223B0 + bl sub_816BC58 + subs r6, 0x8 + adds r4, r6 + ldr r0, =bx_battle_menu_t3 + str r0, [r4] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816C400 + + thumb_func_start sub_816C450 +sub_816C450: @ 816C450 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e08 + mov r8, r0 + adds r1, r4, 0 + add r1, r8 + mov r9, r1 + ldrb r0, [r1, 0xA] + movs r1, 0x10 + movs r2, 0x1 + bl sub_81AF15C + ldr r6, =0x0203bcc4 + ldr r2, [r6] + ldr r1, =0x0203bcb8 + ldrb r0, [r1] + ldrb r1, [r1, 0x2] + adds r0, r1 + ldr r5, =0x00000666 + adds r2, r5 + strb r0, [r2] + mov r1, r9 + ldrb r0, [r1, 0xA] + movs r1, 0 + movs r2, 0 + bl sub_816BFB8 + ldr r0, [r6] + adds r0, r5 + ldrb r0, [r0] + bl sub_816C690 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, [r6] + adds r0, r5 + ldrb r0, [r0] + lsls r0, 2 + adds r1, r0 + movs r0, 0x93 + lsls r0, 3 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =0x02021cc4 + bl itemid_get_name + ldr r0, =0x0000fff7 + bl sub_816C228 + bl sub_816C2C0 + movs r1, 0x8 + negs r1, r1 + add r8, r1 + add r4, r8 + ldr r0, =sub_816C4FC + str r0, [r4] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816C450 + + thumb_func_start sub_816C4FC +sub_816C4FC: @ 816C4FC + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldr r7, =0x030022c0 + ldrh r1, [r7, 0x2E] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0816C530 + ldrb r0, [r4, 0xA] + ldr r1, =0x0203bcba + subs r2, r1, 0x2 + bl get_coro_args_x18_x1A + b _0816C57E + .pool +_0816C530: + ldrb r0, [r4, 0xA] + bl ListMenuHandleInput + adds r6, r0, 0 + ldrb r0, [r4, 0xA] + ldr r1, =0x0203bcba + subs r4, r1, 0x2 + adds r2, r4, 0 + bl get_coro_args_x18_x1A + ldr r0, =0x0203bcc4 + ldr r0, [r0] + movs r1, 0xCD + lsls r1, 3 + adds r0, r1 + movs r1, 0x7 + movs r2, 0 + bl sub_81223FC + ldrb r0, [r4] + bl sub_816C690 + movs r0, 0x2 + negs r0, r0 + cmp r6, r0 + beq _0816C574 + adds r0, 0x1 + cmp r6, r0 + bne _0816C592 + b _0816C59A + .pool +_0816C574: + ldrh r1, [r7, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0816C588 +_0816C57E: + adds r0, r5, 0 + movs r1, 0 + bl sub_816C5A0 + b _0816C59A +_0816C588: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_816C5A0 + b _0816C59A +_0816C592: + adds r0, r5, 0 + movs r1, 0 + bl sub_816C5A0 +_0816C59A: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_816C4FC + + thumb_func_start sub_816C5A0 +sub_816C5A0: @ 816C5A0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r1, 0 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r0, r1 + mov r8, r0 + ldr r4, =0x0203bcb8 + ldrh r0, [r4] + ldrh r1, [r4, 0x2] + adds r0, r1 + lsls r0, 16 + lsrs r6, r0, 16 + movs r0, 0x5 + bl audio_play + mov r2, r8 + ldrb r0, [r2, 0xA] + adds r1, r4, 0x2 + adds r2, r4, 0 + bl sub_81AE6C8 + cmp r5, 0 + bne _0816C60A + ldr r1, =0x0203bcc4 + ldr r0, [r1] + ldr r2, =0x00000666 + adds r0, r2 + ldrb r2, [r0] + adds r4, r1, 0 + cmp r2, r6 + beq _0816C622 + subs r0, r6, 0x1 + cmp r2, r0 + beq _0816C60A + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x93 + lsls r1, 3 + adds r0, r1 + adds r1, r2, 0 + adds r2, r6, 0 + bl sub_80D702C + bl sub_816BD04 +_0816C60A: + ldr r0, =0x0203bcc4 + ldr r1, [r0] + ldr r2, =0x00000666 + adds r1, r2 + ldrb r1, [r1] + adds r4, r0, 0 + cmp r1, r6 + bcs _0816C622 + ldr r1, =0x0203bcb8 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] +_0816C622: + ldr r0, [r4] + movs r1, 0xCD + lsls r1, 3 + adds r0, r1 + movs r1, 0x7 + movs r2, 0x1 + bl sub_81223FC + ldr r0, [r4] + ldr r2, =0x00000666 + adds r0, r2 + movs r1, 0xFF + strb r1, [r0] + ldr r0, =0x03006310 + ldr r2, =0x0203bcb8 + ldrh r1, [r2, 0x2] + ldrh r2, [r2] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + strh r0, [r1, 0xA] + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_816C30C + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816C5A0 + + thumb_func_start sub_816C690 +sub_816C690: @ 816C690 + push {lr} + adds r3, r0, 0 + lsls r3, 24 + ldr r0, =0x0203bcc4 + ldr r0, [r0] + movs r1, 0xCD + lsls r1, 3 + adds r0, r1 + lsrs r3, 4 + movs r1, 0x80 + lsls r1, 13 + adds r3, r1 + lsrs r3, 16 + movs r1, 0x7 + movs r2, 0x80 + bl sub_8122448 + pop {r0} + bx r0 + .pool + thumb_func_end sub_816C690 + + thumb_func_start sub_816C6BC +sub_816C6BC: @ 816C6BC + push {r4-r6,lr} + sub sp, 0xC + adds r6, r0, 0 + ldr r5, [sp, 0x1C] + ldr r3, [sp, 0x20] + lsls r6, 24 + lsrs r6, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r5, 24 + lsrs r5, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =0x02021cc4 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E8DA0 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x30 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + str r5, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + adds r0, r6, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl Print + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816C6BC + + thumb_func_start sub_816C71C +sub_816C71C: @ 816C71C + push {r4-r6,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r6, r0, r1 + ldr r1, =0x0203bcb8 + ldrh r0, [r1, 0x2] + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + bl sub_816BF9C + movs r0, 0x1 + strh r0, [r6, 0x4] + movs r1, 0x6 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0816C798 + ldr r0, =0x03005d8c + ldr r1, [r0] + lsls r0, r4, 2 + adds r1, r0 + ldr r2, =0x0000049a + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, 0x1 + bne _0816C774 + adds r0, r5, 0 + bl sub_816C8FC + b _0816C7FE + .pool +_0816C774: + movs r2, 0x93 + lsls r2, 3 + adds r0, r1, r2 + ldrh r0, [r0] + ldr r1, =0x02021cc4 + bl itemid_get_name + ldr r0, =0x0000fffe + bl sub_816C228 + bl sub_816C2C0 + b _0816C7D4 + .pool +_0816C798: + ldr r0, =0x03005d8c + ldr r1, [r0] + lsls r0, r4, 2 + adds r1, r0 + ldr r2, =0x0000049a + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, 0x1 + bne _0816C7BC + adds r0, r5, 0 + bl sub_816C9B8 + b _0816C7FE + .pool +_0816C7BC: + movs r2, 0x93 + lsls r2, 3 + adds r0, r1, r2 + ldrh r0, [r0] + ldr r1, =0x02021cc4 + bl itemid_get_name + ldr r0, =0x0000fffc + bl sub_816C228 + bl sub_816C2C0 +_0816C7D4: + movs r0, 0x4 + bl sub_816BC7C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x4] + movs r2, 0x1 + str r2, [sp] + movs r2, 0x3 + str r2, [sp, 0x4] + movs r2, 0x2 + movs r3, 0x8 + bl sub_816C6BC + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_816C818 + str r1, [r0] +_0816C7FE: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816C71C + + thumb_func_start sub_816C818 +sub_816C818: @ 816C818 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r5, r0, 24 + mov r9, r5 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r6, r0, r1 + ldr r0, =0x0203bcb8 + ldrh r2, [r0, 0x2] + ldrh r0, [r0] + adds r2, r0 + lsls r2, 16 + adds r0, r6, 0x4 + ldr r1, =0x03005d8c + mov r8, r1 + ldr r1, [r1] + lsrs r7, r2, 14 + adds r1, r7 + ldr r2, =0x0000049a + adds r1, r2 + ldrh r1, [r1] + bl AdjustQuantityAccordingToDPadInput + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bne _0816C888 + movs r0, 0x4 + bl sub_816BC7C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x4] + str r4, [sp] + movs r2, 0x3 + str r2, [sp, 0x4] + movs r2, 0x2 + movs r3, 0x8 + bl sub_816C6BC + b _0816C8EC + .pool +_0816C888: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0816C8BC + movs r0, 0x5 + bl audio_play + movs r0, 0x4 + bl sub_816BCC4 + movs r3, 0x6 + ldrsh r0, [r6, r3] + cmp r0, 0 + bne _0816C8B4 + adds r0, r5, 0 + bl sub_816C8FC + b _0816C8EC + .pool +_0816C8B4: + adds r0, r5, 0 + bl sub_816C9B8 + b _0816C8EC +_0816C8BC: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0816C8EC + movs r0, 0x5 + bl audio_play + movs r0, 0x4 + bl sub_816BCC4 + mov r1, r8 + ldr r0, [r1] + adds r0, r7 + movs r2, 0x93 + lsls r2, 3 + adds r0, r2 + ldrh r0, [r0] + bl sub_816C228 + bl sub_816C2C0 + mov r0, r9 + bl sub_816CBC0 +_0816C8EC: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_816C818 + + thumb_func_start sub_816C8FC +sub_816C8FC: @ 816C8FC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r6, r1, 3 + ldr r0, =0x03005e08 + mov r8, r0 + adds r4, r6, r0 + ldr r0, =0x0203bcb8 + ldrh r1, [r0, 0x2] + ldrh r0, [r0] + adds r1, r0 + lsls r1, 16 + ldr r7, =0x03005d8c + ldr r0, [r7] + lsrs r5, r1, 14 + adds r0, r5 + movs r1, 0x93 + lsls r1, 3 + adds r0, r1 + ldrh r0, [r0] + ldrh r1, [r4, 0x4] + bl bag_add_item + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0816C98C + ldr r0, [r7] + adds r0, r5 + movs r2, 0x93 + lsls r2, 3 + adds r0, r2 + ldrh r0, [r0] + ldr r1, =0x02021cc4 + bl itemid_get_name + ldr r0, =0x02021dc4 + movs r2, 0x4 + ldrsh r1, [r4, r2] + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r0, =0x0000fffd + bl sub_816C228 + bl sub_816C2C0 + mov r0, r8 + subs r0, 0x8 + adds r0, r6, r0 + ldr r1, =sub_816CB04 + b _0816C9A2 + .pool +_0816C98C: + movs r0, 0 + strh r0, [r4, 0x4] + ldr r0, =0x0000fffa + bl sub_816C228 + bl sub_816C2C0 + mov r0, r8 + subs r0, 0x8 + adds r0, r6, r0 + ldr r1, =sub_816CB74 +_0816C9A2: + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816C8FC + + thumb_func_start sub_816C9B8 +sub_816C9B8: @ 816C9B8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + mov r8, r0 + ldr r0, =0x03005e08 + mov r9, r0 + mov r7, r8 + add r7, r9 + ldr r0, =0x0203bcb8 + ldrh r1, [r0, 0x2] + ldrh r0, [r0] + adds r1, r0 + lsls r1, 16 + ldr r6, =0x03005d8c + ldr r0, [r6] + lsrs r4, r1, 14 + adds r0, r4 + movs r1, 0x93 + lsls r1, 3 + adds r0, r1 + ldrh r0, [r0] + bl itemid_is_unique + lsls r0, 24 + cmp r0, 0 + bne _0816CA64 + ldr r0, [r6] + adds r0, r4 + movs r2, 0x93 + lsls r2, 3 + adds r0, r2 + ldrh r0, [r0] + ldr r1, =0x02021cc4 + bl itemid_get_name + ldr r0, =0x02021dc4 + movs r2, 0x4 + ldrsh r1, [r7, r2] + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r0, =0x0000fff8 + bl sub_816C228 + bl sub_816C2C0 + ldr r1, =gUnknown_085DFF84 + movs r0, 0x1 + str r0, [sp] + movs r0, 0x85 + lsls r0, 2 + str r0, [sp, 0x4] + movs r0, 0xE + str r0, [sp, 0x8] + ldr r0, =gUnknown_085DFF3C + str r0, [sp, 0xC] + adds r0, r5, 0 + movs r2, 0x1 + movs r3, 0 + bl CreateYesNoMenuWithCallbacks + b _0816CA7C + .pool +_0816CA64: + movs r0, 0 + strh r0, [r7, 0x4] + ldr r0, =0x0000fff9 + bl sub_816C228 + bl sub_816C2C0 + mov r0, r9 + subs r0, 0x8 + add r0, r8 + ldr r1, =sub_816CB74 + str r1, [r0] +_0816CA7C: + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816C9B8 + + thumb_func_start sub_816CA94 +sub_816CA94: @ 816CA94 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x0000fffb + bl sub_816C228 + bl sub_816C2C0 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_816CB04 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816CA94 + + thumb_func_start sub_816CAC8 +sub_816CAC8: @ 816CAC8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r1, =0x0203bcb8 + ldrh r0, [r1, 0x2] + ldrh r1, [r1] + adds r0, r1 + lsls r0, 2 + adds r2, r0 + movs r0, 0x93 + lsls r0, 3 + adds r2, r0 + ldrh r0, [r2] + bl sub_816C228 + bl sub_816C2C0 + adds r0, r4, 0 + bl sub_816CBC0 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816CAC8 + + thumb_func_start sub_816CB04 +sub_816CB04: @ 816CB04 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0816CB5E + ldr r4, =0x0203bcb8 + ldrb r0, [r4, 0x2] + ldrb r1, [r4] + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x4] + bl sub_80D6E48 + ldrb r0, [r5, 0xA] + adds r1, r4, 0x2 + adds r2, r4, 0 + bl sub_81AE6C8 + bl sub_816C110 + bl sub_816C140 + bl sub_816BD04 + ldr r0, =0x03006310 + ldrh r1, [r4, 0x2] + ldrh r2, [r4] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xA] + adds r0, r6, 0 + bl sub_816CBC0 +_0816CB5E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816CB04 + + thumb_func_start sub_816CB74 +sub_816CB74: @ 816CB74 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0816CBAC + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r1, =0x0203bcb8 + ldrh r0, [r1, 0x2] + ldrh r1, [r1] + adds r0, r1 + lsls r0, 2 + adds r2, r0 + movs r0, 0x93 + lsls r0, 3 + adds r2, r0 + ldrh r0, [r2] + bl sub_816C228 + bl sub_816C2C0 + adds r0, r4, 0 + bl sub_816CBC0 +_0816CBAC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816CB74 + + thumb_func_start sub_816CBC0 +sub_816CBC0: @ 816CBC0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_816BF60 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_816C30C + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816CBC0 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/pokedex.s b/asm/pokedex.s new file mode 100644 index 000000000..73ed5b324 --- /dev/null +++ b/asm/pokedex.s @@ -0,0 +1,13372 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80BB2D0 +sub_80BB2D0: @ 80BB2D0 + push {r4-r6,lr} + ldr r0, =0x02039b50 + movs r2, 0 + strh r2, [r0] + ldr r1, =0x02039b52 + movs r0, 0x40 + strb r0, [r1] + ldr r0, =0x030060b0 + strb r2, [r0] + ldr r4, =0x03005d90 + ldr r0, [r4] + movs r1, 0 + strb r2, [r0, 0x19] + ldr r0, [r4] + strb r2, [r0, 0x18] + ldr r0, [r4] + strb r2, [r0, 0x1A] + ldr r0, [r4] + strb r2, [r0, 0x1B] + ldr r0, [r4] + str r1, [r0, 0x1C] + str r1, [r0, 0x20] + str r1, [r0, 0x24] + bl sub_809D3C0 + movs r1, 0 + movs r2, 0 + ldr r3, =0x03005d8c + ldr r6, =0x00000988 + ldr r5, =0x00003b24 +_080BB30C: + ldr r0, [r4] + adds r0, 0x28 + adds r0, r1 + strb r2, [r0] + ldr r0, [r4] + adds r0, 0x5C + adds r0, r1 + strb r2, [r0] + ldr r0, [r3] + adds r0, r6 + adds r0, r1 + strb r2, [r0] + ldr r0, [r3] + adds r0, r5 + adds r0, r1 + strb r2, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x33 + bls _080BB30C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BB2D0 + + thumb_func_start sub_80BB358 +sub_80BB358: @ 80BB358 + ldr r1, =0x02039b50 + movs r0, 0 + strh r0, [r1] + ldr r1, =0x02039b52 + movs r0, 0x40 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_80BB358 + + thumb_func_start sub_80BB370 +sub_80BB370: @ 80BB370 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_80BB370 + + thumb_func_start sub_80BB384 +sub_80BB384: @ 80BB384 + push {r4-r7,lr} + adds r4, r0, 0 + movs r3, 0 + ldr r0, =0x0000ffff + adds r7, r0, 0 + movs r1, 0x2 + negs r1, r1 + mov r12, r1 + movs r6, 0x3 + negs r6, r6 + ldr r5, =0x00000181 +_080BB39A: + lsls r1, r3, 2 + adds r1, r4, r1 + ldrh r0, [r1] + orrs r0, r7 + strh r0, [r1] + ldrb r2, [r1, 0x2] + mov r0, r12 + ands r0, r2 + ands r0, r6 + strb r0, [r1, 0x2] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r5 + bls _080BB39A + movs r2, 0xC1 + lsls r2, 3 + adds r0, r4, r2 + movs r2, 0 + strh r2, [r0] + ldr r0, =0x0000060a + adds r3, r4, r0 + ldrb r1, [r3] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + movs r1, 0x3 + negs r1, r1 + ands r0, r1 + strb r0, [r3] + ldr r1, =0x0000060c + adds r0, r4, r1 + strh r2, [r0] + ldr r3, =0x0000060e + adds r0, r4, r3 + strh r2, [r0] + adds r1, 0x4 + adds r0, r4, r1 + strh r2, [r0] + adds r3, 0x4 + adds r0, r4, r3 + strh r2, [r0] + adds r1, 0x4 + adds r0, r4, r1 + strh r2, [r0] + adds r3, 0x4 + adds r0, r4, r3 + strh r2, [r0] + adds r1, 0x4 + adds r0, r4, r1 + strh r2, [r0] + adds r3, 0x4 + adds r0, r4, r3 + strh r2, [r0] + adds r1, 0x4 + adds r0, r4, r1 + strh r2, [r0] + movs r3, 0 + ldr r0, =0x0000061e + adds r2, r4, r0 + ldr r1, =0x0000ffff + adds r5, r1, 0 +_080BB416: + lsls r0, r3, 1 + adds r0, r2, r0 + ldrh r1, [r0] + orrs r1, r5 + strh r1, [r0] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x3 + bls _080BB416 + movs r2, 0xC5 + lsls r2, 3 + adds r0, r4, r2 + movs r2, 0 + movs r1, 0 + strh r1, [r0] + ldr r3, =0x0000062a + adds r0, r4, r3 + strh r1, [r0] + adds r3, 0x2 + adds r0, r4, r3 + strb r2, [r0] + adds r3, 0x1 + adds r0, r4, r3 + strb r2, [r0] + adds r3, 0x1 + adds r0, r4, r3 + strb r2, [r0] + adds r3, 0x1 + adds r0, r4, r3 + strb r2, [r0] + movs r2, 0xC6 + lsls r2, 3 + adds r0, r4, r2 + strh r1, [r0] + adds r3, 0x3 + adds r0, r4, r3 + strh r1, [r0] + adds r2, 0x4 + adds r0, r4, r2 + strh r1, [r0] + adds r3, 0x4 + adds r0, r4, r3 + strh r1, [r0] + adds r2, 0x4 + adds r0, r4, r2 + strh r1, [r0] + movs r3, 0 + ldr r0, =0x0000063a + adds r1, r4, r0 + movs r2, 0 +_080BB47C: + lsls r0, r3, 1 + adds r0, r1, r0 + strh r2, [r0] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x3 + bls _080BB47C + ldr r1, =0x0000064a + adds r0, r4, r1 + movs r1, 0 + strb r1, [r0] + ldr r2, =0x0000064b + adds r0, r4, r2 + strb r1, [r0] + ldr r0, =0x0000064c + adds r3, r4, r0 + ldrb r2, [r3] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r3] + ldr r2, =0x0000064d + adds r0, r4, r2 + strb r1, [r0] + ldr r3, =0x0000064e + adds r0, r4, r3 + strb r1, [r0] + adds r2, 0x2 + adds r0, r4, r2 + strb r1, [r0] + adds r3, 0x2 + adds r0, r4, r3 + strh r1, [r0] + adds r2, 0x3 + adds r0, r4, r2 + strh r1, [r0] + movs r3, 0 + ldr r0, =0x00000654 + adds r1, r4, r0 + movs r2, 0 +_080BB4CE: + adds r0, r1, r3 + strb r2, [r0] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x7 + bls _080BB4CE + movs r3, 0 + ldr r2, =0x0000065c + adds r1, r4, r2 + movs r2, 0 +_080BB4E4: + adds r0, r1, r3 + strb r2, [r0] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x7 + bls _080BB4E4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BB384 + + thumb_func_start sub_80BB534 +sub_80BB534: @ 80BB534 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0x1 + beq _080BB5FC + cmp r0, 0x1 + ble _080BB558 + cmp r0, 0x2 + beq _080BB628 + cmp r0, 0x3 + bne _080BB558 + b _080BB71C +_080BB558: + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl sub_80C09B0 + movs r3, 0xC0 + lsls r3, 19 + movs r4, 0xC0 + lsls r4, 9 + add r2, sp, 0x4 + mov r8, r2 + mov r2, sp + movs r6, 0 + ldr r1, =0x040000d4 + movs r5, 0x80 + lsls r5, 5 + ldr r7, =0x81000800 + movs r0, 0x81 + lsls r0, 24 + mov r12, r0 +_080BB582: + strh r6, [r2] + mov r0, sp + str r0, [r1] + str r3, [r1, 0x4] + str r7, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r3, r5 + subs r4, r5 + cmp r4, r5 + bhi _080BB582 + strh r6, [r2] + mov r2, sp + str r2, [r1] + str r3, [r1, 0x4] + lsrs r0, r4, 1 + mov r3, r12 + orrs r0, r3 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r0, 0xE0 + lsls r0, 19 + movs r3, 0x80 + lsls r3, 3 + movs r4, 0 + str r4, [sp, 0x4] + ldr r2, =0x040000d4 + mov r1, r8 + str r1, [r2] + str r0, [r2, 0x4] + lsrs r0, r3, 2 + movs r1, 0x85 + lsls r1, 24 + orrs r0, r1 + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + movs r1, 0xA0 + lsls r1, 19 + mov r0, sp + strh r4, [r0] + str r0, [r2] + str r1, [r2, 0x4] + lsrs r3, 1 + movs r0, 0x81 + lsls r0, 24 + orrs r3, r0 + str r3, [r2, 0x8] + ldr r0, [r2, 0x8] + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] + b _080BB74C + .pool +_080BB5FC: + bl remove_some_task + bl ResetTasks + bl ResetAllObjectData + bl sub_80A1A74 + bl ResetObjectPaletteAllocator + ldr r1, =0x0300301c + movs r0, 0x8 + strb r0, [r1] + bl dp13_810BB8C + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _080BB74C + .pool +_080BB628: + ldr r4, =0x02039b4c + ldr r0, =0x00000664 + bl AllocZeroed + str r0, [r4] + bl sub_80BB384 + ldr r0, =sub_80BB78C + movs r1, 0 + bl CreateTask + ldr r1, [r4] + ldr r5, =0x03005d90 + ldr r0, [r5] + ldrb r0, [r0, 0x19] + ldr r3, =0x00000612 + adds r1, r3 + strh r0, [r1] + bl sub_809D42C + adds r1, r0, 0 + cmp r1, 0 + bne _080BB65E + ldr r0, [r4] + ldr r2, =0x00000612 + adds r0, r2 + strh r1, [r0] +_080BB65E: + ldr r1, [r4] + ldr r0, [r5] + ldrb r2, [r0, 0x18] + ldr r3, =0x00000616 + adds r0, r1, r3 + strh r2, [r0] + ldr r0, =0x02039b50 + ldrh r2, [r0] + subs r3, 0x8 + adds r0, r1, r3 + strh r2, [r0] + ldr r0, =0x02039b52 + ldrb r0, [r0] + ldr r2, =0x0000062c + adds r1, r2 + strb r0, [r1] + ldr r0, [r4] + adds r3, 0x3F + adds r0, r3 + movs r1, 0 + strb r1, [r0] + bl sub_809D42C + cmp r0, 0 + bne _080BB6D0 + movs r0, 0 + bl sub_80C0844 + ldr r1, [r4] + ldr r2, =0x0000061a + adds r1, r2 + strh r0, [r1] + movs r0, 0x1 + bl sub_80C0844 + b _080BB6E4 + .pool +_080BB6D0: + movs r0, 0 + bl pokedex_count + ldr r1, [r4] + ldr r2, =0x0000061a + adds r1, r2 + strh r0, [r1] + movs r0, 0x1 + bl pokedex_count +_080BB6E4: + ldr r1, [r4] + ldr r3, =0x0000061c + adds r1, r3 + strh r0, [r1] + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000062d + adds r0, r1 + movs r1, 0x8 + strb r1, [r0] + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080BB74C + .pool +_080BB71C: + movs r0, 0x1 + bl EnableInterrupts + ldr r0, =sub_80BB370 + bl SetVBlankCallback + ldr r0, =sub_80BB774 + bl SetMainCallback2 + ldr r0, =0x02039b4c + ldr r1, [r0] + ldr r3, =0x00000612 + adds r0, r1, r3 + ldrb r0, [r0] + ldr r2, =0x00000616 + adds r1, r2 + ldrb r1, [r1] + bl sub_80BC8D4 + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + bl MPlayVolumeControl +_080BB74C: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BB534 + + thumb_func_start sub_80BB774 +sub_80BB774: @ 80BB774 + push {lr} + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_80BB774 + + thumb_func_start sub_80BB78C +sub_80BB78C: @ 80BB78C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02039b4c + ldr r1, [r0] + ldr r0, =0x0000064c + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + movs r0, 0 + bl sub_80BC514 + lsls r0, 24 + cmp r0, 0 + beq _080BB7BE + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80BB7D4 + str r0, [r1] +_080BB7BE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BB78C + + thumb_func_start sub_80BB7D4 +sub_80BB7D4: @ 80BB7D4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, =0x02039b4c + ldr r0, [r7] + ldr r4, =0x00000652 + adds r0, r4 + ldrh r1, [r0] + movs r0, 0x12 + bl SetGpuReg + ldr r3, [r7] + adds r1, r3, r4 + ldrh r0, [r1] + movs r4, 0 + ldrsh r2, [r1, r4] + mov r8, r2 + cmp r2, 0 + beq _080BB810 + subs r0, 0x8 + strh r0, [r1] + b _080BBA06 + .pool +_080BB810: + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + mov r9, r0 + ands r0, r1 + cmp r0, 0 + beq _080BB8A4 + ldr r1, =0x0000060e + adds r0, r3, r1 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r3, r0 + ldrb r0, [r0, 0x2] + lsls r0, 31 + cmp r0, 0 + beq _080BB8A4 + bl sub_80BD8D0 + ldr r4, =0x02020630 + ldr r0, [r7] + ldr r5, =0x00000626 + adds r0, r5 + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x5] + lsrs r1, 4 + adds r1, 0x10 + mov r0, r9 + lsls r0, r1 + mvns r0, r0 + mov r2, r8 + str r2, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, [r7] + adds r0, r5 + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, 0x1C + adds r0, r4 + ldr r1, =sub_80BE470 + str r1, [r0] + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80BBBF4 + str r1, [r0] + movs r0, 0x15 + b _080BB976 + .pool +_080BB8A4: + ldrh r2, [r2, 0x2E] + movs r0, 0x8 + ands r0, r2 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _080BB8FC + ldr r3, =0x02039b4c + ldr r1, [r3] + ldr r4, =0x00000652 + adds r0, r1, r4 + movs r2, 0 + strh r2, [r0] + ldr r0, =0x0000064f + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + ldr r0, [r3] + movs r1, 0xCA + lsls r1, 3 + adds r0, r1 + strh r2, [r0] + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80BBA78 + str r1, [r0] + movs r0, 0x5 + bl audio_play + b _080BBA06 + .pool +_080BB8FC: + movs r0, 0x4 + ands r0, r2 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _080BB9A0 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + bl sub_80C1258 + ldr r1, =0x03005e00 + lsls r3, r6, 2 + adds r3, r6 + lsls r3, 3 + adds r3, r1 + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + strh r0, [r3, 0x8] + ldr r1, =0x02039b4c + ldr r0, [r1] + ldr r4, =0x0000064e + adds r0, r4 + strb r2, [r0] + ldr r0, [r1] + ldr r2, =0x0000062c + adds r1, r0, r2 + ldrb r2, [r1] + subs r4, 0x24 + adds r1, r0, r4 + strh r2, [r1] + ldr r2, =0x0000060e + adds r1, r0, r2 + ldrh r2, [r1] + subs r4, 0x1A + adds r1, r0, r4 + strh r2, [r1] + ldr r2, =0x00000612 + adds r1, r0, r2 + ldrh r2, [r1] + adds r4, 0x4 + adds r1, r0, r4 + strh r2, [r1] + ldr r2, =0x00000616 + adds r1, r0, r2 + ldrh r1, [r1] + adds r4, 0x4 + adds r0, r4 + strh r1, [r0] + ldr r0, =sub_80BBD1C + str r0, [r3] + movs r0, 0x2 +_080BB976: + bl audio_play + bl sub_80BC890 + b _080BBA06 + .pool +_080BB9A0: + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _080BB9D8 + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80BBDE8 + str r1, [r0] + movs r0, 0x3 + bl audio_play + b _080BBA06 + .pool +_080BB9D8: + ldr r5, =0x02039b4c + ldr r0, [r5] + ldr r4, =0x0000060e + adds r0, r4 + ldrh r0, [r0] + movs r1, 0xE + bl sub_80BD69C + ldr r1, [r5] + adds r4, r1, r4 + strh r0, [r4] + ldr r0, =0x0000062e + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _080BBA06 + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80BBA28 + str r0, [r1] +_080BBA06: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BB7D4 + + thumb_func_start sub_80BBA28 +sub_80BBA28: @ 80BBA28 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02039b4c + ldr r2, [r0] + ldr r1, =0x0000062f + adds r0, r2, r1 + ldrb r0, [r0] + ldr r3, =0x00000634 + adds r1, r2, r3 + ldrb r1, [r1] + adds r3, 0x2 + adds r2, r3 + ldrb r2, [r2] + bl sub_80BD404 + lsls r0, 24 + cmp r0, 0 + beq _080BBA5C + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80BB7D4 + str r0, [r1] +_080BBA5C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BBA28 + + thumb_func_start sub_80BBA78 +sub_80BBA78: @ 80BBA78 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r6, =0x02039b4c + ldr r0, [r6] + ldr r4, =0x00000652 + adds r0, r4 + ldrh r1, [r0] + movs r0, 0x12 + bl SetGpuReg + ldr r3, [r6] + adds r1, r3, r4 + ldrh r2, [r1] + movs r4, 0 + ldrsh r0, [r1, r4] + cmp r0, 0x50 + beq _080BBAB0 + adds r0, r2, 0 + adds r0, 0x8 + strh r0, [r1] + b _080BBBE8 + .pool +_080BBAB0: + ldr r5, =0x030022c0 + ldrh r1, [r5, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080BBB58 + movs r2, 0xCA + lsls r2, 3 + adds r0, r3, r2 + ldrh r0, [r0] + cmp r0, 0x1 + beq _080BBADC + cmp r0, 0x1 + ble _080BBB20 + cmp r0, 0x2 + beq _080BBAF4 + cmp r0, 0x3 + beq _080BBB34 + b _080BBB20 + .pool +_080BBADC: + ldr r4, =0x0000060e + adds r1, r3, r4 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0000062c + adds r1, r3, r0 + movs r0, 0x40 + b _080BBB0C + .pool +_080BBAF4: + ldr r1, =0x0000060c + adds r2, r3, r1 + ldrh r0, [r2] + subs r0, 0x1 + ldr r4, =0x0000060e + adds r1, r3, r4 + strh r0, [r1] + ldrh r0, [r2] + lsls r0, 4 + adds r0, 0x30 + ldr r2, =0x0000062c + adds r1, r3, r2 +_080BBB0C: + strb r0, [r1] + bl sub_80BDA40 + ldr r0, [r6] + adds r0, r4 + ldrh r0, [r0] + movs r1, 0xE + bl sub_80BD2B4 + ldrh r1, [r5, 0x2E] +_080BBB20: + movs r0, 0x8 + orrs r0, r1 + strh r0, [r5, 0x2E] + b _080BBB58 + .pool +_080BBB34: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80BBDE8 + str r1, [r0] + movs r0, 0x3 + bl audio_play +_080BBB58: + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2E] + movs r0, 0xA + ands r0, r1 + cmp r0, 0 + beq _080BBB98 + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r3, =0x0000064f + adds r0, r3 + movs r1, 0 + strb r1, [r0] + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80BB7D4 + str r1, [r0] + b _080BBBB6 + .pool +_080BBB98: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080BBBC4 + ldr r0, =0x02039b4c + ldr r0, [r0] + movs r4, 0xCA + lsls r4, 3 + adds r1, r0, r4 + ldrh r0, [r1] + cmp r0, 0 + beq _080BBBC4 + subs r0, 0x1 + strh r0, [r1] +_080BBBB6: + movs r0, 0x5 + bl audio_play + b _080BBBE8 + .pool +_080BBBC4: + ldrh r1, [r2, 0x30] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080BBBE8 + ldr r0, =0x02039b4c + ldr r0, [r0] + movs r2, 0xCA + lsls r2, 3 + adds r1, r0, r2 + ldrh r0, [r1] + cmp r0, 0x2 + bhi _080BBBE8 + adds r0, 0x1 + strh r0, [r1] + movs r0, 0x5 + bl audio_play +_080BBBE8: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BBA78 + + thumb_func_start sub_80BBBF4 +sub_80BBBF4: @ 80BBBF4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, =0x02020630 + ldr r5, =0x02039b4c + ldr r3, [r5] + ldr r6, =0x00000626 + adds r0, r3, r6 + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + movs r2, 0x20 + ldrsh r0, [r1, r2] + cmp r0, 0x30 + bne _080BBC52 + movs r2, 0x22 + ldrsh r0, [r1, r2] + cmp r0, 0x38 + bne _080BBC52 + ldr r1, =0x0000064a + adds r0, r3, r1 + ldrb r1, [r0] + ldr r2, =0x0000064b + adds r0, r3, r2 + strb r1, [r0] + ldr r1, [r5] + subs r2, 0x3D + adds r0, r1, r2 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1, r0 + adds r1, r6 + ldrb r1, [r1] + bl sub_80BE91C + ldr r2, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x8] + ldr r0, =sub_80BBC74 + str r0, [r1] +_080BBC52: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BBBF4 + + thumb_func_start sub_80BBC74 +sub_80BBC74: @ 80BBC74 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _080BBCE0 + ldr r5, =0x02039b4c + ldr r0, [r5] + ldr r1, =0x0000064a + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080BBCFC + ldrb r0, [r4, 0x8] + bl sub_80BE9C4 + lsls r0, 24 + cmp r0, 0 + bne _080BBCFC + bl sub_80BD930 + lsls r0, 24 + cmp r0, 0 + beq _080BBCFC + ldr r0, [r5] + ldr r2, =0x0000060e + adds r1, r0, r2 + ldrh r1, [r1] + lsls r1, 2 + adds r0, r1 + ldrb r1, [r4, 0x8] + bl sub_80BE9F8 + b _080BBCFC + .pool +_080BBCE0: + ldr r2, =0x02039b50 + ldr r0, =0x02039b4c + ldr r1, [r0] + ldr r3, =0x0000060e + adds r0, r1, r3 + ldrh r0, [r0] + strh r0, [r2] + ldr r2, =0x02039b52 + ldr r0, =0x0000062c + adds r1, r0 + ldrb r0, [r1] + strb r0, [r2] + ldr r0, =sub_80BB78C + str r0, [r4] +_080BBCFC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BBC74 + + thumb_func_start sub_80BBD1C +sub_80BBD1C: @ 80BBD1C + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r6, r1, r2 + movs r0, 0x8 + ldrsh r1, [r6, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r4, [r0, 0x4] + cmp r4, 0 + bne _080BBDCA + bl sub_80BDA40 + ldr r5, =0x02039b4c + ldr r2, [r5] + ldr r1, =0x0000064e + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080BBD7C + ldr r3, =0x0000060e + adds r0, r2, r3 + strh r4, [r0] + ldr r0, =0x0000062c + adds r1, r2, r0 + movs r0, 0x40 + strb r0, [r1] + ldr r0, =sub_80BBE70 + b _080BBDC8 + .pool +_080BBD7C: + ldr r1, =0x0000062a + adds r0, r2, r1 + ldrh r1, [r0] + ldr r3, =0x0000062c + adds r0, r2, r3 + strb r1, [r0] + ldr r1, [r5] + movs r2, 0xC2 + lsls r2, 3 + adds r0, r1, r2 + ldrh r2, [r0] + subs r3, 0x1E + adds r0, r1, r3 + strh r2, [r0] + ldr r2, =0x00000614 + adds r0, r1, r2 + ldrh r0, [r0] + adds r3, 0x4 + adds r1, r3 + strh r0, [r1] + bl sub_809D42C + adds r1, r0, 0 + cmp r1, 0 + bne _080BBDB6 + ldr r0, [r5] + ldr r2, =0x00000612 + adds r0, r2 + strh r1, [r0] +_080BBDB6: + ldr r0, [r5] + movs r3, 0xC3 + lsls r3, 3 + adds r1, r0, r3 + ldrh r1, [r1] + ldr r2, =0x00000616 + adds r0, r2 + strh r1, [r0] + ldr r0, =sub_80BB78C +_080BBDC8: + str r0, [r6] +_080BBDCA: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BBD1C + + thumb_func_start sub_80BBDE8 +sub_80BBDE8: @ 80BBDE8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BBE4A + ldr r4, =0x03005d90 + ldr r0, [r4] + ldr r5, =0x02039b4c + ldr r1, [r5] + ldr r2, =0x00000612 + adds r1, r2 + ldrh r1, [r1] + strb r1, [r0, 0x19] + bl sub_809D42C + adds r1, r0, 0 + cmp r1, 0 + bne _080BBE18 + ldr r0, [r4] + strb r1, [r0, 0x19] +_080BBE18: + ldr r1, [r4] + ldr r0, [r5] + ldr r2, =0x00000616 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1, 0x18] + bl sub_80BDA40 + bl sub_80BC890 + adds r0, r6, 0 + bl DestroyTask + ldr r0, =sub_8086194 + bl SetMainCallback2 + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + ldr r0, [r5] + bl Free +_080BBE4A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BBDE8 + + thumb_func_start sub_80BBE70 +sub_80BBE70: @ 80BBE70 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02039b4c + ldr r1, [r0] + ldr r0, =0x0000064c + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x1 + orrs r0, r2 + strb r0, [r1] + movs r0, 0x3 + bl sub_80BC514 + lsls r0, 24 + cmp r0, 0 + beq _080BBEA0 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80BBEB8 + str r0, [r1] +_080BBEA0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BBE70 + + thumb_func_start sub_80BBEB8 +sub_80BBEB8: @ 80BBEB8 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, =0x02039b4c + ldr r0, [r5] + ldr r4, =0x00000652 + adds r0, r4 + ldrh r1, [r0] + movs r0, 0x12 + bl SetGpuReg + ldr r3, [r5] + adds r1, r3, r4 + ldrh r0, [r1] + movs r2, 0 + ldrsh r4, [r1, r2] + cmp r4, 0 + beq _080BBEEC + subs r0, 0x8 + strh r0, [r1] + b _080BC08A + .pool +_080BBEEC: + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2E] + movs r7, 0x1 + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _080BBF70 + ldr r1, =0x0000060e + adds r0, r3, r1 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r3, r0 + ldrb r0, [r0, 0x2] + lsls r0, 31 + cmp r0, 0 + beq _080BBF70 + bl sub_80BD8D0 + ldr r3, =0x02020630 + ldr r0, [r5] + ldr r2, =0x00000626 + adds r0, r2 + ldrh r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r0, r2, r3 + ldrb r1, [r0, 0x5] + lsrs r1, 4 + adds r1, 0x10 + adds r0, r7, 0 + lsls r0, r1 + adds r3, 0x1C + adds r2, r3 + ldr r1, =sub_80BE470 + str r1, [r2] + mvns r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80BC2D4 + str r1, [r0] + movs r0, 0x15 + b _080BC00A + .pool +_080BBF70: + ldrh r2, [r2, 0x2E] + movs r0, 0x8 + ands r0, r2 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _080BBFC8 + ldr r3, =0x02039b4c + ldr r1, [r3] + ldr r2, =0x00000652 + adds r0, r1, r2 + movs r2, 0 + strh r2, [r0] + ldr r0, =0x0000064f + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + ldr r0, [r3] + movs r1, 0xCA + lsls r1, 3 + adds r0, r1 + strh r2, [r0] + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80BC0F8 + str r1, [r0] + movs r0, 0x5 + bl audio_play + b _080BC08A + .pool +_080BBFC8: + movs r0, 0x4 + ands r0, r2 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0 + beq _080BC024 + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + bl sub_80C1258 + ldr r2, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + strh r0, [r1, 0x8] + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r3, =0x0000064e + adds r0, r3 + strb r2, [r0] + ldr r0, =sub_80BBD1C + str r0, [r1] + movs r0, 0x2 +_080BC00A: + bl audio_play + bl sub_80BC890 + b _080BC08A + .pool +_080BC024: + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _080BC05C + movs r0, 0x1 + negs r0, r0 + str r3, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80BC3DC + str r1, [r0] + movs r0, 0x3 + bl audio_play + b _080BC08A + .pool +_080BC05C: + ldr r5, =0x02039b4c + ldr r0, [r5] + ldr r4, =0x0000060e + adds r0, r4 + ldrh r0, [r0] + movs r1, 0xE + bl sub_80BD69C + ldr r1, [r5] + adds r4, r1, r4 + strh r0, [r4] + ldr r0, =0x0000062e + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _080BC08A + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80BC0A8 + str r0, [r1] +_080BC08A: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BBEB8 + + thumb_func_start sub_80BC0A8 +sub_80BC0A8: @ 80BC0A8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02039b4c + ldr r2, [r0] + ldr r1, =0x0000062f + adds r0, r2, r1 + ldrb r0, [r0] + ldr r3, =0x00000634 + adds r1, r2, r3 + ldrb r1, [r1] + adds r3, 0x2 + adds r2, r3 + ldrb r2, [r2] + bl sub_80BD404 + lsls r0, 24 + cmp r0, 0 + beq _080BC0DC + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80BBEB8 + str r0, [r1] +_080BC0DC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BC0A8 + + thumb_func_start sub_80BC0F8 +sub_80BC0F8: @ 80BC0F8 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, =0x02039b4c + ldr r0, [r5] + ldr r4, =0x00000652 + adds r0, r4 + ldrh r1, [r0] + movs r0, 0x12 + bl SetGpuReg + ldr r5, [r5] + adds r1, r5, r4 + ldrh r2, [r1] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0x60 + beq _080BC130 + adds r0, r2, 0 + adds r0, 0x8 + strh r0, [r1] + b _080BC2C8 + .pool +_080BC130: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080BC13E + b _080BC238 +_080BC13E: + movs r1, 0xCA + lsls r1, 3 + adds r0, r5, r1 + ldrh r0, [r0] + cmp r0, 0x4 + bhi _080BC1C2 + lsls r0, 2 + ldr r1, =_080BC15C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080BC15C: + .4byte _080BC1C2 + .4byte _080BC170 + .4byte _080BC194 + .4byte _080BC1E4 + .4byte _080BC214 +_080BC170: + ldr r5, =0x02039b4c + ldr r1, [r5] + ldr r4, =0x0000060e + adds r2, r1, r4 + movs r0, 0 + strh r0, [r2] + ldr r2, =0x0000062c + adds r1, r2 + movs r0, 0x40 + strb r0, [r1] + b _080BC1B2 + .pool +_080BC194: + ldr r5, =0x02039b4c + ldr r2, [r5] + ldr r0, =0x0000060c + adds r3, r2, r0 + ldrh r0, [r3] + subs r0, 0x1 + ldr r4, =0x0000060e + adds r1, r2, r4 + strh r0, [r1] + ldrh r0, [r3] + lsls r0, 4 + adds r0, 0x30 + ldr r1, =0x0000062c + adds r2, r1 + strb r0, [r2] +_080BC1B2: + bl sub_80BDA40 + ldr r0, [r5] + adds r0, r4 + ldrh r0, [r0] + movs r1, 0xE + bl sub_80BD2B4 +_080BC1C2: + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2E] + movs r0, 0x8 + orrs r0, r1 + strh r0, [r2, 0x2E] + b _080BC238 + .pool +_080BC1E4: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80BC3DC + str r1, [r0] + movs r0, 0x34 + bl audio_play + b _080BC238 + .pool +_080BC214: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80BC47C + str r1, [r0] + movs r0, 0x3 + bl audio_play +_080BC238: + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2E] + movs r0, 0xA + ands r0, r1 + cmp r0, 0 + beq _080BC278 + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r2, =0x0000064f + adds r0, r2 + movs r1, 0 + strb r1, [r0] + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80BBEB8 + str r1, [r0] + b _080BC296 + .pool +_080BC278: + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080BC2A4 + ldr r0, =0x02039b4c + ldr r0, [r0] + movs r3, 0xCA + lsls r3, 3 + adds r1, r0, r3 + ldrh r0, [r1] + cmp r0, 0 + beq _080BC2A4 + subs r0, 0x1 + strh r0, [r1] +_080BC296: + movs r0, 0x5 + bl audio_play + b _080BC2C8 + .pool +_080BC2A4: + ldrh r1, [r2, 0x30] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080BC2C8 + ldr r0, =0x02039b4c + ldr r0, [r0] + movs r2, 0xCA + lsls r2, 3 + adds r1, r0, r2 + ldrh r0, [r1] + cmp r0, 0x3 + bhi _080BC2C8 + adds r0, 0x1 + strh r0, [r1] + movs r0, 0x5 + bl audio_play +_080BC2C8: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BC0F8 + + thumb_func_start sub_80BC2D4 +sub_80BC2D4: @ 80BC2D4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, =0x02020630 + ldr r5, =0x02039b4c + ldr r3, [r5] + ldr r4, =0x00000626 + adds r0, r3, r4 + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + movs r2, 0x20 + ldrsh r0, [r1, r2] + cmp r0, 0x30 + bne _080BC33A + movs r2, 0x22 + ldrsh r0, [r1, r2] + cmp r0, 0x38 + bne _080BC33A + ldr r1, =0x0000064a + adds r0, r3, r1 + ldrb r1, [r0] + ldr r2, =0x0000064b + adds r0, r3, r2 + strb r1, [r0] + ldr r1, [r5] + subs r2, 0x3D + adds r0, r1, r2 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1, r0 + adds r1, r4 + ldrb r1, [r1] + bl sub_80BE91C + ldr r2, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x8] + ldr r0, [r5] + adds r0, r4 + ldr r2, =0x0000ffff + strh r2, [r0] + ldr r0, =sub_80BC360 + str r0, [r1] +_080BC33A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BC2D4 + + thumb_func_start sub_80BC360 +sub_80BC360: @ 80BC360 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _080BC3CC + ldr r5, =0x02039b4c + ldr r0, [r5] + ldr r1, =0x0000064a + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080BC3D0 + ldrb r0, [r4, 0x8] + bl sub_80BE9C4 + lsls r0, 24 + cmp r0, 0 + bne _080BC3D0 + bl sub_80BD930 + lsls r0, 24 + cmp r0, 0 + beq _080BC3D0 + ldr r0, [r5] + ldr r2, =0x0000060e + adds r1, r0, r2 + ldrh r1, [r1] + lsls r1, 2 + adds r0, r1 + ldrb r1, [r4, 0x8] + bl sub_80BE9F8 + b _080BC3D0 + .pool +_080BC3CC: + ldr r0, =sub_80BBE70 + str r0, [r4] +_080BC3D0: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BC360 + + thumb_func_start sub_80BC3DC +sub_80BC3DC: @ 80BC3DC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BC450 + ldr r4, =0x02039b4c + ldr r0, [r4] + ldr r2, =0x0000062a + adds r1, r0, r2 + ldrh r1, [r1] + ldr r3, =0x0000062c + adds r0, r3 + strb r1, [r0] + ldr r1, [r4] + subs r2, 0x1A + adds r0, r1, r2 + ldrh r2, [r0] + subs r3, 0x1E + adds r0, r1, r3 + strh r2, [r0] + ldr r2, =0x00000614 + adds r0, r1, r2 + ldrh r0, [r0] + adds r3, 0x4 + adds r1, r3 + strh r0, [r1] + bl sub_809D42C + adds r1, r0, 0 + cmp r1, 0 + bne _080BC42A + ldr r0, [r4] + ldr r2, =0x00000612 + adds r0, r2 + strh r1, [r0] +_080BC42A: + ldr r0, [r4] + movs r3, 0xC3 + lsls r3, 3 + adds r1, r0, r3 + ldrh r1, [r1] + ldr r2, =0x00000616 + adds r0, r2 + strh r1, [r0] + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80BB78C + str r1, [r0] + bl sub_80BDA40 + bl sub_80BC890 +_080BC450: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BC3DC + + thumb_func_start sub_80BC47C +sub_80BC47C: @ 80BC47C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BC4E8 + ldr r4, =0x02039b4c + ldr r0, [r4] + ldr r2, =0x0000062a + adds r1, r0, r2 + ldrh r1, [r1] + ldr r3, =0x0000062c + adds r0, r3 + strb r1, [r0] + ldr r1, [r4] + subs r2, 0x1A + adds r0, r1, r2 + ldrh r2, [r0] + subs r3, 0x1E + adds r0, r1, r3 + strh r2, [r0] + ldr r2, =0x00000614 + adds r0, r1, r2 + ldrh r0, [r0] + adds r3, 0x4 + adds r1, r3 + strh r0, [r1] + bl sub_809D42C + adds r1, r0, 0 + cmp r1, 0 + bne _080BC4CA + ldr r0, [r4] + ldr r2, =0x00000612 + adds r0, r2 + strh r1, [r0] +_080BC4CA: + ldr r0, [r4] + movs r3, 0xC3 + lsls r3, 3 + adds r1, r0, r3 + ldrh r1, [r1] + ldr r2, =0x00000616 + adds r0, r2 + strh r1, [r0] + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80BBDE8 + str r1, [r0] +_080BC4E8: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BC47C + + thumb_func_start sub_80BC514 +sub_80BC514: @ 80BC514 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r3, r1, 0 + cmp r0, 0x6 + bhi _080BC55C + lsls r0, 2 + ldr r1, =_080BC540 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080BC540: + .4byte _080BC55C + .4byte _080BC6CC + .4byte _080BC6FC + .4byte _080BC704 + .4byte _080BC768 + .4byte _080BC790 + .4byte _080BC818 +_080BC55C: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + beq _080BC56E + b _080BC838 +_080BC56E: + movs r0, 0 + bl SetVBlankCallback + ldr r4, =0x02039b4c + ldr r0, [r4] + ldr r1, =0x0000064a + adds r0, r1 + strb r5, [r0] + movs r0, 0 + bl sub_80C09B0 + ldr r0, [r4] + ldr r2, =0x0000062d + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x1A + bl SetGpuReg + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0855D298 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl AllocZeroed + adds r1, r0, 0 + movs r0, 0x3 + bl SetBgTilemapBuffer + adds r0, r4, 0 + bl AllocZeroed + adds r1, r0, 0 + movs r0, 0x2 + bl SetBgTilemapBuffer + adds r0, r4, 0 + bl AllocZeroed + adds r1, r0, 0 + movs r0, 0x1 + bl SetBgTilemapBuffer + adds r0, r4, 0 + bl AllocZeroed + adds r1, r0, 0 + movs r0, 0 + bl SetBgTilemapBuffer + ldr r1, =gUnknown_08DC1934 + movs r2, 0x80 + lsls r2, 6 + str r6, [sp] + movs r0, 0x3 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_08DC2C5C + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + ldr r1, =gUnknown_08DC2DAC + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + cmp r5, 0 + bne _080BC640 + ldr r1, =gUnknown_08DC2A08 + movs r3, 0xA0 + lsls r3, 2 + movs r0, 0 + movs r2, 0 + bl CopyToBgTilemapBuffer + b _080BC64E + .pool +_080BC640: + ldr r1, =gUnknown_08DC2B1C + movs r3, 0xA0 + lsls r3, 2 + movs r0, 0 + movs r2, 0 + bl CopyToBgTilemapBuffer +_080BC64E: + bl sub_80A1A74 + cmp r5, 0 + bne _080BC674 + ldr r3, =0x02039b4c + ldr r1, [r3] + ldr r0, =0x0000064c + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + b _080BC682 + .pool +_080BC674: + ldr r3, =0x02039b4c + ldr r1, [r3] + ldr r2, =0x0000064c + adds r1, r2 + ldrb r0, [r1] + movs r2, 0x1 + orrs r0, r2 +_080BC682: + strb r0, [r1] + ldr r0, [r3] + ldr r1, =0x0000064c + adds r0, r1 + ldrb r0, [r0] + lsls r0, 31 + lsrs r0, 31 + bl sub_80BC844 + ldr r0, =gUnknown_0855D2A8 + bl InitWindows + bl DeactivateAllTextPrinters + movs r0, 0 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] + b _080BC838 + .pool +_080BC6CC: + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + ldr r1, =0x0300301c + movs r0, 0x8 + strb r0, [r1] + ldr r0, =gUnknown_0855D26C + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0855D27C + bl LoadTaggedObjectPalettes + adds r0, r5, 0 + bl sub_80BDB7C + b _080BC7F8 + .pool +_080BC6FC: + movs r2, 0x87 + lsls r2, 3 + adds r1, r3, r2 + b _080BC800 +_080BC704: + cmp r5, 0 + bne _080BC71C + ldr r0, =0x02039b4c + ldr r1, [r0] + ldr r2, =0x00000612 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, 0x4 + adds r1, r2 + ldrb r1, [r1] + bl sub_80BC8D4 +_080BC71C: + ldr r4, =0x02039b4c + ldr r0, [r4] + ldr r1, =0x0000060e + adds r0, r1 + ldrh r0, [r0] + movs r1, 0xE + bl sub_80BD2B4 + ldr r0, [r4] + ldr r2, =0x0000064f + adds r0, r2 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + adds r2, 0x3 + adds r0, r2 + strh r1, [r0] + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + b _080BC7F8 + .pool +_080BC768: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =sub_80BB370 + bl SetVBlankCallback + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _080BC800 + .pool +_080BC790: + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + ldr r1, =0x00001d3f + movs r0, 0x4A + 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, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + ldr r1, =0x00009040 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg +_080BC7F8: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_080BC800: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080BC838 + .pool +_080BC818: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _080BC838 + movs r1, 0x87 + lsls r1, 3 + adds r0, r3, r1 + strb r2, [r0] + movs r0, 0x1 + b _080BC83A + .pool +_080BC838: + movs r0, 0 +_080BC83A: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80BC514 + + thumb_func_start sub_80BC844 +sub_80BC844: @ 80BC844 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080BC858 + ldr r0, =gUnknown_08DC17B6 + b _080BC862 + .pool +_080BC858: + bl sub_809D42C + cmp r0, 0 + bne _080BC870 + ldr r0, =gUnknown_08DC16F6 +_080BC862: + movs r1, 0x1 + movs r2, 0xBE + bl gpu_pal_apply + b _080BC87A + .pool +_080BC870: + ldr r0, =gUnknown_08DC1876 + movs r1, 0x1 + movs r2, 0xBE + bl gpu_pal_apply +_080BC87A: + bl sub_8098C64 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BC844 + + thumb_func_start sub_80BC890 +sub_80BC890: @ 80BC890 + push {lr} + bl FreeAllWindowBuffers + movs r0, 0 + bl GetBgTilemapBuffer + cmp r0, 0 + beq _080BC8A4 + bl Free +_080BC8A4: + movs r0, 0x1 + bl GetBgTilemapBuffer + cmp r0, 0 + beq _080BC8B2 + bl Free +_080BC8B2: + movs r0, 0x2 + bl GetBgTilemapBuffer + cmp r0, 0 + beq _080BC8C0 + bl Free +_080BC8C0: + movs r0, 0x3 + bl GetBgTilemapBuffer + cmp r0, 0 + beq _080BC8CE + bl Free +_080BC8CE: + pop {r0} + bx r0 + thumb_func_end sub_80BC890 + + thumb_func_start sub_80BC8D4 +sub_80BC8D4: @ 80BC8D4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000060c + adds r0, r1 + movs r5, 0 + strh r5, [r0] + cmp r4, 0 + beq _080BC8FC + cmp r4, 0x1 + beq _080BC910 +_080BC8FC: + mov r1, sp + movs r0, 0xCA + strh r0, [r1] + movs r0, 0x1 + strh r0, [r1, 0x2] + b _080BC92C + .pool +_080BC910: + bl sub_809D42C + cmp r0, 0 + beq _080BC924 + mov r0, sp + movs r1, 0xC1 + lsls r1, 1 + strh r1, [r0] + strh r5, [r0, 0x2] + b _080BC92C +_080BC924: + mov r0, sp + movs r1, 0xCA + strh r1, [r0] + strh r4, [r0, 0x2] +_080BC92C: + cmp r6, 0x5 + bls _080BC932 + b _080BCDB4 +_080BC932: + lsls r0, r6, 2 + ldr r1, =_080BC940 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080BC940: + .4byte _080BC958 + .4byte _080BCACC + .4byte _080BCB78 + .4byte _080BCC08 + .4byte _080BCCA0 + .4byte _080BCD30 +_080BC958: + mov r0, sp + ldrh r0, [r0, 0x2] + cmp r0, 0 + beq _080BCA00 + movs r4, 0 + mov r0, sp + ldrh r0, [r0] + cmp r4, r0 + blt _080BC96C + b _080BCDB4 +_080BC96C: + mov r5, sp + ldr r2, =0x02039b4c + mov r8, r2 + movs r3, 0x1 + mov r9, r3 +_080BC976: + lsls r4, 16 + asrs r4, 16 + adds r7, r4, 0x1 + mov r10, r7 + lsls r0, r7, 16 + lsrs r6, r0, 16 + adds r0, r6, 0 + bl HoennToNationalOrder + strh r0, [r5, 0x4] + mov r2, r8 + ldr r1, [r2] + lsls r4, 2 + adds r1, r4 + strh r0, [r1] + ldrh r0, [r5, 0x4] + movs r1, 0 + bl pokedex_flag_operation + mov r3, r8 + ldr r2, [r3] + adds r2, r4 + mov r3, r9 + ands r3, r0 + ldrb r0, [r2, 0x2] + movs r7, 0x2 + negs r7, r7 + adds r1, r7, 0 + ands r0, r1 + orrs r0, r3 + strb r0, [r2, 0x2] + ldrh r0, [r5, 0x4] + movs r1, 0x1 + bl pokedex_flag_operation + mov r1, r8 + ldr r3, [r1] + adds r3, r4 + mov r2, r9 + ands r2, r0 + lsls r2, 1 + ldrb r0, [r3, 0x2] + subs r7, 0x1 + adds r1, r7, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x2] + mov r0, r8 + ldr r1, [r0] + adds r4, r1, r4 + ldrb r0, [r4, 0x2] + lsls r0, 31 + cmp r0, 0 + beq _080BC9EA + ldr r2, =0x0000060c + adds r0, r1, r2 + mov r3, r10 + strh r3, [r0] +_080BC9EA: + adds r4, r6, 0 + lsls r0, r4, 16 + asrs r0, 16 + ldrh r7, [r5] + cmp r0, r7 + blt _080BC976 + b _080BCDB4 + .pool +_080BCA00: + movs r4, 0 + movs r5, 0 + mov r10, r5 + mov r0, sp + ldrh r0, [r0] + cmp r4, r0 + blt _080BCA10 + b _080BCDB4 +_080BCA10: + mov r6, sp + ldr r0, =0x02039b4c + mov r8, r0 + movs r1, 0x1 + mov r9, r1 +_080BCA1A: + lsls r4, 16 + asrs r0, r4, 16 + adds r0, 0x1 + strh r0, [r6, 0x4] + ldrh r0, [r6, 0x4] + movs r1, 0 + bl pokedex_flag_operation + lsls r0, 24 + adds r7, r4, 0 + cmp r0, 0 + beq _080BCA36 + movs r2, 0x1 + mov r10, r2 +_080BCA36: + mov r3, r10 + cmp r3, 0 + beq _080BCAB2 + mov r4, r8 + ldr r1, [r4] + lsls r0, r5, 16 + asrs r5, r0, 16 + lsls r4, r5, 2 + adds r1, r4 + ldrh r0, [r6, 0x4] + strh r0, [r1] + ldrh r0, [r6, 0x4] + movs r1, 0 + bl pokedex_flag_operation + mov r1, r8 + ldr r2, [r1] + adds r2, r4 + mov r3, r9 + ands r3, r0 + mov r12, r3 + ldrb r0, [r2, 0x2] + movs r3, 0x2 + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + mov r1, r12 + orrs r0, r1 + strb r0, [r2, 0x2] + ldrh r0, [r6, 0x4] + movs r1, 0x1 + bl pokedex_flag_operation + mov r2, r8 + ldr r3, [r2] + adds r3, r4 + mov r2, r9 + ands r2, r0 + lsls r2, 1 + mov r12, r2 + ldrb r0, [r3, 0x2] + movs r2, 0x3 + negs r2, r2 + adds r1, r2, 0 + ands r0, r1 + mov r1, r12 + orrs r0, r1 + strb r0, [r3, 0x2] + mov r3, r8 + ldr r2, [r3] + adds r4, r2, r4 + ldrb r0, [r4, 0x2] + lsls r0, 31 + cmp r0, 0 + beq _080BCAAC + adds r1, r5, 0x1 + ldr r4, =0x0000060c + adds r0, r2, r4 + strh r1, [r0] +_080BCAAC: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_080BCAB2: + movs r1, 0x80 + lsls r1, 9 + adds r0, r7, r1 + lsrs r4, r0, 16 + asrs r0, 16 + ldrh r2, [r6] + cmp r0, r2 + blt _080BCA1A + b _080BCDB4 + .pool +_080BCACC: + movs r4, 0 + mov r5, sp + ldr r3, =0x02039b4c + mov r8, r3 + ldr r6, =0x0000060c + movs r7, 0x1 + mov r9, r7 +_080BCADA: + ldr r1, =gUnknown_0855C6A4 + lsls r4, 16 + asrs r0, r4, 15 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r5, 0x4] + ldrh r0, [r5, 0x4] + bl NationalToHoennOrder + lsls r0, 16 + lsrs r0, 16 + adds r7, r4, 0 + ldrh r1, [r5] + cmp r0, r1 + bhi _080BCB58 + ldrh r0, [r5, 0x4] + movs r1, 0 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080BCB58 + mov r3, r8 + ldr r2, [r3] + adds r3, r2, r6 + ldrh r0, [r3] + lsls r0, 2 + adds r0, r2, r0 + ldrh r1, [r5, 0x4] + strh r1, [r0] + ldrh r0, [r3] + lsls r0, 2 + adds r2, r0 + ldrb r0, [r2, 0x2] + mov r4, r9 + orrs r0, r4 + strb r0, [r2, 0x2] + ldrh r0, [r5, 0x4] + movs r1, 0x1 + bl pokedex_flag_operation + mov r1, r8 + ldr r3, [r1] + adds r1, r3, r6 + ldrh r1, [r1] + lsls r1, 2 + adds r3, r1 + mov r2, r9 + ands r2, r0 + lsls r2, 1 + ldrb r0, [r3, 0x2] + movs r4, 0x3 + negs r4, r4 + adds r1, r4, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0x2] + mov r0, r8 + ldr r1, [r0] + adds r1, r6 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_080BCB58: + movs r2, 0x80 + lsls r2, 9 + adds r1, r7, r2 + lsrs r4, r1, 16 + movs r0, 0xCD + lsls r0, 17 + cmp r1, r0 + ble _080BCADA + b _080BCDB4 + .pool +_080BCB78: + ldr r4, =0x00000181 + lsls r0, r4, 16 + mov r5, sp + ldr r7, =0x02039b4c + ldr r6, =0x0000060c +_080BCB82: + ldr r1, =gUnknown_0855C9DA + asrs r0, 15 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r5, 0x4] + ldrh r0, [r5, 0x4] + bl NationalToHoennOrder + lsls r0, 16 + lsrs r0, 16 + ldrh r3, [r5] + cmp r0, r3 + bhi _080BCBE2 + ldrh r0, [r5, 0x4] + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080BCBE2 + ldr r2, [r7] + adds r3, r2, r6 + ldrh r0, [r3] + lsls r0, 2 + adds r0, r2, r0 + ldrh r1, [r5, 0x4] + strh r1, [r0] + ldrh r0, [r3] + lsls r0, 2 + adds r2, r0 + ldrb r0, [r2, 0x2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x2] + ldr r2, [r7] + adds r0, r2, r6 + ldrh r0, [r0] + lsls r0, 2 + adds r2, r0 + ldrb r0, [r2, 0x2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0x2] + ldr r1, [r7] + adds r1, r6 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_080BCBE2: + lsls r0, r4, 16 + ldr r4, =0xffff0000 + adds r0, r4 + lsrs r4, r0, 16 + lsls r0, r4, 16 + cmp r0, 0 + bge _080BCB82 + b _080BCDB4 + .pool +_080BCC08: + movs r4, 0 + mov r5, sp + ldr r7, =0x02039b4c + mov r8, r7 + ldr r6, =0x0000060c + ldr r0, =0x00000181 + mov r9, r0 +_080BCC16: + ldr r1, =gUnknown_0855C9DA + lsls r4, 16 + asrs r0, r4, 15 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r5, 0x4] + ldrh r0, [r5, 0x4] + bl NationalToHoennOrder + lsls r0, 16 + lsrs r0, 16 + adds r7, r4, 0 + ldrh r1, [r5] + cmp r0, r1 + bhi _080BCC7E + ldrh r0, [r5, 0x4] + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080BCC7E + mov r3, r8 + ldr r2, [r3] + adds r3, r2, r6 + ldrh r0, [r3] + lsls r0, 2 + adds r0, r2, r0 + ldrh r1, [r5, 0x4] + strh r1, [r0] + ldrh r0, [r3] + lsls r0, 2 + adds r2, r0 + ldrb r0, [r2, 0x2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x2] + mov r4, r8 + ldr r2, [r4] + adds r0, r2, r6 + ldrh r0, [r0] + lsls r0, 2 + adds r2, r0 + ldrb r0, [r2, 0x2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0x2] + ldr r1, [r4] + adds r1, r6 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_080BCC7E: + movs r1, 0x80 + lsls r1, 9 + adds r0, r7, r1 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, r9 + ble _080BCC16 + b _080BCDB4 + .pool +_080BCCA0: + ldr r4, =0x00000181 + lsls r0, r4, 16 + mov r5, sp + ldr r7, =0x02039b4c + ldr r6, =0x0000060c +_080BCCAA: + ldr r1, =gUnknown_0855CCDE + asrs r0, 15 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r5, 0x4] + ldrh r0, [r5, 0x4] + bl NationalToHoennOrder + lsls r0, 16 + lsrs r0, 16 + ldrh r2, [r5] + cmp r0, r2 + bhi _080BCD0A + ldrh r0, [r5, 0x4] + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080BCD0A + ldr r2, [r7] + adds r3, r2, r6 + ldrh r0, [r3] + lsls r0, 2 + adds r0, r2, r0 + ldrh r1, [r5, 0x4] + strh r1, [r0] + ldrh r0, [r3] + lsls r0, 2 + adds r2, r0 + ldrb r0, [r2, 0x2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x2] + ldr r2, [r7] + adds r0, r2, r6 + ldrh r0, [r0] + lsls r0, 2 + adds r2, r0 + ldrb r0, [r2, 0x2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0x2] + ldr r1, [r7] + adds r1, r6 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_080BCD0A: + lsls r0, r4, 16 + ldr r3, =0xffff0000 + adds r0, r3 + lsrs r4, r0, 16 + lsls r0, r4, 16 + cmp r0, 0 + bge _080BCCAA + b _080BCDB4 + .pool +_080BCD30: + movs r4, 0 + mov r5, sp + ldr r7, =0x02039b4c + mov r8, r7 + ldr r6, =0x0000060c + ldr r0, =0x00000181 + mov r9, r0 +_080BCD3E: + ldr r1, =gUnknown_0855CCDE + lsls r4, 16 + asrs r0, r4, 15 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r5, 0x4] + ldrh r0, [r5, 0x4] + bl NationalToHoennOrder + lsls r0, 16 + lsrs r0, 16 + adds r7, r4, 0 + ldrh r1, [r5] + cmp r0, r1 + bhi _080BCDA6 + ldrh r0, [r5, 0x4] + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080BCDA6 + mov r3, r8 + ldr r2, [r3] + adds r3, r2, r6 + ldrh r0, [r3] + lsls r0, 2 + adds r0, r2, r0 + ldrh r1, [r5, 0x4] + strh r1, [r0] + ldrh r0, [r3] + lsls r0, 2 + adds r2, r0 + ldrb r0, [r2, 0x2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x2] + mov r4, r8 + ldr r2, [r4] + adds r0, r2, r6 + ldrh r0, [r0] + lsls r0, 2 + adds r2, r0 + ldrb r0, [r2, 0x2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0x2] + ldr r1, [r4] + adds r1, r6 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_080BCDA6: + movs r1, 0x80 + lsls r1, 9 + adds r0, r7, r1 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, r9 + ble _080BCD3E +_080BCDB4: + ldr r1, =0x02039b4c + ldr r0, [r1] + ldr r2, =0x0000060c + adds r0, r2 + ldrh r4, [r0] + lsls r3, r4, 16 + asrs r0, r3, 16 + ldr r2, =0x00000181 + cmp r0, r2 + bgt _080BCE08 + adds r5, r1, 0 + movs r4, 0x2 + negs r4, r4 + mov r9, r4 + movs r7, 0x3 + negs r7, r7 + mov r8, r7 + adds r7, r2, 0 + ldr r0, =0x0000ffff + adds r6, r0, 0 +_080BCDDC: + ldr r1, [r5] + asrs r3, 16 + lsls r4, r3, 2 + adds r1, r4 + ldrh r0, [r1] + orrs r0, r6 + strh r0, [r1] + ldrb r2, [r1, 0x2] + mov r0, r9 + ands r0, r2 + strb r0, [r1, 0x2] + ldr r1, [r5] + adds r1, r4 + ldrb r2, [r1, 0x2] + mov r0, r8 + ands r0, r2 + strb r0, [r1, 0x2] + adds r3, 0x1 + lsls r3, 16 + asrs r0, r3, 16 + cmp r0, r7 + ble _080BCDDC +_080BCE08: + 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_80BC8D4 + + thumb_func_start sub_80BCE2C +sub_80BCE2C: @ 80BCE2C + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x18 + mov r8, r3 + ldr r3, [sp, 0x2C] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r3, 24 + add r4, sp, 0x14 + movs r6, 0 + strb r6, [r4] + adds r5, r4, 0 + movs r4, 0xF + strb r4, [r5, 0x1] + movs r4, 0x3 + strb r4, [r5, 0x2] + mov r4, r8 + lsls r4, 27 + lsrs r4, 24 + mov r8, r4 + lsrs r3, 21 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + str r6, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r4, 0x1 + negs r4, r4 + str r4, [sp, 0xC] + str r2, [sp, 0x10] + mov r2, r8 + bl AddTextPrinterParametrized2 + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80BCE2C + + thumb_func_start sub_80BCE84 +sub_80BCE84: @ 80BCE84 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r7, r2, 16 + cmp r0, 0x1 + beq _080BCF7C + cmp r0, 0x1 + ble _080BCEA8 + cmp r0, 0x2 + bne _080BCEA8 + b _080BD074 +_080BCEA8: + subs r0, r1, 0x5 + lsls r0, 16 + lsrs r1, r0, 16 + movs r0, 0 + mov r9, r0 +_080BCEB2: + lsls r0, r1, 16 + lsrs r5, r0, 16 + mov r10, r0 + ldr r1, =0x00000181 + cmp r5, r1 + bhi _080BCED2 + ldr r2, =0x02039b4c + mov r8, r2 + ldr r0, [r2] + mov r3, r10 + asrs r6, r3, 14 + adds r0, r6 + ldrh r0, [r0] + ldr r1, =0x0000ffff + cmp r0, r1 + bne _080BCEF0 +_080BCED2: + mov r2, r9 + lsls r1, r2, 25 + lsrs r1, 24 + movs r0, 0x11 + adds r2, r7, 0 + bl sub_80BD28C + b _080BCF64 + .pool +_080BCEF0: + mov r3, r9 + lsls r0, r3, 25 + lsrs r4, r0, 24 + movs r0, 0x11 + adds r1, r4, 0 + adds r2, r7, 0 + bl sub_80BD28C + mov r1, r8 + ldr r0, [r1] + adds r0, r6 + ldrb r0, [r0, 0x2] + lsls r0, 31 + cmp r0, 0 + beq _080BCF42 + adds r0, r5, 0 + movs r1, 0x12 + adds r2, r4, 0 + adds r3, r7, 0 + bl sub_80BD154 + mov r2, r8 + ldr r0, [r2] + adds r0, r6 + ldrb r0, [r0, 0x2] + lsls r0, 30 + lsrs r0, 31 + movs r1, 0x11 + adds r2, r4, 0 + adds r3, r7, 0 + bl sub_80BD1F4 + mov r3, r8 + ldr r0, [r3] + adds r0, r6 + ldrh r0, [r0] + movs r1, 0x16 + adds r2, r4, 0 + bl sub_80BD23C + b _080BCF64 +_080BCF42: + adds r0, r5, 0 + movs r1, 0x12 + adds r2, r4, 0 + adds r3, r7, 0 + bl sub_80BD154 + movs r0, 0 + movs r1, 0x11 + adds r2, r4, 0 + adds r3, r7, 0 + bl sub_80BD1F4 + movs r0, 0 + movs r1, 0x16 + adds r2, r4, 0 + bl sub_80BD23C +_080BCF64: + movs r0, 0x80 + lsls r0, 9 + add r0, r10 + lsrs r1, r0, 16 + mov r0, r9 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + cmp r0, 0xA + bls _080BCEB2 + b _080BD13E +_080BCF7C: + subs r0, r1, 0x5 + lsls r1, r0, 16 + lsrs r5, r1, 16 + ldr r0, =0x00000181 + ldr r2, =0x02039b4c + cmp r5, r0 + bhi _080BCF9A + adds r6, r2, 0 + ldr r3, [r6] + asrs r4, r1, 14 + adds r0, r3, r4 + ldrh r1, [r0] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _080BCFB8 +_080BCF9A: + ldr r0, [r2] + movs r1, 0xC6 + lsls r1, 3 + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r1, 25 + b _080BD0B2 + .pool +_080BCFB8: + movs r1, 0xC6 + lsls r1, 3 + adds r0, r3, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r1, 25 + lsrs r1, 24 + movs r0, 0x11 + adds r2, r7, 0 + bl sub_80BD28C + ldr r1, [r6] + adds r0, r1, r4 + ldrb r0, [r0, 0x2] + lsls r0, 31 + cmp r0, 0 + beq _080BD028 + movs r3, 0xC6 + lsls r3, 3 + adds r0, r1, r3 + movs r1, 0 + ldrsh r2, [r0, r1] + lsls r2, 25 + lsrs r2, 24 + adds r0, r5, 0 + movs r1, 0x12 + adds r3, r7, 0 + bl sub_80BD154 + ldr r1, [r6] + adds r0, r1, r4 + ldrb r0, [r0, 0x2] + lsls r0, 30 + lsrs r0, 31 + movs r2, 0xC6 + lsls r2, 3 + adds r1, r2 + movs r3, 0 + ldrsh r2, [r1, r3] + lsls r2, 25 + lsrs r2, 24 + movs r1, 0x11 + adds r3, r7, 0 + bl sub_80BD1F4 + ldr r1, [r6] + adds r0, r1, r4 + ldrh r0, [r0] + movs r2, 0xC6 + lsls r2, 3 + adds r1, r2 + movs r3, 0 + ldrsh r2, [r1, r3] + lsls r2, 25 + lsrs r2, 24 + b _080BD06C +_080BD028: + movs r2, 0xC6 + lsls r2, 3 + adds r0, r1, r2 + movs r3, 0 + ldrsh r2, [r0, r3] + lsls r2, 25 + lsrs r2, 24 + adds r0, r5, 0 + movs r1, 0x12 + adds r3, r7, 0 + bl sub_80BD154 + ldr r0, [r6] + movs r1, 0xC6 + lsls r1, 3 + adds r0, r1 + movs r3, 0 + ldrsh r2, [r0, r3] + lsls r2, 25 + lsrs r2, 24 + movs r0, 0 + movs r1, 0x11 + adds r3, r7, 0 + bl sub_80BD1F4 + ldr r0, [r6] + movs r1, 0xC6 + lsls r1, 3 + adds r0, r1 + movs r3, 0 + ldrsh r2, [r0, r3] + lsls r2, 25 + lsrs r2, 24 + movs r0, 0 +_080BD06C: + movs r1, 0x16 + bl sub_80BD23C + b _080BD13E +_080BD074: + adds r0, r1, 0x5 + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =0x02039b4c + mov r8, r0 + ldr r3, [r0] + movs r2, 0xC6 + lsls r2, 3 + adds r0, r3, r2 + ldrh r0, [r0] + adds r0, 0xA + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0xF + bls _080BD09A + adds r0, r2, 0 + subs r0, 0x10 + lsls r0, 16 + lsrs r2, r0, 16 +_080BD09A: + lsls r1, 16 + lsrs r5, r1, 16 + ldr r0, =0x00000181 + cmp r5, r0 + bhi _080BD0B0 + asrs r6, r1, 14 + adds r0, r3, r6 + ldrh r1, [r0] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _080BD0CC +_080BD0B0: + lsls r1, r2, 25 +_080BD0B2: + lsrs r1, 24 + movs r0, 0x11 + adds r2, r7, 0 + bl sub_80BD28C + b _080BD13E + .pool +_080BD0CC: + lsls r0, r2, 25 + lsrs r4, r0, 24 + movs r0, 0x11 + adds r1, r4, 0 + adds r2, r7, 0 + bl sub_80BD28C + mov r3, r8 + ldr r0, [r3] + adds r0, r6 + ldrb r0, [r0, 0x2] + lsls r0, 31 + cmp r0, 0 + beq _080BD11C + adds r0, r5, 0 + movs r1, 0x12 + adds r2, r4, 0 + adds r3, r7, 0 + bl sub_80BD154 + mov r1, r8 + ldr r0, [r1] + adds r0, r6 + ldrb r0, [r0, 0x2] + lsls r0, 30 + lsrs r0, 31 + movs r1, 0x11 + adds r2, r4, 0 + adds r3, r7, 0 + bl sub_80BD1F4 + mov r2, r8 + ldr r0, [r2] + adds r0, r6 + ldrh r0, [r0] + movs r1, 0x16 + adds r2, r4, 0 + bl sub_80BD23C + b _080BD13E +_080BD11C: + adds r0, r5, 0 + movs r1, 0x12 + adds r2, r4, 0 + adds r3, r7, 0 + bl sub_80BD154 + movs r0, 0 + movs r1, 0x11 + adds r2, r4, 0 + adds r3, r7, 0 + bl sub_80BD1F4 + movs r0, 0 + movs r1, 0x16 + adds r2, r4, 0 + bl sub_80BD23C +_080BD13E: + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80BCE84 + + thumb_func_start sub_80BD154 +sub_80BD154: @ 80BD154 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r2, 24 + lsrs r7, r2, 24 + ldr r1, =gUnknown_0855D2B8 + add r0, sp, 0x4 + movs r2, 0x6 + bl memcpy + ldr r0, =0x02039b4c + ldr r0, [r0] + lsls r4, 2 + adds r4, r0, r4 + ldrh r6, [r4] + ldr r1, =0x00000612 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _080BD194 + adds r0, r6, 0 + bl NationalToHoennOrder + lsls r0, 16 + lsrs r6, r0, 16 +_080BD194: + add r4, sp, 0x4 + adds r0, r6, 0 + movs r1, 0x64 + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r4, 0x2] + add r5, sp, 0x4 + adds r0, r6, 0 + movs r1, 0x64 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + movs r1, 0xA + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r5, 0x3] + add r5, sp, 0x4 + adds r0, r4, 0 + movs r1, 0xA + bl __umodsi3 + adds r0, 0xA1 + strb r0, [r5, 0x4] + str r7, [sp] + movs r0, 0 + movs r1, 0x7 + add r2, sp, 0x4 + mov r3, r8 + bl sub_80BCE2C + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BD154 + + thumb_func_start sub_80BD1F4 +sub_80BD1F4: @ 80BD1F4 + push {r4,lr} + sub sp, 0x8 + lsls r0, 16 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r2, 24 + lsrs r4, r2, 24 + cmp r0, 0 + beq _080BD220 + ldr r1, =gUnknown_0855D2BE + lsls r2, r3, 3 + lsls r3, r4, 3 + movs r0, 0x8 + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + movs r0, 0 + bl BlitBitmapToWindow + b _080BD234 + .pool +_080BD220: + lsls r2, r3, 3 + lsls r3, r4, 3 + movs r0, 0x8 + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + bl FillWindowPixelRect +_080BD234: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80BD1F4 + + thumb_func_start sub_80BD23C +sub_80BD23C: @ 80BD23C + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r0, 16 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + bl NationalPokedexNumToSpecies + adds r1, r0, 0 + cmp r1, 0 + beq _080BD264 + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r4, r1, r0 + b _080BD266 + .pool +_080BD264: + ldr r4, =gUnknown_0855D2FE +_080BD266: + str r5, [sp] + movs r0, 0 + movs r1, 0x7 + adds r2, r4, 0 + adds r3, r6, 0 + bl sub_80BCE2C + adds r0, r4, 0 + bl GetStringLength + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80BD23C + + thumb_func_start sub_80BD28C +sub_80BD28C: @ 80BD28C + push {lr} + sub sp, 0x8 + adds r2, r0, 0 + adds r3, r1, 0 + lsls r2, 24 + lsls r3, 24 + lsrs r2, 21 + lsrs r3, 21 + movs r0, 0x60 + str r0, [sp] + movs r0, 0x10 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + bl FillWindowPixelRect + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_80BD28C + + thumb_func_start sub_80BD2B4 +sub_80BD2B4: @ 80BD2B4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + ldr r2, =0x02037fd4 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + movs r2, 0 + ldr r7, =0x02039b4c + adds r5, r7, 0 + ldr r4, =0x0000061e + ldr r0, =0x0000ffff + adds r3, r0, 0 +_080BD2DA: + 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, 0x3 + bls _080BD2DA + ldr r0, [r7] + ldr r1, =0x00000626 + adds r0, r1 + ldr r1, =0x0000ffff + strh r1, [r0] + subs r0, r6, 0x1 + lsls r0, 16 + lsrs r0, 16 + bl sub_80BDA8C + lsls r0, 16 + lsrs r0, 16 + ldr r4, =0x0000ffff + cmp r0, r4 + beq _080BD334 + movs r1, 0x60 + movs r2, 0x50 + bl sub_80BDACC + lsls r0, 24 + lsrs r1, r0, 24 + ldr r3, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x1C + adds r1, r0, r1 + ldr r2, =sub_80BE4E0 + str r2, [r1] + adds r0, r3 + ldr r1, =0x0000ffe0 + strh r1, [r0, 0x38] +_080BD334: + adds r0, r6, 0 + bl sub_80BDA8C + lsls r0, 16 + lsrs r0, 16 + cmp r0, r4 + beq _080BD366 + movs r1, 0x60 + movs r2, 0x50 + bl sub_80BDACC + lsls r0, 24 + lsrs r1, r0, 24 + ldr r3, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x1C + adds r1, r0, r1 + ldr r2, =sub_80BE4E0 + str r2, [r1] + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x38] +_080BD366: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r0, 16 + bl sub_80BDA8C + lsls r0, 16 + lsrs r0, 16 + cmp r0, r4 + beq _080BD39C + movs r1, 0x60 + movs r2, 0x50 + bl sub_80BDACC + lsls r0, 24 + lsrs r1, r0, 24 + ldr r3, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x1C + adds r1, r0, r1 + ldr r2, =sub_80BE4E0 + str r2, [r1] + adds r0, r3 + movs r1, 0x20 + strh r1, [r0, 0x38] +_080BD39C: + movs r0, 0 + adds r1, r6, 0 + mov r2, r8 + bl sub_80BCE84 + ldr r0, [r7] + ldr r2, =0x0000062d + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x1A + bl SetGpuReg + ldr r0, [r7] + movs r2, 0xC6 + lsls r2, 3 + adds r1, r0, r2 + movs r2, 0 + strh r2, [r1] + ldr r1, =0x00000632 + adds r0, r1 + strh r2, [r0] + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BD2B4 + + thumb_func_start sub_80BD404 +sub_80BD404: @ 80BD404 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r0, =0x02039b4c + ldr r1, [r0] + ldr r3, =0x0000062e + adds r2, r1, r3 + ldrb r3, [r2] + adds r7, r0, 0 + cmp r3, 0 + bne _080BD428 + b _080BD578 +_080BD428: + subs r0, r3, 0x1 + strb r0, [r2] + cmp r4, 0x1 + beq _080BD440 + cmp r4, 0x2 + beq _080BD4DC + b _080BD558 + .pool +_080BD440: + movs r3, 0 + ldr r4, =0x0000ffff + mov r12, r4 + ldr r0, =0x02020630 + mov r8, r0 + adds r2, r7, 0 +_080BD44C: + ldr r0, [r2] + lsls r1, r3, 1 + ldr r4, =0x0000061e + adds r0, r4 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, r12 + beq _080BD46A + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrh r0, [r1, 0x38] + adds r0, r5 + strh r0, [r1, 0x38] +_080BD46A: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x3 + bls _080BD44C + ldr r4, [r7] + ldr r1, =0x0000062e + adds r0, r4, r1 + ldrb r0, [r0] + subs r0, r6, r0 + lsls r0, 4 + adds r1, r6, 0 + bl __divsi3 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r3, =0x0000062d + adds r0, r4, r3 + ldr r1, =0x00000632 + adds r4, r1 + movs r3, 0 + ldrsh r1, [r4, r3] + lsls r1, 4 + ldrb r0, [r0] + adds r1, r0 + subs r1, r2 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1A + bl SetGpuReg + ldr r0, [r7] + ldr r4, =0x0000062c + adds r2, r0, r4 + movs r1, 0xC5 + lsls r1, 3 + adds r0, r1 + ldrb r1, [r0] + ldrb r0, [r2] + subs r0, r1 + strb r0, [r2] + b _080BD558 + .pool +_080BD4DC: + movs r3, 0 + ldr r2, =0x0000ffff + mov r12, r2 + ldr r4, =0x02020630 + mov r8, r4 + adds r2, r7, 0 +_080BD4E8: + ldr r0, [r2] + lsls r1, r3, 1 + ldr r4, =0x0000061e + adds r0, r4 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, r12 + beq _080BD506 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + ldrh r0, [r1, 0x38] + subs r0, r5 + strh r0, [r1, 0x38] +_080BD506: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x3 + bls _080BD4E8 + ldr r4, [r7] + ldr r1, =0x0000062e + adds r0, r4, r1 + ldrb r0, [r0] + subs r0, r6, r0 + lsls r0, 4 + adds r1, r6, 0 + bl __divsi3 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r3, =0x0000062d + adds r0, r4, r3 + ldr r1, =0x00000632 + adds r4, r1 + movs r3, 0 + ldrsh r1, [r4, r3] + lsls r1, 4 + ldrb r0, [r0] + adds r1, r0 + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1A + bl SetGpuReg + ldr r0, [r7] + ldr r4, =0x0000062c + adds r1, r0, r4 + movs r2, 0xC5 + lsls r2, 3 + adds r0, r2 + ldrb r0, [r0] + ldrb r3, [r1] + adds r0, r3 + strb r0, [r1] +_080BD558: + movs r0, 0 + b _080BD598 + .pool +_080BD578: + ldr r4, =0x0000062d + adds r2, r1, r4 + movs r3, 0xC6 + lsls r3, 3 + adds r0, r1, r3 + movs r4, 0 + ldrsh r1, [r0, r4] + lsls r1, 4 + ldrb r2, [r2] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1A + bl SetGpuReg + movs r0, 0x1 +_080BD598: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80BD404 + + thumb_func_start sub_80BD5A8 +sub_80BD5A8: @ 80BD5A8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 16 + lsrs r3, r1, 16 + ldr r4, =0x02039b4c + ldr r0, [r4] + movs r5, 0xC6 + lsls r5, 3 + adds r1, r0, r5 + ldrh r1, [r1] + ldr r6, =0x00000632 + adds r0, r6 + strh r1, [r0] + cmp r2, 0x1 + beq _080BD5D8 + cmp r2, 0x2 + beq _080BD638 + b _080BD694 + .pool +_080BD5D8: + subs r0, r3, 0x1 + lsls r0, 16 + lsrs r0, 16 + bl sub_80BDA8C + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =0x0000ffff + cmp r1, r0 + beq _080BD612 + adds r0, r1, 0 + movs r1, 0x60 + movs r2, 0x50 + bl sub_80BDACC + lsls r0, 24 + lsrs r1, r0, 24 + ldr r3, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x1C + adds r1, r0, r1 + ldr r2, =sub_80BE4E0 + str r2, [r1] + adds r0, r3 + ldr r1, =0x0000ffc0 + strh r1, [r0, 0x38] +_080BD612: + ldr r0, [r4] + adds r1, r0, r5 + ldrh r2, [r1] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + ble _080BD634 + subs r0, r2, 0x1 + b _080BD692 + .pool +_080BD634: + movs r0, 0xF + b _080BD692 +_080BD638: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r0, 16 + bl sub_80BDA8C + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =0x0000ffff + cmp r1, r0 + beq _080BD672 + adds r0, r1, 0 + movs r1, 0x60 + movs r2, 0x50 + bl sub_80BDACC + lsls r0, 24 + lsrs r1, r0, 24 + ldr r3, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x1C + adds r1, r0, r1 + ldr r2, =sub_80BE4E0 + str r2, [r1] + adds r0, r3 + movs r1, 0x40 + strh r1, [r0, 0x38] +_080BD672: + ldr r0, [r4] + adds r1, r0, r5 + ldrh r2, [r1] + movs r6, 0 + ldrsh r0, [r1, r6] + cmp r0, 0xE + bgt _080BD690 + adds r0, r2, 0x1 + b _080BD692 + .pool +_080BD690: + movs r0, 0 +_080BD692: + strh r0, [r1] +_080BD694: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80BD5A8 + + thumb_func_start sub_80BD69C +sub_80BD69C: @ 80BD69C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r7, r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + movs r0, 0 + mov r10, r0 + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2C] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080BD6FC + cmp r7, 0 + beq _080BD6FC + movs r1, 0x1 + mov r10, r1 + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r2, =0x0000060c + adds r0, r2 + ldrh r3, [r0] + subs r3, 0x1 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0 + bl sub_80C0E0C + adds r7, r0, 0 + movs r0, 0x1 + adds r1, r7, 0 + bl sub_80BD5A8 + movs r0, 0x1 + b _080BD734 + .pool +_080BD6FC: + ldrh r1, [r2, 0x2C] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080BD74C + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r3, =0x0000060c + adds r0, r3 + ldrh r0, [r0] + subs r0, 0x1 + cmp r7, r0 + bge _080BD74C + movs r1, 0x2 + mov r10, r1 + lsls r3, r0, 16 + lsrs r3, 16 + movs r0, 0 + adds r1, r7, 0 + movs r2, 0 + bl sub_80C0E0C + adds r7, r0, 0 + movs r0, 0x2 + adds r1, r7, 0 + bl sub_80BD5A8 + movs r0, 0x2 +_080BD734: + adds r1, r7, 0 + adds r2, r4, 0 + bl sub_80BCE84 + movs r0, 0x6C + bl audio_play + b _080BD81A + .pool +_080BD74C: + ldrh r1, [r2, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080BD7B4 + cmp r7, 0 + beq _080BD7B4 + adds r6, r7, 0 + movs r4, 0 +_080BD75E: + ldr r5, =0x02039b4c + ldr r0, [r5] + ldr r2, =0x0000060c + adds r0, r2 + ldrh r3, [r0] + subs r3, 0x1 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x1 + adds r1, r7, 0 + movs r2, 0 + bl sub_80C0E0C + adds r7, r0, 0 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _080BD75E + ldr r1, [r5] + ldr r3, =0x0000062c + adds r1, r3 + subs r0, r7, r6 + lsls r0, 4 + ldrb r2, [r1] + adds r0, r2 + strb r0, [r1] + bl sub_80BDA40 + adds r0, r7, 0 + movs r1, 0xE + bl sub_80BD2B4 + movs r0, 0x6D + bl audio_play + b _080BD81A + .pool +_080BD7B4: + ldrh r1, [r2, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080BD81A + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r3, =0x0000060c + adds r0, r3 + ldrh r0, [r0] + subs r0, 0x1 + cmp r7, r0 + bge _080BD81A + adds r6, r7, 0 + movs r4, 0 +_080BD7D2: + ldr r5, =0x02039b4c + ldr r0, [r5] + ldr r1, =0x0000060c + adds r0, r1 + ldrh r3, [r0] + subs r3, 0x1 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0 + adds r1, r7, 0 + movs r2, 0 + bl sub_80C0E0C + adds r7, r0, 0 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _080BD7D2 + ldr r1, [r5] + ldr r2, =0x0000062c + adds r1, r2 + subs r0, r7, r6 + lsls r0, 4 + ldrb r3, [r1] + adds r0, r3 + strb r0, [r1] + bl sub_80BDA40 + adds r0, r7, 0 + movs r1, 0xE + bl sub_80BD2B4 + movs r0, 0x6D + bl audio_play +_080BD81A: + mov r0, r10 + cmp r0, 0 + bne _080BD83C + ldr r0, =0x02039b4c + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 3 + adds r0, r1 + mov r2, r10 + strh r2, [r0] + b _080BD8A2 + .pool +_080BD83C: + ldr r1, =gUnknown_0855D28C + ldr r6, =0x02039b4c + ldr r2, [r6] + movs r3, 0xC7 + lsls r3, 3 + mov r9, r3 + adds r0, r2, r3 + ldrh r0, [r0] + lsrs r0, 2 + adds r1, r0, r1 + ldrb r5, [r1] + ldr r1, =gUnknown_0855D291 + adds r0, r1 + ldrb r3, [r0] + ldr r0, =0x0000062e + adds r2, r0 + strb r3, [r2] + ldr r1, [r6] + ldr r2, =0x00000636 + mov r8, r2 + adds r0, r1, r2 + strh r3, [r0] + ldr r4, =0x00000634 + adds r0, r1, r4 + strh r5, [r0] + ldr r3, =0x0000062f + adds r1, r3 + mov r0, r10 + strb r0, [r1] + ldr r2, [r6] + lsrs r5, 1 + movs r1, 0xC5 + lsls r1, 3 + adds r0, r2, r1 + strh r5, [r0] + adds r3, r2, r3 + ldrb r0, [r3] + adds r4, r2, r4 + ldrb r1, [r4] + add r2, r8 + ldrb r2, [r2] + bl sub_80BD404 + ldr r0, [r6] + mov r2, r9 + adds r1, r0, r2 + ldrh r0, [r1] + cmp r0, 0xB + bhi _080BD8A2 + adds r0, 0x1 + strh r0, [r1] +_080BD8A2: + 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_80BD69C + + thumb_func_start sub_80BD8D0 +sub_80BD8D0: @ 80BD8D0 + push {r4-r7,lr} + movs r4, 0 + ldr r0, =0x02039b4c + mov r12, r0 + ldr r6, =0x02020630 + ldr r5, =0x0000ffff +_080BD8DC: + mov r1, r12 + ldr r3, [r1] + lsls r1, r4, 1 + ldr r2, =0x0000061e + adds r0, r3, r2 + adds r0, r1 + ldrh r2, [r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r6 + movs r7, 0x24 + ldrsh r0, [r1, r7] + cmp r0, 0 + bne _080BD90C + movs r7, 0x26 + ldrsh r0, [r1, r7] + cmp r0, 0 + bne _080BD90C + cmp r2, r5 + beq _080BD90C + ldr r1, =0x00000626 + adds r0, r3, r1 + strh r2, [r0] +_080BD90C: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _080BD8DC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BD8D0 + + thumb_func_start sub_80BD930 +sub_80BD930: @ 80BD930 + push {r4-r6,lr} + ldr r3, =0x02039b4c + ldr r0, [r3] + ldr r1, =0x0000060e + adds r0, r1 + ldrh r4, [r0] + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080BD9B8 + cmp r4, 0 + beq _080BD9B8 + adds r2, r4, 0 + adds r5, r3, 0 +_080BD950: + ldr r0, [r5] + ldr r1, =0x0000060c + adds r0, r1 + ldrh r3, [r0] + subs r3, 0x1 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x1 + adds r1, r2, 0 + movs r2, 0 + bl sub_80C0E0C + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r1 + ldrb r0, [r0, 0x2] + lsls r0, 31 + cmp r0, 0 + bne _080BD9A0 + cmp r2, 0 + bne _080BD950 +_080BD97E: + ldr r0, =0x02039b4c + ldr r1, [r0] + ldr r0, =0x0000060e + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, r4 + bne _080BD9A4 + b _080BDA38 + .pool +_080BD9A0: + adds r4, r2, 0 + b _080BD97E +_080BD9A4: + strh r4, [r2] + ldr r0, =0x0000062c + adds r1, r0 + ldrb r0, [r1] + subs r0, 0x10 + b _080BDA20 + .pool +_080BD9B4: + adds r4, r2, 0 + b _080BDA08 +_080BD9B8: + ldrh r1, [r2, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080BDA38 + ldr r0, [r3] + ldr r1, =0x0000060c + adds r0, r1 + ldrh r0, [r0] + subs r0, 0x1 + cmp r4, r0 + bge _080BDA38 + adds r2, r4, 0 + adds r6, r3, 0 + adds r5, r1, 0 +_080BD9D6: + ldr r0, [r6] + adds r0, r5 + ldrh r3, [r0] + subs r3, 0x1 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0 + adds r1, r2, 0 + movs r2, 0 + bl sub_80C0E0C + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, [r6] + lsls r0, r2, 2 + adds r0, r1, r0 + ldrb r0, [r0, 0x2] + lsls r0, 31 + cmp r0, 0 + bne _080BD9B4 + adds r0, r1, r5 + ldrh r0, [r0] + subs r0, 0x1 + cmp r2, r0 + blt _080BD9D6 +_080BDA08: + ldr r0, =0x02039b4c + ldr r1, [r0] + ldr r0, =0x0000060e + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, r4 + beq _080BDA38 + strh r4, [r2] + ldr r0, =0x0000062c + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x10 +_080BDA20: + strb r0, [r1] + movs r0, 0x1 + b _080BDA3A + .pool +_080BDA38: + movs r0, 0 +_080BDA3A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80BD930 + + thumb_func_start sub_80BDA40 +sub_80BDA40: @ 80BDA40 + push {r4-r7,lr} + movs r5, 0 + ldr r6, =0x02039b4c + ldr r7, =0x0000ffff +_080BDA48: + ldr r0, [r6] + lsls r4, r5, 1 + ldr r1, =0x0000061e + adds r0, r1 + adds r1, r0, r4 + ldrh r0, [r1] + cmp r0, r7 + beq _080BDA6C + bl sub_818D820 + ldr r1, [r6] + ldr r0, =0x0000061e + adds r1, r0 + adds r1, r4 + ldrh r2, [r1] + adds r0, r7, 0 + orrs r0, r2 + strh r0, [r1] +_080BDA6C: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x3 + bls _080BDA48 + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80BDA40 + + thumb_func_start sub_80BDA8C +sub_80BDA8C: @ 80BDA8C + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =0x00000181 + cmp r2, r0 + bhi _080BDAA8 + ldr r0, =0x02039b4c + ldr r1, [r0] + lsls r0, r2, 2 + adds r2, r1, r0 + ldrh r1, [r2] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _080BDAB8 +_080BDAA8: + ldr r0, =0x0000ffff + b _080BDAC6 + .pool +_080BDAB8: + ldrb r0, [r2, 0x2] + lsls r0, 31 + cmp r0, 0 + bne _080BDAC4 + movs r0, 0 + b _080BDAC6 +_080BDAC4: + ldrh r0, [r2] +_080BDAC6: + pop {r1} + bx r1 + thumb_func_end sub_80BDA8C + + thumb_func_start sub_80BDACC +sub_80BDACC: @ 80BDACC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r2, 16 + lsrs r2, 16 + movs r6, 0 + ldr r0, =0x02039b4c + mov r9, r0 + ldr r3, =0x0000ffff + lsls r1, 16 +_080BDAE8: + mov r4, r9 + ldr r0, [r4] + lsls r7, r6, 1 + ldr r4, =0x0000061e + adds r0, r4 + adds r0, r7 + ldrh r0, [r0] + cmp r0, r3 + bne _080BDB60 + lsls r2, 16 + mov r0, r8 + asrs r1, 16 + asrs r2, 16 + adds r3, r6, 0 + bl sub_80C0E9C + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =0x02020630 + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + adds r4, r0 + ldrb r1, [r4, 0x1] + movs r2, 0x4 + negs r2, r2 + adds r0, r2, 0 + ands r1, r0 + movs r0, 0x1 + orrs r1, r0 + strb r1, [r4, 0x1] + ldrb r0, [r4, 0x5] + movs r1, 0xC + orrs r0, r1 + strb r0, [r4, 0x5] + movs r0, 0 + strh r0, [r4, 0x2E] + strh r6, [r4, 0x30] + mov r0, r8 + bl NationalPokedexNumToSpecies + strh r0, [r4, 0x32] + mov r4, r9 + ldr r0, [r4] + ldr r1, =0x0000061e + adds r0, r1 + adds r0, r7 + strh r5, [r0] + adds r0, r5, 0 + b _080BDB6C + .pool +_080BDB60: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _080BDAE8 + ldr r0, =0x0000ffff +_080BDB6C: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80BDACC + + thumb_func_start sub_80BDB7C +sub_80BDB7C: @ 80BDB7C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r8, r0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r4, =gUnknown_0855D1AC + adds r0, r4, 0 + movs r1, 0xB8 + movs r2, 0x4 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x02020630 + mov r10, r1 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + add r0, r10 + movs r1, 0 + strh r1, [r0, 0x30] + adds r0, r4, 0 + movs r1, 0xB8 + movs r2, 0x9C + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + add r0, r10 + movs r1, 0x1 + strh r1, [r0, 0x30] + adds r0, 0x3F + ldrb r1, [r0] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0] + ldr r0, =gUnknown_0855D194 + movs r1, 0xE6 + movs r2, 0x14 + movs r3, 0 + bl AddObjectToFront + ldr r5, =gUnknown_0855D1C4 + adds r0, r5, 0 + movs r1, 0x10 + movs r2, 0x78 + movs r3, 0 + bl AddObjectToFront + adds r0, r5, 0 + movs r1, 0x30 + movs r2, 0x78 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + add r0, r10 + movs r1, 0x3 + bl StartObjectImageAnim + adds r0, r5, 0 + movs r1, 0x10 + movs r2, 0x90 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + add r4, r10 + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectImageAnim + movs r0, 0x80 + mov r9, r0 + mov r1, r9 + strh r1, [r4, 0x32] + adds r0, r5, 0 + movs r1, 0x30 + movs r2, 0x90 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + add r0, r10 + movs r1, 0x1 + bl StartObjectImageAnim + ldr r6, =gUnknown_0855D1DC + adds r0, r6, 0 + movs r1, 0 + movs r2, 0x50 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + add r1, r10 + ldrb r2, [r1, 0x1] + movs r4, 0x4 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + movs r5, 0x1 + orrs r0, r5 + strb r0, [r1, 0x1] + ldrb r2, [r1, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r2 + movs r2, 0x3C + orrs r0, r2 + strb r0, [r1, 0x3] + movs r0, 0x1E + strh r0, [r1, 0x2E] + movs r0, 0 + strh r0, [r1, 0x30] + adds r0, r6, 0 + movs r1, 0 + movs r2, 0x50 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + add r1, r10 + ldrb r0, [r1, 0x1] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0x1] + ldrb r0, [r1, 0x3] + movs r2, 0x3E + orrs r0, r2 + strb r0, [r1, 0x3] + movs r0, 0x1F + strh r0, [r1, 0x2E] + mov r0, r9 + strh r0, [r1, 0x30] + mov r1, r8 + cmp r1, 0 + beq _080BDCCC + b _080BE414 +_080BDCCC: + bl sub_809D42C + cmp r0, 0 + beq _080BDCD6 + b _080BDF4C +_080BDCD6: + ldr r4, =gUnknown_0855D1F4 + adds r0, r4, 0 + movs r1, 0x20 + movs r2, 0x28 + movs r3, 0x1 + bl AddObjectToFront + adds r0, r4, 0 + movs r1, 0x20 + movs r2, 0x48 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + add r0, r10 + movs r1, 0x1 + bl StartObjectImageAnim + movs r0, 0 + mov r8, r0 + ldr r0, =gUnknown_0855D224 + movs r1, 0x18 + movs r2, 0x30 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000061a + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + mov r1, r10 + adds r4, r0, r1 + lsls r1, r5, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + cmp r5, 0 + beq _080BDD6C + movs r0, 0x1 + mov r8, r0 + b _080BDD78 + .pool +_080BDD6C: + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BDD78: + ldr r0, =gUnknown_0855D224 + movs r1, 0x20 + movs r2, 0x30 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000061a + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + bne _080BDDB0 + mov r0, r8 + cmp r0, 0 + beq _080BDDD4 +_080BDDB0: + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + lsls r1, r5, 24 + lsrs r1, 24 + bl StartObjectImageAnim + b _080BDDE8 + .pool +_080BDDD4: + ldr r1, =0x02020630 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BDDE8: + ldr r6, =gUnknown_0855D224 + adds r0, r6, 0 + movs r1, 0x28 + movs r2, 0x30 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + ldr r5, =0x02039b4c + ldr r0, [r5] + ldr r1, =0x0000061a + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + adds r1, r0, 0 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + lsls r1, 24 + lsrs r1, 24 + bl StartObjectImageAnim + movs r0, 0 + mov r8, r0 + adds r0, r6, 0 + movs r1, 0x18 + movs r2, 0x50 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, [r5] + ldr r1, =0x0000061c + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r4, r0, r4 + lsls r1, r5, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + cmp r5, 0 + beq _080BDE80 + movs r0, 0x1 + mov r8, r0 + b _080BDE8C + .pool +_080BDE80: + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BDE8C: + ldr r0, =gUnknown_0855D224 + movs r1, 0x20 + movs r2, 0x50 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000061c + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + bne _080BDEC4 + mov r0, r8 + cmp r0, 0 + beq _080BDEE8 +_080BDEC4: + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + lsls r1, r5, 24 + lsrs r1, 24 + bl StartObjectImageAnim + b _080BDEFC + .pool +_080BDEE8: + ldr r1, =0x02020630 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BDEFC: + ldr r0, =gUnknown_0855D224 + movs r1, 0x28 + movs r2, 0x50 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000061c + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + adds r1, r0, 0 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r2, =0x02020630 + adds r0, r2 + lsls r1, 24 + lsrs r1, 24 + bl StartObjectImageAnim + b _080BE3E2 + .pool +_080BDF4C: + ldr r4, =gUnknown_0855D1F4 + adds r0, r4, 0 + movs r1, 0x20 + movs r2, 0x28 + movs r3, 0x1 + bl AddObjectToFront + adds r0, r4, 0 + movs r1, 0x20 + movs r2, 0x4C + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + add r0, r10 + movs r1, 0x1 + bl StartObjectImageAnim + ldr r4, =gUnknown_0855D20C + adds r0, r4, 0 + movs r1, 0x11 + movs r2, 0x2D + movs r3, 0x1 + bl AddObjectToFront + adds r0, r4, 0 + movs r1, 0x11 + movs r2, 0x37 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + add r0, r10 + movs r1, 0x1 + bl StartObjectImageAnim + adds r0, r4, 0 + movs r1, 0x11 + movs r2, 0x51 + movs r3, 0x1 + bl AddObjectToFront + adds r0, r4, 0 + movs r1, 0x11 + movs r2, 0x5B + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + add r0, r10 + movs r1, 0x1 + bl StartObjectImageAnim + movs r0, 0 + bl sub_80C0844 + lsls r0, 16 + lsrs r6, r0, 16 + movs r0, 0 + mov r8, r0 + ldr r0, =gUnknown_0855D23C + movs r1, 0x28 + movs r2, 0x2D + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r6, 0 + movs r1, 0x64 + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + mov r1, r10 + adds r4, r0, r1 + lsls r1, r5, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + cmp r5, 0 + beq _080BE024 + movs r0, 0x1 + mov r8, r0 + b _080BE030 + .pool +_080BE024: + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BE030: + ldr r0, =gUnknown_0855D23C + movs r1, 0x30 + movs r2, 0x2D + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r6, 0 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + bne _080BE060 + mov r1, r8 + cmp r1, 0 + beq _080BE07C +_080BE060: + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + lsls r1, r5, 24 + lsrs r1, 24 + bl StartObjectImageAnim + b _080BE090 + .pool +_080BE07C: + ldr r1, =0x02020630 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BE090: + ldr r5, =gUnknown_0855D23C + adds r0, r5, 0 + movs r1, 0x38 + movs r2, 0x2D + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r6, 0 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + adds r1, r0, 0 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + lsls r1, 24 + lsrs r1, 24 + bl StartObjectImageAnim + movs r0, 0 + mov r8, r0 + adds r0, r5, 0 + movs r1, 0x28 + movs r2, 0x37 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000061a + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r4, r0, r4 + lsls r1, r5, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + cmp r5, 0 + beq _080BE11C + movs r0, 0x1 + mov r8, r0 + b _080BE128 + .pool +_080BE11C: + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BE128: + ldr r0, =gUnknown_0855D23C + movs r1, 0x30 + movs r2, 0x37 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000061a + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + bne _080BE160 + mov r0, r8 + cmp r0, 0 + beq _080BE184 +_080BE160: + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + lsls r1, r5, 24 + lsrs r1, 24 + bl StartObjectImageAnim + b _080BE198 + .pool +_080BE184: + ldr r1, =0x02020630 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BE198: + ldr r5, =gUnknown_0855D23C + adds r0, r5, 0 + movs r1, 0x38 + movs r2, 0x37 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000061a + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + adds r1, r0, 0 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + lsls r1, 24 + lsrs r1, 24 + bl StartObjectImageAnim + movs r0, 0x1 + bl sub_80C0844 + lsls r0, 16 + lsrs r6, r0, 16 + movs r0, 0 + mov r8, r0 + adds r0, r5, 0 + movs r1, 0x28 + movs r2, 0x51 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r6, 0 + movs r1, 0x64 + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r4, r0, r4 + lsls r1, r5, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + cmp r5, 0 + beq _080BE230 + movs r1, 0x1 + mov r8, r1 + b _080BE23C + .pool +_080BE230: + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BE23C: + ldr r0, =gUnknown_0855D23C + movs r1, 0x30 + movs r2, 0x51 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r6, 0 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + bne _080BE26C + mov r0, r8 + cmp r0, 0 + beq _080BE288 +_080BE26C: + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + lsls r1, r5, 24 + lsrs r1, 24 + bl StartObjectImageAnim + b _080BE29C + .pool +_080BE288: + ldr r1, =0x02020630 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BE29C: + ldr r5, =gUnknown_0855D23C + adds r0, r5, 0 + movs r1, 0x38 + movs r2, 0x51 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r6, 0 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + adds r1, r0, 0 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + lsls r1, 24 + lsrs r1, 24 + bl StartObjectImageAnim + movs r1, 0 + mov r8, r1 + adds r0, r5, 0 + movs r1, 0x28 + movs r2, 0x5B + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000061c + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r4, r0, r4 + lsls r1, r5, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + cmp r5, 0 + beq _080BE328 + movs r0, 0x1 + mov r8, r0 + b _080BE334 + .pool +_080BE328: + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BE334: + ldr r0, =gUnknown_0855D23C + movs r1, 0x30 + movs r2, 0x5B + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000061c + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + bne _080BE36C + mov r0, r8 + cmp r0, 0 + beq _080BE390 +_080BE36C: + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + lsls r1, r5, 24 + lsrs r1, 24 + bl StartObjectImageAnim + b _080BE3A4 + .pool +_080BE390: + ldr r1, =0x02020630 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BE3A4: + ldr r0, =gUnknown_0855D23C + movs r1, 0x38 + movs r2, 0x5B + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000061c + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + adds r1, r0, 0 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r2, =0x02020630 + adds r0, r2 + lsls r1, 24 + lsrs r1, 24 + bl StartObjectImageAnim +_080BE3E2: + ldr r0, =gUnknown_0855D254 + movs r1, 0x88 + movs r2, 0x60 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x02020630 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r0, r1 + b _080BE42C + .pool +_080BE414: + ldr r0, =gUnknown_0855D254 + movs r1, 0x88 + movs r2, 0x50 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + add r0, r10 +_080BE42C: + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb 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_80BDB7C + + thumb_func_start nullsub_38 +nullsub_38: @ 80BE448 + bx lr + thumb_func_end nullsub_38 + + thumb_func_start sub_80BE44C +sub_80BE44C: @ 80BE44C + push {lr} + adds r1, r0, 0 + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r2, =0x0000064a + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080BE464 + adds r0, r1, 0 + bl RemoveObjectAndFreeTiles +_080BE464: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BE44C + + thumb_func_start sub_80BE470 +sub_80BE470: @ 80BE470 + push {lr} + adds r2, r0, 0 + ldrb r1, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x5] + ldrb r1, [r2, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x1] + movs r0, 0 + strh r0, [r2, 0x24] + strh r0, [r2, 0x26] + ldr r1, [r2, 0x20] + ldr r0, =0x00380030 + cmp r1, r0 + beq _080BE4D4 + ldrh r1, [r2, 0x20] + movs r3, 0x20 + ldrsh r0, [r2, r3] + cmp r0, 0x30 + ble _080BE4A4 + subs r0, r1, 0x1 + strh r0, [r2, 0x20] +_080BE4A4: + ldrh r1, [r2, 0x20] + movs r3, 0x20 + ldrsh r0, [r2, r3] + cmp r0, 0x2F + bgt _080BE4B2 + adds r0, r1, 0x1 + strh r0, [r2, 0x20] +_080BE4B2: + ldrh r1, [r2, 0x22] + movs r3, 0x22 + ldrsh r0, [r2, r3] + cmp r0, 0x38 + ble _080BE4C0 + subs r0, r1, 0x1 + strh r0, [r2, 0x22] +_080BE4C0: + ldrh r1, [r2, 0x22] + movs r3, 0x22 + ldrsh r0, [r2, r3] + cmp r0, 0x37 + bgt _080BE4D8 + adds r0, r1, 0x1 + strh r0, [r2, 0x22] + b _080BE4D8 + .pool +_080BE4D4: + ldr r0, =nullsub_38 + str r0, [r2, 0x1C] +_080BE4D8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BE470 + + thumb_func_start sub_80BE4E0 +sub_80BE4E0: @ 80BE4E0 + push {r4-r7,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, =0x02039b4c + ldr r1, [r7] + ldr r2, =0x0000064a + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080BE520 + cmp r0, 0x3 + beq _080BE520 + lsls r5, r6, 1 + ldr r4, =0x0000061e + adds r0, r1, r4 + adds r0, r5 + ldrh r0, [r0] + bl sub_818D820 + ldr r0, [r7] + adds r0, r4 + adds r0, r5 + b _080BE5EC + .pool +_080BE520: + ldr r2, =gUnknown_08329F40 + ldrh r0, [r4, 0x38] + lsls r0, 24 + lsrs r0, 23 + adds r0, r2 + movs r3, 0 + ldrsh r1, [r0, r3] + movs r0, 0x4C + muls r0, r1 + cmp r0, 0 + bge _080BE538 + adds r0, 0xFF +_080BE538: + asrs r0, 8 + strh r0, [r4, 0x26] + movs r1, 0x38 + ldrsh r0, [r4, r1] + adds r0, 0x40 + lsls r0, 1 + adds r0, r2 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0x80 + lsls r0, 9 + bl __divsi3 + adds r2, r0, 0 + ldr r0, =0x0000ffff + cmp r2, r0 + bls _080BE55C + adds r2, r0, 0 +_080BE55C: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x80 + lsls r1, 1 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp] + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + adds r1, r6, 0x1 + movs r0, 0x1F + ands r1, r0 + lsls r1, 1 + ldrb r2, [r4, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x3] + ldrh r0, [r4, 0x38] + adds r0, 0x3F + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7E + bhi _080BE5B4 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x5 + negs r1, r1 + ands r1, r0 + strb r1, [r2] + movs r0, 0x1 + strh r0, [r4, 0x2E] + b _080BE5C0 + .pool +_080BE5B4: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_080BE5C0: + ldrh r0, [r4, 0x38] + adds r0, 0x3F + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7E + bls _080BE5F0 + movs r3, 0x2E + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _080BE5F0 + ldr r5, =0x02039b4c + ldr r0, [r5] + lsls r6, 1 + ldr r4, =0x0000061e + adds r0, r4 + adds r0, r6 + ldrh r0, [r0] + bl sub_818D820 + ldr r0, [r5] + adds r0, r4 + adds r0, r6 +_080BE5EC: + ldr r1, =0x0000ffff + strh r1, [r0] +_080BE5F0: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BE4E0 + + thumb_func_start sub_80BE604 +sub_80BE604: @ 80BE604 + push {r4,lr} + adds r4, r0, 0 + ldr r1, =0x02039b4c + ldr r0, [r1] + ldr r2, =0x0000064a + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080BE62C + cmp r0, 0x3 + beq _080BE62C + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + b _080BE648 + .pool +_080BE62C: + ldr r2, [r1] + ldr r1, =0x0000060e + adds r0, r2, r1 + ldrh r1, [r0] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 3 + ldr r1, =0x0000060c + adds r2, r1 + ldrh r1, [r2] + subs r1, 0x1 + bl __divsi3 + strh r0, [r4, 0x26] +_080BE648: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BE604 + + thumb_func_start sub_80BE658 +sub_80BE658: @ 80BE658 + push {r4,r5,lr} + adds r3, r0, 0 + ldr r1, =0x02039b4c + ldr r0, [r1] + ldr r2, =0x0000064a + adds r0, r2 + ldrb r0, [r0] + adds r5, r1, 0 + cmp r0, 0 + beq _080BE680 + cmp r0, 0x3 + beq _080BE680 + adds r0, r3, 0 + bl RemoveObjectAndFreeTiles + b _080BE750 + .pool +_080BE680: + movs r1, 0x30 + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _080BE6C2 + ldr r0, [r5] + ldr r2, =0x0000060e + adds r1, r0, r2 + ldrh r1, [r1] + subs r2, 0x2 + adds r0, r2 + ldrh r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _080BE6AC + adds r0, r3, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + b _080BE6B8 + .pool +_080BE6AC: + adds r0, r3, 0 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 +_080BE6B8: + strb r1, [r0] + adds r2, r0, 0 + ldrh r1, [r3, 0x32] + lsls r0, r1, 24 + b _080BE6F8 +_080BE6C2: + ldr r0, [r5] + ldr r1, =0x0000060e + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _080BE6E0 + adds r0, r3, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + b _080BE6EC + .pool +_080BE6E0: + adds r0, r3, 0 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 +_080BE6EC: + strb r1, [r0] + adds r2, r0, 0 + ldrh r1, [r3, 0x32] + adds r0, r1, 0 + subs r0, 0x80 + lsls r0, 24 +_080BE6F8: + lsrs r0, 24 + adds r4, r1, 0 + ldr r1, =gUnknown_08329F40 + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _080BE70C + adds r0, 0x3F +_080BE70C: + asrs r0, 6 + strh r0, [r3, 0x26] + adds r0, r4, 0 + adds r0, 0x8 + strh r0, [r3, 0x32] + ldr r1, [r5] + ldr r3, =0x0000064f + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _080BE748 + adds r3, 0x3 + adds r0, r1, r3 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _080BE748 + ldrb r1, [r2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080BE748 + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + b _080BE74E + .pool +_080BE748: + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 +_080BE74E: + strb r0, [r2] +_080BE750: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80BE658 + + thumb_func_start sub_80BE758 +sub_80BE758: @ 80BE758 + push {lr} + adds r1, r0, 0 + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r2, =0x0000064a + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080BE774 + cmp r0, 0x3 + beq _080BE774 + adds r0, r1, 0 + bl RemoveObjectAndFreeTiles +_080BE774: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BE758 + + thumb_func_start sub_80BE780 +sub_80BE780: @ 80BE780 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + ldr r1, =0x02039b4c + ldr r0, [r1] + ldr r2, =0x0000064a + adds r0, r2 + ldrb r0, [r0] + adds r7, r1, 0 + cmp r0, 0 + beq _080BE7AC + cmp r0, 0x3 + beq _080BE7AC + adds r0, r6, 0 + bl RemoveObjectAndFreeTiles + b _080BE824 + .pool +_080BE7AC: + ldr r0, [r7] + ldr r5, =0x0000062c + adds r0, r5 + ldrb r1, [r0] + ldrh r0, [r6, 0x30] + adds r1, r0 + lsls r1, 24 + lsrs r1, 24 + ldr r4, =gUnknown_08329F40 + lsls r0, r1, 1 + adds r0, r4 + ldrh r3, [r0] + adds r1, 0x40 + lsls r1, 1 + adds r1, r4 + ldrh r0, [r6, 0x2E] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r1] + lsls r3, 16 + lsrs r2, r3, 16 + negs r3, r3 + lsrs r3, 16 + str r1, [sp] + bl SetSpriteTransformationMatrix + ldr r1, [r7] + adds r1, r5 + ldrh r0, [r6, 0x30] + adds r0, 0x40 + ldrb r1, [r1] + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r4 + ldrh r3, [r1] + adds r0, 0x40 + lsls r0, 1 + adds r0, r4 + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + cmp r0, 0 + bge _080BE80C + adds r0, 0xFF +_080BE80C: + asrs r0, 8 + strh r0, [r6, 0x24] + lsls r1, r3, 16 + asrs r1, 16 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + cmp r0, 0 + bge _080BE820 + adds r0, 0xFF +_080BE820: + asrs r0, 8 + strh r0, [r6, 0x26] +_080BE824: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BE780 + + thumb_func_start sub_80BE834 +sub_80BE834: @ 80BE834 + push {r4,lr} + adds r3, r0, 0 + ldr r1, =0x02039b4c + ldr r0, [r1] + ldr r2, =0x0000064a + adds r0, r2 + ldrb r2, [r0] + cmp r2, 0 + beq _080BE85C + cmp r2, 0x3 + beq _080BE85C + adds r0, r3, 0 + bl RemoveObjectAndFreeTiles + b _080BE8D4 + .pool +_080BE85C: + ldr r4, [r1] + ldr r1, =0x0000064a + adds r0, r4, r1 + ldrb r0, [r0] + movs r1, 0x60 + cmp r0, 0 + bne _080BE86C + movs r1, 0x50 +_080BE86C: + ldr r2, =0x0000064f + adds r0, r4, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080BE8C8 + adds r2, 0x3 + adds r0, r4, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, r1 + bne _080BE8C8 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + movs r1, 0xCA + lsls r1, 3 + adds r0, r4, r1 + ldrh r0, [r0] + lsls r0, 4 + strh r0, [r3, 0x26] + ldr r1, =gUnknown_08329F40 + ldrh r2, [r3, 0x32] + lsls r0, r2, 24 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _080BE8B0 + adds r0, 0x3F +_080BE8B0: + asrs r0, 6 + strh r0, [r3, 0x24] + adds r0, r2, 0 + adds r0, 0x8 + strh r0, [r3, 0x32] + b _080BE8D4 + .pool +_080BE8C8: + adds r0, r3, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080BE8D4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80BE834 + + thumb_func_start sub_80BE8DC +sub_80BE8DC: @ 80BE8DC + push {r4,r5,lr} + sub sp, 0x18 + adds r5, r1, 0 + adds r3, r2, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r3, 24 + lsrs r3, 24 + add r1, sp, 0x14 + movs r4, 0 + strb r4, [r1] + adds r2, r1, 0 + movs r1, 0xF + strb r1, [r2, 0x1] + movs r1, 0x3 + strb r1, [r2, 0x2] + str r4, [sp] + str r4, [sp, 0x4] + str r2, [sp, 0x8] + subs r1, 0x4 + str r1, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0 + movs r1, 0x1 + adds r2, r5, 0 + bl AddTextPrinterParametrized2 + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80BE8DC + + thumb_func_start sub_80BE91C +sub_80BE91C: @ 80BE91C + push {r4,r5,lr} + lsls r4, r1, 24 + lsrs r4, 24 + ldr r1, =0x02039b54 + str r0, [r1] + ldr r0, =sub_80BEA24 + movs r1, 0 + bl CreateTask + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + strh r2, [r0, 0x8] + movs r1, 0x1 + strh r1, [r0, 0xA] + strh r2, [r0, 0xC] + strh r2, [r0, 0xE] + strh r4, [r0, 0x10] + movs r1, 0xFF + strh r1, [r0, 0x12] + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0856E630 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl AllocZeroed + adds r1, r0, 0 + movs r0, 0x3 + bl SetBgTilemapBuffer + adds r0, r4, 0 + bl AllocZeroed + adds r1, r0, 0 + movs r0, 0x2 + bl SetBgTilemapBuffer + adds r0, r4, 0 + bl AllocZeroed + adds r1, r0, 0 + movs r0, 0x1 + bl SetBgTilemapBuffer + adds r0, r4, 0 + bl AllocZeroed + adds r1, r0, 0 + movs r0, 0 + bl SetBgTilemapBuffer + ldr r0, =gUnknown_0856E640 + bl InitWindows + bl DeactivateAllTextPrinters + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80BE91C + + thumb_func_start sub_80BE9C4 +sub_80BE9C4: @ 80BE9C4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _080BE9F0 + ldr r1, [r1] + ldr r0, =sub_80BEDF4 + cmp r1, r0 + bne _080BE9F0 + movs r0, 0 + b _080BE9F2 + .pool +_080BE9F0: + movs r0, 0x1 +_080BE9F2: + pop {r1} + bx r1 + thumb_func_end sub_80BE9C4 + + thumb_func_start sub_80BE9F8 +sub_80BE9F8: @ 80BE9F8 + adds r2, r0, 0 + lsls r0, r1, 24 + lsrs r0, 24 + ldr r1, =0x02039b54 + str r2, [r1] + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r3, 0 + movs r2, 0x1 + strh r2, [r1, 0x8] + strh r3, [r1, 0xA] + strh r3, [r1, 0xC] + strh r3, [r1, 0xE] + bx lr + .pool + thumb_func_end sub_80BE9F8 + + thumb_func_start sub_80BEA24 +sub_80BEA24: @ 80BEA24 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r5, r1, 0 + cmp r0, 0xA + bhi _080BEA7C + lsls r0, 2 + ldr r1, =_080BEA50 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080BEA50: + .4byte _080BEA7C + .4byte _080BEAF0 + .4byte _080BEB50 + .4byte _080BEB90 + .4byte _080BEB98 + .4byte _080BEC08 + .4byte _080BEC60 + .4byte _080BECBC + .4byte _080BED04 + .4byte _080BED5E + .4byte _080BED7C +_080BEA7C: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080BEA8A + b _080BEDA0 +_080BEA8A: + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r3, =0x0000064a + adds r0, r3 + movs r6, 0x1 + strb r6, [r0] + ldr r1, =0x030060b4 + ldr r0, [r5, 0xC] + str r0, [r1] + movs r0, 0 + bl SetVBlankCallback + movs r2, 0 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + movs r3, 0xA + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _080BEABA + movs r2, 0x80 + lsls r2, 5 +_080BEABA: + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _080BEACA + movs r1, 0x80 + lsls r1, 2 + adds r0, r1, 0 + orrs r2, r0 +_080BEACA: + adds r0, r2, 0 + bl sub_80C09B0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r5, r2 + strb r6, [r0] + b _080BEDA0 + .pool +_080BEAF0: + ldr r1, =gUnknown_08DC1934 + movs r2, 0x80 + lsls r2, 6 + movs r0, 0 + str r0, [sp] + movs r0, 0x3 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_08DC3080 + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0 + bl PutWindowTilemap + movs r0, 0x1 + bl PutWindowTilemap + ldr r0, =0x02039b54 + ldr r0, [r0] + ldrh r1, [r0] + movs r0, 0x1 + bl sub_80C0D30 + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080BED70 + .pool +_080BEB50: + movs r0, 0xD + bl sub_80BFCDC + ldr r4, =0x02039b4c + ldr r0, [r4] + ldr r1, =0x0000064d + adds r0, r1 + ldrb r0, [r0] + movs r1, 0xD + bl sub_80BFD0C + ldr r0, [r4] + ldr r2, =0x0000064c + adds r0, r2 + ldrb r0, [r0] + lsls r0, 31 + lsrs r0, 31 + bl sub_80BC844 + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080BED70 + .pool +_080BEB90: + movs r0, 0x87 + lsls r0, 3 + adds r1, r5, r0 + b _080BED70 +_080BEB98: + ldr r4, =0x02039b54 + ldr r3, [r4] + ldrh r0, [r3] + ldr r1, =0x02039b4c + ldr r1, [r1] + ldr r2, =0x00000612 + adds r1, r2 + ldrh r2, [r1] + negs r1, r2 + orrs r1, r2 + lsrs r1, 31 + ldr r2, [r3] + lsls r2, 14 + lsrs r2, 31 + movs r3, 0 + bl sub_80C020C + ldr r0, [r4] + ldrb r1, [r0, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080BEBD0 + ldr r0, =0x02037716 + movs r1, 0x31 + movs r2, 0x1E + bl gpu_pal_apply +_080BEBD0: + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080BED70 + .pool +_080BEC08: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r4, r1, r0 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080BEC44 + ldr r0, =0x02039b54 + ldr r0, [r0] + ldrh r0, [r0] + movs r1, 0x30 + movs r2, 0x38 + movs r3, 0 + bl sub_80C0E9C + strh r0, [r4, 0x10] + ldr r2, =0x02020630 + movs r3, 0x10 + ldrsh r0, [r4, r3] + 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] +_080BEC44: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080BED70 + .pool +_080BEC60: + movs r3, 0 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r2, 0xC + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _080BEC76 + movs r3, 0x14 +_080BEC76: + movs r2, 0xA + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _080BEC98 + ldr r2, =0x02020630 + movs r0, 0x10 + ldrsh r1, [r1, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x5] + lsrs r1, 4 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + orrs r3, r0 +_080BEC98: + mvns r0, r3 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =0x030060b4 + ldr r0, [r0] + bl SetVBlankCallback + b _080BED68 + .pool +_080BECBC: + 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 r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl HideBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080BED70 + .pool +_080BED04: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BEDA0 + movs r0, 0x87 + lsls r0, 3 + adds r2, r5, r0 + ldrb r0, [r2] + adds r3, r0, 0x1 + strb r3, [r2] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0xE + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _080BED58 + bl sub_80A369C + ldr r0, =0x02039b54 + ldr r0, [r0] + ldrh r0, [r0] + bl NationalPokedexNumToSpecies + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + movs r2, 0x7D + movs r3, 0xA + bl sub_80A32C0 + b _080BEDA0 + .pool +_080BED58: + adds r0, r3, 0x1 + strb r0, [r2] + b _080BEDA0 +_080BED5E: + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + bne _080BEDA0 +_080BED68: + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_080BED70: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080BEDA0 + .pool +_080BED7C: + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0 + strh r1, [r0, 0x8] + strh r1, [r0, 0xA] + movs r1, 0x1 + strh r1, [r0, 0xC] + strh r1, [r0, 0xE] + ldr r1, =sub_80BEDF4 + str r1, [r0] + movs r3, 0x87 + lsls r3, 3 + adds r0, r5, r3 + strb r2, [r0] +_080BEDA0: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BEA24 + + thumb_func_start sub_80BEDB0 +sub_80BEDB0: @ 80BEDB0 + push {lr} + bl FreeAllWindowBuffers + movs r0, 0 + bl GetBgTilemapBuffer + cmp r0, 0 + beq _080BEDC4 + bl Free +_080BEDC4: + movs r0, 0x1 + bl GetBgTilemapBuffer + cmp r0, 0 + beq _080BEDD2 + bl Free +_080BEDD2: + movs r0, 0x2 + bl GetBgTilemapBuffer + cmp r0, 0 + beq _080BEDE0 + bl Free +_080BEDE0: + movs r0, 0x3 + bl GetBgTilemapBuffer + cmp r0, 0 + beq _080BEDEE + bl Free +_080BEDEE: + pop {r0} + bx r0 + thumb_func_end sub_80BEDB0 + + thumb_func_start sub_80BEDF4 +sub_80BEDF4: @ 80BEDF4 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + movs r0, 0x8 + ldrsh r5, [r4, r0] + cmp r5, 0 + beq _080BEE34 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_80BF038 + str r0, [r4] + movs r0, 0x6C + bl audio_play + b _080BEFBA + .pool +_080BEE34: + ldr r1, =0x030022c0 + ldrh r2, [r1, 0x2E] + movs r0, 0x2 + ands r0, r2 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0 + beq _080BEE50 + movs r0, 0x1 + negs r0, r0 + str r5, [sp] + b _080BEF0E + .pool +_080BEE50: + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _080BEF28 + ldr r5, =0x02039b4c + ldr r0, [r5] + ldr r1, =0x0000064d + adds r0, r1 + ldrb r1, [r0] + cmp r1, 0x1 + beq _080BEEA0 + cmp r1, 0x1 + bgt _080BEE78 + cmp r1, 0 + beq _080BEE82 + b _080BEFBA + .pool +_080BEE78: + cmp r1, 0x2 + beq _080BEEC0 + cmp r1, 0x3 + beq _080BEF08 + b _080BEFBA +_080BEE82: + movs r0, 0x15 + negs r0, r0 + str r3, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, [r5] + ldr r3, =0x0000064e + adds r0, r3 + movs r1, 0x1 + b _080BEEF0 + .pool +_080BEEA0: + movs r0, 0x15 + negs r0, r0 + str r3, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, [r5] + ldr r1, =0x0000064e + adds r0, r1 + movs r1, 0x2 + b _080BEEF0 + .pool +_080BEEC0: + ldr r0, =0x02039b54 + ldr r0, [r0] + ldrb r0, [r0, 0x2] + ands r1, r0 + cmp r1, 0 + bne _080BEED8 + movs r0, 0x20 + bl audio_play + b _080BEFBA + .pool +_080BEED8: + movs r0, 0x15 + negs r0, r0 + str r3, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, [r5] + ldr r3, =0x0000064e + adds r0, r3 + movs r1, 0x3 +_080BEEF0: + strb r1, [r0] + ldr r0, =sub_80BEFD0 + str r0, [r4] + movs r0, 0x15 + bl audio_play + b _080BEFBA + .pool +_080BEF08: + movs r0, 0x1 + negs r0, r0 + str r3, [sp] +_080BEF0E: + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_80BF070 + str r0, [r4] + movs r0, 0x3 + bl audio_play + b _080BEFBA + .pool +_080BEF28: + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + bne _080BEF44 + movs r0, 0x80 + lsls r0, 2 + ands r0, r2 + cmp r0, 0 + beq _080BEF78 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x1 + bne _080BEF78 +_080BEF44: + ldr r3, =0x02039b4c + ldr r0, [r3] + ldr r4, =0x0000064d + adds r2, r0, r4 + ldrb r0, [r2] + cmp r0, 0 + beq _080BEF78 + subs r0, 0x1 + strb r0, [r2] + ldr r0, [r3] + adds r0, r4 + ldrb r0, [r0] + movs r1, 0xD + bl sub_80BFD0C + movs r0, 0x6D + bl audio_play + b _080BEFBA + .pool +_080BEF78: + ldrh r1, [r1, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _080BEF96 + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _080BEFBA + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x1 + bne _080BEFBA +_080BEF96: + ldr r2, =0x02039b4c + ldr r0, [r2] + ldr r3, =0x0000064d + adds r1, r0, r3 + ldrb r0, [r1] + cmp r0, 0x2 + bhi _080BEFBA + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r2] + adds r0, r3 + ldrb r0, [r0] + movs r1, 0xD + bl sub_80BFD0C + movs r0, 0x6D + bl audio_play +_080BEFBA: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BEDF4 + + thumb_func_start sub_80BEFD0 +sub_80BEFD0: @ 80BEFD0 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BF02C + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x10] + bl sub_818D820 + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000064e + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + beq _080BF020 + cmp r0, 0x2 + ble _080BF008 + cmp r0, 0x3 + beq _080BF028 +_080BF008: + ldr r0, =sub_80BF0AC + b _080BF02A + .pool +_080BF020: + ldr r0, =sub_80BF250 + b _080BF02A + .pool +_080BF028: + ldr r0, =sub_80BF82C +_080BF02A: + str r0, [r4] +_080BF02C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BEFD0 + + thumb_func_start sub_80BF038 +sub_80BF038: @ 80BF038 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BF05E + ldr r0, =0x03005e00 + lsls r4, r2, 2 + adds r4, r2 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r4, 0x10] + bl sub_818D820 + ldr r0, =sub_80BEA24 + str r0, [r4] +_080BF05E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BF038 + + thumb_func_start sub_80BF070 +sub_80BF070: @ 80BF070 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BF09C + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x10] + bl sub_818D820 + bl sub_80BEDB0 + adds r0, r4, 0 + bl DestroyTask +_080BF09C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BF070 + + thumb_func_start sub_80BF0AC +sub_80BF0AC: @ 80BF0AC + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r7, r2, r0 + ldrb r0, [r7] + cmp r0, 0x1 + beq _080BF120 + cmp r0, 0x1 + ble _080BF0C8 + cmp r0, 0x2 + beq _080BF15C +_080BF0C8: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _080BF196 + ldr r4, =0x02039b4c + ldr r0, [r4] + ldr r1, =0x0000064a + adds r0, r1 + movs r1, 0x5 + strb r1, [r0] + ldr r1, =0x030060b4 + ldr r0, [r2, 0xC] + str r0, [r1] + movs r0, 0 + bl SetVBlankCallback + movs r0, 0x80 + lsls r0, 2 + bl sub_80C09B0 + ldr r0, [r4] + ldr r1, =0x0000064d + adds r0, r1 + strb r5, [r0] + movs r0, 0x1 + strb r0, [r7] + b _080BF196 + .pool +_080BF120: + movs r0, 0xD + bl sub_80BFCF4 + movs r0, 0 + movs r1, 0xD + bl sub_80BFD7C + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000064c + adds r0, r1 + ldrb r0, [r0] + lsls r0, 31 + lsrs r0, 31 + bl sub_80BC844 + movs r1, 0xD0 + lsls r1, 4 + movs r0, 0xA + bl SetGpuReg + ldrb r0, [r7] + adds r0, 0x1 + strb r0, [r7] + b _080BF196 + .pool +_080BF15C: + ldr r0, =0x02039b54 + ldr r0, [r0] + ldrh r0, [r0] + bl NationalPokedexNumToSpecies + lsls r0, 16 + lsrs r0, 16 + ldr r5, =0x02039b4c + ldr r1, [r5] + ldr r4, =0x0000064e + adds r1, r4 + bl sub_813D3D8 + ldr r0, =0x030060b4 + ldr r0, [r0] + bl SetVBlankCallback + ldr r0, [r5] + adds r0, r4 + movs r1, 0 + strb r1, [r0] + strb r1, [r7] + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80BF1B4 + str r1, [r0] +_080BF196: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BF0AC + + thumb_func_start sub_80BF1B4 +sub_80BF1B4: @ 80BF1B4 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000064e + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080BF1D6 + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80BF1EC + str r0, [r1] +_080BF1D6: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BF1B4 + + thumb_func_start sub_80BF1EC +sub_80BF1EC: @ 80BF1EC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BF242 + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000064e + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080BF210 + cmp r0, 0x2 + beq _080BF234 +_080BF210: + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80BEA24 + b _080BF240 + .pool +_080BF234: + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80BF250 +_080BF240: + str r0, [r1] +_080BF242: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BF1EC + + thumb_func_start sub_80BF250 +sub_80BF250: @ 80BF250 + push {r4,r5,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0xA + bhi _080BF2A8 + lsls r0, 2 + ldr r1, =_080BF27C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080BF27C: + .4byte _080BF2A8 + .4byte _080BF310 + .4byte _080BF360 + .4byte _080BF38C + .4byte _080BF3A0 + .4byte _080BF3D0 + .4byte _080BF41C + .4byte _080BF498 + .4byte _080BF514 + .4byte _080BF540 + .4byte _080BF590 +_080BF2A8: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080BF2B6 + b _080BF5B2 +_080BF2B6: + ldr r0, =0x03007420 + bl MPlayStop_rev01 + ldr r5, =0x02039b4c + ldr r0, [r5] + ldr r3, =0x0000064a + adds r0, r3 + movs r1, 0x6 + strb r1, [r0] + ldr r1, =0x030060b4 + ldr r4, =0x030022c0 + ldr r0, [r4, 0xC] + str r0, [r1] + movs r0, 0 + bl SetVBlankCallback + movs r0, 0x80 + lsls r0, 2 + bl sub_80C09B0 + ldr r0, [r5] + ldr r1, =0x0000064d + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + movs r2, 0x87 + lsls r2, 3 + adds r4, r2 + strb r1, [r4] + b _080BF5B2 + .pool +_080BF310: + ldr r1, =gUnknown_08DC1934 + movs r2, 0x80 + lsls r2, 6 + movs r0, 0 + str r0, [sp] + movs r0, 0x3 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_08DC3198 + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0 + bl PutWindowTilemap + movs r0, 0x3 + bl PutWindowTilemap + movs r0, 0x2 + bl PutWindowTilemap + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080BF582 + .pool +_080BF360: + movs r0, 0xD + bl sub_80BFCF4 + movs r0, 0x1 + movs r1, 0xD + bl sub_80BFD7C + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r4, =0x0000064c + adds r0, r4 + ldrb r0, [r0] + lsls r0, 31 + lsrs r0, 31 + bl sub_80BC844 + b _080BF57A + .pool +_080BF38C: + bl sub_80A1A74 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _080BF582 + .pool +_080BF3A0: + ldr r0, =gUnknown_085E871B + movs r1, 0x52 + movs r2, 0x21 + bl sub_80BE8DC + ldr r0, =0x02039b54 + ldr r0, [r0] + ldrh r1, [r0] + movs r0, 0 + movs r2, 0x52 + movs r3, 0x31 + bl sub_80C0B44 + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080BF582 + .pool +_080BF3D0: + ldr r0, =0x02039b54 + ldr r0, [r0] + ldrh r0, [r0] + movs r1, 0x30 + movs r2, 0x38 + movs r3, 0 + bl sub_80C0E9C + ldr r2, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r2 + movs r3, 0 + strh r0, [r1, 0x10] + ldr r2, =0x02020630 + movs r4, 0x10 + ldrsh r0, [r1, r4] + 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] + ldr r0, =0x030061ec + strb r3, [r0] + b _080BF57A + .pool +_080BF41C: + ldr r1, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r1 + ldr r1, =0x00004020 + orrs r0, r1 + ldr r1, =0xff00ffff + ands r0, r1 + movs r1, 0xF8 + lsls r1, 13 + orrs r0, r1 + ldr r1, =0x00ffffff + ands r0, r1 + movs r1, 0x80 + lsls r1, 20 + orrs r0, r1 + str r0, [sp, 0x4] + ldr r1, =0xffff00ff + ldr r0, [sp, 0x8] + ands r0, r1 + movs r1, 0xF0 + lsls r1, 5 + orrs r0, r1 + ldr r1, =0xffffff00 + ands r0, r1 + movs r1, 0xC + orrs r0, r1 + str r0, [sp, 0x8] + add r0, sp, 0x4 + movs r1, 0x2 + bl sub_8145354 + lsls r0, 24 + cmp r0, 0 + bne _080BF462 + b _080BF5B2 +_080BF462: + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + ldr r0, =0x030061ec + strb r2, [r0] + b _080BF5B2 + .pool +_080BF498: + ldr r1, =0x00ffffff + ldr r0, [sp, 0xC] + ands r0, r1 + movs r1, 0x90 + lsls r1, 20 + orrs r0, r1 + str r0, [sp, 0xC] + ldr r2, =0xffffff00 + add r0, sp, 0xC + ldr r1, [r0, 0x4] + ands r1, r2 + movs r2, 0x12 + orrs r1, r2 + ldr r2, =0xffff00ff + ands r1, r2 + movs r2, 0xC0 + lsls r2, 2 + orrs r1, r2 + str r1, [r0, 0x4] + movs r1, 0x3 + bl sub_8145850 + lsls r0, 24 + cmp r0, 0 + beq _080BF4D8 + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080BF4D8: + movs r0, 0x3 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + b _080BF5B2 + .pool +_080BF514: + movs r0, 0x15 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =0x030060b4 + ldr r0, [r0] + bl SetVBlankCallback + ldr r1, =0x030022c0 + movs r4, 0x87 + lsls r4, 3 + adds r1, r4 + b _080BF582 + .pool +_080BF540: + 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 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, 0x3 + bl ShowBg +_080BF57A: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_080BF582: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080BF5B2 + .pool +_080BF590: + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000064e + adds r0, r1 + movs r1, 0 + strb r1, [r0] + movs r3, 0x87 + lsls r3, 3 + adds r0, r2, r3 + strb r1, [r0] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80BF5CC + str r1, [r0] +_080BF5B2: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BF250 + + thumb_func_start sub_80BF5CC +sub_80BF5CC: @ 80BF5CC + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x2 + bl sub_814545C + bl sub_80A36EC + lsls r0, 24 + cmp r0, 0 + beq _080BF5EC + movs r0, 0x1 + bl sub_80BF7FC + b _080BF5F2 +_080BF5EC: + movs r0, 0 + bl sub_80BF7FC +_080BF5F2: + ldr r1, =0x030022c0 + ldrh r2, [r1, 0x2E] + movs r0, 0x1 + ands r0, r2 + adds r5, r1, 0 + cmp r0, 0 + beq _080BF624 + movs r0, 0x1 + bl sub_80BF7FC + ldr r0, =0x02039b54 + ldr r0, [r0] + ldrh r0, [r0] + bl NationalPokedexNumToSpecies + lsls r0, 16 + lsrs r0, 16 + bl sub_8145534 + b _080BF772 + .pool +_080BF624: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _080BF636 + b _080BF772 +_080BF636: + movs r0, 0x2 + ands r0, r2 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0 + beq _080BF694 + movs r0, 0x15 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x03007420 + bl m4aMPlayContinue + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000064e + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80BF790 + str r1, [r0] + movs r0, 0x3 + bl audio_play + b _080BF772 + .pool +_080BF694: + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + bne _080BF6B0 + movs r0, 0x80 + lsls r0, 2 + ands r0, r2 + cmp r0, 0 + beq _080BF700 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x1 + bne _080BF700 +_080BF6B0: + movs r0, 0x15 + negs r0, r0 + str r3, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x03007420 + bl m4aMPlayContinue + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000064e + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80BF790 + str r1, [r0] + movs r0, 0x6D + bl audio_play + b _080BF772 + .pool +_080BF700: + ldrh r1, [r5, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _080BF71E + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _080BF772 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x1 + bne _080BF772 +_080BF71E: + ldr r0, =0x02039b54 + ldr r0, [r0] + ldrb r1, [r0, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080BF73C + movs r0, 0x20 + bl audio_play + b _080BF772 + .pool +_080BF73C: + movs r0, 0x15 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x03007420 + bl m4aMPlayContinue + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000064e + adds r0, r1 + movs r1, 0x3 + strb r1, [r0] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80BF790 + str r1, [r0] + movs r0, 0x6D + bl audio_play +_080BF772: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BF5CC + + thumb_func_start sub_80BF790 +sub_80BF790: @ 80BF790 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BF7F0 + bl sub_8145914 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x10] + bl sub_818D820 + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000064e + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + beq _080BF7E4 + cmp r0, 0x2 + ble _080BF7CC + cmp r0, 0x3 + beq _080BF7EC +_080BF7CC: + ldr r0, =sub_80BEA24 + b _080BF7EE + .pool +_080BF7E4: + ldr r0, =sub_80BF0AC + b _080BF7EE + .pool +_080BF7EC: + ldr r0, =sub_80BF82C +_080BF7EE: + str r0, [r4] +_080BF7F0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BF790 + + thumb_func_start sub_80BF7FC +sub_80BF7FC: @ 80BF7FC + push {lr} + sub sp, 0x4 + lsls r0, 24 + cmp r0, 0 + beq _080BF810 + ldr r1, =0x00000392 + b _080BF812 + .pool +_080BF810: + ldr r1, =0x000002af +_080BF812: + mov r0, sp + strh r1, [r0] + mov r0, sp + movs r1, 0x5D + movs r2, 0x2 + bl gpu_pal_apply + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BF7FC + + thumb_func_start sub_80BF82C +sub_80BF82C: @ 80BF82C + push {r4-r7,lr} + sub sp, 0x44 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r5, r1, 0 + cmp r0, 0x9 + bhi _080BF880 + lsls r0, 2 + ldr r1, =_080BF858 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080BF858: + .4byte _080BF880 + .4byte _080BF8D8 + .4byte _080BF910 + .4byte _080BF93C + .4byte _080BF97C + .4byte _080BF982 + .4byte _080BFA34 + .4byte _080BFAE8 + .4byte _080BFB14 + .4byte _080BFB64 +_080BF880: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080BF88E + b _080BFB94 +_080BF88E: + ldr r4, =0x02039b4c + ldr r0, [r4] + ldr r1, =0x0000064a + adds r0, r1 + movs r1, 0x7 + strb r1, [r0] + ldr r1, =0x030060b4 + ldr r0, [r5, 0xC] + str r0, [r1] + movs r0, 0 + bl SetVBlankCallback + movs r0, 0x80 + lsls r0, 2 + bl sub_80C09B0 + ldr r0, [r4] + ldr r2, =0x0000064d + adds r0, r2 + movs r1, 0x2 + strb r1, [r0] + movs r0, 0x87 + lsls r0, 3 + adds r1, r5, r0 + movs r0, 0x1 + strb r0, [r1] + b _080BFB94 + .pool +_080BF8D8: + ldr r1, =gUnknown_08DC1934 + movs r2, 0x80 + lsls r2, 6 + movs r0, 0 + str r0, [sp] + movs r0, 0x3 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_08DC2E6C + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0 + bl PutWindowTilemap + b _080BFB4E + .pool +_080BF910: + movs r0, 0xD + bl sub_80BFCF4 + movs r0, 0x2 + movs r1, 0xD + bl sub_80BFD7C + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000064c + adds r0, r1 + ldrb r0, [r0] + lsls r0, 31 + lsrs r0, 31 + bl sub_80BC844 + b _080BFB4E + .pool +_080BF93C: + ldr r1, =gUnknown_085E8723 + add r0, sp, 0x4 + bl CopyString + ldr r0, =0x03005d90 + ldr r1, [r0] + add r0, sp, 0x4 + bl AppendString + movs r0, 0x1 + add r1, sp, 0x4 + movs r2, 0xF0 + bl GetStringCenterAlignXOffset + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + add r0, sp, 0x4 + movs r2, 0x79 + bl sub_80BE8DC + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080BFB56 + .pool +_080BF97C: + bl sub_80A1A74 + b _080BFB4E +_080BF982: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + bl sub_806F000 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x98 + movs r2, 0x38 + movs r3, 0 + bl sub_80C0EF8 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x02020630 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + adds r4, r0 + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r1, [r4, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4, 0x3] + ldrb r1, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x5] + ldr r2, =gPokedexEntries + ldr r0, =0x02039b54 + ldr r1, [r0] + ldrh r0, [r1] + lsls r0, 5 + adds r0, r2 + ldrh r0, [r0, 0x1C] + strh r0, [r4, 0x26] + ldrh r0, [r1] + lsls r0, 5 + adds r0, r2 + ldrh r1, [r0, 0x1A] + str r1, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + ldr r0, =gUnknown_0856E610 + ldrb r1, [r4, 0x5] + lsrs r1, 4 + adds r1, 0x10 + lsls r1, 4 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0x12] + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080BFB56 + .pool +_080BFA34: + ldr r5, =0x02039b54 + ldr r0, [r5] + ldrh r0, [r0] + movs r1, 0x58 + movs r2, 0x38 + movs r3, 0x1 + bl sub_80C0E9C + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x02020630 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + adds r4, r0 + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r1, [r4, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4, 0x3] + ldrb r1, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x5] + ldr r2, =gPokedexEntries + ldr r1, [r5] + ldrh r0, [r1] + lsls r0, 5 + adds r0, r2 + ldrh r0, [r0, 0x18] + strh r0, [r4, 0x26] + ldrh r0, [r1] + lsls r0, 5 + adds r0, r2 + ldrh r1, [r0, 0x16] + str r1, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + ldr r0, =gUnknown_0856E610 + ldrb r1, [r4, 0x5] + lsrs r1, 4 + adds r1, 0x10 + lsls r1, 4 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0x10] + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + b _080BFB4E + .pool +_080BFAE8: + movs r0, 0x15 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =0x030060b4 + ldr r0, [r0] + bl SetVBlankCallback + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080BFB56 + .pool +_080BFB14: + 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 r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl HideBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg +_080BFB4E: + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_080BFB56: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080BFB94 + .pool +_080BFB64: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _080BFB94 + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000064e + adds r0, r1 + strb r2, [r0] + movs r1, 0x87 + lsls r1, 3 + adds r0, r5, r1 + strb r2, [r0] + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80BFBB0 + str r1, [r0] +_080BFB94: + add sp, 0x44 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BF82C + + thumb_func_start sub_80BFBB0 +sub_80BFBB0: @ 80BFBB0 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _080BFC10 + movs r0, 0x15 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000064e + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80BFC78 + str r1, [r0] + movs r0, 0x3 + bl audio_play + b _080BFC5C + .pool +_080BFC10: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _080BFC2C + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _080BFC5C + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x1 + bne _080BFC5C +_080BFC2C: + movs r0, 0x15 + negs r0, r0 + str r2, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000064e + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80BFC78 + str r1, [r0] + movs r0, 0x6D + bl audio_play +_080BFC5C: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BFBB0 + + thumb_func_start sub_80BFC78 +sub_80BFC78: @ 80BFC78 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080BFCD0 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x10] + bl sub_818D820 + ldrh r0, [r4, 0x12] + bl sub_818D8F0 + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000064e + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080BFCB2 + cmp r0, 0x2 + beq _080BFCCC +_080BFCB2: + ldr r0, =sub_80BEA24 + b _080BFCCE + .pool +_080BFCCC: + ldr r0, =sub_80BF250 +_080BFCCE: + str r0, [r4] +_080BFCD0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BFC78 + + thumb_func_start sub_80BFCDC +sub_80BFCDC: @ 80BFCDC + push {lr} + ldr r1, =gUnknown_08DC2F5C + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BFCDC + + thumb_func_start sub_80BFCF4 +sub_80BFCF4: @ 80BFCF4 + push {lr} + ldr r1, =gUnknown_08DC2FEC + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BFCF4 + + thumb_func_start sub_80BFD0C +sub_80BFD0C: @ 80BFD0C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0x1 + bl GetBgTilemapBuffer + adds r7, r0, 0 + movs r1, 0 +_080BFD22: + lsls r0, r1, 3 + subs r0, r1 + adds r0, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + movs r3, 0x80 + lsls r3, 7 + cmp r1, r8 + bne _080BFD38 + movs r3, 0x80 + lsls r3, 6 +_080BFD38: + movs r2, 0 + adds r6, r1, 0x1 + ldr r4, =0x00000fff +_080BFD3E: + adds r1, r5, r2 + lsls r1, 1 + adds r1, r7 + ldrh r0, [r1] + ands r0, r4 + orrs r0, r3 + strh r0, [r1] + adds r1, 0x40 + ldrh r0, [r1] + ands r0, r4 + orrs r0, r3 + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x6 + bls _080BFD3E + lsls r0, r6, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _080BFD22 + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BFD0C + + thumb_func_start sub_80BFD7C +sub_80BFD7C: @ 80BFD7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0x1 + bl GetBgTilemapBuffer + adds r7, r0, 0 + movs r1, 0 +_080BFD92: + lsls r0, r1, 3 + subs r0, r1 + adds r0, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r1, r8 + beq _080BFDA4 + cmp r1, 0x3 + bne _080BFDAA +_080BFDA4: + movs r3, 0x80 + lsls r3, 6 + b _080BFDAE +_080BFDAA: + movs r3, 0x80 + lsls r3, 7 +_080BFDAE: + movs r2, 0 + adds r5, r1, 0x1 + ldr r4, =0x00000fff +_080BFDB4: + adds r1, r6, r2 + lsls r1, 1 + adds r1, r7 + ldrh r0, [r1] + ands r0, r4 + orrs r0, r3 + strh r0, [r1] + adds r1, 0x40 + ldrh r0, [r1] + ands r0, r4 + orrs r0, r3 + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x6 + bls _080BFDB4 + lsls r0, r5, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _080BFD92 + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BFD7C + + thumb_func_start sub_80BFDF4 +sub_80BFDF4: @ 80BFDF4 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =sub_80BFE38 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + strh r2, [r1, 0x8] + strh r4, [r1, 0xA] + strh r5, [r1, 0x20] + lsrs r5, 16 + strh r5, [r1, 0x22] + strh r6, [r1, 0x24] + lsrs r6, 16 + strh r6, [r1, 0x26] + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80BFDF4 + + thumb_func_start sub_80BFE38 +sub_80BFE38: @ 80BFE38 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrh r4, [r0, 0xA] + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x6 + bhi _080BFE84 + lsls r0, 2 + ldr r1, =_080BFE68 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080BFE68: + .4byte _080BFE84 + .4byte _080BFF0C + .4byte _080BFF78 + .4byte _080BFF82 + .4byte _080BFFA8 + .4byte _080C0000 + .4byte _080C0044 +_080BFE84: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080BFE92 + b _080C0074 +_080BFE92: + ldr r1, =0x030060b4 + ldr r0, =0x030022c0 + ldr r0, [r0, 0xC] + str r0, [r1] + movs r0, 0 + bl SetVBlankCallback + movs r0, 0x80 + lsls r0, 1 + bl sub_80C09B0 + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0856E668 + movs r0, 0 + movs r2, 0x2 + bl InitBgsFromTemplates + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl AllocZeroed + adds r1, r0, 0 + movs r0, 0x3 + bl SetBgTilemapBuffer + adds r0, r4, 0 + bl AllocZeroed + adds r1, r0, 0 + movs r0, 0x2 + bl SetBgTilemapBuffer + ldr r0, =gUnknown_0856E670 + bl InitWindows + bl DeactivateAllTextPrinters + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x8] + b _080C0074 + .pool +_080BFF0C: + ldr r1, =gUnknown_08DC1934 + movs r2, 0x80 + lsls r2, 6 + movs r0, 0 + str r0, [sp] + movs r0, 0x3 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r1, =gUnknown_08DC3080 + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0 + bl PutWindowTilemap + movs r0, 0x1 + bl PutWindowTilemap + ldr r0, =0x03005e00 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + ldrh r1, [r4, 0xA] + movs r0, 0x1 + bl sub_80C0D30 + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram + bl sub_80A1A74 + movs r0, 0 + bl sub_80BC844 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080C0074 + .pool +_080BFF78: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + b _080C0038 +_080BFF82: + bl sub_809D42C + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_80C020C + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + b _080C002E +_080BFFA8: + adds r0, r4, 0 + movs r1, 0x30 + movs r2, 0x38 + movs r3, 0 + bl sub_80C0E9C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =0x030060b4 + ldr r0, [r0] + bl SetVBlankCallback + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0xE] + b _080C0038 + .pool +_080C0000: + 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 r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg +_080C002E: + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 +_080C0038: + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _080C0074 + .pool +_080C0044: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _080C0074 + adds r0, r4, 0 + bl NationalPokedexNumToSpecies + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl cry_related + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0xC] + ldr r1, =sub_80C0088 + str r1, [r0] +_080C0074: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BFE38 + + thumb_func_start sub_80C0088 +sub_80C0088: @ 80C0088 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _080C00E8 + ldr r0, =0x0000ffff + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r3, =0x02020630 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0xE + ldrsh r2, [r1, r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r3, 0x1C + adds r0, r3 + ldr r2, =sub_80C01CC + str r2, [r0] + ldr r0, =blockset_load_palette_to_gpu + str r0, [r1] + b _080C011E + .pool +_080C00E8: + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0xC] + adds r1, 0x1 + strh r1, [r0, 0xC] + movs r0, 0x10 + ands r1, r0 + cmp r1, 0 + beq _080C0114 + ldr r0, =gUnknown_08DC16F6 + movs r1, 0x31 + movs r2, 0xE + bl gpu_pal_apply + b _080C011E + .pool +_080C0114: + ldr r0, =gUnknown_08DC1756 + movs r1, 0x31 + movs r2, 0xE + bl gpu_pal_apply +_080C011E: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C0088 + + thumb_func_start blockset_load_palette_to_gpu +blockset_load_palette_to_gpu: @ 80C012C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080C01BA + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + bl FreeAllWindowBuffers + movs r0, 0x2 + bl GetBgTilemapBuffer + cmp r0, 0 + beq _080C015A + bl Free +_080C015A: + movs r0, 0x3 + bl GetBgTilemapBuffer + cmp r0, 0 + beq _080C0168 + bl Free +_080C0168: + ldr r0, =0x03005e00 + lsls r4, r6, 2 + adds r4, r6 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r4, 0xA] + bl NationalPokedexNumToSpecies + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r4, 0x22] + lsls r1, 16 + ldrh r2, [r4, 0x20] + orrs r1, r2 + ldrh r2, [r4, 0x26] + lsls r2, 16 + ldrh r3, [r4, 0x24] + orrs r2, r3 + ldr r5, =0x02020630 + movs r3, 0xE + ldrsh r4, [r4, r3] + lsls r3, r4, 4 + adds r3, r4 + lsls r3, 2 + adds r3, r5 + ldrb r4, [r3, 0x5] + lsrs r4, 4 + bl species_and_otid_get_pal + lsls r4, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + orrs r4, r1 + adds r1, r4, 0 + movs r2, 0x20 + bl decompress_palette + adds r0, r6, 0 + bl DestroyTask +_080C01BA: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end blockset_load_palette_to_gpu + + thumb_func_start sub_80C01CC +sub_80C01CC: @ 80C01CC + push {lr} + adds r1, r0, 0 + ldrh r2, [r1, 0x20] + movs r3, 0x20 + ldrsh r0, [r1, r3] + cmp r0, 0x77 + bgt _080C01DE + adds r0, r2, 0x2 + strh r0, [r1, 0x20] +_080C01DE: + ldrh r2, [r1, 0x20] + movs r3, 0x20 + ldrsh r0, [r1, r3] + cmp r0, 0x78 + ble _080C01EC + subs r0, r2, 0x2 + strh r0, [r1, 0x20] +_080C01EC: + ldrh r2, [r1, 0x22] + movs r3, 0x22 + ldrsh r0, [r1, r3] + cmp r0, 0x4F + bgt _080C01FA + adds r0, r2, 0x1 + strh r0, [r1, 0x22] +_080C01FA: + ldrh r2, [r1, 0x22] + movs r3, 0x22 + ldrsh r0, [r1, r3] + cmp r0, 0x50 + ble _080C0208 + subs r0, r2, 0x1 + strh r0, [r1, 0x22] +_080C0208: + pop {r0} + bx r0 + thumb_func_end sub_80C01CC + + thumb_func_start sub_80C020C +sub_80C020C: @ 80C020C + push {r4-r7,lr} + sub sp, 0x30 + adds r6, r0, 0 + adds r5, r1, 0 + adds r7, r2, 0 + cmp r3, 0 + beq _080C0234 + ldr r4, =gUnknown_085E8735 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xF0 + bl GetStringCenterAlignXOffset + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0 + bl sub_80BE8DC +_080C0234: + cmp r5, 0 + bne _080C024C + lsls r4, r6, 16 + lsrs r0, r4, 16 + bl NationalToHoennOrder + lsls r0, 16 + lsrs r5, r0, 16 + b _080C0250 + .pool +_080C024C: + adds r5, r6, 0 + lsls r4, r6, 16 +_080C0250: + ldr r1, =gUnknown_085E8D4F + mov r0, sp + bl CopyString + adds r1, r5, 0 + movs r2, 0x2 + movs r3, 0x3 + bl ConvertIntToDecimalString + mov r0, sp + movs r1, 0x60 + movs r2, 0x19 + bl sub_80BE8DC + lsrs r0, r4, 16 + bl NationalPokedexNumToSpecies + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _080C028C + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r0, r1, r0 + b _080C028E + .pool +_080C028C: + ldr r0, =gUnknown_0856E688 +_080C028E: + movs r1, 0x84 + movs r2, 0x19 + bl sub_80BE8DC + cmp r7, 0 + beq _080C02AC + add r4, sp, 0x10 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_81DB468 + adds r0, r4, 0 + b _080C02AE + .pool +_080C02AC: + ldr r0, =gUnknown_085E86B8 +_080C02AE: + movs r1, 0x64 + movs r2, 0x29 + bl sub_80BE8DC + ldr r0, =gUnknown_085E8755 + movs r1, 0x60 + movs r2, 0x39 + bl sub_80BE8DC + ldr r0, =gUnknown_085E8758 + movs r1, 0x60 + movs r2, 0x49 + bl sub_80BE8DC + cmp r7, 0 + beq _080C02FC + ldr r0, =gPokedexEntries + lsls r4, r6, 5 + adds r4, r0 + ldrh r0, [r4, 0xC] + movs r1, 0x81 + movs r2, 0x39 + bl sub_80C0354 + ldrh r0, [r4, 0xE] + movs r1, 0x81 + movs r2, 0x49 + bl sub_80C0460 + b _080C0310 + .pool +_080C02FC: + ldr r0, =gUnknown_085E86C6 + movs r1, 0x81 + movs r2, 0x39 + bl sub_80BE8DC + ldr r0, =gUnknown_085E86D0 + movs r1, 0x81 + movs r2, 0x49 + bl sub_80BE8DC +_080C0310: + cmp r7, 0 + beq _080C032C + ldr r0, =gPokedexEntries + lsls r1, r6, 5 + adds r0, 0x10 + adds r1, r0 + ldr r4, [r1] + b _080C032E + .pool +_080C032C: + ldr r4, =gUnknown_0855D30C +_080C032E: + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xF0 + bl GetStringCenterAlignXOffset + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0x5F + bl sub_80BE8DC + add sp, 0x30 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C020C + + thumb_func_start sub_80C0354 +sub_80C0354: @ 80C0354 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + lsls r0, 16 + lsrs r0, 16 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldr r1, =0x00002710 + muls r0, r1 + movs r1, 0xFE + bl __divsi3 + adds r7, r0, 0 + movs r1, 0xA + bl __umodsi3 + cmp r0, 0x4 + bls _080C0386 + adds r7, 0xA +_080C0386: + adds r0, r7, 0 + movs r1, 0x78 + bl __udivsi3 + adds r6, r0, 0 + lsls r0, r6, 4 + subs r0, r6 + lsls r0, 3 + subs r0, r7, r0 + movs r1, 0xA + bl __udivsi3 + adds r7, r0, 0 + mov r1, sp + movs r0, 0xFC + strb r0, [r1] + adds r1, 0x1 + movs r0, 0x13 + strb r0, [r1] + adds r0, r6, 0 + movs r1, 0xA + bl __udivsi3 + adds r2, r0, 0 + cmp r2, 0 + bne _080C03D4 + mov r1, sp + adds r1, 0x2 + movs r0, 0x12 + strb r0, [r1] + movs r5, 0x4 + adds r1, 0x1 + adds r0, r6, 0 + adds r0, 0xA1 + strb r0, [r1] + b _080C03F4 + .pool +_080C03D4: + mov r1, sp + adds r1, 0x2 + movs r0, 0xC + strb r0, [r1] + adds r1, 0x1 + adds r0, r2, 0 + adds r0, 0xA1 + strb r0, [r1] + movs r5, 0x5 + add r4, sp, 0x4 + adds r0, r6, 0 + movs r1, 0xA + bl __umodsi3 + adds r0, 0xA1 + strb r0, [r4] +_080C03F4: + adds r1, r5, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r2, r5, 0 + add r1, sp + movs r0, 0xB4 + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + mov r0, sp + adds r4, r0, r2 + adds r0, r7, 0 + movs r1, 0xA + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r4] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + mov r1, sp + adds r4, r1, r6 + adds r0, r7, 0 + movs r1, 0xA + bl __umodsi3 + adds r0, 0xA1 + strb r0, [r4] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + adds r2, r1, r5 + movs r1, 0xB2 + strb r1, [r2] + mov r2, sp + adds r1, r2, r0 + movs r0, 0xFF + strb r0, [r1] + mov r0, sp + mov r1, r9 + mov r2, r8 + bl sub_80BE8DC + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80C0354 + + thumb_func_start sub_80C0460 +sub_80C0460: @ 80C0460 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 16 + lsrs r0, 16 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x10] + ldr r5, =0x000186a0 + muls r0, r5 + ldr r1, =0x000011b8 + bl __divsi3 + adds r7, r0, 0 + movs r1, 0xA + bl __umodsi3 + cmp r0, 0x4 + bls _080C0494 + adds r7, 0xA +_080C0494: + movs r0, 0 + mov r8, r0 + mov r4, sp + adds r0, r7, 0 + adds r1, r5, 0 + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r4] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xA1 + bne _080C04C0 + movs r6, 0x1 + mov r1, sp + movs r0, 0x77 + strb r0, [r1] + b _080C04C6 + .pool +_080C04C0: + movs r1, 0x1 + mov r8, r1 + movs r6, 0x1 +_080C04C6: + ldr r1, =0x000186a0 + adds r0, r7, 0 + bl __umodsi3 + adds r7, r0, 0 + mov r4, sp + adds r4, 0x1 + ldr r1, =0x00002710 + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r4] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xA1 + bne _080C0504 + mov r2, r8 + cmp r2, 0 + bne _080C0504 + adds r1, r6, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + add r1, sp + movs r0, 0x77 + strb r0, [r1] + b _080C050E + .pool +_080C0504: + movs r3, 0x1 + mov r8, r3 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_080C050E: + ldr r1, =0x00002710 + adds r0, r7, 0 + bl __umodsi3 + adds r7, r0, 0 + mov r0, sp + adds r4, r0, r6 + movs r1, 0xFA + lsls r1, 2 + adds r0, r7, 0 + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r4] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xA1 + bne _080C054C + mov r1, r8 + cmp r1, 0 + bne _080C054C + adds r1, r6, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + add r1, sp + movs r0, 0x77 + strb r0, [r1] + b _080C0552 + .pool +_080C054C: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_080C0552: + movs r1, 0xFA + lsls r1, 2 + adds r0, r7, 0 + bl __umodsi3 + adds r7, r0, 0 + adds r1, r6, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r5, r6, 0 + mov r2, sp + adds r4, r2, r1 + adds r0, r7, 0 + movs r1, 0x64 + bl __udivsi3 + adds r0, 0xA1 + movs r3, 0 + mov r9, r3 + strb r0, [r4] + adds r0, r7, 0 + movs r1, 0x64 + bl __umodsi3 + adds r7, r0, 0 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r1, r6, 0 + mov r2, sp + adds r0, r2, r5 + movs r3, 0xAD + mov r8, r3 + mov r2, r8 + strb r2, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r5, r6, 0 + mov r3, sp + adds r4, r3, r1 + adds r0, r7, 0 + movs r1, 0xA + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r4] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r1, r6, 0 + mov r2, sp + adds r0, r2, r5 + mov r3, r9 + strb r3, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r2, r6, 0 + add r1, sp + movs r0, 0xE0 + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r3, r6, 0 + mov r0, sp + adds r1, r0, r2 + movs r0, 0xD6 + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r2, r6, 0 + mov r0, sp + adds r1, r0, r3 + movs r0, 0xE7 + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r3, sp + adds r1, r3, r2 + mov r2, r8 + strb r2, [r1] + adds r1, r3, r0 + movs r0, 0xFF + strb r0, [r1] + mov r0, sp + mov r1, r10 + ldr r2, [sp, 0x10] + bl sub_80BE8DC + 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_80C0460 + + thumb_func_start sub_80C0620 +sub_80C0620: @ 80C0620 + lsls r0, 16 + lsrs r0, 11 + ldr r1, =gPokedexEntries + adds r0, r1 + bx lr + .pool + thumb_func_end sub_80C0620 + + thumb_func_start sub_80C0630 +sub_80C0630: @ 80C0630 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0 + beq _080C0646 + cmp r1, 0x1 + beq _080C0654 + movs r0, 0x1 + b _080C065C +_080C0646: + ldr r0, =gPokedexEntries + lsls r1, r2, 5 + adds r1, r0 + ldrh r0, [r1, 0xC] + b _080C065C + .pool +_080C0654: + ldr r0, =gPokedexEntries + lsls r1, r2, 5 + adds r1, r0 + ldrh r0, [r1, 0xE] +_080C065C: + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C0630 + + thumb_func_start pokedex_flag_operation +@ u8 pokedex_flag_operation(u16 nationalPokedexNum, u8 op) +pokedex_flag_operation: @ 80C0664 + push {r4-r7,lr} + lsls r0, 16 + lsls r1, 24 + lsrs r2, r1, 24 + adds r3, r2, 0 + ldr r1, =0xffff0000 + adds r0, r1 + lsrs r1, r0, 16 + lsrs r0, 19 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x7 + ands r1, r0 + movs r0, 0x80 + lsls r0, 17 + lsls r0, r1 + lsrs r5, r0, 24 + movs r6, 0 + cmp r2, 0x1 + beq _080C06FC + cmp r2, 0x1 + bgt _080C069C + cmp r2, 0 + beq _080C06AA + b _080C07E8 + .pool +_080C069C: + cmp r3, 0x2 + bne _080C06A2 + b _080C079C +_080C06A2: + cmp r3, 0x3 + bne _080C06A8 + b _080C07D8 +_080C06A8: + b _080C07E8 +_080C06AA: + ldr r1, =0x03005d90 + ldr r0, [r1] + adds r0, 0x5C + adds r0, r4 + ldrb r2, [r0] + ands r2, r5 + adds r7, r1, 0 + cmp r2, 0 + bne _080C06BE + b _080C07E8 +_080C06BE: + ldr r0, =0x03005d8c + ldr r3, [r0] + ldr r6, =0x00000988 + adds r1, r3, r6 + adds r1, r4 + ldrb r1, [r1] + ands r1, r5 + adds r6, r0, 0 + cmp r2, r1 + bne _080C06E0 + ldr r1, =0x00003b24 + adds r0, r3, r1 + adds r0, r4 + ldrb r0, [r0] + ands r0, r5 + cmp r2, r0 + beq _080C073E +_080C06E0: + ldr r1, [r7] + adds r1, 0x5C + adds r1, r4 + mvns r3, r5 + b _080C076A + .pool +_080C06FC: + ldr r1, =0x03005d90 + ldr r3, [r1] + adds r0, r3, 0 + adds r0, 0x28 + adds r0, r4 + ldrb r2, [r0] + ands r2, r5 + adds r7, r1, 0 + cmp r2, 0 + beq _080C07E8 + adds r0, r3, 0 + adds r0, 0x5C + adds r0, r4 + ldrb r0, [r0] + ands r0, r5 + ldr r6, =0x03005d8c + cmp r2, r0 + bne _080C0754 + ldr r1, [r6] + ldr r3, =0x00000988 + adds r0, r1, r3 + adds r0, r4 + ldrb r0, [r0] + ands r0, r5 + cmp r2, r0 + bne _080C0754 + ldr r3, =0x00003b24 + adds r0, r1, r3 + adds r0, r4 + ldrb r0, [r0] + ands r0, r5 + cmp r2, r0 + bne _080C0754 +_080C073E: + movs r6, 0x1 + b _080C07E8 + .pool +_080C0754: + ldr r1, [r7] + adds r1, 0x28 + adds r1, r4 + mvns r3, r5 + ldrb r2, [r1] + adds r0, r3, 0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r7] + adds r1, 0x5C + adds r1, r4 +_080C076A: + ldrb r2, [r1] + adds r0, r3, 0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r6] + ldr r0, =0x00000988 + adds r1, r0 + adds r1, r4 + ldrb r2, [r1] + adds r0, r3, 0 + ands r0, r2 + strb r0, [r1] + ldr r0, [r6] + ldr r1, =0x00003b24 + adds r0, r1 + adds r0, r4 + ldrb r1, [r0] + ands r3, r1 + strb r3, [r0] + movs r6, 0 + b _080C07E8 + .pool +_080C079C: + ldr r0, =0x03005d90 + ldr r1, [r0] + adds r1, 0x5C + adds r1, r4 + ldrb r2, [r1] + adds r0, r5, 0 + orrs r0, r2 + strb r0, [r1] + ldr r3, =0x03005d8c + ldr r1, [r3] + ldr r0, =0x00000988 + adds r1, r0 + adds r1, r4 + ldrb r2, [r1] + adds r0, r5, 0 + orrs r0, r2 + strb r0, [r1] + ldr r1, [r3] + ldr r3, =0x00003b24 + adds r1, r3 + b _080C07DE + .pool +_080C07D8: + ldr r0, =0x03005d90 + ldr r1, [r0] + adds r1, 0x28 +_080C07DE: + adds r1, r4 + ldrb r2, [r1] + adds r0, r5, 0 + orrs r0, r2 + strb r0, [r1] +_080C07E8: + adds r0, r6, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end pokedex_flag_operation + + thumb_func_start pokedex_count +pokedex_count: @ 80C07F4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + movs r0, 0 + ldr r7, =0x00000181 +_080C0800: + cmp r6, 0 + beq _080C0810 + cmp r6, 0x1 + beq _080C081A + adds r4, r0, 0x1 + b _080C0832 + .pool +_080C0810: + adds r4, r0, 0x1 + lsls r0, r4, 16 + lsrs r0, 16 + movs r1, 0 + b _080C0822 +_080C081A: + adds r4, r0, 0x1 + lsls r0, r4, 16 + lsrs r0, 16 + movs r1, 0x1 +_080C0822: + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080C0832 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_080C0832: + lsls r0, r4, 16 + lsrs r0, 16 + cmp r0, r7 + bls _080C0800 + adds r0, r5, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end pokedex_count + + thumb_func_start sub_80C0844 +sub_80C0844: @ 80C0844 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + movs r0, 0 +_080C084E: + cmp r6, 0 + beq _080C085A + cmp r6, 0x1 + beq _080C086C + adds r4, r0, 0x1 + b _080C088C +_080C085A: + adds r4, r0, 0x1 + lsls r0, r4, 16 + lsrs r0, 16 + bl HoennToNationalOrder + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + b _080C087C +_080C086C: + adds r4, r0, 0x1 + lsls r0, r4, 16 + lsrs r0, 16 + bl HoennToNationalOrder + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 +_080C087C: + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080C088C + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_080C088C: + lsls r0, r4, 16 + lsrs r0, 16 + cmp r0, 0xC9 + bls _080C084E + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80C0844 + + thumb_func_start sub_80C089C +sub_80C089C: @ 80C089C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + movs r0, 0 +_080C08A6: + cmp r6, 0 + beq _080C08B2 + cmp r6, 0x1 + beq _080C08BC + adds r4, r0, 0x1 + b _080C08D4 +_080C08B2: + adds r4, r0, 0x1 + lsls r0, r4, 16 + lsrs r0, 16 + movs r1, 0 + b _080C08C4 +_080C08BC: + adds r4, r0, 0x1 + lsls r0, r4, 16 + lsrs r0, 16 + movs r1, 0x1 +_080C08C4: + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080C08D4 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_080C08D4: + lsls r0, r4, 16 + lsrs r0, 16 + cmp r0, 0x96 + bls _080C08A6 + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80C089C + + thumb_func_start sub_80C08E4 +sub_80C08E4: @ 80C08E4 + push {r4,lr} + movs r0, 0 +_080C08E8: + adds r0, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl HoennToNationalOrder + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + bne _080C0908 + movs r0, 0 + b _080C0910 +_080C0908: + adds r0, r4, 0 + cmp r0, 0xC7 + bls _080C08E8 + movs r0, 0x1 +_080C0910: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80C08E4 + + thumb_func_start sub_80C0918 +sub_80C0918: @ 80C0918 + push {r4,lr} + movs r0, 0 +_080C091C: + adds r0, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + bne _080C0934 + movs r0, 0 + b _080C093C +_080C0934: + adds r0, r4, 0 + cmp r0, 0x95 + bls _080C091C + movs r0, 0x1 +_080C093C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80C0918 + + thumb_func_start sub_80C0944 +sub_80C0944: @ 80C0944 + push {r4,r5,lr} + movs r0, 0 +_080C0948: + adds r0, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080C0996 + adds r0, r4, 0 + cmp r0, 0x95 + bls _080C0948 + movs r0, 0x97 +_080C0964: + adds r0, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080C0996 + adds r0, r4, 0 + cmp r0, 0xF7 + bls _080C0964 + movs r0, 0xFB + ldr r5, =0x0000017f +_080C0982: + adds r0, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + bne _080C09A0 +_080C0996: + movs r0, 0 + b _080C09A8 + .pool +_080C09A0: + adds r0, r4, 0 + cmp r0, r5 + bls _080C0982 + movs r0, 0x1 +_080C09A8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80C0944 + + thumb_func_start sub_80C09B0 +sub_80C09B0: @ 80C09B0 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + movs r1, 0x80 + lsls r1, 1 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _080C09E2 + movs r0, 0 + bl ClearGpuRegBits + movs r0, 0x8 + movs r1, 0 + bl SetGpuReg + movs r0, 0x10 + movs r1, 0 + bl SetGpuReg + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg +_080C09E2: + movs r1, 0x80 + lsls r1, 2 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _080C0A0C + movs r0, 0 + bl ClearGpuRegBits + movs r0, 0xA + movs r1, 0 + bl SetGpuReg + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + movs r0, 0x16 + movs r1, 0 + bl SetGpuReg +_080C0A0C: + movs r1, 0x80 + lsls r1, 3 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _080C0A36 + movs r0, 0 + bl ClearGpuRegBits + movs r0, 0xC + movs r1, 0 + bl SetGpuReg + movs r0, 0x18 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg +_080C0A36: + movs r1, 0x80 + lsls r1, 4 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _080C0A60 + movs r0, 0 + bl ClearGpuRegBits + movs r0, 0xE + movs r1, 0 + bl SetGpuReg + movs r0, 0x1C + movs r1, 0 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0 + bl SetGpuReg +_080C0A60: + movs r1, 0x80 + lsls r1, 5 + ands r5, r1 + cmp r5, 0 + bne _080C0A7E + movs r0, 0 + bl ClearGpuRegBits + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + ldr r1, =0x0300301c + movs r0, 0x8 + strb r0, [r1] +_080C0A7E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C09B0 + + thumb_func_start sub_80C0A88 +sub_80C0A88: @ 80C0A88 + push {r4-r6,lr} + sub sp, 0x18 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + add r4, sp, 0x14 + movs r6, 0 + strb r6, [r4] + adds r5, r4, 0 + movs r4, 0xF + strb r4, [r5, 0x1] + movs r4, 0x3 + strb r4, [r5, 0x2] + str r6, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + subs r4, 0x4 + str r4, [sp, 0xC] + str r1, [sp, 0x10] + movs r1, 0x1 + bl AddTextPrinterParametrized2 + add sp, 0x18 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80C0A88 + + thumb_func_start sub_80C0AC4 +sub_80C0AC4: @ 80C0AC4 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r6, r0, 0 + adds r4, r1, 0 + mov r8, r2 + mov r9, r3 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r5, sp + adds r0, r4, 0 + movs r1, 0x64 + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r5] + mov r5, sp + adds r0, r4, 0 + movs r1, 0x64 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + movs r1, 0xA + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r5, 0x1] + mov r5, sp + adds r0, r4, 0 + movs r1, 0xA + bl __umodsi3 + adds r0, 0xA1 + strb r0, [r5, 0x2] + mov r1, sp + movs r0, 0xFF + strb r0, [r1, 0x3] + adds r0, r6, 0 + mov r2, r8 + mov r3, r9 + bl sub_80C0A88 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80C0AC4 + + thumb_func_start sub_80C0B44 +sub_80C0B44: @ 80C0B44 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 16 + lsrs r5, r1, 16 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r6, r3, 24 + movs r4, 0 + movs r2, 0xFF +_080C0B62: + mov r1, sp + adds r0, r1, r4 + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xA + bls _080C0B62 + adds r0, r5, 0 + bl NationalPokedexNumToSpecies + adds r5, r0, 0 + cmp r5, 0 + beq _080C0BC0 + movs r4, 0 + ldr r2, =gSpeciesNames + movs r0, 0xB + adds r1, r5, 0 + muls r1, r0 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xFF + beq _080C0BD4 + adds r3, r2, 0 + adds r2, r1, 0 +_080C0B98: + mov r0, sp + adds r1, r0, r4 + adds r0, r4, r2 + adds r0, r3 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, r2 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0xFF + beq _080C0BD4 + cmp r4, 0x9 + bls _080C0B98 + b _080C0BD4 + .pool +_080C0BC0: + movs r4, 0 + movs r1, 0xAE +_080C0BC4: + mov r2, sp + adds r0, r2, r4 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _080C0BC4 +_080C0BD4: + mov r0, r8 + mov r1, sp + adds r2, r7, 0 + adds r3, r6, 0 + bl sub_80C0A88 + adds r0, r4, 0 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80C0B44 + + thumb_func_start sub_80C0BF0 +sub_80C0BF0: @ 80C0BF0 + push {r4-r7,lr} + sub sp, 0xC + adds r4, r1, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r2, 24 + lsrs r2, 24 + mov r12, r2 + lsls r3, 24 + lsrs r5, r3, 24 + movs r2, 0 + movs r1, 0 +_080C0C08: + mov r3, sp + adds r0, r3, r2 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xA + bls _080C0C08 + movs r3, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _080C0C32 +_080C0C20: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + adds r0, r4, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _080C0C32 + cmp r3, 0xA + bls _080C0C20 +_080C0C32: + movs r2, 0 + cmp r2, r3 + bcs _080C0C52 +_080C0C38: + adds r0, r2, 0 + adds r0, 0xB + subs r0, r3 + mov r7, sp + adds r1, r7, r0 + adds r0, r4, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r3 + bcc _080C0C38 +_080C0C52: + mov r1, sp + movs r0, 0xFF + strb r0, [r1, 0xB] + adds r0, r6, 0 + mov r2, r12 + adds r3, r5, 0 + bl sub_80C0A88 + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80C0BF0 + + thumb_func_start sub_80C0C6C +sub_80C0C6C: @ 80C0C6C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r6, r3, 24 + movs r5, 0 + movs r1, 0xFA + lsls r1, 2 + adds r0, r4, 0 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _080C0CA2 + mov r1, sp + movs r0, 0x77 + strb r0, [r1] + b _080C0CAA +_080C0CA2: + mov r1, sp + adds r0, 0xA1 + strb r0, [r1] + movs r5, 0x1 +_080C0CAA: + movs r1, 0xFA + lsls r1, 2 + adds r0, r4, 0 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _080C0CD0 + cmp r5, 0 + bne _080C0CD0 + mov r1, sp + movs r0, 0x77 + b _080C0CD4 +_080C0CD0: + mov r1, sp + adds r0, 0xA1 +_080C0CD4: + strb r0, [r1, 0x1] + mov r5, sp + movs r1, 0xFA + lsls r1, 2 + adds r0, r4, 0 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + movs r1, 0xA + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r5, 0x2] + mov r1, sp + movs r0, 0xAD + strb r0, [r1, 0x3] + mov r5, sp + adds r0, r4, 0 + movs r1, 0xA + bl __umodsi3 + adds r0, 0xA1 + strb r0, [r5, 0x4] + mov r1, sp + movs r0, 0xFF + strb r0, [r1, 0x5] + mov r0, r8 + adds r2, r7, 0 + adds r3, r6, 0 + bl sub_80C0A88 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80C0C6C + + thumb_func_start sub_80C0D30 +sub_80C0D30: @ 80C0D30 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x80 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r4, =gMonFootprintTable + adds r0, r1, 0 + bl NationalPokedexNumToSpecies + lsls r0, 16 + lsrs r0, 14 + adds r0, r4 + ldr r0, [r0] + mov r12, r0 + movs r5, 0 + movs r1, 0 + movs r7, 0x2 +_080C0D5A: + mov r2, r12 + adds r0, r2, r1 + ldrb r3, [r0] + movs r4, 0 + adds r6, r1, 0x1 +_080C0D64: + lsls r2, r4, 1 + adds r1, r3, 0 + asrs r1, r2 + movs r0, 0x1 + ands r1, r0 + negs r0, r1 + orrs r0, r1 + asrs r1, r0, 31 + ands r1, r7 + adds r0, r7, 0 + lsls r0, r2 + ands r0, r3 + cmp r0, 0 + beq _080C0D84 + movs r0, 0x20 + orrs r1, r0 +_080C0D84: + mov r2, sp + adds r0, r2, r5 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _080C0D64 + lsls r0, r6, 16 + lsrs r1, r0, 16 + cmp r1, 0x1F + bls _080C0D5A + mov r0, r8 + mov r1, sp + movs r2, 0x80 + movs r3, 0 + bl CopyToWindowPixelBuffer + add sp, 0x80 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C0D30 + + thumb_func_start sub_80C0DC0 +sub_80C0DC0: @ 80C0DC0 + push {r4,lr} + lsls r0, 16 + lsls r1, 16 + lsrs r1, 16 + lsrs r0, 5 + ldr r2, =0x06000232 + adds r3, r0, r2 + movs r4, 0xF0 + lsls r4, 8 + adds r2, r1, r4 + strh r2, [r3] + ldr r2, =0x06000234 + adds r3, r0, r2 + adds r4, 0x1 + adds r2, r1, r4 + strh r2, [r3] + ldr r2, =0x06000272 + adds r3, r0, r2 + adds r4, 0x1 + adds r2, r1, r4 + strh r2, [r3] + ldr r2, =0x06000274 + adds r0, r2 + adds r4, 0x1 + adds r1, r4 + strh r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C0DC0 + + thumb_func_start sub_80C0E0C +sub_80C0E0C: @ 80C0E0C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + lsls r1, 16 + lsrs r0, r1, 16 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + cmp r4, 0x1 + beq _080C0E38 + cmp r4, 0x1 + bgt _080C0E2E + cmp r4, 0 + beq _080C0E40 + b _080C0E60 +_080C0E2E: + cmp r5, 0x2 + beq _080C0E52 + cmp r5, 0x3 + beq _080C0E46 + b _080C0E60 +_080C0E38: + cmp r0, r2 + bls _080C0E60 + subs r0, 0x1 + b _080C0E58 +_080C0E40: + cmp r0, r3 + bcs _080C0E60 + b _080C0E56 +_080C0E46: + cmp r0, r2 + bls _080C0E4E + subs r0, 0x1 + b _080C0E58 +_080C0E4E: + adds r0, r3, 0 + b _080C0E60 +_080C0E52: + cmp r0, r3 + bcs _080C0E5E +_080C0E56: + adds r0, 0x1 +_080C0E58: + lsls r0, 16 + lsrs r0, 16 + b _080C0E60 +_080C0E5E: + adds r0, r2, 0 +_080C0E60: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80C0E0C + + thumb_func_start sub_80C0E68 +sub_80C0E68: @ 80C0E68 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0xC9 + beq _080C0E88 + movs r0, 0x9A + lsls r0, 1 + cmp r1, r0 + bne _080C0E94 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r0, [r0, 0x20] + b _080C0E96 + .pool +_080C0E88: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r0, [r0, 0x1C] + b _080C0E96 + .pool +_080C0E94: + movs r0, 0 +_080C0E96: + pop {r1} + bx r1 + thumb_func_end sub_80C0E68 + + thumb_func_start sub_80C0E9C +sub_80C0E9C: @ 80C0E9C + push {r4-r6,lr} + sub sp, 0x14 + adds r4, r1, 0 + adds r5, r2, 0 + adds r6, r3, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + bl NationalPokedexNumToSpecies + adds r1, r0, 0 + adds r0, r1, 0 + str r1, [sp, 0x10] + bl sub_80C0E68 + adds r2, r0, 0 + lsls r4, 16 + asrs r4, 16 + str r4, [sp] + lsls r5, 16 + asrs r5, 16 + str r5, [sp, 0x4] + lsls r6, 24 + lsrs r6, 24 + str r6, [sp, 0x8] + ldr r0, =0x0000ffff + str r0, [sp, 0xC] + ldr r1, [sp, 0x10] + adds r0, r1, 0 + movs r1, 0x8 + movs r3, 0x1 + bl sub_818D7D8 + lsls r0, 16 + lsrs r0, 16 + add sp, 0x14 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C0E9C + + thumb_func_start sub_80C0EF8 +sub_80C0EF8: @ 80C0EF8 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp] + ldr r1, =0x0000ffff + str r1, [sp, 0x4] + movs r1, 0x1 + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_818D8AC + lsls r0, 16 + lsrs r0, 16 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C0EF8 + + thumb_func_start sub_80C0F30 +sub_80C0F30: @ 80C0F30 + 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 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x4] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x8] + lsls r5, 24 + lsrs r5, 24 + mov r10, r5 + bl sub_80BC8D4 + movs r5, 0 + movs r6, 0 + ldr r4, =0x00000181 + ldr r3, =0x02039b4c +_080C0F6A: + ldr r2, [r3] + lsls r0, r5, 2 + adds r1, r2, r0 + ldrb r0, [r1, 0x2] + lsls r0, 31 + cmp r0, 0 + beq _080C0F86 + lsls r0, r6, 2 + adds r0, r2, r0 + ldr r1, [r1] + str r1, [r0] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_080C0F86: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r4 + bls _080C0F6A + ldr r1, =0x02039b4c + ldr r0, [r1] + ldr r2, =0x0000060c + adds r0, r2 + adds r1, r6, 0 + strh r6, [r0] + cmp r7, 0xFF + beq _080C103C + movs r5, 0 + lsls r0, r1, 16 + movs r6, 0 + cmp r0, 0 + beq _080C1032 + lsls r7, 2 + ldr r0, =gUnknown_0856ED08 + adds r0, 0x3 + adds r0, r7, r0 + str r0, [sp, 0xC] + ldr r0, =gUnknown_0856ED08 + adds r0, r7 + mov r9, r0 +_080C0FBA: + ldr r1, =0x02039b4c + ldr r0, [r1] + lsls r4, r5, 2 + adds r0, r4 + ldrh r0, [r0] + bl NationalPokedexNumToSpecies + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, =gSpeciesNames + movs r0, 0xB + muls r0, r2 + adds r0, r1 + ldrb r2, [r0] + adds r3, r2, 0 + mov r0, r9 + ldrb r0, [r0] + cmp r2, r0 + bcc _080C0FF2 + mov r1, r9 + ldrb r0, [r1] + ldr r1, =gUnknown_0856ED08 + adds r1, 0x1 + adds r1, r7, r1 + ldrb r1, [r1] + adds r0, r1 + cmp r2, r0 + blt _080C100A +_080C0FF2: + ldr r0, =gUnknown_0856ED08 + adds r0, 0x2 + adds r0, r7, r0 + ldrb r2, [r0] + cmp r3, r2 + bcc _080C101E + ldrb r1, [r0] + ldr r2, [sp, 0xC] + ldrb r0, [r2] + adds r1, r0 + cmp r3, r1 + bge _080C101E +_080C100A: + ldr r2, =0x02039b4c + ldr r0, [r2] + lsls r1, r6, 2 + adds r1, r0, r1 + adds r0, r4 + ldr r0, [r0] + str r0, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_080C101E: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r1, =0x02039b4c + ldr r0, [r1] + ldr r2, =0x0000060c + adds r0, r2 + ldrh r0, [r0] + cmp r5, r0 + bcc _080C0FBA +_080C1032: + ldr r1, =0x02039b4c + ldr r0, [r1] + ldr r2, =0x0000060c + adds r0, r2 + strh r6, [r0] +_080C103C: + ldr r0, [sp, 0x4] + cmp r0, 0xFF + beq _080C10AC + movs r5, 0 + movs r6, 0 + ldr r1, =0x02039b4c + ldr r0, [r1] + ldr r2, =0x0000060c + adds r0, r2 + ldrh r0, [r0] + cmp r6, r0 + bcs _080C10A2 + adds r7, r1, 0 + ldr r0, =gBaseStats + mov r8, r0 +_080C105A: + ldr r0, [r7] + lsls r4, r5, 2 + adds r0, r4 + ldrh r0, [r0] + bl NationalPokedexNumToSpecies + lsls r0, 16 + lsrs r2, r0, 16 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + add r0, r8 + ldrb r0, [r0, 0x19] + lsls r0, 25 + lsrs r0, 25 + ldr r1, [sp, 0x4] + cmp r1, r0 + bne _080C1090 + ldr r0, [r7] + lsls r1, r6, 2 + adds r1, r0, r1 + adds r0, r4 + ldr r0, [r0] + str r0, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_080C1090: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, [r7] + ldr r2, =0x0000060c + adds r0, r2 + ldrh r0, [r0] + cmp r5, r0 + bcc _080C105A +_080C10A2: + ldr r1, =0x02039b4c + ldr r0, [r1] + ldr r2, =0x0000060c + adds r0, r2 + strh r6, [r0] +_080C10AC: + ldr r0, [sp, 0x8] + cmp r0, 0xFF + bne _080C10C2 + mov r1, r10 + cmp r1, 0xFF + bne _080C10BA + b _080C11DE +_080C10BA: + mov r2, r10 + str r2, [sp, 0x8] + movs r0, 0xFF + mov r10, r0 +_080C10C2: + mov r1, r10 + cmp r1, 0xFF + bne _080C1158 + movs r5, 0 + movs r6, 0 + ldr r2, =0x02039b4c + ldr r0, [r2] + ldr r1, =0x0000060c + adds r0, r1 + ldrh r0, [r0] + cmp r6, r0 + bcs _080C11D4 + adds r3, r2, 0 + mov r7, sp + mov r8, r2 +_080C10E0: + ldr r0, [r3] + lsls r4, r5, 2 + adds r1, r0, r4 + ldrb r0, [r1, 0x2] + lsls r0, 30 + cmp r0, 0 + bge _080C112A + ldrh r0, [r1] + str r3, [sp, 0x10] + bl NationalPokedexNumToSpecies + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, =gBaseStats + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x6] + strb r1, [r7] + ldrb r0, [r0, 0x7] + strb r0, [r7, 0x1] + ldr r3, [sp, 0x10] + ldr r2, [sp, 0x8] + cmp r1, r2 + beq _080C1118 + cmp r0, r2 + bne _080C112A +_080C1118: + ldr r0, [r3] + lsls r1, r6, 2 + adds r1, r0, r1 + adds r0, r4 + ldr r0, [r0] + str r0, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_080C112A: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x0000060c + adds r0, r2 + ldrh r0, [r0] + cmp r5, r0 + bcc _080C10E0 + b _080C11D4 + .pool +_080C1158: + movs r5, 0 + movs r6, 0 + ldr r1, =0x02039b4c + ldr r0, [r1] + ldr r2, =0x0000060c + adds r0, r2 + ldrh r0, [r0] + cmp r6, r0 + bcs _080C11D4 + mov r7, sp +_080C116C: + ldr r0, [r1] + lsls r1, r5, 2 + adds r2, r0, r1 + ldrb r0, [r2, 0x2] + lsls r0, 30 + adds r4, r1, 0 + cmp r0, 0 + bge _080C11C0 + ldrh r0, [r2] + bl NationalPokedexNumToSpecies + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, =gBaseStats + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x6] + strb r1, [r7] + ldrb r0, [r0, 0x7] + strb r0, [r7, 0x1] + ldr r2, [sp, 0x8] + cmp r1, r2 + bne _080C11A2 + cmp r0, r10 + beq _080C11AC +_080C11A2: + cmp r1, r10 + bne _080C11C0 + ldr r1, [sp, 0x8] + cmp r0, r1 + bne _080C11C0 +_080C11AC: + ldr r2, =0x02039b4c + ldr r0, [r2] + lsls r1, r6, 2 + adds r1, r0, r1 + adds r0, r4 + ldr r0, [r0] + str r0, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_080C11C0: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r1, =0x02039b4c + ldr r0, [r1] + ldr r2, =0x0000060c + adds r0, r2 + ldrh r0, [r0] + cmp r5, r0 + bcc _080C116C +_080C11D4: + ldr r1, =0x02039b4c + ldr r0, [r1] + ldr r2, =0x0000060c + adds r0, r2 + strh r6, [r0] +_080C11DE: + ldr r1, =0x02039b4c + ldr r0, [r1] + ldr r2, =0x0000060c + adds r1, r0, r2 + ldrh r0, [r1] + cmp r0, 0 + beq _080C1232 + adds r5, r0, 0 + ldr r0, =0x00000181 + cmp r5, r0 + bhi _080C1232 + ldr r4, =0x02039b4c + movs r1, 0x2 + negs r1, r1 + mov r10, r1 + movs r2, 0x3 + negs r2, r2 + mov r9, r2 + mov r8, r0 + ldr r0, =0x0000ffff + adds r7, r0, 0 +_080C1208: + ldr r1, [r4] + lsls r3, r5, 2 + adds r1, r3 + ldrh r0, [r1] + orrs r0, r7 + strh r0, [r1] + ldrb r2, [r1, 0x2] + mov r0, r10 + ands r0, r2 + strb r0, [r1, 0x2] + ldr r1, [r4] + adds r1, r3 + ldrb r2, [r1, 0x2] + mov r0, r9 + ands r0, r2 + strb r0, [r1, 0x2] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r8 + bls _080C1208 +_080C1232: + adds r0, r6, 0 + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C0F30 + + thumb_func_start sub_80C1258 +sub_80C1258: @ 80C1258 + push {lr} + ldr r0, =sub_80C12E0 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C1258 + + thumb_func_start sub_80C1270 +sub_80C1270: @ 80C1270 + push {r4,r5,lr} + sub sp, 0x18 + adds r5, r1, 0 + adds r3, r2, 0 + add r1, sp, 0x14 + movs r4, 0 + strb r4, [r1] + adds r2, r1, 0 + movs r1, 0xF + strb r1, [r2, 0x1] + movs r1, 0x2 + strb r1, [r2, 0x2] + lsls r5, 24 + lsrs r5, 24 + lsls r3, 24 + lsrs r3, 24 + str r4, [sp] + str r4, [sp, 0x4] + str r2, [sp, 0x8] + subs r1, 0x3 + str r1, [sp, 0xC] + str r0, [sp, 0x10] + movs r0, 0 + movs r1, 0x1 + adds r2, r5, 0 + bl AddTextPrinterParametrized2 + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80C1270 + + thumb_func_start sub_80C12B0 +sub_80C12B0: @ 80C12B0 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp] + lsls r3, 16 + lsrs r3, 16 + str r3, [sp, 0x4] + movs r0, 0 + movs r1, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl FillWindowPixelRect + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80C12B0 + + thumb_func_start sub_80C12E0 +sub_80C12E0: @ 80C12E0 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r3, r1, 0 + cmp r0, 0x4 + bhi _080C1320 + lsls r0, 2 + ldr r1, =_080C130C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C130C: + .4byte _080C1320 + .4byte _080C1414 + .4byte _080C1480 + .4byte _080C14A0 + .4byte _080C14F0 +_080C1320: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _080C1332 + b _080C1516 +_080C1332: + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000064a + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + movs r0, 0 + bl sub_80C09B0 + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0856EFF8 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl AllocZeroed + adds r1, r0, 0 + movs r0, 0x3 + bl SetBgTilemapBuffer + adds r0, r4, 0 + bl AllocZeroed + adds r1, r0, 0 + movs r0, 0x2 + bl SetBgTilemapBuffer + adds r0, r4, 0 + bl AllocZeroed + adds r1, r0, 0 + movs r0, 0x1 + bl SetBgTilemapBuffer + adds r0, r4, 0 + bl AllocZeroed + adds r1, r0, 0 + movs r0, 0 + bl SetBgTilemapBuffer + ldr r0, =gUnknown_0856F008 + bl InitWindows + bl DeactivateAllTextPrinters + movs r0, 0 + bl PutWindowTilemap + ldr r1, =gUnknown_08DC3304 + movs r2, 0x80 + lsls r2, 6 + str r5, [sp] + movs r0, 0x3 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + bl sub_809D42C + cmp r0, 0 + bne _080C13E4 + ldr r1, =gUnknown_08DC3A0C + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + b _080C13F0 + .pool +_080C13E4: + ldr r1, =gUnknown_08DC3870 + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer +_080C13F0: + ldr r0, =gUnknown_08DC3286 + movs r1, 0x1 + movs r2, 0x7E + bl gpu_pal_apply + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] + b _080C1516 + .pool +_080C1414: + ldr r0, =gUnknown_0855D26C + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0855D27C + bl LoadTaggedObjectPalettes + adds r0, r4, 0 + bl sub_80C2594 + movs r1, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r2, r0, 3 + ldr r5, =0x03005e08 + movs r3, 0 +_080C1432: + lsls r0, r1, 1 + adds r0, r2 + adds r0, r5 + strh r3, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0xF + bls _080C1432 + adds r0, r4, 0 + bl sub_80C23B8 + movs r0, 0 + bl sub_80C2040 + adds r0, r4, 0 + bl sub_80C20F8 + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + b _080C14DA + .pool +_080C1480: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _080C14E2 + .pool +_080C14A0: + 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 r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl HideBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg +_080C14DA: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_080C14E2: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C1516 + .pool +_080C14F0: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _080C1516 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80C1570 + str r1, [r0] + movs r1, 0x87 + lsls r1, 3 + adds r0, r3, r1 + strb r2, [r0] +_080C1516: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C12E0 + + thumb_func_start sub_80C152C +sub_80C152C: @ 80C152C + push {lr} + bl FreeAllWindowBuffers + movs r0, 0 + bl GetBgTilemapBuffer + cmp r0, 0 + beq _080C1540 + bl Free +_080C1540: + movs r0, 0x1 + bl GetBgTilemapBuffer + cmp r0, 0 + beq _080C154E + bl Free +_080C154E: + movs r0, 0x2 + bl GetBgTilemapBuffer + cmp r0, 0 + beq _080C155C + bl Free +_080C155C: + movs r0, 0x3 + bl GetBgTilemapBuffer + cmp r0, 0 + beq _080C156A + bl Free +_080C156A: + pop {r0} + bx r0 + thumb_func_end sub_80C152C + + thumb_func_start sub_80C1570 +sub_80C1570: @ 80C1570 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x03005e00 + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + adds r5, r0 + ldrb r0, [r5, 0x8] + bl sub_80C2040 + adds r0, r4, 0 + bl sub_80C20F8 + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + ldr r0, =sub_80C15B0 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C1570 + + thumb_func_start sub_80C15B0 +sub_80C15B0: @ 80C15B0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080C15E4 + movs r0, 0x3 + bl audio_play + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80C1D38 + str r0, [r1] + b _080C16BC + .pool +_080C15E4: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080C1640 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r5, r0, r1 + movs r0, 0x8 + ldrsh r4, [r5, r0] + cmp r4, 0x1 + beq _080C161C + cmp r4, 0x1 + bgt _080C160C + cmp r4, 0 + beq _080C1612 + b _080C16BC + .pool +_080C160C: + cmp r4, 0x2 + beq _080C1630 + b _080C16BC +_080C1612: + movs r0, 0x15 + bl audio_play + strh r4, [r5, 0xA] + b _080C1626 +_080C161C: + movs r0, 0x15 + bl audio_play + movs r0, 0x4 + strh r0, [r5, 0xA] +_080C1626: + ldr r0, =sub_80C16CC + str r0, [r5] + b _080C16BC + .pool +_080C1630: + movs r0, 0x3 + bl audio_play + ldr r0, =sub_80C1D38 + str r0, [r5] + b _080C16BC + .pool +_080C1640: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080C167C + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r4, r1, r0 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + ble _080C167C + movs r0, 0x6D + bl audio_play + ldrh r0, [r4, 0x8] + subs r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + bl sub_80C2040 + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram +_080C167C: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080C16BC + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r4, r1, r0 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bgt _080C16BC + movs r0, 0x6D + bl audio_play + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + bl sub_80C2040 + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram +_080C16BC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C15B0 + + thumb_func_start sub_80C16CC +sub_80C16CC: @ 80C16CC + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x03005e00 + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + adds r5, r0 + ldrb r0, [r5, 0x8] + ldrb r1, [r5, 0xA] + bl sub_80C2064 + adds r0, r4, 0 + bl sub_80C20F8 + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + ldr r0, =sub_80C170C + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C16CC + + thumb_func_start sub_80C170C +sub_80C170C: @ 80C170C + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _080C1740 + bl sub_809D42C + ldr r6, =gUnknown_0856EDB8 + cmp r0, 0 + bne _080C174C + ldr r6, =gUnknown_0856EDF0 + b _080C174C + .pool +_080C1740: + bl sub_809D42C + ldr r6, =gUnknown_0856ED9C + cmp r0, 0 + bne _080C174C + ldr r6, =gUnknown_0856EDD4 +_080C174C: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0 + beq _080C178C + movs r0, 0x17 + bl audio_play + adds r0, r5, 0 + bl sub_80C23B8 + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80C1570 + str r0, [r1] + b _080C1994 + .pool +_080C178C: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080C1870 + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r6, r1, r0 + movs r2, 0xA + ldrsh r0, [r6, r2] + cmp r0, 0x6 + bne _080C1860 + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _080C183C + ldr r1, =0x02039b52 + movs r0, 0x40 + strb r0, [r1] + ldr r7, =0x02039b4c + ldr r1, [r7] + ldr r0, =0x0000062a + adds r2, r1, r0 + movs r0, 0x40 + strh r0, [r2] + ldr r0, =0x02039b50 + strh r3, [r0] + movs r2, 0xC2 + lsls r2, 3 + adds r1, r2 + strh r3, [r1] + adds r0, r5, 0 + movs r1, 0x5 + bl sub_80C2318 + ldr r4, =0x03005d90 + ldr r1, [r4] + strb r0, [r1, 0x19] + bl sub_809D42C + cmp r0, 0 + bne _080C17E8 + ldr r1, [r4] + movs r0, 0 + strb r0, [r1, 0x19] +_080C17E8: + ldr r0, [r7] + ldr r1, [r4] + ldrb r1, [r1, 0x19] + ldr r2, =0x00000614 + adds r0, r2 + strh r1, [r0] + adds r0, r5, 0 + movs r1, 0x4 + bl sub_80C2318 + ldr r1, [r4] + strb r0, [r1, 0x18] + ldr r0, [r7] + ldr r1, [r4] + ldrb r1, [r1, 0x18] + movs r2, 0xC3 + lsls r2, 3 + adds r0, r2 + strh r1, [r0] + movs r0, 0x3 + bl audio_play + ldr r0, =sub_80C1D38 + str r0, [r6] + b _080C1994 + .pool +_080C183C: + ldr r0, =gUnknown_085E875B + bl sub_80C2618 + ldr r0, =sub_80C19A4 + str r0, [r6] + movs r0, 0x70 + bl audio_play + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + b _080C1994 + .pool +_080C1860: + movs r0, 0x15 + bl audio_play + ldr r0, =sub_80C1B64 + str r0, [r6] + b _080C1994 + .pool +_080C1870: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080C18B6 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0xA + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0xFF + beq _080C18B6 + movs r0, 0x5 + bl audio_play + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0] + strh r1, [r4, 0xA] + ldrb r0, [r4, 0x8] + bl sub_80C2064 + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram +_080C18B6: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080C1900 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0xA + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x1] + cmp r0, 0xFF + beq _080C1900 + movs r0, 0x5 + bl audio_play + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0, 0x1] + strh r1, [r4, 0xA] + ldrb r0, [r4, 0x8] + bl sub_80C2064 + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram +_080C1900: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080C194A + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0xA + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x2] + cmp r0, 0xFF + beq _080C194A + movs r0, 0x5 + bl audio_play + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0, 0x2] + strh r1, [r4, 0xA] + ldrb r0, [r4, 0x8] + bl sub_80C2064 + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram +_080C194A: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080C1994 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0xA + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x3] + cmp r0, 0xFF + beq _080C1994 + movs r0, 0x5 + bl audio_play + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0, 0x3] + strh r1, [r4, 0xA] + ldrb r0, [r4, 0x8] + bl sub_80C2064 + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram +_080C1994: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C170C + + thumb_func_start sub_80C19A4 +sub_80C19A4: @ 80C19A4 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x8 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r5, 0 + movs r1, 0x5 + bl sub_80C2318 + mov r10, r0 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + adds r0, r5, 0 + movs r1, 0x4 + bl sub_80C2318 + mov r9, r0 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + adds r0, r5, 0 + movs r1, 0 + bl sub_80C2318 + mov r8, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80C2318 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + adds r0, r5, 0 + movs r1, 0x2 + bl sub_80C2318 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x3 + bl sub_80C2318 + lsls r0, 24 + lsrs r0, 24 + str r4, [sp] + str r0, [sp, 0x4] + mov r0, r10 + mov r1, r9 + mov r2, r8 + adds r3, r6, 0 + bl sub_80C0F30 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80C1A4C + str r1, [r0] + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C19A4 + + thumb_func_start sub_80C1A4C +sub_80C1A4C: @ 80C1A4C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _080C1AA6 + ldr r0, =0x02039b4c + ldr r0, [r0] + ldr r1, =0x0000060c + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _080C1A84 + movs r0, 0x1F + bl audio_play + ldr r0, =gUnknown_085E8773 + bl sub_80C2618 + b _080C1A90 + .pool +_080C1A84: + movs r0, 0x20 + bl audio_play + ldr r0, =gUnknown_085E8785 + bl sub_80C2618 +_080C1A90: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80C1AB8 + str r0, [r1] + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram +_080C1AA6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C1A4C + + thumb_func_start sub_80C1AB8 +sub_80C1AB8: @ 80C1AB8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r2, r4, 0 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080C1B54 + ldr r5, =0x02039b4c + ldr r1, [r5] + ldr r3, =0x0000060c + adds r0, r1, r3 + ldrh r0, [r0] + cmp r0, 0 + beq _080C1B40 + ldr r0, =0x0000064e + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x5 + bl sub_80C2318 + ldr r1, [r5] + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x00000612 + adds r1, r2 + strh r0, [r1] + adds r0, r4, 0 + movs r1, 0x4 + bl sub_80C2318 + ldr r1, [r5] + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x00000616 + adds r1, r3 + strh r0, [r1] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80C1D38 + str r1, [r0] + movs r0, 0x3 + bl audio_play + b _080C1B54 + .pool +_080C1B40: + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80C16CC + str r0, [r1] + movs r0, 0x17 + bl audio_play +_080C1B54: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C1AB8 + + thumb_func_start sub_80C1B64 +sub_80C1B64: @ 80C1B64 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0 + bl sub_80C21D4 + ldr r2, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r6, r1, r2 + ldrb r0, [r6, 0xA] + adds r2, 0x8 + adds r1, r2 + ldr r2, =gUnknown_0856EFC8 + lsls r0, 3 + adds r0, r2 + ldrb r4, [r0, 0x4] + lsls r4, 1 + adds r4, r1, r4 + ldrb r0, [r0, 0x5] + lsls r0, 1 + adds r1, r0 + ldrh r0, [r4] + strh r0, [r6, 0x24] + ldrh r0, [r1] + strh r0, [r6, 0x26] + adds r0, r5, 0 + bl sub_80C2294 + ldrh r0, [r4] + bl sub_80C2650 + ldr r0, =sub_80C1BCC + str r0, [r6] + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C1B64 + + thumb_func_start sub_80C1BCC +sub_80C1BCC: @ 80C1BCC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r3, =0x03005e00 + lsls r2, r7, 2 + adds r2, r7 + lsls r2, 3 + adds r5, r2, r3 + ldrb r1, [r5, 0xA] + ldr r0, =gUnknown_0856EFC8 + lsls r1, 3 + adds r1, r0 + ldr r0, [r1] + mov r8, r0 + adds r3, 0x8 + adds r2, r3 + ldrb r0, [r1, 0x4] + lsls r0, 1 + adds r4, r2, r0 + ldrb r0, [r1, 0x5] + lsls r0, 1 + adds r6, r2, r0 + ldrh r0, [r1, 0x6] + subs r0, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =0x030022c0 + mov r12, r0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080C1C30 + movs r0, 0x15 + bl audio_play + bl sub_80C267C + movs r0, 0x1 + bl sub_80C21D4 + b _080C1C50 + .pool +_080C1C30: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080C1C68 + movs r0, 0x17 + bl audio_play + bl sub_80C267C + movs r0, 0x1 + bl sub_80C21D4 + ldrh r0, [r5, 0x24] + strh r0, [r4] + ldrh r0, [r5, 0x26] + strh r0, [r6] +_080C1C50: + ldr r0, =sub_80C16CC + str r0, [r5] + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + b _080C1D2E + .pool +_080C1C68: + movs r3, 0 + mov r0, r12 + ldrh r1, [r0, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080C1CCA + ldrh r0, [r4] + cmp r0, 0 + beq _080C1C8E + bl sub_80C2638 + ldrh r0, [r4] + subs r0, 0x1 + strh r0, [r4] + ldrh r0, [r4] + bl sub_80C2650 + b _080C1CAA +_080C1C8E: + ldrh r0, [r6] + cmp r0, 0 + beq _080C1CA6 + subs r0, 0x1 + strh r0, [r6] + adds r0, r7, 0 + bl sub_80C2294 + ldrh r0, [r4] + bl sub_80C2650 + movs r3, 0x1 +_080C1CA6: + cmp r3, 0 + beq _080C1D2E +_080C1CAA: + movs r0, 0x5 + bl audio_play + ldrh r0, [r4] + ldrh r1, [r6] + adds r0, r1 + lsls r0, 3 + add r0, r8 + ldr r0, [r0] + bl sub_80C2618 + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + b _080C1D2E +_080C1CCA: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080C1D2E + ldrh r0, [r4] + cmp r0, 0x4 + bhi _080C1CEE + cmp r0, r2 + bcs _080C1CEE + bl sub_80C2638 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + ldrh r0, [r4] + bl sub_80C2650 + b _080C1D10 +_080C1CEE: + cmp r2, 0x5 + bls _080C1D0C + ldrh r1, [r6] + subs r0, r2, 0x5 + cmp r1, r0 + bge _080C1D0C + adds r0, r1, 0x1 + strh r0, [r6] + adds r0, r7, 0 + bl sub_80C2294 + movs r0, 0x5 + bl sub_80C2650 + movs r3, 0x1 +_080C1D0C: + cmp r3, 0 + beq _080C1D2E +_080C1D10: + movs r0, 0x5 + bl audio_play + ldrh r0, [r4] + ldrh r1, [r6] + adds r0, r1 + lsls r0, 3 + add r0, r8 + ldr r0, [r0] + bl sub_80C2618 + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram +_080C1D2E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80C1BCC + + thumb_func_start sub_80C1D38 +sub_80C1D38: @ 80C1D38 + 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 pal_fade_maybe + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80C1D70 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C1D38 + + thumb_func_start sub_80C1D70 +sub_80C1D70: @ 80C1D70 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080C1D8C + bl sub_80C152C + adds r0, r4, 0 + bl DestroyTask +_080C1D8C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C1D70 + + thumb_func_start sub_80C1D98 +sub_80C1D98: @ 80C1D98 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r3, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r2, 24 + lsrs r5, r2, 24 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x3 + bl GetBgTilemapBuffer + adds r2, r0, 0 + movs r3, 0 + cmp r3, r4 + bcs _080C1DEC + lsls r0, r5, 6 + adds r7, r0, r2 + ldr r5, =0x00000fff + lsls r2, r6, 12 +_080C1DC8: + mov r0, r8 + adds r1, r0, r3 + lsls r1, 1 + adds r1, r7 + ldrh r0, [r1] + ands r0, r5 + orrs r0, r2 + strh r0, [r1] + adds r1, 0x40 + ldrh r0, [r1] + ands r0, r5 + orrs r0, r2 + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r4 + bcc _080C1DC8 +_080C1DEC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C1D98 + + thumb_func_start sub_80C1DFC +sub_80C1DFC: @ 80C1DFC + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1 + ands r5, r0 + ands r2, r0 + lsls r2, 1 + orrs r5, r2 + cmp r4, 0xA + bhi _080C1EE8 + lsls r0, r4, 2 + ldr r1, =_080C1E28 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C1E28: + .4byte _080C1E54 + .4byte _080C1E54 + .4byte _080C1E54 + .4byte _080C1E64 + .4byte _080C1E64 + .4byte _080C1E7C + .4byte _080C1E7C + .4byte _080C1E64 + .4byte _080C1E64 + .4byte _080C1EA4 + .4byte _080C1E94 +_080C1E54: + ldr r1, =gUnknown_0856ED30 + lsls r0, r4, 3 + adds r0, r1 + ldrb r1, [r0, 0x4] + ldrb r2, [r0, 0x5] + b _080C1EC2 + .pool +_080C1E64: + ldr r2, =gUnknown_0856ED48 + subs r1, r4, 0x3 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x4] + ldrb r2, [r0, 0x5] + ldrb r3, [r0, 0x6] + adds r0, r5, 0 + bl sub_80C1D98 +_080C1E7C: + ldr r2, =gUnknown_0856ED48 + subs r1, r4, 0x3 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x7] + ldrb r2, [r0, 0x8] + ldrb r3, [r0, 0x9] + b _080C1EC4 + .pool +_080C1E94: + ldr r0, =gUnknown_0856ED48 + ldrb r1, [r0, 0x1C] + ldrb r2, [r0, 0x1D] + ldrb r3, [r0, 0x1E] + b _080C1EC4 + .pool +_080C1EA4: + bl sub_809D42C + cmp r0, 0 + bne _080C1ED0 + ldr r2, =gUnknown_0856ED48 + subs r1, r4, 0x3 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x4] + ldrb r2, [r0, 0x5] + subs r2, 0x2 + lsls r2, 24 + lsrs r2, 24 +_080C1EC2: + ldrb r3, [r0, 0x6] +_080C1EC4: + adds r0, r5, 0 + bl sub_80C1D98 + b _080C1EE8 + .pool +_080C1ED0: + ldr r2, =gUnknown_0856ED48 + subs r1, r4, 0x3 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x4] + ldrb r2, [r0, 0x5] + ldrb r3, [r0, 0x6] + adds r0, r5, 0 + bl sub_80C1D98 +_080C1EE8: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C1DFC + + thumb_func_start sub_80C1EF4 +sub_80C1EF4: @ 80C1EF4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x1 + beq _080C1F5E + cmp r0, 0x1 + bgt _080C1F0A + cmp r0, 0 + beq _080C1F10 + b _080C203C +_080C1F0A: + cmp r1, 0x2 + beq _080C1FCE + b _080C203C +_080C1F10: + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0xA + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x5 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x6 + movs r1, 0x1 + movs r2, 0 + b _080C1FAA +_080C1F5E: + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC + movs r0, 0xA + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC + movs r0, 0x5 + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC + movs r0, 0x6 + movs r1, 0x1 + movs r2, 0x1 +_080C1FAA: + bl sub_80C1DFC + movs r0, 0x7 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x8 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x9 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + b _080C203C +_080C1FCE: + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC + movs r0, 0x4 + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC + movs r0, 0xA + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC + movs r0, 0x5 + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC + movs r0, 0x6 + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC + movs r0, 0x7 + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC + movs r0, 0x8 + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC + movs r0, 0x9 + movs r1, 0x1 + movs r2, 0x1 + bl sub_80C1DFC +_080C203C: + pop {r0} + bx r0 + thumb_func_end sub_80C1EF4 + + thumb_func_start sub_80C2040 +sub_80C2040: @ 80C2040 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_80C1EF4 + ldr r0, =gUnknown_0856ED30 + lsls r4, 3 + adds r4, r0 + ldr r0, [r4] + bl sub_80C2618 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C2040 + + thumb_func_start sub_80C2064 +sub_80C2064: @ 80C2064 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + bl sub_80C1EF4 + cmp r4, 0x6 + bhi _080C20DE + lsls r0, r4, 2 + ldr r1, =_080C2084 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C2084: + .4byte _080C20A0 + .4byte _080C20A4 + .4byte _080C20A8 + .4byte _080C20B6 + .4byte _080C20C4 + .4byte _080C20C8 + .4byte _080C20D4 +_080C20A0: + movs r0, 0x3 + b _080C20CA +_080C20A4: + movs r0, 0x4 + b _080C20CA +_080C20A8: + movs r0, 0xA + movs r1, 0 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x5 + b _080C20CA +_080C20B6: + movs r0, 0xA + movs r1, 0 + movs r2, 0 + bl sub_80C1DFC + movs r0, 0x6 + b _080C20CA +_080C20C4: + movs r0, 0x7 + b _080C20CA +_080C20C8: + movs r0, 0x8 +_080C20CA: + movs r1, 0 + movs r2, 0 + bl sub_80C1DFC + b _080C20DE +_080C20D4: + movs r0, 0x9 + movs r1, 0 + movs r2, 0 + bl sub_80C1DFC +_080C20DE: + ldr r0, =gUnknown_0856ED48 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl sub_80C2618 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C2064 + + thumb_func_start sub_80C20F8 +sub_80C20F8: @ 80C20F8 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x28 + movs r1, 0x10 + movs r2, 0x60 + movs r3, 0x50 + bl sub_80C12B0 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r5, r0, r1 + ldrh r0, [r5, 0x16] + ldrh r1, [r5, 0x14] + adds r0, r1 + lsls r0, 16 + ldr r1, =gUnknown_0856EE5C + lsrs r0, 13 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x2D + movs r2, 0x11 + bl sub_80C1270 + ldrh r0, [r5, 0x1A] + ldrh r1, [r5, 0x18] + adds r0, r1 + lsls r0, 16 + ldr r1, =gUnknown_0856EEB4 + lsrs r0, 13 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x2D + movs r2, 0x21 + bl sub_80C1270 + ldrh r0, [r5, 0x1E] + ldrh r1, [r5, 0x1C] + adds r0, r1 + lsls r0, 16 + ldr r4, =gUnknown_0856EF14 + lsrs r0, 13 + adds r4, 0x4 + adds r0, r4 + ldr r0, [r0] + movs r1, 0x2D + movs r2, 0x31 + bl sub_80C1270 + ldrh r0, [r5, 0x22] + ldrh r1, [r5, 0x20] + adds r0, r1 + lsls r0, 16 + lsrs r0, 13 + adds r0, r4 + ldr r0, [r0] + movs r1, 0x5D + movs r2, 0x31 + bl sub_80C1270 + ldrh r0, [r5, 0x12] + ldrh r1, [r5, 0x10] + adds r0, r1 + lsls r0, 16 + ldr r1, =gUnknown_0856EE24 + lsrs r0, 13 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x2D + movs r2, 0x41 + bl sub_80C1270 + bl sub_809D42C + cmp r0, 0 + beq _080C21B6 + ldrh r0, [r5, 0xE] + ldrh r5, [r5, 0xC] + adds r0, r5 + lsls r0, 16 + ldr r1, =gUnknown_0856EE0C + lsrs r0, 13 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x2D + movs r2, 0x51 + bl sub_80C1270 +_080C21B6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C20F8 + + thumb_func_start sub_80C21D4 +sub_80C21D4: @ 80C21D4 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x3 + bl GetBgTilemapBuffer + adds r5, r0, 0 + cmp r4, 0 + bne _080C2268 + ldr r1, =0x00000c0b + adds r0, r1, 0 + strh r0, [r5, 0x22] + movs r1, 0x12 + ldr r0, =0x0000080d + adds r2, r0, 0 +_080C21F4: + lsls r0, r1, 1 + adds r0, r5 + strh r2, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1E + bls _080C21F4 + movs r2, 0x1 + ldr r1, =0x0000040a + adds r6, r1, 0 + movs r4, 0x2 +_080C220C: + lsls r0, r2, 6 + adds r0, r5 + strh r6, [r0, 0x22] + movs r1, 0x12 + adds r3, r2, 0x1 + adds r2, r0, 0 +_080C2218: + lsls r0, r1, 1 + adds r0, r2 + strh r4, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1E + bls _080C2218 + lsls r0, r3, 16 + lsrs r2, r0, 16 + cmp r2, 0xC + bls _080C220C + ldr r2, =0x00000362 + adds r1, r5, r2 + adds r2, 0xA9 + adds r0, r2, 0 + strh r0, [r1] + movs r1, 0x12 + movs r3, 0xD0 + lsls r3, 2 + movs r2, 0xD +_080C2242: + lsls r0, r1, 1 + adds r0, r5 + adds r0, r3 + strh r2, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1E + bls _080C2242 + b _080C228C + .pool +_080C2268: + movs r2, 0 + movs r4, 0x4F +_080C226C: + movs r1, 0x11 + lsls r0, r2, 6 + adds r3, r2, 0x1 + adds r2, r0, r5 +_080C2274: + lsls r0, r1, 1 + adds r0, r2 + strh r4, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1D + bls _080C2274 + lsls r0, r3, 16 + lsrs r2, r0, 16 + cmp r2, 0xD + bls _080C226C +_080C228C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80C21D4 + + thumb_func_start sub_80C2294 +sub_80C2294: @ 80C2294 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + ldr r4, =gUnknown_0856EFC8 + ldr r3, =0x03005e00 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r0, r2, r3 + movs r5, 0xA + ldrsh r1, [r0, r5] + lsls r1, 3 + adds r1, r4 + ldr r6, [r1] + adds r3, 0x8 + adds r2, r3 + ldrb r0, [r1, 0x4] + lsls r0, 1 + adds r0, r2 + mov r8, r0 + ldrb r0, [r1, 0x5] + lsls r0, 1 + adds r7, r2, r0 + bl sub_80C267C + movs r5, 0 + ldrh r4, [r7] + b _080C22F2 + .pool +_080C22D8: + adds r0, r1, r6 + ldr r1, [r0, 0x4] + adds r0, r5, 0 + bl sub_80C2668 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r5, 0x5 + bhi _080C22FC +_080C22F2: + lsls r1, r4, 3 + adds r0, r1, r6 + ldr r0, [r0, 0x4] + cmp r0, 0 + bne _080C22D8 +_080C22FC: + mov r1, r8 + ldrh r0, [r1] + ldrh r1, [r7] + adds r0, r1 + lsls r0, 3 + adds r0, r6 + ldr r0, [r0] + bl sub_80C2618 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80C2294 + + thumb_func_start sub_80C2318 +sub_80C2318: @ 80C2318 + 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, =0x03005e08 + adds r1, r0 + ldr r2, =gUnknown_0856EFC8 + lsls r0, r3, 3 + adds r0, r2 + ldrb r2, [r0, 0x4] + lsls r2, 1 + adds r2, r1, r2 + ldrb r0, [r0, 0x5] + lsls r0, 1 + adds r1, r0 + ldrh r0, [r1] + ldrh r2, [r2] + adds r0, r2 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r3, 0x5 + bhi _080C237C + lsls r0, r3, 2 + ldr r1, =_080C2364 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C2364: + .4byte _080C2390 + .4byte _080C239A + .4byte _080C23AA + .4byte _080C23AA + .4byte _080C2388 + .4byte _080C2380 +_080C237C: + movs r0, 0 + b _080C23B0 +_080C2380: + ldr r0, =gUnknown_0856EFAC + b _080C23AC + .pool +_080C2388: + ldr r0, =gUnknown_0856EFAE + b _080C23AC + .pool +_080C2390: + cmp r2, 0 + beq _080C239E + lsls r0, r2, 24 + lsrs r0, 24 + b _080C23B0 +_080C239A: + cmp r2, 0 + bne _080C23A2 +_080C239E: + movs r0, 0xFF + b _080C23B0 +_080C23A2: + subs r0, r2, 0x1 + lsls r0, 24 + lsrs r0, 24 + b _080C23B0 +_080C23AA: + ldr r0, =gUnknown_0856EFB4 +_080C23AC: + adds r0, r2, r0 + ldrb r0, [r0] +_080C23B0: + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C2318 + + thumb_func_start sub_80C23B8 +sub_80C23B8: @ 80C23B8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x02039b4c + ldr r0, [r1] + ldr r2, =0x00000614 + adds r0, r2 + ldrh r0, [r0] + adds r5, r1, 0 + cmp r0, 0 + beq _080C23D2 + cmp r0, 0x1 + beq _080C23E0 +_080C23D2: + movs r3, 0 + b _080C23E2 + .pool +_080C23E0: + movs r3, 0x1 +_080C23E2: + ldr r1, =0x03005e00 + lsls r2, r4, 2 + adds r0, r2, r4 + lsls r0, 3 + adds r0, r1 + strh r3, [r0, 0xC] + ldr r0, [r5] + movs r3, 0xC3 + lsls r3, 3 + adds r0, r3 + ldrh r0, [r0] + adds r5, r1, 0 + cmp r0, 0x5 + bhi _080C2428 + lsls r0, 2 + ldr r1, =_080C2410 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C2410: + .4byte _080C2428 + .4byte _080C242C + .4byte _080C2430 + .4byte _080C2434 + .4byte _080C2438 + .4byte _080C243C +_080C2428: + movs r3, 0 + b _080C243E +_080C242C: + movs r3, 0x1 + b _080C243E +_080C2430: + movs r3, 0x2 + b _080C243E +_080C2434: + movs r3, 0x3 + b _080C243E +_080C2438: + movs r3, 0x4 + b _080C243E +_080C243C: + movs r3, 0x5 +_080C243E: + adds r0, r2, r4 + lsls r0, 3 + adds r0, r5 + strh r3, [r0, 0x10] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80C23B8 + + thumb_func_start sub_80C244C +sub_80C244C: @ 80C244C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r0, r1, r3 + ldrb r2, [r0, 0xA] + adds r3, 0x8 + adds r1, r3 + ldr r0, =gUnknown_0856EFC8 + lsls r2, 3 + adds r2, r0 + ldrb r0, [r2, 0x5] + lsls r0, 1 + adds r1, r0 + ldrh r0, [r2, 0x6] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bls _080C248C + ldrh r0, [r1] + cmp r0, 0 + beq _080C248C + movs r0, 0 + b _080C248E + .pool +_080C248C: + movs r0, 0x1 +_080C248E: + pop {r1} + bx r1 + thumb_func_end sub_80C244C + + thumb_func_start sub_80C2494 +sub_80C2494: @ 80C2494 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r0, r1, r3 + ldrb r2, [r0, 0xA] + adds r3, 0x8 + adds r1, r3 + ldr r0, =gUnknown_0856EFC8 + lsls r2, 3 + adds r2, r0 + ldrb r0, [r2, 0x5] + lsls r0, 1 + adds r1, r0 + ldrh r0, [r2, 0x6] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bls _080C24D8 + ldrh r1, [r1] + subs r0, 0x5 + cmp r1, r0 + bge _080C24D8 + movs r0, 0 + b _080C24DA + .pool +_080C24D8: + movs r0, 0x1 +_080C24DA: + pop {r1} + bx r1 + thumb_func_end sub_80C2494 + + thumb_func_start sub_80C24E0 +sub_80C24E0: @ 80C24E0 + push {r4,lr} + adds r4, r0, 0 + ldr r2, =0x03005e00 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, [r0] + ldr r0, =sub_80C1BCC + cmp r1, r0 + bne _080C2580 + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080C2528 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + bl sub_80C2494 + lsls r0, 24 + cmp r0, 0 + beq _080C2544 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + b _080C2550 + .pool +_080C2528: + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + bl sub_80C244C + lsls r0, 24 + cmp r0, 0 + beq _080C2544 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + b _080C2550 +_080C2544: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 +_080C2550: + strb r0, [r2] + ldrh r2, [r4, 0x32] + movs r1, 0x30 + ldrsh r0, [r4, r1] + lsls r0, 7 + adds r0, r2, r0 + lsls r0, 24 + ldr r1, =gUnknown_08329F40 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _080C256E + adds r0, 0x7F +_080C256E: + asrs r0, 7 + strh r0, [r4, 0x26] + adds r0, r2, 0 + adds r0, 0x8 + strh r0, [r4, 0x32] + b _080C258C + .pool +_080C2580: + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080C258C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80C24E0 + + thumb_func_start sub_80C2594 +sub_80C2594: @ 80C2594 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r6, =gUnknown_0855D1AC + adds r0, r6, 0 + movs r1, 0xB8 + movs r2, 0x4 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r0, r1, r4 + movs r2, 0 + strh r5, [r0, 0x2E] + strh r2, [r0, 0x30] + movs r0, 0x1C + adds r0, r4 + mov r9, r0 + add r1, r9 + ldr r0, =sub_80C24E0 + mov r8, r0 + str r0, [r1] + adds r0, r6, 0 + movs r1, 0xB8 + movs r2, 0x6C + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r4, r1, r4 + strh r5, [r4, 0x2E] + movs r0, 0x1 + strh r0, [r4, 0x30] + adds r4, 0x3F + ldrb r0, [r4] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r4] + add r1, r9 + mov r0, r8 + str r0, [r1] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C2594 + + thumb_func_start sub_80C2618 +sub_80C2618: @ 80C2618 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x8 + movs r1, 0x78 + movs r2, 0xE0 + movs r3, 0x20 + bl sub_80C12B0 + adds r0, r4, 0 + movs r1, 0x8 + movs r2, 0x79 + bl sub_80C1270 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80C2618 + + thumb_func_start sub_80C2638 +sub_80C2638: @ 80C2638 + push {lr} + adds r1, r0, 0 + lsls r1, 4 + adds r1, 0x8 + movs r0, 0x90 + movs r2, 0x8 + movs r3, 0x10 + bl sub_80C12B0 + pop {r0} + bx r0 + thumb_func_end sub_80C2638 + + thumb_func_start sub_80C2650 +sub_80C2650: @ 80C2650 + push {lr} + adds r2, r0, 0 + ldr r0, =gUnknown_085E8B3A + lsls r2, 4 + adds r2, 0x9 + movs r1, 0x90 + bl sub_80C1270 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C2650 + + thumb_func_start sub_80C2668 +sub_80C2668: @ 80C2668 + push {lr} + adds r2, r0, 0 + adds r0, r1, 0 + lsls r2, 4 + adds r2, 0x9 + movs r1, 0x98 + bl sub_80C1270 + pop {r0} + bx r0 + thumb_func_end sub_80C2668 + + thumb_func_start sub_80C267C +sub_80C267C: @ 80C267C + push {lr} + movs r0, 0x90 + movs r1, 0x8 + movs r2, 0x60 + movs r3, 0x60 + bl sub_80C12B0 + pop {r0} + bx r0 + thumb_func_end sub_80C267C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/pokedex_area_screen.s b/asm/pokedex_area_screen.s new file mode 100644 index 000000000..fda3e312c --- /dev/null +++ b/asm/pokedex_area_screen.s @@ -0,0 +1,1892 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_813CA54 +sub_813CA54: @ 813CA54 + ldr r0, =0x0203ab7c + ldr r0, [r0] + movs r1, 0x8A + lsls r1, 1 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_813CA54 + + thumb_func_start sub_813CA68 +sub_813CA68: @ 813CA68 + push {lr} + sub sp, 0x4 + ldr r0, =0x0203ab7c + ldr r0, [r0] + movs r1, 0x8A + lsls r1, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0x4 + bhi _0813CB20 + lsls r0, 2 + ldr r1, =_0813CA90 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0813CA90: + .4byte _0813CAA4 + .4byte _0813CAB4 + .4byte _0813CABA + .4byte _0813CAEC + .4byte _0813CB10 +_0813CAA4: + ldr r0, =0x0203ab7c + ldr r0, [r0] + ldrh r0, [r0, 0xE] + bl sub_813CB40 + b _0813CB24 + .pool +_0813CAB4: + bl sub_813CF0C + b _0813CB24 +_0813CABA: + ldr r1, =gUnknown_085B3DB4 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r0, =0x0203ab7c + ldr r1, [r0] + movs r0, 0x8B + lsls r0, 1 + adds r1, r0 + movs r2, 0xA0 + lsls r2, 3 + movs r0, 0x2 + movs r3, 0 + bl LoadBgTilemap + b _0813CB24 + .pool +_0813CAEC: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _0813CB34 + ldr r0, =gUnknown_085B3D94 + ldr r1, =0x02037854 + ldr r2, =0x04000008 + bl CpuSet + b _0813CB24 + .pool +_0813CB10: + ldr r1, =0xfffff800 + movs r0, 0x2 + movs r2, 0 + bl ChangeBgY + b _0813CB24 + .pool +_0813CB20: + movs r0, 0 + b _0813CB36 +_0813CB24: + ldr r0, =0x0203ab7c + ldr r1, [r0] + movs r0, 0x8A + lsls r0, 1 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0813CB34: + movs r0, 0x1 +_0813CB36: + add sp, 0x4 + pop {r1} + bx r1 + .pool + thumb_func_end sub_813CA68 + + thumb_func_start sub_813CB40 +sub_813CB40: @ 813CB40 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 16 + lsrs r7, r0, 16 + ldr r5, =0x0203ab7c + ldr r0, [r5] + ldr r1, =0x000006e2 + adds r0, r1 + movs r4, 0 + strh r4, [r0] + ldr r0, =0x0000403e + bl VarGet + ldr r1, [r5] + ldr r2, =0x000006e4 + adds r1, r2 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + bls _0813CB70 + strh r4, [r1] +_0813CB70: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r3, =0x000031dc + adds r0, r3 + ldrh r1, [r0, 0x8] + cmp r7, r1 + bne _0813CB80 + b _0813CCB8 +_0813CB80: + ldr r1, [r5] + movs r2, 0x88 + lsls r2, 1 + adds r0, r1, r2 + strh r4, [r0] + movs r3, 0x89 + lsls r3, 1 + adds r0, r1, r3 + strh r4, [r0] + movs r6, 0 + ldr r1, =gUnknown_085B3EE8 +_0813CB96: + lsls r0, r6, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r7 + bne _0813CBA2 + b _0813CCF8 +_0813CBA2: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0 + beq _0813CB96 + movs r6, 0 + ldr r4, =gUnknown_085B3EF0 + ldrh r0, [r4] + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _0813CC44 + mov r8, r4 + adds r5, r4, 0x4 + mov r9, r1 +_0813CBC0: + lsls r0, r6, 1 + adds r1, r0, r6 + lsls r2, r1, 1 + mov r3, r8 + adds r1, r2, r3 + adds r3, r0, 0 + ldrh r1, [r1] + cmp r7, r1 + bne _0813CC2E + adds r0, r4, 0x2 + adds r0, r2, r0 + ldrh r0, [r0] + cmp r0, 0x18 + beq _0813CC1A + cmp r0, 0x18 + bgt _0813CC08 + cmp r0, 0 + beq _0813CC0E + b _0813CC2E + .pool +_0813CC08: + cmp r0, 0x1A + beq _0813CC1A + b _0813CC2E +_0813CC0E: + adds r0, r2, r5 + ldrh r1, [r0] + movs r0, 0 + bl sub_813CD04 + b _0813CC2E +_0813CC1A: + adds r1, r3, r6 + lsls r1, 1 + mov r0, r8 + adds r0, 0x2 + adds r0, r1, r0 + ldrh r0, [r0] + adds r1, r5 + ldrh r1, [r1] + bl sub_813CD64 +_0813CC2E: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r4, =gUnknown_085B3EF0 + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 1 + adds r0, r4 + ldrh r0, [r0] + cmp r0, r9 + bne _0813CBC0 +_0813CC44: + movs r6, 0 + ldr r1, =gWildMonHeaders + ldrb r0, [r1] + cmp r0, 0xFF + beq _0813CCF8 +_0813CC4E: + lsls r4, r6, 2 + adds r0, r4, r6 + lsls r0, 2 + adds r5, r0, r1 + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_813CE48 + lsls r0, 24 + cmp r0, 0 + beq _0813CC9C + ldrb r0, [r5] + cmp r0, 0x18 + beq _0813CC8C + cmp r0, 0x18 + bgt _0813CC7C + cmp r0, 0 + beq _0813CC82 + b _0813CC9C + .pool +_0813CC7C: + cmp r0, 0x1A + beq _0813CC8C + b _0813CC9C +_0813CC82: + ldrb r1, [r5, 0x1] + movs r0, 0 + bl sub_813CD04 + b _0813CC9C +_0813CC8C: + ldr r0, =gWildMonHeaders + adds r1, r4, r6 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + ldrb r1, [r1, 0x1] + bl sub_813CD64 +_0813CC9C: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r1, =gWildMonHeaders + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _0813CC4E + b _0813CCF8 + .pool +_0813CCB8: + ldr r2, [r5] + movs r3, 0x89 + lsls r3, 1 + adds r1, r2, r3 + strh r4, [r1] + ldrb r1, [r0, 0x13] + cmp r1, 0 + beq _0813CCF0 + adds r0, r2, 0 + adds r0, 0x10 + adds r1, r2, 0 + adds r1, 0x11 + bl sub_8161F64 + ldr r1, [r5] + ldrb r0, [r1, 0x10] + ldrb r1, [r1, 0x11] + bl get_mapheader_by_bank_and_number + ldr r1, [r5] + ldrb r0, [r0, 0x14] + strh r0, [r1, 0x12] + movs r0, 0x88 + lsls r0, 1 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1] + b _0813CCF8 +_0813CCF0: + movs r3, 0x88 + lsls r3, 1 + adds r0, r2, r3 + strh r1, [r0] +_0813CCF8: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_813CB40 + + thumb_func_start sub_813CD04 +sub_813CD04: @ 813CD04 + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r3, r1, 16 + ldr r4, =0x0203ab7c + ldr r2, [r4] + movs r0, 0x88 + lsls r0, 1 + adds r1, r2, r0 + ldrh r0, [r1] + cmp r0, 0x3F + bhi _0813CD58 + lsls r0, 2 + adds r0, r2, r0 + strb r5, [r0, 0x10] + ldr r1, [r4] + movs r2, 0x88 + lsls r2, 1 + adds r0, r1, r2 + ldrh r0, [r0] + lsls r0, 2 + adds r1, r0 + strb r3, [r1, 0x11] + adds r0, r5, 0 + adds r1, r3, 0 + bl get_mapheader_by_bank_and_number + ldrb r0, [r0, 0x14] + bl sub_8123F9C + ldr r2, [r4] + movs r1, 0x88 + lsls r1, 1 + adds r3, r2, r1 + ldrh r1, [r3] + lsls r1, 2 + adds r2, r1 + strh r0, [r2, 0x12] + ldrh r0, [r3] + adds r0, 0x1 + strh r0, [r3] +_0813CD58: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813CD04 + + thumb_func_start sub_813CD64 +sub_813CD64: @ 813CD64 + push {r4-r7,lr} + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =0x0203ab7c + ldr r0, [r0] + movs r3, 0x89 + lsls r3, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, 0x1F + bhi _0813CE22 + lsls r0, r2, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + bl sub_813CE34 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0xD4 + bhi _0813CE22 + movs r3, 0 + ldr r0, =gUnknown_085B3EEA +_0813CD96: + ldrh r4, [r0] + cmp r5, r4 + beq _0813CE22 + adds r0, 0x2 + adds r3, 0x1 + cmp r3, 0x2 + bls _0813CD96 + ldr r1, =gUnknown_085B3EFC + ldrh r0, [r1] + cmp r0, 0xD5 + beq _0813CDD2 + adds r4, r1, 0 + adds r7, r4, 0 + movs r6, 0 +_0813CDB2: + ldrh r0, [r4] + cmp r5, r0 + bne _0813CDC8 + adds r0, r7, 0x2 + adds r0, r6, r0 + ldrh r0, [r0] + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0813CE22 +_0813CDC8: + adds r4, 0x4 + adds r6, 0x4 + ldrh r0, [r4] + cmp r0, 0xD5 + bne _0813CDB2 +_0813CDD2: + movs r3, 0 + ldr r0, =0x0203ab7c + ldr r2, [r0] + movs r4, 0x89 + lsls r4, 1 + adds r1, r2, r4 + ldrh r4, [r1] + adds r1, r0, 0 + cmp r3, r4 + bge _0813CE02 + movs r6, 0xC4 + lsls r6, 3 + adds r0, r2, r6 + ldrh r0, [r0] + cmp r0, r5 + beq _0813CE02 + adds r2, r6 +_0813CDF4: + adds r2, 0x2 + adds r3, 0x1 + cmp r3, r4 + bge _0813CE02 + ldrh r0, [r2] + cmp r0, r5 + bne _0813CDF4 +_0813CE02: + ldr r1, [r1] + movs r0, 0x89 + lsls r0, 1 + adds r2, r1, r0 + ldrh r4, [r2] + cmp r3, r4 + bne _0813CE22 + lsls r0, r3, 1 + movs r6, 0xC4 + lsls r6, 3 + adds r1, r6 + adds r1, r0 + strh r5, [r1] + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] +_0813CE22: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813CD64 + + thumb_func_start sub_813CE34 +sub_813CE34: @ 813CE34 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + bl get_mapheader_by_bank_and_number + ldrb r0, [r0, 0x14] + pop {r1} + bx r1 + thumb_func_end sub_813CE34 + + thumb_func_start sub_813CE48 +sub_813CE48: @ 813CE48 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + ldrb r0, [r4] + ldrb r1, [r4, 0x1] + bl sub_813CE34 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xD2 + bne _0813CE7C + ldr r0, =0x0203ab7c + ldr r2, [r0] + ldr r0, =0x000006e2 + adds r1, r2, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + ldrh r1, [r1] + ldr r0, =0x000006e4 + adds r2, r0 + ldrh r0, [r2] + adds r0, 0x1 + cmp r1, r0 + bne _0813CEBC +_0813CE7C: + ldr r0, [r4, 0x4] + adds r1, r5, 0 + movs r2, 0xC + bl sub_813CED4 + lsls r0, 24 + cmp r0, 0 + bne _0813CECC + ldr r0, [r4, 0x8] + adds r1, r5, 0 + movs r2, 0x5 + bl sub_813CED4 + lsls r0, 24 + cmp r0, 0 + bne _0813CECC + ldr r0, [r4, 0x10] + adds r1, r5, 0 + movs r2, 0xC + bl sub_813CED4 + lsls r0, 24 + cmp r0, 0 + bne _0813CECC + ldr r0, [r4, 0xC] + adds r1, r5, 0 + movs r2, 0x5 + bl sub_813CED4 + lsls r0, 24 + cmp r0, 0 + bne _0813CECC +_0813CEBC: + movs r0, 0 + b _0813CECE + .pool +_0813CECC: + movs r0, 0x1 +_0813CECE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_813CE48 + + thumb_func_start sub_813CED4 +sub_813CED4: @ 813CED4 + push {r4,lr} + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 16 + lsrs r2, 16 + cmp r0, 0 + beq _0813CF02 + movs r3, 0 + cmp r3, r2 + bcs _0813CF02 + ldr r1, [r0, 0x4] +_0813CEEA: + lsls r0, r3, 2 + adds r0, r1 + ldrh r0, [r0, 0x2] + cmp r0, r4 + bne _0813CEF8 + movs r0, 0x1 + b _0813CF04 +_0813CEF8: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r2 + bcc _0813CEEA +_0813CF02: + movs r0, 0 +_0813CF04: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_813CED4 + + thumb_func_start sub_813CF0C +sub_813CF0C: @ 813CF0C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r4, 0 + ldr r2, =0x0203ab7c + adds r7, r2, 0 + movs r6, 0x8B + lsls r6, 1 + movs r5, 0 + ldr r3, =0x0000027f +_0813CF26: + ldr r0, [r7] + lsls r1, r4, 1 + adds r0, r6 + adds r0, r1 + strh r5, [r0] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r3 + bls _0813CF26 + movs r4, 0 + ldr r0, [r2] + movs r1, 0x88 + lsls r1, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + bcs _0813CFB2 + adds r3, r2, 0 +_0813CF4C: + movs r5, 0 + movs r6, 0 + adds r2, r4, 0x1 + mov r8, r2 + lsls r4, 2 + mov r9, r4 +_0813CF58: + movs r4, 0 +_0813CF5A: + adds r0, r4, 0 + adds r1, r6, 0 + str r3, [sp] + bl sub_8123E9C + ldr r3, [sp] + ldr r2, [r3] + mov r7, r9 + adds r1, r2, r7 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r1, 0x12] + cmp r0, r1 + bne _0813CF84 + lsls r0, r5, 1 + movs r7, 0x8B + lsls r7, 1 + adds r1, r2, r7 + adds r1, r0 + ldr r0, =0x0000ffff + strh r0, [r1] +_0813CF84: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1F + bls _0813CF5A + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x13 + bls _0813CF58 + mov r1, r8 + lsls r0, r1, 16 + lsrs r4, r0, 16 + ldr r0, [r3] + movs r2, 0x88 + lsls r2, 1 + adds r0, r2 + ldrh r0, [r0] + cmp r4, r0 + bcc _0813CF4C +_0813CFB2: + movs r5, 0 + movs r6, 0 + ldr r7, =0x0203ab7c + mov r12, r7 + movs r7, 0x8B + lsls r7, 1 + ldr r3, =0x0000ffff +_0813CFC0: + movs r4, 0 + adds r1, r6, 0x1 + mov r9, r1 +_0813CFC6: + mov r2, r12 + ldr r0, [r2] + lsls r1, r5, 1 + adds r2, r0, r7 + adds r1, r2, r1 + ldrh r0, [r1] + adds r1, r5, 0x1 + mov r8, r1 + cmp r0, r3 + bne _0813D0D2 + cmp r4, 0 + beq _0813CFF0 + subs r0, r5, 0x1 + lsls r0, 1 + adds r1, r2, r0 + ldrh r2, [r1] + cmp r2, r3 + beq _0813CFF0 + movs r0, 0x2 + orrs r0, r2 + strh r0, [r1] +_0813CFF0: + adds r2, r5, 0x1 + mov r8, r2 + cmp r4, 0x1F + beq _0813D00E + mov r1, r12 + ldr r0, [r1] + lsls r1, r2, 1 + adds r0, r7 + adds r2, r0, r1 + ldrh r1, [r2] + cmp r1, r3 + beq _0813D00E + movs r0, 0x1 + orrs r0, r1 + strh r0, [r2] +_0813D00E: + cmp r6, 0 + beq _0813D02C + mov r2, r12 + ldr r1, [r2] + adds r0, r5, 0 + subs r0, 0x20 + lsls r0, 1 + adds r1, r7 + adds r1, r0 + ldrh r2, [r1] + cmp r2, r3 + beq _0813D02C + movs r0, 0x8 + orrs r0, r2 + strh r0, [r1] +_0813D02C: + cmp r6, 0x13 + beq _0813D04A + mov r0, r12 + ldr r1, [r0] + adds r0, r5, 0 + adds r0, 0x20 + lsls r0, 1 + adds r1, r7 + adds r1, r0 + ldrh r2, [r1] + cmp r2, r3 + beq _0813D04A + movs r0, 0x4 + orrs r0, r2 + strh r0, [r1] +_0813D04A: + cmp r4, 0 + beq _0813D06C + cmp r6, 0 + beq _0813D06C + mov r2, r12 + ldr r1, [r2] + adds r0, r5, 0 + subs r0, 0x21 + lsls r0, 1 + adds r1, r7 + adds r1, r0 + ldrh r2, [r1] + cmp r2, r3 + beq _0813D06C + movs r0, 0x10 + orrs r0, r2 + strh r0, [r1] +_0813D06C: + cmp r4, 0x1F + beq _0813D08E + cmp r6, 0 + beq _0813D08E + mov r0, r12 + ldr r1, [r0] + adds r0, r5, 0 + subs r0, 0x1F + lsls r0, 1 + adds r1, r7 + adds r1, r0 + ldrh r2, [r1] + cmp r2, r3 + beq _0813D08E + movs r0, 0x40 + orrs r0, r2 + strh r0, [r1] +_0813D08E: + cmp r4, 0 + beq _0813D0B0 + cmp r6, 0x13 + beq _0813D0B0 + mov r2, r12 + ldr r1, [r2] + adds r0, r5, 0 + adds r0, 0x1F + lsls r0, 1 + adds r1, r7 + adds r1, r0 + ldrh r2, [r1] + cmp r2, r3 + beq _0813D0B0 + movs r0, 0x20 + orrs r0, r2 + strh r0, [r1] +_0813D0B0: + cmp r4, 0x1F + beq _0813D0D2 + cmp r6, 0x13 + beq _0813D0D2 + mov r0, r12 + ldr r1, [r0] + adds r0, r5, 0 + adds r0, 0x21 + lsls r0, 1 + adds r1, r7 + adds r1, r0 + ldrh r2, [r1] + cmp r2, r3 + beq _0813D0D2 + movs r0, 0x80 + orrs r0, r2 + strh r0, [r1] +_0813D0D2: + mov r1, r8 + lsls r0, r1, 16 + lsrs r5, r0, 16 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1F + bhi _0813D0E4 + b _0813CFC6 +_0813D0E4: + mov r2, r9 + lsls r0, r2, 16 + lsrs r6, r0, 16 + cmp r6, 0x13 + bhi _0813D0F0 + b _0813CFC0 +_0813D0F0: + movs r4, 0 + ldr r6, =0x0203ab7c + movs r5, 0x8B + lsls r5, 1 + ldr r7, =0x0000ffff + mov r12, r7 + movs r0, 0xA0 + lsls r0, 8 + mov r9, r0 + ldr r7, =0x0000a010 + ldr r1, =0x0000ffcf + mov r8, r1 +_0813D108: + ldr r0, [r6] + lsls r3, r4, 1 + adds r0, r5 + adds r2, r0, r3 + ldrh r1, [r2] + adds r0, r1, 0 + cmp r0, r12 + bne _0813D130 + strh r7, [r2] + b _0813D198 + .pool +_0813D130: + cmp r0, 0 + beq _0813D198 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0813D142 + mov r0, r8 + ands r0, r1 + strh r0, [r2] +_0813D142: + ldr r0, [r6] + adds r0, r5 + adds r2, r0, r3 + ldrh r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0813D158 + ldr r0, =0x0000ff3f + ands r0, r1 + strh r0, [r2] +_0813D158: + ldr r0, [r6] + adds r0, r5 + adds r2, r0, r3 + ldrh r1, [r2] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0813D16E + ldr r0, =0x0000ffaf + ands r0, r1 + strh r0, [r2] +_0813D16E: + ldr r0, [r6] + adds r0, r5 + adds r2, r0, r3 + ldrh r1, [r2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0813D184 + ldr r0, =0x0000ff5f + ands r0, r1 + strh r0, [r2] +_0813D184: + ldr r1, [r6] + adds r1, r5 + adds r1, r3 + ldr r2, =gUnknown_085B3F18 + ldrh r0, [r1] + adds r0, r2 + ldrb r0, [r0] + mov r2, r9 + orrs r0, r2 + strh r0, [r1] +_0813D198: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x0000027f + cmp r4, r0 + bls _0813D108 + 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_813CF0C + + thumb_func_start sub_813D1C8 +sub_813D1C8: @ 813D1C8 + push {lr} + ldr r1, =0x0203ab7c + ldr r2, [r1] + movs r3, 0x89 + lsls r3, 1 + adds r0, r2, r3 + ldrh r0, [r0] + adds r3, r1, 0 + cmp r0, 0 + beq _0813D1FC + movs r1, 0x88 + lsls r1, 1 + adds r0, r2, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _0813D1FC + ldr r0, =0x0000061e + adds r1, r2, r0 + movs r0, 0x1 + strb r0, [r1] + b _0813D206 + .pool +_0813D1FC: + ldr r0, [r3] + ldr r1, =0x0000061e + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_0813D206: + ldr r1, [r3] + ldr r2, =0x00000616 + adds r0, r1, r2 + movs r2, 0 + strh r2, [r0] + movs r3, 0xC3 + lsls r3, 3 + adds r0, r1, r3 + strh r2, [r0] + adds r3, 0x2 + adds r0, r1, r3 + strh r2, [r0] + ldr r0, =0x0000061c + adds r2, r1, r0 + movs r0, 0x40 + strh r0, [r2] + ldr r2, =0x0000061f + adds r1, r2 + movs r0, 0x1 + strb r0, [r1] + ldr r1, =0x00003f44 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl SetGpuReg + bl sub_813D25C + pop {r0} + bx r0 + .pool + thumb_func_end sub_813D1C8 + + thumb_func_start sub_813D25C +sub_813D25C: @ 813D25C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x0203ab7c + ldr r2, [r0] + ldr r3, =0x0000061e + adds r1, r2, r3 + ldrb r1, [r1] + adds r7, r0, 0 + cmp r1, 0 + bne _0813D32A + ldr r0, =0x00000616 + adds r1, r2, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _0813D324 + movs r1, 0xC3 + lsls r1, 3 + adds r0, r2, r1 + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0813D2A4 + subs r3, 0x4 + adds r0, r2, r3 + b _0813D2A8 + .pool +_0813D2A4: + ldr r1, =0x0000061c + adds r0, r2, r1 +_0813D2A8: + ldrh r1, [r0] + adds r1, 0x4 + movs r2, 0x7F + ands r1, r2 + strh r1, [r0] + ldr r3, =gUnknown_08329F40 + ldr r1, [r7] + ldr r2, =0x0000061a + adds r0, r1, r2 + ldrh r0, [r0] + lsls r0, 1 + adds r0, r3 + ldrh r2, [r0] + lsls r2, 16 + asrs r2, 20 + lsls r2, 16 + ldr r0, =0x0000061c + adds r1, r0 + ldrh r0, [r1] + lsls r0, 1 + adds r0, r3 + ldrh r1, [r0] + lsls r1, 16 + asrs r1, 20 + lsls r1, 24 + orrs r1, r2 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + ldr r1, [r7] + ldr r2, =0x00000616 + adds r0, r1, r2 + movs r3, 0 + strh r3, [r0] + movs r0, 0xC3 + lsls r0, 3 + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, 0x40 + bne _0813D3C6 + strh r3, [r2] + movs r2, 0x89 + lsls r2, 1 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, 0 + beq _0813D3C6 + ldr r3, =0x0000061e + adds r1, r3 + movs r0, 0x1 + b _0813D3C4 + .pool +_0813D324: + subs r0, 0x1 + strh r0, [r1] + b _0813D3C6 +_0813D32A: + ldr r0, =0x00000616 + adds r1, r2, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xC + bls _0813D3C6 + movs r0, 0 + strh r0, [r1] + ldr r3, =0x0000061f + adds r1, r2, r3 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r4, 0 + ldr r0, [r7] + movs r6, 0x89 + lsls r6, 1 + adds r0, r6 + ldrh r0, [r0] + cmp r4, r0 + bcs _0813D3A0 + adds r5, r7, 0 + movs r0, 0x1 + mov r12, r0 + movs r1, 0x5 + negs r1, r1 + mov r8, r1 +_0813D366: + ldr r1, [r5] + lsls r2, r4, 2 + movs r3, 0xCC + lsls r3, 3 + adds r0, r1, r3 + adds r0, r2 + ldr r3, [r0] + ldr r0, =0x0000061f + adds r1, r0 + ldrb r0, [r1] + movs r1, 0x1 + adds r3, 0x3E + ands r1, r0 + mov r2, r12 + ands r1, r2 + lsls r1, 2 + ldrb r2, [r3] + mov r0, r8 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, [r5] + adds r0, r6 + ldrh r0, [r0] + cmp r4, r0 + bcc _0813D366 +_0813D3A0: + ldr r0, [r7] + ldr r3, =0x0000061f + adds r1, r0, r3 + ldrb r0, [r1] + cmp r0, 0x4 + bls _0813D3C6 + movs r0, 0x1 + strb r0, [r1] + ldr r1, [r7] + movs r2, 0x88 + lsls r2, 1 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, 0 + beq _0813D3C6 + subs r3, 0x1 + adds r1, r3 + movs r0, 0 +_0813D3C4: + strb r0, [r1] +_0813D3C6: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813D25C + + thumb_func_start sub_813D3D8 +sub_813D3D8: @ 813D3D8 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r5, =0x0203ab7c + ldr r0, =0x000015bc + bl AllocZeroed + str r0, [r5] + movs r1, 0 + movs r5, 0 + strh r4, [r0, 0xE] + movs r2, 0xDD + lsls r2, 3 + adds r0, r2 + str r6, [r0] + strb r1, [r6] + ldr r0, =sub_813D42C + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r5, [r1, 0x8] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813D3D8 + + thumb_func_start sub_813D42C +sub_813D42C: @ 813D42C + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + 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, 0xB + bls _0813D44A + b _0813D584 +_0813D44A: + lsls r0, 2 + ldr r1, =_0813D45C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0813D45C: + .4byte _0813D48C + .4byte _0813D4A8 + .4byte _0813D4D4 + .4byte _0813D4E6 + .4byte _0813D4EC + .4byte _0813D4F8 + .4byte _0813D520 + .4byte _0813D526 + .4byte _0813D52C + .4byte _0813D532 + .4byte _0813D544 + .4byte _0813D56C +_0813D48C: + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + movs r0, 0x3 + bl HideBg + movs r0, 0x2 + bl HideBg + movs r0, 0 + bl HideBg + b _0813D584 +_0813D4A8: + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x3 + bl SetBgAttribute + ldr r0, =gUnknown_085B4018 + bl sub_81C4D70 + ldr r0, =0x0203ab7c + ldr r0, [r0] + movs r1, 0xF7 + lsls r1, 4 + adds r0, r1 + movs r1, 0 + movs r2, 0x10 + bl RepeatChar + b _0813D584 + .pool +_0813D4D4: + bl sub_81C4E90 + cmp r0, 0x1 + beq _0813D594 + movs r0, 0x8 + negs r0, r0 + bl sub_81C4ED0 + b _0813D584 +_0813D4E6: + bl sub_813CA54 + b _0813D584 +_0813D4EC: + bl sub_813CA68 + lsls r0, 24 + cmp r0, 0 + bne _0813D594 + b _0813D584 +_0813D4F8: + ldr r0, =0x0203ab7c + ldr r0, [r0] + ldr r2, =0x000006ec + adds r0, r2 + bl sub_8122D88 + movs r0, 0x1 + movs r1, 0x1 + bl sub_8124288 + movs r1, 0x8 + negs r1, r1 + movs r0, 0 + bl sub_8123824 + b _0813D584 + .pool +_0813D520: + bl sub_813D6D0 + b _0813D584 +_0813D526: + bl sub_813D8A8 + b _0813D584 +_0813D52C: + bl sub_813D8E8 + b _0813D584 +_0813D532: + movs r0, 0x15 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + b _0813D584 +_0813D544: + ldr r1, =0x00003f41 + movs r0, 0x50 + bl SetGpuReg + bl sub_813D1C8 + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + movs r1, 0x80 + lsls r1, 5 + movs r0, 0 + bl SetGpuRegBits + b _0813D584 + .pool +_0813D56C: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r2 + ldr r1, =sub_813D5A0 + str r1, [r0] + movs r1, 0 + strh r1, [r0, 0x8] + b _0813D594 + .pool +_0813D584: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_0813D594: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813D42C + + thumb_func_start sub_813D5A0 +sub_813D5A0: @ 813D5A0 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_813D25C + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r6, r0, r1 + movs r0, 0x8 + ldrsh r1, [r6, r0] + cmp r1, 0x1 + beq _0813D5F8 + cmp r1, 0x1 + bgt _0813D5CC + cmp r1, 0 + beq _0813D5E2 + b _0813D5D4 + .pool +_0813D5CC: + cmp r1, 0x2 + beq _0813D640 + cmp r1, 0x3 + beq _0813D652 +_0813D5D4: + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r0, 0 + strh r0, [r1, 0x8] +_0813D5E2: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0813D6A8 + b _0813D698 + .pool +_0813D5F8: + ldr r0, =0x030022c0 + ldrh r2, [r0, 0x2E] + movs r3, 0x2 + adds r0, r3, 0 + ands r0, r2 + cmp r0, 0 + beq _0813D614 + strh r1, [r6, 0xA] + movs r0, 0x3 + bl audio_play + b _0813D698 + .pool +_0813D614: + movs r0, 0x10 + ands r0, r2 + cmp r0, 0 + bne _0813D630 + movs r0, 0x80 + lsls r0, 1 + ands r0, r2 + cmp r0, 0 + beq _0813D6A8 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x1 + bne _0813D6A8 +_0813D630: + strh r3, [r6, 0xA] + movs r0, 0x6D + bl audio_play + b _0813D698 + .pool +_0813D640: + movs r0, 0x15 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _0813D698 +_0813D652: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0 + bne _0813D6A8 + bl sub_813D824 + ldr r4, =0x0203ab7c + ldr r0, [r4] + movs r1, 0xDD + lsls r1, 3 + adds r0, r1 + ldr r1, [r0] + ldrh r0, [r6, 0xA] + strb r0, [r1] + bl sub_813D6B4 + adds r0, r5, 0 + bl DestroyTask + bl sub_81C4EB4 + ldr r0, [r4] + bl Free + str r7, [r4] + b _0813D6A8 + .pool +_0813D698: + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_0813D6A8: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813D5A0 + + thumb_func_start sub_813D6B4 +sub_813D6B4: @ 813D6B4 + push {lr} + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0 + bl SetBgAttribute + movs r0, 0x3 + movs r1, 0x4 + movs r2, 0 + bl SetBgAttribute + pop {r0} + bx r0 + thumb_func_end sub_813D6B4 + + thumb_func_start sub_813D6D0 +sub_813D6D0: @ 813D6D0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =gUnknown_085B401C + bl LoadObjectPic + ldr r0, =gUnknown_085B4024 + bl LoadTaggedObjectPalette + ldr r0, =0x03001204 + movs r1, 0 + strh r1, [r0] + ldr r2, =0x03001200 + strh r1, [r2] + ldr r1, =0x0203ab7c + ldr r0, [r1] + movs r3, 0x89 + lsls r3, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, 0 + beq _0813D7D8 + ldr r5, =0x03001202 + mov r10, r1 + adds r7, r2, 0 + ldr r0, =0x030011fc + mov r9, r0 + ldr r6, =gRegionMapEntries + ldr r1, =0x030011fe + mov r8, r1 +_0813D710: + mov r2, r10 + ldr r1, [r2] + movs r3, 0 + ldrsh r0, [r7, r3] + lsls r0, 1 + movs r2, 0xC4 + lsls r2, 3 + adds r1, r2 + adds r1, r0 + ldrh r0, [r1] + strh r0, [r5] + movs r3, 0 + ldrsh r0, [r5, r3] + lsls r0, 3 + adds r0, r6 + ldrb r1, [r0] + adds r1, 0x1 + lsls r1, 3 + adds r1, 0x4 + mov r0, r9 + strh r1, [r0] + movs r2, 0 + ldrsh r0, [r5, r2] + lsls r0, 3 + adds r0, r6 + ldrb r2, [r0, 0x1] + lsls r2, 3 + adds r2, 0x1C + mov r3, r8 + strh r2, [r3] + movs r3, 0 + ldrsh r0, [r5, r3] + lsls r0, 3 + adds r0, r6 + ldrb r0, [r0, 0x2] + subs r0, 0x1 + lsls r0, 2 + adds r1, r0 + mov r0, r9 + strh r1, [r0] + movs r1, 0 + ldrsh r0, [r5, r1] + lsls r0, 3 + adds r0, r6 + ldrb r0, [r0, 0x3] + subs r0, 0x1 + lsls r0, 2 + adds r2, r0 + mov r3, r8 + strh r2, [r3] + mov r0, r9 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0 + ldrsh r2, [r3, r0] + ldr r0, =gUnknown_085B4034 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _0813D7BE + ldr r0, =0x02020630 + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r3] + mov r1, r10 + ldr r3, [r1] + ldr r4, =0x03001204 + ldrh r1, [r4] + adds r0, r1, 0x1 + strh r0, [r4] + lsls r1, 16 + asrs r1, 14 + movs r0, 0xCC + lsls r0, 3 + adds r3, r0 + adds r3, r1 + str r2, [r3] +_0813D7BE: + ldrh r0, [r7] + adds r0, 0x1 + strh r0, [r7] + movs r2, 0 + ldrsh r1, [r7, r2] + mov r3, r10 + ldr r0, [r3] + movs r2, 0x89 + lsls r2, 1 + adds r0, r2 + ldrh r0, [r0] + cmp r1, r0 + blt _0813D710 +_0813D7D8: + ldr r0, =0x0203ab7c + ldr r0, [r0] + ldr r1, =0x03001204 + ldrh r1, [r1] + movs r3, 0xDC + lsls r3, 3 + adds r0, r3 + strh 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_813D6D0 + + thumb_func_start sub_813D824 +sub_813D824: @ 813D824 + push {r4,r5,lr} + movs r0, 0x2 + bl FreeObjectTilesByTag + movs r0, 0x2 + bl FreeObjectPaletteByTag + movs r4, 0 + ldr r1, =0x0203ab7c + ldr r0, [r1] + movs r2, 0xDC + lsls r2, 3 + adds r0, r2 + ldrh r0, [r0] + cmp r4, r0 + bcs _0813D86C + adds r5, r1, 0 +_0813D846: + ldr r0, [r5] + lsls r1, r4, 2 + movs r2, 0xCC + lsls r2, 3 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + bl RemoveObjectAndFreeTiles + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, [r5] + movs r1, 0xDC + lsls r1, 3 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + bcc _0813D846 +_0813D86C: + movs r0, 0x3 + bl FreeObjectTilesByTag + movs r0, 0x3 + bl FreeObjectPaletteByTag + movs r4, 0 +_0813D87A: + ldr r0, =0x0203ab7c + ldr r0, [r0] + lsls r1, r4, 2 + movs r2, 0xFB + lsls r2, 4 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _0813D892 + bl RemoveObjectAndFreeTiles +_0813D892: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x2 + bls _0813D87A + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813D824 + + thumb_func_start sub_813D8A8 +sub_813D8A8: @ 813D8A8 + push {lr} + sub sp, 0x8 + ldr r0, =0x0203ab7c + ldr r1, [r0] + ldr r0, =0x00000fbc + adds r1, r0 + str r1, [sp] + ldr r0, =0x00030600 + str r0, [sp, 0x4] + ldr r0, =gUnknown_08DC4140 + bl LZ77UnCompWram + mov r0, sp + bl LoadObjectPic + ldr r0, =gUnknown_085B40EC + bl LoadTaggedObjectPalette + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_813D8A8 + + thumb_func_start sub_813D8E8 +sub_813D8E8: @ 813D8E8 + push {r4-r6,lr} + ldr r1, =0x0203ab7c + ldr r0, [r1] + movs r2, 0x88 + lsls r2, 1 + adds r0, r2 + ldr r0, [r0] + cmp r0, 0 + beq _0813D920 + movs r4, 0 + adds r5, r1, 0 + movs r3, 0xFB + lsls r3, 4 + movs r2, 0 +_0813D904: + ldr r0, [r5] + lsls r1, r4, 2 + adds r0, r3 + adds r0, r1 + str r2, [r0] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x2 + bls _0813D904 + b _0813D9A4 + .pool +_0813D920: + movs r4, 0 + ldr r5, =0x02020630 +_0813D924: + lsls r1, r4, 21 + movs r6, 0xA0 + lsls r6, 16 + adds r1, r6 + asrs r1, 16 + ldr r0, =gUnknown_085B40FC + movs r2, 0x8C + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _0813D988 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r3, r5 + ldrh r2, [r3, 0x4] + lsls r0, r2, 22 + lsrs r0, 22 + lsls r1, r4, 4 + adds r0, r1 + ldr r6, =0x000003ff + adds r1, r6, 0 + ands r0, r1 + ldr r6, =0xfffffc00 + adds r1, r6, 0 + ands r2, r1 + orrs r2, r0 + strh r2, [r3, 0x4] + ldr r0, =0x0203ab7c + ldr r0, [r0] + lsls r1, r4, 2 + movs r2, 0xFB + lsls r2, 4 + adds r0, r2 + adds r0, r1 + str r3, [r0] + b _0813D99A + .pool +_0813D988: + ldr r0, =0x0203ab7c + ldr r1, [r0] + lsls r0, r4, 2 + movs r6, 0xFB + lsls r6, 4 + adds r1, r6 + adds r1, r0 + movs r0, 0 + str r0, [r1] +_0813D99A: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x2 + bls _0813D924 +_0813D9A4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813D8E8 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/pokedex_cry_screen.s b/asm/pokedex_cry_screen.s new file mode 100644 index 000000000..b06e23fc1 --- /dev/null +++ b/asm/pokedex_cry_screen.s @@ -0,0 +1,1010 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8145354 +sub_8145354: @ 8145354 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + movs r0, 0 + mov r8, r0 + ldr r0, =0x030061ec + ldrb r0, [r0] + cmp r0, 0x1 + beq _081453F8 + cmp r0, 0x1 + bgt _0814537C + cmp r0, 0 + beq _08145382 + b _0814544A + .pool +_0814537C: + cmp r0, 0x2 + beq _08145434 + b _0814544A +_08145382: + ldr r5, =0x0203ab90 + ldr r0, [r5] + cmp r0, 0 + bne _0814539E + movs r0, 0x1C + bl AllocZeroed + str r0, [r5] + ldr r4, =0x0203ab94 + adds r0, r7, 0 + movs r1, 0x7 + bl GetWindowAttribute + str r0, [r4] +_0814539E: + ldr r1, [r5] + ldrh r0, [r6] + movs r2, 0 + strh r0, [r1, 0x14] + ldrb r0, [r6, 0x5] + strb r0, [r1, 0x16] + ldr r0, [r5] + strb r2, [r0, 0x1A] + ldr r0, [r5] + strb r2, [r0, 0x1B] + ldr r0, [r5] + strb r2, [r0, 0x10] + ldr r1, [r5] + movs r0, 0x1C + strb r0, [r1, 0x12] + ldr r0, [r5] + strb r2, [r0, 0x11] + ldrb r1, [r6, 0x4] + lsls r1, 19 + negs r1, r1 + asrs r1, 16 + adds r0, r7, 0 + movs r2, 0x1 + bl sub_8145824 + movs r4, 0 +_081453D2: + adds r0, r7, 0 + ldr r1, =gUnknown_085B8C10 + movs r2, 0x20 + adds r3, r4, 0 + bl CopyToWindowPixelBuffer + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xDF + bls _081453D2 + b _08145420 + .pool +_081453F8: + movs r4, 0 + ldr r1, =0x0203ab90 + ldr r0, [r1] + ldrb r0, [r0, 0x16] + lsls r0, 3 + cmp r8, r0 + bge _08145420 + adds r5, r1, 0 +_08145408: + adds r0, r4, 0 + movs r1, 0 + bl sub_81456A8 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, [r5] + ldrb r0, [r0, 0x16] + lsls r0, 3 + cmp r4, r0 + blt _08145408 +_08145420: + ldr r1, =0x030061ec + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0814544A + .pool +_08145434: + adds r0, r7, 0 + bl sub_8145814 + ldr r0, =gUnknown_085B8BF0 + ldrb r1, [r6, 0x3] + lsls r1, 4 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0x1 + mov r8, r0 +_0814544A: + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8145354 + + thumb_func_start sub_814545C +sub_814545C: @ 814545C + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_8145814 + adds r0, r4, 0 + bl sub_8145648 + ldr r2, =0x0203ab90 + ldr r1, [r2] + ldrb r0, [r1, 0x1B] + cmp r0, 0 + beq _0814547E + subs r0, 0x1 + strb r0, [r1, 0x1B] +_0814547E: + ldr r1, [r2] + ldrb r0, [r1, 0x1A] + cmp r0, 0 + beq _081454A4 + subs r0, 0x1 + strb r0, [r1, 0x1A] + ldr r1, [r2] + ldrb r0, [r1, 0x1A] + cmp r0, 0 + bne _081454A4 + ldrh r0, [r1, 0x18] + bl sub_8145588 + bl sub_814560C + b _0814552A + .pool +_081454A4: + ldr r5, =0x0203ab90 + ldr r0, [r5] + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _081454B8 + bl sub_814560C + b _0814552A + .pool +_081454B8: + cmp r0, 0x1 + bne _081454C2 + bl sub_81455A8 + b _081454E6 +_081454C2: + cmp r0, 0x8 + bls _081454E6 + bl sub_80A36EC + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081454DC + bl sub_814560C + ldr r0, [r5] + strb r4, [r0, 0x10] + b _0814552A +_081454DC: + bl sub_81455A8 + ldr r1, [r5] + movs r0, 0x1 + strb r0, [r1, 0x10] +_081454E6: + ldr r5, =0x0203ab90 + ldr r1, [r5] + ldrb r4, [r1, 0x10] + subs r4, 0x1 + lsls r4, 25 + lsrs r4, 24 + ldrb r0, [r1, 0x16] + lsls r0, 3 + ldrb r2, [r1, 0x11] + adds r0, r2 + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + adds r1, r4 + ldrb r1, [r1] + bl sub_81456A8 + ldr r1, [r5] + ldrb r0, [r1, 0x16] + lsls r0, 3 + ldrb r2, [r1, 0x11] + adds r0, r2 + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + adds r4, 0x1 + adds r1, r4 + ldrb r1, [r1] + bl sub_81456A8 + ldr r1, [r5] + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] +_0814552A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814545C + + thumb_func_start sub_8145534 +sub_8145534: @ 8145534 + push {r4-r6,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + ldr r0, =0x03007420 + ldr r0, [r0, 0x4] + cmp r0, 0 + bge _08145582 + ldr r6, =0x0203ab90 + ldr r1, [r6] + ldrb r0, [r1, 0x1A] + cmp r0, 0 + bne _08145582 + ldrb r0, [r1, 0x1B] + cmp r0, 0 + bne _08145582 + movs r0, 0x4 + strb r0, [r1, 0x1B] + bl sub_80A36EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0814557C + bl sub_80A36B4 + ldr r1, [r6] + strh r4, [r1, 0x18] + movs r0, 0x2 + strb r0, [r1, 0x1A] + b _08145582 + .pool +_0814557C: + adds r0, r5, 0 + bl sub_8145588 +_08145582: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8145534 + + thumb_func_start sub_8145588 +sub_8145588: @ 8145588 + push {lr} + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + movs r2, 0x7D + movs r3, 0xA + bl sub_80A32C0 + ldr r0, =0x0203ab90 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x10] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8145588 + + thumb_func_start sub_81455A8 +sub_81455A8: @ 81455A8 + push {r4,lr} + ldr r3, =0x03002f50 + movs r0, 0 + ldrsb r0, [r3, r0] + cmp r0, 0x1 + bgt _081455C0 + ldr r0, =0x030066d0 + b _081455D8 + .pool +_081455C0: + ldr r2, =0x03006380 + ldrb r1, [r2, 0xB] + movs r0, 0 + ldrsb r0, [r3, r0] + subs r0, 0x1 + subs r1, r0 + ldr r0, [r2, 0x10] + muls r0, r1 + movs r1, 0xD4 + lsls r1, 2 + adds r2, r1 + adds r0, r2 +_081455D8: + movs r1, 0xC6 + lsls r1, 3 + adds r3, r0, r1 + movs r2, 0 + ldr r4, =0x0203ab90 +_081455E2: + ldr r1, [r4] + adds r1, r2 + lsls r0, r2, 1 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 1 + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _081455E2 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81455A8 + + thumb_func_start sub_814560C +sub_814560C: @ 814560C + push {r4,lr} + ldr r4, =0x0203ab90 + ldr r1, [r4] + ldrb r0, [r1, 0x16] + lsls r0, 3 + ldrb r1, [r1, 0x11] + adds r0, r1 + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_81456A8 + ldr r1, [r4] + ldrb r0, [r1, 0x16] + lsls r0, 3 + ldrb r1, [r1, 0x11] + adds r0, r1 + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_81456A8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814560C + + thumb_func_start sub_8145648 +sub_8145648: @ 8145648 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r4, =0x0203ab90 + ldr r0, [r4] + ldrb r1, [r0, 0x11] + adds r0, r6, 0 + movs r2, 0 + bl sub_8145824 + ldr r1, [r4] + ldrb r0, [r1, 0x11] + adds r0, 0x2 + strb r0, [r1, 0x11] + ldr r1, [r4] + ldrb r0, [r1, 0x11] + lsrs r0, 3 + ldrb r1, [r1, 0x16] + adds r1, r0, r1 + adds r2, r1, 0x1 + adds r0, r2, 0 + asrs r0, 5 + lsls r0, 5 + subs r0, r2, r0 + lsls r0, 16 + lsrs r5, r0, 16 + movs r4, 0 +_0814567E: + lsls r3, r4, 5 + adds r3, r5, r3 + lsls r3, 16 + lsrs r3, 16 + adds r0, r6, 0 + ldr r1, =gUnknown_085B8C10 + movs r2, 0x20 + bl CopyToWindowPixelBuffer + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _0814567E + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8145648 + + thumb_func_start sub_81456A8 +sub_81456A8: @ 81456A8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r7, r0, 24 + lsrs r4, r7, 24 + lsls r1, 24 + movs r0, 0xFE + lsls r0, 23 + adds r1, r0 + lsrs r1, 16 + adds r0, r1, 0 + bl __floatsidf + ldr r3, _08145768 + ldr r2, _08145764 + bl __divdf3 + bl __fixunsdfsi + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x37 + bls _081456DE + movs r5, 0x37 +_081456DE: + str r5, [sp] + movs r6, 0x1 + ands r6, r4 + ldr r0, _0814576C + ldr r1, [r0] + lsrs r7, 27 + mov r8, r7 + ldr r0, _08145770 + ldrb r1, [r1, 0x12] + cmp r5, r1 + bls _08145780 + ldr r3, _08145774 + adds r0, r6, r0 + ldrb r0, [r0] + mov r9, r0 + movs r7, 0x7 + ands r7, r4 +_08145700: + lsls r1, r5, 1 + lsls r0, r7, 3 + adds r0, r7 + lsls r0, 4 + adds r1, r0 + ldr r2, _08145778 + adds r1, r2 + mov r4, r8 + lsls r0, r4, 5 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, [r3] + adds r1, r2 + ldrb r0, [r1] + mov r4, r9 + ands r0, r4 + strb r0, [r1] + ldr r4, [r3] + adds r4, r2 + adds r0, r5, 0 + movs r1, 0x3 + str r3, [sp, 0x4] + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + movs r1, 0xF + ands r0, r1 + lsls r1, r6, 4 + adds r0, r1 + ldr r1, _0814577C + adds r0, r1 + ldrb r1, [r4] + ldrb r0, [r0] + orrs r1, r0 + strb r1, [r4] + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, _0814576C + ldr r0, [r2] + ldr r3, [sp, 0x4] + ldrb r0, [r0, 0x12] + cmp r5, r0 + bhi _08145700 + b _081457EA + .align 2, 0 +_08145764: .4byte 0x40920000 +_08145768: .4byte 0x00000000 +_0814576C: .4byte 0x0203ab90 +_08145770: .4byte gUnknown_085B8C30 +_08145774: .4byte 0x0203ab94 +_08145778: .4byte gUnknown_085B8770 +_0814577C: .4byte gUnknown_085B8C32 +_08145780: + lsls r3, r6, 4 + mov r10, r3 + ldr r7, _08145804 + adds r0, r6, r0 + ldrb r0, [r0] + mov r9, r0 + movs r6, 0x7 + ands r6, r4 +_08145790: + lsls r1, r5, 1 + lsls r0, r6, 3 + adds r0, r6 + lsls r0, 4 + adds r1, r0 + ldr r4, _08145808 + adds r1, r4 + mov r2, r8 + lsls r0, r2, 5 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, [r7] + adds r1, r2 + ldrb r0, [r1] + mov r3, r9 + ands r0, r3 + strb r0, [r1] + ldr r4, [r7] + adds r4, r2 + adds r0, r5, 0 + movs r1, 0x3 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + movs r1, 0xF + ands r0, r1 + add r0, r10 + ldr r1, _0814580C + adds r0, r1 + ldrb r1, [r4] + ldrb r0, [r0] + orrs r1, r0 + strb r1, [r4] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, _08145810 + ldr r0, [r2] + ldrb r0, [r0, 0x12] + cmp r5, r0 + bcc _08145790 +_081457EA: + ldr r3, _08145810 + ldr r0, [r3] + mov r4, sp + ldrb r4, [r4] + strb r4, [r0, 0x12] + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08145804: .4byte 0x0203ab94 +_08145808: .4byte gUnknown_085B8770 +_0814580C: .4byte gUnknown_085B8C32 +_08145810: .4byte 0x0203ab90 + thumb_func_end sub_81456A8 + + thumb_func_start sub_8145814 +sub_8145814: @ 8145814 + push {lr} + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl CopyWindowToVram + pop {r0} + bx r0 + thumb_func_end sub_8145814 + + thumb_func_start sub_8145824 +sub_8145824: @ 8145824 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 24 + cmp r2, 0 + bne _08145848 + movs r1, 0 + bl GetWindowAttribute + lsls r0, 24 + lsrs r0, 24 + lsls r1, r4, 16 + asrs r1, 8 + movs r2, 0 + bl ChangeBgX +_08145848: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8145824 + + thumb_func_start sub_8145850 +sub_8145850: @ 8145850 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + movs r0, 0 + mov r8, r0 + ldr r6, =0x030061ec + ldrb r0, [r6] + cmp r0, 0 + beq _08145874 + cmp r0, 0x1 + beq _081458B0 + b _081458F8 + .pool +_08145874: + ldr r5, =0x0203ab98 + ldr r0, [r5] + cmp r0, 0 + bne _08145884 + movs r0, 0x8 + bl AllocZeroed + str r0, [r5] +_08145884: + ldr r1, =gUnknown_085B8438 + adds r0, r7, 0 + movs r2, 0 + movs r3, 0 + bl CopyToWindowPixelBuffer + ldr r0, =gUnknown_085B8418 + ldrb r1, [r4, 0x3] + lsls r1, 4 + movs r2, 0x20 + bl gpu_pal_apply + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + b _081458F8 + .pool +_081458B0: + ldr r0, =gUnknown_085B8C80 + bl LoadObjectPics + ldr r0, =gUnknown_085B8C90 + bl LoadTaggedObjectPalettes + ldr r0, =gUnknown_085B8C68 + ldrb r1, [r4, 0x4] + lsls r1, 19 + movs r2, 0xA0 + lsls r2, 14 + adds r1, r2 + asrs r1, 16 + ldrb r2, [r4, 0x5] + lsls r2, 19 + movs r3, 0xE0 + lsls r3, 14 + adds r2, r3 + asrs r2, 16 + movs r3, 0x1 + bl AddObjectToFront + ldr r2, =0x0203ab98 + ldr r3, [r2] + lsls r0, 24 + lsrs r0, 24 + movs r4, 0 + strh r0, [r3, 0x4] + movs r1, 0x20 + strb r1, [r3] + ldr r0, [r2] + strb r1, [r0, 0x1] + ldr r0, [r2] + strb r4, [r0, 0x2] + movs r0, 0x1 + mov r8, r0 +_081458F8: + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8145850 + + thumb_func_start sub_8145914 +sub_8145914: @ 8145914 + push {r4-r6,lr} + ldr r4, =0x02020630 + ldr r6, =0x0203ab98 + ldr r0, [r6] + ldrh r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + bl GetObjectPaletteTagBySlot + lsls r0, 16 + lsrs r0, 16 + bl FreeObjectPaletteByTag + ldr r0, [r6] + ldrh r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r4, =0x0203ab90 + ldr r0, [r4] + bl Free + movs r5, 0 + str r5, [r4] + ldr r0, [r6] + bl Free + str r5, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8145914 + + thumb_func_start sub_814596C +sub_814596C: @ 814596C + push {r4-r7,lr} + sub sp, 0x14 + adds r7, r0, 0 + ldr r3, =0x02020630 + ldr r4, =0x0203ab98 + ldr r0, [r4] + ldrh r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r2, [r0, 0x1] + movs r1, 0x4 + negs r1, r1 + ands r1, r2 + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0, 0x1] + ldr r2, [r4] + ldrh r1, [r2, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x6] + ldr r0, =0x0203ab90 + ldr r0, [r0] + ldrb r1, [r0, 0x10] + cmp r1, 0x2 + beq _081459E8 + cmp r1, 0x2 + bgt _081459C0 + cmp r1, 0 + beq _081459C6 + b _08145A2E + .pool +_081459C0: + cmp r1, 0x6 + beq _08145A20 + b _08145A2E +_081459C6: + movs r0, 0x20 + strb r0, [r2, 0x1] + ldr r1, [r4] + movs r0, 0 + ldrsb r0, [r1, r0] + cmp r0, 0 + ble _081459E2 + ldrb r0, [r1, 0x2] + add r4, sp, 0xC + cmp r0, 0x1 + beq _08145A30 + subs r0, 0x1 + strb r0, [r1, 0x2] + b _08145A30 +_081459E2: + movs r0, 0x5 + strb r0, [r1, 0x2] + b _08145A2E +_081459E8: + movs r3, 0 + movs r2, 0 + add r4, sp, 0xC + adds r5, r0, 0 +_081459F0: + lsls r1, r3, 24 + asrs r1, 24 + adds r0, r5, r2 + ldrb r0, [r0] + cmp r1, r0 + bge _081459FE + adds r3, r0, 0 +_081459FE: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0xF + bls _081459F0 + lsls r0, r3, 24 + asrs r0, 24 + movs r1, 0xD0 + muls r0, r1 + cmp r0, 0 + bge _08145A16 + adds r0, 0xFF +_08145A16: + lsls r0, 16 + asrs r0, 24 + bl sub_8145B24 + b _08145A30 +_08145A20: + ldrb r1, [r0, 0xA] + movs r0, 0xD0 + muls r0, r1 + lsls r0, 16 + asrs r0, 24 + bl sub_8145B24 +_08145A2E: + add r4, sp, 0xC +_08145A30: + ldr r0, =0x0203ab98 + ldr r2, [r0] + ldrb r5, [r2] + movs r1, 0 + ldrsb r1, [r2, r1] + movs r3, 0x1 + ldrsb r3, [r2, r3] + adds r6, r0, 0 + cmp r1, r3 + beq _08145A82 + cmp r1, r3 + bge _08145A64 + ldrb r0, [r2, 0x2] + adds r0, r5, r0 + strb r0, [r2] + ldr r2, [r6] + movs r1, 0 + ldrsb r1, [r2, r1] + ldrb r3, [r2, 0x1] + movs r0, 0x1 + ldrsb r0, [r2, r0] + cmp r1, r0 + ble _08145A82 + b _08145A7A + .pool +_08145A64: + ldrb r0, [r2, 0x2] + subs r0, r5, r0 + strb r0, [r2] + ldr r2, [r6] + movs r1, 0 + ldrsb r1, [r2, r1] + ldrb r3, [r2, 0x1] + movs r0, 0x1 + ldrsb r0, [r2, r0] + cmp r1, r0 + bge _08145A82 +_08145A7A: + strb r3, [r2] + ldr r1, [r6] + movs r0, 0 + strb r0, [r1, 0x1] +_08145A82: + ldr r2, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r2 + movs r1, 0x80 + lsls r1, 1 + orrs r0, r1 + ldr r1, =0x0000ffff + ands r0, r1 + movs r1, 0x80 + lsls r1, 17 + orrs r0, r1 + str r0, [sp, 0x4] + ldr r0, [r6] + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r1, 24 + lsrs r1, 16 + ldr r0, [sp, 0x8] + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x8] + add r0, sp, 0x4 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x2 + bl ObjAffineSet + add r0, sp, 0xC + ldrh r1, [r0] + ldrh r2, [r4, 0x2] + ldrh r3, [r4, 0x4] + ldrh r0, [r4, 0x6] + str r0, [sp] + movs r0, 0 + bl SetSpriteTransformationMatrix + ldr r2, =gUnknown_08329F40 + ldr r0, [r6] + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + adds r0, 0x7F + movs r1, 0xFF + ands r0, r1 + lsls r1, r0, 1 + adds r1, r2 + adds r0, 0x40 + lsls r0, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0 + ldrsh r1, [r1, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + cmp r0, 0 + bge _08145AF6 + adds r0, 0xFF +_08145AF6: + asrs r0, 8 + strh r0, [r7, 0x24] + lsls r1, r2, 16 + asrs r1, 16 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + cmp r0, 0 + bge _08145B0A + adds r0, 0xFF +_08145B0A: + asrs r0, 8 + strh r0, [r7, 0x26] + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814596C + + thumb_func_start sub_8145B24 +sub_8145B24: @ 8145B24 + push {lr} + lsls r0, 24 + asrs r0, 24 + movs r1, 0x20 + subs r2, r1, r0 + movs r0, 0xFF + ands r2, r0 + adds r0, r2, 0 + subs r0, 0x21 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xBE + bhi _08145B40 + movs r2, 0xE0 +_08145B40: + ldr r1, =0x0203ab98 + ldr r0, [r1] + strb r2, [r0, 0x1] + ldr r1, [r1] + movs r0, 0x5 + strb r0, [r1, 0x2] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8145B24 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/pokemon_1.s b/asm/pokemon_1.s new file mode 100644 index 000000000..26235dc74 --- /dev/null +++ b/asm/pokemon_1.s @@ -0,0 +1,3306 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start zero_pokemon_boxed_data +@ void zero_pokemon_boxed_data(pokemon *mon) +zero_pokemon_boxed_data: @ 8067A74 + push {lr} + adds r2, r0, 0 + movs r1, 0 + movs r3, 0 +_08067A7C: + adds r0, r2, r1 + strb r3, [r0] + adds r1, 0x1 + cmp r1, 0x4F + bls _08067A7C + pop {r0} + bx r0 + thumb_func_end zero_pokemon_boxed_data + + thumb_func_start zero_pokemon_struct +@ void zero_pokemon_struct(pokemon *mon) +zero_pokemon_struct: @ 8067A8C + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + bl zero_pokemon_boxed_data + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x37 + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x38 + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x39 + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3A + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3B + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3C + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3D + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3E + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3F + mov r2, sp + bl pokemon_setattr + movs r0, 0xFF + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x40 + mov r2, sp + bl pokemon_setattr + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end zero_pokemon_struct + + thumb_func_start zero_player_party_data +@ void zero_player_party_data() +zero_player_party_data: @ 8067B0C + push {r4,r5,lr} + ldr r4, =0x020244ec + movs r0, 0xFA + lsls r0, 1 + adds r5, r4, r0 +_08067B16: + adds r0, r4, 0 + bl zero_pokemon_struct + adds r4, 0x64 + cmp r4, r5 + ble _08067B16 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end zero_player_party_data + + thumb_func_start zero_enemy_party_data +zero_enemy_party_data: @ 8067B2C + push {r4,r5,lr} + ldr r4, =0x02024744 + movs r0, 0xFA + lsls r0, 1 + adds r5, r4, r0 +_08067B36: + adds r0, r4, 0 + bl zero_pokemon_struct + adds r4, 0x64 + cmp r4, r5 + ble _08067B36 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end zero_enemy_party_data + + thumb_func_start create_pokemon_set_level +@ void create_pokemon_set_level(pokemon *mon, s16 species_num, u8 level, u8 forced_iv, char pokemon_id_is_nonrandom, int pokemon_id, u8 trainer_id_mode, int trainer_id) +create_pokemon_set_level: @ 8067B4C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x1C + mov r8, r0 + adds r6, r1, 0 + ldr r4, [sp, 0x34] + ldr r7, [sp, 0x38] + ldr r5, [sp, 0x3C] + lsls r6, 16 + lsrs r6, 16 + add r0, sp, 0x10 + strb r2, [r0] + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + mov r0, r8 + str r3, [sp, 0x18] + bl zero_pokemon_struct + str r4, [sp] + str r7, [sp, 0x4] + str r5, [sp, 0x8] + ldr r0, [sp, 0x40] + str r0, [sp, 0xC] + mov r0, r8 + adds r1, r6, 0 + add r2, sp, 0x10 + ldrb r2, [r2] + ldr r3, [sp, 0x18] + bl create_pokemon + mov r0, r8 + movs r1, 0x38 + add r2, sp, 0x10 + bl pokemon_setattr + movs r0, 0xFF + str r0, [sp, 0x14] + add r2, sp, 0x14 + mov r0, r8 + movs r1, 0x40 + bl pokemon_setattr + mov r0, r8 + bl pokemon_calc_effective_stats + add sp, 0x1C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end create_pokemon_set_level + + thumb_func_start create_pokemon +@ void create_pokemon(pokemon *mon, s16 species_num, u8 level, u8 forced_iv, char pokemon_id_is_nonrandom, int pokemon_id, u8 trainer_id_mode, int trainer_id) +create_pokemon: @ 8067BBC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + adds r7, r0, 0 + ldr r4, [sp, 0x40] + ldr r0, [sp, 0x48] + movs r5, 0xE + add r5, sp + strh r1, [r5] + add r6, sp, 0x10 + strb r2, [r6] + mov r5, sp + adds r5, 0x11 + strb r3, [r5] + lsls r4, 24 + lsrs r4, 24 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + adds r0, r7, 0 + bl zero_pokemon_boxed_data + cmp r4, 0 + beq _08067BF8 + ldr r0, [sp, 0x44] + str r0, [sp, 0x14] + b _08067C0C +_08067BF8: + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + str r4, [sp, 0x14] +_08067C0C: + add r2, sp, 0x14 + adds r0, r7, 0 + movs r1, 0 + bl pokemon_setattr_encrypted + add r0, sp, 0x18 + mov r9, r0 + add r5, sp, 0xC + mov r1, r10 + cmp r1, 0x2 + bne _08067C64 + ldr r2, =0xffff0000 + mov r8, r2 + ldr r6, =0x0000ffff +_08067C28: + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + str r4, [sp, 0x18] + adds r1, r4, 0 + mov r3, r8 + ands r1, r3 + lsrs r1, 16 + ands r4, r6 + eors r1, r4 + ldr r2, [sp, 0x14] + adds r0, r2, 0 + ands r0, r3 + lsrs r0, 16 + eors r1, r0 + ands r2, r6 + eors r1, r2 + cmp r1, 0x7 + bls _08067C28 + b _08067C8A + .pool +_08067C64: + mov r0, r10 + cmp r0, 0x1 + bne _08067C70 + ldr r0, [sp, 0x4C] + str r0, [sp, 0x18] + b _08067C8A +_08067C70: + ldr r0, =0x03005d90 + ldr r2, [r0] + ldrb r1, [r2, 0xA] + ldrb r0, [r2, 0xB] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0xC] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0xD] + lsls r0, 24 + orrs r1, r0 + str r1, [sp, 0x18] +_08067C8A: + adds r0, r7, 0 + movs r1, 0x1 + mov r2, r9 + bl pokemon_setattr_encrypted + adds r0, r7, 0 + bl pokemon_calc_checksum + strh r0, [r5] + adds r0, r7, 0 + movs r1, 0x9 + adds r2, r5, 0 + bl pokemon_setattr_encrypted + adds r0, r7, 0 + bl pokemon_encrypt + mov r0, sp + ldrh r1, [r0, 0xE] + bl GetSpeciesName + adds r0, r7, 0 + movs r1, 0x2 + mov r2, sp + bl pokemon_setattr_encrypted + ldr r2, =gUnknown_82E9531 + adds r0, r7, 0 + movs r1, 0x3 + bl pokemon_setattr_encrypted + ldr r5, =0x03005d90 + ldr r2, [r5] + adds r0, r7, 0 + movs r1, 0x7 + bl pokemon_setattr_encrypted + adds r0, r7, 0 + movs r1, 0xB + mov r2, sp + adds r2, 0xE + bl pokemon_setattr_encrypted + ldr r4, =gBaseStats + mov r2, sp + ldrh r1, [r2, 0xE] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x13] + movs r0, 0xCA + lsls r0, 1 + adds r2, r1, 0 + muls r2, r0 + mov r3, sp + ldrb r0, [r3, 0x10] + lsls r0, 2 + ldr r1, =gExperienceTables + adds r0, r1 + adds r2, r0 + adds r0, r7, 0 + movs r1, 0x19 + bl pokemon_setattr_encrypted + mov r1, sp + ldrh r0, [r1, 0xE] + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 2 + adds r4, 0x12 + adds r2, r4 + adds r0, r7, 0 + movs r1, 0x20 + bl pokemon_setattr_encrypted + bl sav1_map_get_name + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x18] + adds r0, r7, 0 + movs r1, 0x23 + mov r2, r9 + bl pokemon_setattr_encrypted + adds r0, r7, 0 + movs r1, 0x24 + add r2, sp, 0x10 + bl pokemon_setattr_encrypted + ldr r2, =gUnknown_82E9530 + adds r0, r7, 0 + movs r1, 0x25 + bl pokemon_setattr_encrypted + movs r0, 0x4 + str r0, [sp, 0x18] + adds r0, r7, 0 + movs r1, 0x26 + mov r2, r9 + bl pokemon_setattr_encrypted + ldr r2, [r5] + adds r2, 0x8 + adds r0, r7, 0 + movs r1, 0x31 + bl pokemon_setattr_encrypted + mov r2, sp + ldrb r0, [r2, 0x11] + cmp r0, 0x1F + bhi _08067DC8 + adds r0, r7, 0 + movs r1, 0x27 + adds r2, 0x11 + bl pokemon_setattr_encrypted + adds r0, r7, 0 + movs r1, 0x28 + mov r2, sp + adds r2, 0x11 + bl pokemon_setattr_encrypted + adds r0, r7, 0 + movs r1, 0x29 + mov r2, sp + adds r2, 0x11 + bl pokemon_setattr_encrypted + adds r0, r7, 0 + movs r1, 0x2A + mov r2, sp + adds r2, 0x11 + bl pokemon_setattr_encrypted + adds r0, r7, 0 + movs r1, 0x2B + mov r2, sp + adds r2, 0x11 + bl pokemon_setattr_encrypted + adds r0, r7, 0 + movs r1, 0x2C + mov r2, sp + adds r2, 0x11 + bl pokemon_setattr_encrypted + b _08067E50 + .pool +_08067DC8: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x18] + movs r3, 0x1F + mov r8, r3 + ands r0, r3 + str r0, [sp, 0x1C] + add r4, sp, 0x1C + adds r0, r7, 0 + movs r1, 0x27 + adds r2, r4, 0 + bl pokemon_setattr_encrypted + ldr r0, [sp, 0x18] + movs r6, 0xF8 + lsls r6, 2 + ands r0, r6 + lsrs r0, 5 + str r0, [sp, 0x1C] + adds r0, r7, 0 + movs r1, 0x28 + adds r2, r4, 0 + bl pokemon_setattr_encrypted + ldr r0, [sp, 0x18] + movs r5, 0xF8 + lsls r5, 7 + ands r0, r5 + lsrs r0, 10 + str r0, [sp, 0x1C] + adds r0, r7, 0 + movs r1, 0x29 + adds r2, r4, 0 + bl pokemon_setattr_encrypted + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x18] + mov r1, r8 + ands r0, r1 + str r0, [sp, 0x1C] + adds r0, r7, 0 + movs r1, 0x2A + adds r2, r4, 0 + bl pokemon_setattr_encrypted + ldr r0, [sp, 0x18] + ands r0, r6 + lsrs r0, 5 + str r0, [sp, 0x1C] + adds r0, r7, 0 + movs r1, 0x2B + adds r2, r4, 0 + bl pokemon_setattr_encrypted + ldr r0, [sp, 0x18] + ands r0, r5 + lsrs r0, 10 + str r0, [sp, 0x1C] + adds r0, r7, 0 + movs r1, 0x2C + adds r2, r4, 0 + bl pokemon_setattr_encrypted +_08067E50: + ldr r2, =gBaseStats + mov r3, sp + ldrh r1, [r3, 0xE] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x17] + cmp r0, 0 + beq _08067E76 + ldr r0, [sp, 0x14] + movs r1, 0x1 + ands r0, r1 + str r0, [sp, 0x18] + adds r0, r7, 0 + movs r1, 0x2E + mov r2, r9 + bl pokemon_setattr_encrypted +_08067E76: + adds r0, r7, 0 + bl sub_8069270 + 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 create_pokemon + + thumb_func_start pokemon_make_with_nature +pokemon_make_with_nature: @ 8067E90 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + mov r9, r0 + ldr r0, [sp, 0x2C] + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r6, r3, 24 + lsls r0, 24 + lsrs r5, r0, 24 +_08067EB0: + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + adds r0, r4, 0 + bl GetNatureFromPersonality + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bne _08067EB0 + movs r0, 0x1 + str r0, [sp] + str r4, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + str r0, [sp, 0xC] + mov r0, r9 + mov r1, r8 + adds r2, r7, 0 + adds r3, r6, 0 + bl create_pokemon_set_level + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end pokemon_make_with_nature + + thumb_func_start sub_8067EF8 +sub_8067EF8: @ 8067EF8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + str r0, [sp, 0x10] + ldr r4, [sp, 0x38] + ldr r5, [sp, 0x3C] + ldr r0, [sp, 0x40] + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x14] + lsls r3, 24 + lsrs r3, 24 + mov r10, r3 + lsls r4, 24 + lsrs r4, 24 + mov r8, r4 + lsls r5, 24 + lsrs r6, r5, 24 + lsls r0, 24 + lsrs r1, r0, 24 + mov r9, r1 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1B + bhi _08067F9E +_08067F38: + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + movs r0, 0xC0 + lsls r0, 18 + ands r0, r4 + lsrs r0, 18 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r4 + lsrs r1, 12 + orrs r0, r1 + movs r1, 0xC0 + lsls r1, 2 + ands r1, r4 + lsrs r1, 6 + orrs r0, r1 + movs r1, 0x3 + ands r1, r4 + orrs r0, r1 + movs r1, 0x1C + bl __umodsi3 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + bl GetNatureFromPersonality + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + bne _08067F38 + adds r0, r7, 0 + adds r1, r4, 0 + bl pokemon_species_get_gender_info + lsls r0, 24 + lsrs r0, 24 + cmp r8, r0 + bne _08067F38 + mov r0, r9 + subs r0, 0x1 + cmp r5, r0 + bne _08067F38 + b _08067FCE +_08067F9E: + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + adds r0, r4, 0 + bl GetNatureFromPersonality + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + bne _08067F9E + adds r0, r7, 0 + adds r1, r4, 0 + bl pokemon_species_get_gender_info + lsls r0, 24 + lsrs r0, 24 + cmp r8, r0 + bne _08067F9E +_08067FCE: + movs r0, 0x1 + str r0, [sp] + str r4, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + str r0, [sp, 0xC] + ldr r0, [sp, 0x10] + adds r1, r7, 0 + ldr r2, [sp, 0x14] + mov r3, r10 + bl create_pokemon_set_level + 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_8067EF8 + + thumb_func_start sub_8067FF8 +sub_8067FF8: @ 8067FF8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + mov r8, r0 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 24 + lsrs r7, r2, 24 +_0806800A: + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r5, r4, 16 + lsls r0, 16 + orrs r5, r0 + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + adds r0, r6, 0 + adds r1, r4, 0 + bl pokemon_species_get_gender_info + lsls r0, 24 + cmp r0, 0 + bne _0806800A + movs r0, 0x1 + str r0, [sp] + str r4, [sp, 0x4] + str r0, [sp, 0x8] + str r5, [sp, 0xC] + mov r0, r8 + adds r1, r6, 0 + adds r2, r7, 0 + movs r3, 0x20 + bl create_pokemon_set_level + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8067FF8 + + thumb_func_start sub_8068060 +sub_8068060: @ 8068060 + push {r4,lr} + sub sp, 0x14 + adds r4, r0, 0 + str r3, [sp, 0x10] + ldr r3, [sp, 0x1C] + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1 + str r0, [sp] + str r3, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + str r0, [sp, 0xC] + adds r0, r4, 0 + movs r3, 0 + bl create_pokemon_set_level + adds r0, r4, 0 + movs r1, 0x42 + add r2, sp, 0x10 + bl pokemon_setattr + adds r0, r4, 0 + bl pokemon_calc_effective_stats + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8068060 + + thumb_func_start sub_80680A0 +sub_80680A0: @ 80680A0 + push {r4,r5,lr} + sub sp, 0x10 + adds r5, r0, 0 + adds r4, r3, 0 + ldr r3, [sp, 0x1C] + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + str r3, [sp, 0xC] + adds r0, r5, 0 + movs r3, 0 + bl create_pokemon_set_level + adds r0, r5, 0 + movs r1, 0x27 + adds r2, r4, 0 + bl pokemon_setattr + adds r2, r4, 0x1 + adds r0, r5, 0 + movs r1, 0x28 + bl pokemon_setattr + adds r2, r4, 0x2 + adds r0, r5, 0 + movs r1, 0x29 + bl pokemon_setattr + adds r2, r4, 0x3 + adds r0, r5, 0 + movs r1, 0x2A + bl pokemon_setattr + adds r2, r4, 0x4 + adds r0, r5, 0 + movs r1, 0x2B + bl pokemon_setattr + adds r4, 0x5 + adds r0, r5, 0 + movs r1, 0x2C + adds r2, r4, 0 + bl pokemon_setattr + adds r0, r5, 0 + bl pokemon_calc_effective_stats + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80680A0 + + thumb_func_start pokemon_make_ev_something +pokemon_make_ev_something: @ 8068114 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + adds r7, r0, 0 + ldr r0, [sp, 0x2C] + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r6, 0 + str r6, [sp] + str r6, [sp, 0x4] + str r6, [sp, 0x8] + str r6, [sp, 0xC] + adds r0, r7, 0 + bl create_pokemon_set_level + mov r4, r8 + movs r1, 0x1 + movs r5, 0x5 +_08068148: + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _08068152 + adds r6, 0x1 +_08068152: + lsrs r4, 1 + subs r5, 0x1 + cmp r5, 0 + bge _08068148 + movs r0, 0xFF + lsls r0, 1 + adds r1, r6, 0 + bl __divsi3 + add r1, sp, 0x10 + strh r0, [r1] + movs r4, 0x1 + movs r5, 0 +_0806816C: + mov r0, r8 + ands r0, r4 + cmp r0, 0 + beq _08068180 + adds r1, r5, 0 + adds r1, 0x1A + adds r0, r7, 0 + add r2, sp, 0x10 + bl pokemon_setattr +_08068180: + lsls r0, r4, 25 + lsrs r4, r0, 24 + adds r5, 0x1 + cmp r5, 0x5 + ble _0806816C + adds r0, r7, 0 + bl pokemon_calc_effective_stats + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end pokemon_make_ev_something + + thumb_func_start sub_806819C +sub_806819C: @ 806819C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x34 + adds r7, r0, 0 + adds r6, r1, 0 + ldrh r1, [r6] + ldrb r2, [r6, 0xC] + movs r3, 0x1 + str r3, [sp] + ldr r0, [r6, 0x1C] + str r0, [sp, 0x4] + str r3, [sp, 0x8] + ldr r0, [r6, 0x14] + str r0, [sp, 0xC] + adds r0, r7, 0 + movs r3, 0 + bl create_pokemon_set_level + movs r5, 0 + add r0, sp, 0x30 + mov r9, r0 + movs r1, 0x31 + add r1, sp + mov r8, r1 + adds r4, r6, 0x4 +_080681D2: + ldrh r1, [r4] + lsls r2, r5, 24 + lsrs r2, 24 + adds r0, r7, 0 + bl sub_80691F4 + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _080681D2 + adds r2, r6, 0 + adds r2, 0xD + adds r0, r7, 0 + movs r1, 0x15 + bl pokemon_setattr + adds r2, r6, 0x2 + adds r0, r7, 0 + movs r1, 0xC + bl pokemon_setattr + adds r2, r6, 0 + adds r2, 0x2B + adds r0, r7, 0 + movs r1, 0x20 + bl pokemon_setattr + adds r1, r6, 0 + adds r1, 0x20 + add r0, sp, 0x10 + bl CopyString + add r0, sp, 0x10 + ldrb r0, [r0] + cmp r0, 0xFC + bne _08068230 + add r0, sp, 0x10 + ldrb r0, [r0, 0x1] + cmp r0, 0x15 + bne _08068230 + movs r0, 0x1 + mov r1, r9 + strb r0, [r1] + add r0, sp, 0x10 + bl StripExtendedControlCodes + b _08068236 +_08068230: + movs r0, 0x2 + mov r1, r9 + strb r0, [r1] +_08068236: + adds r0, r7, 0 + movs r1, 0x3 + mov r2, r9 + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x2 + add r2, sp, 0x10 + bl pokemon_setattr + adds r2, r6, 0 + adds r2, 0xE + adds r0, r7, 0 + movs r1, 0x1A + bl pokemon_setattr + adds r2, r6, 0 + adds r2, 0xF + adds r0, r7, 0 + movs r1, 0x1B + bl pokemon_setattr + adds r2, r6, 0 + adds r2, 0x10 + adds r0, r7, 0 + movs r1, 0x1C + bl pokemon_setattr + adds r2, r6, 0 + adds r2, 0x11 + adds r0, r7, 0 + movs r1, 0x1D + bl pokemon_setattr + adds r2, r6, 0 + adds r2, 0x12 + adds r0, r7, 0 + movs r1, 0x1E + bl pokemon_setattr + adds r2, r6, 0 + adds r2, 0x13 + adds r0, r7, 0 + movs r1, 0x1F + bl pokemon_setattr + ldrb r0, [r6, 0x1B] + lsrs r0, 7 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x2E + mov r2, r8 + bl pokemon_setattr + ldrb r0, [r6, 0x18] + lsls r0, 27 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x27 + mov r2, r8 + bl pokemon_setattr + ldrh r0, [r6, 0x18] + lsls r0, 22 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x28 + mov r2, r8 + bl pokemon_setattr + ldrb r0, [r6, 0x19] + lsls r0, 25 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x29 + mov r2, r8 + bl pokemon_setattr + ldr r0, [r6, 0x18] + lsls r0, 12 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x2A + mov r2, r8 + bl pokemon_setattr + ldrh r0, [r6, 0x1A] + lsls r0, 23 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x2B + mov r2, r8 + bl pokemon_setattr + ldrb r0, [r6, 0x1B] + lsls r0, 26 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x2C + mov r2, r8 + bl pokemon_setattr + adds r0, r7, 0 + bl sub_806E924 + adds r0, r7, 0 + bl pokemon_calc_effective_stats + add sp, 0x34 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_806819C + + thumb_func_start sub_8068338 +sub_8068338: @ 8068338 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x58 + adds r7, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08068374 + lsls r0, r1, 30 + lsrs r0, 30 + bl sub_8165C90 + lsls r0, 24 + lsrs r3, r0, 24 + b _0806837C + .pool +_08068374: + movs r3, 0x32 + cmp r2, 0 + bne _0806837C + ldrb r3, [r6, 0xC] +_0806837C: + ldrh r1, [r6] + movs r2, 0x1 + str r2, [sp] + ldr r0, [r6, 0x1C] + str r0, [sp, 0x4] + str r2, [sp, 0x8] + ldr r0, [r6, 0x14] + str r0, [sp, 0xC] + adds r0, r7, 0 + adds r2, r3, 0 + movs r3, 0 + bl create_pokemon_set_level + movs r5, 0 + movs r0, 0xD + adds r0, r6 + mov r10, r0 + adds r1, r6, 0x2 + str r1, [sp, 0x38] + adds r0, r6, 0 + adds r0, 0x2B + str r0, [sp, 0x34] + adds r1, 0x1E + str r1, [sp, 0x54] + add r0, sp, 0x30 + mov r9, r0 + subs r1, 0x12 + str r1, [sp, 0x3C] + adds r0, r6, 0 + adds r0, 0xF + str r0, [sp, 0x40] + adds r1, 0x2 + str r1, [sp, 0x44] + adds r0, 0x2 + str r0, [sp, 0x48] + adds r1, 0x2 + str r1, [sp, 0x4C] + adds r0, 0x2 + str r0, [sp, 0x50] + movs r1, 0x31 + add r1, sp + mov r8, r1 + adds r4, r6, 0x4 +_080683D2: + ldrh r1, [r4] + lsls r2, r5, 24 + lsrs r2, 24 + adds r0, r7, 0 + bl sub_80691F4 + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _080683D2 + adds r0, r7, 0 + movs r1, 0x15 + mov r2, r10 + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0xC + ldr r2, [sp, 0x38] + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x20 + ldr r2, [sp, 0x34] + bl pokemon_setattr + add r0, sp, 0x10 + ldr r1, [sp, 0x54] + bl CopyString + add r0, sp, 0x10 + ldrb r0, [r0] + cmp r0, 0xFC + bne _0806842A + add r0, sp, 0x10 + ldrb r0, [r0, 0x1] + cmp r0, 0x15 + bne _0806842A + movs r0, 0x1 + mov r1, r9 + strb r0, [r1] + add r0, sp, 0x10 + bl StripExtendedControlCodes + b _08068430 +_0806842A: + movs r0, 0x2 + mov r1, r9 + strb r0, [r1] +_08068430: + adds r0, r7, 0 + movs r1, 0x3 + mov r2, r9 + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x2 + add r2, sp, 0x10 + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x1A + ldr r2, [sp, 0x3C] + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x1B + ldr r2, [sp, 0x40] + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x1C + ldr r2, [sp, 0x44] + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x1D + ldr r2, [sp, 0x48] + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x1E + ldr r2, [sp, 0x4C] + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x1F + ldr r2, [sp, 0x50] + bl pokemon_setattr + ldrb r0, [r6, 0x1B] + lsrs r0, 7 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x2E + mov r2, r8 + bl pokemon_setattr + ldrb r0, [r6, 0x18] + lsls r0, 27 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x27 + mov r2, r8 + bl pokemon_setattr + ldrh r0, [r6, 0x18] + lsls r0, 22 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x28 + mov r2, r8 + bl pokemon_setattr + ldrb r0, [r6, 0x19] + lsls r0, 25 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x29 + mov r2, r8 + bl pokemon_setattr + ldr r0, [r6, 0x18] + lsls r0, 12 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x2A + mov r2, r8 + bl pokemon_setattr + ldrh r0, [r6, 0x1A] + lsls r0, 23 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x2B + mov r2, r8 + bl pokemon_setattr + ldrb r0, [r6, 0x1B] + lsls r0, 26 + lsrs r0, 27 + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x2C + mov r2, r8 + bl pokemon_setattr + adds r0, r7, 0 + bl sub_806E924 + adds r0, r7, 0 + bl pokemon_calc_effective_stats + add sp, 0x58 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8068338 + + thumb_func_start sub_8068528 +sub_8068528: @ 8068528 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + adds r7, r0, 0 + mov r9, r1 + lsls r2, 24 + lsrs r2, 24 + ldr r6, =gUnknown_08610970 + ldrb r0, [r1] + lsls r3, r0, 27 + lsrs r1, r3, 27 + movs r5, 0x58 + muls r1, r5 + adds r1, r6 + ldrh r1, [r1, 0x30] + mov r8, r1 + lsrs r1, r3, 27 + muls r1, r5 + adds r1, r6 + ldrh r4, [r1, 0x30] + lsrs r4, 8 + lsrs r3, 27 + adds r1, r3, 0 + muls r1, r5 + adds r1, r6 + ldrh r3, [r1, 0x30] + movs r1, 0xFF + ands r1, r3 + lsls r1, 8 + lsls r5, r2, 1 + adds r5, r2 + lsls r5, 2 + mov r2, r9 + adds r6, r2, r5 + orrs r4, r1 + ldrh r1, [r6, 0x4] + adds r4, r1 + ldrb r1, [r2, 0x2] + adds r4, r1 + lsls r0, 25 + lsrs r0, 30 + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + bl sub_8165C90 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldrh r1, [r6, 0x4] + movs r0, 0x1 + str r0, [sp] + str r4, [sp, 0x4] + str r0, [sp, 0x8] + mov r0, r8 + str r0, [sp, 0xC] + adds r0, r7, 0 + movs r3, 0x1F + bl create_pokemon_set_level + mov r1, r9 + adds r2, r5, r1 + adds r2, 0xE + adds r0, r7, 0 + movs r1, 0xC + bl pokemon_setattr + movs r4, 0 + movs r2, 0x12 + add r2, sp + mov r8, r2 + mov r6, r9 + adds r6, 0x6 +_080685BE: + adds r0, r6, r5 + ldrh r1, [r0] + lsls r2, r4, 24 + lsrs r2, 24 + adds r0, r7, 0 + bl sub_80691F4 + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _080685BE + movs r1, 0x55 + add r0, sp, 0x10 + strh r1, [r0] + movs r4, 0 + mov r5, r9 + adds r5, 0x3F +_080685E0: + adds r1, r4, 0 + adds r1, 0x1A + adds r0, r7, 0 + add r2, sp, 0x10 + bl pokemon_setattr + adds r4, 0x1 + cmp r4, 0x5 + ble _080685E0 + ldrb r0, [r5] + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x3 + mov r2, r8 + bl pokemon_setattr + mov r2, r9 + ldrb r0, [r2] + lsls r0, 27 + lsrs r0, 27 + mov r2, r8 + ldrb r1, [r2] + bl sub_81A1650 + adds r2, r0, 0 + adds r0, r7, 0 + movs r1, 0x7 + bl pokemon_setattr + adds r0, r7, 0 + bl pokemon_calc_effective_stats + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8068528 + + thumb_func_start sub_8068634 +sub_8068634: @ 8068634 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + adds r7, r0, 0 + ldr r0, [sp, 0x38] + ldr r4, [sp, 0x3C] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x14] + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + lsls r3, 24 + lsrs r5, r3, 24 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r4, 24 + lsrs r4, 24 + mov r8, r4 + movs r6, 0 +_08068664: + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + adds r0, r4, 0 + bl GetNatureFromPersonality + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bne _08068664 + movs r0, 0x1 + str r0, [sp] + str r4, [sp, 0x4] + str r0, [sp, 0x8] + ldr r0, [sp, 0x40] + str r0, [sp, 0xC] + adds r0, r7, 0 + ldr r1, [sp, 0x14] + mov r2, r10 + mov r3, r9 + bl create_pokemon_set_level + mov r5, r8 + movs r1, 0x1 + movs r4, 0x5 +_080686A2: + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _080686AC + adds r6, 0x1 +_080686AC: + lsrs r5, 1 + subs r4, 0x1 + cmp r4, 0 + bge _080686A2 + movs r0, 0xFF + lsls r0, 1 + adds r1, r6, 0 + bl __divsi3 + add r1, sp, 0x10 + strh r0, [r1] + movs r5, 0x1 + movs r4, 0 +_080686C6: + mov r0, r8 + ands r0, r5 + cmp r0, 0 + beq _080686DA + adds r1, r4, 0 + adds r1, 0x1A + adds r0, r7, 0 + add r2, sp, 0x10 + bl pokemon_setattr +_080686DA: + lsls r0, r5, 25 + lsrs r5, r0, 24 + adds r4, 0x1 + cmp r4, 0x5 + ble _080686C6 + adds r0, r7, 0 + bl pokemon_calc_effective_stats + 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_8068634 + + thumb_func_start sub_80686FC +sub_80686FC: @ 80686FC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + adds r6, r1, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r6] + adds r0, r7, 0 + movs r1, 0xC + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _08068726 + movs r0, 0 +_08068726: + strh r0, [r6, 0x2] + movs r5, 0 + movs r0, 0x2B + adds r0, r6 + mov r8, r0 + movs r1, 0x20 + adds r1, r6 + mov r9, r1 + adds r4, r6, 0x4 +_08068738: + adds r1, r5, 0 + adds r1, 0xD + adds r0, r7, 0 + movs r2, 0 + bl pokemon_getattr + strh r0, [r4] + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _08068738 + adds r0, r7, 0 + movs r1, 0x38 + movs r2, 0 + bl pokemon_getattr + strb r0, [r6, 0xC] + adds r0, r7, 0 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + strb r0, [r6, 0xD] + adds r0, r7, 0 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + str r0, [r6, 0x14] + adds r0, r7, 0 + movs r1, 0x1A + movs r2, 0 + bl pokemon_getattr + strb r0, [r6, 0xE] + adds r0, r7, 0 + movs r1, 0x1B + movs r2, 0 + bl pokemon_getattr + strb r0, [r6, 0xF] + adds r0, r7, 0 + movs r1, 0x1C + movs r2, 0 + bl pokemon_getattr + strb r0, [r6, 0x10] + adds r0, r7, 0 + movs r1, 0x1D + movs r2, 0 + bl pokemon_getattr + strb r0, [r6, 0x11] + adds r0, r7, 0 + movs r1, 0x1E + movs r2, 0 + bl pokemon_getattr + strb r0, [r6, 0x12] + adds r0, r7, 0 + movs r1, 0x1F + movs r2, 0 + bl pokemon_getattr + strb r0, [r6, 0x13] + adds r0, r7, 0 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + mov r1, r8 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x27 + movs r2, 0 + bl pokemon_getattr + movs r4, 0x1F + ands r0, r4 + ldrb r2, [r6, 0x18] + movs r1, 0x20 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r6, 0x18] + adds r0, r7, 0 + movs r1, 0x28 + movs r2, 0 + bl pokemon_getattr + movs r5, 0x1F + ands r0, r5 + lsls r0, 5 + ldrh r2, [r6, 0x18] + ldr r1, =0xfffffc1f + ands r1, r2 + orrs r1, r0 + strh r1, [r6, 0x18] + adds r0, r7, 0 + movs r1, 0x29 + movs r2, 0 + bl pokemon_getattr + ands r0, r4 + lsls r0, 2 + ldrb r2, [r6, 0x19] + movs r1, 0x7D + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r6, 0x19] + adds r0, r7, 0 + movs r1, 0x2A + movs r2, 0 + bl pokemon_getattr + movs r1, 0x1F + ands r1, r0 + lsls r1, 15 + ldr r0, [r6, 0x18] + ldr r2, =0xfff07fff + ands r0, r2 + orrs r0, r1 + str r0, [r6, 0x18] + adds r0, r7, 0 + movs r1, 0x2B + movs r2, 0 + bl pokemon_getattr + ands r0, r5 + lsls r0, 4 + ldrh r2, [r6, 0x1A] + ldr r1, =0xfffffe0f + ands r1, r2 + orrs r1, r0 + strh r1, [r6, 0x1A] + adds r0, r7, 0 + movs r1, 0x2C + movs r2, 0 + bl pokemon_getattr + ands r0, r4 + lsls r0, 1 + ldrb r2, [r6, 0x1B] + movs r1, 0x3F + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r6, 0x1B] + adds r0, r7, 0 + movs r1, 0x2E + movs r2, 0 + bl pokemon_getattr + lsls r0, 7 + ldrb r2, [r6, 0x1B] + movs r1, 0x7F + ands r1, r2 + orrs r1, r0 + strb r1, [r6, 0x1B] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + str r0, [r6, 0x1C] + adds r0, r7, 0 + movs r1, 0x2 + mov r2, r9 + bl pokemon_getattr + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80686FC + + thumb_func_start sub_80688A8 +sub_80688A8: @ 80688A8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + mov r8, r0 + ldr r4, [sp, 0x2C] + ldr r6, [sp, 0x30] + ldr r5, [sp, 0x34] + ldr r7, [sp, 0x38] + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x1 + str r0, [sp, 0x10] + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + str r7, [sp, 0xC] + mov r0, r8 + bl create_pokemon_set_level + mov r0, r8 + movs r1, 0x50 + add r2, sp, 0x10 + bl pokemon_setattr + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80688A8 + + thumb_func_start sub_80688F8 +sub_80688F8: @ 80688F8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + cmp r0, 0x5 + bhi _080689CE + lsls r0, 2 + ldr r1, =_08068914 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08068914: + .4byte _080689CE + .4byte _0806892C + .4byte _08068A00 + .4byte _08068958 + .4byte _08068A00 + .4byte _08068990 +_0806892C: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080689CE + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080689CE + b _080689B6 + .pool +_08068958: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080689CE + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080689CE + cmp r5, 0x1 + beq _08068A00 + cmp r5, 0x4 + beq _08068A00 + cmp r5, 0x5 + beq _08068A00 + b _080689CE + .pool +_08068990: + ldr r0, =0x02022fec + ldr r2, [r0] + movs r3, 0x2 + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + beq _080689E4 + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _080689CE + movs r0, 0x40 + ands r2, r0 + cmp r2, 0 + beq _080689F4 +_080689B6: + ldr r4, =0x020229e8 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r1, 0x18] + cmp r0, r5 + bne _08068A00 +_080689CE: + movs r0, 0 + b _08068A02 + .pool +_080689E4: + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _080689CE +_080689F4: + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080689CE +_08068A00: + movs r0, 0x1 +_08068A02: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80688F8 + + thumb_func_start get_pokemon_data_3 +get_pokemon_data_3: @ 8068A10 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + bne _08068A34 + adds r0, r5, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + movs r1, 0xCD + lsls r1, 1 + cmp r0, r1 + beq _08068A3C +_08068A34: + movs r0, 0 + b _08068A9A + .pool +_08068A3C: + adds r1, r6, 0 + adds r1, 0x27 + adds r0, r5, 0 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + adds r1, r6, 0 + adds r1, 0x1A + adds r0, r5, 0 + movs r2, 0 + bl pokemon_getattr + ldr r2, =gUnknown_08329D48 + lsls r1, r6, 1 + adds r1, r2 + ldrh r1, [r1] + lsls r1, 1 + adds r1, r4 + cmp r0, 0 + bge _08068A68 + adds r0, 0x3 +_08068A68: + asrs r0, 2 + adds r0, r1, r0 + adds r1, r5, 0 + adds r1, 0x54 + ldrb r1, [r1] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + adds r0, 0x5 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r5, 0 + bl GetNature + lsls r0, 24 + lsrs r0, 24 + lsls r2, r6, 24 + lsrs r2, 24 + adds r1, r4, 0 + bl nature_stat_mod + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 +_08068A9A: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end get_pokemon_data_3 + + thumb_func_start sub_8068AA4 +sub_8068AA4: @ 8068AA4 + push {r4,r5,lr} + sub sp, 0x4 + movs r5, 0 +_08068AAA: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + movs r1, 0xCD + lsls r1, 1 + cmp r0, r1 + bne _08068B34 + adds r0, r4, 0 + movs r1, 0x3B + movs r2, 0 + bl pokemon_getattr + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x3B + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3C + movs r2, 0 + bl pokemon_getattr + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x3C + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3D + movs r2, 0 + bl pokemon_getattr + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x3D + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3E + movs r2, 0 + bl pokemon_getattr + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x3E + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3F + movs r2, 0 + bl pokemon_getattr + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x3F + mov r2, sp + bl pokemon_setattr +_08068B34: + adds r5, 0x1 + cmp r5, 0x5 + ble _08068AAA + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8068AA4 + + thumb_func_start sub_8068B48 +sub_8068B48: @ 8068B48 + push {lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _08068B6C + ldr r0, =0x0203c7b4 + ldrb r1, [r0] + movs r0, 0x1 + eors r0, r1 + b _08068B78 + .pool +_08068B6C: + bl link_get_multiplayer_id + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 +_08068B78: + ldr r3, =0x020229e8 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r0, r3, 0x4 + adds r0, r1, r0 + ldr r2, [r0] + movs r0, 0x7 + ands r2, r0 + adds r1, r3 + ldrb r0, [r1, 0x13] + lsls r0, 3 + orrs r2, r0 + ldr r0, =gUnknown_08329D54 + lsls r2, 1 + adds r2, r0 + ldrh r0, [r2] + bl TrainerClassToTrainerPic + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8068B48 + + thumb_func_start sub_8068BB0 +sub_8068BB0: @ 8068BB0 + push {lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _08068BD4 + ldr r0, =0x0203c7b4 + ldrb r1, [r0] + movs r0, 0x1 + eors r0, r1 + b _08068BE0 + .pool +_08068BD4: + bl link_get_multiplayer_id + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 +_08068BE0: + ldr r3, =0x020229e8 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r0, r3, 0x4 + adds r0, r1, r0 + ldr r2, [r0] + movs r0, 0x7 + ands r2, r0 + adds r1, r3 + ldrb r0, [r1, 0x13] + lsls r0, 3 + orrs r2, r0 + ldr r1, =gTrainerClassNameIndices + ldr r0, =gUnknown_08329D54 + lsls r2, 1 + adds r2, r0 + ldrh r0, [r2] + adds r0, r1 + ldrb r0, [r0] + pop {r1} + bx r1 + .pool + thumb_func_end sub_8068BB0 + + thumb_func_start DoScriptedWildBattle +DoScriptedWildBattle: @ 8068C18 + push {r4-r7,lr} + sub sp, 0x14 + ldr r0, =0x020375e0 + ldrh r5, [r0] + ldr r0, =0x020375e2 + ldrh r4, [r0] + ldr r0, =0x020375e4 + ldrh r6, [r0] + bl zero_enemy_party_data + ldr r7, =0x02024744 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + adds r0, r7, 0 + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x20 + bl sub_80688A8 + cmp r6, 0 + beq _08068C60 + add r0, sp, 0x10 + strb r6, [r0] + adds r1, r0, 0 + asrs r0, r6, 8 + strb r0, [r1, 0x1] + adds r0, r7, 0 + movs r1, 0xC + add r2, sp, 0x10 + bl pokemon_setattr +_08068C60: + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end DoScriptedWildBattle + + thumb_func_start pokemon_calc_checksum +@ int pokemon_calc_checksum(pokemon *mon) +pokemon_calc_checksum: @ 8068C78 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + movs r6, 0 + ldr r1, [r4] + movs r2, 0 + bl pokemon_data_permutator + adds r5, r0, 0 + ldr r1, [r4] + adds r0, r4, 0 + movs r2, 0x1 + bl pokemon_data_permutator + adds r7, r0, 0 + ldr r1, [r4] + adds r0, r4, 0 + movs r2, 0x2 + bl pokemon_data_permutator + mov r8, r0 + ldr r1, [r4] + adds r0, r4, 0 + movs r2, 0x3 + bl pokemon_data_permutator + adds r3, r0, 0 + movs r1, 0x5 +_08068CB2: + ldrh r0, [r5] + adds r0, r6, r0 + lsls r0, 16 + lsrs r6, r0, 16 + adds r5, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08068CB2 + adds r2, r7, 0 + movs r1, 0x5 +_08068CC6: + ldrh r0, [r2] + adds r0, r6, r0 + lsls r0, 16 + lsrs r6, r0, 16 + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08068CC6 + mov r2, r8 + movs r1, 0x5 +_08068CDA: + ldrh r0, [r2] + adds r0, r6, r0 + lsls r0, 16 + lsrs r6, r0, 16 + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08068CDA + adds r2, r3, 0 + movs r1, 0x5 +_08068CEE: + ldrh r0, [r2] + adds r0, r6, r0 + lsls r0, 16 + lsrs r6, r0, 16 + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08068CEE + adds r0, r6, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end pokemon_calc_checksum + + thumb_func_start pokemon_calc_effective_stats +pokemon_calc_effective_stats: @ 8068D0C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + adds r5, r0, 0 + movs r1, 0x3A + movs r2, 0 + bl pokemon_getattr + mov r8, r0 + adds r0, r5, 0 + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x1C] + adds r0, r5, 0 + movs r1, 0x27 + movs r2, 0 + bl pokemon_getattr + adds r6, r0, 0 + adds r0, r5, 0 + movs r1, 0x1A + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + adds r0, r5, 0 + movs r1, 0x28 + movs r2, 0 + bl pokemon_getattr + mov r10, r0 + adds r0, r5, 0 + movs r1, 0x1B + movs r2, 0 + bl pokemon_getattr + mov r9, r0 + adds r0, r5, 0 + movs r1, 0x29 + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x20] + adds r0, r5, 0 + movs r1, 0x1C + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x24] + adds r0, r5, 0 + movs r1, 0x2A + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x28] + adds r0, r5, 0 + movs r1, 0x1D + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x2C] + adds r0, r5, 0 + movs r1, 0x2B + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x30] + adds r0, r5, 0 + movs r1, 0x1E + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x34] + adds r0, r5, 0 + movs r1, 0x2C + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x38] + adds r0, r5, 0 + movs r1, 0x1F + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x3C] + adds r0, r5, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r5, 0 + bl level_by_exp + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + adds r0, r5, 0 + movs r1, 0x38 + mov r2, sp + bl pokemon_setattr + ldr r0, =0x0000012f + cmp r7, r0 + bne _08068DF8 + movs r0, 0x1 + str r0, [sp, 0x4] + lsls r6, r7, 3 + b _08068E26 + .pool +_08068DF8: + ldr r1, =gBaseStats + lsls r2, r7, 3 + subs r0, r2, r7 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 1 + adds r1, r0, r6 + adds r0, r4, 0 + adds r6, r2, 0 + cmp r0, 0 + bge _08068E12 + adds r0, 0x3 +_08068E12: + asrs r0, 2 + adds r0, r1, r0 + ldr r4, [sp] + muls r0, r4 + movs r1, 0x64 + bl __divsi3 + adds r0, r4 + adds r0, 0xA + str r0, [sp, 0x4] +_08068E26: + ldr r1, =0x02024474 + add r2, sp, 0x4 + ldrb r0, [r2] + mov r3, r8 + subs r0, r3 + adds r1, 0x23 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _08068E3E + movs r0, 0x1 + strb r0, [r1] +_08068E3E: + adds r0, r5, 0 + movs r1, 0x3A + bl pokemon_setattr + ldr r0, =gBaseStats + subs r1, r6, r7 + lsls r1, 2 + adds r6, r1, r0 + ldrb r0, [r6, 0x1] + lsls r0, 1 + mov r2, r10 + adds r1, r0, r2 + mov r0, r9 + cmp r0, 0 + bge _08068E5E + adds r0, 0x3 +_08068E5E: + asrs r0, 2 + adds r0, r1, r0 + ldr r1, [sp] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + adds r0, 0x5 + str r0, [sp, 0x8] + adds r0, r5, 0 + bl GetNature + lsls r0, 24 + lsrs r0, 24 + add r4, sp, 0x8 + ldrh r1, [r4] + movs r2, 0x1 + bl nature_stat_mod + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0x3B + adds r2, r4, 0 + bl pokemon_setattr + ldrb r0, [r6, 0x2] + lsls r0, 1 + ldr r3, [sp, 0x20] + adds r1, r0, r3 + ldr r0, [sp, 0x24] + cmp r0, 0 + bge _08068EA4 + adds r0, 0x3 +_08068EA4: + asrs r0, 2 + adds r0, r1, r0 + ldr r1, [sp] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + adds r0, 0x5 + str r0, [sp, 0xC] + adds r0, r5, 0 + bl GetNature + lsls r0, 24 + lsrs r0, 24 + add r4, sp, 0xC + ldrh r1, [r4] + movs r2, 0x2 + bl nature_stat_mod + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0xC] + adds r0, r5, 0 + movs r1, 0x3C + adds r2, r4, 0 + bl pokemon_setattr + ldrb r0, [r6, 0x3] + lsls r0, 1 + ldr r2, [sp, 0x28] + adds r1, r0, r2 + ldr r0, [sp, 0x2C] + cmp r0, 0 + bge _08068EEA + adds r0, 0x3 +_08068EEA: + asrs r0, 2 + adds r0, r1, r0 + ldr r1, [sp] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + adds r0, 0x5 + str r0, [sp, 0x10] + adds r0, r5, 0 + bl GetNature + lsls r0, 24 + lsrs r0, 24 + add r4, sp, 0x10 + ldrh r1, [r4] + movs r2, 0x3 + bl nature_stat_mod + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x10] + adds r0, r5, 0 + movs r1, 0x3D + adds r2, r4, 0 + bl pokemon_setattr + ldrb r0, [r6, 0x4] + lsls r0, 1 + ldr r3, [sp, 0x30] + adds r1, r0, r3 + ldr r0, [sp, 0x34] + cmp r0, 0 + bge _08068F30 + adds r0, 0x3 +_08068F30: + asrs r0, 2 + adds r0, r1, r0 + ldr r1, [sp] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + adds r0, 0x5 + str r0, [sp, 0x14] + adds r0, r5, 0 + bl GetNature + lsls r0, 24 + lsrs r0, 24 + add r4, sp, 0x14 + ldrh r1, [r4] + movs r2, 0x4 + bl nature_stat_mod + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x14] + adds r0, r5, 0 + movs r1, 0x3E + adds r2, r4, 0 + bl pokemon_setattr + ldrb r0, [r6, 0x5] + lsls r0, 1 + ldr r2, [sp, 0x38] + adds r1, r0, r2 + ldr r0, [sp, 0x3C] + cmp r0, 0 + bge _08068F76 + adds r0, 0x3 +_08068F76: + asrs r0, 2 + adds r0, r1, r0 + ldr r1, [sp] + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + adds r0, 0x5 + str r0, [sp, 0x18] + adds r0, r5, 0 + bl GetNature + lsls r0, 24 + lsrs r0, 24 + add r4, sp, 0x18 + ldrh r1, [r4] + movs r2, 0x5 + bl nature_stat_mod + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x18] + adds r0, r5, 0 + movs r1, 0x3F + adds r2, r4, 0 + bl pokemon_setattr + ldr r0, =0x0000012f + cmp r7, r0 + bne _08068FD0 + ldr r0, [sp, 0x1C] + cmp r0, 0 + bne _08068FBE + mov r3, r8 + cmp r3, 0 + bne _08068FF4 +_08068FBE: + movs r0, 0x1 + b _08068FE8 + .pool +_08068FD0: + ldr r1, [sp, 0x1C] + cmp r1, 0 + bne _08068FE0 + mov r0, r8 + cmp r0, 0 + bne _08068FF4 + ldr r0, [sp, 0x4] + b _08068FE8 +_08068FE0: + ldr r0, [sp, 0x4] + mov r2, r8 + subs r0, r2 + adds r0, r1, r0 +_08068FE8: + str r0, [sp, 0x1C] + add r2, sp, 0x1C + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_setattr +_08068FF4: + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end pokemon_calc_effective_stats + + thumb_func_start sub_8069004 +sub_8069004: @ 8069004 + push {r4,lr} + sub sp, 0x4 + adds r2, r0, 0 + adds r4, r1, 0 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + adds r1, r2, 0 + movs r2, 0x50 + bl memcpy + adds r0, r4, 0 + movs r1, 0x37 + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x39 + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3A + mov r2, sp + bl pokemon_setattr + movs r0, 0xFF + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x40 + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + bl pokemon_calc_effective_stats + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8069004 + + thumb_func_start level_by_exp +level_by_exp: @ 8069054 + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x19 + movs r2, 0 + bl pokemon_getattr + adds r3, r0, 0 + movs r2, 0x1 + ldr r6, =gExperienceTables + ldr r1, =gBaseStats + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r1, r0, r1 + ldrb r0, [r1, 0x13] + movs r5, 0xCA + lsls r5, 1 + muls r0, r5 + adds r0, 0x4 + adds r0, r6 + ldr r0, [r0] + cmp r0, r3 + bhi _080690AA + adds r4, r1, 0 +_08069094: + adds r2, 0x1 + cmp r2, 0x64 + bgt _080690AA + lsls r1, r2, 2 + ldrb r0, [r4, 0x13] + muls r0, r5 + adds r1, r0 + adds r1, r6 + ldr r0, [r1] + cmp r0, r3 + bls _08069094 +_080690AA: + subs r0, r2, 0x1 + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end level_by_exp + + thumb_func_start sub_80690C0 +sub_80690C0: @ 80690C0 + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr_encrypted + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x19 + movs r2, 0 + bl pokemon_getattr_encrypted + adds r3, r0, 0 + movs r2, 0x1 + ldr r6, =gExperienceTables + ldr r1, =gBaseStats + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r1, r0, r1 + ldrb r0, [r1, 0x13] + movs r5, 0xCA + lsls r5, 1 + muls r0, r5 + adds r0, 0x4 + adds r0, r6 + ldr r0, [r0] + cmp r0, r3 + bhi _08069116 + adds r4, r1, 0 +_08069100: + adds r2, 0x1 + cmp r2, 0x64 + bgt _08069116 + lsls r1, r2, 2 + ldrb r0, [r4, 0x13] + muls r0, r5 + adds r1, r0 + adds r1, r6 + ldr r0, [r1] + cmp r0, r3 + bls _08069100 +_08069116: + subs r0, r2, 0x1 + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80690C0 + + thumb_func_start pokemon_moveset_pad_ +pokemon_moveset_pad_: @ 806912C + push {lr} + lsls r1, 16 + lsrs r1, 16 + bl pokemon_moveset_pad + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end pokemon_moveset_pad_ + + thumb_func_start pokemon_moveset_pad +pokemon_moveset_pad: @ 8069140 + push {r4-r7,lr} + sub sp, 0x4 + adds r7, r0, 0 + mov r0, sp + strh r1, [r0] + movs r5, 0 + mov r6, sp +_0806914E: + adds r4, r5, 0 + adds r4, 0xD + adds r0, r7, 0 + adds r1, r4, 0 + movs r2, 0 + bl pokemon_getattr_encrypted + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _0806918C + adds r0, r7, 0 + adds r1, r4, 0 + mov r2, sp + bl pokemon_setattr_encrypted + adds r1, r5, 0 + adds r1, 0x11 + ldrh r0, [r6] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + ldr r0, =gBattleMoves + 0x4 @ PP offset + adds r2, r0 + adds r0, r7, 0 + bl pokemon_setattr_encrypted + ldrh r0, [r6] + b _080691A4 + .pool +_0806918C: + ldrh r1, [r6] + cmp r0, r1 + bne _0806919C + ldr r0, =0x0000fffe + b _080691A4 + .pool +_0806919C: + adds r5, 0x1 + cmp r5, 0x3 + ble _0806914E + ldr r0, =0x0000ffff +_080691A4: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end pokemon_moveset_pad + + thumb_func_start sub_80691B0 +sub_80691B0: @ 80691B0 + push {r4,r5,lr} + lsls r1, 16 + lsrs r4, r1, 16 + movs r3, 0 + adds r5, r0, 0 + adds r5, 0x24 + ldr r2, =gBattleMoves + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r2, r1, r2 + adds r1, r0, 0 + adds r1, 0xC +_080691CA: + ldrh r0, [r1] + cmp r0, 0 + bne _080691E0 + strh r4, [r1] + adds r1, r5, r3 + ldrb r0, [r2, 0x4] + strb r0, [r1] + adds r0, r4, 0 + b _080691EA + .pool +_080691E0: + adds r1, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _080691CA + ldr r0, =0x0000ffff +_080691EA: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80691B0 + + thumb_func_start sub_80691F4 +sub_80691F4: @ 80691F4 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r4, r2, 0 + mov r0, sp + strh r1, [r0] + lsls r4, 24 + lsrs r4, 24 + adds r1, r4, 0 + adds r1, 0xD + adds r0, r5, 0 + mov r2, sp + bl pokemon_setattr + adds r4, 0x11 + mov r0, sp + ldrh r0, [r0] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + ldr r0, =gBattleMoves + 0x4 @ PP offset + adds r2, r0 + adds r0, r5, 0 + adds r1, r4, 0 + bl pokemon_setattr + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80691F4 + + thumb_func_start sub_8069234 +sub_8069234: @ 8069234 + push {r4,lr} + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + lsls r4, r2, 1 + adds r3, r0, 0 + adds r3, 0xC + adds r3, r4 + strh r1, [r3] + adds r0, 0x24 + adds r0, r2 + ldr r3, =gBattleMoves + lsls r2, r1, 1 + adds r2, r1 + lsls r2, 2 + adds r2, r3 + ldrb r1, [r2, 0x4] + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8069234 + + thumb_func_start sub_8069264 +sub_8069264: @ 8069264 + push {lr} + bl sub_8069270 + pop {r0} + bx r0 + thumb_func_end sub_8069264 + + thumb_func_start sub_8069270 +sub_8069270: @ 8069270 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr_encrypted + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + bl sub_80690C0 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r0, =gLevelUpLearnsetPointers + lsls r6, r4, 2 + adds r0, r6, r0 + ldr r0, [r0] + ldrh r1, [r0] + ldr r2, =0xffff0000 + lsrs r0, r2, 16 + cmp r1, r0 + beq _080692FC + mov r9, r2 + movs r3, 0 +_080692AE: + ldr r0, =gLevelUpLearnsetPointers + adds r7, r6, r0 + ldr r0, [r7] + adds r0, r3, r0 + ldrh r2, [r0] + movs r1, 0xFE + lsls r1, 8 + adds r0, r1, 0 + ands r0, r2 + mov r4, r10 + lsls r1, r4, 9 + cmp r0, r1 + bgt _080692FC + ldr r1, =0x000001ff + adds r0, r1, 0 + adds r4, r0, 0 + ands r4, r2 + mov r0, r8 + adds r1, r4, 0 + str r3, [sp] + bl pokemon_moveset_pad + lsls r0, 16 + mov r1, r9 + lsrs r5, r1, 16 + ldr r3, [sp] + cmp r0, r9 + bne _080692F0 + mov r0, r8 + adds r1, r4, 0 + bl sub_80694D0 + ldr r3, [sp] +_080692F0: + adds r3, 0x2 + ldr r0, [r7] + adds r0, r3, r0 + ldrh r0, [r0] + cmp r0, r5 + bne _080692AE +_080692FC: + 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_8069270 + + thumb_func_start sub_8069318 +sub_8069318: @ 8069318 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r0 + lsls r4, r1, 24 + lsrs r4, 24 + movs r0, 0 + str r0, [sp] + mov r0, r8 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + mov r0, r8 + movs r1, 0x38 + movs r2, 0 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + cmp r4, 0 + beq _080693B0 + ldr r4, =0x020244e8 + mov r1, sp + ldrb r1, [r1] + strb r1, [r4] + ldr r2, =gLevelUpLearnsetPointers + mov r5, r9 + lsls r3, r5, 2 + adds r5, r3, r2 + ldr r0, [r5] + ldrh r1, [r0] + movs r7, 0xFE + lsls r7, 8 + adds r0, r7, 0 + ands r0, r1 + adds r6, r4, 0 + mov r12, r2 + mov r1, r10 + lsls r4, r1, 9 + cmp r0, r4 + beq _080693D8 + adds r2, r6, 0 + ldr r0, =0x0000ffff + mov r12, r0 + adds r6, r7, 0 + adds r3, r5, 0 +_08069384: + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + ldrb r0, [r2] + ldr r1, [r3] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + cmp r1, r12 + bne _080693A8 + movs r0, 0 + b _08069404 + .pool +_080693A8: + adds r0, r6, 0 + ands r0, r1 + cmp r0, r4 + bne _08069384 +_080693B0: + ldr r3, =gLevelUpLearnsetPointers + mov r1, r9 + lsls r4, r1, 2 + adds r1, r4, r3 + ldr r2, =0x020244e8 + ldrb r0, [r2] + ldr r1, [r1] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0xFE + lsls r0, 8 + ands r0, r1 + mov r5, r10 + lsls r1, r5, 9 + adds r6, r2, 0 + mov r12, r3 + adds r3, r4, 0 + cmp r0, r1 + bne _08069402 +_080693D8: + ldr r2, =0x020244e2 + mov r0, r12 + adds r1, r3, r0 + ldrb r0, [r6] + ldr r1, [r1] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + ldr r0, =0x000001ff + ands r0, r1 + strh r0, [r2] + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + ldrh r1, [r2] + mov r0, r8 + bl pokemon_moveset_pad_ + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] +_08069402: + ldr r0, [sp] +_08069404: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8069318 + + thumb_func_start sub_8069424 +sub_8069424: @ 8069424 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + adds r6, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + movs r4, 0 + add r7, sp, 0x8 + add r0, sp, 0xC + mov r9, r0 + mov r5, sp +_08069440: + adds r1, r4, 0 + adds r1, 0xE + adds r0, r6, 0 + movs r2, 0 + bl pokemon_getattr + strh r0, [r5] + adds r1, r4, 0 + adds r1, 0x12 + adds r0, r6, 0 + movs r2, 0 + bl pokemon_getattr + adds r1, r7, r4 + strb r0, [r1] + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x2 + ble _08069440 + adds r0, r6, 0 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + mov r1, r9 + strb r0, [r1] + ldrb r0, [r1] + lsrs r0, 2 + strb r0, [r1] + mov r0, sp + mov r2, r8 + strh r2, [r0, 0x6] + ldr r1, =gBattleMoves + mov r2, r8 + lsls r0, r2, 1 + add r0, r8 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x4] + strb r0, [r7, 0x3] + movs r4, 0 + mov r5, sp +_08069494: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r6, 0 + adds r2, r5, 0 + bl pokemon_setattr + adds r1, r4, 0 + adds r1, 0x11 + adds r2, r7, r4 + adds r0, r6, 0 + bl pokemon_setattr + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _08069494 + adds r0, r6, 0 + movs r1, 0x15 + mov r2, r9 + bl pokemon_setattr + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8069424 + + thumb_func_start sub_80694D0 +sub_80694D0: @ 80694D0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + adds r6, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + movs r4, 0 + add r7, sp, 0x8 + add r0, sp, 0xC + mov r9, r0 + mov r5, sp +_080694EC: + adds r1, r4, 0 + adds r1, 0xE + adds r0, r6, 0 + movs r2, 0 + bl pokemon_getattr_encrypted + strh r0, [r5] + adds r1, r4, 0 + adds r1, 0x12 + adds r0, r6, 0 + movs r2, 0 + bl pokemon_getattr_encrypted + adds r1, r7, r4 + strb r0, [r1] + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x2 + ble _080694EC + adds r0, r6, 0 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr_encrypted + mov r1, r9 + strb r0, [r1] + ldrb r0, [r1] + lsrs r0, 2 + strb r0, [r1] + mov r0, sp + mov r2, r8 + strh r2, [r0, 0x6] + ldr r1, =gBattleMoves + mov r2, r8 + lsls r0, r2, 1 + add r0, r8 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x4] + strb r0, [r7, 0x3] + movs r4, 0 + mov r5, sp +_08069540: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r6, 0 + adds r2, r5, 0 + bl pokemon_setattr_encrypted + adds r1, r4, 0 + adds r1, 0x11 + adds r2, r7, r4 + adds r0, r6, 0 + bl pokemon_setattr_encrypted + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _08069540 + adds r0, r6, 0 + movs r1, 0x15 + mov r2, r9 + bl pokemon_setattr_encrypted + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80694D0 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/pokemon_2.s b/asm/pokemon_2.s new file mode 100644 index 000000000..ffb5ee13e --- /dev/null +++ b/asm/pokemon_2.s @@ -0,0 +1,3992 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8069DEC +sub_8069DEC: @ 8069DEC + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + movs r6, 0 + cmp r0, 0x1 + beq _08069E40 + cmp r0, 0x1 + bgt _08069E04 + cmp r0, 0 + beq _08069E0A + b _08069EC2 +_08069E04: + cmp r1, 0x2 + beq _08069E88 + b _08069EC2 +_08069E0A: + movs r5, 0 + ldr r0, =0x02024064 + ldrb r3, [r0] + ldr r4, =0x02024210 + ldr r2, =gUnknown_0832A328 +_08069E14: + cmp r5, r3 + beq _08069E28 + ldrb r0, [r4] + ldr r1, [r2] + ands r0, r1 + cmp r0, 0 + bne _08069E28 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_08069E28: + adds r2, 0x4 + adds r5, 0x1 + cmp r5, 0x3 + ble _08069E14 + b _08069EC2 + .pool +_08069E40: + movs r5, 0 +_08069E42: + lsls r0, r5, 24 + lsrs r0, 24 + bl battle_side_get_owner + adds r4, r0, 0 + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _08069E74 + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08069E74 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_08069E74: + adds r5, 0x1 + cmp r5, 0x3 + ble _08069E42 + b _08069EC2 + .pool +_08069E88: + movs r5, 0 +_08069E8A: + lsls r0, r5, 24 + lsrs r0, 24 + bl battle_side_get_owner + adds r4, r0, 0 + ldr r0, =0x0202420c + ldrb r0, [r0] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _08069EBC + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08069EBC + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_08069EBC: + adds r5, 0x1 + cmp r5, 0x3 + ble _08069E8A +_08069EC2: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8069DEC + + thumb_func_start sub_8069ED8 +sub_8069ED8: @ 8069ED8 + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 24 + lsrs r2, r1, 24 + ldr r4, =0x02022fec + ldr r0, [r4] + ldr r1, =0x023f0902 + ands r0, r1 + cmp r0, 0 + bne _08069F1C + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08069F1C + ldr r0, [r4] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08069F10 + ldr r0, =0x02038bca + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 3 + cmp r1, r0 + beq _08069F1C +_08069F10: + adds r0, r5, 0 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08069F2C +_08069F1C: + movs r0, 0 + b _08069F2E + .pool +_08069F2C: + movs r0, 0x1 +_08069F2E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8069ED8 + + thumb_func_start sub_8069F34 +sub_8069F34: @ 8069F34 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + bl battle_get_per_side_status + movs r1, 0x1 + movs r6, 0x1 + adds r4, r6, 0 + ands r4, r0 + eors r4, r1 + adds r5, r4, 0 + ldr r0, =0x02022fec + ldr r0, [r0] + ands r0, r6 + cmp r0, 0 + bne _08069F5C + adds r0, r4, 0 + b _08069FA6 + .pool +_08069F5C: + movs r0, 0 + bl sub_8069DEC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _08069F80 + bl GenerateRandomNumber + adds r1, r6, 0 + ands r1, r0 + cmp r1, 0 + bne _08069F7C + movs r0, 0x2 + eors r0, r4 + b _08069FA6 +_08069F7C: + adds r0, r4, 0 + b _08069FA6 +_08069F80: + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + lsls r0, r4, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08069FA0 + adds r0, r4, 0 + b _08069FA6 + .pool +_08069FA0: + movs r0, 0x2 + eors r5, r0 + adds r0, r5, 0 +_08069FA6: + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8069F34 + + thumb_func_start pokemon_get_gender +pokemon_get_gender: @ 8069FB4 + push {lr} + bl pokemon_roll_gender + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end pokemon_get_gender + + thumb_func_start pokemon_roll_gender +pokemon_roll_gender: @ 8069FC4 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr_encrypted + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr_encrypted + adds r2, r0, 0 + ldr r1, =gBaseStats + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x10] + cmp r0, 0 + beq _0806A01A + cmp r0, 0 + blt _08069FFC + cmp r0, 0xFF + bgt _08069FFC + cmp r0, 0xFE + bge _0806A01A +_08069FFC: + ldr r1, =gBaseStats + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x10] + movs r0, 0xFF + ands r0, r2 + cmp r1, r0 + bhi _0806A018 + movs r0, 0 + b _0806A01A + .pool +_0806A018: + movs r0, 0xFE +_0806A01A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end pokemon_roll_gender + + thumb_func_start pokemon_species_get_gender_info +pokemon_species_get_gender_info: @ 806A020 + push {lr} + adds r3, r1, 0 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, =gBaseStats + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x10] + cmp r0, 0 + beq _0806A062 + cmp r0, 0 + blt _0806A044 + cmp r0, 0xFF + bgt _0806A044 + cmp r0, 0xFE + bge _0806A062 +_0806A044: + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x10] + movs r0, 0xFF + ands r0, r3 + cmp r1, r0 + bhi _0806A060 + movs r0, 0 + b _0806A062 + .pool +_0806A060: + movs r0, 0xFE +_0806A062: + pop {r1} + bx r1 + thumb_func_end pokemon_species_get_gender_info + + thumb_func_start sub_806A068 +sub_806A068: @ 806A068 + push {r4-r7,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r0, =0x020244d4 + ldr r2, [r0] + cmp r2, 0 + beq _0806A09C + ldr r0, =0x0202499c + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 3 + adds r1, r2, r1 + adds r2, r0, 0 + adds r1, 0x14 + ldm r1!, {r3,r6,r7} + stm r2!, {r3,r6,r7} + ldm r1!, {r3,r6,r7} + stm r2!, {r3,r6,r7} + adds r3, r0, 0 + b _0806A0DA + .pool +_0806A09C: + ldr r1, =0x020249b4 + ldr r0, [r1] + cmp r0, 0 + beq _0806A0B4 + ldr r3, =0x0202499c + ldr r2, [r0, 0xC] + b _0806A0C8 + .pool +_0806A0B4: + ldr r0, [r1, 0x4] + cmp r0, 0 + beq _0806A0C4 + ldr r3, =0x0202499c + ldr r2, [r0, 0xC] + b _0806A0C8 + .pool +_0806A0C4: + ldr r3, =0x0202499c + ldr r2, =gUnknown_08329D98 +_0806A0C8: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + adds r1, r3, 0 + adds r0, r2 + ldm r0!, {r2,r6,r7} + stm r1!, {r2,r6,r7} + ldm r0!, {r2,r6,r7} + stm r1!, {r2,r6,r7} +_0806A0DA: + adds r2, r3, 0 + strh r5, [r2, 0x2] + cmp r4, 0 + beq _0806A0E6 + cmp r4, 0x2 + bne _0806A0F8 +_0806A0E6: + ldr r0, =gUnknown_082FF70C + str r0, [r2, 0x8] + b _0806A122 + .pool +_0806A0F8: + movs r0, 0xFA + lsls r0, 1 + cmp r5, r0 + bls _0806A118 + ldr r0, =gUnknown_08309AAC + ldr r3, =0xfffffe0c + adds r1, r5, r3 + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x8] + b _0806A122 + .pool +_0806A118: + ldr r0, =gUnknown_08309AAC + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r3, 0x8] +_0806A122: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806A068 + + thumb_func_start template_build_for_pokemon_or_trainer +template_build_for_pokemon_or_trainer: @ 806A12C + push {r4-r6,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 24 + lsrs r3, r1, 24 + ldr r0, =0x0202499c + strh r4, [r0, 0x2] + adds r5, r0, 0 + cmp r3, 0 + beq _0806A144 + cmp r3, 0x2 + bne _0806A170 +_0806A144: + ldr r2, =gUnknown_08329DF8 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + adds r1, r5, 0 + adds r0, r2 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldr r1, =gUnknown_08305D0C + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + b _0806A1B0 + .pool +_0806A170: + ldr r0, =0x020244d4 + ldr r1, [r0] + cmp r1, 0 + beq _0806A194 + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 3 + adds r0, r1, r0 + adds r1, r5, 0 + adds r0, 0x14 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + b _0806A1A8 + .pool +_0806A194: + ldr r0, =gUnknown_08329D98 + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 3 + adds r2, r5, 0 + adds r1, r0 + ldm r1!, {r0,r3,r6} + stm r2!, {r0,r3,r6} + ldm r1!, {r0,r3,r6} + stm r2!, {r0,r3,r6} +_0806A1A8: + ldr r0, =gUnknown_0830536C + lsls r1, r4, 2 + adds r1, r0 + ldr r0, [r1] +_0806A1B0: + str r0, [r5, 0x8] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end template_build_for_pokemon_or_trainer + + thumb_func_start sub_806A1C0 +sub_806A1C0: @ 806A1C0 + push {r4-r6,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r0, =0x020244d4 + ldr r2, [r0] + cmp r2, 0 + beq _0806A1F4 + ldr r0, =0x0202499c + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 3 + adds r1, r2, r1 + adds r2, r0, 0 + adds r1, 0x14 + ldm r1!, {r3,r4,r6} + stm r2!, {r3,r4,r6} + ldm r1!, {r3,r4,r6} + stm r2!, {r3,r4,r6} + adds r3, r0, 0 + b _0806A20A + .pool +_0806A1F4: + ldr r3, =0x0202499c + ldr r2, =gUnknown_08329D98 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + adds r1, r3, 0 + adds r0, r2 + ldm r0!, {r2,r4,r6} + stm r1!, {r2,r4,r6} + ldm r0!, {r2,r4,r6} + stm r1!, {r2,r4,r6} +_0806A20A: + strh r5, [r3, 0x2] + ldr r0, =gUnknown_0830536C + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r3, 0x8] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806A1C0 + + thumb_func_start pokemon_encrypt +@ void pokemon_encrypt(pokemon *mon) +pokemon_encrypt: @ 806A228 + push {r4,lr} + adds r3, r0, 0 + movs r4, 0 + adds r2, r3, 0 + adds r2, 0x20 +_0806A232: + ldr r0, [r2] + ldr r1, [r3] + eors r0, r1 + str r0, [r2] + ldr r1, [r3, 0x4] + eors r0, r1 + stm r2!, {r0} + adds r4, 0x1 + cmp r4, 0xB + bls _0806A232 + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemon_encrypt + + thumb_func_start pokemon_decrypt +@ void pokemon_decrypt(pokemon *mon) +pokemon_decrypt: @ 806A24C + push {r4,lr} + adds r3, r0, 0 + movs r4, 0 + adds r2, r3, 0 + adds r2, 0x20 +_0806A256: + ldr r0, [r2] + ldr r1, [r3, 0x4] + eors r0, r1 + str r0, [r2] + ldr r1, [r3] + eors r0, r1 + stm r2!, {r0} + adds r4, 0x1 + cmp r4, 0xB + bls _0806A256 + pop {r4} + pop {r0} + bx r0 + thumb_func_end pokemon_decrypt + + thumb_func_start pokemon_data_permutator +@ int pokemon_data_permutator(pokemon *mon, int a2, u8 a3) +pokemon_data_permutator: @ 806A270 + push {r4-r6,lr} + adds r5, r0, 0 + adds r0, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + movs r6, 0 + movs r1, 0x18 + bl __umodsi3 + cmp r0, 0x17 + bls _0806A288 + b _0806A510 +_0806A288: + lsls r0, 2 + ldr r1, =_0806A298 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806A298: + .4byte _0806A2F8 + .4byte _0806A31C + .4byte _0806A338 + .4byte _0806A34E + .4byte _0806A364 + .4byte _0806A380 + .4byte _0806A396 + .4byte _0806A3AC + .4byte _0806A3BC + .4byte _0806A3DA + .4byte _0806A3F2 + .4byte _0806A402 + .4byte _0806A416 + .4byte _0806A428 + .4byte _0806A43A + .4byte _0806A44C + .4byte _0806A45E + .4byte _0806A470 + .4byte _0806A482 + .4byte _0806A498 + .4byte _0806A4AC + .4byte _0806A4BA + .4byte _0806A4CC + .4byte _0806A4E0 +_0806A2F8: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A302 + b _0806A508 +_0806A302: + cmp r4, 0x1 + bgt _0806A30E +_0806A306: + cmp r4, 0 + bne _0806A30C + b _0806A50E +_0806A30C: + b _0806A510 +_0806A30E: + cmp r4, 0x2 + bne _0806A314 + b _0806A502 +_0806A314: + cmp r4, 0x3 + beq _0806A31A + b _0806A510 +_0806A31A: + b _0806A4FC +_0806A31C: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A326 + b _0806A508 +_0806A326: + cmp r4, 0x1 + ble _0806A306 +_0806A32A: + cmp r4, 0x2 + bne _0806A330 + b _0806A4FC +_0806A330: + cmp r4, 0x3 + beq _0806A336 + b _0806A510 +_0806A336: + b _0806A502 +_0806A338: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A342 + b _0806A502 +_0806A342: + cmp r4, 0x1 + ble _0806A306 + cmp r4, 0x2 + bne _0806A34C + b _0806A508 +_0806A34C: + b _0806A314 +_0806A34E: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A358 + b _0806A4FC +_0806A358: + cmp r4, 0x1 + ble _0806A306 + cmp r4, 0x2 + bne _0806A362 + b _0806A508 +_0806A362: + b _0806A330 +_0806A364: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A36E + b _0806A502 +_0806A36E: + cmp r4, 0x1 + ble _0806A306 +_0806A372: + cmp r4, 0x2 + bne _0806A378 + b _0806A4FC +_0806A378: + cmp r4, 0x3 + beq _0806A37E + b _0806A510 +_0806A37E: + b _0806A508 +_0806A380: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A38A + b _0806A4FC +_0806A38A: + cmp r4, 0x1 + ble _0806A306 + cmp r4, 0x2 + bne _0806A394 + b _0806A502 +_0806A394: + b _0806A378 +_0806A396: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A3A0 + b _0806A50E +_0806A3A0: + cmp r4, 0x1 + bgt _0806A30E +_0806A3A4: + cmp r4, 0 + bne _0806A3AA + b _0806A508 +_0806A3AA: + b _0806A510 +_0806A3AC: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A3B6 + b _0806A50E +_0806A3B6: + cmp r4, 0x1 + ble _0806A3A4 + b _0806A32A +_0806A3BC: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A3C6 + b _0806A50E +_0806A3C6: + cmp r4, 0x1 + bgt _0806A3D2 +_0806A3CA: + cmp r4, 0 + bne _0806A3D0 + b _0806A502 +_0806A3D0: + b _0806A510 +_0806A3D2: + cmp r4, 0x2 + bne _0806A3D8 + b _0806A508 +_0806A3D8: + b _0806A314 +_0806A3DA: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A3E4 + b _0806A50E +_0806A3E4: + cmp r4, 0x1 + bgt _0806A3EA + b _0806A4EC +_0806A3EA: + cmp r4, 0x2 + bne _0806A3F0 + b _0806A508 +_0806A3F0: + b _0806A330 +_0806A3F2: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A3FC + b _0806A50E +_0806A3FC: + cmp r4, 0x1 + ble _0806A3CA + b _0806A372 +_0806A402: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + bne _0806A40C + b _0806A50E +_0806A40C: + cmp r4, 0x1 + ble _0806A4EC + cmp r4, 0x2 + beq _0806A502 + b _0806A378 +_0806A416: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A502 + cmp r4, 0x1 + ble _0806A3A4 + cmp r4, 0x2 + beq _0806A50E + b _0806A314 +_0806A428: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A4FC + cmp r4, 0x1 + ble _0806A3A4 + cmp r4, 0x2 + beq _0806A50E + b _0806A330 +_0806A43A: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A508 + cmp r4, 0x1 + ble _0806A3CA + cmp r4, 0x2 + beq _0806A50E + b _0806A314 +_0806A44C: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A508 + cmp r4, 0x1 + ble _0806A4EC + cmp r4, 0x2 + beq _0806A50E + b _0806A330 +_0806A45E: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A4FC + cmp r4, 0x1 + ble _0806A3CA + cmp r4, 0x2 + beq _0806A50E + b _0806A378 +_0806A470: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A502 + cmp r4, 0x1 + ble _0806A4EC + cmp r4, 0x2 + beq _0806A50E + b _0806A378 +_0806A482: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A502 + cmp r4, 0x1 + ble _0806A3A4 +_0806A48E: + cmp r4, 0x2 + beq _0806A4FC +_0806A492: + cmp r4, 0x3 + bne _0806A510 + b _0806A50E +_0806A498: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A4FC + cmp r4, 0x1 + bgt _0806A4A6 + b _0806A3A4 +_0806A4A6: + cmp r4, 0x2 + beq _0806A502 + b _0806A492 +_0806A4AC: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A508 + cmp r4, 0x1 + ble _0806A3CA + b _0806A48E +_0806A4BA: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A508 + cmp r4, 0x1 + ble _0806A4EC + cmp r4, 0x2 + beq _0806A502 + b _0806A492 +_0806A4CC: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A4FC + cmp r4, 0x1 + bgt _0806A4DA + b _0806A3CA +_0806A4DA: + cmp r4, 0x2 + beq _0806A508 + b _0806A492 +_0806A4E0: + adds r0, r5, 0 + adds r0, 0x20 + cmp r4, 0x1 + beq _0806A502 + cmp r4, 0x1 + bgt _0806A4F2 +_0806A4EC: + cmp r4, 0 + beq _0806A4FC + b _0806A510 +_0806A4F2: + cmp r4, 0x2 + beq _0806A508 + cmp r4, 0x3 + beq _0806A50E + b _0806A510 +_0806A4FC: + adds r6, r5, 0 + adds r6, 0x44 + b _0806A510 +_0806A502: + adds r6, r5, 0 + adds r6, 0x38 + b _0806A510 +_0806A508: + adds r6, r5, 0 + adds r6, 0x2C + b _0806A510 +_0806A50E: + adds r6, r0, 0 +_0806A510: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end pokemon_data_permutator + + thumb_func_start pokemon_getattr +@ int pokemon_getattr(pokemon *mon, enum pokemon_data_request req, void *data) +pokemon_getattr: @ 806A518 + push {r4,lr} + adds r4, r0, 0 + adds r3, r1, 0 + adds r0, r3, 0 + subs r0, 0x37 + cmp r0, 0x21 + bls _0806A528 + b _0806A666 +_0806A528: + lsls r0, 2 + ldr r1, =_0806A538 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806A538: + .4byte _0806A5C0 + .4byte _0806A5C4 + .4byte _0806A5CC + .4byte _0806A5D4 + .4byte _0806A5DC + .4byte _0806A5EE + .4byte _0806A600 + .4byte _0806A612 + .4byte _0806A624 + .4byte _0806A65E + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A666 + .4byte _0806A636 + .4byte _0806A63E + .4byte _0806A646 + .4byte _0806A64E + .4byte _0806A656 +_0806A5C0: + ldr r0, [r4, 0x50] + b _0806A66E +_0806A5C4: + adds r0, r4, 0 + adds r0, 0x54 + ldrb r0, [r0] + b _0806A66E +_0806A5CC: + adds r0, r4, 0 + adds r0, 0x56 + ldrh r0, [r0] + b _0806A66E +_0806A5D4: + adds r0, r4, 0 + adds r0, 0x58 + ldrh r0, [r0] + b _0806A66E +_0806A5DC: + adds r0, r4, 0 + movs r1, 0x1 + bl get_pokemon_data_3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _0806A66E + b _0806A636 +_0806A5EE: + adds r0, r4, 0 + movs r1, 0x2 + bl get_pokemon_data_3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _0806A66E + b _0806A63E +_0806A600: + adds r0, r4, 0 + movs r1, 0x3 + bl get_pokemon_data_3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _0806A66E + b _0806A646 +_0806A612: + adds r0, r4, 0 + movs r1, 0x4 + bl get_pokemon_data_3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _0806A66E + b _0806A64E +_0806A624: + adds r0, r4, 0 + movs r1, 0x5 + bl get_pokemon_data_3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _0806A66E + b _0806A656 +_0806A636: + adds r0, r4, 0 + adds r0, 0x5A + ldrh r0, [r0] + b _0806A66E +_0806A63E: + adds r0, r4, 0 + adds r0, 0x5C + ldrh r0, [r0] + b _0806A66E +_0806A646: + adds r0, r4, 0 + adds r0, 0x5E + ldrh r0, [r0] + b _0806A66E +_0806A64E: + adds r0, r4, 0 + adds r0, 0x60 + ldrh r0, [r0] + b _0806A66E +_0806A656: + adds r0, r4, 0 + adds r0, 0x62 + ldrh r0, [r0] + b _0806A66E +_0806A65E: + adds r0, r4, 0 + adds r0, 0x55 + ldrb r0, [r0] + b _0806A66E +_0806A666: + adds r0, r4, 0 + adds r1, r3, 0 + bl pokemon_getattr_encrypted +_0806A66E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end pokemon_getattr + + thumb_func_start pokemon_getattr_encrypted +@ int pokemon_getattr_encrypted(pokemon *mon, enum pokemon_data_request req, void *data) +pokemon_getattr_encrypted: @ 806A674 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r0 + str r1, [sp] + adds r6, r2, 0 + movs r4, 0 + mov r9, r4 + mov r10, r4 + movs r7, 0 + movs r5, 0 + cmp r1, 0xA + ble _0806A6F2 + ldr r1, [r0] + movs r2, 0 + bl pokemon_data_permutator + mov r9, r0 + mov r0, r8 + ldr r1, [r0] + movs r2, 0x1 + bl pokemon_data_permutator + mov r10, r0 + mov r2, r8 + ldr r1, [r2] + mov r0, r8 + movs r2, 0x2 + bl pokemon_data_permutator + adds r7, r0, 0 + mov r0, r8 + ldr r1, [r0] + movs r2, 0x3 + bl pokemon_data_permutator + adds r5, r0, 0 + mov r0, r8 + bl pokemon_decrypt + mov r0, r8 + bl pokemon_calc_checksum + lsls r0, 16 + lsrs r0, 16 + mov r1, r8 + ldrh r1, [r1, 0x1C] + cmp r0, r1 + beq _0806A6F2 + mov r2, r8 + ldrb r0, [r2, 0x13] + movs r1, 0x1 + orrs r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x13] + ldrb r0, [r5, 0x7] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r5, 0x7] +_0806A6F2: + ldr r0, [sp] + cmp r0, 0x53 + bls _0806A6FA + b _0806AC8C +_0806A6FA: + lsls r0, 2 + ldr r1, =_0806A708 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806A708: + .4byte _0806A858 + .4byte _0806A85E + .4byte _0806A864 + .4byte _0806A918 + .4byte _0806A91E + .4byte _0806A924 + .4byte _0806A92A + .4byte _0806A930 + .4byte _0806A94C + .4byte _0806A952 + .4byte _0806A958 + .4byte _0806A95E + .4byte _0806A976 + .4byte _0806A98E + .4byte _0806A98E + .4byte _0806A98E + .4byte _0806A98E + .4byte _0806A99A + .4byte _0806A99A + .4byte _0806A99A + .4byte _0806A99A + .4byte _0806A982 + .4byte _0806A9BC + .4byte _0806A9C0 + .4byte _0806A9C4 + .4byte _0806A97C + .4byte _0806A9A4 + .4byte _0806A9A8 + .4byte _0806A9AC + .4byte _0806A9B0 + .4byte _0806A9B4 + .4byte _0806A9B8 + .4byte _0806A988 + .4byte _0806A9C8 + .4byte _0806A9D4 + .4byte _0806A9D8 + .4byte _0806A9DC + .4byte _0806A9E4 + .4byte _0806A9EC + .4byte _0806A9F6 + .4byte _0806A9FE + .4byte _0806AA06 + .4byte _0806AA0E + .4byte _0806AA16 + .4byte _0806AA1E + .4byte _0806AA26 + .4byte _0806AA2A + .4byte _0806A9CC + .4byte _0806A9D0 + .4byte _0806A9F0 + .4byte _0806AA30 + .4byte _0806AA38 + .4byte _0806AA40 + .4byte _0806AA48 + .4byte _0806AA50 + .4byte _0806AC8C + .4byte _0806AC8C + .4byte _0806AC8C + .4byte _0806AC8C + .4byte _0806AC8C + .4byte _0806AC8C + .4byte _0806AC8C + .4byte _0806AC8C + .4byte _0806AC8C + .4byte _0806AC8C + .4byte _0806AAB6 + .4byte _0806AADC + .4byte _0806AA58 + .4byte _0806AA5E + .4byte _0806AA62 + .4byte _0806AA66 + .4byte _0806AA6A + .4byte _0806AA72 + .4byte _0806AA7A + .4byte _0806AA82 + .4byte _0806AA8A + .4byte _0806AA90 + .4byte _0806AA98 + .4byte _0806AAA0 + .4byte _0806AAA8 + .4byte _0806AAB0 + .4byte _0806AB16 + .4byte _0806AB70 + .4byte _0806ABF2 +_0806A858: + mov r1, r8 + ldr r4, [r1] + b _0806AC8C +_0806A85E: + mov r2, r8 + ldr r4, [r2, 0x4] + b _0806AC8C +_0806A864: + mov r0, r8 + ldrb r1, [r0, 0x13] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0806A89C + movs r4, 0 + ldr r0, =gUnknown_085CCB90 + ldrb r1, [r0] + adds r2, r0, 0 + cmp r1, 0xFF + beq _0806A944 + adds r3, r2, 0 +_0806A87E: + adds r0, r6, r4 + adds r1, r4, r3 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x9 + bhi _0806A944 + adds r0, r4, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _0806A87E + b _0806A944 + .pool +_0806A89C: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0806A8BC + ldr r1, =gUnknown_085E8264 + adds r0, r6, 0 + bl CopyString + adds r0, r6, 0 + bl GetStringLength + lsls r0, 16 + lsrs r4, r0, 16 + b _0806AC8C + .pool +_0806A8BC: + mov r1, r8 + ldrb r0, [r1, 0x12] + cmp r0, 0x1 + bne _0806A902 + movs r0, 0xFC + strb r0, [r6] + movs r0, 0x15 + strb r0, [r6, 0x1] + movs r4, 0x2 + movs r3, 0 + ldrb r0, [r1, 0x8] + cmp r0, 0xFF + beq _0806A8F0 + mov r2, r8 + adds r2, 0x8 +_0806A8DA: + adds r1, r6, r4 + ldrb r0, [r2] + strb r0, [r1] + adds r4, 0x1 + adds r2, 0x1 + adds r3, 0x1 + cmp r3, 0x4 + bgt _0806A8F0 + ldrb r0, [r2] + cmp r0, 0xFF + bne _0806A8DA +_0806A8F0: + adds r1, r6, r4 + movs r0, 0xFC + strb r0, [r1] + adds r4, 0x1 + adds r1, r6, r4 + movs r0, 0x16 + strb r0, [r1] + adds r4, 0x1 + b _0806A944 +_0806A902: + movs r4, 0 + mov r2, r8 + adds r2, 0x8 +_0806A908: + adds r0, r6, r4 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x9 + bls _0806A908 + b _0806A944 +_0806A918: + mov r2, r8 + ldrb r4, [r2, 0x12] + b _0806AC8C +_0806A91E: + mov r6, r8 + ldrb r0, [r6, 0x13] + b _0806AA92 +_0806A924: + mov r1, r8 + ldrb r0, [r1, 0x13] + b _0806AA9A +_0806A92A: + mov r2, r8 + ldrb r0, [r2, 0x13] + b _0806AAA2 +_0806A930: + movs r4, 0 + mov r2, r8 + adds r2, 0x14 +_0806A936: + adds r0, r6, r4 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x6 + bls _0806A936 +_0806A944: + adds r1, r6, r4 + movs r0, 0xFF + strb r0, [r1] + b _0806AC8C +_0806A94C: + mov r6, r8 + ldrb r4, [r6, 0x1B] + b _0806AC8C +_0806A952: + mov r0, r8 + ldrh r4, [r0, 0x1C] + b _0806AC8C +_0806A958: + mov r1, r8 + ldrh r4, [r1, 0x1E] + b _0806AC8C +_0806A95E: + mov r2, r8 + ldrb r1, [r2, 0x13] + movs r0, 0x1 + ands r0, r1 + movs r4, 0xCE + lsls r4, 1 + cmp r0, 0 + beq _0806A970 + b _0806AC8C +_0806A970: + mov r6, r9 + ldrh r4, [r6] + b _0806AC8C +_0806A976: + mov r0, r9 + ldrh r4, [r0, 0x2] + b _0806AC8C +_0806A97C: + mov r1, r9 + ldr r4, [r1, 0x4] + b _0806AC8C +_0806A982: + mov r2, r9 + ldrb r4, [r2, 0x8] + b _0806AC8C +_0806A988: + mov r6, r9 + ldrb r4, [r6, 0x9] + b _0806AC8C +_0806A98E: + ldr r0, [sp] + subs r0, 0xD + lsls r0, 1 + add r0, r10 + ldrh r4, [r0] + b _0806AC8C +_0806A99A: + ldr r0, [sp] + add r0, r10 + subs r0, 0x9 + ldrb r4, [r0] + b _0806AC8C +_0806A9A4: + ldrb r4, [r7] + b _0806AC8C +_0806A9A8: + ldrb r4, [r7, 0x1] + b _0806AC8C +_0806A9AC: + ldrb r4, [r7, 0x2] + b _0806AC8C +_0806A9B0: + ldrb r4, [r7, 0x3] + b _0806AC8C +_0806A9B4: + ldrb r4, [r7, 0x4] + b _0806AC8C +_0806A9B8: + ldrb r4, [r7, 0x5] + b _0806AC8C +_0806A9BC: + ldrb r4, [r7, 0x6] + b _0806AC8C +_0806A9C0: + ldrb r4, [r7, 0x7] + b _0806AC8C +_0806A9C4: + ldrb r4, [r7, 0x8] + b _0806AC8C +_0806A9C8: + ldrb r4, [r7, 0x9] + b _0806AC8C +_0806A9CC: + ldrb r4, [r7, 0xA] + b _0806AC8C +_0806A9D0: + ldrb r4, [r7, 0xB] + b _0806AC8C +_0806A9D4: + ldrb r4, [r5] + b _0806AC8C +_0806A9D8: + ldrb r4, [r5, 0x1] + b _0806AC8C +_0806A9DC: + ldrb r0, [r5, 0x2] + lsls r0, 25 + lsrs r4, r0, 25 + b _0806AC8C +_0806A9E4: + ldrh r0, [r5, 0x2] + lsls r0, 21 + lsrs r4, r0, 28 + b _0806AC8C +_0806A9EC: + ldrb r0, [r5, 0x3] + b _0806AAAA +_0806A9F0: + ldrb r0, [r5, 0x3] + lsrs r4, r0, 7 + b _0806AC8C +_0806A9F6: + ldrb r0, [r5, 0x4] + lsls r0, 27 + lsrs r4, r0, 27 + b _0806AC8C +_0806A9FE: + ldrh r0, [r5, 0x4] + lsls r0, 22 + lsrs r4, r0, 27 + b _0806AC8C +_0806AA06: + ldrb r0, [r5, 0x5] + lsls r0, 25 + lsrs r4, r0, 27 + b _0806AC8C +_0806AA0E: + ldr r0, [r5, 0x4] + lsls r0, 12 + lsrs r4, r0, 27 + b _0806AC8C +_0806AA16: + ldrh r0, [r5, 0x6] + lsls r0, 23 + lsrs r4, r0, 27 + b _0806AC8C +_0806AA1E: + ldrb r0, [r5, 0x7] + lsls r0, 26 + lsrs r4, r0, 27 + b _0806AC8C +_0806AA26: + ldrb r0, [r5, 0x7] + b _0806AA84 +_0806AA2A: + ldrb r0, [r5, 0x7] + lsrs r4, r0, 7 + b _0806AC8C +_0806AA30: + ldrb r0, [r5, 0x8] + lsls r0, 29 + lsrs r4, r0, 29 + b _0806AC8C +_0806AA38: + ldrb r0, [r5, 0x8] + lsls r0, 26 + lsrs r4, r0, 29 + b _0806AC8C +_0806AA40: + ldrh r0, [r5, 0x8] + lsls r0, 23 + lsrs r4, r0, 29 + b _0806AC8C +_0806AA48: + ldrb r0, [r5, 0x9] + lsls r0, 28 + lsrs r4, r0, 29 + b _0806AC8C +_0806AA50: + ldrb r0, [r5, 0x9] + lsls r0, 25 + lsrs r4, r0, 29 + b _0806AC8C +_0806AA58: + ldrb r0, [r5, 0x9] + lsrs r4, r0, 7 + b _0806AC8C +_0806AA5E: + ldrb r0, [r5, 0xA] + b _0806AA92 +_0806AA62: + ldrb r0, [r5, 0xA] + b _0806AA9A +_0806AA66: + ldrb r0, [r5, 0xA] + b _0806AAA2 +_0806AA6A: + ldrb r0, [r5, 0xA] + lsls r0, 28 + lsrs r4, r0, 31 + b _0806AC8C +_0806AA72: + ldrb r0, [r5, 0xA] + lsls r0, 27 + lsrs r4, r0, 31 + b _0806AC8C +_0806AA7A: + ldrb r0, [r5, 0xA] + lsls r0, 26 + lsrs r4, r0, 31 + b _0806AC8C +_0806AA82: + ldrb r0, [r5, 0xA] +_0806AA84: + lsls r0, 25 + lsrs r4, r0, 31 + b _0806AC8C +_0806AA8A: + ldrb r0, [r5, 0xA] + lsrs r4, r0, 7 + b _0806AC8C +_0806AA90: + ldrb r0, [r5, 0xB] +_0806AA92: + lsls r0, 31 + lsrs r4, r0, 31 + b _0806AC8C +_0806AA98: + ldrb r0, [r5, 0xB] +_0806AA9A: + lsls r0, 30 + lsrs r4, r0, 31 + b _0806AC8C +_0806AAA0: + ldrb r0, [r5, 0xB] +_0806AAA2: + lsls r0, 29 + lsrs r4, r0, 31 + b _0806AC8C +_0806AAA8: + ldrb r0, [r5, 0xB] +_0806AAAA: + lsls r0, 25 + lsrs r4, r0, 28 + b _0806AC8C +_0806AAB0: + ldrb r0, [r5, 0xB] + lsrs r4, r0, 7 + b _0806AC8C +_0806AAB6: + mov r0, r9 + ldrh r4, [r0] + cmp r4, 0 + bne _0806AAC0 + b _0806AC8C +_0806AAC0: + ldrb r0, [r5, 0x7] + lsls r0, 25 + cmp r0, 0 + blt _0806AAD6 + mov r2, r8 + ldrb r1, [r2, 0x13] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0806AAD6 + b _0806AC8C +_0806AAD6: + movs r4, 0xCE + lsls r4, 1 + b _0806AC8C +_0806AADC: + ldrb r0, [r5, 0x4] + lsls r0, 27 + lsrs r4, r0, 27 + ldrh r1, [r5, 0x4] + movs r0, 0xF8 + lsls r0, 2 + ands r0, r1 + orrs r4, r0 + ldrb r0, [r5, 0x5] + lsls r0, 25 + lsrs r0, 27 + lsls r0, 10 + orrs r4, r0 + ldr r0, [r5, 0x4] + movs r1, 0xF8 + lsls r1, 12 + ands r0, r1 + orrs r4, r0 + ldrh r0, [r5, 0x6] + lsls r0, 23 + lsrs r0, 27 + lsls r0, 20 + orrs r4, r0 + ldrb r0, [r5, 0x7] + lsls r0, 26 + lsrs r0, 27 + lsls r0, 25 + orrs r4, r0 + b _0806AC8C +_0806AB16: + mov r1, r9 + ldrh r0, [r1] + cmp r0, 0 + bne _0806AB20 + b _0806AC8C +_0806AB20: + ldrb r0, [r5, 0x7] + lsls r0, 25 + cmp r0, 0 + bge _0806AB2A + b _0806AC8C +_0806AB2A: + ldrh r0, [r6] + ldr r1, =0x00000163 + cmp r0, r1 + bne _0806AB34 + b _0806AC8C +_0806AB34: + mov r2, r10 + ldrh r5, [r2] + adds r7, r1, 0 + adds r2, r6, 0 + ldr r1, =gUnknown_0832A328 +_0806AB3E: + ldrh r3, [r2] + cmp r5, r3 + beq _0806AB58 + mov r6, r10 + ldrh r0, [r6, 0x2] + cmp r0, r3 + beq _0806AB58 + ldrh r0, [r6, 0x4] + cmp r0, r3 + beq _0806AB58 + ldrh r0, [r6, 0x6] + cmp r0, r3 + bne _0806AB5C +_0806AB58: + ldr r0, [r1] + orrs r4, r0 +_0806AB5C: + adds r2, 0x2 + adds r1, 0x4 + ldrh r0, [r2] + cmp r0, r7 + bne _0806AB3E + b _0806AC8C + .pool +_0806AB70: + movs r4, 0 + mov r1, r9 + ldrh r0, [r1] + cmp r0, 0 + bne _0806AB7C + b _0806AC8C +_0806AB7C: + ldrb r0, [r5, 0x7] + lsls r0, 25 + cmp r0, 0 + bge _0806AB86 + b _0806AC8C +_0806AB86: + ldrb r0, [r5, 0x8] + lsls r1, r0, 29 + lsrs r4, r1, 29 + lsls r0, 26 + lsrs r0, 29 + adds r4, r0 + ldrh r0, [r5, 0x8] + lsls r0, 23 + lsrs r0, 29 + adds r4, r0 + ldrb r1, [r5, 0x9] + lsls r0, r1, 28 + lsrs r0, 29 + adds r4, r0 + lsls r0, r1, 25 + lsrs r0, 29 + adds r4, r0 + lsrs r1, 7 + adds r4, r1 + ldrb r1, [r5, 0xA] + lsls r0, r1, 31 + lsrs r0, 31 + adds r4, r0 + lsls r0, r1, 30 + lsrs r0, 31 + adds r4, r0 + lsls r0, r1, 29 + lsrs r0, 31 + adds r4, r0 + lsls r0, r1, 28 + lsrs r0, 31 + adds r4, r0 + lsls r0, r1, 27 + lsrs r0, 31 + adds r4, r0 + lsls r0, r1, 26 + lsrs r0, 31 + adds r4, r0 + lsls r0, r1, 25 + lsrs r0, 31 + adds r4, r0 + lsrs r1, 7 + adds r4, r1 + ldrb r1, [r5, 0xB] + lsls r0, r1, 31 + lsrs r0, 31 + adds r4, r0 + lsls r0, r1, 30 + lsrs r0, 31 + adds r4, r0 + lsls r1, 29 + lsrs r1, 31 + adds r4, r1 + b _0806AC8C +_0806ABF2: + movs r4, 0 + mov r2, r9 + ldrh r0, [r2] + cmp r0, 0 + beq _0806AC8C + ldrb r0, [r5, 0x7] + lsls r0, 25 + cmp r0, 0 + blt _0806AC8C + ldrb r2, [r5, 0x9] + lsrs r4, r2, 7 + ldrb r1, [r5, 0x8] + lsls r0, r1, 29 + lsrs r0, 28 + orrs r4, r0 + lsls r1, 26 + lsrs r1, 29 + lsls r1, 4 + orrs r4, r1 + ldrh r0, [r5, 0x8] + lsls r0, 23 + lsrs r0, 29 + lsls r0, 7 + orrs r4, r0 + lsls r0, r2, 28 + lsrs r0, 29 + lsls r0, 10 + orrs r4, r0 + lsls r2, 25 + lsrs r2, 29 + lsls r2, 13 + orrs r4, r2 + ldrb r1, [r5, 0xA] + lsls r0, r1, 31 + lsrs r0, 31 + lsls r0, 16 + orrs r4, r0 + lsls r0, r1, 30 + lsrs r0, 31 + lsls r0, 17 + orrs r4, r0 + lsls r0, r1, 29 + lsrs r0, 31 + lsls r0, 18 + orrs r4, r0 + lsls r0, r1, 28 + lsrs r0, 31 + lsls r0, 19 + orrs r4, r0 + lsls r0, r1, 27 + lsrs r0, 31 + lsls r0, 20 + orrs r4, r0 + lsls r0, r1, 26 + lsrs r0, 31 + lsls r0, 21 + orrs r4, r0 + lsls r0, r1, 25 + lsrs r0, 31 + lsls r0, 22 + orrs r4, r0 + lsrs r1, 7 + lsls r1, 23 + orrs r4, r1 + ldrb r1, [r5, 0xB] + lsls r0, r1, 31 + lsrs r0, 31 + lsls r0, 24 + orrs r4, r0 + lsls r0, r1, 30 + lsrs r0, 31 + lsls r0, 25 + orrs r4, r0 + lsls r1, 29 + lsrs r1, 31 + lsls r1, 26 + orrs r4, r1 +_0806AC8C: + ldr r6, [sp] + cmp r6, 0xA + ble _0806AC98 + mov r0, r8 + bl pokemon_encrypt +_0806AC98: + adds r0, r4, 0 + 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 pokemon_getattr_encrypted + + thumb_func_start pokemon_setattr +@ int pokemon_setattr(pokemon *mon, enum pokemon_data_request req, void *data) +pokemon_setattr: @ 806ACAC + push {lr} + adds r3, r0, 0 + adds r0, r1, 0 + subs r0, 0x37 + cmp r0, 0xA + bhi _0806AD90 + lsls r0, 2 + ldr r1, =_0806ACC8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806ACC8: + .4byte _0806ACF4 + .4byte _0806AD0C + .4byte _0806AD16 + .4byte _0806AD26 + .4byte _0806AD36 + .4byte _0806AD46 + .4byte _0806AD56 + .4byte _0806AD66 + .4byte _0806AD76 + .4byte _0806AD86 + .4byte _0806AD96 +_0806ACF4: + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x2] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 24 + adds r1, r0 + str r1, [r3, 0x50] + b _0806AD96 +_0806AD0C: + ldrb r1, [r2] + adds r0, r3, 0 + adds r0, 0x54 + strb r1, [r0] + b _0806AD96 +_0806AD16: + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + lsls r1, 8 + adds r0, r1 + adds r1, r3, 0 + adds r1, 0x56 + strh r0, [r1] + b _0806AD96 +_0806AD26: + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + lsls r1, 8 + adds r0, r1 + adds r1, r3, 0 + adds r1, 0x58 + strh r0, [r1] + b _0806AD96 +_0806AD36: + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + lsls r1, 8 + adds r0, r1 + adds r1, r3, 0 + adds r1, 0x5A + strh r0, [r1] + b _0806AD96 +_0806AD46: + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + lsls r1, 8 + adds r0, r1 + adds r1, r3, 0 + adds r1, 0x5C + strh r0, [r1] + b _0806AD96 +_0806AD56: + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + lsls r1, 8 + adds r0, r1 + adds r1, r3, 0 + adds r1, 0x5E + strh r0, [r1] + b _0806AD96 +_0806AD66: + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + lsls r1, 8 + adds r0, r1 + adds r1, r3, 0 + adds r1, 0x60 + strh r0, [r1] + b _0806AD96 +_0806AD76: + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + lsls r1, 8 + adds r0, r1 + adds r1, r3, 0 + adds r1, 0x62 + strh r0, [r1] + b _0806AD96 +_0806AD86: + ldrb r1, [r2] + adds r0, r3, 0 + adds r0, 0x55 + strb r1, [r0] + b _0806AD96 +_0806AD90: + adds r0, r3, 0 + bl pokemon_setattr_encrypted +_0806AD96: + pop {r0} + bx r0 + thumb_func_end pokemon_setattr + + thumb_func_start pokemon_setattr_encrypted +@ int pokemon_setattr_encrypted(pokemon *mon, enum pokemon_data_request req, void *data) +pokemon_setattr_encrypted: @ 806AD9C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r7, r0, 0 + mov r10, r1 + adds r4, r2, 0 + movs r0, 0 + mov r8, r0 + mov r9, r0 + movs r6, 0 + movs r5, 0 + cmp r1, 0xA + ble _0806AE1C + ldr r1, [r7] + adds r0, r7, 0 + movs r2, 0 + bl pokemon_data_permutator + mov r8, r0 + ldr r1, [r7] + adds r0, r7, 0 + movs r2, 0x1 + bl pokemon_data_permutator + mov r9, r0 + ldr r1, [r7] + adds r0, r7, 0 + movs r2, 0x2 + bl pokemon_data_permutator + adds r6, r0, 0 + ldr r1, [r7] + adds r0, r7, 0 + movs r2, 0x3 + bl pokemon_data_permutator + adds r5, r0, 0 + adds r0, r7, 0 + bl pokemon_decrypt + adds r0, r7, 0 + bl pokemon_calc_checksum + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r7, 0x1C] + cmp r0, r1 + beq _0806AE1C + ldrb r0, [r7, 0x13] + movs r1, 0x1 + orrs r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r7, 0x13] + ldrb r0, [r5, 0x7] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r5, 0x7] + adds r0, r7, 0 + bl pokemon_encrypt + b _0806B3EC +_0806AE1C: + mov r0, r10 + cmp r0, 0x50 + bls _0806AE24 + b _0806B3D8 +_0806AE24: + lsls r0, 2 + ldr r1, =_0806AE34 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806AE34: + .4byte _0806AF78 + .4byte _0806AF90 + .4byte _0806AFA8 + .4byte _0806AFBE + .4byte _0806AFC4 + .4byte _0806AFD4 + .4byte _0806AFE6 + .4byte _0806AFF8 + .4byte _0806B00E + .4byte _0806B014 + .4byte _0806B020 + .4byte _0806B02C + .4byte _0806B04C + .4byte _0806B084 + .4byte _0806B084 + .4byte _0806B084 + .4byte _0806B084 + .4byte _0806B098 + .4byte _0806B098 + .4byte _0806B098 + .4byte _0806B098 + .4byte _0806B074 + .4byte _0806B0C8 + .4byte _0806B0CE + .4byte _0806B0D4 + .4byte _0806B05A + .4byte _0806B0A4 + .4byte _0806B0AA + .4byte _0806B0B0 + .4byte _0806B0B6 + .4byte _0806B0BC + .4byte _0806B0C2 + .4byte _0806B07C + .4byte _0806B0DA + .4byte _0806B0EC + .4byte _0806B0F2 + .4byte _0806B0F8 + .4byte _0806B10C + .4byte _0806B124 + .4byte _0806B14A + .4byte _0806B15E + .4byte _0806B178 + .4byte _0806B18E + .4byte _0806B1A8 + .4byte _0806B1C0 + .4byte _0806B1D4 + .4byte _0806B204 + .4byte _0806B0E0 + .4byte _0806B0E6 + .4byte _0806B13A + .4byte _0806B214 + .4byte _0806B222 + .4byte _0806B238 + .4byte _0806B250 + .4byte _0806B260 + .4byte _0806B3D8 + .4byte _0806B3D8 + .4byte _0806B3D8 + .4byte _0806B3D8 + .4byte _0806B3D8 + .4byte _0806B3D8 + .4byte _0806B3D8 + .4byte _0806B3D8 + .4byte _0806B3D8 + .4byte _0806B3D8 + .4byte _0806B3D8 + .4byte _0806B35E + .4byte _0806B276 + .4byte _0806B286 + .4byte _0806B294 + .4byte _0806B2A4 + .4byte _0806B2B4 + .4byte _0806B2C4 + .4byte _0806B2D4 + .4byte _0806B2E4 + .4byte _0806B2FA + .4byte _0806B30A + .4byte _0806B318 + .4byte _0806B328 + .4byte _0806B338 + .4byte _0806B34E +_0806AF78: + ldrb r1, [r4] + ldrb r0, [r4, 0x1] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r4, 0x2] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r4, 0x3] + lsls r0, 24 + adds r1, r0 + str r1, [r7] + b _0806B3D8 +_0806AF90: + ldrb r1, [r4] + ldrb r0, [r4, 0x1] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r4, 0x2] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r4, 0x3] + lsls r0, 24 + adds r1, r0 + str r1, [r7, 0x4] + b _0806B3D8 +_0806AFA8: + movs r2, 0 + adds r3, r7, 0 + adds r3, 0x8 +_0806AFAE: + adds r0, r3, r2 + adds r1, r4, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x9 + ble _0806AFAE + b _0806B3D8 +_0806AFBE: + ldrb r0, [r4] + strb r0, [r7, 0x12] + b _0806B3D8 +_0806AFC4: + ldrb r0, [r4] + movs r1, 0x1 + ands r1, r0 + ldrb r2, [r7, 0x13] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + b _0806B1F2 +_0806AFD4: + ldrb r0, [r4] + movs r1, 0x1 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r7, 0x13] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + b _0806B1F2 +_0806AFE6: + ldrb r0, [r4] + movs r1, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r7, 0x13] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + b _0806B1F2 +_0806AFF8: + movs r2, 0 + adds r3, r7, 0 + adds r3, 0x14 +_0806AFFE: + adds r0, r3, r2 + adds r1, r4, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x6 + ble _0806AFFE + b _0806B3D8 +_0806B00E: + ldrb r0, [r4] + strb r0, [r7, 0x1B] + b _0806B3D8 +_0806B014: + ldrb r1, [r4] + ldrb r0, [r4, 0x1] + lsls r0, 8 + adds r1, r0 + strh r1, [r7, 0x1C] + b _0806B3D8 +_0806B020: + ldrb r1, [r4] + ldrb r0, [r4, 0x1] + lsls r0, 8 + adds r1, r0 + strh r1, [r7, 0x1E] + b _0806B3D8 +_0806B02C: + ldrb r1, [r4] + ldrb r0, [r4, 0x1] + lsls r0, 8 + adds r1, r0 + mov r0, r8 + strh r1, [r0] + lsls r1, 16 + cmp r1, 0 + beq _0806B044 + ldrb r0, [r7, 0x13] + movs r1, 0x2 + b _0806B1F2 +_0806B044: + ldrb r1, [r7, 0x13] + movs r0, 0x3 + negs r0, r0 + b _0806B1FE +_0806B04C: + ldrb r1, [r4] + ldrb r0, [r4, 0x1] + lsls r0, 8 + adds r1, r0 + mov r0, r8 + strh r1, [r0, 0x2] + b _0806B3D8 +_0806B05A: + ldrb r1, [r4] + ldrb r0, [r4, 0x1] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r4, 0x2] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r4, 0x3] + lsls r0, 24 + adds r1, r0 + mov r0, r8 + str r1, [r0, 0x4] + b _0806B3D8 +_0806B074: + ldrb r0, [r4] + mov r1, r8 + strb r0, [r1, 0x8] + b _0806B3D8 +_0806B07C: + ldrb r0, [r4] + mov r1, r8 + strb r0, [r1, 0x9] + b _0806B3D8 +_0806B084: + mov r2, r10 + subs r2, 0xD + lsls r2, 1 + add r2, r9 + ldrb r1, [r4] + ldrb r0, [r4, 0x1] + lsls r0, 8 + adds r1, r0 + strh r1, [r2] + b _0806B3D8 +_0806B098: + mov r0, r9 + add r0, r10 + subs r0, 0x9 + ldrb r1, [r4] + strb r1, [r0] + b _0806B3D8 +_0806B0A4: + ldrb r0, [r4] + strb r0, [r6] + b _0806B3D8 +_0806B0AA: + ldrb r0, [r4] + strb r0, [r6, 0x1] + b _0806B3D8 +_0806B0B0: + ldrb r0, [r4] + strb r0, [r6, 0x2] + b _0806B3D8 +_0806B0B6: + ldrb r0, [r4] + strb r0, [r6, 0x3] + b _0806B3D8 +_0806B0BC: + ldrb r0, [r4] + strb r0, [r6, 0x4] + b _0806B3D8 +_0806B0C2: + ldrb r0, [r4] + strb r0, [r6, 0x5] + b _0806B3D8 +_0806B0C8: + ldrb r0, [r4] + strb r0, [r6, 0x6] + b _0806B3D8 +_0806B0CE: + ldrb r0, [r4] + strb r0, [r6, 0x7] + b _0806B3D8 +_0806B0D4: + ldrb r0, [r4] + strb r0, [r6, 0x8] + b _0806B3D8 +_0806B0DA: + ldrb r0, [r4] + strb r0, [r6, 0x9] + b _0806B3D8 +_0806B0E0: + ldrb r0, [r4] + strb r0, [r6, 0xA] + b _0806B3D8 +_0806B0E6: + ldrb r0, [r4] + strb r0, [r6, 0xB] + b _0806B3D8 +_0806B0EC: + ldrb r0, [r4] + strb r0, [r5] + b _0806B3D8 +_0806B0F2: + ldrb r0, [r4] + strb r0, [r5, 0x1] + b _0806B3D8 +_0806B0F8: + ldrb r1, [r4] + movs r0, 0x7F + ands r1, r0 + ldrb r2, [r5, 0x2] + movs r0, 0x80 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x2] + b _0806B3D8 +_0806B10C: + ldrb r1, [r4] + movs r0, 0xF + ands r1, r0 + lsls r1, 7 + ldrh r2, [r5, 0x2] + ldr r0, =0xfffff87f + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x2] + b _0806B3D8 + .pool +_0806B124: + ldrb r1, [r4] + movs r0, 0xF + ands r1, r0 + lsls r1, 3 + ldrb r2, [r5, 0x3] + movs r0, 0x79 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x3] + b _0806B3D8 +_0806B13A: + ldrb r0, [r4] + lsls r0, 7 + ldrb r2, [r5, 0x3] + movs r1, 0x7F + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0x3] + b _0806B3D8 +_0806B14A: + ldrb r1, [r4] + movs r0, 0x1F + ands r1, r0 + ldrb r2, [r5, 0x4] + movs r0, 0x20 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x4] + b _0806B3D8 +_0806B15E: + ldrb r1, [r4] + movs r0, 0x1F + ands r1, r0 + lsls r1, 5 + ldrh r2, [r5, 0x4] + ldr r0, =0xfffffc1f + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + b _0806B3D8 + .pool +_0806B178: + ldrb r1, [r4] + movs r0, 0x1F + ands r1, r0 + lsls r1, 2 + ldrb r2, [r5, 0x5] + movs r0, 0x7D + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + b _0806B3D8 +_0806B18E: + ldrb r2, [r4] + movs r0, 0x1F + ands r2, r0 + lsls r2, 15 + ldr r0, [r5, 0x4] + ldr r1, =0xfff07fff + ands r0, r1 + orrs r0, r2 + str r0, [r5, 0x4] + b _0806B3D8 + .pool +_0806B1A8: + ldrb r1, [r4] + movs r0, 0x1F + ands r1, r0 + lsls r1, 4 + ldrh r2, [r5, 0x6] + ldr r0, =0xfffffe0f + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x6] + b _0806B3D8 + .pool +_0806B1C0: + ldrb r1, [r4] + movs r0, 0x1F + ands r1, r0 + lsls r1, 1 + ldrb r2, [r5, 0x7] + movs r0, 0x3F + negs r0, r0 + ands r0, r2 + orrs r0, r1 + b _0806B3D6 +_0806B1D4: + ldrb r1, [r4] + movs r0, 0x1 + ands r1, r0 + lsls r1, 6 + ldrb r2, [r5, 0x7] + movs r0, 0x41 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x7] + lsls r0, 25 + cmp r0, 0 + bge _0806B1F8 + ldrb r0, [r7, 0x13] + movs r1, 0x4 +_0806B1F2: + orrs r0, r1 + strb r0, [r7, 0x13] + b _0806B3D8 +_0806B1F8: + ldrb r1, [r7, 0x13] + movs r0, 0x5 + negs r0, r0 +_0806B1FE: + ands r0, r1 + strb r0, [r7, 0x13] + b _0806B3D8 +_0806B204: + ldrb r0, [r4] + lsls r0, 7 + ldrb r2, [r5, 0x7] + movs r1, 0x7F + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0x7] + b _0806B3D8 +_0806B214: + ldrb r1, [r4] + movs r0, 0x7 + ands r1, r0 + ldrb r2, [r5, 0x8] + movs r0, 0x8 + negs r0, r0 + b _0806B230 +_0806B222: + ldrb r1, [r4] + movs r0, 0x7 + ands r1, r0 + lsls r1, 3 + ldrb r2, [r5, 0x8] + movs r0, 0x39 + negs r0, r0 +_0806B230: + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x8] + b _0806B3D8 +_0806B238: + ldrb r1, [r4] + movs r0, 0x7 + ands r1, r0 + lsls r1, 6 + ldrh r2, [r5, 0x8] + ldr r0, =0xfffffe3f + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x8] + b _0806B3D8 + .pool +_0806B250: + ldrb r1, [r4] + movs r0, 0x7 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r5, 0x9] + movs r0, 0xF + negs r0, r0 + b _0806B26E +_0806B260: + ldrb r1, [r4] + movs r0, 0x7 + ands r1, r0 + lsls r1, 4 + ldrb r2, [r5, 0x9] + movs r0, 0x71 + negs r0, r0 +_0806B26E: + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x9] + b _0806B3D8 +_0806B276: + ldrb r0, [r4] + lsls r0, 7 + ldrb r2, [r5, 0x9] + movs r1, 0x7F + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0x9] + b _0806B3D8 +_0806B286: + ldrb r1, [r4] + movs r0, 0x1 + ands r1, r0 + ldrb r2, [r5, 0xA] + movs r0, 0x2 + negs r0, r0 + b _0806B2F2 +_0806B294: + ldrb r1, [r4] + movs r0, 0x1 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r5, 0xA] + movs r0, 0x3 + negs r0, r0 + b _0806B2F2 +_0806B2A4: + ldrb r1, [r4] + movs r0, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r5, 0xA] + movs r0, 0x5 + negs r0, r0 + b _0806B2F2 +_0806B2B4: + ldrb r1, [r4] + movs r0, 0x1 + ands r1, r0 + lsls r1, 3 + ldrb r2, [r5, 0xA] + movs r0, 0x9 + negs r0, r0 + b _0806B2F2 +_0806B2C4: + ldrb r1, [r4] + movs r0, 0x1 + ands r1, r0 + lsls r1, 4 + ldrb r2, [r5, 0xA] + movs r0, 0x11 + negs r0, r0 + b _0806B2F2 +_0806B2D4: + ldrb r1, [r4] + movs r0, 0x1 + ands r1, r0 + lsls r1, 5 + ldrb r2, [r5, 0xA] + movs r0, 0x21 + negs r0, r0 + b _0806B2F2 +_0806B2E4: + ldrb r1, [r4] + movs r0, 0x1 + ands r1, r0 + lsls r1, 6 + ldrb r2, [r5, 0xA] + movs r0, 0x41 + negs r0, r0 +_0806B2F2: + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0xA] + b _0806B3D8 +_0806B2FA: + ldrb r0, [r4] + lsls r0, 7 + ldrb r2, [r5, 0xA] + movs r1, 0x7F + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0xA] + b _0806B3D8 +_0806B30A: + ldrb r1, [r4] + movs r0, 0x1 + ands r1, r0 + ldrb r2, [r5, 0xB] + movs r0, 0x2 + negs r0, r0 + b _0806B346 +_0806B318: + ldrb r1, [r4] + movs r0, 0x1 + ands r1, r0 + lsls r1, 1 + ldrb r2, [r5, 0xB] + movs r0, 0x3 + negs r0, r0 + b _0806B346 +_0806B328: + ldrb r1, [r4] + movs r0, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r5, 0xB] + movs r0, 0x5 + negs r0, r0 + b _0806B346 +_0806B338: + ldrb r1, [r4] + movs r0, 0xF + ands r1, r0 + lsls r1, 3 + ldrb r2, [r5, 0xB] + movs r0, 0x79 + negs r0, r0 +_0806B346: + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0xB] + b _0806B3D8 +_0806B34E: + ldrb r0, [r4] + lsls r0, 7 + ldrb r2, [r5, 0xB] + movs r1, 0x7F + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0xB] + b _0806B3D8 +_0806B35E: + ldrb r3, [r4] + ldrb r0, [r4, 0x1] + lsls r0, 8 + orrs r3, r0 + ldrb r0, [r4, 0x2] + lsls r0, 16 + orrs r3, r0 + ldrb r0, [r4, 0x3] + lsls r0, 24 + orrs r3, r0 + movs r4, 0x1F + adds r1, r3, 0 + ands r1, r4 + ldrb r2, [r5, 0x4] + movs r0, 0x20 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x4] + lsrs r1, r3, 5 + ands r1, r4 + lsls r1, 5 + ldrh r2, [r5, 0x4] + ldr r0, =0xfffffc1f + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + lsrs r1, r3, 10 + ands r1, r4 + lsls r1, 2 + ldrb r2, [r5, 0x5] + movs r0, 0x7D + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + lsrs r1, r3, 15 + ands r1, r4 + lsls r1, 15 + ldr r0, [r5, 0x4] + ldr r2, =0xfff07fff + ands r0, r2 + orrs r0, r1 + str r0, [r5, 0x4] + lsrs r1, r3, 20 + ands r1, r4 + lsls r1, 4 + ldrh r2, [r5, 0x6] + ldr r0, =0xfffffe0f + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x6] + lsrs r3, 25 + ands r3, r4 + lsls r3, 1 + ldrb r1, [r5, 0x7] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + orrs r0, r3 +_0806B3D6: + strb r0, [r5, 0x7] +_0806B3D8: + mov r0, r10 + cmp r0, 0xA + ble _0806B3EC + adds r0, r7, 0 + bl pokemon_calc_checksum + strh r0, [r7, 0x1C] + adds r0, r7, 0 + bl pokemon_encrypt +_0806B3EC: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end pokemon_setattr_encrypted + + thumb_func_start memcpy_pokemon +@ void *memcpy_pokemon(void *dest, void *src, unsigned int size) +memcpy_pokemon: @ 806B408 + push {lr} + bl memcpy + pop {r0} + bx r0 + thumb_func_end memcpy_pokemon + + thumb_func_start pokemon_catch +@ int pokemon_catch(pokemon *mon) +pokemon_catch: @ 806B414 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r4, =0x03005d90 + ldr r2, [r4] + movs r1, 0x7 + bl pokemon_setattr + ldr r2, [r4] + adds r2, 0x8 + adds r0, r6, 0 + movs r1, 0x31 + bl pokemon_setattr + ldr r2, [r4] + adds r2, 0xA + adds r0, r6, 0 + movs r1, 0x1 + bl pokemon_setattr + movs r5, 0 + b _0806B446 + .pool +_0806B444: + adds r5, 0x1 +_0806B446: + cmp r5, 0x5 + bgt _0806B480 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0806B444 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x64 + bl memcpy_pokemon + ldr r1, =0x020244e9 + adds r0, r5, 0x1 + strb r0, [r1] + movs r0, 0 + b _0806B48A + .pool +_0806B480: + adds r0, r6, 0 + bl pokemon_add_to_pc + lsls r0, 24 + lsrs r0, 24 +_0806B48A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end pokemon_catch + + thumb_func_start pokemon_add_to_pc +@ int pokemon_add_to_pc(pokemon *mon) +pokemon_add_to_pc: @ 806B490 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + ldr r0, =0x00004036 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + bl set_unknown_box_id + bl get_preferred_box + lsls r0, 24 + lsrs r5, r0, 24 +_0806B4AE: + movs r6, 0 + lsls r7, r5, 24 +_0806B4B2: + lsls r1, r6, 24 + lsrs r1, 24 + lsrs r0, r7, 24 + bl get_pokemon_by_box_and_pos + adds r4, r0, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _0806B514 + mov r0, r8 + bl sub_806E924 + adds r0, r4, 0 + mov r1, r8 + movs r2, 0x50 + bl memcpy_pokemon + ldr r0, =0x020375f6 + strh r5, [r0] + ldr r0, =0x020375f8 + strh r6, [r0] + bl get_unknown_box_id + lsls r0, 16 + lsrs r0, 16 + cmp r0, r5 + beq _0806B4F4 + ldr r0, =0x000008d7 + bl FlagReset +_0806B4F4: + lsls r1, r5, 16 + ldr r0, =0x00004036 + lsrs r1, 16 + bl VarSet + movs r0, 0x1 + b _0806B530 + .pool +_0806B514: + adds r6, 0x1 + cmp r6, 0x1D + ble _0806B4B2 + adds r5, 0x1 + cmp r5, 0xE + bne _0806B522 + movs r5, 0 +_0806B522: + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bne _0806B4AE + movs r0, 0x2 +_0806B530: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end pokemon_add_to_pc + + thumb_func_start calc_player_party_count +@ u8 calc_player_party_count() +calc_player_party_count: @ 806B53C + push {r4,lr} + ldr r0, =0x020244e9 + movs r1, 0 + strb r1, [r0] + b _0806B554 + .pool +_0806B54C: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + adds r0, r4, 0 +_0806B554: + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0x5 + bhi _0806B572 + adds r1, r0, 0 + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0806B54C +_0806B572: + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end calc_player_party_count + + thumb_func_start calc_enemy_party_count +@ u8 calc_enemy_party_count() +calc_enemy_party_count: @ 806B580 + push {r4,lr} + ldr r0, =0x020244ea + movs r1, 0 + strb r1, [r0] + b _0806B598 + .pool +_0806B590: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + adds r0, r4, 0 +_0806B598: + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0x5 + bhi _0806B5B6 + adds r1, r0, 0 + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0806B590 +_0806B5B6: + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end calc_enemy_party_count + + thumb_func_start sub_806B5C4 +sub_806B5C4: @ 806B5C4 + push {r4-r6,lr} + movs r6, 0 + bl calc_player_party_count + ldr r1, =0x020244e9 + ldrb r0, [r1] + cmp r0, 0x1 + beq _0806B628 + movs r5, 0 + ldrb r1, [r1] + cmp r6, r1 + bge _0806B620 +_0806B5DC: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _0806B616 + adds r0, r4, 0 + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _0806B616 + adds r0, r4, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _0806B616 + adds r6, 0x1 +_0806B616: + adds r5, 0x1 + ldr r0, =0x020244e9 + ldrb r0, [r0] + cmp r5, r0 + blt _0806B5DC +_0806B620: + movs r0, 0 + cmp r6, 0x1 + bgt _0806B628 + movs r0, 0x2 +_0806B628: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806B5C4 + + thumb_func_start CheckPlayerPartySize +@ u8 CheckPlayerPartySize() +CheckPlayerPartySize: @ 806B638 + push {r4-r6,lr} + movs r6, 0 + movs r5, 0 +_0806B63E: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + beq _0806B670 + cmp r1, 0 + beq _0806B670 + adds r0, r4, 0 + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _0806B670 + adds r6, 0x1 +_0806B670: + adds r5, 0x1 + cmp r5, 0x5 + ble _0806B63E + cmp r6, 0x1 + bne _0806B684 + movs r0, 0x1 + b _0806B68C + .pool +_0806B684: + movs r0, 0 + cmp r6, 0x1 + bgt _0806B68C + movs r0, 0x2 +_0806B68C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end CheckPlayerPartySize + + thumb_func_start sub_806B694 +@ int sub_806B694(u16 a1, int a2) +sub_806B694: @ 806B694 + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 24 + cmp r1, 0 + beq _0806B6B8 + ldr r2, =0x0202420a + ldr r1, =gBaseStats + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x17] + b _0806B6C6 + .pool +_0806B6B8: + ldr r2, =0x0202420a + ldr r1, =gBaseStats + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x16] +_0806B6C6: + strb r0, [r2] + ldrb r0, [r2] + pop {r1} + bx r1 + .pool + thumb_func_end sub_806B694 + + thumb_func_start GetMonAbility +@ u8 GetMonAbility(pokemon *mon) +GetMonAbility: @ 806B6D8 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x2E + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_806B694 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end GetMonAbility + + thumb_func_start create_enemy_party +create_enemy_party: @ 806B70C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + adds r5, r0, 0 + bl zero_enemy_party_data + ldr r4, =0x020244a8 + ldr r0, [r4] + ldr r0, [r0] + adds r1, r5, 0 + movs r2, 0xA0 + bl memcpy + movs r0, 0 + mov r9, r0 +_0806B730: + ldr r1, =0x020244a8 + ldr r3, [r1] + ldr r2, [r3] + mov r4, r9 + lsls r7, r4, 1 + adds r0, r2, 0 + adds r0, 0x7C + adds r1, r0, r7 + ldrh r0, [r1] + adds r4, 0x1 + str r4, [sp, 0x10] + cmp r0, 0 + beq _0806B80A + movs r0, 0x64 + mov r6, r9 + muls r6, r0 + ldr r4, =0x02024744 + mov r8, r4 + adds r5, r6, r4 + ldrh r1, [r1] + adds r0, r2, 0 + adds r0, 0x94 + add r0, r9 + ldrb r2, [r0] + movs r0, 0x1 + str r0, [sp] + ldr r0, [r3] + mov r3, r9 + lsls r4, r3, 2 + adds r0, 0x34 + adds r0, r4 + ldr r0, [r0] + str r0, [sp, 0x4] + movs r0, 0x2 + str r0, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + adds r0, r5, 0 + movs r3, 0xF + bl create_pokemon_set_level + ldr r1, =0x020244a8 + ldr r0, [r1] + adds r1, r7, 0 + adds r1, 0x88 + ldr r2, [r0] + adds r2, r1 + adds r0, r5, 0 + movs r1, 0xC + bl pokemon_setattr + movs r5, 0 + mov r10, r4 + mov r7, r9 + adds r7, 0x9A + mov r4, r8 +_0806B7A0: + adds r1, r5, 0 + adds r1, 0x1A + ldr r2, =0x020244a8 + ldr r0, [r2] + ldr r2, [r0] + adds r2, r7 + adds r0, r6, r4 + bl pokemon_setattr + adds r5, 0x1 + cmp r5, 0x5 + ble _0806B7A0 + movs r5, 0 + movs r3, 0x64 + mov r0, r9 + muls r0, r3 + ldr r1, =0x02024744 + adds r7, r0, r1 + mov r4, r10 + lsls r0, r4, 1 + adds r6, r0, 0 + adds r6, 0x4C + adds r4, r0, 0 +_0806B7CE: + adds r1, r5, 0 + adds r1, 0xD + ldr r2, =0x020244a8 + ldr r0, [r2] + ldr r2, [r0] + adds r2, r6 + adds r0, r7, 0 + bl pokemon_setattr + adds r1, r5, 0 + adds r1, 0x11 + ldr r3, =0x020244a8 + ldr r0, [r3] + ldr r0, [r0] + adds r0, 0x4C + adds r0, r4 + ldrh r0, [r0] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + ldr r0, =gBattleMoves + 0x4 @ PP offset + adds r2, r0 + adds r0, r7, 0 + bl pokemon_setattr + adds r6, 0x2 + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _0806B7CE +_0806B80A: + ldr r4, [sp, 0x10] + mov r9, r4 + cmp r4, 0x5 + ble _0806B730 + 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 create_enemy_party + + thumb_func_start sub_806B830 +sub_806B830: @ 806B830 + push {r4,r5,lr} + ldr r5, =gUnknown_08329EB8 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r4, [r0] + ldrb r0, [r4, 0x9] + movs r1, 0x5 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + ldrb r2, [r4, 0x1] + lsls r2, 27 + lsrs r2, 31 + lsls r1, r2, 2 + adds r1, r2 + adds r0, r1 + adds r0, r5 + ldrb r0, [r0] + ldr r1, =gTrainerPicIndices + adds r0, r1 + ldrb r0, [r0] + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806B830 + + thumb_func_start sub_806B870 +sub_806B870: @ 806B870 + push {r4,r5,lr} + ldr r5, =gUnknown_08329EB8 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r4, [r0] + ldrb r0, [r4, 0x9] + movs r1, 0x5 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + ldrb r2, [r4, 0x1] + lsls r2, 27 + lsrs r2, 31 + lsls r1, r2, 2 + adds r1, r2 + adds r0, r1 + adds r0, r5 + ldrb r0, [r0] + ldr r1, =gTrainerClassNameIndices + adds r0, r1 + ldrb r0, [r0] + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806B870 + + thumb_func_start sub_806B8B0 +sub_806B8B0: @ 806B8B0 + push {r4,lr} + movs r4, 0 +_0806B8B4: + movs r0, 0x64 + muls r0, r4 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0806B8D0 + movs r0, 0 + b _0806B8DE + .pool +_0806B8D0: + adds r4, 0x1 + cmp r4, 0x5 + ble _0806B8B4 + bl sub_806B8E4 + lsls r0, 24 + lsrs r0, 24 +_0806B8DE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_806B8B0 + + thumb_func_start sub_806B8E4 +sub_806B8E4: @ 806B8E4 + push {r4-r6,lr} + movs r6, 0 +_0806B8E8: + movs r4, 0 + lsls r5, r6, 24 +_0806B8EC: + lsls r1, r4, 24 + lsrs r1, 24 + lsrs r0, r5, 24 + movs r2, 0xB + bl get_pokemon_data_from_any_box + cmp r0, 0 + bne _0806B900 + movs r0, 0 + b _0806B90E +_0806B900: + adds r4, 0x1 + cmp r4, 0x1D + ble _0806B8EC + adds r6, 0x1 + cmp r6, 0xD + ble _0806B8E8 + movs r0, 0x1 +_0806B90E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_806B8E4 + + thumb_func_start GetSpeciesName +@ void GetSpeciesName(u8 *dest, u16 speciesId) +GetSpeciesName: @ 806B914 + push {r4-r7,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + movs r1, 0 + movs r0, 0xCE + lsls r0, 1 + mov r12, r0 + ldr r7, =gSpeciesNames + movs r0, 0xB + muls r0, r5 + adds r3, r0, r7 + adds r2, r6, 0 + b _0806B93A + .pool +_0806B934: + adds r3, 0x1 + adds r2, 0x1 + adds r1, 0x1 +_0806B93A: + adds r4, r6, r1 + cmp r1, 0xA + bgt _0806B954 + cmp r5, r12 + bls _0806B94A + adds r0, r1, r7 + ldrb r0, [r0] + b _0806B94C +_0806B94A: + ldrb r0, [r3] +_0806B94C: + strb r0, [r2] + ldrb r0, [r4] + cmp r0, 0xFF + bne _0806B934 +_0806B954: + movs r0, 0xFF + strb r0, [r4] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end GetSpeciesName + + thumb_func_start CalcPPWithPPUps +@ u16 CalcPPWithPPUps(u16 moveId, s32 ppUpCounts, u8 monMoveIndex) +CalcPPWithPPUps: @ 806B960 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + lsls r2, 24 + lsrs r2, 24 + ldr r4, =gBattleMoves + lsls r3, r0, 1 + adds r3, r0 + lsls r3, 2 + adds r3, r4 + ldrb r4, [r3, 0x4] + ldr r0, =gUnknown_08329D22 + adds r0, r2, r0 + ldrb r3, [r0] + ands r3, r1 + lsls r2, 1 + asrs r3, r2 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 2 + muls r0, r4 + movs r1, 0x64 + bl __divsi3 + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end CalcPPWithPPUps + + thumb_func_start sub_806B9A8 +sub_806B9A8: @ 806B9A8 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + lsls r4, r1, 24 + lsrs r4, 24 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + strb r0, [r1] + ldr r1, =gUnknown_08329D26 + adds r4, r1 + ldrb r1, [r4] + ands r1, r0 + mov r0, sp + strb r1, [r0] + adds r0, r5, 0 + movs r1, 0x15 + mov r2, sp + bl pokemon_setattr + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806B9A8 + + thumb_func_start sub_806B9E4 +sub_806B9E4: @ 806B9E4 + lsls r1, 24 + lsrs r1, 24 + adds r0, 0x3B + ldr r2, =gUnknown_08329D26 + adds r1, r2 + ldrb r2, [r0] + ldrb r1, [r1] + ands r1, r2 + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_806B9E4 + + thumb_func_start battle_data_fill +battle_data_fill: @ 806B9FC + 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, 0x14] + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + movs r0, 0x64 + mov r5, r9 + muls r5, r0 + ldr r0, =0x020244ec + adds r5, r0 + adds r0, r5, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + ldr r1, =0x02024084 + mov r8, r1 + movs r1, 0x58 + ldr r2, [sp, 0x14] + adds r4, r2, 0 + muls r4, r1 + mov r3, r8 + adds r6, r4, r3 + strh r0, [r6] + adds r0, r5, 0 + movs r1, 0xC + movs r2, 0 + bl pokemon_getattr + strh r0, [r6, 0x2E] + movs r6, 0 + mov r0, r8 + adds r0, 0x24 + adds r7, r4, r0 +_0806BA4E: + adds r1, r6, 0 + adds r1, 0xD + adds r0, r5, 0 + movs r2, 0 + bl pokemon_getattr + movs r1, 0xC + add r1, r8 + mov r10, r1 + adds r1, r4, r1 + strh r0, [r1] + adds r1, r6, 0 + adds r1, 0x11 + adds r0, r5, 0 + movs r2, 0 + bl pokemon_getattr + strb r0, [r7] + adds r7, 0x1 + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _0806BA4E + movs r0, 0x64 + mov r4, r9 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + movs r2, 0xC + negs r2, r2 + add r2, r10 + mov r9, r2 + movs r1, 0x58 + ldr r3, [sp, 0x14] + adds r5, r3, 0 + muls r5, r1 + adds r7, r5, r2 + adds r1, r7, 0 + adds r1, 0x3B + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + adds r1, r7, 0 + adds r1, 0x2B + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x19 + movs r2, 0 + bl pokemon_getattr + mov r1, r10 + adds r1, 0x38 + adds r1, r5, r1 + str r0, [r1] + adds r0, r4, 0 + movs r1, 0x27 + movs r2, 0 + bl pokemon_getattr + movs r6, 0x1F + ands r0, r6 + ldrb r2, [r7, 0x14] + movs r1, 0x20 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r7, 0x14] + adds r0, r4, 0 + movs r1, 0x28 + movs r2, 0 + bl pokemon_getattr + movs r1, 0x1F + mov r8, r1 + mov r2, r8 + ands r0, r2 + lsls r0, 5 + ldrh r2, [r7, 0x14] + ldr r1, =0xfffffc1f + ands r1, r2 + orrs r1, r0 + strh r1, [r7, 0x14] + adds r0, r4, 0 + movs r1, 0x29 + movs r2, 0 + bl pokemon_getattr + ands r0, r6 + lsls r0, 2 + ldrb r2, [r7, 0x15] + movs r1, 0x7D + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r7, 0x15] + adds r0, r4, 0 + movs r1, 0x2A + movs r2, 0 + bl pokemon_getattr + movs r1, 0x1F + ands r1, r0 + lsls r1, 15 + ldr r0, [r7, 0x14] + ldr r2, =0xfff07fff + ands r0, r2 + orrs r0, r1 + str r0, [r7, 0x14] + adds r0, r4, 0 + movs r1, 0x2B + movs r2, 0 + bl pokemon_getattr + mov r3, r8 + ands r0, r3 + lsls r0, 4 + ldrh r2, [r7, 0x16] + ldr r1, =0xfffffe0f + ands r1, r2 + orrs r1, r0 + strh r1, [r7, 0x16] + adds r0, r4, 0 + movs r1, 0x2C + movs r2, 0 + bl pokemon_getattr + ands r0, r6 + lsls r0, 1 + ldrb r2, [r7, 0x17] + movs r1, 0x3F + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r7, 0x17] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + mov r1, r10 + adds r1, 0x3C + adds r1, r5, r1 + str r0, [r1] + adds r0, r4, 0 + movs r1, 0x37 + movs r2, 0 + bl pokemon_getattr + mov r1, r10 + adds r1, 0x40 + adds r1, r5, r1 + str r0, [r1] + adds r0, r4, 0 + movs r1, 0x38 + movs r2, 0 + bl pokemon_getattr + adds r1, r7, 0 + adds r1, 0x2A + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x28] + adds r0, r4, 0 + movs r1, 0x3A + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x2C] + adds r0, r4, 0 + movs r1, 0x3B + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x2] + adds r0, r4, 0 + movs r1, 0x3C + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x4] + adds r0, r4, 0 + movs r1, 0x3D + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x6] + adds r0, r4, 0 + movs r1, 0x3E + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x8] + adds r0, r4, 0 + movs r1, 0x3F + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0xA] + adds r0, r4, 0 + movs r1, 0x2D + movs r2, 0 + bl pokemon_getattr + movs r1, 0x1 + ands r0, r1 + lsls r0, 6 + ldrb r2, [r7, 0x17] + movs r1, 0x41 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r7, 0x17] + adds r0, r4, 0 + movs r1, 0x2E + movs r2, 0 + bl pokemon_getattr + lsls r0, 7 + ldrb r2, [r7, 0x17] + movs r1, 0x7F + ands r1, r2 + orrs r1, r0 + strb r1, [r7, 0x17] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + mov r1, r10 + adds r1, 0x48 + adds r1, r5, r1 + str r0, [r1] + ldr r2, =gBaseStats + ldrh r1, [r7] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x6] + adds r1, r7, 0 + adds r1, 0x21 + strb r0, [r1] + ldrh r1, [r7] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x7] + adds r1, r7, 0 + adds r1, 0x22 + strb r0, [r1] + ldrh r0, [r7] + ldrb r1, [r7, 0x17] + lsrs r1, 7 + bl sub_806B694 + adds r1, r7, 0 + adds r1, 0x20 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + mov r0, r10 + adds r0, 0x24 + adds r0, r5, r0 + mov r1, sp + bl CopyString_Limit10 + mov r2, r10 + adds r2, 0x30 + adds r2, r5, r2 + adds r0, r4, 0 + movs r1, 0x7 + bl pokemon_getattr + ldr r0, [sp, 0x14] + bl battle_side_get_owner + ldr r1, =0x0202449c + lsls r0, 24 + lsrs r0, 23 + adds r0, 0xA8 + ldr r1, [r1] + adds r1, r0 + ldrh r0, [r7, 0x28] + strh r0, [r1] + movs r2, 0x6 + mov r1, r9 + movs r6, 0x7 + add r5, r10 + adds r0, r5, 0 + adds r0, 0x13 +_0806BCB2: + strb r2, [r0] + subs r0, 0x1 + subs r6, 0x1 + cmp r6, 0 + bge _0806BCB2 + movs r2, 0 + movs r0, 0x58 + ldr r3, [sp, 0x14] + muls r0, r3 + adds r1, 0x50 + adds r0, r1 + str r2, [r0] + ldr r0, [sp, 0x14] + bl sub_803FA70 + ldr r0, [sp, 0x14] + movs r1, 0 + bl sub_805EF84 + 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 battle_data_fill + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/porthole.s b/asm/porthole.s new file mode 100644 index 000000000..bb895e597 --- /dev/null +++ b/asm/porthole.s @@ -0,0 +1,282 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80FB59C +sub_80FB59C: @ 80FB59C + push {r4-r6,lr} + sub sp, 0xC + mov r4, sp + adds r4, 0x5 + mov r5, sp + adds r5, 0x6 + add r6, sp, 0x8 + add r0, sp, 0x4 + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_8137FFC + lsls r0, 24 + cmp r0, 0 + bne _080FB5DE + add r0, sp, 0x4 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + movs r1, 0 + ldrsb r1, [r4, r1] + movs r2, 0x1 + negs r2, r2 + movs r3, 0 + ldrsb r3, [r5, r3] + movs r4, 0 + ldrsb r4, [r6, r4] + str r4, [sp] + bl warp1_set + movs r0, 0x1 + b _080FB5E0 +_080FB5DE: + movs r0, 0 +_080FB5E0: + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80FB59C + + thumb_func_start sub_80FB5E8 +sub_80FB5E8: @ 80FB5E8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldr r0, =0x000040b4 + bl GetVarPointer + adds r7, r0, 0 + ldr r0, =0x03005d8c + ldr r3, [r0] + adds r6, r3, 0x4 + movs r0, 0 + ldrsh r2, [r4, r0] + cmp r2, 0x1 + beq _080FB648 + cmp r2, 0x1 + bgt _080FB624 + cmp r2, 0 + beq _080FB62E + b _080FB6E2 + .pool +_080FB624: + cmp r2, 0x2 + beq _080FB68A + cmp r2, 0x3 + beq _080FB6C4 + b _080FB6E2 +_080FB62E: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080FB6E2 + strh r2, [r4, 0x2] + movs r0, 0x2 + strh r0, [r4] + b _080FB6E2 + .pool +_080FB648: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _080FB656 + strh r2, [r4, 0x2] +_080FB656: + ldrb r1, [r6, 0x1] + ldrb r2, [r3, 0x4] + movs r0, 0xFF + bl sub_80D3340 + lsls r0, 24 + cmp r0, 0 + beq _080FB6E2 + movs r0, 0x1 + bl sub_8137FC0 + cmp r0, 0x1 + bne _080FB686 + ldrh r0, [r7] + cmp r0, 0x2 + bne _080FB680 + movs r0, 0x9 + b _080FB682 + .pool +_080FB680: + movs r0, 0xA +_080FB682: + strh r0, [r7] + b _080FB692 +_080FB686: + movs r0, 0x2 + strh r0, [r4] +_080FB68A: + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080FB698 +_080FB692: + movs r0, 0x3 + strh r0, [r4] + b _080FB6E2 +_080FB698: + ldrh r0, [r7] + cmp r0, 0x2 + bne _080FB6AC + ldrb r1, [r6, 0x1] + ldrb r2, [r6] + ldr r3, =gUnknown_0858E8AB + b _080FB6B2 + .pool +_080FB6AC: + ldrb r1, [r6, 0x1] + ldrb r2, [r6] + ldr r3, =gUnknown_0858E8AD +_080FB6B2: + movs r0, 0xFF + bl exec_movement + movs r0, 0x1 + strh r0, [r4] + b _080FB6E2 + .pool +_080FB6C4: + ldr r0, =0x00004001 + bl FlagReset + movs r0, 0x80 + lsls r0, 7 + bl FlagReset + movs r0, 0 + bl copy_saved_warp2_bank_and_enter_x_to_warp1 + bl sp13E_warp_to_last_warp + adds r0, r5, 0 + bl DestroyTask +_080FB6E2: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FB5E8 + + thumb_func_start sub_80FB6EC +sub_80FB6EC: @ 80FB6EC + push {r4,lr} + sub sp, 0x4 + ldr r1, =DummyObjectCallback + movs r0, 0 + str r0, [sp] + movs r0, 0x8C + movs r2, 0x70 + movs r3, 0x50 + bl AddPseudoFieldObject + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r4, r1, r2 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, =0x000040b4 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bne _080FB74C + movs r0, 0x4 + bl FieldObjectDirectionToImageAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + b _080FB75E + .pool +_080FB74C: + movs r0, 0x3 + bl FieldObjectDirectionToImageAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim +_080FB75E: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80FB6EC + + thumb_func_start sub_80FB768 +sub_80FB768: @ 80FB768 + push {lr} + bl sub_80FB6EC + ldr r2, =0x02037350 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x1] + bl pal_fill_black + ldr r0, =sub_80FB5E8 + movs r1, 0x50 + bl CreateTask + bl script_env_2_enable + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FB768 + + thumb_func_start sub_80FB7A4 +sub_80FB7A4: @ 80FB7A4 + push {lr} + ldr r0, =0x0000088d + bl FlagSet + ldr r0, =0x00004001 + bl FlagSet + movs r0, 0x80 + lsls r0, 7 + bl FlagSet + ldr r0, =0x03005d8c + 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 + bl sub_80FB59C + bl sub_80AF8B8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FB7A4 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/record_mixing.s b/asm/record_mixing.s new file mode 100644 index 000000000..a706fef91 --- /dev/null +++ b/asm/record_mixing.s @@ -0,0 +1,3711 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80E6BE8 +sub_80E6BE8: @ 80E6BE8 + push {lr} + ldr r0, =sub_80E715C + bl sub_80B37D4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E6BE8 + + thumb_func_start sub_80E6BF8 +sub_80E6BF8: @ 80E6BF8 + push {r4,lr} + ldr r2, =0x03001134 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r3, =0x00001a9c + adds r0, r1, r3 + str r0, [r2] + ldr r2, =0x03001138 + ldr r4, =0x000027cc + adds r0, r1, r4 + str r0, [r2] + ldr r2, =0x0300113c + ldr r3, =0x00002b50 + adds r0, r1, r3 + str r0, [r2] + ldr r2, =0x03001140 + ldr r4, =0x00002e28 + adds r0, r1, r4 + str r0, [r2] + ldr r2, =0x03001144 + ldr r3, =0x00002e68 + adds r0, r1, r3 + str r0, [r2] + ldr r2, =0x03001148 + ldr r0, =0x02039f9c + str r0, [r2] + ldr r2, =0x0300114c + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r4, =0x0000064c + adds r3, r0, r4 + str r3, [r2] + ldr r2, =0x03001150 + ldr r4, =0x00003b58 + adds r1, r4 + str r1, [r2] + ldr r1, =0x03001154 + adds r0, 0xDC + str r0, [r1] + ldr r0, =0x03001158 + str r3, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E6BF8 + + thumb_func_start sub_80E6CA0 +sub_80E6CA0: @ 80E6CA0 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x03001134 + ldr r1, [r0] + movs r4, 0xC8 + lsls r4, 4 + adds r0, r5, 0 + adds r2, r4, 0 + bl memcpy + adds r4, r5, r4 + ldr r0, =0x03001138 + ldr r1, [r0] + movs r2, 0xE1 + lsls r2, 2 + adds r0, r4, 0 + bl memcpy + adds r0, r4, 0 + bl sub_80F14F8 + ldr r1, =0x00001004 + adds r0, r5, r1 + ldr r1, =0x0300113c + ldr r1, [r1] + movs r2, 0x40 + bl memcpy + ldr r2, =0x00001044 + adds r0, r5, r2 + ldr r1, =0x03001140 + ldr r1, [r1] + movs r2, 0x40 + bl memcpy + ldr r1, =0x00001084 + adds r0, r5, r1 + ldr r1, =0x03001144 + ldr r1, [r1] + movs r2, 0x28 + bl memcpy + ldr r2, =0x000010ac + adds r0, r5, r2 + bl sub_80E89F8 + ldr r0, =0x0300114c + ldr r0, [r0] + ldr r2, =0x00001124 + adds r1, r5, r2 + bl sub_81659DC + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _080E6D1C + bl sub_81539D4 + ldr r2, =0x000011c8 + adds r1, r5, r2 + strh r0, [r1] +_080E6D1C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E6CA0 + + thumb_func_start sub_80E6D54 +sub_80E6D54: @ 80E6D54 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x03001134 + ldr r1, [r0] + movs r4, 0xC8 + lsls r4, 4 + adds r0, r5, 0 + adds r2, r4, 0 + bl memcpy + adds r0, r5, 0 + bl sub_80EB18C + adds r4, r5, r4 + ldr r0, =0x03001138 + ldr r1, [r0] + movs r2, 0xE1 + lsls r2, 2 + adds r0, r4, 0 + bl memcpy + adds r0, r4, 0 + bl sub_80F1208 + ldr r1, =0x00001004 + adds r0, r5, r1 + ldr r1, =0x0300113c + ldr r1, [r1] + movs r2, 0x40 + bl memcpy + ldr r2, =0x00001044 + adds r4, r5, r2 + ldr r0, =0x03001140 + ldr r1, [r0] + adds r0, r4, 0 + movs r2, 0x40 + bl memcpy + adds r0, r4, 0 + bl sub_8120B70 + ldr r1, =0x00001084 + adds r0, r5, r1 + ldr r1, =0x03001144 + ldr r1, [r1] + movs r2, 0x28 + bl memcpy + ldr r2, =0x000010ac + adds r4, r5, r2 + adds r0, r4, 0 + bl sub_80E89F8 + adds r0, r4, 0 + bl sub_80E8A54 + ldr r0, =0x0300114c + ldr r0, [r0] + ldr r1, =0x00001124 + adds r4, r5, r1 + adds r1, r4, 0 + bl sub_81659DC + adds r0, r4, 0 + bl TaskDummy4 + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _080E6DEE + bl sub_81539D4 + ldr r2, =0x000011c8 + adds r1, r5, r2 + strh r0, [r1] +_080E6DEE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E6D54 + + thumb_func_start sub_80E6E24 +sub_80E6E24: @ 80E6E24 + push {r4,r5,lr} + bl sub_80E9914 + bl sub_80F0BB8 + bl sub_80E6BF8 + bl sub_800A064 + cmp r0, 0 + beq _080E6E60 + bl sub_800A03C + cmp r0, 0 + bne _080E6E50 + ldr r0, =0x0203a018 + ldr r0, [r0] + bl sub_80E6CA0 + b _080E6F12 + .pool +_080E6E50: + ldr r0, =0x0203a018 + ldr r0, [r0] + bl sub_80E6D54 + b _080E6F12 + .pool +_080E6E60: + ldr r5, =0x0203a018 + ldr r0, [r5] + ldr r1, =0x03001134 + ldr r1, [r1] + movs r4, 0xC8 + lsls r4, 4 + adds r2, r4, 0 + bl memcpy + ldr r0, [r5] + adds r0, r4 + ldr r1, =0x03001138 + ldr r1, [r1] + movs r2, 0xE1 + lsls r2, 2 + bl memcpy + ldr r0, [r5] + ldr r1, =0x00001004 + adds r0, r1 + ldr r1, =0x0300113c + ldr r1, [r1] + movs r2, 0x40 + bl memcpy + ldr r0, [r5] + ldr r2, =0x00001044 + adds r0, r2 + ldr r1, =0x03001140 + ldr r1, [r1] + movs r2, 0x40 + bl memcpy + ldr r0, [r5] + ldr r1, =0x00001214 + adds r0, r1 + ldr r1, =0x03001150 + ldr r1, [r1] + movs r2, 0x40 + bl memcpy + ldr r0, [r5] + ldr r2, =0x00001084 + adds r0, r2 + ldr r1, =0x03001144 + ldr r1, [r1] + movs r2, 0x28 + bl memcpy + ldr r0, [r5] + ldr r1, =0x000010ac + adds r0, r1 + bl sub_80E89F8 + ldr r0, [r5] + ldr r4, =0x00001124 + adds r0, r4 + ldr r1, =0x0300114c + ldr r1, [r1] + movs r2, 0xEC + bl memcpy + ldr r0, [r5] + adds r0, r4 + bl sub_80E8AC0 + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _080E6EFA + bl sub_81539D4 + ldr r1, [r5] + ldr r2, =0x00001210 + adds r1, r2 + strh r0, [r1] +_080E6EFA: + ldr r0, [r5] + ldr r1, =0x00001254 + adds r0, r1 + ldr r1, =0x03001154 + ldr r1, [r1] + bl sub_80E8110 + ldr r0, [r5] + ldr r2, =0x000012dc + adds r0, r2 + bl sub_80E8260 +_080E6F12: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E6E24 + + thumb_func_start sub_80E6F60 +sub_80E6F60: @ 80E6F60 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r4, r0, 0 + bl sub_800A064 + cmp r0, 0 + beq _080E7014 + ldr r5, =0x0203a014 + ldr r0, [r5] + movs r1, 0xC8 + lsls r1, 4 + mov r8, r1 + add r0, r8 + bl sub_80E7B2C + ldr r0, [r5] + ldr r6, =0x00001230 + lsls r4, 24 + lsrs r4, 24 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80EAF80 + ldr r3, [r5] + ldr r1, =0x000010ac + adds r0, r3, r1 + add r3, r8 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80E7B60 + ldr r0, [r5] + ldr r1, =0x00001124 + adds r0, r1 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80E7948 + ldr r0, [r5] + add r0, r8 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80F01E8 + ldr r0, [r5] + ldr r1, =0x00001004 + adds r0, r1 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80F0C7C + ldr r0, [r5] + ldr r1, =0x00001044 + adds r0, r1 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80E78C4 + ldr r0, [r5] + ldr r1, =0x00001084 + adds r0, r1 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_812287C + ldr r0, [r5] + ldr r1, =0x000011c8 + adds r0, r1 + adds r1, r4, 0 + bl sub_80E7F68 + b _080E70BE + .pool +_080E7014: + ldr r5, =0x0203a014 + ldr r0, [r5] + movs r1, 0xC8 + lsls r1, 4 + mov r8, r1 + add r0, r8 + bl sub_80E7B2C + ldr r0, [r5] + ldr r6, =0x00001444 + lsls r4, 24 + lsrs r4, 24 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80EAF80 + ldr r0, [r5] + add r0, r8 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80F01E8 + ldr r0, [r5] + ldr r1, =0x00001004 + adds r0, r1 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80F0C7C + ldr r0, [r5] + ldr r1, =0x00001044 + adds r0, r1 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80E78C4 + ldr r0, [r5] + ldr r1, =0x00001084 + adds r0, r1 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_812287C + ldr r3, [r5] + ldr r1, =0x000010ac + adds r0, r3, r1 + add r3, r8 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80E7B60 + ldr r0, [r5] + ldr r1, =0x00001124 + adds r0, r1 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80E7948 + ldr r0, [r5] + ldr r1, =0x00001210 + adds r0, r1 + adds r1, r4, 0 + bl sub_80E7F68 + ldr r0, [r5] + ldr r1, =0x00001214 + adds r0, r1 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80E7A14 + ldr r0, [r5] + ldr r1, =0x00001254 + adds r0, r1 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80E8468 + ldr r0, [r5] + ldr r1, =0x000012dc + adds r0, r1 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80E89AC +_080E70BE: + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E6F60 + + thumb_func_start sub_80E70F4 +sub_80E70F4: @ 80E70F4 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl Print + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80E70F4 + + thumb_func_start sub_80E7128 +sub_80E7128: @ 80E7128 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x32 + bne _080E7150 + movs r0, 0xE2 + bl audio_play + movs r0, 0 + strh r0, [r4, 0x8] +_080E7150: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E7128 + + thumb_func_start sub_80E715C +sub_80E715C: @ 80E715C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x5 + bls _080E7176 + b _080E730A +_080E7176: + lsls r0, 2 + ldr r1, =_080E7188 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080E7188: + .4byte _080E71A0 + .4byte _080E7218 + .4byte _080E724C + .4byte _080E726C + .4byte _080E72AC + .4byte _080E72C0 +_080E71A0: + ldr r4, =0x0203a018 + ldr r0, =0x00001444 + bl Alloc + str r0, [r4] + ldr r4, =0x0203a014 + ldr r0, =0x00005110 + bl Alloc + str r0, [r4] + ldr r0, =0x020375e2 + ldrb r0, [r0] + bl sub_8009628 + movs r0, 0x80 + lsls r0, 7 + movs r1, 0x1 + bl VarSet + ldr r1, =0x03001130 + movs r0, 0 + strb r0, [r1] + bl sub_80E6E24 + bl sub_80FB00C + movs r0, 0x1 + strh r0, [r5] + ldr r0, =sub_80E7324 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x14] + ldr r0, =sub_80E7128 + movs r1, 0x51 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x1E] + b _080E730A + .pool +_080E7218: + ldr r2, =0x03005e00 + movs r0, 0x14 + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _080E730A + movs r0, 0x2 + strh r0, [r5] + ldr r0, =0x00000894 + bl FlagSet + bl sub_80FB074 + ldrb r0, [r5, 0x1E] + bl DestroyTask + b _080E730A + .pool +_080E724C: + ldr r0, =sub_80E7FF8 + movs r1, 0xA + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x14] + movs r0, 0x3 + strh r0, [r5] + movs r0, 0xE0 + bl audio_play + b _080E730A + .pool +_080E726C: + ldr r2, =0x03005e00 + movs r0, 0x14 + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r4, [r0, 0x4] + cmp r4, 0 + bne _080E730A + movs r0, 0x4 + strh r0, [r5] + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _080E7296 + bl sub_80B3050 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x14] +_080E7296: + ldr r0, =gUnknown_085EEA8E + bl sub_80E70F4 + strh r4, [r5, 0x10] + b _080E730A + .pool +_080E72AC: + ldrh r0, [r5, 0x10] + adds r0, 0x1 + strh r0, [r5, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + ble _080E730A + movs r0, 0x5 + strh r0, [r5] + b _080E730A +_080E72C0: + ldr r2, =0x03005e00 + movs r0, 0x14 + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _080E730A + ldr r0, =0x0203a014 + ldr r0, [r0] + bl Free + ldr r0, =0x0203a018 + ldr r0, [r0] + bl Free + bl sub_808729C + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _080E72F8 + ldr r0, =sub_80AF2B4 + movs r1, 0xA + bl CreateTask +_080E72F8: + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + adds r0, r4, 0 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running +_080E730A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E715C + + thumb_func_start sub_80E7324 +sub_80E7324: @ 80E7324 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r6, =0x03005e00 + adds r5, r0, r6 + movs r0, 0x8 + ldrsh r1, [r5, r0] + cmp r1, 0x64 + beq _080E73A0 + cmp r1, 0x64 + bgt _080E7362 + cmp r1, 0x1 + bne _080E7346 + b _080E7464 +_080E7346: + cmp r1, 0x1 + bgt _080E7354 + cmp r1, 0 + beq _080E7384 + b _080E7566 + .pool +_080E7354: + cmp r1, 0x2 + bne _080E735A + b _080E7490 +_080E735A: + cmp r1, 0x5 + bne _080E7360 + b _080E7550 +_080E7360: + b _080E7566 +_080E7362: + cmp r1, 0xC9 + beq _080E73F8 + cmp r1, 0xC9 + bgt _080E7370 + cmp r1, 0x65 + beq _080E73B8 + b _080E7566 +_080E7370: + ldr r0, =0x0000012d + cmp r1, r0 + beq _080E7432 + adds r0, 0x63 + cmp r1, r0 + beq _080E744A + b _080E7566 + .pool +_080E7384: + ldr r0, =gUnknown_085EEA7E + bl sub_80E70F4 + movs r0, 0xE1 + lsls r0, 3 + strh r0, [r5, 0x18] + movs r0, 0xC8 + lsls r0, 1 + strh r0, [r5, 0x8] + bl sub_8009FAC + b _080E7566 + .pool +_080E73A0: + ldrh r0, [r5, 0x20] + adds r0, 0x1 + strh r0, [r5, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + bgt _080E73B0 + b _080E7566 +_080E73B0: + movs r0, 0 + strh r0, [r5, 0x20] + movs r0, 0x65 + b _080E7564 +_080E73B8: + bl sub_800ABAC + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_800ABBC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E73EA + bl sub_800AA48 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + beq _080E73DA + b _080E7566 +_080E73DA: + movs r0, 0x15 + bl audio_play + movs r1, 0 + movs r0, 0xC9 + strh r0, [r5, 0x8] + strh r1, [r5, 0x20] + b _080E7566 +_080E73EA: + movs r0, 0x16 + bl audio_play + ldr r0, =0x0000012d + b _080E7564 + .pool +_080E73F8: + bl sub_800AA48 + adds r4, r0, 0 + bl sub_800ABAC + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _080E740C + b _080E7566 +_080E740C: + ldrh r4, [r5, 0x20] + adds r4, 0x1 + strh r4, [r5, 0x20] + lsls r4, 16 + asrs r4, 16 + bl sub_800ABAC + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 1 + cmp r4, r1 + bgt _080E742A + b _080E7566 +_080E742A: + bl sub_800A620 + movs r0, 0x1 + b _080E7564 +_080E7432: + bl sub_800AA48 + adds r4, r0, 0 + bl sub_800ABAC + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _080E7446 + b _080E7566 +_080E7446: + movs r0, 0x1 + b _080E7564 +_080E744A: + ldrh r0, [r5, 0x20] + adds r0, 0x1 + strh r0, [r5, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + bgt _080E745A + b _080E7566 +_080E745A: + movs r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + strh r0, [r5, 0x20] + b _080E7566 +_080E7464: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _080E746E + b _080E7566 +_080E746E: + ldr r4, =0x02021cc4 + bl sub_80E7810 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + movs r0, 0x5 + b _080E7564 + .pool +_080E7490: + bl sub_800ABAC + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + strh r0, [r5, 0x14] + strh r1, [r5, 0x8] + bl sub_80E7810 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x12] + ldr r0, =sub_80E756C + str r0, [r5] + bl sub_800A064 + cmp r0, 0 + beq _080E7504 + ldr r0, =0x0203a018 + ldr r0, [r0] + adds r1, r5, 0 + adds r1, 0xC + bl sub_80E7808 + ldr r0, =sub_80E7630 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x1C] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r0, r1, r6 + strh r4, [r0, 0x8] + ldr r0, =0x0203a014 + ldr r0, [r0] + adds r1, r6, r1 + adds r1, 0x12 + bl sub_80E7808 + ldr r1, =0x0300115c + ldr r0, =0x00001230 + str r0, [r1] + b _080E7566 + .pool +_080E7504: + ldr r0, =0x0203a018 + ldr r0, [r0] + adds r1, r5, 0 + adds r1, 0xC + bl sub_80E7808 + ldr r0, =sub_80E7630 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x1C] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r0, r1, r6 + strh r4, [r0, 0x8] + ldr r0, =0x0203a014 + ldr r0, [r0] + adds r1, r6, r1 + adds r1, 0x12 + bl sub_80E7808 + ldr r1, =0x0300115c + ldr r0, =0x00001444 + str r0, [r1] + b _080E7566 + .pool +_080E7550: + ldrh r0, [r5, 0x1C] + adds r0, 0x1 + strh r0, [r5, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + ble _080E7566 + movs r0, 0 + strh r0, [r5, 0x1C] + movs r0, 0x2 +_080E7564: + strh r0, [r5, 0x8] +_080E7566: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80E7324 + + thumb_func_start sub_80E756C +sub_80E756C: @ 80E756C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r5, r1, r0 + movs r2, 0x8 + ldrsh r1, [r5, r2] + adds r2, r0, 0 + cmp r1, 0x4 + bhi _080E7624 + lsls r0, r1, 2 + ldr r1, =_080E7598 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080E7598: + .4byte _080E75AC + .4byte _080E75D0 + .4byte _080E7624 + .4byte _080E75E2 + .4byte _080E760E +_080E75AC: + adds r0, r5, 0 + adds r0, 0xC + bl sub_80E77FC + adds r1, r0, 0 + movs r0, 0x10 + ldrsh r2, [r5, r0] + movs r0, 0xC8 + muls r0, r2 + adds r1, r0 + ldr r0, =0x020228c4 + movs r2, 0xC8 + bl memcpy + b _080E75FC + .pool +_080E75D0: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _080E75FC + movs r0, 0x1 + bl sub_800A4D8 + b _080E75FC +_080E75E2: + ldrh r0, [r5, 0x10] + adds r0, 0x1 + strh r0, [r5, 0x10] + movs r1, 0x10 + ldrsh r4, [r5, r1] + ldr r0, =0x0300115c + ldr r0, [r0] + movs r1, 0xC8 + bl __udivsi3 + adds r0, 0x1 + cmp r4, r0 + bne _080E7608 +_080E75FC: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _080E7624 + .pool +_080E7608: + movs r0, 0 + strh r0, [r5, 0x8] + b _080E7624 +_080E760E: + movs r1, 0x1C + ldrsh r0, [r5, r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x4] + cmp r0, 0 + bne _080E7624 + ldr r0, =sub_80E77D4 + str r0, [r5] +_080E7624: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E756C + + thumb_func_start sub_80E7630 +sub_80E7630: @ 80E7630 + 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] + lsls r0, 2 + ldr r1, [sp] + adds r0, r1 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r0, r1 + mov r10, r0 + bl sub_800A550 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + bl sub_800A9D8 + lsls r0, 24 + lsrs r0, 24 + ldr r3, [sp, 0x4] + cmp r3, r0 + bne _080E773E + movs r4, 0 + mov r8, r4 + b _080E771C + .pool +_080E7678: + ldr r1, [sp, 0x4] + mov r0, r8 + asrs r1, r0 + movs r0, 0x1 + ands r1, r0 + movs r2, 0x1 + add r2, r8 + mov r9, r2 + cmp r1, 0 + beq _080E7714 + mov r0, r10 + adds r0, 0x12 + bl sub_80E77FC + mov r3, r9 + lsls r4, r3, 1 + mov r5, r10 + adds r5, 0x8 + adds r4, r5, r4 + movs r2, 0 + ldrsh r1, [r4, r2] + movs r7, 0xC8 + muls r1, r7 + adds r0, r1 + ldr r3, =0x0300115c + ldr r1, [r3] + mov r2, r8 + muls r2, r1 + adds r1, r2, 0 + adds r6, r0, r1 + mov r0, r8 + bl sub_80E7820 + adds r1, r0, 0 + movs r3, 0 + ldrsh r2, [r4, r3] + adds r0, r2, 0x1 + muls r0, r7 + ldr r4, =0x0300115c + ldr r3, [r4] + cmp r0, r3 + bls _080E76DC + muls r2, r7 + subs r2, r3, r2 + adds r0, r6, 0 + bl memcpy + b _080E76E4 + .pool +_080E76DC: + adds r0, r6, 0 + movs r2, 0xC8 + bl memcpy +_080E76E4: + mov r0, r8 + bl sub_800A5EC + mov r0, r9 + lsls r1, r0, 1 + adds r1, r5, r1 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + movs r2, 0 + ldrsh r4, [r1, r2] + ldr r3, =0x0300115c + ldr r0, [r3] + movs r1, 0xC8 + bl __udivsi3 + adds r0, 0x1 + cmp r4, r0 + bne _080E7714 + ldr r0, [sp, 0x8] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] +_080E7714: + mov r4, r9 + lsls r0, r4, 24 + lsrs r0, 24 + mov r8, r0 +_080E771C: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r8, r0 + bcc _080E7678 + ldr r2, =0x03005e00 + mov r0, r10 + movs r3, 0x8 + ldrsh r1, [r0, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] +_080E773E: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + ldr r4, [sp, 0x8] + cmp r4, r0 + bne _080E7752 + ldr r0, [sp] + bl DestroyTask +_080E7752: + 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_80E7630 + + thumb_func_start sub_80E776C +sub_80E776C: @ 80E776C + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + ldr r2, =0x03005e00 + adds r0, r2 + movs r4, 0x1C + ldrsh r1, [r0, r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _080E7794 + adds r0, r3, 0 + bl DestroyTask +_080E7794: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E776C + + thumb_func_start sub_80E77A0 +sub_80E77A0: @ 80E77A0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r1, r0 + ldr r0, =sub_80E776C + str r0, [r1] + ldr r0, =0x03001130 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080E77C4 + movs r2, 0x12 + ldrsh r0, [r1, r2] + bl sub_80E6F60 +_080E77C4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E77A0 + + thumb_func_start sub_80E77D4 +sub_80E77D4: @ 80E77D4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =sub_80E77A0 + str r0, [r1] + ldr r1, =0x03001130 + movs r0, 0x1 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_80E77D4 + + thumb_func_start sub_80E77FC +sub_80E77FC: @ 80E77FC + adds r1, r0, 0 + ldrh r0, [r1] + ldrh r1, [r1, 0x2] + lsls r1, 16 + orrs r0, r1 + bx lr + thumb_func_end sub_80E77FC + + thumb_func_start sub_80E7808 +sub_80E7808: @ 80E7808 + strh r0, [r1] + lsrs r0, 16 + strh r0, [r1, 0x2] + bx lr + thumb_func_end sub_80E7808 + + thumb_func_start sub_80E7810 +sub_80E7810: @ 80E7810 + push {lr} + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80E7810 + + thumb_func_start sub_80E7820 +sub_80E7820: @ 80E7820 + lsls r0, 24 + lsrs r0, 16 + ldr r1, =0x020223c4 + adds r0, r1 + bx lr + .pool + thumb_func_end sub_80E7820 + + thumb_func_start sub_80E7830 +sub_80E7830: @ 80E7830 + push {r4,lr} + adds r4, r0, 0 + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _080E7868 + cmp r0, 0x3 + bhi _080E784A + cmp r0, 0x2 + beq _080E7850 + b _080E78B8 +_080E784A: + cmp r0, 0x4 + beq _080E7894 + b _080E78B8 +_080E7850: + movs r3, 0 + ldr r2, =gUnknown_0858CF8C + adds r1, r4, 0 +_080E7856: + adds r0, r3, r2 + ldrb r0, [r0] + stm r1!, {r0} + adds r3, 0x1 + cmp r3, 0x1 + bls _080E7856 + b _080E78B8 + .pool +_080E7868: + movs r0, 0 + bl sub_800A2A4 + adds r2, r0, 0 + movs r0, 0x1 + ands r2, r0 + movs r3, 0 + ldr r1, =gUnknown_0858CF8E + lsls r0, r2, 1 + adds r0, r2 + adds r1, r0, r1 + adds r2, r4, 0 +_080E7880: + ldrb r0, [r1] + stm r2!, {r0} + adds r1, 0x1 + adds r3, 0x1 + cmp r3, 0x2 + bls _080E7880 + b _080E78B8 + .pool +_080E7894: + movs r0, 0 + bl sub_800A2A4 + movs r1, 0x9 + bl __umodsi3 + adds r2, r0, 0 + movs r3, 0 + ldr r1, =gUnknown_0858CF94 + lsls r0, r2, 2 + adds r1, r0, r1 + adds r2, r4, 0 +_080E78AC: + ldrb r0, [r1] + stm r2!, {r0} + adds r1, 0x1 + adds r3, 0x1 + cmp r3, 0x3 + bls _080E78AC +_080E78B8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E7830 + + thumb_func_start sub_80E78C4 +sub_80E78C4: @ 80E78C4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + mov r9, r0 + mov r8, r1 + lsls r2, 24 + lsrs r7, r2, 24 + mov r0, sp + bl sub_80E7830 + lsls r0, r7, 2 + add r0, sp + ldr r1, [r0] + mov r0, r8 + muls r0, r1 + mov r2, r9 + adds r6, r2, r0 + ldr r2, =0x020229e8 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r4, [r0] + ldrh r5, [r0, 0x1A] + bl sub_800A064 + cmp r0, 0 + beq _080E7910 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_8120D34 + b _080E791A + .pool +_080E7910: + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_8120CD0 +_080E791A: + ldr r0, =0x03001140 + ldr r0, [r0] + lsls r1, r7, 2 + add r1, sp + ldr r1, [r1] + mov r2, r8 + muls r2, r1 + adds r1, r2, 0 + add r1, r9 + movs r2, 0x40 + bl memcpy + bl sub_8120670 + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E78C4 + + thumb_func_start sub_80E7948 +sub_80E7948: @ 80E7948 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + mov r8, r0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r6, r2, 24 + mov r0, sp + bl sub_80E7830 + bl sub_800A064 + cmp r0, 0 + beq _080E79AC + lsls r0, r6, 2 + mov r1, sp + adds r5, r1, r0 + ldr r0, [r5] + muls r0, r7 + add r0, r8 + adds r4, r7, 0 + muls r4, r6 + mov r1, r8 + adds r6, r1, r4 + adds r1, r6, 0 + bl sub_816587C + mov r9, r4 + cmp r0, 0x1 + bne _080E79FE + adds r7, r6, 0 + ldr r2, =0x020229e8 + ldr r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x1A] + adds r0, r7, 0 + adds r0, 0xE4 + strb r1, [r0] + adds r0, r7, 0 + bl sub_8164F70 + b _080E79FE + .pool +_080E79AC: + adds r5, r7, 0 + muls r5, r6 + mov r0, r8 + adds r4, r0, r5 + lsls r0, r6, 2 + add r0, sp + ldr r0, [r0] + adds r1, r7, 0 + muls r1, r0 + add r1, r8 + adds r0, r4, 0 + movs r2, 0xEC + bl memcpy + adds r7, r4, 0 + movs r6, 0 + mov r9, r5 +_080E79CE: + movs r0, 0x2C + muls r0, r6 + adds r0, 0x34 + adds r1, r7, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _080E79F2 + adds r4, r1, 0 + adds r4, 0x20 + adds r0, r4, 0 + bl sub_8009228 + cmp r0, 0 + beq _080E79F2 + adds r0, r4, 0 + movs r1, 0x1 + bl StopMusicWhileStringIsPrinted +_080E79F2: + adds r6, 0x1 + cmp r6, 0x3 + ble _080E79CE + adds r0, r7, 0 + bl sub_8164F70 +_080E79FE: + mov r0, r8 + add r0, r9 + bl sub_81628A0 + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E7948 + + thumb_func_start sub_80E7A14 +sub_80E7A14: @ 80E7A14 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + mov r8, r0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r5, r2, 24 + mov r0, sp + bl sub_80E7830 + adds r0, r7, 0 + muls r0, r5 + add r0, r8 + ldr r6, =0x03001150 + ldr r1, [r6] + movs r2, 0x40 + bl memcpy + bl sub_818D9AC + lsls r0, 24 + cmp r0, 0 + bne _080E7A60 + movs r0, 0x40 + bl Alloc + adds r4, r0, 0 + cmp r4, 0 + beq _080E7A8A + ldr r1, [r6] + movs r2, 0x40 + bl memcpy + b _080E7A62 + .pool +_080E7A60: + movs r4, 0 +_080E7A62: + ldr r0, =0x03001150 + ldr r0, [r0] + lsls r1, r5, 2 + add r1, sp + ldr r1, [r1] + muls r1, r7 + add r1, r8 + movs r2, 0x40 + bl memcpy + bl sub_818DA78 + cmp r4, 0 + beq _080E7A8A + adds r0, r4, 0 + bl sub_818E570 + adds r0, r4, 0 + bl Free +_080E7A8A: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E7A14 + + thumb_func_start sub_80E7A9C +sub_80E7A9C: @ 80E7A9C + ldrh r0, [r0, 0x20] + lsls r0, 24 + lsrs r0, 24 + bx lr + thumb_func_end sub_80E7A9C + + thumb_func_start sub_80E7AA4 +sub_80E7AA4: @ 80E7AA4 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x38 + mov r8, r0 + mov r10, r1 + mov r9, r2 + adds r4, r3, 0 + ldr r5, [sp, 0x54] + lsls r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsrs r4, 23 + add r4, r9 + ldrb r0, [r4] + mov r6, r10 + muls r6, r0 + add r6, r8 + ldrb r0, [r4, 0x1] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 3 + adds r1, r6, r1 + mov r0, sp + movs r2, 0x38 + bl memcpy + lsls r5, 1 + add r5, r9 + ldrb r0, [r5] + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + add r8, r0 + ldrb r1, [r4, 0x1] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 3 + adds r6, r0 + ldrb r0, [r5, 0x1] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 3 + add r1, r8 + adds r0, r6, 0 + movs r2, 0x38 + bl memcpy + ldrb r1, [r5, 0x1] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 3 + add r8, r0 + mov r0, r8 + mov r1, sp + movs r2, 0x38 + bl memcpy + add sp, 0x38 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80E7AA4 + + thumb_func_start sub_80E7B2C +sub_80E7B2C: @ 80E7B2C + push {r4,lr} + adds r3, r0, 0 + movs r2, 0 + movs r1, 0 + ldr r4, =0x03001160 +_080E7B36: + adds r0, r3, r1 + ldrb r0, [r0] + adds r0, r2, r0 + lsls r0, 24 + lsrs r2, r0, 24 + adds r1, 0x1 + cmp r1, 0xFF + ble _080E7B36 + strb r2, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E7B2C + + thumb_func_start sub_80E7B54 +sub_80E7B54: @ 80E7B54 + ldr r0, =0x03001160 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80E7B54 + + thumb_func_start sub_80E7B60 +sub_80E7B60: @ 80E7B60 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x58 + str r0, [sp, 0x2C] + str r1, [sp, 0x30] + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x38] + ldr r0, =0x020229e8 + ldrh r0, [r0, 0x4] + bl SeedRng2 + bl sub_8009FCC + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0 + mov r8, r0 + mov r1, sp + adds r1, 0x1C + str r1, [sp, 0x4C] + mov r2, sp + adds r2, 0x1D + str r2, [sp, 0x50] + mov r3, sp + adds r3, 0xC + str r3, [sp, 0x48] + movs r7, 0xFF + add r3, sp, 0x8 + movs r2, 0 + adds r6, r1, 0 + ldr r5, [sp, 0x50] +_080E7BB0: + mov r1, sp + add r1, r8 + adds r1, 0x4 + ldrb r0, [r1] + orrs r0, r7 + strb r0, [r1] + mov r1, r8 + adds r0, r3, r1 + strb r2, [r0] + lsls r1, 1 + adds r0, r6, r1 + strb r2, [r0] + adds r1, r5, r1 + strb r2, [r1] + mov r0, r8 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r0, 0x3 + bls _080E7BB0 + bl sub_800A064 + str r0, [sp, 0x3C] + movs r2, 0 + mov r8, r2 + lsls r4, 16 + str r4, [sp, 0x54] + ldr r0, [sp, 0x30] + mov r3, r9 + muls r3, r0 + str r3, [sp, 0x44] + b _080E7D04 + .pool +_080E7BF8: + ldr r1, [sp, 0x30] + mov r0, r8 + muls r0, r1 + ldr r2, [sp, 0x2C] + adds r7, r2, r0 + ldr r1, =0x020229e8 + mov r3, r8 + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0, 0x1A] + mov r9, r1 + ldrb r0, [r0] + str r0, [sp, 0x40] + movs r6, 0 + ldr r0, [r7, 0x70] + cmp r6, r0 + bcs _080E7CFA + movs r2, 0x10 + negs r2, r2 + mov r10, r2 +_080E7C24: + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 3 + adds r5, r7, r0 + ldrh r0, [r5, 0x20] + cmp r0, 0 + beq _080E7CEE + ldr r3, [sp, 0x3C] + cmp r3, 0 + beq _080E7C9A + adds r4, r5, 0 + adds r4, 0x24 + adds r0, r4, 0 + bl GetStringLength + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bhi _080E7C54 + movs r4, 0x1 + b _080E7C5C + .pool +_080E7C54: + adds r0, r4, 0 + bl StripExtendedControlCodes + mov r4, r9 +_080E7C5C: + ldrh r1, [r5, 0x2C] + ldr r0, =0x000015fc + cmp r1, r0 + bne _080E7C74 + adds r0, r5, 0 + adds r0, 0x2C + bl StripExtendedControlCodes + movs r1, 0x1 + b _080E7C76 + .pool +_080E7C74: + mov r1, r9 +_080E7C76: + ldr r0, [sp, 0x40] + subs r0, 0x1 + cmp r0, 0x1 + bhi _080E7CEE + adds r2, r5, 0 + adds r2, 0x37 + movs r0, 0xF + ands r4, r0 + ldrb r0, [r2] + mov r3, r10 + ands r0, r3 + orrs r0, r4 + lsls r1, 4 + movs r3, 0xF + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + b _080E7CEE +_080E7C9A: + mov r0, r9 + cmp r0, 0x1 + bne _080E7CEE + adds r0, r5, 0 + adds r0, 0x24 + bl sub_8009228 + cmp r0, 0 + beq _080E7CBA + adds r0, r5, 0 + adds r0, 0x37 + ldrb r1, [r0] + mov r2, r10 + ands r1, r2 + movs r2, 0x1 + b _080E7CC6 +_080E7CBA: + adds r0, r5, 0 + adds r0, 0x37 + ldrb r1, [r0] + mov r3, r10 + ands r1, r3 + movs r2, 0x2 +_080E7CC6: + orrs r1, r2 + strb r1, [r0] + adds r4, r0, 0 + adds r0, r5, 0 + adds r0, 0x2C + bl sub_8009228 + cmp r0, 0 + beq _080E7CE2 + ldrb r0, [r4] + movs r1, 0xF + ands r1, r0 + movs r0, 0x10 + b _080E7CEA +_080E7CE2: + ldrb r0, [r4] + movs r1, 0xF + ands r1, r0 + movs r0, 0x20 +_080E7CEA: + orrs r1, r0 + strb r1, [r4] +_080E7CEE: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, [r7, 0x70] + cmp r6, r0 + bcc _080E7C24 +_080E7CFA: + mov r0, r8 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 +_080E7D04: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r8, r0 + bcs _080E7D12 + b _080E7BF8 +_080E7D12: + movs r0, 0 + str r0, [sp, 0x34] + mov r8, r0 + ldr r1, [sp, 0x54] + lsrs r0, r1, 16 + ldr r2, [sp, 0x34] + cmp r2, r0 + bcs _080E7D70 + adds r5, r0, 0 +_080E7D24: + ldr r3, [sp, 0x30] + mov r0, r8 + muls r0, r3 + ldr r1, [sp, 0x2C] + adds r7, r1, r0 + ldr r0, [r7, 0x70] + cmp r0, 0 + beq _080E7D62 + movs r6, 0 + cmp r6, r0 + bcs _080E7D62 + adds r3, r7, 0 + adds r3, 0x74 + ldr r2, [sp, 0x4C] + mov r0, r8 + lsls r1, r0, 1 + movs r4, 0x1 +_080E7D46: + lsls r0, r6, 1 + adds r0, r3, r0 + ldrh r0, [r0] + cmp r0, 0 + bne _080E7D56 + adds r0, r6, r1 + adds r0, r2, r0 + strb r4, [r0] +_080E7D56: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, [r7, 0x70] + cmp r6, r0 + bcc _080E7D46 +_080E7D62: + mov r0, r8 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r8, r5 + bcc _080E7D24 +_080E7D70: + movs r6, 0 + mov r8, r6 + ldr r1, [sp, 0x54] + cmp r1, 0 + beq _080E7E64 + add r2, sp, 0x24 + mov r10, r2 + movs r3, 0x25 + add r3, sp + mov r9, r3 +_080E7D84: + ldr r1, [sp, 0x30] + mov r0, r8 + muls r0, r1 + ldr r2, [sp, 0x2C] + adds r7, r2, r0 + mov r3, r8 + lsls r1, r3, 1 + ldr r2, [sp, 0x4C] + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080E7DA6 + ldr r3, [sp, 0x50] + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080E7DB0 +_080E7DA6: + ldr r0, [sp, 0x34] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x34] +_080E7DB0: + ldr r2, [sp, 0x4C] + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080E7DD4 + ldr r3, [sp, 0x50] + adds r0, r3, r1 + ldrb r2, [r0] + cmp r2, 0 + bne _080E7DD4 +_080E7DC4: + lsls r1, r6, 1 + mov r3, r10 + adds r0, r3, r1 + mov r3, r8 + strb r3, [r0] + add r1, r9 + strb r2, [r1] + b _080E7E4E +_080E7DD4: + ldr r2, [sp, 0x4C] + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080E7DE8 + ldr r3, [sp, 0x50] + adds r0, r3, r1 + ldrb r2, [r0] + cmp r2, 0x1 + beq _080E7DC4 +_080E7DE8: + ldr r2, [sp, 0x4C] + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080E7E54 + ldr r3, [sp, 0x50] + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080E7E54 + lsls r5, r6, 1 + mov r1, r10 + adds r0, r1, r5 + mov r2, r8 + strb r2, [r0] + adds r0, r7, 0 + bl sub_80E7A9C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r7, 0 + adds r0, 0x38 + bl sub_80E7A9C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r4, 0 + bne _080E7E30 + cmp r1, 0 + beq _080E7E34 + mov r3, r9 + adds r1, r3, r5 + movs r0, 0x1 + strb r0, [r1] + b _080E7E4E +_080E7E30: + cmp r1, 0 + beq _080E7E48 +_080E7E34: + bl GenerateRandomNumber2 + mov r1, r9 + adds r2, r1, r5 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + strb r0, [r2] + b _080E7E4E +_080E7E48: + mov r2, r9 + adds r0, r2, r5 + strb r1, [r0] +_080E7E4E: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_080E7E54: + mov r0, r8 + adds r0, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + mov r8, r3 + ldr r1, [sp, 0x54] + cmp r0, r1 + bcc _080E7D84 +_080E7E64: + movs r2, 0 + mov r8, r2 + ldr r3, [sp, 0x44] + lsls r0, r3, 4 + subs r0, r3 + lsls r0, 3 + ldr r1, [sp, 0x2C] + adds r7, r1, r0 + ldr r1, [sp, 0x48] +_080E7E76: + mov r2, r8 + lsls r0, r2, 2 + adds r0, r1, r0 + str r7, [r0] + mov r0, r8 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r0, 0x3 + bls _080E7E76 + bl sub_80E7B54 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r1, r0, 24 + ldr r3, [sp, 0x34] + cmp r3, 0x3 + beq _080E7EC8 + cmp r3, 0x3 + bgt _080E7EAE + cmp r3, 0x2 + beq _080E7EB6 + b _080E7F1C +_080E7EAE: + ldr r0, [sp, 0x34] + cmp r0, 0x4 + beq _080E7EE8 + b _080E7F1C +_080E7EB6: + add r2, sp, 0x24 + movs r0, 0x1 + str r0, [sp] + ldr r0, [sp, 0x2C] + ldr r1, [sp, 0x30] + movs r3, 0 + bl sub_80E7AA4 + b _080E7F1C +_080E7EC8: + ldr r0, =gUnknown_0858CFB8 + lsls r1, 1 + adds r2, r1, r0 + ldrb r3, [r2] + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + add r2, sp, 0x24 + str r0, [sp] + ldr r0, [sp, 0x2C] + ldr r1, [sp, 0x30] + bl sub_80E7AA4 + b _080E7F1C + .pool +_080E7EE8: + add r6, sp, 0x24 + ldr r4, =gUnknown_0858CFBE + lsls r5, r1, 2 + adds r0, r5, r4 + ldrb r3, [r0] + adds r0, r4, 0x1 + adds r0, r5, r0 + ldrb r0, [r0] + str r0, [sp] + ldr r0, [sp, 0x2C] + ldr r1, [sp, 0x30] + adds r2, r6, 0 + bl sub_80E7AA4 + adds r0, r4, 0x2 + adds r0, r5, r0 + ldrb r3, [r0] + adds r4, 0x3 + adds r5, r4 + ldrb r0, [r5] + str r0, [sp] + ldr r0, [sp, 0x2C] + ldr r1, [sp, 0x30] + adds r2, r6, 0 + bl sub_80E7AA4 +_080E7F1C: + ldr r1, [sp, 0x2C] + ldr r2, [sp, 0x44] + adds r7, r1, r2 + ldr r4, =0x03005d8c + ldr r0, [r4] + movs r3, 0xC2 + lsls r3, 6 + adds r0, r3 + adds r1, r7, 0 + movs r2, 0x38 + bl memcpy + ldr r0, [r4] + ldr r1, =0x0000310c + adds r0, r1 + adds r1, r7, 0 + adds r1, 0x38 + movs r2, 0x38 + bl memcpy + ldr r0, [sp, 0x38] + bl SeedRng + 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_80E7B60 + + thumb_func_start sub_80E7F68 +sub_80E7F68: @ 80E7F68 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + cmp r1, 0 + beq _080E7FEC + ldrh r0, [r4] + cmp r0, 0 + beq _080E7FEC + bl sub_80D6C68 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bne _080E7FEC + ldrh r0, [r4] + movs r1, 0x1 + bl sub_80D6724 + lsls r0, 24 + cmp r0, 0 + bne _080E7FE4 + ldrh r0, [r4] + movs r1, 0x1 + bl sub_80D6D1C + lsls r0, 24 + cmp r0, 0 + bne _080E7FE4 + ldrh r0, [r4] + movs r1, 0x1 + bl bag_add_item + lsls r0, 24 + cmp r0, 0 + beq _080E7FE4 + ldr r0, =0x00004001 + ldrh r1, [r4] + bl VarSet + ldr r0, =0x02021cc4 + ldr r1, =0x020229f0 + bl CopyString + ldrh r1, [r4] + ldr r0, =0x00000113 + cmp r1, r0 + bne _080E7FEC + ldr r0, =0x000008b3 + bl FlagSet + b _080E7FEC + .pool +_080E7FE4: + ldr r0, =0x00004001 + movs r1, 0 + bl VarSet +_080E7FEC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E7F68 + + thumb_func_start sub_80E7FF8 +sub_80E7FF8: @ 80E7FF8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x9 + bls _080E8012 + b _080E810A +_080E8012: + lsls r0, 2 + ldr r1, =_080E8024 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080E8024: + .4byte _080E80F2 + .4byte _080E804C + .4byte _080E805A + .4byte _080E8064 + .4byte _080E807C + .4byte _080E8090 + .4byte _080E80A4 + .4byte _080E80C0 + .4byte _080E80EE + .4byte _080E80FA +_080E804C: + bl sub_800A064 + cmp r0, 0 + bne _080E80F2 + movs r0, 0x6 + strh r0, [r4, 0x8] + b _080E810A +_080E805A: + bl sub_8076D5C + bl sub_8153430 + b _080E80F2 +_080E8064: + bl sub_8153474 + lsls r0, 24 + cmp r0, 0 + beq _080E810A + bl sav2_gender2_inplace_and_xFE + movs r1, 0 + movs r0, 0x4 + strh r0, [r4, 0x8] + strh r1, [r4, 0xA] + b _080E810A +_080E807C: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + ble _080E810A + bl sub_800AC34 + b _080E80F2 +_080E8090: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _080E810A + adds r0, r5, 0 + bl DestroyTask + b _080E810A + .pool +_080E80A4: + movs r0, 0 + bl sub_801048C + lsls r0, 24 + cmp r0, 0 + bne _080E810A + ldr r0, =sub_8153688 + movs r1, 0x5 + bl CreateTask + b _080E80F2 + .pool +_080E80C0: + ldr r0, =sub_8153688 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + bne _080E810A + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _080E80E8 + movs r0, 0x1 + bl sub_801048C + movs r0, 0x8 + strh r0, [r4, 0x8] + b _080E810A + .pool +_080E80E8: + movs r0, 0x4 + strh r0, [r4, 0x8] + b _080E810A +_080E80EE: + bl sub_800ADF8 +_080E80F2: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080E810A +_080E80FA: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080E810A + adds r0, r5, 0 + bl DestroyTask +_080E810A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80E7FF8 + + thumb_func_start sub_80E8110 +sub_80E8110: @ 80E8110 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + str r0, [sp] + mov r10, r1 + adds r1, r0, 0 + adds r1, 0x38 + movs r0, 0xFF + strb r0, [r1] + ldr r1, [sp] + adds r1, 0x7C + movs r0, 0x1 + negs r0, r0 + strb r0, [r1] + ldr r0, [sp] + mov r1, r10 + movs r2, 0x44 + bl memcpy + movs r0, 0 + str r0, [sp, 0x8] + movs r1, 0 + str r1, [sp, 0xC] + movs r2, 0 + str r2, [sp, 0x4] + mov r8, r2 + movs r7, 0 + ldr r0, =0x03005d90 + mov r9, r0 +_080E8150: + mov r1, r9 + ldr r0, [r1] + adds r0, 0xB2 + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 30 + adds r0, r7, r0 + movs r1, 0x3 + bl __modsi3 + adds r6, r0, 0x1 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + mov r2, r10 + adds r1, r0, r2 + adds r0, r1, 0 + adds r0, 0x38 + ldrb r0, [r0] + cmp r0, 0xFF + beq _080E81B8 + adds r5, r1, 0 + adds r5, 0x34 + adds r0, r5, 0 + bl sub_80842DC + adds r4, r0, 0 + mov r1, r9 + ldr r0, [r1] + adds r0, 0xA + bl sub_80842DC + cmp r4, r0 + beq _080E819A + movs r2, 0x1 + add r8, r2 + str r6, [sp, 0x4] +_080E819A: + adds r0, r5, 0 + bl sub_80842DC + adds r4, r0, 0 + mov r1, r9 + ldr r0, [r1] + adds r0, 0xA + bl sub_80842DC + cmp r4, r0 + bne _080E81B8 + ldr r2, [sp, 0xC] + adds r2, 0x1 + str r2, [sp, 0xC] + str r6, [sp, 0x8] +_080E81B8: + adds r7, 0x1 + cmp r7, 0x1 + ble _080E8150 + mov r0, r8 + cmp r0, 0 + bne _080E81D0 + ldr r1, [sp, 0xC] + cmp r1, 0 + beq _080E81D0 + mov r8, r1 + ldr r2, [sp, 0x8] + str r2, [sp, 0x4] +_080E81D0: + mov r0, r8 + cmp r0, 0x1 + beq _080E81E0 + cmp r0, 0x2 + beq _080E81EC + b _080E824C + .pool +_080E81E0: + ldr r2, [sp, 0x4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r10 + b _080E820E +_080E81EC: + bl GenerateRandomNumber2 + lsls r0, 16 + ldr r1, =0x33330000 + cmp r0, r1 + bls _080E8224 + ldr r0, =0x03005d90 + ldr r0, [r0] + adds r0, 0xB2 + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 30 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r10 + adds r1, 0x44 +_080E820E: + ldr r0, [sp] + adds r0, 0x44 + movs r2, 0x44 + bl memcpy + b _080E824C + .pool +_080E8224: + ldr r0, =0x03005d90 + ldr r0, [r0] + adds r0, 0xB2 + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 30 + adds r0, 0x1 + movs r1, 0x3 + bl __modsi3 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r10 + adds r1, 0x44 + ldr r0, [sp] + adds r0, 0x44 + movs r2, 0x44 + bl memcpy +_080E824C: + 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_80E8110 + + thumb_func_start sub_80E8260 +sub_80E8260: @ 80E8260 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r8, r0 + movs r6, 0 + ldr r0, =0x03005d90 + mov r10, r0 +_080E8274: + movs r7, 0 + lsls r0, r6, 5 + adds r6, 0x1 + mov r9, r6 + mov r1, r8 + adds r4, r0, r1 + adds r0, 0x6 + adds r6, r1, r0 + adds r5, r4, 0 +_080E8286: + mov r2, r10 + ldr r1, [r2] + adds r1, 0xA + adds r0, r5, 0 + bl sub_80842F4 + movs r0, 0x2 + strb r0, [r4, 0xE] + mov r0, r10 + ldr r1, [r0] + adds r0, r6, 0 + bl CopyString + adds r4, 0x10 + adds r6, 0x10 + adds r5, 0x10 + adds r7, 0x1 + cmp r7, 0x1 + ble _080E8286 + mov r6, r9 + cmp r6, 0x8 + ble _080E8274 + ldr r1, =0x03005d90 + mov r10, r1 + ldr r2, =0x00000ee1 + str r2, [sp, 0x4] + movs r4, 0x99 + lsls r4, 1 + add r4, r8 + movs r0, 0x95 + lsls r0, 1 + add r0, r8 + mov r9, r0 + ldr r1, =0x00000ef1 + str r1, [sp, 0x8] + movs r6, 0x92 + lsls r6, 1 + add r6, r8 + movs r5, 0x90 + lsls r5, 1 + add r5, r8 + movs r7, 0x1 +_080E82DA: + movs r0, 0x2 + strb r0, [r4, 0x8] + mov r2, r10 + ldr r1, [r2] + adds r1, 0xA + adds r0, r5, 0 + bl sub_80842F4 + mov r0, r10 + ldr r1, [r0] + ldr r2, [sp, 0x8] + adds r1, r2 + adds r0, r6, 0 + bl sub_80842F4 + mov r0, r10 + ldr r1, [r0] + mov r0, r9 + bl CopyString + mov r2, r10 + ldr r1, [r2] + ldr r0, [sp, 0x4] + adds r1, r0 + adds r0, r4, 0 + bl CopyString + ldr r1, [sp, 0x4] + adds r1, 0x8 + str r1, [sp, 0x4] + adds r4, 0x1C + movs r2, 0x1C + add r9, r2 + ldr r0, [sp, 0x8] + adds r0, 0x4 + str r0, [sp, 0x8] + adds r6, 0x1C + adds r5, 0x1C + subs r7, 0x1 + cmp r7, 0 + bge _080E82DA + movs r6, 0 + ldr r0, =0x03005d90 + ldr r3, [r0] + mov r4, r8 + movs r1, 0xC4 + adds r1, r4 + mov r9, r1 + movs r2, 0x84 + adds r2, r4 + mov r8, r2 + movs r0, 0x44 + adds r0, r4 + mov r12, r0 + adds r7, r4, 0x4 + movs r1, 0xCF + lsls r1, 4 + adds r1, r3, r1 + str r1, [sp] + mov r10, r4 + ldr r2, =0x00000cf4 + adds r5, r3, r2 +_080E8356: + lsls r2, r6, 1 + ldr r1, [sp] + ldrh r0, [r1] + strh r0, [r7] + ldrh r0, [r5] + strh r0, [r7, 0x20] + ldrh r0, [r5, 0x4] + mov r1, r12 + strh r0, [r1] + ldr r1, =0x00000d14 + adds r0, r3, r1 + adds r0, r2 + ldrh r0, [r0] + mov r1, r12 + strh r0, [r1, 0x20] + movs r1, 0xDD + lsls r1, 4 + adds r0, r3, r1 + adds r0, r2 + ldrh r0, [r0] + mov r1, r8 + strh r0, [r1] + ldr r1, =0x00000dde + adds r0, r3, r1 + adds r0, r2 + ldrh r0, [r0] + mov r1, r8 + strh r0, [r1, 0x20] + ldr r1, =0x00000dea + adds r0, r3, r1 + adds r0, r2 + ldrh r0, [r0] + mov r1, r9 + strh r0, [r1] + ldr r1, =0x00000e08 + adds r0, r3, r1 + adds r0, r2 + ldrh r0, [r0] + mov r1, r9 + strh r0, [r1, 0x20] + ldr r1, =0x00000e1e + adds r0, r3, r1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x82 + lsls r0, 1 + add r0, r10 + strh r1, [r0] + ldr r1, =0x00000cfc + adds r0, r3, r1 + adds r0, r2 + ldrh r1, [r0] + movs r2, 0x94 + lsls r2, 1 + adds r0, r4, r2 + strh r1, [r0] + adds r4, 0x1C + movs r0, 0x10 + add r9, r0 + add r8, r0 + add r12, r0 + adds r7, 0x10 + ldr r1, [sp] + adds r1, 0x2 + str r1, [sp] + add r10, r0 + adds r5, 0x2 + adds r6, 0x1 + cmp r6, 0x1 + ble _080E8356 + 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_80E8260 + + thumb_func_start sub_80E841C +sub_80E841C: @ 80E841C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + movs r0, 0 + mov r8, r0 + adds r6, r1, 0 + adds r6, 0x34 + adds r5, r1, 0 +_080E842E: + adds r0, r7, 0 + adds r0, 0x34 + bl sub_80842DC + adds r4, r0, 0 + adds r0, r6, 0 + bl sub_80842DC + cmp r4, r0 + bne _080E844E + ldrb r0, [r7, 0x2] + ldrb r1, [r5, 0x2] + cmp r0, r1 + bne _080E844E + movs r0, 0x1 + b _080E845E +_080E844E: + adds r6, 0x44 + adds r5, 0x44 + movs r0, 0x1 + add r8, r0 + mov r1, r8 + cmp r1, 0x3 + ble _080E842E + movs r0, 0 +_080E845E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80E841C + + thumb_func_start sub_80E8468 +sub_80E8468: @ 80E8468 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + adds r6, r0, 0 + adds r5, r1, 0 + adds r4, r2, 0 + mov r0, sp + bl sub_80E7830 + lsls r4, 2 + mov r1, sp + adds r0, r1, r4 + ldr r0, [r0] + muls r0, r5 + adds r3, r6, r0 + movs r7, 0 + movs r2, 0 + mov r8, r2 + movs r5, 0 + adds r6, r3, 0 + adds r6, 0x38 + adds r4, r3, 0 +_080E8496: + ldrb r0, [r6] + cmp r0, 0xFF + beq _080E84B4 + ldr r0, =0x03005d90 + ldr r1, [r0] + adds r1, 0xDC + adds r0, r4, 0 + str r3, [sp, 0x10] + bl sub_80E841C + ldr r3, [sp, 0x10] + cmp r0, 0 + bne _080E84B4 + adds r7, 0x1 + mov r8, r5 +_080E84B4: + adds r6, 0x44 + adds r4, 0x44 + adds r5, 0x1 + cmp r5, 0x1 + ble _080E8496 + cmp r7, 0x1 + beq _080E84CC + cmp r7, 0x2 + beq _080E8508 + b _080E8566 + .pool +_080E84CC: + ldr r4, =0x03005d90 + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xB2 + ldrb r1, [r1] + lsls r1, 27 + lsrs r1, 30 + adds r2, r1, 0x1 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r0, r1 + adds r0, 0xDC + mov r2, r8 + lsls r1, r2, 4 + add r1, r8 + lsls r1, 2 + adds r1, r3 + movs r2, 0x44 + bl memcpy + ldr r4, [r4] + adds r4, 0xB2 + ldrb r5, [r4] + lsls r0, r5, 27 + lsrs r0, 30 + adds r0, 0x1 + b _080E8550 + .pool +_080E8508: + movs r5, 0 + adds r6, r3, 0 +_080E850C: + movs r0, 0x1 + eors r0, r5 + ldr r7, =0x03005d90 + ldr r4, [r7] + adds r1, r4, 0 + adds r1, 0xB2 + ldrb r1, [r1] + lsls r1, 27 + lsrs r1, 30 + adds r0, r1 + movs r1, 0x3 + bl __modsi3 + adds r2, r0, 0x1 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r4, r0 + adds r4, 0xDC + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x44 + bl memcpy + adds r6, 0x44 + adds r5, 0x1 + cmp r5, 0x1 + ble _080E850C + ldr r4, [r7] + adds r4, 0xB2 + ldrb r5, [r4] + lsls r0, r5, 27 + lsrs r0, 30 + adds r0, 0x2 +_080E8550: + movs r1, 0x3 + bl __modsi3 + movs r1, 0x3 + ands r0, r1 + lsls r0, 3 + movs r1, 0x19 + negs r1, r1 + ands r1, r5 + orrs r1, r0 + strb r1, [r4] +_080E8566: + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E8468 + + thumb_func_start sub_80E8578 +sub_80E8578: @ 80E8578 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x54 + str r0, [sp] + ldr r0, [sp, 0x74] + movs r4, 0 + mov r8, r4 + movs r5, 0 + str r5, [sp, 0x4] + ldr r4, =0x03001168 + b _080E85A0 + .pool +_080E8598: + adds r1, r2 + ldr r6, [sp, 0x4] + adds r6, 0x1 + str r6, [sp, 0x4] +_080E85A0: + ldr r5, [sp, 0x4] + cmp r5, r0 + bge _080E85B6 + cmp r5, r3 + beq _080E85B0 + stm r4!, {r1} + movs r6, 0x1 + add r8, r6 +_080E85B0: + mov r5, r8 + cmp r5, 0x3 + bne _080E8598 +_080E85B6: + movs r6, 0 + str r6, [sp, 0x4] + subs r0, 0x1 + str r0, [sp, 0x24] +_080E85BE: + movs r0, 0 + str r0, [sp, 0x8] + ldr r1, [sp, 0x4] + adds r1, 0x1 + str r1, [sp, 0x28] + ldr r2, [sp, 0x4] + lsls r2, 1 + str r2, [sp, 0x34] + ldr r3, [sp, 0x4] + adds r3, r2, r3 + str r3, [sp, 0x10] + movs r4, 0 + str r4, [sp, 0x44] + movs r5, 0 + str r5, [sp, 0x48] +_080E85DC: + movs r6, 0 + mov r8, r6 + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r2, [sp, 0x10] + lsls r0, r2, 5 + ldr r3, [sp, 0x48] + adds r0, r3, r0 + adds r3, r0, r1 + lsls r0, r2, 6 + ldr r4, [sp, 0x44] + adds r0, r4, r0 + ldr r5, [sp] + adds r2, r0, r5 +_080E85F8: + adds r0, r2, 0 + movs r6, 0x87 + lsls r6, 2 + adds r1, r3, r6 + ldm r1!, {r4-r6} + stm r0!, {r4-r6} + ldr r1, [r1] + str r1, [r0] + adds r3, 0x10 + adds r2, 0x10 + movs r0, 0x1 + add r8, r0 + mov r1, r8 + cmp r1, 0x2 + ble _080E85F8 + movs r2, 0 + mov r8, r2 + ldr r3, [sp, 0x24] + cmp r8, r3 + bge _080E86DC + ldr r4, [sp, 0x4] + lsls r4, 5 + mov r9, r4 + ldr r5, [sp, 0x8] + lsls r7, r5, 4 + ldr r6, [sp, 0x34] + ldr r1, [sp, 0x4] + adds r0, r6, r1 + lsls r0, 6 + str r0, [sp, 0x14] + ldr r2, [sp] + adds r0, r2, r0 + ldr r3, [sp, 0x44] + str r3, [sp, 0x18] + adds r0, r3 + str r0, [sp, 0x1C] + ldr r4, [sp, 0x14] + adds r0, r3, r4 + adds r0, r2 + adds r0, 0x30 + mov r10, r0 +_080E864A: + movs r5, 0 + str r5, [sp, 0xC] + movs r3, 0 + mov r6, r8 + lsls r6, 2 + str r6, [sp, 0x38] + ldr r1, [sp, 0x18] + ldr r2, [sp, 0x14] + adds r0, r1, r2 + ldr r4, [sp] + adds r5, r0, r4 + ldr r0, =0x03001168 + adds r0, r6, r0 + str r0, [sp, 0x50] +_080E8666: + lsls r0, r3, 4 + ldr r6, [sp, 0x1C] + adds r0, r6, r0 + str r3, [sp, 0x4C] + bl sub_80842DC + adds r4, r0, 0 + ldr r1, [sp, 0x50] + ldr r0, [r1] + add r0, r9 + adds r0, r7 + bl sub_80842DC + ldr r3, [sp, 0x4C] + cmp r4, r0 + bne _080E86A8 + ldr r2, [sp, 0xC] + adds r2, 0x1 + str r2, [sp, 0xC] + ldr r4, [sp, 0x50] + ldr r0, [r4] + mov r6, r9 + adds r1, r7, r6 + adds r1, r0, r1 + ldrh r0, [r5, 0x4] + ldrh r2, [r1, 0x4] + cmp r0, r2 + bcs _080E86A8 + adds r0, r5, 0 + ldm r1!, {r2,r4,r6} + stm r0!, {r2,r4,r6} + ldr r1, [r1] + str r1, [r0] +_080E86A8: + adds r5, 0x10 + adds r3, 0x1 + cmp r3, 0x2 + ble _080E8666 + ldr r3, [sp, 0xC] + cmp r3, 0 + bne _080E86CE + ldr r0, =0x03001168 + ldr r4, [sp, 0x38] + adds r0, r4, r0 + ldr r0, [r0] + mov r5, r9 + adds r2, r7, r5 + mov r1, r10 + adds r0, r2 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldr r0, [r0] + str r0, [r1] +_080E86CE: + movs r4, 0x10 + add r10, r4 + movs r5, 0x1 + add r8, r5 + ldr r6, [sp, 0x24] + cmp r8, r6 + blt _080E864A +_080E86DC: + ldr r0, [sp, 0x44] + adds r0, 0x60 + str r0, [sp, 0x44] + ldr r1, [sp, 0x48] + adds r1, 0x30 + str r1, [sp, 0x48] + ldr r2, [sp, 0x8] + adds r2, 0x1 + str r2, [sp, 0x8] + cmp r2, 0x1 + bgt _080E86F4 + b _080E85DC +_080E86F4: + ldr r3, [sp, 0x28] + str r3, [sp, 0x4] + cmp r3, 0x8 + bgt _080E86FE + b _080E85BE +_080E86FE: + movs r4, 0 + str r4, [sp, 0x8] +_080E8702: + ldr r5, [sp, 0x8] + adds r5, 0x1 + str r5, [sp, 0x2C] + ldr r0, =0x03005d90 + ldr r1, [r0] + movs r0, 0x54 + ldr r6, [sp, 0x8] + muls r0, r6 + adds r3, r0, r1 + movs r0, 0xA8 + muls r0, r6 + ldr r1, [sp] + adds r2, r0, r1 + movs r4, 0x2 + mov r8, r4 +_080E8720: + movs r5, 0xD8 + lsls r5, 3 + adds r0, r2, r5 + ldr r6, =0x0000057c + adds r1, r3, r6 + ldm r1!, {r4-r6} + stm r0!, {r4-r6} + ldm r1!, {r4-r6} + stm r0!, {r4-r6} + ldr r1, [r1] + str r1, [r0] + adds r3, 0x1C + adds r2, 0x1C + movs r0, 0x1 + negs r0, r0 + add r8, r0 + mov r1, r8 + cmp r1, 0 + bge _080E8720 + movs r2, 0 + mov r8, r2 + ldr r3, [sp, 0x24] + cmp r8, r3 + blt _080E8752 + b _080E885A +_080E8752: + ldr r4, [sp, 0x8] + lsls r1, r4, 3 + movs r0, 0xA8 + adds r5, r4, 0 + muls r5, r0 + str r5, [sp, 0x20] + str r5, [sp, 0x3C] + subs r1, r4 + lsls r1, 2 + mov r10, r1 +_080E8766: + movs r6, 0 + str r6, [sp, 0xC] + mov r0, r8 + lsls r0, 2 + str r0, [sp, 0x38] + mov r1, r8 + adds r1, 0x1 + str r1, [sp, 0x30] + ldr r0, =0x03001168 + ldr r2, [sp, 0x38] + adds r2, r0 + mov r9, r2 + ldr r3, [sp] + movs r4, 0xD8 + lsls r4, 3 + adds r0, r3, r4 + ldr r5, [sp, 0x3C] + adds r7, r5, r0 + str r6, [sp, 0x40] + movs r3, 0x2 +_080E878E: + ldr r1, [sp, 0x20] + movs r2, 0xD8 + lsls r2, 3 + adds r0, r1, r2 + ldr r4, [sp] + adds r0, r4, r0 + ldr r6, [sp, 0x40] + adds r5, r0, r6 + adds r0, r5, 0 + str r3, [sp, 0x4C] + bl sub_80842DC + adds r4, r0, 0 + movs r6, 0x90 + lsls r6, 1 + add r6, r10 + mov r1, r9 + ldr r0, [r1] + adds r0, r6 + bl sub_80842DC + ldr r3, [sp, 0x4C] + cmp r4, r0 + bne _080E8808 + adds r0, r5, 0x4 + bl sub_80842DC + adds r4, r0, 0 + mov r2, r9 + ldr r0, [r2] + adds r0, r6 + adds r0, 0x4 + bl sub_80842DC + ldr r3, [sp, 0x4C] + cmp r4, r0 + bne _080E8808 + ldr r4, [sp, 0xC] + adds r4, 0x1 + str r4, [sp, 0xC] + mov r5, r9 + ldr r0, [r5] + mov r6, r10 + adds r2, r0, r6 + movs r0, 0x94 + lsls r0, 1 + adds r1, r2, r0 + ldrh r0, [r7, 0x8] + ldrh r1, [r1] + cmp r0, r1 + bcs _080E8808 + adds r0, r7, 0 + movs r4, 0x90 + lsls r4, 1 + adds r1, r2, r4 + ldm r1!, {r2,r5,r6} + stm r0!, {r2,r5,r6} + ldm r1!, {r4-r6} + stm r0!, {r4-r6} + ldr r1, [r1] + str r1, [r0] +_080E8808: + adds r7, 0x1C + ldr r0, [sp, 0x40] + adds r0, 0x1C + str r0, [sp, 0x40] + subs r3, 0x1 + cmp r3, 0 + bge _080E878E + ldr r1, [sp, 0xC] + cmp r1, 0 + bne _080E8850 + mov r0, r8 + adds r0, 0x3 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r2, [sp, 0x20] + adds r1, r2 + ldr r3, [sp] + adds r1, r3, r1 + ldr r0, =0x03001168 + ldr r4, [sp, 0x38] + adds r0, r4, r0 + ldr r0, [r0] + add r0, r10 + movs r5, 0xD8 + lsls r5, 3 + adds r1, r5 + movs r6, 0x90 + lsls r6, 1 + adds r0, r6 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r5,r6} + stm r1!, {r2,r5,r6} + ldr r0, [r0] + str r0, [r1] +_080E8850: + ldr r3, [sp, 0x30] + mov r8, r3 + ldr r4, [sp, 0x24] + cmp r8, r4 + blt _080E8766 +_080E885A: + ldr r5, [sp, 0x2C] + str r5, [sp, 0x8] + cmp r5, 0x1 + bgt _080E8864 + b _080E8702 +_080E8864: + add sp, 0x54 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E8578 + + thumb_func_start sub_80E8880 +sub_80E8880: @ 80E8880 + push {r4-r7,lr} + mov r12, r0 + adds r7, r1, 0 + movs r5, 0 +_080E8888: + movs r2, 0 + movs r4, 0x1 + negs r4, r4 + movs r1, 0 + adds r6, r5, 0x1 + adds r3, r7, 0 +_080E8894: + ldrh r0, [r3, 0x4] + cmp r0, r2 + ble _080E889E + adds r4, r1, 0 + adds r2, r0, 0 +_080E889E: + adds r3, 0x10 + adds r1, 0x1 + cmp r1, 0x5 + ble _080E8894 + cmp r4, 0 + blt _080E88C0 + lsls r1, r5, 4 + lsls r2, r4, 4 + adds r2, r7 + add r1, r12 + 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] +_080E88C0: + adds r5, r6, 0 + cmp r5, 0x2 + ble _080E8888 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E8880 + + thumb_func_start sub_80E88CC +sub_80E88CC: @ 80E88CC + push {r4-r7,lr} + mov r12, r0 + adds r6, r1, 0 + movs r5, 0 +_080E88D4: + movs r3, 0 + movs r4, 0x1 + negs r4, r4 + movs r2, 0 + adds r7, r5, 0x1 + adds r1, r6, 0 +_080E88E0: + ldrh r0, [r1, 0x8] + cmp r0, r3 + ble _080E88EA + adds r4, r2, 0 + adds r3, r0, 0 +_080E88EA: + adds r1, 0x1C + adds r2, 0x1 + cmp r2, 0x5 + ble _080E88E0 + cmp r4, 0 + blt _080E8918 + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + lsls r2, r4, 3 + subs r2, r4 + lsls r2, 2 + adds r2, r6 + add r1, r12 + adds r0, r2, 0 + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldr r0, [r0] + str r0, [r1] + movs r0, 0 + strh r0, [r2, 0x8] +_080E8918: + adds r5, r7, 0 + cmp r5, 0x2 + ble _080E88D4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E88CC + + thumb_func_start sub_80E8924 +sub_80E8924: @ 80E8924 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r0 + movs r0, 0 + ldr r1, =0x03005d90 + mov r10, r1 +_080E8936: + lsls r1, r0, 1 + adds r2, r0, 0x1 + mov r8, r2 + adds r1, r0 + lsls r0, r1, 5 + movs r2, 0x87 + lsls r2, 2 + adds r7, r0, r2 + lsls r1, 6 + mov r0, r9 + adds r4, r0, r1 + movs r6, 0 + movs r5, 0x1 +_080E8950: + mov r1, r10 + ldr r0, [r1] + adds r0, r7 + adds r0, r6 + adds r1, r4, 0 + bl sub_80E8880 + adds r4, 0x60 + adds r6, 0x30 + subs r5, 0x1 + cmp r5, 0 + bge _080E8950 + mov r0, r8 + cmp r0, 0x8 + ble _080E8936 + movs r5, 0 + ldr r4, =0x03005d90 +_080E8972: + movs r0, 0x54 + adds r1, r5, 0 + muls r1, r0 + ldr r2, =0x0000057c + adds r1, r2 + ldr r0, [r4] + adds r0, r1 + movs r1, 0xA8 + muls r1, r5 + movs r2, 0xD8 + lsls r2, 3 + adds r1, r2 + add r1, r9 + bl sub_80E88CC + adds r5, 0x1 + cmp r5, 0x1 + ble _080E8972 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E8924 + + thumb_func_start sub_80E89AC +sub_80E89AC: @ 80E89AC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r6, r0, 0 + mov r8, r1 + mov r9, r2 + bl sub_8009FCC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x81 + lsls r0, 4 + bl AllocZeroed + adds r5, r0, 0 + str r4, [sp] + adds r1, r6, 0 + mov r2, r8 + mov r3, r9 + bl sub_80E8578 + adds r0, r5, 0 + bl sub_80E8924 + adds r0, r5, 0 + bl Free + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80E89AC + + thumb_func_start sub_80E89F8 +sub_80E89F8: @ 80E89F8 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r5, =0x02039f9c + ldr r4, =0x03005d8c + ldr r1, [r4] + movs r0, 0xC2 + lsls r0, 6 + adds r1, r0 + adds r0, r5, 0 + movs r2, 0x38 + bl memcpy + ldr r1, [r4] + ldr r0, =0x0000310c + adds r1, r0 + adds r0, r5, 0 + adds r0, 0x38 + movs r2, 0x38 + bl memcpy + ldr r0, [r4] + ldr r1, =0x00003030 + adds r0, r1 + adds r1, r5, 0 + bl sub_806FA9C + ldr r0, =0x03001148 + ldr r1, [r0] + adds r0, r6, 0 + movs r2, 0x78 + bl memcpy + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E89F8 + + thumb_func_start sub_80E8A54 +sub_80E8A54: @ 80E8A54 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r5, r0, 0 + movs r0, 0 + mov r9, r0 + ldr r0, [r5, 0x70] + cmp r9, r0 + bcs _080E8AAE + adds r4, r5, 0 + adds r4, 0x2C + movs r0, 0x24 + adds r0, r5 + mov r8, r0 + adds r7, r5, 0 + adds r7, 0x37 + adds r6, r5, 0 +_080E8A78: + ldrh r0, [r6, 0x20] + cmp r0, 0 + beq _080E8A9A + ldrb r1, [r4, 0xB] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + beq _080E8A90 + mov r0, r8 + movs r1, 0xFC + bl sub_81DB4DC +_080E8A90: + ldrb r1, [r7] + lsrs r1, 4 + adds r0, r4, 0 + bl StopMusicWhileStringIsPrinted +_080E8A9A: + adds r4, 0x38 + movs r0, 0x38 + add r8, r0 + adds r7, 0x38 + adds r6, 0x38 + movs r0, 0x1 + add r9, r0 + ldr r0, [r5, 0x70] + cmp r9, r0 + bcc _080E8A78 +_080E8AAE: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E8A54 + + thumb_func_start TaskDummy4 +TaskDummy4: @ 80E8ABC + bx lr + thumb_func_end TaskDummy4 + + thumb_func_start sub_80E8AC0 +sub_80E8AC0: @ 80E8AC0 + push {r4,r5,lr} + adds r5, r0, 0 + movs r4, 0 +_080E8AC6: + movs r0, 0x2C + muls r0, r4 + adds r0, 0x34 + adds r1, r5, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _080E8ADC + adds r0, r1, 0 + adds r0, 0x20 + bl StripExtendedControlCodes +_080E8ADC: + adds r4, 0x1 + cmp r4, 0x3 + ble _080E8AC6 + adds r0, r5, 0 + bl sub_8164F70 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80E8AC0 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/region_map.s b/asm/region_map.s new file mode 100644 index 000000000..12a96e77b --- /dev/null +++ b/asm/region_map.s @@ -0,0 +1,4288 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8122CDC +sub_8122CDC: @ 8122CDC + push {lr} + lsls r2, r1, 24 + lsrs r2, 24 + movs r1, 0 + bl sub_8122CF8 +_08122CE8: + bl sub_8122DB0 + lsls r0, 24 + cmp r0, 0 + bne _08122CE8 + pop {r0} + bx r0 + thumb_func_end sub_8122CDC + + thumb_func_start sub_8122CF8 +sub_8122CF8: @ 8122CF8 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r3, =0x0203a144 + str r0, [r3] + movs r1, 0x79 + adds r1, r0 + mov r12, r1 + movs r1, 0 + mov r5, r12 + strb r1, [r5] + adds r0, 0x78 + strb r2, [r0] + ldr r1, [r3] + cmp r2, 0x1 + bne _08122D28 + ldr r0, =sub_8123254 + b _08122D2A + .pool +_08122D28: + ldr r0, =sub_81230C4 +_08122D2A: + str r0, [r1, 0x18] + cmp r4, 0 + beq _08122D64 + ldr r1, [r3] + ldr r0, [r4] + lsls r0, 30 + lsrs r0, 30 + adds r1, 0x80 + strb r0, [r1] + ldr r1, [r3] + ldr r0, [r4] + lsls r0, 28 + lsrs r0, 30 + adds r1, 0x81 + strb r0, [r1] + ldr r1, [r3] + ldr r0, [r4] + lsls r0, 23 + lsrs r0, 27 + adds r1, 0x82 + strb r0, [r1] + ldr r0, [r3] + adds r0, 0x83 + movs r1, 0x1 + strb r1, [r0] + b _08122D80 + .pool +_08122D64: + ldr r0, [r3] + adds r0, 0x80 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r3] + adds r0, 0x81 + strb r1, [r0] + ldr r0, [r3] + adds r0, 0x82 + movs r1, 0x1C + strb r1, [r0] + ldr r0, [r3] + adds r0, 0x83 + strb r4, [r0] +_08122D80: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8122CF8 + + thumb_func_start sub_8122D88 +sub_8122D88: @ 8122D88 + push {r4,lr} + ldr r4, =0x0203a144 + str r0, [r4] + bl sub_81238AC + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x54 + ldrh r1, [r0] + adds r0, 0x20 + strh r1, [r0] + subs r0, 0x1E + ldrh r1, [r0] + adds r0, 0x20 + strh r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8122D88 + + thumb_func_start sub_8122DB0 +sub_8122DB0: @ 8122DB0 + push {r4,r5,lr} + sub sp, 0xC + ldr r0, =0x0203a144 + ldr r0, [r0] + adds r0, 0x79 + ldrb r0, [r0] + cmp r0, 0x7 + bls _08122DC2 + b _0812300C +_08122DC2: + lsls r0, 2 + ldr r1, =_08122DD4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08122DD4: + .4byte _08122DF4 + .4byte _08122E2C + .4byte _08122E78 + .4byte _08122E94 + .4byte _08122EB0 + .4byte _08122ECC + .4byte _08122F10 + .4byte _08122F8C +_08122DF4: + ldr r0, =0x0203a144 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x83 + ldrb r0, [r0] + cmp r0, 0 + beq _08122E18 + adds r0, r1, 0 + adds r0, 0x80 + ldrb r0, [r0] + ldr r1, =gUnknown_0859F77C + movs r2, 0 + str r2, [sp] + b _08122E52 + .pool +_08122E18: + ldr r0, =gUnknown_0859F77C + ldr r1, =0x06008000 + bl LZ77UnCompVram + b _08123014 + .pool +_08122E2C: + ldr r4, =0x0203a144 + ldr r0, [r4] + adds r0, 0x83 + ldrb r0, [r0] + cmp r0, 0 + beq _08122E64 + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + beq _08122E44 + b _08123014 +_08122E44: + ldr r0, [r4] + adds r0, 0x80 + ldrb r0, [r0] + ldr r1, =gUnknown_085A04E0 + movs r2, 0x1 + str r2, [sp] + movs r2, 0 +_08122E52: + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _08123014 + .pool +_08122E64: + ldr r0, =gUnknown_085A04E0 + ldr r1, =0x0600e000 + bl LZ77UnCompVram + b _08123014 + .pool +_08122E78: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + beq _08122E84 + b _08123014 +_08122E84: + ldr r0, =gUnknown_0859F73C + movs r1, 0x70 + movs r2, 0x60 + bl gpu_pal_apply + b _08123014 + .pool +_08122E94: + ldr r0, =gUnknown_0859F60C + ldr r1, =0x0203a144 + ldr r1, [r1] + movs r2, 0xC2 + lsls r2, 1 + adds r1, r2 + bl LZ77UnCompWram + b _08123014 + .pool +_08122EB0: + ldr r0, =gUnknown_0859F650 + ldr r1, =0x0203a144 + ldr r1, [r1] + movs r5, 0xA1 + lsls r5, 2 + adds r1, r5 + bl LZ77UnCompWram + b _08123014 + .pool +_08122ECC: + bl sub_81238AC + ldr r4, =0x0203a144 + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x54 + ldrh r1, [r0] + adds r0, 0x20 + strh r1, [r0] + subs r0, 0x1E + ldrh r0, [r0] + adds r1, r2, 0 + adds r1, 0x76 + strh r0, [r1] + ldrh r0, [r2] + bl sub_8123EB4 + ldr r1, [r4] + strh r0, [r1] + ldrh r0, [r1] + bl get_flagnr_blue_points + ldr r1, [r4] + strb r0, [r1, 0x2] + ldr r1, [r4] + adds r0, r1, 0x4 + ldrh r1, [r1] + movs r2, 0x10 + bl GetMapName + b _08123014 + .pool +_08122F10: + ldr r0, =0x0203a144 + ldr r4, [r0] + adds r0, r4, 0 + adds r0, 0x78 + ldrb r1, [r0] + cmp r1, 0 + bne _08122F3C + movs r0, 0x80 + lsls r0, 1 + str r0, [sp] + str r0, [sp, 0x4] + str r1, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_81236C4 + b _08123014 + .pool +_08122F3C: + adds r1, r4, 0 + adds r1, 0x54 + ldrh r0, [r1] + lsls r0, 3 + subs r0, 0x34 + adds r2, r4, 0 + adds r2, 0x5C + movs r3, 0 + strh r0, [r2] + movs r0, 0x56 + adds r0, r4 + mov r12, r0 + ldrh r0, [r0] + lsls r0, 3 + subs r0, 0x44 + adds r5, r4, 0 + adds r5, 0x5E + strh r0, [r5] + ldrh r1, [r1] + adds r0, r4, 0 + adds r0, 0x64 + strh r1, [r0] + mov r0, r12 + ldrh r1, [r0] + adds r0, r4, 0 + adds r0, 0x66 + strh r1, [r0] + movs r1, 0 + ldrsh r0, [r2, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + movs r2, 0x80 + str r2, [sp] + str r2, [sp, 0x4] + str r3, [sp, 0x8] + movs r2, 0x38 + movs r3, 0x48 + bl sub_81236C4 + b _08123014 +_08122F8C: + bl sub_8123FB0 + bl sub_81237B4 + ldr r4, =0x0203a144 + ldr r0, [r4] + movs r1, 0 + str r1, [r0, 0x1C] + str r1, [r0, 0x20] + adds r0, 0x7A + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x7E + strb r1, [r0] + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x83 + ldrb r0, [r0] + cmp r0, 0 + beq _08123002 + adds r0, r1, 0 + adds r0, 0x80 + ldrb r0, [r0] + movs r1, 0x3 + movs r2, 0x2 + bl SetBgAttribute + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x80 + ldrb r0, [r0] + adds r1, 0x81 + ldrb r2, [r1] + movs r1, 0x1 + bl SetBgAttribute + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x80 + ldrb r0, [r0] + adds r1, 0x82 + ldrb r2, [r1] + movs r1, 0x2 + bl SetBgAttribute + ldr r0, [r4] + adds r0, 0x80 + ldrb r0, [r0] + movs r1, 0x6 + movs r2, 0x1 + bl SetBgAttribute + ldr r0, [r4] + adds r0, 0x80 + ldrb r0, [r0] + movs r1, 0x4 + movs r2, 0x1 + bl SetBgAttribute +_08123002: + ldr r1, [r4] + adds r1, 0x79 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0812300C: + movs r0, 0 + b _08123022 + .pool +_08123014: + ldr r0, =0x0203a144 + ldr r1, [r0] + adds r1, 0x79 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0x1 +_08123022: + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8122DB0 + + thumb_func_start sub_8123030 +sub_8123030: @ 8123030 + push {lr} + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0xE0 + lsls r0, 2 + lsls r1, 24 + lsrs r1, 24 + bl sub_80A2A20 + ldr r0, =0x02037bf4 + ldr r1, =0x020377f4 + movs r2, 0x30 + bl CpuSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_8123030 + + thumb_func_start sub_812305C +sub_812305C: @ 812305C + push {r4,lr} + ldr r4, =0x0203a144 + ldr r0, [r4] + ldr r0, [r0, 0x1C] + cmp r0, 0 + beq _08123080 + bl RemoveObjectAndFreeTiles + ldr r0, [r4] + adds r0, 0x58 + ldrh r0, [r0] + bl FreeObjectTilesByTag + ldr r0, [r4] + adds r0, 0x5A + ldrh r0, [r0] + bl FreeObjectPaletteByTag +_08123080: + ldr r0, [r4] + ldr r0, [r0, 0x20] + cmp r0, 0 + beq _081230A0 + bl RemoveObjectAndFreeTiles + ldr r0, [r4] + adds r0, 0x70 + ldrh r0, [r0] + bl FreeObjectTilesByTag + ldr r0, [r4] + adds r0, 0x72 + ldrh r0, [r0] + bl FreeObjectPaletteByTag +_081230A0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812305C + + thumb_func_start sub_81230AC +sub_81230AC: @ 81230AC + push {lr} + ldr r0, =0x0203a144 + ldr r0, [r0] + ldr r0, [r0, 0x18] + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81230AC + + thumb_func_start sub_81230C4 +sub_81230C4: @ 81230C4 + push {r4,lr} + movs r4, 0 + ldr r2, =0x0203a144 + ldr r0, [r2] + adds r0, 0x7B + strb r4, [r0] + ldr r0, [r2] + adds r0, 0x7C + strb r4, [r0] + ldr r3, =0x030022c0 + ldrh r1, [r3, 0x2C] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081230F6 + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0x56 + ldrh r0, [r0] + cmp r0, 0x2 + bls _081230F6 + adds r1, 0x7C + movs r0, 0xFF + strb r0, [r1] + movs r4, 0x1 +_081230F6: + ldrh r1, [r3, 0x2C] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08123114 + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0x56 + ldrh r0, [r0] + cmp r0, 0xF + bhi _08123114 + adds r1, 0x7C + movs r0, 0x1 + strb r0, [r1] + movs r4, 0x1 +_08123114: + ldrh r1, [r3, 0x2C] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08123132 + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0x54 + ldrh r0, [r0] + cmp r0, 0x1 + bls _08123132 + adds r1, 0x7B + movs r0, 0xFF + strb r0, [r1] + movs r4, 0x1 +_08123132: + ldrh r1, [r3, 0x2C] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08123150 + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0x54 + ldrh r0, [r0] + cmp r0, 0x1B + bhi _08123150 + adds r1, 0x7B + movs r0, 0x1 + strb r0, [r1] + movs r4, 0x1 +_08123150: + ldrh r3, [r3, 0x2E] + movs r0, 0x1 + ands r0, r3 + cmp r0, 0 + beq _08123168 + movs r4, 0x4 + b _08123172 + .pool +_08123168: + movs r0, 0x2 + ands r0, r3 + cmp r0, 0 + beq _08123172 + movs r4, 0x5 +_08123172: + cmp r4, 0x1 + bne _08123184 + ldr r0, [r2] + adds r0, 0x7A + movs r1, 0x4 + strb r1, [r0] + ldr r1, [r2] + ldr r0, =_swiopen + str r0, [r1, 0x18] +_08123184: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81230C4 + + thumb_func_start _swiopen +_swiopen: @ 8123190 + push {r4,r5,lr} + ldr r5, =0x0203a144 + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x7A + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + beq _081231AC + movs r0, 0x2 + b _08123248 + .pool +_081231AC: + adds r0, r1, 0 + adds r0, 0x7B + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + ble _081231C2 + adds r1, 0x54 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_081231C2: + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x7B + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bge _081231DA + adds r1, 0x54 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] +_081231DA: + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x7C + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + ble _081231F2 + adds r1, 0x56 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_081231F2: + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x7C + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bge _0812320A + adds r1, 0x56 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] +_0812320A: + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x54 + ldrh r0, [r0] + adds r1, 0x56 + ldrh r1, [r1] + bl sub_812386C + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl get_flagnr_blue_points + ldr r1, [r5] + strb r0, [r1, 0x2] + ldr r1, [r5] + ldrh r0, [r1] + cmp r4, r0 + beq _0812323C + strh r4, [r1] + adds r0, r1, 0x4 + ldrh r1, [r1] + movs r2, 0x10 + bl GetMapName +_0812323C: + bl sub_8123FB0 + ldr r1, [r5] + ldr r0, =sub_81230C4 + str r0, [r1, 0x18] + movs r0, 0x3 +_08123248: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end _swiopen + + thumb_func_start sub_8123254 +sub_8123254: @ 8123254 + push {r4-r6,lr} + movs r4, 0 + ldr r3, =0x0203a144 + ldr r0, [r3] + mov r12, r0 + adds r0, 0x6A + strh r4, [r0] + mov r5, r12 + adds r5, 0x68 + strh r4, [r5] + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2C] + movs r0, 0x40 + ands r0, r1 + adds r6, r3, 0 + adds r3, r2, 0 + cmp r0, 0 + beq _0812328E + mov r0, r12 + adds r0, 0x5E + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0x34 + negs r0, r0 + cmp r1, r0 + ble _0812328E + ldr r0, =0x0000ffff + strh r0, [r5] + movs r4, 0x1 +_0812328E: + ldrh r1, [r3, 0x2C] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081232AE + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0x5E + movs r5, 0 + ldrsh r0, [r0, r5] + cmp r0, 0x3B + bgt _081232AE + adds r1, 0x68 + movs r0, 0x1 + strh r0, [r1] + movs r4, 0x1 +_081232AE: + ldrh r1, [r3, 0x2C] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _081232D4 + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0x5C + movs r5, 0 + ldrsh r1, [r0, r5] + movs r0, 0x2C + negs r0, r0 + cmp r1, r0 + ble _081232D4 + adds r1, r2, 0 + adds r1, 0x6A + ldr r0, =0x0000ffff + strh r0, [r1] + movs r4, 0x1 +_081232D4: + ldrh r1, [r3, 0x2C] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081232F4 + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0x5C + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0xAB + bgt _081232F4 + adds r1, 0x6A + movs r0, 0x1 + strh r0, [r1] + movs r4, 0x1 +_081232F4: + ldrh r2, [r3, 0x2E] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _08123300 + movs r4, 0x4 +_08123300: + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _0812330A + movs r4, 0x5 +_0812330A: + cmp r4, 0x1 + bne _0812331A + ldr r0, [r6] + ldr r1, =sub_8123334 + str r1, [r0, 0x18] + adds r0, 0x6C + movs r1, 0 + strh r1, [r0] +_0812331A: + adds r0, r4, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8123254 + + thumb_func_start sub_8123334 +sub_8123334: @ 8123334 + push {r4,r5,lr} + ldr r5, =0x0203a144 + ldr r2, [r5] + adds r3, r2, 0 + adds r3, 0x5E + adds r0, r2, 0 + adds r0, 0x68 + ldrh r0, [r0] + ldrh r1, [r3] + adds r0, r1 + strh r0, [r3] + adds r1, r2, 0 + adds r1, 0x5C + adds r0, r2, 0 + adds r0, 0x6A + ldrh r0, [r0] + ldrh r2, [r1] + adds r0, r2 + strh r0, [r1] + movs r4, 0 + ldrsh r0, [r1, r4] + movs r2, 0 + ldrsh r1, [r3, r2] + bl sub_812378C + ldr r2, [r5] + adds r1, r2, 0 + adds r1, 0x6C + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + bne _08123410 + adds r0, r2, 0 + adds r0, 0x5C + movs r3, 0 + ldrsh r1, [r0, r3] + adds r0, r1, 0 + adds r0, 0x2C + cmp r0, 0 + bge _0812338C + adds r0, 0x7 +_0812338C: + asrs r0, 3 + adds r0, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + adds r0, r2, 0 + adds r0, 0x5E + movs r4, 0 + ldrsh r1, [r0, r4] + adds r0, r1, 0 + adds r0, 0x34 + cmp r0, 0 + bge _081233A6 + adds r0, 0x7 +_081233A6: + asrs r0, 3 + adds r0, 0x2 + lsls r0, 16 + lsrs r1, r0, 16 + adds r4, r2, 0 + adds r4, 0x64 + adds r0, r2, 0 + adds r0, 0x66 + ldrh r2, [r4] + cmp r3, r2 + bne _081233C2 + ldrh r2, [r0] + cmp r1, r2 + beq _081233F2 +_081233C2: + strh r3, [r4] + strh r1, [r0] + adds r0, r3, 0 + bl sub_812386C + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl get_flagnr_blue_points + ldr r1, [r5] + strb r0, [r1, 0x2] + ldr r1, [r5] + ldrh r3, [r1] + cmp r4, r3 + beq _081233EE + strh r4, [r1] + adds r0, r1, 0x4 + ldrh r1, [r1] + movs r2, 0x10 + bl GetMapName +_081233EE: + bl sub_8123FB0 +_081233F2: + ldr r0, =0x0203a144 + ldr r2, [r0] + adds r1, r2, 0 + adds r1, 0x6C + movs r0, 0 + strh r0, [r1] + ldr r0, =sub_8123254 + str r0, [r2, 0x18] + movs r0, 0x3 + b _08123412 + .pool +_08123410: + movs r0, 0x2 +_08123412: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8123334 + + thumb_func_start sub_8123418 +sub_8123418: @ 8123418 + push {r4-r6,lr} + ldr r1, =0x0203a144 + ldr r2, [r1] + adds r0, r2, 0 + adds r0, 0x78 + ldrb r3, [r0] + adds r5, r1, 0 + cmp r3, 0 + bne _0812349C + subs r0, 0x1A + strh r3, [r0] + subs r0, 0x2 + strh r3, [r0] + str r3, [r2, 0x40] + str r3, [r2, 0x3C] + adds r4, r2, 0 + adds r4, 0x54 + ldrh r0, [r4] + lsls r0, 3 + subs r0, 0x34 + adds r1, r2, 0 + adds r1, 0x60 + strh r0, [r1] + movs r0, 0x56 + adds r0, r2 + mov r12, r0 + ldrh r0, [r0] + lsls r0, 3 + subs r0, 0x44 + adds r3, r2, 0 + adds r3, 0x62 + strh r0, [r3] + movs r6, 0 + ldrsh r0, [r1, r6] + lsls r0, 8 + cmp r0, 0 + bge _08123464 + adds r0, 0xF +_08123464: + asrs r0, 4 + str r0, [r2, 0x44] + movs r1, 0 + ldrsh r0, [r3, r1] + lsls r0, 8 + cmp r0, 0 + bge _08123474 + adds r0, 0xF +_08123474: + asrs r0, 4 + str r0, [r2, 0x48] + ldrh r1, [r4] + adds r0, r2, 0 + adds r0, 0x64 + strh r1, [r0] + mov r3, r12 + ldrh r0, [r3] + adds r1, r2, 0 + adds r1, 0x66 + strh r0, [r1] + movs r0, 0x80 + lsls r0, 9 + str r0, [r2, 0x4C] + ldr r0, =0xfffff800 + b _081234FA + .pool +_0812349C: + adds r0, r2, 0 + adds r0, 0x5C + movs r6, 0 + ldrsh r0, [r0, r6] + lsls r0, 8 + str r0, [r2, 0x3C] + adds r0, r2, 0 + adds r0, 0x5E + movs r1, 0 + ldrsh r0, [r0, r1] + lsls r0, 8 + str r0, [r2, 0x40] + adds r0, r2, 0 + adds r0, 0x60 + movs r1, 0 + strh r1, [r0] + adds r0, 0x2 + strh r1, [r0] + ldr r0, [r2, 0x3C] + cmp r0, 0 + bge _081234C8 + adds r0, 0xF +_081234C8: + asrs r0, 4 + negs r0, r0 + str r0, [r2, 0x44] + ldr r0, [r2, 0x40] + cmp r0, 0 + bge _081234D6 + adds r0, 0xF +_081234D6: + asrs r0, 4 + negs r0, r0 + str r0, [r2, 0x48] + adds r0, r2, 0 + adds r0, 0x64 + ldrh r1, [r0] + subs r0, 0x10 + strh r1, [r0] + adds r0, 0x12 + ldrh r0, [r0] + adds r1, r2, 0 + adds r1, 0x56 + strh r0, [r1] + movs r0, 0x80 + lsls r0, 8 + str r0, [r2, 0x4C] + movs r0, 0x80 + lsls r0, 4 +_081234FA: + str r0, [r2, 0x50] + ldr r0, [r5] + adds r0, 0x6E + movs r1, 0 + strh r1, [r0] + bl sub_8124238 + bl sub_81243B0 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8123418 + + thumb_func_start sub_8123514 +sub_8123514: @ 8123514 + push {r4-r6,lr} + sub sp, 0xC + ldr r0, =0x0203a144 + ldr r3, [r0] + adds r2, r3, 0 + adds r2, 0x6E + ldrh r1, [r2] + adds r5, r0, 0 + cmp r1, 0xF + bls _08123530 + movs r0, 0 + b _081236B8 + .pool +_08123530: + adds r0, r1, 0x1 + movs r1, 0 + strh r0, [r2] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x10 + bne _081235A4 + str r1, [r3, 0x44] + str r1, [r3, 0x48] + adds r0, r3, 0 + adds r0, 0x60 + ldrh r1, [r0] + subs r0, 0x4 + strh r1, [r0] + adds r0, 0x6 + ldrh r0, [r0] + adds r1, r3, 0 + adds r1, 0x5E + strh r0, [r1] + adds r1, 0x1A + ldrb r0, [r1] + movs r2, 0x80 + lsls r2, 9 + cmp r0, 0 + bne _08123566 + movs r2, 0x80 + lsls r2, 8 +_08123566: + str r2, [r3, 0x4C] + movs r2, 0 + ldrb r0, [r1] + cmp r0, 0 + bne _08123572 + movs r2, 0x1 +_08123572: + strb r2, [r1] + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x78 + ldrb r0, [r0] + ldr r2, =sub_8123254 + cmp r0, 0 + bne _08123584 + ldr r2, =sub_81230C4 +_08123584: + str r2, [r1, 0x18] + adds r0, r1, 0 + adds r0, 0x58 + ldrh r0, [r0] + adds r1, 0x5A + ldrh r1, [r1] + bl sub_81240D4 + bl sub_81243DC + movs r4, 0 + b _08123686 + .pool +_081235A4: + ldr r2, [r3, 0x3C] + ldr r0, [r3, 0x44] + adds r2, r0 + str r2, [r3, 0x3C] + ldr r0, [r3, 0x40] + ldr r1, [r3, 0x48] + adds r0, r1 + str r0, [r3, 0x40] + asrs r2, 8 + adds r4, r3, 0 + adds r4, 0x5C + strh r2, [r4] + ldr r0, [r3, 0x40] + asrs r0, 8 + adds r1, r3, 0 + adds r1, 0x5E + strh r0, [r1] + ldr r0, [r3, 0x4C] + ldr r1, [r3, 0x50] + adds r0, r1 + str r0, [r3, 0x4C] + ldr r2, [r3, 0x44] + cmp r2, 0 + bge _081235E4 + adds r0, r3, 0 + adds r0, 0x60 + movs r6, 0 + ldrsh r1, [r4, r6] + movs r6, 0 + ldrsh r0, [r0, r6] + cmp r1, r0 + blt _081235F8 +_081235E4: + cmp r2, 0 + ble _08123608 + adds r0, r3, 0 + adds r0, 0x60 + movs r2, 0 + ldrsh r1, [r4, r2] + movs r6, 0 + ldrsh r0, [r0, r6] + cmp r1, r0 + ble _08123608 +_081235F8: + ldr r3, [r5] + adds r0, r3, 0 + adds r0, 0x60 + ldrh r2, [r0] + subs r0, 0x4 + movs r1, 0 + strh r2, [r0] + str r1, [r3, 0x44] +_08123608: + ldr r2, [r5] + ldr r4, [r2, 0x48] + cmp r4, 0 + bge _08123624 + adds r0, r2, 0 + adds r0, 0x5E + adds r3, r2, 0 + adds r3, 0x62 + movs r6, 0 + ldrsh r1, [r0, r6] + movs r6, 0 + ldrsh r0, [r3, r6] + cmp r1, r0 + blt _0812363C +_08123624: + cmp r4, 0 + ble _0812364E + adds r1, r2, 0 + adds r1, 0x5E + adds r0, r2, 0 + adds r0, 0x62 + movs r2, 0 + ldrsh r1, [r1, r2] + movs r6, 0 + ldrsh r0, [r0, r6] + cmp r1, r0 + ble _0812364E +_0812363C: + ldr r2, [r5] + adds r0, r2, 0 + adds r0, 0x62 + ldrh r1, [r0] + adds r3, r2, 0 + adds r3, 0x5E + movs r0, 0 + strh r1, [r3] + str r0, [r2, 0x48] +_0812364E: + ldr r0, =0x0203a144 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x78 + ldrb r3, [r0] + cmp r3, 0 + bne _08123674 + ldr r1, [r2, 0x4C] + ldr r0, =0x00007fff + cmp r1, r0 + bgt _08123684 + adds r0, 0x1 + str r0, [r2, 0x4C] + str r3, [r2, 0x50] + b _08123684 + .pool +_08123674: + ldr r0, [r2, 0x4C] + movs r1, 0x80 + lsls r1, 9 + cmp r0, r1 + ble _08123684 + str r1, [r2, 0x4C] + movs r0, 0 + str r0, [r2, 0x50] +_08123684: + movs r4, 0x1 +_08123686: + ldr r0, =0x0203a144 + ldr r3, [r0] + adds r0, r3, 0 + adds r0, 0x5C + movs r1, 0 + ldrsh r0, [r0, r1] + adds r1, r3, 0 + adds r1, 0x5E + movs r2, 0 + ldrsh r1, [r1, r2] + ldr r2, [r3, 0x4C] + lsls r2, 8 + lsrs r2, 16 + str r2, [sp] + ldr r2, [r3, 0x4C] + lsls r2, 8 + lsrs r2, 16 + str r2, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + movs r2, 0x38 + movs r3, 0x48 + bl sub_81236C4 + adds r0, r4, 0 +_081236B8: + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8123514 + + thumb_func_start sub_81236C4 +sub_81236C4: @ 81236C4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r4, [sp, 0x24] + ldr r7, [sp, 0x28] + ldr r5, [sp, 0x2C] + lsls r4, 16 + lsrs r4, 16 + mov r8, r4 + lsls r7, 16 + adds r4, r7, 0 + lsrs r4, 16 + mov r9, r4 + lsls r5, 24 + lsrs r5, 24 + ldr r4, =0x0203a144 + ldr r6, [r4] + ldr r7, =gUnknown_08329F40 + mov r12, r7 + adds r4, r5, 0 + adds r4, 0x40 + lsls r4, 1 + add r4, r12 + movs r7, 0 + ldrsh r4, [r4, r7] + str r4, [sp] + mov r7, r8 + muls r7, r4 + adds r4, r7, 0 + asrs r4, 8 + mov r10, r4 + str r4, [r6, 0x2C] + lsls r5, 1 + add r5, r12 + movs r7, 0 + ldrsh r5, [r5, r7] + negs r4, r5 + mov r7, r8 + muls r7, r4 + adds r4, r7, 0 + asrs r4, 8 + mov r12, r4 + str r4, [r6, 0x30] + mov r7, r9 + muls r7, r5 + adds r5, r7, 0 + asrs r5, 8 + str r5, [r6, 0x34] + ldr r7, [sp] + mov r4, r9 + muls r4, r7 + asrs r4, 8 + mov r8, r4 + str r4, [r6, 0x38] + lsls r0, 16 + asrs r0, 8 + lsls r2, 16 + asrs r2, 16 + lsls r4, r2, 8 + adds r0, r4 + lsls r3, 16 + asrs r3, 16 + adds r4, r3, 0 + muls r4, r5 + mov r5, r10 + muls r5, r2 + adds r4, r5 + subs r0, r4 + str r0, [r6, 0x24] + lsls r1, 16 + asrs r1, 8 + lsls r0, r3, 8 + adds r1, r0 + mov r0, r8 + muls r0, r3 + mov r3, r12 + muls r3, r2 + adds r2, r3, 0 + adds r0, r2 + subs r1, r0 + str r1, [r6, 0x28] + adds r6, 0x7D + movs r0, 0x1 + strb r0, [r6] + 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_81236C4 + + thumb_func_start sub_812378C +sub_812378C: @ 812378C + ldr r2, =0x0203a144 + ldr r2, [r2] + lsls r0, 16 + asrs r0, 8 + movs r3, 0xE0 + lsls r3, 5 + adds r0, r3 + str r0, [r2, 0x24] + lsls r1, 16 + asrs r1, 8 + movs r0, 0x90 + lsls r0, 6 + adds r1, r0 + str r1, [r2, 0x28] + adds r2, 0x7D + movs r0, 0x1 + strb r0, [r2] + bx lr + .pool + thumb_func_end sub_812378C + + thumb_func_start sub_81237B4 +sub_81237B4: @ 81237B4 + push {r4,lr} + ldr r4, =0x0203a144 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x7D + ldrb r0, [r0] + cmp r0, 0 + beq _0812381A + ldrh r1, [r1, 0x2C] + movs r0, 0x20 + bl SetGpuReg + ldr r0, [r4] + ldrh r1, [r0, 0x34] + movs r0, 0x22 + bl SetGpuReg + ldr r0, [r4] + ldrh r1, [r0, 0x30] + movs r0, 0x24 + bl SetGpuReg + ldr r0, [r4] + ldrh r1, [r0, 0x38] + movs r0, 0x26 + bl SetGpuReg + ldr r0, [r4] + ldrh r1, [r0, 0x24] + movs r0, 0x28 + bl SetGpuReg + ldr r0, [r4] + ldrh r1, [r0, 0x26] + movs r0, 0x2A + bl SetGpuReg + ldr r0, [r4] + ldrh r1, [r0, 0x28] + movs r0, 0x2C + bl SetGpuReg + ldr r0, [r4] + ldrh r1, [r0, 0x2A] + movs r0, 0x2E + bl SetGpuReg + ldr r0, [r4] + adds r0, 0x7D + movs r1, 0 + strb r1, [r0] +_0812381A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81237B4 + + thumb_func_start sub_8123824 +sub_8123824: @ 8123824 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 16 + asrs r4, r0, 16 + lsls r1, 16 + asrs r5, r1, 16 + movs r0, 0x80 + lsls r0, 1 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x38 + movs r3, 0x48 + bl sub_81236C4 + bl sub_81237B4 + ldr r0, =0x0203a144 + ldr r2, [r0] + ldr r1, [r2, 0x20] + cmp r1, 0 + beq _08123860 + negs r0, r4 + strh r0, [r1, 0x24] + ldr r1, [r2, 0x20] + negs r0, r5 + strh r0, [r1, 0x26] +_08123860: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8123824 + + thumb_func_start sub_812386C +sub_812386C: @ 812386C + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 16 + ldr r0, =0xfffe0000 + adds r1, r0 + lsrs r2, r1, 16 + cmp r2, 0xE + bhi _08123886 + cmp r3, 0 + beq _08123886 + cmp r3, 0x1C + bls _08123890 +_08123886: + movs r0, 0xD5 + b _081238A4 + .pool +_08123890: + subs r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + ldr r1, =gUnknown_085A096C + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r3, r0 + adds r0, r1 + ldrb r0, [r0] +_081238A4: + pop {r1} + bx r1 + .pool + thumb_func_end sub_812386C + + thumb_func_start sub_81238AC +sub_81238AC: @ 81238AC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldr r0, =0x03005d8c + ldr r2, [r0] + movs r1, 0x4 + ldrsb r1, [r2, r1] + adds r3, r0, 0 + cmp r1, 0x19 + bne _081238DC + ldrb r0, [r2, 0x5] + subs r0, 0x29 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bhi _081238DC + bl sub_8123C00 + b _08123BEC + .pool +_081238DC: + ldr r1, [r3] + movs r0, 0x4 + ldrsb r0, [r1, r0] + ldrb r1, [r1, 0x5] + lsls r1, 24 + asrs r1, 24 + bl get_map_light_level_by_bank_and_number + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + cmp r0, 0x8 + bhi _08123928 + lsls r0, 2 + ldr r1, =_08123904 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08123904: + .4byte _08123928 + .4byte _08123928 + .4byte _08123928 + .4byte _0812396C + .4byte _08123928 + .4byte _08123928 + .4byte _0812396C + .4byte _08123A28 + .4byte _081239E4 +_08123928: + ldr r4, =0x0203a144 + ldr r0, [r4] + ldr r3, =0x02037318 + ldrb r1, [r3, 0x14] + movs r2, 0 + strh r1, [r0] + adds r0, 0x7F + strb r2, [r0] + ldr r0, [r3] + ldrh r2, [r0] + ldrh r0, [r0, 0x4] + mov r9, r0 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r6, [r0] + ldrh r3, [r0, 0x2] + ldr r1, [r4] + ldrh r0, [r1] + cmp r0, 0x45 + beq _08123956 + cmp r0, 0xCC + beq _08123956 + b _08123ABE +_08123956: + adds r1, 0x7F + movs r0, 0x1 + strb r0, [r1] + b _08123ABE + .pool +_0812396C: + ldr r2, =0x02037318 + ldrb r1, [r2, 0x1A] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _081239C8 + ldr r4, =0x03005d8c + ldr r1, [r4] + 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 r5, r0, 0 + ldr r0, =0x0203a144 + ldr r0, [r0] + ldrb r1, [r5, 0x14] + strh r1, [r0] + adds r0, 0x7F + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r5] + ldrh r2, [r0] + ldrh r0, [r0, 0x4] + mov r9, r0 + ldr r0, [r4] + ldrh r6, [r0, 0x28] + ldrh r3, [r0, 0x2A] + b _08123ABE + .pool +_081239C8: + ldr r0, =0x0203a144 + ldr r0, [r0] + ldrb r1, [r2, 0x14] + strh r1, [r0] + adds r0, 0x7F + movs r1, 0x1 + strb r1, [r0] + movs r2, 0x1 + mov r9, r2 + movs r6, 0x1 + movs r3, 0x1 + b _08123ABE + .pool +_081239E4: + ldr r4, =0x03005d8c + ldr r1, [r4] + movs r0, 0x14 + ldrsb r0, [r1, r0] + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x15] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + adds r5, r0, 0 + ldr r0, =0x0203a144 + ldr r0, [r0] + ldrb r1, [r5, 0x14] + strh r1, [r0] + adds r0, 0x7F + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r5] + ldrh r2, [r0] + ldrh r0, [r0, 0x4] + mov r9, r0 + ldr r0, [r4] + ldrh r6, [r0, 0x18] + ldrh r3, [r0, 0x1A] + b _08123ABE + .pool +_08123A28: + ldr r4, =0x0203a144 + ldr r0, [r4] + ldr r1, =0x02037318 + ldrb r1, [r1, 0x14] + strh r1, [r0] + cmp r1, 0x57 + beq _08123A64 + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r7, r0, 0 + adds r7, 0x24 + movs r0, 0 + ldrsb r0, [r7, r0] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ldrsb r1, [r7, r1] + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + adds r5, r0, 0 + b _08123A8A + .pool +_08123A64: + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r7, r0, 0 + adds r7, 0x14 + ldrb r0, [r0, 0x14] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ldrsb r1, [r7, r1] + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + adds r5, r0, 0 + ldr r1, [r4] + ldrb r0, [r5, 0x14] + strh r0, [r1] +_08123A8A: + ldr r4, =0x0203a144 + ldr r0, [r4] + ldrb r0, [r0] + bl sub_8123F74 + adds r1, r0, 0 + cmp r1, 0 + beq _08123AAC + ldr r0, [r4] + adds r0, 0x7F + movs r1, 0x1 + b _08123AB0 + .pool +_08123AAC: + ldr r0, [r4] + adds r0, 0x7F +_08123AB0: + strb r1, [r0] + ldr r0, [r5] + ldrh r2, [r0] + ldrh r0, [r0, 0x4] + mov r9, r0 + ldrh r6, [r7, 0x4] + ldrh r3, [r7, 0x6] +_08123ABE: + str r6, [sp] + ldr r5, =gRegionMapEntries + ldr r4, =0x0203a144 + ldr r0, [r4] + mov r10, r0 + ldrh r7, [r0] + lsls r0, r7, 3 + adds r0, r5 + str r0, [sp, 0x4] + ldrb r0, [r0, 0x2] + mov r8, r0 + adds r0, r2, 0 + mov r1, r8 + str r3, [sp, 0x8] + bl __divsi3 + lsls r0, 16 + lsrs r1, r0, 16 + ldr r3, [sp, 0x8] + cmp r1, 0 + bne _08123AEA + movs r1, 0x1 +_08123AEA: + adds r0, r6, 0 + str r3, [sp, 0x8] + bl __udivsi3 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r3, [sp, 0x8] + cmp r6, r8 + bcc _08123B04 + mov r0, r8 + subs r0, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_08123B04: + ldr r2, [sp, 0x4] + ldrb r4, [r2, 0x3] + mov r0, r9 + adds r1, r4, 0 + str r3, [sp, 0x8] + bl __divsi3 + lsls r0, 16 + lsrs r1, r0, 16 + ldr r3, [sp, 0x8] + cmp r1, 0 + bne _08123B1E + movs r1, 0x1 +_08123B1E: + adds r0, r3, 0 + bl __udivsi3 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r4 + bcc _08123B32 + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 +_08123B32: + cmp r7, 0x29 + beq _08123B5E + cmp r7, 0x29 + bgt _08123B4C + cmp r7, 0x1D + beq _08123B56 + cmp r7, 0x24 + beq _08123B94 + b _08123BC6 + .pool +_08123B4C: + cmp r7, 0x33 + beq _08123B5E + cmp r7, 0xCC + beq _08123BB8 + b _08123BC6 +_08123B56: + cmp r3, 0 + beq _08123BC6 + movs r6, 0 + b _08123BC6 +_08123B5E: + movs r6, 0 + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0x20 + ble _08123B6E + movs r6, 0x1 +_08123B6E: + cmp r0, 0x33 + ble _08123B78 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_08123B78: + movs r3, 0 + movs r2, 0x2 + ldrsh r0, [r1, r2] + cmp r0, 0x25 + ble _08123B84 + movs r3, 0x1 +_08123B84: + cmp r0, 0x38 + ble _08123BC6 + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + b _08123BC6 + .pool +_08123B94: + movs r6, 0 + ldr r0, [sp] + cmp r0, 0xE + bls _08123B9E + movs r6, 0x1 +_08123B9E: + ldr r2, [sp] + cmp r2, 0x1C + bls _08123BAA + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_08123BAA: + ldr r0, [sp] + cmp r0, 0x36 + bls _08123BC6 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + b _08123BC6 +_08123BB8: + mov r0, r10 + adds r0, 0x54 + mov r1, r10 + adds r1, 0x56 + bl sub_8123F30 + b _08123BEC +_08123BC6: + ldr r0, =0x0203a144 + ldr r2, [r0] + ldrh r0, [r2] + lsls r0, 3 + adds r0, r5 + ldrb r0, [r0] + adds r0, r6, r0 + adds r0, 0x1 + adds r1, r2, 0 + adds r1, 0x54 + strh r0, [r1] + ldrh r0, [r2] + lsls r0, 3 + adds r0, r5 + ldrb r0, [r0, 0x1] + adds r0, r3, r0 + adds r0, 0x2 + adds r2, 0x56 + strh r0, [r2] +_08123BEC: + 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_81238AC + + thumb_func_start sub_8123C00 +sub_8123C00: @ 8123C00 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r7, 0 + movs r0, 0 + mov r8, r0 + mov r4, sp + adds r4, 0x1 + mov r5, sp + adds r5, 0x2 + add r6, sp, 0x4 + mov r0, sp + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_8137FFC + lsls r0, 24 + lsrs r0, 24 + mov r10, r5 + cmp r0, 0x4 + bhi _08123C94 + lsls r0, 2 + ldr r1, =_08123C40 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08123C40: + .4byte _08123C94 + .4byte _08123C54 + .4byte _08123C64 + .4byte _08123C74 + .4byte _08123C84 +_08123C54: + ldr r2, =0x0203a144 + ldr r1, [r2] + movs r0, 0x8 + strh r0, [r1] + b _08123D10 + .pool +_08123C64: + ldr r2, =0x0203a144 + ldr r1, [r2] + movs r0, 0xC + strh r0, [r1] + b _08123D10 + .pool +_08123C74: + ldr r2, =0x0203a144 + ldr r1, [r2] + movs r0, 0x27 + strh r0, [r1] + b _08123D10 + .pool +_08123C84: + ldr r2, =0x0203a144 + ldr r1, [r2] + movs r0, 0x2E + strh r0, [r1] + b _08123D10 + .pool +_08123C94: + mov r0, sp + ldrb r0, [r0] + ldrb r1, [r4] + bl get_mapheader_by_bank_and_number + ldr r1, =0x0203a144 + mov r9, r1 + ldr r2, [r1] + ldrb r1, [r0, 0x14] + strh r1, [r2] + ldr r6, [r0] + ldr r1, =gRegionMapEntries + ldrh r0, [r2] + lsls r0, 3 + adds r5, r0, r1 + ldrb r4, [r5, 0x2] + ldr r0, [r6] + adds r1, r4, 0 + bl __divsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _08123CC6 + movs r1, 0x1 +_08123CC6: + mov r2, r10 + movs r3, 0 + ldrsh r0, [r2, r3] + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r8, r4 + bcc _08123CE2 + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 +_08123CE2: + ldrb r4, [r5, 0x3] + ldr r0, [r6, 0x4] + adds r1, r4, 0 + bl __divsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _08123CF6 + movs r1, 0x1 +_08123CF6: + mov r2, sp + movs r3, 0x4 + ldrsh r0, [r2, r3] + bl __divsi3 + lsls r0, 16 + lsrs r7, r0, 16 + mov r2, r9 + cmp r7, r4 + bcc _08123D10 + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 +_08123D10: + ldr r0, [r2] + adds r0, 0x7F + movs r1, 0 + strb r1, [r0] + ldr r2, [r2] + ldr r3, =gRegionMapEntries + ldrh r0, [r2] + lsls r0, 3 + adds r0, r3 + ldrb r0, [r0] + add r0, r8 + adds r0, 0x1 + adds r1, r2, 0 + adds r1, 0x54 + strh r0, [r1] + ldrh r0, [r2] + lsls r0, 3 + adds r0, r3 + ldrb r0, [r0, 0x1] + adds r0, r7, r0 + adds r0, 0x2 + adds r2, 0x56 + strh r0, [r2] + 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_8123C00 + + thumb_func_start get_flagnr_blue_points +get_flagnr_blue_points: @ 8123D58 + push {lr} + lsls r0, 16 + lsrs r0, 16 + adds r1, r0, 0 + cmp r0, 0x9 + beq _08123E18 + cmp r0, 0x9 + bgt _08123D9A + cmp r0, 0x4 + beq _08123DF0 + cmp r0, 0x4 + bgt _08123D88 + cmp r0, 0x1 + beq _08123DD8 + cmp r0, 0x1 + bgt _08123D7E + cmp r0, 0 + beq _08123DD0 + b _08123E94 +_08123D7E: + cmp r0, 0x2 + beq _08123DDE + cmp r0, 0x3 + beq _08123DE8 + b _08123E94 +_08123D88: + cmp r0, 0x6 + beq _08123E00 + cmp r0, 0x6 + blt _08123DF8 + cmp r0, 0x7 + beq _08123E08 + cmp r0, 0x8 + beq _08123E10 + b _08123E94 +_08123D9A: + cmp r0, 0xE + beq _08123E40 + cmp r0, 0xE + bgt _08123DB4 + cmp r0, 0xB + beq _08123E28 + cmp r0, 0xB + blt _08123E20 + cmp r0, 0xC + beq _08123E30 + cmp r0, 0xD + beq _08123E38 + b _08123E94 +_08123DB4: + cmp r0, 0x3A + beq _08123E60 + cmp r0, 0x3A + bgt _08123DC2 + cmp r0, 0xF + beq _08123E48 + b _08123E94 +_08123DC2: + cmp r1, 0x49 + beq _08123E7C + cmp r1, 0xD5 + beq _08123DCC + b _08123E94 +_08123DCC: + movs r0, 0 + b _08123E96 +_08123DD0: + ldr r0, =0x0000086f + b _08123E4A + .pool +_08123DD8: + movs r0, 0x87 + lsls r0, 4 + b _08123E4A +_08123DDE: + ldr r0, =0x00000871 + b _08123E4A + .pool +_08123DE8: + ldr r0, =0x00000872 + b _08123E4A + .pool +_08123DF0: + ldr r0, =0x00000873 + b _08123E4A + .pool +_08123DF8: + ldr r0, =0x00000874 + b _08123E4A + .pool +_08123E00: + ldr r0, =0x00000875 + b _08123E4A + .pool +_08123E08: + ldr r0, =0x00000876 + b _08123E4A + .pool +_08123E10: + ldr r0, =0x00000877 + b _08123E4A + .pool +_08123E18: + ldr r0, =0x00000878 + b _08123E4A + .pool +_08123E20: + ldr r0, =0x00000879 + b _08123E4A + .pool +_08123E28: + ldr r0, =0x0000087a + b _08123E4A + .pool +_08123E30: + ldr r0, =0x0000087b + b _08123E4A + .pool +_08123E38: + ldr r0, =0x0000087c + b _08123E4A + .pool +_08123E40: + ldr r0, =0x0000087d + b _08123E4A + .pool +_08123E48: + ldr r0, =0x0000087e +_08123E4A: + bl FlagGet + lsls r0, 24 + movs r1, 0x3 + cmp r0, 0 + beq _08123E58 + movs r1, 0x2 +_08123E58: + adds r0, r1, 0 + b _08123E96 + .pool +_08123E60: + ldr r0, =0x000008a8 + bl FlagGet + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + negs r0, r1 + orrs r0, r1 + asrs r0, 31 + movs r1, 0x4 + ands r0, r1 + b _08123E96 + .pool +_08123E7C: + ldr r0, =0x000008a9 + bl FlagGet + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + b _08123E96 + .pool +_08123E94: + movs r0, 0x1 +_08123E96: + pop {r1} + bx r1 + thumb_func_end get_flagnr_blue_points + + thumb_func_start sub_8123E9C +sub_8123E9C: @ 8123E9C + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + bl sub_812386C + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_8123E9C + + thumb_func_start sub_8123EB4 +sub_8123EB4: @ 8123EB4 + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r1, =gUnknown_085A1B84 +_08123EBE: + ldrh r0, [r1] + cmp r0, r3 + bne _08123ED4 + bl sub_8123F04 + lsls r0, 16 + lsrs r0, 16 + b _08123F00 + .pool +_08123ED4: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x2 + bls _08123EBE + ldr r1, =gUnknown_085A1B24 + ldrh r0, [r1] + cmp r0, 0xD5 + beq _08123EFE + adds r2, r1, 0 +_08123EE6: + ldrh r0, [r2] + cmp r0, r3 + bne _08123EF4 + ldrh r0, [r1, 0x2] + b _08123F00 + .pool +_08123EF4: + adds r1, 0x4 + adds r2, 0x4 + ldrh r0, [r1] + cmp r0, 0xD5 + bne _08123EE6 +_08123EFE: + adds r0, r3, 0 +_08123F00: + pop {r1} + bx r1 + thumb_func_end sub_8123EB4 + + thumb_func_start sub_8123F04 +sub_8123F04: @ 8123F04 + push {lr} + ldr r0, =0x00004037 + bl VarGet + subs r0, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0xF + bls _08123F18 + movs r1, 0 +_08123F18: + ldr r0, =gUnknown_085A1B8A + lsls r1, 16 + asrs r1, 15 + adds r1, r0 + ldrh r0, [r1] + pop {r1} + bx r1 + .pool + thumb_func_end sub_8123F04 + + thumb_func_start sub_8123F30 +sub_8123F30: @ 8123F30 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, =0x00004037 + bl VarGet + lsls r0, 16 + lsrs r1, r0, 16 + ldr r2, =0xfff70000 + adds r0, r2 + lsrs r0, 16 + cmp r0, 0x7 + bls _08123F4C + movs r1, 0x9 +_08123F4C: + subs r1, 0x9 + lsls r1, 16 + ldr r0, =gUnknown_085A1BAC + lsrs r1, 14 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r4] + ldrh r0, [r1, 0x2] + adds r0, 0x2 + strh r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8123F30 + + thumb_func_start sub_8123F74 +sub_8123F74: @ 8123F74 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r3, =gUnknown_085A1BCC +_08123F7E: + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _08123F90 + movs r0, 0x1 + b _08123F98 + .pool +_08123F90: + adds r1, 0x1 + cmp r1, 0 + beq _08123F7E + movs r0, 0 +_08123F98: + pop {r1} + bx r1 + thumb_func_end sub_8123F74 + + thumb_func_start sub_8123F9C +sub_8123F9C: @ 8123F9C + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_8123EB4 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_8123F9C + + thumb_func_start sub_8123FB0 +sub_8123FB0: @ 8123FB0 + push {r4-r6,lr} + ldr r0, =0x0203a144 + ldr r1, [r0] + ldrh r0, [r1] + cmp r0, 0xD5 + bne _08123FC8 + movs r0, 0 + strb r0, [r1, 0x3] + b _0812402E + .pool +_08123FC8: + adds r0, r1, 0 + adds r0, 0x78 + ldrb r0, [r0] + cmp r0, 0 + bne _08123FD8 + adds r0, r1, 0 + adds r0, 0x54 + b _08123FDC +_08123FD8: + adds r0, r1, 0 + adds r0, 0x64 +_08123FDC: + ldrh r4, [r0] + adds r0, 0x2 + ldrh r5, [r0] + movs r6, 0 + b _08124008 +_08123FE6: + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_812386C + ldr r1, =0x0203a144 + ldr r1, [r1] + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r1] + cmp r0, r1 + bne _08124008 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_08124008: + cmp r4, 0x1 + bhi _08123FE6 + adds r0, r5, 0 + bl sub_8124038 + lsls r0, 24 + cmp r0, 0 + beq _08124028 + subs r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + movs r4, 0x1D + b _08124008 + .pool +_08124028: + ldr r0, =0x0203a144 + ldr r0, [r0] + strb r6, [r0, 0x3] +_0812402E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8123FB0 + + thumb_func_start sub_8124038 +sub_8124038: @ 8124038 + push {r4,r5,lr} + lsls r0, 16 + ldr r1, =0xffff0000 + adds r0, r1 + lsrs r5, r0, 16 + ldr r0, =0x0000ffff + cmp r5, r0 + bne _08124058 + b _0812407A + .pool +_08124054: + movs r0, 0x1 + b _0812407C +_08124058: + movs r4, 0x1 +_0812405A: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_812386C + ldr r1, =0x0203a144 + ldr r1, [r1] + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r1] + cmp r0, r1 + beq _08124054 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1C + bls _0812405A +_0812407A: + movs r0, 0 +_0812407C: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8124038 + + thumb_func_start sub_8124088 +sub_8124088: @ 8124088 + push {r4,lr} + adds r2, r0, 0 + ldr r0, =0x0203a144 + ldr r1, [r0] + adds r3, r1, 0 + adds r3, 0x7A + movs r0, 0 + ldrsb r0, [r3, r0] + cmp r0, 0 + beq _081240C6 + adds r0, r1, 0 + adds r0, 0x7B + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 1 + ldrh r4, [r2, 0x20] + adds r0, r4 + strh r0, [r2, 0x20] + adds r0, r1, 0 + adds r0, 0x7C + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 1 + ldrh r1, [r2, 0x22] + adds r0, r1 + strh r0, [r2, 0x22] + ldrb r0, [r3] + subs r0, 0x1 + strb r0, [r3] +_081240C6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8124088 + + thumb_func_start TaskDummy8 +TaskDummy8: @ 81240D0 + bx lr + thumb_func_end TaskDummy8 + + thumb_func_start sub_81240D4 +sub_81240D4: @ 81240D4 + push {r4-r7,lr} + sub sp, 0x28 + lsls r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + ldr r1, =gUnknown_085A1C00 + ldr r2, [r1, 0x4] + ldr r1, [r1] + str r1, [sp, 0x20] + str r2, [sp, 0x24] + mov r2, sp + ldr r1, =gUnknown_085A1C08 + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + lsrs r3, r0, 16 + add r2, sp, 0x18 + ldrh r1, [r2, 0x4] + orrs r1, r0 + str r1, [r2, 0x4] + mov r0, sp + strh r3, [r0] + ldr r0, =0x0203a144 + ldr r4, [r0] + adds r0, r4, 0 + adds r0, 0x58 + strh r3, [r0] + ldr r5, =0xffff0000 + add r1, sp, 0x20 + ldr r0, [r1, 0x4] + ands r0, r5 + orrs r0, r6 + str r0, [r1, 0x4] + mov r0, sp + strh r6, [r0, 0x2] + adds r3, r4, 0 + adds r0, r3, 0 + adds r0, 0x5A + strh r6, [r0] + adds r0, 0x1E + ldrb r0, [r0] + adds r7, r1, 0 + cmp r0, 0 + bne _08124158 + movs r1, 0xC2 + lsls r1, 1 + adds r0, r3, r1 + str r0, [sp, 0x18] + ldr r0, [r2, 0x4] + ands r0, r5 + subs r1, 0x84 + orrs r0, r1 + str r0, [r2, 0x4] + ldr r0, =sub_8124088 + b _0812416E + .pool +_08124158: + movs r3, 0xA1 + lsls r3, 2 + adds r0, r4, r3 + str r0, [sp, 0x18] + ldr r0, [r2, 0x4] + ands r0, r5 + movs r1, 0xC0 + lsls r1, 3 + orrs r0, r1 + str r0, [r2, 0x4] + ldr r0, =TaskDummy8 +_0812416E: + str r0, [sp, 0x14] + adds r0, r2, 0 + bl LoadObjectPic + adds r0, r7, 0 + bl LoadTaggedObjectPalette + mov r0, sp + movs r1, 0x38 + movs r2, 0x48 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _08124228 + ldr r4, =0x0203a144 + ldr r2, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r3, r0, r1 + str r3, [r2, 0x1C] + adds r2, 0x78 + ldrb r0, [r2] + cmp r0, 0x1 + bne _081241DC + ldrb r1, [r3, 0x3] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r3, 0x3] + ldr r2, [r4] + ldr r1, [r2, 0x1C] + ldrh r0, [r1, 0x20] + subs r0, 0x8 + strh r0, [r1, 0x20] + ldr r1, [r2, 0x1C] + ldrh r0, [r1, 0x22] + subs r0, 0x8 + strh r0, [r1, 0x22] + ldr r0, [r2, 0x1C] + movs r1, 0x1 + bl StartObjectImageAnim + b _08124204 + .pool +_081241DC: + ldrb r1, [r3, 0x3] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r3, 0x3] + ldr r1, [r4] + ldr r2, [r1, 0x1C] + adds r0, r1, 0 + adds r0, 0x54 + ldrh r0, [r0] + lsls r0, 3 + adds r0, 0x4 + strh r0, [r2, 0x20] + ldr r2, [r1, 0x1C] + adds r1, 0x56 + ldrh r0, [r1] + lsls r0, 3 + adds r0, 0x4 + strh r0, [r2, 0x22] +_08124204: + ldr r4, =0x0203a144 + ldr r0, [r4] + ldr r1, [r0, 0x1C] + movs r0, 0x2 + strh r0, [r1, 0x30] + adds r0, r6, 0 + bl IndexOfObjectPaletteTag + ldr r1, [r4] + ldr r2, [r1, 0x1C] + lsls r0, 24 + lsrs r0, 20 + ldr r4, =0x00000101 + adds r0, r4 + strh r0, [r2, 0x32] + ldr r1, [r1, 0x1C] + movs r0, 0x1 + strh r0, [r1, 0x34] +_08124228: + add sp, 0x28 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81240D4 + + thumb_func_start sub_8124238 +sub_8124238: @ 8124238 + push {r4,lr} + ldr r4, =0x0203a144 + ldr r0, [r4] + ldr r0, [r0, 0x1C] + cmp r0, 0 + beq _0812425C + bl RemoveObjectAndFreeTiles + ldr r0, [r4] + adds r0, 0x58 + ldrh r0, [r0] + bl FreeObjectTilesByTag + ldr r0, [r4] + adds r0, 0x5A + ldrh r0, [r0] + bl FreeObjectPaletteByTag +_0812425C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8124238 + + thumb_func_start sub_8124268 +sub_8124268: @ 8124268 + ldr r0, =0x0203a144 + ldr r0, [r0] + ldr r1, [r0, 0x1C] + movs r0, 0x1 + strh r0, [r1, 0x34] + bx lr + .pool + thumb_func_end sub_8124268 + + thumb_func_start sub_8124278 +sub_8124278: @ 8124278 + ldr r0, =0x0203a144 + ldr r0, [r0] + ldr r1, [r0, 0x1C] + movs r0, 0 + strh r0, [r1, 0x34] + bx lr + .pool + thumb_func_end sub_8124278 + + thumb_func_start sub_8124288 +sub_8124288: @ 8124288 + push {r4-r6,lr} + sub sp, 0x28 + lsls r0, 16 + lsls r1, 16 + lsrs r1, 16 + ldr r2, =gUnknown_085A084C + str r2, [sp, 0x18] + movs r2, 0x80 + add r6, sp, 0x18 + lsrs r3, r0, 16 + orrs r0, r2 + str r0, [r6, 0x4] + ldr r0, =gUnknown_085A082C + str r0, [sp, 0x20] + ldr r2, =0xffff0000 + add r4, sp, 0x20 + ldr r0, [r4, 0x4] + ands r0, r2 + orrs r0, r1 + str r0, [r4, 0x4] + mov r0, sp + movs r5, 0 + strh r3, [r0] + strh r1, [r0, 0x2] + ldr r0, =gUnknown_085A1C20 + str r0, [sp, 0x4] + ldr r0, =gUnknown_085A1C30 + str r0, [sp, 0x8] + str r5, [sp, 0xC] + ldr r0, =gDummyObjectRotScalAnimTable + str r0, [sp, 0x10] + ldr r0, =DummyObjectCallback + str r0, [sp, 0x14] + ldr r0, =0x02037318 + ldrb r0, [r0, 0x14] + bl sub_8124668 + cmp r0, 0 + beq _08124304 + ldr r0, =0x0203a144 + ldr r0, [r0] + str r5, [r0, 0x20] + b _081243A4 + .pool +_08124304: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0x1 + bne _08124316 + ldr r0, =gUnknown_085A08EC + str r0, [sp, 0x18] + ldr r0, =gUnknown_085A08CC + str r0, [sp, 0x20] +_08124316: + adds r0, r6, 0 + bl LoadObjectPic + adds r0, r4, 0 + bl LoadTaggedObjectPalette + mov r0, sp + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0203a144 + ldr r2, [r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + str r1, [r2, 0x20] + adds r0, r2, 0 + adds r0, 0x78 + ldrb r0, [r0] + cmp r0, 0 + bne _08124384 + adds r0, r2, 0 + adds r0, 0x74 + ldrh r0, [r0] + lsls r0, 3 + adds r0, 0x4 + strh r0, [r1, 0x20] + ldr r1, [r2, 0x20] + adds r0, r2, 0 + adds r0, 0x76 + ldrh r0, [r0] + lsls r0, 3 + adds r0, 0x4 + strh r0, [r1, 0x22] + ldr r1, [r2, 0x20] + ldr r0, =sub_81244EC + b _081243A2 + .pool +_08124384: + adds r0, r2, 0 + adds r0, 0x74 + ldrh r0, [r0] + lsls r0, 4 + subs r0, 0x30 + strh r0, [r1, 0x20] + ldr r1, [r2, 0x20] + adds r0, r2, 0 + adds r0, 0x76 + ldrh r0, [r0] + lsls r0, 4 + subs r0, 0x42 + strh r0, [r1, 0x22] + ldr r1, [r2, 0x20] + ldr r0, =sub_812445C +_081243A2: + str r0, [r1, 0x1C] +_081243A4: + add sp, 0x28 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8124288 + + thumb_func_start sub_81243B0 +sub_81243B0: @ 81243B0 + push {lr} + ldr r3, =0x0203a144 + ldr r0, [r3] + ldr r2, [r0, 0x20] + cmp r2, 0 + beq _081243CE + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, [r3] + ldr r1, [r0, 0x20] + ldr r0, =DummyObjectCallback + str r0, [r1, 0x1C] +_081243CE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81243B0 + + thumb_func_start sub_81243DC +sub_81243DC: @ 81243DC + push {lr} + ldr r0, =0x0203a144 + ldr r3, [r0] + ldr r1, [r3, 0x20] + cmp r1, 0 + beq _08124452 + adds r0, r3, 0 + adds r0, 0x78 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0812441C + adds r0, r3, 0 + adds r0, 0x74 + ldrh r0, [r0] + lsls r0, 4 + subs r0, 0x30 + strh r0, [r1, 0x20] + ldr r1, [r3, 0x20] + adds r0, r3, 0 + adds r0, 0x76 + ldrh r0, [r0] + lsls r0, 4 + subs r0, 0x42 + strh r0, [r1, 0x22] + ldr r1, [r3, 0x20] + ldr r0, =sub_812445C + b _08124444 + .pool +_0812441C: + adds r0, r3, 0 + adds r0, 0x74 + ldrh r0, [r0] + lsls r0, 3 + adds r0, 0x4 + movs r2, 0 + strh r0, [r1, 0x20] + ldr r1, [r3, 0x20] + adds r0, r3, 0 + adds r0, 0x76 + ldrh r0, [r0] + lsls r0, 3 + adds r0, 0x4 + strh r0, [r1, 0x22] + ldr r0, [r3, 0x20] + strh r2, [r0, 0x24] + ldr r0, [r3, 0x20] + strh r2, [r0, 0x26] + ldr r1, [r3, 0x20] + ldr r0, =sub_81244EC +_08124444: + str r0, [r1, 0x1C] + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] +_08124452: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81243DC + + thumb_func_start sub_812445C +sub_812445C: @ 812445C + push {r4,lr} + adds r3, r0, 0 + ldr r0, =0x0203a144 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x5C + movs r4, 0 + ldrsh r2, [r0, r4] + lsls r2, 1 + negs r2, r2 + strh r2, [r3, 0x24] + adds r1, 0x5E + movs r4, 0 + ldrsh r0, [r1, r4] + lsls r0, 1 + negs r0, r0 + strh r0, [r3, 0x26] + ldrh r1, [r3, 0x22] + adds r1, r0 + adds r0, r3, 0 + adds r0, 0x29 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + strh r0, [r3, 0x2E] + ldrh r1, [r3, 0x20] + adds r1, r2 + adds r2, r3, 0 + adds r2, 0x28 + ldrb r2, [r2] + lsls r2, 24 + asrs r2, 24 + adds r2, r1 + strh r2, [r3, 0x30] + adds r0, 0x8 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xB0 + bhi _081244BC + lsls r0, r2, 16 + asrs r2, r0, 16 + movs r0, 0x8 + negs r0, r0 + cmp r2, r0 + blt _081244BC + cmp r2, 0xF8 + ble _081244C4 +_081244BC: + movs r0, 0 + b _081244C6 + .pool +_081244C4: + movs r0, 0x1 +_081244C6: + strh r0, [r3, 0x32] + movs r1, 0x32 + ldrsh r0, [r3, r1] + cmp r0, 0x1 + bne _081244D8 + adds r0, r3, 0 + bl sub_81244F8 + b _081244E4 +_081244D8: + adds r0, r3, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_081244E4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812445C + + thumb_func_start sub_81244EC +sub_81244EC: @ 81244EC + push {lr} + bl sub_81244F8 + pop {r0} + bx r0 + thumb_func_end sub_81244EC + + thumb_func_start sub_81244F8 +sub_81244F8: @ 81244F8 + push {lr} + adds r2, r0, 0 + ldr r0, =0x0203a144 + ldr r0, [r0] + adds r0, 0x7E + ldrb r0, [r0] + cmp r0, 0 + beq _0812453C + ldrh r0, [r2, 0x3C] + adds r0, 0x1 + strh r0, [r2, 0x3C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _08124548 + movs r0, 0 + strh r0, [r2, 0x3C] + adds r3, r2, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsrs r1, r2, 2 + movs r0, 0x1 + eors r1, r0 + ands r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + b _08124548 + .pool +_0812453C: + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_08124548: + pop {r0} + bx r0 + thumb_func_end sub_81244F8 + + thumb_func_start sub_812454C +sub_812454C: @ 812454C + push {lr} + ldr r0, =0x0203a144 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x7F + ldrb r0, [r0] + cmp r0, 0 + beq _08124562 + adds r1, 0x7E + movs r0, 0x1 + strb r0, [r1] +_08124562: + pop {r0} + bx r0 + .pool + thumb_func_end sub_812454C + + thumb_func_start GetMapName +@ u8 *GetMapName(u8 *dest, u16 regionMapId, u16 padLength) +GetMapName: @ 812456C + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r4, r2, 16 + cmp r1, 0x56 + bne _08124584 + bl GetSecretBaseMapName + adds r1, r0, 0 + b _081245B2 +_08124584: + cmp r1, 0xD4 + bhi _081245A0 + ldr r0, =gRegionMapEntries + lsls r1, 3 + adds r0, 0x4 + adds r1, r0 + ldr r1, [r1] + adds r0, r5, 0 + bl CopyString + adds r1, r0, 0 + b _081245B2 + .pool +_081245A0: + cmp r4, 0 + bne _081245A6 + movs r4, 0x12 +_081245A6: + adds r0, r5, 0 + movs r1, 0 + adds r2, r4, 0 + bl RepeatChar + b _081245D6 +_081245B2: + cmp r4, 0 + beq _081245D4 + subs r0, r1, r5 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r4 + bcs _081245D0 + movs r2, 0 +_081245C2: + strb r2, [r1] + adds r1, 0x1 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r4 + bcc _081245C2 +_081245D0: + movs r0, 0xFF + strb r0, [r1] +_081245D4: + adds r0, r1, 0 +_081245D6: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end GetMapName + + thumb_func_start sub_81245DC +sub_81245DC: @ 81245DC + push {lr} + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0x56 + beq _081245F8 + cmp r1, 0x57 + bne _08124604 + ldr r1, =gUnknown_085EC9D2 + bl CopyString + b _0812460A + .pool +_081245F8: + ldr r1, =gUnknown_085EC9D8 + bl CopyString + b _0812460A + .pool +_08124604: + movs r2, 0 + bl GetMapName +_0812460A: + pop {r1} + bx r1 + thumb_func_end sub_81245DC + + thumb_func_start sub_8124610 +sub_8124610: @ 8124610 + push {lr} + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0x42 + beq _08124620 + bl sub_81245DC + b _08124626 +_08124620: + ldr r1, =gUnknown_085EC9E4 + bl CopyString +_08124626: + pop {r1} + bx r1 + .pool + thumb_func_end sub_8124610 + + thumb_func_start sub_8124630 +sub_8124630: @ 8124630 + push {r4,r5,lr} + ldr r5, [sp, 0xC] + lsls r0, 16 + ldr r4, =gRegionMapEntries + lsrs r0, 13 + adds r0, r4 + ldrb r4, [r0] + strh r4, [r1] + ldrb r1, [r0, 0x1] + strh r1, [r2] + ldrb r1, [r0, 0x2] + strh r1, [r3] + ldrb r0, [r0, 0x3] + strh r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8124630 + + thumb_func_start sub_8124658 +sub_8124658: @ 8124658 + ldr r0, =0x0203a144 + ldr r0, [r0] + adds r0, 0x78 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8124658 + + thumb_func_start sub_8124668 +sub_8124668: @ 8124668 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r3, =gUnknown_085A1C34 +_08124672: + adds r0, r1, r3 + ldrb r0, [r0] + cmp r2, r0 + bne _08124684 + movs r0, 0x1 + b _0812468C + .pool +_08124684: + adds r1, 0x1 + cmp r1, 0x2 + bls _08124672 + movs r0, 0 +_0812468C: + pop {r1} + bx r1 + thumb_func_end sub_8124668 + + thumb_func_start sub_8124690 +sub_8124690: @ 8124690 + push {r4,lr} + sub sp, 0xC + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xA + bls _081246A4 + b _081248AA +_081246A4: + lsls r0, 2 + ldr r1, =_081246B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081246B8: + .4byte _081246E4 + .4byte _08124766 + .4byte _0812477C + .4byte _0812478C + .4byte _0812479C + .4byte _081247E4 + .4byte _081247F8 + .4byte _0812480C + .4byte _0812484C + .4byte _08124852 + .4byte _0812486C +_081246E4: + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0x10 + movs r1, 0 + bl SetGpuReg + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + movs r0, 0x16 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg + movs r0, 0x18 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1C + movs r1, 0 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0 + bl SetGpuReg + ldr r4, =0x0203a148 + ldr r0, =0x00000a74 + bl Alloc + str r0, [r4] + cmp r0, 0 + bne _08124754 + ldr r0, =sub_8086194 + bl SetMainCallback2 + b _081248AA + .pool +_08124754: + bl sub_80A1A74 + bl ResetAllObjectData + bl FreeAllObjectTiles + bl ResetObjectPaletteAllocator + b _0812489C +_08124766: + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085A1EE4 + movs r0, 0x1 + movs r2, 0x3 + bl InitBgsFromTemplates + b _0812489C + .pool +_0812477C: + ldr r0, =gUnknown_085A1EF0 + bl InitWindows + bl DeactivateAllTextPrinters + b _0812489C + .pool +_0812478C: + movs r0, 0 + movs r1, 0x65 + movs r2, 0xD0 + bl sub_809882C + bl clear_scheduled_bg_copies_to_vram + b _0812489C +_0812479C: + ldr r4, =0x0203a148 + ldr r0, [r4] + adds r0, 0x8 + movs r1, 0 + bl sub_8122CDC + movs r0, 0 + movs r1, 0 + bl sub_81240D4 + movs r0, 0x1 + movs r1, 0x1 + bl sub_8124288 + ldr r0, [r4] + ldrh r1, [r0, 0x8] + strh r1, [r0, 0x6] + ldr r1, =0x00000a4c + adds r0, r1 + movs r1, 0 + movs r2, 0x10 + bl RepeatChar + ldr r1, =0x03001180 + movs r0, 0x1 + str r0, [r1] + bl sub_8124904 + b _0812489C + .pool +_081247E4: + ldr r0, =gUnknown_085A1C58 + ldr r1, =0x0600c000 + bl LZ77UnCompVram + b _0812489C + .pool +_081247F8: + ldr r0, =gUnknown_085A1C90 + ldr r1, =0x0600f000 + bl LZ77UnCompVram + b _0812489C + .pool +_0812480C: + ldr r0, =gUnknown_085A1C38 + movs r1, 0x10 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0x2 + bl PutWindowTilemap + movs r0, 0x2 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_085E8CB4 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + b _0812489C + .pool +_0812484C: + bl sub_8124A70 + b _0812489C +_08124852: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r0, =sub_81248C0 + bl SetVBlankCallback + b _0812489C + .pool +_0812486C: + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuRegBits + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + ldr r0, =sub_8124D14 + bl sub_81248F4 + ldr r0, =sub_81248D4 + bl SetMainCallback2 +_0812489C: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081248AA: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8124690 + + thumb_func_start sub_81248C0 +sub_81248C0: @ 81248C0 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_81248C0 + + thumb_func_start sub_81248D4 +sub_81248D4: @ 81248D4 + push {lr} + ldr r0, =0x0203a148 + ldr r0, [r0] + ldr r0, [r0] + bl _call_via_r0 + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl do_scheduled_bg_tilemap_copies_to_vram + pop {r0} + bx r0 + .pool + thumb_func_end sub_81248D4 + + thumb_func_start sub_81248F4 +sub_81248F4: @ 81248F4 + ldr r1, =0x0203a148 + ldr r1, [r1] + str r0, [r1] + movs r0, 0 + strh r0, [r1, 0x4] + bx lr + .pool + thumb_func_end sub_81248F4 + + thumb_func_start sub_8124904 +sub_8124904: @ 8124904 + push {r4-r7,lr} + sub sp, 0xC + ldr r2, =0x0203a148 + ldr r0, [r2] + ldrb r0, [r0, 0xA] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _0812491A + b _08124A2C +_0812491A: + movs r7, 0 + movs r3, 0 + ldr r0, =gUnknown_085A1EDC + mov r12, r0 + adds r5, r2, 0 + movs r6, 0 +_08124926: + ldr r0, [r5] + lsls r1, r3, 3 + mov r2, r12 + adds r4, r1, r2 + ldrh r0, [r0, 0x8] + ldrh r1, [r4, 0x4] + cmp r0, r1 + bne _081249C4 + ldrh r0, [r4, 0x6] + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _081249CE + ldr r0, [r5] + ldrb r0, [r0, 0xB] + ldr r1, [r4] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl GetStringLength + movs r7, 0x1 + movs r0, 0 + movs r1, 0 + bl sub_8198070 + movs r0, 0x1 + movs r1, 0 + movs r2, 0x65 + movs r3, 0xD + bl SetWindowBorderStyle + ldr r2, [r5] + adds r2, 0xC + str r7, [sp] + str r6, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r0, [r5] + ldrb r0, [r0, 0xB] + ldr r1, [r4] + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x60 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x11 + str r0, [sp] + str r6, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + bl Print + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =0x03001180 + str r7, [r0] + b _081249CE + .pool +_081249C4: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0 + beq _08124926 +_081249CE: + cmp r7, 0 + bne _08124A62 + ldr r0, =0x03001180 + ldr r0, [r0] + cmp r0, 0x1 + bne _081249F4 + movs r0, 0x1 + movs r1, 0 + bl sub_8198070 + movs r0, 0 + movs r1, 0 + movs r2, 0x65 + movs r3, 0xD + bl SetWindowBorderStyle + b _081249FC + .pool +_081249F4: + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer +_081249FC: + ldr r0, =0x0203a148 + ldr r2, [r0] + adds r2, 0xC + movs r0, 0x1 + str r0, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =0x03001180 + str r4, [r0] + b _08124A62 + .pool +_08124A2C: + ldr r4, =0x03001180 + ldr r0, [r4] + cmp r0, 0x1 + bne _08124A48 + movs r0, 0x1 + movs r1, 0 + bl sub_8198070 + movs r0, 0 + movs r1, 0 + movs r2, 0x65 + movs r3, 0xD + bl SetWindowBorderStyle +_08124A48: + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0 + str r0, [r4] +_08124A62: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8124904 + + thumb_func_start sub_8124A70 +sub_8124A70: @ 8124A70 + push {r4,r5,lr} + sub sp, 0x8 + ldr r0, =gUnknown_085A1D68 + ldr r5, =0x0203a148 + ldr r1, [r5] + ldr r4, =0x0000088c + adds r1, r4 + bl LZ77UnCompWram + ldr r0, [r5] + adds r0, r4 + str r0, [sp] + ldr r1, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r1 + movs r1, 0xE0 + lsls r1, 1 + orrs r0, r1 + ldr r1, =0x0000ffff + ands r0, r1 + movs r1, 0x80 + lsls r1, 10 + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl LoadObjectPic + ldr r0, =gUnknown_085A1F10 + bl LoadTaggedObjectPalette + bl sub_8124AD4 + bl sub_8124BE4 + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8124A70 + + thumb_func_start sub_8124AD4 +sub_8124AD4: @ 8124AD4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + ldr r0, =0x0000086f + str r0, [sp, 0xC] + movs r1, 0 + mov r9, r1 + mov r2, sp + adds r2, 0x6 + str r2, [sp, 0x14] + mov r3, sp + adds r3, 0xA + str r3, [sp, 0x18] + mov r0, sp + adds r0, 0x8 + str r0, [sp, 0x10] + add r1, sp, 0x4 + mov r10, r1 +_08124AFE: + ldr r2, [sp, 0x18] + str r2, [sp] + mov r0, r9 + add r1, sp, 0x4 + mov r2, sp + adds r2, 0x6 + ldr r3, [sp, 0x10] + bl sub_8124630 + mov r3, r10 + ldrh r0, [r3] + adds r0, 0x1 + lsls r0, 3 + adds r0, 0x4 + strh r0, [r3] + mov r1, sp + ldrh r0, [r1, 0x6] + adds r0, 0x2 + lsls r0, 3 + adds r0, 0x4 + strh r0, [r1, 0x6] + ldr r2, [sp, 0x10] + ldrh r0, [r2] + cmp r0, 0x2 + bne _08124B38 + movs r7, 0x1 + b _08124B44 + .pool +_08124B38: + ldr r3, [sp, 0x18] + ldrh r0, [r3] + movs r7, 0 + cmp r0, 0x2 + bne _08124B44 + movs r7, 0x2 +_08124B44: + mov r0, r10 + movs r2, 0 + ldrsh r1, [r0, r2] + ldr r3, [sp, 0x14] + movs r0, 0 + ldrsh r2, [r3, r0] + ldr r0, =gUnknown_085A1F7C + movs r3, 0xA + bl AddObjectToFront + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x40 + beq _08124BB8 + ldr r1, =0x02020630 + mov r8, r1 + lsls r4, r5, 4 + adds r0, r4, r5 + lsls r6, r0, 2 + adds r2, r6, r1 + lsls r3, r7, 6 + ldrb r1, [r2, 0x1] + movs r0, 0x3F + ands r0, r1 + orrs r0, r3 + strb r0, [r2, 0x1] + ldr r0, [sp, 0xC] + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08124B9C + mov r0, r8 + adds r0, 0x1C + adds r0, r6, r0 + ldr r1, =sub_8124CBC + str r1, [r0] + b _08124BA2 + .pool +_08124B9C: + adds r0, r7, 0x3 + lsls r0, 16 + lsrs r7, r0, 16 +_08124BA2: + adds r4, r5 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + lsls r1, r7, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + mov r2, r9 + strh r2, [r4, 0x2E] +_08124BB8: + ldr r0, [sp, 0xC] + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0xC] + mov r0, r9 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + cmp r0, 0xF + bls _08124AFE + 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_8124AD4 + + thumb_func_start sub_8124BE4 +sub_8124BE4: @ 8124BE4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + movs r0, 0 + mov r8, r0 + ldr r6, =gUnknown_085A1F18 + ldrh r0, [r6, 0x2] + cmp r0, 0xD5 + beq _08124C9C + mov r5, sp + adds r5, 0x6 + add r7, sp, 0x4 + ldr r1, =0x02020630 + mov r9, r1 + movs r0, 0x1C + add r0, r9 + mov r10, r0 +_08124C0C: + mov r1, r8 + lsls r4, r1, 2 + adds r0, r4, r6 + ldrh r0, [r0] + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08124C84 + adds r0, r6, 0x2 + adds r0, r4, r0 + ldrh r6, [r0] + mov r0, sp + adds r0, 0xA + str r0, [sp] + adds r0, r6, 0 + add r1, sp, 0x4 + adds r2, r5, 0 + add r3, sp, 0x8 + bl sub_8124630 + ldrh r0, [r7] + adds r0, 0x1 + lsls r0, 3 + strh r0, [r7] + ldrh r0, [r5] + adds r0, 0x2 + lsls r0, 3 + strh r0, [r5] + movs r0, 0 + ldrsh r1, [r7, r0] + movs r0, 0 + ldrsh r2, [r5, r0] + ldr r0, =gUnknown_085A1F7C + movs r3, 0xA + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08124C84 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + mov r1, r9 + adds r4, r2, r1 + ldrb r1, [r4, 0x3] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r4, 0x3] + add r2, r10 + ldr r0, =sub_8124CBC + str r0, [r2] + adds r0, r4, 0 + movs r1, 0x6 + bl StartObjectImageAnim + strh r6, [r4, 0x2E] +_08124C84: + mov r0, r8 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r6, =gUnknown_085A1F18 + lsls r0, 2 + adds r1, r6, 0x2 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0xD5 + bne _08124C0C +_08124C9C: + 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_8124BE4 + + thumb_func_start sub_8124CBC +sub_8124CBC: @ 8124CBC + push {lr} + adds r2, r0, 0 + ldr r0, =0x0203a148 + ldr r0, [r0] + ldrh r1, [r0, 0x8] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r1, r0 + bne _08124D00 + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _08124D0E + movs r0, 0 + strh r0, [r2, 0x30] + adds r3, r2, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsrs r1, r2, 2 + movs r0, 0x1 + eors r1, r0 + ands r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + b _08124D0E + .pool +_08124D00: + movs r0, 0x10 + strh r0, [r2, 0x30] + adds r2, 0x3E + ldrb r1, [r2] + subs r0, 0x15 + ands r0, r1 + strb r0, [r2] +_08124D0E: + pop {r0} + bx r0 + thumb_func_end sub_8124CBC + + thumb_func_start sub_8124D14 +sub_8124D14: @ 8124D14 + push {r4,lr} + sub sp, 0x4 + ldr r4, =0x0203a148 + ldr r0, [r4] + ldrh r1, [r0, 0x4] + cmp r1, 0 + beq _08124D2C + cmp r1, 0x1 + beq _08124D46 + b _08124D56 + .pool +_08124D2C: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r1, [r4] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] + b _08124D56 +_08124D46: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _08124D56 + ldr r0, =sub_8124D64 + bl sub_81248F4 +_08124D56: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8124D14 + + thumb_func_start sub_8124D64 +sub_8124D64: @ 8124D64 + push {r4,lr} + ldr r0, =0x0203a148 + ldr r0, [r0] + ldrh r0, [r0, 0x4] + cmp r0, 0 + bne _08124DF8 + bl sub_81230AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bhi _08124DF8 + lsls r0, 2 + ldr r1, =_08124D90 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08124D90: + .4byte _08124DF8 + .4byte _08124DF8 + .4byte _08124DF8 + .4byte _08124DA8 + .4byte _08124DAE + .4byte _08124DE0 +_08124DA8: + bl sub_8124904 + b _08124DF8 +_08124DAE: + ldr r4, =0x0203a148 + ldr r0, [r4] + ldrb r0, [r0, 0xA] + cmp r0, 0x2 + beq _08124DBC + cmp r0, 0x4 + bne _08124DF8 +_08124DBC: + movs r0, 0x5 + bl m4aSongNumStart + ldr r0, [r4] + ldr r1, =0x00000a72 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r0, =sub_8124E0C + bl sub_81248F4 + b _08124DF8 + .pool +_08124DE0: + movs r0, 0x5 + bl m4aSongNumStart + ldr r0, =0x0203a148 + ldr r0, [r0] + ldr r1, =0x00000a72 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, =sub_8124E0C + bl sub_81248F4 +_08124DF8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8124D64 + + thumb_func_start sub_8124E0C +sub_8124E0C: @ 8124E0C + push {r4,lr} + sub sp, 0x4 + ldr r4, =0x0203a148 + ldr r0, [r4] + ldrh r1, [r0, 0x4] + cmp r1, 0 + beq _08124E24 + cmp r1, 0x1 + beq _08124E3E + b _08124F1A + .pool +_08124E24: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, [r4] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] + b _08124F1A +_08124E3E: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _08124F1A + bl sub_812305C + ldr r1, [r4] + ldr r2, =0x00000a72 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _08124F00 + ldrh r0, [r1, 0x8] + cmp r0, 0xF + beq _08124E98 + cmp r0, 0xF + bgt _08124E6C + cmp r0, 0 + beq _08124E84 + b _08124EBC + .pool +_08124E6C: + cmp r0, 0x3A + beq _08124E7C + cmp r0, 0x49 + bne _08124EBC + movs r0, 0x15 + bl sub_8084CCC + b _08124EFA +_08124E7C: + movs r0, 0x16 + bl sub_8084CCC + b _08124EFA +_08124E84: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + movs r1, 0xD + cmp r0, 0 + bne _08124EB0 + movs r1, 0xC + b _08124EB0 + .pool +_08124E98: + ldr r0, =0x000008b4 + bl FlagGet + lsls r0, 24 + movs r1, 0xB + cmp r0, 0 + beq _08124EB0 + ldr r0, [r4] + ldrb r0, [r0, 0xB] + cmp r0, 0 + bne _08124EB0 + movs r1, 0x14 +_08124EB0: + adds r0, r1, 0 + bl sub_8084CCC + b _08124EFA + .pool +_08124EBC: + ldr r3, =gUnknown_085A1E3C + ldr r0, =0x0203a148 + ldr r0, [r0] + ldrh r1, [r0, 0x8] + lsls r0, r1, 1 + adds r2, r0, r1 + adds r0, r3, 0x2 + adds r1, r2, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _08124EE0 + bl sub_8084CCC + b _08124EFA + .pool +_08124EE0: + adds r0, r2, r3 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + movs r2, 0x1 + negs r2, r2 + bl warp1_set_2 +_08124EFA: + bl sub_80B69DC + b _08124F06 +_08124F00: + ldr r0, =sub_81B58A8 + bl SetMainCallback2 +_08124F06: + ldr r4, =0x0203a148 + ldr r0, [r4] + cmp r0, 0 + beq _08124F16 + bl Free + movs r0, 0 + str r0, [r4] +_08124F16: + bl FreeAllWindowBuffers +_08124F1A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8124E0C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/reset_rtc_screen.s b/asm/reset_rtc_screen.s new file mode 100644 index 000000000..1c55f0efa --- /dev/null +++ b/asm/reset_rtc_screen.s @@ -0,0 +1,1342 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_809E8E8 +sub_809E8E8: @ 809E8E8 + push {lr} + adds r3, r0, 0 + ldr r2, =0x03005e00 + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0xC + ldrsh r1, [r0, r2] + movs r2, 0x30 + ldrsh r0, [r3, r2] + cmp r1, r0 + beq _0809E9FE + strh r1, [r3, 0x30] + subs r0, r1, 0x1 + cmp r0, 0x5 + bhi _0809E9FE + lsls r0, 2 + ldr r1, =_0809E920 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0809E920: + .4byte _0809E938 + .4byte _0809E95C + .4byte _0809E980 + .4byte _0809E9A4 + .4byte _0809E9CE + .4byte _0809E9F8 +_0809E938: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r1, r3, 0 + adds r1, 0x2A + movs r0, 0x1 + strb r0, [r1] + subs r2, 0x12 + ldrb r1, [r2] + subs r0, 0x41 + ands r0, r1 + strb r0, [r2] + movs r0, 0x35 + b _0809E9C6 +_0809E95C: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r1, r3, 0 + adds r1, 0x2A + movs r0, 0x1 + strb r0, [r1] + subs r2, 0x12 + ldrb r1, [r2] + subs r0, 0x41 + ands r0, r1 + strb r0, [r2] + movs r0, 0x56 + b _0809E9C6 +_0809E980: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r1, r3, 0 + adds r1, 0x2A + movs r0, 0x1 + strb r0, [r1] + subs r2, 0x12 + ldrb r1, [r2] + subs r0, 0x41 + ands r0, r1 + strb r0, [r2] + movs r0, 0x65 + b _0809E9C6 +_0809E9A4: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r1, r3, 0 + adds r1, 0x2A + movs r0, 0x1 + strb r0, [r1] + subs r2, 0x12 + ldrb r1, [r2] + subs r0, 0x41 + ands r0, r1 + strb r0, [r2] + movs r0, 0x74 +_0809E9C6: + strh r0, [r3, 0x20] + movs r0, 0x44 + strh r0, [r3, 0x22] + b _0809E9FE +_0809E9CE: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r1, r3, 0 + adds r1, 0x2A + movs r0, 0x2 + strb r0, [r1] + subs r2, 0x12 + ldrb r1, [r2] + subs r0, 0x42 + ands r0, r1 + strb r0, [r2] + movs r0, 0x99 + strh r0, [r3, 0x20] + movs r0, 0x50 + strh r0, [r3, 0x22] + b _0809E9FE +_0809E9F8: + adds r0, r3, 0 + bl RemoveObjectAndFreeTiles +_0809E9FE: + pop {r0} + bx r0 + thumb_func_end sub_809E8E8 + + thumb_func_start sub_809EA04 +sub_809EA04: @ 809EA04 + push {lr} + adds r3, r0, 0 + ldr r2, =0x03005e00 + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0xC + ldrsh r1, [r0, r2] + movs r2, 0x30 + ldrsh r0, [r3, r2] + cmp r1, r0 + beq _0809EAFE + strh r1, [r3, 0x30] + subs r0, r1, 0x1 + cmp r0, 0x5 + bhi _0809EAFE + lsls r0, 2 + ldr r1, =_0809EA3C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0809EA3C: + .4byte _0809EA54 + .4byte _0809EA78 + .4byte _0809EA9C + .4byte _0809EAC0 + .4byte _0809EAEA + .4byte _0809EAF8 +_0809EA54: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r1, r3, 0 + adds r1, 0x2A + movs r0, 0 + strb r0, [r1] + subs r2, 0x12 + ldrb r1, [r2] + subs r0, 0x40 + ands r0, r1 + strb r0, [r2] + movs r0, 0x35 + b _0809EAE2 +_0809EA78: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r1, r3, 0 + adds r1, 0x2A + movs r0, 0 + strb r0, [r1] + subs r2, 0x12 + ldrb r1, [r2] + subs r0, 0x40 + ands r0, r1 + strb r0, [r2] + movs r0, 0x56 + b _0809EAE2 +_0809EA9C: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r1, r3, 0 + adds r1, 0x2A + movs r0, 0 + strb r0, [r1] + subs r2, 0x12 + ldrb r1, [r2] + subs r0, 0x40 + ands r0, r1 + strb r0, [r2] + movs r0, 0x65 + b _0809EAE2 +_0809EAC0: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r1, r3, 0 + adds r1, 0x2A + movs r0, 0 + strb r0, [r1] + subs r2, 0x12 + ldrb r1, [r2] + subs r0, 0x40 + ands r0, r1 + strb r0, [r2] + movs r0, 0x74 +_0809EAE2: + strh r0, [r3, 0x20] + movs r0, 0x5C + strh r0, [r3, 0x22] + b _0809EAFE +_0809EAEA: + adds r0, r3, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _0809EAFE +_0809EAF8: + adds r0, r3, 0 + bl RemoveObjectAndFreeTiles +_0809EAFE: + pop {r0} + bx r0 + thumb_func_end sub_809EA04 + + thumb_func_start sub_809EB04 +sub_809EB04: @ 809EB04 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_085104C4 + bl LoadTaggedObjectPalette + ldr r0, =gUnknown_085104F0 + mov r8, r0 + movs r1, 0x35 + movs r2, 0x44 + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r1, r0, 24 + ldr r6, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r6, 0 + adds r4, 0x1C + adds r2, r0, r4 + ldr r1, =sub_809E8E8 + str r1, [r2] + adds r0, r6 + strh r5, [r0, 0x2E] + ldr r1, =0x0000ffff + strh r1, [r0, 0x30] + mov r0, r8 + movs r1, 0x35 + movs r2, 0x44 + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r4 + ldr r1, =sub_809EA04 + str r1, [r4] + adds r0, r6 + strh r5, [r0, 0x2E] + movs r1, 0x1 + negs r1, r1 + strh r1, [r0, 0x30] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809EB04 + + thumb_func_start sub_809EB8C +sub_809EB8C: @ 809EB8C + push {lr} + ldr r0, =gUnknown_085104C4 + ldrh r0, [r0, 0x4] + bl FreeObjectPaletteByTag + pop {r0} + bx r0 + .pool + thumb_func_end sub_809EB8C + + thumb_func_start sub_809EBA0 +sub_809EBA0: @ 809EBA0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl sub_8198070 + adds r0, r4, 0 + bl RemoveWindow + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_809EBA0 + + thumb_func_start sub_809EBC4 +sub_809EBC4: @ 809EBC4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + mov r10, r0 + adds r0, r1, 0 + mov r9, r2 + adds r1, r3, 0 + ldr r5, [sp, 0x30] + ldr r6, [sp, 0x34] + ldr r2, [sp, 0x38] + mov r8, r2 + mov r2, r10 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + lsls r3, r0, 24 + lsrs r3, 24 + str r3, [sp, 0xC] + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, 16 + lsrs r1, 16 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + mov r2, r8 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldr r7, =0x02021fc4 + ldr r4, =0x02021cc4 + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalString + adds r0, r7, 0 + adds r1, r4, 0 + bl CopyString + adds r7, r0, 0 + ldr r1, =gUnknown_085EE68A + bl CopyString + adds r7, r0, 0 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r0, r7, 0 + adds r1, r4, 0 + bl CopyString + adds r7, r0, 0 + ldr r5, =gUnknown_085EE68E + adds r1, r5, 0 + bl CopyString + adds r7, r0, 0 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + adds r0, r7, 0 + adds r1, r4, 0 + bl CopyString + adds r7, r0, 0 + adds r1, r5, 0 + bl CopyString + adds r7, r0, 0 + adds r0, r4, 0 + mov r1, r8 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + adds r0, r7, 0 + adds r1, r4, 0 + bl CopyString + ldr r2, =0x02021fc4 + mov r0, r9 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + mov r0, r10 + movs r1, 0x1 + 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_809EBC4 + + thumb_func_start sub_809ECB4 +sub_809ECB4: @ 809ECB4 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0xC + adds r4, r0, 0 + mov r9, r1 + adds r5, r2, 0 + adds r6, r3, 0 + ldr r0, [sp, 0x24] + mov r8, r0 + lsls r4, 24 + lsrs r4, 24 + mov r0, r9 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r2, 0x85 + lsls r2, 2 + adds r0, r4, 0 + movs r1, 0 + movs r3, 0xE + bl SetWindowBorderStyle + str r5, [sp] + str r6, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x1 + mov r3, r9 + bl sub_809EBC4 + ldr r2, =gUnknown_085EE690 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x7E + bl Print + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809ECB4 + + thumb_func_start sub_809ED38 +sub_809ED38: @ 809ED38 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r3, 16 + lsrs r3, 16 + adds r1, r3, 0 + movs r0, 0x80 + ands r0, r3 + cmp r0, 0 + beq _0809ED52 + ldrh r0, [r4] + subs r0, 0x1 + b _0809ED6C +_0809ED52: + movs r0, 0x40 + ands r0, r3 + cmp r0, 0 + beq _0809ED60 + ldrh r0, [r4] + adds r0, 0x1 + b _0809ED8A +_0809ED60: + movs r0, 0x20 + ands r0, r3 + cmp r0, 0 + beq _0809ED7A + ldrh r0, [r4] + subs r0, 0xA +_0809ED6C: + strh r0, [r4] + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, r5 + bge _0809ED96 + strh r2, [r4] + b _0809ED96 +_0809ED7A: + movs r0, 0x10 + ands r1, r0 + cmp r1, 0 + bne _0809ED86 + movs r0, 0 + b _0809ED98 +_0809ED86: + ldrh r0, [r4] + adds r0, 0xA +_0809ED8A: + strh r0, [r4] + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, r2 + ble _0809ED96 + strh r5, [r4] +_0809ED96: + movs r0, 0x1 +_0809ED98: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809ED38 + + thumb_func_start sub_809EDA0 +sub_809EDA0: @ 809EDA0 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x1 + strh r0, [r1, 0x8] + bx lr + .pool + thumb_func_end sub_809EDA0 + + thumb_func_start sub_809EDB8 +sub_809EDB8: @ 809EDB8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r5, =0x03005e08 + adds r0, r4, r5 + ldrb r0, [r0, 0x10] + bl sub_809EBA0 + bl sub_809EB8C + subs r5, 0x8 + adds r4, r5 + ldr r0, =sub_809EDA0 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809EDB8 + + thumb_func_start sub_809EDE8 +sub_809EDE8: @ 809EDE8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r7, r0, 3 + ldr r0, =0x03005e08 + mov r8, r0 + adds r5, r7, r0 + ldrb r4, [r5, 0x4] + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + ldr r1, =gUnknown_0851041C + adds r2, r0, r1 + ldr r1, =0x030022c0 + ldrh r3, [r1, 0x2E] + movs r0, 0x2 + ands r0, r3 + mov r12, r1 + cmp r0, 0 + beq _0809EE3C + mov r0, r8 + subs r0, 0x8 + adds r0, r7, r0 + ldr r1, =sub_809EDB8 + str r1, [r0] + movs r0, 0 + strh r0, [r5, 0x2] + movs r0, 0x6 + b _0809EE5C + .pool +_0809EE3C: + movs r0, 0x10 + ands r0, r3 + cmp r0, 0 + beq _0809EE4A + ldrb r0, [r2, 0x7] + cmp r0, 0 + bne _0809EE5C +_0809EE4A: + mov r3, r12 + ldrh r1, [r3, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0809EE66 + ldrb r0, [r2, 0x6] + cmp r0, 0 + beq _0809EE66 +_0809EE5C: + strh r0, [r5, 0x4] + movs r0, 0x5 + bl audio_play + b _0809EEF4 +_0809EE66: + cmp r4, 0x5 + bne _0809EEB4 + mov r0, r12 + ldrh r1, [r0, 0x2E] + movs r4, 0x1 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0809EEF4 + ldr r1, =0x03005cf8 + ldrh r0, [r5, 0x6] + strh r0, [r1] + ldrh r0, [r5, 0x8] + strb r0, [r1, 0x2] + ldrh r0, [r5, 0xA] + strb r0, [r1, 0x3] + ldrh r0, [r5, 0xC] + strb r0, [r1, 0x4] + movs r0, 0x5 + bl audio_play + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_809EDB8 + str r1, [r0] + strh r4, [r5, 0x2] + movs r0, 0x6 + strh r0, [r5, 0x4] + b _0809EEF4 + .pool +_0809EEB4: + ldrb r0, [r2] + lsls r0, 1 + adds r0, r5, r0 + ldrh r1, [r2, 0x2] + ldrh r2, [r2, 0x4] + mov r3, r12 + ldrh r4, [r3, 0x30] + movs r3, 0xC0 + ands r3, r4 + bl sub_809ED38 + cmp r0, 0 + beq _0809EEF4 + movs r0, 0x5 + bl audio_play + ldrb r0, [r5, 0x10] + ldrh r3, [r5, 0x6] + ldrb r1, [r5, 0x8] + str r1, [sp] + ldrb r1, [r5, 0xA] + str r1, [sp, 0x4] + ldrb r1, [r5, 0xC] + str r1, [sp, 0x8] + movs r1, 0 + movs r2, 0x1 + bl sub_809EBC4 + ldrb r0, [r5, 0x10] + movs r1, 0x2 + bl CopyWindowToVram +_0809EEF4: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_809EDE8 + + thumb_func_start sub_809EF00 +sub_809EF00: @ 809EF00 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + mov r8, r0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r6, r0, 2 + add r6, r8 + lsls r6, 3 + ldr r0, =0x03005e08 + mov r9, r0 + adds r5, r6, r0 + movs r0, 0 + strh r0, [r5] + ldr r1, =0x03005cf8 + ldrh r0, [r1] + strh r0, [r5, 0x6] + movs r0, 0x2 + ldrsb r0, [r1, r0] + strh r0, [r5, 0x8] + movs r0, 0x3 + ldrsb r0, [r1, r0] + strh r0, [r5, 0xA] + movs r0, 0x4 + ldrsb r0, [r1, r0] + strh r0, [r5, 0xC] + ldr r0, =gUnknown_08510420 + bl AddWindow + strh r0, [r5, 0x10] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r5, 0x6] + ldrb r2, [r5, 0x8] + ldrb r3, [r5, 0xA] + ldrb r4, [r5, 0xC] + str r4, [sp] + bl sub_809ECB4 + mov r0, r8 + bl sub_809EB04 + movs r0, 0x2 + strh r0, [r5, 0x4] + movs r0, 0x8 + negs r0, r0 + add r9, r0 + add r6, r9 + ldr r0, =sub_809EDE8 + str r0, [r6] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809EF00 + + thumb_func_start sub_809EF88 +sub_809EF88: @ 809EF88 + push {r4-r7,lr} + sub sp, 0x4 + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0 + bl SetVBlankCallback + movs r2, 0xA0 + lsls r2, 19 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, =0x040000d4 + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + ldr r0, =0x81000200 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r2, 0xC0 + lsls r2, 19 + movs r3, 0xC0 + lsls r3, 9 + mov r4, sp + movs r6, 0 + movs r5, 0x80 + lsls r5, 5 + ldr r7, =0x81000800 + movs r0, 0x81 + lsls r0, 24 + mov r12, r0 +_0809EFCA: + strh r6, [r4] + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + str r7, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r2, r5 + subs r3, r5 + cmp r3, r5 + bhi _0809EFCA + strh r6, [r4] + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + lsrs r0, r3, 1 + mov r2, r12 + orrs r0, r2 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r0, 0 + movs r1, 0x80 + bl ResetSpriteRange + bl LoadOamFromSprites + bl remove_some_task + bl dp12_8087EA4 + bl ResetAllObjectData + bl ResetTasks + bl sub_80A1A74 + bl sub_809F048 + ldr r0, =sub_809F0AC + bl SetVBlankCallback + ldr r0, =sub_809F090 + bl SetMainCallback2 + ldr r0, =sub_809F200 + movs r1, 0x50 + bl CreateTask + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809EF88 + + thumb_func_start sub_809F048 +sub_809F048: @ 809F048 + push {lr} + bl clear_scheduled_bg_copies_to_vram + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_08510404 + movs r0, 0 + movs r2, 0x1 + bl InitBgsFromTemplates + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + ldr r0, =gUnknown_08510408 + bl InitWindows + bl DeactivateAllTextPrinters + bl sub_81973A4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_809F048 + + thumb_func_start sub_809F090 +sub_809F090: @ 809F090 + push {lr} + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl do_scheduled_bg_tilemap_copies_to_vram + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_809F090 + + thumb_func_start sub_809F0AC +sub_809F0AC: @ 809F0AC + push {lr} + bl ProcessObjectCopyRequests + bl LoadOamFromSprites + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_809F0AC + + thumb_func_start sub_809F0C0 +sub_809F0C0: @ 809F0C0 + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + movs r2, 0x80 + lsls r2, 2 + movs r0, 0x1 + movs r1, 0 + movs r3, 0xF + bl sub_8197B1C + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl Print + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_809F0C0 + + thumb_func_start sub_809F0F8 +sub_809F0F8: @ 809F0F8 + 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, =0x03005e08 + adds r6, r0, r1 + movs r0, 0 + ldrsh r5, [r6, r0] + cmp r5, 0 + beq _0809F11C + cmp r5, 0x1 + beq _0809F1B2 + b _0809F1F8 + .pool +_0809F11C: + movs r2, 0x85 + lsls r2, 2 + movs r0, 0 + movs r1, 0 + movs r3, 0xE + bl SetWindowBorderStyle + ldr r2, =gUnknown_085ECA0D + movs r0, 0x1 + str r0, [sp] + movs r4, 0xFF + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r1, =0x03005cf8 + ldrh r3, [r1] + ldrb r0, [r1, 0x2] + str r0, [sp] + ldrb r0, [r1, 0x3] + str r0, [sp, 0x4] + ldrb r0, [r1, 0x4] + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x11 + bl sub_809EBC4 + ldr r2, =gUnknown_085ECA22 + movs r0, 0x21 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r0, =0x03005d90 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xA0 + ldrh r3, [r0] + adds r0, 0x2 + ldrb r0, [r0] + str r0, [sp] + adds r0, r1, 0 + adds r0, 0xA3 + ldrb r0, [r0] + str r0, [sp, 0x4] + adds r0, r1, 0 + adds r0, 0xA4 + ldrb r0, [r0] + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x31 + bl sub_809EBC4 + ldr r0, =gUnknown_085EC9EC + bl sub_809F0C0 + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] +_0809F1B2: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809F1E4 + adds r0, r7, 0 + bl DestroyTask + bl Reset + b _0809F1F8 + .pool +_0809F1E4: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0809F1F8 + movs r0, 0x5 + bl audio_play + adds r0, r7, 0 + bl DestroyTask +_0809F1F8: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_809F0F8 + + thumb_func_start sub_809F200 +sub_809F200: @ 809F200 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x6 + bls _0809F21C + b _0809F404 +_0809F21C: + lsls r0, 2 + ldr r1, =_0809F230 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0809F230: + .4byte _0809F24C + .4byte _0809F268 + .4byte _0809F2B4 + .4byte _0809F310 + .4byte _0809F398 + .4byte _0809F3C8 + .4byte _0809F3EA +_0809F24C: + movs r0, 0x1 + negs r0, r0 + ldr r1, =0x0000ffff + str r1, [sp] + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r0, 0x1 + strh r0, [r5] + b _0809F404 + .pool +_0809F268: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809F276 + b _0809F404 +_0809F276: + ldr r0, =0x03006210 + ldrh r0, [r0] + cmp r0, 0 + beq _0809F282 + cmp r0, 0x2 + bne _0809F29C +_0809F282: + ldr r0, =gUnknown_085ECAA7 + bl sub_809F0C0 + movs r0, 0x5 + strh r0, [r5] + b _0809F404 + .pool +_0809F29C: + bl GameFreakRTC_CalcLocalDateTime + ldr r0, =sub_809F0F8 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x2] + b _0809F334 + .pool +_0809F2B4: + ldr r2, =0x03005e00 + movs r0, 0x2 + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x4] + cmp r0, 0x1 + bne _0809F2CA + b _0809F404 +_0809F2CA: + movs r0, 0 + movs r1, 0 + bl sub_8198070 + ldr r0, =gUnknown_085ECA38 + bl sub_809F0C0 + ldr r2, =0x03005cf8 + ldr r0, =0x03005d90 + ldr r0, [r0] + adds r0, 0xA0 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + ldr r0, =sub_809EF00 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x2] + movs r0, 0x3 + strh r0, [r5] + b _0809F404 + .pool +_0809F310: + ldr r2, =0x03005e00 + movs r0, 0x2 + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r1, r0, r2 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _0809F404 + movs r2, 0xA + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0809F340 + ldrb r0, [r5, 0x2] + bl DestroyTask +_0809F334: + movs r0, 0x2 + strh r0, [r5] + b _0809F404 + .pool +_0809F340: + ldrb r0, [r5, 0x2] + bl DestroyTask + bl GameFreakRTC_Reset + ldr r4, =0x03005cf8 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0x2 + ldrsb r1, [r4, r1] + movs r2, 0x3 + ldrsb r2, [r4, r2] + movs r3, 0x4 + ldrsb r3, [r4, r3] + bl GameFreakRTC_CalcRTCToLocalDelta + ldr r0, =0x03005d90 + ldr r2, [r0] + adds r2, 0xA0 + ldr r0, [r4] + ldr r1, [r4, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + ldr r0, =0x00004040 + ldrh r1, [r4] + bl VarSet + bl sub_809D5D8 + ldr r0, =gUnknown_085ECA4F + bl sub_809F0C0 + movs r0, 0x4 + strh r0, [r5] + b _0809F404 + .pool +_0809F398: + movs r0, 0 + bl save_game_when_memory_present + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809F3B8 + ldr r0, =gUnknown_085ECA8A + bl sub_809F0C0 + movs r0, 0x49 + bl audio_play + b _0809F3C4 + .pool +_0809F3B8: + ldr r0, =gUnknown_085ECA9A + bl sub_809F0C0 + movs r0, 0x16 + bl audio_play +_0809F3C4: + movs r0, 0x5 + strh r0, [r5] +_0809F3C8: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0809F404 + movs r0, 0x1 + negs r0, r0 + ldr r1, =0x0000ffff + str r1, [sp] + movs r1, 0x1 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + movs r0, 0x6 + strh r0, [r5] +_0809F3EA: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0809F404 + adds r0, r4, 0 + bl DestroyTask + bl FreeAllWindowBuffers + bl Reset +_0809F404: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809F200 + + thumb_func_start sub_809F41C +sub_809F41C: @ 809F41C + push {lr} + ldr r0, =0x00000861 + bl FlagSet + movs r0, 0x86 + lsls r0, 4 + bl FlagSet + ldr r0, =0x00000862 + bl FlagSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_809F41C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rng.s b/asm/rng.s new file mode 100644 index 000000000..1f1e4678c --- /dev/null +++ b/asm/rng.s @@ -0,0 +1,65 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start GenerateRandomNumber +@ u16 GenerateRandomNumber() +GenerateRandomNumber: @ 806F5CC + ldr r2, =0x03005d80 + ldr r1, [r2] + ldr r0, =0x41c64e6d + muls r0, r1 + ldr r1, =0x00006073 + adds r0, r1 + str r0, [r2] + ldr r2, =0x020249c0 + ldr r1, [r2] + adds r1, 0x1 + str r1, [r2] + lsrs r0, 16 + bx lr + .pool + thumb_func_end GenerateRandomNumber + + thumb_func_start SeedRng +@ void SeedRng(u16 seed) +SeedRng: @ 806F5F8 + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x03005d80 + str r0, [r1] + ldr r1, =0x020249bc + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end SeedRng + + thumb_func_start SeedRng2 +SeedRng2: @ 806F610 + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x03005d84 + str r0, [r1] + bx lr + .pool + thumb_func_end SeedRng2 + + thumb_func_start GenerateRandomNumber2 +GenerateRandomNumber2: @ 806F620 + ldr r2, =0x03005d84 + ldr r1, [r2] + ldr r0, =0x41c64e6d + muls r0, r1 + ldr r1, =0x00006073 + adds r0, r1 + str r0, [r2] + lsrs r0, 16 + bx lr + .pool + thumb_func_end GenerateRandomNumber2 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom3.s b/asm/rom3.s new file mode 100644 index 000000000..951bb77e2 --- /dev/null +++ b/asm/rom3.s @@ -0,0 +1,3775 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start battle_wireless_setup_if_required_maybe +battle_wireless_setup_if_required_maybe: @ 8032654 + push {lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08032686 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _0803266E + bl sub_800B488 +_0803266E: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0803267A + bl sub_8009734 +_0803267A: + ldr r0, =task00_08081A90 + movs r1, 0 + bl CreateTask + bl sub_8033244 +_08032686: + pop {r0} + bx r0 + .pool + thumb_func_end battle_wireless_setup_if_required_maybe + + thumb_func_start sub_803269C +sub_803269C: @ 803269C + push {r4-r7,lr} + sub sp, 0x14 + ldr r0, =0x03005d04 + ldr r1, =nullsub_20 + str r1, [r0] + movs r0, 0 + str r0, [sp, 0x10] + movs r1, 0 + ldr r7, =0x03005d60 + ldr r6, =0x020244ac + movs r2, 0 + ldr r5, =0x020244b0 + ldr r4, =nullsub_21 + ldr r3, =0x02024076 +_080326B8: + lsls r0, r1, 2 + adds r0, r7 + str r4, [r0] + adds r1, r3 + movs r0, 0xFF + strb r0, [r1] + ldr r0, [sp, 0x10] + adds r0, r6 + strb r2, [r0] + ldr r0, [sp, 0x10] + adds r0, r5 + strb r2, [r0] + ldr r0, [sp, 0x10] + adds r0, 0x1 + str r0, [sp, 0x10] + adds r1, r0, 0 + cmp r1, 0x3 + ble _080326B8 + bl battle_wireless_setup_if_required_maybe + ldr r0, =0x02024068 + movs r5, 0 + str r5, [r0] + bl sub_80A3934 + bl sub_806E414 + movs r0, 0xF + bl sub_81308C8 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08032728 + bl zero_enemy_party_data + ldr r4, =0x02024744 + movs r1, 0x90 + lsls r1, 1 + str r5, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + str r5, [sp, 0xC] + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0x20 + bl create_pokemon_set_level + str r5, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0xC + add r2, sp, 0x10 + bl pokemon_setattr +_08032728: + ldr r0, =0x02022ff4 + str r5, [r0] + ldr r0, =0x0202428c + strb r5, [r0] + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803269C + + thumb_func_start sub_8032768 +sub_8032768: @ 8032768 + push {r4,r5,lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _08032784 + movs r0, 0x1 + bl sub_8184DA4 + b _0803278A + .pool +_08032784: + movs r0, 0x2 + bl sub_8184DA4 +_0803278A: + ldr r4, =0x02022fec + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _0803279C + bl sub_8185EB8 +_0803279C: + ldr r0, [r4] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080327B0 + bl b_setup_bx_link + b _080327B4 + .pool +_080327B0: + bl b_setup_bx +_080327B4: + bl sub_8033050 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _080327E2 + movs r4, 0 + ldr r0, =0x0202406c + ldrb r1, [r0] + cmp r4, r1 + bge _080327E2 + adds r5, r0, 0 +_080327D0: + lsls r0, r4, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_81B8D64 + adds r4, 0x1 + ldrb r0, [r5] + cmp r4, r0 + blt _080327D0 +_080327E2: + movs r4, 0 + ldr r3, =0x0202449c + movs r2, 0xD2 + lsls r2, 1 + movs r1, 0 +_080327EC: + ldr r0, [r3] + adds r0, r4, r0 + adds r0, r2 + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x5F + bls _080327EC + movs r4, 0 + ldr r3, =0x0202449c + movs r2, 0x81 + lsls r2, 2 + movs r1, 0 +_08032804: + ldr r0, [r3] + adds r0, r4, r0 + adds r0, r2 + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x67 + bls _08032804 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8032768 + + thumb_func_start b_setup_bx +b_setup_bx: @ 8032824 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x02022fec + ldr r3, [r0] + movs r5, 0x80 + lsls r5, 15 + ands r5, r3 + cmp r5, 0 + beq _080328E4 + ldr r1, =0x03005d04 + ldr r0, =sub_8039ECC + str r0, [r1] + movs r4, 0x80 + lsls r4, 17 + ands r4, r3 + cmp r4, 0 + beq _08032874 + ldr r2, =0x03005d60 + ldr r0, =sub_818994C + str r0, [r2] + ldr r1, =0x02024076 + movs r0, 0 + strb r0, [r1] + b _0803287E + .pool +_08032874: + ldr r2, =0x03005d60 + ldr r0, =sub_805745C + str r0, [r2] + ldr r1, =0x02024076 + strb r4, [r1] +_0803287E: + ldr r3, =sub_805F164 + str r3, [r2, 0x4] + movs r0, 0x1 + strb r0, [r1, 0x1] + ldr r0, =sub_81BADF4 + str r0, [r2, 0x8] + movs r0, 0x2 + strb r0, [r1, 0x2] + str r3, [r2, 0xC] + movs r0, 0x3 + strb r0, [r1, 0x3] + ldr r1, =0x0202406c + movs r0, 0x4 + strb r0, [r1] + movs r0, 0 + movs r1, 0 + bl sub_81B8D64 + movs r0, 0x1 + movs r1, 0 + bl sub_81B8D64 + movs r0, 0x2 + movs r1, 0x1 + bl sub_81B8D64 + movs r0, 0x3 + movs r1, 0x1 + bl sub_81B8D64 + ldr r0, =0x0202406e + movs r1, 0 + strh r1, [r0] + strh r1, [r0, 0x2] + movs r1, 0x3 + b _08032A76 + .pool +_080328E4: + movs r7, 0x1 + adds r0, r3, 0 + ands r0, r7 + cmp r0, 0 + beq _080328F0 + b _080329E0 +_080328F0: + ldr r0, =0x03005d04 + ldr r2, =sub_8039ECC + str r2, [r0] + movs r1, 0x80 + ands r1, r3 + mov r12, r2 + cmp r1, 0 + beq _08032918 + ldr r1, =0x03005d60 + ldr r0, =sub_815936C + b _08032934 + .pool +_08032918: + movs r0, 0x80 + lsls r0, 2 + ands r3, r0 + cmp r3, 0 + beq _08032930 + ldr r1, =0x03005d60 + ldr r0, =bx_goto_buffer_A_ch0_tbl3 + b _08032934 + .pool +_08032930: + ldr r1, =0x03005d60 + ldr r0, =sub_805745C +_08032934: + str r0, [r1] + mov r10, r1 + ldr r4, =0x02024076 + movs r0, 0 + mov r9, r0 + mov r1, r9 + strb r1, [r4] + mov r5, r10 + ldr r2, =sub_805F164 + mov r8, r2 + str r2, [r5, 0x4] + movs r6, 0x1 + strb r6, [r4, 0x1] + ldr r2, =0x0202406c + movs r7, 0x2 + strb r7, [r2] + ldr r0, =0x02022fec + ldr r3, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r3 + cmp r0, 0 + bne _08032964 + b _08032CB2 +_08032964: + movs r1, 0x80 + lsls r1, 18 + ands r1, r3 + cmp r1, 0 + beq _080329CC + movs r1, 0x80 + lsls r1, 24 + ands r1, r3 + cmp r1, 0 + beq _080329B4 + mov r1, r12 + ldr r0, =0x03005d04 + str r1, [r0] + ldr r0, =sub_818994C + str r0, [r5] + mov r1, r9 + strb r1, [r4] + ldr r0, =sub_81864EC + str r0, [r5, 0x4] + strb r6, [r4, 0x1] + strb r7, [r2] + b _08032CB2 + .pool +_080329B4: + ldr r0, =sub_818994C + str r0, [r5, 0x4] + strb r1, [r4, 0x1] + ldr r0, =sub_81864EC + str r0, [r5] + strb r6, [r4] + strb r7, [r2] + b _08032CB2 + .pool +_080329CC: + ldr r0, =sub_818994C + mov r2, r10 + str r0, [r2] + strb r1, [r4] + mov r0, r8 + str r0, [r2, 0x4] + strb r6, [r4, 0x1] + b _08032CB2 + .pool +_080329E0: + ldr r1, =sub_8039ECC + ldr r2, =0x03005d04 + str r1, [r2] + ldr r2, =0x03005d60 + ldr r0, =sub_805745C + str r0, [r2] + ldr r4, =0x02024076 + strb r5, [r4] + ldr r6, =sub_805F164 + str r6, [r2, 0x4] + strb r7, [r4, 0x1] + str r0, [r2, 0x8] + movs r0, 0x2 + mov r12, r0 + mov r1, r12 + strb r1, [r4, 0x2] + str r6, [r2, 0xC] + movs r0, 0x3 + mov r8, r0 + mov r1, r8 + strb r1, [r4, 0x3] + ldr r0, =0x0202406c + mov r10, r0 + movs r1, 0x4 + mov r9, r1 + strb r1, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r3 + cmp r0, 0 + bne _08032A20 + b _08032CB2 +_08032A20: + movs r1, 0xA0 + lsls r1, 1 + adds r0, r3, 0 + ands r0, r1 + cmp r0, r1 + bne _08032AA0 + ldr r0, =sub_8039ECC + ldr r1, =0x03005d04 + str r0, [r1] + ldr r0, =sub_818994C + str r0, [r2] + strb r5, [r4] + str r6, [r2, 0x4] + strb r7, [r4, 0x1] + str r0, [r2, 0x8] + mov r0, r12 + strb r0, [r4, 0x2] + str r6, [r2, 0xC] + mov r1, r8 + strb r1, [r4, 0x3] + mov r0, r9 + mov r2, r10 + strb r0, [r2] + movs r0, 0 + movs r1, 0 + bl sub_81B8D64 + movs r0, 0x1 + movs r1, 0 + bl sub_81B8D64 + movs r0, 0x2 + movs r1, 0x1 + bl sub_81B8D64 + movs r0, 0x3 + movs r1, 0x1 + bl sub_81B8D64 + ldr r0, =0x0202406e + strh r5, [r0] + strh r5, [r0, 0x2] + mov r1, r8 +_08032A76: + strh r1, [r0, 0x4] + strh r1, [r0, 0x6] + b _08032CB2 + .pool +_08032AA0: + movs r5, 0x40 + ands r5, r3 + cmp r5, 0 + bne _08032AAA + b _08032C3C +_08032AAA: + ldr r0, =0x0203c7b4 + ldrb r5, [r0] + movs r0, 0 + mov r10, r0 + ldr r1, =0x020229e8 + mov r12, r1 + adds r7, r4, 0 + mov r8, r0 + ldr r6, =0x0202406e + movs r4, 0 + movs r2, 0x3 + mov r9, r2 +_08032AC2: + mov r1, r12 + adds r0, r4, r1 + ldrh r0, [r0, 0x18] + cmp r0, 0x2 + bgt _08032AE4 + cmp r0, 0x1 + bge _08032AFC + cmp r0, 0 + beq _08032AE8 + b _08032B06 + .pool +_08032AE4: + cmp r0, 0x3 + bne _08032B06 +_08032AE8: + ldr r0, =0x020229e8 + adds r0, r4, r0 + ldrb r0, [r0, 0x18] + movs r1, 0 + bl sub_81B8D64 + b _08032B06 + .pool +_08032AFC: + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_81B8D64 +_08032B06: + cmp r10, r5 + bne _08032B56 + ldr r0, =0x020229e8 + adds r3, r4, r0 + ldrh r1, [r3, 0x18] + lsls r1, 2 + ldr r2, =0x03005d60 + adds r1, r2 + ldr r2, =sub_818994C + str r2, [r1] + ldrh r1, [r3, 0x18] + mov r12, r0 + cmp r1, 0x2 + bgt _08032B38 + cmp r1, 0x1 + bge _08032B4C + cmp r1, 0 + beq _08032B3C + b _08032C2C + .pool +_08032B38: + cmp r1, 0x3 + bne _08032C2C +_08032B3C: + mov r1, r12 + adds r0, r4, r1 + ldrh r1, [r0, 0x18] + adds r1, r7 + mov r2, r8 + strb r2, [r1] + ldrh r0, [r0, 0x18] + b _08032C12 +_08032B4C: + adds r1, r7 + movs r0, 0x2 + strb r0, [r1] + ldrh r0, [r3, 0x18] + b _08032C24 +_08032B56: + ldr r2, =0x020229e8 + adds r0, r4, r2 + ldrh r1, [r0, 0x18] + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r1 + mov r12, r2 + cmp r0, 0 + bne _08032B80 + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + add r0, r12 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08032B92 + b _08032BD8 + .pool +_08032B80: + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + add r0, r12 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08032BD8 +_08032B92: + mov r0, r12 + adds r2, r4, r0 + ldrh r0, [r2, 0x18] + lsls r0, 2 + ldr r1, =0x03005d60 + adds r0, r1 + ldr r1, =sub_818994C + str r1, [r0] + ldrh r1, [r2, 0x18] + cmp r1, 0x2 + bgt _08032BBC + cmp r1, 0x1 + bge _08032BD0 + cmp r1, 0 + beq _08032BC0 + b _08032C2C + .pool +_08032BBC: + cmp r1, 0x3 + bne _08032C2C +_08032BC0: + mov r2, r12 + adds r0, r4, r2 + ldrh r1, [r0, 0x18] + adds r1, r7 + mov r2, r8 + strb r2, [r1] + ldrh r0, [r0, 0x18] + b _08032C12 +_08032BD0: + adds r1, r7 + movs r0, 0x2 + strb r0, [r1] + b _08032C22 +_08032BD8: + mov r0, r12 + adds r2, r4, r0 + ldrh r0, [r2, 0x18] + lsls r0, 2 + ldr r1, =0x03005d60 + adds r0, r1 + ldr r1, =sub_81864EC + str r1, [r0] + ldrh r0, [r2, 0x18] + cmp r0, 0x2 + bgt _08032C00 + cmp r0, 0x1 + bge _08032C1C + cmp r0, 0 + beq _08032C04 + b _08032C2C + .pool +_08032C00: + cmp r0, 0x3 + bne _08032C2C +_08032C04: + mov r0, r12 + adds r2, r4, r0 + ldrh r0, [r2, 0x18] + adds r0, r7 + movs r1, 0x1 + strb r1, [r0] + ldrh r0, [r2, 0x18] +_08032C12: + lsls r0, 1 + adds r0, r6 + mov r1, r8 + strh r1, [r0] + b _08032C2C +_08032C1C: + adds r0, r7 + mov r1, r9 + strb r1, [r0] +_08032C22: + ldrh r0, [r2, 0x18] +_08032C24: + lsls r0, 1 + adds r0, r6 + mov r2, r9 + strh r2, [r0] +_08032C2C: + adds r4, 0x1C + movs r0, 0x1 + add r10, r0 + mov r1, r10 + cmp r1, 0x3 + bgt _08032C3A + b _08032AC2 +_08032C3A: + b _08032CB2 +_08032C3C: + movs r1, 0x4 + ands r1, r3 + cmp r1, 0 + beq _08032C7C + ldr r0, =sub_818994C + str r0, [r2] + strb r5, [r4] + str r0, [r2, 0x8] + mov r0, r12 + strb r0, [r4, 0x2] + movs r0, 0x80 + lsls r0, 18 + ands r3, r0 + cmp r3, 0 + beq _08032C70 + ldr r0, =sub_81864EC + str r0, [r2, 0x4] + strb r7, [r4, 0x1] + str r0, [r2, 0xC] + mov r1, r8 + strb r1, [r4, 0x3] + b _08032CB2 + .pool +_08032C70: + str r6, [r2, 0x4] + strb r7, [r4, 0x1] + str r6, [r2, 0xC] + mov r2, r8 + strb r2, [r4, 0x3] + b _08032CB2 +_08032C7C: + ldr r0, =sub_818994C + str r0, [r2, 0x4] + strb r1, [r4, 0x1] + str r0, [r2, 0xC] + mov r0, r12 + strb r0, [r4, 0x3] + movs r0, 0x80 + lsls r0, 18 + ands r3, r0 + cmp r3, 0 + beq _08032CA8 + ldr r0, =sub_81864EC + str r0, [r2] + strb r7, [r4] + str r0, [r2, 0x8] + mov r1, r8 + strb r1, [r4, 0x2] + b _08032CB2 + .pool +_08032CA8: + str r6, [r2] + strb r7, [r4] + str r6, [r2, 0x8] + mov r2, r8 + strb r2, [r4, 0x2] +_08032CB2: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end b_setup_bx + + thumb_func_start b_setup_bx_link +b_setup_bx_link: @ 8032CC0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, =0x02022fec + ldr r1, [r4] + movs r5, 0x1 + adds r3, r1, 0 + ands r3, r5 + cmp r3, 0 + bne _08032D48 + movs r4, 0x4 + ands r4, r1 + cmp r4, 0 + beq _08032D1C + ldr r1, =0x03005d04 + ldr r0, =sub_8039ECC + str r0, [r1] + ldr r2, =0x03005d60 + ldr r0, =sub_805745C + str r0, [r2] + ldr r1, =0x02024076 + strb r3, [r1] + ldr r0, =sub_8064394 + str r0, [r2, 0x4] + strb r5, [r1, 0x1] + ldr r1, =0x0202406c + movs r0, 0x2 + b _0803303A + .pool +_08032D1C: + ldr r2, =0x03005d60 + ldr r0, =sub_805745C + str r0, [r2, 0x4] + ldr r1, =0x02024076 + strb r4, [r1, 0x1] + ldr r0, =sub_8064394 + str r0, [r2] + strb r5, [r1] + ldr r1, =0x0202406c + movs r0, 0x2 + b _0803303A + .pool +_08032D48: + movs r0, 0x41 + ands r0, r1 + cmp r0, 0x1 + bne _08032DD0 + movs r6, 0x4 + adds r3, r6, 0 + ands r3, r1 + cmp r3, 0 + beq _08032D98 + ldr r1, =0x03005d04 + ldr r0, =sub_8039ECC + str r0, [r1] + ldr r2, =0x03005d60 + ldr r4, =sub_805745C + str r4, [r2] + ldr r1, =0x02024076 + movs r0, 0 + strb r0, [r1] + ldr r3, =sub_8064394 + str r3, [r2, 0x4] + strb r5, [r1, 0x1] + str r4, [r2, 0x8] + movs r0, 0x2 + strb r0, [r1, 0x2] + str r3, [r2, 0xC] + movs r0, 0x3 + strb r0, [r1, 0x3] + b _08032DB4 + .pool +_08032D98: + ldr r2, =0x03005d60 + ldr r0, =sub_805745C + str r0, [r2, 0x4] + ldr r1, =0x02024076 + strb r3, [r1, 0x1] + ldr r3, =sub_8064394 + str r3, [r2] + strb r5, [r1] + str r0, [r2, 0xC] + movs r0, 0x2 + strb r0, [r1, 0x3] + str r3, [r2, 0x8] + movs r0, 0x3 + strb r0, [r1, 0x2] +_08032DB4: + ldr r0, =0x0202406c + strb r6, [r0] + b _0803303C + .pool +_08032DD0: + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _08032E8C + movs r4, 0x4 + adds r3, r4, 0 + ands r3, r1 + cmp r3, 0 + beq _08032E1C + ldr r1, =0x03005d04 + ldr r0, =sub_8039ECC + str r0, [r1] + ldr r2, =0x03005d60 + ldr r0, =sub_805745C + str r0, [r2] + ldr r1, =0x02024076 + movs r0, 0 + strb r0, [r1] + ldr r3, =sub_805F164 + str r3, [r2, 0x4] + strb r5, [r1, 0x1] + ldr r0, =sub_814AEB0 + b _08032E2E + .pool +_08032E1C: + ldr r2, =0x03005d60 + ldr r0, =sub_814AEB0 + str r0, [r2] + ldr r1, =0x02024076 + strb r3, [r1] + ldr r3, =sub_8064394 + str r3, [r2, 0x4] + strb r5, [r1, 0x1] + ldr r0, =sub_805745C +_08032E2E: + str r0, [r2, 0x8] + movs r0, 0x2 + strb r0, [r1, 0x2] + str r3, [r2, 0xC] + movs r0, 0x3 + strb r0, [r1, 0x3] + ldr r0, =0x0202406c + strb r4, [r0] + movs r0, 0 + movs r1, 0 + bl sub_81B8D64 + movs r0, 0x1 + movs r1, 0 + bl sub_81B8D64 + movs r0, 0x2 + movs r1, 0x1 + bl sub_81B8D64 + movs r0, 0x3 + movs r1, 0x1 + bl sub_81B8D64 + ldr r0, =0x0202406e + movs r1, 0 + strh r1, [r0] + strh r1, [r0, 0x2] + movs r1, 0x3 + strh r1, [r0, 0x4] + strh r1, [r0, 0x6] + b _0803303C + .pool +_08032E8C: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r4] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08032EA4 + ldr r1, =0x03005d04 + ldr r0, =sub_8039ECC + str r0, [r1] +_08032EA4: + movs r0, 0 + mov r10, r0 + ldr r1, =0x020229e8 + mov r12, r1 + ldr r7, =0x02024076 + mov r8, r0 + ldr r6, =0x0202406e + movs r4, 0 + movs r2, 0x3 + mov r9, r2 +_08032EB8: + mov r1, r12 + adds r0, r4, r1 + ldrh r0, [r0, 0x18] + cmp r0, 0x2 + bgt _08032EE0 + cmp r0, 0x1 + bge _08032EF8 + cmp r0, 0 + beq _08032EE4 + b _08032F02 + .pool +_08032EE0: + cmp r0, 0x3 + bne _08032F02 +_08032EE4: + ldr r0, =0x020229e8 + adds r0, r4, r0 + ldrb r0, [r0, 0x18] + movs r1, 0 + bl sub_81B8D64 + b _08032F02 + .pool +_08032EF8: + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_81B8D64 +_08032F02: + cmp r10, r5 + bne _08032F52 + ldr r0, =0x020229e8 + adds r3, r4, r0 + ldrh r1, [r3, 0x18] + lsls r1, 2 + ldr r2, =0x03005d60 + adds r1, r2 + ldr r2, =sub_805745C + str r2, [r1] + ldrh r1, [r3, 0x18] + mov r12, r0 + cmp r1, 0x2 + bgt _08032F34 + cmp r1, 0x1 + bge _08032F48 + cmp r1, 0 + beq _08032F38 + b _08033028 + .pool +_08032F34: + cmp r1, 0x3 + bne _08033028 +_08032F38: + mov r1, r12 + adds r0, r4, r1 + ldrh r1, [r0, 0x18] + adds r1, r7 + mov r2, r8 + strb r2, [r1] + ldrh r0, [r0, 0x18] + b _0803300E +_08032F48: + adds r1, r7 + movs r0, 0x2 + strb r0, [r1] + ldrh r0, [r3, 0x18] + b _08033020 +_08032F52: + ldr r2, =0x020229e8 + adds r0, r4, r2 + ldrh r1, [r0, 0x18] + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r1 + mov r12, r2 + cmp r0, 0 + bne _08032F7C + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + add r0, r12 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08032F8E + b _08032FD4 + .pool +_08032F7C: + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + add r0, r12 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08032FD4 +_08032F8E: + mov r0, r12 + adds r2, r4, r0 + ldrh r0, [r2, 0x18] + lsls r0, 2 + ldr r1, =0x03005d60 + adds r0, r1 + ldr r1, =sub_814AEB0 + str r1, [r0] + ldrh r1, [r2, 0x18] + cmp r1, 0x2 + bgt _08032FB8 + cmp r1, 0x1 + bge _08032FCC + cmp r1, 0 + beq _08032FBC + b _08033028 + .pool +_08032FB8: + cmp r1, 0x3 + bne _08033028 +_08032FBC: + mov r2, r12 + adds r0, r4, r2 + ldrh r1, [r0, 0x18] + adds r1, r7 + mov r2, r8 + strb r2, [r1] + ldrh r0, [r0, 0x18] + b _0803300E +_08032FCC: + adds r1, r7 + movs r0, 0x2 + strb r0, [r1] + b _0803301E +_08032FD4: + mov r0, r12 + adds r2, r4, r0 + ldrh r0, [r2, 0x18] + lsls r0, 2 + ldr r1, =0x03005d60 + adds r0, r1 + ldr r1, =sub_8064394 + str r1, [r0] + ldrh r0, [r2, 0x18] + cmp r0, 0x2 + bgt _08032FFC + cmp r0, 0x1 + bge _08033018 + cmp r0, 0 + beq _08033000 + b _08033028 + .pool +_08032FFC: + cmp r0, 0x3 + bne _08033028 +_08033000: + mov r0, r12 + adds r2, r4, r0 + ldrh r0, [r2, 0x18] + adds r0, r7 + movs r1, 0x1 + strb r1, [r0] + ldrh r0, [r2, 0x18] +_0803300E: + lsls r0, 1 + adds r0, r6 + mov r1, r8 + strh r1, [r0] + b _08033028 +_08033018: + adds r0, r7 + mov r1, r9 + strb r1, [r0] +_0803301E: + ldrh r0, [r2, 0x18] +_08033020: + lsls r0, 1 + adds r0, r6 + mov r2, r9 + strh r2, [r0] +_08033028: + adds r4, 0x1C + movs r0, 0x1 + add r10, r0 + mov r1, r10 + cmp r1, 0x3 + bgt _08033036 + b _08032EB8 +_08033036: + ldr r1, =0x0202406c + movs r0, 0x4 +_0803303A: + strb r0, [r1] +_0803303C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end b_setup_bx_link + + thumb_func_start sub_8033050 +sub_8033050: @ 8033050 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08033068 + b _0803319C +_08033068: + movs r0, 0 + mov r8, r0 + b _0803317A + .pool +_08033074: + movs r5, 0 + movs r0, 0x1 + add r0, r8 + mov r10, r0 + ldr r0, =0x02024076 + add r0, r8 + mov r9, r0 + mov r0, r8 + lsls r6, r0, 1 + movs r7, 0 +_08033088: + mov r0, r8 + cmp r0, 0x1 + bgt _080330F0 + mov r0, r9 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080330A8 + ldr r0, =0x020244ec + b _080330AA + .pool +_080330A8: + ldr r0, =0x02024744 +_080330AA: + adds r4, r7, r0 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08033170 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _08033170 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _08033170 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _08033170 + ldr r0, =0x0202406e + adds r0, r6, r0 + strh r5, [r0] + b _08033178 + .pool +_080330F0: + mov r0, r9 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08033118 + ldr r0, =0x020244ec + adds r4, r7, r0 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08033170 + adds r0, r4, 0 + movs r1, 0xB + b _0803312C + .pool +_08033118: + ldr r0, =0x02024744 + adds r4, r7, r0 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08033170 + adds r0, r4, 0 + movs r1, 0x41 +_0803312C: + bl pokemon_getattr + cmp r0, 0 + beq _08033170 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _08033170 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _08033170 + ldr r1, =0x0202406e + mov r0, r8 + subs r0, 0x2 + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r5 + beq _08033170 + adds r0, r6, r1 + strh r5, [r0] + b _08033178 + .pool +_08033170: + adds r7, 0x64 + adds r5, 0x1 + cmp r5, 0x5 + ble _08033088 +_08033178: + mov r8, r10 +_0803317A: + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r8, r0 + bge _08033184 + b _08033074 +_08033184: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0803319C + ldr r0, =0x0202406e + movs r1, 0 + strh r1, [r0, 0x2] + movs r1, 0x3 + strh r1, [r0, 0x6] +_0803319C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8033050 + + thumb_func_start dp01_prepare_buffer +dp01_prepare_buffer: @ 80331B8 + push {r4-r6,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r3, r0, 24 + adds r5, r3, 0 + lsls r2, 16 + lsrs r2, 16 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080331E4 + adds r0, r3, 0 + adds r1, r2, 0 + adds r2, r4, 0 + bl dp01_prepare_buffer_wireless_probably + b _08033236 + .pool +_080331E4: + cmp r5, 0 + beq _080331EE + cmp r5, 0x1 + beq _08033218 + b _08033236 +_080331EE: + movs r3, 0 + cmp r3, r2 + bge _08033236 + ldr r6, =0x02023064 + ldr r5, =0x02024064 +_080331F8: + ldrb r0, [r5] + lsls r0, 9 + adds r0, r3, r0 + adds r0, r6 + ldrb r1, [r4] + strb r1, [r0] + adds r4, 0x1 + adds r3, 0x1 + cmp r3, r2 + blt _080331F8 + b _08033236 + .pool +_08033218: + movs r3, 0 + cmp r3, r2 + bge _08033236 + ldr r6, =0x02023864 + ldr r5, =0x02024064 +_08033222: + ldrb r0, [r5] + lsls r0, 9 + adds r0, r3, r0 + adds r0, r6 + ldrb r1, [r4] + strb r1, [r0] + adds r4, 0x1 + adds r3, 0x1 + cmp r3, r2 + blt _08033222 +_08033236: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_prepare_buffer + + thumb_func_start sub_8033244 +sub_8033244: @ 8033244 + push {r4-r6,lr} + ldr r0, =task00_wireless_something + movs r1, 0 + bl CreateTask + ldr r2, =0x02022d08 + strb r0, [r2] + ldr r5, =0x03005e00 + ldrb r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r6, 0 + movs r4, 0 + strh r4, [r0, 0x1E] + ldrb r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r4, [r0, 0x20] + ldrb r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r4, [r0, 0x22] + ldrb r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r4, [r0, 0x24] + ldrb r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r4, [r0, 0x26] + ldr r0, =sub_803375C + movs r1, 0 + bl CreateTask + ldr r2, =0x02022d09 + strb r0, [r2] + ldrb r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r4, [r0, 0x20] + ldrb r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r4, [r0, 0x22] + ldrb r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r4, [r0, 0x24] + ldrb r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r4, [r0, 0x26] + ldr r0, =0x02022d0a + strb r6, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8033244 + + thumb_func_start dp01_prepare_buffer_wireless_probably +dp01_prepare_buffer_wireless_probably: @ 80332F4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r2 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 16 + lsrs r1, 16 + mov r12, r1 + movs r1, 0x3 + mov r0, r12 + bics r0, r1 + adds r0, 0x4 + mov r8, r0 + ldr r2, =0x03005e00 + ldr r3, =0x02022d08 + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r4, r0, r2 + movs r1, 0x24 + ldrsh r0, [r4, r1] + add r0, r8 + adds r0, 0x9 + movs r1, 0x80 + lsls r1, 5 + adds r5, r2, 0 + cmp r0, r1 + ble _08033346 + ldrh r0, [r4, 0x24] + movs r2, 0 + strh r0, [r4, 0x20] + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r2, [r0, 0x24] +_08033346: + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r2, 0x24 + ldrsh r1, [r0, r2] + ldr r4, =0x020244a0 + ldr r0, [r4] + adds r0, r1 + strb r6, [r0] + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r7, 0x24 + ldrsh r1, [r0, r7] + ldr r0, [r4] + adds r1, r0 + ldr r0, =0x02024064 + ldrb r0, [r0] + strb r0, [r1, 0x1] + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r2, 0x24 + ldrsh r1, [r0, r2] + ldr r0, [r4] + adds r1, r0 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r1, 0x2] + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r7, 0x24 + ldrsh r1, [r0, r7] + ldr r0, [r4] + adds r1, r0 + ldr r0, =0x0202420c + ldrb r0, [r0] + strb r0, [r1, 0x3] + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r1, 0x24 + ldrsh r0, [r0, r1] + ldr r1, [r4] + adds r0, r1 + mov r2, r8 + strb r2, [r0, 0x4] + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r7, 0x24 + ldrsh r1, [r0, r7] + ldr r0, [r4] + adds r1, r0 + movs r0, 0xFF + lsls r0, 8 + mov r2, r8 + ands r0, r2 + asrs r0, 8 + strb r0, [r1, 0x5] + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r7, 0x24 + ldrsh r1, [r0, r7] + ldr r0, [r4] + adds r1, r0 + ldr r0, =0x02024210 + ldrb r0, [r0] + strb r0, [r1, 0x6] + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r2, 0x24 + ldrsh r1, [r0, r2] + ldr r0, [r4] + adds r1, r0 + ldr r0, =0x0202420e + ldrb r0, [r0] + strb r0, [r1, 0x7] + movs r2, 0 + cmp r2, r12 + bge _08033434 + mov r10, r5 + adds r6, r3, 0 +_08033412: + ldrb r1, [r6] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + add r0, r10 + movs r7, 0x24 + ldrsh r1, [r0, r7] + ldr r0, [r4] + adds r1, r2, r1 + adds r1, r0 + mov r7, r9 + adds r0, r7, r2 + ldrb r0, [r0] + strb r0, [r1, 0x8] + adds r2, 0x1 + cmp r2, r12 + blt _08033412 +_08033434: + ldrb r0, [r3] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + ldrh r0, [r1, 0x24] + add r0, r8 + adds r0, 0x8 + strh r0, [r1, 0x24] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_prepare_buffer_wireless_probably + + thumb_func_start task00_wireless_something +task00_wireless_something: @ 8033474 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x1E + ldrsh r0, [r0, r2] + adds r7, r1, 0 + cmp r0, 0x5 + bls _08033490 + b _08033640 +_08033490: + lsls r0, 2 + ldr r1, =_080334A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080334A4: + .4byte _080334BC + .4byte _080334CA + .4byte _080334E6 + .4byte _08033570 + .4byte _080335E6 + .4byte _08033624 +_080334BC: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r7 + movs r1, 0x64 + strh r1, [r0, 0x1C] + b _080334F6 +_080334CA: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r7 + ldrh r0, [r1, 0x1C] + subs r0, 0x1 + strh r0, [r1, 0x1C] + lsls r0, 16 + cmp r0, 0 + beq _080334E0 + b _08033640 +_080334E0: + ldrh r0, [r1, 0x1E] + adds r0, 0x1 + b _0803363E +_080334E6: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08033504 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r7 +_080334F6: + ldrh r1, [r0, 0x1E] + adds r1, 0x1 + strh r1, [r0, 0x1E] + b _08033640 + .pool +_08033504: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _0803351C + movs r5, 0x2 + b _0803352A + .pool +_0803351C: + movs r0, 0x40 + ands r1, r0 + movs r0, 0x2 + cmp r1, 0 + beq _08033528 + movs r0, 0x4 +_08033528: + adds r5, r0, 0 +_0803352A: + bl sub_800ABAC + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + bcs _08033538 + b _08033640 +_08033538: + bl sub_800ABBC + lsls r0, 24 + cmp r0, 0 + beq _0803355C + bl sub_800A620 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x1E] + adds r0, 0x1 + b _0803363E + .pool +_0803355C: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x1E] + adds r0, 0x1 + b _0803363E + .pool +_08033570: + lsls r1, r4, 2 + adds r0, r1, r4 + lsls r0, 3 + adds r2, r0, r7 + movs r3, 0x26 + ldrsh r5, [r2, r3] + movs r0, 0x24 + ldrsh r6, [r2, r0] + mov r12, r6 + cmp r5, r12 + beq _08033640 + ldrh r0, [r2, 0x22] + movs r6, 0x22 + ldrsh r3, [r2, r6] + cmp r3, 0 + bne _080335E0 + cmp r5, r12 + ble _080335A0 + movs r6, 0x20 + ldrsh r0, [r2, r6] + cmp r5, r0 + bne _080335A0 + strh r3, [r2, 0x20] + strh r3, [r2, 0x26] +_080335A0: + adds r4, r1, r4 + lsls r4, 3 + adds r4, r7 + movs r0, 0x26 + ldrsh r1, [r4, r0] + ldr r5, =0x020244a0 + ldr r0, [r5] + adds r1, r0 + ldrb r0, [r1, 0x4] + ldrb r1, [r1, 0x5] + lsls r1, 8 + orrs r0, r1 + adds r0, 0x8 + lsls r0, 16 + lsrs r6, r0, 16 + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x26 + ldrsh r2, [r4, r1] + ldr r1, [r5] + adds r1, r2 + adds r2, r6, 0 + bl link_0800A448 + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + strh r0, [r4, 0x1E] + b _08033640 + .pool +_080335E0: + subs r0, 0x1 + strh r0, [r2, 0x22] + b _08033640 +_080335E6: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08033640 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r3, 0x26 + ldrsh r2, [r1, r3] + ldr r0, =0x020244a0 + ldr r0, [r0] + adds r2, r0 + ldrb r0, [r2, 0x4] + ldrb r2, [r2, 0x5] + lsls r2, 8 + movs r3, 0x1 + strh r3, [r1, 0x22] + orrs r0, r2 + ldrh r6, [r1, 0x26] + adds r0, r6 + adds r0, 0x8 + strh r0, [r1, 0x26] + b _0803363C + .pool +_08033624: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r7 + ldrh r0, [r1, 0x22] + subs r0, 0x1 + strh r0, [r1, 0x22] + lsls r0, 16 + cmp r0, 0 + bne _08033640 + movs r0, 0x1 + strh r0, [r1, 0x22] +_0803363C: + movs r0, 0x3 +_0803363E: + strh r0, [r1, 0x1E] +_08033640: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end task00_wireless_something + + thumb_func_start sub_8033648 +sub_8033648: @ 8033648 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _08033738 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08033738 + bl sub_8011BD0 + movs r4, 0 + ldr r0, =0x020223c4 + mov r10, r0 + b _0803372C + .pool +_08033680: + bl sub_800A550 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_0832A328 + lsls r1, r4, 2 + adds r1, r2 + ldr r1, [r1] + ands r0, r1 + adds r1, r4, 0x1 + mov r9, r1 + cmp r0, 0 + beq _08033726 + adds r0, r4, 0 + bl sub_800A5EC + lsls r0, r4, 8 + mov r4, r10 + adds r3, r0, r4 + ldr r1, =0x020223c8 + adds r0, r1 + ldrh r6, [r0] + ldr r7, =0x03005e00 + ldr r4, =0x02022d09 + mov r12, r4 + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r2, r0, r7 + movs r0, 0x24 + ldrsh r1, [r2, r0] + adds r0, r6, 0 + adds r0, 0x9 + adds r1, r0 + movs r0, 0x80 + lsls r0, 5 + cmp r1, r0 + ble _080336E0 + ldrh r0, [r2, 0x24] + strh r0, [r2, 0x20] + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r1, 0 + strh r1, [r0, 0x24] +_080336E0: + ldr r2, =0x020244a4 + mov r4, r12 + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r7 + movs r4, 0x24 + ldrsh r1, [r0, r4] + ldr r0, [r2] + adds r5, r0, r1 + adds r4, r3, 0 + movs r2, 0 + adds r3, r6, 0 + adds r3, 0x8 + mov r8, r7 + mov r7, r12 + cmp r2, r3 + bge _08033714 +_08033706: + adds r0, r5, r2 + adds r1, r4, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, r3 + blt _08033706 +_08033714: + ldrb r0, [r7] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + add r1, r8 + ldrh r0, [r1, 0x24] + adds r0, r6, r0 + adds r0, 0x8 + strh r0, [r1, 0x24] +_08033726: + mov r1, r9 + lsls r0, r1, 24 + lsrs r4, r0, 24 +_0803372C: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcc _08033680 +_08033738: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8033648 + + thumb_func_start sub_803375C +sub_803375C: @ 803375C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r3, r0, r1 + movs r0, 0x26 + ldrsh r2, [r3, r0] + movs r4, 0x24 + ldrsh r0, [r3, r4] + cmp r2, r0 + bne _08033780 + b _0803389C +_08033780: + cmp r2, r0 + ble _08033792 + movs r4, 0x20 + ldrsh r0, [r3, r4] + cmp r2, r0 + bne _08033792 + movs r0, 0 + strh r0, [r3, 0x20] + strh r0, [r3, 0x26] +_08033792: + lsls r2, r7, 2 + adds r0, r2, r7 + lsls r0, 3 + adds r5, r0, r1 + movs r0, 0x26 + ldrsh r1, [r5, r0] + ldr r3, =0x020244a4 + mov r8, r3 + ldr r0, [r3] + adds r3, r1, r0 + ldrb r4, [r3, 0x1] + ldrb r6, [r3, 0x4] + ldrb r0, [r3, 0x5] + lsls r0, 8 + orrs r6, r0 + ldrb r0, [r3] + mov r9, r2 + cmp r0, 0x1 + beq _0803385C + cmp r0, 0x1 + bgt _080337CC + cmp r0, 0 + beq _080337D2 + b _0803388A + .pool +_080337CC: + cmp r0, 0x2 + beq _08033874 + b _0803388A +_080337D2: + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + lsls r0, r4, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0803389C + lsls r0, r4, 9 + ldr r1, =0x02023064 + adds r0, r1 + adds r1, r3, 0 + adds r1, 0x8 + adds r2, r6, 0 + bl memcpy + adds r0, r4, 0 + bl sub_803F850 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + bne _0803388A + ldr r2, =0x0202420b + movs r4, 0x26 + ldrsh r0, [r5, r4] + mov r3, r8 + ldr r1, [r3] + adds r0, r1 + ldrb r0, [r0, 0x2] + strb r0, [r2] + ldr r2, =0x0202420c + movs r4, 0x26 + ldrsh r0, [r5, r4] + adds r0, r1 + ldrb r0, [r0, 0x3] + strb r0, [r2] + ldr r2, =0x02024210 + movs r3, 0x26 + ldrsh r0, [r5, r3] + adds r0, r1 + ldrb r0, [r0, 0x6] + strb r0, [r2] + ldr r2, =0x0202420e + movs r4, 0x26 + ldrsh r0, [r5, r4] + adds r0, r1 + ldrb r0, [r0, 0x7] + strb r0, [r2] + b _0803388A + .pool +_0803385C: + lsls r0, r4, 9 + ldr r1, =0x02023864 + adds r0, r1 + adds r1, r3, 0 + adds r1, 0x8 + adds r2, r6, 0 + bl memcpy + b _0803388A + .pool +_08033874: + ldrb r2, [r3, 0x8] + ldr r3, =0x02024068 + ldr r1, =gUnknown_0832A328 + lsls r0, r4, 2 + adds r0, r1 + lsls r2, 2 + ldr r1, [r0] + lsls r1, r2 + ldr r0, [r3] + bics r0, r1 + str r0, [r3] +_0803388A: + ldr r0, =0x03005e00 + mov r2, r9 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + adds r0, r6, r0 + adds r0, 0x8 + strh r0, [r1, 0x26] +_0803389C: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803375C + + thumb_func_start dp01_build_cmdbuf_x00_a_b_0 +dp01_build_cmdbuf_x00_a_b_0: @ 80338B4 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r3, 0 + strb r3, [r1] + strb r4, [r1, 0x1] + strb r2, [r1, 0x2] + strb r3, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x00_a_b_0 + + thumb_func_start dp01_build_cmdbuf_x01_a_b_0 +dp01_build_cmdbuf_x01_a_b_0: @ 80338D8 + push {r4,r5,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r4, 0 + movs r3, 0x1 + strb r3, [r1] + strb r5, [r1, 0x1] + strb r2, [r1, 0x2] + strb r4, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x01_a_b_0 + + thumb_func_start dp01_build_cmdbuf_x02_a_b_varargs +dp01_build_cmdbuf_x02_a_b_varargs: @ 8033900 + push {r4-r6,lr} + ldr r4, [sp, 0x10] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r3, 24 + lsrs r5, r3, 24 + ldr r0, =0x02022d10 + movs r3, 0x2 + strb r3, [r0] + strb r1, [r0, 0x1] + strb r2, [r0, 0x2] + adds r1, r0, 0 + cmp r5, 0 + beq _0803392E + adds r3, r1, 0x3 + adds r2, r5, 0 +_08033920: + ldrb r0, [r4] + strb r0, [r3] + adds r4, 0x1 + adds r3, 0x1 + subs r2, 0x1 + cmp r2, 0 + bne _08033920 +_0803392E: + adds r2, r5, 0x3 + adds r0, r6, 0 + bl dp01_prepare_buffer + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x02_a_b_varargs + + thumb_func_start sub_8033940 +sub_8033940: @ 8033940 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r2, 24 + lsrs r4, r2, 24 + ldr r0, =0x02022d10 + movs r2, 0x3 + strb r2, [r0] + strb r1, [r0, 0x1] + strb r4, [r0, 0x2] + adds r5, r0, 0 + cmp r4, 0 + beq _0803396C + adds r1, r5, 0x3 + adds r2, r4, 0 +_0803395E: + ldrb r0, [r3] + strb r0, [r1] + adds r3, 0x1 + adds r1, 0x1 + subs r2, 0x1 + cmp r2, 0 + bne _0803395E +_0803396C: + adds r2, r4, 0x3 + adds r0, r6, 0 + adds r1, r5, 0 + bl dp01_prepare_buffer + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8033940 + + thumb_func_start dp01_build_cmdbuf_x04_4_4_4 +dp01_build_cmdbuf_x04_4_4_4: @ 8033980 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x4 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x04_4_4_4 + + thumb_func_start dp01_build_cmdbuf_x05_a_b_c +dp01_build_cmdbuf_x05_a_b_c: @ 80339A0 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r3, 0x5 + strb r3, [r1] + strb r4, [r1, 0x1] + strb r2, [r1, 0x2] + strb r3, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x05_a_b_c + + thumb_func_start dp01_build_cmdbuf_x06_a +dp01_build_cmdbuf_x06_a: @ 80339C4 + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x6 + strb r2, [r1] + strb r3, [r1, 0x1] + movs r2, 0x2 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x06_a + + thumb_func_start dp01_build_cmdbuf_x07_7_7_7 +dp01_build_cmdbuf_x07_7_7_7: @ 80339E4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x7 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x07_7_7_7 + + thumb_func_start dp01_build_cmdbuf_x08_8_8_8 +dp01_build_cmdbuf_x08_8_8_8: @ 8033A04 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x8 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x08_8_8_8 + + thumb_func_start dp01_build_cmdbuf_x09_9_9_9 +dp01_build_cmdbuf_x09_9_9_9: @ 8033A24 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x9 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x09_9_9_9 + + thumb_func_start dp01_build_cmdbuf_x0A_A_A_A +dp01_build_cmdbuf_x0A_A_A_A: @ 8033A44 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0xA + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x0A_A_A_A + + thumb_func_start dp01_build_cmdbuf_x0B_B_B_B +dp01_build_cmdbuf_x0B_B_B_B: @ 8033A64 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0xB + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x0B_B_B_B + + thumb_func_start dp01_build_cmdbuf_x0C_C_C_C +dp01_build_cmdbuf_x0C_C_C_C: @ 8033A84 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0xC + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x0C_C_C_C + + thumb_func_start dp01_build_cmdbuf_x0D_a +dp01_build_cmdbuf_x0D_a: @ 8033AA4 + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0xD + strb r2, [r1] + strb r3, [r1, 0x1] + movs r2, 0x2 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x0D_a + + thumb_func_start sub_8033AC4 +sub_8033AC4: @ 8033AC4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r1, =0x02022d10 + movs r0, 0xE + strb r0, [r1] + strb r4, [r1, 0x1] + lsls r0, r4, 1 + adds r0, r4 + adds r5, r1, 0 + cmp r0, 0 + beq _08033AF2 + adds r1, r5, 0x2 + adds r3, r0, 0 +_08033AE4: + ldrb r0, [r2] + strb r0, [r1] + adds r2, 0x1 + adds r1, 0x1 + subs r3, 0x1 + cmp r3, 0 + bne _08033AE4 +_08033AF2: + lsls r2, r4, 1 + adds r2, r4 + adds r2, 0x2 + adds r0, r6, 0 + adds r1, r5, 0 + bl dp01_prepare_buffer + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8033AC4 + + thumb_func_start dp01_build_cmdbuf_x0F_aa_b_cc_dddd_e_mlc_weather_00_x1Cbytes +dp01_build_cmdbuf_x0F_aa_b_cc_dddd_e_mlc_weather_00_x1Cbytes: @ 8033B0C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + ldr r4, [sp, 0x20] + ldr r5, [sp, 0x24] + ldr r6, [sp, 0x2C] + mov r8, r6 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, 16 + lsrs r1, 16 + lsls r3, 16 + lsrs r3, 16 + ldr r7, =0x02022d10 + movs r0, 0 + mov r12, r0 + movs r0, 0xF + strb r0, [r7] + strb r1, [r7, 0x1] + lsrs r1, 8 + strb r1, [r7, 0x2] + strb r2, [r7, 0x3] + strb r3, [r7, 0x4] + movs r6, 0xFF + lsls r6, 8 + lsrs r3, 8 + strb r3, [r7, 0x5] + strb r4, [r7, 0x6] + adds r0, r4, 0 + ands r0, r6 + asrs r0, 8 + strb r0, [r7, 0x7] + movs r0, 0xFF + lsls r0, 16 + ands r0, r4 + asrs r0, 16 + strb r0, [r7, 0x8] + lsrs r4, 24 + strb r4, [r7, 0x9] + strb r5, [r7, 0xA] + mov r0, r8 + strb r0, [r7, 0xB] + mov r0, r12 + str r0, [sp] + movs r0, 0xE + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08033BAC + str r0, [sp] + movs r0, 0xE + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _08033BAC + ldr r0, =0x020243cc + ldrh r0, [r0] + strb r0, [r7, 0xC] + ands r6, r0 + lsrs r0, r6, 8 + strb r0, [r7, 0xD] + adds r4, r7, 0 + b _08033BB6 + .pool +_08033BAC: + ldr r0, =0x02022d10 + movs r1, 0 + strb r1, [r0, 0xC] + strb r1, [r0, 0xD] + adds r4, r0, 0 +_08033BB6: + movs r0, 0 + strb r0, [r4, 0xE] + strb r0, [r4, 0xF] + adds r0, r4, 0 + adds r0, 0x10 + ldr r1, [sp, 0x28] + movs r2, 0x1C + bl memcpy + mov r0, r9 + adds r1, r4, 0 + movs r2, 0x2C + bl dp01_prepare_buffer + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x0F_aa_b_cc_dddd_e_mlc_weather_00_x1Cbytes + + thumb_func_start dp01_build_cmdbuf_x10_TODO +dp01_build_cmdbuf_x10_TODO: @ 8033BE4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r2, =0x02022d10 + movs r0, 0x10 + strb r0, [r2] + ldr r0, =0x0202433a + ldrb r0, [r0] + strb r0, [r2, 0x1] + strb r1, [r2, 0x2] + lsrs r1, 8 + strb r1, [r2, 0x3] + adds r0, r2, 0x4 + mov r12, r0 + ldr r4, =0x020241ea + ldrh r0, [r4] + strh r0, [r2, 0x4] + ldr r0, =0x020241ec + ldrh r0, [r0] + mov r1, r12 + strh r0, [r1, 0x2] + ldr r0, =0x02024208 + ldrh r0, [r0] + strh r0, [r1, 0x4] + ldr r0, =0x0202420a + ldrb r0, [r0] + strb r0, [r1, 0x6] + ldr r0, =0x02024474 + ldrb r0, [r0, 0x17] + strb r0, [r1, 0x7] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x52 + ldrb r1, [r1] + mov r3, r12 + strb r1, [r3, 0x8] + adds r0, 0xB1 + ldrb r0, [r0] + strb r0, [r3, 0x9] + ldr r0, =0x0202420f + ldrb r0, [r0] + strb r0, [r3, 0xA] + ldr r3, =gBattleMoves + ldrh r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x2] + mov r7, r12 + strb r0, [r7, 0xB] + movs r3, 0 + mov r9, r2 + ldr r0, =0x02022f78 + mov r8, r0 + adds r2, 0x10 + ldr r0, =0x02024084 + adds r4, r0, 0 + adds r4, 0x20 +_08033C6A: + adds r1, r2, r3 + ldrb r0, [r4] + strb r0, [r1] + adds r4, 0x58 + adds r3, 0x1 + cmp r3, 0x3 + ble _08033C6A + movs r3, 0 + mov r5, r12 + adds r5, 0x10 + mov r4, r12 + adds r4, 0x20 + ldr r6, =0x02022f68 + mov r2, r12 + adds r2, 0x30 +_08033C88: + adds r1, r5, r3 + ldr r7, =0x02022f58 + adds r0, r3, r7 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r4, r3 + adds r0, r3, r6 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r2, r3 + mov r7, r8 + adds r0, r3, r7 + ldrb r0, [r0] + strb r0, [r1] + adds r3, 0x1 + cmp r3, 0xF + ble _08033C88 + mov r0, r10 + mov r1, r9 + movs r2, 0x44 + bl dp01_prepare_buffer + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x10_TODO + + thumb_func_start dp01_build_cmdbuf_x11_TODO +dp01_build_cmdbuf_x11_TODO: @ 8033CFC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r2, =0x02022d10 + movs r0, 0x11 + strb r0, [r2] + strb r0, [r2, 0x1] + strb r1, [r2, 0x2] + lsrs r1, 8 + strb r1, [r2, 0x3] + adds r0, r2, 0x4 + mov r12, r0 + ldr r0, =0x020241ea + ldrh r0, [r0] + strh r0, [r2, 0x4] + ldr r0, =0x020241ec + ldrh r0, [r0] + mov r1, r12 + strh r0, [r1, 0x2] + ldr r0, =0x02024208 + ldrh r0, [r0] + strh r0, [r1, 0x4] + ldr r0, =0x0202420a + ldrb r0, [r0] + strb r0, [r1, 0x6] + ldr r0, =0x02024474 + ldrb r0, [r0, 0x17] + strb r0, [r1, 0x7] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x52 + ldrb r0, [r0] + strb r0, [r1, 0x8] + movs r3, 0 + mov r9, r2 + ldr r7, =0x02022f78 + mov r8, r7 + mov r4, r9 + adds r4, 0x10 + ldr r0, =0x02024084 + adds r2, r0, 0 + adds r2, 0x20 +_08033D5E: + adds r1, r4, r3 + ldrb r0, [r2] + strb r0, [r1] + adds r2, 0x58 + adds r3, 0x1 + cmp r3, 0x3 + ble _08033D5E + movs r3, 0 + mov r5, r12 + adds r5, 0x10 + mov r4, r12 + adds r4, 0x20 + ldr r6, =0x02022f68 + mov r2, r12 + adds r2, 0x30 +_08033D7C: + adds r1, r5, r3 + ldr r7, =0x02022f58 + adds r0, r3, r7 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r4, r3 + adds r0, r3, r6 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r2, r3 + mov r7, r8 + adds r0, r3, r7 + ldrb r0, [r0] + strb r0, [r1] + adds r3, 0x1 + cmp r3, 0xF + ble _08033D7C + mov r0, r10 + mov r1, r9 + movs r2, 0x44 + bl dp01_prepare_buffer + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x11_TODO + + thumb_func_start dp01_build_cmdbuf_x12_a_bb +dp01_build_cmdbuf_x12_a_bb: @ 8033DE4 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + lsrs r2, 16 + ldr r1, =0x02022d10 + movs r3, 0x12 + strb r3, [r1] + strb r4, [r1, 0x1] + strb r2, [r1, 0x2] + lsrs r2, 8 + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x12_a_bb + + thumb_func_start sub_8033E10 +sub_8033E10: @ 8033E10 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x13 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end sub_8033E10 + + thumb_func_start sub_8033E30 +sub_8033E30: @ 8033E30 + push {r4-r6,lr} + adds r5, r3, 0 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r3, =0x02022d10 + movs r4, 0 + movs r0, 0x14 + strb r0, [r3] + strb r1, [r3, 0x1] + strb r2, [r3, 0x2] + strb r4, [r3, 0x3] + movs r2, 0 + adds r1, r3, 0 + adds r4, r1, 0x4 +_08033E4C: + adds r0, r5, r2 + ldrb r0, [r0] + strb r0, [r4] + adds r4, 0x1 + adds r2, 0x1 + cmp r2, 0x13 + bls _08033E4C + adds r0, r6, 0 + movs r2, 0x18 + bl dp01_prepare_buffer + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8033E30 + + thumb_func_start sub_8033E6C +sub_8033E6C: @ 8033E6C + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x02022d10 + movs r0, 0x15 + strb r0, [r1] + movs r2, 0 + adds r3, r1, 0x1 +_08033E7E: + adds r0, r4, r2 + ldrb r0, [r0] + strb r0, [r3] + adds r3, 0x1 + adds r2, 0x1 + cmp r2, 0x2 + ble _08033E7E + adds r0, r5, 0 + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8033E6C + + thumb_func_start dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f +dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f: @ 8033EA0 + push {r4-r6,lr} + ldr r6, [sp, 0x10] + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x02022d10 + movs r0, 0x16 + strb r0, [r4] + strb r1, [r4, 0x1] + strb r2, [r4, 0x2] + strb r3, [r4, 0x3] + movs r2, 0 + adds r1, r4, 0 + adds r3, r1, 0x4 +_08033EBA: + adds r0, r6, r2 + ldrb r0, [r0] + strb r0, [r3] + adds r3, 0x1 + adds r2, 0x1 + cmp r2, 0x2 + ble _08033EBA + adds r0, r5, 0 + movs r2, 0x8 + bl dp01_prepare_buffer + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f + + thumb_func_start dp01_build_cmdbuf_x17_17_17_17 +dp01_build_cmdbuf_x17_17_17_17: @ 8033EDC + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x17 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x17_17_17_17 + + thumb_func_start dp01_build_cmdbuf_x18_0_aa_health_bar_update +dp01_build_cmdbuf_x18_0_aa_health_bar_update: @ 8033EFC + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + ldr r3, =0x02022d10 + movs r4, 0 + movs r2, 0x18 + strb r2, [r3] + strb r4, [r3, 0x1] + strb r1, [r3, 0x2] + lsls r1, 16 + asrs r1, 16 + movs r2, 0xFF + lsls r2, 8 + ands r1, r2 + asrs r1, 8 + strb r1, [r3, 0x3] + adds r1, r3, 0 + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x18_0_aa_health_bar_update + + thumb_func_start dp01_build_cmdbuf_x19_a_bb +dp01_build_cmdbuf_x19_a_bb: @ 8033F34 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + lsrs r2, 16 + ldr r1, =0x02022d10 + movs r3, 0x19 + strb r3, [r1] + strb r4, [r1, 0x1] + strb r2, [r1, 0x2] + lsls r2, 16 + asrs r2, 16 + movs r3, 0xFF + lsls r3, 8 + ands r2, r3 + asrs r2, 8 + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x19_a_bb + + thumb_func_start dp01_build_cmdbuf_x1A_aaaa_bbbb +dp01_build_cmdbuf_x1A_aaaa_bbbb: @ 8033F68 + push {r4-r6,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r3, 0x1A + strb r3, [r1] + strb r4, [r1, 0x1] + movs r6, 0xFF + lsls r6, 8 + adds r3, r4, 0 + ands r3, r6 + lsrs r3, 8 + strb r3, [r1, 0x2] + movs r5, 0xFF + lsls r5, 16 + adds r3, r4, 0 + ands r3, r5 + lsrs r3, 16 + strb r3, [r1, 0x3] + lsrs r4, 24 + strb r4, [r1, 0x4] + strb r2, [r1, 0x5] + adds r3, r2, 0 + ands r3, r6 + lsrs r3, 8 + strb r3, [r1, 0x6] + adds r3, r2, 0 + ands r3, r5 + lsrs r3, 16 + strb r3, [r1, 0x7] + lsrs r2, 24 + strb r2, [r1, 0x8] + movs r2, 0x9 + bl dp01_prepare_buffer + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x1A_aaaa_bbbb + + thumb_func_start dp01_build_cmdbuf_x1B_aaaa_b +dp01_build_cmdbuf_x1B_aaaa_b: @ 8033FBC + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r3, 0x1B + strb r3, [r1] + strb r4, [r1, 0x1] + strb r2, [r1, 0x2] + movs r3, 0xFF + lsls r3, 8 + ands r3, r2 + lsrs r3, 8 + strb r3, [r1, 0x3] + movs r3, 0xFF + lsls r3, 16 + ands r3, r2 + lsrs r3, 16 + strb r3, [r1, 0x4] + lsrs r2, 24 + strb r2, [r1, 0x5] + movs r2, 0x6 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x1B_aaaa_b + + thumb_func_start dp01_build_cmdbuf_x1C_a +dp01_build_cmdbuf_x1C_a: @ 8033FF8 + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x1C + strb r2, [r1] + strb r3, [r1, 0x1] + movs r2, 0x2 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x1C_a + + thumb_func_start dp01_build_cmdbuf_x1D_1D_numargs_varargs +dp01_build_cmdbuf_x1D_1D_numargs_varargs: @ 8034018 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 16 + lsrs r4, r1, 16 + ldr r1, =0x02022d10 + movs r0, 0x1D + strb r0, [r1] + strb r0, [r1, 0x1] + strb r4, [r1, 0x2] + lsrs r0, r4, 8 + strb r0, [r1, 0x3] + adds r5, r1, 0 + cmp r4, 0 + beq _08034048 + adds r1, r5, 0x4 + adds r3, r4, 0 +_0803403A: + ldrb r0, [r2] + strb r0, [r1] + adds r2, 0x1 + adds r1, 0x1 + subs r3, 0x1 + cmp r3, 0 + bne _0803403A +_08034048: + adds r2, r4, 0x4 + lsls r2, 16 + lsrs r2, 16 + adds r0, r6, 0 + adds r1, r5, 0 + bl dp01_prepare_buffer + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x1D_1D_numargs_varargs + + thumb_func_start sub_8034060 +sub_8034060: @ 8034060 + push {r4-r6,lr} + adds r4, r3, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r2, 16 + lsrs r5, r2, 16 + ldr r2, =0x02022d10 + movs r0, 0x1E + strb r0, [r2] + strb r1, [r2, 0x1] + movs r3, 0xFF + lsls r3, 8 + adds r0, r1, 0 + ands r0, r3 + lsrs r0, 8 + strb r0, [r2, 0x2] + movs r0, 0xFF + lsls r0, 16 + ands r0, r1 + lsrs r0, 16 + strb r0, [r2, 0x3] + lsrs r1, 24 + strb r1, [r2, 0x4] + strb r5, [r2, 0x5] + adds r0, r5, 0 + ands r0, r3 + lsrs r0, 8 + strb r0, [r2, 0x6] + adds r1, r2, 0 + cmp r5, 0 + beq _080340B0 + adds r3, r1, 0x7 + adds r2, r5, 0 +_080340A2: + ldrb r0, [r4] + strb r0, [r3] + adds r4, 0x1 + adds r3, 0x1 + subs r2, 0x1 + cmp r2, 0 + bne _080340A2 +_080340B0: + adds r2, r5, 0x7 + lsls r2, 16 + lsrs r2, 16 + adds r0, r6, 0 + bl dp01_prepare_buffer + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8034060 + + thumb_func_start sub_80340C8 +sub_80340C8: @ 80340C8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 16 + lsrs r4, r1, 16 + ldr r1, =0x02022d10 + movs r0, 0x1F + strb r0, [r1] + strb r4, [r1, 0x1] + lsrs r0, r4, 8 + strb r0, [r1, 0x2] + adds r5, r1, 0 + cmp r4, 0 + beq _080340F6 + adds r1, r5, 0x3 + adds r3, r4, 0 +_080340E8: + ldrb r0, [r2] + strb r0, [r1] + adds r2, 0x1 + adds r1, 0x1 + subs r3, 0x1 + cmp r3, 0 + bne _080340E8 +_080340F6: + adds r2, r4, 0x3 + lsls r2, 16 + lsrs r2, 16 + adds r0, r6, 0 + adds r1, r5, 0 + bl dp01_prepare_buffer + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80340C8 + + thumb_func_start sub_8034110 +sub_8034110: @ 8034110 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 16 + lsrs r4, r1, 16 + ldr r1, =0x02022d10 + movs r0, 0x20 + strb r0, [r1] + strb r4, [r1, 0x1] + lsrs r0, r4, 8 + strb r0, [r1, 0x2] + adds r5, r1, 0 + cmp r4, 0 + beq _0803413E + adds r1, r5, 0x3 + adds r3, r4, 0 +_08034130: + ldrb r0, [r2] + strb r0, [r1] + adds r2, 0x1 + adds r1, 0x1 + subs r3, 0x1 + cmp r3, 0 + bne _08034130 +_0803413E: + adds r2, r4, 0x3 + lsls r2, 16 + lsrs r2, 16 + adds r0, r6, 0 + adds r1, r5, 0 + bl dp01_prepare_buffer + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8034110 + + thumb_func_start dp01_build_cmdbuf_x21_a_bb +dp01_build_cmdbuf_x21_a_bb: @ 8034158 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + lsrs r2, 16 + ldr r1, =0x02022d10 + movs r3, 0x21 + strb r3, [r1] + strb r4, [r1, 0x1] + strb r2, [r1, 0x2] + lsrs r2, 8 + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x21_a_bb + + thumb_func_start dp01_build_cmdbuf_x22_a_three_bytes +dp01_build_cmdbuf_x22_a_three_bytes: @ 8034184 + push {r4,r5,lr} + adds r4, r2, 0 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, =0x02022d10 + movs r0, 0x22 + strb r0, [r2] + strb r1, [r2, 0x1] + movs r3, 0 + adds r1, r2, 0x2 +_08034198: + adds r0, r4, r3 + ldrb r0, [r0] + strb r0, [r1] + adds r1, 0x1 + adds r3, 0x1 + cmp r3, 0x2 + ble _08034198 + adds r0, r5, 0 + adds r1, r2, 0 + movs r2, 0x5 + bl dp01_prepare_buffer + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x22_a_three_bytes + + thumb_func_start dp01_build_cmdbuf_x23_aa_0 +dp01_build_cmdbuf_x23_aa_0: @ 80341BC + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + ldr r3, =0x02022d10 + movs r4, 0 + movs r2, 0x23 + strb r2, [r3] + strb r1, [r3, 0x1] + lsrs r1, 8 + strb r1, [r3, 0x2] + strb r4, [r3, 0x3] + adds r1, r3, 0 + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x23_aa_0 + + thumb_func_start dp01_build_cmdbuf_x24_aa_0 +dp01_build_cmdbuf_x24_aa_0: @ 80341E8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + ldr r3, =0x02022d10 + movs r4, 0 + movs r2, 0x24 + strb r2, [r3] + strb r1, [r3, 0x1] + lsrs r1, 8 + strb r1, [r3, 0x2] + strb r4, [r3, 0x3] + adds r1, r3, 0 + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x24_aa_0 + + thumb_func_start dp01_build_cmdbuf_x25_25_25_25 +dp01_build_cmdbuf_x25_25_25_25: @ 8034214 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x25 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x25_25_25_25 + + thumb_func_start dp01_build_cmdbuf_x26_a +dp01_build_cmdbuf_x26_a: @ 8034234 + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x26 + strb r2, [r1] + strb r3, [r1, 0x1] + movs r2, 0x2 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x26_a + + thumb_func_start dp01_build_cmdbuf_x27_27_27_27 +dp01_build_cmdbuf_x27_27_27_27: @ 8034254 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x27 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x27_27_27_27 + + thumb_func_start dp01_build_cmdbuf_x28_28_28_28 +dp01_build_cmdbuf_x28_28_28_28: @ 8034274 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x28 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x28_28_28_28 + + thumb_func_start dp01_build_cmdbuf_x29_29_29_29 +dp01_build_cmdbuf_x29_29_29_29: @ 8034294 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x29 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x29_29_29_29 + + thumb_func_start dp01_build_cmdbuf_x2A_2A_2A_2A +dp01_build_cmdbuf_x2A_2A_2A_2A: @ 80342B4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x2A + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x2A_2A_2A_2A + + thumb_func_start dp01_build_cmdbuf_x2B_aa_0 +dp01_build_cmdbuf_x2B_aa_0: @ 80342D4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + ldr r3, =0x02022d10 + movs r4, 0 + movs r2, 0x2B + strb r2, [r3] + strb r1, [r3, 0x1] + lsrs r1, 8 + strb r1, [r3, 0x2] + strb r4, [r3, 0x3] + adds r1, r3, 0 + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x2B_aa_0 + + thumb_func_start sub_8034300 +sub_8034300: @ 8034300 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + ldr r4, =0x02022d10 + movs r3, 0x2C + strb r3, [r4] + strb r1, [r4, 0x1] + lsrs r1, 8 + strb r1, [r4, 0x2] + strb r2, [r4, 0x3] + adds r1, r4, 0 + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8034300 + + thumb_func_start dp01_build_cmdbuf_x2D_2D_2D_2D +dp01_build_cmdbuf_x2D_2D_2D_2D: @ 803432C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x2D + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x2D_2D_2D_2D + + thumb_func_start dp01_build_cmdbuf_x2E_a +dp01_build_cmdbuf_x2E_a: @ 803434C + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x2E + strb r2, [r1] + strb r3, [r1, 0x1] + movs r2, 0x2 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x2E_a + + thumb_func_start dp01_build_cmdbuf_x2F_2F_2F_2F +dp01_build_cmdbuf_x2F_2F_2F_2F: @ 803436C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x2F + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x2F_2F_2F_2F + + thumb_func_start dp01_build_cmdbuf_x30_TODO +dp01_build_cmdbuf_x30_TODO: @ 803438C + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r1, =0x02022d10 + movs r3, 0x30 + strb r3, [r1] + movs r0, 0x7F + ands r0, r2 + strb r0, [r1, 0x1] + movs r0, 0x80 + ands r0, r2 + lsls r0, 24 + lsrs r0, 31 + strb r0, [r1, 0x2] + strb r3, [r1, 0x3] + movs r2, 0 + adds r3, r1, 0x4 +_080343B4: + adds r0, r4, r2 + ldrb r0, [r0] + strb r0, [r3] + adds r3, 0x1 + adds r2, 0x1 + cmp r2, 0x2F + ble _080343B4 + adds r0, r5, 0 + movs r2, 0x34 + bl dp01_prepare_buffer + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x30_TODO + + thumb_func_start dp01_build_cmdbuf_x31_31_31_31 +dp01_build_cmdbuf_x31_31_31_31: @ 80343D4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x31 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x31_31_31_31 + + thumb_func_start dp01_build_cmdbuf_x32_32_32_32 +dp01_build_cmdbuf_x32_32_32_32: @ 80343F4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x32 + strb r2, [r1] + strb r2, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x32_32_32_32 + + thumb_func_start dp01_build_cmdbuf_x33_a_33_33 +dp01_build_cmdbuf_x33_a_33_33: @ 8034414 + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x33 + strb r2, [r1] + strb r3, [r1, 0x1] + strb r2, [r1, 0x2] + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x33_a_33_33 + + thumb_func_start dp01_build_cmdbuf_x34_a_bb_aka_battle_anim +dp01_build_cmdbuf_x34_a_bb_aka_battle_anim: @ 8034438 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + lsrs r2, 16 + ldr r1, =0x02022d10 + movs r3, 0x34 + strb r3, [r1] + strb r4, [r1, 0x1] + strb r2, [r1, 0x2] + lsrs r2, 8 + strb r2, [r1, 0x3] + movs r2, 0x4 + bl dp01_prepare_buffer + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x34_a_bb_aka_battle_anim + + thumb_func_start sub_8034464 +sub_8034464: @ 8034464 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r4, =0x02022d10 + movs r0, 0x35 + strb r0, [r4] + strb r1, [r4, 0x1] + cmp r2, 0 + beq _0803448C + adds r0, r4, 0x4 + bl sub_81850DC + strb r0, [r4, 0x2] + strb r0, [r4, 0x3] + b _08034490 + .pool +_0803448C: + strb r2, [r4, 0x2] + strb r2, [r4, 0x3] +_08034490: + ldr r1, =0x02022d10 + ldrb r2, [r1, 0x2] + adds r2, 0x4 + adds r0, r5, 0 + bl dp01_prepare_buffer + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8034464 + + thumb_func_start dp01_build_cmdbuf_x38_a +dp01_build_cmdbuf_x38_a: @ 80344A8 + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02022d10 + movs r2, 0x36 + strb r2, [r1] + strb r3, [r1, 0x1] + movs r2, 0x2 + bl dp01_prepare_buffer + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x38_a + + thumb_func_start dp01_build_cmdbuf_x37_a +dp01_build_cmdbuf_x37_a: @ 80344C8 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r4, =0x02022d10 + movs r0, 0x37 + strb r0, [r4] + strb r1, [r4, 0x1] + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 28 + lsrs r0, 31 + strb r0, [r4, 0x2] + ldrb r0, [r1] + lsls r0, 28 + lsrs r0, 31 + strb r0, [r4, 0x3] + adds r0, r4, 0x6 + bl sub_81850DC + strb r0, [r4, 0x4] + strb r0, [r4, 0x5] + ldrb r2, [r4, 0x4] + adds r2, 0x6 + adds r0, r5, 0 + adds r1, r4, 0 + bl dp01_prepare_buffer + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_build_cmdbuf_x37_a + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom4.s b/asm/rom4.s new file mode 100644 index 000000000..0d45f0765 --- /dev/null +++ b/asm/rom4.s @@ -0,0 +1,6825 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8084620 +sub_8084620: @ 8084620 + push {r4,lr} + ldr r0, =gUnknown_08271857 + bl script_env_2_execute_new_script + ldr r0, =0x03005d8c + ldr r4, [r0] + movs r0, 0x92 + lsls r0, 3 + adds r4, r0 + adds r0, r4, 0 + bl DecryptMoney + adds r1, r0, 0 + lsrs r1, 1 + adds r0, r4, 0 + bl EncryptMoney + bl sp000_heal_pokemon + bl sub_8084720 + bl copy_saved_warp3_bank_and_enter_x_to_warp1 + bl warp_in + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084620 + + thumb_func_start flag_var_implications_of_teleport_ +flag_var_implications_of_teleport_: @ 8084660 + push {lr} + bl player_avatar_init_params_reset + ldr r0, =0x0000088b + bl FlagReset + ldr r0, =0x0000088d + bl FlagReset + ldr r0, =0x0000088c + bl FlagReset + ldr r0, =0x00000889 + bl FlagReset + ldr r0, =0x00000888 + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end flag_var_implications_of_teleport_ + + thumb_func_start sub_808469C +sub_808469C: @ 808469C + push {lr} + bl player_avatar_init_params_reset + ldr r0, =0x0000088b + bl FlagReset + ldr r0, =0x0000088d + bl FlagReset + ldr r0, =0x0000088c + bl FlagReset + ldr r0, =0x00000889 + bl FlagReset + ldr r0, =0x00000888 + bl FlagReset + ldr r0, =gUnknown_08271862 + bl script_env_2_execute_new_script + pop {r0} + bx r0 + .pool + thumb_func_end sub_808469C + + thumb_func_start flagmods_08054D70 +flagmods_08054D70: @ 80846E4 + push {lr} + bl player_avatar_init_params_reset + ldr r0, =0x0000088b + bl FlagReset + ldr r0, =0x0000088d + bl FlagReset + ldr r0, =0x0000088c + bl FlagReset + ldr r0, =0x00000889 + bl FlagReset + ldr r0, =0x00000888 + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end flagmods_08054D70 + + thumb_func_start sub_8084720 +sub_8084720: @ 8084720 + push {r4,lr} + bl player_avatar_init_params_reset + ldr r0, =0x0000088b + bl FlagReset + ldr r0, =0x0000088d + bl FlagReset + ldr r0, =0x0000088c + bl FlagReset + ldr r0, =0x00000889 + bl FlagReset + ldr r0, =0x00000888 + bl FlagReset + ldr r4, =0x00004039 + adds r0, r4, 0 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _08084764 + adds r0, r4, 0 + movs r1, 0 + bl VarSet + ldr r0, =0x00004037 + movs r1, 0 + bl VarSet +_08084764: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084720 + + thumb_func_start sub_8084788 +sub_8084788: @ 8084788 + push {lr} + ldr r0, =0x0000088c + bl FlagReset + bl sub_8085B2C + bl wild_pokemon_reroll + bl mapnumbers_history_shift_sav1_0_2_4_out + bl sub_8161D00 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084788 + + thumb_func_start sub_80847A8 +sub_80847A8: @ 80847A8 + push {r4,lr} + movs r4, 0 +_080847AC: + lsls r0, r4, 24 + lsrs r0, 24 + movs r1, 0 + bl sav12_xor_set + adds r4, 0x1 + cmp r4, 0x3F + ble _080847AC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80847A8 + + thumb_func_start sav12_xor_increment +@ void sav12_xor_increment(u8 a1) +sav12_xor_increment: @ 80847C4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x33 + bhi _080847EC + adds r0, r4, 0 + bl sub_80847F8 + adds r1, r0, 0 + ldr r0, =0x00fffffe + cmp r1, r0 + bhi _080847E4 + adds r1, 0x1 + b _080847E6 + .pool +_080847E4: + ldr r1, =0x00ffffff +_080847E6: + adds r0, r4, 0 + bl sav12_xor_set +_080847EC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sav12_xor_increment + + thumb_func_start sub_80847F8 +sub_80847F8: @ 80847F8 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x33 + bhi _08084828 + ldr r0, =0x03005d8c + ldr r2, [r0] + lsls r0, r1, 2 + ldr r1, =0x0000159c + adds r2, r1 + adds r2, r0 + ldr r0, =0x03005d90 + ldr r1, [r0] + adds r1, 0xAC + ldr r0, [r2] + ldr r1, [r1] + eors r0, r1 + b _0808482A + .pool +_08084828: + movs r0, 0 +_0808482A: + pop {r1} + bx r1 + thumb_func_end sub_80847F8 + + thumb_func_start sav12_xor_set +sav12_xor_set: @ 8084830 + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x33 + bhi _08084854 + ldr r0, =0x03005d8c + ldr r1, [r0] + lsls r0, r2, 2 + ldr r2, =0x0000159c + adds r1, r2 + adds r1, r0 + ldr r0, =0x03005d90 + ldr r0, [r0] + adds r0, 0xAC + ldr r0, [r0] + eors r0, r3 + str r0, [r1] +_08084854: + pop {r0} + bx r0 + .pool + thumb_func_end sav12_xor_set + + thumb_func_start sub_8084864 +sub_8084864: @ 8084864 + push {r4-r6,lr} + adds r5, r0, 0 + movs r4, 0 + ldr r6, =0x03005d8c +_0808486C: + lsls r1, r4, 2 + ldr r0, =0x0000159c + adds r1, r0 + ldr r0, [r6] + adds r0, r1 + adds r1, r5, 0 + bl apply_u32_xor_crypto + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3F + bls _0808486C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084864 + + thumb_func_start CopyFieldObjectTemplatesToSav1 +@ void CopyFieldObjectTemplatesToSav1() +CopyFieldObjectTemplatesToSav1: @ 8084894 + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + ldr r5, =0x03005d8c + ldr r1, [r5] + movs r4, 0xC7 + lsls r4, 4 + adds r1, r4 + ldr r2, =0x05000180 + mov r0, sp + bl CpuSet + ldr r0, =0x02037318 + ldr r2, [r0, 0x4] + ldr r0, [r2, 0x4] + ldr r1, [r5] + adds r1, r4 + ldrb r3, [r2] + lsls r2, r3, 1 + adds r2, r3 + lsls r2, 1 + movs r3, 0x80 + lsls r3, 19 + orrs r2, r3 + bl CpuSet + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end CopyFieldObjectTemplatesToSav1 + + thumb_func_start CopyFieldObjectTemplateCoordsToSav1 +@ void CopyFieldObjectTemplateCoordsToSav1() +CopyFieldObjectTemplateCoordsToSav1: @ 80848E0 + push {lr} + ldr r0, =0x02037318 + ldr r1, [r0, 0x4] + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, [r1, 0x4] + movs r3, 0xC7 + lsls r3, 4 + adds r1, r0, r3 + movs r3, 0x3F +_080848F4: + ldr r0, [r2, 0x10] + str r0, [r1, 0x10] + adds r2, 0x18 + adds r1, 0x18 + subs r3, 0x1 + cmp r3, 0 + bge _080848F4 + pop {r0} + bx r0 + .pool + thumb_func_end CopyFieldObjectTemplateCoordsToSav1 + + thumb_func_start update_saveblock1_field_object_coords +update_saveblock1_field_object_coords: @ 8084910 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 16 + lsrs r2, 16 + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0 + movs r6, 0xC7 + lsls r6, 4 + adds r3, r0, r6 +_0808492A: + ldrb r0, [r3] + cmp r0, r5 + bne _0808493C + strh r4, [r3, 0x4] + strh r2, [r3, 0x6] + b _08084944 + .pool +_0808493C: + adds r3, 0x18 + adds r1, 0x1 + cmp r1, 0x3F + ble _0808492A +_08084944: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end update_saveblock1_field_object_coords + + thumb_func_start update_saveblock1_field_object_movement_behavior +update_saveblock1_field_object_movement_behavior: @ 808494C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r3, 0 + movs r5, 0xC7 + lsls r5, 4 + adds r2, r0, r5 +_08084962: + ldrb r0, [r2] + cmp r0, r4 + bne _08084970 + strb r1, [r2, 0x9] + b _08084978 + .pool +_08084970: + adds r2, 0x18 + adds r3, 0x1 + cmp r3, 0x3F + ble _08084962 +_08084978: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end update_saveblock1_field_object_movement_behavior + + thumb_func_start mapdata_load_assets_to_gpu_and_full_redraw +mapdata_load_assets_to_gpu_and_full_redraw: @ 8084980 + push {r4,lr} + bl move_tilemap_camera_to_upper_left_corner + ldr r4, =0x02037318 + ldr r0, [r4] + bl copy_map_tileset1_tileset2_to_vram + ldr r0, [r4] + bl apply_map_tileset1_tileset2_palette + bl DrawWholeMapView + bl cur_mapheader_run_tileset_funcs_after_some_cpuset + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end mapdata_load_assets_to_gpu_and_full_redraw + + thumb_func_start get_mapdata_header +@ mapdata_header *get_mapdata_header() +get_mapdata_header: @ 80849A8 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x32] + cmp r1, 0 + bne _080849BC + movs r0, 0 + b _080849C6 + .pool +_080849BC: + ldr r0, =gUnknown_08481DD4 + subs r1, 0x1 + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] +_080849C6: + pop {r1} + bx r1 + .pool + thumb_func_end get_mapdata_header + + thumb_func_start warp_shift +@ void warp_shift() +warp_shift: @ 80849D0 + ldr r3, =0x020322dc + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r0, [r2, 0x4] + ldr r1, [r2, 0x8] + str r0, [r3] + str r1, [r3, 0x4] + ldr r0, =0x020322e4 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2, 0x4] + str r1, [r2, 0x8] + ldr r2, =0x020322ec + ldr r0, =gUnknown_08339D3C + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + ldr r2, =0x020322f4 + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .pool + thumb_func_end warp_shift + + thumb_func_start set_warp2_warp3_to_neg_1 +@ void set_warp2_warp3_to_neg_1() +set_warp2_warp3_to_neg_1: @ 8084A14 + ldr r2, =0x020322ec + ldr r0, =gUnknown_08339D3C + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + ldr r2, =0x020322f4 + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .pool + thumb_func_end set_warp2_warp3_to_neg_1 + + thumb_func_start warp_set +@ void warp_set(warpdata *warp, char bank, char map, char warpid, char enter_x, char enter_y) +warp_set: @ 8084A34 + push {r4,r5,lr} + ldr r4, [sp, 0xC] + ldr r5, [sp, 0x10] + strb r1, [r0] + strb r2, [r0, 0x1] + strb r3, [r0, 0x2] + lsls r4, 24 + asrs r4, 24 + strh r4, [r0, 0x4] + lsls r5, 24 + asrs r5, 24 + strh r5, [r0, 0x6] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end warp_set + + thumb_func_start warp_data_is_not_neg_1 +@ int warp_data_is_not_neg_1(warpdata *warp) +warp_data_is_not_neg_1: @ 8084A54 + push {lr} + adds r1, r0, 0 + movs r2, 0 + ldrsb r2, [r1, r2] + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + bne _08084A88 + movs r0, 0x1 + ldrsb r0, [r1, r0] + cmp r0, r2 + bne _08084A88 + movs r2, 0x2 + ldrsb r2, [r1, r2] + cmp r2, r0 + bne _08084A88 + movs r0, 0x4 + ldrsh r3, [r1, r0] + cmp r3, r2 + bne _08084A88 + movs r2, 0x6 + ldrsh r0, [r1, r2] + cmp r0, r3 + bne _08084A88 + movs r0, 0x1 + b _08084A8A +_08084A88: + movs r0, 0 +_08084A8A: + pop {r1} + bx r1 + thumb_func_end warp_data_is_not_neg_1 + + thumb_func_start get_mapheader_by_bank_and_number +@ struct mapheader *get_mapheader_by_bank_and_number(unsigned int bank, unsigned int num) +get_mapheader_by_bank_and_number: @ 8084A90 + lsls r0, 16 + lsls r1, 16 + ldr r2, =gUnknown_08486578 + lsrs r0, 14 + adds r0, r2 + ldr r0, [r0] + lsrs r1, 14 + adds r1, r0 + ldr r0, [r1] + bx lr + .pool + thumb_func_end get_mapheader_by_bank_and_number + + thumb_func_start warp1_get_mapheader +@ struct mapheader *warp1_get_mapheader() +warp1_get_mapheader: @ 8084AA8 + push {lr} + ldr r1, =0x020322e4 + movs r0, 0 + ldrsb r0, [r1, r0] + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x1] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + pop {r1} + bx r1 + .pool + thumb_func_end warp1_get_mapheader + + thumb_func_start set_current_map_header_from_sav1_save_old_name +@ void set_current_map_header_from_sav1_save_old_name() +set_current_map_header_from_sav1_save_old_name: @ 8084ACC + push {r4-r6,lr} + ldr r1, =0x020322fc + ldr r4, =0x02037318 + ldrb r0, [r4, 0x14] + strh r0, [r1] + ldr r5, =0x03005d8c + ldr r1, [r5] + movs r0, 0x4 + ldrsb r0, [r1, r0] + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x5] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + adds r1, r4, 0 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldr r0, [r0] + str r0, [r1] + ldr r1, [r5] + ldrh r0, [r4, 0x12] + strh r0, [r1, 0x32] + bl get_mapdata_header + str r0, [r4] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end set_current_map_header_from_sav1_save_old_name + + thumb_func_start set_current_map_header_from_sav1 +set_current_map_header_from_sav1: @ 8084B1C + push {r4,r5,lr} + ldr r4, =0x02037318 + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r0, 0x4 + ldrsb r0, [r1, r0] + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x5] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + adds r1, r4, 0 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldr r0, [r0] + str r0, [r1] + bl get_mapdata_header + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end set_current_map_header_from_sav1 + + thumb_func_start update_camera_pos_from_warpid +@ void update_camera_pos_from_warpid() +update_camera_pos_from_warpid: @ 8084B5C + push {r4,r5,lr} + ldr r0, =0x03005d8c + ldr r2, [r0] + movs r1, 0x6 + ldrsb r1, [r2, r1] + adds r4, r0, 0 + cmp r1, 0 + blt _08084B94 + ldr r3, =0x02037318 + ldr r0, [r3, 0x4] + ldrb r5, [r0, 0x1] + cmp r1, r5 + bge _08084B94 + ldr r0, [r0, 0x8] + lsls r1, 3 + adds r0, r1, r0 + ldrh r0, [r0] + strh r0, [r2] + ldr r0, [r3, 0x4] + ldr r0, [r0, 0x8] + adds r1, r0 + ldrh r0, [r1, 0x2] + strh r0, [r2, 0x2] + b _08084BCC + .pool +_08084B94: + ldr r1, [r4] + ldrh r3, [r1, 0x8] + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + blt _08084BB0 + ldrh r2, [r1, 0xA] + movs r5, 0xA + ldrsh r0, [r1, r5] + cmp r0, 0 + blt _08084BB0 + strh r3, [r1] + strh r2, [r1, 0x2] + b _08084BCC +_08084BB0: + ldr r3, [r4] + ldr r2, =0x02037318 + ldr r0, [r2] + ldr r0, [r0] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r3] + ldr r0, [r2] + ldr r0, [r0, 0x4] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r3, 0x2] +_08084BCC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end update_camera_pos_from_warpid + + thumb_func_start warp_in +warp_in: @ 8084BD8 + push {lr} + bl warp_shift + bl set_current_map_header_from_sav1_save_old_name + bl update_camera_pos_from_warpid + pop {r0} + bx r0 + thumb_func_end warp_in + + thumb_func_start warp1_set +@ void warp1_set(char bank, char map, char warpid, char enter_x, char enter_y) +warp1_set: @ 8084BEC + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + ldr r1, [sp, 0x18] + ldr r0, =0x020322e4 + lsls r4, 24 + asrs r4, 24 + lsls r5, 24 + asrs r5, 24 + lsls r6, 24 + asrs r6, 24 + lsls r3, 24 + asrs r3, 24 + str r3, [sp] + lsls r1, 24 + asrs r1, 24 + str r1, [sp, 0x4] + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl warp_set + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end warp1_set + + thumb_func_start warp1_set_2 +@ void warp1_set_2(char bank, char map, char warpid) +warp1_set_2: @ 8084C28 + push {lr} + sub sp, 0x4 + lsls r0, 24 + asrs r0, 24 + lsls r1, 24 + asrs r1, 24 + lsls r2, 24 + asrs r2, 24 + movs r3, 0x1 + negs r3, r3 + str r3, [sp] + bl warp1_set + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end warp1_set_2 + + thumb_func_start saved_warp2_set +@ void saved_warp2_set(char bank, char map, char warpid) +saved_warp2_set: @ 8084C48 + push {r4,r5,lr} + sub sp, 0x8 + ldr r0, =0x03005d8c + ldr r5, [r0] + adds r0, r5, 0 + adds r0, 0x14 + lsls r1, 24 + asrs r1, 24 + lsls r2, 24 + asrs r2, 24 + lsls r3, 24 + asrs r3, 24 + movs r4, 0 + ldrsb r4, [r5, r4] + str r4, [sp] + movs r4, 0x2 + ldrsb r4, [r5, r4] + str r4, [sp, 0x4] + bl warp_set + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end saved_warp2_set + + thumb_func_start saved_warp2_set_2 +saved_warp2_set_2: @ 8084C7C + push {r4,r5,lr} + sub sp, 0x8 + ldr r4, [sp, 0x14] + ldr r5, [sp, 0x18] + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r0, 0x14 + lsls r1, 24 + asrs r1, 24 + lsls r2, 24 + asrs r2, 24 + lsls r3, 24 + asrs r3, 24 + lsls r4, 24 + asrs r4, 24 + str r4, [sp] + lsls r5, 24 + asrs r5, 24 + str r5, [sp, 0x4] + bl warp_set + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end saved_warp2_set_2 + + thumb_func_start copy_saved_warp2_bank_and_enter_x_to_warp1 +copy_saved_warp2_bank_and_enter_x_to_warp1: @ 8084CB4 + ldr r2, =0x020322e4 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, [r0, 0x18] + ldr r0, [r0, 0x14] + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .pool + thumb_func_end copy_saved_warp2_bank_and_enter_x_to_warp1 + + thumb_func_start sub_8084CCC +@ void sub_8084CCC(int a1) +sub_8084CCC: @ 8084CCC + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + bl sub_8122CBC + adds r4, r0, 0 + cmp r4, 0 + beq _08084CFA + movs r0, 0 + ldrsb r0, [r4, r0] + movs r1, 0x1 + ldrsb r1, [r4, r1] + movs r2, 0x1 + negs r2, r2 + movs r3, 0x2 + ldrsb r3, [r4, r3] + ldrb r4, [r4, 0x4] + lsls r4, 24 + asrs r4, 24 + str r4, [sp] + bl warp1_set +_08084CFA: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8084CCC + + thumb_func_start copy_saved_warp3_bank_and_enter_x_to_warp1 +@ void copy_saved_warp3_bank_and_enter_x_to_warp1() +copy_saved_warp3_bank_and_enter_x_to_warp1: @ 8084D04 + ldr r2, =0x020322e4 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, [r0, 0x20] + ldr r0, [r0, 0x1C] + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .pool + thumb_func_end copy_saved_warp3_bank_and_enter_x_to_warp1 + + thumb_func_start sub_8084D1C +sub_8084D1C: @ 8084D1C + push {r4,r5,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + bl sub_8122CBC + adds r5, r0, 0 + cmp r5, 0 + beq _08084D50 + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r0, 0x1C + movs r1, 0 + ldrsb r1, [r5, r1] + movs r2, 0x1 + ldrsb r2, [r5, r2] + movs r3, 0x1 + negs r3, r3 + movs r4, 0x2 + ldrsb r4, [r5, r4] + str r4, [sp] + movs r4, 0x4 + ldrsb r4, [r5, r4] + str r4, [sp, 0x4] + bl warp_set +_08084D50: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084D1C + + thumb_func_start sub_8084D5C +sub_8084D5C: @ 8084D5C + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 16 + lsrs r7, r1, 16 + bl sav1_map_get_light_level + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =0x020322e4 + movs r0, 0 + ldrsb r0, [r1, r0] + ldrb r1, [r1, 0x1] + lsls r1, 24 + asrs r1, 24 + bl get_map_light_level_by_bank_and_number + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + bl is_light_level_1_2_3_5_or_6 + lsls r0, 24 + cmp r0, 0 + beq _08084DC4 + adds r0, r5, 0 + bl is_light_level_1_2_3_5_or_6 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08084DC4 + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r0, 0x4 + ldrsb r0, [r1, r0] + ldrb r1, [r1, 0x5] + lsls r1, 24 + asrs r1, 24 + movs r2, 0x1 + negs r2, r2 + subs r3, r6, 0x7 + lsls r3, 24 + asrs r3, 24 + subs r4, r7, 0x6 + lsls r4, 24 + asrs r4, 24 + str r4, [sp] + bl sub_8084DD4 +_08084DC4: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084D5C + + thumb_func_start sub_8084DD4 +sub_8084DD4: @ 8084DD4 + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + ldr r1, [sp, 0x18] + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r0, 0x24 + lsls r4, 24 + asrs r4, 24 + lsls r5, 24 + asrs r5, 24 + lsls r6, 24 + asrs r6, 24 + lsls r3, 24 + asrs r3, 24 + str r3, [sp] + lsls r1, 24 + asrs r1, 24 + str r1, [sp, 0x4] + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl warp_set + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084DD4 + + thumb_func_start sub_8084E14 +sub_8084E14: @ 8084E14 + ldr r2, =0x020322e4 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, [r0, 0x28] + ldr r0, [r0, 0x24] + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .pool + thumb_func_end sub_8084E14 + + thumb_func_start sub_8084E2C +sub_8084E2C: @ 8084E2C + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + ldr r1, [sp, 0x18] + ldr r0, =0x020322ec + lsls r4, 24 + asrs r4, 24 + lsls r5, 24 + asrs r5, 24 + lsls r6, 24 + asrs r6, 24 + lsls r3, 24 + asrs r3, 24 + str r3, [sp] + lsls r1, 24 + asrs r1, 24 + str r1, [sp, 0x4] + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl warp_set + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084E2C + + thumb_func_start warp1_set_to_warp2 +warp1_set_to_warp2: @ 8084E68 + ldr r2, =0x020322e4 + ldr r0, =0x020322ec + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .pool + thumb_func_end warp1_set_to_warp2 + + thumb_func_start sub_8084E80 +sub_8084E80: @ 8084E80 + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + ldr r1, [sp, 0x18] + ldr r0, =0x020322f4 + lsls r4, 24 + asrs r4, 24 + lsls r5, 24 + asrs r5, 24 + lsls r6, 24 + asrs r6, 24 + lsls r3, 24 + asrs r3, 24 + str r3, [sp] + lsls r1, 24 + asrs r1, 24 + str r1, [sp, 0x4] + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl warp_set + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084E80 + + thumb_func_start sub_8084EBC +sub_8084EBC: @ 8084EBC + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + ldr r4, =0x020322f4 + adds r0, r4, 0 + bl warp_data_is_not_neg_1 + cmp r0, 0x1 + bne _08084EF0 + ldr r2, =0x020322e4 + ldr r0, =0x020322dc + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + b _08084F0A + .pool +_08084EF0: + movs r0, 0 + ldrsb r0, [r4, r0] + movs r1, 0x1 + ldrsb r1, [r4, r1] + movs r2, 0x1 + negs r2, r2 + lsls r3, r5, 24 + asrs r3, 24 + lsls r4, r6, 24 + asrs r4, 24 + str r4, [sp] + bl warp1_set +_08084F0A: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8084EBC + + thumb_func_start warp1_set_to_sav1w +warp1_set_to_sav1w: @ 8084F14 + ldr r2, =0x020322e4 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, [r0, 0x10] + ldr r0, [r0, 0xC] + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .pool + thumb_func_end warp1_set_to_sav1w + + thumb_func_start sub_8084F2C +sub_8084F2C: @ 8084F2C + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + ldr r1, [sp, 0x18] + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r0, 0xC + lsls r4, 24 + asrs r4, 24 + lsls r5, 24 + asrs r5, 24 + lsls r6, 24 + asrs r6, 24 + lsls r3, 24 + asrs r3, 24 + str r3, [sp] + lsls r1, 24 + asrs r1, 24 + str r1, [sp, 0x4] + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl warp_set + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084F2C + + thumb_func_start sub_8084F6C +sub_8084F6C: @ 8084F6C + push {r4,r5,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + bl sub_8122CBC + adds r5, r0, 0 + cmp r5, 0 + beq _08084FA0 + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r0, 0xC + movs r1, 0 + ldrsb r1, [r5, r1] + movs r2, 0x1 + ldrsb r2, [r5, r2] + movs r3, 0x1 + negs r3, r3 + movs r4, 0x2 + ldrsb r4, [r5, r4] + str r4, [sp] + movs r4, 0x4 + ldrsb r4, [r5, r4] + str r4, [sp, 0x4] + bl warp_set +_08084FA0: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8084F6C + + thumb_func_start sub_8084FAC +sub_8084FAC: @ 8084FAC + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r0, [r2, 0x14] + ldr r1, [r2, 0x18] + str r0, [r2, 0xC] + str r1, [r2, 0x10] + bx lr + .pool + thumb_func_end sub_8084FAC + + thumb_func_start sub_8084FC0 +sub_8084FC0: @ 8084FC0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037318 + ldr r0, [r0, 0xC] + ldr r3, [r0] + ldr r1, [r0, 0x4] + cmp r1, 0 + bne _08084FDC + b _08084FF0 + .pool +_08084FD8: + adds r0, r1, 0 + b _08084FF2 +_08084FDC: + movs r2, 0 + cmp r2, r3 + bge _08084FF0 +_08084FE2: + ldrb r0, [r1] + cmp r0, r4 + beq _08084FD8 + adds r2, 0x1 + adds r1, 0xC + cmp r2, r3 + blt _08084FE2 +_08084FF0: + movs r0, 0 +_08084FF2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8084FC0 + + thumb_func_start sub_8084FF8 +sub_8084FF8: @ 8084FF8 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 16 + lsrs r5, r2, 16 + bl sub_8084FC0 + adds r1, r0, 0 + cmp r1, 0 + beq _08085030 + movs r0, 0x8 + ldrsb r0, [r1, r0] + ldrb r1, [r1, 0x9] + lsls r1, 24 + asrs r1, 24 + movs r2, 0x1 + negs r2, r2 + lsls r3, r4, 24 + asrs r3, 24 + lsls r4, r5, 24 + asrs r4, 24 + str r4, [sp] + bl warp1_set + b _0808504C +_08085030: + bl mapheader_run_script_with_tag_x6 + ldr r0, =0x020322ec + bl warp_data_is_not_neg_1 + cmp r0, 0 + beq _08085048 + movs r0, 0 + b _0808504E + .pool +_08085048: + bl warp1_set_to_warp2 +_0808504C: + movs r0, 0x1 +_0808504E: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8084FF8 + + thumb_func_start sub_8085058 +sub_8085058: @ 8085058 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + lsls r3, 16 + lsrs r3, 16 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x6 + adds r1, r3, 0 + bl sub_8084FF8 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8085058 + + thumb_func_start sub_8085078 +sub_8085078: @ 8085078 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + lsls r3, 16 + lsrs r3, 16 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x5 + adds r1, r3, 0 + bl sub_8084FF8 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8085078 + + thumb_func_start mliX_load_map +mliX_load_map: @ 8085098 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r5, r1, 0 + lsls r0, r6, 24 + asrs r0, 24 + lsls r1, r5, 24 + asrs r1, 24 + movs r3, 0x1 + negs r3, r3 + str r3, [sp] + adds r2, r3, 0 + bl warp1_set + ldr r4, =0x02037318 + ldrb r0, [r4, 0x14] + cmp r0, 0x3A + beq _080850C8 + bl sub_8085810 +_080850C8: + bl warp_shift + bl set_current_map_header_from_sav1_save_old_name + bl CopyFieldObjectTemplatesToSav1 + bl sav2_set_x9_depending_on_sav1_map + bl sub_809D344 + bl wild_pokemon_reroll + bl prev_quest_postbuffer_cursor_backup_reset + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80B21B4 + bl sub_809E7B0 + bl sub_80AEDBC + bl sub_8085B2C + bl update_sav1_flash_used_on_map + bl sav1_reset_battle_music_maybe + bl mapheader_run_script_with_tag_x3 + bl not_trainer_hill_battle_pyramid + ldr r0, [r4] + bl copy_map_tileset2_to_vram_2 + ldr r0, [r4] + bl apply_map_tileset2_palette + movs r4, 0x6 +_08085116: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80ABF00 + adds r4, 0x1 + cmp r4, 0xC + ble _08085116 + bl sub_80A0A2C + bl mapnumbers_history_shift_sav1_0_2_4_out + bl sub_8161D54 + bl sub_80AEE20 + bl wild_encounter_reset_coro_args + bl mapheader_run_script_with_tag_x5 + ldr r2, =0x02037318 + ldrb r0, [r2, 0x14] + cmp r0, 0x3A + bne _0808514C + ldr r1, =0x020322fc + ldrh r1, [r1] + cmp r0, r1 + beq _08085150 +_0808514C: + bl AddMapNamePopUpWindowTask +_08085150: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end mliX_load_map + + thumb_func_start mli0_load_map +mli0_load_map: @ 8085160 + push {r4-r7,lr} + adds r7, r0, 0 + bl set_current_map_header_from_sav1_save_old_name + ldr r0, =0x020322d8 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080851A2 + ldr r0, =0x02037318 + ldrh r1, [r0, 0x12] + ldr r0, =0x00000169 + cmp r1, r0 + bne _08085190 + bl sub_81AA1D8 + b _080851A2 + .pool +_08085190: + bl InTrainerHill + cmp r0, 0 + beq _0808519E + bl sub_81D5DF8 + b _080851A2 +_0808519E: + bl CopyFieldObjectTemplatesToSav1 +_080851A2: + ldr r4, =0x02037318 + ldrb r0, [r4, 0x17] + bl is_light_level_1_2_3_5_or_6 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r0, [r4, 0x17] + bl is_light_level_8_or_9 + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_80EB218 + bl sav2_set_x9_depending_on_sav1_map + bl sub_809D344 + bl wild_pokemon_reroll + bl prev_quest_postbuffer_cursor_backup_reset + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r0, 0x4 + ldrsb r0, [r1, r0] + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x5] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl sub_80B21B4 + cmp r7, 0x1 + beq _080851EE + bl sub_809E7B0 +_080851EE: + bl sub_80AEDBC + bl sub_8085B2C + cmp r5, 0 + beq _08085200 + ldr r0, =0x00000888 + bl FlagReset +_08085200: + bl update_sav1_flash_used_on_map + bl sav1_reset_battle_music_maybe + bl mapheader_run_script_with_tag_x3 + bl mapnumbers_history_shift_sav1_0_2_4_out + bl sub_8161D00 + ldrh r1, [r4, 0x12] + ldr r0, =0x00000169 + cmp r1, r0 + bne _08085234 + movs r0, 0 + bl battle_pyramid_map_load_related + b _08085246 + .pool +_08085234: + bl InTrainerHill + cmp r0, 0 + beq _08085242 + bl trainer_hill_map_load_related + b _08085246 +_08085242: + bl not_trainer_hill_battle_pyramid +_08085246: + cmp r7, 0x1 + beq _0808525E + cmp r6, 0 + beq _0808525E + ldr r1, =0x03005dc0 + ldr r0, [r1] + ldr r1, [r1, 0x4] + bl UpdateTVScreensOnMap + movs r0, 0x1 + bl sub_80E9238 +_0808525E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end mli0_load_map + + thumb_func_start player_avatar_init_params_reset +player_avatar_init_params_reset: @ 8085268 + ldr r1, =0x02032300 + movs r0, 0x1 + strb r0, [r1, 0x1] + strb r0, [r1] + bx lr + .pool + thumb_func_end player_avatar_init_params_reset + + thumb_func_start walkrun_find_lowest_active_bit_in_bitfield +walkrun_find_lowest_active_bit_in_bitfield: @ 8085278 + push {r4,lr} + bl player_get_direction_lower_nybble + ldr r4, =0x02032300 + strb r0, [r4, 0x1] + movs r0, 0x2 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _08085298 + movs r0, 0x2 + b _080852CA + .pool +_08085298: + movs r0, 0x4 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _080852A8 + movs r0, 0x4 + b _080852CA +_080852A8: + movs r0, 0x8 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _080852B8 + movs r0, 0x8 + b _080852CA +_080852B8: + movs r0, 0x10 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _080852C8 + movs r0, 0x10 + b _080852CA +_080852C8: + movs r0, 0x1 +_080852CA: + strb r0, [r4] + pop {r4} + pop {r0} + bx r0 + thumb_func_end walkrun_find_lowest_active_bit_in_bitfield + + thumb_func_start sub_80852D4 +sub_80852D4: @ 80852D4 + push {r4-r7,lr} + bl sav1_map_get_light_level + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + bl cur_mapdata_block_role_at_screen_center_acc_to_sav1 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r6, =0x02032300 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_808532C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =0xffffff00 + ands r7, r0 + orrs r7, r1 + adds r0, r6, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_808538C + lsls r0, 24 + lsrs r0, 16 + ldr r1, =0xffff00ff + ands r7, r1 + orrs r7, r0 + str r7, [r6] + adds r0, r6, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80852D4 + + thumb_func_start sub_808532C +sub_808532C: @ 808532C + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + lsls r2, 24 + lsrs r4, r2, 24 + cmp r4, 0x8 + beq _08085348 + ldr r0, =0x0000088d + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08085382 +_08085348: + cmp r4, 0x5 + bne _08085354 + movs r0, 0x10 + b _08085384 + .pool +_08085354: + lsls r0, r5, 24 + lsrs r0, 24 + bl MetatileBehavior_IsSurfableWaterOrUnderwater + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08085368 + movs r0, 0x8 + b _08085384 +_08085368: + bl sav1_map_is_biking_allowed + cmp r0, 0x1 + bne _08085382 + ldrb r0, [r6] + cmp r0, 0x2 + bne _0808537A + movs r0, 0x2 + b _08085384 +_0808537A: + cmp r0, 0x4 + bne _08085382 + movs r0, 0x4 + b _08085384 +_08085382: + movs r0, 0x1 +_08085384: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808532C + + thumb_func_start sub_808538C +sub_808538C: @ 808538C + push {r4-r7,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 16 + lsrs r4, r2, 16 + lsls r3, 24 + lsrs r5, r3, 24 + ldr r0, =0x0000088d + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _080853AC + cmp r5, 0x6 + beq _0808540C +_080853AC: + lsls r4, 24 + lsrs r5, r4, 24 + adds r0, r5, 0 + bl sub_8088F74 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080853E8 + adds r0, r5, 0 + bl sub_8088F58 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08085442 + adds r0, r5, 0 + bl sub_8088EFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08085442 + adds r0, r5, 0 + bl MetatileBehavior_IsSouthArrowWarp + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080853F0 +_080853E8: + movs r0, 0x2 + b _08085448 + .pool +_080853F0: + adds r0, r5, 0 + bl MetatileBehavior_IsNorthArrowWarp + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08085442 + adds r0, r5, 0 + bl MetatileBehavior_IsWestArrowWarp + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08085410 +_0808540C: + movs r0, 0x4 + b _08085448 +_08085410: + adds r0, r5, 0 + bl MetatileBehavior_IsEastArrowWarp + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08085422 + movs r0, 0x3 + b _08085448 +_08085422: + ldrb r0, [r6] + cmp r0, 0x10 + bne _0808542C + cmp r7, 0x8 + beq _08085446 +_0808542C: + cmp r0, 0x8 + bne _08085434 + cmp r7, 0x10 + beq _08085446 +_08085434: + lsrs r0, r4, 24 + bl MetatileBehavior_IsLadder + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08085446 +_08085442: + movs r0, 0x1 + b _08085448 +_08085446: + ldrb r0, [r6, 0x1] +_08085448: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808538C + + thumb_func_start cur_mapdata_block_role_at_screen_center_acc_to_sav1 +cur_mapdata_block_role_at_screen_center_acc_to_sav1: @ 8085450 + push {lr} + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r2, 0 + ldrsh r0, [r1, r2] + adds r0, 0x7 + movs r2, 0x2 + ldrsh r1, [r1, r2] + adds r1, 0x7 + bl MapGridGetMetatileBehaviorAt + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end cur_mapdata_block_role_at_screen_center_acc_to_sav1 + + thumb_func_start sav1_map_is_biking_allowed +sav1_map_is_biking_allowed: @ 8085474 + push {lr} + ldr r0, =0x02037318 + ldrb r1, [r0, 0x1A] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0808548C + movs r0, 0x1 + b _0808548E + .pool +_0808548C: + movs r0, 0 +_0808548E: + pop {r1} + bx r1 + thumb_func_end sav1_map_is_biking_allowed + + thumb_func_start update_sav1_flash_used_on_map +update_sav1_flash_used_on_map: @ 8085494 + push {lr} + ldr r0, =0x02037318 + ldrb r1, [r0, 0x15] + cmp r1, 0 + bne _080854B0 + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r0, 0x30 + strb r1, [r0] + b _080854DE + .pool +_080854B0: + ldr r0, =0x00000888 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _080854D0 + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r0, 0x30 + movs r1, 0x1 + strb r1, [r0] + b _080854DE + .pool +_080854D0: + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =gUnknown_0854FE78 + ldr r0, [r0] + subs r0, 0x1 + adds r1, 0x30 + strb r0, [r1] +_080854DE: + pop {r0} + bx r0 + .pool + thumb_func_end update_sav1_flash_used_on_map + + thumb_func_start sub_80854EC +sub_80854EC: @ 80854EC + push {lr} + adds r1, r0, 0 + cmp r1, 0 + blt _080854FC + ldr r0, =gUnknown_0854FE78 + ldr r0, [r0] + cmp r1, r0 + ble _080854FE +_080854FC: + movs r1, 0 +_080854FE: + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r0, 0x30 + strb r1, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80854EC + + thumb_func_start sav1_get_flash_used_on_map +sav1_get_flash_used_on_map: @ 8085514 + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r0, 0x30 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sav1_get_flash_used_on_map + + thumb_func_start sub_8085524 +sub_8085524: @ 8085524 + push {lr} + ldr r1, =0x03005d8c + ldr r1, [r1] + strh r0, [r1, 0x32] + bl get_mapdata_header + ldr r1, =0x02037318 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8085524 + + thumb_func_start sub_8085540 +sub_8085540: @ 8085540 + ldr r1, =0x020322d8 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_8085540 + + thumb_func_start sub_808554C +sub_808554C: @ 808554C + ldr r0, =0x020322d8 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_808554C + + thumb_func_start sub_8085558 +sub_8085558: @ 8085558 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0000088a + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _080855AC + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + bne _080855AC + movs r0, 0x1 + ldrsb r0, [r4, r0] + cmp r0, 0x5 + blt _08085584 + cmp r0, 0x8 + ble _0808559E + cmp r0, 0x2B + bgt _08085584 + cmp r0, 0x27 + bge _0808559E +_08085584: + ldr r0, =0x0000405e + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3 + bls _080855AC + movs r0, 0x1 + ldrsb r0, [r4, r0] + cmp r0, 0x2E + bgt _080855AC + cmp r0, 0x2C + blt _080855AC +_0808559E: + movs r0, 0x1 + b _080855AE + .pool +_080855AC: + movs r0, 0 +_080855AE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8085558 + + thumb_func_start sub_80855B4 +sub_80855B4: @ 80855B4 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x000040ca + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _080855D6 + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + bne _080855D6 + movs r0, 0x1 + ldrsb r0, [r4, r0] + cmp r0, 0x7 + beq _080855E0 +_080855D6: + movs r0, 0 + b _080855E2 + .pool +_080855E0: + movs r0, 0x1 +_080855E2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80855B4 + + thumb_func_start sub_80855E8 +sub_80855E8: @ 80855E8 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x000040b3 + bl VarGet + lsls r0, 16 + cmp r0, 0 + bne _08085606 + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x20 + bne _08085606 + ldrb r0, [r4, 0x1] + cmp r0, 0x1 + bls _08085610 +_08085606: + movs r0, 0 + b _08085612 + .pool +_08085610: + movs r0, 0x1 +_08085612: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80855E8 + + thumb_func_start sub_8085618 +sub_8085618: @ 8085618 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x0000405d + adds r0, r4, 0 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _0808564C + adds r0, r4, 0 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bhi _0808564C + movs r0, 0 + ldrsb r0, [r5, r0] + cmp r0, 0xE + bne _0808564C + ldrb r0, [r5, 0x1] + subs r0, 0x9 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _08085654 +_0808564C: + movs r0, 0 + b _08085656 + .pool +_08085654: + movs r0, 0x1 +_08085656: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8085618 + + thumb_func_start warp_target_get_music +warp_target_get_music: @ 808565C + push {r4,lr} + adds r4, r0, 0 + bl sub_80855B4 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _08085674 + ldr r0, =0x0000ffff + b _080856CE + .pool +_08085674: + adds r0, r4, 0 + bl sub_8085558 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _0808568C + ldr r0, =0x000001bb + b _080856CE + .pool +_0808568C: + adds r0, r4, 0 + bl sub_8085618 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _080856A4 + ldr r0, =0x000001b9 + b _080856CE + .pool +_080856A4: + adds r0, r4, 0 + bl sub_80855E8 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + beq _080856CA + movs r0, 0 + ldrsb r0, [r4, r0] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ldrsb r1, [r4, r1] + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + ldrh r0, [r0, 0x10] + b _080856CE +_080856CA: + movs r0, 0xCB + lsls r0, 1 +_080856CE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end warp_target_get_music + + thumb_func_start sav1_map_get_music +sav1_map_get_music: @ 80856D4 + push {r4,lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0xD0 + lsls r0, 5 + cmp r1, r0 + bne _080856FC + bl sav1_get_weather_probably + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8 + bne _080856FC + ldr r0, =0x00000199 + b _08085730 + .pool +_080856FC: + ldr r4, =0x03005d8c + ldr r0, [r4] + adds r0, 0x4 + bl warp_target_get_music + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =0x00007fff + cmp r1, r0 + beq _0808571C + adds r0, r1, 0 + b _08085730 + .pool +_0808571C: + ldr r0, [r4] + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x17 + ble _0808572C + movs r0, 0xC9 + lsls r0, 1 + b _08085730 +_0808572C: + movs r0, 0xB4 + lsls r0, 1 +_08085730: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sav1_map_get_music + + thumb_func_start warp1_target_get_music +warp1_target_get_music: @ 8085738 + push {lr} + ldr r0, =0x020322e4 + bl warp_target_get_music + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =0x00007fff + cmp r1, r0 + beq _08085758 + adds r0, r1, 0 + b _08085774 + .pool +_08085758: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0x80 + lsls r0, 2 + cmp r1, r0 + beq _08085770 + subs r0, 0x6E + b _08085774 + .pool +_08085770: + movs r0, 0xB4 + lsls r0, 1 +_08085774: + pop {r1} + bx r1 + thumb_func_end warp1_target_get_music + + thumb_func_start call_map_music_set_to_zero +call_map_music_set_to_zero: @ 8085778 + push {lr} + bl map_music_set_to_zero + pop {r0} + bx r0 + thumb_func_end call_map_music_set_to_zero + + thumb_func_start sub_8085784 +sub_8085784: @ 8085784 + push {r4,lr} + bl sav1_map_get_music + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x000001bb + cmp r4, r0 + beq _080857D6 + ldr r0, =0x0000ffff + cmp r4, r0 + beq _080857D6 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldrh r0, [r1, 0x2C] + cmp r0, 0 + beq _080857B4 + adds r4, r0, 0 + b _080857D6 + .pool +_080857B4: + bl sav1_map_get_light_level + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bne _080857C8 + ldr r4, =0x0000019b + b _080857D6 + .pool +_080857C8: + movs r0, 0x8 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _080857D6 + ldr r4, =0x0000016d +_080857D6: + bl current_map_music_get + lsls r0, 16 + lsrs r0, 16 + cmp r4, r0 + beq _080857E8 + adds r0, r4, 0 + bl current_map_music_set +_080857E8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8085784 + + thumb_func_start sav1_set_battle_music_maybe +sav1_set_battle_music_maybe: @ 80857F4 + ldr r1, =0x03005d8c + ldr r1, [r1] + strh r0, [r1, 0x2C] + bx lr + .pool + thumb_func_end sav1_set_battle_music_maybe + + thumb_func_start sav1_reset_battle_music_maybe +sav1_reset_battle_music_maybe: @ 8085800 + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r0, 0 + strh r0, [r1, 0x2C] + bx lr + .pool + thumb_func_end sav1_reset_battle_music_maybe + + thumb_func_start sub_8085810 +sub_8085810: @ 8085810 + push {r4-r6,lr} + ldr r0, =0x00004001 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08085890 + bl warp1_target_get_music + lsls r0, 16 + lsrs r4, r0, 16 + bl current_map_music_get + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =0x000001bb + cmp r4, r0 + beq _08085856 + ldr r0, =0x0000ffff + cmp r4, r0 + beq _08085856 + ldr r0, =0x0000019b + cmp r5, r0 + beq _08085890 + ldr r6, =0x0000016d + cmp r5, r6 + beq _08085890 + movs r0, 0x8 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _08085856 + adds r4, r6, 0 +_08085856: + cmp r4, r5 + beq _08085890 + movs r0, 0x6 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _08085888 + adds r0, r4, 0 + movs r1, 0x4 + movs r2, 0x4 + bl sub_80A2FBC + b _08085890 + .pool +_08085888: + adds r0, r4, 0 + movs r1, 0x8 + bl sub_80A2F88 +_08085890: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8085810 + + thumb_func_start sub_8085898 +sub_8085898: @ 8085898 + push {r4,lr} + bl current_map_music_get + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sav1_map_get_music + lsls r0, 16 + lsrs r0, 16 + cmp r4, r0 + beq _080858BE + bl sav1_map_get_music + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x8 + bl sub_80A2F88 +_080858BE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8085898 + + thumb_func_start sub_80858C4 +sub_80858C4: @ 80858C4 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + bl current_map_music_get + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r4 + beq _080858E4 + ldr r0, =0x000001bb + cmp r1, r0 + beq _080858E4 + adds r0, r4, 0 + movs r1, 0x8 + bl sub_80A2F88 +_080858E4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80858C4 + + thumb_func_start is_warp1_light_level_8_or_9 +is_warp1_light_level_8_or_9: @ 80858F0 + push {lr} + bl warp1_get_mapheader + ldrb r0, [r0, 0x17] + bl is_light_level_8_or_9 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08085908 + movs r0, 0x4 + b _0808590A +_08085908: + movs r0, 0x2 +_0808590A: + pop {r1} + bx r1 + thumb_func_end is_warp1_light_level_8_or_9 + + thumb_func_start music_something +music_something: @ 8085910 + push {r4,r5,lr} + bl current_map_music_get + lsls r0, 16 + lsrs r5, r0, 16 + bl warp1_target_get_music + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x00004001 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0808597E + bl current_map_music_get + lsls r0, 16 + lsrs r0, 16 + cmp r4, r0 + beq _0808597E + ldr r0, =0x0000016d + cmp r5, r0 + bne _08085972 + ldr r0, =0x000040ca + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bne _08085972 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x0000ffff + ldrh r2, [r0, 0x4] + movs r0, 0xE0 + lsls r0, 3 + cmp r2, r0 + bne _08085972 + ldr r3, =0x020322e4 + ldrh r0, [r3] + ands r1, r0 + cmp r1, r2 + bne _08085972 + ldr r1, [r3, 0x4] + ldr r0, =0x0035001d + cmp r1, r0 + beq _0808597E +_08085972: + bl is_warp1_light_level_8_or_9 + lsls r0, 24 + lsrs r0, 24 + bl sub_80A2F50 +_0808597E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end music_something + + thumb_func_start sub_80859A0 +sub_80859A0: @ 80859A0 + push {lr} + bl sub_80A303C + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80859A0 + + thumb_func_start sub_80859B0 +sub_80859B0: @ 80859B0 + push {lr} + movs r0, 0x4 + bl sub_80A2F50 + pop {r0} + bx r0 + thumb_func_end sub_80859B0 + + thumb_func_start sub_80859BC +sub_80859BC: @ 80859BC + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + ldr r0, =0x02032306 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080859F0 + 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_IsSurfableWaterOrUnderwater + lsls r0, 24 + cmp r0, 0 + beq _08085A2C +_080859F0: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x58 + bl __umodsi3 + adds r4, r0, 0 + adds r4, 0xD4 + lsls r4, 24 + lsrs r4, 24 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1E + bl __umodsi3 + adds r2, r0, 0 + adds r2, 0x32 + ldr r0, =0x02032304 + ldrh r0, [r0] + lsls r4, 24 + asrs r4, 24 + lsls r2, 24 + asrs r2, 24 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_80A32C0 +_08085A2C: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80859BC + + thumb_func_start wild_encounter_related +wild_encounter_related: @ 8085A3C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + adds r7, r1, 0 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0x4 + bhi _08085B20 + lsls r0, 2 + ldr r1, =_08085A60 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08085A60: + .4byte _08085A74 + .4byte _08085A88 + .4byte _08085AA4 + .4byte _08085B0C + .4byte _08085B20 +_08085A74: + ldr r0, =0x02032304 + ldrh r0, [r0] + cmp r0, 0 + bne _08085A84 + movs r0, 0x4 + b _08085B1E + .pool +_08085A84: + movs r0, 0x1 + b _08085B1E +_08085A88: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x96 + lsls r1, 4 + bl __umodsi3 + movs r1, 0x96 + lsls r1, 3 + adds r0, r1 + strh r0, [r7] + movs r0, 0x3 + b _08085B1E +_08085AA4: + movs r0, 0x1 + mov r9, r0 + bl calc_player_party_count + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + b _08085ABC +_08085AB6: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_08085ABC: + cmp r5, r8 + bcs _08085AE4 + movs r0, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _08085AB6 + adds r0, r4, 0 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x44 + bne _08085AB6 + movs r1, 0x2 + mov r9, r1 +_08085AE4: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r4, 0x96 + lsls r4, 3 + adds r1, r4, 0 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r0, r4 + mov r1, r9 + bl __divsi3 + strh r0, [r7] + movs r0, 0x3 + b _08085B1E + .pool +_08085B0C: + ldrh r0, [r7] + subs r0, 0x1 + strh r0, [r7] + lsls r0, 16 + cmp r0, 0 + bne _08085B20 + bl sub_80859BC + movs r0, 0x2 +_08085B1E: + strh r0, [r6] +_08085B20: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end wild_encounter_related + + thumb_func_start sub_8085B2C +sub_8085B2C: @ 8085B2C + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0xB4 + lsls r0, 6 + cmp r1, r0 + bne _08085B5C + bl sub_813793C + lsls r0, 24 + cmp r0, 0 + bne _08085B5C + ldr r1, =0x02032306 + movs r0, 0x1 + strb r0, [r1] + bl sub_80B582C + b _08085B62 + .pool +_08085B5C: + ldr r0, =0x02032306 + bl wild_pokemon_rand_for_map +_08085B62: + ldr r1, =0x02032304 + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8085B2C + + thumb_func_start get_map_light_level_by_bank_and_number +@ int get_map_light_level_by_bank_and_number(int bank, int number) +get_map_light_level_by_bank_and_number: @ 8085B74 + push {lr} + lsls r0, 24 + asrs r0, 8 + lsrs r0, 16 + lsls r1, 24 + asrs r1, 8 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + ldrb r0, [r0, 0x17] + pop {r1} + bx r1 + thumb_func_end get_map_light_level_by_bank_and_number + + thumb_func_start get_map_light_level_from_warp +@ int get_map_light_level_from_warp(warpdata *warp) +get_map_light_level_from_warp: @ 8085B8C + push {lr} + movs r2, 0 + ldrsb r2, [r0, r2] + movs r1, 0x1 + ldrsb r1, [r0, r1] + adds r0, r2, 0 + bl get_map_light_level_by_bank_and_number + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end get_map_light_level_from_warp + + thumb_func_start sav1_map_get_light_level +sav1_map_get_light_level: @ 8085BA4 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r0, 0x4 + bl get_map_light_level_from_warp + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sav1_map_get_light_level + + thumb_func_start get_map_light_from_warp0 +get_map_light_from_warp0: @ 8085BBC + push {lr} + ldr r0, =0x020322dc + bl get_map_light_level_from_warp + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end get_map_light_from_warp0 + + thumb_func_start is_light_level_1_2_3_5_or_6 +is_light_level_1_2_3_5_or_6: @ 8085BD0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _08085BEA + cmp r0, 0x1 + beq _08085BEA + cmp r0, 0x5 + beq _08085BEA + cmp r0, 0x2 + beq _08085BEA + cmp r0, 0x6 + bne _08085BEE +_08085BEA: + movs r0, 0x1 + b _08085BF0 +_08085BEE: + movs r0, 0 +_08085BF0: + pop {r1} + bx r1 + thumb_func_end is_light_level_1_2_3_5_or_6 + + thumb_func_start is_light_level_1_2_3_or_6 +is_light_level_1_2_3_or_6: @ 8085BF4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _08085C0A + cmp r0, 0x1 + beq _08085C0A + cmp r0, 0x6 + beq _08085C0A + cmp r0, 0x2 + bne _08085C0E +_08085C0A: + movs r0, 0x1 + b _08085C10 +_08085C0E: + movs r0, 0 +_08085C10: + pop {r1} + bx r1 + thumb_func_end is_light_level_1_2_3_or_6 + + thumb_func_start is_light_level_8_or_9 +is_light_level_8_or_9: @ 8085C14 + push {lr} + lsls r0, 24 + movs r1, 0xF8 + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _08085C28 + movs r0, 0 + b _08085C2A +_08085C28: + movs r0, 0x1 +_08085C2A: + pop {r1} + bx r1 + thumb_func_end is_light_level_8_or_9 + + thumb_func_start sav1_saved_warp2_map_get_name +sav1_saved_warp2_map_get_name: @ 8085C30 + push {lr} + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r0, 0x14 + ldrsb r0, [r1, r0] + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x15] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + ldrb r0, [r0, 0x14] + pop {r1} + bx r1 + .pool + thumb_func_end sav1_saved_warp2_map_get_name + + thumb_func_start sav1_map_get_name +sav1_map_get_name: @ 8085C58 + push {lr} + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r0, 0x4 + ldrsb r0, [r1, r0] + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x5] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + ldrb r0, [r0, 0x14] + pop {r1} + bx r1 + .pool + thumb_func_end sav1_map_get_name + + thumb_func_start sav1_map_get_battletype +sav1_map_get_battletype: @ 8085C80 + push {lr} + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r0, 0x4 + ldrsb r0, [r1, r0] + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x5] + lsls r1, 24 + asrs r1, 24 + lsls r1, 16 + lsrs r1, 16 + bl get_mapheader_by_bank_and_number + ldrb r0, [r0, 0x1B] + pop {r1} + bx r1 + .pool + thumb_func_end sav1_map_get_battletype + + thumb_func_start overworld_bg_setup +@ void overworld_bg_setup() +overworld_bg_setup: @ 8085CA8 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r1, =gUnknown_08339DAC + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + movs r0, 0x1 + movs r1, 0x5 + movs r2, 0x1 + bl SetBgAttribute + movs r0, 0x2 + movs r1, 0x5 + movs r2, 0x1 + bl SetBgAttribute + movs r0, 0x3 + movs r1, 0x5 + movs r2, 0x1 + bl SetBgAttribute + ldr r0, =0x03005da0 + mov r8, r0 + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl AllocZeroed + mov r1, r8 + str r0, [r1] + ldr r6, =0x03005d9c + adds r0, r4, 0 + bl AllocZeroed + str r0, [r6] + ldr r5, =0x03005da4 + adds r0, r4, 0 + bl AllocZeroed + str r0, [r5] + mov r0, r8 + ldr r1, [r0] + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r6] + movs r0, 0x2 + bl SetBgTilemapBuffer + ldr r1, [r5] + movs r0, 0x3 + bl SetBgTilemapBuffer + bl sub_81971D0 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end overworld_bg_setup + + thumb_func_start overworld_free_bg_tilemaps +overworld_free_bg_tilemaps: @ 8085D34 + push {r4,lr} + bl sub_81BE72C + bl sub_81971F4 + ldr r4, =0x03005da4 + ldr r0, [r4] + cmp r0, 0 + beq _08085D4E + bl Free + movs r0, 0 + str r0, [r4] +_08085D4E: + ldr r4, =0x03005d9c + ldr r0, [r4] + cmp r0, 0 + beq _08085D5E + bl Free + movs r0, 0 + str r0, [r4] +_08085D5E: + ldr r4, =0x03005da0 + ldr r0, [r4] + cmp r0, 0 + beq _08085D6E + bl Free + movs r0, 0 + str r0, [r4] +_08085D6E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end overworld_free_bg_tilemaps + + thumb_func_start ResetSafariZoneFlag_ +ResetSafariZoneFlag_: @ 8085D80 + push {lr} + bl ResetSafariZoneFlag + pop {r0} + bx r0 + thumb_func_end ResetSafariZoneFlag_ + + thumb_func_start is_c1_link_related_active +@ _BOOL4 is_c1_link_related_active() +is_c1_link_related_active: @ 8085D8C + push {lr} + ldr r0, =0x030022c0 + ldr r1, [r0] + ldr r0, =c1_link_related + cmp r1, r0 + beq _08085DA4 + movs r0, 0 + b _08085DA6 + .pool +_08085DA4: + movs r0, 0x1 +_08085DA6: + pop {r1} + bx r1 + thumb_func_end is_c1_link_related_active + + thumb_func_start c1_overworld_normal +@ void c1_overworld_normal(int buttons_new, int buttons_held) +c1_overworld_normal: @ 8085DAC + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r0, 16 + adds r5, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r4, r1, 0 + bl sub_808B578 + mov r6, sp + mov r0, sp + bl sub_809BEDC + mov r0, sp + adds r1, r5, 0 + adds r2, r4, 0 + bl process_overworld_input + bl script_env_2_is_enabled + lsls r0, 24 + cmp r0, 0 + bne _08085DFA + mov r0, sp + bl sub_809C014 + cmp r0, 0x1 + bne _08085DF0 + bl script_env_2_enable + bl HideMapNamePopUpWindow + b _08085DFA +_08085DF0: + ldrb r0, [r6, 0x2] + adds r1, r5, 0 + adds r2, r4, 0 + bl player_step +_08085DFA: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end c1_overworld_normal + + thumb_func_start c1_overworld +c1_overworld: @ 8085E04 + push {lr} + ldr r2, =0x030022c0 + ldr r1, [r2, 0x4] + ldr r0, =c2_overworld + cmp r1, r0 + bne _08085E18 + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x2C] + bl c1_overworld_normal +_08085E18: + pop {r0} + bx r0 + .pool + thumb_func_end c1_overworld + + thumb_func_start c2_overworld_basic +@ void c2_overworld_basic() +c2_overworld_basic: @ 8085E24 + push {lr} + bl script_env_2_run_current_script + bl RunTasks + bl CallObjectCallbacks + bl CameraUpdate + bl UpdateCameraPanning + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + bl sub_80A0A38 + bl do_scheduled_bg_tilemap_copies_to_vram + pop {r0} + bx r0 + thumb_func_end c2_overworld_basic + + thumb_func_start sub_8085E50 +sub_8085E50: @ 8085E50 + push {lr} + bl c2_overworld_basic + pop {r0} + bx r0 + thumb_func_end sub_8085E50 + + thumb_func_start c2_overworld +c2_overworld: @ 8085E5C + push {r4,lr} + ldr r0, =0x02037fd4 + ldrb r0, [r0, 0x7] + lsrs r0, 7 + adds r4, r0, 0 + cmp r4, 0 + beq _08085E70 + movs r0, 0 + bl SetVBlankCallback +_08085E70: + bl c2_overworld_basic + cmp r4, 0 + beq _08085E7C + bl SetFieldVBlankCallback +_08085E7C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end c2_overworld + + thumb_func_start set_callback1 +set_callback1: @ 8085E88 + ldr r1, =0x030022c0 + str r0, [r1] + bx lr + .pool + thumb_func_end set_callback1 + + thumb_func_start sub_8085E94 +sub_8085E94: @ 8085E94 + ldr r1, =0x03000e0c + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8085E94 + + thumb_func_start map_post_load_hook_exec +map_post_load_hook_exec: @ 8085EA0 + push {r4,lr} + ldr r4, =0x03005db0 + ldr r0, [r4] + cmp r0, 0 + beq _08085ECC + bl _call_via_r0 + lsls r0, 24 + cmp r0, 0 + bne _08085EBC + movs r0, 0 + b _08085EEC + .pool +_08085EBC: + movs r1, 0 + str r1, [r4] + ldr r0, =0x03005dac + str r1, [r0] + b _08085EEA + .pool +_08085ECC: + ldr r0, =0x03005dac + ldr r0, [r0] + cmp r0, 0 + beq _08085EE0 + bl _call_via_r0 + b _08085EE4 + .pool +_08085EE0: + bl mapldr_default +_08085EE4: + ldr r1, =0x03005dac + movs r0, 0 + str r0, [r1] +_08085EEA: + movs r0, 0x1 +_08085EEC: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end map_post_load_hook_exec + + thumb_func_start CB2_NewGame +CB2_NewGame: @ 8085EF8 + push {lr} + bl sub_808631C + bl sub_80A2F30 + bl ResetSafariZoneFlag_ + bl NewGameInitData + bl player_avatar_init_params_reset + bl set_max_playtime_if_appropriate + bl script_env_1_init + bl script_env_2_disable + ldr r1, =0x03005dac + ldr r0, =sub_80FB4E0 + str r0, [r1] + ldr r1, =0x03005db0 + movs r0, 0 + str r0, [r1] + ldr r0, =0x030026f8 + bl do_load_map_stuff_loop + bl SetFieldVBlankCallback + ldr r0, =c1_overworld + bl set_callback1 + ldr r0, =c2_overworld + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end CB2_NewGame + + thumb_func_start c2_whiteout +c2_whiteout: @ 8085F58 + push {lr} + sub sp, 0x4 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x77 + bls _08085FB0 + bl sub_808631C + bl sub_80A2F30 + bl ResetSafariZoneFlag_ + bl sub_8084620 + bl player_avatar_init_params_reset + bl script_env_1_init + bl script_env_2_disable + ldr r1, =0x03005dac + ldr r0, =sub_80AF3C8 + str r0, [r1] + mov r1, sp + movs r0, 0 + strb r0, [r1] + mov r0, sp + bl do_load_map_stuff_loop + bl SetFieldVBlankCallback + ldr r0, =c1_overworld + bl set_callback1 + ldr r0, =c2_overworld + bl SetMainCallback2 +_08085FB0: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end c2_whiteout + + thumb_func_start c2_load_new_map +c2_load_new_map: @ 8085FCC + push {lr} + bl sub_808631C + bl script_env_1_init + bl script_env_2_disable + movs r0, 0 + bl set_callback1 + ldr r0, =c2_change_map + bl SetMainCallback2 + ldr r1, =0x030022c0 + ldr r0, =c2_load_new_map_2 + str r0, [r1, 0x8] + pop {r0} + bx r0 + .pool + thumb_func_end c2_load_new_map + + thumb_func_start c2_load_new_map_2 +c2_load_new_map_2: @ 8085FFC + push {lr} + ldr r0, =0x030026f8 + bl do_load_map_stuff_loop + bl SetFieldVBlankCallback + ldr r0, =c1_overworld + bl set_callback1 + ldr r0, =c2_overworld + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end c2_load_new_map_2 + + thumb_func_start sub_8086024 +sub_8086024: @ 8086024 + push {r4,lr} + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0 + bne _08086046 + bl sub_808631C + bl script_env_1_init + bl script_env_2_disable + movs r0, 0 + bl set_callback1 +_08086046: + adds r0, r4, 0 + movs r1, 0x1 + bl load_map_stuff + cmp r0, 0 + beq _08086062 + bl SetFieldVBlankCallback + ldr r0, =c1_overworld + bl set_callback1 + ldr r0, =c2_overworld + bl SetMainCallback2 +_08086062: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086024 + + thumb_func_start sub_8086074 +sub_8086074: @ 8086074 + push {lr} + bl sub_808631C + ldr r0, =0x03005dac + ldr r1, =sub_80AF314 + str r1, [r0] + ldr r0, =c2_80567AC + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086074 + + thumb_func_start c2_80567AC +c2_80567AC: @ 8086098 + push {lr} + ldr r0, =0x030026f8 + bl map_loading_iteration_3 + cmp r0, 0 + beq _080860B8 + bl SetFieldVBlankCallback + ldr r0, =c1_link_related + bl set_callback1 + bl sub_8086C2C + ldr r0, =c2_overworld + bl SetMainCallback2 +_080860B8: + pop {r0} + bx r0 + .pool + thumb_func_end c2_80567AC + + thumb_func_start c2_exit_to_overworld_2_switch +c2_exit_to_overworld_2_switch: @ 80860C8 + push {lr} + bl is_c1_link_related_active + cmp r0, 0x1 + bne _080860E0 + ldr r0, =c2_exit_to_overworld_2_link + bl SetMainCallback2 + b _080860EA + .pool +_080860E0: + bl sub_808631C + ldr r0, =c2_exit_to_overworld_2_local + bl SetMainCallback2 +_080860EA: + pop {r0} + bx r0 + .pool + thumb_func_end c2_exit_to_overworld_2_switch + + thumb_func_start c2_exit_to_overworld_2_local +c2_exit_to_overworld_2_local: @ 80860F4 + push {lr} + ldr r0, =0x030026f8 + bl sub_8086638 + cmp r0, 0 + beq _0808610A + bl SetFieldVBlankCallback + ldr r0, =c2_overworld + bl SetMainCallback2 +_0808610A: + pop {r0} + bx r0 + .pool + thumb_func_end c2_exit_to_overworld_2_local + + thumb_func_start c2_exit_to_overworld_2_link +c2_exit_to_overworld_2_link: @ 8086118 + push {lr} + bl sub_8087598 + cmp r0, 0 + bne _08086132 + ldr r0, =0x030026f8 + bl map_loading_iteration_2_link + cmp r0, 0 + beq _08086132 + ldr r0, =c2_overworld + bl SetMainCallback2 +_08086132: + pop {r0} + bx r0 + .pool + thumb_func_end c2_exit_to_overworld_2_link + + thumb_func_start c2_8056854 +c2_8056854: @ 8086140 + push {lr} + bl sub_808631C + bl sub_80A2F30 + ldr r0, =c1_link_related + bl set_callback1 + bl sub_8086C2C + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08086174 + ldr r1, =0x03005dac + ldr r0, =sub_80AF314 + b _08086178 + .pool +_08086174: + ldr r1, =0x03005dac + ldr r0, =sub_80AF214 +_08086178: + str r0, [r1] + bl script_env_1_init + bl script_env_2_disable + bl c2_exit_to_overworld_2_switch + pop {r0} + bx r0 + .pool + thumb_func_end c2_8056854 + + thumb_func_start sub_8086194 +sub_8086194: @ 8086194 + push {lr} + bl sub_808631C + ldr r1, =0x03005db0 + ldr r0, =sub_80AF6A4 + str r0, [r1] + bl c2_exit_to_overworld_2_switch + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086194 + + thumb_func_start sub_80861B0 +sub_80861B0: @ 80861B0 + push {lr} + bl sub_808631C + ldr r1, =0x03005dac + ldr r0, =sub_80AF188 + str r0, [r1] + bl c2_exit_to_overworld_2_switch + pop {r0} + bx r0 + .pool + thumb_func_end sub_80861B0 + + thumb_func_start c2_exit_to_overworld_1_continue_scripts_restart_music +c2_exit_to_overworld_1_continue_scripts_restart_music: @ 80861CC + push {lr} + bl sub_808631C + ldr r1, =0x03005dac + ldr r0, =sub_80AF168 + str r0, [r1] + bl c2_exit_to_overworld_2_switch + pop {r0} + bx r0 + .pool + thumb_func_end c2_exit_to_overworld_1_continue_scripts_restart_music + + thumb_func_start sub_80861E8 +sub_80861E8: @ 80861E8 + push {lr} + bl sub_808631C + ldr r1, =0x03005dac + ldr r0, =sub_80AF3C8 + str r0, [r1] + bl c2_exit_to_overworld_2_switch + pop {r0} + bx r0 + .pool + thumb_func_end sub_80861E8 + + thumb_func_start sub_8086204 +sub_8086204: @ 8086204 + push {lr} + ldr r0, =0x02037318 + ldrb r1, [r0, 0x1A] + movs r0, 0xF8 + ands r0, r1 + cmp r0, 0x8 + bne _08086222 + bl sub_80E909C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08086222 + bl AddMapNamePopUpWindowTask +_08086222: + bl sub_80AF3C8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086204 + + thumb_func_start sub_8086230 +sub_8086230: @ 8086230 + push {r4,lr} + bl sub_808631C + bl sub_80A2F30 + bl ResetSafariZoneFlag_ + ldr r0, =0x03006210 + ldrh r0, [r0] + cmp r0, 0xFF + bne _0808624A + bl sub_81A3908 +_0808624A: + bl set_current_map_header_from_sav1 + bl set_warp2_warp3_to_neg_1 + bl GetCurrentTrainerHillMapId + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037318 + ldrh r1, [r0, 0x12] + ldr r0, =0x00000169 + cmp r1, r0 + bne _08086278 + bl sub_81AA2F8 + b _0808628A + .pool +_08086278: + cmp r4, 0 + beq _08086286 + cmp r4, 0x6 + beq _08086286 + bl sub_81D5F48 + b _0808628A +_08086286: + bl CopyFieldObjectTemplateCoordsToSav1 +_0808628A: + bl sub_809757C + bl sub_809E7B0 + bl sub_8084788 + ldr r0, =0x02037318 + ldrh r1, [r0, 0x12] + ldr r0, =0x00000169 + cmp r1, r0 + bne _080862B0 + movs r0, 0x1 + bl battle_pyramid_map_load_related + b _080862BE + .pool +_080862B0: + cmp r4, 0 + beq _080862BA + bl trainer_hill_map_load_related + b _080862BE +_080862BA: + bl sub_8087D74 +_080862BE: + bl set_max_playtime_if_appropriate + bl script_env_1_init + bl script_env_2_disable + bl sub_8195E10 + bl sav2_x1_query_bit1 + cmp r0, 0x1 + bne _080862F4 + bl sav2_x9_clear_bit1 + bl warp1_set_to_sav1w + bl warp_in + bl sub_80EDB44 + ldr r0, =c2_load_new_map + bl SetMainCallback2 + b _08086308 + .pool +_080862F4: + bl sub_80EDB44 + ldr r0, =0x03005dac + ldr r1, =sub_8086204 + str r1, [r0] + ldr r0, =c1_overworld + bl set_callback1 + bl c2_exit_to_overworld_2_switch +_08086308: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086230 + + thumb_func_start sub_808631C +@ void sub_808631C() +sub_808631C: @ 808631C + push {r4,lr} + bl warp0_in_pokecenter + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0808632E + bl sub_80097E8 +_0808632E: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08086348 + movs r0, 0xC5 + bl EnableInterrupts + movs r0, 0x2 + bl DisableInterrupts + b _08086362 + .pool +_08086348: + ldr r4, =0x04000208 + ldrh r3, [r4] + strh r0, [r4] + ldr r2, =0x04000200 + ldrh r1, [r2] + ldr r0, =0x0000fffd + ands r0, r1 + strh r0, [r2] + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + strh r3, [r4] +_08086362: + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl SetHBlankCallback + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808631C + + thumb_func_start SetFieldVBlankCallback +@ void SetFieldVBlankCallback() +SetFieldVBlankCallback: @ 8086380 + push {lr} + ldr r0, =VBlankCB_Field + bl SetVBlankCallback + pop {r0} + bx r0 + .pool + thumb_func_end SetFieldVBlankCallback + + thumb_func_start VBlankCB_Field +VBlankCB_Field: @ 8086390 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl sub_80BA0A8 + bl FieldUpdateBgTilemapScroll + bl copy_pal_bg_faded_to_pal_ram + bl sub_80A09D0 + pop {r0} + bx r0 + thumb_func_end VBlankCB_Field + + thumb_func_start sub_80863B0 +sub_80863B0: @ 80863B0 + push {lr} + bl sub_81A9E6C + lsls r0, 24 + cmp r0, 0 + beq _080863D4 + bl door_upload_tiles + ldr r2, =gUnknown_08339DBC + ldr r0, [r2] + ldr r1, [r2, 0x4] + ldr r2, [r2, 0x8] + bl sub_80BA038 + b _080863F0 + .pool +_080863D4: + bl sav1_get_flash_used_on_map + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080863F0 + bl sub_80B00E8 + ldr r2, =gUnknown_08339DBC + ldr r0, [r2] + ldr r1, [r2, 0x4] + ldr r2, [r2, 0x8] + bl sub_80BA038 +_080863F0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80863B0 + + thumb_func_start map_loading_iteration_3 +map_loading_iteration_3: @ 80863F8 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0xD + bls _08086404 + b _08086512 +_08086404: + lsls r0, 2 + ldr r1, =_08086414 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08086414: + .4byte _0808644C + .4byte _08086462 + .4byte _0808646A + .4byte _08086472 + .4byte _08086484 + .4byte _08086492 + .4byte _08086498 + .4byte _080864A8 + .4byte _080864B8 + .4byte _080864D4 + .4byte _080864DA + .4byte _080864E0 + .4byte _080864FC + .4byte _0808650E +_0808644C: + bl overworld_bg_setup + bl script_env_1_init + bl script_env_2_disable + bl saveblock_randomize_and_relocate_ + bl sub_80867D8 + b _08086506 +_08086462: + movs r0, 0x1 + bl mli0_load_map + b _08086506 +_0808646A: + movs r0, 0x1 + bl sub_8086988 + b _08086506 +_08086472: + bl sub_8086AE4 + bl sub_80869DC + bl sub_8086B14 + bl sub_8086AAC + b _08086506 +_08086484: + bl sub_80863B0 + bl map_loading_lcd_reset + bl sub_8197200 + b _08086506 +_08086492: + bl move_tilemap_camera_to_upper_left_corner + b _08086506 +_08086498: + ldr r0, =0x02037318 + ldr r0, [r0] + bl copy_map_tileset1_to_vram + b _08086506 + .pool +_080864A8: + ldr r0, =0x02037318 + ldr r0, [r0] + bl copy_map_tileset2_to_vram + b _08086506 + .pool +_080864B8: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08086512 + ldr r0, =0x02037318 + ldr r0, [r0] + bl apply_map_tileset1_tileset2_palette + b _08086506 + .pool +_080864D4: + bl DrawWholeMapView + b _08086506 +_080864DA: + bl cur_mapheader_run_tileset_funcs_after_some_cpuset + b _08086506 +_080864E0: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08086506 + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _08086506 + .pool +_080864FC: + bl map_post_load_hook_exec + lsls r0, 24 + cmp r0, 0 + beq _08086512 +_08086506: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _08086512 +_0808650E: + movs r0, 0x1 + b _08086514 +_08086512: + movs r0, 0 +_08086514: + pop {r4} + pop {r1} + bx r1 + thumb_func_end map_loading_iteration_3 + + thumb_func_start load_map_stuff +@ int load_map_stuff(u8 *a1, int a2) +load_map_stuff: @ 808651C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r0, [r4] + cmp r0, 0xD + bls _0808652A + b _0808662E +_0808652A: + lsls r0, 2 + ldr r1, =_08086538 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08086538: + .4byte _08086570 + .4byte _0808657C + .4byte _08086586 + .4byte _0808658E + .4byte _08086598 + .4byte _080865A6 + .4byte _080865AC + .4byte _080865BC + .4byte _080865CC + .4byte _080865E8 + .4byte _080865EE + .4byte _080865F4 + .4byte _08086618 + .4byte _0808662A +_08086570: + bl sub_808631C + adds r0, r5, 0 + bl mli0_load_map + b _08086622 +_0808657C: + bl saveblock_randomize_and_relocate_ + bl sub_80867D8 + b _08086622 +_08086586: + adds r0, r5, 0 + bl sub_8086988 + b _08086622 +_0808658E: + bl mli4_mapscripts_and_other + bl sub_8086A80 + b _08086622 +_08086598: + bl sub_80863B0 + bl map_loading_lcd_reset + bl sub_8197200 + b _08086622 +_080865A6: + bl move_tilemap_camera_to_upper_left_corner + b _08086622 +_080865AC: + ldr r0, =0x02037318 + ldr r0, [r0] + bl copy_map_tileset1_to_vram + b _08086622 + .pool +_080865BC: + ldr r0, =0x02037318 + ldr r0, [r0] + bl copy_map_tileset2_to_vram + b _08086622 + .pool +_080865CC: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0808662E + ldr r0, =0x02037318 + ldr r0, [r0] + bl apply_map_tileset1_tileset2_palette + b _08086622 + .pool +_080865E8: + bl DrawWholeMapView + b _08086622 +_080865EE: + bl cur_mapheader_run_tileset_funcs_after_some_cpuset + b _08086622 +_080865F4: + ldr r0, =0x02037318 + ldrb r1, [r0, 0x1A] + movs r0, 0xF8 + ands r0, r1 + cmp r0, 0x8 + bne _08086622 + bl sub_80E909C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08086622 + bl AddMapNamePopUpWindowTask + b _08086622 + .pool +_08086618: + bl map_post_load_hook_exec + lsls r0, 24 + cmp r0, 0 + beq _0808662E +_08086622: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0808662E +_0808662A: + movs r0, 0x1 + b _08086630 +_0808662E: + movs r0, 0 +_08086630: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end load_map_stuff + + thumb_func_start sub_8086638 +sub_8086638: @ 8086638 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0x1 + beq _0808666E + cmp r0, 0x1 + bgt _0808664C + cmp r0, 0 + beq _08086656 + b _0808668E +_0808664C: + cmp r0, 0x2 + beq _08086678 + cmp r0, 0x3 + beq _0808668A + b _0808668E +_08086656: + bl saveblock_randomize_and_relocate_ + bl sub_80867D8 + movs r0, 0 + bl sub_8086988 + bl sub_8086A68 + bl sub_8086A80 + b _08086682 +_0808666E: + bl sub_8086860 + bl sub_81D64C0 + b _08086682 +_08086678: + bl map_post_load_hook_exec + lsls r0, 24 + cmp r0, 0 + beq _0808668E +_08086682: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0808668E +_0808668A: + movs r0, 0x1 + b _08086690 +_0808668E: + movs r0, 0 +_08086690: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8086638 + + thumb_func_start map_loading_iteration_2_link +map_loading_iteration_2_link: @ 8086698 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0xD + bls _080866A4 + b _080867A8 +_080866A4: + lsls r0, 2 + ldr r1, =_080866B4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080866B4: + .4byte _080866EC + .4byte _080866FA + .4byte _08086702 + .4byte _08086710 + .4byte _0808671E + .4byte _08086724 + .4byte _08086734 + .4byte _08086744 + .4byte _08086760 + .4byte _08086766 + .4byte _08086792 + .4byte _0808676C + .4byte _08086788 + .4byte _0808679A +_080866EC: + bl sub_808631C + bl saveblock_randomize_and_relocate_ + bl sub_80867D8 + b _08086792 +_080866FA: + movs r0, 0x1 + bl sub_8086988 + b _08086792 +_08086702: + bl sub_8086B9C + bl sub_8086A68 + bl sub_8086AC8 + b _08086792 +_08086710: + bl sub_80863B0 + bl map_loading_lcd_reset + bl sub_8197200 + b _08086792 +_0808671E: + bl move_tilemap_camera_to_upper_left_corner + b _08086792 +_08086724: + ldr r0, =0x02037318 + ldr r0, [r0] + bl copy_map_tileset1_to_vram + b _08086792 + .pool +_08086734: + ldr r0, =0x02037318 + ldr r0, [r0] + bl copy_map_tileset2_to_vram + b _08086792 + .pool +_08086744: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080867A8 + ldr r0, =0x02037318 + ldr r0, [r0] + bl apply_map_tileset1_tileset2_palette + b _08086792 + .pool +_08086760: + bl DrawWholeMapView + b _08086792 +_08086766: + bl cur_mapheader_run_tileset_funcs_after_some_cpuset + b _08086792 +_0808676C: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08086792 + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _08086792 + .pool +_08086788: + bl map_post_load_hook_exec + lsls r0, 24 + cmp r0, 0 + beq _080867A8 +_08086792: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _080867A8 +_0808679A: + bl SetFieldVBlankCallback + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + movs r0, 0x1 + b _080867AA +_080867A8: + movs r0, 0 +_080867AA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end map_loading_iteration_2_link + + thumb_func_start do_load_map_stuff_loop +do_load_map_stuff_loop: @ 80867B0 + push {r4,lr} + adds r4, r0, 0 +_080867B4: + adds r0, r4, 0 + movs r1, 0 + bl load_map_stuff + cmp r0, 0 + beq _080867B4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end do_load_map_stuff_loop + + thumb_func_start saveblock_randomize_and_relocate_ +saveblock_randomize_and_relocate_: @ 80867C8 + push {lr} + bl sub_81BE6AC + bl saveblock_randomize_and_relocate + pop {r0} + bx r0 + thumb_func_end saveblock_randomize_and_relocate_ + + thumb_func_start sub_80867D8 +sub_80867D8: @ 80867D8 + push {r4-r7,lr} + sub sp, 0x4 + movs r0, 0 + movs r1, 0 + bl SetGpuReg + bl remove_some_task + ldr r2, =0x05000002 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, =0x040000d4 + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + ldr r0, =0x810001ff + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r2, 0xC0 + lsls r2, 19 + movs r3, 0xC0 + lsls r3, 9 + mov r4, sp + movs r6, 0 + movs r5, 0x80 + lsls r5, 5 + ldr r7, =0x81000800 + movs r0, 0x81 + lsls r0, 24 + mov r12, r0 +_08086816: + strh r6, [r4] + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + str r7, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r2, r5 + subs r3, r5 + cmp r3, r5 + bhi _08086816 + strh r6, [r4] + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + lsrs r0, r3, 1 + mov r2, r12 + orrs r0, r2 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r0, 0 + movs r1, 0x80 + bl ResetSpriteRange + bl LoadOamFromSprites + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80867D8 + + thumb_func_start sub_8086860 +sub_8086860: @ 8086860 + push {lr} + bl sub_80863B0 + bl map_loading_lcd_reset + bl sub_8197200 + bl mapdata_load_assets_to_gpu_and_full_redraw + pop {r0} + bx r0 + thumb_func_end sub_8086860 + + thumb_func_start map_loading_lcd_reset +map_loading_lcd_reset: @ 8086878 + push {r4,lr} + bl clear_scheduled_bg_copies_to_vram + bl reset_temp_tile_data_buffers + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + ldr r1, =0x00001f1f + movs r0, 0x48 + bl SetGpuReg + ldr r1, =0x00000101 + movs r0, 0x4A + bl SetGpuReg + movs r0, 0x40 + movs r1, 0xFF + bl SetGpuReg + movs r0, 0x44 + movs r1, 0xFF + bl SetGpuReg + ldr r4, =0x0000ffff + movs r0, 0x42 + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x46 + adds r1, r4, 0 + bl SetGpuReg + ldr r0, =gUnknown_82EC7C4 + ldrh r1, [r0, 0x2] + ldrh r2, [r0, 0x4] + orrs r1, r2 + ldrh r0, [r0, 0x6] + orrs r1, r0 + movs r2, 0x82 + lsls r2, 5 + adds r0, r2, 0 + orrs r1, r0 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x0000070d + movs r0, 0x52 + bl SetGpuReg + bl overworld_bg_setup + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x3 + bl schedule_bg_copy_tilemap_to_vram + 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 + ldr r1, =0x00007060 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + bl sub_8098128 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end map_loading_lcd_reset + + thumb_func_start sub_8086988 +sub_8086988: @ 8086988 + push {r4,lr} + adds r4, r0, 0 + bl ResetTasks + bl ResetAllObjectData + bl sub_80A1A74 + bl dp12_8087EA4 + bl dp13_810BB8C + bl ResetCameraUpdateInfo + bl InstallCameraPanAheadCallback + cmp r4, 0 + bne _080869B4 + movs r0, 0 + bl npc_paltag_set_load + b _080869BA +_080869B4: + movs r0, 0x1 + bl npc_paltag_set_load +_080869BA: + bl FieldEffectActiveListClear + bl sub_80AAFA4 + bl sub_80AEE84 + cmp r4, 0 + bne _080869CE + bl overworld_ensure_per_step_coros_running +_080869CE: + bl mapheader_run_script_with_tag_x5 + bl sub_81BE6B8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8086988 + + thumb_func_start sub_80869DC +sub_80869DC: @ 80869DC + push {lr} + ldr r0, =0x03005dec + movs r1, 0 + strh r1, [r0] + ldr r0, =0x03005de8 + strh r1, [r0] + bl sub_808D438 + movs r0, 0 + movs r1, 0 + bl SpawnFieldObjectsInView + bl mapheader_run_first_tag4_script_list_match + pop {r0} + bx r0 + .pool + thumb_func_end sub_80869DC + + thumb_func_start mli4_mapscripts_and_other +mli4_mapscripts_and_other: @ 8086A04 + push {r4,r5,lr} + sub sp, 0x4 + ldr r0, =0x03005dec + movs r1, 0 + strh r1, [r0] + ldr r0, =0x03005de8 + strh r1, [r0] + bl sub_808D438 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl sav1_camera_get_focus_coords + bl sub_80852D4 + adds r5, r0, 0 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + ldrb r2, [r5, 0x1] + ldr r3, =0x03005d90 + ldr r3, [r3] + ldrb r3, [r3, 0x8] + bl InitPlayerAvatar + ldrb r0, [r5] + bl SetPlayerAvatarTransitionFlags + bl player_avatar_init_params_reset + movs r0, 0 + movs r1, 0 + bl SpawnFieldObjectsInView + bl mapheader_run_first_tag4_script_list_match + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end mli4_mapscripts_and_other + + thumb_func_start sub_8086A68 +sub_8086A68: @ 8086A68 + push {lr} + movs r0, 0 + movs r1, 0 + bl sub_808E16C + bl sub_80FBED0 + bl mapheader_run_script_with_tag_x7 + pop {r0} + bx r0 + thumb_func_end sub_8086A68 + + thumb_func_start sub_8086A80 +sub_8086A80: @ 8086A80 + push {lr} + ldr r2, =0x02037350 + ldr r3, =0x02037590 + ldrb r1, [r3, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0, 0x1] + ldrb r0, [r3, 0x4] + bl InitCameraUpdateCallback + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086A80 + + thumb_func_start sub_8086AAC +sub_8086AAC: @ 8086AAC + push {lr} + ldr r0, =0x03005db4 + ldrb r0, [r0] + bl sub_8087858 + lsls r0, 24 + lsrs r0, 24 + bl InitCameraUpdateCallback + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086AAC + + thumb_func_start sub_8086AC8 +sub_8086AC8: @ 8086AC8 + push {lr} + ldr r0, =0x03005db4 + ldrb r0, [r0] + bl sub_8087858 + lsls r0, 24 + lsrs r0, 24 + bl InitCameraUpdateCallback + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086AC8 + + thumb_func_start sub_8086AE4 +sub_8086AE4: @ 8086AE4 + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl sav1_camera_get_focus_coords + mov r2, sp + ldr r0, =0x03005db4 + ldrb r1, [r0] + ldrh r0, [r2] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r4] + bl sub_8088B3C + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086AE4 + + thumb_func_start sub_8086B14 +sub_8086B14: @ 8086B14 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl sav1_camera_get_focus_coords + mov r3, sp + mov r2, sp + ldr r0, =0x03005db4 + ldrb r1, [r0] + ldrh r0, [r2] + subs r0, r1 + strh r0, [r3] + movs r6, 0 + ldr r0, =0x03005db8 + mov r8, r4 + ldrb r0, [r0] + cmp r6, r0 + bcs _08086B7E + ldr r7, =0x020229e8 +_08086B44: + lsls r5, r6, 24 + lsrs r5, 24 + mov r0, sp + ldrh r1, [r0] + adds r1, r6, r1 + lsls r1, 16 + asrs r1, 16 + mov r0, r8 + movs r3, 0 + ldrsh r2, [r0, r3] + lsls r4, r6, 3 + subs r4, r6 + lsls r4, 2 + adds r4, r7 + ldrb r3, [r4, 0x13] + adds r0, r5, 0 + bl sub_80876F0 + ldrb r1, [r4] + adds r0, r5, 0 + bl sub_8087BCC + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =0x03005db8 + ldrb r0, [r0] + cmp r6, r0 + bcc _08086B44 +_08086B7E: + bl sub_8086C40 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086B14 + + thumb_func_start sub_8086B9C +sub_8086B9C: @ 8086B9C + push {r4,r5,lr} + movs r4, 0 + ldr r0, =0x03005db8 + ldrb r0, [r0] + cmp r4, r0 + bcs _08086BCA + ldr r5, =0x020229e8 +_08086BAA: + lsls r0, r4, 24 + lsrs r0, 24 + lsls r1, r4, 3 + subs r1, r4 + lsls r1, 2 + adds r1, r5 + ldrb r1, [r1] + bl sub_8087BCC + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x03005db8 + ldrb r0, [r0] + cmp r4, r0 + bcc _08086BAA +_08086BCA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086B9C + + thumb_func_start c1_link_related +c1_link_related: @ 8086BD8 + push {r4,lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08086BF2 + bl sub_800F0B8 + cmp r0, 0 + beq _08086BF2 + bl sub_8009F3C + cmp r0, 0 + bne _08086C14 +_08086BF2: + ldr r0, =0x03005db4 + ldrb r4, [r0] + ldr r0, =0x03003020 + adds r1, r4, 0 + bl sub_8086F38 + ldr r0, =0x03000e14 + ldr r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 + lsls r0, 16 + lsrs r0, 16 + bl sub_8086FA0 + bl sub_8086C40 +_08086C14: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end c1_link_related + + thumb_func_start sub_8086C2C +sub_8086C2C: @ 8086C2C + push {lr} + bl sub_8086C90 + ldr r0, =sub_80870B0 + bl c1_link_related_func_set + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086C2C + + thumb_func_start sub_8086C40 +sub_8086C40: @ 8086C40 + push {lr} + ldr r0, =0x03003020 + bl sub_808709C + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086C40 + + thumb_func_start c1_link_related_func_set +c1_link_related_func_set: @ 8086C50 + ldr r2, =0x03000e19 + movs r1, 0 + strb r1, [r2] + ldr r1, =0x03000e14 + str r0, [r1] + bx lr + .pool + thumb_func_end c1_link_related_func_set + + thumb_func_start sub_8086C64 +sub_8086C64: @ 8086C64 + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08086C82 + ldr r1, =0x03000e19 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3C + bls _08086C82 + bl sub_8010198 +_08086C82: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086C64 + + thumb_func_start sub_8086C90 +sub_8086C90: @ 8086C90 + push {lr} + ldr r1, =0x03000e10 + movs r2, 0x80 + adds r0, r1, 0x3 +_08086C98: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _08086C98 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086C90 + + thumb_func_start sub_8086CA8 +sub_8086CA8: @ 8086CA8 + push {r4,lr} + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, =0x03005db8 + ldrb r2, [r0] + movs r1, 0 + cmp r1, r2 + bge _08086CD6 + ldr r4, =0x03000e10 +_08086CBA: + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, r3 + beq _08086CD0 + movs r0, 0 + b _08086CD8 + .pool +_08086CD0: + adds r1, 0x1 + cmp r1, r2 + blt _08086CBA +_08086CD6: + movs r0, 0x1 +_08086CD8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8086CA8 + + thumb_func_start sub_8086CE0 +sub_8086CE0: @ 8086CE0 + push {r4,lr} + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, =0x03005db8 + ldrb r2, [r0] + movs r1, 0 + cmp r1, r2 + bge _08086D0E + ldr r4, =0x03000e10 +_08086CF2: + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, r3 + bne _08086D08 + movs r0, 0x1 + b _08086D10 + .pool +_08086D08: + adds r1, 0x1 + cmp r1, r2 + blt _08086CF2 +_08086D0E: + movs r0, 0 +_08086D10: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8086CE0 + + thumb_func_start sub_8086D18 +sub_8086D18: @ 8086D18 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + adds r6, r2, 0 + mov r9, r3 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + ldr r0, =0x03000e10 + adds r5, r7, r0 + ldrb r0, [r5] + cmp r0, 0x80 + beq _08086D38 + b _08086EB2 +_08086D38: + adds r0, r6, 0 + bl sub_8087370 + adds r4, r0, 0 + cmp r4, 0 + beq _08086D70 + bl sub_8087480 + mov r1, r9 + strh r0, [r1] + movs r0, 0x81 + strb r0, [r5] + ldrb r0, [r6, 0x1] + cmp r0, 0 + bne _08086D58 + b _08086F26 +_08086D58: + ldr r0, =sub_80870F8 + bl c1_link_related_func_set + adds r0, r4, 0 + bl sub_8087530 + b _08086F26 + .pool +_08086D70: + movs r0, 0x83 + bl sub_8086CE0 + cmp r0, 0x1 + bne _08086D98 + movs r0, 0x81 + strb r0, [r5] + ldrb r0, [r6, 0x1] + cmp r0, 0 + bne _08086D86 + b _08086F26 +_08086D86: + ldr r0, =sub_80870F8 + bl c1_link_related_func_set + bl sub_8087584 + b _08086F26 + .pool +_08086D98: + mov r0, r8 + subs r0, 0x12 + cmp r0, 0xA + bls _08086DA2 + b _08086EB2 +_08086DA2: + lsls r0, 2 + ldr r1, =_08086DB0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08086DB0: + .4byte _08086E08 + .4byte _08086EB2 + .4byte _08086EB2 + .4byte _08086EB2 + .4byte _08086EB2 + .4byte _08086EB2 + .4byte _08086DDC + .4byte _08086E34 + .4byte _08086EB2 + .4byte _08086E64 + .4byte _08086E90 +_08086DDC: + adds r0, r6, 0 + bl sub_8087358 + cmp r0, 0 + beq _08086EB2 + ldr r0, =0x03000e10 + adds r0, r7, r0 + movs r1, 0x81 + strb r1, [r0] + ldrb r0, [r6, 0x1] + cmp r0, 0 + beq _08086EB2 + ldr r0, =sub_80870F8 + bl c1_link_related_func_set + bl sub_808751C + b _08086EB2 + .pool +_08086E08: + adds r0, r6, 0 + bl sub_8087388 + cmp r0, 0x1 + bne _08086EB2 + ldr r0, =0x03000e10 + adds r0, r7, r0 + movs r1, 0x81 + strb r1, [r0] + ldrb r0, [r6, 0x1] + cmp r0, 0 + beq _08086EB2 + ldr r0, =sub_80870F8 + bl c1_link_related_func_set + bl sub_808754C + b _08086EB2 + .pool +_08086E34: + adds r0, r6, 0 + bl sub_80873B4 + adds r4, r0, 0 + cmp r4, 0 + beq _08086EB2 + ldr r0, =0x03000e10 + adds r0, r7, r0 + movs r1, 0x81 + strb r1, [r0] + ldrb r0, [r6, 0x1] + cmp r0, 0 + beq _08086EB2 + ldr r0, =sub_80870F8 + bl c1_link_related_func_set + adds r0, r4, 0 + bl sub_8087568 + b _08086EB2 + .pool +_08086E64: + adds r0, r6, 0 + bl sub_8087340 + cmp r0, 0 + beq _08086EB2 + ldr r0, =0x03000e10 + adds r0, r7, r0 + movs r1, 0x81 + strb r1, [r0] + ldrb r0, [r6, 0x1] + cmp r0, 0 + beq _08086EB2 + ldr r0, =sub_808711C + bl c1_link_related_func_set + bl sub_8087510 + b _08086EB2 + .pool +_08086E90: + adds r0, r6, 0 + bl sub_8087340 + cmp r0, 0 + beq _08086EB2 + ldr r0, =0x03000e10 + adds r0, r7, r0 + movs r1, 0x81 + strb r1, [r0] + ldrb r0, [r6, 0x1] + cmp r0, 0 + beq _08086EB2 + ldr r0, =sub_8087140 + bl c1_link_related_func_set + bl sub_8087510 +_08086EB2: + mov r0, r8 + cmp r0, 0x17 + beq _08086ED8 + cmp r0, 0x17 + bgt _08086ECC + cmp r0, 0x16 + beq _08086EE8 + b _08086F26 + .pool +_08086ECC: + mov r1, r8 + cmp r1, 0x1A + beq _08086EF8 + cmp r1, 0x1D + beq _08086F18 + b _08086F26 +_08086ED8: + ldr r0, =0x03000e10 + adds r0, r7, r0 + movs r1, 0x83 + strb r1, [r0] + b _08086F26 + .pool +_08086EE8: + ldr r0, =0x03000e10 + adds r0, r7, r0 + movs r1, 0x82 + strb r1, [r0] + b _08086F26 + .pool +_08086EF8: + ldr r0, =0x03000e10 + adds r0, r7, r0 + movs r1, 0x80 + strb r1, [r0] + ldrb r0, [r6, 0x1] + cmp r0, 0 + beq _08086F26 + ldr r0, =sub_80870B0 + bl c1_link_related_func_set + b _08086F26 + .pool +_08086F18: + ldr r0, =0x03000e10 + adds r1, r7, r0 + ldrb r0, [r1] + cmp r0, 0x82 + bne _08086F26 + movs r0, 0x81 + strb r0, [r1] +_08086F26: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086D18 + + thumb_func_start sub_8086F38 +sub_8086F38: @ 8086F38 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + mov r8, r1 + movs r6, 0 + add r5, sp, 0x10 + mov r9, r5 + adds r7, r0, 0 +_08086F4C: + ldrb r4, [r7] + movs r0, 0 + strh r0, [r5] + adds r0, r6, 0 + mov r1, r8 + mov r2, sp + bl sub_80872D8 + adds r0, r6, 0 + adds r1, r4, 0 + mov r2, sp + adds r3, r5, 0 + bl sub_8086D18 + ldr r0, =0x03000e10 + adds r0, r6, r0 + ldrb r0, [r0] + cmp r0, 0x80 + bne _08086F7C + adds r0, r4, 0 + bl sub_8087068 + mov r1, r9 + strh r0, [r1] +_08086F7C: + lsls r0, r6, 24 + lsrs r0, 24 + ldrb r1, [r5] + bl sub_808796C + adds r7, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _08086F4C + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086F38 + + thumb_func_start sub_8086FA0 +sub_8086FA0: @ 8086FA0 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + ldr r1, =0xffef0000 + adds r0, r1 + lsrs r0, 16 + cmp r0, 0xC + bhi _08086FC0 + ldr r0, =0x03005da8 + strh r4, [r0] + b _08086FC6 + .pool +_08086FC0: + ldr r1, =0x03005da8 + movs r0, 0x11 + strh r0, [r1] +_08086FC6: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08086FFC + bl sub_8087690 + cmp r0, 0x1 + bls _08086FFC + bl is_c1_link_related_active + cmp r0, 0x1 + bne _08086FFC + bl sub_8009F3C + cmp r0, 0x1 + bne _08086FFC + cmp r4, 0x11 + blt _08086FFC + cmp r4, 0x15 + ble _08086FF6 + cmp r4, 0x19 + bgt _08086FFC + cmp r4, 0x18 + blt _08086FFC +_08086FF6: + ldr r1, =0x03005da8 + movs r0, 0 + strh r0, [r1] +_08086FFC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8086FA0 + + thumb_func_start sub_808700C +sub_808700C: @ 808700C + push {lr} + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2C] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08087024 + movs r0, 0x13 + b _08087064 + .pool +_08087024: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08087030 + movs r0, 0x12 + b _08087064 +_08087030: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0808703C + movs r0, 0x14 + b _08087064 +_0808703C: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08087048 + movs r0, 0x15 + b _08087064 +_08087048: + ldrh r1, [r2, 0x2E] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08087056 + movs r0, 0x18 + b _08087064 +_08087056: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08087062 + movs r0, 0x11 + b _08087064 +_08087062: + movs r0, 0x19 +_08087064: + pop {r1} + bx r1 + thumb_func_end sub_808700C + + thumb_func_start sub_8087068 +sub_8087068: @ 8087068 + push {lr} + lsls r0, 16 + lsrs r0, 16 + adds r1, r0, 0 + cmp r0, 0x13 + beq _0808708E + cmp r0, 0x13 + bgt _0808707E + cmp r0, 0x12 + beq _08087092 + b _08087096 +_0808707E: + cmp r1, 0x14 + beq _0808708A + cmp r1, 0x15 + bne _08087096 + movs r0, 0x4 + b _08087098 +_0808708A: + movs r0, 0x3 + b _08087098 +_0808708E: + movs r0, 0x1 + b _08087098 +_08087092: + movs r0, 0x2 + b _08087098 +_08087096: + movs r0, 0 +_08087098: + pop {r1} + bx r1 + thumb_func_end sub_8087068 + + thumb_func_start sub_808709C +sub_808709C: @ 808709C + push {lr} + movs r2, 0x11 + adds r1, r0, 0x6 +_080870A2: + strh r2, [r1] + subs r1, 0x2 + cmp r1, r0 + bge _080870A2 + pop {r0} + bx r0 + thumb_func_end sub_808709C + + thumb_func_start sub_80870B0 +sub_80870B0: @ 80870B0 + push {r4,lr} + adds r4, r0, 0 + bl script_env_2_is_enabled + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080870C4 + movs r0, 0x11 + b _080870E6 +_080870C4: + bl sub_800B4DC + cmp r0, 0x4 + bls _080870D0 + movs r0, 0x1B + b _080870E6 +_080870D0: + bl sub_8087690 + cmp r0, 0x4 + bls _080870DC + movs r0, 0x1C + b _080870E6 +_080870DC: + adds r0, r4, 0 + bl sub_808700C + lsls r0, 16 + lsrs r0, 16 +_080870E6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80870B0 + + thumb_func_start sub_80870EC +sub_80870EC: @ 80870EC + push {lr} + bl sub_8086C64 + movs r0, 0x11 + pop {r1} + bx r1 + thumb_func_end sub_80870EC + + thumb_func_start sub_80870F8 +sub_80870F8: @ 80870F8 + push {r4,lr} + bl script_env_2_is_enabled + lsls r0, 24 + lsrs r0, 24 + movs r4, 0x11 + cmp r0, 0x1 + beq _08087110 + movs r4, 0x1A + ldr r0, =sub_80870EC + bl c1_link_related_func_set +_08087110: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80870F8 + + thumb_func_start sub_808711C +sub_808711C: @ 808711C + push {r4,lr} + bl sub_800B4DC + movs r4, 0x11 + cmp r0, 0x2 + bhi _08087134 + movs r4, 0x1A + bl script_env_2_disable + ldr r0, =sub_80870EC + bl c1_link_related_func_set +_08087134: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_808711C + + thumb_func_start sub_8087140 +sub_8087140: @ 8087140 + push {r4,lr} + bl sub_8087690 + movs r4, 0x11 + cmp r0, 0x2 + bhi _08087158 + movs r4, 0x1A + bl script_env_2_disable + ldr r0, =sub_80870EC + bl c1_link_related_func_set +_08087158: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8087140 + + thumb_func_start sub_8087164 +sub_8087164: @ 8087164 + push {lr} + bl sub_8086C64 + movs r0, 0x11 + pop {r1} + bx r1 + thumb_func_end sub_8087164 + + thumb_func_start sub_8087170 +sub_8087170: @ 8087170 + push {lr} + ldr r1, =0x03000e10 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x82 + bne _080871A0 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080871A4 + ldr r0, =sub_8087164 + bl c1_link_related_func_set + movs r0, 0x1D + b _080871A6 + .pool +_080871A0: + bl sub_8086C64 +_080871A4: + movs r0, 0x11 +_080871A6: + pop {r1} + bx r1 + thumb_func_end sub_8087170 + + thumb_func_start sub_80871AC +sub_80871AC: @ 80871AC + push {lr} + ldr r0, =sub_8087170 + bl c1_link_related_func_set + movs r0, 0x16 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80871AC + + thumb_func_start sub_80871C0 +sub_80871C0: @ 80871C0 + movs r0, 0x11 + bx lr + thumb_func_end sub_80871C0 + + thumb_func_start sub_80871C4 +sub_80871C4: @ 80871C4 + push {lr} + ldr r1, =0x03000e10 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x83 + beq _080871D4 + bl sub_8086C64 +_080871D4: + movs r0, 0x83 + bl sub_8086CA8 + cmp r0, 0x1 + bne _080871EA + ldr r0, =gUnknown_08277513 + bl script_env_1_execute_new_script + ldr r0, =sub_80871C0 + bl c1_link_related_func_set +_080871EA: + movs r0, 0x11 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80871C4 + + thumb_func_start sub_80871FC +sub_80871FC: @ 80871FC + push {lr} + ldr r0, =sub_80871C4 + bl c1_link_related_func_set + movs r0, 0x17 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80871FC + + thumb_func_start sub_8087210 +sub_8087210: @ 8087210 + movs r0, 0x11 + bx lr + thumb_func_end sub_8087210 + + thumb_func_start sub_8087214 +sub_8087214: @ 8087214 + push {lr} + movs r0, 0x83 + bl sub_8086CE0 + cmp r0, 0x1 + beq _08087250 + ldr r0, =0x03000e14 + ldr r2, [r0] + ldr r1, =sub_8087170 + adds r3, r0, 0 + cmp r2, r1 + bne _0808723A + ldr r1, =0x03000e10 + ldr r0, =0x03005db4 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x82 + bne _08087272 +_0808723A: + ldr r1, [r3] + ldr r0, =sub_8087164 + cmp r1, r0 + bne _08087268 + ldr r1, =0x03000e10 + ldr r0, =0x03005db4 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x81 + bne _08087268 +_08087250: + movs r0, 0x2 + b _08087278 + .pool +_08087268: + movs r0, 0x82 + bl sub_8086CA8 + cmp r0, 0 + bne _08087276 +_08087272: + movs r0, 0 + b _08087278 +_08087276: + movs r0, 0x1 +_08087278: + pop {r1} + bx r1 + thumb_func_end sub_8087214 + + thumb_func_start sub_808727C +sub_808727C: @ 808727C + push {lr} + movs r0, 0x83 + bl sub_8086CE0 + pop {r1} + bx r1 + thumb_func_end sub_808727C + + thumb_func_start sub_8087288 +sub_8087288: @ 8087288 + push {lr} + ldr r0, =sub_80871AC + bl c1_link_related_func_set + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8087288 + + thumb_func_start sub_808729C +sub_808729C: @ 808729C + push {lr} + ldr r0, =sub_80870F8 + bl c1_link_related_func_set + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_808729C + + thumb_func_start sub_80872B0 +sub_80872B0: @ 80872B0 + push {lr} + ldr r0, =sub_80871FC + bl c1_link_related_func_set + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80872B0 + + thumb_func_start sub_80872C4 +sub_80872C4: @ 80872C4 + push {lr} + ldr r0, =sub_8087210 + bl c1_link_related_func_set + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80872C4 + + thumb_func_start sub_80872D8 +sub_80872D8: @ 80872D8 + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r6, r2, 0 + strb r4, [r6] + movs r0, 0 + cmp r4, r1 + bne _080872EA + movs r0, 0x1 +_080872EA: + strb r0, [r6, 0x1] + ldr r1, =0x02032308 + lsls r0, r4, 2 + adds r0, r1 + ldrb r0, [r0, 0x3] + strb r0, [r6, 0x2] + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_80878A0 + strb r0, [r6, 0x3] + mov r5, sp + adds r5, 0x2 + adds r0, r4, 0 + mov r1, sp + adds r2, r5, 0 + bl sub_8087878 + mov r0, sp + ldrh r0, [r0] + strh r0, [r6, 0x4] + ldrh r0, [r5] + strh r0, [r6, 0x6] + adds r0, r4, 0 + bl sub_80878C0 + strb r0, [r6, 0x8] + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + strh r0, [r6, 0xC] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80872D8 + + thumb_func_start sub_8087340 +sub_8087340: @ 8087340 + push {lr} + ldrb r0, [r0, 0x2] + cmp r0, 0x2 + beq _0808734C + cmp r0, 0 + bne _08087350 +_0808734C: + movs r0, 0x1 + b _08087352 +_08087350: + movs r0, 0 +_08087352: + pop {r1} + bx r1 + thumb_func_end sub_8087340 + + thumb_func_start sub_8087358 +sub_8087358: @ 8087358 + push {lr} + ldrb r0, [r0, 0x2] + cmp r0, 0x2 + beq _08087364 + cmp r0, 0 + bne _08087368 +_08087364: + movs r0, 0x1 + b _0808736A +_08087368: + movs r0, 0 +_0808736A: + pop {r1} + bx r1 + thumb_func_end sub_8087358 + + thumb_func_start sub_8087370 +sub_8087370: @ 8087370 + push {lr} + adds r1, r0, 0 + ldrb r0, [r1, 0x2] + cmp r0, 0x2 + bne _08087382 + adds r0, r1, 0x4 + bl sub_809D0F4 + b _08087384 +_08087382: + movs r0, 0 +_08087384: + pop {r1} + bx r1 + thumb_func_end sub_8087370 + + thumb_func_start sub_8087388 +sub_8087388: @ 8087388 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x2] + cmp r0, 0x2 + beq _08087396 + cmp r0, 0 + bne _080873AC +_08087396: + ldrb r0, [r4, 0xC] + bl MetatileBehavior_IsSouthArrowWarp + lsls r0, 24 + cmp r0, 0 + beq _080873AC + ldrb r0, [r4, 0x3] + cmp r0, 0x1 + bne _080873AC + movs r0, 0x1 + b _080873AE +_080873AC: + movs r0, 0 +_080873AE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8087388 + + thumb_func_start sub_80873B4 +sub_80873B4: @ 80873B4 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldrb r0, [r4, 0x2] + cmp r0, 0 + beq _080873C8 + cmp r0, 0x2 + beq _080873C8 + movs r0, 0 + b _08087476 +_080873C8: + ldr r0, [r4, 0x4] + ldr r1, [r4, 0x8] + str r0, [sp] + str r1, [sp, 0x4] + ldr r3, =gUnknown_08339D64 + ldrb r0, [r4, 0x3] + lsls r0, 3 + adds r0, r3 + ldr r0, [r0] + mov r1, sp + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0xffff0000 + ldr r2, [sp] + ands r2, r1 + orrs r2, r0 + str r2, [sp] + asrs r1, r2, 16 + ldrb r0, [r4, 0x3] + lsls r0, 3 + adds r3, 0x4 + adds r0, r3 + ldr r0, [r0] + adds r0, r1 + lsls r0, 16 + ldr r1, =0x0000ffff + ands r1, r2 + orrs r1, r0 + str r1, [sp] + ldr r2, =0xffffff00 + ldr r0, [sp, 0x4] + ands r0, r2 + str r0, [sp, 0x4] + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + asrs r1, 16 + bl sub_808790C + lsls r0, 24 + lsrs r1, r0, 24 + adds r2, r1, 0 + cmp r1, 0x4 + beq _0808746C + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _08087434 + ldr r0, =0x03000e10 + adds r0, r1, r0 + ldrb r0, [r0] + cmp r0, 0x80 + beq _08087450 +_08087434: + ldr r0, =gUnknown_0827749C + b _08087476 + .pool +_08087450: + adds r0, r2, 0 + bl sub_80B39D4 + cmp r0, 0 + bne _08087464 + ldr r0, =gUnknown_0827747E + b _08087476 + .pool +_08087464: + ldr r0, =gUnknown_0827748D + b _08087476 + .pool +_0808746C: + ldrb r1, [r4, 0xC] + ldrb r2, [r4, 0x3] + mov r0, sp + bl sub_809C2C8 +_08087476: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80873B4 + + thumb_func_start sub_8087480 +sub_8087480: @ 8087480 + push {lr} + adds r1, r0, 0 + ldr r0, =gUnknown_08277388 + cmp r1, r0 + beq _080874C6 + ldr r0, =gUnknown_082773A3 + cmp r1, r0 + beq _08087508 + ldr r0, =gUnknown_082773BE + cmp r1, r0 + beq _080874C6 + ldr r0, =gUnknown_082773D9 + cmp r1, r0 + beq _08087508 + ldr r0, =gUnknown_0827741D + cmp r1, r0 + beq _080874C6 + ldr r0, =gUnknown_08277432 + cmp r1, r0 + beq _08087508 + ldr r0, =gUnknown_08277447 + cmp r1, r0 + beq _080874C6 + ldr r0, =gUnknown_0827745C + cmp r1, r0 + beq _08087508 + ldr r0, =gUnknown_08277374 + cmp r1, r0 + beq _080874C6 + ldr r0, =gUnknown_0827737E + cmp r1, r0 + beq _08087508 + ldr r0, =gUnknown_082773F5 + cmp r1, r0 + bne _080874F8 +_080874C6: + movs r0, 0xA + b _0808750A + .pool +_080874F8: + ldr r0, =gUnknown_082773FF + cmp r1, r0 + beq _08087508 + movs r0, 0 + b _0808750A + .pool +_08087508: + movs r0, 0x9 +_0808750A: + pop {r1} + bx r1 + thumb_func_end sub_8087480 + + thumb_func_start sub_8087510 +sub_8087510: @ 8087510 + push {lr} + bl script_env_2_enable + pop {r0} + bx r0 + thumb_func_end sub_8087510 + + thumb_func_start sub_808751C +sub_808751C: @ 808751C + push {lr} + movs r0, 0x6 + bl audio_play + bl sub_809FA9C + bl script_env_2_enable + pop {r0} + bx r0 + thumb_func_end sub_808751C + + thumb_func_start sub_8087530 +sub_8087530: @ 8087530 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl script_env_1_execute_new_script + bl script_env_2_enable + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8087530 + + thumb_func_start sub_808754C +sub_808754C: @ 808754C + push {lr} + movs r0, 0x6 + bl audio_play + ldr r0, =gUnknown_082774EF + bl script_env_1_execute_new_script + bl script_env_2_enable + pop {r0} + bx r0 + .pool + thumb_func_end sub_808754C + + thumb_func_start sub_8087568 +sub_8087568: @ 8087568 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl script_env_1_execute_new_script + bl script_env_2_enable + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8087568 + + thumb_func_start sub_8087584 +sub_8087584: @ 8087584 + push {lr} + ldr r0, =gUnknown_08277509 + bl script_env_1_execute_new_script + bl script_env_2_enable + pop {r0} + bx r0 + .pool + thumb_func_end sub_8087584 + + thumb_func_start sub_8087598 +sub_8087598: @ 8087598 + push {lr} + bl is_c1_link_related_active + cmp r0, 0 + bne _080875A6 + movs r0, 0 + b _080875C0 +_080875A6: + bl sub_800B4DC + cmp r0, 0x2 + bls _080875B8 + ldr r1, =0x03000e18 + movs r0, 0x1 + b _080875BC + .pool +_080875B8: + ldr r1, =0x03000e18 + movs r0, 0 +_080875BC: + strb r0, [r1] + ldrb r0, [r1] +_080875C0: + pop {r1} + bx r1 + .pool + thumb_func_end sub_8087598 + + thumb_func_start sub_80875C8 +sub_80875C8: @ 80875C8 + push {lr} + bl sub_800B4DC + cmp r0, 0x1 + bls _0808762C + bl is_c1_link_related_active + cmp r0, 0x1 + bne _0808762C + bl sub_8009F3C + cmp r0, 0x1 + bne _0808762C + ldr r0, =0x03000e14 + ldr r1, [r0] + ldr r0, =sub_808711C + cmp r1, r0 + beq _08087614 + ldr r0, =sub_80870F8 + cmp r1, r0 + bne _0808762C + ldr r0, =0x03000e18 + ldrb r2, [r0] + movs r1, 0 + strb r1, [r0] + cmp r2, 0x1 + beq _08087614 + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0808762C + ldrb r1, [r2, 0xA] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0808762C +_08087614: + movs r0, 0x1 + b _0808762E + .pool +_0808762C: + movs r0, 0 +_0808762E: + pop {r1} + bx r1 + thumb_func_end sub_80875C8 + + thumb_func_start sub_8087634 +sub_8087634: @ 8087634 + push {lr} + bl sub_8087690 + cmp r0, 0x1 + bls _08087658 + bl is_c1_link_related_active + cmp r0, 0x1 + bne _08087658 + bl sub_8009F3C + cmp r0, 0x1 + bne _08087658 + ldr r0, =0x03000e14 + ldr r1, [r0] + ldr r0, =sub_8087140 + cmp r1, r0 + beq _08087664 +_08087658: + movs r0, 0 + b _08087666 + .pool +_08087664: + movs r0, 0x1 +_08087666: + pop {r1} + bx r1 + thumb_func_end sub_8087634 + + thumb_func_start sub_808766C +sub_808766C: @ 808766C + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _08087688 + bl sub_8009F3C + cmp r0, 0 + beq _08087688 + movs r0, 0x1 + b _0808768A + .pool +_08087688: + movs r0, 0 +_0808768A: + pop {r1} + bx r1 + thumb_func_end sub_808766C + + thumb_func_start sub_8087690 +sub_8087690: @ 8087690 + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _080876B0 + ldr r0, =0x03003170 + ldr r1, =0x00000339 + adds r0, r1 + ldrb r0, [r0] + b _080876B8 + .pool +_080876B0: + ldr r0, =0x03005000 + ldr r1, =0x00000c1a + adds r0, r1 + ldrb r0, [r0] +_080876B8: + pop {r1} + bx r1 + .pool + thumb_func_end sub_8087690 + + thumb_func_start sub_80876C4 +sub_80876C4: @ 80876C4 + movs r1, 0 + str r1, [r0] + bx lr + thumb_func_end sub_80876C4 + + thumb_func_start strange_npc_table_clear +strange_npc_table_clear: @ 80876CC + push {lr} + ldr r0, =0x02032308 + movs r1, 0 + movs r2, 0x10 + bl memset + pop {r0} + bx r0 + .pool + thumb_func_end strange_npc_table_clear + + thumb_func_start sub_80876E0 +sub_80876E0: @ 80876E0 + push {lr} + movs r1, 0 + movs r2, 0x24 + bl memset + pop {r0} + bx r0 + thumb_func_end sub_80876E0 + + thumb_func_start sub_80876F0 +sub_80876F0: @ 80876F0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r1 + mov r10, r2 + mov r8, r3 + lsls r0, 24 + lsrs r7, r0, 24 + mov r0, r9 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + mov r1, r10 + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + mov r2, r8 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + bl sub_808D4F4 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r4, r7, 2 + ldr r0, =0x02032308 + adds r4, r0 + lsls r5, r6, 3 + adds r5, r6 + lsls r5, 2 + ldr r0, =0x02037350 + adds r5, r0 + adds r0, r4, 0 + bl sub_80876C4 + adds r0, r5, 0 + bl sub_80876E0 + movs r2, 0 + movs r1, 0x1 + movs r0, 0x1 + strb r0, [r4] + strb r7, [r4, 0x1] + strb r6, [r4, 0x2] + strb r2, [r4, 0x3] + ldrb r0, [r5] + orrs r0, r1 + mov r2, r8 + ands r2, r1 + lsls r2, 1 + movs r1, 0x3 + negs r1, r1 + ands r0, r1 + orrs r0, r2 + strb r0, [r5] + movs r0, 0x2 + strb r0, [r5, 0x19] + movs r0, 0x40 + strb r0, [r5, 0x4] + mov r0, r9 + lsls r0, 16 + asrs r0, 16 + mov r9, r0 + mov r1, r10 + lsls r1, 16 + asrs r1, 16 + mov r10, r1 + adds r0, r5, 0 + mov r1, r9 + mov r2, r10 + bl sub_808779C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80876F0 + + thumb_func_start sub_808779C +sub_808779C: @ 808779C + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + adds r1, r2, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + strh r0, [r4, 0x10] + strh r1, [r4, 0x12] + strh r0, [r4, 0x14] + strh r1, [r4, 0x16] + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + adds r2, r4, 0 + adds r2, 0xC + adds r3, r4, 0 + adds r3, 0xE + bl sub_8093038 + ldrh r0, [r4, 0xC] + adds r0, 0x8 + strh r0, [r4, 0xC] + adds r0, r4, 0 + bl FieldObjectUpdateZCoord + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_808779C + + thumb_func_start sub_80877DC +sub_80877DC: @ 80877DC + push {lr} + lsls r0, 24 + lsls r1, 24 + lsrs r2, r1, 24 + ldr r1, =0x02032308 + lsrs r0, 22 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + beq _080877FE + ldrb r0, [r1, 0x2] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02037350 + adds r1, r0 + strb r2, [r1, 0x19] +_080877FE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80877DC + + thumb_func_start sub_808780C +sub_808780C: @ 808780C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 22 + ldr r1, =0x02032308 + adds r5, r0, r1 + ldrb r1, [r5, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + ldrb r0, [r4, 0x4] + cmp r0, 0x40 + beq _08087838 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles +_08087838: + movs r0, 0 + strb r0, [r5] + ldrb r1, [r4] + subs r0, 0x2 + ands r0, r1 + strb r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808780C + + thumb_func_start sub_8087858 +sub_8087858: @ 8087858 + lsls r0, 24 + ldr r1, =0x02032308 + lsrs r0, 22 + adds r0, r1 + ldrb r1, [r0, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldrb r0, [r0, 0x4] + bx lr + .pool + thumb_func_end sub_8087858 + + thumb_func_start sub_8087878 +sub_8087878: @ 8087878 + lsls r0, 24 + ldr r3, =0x02032308 + lsrs r0, 22 + adds r0, r3 + ldrb r3, [r0, 0x2] + lsls r0, r3, 3 + adds r0, r3 + lsls r0, 2 + ldr r3, =0x02037350 + adds r0, r3 + ldrh r3, [r0, 0x10] + strh r3, [r1] + ldrh r0, [r0, 0x12] + strh r0, [r2] + bx lr + .pool + thumb_func_end sub_8087878 + + thumb_func_start sub_80878A0 +sub_80878A0: @ 80878A0 + lsls r0, 24 + ldr r1, =0x02032308 + lsrs r0, 22 + adds r0, r1 + ldrb r1, [r0, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldrb r0, [r0, 0x19] + bx lr + .pool + thumb_func_end sub_80878A0 + + thumb_func_start sub_80878C0 +sub_80878C0: @ 80878C0 + lsls r0, 24 + ldr r1, =0x02032308 + lsrs r0, 22 + adds r0, r1 + ldrb r1, [r0, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldrb r0, [r0, 0xB] + lsls r0, 28 + lsrs r0, 28 + bx lr + .pool + thumb_func_end sub_80878C0 + + thumb_func_start sub_80878E4 +sub_80878E4: @ 80878E4 + lsls r0, 24 + ldr r1, =0x02032308 + lsrs r0, 22 + adds r0, r1 + ldrb r1, [r0, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + adds r0, 0x21 + movs r1, 0 + ldrsb r1, [r0, r1] + movs r0, 0x10 + subs r0, r1 + bx lr + .pool + thumb_func_end sub_80878E4 + + thumb_func_start sub_808790C +sub_808790C: @ 808790C + push {r4-r6,lr} + movs r2, 0 + ldr r5, =0x02032308 + lsls r0, 16 + asrs r4, r0, 16 + lsls r1, 16 + asrs r3, r1, 16 +_0808791A: + lsls r0, r2, 2 + adds r1, r0, r5 + ldrb r0, [r1] + cmp r0, 0 + beq _08087958 + ldrb r0, [r1, 0x3] + cmp r0, 0 + beq _0808792E + cmp r0, 0x2 + bne _08087958 +_0808792E: + ldrb r1, [r1, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r1, r0, r1 + movs r6, 0x10 + ldrsh r0, [r1, r6] + cmp r0, r4 + bne _08087958 + movs r6, 0x12 + ldrsh r0, [r1, r6] + cmp r0, r3 + bne _08087958 + adds r0, r2, 0 + b _08087964 + .pool +_08087958: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _0808791A + movs r0, 0x4 +_08087964: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808790C + + thumb_func_start sub_808796C +sub_808796C: @ 808796C + push {r4-r6,lr} + lsls r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + adds r2, r3, 0 + lsrs r0, 22 + ldr r1, =0x02032308 + adds r5, r0, r1 + ldrb r1, [r5, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r6, r0, r1 + ldrb r0, [r5] + cmp r0, 0 + beq _080879C8 + cmp r3, 0xA + bls _080879A4 + ldrb r0, [r6] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r6] + b _080879C8 + .pool +_080879A4: + ldr r4, =gUnknown_08339E00 + ldr r1, =gUnknown_08339DC8 + ldrb r0, [r5, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r3, [r0] + adds r0, r5, 0 + adds r1, r6, 0 + bl _call_via_r3 + lsls r0, 24 + lsrs r0, 22 + adds r0, r4 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r6, 0 + bl _call_via_r2 +_080879C8: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_808796C + + thumb_func_start sub_80879D8 +sub_80879D8: @ 80879D8 + push {r4,lr} + lsls r2, 24 + lsrs r2, 24 + ldr r4, =gUnknown_08339DD4 + lsls r3, r2, 2 + adds r3, r4 + ldr r3, [r3] + bl _call_via_r3 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80879D8 + + thumb_func_start sub_80879F8 +sub_80879F8: @ 80879F8 + movs r0, 0x1 + bx lr + thumb_func_end sub_80879F8 + + thumb_func_start sub_80879FC +sub_80879FC: @ 80879FC + push {r4,lr} + lsls r2, 24 + lsrs r2, 24 + ldr r4, =gUnknown_08339DD4 + lsls r3, r2, 2 + adds r3, r4 + ldr r3, [r3] + bl _call_via_r3 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80879FC + + thumb_func_start sub_8087A1C +sub_8087A1C: @ 8087A1C + movs r0, 0 + bx lr + thumb_func_end sub_8087A1C + + thumb_func_start sub_8087A20 +sub_8087A20: @ 8087A20 + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r0, r2, 24 + lsrs r0, 24 + ldrb r1, [r5, 0x19] + bl npc_something3 + strb r0, [r5, 0x19] + ldrb r1, [r5, 0x19] + mov r6, sp + adds r6, 0x2 + adds r0, r5, 0 + mov r2, sp + adds r3, r6, 0 + bl FieldObjectMoveDestCoords + ldrb r0, [r4, 0x2] + ldrb r1, [r5, 0x19] + mov r2, sp + movs r3, 0 + ldrsh r2, [r2, r3] + movs r4, 0 + ldrsh r3, [r6, r4] + bl npc_080587EC + lsls r0, 24 + cmp r0, 0 + bne _08087A7E + adds r1, r5, 0 + adds r1, 0x21 + movs r0, 0x10 + strb r0, [r1] + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r3, 0 + ldrsh r2, [r6, r3] + adds r0, r5, 0 + bl npc_coords_shift + adds r0, r5, 0 + bl FieldObjectUpdateZCoord + movs r0, 0x1 + b _08087A80 +_08087A7E: + movs r0, 0 +_08087A80: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8087A20 + + thumb_func_start sub_8087A88 +sub_8087A88: @ 8087A88 + push {r4,lr} + adds r4, r1, 0 + lsls r0, r2, 24 + lsrs r0, 24 + ldrb r1, [r4, 0x19] + bl npc_something3 + strb r0, [r4, 0x19] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8087A88 + + thumb_func_start sub_8087AA0 +sub_8087AA0: @ 8087AA0 + movs r1, 0 + strb r1, [r0, 0x3] + bx lr + thumb_func_end sub_8087AA0 + + thumb_func_start sub_8087AA8 +sub_8087AA8: @ 8087AA8 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r4, 0 + adds r5, 0x21 + ldrb r0, [r5] + subs r0, 0x1 + strb r0, [r5] + movs r0, 0x1 + strb r0, [r6, 0x3] + ldrb r0, [r4, 0x19] + adds r1, 0xC + adds r2, r4, 0 + adds r2, 0xE + bl MoveCoords + ldrb r0, [r5] + cmp r0, 0 + bne _08087AD8 + adds r0, r4, 0 + bl npc_coords_shift_still + movs r0, 0x2 + strb r0, [r6, 0x3] +_08087AD8: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8087AA8 + + thumb_func_start npc_something3 +npc_something3: @ 8087AE0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r2, r1, 24 + subs r0, 0x1 + cmp r0, 0x9 + bhi _08087B38 + lsls r0, 2 + ldr r1, =_08087B00 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08087B00: + .4byte _08087B28 + .4byte _08087B2C + .4byte _08087B30 + .4byte _08087B34 + .4byte _08087B38 + .4byte _08087B38 + .4byte _08087B28 + .4byte _08087B2C + .4byte _08087B30 + .4byte _08087B34 +_08087B28: + movs r0, 0x2 + b _08087B3A +_08087B2C: + movs r0, 0x1 + b _08087B3A +_08087B30: + movs r0, 0x3 + b _08087B3A +_08087B34: + movs r0, 0x4 + b _08087B3A +_08087B38: + adds r0, r2, 0 +_08087B3A: + pop {r1} + bx r1 + thumb_func_end npc_something3 + + thumb_func_start npc_080587EC +npc_080587EC: @ 8087B40 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r2, 16 + lsrs r2, 16 + mov r12, r2 + lsls r3, 16 + movs r4, 0 + ldr r0, =0x02037350 + mov r9, r0 + lsrs r2, r3, 16 + mov r10, r2 + asrs r6, r3, 16 +_08087B64: + mov r7, r12 + lsls r3, r7, 16 + mov r0, r10 + lsls r5, r0, 16 + cmp r4, r8 + beq _08087BA8 + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + mov r2, r9 + adds r1, r0, r2 + movs r7, 0x10 + ldrsh r0, [r1, r7] + asrs r2, r3, 16 + cmp r0, r2 + bne _08087B8C + movs r7, 0x12 + ldrsh r0, [r1, r7] + cmp r0, r6 + beq _08087B9E +_08087B8C: + movs r7, 0x14 + ldrsh r0, [r1, r7] + cmp r0, r2 + bne _08087BA8 + movs r0, 0x16 + ldrsh r1, [r1, r0] + asrs r0, r5, 16 + cmp r1, r0 + bne _08087BA8 +_08087B9E: + movs r0, 0x1 + b _08087BBE + .pool +_08087BA8: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _08087B64 + asrs r0, r3, 16 + asrs r1, r5, 16 + bl MapGridIsImpassableAt + lsls r0, 24 + lsrs r0, 24 +_08087BBE: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end npc_080587EC + + thumb_func_start sub_8087BCC +sub_8087BCC: @ 8087BCC + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r2, r5, 2 + ldr r0, =0x02032308 + adds r2, r0 + ldrb r1, [r2, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + ldrb r0, [r2] + cmp r0, 0 + beq _08087C7A + subs r0, r3, 0x1 + cmp r0, 0x4 + bhi _08087C56 + lsls r0, 2 + ldr r1, =_08087C0C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08087C0C: + .4byte _08087C2C + .4byte _08087C2C + .4byte _08087C38 + .4byte _08087C20 + .4byte _08087C20 +_08087C20: + ldrb r0, [r4] + lsls r0, 30 + lsrs r0, 31 + bl sub_808BD6C + b _08087C44 +_08087C2C: + ldrb r0, [r4] + lsls r0, 30 + lsrs r0, 31 + bl sub_808BD7C + b _08087C44 +_08087C38: + ldrb r1, [r4] + lsls r1, 30 + lsrs r1, 31 + movs r0, 0 + bl sub_808BD3C +_08087C44: + lsls r0, 24 + lsrs r0, 24 + ldr r1, =sub_8087C8C + movs r2, 0 + str r2, [sp] + movs r3, 0 + bl AddPseudoFieldObject + strb r0, [r4, 0x4] +_08087C56: + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r3] + strh r5, [r0, 0x2E] + ldrb r1, [r4] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r4] +_08087C7A: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8087BCC + + thumb_func_start sub_8087C8C +sub_8087C8C: @ 8087C8C + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0x2E + ldrsh r4, [r5, r0] + lsls r4, 2 + ldr r0, =0x02032308 + adds r4, r0 + ldrb r1, [r4, 0x2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r6, r0, r1 + ldrh r0, [r6, 0xC] + strh r0, [r5, 0x20] + ldrh r0, [r6, 0xE] + strh r0, [r5, 0x22] + ldrb r0, [r6, 0xB] + lsrs r0, 4 + adds r1, r5, 0 + movs r2, 0x1 + bl SetObjectSubpriorityByZCoord + ldrb r0, [r6, 0xB] + lsrs r0, 4 + bl ZCoordToPriority + movs r1, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r5, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + ldrb r0, [r4, 0x3] + cmp r0, 0 + bne _08087CF8 + ldrb r0, [r6, 0x19] + bl FieldObjectDirectionToImageAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl StartObjectImageAnim + b _08087D0A + .pool +_08087CF8: + ldrb r0, [r6, 0x19] + bl get_go_image_anim_num + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl StartObjectImageAnimIfDifferent +_08087D0A: + adds r0, r5, 0 + movs r1, 0 + bl sub_80979D4 + ldrb r0, [r6] + lsls r0, 29 + cmp r0, 0 + bge _08087D3C + ldrh r0, [r5, 0x3C] + movs r1, 0x4 + ands r1, r0 + lsls r1, 16 + adds r3, r5, 0 + adds r3, 0x3E + lsrs r1, 18 + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + ldrh r0, [r5, 0x3C] + adds r0, 0x1 + strh r0, [r5, 0x3C] +_08087D3C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8087C8C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom5.s b/asm/rom5.s new file mode 100644 index 000000000..5f2745129 --- /dev/null +++ b/asm/rom5.s @@ -0,0 +1,1961 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start nullsub_35 +nullsub_35: @ 80A92F4 + bx lr + thumb_func_end nullsub_35 + + thumb_func_start sub_80A92F8 +sub_80A92F8: @ 80A92F8 + push {lr} + ldr r2, =0x02037fd4 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + ldr r0, =0x02024474 + adds r2, r0, 0 + adds r2, 0x21 + movs r1, 0 + strb r1, [r2] + adds r0, 0x22 + strb r1, [r0] + ldr r0, =c2_80777E8 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A92F8 + + thumb_func_start c2_80777E8 +c2_80777E8: @ 80A933C + push {r4-r7,lr} + sub sp, 0x8 + ldr r0, =0x02024474 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x13 + bls _080A934C + b _080A95A4 +_080A934C: + lsls r0, 2 + ldr r1, =_080A9360 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080A9360: + .4byte _080A93B0 + .4byte _080A942C + .4byte _080A9444 + .4byte _080A944A + .4byte _080A9450 + .4byte _080A9460 + .4byte _080A9466 + .4byte _080A948E + .4byte _080A9492 + .4byte _080A9496 + .4byte _080A949A + .4byte _080A94B8 + .4byte _080A94C0 + .4byte _080A94C8 + .4byte _080A94D0 + .4byte _080A94D8 + .4byte _080A94E0 + .4byte _080A94E8 + .4byte _080A94F0 + .4byte _080A94F8 +_080A93B0: + bl dp12_8087EA4 + bl trs_config + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl SetBgAttribute + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + bl SetBgAttribute + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + bl sub_80A1A74 + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r0, =0x02022e18 + strh r1, [r0] + ldr r0, =0x02022e1a + strh r1, [r0] + ldr r0, =0x02022e1c + strh r1, [r0] + ldr r0, =0x02022e1e + strh r1, [r0] + ldr r0, =0x02022e20 + strh r1, [r0] + ldr r0, =0x02022e22 + strh r1, [r0] + b _080A95D2 + .pool +_080A942C: + movs r0, 0 + str r0, [sp, 0x4] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x01006000 + add r0, sp, 0x4 + bl CpuFastSet + b _080A95D2 + .pool +_080A9444: + bl sub_8035AA4 + b _080A95D2 +_080A944A: + bl ResetAllObjectData + b _080A95D2 +_080A9450: + bl ResetObjectPaletteAllocator + ldr r1, =0x0300301c + movs r0, 0x4 + strb r0, [r1] + b _080A95D2 + .pool +_080A9460: + bl sub_805E350 + b _080A95D2 +_080A9466: + ldr r5, =0x02024474 + adds r4, r5, 0 + adds r4, 0x22 + ldrb r0, [r4] + bl sub_805E08C + lsls r0, 24 + cmp r0, 0 + beq _080A9484 + movs r0, 0 + strb r0, [r4] + b _080A95D2 + .pool +_080A9484: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + adds r1, r5, 0 + b _080A94AA +_080A948E: + movs r0, 0 + b _080A949C +_080A9492: + movs r0, 0x1 + b _080A949C +_080A9496: + movs r0, 0x2 + b _080A949C +_080A949A: + movs r0, 0x3 +_080A949C: + bl sub_80A9614 + lsls r0, 24 + cmp r0, 0 + beq _080A94A8 + b _080A95D2 +_080A94A8: + ldr r1, =0x02024474 +_080A94AA: + adds r1, 0x21 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + b _080A95D2 + .pool +_080A94B8: + movs r0, 0 + bl sub_80A9708 + b _080A95D2 +_080A94C0: + movs r0, 0x1 + bl sub_80A9708 + b _080A95D2 +_080A94C8: + movs r0, 0x2 + bl sub_80A9708 + b _080A95D2 +_080A94D0: + movs r0, 0x3 + bl sub_80A9708 + b _080A95D2 +_080A94D8: + movs r0, 0 + bl sub_80A9ADC + b _080A95D2 +_080A94E0: + movs r0, 0x1 + bl sub_80A9ADC + b _080A95D2 +_080A94E8: + movs r0, 0x2 + bl sub_80A9ADC + b _080A95D2 +_080A94F0: + movs r0, 0x3 + bl sub_80A9ADC + b _080A95D2 +_080A94F8: + bl sub_805EC84 + movs r0, 0x1 + bl battle_get_side_with_given_state + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r7, =0x0202406e + lsls r0, r4, 1 + adds r0, r7 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x02024744 + adds r0, r5 + movs r1, 0xB + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_805EE54 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _080A955C + movs r0, 0x3 + bl battle_get_side_with_given_state + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0xB + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_805EE54 +_080A955C: + ldr r1, =0x020244ac + ldr r0, =0x020244b8 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_8059CB4 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _080A95D2 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _080A95D2 + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _080A95D2 + .pool +_080A95A4: + ldr r0, =vblank_cb_08078BB4 + bl SetVBlankCallback + bl sub_80A95F4 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A27B0 + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + ldr r0, =sub_8038420 + bl SetMainCallback2 + bl sub_805EF14 +_080A95D2: + ldr r1, =0x02024474 + adds r1, 0x21 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end c2_80777E8 + + thumb_func_start sub_80A95F4 +sub_80A95F4: @ 80A95F4 + ldr r3, =0x0400000a + ldrb r2, [r3] + movs r1, 0xD + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3] + ldr r2, =0x0400000c + ldrb r0, [r2] + ands r1, r0 + strb r1, [r2] + bx lr + .pool + thumb_func_end sub_80A95F4 + + thumb_func_start sub_80A9614 +sub_80A9614: @ 80A9614 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + bcs _080A96FC + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A9676 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r4, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080A966C + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + adds r1, r4, 0 + bl sub_805DC0C + b _080A96F4 + .pool +_080A966C: + adds r0, r4, 0 + movs r1, 0 + bl sub_805E7DC + b _080A96F4 +_080A9676: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r2, 0x80 + ands r1, r2 + cmp r1, 0 + beq _080A9698 + cmp r4, 0 + bne _080A9698 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + b _080A96AA + .pool +_080A9698: + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 2 + ands r0, r1 + cmp r0, 0 + beq _080A96B2 + cmp r4, 0 + bne _080A96B2 + movs r0, 0x6 +_080A96AA: + movs r1, 0 + bl sub_805DF84 + b _080A96F4 +_080A96B2: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r4, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080A96EC + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + adds r1, r4, 0 + bl sub_805DD7C + b _080A96F4 + .pool +_080A96EC: + adds r0, r4, 0 + movs r1, 0 + bl sub_805E7DC +_080A96F4: + ldr r0, =0x02024474 + adds r0, 0x22 + movs r1, 0 + strb r1, [r0] +_080A96FC: + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A9614 + + thumb_func_start sub_80A9708 +sub_80A9708: @ 80A9708 + 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, =0x0202406c + ldrb r0, [r0] + cmp r7, r0 + bcc _080A9722 + b _080A9AA0 +_080A9722: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + lsls r2, r7, 2 + adds r0, r2, r0 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + str r2, [sp] + cmp r0, 0 + beq _080A9748 + adds r0, r7, 0 + bl sub_80A614C + b _080A974E + .pool +_080A9748: + adds r0, r7, 0 + bl sub_80A6138 +_080A974E: + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + adds r0, r7, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080A9762 + b _080A986C +_080A9762: + ldr r1, =0x0202406e + lsls r0, r7, 1 + adds r6, r0, r1 + ldrh r0, [r6] + movs r1, 0x64 + mov r10, r1 + mov r2, r10 + muls r2, r0 + adds r0, r2, 0 + ldr r1, =0x02024744 + mov r9, r1 + add r0, r9 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _080A9786 + b _080A9AA0 +_080A9786: + ldrh r0, [r6] + mov r2, r10 + muls r2, r0 + adds r0, r2, 0 + add r0, r9 + movs r1, 0xB + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r7, 0 + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_806A068 + ldr r5, =0x0202499c + adds r0, r7, 0 + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r7, 0 + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r5, 0 + adds r1, r4, 0 + mov r2, r8 + bl AddObjectToFront + ldr r1, =0x020241e4 + adds r4, r7, r1 + strb r0, [r4] + ldr r5, =0x02020630 + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + lsls r3, r7, 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 r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =DummyObjectCallback + str r1, [r0] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r7, [r0, 0x2E] + ldrh r0, [r6] + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + add r0, r9 + movs r1, 0xB + bl pokemon_getattr + ldrb r2, [r4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r5 + strh r0, [r1, 0x32] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x020244e4 + adds r1, r7, r1 + ldrb r1, [r1] + bl StartObjectImageAnim + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + ldr r2, [sp] + adds r0, r2, r0 + b _080A9A50 + .pool +_080A986C: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r2, 0x80 + ands r1, r2 + cmp r1, 0 + beq _080A98D0 + cmp r7, 0 + bne _080A98D0 + ldr r5, =0x03005d90 + ldr r0, [r5] + ldrb r4, [r0, 0x8] + movs r0, 0 + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl template_build_for_pokemon_or_trainer + ldr r6, =0x0202499c + ldr r1, =gUnknown_08305D2C + ldr r0, [r5] + ldrb r0, [r0, 0x8] + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0] + movs r4, 0x8 + subs r4, r0 + lsls r4, 18 + movs r0, 0xA0 + lsls r0, 15 + adds r4, r0 + asrs r4, 16 + movs r0, 0 + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r6, 0 + b _080A9914 + .pool +_080A98D0: + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 2 + ands r0, r1 + cmp r0, 0 + beq _080A9968 + cmp r7, 0 + bne _080A9968 + movs r0, 0 + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x6 + bl template_build_for_pokemon_or_trainer + ldr r5, =0x0202499c + ldr r0, =gUnknown_08305D2C + ldrb r0, [r0, 0x18] + movs r4, 0x8 + subs r4, r0 + lsls r4, 18 + movs r1, 0xA0 + lsls r1, 15 + adds r4, r1 + asrs r4, 16 + movs r0, 0 + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r5, 0 +_080A9914: + movs r1, 0x50 + adds r2, r4, 0 + bl AddObjectToFront + ldr r3, =0x020241e4 + strb r0, [r3] + ldr r4, =0x02020630 + ldrb r0, [r3] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + strb r0, [r1, 0x5] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =DummyObjectCallback + str r1, [r0] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r7, [r0, 0x2E] + b _080A9A70 + .pool +_080A9968: + ldr r1, =0x0202406e + lsls r0, r7, 1 + adds r6, r0, r1 + ldrh r0, [r6] + movs r2, 0x64 + mov r10, r2 + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + ldr r2, =0x020244ec + mov r9, r2 + add r0, r9 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _080A998C + b _080A9AA0 +_080A998C: + ldrh r0, [r6] + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + add r0, r9 + movs r1, 0xB + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r7, 0 + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_806A068 + ldr r5, =0x0202499c + adds r0, r7, 0 + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r7, 0 + bl sub_80A82E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r5, 0 + adds r1, r4, 0 + mov r2, r8 + bl AddObjectToFront + ldr r1, =0x020241e4 + adds r4, r7, r1 + strb r0, [r4] + ldr r5, =0x02020630 + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + lsls r3, r7, 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 r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =DummyObjectCallback + str r1, [r0] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r7, [r0, 0x2E] + ldrh r0, [r6] + mov r2, r10 + muls r2, r0 + adds r0, r2, 0 + add r0, r9 + movs r1, 0xB + bl pokemon_getattr + ldrb r2, [r4] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r5 + strh r0, [r1, 0x32] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x020244e4 + adds r1, r7, r1 + ldrb r1, [r1] + bl StartObjectImageAnim + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + ldr r1, [sp] + adds r0, r1, r0 +_080A9A50: + ldrh r1, [r0, 0x2] + ldr r0, =0x00000181 + cmp r1, r0 + bne _080A9A70 + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r0, r5, 0 + adds r0, 0x8 + adds r1, r0 + ldr r0, =gUnknown_08309AAC + ldr r2, =0x00000604 + adds r0, r2 + ldr r0, [r0] + str r0, [r1] +_080A9A70: + ldr r1, =0x02020630 + ldr r0, =0x020241e4 + adds r0, r7, r0 + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + ldr r1, [sp] + adds r0, r1, r0 + ldr r1, [r0] + lsls r1, 31 + adds r2, 0x3E + lsrs r1, 31 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] +_080A9AA0: + 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_80A9708 + + thumb_func_start sub_80A9ADC +sub_80A9ADC: @ 80A9ADC + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + bcc _080A9AEC + b _080A9C5E +_080A9AEC: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r2, 0x80 + ands r1, r2 + cmp r1, 0 + beq _080A9B0C + cmp r5, 0 + bne _080A9B0C + bl battle_make_oam_safari_battle + b _080A9B24 + .pool +_080A9B0C: + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 2 + ands r0, r1 + cmp r0, 0 + beq _080A9B1E + cmp r5, 0 + bne _080A9B1E + b _080A9C5E +_080A9B1E: + adds r0, r5, 0 + bl battle_make_oam_normal_battle +_080A9B24: + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x03005d70 + adds r4, r5, r0 + strb r6, [r4] + adds r0, r5, 0 + bl sub_8072B18 + adds r0, r6, 0 + bl sub_80729D0 + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A9B6C + ldrb r0, [r4] + ldr r1, =0x0202406e + lsls r4, r5, 1 + adds r1, r4, r1 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + b _080A9BB8 + .pool +_080A9B6C: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080A9BA0 + ldrb r0, [r4] + ldr r1, =0x0202406e + lsls r4, r5, 1 + adds r1, r4, r1 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0xA + bl healthbar_draw_field_maybe + b _080A9BB8 + .pool +_080A9BA0: + ldrb r0, [r4] + ldr r1, =0x0202406e + lsls r4, r5, 1 + adds r1, r4, r1 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe +_080A9BB8: + adds r0, r5, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _080A9BD4 + adds r0, r5, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _080A9BF0 +_080A9BD4: + ldr r0, =0x03005d70 + adds r0, r5, r0 + ldrb r0, [r0] + movs r1, 0x1 + bl nullsub_30 + b _080A9BFC + .pool +_080A9BF0: + ldr r0, =0x03005d70 + adds r0, r5, r0 + ldrb r0, [r0] + movs r1, 0 + bl nullsub_30 +_080A9BFC: + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A9C34 + ldr r0, =0x0202406e + adds r0, r4, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _080A9C5E + adds r0, r6, 0 + bl sub_8072984 + b _080A9C5E + .pool +_080A9C34: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080A9C5E + ldr r0, =0x0202406e + adds r0, r4, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _080A9C5E + adds r0, r6, 0 + bl sub_8072984 +_080A9C5E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A9ADC + + thumb_func_start sub_80A9C70 +sub_80A9C70: @ 80A9C70 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =0x020241e4 + adds r0, r4, r0 + ldrb r6, [r0] + ldr r0, =sub_80A9DB4 + movs r1, 0xA + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =gUnknown_08524F84 + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_0852588C + bl LoadCompressedObjectPaletteUsingHeap + ldr r1, =0x03005e00 + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r1, r0, r1 + strh r4, [r1, 0x8] + cmp r5, 0 + beq _080A9D30 + movs r0, 0x1F + strh r0, [r1, 0xA] + movs r5, 0 + lsls r0, r6, 4 + ldr r7, =0x02020630 + adds r0, r6 + lsls r0, 2 + adds r6, r0, r7 +_080A9CC4: + movs r0, 0x20 + ldrsh r1, [r6, r0] + ldrh r2, [r6, 0x22] + adds r2, 0x20 + lsls r2, 16 + asrs r2, 16 + ldr r0, =gUnknown_0853EF60 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r3, r0, r7 + lsls r0, r5, 1 + adds r0, r5 + lsls r1, r0, 4 + adds r0, r1 + strh r0, [r3, 0x2E] + movs r0, 0xFF + lsls r0, 8 + strh r0, [r3, 0x30] + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + cmp r5, 0x4 + bls _080A9D08 + movs r0, 0x15 + strh r0, [r3, 0x3A] +_080A9D08: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _080A9CC4 + b _080A9D90 + .pool +_080A9D30: + movs r0, 0xF8 + lsls r0, 7 + strh r0, [r1, 0xA] + movs r5, 0 + lsls r0, r6, 4 + ldr r7, =0x02020630 + adds r0, r6 + lsls r0, 2 + adds r6, r0, r7 +_080A9D42: + movs r2, 0x20 + ldrsh r1, [r6, r2] + ldrh r2, [r6, 0x22] + subs r2, 0x20 + lsls r2, 16 + asrs r2, 16 + ldr r0, =gUnknown_0853EF60 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r3, r0, r7 + lsls r0, r5, 1 + adds r0, r5 + lsls r1, r0, 4 + adds r0, r1 + strh r0, [r3, 0x2E] + movs r0, 0x80 + lsls r0, 1 + strh r0, [r3, 0x30] + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + cmp r5, 0x4 + bls _080A9D86 + movs r0, 0x15 + strh r0, [r3, 0x3A] +_080A9D86: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x9 + bls _080A9D42 +_080A9D90: + ldr r0, =0x02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A9C70 + + thumb_func_start sub_80A9DB4 +sub_80A9DB4: @ 80A9DB4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r1, [r4, 0xC] + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0x2 + bne _080A9E3A + movs r0, 0 + strh r0, [r4, 0xC] + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r0, 20 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r0, 16 + ldrb r2, [r4, 0x10] + ldrh r3, [r4, 0xA] + movs r1, 0x10 + bl pal_fade_1 + ldrh r2, [r4, 0x12] + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080A9E10 + ldrh r0, [r4, 0x10] + adds r0, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _080A9E3E + movs r0, 0x1 + eors r0, r2 + strh r0, [r4, 0x12] + b _080A9E3E + .pool +_080A9E10: + ldrh r1, [r4, 0x10] + subs r0, r1, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + cmp r0, 0 + bge _080A9E3E + strh r1, [r4, 0x10] + movs r0, 0x1 + eors r0, r2 + strh r0, [r4, 0x12] + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _080A9E3E + adds r0, r5, 0 + bl DestroyTask + b _080A9E3E +_080A9E3A: + adds r0, r1, 0x1 + strh r0, [r4, 0xC] +_080A9E3E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80A9DB4 + + thumb_func_start sub_80A9E44 +sub_80A9E44: @ 80A9E44 + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x3A] + movs r3, 0x3A + ldrsh r0, [r2, r3] + cmp r0, 0 + bne _080A9E70 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x5 + negs r1, r1 + ands r1, r0 + strb r1, [r3] + ldr r1, =sub_80A9E78 + str r1, [r2, 0x1C] + adds r0, r2, 0 + bl _call_via_r1 + b _080A9E74 + .pool +_080A9E70: + subs r0, r1, 0x1 + strh r0, [r2, 0x3A] +_080A9E74: + pop {r0} + bx r0 + thumb_func_end sub_80A9E44 + + thumb_func_start sub_80A9E78 +sub_80A9E78: @ 80A9E78 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x20 + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl sine + strh r0, [r4, 0x26] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x7F + bgt _080A9EA4 + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1D + b _080A9EAA +_080A9EA4: + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1F +_080A9EAA: + strb r0, [r1] + ldrh r0, [r4, 0x2E] + adds r0, 0x8 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x38] + adds r0, r1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x34 + bne _080A9EEC + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080A9EE6 + adds r0, r4, 0 + bl RemoveObjectAndFreeResources + b _080A9EEC +_080A9EE6: + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_080A9EEC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A9E78 + + thumb_func_start sub_80A9EF4 +sub_80A9EF4: @ 80A9EF4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 8 + ldr r1, =0xffe00000 + adds r0, r1 + lsrs r5, r0, 16 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 8 + ldr r1, =0xffdc0000 + adds r0, r1 + lsrs r4, r0, 16 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A9F32 + lsls r0, r5, 16 + ldr r1, =0xfffa0000 + adds r0, r1 + lsrs r5, r0, 16 +_080A9F32: + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl SetGpuReg + ldr r0, =gUnknown_0853EF48 + lsls r1, r5, 16 + asrs r1, 16 + lsls r2, r4, 16 + asrs r2, 16 + movs r3, 0x4 + bl AddObjectToFront + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0000271a + bl GetObjectTileRangeStartByTag + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + bne _080A9F7C + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080A9F7C: + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + ldr r1, =gUnknown_0853EF40 + bl SetSpriteOamTables_NoPriorityFromTable + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0x26] + ldr r1, =sub_80A9FD0 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A9EF4 + + thumb_func_start sub_80A9FD0 +sub_80A9FD0: @ 80A9FD0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + adds r2, r0, 0 + strh r0, [r1, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _080AA004 + ldr r0, =sub_80AA020 + str r0, [r1] + movs r0, 0 + strh r0, [r1, 0xA] + b _080AA01A + .pool +_080AA004: + lsls r0, r2, 24 + lsrs r0, 24 + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg +_080AA01A: + pop {r0} + bx r0 + thumb_func_end sub_80A9FD0 + + thumb_func_start sub_80AA020 +sub_80AA020: @ 80AA020 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x0000271a + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r5, r0, r1 + ldrh r0, [r5, 0xA] + adds r1, r0, 0x1 + strh r1, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD + ble _080AA0B0 + ldrh r0, [r5, 0xC] + adds r0, 0x1 + movs r6, 0 + strh r0, [r5, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _080AA0B0 + ldr r3, =0x02037b14 + lsls r2, 4 + mov r12, r2 + ldr r1, =0x0000010d + add r1, r12 + lsls r1, 1 + adds r1, r3 + ldrh r4, [r1] + movs r2, 0x87 + lsls r2, 1 + add r2, r12 + lsls r2, 1 + adds r2, r3 + ldrh r0, [r2] + strh r0, [r1] + ldr r0, =0x0000010f + add r0, r12 + lsls r0, 1 + adds r0, r3 + ldrh r1, [r0] + strh r1, [r2] + strh r4, [r0] + strh r6, [r5, 0xC] + ldrh r0, [r5, 0xE] + adds r0, 0x1 + strh r0, [r5, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _080AA0B0 + strh r6, [r5, 0xE] + strh r6, [r5, 0xA] + ldrh r0, [r5, 0x10] + adds r0, 0x1 + strh r0, [r5, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _080AA0B0 + movs r0, 0x9 + strh r0, [r5, 0xA] + ldr r0, =sub_80AA0D0 + str r0, [r5] +_080AA0B0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AA020 + + thumb_func_start sub_80AA0D0 +sub_80AA0D0: @ 80AA0D0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r2, r1, r2 + ldrh r0, [r2, 0xA] + subs r0, 0x1 + adds r3, r0, 0 + strh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _080AA108 + ldr r0, =sub_80AA124 + str r0, [r2] + movs r0, 0 + strh r0, [r2, 0xA] + b _080AA11E + .pool +_080AA108: + lsls r0, r3, 24 + lsrs r0, 24 + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg +_080AA11E: + pop {r0} + bx r0 + thumb_func_end sub_80AA0D0 + + thumb_func_start sub_80AA124 +sub_80AA124: @ 80AA124 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x25 + bne _080AA16C + ldrh r0, [r1, 0x26] + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + b _080AA186 + .pool +_080AA16C: + cmp r0, 0x27 + bne _080AA186 + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r4, 0 + bl move_anim_task_del +_080AA186: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80AA124 + + thumb_func_start sub_80AA18C +sub_80AA18C: @ 80AA18C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r3, 0 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrh r0, [r0] + subs r0, 0xF + cmp r0, 0x2B + bls _080AA1A4 + b _080AA328 +_080AA1A4: + lsls r0, 2 + ldr r1, =_080AA1B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080AA1B8: + .4byte _080AA268 + .4byte _080AA26E + .4byte _080AA274 + .4byte _080AA27A + .4byte _080AA280 + .4byte _080AA286 + .4byte _080AA28C + .4byte _080AA292 + .4byte _080AA298 + .4byte _080AA29E + .4byte _080AA2A4 + .4byte _080AA2AA + .4byte _080AA2B0 + .4byte _080AA2B6 + .4byte _080AA328 + .4byte _080AA328 + .4byte _080AA328 + .4byte _080AA328 + .4byte _080AA328 + .4byte _080AA328 + .4byte _080AA328 + .4byte _080AA328 + .4byte _080AA328 + .4byte _080AA328 + .4byte _080AA2BC + .4byte _080AA2C0 + .4byte _080AA2C4 + .4byte _080AA2C8 + .4byte _080AA2CC + .4byte _080AA2D0 + .4byte _080AA2D4 + .4byte _080AA2D8 + .4byte _080AA2E0 + .4byte _080AA2E8 + .4byte _080AA2F0 + .4byte _080AA2F8 + .4byte _080AA300 + .4byte _080AA308 + .4byte _080AA328 + .4byte _080AA328 + .4byte _080AA310 + .4byte _080AA314 + .4byte _080AA318 + .4byte _080AA320 +_080AA268: + movs r5, 0 + movs r2, 0 + b _080AA330 +_080AA26E: + movs r5, 0 + movs r2, 0x1 + b _080AA330 +_080AA274: + movs r5, 0 + movs r2, 0x3 + b _080AA330 +_080AA27A: + movs r5, 0 + movs r2, 0x5 + b _080AA330 +_080AA280: + movs r5, 0 + movs r2, 0x6 + b _080AA330 +_080AA286: + movs r5, 0 + movs r2, 0x2 + b _080AA330 +_080AA28C: + movs r5, 0 + movs r2, 0x4 + b _080AA330 +_080AA292: + movs r5, 0x1 + movs r2, 0 + b _080AA330 +_080AA298: + movs r5, 0x1 + movs r2, 0x1 + b _080AA330 +_080AA29E: + movs r5, 0x1 + movs r2, 0x3 + b _080AA330 +_080AA2A4: + movs r5, 0x1 + movs r2, 0x5 + b _080AA330 +_080AA2AA: + movs r5, 0x1 + movs r2, 0x6 + b _080AA330 +_080AA2B0: + movs r5, 0x1 + movs r2, 0x2 + b _080AA330 +_080AA2B6: + movs r5, 0x1 + movs r2, 0x4 + b _080AA330 +_080AA2BC: + movs r5, 0 + b _080AA2DA +_080AA2C0: + movs r5, 0 + b _080AA2E2 +_080AA2C4: + movs r5, 0 + b _080AA2EA +_080AA2C8: + movs r5, 0 + b _080AA2F2 +_080AA2CC: + movs r5, 0 + b _080AA2FA +_080AA2D0: + movs r5, 0 + b _080AA302 +_080AA2D4: + movs r5, 0 + b _080AA30A +_080AA2D8: + movs r5, 0x1 +_080AA2DA: + movs r2, 0 + movs r3, 0x1 + b _080AA330 +_080AA2E0: + movs r5, 0x1 +_080AA2E2: + movs r2, 0x1 + movs r3, 0x1 + b _080AA330 +_080AA2E8: + movs r5, 0x1 +_080AA2EA: + movs r2, 0x3 + movs r3, 0x1 + b _080AA330 +_080AA2F0: + movs r5, 0x1 +_080AA2F2: + movs r2, 0x5 + movs r3, 0x1 + b _080AA330 +_080AA2F8: + movs r5, 0x1 +_080AA2FA: + movs r2, 0x6 + movs r3, 0x1 + b _080AA330 +_080AA300: + movs r5, 0x1 +_080AA302: + movs r2, 0x2 + movs r3, 0x1 + b _080AA330 +_080AA308: + movs r5, 0x1 +_080AA30A: + movs r2, 0x4 + movs r3, 0x1 + b _080AA330 +_080AA310: + movs r5, 0 + b _080AA31A +_080AA314: + movs r5, 0 + b _080AA322 +_080AA318: + movs r5, 0x1 +_080AA31A: + movs r2, 0xFF + movs r3, 0 + b _080AA330 +_080AA320: + movs r5, 0x1 +_080AA322: + movs r2, 0xFF + movs r3, 0x1 + b _080AA330 +_080AA328: + adds r0, r4, 0 + bl move_anim_task_del + b _080AA352 +_080AA330: + ldr r0, =0x0203841e + movs r1, 0 + strh r5, [r0] + strh r2, [r0, 0x2] + strh r1, [r0, 0x4] + strh r1, [r0, 0x6] + strh r3, [r0, 0x8] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8116EB4 + str r1, [r0] + adds r0, r4, 0 + bl _call_via_r1 +_080AA352: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AA18C + + thumb_func_start move_anim_start_t2 +move_anim_start_t2: @ 80AA364 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =0x02038436 + strb r4, [r0] + ldr r0, =0x02038437 + strb r4, [r0] + ldr r0, =gUnknown_082C92FC + movs r2, 0 + bl move_something + ldr r0, =task0A_80788BC + movs r1, 0xA + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end move_anim_start_t2 + + thumb_func_start task0A_80788BC +task0A_80788BC: @ 80AA3B4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x020383f8 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =0x020383fd + ldrb r0, [r0] + cmp r0, 0 + bne _080AA3F6 + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + ldr r2, [r2, 0x4] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + adds r0, r4, 0 + bl DestroyTask +_080AA3F6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task0A_80788BC + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom6.s b/asm/rom6.s new file mode 100644 index 000000000..266bc7ae3 --- /dev/null +++ b/asm/rom6.s @@ -0,0 +1,12772 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start npc_before_player_of_type +npc_before_player_of_type: @ 8135424 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r4, =0x0203ab40 + adds r1, r4, 0x2 + adds r0, r4, 0 + bl GetXYCoordsOneStepInFrontOfPlayer + bl PlayerGetZCoord + strb r0, [r4, 0x4] + ldrh r0, [r4] + ldrh r1, [r4, 0x2] + ldrb r2, [r4, 0x4] + bl GetFieldObjectIdByXYZ + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02037350 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r2, r1, r2 + ldrb r0, [r2, 0x5] + cmp r0, r5 + bne _08135470 + ldr r1, =0x020375f2 + ldrb r0, [r2, 0x8] + strh r0, [r1] + movs r0, 0x1 + b _08135472 + .pool +_08135470: + movs r0, 0 +_08135472: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end npc_before_player_of_type + + thumb_func_start oei_task_add +oei_task_add: @ 8135478 + push {lr} + ldr r0, =0x0203ab40 + adds r1, r0, 0x2 + bl GetXYCoordsOneStepInFrontOfPlayer + ldr r0, =task08_080C9820 + movs r1, 0x8 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end oei_task_add + + thumb_func_start task08_080C9820 +task08_080C9820: @ 813549C + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + bl script_env_2_enable + ldr r1, =0x02037590 + movs r0, 0x1 + strb r0, [r1, 0x6] + ldrb r1, [r1, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + adds r0, r4, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _081354D2 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _0813551E +_081354D2: + ldr r0, =0x02037318 + ldrb r0, [r0, 0x17] + cmp r0, 0x5 + bne _08135504 + movs r0, 0x3B + bl FieldEffectStart + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8135578 + b _0813551C + .pool +_08135504: + bl sub_808C114 + adds r0, r4, 0 + movs r1, 0x39 + bl FieldObjectSetSpecialAnim + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_813552C +_0813551C: + str r0, [r1] +_0813551E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end task08_080C9820 + + thumb_func_start sub_813552C +sub_813552C: @ 813552C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08135560 + movs r0, 0x3B + bl FieldEffectStart + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8135578 + str r0, [r1] +_08135560: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813552C + + thumb_func_start sub_8135578 +sub_8135578: @ 8135578 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0x6 + bl FieldEffectActiveListContains + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081355FC + bl player_get_direction_lower_nybble + ldr r6, =0x02038c08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r6, 0x4] + cmp r0, 0x1 + bne _0813559E + str r4, [r6, 0x8] +_0813559E: + ldr r1, [r6, 0x4] + cmp r1, 0x2 + bne _081355A8 + movs r0, 0x1 + str r0, [r6, 0x8] +_081355A8: + cmp r1, 0x3 + bne _081355B0 + movs r0, 0x2 + str r0, [r6, 0x8] +_081355B0: + cmp r1, 0x4 + bne _081355B8 + movs r0, 0x3 + str r0, [r6, 0x8] +_081355B8: + ldr r5, =0x02037590 + ldrb r0, [r5, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + bl GetPlayerAvatarGraphicsIdByCurrentState + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r1, [r5, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + ldrb r1, [r6, 0x8] + bl StartObjectImageAnim + movs r0, 0x6 + bl FieldEffectActiveListRemove + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_813561C + str r1, [r0] +_081355FC: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8135578 + + thumb_func_start sub_813561C +sub_813561C: @ 813561C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x18] + lsls r1, 16 + ldrh r0, [r0, 0x1A] + orrs r1, r0 + bl _call_via_r1 + ldr r1, =0x02037590 + movs r0, 0 + strb r0, [r1, 0x6] + adds r0, r4, 0 + bl DestroyTask + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813561C + + thumb_func_start sub_8135654 +sub_8135654: @ 8135654 + push {r4,lr} + bl sub_81797DC + lsls r0, 24 + cmp r0, 0 + beq _0813568C + ldr r4, =0x020375f0 + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + ldr r1, =0x03005db0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =0x0203ceec + ldr r0, =sub_8179834 + b _081356A8 + .pool +_0813568C: + movs r0, 0x56 + bl npc_before_player_of_type + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0813569E + movs r0, 0 + b _081356AC +_0813569E: + ldr r1, =0x03005db0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =0x0203ceec + ldr r0, =sub_81356C4 +_081356A8: + str r0, [r1] + movs r0, 0x1 +_081356AC: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8135654 + + thumb_func_start sub_81356C4 +sub_81356C4: @ 81356C4 + push {lr} + bl brm_get_pokemon_selection + ldr r1, =0x02038c08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + ldr r0, =gUnknown_082907F0 + bl script_env_1_execute_new_script + pop {r0} + bx r0 + .pool + thumb_func_end sub_81356C4 + + thumb_func_start oei_rocksmash +oei_rocksmash: @ 81356E4 + push {lr} + bl oei_task_add + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =sub_8135714 + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + movs r0, 0x13 + bl sav12_xor_increment + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end oei_rocksmash + + thumb_func_start sub_8135714 +sub_8135714: @ 8135714 + push {lr} + movs r0, 0x83 + bl audio_play + movs r0, 0x25 + bl FieldEffectActiveListRemove + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_8135714 + + thumb_func_start sub_813572C +sub_813572C: @ 813572C + push {lr} + bl sub_80FE314 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0813573E + movs r0, 0 + b _0813574C +_0813573E: + ldr r1, =0x03005db0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =0x0203ceec + ldr r0, =hm2_dig + str r0, [r1] + movs r0, 0x1 +_0813574C: + pop {r1} + bx r1 + .pool + thumb_func_end sub_813572C + + thumb_func_start hm2_dig +hm2_dig: @ 8135760 + push {lr} + bl flagmods_08054D70 + movs r0, 0x26 + bl FieldEffectStart + bl brm_get_pokemon_selection + ldr r1, =0x02038c08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end hm2_dig + + thumb_func_start sub_8135780 +sub_8135780: @ 8135780 + push {lr} + bl oei_task_add + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =sub_81357BC + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + bl sub_81795E8 + lsls r0, 24 + cmp r0, 0 + bne _081357AC + movs r0, 0x1 + bl SetPlayerAvatarTransitionFlags +_081357AC: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8135780 + + thumb_func_start sub_81357BC +sub_81357BC: @ 81357BC + push {r4,lr} + movs r0, 0x26 + bl FieldEffectActiveListRemove + bl sub_81795E8 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _081357D6 + bl sub_817963C + b _081357EE +_081357D6: + ldr r0, =task08_080A1C44 + movs r1, 0x8 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] +_081357EE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81357BC + + thumb_func_start sub_81357FC +sub_81357FC: @ 81357FC + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =0x0203ab50 + ldr r0, =0x00000e88 + bl Alloc + str r0, [r5] + ldr r2, =0x00000809 + adds r0, r2 + movs r3, 0 + strb r4, [r0] + ldr r0, [r5] + movs r4, 0x80 + lsls r4, 4 + adds r1, r0, r4 + str r3, [r1] + ldr r1, =0x00000e7c + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r5] + ldr r4, =0x00000e7d + adds r0, r4 + strb r3, [r0] + ldr r0, =0x0203ab48 + str r6, [r0] + ldr r5, [r5] + adds r2, r5, r2 + ldrb r2, [r2] + cmp r2, 0x2 + beq _08135888 + cmp r2, 0x2 + bgt _08135864 + cmp r2, 0x1 + beq _0813586A + b _081358C0 + .pool +_08135864: + cmp r2, 0x3 + beq _081358A4 + b _081358C0 +_0813586A: + ldr r0, =0x00000804 + adds r1, r5, r0 + ldr r0, =gUnknown_085B269B + str r0, [r1] + ldr r4, =0x00000808 + adds r1, r5, r4 + movs r0, 0x2 + b _081358D2 + .pool +_08135888: + ldr r1, =0x00000804 + adds r0, r5, r1 + ldr r1, =gUnknown_085B269D + str r1, [r0] + ldr r4, =0x00000808 + adds r0, r5, r4 + strb r2, [r0] + b _081358D4 + .pool +_081358A4: + ldr r0, =0x00000804 + adds r1, r5, r0 + ldr r0, =gUnknown_085B269F + str r0, [r1] + ldr r4, =0x00000808 + adds r1, r5, r4 + movs r0, 0x2 + b _081358D2 + .pool +_081358C0: + ldr r0, =0x0203ab50 + ldr r1, [r0] + ldr r0, =0x00000804 + adds r2, r1, r0 + ldr r0, =gUnknown_085B2698 + str r0, [r2] + ldr r4, =0x00000808 + adds r1, r4 + movs r0, 0x3 +_081358D2: + strb r0, [r1] +_081358D4: + ldr r0, =sub_813594C + bl SetMainCallback2 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81357FC + + thumb_func_start sub_81358F4 +sub_81358F4: @ 81358F4 + push {lr} + ldr r1, =sub_8059D50 + movs r0, 0x1 + bl sub_81357FC + pop {r0} + bx r0 + .pool + thumb_func_end sub_81358F4 + + thumb_func_start sub_8135908 +sub_8135908: @ 8135908 + push {lr} + ldr r1, =c2_exit_to_overworld_2_switch + movs r0, 0x2 + bl sub_81357FC + pop {r0} + bx r0 + .pool + thumb_func_end sub_8135908 + + thumb_func_start sub_813591C +sub_813591C: @ 813591C + push {lr} + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl do_scheduled_bg_tilemap_copies_to_vram + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_813591C + + thumb_func_start sub_8135938 +sub_8135938: @ 8135938 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8135938 + + thumb_func_start sub_813594C +sub_813594C: @ 813594C + push {lr} +_0813594E: + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08135972 + bl sub_8135978 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08135972 + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0813594E +_08135972: + pop {r0} + bx r0 + thumb_func_end sub_813594C + + thumb_func_start sub_8135978 +sub_8135978: @ 8135978 + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x12 + bls _0813598C + b _08135BB8 +_0813598C: + lsls r0, 2 + ldr r1, =_081359A0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081359A0: + .4byte _081359EC + .4byte _081359F6 + .4byte _08135A08 + .4byte _08135A0E + .4byte _08135A30 + .4byte _08135A36 + .4byte _08135A54 + .4byte _08135A70 + .4byte _08135A8C + .4byte _08135A9A + .4byte _08135AC4 + .4byte _08135ADC + .4byte _08135AFC + .4byte _08135B02 + .4byte _08135B14 + .4byte _08135B1A + .4byte _08135B64 + .4byte _08135B6A + .4byte _08135B84 +_081359EC: + bl SetVBlankHBlankCallbacksToNull + bl clear_scheduled_bg_copies_to_vram + b _08135B9E +_081359F6: + bl remove_some_task + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _08135BA6 + .pool +_08135A08: + bl ResetObjectPaletteAllocator + b _08135B9E +_08135A0E: + bl sub_80A1A74 + ldr r2, =0x02037fd4 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _08135BA6 + .pool +_08135A30: + bl ResetAllObjectData + b _08135B9E +_08135A36: + ldr r0, =0x0203ab50 + ldr r0, [r0] + ldr r1, =0x00000809 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08135A46 + b _08135B9E +_08135A46: + bl ResetTasks + b _08135B9E + .pool +_08135A54: + bl sub_8135BDC + ldr r0, =0x0203ab50 + ldr r0, [r0] + ldr r1, =0x00000e7e + adds r0, r1 + movs r1, 0 + strh r1, [r0] + b _08135B9E + .pool +_08135A70: + bl sub_8135C38 + lsls r0, 24 + cmp r0, 0 + bne _08135A7C + b _08135BD0 +_08135A7C: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _08135BA6 + .pool +_08135A8C: + bl sub_813625C + bl sub_81362E0 + bl sub_8136344 + b _08135B9E +_08135A9A: + movs r0, 0x38 + movs r1, 0x40 + movs r2, 0 + bl sub_8136444 + ldr r1, =0x0203ab50 + ldr r1, [r1] + ldr r2, =0x00000e74 + adds r1, r2 + strb r0, [r1] + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _08135BA6 + .pool +_08135AC4: + ldr r0, =0x0203ab50 + ldr r0, [r0] + ldr r1, =0x00000e75 + adds r0, r1 + movs r1, 0x7 + bl sub_8122344 + b _08135B9E + .pool +_08135ADC: + ldr r0, =0x0203ab48 + ldrh r0, [r0, 0x4] + ldr r1, =0x00001005 + bl sub_8136110 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _08135BA6 + .pool +_08135AFC: + bl sub_8135D24 + b _08135B9E +_08135B02: + bl sub_8135E2C + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _08135BA6 + .pool +_08135B14: + bl sub_81363BC + b _08135B9E +_08135B1A: + ldr r0, =sub_81365C8 + movs r1, 0 + bl CreateTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x03006310 + ldr r2, =0x0203ab48 + ldrh r1, [r2, 0x6] + ldrh r2, [r2, 0x4] + bl ListMenuInit + ldr r2, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x8] + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _08135BA6 + .pool +_08135B64: + bl sub_8135DAC + b _08135B9E +_08135B6A: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _08135BA6 + .pool +_08135B84: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] +_08135B9E: + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_08135BA6: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08135BD0 + .pool +_08135BB8: + ldr r0, =sub_8135938 + bl SetVBlankCallback + ldr r0, =sub_813591C + bl SetMainCallback2 + movs r0, 0x1 + b _08135BD2 + .pool +_08135BD0: + movs r0, 0 +_08135BD2: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8135978 + + thumb_func_start sub_8135BDC +sub_8135BDC: @ 8135BDC + push {lr} + bl sub_8121DA0 + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085B2620 + movs r0, 0 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r0, =0x0203ab50 + ldr r1, [r0] + 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 {r0} + bx r0 + .pool + thumb_func_end sub_8135BDC + + thumb_func_start sub_8135C38 +sub_8135C38: @ 8135C38 + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x0203ab50 + ldr r0, [r0] + ldr r1, =0x00000e7e + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x5 + bhi _08135D18 + lsls r0, 2 + ldr r1, =_08135C64 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08135C64: + .4byte _08135C7C + .4byte _08135C98 + .4byte _08135CBC + .4byte _08135CCC + .4byte _08135CD8 + .4byte _08135CFC +_08135C7C: + bl reset_temp_tile_data_buffers + ldr r1, =gUnknown_08D9B2B4 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _08135CDE + .pool +_08135C98: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08135D18 + ldr r0, =gUnknown_08D9B7C8 + ldr r4, =0x0203ab50 + ldr r1, [r4] + bl LZDecompressWram + ldr r1, [r4] + b _08135CE2 + .pool +_08135CBC: + ldr r0, =gUnknown_08D9B470 + movs r1, 0 + movs r2, 0xC0 + bl decompress_palette + b _08135CDE + .pool +_08135CCC: + ldr r0, =gUnknown_085B26F4 + bl LoadCompressedObjectPic + b _08135CDE + .pool +_08135CD8: + ldr r0, =gUnknown_085B26FC + bl LoadCompressedObjectPalette +_08135CDE: + ldr r0, =0x0203ab50 + ldr r1, [r0] +_08135CE2: + ldr r0, =0x00000e7e + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _08135D18 + .pool +_08135CFC: + bl sub_8122328 + ldr r0, =0x0203ab50 + ldr r0, [r0] + ldr r1, =0x00000e7e + adds r0, r1 + movs r1, 0 + strh r1, [r0] + movs r0, 0x1 + b _08135D1A + .pool +_08135D18: + movs r0, 0 +_08135D1A: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8135C38 + + thumb_func_start sub_8135D24 +sub_8135D24: @ 8135D24 + push {r4,lr} + ldr r0, =gUnknown_085B2748 + 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 + ldr r0, =gUnknown_0860F074 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r4, 0 +_08135D50: + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xA + bls _08135D50 + 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 sub_8135D24 + + thumb_func_start sub_8135D7C +sub_8135D7C: @ 8135D7C + push {r4,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + movs r4, 0 + str r4, [sp] + str r4, [sp, 0x4] + ldr r3, =gUnknown_085B271C + str r3, [sp, 0x8] + str r4, [sp, 0xC] + str r1, [sp, 0x10] + movs r1, 0x1 + movs r3, 0x1 + bl AddTextPrinterParametrized2 + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8135D7C + + thumb_func_start sub_8135DAC +sub_8135DAC: @ 8135DAC + push {r4,lr} + ldr r0, =0x00000111 + bl itemid_get_item + adds r4, r0, 0 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x48 + bl GetStringCenterAlignXOffset + adds r2, r0, 0 + movs r0, 0 + adds r1, r4, 0 + bl sub_8135D7C + ldr r1, =gUnknown_085E931D + movs r0, 0x2 + movs r2, 0 + bl sub_8135D7C + ldr r1, =gUnknown_085E9323 + movs r0, 0x3 + movs r2, 0 + bl sub_8135D7C + ldr r1, =gUnknown_085E9327 + movs r0, 0x4 + movs r2, 0 + bl sub_8135D7C + ldr r1, =gUnknown_085E932D + movs r0, 0x5 + movs r2, 0 + bl sub_8135D7C + ldr r1, =gUnknown_085E9334 + movs r0, 0x6 + movs r2, 0 + bl sub_8135D7C + movs r4, 0 +_08135DFE: + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _08135DFE + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8135DAC + + thumb_func_start sub_8135E2C +sub_8135E2C: @ 8135E2C + push {r4-r7,lr} + movs r6, 0 + ldr r1, =0x0203ab50 + ldr r0, [r1] + ldr r2, =0x0000080a + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r6, r0 + bge _08135E7C + adds r5, r1, 0 +_08135E42: + lsls r4, r6, 5 + ldr r3, =0x00000954 + adds r4, r3 + ldr r0, [r5] + adds r0, r4 + adds r1, r6, 0 + bl sub_8135F04 + ldr r1, [r5] + lsls r2, r6, 3 + ldr r7, =0x0000080c + adds r0, r1, r7 + adds r0, r2 + adds r4, r1, r4 + str r4, [r0] + movs r3, 0x81 + lsls r3, 4 + adds r0, r1, r3 + adds r0, r2 + str r6, [r0] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r4, =0x0000080a + adds r1, r4 + ldrb r0, [r1] + subs r0, 0x1 + cmp r6, r0 + blt _08135E42 +_08135E7C: + ldr r5, =0x0203ab50 + lsls r4, r6, 5 + ldr r7, =0x00000954 + adds r4, r7 + ldr r0, [r5] + adds r0, r4 + ldr r1, =gUnknown_085E9344 + bl CopyString + ldr r1, [r5] + lsls r2, r6, 3 + ldr r3, =0x0000080c + adds r0, r1, r3 + adds r0, r2 + adds r4, r1, r4 + str r4, [r0] + movs r0, 0x81 + lsls r0, 4 + adds r1, r0 + adds r1, r2 + movs r0, 0x2 + negs r0, r0 + str r0, [r1] + ldr r2, =0x03006310 + adds r1, r2, 0 + ldr r0, =gUnknown_085B27B0 + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldrb r1, [r2, 0x17] + movs r0, 0x40 + negs r0, r0 + ands r0, r1 + movs r1, 0x7 + orrs r0, r1 + strb r0, [r2, 0x17] + ldr r1, [r5] + ldr r4, =0x0000080a + adds r0, r1, r4 + ldrb r0, [r0] + strh r0, [r2, 0xC] + adds r3, r1, r3 + str r3, [r2] + ldr r6, =0x0000080b + adds r1, r6 + ldrb r0, [r1] + strh r0, [r2, 0xE] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8135E2C + + thumb_func_start sub_8135F04 +sub_8135F04: @ 8135F04 + push {r4-r6,lr} + lsls r1, 16 + ldr r2, =0x03005d8c + lsrs r1, 13 + ldr r3, =0x00000848 + adds r1, r3 + ldr r5, [r2] + adds r5, r1 + ldr r2, =gUnknown_085B262C + ldrb r1, [r5] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl CopyString + adds r4, r0, 0 + movs r0, 0xFC + strb r0, [r4] + adds r4, 0x1 + movs r0, 0x12 + strb r0, [r4] + adds r4, 0x1 + movs r0, 0x57 + strb r0, [r4] + adds r4, 0x1 + ldr r6, =0x02021cc4 + adds r0, r5, 0 + bl sub_8136EA4 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r1, =gUnknown_085E934F + adds r0, r4, 0 + bl ExpandStringRefs + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8135F04 + + thumb_func_start sub_8135F70 +sub_8135F70: @ 8135F70 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + beq _08135F9C + movs r0, 0x5 + bl audio_play + ldr r2, =0x02020630 + ldr r0, =0x0203ab50 + ldr r0, [r0] + ldr r1, =0x00000e74 + 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_8136470 + str r1, [r0] +_08135F9C: + ldr r0, =0x0203ab50 + ldr r0, [r0] + ldr r1, =0x00000e7d + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08135FB0 + adds r0, r4, 0 + bl sub_8135FCC +_08135FB0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8135F70 + + thumb_func_start sub_8135FCC +sub_8135FCC: @ 8135FCC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r4, r0, 0 + movs r0, 0x7 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _081360A0 + ldr r1, =0x03005d8c + lsls r0, r4, 3 + ldr r2, =0x00000848 + adds r0, r2 + ldr r1, [r1] + adds r1, r0 + mov r8, r1 + add r1, sp, 0x8 + movs r0, 0x17 + strh r0, [r1] + movs r0, 0x18 + strh r0, [r1, 0x2] + movs r5, 0 + adds r6, r1, 0 +_08136002: + adds r4, r5, 0x1 + lsls r1, r4, 24 + lsrs r1, 24 + mov r0, r8 + bl sub_8136F9C + lsls r0, 16 + adds r7, r4, 0 + cmp r0, 0 + ble _0813602C + lsls r1, r5, 12 + adds r0, r1, 0 + adds r0, 0x17 + strh r0, [r6] + adds r1, 0x18 + strh r1, [r6, 0x2] + b _08136032 + .pool +_0813602C: + movs r0, 0xF + strh r0, [r6] + strh r0, [r6, 0x2] +_08136032: + adds r0, r5, 0 + movs r1, 0x3 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 1 + adds r4, r0 + lsls r4, 1 + adds r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x3 + bl __umodsi3 + adds r3, r0, 0 + lsls r3, 25 + movs r0, 0xD0 + lsls r0, 20 + adds r3, r0 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + add r1, sp, 0x8 + adds r2, r4, 0 + bl CopyToBgTilemapBufferRect + lsls r0, r7, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _08136002 + ldr r4, =0x02021cc4 + mov r0, r8 + bl sub_8136EDC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + movs r0, 0x7 + adds r1, r4, 0 + movs r2, 0x4 + bl sub_8135D7C + b _081360F8 + .pool +_081360A0: + add r0, sp, 0x8 + movs r1, 0xF + strh r1, [r0] + strh r1, [r0, 0x2] + movs r5, 0 +_081360AA: + adds r0, r5, 0 + movs r1, 0x3 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 1 + adds r4, r0 + lsls r4, 1 + adds r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x3 + bl __umodsi3 + adds r3, r0, 0 + lsls r3, 25 + movs r2, 0xD0 + lsls r2, 20 + adds r3, r2 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + add r1, sp, 0x8 + adds r2, r4, 0 + bl CopyToBgTilemapBufferRect + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _081360AA + movs r0, 0x7 + movs r1, 0x2 + bl CopyWindowToVram +_081360F8: + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8135FCC + + thumb_func_start sub_8136110 +sub_8136110: @ 8136110 + push {lr} + sub sp, 0x8 + adds r3, r0, 0 + lsls r3, 16 + lsls r1, 16 + lsrs r1, 16 + lsrs r3, 15 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0xE + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r2, 0xF + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_8136110 + + thumb_func_start sub_8136140 +sub_8136140: @ 8136140 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r2, 0 +_0813614A: + adds r1, r2, 0x1 + lsls r0, r1, 16 + lsrs r6, r0, 16 + mov r12, r1 + cmp r6, 0x27 + bhi _08136192 + ldr r0, =0x03005d8c + mov r9, r0 + lsls r7, r2, 3 + ldr r1, =0x00000848 + mov r8, r1 +_08136160: + mov r0, r9 + ldr r2, [r0] + adds r0, r2, r7 + add r0, r8 + ldrb r0, [r0] + cmp r0, 0 + bne _08136188 + ldr r1, =0x00000848 + adds r2, r1 + adds r3, r2, r7 + ldr r4, [r3] + ldr r5, [r3, 0x4] + lsls r0, r6, 3 + adds r2, r0 + ldr r0, [r2] + ldr r1, [r2, 0x4] + str r0, [r3] + str r1, [r3, 0x4] + str r4, [r2] + str r5, [r2, 0x4] +_08136188: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x27 + bls _08136160 +_08136192: + mov r1, r12 + lsls r0, r1, 16 + lsrs r2, r0, 16 + cmp r2, 0x26 + bls _0813614A + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8136140 + + thumb_func_start sub_81361B0 +sub_81361B0: @ 81361B0 + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00000848 + adds r6, r0, r1 + cmp r4, r5 + beq _08136246 + movs r0, 0x8 + bl Alloc + adds r7, r0, 0 + lsls r0, r4, 3 + adds r0, r6 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r7] + str r1, [r7, 0x4] + cmp r5, r4 + bls _0813620C + subs r5, 0x1 + lsls r3, r4, 16 + lsls r0, r5, 16 + asrs r1, r0, 16 + cmp r3, r0 + bge _08136234 + adds r4, r1, 0 +_081361E8: + asrs r3, 16 + lsls r2, r3, 3 + adds r2, r6 + ldr r0, [r2, 0x8] + ldr r1, [r2, 0xC] + str r0, [r2] + str r1, [r2, 0x4] + adds r3, 0x1 + lsls r3, 16 + asrs r0, r3, 16 + cmp r0, r4 + blt _081361E8 + b _08136234 + .pool +_0813620C: + lsls r3, r4, 16 + lsls r0, r5, 16 + asrs r1, r0, 16 + cmp r3, r0 + ble _08136234 + adds r4, r1, 0 +_08136218: + asrs r3, 16 + lsls r2, r3, 3 + adds r2, r6 + adds r0, r2, 0 + subs r0, 0x8 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + subs r3, 0x1 + lsls r3, 16 + asrs r0, r3, 16 + cmp r0, r4 + bgt _08136218 +_08136234: + lsls r2, r5, 3 + adds r2, r6 + ldr r0, [r7] + ldr r1, [r7, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + adds r0, r7, 0 + bl Free +_08136246: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_81361B0 + + thumb_func_start sub_813624C +sub_813624C: @ 813624C + ldr r1, =0x0203ab48 + movs r0, 0 + strh r0, [r1, 0x4] + strh r0, [r1, 0x6] + bx lr + .pool + thumb_func_end sub_813624C + + thumb_func_start sub_813625C +sub_813625C: @ 813625C + push {r4,r5,lr} + bl sub_8136140 + ldr r0, =0x0203ab50 + ldr r0, [r0] + ldr r1, =0x0000080a + adds r0, r1 + movs r1, 0 + strb r1, [r0] + movs r2, 0 + ldr r5, =0x03005d8c + ldr r4, =0x00000848 +_08136274: + ldr r0, [r5] + lsls r1, r2, 3 + adds r0, r1 + adds r0, r4 + ldrb r0, [r0] + ldr r3, =0x0203ab50 + cmp r0, 0 + beq _08136290 + ldr r1, [r3] + ldr r0, =0x0000080a + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08136290: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x27 + bls _08136274 + ldr r0, [r3] + ldr r2, =0x0000080a + adds r0, r2 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r0, [r3] + adds r2, r0, r2 + ldrb r2, [r2] + cmp r2, 0x9 + bls _081362D0 + ldr r2, =0x0000080b + adds r1, r0, r2 + movs r0, 0x9 + strb r0, [r1] + b _081362D6 + .pool +_081362D0: + ldr r1, =0x0000080b + adds r0, r1 + strb r2, [r0] +_081362D6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813625C + + thumb_func_start sub_81362E0 +sub_81362E0: @ 81362E0 + push {r4,r5,lr} + ldr r0, =0x0203ab48 + ldrh r1, [r0, 0x6] + adds r3, r0, 0 + ldr r4, =0x0203ab50 + cmp r1, 0 + beq _08136308 + ldrh r0, [r3, 0x6] + ldr r1, [r4] + ldr r5, =0x0000080b + adds r2, r1, r5 + ldrb r2, [r2] + adds r0, r2 + subs r5, 0x1 + adds r1, r5 + ldrb r1, [r1] + cmp r0, r1 + ble _08136308 + subs r0, r1, r2 + strh r0, [r3, 0x6] +_08136308: + adds r2, r3, 0 + ldrh r1, [r2, 0x6] + ldrh r0, [r2, 0x4] + adds r1, r0 + ldr r0, [r4] + ldr r4, =0x0000080a + adds r0, r4 + ldrb r0, [r0] + cmp r1, r0 + blt _0813633C + adds r1, r0, 0 + cmp r1, 0 + bne _08136338 + strh r1, [r2, 0x4] + b _0813633C + .pool +_08136338: + subs r0, 0x1 + strh r0, [r3, 0x4] +_0813633C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81362E0 + + thumb_func_start sub_8136344 +sub_8136344: @ 8136344 + push {r4-r7,lr} + ldr r0, =0x0203ab48 + ldrh r1, [r0, 0x4] + adds r5, r0, 0 + cmp r1, 0x4 + bls _081363A4 + movs r4, 0 + ldrh r0, [r5, 0x4] + subs r0, 0x4 + cmp r4, r0 + bge _081363A4 + ldrh r2, [r5, 0x6] + ldr r6, =0x0203ab50 + ldr r0, [r6] + ldr r3, =0x0000080b + adds r1, r0, r3 + ldrb r1, [r1] + adds r2, r1 + ldr r7, =0x0000080a + adds r0, r7 + ldrb r0, [r0] + cmp r2, r0 + beq _081363A4 + adds r3, r5, 0 +_08136374: + ldrh r0, [r3, 0x4] + subs r0, 0x1 + strh r0, [r3, 0x4] + ldrh r0, [r3, 0x6] + adds r0, 0x1 + strh r0, [r3, 0x6] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldrh r0, [r3, 0x4] + subs r0, 0x4 + cmp r4, r0 + bge _081363A4 + ldrh r2, [r5, 0x6] + ldr r1, [r6] + ldr r7, =0x0000080b + adds r0, r1, r7 + ldrb r0, [r0] + adds r2, r0 + ldr r0, =0x0000080a + adds r1, r0 + ldrb r1, [r1] + cmp r2, r1 + bne _08136374 +_081363A4: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8136344 + + thumb_func_start sub_81363BC +sub_81363BC: @ 81363BC + push {r4,lr} + sub sp, 0x10 + ldr r4, =0x0203ab50 + ldr r1, [r4] + ldr r2, =0x00000e7c + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081363FC + ldr r2, =0x0000080a + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + subs r0, r1 + str r0, [sp] + ldr r0, =0x00000456 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + ldr r0, =0x0203ab4e + str r0, [sp, 0xC] + movs r0, 0x2 + movs r1, 0xB0 + movs r2, 0x8 + movs r3, 0x98 + bl AddScrollIndicatorArrowPairParametrized + ldr r1, [r4] + ldr r2, =0x00000e7c + adds r1, r2 + strb r0, [r1] +_081363FC: + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81363BC + + thumb_func_start sub_8136418 +sub_8136418: @ 8136418 + push {r4,lr} + ldr r4, =0x0203ab50 + ldr r0, [r4] + ldr r2, =0x00000e7c + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08136436 + bl RemoveScrollIndicatorArrowPair + ldr r0, [r4] + ldr r1, =0x00000e7c + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] +_08136436: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8136418 + + thumb_func_start sub_8136444 +sub_8136444: @ 8136444 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r3, r2, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =gUnknown_085B2704 + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r1, r4, 0 + adds r2, r5, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8136444 + + thumb_func_start sub_8136470 +sub_8136470: @ 8136470 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + ble _08136480 + movs r0, 0 + strh r0, [r4, 0x2E] +_08136480: + movs r0, 0x2E + ldrsh r5, [r4, r0] + cmp r5, 0 + beq _0813648E + cmp r5, 0x1 + beq _081364B4 + b _081364E0 +_0813648E: + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4, 0x1] + ldr r0, =gUnknown_085B26F0 + str r0, [r4, 0x10] + adds r0, r4, 0 + bl obj_alloc_rotscale_entry + movs r0, 0x1 + strh r0, [r4, 0x2E] + strh r5, [r4, 0x30] + b _081364E0 + .pool +_081364B4: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + movs r2, 0 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + ble _081364E0 + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] + strh r2, [r4, 0x2E] + strh r2, [r4, 0x30] + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] +_081364E0: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8136470 + + thumb_func_start sub_81364EC +sub_81364EC: @ 81364EC + 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 pal_fade_maybe + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8136524 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81364EC + + thumb_func_start sub_8136524 +sub_8136524: @ 8136524 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r2, r0, r1 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081365BE + ldr r6, =0x0203ab50 + ldr r0, [r6] + ldr r1, =0x00000809 + adds r0, r1 + ldrb r0, [r0] + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0813655A + ldr r1, =0x03005dac + ldr r0, =sub_80AF168 + str r0, [r1] +_0813655A: + ldrb r0, [r2] + ldr r4, =0x0203ab4e + subs r2, r4, 0x2 + adds r1, r4, 0 + bl sub_81AE6C8 + bl sub_8136418 + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + ldr r0, [r6] + movs r1, 0x80 + lsls r1, 4 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _081365A4 + bl SetMainCallback2 + b _081365AC + .pool +_081365A4: + subs r0, r4, 0x6 + ldr r0, [r0] + bl SetMainCallback2 +_081365AC: + bl FreeAllWindowBuffers + ldr r0, =0x0203ab50 + ldr r0, [r0] + bl Free + adds r0, r5, 0 + bl DestroyTask +_081365BE: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8136524 + + thumb_func_start sub_81365C8 +sub_81365C8: @ 81365C8 + 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 + mov r8, r0 + ldr r0, =0x03005e08 + mov r10, r0 + mov r6, r8 + add r6, r10 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081365F4 + b _08136708 +_081365F4: + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08136602 + b _08136708 +_08136602: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x4 + ands r0, r1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + cmp r0, 0 + beq _08136688 + ldrb r0, [r6] + ldr r4, =0x0203ab4e + subs r2, r4, 0x2 + adds r1, r4, 0 + bl get_coro_args_x18_x1A + subs r4, 0x6 + ldrh r1, [r4, 0x6] + ldrh r0, [r4, 0x4] + adds r1, r0 + ldr r5, =0x0203ab50 + ldr r0, [r5] + ldr r2, =0x0000080a + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _08136708 + movs r0, 0x5 + bl audio_play + ldrh r0, [r4, 0x4] + ldr r1, =0x00002005 + bl sub_8136110 + ldrh r0, [r4, 0x4] + ldrh r4, [r4, 0x6] + adds r0, r4 + strh r0, [r6, 0x4] + ldr r0, [r5] + ldr r1, =0x00000e7d + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + mov r0, r10 + subs r0, 0x8 + add r0, r8 + ldr r1, =sub_813671C + str r1, [r0] + b _08136708 + .pool +_08136688: + ldr r5, =0x0203ab48 + ldrh r2, [r5, 0x4] + mov r8, r2 + ldrb r0, [r6] + bl ListMenuHandleInput + adds r4, r0, 0 + ldrb r0, [r6] + adds r1, r5, 0x6 + adds r2, r5, 0x4 + bl get_coro_args_x18_x1A + ldrh r0, [r5, 0x4] + cmp r8, r0 + beq _081366B6 + mov r0, r8 + movs r1, 0x5 + bl sub_8136110 + ldrh r0, [r5, 0x4] + ldr r1, =0x00001005 + bl sub_8136110 +_081366B6: + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _081366D0 + adds r0, 0x1 + cmp r4, r0 + bne _081366F8 + b _08136708 + .pool +_081366D0: + movs r0, 0x5 + bl audio_play + ldr r0, =0x020375f0 + ldr r2, =0x0000ffff + adds r1, r2, 0 + strh r1, [r0] + ldr r0, =0x0203ce7c + mov r1, r9 + strh r1, [r0] + adds r0, r7, 0 + bl sub_81364EC + b _08136708 + .pool +_081366F8: + movs r0, 0x5 + bl audio_play + ldr r0, =0x0203ce7c + strh r4, [r0] + adds r0, r7, 0 + bl sub_8136938 +_08136708: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81365C8 + + thumb_func_start sub_813671C +sub_813671C: @ 813671C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r7, r0, r1 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08136742 + b _08136848 +_08136742: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0813676C + movs r0, 0x5 + bl audio_play + ldrb r0, [r7] + ldr r1, =0x0203ab4e + subs r2, r1, 0x2 + bl get_coro_args_x18_x1A + b _08136822 + .pool +_0813676C: + ldr r6, =0x0203ab48 + ldrh r4, [r6, 0x6] + ldrh r5, [r6, 0x4] + ldrb r0, [r7] + bl ListMenuHandleInput + mov r9, r0 + ldrb r0, [r7] + adds r1, r6, 0x6 + adds r2, r6, 0x4 + bl get_coro_args_x18_x1A + ldrh r0, [r6, 0x6] + cmp r4, r0 + bne _08136790 + ldrh r6, [r6, 0x4] + cmp r5, r6 + beq _081367CA +_08136790: + movs r4, 0 +_08136792: + ldr r0, =0x0203ab48 + ldrh r0, [r0, 0x6] + adds r0, r4, r0 + lsls r0, 16 + lsrs r5, r0, 16 + movs r1, 0x4 + ldrsh r0, [r7, r1] + cmp r5, r0 + bne _081367B8 + adds r0, r4, 0 + ldr r1, =0x00002005 + bl sub_8136110 + b _081367C0 + .pool +_081367B8: + adds r0, r4, 0 + movs r1, 0x5 + bl sub_8136110 +_081367C0: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x8 + bls _08136792 +_081367CA: + ldr r5, =0x0203ab50 + ldr r0, [r5] + ldr r4, =0x00000e75 + adds r0, r4 + movs r1, 0x7 + movs r2, 0 + bl sub_81223FC + ldr r0, [r5] + adds r0, r4 + ldr r1, =0x0203ab48 + ldrh r3, [r1, 0x4] + lsls r3, 4 + adds r3, 0x8 + lsls r3, 16 + lsrs r3, 16 + movs r1, 0x7 + movs r2, 0x80 + bl sub_8122448 + movs r0, 0x2 + negs r0, r0 + cmp r9, r0 + beq _08136810 + adds r0, 0x1 + cmp r9, r0 + bne _0813683A + b _08136848 + .pool +_08136810: + movs r0, 0x5 + bl audio_play + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08136830 +_08136822: + mov r0, r8 + movs r1, 0 + bl sub_8136854 + b _08136848 + .pool +_08136830: + mov r0, r8 + movs r1, 0x1 + bl sub_8136854 + b _08136848 +_0813683A: + movs r0, 0x5 + bl audio_play + mov r0, r8 + movs r1, 0 + bl sub_8136854 +_08136848: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_813671C + + thumb_func_start sub_8136854 +sub_8136854: @ 8136854 + push {r4-r7,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r6, r0, r1 + ldr r2, =0x0203ab48 + ldrh r0, [r2, 0x4] + ldrh r1, [r2, 0x6] + adds r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =0x0203ab50 + ldr r0, [r0] + ldr r1, =0x00000e7d + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldrb r0, [r6] + adds r1, r2, 0x6 + adds r2, 0x4 + bl sub_81AE6C8 + cmp r4, 0 + bne _081368AA + movs r0, 0x4 + ldrsh r1, [r6, r0] + cmp r1, r5 + beq _081368BA + subs r0, r5, 0x1 + cmp r1, r0 + beq _081368AA + adds r0, r1, 0 + adds r1, r5, 0 + bl sub_81361B0 + bl sub_8135E2C +_081368AA: + movs r1, 0x4 + ldrsh r0, [r6, r1] + cmp r0, r5 + bge _081368BA + ldr r1, =0x0203ab48 + ldrh r0, [r1, 0x4] + subs r0, 0x1 + strh r0, [r1, 0x4] +_081368BA: + ldr r0, =0x03006310 + ldr r2, =0x0203ab48 + ldrh r1, [r2, 0x6] + ldrh r2, [r2, 0x4] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6] + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =0x0203ab50 + ldr r0, [r0] + ldr r1, =0x00000e75 + adds r0, r1 + movs r1, 0x7 + movs r2, 0x1 + bl sub_81223FC + movs r4, 0 + lsls r5, r7, 2 +_081368E6: + adds r0, r4, 0 + movs r1, 0x5 + bl sub_8136110 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x8 + bls _081368E6 + ldr r0, =0x0203ab48 + ldrh r0, [r0, 0x4] + ldr r1, =0x00001005 + bl sub_8136110 + ldr r1, =0x03005e00 + adds r0, r5, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81365C8 + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8136854 + + thumb_func_start sub_8136938 +sub_8136938: @ 8136938 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r6, r0, r1 + ldr r0, =0x0203ab50 + ldr r0, [r0] + ldr r1, =0x00000808 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _08136968 + movs r0, 0x8 + b _0813696A + .pool +_08136968: + movs r0, 0x9 +_0813696A: + strh r0, [r6, 0x2] + bl sub_8136418 + ldrb r0, [r6, 0x2] + movs r1, 0 + movs r2, 0x1 + movs r3, 0xE + bl SetWindowBorderStyle + ldrb r0, [r6, 0x2] + ldr r5, =0x0203ab50 + ldr r3, [r5] + ldr r4, =0x00000808 + adds r1, r3, r4 + ldrb r1, [r1] + ldr r2, =gUnknown_085B2668 + mov r12, r2 + ldr r2, =0x00000804 + adds r3, r2 + ldr r3, [r3] + mov r2, r12 + bl sub_81995E4 + ldrb r0, [r6, 0x2] + ldr r1, [r5] + adds r1, r4 + ldrb r1, [r1] + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + ldrb r0, [r6, 0x2] + bl PutWindowTilemap + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81369E0 + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8136938 + + thumb_func_start sub_81369E0 +sub_81369E0: @ 81369E0 + 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 _08136A3C + bl ProcessMenuInputNoWrapAround + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _08136A3C + adds r0, 0x1 + cmp r4, r0 + bne _08136A18 + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_8136DE8 + b _08136A3C +_08136A18: + movs r0, 0x5 + bl audio_play + ldr r1, =gUnknown_085B2668 + ldr r0, =0x0203ab50 + ldr r0, [r0] + ldr r2, =0x00000804 + 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 +_08136A3C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81369E0 + + thumb_func_start sub_8136A50 +sub_8136A50: @ 8136A50 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0203ab50 + ldr r1, [r1] + movs r2, 0x80 + lsls r2, 4 + adds r1, r2 + ldr r2, =sub_8136A74 + str r2, [r1] + bl sub_81364EC + pop {r0} + bx r0 + .pool + thumb_func_end sub_8136A50 + + thumb_func_start sub_8136A74 +sub_8136A74: @ 8136A74 + push {lr} + ldr r2, =0x03005d8c + ldr r0, =0x0203ce7c + ldrh r1, [r0] + lsls r1, 3 + ldr r0, =0x00000848 + adds r1, r0 + ldr r0, [r2] + adds r0, r1 + ldr r1, =sub_8136AA0 + bl sub_8166204 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8136A74 + + thumb_func_start sub_8136AA0 +sub_8136AA0: @ 8136AA0 + push {lr} + ldr r0, =0x0203ab48 + ldr r1, [r0] + movs r0, 0 + bl sub_81357FC + pop {r0} + bx r0 + .pool + thumb_func_end sub_8136AA0 + + thumb_func_start sub_8136AB4 +sub_8136AB4: @ 8136AB4 + push {r4,r5,lr} + sub sp, 0x10 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r0, r1 + ldrb r0, [r0, 0x2] + movs r1, 0 + bl sub_8198070 + ldr r0, =0x02021cc4 + ldr r3, =gUnknown_085B262C + ldr r1, =0x03005d8c + ldr r2, [r1] + ldr r1, =0x0203ce7c + ldrh r1, [r1] + lsls r1, 3 + adds r2, r1 + ldr r1, =0x00000848 + adds r2, r1 + ldrb r1, [r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl CopyString + ldr r5, =0x02021fc4 + ldr r1, =gUnknown_085E9353 + adds r0, r5, 0 + bl ExpandStringRefs + bl sav2_get_text_speed + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + str r1, [sp] + str r0, [sp, 0x4] + str r5, [sp, 0x8] + ldr r0, =sub_8136B48 + str r0, [sp, 0xC] + adds r0, r4, 0 + movs r1, 0xA + movs r2, 0xA + movs r3, 0xD + bl DisplayMessageAndContinueTask + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8136AB4 + + thumb_func_start sub_8136B48 +sub_8136B48: @ 8136B48 + push {lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_085B27A8 + movs r2, 0x2 + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0xE + str r2, [sp, 0x8] + ldr r2, =gUnknown_085B26A4 + str r2, [sp, 0xC] + movs r2, 0x1 + movs r3, 0 + bl CreateYesNoMenuWithCallbacks + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8136B48 + + thumb_func_start sub_8136B78 +sub_8136B78: @ 8136B78 + push {r4,r5,lr} + sub sp, 0x10 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =0x02021fc4 + ldr r1, =gUnknown_085E9367 + adds r0, r5, 0 + bl ExpandStringRefs + bl sav2_get_text_speed + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + str r1, [sp] + str r0, [sp, 0x4] + str r5, [sp, 0x8] + ldr r0, =sub_8136BC0 + str r0, [sp, 0xC] + adds r0, r4, 0 + movs r1, 0xA + movs r2, 0xA + movs r3, 0xD + bl DisplayMessageAndContinueTask + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8136B78 + + thumb_func_start sub_8136BC0 +sub_8136BC0: @ 8136BC0 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08136C36 + ldr r0, =0x0203ce7c + ldrb r0, [r0] + bl sub_8136F68 + movs r0, 0x5 + bl audio_play + ldr r5, =0x0203ab4e + subs r6, r5, 0x2 + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + ldr r0, =0x03005e08 + adds r4, r0 + ldrb r0, [r4] + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_81AE6C8 + ldrh r0, [r6] + movs r1, 0x5 + bl sub_8136110 + bl sub_813625C + bl sub_81362E0 + bl sub_8135E2C + ldr r0, =0x03006310 + ldrh r1, [r5] + ldrh r2, [r6] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + ldrh r0, [r6] + ldr r1, =0x00001005 + bl sub_8136110 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r7, 0 + bl sub_8136C54 +_08136C36: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8136BC0 + + thumb_func_start sub_8136C54 +sub_8136C54: @ 8136C54 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0xA + movs r1, 0 + bl sub_8197DF8 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + bl sub_81363BC + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81365C8 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8136C54 + + thumb_func_start sub_8136C8C +sub_8136C8C: @ 8136C8C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =0x02024744 + bl GetNature + lsls r0, 24 + lsrs r0, 24 + ldr r5, =0x03005d8c + ldr r7, =0x0203ce7c + ldrh r2, [r7] + lsls r2, 3 + ldr r6, =0x00000848 + adds r2, r6 + ldr r1, [r5] + adds r1, r2 + bl sub_8136FE4 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =0x02022f58 + ldr r3, =gUnknown_085B262C + ldr r2, [r5] + ldrh r1, [r7] + lsls r1, 3 + adds r2, r1 + adds r2, r6 + ldrb r1, [r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl CopyString + ldrb r0, [r7] + bl sub_8136F68 + ldr r1, [r5] + ldrh r0, [r7] + lsls r0, 3 + adds r1, r0 + adds r1, r6 + ldrb r0, [r1] + lsls r0, 8 + strh r0, [r7] + lsls r4, 16 + asrs r4, 16 + cmp r4, 0 + bne _08136D10 + adds r0, 0x1 + b _08136D1A + .pool +_08136D10: + cmp r4, 0 + ble _08136D18 + adds r0, 0x2 + b _08136D1A +_08136D18: + adds r0, 0x3 +_08136D1A: + strh r0, [r7] + mov r0, r8 + bl sub_81364EC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8136C8C + + thumb_func_start sub_8136D2C +sub_8136D2C: @ 8136D2C + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =0x0203ce7c + ldrb r0, [r5] + bl sub_80FC3E8 + ldr r0, =0x02021cc4 + ldr r3, =gUnknown_085B262C + ldr r1, =0x03005d8c + ldr r2, [r1] + ldrh r1, [r5] + lsls r1, 3 + adds r2, r1 + ldr r1, =0x00000848 + adds r2, r1 + ldrb r1, [r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl CopyString + ldr r1, =0x020375f0 + ldrh r0, [r5] + strh r0, [r1] + lsls r0, 24 + lsrs r0, 24 + bl sub_8136F68 + movs r0, 0 + strh r0, [r5] + adds r0, r4, 0 + bl sub_81364EC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8136D2C + + thumb_func_start sub_8136D90 +sub_8136D90: @ 8136D90 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r6, =0x020375e0 + ldr r0, =0x03005d8c + ldr r5, =0x0203ce7c + ldrh r1, [r5] + lsls r1, 3 + ldr r2, =0x00000848 + adds r1, r2 + ldr r0, [r0] + adds r0, r1 + bl sub_818E704 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6] + ldr r1, =0x020375f0 + ldrh r0, [r5] + strh r0, [r1] + lsls r0, 24 + lsrs r0, 24 + bl sub_8136F68 + movs r0, 0 + strh r0, [r5] + adds r0, r4, 0 + bl sub_81364EC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8136D90 + + thumb_func_start sub_8136DE8 +sub_8136DE8: @ 8136DE8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r5, =0x03005e08 + adds r0, r4, r5 + ldrb r0, [r0, 0x2] + movs r1, 0 + bl sub_8198070 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + bl sub_81363BC + subs r5, 0x8 + adds r4, r5 + ldr r0, =sub_81365C8 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8136DE8 + + thumb_func_start sub_8136E20 +sub_8136E20: @ 8136E20 + push {r4,lr} + lsls r0, 24 + ldr r3, =0x03005d8c + ldr r1, [r3] + lsrs r0, 21 + adds r1, r0 + ldr r2, =0x00000848 + adds r1, r2 + movs r2, 0 + strb r2, [r1] + ldr r1, [r3] + adds r1, r0 + ldr r4, =0x00000849 + adds r1, r4 + strb r2, [r1] + ldr r1, [r3] + adds r1, r0 + adds r4, 0x1 + adds r1, r4 + strb r2, [r1] + ldr r1, [r3] + adds r1, r0 + adds r4, 0x1 + adds r1, r4 + strb r2, [r1] + ldr r1, [r3] + adds r1, r0 + adds r4, 0x1 + adds r1, r4 + strb r2, [r1] + ldr r1, [r3] + adds r1, r0 + adds r4, 0x1 + adds r1, r4 + strb r2, [r1] + ldr r1, [r3] + adds r1, r0 + ldr r0, =0x0000084e + adds r1, r0 + strb r2, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8136E20 + + thumb_func_start sub_8136E88 +sub_8136E88: @ 8136E88 + push {r4,lr} + movs r4, 0 +_08136E8C: + adds r0, r4, 0 + bl sub_8136E20 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x27 + bls _08136E8C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8136E88 + + thumb_func_start sub_8136EA4 +sub_8136EA4: @ 8136EA4 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x1 + bl sub_8136F9C + lsls r0, 24 + lsrs r5, r0, 24 + movs r1, 0x1 +_08136EB4: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8136F9C + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bcs _08136ECC + adds r5, r0, 0 +_08136ECC: + adds r1, r4, 0 + cmp r1, 0x4 + bls _08136EB4 + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8136EA4 + + thumb_func_start sub_8136EDC +sub_8136EDC: @ 8136EDC + push {lr} + movs r1, 0x6 + bl sub_8136F9C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x63 + bls _08136EEE + movs r0, 0x63 +_08136EEE: + pop {r1} + bx r1 + thumb_func_end sub_8136EDC + + thumb_func_start sub_8136EF4 +sub_8136EF4: @ 8136EF4 + push {lr} + movs r1, 0 + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r3, =0x00000848 +_08136EFE: + lsls r0, r1, 3 + adds r0, r2, r0 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _08136F18 + lsls r0, r1, 24 + asrs r0, 24 + b _08136F26 + .pool +_08136F18: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x27 + bls _08136EFE + movs r0, 0x1 + negs r0, r0 +_08136F26: + pop {r1} + bx r1 + thumb_func_end sub_8136EF4 + + thumb_func_start sub_8136F2C +sub_8136F2C: @ 8136F2C + push {r4,lr} + adds r4, r0, 0 + bl sub_8136EF4 + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08136F60 + ldr r0, =0x03005d8c + ldr r2, [r0] + lsls r0, r1, 3 + ldr r1, =0x00000848 + adds r2, r1 + adds r2, r0 + ldr r0, [r4] + ldr r1, [r4, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + movs r0, 0x1 + b _08136F62 + .pool +_08136F60: + movs r0, 0 +_08136F62: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8136F2C + + thumb_func_start sub_8136F68 +sub_8136F68: @ 8136F68 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x03005d8c + ldr r0, [r0] + lsls r1, r2, 3 + adds r0, r1 + ldr r1, =0x00000848 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08136F94 + adds r0, r2, 0 + bl sub_8136E20 + movs r0, 0x1 + b _08136F96 + .pool +_08136F94: + movs r0, 0 +_08136F96: + pop {r1} + bx r1 + thumb_func_end sub_8136F68 + + thumb_func_start sub_8136F9C +sub_8136F9C: @ 8136F9C + push {lr} + lsls r1, 24 + lsrs r1, 24 + adds r2, r1, 0 + cmp r1, 0 + bne _08136FAC + ldrb r0, [r0] + b _08136FDE +_08136FAC: + cmp r1, 0x1 + bne _08136FB4 + ldrb r0, [r0, 0x1] + b _08136FDE +_08136FB4: + cmp r1, 0x2 + bne _08136FBC + ldrb r0, [r0, 0x2] + b _08136FDE +_08136FBC: + cmp r1, 0x3 + bne _08136FC4 + ldrb r0, [r0, 0x3] + b _08136FDE +_08136FC4: + cmp r1, 0x4 + bne _08136FCC + ldrb r0, [r0, 0x4] + b _08136FDE +_08136FCC: + cmp r1, 0x5 + bne _08136FD4 + ldrb r0, [r0, 0x5] + b _08136FDE +_08136FD4: + cmp r2, 0x6 + beq _08136FDC + movs r0, 0 + b _08136FDE +_08136FDC: + ldrb r0, [r0, 0x6] +_08136FDE: + pop {r1} + bx r1 + thumb_func_end sub_8136F9C + + thumb_func_start sub_8136FE4 +sub_8136FE4: @ 8136FE4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r1 + lsls r0, 24 + lsrs r0, 24 + movs r6, 0 + movs r4, 0 + ldr r1, =gUnknown_085B25A0 + mov r9, r1 + lsls r1, r0, 2 + adds r7, r1, r0 +_08136FFE: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, r8 + adds r1, r5, 0 + bl sub_8136F9C + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + ble _0813702A + adds r0, r7, r4 + add r0, r9 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + muls r1, r0 + lsls r0, r6, 16 + asrs r0, 16 + adds r0, r1 + lsls r0, 16 + lsrs r6, r0, 16 +_0813702A: + adds r4, r5, 0 + cmp r4, 0x4 + bls _08136FFE + lsls r0, r6, 16 + asrs r0, 16 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8136FE4 + + thumb_func_start sub_8137044 +sub_8137044: @ 8137044 + push {r4,lr} + adds r4, r1, 0 + movs r1, 0 + bl sub_8136F9C + lsls r0, 24 + ldr r1, =gUnknown_085B262C + lsrs r0, 22 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl CopyString + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8137044 + + thumb_func_start sub_8137068 +sub_8137068: @ 8137068 + push {r4-r7,lr} + adds r6, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r7, =gUnknown_085B262C +_08137074: + lsls r1, r4, 3 + ldr r0, =gUnknown_085B2720 + adds r1, r0 + adds r0, r5, 0 + bl sub_8136FE4 + lsls r0, 16 + cmp r0, 0 + ble _081370A0 + adds r0, r4, 0x1 + lsls r0, 2 + adds r0, r7 + ldr r1, [r0] + adds r0, r6, 0 + bl CopyString + movs r0, 0x1 + b _081370AC + .pool +_081370A0: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _08137074 + movs r0, 0 +_081370AC: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8137068 + + thumb_func_start sub_81370B4 +sub_81370B4: @ 81370B4 + push {r4-r7,lr} + adds r5, r0, 0 + movs r7, 0 + movs r6, 0 +_081370BC: + adds r1, r7, 0x1 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_8136F9C + adds r4, r0, 0 + adds r1, r6, 0x1 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_8136F9C + lsls r4, 16 + lsls r0, 16 + lsls r1, r6, 16 + cmp r4, r0 + bge _081370E2 + lsrs r7, r1, 16 +_081370E2: + movs r2, 0x80 + lsls r2, 9 + adds r0, r1, r2 + lsrs r6, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _081370BC + lsls r0, r7, 24 + lsrs r0, 24 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_81370B4 + + thumb_func_start sub_81370FC +sub_81370FC: @ 81370FC + push {r4,lr} + bl sub_81798D0 + lsls r0, 24 + cmp r0, 0 + beq _08137134 + ldr r4, =0x020375f0 + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + ldr r1, =0x03005db0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =0x0203ceec + ldr r0, =sub_8179918 + b _08137152 + .pool +_08137134: + ldr r0, =0x02037318 + ldrb r0, [r0, 0x15] + cmp r0, 0x1 + bne _08137170 + ldr r0, =0x00000888 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08137170 + ldr r1, =0x03005db0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =0x0203ceec + ldr r0, =hm2_flash +_08137152: + str r0, [r1] + movs r0, 0x1 + b _08137172 + .pool +_08137170: + movs r0, 0 +_08137172: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81370FC + + thumb_func_start hm2_flash +hm2_flash: @ 8137178 + push {r4,lr} + bl oei_task_add + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl brm_get_pokemon_selection + ldr r1, =0x02038c08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r2, =sub_81371B4 + lsrs r1, r2, 16 + strh r1, [r0, 0x18] + strh r2, [r0, 0x1A] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end hm2_flash + + thumb_func_start sub_81371B4 +sub_81371B4: @ 81371B4 + push {lr} + movs r0, 0xCF + bl audio_play + ldr r0, =0x00000888 + bl FlagSet + ldr r0, =gUnknown_082926F8 + bl script_env_1_execute_new_script + pop {r0} + bx r0 + .pool + thumb_func_end sub_81371B4 + + thumb_func_start sub_81371D4 +sub_81371D4: @ 81371D4 + push {lr} + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_81371D4 + + thumb_func_start sub_81371EC +sub_81371EC: @ 81371EC + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_81371EC + + thumb_func_start c2_change_map +c2_change_map: @ 8137200 + push {r4,lr} + sub sp, 0x8 + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0xC + movs r1, 0 + bl SetGpuReg + movs r0, 0xA + movs r1, 0 + bl SetGpuReg + movs r0, 0x8 + movs r1, 0 + bl SetGpuReg + movs r0, 0x18 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + movs r0, 0x16 + movs r1, 0 + bl SetGpuReg + movs r0, 0x10 + movs r1, 0 + bl SetGpuReg + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, =0x040000d4 + mov r0, sp + str r0, [r1] + movs r0, 0xC0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, =0x8100c000 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r4, 0 + str r4, [sp, 0x4] + add r0, sp, 0x4 + str r0, [r1] + movs r0, 0xE0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, =0x85000100 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + mov r0, sp + strh r4, [r0] + str r0, [r1] + ldr r0, =0x05000002 + str r0, [r1, 0x4] + ldr r0, =0x810001ff + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + bl sub_80A1A74 + bl ResetTasks + bl ResetAllObjectData + ldr r3, =0x04000208 + ldrh r2, [r3] + strh r4, [r3] + ldr r4, =0x04000200 + ldrh r0, [r4] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r4] + strh r2, [r3] + ldr r0, =sub_81371EC + bl SetVBlankCallback + ldr r0, =sub_81371D4 + bl SetMainCallback2 + bl sub_8137304 + lsls r0, 24 + cmp r0, 0 + bne _081372D2 + ldr r0, =0x030022c0 + ldr r0, [r0, 0x8] + bl SetMainCallback2 +_081372D2: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end c2_change_map + + thumb_func_start sub_8137304 +sub_8137304: @ 8137304 + push {r4-r7,lr} + bl get_map_light_from_warp0 + lsls r0, 24 + lsrs r6, r0, 24 + bl sav1_map_get_light_level + lsls r0, 24 + lsrs r5, r0, 24 + movs r3, 0 + ldr r4, =gUnknown_085B27C8 + ldrb r0, [r4] + cmp r0, 0 + beq _08137358 + adds r7, r4, 0 + adds r0, r4, 0x4 + mov r12, r0 +_08137326: + lsls r2, r3, 3 + adds r1, r2, r7 + ldrb r0, [r1] + cmp r0, r6 + bne _08137348 + ldrb r0, [r1, 0x1] + cmp r0, r5 + bne _08137348 + mov r1, r12 + adds r0, r2, r1 + ldr r0, [r0] + bl _call_via_r0 + movs r0, 0x1 + b _0813735A + .pool +_08137348: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 3 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _08137326 +_08137358: + movs r0, 0 +_0813735A: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8137304 + + thumb_func_start sub_8137360 +sub_8137360: @ 8137360 + push {r4-r6,lr} + lsls r0, 24 + lsls r1, 24 + lsrs r5, r0, 24 + lsrs r4, r1, 24 + movs r3, 0 + ldr r1, =gUnknown_085B27C8 + ldrb r0, [r1] + cmp r0, 0 + beq _081373A0 + adds r6, r1, 0 +_08137376: + lsls r0, r3, 3 + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, r5 + bne _08137390 + ldrb r0, [r2, 0x1] + cmp r0, r4 + bne _08137390 + ldrb r0, [r2, 0x2] + b _081373A2 + .pool +_08137390: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08137376 +_081373A0: + movs r0, 0 +_081373A2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8137360 + + thumb_func_start fade_type_for_given_maplight_pair +fade_type_for_given_maplight_pair: @ 81373A8 + push {r4-r6,lr} + lsls r0, 24 + lsls r1, 24 + lsrs r5, r0, 24 + lsrs r4, r1, 24 + movs r3, 0 + ldr r1, =gUnknown_085B27C8 + ldrb r0, [r1] + cmp r0, 0 + beq _081373E8 + adds r6, r1, 0 +_081373BE: + lsls r0, r3, 3 + adds r2, r0, r6 + ldrb r0, [r2] + cmp r0, r5 + bne _081373D8 + ldrb r0, [r2, 0x1] + cmp r0, r4 + bne _081373D8 + ldrb r0, [r2, 0x3] + b _081373EA + .pool +_081373D8: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _081373BE +_081373E8: + movs r0, 0 +_081373EA: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end fade_type_for_given_maplight_pair + + thumb_func_start sub_81373F0 +sub_81373F0: @ 81373F0 + push {lr} + ldr r0, =sub_8137404 + movs r1, 0 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81373F0 + + thumb_func_start sub_8137404 +sub_8137404: @ 8137404 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =sub_8137420 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8137404 + + thumb_func_start sub_8137420 +sub_8137420: @ 8137420 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0 + bl SetGpuReg + ldr r0, =gUnknown_085B2A90 + ldr r1, =0x0600c000 + bl LZ77UnCompVram + ldr r0, =gUnknown_085B28B0 + ldr r1, =0x0600f800 + bl LZ77UnCompVram + ldr r0, =gUnknown_085B2850 + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_085B28A0 + movs r1, 0xE0 + movs r2, 0x10 + bl gpu_pal_apply + ldr r1, =0x00003e41 + movs r0, 0x50 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + ldr r1, =0x00001f0c + movs r0, 0x8 + bl SetGpuReg + movs r1, 0x8A + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81374C4 + str r1, [r0] + movs r2, 0 + movs r1, 0x10 + strh r1, [r0, 0x8] + strh r2, [r0, 0xA] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8137420 + + thumb_func_start sub_81374C4 +sub_81374C4: @ 81374C4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r5, r1, r2 + ldrh r4, [r5, 0xA] + movs r0, 0x80 + lsls r0, 5 + adds r1, r4, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + cmp r4, 0x10 + bhi _081374F8 + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + b _08137500 + .pool +_081374F8: + movs r0, 0 + strh r0, [r5, 0xC] + ldr r0, =sub_813750C + str r0, [r5] +_08137500: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81374C4 + + thumb_func_start sub_813750C +sub_813750C: @ 813750C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =0x00001010 + movs r0, 0x52 + bl SetGpuReg + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r1 + ldrh r1, [r4, 0xC] + cmp r1, 0x7 + bhi _08137554 + adds r0, r1, 0x1 + strh r0, [r4, 0xC] + lsls r1, 1 + ldr r0, =gUnknown_085B28A0 + adds r0, r1, r0 + movs r2, 0x10 + subs r2, r1 + lsls r2, 16 + lsrs r2, 16 + movs r1, 0xE0 + bl gpu_pal_apply + b _08137566 + .pool +_08137554: + ldr r0, =gUnknown_085B2850 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =sub_8137574 + str r0, [r4] + movs r0, 0x8 + strh r0, [r4, 0xC] +_08137566: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813750C + + thumb_func_start sub_8137574 +sub_8137574: @ 8137574 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r2, [r1, 0xC] + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _08137598 + subs r0, r2, 0x1 + strh r0, [r1, 0xC] + b _081375A0 + .pool +_08137598: + ldr r0, =0x030022c0 + ldr r0, [r0, 0x8] + bl SetMainCallback2 +_081375A0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8137574 + + thumb_func_start sub_81375A8 +sub_81375A8: @ 81375A8 + push {lr} + ldr r0, =sub_81375BC + movs r1, 0 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81375A8 + + thumb_func_start sub_81375BC +sub_81375BC: @ 81375BC + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =sub_81375D8 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_81375BC + + thumb_func_start sub_81375D8 +sub_81375D8: @ 81375D8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0 + bl SetGpuReg + ldr r0, =gUnknown_085B2A90 + ldr r1, =0x0600c000 + bl LZ77UnCompVram + ldr r0, =gUnknown_085B28B0 + ldr r1, =0x0600f800 + bl LZ77UnCompVram + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + ldr r1, =0x00001f0c + movs r0, 0x8 + bl SetGpuReg + movs r1, 0x8A + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r0, =gUnknown_085B2850 + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_085B2870 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8137678 + str r1, [r0] + movs r2, 0 + movs r1, 0x10 + strh r1, [r0, 0x8] + strh r2, [r0, 0xA] + strh r2, [r0, 0xC] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81375D8 + + thumb_func_start sub_8137678 +sub_8137678: @ 8137678 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r1, [r4, 0xC] + cmp r1, 0xF + bhi _081376B4 + adds r2, r1, 0x1 + adds r0, r2, 0x1 + strh r0, [r4, 0xC] + movs r0, 0xF + subs r0, r1 + lsls r0, 1 + ldr r1, =gUnknown_085B2890 + adds r0, r1 + lsls r2, 17 + lsrs r2, 16 + movs r1, 0xE0 + bl gpu_pal_apply + b _081376C8 + .pool +_081376B4: + ldr r1, =0x00001010 + movs r0, 0x52 + bl SetGpuReg + ldr r1, =0x00003e41 + movs r0, 0x50 + bl SetGpuReg + ldr r0, =sub_81376DC + str r0, [r4] +_081376C8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8137678 + + thumb_func_start sub_81376DC +sub_81376DC: @ 81376DC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r5, r1, r2 + ldrh r0, [r5, 0xA] + movs r1, 0x10 + subs r1, r0 + lsls r1, 16 + lsrs r4, r1, 16 + movs r0, 0x80 + lsls r0, 21 + adds r1, r0 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + cmp r4, 0 + beq _08137714 + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + b _08137726 + .pool +_08137714: + ldr r0, =gUnknown_085B2870 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =0x030022c0 + ldr r0, [r0, 0x8] + bl SetMainCallback2 +_08137726: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81376DC + + thumb_func_start sub_8137734 +sub_8137734: @ 8137734 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x1C + bl sp000_heal_pokemon + ldr r4, =0x00000864 + adds r0, r4, 0 + bl FlagGet + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + bne _08137760 + ldr r0, =0x0203bce4 + strb r1, [r0] + b _0813776C + .pool +_08137760: + ldr r1, =0x0203bce4 + movs r0, 0 + strb r0, [r1] + adds r0, r4, 0 + bl FlagSet +_0813776C: + movs r0, 0x1 + bl sub_80847F8 + cmp r0, 0 + bne _0813778E + ldr r0, =0x03005d90 + ldr r2, [r0] + ldrh r1, [r2, 0xE] + lsls r1, 16 + ldrb r0, [r2, 0x10] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x11] + orrs r1, r0 + movs r0, 0x1 + bl sav12_xor_set +_0813778E: + bl sub_8076D48 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _081377AC + movs r0, 0x1 + bl sub_8084F6C + b _081377B2 + .pool +_081377AC: + movs r0, 0x2 + bl sub_8084F6C +_081377B2: + movs r7, 0 + movs r6, 0 + add r0, sp, 0x18 + mov r8, r0 + mov r5, sp +_081377BC: + movs r0, 0x64 + adds r1, r6, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + movs r0, 0 + strb r6, [r5] + strb r0, [r5, 0x1] + adds r0, r4, 0 + movs r1, 0x5 + bl pokemon_getattr + cmp r0, 0 + beq _0813780A + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _0813780A + adds r0, r4, 0 + movs r1, 0x43 + bl pokemon_getattr + cmp r0, 0 + bne _0813780A + movs r0, 0x1 + mov r1, r8 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x43 + add r2, sp, 0x18 + bl pokemon_setattr + adds r0, r4, 0 + bl sub_80EE5A4 + strb r0, [r5, 0x1] + movs r7, 0x1 +_0813780A: + adds r5, 0x4 + adds r6, 0x1 + cmp r6, 0x5 + ble _081377BC + cmp r7, 0x1 + bne _0813785A + movs r0, 0x2A + bl sav12_xor_increment + ldr r0, =0x0000089b + bl FlagSet + mov r3, sp + add r2, sp, 0x4 + movs r6, 0x4 +_08137828: + ldrb r1, [r3, 0x1] + ldrb r0, [r2, 0x1] + cmp r0, r1 + bls _08137838 + ldr r1, [sp] + ldr r0, [r2] + str r0, [sp] + str r1, [r2] +_08137838: + adds r2, 0x4 + subs r6, 0x1 + cmp r6, 0 + bge _08137828 + mov r0, sp + ldrb r0, [r0, 0x1] + cmp r0, 0x4 + bls _0813785A + mov r0, sp + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x43 + bl sub_80EE4DC +_0813785A: + ldr r0, =sub_8173694 + bl SetMainCallback2 + movs r0, 0 + add sp, 0x1C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8137734 + + thumb_func_start sp0C8_whiteout_maybe +sp0C8_whiteout_maybe: @ 813787C + push {lr} + ldr r0, =c2_whiteout + bl SetMainCallback2 + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sp0C8_whiteout_maybe + + thumb_func_start sub_8137890 +sub_8137890: @ 8137890 + push {r4,lr} + ldr r0, =0x00004024 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =0x00004025 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + lsls r4, 16 + orrs r4, r0 + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8137890 + + thumb_func_start sub_81378BC +sub_81378BC: @ 81378BC + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x00004024 + lsrs r1, r4, 16 + bl VarSet + ldr r0, =0x00004025 + lsls r4, 16 + lsrs r4, 16 + adds r1, r4, 0 + bl VarSet + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81378BC + + thumb_func_start sub_81378E4 +sub_81378E4: @ 81378E4 + push {r4,lr} + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsls r0, 16 + lsrs r0, 16 + orrs r4, r0 + adds r0, r4, 0 + bl sub_81378BC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81378E4 + + thumb_func_start sub_8137904 +sub_8137904: @ 8137904 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + bl sub_8137890 + adds r1, r0, 0 + cmp r4, 0 + beq _08137928 + ldr r3, =0x41c64e6d + ldr r2, =0x00003039 +_08137918: + adds r0, r1, 0 + muls r0, r3 + adds r1, r0, r2 + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + bne _08137918 +_08137928: + adds r0, r1, 0 + bl sub_81378BC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8137904 + + thumb_func_start sub_813793C +sub_813793C: @ 813793C + push {r4-r6,lr} + bl sub_8137890 + lsrs r6, r0, 16 + movs r5, 0 +_08137946: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _08137978 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + ldr r1, =0x0000ffff + ands r1, r0 + cmp r1, r6 + bne _08137978 + movs r0, 0x1 + b _08137980 + .pool +_08137978: + adds r5, 0x1 + cmp r5, 0x5 + ble _08137946 + movs r0, 0 +_08137980: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_813793C + + thumb_func_start sub_8137988 +sub_8137988: @ 8137988 + push {lr} + bl get_map_light_from_warp0 + lsls r0, 24 + lsrs r0, 24 + bl is_light_level_1_2_3_5_or_6 + lsls r0, 24 + cmp r0, 0 + beq _081379CE + bl GameFreakRTC_CalcLocalDateTime + ldr r1, =gUnknown_085B2B44 + ldr r0, =0x03005cf8 + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _081379C8 + ldr r0, =0x0000089a + bl FlagSet + b _081379CE + .pool +_081379C8: + ldr r0, =0x0000089a + bl FlagReset +_081379CE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8137988 + + thumb_func_start sub_81379D8 +sub_81379D8: @ 81379D8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80AC3BC + lsls r0, 24 + cmp r0, 0 + beq _081379F2 + bl script_env_2_enable_and_set_ctx_running + adds r0, r4, 0 + bl DestroyTask +_081379F2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81379D8 + + thumb_func_start sub_81379F8 +sub_81379F8: @ 81379F8 + push {lr} + ldr r0, =sub_81379D8 + movs r1, 0x50 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81379F8 + + thumb_func_start sub_8137A0C +sub_8137A0C: @ 8137A0C + push {lr} + ldr r0, =0x00004049 + bl GetVarPointer + movs r1, 0 + strh r1, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8137A0C + + thumb_func_start sub_8137A20 +sub_8137A20: @ 8137A20 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =0x00004049 + bl GetVarPointer + adds r5, r0, 0 + ldrh r0, [r5] + adds r4, r0 + strh r4, [r5] + ldrh r0, [r5] + movs r1, 0x7 + bl __umodsi3 + strh r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8137A20 + + thumb_func_start sub_8137A4C +sub_8137A4C: @ 8137A4C + push {lr} + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0 + bne _08137A70 + movs r0, 0 + bl sub_80C0844 + ldr r1, =0x020375e2 + strh r0, [r1] + movs r0, 0x1 + bl sub_80C0844 + b _08137A80 + .pool +_08137A70: + movs r0, 0 + bl pokedex_count + ldr r1, =0x020375e2 + strh r0, [r1] + movs r0, 0x1 + bl pokedex_count +_08137A80: + ldr r1, =0x020375e4 + strh r0, [r1] + bl sub_809D42C + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8137A4C + + thumb_func_start sub_8137A98 +sub_8137A98: @ 8137A98 + push {lr} + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x9 + bhi _08137AA4 + b _08137BFC +_08137AA4: + cmp r0, 0x13 + bhi _08137AB0 + ldr r0, =gUnknown_082A5DAB + b _08137C06 + .pool +_08137AB0: + cmp r0, 0x1D + bhi _08137ABC + ldr r0, =gUnknown_082A5DF1 + b _08137C06 + .pool +_08137ABC: + cmp r0, 0x27 + bhi _08137AC8 + ldr r0, =gUnknown_082A5E34 + b _08137C06 + .pool +_08137AC8: + cmp r0, 0x31 + bhi _08137AD4 + ldr r0, =gUnknown_082A5E83 + b _08137C06 + .pool +_08137AD4: + cmp r0, 0x3B + bhi _08137AE0 + ldr r0, =gUnknown_082A5EB9 + b _08137C06 + .pool +_08137AE0: + cmp r0, 0x45 + bhi _08137AEC + ldr r0, =gUnknown_082A5EF4 + b _08137C06 + .pool +_08137AEC: + cmp r0, 0x4F + bhi _08137AF8 + ldr r0, =gUnknown_082A5F39 + b _08137C06 + .pool +_08137AF8: + cmp r0, 0x59 + bhi _08137B04 + ldr r0, =gUnknown_082A5F82 + b _08137C06 + .pool +_08137B04: + cmp r0, 0x63 + bhi _08137B10 + ldr r0, =gUnknown_082A5FB9 + b _08137C06 + .pool +_08137B10: + cmp r0, 0x6D + bhi _08137B1C + ldr r0, =gUnknown_082A6018 + b _08137C06 + .pool +_08137B1C: + cmp r0, 0x77 + bhi _08137B28 + ldr r0, =gUnknown_082A6061 + b _08137C06 + .pool +_08137B28: + cmp r0, 0x81 + bhi _08137B34 + ldr r0, =gUnknown_082A609C + b _08137C06 + .pool +_08137B34: + cmp r0, 0x8B + bhi _08137B40 + ldr r0, =gUnknown_082A60D5 + b _08137C06 + .pool +_08137B40: + cmp r0, 0x95 + bhi _08137B4C + ldr r0, =gUnknown_082A6124 + b _08137C06 + .pool +_08137B4C: + cmp r0, 0x9F + bhi _08137B58 + ldr r0, =gUnknown_082A616F + b _08137C06 + .pool +_08137B58: + cmp r0, 0xA9 + bhi _08137B64 + ldr r0, =gUnknown_082A61D6 + b _08137C06 + .pool +_08137B64: + cmp r0, 0xB3 + bhi _08137B70 + ldr r0, =gUnknown_082A623A + b _08137C06 + .pool +_08137B70: + cmp r0, 0xBD + bhi _08137B7C + ldr r0, =gUnknown_082A6287 + b _08137C06 + .pool +_08137B7C: + cmp r0, 0xC7 + bls _08137BEA + cmp r0, 0xC8 + bne _08137BB8 + ldr r0, =0x00000199 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + bne _08137BEA + 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 + bne _08137BEA + b _08137C04 + .pool +_08137BB8: + cmp r0, 0xC9 + bne _08137BF8 + 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 _08137C04 + 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 _08137C04 +_08137BEA: + ldr r0, =gUnknown_082A62C9 + b _08137C06 + .pool +_08137BF8: + cmp r0, 0xCA + beq _08137C04 +_08137BFC: + ldr r0, =gUnknown_082A5D6C + b _08137C06 + .pool +_08137C04: + ldr r0, =gUnknown_082A6312 +_08137C06: + pop {r1} + bx r1 + .pool + thumb_func_end sub_8137A98 + + thumb_func_start sub_8137C10 +sub_8137C10: @ 8137C10 + push {lr} + ldr r0, =0x020375e0 + ldrh r0, [r0] + bl sub_8137A98 + bl box_related_two__2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8137C10 + + thumb_func_start sub_8137C28 +sub_8137C28: @ 8137C28 + push {lr} + ldr r0, =sub_8174194 + bl SetMainCallback2 + bl script_env_2_enable + pop {r0} + bx r0 + .pool + thumb_func_end sub_8137C28 + + thumb_func_start sub_8137C3C +sub_8137C3C: @ 8137C3C + push {lr} + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + ldr r1, =0x03005dac + ldr r0, =mapldr_080CA5C0 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8137C3C + + thumb_func_start mapldr_080CA5C0 +mapldr_080CA5C0: @ 8137C5C + push {lr} + sub sp, 0x4 + bl script_env_2_enable + bl sub_8085784 + bl sp109_CreatePCMenu + bl sub_80E2514 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =sub_8137C94 + movs r1, 0xA + bl CreateTask + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end mapldr_080CA5C0 + + thumb_func_start sub_8137C94 +sub_8137C94: @ 8137C94 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08137CAC + adds r0, r2, 0 + bl DestroyTask +_08137CAC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8137C94 + + thumb_func_start sub_8137CB4 +sub_8137CB4: @ 8137CB4 + push {lr} + ldr r0, =sub_8177888 + bl SetMainCallback2 + bl script_env_2_enable + pop {r0} + bx r0 + .pool + thumb_func_end sub_8137CB4 + + thumb_func_start Special_ViewWallClock +Special_ViewWallClock: @ 8137CC8 + push {lr} + ldr r0, =0x030022c0 + ldr r1, =c2_exit_to_overworld_2_switch + str r1, [r0, 0x8] + ldr r0, =Cb2_ViewWallClock + bl SetMainCallback2 + bl script_env_2_enable + pop {r0} + bx r0 + .pool + thumb_func_end Special_ViewWallClock + + thumb_func_start wild_pokemon_reroll +wild_pokemon_reroll: @ 8137CEC + ldr r0, =0x0203ab54 + movs r1, 0 + strb r1, [r0] + ldr r0, =0x0203ab55 + strb r1, [r0] + ldr r1, =0x0203ab58 + movs r0, 0 + str r0, [r1] + bx lr + .pool + thumb_func_end wild_pokemon_reroll + + thumb_func_start sub_8137D0C +sub_8137D0C: @ 8137D0C + ldr r1, =0x0203ab54 + movs r0, 0x1 + strb r0, [r1] + ldr r1, =0x0203ab55 + movs r0, 0 + strb r0, [r1] + ldr r1, =0x0203ab58 + ldr r0, =0x030022c0 + ldr r0, [r0, 0x20] + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8137D0C + + thumb_func_start sp0E3_walkrun_bitfield_interpretation +sp0E3_walkrun_bitfield_interpretation: @ 8137D34 + push {lr} + movs r0, 0x4 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _08137D46 + movs r0, 0x1 + b _08137D58 +_08137D46: + movs r0, 0x2 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + bne _08137D56 + movs r0, 0 + b _08137D58 +_08137D56: + movs r0, 0x2 +_08137D58: + pop {r1} + bx r1 + thumb_func_end sp0E3_walkrun_bitfield_interpretation + + thumb_func_start sub_8137D5C +sub_8137D5C: @ 8137D5C + push {r4-r7,lr} + adds r7, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + cmp r6, 0x63 + bhi _08137D88 + ldr r4, =0x02021cc4 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r1, =gUnknown_085EB5EE + adds r0, r4, 0 + bl AppendString + b _08137D90 + .pool +_08137D88: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EB5CF + bl CopyString +_08137D90: + ldr r0, =0x00000e0f + cmp r7, r0 + bhi _08137DF0 + ldr r4, =0x02021dc4 + adds r0, r7, 0 + movs r1, 0x3C + bl __udivsi3 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + movs r0, 0xAD + strb r0, [r4, 0x2] + adds r5, r4, 0x3 + adds r0, r7, 0 + movs r1, 0x3C + bl __umodsi3 + movs r1, 0x64 + muls r0, r1 + movs r1, 0x3C + bl __udivsi3 + adds r1, r0, 0 + adds r0, r5, 0 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r1, =gUnknown_085EB5E5 + adds r0, r4, 0 + bl AppendString + b _08137DF8 + .pool +_08137DF0: + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085EB5DA + bl CopyString +_08137DF8: + movs r4, 0 + cmp r6, 0 + bne _08137E0C + movs r4, 0x5 + b _08137E2A + .pool +_08137E0C: + cmp r6, 0x3 + bhi _08137E14 + movs r4, 0x4 + b _08137E2A +_08137E14: + cmp r6, 0x9 + bhi _08137E1C + movs r4, 0x3 + b _08137E2A +_08137E1C: + cmp r6, 0x13 + bhi _08137E24 + movs r4, 0x2 + b _08137E2A +_08137E24: + cmp r6, 0x63 + bhi _08137E2A + movs r4, 0x1 +_08137E2A: + adds r0, r7, 0 + movs r1, 0x3C + bl __udivsi3 + cmp r0, 0xA + bhi _08137E3A + adds r0, r4, 0x5 + b _08137E58 +_08137E3A: + cmp r0, 0xF + bhi _08137E42 + adds r0, r4, 0x4 + b _08137E58 +_08137E42: + cmp r0, 0x14 + bhi _08137E4A + adds r0, r4, 0x3 + b _08137E58 +_08137E4A: + cmp r0, 0x28 + bhi _08137E52 + adds r0, r4, 0x2 + b _08137E58 +_08137E52: + cmp r0, 0x3B + bhi _08137E5C + adds r0, r4, 0x1 +_08137E58: + lsls r0, 24 + lsrs r4, r0, 24 +_08137E5C: + ldr r0, =0x020375f0 + strh r4, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8137D5C + + thumb_func_start sub_8137E6C +sub_8137E6C: @ 8137E6C + push {r4,r5,lr} + ldr r0, =0x030022c0 + ldr r1, =0x0203ab58 + ldr r4, [r0, 0x20] + ldr r0, [r1] + subs r4, r0 + ldr r5, =0x0203ab55 + ldrb r1, [r5] + adds r0, r4, 0 + bl sub_8137D5C + ldrb r1, [r5] + adds r0, r4, 0 + bl sub_8137E9C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8137E6C + + thumb_func_start sub_8137E9C +sub_8137E9C: @ 8137E9C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + ldr r6, =0x00004028 + adds r0, r6, 0 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r7, =0x00004029 + adds r0, r7, 0 + bl VarGet + lsls r0, 16 + adds r4, r0 + cmp r4, r5 + bhi _08137ECC + cmp r4, 0 + bne _08137EE6 +_08137ECC: + lsls r1, r5, 16 + lsrs r1, 16 + adds r0, r6, 0 + bl VarSet + lsrs r1, r5, 16 + adds r0, r7, 0 + bl VarSet + ldr r0, =0x00004027 + mov r1, r8 + bl VarSet +_08137EE6: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8137E9C + + thumb_func_start sub_8137EFC +sub_8137EFC: @ 8137EFC + push {r4,lr} + ldr r0, =0x00004028 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =0x00004029 + bl VarGet + lsls r0, 16 + adds r4, r0 + cmp r4, 0 + beq _08137F3C + ldr r0, =0x00004027 + bl VarGet + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_8137D5C + movs r0, 0x1 + b _08137F3E + .pool +_08137F3C: + movs r0, 0 +_08137F3E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8137EFC + + thumb_func_start sub_8137F44 +sub_8137F44: @ 8137F44 + push {r4,lr} + ldr r0, =0x020322dc + ldrh r1, [r0] + ldr r0, =0x00000c1d + cmp r1, r0 + beq _08137F7C + ldr r4, =0x000040a9 + adds r0, r4, 0 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + beq _08137F6E + adds r0, r4, 0 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3 + bne _08137F7C +_08137F6E: + adds r0, r4, 0 + movs r1, 0 + bl VarSet + movs r0, 0 + bl sav1_set_battle_music_maybe +_08137F7C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8137F44 + + thumb_func_start sub_8137F90 +sub_8137F90: @ 8137F90 + push {lr} + ldr r0, =0x0000088d + bl FlagSet + ldr r0, =0x0000404a + bl GetVarPointer + movs r1, 0 + strh r1, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8137F90 + + thumb_func_start sub_8137FB0 +sub_8137FB0: @ 8137FB0 + push {lr} + ldr r0, =0x0000088d + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end sub_8137FB0 + + thumb_func_start sub_8137FC0 +sub_8137FC0: @ 8137FC0 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x0000088d + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08137FE6 + ldr r0, =0x0000404a + bl GetVarPointer + ldrh r1, [r0] + adds r1, r4, r1 + strh r1, [r0] + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0xCC + bhi _08137FF4 +_08137FE6: + movs r0, 0 + b _08137FF6 + .pool +_08137FF4: + movs r0, 0x1 +_08137FF6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8137FC0 + + thumb_func_start sub_8137FFC +sub_8137FFC: @ 8137FFC + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + adds r5, r1, 0 + adds r6, r2, 0 + adds r7, r3, 0 + ldr r0, =0x0000404a + bl GetVarPointer + adds r4, r0, 0 + ldr r0, =0x000040b4 + bl GetVarPointer + ldrh r0, [r0] + subs r0, 0x1 + cmp r0, 0x9 + bhi _081380C2 + lsls r0, 2 + ldr r1, =_08138038 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08138038: + .4byte _08138060 + .4byte _08138070 + .4byte _08138064 + .4byte _08138068 + .4byte _08138068 + .4byte _0813806C + .4byte _08138098 + .4byte _08138060 + .4byte _08138064 + .4byte _0813806C +_08138060: + movs r0, 0x1 + b _081380CE +_08138064: + movs r0, 0x4 + b _081380CE +_08138068: + movs r0, 0x2 + b _081380CE +_0813806C: + movs r0, 0x3 + b _081380CE +_08138070: + ldrh r0, [r4] + cmp r0, 0x3B + bhi _08138080 + movs r0, 0x31 + strb r0, [r5] + ldrh r0, [r4] + adds r0, 0x13 + b _081380C0 +_08138080: + cmp r0, 0x8B + bhi _0813808E + movs r0, 0x30 + strb r0, [r5] + ldrh r0, [r4] + subs r0, 0x3C + b _081380C0 +_0813808E: + movs r0, 0x2F + strb r0, [r5] + ldrh r0, [r4] + subs r0, 0x8C + b _081380C0 +_08138098: + ldrh r0, [r4] + cmp r0, 0x41 + bhi _081380A8 + movs r0, 0x2F + strb r0, [r5] + ldrh r1, [r4] + movs r0, 0x41 + b _081380BE +_081380A8: + cmp r0, 0x91 + bhi _081380B6 + movs r0, 0x30 + strb r0, [r5] + ldrh r1, [r4] + movs r0, 0x91 + b _081380BE +_081380B6: + movs r0, 0x31 + strb r0, [r5] + ldrh r1, [r4] + movs r0, 0xE0 +_081380BE: + subs r0, r1 +_081380C0: + strh r0, [r6] +_081380C2: + movs r0, 0 + mov r1, r8 + strb r0, [r1] + movs r0, 0x14 + strh r0, [r7] + movs r0, 0 +_081380CE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8137FFC + + thumb_func_start is_tile_that_overrides_player_control +is_tile_that_overrides_player_control: @ 81380D8 + push {lr} + movs r0, 0x88 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0813810A + ldr r0, =0x02037318 + ldrb r0, [r0, 0x17] + cmp r0, 0x1 + blt _0813810A + cmp r0, 0x3 + ble _081380F6 + cmp r0, 0x6 + bne _0813810A +_081380F6: + ldr r0, =0x000040f2 + bl GetVarPointer + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0xF9 + bhi _08138118 +_0813810A: + movs r0, 0 + b _0813811A + .pool +_08138118: + movs r0, 0x1 +_0813811A: + pop {r1} + bx r1 + thumb_func_end is_tile_that_overrides_player_control + + thumb_func_start sub_8138120 +sub_8138120: @ 8138120 + push {lr} + movs r0, 0x8A + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08138152 + ldr r0, =0x02037318 + ldrb r0, [r0, 0x17] + cmp r0, 0x1 + blt _08138152 + cmp r0, 0x3 + ble _0813813E + cmp r0, 0x6 + bne _08138152 +_0813813E: + ldr r0, =0x000040f3 + bl GetVarPointer + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0x9 + bhi _08138160 +_08138152: + movs r0, 0 + b _08138162 + .pool +_08138160: + movs r0, 0x1 +_08138162: + pop {r1} + bx r1 + thumb_func_end sub_8138120 + + thumb_func_start sub_8138168 +sub_8138168: @ 8138168 + push {lr} + movs r0, 0x72 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0813819A + ldr r0, =0x02037318 + ldrb r0, [r0, 0x17] + cmp r0, 0x1 + blt _0813819A + cmp r0, 0x3 + ble _08138186 + cmp r0, 0x6 + bne _0813819A +_08138186: + ldr r0, =0x000040f5 + bl GetVarPointer + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0x9 + bhi _081381A8 +_0813819A: + movs r0, 0 + b _081381AA + .pool +_081381A8: + movs r0, 0x1 +_081381AA: + pop {r1} + bx r1 + thumb_func_end sub_8138168 + + thumb_func_start sub_81381B0 +sub_81381B0: @ 81381B0 + push {lr} + movs r0, 0x80 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _081381E2 + ldr r0, =0x02037318 + ldrb r0, [r0, 0x17] + cmp r0, 0x1 + blt _081381E2 + cmp r0, 0x3 + ble _081381CE + cmp r0, 0x6 + bne _081381E2 +_081381CE: + ldr r0, =0x000040f4 + bl GetVarPointer + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0xF9 + bhi _081381F0 +_081381E2: + movs r0, 0 + b _081381F2 + .pool +_081381F0: + movs r0, 0x1 +_081381F2: + pop {r1} + bx r1 + thumb_func_end sub_81381B0 + + thumb_func_start sub_81381F8 +sub_81381F8: @ 81381F8 + push {lr} + movs r0, 0x75 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0813822A + ldr r0, =0x02037318 + ldrb r0, [r0, 0x17] + cmp r0, 0x1 + blt _0813822A + cmp r0, 0x3 + ble _08138216 + cmp r0, 0x6 + bne _0813822A +_08138216: + ldr r0, =0x000040f6 + bl GetVarPointer + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0xF9 + bhi _08138238 +_0813822A: + movs r0, 0 + b _0813823A + .pool +_08138238: + movs r0, 0x1 +_0813823A: + pop {r1} + bx r1 + thumb_func_end sub_81381F8 + + thumb_func_start sub_8138240 +sub_8138240: @ 8138240 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r6, 0 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r7, r0, 24 + bl sub_8009FCC + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + cmp r4, r5 + bcs _0813828A + ldr r0, =gUnknown_0858D144 + mov r8, r0 +_08138262: + cmp r7, r4 + beq _08138280 + lsls r0, r6, 2 + add r0, r8 + ldr r0, [r0] + lsls r1, r4, 3 + subs r1, r4 + lsls r1, 2 + ldr r2, =0x020229f0 + adds r1, r2 + bl CopyString + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_08138280: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _08138262 +_0813828A: + adds r0, r5, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8138240 + + thumb_func_start SpawnLinkPartnerFieldObject +SpawnLinkPartnerFieldObject: @ 81382A0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + movs r7, 0 + movs r0, 0 + mov r9, r0 + mov r8, r0 + ldr r1, =gUnknown_085B2B5C + add r0, sp, 0x8 + movs r2, 0x4 + bl memcpy + add r4, sp, 0xC + ldr r1, =gUnknown_085B2B60 + adds r0, r4, 0 + movs r2, 0x8 + bl memcpy + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x2 + beq _08138310 + cmp r0, 0x2 + bgt _081382F4 + cmp r0, 0x1 + beq _0813833C + b _08138350 + .pool +_081382F4: + cmp r1, 0x3 + beq _081382FE + cmp r1, 0x4 + beq _08138324 + b _08138350 +_081382FE: + movs r7, 0x2 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldrh r0, [r1] + subs r0, 0x1 + b _0813832C + .pool +_08138310: + movs r7, 0x1 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0] + mov r9, r1 + ldrh r0, [r0, 0x2] + subs r0, 0x1 + b _0813834A + .pool +_08138324: + ldr r0, =0x03005d8c + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 +_0813832C: + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + ldrh r1, [r1, 0x2] + mov r8, r1 + b _08138350 + .pool +_0813833C: + movs r7, 0x3 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r3, [r0] + mov r9, r3 + ldrh r0, [r0, 0x2] + adds r0, 0x1 +_0813834A: + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 +_08138350: + movs r6, 0 + b _08138410 + .pool +_08138358: + cmp r10, r6 + beq _0813840A + ldr r0, =0x020229e8 + lsls r2, r6, 3 + subs r1, r2, r6 + lsls r1, 2 + adds r1, r0 + ldrb r3, [r1] + adds r4, r0, 0 + cmp r3, 0x1 + blt _0813838C + cmp r3, 0x2 + ble _0813837C + cmp r3, 0x3 + beq _08138388 + b _0813838C + .pool +_0813837C: + ldrb r0, [r1, 0x13] + movs r5, 0xEC + cmp r0, 0 + bne _0813839C + movs r5, 0xEB + b _0813839C +_08138388: + ldrb r0, [r1, 0x13] + b _08138394 +_0813838C: + subs r0, r2, r6 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x13] +_08138394: + movs r5, 0x69 + cmp r0, 0 + bne _0813839C + movs r5, 0x64 +_0813839C: + mov r0, sp + adds r0, r7 + adds r0, 0x8 + ldrb r1, [r0] + movs r4, 0xF0 + subs r4, r6 + lsls r4, 24 + lsrs r4, 24 + lsls r2, r7, 1 + mov r0, sp + adds r0, r2 + adds r0, 0xC + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + mov r3, r9 + lsls r3, 16 + asrs r3, 16 + mov r12, r3 + add r0, r12 + adds r3, r0, 0x7 + lsls r3, 16 + asrs r3, 16 + mov r12, r3 + mov r0, sp + adds r0, 0xD + adds r0, r2 + movs r2, 0 + ldrsb r2, [r0, r2] + mov r3, r8 + lsls r0, r3, 16 + asrs r0, 16 + adds r0, r2 + adds r0, 0x7 + lsls r0, 16 + asrs r0, 16 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + adds r0, r5, 0 + adds r2, r4, 0 + mov r3, r12 + bl SpawnSpecialFieldObjectParametrized + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_813842C + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x4 + bne _0813840A + movs r7, 0 +_0813840A: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_08138410: + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r6, r0 + bcc _08138358 + 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 SpawnLinkPartnerFieldObject + + thumb_func_start sub_813842C +sub_813842C: @ 813842C + push {r4,r5,lr} + lsls r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r2, 24 + movs r1, 0xC0 + lsls r1, 19 + adds r2, r1 + lsrs r5, r2, 24 + lsrs r4, r0, 24 + movs r2, 0xA8 + lsls r2, 21 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0x1 + bls _08138454 + cmp r4, 0x64 + beq _08138454 + cmp r4, 0x69 + bne _081384E6 +_08138454: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + adds r0, r3, 0 + bl GetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x10 + beq _081384E6 + ldr r1, =0x02037350 + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + lsls r3, r5, 4 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + cmp r4, 0x69 + beq _081384D8 + cmp r4, 0x69 + bgt _081384A8 + cmp r4, 0x64 + beq _081384C4 + b _081384E6 + .pool +_081384A8: + cmp r4, 0xEB + beq _081384B2 + cmp r4, 0xEC + beq _081384BC + b _081384E6 +_081384B2: + ldr r0, =gFieldObjectPalette33 + b _081384C6 + .pool +_081384BC: + ldr r0, =gFieldObjectPalette34 + b _081384C6 + .pool +_081384C4: + ldr r0, =gFieldObjectPalette8 +_081384C6: + movs r2, 0x80 + lsls r2, 1 + adds r1, r3, r2 + movs r2, 0x20 + bl gpu_pal_apply + b _081384E6 + .pool +_081384D8: + ldr r0, =gFieldObjectPalette17 + movs r2, 0x80 + lsls r2, 1 + adds r1, r3, r2 + movs r2, 0x20 + bl gpu_pal_apply +_081384E6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813842C + + thumb_func_start sub_81384F0 +sub_81384F0: @ 81384F0 + push {r4,r5,lr} + movs r4, 0 + ldr r5, =gUnknown_085B2B68 +_081384F6: + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r4, r0 + bne _0813851C + lsls r1, r4, 2 + adds r1, r5 + ldrb r0, [r1] + ldrb r1, [r1, 0x1] + ldr r2, =0x00000206 + bl MapGridSetMetatileIdAt + b _0813852A + .pool +_0813851C: + lsls r1, r4, 2 + adds r1, r5 + ldrb r0, [r1] + ldrb r1, [r1, 0x1] + ldr r2, =0x00000205 + bl MapGridSetMetatileIdAt +_0813852A: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _081384F6 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81384F0 + + thumb_func_start sub_8138540 +sub_8138540: @ 8138540 + push {r4-r6,lr} + movs r5, 0xC +_08138544: + movs r4, 0x7 + adds r6, r5, 0x1 +_08138548: + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridGetMetatileIdAt + ldr r1, =0xfffffde6 + adds r0, r1 + cmp r0, 0x37 + bls _0813855A + b _08138734 +_0813855A: + lsls r0, 2 + ldr r1, =_0813856C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0813856C: + .4byte _081386F2 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _0813864C + .4byte _08138652 + .4byte _0813868C + .4byte _08138694 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _0813865C + .4byte _08138662 + .4byte _0813869C + .4byte _081386A4 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _0813866C + .4byte _08138672 + .4byte _081386AC + .4byte _081386B4 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _0813867C + .4byte _08138684 + .4byte _081386BC + .4byte _081386C4 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _081386CC + .4byte _081386DC + .4byte _081386EC + .4byte _08138714 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _081386D4 + .4byte _081386E4 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _08138734 + .4byte _0813872A + .4byte _0813871C +_0813864C: + movs r2, 0x8C + lsls r2, 2 + b _08138720 +_08138652: + ldr r2, =0x00000231 + b _08138720 + .pool +_0813865C: + movs r2, 0x8E + lsls r2, 2 + b _08138720 +_08138662: + ldr r2, =0x00000239 + b _08138720 + .pool +_0813866C: + movs r2, 0x88 + lsls r2, 2 + b _08138720 +_08138672: + ldr r2, =0x00000221 + b _08138720 + .pool +_0813867C: + ldr r2, =0x00000e28 + b _08138720 + .pool +_08138684: + ldr r2, =0x00000e29 + b _08138720 + .pool +_0813868C: + ldr r2, =0x00000232 + b _08138720 + .pool +_08138694: + ldr r2, =0x00000233 + b _08138720 + .pool +_0813869C: + ldr r2, =0x0000023a + b _08138720 + .pool +_081386A4: + ldr r2, =0x0000023b + b _08138720 + .pool +_081386AC: + ldr r2, =0x00000222 + b _08138720 + .pool +_081386B4: + ldr r2, =0x00000223 + b _08138720 + .pool +_081386BC: + ldr r2, =0x00000e2a + b _08138720 + .pool +_081386C4: + ldr r2, =0x00000e2b + b _08138720 + .pool +_081386CC: + ldr r2, =0x00000e42 + b _08138720 + .pool +_081386D4: + ldr r2, =0x0000021a + b _08138720 + .pool +_081386DC: + ldr r2, =0x00000e43 + b _08138720 + .pool +_081386E4: + ldr r2, =0x0000021a + b _08138720 + .pool +_081386EC: + movs r2, 0xE4 + lsls r2, 4 + b _08138720 +_081386F2: + subs r1, r5, 0x1 + adds r0, r4, 0 + bl MapGridGetMetatileIdAt + movs r1, 0x90 + lsls r1, 2 + cmp r0, r1 + bne _0813870C + ldr r2, =0x00000e48 + b _08138720 + .pool +_0813870C: + ldr r2, =0x00000e49 + b _08138720 + .pool +_08138714: + ldr r2, =0x00000e41 + b _08138720 + .pool +_0813871C: + movs r2, 0xE5 + lsls r2, 4 +_08138720: + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridSetMetatileIdAt + b _08138734 +_0813872A: + ldr r2, =0x00000251 + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridSetMetatileIdAt +_08138734: + adds r4, 0x1 + cmp r4, 0xF + bgt _0813873C + b _08138548 +_0813873C: + adds r5, r6, 0 + cmp r5, 0x17 + bgt _08138744 + b _08138544 +_08138744: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8138540 + + thumb_func_start sub_8138750 +sub_8138750: @ 8138750 + push {r4-r6,lr} + ldr r4, =gUnknown_085B2B68 + movs r5, 0x3 +_08138756: + ldrb r0, [r4] + ldrb r1, [r4, 0x1] + ldr r2, =0x00000206 + bl MapGridSetMetatileIdAt + adds r4, 0x4 + subs r5, 0x1 + cmp r5, 0 + bge _08138756 + movs r5, 0xC +_0813876A: + movs r4, 0x7 + adds r6, r5, 0x1 +_0813876E: + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridGetMetatileIdAt + ldr r1, =0xfffffde0 + adds r0, r1 + cmp r0, 0x30 + bls _08138780 + b _081388CA +_08138780: + lsls r0, 2 + ldr r1, =_0813879C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0813879C: + .4byte _08138860 + .4byte _08138866 + .4byte _08138880 + .4byte _08138888 + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _08138870 + .4byte _08138876 + .4byte _08138890 + .4byte _08138898 + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388A0 + .4byte _081388A8 + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388B0 + .4byte _081388B0 + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388CA + .4byte _081388C0 +_08138860: + movs r2, 0x8C + lsls r2, 2 + b _081388B2 +_08138866: + ldr r2, =0x00000231 + b _081388B2 + .pool +_08138870: + movs r2, 0x8E + lsls r2, 2 + b _081388B2 +_08138876: + ldr r2, =0x00000239 + b _081388B2 + .pool +_08138880: + ldr r2, =0x00000232 + b _081388B2 + .pool +_08138888: + ldr r2, =0x00000233 + b _081388B2 + .pool +_08138890: + ldr r2, =0x0000023a + b _081388B2 + .pool +_08138898: + ldr r2, =0x0000023b + b _081388B2 + .pool +_081388A0: + ldr r2, =0x00000e42 + b _081388B2 + .pool +_081388A8: + ldr r2, =0x00000e43 + b _081388B2 + .pool +_081388B0: + ldr r2, =0x0000021a +_081388B2: + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridSetMetatileIdAt + b _081388CA + .pool +_081388C0: + ldr r2, =0x00000251 + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridSetMetatileIdAt +_081388CA: + adds r4, 0x1 + cmp r4, 0xF + bgt _081388D2 + b _0813876E +_081388D2: + adds r5, r6, 0 + cmp r5, 0x17 + bgt _081388DA + b _0813876A +_081388DA: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8138750 + + thumb_func_start sub_81388E4 +sub_81388E4: @ 81388E4 + push {lr} + ldr r0, =0x0203ab5c + movs r1, 0 + strb r1, [r0] + ldr r0, =0x0203ab5d + strb r1, [r0] + movs r0, 0x2C + bl audio_play + ldr r0, =sub_8138910 + movs r1, 0x8 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_81388E4 + + thumb_func_start sub_8138910 +sub_8138910: @ 8138910 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =gUnknown_085B2B78 + ldr r5, =0x0203ab5d + ldrb r1, [r5] + adds r0, r1, r0 + ldr r4, =0x0203ab5c + ldrb r2, [r4] + ldrb r0, [r0] + cmp r0, r2 + bne _0813896C + ldr r0, =0x020375e0 + ldrb r0, [r0] + ldr r2, =gUnknown_085B2B7E + lsls r1, 1 + adds r1, r2 + ldrh r1, [r1] + bl sub_8138978 + movs r0, 0 + strb r0, [r4] + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bne _08138970 + adds r0, r6, 0 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running + b _08138970 + .pool +_0813896C: + adds r0, r2, 0x1 + strb r0, [r4] +_08138970: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8138910 + + thumb_func_start sub_8138978 +sub_8138978: @ 8138978 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r2, r1, 16 + movs r7, 0 + subs r0, 0x1 + cmp r0, 0x7 + bhi _08138A40 + lsls r0, 2 + ldr r1, =_081389A0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081389A0: + .4byte _081389C0 + .4byte _081389D2 + .4byte _081389E4 + .4byte _081389F6 + .4byte _08138A04 + .4byte _08138A1A + .4byte _08138A26 + .4byte _08138A34 +_081389C0: + movs r7, 0x2 + mov r1, sp + movs r0, 0x1 + strh r0, [r1] + movs r0, 0x7 + strh r0, [r1, 0x2] + add r1, sp, 0x8 + movs r0, 0x68 + b _08138A14 +_081389D2: + movs r7, 0x2 + mov r1, sp + movs r0, 0x1 + strh r0, [r1] + movs r0, 0x7 + strh r0, [r1, 0x2] + add r1, sp, 0x8 + movs r0, 0x4E + b _08138A14 +_081389E4: + movs r7, 0x2 + mov r1, sp + movs r0, 0x1 + strh r0, [r1] + movs r0, 0x7 + strh r0, [r1, 0x2] + add r1, sp, 0x8 + movs r0, 0x5B + b _08138A14 +_081389F6: + movs r7, 0x1 + mov r1, sp + movs r0, 0x7 + strh r0, [r1] + add r1, sp, 0x8 + movs r0, 0x27 + b _08138A3E +_08138A04: + movs r7, 0x2 + mov r1, sp + movs r0, 0x1 + strh r0, [r1] + movs r0, 0x7 + strh r0, [r1, 0x2] + add r1, sp, 0x8 + movs r0, 0x34 +_08138A14: + strh r0, [r1] + strh r0, [r1, 0x2] + b _08138A40 +_08138A1A: + movs r7, 0x1 + mov r0, sp + strh r7, [r0] + add r1, sp, 0x8 + movs r0, 0x41 + b _08138A3E +_08138A26: + movs r7, 0x1 + mov r1, sp + movs r0, 0x7 + strh r0, [r1] + add r1, sp, 0x8 + movs r0, 0xD + b _08138A3E +_08138A34: + movs r7, 0x1 + mov r0, sp + strh r7, [r0] + add r1, sp, 0x8 + movs r0, 0x1A +_08138A3E: + strh r0, [r1] +_08138A40: + movs r6, 0 + cmp r6, r7 + bcs _08138A92 + movs r1, 0xC0 + lsls r1, 4 + adds r0, r1, 0 + adds r1, r2, 0 + orrs r1, r0 + lsls r1, 16 + mov r9, r1 + adds r1, r2, 0 + adds r1, 0x8 + orrs r1, r0 + lsls r1, 16 + mov r8, r1 +_08138A5E: + lsls r1, r6, 1 + mov r3, sp + adds r5, r3, r1 + ldrh r0, [r5] + adds r0, 0x7 + add r4, sp, 0x8 + adds r4, r1 + ldrh r1, [r4] + adds r1, 0x7 + mov r3, r9 + lsrs r2, r3, 16 + bl MapGridSetMetatileIdAt + ldrh r0, [r5] + adds r0, 0x7 + ldrh r1, [r4] + adds r1, 0x8 + mov r3, r8 + lsrs r2, r3, 16 + bl MapGridSetMetatileIdAt + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, r7 + bcc _08138A5E +_08138A92: + bl DrawWholeMapView + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8138978 + + thumb_func_start sub_8138AA4 +sub_8138AA4: @ 8138AA4 + push {lr} + ldr r0, =0x020375e0 + ldrb r0, [r0] + ldr r1, =gUnknown_085B2B7E + ldrh r1, [r1, 0x8] + bl sub_8138978 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8138AA4 + + thumb_func_start sub_8138AC0 +sub_8138AC0: @ 8138AC0 + push {lr} + ldr r0, =0x02021fc4 + bl box_related_two__2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8138AC0 + + thumb_func_start sub_8138AD0 +sub_8138AD0: @ 8138AD0 + ldr r1, =0x020375e0 + ldr r0, =0x03005d8c + ldr r2, [r0] + ldrh r0, [r2] + strh r0, [r1] + ldr r1, =0x020375e2 + ldrh r0, [r2, 0x2] + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_8138AD0 + + thumb_func_start sub_8138AF0 +sub_8138AF0: @ 8138AF0 + push {lr} + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r1, [r0, 0xB] + lsls r1, 8 + ldrb r0, [r0, 0xA] + orrs r0, r1 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8138AF0 + + thumb_func_start sub_8138B10 +sub_8138B10: @ 8138B10 + push {lr} + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _08138B34 + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EB5F9 + bl CopyString + b _08138B3C + .pool +_08138B34: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EB601 + bl CopyString +_08138B3C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8138B10 + + thumb_func_start sub_8138B48 +sub_8138B48: @ 8138B48 + push {lr} + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _08138B6C + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EB60E + bl CopyString + b _08138B74 + .pool +_08138B6C: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EB60A + bl CopyString +_08138B74: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8138B48 + + thumb_func_start sub_8138B80 +sub_8138B80: @ 8138B80 + ldr r0, =0x0202433a + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8138B80 + + thumb_func_start sub_8138B8C +sub_8138B8C: @ 8138B8C + push {lr} + sub sp, 0x4 + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0 + beq _08138BB0 + movs r2, 0x1 + negs r2, r2 + movs r0, 0x4 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r3, 0x6 + bl warp1_set + b _08138BC2 + .pool +_08138BB0: + movs r2, 0x1 + negs r2, r2 + movs r0, 0x4 + str r0, [sp] + movs r0, 0x13 + movs r1, 0x1 + movs r3, 0x6 + bl warp1_set +_08138BC2: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8138B8C + + thumb_func_start sub_8138BC8 +sub_8138BC8: @ 8138BC8 + push {lr} + ldr r0, =0x020375e0 + ldrh r0, [r0] + bl FlagSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_8138BC8 + + thumb_func_start sub_8138BDC +sub_8138BDC: @ 8138BDC + push {lr} + ldr r0, =0x03005cf8 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0x7 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x0000270f + cmp r0, r1 + bls _08138BF6 + adds r0, r1, 0 +_08138BF6: + pop {r1} + bx r1 + .pool + thumb_func_end sub_8138BDC + + thumb_func_start sub_8138C04 +sub_8138C04: @ 8138C04 + push {r4,lr} + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + cmp r0, 0xFF + bne _08138C2C + movs r0, 0x6 + b _08138C7E + .pool +_08138C2C: + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + cmp r0, 0xC7 + bls _08138C3C + movs r0, 0x5 + b _08138C7E +_08138C3C: + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + cmp r0, 0x95 + bls _08138C4C + movs r0, 0x4 + b _08138C7E +_08138C4C: + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + cmp r0, 0x63 + bls _08138C5C + movs r0, 0x3 + b _08138C7E +_08138C5C: + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + cmp r0, 0x31 + bls _08138C6C + movs r0, 0x2 + b _08138C7E +_08138C6C: + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + cmp r0, 0 + bne _08138C7C + movs r0, 0 + b _08138C7E +_08138C7C: + movs r0, 0x1 +_08138C7E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8138C04 + + thumb_func_start sub_8138C84 +sub_8138C84: @ 8138C84 + push {lr} + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl sub_817018C + pop {r0} + bx r0 + .pool + thumb_func_end sub_8138C84 + + thumb_func_start sub_8138C94 +sub_8138C94: @ 8138C94 + push {lr} + ldr r0, =sub_8138C84 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8138C94 + + thumb_func_start sp0D9_ComputerRelated +sp0D9_ComputerRelated: @ 8138CA4 + push {r4,lr} + ldr r4, =sub_8138CE8 + adds r0, r4, 0 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08138CD8 + adds r0, r4, 0 + movs r1, 0x8 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + strh r2, [r1, 0x8] + strh r0, [r1, 0xA] + strh r2, [r1, 0xC] + strh r2, [r1, 0xE] + strh r2, [r1, 0x10] +_08138CD8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sp0D9_ComputerRelated + + thumb_func_start sub_8138CE8 +sub_8138CE8: @ 8138CE8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r1, r0 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08138D06 + adds r0, r1, 0 + bl sub_8138D10 +_08138D06: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8138CE8 + + thumb_func_start sub_8138D10 +sub_8138D10: @ 8138D10 + push {r4-r6,lr} + adds r4, r0, 0 + movs r6, 0 + movs r5, 0 + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0x6 + bne _08138D7C + strh r5, [r4, 0xE] + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x3 + beq _08138D44 + cmp r0, 0x3 + bgt _08138D3A + cmp r0, 0x2 + beq _08138D40 + b _08138D4C +_08138D3A: + cmp r1, 0x4 + beq _08138D48 + b _08138D4C +_08138D40: + movs r6, 0 + b _08138D4A +_08138D44: + movs r6, 0xFF + b _08138D4A +_08138D48: + movs r6, 0x1 +_08138D4A: + movs r5, 0xFF +_08138D4C: + movs r1, 0x10 + ldrsh r0, [r4, r1] + lsls r1, r6, 24 + asrs r1, 24 + lsls r2, r5, 24 + asrs r2, 24 + bl sub_8138D88 + bl DrawWholeMapView + ldrh r0, [r4, 0x10] + movs r1, 0x1 + eors r0, r1 + strh r0, [r4, 0x10] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _08138D7C + ldrb r0, [r4, 0xA] + bl DestroyTask +_08138D7C: + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8138D10 + + thumb_func_start sub_8138D88 +sub_8138D88: @ 8138D88 + push {r4,r5,lr} + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r4, r2, 24 + movs r3, 0 + lsls r0, 16 + cmp r0, 0 + beq _08138DC4 + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0 + bne _08138DAC + movs r3, 0x4 + b _08138DE6 + .pool +_08138DAC: + cmp r0, 0x1 + bne _08138DB8 + ldr r3, =0x0000025a + b _08138DE6 + .pool +_08138DB8: + cmp r0, 0x2 + bne _08138DE6 + ldr r3, =0x00000259 + b _08138DE6 + .pool +_08138DC4: + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0 + bne _08138DD4 + movs r3, 0x5 + b _08138DE6 + .pool +_08138DD4: + cmp r0, 0x1 + bne _08138DE0 + ldr r3, =0x0000027f + b _08138DE6 + .pool +_08138DE0: + cmp r0, 0x2 + bne _08138DE6 + ldr r3, =0x0000027e +_08138DE6: + ldr r0, =0x03005d8c + ldr r2, [r0] + movs r5, 0 + ldrsh r0, [r2, r5] + lsls r1, 24 + asrs r1, 24 + adds r0, r1 + adds r0, 0x7 + movs r5, 0x2 + ldrsh r1, [r2, r5] + lsls r2, r4, 24 + asrs r2, 24 + adds r1, r2 + adds r1, 0x7 + movs r4, 0xC0 + lsls r4, 4 + adds r2, r4, 0 + orrs r3, r2 + adds r2, r3, 0 + bl MapGridSetMetatileIdAt + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8138D88 + + thumb_func_start sub_8138E20 +sub_8138E20: @ 8138E20 + push {lr} + bl sub_8138E2C + pop {r0} + bx r0 + thumb_func_end sub_8138E20 + + thumb_func_start sub_8138E2C +sub_8138E2C: @ 8138E2C + push {r4-r6,lr} + movs r6, 0 + movs r5, 0 + movs r4, 0 + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x3 + beq _08138E56 + cmp r0, 0x3 + bgt _08138E4C + cmp r0, 0x2 + beq _08138E52 + b _08138E5E +_08138E4C: + cmp r1, 0x4 + beq _08138E5A + b _08138E5E +_08138E52: + movs r6, 0 + b _08138E5C +_08138E56: + movs r6, 0xFF + b _08138E5C +_08138E5A: + movs r6, 0x1 +_08138E5C: + movs r5, 0xFF +_08138E5E: + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0 + bne _08138E70 + movs r4, 0x4 + b _08138E82 + .pool +_08138E70: + cmp r0, 0x1 + bne _08138E7C + ldr r4, =0x0000025a + b _08138E82 + .pool +_08138E7C: + cmp r0, 0x2 + bne _08138E82 + ldr r4, =0x00000259 +_08138E82: + ldr r0, =0x03005d8c + ldr r2, [r0] + movs r1, 0 + ldrsh r0, [r2, r1] + lsls r1, r6, 24 + asrs r1, 24 + adds r0, r1 + adds r0, 0x7 + movs r3, 0x2 + ldrsh r1, [r2, r3] + lsls r2, r5, 24 + asrs r2, 24 + adds r1, r2 + adds r1, 0x7 + movs r3, 0xC0 + lsls r3, 4 + adds r2, r3, 0 + orrs r4, r2 + adds r2, r4, 0 + bl MapGridSetMetatileIdAt + bl DrawWholeMapView + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8138E2C + + thumb_func_start sub_8138EC0 +sub_8138EC0: @ 8138EC0 + push {r4,lr} + ldr r4, =sub_8138F04 + adds r0, r4, 0 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08138EF4 + adds r0, r4, 0 + movs r1, 0x8 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + strh r2, [r1, 0x8] + strh r0, [r1, 0xA] + strh r2, [r1, 0xC] + strh r2, [r1, 0xE] + strh r2, [r1, 0x10] +_08138EF4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8138EC0 + + thumb_func_start sub_8138F04 +sub_8138F04: @ 8138F04 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r1, r0 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08138F22 + adds r0, r1, 0 + bl sub_8138F2C +_08138F22: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8138F04 + + thumb_func_start sub_8138F2C +sub_8138F2C: @ 8138F2C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0x6 + bne _08138F9A + movs r0, 0 + strh r0, [r4, 0xE] + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08138F64 + ldr r2, =0x00000e9d + movs r0, 0x12 + movs r1, 0x8 + bl MapGridSetMetatileIdAt + ldr r2, =0x00000ea5 + movs r0, 0x12 + movs r1, 0x9 + bl MapGridSetMetatileIdAt + b _08138F7A + .pool +_08138F64: + ldr r2, =0x00000e58 + movs r0, 0x12 + movs r1, 0x8 + bl MapGridSetMetatileIdAt + movs r2, 0xE6 + lsls r2, 4 + movs r0, 0x12 + movs r1, 0x9 + bl MapGridSetMetatileIdAt +_08138F7A: + bl DrawWholeMapView + ldrh r0, [r4, 0x10] + movs r1, 0x1 + eors r0, r1 + strh r0, [r4, 0x10] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _08138F9A + ldrb r0, [r4, 0xA] + bl DestroyTask +_08138F9A: + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8138F2C + + thumb_func_start sub_8138FAC +sub_8138FAC: @ 8138FAC + push {lr} + ldr r2, =0x00000e9d + movs r0, 0x12 + movs r1, 0x8 + bl MapGridSetMetatileIdAt + ldr r2, =0x00000ea5 + movs r0, 0x12 + movs r1, 0x9 + bl MapGridSetMetatileIdAt + bl DrawWholeMapView + pop {r0} + bx r0 + .pool + thumb_func_end sub_8138FAC + + thumb_func_start sub_8138FD4 +sub_8138FD4: @ 8138FD4 + push {lr} + ldr r1, =0x020375e0 + ldr r0, =0x000001f5 + strh r0, [r1] + bl FlagSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_8138FD4 + + thumb_func_start sub_8138FEC +sub_8138FEC: @ 8138FEC + push {lr} + ldr r1, =0x020375e0 + ldr r0, =0x000001f5 + strh r0, [r1] + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end sub_8138FEC + + thumb_func_start sub_8139004 +sub_8139004: @ 8139004 + push {lr} + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x16 + bl pokemon_getattr + cmp r0, 0xC7 + bls _08139028 + movs r0, 0x1 + b _0813902A + .pool +_08139028: + movs r0, 0 +_0813902A: + pop {r1} + bx r1 + thumb_func_end sub_8139004 + + thumb_func_start sub_8139030 +sub_8139030: @ 8139030 + push {lr} + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x17 + bl pokemon_getattr + cmp r0, 0xC7 + bls _08139054 + movs r0, 0x1 + b _08139056 + .pool +_08139054: + movs r0, 0 +_08139056: + pop {r1} + bx r1 + thumb_func_end sub_8139030 + + thumb_func_start sub_813905C +sub_813905C: @ 813905C + push {lr} + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x18 + bl pokemon_getattr + cmp r0, 0xC7 + bls _08139080 + movs r0, 0x1 + b _08139082 + .pool +_08139080: + movs r0, 0 +_08139082: + pop {r1} + bx r1 + thumb_func_end sub_813905C + + thumb_func_start sub_8139088 +sub_8139088: @ 8139088 + push {lr} + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x21 + bl pokemon_getattr + cmp r0, 0xC7 + bls _081390AC + movs r0, 0x1 + b _081390AE + .pool +_081390AC: + movs r0, 0 +_081390AE: + pop {r1} + bx r1 + thumb_func_end sub_8139088 + + thumb_func_start sub_81390B4 +sub_81390B4: @ 81390B4 + push {lr} + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2F + bl pokemon_getattr + cmp r0, 0xC7 + bls _081390D8 + movs r0, 0x1 + b _081390DA + .pool +_081390D8: + movs r0, 0 +_081390DA: + pop {r1} + bx r1 + thumb_func_end sub_81390B4 + + thumb_func_start sub_81390E0 +sub_81390E0: @ 81390E0 + push {r4-r6,lr} + movs r5, 0 + ldr r6, =gBaseStats +_081390E6: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x5 + bl pokemon_getattr + cmp r0, 0 + beq _0813913C + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0813913C + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1, 0x6] + cmp r0, 0xC + beq _08139128 + ldrb r0, [r1, 0x7] + cmp r0, 0xC + bne _0813913C +_08139128: + ldr r1, =0x020375f0 + movs r0, 0x1 + b _0813914A + .pool +_0813913C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _081390E6 + ldr r1, =0x020375f0 + movs r0, 0 +_0813914A: + strh r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81390E0 + + thumb_func_start SpawnScriptFieldObject +SpawnScriptFieldObject: @ 8139158 + push {lr} + sub sp, 0x8 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r3, [r0] + adds r3, 0x7 + lsls r3, 16 + asrs r3, 16 + ldrh r0, [r0, 0x2] + adds r0, 0x7 + lsls r0, 16 + asrs r0, 16 + str r0, [sp] + movs r0, 0x3 + str r0, [sp, 0x4] + movs r0, 0x7 + movs r1, 0x8 + movs r2, 0x7F + bl SpawnSpecialFieldObjectParametrized + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02037350 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x1] + movs r2, 0x20 + orrs r0, r2 + strb r0, [r1, 0x1] + ldrb r0, [r1, 0x4] + bl CameraObjectSetFollowedObjectId + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end SpawnScriptFieldObject + + thumb_func_start RemoveScriptFieldObject +RemoveScriptFieldObject: @ 81391AC + push {lr} + bl GetPlayerAvatarObjectId + lsls r0, 24 + lsrs r0, 24 + bl CameraObjectSetFollowedObjectId + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + movs r0, 0x7F + bl RemoveFieldObjectByLocalIdAndMap + pop {r0} + bx r0 + .pool + thumb_func_end RemoveScriptFieldObject + + thumb_func_start sub_81391D0 +sub_81391D0: @ 81391D0 + push {lr} + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + bl GetNature + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02021cc4 + bl sub_8137068 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81391D0 + + thumb_func_start sub_8139200 +sub_8139200: @ 8139200 + push {r4,lr} + ldr r4, =0x02021cc4 + ldr r0, =0x00004026 + bl VarGet + 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 + .pool + thumb_func_end sub_8139200 + + thumb_func_start sub_8139228 +sub_8139228: @ 8139228 + push {lr} + movs r0, 0x20 + bl sub_80847F8 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_8139228 + + thumb_func_start sub_8139238 +sub_8139238: @ 8139238 + push {lr} + ldr r0, =0x02021cc4 + bl sub_8165284 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8139238 + + thumb_func_start sub_8139248 +sub_8139248: @ 8139248 + push {r4,r5,lr} + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r1, =0x00002e68 + adds r0, r2, r1 + ldrb r1, [r0] + lsls r1, 25 + ldr r0, =0x00002e6a + adds r2, r0 + lsrs r1, 25 + ldrh r2, [r2] + adds r1, r2 + ldr r2, =gUnknown_085B2B88 + ldr r0, =0x020375e0 + ldrh r0, [r0] + adds r0, r2 + ldrb r0, [r0] + adds r5, r1, r0 + movs r0, 0x2 + bl GetPriceReduction + lsls r0, 24 + cmp r0, 0 + bne _08139294 + ldr r4, =gUnknown_085B2B94 + b _08139296 + .pool +_08139294: + ldr r4, =gUnknown_085B2BA0 +_08139296: + adds r0, r5, 0 + movs r1, 0xC + bl __umodsi3 + adds r0, r4 + ldrb r0, [r0] + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8139248 + + thumb_func_start sub_81392AC +sub_81392AC: @ 81392AC + push {lr} + ldr r1, =0x020375e0 + ldr r0, =0x00000213 + strh r0, [r1] + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _081392CC + movs r0, 0x1 + b _081392CE + .pool +_081392CC: + movs r0, 0 +_081392CE: + pop {r1} + bx r1 + thumb_func_end sub_81392AC + + thumb_func_start sub_81392D4 +sub_81392D4: @ 81392D4 + push {lr} + ldr r1, =0x020375e0 + movs r0, 0x85 + lsls r0, 2 + strh r0, [r1] + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _081392F0 + movs r0, 0x1 + b _081392F2 + .pool +_081392F0: + movs r0, 0 +_081392F2: + pop {r1} + bx r1 + thumb_func_end sub_81392D4 + + thumb_func_start sub_81392F8 +sub_81392F8: @ 81392F8 + push {lr} + ldr r1, =0x020375e0 + ldr r0, =0x00000215 + strh r0, [r1] + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08139318 + movs r0, 0x1 + b _0813931A + .pool +_08139318: + movs r0, 0 +_0813931A: + pop {r1} + bx r1 + thumb_func_end sub_81392F8 + + thumb_func_start sub_8139320 +sub_8139320: @ 8139320 + push {lr} + ldr r1, =0x020375e0 + ldr r0, =0x00000216 + strh r0, [r1] + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08139340 + movs r0, 0x1 + b _08139342 + .pool +_08139340: + movs r0, 0 +_08139342: + pop {r1} + bx r1 + thumb_func_end sub_8139320 + + thumb_func_start sub_8139348 +sub_8139348: @ 8139348 + push {lr} + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x47 + movs r2, 0 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8139348 + + thumb_func_start sub_8139370 +sub_8139370: @ 8139370 + push {r4,lr} + sub sp, 0x4 + movs r0, 0x2A + bl sav12_xor_increment + ldr r0, =0x0000089b + bl FlagSet + movs r1, 0x1 + mov r0, sp + strb r1, [r0] + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x47 + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + bl sub_80EE5A4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bls _081393B6 + adds r0, r4, 0 + movs r1, 0x47 + bl sub_80EE4DC +_081393B6: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8139370 + + thumb_func_start sub_81393C8 +sub_81393C8: @ 81393C8 + push {lr} + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + bl sub_806DC8C + lsls r0, 16 + ldr r1, =0x01fd0000 + cmp r0, r1 + bhi _081393F4 + movs r0, 0 + b _081393F6 + .pool +_081393F4: + movs r0, 0x1 +_081393F6: + pop {r1} + bx r1 + thumb_func_end sub_81393C8 + + thumb_func_start sub_81393FC +sub_81393FC: @ 81393FC + push {lr} + movs r0, 0xC7 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08139454 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0x83 + lsls r0, 3 + cmp r1, r0 + bne _08139454 + subs r0, 0x75 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08139434 + ldr r0, =0x0000409a + movs r1, 0x4 + b _08139446 + .pool +_08139434: + movs r0, 0xE9 + lsls r0, 2 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08139454 + ldr r0, =0x0000409a + movs r1, 0x5 +_08139446: + bl VarSet + movs r0, 0x1 + b _08139456 + .pool +_08139454: + movs r0, 0 +_08139456: + pop {r1} + bx r1 + thumb_func_end sub_81393FC + + thumb_func_start sub_813945C +sub_813945C: @ 813945C + push {lr} + ldr r0, =0x000008bf + bl FlagSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_813945C + + thumb_func_start sub_813946C +sub_813946C: @ 813946C + push {r4,r5,lr} + sub sp, 0x14 + ldr r5, =0x020244ec + movs r1, 0x90 + lsls r1, 1 + movs r4, 0 + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + str r4, [sp, 0xC] + adds r0, r5, 0 + movs r2, 0x7 + movs r3, 0x20 + bl create_pokemon_set_level + movs r1, 0x1 + add r0, sp, 0x10 + strh r1, [r0] + adds r0, r5, 0 + movs r1, 0x2E + add r2, sp, 0x10 + bl pokemon_setattr + add r1, sp, 0x10 + movs r0, 0x21 + strh r0, [r1] + adds r0, r5, 0 + movs r1, 0xD + add r2, sp, 0x10 + bl pokemon_setattr + add r0, sp, 0x10 + strh r4, [r0] + adds r0, r5, 0 + movs r1, 0xE + add r2, sp, 0x10 + bl pokemon_setattr + adds r0, r5, 0 + movs r1, 0xF + add r2, sp, 0x10 + bl pokemon_setattr + adds r0, r5, 0 + movs r1, 0x10 + add r2, sp, 0x10 + bl pokemon_setattr + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813946C + + thumb_func_start sub_81394D8 +sub_81394D8: @ 81394D8 + push {r4-r6,lr} + ldr r0, =0x00004023 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + bl sub_8133EDC + lsls r0, 16 + lsrs r6, r0, 16 + bl calc_player_party_count + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + cmp r4, r5 + bcs _08139526 +_081394FA: + movs r0, 0x64 + muls r0, r4 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + cmp r0, r6 + bne _0813951C + movs r0, 0x1 + b _08139528 + .pool +_0813951C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _081394FA +_08139526: + movs r0, 0 +_08139528: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81394D8 + + thumb_func_start sub_8139530 +sub_8139530: @ 8139530 + push {lr} + bl sub_80D2218 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8139530 + + thumb_func_start sub_8139540 +sub_8139540: @ 8139540 + push {lr} + ldr r0, =0x020244ec + movs r1, 0x3F + bl sub_806DD7C + lsls r0, 24 + cmp r0, 0 + beq _08139558 + movs r0, 0x1 + b _0813955A + .pool +_08139558: + movs r0, 0 +_0813955A: + pop {r1} + bx r1 + thumb_func_end sub_8139540 + + thumb_func_start sub_8139560 +sub_8139560: @ 8139560 + push {lr} + ldr r0, =sub_81395BC + movs r1, 0x9 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =0x020375e2 + ldrh r0, [r0] + movs r2, 0 + strh r0, [r1, 0x8] + strh r2, [r1, 0xA] + ldr r0, =0x020375e4 + ldrh r0, [r0] + strh r0, [r1, 0xC] + ldr r0, =0x020375e6 + ldrh r0, [r0] + strh r0, [r1, 0xE] + ldr r0, =0x020375e0 + ldrh r0, [r0] + strh r0, [r1, 0x10] + movs r0, 0 + bl SetCameraPanningCallback + movs r0, 0xD6 + bl audio_play + pop {r0} + bx r0 + .pool + thumb_func_end sub_8139560 + + thumb_func_start sub_81395BC +sub_81395BC: @ 81395BC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + movs r1, 0x2 + ldrsh r0, [r4, r1] + movs r2, 0x6 + ldrsh r1, [r4, r2] + bl __modsi3 + cmp r0, 0 + bne _08139614 + strh r0, [r4, 0x2] + ldrh r0, [r4, 0x4] + subs r0, 0x1 + strh r0, [r4, 0x4] + ldrh r0, [r4] + negs r0, r0 + strh r0, [r4] + ldrh r0, [r4, 0x8] + negs r0, r0 + strh r0, [r4, 0x8] + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x8 + ldrsh r1, [r4, r2] + bl SetCameraPanning + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08139614 + adds r0, r5, 0 + bl sub_8139620 + bl InstallCameraPanAheadCallback +_08139614: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81395BC + + thumb_func_start sub_8139620 +sub_8139620: @ 8139620 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_8139620 + + thumb_func_start sub_8139634 +sub_8139634: @ 8139634 + push {lr} + movs r0, 0x95 + lsls r0, 2 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8139634 + + thumb_func_start sub_8139648 +sub_8139648: @ 8139648 + push {lr} + bl get_map_light_from_warp0 + lsls r0, 24 + lsrs r0, 24 + bl is_light_level_1_2_3_5_or_6 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08139664 + movs r0, 0x14 + bl sub_80AED7C +_08139664: + pop {r0} + bx r0 + thumb_func_end sub_8139648 + + thumb_func_start sub_8139668 +sub_8139668: @ 8139668 + push {lr} + bl get_map_light_from_warp0 + lsls r0, 24 + lsrs r0, 24 + bl is_light_level_1_2_3_5_or_6 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08139684 + movs r0, 0x15 + bl sub_80AED7C +_08139684: + pop {r0} + bx r0 + thumb_func_end sub_8139668 + + thumb_func_start sub_8139688 +sub_8139688: @ 8139688 + push {r4-r6,lr} + bl calc_player_party_count + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + cmp r5, r6 + bcs _081396D6 +_08139698: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _081396CC + adds r0, r4, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _081396CC + adds r0, r5, 0 + b _081396D8 + .pool +_081396CC: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r6 + bcc _08139698 +_081396D6: + movs r0, 0 +_081396D8: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8139688 + + thumb_func_start sub_81396E0 +sub_81396E0: @ 81396E0 + push {lr} + ldr r0, =0x020375e0 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81396E0 + + thumb_func_start nullsub_54 +nullsub_54: @ 8139708 + bx lr + thumb_func_end nullsub_54 + + thumb_func_start sub_813970C +sub_813970C: @ 813970C + push {r4,lr} + ldr r0, =0x000040c2 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + adds r3, r0, 0 + ldr r2, =0x03005cf8 + movs r1, 0 + ldrsh r0, [r2, r1] + subs r0, r3 + cmp r0, 0x6 + ble _08139734 + movs r0, 0 + b _0813974C + .pool +_08139734: + ldrh r1, [r2] + movs r4, 0 + ldrsh r0, [r2, r4] + cmp r0, 0 + blt _0813974A + subs r1, r3 + movs r0, 0x7 + subs r0, r1 + lsls r0, 16 + lsrs r0, 16 + b _0813974C +_0813974A: + movs r0, 0x8 +_0813974C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_813970C + + thumb_func_start sub_8139754 +sub_8139754: @ 8139754 + push {r4,lr} + ldr r0, =0x000040c2 + ldr r4, =0x03005cf8 + ldrh r1, [r4] + bl VarSet + ldrh r0, [r4] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8139754 + + thumb_func_start sub_8139770 +sub_8139770: @ 8139770 + push {r4-r6,lr} + ldr r6, =0x020375e0 + ldrh r0, [r6] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + movs r1, 0x3 + bl pokemon_getattr + cmp r0, 0x2 + bne _081397A6 + ldrh r0, [r6] + muls r0, r5 + adds r0, r4 + ldr r4, =0x02021cc4 + movs r1, 0x7 + adds r2, r4, 0 + bl pokemon_getattr + ldr r0, =0x03005d90 + ldr r0, [r0] + adds r1, r4, 0 + bl CompareString + cmp r0, 0 + beq _081397BC +_081397A6: + movs r0, 0x1 + b _081397BE + .pool +_081397BC: + movs r0, 0 +_081397BE: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8139770 + + thumb_func_start sub_81397C4 +sub_81397C4: @ 81397C4 + push {r4,r5,lr} + ldr r2, =0x020375f0 + ldrh r1, [r2] + ldr r0, =0x0000270f + cmp r1, r0 + bls _081397E0 + movs r0, 0 + bl sub_80EF340 + b _08139862 + .pool +_081397E0: + ldr r0, =0x000003e7 + cmp r1, r0 + bls _081397F8 + ldr r4, =0x02021cc4 + movs r0, 0xA1 + strb r0, [r4] + adds r4, 0x1 + b _0813981C + .pool +_081397F8: + cmp r1, 0x63 + bls _0813980C + ldr r4, =0x02021cc4 + movs r0, 0xA1 + strb r0, [r4] + strb r0, [r4, 0x1] + adds r4, 0x2 + b _0813981C + .pool +_0813980C: + cmp r1, 0x9 + bls _0813983C + ldr r4, =0x02021cc4 + movs r0, 0xA1 + strb r0, [r4] + strb r0, [r4, 0x1] + strb r0, [r4, 0x2] + adds r4, 0x3 +_0813981C: + ldrh r5, [r2] + adds r0, r5, 0 + bl sub_80EF370 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl ConvertIntToDecimalString + b _08139862 + .pool +_0813983C: + ldr r4, =0x02021cc4 + movs r0, 0xA1 + strb r0, [r4] + strb r0, [r4, 0x1] + strb r0, [r4, 0x2] + strb r0, [r4, 0x3] + adds r4, 0x4 + ldrh r5, [r2] + adds r0, r5, 0 + bl sub_80EF370 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl ConvertIntToDecimalString +_08139862: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81397C4 + + thumb_func_start sub_813986C +sub_813986C: @ 813986C + push {lr} + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0x4 + bhi _081398B8 + lsls r0, 2 + ldr r1, =_08139888 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08139888: + .4byte _0813989C + .4byte _081398A0 + .4byte _081398A4 + .4byte _081398A8 + .4byte _081398AC +_0813989C: + movs r0, 0x3 + b _081398AE +_081398A0: + movs r0, 0x4 + b _081398AE +_081398A4: + movs r0, 0 + b _081398AE +_081398A8: + movs r0, 0x1 + b _081398AE +_081398AC: + movs r0, 0x2 +_081398AE: + bl mevent_081445C0 + lsls r0, 16 + lsrs r0, 16 + b _081398BA +_081398B8: + movs r0, 0 +_081398BA: + pop {r1} + bx r1 + thumb_func_end sub_813986C + + thumb_func_start sub_81398C0 +sub_81398C0: @ 81398C0 + push {r4,lr} + ldr r1, =0x020375e0 + ldr r2, =0xfffffedf + adds r0, r2, 0 + ldrh r2, [r1] + adds r0, r2 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x39 + bls _081398E0 + movs r0, 0 + b _081398FC + .pool +_081398E0: + ldr r4, =0x02021dc4 + ldrh r0, [r1] + 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 CopyString + movs r0, 0x1 +_081398FC: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81398C0 + + thumb_func_start sub_813990C +sub_813990C: @ 813990C + push {r4,r5,lr} + bl calc_player_party_count + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + cmp r4, r5 + bcs _08139942 +_0813991C: + movs r0, 0x64 + muls r0, r4 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x4 + bl pokemon_getattr + cmp r0, 0x1 + bne _08139938 + movs r0, 0x1 + b _08139944 + .pool +_08139938: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _0813991C +_08139942: + movs r0, 0 +_08139944: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_813990C + + thumb_func_start in_multi_battle_room_with_var_condition +in_multi_battle_room_with_var_condition: @ 813994C + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, =0x00000f1a + cmp r1, r0 + bne _08139978 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bne _08139978 + movs r0, 0x1 + b _0813997A + .pool +_08139978: + movs r0, 0 +_0813997A: + pop {r1} + bx r1 + thumb_func_end in_multi_battle_room_with_var_condition + + thumb_func_start sub_8139980 +sub_8139980: @ 8139980 + push {lr} + movs r0, 0 + bl SetCameraPanningCallback + movs r0, 0x8 + movs r1, 0 + bl SetCameraPanning + pop {r0} + bx r0 + thumb_func_end sub_8139980 + + thumb_func_start sub_8139994 +sub_8139994: @ 8139994 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrb r0, [r0, 0x15] + subs r0, 0x10 + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x5 + bhi _081399E4 + lsls r0, 2 + ldr r1, =_081399B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081399B8: + .4byte _081399E4 + .4byte _081399D0 + .4byte _081399D4 + .4byte _081399D8 + .4byte _081399DC + .4byte _081399E0 +_081399D0: + movs r1, 0x5 + b _081399E6 +_081399D4: + movs r1, 0x6 + b _081399E6 +_081399D8: + movs r1, 0x7 + b _081399E6 +_081399DC: + movs r1, 0x8 + b _081399E6 +_081399E0: + movs r1, 0xF + b _081399E6 +_081399E4: + movs r1, 0x4 +_081399E6: + ldr r0, =0x00004043 + bl VarSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_8139994 + + thumb_func_start sub_81399F4 +sub_81399F4: @ 81399F4 + push {r4,lr} + ldr r2, =0x0203ab60 + movs r0, 0 + strh r0, [r2] + ldr r1, =0x0203ab62 + strh r0, [r1] + ldr r0, =0x03005d8c + ldr r3, [r0] + movs r0, 0x14 + ldrsb r0, [r3, r0] + adds r4, r1, 0 + cmp r0, 0xD + bne _08139A6E + ldrb r0, [r3, 0x15] + subs r0, 0x10 + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x4 + bhi _08139A6E + lsls r0, 2 + ldr r1, =_08139A34 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08139A34: + .4byte _08139A66 + .4byte _08139A5E + .4byte _08139A56 + .4byte _08139A4E + .4byte _08139A48 +_08139A48: + movs r0, 0 + strh r0, [r2] + b _08139A6C +_08139A4E: + movs r0, 0 + strh r0, [r2] + movs r0, 0x1 + b _08139A6C +_08139A56: + movs r0, 0 + strh r0, [r2] + movs r0, 0x2 + b _08139A6C +_08139A5E: + movs r0, 0 + strh r0, [r2] + movs r0, 0x3 + b _08139A6C +_08139A66: + movs r0, 0 + strh r0, [r2] + movs r0, 0x4 +_08139A6C: + strh r0, [r4] +_08139A6E: + ldrh r0, [r4] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81399F4 + + thumb_func_start sub_8139A78 +sub_8139A78: @ 8139A78 + push {r4-r6,lr} + ldr r0, =sub_8139AF4 + movs r1, 0x9 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r4, r1, r0 + movs r3, 0 + strh r3, [r4, 0x2] + strh r3, [r4, 0x4] + movs r6, 0x1 + strh r6, [r4, 0x8] + ldr r0, =0x020375e2 + ldr r1, =0x020375e4 + ldrh r2, [r0] + ldrh r0, [r1] + cmp r2, r0 + bls _08139AC0 + subs r0, r2, r0 + lsls r0, 16 + lsrs r5, r0, 16 + strh r6, [r4, 0xC] + b _08139AC8 + .pool +_08139AC0: + subs r0, r2 + lsls r0, 16 + lsrs r5, r0, 16 + strh r3, [r4, 0xC] +_08139AC8: + cmp r5, 0x8 + bls _08139ACE + movs r5, 0x8 +_08139ACE: + ldr r0, =gUnknown_085B2C18 + adds r0, r5, r0 + ldrb r0, [r0] + strh r0, [r4, 0xA] + movs r0, 0 + bl SetCameraPanningCallback + ldrb r1, [r4, 0xC] + adds r0, r5, 0 + bl sub_8139C2C + movs r0, 0x59 + bl audio_play + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8139A78 + + thumb_func_start sub_8139AF4 +sub_8139AF4: @ 8139AF4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + movs r1, 0x2 + ldrsh r0, [r4, r1] + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bne _08139B54 + strh r0, [r4, 0x2] + ldrh r0, [r4, 0x4] + adds r0, 0x1 + strh r0, [r4, 0x4] + ldrh r0, [r4, 0x8] + negs r0, r0 + strh r0, [r4, 0x8] + movs r2, 0x8 + ldrsh r1, [r4, r2] + movs r0, 0 + bl SetCameraPanning + movs r0, 0x4 + ldrsh r1, [r4, r0] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _08139B54 + movs r0, 0x49 + bl audio_play + adds r0, r5, 0 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running + bl InstallCameraPanAheadCallback +_08139B54: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8139AF4 + + thumb_func_start sub_8139B60 +sub_8139B60: @ 8139B60 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0xC + ldr r5, =0x0203ab5e + ldr r0, =gUnknown_085B2BAC + bl AddWindow + strb r0, [r5] + ldrb r0, [r5] + movs r1, 0 + bl SetStandardWindowBorderStyle + ldr r4, =gUnknown_085EB6A5 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x40 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + ldrb r0, [r5] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x1 + str r1, [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, r4, 0 + bl Print + ldr r6, =gUnknown_085B2BB4 + ldr r4, =0x020375e2 + ldrh r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r1, [r0] + movs r0, 0x1 + movs r2, 0x40 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + ldrb r0, [r5] + ldrh r1, [r4] + lsls r1, 2 + adds r1, r6 + ldr r2, [r1] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x11 + str r1, [sp] + mov r1, r9 + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + movs r1, 0x1 + bl Print + ldrb r0, [r5] + bl PutWindowTilemap + ldrb r0, [r5] + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8139B60 + + thumb_func_start sub_8139C10 +sub_8139C10: @ 8139C10 + push {r4,lr} + ldr r4, =0x0203ab5e + 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_8139C10 + + thumb_func_start sub_8139C2C +sub_8139C2C: @ 8139C2C + push {r4-r6,lr} + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r4, =sub_8139C80 + adds r0, r4, 0 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08139C6C + adds r0, r4, 0 + movs r1, 0x8 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x8] + strh r0, [r1, 0xA] + strh r5, [r1, 0xC] + ldr r0, =gUnknown_085B2C21 + adds r0, r6, r0 + ldrb r0, [r0] + strh r0, [r1, 0xE] +_08139C6C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8139C2C + + thumb_func_start sub_8139C80 +sub_8139C80: @ 8139C80 + 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 r0, 2 + ldr r1, [sp] + adds r0, r1 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r6, r0, r1 + movs r2, 0x2 + ldrsh r0, [r6, r2] + cmp r0, 0x6 + bne _08139D7C + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] + movs r1, 0x4 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _08139D10 + movs r1, 0 + ldr r2, =gUnknown_085B2BF4 + mov r10, r2 +_08139CBA: + movs r5, 0 + adds r7, r1, 0x7 + lsls r0, r1, 1 + adds r2, r1, 0x1 + mov r8, r2 + adds r0, r1 + lsls r0, 1 + mov r9, r0 +_08139CCA: + adds r4, r5, 0 + adds r4, 0x8 + movs r1, 0 + ldrsh r0, [r6, r1] + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + asrs r0, 15 + add r0, r9 + add r0, r10 + ldrh r0, [r0] + movs r1, 0xC0 + lsls r1, 4 + adds r2, r1, 0 + orrs r2, r0 + adds r0, r4, 0 + adds r1, r7, 0 + bl MapGridSetMetatileIdAt + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _08139CCA + mov r2, r8 + lsls r0, r2, 24 + lsrs r1, r0, 24 + cmp r1, 0x2 + bls _08139CBA + b _08139D62 + .pool +_08139D10: + movs r1, 0 + ldr r0, =gUnknown_085B2C06 + mov r10, r0 +_08139D16: + movs r5, 0 + adds r7, r1, 0x7 + lsls r0, r1, 1 + adds r2, r1, 0x1 + mov r8, r2 + adds r0, r1 + lsls r0, 1 + mov r9, r0 +_08139D26: + adds r4, r5, 0 + adds r4, 0x8 + movs r1, 0 + ldrsh r0, [r6, r1] + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + asrs r0, 15 + add r0, r9 + add r0, r10 + ldrh r0, [r0] + movs r1, 0xC0 + lsls r1, 4 + adds r2, r1, 0 + orrs r2, r0 + adds r0, r4, 0 + adds r1, r7, 0 + bl MapGridSetMetatileIdAt + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _08139D26 + mov r2, r8 + lsls r0, r2, 24 + lsrs r1, r0, 24 + cmp r1, 0x2 + bls _08139D16 +_08139D62: + bl DrawWholeMapView + movs r0, 0 + strh r0, [r6, 0x2] + movs r0, 0 + ldrsh r1, [r6, r0] + movs r2, 0x6 + ldrsh r0, [r6, r2] + cmp r1, r0 + bne _08139D7C + ldr r0, [sp] + bl DestroyTask +_08139D7C: + ldrh r0, [r6, 0x2] + adds r0, 0x1 + strh r0, [r6, 0x2] + 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_8139C80 + + thumb_func_start sub_8139D98 +sub_8139D98: @ 8139D98 + push {r4-r7,lr} + sub sp, 0x18 + ldr r6, =0x020375e0 + ldrh r0, [r6] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + movs r1, 0x27 + bl pokemon_getattr + str r0, [sp] + ldrh r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0x28 + bl pokemon_getattr + str r0, [sp, 0x4] + ldrh r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0x29 + bl pokemon_getattr + str r0, [sp, 0x8] + ldrh r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0x2A + bl pokemon_getattr + str r0, [sp, 0xC] + ldrh r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0x2B + bl pokemon_getattr + str r0, [sp, 0x10] + ldrh r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0x2C + bl pokemon_getattr + str r0, [sp, 0x14] + ldr r1, =0x020375e2 + movs r0, 0 + strh r0, [r1] + movs r4, 0 + adds r2, r1, 0 +_08139E00: + lsls r0, r4, 2 + add r0, sp + ldr r1, [r0] + ldrh r0, [r2] + adds r0, r1 + strh r0, [r2] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _08139E00 + ldr r2, =0x020375e4 + movs r0, 0 + strh r0, [r2] + ldr r1, =0x020375e6 + ldr r0, [sp] + strh r0, [r1] + movs r4, 0x1 + adds r6, r2, 0 + adds r7, r1, 0 +_08139E28: + ldrh r0, [r6] + lsls r0, 2 + mov r2, sp + adds r1, r2, r0 + lsls r0, r4, 2 + adds r5, r2, r0 + ldr r1, [r1] + ldr r0, [r5] + cmp r1, r0 + bcs _08139E54 + strh r4, [r6] + b _08139E6C + .pool +_08139E54: + cmp r1, r0 + bne _08139E6E + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08139E6E + strh r4, [r6] + ldr r0, [r5] +_08139E6C: + strh r0, [r7] +_08139E6E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _08139E28 + add sp, 0x18 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8139D98 + + thumb_func_start warp0_in_pokecenter +warp0_in_pokecenter: @ 8139E80 + push {r4,lr} + ldr r0, =0x020322dc + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r1, 8 + ldrb r0, [r0, 0x1] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + lsls r0, 16 + lsrs r3, r0, 16 + ldr r2, =gUnknown_085B2C2A + ldrh r0, [r2] + ldr r1, =0x0000ffff + cmp r0, r1 + beq _08139EC6 + adds r4, r1, 0 + adds r1, r2, 0 +_08139EA4: + ldrh r0, [r2] + cmp r0, r3 + bne _08139EBC + movs r0, 0x1 + b _08139EC8 + .pool +_08139EBC: + adds r1, 0x2 + adds r2, 0x2 + ldrh r0, [r1] + cmp r0, r4 + bne _08139EA4 +_08139EC6: + movs r0, 0 +_08139EC8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end warp0_in_pokecenter + + thumb_func_start sub_8139ED0 +sub_8139ED0: @ 8139ED0 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, =0x00003c1a + cmp r1, r0 + beq _08139EEC + movs r0, 0x1 + b _08139EEE + .pool +_08139EEC: + movs r0, 0 +_08139EEE: + pop {r1} + bx r1 + thumb_func_end sub_8139ED0 + + thumb_func_start sub_8139EF4 +sub_8139EF4: @ 8139EF4 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =0x0000402f + bl GetVarPointer + adds r5, r0, 0 + ldrh r0, [r5] + adds r4, r0 + strh r4, [r5] + ldrh r0, [r5] + movs r1, 0xA + bl __umodsi3 + strh r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8139EF4 + + thumb_func_start sub_8139F20 +sub_8139F20: @ 8139F20 + push {r4-r7,lr} + movs r4, 0 + ldr r0, =0x0000402f + bl VarGet + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x9 + bls _08139F34 + b _0813A03A +_08139F34: + lsls r0, r6, 2 + ldr r1, =_08139F48 + adds r1, r0, r1 + ldr r1, [r1] + adds r2, r0, 0 + mov pc, r1 + .pool + .align 2, 0 +_08139F48: + .4byte _08139F70 + .4byte _08139F70 + .4byte _08139F70 + .4byte _08139F70 + .4byte _08139F94 + .4byte _08139FB4 + .4byte _08139FCC + .4byte _08139FE4 + .4byte _08139FFC + .4byte _0813A014 +_08139F70: + ldr r0, =0x03005d90 + ldr r0, [r0] + movs r3, 0xCE + lsls r3, 4 + adds r1, r0, r3 + adds r3, r1, r2 + ldr r1, =0x00000ce2 + adds r0, r1 + adds r1, r0, r2 + ldrh r0, [r3] + ldrh r2, [r1] + cmp r0, r2 + bcs _0813A028 + b _0813A038 + .pool +_08139F94: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r3, =0x00000d0c + adds r2, r0, r3 + adds r3, 0x2 +_08139F9E: + adds r1, r0, r3 + ldrh r0, [r2] + ldrh r3, [r1] + cmp r0, r3 + bcs _0813A028 + b _0813A038 + .pool +_08139FB4: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000de2 + adds r2, r0, r1 + ldr r3, =0x00000de4 + b _08139F9E + .pool +_08139FCC: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000dc8 + adds r2, r0, r1 + ldr r3, =0x00000dca + b _08139F9E + .pool +_08139FE4: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000dda + adds r2, r0, r1 + ldr r3, =0x00000ddc + b _08139F9E + .pool +_08139FFC: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000e04 + adds r2, r0, r1 + ldr r3, =0x00000e06 + b _08139F9E + .pool +_0813A014: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000e1a + adds r2, r0, r1 + ldr r3, =0x00000e1c + adds r1, r0, r3 + ldrh r0, [r2] + ldrh r3, [r1] + cmp r0, r3 + bcc _0813A038 +_0813A028: + adds r4, r0, 0 + b _0813A03A + .pool +_0813A038: + ldrh r4, [r1] +_0813A03A: + movs r2, 0 + ldr r5, =gUnknown_085B2CC8 + lsls r0, r6, 1 + adds r1, r0, r5 + ldrb r1, [r1] + adds r3, r0, 0 + ldr r7, =gUnknown_085B2C50 + cmp r1, r4 + bcs _0813A062 + adds r1, r3, 0 +_0813A04E: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x1 + bhi _0813A062 + adds r0, r2, r1 + adds r0, r5 + ldrb r0, [r0] + cmp r0, r4 + bcc _0813A04E +_0813A062: + adds r0, r3, r6 + adds r0, r2 + lsls r0, 2 + adds r0, r7 + ldr r0, [r0] + bl box_related_two__2 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8139F20 + + thumb_func_start sub_813A080 +sub_813A080: @ 813A080 + push {r4-r7,lr} + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + cmp r5, 0x2 + bne _0813A0D8 + movs r0, 0xA9 + lsls r0, 1 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _0813A0D8 + ldr r1, =0x020375e2 + movs r0, 0x5 + strh r0, [r1] + ldr r1, =0x020375e4 + movs r0, 0x4 + strh r0, [r1] + b _0813A110 + .pool +_0813A0D0: + movs r0, 0x4 + strh r0, [r6] + adds r0, r3, 0x5 + b _0813A10E +_0813A0D8: + movs r3, 0 + ldr r6, =0x020375e2 + ldr r7, =0x020375e4 + lsls r1, r4, 1 + lsls r2, r5, 2 + ldr r4, =gUnknown_085B2CDC + ldr r0, =0x03005d90 + ldr r0, [r0] + adds r1, r2 + movs r2, 0xCE + lsls r2, 4 + adds r0, r2 + adds r0, r1 + ldrh r1, [r0] +_0813A0F4: + lsls r0, r3, 1 + adds r0, r4 + ldrh r0, [r0] + cmp r0, r1 + bhi _0813A0D0 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x8 + bls _0813A0F4 + movs r0, 0x4 + strh r0, [r6] + movs r0, 0xC +_0813A10E: + strh r0, [r7] +_0813A110: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813A080 + + thumb_func_start sub_813A128 +sub_813A128: @ 813A128 + push {r4,lr} + ldr r0, =sub_813A2DC + movs r1, 0x8 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r3, r0, r1 + ldr r1, =0x020375e0 + ldrh r0, [r1] + strh r0, [r3, 0x1E] + ldrh r0, [r1] + cmp r0, 0xC + bls _0813A14E + b _0813A2C6 +_0813A14E: + lsls r0, 2 + ldr r1, =_0813A168 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0813A168: + .4byte _0813A19C + .4byte _0813A1AA + .4byte _0813A1C2 + .4byte _0813A1D6 + .4byte _0813A1F0 + .4byte _0813A208 + .4byte _0813A222 + .4byte _0813A23C + .4byte _0813A25A + .4byte _0813A274 + .4byte _0813A274 + .4byte _0813A28E + .4byte _0813A2A8 +_0813A19C: + movs r1, 0 + movs r0, 0x1 + strh r0, [r3, 0x8] + strh r0, [r3, 0xA] + strh r0, [r3, 0xC] + strh r0, [r3, 0xE] + b _0813A2BC +_0813A1AA: + movs r1, 0 + movs r0, 0x5 + strh r0, [r3, 0x8] + movs r0, 0x8 + strh r0, [r3, 0xA] + movs r0, 0x1 + strh r0, [r3, 0xC] + strh r0, [r3, 0xE] + movs r0, 0x9 + strh r0, [r3, 0x10] + movs r0, 0xA + b _0813A2BE +_0813A1C2: + movs r2, 0 + movs r0, 0x6 + strh r0, [r3, 0x8] + movs r1, 0xC + strh r1, [r3, 0xA] + movs r0, 0x1 + strh r0, [r3, 0xC] + strh r0, [r3, 0xE] + movs r0, 0x7 + b _0813A250 +_0813A1D6: + movs r1, 0 + movs r0, 0x6 + strh r0, [r3, 0x8] + movs r0, 0xB + strh r0, [r3, 0xA] + movs r0, 0xE + strh r0, [r3, 0xC] + movs r0, 0x1 + strh r0, [r3, 0xE] + movs r0, 0xF + strh r0, [r3, 0x10] + movs r0, 0xC + b _0813A2BE +_0813A1F0: + movs r1, 0 + movs r0, 0x6 + strh r0, [r3, 0x8] + strh r0, [r3, 0xA] + movs r0, 0xE + strh r0, [r3, 0xC] + movs r0, 0x1 + strh r0, [r3, 0xE] + movs r0, 0xF + strh r0, [r3, 0x10] + movs r0, 0xC + b _0813A2BE +_0813A208: + movs r1, 0 + movs r0, 0x6 + strh r0, [r3, 0x8] + movs r0, 0x7 + strh r0, [r3, 0xA] + movs r0, 0xE + strh r0, [r3, 0xC] + movs r0, 0x1 + strh r0, [r3, 0xE] + movs r0, 0xF + strh r0, [r3, 0x10] + movs r0, 0xC + b _0813A2BE +_0813A222: + movs r1, 0 + movs r0, 0x6 + strh r0, [r3, 0x8] + movs r0, 0xA + strh r0, [r3, 0xA] + movs r0, 0xE + strh r0, [r3, 0xC] + movs r0, 0x1 + strh r0, [r3, 0xE] + movs r0, 0xF + strh r0, [r3, 0x10] + movs r0, 0xC + b _0813A2BE +_0813A23C: + movs r2, 0 + movs r0, 0x6 + strh r0, [r3, 0x8] + movs r1, 0xC + strh r1, [r3, 0xA] + movs r0, 0xF + strh r0, [r3, 0xC] + movs r0, 0x1 + strh r0, [r3, 0xE] + movs r0, 0xE +_0813A250: + strh r0, [r3, 0x10] + strh r1, [r3, 0x12] + strh r2, [r3, 0x14] + strh r4, [r3, 0x26] + b _0813A2D2 +_0813A25A: + movs r1, 0 + movs r0, 0x6 + strh r0, [r3, 0x8] + movs r0, 0xA + strh r0, [r3, 0xA] + movs r0, 0x11 + strh r0, [r3, 0xC] + movs r0, 0x1 + strh r0, [r3, 0xE] + movs r0, 0xB + strh r0, [r3, 0x10] + movs r0, 0xC + b _0813A2BE +_0813A274: + movs r1, 0 + movs r0, 0x6 + strh r0, [r3, 0x8] + movs r0, 0xB + strh r0, [r3, 0xA] + movs r0, 0xF + strh r0, [r3, 0xC] + movs r0, 0x1 + strh r0, [r3, 0xE] + movs r0, 0xE + strh r0, [r3, 0x10] + movs r0, 0xC + b _0813A2BE +_0813A28E: + movs r1, 0 + movs r0, 0x6 + strh r0, [r3, 0x8] + movs r0, 0x7 + strh r0, [r3, 0xA] + movs r0, 0x13 + strh r0, [r3, 0xC] + movs r0, 0x1 + strh r0, [r3, 0xE] + movs r0, 0xA + strh r0, [r3, 0x10] + movs r0, 0xC + b _0813A2BE +_0813A2A8: + movs r1, 0 + movs r0, 0x6 + strh r0, [r3, 0x8] + movs r0, 0x7 + strh r0, [r3, 0xA] + movs r0, 0x11 + strh r0, [r3, 0xC] + movs r0, 0x1 + strh r0, [r3, 0xE] + movs r0, 0xC +_0813A2BC: + strh r0, [r3, 0x10] +_0813A2BE: + strh r0, [r3, 0x12] + strh r1, [r3, 0x14] + strh r4, [r3, 0x26] + b _0813A2D2 +_0813A2C6: + ldr r1, =0x020375f0 + movs r0, 0x7F + strh r0, [r1] + adds r0, r4, 0 + bl DestroyTask +_0813A2D2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813A128 + + thumb_func_start sub_813A2DC +sub_813A2DC: @ 813A2DC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x20 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r6, r0, r1 + bl script_env_2_enable + ldr r0, =0x0203ab68 + movs r5, 0 + strh r5, [r0] + ldr r1, =0x0203ab6c + movs r0, 0x40 + strb r0, [r1] + ldrh r0, [r6, 0x1E] + movs r1, 0 + bl sub_813AA60 + ldrb r0, [r6, 0x1E] + movs r1, 0 + bl sub_813ACE8 + ldr r4, =0x0203ab64 + movs r1, 0xA + ldrsh r0, [r6, r1] + lsls r0, 3 + bl AllocZeroed + str r0, [r4] + ldr r0, =0x0203ab6a + strh r5, [r0] + bl sub_813A42C + movs r3, 0 + movs r4, 0 + movs r2, 0xA + ldrsh r0, [r6, r2] + add r1, sp, 0x18 + mov r8, r1 + cmp r3, r0 + bge _0813A36A + ldr r5, =gUnknown_085B2CF0 +_0813A33A: + lsls r1, r4, 2 + ldr r0, =0x020375e0 + ldrh r0, [r0] + lsls r0, 6 + adds r1, r0 + adds r1, r5 + ldr r0, [r1] + ldr r1, =0x0203ab64 + ldr r2, [r1] + lsls r1, r4, 3 + adds r1, r2 + str r0, [r1] + str r4, [r1, 0x4] + adds r1, r3, 0 + bl display_text_and_get_width + adds r3, r0, 0 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + movs r2, 0xA + ldrsh r0, [r6, r2] + cmp r4, r0 + blt _0813A33A +_0813A36A: + adds r0, r3, 0 + bl convert_pixel_width_to_tile_width + strh r0, [r6, 0x10] + movs r1, 0xC + ldrsh r0, [r6, r1] + movs r2, 0x10 + ldrsh r1, [r6, r2] + adds r0, r1 + cmp r0, 0x1D + ble _0813A38C + movs r0, 0x1D + subs r0, r1 + cmp r0, 0 + bge _0813A38A + movs r0, 0 +_0813A38A: + strh r0, [r6, 0xC] +_0813A38C: + ldrb r2, [r6, 0xC] + ldrb r3, [r6, 0xE] + ldrb r0, [r6, 0x10] + str r0, [sp] + ldrb r0, [r6, 0x12] + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0x64 + str r0, [sp, 0xC] + add r0, sp, 0x10 + movs r1, 0 + bl sub_8198A50 + ldr r0, [sp, 0x10] + ldr r1, [sp, 0x14] + str r0, [sp, 0x18] + str r1, [sp, 0x1C] + mov r0, r8 + bl AddWindow + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x22] + movs r1, 0 + bl SetStandardWindowBorderStyle + ldr r4, =0x030061d0 + ldrh r0, [r6, 0xA] + strh r0, [r4, 0xC] + ldrh r0, [r6, 0x8] + strh r0, [r4, 0xE] + ldrh r0, [r6, 0x22] + strb r0, [r4, 0x10] + adds r0, r7, 0 + bl sub_813A694 + ldrh r1, [r6, 0x16] + ldrh r2, [r6, 0x18] + adds r0, r4, 0 + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x24] + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_813A4EC + str r1, [r0] + add sp, 0x20 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813A2DC + + thumb_func_start sub_813A42C +sub_813A42C: @ 813A42C + ldr r1, =0x030061d0 + ldr r0, =0x0203ab64 + ldr r0, [r0] + str r0, [r1] + ldr r0, =sub_813A46C + str r0, [r1, 0x4] + movs r0, 0 + str r0, [r1, 0x8] + movs r2, 0 + movs r0, 0x1 + strh r0, [r1, 0xC] + strh r0, [r1, 0xE] + strb r2, [r1, 0x10] + strb r2, [r1, 0x11] + movs r0, 0x8 + strb r0, [r1, 0x12] + strb r2, [r1, 0x13] + movs r0, 0x21 + strb r0, [r1, 0x14] + movs r0, 0x31 + strb r0, [r1, 0x15] + movs r0, 0 + strb r0, [r1, 0x16] + movs r0, 0x1 + strb r0, [r1, 0x17] + bx lr + .pool + thumb_func_end sub_813A42C + + thumb_func_start sub_813A46C +sub_813A46C: @ 813A46C + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0x5 + bl audio_play + ldr r0, =sub_813A4EC + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _0813A4D4 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + ldrh r0, [r4, 0x24] + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + movs r2, 0 + bl get_coro_args_x18_x1A + ldr r1, =0x0203ab68 + mov r0, sp + ldrh r0, [r0] + strh r0, [r1] + ldrh r0, [r4, 0x24] + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + bl sub_81AE838 + ldrh r0, [r4, 0x1E] + ldr r5, =0x0203ab6a + ldrh r1, [r5] + bl sub_813AC44 + ldrh r0, [r4, 0x1E] + mov r1, sp + ldrh r1, [r1] + bl sub_813AA60 + ldrb r0, [r4, 0x1E] + mov r1, sp + ldrh r1, [r1] + bl sub_813AD34 + mov r0, sp + ldrh r0, [r0] + strh r0, [r5] +_0813A4D4: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813A46C + + thumb_func_start sub_813A4EC +sub_813A4EC: @ 813A4EC + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r6, r0, r1 + ldrh r0, [r6, 0x24] + lsls r0, 24 + lsrs r0, 24 + bl ListMenuHandleInput + adds r4, r0, 0 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _0813A51C + adds r0, 0x1 + cmp r4, r0 + bne _0813A530 + b _0813A566 + .pool +_0813A51C: + ldr r1, =0x020375f0 + movs r0, 0x7F + strh r0, [r1] + movs r0, 0x5 + bl audio_play + b _0813A54C + .pool +_0813A530: + ldr r0, =0x020375f0 + strh r4, [r0] + movs r0, 0x5 + bl audio_play + movs r1, 0x14 + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _0813A54C + movs r1, 0xA + ldrsh r0, [r6, r1] + subs r0, 0x1 + cmp r4, r0 + bne _0813A558 +_0813A54C: + adds r0, r5, 0 + bl sub_813A570 + b _0813A566 + .pool +_0813A558: + adds r0, r5, 0 + bl sub_813A738 + ldr r0, =sub_813A600 + str r0, [r6] + bl script_env_2_enable_and_set_ctx_running +_0813A566: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813A4EC + + thumb_func_start sub_813A570 +sub_813A570: @ 813A570 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + ldrh r0, [r4, 0x24] + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + bl sub_81AE838 + ldrh r0, [r4, 0x1E] + mov r1, sp + ldrh r1, [r1] + bl sub_813AC44 + adds r0, r5, 0 + bl sub_813A738 + ldrh r0, [r4, 0x24] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldr r0, =0x0203ab64 + ldr r0, [r0] + bl Free + ldrh r0, [r4, 0x22] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_8198070 + ldrh r0, [r4, 0x22] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl FillWindowPixelBuffer + ldrh r0, [r4, 0x22] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl CopyWindowToVram + ldrh r0, [r4, 0x22] + lsls r0, 24 + lsrs r0, 24 + bl RemoveWindow + adds r0, r5, 0 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813A570 + + thumb_func_start sub_813A600 +sub_813A600: @ 813A600 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x14 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + beq _0813A624 + cmp r0, 0x2 + bne _0813A624 + movs r0, 0x1 + strh r0, [r1, 0x14] + ldr r0, =sub_813A664 + str r0, [r1] +_0813A624: + pop {r0} + bx r0 + .pool + thumb_func_end sub_813A600 + + thumb_func_start sub_813A630 +sub_813A630: @ 813A630 + push {lr} + ldr r0, =sub_813A600 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + bne _0813A64C + bl script_env_2_enable_and_set_ctx_running + b _0813A65C + .pool +_0813A64C: + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x14] + adds r0, 0x1 + strh r0, [r1, 0x14] +_0813A65C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_813A630 + + thumb_func_start sub_813A664 +sub_813A664: @ 813A664 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl script_env_2_enable + adds r0, r4, 0 + bl sub_813A694 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_813A4EC + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813A664 + + thumb_func_start sub_813A694 +sub_813A694: @ 813A694 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r4, r1, r0 + mov r1, sp + ldr r0, =gUnknown_085B3030 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldr r0, [r0] + str r0, [r1] + movs r0, 0x8 + ldrsh r1, [r4, r0] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r1, r0 + beq _0813A724 + mov r2, sp + movs r3, 0x10 + ldrsh r1, [r4, r3] + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + lsls r1, 3 + adds r1, 0xC + movs r5, 0xC + ldrsh r0, [r4, r5] + subs r0, 0x1 + lsls r0, 3 + adds r1, r0 + movs r3, 0 + strb r1, [r2, 0x1] + mov r1, sp + movs r0, 0x8 + strb r0, [r1, 0x2] + movs r0, 0x10 + ldrsh r1, [r4, r0] + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + lsls r1, 3 + adds r1, 0xC + movs r5, 0xC + ldrsh r0, [r4, r5] + subs r0, 0x1 + lsls r0, 3 + adds r1, r0 + strb r1, [r2, 0x4] + mov r1, sp + movs r2, 0x12 + ldrsh r0, [r4, r2] + lsls r0, 3 + adds r0, 0xA + strb r0, [r1, 0x5] + mov r0, sp + strh r3, [r0, 0x6] + mov r2, sp + ldrh r0, [r4, 0xA] + ldrh r1, [r4, 0x8] + subs r0, r1 + strh r0, [r2, 0x8] + ldr r1, =0x0203ab68 + mov r0, sp + bl AddScrollIndicatorArrowPair + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] +_0813A724: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813A694 + + thumb_func_start sub_813A738 +sub_813A738: @ 813A738 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r2, r1, r0 + movs r0, 0x8 + ldrsh r1, [r2, r0] + movs r3, 0xA + ldrsh r0, [r2, r3] + cmp r1, r0 + beq _0813A75E + ldrh r0, [r2, 0x20] + lsls r0, 24 + lsrs r0, 24 + bl RemoveScrollIndicatorArrowPair +_0813A75E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_813A738 + + thumb_func_start nullsub_55 +nullsub_55: @ 813A768 + bx lr + thumb_func_end nullsub_55 + + thumb_func_start sub_813A76C +sub_813A76C: @ 813A76C + push {r4-r6,lr} + movs r4, 0 + ldr r6, =0x020229e8 + ldr r0, =0x0000401f + adds r5, r0, 0 +_0813A776: + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x13] + cmp r0, 0 + bne _0813A79C + subs r0, r5, r4 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl VarSet + b _0813A7A8 + .pool +_0813A79C: + subs r0, r5, r4 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x69 + bl VarSet +_0813A7A8: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0813A776 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_813A76C + + thumb_func_start sub_813A7B8 +sub_813A7B8: @ 813A7B8 + push {lr} + ldr r1, =0x020375e0 + ldrh r0, [r1] + cmp r0, 0x5 + bls _0813A7C6 + movs r0, 0 + strh r0, [r1] +_0813A7C6: + ldrh r1, [r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + bl GetNature + lsls r0, 24 + ldr r1, =gUnknown_085B3040 + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bl box_related_two__2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_813A7B8 + + thumb_func_start sub_813A7F4 +sub_813A7F4: @ 813A7F4 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =0x00004030 + bl GetVarPointer + adds r5, r0, 0 + ldrh r0, [r5] + adds r4, r0 + strh r4, [r5] + ldrh r0, [r5] + movs r1, 0xC + bl __umodsi3 + strh r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813A7F4 + + thumb_func_start sub_813A820 +sub_813A820: @ 813A820 + push {r4,lr} + ldr r0, =0x00004030 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r1, =gUnknown_085B30A4 + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + bl box_related_two__2 + ldr r0, =0x00004031 + adds r1, r4, 0 + bl VarSet + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813A820 + + thumb_func_start sub_813A854 +sub_813A854: @ 813A854 + push {r4,lr} + ldr r4, =gUnknown_085B30D4 + ldr r0, =0x00004031 + bl VarGet + lsls r0, 16 + lsrs r0, 14 + adds r0, r4 + ldr r0, [r0] + bl box_related_two__2 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813A854 + + thumb_func_start sub_813A878 +sub_813A878: @ 813A878 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, =0x00004031 + bl VarGet + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r5, r0, 16 + ldr r4, =0x00004033 + adds r0, r4, 0 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _0813A8F0 + ldr r1, =gUnknown_085B3104 + lsls r0, r6, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r5, 8 + adds r0, r7 + cmp r1, r0 + bne _0813A8F0 + mov r0, r8 + cmp r0, 0 + beq _0813A8E8 + adds r0, r4, 0 + movs r1, 0x2 + bl VarSet + b _0813A8F0 + .pool +_0813A8E8: + adds r0, r4, 0 + movs r1, 0x3 + bl VarSet +_0813A8F0: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_813A878 + + thumb_func_start sub_813A8FC +sub_813A8FC: @ 813A8FC + push {lr} + sub sp, 0x2C + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000eb8 + adds r0, r1 + ldrh r1, [r0] + add r0, sp, 0xC + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldr r1, =gUnknown_085EB6AD + bl CopyString + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x30 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + ldr r0, =0x0203ab6d + ldrb r0, [r0] + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x1 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + add r2, sp, 0xC + bl Print + add sp, 0x2C + pop {r0} + bx r0 + .pool + thumb_func_end sub_813A8FC + + thumb_func_start sub_813A958 +sub_813A958: @ 813A958 + push {r4,lr} + ldr r4, =0x0203ab6d + ldr r0, =gUnknown_085B311C + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl SetStandardWindowBorderStyle + bl sub_813A8FC + ldrb r0, [r4] + movs r1, 0x2 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813A958 + + thumb_func_start sub_813A988 +sub_813A988: @ 813A988 + push {r4,lr} + ldr r4, =0x0203ab6d + 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_813A988 + + thumb_func_start sub_813A9A4 +sub_813A9A4: @ 813A9A4 + push {lr} + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r2, =0x00000eb8 + adds r1, r0, r2 + ldr r0, =0x020375e0 + ldrh r2, [r1] + ldrh r0, [r0] + cmp r2, r0 + bcs _0813A9C8 + movs r0, 0 + b _0813A9CA + .pool +_0813A9C8: + subs r0, r2, r0 +_0813A9CA: + strh r0, [r1] + pop {r0} + bx r0 + thumb_func_end sub_813A9A4 + + thumb_func_start sub_813A9D0 +sub_813A9D0: @ 813A9D0 + push {lr} + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000eb8 + adds r2, r0, r1 + ldrh r1, [r2] + ldr r0, =0x020375e0 + ldrh r0, [r0] + adds r1, r0 + ldr r0, =0x0000270f + cmp r1, r0 + ble _0813A9FC + strh r0, [r2] + b _0813A9FE + .pool +_0813A9FC: + strh r1, [r2] +_0813A9FE: + pop {r0} + bx r0 + thumb_func_end sub_813A9D0 + + thumb_func_start sub_813AA04 +sub_813AA04: @ 813AA04 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000eb8 + adds r0, r1 + ldrh r0, [r0] + bx lr + .pool + thumb_func_end sub_813AA04 + + thumb_func_start sub_813AA18 +sub_813AA18: @ 813AA18 + push {r4,lr} + ldr r4, =0x0203ab6e + ldr r0, =gUnknown_085B3124 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl SetStandardWindowBorderStyle + ldrb r0, [r4] + movs r1, 0x2 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813AA18 + + thumb_func_start sub_813AA44 +sub_813AA44: @ 813AA44 + push {r4,lr} + ldr r4, =0x0203ab6e + 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_813AA44 + + thumb_func_start sub_813AA60 +sub_813AA60: @ 813AA60 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 16 + lsls r1, 16 + lsrs r5, r1, 16 + lsrs r4, r0, 16 + ldr r1, =0xfffd0000 + adds r0, r1 + lsrs r0, 16 + cmp r0, 0x3 + bls _0813AA78 + b _0813ABC2 +_0813AA78: + movs r0, 0xD8 + str r0, [sp] + movs r0, 0x20 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0x11 + movs r2, 0 + movs r3, 0 + bl FillWindowPixelRect + cmp r4, 0x4 + beq _0813AAE8 + cmp r4, 0x4 + bgt _0813AAA0 + cmp r4, 0x3 + beq _0813AAAA + b _0813ABC2 + .pool +_0813AAA0: + cmp r4, 0x5 + beq _0813AB5C + cmp r4, 0x6 + beq _0813AB94 + b _0813ABC2 +_0813AAAA: + ldr r1, =gUnknown_085B3170 + lsls r0, r5, 2 + adds r0, r1 + ldr r2, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + str r4, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl AddTextPrinterParametrized + ldr r1, =gUnknown_085B312C + lsls r0, r5, 1 + adds r1, r0, r1 + ldrh r5, [r1] + ldr r0, =0x0000ffff + cmp r5, r0 + beq _0813AB18 + b _0813AB2C + .pool +_0813AAE8: + ldr r1, =gUnknown_085B319C + lsls r0, r5, 2 + adds r0, r1 + ldr r2, [r0] + 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, 0 + movs r1, 0x1 + movs r3, 0 + bl AddTextPrinterParametrized + ldr r1, =gUnknown_085B3142 + lsls r0, r5, 1 + adds r1, r0, r1 + ldrh r5, [r1] + ldr r0, =0x0000ffff + cmp r5, r0 + bne _0813AB2C +_0813AB18: + ldrh r0, [r1] + bl sub_813ABD4 + b _0813ABC2 + .pool +_0813AB2C: + ldr r4, =0x0000157c + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + lsls r0, r5, 24 + lsrs r0, 24 + str r4, [sp] + str r4, [sp, 0x4] + movs r1, 0x21 + movs r2, 0x58 + movs r3, 0 + bl AddDecorationIconObject + ldr r1, =0x0203ab6c + strb r0, [r1] + b _0813ABC2 + .pool +_0813AB5C: + ldr r1, =gUnknown_085B31B4 + lsls r0, r5, 2 + adds r0, r1 + ldr r2, [r0] + 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, 0 + movs r1, 0x1 + movs r3, 0 + bl AddTextPrinterParametrized + ldr r1, =gUnknown_085B314E + lsls r0, r5, 1 + adds r0, r1 + ldrh r0, [r0] + bl sub_813ABD4 + b _0813ABC2 + .pool +_0813AB94: + ldr r1, =gUnknown_085B31D0 + lsls r0, r5, 2 + adds r0, r1 + ldr r2, [r0] + 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, 0 + movs r1, 0x1 + movs r3, 0 + bl AddTextPrinterParametrized + ldr r1, =gUnknown_085B315C + lsls r0, r5, 1 + adds r0, r1 + ldrh r0, [r0] + bl sub_813ABD4 +_0813ABC2: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813AA60 + + thumb_func_start sub_813ABD4 +sub_813ABD4: @ 813ABD4 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + ldr r4, =0x0000157c + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl AddItemIconObject + ldr r4, =0x0203ab6c + strb r0, [r4] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _0813AC32 + ldr r3, =0x02020630 + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x24 + strh r1, [r0, 0x20] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x5C + strh r1, [r0, 0x22] +_0813AC32: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813ABD4 + + thumb_func_start sub_813AC44 +sub_813AC44: @ 813AC44 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r2, =0x0203ab6c + ldrb r0, [r2] + cmp r0, 0x40 + beq _0813AC70 + cmp r1, 0x6 + bgt _0813AC6A + cmp r1, 0x3 + blt _0813AC6A + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeResources +_0813AC6A: + ldr r1, =0x0203ab6c + movs r0, 0x40 + strb r0, [r1] +_0813AC70: + pop {r0} + bx r0 + .pool + thumb_func_end sub_813AC44 + + thumb_func_start sub_813AC7C +sub_813AC7C: @ 813AC7C + push {lr} + ldr r0, =0x020375e2 + ldrh r0, [r0] + cmp r0, 0 + beq _0813ACB8 + ldr r0, =0x02021cc4 + ldr r2, =gUnknown_085B320C + ldr r1, =0x020375e0 + ldrh r1, [r1] + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + b _0813ACD2 + .pool +_0813ACB8: + ldr r0, =0x02021cc4 + ldr r2, =gUnknown_085B31F8 + ldr r1, =0x020375e0 + ldrh r1, [r1] + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString +_0813ACD2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_813AC7C + + thumb_func_start sub_813ACE8 +sub_813ACE8: @ 813ACE8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + lsls r1, 16 + lsrs r6, r1, 16 + subs r0, 0x9 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0813AD20 + ldr r0, =0x020375e4 + ldrh r0, [r0] + cmp r0, 0 + bne _0813AD18 + ldr r4, =0x0203ab5e + ldr r0, =gUnknown_085B3220 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0 + bl SetStandardWindowBorderStyle +_0813AD18: + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_813AD34 +_0813AD20: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813ACE8 + + thumb_func_start sub_813AD34 +sub_813AD34: @ 813AD34 + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsls r1, 16 + lsrs r5, r1, 16 + adds r7, r5, 0 + lsrs r6, r0, 24 + movs r1, 0xF7 + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0813ADAC + ldr r4, =0x0203ab5e + ldrb r0, [r4] + movs r1, 0x60 + str r1, [sp] + movs r1, 0x30 + str r1, [sp, 0x4] + movs r1, 0x11 + movs r2, 0 + movs r3, 0 + bl FillWindowPixelRect + cmp r6, 0xA + bne _0813AD90 + ldrb r0, [r4] + ldr r2, =gUnknown_085B3254 + lsls r1, r5, 2 + adds r1, r2 + ldr r2, [r1] + movs r1, 0x1 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + b _0813ADAC + .pool +_0813AD90: + ldrb r0, [r4] + ldr r2, =gUnknown_085B3228 + lsls r1, r7, 2 + adds r1, r2 + ldr r2, [r1] + movs r1, 0x1 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print +_0813ADAC: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813AD34 + + thumb_func_start sub_813ADB8 +sub_813ADB8: @ 813ADB8 + push {r4,lr} + ldr r4, =0x0203ab5e + 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_813ADB8 + + thumb_func_start sub_813ADD4 +sub_813ADD4: @ 813ADD4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + ldr r0, =sub_813A600 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xFF + beq _0813AE90 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r6, r0, r1 + ldrh r0, [r6, 0x24] + lsls r0, 24 + lsrs r0, 24 + mov r4, sp + adds r4, 0x16 + add r1, sp, 0x14 + adds r2, r4, 0 + bl get_coro_args_x18_x1A + ldrh r0, [r6, 0x22] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl SetStandardWindowBorderStyle + movs r5, 0 + mov r9, r4 + ldr r0, =gUnknown_085B2CF0 + mov r8, r0 + movs r4, 0 +_0813AE1E: + ldrh r0, [r6, 0x22] + lsls r0, 24 + lsrs r0, 24 + add r1, sp, 0x14 + ldrh r2, [r1] + adds r2, r5 + lsls r2, 2 + ldr r1, =0x020375e0 + ldrh r1, [r1] + lsls r1, 6 + adds r2, r1 + add r2, r8 + ldr r2, [r2] + lsls r1, r5, 28 + lsrs r1, 24 + str r1, [sp] + movs r7, 0xFF + str r7, [sp, 0x4] + str r4, [sp, 0x8] + str r4, [sp, 0xC] + str r4, [sp, 0x10] + movs r1, 0x1 + movs r3, 0xA + bl sub_8199F74 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _0813AE1E + ldrh r0, [r6, 0x22] + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_085E8B3A + mov r3, r9 + ldrh r1, [r3] + lsls r1, 28 + lsrs r1, 24 + str r1, [sp] + str r7, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldrh r0, [r6, 0x22] + lsls r0, 24 + lsrs r0, 24 + bl PutWindowTilemap + ldrh r0, [r6, 0x22] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + bl CopyWindowToVram +_0813AE90: + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813ADD4 + + thumb_func_start sub_813AEB4 +sub_813AEB4: @ 813AEB4 + push {r4,lr} + movs r1, 0 + ldr r0, =0x020375e2 + strh r1, [r0] + ldr r0, =0x0000400e + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =0x0000400d + bl VarGet + lsls r0, 16 + lsrs r1, r0, 16 + cmp r4, 0 + beq _0813AF18 + movs r2, 0 + lsls r1, 1 + ldr r3, =gUnknown_0861500C + ldr r0, =gUnknown_085B320C + adds r0, r1, r0 + ldrh r1, [r0] +_0813AEE2: + lsls r0, r2, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r1 + beq _0813AF0C + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x1D + bls _0813AEE2 + b _0813AF38 + .pool +_0813AF0C: + ldr r0, =0x020375e2 + strh r2, [r0] + b _0813AF38 + .pool +_0813AF18: + movs r2, 0 + lsls r1, 1 + ldr r3, =gUnknown_0861500C + ldr r0, =gUnknown_085B31F8 + adds r0, r1, r0 + ldrh r1, [r0] +_0813AF24: + lsls r0, r2, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r1 + beq _0813AF0C + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x1D + bls _0813AF24 +_0813AF38: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813AEB4 + + thumb_func_start sub_813AF48 +sub_813AF48: @ 813AF48 + push {r4,r5,lr} + ldr r0, =sub_813A600 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xFF + beq _0813AFB6 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + ldrh r0, [r4, 0x24] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldr r0, =0x0203ab64 + ldr r0, [r0] + bl Free + ldrh r0, [r4, 0x22] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_8198070 + ldrh r0, [r4, 0x22] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl FillWindowPixelBuffer + ldrh r0, [r4, 0x22] + lsls r0, 24 + lsrs r0, 24 + bl ClearWindowTilemap + ldrh r0, [r4, 0x22] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl CopyWindowToVram + ldrh r0, [r4, 0x22] + lsls r0, 24 + lsrs r0, 24 + bl RemoveWindow + adds r0, r5, 0 + bl DestroyTask +_0813AFB6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813AF48 + + thumb_func_start sub_813AFC8 +sub_813AFC8: @ 813AFC8 + push {lr} + ldr r0, =task_deoxys_sound + movs r1, 0x8 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_813AFC8 + + thumb_func_start task_deoxys_sound +task_deoxys_sound: @ 813AFDC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x000008d4 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0813B004 + ldr r1, =0x020375f0 + movs r0, 0x3 + b _0813B06A + .pool +_0813B004: + ldr r0, =0x00004035 + mov r8, r0 + bl VarGet + lsls r0, 16 + lsrs r5, r0, 16 + ldr r4, =0x00004034 + adds r0, r4, 0 + bl VarGet + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r4, 0 + movs r1, 0 + bl VarSet + cmp r5, 0 + beq _0813B05C + ldr r0, =gUnknown_085B33F6 + subs r1, r5, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, r6 + bcs _0813B05C + movs r0, 0 + bl sub_813B0B4 + mov r0, r8 + movs r1, 0 + bl VarSet + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + b _0813B070 + .pool +_0813B05C: + cmp r5, 0xA + bne _0813B080 + ldr r0, =0x000008d4 + bl FlagSet + ldr r1, =0x020375f0 + movs r0, 0x2 +_0813B06A: + strh r0, [r1] + bl script_env_2_enable_and_set_ctx_running +_0813B070: + adds r0, r7, 0 + bl DestroyTask + b _0813B0A2 + .pool +_0813B080: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_813B0B4 + ldr r0, =0x00004035 + adds r1, r5, 0 + bl VarSet + ldr r1, =0x020375f0 + movs r0, 0x1 + strh r0, [r1] + adds r0, r7, 0 + bl DestroyTask +_0813B0A2: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end task_deoxys_sound + + thumb_func_start sub_813B0B4 +sub_813B0B4: @ 813B0B4 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 5 + ldr r1, =gUnknown_085B3280 + adds r0, r1 + movs r1, 0xD0 + lsls r1, 1 + movs r2, 0x8 + bl gpu_pal_apply + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + movs r0, 0x1 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + cmp r4, 0 + bne _0813B0F0 + movs r0, 0xC4 + bl audio_play + b _0813B0F8 + .pool +_0813B0F0: + movs r0, 0x82 + lsls r0, 1 + bl audio_play +_0813B0F8: + ldr r0, =sub_813B160 + movs r1, 0x8 + bl CreateTask + ldr r3, =0x02038c08 + movs r0, 0x1 + str r0, [r3] + movs r0, 0x3A + str r0, [r3, 0x4] + movs r0, 0x1A + str r0, [r3, 0x8] + ldr r0, =gUnknown_085B33E0 + lsls r2, r4, 1 + adds r1, r2, r0 + ldrb r1, [r1] + str r1, [r3, 0xC] + adds r0, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + str r0, [r3, 0x10] + adds r5, r2, 0 + cmp r4, 0 + bne _0813B138 + movs r0, 0x3C + b _0813B13A + .pool +_0813B138: + movs r0, 0x5 +_0813B13A: + str r0, [r3, 0x14] + movs r0, 0x42 + bl FieldEffectStart + ldr r0, =gUnknown_085B33E0 + adds r1, r5, r0 + ldrb r1, [r1] + adds r0, 0x1 + adds r0, r5, r0 + ldrb r2, [r0] + movs r0, 0x1 + bl update_saveblock1_field_object_coords + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813B0B4 + + thumb_func_start sub_813B160 +sub_813B160: @ 813B160 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x42 + bl FieldEffectActiveListContains + lsls r0, 24 + cmp r0, 0 + bne _0813B17C + bl script_env_2_enable_and_set_ctx_running + adds r0, r4, 0 + bl DestroyTask +_0813B17C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_813B160 + + thumb_func_start increment_var_x4026_on_birth_island_modulo_100 +increment_var_x4026_on_birth_island_modulo_100: @ 813B184 + push {r4,lr} + ldr r4, =0x00004034 + adds r0, r4, 0 + bl VarGet + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, =0x00003a1a + cmp r1, r0 + bne _0813B1C8 + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x63 + bls _0813B1C0 + adds r0, r4, 0 + movs r1, 0 + bl VarSet + b _0813B1C8 + .pool +_0813B1C0: + adds r0, r4, 0 + adds r1, r2, 0 + bl VarSet +_0813B1C8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end increment_var_x4026_on_birth_island_modulo_100 + + thumb_func_start sub_813B1D0 +sub_813B1D0: @ 813B1D0 + push {lr} + ldr r0, =0x00004035 + bl VarGet + lsls r0, 24 + lsrs r0, 19 + ldr r1, =gUnknown_085B3280 + adds r0, r1 + movs r1, 0xD0 + lsls r1, 1 + movs r2, 0x8 + bl gpu_pal_apply + movs r0, 0x80 + lsls r0, 19 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + pop {r0} + bx r0 + .pool + thumb_func_end sub_813B1D0 + + thumb_func_start set_unknown_box_id +@ void set_unknown_box_id(char id) +set_unknown_box_id: @ 813B204 + ldr r1, =0x0203ab6f + strb r0, [r1] + bx lr + .pool + thumb_func_end set_unknown_box_id + + thumb_func_start get_unknown_box_id +get_unknown_box_id: @ 813B210 + ldr r0, =0x0203ab6f + ldrb r0, [r0] + bx lr + .pool + thumb_func_end get_unknown_box_id + + thumb_func_start sub_813B21C +sub_813B21C: @ 813B21C + push {r4,r5,lr} + ldr r5, =0x000008d7 + adds r0, r5, 0 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _0813B258 + bl get_preferred_box + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x00004036 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r4, r0 + beq _0813B258 + adds r0, r5, 0 + bl FlagSet + movs r0, 0x1 + b _0813B25A + .pool +_0813B258: + movs r0, 0 +_0813B25A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_813B21C + + thumb_func_start sub_813B260 +sub_813B260: @ 813B260 + push {r4-r7,lr} + ldr r0, =0x00004036 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + bl set_unknown_box_id + bl get_preferred_box + lsls r0, 24 + lsrs r4, r0, 24 +_0813B278: + movs r5, 0 + lsls r6, r4, 24 + lsls r7, r4, 16 +_0813B27E: + lsls r1, r5, 24 + lsrs r1, 24 + lsrs r0, r6, 24 + bl get_pokemon_by_box_and_pos + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _0813B2C0 + bl get_unknown_box_id + lsls r0, 16 + lsrs r0, 16 + cmp r0, r4 + beq _0813B2A6 + ldr r0, =0x000008d7 + bl FlagReset +_0813B2A6: + ldr r0, =0x00004036 + lsrs r1, r7, 16 + bl VarSet + bl sub_813B21C + lsls r0, 24 + lsrs r0, 24 + b _0813B2DC + .pool +_0813B2C0: + adds r5, 0x1 + cmp r5, 0x1D + ble _0813B27E + adds r4, 0x1 + cmp r4, 0xE + bne _0813B2CE + movs r4, 0 +_0813B2CE: + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _0813B278 + movs r0, 0 +_0813B2DC: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_813B260 + + thumb_func_start sub_813B2E4 +sub_813B2E4: @ 813B2E4 + push {r4,lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x00004038 + movs r1, 0 + bl VarSet + movs r0, 0xDF + lsls r0, 1 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0813B340 + ldr r0, =0x000001bf + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0813B330 + ldr r0, =0x00004037 + movs r1, 0x7 + ands r4, r1 + adds r1, r4, 0 + adds r1, 0x9 + bl VarSet + b _0813B36A + .pool +_0813B330: + movs r0, 0x1 + ands r4, r0 + cmp r4, 0 + bne _0813B354 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r4, r0, 16 +_0813B340: + ldr r0, =0x00004037 + movs r1, 0x7 + ands r4, r1 + adds r1, r4, 0x1 + bl VarSet + b _0813B36A + .pool +_0813B354: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x00004037 + movs r1, 0x7 + ands r4, r1 + adds r1, r4, 0 + adds r1, 0x9 + bl VarSet +_0813B36A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813B2E4 + + thumb_func_start sub_813B374 +sub_813B374: @ 813B374 + push {r4,lr} + ldr r0, =0x00004037 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =0x02021cc4 + ldr r2, =gUnknown_085B3400 + subs r1, r4, 0x1 + adds r1, r2 + ldrb r1, [r1] + movs r2, 0 + bl GetMapName + cmp r4, 0x8 + bls _0813B3A8 + movs r0, 0x1 + b _0813B3AA + .pool +_0813B3A8: + movs r0, 0 +_0813B3AA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_813B374 + + thumb_func_start sub_813B3B0 +sub_813B3B0: @ 813B3B0 + push {r4-r6,lr} + ldr r5, =0x00004038 + adds r0, r5, 0 + bl VarGet + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x00004037 + bl VarGet + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0 + beq _0813B47C + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x000003e7 + cmp r4, r0 + bls _0813B474 + adds r0, r5, 0 + movs r1, 0 + bl VarSet + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r0, 0x4 + ldrsb r0, [r1, r0] + cmp r0, 0x18 + bne _0813B414 + movs r0, 0x5 + ldrsb r0, [r1, r0] + cmp r0, 0x69 + bgt _0813B414 + cmp r0, 0x65 + blt _0813B414 + ldr r0, =0x00004039 + movs r1, 0x1 + b _0813B478 + .pool +_0813B414: + ldr r0, =0x03005d8c + ldr r2, [r0] + movs r1, 0x4 + ldrsb r1, [r2, r1] + adds r3, r0, 0 + cmp r1, 0 + bne _0813B444 + movs r0, 0x5 + ldrsb r0, [r2, r0] + cmp r0, 0x34 + beq _0813B436 + cmp r0, 0x34 + blt _0813B444 + cmp r0, 0x38 + bgt _0813B444 + cmp r0, 0x36 + blt _0813B444 +_0813B436: + ldr r0, =0x00004039 + movs r1, 0x1 + b _0813B478 + .pool +_0813B444: + ldr r3, [r3] + movs r2, 0x5 + ldrsb r2, [r3, r2] + ldr r1, =gUnknown_085B3410 + subs r0, r6, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r2, r0 + bne _0813B468 + movs r0, 0x4 + ldrsb r0, [r3, r0] + cmp r0, 0 + bne _0813B468 + movs r0, 0x1 + b _0813B47E + .pool +_0813B468: + ldr r0, =0x00004037 + movs r1, 0 + b _0813B478 + .pool +_0813B474: + adds r0, r5, 0 + adds r1, r4, 0 +_0813B478: + bl VarSet +_0813B47C: + movs r0, 0 +_0813B47E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_813B3B0 + + thumb_func_start sub_813B484 +sub_813B484: @ 813B484 + push {lr} + movs r0, 0x2 + bl sub_80AB104 + pop {r0} + bx r0 + thumb_func_end sub_813B484 + + thumb_func_start sub_813B490 +sub_813B490: @ 813B490 + push {r4-r7,lr} + movs r3, 0 + ldr r0, =0x03005d8c + ldr r4, [r0] + movs r6, 0x4 + ldrsb r6, [r4, r6] + ldr r5, =gUnknown_085B3420 + adds r0, r5, 0x2 + mov r12, r0 + adds r7, r5, 0x1 +_0813B4A4: + lsls r0, r3, 1 + adds r2, r0, r3 + adds r0, r2, r5 + ldrb r0, [r0] + cmp r6, r0 + bne _0813B4CC + movs r1, 0x5 + ldrsb r1, [r4, r1] + adds r0, r2, r7 + ldrb r0, [r0] + cmp r1, r0 + bne _0813B4CC + mov r1, r12 + adds r0, r2, r1 + ldrb r0, [r0] + b _0813B4D8 + .pool +_0813B4CC: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xB + bls _0813B4A4 + movs r0, 0x1 +_0813B4D8: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_813B490 + + thumb_func_start sub_813B4E0 +sub_813B4E0: @ 813B4E0 + push {lr} + ldr r0, =0x020375e0 + ldrh r0, [r0] + bl sub_81D15CC + cmp r0, 0 + blt _0813B50C + movs r1, 0xAE + lsls r1, 1 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0813B50C + movs r0, 0x1 + b _0813B50E + .pool +_0813B50C: + movs r0, 0 +_0813B50E: + pop {r1} + bx r1 + thumb_func_end sub_813B4E0 + + thumb_func_start sub_813B514 +sub_813B514: @ 813B514 + push {lr} + ldr r0, =0x0000403f + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _0813B52C + movs r0, 0x1 + b _0813B52E + .pool +_0813B52C: + movs r0, 0 +_0813B52E: + pop {r1} + bx r1 + thumb_func_end sub_813B514 + + thumb_func_start sub_813B534 +sub_813B534: @ 813B534 + push {lr} + ldr r2, =0x0203ab70 + ldr r1, =0x02022fec + ldr r0, [r1] + str r0, [r2] + movs r0, 0 + str r0, [r1] + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0813B552 + ldr r0, =sub_80B3AF8 + movs r1, 0x5 + bl CreateTask +_0813B552: + pop {r0} + bx r0 + .pool + thumb_func_end sub_813B534 + + thumb_func_start sub_813B568 +sub_813B568: @ 813B568 + push {lr} + ldr r0, =sub_813B57C + movs r1, 0x5 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_813B568 + + thumb_func_start sub_813B57C +sub_813B57C: @ 813B57C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0x9 + bls _0813B596 + b _0813B7C6 +_0813B596: + lsls r0, 2 + ldr r1, =_0813B5A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0813B5A8: + .4byte _0813B5D0 + .4byte _0813B5E4 + .4byte _0813B614 + .4byte _0813B6B4 + .4byte _0813B6E4 + .4byte _0813B728 + .4byte _0813B764 + .4byte _0813B772 + .4byte _0813B784 + .4byte _0813B7A8 +_0813B5D0: + ldr r0, =sub_80B3AF8 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + beq _0813B5DE + b _0813B7C6 +_0813B5DE: + b _0813B790 + .pool +_0813B5E4: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0813B5F2 + b _0813B7C6 +_0813B5F2: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _0813B5FE + b _0813B790 +_0813B5FE: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020375e0 + movs r2, 0x2 + bl link_0800A448 + b _0813B708 + .pool +_0813B614: + bl sub_800A550 + movs r1, 0x2 + ands r1, r0 + cmp r1, 0 + bne _0813B622 + b _0813B7C6 +_0813B622: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + beq _0813B62E + b _0813B790 +_0813B62E: + ldr r5, =0x020375e2 + ldr r0, =0x020223c4 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r5] + movs r0, 0x1 + bl sub_800A5EC + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0x1 + bne _0813B668 + ldrh r1, [r5] + cmp r1, 0x1 + bne _0813B668 + ldr r0, =0x020375f0 + strh r1, [r0] + b _0813B790 + .pool +_0813B668: + ldr r0, =0x020375e0 + ldrh r1, [r0] + adds r2, r0, 0 + cmp r1, 0 + bne _0813B68C + ldr r0, =0x020375e2 + ldrh r0, [r0] + cmp r0, 0x1 + bne _0813B68C + ldr r1, =0x020375f0 + movs r0, 0x2 + b _0813B6AC + .pool +_0813B68C: + ldrh r0, [r2] + cmp r0, 0x1 + bne _0813B6A8 + ldr r0, =0x020375e2 + ldrh r0, [r0] + cmp r0, 0 + bne _0813B6A8 + ldr r1, =0x020375f0 + movs r0, 0x3 + b _0813B6AC + .pool +_0813B6A8: + ldr r1, =0x020375f0 + movs r0, 0 +_0813B6AC: + strh r0, [r1] + b _0813B790 + .pool +_0813B6B4: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0813B6C2 + b _0813B7C6 +_0813B6C2: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _0813B790 + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020375f0 + movs r2, 0x2 + bl link_0800A448 + b _0813B708 + .pool +_0813B6E4: + bl sub_800A550 + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0813B7C6 + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + beq _0813B790 + ldr r1, =0x020375f0 + ldr r0, =0x020223c4 + ldrh r0, [r0] + strh r0, [r1] + movs r0, 0 + bl sub_800A5EC +_0813B708: + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _0813B7C6 + .pool +_0813B728: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _0813B74C + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0x2 + bne _0813B790 + ldr r0, =gUnknown_0824979B + bl box_related_two__3 + b _0813B790 + .pool +_0813B74C: + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0x3 + bne _0813B790 + ldr r0, =gUnknown_0824979B + bl box_related_two__3 + b _0813B790 + .pool +_0813B764: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _0813B7C6 + b _0813B790 +_0813B772: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0813B7C6 + bl sub_800ADF8 + b _0813B790 +_0813B784: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0813B7C6 +_0813B790: + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0813B7C6 + .pool +_0813B7A8: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _0813B7B4 + bl sub_800AC34 +_0813B7B4: + ldr r0, =0x02022fec + ldr r1, =0x0203ab70 + ldr r1, [r1] + str r1, [r0] + bl script_env_2_enable_and_set_ctx_running + adds r0, r4, 0 + bl DestroyTask +_0813B7C6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813B57C + + thumb_func_start sub_813B7D8 +sub_813B7D8: @ 813B7D8 + push {lr} + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0 + bne _0813B7F8 + ldr r2, =c2_exit_to_overworld_1_continue_scripts_restart_music + movs r0, 0 + movs r1, 0x1 + bl sub_81D6720 + b _0813B802 + .pool +_0813B7F8: + ldr r2, =c2_exit_to_overworld_1_continue_scripts_restart_music + movs r0, 0x1 + movs r1, 0 + bl sub_81D6720 +_0813B802: + pop {r0} + bx r0 + .pool + thumb_func_end sub_813B7D8 + + thumb_func_start sub_813B80C +sub_813B80C: @ 813B80C + push {lr} + ldr r0, =sub_813B824 + movs r1, 0x8 + bl CreateTask + movs r0, 0x9D + bl audio_play + pop {r0} + bx r0 + .pool + thumb_func_end sub_813B80C + + thumb_func_start sub_813B824 +sub_813B824: @ 813B824 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + movs r0, 0x2 + ldrsh r1, [r4, r0] + ldr r0, =0x020375e2 + ldrh r0, [r0] + cmp r1, r0 + bne _0813B858 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + movs r0, 0 + strh r0, [r4, 0x2] + movs r0, 0x9D + bl audio_play +_0813B858: + movs r0, 0 + ldrsh r1, [r4, r0] + ldr r0, =0x020375e0 + ldrh r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _0813B86C + adds r0, r5, 0 + bl DestroyTask +_0813B86C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813B824 + + thumb_func_start sub_813B880 +sub_813B880: @ 813B880 + push {lr} + ldr r0, =_fwalk + movs r1, 0x8 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + movs r0, 0x4 + strh r0, [r1, 0x8] + strh r0, [r1, 0xA] + strh r0, [r1, 0xC] + strh r2, [r1, 0xE] + pop {r0} + bx r0 + .pool + thumb_func_end sub_813B880 + + thumb_func_start _fwalk +_fwalk: @ 813B8B0 + 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 + lsls r0, 2 + add r0, r9 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + movs r0, 0x6 + ldrsh r1, [r5, r0] + lsls r1, 1 + adds r1, r5 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + movs r1, 0x6 + ldrsh r0, [r5, r1] + lsls r0, 1 + adds r0, r5 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _0813B94E + movs r6, 0 +_0813B8EA: + movs r4, 0 + lsls r3, r6, 3 + mov r10, r3 + adds r7, r6, 0x1 + mov r8, r7 +_0813B8F4: + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r2, 0 + ldrsh r0, [r1, r2] + adds r0, r4 + adds r0, 0x6 + movs r3, 0x2 + ldrsh r1, [r1, r3] + adds r1, r6 + adds r1, 0x4 + ldr r7, =0x00000201 + adds r2, r4, r7 + add r2, r10 + movs r7, 0x6 + ldrsh r3, [r5, r7] + lsls r3, 5 + adds r2, r3 + lsls r2, 16 + lsrs r2, 16 + bl MapGridSetMetatileIdAt + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _0813B8F4 + mov r1, r8 + lsls r0, r1, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _0813B8EA + bl DrawWholeMapView + ldrh r0, [r5, 0x6] + adds r0, 0x1 + strh r0, [r5, 0x6] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _0813B94E + mov r0, r9 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running +_0813B94E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end _fwalk + + thumb_func_start sub_813B968 +sub_813B968: @ 813B968 + push {r4,r5,lr} + ldr r5, =0x020375f0 + ldr r0, =0x020375e0 + ldrh r0, [r0] + movs r1, 0x7 + bl __udivsi3 + strh r0, [r5] + ldrh r4, [r5] + adds r0, r4, 0 + movs r1, 0x14 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + subs r4, r1 + strh r4, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813B968 + + thumb_func_start sub_813B9A0 +sub_813B9A0: @ 813B9A0 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x1C] + movs r0, 0xB0 + lsls r0, 4 + cmp r1, r0 + bne _0813B9B6 + movs r0, 0x3 + bl sub_8084D1C +_0813B9B6: + pop {r0} + bx r0 + .pool + thumb_func_end sub_813B9A0 + + thumb_func_start sub_813B9C0 +sub_813B9C0: @ 813B9C0 + push {r4,lr} + ldr r0, =0x03005d8c + 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 + ldr r2, =gUnknown_085B3444 + ldrh r0, [r2] + ldr r1, =0x0000ffff + cmp r0, r1 + beq _0813BA06 + adds r4, r1, 0 + adds r1, r2, 0 +_0813B9E6: + ldrh r0, [r2] + cmp r0, r3 + bne _0813B9FC + movs r0, 0x1 + b _0813BA08 + .pool +_0813B9FC: + adds r1, 0x2 + adds r2, 0x2 + ldrh r0, [r1] + cmp r0, r4 + bne _0813B9E6 +_0813BA06: + movs r0, 0 +_0813BA08: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_813B9C0 + + thumb_func_start sub_813BA10 +sub_813BA10: @ 813BA10 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x0000141e + adds r1, r0, r2 + movs r2, 0 + strh r2, [r1] + movs r1, 0xA1 + lsls r1, 5 + adds r0, r1 + strh r2, [r0] + bx lr + .pool + thumb_func_end sub_813BA10 + + thumb_func_start sub_813BA30 +sub_813BA30: @ 813BA30 + push {lr} + bl sub_813BF44 + lsls r0, 24 + cmp r0, 0 + beq _0813BA52 + bl sub_813BCE8 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrh r0, [r0, 0xE] + movs r2, 0xA1 + lsls r2, 5 + adds r1, r2 + strh r0, [r1] +_0813BA52: + pop {r0} + bx r0 + .pool + thumb_func_end sub_813BA30 + + thumb_func_start sub_813BA60 +sub_813BA60: @ 813BA60 + push {r4,lr} + ldr r4, =0x03005d8c + ldr r0, [r4] + ldr r1, =0x0000141e + adds r0, r1 + ldrh r0, [r0] + lsrs r0, 7 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0813BAB6 + bl sub_813BF60 + bl sub_813BD84 + ldr r1, [r4] + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrh r0, [r0, 0xE] + movs r2, 0xA1 + lsls r2, 5 + adds r1, r2 + strh r0, [r1] + ldr r0, =0x00000315 + bl FlagReset + ldr r0, =0x00000316 + bl FlagReset + ldr r0, =0x00000317 + bl FlagReset + movs r0, 0xC6 + lsls r0, 2 + bl FlagReset + ldr r0, =0x000002da + bl FlagReset + ldr r0, =0x00004095 + movs r1, 0x1 + bl VarSet +_0813BAB6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813BA60 + + thumb_func_start sub_813BADC +sub_813BADC: @ 813BADC + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x00004095 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bne _0813BB58 + ldr r4, =0x03005d8c + ldr r0, [r4] + ldr r5, =0x0000141e + adds r3, r0, r5 + ldrh r2, [r3] + movs r1, 0x7F + ands r1, r2 + ldr r0, =gUnknown_085B3470 + adds r0, r6, r0 + ldrb r0, [r0] + adds r1, r0 + cmp r1, 0x13 + ble _0813BB54 + bl sub_813BCA8 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bhi _0813BB3C + bl sub_813BB74 + ldr r0, [r4] + adds r0, r5 + ldrh r2, [r0] + ldr r1, =0x0000ff80 + ands r1, r2 + strh r1, [r0] + b _0813BB58 + .pool +_0813BB3C: + ldr r2, [r4] + adds r2, r5 + ldrh r1, [r2] + ldr r0, =0x0000ff80 + ands r0, r1 + movs r1, 0x14 + orrs r0, r1 + strh r0, [r2] + b _0813BB58 + .pool +_0813BB54: + adds r0, r2, r0 + strh r0, [r3] +_0813BB58: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x0000141e + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x7F + ands r0, r1 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_813BADC + + thumb_func_start sub_813BB74 +sub_813BB74: @ 813BB74 + push {r4-r7,lr} + sub sp, 0x8 + movs r3, 0 + movs r5, 0 + ldr r7, =0x03005d8c + ldr r2, =0x0000141e + movs r6, 0x1 +_0813BB82: + ldr r0, [r7] + adds r0, r2 + ldrh r1, [r0] + ldr r0, =gUnknown_085B3474 + adds r0, r5, r0 + ldrb r4, [r0] + asrs r1, r4 + ands r1, r6 + cmp r1, 0 + bne _0813BBC8 + adds r3, r5, 0 + str r2, [sp] + str r3, [sp, 0x4] + bl GenerateRandomNumber + adds r1, r6, 0 + ands r1, r0 + ldr r2, [sp] + ldr r3, [sp, 0x4] + cmp r1, 0 + beq _0813BBC8 + ldr r0, [r7] + adds r0, r2 + adds r1, r6, 0 + lsls r1, r4 + ldrh r2, [r0] + orrs r1, r2 + strh r1, [r0] + b _0813BBEA + .pool +_0813BBC8: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x7 + bls _0813BB82 + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r0, =0x0000141e + adds r2, r0 + ldr r1, =gUnknown_085B3474 + adds r1, r3, r1 + movs r0, 0x1 + ldrb r1, [r1] + lsls r0, r1 + ldrh r1, [r2] + orrs r0, r1 + strh r0, [r2] +_0813BBEA: + adds r0, r3, 0 + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_813BB74 + + thumb_func_start sub_813BC00 +sub_813BC00: @ 813BC00 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r0, 0 + mov r10, r0 + bl sub_813BCA8 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _0813BC2E + movs r0, 0 + b _0813BC8E +_0813BC1E: + mov r1, r8 + ldr r0, [r1] + add r0, r9 + lsls r4, r6 + ldrh r1, [r0] + eors r4, r1 + strh r4, [r0] + b _0813BC8C +_0813BC2E: + movs r5, 0 + ldr r2, =0x03005d8c + mov r8, r2 + ldr r0, =0x0000141e + mov r9, r0 + movs r4, 0x1 +_0813BC3A: + mov r1, r8 + ldr r0, [r1] + add r0, r9 + ldrh r1, [r0] + ldr r7, =gUnknown_085B347C + adds r0, r5, r7 + ldrb r6, [r0] + asrs r1, r6 + ands r1, r4 + cmp r1, 0 + beq _0813BC5E + mov r10, r5 + bl GenerateRandomNumber + adds r1, r4, 0 + ands r1, r0 + cmp r1, 0 + bne _0813BC1E +_0813BC5E: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x7 + bls _0813BC3A + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x0000141e + adds r4, r0, r2 + ldrh r1, [r4] + mov r2, r10 + adds r0, r2, r7 + ldrb r2, [r0] + adds r0, r1, 0 + asrs r0, r2 + movs r3, 0x1 + ands r0, r3 + cmp r0, 0 + beq _0813BC8C + adds r0, r3, 0 + lsls r0, r2 + eors r1, r0 + strh r1, [r4] +_0813BC8C: + mov r0, r10 +_0813BC8E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_813BC00 + + thumb_func_start sub_813BCA8 +sub_813BCA8: @ 813BCA8 + push {r4,r5,lr} + movs r3, 0 + movs r2, 0 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x0000141e + adds r0, r1 + ldrh r4, [r0] + movs r5, 0x1 +_0813BCBA: + adds r1, r2, 0 + adds r1, 0x8 + adds r0, r4, 0 + asrs r0, r1 + ands r0, r5 + cmp r0, 0 + beq _0813BCCE + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 +_0813BCCE: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _0813BCBA + adds r0, r3, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_813BCA8 + + thumb_func_start sub_813BCE8 +sub_813BCE8: @ 813BCE8 + push {r4-r6,lr} + movs r5, 0 + ldr r2, =0x03005d90 + ldr r0, [r2] + ldrh r1, [r0, 0xE] + ldr r0, =0x000003e6 + cmp r1, r0 + bhi _0813BD58 + adds r6, r2, 0 + b _0813BD32 + .pool +_0813BD04: + ldr r0, [r6] + ldrh r1, [r0, 0xE] + ldr r4, =0x03005d8c + ldr r0, [r4] + movs r2, 0xA1 + lsls r2, 5 + adds r0, r2 + ldrh r0, [r0] + subs r1, r0 + cmp r1, 0xB + ble _0813BD58 + bl sub_813BC00 + ldr r0, [r4] + movs r1, 0xA1 + lsls r1, 5 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0xC + strh r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_0813BD32: + bl sub_813BCA8 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4 + bhi _0813BD54 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, [r6] + ldrh r0, [r0, 0xE] + movs r2, 0xA1 + lsls r2, 5 + adds r1, r2 + strh r0, [r1] + b _0813BD58 + .pool +_0813BD54: + cmp r5, 0x8 + bne _0813BD04 +_0813BD58: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_813BCE8 + + thumb_func_start sub_813BD60 +sub_813BD60: @ 813BD60 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x0000141e + adds r0, r1 + ldrh r0, [r0] + ldr r1, =0x020375e0 + ldrh r1, [r1] + asrs r0, r1 + movs r1, 0x1 + ands r0, r1 + bx lr + .pool + thumb_func_end sub_813BD60 + + thumb_func_start sub_813BD84 +sub_813BD84: @ 813BD84 + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r0, =0x0000141e + adds r2, r0 + ldrh r1, [r2] + movs r3, 0x80 + lsls r3, 6 + adds r0, r3, 0 + orrs r0, r1 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + orrs r0, r1 + movs r3, 0x80 + lsls r3, 3 + adds r1, r3, 0 + orrs r0, r1 + strh r0, [r2] + bx lr + .pool + thumb_func_end sub_813BD84 + + thumb_func_start sub_813BDB4 +sub_813BDB4: @ 813BDB4 + push {lr} + movs r3, 0 + movs r2, 0 + ldr r0, =0x020375e0 + ldrh r0, [r0] + subs r0, 0x8 + cmp r0, 0x7 + bhi _0813BE14 + lsls r0, 2 + ldr r1, =_0813BDD8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0813BDD8: + .4byte _0813BE14 + .4byte _0813BE14 + .4byte _0813BDF8 + .4byte _0813BDFE + .4byte _0813BE04 + .4byte _0813BE0A + .4byte _0813BE10 + .4byte _0813BE14 +_0813BDF8: + movs r3, 0 + movs r2, 0x3 + b _0813BE14 +_0813BDFE: + movs r3, 0 + movs r2, 0x1 + b _0813BE14 +_0813BE04: + movs r3, 0x1 + movs r2, 0 + b _0813BE14 +_0813BE0A: + movs r3, 0 + movs r2, 0x4 + b _0813BE14 +_0813BE10: + movs r3, 0x1 + movs r2, 0x5 +_0813BE14: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003150 + adds r0, r1 + adds r1, r3, 0 + bl sub_813BE30 + pop {r0} + bx r0 + .pool + thumb_func_end sub_813BDB4 + + thumb_func_start sub_813BE30 +sub_813BE30: @ 813BE30 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r0, r5, 4 + adds r1, r6, r0 + ldrb r0, [r1] + cmp r0, 0xFF + bne _0813BEE8 + cmp r2, 0x5 + bhi _0813BED4 + lsls r0, r2, 2 + ldr r1, =_0813BE58 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0813BE58: + .4byte _0813BED4 + .4byte _0813BE70 + .4byte _0813BE84 + .4byte _0813BE98 + .4byte _0813BEAC + .4byte _0813BEC0 +_0813BE70: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EAD14 + bl CopyString + b _0813BF04 + .pool +_0813BE84: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EAD1B + bl CopyString + b _0813BF04 + .pool +_0813BE98: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EAD22 + bl CopyString + b _0813BF04 + .pool +_0813BEAC: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EAD29 + bl CopyString + b _0813BF04 + .pool +_0813BEC0: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EAD30 + bl CopyString + b _0813BF04 + .pool +_0813BED4: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EAD0C + bl CopyString + b _0813BF04 + .pool +_0813BEE8: + ldr r4, =0x02021cc4 + adds r0, r4, 0 + movs r2, 0x7 + bl CopyString_LimitN + movs r0, 0xFF + strb r0, [r4, 0x7] + adds r0, r6, 0 + adds r0, 0x50 + adds r0, r5 + ldrb r1, [r0] + adds r0, r4, 0 + bl StopMusicWhileStringIsPrinted +_0813BF04: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813BE30 + + thumb_func_start sub_813BF10 +sub_813BF10: @ 813BF10 + push {lr} + ldr r0, =0x00004095 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bne _0813BF40 + bl sub_813BA30 + ldr r0, =0x0202433a + ldrb r0, [r0] + cmp r0, 0x1 + bne _0813BF3C + bl sub_813BB74 + b _0813BF40 + .pool +_0813BF3C: + bl sub_813BC00 +_0813BF40: + pop {r0} + bx r0 + thumb_func_end sub_813BF10 + + thumb_func_start sub_813BF44 +sub_813BF44: @ 813BF44 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x0000141e + adds r0, r1 + ldrh r0, [r0] + lsrs r0, 7 + movs r1, 0x1 + ands r0, r1 + bx lr + .pool + thumb_func_end sub_813BF44 + + thumb_func_start sub_813BF60 +sub_813BF60: @ 813BF60 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x0000141e + adds r1, r0 + ldrh r2, [r1] + movs r0, 0x80 + orrs r0, r2 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_813BF60 + + thumb_func_start sub_813BF7C +sub_813BF7C: @ 813BF7C + push {lr} + ldr r0, =0x020375e0 + ldrb r0, [r0] + bl sub_813BADC + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_813BF7C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_8032654.s b/asm/rom_8032654.s deleted file mode 100644 index 6283076d9..000000000 --- a/asm/rom_8032654.s +++ /dev/null @@ -1,212175 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start battle_wireless_setup_if_required_maybe -battle_wireless_setup_if_required_maybe: @ 8032654 - push {lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08032686 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _0803266E - bl sub_800B488 -_0803266E: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0803267A - bl sub_8009734 -_0803267A: - ldr r0, =task00_08081A90 - movs r1, 0 - bl CreateTask - bl sub_8033244 -_08032686: - pop {r0} - bx r0 - .pool - thumb_func_end battle_wireless_setup_if_required_maybe - - thumb_func_start sub_803269C -sub_803269C: @ 803269C - push {r4-r7,lr} - sub sp, 0x14 - ldr r0, =0x03005d04 - ldr r1, =nullsub_20 - str r1, [r0] - movs r0, 0 - str r0, [sp, 0x10] - movs r1, 0 - ldr r7, =0x03005d60 - ldr r6, =0x020244ac - movs r2, 0 - ldr r5, =0x020244b0 - ldr r4, =nullsub_21 - ldr r3, =0x02024076 -_080326B8: - lsls r0, r1, 2 - adds r0, r7 - str r4, [r0] - adds r1, r3 - movs r0, 0xFF - strb r0, [r1] - ldr r0, [sp, 0x10] - adds r0, r6 - strb r2, [r0] - ldr r0, [sp, 0x10] - adds r0, r5 - strb r2, [r0] - ldr r0, [sp, 0x10] - adds r0, 0x1 - str r0, [sp, 0x10] - adds r1, r0, 0 - cmp r1, 0x3 - ble _080326B8 - bl battle_wireless_setup_if_required_maybe - ldr r0, =0x02024068 - movs r5, 0 - str r5, [r0] - bl sub_80A3934 - bl sub_806E414 - movs r0, 0xF - bl sub_81308C8 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08032728 - bl zero_enemy_party_data - ldr r4, =0x02024744 - movs r1, 0x90 - lsls r1, 1 - str r5, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - str r5, [sp, 0xC] - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0x20 - bl create_pokemon_set_level - str r5, [sp, 0x10] - adds r0, r4, 0 - movs r1, 0xC - add r2, sp, 0x10 - bl pokemon_setattr -_08032728: - ldr r0, =0x02022ff4 - str r5, [r0] - ldr r0, =0x0202428c - strb r5, [r0] - add sp, 0x14 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803269C - - thumb_func_start sub_8032768 -sub_8032768: @ 8032768 - push {r4,r5,lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - bne _08032784 - movs r0, 0x1 - bl sub_8184DA4 - b _0803278A - .pool -_08032784: - movs r0, 0x2 - bl sub_8184DA4 -_0803278A: - ldr r4, =0x02022fec - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - bne _0803279C - bl sub_8185EB8 -_0803279C: - ldr r0, [r4] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080327B0 - bl b_setup_bx_link - b _080327B4 - .pool -_080327B0: - bl b_setup_bx -_080327B4: - bl sub_8033050 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _080327E2 - movs r4, 0 - ldr r0, =0x0202406c - ldrb r1, [r0] - cmp r4, r1 - bge _080327E2 - adds r5, r0, 0 -_080327D0: - lsls r0, r4, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_81B8D64 - adds r4, 0x1 - ldrb r0, [r5] - cmp r4, r0 - blt _080327D0 -_080327E2: - movs r4, 0 - ldr r3, =0x0202449c - movs r2, 0xD2 - lsls r2, 1 - movs r1, 0 -_080327EC: - ldr r0, [r3] - adds r0, r4, r0 - adds r0, r2 - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x5F - bls _080327EC - movs r4, 0 - ldr r3, =0x0202449c - movs r2, 0x81 - lsls r2, 2 - movs r1, 0 -_08032804: - ldr r0, [r3] - adds r0, r4, r0 - adds r0, r2 - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x67 - bls _08032804 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8032768 - - thumb_func_start b_setup_bx -b_setup_bx: @ 8032824 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x02022fec - ldr r3, [r0] - movs r5, 0x80 - lsls r5, 15 - ands r5, r3 - cmp r5, 0 - beq _080328E4 - ldr r1, =0x03005d04 - ldr r0, =sub_8039ECC - str r0, [r1] - movs r4, 0x80 - lsls r4, 17 - ands r4, r3 - cmp r4, 0 - beq _08032874 - ldr r2, =0x03005d60 - ldr r0, =sub_818994C - str r0, [r2] - ldr r1, =0x02024076 - movs r0, 0 - strb r0, [r1] - b _0803287E - .pool -_08032874: - ldr r2, =0x03005d60 - ldr r0, =sub_805745C - str r0, [r2] - ldr r1, =0x02024076 - strb r4, [r1] -_0803287E: - ldr r3, =sub_805F164 - str r3, [r2, 0x4] - movs r0, 0x1 - strb r0, [r1, 0x1] - ldr r0, =sub_81BADF4 - str r0, [r2, 0x8] - movs r0, 0x2 - strb r0, [r1, 0x2] - str r3, [r2, 0xC] - movs r0, 0x3 - strb r0, [r1, 0x3] - ldr r1, =0x0202406c - movs r0, 0x4 - strb r0, [r1] - movs r0, 0 - movs r1, 0 - bl sub_81B8D64 - movs r0, 0x1 - movs r1, 0 - bl sub_81B8D64 - movs r0, 0x2 - movs r1, 0x1 - bl sub_81B8D64 - movs r0, 0x3 - movs r1, 0x1 - bl sub_81B8D64 - ldr r0, =0x0202406e - movs r1, 0 - strh r1, [r0] - strh r1, [r0, 0x2] - movs r1, 0x3 - b _08032A76 - .pool -_080328E4: - movs r7, 0x1 - adds r0, r3, 0 - ands r0, r7 - cmp r0, 0 - beq _080328F0 - b _080329E0 -_080328F0: - ldr r0, =0x03005d04 - ldr r2, =sub_8039ECC - str r2, [r0] - movs r1, 0x80 - ands r1, r3 - mov r12, r2 - cmp r1, 0 - beq _08032918 - ldr r1, =0x03005d60 - ldr r0, =sub_815936C - b _08032934 - .pool -_08032918: - movs r0, 0x80 - lsls r0, 2 - ands r3, r0 - cmp r3, 0 - beq _08032930 - ldr r1, =0x03005d60 - ldr r0, =bx_goto_buffer_A_ch0_tbl3 - b _08032934 - .pool -_08032930: - ldr r1, =0x03005d60 - ldr r0, =sub_805745C -_08032934: - str r0, [r1] - mov r10, r1 - ldr r4, =0x02024076 - movs r0, 0 - mov r9, r0 - mov r1, r9 - strb r1, [r4] - mov r5, r10 - ldr r2, =sub_805F164 - mov r8, r2 - str r2, [r5, 0x4] - movs r6, 0x1 - strb r6, [r4, 0x1] - ldr r2, =0x0202406c - movs r7, 0x2 - strb r7, [r2] - ldr r0, =0x02022fec - ldr r3, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r3 - cmp r0, 0 - bne _08032964 - b _08032CB2 -_08032964: - movs r1, 0x80 - lsls r1, 18 - ands r1, r3 - cmp r1, 0 - beq _080329CC - movs r1, 0x80 - lsls r1, 24 - ands r1, r3 - cmp r1, 0 - beq _080329B4 - mov r1, r12 - ldr r0, =0x03005d04 - str r1, [r0] - ldr r0, =sub_818994C - str r0, [r5] - mov r1, r9 - strb r1, [r4] - ldr r0, =sub_81864EC - str r0, [r5, 0x4] - strb r6, [r4, 0x1] - strb r7, [r2] - b _08032CB2 - .pool -_080329B4: - ldr r0, =sub_818994C - str r0, [r5, 0x4] - strb r1, [r4, 0x1] - ldr r0, =sub_81864EC - str r0, [r5] - strb r6, [r4] - strb r7, [r2] - b _08032CB2 - .pool -_080329CC: - ldr r0, =sub_818994C - mov r2, r10 - str r0, [r2] - strb r1, [r4] - mov r0, r8 - str r0, [r2, 0x4] - strb r6, [r4, 0x1] - b _08032CB2 - .pool -_080329E0: - ldr r1, =sub_8039ECC - ldr r2, =0x03005d04 - str r1, [r2] - ldr r2, =0x03005d60 - ldr r0, =sub_805745C - str r0, [r2] - ldr r4, =0x02024076 - strb r5, [r4] - ldr r6, =sub_805F164 - str r6, [r2, 0x4] - strb r7, [r4, 0x1] - str r0, [r2, 0x8] - movs r0, 0x2 - mov r12, r0 - mov r1, r12 - strb r1, [r4, 0x2] - str r6, [r2, 0xC] - movs r0, 0x3 - mov r8, r0 - mov r1, r8 - strb r1, [r4, 0x3] - ldr r0, =0x0202406c - mov r10, r0 - movs r1, 0x4 - mov r9, r1 - strb r1, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r3 - cmp r0, 0 - bne _08032A20 - b _08032CB2 -_08032A20: - movs r1, 0xA0 - lsls r1, 1 - adds r0, r3, 0 - ands r0, r1 - cmp r0, r1 - bne _08032AA0 - ldr r0, =sub_8039ECC - ldr r1, =0x03005d04 - str r0, [r1] - ldr r0, =sub_818994C - str r0, [r2] - strb r5, [r4] - str r6, [r2, 0x4] - strb r7, [r4, 0x1] - str r0, [r2, 0x8] - mov r0, r12 - strb r0, [r4, 0x2] - str r6, [r2, 0xC] - mov r1, r8 - strb r1, [r4, 0x3] - mov r0, r9 - mov r2, r10 - strb r0, [r2] - movs r0, 0 - movs r1, 0 - bl sub_81B8D64 - movs r0, 0x1 - movs r1, 0 - bl sub_81B8D64 - movs r0, 0x2 - movs r1, 0x1 - bl sub_81B8D64 - movs r0, 0x3 - movs r1, 0x1 - bl sub_81B8D64 - ldr r0, =0x0202406e - strh r5, [r0] - strh r5, [r0, 0x2] - mov r1, r8 -_08032A76: - strh r1, [r0, 0x4] - strh r1, [r0, 0x6] - b _08032CB2 - .pool -_08032AA0: - movs r5, 0x40 - ands r5, r3 - cmp r5, 0 - bne _08032AAA - b _08032C3C -_08032AAA: - ldr r0, =0x0203c7b4 - ldrb r5, [r0] - movs r0, 0 - mov r10, r0 - ldr r1, =0x020229e8 - mov r12, r1 - adds r7, r4, 0 - mov r8, r0 - ldr r6, =0x0202406e - movs r4, 0 - movs r2, 0x3 - mov r9, r2 -_08032AC2: - mov r1, r12 - adds r0, r4, r1 - ldrh r0, [r0, 0x18] - cmp r0, 0x2 - bgt _08032AE4 - cmp r0, 0x1 - bge _08032AFC - cmp r0, 0 - beq _08032AE8 - b _08032B06 - .pool -_08032AE4: - cmp r0, 0x3 - bne _08032B06 -_08032AE8: - ldr r0, =0x020229e8 - adds r0, r4, r0 - ldrb r0, [r0, 0x18] - movs r1, 0 - bl sub_81B8D64 - b _08032B06 - .pool -_08032AFC: - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_81B8D64 -_08032B06: - cmp r10, r5 - bne _08032B56 - ldr r0, =0x020229e8 - adds r3, r4, r0 - ldrh r1, [r3, 0x18] - lsls r1, 2 - ldr r2, =0x03005d60 - adds r1, r2 - ldr r2, =sub_818994C - str r2, [r1] - ldrh r1, [r3, 0x18] - mov r12, r0 - cmp r1, 0x2 - bgt _08032B38 - cmp r1, 0x1 - bge _08032B4C - cmp r1, 0 - beq _08032B3C - b _08032C2C - .pool -_08032B38: - cmp r1, 0x3 - bne _08032C2C -_08032B3C: - mov r1, r12 - adds r0, r4, r1 - ldrh r1, [r0, 0x18] - adds r1, r7 - mov r2, r8 - strb r2, [r1] - ldrh r0, [r0, 0x18] - b _08032C12 -_08032B4C: - adds r1, r7 - movs r0, 0x2 - strb r0, [r1] - ldrh r0, [r3, 0x18] - b _08032C24 -_08032B56: - ldr r2, =0x020229e8 - adds r0, r4, r2 - ldrh r1, [r0, 0x18] - movs r3, 0x1 - adds r0, r3, 0 - ands r0, r1 - mov r12, r2 - cmp r0, 0 - bne _08032B80 - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - add r0, r12 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _08032B92 - b _08032BD8 - .pool -_08032B80: - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - add r0, r12 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _08032BD8 -_08032B92: - mov r0, r12 - adds r2, r4, r0 - ldrh r0, [r2, 0x18] - lsls r0, 2 - ldr r1, =0x03005d60 - adds r0, r1 - ldr r1, =sub_818994C - str r1, [r0] - ldrh r1, [r2, 0x18] - cmp r1, 0x2 - bgt _08032BBC - cmp r1, 0x1 - bge _08032BD0 - cmp r1, 0 - beq _08032BC0 - b _08032C2C - .pool -_08032BBC: - cmp r1, 0x3 - bne _08032C2C -_08032BC0: - mov r2, r12 - adds r0, r4, r2 - ldrh r1, [r0, 0x18] - adds r1, r7 - mov r2, r8 - strb r2, [r1] - ldrh r0, [r0, 0x18] - b _08032C12 -_08032BD0: - adds r1, r7 - movs r0, 0x2 - strb r0, [r1] - b _08032C22 -_08032BD8: - mov r0, r12 - adds r2, r4, r0 - ldrh r0, [r2, 0x18] - lsls r0, 2 - ldr r1, =0x03005d60 - adds r0, r1 - ldr r1, =sub_81864EC - str r1, [r0] - ldrh r0, [r2, 0x18] - cmp r0, 0x2 - bgt _08032C00 - cmp r0, 0x1 - bge _08032C1C - cmp r0, 0 - beq _08032C04 - b _08032C2C - .pool -_08032C00: - cmp r0, 0x3 - bne _08032C2C -_08032C04: - mov r0, r12 - adds r2, r4, r0 - ldrh r0, [r2, 0x18] - adds r0, r7 - movs r1, 0x1 - strb r1, [r0] - ldrh r0, [r2, 0x18] -_08032C12: - lsls r0, 1 - adds r0, r6 - mov r1, r8 - strh r1, [r0] - b _08032C2C -_08032C1C: - adds r0, r7 - mov r1, r9 - strb r1, [r0] -_08032C22: - ldrh r0, [r2, 0x18] -_08032C24: - lsls r0, 1 - adds r0, r6 - mov r2, r9 - strh r2, [r0] -_08032C2C: - adds r4, 0x1C - movs r0, 0x1 - add r10, r0 - mov r1, r10 - cmp r1, 0x3 - bgt _08032C3A - b _08032AC2 -_08032C3A: - b _08032CB2 -_08032C3C: - movs r1, 0x4 - ands r1, r3 - cmp r1, 0 - beq _08032C7C - ldr r0, =sub_818994C - str r0, [r2] - strb r5, [r4] - str r0, [r2, 0x8] - mov r0, r12 - strb r0, [r4, 0x2] - movs r0, 0x80 - lsls r0, 18 - ands r3, r0 - cmp r3, 0 - beq _08032C70 - ldr r0, =sub_81864EC - str r0, [r2, 0x4] - strb r7, [r4, 0x1] - str r0, [r2, 0xC] - mov r1, r8 - strb r1, [r4, 0x3] - b _08032CB2 - .pool -_08032C70: - str r6, [r2, 0x4] - strb r7, [r4, 0x1] - str r6, [r2, 0xC] - mov r2, r8 - strb r2, [r4, 0x3] - b _08032CB2 -_08032C7C: - ldr r0, =sub_818994C - str r0, [r2, 0x4] - strb r1, [r4, 0x1] - str r0, [r2, 0xC] - mov r0, r12 - strb r0, [r4, 0x3] - movs r0, 0x80 - lsls r0, 18 - ands r3, r0 - cmp r3, 0 - beq _08032CA8 - ldr r0, =sub_81864EC - str r0, [r2] - strb r7, [r4] - str r0, [r2, 0x8] - mov r1, r8 - strb r1, [r4, 0x2] - b _08032CB2 - .pool -_08032CA8: - str r6, [r2] - strb r7, [r4] - str r6, [r2, 0x8] - mov r2, r8 - strb r2, [r4, 0x2] -_08032CB2: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end b_setup_bx - - thumb_func_start b_setup_bx_link -b_setup_bx_link: @ 8032CC0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r4, =0x02022fec - ldr r1, [r4] - movs r5, 0x1 - adds r3, r1, 0 - ands r3, r5 - cmp r3, 0 - bne _08032D48 - movs r4, 0x4 - ands r4, r1 - cmp r4, 0 - beq _08032D1C - ldr r1, =0x03005d04 - ldr r0, =sub_8039ECC - str r0, [r1] - ldr r2, =0x03005d60 - ldr r0, =sub_805745C - str r0, [r2] - ldr r1, =0x02024076 - strb r3, [r1] - ldr r0, =sub_8064394 - str r0, [r2, 0x4] - strb r5, [r1, 0x1] - ldr r1, =0x0202406c - movs r0, 0x2 - b _0803303A - .pool -_08032D1C: - ldr r2, =0x03005d60 - ldr r0, =sub_805745C - str r0, [r2, 0x4] - ldr r1, =0x02024076 - strb r4, [r1, 0x1] - ldr r0, =sub_8064394 - str r0, [r2] - strb r5, [r1] - ldr r1, =0x0202406c - movs r0, 0x2 - b _0803303A - .pool -_08032D48: - movs r0, 0x41 - ands r0, r1 - cmp r0, 0x1 - bne _08032DD0 - movs r6, 0x4 - adds r3, r6, 0 - ands r3, r1 - cmp r3, 0 - beq _08032D98 - ldr r1, =0x03005d04 - ldr r0, =sub_8039ECC - str r0, [r1] - ldr r2, =0x03005d60 - ldr r4, =sub_805745C - str r4, [r2] - ldr r1, =0x02024076 - movs r0, 0 - strb r0, [r1] - ldr r3, =sub_8064394 - str r3, [r2, 0x4] - strb r5, [r1, 0x1] - str r4, [r2, 0x8] - movs r0, 0x2 - strb r0, [r1, 0x2] - str r3, [r2, 0xC] - movs r0, 0x3 - strb r0, [r1, 0x3] - b _08032DB4 - .pool -_08032D98: - ldr r2, =0x03005d60 - ldr r0, =sub_805745C - str r0, [r2, 0x4] - ldr r1, =0x02024076 - strb r3, [r1, 0x1] - ldr r3, =sub_8064394 - str r3, [r2] - strb r5, [r1] - str r0, [r2, 0xC] - movs r0, 0x2 - strb r0, [r1, 0x3] - str r3, [r2, 0x8] - movs r0, 0x3 - strb r0, [r1, 0x2] -_08032DB4: - ldr r0, =0x0202406c - strb r6, [r0] - b _0803303C - .pool -_08032DD0: - movs r0, 0x80 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - beq _08032E8C - movs r4, 0x4 - adds r3, r4, 0 - ands r3, r1 - cmp r3, 0 - beq _08032E1C - ldr r1, =0x03005d04 - ldr r0, =sub_8039ECC - str r0, [r1] - ldr r2, =0x03005d60 - ldr r0, =sub_805745C - str r0, [r2] - ldr r1, =0x02024076 - movs r0, 0 - strb r0, [r1] - ldr r3, =sub_805F164 - str r3, [r2, 0x4] - strb r5, [r1, 0x1] - ldr r0, =sub_814AEB0 - b _08032E2E - .pool -_08032E1C: - ldr r2, =0x03005d60 - ldr r0, =sub_814AEB0 - str r0, [r2] - ldr r1, =0x02024076 - strb r3, [r1] - ldr r3, =sub_8064394 - str r3, [r2, 0x4] - strb r5, [r1, 0x1] - ldr r0, =sub_805745C -_08032E2E: - str r0, [r2, 0x8] - movs r0, 0x2 - strb r0, [r1, 0x2] - str r3, [r2, 0xC] - movs r0, 0x3 - strb r0, [r1, 0x3] - ldr r0, =0x0202406c - strb r4, [r0] - movs r0, 0 - movs r1, 0 - bl sub_81B8D64 - movs r0, 0x1 - movs r1, 0 - bl sub_81B8D64 - movs r0, 0x2 - movs r1, 0x1 - bl sub_81B8D64 - movs r0, 0x3 - movs r1, 0x1 - bl sub_81B8D64 - ldr r0, =0x0202406e - movs r1, 0 - strh r1, [r0] - strh r1, [r0, 0x2] - movs r1, 0x3 - strh r1, [r0, 0x4] - strh r1, [r0, 0x6] - b _0803303C - .pool -_08032E8C: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r4] - movs r1, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08032EA4 - ldr r1, =0x03005d04 - ldr r0, =sub_8039ECC - str r0, [r1] -_08032EA4: - movs r0, 0 - mov r10, r0 - ldr r1, =0x020229e8 - mov r12, r1 - ldr r7, =0x02024076 - mov r8, r0 - ldr r6, =0x0202406e - movs r4, 0 - movs r2, 0x3 - mov r9, r2 -_08032EB8: - mov r1, r12 - adds r0, r4, r1 - ldrh r0, [r0, 0x18] - cmp r0, 0x2 - bgt _08032EE0 - cmp r0, 0x1 - bge _08032EF8 - cmp r0, 0 - beq _08032EE4 - b _08032F02 - .pool -_08032EE0: - cmp r0, 0x3 - bne _08032F02 -_08032EE4: - ldr r0, =0x020229e8 - adds r0, r4, r0 - ldrb r0, [r0, 0x18] - movs r1, 0 - bl sub_81B8D64 - b _08032F02 - .pool -_08032EF8: - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_81B8D64 -_08032F02: - cmp r10, r5 - bne _08032F52 - ldr r0, =0x020229e8 - adds r3, r4, r0 - ldrh r1, [r3, 0x18] - lsls r1, 2 - ldr r2, =0x03005d60 - adds r1, r2 - ldr r2, =sub_805745C - str r2, [r1] - ldrh r1, [r3, 0x18] - mov r12, r0 - cmp r1, 0x2 - bgt _08032F34 - cmp r1, 0x1 - bge _08032F48 - cmp r1, 0 - beq _08032F38 - b _08033028 - .pool -_08032F34: - cmp r1, 0x3 - bne _08033028 -_08032F38: - mov r1, r12 - adds r0, r4, r1 - ldrh r1, [r0, 0x18] - adds r1, r7 - mov r2, r8 - strb r2, [r1] - ldrh r0, [r0, 0x18] - b _0803300E -_08032F48: - adds r1, r7 - movs r0, 0x2 - strb r0, [r1] - ldrh r0, [r3, 0x18] - b _08033020 -_08032F52: - ldr r2, =0x020229e8 - adds r0, r4, r2 - ldrh r1, [r0, 0x18] - movs r3, 0x1 - adds r0, r3, 0 - ands r0, r1 - mov r12, r2 - cmp r0, 0 - bne _08032F7C - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - add r0, r12 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _08032F8E - b _08032FD4 - .pool -_08032F7C: - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - add r0, r12 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _08032FD4 -_08032F8E: - mov r0, r12 - adds r2, r4, r0 - ldrh r0, [r2, 0x18] - lsls r0, 2 - ldr r1, =0x03005d60 - adds r0, r1 - ldr r1, =sub_814AEB0 - str r1, [r0] - ldrh r1, [r2, 0x18] - cmp r1, 0x2 - bgt _08032FB8 - cmp r1, 0x1 - bge _08032FCC - cmp r1, 0 - beq _08032FBC - b _08033028 - .pool -_08032FB8: - cmp r1, 0x3 - bne _08033028 -_08032FBC: - mov r2, r12 - adds r0, r4, r2 - ldrh r1, [r0, 0x18] - adds r1, r7 - mov r2, r8 - strb r2, [r1] - ldrh r0, [r0, 0x18] - b _0803300E -_08032FCC: - adds r1, r7 - movs r0, 0x2 - strb r0, [r1] - b _0803301E -_08032FD4: - mov r0, r12 - adds r2, r4, r0 - ldrh r0, [r2, 0x18] - lsls r0, 2 - ldr r1, =0x03005d60 - adds r0, r1 - ldr r1, =sub_8064394 - str r1, [r0] - ldrh r0, [r2, 0x18] - cmp r0, 0x2 - bgt _08032FFC - cmp r0, 0x1 - bge _08033018 - cmp r0, 0 - beq _08033000 - b _08033028 - .pool -_08032FFC: - cmp r0, 0x3 - bne _08033028 -_08033000: - mov r0, r12 - adds r2, r4, r0 - ldrh r0, [r2, 0x18] - adds r0, r7 - movs r1, 0x1 - strb r1, [r0] - ldrh r0, [r2, 0x18] -_0803300E: - lsls r0, 1 - adds r0, r6 - mov r1, r8 - strh r1, [r0] - b _08033028 -_08033018: - adds r0, r7 - mov r1, r9 - strb r1, [r0] -_0803301E: - ldrh r0, [r2, 0x18] -_08033020: - lsls r0, 1 - adds r0, r6 - mov r2, r9 - strh r2, [r0] -_08033028: - adds r4, 0x1C - movs r0, 0x1 - add r10, r0 - mov r1, r10 - cmp r1, 0x3 - bgt _08033036 - b _08032EB8 -_08033036: - ldr r1, =0x0202406c - movs r0, 0x4 -_0803303A: - strb r0, [r1] -_0803303C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end b_setup_bx_link - - thumb_func_start sub_8033050 -sub_8033050: @ 8033050 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08033068 - b _0803319C -_08033068: - movs r0, 0 - mov r8, r0 - b _0803317A - .pool -_08033074: - movs r5, 0 - movs r0, 0x1 - add r0, r8 - mov r10, r0 - ldr r0, =0x02024076 - add r0, r8 - mov r9, r0 - mov r0, r8 - lsls r6, r0, 1 - movs r7, 0 -_08033088: - mov r0, r8 - cmp r0, 0x1 - bgt _080330F0 - mov r0, r9 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080330A8 - ldr r0, =0x020244ec - b _080330AA - .pool -_080330A8: - ldr r0, =0x02024744 -_080330AA: - adds r4, r7, r0 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08033170 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _08033170 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _08033170 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _08033170 - ldr r0, =0x0202406e - adds r0, r6, r0 - strh r5, [r0] - b _08033178 - .pool -_080330F0: - mov r0, r9 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08033118 - ldr r0, =0x020244ec - adds r4, r7, r0 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08033170 - adds r0, r4, 0 - movs r1, 0xB - b _0803312C - .pool -_08033118: - ldr r0, =0x02024744 - adds r4, r7, r0 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08033170 - adds r0, r4, 0 - movs r1, 0x41 -_0803312C: - bl pokemon_getattr - cmp r0, 0 - beq _08033170 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _08033170 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _08033170 - ldr r1, =0x0202406e - mov r0, r8 - subs r0, 0x2 - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r5 - beq _08033170 - adds r0, r6, r1 - strh r5, [r0] - b _08033178 - .pool -_08033170: - adds r7, 0x64 - adds r5, 0x1 - cmp r5, 0x5 - ble _08033088 -_08033178: - mov r8, r10 -_0803317A: - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r8, r0 - bge _08033184 - b _08033074 -_08033184: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0803319C - ldr r0, =0x0202406e - movs r1, 0 - strh r1, [r0, 0x2] - movs r1, 0x3 - strh r1, [r0, 0x6] -_0803319C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8033050 - - thumb_func_start dp01_prepare_buffer -dp01_prepare_buffer: @ 80331B8 - push {r4-r6,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r3, r0, 24 - adds r5, r3, 0 - lsls r2, 16 - lsrs r2, 16 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080331E4 - adds r0, r3, 0 - adds r1, r2, 0 - adds r2, r4, 0 - bl dp01_prepare_buffer_wireless_probably - b _08033236 - .pool -_080331E4: - cmp r5, 0 - beq _080331EE - cmp r5, 0x1 - beq _08033218 - b _08033236 -_080331EE: - movs r3, 0 - cmp r3, r2 - bge _08033236 - ldr r6, =0x02023064 - ldr r5, =0x02024064 -_080331F8: - ldrb r0, [r5] - lsls r0, 9 - adds r0, r3, r0 - adds r0, r6 - ldrb r1, [r4] - strb r1, [r0] - adds r4, 0x1 - adds r3, 0x1 - cmp r3, r2 - blt _080331F8 - b _08033236 - .pool -_08033218: - movs r3, 0 - cmp r3, r2 - bge _08033236 - ldr r6, =0x02023864 - ldr r5, =0x02024064 -_08033222: - ldrb r0, [r5] - lsls r0, 9 - adds r0, r3, r0 - adds r0, r6 - ldrb r1, [r4] - strb r1, [r0] - adds r4, 0x1 - adds r3, 0x1 - cmp r3, r2 - blt _08033222 -_08033236: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_prepare_buffer - - thumb_func_start sub_8033244 -sub_8033244: @ 8033244 - push {r4-r6,lr} - ldr r0, =task00_wireless_something - movs r1, 0 - bl CreateTask - ldr r2, =0x02022d08 - strb r0, [r2] - ldr r5, =0x03005e00 - ldrb r1, [r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r6, 0 - movs r4, 0 - strh r4, [r0, 0x1E] - ldrb r1, [r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r4, [r0, 0x20] - ldrb r1, [r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r4, [r0, 0x22] - ldrb r1, [r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r4, [r0, 0x24] - ldrb r1, [r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r4, [r0, 0x26] - ldr r0, =sub_803375C - movs r1, 0 - bl CreateTask - ldr r2, =0x02022d09 - strb r0, [r2] - ldrb r1, [r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r4, [r0, 0x20] - ldrb r1, [r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r4, [r0, 0x22] - ldrb r1, [r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r4, [r0, 0x24] - ldrb r1, [r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r4, [r0, 0x26] - ldr r0, =0x02022d0a - strb r6, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8033244 - - thumb_func_start dp01_prepare_buffer_wireless_probably -dp01_prepare_buffer_wireless_probably: @ 80332F4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r9, r2 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 16 - lsrs r1, 16 - mov r12, r1 - movs r1, 0x3 - mov r0, r12 - bics r0, r1 - adds r0, 0x4 - mov r8, r0 - ldr r2, =0x03005e00 - ldr r3, =0x02022d08 - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r4, r0, r2 - movs r1, 0x24 - ldrsh r0, [r4, r1] - add r0, r8 - adds r0, 0x9 - movs r1, 0x80 - lsls r1, 5 - adds r5, r2, 0 - cmp r0, r1 - ble _08033346 - ldrh r0, [r4, 0x24] - movs r2, 0 - strh r0, [r4, 0x20] - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r2, [r0, 0x24] -_08033346: - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r2, 0x24 - ldrsh r1, [r0, r2] - ldr r4, =0x020244a0 - ldr r0, [r4] - adds r0, r1 - strb r6, [r0] - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r7, 0x24 - ldrsh r1, [r0, r7] - ldr r0, [r4] - adds r1, r0 - ldr r0, =0x02024064 - ldrb r0, [r0] - strb r0, [r1, 0x1] - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r2, 0x24 - ldrsh r1, [r0, r2] - ldr r0, [r4] - adds r1, r0 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r1, 0x2] - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r7, 0x24 - ldrsh r1, [r0, r7] - ldr r0, [r4] - adds r1, r0 - ldr r0, =0x0202420c - ldrb r0, [r0] - strb r0, [r1, 0x3] - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r1, 0x24 - ldrsh r0, [r0, r1] - ldr r1, [r4] - adds r0, r1 - mov r2, r8 - strb r2, [r0, 0x4] - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r7, 0x24 - ldrsh r1, [r0, r7] - ldr r0, [r4] - adds r1, r0 - movs r0, 0xFF - lsls r0, 8 - mov r2, r8 - ands r0, r2 - asrs r0, 8 - strb r0, [r1, 0x5] - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r7, 0x24 - ldrsh r1, [r0, r7] - ldr r0, [r4] - adds r1, r0 - ldr r0, =0x02024210 - ldrb r0, [r0] - strb r0, [r1, 0x6] - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r2, 0x24 - ldrsh r1, [r0, r2] - ldr r0, [r4] - adds r1, r0 - ldr r0, =0x0202420e - ldrb r0, [r0] - strb r0, [r1, 0x7] - movs r2, 0 - cmp r2, r12 - bge _08033434 - mov r10, r5 - adds r6, r3, 0 -_08033412: - ldrb r1, [r6] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - add r0, r10 - movs r7, 0x24 - ldrsh r1, [r0, r7] - ldr r0, [r4] - adds r1, r2, r1 - adds r1, r0 - mov r7, r9 - adds r0, r7, r2 - ldrb r0, [r0] - strb r0, [r1, 0x8] - adds r2, 0x1 - cmp r2, r12 - blt _08033412 -_08033434: - ldrb r0, [r3] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r5 - ldrh r0, [r1, 0x24] - add r0, r8 - adds r0, 0x8 - strh r0, [r1, 0x24] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_prepare_buffer_wireless_probably - - thumb_func_start task00_wireless_something -task00_wireless_something: @ 8033474 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x1E - ldrsh r0, [r0, r2] - adds r7, r1, 0 - cmp r0, 0x5 - bls _08033490 - b _08033640 -_08033490: - lsls r0, 2 - ldr r1, =_080334A4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080334A4: - .4byte _080334BC - .4byte _080334CA - .4byte _080334E6 - .4byte _08033570 - .4byte _080335E6 - .4byte _08033624 -_080334BC: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r7 - movs r1, 0x64 - strh r1, [r0, 0x1C] - b _080334F6 -_080334CA: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r7 - ldrh r0, [r1, 0x1C] - subs r0, 0x1 - strh r0, [r1, 0x1C] - lsls r0, 16 - cmp r0, 0 - beq _080334E0 - b _08033640 -_080334E0: - ldrh r0, [r1, 0x1E] - adds r0, 0x1 - b _0803363E -_080334E6: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08033504 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r7 -_080334F6: - ldrh r1, [r0, 0x1E] - adds r1, 0x1 - strh r1, [r0, 0x1E] - b _08033640 - .pool -_08033504: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - beq _0803351C - movs r5, 0x2 - b _0803352A - .pool -_0803351C: - movs r0, 0x40 - ands r1, r0 - movs r0, 0x2 - cmp r1, 0 - beq _08033528 - movs r0, 0x4 -_08033528: - adds r5, r0, 0 -_0803352A: - bl sub_800ABAC - lsls r0, 24 - lsrs r0, 24 - cmp r0, r5 - bcs _08033538 - b _08033640 -_08033538: - bl sub_800ABBC - lsls r0, 24 - cmp r0, 0 - beq _0803355C - bl sub_800A620 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x1E] - adds r0, 0x1 - b _0803363E - .pool -_0803355C: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x1E] - adds r0, 0x1 - b _0803363E - .pool -_08033570: - lsls r1, r4, 2 - adds r0, r1, r4 - lsls r0, 3 - adds r2, r0, r7 - movs r3, 0x26 - ldrsh r5, [r2, r3] - movs r0, 0x24 - ldrsh r6, [r2, r0] - mov r12, r6 - cmp r5, r12 - beq _08033640 - ldrh r0, [r2, 0x22] - movs r6, 0x22 - ldrsh r3, [r2, r6] - cmp r3, 0 - bne _080335E0 - cmp r5, r12 - ble _080335A0 - movs r6, 0x20 - ldrsh r0, [r2, r6] - cmp r5, r0 - bne _080335A0 - strh r3, [r2, 0x20] - strh r3, [r2, 0x26] -_080335A0: - adds r4, r1, r4 - lsls r4, 3 - adds r4, r7 - movs r0, 0x26 - ldrsh r1, [r4, r0] - ldr r5, =0x020244a0 - ldr r0, [r5] - adds r1, r0 - ldrb r0, [r1, 0x4] - ldrb r1, [r1, 0x5] - lsls r1, 8 - orrs r0, r1 - adds r0, 0x8 - lsls r0, 16 - lsrs r6, r0, 16 - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x26 - ldrsh r2, [r4, r1] - ldr r1, [r5] - adds r1, r2 - adds r2, r6, 0 - bl link_0800A448 - ldrh r0, [r4, 0x1E] - adds r0, 0x1 - strh r0, [r4, 0x1E] - b _08033640 - .pool -_080335E0: - subs r0, 0x1 - strh r0, [r2, 0x22] - b _08033640 -_080335E6: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08033640 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r3, 0x26 - ldrsh r2, [r1, r3] - ldr r0, =0x020244a0 - ldr r0, [r0] - adds r2, r0 - ldrb r0, [r2, 0x4] - ldrb r2, [r2, 0x5] - lsls r2, 8 - movs r3, 0x1 - strh r3, [r1, 0x22] - orrs r0, r2 - ldrh r6, [r1, 0x26] - adds r0, r6 - adds r0, 0x8 - strh r0, [r1, 0x26] - b _0803363C - .pool -_08033624: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r7 - ldrh r0, [r1, 0x22] - subs r0, 0x1 - strh r0, [r1, 0x22] - lsls r0, 16 - cmp r0, 0 - bne _08033640 - movs r0, 0x1 - strh r0, [r1, 0x22] -_0803363C: - movs r0, 0x3 -_0803363E: - strh r0, [r1, 0x1E] -_08033640: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end task00_wireless_something - - thumb_func_start sub_8033648 -sub_8033648: @ 8033648 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _08033738 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08033738 - bl sub_8011BD0 - movs r4, 0 - ldr r0, =0x020223c4 - mov r10, r0 - b _0803372C - .pool -_08033680: - bl sub_800A550 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_0832A328 - lsls r1, r4, 2 - adds r1, r2 - ldr r1, [r1] - ands r0, r1 - adds r1, r4, 0x1 - mov r9, r1 - cmp r0, 0 - beq _08033726 - adds r0, r4, 0 - bl sub_800A5EC - lsls r0, r4, 8 - mov r4, r10 - adds r3, r0, r4 - ldr r1, =0x020223c8 - adds r0, r1 - ldrh r6, [r0] - ldr r7, =0x03005e00 - ldr r4, =0x02022d09 - mov r12, r4 - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r2, r0, r7 - movs r0, 0x24 - ldrsh r1, [r2, r0] - adds r0, r6, 0 - adds r0, 0x9 - adds r1, r0 - movs r0, 0x80 - lsls r0, 5 - cmp r1, r0 - ble _080336E0 - ldrh r0, [r2, 0x24] - strh r0, [r2, 0x20] - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r1, 0 - strh r1, [r0, 0x24] -_080336E0: - ldr r2, =0x020244a4 - mov r4, r12 - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r7 - movs r4, 0x24 - ldrsh r1, [r0, r4] - ldr r0, [r2] - adds r5, r0, r1 - adds r4, r3, 0 - movs r2, 0 - adds r3, r6, 0 - adds r3, 0x8 - mov r8, r7 - mov r7, r12 - cmp r2, r3 - bge _08033714 -_08033706: - adds r0, r5, r2 - adds r1, r4, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, r3 - blt _08033706 -_08033714: - ldrb r0, [r7] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - add r1, r8 - ldrh r0, [r1, 0x24] - adds r0, r6, r0 - adds r0, 0x8 - strh r0, [r1, 0x24] -_08033726: - mov r1, r9 - lsls r0, r1, 24 - lsrs r4, r0, 24 -_0803372C: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bcc _08033680 -_08033738: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8033648 - - thumb_func_start sub_803375C -sub_803375C: @ 803375C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r3, r0, r1 - movs r0, 0x26 - ldrsh r2, [r3, r0] - movs r4, 0x24 - ldrsh r0, [r3, r4] - cmp r2, r0 - bne _08033780 - b _0803389C -_08033780: - cmp r2, r0 - ble _08033792 - movs r4, 0x20 - ldrsh r0, [r3, r4] - cmp r2, r0 - bne _08033792 - movs r0, 0 - strh r0, [r3, 0x20] - strh r0, [r3, 0x26] -_08033792: - lsls r2, r7, 2 - adds r0, r2, r7 - lsls r0, 3 - adds r5, r0, r1 - movs r0, 0x26 - ldrsh r1, [r5, r0] - ldr r3, =0x020244a4 - mov r8, r3 - ldr r0, [r3] - adds r3, r1, r0 - ldrb r4, [r3, 0x1] - ldrb r6, [r3, 0x4] - ldrb r0, [r3, 0x5] - lsls r0, 8 - orrs r6, r0 - ldrb r0, [r3] - mov r9, r2 - cmp r0, 0x1 - beq _0803385C - cmp r0, 0x1 - bgt _080337CC - cmp r0, 0 - beq _080337D2 - b _0803388A - .pool -_080337CC: - cmp r0, 0x2 - beq _08033874 - b _0803388A -_080337D2: - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - lsls r0, r4, 2 - adds r0, r1 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0803389C - lsls r0, r4, 9 - ldr r1, =0x02023064 - adds r0, r1 - adds r1, r3, 0 - adds r1, 0x8 - adds r2, r6, 0 - bl memcpy - adds r0, r4, 0 - bl sub_803F850 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x4 - ands r0, r1 - cmp r0, 0 - bne _0803388A - ldr r2, =0x0202420b - movs r4, 0x26 - ldrsh r0, [r5, r4] - mov r3, r8 - ldr r1, [r3] - adds r0, r1 - ldrb r0, [r0, 0x2] - strb r0, [r2] - ldr r2, =0x0202420c - movs r4, 0x26 - ldrsh r0, [r5, r4] - adds r0, r1 - ldrb r0, [r0, 0x3] - strb r0, [r2] - ldr r2, =0x02024210 - movs r3, 0x26 - ldrsh r0, [r5, r3] - adds r0, r1 - ldrb r0, [r0, 0x6] - strb r0, [r2] - ldr r2, =0x0202420e - movs r4, 0x26 - ldrsh r0, [r5, r4] - adds r0, r1 - ldrb r0, [r0, 0x7] - strb r0, [r2] - b _0803388A - .pool -_0803385C: - lsls r0, r4, 9 - ldr r1, =0x02023864 - adds r0, r1 - adds r1, r3, 0 - adds r1, 0x8 - adds r2, r6, 0 - bl memcpy - b _0803388A - .pool -_08033874: - ldrb r2, [r3, 0x8] - ldr r3, =0x02024068 - ldr r1, =gUnknown_0832A328 - lsls r0, r4, 2 - adds r0, r1 - lsls r2, 2 - ldr r1, [r0] - lsls r1, r2 - ldr r0, [r3] - bics r0, r1 - str r0, [r3] -_0803388A: - ldr r0, =0x03005e00 - mov r2, r9 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x26] - adds r0, r6, r0 - adds r0, 0x8 - strh r0, [r1, 0x26] -_0803389C: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803375C - - thumb_func_start dp01_build_cmdbuf_x00_a_b_0 -dp01_build_cmdbuf_x00_a_b_0: @ 80338B4 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r3, 0 - strb r3, [r1] - strb r4, [r1, 0x1] - strb r2, [r1, 0x2] - strb r3, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x00_a_b_0 - - thumb_func_start dp01_build_cmdbuf_x01_a_b_0 -dp01_build_cmdbuf_x01_a_b_0: @ 80338D8 - push {r4,r5,lr} - adds r5, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r4, 0 - movs r3, 0x1 - strb r3, [r1] - strb r5, [r1, 0x1] - strb r2, [r1, 0x2] - strb r4, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x01_a_b_0 - - thumb_func_start dp01_build_cmdbuf_x02_a_b_varargs -dp01_build_cmdbuf_x02_a_b_varargs: @ 8033900 - push {r4-r6,lr} - ldr r4, [sp, 0x10] - lsls r0, 24 - lsrs r6, r0, 24 - lsls r3, 24 - lsrs r5, r3, 24 - ldr r0, =0x02022d10 - movs r3, 0x2 - strb r3, [r0] - strb r1, [r0, 0x1] - strb r2, [r0, 0x2] - adds r1, r0, 0 - cmp r5, 0 - beq _0803392E - adds r3, r1, 0x3 - adds r2, r5, 0 -_08033920: - ldrb r0, [r4] - strb r0, [r3] - adds r4, 0x1 - adds r3, 0x1 - subs r2, 0x1 - cmp r2, 0 - bne _08033920 -_0803392E: - adds r2, r5, 0x3 - adds r0, r6, 0 - bl dp01_prepare_buffer - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x02_a_b_varargs - - thumb_func_start sub_8033940 -sub_8033940: @ 8033940 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r2, 24 - lsrs r4, r2, 24 - ldr r0, =0x02022d10 - movs r2, 0x3 - strb r2, [r0] - strb r1, [r0, 0x1] - strb r4, [r0, 0x2] - adds r5, r0, 0 - cmp r4, 0 - beq _0803396C - adds r1, r5, 0x3 - adds r2, r4, 0 -_0803395E: - ldrb r0, [r3] - strb r0, [r1] - adds r3, 0x1 - adds r1, 0x1 - subs r2, 0x1 - cmp r2, 0 - bne _0803395E -_0803396C: - adds r2, r4, 0x3 - adds r0, r6, 0 - adds r1, r5, 0 - bl dp01_prepare_buffer - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8033940 - - thumb_func_start dp01_build_cmdbuf_x04_4_4_4 -dp01_build_cmdbuf_x04_4_4_4: @ 8033980 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x4 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x04_4_4_4 - - thumb_func_start dp01_build_cmdbuf_x05_a_b_c -dp01_build_cmdbuf_x05_a_b_c: @ 80339A0 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r3, 0x5 - strb r3, [r1] - strb r4, [r1, 0x1] - strb r2, [r1, 0x2] - strb r3, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x05_a_b_c - - thumb_func_start dp01_build_cmdbuf_x06_a -dp01_build_cmdbuf_x06_a: @ 80339C4 - push {lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x6 - strb r2, [r1] - strb r3, [r1, 0x1] - movs r2, 0x2 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x06_a - - thumb_func_start dp01_build_cmdbuf_x07_7_7_7 -dp01_build_cmdbuf_x07_7_7_7: @ 80339E4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x7 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x07_7_7_7 - - thumb_func_start dp01_build_cmdbuf_x08_8_8_8 -dp01_build_cmdbuf_x08_8_8_8: @ 8033A04 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x8 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x08_8_8_8 - - thumb_func_start dp01_build_cmdbuf_x09_9_9_9 -dp01_build_cmdbuf_x09_9_9_9: @ 8033A24 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x9 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x09_9_9_9 - - thumb_func_start dp01_build_cmdbuf_x0A_A_A_A -dp01_build_cmdbuf_x0A_A_A_A: @ 8033A44 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0xA - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x0A_A_A_A - - thumb_func_start dp01_build_cmdbuf_x0B_B_B_B -dp01_build_cmdbuf_x0B_B_B_B: @ 8033A64 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0xB - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x0B_B_B_B - - thumb_func_start dp01_build_cmdbuf_x0C_C_C_C -dp01_build_cmdbuf_x0C_C_C_C: @ 8033A84 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0xC - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x0C_C_C_C - - thumb_func_start dp01_build_cmdbuf_x0D_a -dp01_build_cmdbuf_x0D_a: @ 8033AA4 - push {lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0xD - strb r2, [r1] - strb r3, [r1, 0x1] - movs r2, 0x2 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x0D_a - - thumb_func_start sub_8033AC4 -sub_8033AC4: @ 8033AC4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - ldr r1, =0x02022d10 - movs r0, 0xE - strb r0, [r1] - strb r4, [r1, 0x1] - lsls r0, r4, 1 - adds r0, r4 - adds r5, r1, 0 - cmp r0, 0 - beq _08033AF2 - adds r1, r5, 0x2 - adds r3, r0, 0 -_08033AE4: - ldrb r0, [r2] - strb r0, [r1] - adds r2, 0x1 - adds r1, 0x1 - subs r3, 0x1 - cmp r3, 0 - bne _08033AE4 -_08033AF2: - lsls r2, r4, 1 - adds r2, r4 - adds r2, 0x2 - adds r0, r6, 0 - adds r1, r5, 0 - bl dp01_prepare_buffer - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8033AC4 - - thumb_func_start dp01_build_cmdbuf_x0F_aa_b_cc_dddd_e_mlc_weather_00_x1Cbytes -dp01_build_cmdbuf_x0F_aa_b_cc_dddd_e_mlc_weather_00_x1Cbytes: @ 8033B0C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - ldr r4, [sp, 0x20] - ldr r5, [sp, 0x24] - ldr r6, [sp, 0x2C] - mov r8, r6 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r1, 16 - lsrs r1, 16 - lsls r3, 16 - lsrs r3, 16 - ldr r7, =0x02022d10 - movs r0, 0 - mov r12, r0 - movs r0, 0xF - strb r0, [r7] - strb r1, [r7, 0x1] - lsrs r1, 8 - strb r1, [r7, 0x2] - strb r2, [r7, 0x3] - strb r3, [r7, 0x4] - movs r6, 0xFF - lsls r6, 8 - lsrs r3, 8 - strb r3, [r7, 0x5] - strb r4, [r7, 0x6] - adds r0, r4, 0 - ands r0, r6 - asrs r0, 8 - strb r0, [r7, 0x7] - movs r0, 0xFF - lsls r0, 16 - ands r0, r4 - asrs r0, 16 - strb r0, [r7, 0x8] - lsrs r4, 24 - strb r4, [r7, 0x9] - strb r5, [r7, 0xA] - mov r0, r8 - strb r0, [r7, 0xB] - mov r0, r12 - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08033BAC - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _08033BAC - ldr r0, =0x020243cc - ldrh r0, [r0] - strb r0, [r7, 0xC] - ands r6, r0 - lsrs r0, r6, 8 - strb r0, [r7, 0xD] - adds r4, r7, 0 - b _08033BB6 - .pool -_08033BAC: - ldr r0, =0x02022d10 - movs r1, 0 - strb r1, [r0, 0xC] - strb r1, [r0, 0xD] - adds r4, r0, 0 -_08033BB6: - movs r0, 0 - strb r0, [r4, 0xE] - strb r0, [r4, 0xF] - adds r0, r4, 0 - adds r0, 0x10 - ldr r1, [sp, 0x28] - movs r2, 0x1C - bl memcpy - mov r0, r9 - adds r1, r4, 0 - movs r2, 0x2C - bl dp01_prepare_buffer - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x0F_aa_b_cc_dddd_e_mlc_weather_00_x1Cbytes - - thumb_func_start dp01_build_cmdbuf_x10_TODO -dp01_build_cmdbuf_x10_TODO: @ 8033BE4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r1, 16 - lsrs r1, 16 - ldr r2, =0x02022d10 - movs r0, 0x10 - strb r0, [r2] - ldr r0, =0x0202433a - ldrb r0, [r0] - strb r0, [r2, 0x1] - strb r1, [r2, 0x2] - lsrs r1, 8 - strb r1, [r2, 0x3] - adds r0, r2, 0x4 - mov r12, r0 - ldr r4, =0x020241ea - ldrh r0, [r4] - strh r0, [r2, 0x4] - ldr r0, =0x020241ec - ldrh r0, [r0] - mov r1, r12 - strh r0, [r1, 0x2] - ldr r0, =0x02024208 - ldrh r0, [r0] - strh r0, [r1, 0x4] - ldr r0, =0x0202420a - ldrb r0, [r0] - strb r0, [r1, 0x6] - ldr r0, =0x02024474 - ldrb r0, [r0, 0x17] - strb r0, [r1, 0x7] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x52 - ldrb r1, [r1] - mov r3, r12 - strb r1, [r3, 0x8] - adds r0, 0xB1 - ldrb r0, [r0] - strb r0, [r3, 0x9] - ldr r0, =0x0202420f - ldrb r0, [r0] - strb r0, [r3, 0xA] - ldr r3, =gBattleMoves - ldrh r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x2] - mov r7, r12 - strb r0, [r7, 0xB] - movs r3, 0 - mov r9, r2 - ldr r0, =0x02022f78 - mov r8, r0 - adds r2, 0x10 - ldr r0, =0x02024084 - adds r4, r0, 0 - adds r4, 0x20 -_08033C6A: - adds r1, r2, r3 - ldrb r0, [r4] - strb r0, [r1] - adds r4, 0x58 - adds r3, 0x1 - cmp r3, 0x3 - ble _08033C6A - movs r3, 0 - mov r5, r12 - adds r5, 0x10 - mov r4, r12 - adds r4, 0x20 - ldr r6, =0x02022f68 - mov r2, r12 - adds r2, 0x30 -_08033C88: - adds r1, r5, r3 - ldr r7, =0x02022f58 - adds r0, r3, r7 - ldrb r0, [r0] - strb r0, [r1] - adds r1, r4, r3 - adds r0, r3, r6 - ldrb r0, [r0] - strb r0, [r1] - adds r1, r2, r3 - mov r7, r8 - adds r0, r3, r7 - ldrb r0, [r0] - strb r0, [r1] - adds r3, 0x1 - cmp r3, 0xF - ble _08033C88 - mov r0, r10 - mov r1, r9 - movs r2, 0x44 - bl dp01_prepare_buffer - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x10_TODO - - thumb_func_start dp01_build_cmdbuf_x11_TODO -dp01_build_cmdbuf_x11_TODO: @ 8033CFC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r1, 16 - lsrs r1, 16 - ldr r2, =0x02022d10 - movs r0, 0x11 - strb r0, [r2] - strb r0, [r2, 0x1] - strb r1, [r2, 0x2] - lsrs r1, 8 - strb r1, [r2, 0x3] - adds r0, r2, 0x4 - mov r12, r0 - ldr r0, =0x020241ea - ldrh r0, [r0] - strh r0, [r2, 0x4] - ldr r0, =0x020241ec - ldrh r0, [r0] - mov r1, r12 - strh r0, [r1, 0x2] - ldr r0, =0x02024208 - ldrh r0, [r0] - strh r0, [r1, 0x4] - ldr r0, =0x0202420a - ldrb r0, [r0] - strb r0, [r1, 0x6] - ldr r0, =0x02024474 - ldrb r0, [r0, 0x17] - strb r0, [r1, 0x7] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x52 - ldrb r0, [r0] - strb r0, [r1, 0x8] - movs r3, 0 - mov r9, r2 - ldr r7, =0x02022f78 - mov r8, r7 - mov r4, r9 - adds r4, 0x10 - ldr r0, =0x02024084 - adds r2, r0, 0 - adds r2, 0x20 -_08033D5E: - adds r1, r4, r3 - ldrb r0, [r2] - strb r0, [r1] - adds r2, 0x58 - adds r3, 0x1 - cmp r3, 0x3 - ble _08033D5E - movs r3, 0 - mov r5, r12 - adds r5, 0x10 - mov r4, r12 - adds r4, 0x20 - ldr r6, =0x02022f68 - mov r2, r12 - adds r2, 0x30 -_08033D7C: - adds r1, r5, r3 - ldr r7, =0x02022f58 - adds r0, r3, r7 - ldrb r0, [r0] - strb r0, [r1] - adds r1, r4, r3 - adds r0, r3, r6 - ldrb r0, [r0] - strb r0, [r1] - adds r1, r2, r3 - mov r7, r8 - adds r0, r3, r7 - ldrb r0, [r0] - strb r0, [r1] - adds r3, 0x1 - cmp r3, 0xF - ble _08033D7C - mov r0, r10 - mov r1, r9 - movs r2, 0x44 - bl dp01_prepare_buffer - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x11_TODO - - thumb_func_start dp01_build_cmdbuf_x12_a_bb -dp01_build_cmdbuf_x12_a_bb: @ 8033DE4 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r2, 16 - lsrs r2, 16 - ldr r1, =0x02022d10 - movs r3, 0x12 - strb r3, [r1] - strb r4, [r1, 0x1] - strb r2, [r1, 0x2] - lsrs r2, 8 - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x12_a_bb - - thumb_func_start sub_8033E10 -sub_8033E10: @ 8033E10 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x13 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end sub_8033E10 - - thumb_func_start sub_8033E30 -sub_8033E30: @ 8033E30 - push {r4-r6,lr} - adds r5, r3, 0 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r3, =0x02022d10 - movs r4, 0 - movs r0, 0x14 - strb r0, [r3] - strb r1, [r3, 0x1] - strb r2, [r3, 0x2] - strb r4, [r3, 0x3] - movs r2, 0 - adds r1, r3, 0 - adds r4, r1, 0x4 -_08033E4C: - adds r0, r5, r2 - ldrb r0, [r0] - strb r0, [r4] - adds r4, 0x1 - adds r2, 0x1 - cmp r2, 0x13 - bls _08033E4C - adds r0, r6, 0 - movs r2, 0x18 - bl dp01_prepare_buffer - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8033E30 - - thumb_func_start sub_8033E6C -sub_8033E6C: @ 8033E6C - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x02022d10 - movs r0, 0x15 - strb r0, [r1] - movs r2, 0 - adds r3, r1, 0x1 -_08033E7E: - adds r0, r4, r2 - ldrb r0, [r0] - strb r0, [r3] - adds r3, 0x1 - adds r2, 0x1 - cmp r2, 0x2 - ble _08033E7E - adds r0, r5, 0 - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8033E6C - - thumb_func_start dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f -dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f: @ 8033EA0 - push {r4-r6,lr} - ldr r6, [sp, 0x10] - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x02022d10 - movs r0, 0x16 - strb r0, [r4] - strb r1, [r4, 0x1] - strb r2, [r4, 0x2] - strb r3, [r4, 0x3] - movs r2, 0 - adds r1, r4, 0 - adds r3, r1, 0x4 -_08033EBA: - adds r0, r6, r2 - ldrb r0, [r0] - strb r0, [r3] - adds r3, 0x1 - adds r2, 0x1 - cmp r2, 0x2 - ble _08033EBA - adds r0, r5, 0 - movs r2, 0x8 - bl dp01_prepare_buffer - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f - - thumb_func_start dp01_build_cmdbuf_x17_17_17_17 -dp01_build_cmdbuf_x17_17_17_17: @ 8033EDC - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x17 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x17_17_17_17 - - thumb_func_start dp01_build_cmdbuf_x18_0_aa_health_bar_update -dp01_build_cmdbuf_x18_0_aa_health_bar_update: @ 8033EFC - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - ldr r3, =0x02022d10 - movs r4, 0 - movs r2, 0x18 - strb r2, [r3] - strb r4, [r3, 0x1] - strb r1, [r3, 0x2] - lsls r1, 16 - asrs r1, 16 - movs r2, 0xFF - lsls r2, 8 - ands r1, r2 - asrs r1, 8 - strb r1, [r3, 0x3] - adds r1, r3, 0 - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x18_0_aa_health_bar_update - - thumb_func_start dp01_build_cmdbuf_x19_a_bb -dp01_build_cmdbuf_x19_a_bb: @ 8033F34 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r2, 16 - lsrs r2, 16 - ldr r1, =0x02022d10 - movs r3, 0x19 - strb r3, [r1] - strb r4, [r1, 0x1] - strb r2, [r1, 0x2] - lsls r2, 16 - asrs r2, 16 - movs r3, 0xFF - lsls r3, 8 - ands r2, r3 - asrs r2, 8 - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x19_a_bb - - thumb_func_start dp01_build_cmdbuf_x1A_aaaa_bbbb -dp01_build_cmdbuf_x1A_aaaa_bbbb: @ 8033F68 - push {r4-r6,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r3, 0x1A - strb r3, [r1] - strb r4, [r1, 0x1] - movs r6, 0xFF - lsls r6, 8 - adds r3, r4, 0 - ands r3, r6 - lsrs r3, 8 - strb r3, [r1, 0x2] - movs r5, 0xFF - lsls r5, 16 - adds r3, r4, 0 - ands r3, r5 - lsrs r3, 16 - strb r3, [r1, 0x3] - lsrs r4, 24 - strb r4, [r1, 0x4] - strb r2, [r1, 0x5] - adds r3, r2, 0 - ands r3, r6 - lsrs r3, 8 - strb r3, [r1, 0x6] - adds r3, r2, 0 - ands r3, r5 - lsrs r3, 16 - strb r3, [r1, 0x7] - lsrs r2, 24 - strb r2, [r1, 0x8] - movs r2, 0x9 - bl dp01_prepare_buffer - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x1A_aaaa_bbbb - - thumb_func_start dp01_build_cmdbuf_x1B_aaaa_b -dp01_build_cmdbuf_x1B_aaaa_b: @ 8033FBC - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r3, 0x1B - strb r3, [r1] - strb r4, [r1, 0x1] - strb r2, [r1, 0x2] - movs r3, 0xFF - lsls r3, 8 - ands r3, r2 - lsrs r3, 8 - strb r3, [r1, 0x3] - movs r3, 0xFF - lsls r3, 16 - ands r3, r2 - lsrs r3, 16 - strb r3, [r1, 0x4] - lsrs r2, 24 - strb r2, [r1, 0x5] - movs r2, 0x6 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x1B_aaaa_b - - thumb_func_start dp01_build_cmdbuf_x1C_a -dp01_build_cmdbuf_x1C_a: @ 8033FF8 - push {lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x1C - strb r2, [r1] - strb r3, [r1, 0x1] - movs r2, 0x2 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x1C_a - - thumb_func_start dp01_build_cmdbuf_x1D_1D_numargs_varargs -dp01_build_cmdbuf_x1D_1D_numargs_varargs: @ 8034018 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 16 - lsrs r4, r1, 16 - ldr r1, =0x02022d10 - movs r0, 0x1D - strb r0, [r1] - strb r0, [r1, 0x1] - strb r4, [r1, 0x2] - lsrs r0, r4, 8 - strb r0, [r1, 0x3] - adds r5, r1, 0 - cmp r4, 0 - beq _08034048 - adds r1, r5, 0x4 - adds r3, r4, 0 -_0803403A: - ldrb r0, [r2] - strb r0, [r1] - adds r2, 0x1 - adds r1, 0x1 - subs r3, 0x1 - cmp r3, 0 - bne _0803403A -_08034048: - adds r2, r4, 0x4 - lsls r2, 16 - lsrs r2, 16 - adds r0, r6, 0 - adds r1, r5, 0 - bl dp01_prepare_buffer - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x1D_1D_numargs_varargs - - thumb_func_start sub_8034060 -sub_8034060: @ 8034060 - push {r4-r6,lr} - adds r4, r3, 0 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r2, 16 - lsrs r5, r2, 16 - ldr r2, =0x02022d10 - movs r0, 0x1E - strb r0, [r2] - strb r1, [r2, 0x1] - movs r3, 0xFF - lsls r3, 8 - adds r0, r1, 0 - ands r0, r3 - lsrs r0, 8 - strb r0, [r2, 0x2] - movs r0, 0xFF - lsls r0, 16 - ands r0, r1 - lsrs r0, 16 - strb r0, [r2, 0x3] - lsrs r1, 24 - strb r1, [r2, 0x4] - strb r5, [r2, 0x5] - adds r0, r5, 0 - ands r0, r3 - lsrs r0, 8 - strb r0, [r2, 0x6] - adds r1, r2, 0 - cmp r5, 0 - beq _080340B0 - adds r3, r1, 0x7 - adds r2, r5, 0 -_080340A2: - ldrb r0, [r4] - strb r0, [r3] - adds r4, 0x1 - adds r3, 0x1 - subs r2, 0x1 - cmp r2, 0 - bne _080340A2 -_080340B0: - adds r2, r5, 0x7 - lsls r2, 16 - lsrs r2, 16 - adds r0, r6, 0 - bl dp01_prepare_buffer - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8034060 - - thumb_func_start sub_80340C8 -sub_80340C8: @ 80340C8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 16 - lsrs r4, r1, 16 - ldr r1, =0x02022d10 - movs r0, 0x1F - strb r0, [r1] - strb r4, [r1, 0x1] - lsrs r0, r4, 8 - strb r0, [r1, 0x2] - adds r5, r1, 0 - cmp r4, 0 - beq _080340F6 - adds r1, r5, 0x3 - adds r3, r4, 0 -_080340E8: - ldrb r0, [r2] - strb r0, [r1] - adds r2, 0x1 - adds r1, 0x1 - subs r3, 0x1 - cmp r3, 0 - bne _080340E8 -_080340F6: - adds r2, r4, 0x3 - lsls r2, 16 - lsrs r2, 16 - adds r0, r6, 0 - adds r1, r5, 0 - bl dp01_prepare_buffer - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80340C8 - - thumb_func_start sub_8034110 -sub_8034110: @ 8034110 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 16 - lsrs r4, r1, 16 - ldr r1, =0x02022d10 - movs r0, 0x20 - strb r0, [r1] - strb r4, [r1, 0x1] - lsrs r0, r4, 8 - strb r0, [r1, 0x2] - adds r5, r1, 0 - cmp r4, 0 - beq _0803413E - adds r1, r5, 0x3 - adds r3, r4, 0 -_08034130: - ldrb r0, [r2] - strb r0, [r1] - adds r2, 0x1 - adds r1, 0x1 - subs r3, 0x1 - cmp r3, 0 - bne _08034130 -_0803413E: - adds r2, r4, 0x3 - lsls r2, 16 - lsrs r2, 16 - adds r0, r6, 0 - adds r1, r5, 0 - bl dp01_prepare_buffer - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8034110 - - thumb_func_start dp01_build_cmdbuf_x21_a_bb -dp01_build_cmdbuf_x21_a_bb: @ 8034158 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r2, 16 - lsrs r2, 16 - ldr r1, =0x02022d10 - movs r3, 0x21 - strb r3, [r1] - strb r4, [r1, 0x1] - strb r2, [r1, 0x2] - lsrs r2, 8 - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x21_a_bb - - thumb_func_start dp01_build_cmdbuf_x22_a_three_bytes -dp01_build_cmdbuf_x22_a_three_bytes: @ 8034184 - push {r4,r5,lr} - adds r4, r2, 0 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, =0x02022d10 - movs r0, 0x22 - strb r0, [r2] - strb r1, [r2, 0x1] - movs r3, 0 - adds r1, r2, 0x2 -_08034198: - adds r0, r4, r3 - ldrb r0, [r0] - strb r0, [r1] - adds r1, 0x1 - adds r3, 0x1 - cmp r3, 0x2 - ble _08034198 - adds r0, r5, 0 - adds r1, r2, 0 - movs r2, 0x5 - bl dp01_prepare_buffer - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x22_a_three_bytes - - thumb_func_start dp01_build_cmdbuf_x23_aa_0 -dp01_build_cmdbuf_x23_aa_0: @ 80341BC - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - ldr r3, =0x02022d10 - movs r4, 0 - movs r2, 0x23 - strb r2, [r3] - strb r1, [r3, 0x1] - lsrs r1, 8 - strb r1, [r3, 0x2] - strb r4, [r3, 0x3] - adds r1, r3, 0 - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x23_aa_0 - - thumb_func_start dp01_build_cmdbuf_x24_aa_0 -dp01_build_cmdbuf_x24_aa_0: @ 80341E8 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - ldr r3, =0x02022d10 - movs r4, 0 - movs r2, 0x24 - strb r2, [r3] - strb r1, [r3, 0x1] - lsrs r1, 8 - strb r1, [r3, 0x2] - strb r4, [r3, 0x3] - adds r1, r3, 0 - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x24_aa_0 - - thumb_func_start dp01_build_cmdbuf_x25_25_25_25 -dp01_build_cmdbuf_x25_25_25_25: @ 8034214 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x25 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x25_25_25_25 - - thumb_func_start dp01_build_cmdbuf_x26_a -dp01_build_cmdbuf_x26_a: @ 8034234 - push {lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x26 - strb r2, [r1] - strb r3, [r1, 0x1] - movs r2, 0x2 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x26_a - - thumb_func_start dp01_build_cmdbuf_x27_27_27_27 -dp01_build_cmdbuf_x27_27_27_27: @ 8034254 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x27 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x27_27_27_27 - - thumb_func_start dp01_build_cmdbuf_x28_28_28_28 -dp01_build_cmdbuf_x28_28_28_28: @ 8034274 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x28 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x28_28_28_28 - - thumb_func_start dp01_build_cmdbuf_x29_29_29_29 -dp01_build_cmdbuf_x29_29_29_29: @ 8034294 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x29 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x29_29_29_29 - - thumb_func_start dp01_build_cmdbuf_x2A_2A_2A_2A -dp01_build_cmdbuf_x2A_2A_2A_2A: @ 80342B4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x2A - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x2A_2A_2A_2A - - thumb_func_start dp01_build_cmdbuf_x2B_aa_0 -dp01_build_cmdbuf_x2B_aa_0: @ 80342D4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - ldr r3, =0x02022d10 - movs r4, 0 - movs r2, 0x2B - strb r2, [r3] - strb r1, [r3, 0x1] - lsrs r1, 8 - strb r1, [r3, 0x2] - strb r4, [r3, 0x3] - adds r1, r3, 0 - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x2B_aa_0 - - thumb_func_start sub_8034300 -sub_8034300: @ 8034300 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - ldr r4, =0x02022d10 - movs r3, 0x2C - strb r3, [r4] - strb r1, [r4, 0x1] - lsrs r1, 8 - strb r1, [r4, 0x2] - strb r2, [r4, 0x3] - adds r1, r4, 0 - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8034300 - - thumb_func_start dp01_build_cmdbuf_x2D_2D_2D_2D -dp01_build_cmdbuf_x2D_2D_2D_2D: @ 803432C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x2D - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x2D_2D_2D_2D - - thumb_func_start dp01_build_cmdbuf_x2E_a -dp01_build_cmdbuf_x2E_a: @ 803434C - push {lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x2E - strb r2, [r1] - strb r3, [r1, 0x1] - movs r2, 0x2 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x2E_a - - thumb_func_start dp01_build_cmdbuf_x2F_2F_2F_2F -dp01_build_cmdbuf_x2F_2F_2F_2F: @ 803436C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x2F - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x2F_2F_2F_2F - - thumb_func_start dp01_build_cmdbuf_x30_TODO -dp01_build_cmdbuf_x30_TODO: @ 803438C - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r2, 24 - lsrs r2, 24 - ldr r1, =0x02022d10 - movs r3, 0x30 - strb r3, [r1] - movs r0, 0x7F - ands r0, r2 - strb r0, [r1, 0x1] - movs r0, 0x80 - ands r0, r2 - lsls r0, 24 - lsrs r0, 31 - strb r0, [r1, 0x2] - strb r3, [r1, 0x3] - movs r2, 0 - adds r3, r1, 0x4 -_080343B4: - adds r0, r4, r2 - ldrb r0, [r0] - strb r0, [r3] - adds r3, 0x1 - adds r2, 0x1 - cmp r2, 0x2F - ble _080343B4 - adds r0, r5, 0 - movs r2, 0x34 - bl dp01_prepare_buffer - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x30_TODO - - thumb_func_start dp01_build_cmdbuf_x31_31_31_31 -dp01_build_cmdbuf_x31_31_31_31: @ 80343D4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x31 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x31_31_31_31 - - thumb_func_start dp01_build_cmdbuf_x32_32_32_32 -dp01_build_cmdbuf_x32_32_32_32: @ 80343F4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x32 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x32_32_32_32 - - thumb_func_start dp01_build_cmdbuf_x33_a_33_33 -dp01_build_cmdbuf_x33_a_33_33: @ 8034414 - push {lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x33 - strb r2, [r1] - strb r3, [r1, 0x1] - strb r2, [r1, 0x2] - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x33_a_33_33 - - thumb_func_start dp01_build_cmdbuf_x34_a_bb_aka_battle_anim -dp01_build_cmdbuf_x34_a_bb_aka_battle_anim: @ 8034438 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r2, 16 - lsrs r2, 16 - ldr r1, =0x02022d10 - movs r3, 0x34 - strb r3, [r1] - strb r4, [r1, 0x1] - strb r2, [r1, 0x2] - lsrs r2, 8 - strb r2, [r1, 0x3] - movs r2, 0x4 - bl dp01_prepare_buffer - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x34_a_bb_aka_battle_anim - - thumb_func_start sub_8034464 -sub_8034464: @ 8034464 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r2, 24 - lsrs r2, 24 - ldr r4, =0x02022d10 - movs r0, 0x35 - strb r0, [r4] - strb r1, [r4, 0x1] - cmp r2, 0 - beq _0803448C - adds r0, r4, 0x4 - bl sub_81850DC - strb r0, [r4, 0x2] - strb r0, [r4, 0x3] - b _08034490 - .pool -_0803448C: - strb r2, [r4, 0x2] - strb r2, [r4, 0x3] -_08034490: - ldr r1, =0x02022d10 - ldrb r2, [r1, 0x2] - adds r2, 0x4 - adds r0, r5, 0 - bl dp01_prepare_buffer - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8034464 - - thumb_func_start dp01_build_cmdbuf_x38_a -dp01_build_cmdbuf_x38_a: @ 80344A8 - push {lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02022d10 - movs r2, 0x36 - strb r2, [r1] - strb r3, [r1, 0x1] - movs r2, 0x2 - bl dp01_prepare_buffer - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x38_a - - thumb_func_start dp01_build_cmdbuf_x37_a -dp01_build_cmdbuf_x37_a: @ 80344C8 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r4, =0x02022d10 - movs r0, 0x37 - strb r0, [r4] - strb r1, [r4, 0x1] - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 28 - lsrs r0, 31 - strb r0, [r4, 0x2] - ldrb r0, [r1] - lsls r0, 28 - lsrs r0, 31 - strb r0, [r4, 0x3] - adds r0, r4, 0x6 - bl sub_81850DC - strb r0, [r4, 0x4] - strb r0, [r4, 0x5] - ldrb r2, [r4, 0x4] - adds r2, 0x6 - adds r0, r5, 0 - adds r1, r4, 0 - bl dp01_prepare_buffer - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_build_cmdbuf_x37_a - - thumb_func_start LZDecompressWram -@ void LZDecompressWram(void *src, void *dest) -LZDecompressWram: @ 8034518 - push {lr} - bl LZ77UnCompWram - pop {r0} - bx r0 - thumb_func_end LZDecompressWram - - thumb_func_start LZDecompressVram -@ void LZDecompressVram(void *src, void *dest) -LZDecompressVram: @ 8034524 - push {lr} - bl LZ77UnCompVram - pop {r0} - bx r0 - thumb_func_end LZDecompressVram - - thumb_func_start LoadCompressedObjectPic -@ u16 LoadCompressedObjectPic(struct obj_tiles *pic) -LoadCompressedObjectPic: @ 8034530 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r0, [r4] - ldr r5, =0x0201c000 - adds r1, r5, 0 - bl LZ77UnCompWram - str r5, [sp] - ldrh r1, [r4, 0x6] - lsls r1, 16 - ldrh r0, [r4, 0x4] - orrs r0, r1 - str r0, [sp, 0x4] - mov r0, sp - bl LoadObjectPic - lsls r0, 16 - lsrs r0, 16 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end LoadCompressedObjectPic - - thumb_func_start LoadCompressedObjectPicOverrideBuffer -@ void LoadCompressedObjectPicOverrideBuffer(struct obj_tiles *pic, void *tempBuffer) -LoadCompressedObjectPicOverrideBuffer: @ 8034564 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, [r4] - bl LZ77UnCompWram - str r5, [sp] - ldrh r1, [r4, 0x6] - lsls r1, 16 - ldrh r0, [r4, 0x4] - orrs r0, r1 - str r0, [sp, 0x4] - mov r0, sp - bl LoadObjectPic - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end LoadCompressedObjectPicOverrideBuffer - - thumb_func_start LoadCompressedObjectPalette -@ void LoadCompressedObjectPalette(struct TaggedObjectPalette *palette) -LoadCompressedObjectPalette: @ 803458C - push {r4,r5,lr} - sub sp, 0x8 - adds r5, r0, 0 - ldr r0, [r5] - ldr r4, =0x0201c000 - adds r1, r4, 0 - bl LZ77UnCompWram - str r4, [sp] - ldrh r2, [r5, 0x4] - ldr r1, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r1 - orrs r0, r2 - str r0, [sp, 0x4] - mov r0, sp - bl LoadTaggedObjectPalette - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end LoadCompressedObjectPalette - - thumb_func_start LoadCompressedObjectPaletteOverrideBuffer -@ void LoadCompressedObjectPaletteOverrideBuffer(struct TaggedObjectPalette *palette, void *tempBuffer) -LoadCompressedObjectPaletteOverrideBuffer: @ 80345C0 - push {r4,r5,lr} - sub sp, 0x8 - adds r5, r0, 0 - adds r4, r1, 0 - ldr r0, [r5] - bl LZ77UnCompWram - str r4, [sp] - ldrh r2, [r5, 0x4] - ldr r1, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r1 - orrs r0, r2 - str r0, [sp, 0x4] - mov r0, sp - bl LoadTaggedObjectPalette - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end LoadCompressedObjectPaletteOverrideBuffer - - thumb_func_start DecompressPicFromTable -@ void DecompressPicFromTable(void **picTable, void *dest, u32 index) -DecompressPicFromTable: @ 80345F0 - push {r4,r5,lr} - adds r3, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - movs r0, 0xCE - lsls r0, 1 - cmp r5, r0 - ble _08034610 - ldr r0, =gMonFrontPicTable - ldr r0, [r0] - bl LZ77UnCompWram - b _08034618 - .pool -_08034610: - ldr r0, [r3] - adds r1, r4, 0 - bl LZ77UnCompWram -_08034618: - adds r0, r4, 0 - adds r1, r5, 0 - bl DuplicateDeoxysTiles - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end DecompressPicFromTable - - thumb_func_start DecompressMonPic_DetectFrontOrBack -@ void DecompressMonPic_DetectFrontOrBack(void **picTable, void *dest, u32 speciesId, u32 personality) -DecompressMonPic_DetectFrontOrBack: @ 8034628 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - lsls r0, r2, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - movs r1, 0 - cmp r4, r0 - bne _0803463E - movs r1, 0x1 -_0803463E: - str r1, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - bl DecompressMonPic_2 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DecompressMonPic_DetectFrontOrBack - - thumb_func_start DecompressMonPic -@ void DecompressMonPic(void **picTable, void *dest, u32 speciesId, u32 personality, bool8 isFrontPic) -DecompressMonPic: @ 8034654 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - adds r4, r1, 0 - adds r7, r2, 0 - adds r5, r3, 0 - ldr r0, [sp, 0x18] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r7, 0xC9 - bne _080346D0 - movs r0, 0xC0 - lsls r0, 18 - ands r0, r5 - lsrs r0, 18 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r5 - lsrs r1, 12 - orrs r0, r1 - movs r1, 0xC0 - lsls r1, 2 - ands r1, r5 - lsrs r1, 6 - orrs r0, r1 - movs r1, 0x3 - ands r1, r5 - orrs r0, r1 - movs r1, 0x1C - bl __umodsi3 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - bne _080346A2 - movs r1, 0xC9 - b _080346AC -_080346A2: - movs r2, 0xCE - lsls r2, 1 - adds r0, r1, r2 - lsls r0, 16 - lsrs r1, r0, 16 -_080346AC: - mov r0, r8 - cmp r0, 0 - bne _080346C0 - ldr r0, =gMonBackPicTable - lsls r1, 3 - adds r1, r0 - ldr r0, [r1] - b _080346DC - .pool -_080346C0: - ldr r0, =gMonFrontPicTable - lsls r1, 3 - adds r1, r0 - ldr r0, [r1] - b _080346DC - .pool -_080346D0: - movs r0, 0xCE - lsls r0, 1 - cmp r7, r0 - ble _080346E8 - ldr r0, =gMonFrontPicTable - ldr r0, [r0] -_080346DC: - adds r1, r4, 0 - bl LZ77UnCompWram - b _080346F0 - .pool -_080346E8: - ldr r0, [r6] - adds r1, r4, 0 - bl LZ77UnCompWram -_080346F0: - adds r0, r4, 0 - adds r1, r7, 0 - bl DuplicateDeoxysTiles - lsls r0, r7, 16 - lsrs r0, 16 - adds r1, r5, 0 - adds r2, r4, 0 - mov r3, r8 - bl DrawSpindaSpots - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end DecompressMonPic - - thumb_func_start Unused_LZDecompressWramIndirect -@ void Unused_LZDecompressWramIndirect(void **src) -Unused_LZDecompressWramIndirect: @ 8034710 - push {lr} - ldr r0, [r0] - bl LZ77UnCompWram - pop {r0} - bx r0 - thumb_func_end Unused_LZDecompressWramIndirect - - thumb_func_start sub_803471C -sub_803471C: @ 803471C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - mov r9, r0 - str r1, [sp] - str r2, [sp, 0x4] - adds r5, r3, 0 - movs r0, 0x1 - mov r1, r9 - ands r0, r1 - cmp r0, 0 - bne _0803473C - b _080348D4 -_0803473C: - asrs r0, r1, 1 - adds r0, 0x4 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - movs r0, 0 - ldr r2, [sp] - cmp r0, r2 - blt _08034750 - b _08034964 -_08034750: - movs r4, 0x8 - subs r1, r4, r1 - str r1, [sp, 0x10] -_08034756: - movs r7, 0 - adds r0, 0x1 - str r0, [sp, 0x14] - ldr r0, [sp, 0x10] - cmp r7, r0 - bge _080347D2 - ldr r1, [sp, 0x8] - lsls r1, 8 - str r1, [sp, 0x18] - movs r2, 0 - mov r10, r2 - mov r0, r9 - movs r4, 0x8 - subs r0, r4, r0 - str r0, [sp, 0xC] -_08034774: - movs r3, 0 - asrs r0, r7, 1 - adds r1, r7, 0 - movs r2, 0x1 - ands r1, r2 - str r1, [sp, 0x20] - lsls r0, 8 - mov r8, r0 - mov r12, r5 -_08034786: - lsls r1, r3, 5 - ldr r4, [sp, 0x18] - adds r0, r5, r4 - adds r0, r1 - mov r1, r8 - adds r2, r0, r1 - mov r1, r12 - add r1, r8 - movs r6, 0xF -_08034798: - ldr r4, [sp, 0x20] - cmp r4, 0 - bne _080347A8 - strb r4, [r1] - add r4, sp, 0x20 - ldrb r4, [r4] - strb r4, [r2, 0x10] - b _080347B6 -_080347A8: - mov r0, r10 - strb r0, [r1, 0x10] - movs r4, 0x80 - lsls r4, 1 - adds r4, r2, r4 - str r4, [sp, 0x1C] - strb r0, [r4] -_080347B6: - adds r2, 0x1 - adds r1, 0x1 - subs r6, 0x1 - cmp r6, 0 - bge _08034798 - movs r0, 0x20 - add r12, r0 - adds r3, 0x1 - cmp r3, 0x7 - ble _08034786 - adds r7, 0x1 - ldr r1, [sp, 0xC] - cmp r7, r1 - blt _08034774 -_080347D2: - movs r7, 0 - movs r2, 0 -_080347D6: - movs r6, 0 - adds r4, r7, 0x1 - mov r8, r4 - lsls r4, r7, 5 -_080347DE: - adds r0, r6, 0x1 - mov r10, r0 - lsls r1, r6, 8 - adds r0, r1, 0 - adds r0, 0xC0 - adds r0, r5, r0 - adds r0, r4 - adds r1, r5, r1 - adds r1, r4 - movs r3, 0x1F -_080347F2: - strb r2, [r1] - strb r2, [r0] - adds r0, 0x1 - adds r1, 0x1 - subs r3, 0x1 - cmp r3, 0 - bge _080347F2 - mov r6, r10 - cmp r6, 0x7 - ble _080347DE - mov r7, r8 - cmp r7, 0x1 - ble _080347D6 - mov r1, r9 - cmp r1, 0x5 - bne _08034818 - movs r2, 0x90 - lsls r2, 1 - adds r5, r2 -_08034818: - movs r7, 0 - cmp r7, r9 - bge _080348AE -_0803481E: - movs r3, 0 - adds r7, 0x1 - mov r8, r7 - cmp r3, r9 - bge _0803488E -_08034828: - adds r3, 0x1 - mov r10, r3 - ldr r4, [sp, 0x4] - adds r4, 0x20 - adds r7, r5, 0 - adds r7, 0x20 - movs r0, 0x12 - adds r0, r5 - mov r12, r0 - ldr r2, [sp, 0x4] - adds r3, r5, 0 - movs r6, 0x3 -_08034840: - ldrb r0, [r2] - mov r1, r12 - strb r0, [r1] - ldrb r0, [r2, 0x1] - strb r0, [r1, 0x1] - ldrb r0, [r2, 0x2] - strb r0, [r1, 0x1E] - ldrb r0, [r2, 0x3] - strb r0, [r1, 0x1F] - movs r0, 0x81 - lsls r0, 1 - adds r1, r3, r0 - ldrb r0, [r2, 0x10] - strb r0, [r1] - ldr r0, =0x00000103 - adds r1, r3, r0 - ldrb r0, [r2, 0x11] - strb r0, [r1] - movs r0, 0x90 - lsls r0, 1 - adds r1, r3, r0 - ldrb r0, [r2, 0x12] - strb r0, [r1] - ldr r0, =0x00000121 - adds r1, r3, r0 - ldrb r0, [r2, 0x13] - strb r0, [r1] - movs r1, 0x4 - add r12, r1 - adds r2, 0x4 - adds r3, 0x4 - subs r6, 0x1 - cmp r6, 0 - bge _08034840 - str r4, [sp, 0x4] - adds r5, r7, 0 - mov r3, r10 - cmp r3, r9 - blt _08034828 -_0803488E: - mov r2, r9 - cmp r2, 0x7 - bne _080348A0 - adds r5, 0x20 - b _080348A8 - .pool -_080348A0: - mov r4, r9 - cmp r4, 0x5 - bne _080348A8 - adds r5, 0x60 -_080348A8: - mov r7, r8 - cmp r7, r9 - blt _0803481E -_080348AE: - mov r0, r9 - cmp r0, 0x7 - bne _080348BC - movs r1, 0x80 - lsls r1, 1 - adds r5, r1 - b _080348C8 -_080348BC: - mov r2, r9 - cmp r2, 0x5 - bne _080348C8 - movs r4, 0xF0 - lsls r4, 1 - adds r5, r4 -_080348C8: - ldr r0, [sp, 0x14] - ldr r1, [sp] - cmp r0, r1 - bge _080348D2 - b _08034756 -_080348D2: - b _08034964 -_080348D4: - movs r6, 0 - ldr r2, [sp] - cmp r6, r2 - bge _08034964 -_080348DC: - adds r6, 0x1 - mov r10, r6 - mov r4, r9 - cmp r4, 0x6 - bne _080348F4 - movs r0, 0 - movs r3, 0xFF -_080348EA: - strb r0, [r5] - adds r5, 0x1 - subs r3, 0x1 - cmp r3, 0 - bge _080348EA -_080348F4: - movs r7, 0 - cmp r7, r9 - bge _08034948 -_080348FA: - adds r7, 0x1 - mov r8, r7 - mov r1, r9 - lsls r0, r1, 5 - cmp r1, 0x6 - bne _08034914 - movs r1, 0 - movs r3, 0x1F -_0803490A: - strb r1, [r5] - adds r5, 0x1 - subs r3, 0x1 - cmp r3, 0 - bge _0803490A -_08034914: - adds r1, r0, 0 - cmp r1, 0 - ble _0803492E - adds r3, r1, 0 -_0803491C: - ldr r2, [sp, 0x4] - ldrb r0, [r2] - strb r0, [r5] - adds r2, 0x1 - str r2, [sp, 0x4] - adds r5, 0x1 - subs r3, 0x1 - cmp r3, 0 - bne _0803491C -_0803492E: - mov r4, r9 - cmp r4, 0x6 - bne _08034942 - movs r0, 0 - movs r3, 0x1F -_08034938: - strb r0, [r5] - adds r5, 0x1 - subs r3, 0x1 - cmp r3, 0 - bge _08034938 -_08034942: - mov r7, r8 - cmp r7, r9 - blt _080348FA -_08034948: - mov r0, r9 - cmp r0, 0x6 - bne _0803495C - movs r0, 0 - movs r3, 0xFF -_08034952: - strb r0, [r5] - adds r5, 0x1 - subs r3, 0x1 - cmp r3, 0 - bge _08034952 -_0803495C: - mov r6, r10 - ldr r1, [sp] - cmp r6, r1 - blt _080348DC -_08034964: - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_803471C - - thumb_func_start sub_8034974 -sub_8034974: @ 8034974 - adds r2, r0, 0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - ldrb r1, [r2, 0x2] - lsls r1, 8 - orrs r0, r1 - ldrb r1, [r2, 0x1] - orrs r0, r1 - bx lr - thumb_func_end sub_8034974 - - thumb_func_start LoadCompressedObjectPicUsingHeap -@ u32 LoadCompressedObjectPicUsingHeap(struct obj_tiles *pic) -LoadCompressedObjectPicUsingHeap: @ 8034988 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r0, [r4] - ldr r0, [r0] - lsrs r0, 8 - bl AllocZeroed - adds r5, r0, 0 - ldr r0, [r4] - adds r1, r5, 0 - bl LZ77UnCompWram - str r5, [sp] - ldrh r1, [r4, 0x6] - lsls r1, 16 - ldrh r0, [r4, 0x4] - orrs r0, r1 - str r0, [sp, 0x4] - mov r0, sp - bl LoadObjectPic - adds r0, r5, 0 - bl Free - movs r0, 0 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end LoadCompressedObjectPicUsingHeap - - thumb_func_start LoadCompressedObjectPaletteUsingHeap -@ u32 LoadCompressedObjectPaletteUsingHeap(struct TaggedObjectPalette *palette) -LoadCompressedObjectPaletteUsingHeap: @ 80349C4 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r0, [r4] - ldr r0, [r0] - lsrs r0, 8 - bl AllocZeroed - adds r5, r0, 0 - ldr r0, [r4] - adds r1, r5, 0 - bl LZ77UnCompWram - str r5, [sp] - ldrh r2, [r4, 0x4] - ldr r1, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r1 - orrs r0, r2 - str r0, [sp, 0x4] - mov r0, sp - bl LoadTaggedObjectPalette - adds r0, r5, 0 - bl Free - movs r0, 0 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end LoadCompressedObjectPaletteUsingHeap - - thumb_func_start DecompressPicFromTable_2 -@ void DecompressPicFromTable_2(void **picTable, void *dest, u32 index) -DecompressPicFromTable_2: @ 8034A08 - push {r4,r5,lr} - adds r3, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - movs r0, 0xCE - lsls r0, 1 - cmp r5, r0 - ble _08034A28 - ldr r0, =gMonFrontPicTable - ldr r0, [r0] - bl LZ77UnCompWram - b _08034A30 - .pool -_08034A28: - ldr r0, [r3] - adds r1, r4, 0 - bl LZ77UnCompWram -_08034A30: - adds r0, r4, 0 - adds r1, r5, 0 - bl DuplicateDeoxysTiles - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end DecompressPicFromTable_2 - - thumb_func_start DecompressMonPic_2 -@ void DecompressMonPic_2(void **picTable, void *dest, u32 speciesId, u32 personality, bool8 isFrontPic) -DecompressMonPic_2: @ 8034A40 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - adds r4, r1, 0 - adds r7, r2, 0 - adds r5, r3, 0 - ldr r0, [sp, 0x18] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r7, 0xC9 - bne _08034ABC - movs r0, 0xC0 - lsls r0, 18 - ands r0, r5 - lsrs r0, 18 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r5 - lsrs r1, 12 - orrs r0, r1 - movs r1, 0xC0 - lsls r1, 2 - ands r1, r5 - lsrs r1, 6 - orrs r0, r1 - movs r1, 0x3 - ands r1, r5 - orrs r0, r1 - movs r1, 0x1C - bl __umodsi3 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - bne _08034A8E - movs r1, 0xC9 - b _08034A98 -_08034A8E: - movs r2, 0xCE - lsls r2, 1 - adds r0, r1, r2 - lsls r0, 16 - lsrs r1, r0, 16 -_08034A98: - mov r0, r8 - cmp r0, 0 - bne _08034AAC - ldr r0, =gMonBackPicTable - lsls r1, 3 - adds r1, r0 - ldr r0, [r1] - b _08034AC8 - .pool -_08034AAC: - ldr r0, =gMonFrontPicTable - lsls r1, 3 - adds r1, r0 - ldr r0, [r1] - b _08034AC8 - .pool -_08034ABC: - movs r0, 0xCE - lsls r0, 1 - cmp r7, r0 - ble _08034AD4 - ldr r0, =gMonFrontPicTable - ldr r0, [r0] -_08034AC8: - adds r1, r4, 0 - bl LZ77UnCompWram - b _08034ADC - .pool -_08034AD4: - ldr r0, [r6] - adds r1, r4, 0 - bl LZ77UnCompWram -_08034ADC: - adds r0, r4, 0 - adds r1, r7, 0 - bl DuplicateDeoxysTiles - lsls r0, r7, 16 - lsrs r0, 16 - adds r1, r5, 0 - adds r2, r4, 0 - mov r3, r8 - bl DrawSpindaSpots - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end DecompressMonPic_2 - - thumb_func_start DecompressMonPic_DetectFrontOrBack_2 -@ void DecompressMonPic_DetectFrontOrBack_2(void **picTable, void *dest, u32 speciesId, u32 personality) -DecompressMonPic_DetectFrontOrBack_2: @ 8034AFC - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - lsls r0, r2, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - movs r1, 0 - cmp r4, r0 - bne _08034B12 - movs r1, 0x1 -_08034B12: - str r1, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - bl DecompressMonPic_2 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DecompressMonPic_DetectFrontOrBack_2 - - thumb_func_start sub_8034B28 -sub_8034B28: @ 8034B28 - push {lr} - adds r3, r0, 0 - movs r0, 0xCE - lsls r0, 1 - cmp r2, r0 - ble _08034B44 - ldr r0, =gMonFrontPicTable - ldr r0, [r0] - bl LZ77UnCompWram - b _08034B4A - .pool -_08034B44: - ldr r0, [r3] - bl LZ77UnCompWram -_08034B4A: - pop {r0} - bx r0 - thumb_func_end sub_8034B28 - - thumb_func_start DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack -@ void DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack(void **picTable, void *dest, u32 speciesId, u32 personality) -DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack: @ 8034B50 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - lsls r0, r2, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - movs r1, 0 - cmp r4, r0 - bne _08034B66 - movs r1, 0x1 -_08034B66: - str r1, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - bl DecompressMonPicWithoutDuplicatingDeoxysTiles - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack - - thumb_func_start DecompressMonPicWithoutDuplicatingDeoxysTiles -@ void DecompressMonPicWithoutDuplicatingDeoxysTiles(void **picTable, void *dest, u32 speciesId, u32 personality, bool8 isFrontPic) -DecompressMonPicWithoutDuplicatingDeoxysTiles: @ 8034B7C - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - adds r5, r1, 0 - adds r7, r2, 0 - adds r4, r3, 0 - ldr r0, [sp, 0x18] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r7, 0xC9 - bne _08034BF8 - movs r0, 0xC0 - lsls r0, 18 - ands r0, r4 - lsrs r0, 18 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r4 - lsrs r1, 12 - orrs r0, r1 - movs r1, 0xC0 - lsls r1, 2 - ands r1, r4 - lsrs r1, 6 - orrs r0, r1 - movs r1, 0x3 - ands r1, r4 - orrs r0, r1 - movs r1, 0x1C - bl __umodsi3 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - bne _08034BCA - movs r1, 0xC9 - b _08034BD4 -_08034BCA: - movs r2, 0xCE - lsls r2, 1 - adds r0, r1, r2 - lsls r0, 16 - lsrs r1, r0, 16 -_08034BD4: - mov r0, r8 - cmp r0, 0 - bne _08034BE8 - ldr r0, =gMonBackPicTable - lsls r1, 3 - adds r1, r0 - ldr r0, [r1] - b _08034C04 - .pool -_08034BE8: - ldr r0, =gMonFrontPicTable - lsls r1, 3 - adds r1, r0 - ldr r0, [r1] - b _08034C04 - .pool -_08034BF8: - movs r0, 0xCE - lsls r0, 1 - cmp r7, r0 - ble _08034C10 - ldr r0, =gMonFrontPicTable - ldr r0, [r0] -_08034C04: - adds r1, r5, 0 - bl LZ77UnCompWram - b _08034C18 - .pool -_08034C10: - ldr r0, [r6] - adds r1, r5, 0 - bl LZ77UnCompWram -_08034C18: - lsls r0, r7, 16 - lsrs r0, 16 - adds r1, r4, 0 - adds r2, r5, 0 - mov r3, r8 - bl DrawSpindaSpots - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end DecompressMonPicWithoutDuplicatingDeoxysTiles - - thumb_func_start DuplicateDeoxysTiles -@ void DuplicateDeoxysTiles(void *pointer, u32 speciesId) -DuplicateDeoxysTiles: @ 8034C30 - push {lr} - adds r3, r0, 0 - movs r0, 0xCD - lsls r0, 1 - cmp r1, r0 - bne _08034C4A - movs r1, 0x80 - lsls r1, 4 - adds r0, r3, r1 - ldr r2, =0x04000200 - adds r1, r3, 0 - bl CpuSet -_08034C4A: - pop {r0} - bx r0 - .pool - thumb_func_end DuplicateDeoxysTiles - - thumb_func_start sub_8034C54 -sub_8034C54: @ 8034C54 - push {r4-r7,lr} - adds r4, r0, 0 - ldr r5, =0x02022e10 - ldr r0, [r5] - cmp r0, 0 - beq _08034C64 - bl sub_8034CC8 -_08034C64: - movs r0, 0x8 - bl Alloc - str r0, [r5] - cmp r0, 0 - bne _08034C78 - movs r0, 0 - b _08034CC0 - .pool -_08034C78: - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - bl Alloc - ldr r1, [r5] - str r0, [r1, 0x4] - cmp r0, 0 - bne _08034C94 - adds r0, r1, 0 - bl Free - movs r0, 0 - b _08034CC0 -_08034C94: - str r4, [r1] - movs r3, 0 - cmp r3, r4 - bcs _08034CBE - movs r7, 0 - movs r6, 0xFF - movs r2, 0 -_08034CA2: - ldr r0, [r5] - ldr r0, [r0, 0x4] - adds r0, r2, r0 - strb r7, [r0] - ldr r0, [r5] - ldr r1, [r0, 0x4] - adds r1, r2, r1 - ldrb r0, [r1, 0x1] - orrs r0, r6 - strb r0, [r1, 0x1] - adds r2, 0x1C - adds r3, 0x1 - cmp r3, r4 - bcc _08034CA2 -_08034CBE: - movs r0, 0x1 -_08034CC0: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8034C54 - - thumb_func_start sub_8034CC8 -sub_8034CC8: @ 8034CC8 - push {r4,r5,lr} - ldr r2, =0x02022e10 - ldr r1, [r2] - cmp r1, 0 - beq _08034D08 - ldr r0, [r1, 0x4] - cmp r0, 0 - beq _08034CFC - movs r4, 0 - ldr r0, [r1] - cmp r4, r0 - bcs _08034CF2 - adds r5, r2, 0 -_08034CE2: - adds r0, r4, 0 - bl sub_80353DC - adds r4, 0x1 - ldr r0, [r5] - ldr r0, [r0] - cmp r4, r0 - bcc _08034CE2 -_08034CF2: - ldr r0, =0x02022e10 - ldr r0, [r0] - ldr r0, [r0, 0x4] - bl Free -_08034CFC: - ldr r4, =0x02022e10 - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] -_08034D08: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8034CC8 - - thumb_func_start sub_8034D14 -sub_8034D14: @ 8034D14 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - mov r8, r0 - mov r10, r1 - adds r5, r2, 0 - ldr r6, =0x02022e10 - ldr r0, [r6] - cmp r0, 0 - beq _08034DD4 - ldr r1, [r0, 0x4] - mov r0, r8 - lsls r2, r0, 3 - subs r0, r2, r0 - lsls r4, r0, 2 - adds r1, r4, r1 - ldrb r0, [r1] - mov r9, r2 - cmp r0, 0 - bne _08034DD4 - ldrb r0, [r5, 0x1] - bl sub_8035518 - ldr r1, [r6] - ldr r1, [r1, 0x4] - adds r1, r4, r1 - strb r0, [r1, 0x1] - ldr r0, [r6] - ldr r0, [r0, 0x4] - adds r0, r4, r0 - ldrb r0, [r0, 0x1] - cmp r0, 0xFF - beq _08034DD4 - ldr r0, [r5, 0x8] - ldrh r0, [r0, 0x6] - bl GetObjectTileRangeStartByTag - ldr r2, [r6] - ldr r1, [r2, 0x4] - adds r1, r4, r1 - strh r0, [r1, 0xA] - ldr r0, [r2, 0x4] - adds r0, r4, r0 - ldrh r1, [r0, 0xA] - ldr r7, =0xffff0000 - lsrs r0, r7, 16 - cmp r1, r0 - bne _08034DE0 - ldr r2, [r5, 0x8] - ldrh r0, [r2, 0x4] - adds r1, r2, 0 - cmp r0, 0 - beq _08034D94 - adds r0, r1, 0 - bl LoadObjectPic - b _08034DB4 - .pool -_08034D94: - ldr r0, [r2] - ldr r1, [r2, 0x4] - str r0, [sp] - str r1, [sp, 0x4] - ldr r0, [r2] - bl sub_8034974 - lsls r0, 16 - lsrs r0, 16 - ldr r1, [sp, 0x4] - ands r1, r7 - orrs r1, r0 - str r1, [sp, 0x4] - mov r0, sp - bl LoadCompressedObjectPic -_08034DB4: - ldr r1, [r6] - ldr r1, [r1, 0x4] - adds r1, r4, r1 - strh r0, [r1, 0xA] - ldr r0, =0x02022e10 - ldr r0, [r0] - ldr r1, [r0, 0x4] - mov r2, r9 - mov r3, r8 - subs r0, r2, r3 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0, 0xA] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08034DE0 -_08034DD4: - movs r0, 0 - b _08034EE8 - .pool -_08034DE0: - ldr r0, [r5, 0xC] - ldrh r0, [r0, 0x4] - bl IndexOfObjectPaletteTag - ldr r6, =0x02022e10 - ldr r1, [r6] - ldr r1, [r1, 0x4] - mov r4, r9 - mov r3, r8 - subs r2, r4, r3 - lsls r4, r2, 2 - adds r1, r4, r1 - strb r0, [r1, 0x4] - ldr r0, [r6] - ldr r0, [r0, 0x4] - adds r0, r4, r0 - ldrb r0, [r0, 0x4] - cmp r0, 0xFF - bne _08034E14 - ldr r0, [r5, 0xC] - bl LoadTaggedObjectPalette - ldr r1, [r6] - ldr r1, [r1, 0x4] - adds r1, r4, r1 - strb r0, [r1, 0x4] -_08034E14: - ldr r0, [r6] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r0, [r5] - lsls r0, 30 - lsrs r0, 30 - strb r0, [r1, 0x2] - ldr r0, [r6] - ldr r0, [r0, 0x4] - adds r0, r4, r0 - ldrb r1, [r5, 0x1] - strb r1, [r0, 0x3] - ldr r2, [r6] - ldr r0, [r2, 0x4] - adds r0, r4, r0 - ldrh r1, [r5, 0x4] - strh r1, [r0, 0xC] - ldr r0, [r2, 0x4] - adds r0, r4, r0 - ldrh r1, [r5, 0x6] - strh r1, [r0, 0xE] - ldr r1, [r2, 0x4] - adds r1, r4, r1 - ldrb r0, [r5] - lsls r0, 28 - lsrs r0, 30 - strb r0, [r1, 0x6] - ldr r0, [r6] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r0, [r5] - lsls r0, 26 - lsrs r0, 30 - strb r0, [r1, 0x5] - ldr r0, [r6] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r0, [r5] - lsrs r0, 6 - strb r0, [r1, 0x7] - ldr r0, [r6] - ldr r0, [r0, 0x4] - adds r0, r4, r0 - ldrb r1, [r5, 0x2] - strb r1, [r0, 0x8] - ldrb r1, [r5] - lsls r0, r1, 28 - lsrs r0, 30 - lsls r1, 26 - lsrs r1, 30 - bl sub_80355F8 - ldr r1, [r6] - ldr r1, [r1, 0x4] - adds r1, r4, r1 - strb r0, [r1, 0x9] - ldr r2, [r6] - ldr r0, [r2, 0x4] - adds r0, r4, r0 - ldr r1, [r5, 0x8] - ldrh r1, [r1, 0x6] - strh r1, [r0, 0x10] - ldr r0, [r2, 0x4] - adds r0, r4, r0 - ldr r1, [r5, 0xC] - ldrh r1, [r1, 0x4] - strh r1, [r0, 0x12] - ldr r0, [r2, 0x4] - adds r0, r4, r0 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r6] - ldr r0, [r0, 0x4] - adds r0, r4, r0 - str r1, [r0, 0x14] - movs r3, 0x1 - ldrb r0, [r5, 0x1] - cmp r3, r0 - bcs _08034ECA -_08034EB2: - ldr r0, [r6] - ldr r2, [r0, 0x4] - adds r2, r4, r2 - ldr r1, [r2, 0x14] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - str r0, [r2, 0x14] - adds r3, 0x1 - ldrb r2, [r5, 0x1] - cmp r3, r2 - bcc _08034EB2 -_08034ECA: - ldr r0, =0x02022e10 - ldr r0, [r0] - mov r3, r9 - mov r4, r8 - subs r1, r3, r4 - lsls r1, 2 - ldr r0, [r0, 0x4] - adds r0, r1 - bl sub_8034EFC - mov r0, r8 - mov r1, r10 - bl sub_8035044 - movs r0, 0x1 -_08034EE8: - 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_8034D14 - - thumb_func_start sub_8034EFC -sub_8034EFC: @ 8034EFC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r4, r0, 0 - ldrb r5, [r4, 0x1] - movs r0, 0xC - ldrsh r7, [r4, r0] - ldrb r0, [r4, 0x3] - adds r0, 0x1 - mov r8, r0 - mov r1, sp - movs r0, 0 - strh r0, [r1] - lsls r1, r5, 3 - ldr r2, =0x030022f8 - mov r9, r2 - add r1, r9 - mov r0, r8 - lsls r2, r0, 2 - movs r0, 0x80 - lsls r0, 17 - orrs r2, r0 - mov r0, sp - bl CpuSet - movs r6, 0 - ldrb r5, [r4, 0x1] - cmp r6, r8 - bcs _08034FCE - movs r1, 0x3F - mov r10, r1 - movs r2, 0xD - negs r2, r2 - mov r9, r2 -_08034F46: - lsls r0, r5, 3 - ldr r1, =0x030022c0 - adds r3, r0, r1 - ldrh r1, [r4, 0xE] - adds r0, r3, 0 - adds r0, 0x38 - strb r1, [r0] - ldr r2, =0x000001ff - adds r0, r2, 0 - adds r1, r7, 0 - ands r1, r0 - ldrh r2, [r3, 0x3A] - ldr r0, =0xfffffe00 - ands r0, r2 - orrs r0, r1 - strh r0, [r3, 0x3A] - ldrb r1, [r4, 0x6] - movs r0, 0x39 - adds r0, r3 - mov r12, r0 - lsls r1, 6 - ldrb r2, [r0] - mov r0, r10 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - ldrb r1, [r4, 0x5] - movs r2, 0x3B - adds r2, r3 - mov r12, r2 - lsls r1, 6 - ldrb r2, [r2] - mov r0, r10 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - ldrh r0, [r4, 0xA] - ldr r1, =0x000003ff - ands r1, r0 - ldrh r2, [r3, 0x3C] - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r3, 0x3C] - adds r3, 0x3D - movs r0, 0x3 - ldrb r1, [r4, 0x7] - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - mov r0, r9 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - ldrb r2, [r4, 0x4] - lsls r2, 4 - movs r1, 0xF - ands r0, r1 - orrs r0, r2 - strb r0, [r3] - ldrb r0, [r4, 0x8] - adds r7, r0 - adds r6, 0x1 - adds r5, 0x1 - cmp r6, r8 - bcc _08034F46 -_08034FCE: - subs r5, 0x1 - ldr r0, =0x030022c0 - lsls r3, r5, 3 - adds r3, r0 - movs r2, 0xC - ldrsh r1, [r4, r2] - ldrb r0, [r4, 0x8] - subs r1, r0 - ldr r2, =0x000001ff - adds r0, r2, 0 - ands r1, r0 - ldrh r2, [r3, 0x3A] - ldr r0, =0xfffffe00 - ands r0, r2 - orrs r0, r1 - strh r0, [r3, 0x3A] - adds r2, r3, 0 - adds r2, 0x39 - ldrb r1, [r2] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] - ldrb r0, [r4, 0x9] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 1 - ldrh r4, [r4, 0xA] - adds r1, r4 - ldr r2, =0x000003ff - adds r0, r2, 0 - ands r1, r0 - ldrh r2, [r3, 0x3C] - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r3, 0x3C] - 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_8034EFC - - thumb_func_start sub_8035044 -sub_8035044: @ 8035044 - push {r4-r6,lr} - adds r3, r0, 0 - adds r4, r1, 0 - ldr r0, =0x02022e10 - ldr r1, [r0] - adds r6, r0, 0 - cmp r1, 0 - beq _080350A8 - ldr r2, [r1, 0x4] - lsls r1, r3, 3 - subs r0, r1, r3 - lsls r0, 2 - adds r2, r0, r2 - ldrb r0, [r2] - adds r5, r1, 0 - cmp r0, 0 - beq _080350A8 - str r4, [r2, 0x18] - cmp r4, 0 - bge _08035078 - movs r2, 0x1 - negs r4, r4 - b _0803507A - .pool -_08035078: - movs r2, 0 -_0803507A: - ldr r0, [r6] - ldr r1, [r0, 0x4] - subs r0, r5, r3 - lsls r0, 2 - adds r0, r1 - ldrb r3, [r0, 0x2] - cmp r3, 0x1 - beq _0803509A - cmp r3, 0x1 - ble _08035092 - cmp r3, 0x2 - beq _080350A2 -_08035092: - adds r1, r4, 0 - bl sub_80350B0 - b _080350A8 -_0803509A: - adds r1, r4, 0 - bl sub_8035164 - b _080350A8 -_080350A2: - adds r1, r4, 0 - bl sub_80352C0 -_080350A8: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8035044 - - thumb_func_start sub_80350B0 -sub_80350B0: @ 80350B0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r0 - mov r9, r1 - str r2, [sp] - ldr r5, [r0, 0x14] - ldrb r7, [r0, 0x1] - ldr r0, =0x030022c0 - mov r10, r0 - cmp r5, 0 - beq _0803511A - lsls r0, r7, 3 - adds r0, 0x3C - mov r1, r10 - adds r6, r0, r1 -_080350D6: - mov r0, r9 - adds r1, r5, 0 - bl __udivsi3 - adds r4, r0, 0 - adds r0, r4, 0 - muls r0, r5 - mov r2, r9 - subs r2, r0 - mov r9, r2 - adds r0, r5, 0 - movs r1, 0xA - bl __udivsi3 - adds r5, r0, 0 - mov r1, r8 - ldrb r0, [r1, 0x9] - adds r1, r4, 0 - muls r1, r0 - mov r2, r8 - ldrh r2, [r2, 0xA] - adds r1, r2 - ldr r2, =0x000003ff - adds r0, r2, 0 - ands r1, r0 - ldrh r0, [r6] - ldr r2, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r6] - adds r6, 0x8 - adds r7, 0x1 - cmp r5, 0 - bne _080350D6 -_0803511A: - ldr r0, [sp] - cmp r0, 0 - beq _08035140 - lsls r0, r7, 3 - add r0, r10 - adds r0, 0x39 - ldrb r2, [r0] - movs r1, 0x4 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - b _08035154 - .pool -_08035140: - lsls r2, r7, 3 - add r2, r10 - adds r2, 0x39 - ldrb r1, [r2] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] -_08035154: - 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_80350B0 - - thumb_func_start sub_8035164 -sub_8035164: @ 8035164 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r6, r0, 0 - mov r8, r1 - str r2, [sp] - ldr r5, [r6, 0x14] - ldr r3, =0x03000dd4 - ldrb r0, [r6, 0x1] - str r0, [r3] - ldr r2, =0x03000dd8 - movs r0, 0 - str r0, [r2] - ldr r1, =0x03000ddc - subs r0, 0x1 - str r0, [r1] - adds r7, r3, 0 - mov r10, r1 - ldr r0, =0x030022c0 - mov r9, r0 - cmp r5, 0 - beq _0803524C -_08035196: - mov r0, r8 - adds r1, r5, 0 - bl __udivsi3 - adds r4, r0, 0 - adds r0, r4, 0 - muls r0, r5 - mov r1, r8 - subs r1, r0 - mov r8, r1 - adds r0, r5, 0 - movs r1, 0xA - bl __udivsi3 - adds r5, r0, 0 - cmp r4, 0 - bne _080351C8 - mov r2, r10 - ldr r1, [r2] - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _080351C8 - cmp r5, 0 - bne _08035224 -_080351C8: - ldr r2, [r7] - lsls r2, 3 - add r2, r9 - ldrb r0, [r6, 0x9] - adds r3, r4, 0 - muls r3, r0 - ldrh r4, [r6, 0xA] - adds r3, r4 - ldr r1, =0x000003ff - adds r0, r1, 0 - ands r3, r0 - ldrh r0, [r2, 0x3C] - ldr r4, =0xfffffc00 - adds r1, r4, 0 - ands r0, r1 - orrs r0, r3 - strh r0, [r2, 0x3C] - adds r2, 0x39 - ldrb r0, [r2] - movs r1, 0x4 - negs r1, r1 - ands r0, r1 - strb r0, [r2] - mov r2, r10 - ldr r1, [r2] - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _0803523A - ldr r4, =0x03000dd8 - ldr r0, [r4] - str r0, [r2] - b _0803523A - .pool -_08035224: - ldr r0, [r7] - lsls r0, 3 - add r0, r9 - adds r0, 0x39 - ldrb r1, [r0] - movs r2, 0x4 - negs r2, r2 - ands r1, r2 - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0] -_0803523A: - ldr r0, [r7] - adds r0, 0x1 - str r0, [r7] - ldr r4, =0x03000dd8 - ldr r0, [r4] - adds r0, 0x1 - str r0, [r4] - cmp r5, 0 - bne _08035196 -_0803524C: - ldr r0, [sp] - cmp r0, 0 - beq _08035298 - ldr r1, [r7] - lsls r1, 3 - add r1, r9 - adds r1, 0x39 - ldrb r2, [r1] - movs r0, 0x4 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r3, [r7] - lsls r3, 3 - add r3, r9 - movs r1, 0xC - ldrsh r2, [r6, r1] - mov r4, r10 - ldr r0, [r4] - subs r0, 0x1 - ldrb r1, [r6, 0x8] - muls r0, r1 - adds r2, r0 - ldr r1, =0x000001ff - adds r0, r1, 0 - ands r2, r0 - ldrh r1, [r3, 0x3A] - ldr r0, =0xfffffe00 - ands r0, r1 - orrs r0, r2 - strh r0, [r3, 0x3A] - b _080352AE - .pool -_08035298: - ldr r0, [r7] - lsls r0, 3 - add r0, r9 - adds r0, 0x39 - ldrb r2, [r0] - movs r1, 0x4 - negs r1, r1 - ands r1, r2 - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0] -_080352AE: - 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_8035164 - - thumb_func_start sub_80352C0 -sub_80352C0: @ 80352C0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - mov r8, r0 - mov r10, r1 - str r2, [sp] - ldr r5, [r0, 0x14] - ldrb r3, [r0, 0x1] - movs r0, 0 - str r0, [sp, 0x4] - mov r9, r0 - cmp r5, 0 - beq _0803535A -_080352E0: - lsls r0, r3, 3 - adds r1, r0, 0 - adds r1, 0x39 - ldr r2, =0x030022c0 - adds r7, r1, r2 - adds r0, 0x3C - adds r6, r0, r2 -_080352EE: - mov r0, r10 - adds r1, r5, 0 - str r3, [sp, 0x8] - bl __udivsi3 - adds r4, r0, 0 - adds r0, r4, 0 - muls r0, r5 - mov r1, r10 - subs r1, r0 - mov r10, r1 - adds r0, r5, 0 - movs r1, 0xA - bl __udivsi3 - adds r5, r0, 0 - ldr r3, [sp, 0x8] - cmp r4, 0 - bne _0803531E - ldr r2, [sp, 0x4] - cmp r2, 0 - bne _0803531E - cmp r5, 0 - bne _080352E0 -_0803531E: - movs r0, 0x1 - str r0, [sp, 0x4] - mov r1, r8 - ldrb r0, [r1, 0x9] - adds r2, r4, 0 - muls r2, r0 - ldrh r4, [r1, 0xA] - adds r2, r4 - ldr r1, =0x000003ff - adds r0, r1, 0 - ands r2, r0 - ldrh r0, [r6] - ldr r4, =0xfffffc00 - adds r1, r4, 0 - ands r0, r1 - orrs r0, r2 - strh r0, [r6] - ldrb r0, [r7] - movs r2, 0x4 - negs r2, r2 - adds r1, r2, 0 - ands r0, r1 - strb r0, [r7] - adds r7, 0x8 - adds r6, 0x8 - adds r3, 0x1 - movs r4, 0x1 - add r9, r4 - cmp r5, 0 - bne _080352EE -_0803535A: - mov r0, r8 - ldrb r0, [r0, 0x3] - cmp r9, r0 - bge _0803538A - ldr r1, =0x030022c0 - movs r5, 0x4 - negs r5, r5 - movs r4, 0x2 - lsls r0, r3, 3 - adds r0, 0x39 - adds r2, r0, r1 -_08035370: - ldrb r1, [r2] - adds r0, r5, 0 - ands r0, r1 - orrs r0, r4 - strb r0, [r2] - adds r2, 0x8 - adds r3, 0x1 - movs r1, 0x1 - add r9, r1 - mov r0, r8 - ldrb r0, [r0, 0x3] - cmp r9, r0 - blt _08035370 -_0803538A: - ldr r1, [sp] - cmp r1, 0 - beq _080353B0 - lsls r0, r3, 3 - ldr r2, =0x030022c0 - adds r0, r2 - adds r0, 0x39 - ldrb r2, [r0] - movs r1, 0x4 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - b _080353C6 - .pool -_080353B0: - lsls r2, r3, 3 - ldr r4, =0x030022c0 - adds r2, r4 - adds r2, 0x39 - ldrb r1, [r2] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] -_080353C6: - 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_80352C0 - - thumb_func_start sub_80353DC -sub_80353DC: @ 80353DC - push {r4-r7,lr} - adds r4, r0, 0 - ldr r0, =0x02022e10 - ldr r0, [r0] - cmp r0, 0 - beq _0803546E - ldr r2, [r0, 0x4] - lsls r1, r4, 3 - subs r0, r1, r4 - lsls r0, 2 - adds r2, r0, r2 - ldrb r0, [r2] - adds r5, r1, 0 - cmp r0, 0 - beq _0803546E - ldrb r3, [r2, 0x3] - adds r0, r3, 0x1 - ldrb r2, [r2, 0x1] - cmp r0, 0 - beq _08035426 - ldr r1, =0x030022c0 - movs r7, 0x4 - negs r7, r7 - movs r6, 0x2 - adds r3, r0, 0 - lsls r0, r2, 3 - adds r0, 0x39 - adds r2, r0, r1 -_08035414: - ldrb r1, [r2] - adds r0, r7, 0 - ands r0, r1 - orrs r0, r6 - strb r0, [r2] - subs r3, 0x1 - adds r2, 0x8 - cmp r3, 0 - bne _08035414 -_08035426: - adds r0, r4, 0 - bl sub_8035570 - cmp r0, 0 - bne _08035442 - ldr r0, =0x02022e10 - ldr r0, [r0] - ldr r1, [r0, 0x4] - subs r0, r5, r4 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x10] - bl FreeObjectTilesByTag -_08035442: - adds r0, r4, 0 - bl sub_80355B4 - cmp r0, 0 - bne _0803545E - ldr r0, =0x02022e10 - ldr r0, [r0] - ldr r1, [r0, 0x4] - subs r0, r5, r4 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x12] - bl FreeObjectPaletteByTag -_0803545E: - ldr r0, =0x02022e10 - ldr r0, [r0] - ldr r1, [r0, 0x4] - subs r0, r5, r4 - lsls r0, 2 - adds r0, r1 - movs r1, 0 - strb r1, [r0] -_0803546E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80353DC - - thumb_func_start sub_803547C -sub_803547C: @ 803547C - push {r4-r7,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, =0x02022e10 - ldr r1, [r0] - adds r7, r0, 0 - cmp r1, 0 - beq _0803550C - ldr r2, [r1, 0x4] - lsls r1, r4, 3 - subs r0, r1, r4 - lsls r0, 2 - adds r2, r0, r2 - ldrb r0, [r2] - adds r6, r1, 0 - cmp r0, 0 - beq _0803550C - ldrb r3, [r2, 0x3] - adds r1, r3, 0x1 - ldrb r0, [r2, 0x1] - cmp r5, 0 - beq _080354D8 - cmp r1, 0 - beq _0803550C - ldr r1, =0x030022c0 - movs r5, 0x4 - negs r5, r5 - movs r4, 0x2 - adds r3, 0x1 - lsls r0, 3 - adds r0, 0x39 - adds r2, r0, r1 -_080354BC: - ldrb r1, [r2] - adds r0, r5, 0 - ands r0, r1 - orrs r0, r4 - strb r0, [r2] - subs r3, 0x1 - adds r2, 0x8 - cmp r3, 0 - bne _080354BC - b _0803550C - .pool -_080354D8: - cmp r1, 0 - beq _080354FA - ldr r1, =0x030022c0 - movs r5, 0x4 - negs r5, r5 - adds r3, 0x1 - lsls r0, 3 - adds r0, 0x39 - adds r2, r0, r1 -_080354EA: - ldrb r1, [r2] - adds r0, r5, 0 - ands r0, r1 - strb r0, [r2] - subs r3, 0x1 - adds r2, 0x8 - cmp r3, 0 - bne _080354EA -_080354FA: - ldr r0, [r7] - ldr r1, [r0, 0x4] - subs r0, r6, r4 - lsls r0, 2 - adds r0, r1 - ldr r1, [r0, 0x18] - adds r0, r4, 0 - bl sub_8035044 -_0803550C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803547C - - thumb_func_start sub_8035518 -sub_8035518: @ 8035518 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r5, 0x40 - movs r3, 0 - ldr r0, =0x02022e10 - ldr r0, [r0] - ldr r2, [r0] - cmp r3, r2 - bcs _0803555A - ldr r1, [r0, 0x4] -_0803552E: - ldrb r0, [r1] - cmp r0, 0 - bne _08035548 - ldrb r0, [r1, 0x1] - cmp r0, 0xFF - beq _08035552 - ldrb r0, [r1, 0x3] - cmp r0, r4 - bhi _08035552 - ldrb r0, [r1, 0x1] - b _0803556A - .pool -_08035548: - adds r0, r5, 0x1 - ldrb r5, [r1, 0x3] - adds r0, r5 - lsls r0, 16 - lsrs r5, r0, 16 -_08035552: - adds r1, 0x1C - adds r3, 0x1 - cmp r3, r2 - bcc _0803552E -_0803555A: - adds r0, r5, r4 - adds r0, 0x1 - cmp r0, 0x80 - bgt _08035568 - lsls r0, r5, 24 - lsrs r0, 24 - b _0803556A -_08035568: - movs r0, 0xFF -_0803556A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8035518 - - thumb_func_start sub_8035570 -sub_8035570: @ 8035570 - push {r4-r6,lr} - adds r3, r0, 0 - movs r2, 0 - ldr r0, =0x02022e10 - ldr r0, [r0] - ldr r4, [r0] - cmp r2, r4 - bcs _080355AC - ldr r1, [r0, 0x4] - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r5, r0, r1 -_0803558A: - ldrb r0, [r1] - cmp r0, 0 - beq _080355A4 - cmp r2, r3 - beq _080355A4 - ldrh r0, [r1, 0x10] - ldrh r6, [r5, 0x10] - cmp r0, r6 - bne _080355A4 - movs r0, 0x1 - b _080355AE - .pool -_080355A4: - adds r1, 0x1C - adds r2, 0x1 - cmp r2, r4 - bcc _0803558A -_080355AC: - movs r0, 0 -_080355AE: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8035570 - - thumb_func_start sub_80355B4 -sub_80355B4: @ 80355B4 - push {r4-r6,lr} - adds r3, r0, 0 - movs r2, 0 - ldr r0, =0x02022e10 - ldr r0, [r0] - ldr r4, [r0] - cmp r2, r4 - bcs _080355F0 - ldr r1, [r0, 0x4] - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r5, r0, r1 -_080355CE: - ldrb r0, [r1] - cmp r0, 0 - beq _080355E8 - cmp r2, r3 - beq _080355E8 - ldrh r0, [r1, 0x12] - ldrh r6, [r5, 0x12] - cmp r0, r6 - bne _080355E8 - movs r0, 0x1 - b _080355F2 - .pool -_080355E8: - adds r1, 0x1C - adds r2, 0x1 - cmp r2, r4 - bcc _080355CE -_080355F0: - movs r0, 0 -_080355F2: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80355B4 - - thumb_func_start sub_80355F8 -sub_80355F8: @ 80355F8 - ldr r2, =gUnknown_082FF1C8 - lsls r0, 2 - adds r1, r0 - adds r1, r2 - ldrb r0, [r1] - bx lr - .pool - thumb_func_end sub_80355F8 - - thumb_func_start sub_8035608 -sub_8035608: @ 8035608 - push {lr} - bl ResetAllObjectData - ldr r0, =gUnknown_0831AC88 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - ldr r0, =sub_8035648 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8035608 - - thumb_func_start sub_8035648 -sub_8035648: @ 8035648 - push {lr} - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - pop {r0} - bx r0 - thumb_func_end sub_8035648 - - thumb_func_start trs_config -trs_config: @ 8035658 - push {r4,lr} - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0831AA08 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 11 - ands r1, r0 - cmp r1, 0 - beq _080356A4 - ldr r0, =0x02024474 - adds r0, 0x24 - movs r1, 0x1 - strb r1, [r0] - ldr r4, =0x02023060 - ldr r1, [r4] - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - movs r0, 0x2 - bl SetBgTilemapBuffer - b _080356AA - .pool -_080356A4: - ldr r0, =0x02024474 - adds r0, 0x24 - strb r1, [r0] -_080356AA: - ldr r1, =gUnknown_0831ABA0 - ldr r0, =0x02024474 - adds r0, 0x24 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl InitWindows - bl DeactivateAllTextPrinters - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end trs_config - - thumb_func_start c2_berry_program_update_menu -c2_berry_program_update_menu: @ 80356D0 - push {lr} - movs r0, 0x2 - bl DisableInterrupts - movs r0, 0xC5 - bl EnableInterrupts - bl trs_config - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - ldr r1, =0x0000b040 - movs r0, 0 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end c2_berry_program_update_menu - - thumb_func_start sub_803570C -sub_803570C: @ 803570C - push {lr} - movs r0, 0x2 - movs r1, 0x12 - movs r2, 0x10 - bl sub_809882C - movs r0, 0x2 - movs r1, 0x22 - movs r2, 0x10 - bl sub_809882C - ldr r0, =gUnknown_08D85600 - movs r1, 0x50 - movs r2, 0x20 - bl decompress_palette - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _0803575A - movs r0, 0x70 - bl sub_81978B0 - movs r0, 0 - movs r1, 0x30 - movs r2, 0x70 - bl copy_textbox_border_tile_patterns_to_vram - ldr r0, =0x02037714 - adds r0, 0xEC - movs r1, 0 - strh r1, [r0] - ldr r1, =0x02037c00 - movs r2, 0x1 - bl CpuSet -_0803575A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_803570C - - thumb_func_start load_battle_oval_graphics -load_battle_oval_graphics: @ 8035770 - push {r4,r5,lr} - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r0, =0x023f0902 - ands r0, r1 - cmp r0, 0 - beq _080357B0 - ldr r0, =gUnknown_08D7C440 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7CA28 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7C9EC - b _08035A52 - .pool -_080357B0: - movs r0, 0x80 - lsls r0, 21 - ands r0, r1 - cmp r0, 0 - beq _080357E4 - ldr r0, =gUnknown_08D7BB14 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7C154 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7DF30 - b _08035A52 - .pool -_080357E4: - movs r0, 0x80 - lsls r0, 22 - ands r0, r1 - cmp r0, 0 - beq _08035818 - ldr r0, =gUnknown_08D7A108 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7A720 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7DEF4 - b _08035A52 - .pool -_08035818: - movs r0, 0x80 - lsls r0, 23 - ands r0, r1 - cmp r0, 0 - beq _0803584C - ldr r0, =gUnknown_08D7D590 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7DC04 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7E234 - b _08035A52 - .pool -_0803584C: - movs r0, 0x8 - ands r1, r0 - cmp r1, 0 - beq _080358C4 - ldr r2, =gTrainers - ldr r0, =0x02038bca - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0x20 - bne _08035898 - ldr r0, =gUnknown_08D7C440 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7CA28 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7DFC4 - b _08035A52 - .pool -_08035898: - cmp r0, 0x26 - bne _080358C4 - ldr r0, =gUnknown_08D7CCD8 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7D2E0 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7E1F8 - b _08035A52 - .pool -_080358C4: - bl sav1_map_get_battletype - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8 - bhi _08035904 - lsls r0, 2 - ldr r1, =_080358E0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080358E0: - .4byte _08035904 - .4byte _08035950 - .4byte _08035978 - .4byte _080359A0 - .4byte _080359C8 - .4byte _080359F0 - .4byte _08035A18 - .4byte _08035A40 - .4byte _08035A70 -_08035904: - ldr r4, =gUnknown_0831ABA8 - ldr r5, =0x02022ff0 - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - ldr r1, =0x06008000 - bl LZDecompressVram - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0x4 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x0600d000 - bl LZDecompressVram - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r4, 0x10 - adds r0, r4 - ldr r0, [r0] - b _08035A52 - .pool -_08035950: - ldr r0, =gUnknown_08D7C440 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7CA28 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7DF88 - b _08035A52 - .pool -_08035978: - ldr r0, =gUnknown_08D7CCD8 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7D2E0 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7E060 - b _08035A52 - .pool -_080359A0: - ldr r0, =gUnknown_08D7CCD8 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7D2E0 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7E000 - b _08035A52 - .pool -_080359C8: - ldr r0, =gUnknown_08D7CCD8 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7D2E0 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7E0CC - b _08035A52 - .pool -_080359F0: - ldr r0, =gUnknown_08D7CCD8 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7D2E0 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7E11C - b _08035A52 - .pool -_08035A18: - ldr r0, =gUnknown_08D7CCD8 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7D2E0 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7E164 - b _08035A52 - .pool -_08035A40: - ldr r0, =gUnknown_08D7CCD8 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7D2E0 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7E1A8 -_08035A52: - movs r1, 0x20 - movs r2, 0x60 - bl decompress_palette - b _08035A8A - .pool -_08035A70: - ldr r0, =gUnknown_08D7C440 - ldr r1, =0x06008000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7CA28 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7C9EC - movs r1, 0x20 - movs r2, 0x60 - bl decompress_palette -_08035A8A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end load_battle_oval_graphics - - thumb_func_start sub_8035AA4 -sub_8035AA4: @ 8035AA4 - push {lr} - ldr r0, =gUnknown_08C00000 - movs r1, 0xC0 - lsls r1, 19 - bl LZDecompressVram - ldr r1, =gUnknown_08C00524 - movs r0, 0 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, =gUnknown_08C004E0 - movs r1, 0 - movs r2, 0x40 - bl decompress_palette - bl sub_803570C - bl load_battle_oval_graphics - pop {r0} - bx r0 - .pool - thumb_func_end sub_8035AA4 - - thumb_func_start sub_8035AE4 -sub_8035AE4: @ 8035AE4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - ldr r4, [sp, 0x34] - lsls r0, 24 - lsrs r6, r0, 24 - adds r7, r6, 0 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r3, 24 - mov r12, r3 - lsls r4, 24 - lsrs r4, 24 - mov r9, r4 - movs r4, 0 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08035BCC - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - movs r2, 0x12 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _08035B56 - cmp r5, 0x1 - beq _08035B7E - cmp r5, 0x1 - bgt _08035B44 - cmp r5, 0 - beq _08035B4E - b _08035B88 - .pool -_08035B44: - cmp r5, 0x2 - beq _08035B52 - cmp r5, 0x3 - beq _08035B72 - b _08035B88 -_08035B4E: - ldrh r0, [r1, 0xE] - b _08035B74 -_08035B52: - ldrh r1, [r1, 0xE] - b _08035B80 -_08035B56: - cmp r5, 0x1 - beq _08035B72 - cmp r5, 0x1 - bgt _08035B64 - cmp r5, 0 - beq _08035B6E - b _08035B88 -_08035B64: - cmp r5, 0x2 - beq _08035B7A - cmp r5, 0x3 - beq _08035B7E - b _08035B88 -_08035B6E: - ldrh r0, [r1, 0xE] - b _08035B74 -_08035B72: - ldrh r0, [r1, 0x10] -_08035B74: - movs r4, 0x3F - ands r4, r0 - b _08035B88 -_08035B7A: - ldrh r1, [r1, 0xE] - b _08035B80 -_08035B7E: - ldrh r1, [r1, 0x10] -_08035B80: - movs r0, 0xFC - lsls r0, 4 - ands r0, r1 - lsrs r4, r0, 6 -_08035B88: - movs r2, 0 - movs r6, 0x3 - ldr r0, =0x00006001 - adds r5, r0, 0 - add r3, sp, 0xC -_08035B92: - lsls r1, r2, 1 - adds r0, r6, 0 - lsls r0, r1 - ands r0, r4 - asrs r0, r1 - adds r0, r5 - strh r0, [r3] - adds r3, 0x2 - adds r2, 0x1 - cmp r2, 0x2 - ble _08035B92 - movs r0, 0x3 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - mov r0, r8 - add r1, sp, 0xC - mov r2, r12 - mov r3, r9 - bl CopyToBgTilemapBufferRect_ChangePalette - mov r0, r8 - bl CopyBgTilemapBufferToVram - b _08035C36 - .pool -_08035BCC: - ldr r0, =0x02024474 - adds r0, 0x25 - ldrb r0, [r0] - cmp r5, r0 - bne _08035BEC - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldrh r4, [r0, 0xE] - b _08035BF8 - .pool -_08035BEC: - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldrh r4, [r0, 0x10] -_08035BF8: - movs r2, 0 - movs r6, 0x3 - ldr r0, =0x00006001 - adds r5, r0, 0 - add r3, sp, 0xC -_08035C02: - lsls r1, r2, 1 - adds r0, r6, 0 - lsls r0, r1 - ands r0, r4 - asrs r0, r1 - adds r0, r5 - strh r0, [r3] - adds r3, 0x2 - adds r2, 0x1 - cmp r2, 0x5 - ble _08035C02 - movs r0, 0x6 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - mov r0, r8 - add r1, sp, 0xC - mov r2, r12 - mov r3, r9 - bl CopyToBgTilemapBufferRect_ChangePalette - mov r0, r8 - bl CopyBgTilemapBufferToVram -_08035C36: - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8035AE4 - - thumb_func_start sub_8035C4C -sub_8035C4C: @ 8035C4C - push {lr} - ldr r0, =0x0202433a - ldrb r2, [r0] - cmp r2, 0x3 - bne _08035C68 - ldr r0, =gUnknown_085CCBAD - movs r1, 0x15 - bl battle_show_message_maybe - b _08035D68 - .pool -_08035C68: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08035CE2 - cmp r2, 0x1 - bne _08035CAE - ldr r2, =0x020229e8 - ldr r0, =0x02024474 - adds r0, 0x25 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x18] - cmp r0, 0x1 - beq _08035CFC - cmp r0, 0x1 - bgt _08035CA4 - cmp r0, 0 - beq _08035D36 - b _08035D68 - .pool -_08035CA4: - cmp r0, 0x2 - beq _08035D36 - cmp r0, 0x3 - bne _08035D68 - b _08035CFC -_08035CAE: - ldr r2, =0x020229e8 - ldr r0, =0x02024474 - adds r0, 0x25 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x18] - cmp r0, 0x1 - beq _08035D36 - cmp r0, 0x1 - bgt _08035CD8 - cmp r0, 0 - beq _08035CFC - b _08035D68 - .pool -_08035CD8: - cmp r0, 0x2 - beq _08035CFC - cmp r0, 0x3 - bne _08035D68 - b _08035D36 -_08035CE2: - cmp r2, 0x1 - bne _08035D20 - ldr r2, =0x020229e8 - ldr r0, =0x02024474 - adds r0, 0x25 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x18] - cmp r0, 0 - beq _08035D36 -_08035CFC: - ldr r0, =gUnknown_085CCB9E - movs r1, 0x17 - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCBA5 - movs r1, 0x16 - bl battle_show_message_maybe - b _08035D68 - .pool -_08035D20: - ldr r2, =0x020229e8 - ldr r0, =0x02024474 - adds r0, 0x25 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x18] - cmp r0, 0 - beq _08035D58 -_08035D36: - ldr r0, =gUnknown_085CCB9E - movs r1, 0x16 - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCBA5 - movs r1, 0x17 - bl battle_show_message_maybe - b _08035D68 - .pool -_08035D58: - ldr r0, =gUnknown_085CCB9E - movs r1, 0x17 - bl battle_show_message_maybe - ldr r0, =gUnknown_085CCBA5 - movs r1, 0x16 - bl battle_show_message_maybe -_08035D68: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8035C4C - - thumb_func_start task00_0800F6FC -task00_0800F6FC: @ 8035D74 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r7, 2 - mov r8, r0 - adds r0, r7 - lsls r0, 3 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - bne _08035D96 - b _08035EC4 -_08035D96: - cmp r0, 0x1 - bgt _08035DA4 - cmp r0, 0 - beq _08035DAC - b _08036138 - .pool -_08035DA4: - cmp r0, 0x2 - bne _08035DAA - b _08035F64 -_08035DAA: - b _08036138 -_08035DAC: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08035E44 - movs r5, 0 - movs r6, 0x3 -_08035DBC: - ldr r0, =0x020229f0 - adds r1, r5, r0 - subs r0, 0x8 - adds r4, r5, r0 - ldrh r0, [r4, 0x18] - cmp r0, 0x1 - beq _08035DF4 - cmp r0, 0x1 - bgt _08035DDC - cmp r0, 0 - beq _08035DE6 - b _08035E3A - .pool -_08035DDC: - cmp r0, 0x2 - beq _08035E08 - cmp r0, 0x3 - beq _08035E22 - b _08035E3A -_08035DE6: - adds r0, r1, 0 - movs r1, 0x11 - bl battle_show_message_maybe - ldrb r1, [r4, 0x18] - movs r0, 0x4 - b _08035E14 -_08035DF4: - adds r0, r1, 0 - movs r1, 0x12 - bl battle_show_message_maybe - ldrb r1, [r4, 0x18] - movs r0, 0x4 - str r0, [sp] - adds r0, r7, 0 - movs r2, 0x2 - b _08035E1A -_08035E08: - adds r0, r1, 0 - movs r1, 0x13 - bl battle_show_message_maybe - ldrb r1, [r4, 0x18] - movs r0, 0x8 -_08035E14: - str r0, [sp] - adds r0, r7, 0 - movs r2, 0x1 -_08035E1A: - movs r3, 0x2 - bl sub_8035AE4 - b _08035E3A -_08035E22: - adds r0, r1, 0 - movs r1, 0x14 - bl battle_show_message_maybe - ldrb r1, [r4, 0x18] - movs r0, 0x8 - str r0, [sp] - adds r0, r7, 0 - movs r2, 0x2 - movs r3, 0x2 - bl sub_8035AE4 -_08035E3A: - adds r5, 0x1C - subs r6, 0x1 - cmp r6, 0 - bge _08035DBC - b _08035EA6 -_08035E44: - ldr r0, =0x02024474 - adds r0, 0x25 - ldrb r5, [r0] - movs r0, 0x1 - adds r6, r5, 0 - eors r6, r0 - adds r1, r6, 0 - ldr r4, =0x020229e8 - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x18] - cmp r0, 0 - beq _08035E66 - adds r6, r5, 0 - adds r5, r1, 0 -_08035E66: - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r4, 0x8 - adds r1, r0, r4 - adds r0, r1, 0 - movs r1, 0xF - bl battle_show_message_maybe - lsls r0, r6, 3 - subs r0, r6 - lsls r0, 2 - adds r1, r0, r4 - adds r0, r1, 0 - movs r1, 0x10 - bl battle_show_message_maybe - movs r4, 0x7 - str r4, [sp] - adds r0, r7, 0 - adds r1, r5, 0 - movs r2, 0x1 - movs r3, 0x2 - bl sub_8035AE4 - str r4, [sp] - adds r0, r7, 0 - adds r1, r6, 0 - movs r2, 0x2 - movs r3, 0x2 - bl sub_8035AE4 -_08035EA6: - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _08036138 - .pool -_08035EC4: - ldr r0, =0x00002710 - bl AllocObjectPalette - lsls r0, 24 - ldr r2, =0x02037714 - lsrs r0, 19 - ldr r3, =0x0000021e - adds r0, r3 - adds r2, r0, r2 - ldr r1, =0x02037b14 - adds r0, r1 - ldr r1, =0x00007fff - strh r1, [r0] - strh r1, [r2] - ldr r0, =gUnknown_0831A9D0 - movs r1, 0x6F - movs r2, 0x50 - movs r3, 0 - bl AddObjectToFront - ldr r4, =0x0202449c - ldr r1, [r4] - adds r1, 0x7D - strb r0, [r1] - ldr r0, =gUnknown_0831A9E8 - movs r1, 0x81 - movs r2, 0x50 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r4] - adds r1, 0x7E - strb r0, [r1] - ldr r3, =0x02020630 - ldr r0, [r4] - adds r0, 0x7D - ldrb r1, [r0] - 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] - ldr r0, [r4] - adds r0, 0x7E - 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] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - b _08036138 - .pool -_08035F64: - movs r1, 0x12 - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08035FCC - ldr r4, =0x02022e18 - ldrh r0, [r5, 0xA] - bl sine2 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08035F7E - adds r0, 0x1F -_08035F7E: - asrs r1, r0, 5 - movs r2, 0x14 - negs r2, r2 - adds r0, r2, 0 - subs r0, r1 - strh r0, [r4] - ldr r4, =0x02022e1c - ldrh r0, [r5, 0xC] - bl sine2 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08035F9C - adds r0, 0x1F -_08035F9C: - asrs r1, r0, 5 - movs r3, 0x8C - negs r3, r3 - adds r0, r3, 0 - subs r0, r1 - strh r0, [r4] - ldr r0, =0x02022e1a - ldr r2, =0x0000ffdc - adds r1, r2, 0 - strh r1, [r0] - ldr r0, =0x02022e1e - strh r1, [r0] - b _08036038 - .pool -_08035FCC: - ldr r4, =0x02022e18 - ldrh r0, [r5, 0xA] - bl sine2 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08035FDE - adds r0, 0x1F -_08035FDE: - asrs r1, r0, 5 - movs r3, 0x14 - negs r3, r3 - adds r0, r3, 0 - subs r0, r1 - strh r0, [r4] - ldr r4, =0x02022e1a - ldrh r0, [r5, 0xA] - bl cosine2 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08035FFC - adds r0, 0x1F -_08035FFC: - asrs r0, 5 - subs r0, 0xA4 - strh r0, [r4] - ldr r4, =0x02022e1c - ldrh r0, [r5, 0xC] - bl sine2 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08036014 - adds r0, 0x1F -_08036014: - asrs r1, r0, 5 - movs r2, 0x8C - negs r2, r2 - adds r0, r2, 0 - subs r0, r1 - strh r0, [r4] - ldr r4, =0x02022e1e - ldrh r0, [r5, 0xC] - bl cosine2 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08036032 - adds r0, 0x1F -_08036032: - asrs r0, 5 - subs r0, 0xA4 - strh r0, [r4] -_08036038: - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r1, r0, r1 - ldrh r0, [r1, 0xC] - movs r2, 0xC - ldrsh r3, [r1, r2] - mov r8, r3 - cmp r3, 0 - beq _08036070 - subs r0, 0x2 - strh r0, [r1, 0xC] - ldrh r0, [r1, 0xA] - adds r0, 0x2 - strh r0, [r1, 0xA] - b _08036138 - .pool -_08036070: - movs r3, 0x12 - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _0803607C - bl sub_8035C4C -_0803607C: - movs r0, 0x78 - bl audio_play - adds r0, r7, 0 - bl DestroyTask - ldr r4, =0x02020630 - ldr r5, =0x0202449c - ldr r0, [r5] - adds r0, 0x7D - ldrb r0, [r0] - 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] - adds r0, 0x7E - ldrb r1, [r0] - 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] - ldr r5, [r5] - adds r6, r5, 0 - adds r6, 0x7E - ldrb r0, [r6] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r4 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x40 - ldr r7, =0x000003ff - adds r0, r7, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] - adds r5, 0x7D - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - mov r1, r8 - strh r1, [r0, 0x2E] - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - strh r1, [r0, 0x2E] - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x20] - strh r1, [r0, 0x30] - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x20] - strh r1, [r0, 0x30] - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - mov r2, r8 - strh r2, [r0, 0x32] - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r2, [r0, 0x32] -_08036138: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end task00_0800F6FC - - thumb_func_start sub_8036154 -sub_8036154: @ 8036154 - push {r4,r5,lr} - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08036208 - ldr r0, =gUnknown_08D778F0 - ldr r1, =0x06004000 - bl LZDecompressVram - ldr r0, =gUnknown_08D77B0C - ldr r1, =0x06010000 - bl LZDecompressVram - ldr r0, =gUnknown_08D77AE4 - movs r1, 0x60 - movs r2, 0x20 - bl decompress_palette - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl SetBgAttribute - ldr r1, =0x00005c04 - movs r0, 0xA - bl SetGpuReg - ldr r4, =gUnknown_08D779D8 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x2 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - movs r0, 0x48 - movs r1, 0x36 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x36 - bl SetGpuReg - ldr r0, =0x02022e1a - ldr r2, =0x0000ff5c - adds r1, r2, 0 - strh r1, [r0] - ldr r0, =0x02022e1e - strh r1, [r0] - ldr r0, =gUnknown_0831AA00 - bl LoadCompressedObjectPicUsingHeap - b _080363AC - .pool -_08036208: - ldr r0, =0x023f0902 - ands r0, r1 - cmp r0, 0 - beq _0803628C - movs r0, 0x80 - lsls r0, 15 - ands r1, r0 - cmp r1, 0 - beq _08036224 - ldr r0, =0x02038bce - ldrh r1, [r0] - ldr r0, =0x00000c03 - cmp r1, r0 - bne _08036248 -_08036224: - ldr r0, =gUnknown_08D820D4 - ldr r1, =0x06004000 - bl LZDecompressVram - ldr r0, =gUnknown_08D824E4 - b _08036382 - .pool -_08036248: - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x2 - bl SetBgAttribute - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0x2 - bl SetBgAttribute - ldr r1, =gUnknown_08D857A8 - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r1, =gUnknown_08D85A1C - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - b _080363AC - .pool -_0803628C: - movs r0, 0x80 - lsls r0, 21 - ands r0, r1 - cmp r0, 0 - beq _080362B0 - ldr r0, =gUnknown_08D81610 - ldr r1, =0x06004000 - bl LZDecompressVram - ldr r0, =gUnknown_08D81E2C - b _08036382 - .pool -_080362B0: - movs r0, 0x80 - lsls r0, 22 - ands r0, r1 - cmp r0, 0 - beq _080362D4 - ldr r0, =gUnknown_08D7F9F8 - ldr r1, =0x06004000 - bl LZDecompressVram - ldr r0, =gUnknown_08D7FEC4 - b _08036382 - .pool -_080362D4: - movs r0, 0x80 - lsls r0, 23 - ands r0, r1 - cmp r0, 0 - beq _080362F8 - ldr r0, =gUnknown_08D82608 - ldr r1, =0x06004000 - bl LZDecompressVram - ldr r0, =gUnknown_08D82C70 - b _08036382 - .pool -_080362F8: - movs r0, 0x8 - ands r1, r0 - cmp r1, 0 - beq _08036350 - ldr r2, =gTrainers - ldr r0, =0x02038bca - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0x20 - bne _08036334 - ldr r0, =gUnknown_08D820D4 - ldr r1, =0x06004000 - bl LZDecompressVram - ldr r0, =gUnknown_08D824E4 - b _08036382 - .pool -_08036334: - cmp r0, 0x26 - bne _08036350 - ldr r0, =gUnknown_08D820D4 - ldr r1, =0x06004000 - bl LZDecompressVram - ldr r0, =gUnknown_08D824E4 - b _08036382 - .pool -_08036350: - bl sav1_map_get_battletype - lsls r0, 24 - cmp r0, 0 - bne _0803639C - ldr r4, =gUnknown_0831ABA8 - ldr r5, =0x02022ff0 - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x8 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x06004000 - bl LZDecompressVram - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r4, 0xC - adds r0, r4 - ldr r0, [r0] -_08036382: - ldr r1, =0x0600e000 - bl LZDecompressVram - b _080363AC - .pool -_0803639C: - ldr r0, =gUnknown_08D820D4 - ldr r1, =0x06004000 - bl LZDecompressVram - ldr r0, =gUnknown_08D824E4 - ldr r1, =0x0600e000 - bl LZDecompressVram -_080363AC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8036154 - - thumb_func_start sub_80363C4 -sub_80363C4: @ 80363C4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - movs r4, 0 - cmp r0, 0x6 - bls _080363D2 - b _08036756 -_080363D2: - lsls r0, 2 - ldr r1, =_080363E0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080363E0: - .4byte _080363FC - .4byte _0803640C - .4byte _08036424 - .4byte _08036434 - .4byte _0803652C - .4byte _08036638 - .4byte _08036750 -_080363FC: - ldr r0, =gUnknown_08C00000 - movs r1, 0xC0 - lsls r1, 19 - bl LZDecompressVram - b _08036758 - .pool -_0803640C: - ldr r1, =gUnknown_08C00524 - movs r0, 0 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0 - bl CopyBgTilemapBufferToVram - b _08036758 - .pool -_08036424: - ldr r0, =gUnknown_08C004E0 - movs r1, 0 - movs r2, 0x40 - bl decompress_palette - b _08036758 - .pool -_08036434: - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r0, =0x023f0902 - ands r0, r1 - cmp r0, 0 - bne _08036518 - movs r0, 0x80 - lsls r0, 21 - ands r0, r1 - cmp r0, 0 - beq _0803645C - ldr r0, =gUnknown_08D7BB14 - b _0803651A - .pool -_0803645C: - movs r0, 0x8 - ands r1, r0 - cmp r1, 0 - beq _0803648C - ldr r2, =gTrainers - ldr r0, =0x02038bca - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0x20 - beq _08036518 - cmp r0, 0x26 - bne _0803648C - ldr r0, =gUnknown_08D7CCD8 - b _0803651A - .pool -_0803648C: - bl sav1_map_get_battletype - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8 - bhi _080364CC - lsls r0, 2 - ldr r1, =_080364A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080364A8: - .4byte _080364CC - .4byte _08036518 - .4byte _080364E8 - .4byte _080364F0 - .4byte _080364F8 - .4byte _08036500 - .4byte _08036508 - .4byte _08036510 - .4byte _08036518 -_080364CC: - ldr r2, =gUnknown_0831ABA8 - ldr r0, =0x02022ff0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - b _0803651A - .pool -_080364E8: - ldr r0, =gUnknown_08D7CCD8 - b _0803651A - .pool -_080364F0: - ldr r0, =gUnknown_08D7CCD8 - b _0803651A - .pool -_080364F8: - ldr r0, =gUnknown_08D7CCD8 - b _0803651A - .pool -_08036500: - ldr r0, =gUnknown_08D7CCD8 - b _0803651A - .pool -_08036508: - ldr r0, =gUnknown_08D7CCD8 - b _0803651A - .pool -_08036510: - ldr r0, =gUnknown_08D7CCD8 - b _0803651A - .pool -_08036518: - ldr r0, =gUnknown_08D7C440 -_0803651A: - ldr r1, =0x06008000 - bl LZDecompressVram - b _08036758 - .pool -_0803652C: - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r0, =0x023f0902 - ands r0, r1 - cmp r0, 0 - beq _0803653A - b _08036624 -_0803653A: - movs r0, 0x80 - lsls r0, 5 - ands r0, r1 - cmp r0, 0 - beq _08036568 - ldr r0, =gUnknown_82E9530 - ldrb r0, [r0] - cmp r0, 0x2 - bne _08036560 - ldr r0, =gUnknown_08D7C154 - b _08036626 - .pool -_08036560: - ldr r0, =gUnknown_08D7A720 - b _08036626 - .pool -_08036568: - movs r0, 0x8 - ands r1, r0 - cmp r1, 0 - beq _08036598 - ldr r2, =gTrainers - ldr r0, =0x02038bca - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0x20 - beq _08036624 - cmp r0, 0x26 - bne _08036598 - ldr r0, =gUnknown_08D7D2E0 - b _08036626 - .pool -_08036598: - bl sav1_map_get_battletype - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8 - bhi _080365D8 - lsls r0, 2 - ldr r1, =_080365B4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080365B4: - .4byte _080365D8 - .4byte _08036624 - .4byte _080365F4 - .4byte _080365FC - .4byte _08036604 - .4byte _0803660C - .4byte _08036614 - .4byte _0803661C - .4byte _08036624 -_080365D8: - ldr r2, =gUnknown_0831ABA8 - ldr r0, =0x02022ff0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x4 - adds r0, r2 - ldr r0, [r0] - b _08036626 - .pool -_080365F4: - ldr r0, =gUnknown_08D7D2E0 - b _08036626 - .pool -_080365FC: - ldr r0, =gUnknown_08D7D2E0 - b _08036626 - .pool -_08036604: - ldr r0, =gUnknown_08D7D2E0 - b _08036626 - .pool -_0803660C: - ldr r0, =gUnknown_08D7D2E0 - b _08036626 - .pool -_08036614: - ldr r0, =gUnknown_08D7D2E0 - b _08036626 - .pool -_0803661C: - ldr r0, =gUnknown_08D7D2E0 - b _08036626 - .pool -_08036624: - ldr r0, =gUnknown_08D7CA28 -_08036626: - ldr r1, =0x0600d000 - bl LZDecompressVram - b _08036758 - .pool -_08036638: - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r0, =0x023f0902 - ands r0, r1 - cmp r0, 0 - beq _08036646 - b _08036740 -_08036646: - movs r0, 0x80 - lsls r0, 5 - ands r0, r1 - cmp r0, 0 - beq _08036674 - ldr r0, =gUnknown_82E9530 - ldrb r0, [r0] - cmp r0, 0x2 - bne _0803666C - ldr r0, =gUnknown_08D7DF30 - b _08036742 - .pool -_0803666C: - ldr r0, =gUnknown_08D7DEF4 - b _08036742 - .pool -_08036674: - movs r0, 0x8 - ands r1, r0 - cmp r1, 0 - beq _080366AC - ldr r2, =gTrainers - ldr r0, =0x02038bca - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0x20 - bne _080366A0 - ldr r0, =gUnknown_08D7DFC4 - b _08036742 - .pool -_080366A0: - cmp r0, 0x26 - bne _080366AC - ldr r0, =gUnknown_08D7E1F8 - b _08036742 - .pool -_080366AC: - bl sav1_map_get_battletype - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8 - bhi _080366EC - lsls r0, 2 - ldr r1, =_080366C8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080366C8: - .4byte _080366EC - .4byte _08036708 - .4byte _08036710 - .4byte _08036718 - .4byte _08036720 - .4byte _08036728 - .4byte _08036730 - .4byte _08036738 - .4byte _08036740 -_080366EC: - ldr r2, =gUnknown_0831ABA8 - ldr r0, =0x02022ff0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x10 - adds r0, r2 - ldr r0, [r0] - b _08036742 - .pool -_08036708: - ldr r0, =gUnknown_08D7DF88 - b _08036742 - .pool -_08036710: - ldr r0, =gUnknown_08D7E060 - b _08036742 - .pool -_08036718: - ldr r0, =gUnknown_08D7E000 - b _08036742 - .pool -_08036720: - ldr r0, =gUnknown_08D7E0CC - b _08036742 - .pool -_08036728: - ldr r0, =gUnknown_08D7E11C - b _08036742 - .pool -_08036730: - ldr r0, =gUnknown_08D7E164 - b _08036742 - .pool -_08036738: - ldr r0, =gUnknown_08D7E1A8 - b _08036742 - .pool -_08036740: - ldr r0, =gUnknown_08D7C9EC -_08036742: - movs r1, 0x20 - movs r2, 0x60 - bl decompress_palette - b _08036758 - .pool -_08036750: - bl sub_803570C - b _08036758 -_08036756: - movs r4, 0x1 -_08036758: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80363C4 - - thumb_func_start sub_8036760 -sub_8036760: @ 8036760 - push {lr} - bl saveblock_randomize_and_relocate - bl sub_8056F28 - bl dp11_init - bl init_uns_table_pokemon_copy - bl sub_8185F84 - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080367CC - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - beq _08036798 - bl sub_80367D4 - b _080367BA - .pool -_08036798: - movs r0, 0x80 - lsls r0, 15 - ands r1, r0 - cmp r1, 0 - bne _080367B4 - bl battle_wireless_setup_if_required_maybe - ldr r0, =sub_8037ADC - bl SetMainCallback2 - b _080367BA - .pool -_080367B4: - ldr r0, =intro_end - bl SetMainCallback2 -_080367BA: - ldr r1, =0x02024332 - movs r0, 0 - strb r0, [r1] - b _080367D0 - .pool -_080367CC: - bl sub_80367D4 -_080367D0: - pop {r0} - bx r0 - thumb_func_end sub_8036760 - - thumb_func_start sub_80367D4 -sub_80367D4: @ 80367D4 - push {r4,r5,lr} - sub sp, 0x4 - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - str r0, [sp] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - mov r0, sp - bl CpuSet - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0xF0 - bl SetGpuReg - ldr r1, =0x00005051 - movs r0, 0x44 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - ldr r0, =0x02022e24 - movs r2, 0xF0 - strh r2, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _08036870 - ldr r0, =0x02038bce - ldrh r1, [r0] - ldr r0, =0x00000c03 - cmp r1, r0 - beq _08036870 - ldr r1, =0x02022e26 - movs r0, 0x9F - strh r0, [r1] - ldr r0, =0x02022e28 - strh r2, [r0] - ldr r1, =0x02022e2a - movs r0, 0x20 - strh r0, [r1] - b _080368BE - .pool -_08036870: - ldr r0, =0x02022e26 - ldr r2, =0x00005051 - adds r1, r2, 0 - strh r1, [r0] - bl dp12_8087EA4 - ldr r0, =0x02038c28 - movs r3, 0xF0 - movs r5, 0xF0 - lsls r5, 3 - adds r2, r0, r5 - movs r1, 0x4F -_08036888: - strh r3, [r0] - strh r3, [r2] - adds r2, 0x2 - adds r0, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _08036888 - movs r1, 0x50 - ldr r4, =gUnknown_0831AC70 - ldr r0, =0x02038c28 - ldr r3, =0x0000ff10 - movs r5, 0x82 - lsls r5, 4 - adds r2, r0, r5 - adds r0, 0xA0 -_080368A6: - strh r3, [r0] - strh r3, [r2] - adds r2, 0x2 - adds r0, 0x2 - adds r1, 0x1 - cmp r1, 0x9F - ble _080368A6 - ldr r0, [r4] - ldr r1, [r4, 0x4] - ldr r2, [r4, 0x8] - bl sub_80BA038 -_080368BE: - bl sub_80A1A74 - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r0, =0x02022e18 - strh r1, [r0] - ldr r0, =0x02022e1a - strh r1, [r0] - ldr r0, =0x02022e1c - strh r1, [r0] - ldr r0, =0x02022e1e - strh r1, [r0] - ldr r0, =0x02022e20 - strh r1, [r0] - ldr r0, =0x02022e22 - strh r1, [r0] - bl sub_80B0BD0 - ldr r2, =0x02022ff0 - strb r0, [r2] - ldr r4, =0x02022fec - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _080368FE - movs r0, 0x8 - strb r0, [r2] -_080368FE: - bl c2_berry_program_update_menu - bl sub_8035AA4 - bl ResetAllObjectData - bl ResetTasks - bl sub_8036154 - bl ResetObjectPaletteAllocator - ldr r1, =0x0300301c - movs r0, 0x4 - strb r0, [r1] - ldr r0, =vblank_cb_08078BB4 - bl SetVBlankCallback - bl sub_803269C - ldr r2, [r4] - movs r1, 0xA0 - lsls r1, 1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, r1 - beq _0803693E - ldr r1, =0x00400040 - adds r0, r2, 0 - ands r0, r1 - cmp r0, r1 - bne _08036994 -_0803693E: - ldr r0, =sub_8037458 - bl SetMainCallback2 - b _080369AE - .pool -_08036994: - movs r0, 0x40 - ands r2, r0 - cmp r2, 0 - beq _080369A8 - ldr r0, =sub_8037DF4 - bl SetMainCallback2 - b _080369AE - .pool -_080369A8: - ldr r0, =sub_8036FAC - bl SetMainCallback2 -_080369AE: - ldr r5, =0x02022fec - ldr r0, [r5] - ldr r1, =0x01000002 - ands r0, r1 - cmp r0, 0 - bne _080369E8 - ldr r4, =0x02024744 - ldr r0, =0x02038bca - ldrh r1, [r0] - adds r0, r4, 0 - movs r2, 0x1 - bl LoadTrainerParty - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _080369E4 - movs r1, 0x96 - lsls r1, 1 - adds r0, r4, r1 - ldr r1, =0x02038bcc - ldrh r1, [r1] - movs r2, 0 - bl LoadTrainerParty -_080369E4: - bl sub_806EA68 -_080369E8: - ldr r1, =0x030022c0 - ldr r2, =0x00000439 - adds r1, r2 - ldrb r0, [r1] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r1] - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r5, =0x00000ca9 - adds r1, r5 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r4, =0x020244ec - movs r0, 0xFA - lsls r0, 1 - adds r5, r4, r0 -_08036A10: - adds r0, r4, 0 - movs r1, 0x3 - bl happiness_algorithm - adds r4, 0x64 - cmp r4, r5 - ble _08036A10 - movs r1, 0 - ldr r0, =0x02024332 - strb r1, [r0] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80367D4 - - thumb_func_start sub_8036A5C -sub_8036A5C: @ 8036A5C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r6, 0 - mov r9, r6 - movs r0, 0xCE - lsls r0, 1 - mov r10, r0 - mov r8, r6 -_08036A72: - movs r0, 0x64 - mov r4, r9 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - lsls r0, 16 - lsrs r7, r0, 16 - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - adds r1, r0, 0 - cmp r5, 0 - beq _08036AEE - cmp r5, r10 - beq _08036ABA - cmp r7, 0 - beq _08036ABA - cmp r1, 0 - bne _08036ABA - movs r0, 0x1 - mov r2, r8 - lsls r0, r2 - orrs r6, r0 - lsls r0, r6, 16 - lsrs r6, r0, 16 -_08036ABA: - cmp r5, 0 - beq _08036AEE - cmp r7, 0 - beq _08036AD6 - cmp r5, r10 - beq _08036ACA - cmp r1, 0 - beq _08036AD6 -_08036ACA: - movs r0, 0x2 - mov r1, r8 - lsls r0, r1 - orrs r6, r0 - lsls r0, r6, 16 - lsrs r6, r0, 16 -_08036AD6: - cmp r5, 0 - beq _08036AEE - cmp r5, r10 - beq _08036AEE - cmp r7, 0 - bne _08036AEE - movs r0, 0x3 - mov r2, r8 - lsls r0, r2 - orrs r6, r0 - lsls r0, r6, 16 - lsrs r6, r0, 16 -_08036AEE: - movs r0, 0x2 - add r8, r0 - movs r1, 0x1 - add r9, r1 - mov r2, r9 - cmp r2, 0x5 - ble _08036A72 - ldr r4, =0x0202449c - ldr r0, [r4] - movs r1, 0xC1 - lsls r1, 1 - adds r0, r1 - strb r6, [r0] - ldr r0, [r4] - ldr r5, =0x00000183 - adds r0, r5 - lsrs r1, r6, 8 - strb r1, [r0] - ldr r0, =0x000008d2 - bl FlagGet - ldr r1, [r4] - adds r1, r5 - lsls r0, 7 - ldrb r2, [r1] - orrs r0, r2 - strb r0, [r1] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8036A5C - - thumb_func_start sub_8036B44 -sub_8036B44: @ 8036B44 - push {r4-r7,lr} - ldr r0, =0x0202449c - ldr r5, [r0] - movs r0, 0xC2 - lsls r0, 1 - adds r4, r5, r0 - bl sub_80E162C - cmp r0, 0x1 - bne _08036BC0 - movs r2, 0 - ldr r7, =0x03005d8c - movs r1, 0xC6 - lsls r1, 1 - adds r5, r1 - adds r6, r7, 0 - ldr r3, =0x000031f8 -_08036B66: - adds r0, r4, r2 - ldr r1, [r6] - adds r1, r3 - adds r1, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x5 - ble _08036B66 - adds r1, r4, r2 - movs r0, 0xFF - strb r0, [r1] - movs r2, 0 - adds r3, r5, 0 - ldr r6, =0x03005d8c - ldr r5, =0x00003214 -_08036B86: - adds r0, r3, r2 - ldr r1, [r6] - adds r1, r5 - adds r1, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x11 - ble _08036B86 - ldr r0, [r7] - ldr r1, =0x00003226 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r4, 0x7] - ldr r0, [r7] - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - b _08036C00 - .pool -_08036BC0: - movs r0, 0xAF - bl ItemIdToBerryType - lsls r0, 24 - lsrs r0, 24 - bl GetBerryInfo - adds r3, r0, 0 - movs r2, 0 - movs r0, 0xC6 - lsls r0, 1 - adds r5, r0 -_08036BD8: - adds r0, r4, r2 - adds r1, r3, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x5 - ble _08036BD8 - adds r1, r4, r2 - movs r0, 0xFF - strb r0, [r1] - adds r0, r5, 0 - movs r2, 0 - adds r1, r0, 0 - adds r1, 0x11 -_08036BF4: - strb r2, [r1] - subs r1, 0x1 - cmp r1, r0 - bge _08036BF4 - movs r0, 0 - strb r0, [r4, 0x7] -_08036C00: - strb r0, [r4, 0x1A] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8036B44 - - thumb_func_start berry_801017C -berry_801017C: @ 8036C08 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08036C20 - b _08036D4C -_08036C20: - bl sub_80E162C - cmp r0, 0x1 - bne _08036CDC - movs r5, 0 - ldr r3, =0x02024404 - ldr r0, =0x03005d8c - mov r8, r0 - adds r6, r3, 0 - mov r4, r8 - ldr r2, =0x000031f8 - adds r7, r3, 0 - adds r7, 0x38 -_08036C3A: - adds r1, r5, r6 - ldr r0, [r4] - adds r0, r2 - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1] - adds r1, r5, r7 - ldr r0, [r4] - adds r0, r2 - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1] - adds r5, 0x1 - cmp r5, 0x5 - ble _08036C3A - adds r1, r5, r3 - movs r0, 0xFF - strb r0, [r1] - adds r0, r3, 0 - adds r0, 0x38 - adds r0, r5, r0 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - movs r5, 0 - adds r7, r3, 0 - adds r7, 0x8 - ldr r4, =0x03005d8c - ldr r2, =0x00003214 - adds r6, r3, 0 - adds r6, 0x40 -_08036C78: - adds r1, r5, r7 - ldr r0, [r4] - adds r0, r2 - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1] - adds r1, r5, r6 - ldr r0, [r4] - adds r0, r2 - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1] - adds r5, 0x1 - cmp r5, 0x11 - ble _08036C78 - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x00003226 - adds r0, r2 - ldrb r1, [r0] - strb r1, [r3, 0x7] - ldrb r0, [r0] - adds r1, r3, 0 - adds r1, 0x3F - strb r0, [r1] - mov r4, r8 - ldr r0, [r4] - ldr r1, =0x00003227 - adds r0, r1 - ldrb r1, [r0] - strb r1, [r3, 0x1A] - ldrb r1, [r0] - adds r0, r3, 0 - adds r0, 0x52 - strb r1, [r0] - b _08036EA0 - .pool -_08036CDC: - movs r0, 0xAF - bl ItemIdToBerryType - lsls r0, 24 - lsrs r0, 24 - bl GetBerryInfo - adds r6, r0, 0 - movs r5, 0 - ldr r4, =0x02024404 - adds r7, r4, 0 - adds r7, 0x38 - adds r3, r4, 0 -_08036CF6: - adds r1, r5, r4 - adds r2, r6, r5 - ldrb r0, [r2] - strb r0, [r1] - adds r1, r5, r7 - ldrb r0, [r2] - strb r0, [r1] - adds r5, 0x1 - cmp r5, 0x5 - ble _08036CF6 - adds r1, r5, r3 - movs r0, 0xFF - strb r0, [r1] - adds r0, r3, 0 - adds r0, 0x38 - adds r0, r5, r0 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - movs r5, 0 - adds r4, r3, 0 - adds r4, 0x8 - movs r1, 0 - adds r2, r3, 0 - adds r2, 0x40 -_08036D28: - adds r0, r5, r4 - strb r1, [r0] - adds r0, r5, r2 - strb r1, [r0] - adds r5, 0x1 - cmp r5, 0x11 - ble _08036D28 - movs r1, 0 - strb r1, [r3, 0x7] - adds r0, r3, 0 - adds r0, 0x3F - strb r1, [r0] - strb r1, [r3, 0x1A] - adds r0, 0x13 - strb r1, [r0] - b _08036EA0 - .pool -_08036D4C: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08036DF0 - movs r0, 0x80 - lsls r0, 1 - ands r1, r0 - movs r2, 0x4 - mov r8, r2 - cmp r1, 0 - beq _08036D66 - movs r4, 0x2 - mov r8, r4 -_08036D66: - movs r5, 0 - cmp r5, r8 - blt _08036D6E - b _08036EA0 -_08036D6E: - ldr r0, =0x020229e8 - mov r12, r0 - ldr r3, =0x02024404 - adds r6, r3, 0 - movs r1, 0x8 - adds r1, r6 - mov r9, r1 -_08036D7C: - lsls r1, r5, 8 - ldr r0, =0x020223c8 - adds r7, r1, r0 - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - add r0, r12 - ldrb r3, [r0, 0x18] - movs r4, 0 - adds r5, 0x1 - mov r10, r5 - lsls r1, r3, 3 - subs r0, r1, r3 - adds r5, r1, 0 - lsls r0, 2 - adds r1, r0, r6 -_08036D9C: - adds r0, r7, r4 - ldrb r0, [r0] - strb r0, [r1] - adds r1, 0x1 - adds r4, 0x1 - cmp r4, 0x5 - ble _08036D9C - subs r0, r5, r3 - lsls r0, 2 - adds r1, r4, r0 - adds r1, r6 - movs r2, 0xFF - strb r2, [r1] - movs r4, 0 - mov r2, r9 - adds r1, r0, r2 - adds r2, r7, 0 - adds r2, 0x8 -_08036DC0: - adds r0, r2, r4 - ldrb r0, [r0] - strb r0, [r1] - adds r1, 0x1 - adds r4, 0x1 - cmp r4, 0x11 - ble _08036DC0 - subs r0, r5, r3 - lsls r0, 2 - adds r0, r6 - ldrb r1, [r7, 0x7] - strb r1, [r0, 0x7] - ldrb r1, [r7, 0x1A] - strb r1, [r0, 0x1A] - mov r5, r10 - cmp r5, r8 - blt _08036D7C - b _08036EA0 - .pool -_08036DF0: - movs r5, 0 - ldr r4, =0x02024404 - mov r9, r4 -_08036DF6: - lsls r0, r5, 8 - ldr r1, =0x020223c8 - adds r7, r0, r1 - movs r4, 0 - adds r2, r5, 0x1 - mov r10, r2 - lsls r0, r5, 3 - mov r8, r0 - adds r1, r5, 0x2 - mov r12, r1 - subs r1, r0, r5 - mov r2, r12 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - mov r2, r9 - adds r3, r0, r2 - lsls r1, 2 - adds r2, r1, r2 -_08036E1C: - adds r0, r7, r4 - ldrb r1, [r0] - strb r1, [r2] - ldrb r0, [r0] - strb r0, [r3] - adds r3, 0x1 - adds r2, 0x1 - adds r4, 0x1 - cmp r4, 0x5 - ble _08036E1C - mov r0, r8 - subs r3, r0, r5 - lsls r3, 2 - adds r1, r4, r3 - add r1, r9 - ldrb r0, [r1] - movs r2, 0xFF - orrs r0, r2 - strb r0, [r1] - mov r0, r12 - lsls r2, r0, 3 - subs r2, r0 - lsls r2, 2 - adds r1, r4, r2 - add r1, r9 - ldrb r0, [r1] - movs r4, 0xFF - orrs r0, r4 - strb r0, [r1] - movs r4, 0 - ldr r0, =0x02024404 - adds r0, 0x8 - adds r2, r0 - adds r3, r0 - adds r6, r7, 0 - adds r6, 0x8 -_08036E64: - adds r0, r6, r4 - ldrb r1, [r0] - strb r1, [r3] - ldrb r0, [r0] - strb r0, [r2] - adds r2, 0x1 - adds r3, 0x1 - adds r4, 0x1 - cmp r4, 0x11 - ble _08036E64 - mov r0, r8 - subs r2, r0, r5 - lsls r2, 2 - add r2, r9 - ldrb r0, [r7, 0x7] - strb r0, [r2, 0x7] - mov r1, r12 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r9 - ldrb r1, [r7, 0x7] - strb r1, [r0, 0x7] - ldrb r1, [r7, 0x1A] - strb r1, [r2, 0x1A] - ldrb r1, [r7, 0x1A] - strb r1, [r0, 0x1A] - mov r5, r10 - cmp r5, 0x1 - ble _08036DF6 -_08036EA0: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end berry_801017C - - thumb_func_start sub_8036EB8 -sub_8036EB8: @ 8036EB8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r3, r1, 24 - movs r6, 0 - ldr r0, =0x020223c4 - ldrh r2, [r0] - movs r1, 0x80 - lsls r1, 1 - mov r12, r0 - cmp r2, r1 - bne _08036EFC - cmp r3, 0 - bne _08036EEC - ldr r0, =0x02022fec - ldr r1, [r0] - movs r2, 0xC - b _08036EF2 - .pool -_08036EEC: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r2, 0x8 -_08036EF2: - orrs r1, r2 - str r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_08036EFC: - cmp r6, 0 - bne _08036FA0 - movs r2, 0 - cmp r2, r4 - bge _08036F20 - ldr r1, =0x020223c4 - mov r8, r1 - movs r5, 0x80 - lsls r5, 1 -_08036F0E: - adds r1, r5 - adds r2, 0x1 - cmp r2, r4 - bge _08036F20 - mov r7, r8 - ldrh r0, [r7] - ldrh r7, [r1] - cmp r0, r7 - beq _08036F0E -_08036F20: - cmp r2, r4 - bne _08036F48 - cmp r3, 0 - bne _08036F38 - ldr r0, =0x02022fec - ldr r1, [r0] - movs r2, 0xC - b _08036F3E - .pool -_08036F38: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r2, 0x8 -_08036F3E: - orrs r1, r2 - str r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_08036F48: - cmp r6, 0 - bne _08036FA0 - movs r2, 0 - ldr r5, =0x02022fec - cmp r2, r4 - bge _08036F8A - mov r0, r12 - ldrh r1, [r0] - movs r0, 0xC0 - lsls r0, 2 - cmp r1, r0 - beq _08036F82 -_08036F60: - lsls r0, r2, 8 - add r0, r12 - ldrh r0, [r0] - movs r1, 0xC0 - lsls r1, 2 - cmp r0, r1 - bls _08036F72 - cmp r2, r3 - bne _08036F8A -_08036F72: - adds r2, 0x1 - cmp r2, r4 - bge _08036F8A - lsls r0, r2, 8 - add r0, r12 - ldrh r0, [r0] - cmp r0, r1 - bne _08036F60 -_08036F82: - cmp r2, r3 - beq _08036F60 - cmp r2, r3 - bge _08036F60 -_08036F8A: - cmp r2, r4 - bne _08036F98 - ldr r0, [r5] - movs r1, 0xC - b _08036F9C - .pool -_08036F98: - ldr r0, [r5] - movs r1, 0x8 -_08036F9C: - orrs r0, r1 - str r0, [r5] -_08036FA0: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8036EB8 - - thumb_func_start sub_8036FAC -sub_8036FAC: @ 8036FAC - push {r4-r6,lr} - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x02024474 - adds r0, 0x25 - strb r6, [r0] - movs r0, 0x1 - adds r5, r6, 0 - eors r5, r0 - ldr r0, =0x02024332 - ldrb r0, [r0] - cmp r0, 0x12 - bls _08036FD8 - b _0803744C -_08036FD8: - lsls r0, 2 - ldr r1, =_08036FF0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08036FF0: - .4byte _0803703C - .4byte _08037080 - .4byte _08037144 - .4byte _080371D8 - .4byte _08037200 - .4byte _0803742C - .4byte _08037438 - .4byte _08037230 - .4byte _08037258 - .4byte _0803742C - .4byte _08037438 - .4byte _08037288 - .4byte _080372B0 - .4byte _0803742C - .4byte _08037438 - .4byte _08037318 - .4byte _08037378 - .4byte _080373A0 - .4byte _080373E0 -_0803703C: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _08037068 - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - bl sub_805EF14 - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1] -_08037068: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _08037072 - b _0803744C -_08037072: - bl sub_800E0E8 - b _0803744C - .pool -_08037080: - ldr r2, =0x02022fec - ldr r1, [r2] - movs r6, 0x2 - adds r0, r1, 0 - ands r0, r6 - cmp r0, 0 - beq _08037124 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08037098 - b _0803744C -_08037098: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080370EE - ldr r4, =0x0202449c - ldr r0, [r4] - movs r5, 0xC0 - lsls r5, 1 - adds r0, r5 - movs r1, 0 - strb r1, [r0] - ldr r0, [r4] - ldr r2, =0x00000181 - adds r1, r0, r2 - movs r0, 0x3 - strb r0, [r1] - bl sub_8036A5C - bl sub_8036B44 - ldr r0, =0x02038bca - ldrh r1, [r0] - movs r0, 0xC0 - lsls r0, 4 - cmp r1, r0 - bne _080370D8 - ldr r0, =0x020229e8 - movs r1, 0 - strh r1, [r0, 0x18] - movs r1, 0x1 - strh r1, [r0, 0x34] -_080370D8: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, [r4] - adds r1, r5 - movs r2, 0x20 - bl link_0800A448 - ldr r0, =0x02024332 - strb r6, [r0] -_080370EE: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _080370F8 - b _0803744C -_080370F8: - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - b _0803744C - .pool -_08037124: - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - bne _08037134 - movs r0, 0x4 - orrs r1, r0 - str r1, [r2] -_08037134: - ldr r1, =0x02024332 - movs r0, 0xF - strb r0, [r1] - bl berry_801017C - b _0803744C - .pool -_08037144: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _08037152 - b _0803744C -_08037152: - bl sub_800A5B4 - movs r0, 0x2 - adds r1, r6, 0 - bl sub_8036EB8 - bl berry_801017C - ldr r0, =task00_0800F6FC - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - adds r2, r1 - movs r1, 0 - movs r0, 0x87 - lsls r0, 1 - strh r0, [r2, 0xA] - movs r0, 0x5A - strh r0, [r2, 0xC] - strh r1, [r2, 0x12] - ldr r0, =0x0202449c - ldr r3, [r0] - movs r4, 0xC1 - lsls r4, 1 - adds r0, r3, r4 - ldrb r1, [r0] - adds r4, 0x1 - adds r0, r3, r4 - ldrb r0, [r0] - lsls r0, 8 - orrs r1, r0 - strh r1, [r2, 0xE] - ldr r1, =0x020223c4 - lsls r4, r5, 8 - adds r1, 0x2 - adds r4, r1 - ldrh r0, [r4] - strh r0, [r2, 0x10] - lsls r0, r6, 8 - adds r0, r1 - ldrh r0, [r0] - bl sub_8185F90 - ldrh r0, [r4] - bl sub_8185F90 - bl sub_8068AA4 - ldr r1, =0x02024332 - b _08037446 - .pool -_080371D8: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _080371E4 - b _0803744C -_080371E4: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020244ec - movs r2, 0xC8 - bl link_0800A448 - ldr r1, =0x02024332 - b _08037446 - .pool -_08037200: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _0803720E - b _0803744C -_0803720E: - bl sub_800A5B4 - ldr r0, =0x02024744 - lsls r1, r5, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0xC8 - bl memcpy - ldr r1, =0x02024332 - b _08037446 - .pool -_08037230: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _0803723C - b _0803744C -_0803723C: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020245b4 - movs r2, 0xC8 - bl link_0800A448 - ldr r1, =0x02024332 - b _08037446 - .pool -_08037258: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _08037266 - b _0803744C -_08037266: - bl sub_800A5B4 - ldr r0, =0x0202480c - lsls r1, r5, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0xC8 - bl memcpy - ldr r1, =0x02024332 - b _08037446 - .pool -_08037288: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _08037294 - b _0803744C -_08037294: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0202467c - movs r2, 0xC8 - bl link_0800A448 - ldr r1, =0x02024332 - b _08037446 - .pool -_080372B0: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _080372BE - b _0803744C -_080372BE: - bl sub_800A5B4 - ldr r4, =0x020248d4 - lsls r1, r5, 8 - ldr r0, =0x020223c4 - adds r1, r0 - adds r0, r4, 0 - movs r2, 0xC8 - bl memcpy - ldr r1, =0xfffffe70 - adds r0, r4, r1 - bl shedinja_something - ldr r2, =0xfffffed4 - adds r0, r4, r2 - bl shedinja_something - adds r0, r4, 0 - subs r0, 0xC8 - bl shedinja_something - adds r0, r4, 0 - subs r0, 0x64 - bl shedinja_something - adds r0, r4, 0 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0x64 - bl shedinja_something - ldr r1, =0x02024332 - b _08037446 - .pool -_08037318: - bl sub_8032768 - bl sub_8184E58 - ldr r2, =0x02024332 - movs r0, 0 - strb r0, [r2, 0x1] - strb r0, [r2, 0x2] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08037372 - movs r3, 0 - ldr r1, =0x020229e8 - ldrb r0, [r1] - adds r5, r2, 0 - cmp r0, 0x3 - bne _08037356 - movs r4, 0xFF - adds r2, r1, 0 -_08037344: - adds r2, 0x1C - adds r3, 0x1 - cmp r3, 0x1 - bgt _08037356 - ldrh r1, [r2] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x3 - beq _08037344 -_08037356: - cmp r3, 0x2 - bne _0803736C - movs r0, 0x10 - strb r0, [r5] - b _0803744C - .pool -_0803736C: - movs r0, 0x12 - strb r0, [r5] - b _0803744C -_08037372: - movs r0, 0x12 - strb r0, [r2] - b _0803744C -_08037378: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0803744C - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0203bd2c - movs r2, 0x4 - bl link_0800A448 - ldr r1, =0x02024332 - b _08037446 - .pool -_080373A0: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - bne _0803744C - bl sub_800A5B4 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x4 - ands r0, r1 - cmp r0, 0 - bne _080373CA - ldr r0, =0x0203bd2c - lsls r1, r5, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0x4 - bl memcpy -_080373CA: - ldr r1, =0x02024332 - b _08037446 - .pool -_080373E0: - ldr r0, =0x02024333 - adds r1, r0, 0x1 - bl battle_load_something - lsls r0, 24 - cmp r0, 0 - beq _0803744C - ldr r2, =0x03005d00 - ldr r1, =0x030022c0 - ldr r0, [r1] - str r0, [r2] - ldr r0, =sub_8039EF0 - str r0, [r1] - ldr r0, =sub_8038420 - bl SetMainCallback2 - ldr r2, =0x02022fec - ldr r1, [r2] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0803744C - movs r0, 0x20 - orrs r1, r0 - str r1, [r2] - b _0803744C - .pool -_0803742C: - ldr r0, =0x02024332 - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - movs r1, 0x1 - strb r1, [r0, 0x1] -_08037438: - ldr r1, =0x02024332 - ldrb r0, [r1, 0x1] - subs r0, 0x1 - strb r0, [r1, 0x1] - lsls r0, 24 - cmp r0, 0 - bne _0803744C -_08037446: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0803744C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8036FAC - - thumb_func_start sub_8037458 -sub_8037458: @ 8037458 - push {r4-r7,lr} - sub sp, 0x4 - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x02024474 - adds r0, 0x25 - strb r6, [r0] - movs r0, 0x1 - adds r7, r6, 0 - eors r7, r0 - ldr r0, =0x02024332 - ldrb r0, [r0] - cmp r0, 0x10 - bls _08037486 - b _080379D6 -_08037486: - lsls r0, 2 - ldr r1, =_0803749C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0803749C: - .4byte _080374E0 - .4byte _08037518 - .4byte _0803761C - .4byte _08037670 - .4byte _08037694 - .4byte _08037710 - .4byte _08037734 - .4byte _080377B0 - .4byte _080377CC - .4byte _080377FC - .4byte _08037818 - .4byte _08037848 - .4byte _08037864 - .4byte _08037908 - .4byte _0803793A - .4byte _0803795C - .4byte _080379A0 -_080374E0: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0803750C - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - bl sub_805EF14 - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1] -_0803750C: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08037518 - bl sub_800E0E8 -_08037518: - ldr r2, =0x02022fec - ldr r1, [r2] - movs r3, 0x2 - adds r0, r1, 0 - ands r0, r3 - cmp r0, 0 - beq _080375FC - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08037530 - b _080379D6 -_08037530: - ldr r6, =0x020229e8 - movs r0, 0 - strh r0, [r6, 0x18] - strh r3, [r6, 0x34] - adds r1, r6, 0 - adds r1, 0x50 - movs r0, 0x1 - strh r0, [r1] - adds r1, 0x1C - movs r0, 0x3 - strh r0, [r1] - adds r0, r6, 0 - adds r0, 0x40 - ldr r4, =0x02038bca - ldrh r1, [r4] - bl sub_8162E20 - adds r0, r6, 0 - adds r0, 0x5C - ldr r5, =0x02038bcc - ldrh r1, [r5] - bl sub_8162E20 - ldrh r1, [r4] - mov r0, sp - bl sub_8165B88 - mov r0, sp - ldrb r0, [r0] - adds r1, r6, 0 - adds r1, 0x52 - strh r0, [r1] - ldrh r1, [r5] - mov r0, sp - bl sub_8165B88 - mov r0, sp - ldrb r1, [r0] - adds r0, r6, 0 - adds r0, 0x6E - strh r1, [r0] - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080375C4 - ldr r4, =0x0202449c - ldr r0, [r4] - movs r5, 0xC0 - lsls r5, 1 - adds r0, r5 - movs r1, 0 - strb r1, [r0] - ldr r0, [r4] - ldr r2, =0x00000181 - adds r1, r0, r2 - movs r0, 0x3 - strb r0, [r1] - bl sub_8036A5C - bl sub_8036B44 - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, [r4] - adds r1, r5 - movs r2, 0x20 - bl link_0800A448 - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1] -_080375C4: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _080375CE - b _080379D6 -_080375CE: - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - b _080379D6 - .pool -_080375FC: - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - bne _0803760C - movs r0, 0x4 - orrs r1, r0 - str r1, [r2] -_0803760C: - ldr r1, =0x02024332 - movs r0, 0xD - strb r0, [r1] - bl berry_801017C - b _080379D6 - .pool -_0803761C: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _0803762A - b _080379D6 -_0803762A: - bl sub_800A5B4 - movs r0, 0x2 - adds r1, r6, 0 - bl sub_8036EB8 - bl berry_801017C - ldr r0, =task00_0800F6FC - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0 - movs r0, 0x87 - lsls r0, 1 - strh r0, [r1, 0xA] - movs r0, 0x5A - strh r0, [r1, 0xC] - strh r2, [r1, 0x12] - adds r0, 0xEB - strh r0, [r1, 0xE] - strh r0, [r1, 0x10] - b _08037986 - .pool -_08037670: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _0803767C - b _080379D6 -_0803767C: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020244ec -_08037686: - movs r2, 0xC8 - bl link_0800A448 - b _08037986 - .pool -_08037694: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _080376A2 - b _080379D6 -_080376A2: - bl sub_800A5B4 - ldr r0, =0x020229e8 - lsls r1, r6, 3 - subs r1, r6 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x18] - cmp r0, 0 - beq _080376E8 - ldr r4, =0x020244ec - lsls r1, r7, 8 - ldr r5, =0x020223c4 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0xC8 - bl memcpy - movs r0, 0x96 - lsls r0, 1 - adds r4, r0 - lsls r1, r6, 8 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0xC8 - bl memcpy - b _08037986 - .pool -_080376E8: - ldr r4, =0x020244ec - lsls r1, r6, 8 - ldr r5, =0x020223c4 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0xC8 - bl memcpy - movs r1, 0x96 - lsls r1, 1 - adds r4, r1 - lsls r1, r7, 8 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0xC8 - b _08037982 - .pool -_08037710: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _0803771C - b _080379D6 -_0803771C: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020245b4 - movs r2, 0x64 - bl link_0800A448 - b _08037986 - .pool -_08037734: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _08037742 - b _080379D6 -_08037742: - bl sub_800A5B4 - ldr r0, =0x020229e8 - lsls r1, r6, 3 - subs r1, r6 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x18] - cmp r0, 0 - beq _08037788 - ldr r4, =0x020245b4 - lsls r1, r7, 8 - ldr r5, =0x020223c4 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0x64 - bl memcpy - movs r2, 0x96 - lsls r2, 1 - adds r4, r2 - lsls r1, r6, 8 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0x64 - bl memcpy - b _08037986 - .pool -_08037788: - ldr r4, =0x020245b4 - lsls r1, r6, 8 - ldr r5, =0x020223c4 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0x64 - bl memcpy - movs r0, 0x96 - lsls r0, 1 - adds r4, r0 - lsls r1, r7, 8 - adds r1, r5 - adds r0, r4, 0 - movs r2, 0x64 - b _08037982 - .pool -_080377B0: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _080377BC - b _080379D6 -_080377BC: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02024744 - b _08037686 - .pool -_080377CC: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _080377DA - b _080379D6 -_080377DA: - bl sub_800A5B4 - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _080377EA - b _08037986 -_080377EA: - ldr r0, =0x02024744 - ldr r1, =0x020223c4 - movs r2, 0xC8 - b _08037982 - .pool -_080377FC: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _08037808 - b _080379D6 -_08037808: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0202480c - b _08037686 - .pool -_08037818: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _08037826 - b _080379D6 -_08037826: - bl sub_800A5B4 - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _08037836 - b _08037986 -_08037836: - ldr r0, =0x0202480c - ldr r1, =0x020223c4 - movs r2, 0xC8 - b _08037982 - .pool -_08037848: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _08037854 - b _080379D6 -_08037854: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020248d4 - b _08037686 - .pool -_08037864: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _08037872 - b _080379D6 -_08037872: - bl sub_800A5B4 - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - beq _0803788A - ldr r0, =0x020248d4 - ldr r1, =0x020223c4 - movs r2, 0xC8 - bl memcpy -_0803788A: - ldr r4, =0x020244ec - adds r0, r4, 0 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0x64 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0xC8 - bl shedinja_something - movs r1, 0x96 - lsls r1, 1 - adds r0, r4, r1 - bl shedinja_something - movs r2, 0xC8 - lsls r2, 1 - adds r0, r4, r2 - bl shedinja_something - movs r1, 0xFA - lsls r1, 1 - adds r0, r4, r1 - bl shedinja_something - ldr r4, =0x02024744 - adds r0, r4, 0 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0x64 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0xC8 - bl shedinja_something - movs r2, 0x96 - lsls r2, 1 - adds r0, r4, r2 - bl shedinja_something - movs r1, 0xC8 - lsls r1, 1 - adds r0, r4, r1 - bl shedinja_something - movs r2, 0xFA - lsls r2, 1 - adds r0, r4, r2 - bl shedinja_something - b _08037986 - .pool -_08037908: - bl sub_8032768 - bl sub_8184E58 - ldr r2, =0x02024332 - movs r0, 0 - strb r0, [r2, 0x1] - strb r0, [r2, 0x2] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08037934 - movs r0, 0xE - strb r0, [r2] - b _080379D6 - .pool -_08037934: - movs r0, 0x10 - strb r0, [r2] - b _080379D6 -_0803793A: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080379D6 - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0203bd2c - movs r2, 0x4 - bl link_0800A448 - b _08037986 - .pool -_0803795C: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - bne _080379D6 - bl sub_800A5B4 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x4 - ands r0, r1 - cmp r0, 0 - bne _08037986 - ldr r0, =0x0203bd2c - lsls r1, r7, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0x4 -_08037982: - bl memcpy -_08037986: - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080379D6 - .pool -_080379A0: - ldr r0, =0x02024333 - adds r1, r0, 0x1 - bl battle_load_something - lsls r0, 24 - cmp r0, 0 - beq _080379D6 - bl sub_8166188 - ldr r2, =0x03005d00 - ldr r1, =0x030022c0 - ldr r0, [r1] - str r0, [r2] - ldr r0, =sub_8039EF0 - str r0, [r1] - ldr r0, =sub_8038420 - bl SetMainCallback2 - ldr r2, =0x02022fec - ldr r1, [r2] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080379D6 - movs r0, 0x20 - orrs r1, r0 - str r1, [r2] -_080379D6: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8037458 - - thumb_func_start sub_80379F8 -sub_80379F8: @ 80379F8 - 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] - movs r0, 0 - mov r8, r0 - ldr r6, =0x02022ff8 - mov r10, r6 -_08037A12: - ldr r1, [sp] - add r1, r8 - movs r0, 0x64 - adds r4, r1, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - mov r1, r8 - lsls r5, r1, 5 - strh r0, [r6] - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr - strh r0, [r6, 0x2] - movs r0, 0x4 - add r0, r10 - mov r9, r0 - adds r7, r5, r0 - adds r0, r4, 0 - movs r1, 0x2 - adds r2, r7, 0 - bl pokemon_getattr - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - strb r0, [r6, 0xF] - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - strh r0, [r6, 0x10] - adds r0, r4, 0 - movs r1, 0x3A - bl pokemon_getattr - strh r0, [r6, 0x12] - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - mov r1, r10 - adds r1, 0x14 - adds r5, r1 - str r0, [r5] - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - str r0, [r6, 0x18] - adds r0, r4, 0 - bl pokemon_get_gender - strb r0, [r6, 0x1C] - adds r0, r7, 0 - bl StripExtendedControlCodes - adds r0, r4, 0 - movs r1, 0x3 - bl pokemon_getattr - cmp r0, 0x1 - beq _08037AA4 - adds r0, r7, 0 - movs r1, 0 - bl sub_81DB4DC -_08037AA4: - adds r6, 0x20 - movs r1, 0x1 - add r8, r1 - mov r0, r8 - cmp r0, 0x2 - ble _08037A12 - ldr r0, =0x02023058 - ldr r0, [r0] - mov r1, r9 - subs r1, 0x4 - movs r2, 0x60 - bl memcpy - 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_80379F8 - - thumb_func_start sub_8037ADC -sub_8037ADC: @ 8037ADC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r0, 0x4 - mov r9, r0 - movs r4, 0xF - ldr r6, =0x02022fec - ldr r0, [r6] - movs r1, 0x80 - lsls r1, 1 - ands r0, r1 - cmp r0, 0 - beq _08037B02 - movs r1, 0x2 - mov r9, r1 - movs r4, 0x3 -_08037B02: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02024474 - adds r0, 0x25 - movs r2, 0 - mov r8, r2 - strb r7, [r0] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0xB4 - str r1, [sp] - adds r0, 0xAC - mov r10, r0 - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - ldr r5, =0x02024332 - ldrb r0, [r5] - cmp r0, 0x1 - beq _08037BA4 - cmp r0, 0x1 - bgt _08037B50 - cmp r0, 0 - beq _08037B5E - b _08037D0A - .pool -_08037B50: - cmp r0, 0x2 - bne _08037B56 - b _08037C64 -_08037B56: - cmp r0, 0x3 - bne _08037B5C - b _08037C9E -_08037B5C: - b _08037D0A -_08037B5E: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08037B68 - b _08037D0A -_08037B68: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _08037B74 - b _08037D0A -_08037B74: - ldr r4, =0x02023058 - movs r0, 0x60 - bl Alloc - str r0, [r4] - movs r0, 0 - bl sub_80379F8 - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, [r4] - movs r2, 0x60 - bl link_0800A448 - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - b _08037D0A - .pool -_08037BA4: - bl sub_800A550 - adds r1, r4, 0 - ands r1, r0 - cmp r1, r4 - beq _08037BB2 - b _08037D0A -_08037BB2: - bl sub_800A5B4 - movs r5, 0 - cmp r8, r9 - bge _08037C2E - lsls r0, r7, 3 - subs r0, r7 - lsls r6, r0, 2 - mov r8, r5 - ldr r4, =0x020223c4 -_08037BC6: - cmp r5, r7 - beq _08037C1E - mov r2, r9 - cmp r2, 0x4 - bne _08037C14 - ldr r2, =0x020229e8 - mov r1, r8 - adds r0, r1, r2 - ldrh r1, [r0, 0x18] - movs r3, 0x1 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _08037BF8 - adds r0, r6, r2 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _08037C04 - b _08037C1E - .pool -_08037BF8: - adds r0, r6, r2 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _08037C1E -_08037C04: - ldr r0, =0x02022ff8 - adds r1, r4, 0 - movs r2, 0x60 - bl memcpy - b _08037C1E - .pool -_08037C14: - ldr r0, =0x02022ff8 - adds r1, r4, 0 - movs r2, 0x60 - bl memcpy -_08037C1E: - movs r2, 0x80 - lsls r2, 1 - adds r4, r2 - movs r0, 0x1C - add r8, r0 - adds r5, 0x1 - cmp r5, r9 - blt _08037BC6 -_08037C2E: - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r1, =0x030022c0 - ldr r0, [r1, 0x8] - ldr r2, [sp] - str r0, [r2] - ldr r0, =0x02022fec - ldr r0, [r0] - mov r2, r10 - str r0, [r2] - ldr r0, =sub_8037ADC - str r0, [r1, 0x8] - bl sub_81B9150 - b _08037D0A - .pool -_08037C64: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08037D0A - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08037D0A - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08037C98 - bl sub_800ADF8 - b _08037D0A - .pool -_08037C98: - bl sub_800AC34 - b _08037D0A -_08037C9E: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08037CE4 - bl sub_8010500 - lsls r0, 24 - cmp r0, 0 - beq _08037D0A - mov r1, r10 - ldr r0, [r1] - str r0, [r6] - ldr r1, =0x030022c0 - ldr r2, [sp] - ldr r0, [r2] - str r0, [r1, 0x8] - ldr r0, =sub_80367D4 - bl SetMainCallback2 - ldr r4, =0x02023058 - ldr r0, [r4] - bl Free - mov r0, r8 - str r0, [r4] - b _08037D0A - .pool -_08037CE4: - ldr r0, =0x03003124 - ldrb r5, [r0] - cmp r5, 0 - bne _08037D0A - mov r1, r10 - ldr r0, [r1] - str r0, [r6] - ldr r1, =0x030022c0 - ldr r2, [sp] - ldr r0, [r2] - str r0, [r1, 0x8] - ldr r0, =sub_80367D4 - bl SetMainCallback2 - ldr r4, =0x02023058 - ldr r0, [r4] - bl Free - str r5, [r4] -_08037D0A: - 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_8037ADC - - thumb_func_start intro_end -intro_end: @ 8037D2C - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x0202449c - ldr r0, [r0] - movs r1, 0xB4 - adds r1, r0 - mov r8, r1 - adds r7, r0, 0 - adds r7, 0xAC - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - ldr r5, =0x02024332 - ldrb r0, [r5] - cmp r0, 0 - beq _08037D64 - cmp r0, 0x1 - beq _08037DA4 - b _08037DD6 - .pool -_08037D64: - ldr r4, =0x02023058 - movs r0, 0x60 - bl Alloc - str r0, [r4] - movs r0, 0x3 - bl sub_80379F8 - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - ldr r1, =0x030022c0 - ldr r0, [r1, 0x8] - mov r2, r8 - str r0, [r2] - ldr r0, =0x02022fec - ldr r0, [r0] - str r0, [r7] - ldr r0, =intro_end - str r0, [r1, 0x8] - bl sub_81B9150 - b _08037DD6 - .pool -_08037DA4: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _08037DD6 - movs r0, 0x2 - strb r0, [r5] - ldr r1, =0x02022fec - ldr r0, [r7] - str r0, [r1] - ldr r1, =0x030022c0 - mov r2, r8 - ldr r0, [r2] - str r0, [r1, 0x8] - ldr r0, =sub_80367D4 - bl SetMainCallback2 - ldr r4, =0x02023058 - ldr r0, [r4] - bl Free - str r6, [r4] -_08037DD6: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end intro_end - - thumb_func_start sub_8037DF4 -sub_8037DF4: @ 8037DF4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02024474 - adds r0, 0x25 - strb r7, [r0] - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - ldr r0, =0x02024332 - ldrb r0, [r0] - cmp r0, 0xA - bls _08037E20 - b _080383F8 -_08037E20: - lsls r0, 2 - ldr r1, =_08037E38 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08037E38: - .4byte _08037E64 - .4byte _08037EA8 - .4byte _08037F50 - .4byte _08038026 - .4byte _0803804C - .4byte _08038140 - .4byte _08038164 - .4byte _080382CC - .4byte _0803832C - .4byte _0803836C - .4byte _080383BC -_08037E64: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _08037E90 - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - bl sub_805EF14 - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1] -_08037E90: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _08037E9A - b _080383F8 -_08037E9A: - bl sub_800E0E8 - b _080383F8 - .pool -_08037EA8: - ldr r2, =0x02022fec - ldr r1, [r2] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08037F30 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08037EBE - b _080383F8 -_08037EBE: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08037F02 - ldr r4, =0x0202449c - ldr r0, [r4] - movs r5, 0xC0 - lsls r5, 1 - adds r0, r5 - movs r1, 0 - strb r1, [r0] - ldr r0, [r4] - ldr r2, =0x00000181 - adds r1, r0, r2 - movs r0, 0x3 - strb r0, [r1] - bl sub_8036A5C - bl sub_8036B44 - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, [r4] - adds r1, r5 - movs r2, 0x20 - bl link_0800A448 - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_08037F02: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _08037F0C - b _080383F8 -_08037F0C: - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - b _080383F8 - .pool -_08037F30: - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - bne _08037F40 - movs r0, 0x4 - orrs r1, r0 - str r1, [r2] -_08037F40: - ldr r1, =0x02024332 - movs r0, 0x7 - strb r0, [r1] - bl berry_801017C - b _080383F8 - .pool -_08037F50: - bl sub_800A550 - movs r1, 0xF - ands r1, r0 - cmp r1, 0xF - beq _08037F5E - b _080383F8 -_08037F5E: - bl sub_800A5B4 - movs r0, 0x4 - adds r1, r7, 0 - bl sub_8036EB8 - bl berry_801017C - bl sub_8068AA4 - ldr r0, =task00_0800F6FC - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - movs r1, 0x87 - lsls r1, 1 - strh r1, [r0, 0xA] - movs r1, 0x5A - strh r1, [r0, 0xC] - strh r2, [r0, 0x12] - strh r2, [r0, 0xE] - strh r2, [r0, 0x10] - ldr r1, =0x020223c4 - adds r4, r0, 0 - adds r5, r1, 0x2 - movs r7, 0x3F - movs r6, 0x3 -_08037FA4: - ldrh r0, [r5] - str r2, [sp] - bl sub_8185F90 - ldr r0, =0x020229e8 - ldr r2, [sp] - adds r0, r2, r0 - ldrh r0, [r0, 0x18] - cmp r0, 0x1 - beq _08037FE6 - cmp r0, 0x1 - bgt _08037FD4 - cmp r0, 0 - beq _08037FDE - b _0803800C - .pool -_08037FD4: - cmp r0, 0x2 - beq _08037FEE - cmp r0, 0x3 - beq _08037FFE - b _0803800C -_08037FDE: - ldrh r0, [r5] - adds r1, r7, 0 - ands r1, r0 - b _08037FF6 -_08037FE6: - ldrh r0, [r5] - adds r1, r7, 0 - ands r1, r0 - b _08038006 -_08037FEE: - ldrh r0, [r5] - adds r1, r7, 0 - ands r1, r0 - lsls r1, 6 -_08037FF6: - ldrh r0, [r4, 0xE] - orrs r1, r0 - strh r1, [r4, 0xE] - b _0803800C -_08037FFE: - ldrh r0, [r5] - adds r1, r7, 0 - ands r1, r0 - lsls r1, 6 -_08038006: - ldrh r0, [r4, 0x10] - orrs r1, r0 - strh r1, [r4, 0x10] -_0803800C: - movs r0, 0x80 - lsls r0, 1 - adds r5, r0 - adds r2, 0x1C - subs r6, 0x1 - cmp r6, 0 - bge _08037FA4 - bl zero_enemy_party_data - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_08038026: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _08038032 - b _080383F8 -_08038032: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020244ec - movs r2, 0xC8 - bl link_0800A448 - b _080383A6 - .pool -_0803804C: - bl sub_800A550 - movs r1, 0xF - ands r1, r0 - cmp r1, 0xF - beq _0803805A - b _080383F8 -_0803805A: - bl sub_800A5B4 - movs r6, 0 - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - mov r8, r0 - ldr r4, =0x020223c4 - movs r5, 0 -_0803806C: - cmp r6, r7 - bne _080380A0 - ldr r0, =0x020229e8 - adds r0, r5, r0 - ldrh r0, [r0, 0x18] - cmp r0, 0x2 - bgt _0803808C - cmp r0, 0x1 - bge _08038098 - cmp r0, 0 - beq _08038090 - b _0803812A - .pool -_0803808C: - cmp r0, 0x3 - bne _0803812A -_08038090: - ldr r0, =0x020244ec - b _08038110 - .pool -_08038098: - ldr r0, =0x02024618 - b _08038110 - .pool -_080380A0: - ldr r2, =0x020229e8 - adds r0, r5, r2 - ldrh r1, [r0, 0x18] - movs r3, 0x1 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _080380C4 - mov r1, r8 - adds r0, r1, r2 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _080380D2 - b _080380F8 - .pool -_080380C4: - mov r1, r8 - adds r0, r1, r2 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _080380F8 -_080380D2: - adds r0, r5, r2 - ldrh r0, [r0, 0x18] - cmp r0, 0x2 - bgt _080380E4 - cmp r0, 0x1 - bge _080380F0 - cmp r0, 0 - beq _080380E8 - b _0803812A -_080380E4: - cmp r0, 0x3 - bne _0803812A -_080380E8: - ldr r0, =0x020244ec - b _08038110 - .pool -_080380F0: - ldr r0, =0x02024618 - b _08038110 - .pool -_080380F8: - adds r0, r5, r2 - ldrh r0, [r0, 0x18] - cmp r0, 0x2 - bgt _0803810A - cmp r0, 0x1 - bge _08038120 - cmp r0, 0 - beq _0803810E - b _0803812A -_0803810A: - cmp r0, 0x3 - bne _0803812A -_0803810E: - ldr r0, =0x02024744 -_08038110: - adds r1, r4, 0 - movs r2, 0xC8 - bl memcpy - b _0803812A - .pool -_08038120: - ldr r0, =0x02024870 - adds r1, r4, 0 - movs r2, 0xC8 - bl memcpy -_0803812A: - movs r2, 0x80 - lsls r2, 1 - adds r4, r2 - adds r5, 0x1C - adds r6, 0x1 - cmp r6, 0x3 - ble _0803806C - b _080383A6 - .pool -_08038140: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _0803814C - b _080383F8 -_0803814C: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020245b4 - movs r2, 0x64 - bl link_0800A448 - b _080383A6 - .pool -_08038164: - bl sub_800A550 - movs r1, 0xF - ands r1, r0 - cmp r1, 0xF - beq _08038172 - b _080383F8 -_08038172: - bl sub_800A5B4 - movs r6, 0 - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - mov r8, r0 - ldr r4, =0x020223c4 - movs r5, 0 -_08038184: - cmp r6, r7 - bne _080381B8 - ldr r0, =0x020229e8 - adds r0, r5, r0 - ldrh r0, [r0, 0x18] - cmp r0, 0x2 - bgt _080381A4 - cmp r0, 0x1 - bge _080381B0 - cmp r0, 0 - beq _080381A8 - b _08038242 - .pool -_080381A4: - cmp r0, 0x3 - bne _08038242 -_080381A8: - ldr r0, =0x020245b4 - b _08038228 - .pool -_080381B0: - ldr r0, =0x020246e0 - b _08038228 - .pool -_080381B8: - ldr r2, =0x020229e8 - adds r0, r5, r2 - ldrh r1, [r0, 0x18] - movs r3, 0x1 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _080381DC - mov r1, r8 - adds r0, r1, r2 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _080381EA - b _08038210 - .pool -_080381DC: - mov r1, r8 - adds r0, r1, r2 - ldrh r1, [r0, 0x18] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _08038210 -_080381EA: - adds r0, r5, r2 - ldrh r0, [r0, 0x18] - cmp r0, 0x2 - bgt _080381FC - cmp r0, 0x1 - bge _08038208 - cmp r0, 0 - beq _08038200 - b _08038242 -_080381FC: - cmp r0, 0x3 - bne _08038242 -_08038200: - ldr r0, =0x020245b4 - b _08038228 - .pool -_08038208: - ldr r0, =0x020246e0 - b _08038228 - .pool -_08038210: - adds r0, r5, r2 - ldrh r0, [r0, 0x18] - cmp r0, 0x2 - bgt _08038222 - cmp r0, 0x1 - bge _08038238 - cmp r0, 0 - beq _08038226 - b _08038242 -_08038222: - cmp r0, 0x3 - bne _08038242 -_08038226: - ldr r0, =0x0202480c -_08038228: - adds r1, r4, 0 - movs r2, 0x64 - bl memcpy - b _08038242 - .pool -_08038238: - ldr r0, =0x02024938 - adds r1, r4, 0 - movs r2, 0x64 - bl memcpy -_08038242: - movs r2, 0x80 - lsls r2, 1 - adds r4, r2 - adds r5, 0x1C - adds r6, 0x1 - cmp r6, 0x3 - ble _08038184 - ldr r4, =0x020244ec - adds r0, r4, 0 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0x64 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0xC8 - bl shedinja_something - movs r1, 0x96 - lsls r1, 1 - adds r0, r4, r1 - bl shedinja_something - movs r2, 0xC8 - lsls r2, 1 - adds r0, r4, r2 - bl shedinja_something - movs r1, 0xFA - lsls r1, 1 - adds r0, r4, r1 - bl shedinja_something - ldr r4, =0x02024744 - adds r0, r4, 0 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0x64 - bl shedinja_something - adds r0, r4, 0 - adds r0, 0xC8 - bl shedinja_something - movs r2, 0x96 - lsls r2, 1 - adds r0, r4, r2 - bl shedinja_something - movs r1, 0xC8 - lsls r1, 1 - adds r0, r4, r1 - bl shedinja_something - movs r2, 0xFA - lsls r2, 1 - adds r0, r4, r2 - bl shedinja_something - b _080383A6 - .pool -_080382CC: - bl sub_8032768 - bl sub_8184E58 - ldr r3, =0x02024332 - movs r0, 0 - strb r0, [r3, 0x1] - strb r0, [r3, 0x2] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08038326 - movs r6, 0 - ldr r0, =0x020229e8 - ldrb r1, [r0] - adds r4, r3, 0 - adds r2, r0, 0 - cmp r1, 0x3 - bne _0803830A - movs r3, 0xFF -_080382F8: - adds r2, 0x1C - adds r6, 0x1 - cmp r6, 0x3 - bgt _0803830A - ldrh r1, [r2] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0x3 - beq _080382F8 -_0803830A: - cmp r6, 0x4 - bne _08038320 - movs r0, 0x8 - strb r0, [r4] - b _080383F8 - .pool -_08038320: - movs r0, 0xA - strb r0, [r4] - b _080383F8 -_08038326: - movs r0, 0xA - strb r0, [r3] - b _080383F8 -_0803832C: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080383F8 - ldr r0, =0x0202449c - ldr r4, [r0] - movs r0, 0xC0 - lsls r0, 1 - adds r4, r0 - ldr r0, =0x02022fec - ldr r0, [r0] - str r0, [r4] - ldr r0, =0x0203bd2c - ldr r0, [r0] - str r0, [r4, 0x4] - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - movs r2, 0x8 - bl link_0800A448 - b _080383A6 - .pool -_0803836C: - bl sub_800A550 - movs r1, 0xF - ands r1, r0 - cmp r1, 0xF - bne _080383F8 - bl sub_800A5B4 - movs r2, 0 - b _08038386 -_08038380: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_08038386: - cmp r2, 0x3 - bhi _080383A6 - ldr r4, =0x020223c4 - lsls r3, r2, 8 - adds r0, r3, r4 - ldrh r0, [r0] - movs r1, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08038380 - adds r1, r4, 0x4 - adds r1, r3, r1 - ldr r0, =0x0203bd2c - movs r2, 0x4 - bl memcpy -_080383A6: - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080383F8 - .pool -_080383BC: - ldr r0, =0x02024333 - adds r1, r0, 0x1 - bl battle_load_something - lsls r0, 24 - cmp r0, 0 - beq _080383F8 - ldr r2, =0x03005d00 - ldr r1, =0x030022c0 - ldr r0, [r1] - str r0, [r2] - ldr r0, =sub_8039EF0 - str r0, [r1] - ldr r0, =sub_8038420 - bl SetMainCallback2 - ldr r3, =0x02022fec - ldr r2, [r3] - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - beq _080383F8 - ldr r0, =0x02038bca - movs r4, 0x80 - lsls r4, 4 - adds r1, r4, 0 - strh r1, [r0] - movs r0, 0x20 - orrs r2, r0 - str r2, [r3] -_080383F8: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8037DF4 - - thumb_func_start sub_8038420 -sub_8038420: @ 8038420 - push {lr} - sub sp, 0x4 - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - bl RunTasks - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2C] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08038482 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08038482 - bl rfu_lacks_rfufunc - lsls r0, 24 - cmp r0, 0 - beq _08038482 - ldr r2, =0x020375f0 - ldr r1, =0x0202433a - movs r0, 0x5 - strb r0, [r1] - movs r0, 0x5 - strh r0, [r2] - bl pal_fade_control_reset_maybe - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =sub_80384E4 - bl SetMainCallback2 -_08038482: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8038420 - - thumb_func_start sub_803849C -sub_803849C: @ 803849C - push {lr} - ldr r1, =0x030022c0 - ldr r0, =0x03005d00 - ldr r0, [r0] - str r0, [r1] - ldr r2, =0x02039b28 - movs r0, 0x3 - strb r0, [r2, 0x15] - ldr r0, =0x00000439 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - bl zero_enemy_party_data - movs r0, 0x5A - bl m4aSongNumStop - bl sub_805F094 - bl dp11_free - bl sub_8057028 - pop {r0} - bx r0 - .pool - thumb_func_end sub_803849C - - thumb_func_start sub_80384E4 -sub_80384E4: @ 80384E4 - push {lr} - bl fade_and_return_progress_probably - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08038512 - ldr r0, =0x030075f0 - bl MPlayStop_rev01 - ldr r0, =0x03007630 - bl MPlayStop_rev01 - bl sub_803849C - bl FreeAllWindowBuffers - ldr r0, =0x030022c0 - ldr r0, [r0, 0x8] - bl SetMainCallback2 -_08038512: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80384E4 - - thumb_func_start sub_8038528 -sub_8038528: @ 8038528 - movs r1, 0 - strh r1, [r0, 0x2E] - ldr r1, =sub_8038538 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_8038528 - - thumb_func_start sub_8038538 -sub_8038538: @ 8038538 - push {r4,r5,lr} - adds r3, r0, 0 - ldr r5, =0x0201c000 - movs r0, 0x2E - ldrsh r1, [r3, r0] - cmp r1, 0x1 - beq _0803856C - cmp r1, 0x1 - bgt _08038554 - cmp r1, 0 - beq _0803855A - b _080385DC - .pool -_08038554: - cmp r1, 0x2 - beq _080385C8 - b _080385DC -_0803855A: - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - strh r1, [r3, 0x30] - ldr r0, =0x00000281 - strh r0, [r3, 0x32] - strh r1, [r3, 0x34] - movs r0, 0x1 - strh r0, [r3, 0x36] -_0803856C: - ldrh r0, [r3, 0x36] - subs r0, 0x1 - strh r0, [r3, 0x36] - lsls r0, 16 - cmp r0, 0 - bne _080385DC - movs r0, 0x2 - strh r0, [r3, 0x36] - movs r4, 0x30 - ldrsh r2, [r3, r4] - movs r0, 0x34 - ldrsh r1, [r3, r0] - lsls r1, 5 - adds r2, r1 - movs r4, 0x32 - ldrsh r0, [r3, r4] - subs r0, r1 - movs r4, 0x3D - lsls r0, 1 - adds r0, r5 - lsls r2, 1 - adds r2, r5 - movs r1, 0x1C -_0803859A: - strh r4, [r2] - strh r4, [r0] - adds r0, 0x4 - adds r2, 0x4 - subs r1, 0x2 - cmp r1, 0 - bge _0803859A - ldrh r0, [r3, 0x34] - adds r0, 0x1 - strh r0, [r3, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x15 - bne _080385DC - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - movs r0, 0x20 - strh r0, [r3, 0x30] - b _080385DC - .pool -_080385C8: - ldrh r0, [r3, 0x30] - subs r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - bne _080385DC - ldr r0, =sub_8036760 - bl SetMainCallback2 -_080385DC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8038538 - - thumb_func_start LoadTrainerParty -LoadTrainerParty: @ 80385E8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - str r0, [sp, 0x10] - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0x14] - lsls r2, 24 - lsrs r2, 24 - movs r0, 0 - mov r9, r0 - movs r0, 0x80 - lsls r0, 3 - cmp r1, r0 - bne _08038610 - movs r0, 0 - b _080389E2 -_08038610: - ldr r4, =0x02022fec - ldr r0, [r4] - ldr r1, =0x043f0908 - ands r0, r1 - ldr r1, [sp, 0x14] - lsls r1, 2 - str r1, [sp, 0x20] - cmp r0, 0x8 - beq _08038624 - b _080389D2 -_08038624: - cmp r2, 0x1 - bne _0803862C - bl zero_enemy_party_data -_0803862C: - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _08038668 - ldr r0, =gTrainers - ldr r2, [sp, 0x20] - ldr r3, [sp, 0x14] - adds r1, r2, r3 - lsls r1, 3 - adds r1, r0 - adds r2, r1, 0 - adds r2, 0x20 - ldrb r1, [r2] - movs r4, 0x3 - str r4, [sp, 0x1C] - adds r4, r0, 0 - cmp r1, 0x3 - bhi _0803867C - adds r2, r1, 0 - str r2, [sp, 0x1C] - b _0803867C - .pool -_08038668: - ldr r1, =gTrainers - ldr r2, [sp, 0x20] - ldr r3, [sp, 0x14] - adds r0, r2, r3 - lsls r0, 3 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - str r0, [sp, 0x1C] - adds r4, r1, 0 -_0803867C: - movs r0, 0 - str r0, [sp, 0x18] - b _080389B4 - .pool -_08038688: - ldr r2, [sp, 0x20] - ldr r3, [sp, 0x14] - adds r0, r2, r3 - lsls r0, 3 - adds r1, r0, r4 - ldrb r0, [r1, 0x18] - cmp r0, 0x1 - bne _0803869E - movs r0, 0x80 - mov r10, r0 - b _080386B0 -_0803869E: - ldrb r1, [r1, 0x2] - movs r0, 0x80 - ands r0, r1 - movs r1, 0x88 - mov r10, r1 - cmp r0, 0 - beq _080386B0 - movs r2, 0x78 - mov r10, r2 -_080386B0: - movs r6, 0 - ldr r2, [sp, 0x20] - ldr r3, [sp, 0x14] - adds r0, r2, r3 - lsls r0, 3 - adds r1, r4, 0x4 - adds r0, r1 - ldrb r0, [r0] - ldr r3, [sp, 0x18] - adds r3, 0x1 - str r3, [sp, 0x24] - cmp r0, 0xFF - beq _080386E6 - adds r3, r1, 0 -_080386CC: - ldr r0, [sp, 0x14] - adds r1, r2, r0 - lsls r1, 3 - adds r0, r6, r1 - adds r0, r3 - ldrb r0, [r0] - add r9, r0 - adds r6, 0x1 - adds r1, r6, r1 - adds r1, r3 - ldrb r0, [r1] - cmp r0, 0xFF - bne _080386CC -_080386E6: - ldr r1, [sp, 0x20] - ldr r2, [sp, 0x14] - adds r0, r1, r2 - lsls r1, r0, 3 - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08038794 - cmp r0, 0x1 - bgt _08038700 - cmp r0, 0 - beq _0803870E - b _080389AC -_08038700: - cmp r0, 0x2 - bne _08038706 - b _08038854 -_08038706: - cmp r0, 0x3 - bne _0803870C - b _080388E8 -_0803870C: - b _080389AC -_0803870E: - adds r0, r4, 0 - adds r0, 0x24 - adds r0, r1, r0 - ldr r4, [r0] - movs r6, 0 - ldr r3, [sp, 0x18] - lsls r2, r3, 3 - adds r0, r2, r4 - ldrh r1, [r0, 0x4] - movs r0, 0xB - muls r0, r1 - ldr r1, =gSpeciesNames - adds r0, r1 - ldrb r0, [r0] - adds r5, r2, 0 - cmp r0, 0xFF - beq _08038750 - adds r3, r1, 0 - movs r7, 0xB -_08038734: - adds r0, r2, r4 - ldrh r0, [r0, 0x4] - adds r1, r0, 0 - muls r1, r7 - adds r0, r6, r1 - adds r0, r3 - ldrb r0, [r0] - add r9, r0 - adds r6, 0x1 - adds r1, r6, r1 - adds r1, r3 - ldrb r0, [r1] - cmp r0, 0xFF - bne _08038734 -_08038750: - mov r2, r9 - lsls r0, r2, 8 - add r10, r0 - adds r4, r5, r4 - ldrh r1, [r4] - lsls r0, r1, 5 - subs r0, r1 - movs r1, 0xFF - bl __divsi3 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r3, [sp, 0x18] - movs r1, 0x64 - adds r0, r3, 0 - muls r0, r1 - ldr r2, [sp, 0x10] - adds r0, r2, r0 - ldrh r1, [r4, 0x4] - ldrb r2, [r4, 0x2] - movs r3, 0x1 - str r3, [sp] - mov r3, r10 - str r3, [sp, 0x4] - movs r3, 0x2 - str r3, [sp, 0x8] - movs r3, 0 - str r3, [sp, 0xC] - adds r3, r6, 0 - bl create_pokemon_set_level - b _080389AC - .pool -_08038794: - adds r0, r4, 0 - adds r0, 0x24 - adds r0, r1, r0 - ldr r7, [r0] - movs r6, 0 - ldr r4, [sp, 0x18] - lsls r2, r4, 4 - adds r0, r2, r7 - ldrh r1, [r0, 0x4] - movs r0, 0xB - muls r0, r1 - ldr r1, =gSpeciesNames - adds r0, r1 - ldrb r0, [r0] - mov r8, r2 - cmp r0, 0xFF - beq _080387D6 - adds r3, r1, 0 - movs r4, 0xB -_080387BA: - adds r0, r2, r7 - ldrh r0, [r0, 0x4] - adds r1, r0, 0 - muls r1, r4 - adds r0, r6, r1 - adds r0, r3 - ldrb r0, [r0] - add r9, r0 - adds r6, 0x1 - adds r1, r6, r1 - adds r1, r3 - ldrb r0, [r1] - cmp r0, 0xFF - bne _080387BA -_080387D6: - mov r2, r9 - lsls r0, r2, 8 - add r10, r0 - mov r3, r8 - adds r4, r3, r7 - ldrh r1, [r4] - lsls r0, r1, 5 - subs r0, r1 - movs r1, 0xFF - bl __divsi3 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, [sp, 0x18] - movs r1, 0x64 - adds r5, r0, 0 - muls r5, r1 - ldr r2, [sp, 0x10] - adds r5, r2, r5 - ldrh r1, [r4, 0x4] - ldrb r2, [r4, 0x2] - movs r0, 0x1 - str r0, [sp] - mov r3, r10 - str r3, [sp, 0x4] - movs r0, 0x2 - str r0, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - adds r0, r5, 0 - adds r3, r6, 0 - bl create_pokemon_set_level - movs r6, 0 - mov r0, r8 - adds r0, 0x6 - adds r4, r7, r0 -_08038820: - adds r1, r6, 0 - adds r1, 0xD - adds r0, r5, 0 - adds r2, r4, 0 - bl pokemon_setattr - adds r1, r6, 0 - adds r1, 0x11 - ldrh r0, [r4] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - ldr r0, =gBattleMoves + 0x4 @ PP offset - adds r2, r0 - adds r0, r5, 0 - bl pokemon_setattr - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _08038820 - b _080389AC - .pool -_08038854: - adds r0, r4, 0 - adds r0, 0x24 - adds r0, r1, r0 - ldr r4, [r0] - movs r6, 0 - ldr r0, [sp, 0x18] - lsls r2, r0, 3 - adds r0, r2, r4 - ldrh r1, [r0, 0x4] - movs r0, 0xB - muls r0, r1 - ldr r1, =gSpeciesNames - adds r0, r1 - ldrb r0, [r0] - adds r5, r2, 0 - cmp r0, 0xFF - beq _08038896 - adds r3, r1, 0 - movs r7, 0xB -_0803887A: - adds r0, r2, r4 - ldrh r0, [r0, 0x4] - adds r1, r0, 0 - muls r1, r7 - adds r0, r6, r1 - adds r0, r3 - ldrb r0, [r0] - add r9, r0 - adds r6, 0x1 - adds r1, r6, r1 - adds r1, r3 - ldrb r0, [r1] - cmp r0, 0xFF - bne _0803887A -_08038896: - mov r2, r9 - lsls r0, r2, 8 - add r10, r0 - adds r5, r4 - ldrh r1, [r5] - lsls r0, r1, 5 - subs r0, r1 - movs r1, 0xFF - bl __divsi3 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r3, [sp, 0x18] - movs r0, 0x64 - adds r4, r3, 0 - muls r4, r0 - ldr r1, [sp, 0x10] - adds r4, r1, r4 - ldrh r1, [r5, 0x4] - ldrb r2, [r5, 0x2] - movs r0, 0x1 - str r0, [sp] - mov r3, r10 - str r3, [sp, 0x4] - movs r0, 0x2 - str r0, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - adds r0, r4, 0 - adds r3, r6, 0 - bl create_pokemon_set_level - adds r5, 0x6 - adds r0, r4, 0 - movs r1, 0xC - adds r2, r5, 0 - bl pokemon_setattr - b _080389AC - .pool -_080388E8: - adds r0, r4, 0 - adds r0, 0x24 - adds r0, r1, r0 - ldr r7, [r0] - movs r6, 0 - ldr r4, [sp, 0x18] - lsls r2, r4, 4 - adds r0, r2, r7 - ldrh r1, [r0, 0x4] - movs r0, 0xB - muls r0, r1 - ldr r1, =gSpeciesNames - adds r0, r1 - ldrb r0, [r0] - mov r8, r2 - cmp r0, 0xFF - beq _0803892A - adds r3, r1, 0 - movs r4, 0xB -_0803890E: - adds r0, r2, r7 - ldrh r0, [r0, 0x4] - adds r1, r0, 0 - muls r1, r4 - adds r0, r6, r1 - adds r0, r3 - ldrb r0, [r0] - add r9, r0 - adds r6, 0x1 - adds r1, r6, r1 - adds r1, r3 - ldrb r0, [r1] - cmp r0, 0xFF - bne _0803890E -_0803892A: - mov r2, r9 - lsls r0, r2, 8 - add r10, r0 - mov r3, r8 - adds r5, r3, r7 - ldrh r1, [r5] - lsls r0, r1, 5 - subs r0, r1 - movs r1, 0xFF - bl __divsi3 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, [sp, 0x18] - movs r1, 0x64 - adds r4, r0, 0 - muls r4, r1 - ldr r2, [sp, 0x10] - adds r4, r2, r4 - ldrh r1, [r5, 0x4] - ldrb r2, [r5, 0x2] - movs r0, 0x1 - str r0, [sp] - mov r3, r10 - str r3, [sp, 0x4] - movs r0, 0x2 - str r0, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - adds r0, r4, 0 - adds r3, r6, 0 - bl create_pokemon_set_level - adds r5, 0x6 - adds r0, r4, 0 - movs r1, 0xC - adds r2, r5, 0 - bl pokemon_setattr - movs r6, 0 - adds r5, r4, 0 - mov r0, r8 - adds r0, 0x8 - adds r4, r7, r0 -_08038982: - adds r1, r6, 0 - adds r1, 0xD - adds r0, r5, 0 - adds r2, r4, 0 - bl pokemon_setattr - adds r1, r6, 0 - adds r1, 0x11 - ldrh r0, [r4] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - ldr r0, =gBattleMoves + 0x4 @ PP offset - adds r2, r0 - adds r0, r5, 0 - bl pokemon_setattr - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _08038982 -_080389AC: - ldr r4, [sp, 0x24] - str r4, [sp, 0x18] - ldr r4, =gTrainers - ldr r0, [sp, 0x18] -_080389B4: - ldr r1, [sp, 0x1C] - cmp r0, r1 - bge _080389BC - b _08038688 -_080389BC: - ldr r2, =0x02022fec - ldr r1, =gTrainers - ldr r3, [sp, 0x20] - ldr r4, [sp, 0x14] - adds r0, r3, r4 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x18] - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] -_080389D2: - ldr r0, =gTrainers - ldr r2, [sp, 0x20] - ldr r3, [sp, 0x14] - adds r1, r2, r3 - lsls r1, 3 - adds r1, r0 - adds r1, 0x20 - ldrb r0, [r1] -_080389E2: - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end LoadTrainerParty - - thumb_func_start sub_8038A04 -sub_8038A04: @ 8038A04 - push {lr} - ldr r0, =0x04000006 - ldrh r0, [r0] - subs r0, 0x6F - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x30 - bhi _08038A1E - movs r1, 0x98 - lsls r1, 8 - movs r0, 0x8 - bl SetGpuReg -_08038A1E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8038A04 - - thumb_func_start vblank_cb_08078BB4 -vblank_cb_08078BB4: @ 8038A28 - push {lr} - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x013f0102 - ands r0, r1 - cmp r0, 0 - bne _08038A3A - bl GenerateRandomNumber -_08038A3A: - ldr r0, =0x02022e14 - ldrh r1, [r0] - movs r0, 0x10 - bl SetGpuReg - ldr r0, =0x02022e16 - ldrh r1, [r0] - movs r0, 0x12 - bl SetGpuReg - ldr r0, =0x02022e18 - ldrh r1, [r0] - movs r0, 0x14 - bl SetGpuReg - ldr r0, =0x02022e1a - ldrh r1, [r0] - movs r0, 0x16 - bl SetGpuReg - ldr r0, =0x02022e1c - ldrh r1, [r0] - movs r0, 0x18 - bl SetGpuReg - ldr r0, =0x02022e1e - ldrh r1, [r0] - movs r0, 0x1A - bl SetGpuReg - ldr r0, =0x02022e20 - ldrh r1, [r0] - movs r0, 0x1C - bl SetGpuReg - ldr r0, =0x02022e22 - ldrh r1, [r0] - movs r0, 0x1E - bl SetGpuReg - ldr r0, =0x02022e24 - ldrh r1, [r0] - movs r0, 0x40 - bl SetGpuReg - ldr r0, =0x02022e26 - ldrh r1, [r0] - movs r0, 0x44 - bl SetGpuReg - ldr r0, =0x02022e28 - ldrh r1, [r0] - movs r0, 0x42 - bl SetGpuReg - ldr r0, =0x02022e2a - ldrh r1, [r0] - movs r0, 0x46 - bl SetGpuReg - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - bl sub_80BA0A8 - pop {r0} - bx r0 - .pool - thumb_func_end vblank_cb_08078BB4 - - thumb_func_start nullsub_17 -nullsub_17: @ 8038B00 - bx lr - thumb_func_end nullsub_17 - - thumb_func_start sub_8038B04 -sub_8038B04: @ 8038B04 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08038B24 - movs r1, 0x32 - ldrsh r0, [r5, r1] - movs r1, 0xFF - lsls r1, 8 - ands r0, r1 - lsrs r0, 8 - ldrh r1, [r5, 0x30] - adds r0, r1 - strh r0, [r5, 0x20] - b _08038B36 -_08038B24: - movs r1, 0x32 - ldrsh r0, [r5, r1] - movs r1, 0xFF - lsls r1, 8 - ands r0, r1 - asrs r0, 8 - ldrh r1, [r5, 0x30] - subs r1, r0 - strh r1, [r5, 0x20] -_08038B36: - movs r1, 0xC0 - lsls r1, 1 - adds r0, r1, 0 - ldrh r1, [r5, 0x32] - adds r0, r1 - strh r0, [r5, 0x32] - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08038B6A - ldr r4, =0x00002710 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - adds r0, r5, 0 - bl obj_free_rotscale_entry - adds r0, r5, 0 - bl RemoveObjectAndFreeTiles -_08038B6A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8038B04 - - thumb_func_start sub_8038B74 -sub_8038B74: @ 8038B74 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - ldr r0, =sub_8038B04 - str r0, [r4, 0x1C] - movs r0, 0x68 - bl audio_play - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8038B74 - - thumb_func_start sub_8038B94 -sub_8038B94: @ 8038B94 - 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, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - ldr r0, =0x02024474 - adds r0, 0x25 - ldrb r2, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08038C04 - ldr r1, =0x020229e8 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x18] - cmp r0, 0x1 - beq _08038BF0 - cmp r0, 0x1 - bgt _08038BE8 - cmp r0, 0 - beq _08038C04 - b _08038C0C - .pool -_08038BE8: - cmp r0, 0x2 - beq _08038C04 - cmp r0, 0x3 - bne _08038C0C -_08038BF0: - ldr r0, =0x02024744 - str r0, [sp, 0x4] - ldr r1, =0x020244ec - str r1, [sp, 0x8] - b _08038C0C - .pool -_08038C04: - ldr r2, =0x020244ec - str r2, [sp, 0x4] - ldr r3, =0x02024744 - str r3, [sp, 0x8] -_08038C0C: - movs r7, 0 - movs r0, 0 - mov r8, r0 - ldr r1, [sp] - lsls r1, 2 - str r1, [sp, 0xC] - movs r2, 0xCE - lsls r2, 1 - mov r10, r2 - mov r9, r0 -_08038C20: - movs r0, 0x64 - mov r4, r8 - muls r4, r0 - ldr r3, [sp, 0x4] - adds r4, r3, r4 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - adds r1, r0, 0 - cmp r5, 0 - beq _08038C90 - cmp r5, r10 - beq _08038C64 - cmp r6, 0 - beq _08038C64 - cmp r1, 0 - bne _08038C64 - movs r0, 0x1 - mov r2, r9 - lsls r0, r2 - orrs r7, r0 -_08038C64: - cmp r5, 0 - beq _08038C90 - cmp r6, 0 - beq _08038C7C - cmp r5, r10 - beq _08038C74 - cmp r1, 0 - beq _08038C7C -_08038C74: - movs r0, 0x2 - mov r3, r9 - lsls r0, r3 - orrs r7, r0 -_08038C7C: - cmp r5, 0 - beq _08038C90 - cmp r5, r10 - beq _08038C90 - cmp r6, 0 - bne _08038C90 - movs r0, 0x3 - mov r1, r9 - lsls r0, r1 - orrs r7, r0 -_08038C90: - movs r2, 0x2 - add r9, r2 - movs r3, 0x1 - add r8, r3 - mov r0, r8 - cmp r0, 0x5 - ble _08038C20 - ldr r1, =0x03005e00 - ldr r2, [sp, 0xC] - ldr r3, [sp] - adds r0, r2, r3 - lsls r0, 3 - adds r0, r1 - strh r7, [r0, 0xE] - movs r7, 0 - movs r0, 0 - mov r8, r0 - movs r1, 0xCE - lsls r1, 1 - mov r10, r1 - mov r9, r0 -_08038CBA: - movs r0, 0x64 - mov r4, r8 - muls r4, r0 - ldr r2, [sp, 0x8] - adds r4, r2, r4 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - adds r1, r0, 0 - cmp r5, 0 - beq _08038D2A - cmp r5, r10 - beq _08038CFE - cmp r6, 0 - beq _08038CFE - cmp r1, 0 - bne _08038CFE - movs r0, 0x1 - mov r3, r9 - lsls r0, r3 - orrs r7, r0 -_08038CFE: - cmp r5, 0 - beq _08038D2A - cmp r6, 0 - beq _08038D16 - cmp r5, r10 - beq _08038D0E - cmp r1, 0 - beq _08038D16 -_08038D0E: - movs r0, 0x2 - mov r1, r9 - lsls r0, r1 - orrs r7, r0 -_08038D16: - cmp r5, 0 - beq _08038D2A - cmp r5, r10 - beq _08038D2A - cmp r6, 0 - bne _08038D2A - movs r0, 0x3 - mov r2, r9 - lsls r0, r2 - orrs r7, r0 -_08038D2A: - movs r3, 0x2 - add r9, r3 - movs r0, 0x1 - add r8, r0 - mov r1, r8 - cmp r1, 0x5 - ble _08038CBA - ldr r1, =0x03005e00 - ldr r2, [sp, 0xC] - ldr r3, [sp] - adds r0, r2, r3 - lsls r0, 3 - adds r0, r1 - strh r7, [r0, 0x10] - 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_8038B94 - - thumb_func_start sub_8038D64 -sub_8038D64: @ 8038D64 - push {r4,lr} - sub sp, 0x4 - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - ldr r0, =0x02022fec - ldr r1, [r0] - movs r2, 0x21 - negs r2, r2 - ands r1, r2 - str r1, [r0] - ldr r0, =0x003f0100 - ands r0, r1 - cmp r0, 0 - beq _08038DAC - ldr r0, =0x030022c0 - ldr r0, [r0, 0x8] - bl SetMainCallback2 - bl sub_8057028 - bl dp11_free - bl sub_805F094 - b _08038EB6 - .pool -_08038DAC: - str r0, [sp] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - mov r0, sp - bl CpuSet - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0xF0 - bl SetGpuReg - ldr r4, =0x00005051 - movs r0, 0x44 - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - ldr r1, =0x02022e24 - movs r0, 0xF0 - strh r0, [r1] - ldr r0, =0x02022e26 - strh r4, [r0] - bl dp12_8087EA4 - ldr r0, =0x02038c28 - movs r3, 0xF0 - movs r1, 0xF0 - lsls r1, 3 - adds r2, r0, r1 - movs r1, 0x4F -_08038DFE: - strh r3, [r0] - strh r3, [r2] - adds r2, 0x2 - adds r0, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _08038DFE - movs r1, 0x50 - ldr r0, =0x02038c28 - ldr r3, =0x0000ff10 - movs r4, 0x82 - lsls r4, 4 - adds r2, r0, r4 - adds r0, 0xA0 -_08038E1A: - strh r3, [r0] - strh r3, [r2] - adds r2, 0x2 - adds r0, 0x2 - adds r1, 0x1 - cmp r1, 0x9F - ble _08038E1A - bl sub_80A1A74 - ldr r0, =0x02022e14 - movs r4, 0 - strh r4, [r0] - ldr r0, =0x02022e16 - strh r4, [r0] - ldr r0, =0x02022e18 - strh r4, [r0] - ldr r0, =0x02022e1a - strh r4, [r0] - ldr r0, =0x02022e1c - strh r4, [r0] - ldr r0, =0x02022e1e - strh r4, [r0] - ldr r0, =0x02022e20 - strh r4, [r0] - ldr r0, =0x02022e22 - strh r4, [r0] - bl c2_berry_program_update_menu - ldr r0, =gUnknown_08C004E0 - movs r1, 0 - movs r2, 0x40 - bl decompress_palette - bl sub_803570C - bl ResetAllObjectData - bl ResetTasks - bl sub_8036154 - movs r0, 0x4A - movs r1, 0x37 - bl SetGpuReg - bl ResetObjectPaletteAllocator - ldr r1, =0x0300301c - movs r0, 0x4 - strb r0, [r1] - ldr r0, =vblank_cb_08078BB4 - bl SetVBlankCallback - ldr r0, =task00_0800F6FC - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0x87 - lsls r2, 1 - strh r2, [r1, 0xA] - movs r2, 0x5A - strh r2, [r1, 0xC] - movs r2, 0x1 - strh r2, [r1, 0x12] - bl sub_8038B94 - ldr r0, =sub_8038F14 - bl SetMainCallback2 - ldr r0, =0x02024332 - strb r4, [r0] -_08038EB6: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8038D64 - - thumb_func_start sub_8038F14 -sub_8038F14: @ 8038F14 - push {lr} - bl sub_8038F34 - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - bl RunTasks - pop {r0} - bx r0 - thumb_func_end sub_8038F14 - - thumb_func_start sub_8038F34 -sub_8038F34: @ 8038F34 - push {r4-r6,lr} - sub sp, 0x8 - ldr r0, =0x02024332 - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0x9 - bls _08038F44 - b _080391C6 -_08038F44: - lsls r0, r1, 2 - ldr r1, =_08038F58 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08038F58: - .4byte _08038F80 - .4byte _08038FA0 - .4byte _08038FC2 - .4byte _080390C8 - .4byte _08039100 - .4byte _08039118 - .4byte _0803912C - .4byte _0803914C - .4byte _08039166 - .4byte _08039184 -_08038F80: - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - ldr r1, =0x02024332 - movs r0, 0xFF - strb r0, [r1, 0x1] - b _08039174 - .pool -_08038FA0: - ldrb r0, [r4, 0x1] - subs r0, 0x1 - strb r0, [r4, 0x1] - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _08038FB0 - b _080391C6 -_08038FB0: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _0803910C -_08038FC2: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08038FD0 - b _080391C6 -_08038FD0: - bl sub_8185FAC - ldr r2, =0x030022c0 - ldr r1, =0x00000439 - adds r2, r1 - movs r1, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - movs r3, 0x2 - cmp r0, 0 - beq _08038FFC - movs r3, 0x4 -_08038FFC: - movs r4, 0 - ldr r6, =0x03005d90 - cmp r4, r3 - bge _08039022 - ldr r1, =0x020229e8 - ldrb r0, [r1] - cmp r0, 0x3 - bne _08039022 - movs r5, 0xFF - adds r2, r1, 0 -_08039010: - adds r2, 0x1C - adds r4, 0x1 - cmp r4, r3 - bge _08039022 - ldrh r1, [r2] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0x3 - beq _08039010 -_08039022: - ldr r0, [r6] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - bne _080390AC - cmp r4, r3 - bne _080390AC - ldr r0, =0x000008d2 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08039074 - bl FreeAllWindowBuffers - ldr r0, =sub_80392A8 - bl SetMainCallback2 - b _080391C6 - .pool -_08039074: - ldr r2, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _08039090 - ldr r0, [r2, 0x8] - b _080390B0 - .pool -_08039090: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08039172 - ldr r0, =sub_80B3AF8 - movs r1, 0x5 - bl CreateTask - b _08039172 - .pool -_080390AC: - ldr r0, =0x030022c0 - ldr r0, [r0, 0x8] -_080390B0: - bl SetMainCallback2 - bl sub_8057028 - bl dp11_free - bl sub_805F094 - b _080391C6 - .pool -_080390C8: - movs r0, 0 - str r0, [sp, 0x4] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - add r0, sp, 0x4 - bl CpuSet - movs r4, 0 -_080390DA: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_80363C4 - adds r4, 0x1 - cmp r4, 0x1 - ble _080390DA - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - b _08039172 - .pool -_08039100: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080391C6 -_0803910C: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _080391C6 - .pool -_08039118: - ldr r0, =sub_80B3AF8 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _080391C6 - b _08039172 - .pool -_0803912C: - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080391C6 - bl sub_800ADF8 - ldr r0, =gUnknown_0824978D - movs r1, 0 - bl battle_show_message_maybe - b _08039172 - .pool -_0803914C: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _080391C6 - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080391C6 - b _08039172 -_08039166: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _08039172 - bl sub_800AC34 -_08039172: - ldr r1, =0x02024332 -_08039174: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080391C6 - .pool -_08039184: - ldr r2, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - adds r3, r2, 0 - cmp r0, 0 - beq _080391A6 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _080391A6 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080391C6 -_080391A6: - ldr r0, =0x00000439 - adds r2, r3, r0 - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r0, [r3, 0x8] - bl SetMainCallback2 - bl sub_8057028 - bl dp11_free - bl sub_805F094 -_080391C6: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8038F34 - - thumb_func_start sub_80391E0 -sub_80391E0: @ 80391E0 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0 - cmp r1, 0x6 - bhi _080392A0 - lsls r0, r1, 2 - ldr r1, =_08039200 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08039200: - .4byte _0803921C - .4byte _08039230 - .4byte _08039244 - .4byte _08039258 - .4byte _0803926C - .4byte _08039280 - .4byte _08039294 -_0803921C: - ldr r0, =gUnknown_0831AA08 - lsls r1, r2, 2 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 30 - lsrs r0, 30 - b _080392A0 - .pool -_08039230: - ldr r0, =gUnknown_0831AA08 - lsls r1, r2, 2 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 28 - lsrs r0, 30 - b _080392A0 - .pool -_08039244: - ldr r0, =gUnknown_0831AA08 - lsls r1, r2, 2 - adds r1, r0 - ldrh r0, [r1] - lsls r0, 23 - lsrs r0, 27 - b _080392A0 - .pool -_08039258: - ldr r0, =gUnknown_0831AA08 - lsls r1, r2, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 29 - lsrs r0, 30 - b _080392A0 - .pool -_0803926C: - ldr r0, =gUnknown_0831AA08 - lsls r1, r2, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 28 - lsrs r0, 31 - b _080392A0 - .pool -_08039280: - ldr r0, =gUnknown_0831AA08 - lsls r1, r2, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 26 - lsrs r0, 30 - b _080392A0 - .pool -_08039294: - ldr r0, =gUnknown_0831AA08 - lsls r1, r2, 2 - adds r1, r0 - ldr r0, [r1] - lsls r0, 8 - lsrs r0, 22 -_080392A0: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80391E0 - - thumb_func_start sub_80392A8 -sub_80392A8: @ 80392A8 - push {r4,lr} - sub sp, 0x8 - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - movs r4, 0 - str r4, [sp, 0x4] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - add r0, sp, 0x4 - bl CpuSet - bl sub_80A1A74 - ldr r0, =0x02022e14 - strh r4, [r0] - ldr r0, =0x02022e16 - strh r4, [r0] - ldr r0, =0x02022e18 - strh r4, [r0] - ldr r0, =0x02022e1a - strh r4, [r0] - ldr r0, =0x02022e1c - strh r4, [r0] - ldr r0, =0x02022e1e - strh r4, [r0] - ldr r0, =0x02022e20 - strh r4, [r0] - ldr r0, =0x02022e22 - strh r4, [r0] - bl c2_berry_program_update_menu - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - bl sub_803570C -_080392FE: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_80363C4 - adds r4, 0x1 - cmp r4, 0x1 - ble _080392FE - bl ResetAllObjectData - bl ResetTasks - bl ResetObjectPaletteAllocator - ldr r1, =0x0300301c - movs r0, 0x4 - strb r0, [r1] - ldr r0, =vblank_cb_08078BB4 - bl SetVBlankCallback - ldr r0, =sub_803937C - bl SetMainCallback2 - movs r0, 0x1 - negs r0, r0 - movs r4, 0 - str r4, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =0x02024332 - strb r4, [r0] - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80392A8 - - thumb_func_start sub_803937C -sub_803937C: @ 803937C - push {lr} - bl sub_803939C - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - bl RunTasks - pop {r0} - bx r0 - thumb_func_end sub_803937C - - thumb_func_start sub_803939C -sub_803939C: @ 803939C - push {r4,r5,lr} - sub sp, 0x4 - ldr r0, =0x02024332 - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0xC - bls _080393AC - b _0803975E -_080393AC: - lsls r0, r1, 2 - ldr r1, =_080393C0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080393C0: - .4byte _080393F4 - .4byte _08039414 - .4byte _08039450 - .4byte _08039470 - .4byte _0803949C - .4byte _080394D8 - .4byte _0803957C - .4byte _08039704 - .4byte _080395CC - .4byte _08039610 - .4byte _08039678 - .4byte _080396A8 - .4byte _08039704 -_080393F4: - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - b _0803975C - .pool -_08039414: - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08039434 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08039434 - ldr r0, =sub_80B3AF8 - movs r1, 0x5 - bl CreateTask -_08039434: - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - b _0803975C - .pool -_08039450: - ldr r0, =sub_80B3AF8 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - beq _0803945E - b _0803975E -_0803945E: - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - b _0803975C - .pool -_08039470: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0803947E - b _0803975E -_0803947E: - ldr r0, =gUnknown_085CD28F - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - b _0803975C - .pool -_0803949C: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - beq _080394AC - b _0803975E -_080394AC: - str r0, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - ldr r0, =gUnknown_085CCABB - movs r1, 0xC - bl battle_show_message_maybe - ldr r4, =0x02024332 - movs r0, 0x1 - strb r0, [r4, 0x1] - bl sub_8056B74 - b _080396EA - .pool -_080394D8: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08039500 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _080394EC - b _0803975E -_080394EC: - movs r0, 0x5 - bl audio_play - ldrb r0, [r4, 0x1] - bl sub_8056BAC - movs r0, 0 - b _0803951E - .pool -_08039500: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08039526 - ldrb r0, [r4, 0x1] - cmp r0, 0 - beq _08039510 - b _0803975E -_08039510: - movs r0, 0x5 - bl audio_play - ldrb r0, [r4, 0x1] - bl sub_8056BAC - movs r0, 0x1 -_0803951E: - strb r0, [r4, 0x1] - bl sub_8056B74 - b _0803975E -_08039526: - movs r5, 0x1 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _08039560 - movs r0, 0x5 - bl audio_play - ldr r4, =0x02024332 - ldrb r0, [r4, 0x1] - cmp r0, 0 - beq _08039540 - b _080396EA -_08039540: - str r5, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - bl sub_8185338 - strb r0, [r4, 0x1] - movs r0, 0xA - strb r0, [r4] - b _0803975E - .pool -_08039560: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0803956A - b _0803975E -_0803956A: - movs r0, 0x5 - bl audio_play - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - b _0803975C - .pool -_0803957C: - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0803958A - b _0803975E -_0803958A: - str r0, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080395B4 - bl sub_800ADF8 - ldr r0, =gUnknown_0824978D - movs r1, 0 - bl battle_show_message_maybe -_080395B4: - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - b _0803975C - .pool -_080395CC: - ldrb r0, [r4, 0x1] - subs r0, 0x1 - strb r0, [r4, 0x1] - lsls r0, 24 - cmp r0, 0 - beq _080395DA - b _0803975E -_080395DA: - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080395F6 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _080395F6 - bl sub_800AC34 -_080395F6: - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - b _0803975C - .pool -_08039610: - ldr r2, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - adds r3, r2, 0 - cmp r0, 0 - beq _08039634 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _08039634 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08039634 - b _0803975E -_08039634: - ldr r0, =0x00000439 - adds r2, r3, r0 - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08039650 - b _0803975E -_08039650: - ldr r0, [r3, 0x8] - bl SetMainCallback2 - bl sub_8057028 - bl dp11_free - bl sub_805F094 - b _0803975E - .pool -_08039678: - ldrb r0, [r4, 0x1] - cmp r0, 0x1 - bne _080396A0 - movs r0, 0x37 - bl audio_play - ldr r0, =gUnknown_085CD2CB -_08039686: - bl get_battle_strings_ - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - movs r0, 0x80 - strb r0, [r4, 0x1] - b _080396EA - .pool -_080396A0: - ldr r0, =gUnknown_08242481 - b _08039686 - .pool -_080396A8: - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803975E - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _0803975E - ldr r4, =0x02024332 - ldrb r0, [r4, 0x1] - subs r0, 0x1 - strb r0, [r4, 0x1] - lsls r0, 24 - cmp r0, 0 - bne _0803975E - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080396EA - bl sub_800ADF8 - ldr r0, =gUnknown_0824978D - movs r1, 0 - bl battle_show_message_maybe -_080396EA: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _0803975E - .pool -_08039704: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - bne _0803975E - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _08039744 - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803975E - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - b _0803974A - .pool -_08039744: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] -_0803974A: - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x02024332 - movs r0, 0x20 - strb r0, [r1, 0x1] - movs r0, 0x8 -_0803975C: - strb r0, [r1] -_0803975E: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803939C - - thumb_func_start shedinja_something -shedinja_something: @ 803976C - push {r4,r5,lr} - sub sp, 0x10 - adds r4, r0, 0 - add r5, sp, 0xC - movs r0, 0x1 - strb r0, [r5] - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - ldr r1, =0x0000012f - cmp r0, r1 - bne _080397B4 - adds r0, r4, 0 - movs r1, 0x3 - bl pokemon_getattr - ldrb r1, [r5] - cmp r0, r1 - beq _080397B4 - adds r0, r4, 0 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - ldr r1, =gUnknown_0831ACA0 - mov r0, sp - bl CompareStringWithoutExtendedControlCodes - cmp r0, 0 - bne _080397B4 - adds r0, r4, 0 - movs r1, 0x3 - adds r2, r5, 0 - bl pokemon_setattr -_080397B4: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end shedinja_something - - thumb_func_start sub_80397C4 -sub_80397C4: @ 80397C4 - ldr r2, =gUnknown_0831ABA0 - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - lsls r1, 3 - adds r1, r0 - ldrb r0, [r1, 0x3] - lsls r0, 3 - bx lr - .pool - thumb_func_end sub_80397C4 - - thumb_func_start oac_poke_opponent -oac_poke_opponent: @ 80397DC - push {lr} - sub sp, 0x4 - ldr r1, =sub_803980C - str r1, [r0, 0x1C] - movs r1, 0 - bl StartObjectImageAnimIfDifferent - movs r0, 0x80 - lsls r0, 10 - ldr r1, =0x00002108 - str r1, [sp] - movs r1, 0 - movs r2, 0xA - movs r3, 0xA - bl pal_fade_maybe - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end oac_poke_opponent - - thumb_func_start sub_803980C -sub_803980C: @ 803980C - push {lr} - adds r2, r0, 0 - ldr r0, =0x020243fc - ldrh r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0803982C - ldrh r0, [r2, 0x24] - adds r0, 0x2 - strh r0, [r2, 0x24] - lsls r0, 16 - cmp r0, 0 - bne _0803982C - ldr r0, =sub_8039838 - str r0, [r2, 0x1C] -_0803982C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_803980C - - thumb_func_start sub_8039838 -sub_8039838: @ 8039838 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08039880 - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r0, 24 - bl sub_8076918 - ldr r1, =0x03005d70 - movs r2, 0x2E - ldrsh r0, [r4, r2] - adds r0, r1 - ldrb r0, [r0] - bl sub_80729D0 - ldr r0, =sub_8039894 - str r0, [r4, 0x1C] - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnimIfDifferent - movs r0, 0x80 - lsls r0, 10 - ldr r1, =0x00002108 - str r1, [sp] - movs r1, 0 - movs r2, 0xA - movs r3, 0 - bl pal_fade_maybe -_08039880: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039838 - - thumb_func_start sub_8039894 -sub_8039894: @ 8039894 - push {lr} - adds r2, r0, 0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080398B0 - ldrh r1, [r2, 0x32] - adds r0, r2, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_806ECEC -_080398B0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039894 - - thumb_func_start nullsub_18 -nullsub_18: @ 80398B8 - bx lr - thumb_func_end nullsub_18 - - thumb_func_start sub_80398BC -sub_80398BC: @ 80398BC - movs r1, 0x6 - strh r1, [r0, 0x34] - movs r1, 0x1 - strh r1, [r0, 0x36] - ldr r1, =sub_80398D0 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_80398BC - - thumb_func_start sub_80398D0 -sub_80398D0: @ 80398D0 - push {r4,lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x36] - subs r0, 0x1 - strh r0, [r3, 0x36] - lsls r0, 16 - cmp r0, 0 - bne _08039924 - movs r0, 0x8 - strh r0, [r3, 0x36] - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r4, 0x5 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - ldrh r0, [r3, 0x34] - subs r0, 0x1 - strh r0, [r3, 0x34] - lsls r0, 16 - asrs r2, r0, 16 - cmp r2, 0 - bne _08039924 - ldrb r1, [r1] - adds r0, r4, 0 - ands r0, r1 - mov r1, r12 - strb r0, [r1] - ldr r0, =nullsub_18 - str r0, [r3, 0x1C] - ldr r0, =0x02022f88 - str r2, [r0] -_08039924: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80398D0 - - thumb_func_start sub_8039934 -sub_8039934: @ 8039934 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r9, r0 - ldrh r0, [r0, 0x2E] - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r6, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - beq _0803995C - adds r4, r0, 0 - b _08039960 - .pool -_0803995C: - mov r0, r9 - ldrh r4, [r0, 0x32] -_08039960: - ldr r1, =0x0202406e - lsls r0, r6, 1 - adds r5, r0, r1 - ldrh r0, [r5] - movs r1, 0x64 - mov r8, r1 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - ldr r7, =0x02024744 - adds r0, r7 - movs r1, 0 - bl pokemon_getattr - cmp r4, 0xC9 - bne _080399E4 - ldrh r0, [r5] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r7 - movs r1, 0 - bl pokemon_getattr - adds r2, r0, 0 - movs r0, 0xC0 - lsls r0, 18 - ands r0, r2 - lsrs r0, 18 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r2 - lsrs r1, 12 - orrs r0, r1 - movs r1, 0xC0 - lsls r1, 2 - ands r1, r2 - lsrs r1, 6 - orrs r0, r1 - movs r1, 0x3 - ands r1, r2 - orrs r0, r1 - movs r1, 0x1C - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _080399D0 - movs r0, 0xC9 - b _080399DA - .pool -_080399D0: - movs r1, 0xCE - lsls r1, 1 - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 -_080399DA: - ldr r1, =gUnknown_08300D38 - lsls r0, 2 - b _08039A1C - .pool -_080399E4: - ldr r0, =0x00000181 - cmp r4, r0 - bne _08039A08 - ldr r0, =gUnknown_08525F78 - ldr r1, =0x020244e4 - adds r1, r6, r1 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - b _08039A20 - .pool -_08039A08: - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - bls _08039A18 - ldr r0, =gUnknown_08300D38 - b _08039A1E - .pool -_08039A18: - ldr r1, =gUnknown_08300D38 - lsls r0, r4, 2 -_08039A1C: - adds r0, r1 -_08039A1E: - ldrb r0, [r0, 0x1] -_08039A20: - lsrs r1, r0, 3 - movs r0, 0x8 - subs r0, r1 - mov r1, r9 - strh r0, [r1, 0x34] - movs r0, 0x1 - strh r0, [r1, 0x36] - ldr r0, =sub_8039A48 - str r0, [r1, 0x1C] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039934 - - thumb_func_start sub_8039A48 -sub_8039A48: @ 8039A48 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x36] - subs r0, 0x1 - strh r0, [r4, 0x36] - lsls r0, 16 - cmp r0, 0 - bne _08039AC8 - movs r0, 0x2 - strh r0, [r4, 0x36] - ldrh r0, [r4, 0x26] - adds r0, 0x8 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x34] - subs r0, 0x1 - strh r0, [r4, 0x34] - lsls r0, 16 - cmp r0, 0 - bge _08039A7C - adds r0, r4, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - b _08039AC8 -_08039A7C: - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r0, 24 - bl battle_get_per_side_status - ldr r1, =0x020244d4 - ldr r1, [r1] - lsls r0, 24 - lsrs r0, 22 - adds r1, 0x4 - adds r1, r0 - ldr r2, =0x020244e4 - movs r3, 0x2E - ldrsh r0, [r4, r3] - adds r0, r2 - ldrb r0, [r0] - lsls r0, 11 - ldr r1, [r1] - adds r1, r0 - movs r2, 0x34 - ldrsh r0, [r4, r2] - lsls r0, 8 - adds r1, r0 - movs r2, 0 - movs r0, 0xFF -_08039AAE: - strb r2, [r1] - adds r1, 0x1 - subs r0, 0x1 - cmp r0, 0 - bge _08039AAE - ldr r0, =0x020244e4 - movs r3, 0x2E - ldrsh r1, [r4, r3] - adds r1, r0 - ldrb r1, [r1] - adds r0, r4, 0 - bl StartObjectImageAnim -_08039AC8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039A48 - - thumb_func_start sub_8039AD8 -sub_8039AD8: @ 8039AD8 - movs r1, 0x8 - strh r1, [r0, 0x34] - adds r1, r0, 0 - adds r1, 0x3E - ldrb r1, [r1] - lsls r1, 29 - lsrs r1, 31 - strh r1, [r0, 0x36] - ldr r1, =sub_8039AF4 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_8039AD8 - - thumb_func_start sub_8039AF4 -sub_8039AF4: @ 8039AF4 - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x34] - subs r0, 0x1 - strh r0, [r3, 0x34] - lsls r0, 16 - cmp r0, 0 - bne _08039B26 - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - 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 - mov r1, r12 - strb r0, [r1] - movs r0, 0x8 - strh r0, [r3, 0x34] -_08039B26: - pop {r0} - bx r0 - thumb_func_end sub_8039AF4 - - thumb_func_start sub_8039B2C -sub_8039B2C: @ 8039B2C - movs r1, 0x3E - adds r1, r0 - mov r12, r1 - movs r1, 0x1 - ldrh r2, [r0, 0x36] - ands r2, r1 - lsls r2, 2 - mov r1, r12 - ldrb r3, [r1] - movs r1, 0x5 - negs r1, r1 - ands r1, r3 - orrs r1, r2 - mov r2, r12 - strb r1, [r2] - movs r1, 0 - strh r1, [r0, 0x36] - ldr r1, =nullsub_18 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_8039B2C - - thumb_func_start sub_8039B58 -sub_8039B58: @ 8039B58 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08039BA0 - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08039B80 - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x02000002 - ands r0, r1 - cmp r0, 0 - beq _08039B94 -_08039B80: - ldrh r0, [r4, 0x32] - bl sub_806F0D4 - lsls r0, 24 - cmp r0, 0 - beq _08039B94 - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnim -_08039B94: - ldrh r1, [r4, 0x32] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x1 - bl sub_806ECEC -_08039BA0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039B58 - - thumb_func_start sub_8039BB4 -sub_8039BB4: @ 8039BB4 - ldr r1, =oac_poke_ally_ - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_8039BB4 - - thumb_func_start oac_poke_ally_ -oac_poke_ally_: @ 8039BC0 - push {lr} - adds r2, r0, 0 - ldr r0, =0x020243fc - ldrh r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08039BE4 - ldrh r0, [r2, 0x24] - subs r0, 0x2 - strh r0, [r2, 0x24] - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0 - bne _08039BE4 - ldr r0, =nullsub_19 - str r0, [r2, 0x1C] - strh r1, [r2, 0x30] -_08039BE4: - pop {r0} - bx r0 - .pool - thumb_func_end oac_poke_ally_ - - thumb_func_start sub_8039BF0 -sub_8039BF0: @ 8039BF0 - ldr r1, =nullsub_19 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_8039BF0 - - thumb_func_start nullsub_19 -nullsub_19: @ 8039BFC - bx lr - thumb_func_end nullsub_19 - - thumb_func_start sub_8039C00 -sub_8039C00: @ 8039C00 - push {lr} - adds r2, r0, 0 - ldr r0, =0x020243fc - ldrh r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08039C20 - ldrh r0, [r2, 0x30] - ldrh r1, [r2, 0x24] - adds r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x32] - ldrh r1, [r2, 0x26] - adds r0, r1 - strh r0, [r2, 0x26] -_08039C20: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039C00 - - thumb_func_start dp11b_obj_instanciate -dp11b_obj_instanciate: @ 8039C28 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r3, 24 - mov r10, r3 - cmp r1, 0 - beq _08039C64 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r2, r4, 1 - adds r0, r2, r4 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - b _08039C76 - .pool -_08039C64: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r2, r4, 1 - adds r0, r2, r4 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 -_08039C76: - ands r0, r1 - adds r6, r2, 0 - cmp r0, 0 - bne _08039D2C - ldr r0, =objc_dp11b_pingpong - bl object_new_hidden_with_callback - lsls r0, 24 - lsrs r5, r0, 24 - mov r0, r8 - cmp r0, 0x1 - bne _08039CD0 - ldr r0, =0x03005d70 - adds r0, r4, r0 - ldrb r7, [r0] - ldr r2, =0x020244d0 - ldr r0, [r2] - ldr r0, [r0, 0x4] - adds r1, r6, r4 - lsls r1, 2 - adds r0, r1, r0 - strb r5, [r0, 0x2] - ldr r0, [r2] - ldr r0, [r0, 0x4] - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r1] - ldr r2, =0x02020630 - lsls r3, r5, 4 - adds r0, r3, r5 - lsls r0, 2 - adds r0, r2 - movs r1, 0x80 - b _08039CFE - .pool -_08039CD0: - ldr r0, =0x020241e4 - adds r0, r4, r0 - ldrb r7, [r0] - ldr r2, =0x020244d0 - ldr r0, [r2] - ldr r0, [r0, 0x4] - adds r1, r6, r4 - lsls r1, 2 - adds r0, r1, r0 - strb r5, [r0, 0x3] - ldr r0, [r2] - ldr r0, [r0, 0x4] - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - ldr r2, =0x02020630 - lsls r3, r5, 4 - adds r0, r3, r5 - lsls r0, 2 - adds r0, r2 - movs r1, 0xC0 -_08039CFE: - strh r1, [r0, 0x2E] - adds r4, r2, 0 - adds r1, r3, r5 - lsls r1, 2 - adds r1, r4 - mov r2, r9 - lsls r0, r2, 24 - asrs r0, 24 - movs r2, 0 - strh r0, [r1, 0x30] - mov r3, r10 - lsls r0, r3, 24 - asrs r0, 24 - strh r0, [r1, 0x32] - strh r7, [r1, 0x34] - mov r0, r8 - strh r0, [r1, 0x36] - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r0, r4 - strh r2, [r0, 0x24] - strh r2, [r0, 0x26] -_08039D2C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp11b_obj_instanciate - - thumb_func_start dp11b_obj_free -dp11b_obj_free: @ 8039D48 - push {r4-r6,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x1 - bne _08039D9C - ldr r6, =0x020244d0 - ldr r0, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r5, r0, 2 - adds r3, r5, r1 - ldrb r1, [r3] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08039DEA - ldr r2, =0x02020630 - ldrb r1, [r3, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x34] - lsls r1, 24 - lsrs r4, r1, 24 - bl RemoveObjectAndFreeTiles - ldr r0, [r6] - ldr r1, [r0, 0x4] - adds r1, r5, r1 - ldrb r2, [r1] - movs r0, 0x3 - negs r0, r0 - b _08039DD6 - .pool -_08039D9C: - ldr r6, =0x020244d0 - ldr r0, [r6] - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r5, r0, 2 - adds r3, r5, r1 - ldrb r1, [r3] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08039DEA - ldr r2, =0x02020630 - ldrb r1, [r3, 0x3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x34] - lsls r1, 24 - lsrs r4, r1, 24 - bl RemoveObjectAndFreeTiles - ldr r0, [r6] - ldr r1, [r0, 0x4] - adds r1, r5, r1 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 -_08039DD6: - ands r0, r2 - strb r0, [r1] - ldr r0, =0x02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - movs r0, 0 - strh r0, [r1, 0x24] - strh r0, [r1, 0x26] -_08039DEA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end dp11b_obj_free - - thumb_func_start objc_dp11b_pingpong -objc_dp11b_pingpong: @ 8039DF8 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x34] - lsls r0, 24 - lsrs r5, r0, 24 - movs r1, 0x36 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _08039E10 - movs r2, 0x2E - ldrsh r0, [r4, r2] - b _08039E14 -_08039E10: - movs r1, 0x2E - ldrsh r0, [r4, r1] -_08039E14: - movs r2, 0x32 - ldrsh r1, [r4, r2] - bl sine - ldr r2, =0x02020630 - lsls r1, r5, 4 - adds r1, r5 - lsls r1, 2 - adds r1, r2 - ldrh r2, [r4, 0x32] - adds r0, r2 - strh r0, [r1, 0x26] - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x2E] - adds r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x2E] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end objc_dp11b_pingpong - - thumb_func_start sub_8039E44 -sub_8039E44: @ 8039E44 - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08039E5C - ldrh r1, [r2, 0x32] - adds r0, r2, 0 - bl sub_806EEB4 -_08039E5C: - pop {r0} - bx r0 - thumb_func_end sub_8039E44 - - thumb_func_start sub_8039E60 -sub_8039E60: @ 8039E60 - push {r4,lr} - adds r4, r0, 0 - bl sub_8039E9C - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08039E7A - ldr r0, =nullsub_19 - str r0, [r4, 0x1C] -_08039E7A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039E60 - - thumb_func_start sub_8039E84 -sub_8039E84: @ 8039E84 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl StartObjectImageAnim - ldr r0, =sub_8039E60 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039E84 - - thumb_func_start sub_8039E9C -sub_8039E9C: @ 8039E9C - push {lr} - adds r2, r0, 0 - adds r0, 0x2C - ldrb r1, [r0] - movs r0, 0x3F - ands r0, r1 - cmp r0, 0 - bne _08039EBE - ldr r1, =gUnknown_0831ACE0 - adds r0, r2, 0 - adds r0, 0x2B - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - adds r0, r2, 0 - adds r0, 0x28 - strb r1, [r0] -_08039EBE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039E9C - - thumb_func_start nullsub_20 -nullsub_20: @ 8039EC8 - bx lr - thumb_func_end nullsub_20 - - thumb_func_start sub_8039ECC -sub_8039ECC: @ 8039ECC - push {lr} - bl sub_8039F40 - ldr r1, =0x02024332 - movs r0, 0 - strb r0, [r1, 0x1] - ldr r1, =0x03005d04 - ldr r0, =bc_8012FAC - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039ECC - - thumb_func_start sub_8039EF0 -sub_8039EF0: @ 8039EF0 - push {r4,r5,lr} - ldr r0, =0x03005d04 - ldr r0, [r0] - bl _call_via_r0 - ldr r1, =0x02024064 - movs r0, 0 - strb r0, [r1] - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r0, 0 - beq _08039F2A - ldr r5, =0x03005d60 - adds r4, r1, 0 -_08039F0C: - ldrb r0, [r4] - lsls r0, 2 - adds r0, r5 - ldr r0, [r0] - bl _call_via_r0 - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _08039F0C -_08039F2A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8039EF0 - - thumb_func_start sub_8039F40 -sub_8039F40: @ 8039F40 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r0, 0 - bl sub_803D580 - bl sub_803D6A0 - movs r2, 0 - movs r3, 0 - ldr r0, =0x02024260 - mov r10, r0 - ldr r1, =0x02024258 - mov r9, r1 - ldr r0, =0x02024250 - mov r8, r0 - ldr r1, =0x02024248 - mov r12, r1 - ldr r5, =0x020242bc - movs r4, 0 - ldr r7, =0x02024240 - ldr r6, =0x02024268 -_08039F70: - ldr r0, =0x020242ac - adds r0, r4, r0 - str r3, [r0] - movs r1, 0 -_08039F78: - adds r0, r5, r1 - strb r3, [r0] - adds r1, 0x1 - cmp r1, 0x1B - bls _08039F78 - movs r0, 0x2 - strb r0, [r5, 0x16] - ldr r1, =0x02024284 - adds r0, r2, r1 - strb r3, [r0] - mov r0, r12 - strh r3, [r0] - mov r1, r8 - strh r3, [r1] - mov r0, r9 - strh r3, [r0] - mov r1, r10 - strh r3, [r1] - ldr r0, =0x02024270 - adds r1, r2, r0 - movs r0, 0xFF - strb r0, [r1] - strh r3, [r6] - strh r3, [r7] - ldr r1, =0x020244a8 - ldr r0, [r1] - ldr r0, [r0, 0x4] - adds r0, r4 - str r3, [r0] - ldr r1, =0x02024230 - adds r0, r4, r1 - str r3, [r0] - movs r0, 0x2 - add r10, r0 - add r9, r0 - add r8, r0 - add r12, r0 - adds r5, 0x1C - adds r4, 0x4 - adds r7, 0x2 - adds r6, 0x2 - adds r2, 0x1 - cmp r2, 0x3 - ble _08039F70 - movs r5, 0 - ldr r3, =0x02024294 - ldr r4, =0x0202428e - movs r2, 0x1 -_08039FD8: - strh r5, [r4] - movs r1, 0 -_08039FDC: - adds r0, r3, r1 - strb r5, [r0] - adds r1, 0x1 - cmp r1, 0xB - bls _08039FDC - adds r3, 0xC - adds r4, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _08039FD8 - movs r1, 0 - ldr r2, =0x0202420b - strb r1, [r2] - ldr r0, =0x0202420c - strb r1, [r0] - ldr r2, =0x020243cc - strh r1, [r2] - ldr r1, =0x020243d0 - movs r2, 0 - movs r3, 0 -_0803A004: - adds r0, r1, r2 - strb r3, [r0] - adds r2, 0x1 - cmp r2, 0x2B - bls _0803A004 - ldr r2, =0x02024280 - movs r0, 0 - str r0, [r2] - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - bne _0803A090 - movs r0, 0x2 - ands r1, r0 - cmp r1, 0 - bne _0803A0AE - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r1, [r0, 0x15] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0803A0AE - movs r0, 0x80 - b _0803A0AC - .pool -_0803A090: - ldr r0, =0x02000002 - ands r1, r0 - cmp r1, 0 - bne _0803A0AE - bl sub_8185FB8 - lsls r0, 24 - cmp r0, 0 - beq _0803A0AE - ldr r1, =0x02024280 - ldr r0, [r1] - movs r1, 0x80 - orrs r0, r1 - ldr r2, =0x02024280 -_0803A0AC: - str r0, [r2] -_0803A0AE: - ldr r3, =0x02024474 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x15] - lsls r0, 30 - lsrs r0, 31 - movs r1, 0 - strb r0, [r3, 0x1D] - ldr r0, =0x02024212 - strb r1, [r0] - ldr r0, =0x0202433a - strb r1, [r0] - ldr r0, =0x02024068 - str r1, [r0] - ldr r0, =0x0202432e - movs r2, 0 - strh r1, [r0] - ldr r1, =0x020244a8 - ldr r0, [r1] - ldr r0, [r0, 0x8] - adds r0, 0x20 - strb r2, [r0] - ldr r0, [r1] - ldr r0, [r0, 0xC] - adds r0, 0x20 - strb r2, [r0] - ldr r5, =0x0202432c - ldr r6, =0x020241f0 - ldr r7, =0x020243fc - ldr r0, =0x03005d54 - mov r8, r0 - ldr r1, =0x02024210 - mov r9, r1 - ldr r2, =0x02024744 - mov r10, r2 - ldr r1, =0x02024332 - movs r2, 0 - adds r0, r1, 0x7 -_0803A0FA: - strb r2, [r0] - subs r0, 0x1 - cmp r0, r1 - bge _0803A0FA - movs r4, 0 - strh r4, [r5] - movs r0, 0 - str r0, [r6] - strh r0, [r7] - strb r4, [r3, 0x18] - strb r4, [r3, 0x19] - mov r0, r8 - strb r4, [r0] - mov r1, r9 - strb r4, [r1] - ldr r5, =0x0202449c - ldr r0, [r5] - adds r0, 0x6C - strb r4, [r0] - ldr r0, [r5] - adds r0, 0x79 - strb r4, [r0] - ldr r0, [r5] - adds r0, 0x7A - strb r4, [r0] - mov r0, r10 - movs r1, 0xB - bl pokemon_getattr - ldr r6, [r5] - adds r6, 0x7C - ldr r2, =gBaseStats - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1, 0x8] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x000004fb - bl __divsi3 - strb r0, [r6] - ldr r0, [r5] - adds r0, 0x7B - movs r1, 0x3 - strb r1, [r0] - ldr r0, [r5] - strb r4, [r0, 0x12] - ldr r0, [r5] - adds r0, 0x4A - movs r1, 0x1 - strb r1, [r0] - movs r2, 0 - movs r1, 0 - adds r6, r5, 0 -_0803A16A: - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0x98 - strb r1, [r0] - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0xB8 - strb r1, [r0] - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0xC8 - strb r1, [r0] - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0xD0 - strb r1, [r0] - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0xE0 - strb r1, [r0] - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0xE8 - strb r1, [r0] - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0xF0 - strb r1, [r0] - ldr r0, [r5] - adds r0, r2, r0 - adds r0, 0xF8 - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x7 - ble _0803A16A - movs r2, 0 - ldr r4, =0x0202449c - movs r3, 0xA5 - lsls r3, 2 - movs r1, 0x6 -_0803A1BA: - ldr r0, [r4] - adds r0, r2, r0 - adds r0, r3 - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x3 - ble _0803A1BA - ldr r0, [r6] - adds r0, 0xDF - movs r1, 0 - strb r1, [r0] - ldr r0, [r6] - adds r0, 0x92 - strb r1, [r0] - bl GenerateRandomNumber - ldr r1, =0x02024330 - strh r0, [r1] - ldr r1, =0x03005d10 - movs r2, 0 - movs r3, 0 -_0803A1E4: - adds r0, r1, r2 - strb r3, [r0] - adds r2, 0x1 - cmp r2, 0x43 - bls _0803A1E4 - ldr r0, =0x02024744 - bl sub_806EBA4 - ldr r3, =0x03005d10 - movs r1, 0x1 - ands r1, r0 - lsls r1, 6 - ldrb r2, [r3, 0x5] - movs r0, 0x41 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x5] - ldr r2, =0x0202449c - ldr r0, [r2] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - ldr r2, =0x000002a1 - adds r0, r2 - strb 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_8039F40 - - thumb_func_start sub_803A284 -sub_803A284: @ 803A284 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - ldr r4, =0x020242bc - ldr r5, =0x02024064 - ldrb r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - mov r1, sp - adds r0, r4 - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldr r0, [r0] - str r0, [r1] - ldr r2, =gBattleMoves - ldr r3, =0x020241ea - ldrh r1, [r3] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - mov r12, r4 - mov r9, r5 - ldr r6, =0x020242ac - mov r10, r6 - cmp r0, 0x7F - beq _0803A35C - movs r5, 0 - mov r6, r9 - movs r4, 0x58 - ldr r2, =0x02024084 - adds r2, 0x18 - movs r1, 0x6 -_0803A2D4: - ldrb r0, [r6] - muls r0, r4 - adds r0, r5, r0 - adds r0, r2 - strb r1, [r0] - adds r5, 0x1 - cmp r5, 0x7 - ble _0803A2D4 - movs r5, 0 - ldr r7, =0x0202406c - ldrb r7, [r7] - cmp r5, r7 - bge _0803A348 - ldr r0, =0x020240d4 - mov r8, r0 - ldr r4, =0x020242bc - ldr r3, =0x020242ac -_0803A2F6: - movs r0, 0x58 - muls r0, r5 - mov r1, r8 - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0x80 - lsls r0, 19 - ands r0, r1 - cmp r0, 0 - beq _0803A31A - ldrb r0, [r4, 0x14] - ldr r6, =0x02024064 - ldrb r6, [r6] - cmp r0, r6 - bne _0803A31A - ldr r0, =0xfbffffff - ands r1, r0 - str r1, [r2] -_0803A31A: - ldr r1, [r3] - movs r0, 0x18 - ands r0, r1 - cmp r0, 0 - beq _0803A33A - ldrb r0, [r4, 0x15] - ldr r7, =0x02024064 - ldrb r7, [r7] - cmp r0, r7 - bne _0803A33A - movs r0, 0x19 - negs r0, r0 - ands r1, r0 - str r1, [r3] - movs r0, 0 - strb r0, [r4, 0x15] -_0803A33A: - adds r4, 0x1C - adds r3, 0x4 - adds r5, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - blt _0803A2F6 -_0803A348: - ldr r1, =0x020241ea - ldrh r0, [r1] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - ldr r2, =gBattleMoves - adds r1, r2 - ldrb r0, [r1] - cmp r0, 0x7F - bne _0803A414 -_0803A35C: - mov r3, r9 - ldrb r1, [r3] - movs r0, 0x58 - adds r2, r1, 0 - muls r2, r0 - ldr r0, =0x02024084 - adds r0, 0x50 - adds r2, r0 - ldr r0, [r2] - ldr r1, =0x15100007 - ands r0, r1 - str r0, [r2] - ldrb r1, [r3] - lsls r1, 2 - add r1, r10 - ldr r0, [r1] - ldr r2, =0x0003043f - ands r0, r2 - str r0, [r1] - movs r5, 0 - ldr r6, =0x0202406c - ldrb r6, [r6] - cmp r5, r6 - bge _0803A430 - mov r7, r9 - movs r6, 0 -_0803A390: - ldrb r0, [r7] - bl battle_side_get_owner - adds r4, r0, 0 - lsls r0, r5, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _0803A3D0 - ldr r1, =0x020242ac - lsls r0, r5, 2 - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0x18 - ands r0, r1 - cmp r0, 0 - beq _0803A3D0 - ldr r0, =0x020242bc - adds r0, r6, r0 - ldrb r0, [r0, 0x15] - ldrb r3, [r7] - cmp r0, r3 - bne _0803A3D0 - movs r0, 0x19 - negs r0, r0 - ands r1, r0 - movs r0, 0x10 - orrs r1, r0 - str r1, [r2] -_0803A3D0: - adds r6, 0x1C - adds r5, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - blt _0803A390 - ldr r6, =0x020242bc - mov r12, r6 - ldr r7, =0x02024064 - mov r9, r7 - b _0803A430 - .pool -_0803A414: - mov r0, r9 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - ldr r1, =0x02024084 - adds r1, 0x50 - adds r0, r1 - movs r1, 0 - str r1, [r0] - mov r2, r9 - ldrb r0, [r2] - lsls r0, 2 - add r0, r10 - str r1, [r0] -_0803A430: - movs r5, 0 - ldr r3, =0x0202449c - mov r8, r3 - ldr r6, =0x020244ac - mov r10, r6 - ldr r7, =0x0202406c - ldrb r7, [r7] - cmp r5, r7 - bge _0803A490 - ldr r3, =0x020240d4 - ldr r7, =gUnknown_0832A328 - ldr r6, =0x02024064 -_0803A448: - movs r0, 0x58 - muls r0, r5 - adds r4, r0, r3 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r7 - ldr r0, [r0] - lsls r2, r0, 16 - ldr r1, [r4] - adds r0, r1, 0 - ands r0, r2 - cmp r0, 0 - beq _0803A466 - bics r1, r2 - str r1, [r4] -_0803A466: - ldr r1, [r4] - movs r0, 0xE0 - lsls r0, 8 - ands r0, r1 - cmp r0, 0 - beq _0803A486 - mov r2, r8 - ldr r0, [r2] - adds r0, r5, r0 - ldrb r0, [r0, 0x14] - ldrb r2, [r6] - cmp r0, r2 - bne _0803A486 - ldr r0, =0xffff1fff - ands r1, r0 - str r1, [r4] -_0803A486: - adds r5, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - blt _0803A448 -_0803A490: - mov r1, r9 - ldrb r0, [r1] - add r0, r10 - movs r1, 0 - strb r1, [r0] - mov r2, r9 - ldrb r0, [r2] - ldr r3, =0x020244b0 - adds r0, r3 - strb r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - mov r6, r12 - adds r1, r0, r6 - movs r5, 0 - movs r2, 0 -_0803A4B4: - adds r0, r1, r5 - strb r2, [r0] - adds r5, 0x1 - cmp r5, 0x1B - bls _0803A4B4 - ldr r7, =0x020241ea - ldrh r0, [r7] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - ldr r0, =gBattleMoves - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x7F - bne _0803A540 - mov r2, r9 - ldrb r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - mov r1, sp - ldrb r1, [r1, 0xA] - strb r1, [r0, 0xA] - ldrb r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - mov r1, sp - ldrb r1, [r1, 0x15] - strb r1, [r0, 0x15] - ldrb r0, [r2] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - add r1, r12 - mov r0, sp - ldrb r2, [r0, 0xF] - lsls r2, 28 - movs r4, 0xF - lsrs r2, 28 - ldrb r3, [r1, 0xF] - movs r0, 0x10 - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0xF] - mov r3, r9 - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - mov r1, sp - ldrb r1, [r1, 0xF] - lsrs r1, 4 - lsls r1, 4 - ldrb r2, [r0, 0xF] - ands r4, r2 - orrs r4, r1 - strb r4, [r0, 0xF] - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - mov r1, sp - ldrb r1, [r1, 0x14] - strb r1, [r0, 0x14] -_0803A540: - movs r0, 0 - ldr r6, =0x0202427c - strb r0, [r6] - mov r7, r9 - ldrb r1, [r7] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - movs r4, 0 - movs r1, 0x2 - strb r1, [r0, 0x16] - ldrb r0, [r7] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - add r1, r12 - mov r0, sp - ldrb r0, [r0, 0x18] - movs r2, 0x2 - ands r2, r0 - ldrb r3, [r1, 0x18] - movs r0, 0x3 - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x18] - ldrb r0, [r7] - lsls r0, 1 - ldr r1, =0x02024248 - adds r0, r1 - movs r2, 0 - strh r4, [r0] - ldrb r0, [r7] - lsls r0, 1 - ldr r3, =0x02024250 - adds r0, r3 - strh r4, [r0] - ldrb r0, [r7] - lsls r0, 1 - ldr r6, =0x02024258 - adds r0, r6 - strh r4, [r0] - ldrb r0, [r7] - lsls r0, 1 - ldr r7, =0x02024260 - adds r0, r7 - strh r4, [r0] - mov r1, r9 - ldrb r0, [r1] - lsls r0, 1 - ldr r3, =0x02024240 - adds r0, r3 - strh r4, [r0] - ldrb r0, [r1] - ldr r6, =0x02024270 - adds r0, r6 - movs r1, 0xFF - strb r1, [r0] - mov r7, r9 - ldrb r0, [r7] - mov r3, r8 - ldr r1, [r3] - lsls r0, 1 - adds r0, r1 - adds r0, 0x98 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 1 - adds r0, r1 - adds r0, 0x99 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE0 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE1 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE2 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE3 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE4 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE5 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE6 - strb r2, [r0] - ldrb r0, [r7] - ldr r1, [r3] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE7 - strb r2, [r0] - ldr r1, [r3] - adds r1, 0x92 - ldrb r0, [r7] - lsls r0, 2 - ldr r6, =gUnknown_0832A328 - adds r0, r6 - ldr r2, [r0] - ldrb r0, [r1] - bics r0, r2 - strb r0, [r1] - movs r5, 0 - ldr r7, =0x0202406c - ldrb r7, [r7] - cmp r5, r7 - bge _0803A6B4 - mov r3, r9 - mov r7, r8 - movs r6, 0 -_0803A656: - ldrb r0, [r3] - cmp r5, r0 - beq _0803A68C - lsls r0, r5, 24 - lsrs r0, 24 - str r3, [sp, 0x1C] - bl battle_side_get_owner - adds r4, r0, 0 - ldr r3, [sp, 0x1C] - ldrb r0, [r3] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - ldr r3, [sp, 0x1C] - cmp r4, r0 - beq _0803A68C - ldr r0, [r7] - lsls r1, r5, 1 - adds r0, r1, r0 - adds r0, 0x98 - strb r6, [r0] - ldr r0, [r7] - adds r1, r0 - adds r1, 0x99 - strb r6, [r1] -_0803A68C: - ldrb r0, [r3] - ldr r1, [r7] - lsls r0, 1 - lsls r2, r5, 3 - adds r0, r2 - adds r0, r1 - adds r0, 0xE0 - strb r6, [r0] - ldrb r0, [r3] - ldr r1, [r7] - lsls r0, 1 - adds r0, r2 - adds r0, r1 - adds r0, 0xE1 - strb r6, [r0] - adds r5, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - blt _0803A656 -_0803A6B4: - mov r1, r9 - ldrb r0, [r1] - mov r2, r8 - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC8 - movs r2, 0 - strb r2, [r0] - mov r3, r9 - ldrb r0, [r3] - mov r6, r8 - ldr r1, [r6] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC9 - strb r2, [r0] - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x4] - ldrb r0, [r3] - lsls r0, 2 - adds r1, r0 - movs r2, 0 - str r2, [r1] - ldr r0, =0x020241ea - strh r2, [r0] - ldr r0, [r6] - adds r0, 0xDA - movs r1, 0xFF - strb r1, [r0] - ldrb r0, [r3] - bl sub_81310F0 - mov r7, r9 - ldrb r0, [r7] - bl sub_8131130 - 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_803A284 - - thumb_func_start sub_803A75C -sub_803A75C: @ 803A75C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r5, 0 - ldr r6, =0x02024084 - ldr r0, =0x020242ac - mov r8, r0 - ldr r1, =0x0202449c - mov r12, r1 - ldr r2, =0x020244ac - mov r9, r2 - ldr r3, =0x020244b0 - mov r10, r3 - ldr r7, =0x0202433c - ldr r4, =0x02024064 - movs r3, 0x58 - adds r2, r6, 0 - adds r2, 0x18 - movs r1, 0x6 -_0803A788: - ldrb r0, [r4] - muls r0, r3 - adds r0, r5, r0 - adds r0, r2 - strb r1, [r0] - adds r5, 0x1 - cmp r5, 0x7 - ble _0803A788 - ldr r0, =0x02024064 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r2, r6, 0 - adds r2, 0x50 - adds r0, r2 - movs r1, 0 - str r1, [r0] - ldr r3, =0x02024064 - ldrb r0, [r3] - lsls r0, 2 - add r0, r8 - str r1, [r0] - movs r5, 0 - ldr r6, =0x0202406c - ldrb r6, [r6] - cmp r5, r6 - bge _0803A830 - adds r3, r2, 0 - movs r4, 0 - ldr r0, =gUnknown_0832A328 - mov r8, r0 -_0803A7C6: - ldr r1, [r3] - movs r0, 0x80 - lsls r0, 19 - ands r0, r1 - cmp r0, 0 - beq _0803A7E6 - ldr r2, =0x020242bc - adds r0, r4, r2 - ldrb r0, [r0, 0x14] - ldr r6, =0x02024064 - ldrb r6, [r6] - cmp r0, r6 - bne _0803A7E6 - ldr r0, =0xfbffffff - ands r1, r0 - str r1, [r3] -_0803A7E6: - ldr r1, =0x02024064 - ldrb r0, [r1] - lsls r0, 2 - add r0, r8 - ldr r0, [r0] - lsls r2, r0, 16 - ldr r1, [r3] - adds r0, r1, 0 - ands r0, r2 - cmp r0, 0 - beq _0803A800 - bics r1, r2 - str r1, [r3] -_0803A800: - ldr r1, [r3] - movs r0, 0xE0 - lsls r0, 8 - ands r0, r1 - cmp r0, 0 - beq _0803A822 - mov r2, r12 - ldr r0, [r2] - adds r0, r5, r0 - ldrb r0, [r0, 0x14] - ldr r6, =0x02024064 - ldrb r6, [r6] - cmp r0, r6 - bne _0803A822 - ldr r0, =0xffff1fff - ands r1, r0 - str r1, [r3] -_0803A822: - adds r3, 0x58 - adds r4, 0x1C - adds r5, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - blt _0803A7C6 -_0803A830: - ldr r1, =0x02024064 - ldrb r0, [r1] - add r0, r9 - movs r1, 0 - strb r1, [r0] - ldr r2, =0x02024064 - ldrb r0, [r2] - add r0, r10 - strb r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r3, =0x020242bc - adds r1, r0, r3 - movs r5, 0 - movs r2, 0 -_0803A852: - adds r0, r1, r5 - strb r2, [r0] - adds r5, 0x1 - cmp r5, 0x1B - bls _0803A852 - ldr r6, =0x02024064 - ldrb r1, [r6] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r0, 0x2 - negs r0, r0 - mov r9, r0 - ands r0, r2 - strb r0, [r1] - ldrb r1, [r6] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r3, 0x3 - negs r3, r3 - mov r8, r3 - mov r0, r8 - ands r0, r2 - strb r0, [r1] - ldrb r1, [r6] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r6, 0x5 - negs r6, r6 - adds r0, r6, 0 - ands r0, r2 - strb r0, [r1] - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - subs r3, 0x6 - mov r10, r3 - mov r0, r10 - ands r0, r2 - strb r0, [r1] - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r2, =0x02024064 - ldrb r1, [r2] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r5, 0x21 - negs r5, r5 - adds r0, r5, 0 - ands r0, r2 - strb r0, [r1] - ldr r3, =0x02024064 - ldrb r1, [r3] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r4, 0x41 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - strb r0, [r1] - ldrb r1, [r3] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r3, 0x7F - adds r0, r3, 0 - ands r0, r2 - strb r0, [r1] - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1, 0x1] - mov r0, r9 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r2, =0x02024064 - ldrb r1, [r2] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1, 0x1] - mov r0, r8 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1, 0x1] - adds r0, r6, 0 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r2, =0x02024064 - ldrb r1, [r2] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1, 0x1] - movs r0, 0x19 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r1, =0x02024064 - ldrb r0, [r1] - lsls r0, 4 - adds r0, r7 - ldrb r1, [r0, 0x1] - ands r5, r1 - strb r5, [r0, 0x1] - ldr r2, =0x02024064 - ldrb r0, [r2] - lsls r0, 4 - adds r0, r7 - ldrb r1, [r0, 0x1] - ands r4, r1 - strb r4, [r0, 0x1] - ldrb r0, [r2] - lsls r0, 4 - adds r0, r7 - ldrb r1, [r0, 0x1] - ands r3, r1 - strb r3, [r0, 0x1] - ldrb r0, [r2] - lsls r0, 4 - adds r0, r7 - ldrb r1, [r0, 0x2] - mov r3, r9 - ands r3, r1 - strb r3, [r0, 0x2] - ldrb r0, [r2] - lsls r0, 4 - adds r0, r7 - ldrb r1, [r0, 0x2] - mov r2, r8 - ands r2, r1 - strb r2, [r0, 0x2] - ldr r3, =0x02024064 - ldrb r0, [r3] - lsls r0, 4 - adds r0, r7 - ldrb r1, [r0, 0x2] - ands r6, r1 - strb r6, [r0, 0x2] - ldrb r0, [r3] - lsls r0, 4 - adds r0, r7 - ldrb r1, [r0, 0x2] - mov r6, r10 - ands r6, r1 - strb r6, [r0, 0x2] - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r1, =0x020242bc - adds r0, r1 - movs r2, 0 - movs r1, 0x2 - strb r1, [r0, 0x16] - ldrb r0, [r3] - lsls r0, 1 - ldr r3, =0x02024248 - adds r0, r3 - movs r3, 0 - strh r2, [r0] - ldr r6, =0x02024064 - ldrb r0, [r6] - lsls r0, 1 - ldr r1, =0x02024250 - adds r0, r1 - strh r2, [r0] - ldrb r0, [r6] - lsls r0, 1 - ldr r6, =0x02024258 - adds r0, r6 - strh r2, [r0] - ldr r1, =0x02024064 - ldrb r0, [r1] - lsls r0, 1 - ldr r6, =0x02024260 - adds r0, r6 - strh r2, [r0] - ldrb r0, [r1] - lsls r0, 1 - ldr r1, =0x02024240 - adds r0, r1 - strh r2, [r0] - ldr r2, =0x02024064 - ldrb r0, [r2] - ldr r6, =0x02024270 - adds r0, r6 - movs r1, 0xFF - strb r1, [r0] - ldrb r0, [r2] - mov r2, r12 - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC8 - strb r3, [r0] - ldr r6, =0x02024064 - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC9 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0x98 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0x99 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE0 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE1 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE2 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE3 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE4 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE5 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE6 - strb r3, [r0] - ldrb r0, [r6] - ldr r1, [r2] - lsls r0, 3 - adds r0, r1 - adds r0, 0xE7 - strb r3, [r0] - ldr r1, [r2] - adds r1, 0x92 - ldrb r0, [r6] - lsls r0, 2 - ldr r2, =gUnknown_0832A328 - adds r0, r2 - ldr r2, [r0] - ldrb r0, [r1] - bics r0, r2 - strb r0, [r1] - movs r5, 0 - ldr r3, =0x0202406c - ldrb r3, [r3] - cmp r5, r3 - bge _0803AB02 - adds r3, r6, 0 - mov r7, r12 - movs r6, 0 -_0803AAA4: - ldrb r0, [r3] - cmp r5, r0 - beq _0803AADA - lsls r0, r5, 24 - lsrs r0, 24 - str r3, [sp] - bl battle_side_get_owner - adds r4, r0, 0 - ldr r3, [sp] - ldrb r0, [r3] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - ldr r3, [sp] - cmp r4, r0 - beq _0803AADA - ldr r0, [r7] - lsls r1, r5, 1 - adds r0, r1, r0 - adds r0, 0x98 - strb r6, [r0] - ldr r0, [r7] - adds r1, r0 - adds r1, 0x99 - strb r6, [r1] -_0803AADA: - ldrb r0, [r3] - ldr r1, [r7] - lsls r0, 1 - lsls r2, r5, 3 - adds r0, r2 - adds r0, r1 - adds r0, 0xE0 - strb r6, [r0] - ldrb r0, [r3] - ldr r1, [r7] - lsls r0, 1 - adds r0, r2 - adds r0, r1 - adds r0, 0xE1 - strb r6, [r0] - adds r5, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - blt _0803AAA4 -_0803AB02: - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x4] - ldr r2, =0x02024064 - ldrb r0, [r2] - lsls r0, 2 - adds r1, r0 - movs r0, 0 - str r0, [r1] - ldr r4, =0x02024084 - ldrb r0, [r2] - movs r3, 0x58 - adds r2, r0, 0 - muls r2, r3 - b _0803AB6C - .pool -_0803AB6C: - adds r2, r4 - ldr r5, =gBaseStats - ldrh r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0, 0x6] - adds r2, 0x21 - strb r0, [r2] - ldr r6, =0x02024064 - ldrb r0, [r6] - adds r1, r0, 0 - muls r1, r3 - adds r1, r4 - ldrh r2, [r1] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0, 0x7] - adds r1, 0x22 - strb r0, [r1] - ldrb r0, [r6] - bl sub_81310F0 - ldrb r0, [r6] - bl sub_8131130 - 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_803A75C - - thumb_func_start bc_8012FAC -bc_8012FAC: @ 803ABC0 - push {r4,r5,lr} - ldr r5, =0x02024332 - ldrb r0, [r5] - cmp r0, 0 - beq _0803ABD4 - cmp r0, 0x1 - beq _0803ABF8 - b _0803AC2E - .pool -_0803ABD4: - ldr r4, =0x02024064 - ldrb r0, [r5, 0x1] - strb r0, [r4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl dp01_build_cmdbuf_x00_a_b_0 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - b _0803AC2E - .pool -_0803ABF8: - ldr r0, =0x02024068 - ldr r2, [r0] - cmp r2, 0 - bne _0803AC2E - ldrb r0, [r5, 0x1] - adds r0, 0x1 - strb r0, [r5, 0x1] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bne _0803AC2C - ldr r1, =0x03005d04 - ldr r0, =bc_load_battlefield - str r0, [r1] - b _0803AC2E - .pool -_0803AC2C: - strb r2, [r5] -_0803AC2E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end bc_8012FAC - - thumb_func_start bc_load_battlefield -bc_load_battlefield: @ 803AC34 - push {r4,r5,lr} - ldr r0, =0x02024068 - ldr r5, [r0] - cmp r5, 0 - bne _0803AC64 - movs r0, 0 - bl battle_get_side_with_given_state - ldr r4, =0x02024064 - strb r0, [r4] - ldr r0, =0x02022ff0 - ldrb r1, [r0] - movs r0, 0 - bl dp01_build_cmdbuf_x2E_a - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x03005d04 - ldr r0, =sub_803AC84 - str r0, [r1] - ldr r0, =0x02024332 - strb r5, [r0] - strb r5, [r0, 0x1] -_0803AC64: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end bc_load_battlefield - - thumb_func_start sub_803AC84 -sub_803AC84: @ 803AC84 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x02024068 - ldr r1, [r0] - cmp r1, 0 - beq _0803AC98 - b _0803AF4E -_0803AC98: - ldr r2, =0x02024064 - strb r1, [r2] - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r1, r0 - bcc _0803ACA6 - b _0803AF48 -_0803ACA6: - movs r7, 0x58 - ldr r0, =0x02024084 - mov r8, r0 - mov r9, r2 - movs r1, 0x48 - add r1, r8 - mov r10, r1 -_0803ACB4: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0803ACFC - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0803ACFC - ldrb r0, [r4] - muls r0, r7 - mov r2, r8 - adds r3, r0, r2 - movs r2, 0 - movs r1, 0 -_0803ACDA: - adds r0, r3, r2 - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x57 - bls _0803ACDA - b _0803ADCA - .pool -_0803ACFC: - mov r1, r9 - ldrb r0, [r1] - muls r0, r7 - mov r2, r8 - adds r3, r0, r2 - movs r2, 0 - ldr r6, =gBaseStats - ldr r5, =0x02023864 - ldr r4, =0x02024064 -_0803AD0E: - adds r0, r3, r2 - ldrb r1, [r4] - lsls r1, 9 - adds r1, 0x4 - adds r1, r2, r1 - adds r1, r5 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x57 - bls _0803AD0E - mov r1, r9 - ldrb r0, [r1] - adds r2, r0, 0 - muls r2, r7 - add r2, r8 - ldrh r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x6] - adds r2, 0x21 - strb r0, [r2] - mov r2, r9 - ldrb r0, [r2] - adds r2, r0, 0 - muls r2, r7 - add r2, r8 - ldrh r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x7] - adds r2, 0x22 - strb r0, [r2] - mov r1, r9 - ldrb r0, [r1] - adds r1, r0, 0 - muls r1, r7 - add r1, r8 - ldrh r0, [r1] - ldrb r1, [r1, 0x17] - lsrs r1, 7 - bl sub_806B694 - mov r2, r9 - ldrb r1, [r2] - muls r1, r7 - add r1, r8 - adds r1, 0x20 - strb r0, [r1] - ldrb r0, [r2] - bl battle_side_get_owner - ldr r1, =0x0202449c - lsls r0, 24 - lsrs r0, 23 - adds r0, 0xA8 - ldr r1, [r1] - adds r1, r0 - mov r2, r9 - ldrb r0, [r2] - muls r0, r7 - add r0, r8 - ldrh r0, [r0, 0x28] - strh r0, [r1] - movs r2, 0 - ldr r4, =0x02024064 - movs r5, 0x58 - ldr r1, =0x0202409c - adds r6, r4, 0 - movs r0, 0x18 - negs r0, r0 - adds r0, r1 - mov r12, r0 - movs r3, 0x6 -_0803ADAA: - ldrb r0, [r4] - muls r0, r5 - adds r0, r2, r0 - adds r0, r1 - strb r3, [r0] - adds r2, 0x1 - cmp r2, 0x7 - ble _0803ADAA - ldrb r0, [r6] - adds r1, r0, 0 - muls r1, r7 - mov r0, r12 - adds r0, 0x50 - adds r1, r0 - movs r0, 0 - str r0, [r1] -_0803ADCA: - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - cmp r0, 0 - bne _0803ADE4 - movs r0, 0 - bl dp01_build_cmdbuf_x07_7_7_7 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803ADE4: - ldr r5, =0x02022fec - ldr r0, [r5] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0803AE60 - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803AE0A - movs r0, 0 - bl dp01_build_cmdbuf_x07_7_7_7 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803AE0A: - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803AEC0 - ldr r0, [r5] - ldr r1, =0x063f0902 - ands r0, r1 - cmp r0, 0 - bne _0803AEC0 - ldrb r0, [r4] - muls r0, r7 - add r0, r8 - ldrh r0, [r0] - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r4] - muls r1, r7 - add r1, r10 - ldr r2, [r1] - movs r1, 0x2 - bl SetPokedexFlag - b _0803AEC0 - .pool -_0803AE60: - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803AEC0 - ldr r0, [r5] - ldr r1, =0x063f0902 - ands r0, r1 - cmp r0, 0 - bne _0803AE96 - ldrb r0, [r4] - muls r0, r7 - add r0, r8 - ldrh r0, [r0] - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r4] - muls r1, r7 - add r1, r10 - ldr r2, [r1] - movs r1, 0x2 - bl SetPokedexFlag -_0803AE96: - movs r0, 0 - bl dp01_build_cmdbuf_x04_4_4_4 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - ldr r1, =0x03005d10 - strh r0, [r1, 0x20] -_0803AEC0: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0803AEF6 - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _0803AEEA - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _0803AEF6 -_0803AEEA: - movs r0, 0 - bl dp01_build_cmdbuf_x07_7_7_7 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803AEF6: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0803AF20 - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _0803AF20 - movs r0, 0 - bl dp01_build_cmdbuf_x07_7_7_7 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803AF20: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _0803AF32 - bl sub_81A56B4 -_0803AF32: - mov r1, r9 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcs _0803AF48 - b _0803ACB4 -_0803AF48: - ldr r1, =0x03005d04 - ldr r0, =bc_801333C - str r0, [r1] -_0803AF4E: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803AC84 - - thumb_func_start bc_801333C -bc_801333C: @ 803AF80 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x30 - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _0803AF92 - b _0803B10C -_0803AF92: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - bne _0803AFA0 - b _0803B0AC -_0803AFA0: - movs r7, 0 - add r0, sp, 0x4 - mov r8, r0 - mov r6, r8 - mov r5, sp -_0803AFAA: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =0x02024744 - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _0803AFD0 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _0803AFE8 -_0803AFD0: - ldr r0, =0x0000ffff - strh r0, [r5] - movs r0, 0 - b _0803AFFA - .pool -_0803AFE8: - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr -_0803AFFA: - str r0, [r6] - adds r6, 0x8 - adds r5, 0x8 - adds r7, 0x1 - cmp r7, 0x5 - ble _0803AFAA - movs r0, 0x1 - bl battle_get_side_with_given_state - ldr r4, =0x02024064 - strb r0, [r4] - movs r0, 0 - mov r1, sp - movs r2, 0x80 - bl dp01_build_cmdbuf_x30_TODO - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - movs r7, 0 - mov r6, r8 - mov r5, sp -_0803B026: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _0803B04C - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _0803B060 -_0803B04C: - ldr r0, =0x0000ffff - strh r0, [r5] - movs r0, 0 - b _0803B072 - .pool -_0803B060: - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr -_0803B072: - str r0, [r6] - adds r6, 0x8 - adds r5, 0x8 - adds r7, 0x1 - cmp r7, 0x5 - ble _0803B026 - movs r0, 0 - bl battle_get_side_with_given_state - ldr r4, =0x02024064 - strb r0, [r4] - movs r0, 0 - mov r1, sp - movs r2, 0x80 - bl dp01_build_cmdbuf_x30_TODO - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x03005d04 - ldr r0, =bc_battle_begin_message - b _0803B10A - .pool -_0803B0AC: - movs r7, 0 - add r6, sp, 0x4 - mov r5, sp -_0803B0B2: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _0803B0D8 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _0803B0E8 -_0803B0D8: - ldr r0, =0x0000ffff - strh r0, [r5] - movs r0, 0 - b _0803B0FA - .pool -_0803B0E8: - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr -_0803B0FA: - str r0, [r6] - adds r6, 0x8 - adds r5, 0x8 - adds r7, 0x1 - cmp r7, 0x5 - ble _0803B0B2 - ldr r1, =0x03005d04 - ldr r0, =bc_8013568 -_0803B10A: - str r0, [r1] -_0803B10C: - add sp, 0x30 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bc_801333C - - thumb_func_start bc_battle_begin_message -bc_battle_begin_message: @ 803B120 - push {lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0803B142 - movs r0, 0x1 - bl battle_get_side_with_given_state - ldr r1, =0x02024064 - strb r0, [r1] - ldrb r1, [r1] - movs r0, 0 - bl b_std_message - ldr r1, =0x03005d04 - ldr r0, =sub_803B180 - str r0, [r1] -_0803B142: - pop {r0} - bx r0 - .pool - thumb_func_end bc_battle_begin_message - - thumb_func_start bc_8013568 -bc_8013568: @ 803B158 - push {lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0803B170 - ldr r1, =0x03005d04 - ldr r0, =sub_803B3CC - str r0, [r1] - movs r0, 0 - movs r1, 0 - bl b_std_message -_0803B170: - pop {r0} - bx r0 - .pool - thumb_func_end bc_8013568 - - thumb_func_start sub_803B180 -sub_803B180: @ 803B180 - push {lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0803B1D0 - ldr r0, =0x02022fec - ldr r2, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r2 - cmp r0, 0 - beq _0803B1B8 - movs r0, 0x80 - lsls r0, 18 - ands r0, r2 - cmp r0, 0 - beq _0803B1B8 - movs r1, 0x80 - lsls r1, 24 - ands r1, r2 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - b _0803B1BA - .pool -_0803B1B8: - movs r0, 0x1 -_0803B1BA: - bl battle_get_side_with_given_state - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x1 - bl b_std_message - ldr r1, =0x03005d04 - ldr r0, =sub_803B25C - str r0, [r1] -_0803B1D0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B180 - - thumb_func_start sub_803B1DC -sub_803B1DC: @ 803B1DC - push {r4,r5,lr} - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - beq _0803B1FC - movs r0, 0x80 - lsls r0, 18 - ands r0, r1 - cmp r0, 0 - beq _0803B1FC - movs r5, 0x2 - cmp r1, 0 - bge _0803B1FE -_0803B1FC: - movs r5, 0x3 -_0803B1FE: - ldr r1, =0x02024064 - movs r0, 0 - strb r0, [r1] - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r0, 0 - beq _0803B23A - adds r4, r1, 0 -_0803B20E: - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, r5 - bne _0803B228 - movs r0, 0 - bl dp01_build_cmdbuf_x2F_2F_2F_2F - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803B228: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B20E -_0803B23A: - ldr r1, =0x03005d04 - ldr r0, =bc_801362C - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B1DC - - thumb_func_start sub_803B25C -sub_803B25C: @ 803B25C - push {r4-r6,lr} - ldr r0, =0x02022fec - ldr r2, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r2 - cmp r0, 0 - beq _0803B298 - movs r0, 0x80 - lsls r0, 18 - ands r0, r2 - cmp r0, 0 - beq _0803B298 - movs r1, 0x80 - lsls r1, 24 - ands r1, r2 - negs r0, r1 - orrs r0, r1 - lsrs r5, r0, 31 - b _0803B29A - .pool -_0803B288: - ldr r1, =0x03005d04 - ldr r0, =sub_803B1DC - b _0803B2F0 - .pool -_0803B298: - movs r5, 0x1 -_0803B29A: - ldr r0, =0x02024068 - ldr r2, [r0] - cmp r2, 0 - bne _0803B2F2 - ldr r0, =0x02024064 - strb r2, [r0] - ldr r1, =0x0202406c - adds r4, r0, 0 - ldrb r1, [r1] - cmp r2, r1 - bcs _0803B2EC - adds r6, r4, 0 -_0803B2B2: - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, r5 - bne _0803B2D8 - movs r0, 0 - bl dp01_build_cmdbuf_x2F_2F_2F_2F - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x00008040 - ands r0, r1 - cmp r0, 0 - bne _0803B288 -_0803B2D8: - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x02024064 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B2B2 -_0803B2EC: - ldr r1, =0x03005d04 - ldr r0, =bc_801362C -_0803B2F0: - str r0, [r1] -_0803B2F2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B25C - - thumb_func_start bc_801362C -bc_801362C: @ 803B314 - push {r4-r7,lr} - ldr r0, =0x02024068 - ldr r1, [r0] - cmp r1, 0 - bne _0803B384 - ldr r2, =0x02024064 - strb r1, [r2] - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r1, r0 - bcs _0803B37E - adds r4, r2, 0 - ldr r6, =0x02024084 - movs r5, 0x58 - adds r7, r6, 0 - adds r7, 0x48 -_0803B334: - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803B36C - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x063f0902 - ands r0, r1 - cmp r0, 0 - bne _0803B36C - ldrb r0, [r4] - muls r0, r5 - adds r0, r6 - ldrh r0, [r0] - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r4] - muls r1, r5 - adds r1, r7 - ldr r2, [r1] - movs r1, 0x2 - bl SetPokedexFlag -_0803B36C: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B334 -_0803B37E: - ldr r1, =0x03005d04 - ldr r0, =sub_803B3CC - str r0, [r1] -_0803B384: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bc_801362C - - thumb_func_start sub_803B3AC -sub_803B3AC: @ 803B3AC - push {lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0803B3BC - ldr r1, =0x03005d04 - ldr r0, =sub_803B3CC - str r0, [r1] -_0803B3BC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B3AC - - thumb_func_start sub_803B3CC -sub_803B3CC: @ 803B3CC - push {lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0803B418 - ldr r1, =0x02022fec - ldr r2, [r1] - movs r0, 0x80 - lsls r0, 17 - ands r0, r2 - cmp r0, 0 - beq _0803B3F4 - movs r0, 0x80 - lsls r0, 18 - ands r0, r2 - cmp r0, 0 - beq _0803B3F4 - movs r3, 0x1 - cmp r2, 0 - bge _0803B3F6 -_0803B3F4: - movs r3, 0 -_0803B3F6: - ldr r0, [r1] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0803B412 - adds r0, r3, 0 - bl battle_get_side_with_given_state - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x1 - bl b_std_message -_0803B412: - ldr r1, =0x03005d04 - ldr r0, =sub_803B4C8 - str r0, [r1] -_0803B418: - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B3CC - - thumb_func_start sub_803B42C -sub_803B42C: @ 803B42C - push {r4,r5,lr} - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - beq _0803B44C - movs r0, 0x80 - lsls r0, 18 - ands r0, r1 - cmp r0, 0 - beq _0803B44C - movs r5, 0x3 - cmp r1, 0 - bge _0803B44E -_0803B44C: - movs r5, 0x2 -_0803B44E: - ldr r1, =0x02024064 - movs r0, 0 - strb r0, [r1] - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r0, 0 - beq _0803B48A - adds r4, r1, 0 -_0803B45E: - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, r5 - bne _0803B478 - movs r0, 0 - bl dp01_build_cmdbuf_x2F_2F_2F_2F - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803B478: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B45E -_0803B48A: - ldr r2, =0x0202449c - ldr r0, [r2] - adds r0, 0x4C - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0xD9 - strb r1, [r0] - ldr r0, [r2] - movs r2, 0xD1 - lsls r2, 1 - adds r0, r2 - strb r1, [r0] - ldr r1, =0x03005d04 - ldr r0, =sub_803B628 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B42C - - thumb_func_start sub_803B4C8 -sub_803B4C8: @ 803B4C8 - push {r4-r6,lr} - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - beq _0803B500 - movs r0, 0x80 - lsls r0, 18 - ands r0, r1 - cmp r0, 0 - beq _0803B500 - movs r6, 0x1 - cmp r1, 0 - bge _0803B502 - b _0803B500 - .pool -_0803B4F0: - ldr r1, =0x03005d04 - ldr r0, =sub_803B42C - b _0803B572 - .pool -_0803B500: - movs r6, 0 -_0803B502: - ldr r0, =0x02024068 - ldr r2, [r0] - cmp r2, 0 - bne _0803B574 - ldr r0, =0x02024064 - strb r2, [r0] - ldr r1, =0x0202406c - adds r4, r0, 0 - ldrb r1, [r1] - cmp r2, r1 - bcs _0803B554 - adds r5, r4, 0 -_0803B51A: - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, r6 - bne _0803B540 - movs r0, 0 - bl dp01_build_cmdbuf_x2F_2F_2F_2F - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0803B4F0 -_0803B540: - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x02024064 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B51A -_0803B554: - ldr r2, =0x0202449c - ldr r0, [r2] - adds r0, 0x4C - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0xD9 - strb r1, [r0] - ldr r0, [r2] - movs r2, 0xD1 - lsls r2, 1 - adds r0, r2 - strb r1, [r0] - ldr r1, =0x03005d04 - ldr r0, =sub_803B628 -_0803B572: - str r0, [r1] -_0803B574: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B4C8 - - thumb_func_start sub_803B598 -sub_803B598: @ 803B598 - push {r4,r5,lr} - ldr r0, =0x02024068 - ldr r1, [r0] - cmp r1, 0 - bne _0803B606 - ldr r2, =0x02024064 - strb r1, [r2] - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r1, r0 - bcs _0803B5E6 - adds r4, r2, 0 - ldr r5, =0x0202406e -_0803B5B2: - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0803B5D4 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r5 - ldrb r1, [r0] - movs r0, 0 - movs r2, 0 - bl dp01_build_cmdbuf_x05_a_b_c - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803B5D4: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B5B2 -_0803B5E6: - ldr r2, =0x0202449c - ldr r0, [r2] - adds r0, 0x4C - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0xD9 - strb r1, [r0] - ldr r0, [r2] - movs r2, 0xD1 - lsls r2, 1 - adds r0, r2 - strb r1, [r0] - ldr r1, =0x03005d04 - ldr r0, =sub_803B628 - str r0, [r1] -_0803B606: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B598 - - thumb_func_start sub_803B628 -sub_803B628: @ 803B628 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r0, 0 - mov r9, r0 - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _0803B642 - b _0803B8B2 -_0803B642: - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x4C - ldrb r0, [r0] - cmp r0, 0 - bne _0803B6C2 - movs r5, 0 - ldr r1, =0x0202406c - mov r10, r1 - ldrb r3, [r1] - cmp r5, r3 - bge _0803B668 - ldr r2, =0x0202407e -_0803B65C: - adds r0, r5, r2 - strb r5, [r0] - adds r5, 0x1 - ldrb r0, [r1] - cmp r5, r0 - blt _0803B65C -_0803B668: - movs r5, 0 - b _0803B6B8 - .pool -_0803B67C: - adds r4, r5, 0x1 - mov r8, r4 - ldrb r1, [r1] - cmp r8, r1 - bge _0803B6B6 - ldr r6, =0x0202407e - ldr r1, =0x0202406c - mov r10, r1 - lsls r7, r5, 24 -_0803B68E: - adds r0, r5, r6 - ldrb r0, [r0] - adds r1, r4, r6 - ldrb r1, [r1] - movs r2, 0x1 - bl b_first_side - lsls r0, 24 - cmp r0, 0 - beq _0803B6AC - lsls r1, r4, 24 - lsrs r1, 24 - lsrs r0, r7, 24 - bl sub_803CEDC -_0803B6AC: - adds r4, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _0803B68E -_0803B6B6: - mov r5, r8 -_0803B6B8: - mov r1, r10 - ldrb r0, [r1] - subs r0, 0x1 - cmp r5, r0 - blt _0803B67C -_0803B6C2: - ldr r5, =0x0202449c - ldr r0, [r5] - movs r4, 0xD1 - lsls r4, 1 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _0803B6FC - str r0, [sp] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0xFF - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _0803B6FC - ldr r0, [r5] - adds r0, r4 - movs r1, 0x1 - strb r1, [r0] - b _0803B8B2 - .pool -_0803B6FC: - ldr r2, =0x0202449c - ldr r0, [r2] - adds r0, 0x4C - ldr r1, =0x0202406c - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcs _0803B756 - ldr r5, =0x0202407e - adds r4, r2, 0 -_0803B710: - ldr r0, [r4] - adds r0, 0x4C - ldrb r0, [r0] - adds r0, r5 - ldrb r1, [r0] - movs r0, 0 - str r0, [sp] - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _0803B736 - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_0803B736: - ldr r1, [r4] - adds r1, 0x4C - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r3, r9 - cmp r3, 0 - beq _0803B748 - b _0803B8B2 -_0803B748: - ldr r0, [r4] - adds r0, 0x4C - ldr r1, =0x0202406c - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B710 -_0803B756: - movs r0, 0 - str r0, [sp] - movs r0, 0x9 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _0803B770 - b _0803B8B2 -_0803B770: - str r0, [sp] - movs r0, 0xB - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _0803B786 - b _0803B8B2 -_0803B786: - ldr r2, =0x0202449c - ldr r0, [r2] - adds r0, 0xD9 - ldr r1, =0x0202406c - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcs _0803B7DA - ldr r5, =0x0202407e - adds r4, r2, 0 -_0803B79A: - ldr r0, [r4] - adds r0, 0xD9 - ldrb r0, [r0] - adds r0, r5 - ldrb r1, [r0] - movs r0, 0 - movs r2, 0 - bl berry_effects_maybe - lsls r0, 24 - cmp r0, 0 - beq _0803B7BC - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_0803B7BC: - ldr r1, [r4] - adds r1, 0xD9 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r0, r9 - cmp r0, 0 - bne _0803B8B2 - ldr r0, [r4] - adds r0, 0xD9 - ldr r1, =0x0202406c - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcc _0803B79A -_0803B7DA: - movs r5, 0 - ldr r1, =0x0202449c - mov r8, r1 - movs r7, 0x6 - ldr r6, =0x0202421c - ldr r2, =0x02024274 - movs r4, 0xFF - movs r3, 0 -_0803B7EA: - mov r1, r8 - ldr r0, [r1] - adds r0, r5, r0 - adds r0, 0x5C - strb r7, [r0] - adds r1, r5, r6 - ldrb r0, [r1] - orrs r0, r4 - strb r0, [r1] - strh r3, [r2] - adds r2, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _0803B7EA - movs r0, 0 - bl sub_803D580 - bl sub_803D6A0 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x91 - ldr r1, =0x02024210 - ldrb r1, [r1] - strb r1, [r0] - ldr r0, =gUnknown_085CC23E - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =0x03005d04 - ldr r0, =sub_803BE74 - str r0, [r1] - bl sub_803F988 - ldr r1, =0x02024332 - movs r2, 0 - adds r0, r1, 0x7 -_0803B834: - strb r2, [r0] - subs r0, 0x1 - cmp r0, r1 - bge _0803B834 - movs r5, 0 - ldr r3, =0x0202406c - ldr r2, =0x0202449c - ldr r6, =0x02024474 - ldr r7, =0x0202427c - ldrb r0, [r3] - cmp r5, r0 - bge _0803B866 - ldr r0, =0x02024084 - movs r4, 0x9 - negs r4, r4 - adds r1, r0, 0 - adds r1, 0x50 -_0803B856: - ldr r0, [r1] - ands r0, r4 - str r0, [r1] - adds r1, 0x58 - adds r5, 0x1 - ldrb r0, [r3] - cmp r5, r0 - blt _0803B856 -_0803B866: - ldr r0, [r2] - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - strb r1, [r0, 0x1] - ldr r0, [r2] - movs r3, 0xD0 - lsls r3, 1 - adds r0, r3 - strb r1, [r0] - ldr r0, [r2] - adds r3, 0x1 - adds r0, r3 - strb r1, [r0] - movs r1, 0 - strb r1, [r6, 0x14] - ldr r0, [r2] - adds r0, 0x4D - strb r1, [r0] - ldr r0, [r2] - strb r1, [r0, 0x3] - strb r1, [r7] - bl GenerateRandomNumber - ldr r1, =0x02024330 - strh r0, [r1] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _0803B8B2 - bl sub_80A369C - ldr r0, =gUnknown_082DB8BE - bl b_call_bc_move_exec -_0803B8B2: - 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_803B628 - - thumb_func_start bc_8013B1C -bc_8013B1C: @ 803B904 - push {r4-r6,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0803B994 - ldr r1, =0x03005d04 - ldr r0, =sub_803B9BC - str r0, [r1] - ldr r3, =0x0202406c - ldr r1, =0x02024332 - movs r2, 0 - adds r0, r1, 0x7 -_0803B91C: - strb r2, [r0] - subs r0, 0x1 - cmp r0, r1 - bge _0803B91C - movs r4, 0 - ldrb r3, [r3] - cmp r4, r3 - bge _0803B96E - ldr r5, =0x02024084 - adds r6, r5, 0 - adds r6, 0x4C -_0803B932: - movs r0, 0x58 - adds r2, r4, 0 - muls r2, r0 - adds r1, r5, 0 - adds r1, 0x50 - adds r1, r2, r1 - ldr r3, [r1] - subs r0, 0x61 - ands r3, r0 - str r3, [r1] - adds r2, r6 - ldr r0, [r2] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _0803B964 - movs r0, 0x80 - lsls r0, 5 - ands r3, r0 - cmp r3, 0 - beq _0803B964 - lsls r0, r4, 24 - lsrs r0, 24 - bl b_cancel_multi_turn_move_maybe -_0803B964: - adds r4, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _0803B932 -_0803B96E: - ldr r2, =0x0202449c - ldr r0, [r2] - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - strb r1, [r0, 0x1] - ldr r0, [r2] - movs r3, 0xD0 - lsls r3, 1 - adds r0, r3 - strb r1, [r0] - ldr r0, [r2] - adds r3, 0x1 - adds r0, r3 - strb r1, [r0] - ldr r0, [r2] - strb r1, [r0, 0x3] - ldr r0, =0x0202427c - strb r1, [r0] -_0803B994: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bc_8013B1C - - thumb_func_start sub_803B9BC -sub_803B9BC: @ 803B9BC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r0, 0x1 - bl sub_803D580 - ldr r0, =0x0202433a - ldrb r0, [r0] - cmp r0, 0 - bne _0803B9EA - bl sub_80401D0 - lsls r0, 24 - cmp r0, 0 - beq _0803B9DE - b _0803BB78 -_0803B9DE: - bl sub_8040924 - lsls r0, 24 - cmp r0, 0 - beq _0803B9EA - b _0803BB78 -_0803B9EA: - bl sub_8041728 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _0803B9F8 - b _0803BB78 -_0803B9F8: - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x4D - strb r1, [r0] - bl sub_8041364 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0803BA0E - b _0803BB78 -_0803BA0E: - movs r0, 0 - bl sub_803D580 - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xfffffdff - ands r0, r1 - ldr r1, =0xfff7ffff - ands r0, r1 - ldr r1, =0xffbfffff - ands r0, r1 - ldr r1, =0xffefffff - ands r0, r1 - str r0, [r2] - ldr r0, =0x02024474 - strb r4, [r0, 0x18] - strb r4, [r0, 0x19] - strb r4, [r0, 0x14] - ldr r0, =0x020241f0 - str r4, [r0] - ldr r0, =0x0202427c - strb r4, [r0] - ldr r1, =0x02024332 - movs r2, 0 - adds r0, r1, 0x4 -_0803BA40: - strb r2, [r0] - subs r0, 0x1 - cmp r0, r1 - bge _0803BA40 - ldr r0, =0x0202433a - ldrb r0, [r0] - cmp r0, 0 - beq _0803BA98 - ldr r1, =0x02024083 - movs r0, 0xC - strb r0, [r1] - ldr r1, =0x03005d04 - ldr r0, =bc_bs_exec - str r0, [r1] - b _0803BB78 - .pool -_0803BA98: - ldr r1, =0x03005d10 - ldrb r0, [r1, 0x13] - ldr r2, =0x0202449c - mov r8, r2 - cmp r0, 0xFE - bhi _0803BAB2 - adds r0, 0x1 - strb r0, [r1, 0x13] - ldr r1, [r2] - adds r1, 0xDA - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0803BAB2: - movs r2, 0 - ldr r4, =0x0202406c - ldr r0, =0x02024210 - mov r12, r0 - ldr r1, =gUnknown_085CC23E - mov r9, r1 - ldrb r0, [r4] - cmp r2, r0 - bge _0803BAE0 - ldr r7, =0x0202421c - movs r6, 0xFF - movs r5, 0 - ldr r3, =0x02024274 -_0803BACC: - adds r1, r2, r7 - ldrb r0, [r1] - orrs r0, r6 - strb r0, [r1] - strh r5, [r3] - adds r3, 0x2 - adds r2, 0x1 - ldrb r1, [r4] - cmp r2, r1 - blt _0803BACC -_0803BAE0: - movs r2, 0 - ldr r3, =0x0202449c - movs r1, 0x6 -_0803BAE6: - ldr r0, [r3] - adds r0, r2, r0 - adds r0, 0x5C - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x3 - ble _0803BAE6 - mov r2, r8 - ldr r0, [r2] - adds r0, 0x91 - mov r2, r12 - ldrb r1, [r2] - strb r1, [r0] - mov r0, r9 - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =0x03005d04 - ldr r0, =sub_803BE74 - str r0, [r1] - bl GenerateRandomNumber - ldr r1, =0x02024330 - strh r0, [r1] - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 10 - ands r0, r1 - cmp r0, 0 - beq _0803BB5C - ldr r0, =gUnknown_082DB881 - bl b_call_bc_move_exec - b _0803BB78 - .pool -_0803BB5C: - movs r0, 0x80 - lsls r0, 11 - ands r1, r0 - cmp r1, 0 - beq _0803BB78 - mov r1, r8 - ldr r0, [r1] - adds r0, 0xDA - ldrb r0, [r0] - cmp r0, 0 - bne _0803BB78 - ldr r0, =gUnknown_082DB8BE - bl b_call_bc_move_exec -_0803BB78: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803B9BC - - thumb_func_start sub_803BB88 -sub_803BB88: @ 803BB88 - push {r4-r7,lr} - sub sp, 0x4 - ldr r1, =0x02024084 - ldr r0, =0x02024064 - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _0803BBB8 - ldr r1, =0x02024404 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x7] - b _0803BBC2 - .pool -_0803BBB8: - ldrh r0, [r1, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r2, r0, 24 -_0803BBC2: - ldr r1, =0x0202420f - ldr r3, =0x02024064 - ldrb r0, [r3] - strb r0, [r1] - cmp r2, 0x25 - bne _0803BBD0 - b _0803BD4C -_0803BBD0: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0803BBDE - b _0803BD4C -_0803BBDE: - ldr r1, =0x02024084 - ldrb r2, [r3] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x32 - bne _0803BBF2 - b _0803BD4C -_0803BBF2: - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - bge _0803BC86 - movs r7, 0 -_0803BC08: - lsrs r4, r7, 24 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - beq _0803BC2C - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r5 - adds r0, r1 - adds r2, r0, 0 - adds r2, 0x20 - ldrb r0, [r2] - cmp r0, 0x17 - bne _0803BC2C - b _0803BD54 -_0803BC2C: - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - beq _0803BC76 - ldr r3, =0x02024084 - ldr r0, =0x02024064 - ldrb r0, [r0] - movs r2, 0x58 - muls r0, r2 - adds r1, r0, r3 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1A - beq _0803BC76 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x2 - beq _0803BC76 - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x2 - beq _0803BC76 - adds r0, r5, 0 - muls r0, r2 - adds r0, r3 - adds r2, r0, 0 - adds r2, 0x20 - ldrb r0, [r2] - cmp r0, 0x47 - bne _0803BC76 - b _0803BD70 -_0803BC76: - movs r0, 0x80 - lsls r0, 17 - adds r7, r0 - adds r5, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - blt _0803BC08 -_0803BC86: - ldr r4, =0x02024064 - ldrb r1, [r4] - movs r0, 0 - str r0, [sp] - movs r0, 0xF - movs r2, 0x2A - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - beq _0803BCF8 - ldr r6, =0x02024084 - ldrb r0, [r4] - movs r3, 0x58 - muls r0, r3 - adds r1, r0, r6 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x8 - beq _0803BCBE - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x8 - bne _0803BCF8 -_0803BCBE: - ldr r0, =0x02024474 - subs r1, r5, 0x1 - strb r1, [r0, 0x17] - ldr r2, =0x0202420a - adds r0, r1, 0 - muls r0, r3 - adds r0, r6 - adds r0, 0x20 - ldrb r0, [r0] - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x2 - b _0803BD90 - .pool -_0803BCF8: - ldr r1, =0x02024084 - ldr r0, =0x02024064 - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x0400e000 - ands r0, r1 - cmp r0, 0 - bne _0803BD22 - ldr r1, =0x020242ac - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 3 - ands r0, r1 - cmp r0, 0 - beq _0803BD40 -_0803BD22: - ldr r1, =0x02024332 - movs r0, 0 - strb r0, [r1, 0x5] - movs r0, 0x1 - b _0803BD92 - .pool -_0803BD40: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - bne _0803BD8C -_0803BD4C: - movs r0, 0 - b _0803BD92 - .pool -_0803BD54: - ldr r0, =0x02024474 - strb r5, [r0, 0x17] - ldr r1, =0x0202420a - ldrb r0, [r2] - strb r0, [r1] - ldr r1, =0x02024332 - movs r0, 0x2 - b _0803BD90 - .pool -_0803BD70: - ldr r0, =0x02024474 - strb r5, [r0, 0x17] - ldr r1, =0x0202420a - ldrb r0, [r2] - strb r0, [r1] - ldr r1, =0x02024332 - movs r0, 0x2 - b _0803BD90 - .pool -_0803BD8C: - ldr r1, =0x02024332 - movs r0, 0x1 -_0803BD90: - strb r0, [r1, 0x5] -_0803BD92: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_803BB88 - - thumb_func_start sub_803BDA0 -sub_803BDA0: @ 803BDA0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - movs r3, 0 - ldr r0, =0x0202406e - mov r8, r0 - ldr r1, =0x0203cf00 - mov r12, r1 - ldr r7, =0x0202449c - lsls r0, r5, 1 - adds r4, r0, r5 - adds r6, r0, 0 -_0803BDBC: - mov r0, r12 - adds r2, r3, r0 - ldr r1, [r7] - adds r0, r4, r3 - adds r0, r1 - adds r0, 0x60 - ldrb r0, [r0] - strb r0, [r2] - adds r3, 0x1 - cmp r3, 0x2 - ble _0803BDBC - mov r1, r8 - adds r0, r6, r1 - ldrb r0, [r0] - bl pokemon_order_func - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r7, =0x0202449c - ldr r0, [r7] - adds r0, r5, r0 - adds r0, 0x5C - ldrb r0, [r0] - bl pokemon_order_func - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_81B8FB0 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0803BE4C - movs r3, 0 - adds r4, r7, 0 - adds r6, r5 - movs r0, 0x2 - adds r1, r5, 0 - eors r1, r0 - ldr r7, =0x0203cf00 - lsls r0, r1, 1 - adds r5, r0, r1 -_0803BE1A: - ldr r0, [r4] - adds r1, r6, r3 - adds r1, r0 - adds r1, 0x60 - adds r2, r3, r7 - ldrb r0, [r2] - strb r0, [r1] - ldr r1, [r4] - adds r0, r5, r3 - adds r0, r1 - adds r0, 0x60 - ldrb r1, [r2] - strb r1, [r0] - adds r3, 0x1 - cmp r3, 0x2 - ble _0803BE1A - b _0803BE66 - .pool -_0803BE4C: - movs r3, 0 - adds r2, r6, r5 - ldr r4, =0x0203cf00 -_0803BE52: - ldr r0, [r7] - adds r1, r2, r3 - adds r1, r0 - adds r1, 0x60 - adds r0, r3, r4 - ldrb r0, [r0] - strb r0, [r1] - adds r3, 0x1 - cmp r3, 0x2 - ble _0803BE52 -_0803BE66: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803BDA0 - - thumb_func_start sub_803BE74 -sub_803BE74: @ 803BE74 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - ldr r0, =0x02024332 - movs r1, 0 - strb r1, [r0, 0x4] - ldr r0, =0x02024064 - strb r1, [r0] - ldr r0, =0x0202406c - bl _0803CD12 - .pool -_0803BE9C: - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x02024332 - ldrb r0, [r4] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x8 - bls _0803BEB8 - bl _0803CD04 -_0803BEB8: - lsls r0, 2 - ldr r1, =_0803BED0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0803BED0: - .4byte _0803BEF4 - .4byte _0803BF0C - .4byte _0803C02C - .4byte _0803C7D8 - .4byte _0803CAD0 - .4byte _0803CB84 - .4byte _0803CBC8 - .4byte _0803CBF4 - .4byte _0803CC38 -_0803BEF4: - bl sub_8185FD0 - ldr r1, =0x02024332 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - bl _0803CC20 - .pool -_0803BF0C: - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r4, =0x0202449c - ldr r0, [r4] - adds r1, r0 - adds r1, 0x5C - movs r0, 0x6 - strb r0, [r1] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0803BF68 - movs r1, 0x2 - movs r0, 0x2 - ands r0, r5 - cmp r0, 0 - beq _0803BF68 - eors r5, r1 - adds r0, r5, 0 - bl battle_get_side_with_given_state - ldr r1, [r4] - adds r1, 0x91 - ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 - lsls r0, 24 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0803BF68 - ldr r4, =0x02024332 - adds r0, r5, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x5 - beq _0803BF68 - bl _0803CD04 -_0803BF68: - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x91 - ldrb r3, [r0] - ldr r1, =gUnknown_0832A328 - ldr r4, =0x02024064 - ldrb r2, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - ands r3, r0 - cmp r3, 0 - beq _0803BFD0 - ldr r0, =0x0202421c - adds r0, r2, r0 - movs r1, 0xD - strb r1, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0803BFBC - ldr r0, =0x02024332 - ldrb r1, [r4] - adds r1, r0 - movs r0, 0x5 - strb r0, [r1] - bl _0803CD04 - .pool -_0803BFBC: - ldr r0, =0x02024332 - ldrb r1, [r4] - adds r1, r0 - movs r0, 0x4 - strb r0, [r1] - bl _0803CD04 - .pool -_0803BFD0: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 5 - ands r0, r1 - cmp r0, 0 - bne _0803BFF0 - movs r0, 0x80 - lsls r0, 15 - ands r1, r0 - cmp r1, 0 - beq _0803C00C -_0803BFF0: - ldr r0, =0x0202421c - adds r0, r2, r0 - strb r3, [r0] - ldr r1, =0x02024332 - ldrb r0, [r4] - bl _0803CC72 - .pool -_0803C00C: - ldr r0, =0x0202421c - ldrb r1, [r0] - ldr r0, =0x02023864 - ldrb r2, [r0, 0x1] - ldrb r0, [r0, 0x2] - lsls r0, 8 - orrs r2, r0 - movs r0, 0 - bl dp01_build_cmdbuf_x12_a_bb - bl _0803CB68 - .pool -_0803C02C: - ldr r3, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldr r6, =0x02024064 - ldrb r5, [r6] - lsls r0, r5, 2 - adds r0, r1 - ldr r2, [r0] - lsls r1, r2, 4 - movs r0, 0xF0 - lsls r0, 24 - orrs r1, r0 - orrs r1, r2 - lsls r0, r2, 8 - orrs r1, r0 - lsls r2, 12 - orrs r1, r2 - ldr r0, [r3] - ands r0, r1 - cmp r0, 0 - beq _0803C058 - bl _0803CD04 -_0803C058: - ldr r4, =0x02023864 - lsls r0, r5, 9 - adds r4, 0x1 - adds r0, r4 - ldrb r1, [r0] - adds r0, r5, 0 - bl sub_8184FBC - ldr r1, =0x0202421c - ldrb r0, [r6] - adds r1, r0, r1 - lsls r0, 9 - adds r0, r4 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r6] - lsls r0, 9 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0xC - bls _0803C084 - b _0803C6C4 -_0803C084: - lsls r0, 2 - ldr r1, =_0803C0A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0803C0A8: - .4byte _0803C0DC - .4byte _0803C230 - .4byte _0803C268 - .4byte _0803C6C4 - .4byte _0803C6C4 - .4byte _0803C440 - .4byte _0803C48C - .4byte _0803C6C4 - .4byte _0803C6C4 - .4byte _0803C6C4 - .4byte _0803C6C4 - .4byte _0803C6C4 - .4byte _0803C4B4 -_0803C0DC: - bl sub_80400C8 - lsls r0, 24 - cmp r0, 0 - beq _0803C134 - ldr r0, =0x02024332 - ldr r3, =0x02024064 - ldrb r1, [r3] - adds r1, r0 - movs r4, 0 - movs r0, 0x6 - strb r0, [r1] - ldrb r1, [r3] - ldr r2, =0x0202449c - ldr r0, [r2] - adds r1, r0 - adds r1, 0x54 - strb r4, [r1] - ldrb r1, [r3] - ldr r0, [r2] - adds r1, r0 - adds r1, 0x84 - movs r0, 0x4 - strb r0, [r1] - ldrb r1, [r3] - ldr r2, [r2] - adds r2, r1, r2 - ldr r0, =0x02023864 - lsls r1, 9 - adds r0, 0x3 - adds r1, r0 - ldrb r0, [r1] - strb r0, [r2, 0xC] - bl _0803CD70 - .pool -_0803C134: - ldr r3, =0x020242bc - ldr r5, =0x02024064 - ldrb r4, [r5] - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r0, r3 - ldrh r2, [r0, 0x6] - cmp r2, 0 - beq _0803C188 - ldr r1, =0x02024274 - lsls r0, r4, 1 - adds r0, r1 - strh r2, [r0] - ldrb r2, [r5] - ldr r0, =0x0202449c - ldr r1, [r0] - adds r1, r2, r1 - adds r1, 0x80 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0xC] - strb r0, [r1] - ldr r1, =0x02024332 - ldrb r0, [r5] - adds r0, r1 - movs r1, 0x4 - strb r1, [r0] - bl _0803CD70 - .pool -_0803C188: - add r2, sp, 0x4 - ldr r3, =0x02024084 - movs r1, 0x58 - adds r0, r4, 0 - muls r0, r1 - adds r0, r3 - ldrh r0, [r0] - strh r0, [r2, 0x10] - ldrb r0, [r5] - muls r0, r1 - adds r0, r3 - adds r0, 0x21 - ldrb r0, [r0] - strb r0, [r2, 0x12] - ldrb r0, [r5] - muls r0, r1 - adds r0, r3 - adds r0, 0x22 - ldrb r0, [r0] - strb r0, [r2, 0x13] - movs r4, 0 - mov r1, sp - adds r1, 0xC - str r1, [sp, 0x18] - add r2, sp, 0x10 - mov r10, r2 - mov r8, r3 - adds r7, r5, 0 - movs r6, 0x58 - movs r0, 0xC - add r0, r8 - mov r9, r0 - add r5, sp, 0x4 -_0803C1CA: - lsls r2, r4, 1 - ldrb r0, [r7] - muls r0, r6 - adds r0, r2, r0 - add r0, r9 - ldrh r0, [r0] - strh r0, [r5] - ldr r1, [sp, 0x18] - adds r3, r1, r4 - ldrb r0, [r7] - muls r0, r6 - adds r0, r4, r0 - mov r1, r8 - adds r1, 0x24 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r3] - ldrb r0, [r7] - adds r1, r0, 0 - muls r1, r6 - adds r2, r1 - add r2, r9 - ldrh r0, [r2] - add r1, r8 - adds r1, 0x3B - ldrb r1, [r1] - lsls r2, r4, 24 - lsrs r2, 24 - bl CalcPPWithPPUps - mov r2, r10 - adds r1, r2, r4 - strb r0, [r1] - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _0803C1CA - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x1 - ands r1, r0 - movs r0, 0 - movs r2, 0 - add r3, sp, 0x4 - bl sub_8033E30 - b _0803C42E - .pool -_0803C230: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x021f0902 - ands r0, r1 - cmp r0, 0 - bne _0803C23E - b _0803C48C -_0803C23E: - ldr r4, =0x02024064 - ldrb r0, [r4] - movs r1, 0x1 - bl sub_8185008 - ldr r1, =0x02024220 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB879 - b _0803C784 - .pool -_0803C268: - ldr r5, =0x02024064 - ldrb r0, [r5] - ldr r3, =0x0202449c - ldr r1, [r3] - adds r1, r0, r1 - adds r1, 0x58 - ldr r2, =0x0202406e - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1] - ldr r7, =0x02024084 - ldrb r2, [r5] - movs r6, 0x58 - adds r0, r2, 0 - muls r0, r6 - adds r1, r7, 0 - adds r1, 0x50 - adds r0, r1 - ldr r1, [r0] - ldr r0, =0x0400e000 - ands r1, r0 - cmp r1, 0 - bne _0803C2B8 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - bne _0803C2B8 - ldr r0, =0x020242ac - lsls r1, r2, 2 - adds r1, r0 - ldr r1, [r1] - movs r0, 0x80 - lsls r0, 3 - ands r1, r0 - cmp r1, 0 - beq _0803C2EC -_0803C2B8: - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r1, r0, 1 - adds r1, r0 - adds r1, 0x60 - ldr r0, [r3] - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x2 - movs r2, 0x6 - b _0803C400 - .pool -_0803C2EC: - str r1, [sp] - movs r0, 0xC - adds r1, r2, 0 - movs r2, 0x17 - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0803C374 - ldrb r1, [r5] - str r4, [sp] - movs r0, 0xC - movs r2, 0x47 - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0803C33C - ldrb r0, [r5] - muls r0, r6 - adds r1, r0, r7 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x2 - beq _0803C33C - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x2 - beq _0803C33C - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1A - bne _0803C374 -_0803C33C: - ldr r5, =0x02024064 - ldrb r1, [r5] - movs r0, 0 - str r0, [sp] - movs r0, 0xF - movs r2, 0x2A - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0803C3B0 - ldr r2, =0x02024084 - ldrb r1, [r5] - movs r0, 0x58 - muls r0, r1 - adds r1, r0, r2 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x8 - beq _0803C374 - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x8 - bne _0803C3B0 -_0803C374: - subs r1, r4, 0x1 - lsls r1, 4 - movs r0, 0x4 - orrs r1, r0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0x0202420a - ldrb r3, [r0] - ldr r4, =0x0202449c - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r2, r0, 1 - adds r2, r0 - adds r2, 0x60 - ldr r0, [r4] - adds r0, r2 - str r0, [sp] - movs r0, 0 - movs r2, 0x6 - bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f - b _0803C42E - .pool -_0803C3B0: - ldr r0, =0x02024064 - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0x2 - bne _0803C3D8 - ldr r0, =0x0202421c - ldrb r0, [r0] - cmp r0, 0x2 - bne _0803C3D8 - ldr r0, =0x0202449c - ldr r3, [r0] - adds r0, r3, 0 - adds r0, 0x5C - b _0803C3EE - .pool -_0803C3D8: - ldrb r0, [r4] - cmp r0, 0x3 - bne _0803C410 - ldr r0, =0x0202421c - ldrb r0, [r0, 0x1] - cmp r0, 0x2 - bne _0803C410 - ldr r0, =0x0202449c - ldr r3, [r0] - adds r0, r3, 0 - adds r0, 0x5D -_0803C3EE: - ldrb r2, [r0] - ldrb r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - adds r0, 0x60 - adds r3, r0 - str r3, [sp] - movs r0, 0 - movs r1, 0 -_0803C400: - movs r3, 0 - bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f - b _0803C42E - .pool -_0803C410: - ldr r2, =0x0202449c - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r1, r0, 1 - adds r1, r0 - adds r1, 0x60 - ldr r0, [r2] - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0 - movs r2, 0x6 - movs r3, 0 - bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f -_0803C42E: - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - b _0803C6C4 - .pool -_0803C440: - bl sub_806B8B0 - lsls r0, 24 - cmp r0, 0 - bne _0803C44C - b _0803C6C4 -_0803C44C: - ldr r1, =0x02024220 - ldr r3, =0x02024064 - ldrb r0, [r3] - lsls r0, 2 - adds r0, r1 - ldr r1, =gUnknown_082DAB11 - str r1, [r0] - ldr r0, =0x02024332 - ldrb r1, [r3] - adds r1, r0 - movs r4, 0 - movs r0, 0x6 - strb r0, [r1] - ldrb r1, [r3] - ldr r2, =0x0202449c - ldr r0, [r2] - adds r1, r0 - adds r1, 0x54 - strb r4, [r1] - ldrb r1, [r3] - b _0803C7A0 - .pool -_0803C48C: - ldr r2, =0x0202449c - ldr r4, =0x02024064 - ldrb r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - adds r0, 0x60 - ldr r1, [r2] - adds r1, r0 - movs r0, 0 - bl sub_8033E6C - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _0803C6C4 - .pool -_0803C4B4: - ldr r4, =0x02024332 - ldr r5, =0x02024064 - ldrb r0, [r5] - adds r0, r4 - movs r1, 0x7 - strb r1, [r0] - ldrb r0, [r5] - bl battle_get_per_side_status - movs r6, 0x2 - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - movs r1, 0x1 - strb r1, [r0] - ldrb r0, [r5] - bl sub_8185008 - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - ldr r1, =0x02024084 - lsls r0, 24 - lsrs r0, 24 - movs r7, 0x58 - muls r0, r7 - adds r4, r1, 0 - adds r4, 0x50 - adds r0, r4 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 5 - ands r0, r1 - cmp r0, 0 - bne _0803C532 - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - muls r0, r7 - adds r0, r4 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _0803C550 -_0803C532: - movs r0, 0 - bl dp01_build_cmdbuf_x32_32_32_32 - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - bl _0803CD70 - .pool -_0803C550: - ldr r4, =0x0202421c - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x2 - bne _0803C590 - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl sub_8185008 - b _0803C6AE - .pool -_0803C590: - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x3 - bne _0803C5B6 - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r6 - b _0803C668 -_0803C5B6: - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _0803C628 - ldr r4, =0x0202433c - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 20 - adds r0, r4 - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _0803C616 - ldr r4, =0x020242bc - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r6 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r1, 0x6] - cmp r0, 0 - beq _0803C628 -_0803C616: - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r6 - b _0803C668 - .pool -_0803C628: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _0803C690 - ldr r4, =0x0202421c - ldr r6, =0x02024064 - ldrb r0, [r6] - bl battle_get_per_side_status - movs r5, 0x2 - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _0803C690 - ldr r1, =0x03005d80 - ldr r0, =0x0203bd30 - ldr r0, [r0] - str r0, [r1] - ldrb r0, [r6] - bl battle_get_per_side_status - eors r0, r5 -_0803C668: - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_8185008 - b _0803C6AE - .pool -_0803C690: - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_get_per_side_status - movs r1, 0x2 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - bl sub_8185008 -_0803C6AE: - movs r0, 0 - bl dp01_build_cmdbuf_x32_32_32_32 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - b _0803CD70 - .pool -_0803C6C4: - ldr r1, =0x02022fec - ldr r2, [r1] - movs r5, 0x8 - adds r0, r2, 0 - ands r0, r5 - adds r3, r1, 0 - cmp r0, 0 - beq _0803C720 - ldr r0, =0x043f0100 - ands r2, r0 - cmp r2, 0 - beq _0803C720 - ldr r0, =0x02023864 - ldr r4, =0x02024064 - ldrb r2, [r4] - lsls r1, r2, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x3 - bne _0803C720 - ldr r1, =0x02024220 - lsls r0, r2, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB9BA - str r1, [r0] - ldr r1, =0x02024332 - ldrb r0, [r4] - adds r0, r1 - movs r3, 0 - strb r5, [r0] - b _0803C792 - .pool -_0803C720: - ldr r0, [r3] - ldr r1, =0x0200000a - ands r0, r1 - cmp r0, 0x8 - bne _0803C760 - ldr r0, =0x02023864 - ldr r4, =0x02024064 - ldrb r1, [r4] - lsls r1, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x3 - bne _0803C760 - ldr r0, =gUnknown_082DAAFE - bl b_call_bc_move_exec - ldr r1, =0x02024332 - ldrb r0, [r4] - adds r0, r1 - b _0803CC20 - .pool -_0803C760: - bl sub_803BB88 - lsls r0, 24 - cmp r0, 0 - beq _0803C7C4 - ldr r0, =0x02023864 - ldr r4, =0x02024064 - ldrb r2, [r4] - lsls r1, r2, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x3 - bne _0803C7C4 - ldr r1, =0x02024220 - lsls r0, r2, 2 - adds r0, r1 - ldr r1, =gUnknown_082DAB0B -_0803C784: - str r1, [r0] - ldr r0, =0x02024332 - ldrb r1, [r4] - adds r1, r0 - movs r3, 0 - movs r0, 0x6 - strb r0, [r1] -_0803C792: - ldrb r1, [r4] - ldr r2, =0x0202449c - ldr r0, [r2] - adds r1, r0 - adds r1, 0x54 - strb r3, [r1] - ldrb r1, [r4] -_0803C7A0: - ldr r0, [r2] - adds r1, r0 - adds r1, 0x84 - movs r0, 0x1 - strb r0, [r1] - b _0803CD70 - .pool -_0803C7C4: - ldr r2, =0x02024332 - ldr r0, =0x02024064 - ldrb r1, [r0] - adds r1, r2 - b _0803CB74 - .pool -_0803C7D8: - ldr r4, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldr r3, =0x02024064 - ldrb r5, [r3] - lsls r0, r5, 2 - adds r0, r1 - ldr r2, [r0] - lsls r0, r2, 4 - movs r1, 0xF0 - lsls r1, 24 - orrs r0, r1 - orrs r0, r2 - lsls r1, r2, 8 - orrs r0, r1 - lsls r2, 12 - orrs r0, r2 - ldr r1, [r4] - ands r1, r0 - adds r4, r3, 0 - cmp r1, 0 - beq _0803C804 - b _0803CD04 -_0803C804: - ldr r1, =0x0202421c - adds r0, r5, r1 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0x9 - bls _0803C812 - b _0803CD04 -_0803C812: - lsls r0, 2 - ldr r1, =_0803C830 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0803C830: - .4byte _0803C858 - .4byte _0803C99C - .4byte _0803C9D4 - .4byte _0803CA0A - .4byte _0803CA2C - .4byte _0803CA40 - .4byte _0803CA54 - .4byte _0803CA84 - .4byte _0803CA98 - .4byte _0803CABC -_0803C858: - ldr r1, =0x02023864 - ldrb r3, [r4] - lsls r0, r3, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r1, [r0] - cmp r1, 0x3 - blt _0803C88A - cmp r1, 0x9 - ble _0803C878 - cmp r1, 0xF - beq _0803C87E - b _0803C88A - .pool -_0803C878: - adds r0, r3, r2 - strb r1, [r0] - b _0803CD70 -_0803C87E: - adds r1, r3, r2 - movs r0, 0x2 - strb r0, [r1] - bl sub_803CDF8 - b _0803CD70 -_0803C88A: - movs r0, 0x2 - bl sub_818603C - ldr r4, =0x02023864 - ldr r6, =0x02024064 - ldrb r3, [r6] - lsls r1, r3, 9 - adds r5, r4, 0x2 - adds r0, r1, r5 - ldrb r2, [r0] - adds r7, r4, 0x3 - adds r1, r7 - ldrb r0, [r1] - lsls r0, 8 - orrs r2, r0 - ldr r0, =0x0000ffff - cmp r2, r0 - bne _0803C8D0 - ldr r0, =0x02024332 - adds r0, r3, r0 - movs r1, 0x1 - strb r1, [r0] - ldrb r0, [r6] - bl sub_8185008 - b _0803CD04 - .pool -_0803C8D0: - bl sub_803FB4C - lsls r0, 24 - cmp r0, 0 - beq _0803C91C - ldrb r0, [r6] - movs r1, 0x1 - bl sub_8185008 - ldr r0, =0x02024332 - ldrb r1, [r6] - adds r1, r0 - movs r3, 0 - movs r0, 0x6 - strb r0, [r1] - ldrb r1, [r6] - ldr r2, =0x0202449c - ldr r0, [r2] - adds r1, r0 - adds r1, 0x54 - strb r3, [r1] - ldrb r0, [r6] - lsls r0, 9 - adds r1, r4, 0x1 - adds r0, r1 - strb r3, [r0] - ldrb r1, [r6] - ldr r0, [r2] - adds r1, r0 - adds r1, 0x84 - movs r0, 0x2 - strb r0, [r1] - b _0803CD70 - .pool -_0803C91C: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - bne _0803C942 - ldrb r0, [r6] - lsls r1, r0, 9 - adds r1, r5 - ldrb r1, [r1] - bl sub_8184FBC - ldrb r0, [r6] - lsls r1, r0, 9 - adds r1, r7 - ldrb r1, [r1] - bl sub_8184FBC -_0803C942: - ldrb r0, [r6] - ldr r4, =0x0202449c - ldr r1, [r4] - adds r1, r0, r1 - adds r1, 0x80 - lsls r0, 9 - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1] - ldr r0, =0x02024274 - ldrb r2, [r6] - lsls r5, r2, 1 - adds r5, r0 - ldr r3, =0x02024084 - ldr r4, [r4] - adds r0, r2, r4 - adds r0, 0x80 - ldrb r0, [r0] - lsls r0, 1 - movs r1, 0x58 - muls r1, r2 - adds r0, r1 - adds r3, 0xC - adds r0, r3 - ldrh r0, [r0] - strh r0, [r5] - ldrb r0, [r6] - adds r4, r0, r4 - lsls r0, 9 - adds r0, r7 - ldrb r0, [r0] - strb r0, [r4, 0xC] - ldr r0, =0x02024332 - ldrb r1, [r6] - b _0803CB72 - .pool -_0803C99C: - ldr r2, =0x02023864 - ldr r5, =0x02024064 - ldrb r4, [r5] - lsls r1, r4, 9 - adds r0, r2, 0x1 - adds r0, r1, r0 - ldrb r3, [r0] - adds r2, 0x2 - adds r1, r2 - ldrb r0, [r1] - lsls r0, 8 - orrs r3, r0 - cmp r3, 0 - bne _0803C9BA - b _0803CC1C -_0803C9BA: - ldr r0, =0x02024208 - strh r3, [r0] - ldr r0, =0x02024332 - ldrb r1, [r5] - b _0803CB72 - .pool -_0803C9D4: - ldr r0, =0x02023864 - ldr r4, =0x02024064 - ldrb r2, [r4] - lsls r1, r2, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x6 - bne _0803CA04 - ldr r0, =0x02024332 - adds r0, r2, r0 - movs r1, 0x1 - strb r1, [r0] - ldrb r0, [r4] - bl sub_8185008 - b _0803CD04 - .pool -_0803CA04: - bl sub_803CDF8 - b _0803CB6E -_0803CA0A: - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 8 - orrs r0, r1 - str r0, [r2] - ldr r2, =0x02024332 - ldr r0, =0x02024064 - ldrb r1, [r0] - adds r1, r2 - b _0803CB74 - .pool -_0803CA2C: - ldr r2, =0x02024332 - ldr r0, =0x02024064 - ldrb r1, [r0] - adds r1, r2 - b _0803CB74 - .pool -_0803CA40: - ldr r2, =0x02024332 - ldr r0, =0x02024064 - ldrb r1, [r0] - adds r1, r2 - b _0803CB74 - .pool -_0803CA54: - ldr r3, =0x02023864 - ldr r0, =0x02024064 - ldrb r4, [r0] - lsls r1, r4, 9 - adds r0, r3, 0x1 - adds r0, r1, r0 - ldrb r2, [r0] - adds r3, 0x2 - adds r1, r3 - ldrb r0, [r1] - lsls r0, 8 - orrs r2, r0 - cmp r2, 0 - bne _0803CA72 - b _0803CC1C -_0803CA72: - ldr r1, =0x02024332 - adds r1, r4, r1 - b _0803CB74 - .pool -_0803CA84: - ldr r2, =0x02024332 - ldr r0, =0x02024064 - ldrb r1, [r0] - adds r1, r2 - b _0803CB74 - .pool -_0803CA98: - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 8 - orrs r0, r1 - str r0, [r2] - ldr r2, =0x02024332 - ldr r0, =0x02024064 - ldrb r1, [r0] - adds r1, r2 - b _0803CB74 - .pool -_0803CABC: - ldr r2, =0x02024332 - ldr r0, =0x02024064 - ldrb r1, [r0] - adds r1, r2 - b _0803CB74 - .pool -_0803CAD0: - ldr r3, =0x02024068 - ldr r6, =gUnknown_0832A328 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r6 - ldr r2, [r0] - lsls r1, r2, 4 - movs r0, 0xF0 - lsls r0, 24 - orrs r1, r0 - orrs r1, r2 - lsls r0, r2, 8 - orrs r1, r0 - lsls r2, 12 - orrs r1, r2 - ldr r0, [r3] - ands r0, r1 - cmp r0, 0 - beq _0803CAFA - b _0803CD04 -_0803CAFA: - bl sub_803CDB8 - lsls r0, 24 - lsrs r0, 24 - negs r1, r0 - orrs r1, r0 - lsrs r4, r1, 31 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x41 - ands r0, r1 - cmp r0, 0x1 - bne _0803CB3C - movs r1, 0x2 - movs r0, 0x2 - ands r0, r5 - cmp r0, 0 - bne _0803CB3C - adds r0, r5, 0 - eors r0, r1 - bl battle_get_side_with_given_state - ldr r1, =0x0202449c - ldr r1, [r1] - adds r1, 0x91 - ldrb r1, [r1] - lsls r0, 24 - lsrs r0, 22 - adds r0, r6 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _0803CB5C -_0803CB3C: - movs r0, 0 - movs r1, 0 - adds r2, r4, 0 - bl sub_8034464 - b _0803CB66 - .pool -_0803CB5C: - movs r0, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl sub_8034464 -_0803CB66: - ldr r4, =0x02024064 -_0803CB68: - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803CB6E: - ldr r0, =0x02024332 - ldrb r1, [r4] -_0803CB72: - adds r1, r0 -_0803CB74: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0803CD04 - .pool -_0803CB84: - ldr r3, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r2, [r0] - lsls r1, r2, 4 - movs r0, 0xF0 - lsls r0, 24 - orrs r1, r0 - orrs r1, r2 - lsls r0, r2, 8 - orrs r1, r0 - lsls r2, 12 - orrs r1, r2 - ldr r0, [r3] - ands r0, r1 - cmp r0, 0 - beq _0803CBAE - b _0803CD04 -_0803CBAE: - ldr r1, =0x02024332 - ldrb r0, [r1, 0x4] - adds r0, 0x1 - strb r0, [r1, 0x4] - b _0803CD04 - .pool -_0803CBC8: - ldr r5, =0x02024064 - ldrb r2, [r5] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r1, r2, r0 - adds r0, r1, 0 - adds r0, 0x54 - ldrb r0, [r0] - cmp r0, 0 - beq _0803CCB4 - ldr r0, =0x02024332 - adds r0, r2, r0 - adds r1, 0x84 - ldrb r1, [r1] - strb r1, [r0] - b _0803CD04 - .pool -_0803CBF4: - ldr r3, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldr r0, =0x02024064 - ldrb r4, [r0] - lsls r0, r4, 2 - adds r0, r1 - ldr r2, [r0] - lsls r1, r2, 4 - movs r0, 0xF0 - lsls r0, 24 - orrs r1, r0 - orrs r1, r2 - lsls r0, r2, 8 - orrs r1, r0 - lsls r2, 12 - orrs r1, r2 - ldr r0, [r3] - ands r0, r1 - cmp r0, 0 - bne _0803CD04 -_0803CC1C: - ldr r0, =0x02024332 - adds r0, r4, r0 -_0803CC20: - movs r1, 0x1 - strb r1, [r0] - b _0803CD04 - .pool -_0803CC38: - ldr r5, =0x02024064 - ldrb r2, [r5] - ldr r4, =0x0202449c - ldr r0, [r4] - adds r0, r2, r0 - adds r0, 0x54 - ldrb r0, [r0] - cmp r0, 0 - beq _0803CCB4 - ldr r0, =0x02023864 - lsls r1, r2, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0xD - bne _0803CC94 - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 8 - orrs r0, r1 - str r0, [r2] - ldr r1, =0x0202421c - ldrb r0, [r5] - adds r0, r1 - movs r1, 0x3 - strb r1, [r0] - ldr r1, =0x02024332 - ldrb r0, [r5] -_0803CC72: - adds r0, r1 - movs r1, 0x4 - strb r1, [r0] - b _0803CD04 - .pool -_0803CC94: - adds r0, r2, 0 - movs r1, 0x1 - bl sub_8185008 - ldr r2, =0x02024332 - ldrb r0, [r5] - adds r2, r0, r2 - ldr r1, [r4] - adds r0, r1 - adds r0, 0x84 - ldrb r0, [r0] - strb r0, [r2] - b _0803CD04 - .pool -_0803CCB4: - ldr r0, =0x0202420b - strb r2, [r0] - ldr r7, =0x02024214 - ldr r6, =0x02024220 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r6 - ldr r4, [r0] - str r4, [r7] - ldr r3, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r2, [r0] - lsls r1, r2, 4 - movs r0, 0xF0 - lsls r0, 24 - orrs r1, r0 - orrs r1, r2 - lsls r0, r2, 8 - orrs r1, r0 - lsls r2, 12 - orrs r1, r2 - ldr r0, [r3] - ands r0, r1 - cmp r0, 0 - bne _0803CCFA - ldr r0, =gUnknown_0831BD10 - ldrb r1, [r4] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 -_0803CCFA: - ldrb r0, [r5] - lsls r0, 2 - adds r0, r6 - ldr r1, [r7] - str r1, [r0] -_0803CD04: - ldr r0, =0x02024064 - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - ldr r0, =0x0202406c - lsls r1, 24 - lsrs r1, 24 -_0803CD12: - adds r5, r0, 0 - ldrb r0, [r5] - cmp r1, r0 - bcs _0803CD1E - bl _0803BE9C -_0803CD1E: - ldr r0, =0x02024332 - ldrb r0, [r0, 0x4] - ldrb r1, [r5] - cmp r0, r1 - bne _0803CD70 - movs r0, 0x1 - bl sub_818603C - ldr r1, =0x03005d04 - ldr r0, =sub_803D2E8 - str r0, [r1] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _0803CD70 - movs r4, 0 - ldrb r5, [r5] - cmp r4, r5 - bge _0803CD70 -_0803CD4A: - ldr r0, =0x0202421c - adds r0, r4, r0 - ldrb r0, [r0] - cmp r0, 0x2 - bne _0803CD66 - lsls r0, r4, 24 - lsrs r0, 24 - ldr r1, =0x0202449c - ldr r1, [r1] - adds r1, r4, r1 - adds r1, 0x5C - ldrb r1, [r1] - bl sub_80571DC -_0803CD66: - adds r4, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _0803CD4A -_0803CD70: - 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_803BE74 - - thumb_func_start sub_803CDB8 -sub_803CDB8: @ 803CDB8 - push {r4,r5,lr} - movs r3, 0 - movs r1, 0 - ldr r0, =0x0202406c - ldrb r2, [r0] - adds r5, r0, 0 - cmp r3, r2 - bge _0803CDDA - ldr r4, =0x02024332 -_0803CDCA: - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0x5 - bne _0803CDD4 - adds r3, 0x1 -_0803CDD4: - adds r1, 0x1 - cmp r1, r2 - blt _0803CDCA -_0803CDDA: - adds r0, r3, 0x1 - ldrb r5, [r5] - cmp r0, r5 - beq _0803CDF0 - movs r0, 0 - b _0803CDF2 - .pool -_0803CDF0: - movs r0, 0x1 -_0803CDF2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_803CDB8 - - thumb_func_start sub_803CDF8 -sub_803CDF8: @ 803CDF8 - push {r4-r7,lr} - ldr r7, =0x02024064 - ldrb r0, [r7] - ldr r6, =0x0202449c - ldr r1, [r6] - adds r1, r0, r1 - adds r1, 0x5C - ldr r4, =0x02023864 - lsls r0, 9 - adds r2, r4, 0x1 - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r7] - lsls r1, r0, 9 - adds r1, r2 - ldrb r1, [r1] - bl sub_8184FBC - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x42 - ands r0, r1 - cmp r0, 0x42 - bne _0803CEC6 - ldrb r0, [r7] - ldr r2, [r6] - lsls r1, r0, 1 - adds r1, r0 - adds r1, r2 - adds r1, 0x60 - ldrb r2, [r1] - movs r0, 0xF - ands r0, r2 - strb r0, [r1] - ldrb r0, [r7] - ldr r2, [r6] - lsls r1, r0, 1 - adds r1, r0 - adds r1, r2 - adds r1, 0x60 - lsls r0, 9 - adds r5, r4, 0x2 - adds r0, r5 - ldrb r2, [r0] - movs r3, 0xF0 - adds r0, r3, 0 - ands r0, r2 - ldrb r2, [r1] - orrs r0, r2 - strb r0, [r1] - ldrb r1, [r7] - ldr r2, [r6] - lsls r0, r1, 1 - adds r0, r1 - adds r0, r2 - adds r0, 0x61 - lsls r1, 9 - adds r4, 0x3 - mov r12, r4 - add r1, r12 - ldrb r1, [r1] - strb r1, [r0] - ldrb r0, [r7] - movs r4, 0x2 - eors r0, r4 - ldr r2, [r6] - lsls r1, r0, 1 - adds r1, r0 - adds r1, r2 - adds r1, 0x60 - ldrb r2, [r1] - adds r0, r3, 0 - ands r0, r2 - strb r0, [r1] - ldrb r0, [r7] - eors r0, r4 - ldr r2, [r6] - lsls r1, r0, 1 - adds r1, r0 - adds r1, r2 - adds r1, 0x60 - ldrb r0, [r7] - lsls r0, 9 - adds r0, r5 - ldrb r0, [r0] - ands r3, r0 - lsrs r3, 4 - ldrb r0, [r1] - orrs r3, r0 - strb r3, [r1] - ldrb r0, [r7] - eors r4, r0 - ldr r0, [r6] - lsls r1, r4, 1 - adds r1, r4 - adds r1, r0 - adds r1, 0x62 - ldrb r0, [r7] - lsls r0, 9 - add r0, r12 - ldrb r0, [r0] - strb r0, [r1] -_0803CEC6: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803CDF8 - - thumb_func_start sub_803CEDC -sub_803CEDC: @ 803CEDC - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x0202407a - adds r4, r0, r2 - ldrb r5, [r4] - adds r2, r1, r2 - ldrb r3, [r2] - strb r3, [r4] - strb r5, [r2] - ldr r2, =0x0202407e - adds r0, r2 - ldrb r5, [r0] - adds r1, r2 - ldrb r2, [r1] - strb r2, [r0] - strb r5, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803CEDC - - thumb_func_start b_first_side -b_first_side: @ 803CF10 - 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 r9, r0 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _0803CFD8 - ldr r1, [sp, 0x8] - str r1, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _0803CFD8 - ldr r1, =0x02024084 - movs r0, 0x58 - mov r2, r9 - muls r2, r0 - adds r0, r2, 0 - adds r0, r1 - adds r0, 0x20 - ldrb r3, [r0] - cmp r3, 0x21 - bne _0803CF7C - ldr r0, =0x020243cc - ldrh r1, [r0] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0803CF8C -_0803CF7C: - cmp r3, 0x22 - bne _0803CF98 - ldr r0, =0x020243cc - ldrh r1, [r0] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _0803CF98 -_0803CF8C: - movs r3, 0x2 - b _0803CF9A - .pool -_0803CF98: - movs r3, 0x1 -_0803CF9A: - movs r0, 0x58 - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - ldr r2, =0x02024084 - adds r0, r2 - adds r0, 0x20 - ldrb r2, [r0] - cmp r2, 0x21 - bne _0803CFBA - ldr r0, =0x020243cc - ldrh r1, [r0] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0803CFCA -_0803CFBA: - cmp r2, 0x22 - bne _0803CFDA - ldr r0, =0x020243cc - ldrh r1, [r0] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _0803CFDA -_0803CFCA: - movs r7, 0x2 - b _0803CFDC - .pool -_0803CFD8: - movs r3, 0x1 -_0803CFDA: - movs r7, 0x1 -_0803CFDC: - ldr r1, =0x02024084 - movs r0, 0x58 - mov r2, r9 - muls r2, r0 - adds r0, r2, 0 - adds r4, r0, r1 - ldrh r0, [r4, 0x6] - muls r3, r0 - ldr r2, =gUnknown_08329D2E - movs r1, 0x1B - ldrsb r1, [r4, r1] - lsls r1, 1 - adds r0, r1, r2 - ldrb r0, [r0] - muls r0, r3 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - bl __divsi3 - mov r8, r0 - ldrh r0, [r4, 0x2E] - cmp r0, 0xAF - bne _0803D02C - ldr r1, =0x02024404 - mov r3, r9 - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r6, [r0, 0x7] - ldrb r5, [r0, 0x1A] - b _0803D040 - .pool -_0803D02C: - ldrh r0, [r4, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r6, r0, 24 - ldrh r0, [r4, 0x2E] - bl itemid_get_quality - lsls r0, 24 - lsrs r5, r0, 24 -_0803D040: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x023f0102 - ands r0, r1 - cmp r0, 0 - bne _0803D074 - ldr r0, =0x00000869 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0803D074 - mov r0, r9 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0803D074 - movs r0, 0x6E - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - movs r1, 0x64 - bl __udivsi3 - mov r8, r0 -_0803D074: - cmp r6, 0x18 - bne _0803D07E - mov r2, r8 - lsrs r2, 1 - mov r8, r2 -_0803D07E: - ldr r1, =0x02024084 - movs r0, 0x58 - mov r3, r9 - muls r3, r0 - adds r0, r3, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0803D09C - mov r0, r8 - lsrs r0, 2 - mov r8, r0 -_0803D09C: - cmp r6, 0x1A - bne _0803D0B8 - ldr r0, =0x02024330 - ldrh r4, [r0] - lsls r0, r5, 16 - subs r0, r5 - movs r1, 0x64 - bl __divsi3 - cmp r4, r0 - bge _0803D0B8 - movs r1, 0x1 - negs r1, r1 - mov r8, r1 -_0803D0B8: - ldr r1, =0x02024084 - movs r0, 0x58 - mov r2, r10 - muls r2, r0 - adds r0, r2, 0 - adds r4, r0, r1 - ldrh r0, [r4, 0x6] - adds r3, r0, 0 - muls r3, r7 - ldr r2, =gUnknown_08329D2E - movs r1, 0x1B - ldrsb r1, [r4, r1] - lsls r1, 1 - adds r0, r1, r2 - ldrb r0, [r0] - muls r0, r3 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - bl __divsi3 - adds r7, r0, 0 - ldrh r0, [r4, 0x2E] - cmp r0, 0xAF - bne _0803D118 - ldr r1, =0x02024404 - mov r3, r10 - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r6, [r0, 0x7] - ldrb r5, [r0, 0x1A] - b _0803D12C - .pool -_0803D118: - ldrh r0, [r4, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r6, r0, 24 - ldrh r0, [r4, 0x2E] - bl itemid_get_quality - lsls r0, 24 - lsrs r5, r0, 24 -_0803D12C: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x023f0102 - ands r0, r1 - cmp r0, 0 - bne _0803D15C - ldr r0, =0x00000869 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0803D15C - mov r0, r10 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0803D15C - movs r0, 0x6E - muls r0, r7 - movs r1, 0x64 - bl __udivsi3 - adds r7, r0, 0 -_0803D15C: - cmp r6, 0x18 - bne _0803D162 - lsrs r7, 1 -_0803D162: - ldr r2, =0x02024084 - movs r0, 0x58 - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - adds r1, r2, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0803D17E - lsrs r7, 2 -_0803D17E: - cmp r6, 0x1A - bne _0803D198 - ldr r0, =0x02024330 - ldrh r4, [r0] - lsls r0, r5, 16 - subs r0, r5 - movs r1, 0x64 - bl __divsi3 - cmp r4, r0 - bge _0803D198 - movs r7, 0x1 - negs r7, r7 -_0803D198: - ldr r2, [sp, 0x4] - cmp r2, 0 - beq _0803D1B8 - movs r3, 0 - b _0803D254 - .pool -_0803D1B8: - ldr r0, =0x0202421c - mov r3, r9 - adds r1, r3, r0 - ldrb r1, [r1] - adds r2, r0, 0 - cmp r1, 0 - bne _0803D208 - ldr r0, =0x0202433c - lsls r1, r3, 4 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 29 - cmp r0, 0 - bge _0803D1E0 - movs r3, 0xA5 - b _0803D20A - .pool -_0803D1E0: - ldr r0, =0x0202449c - ldr r0, [r0] - add r0, r9 - adds r0, 0x80 - ldrb r0, [r0] - lsls r0, 1 - movs r1, 0x58 - mov r3, r9 - muls r3, r1 - adds r1, r3, 0 - adds r0, r1 - ldr r1, =0x02024084 - adds r1, 0xC - adds r0, r1 - ldrh r3, [r0] - b _0803D20A - .pool -_0803D208: - movs r3, 0 -_0803D20A: - mov r1, r10 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _0803D254 - ldr r0, =0x0202433c - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 29 - cmp r0, 0 - bge _0803D22C - movs r2, 0xA5 - b _0803D256 - .pool -_0803D22C: - ldr r0, =0x0202449c - ldr r0, [r0] - add r0, r10 - adds r0, 0x80 - ldrb r0, [r0] - lsls r0, 1 - movs r1, 0x58 - mov r2, r10 - muls r2, r1 - adds r1, r2, 0 - adds r0, r1 - ldr r1, =0x02024084 - adds r1, 0xC - adds r0, r1 - ldrh r2, [r0] - b _0803D256 - .pool -_0803D254: - movs r2, 0 -_0803D256: - ldr r4, =gBattleMoves - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r4 - movs r1, 0x7 - ldrsb r1, [r0, r1] - lsls r3, r2, 1 - cmp r1, 0 - bne _0803D27A - adds r0, r3, r2 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x7] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - beq _0803D2B8 -_0803D27A: - adds r0, r3, r2 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x7] - lsls r0, 24 - asrs r0, 24 - cmp r1, r0 - bne _0803D2AE - cmp r8, r7 - bne _0803D2A4 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0803D2A4 - movs r3, 0x2 - b _0803D2D4 - .pool -_0803D2A4: - cmp r8, r7 - bcs _0803D2D6 - movs r0, 0x1 - str r0, [sp, 0x8] - b _0803D2D6 -_0803D2AE: - cmp r1, r0 - bge _0803D2D6 - movs r1, 0x1 - str r1, [sp, 0x8] - b _0803D2D6 -_0803D2B8: - cmp r8, r7 - bne _0803D2CE - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0803D2CE - movs r2, 0x2 - str r2, [sp, 0x8] - b _0803D2D6 -_0803D2CE: - cmp r8, r7 - bcs _0803D2D6 - movs r3, 0x1 -_0803D2D4: - str r3, [sp, 0x8] -_0803D2D6: - ldr r0, [sp, 0x8] - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end b_first_side - - thumb_func_start sub_803D2E8 -sub_803D2E8: @ 803D2E8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r3, 0 - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0803D354 - ldr r0, =0x02024064 - strb r3, [r0] - ldr r4, =0x0202406c - mov r8, r0 - ldrb r0, [r4] - cmp r3, r0 - bcc _0803D310 - b _0803D54A -_0803D310: - ldr r7, =0x0202407a - ldr r6, =0x0202421c - mov r2, r8 - ldr r5, =0x0202407e -_0803D318: - adds r1, r3, r7 - ldrb r0, [r2] - adds r0, r6 - ldrb r0, [r0] - strb r0, [r1] - adds r1, r3, r5 - ldrb r0, [r2] - strb r0, [r1] - adds r3, 0x1 - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r4] - cmp r0, r1 - bcc _0803D318 - b _0803D54A - .pool -_0803D354: - movs r2, 0x2 - ands r1, r2 - cmp r1, 0 - beq _0803D3A4 - ldr r0, =0x02024064 - strb r3, [r0] - ldr r1, =0x0202406c - mov r8, r0 - adds r2, r1, 0 - ldrb r2, [r2] - cmp r3, r2 - bcs _0803D3C0 - ldr r0, =0x0202421c - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0x3 - beq _0803D3BE -_0803D376: - mov r7, r8 - ldrb r0, [r7] - adds r0, 0x1 - strb r0, [r7] - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0202406c - ldrb r1, [r1] - cmp r0, r1 - bcs _0803D3C0 - ldrb r0, [r7] - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x3 - bne _0803D376 - b _0803D3BE - .pool -_0803D3A4: - ldr r1, =0x0202421c - ldrb r0, [r1] - ldr r4, =0x02024064 - mov r8, r4 - cmp r0, 0x3 - bne _0803D3B4 - strb r3, [r4] - movs r3, 0x5 -_0803D3B4: - ldrb r0, [r1, 0x2] - cmp r0, 0x3 - bne _0803D3C0 - mov r7, r8 - strb r2, [r7] -_0803D3BE: - movs r3, 0x5 -_0803D3C0: - cmp r3, 0x5 - bne _0803D448 - ldr r6, =0x0202407a - ldr r1, =0x0202421c - mov r2, r8 - ldrb r0, [r2] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r6] - ldr r2, =0x0202407e - mov r3, r8 - ldrb r0, [r3] - strb r0, [r2] - movs r3, 0x1 - movs r5, 0 - adds r4, r1, 0 - ldr r7, =0x03005d04 - mov r10, r7 - ldr r0, =bc_80154A0 - mov r12, r0 - ldr r1, =0x0202449c - mov r9, r1 - ldr r7, =0x0202406c - ldrb r7, [r7] - cmp r5, r7 - bge _0803D41A - adds r7, r6, 0 - adds r6, r4, 0 - adds r4, r2, 0 - ldr r2, =0x0202406c -_0803D3FC: - mov r0, r8 - ldrb r0, [r0] - cmp r5, r0 - beq _0803D412 - adds r1, r3, r7 - adds r0, r5, r6 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r3, r4 - strb r5, [r0] - adds r3, 0x1 -_0803D412: - adds r5, 0x1 - ldrb r1, [r2] - cmp r5, r1 - blt _0803D3FC -_0803D41A: - mov r2, r12 - mov r3, r10 - str r2, [r3] - mov r4, r9 - ldr r0, [r4] - b _0803D554 - .pool -_0803D448: - movs r0, 0 - mov r7, r8 - strb r0, [r7] - ldr r1, =0x0202406c - ldrb r0, [r1] - cmp r0, 0 - beq _0803D48E - ldr r6, =0x0202421c - mov r2, r8 - ldr r5, =0x0202407a - ldr r4, =0x0202407e -_0803D45E: - ldrb r0, [r2] - adds r0, r6 - ldrb r1, [r0] - subs r0, r1, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _0803D47C - adds r0, r3, r5 - strb r1, [r0] - adds r1, r3, r4 - mov r7, r8 - ldrb r0, [r7] - strb r0, [r1] - adds r3, 0x1 -_0803D47C: - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0202406c - ldrb r1, [r1] - cmp r0, r1 - bcc _0803D45E -_0803D48E: - movs r0, 0 - mov r2, r8 - strb r0, [r2] - ldr r4, =0x0202406c - ldrb r0, [r4] - cmp r0, 0 - beq _0803D4D2 - ldr r6, =0x0202421c - ldr r5, =0x0202407a - ldr r4, =0x0202407e -_0803D4A2: - ldrb r0, [r2] - adds r0, r6 - ldrb r1, [r0] - subs r0, r1, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _0803D4C0 - adds r0, r3, r5 - strb r1, [r0] - adds r1, r3, r4 - mov r7, r8 - ldrb r0, [r7] - strb r0, [r1] - adds r3, 0x1 -_0803D4C0: - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0202406c - ldrb r1, [r1] - cmp r0, r1 - bcc _0803D4A2 -_0803D4D2: - movs r5, 0 - b _0803D540 - .pool -_0803D4E8: - adds r4, r5, 0x1 - adds r7, r4, 0 - ldrb r1, [r1] - cmp r7, r1 - bge _0803D53E - ldr r6, =0x0202407a - lsls r2, r5, 24 - mov r8, r2 -_0803D4F8: - ldr r0, =0x0202407e - adds r1, r5, r0 - ldrb r3, [r1] - adds r0, r4, r0 - ldrb r1, [r0] - adds r0, r5, r6 - ldrb r2, [r0] - cmp r2, 0x1 - beq _0803D534 - adds r0, r4, r6 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0803D534 - cmp r2, 0x2 - beq _0803D534 - cmp r0, 0x2 - beq _0803D534 - adds r0, r3, 0 - movs r2, 0 - bl b_first_side - lsls r0, 24 - cmp r0, 0 - beq _0803D534 - lsls r1, r4, 24 - lsrs r1, 24 - mov r3, r8 - lsrs r0, r3, 24 - bl sub_803CEDC -_0803D534: - adds r4, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _0803D4F8 -_0803D53E: - adds r5, r7, 0 -_0803D540: - ldr r1, =0x0202406c - ldrb r0, [r1] - subs r0, 0x1 - cmp r5, r0 - blt _0803D4E8 -_0803D54A: - ldr r1, =0x03005d04 - ldr r0, =bc_80154A0 - str r0, [r1] - ldr r0, =0x0202449c - ldr r0, [r0] -_0803D554: - adds r0, 0x48 - movs r1, 0 - strb 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_803D2E8 - - thumb_func_start sub_803D580 -sub_803D580: @ 803D580 - 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 - ldr r1, =0x02024064 - movs r0, 0 - strb r0, [r1] - ldr r0, =0x0202406c - ldrb r2, [r0] - adds r5, r1, 0 - cmp r2, 0 - beq _0803D678 - ldr r7, =0x0202433c - adds r6, r5, 0 - ldr r0, =0x020240d4 - mov r12, r0 - ldr r1, =0x020242bc - mov r8, r1 - mov r10, r8 -_0803D5AE: - mov r2, r9 - cmp r2, 0 - beq _0803D5EC - ldrb r1, [r6] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldrb r1, [r6] - lsls r1, 4 - adds r1, r7 - ldrb r2, [r1] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - b _0803D648 - .pool -_0803D5EC: - ldrb r0, [r6] - lsls r0, 4 - adds r2, r0, r7 - movs r1, 0 - mov r4, r10 - movs r3, 0 -_0803D5F8: - adds r0, r2, r1 - strb r3, [r0] - adds r1, 0x1 - cmp r1, 0xF - bls _0803D5F8 - ldrb r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r0, r4 - ldrb r0, [r1, 0x16] - cmp r0, 0 - beq _0803D616 - subs r0, 0x1 - strb r0, [r1, 0x16] -_0803D616: - ldrb r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r0, r4 - ldrb r0, [r1, 0x19] - cmp r0, 0 - beq _0803D648 - subs r0, 0x1 - strb r0, [r1, 0x19] - ldrb r2, [r5] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x19] - cmp r0, 0 - bne _0803D648 - movs r0, 0x58 - muls r2, r0 - add r2, r12 - ldr r0, [r2] - ldr r1, =0xffbfffff - ands r0, r1 - str r0, [r2] -_0803D648: - ldrb r2, [r5] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - add r0, r8 - ldrb r0, [r0, 0xA] - cmp r0, 0 - bne _0803D666 - movs r0, 0x58 - muls r2, r0 - add r2, r12 - ldr r0, [r2] - ldr r1, =0xfeffffff - ands r0, r1 - str r0, [r2] -_0803D666: - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0202406c - ldrb r1, [r1] - cmp r0, r1 - bcc _0803D5AE -_0803D678: - movs r0, 0 - ldr r2, =0x02024294 - strb r0, [r2, 0x8] - strb r0, [r2, 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_803D580 - - thumb_func_start sub_803D6A0 -sub_803D6A0: @ 803D6A0 - push {r4-r6,lr} - ldr r2, =0x02024064 - movs r0, 0 - strb r0, [r2] - ldr r0, =0x0202406c - ldrb r1, [r0] - adds r6, r0, 0 - cmp r1, 0 - beq _0803D6DE - adds r3, r2, 0 - movs r4, 0 - ldr r5, =0x0202437c -_0803D6B8: - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, r0, r5 - movs r1, 0 -_0803D6C4: - adds r0, r2, r1 - strb r4, [r0] - adds r1, 0x1 - cmp r1, 0x13 - bls _0803D6C4 - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r6] - cmp r0, r1 - bcc _0803D6B8 -_0803D6DE: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803D6A0 - - thumb_func_start bc_80154A0 -bc_80154A0: @ 803D6F0 - push {r4-r7,lr} - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - bne _0803D7AE - ldr r2, =0x0202449c - ldr r0, [r2] - adds r0, 0x48 - ldr r1, =0x0202406c - ldrb r0, [r0] - mov r12, r2 - adds r6, r1, 0 - ldrb r1, [r6] - cmp r0, r1 - bcs _0803D7AE - ldr r5, =0x02024064 - ldr r4, =0x0202420b - movs r7, 0x84 - lsls r7, 1 -_0803D71C: - ldr r1, [r2] - adds r1, 0x48 - ldrb r0, [r1] - strb r0, [r4] - strb r0, [r5] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r1, =0x02024274 - ldrb r3, [r5] - lsls r0, r3, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r7 - bne _0803D7A0 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r3 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0803D7A0 - ldr r2, =0x020242bc - ldrb r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x18] - lsls r0, 31 - cmp r0, 0 - bne _0803D7A0 - ldr r0, =0x0202433c - lsls r1, r3, 4 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 29 - cmp r0, 0 - blt _0803D7A0 - ldr r0, =gUnknown_082DB1FF - bl b_call_bc_move_exec - b _0803D7E8 - .pool -_0803D7A0: - mov r2, r12 - ldr r0, [r2] - adds r0, 0x48 - ldrb r0, [r0] - ldrb r1, [r6] - cmp r0, r1 - bcc _0803D71C -_0803D7AE: - bl b_clear_atk_up_if_hit_flag_unless_enraged - ldr r1, =0x02024082 - movs r0, 0 - strb r0, [r1] - ldr r1, =0x02024083 - ldr r0, =0x0202407a - movs r3, 0 - ldrb r0, [r0] - strb r0, [r1] - ldr r0, =0x02024400 - movs r2, 0 - strh r3, [r0] - ldr r0, =0x0202449c - ldr r0, [r0] - strb r2, [r0, 0x13] - ldr r1, =0x03005d04 - ldr r0, =bc_bs_exec - str r0, [r1] - ldr r0, =0x02024332 - strb r2, [r0, 0x3] - strb r2, [r0, 0x4] - ldr r0, =0x02024474 - strb r2, [r0, 0x16] - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x8] - adds r0, 0x20 - strb r2, [r0] -_0803D7E8: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end bc_80154A0 - - thumb_func_start bc_bs_exec -bc_bs_exec: @ 803D818 - push {r4-r6,lr} - ldr r6, =0x0202433a - ldrb r0, [r6] - ldr r2, =0x02024083 - cmp r0, 0 - beq _0803D828 - movs r0, 0xC - strb r0, [r2] -_0803D828: - ldr r5, =0x0202449c - ldr r0, [r5] - adds r0, 0x4B - ldr r4, =0x02024082 - ldrb r1, [r4] - strb r1, [r0] - ldr r1, =gUnknown_0831BC0C - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =0x0202406c - ldrb r1, [r4] - ldrb r0, [r0] - cmp r1, r0 - bcc _0803D894 - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xffefffff - ands r0, r1 - str r0, [r2] - ldr r3, =0x03005d04 - ldr r2, =gUnknown_0831BC44 - ldrb r1, [r6] - movs r0, 0x7F - ands r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - str r0, [r3] - b _0803D8AC - .pool -_0803D894: - ldr r0, [r5] - adds r0, 0x4B - ldrb r0, [r0] - cmp r0, r1 - beq _0803D8AC - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xfffffdff - ands r0, r1 - ldr r1, =0xfff7ffff - ands r0, r1 - str r0, [r2] -_0803D8AC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bc_bs_exec - - thumb_func_start sub_803D8C0 -sub_803D8C0: @ 803D8C0 - push {r4,lr} - ldr r1, =0x02024083 - movs r0, 0 - strb r0, [r1] - ldr r1, =0x02022fec - ldr r2, [r1] - ldr r0, =0x02000002 - ands r0, r2 - cmp r0, 0 - beq _0803D920 - ldr r1, =0x020375f0 - ldr r4, =0x0202433a - ldrb r0, [r4] - strh r0, [r1] - ldr r1, =0x02022f58 - ldrb r0, [r4] - strb r0, [r1] - movs r0, 0 - bl battle_get_side_with_given_state - ldr r1, =0x0202420b - strb r0, [r1] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAA35 - str r0, [r1] - ldrb r1, [r4] - movs r0, 0x7F - ands r0, r1 - strb r0, [r4] - b _0803DAA4 - .pool -_0803D920: - movs r0, 0x8 - ands r0, r2 - cmp r0, 0 - beq _0803D95C - ldr r0, =0x043f0900 - ands r2, r0 - cmp r2, 0 - beq _0803D95C - bl sub_805EA60 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAA87 - str r0, [r1] - ldr r0, =0x02038bca - ldrh r1, [r0] - ldr r0, =0x000003fe - cmp r1, r0 - bne _0803D946 - b _0803DA8A -_0803D946: - b _0803DA94 - .pool -_0803D95C: - ldr r0, [r1] - movs r1, 0xA - ands r0, r1 - cmp r0, 0x8 - beq _0803D968 - b _0803DA9E -_0803D968: - bl sub_805EA60 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DA92D - str r0, [r1] - ldr r2, =gTrainers - ldr r0, =0x02038bca - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x1] - subs r0, 0x3 - cmp r0, 0x32 - bls _0803D98A - b _0803DA94 -_0803D98A: - lsls r0, 2 - ldr r1, =_0803D9A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0803D9A8: - .4byte _0803DA80 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA80 - .4byte _0803DA94 - .4byte _0803DA80 - .4byte _0803DA94 - .4byte _0803DA80 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA74 - .4byte _0803DA8A - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA74 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA80 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA94 - .4byte _0803DA80 -_0803DA74: - ldr r0, =0x00000163 - bl song_play_for_text - b _0803DAA4 - .pool -_0803DA80: - movs r0, 0xD4 - lsls r0, 1 - bl song_play_for_text - b _0803DAA4 -_0803DA8A: - movs r0, 0xB1 - lsls r0, 1 - bl song_play_for_text - b _0803DAA4 -_0803DA94: - movs r0, 0xCE - lsls r0, 1 - bl song_play_for_text - b _0803DAA4 -_0803DA9E: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DA96A - str r0, [r1] -_0803DAA4: - ldr r1, =0x03005d04 - ldr r0, =sub_803DCD8 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803D8C0 - - thumb_func_start sub_803DAC0 -sub_803DAC0: @ 803DAC0 - push {r4,lr} - ldr r1, =0x02024083 - movs r0, 0 - strb r0, [r1] - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r0, =0x02000002 - ands r0, r1 - cmp r0, 0 - beq _0803DB7C - ldr r0, =0x003f0100 - ands r1, r0 - cmp r1, 0 - beq _0803DB44 - ldr r3, =0x0202433a - ldrb r2, [r3] - movs r0, 0x80 - ands r0, r2 - cmp r0, 0 - beq _0803DB2C - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB9C8 - str r0, [r1] - movs r0, 0x7F - ands r0, r2 - strb r0, [r3] - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x8 - orrs r0, r2 - strb r0, [r1] - b _0803DB82 - .pool -_0803DB2C: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAA0B - str r0, [r1] - movs r0, 0x7F - ands r0, r2 - strb r0, [r3] - b _0803DB82 - .pool -_0803DB44: - ldr r1, =0x02022f58 - ldr r4, =0x0202433a - ldrb r0, [r4] - strb r0, [r1] - movs r0, 0 - bl battle_get_side_with_given_state - ldr r1, =0x0202420b - strb r0, [r1] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAA35 - str r0, [r1] - ldrb r1, [r4] - movs r0, 0x7F - ands r0, r1 - strb r0, [r4] - b _0803DB82 - .pool -_0803DB7C: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DA96D - str r0, [r1] -_0803DB82: - ldr r1, =0x03005d04 - ldr r0, =sub_803DCD8 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803DAC0 - - thumb_func_start sub_803DBA0 -sub_803DBA0: @ 803DBA0 - push {lr} - ldr r1, =0x02024083 - movs r0, 0 - strb r0, [r1] - ldr r1, =0x02022fec - ldr r2, [r1] - ldr r0, =0x003f0100 - ands r0, r2 - cmp r0, 0 - beq _0803DBFC - movs r0, 0x8 - ands r2, r0 - cmp r2, 0 - beq _0803DBFC - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB9C1 - str r0, [r1] - ldr r1, =0x0202433a - movs r0, 0x9 - strb r0, [r1] - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x8 - orrs r0, r2 - strb r0, [r1] - b _0803DC6A - .pool -_0803DBFC: - ldr r0, [r1] - movs r1, 0x80 - lsls r1, 19 - ands r0, r1 - cmp r0, 0 - beq _0803DC24 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB9C1 - str r0, [r1] - ldr r1, =0x0202433a - movs r0, 0x9 - strb r0, [r1] - b _0803DC6A - .pool -_0803DC24: - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x1] - lsls r0, 27 - lsrs r0, 30 - cmp r0, 0x1 - beq _0803DC54 - cmp r0, 0x2 - beq _0803DC64 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAAF0 - b _0803DC68 - .pool -_0803DC54: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAADB - b _0803DC68 - .pool -_0803DC64: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAAE9 -_0803DC68: - str r0, [r1] -_0803DC6A: - ldr r1, =0x03005d04 - ldr r0, =sub_803DCD8 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_803DBA0 - - thumb_func_start bc_80158BC -bc_80158BC: @ 803DC84 - ldr r1, =0x02024083 - movs r0, 0 - strb r0, [r1] - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x7 - strb r0, [r1, 0x1] - ldr r2, =0x0202420b - ldrb r0, [r2] - strb r0, [r1, 0x2] - ldr r3, =0x0202406e - ldrb r0, [r2] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAAF7 - str r0, [r1] - ldr r1, =0x03005d04 - ldr r0, =sub_803DCD8 - str r0, [r1] - bx lr - .pool - thumb_func_end bc_80158BC - - thumb_func_start sub_803DCD8 -sub_803DCD8: @ 803DCD8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x02024083 - ldrb r0, [r0] - subs r0, 0xB - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _0803DCEE - b _0803DE10 -_0803DCEE: - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r0, =0x023f0b92 - ands r1, r0 - cmp r1, 0 - bne _0803DDB6 - ldr r2, =0x02024064 - strb r1, [r2] - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r1, r0 - bcs _0803DDB2 - adds r5, r2, 0 - ldr r0, =0x0202406e - mov r8, r0 - movs r7, 0x64 - ldr r6, =0x020244ec -_0803DD10: - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0803DDA0 - ldr r4, =0x03005d10 - ldrh r0, [r4, 0x6] - cmp r0, 0 - bne _0803DD74 - ldrb r0, [r5] - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - muls r0, r7 - adds r0, r6 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - strh r0, [r4, 0x6] - ldrb r0, [r5] - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - muls r0, r7 - adds r0, r6 - movs r1, 0x2 - adds r2, r4, 0 - adds r2, 0x8 - bl pokemon_getattr - b _0803DDA0 - .pool -_0803DD74: - ldrb r0, [r5] - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - muls r0, r7 - adds r0, r6 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - strh r0, [r4, 0x26] - ldrb r0, [r5] - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - muls r0, r7 - adds r0, r6 - movs r1, 0x2 - adds r2, r4, 0 - adds r2, 0x14 - bl pokemon_getattr -_0803DDA0: - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803DD10 -_0803DDB2: - bl sub_80EC728 -_0803DDB6: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x023f0b9a - ands r0, r1 - cmp r0, 0 - bne _0803DDD2 - ldr r0, =0x03005d10 - ldrb r1, [r0, 0x5] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0803DDD2 - bl sub_80EE184 -_0803DDD2: - bl sub_8186444 - movs r0, 0x3 - bl sub_80A2390 - movs r0, 0x5 - bl sub_80A2F50 - ldr r1, =0x03005d04 - ldr r0, =sub_803DE40 - str r0, [r1] - ldr r1, =0x030061e8 - ldr r0, =sub_8038420 - str r0, [r1] - b _0803DE2A - .pool -_0803DE10: - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0803DE2A - ldr r1, =gUnknown_0831BD10 - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 -_0803DE2A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803DCD8 - - thumb_func_start sub_803DE40 -sub_803DE40: @ 803DE40 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0803DE86 - bl ResetAllObjectData - ldr r0, =0x03005d54 - ldrb r0, [r0] - cmp r0, 0 - beq _0803DE62 - ldr r0, =0x0202433a - ldrb r0, [r0] - cmp r0, 0x1 - beq _0803DE80 -_0803DE62: - ldr r1, =0x03005d04 - ldr r0, =c4_overworld - str r0, [r1] - b _0803DEA2 - .pool -_0803DE80: - ldr r1, =0x03005d04 - ldr r0, =bc_evolution_cutscene - str r0, [r1] -_0803DE86: - bl FreeAllWindowBuffers - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0803DEA2 - bl sub_805F094 - bl sub_8057028 - bl dp11_free -_0803DEA2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_803DE40 - - thumb_func_start bc_evolution_cutscene -bc_evolution_cutscene: @ 803DEB4 - push {r4-r6,lr} - ldr r0, =0x03005d54 - ldrb r1, [r0] - adds r3, r0, 0 - cmp r1, 0 - beq _0803DF2E -_0803DEC0: - movs r6, 0 -_0803DEC2: - ldrb r2, [r3] - ldr r0, =gUnknown_0832A328 - lsls r1, r6, 2 - adds r1, r0 - ldr r1, [r1] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _0803DF20 - bics r2, r1 - strb r2, [r3] - movs r0, 0x64 - adds r1, r6, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0 - bl GetEvolutionTargetSpecies - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _0803DF20 - bl FreeAllWindowBuffers - ldr r0, =0x03005d04 - ldr r1, =sub_803DF48 - str r1, [r0] - lsls r3, r6, 24 - lsrs r3, 24 - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl evolution_cutscene - b _0803DF34 - .pool -_0803DF20: - adds r6, 0x1 - ldr r3, =0x03005d54 - cmp r6, 0x5 - ble _0803DEC2 - ldrb r0, [r3] - cmp r0, 0 - bne _0803DEC0 -_0803DF2E: - ldr r1, =0x03005d04 - ldr r0, =c4_overworld - str r0, [r1] -_0803DF34: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bc_evolution_cutscene - - thumb_func_start sub_803DF48 -sub_803DF48: @ 803DF48 - push {lr} - ldr r0, =0x030022c0 - ldr r1, [r0, 0x4] - ldr r0, =sub_8038420 - cmp r1, r0 - bne _0803DF5A - ldr r1, =0x03005d04 - ldr r0, =bc_evolution_cutscene - str r0, [r1] -_0803DF5A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_803DF48 - - thumb_func_start c4_overworld -c4_overworld: @ 803DF70 - push {r4-r6,lr} - ldr r6, =0x02022fec - ldr r0, [r6] - movs r5, 0x2 - ands r0, r5 - cmp r0, 0 - bne _0803DF8C - ldr r4, =0x020244ec - adds r0, r4, 0 - bl sub_806DCB4 - adds r0, r4, 0 - bl sub_806DEC4 -_0803DF8C: - ldr r4, [r6] - adds r0, r4, 0 - ands r0, r5 - cmp r0, 0 - beq _0803DF9E - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0803DFEC -_0803DF9E: - ldr r1, =0x020375f0 - ldr r5, =0x0202433a - ldrb r0, [r5] - strh r0, [r1] - ldr r3, =0x030022c0 - ldr r0, =0x00000439 - adds r2, r3, r0 - ldrb r1, [r2] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r0, =0x03005d00 - ldr r0, [r0] - str r0, [r3] - movs r0, 0x80 - lsls r0, 3 - ands r4, r0 - cmp r4, 0 - beq _0803DFDE - ldr r0, =0x02024744 - bl sub_8161F18 - ldrb r1, [r5] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0803DFDA - cmp r1, 0x7 - bne _0803DFDE -_0803DFDA: - bl sub_8161F4C -_0803DFDE: - movs r0, 0x5A - bl m4aSongNumStop - ldr r0, =0x030022c0 - ldr r0, [r0, 0x8] - bl SetMainCallback2 -_0803DFEC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end c4_overworld - - thumb_func_start bc_move_exec_returning -bc_move_exec_returning: @ 803E018 - push {lr} - ldr r0, =0x02024083 - ldrb r0, [r0] - subs r0, 0xB - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _0803E060 - ldr r3, =0x020244a8 - ldr r0, [r3] - ldr r0, [r0, 0xC] - adds r1, r0, 0 - adds r1, 0x20 - ldrb r0, [r1] - cmp r0, 0 - beq _0803E03C - subs r0, 0x1 - strb r0, [r1] -_0803E03C: - ldr r2, =0x03005d04 - ldr r0, [r3] - ldr r1, [r0, 0xC] - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - lsls r0, 2 - adds r1, r0 - ldr r0, [r1] - str r0, [r2] - b _0803E07A - .pool -_0803E060: - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0803E07A - ldr r1, =gUnknown_0831BD10 - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 -_0803E07A: - pop {r0} - bx r0 - .pool - thumb_func_end bc_move_exec_returning - - thumb_func_start sub_803E08C -sub_803E08C: @ 803E08C - push {lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0803E0A8 - ldr r1, =gUnknown_0831BD10 - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 -_0803E0A8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_803E08C - - thumb_func_start sub_803E0B8 -sub_803E0B8: @ 803E0B8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r0, 0x4 - str r0, [sp] - ldr r6, =0x0202420b - ldr r1, =0x0202407e - ldr r0, =0x02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r6] - ldr r1, =0x0202449c - ldr r3, [r1] - adds r0, r3, 0 - adds r0, 0x91 - ldrb r2, [r0] - ldr r1, =gUnknown_0832A328 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ands r2, r0 - cmp r2, 0 - beq _0803E110 - ldr r1, =0x02024083 - movs r0, 0xC - b _0803E83C - .pool -_0803E110: - ldr r1, =0x02024211 - movs r0, 0x1 - strb r0, [r1] - ldr r1, =0x02024474 - movs r0, 0x1 - strb r0, [r1, 0xE] - ldr r5, =0x000001a3 - adds r0, r3, r5 - strb r2, [r0] - ldr r0, =0x0202427c - strb r2, [r0] - ldr r0, =0x02024212 - strb r2, [r0] - ldr r0, =0x02024332 - strb r2, [r0, 0x6] - ldr r2, =0x020241e8 - ldr r0, =0x020241e9 - mov r9, r0 - ldrb r0, [r6] - ldr r3, =0x0202449c - ldr r1, [r3] - adds r0, r1 - adds r0, 0x80 - ldrb r0, [r0] - mov r5, r9 - strb r0, [r5] - strb r0, [r2] - ldr r1, =0x0202433c - ldrb r4, [r6] - lsls r0, r4, 4 - adds r3, r0, r1 - ldrb r1, [r3] - lsls r0, r1, 29 - mov r8, r2 - cmp r0, 0 - bge _0803E1BC - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - ldr r2, =0x020241ea - ldr r1, =0x020241ec - movs r0, 0xA5 - strh r0, [r1] - strh r0, [r2] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 4 - orrs r0, r1 - str r0, [r2] - movs r0, 0xA5 - movs r1, 0 - bl sub_80458E0 - ldrb r1, [r6] - ldr r3, =0x0202449c - ldr r2, [r3] - b _0803E316 - .pool -_0803E1BC: - ldr r5, =0x02024084 - mov r10, r5 - movs r0, 0x58 - adds r5, r4, 0 - muls r5, r0 - mov r0, r10 - adds r0, 0x50 - adds r0, r5, r0 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 5 - ands r0, r1 - cmp r0, 0 - bne _0803E1E2 - movs r7, 0x80 - lsls r7, 15 - ands r7, r1 - cmp r7, 0 - beq _0803E204 -_0803E1E2: - ldr r3, =0x020241ea - ldr r2, =0x020241ec - ldr r1, =0x02024268 - lsls r0, r4, 1 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] - strh r0, [r3] - b _0803E33C - .pool -_0803E204: - ldr r1, =0x020242bc - mov r12, r1 - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - add r0, r12 - ldrh r3, [r0, 0x6] - adds r1, r3, 0 - cmp r1, 0 - beq _0803E2DC - ldrb r2, [r0, 0xC] - lsls r0, r2, 1 - adds r0, r5 - mov r4, r10 - adds r4, 0xC - adds r0, r4 - ldrh r0, [r0] - cmp r1, r0 - bne _0803E268 - ldr r2, =0x020241ea - ldr r0, =0x020241ec - strh r3, [r0] - strh r3, [r2] - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - ldrb r0, [r0, 0xC] - mov r3, r9 - strb r0, [r3] - mov r5, r8 - strb r0, [r5] - ldrh r0, [r2] - movs r1, 0 - bl sub_80458E0 - ldrb r1, [r6] - ldr r3, =0x0202449c - ldr r2, [r3] - b _0803E316 - .pool -_0803E268: - cmp r1, 0 - beq _0803E2DC - cmp r1, r0 - beq _0803E2DC - mov r5, r9 - strb r2, [r5] - mov r0, r8 - strb r2, [r0] - ldr r3, =0x020241ea - ldr r2, =0x020241ec - ldrb r0, [r0] - lsls r0, 1 - ldrb r1, [r6] - movs r5, 0x58 - muls r1, r5 - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - strh r0, [r2] - strh r0, [r3] - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - movs r2, 0 - strh r7, [r0, 0x6] - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - strb r2, [r0, 0xC] - ldrb r0, [r6] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - add r1, r12 - ldrb r2, [r1, 0xE] - movs r0, 0x10 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0xE] - ldrh r0, [r3] - movs r1, 0 - bl sub_80458E0 - ldrb r1, [r6] - ldr r3, =0x0202449c - ldr r2, [r3] - b _0803E316 - .pool -_0803E2DC: - ldr r3, =0x02024084 - mov r5, r8 - ldrb r0, [r5] - lsls r0, 1 - ldr r4, =0x0202420b - ldrb r2, [r4] - movs r1, 0x58 - muls r1, r2 - adds r0, r1 - adds r3, 0xC - adds r0, r3 - ldr r1, =0x02024274 - lsls r2, 1 - adds r2, r1 - ldrh r3, [r0] - ldrh r2, [r2] - cmp r3, r2 - beq _0803E334 - ldr r1, =0x020241ea - ldr r0, =0x020241ec - strh r3, [r0] - strh r3, [r1] - ldrh r0, [r1] - movs r1, 0 - bl sub_80458E0 - ldrb r1, [r4] - ldr r2, =0x0202449c - ldr r2, [r2] -_0803E316: - adds r1, r2 - strb r0, [r1, 0xC] - b _0803E33C - .pool -_0803E334: - ldr r1, =0x020241ea - ldr r0, =0x020241ec - strh r3, [r0] - strh r3, [r1] -_0803E33C: - ldr r2, =0x02024084 - ldr r1, =0x0202420b - ldrb r3, [r1] - movs r0, 0x58 - muls r0, r3 - adds r0, r2 - ldrh r0, [r0, 0x28] - mov r8, r1 - cmp r0, 0 - beq _0803E384 - adds r0, r3, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0803E37C - ldr r0, =0x03005d10 - ldr r1, =0x020241ea - ldrh r1, [r1] - strh r1, [r0, 0x22] - b _0803E384 - .pool -_0803E37C: - ldr r0, =0x03005d10 - ldr r1, =0x020241ea - ldrh r1, [r1] - strh r1, [r0, 0x24] -_0803E384: - mov r1, r8 - ldrb r0, [r1] - bl battle_side_get_owner - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x02024294 - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 2 - adds r5, r0, r1 - ldrb r0, [r5, 0x8] - cmp r0, 0 - beq _0803E400 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x6] - cmp r0, 0 - bne _0803E400 - mov r3, r8 - ldrb r0, [r3] - bl battle_side_get_owner - adds r4, r0, 0 - ldrb r0, [r5, 0x9] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _0803E400 - ldr r1, =0x02024084 - ldrb r2, [r5, 0x9] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _0803E400 - ldr r0, =0x0202420c - strb r2, [r0] - b _0803E76A - .pool -_0803E400: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - ldr r5, =0x0202420b - mov r8, r5 - cmp r0, 0 - bne _0803E412 - b _0803E6E0 -_0803E412: - ldr r1, =0x02024294 - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - ldrb r5, [r0, 0x8] - cmp r5, 0 - beq _0803E424 - b _0803E630 -_0803E424: - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r4, r0, r2 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _0803E440 - ldrb r0, [r4, 0x6] - cmp r0, 0x10 - bne _0803E440 - b _0803E630 -_0803E440: - ldr r3, =0x02024084 - ldr r2, =0x0202420b - ldrb r6, [r2] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, r6, r0 - ldrb r1, [r0, 0xC] - movs r0, 0x58 - muls r0, r1 - adds r0, r3 - adds r0, 0x20 - ldrb r0, [r0] - mov r8, r2 - cmp r0, 0x1F - bne _0803E460 - b _0803E630 -_0803E460: - ldrb r0, [r4, 0x2] - cmp r0, 0xD - beq _0803E468 - b _0803E630 -_0803E468: - adds r0, r6, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x02024064 - strb r5, [r1] - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - bcs _0803E4E0 - adds r4, r1, 0 -_0803E480: - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - beq _0803E4CE - ldr r0, =0x0202420b - ldrb r1, [r0] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r1, r0 - ldrb r0, [r1, 0xC] - ldrb r1, [r4] - cmp r0, r1 - beq _0803E4CE - ldr r1, =0x02024084 - ldrb r2, [r4] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1F - bne _0803E4CE - adds r0, r2, 0 - bl sub_8048728 - lsls r0, 24 - lsrs r0, 24 - ldr r3, [sp] - cmp r0, r3 - bcs _0803E4CE - ldrb r0, [r4] - bl sub_8048728 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] -_0803E4CE: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803E480 -_0803E4E0: - ldr r5, [sp] - cmp r5, 0x4 - beq _0803E4E8 - b _0803E5E2 -_0803E4E8: - ldr r2, =gBattleMoves - ldr r0, =0x020241ec - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x6] - ands r5, r0 - cmp r5, 0 - beq _0803E568 - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0803E548 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0803E544 - movs r0, 0x1 - b _0803E55A - .pool -_0803E544: - movs r0, 0x3 - b _0803E55A -_0803E548: - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0803E558 - movs r0, 0 - b _0803E55A -_0803E558: - movs r0, 0x2 -_0803E55A: - bl battle_get_side_with_given_state - ldr r1, =0x0202420c - strb r0, [r1] - b _0803E578 - .pool -_0803E568: - ldr r2, =0x0202420c - ldr r0, =0x0202420b - ldrb r0, [r0] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - ldrb r0, [r0, 0xC] - strb r0, [r2] -_0803E578: - ldr r7, =0x02024210 - ldrb r0, [r7] - ldr r1, =gUnknown_0832A328 - mov r8, r1 - ldr r5, =0x0202420c - ldrb r1, [r5] - lsls r1, 2 - add r1, r8 - ldr r1, [r1] - ands r0, r1 - cmp r0, 0 - bne _0803E592 - b _0803E76A -_0803E592: - ldr r6, =0x0202420b - ldrb r0, [r6] - bl battle_side_get_owner - adds r4, r0, 0 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _0803E5C4 - ldrb r0, [r5] - b _0803E758 - .pool -_0803E5C4: - ldrb r0, [r6] - bl battle_get_per_side_status - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - strb r0, [r5] - ldrb r1, [r7] - ldrb r2, [r5] - lsls r0, r2, 2 - add r0, r8 - b _0803E74E -_0803E5E2: - ldr r4, =0x02024064 - ldr r0, =0x0202407e - ldr r3, [sp] - adds r0, r3, r0 - ldrb r0, [r0] - strb r0, [r4] - ldrb r0, [r4] - ldr r2, =0x02024084 - movs r1, 0x58 - muls r1, r0 - adds r1, r2 - adds r1, 0x20 - ldrb r1, [r1] - bl b_history__record_ability_usage_of_player - ldr r2, =0x0202437c - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0] - ldr r1, =0x0202420c - ldrb r0, [r4] - strb r0, [r1] - b _0803E76A - .pool -_0803E630: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r4, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0803E6E0 - ldr r2, =gBattleMoves - ldr r0, =0x020241ec - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x6] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0803E6E0 - mov r5, r8 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0803E684 - bl GenerateRandomNumber - adds r1, r4, 0 - ands r1, r0 - cmp r1, 0 - beq _0803E680 - movs r0, 0x1 - b _0803E696 - .pool -_0803E680: - movs r0, 0x3 - b _0803E696 -_0803E684: - bl GenerateRandomNumber - adds r1, r4, 0 - ands r1, r0 - cmp r1, 0 - beq _0803E694 - movs r0, 0 - b _0803E696 -_0803E694: - movs r0, 0x2 -_0803E696: - bl battle_get_side_with_given_state - ldr r1, =0x0202420c - strb r0, [r1] - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldr r5, =0x0202420c - ldrb r0, [r5] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _0803E76A - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - adds r4, r0, 0 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _0803E76A - ldrb r0, [r5] - b _0803E758 - .pool -_0803E6E0: - ldr r5, =0x0202420c - mov r2, r8 - ldrb r0, [r2] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - ldrb r0, [r0, 0xC] - strb r0, [r5] - ldr r6, =0x02024210 - ldrb r1, [r6] - ldr r7, =gUnknown_0832A328 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r7 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _0803E76A - ldrb r0, [r2] - bl battle_side_get_owner - adds r4, r0, 0 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _0803E730 - ldrb r0, [r5] - b _0803E758 - .pool -_0803E730: - mov r1, r8 - ldrb r0, [r1] - bl battle_get_per_side_status - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - strb r0, [r5] - ldrb r1, [r6] - ldrb r2, [r5] - lsls r0, r2, 2 - adds r0, r7 -_0803E74E: - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _0803E76A - adds r0, r2, 0 -_0803E758: - bl battle_get_per_side_status - movs r1, 0x2 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - strb r0, [r5] -_0803E76A: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 10 - ands r1, r2 - adds r5, r0, 0 - cmp r1, 0 - beq _0803E808 - ldr r0, =0x0202433c - ldr r4, =0x0202420b - ldrb r2, [r4] - lsls r1, r2, 4 - adds r1, r0 - ldrb r0, [r1, 0x2] - lsls r0, 27 - cmp r0, 0 - bge _0803E808 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _0803E7B4 - ldr r1, =0x02024083 - movs r0, 0xC - b _0803E83C - .pool -_0803E7B4: - ldr r3, =0x02024230 - lsls r0, r2, 2 - adds r0, r3 - ldr r0, [r0] - cmp r0, 0 - beq _0803E7EC - ldr r1, =0x02024332 - movs r2, 0 - movs r0, 0x4 - strb r0, [r1, 0x5] - ldr r1, =0x02024214 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - str r0, [r1] - ldrb r0, [r4] - lsls r0, 2 - adds r0, r3 - str r2, [r0] - b _0803E824 - .pool -_0803E7EC: - ldr r1, =0x02024332 - movs r0, 0x4 - strb r0, [r1, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB6AD - str r0, [r1] - b _0803E824 - .pool -_0803E808: - ldr r4, =0x02024214 - ldr r3, =gUnknown_082D86A8 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - str r0, [r4] -_0803E824: - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _0803E838 - ldr r0, =0x0202420b - ldrb r0, [r0] - bl sub_81A56E8 -_0803E838: - ldr r1, =0x02024083 - movs r0, 0xA -_0803E83C: - strb r0, [r1] - 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_803E0B8 - - thumb_func_start bs2_8016374 -bs2_8016374: @ 803E868 - push {r4,lr} - ldr r3, =0x0202420b - ldr r1, =0x0202407e - ldr r0, =0x02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r3] - ldr r0, =0x02022e14 - movs r2, 0 - strh r2, [r0] - ldr r0, =0x02022e16 - strh r2, [r0] - ldr r1, =0x020244ac - ldrb r0, [r3] - adds r0, r1 - strb r2, [r0] - ldr r1, =0x020244b0 - ldrb r0, [r3] - adds r0, r1 - strb r2, [r0] - ldr r2, =0x02022f58 - movs r0, 0xFD - strb r0, [r2] - movs r0, 0x7 - strb r0, [r2, 0x1] - ldrb r4, [r3] - strb r4, [r2, 0x2] - ldrb r0, [r3] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - adds r0, 0x58 - ldrb r0, [r0] - strb r0, [r2, 0x3] - movs r0, 0xFF - strb r0, [r2, 0x4] - ldr r0, =0x02024474 - strb r4, [r0, 0x17] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAB15 - str r0, [r1] - ldr r1, =0x02024083 - movs r0, 0xA - strb r0, [r1] - ldr r1, =0x03005d10 - ldrb r0, [r1, 0x2] - cmp r0, 0xFE - bhi _0803E8CE - adds r0, 0x1 - strb r0, [r1, 0x2] -_0803E8CE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bs2_8016374 - - thumb_func_start sub_803E90C -sub_803E90C: @ 803E90C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r4, =0x0202420b - ldr r2, =0x0202420c - ldr r1, =0x0202407e - ldr r0, =0x02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - strb r0, [r4] - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldrb r0, [r4] - bl sub_8045868 - ldr r5, =0x02024208 - ldr r2, =0x02023864 - ldrb r1, [r4] - lsls r1, 9 - adds r0, r2, 0x1 - adds r0, r1, r0 - ldrb r3, [r0] - adds r2, 0x2 - adds r1, r2 - ldrb r0, [r1] - lsls r0, 8 - orrs r3, r0 - strh r3, [r5] - cmp r3, 0xC - bhi _0803E998 - ldr r2, =0x02024214 - ldr r1, =gUnknown_082DBD08 - ldrh r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [r2] - ldr r0, =0x02024083 - mov r10, r0 - b _0803EBF6 - .pool -_0803E998: - adds r0, r3, 0 - subs r0, 0x50 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _0803E9C0 - ldr r0, =0x02024214 - ldr r1, =gUnknown_082DBD54 - ldr r1, [r1] - str r1, [r0] - ldr r1, =0x02024083 - mov r10, r1 - b _0803EBF6 - .pool -_0803E9C0: - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0803E9E8 - ldr r0, =0x02024214 - ldr r1, =gUnknown_082DBD3C - ldr r1, [r1] - str r1, [r0] - ldr r2, =0x02024083 - mov r10, r2 - b _0803EBF6 - .pool -_0803E9E8: - ldr r3, =0x02024474 - ldrb r0, [r4] - strb r0, [r3, 0x17] - lsls r0, 24 - lsrs r0, 25 - ldr r2, =0x0202449c - ldr r1, [r2] - adds r0, r1 - adds r0, 0xC4 - ldrb r0, [r0] - subs r0, 0x1 - mov r8, r4 - ldr r1, =0x02024214 - mov r9, r1 - ldr r6, =gUnknown_082DBD3C - mov r12, r3 - adds r7, r2, 0 - ldr r2, =0x02024083 - mov r10, r2 - cmp r0, 0x4 - bls _0803EA14 - b _0803EBDE -_0803EA14: - lsls r0, 2 - ldr r1, =_0803EA38 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0803EA38: - .4byte _0803EBDE - .4byte _0803EBDE - .4byte _0803EA4C - .4byte _0803EAE0 - .4byte _0803EBB0 -_0803EA4C: - ldr r5, =0x02024332 - movs r0, 0 - strb r0, [r5, 0x5] - ldr r2, =0x0202420b - ldrb r0, [r2] - lsrs r0, 1 - ldr r1, [r7] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - mov r8, r2 - cmp r0, 0 - beq _0803EA98 - movs r0, 0x3E - ands r0, r1 - ldr r1, =0x02024214 - mov r9, r1 - ldr r6, =gUnknown_082DBD3C - ldr r2, =0x02024083 - mov r10, r2 - cmp r0, 0 - bne _0803EA7E - b _0803EBDE -_0803EA7E: - movs r0, 0x5 - strb r0, [r5, 0x5] - b _0803EBDE - .pool -_0803EA98: - ldr r0, =0x02024214 - mov r9, r0 - ldr r6, =gUnknown_082DBD3C - ldr r1, =0x02024083 - mov r10, r1 - mov r4, r8 - adds r3, r7, 0 - adds r2, r5, 0 -_0803EAA8: - ldrb r1, [r4] - lsrs r1, 1 - ldr r0, [r3] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - lsrs r0, 1 - strb r0, [r1] - ldrb r0, [r2, 0x5] - adds r0, 0x1 - strb r0, [r2, 0x5] - ldrb r0, [r4] - lsrs r0, 1 - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0803EAA8 - b _0803EBDE - .pool -_0803EAE0: - ldr r3, =0x02024332 - movs r0, 0x4 - strb r0, [r3, 0x5] - ldr r2, =0x0202420b - ldrb r0, [r2] - lsrs r0, 1 - ldr r1, [r7] - adds r0, r1 - adds r6, r0, 0 - adds r6, 0xC6 - ldrb r1, [r6] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - mov r8, r2 - cmp r5, 0 - beq _0803EB28 - movs r0, 0x5 - strb r0, [r3, 0x5] - ldr r2, =0x02024214 - mov r9, r2 - ldr r6, =gUnknown_082DBD3C - ldr r0, =0x02024083 - mov r10, r0 - b _0803EBDE - .pool -_0803EB28: - ldr r3, =0x02022f58 - movs r4, 0xFD - strb r4, [r3] - movs r0, 0x5 - strb r0, [r3, 0x1] - movs r2, 0x1 - strb r2, [r3, 0x2] - movs r0, 0xFF - strb r0, [r3, 0x3] - ldr r1, =0x02022f68 - strb r4, [r1] - strb r5, [r1, 0x1] - movs r0, 0xD2 - strb r0, [r1, 0x2] - strb r5, [r1, 0x3] - subs r0, 0xD3 - strb r0, [r1, 0x4] - ldrb r0, [r6] - ands r2, r0 - ldr r1, =0x02024214 - mov r9, r1 - ldr r6, =gUnknown_082DBD3C - ldr r0, =0x02024083 - mov r10, r0 - cmp r2, 0 - bne _0803EB8C - mov r5, r8 - adds r4, r7, 0 - adds r2, r3, 0 -_0803EB62: - ldrb r1, [r5] - lsrs r1, 1 - ldr r0, [r4] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - lsrs r0, 1 - strb r0, [r1] - ldrb r0, [r2, 0x2] - adds r0, 0x1 - strb r0, [r2, 0x2] - ldrb r0, [r5] - lsrs r0, 1 - ldr r1, [r4] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0803EB62 -_0803EB8C: - ldrb r0, [r3, 0x2] - adds r0, 0xE - movs r1, 0 - mov r2, r12 - strb r0, [r2, 0x10] - strb r1, [r2, 0x11] - b _0803EBDE - .pool -_0803EBB0: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0803EBCC - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1, 0x5] - b _0803EBD0 - .pool -_0803EBCC: - ldr r0, =0x02024332 - strb r1, [r0, 0x5] -_0803EBD0: - ldr r0, =0x0202420b - mov r8, r0 - ldr r1, =0x02024214 - mov r9, r1 - ldr r6, =gUnknown_082DBD3C - ldr r2, =0x02024083 - mov r10, r2 -_0803EBDE: - mov r1, r8 - ldrb r0, [r1] - lsrs r0, 1 - ldr r1, [r7] - adds r0, r1 - adds r0, 0xC4 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - mov r2, r9 - str r0, [r2] -_0803EBF6: - movs r0, 0xA - mov r1, r10 - strb r0, [r1] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803E90C - - thumb_func_start sub_803EC20 -sub_803EC20: @ 803EC20 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r5, r0, 24 - movs r7, 0 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r5 - adds r1, r0, r1 - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _0803EC54 - ldr r1, =0x02024404 - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x7] - b _0803EC5E - .pool -_0803EC54: - ldrh r0, [r1, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r1, r0, 24 -_0803EC5E: - ldr r0, =0x0202420f - strb r5, [r0] - cmp r1, 0x25 - bne _0803EC9C - ldr r2, =0x02024208 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r5 - adds r0, r1 - ldrh r0, [r0, 0x2E] - strh r0, [r2] - ldr r0, =0x0202433c - lsls r2, r5, 4 - adds r2, r0 - ldrb r1, [r2, 0x1] - movs r0, 0x19 - negs r0, r0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r2, 0x1] - b _0803ED70 - .pool -_0803EC9C: - ldr r0, =0x02024084 - mov r10, r0 - movs r2, 0x58 - mov r9, r2 - mov r0, r9 - muls r0, r5 - add r0, r10 - mov r8, r0 - adds r0, 0x20 - ldrb r6, [r0] - cmp r6, 0x32 - bne _0803ED5C - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0803ED38 - ldr r4, =0x0202449c - ldr r1, [r4] - adds r1, 0x6C - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - bl sub_81A9E28 - lsls r0, 24 - lsrs r1, r0, 24 - mov r2, r8 - ldrh r0, [r2, 0x6] - muls r0, r1 - movs r2, 0x1 - adds r1, r5, 0 - eors r1, r2 - mov r2, r9 - muls r2, r1 - adds r1, r2, 0 - add r1, r10 - ldrh r1, [r1, 0x6] - bl __divsi3 - ldr r1, [r4] - adds r1, 0x6C - ldrb r2, [r1] - lsls r1, r2, 4 - subs r1, r2 - lsls r1, 1 - adds r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - bl GenerateRandomNumber - movs r1, 0xFF - ands r1, r0 - cmp r4, r1 - bhi _0803ED0C - b _0803EE12 -_0803ED0C: - ldr r0, =0x0202420a - strb r6, [r0] - ldr r0, =0x0202433c - lsls r2, r5, 4 - adds r2, r0 - ldrb r1, [r2, 0x1] - movs r0, 0x19 - negs r0, r0 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r2, 0x1] - b _0803ED70 - .pool -_0803ED38: - ldr r0, =0x0202420a - strb r6, [r0] - ldr r0, =0x0202433c - lsls r2, r5, 4 - adds r2, r0 - ldrb r1, [r2, 0x1] - movs r0, 0x19 - negs r0, r0 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r2, 0x1] - b _0803ED70 - .pool -_0803ED5C: - ldr r1, =0x02022fec - ldr r2, [r1] - ldr r0, =0x043f0100 - ands r0, r2 - cmp r0, 0 - beq _0803ED80 - movs r0, 0x8 - ands r2, r0 - cmp r2, 0 - beq _0803ED80 -_0803ED70: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - b _0803EE12 - .pool -_0803ED80: - ldr r0, [r1] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0803EE06 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0803EDBC - bl sub_81A9E28 - lsls r0, 24 - lsrs r1, r0, 24 - ldr r4, =0x02024084 - movs r3, 0x58 - adds r0, r5, 0 - muls r0, r3 - adds r0, r4 - ldrh r0, [r0, 0x6] - muls r0, r1 - movs r2, 0x1 - adds r1, r5, 0 - eors r1, r2 - muls r1, r3 - adds r1, r4 - b _0803EDDA - .pool -_0803EDBC: - ldr r3, =0x02024084 - movs r2, 0x58 - adds r0, r5, 0 - muls r0, r2 - adds r4, r0, r3 - movs r1, 0x1 - adds r0, r5, 0 - eors r0, r1 - muls r0, r2 - adds r1, r0, r3 - ldrh r0, [r4, 0x6] - ldrh r2, [r1, 0x6] - cmp r0, r2 - bcs _0803EE00 - lsls r0, 7 -_0803EDDA: - ldrh r1, [r1, 0x6] - bl __divsi3 - ldr r1, =0x0202449c - ldr r1, [r1] - adds r1, 0x6C - ldrb r2, [r1] - lsls r1, r2, 4 - subs r1, r2 - lsls r1, 1 - adds r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - bl GenerateRandomNumber - movs r1, 0xFF - ands r1, r0 - cmp r4, r1 - bls _0803EE06 -_0803EE00: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 -_0803EE06: - ldr r0, =0x0202449c - ldr r1, [r0] - adds r1, 0x6C - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0803EE12: - cmp r7, 0 - beq _0803EE24 - ldr r1, =0x02024082 - ldr r0, =0x0202406c - ldrb r0, [r0] - strb r0, [r1] - ldr r1, =0x0202433a - movs r0, 0x4 - strb r0, [r1] -_0803EE24: - 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_803EC20 - - thumb_func_start sub_803EE48 -sub_803EE48: @ 803EE48 - push {r4-r6,lr} - ldr r4, =0x0202420b - ldr r1, =0x0202407e - ldr r5, =0x02024082 - ldrb r0, [r5] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r4] - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x02000002 - ands r0, r1 - cmp r0, 0 - beq _0803EF0C - ldr r0, =0x0202406c - ldrb r1, [r0] - strb r1, [r5] - ldr r2, =0x02024064 - movs r0, 0 - strb r0, [r2] - lsls r1, 24 - cmp r1, 0 - beq _0803EEE0 - adds r4, r2, 0 - ldr r6, =0x0202421c - ldr r5, =0x0202433a -_0803EE7C: - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0803EEBC - ldrb r0, [r4] - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0x3 - bne _0803EECE - ldrb r0, [r5] - movs r1, 0x2 - b _0803EECA - .pool -_0803EEBC: - ldrb r0, [r4] - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0x3 - bne _0803EECE - ldrb r0, [r5] - movs r1, 0x1 -_0803EECA: - orrs r0, r1 - strb r0, [r5] -_0803EECE: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0803EE7C -_0803EEE0: - ldr r2, =0x0202433a - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r0, =0x00000ca9 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x8 - orrs r0, r2 - b _0803EF96 - .pool -_0803EF0C: - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0803EF4C - ldrb r0, [r4] - bl sub_803EC20 - lsls r0, 24 - cmp r0, 0 - bne _0803EF98 - ldrb r0, [r4] - bl sub_8045868 - ldr r1, =0x02024332 - movs r0, 0x3 - strb r0, [r1, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAB02 - str r0, [r1] - ldr r1, =0x02024083 - movs r0, 0xA - b _0803EF96 - .pool -_0803EF4C: - ldr r1, =0x02024084 - ldrb r2, [r4] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x0400e000 - ands r0, r1 - cmp r0, 0 - beq _0803EF8C - ldr r1, =0x02024332 - movs r0, 0x4 - strb r0, [r1, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAB02 - str r0, [r1] - ldr r1, =0x02024083 - movs r0, 0xA - b _0803EF96 - .pool -_0803EF8C: - ldr r0, =0x0202406c - ldrb r0, [r0] - strb r0, [r5] - ldr r1, =0x0202433a - movs r0, 0x6 -_0803EF96: - strb r0, [r1] -_0803EF98: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803EE48 - - thumb_func_start sub_803EFA8 -sub_803EFA8: @ 803EFA8 - ldr r2, =0x0202420b - ldr r1, =0x0202407e - ldr r0, =0x02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DBD58 - ldr r0, [r0] - str r0, [r1] - ldr r1, =0x02024083 - movs r0, 0xA - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_803EFA8 - - thumb_func_start bs5_8016AC0 -bs5_8016AC0: @ 803EFF0 - ldr r2, =0x0202420b - ldr r1, =0x0202407e - ldr r0, =0x02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r1, =0x0203a04c - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - ldr r1, =0x02024208 - movs r0, 0x5 - strh r0, [r1] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DBD08 - ldr r0, [r0, 0x14] - str r0, [r1] - ldr r1, =0x02024083 - movs r0, 0xA - strb r0, [r1] - bx lr - .pool - thumb_func_end bs5_8016AC0 - - thumb_func_start sub_803F050 -sub_803F050: @ 803F050 - push {r4-r6,lr} - ldr r3, =0x0202420b - ldr r1, =0x0202407e - ldr r0, =0x02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r3] - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r6, =0x02024332 - ldr r2, =0x02023864 - ldrb r0, [r3] - lsls r0, 9 - adds r1, r2, 0x1 - adds r0, r1 - ldrb r0, [r0] - subs r0, 0x1 - strb r0, [r6, 0x5] - ldr r1, =0x02024208 - ldrb r0, [r3] - lsls r0, 9 - adds r2, 0x2 - adds r0, r2 - ldrb r0, [r0] - strh r0, [r1] - ldr r1, =0x03005d10 - ldrb r0, [r1, 0x1F] - cmp r0, 0xFE - bhi _0803F096 - adds r0, 0x1 - strb r0, [r1, 0x1F] -_0803F096: - ldr r2, =0x0202449c - ldr r0, [r2] - adds r1, r0, 0 - adds r1, 0x7A - ldrb r0, [r1] - cmp r0, 0x2 - bhi _0803F0A8 - adds r0, 0x1 - strb r0, [r1] -_0803F0A8: - ldr r0, [r2] - adds r3, r0, 0 - adds r3, 0x7B - ldrb r5, [r3] - adds r4, r5, 0 - cmp r4, 0x1 - bls _0803F100 - ldr r2, =gUnknown_0831BCE0 - adds r0, 0x7A - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - ldrb r6, [r6, 0x5] - adds r0, r6 - adds r0, r2 - ldrb r0, [r0] - cmp r4, r0 - bcs _0803F0FC - movs r0, 0x1 - b _0803F0FE - .pool -_0803F0FC: - subs r0, r5, r0 -_0803F0FE: - strb r0, [r3] -_0803F100: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DBD58 - ldr r0, [r0, 0x8] - str r0, [r1] - ldr r1, =0x02024083 - movs r0, 0xA - strb r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F050 - - thumb_func_start sub_803F120 -sub_803F120: @ 803F120 - push {r4,lr} - ldr r2, =0x0202420b - ldr r1, =0x0202407e - ldr r0, =0x02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r0, =0x02022e14 - movs r4, 0 - strh r4, [r0] - ldr r0, =0x02022e16 - strh r4, [r0] - ldr r3, =0x0202449c - ldr r0, [r3] - adds r2, r0, 0 - adds r2, 0x7C - ldr r1, =gUnknown_0831BCEF - adds r0, 0x79 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - ldrb r1, [r2] - adds r0, r1 - strb r0, [r2] - ldr r0, [r3] - adds r1, r0, 0 - adds r1, 0x7C - ldrb r0, [r1] - cmp r0, 0x14 - bls _0803F162 - movs r0, 0x14 - strb r0, [r1] -_0803F162: - ldr r0, [r3] - adds r2, r0, 0 - adds r2, 0x7B - ldr r1, =gUnknown_0831BCF3 - adds r0, 0x79 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - ldrb r1, [r2] - adds r0, r1 - strb r0, [r2] - ldr r0, [r3] - adds r1, r0, 0 - adds r1, 0x7B - ldrb r0, [r1] - cmp r0, 0x14 - bls _0803F188 - movs r0, 0x14 - strb r0, [r1] -_0803F188: - ldr r0, [r3] - adds r1, r0, 0 - adds r1, 0x79 - ldrb r0, [r1] - cmp r0, 0x2 - bhi _0803F1C4 - adds r0, 0x1 - strb r0, [r1] - ldr r0, =0x02024332 - strb r4, [r0, 0x5] - b _0803F1CA - .pool -_0803F1C4: - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] -_0803F1CA: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DBD58 - ldr r0, [r0, 0x4] - str r0, [r1] - ldr r1, =0x02024083 - movs r0, 0xA - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F120 - - thumb_func_start bs8_exit_by_flight -bs8_exit_by_flight: @ 803F1F0 - push {r4,lr} - ldr r2, =0x0202420b - ldr r1, =0x0202407e - ldr r4, =0x02024082 - ldrb r0, [r4] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - movs r0, 0x11 - bl audio_play - ldr r0, =0x0202406c - ldrb r0, [r0] - strb r0, [r4] - ldr r1, =0x0202433a - movs r0, 0x4 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bs8_exit_by_flight - - thumb_func_start bs9_8016C9C -bs9_8016C9C: @ 803F22C - ldr r3, =0x0202420b - ldr r1, =0x0202407e - ldr r0, =0x02024082 - ldrb r0, [r0] - adds r0, r1 - ldrb r2, [r0] - strb r2, [r3] - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x7 - strb r0, [r1, 0x1] - strb r2, [r1, 0x2] - ldr r2, =0x0202406e - ldrb r0, [r3] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DBD58 - ldr r0, [r0, 0xC] - str r0, [r1] - ldr r1, =0x02024083 - movs r0, 0xA - strb r0, [r1] - ldr r1, =0x0202407a - movs r0, 0xC - strb r0, [r1, 0x1] - bx lr - .pool - thumb_func_end bs9_8016C9C - - thumb_func_start bsB_exit_by_move -bsB_exit_by_move: @ 803F2A4 - push {lr} - bl sub_8041728 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0803F2C0 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x4D - strb r1, [r0] - ldr r1, =0x02024083 - movs r0, 0xC - strb r0, [r1] -_0803F2C0: - pop {r0} - bx r0 - .pool - thumb_func_end bsB_exit_by_move - - thumb_func_start bsD_proceed -bsD_proceed: @ 803F2CC - ldr r1, =0x02024082 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r3, =0x02024083 - ldr r2, =0x0202407a - ldrb r0, [r1] - adds r0, r2 - ldrb r0, [r0] - strb r0, [r3] - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xf1e892af - ands r0, r1 - str r0, [r2] - bx lr - .pool - thumb_func_end bsD_proceed - - thumb_func_start bsC_8016D70 -bsC_8016D70: @ 803F300 - push {r4-r6,lr} - ldr r1, =0x0202407e - ldr r2, =0x02024082 - ldrb r0, [r2] - adds r0, r1 - ldrb r0, [r0] - ldr r6, =0x0202449c - ldr r1, [r6] - adds r0, r1 - adds r0, 0x5C - movs r1, 0x6 - strb r1, [r0] - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - ldr r3, =0x02024083 - ldr r1, =0x0202407a - ldrb r0, [r2] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r3] - bl sub_803D6A0 - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xf1e892af - ands r0, r1 - str r0, [r2] - ldr r0, =0x020241ea - movs r1, 0 - strh r1, [r0] - ldr r0, =0x020241f0 - movs r4, 0 - str r4, [r0] - ldr r0, =0x0202427c - strb r1, [r0] - ldr r5, =0x02024474 - strb r1, [r5, 0x18] - strb r1, [r5, 0x19] - ldr r2, =0x02024250 - ldr r3, =0x0202420b - ldrb r0, [r3] - lsls r0, 1 - adds r0, r2 - strh r4, [r0] - ldr r2, =0x02024258 - ldrb r0, [r3] - lsls r0, 1 - adds r0, r2 - strh r4, [r0] - ldr r0, [r6] - strb r1, [r0, 0x13] - ldr r0, =0x02024400 - strh r4, [r0] - strb r1, [r5, 0x14] - ldr r0, =0x02024332 - strb r1, [r0, 0x3] - strb r1, [r0, 0x4] - strb r1, [r5, 0x16] - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x8] - adds r0, 0x20 - strb r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bsC_8016D70 - - thumb_func_start get_battle_side_of_something -get_battle_side_of_something: @ 803F3CC - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0 - cmp r1, 0xE - bhi _0803F47A - lsls r0, r1, 2 - ldr r1, =_0803F3E8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0803F3E8: - .4byte _0803F424 - .4byte _0803F430 - .4byte _0803F43C - .4byte _0803F458 - .4byte _0803F464 - .4byte _0803F458 - .4byte _0803F464 - .4byte _0803F448 - .4byte _0803F464 - .4byte _0803F464 - .4byte _0803F44C - .4byte _0803F464 - .4byte _0803F468 - .4byte _0803F46C - .4byte _0803F470 -_0803F424: - ldr r0, =0x0202420c - ldrb r0, [r0] - b _0803F47A - .pool -_0803F430: - ldr r0, =0x0202420b - ldrb r0, [r0] - b _0803F47A - .pool -_0803F43C: - ldr r0, =0x0202420e - ldrb r0, [r0] - b _0803F47A - .pool -_0803F448: - movs r0, 0 - b _0803F47A -_0803F44C: - ldr r0, =0x02024474 - ldrb r0, [r0, 0x17] - b _0803F47A - .pool -_0803F458: - ldr r0, =0x0202420d - ldrb r0, [r0] - b _0803F47A - .pool -_0803F464: - movs r0, 0 - b _0803F472 -_0803F468: - movs r0, 0x1 - b _0803F472 -_0803F46C: - movs r0, 0x2 - b _0803F472 -_0803F470: - movs r0, 0x3 -_0803F472: - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 -_0803F47A: - pop {r1} - bx r1 - thumb_func_end get_battle_side_of_something - - thumb_func_start sub_803F480 -sub_803F480: @ 803F480 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 16 - lsrs r2, 16 - ldr r1, =0x02024084 - movs r4, 0x58 - muls r0, r4 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - mov r12, r1 - cmp r0, 0x2E - bne _0803F532 - movs r3, 0 - adds r0, r5, 0 - muls r0, r4 - adds r1, 0xC - adds r1, r0, r1 - b _0803F4BC - .pool -_0803F4B4: - adds r1, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - bgt _0803F4C2 -_0803F4BC: - ldrh r0, [r1] - cmp r0, r2 - bne _0803F4B4 -_0803F4C2: - cmp r3, 0x4 - beq _0803F532 - movs r7, 0x58 - adds r2, r5, 0 - muls r2, r7 - adds r0, r3, r2 - mov r6, r12 - adds r6, 0x24 - adds r1, r0, r6 - ldrb r0, [r1] - cmp r0, 0 - beq _0803F4DE - subs r0, 0x1 - strb r0, [r1] -_0803F4DE: - mov r0, r12 - adds r0, 0x50 - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _0803F532 - ldr r1, =0x020242bc - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gUnknown_0832A328 - lsls r0, r3, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0803F532 - ldr r4, =0x02024064 - strb r5, [r4] - adds r1, r3, 0 - adds r1, 0x9 - lsls r1, 24 - lsrs r1, 24 - ldrb r0, [r4] - muls r0, r7 - adds r0, r6 - adds r0, r3 - str r0, [sp] - movs r0, 0 - movs r2, 0 - movs r3, 0x1 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803F532: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F480 - - thumb_func_start sub_803F548 -sub_803F548: @ 803F548 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x4 - mov r8, r0 - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - bge _0803F5F0 - ldr r1, =0x02024084 - movs r0, 0x58 - adds r7, r5, 0 - muls r7, r0 - adds r1, 0xC - mov r10, r1 -_0803F57E: - lsls r0, r4, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - adds r6, r4, 0x1 - cmp r9, r0 - beq _0803F5E6 - ldr r0, =0x02024084 - movs r3, 0x58 - adds r1, r4, 0 - muls r1, r3 - adds r1, r0 - adds r1, 0x20 - ldrb r1, [r1] - adds r4, r0, 0 - cmp r1, 0x2E - bne _0803F5E6 - movs r2, 0 - adds r0, r5, 0 - muls r0, r3 - adds r1, r4, 0 - adds r1, 0xC - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x8F - lsls r1, 1 - cmp r0, r1 - beq _0803F5CE - adds r3, r1, 0 - mov r0, r10 - adds r1, r7, r0 -_0803F5C0: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, 0x3 - bgt _0803F5CE - ldrh r0, [r1] - cmp r0, r3 - bne _0803F5C0 -_0803F5CE: - cmp r2, 0x4 - beq _0803F5E6 - mov r8, r2 - adds r1, r2, r7 - adds r0, r4, 0 - adds r0, 0x24 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _0803F5E6 - subs r0, 0x1 - strb r0, [r1] -_0803F5E6: - adds r4, r6, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _0803F57E -_0803F5F0: - mov r1, r8 - cmp r1, 0x4 - beq _0803F658 - ldr r6, =0x02024084 - movs r3, 0x58 - adds r0, r5, 0 - muls r0, r3 - adds r1, r6, 0 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _0803F658 - ldr r1, =0x020242bc - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gUnknown_0832A328 - mov r4, r8 - lsls r0, r4, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0803F658 - ldr r4, =0x02024064 - strb r5, [r4] - mov r1, r8 - adds r1, 0x9 - lsls r1, 24 - lsrs r1, 24 - ldrb r0, [r4] - muls r0, r3 - adds r2, r6, 0 - adds r2, 0x24 - adds r0, r2 - add r0, r8 - str r0, [sp] - movs r0, 0 - movs r2, 0 - movs r3, 0x1 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803F658: - 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_803F548 - - thumb_func_start sub_803F67C -sub_803F67C: @ 803F67C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r3, r0, 24 - movs r6, 0x4 - movs r1, 0 - ldr r0, =0x0202406c - mov r8, r0 - ldrb r0, [r0] - cmp r1, r0 - bge _0803F6FE - ldr r7, =0x02024084 - movs r2, 0x58 - mov r12, r2 - mov r5, r12 - muls r5, r3 - adds r0, r7, 0 - adds r0, 0xC - adds r2, r5, r0 - mov r10, r2 - mov r9, r5 -_0803F6AE: - mov r0, r12 - muls r0, r1 - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - adds r4, r1, 0x1 - cmp r0, 0x2E - bne _0803F6F4 - cmp r1, r3 - beq _0803F6F4 - movs r2, 0 - mov r1, r10 - ldrh r0, [r1] - cmp r0, 0xC3 - beq _0803F6DE - ldr r1, =0x02024090 - add r1, r9 -_0803F6D0: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, 0x3 - bgt _0803F6DE - ldrh r0, [r1] - cmp r0, 0xC3 - bne _0803F6D0 -_0803F6DE: - cmp r2, 0x4 - beq _0803F6F4 - adds r6, r2, 0 - adds r0, r6, r5 - ldr r2, =0x020240a8 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0 - beq _0803F6F4 - subs r0, 0x1 - strb r0, [r1] -_0803F6F4: - adds r1, r4, 0 - mov r0, r8 - ldrb r0, [r0] - cmp r1, r0 - blt _0803F6AE -_0803F6FE: - cmp r6, 0x4 - beq _0803F762 - ldr r7, =0x02024084 - movs r5, 0x58 - adds r0, r3, 0 - muls r0, r5 - adds r1, r7, 0 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _0803F762 - ldr r1, =0x020242bc - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gUnknown_0832A328 - lsls r0, r6, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0803F762 - ldr r4, =0x02024064 - strb r3, [r4] - adds r1, r6, 0 - adds r1, 0x9 - lsls r1, 24 - lsrs r1, 24 - ldrb r0, [r4] - muls r0, r5 - adds r2, r7, 0 - adds r2, 0x24 - adds r0, r2 - adds r0, r6 - str r0, [sp] - movs r0, 0 - movs r2, 0 - movs r3, 0x1 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0803F762: - 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_803F67C - - thumb_func_start sub_803F790 -sub_803F790: @ 803F790 - push {r4,r5,lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0803F7D0 - movs r2, 0 - ldr r4, =0x0202406c - ldrb r0, [r4] - cmp r2, r0 - bge _0803F7EE - ldr r3, =0x02024068 - ldr r5, =gUnknown_0832A328 -_0803F7AC: - ldm r5!, {r1} - lsls r1, 28 - ldr r0, [r3] - orrs r0, r1 - str r0, [r3] - adds r2, 0x1 - ldrb r0, [r4] - cmp r2, r0 - blt _0803F7AC - b _0803F7EE - .pool -_0803F7D0: - movs r2, 0 - ldr r4, =0x0202406c - ldrb r0, [r4] - cmp r2, r0 - bge _0803F7EE - ldr r3, =0x02024068 - ldr r5, =gUnknown_0832A328 -_0803F7DE: - ldr r0, [r3] - ldm r5!, {r1} - orrs r0, r1 - str r0, [r3] - adds r2, 0x1 - ldrb r0, [r4] - cmp r2, r0 - blt _0803F7DE -_0803F7EE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F790 - - thumb_func_start dp01_battle_side_mark_buffer_for_execution -dp01_battle_side_mark_buffer_for_execution: @ 803F800 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0803F834 - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r0] - lsls r1, 28 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - b _0803F844 - .pool -_0803F834: - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r2] - ldr r0, [r0] - orrs r1, r0 - str r1, [r2] -_0803F844: - pop {r0} - bx r0 - .pool - thumb_func_end dp01_battle_side_mark_buffer_for_execution - - thumb_func_start sub_803F850 -sub_803F850: @ 803F850 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - movs r4, 0 - ldr r5, =0x02024068 - ldr r1, =gUnknown_0832A328 - lsls r0, r7, 2 - adds r6, r0, r1 - b _0803F87A - .pool -_0803F86C: - lsls r0, r4, 2 - ldr r1, [r6] - lsls r1, r0 - ldr r0, [r5] - orrs r0, r1 - str r0, [r5] - adds r4, 0x1 -_0803F87A: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - blt _0803F86C - ldr r2, =0x02024068 - movs r1, 0x80 - lsls r1, 21 - lsls r1, r7 - ldr r0, [r2] - bics r0, r1 - str r0, [r2] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F850 - - thumb_func_start b_cancel_multi_turn_move_maybe -b_cancel_multi_turn_move_maybe: @ 803F8A0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02024084 - movs r2, 0x58 - adds r3, r0, 0 - muls r3, r2 - adds r1, 0x50 - adds r3, r1 - ldr r1, [r3] - ldr r2, =0xffffefff - ands r1, r2 - ldr r2, =0xfffff3ff - ands r1, r2 - movs r2, 0x71 - negs r2, r2 - ands r1, r2 - ldr r2, =0xfffffcff - ands r1, r2 - str r1, [r3] - ldr r1, =0x020242ac - lsls r2, r0, 2 - adds r2, r1 - ldr r1, [r2] - ldr r3, =0xfffbff3f - ands r1, r3 - str r1, [r2] - ldr r2, =0x020242bc - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1, 0x11] - movs r0, 0x10 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x11] - movs r0, 0 - strb r0, [r1, 0x10] - bx lr - .pool - thumb_func_end b_cancel_multi_turn_move_maybe - - thumb_func_start sub_803F90C -sub_803F90C: @ 803F90C - push {lr} - lsls r0, 24 - ldr r1, =0x0202433c - lsrs r0, 20 - adds r1, r0, r1 - ldrb r0, [r1] - lsrs r0, 7 - cmp r0, 0 - bne _0803F952 - ldrb r2, [r1, 0x1] - lsls r0, r2, 30 - cmp r0, 0 - blt _0803F952 - lsls r0, r2, 26 - cmp r0, 0 - blt _0803F952 - lsls r0, r2, 25 - cmp r0, 0 - blt _0803F952 - lsrs r0, r2, 7 - cmp r0, 0 - bne _0803F952 - ldrb r1, [r1, 0x2] - lsls r0, r1, 31 - cmp r0, 0 - bne _0803F952 - lsls r0, r1, 30 - cmp r0, 0 - blt _0803F952 - lsls r0, r1, 29 - cmp r0, 0 - blt _0803F952 - lsls r0, r2, 31 - cmp r0, 0 - beq _0803F95C -_0803F952: - movs r0, 0x1 - b _0803F95E - .pool -_0803F95C: - movs r0, 0 -_0803F95E: - pop {r1} - bx r1 - thumb_func_end sub_803F90C - - thumb_func_start b_std_message -b_std_message: @ 803F964 - push {r4,lr} - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - ldr r4, =0x02024064 - strb r1, [r4] - movs r0, 0 - adds r1, r2, 0 - bl dp01_build_cmdbuf_x10_TODO - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end b_std_message - - thumb_func_start sub_803F988 -sub_803F988: @ 803F988 - push {r4-r6,lr} - movs r3, 0 - ldr r0, =0x020243fe - strb r3, [r0] - strb r3, [r0, 0x1] - movs r1, 0 - ldr r0, =0x0202406c - ldrb r2, [r0] - adds r6, r0, 0 - cmp r1, r2 - bge _0803F9B6 - ldr r5, =gUnknown_0832A328 - adds r4, r2, 0 - ldr r2, =0x0202406e -_0803F9A4: - ldrh r0, [r2] - lsls r0, 2 - adds r0, r5 - ldr r0, [r0] - orrs r3, r0 - adds r2, 0x4 - adds r1, 0x2 - cmp r1, r4 - blt _0803F9A4 -_0803F9B6: - movs r1, 0x1 - adds r2, r6, 0 - ldrb r0, [r2] - cmp r1, r0 - bge _0803F9D6 - ldr r5, =0x020243fe - movs r4, 0x2 -_0803F9C4: - adds r0, r1, 0 - ands r0, r4 - asrs r0, 1 - adds r0, r5 - strb r3, [r0] - adds r1, 0x2 - ldrb r0, [r2] - cmp r1, r0 - blt _0803F9C4 -_0803F9D6: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F988 - - thumb_func_start sub_803F9EC -sub_803F9EC: @ 803F9EC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803FA50 - movs r0, 0x2 - ands r0, r5 - lsls r0, 24 - lsrs r0, 25 - mov r12, r0 - ldr r1, =0x020243fe - adds r0, r1 - strb r4, [r0] - adds r5, r4, 0 - ldr r0, =0x0202406c - ldrb r2, [r0] - mov r8, r1 - cmp r4, r2 - bge _0803FA4A - ldr r0, =0x02024210 - ldrb r7, [r0] - ldr r1, =gUnknown_0832A328 - adds r6, r2, 0 - ldr r3, =0x0202406e - adds r2, r1, 0 -_0803FA2E: - ldr r0, [r2] - ands r0, r7 - cmp r0, 0 - bne _0803FA40 - ldrh r0, [r3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - orrs r4, r0 -_0803FA40: - adds r3, 0x4 - adds r2, 0x8 - adds r5, 0x2 - cmp r5, r6 - blt _0803FA2E -_0803FA4A: - mov r0, r12 - add r0, r8 - strb r4, [r0] -_0803FA50: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803F9EC - - thumb_func_start sub_803FA70 -sub_803FA70: @ 803FA70 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0803FA8C - adds r0, r4, 0 - bl sub_803F9EC - b _0803FAC2 -_0803FA8C: - movs r3, 0x1 - ldr r5, =0x0202406c - ldrb r0, [r5] - cmp r3, r0 - bge _0803FAC2 - ldr r0, =0x020243fe - mov r12, r0 - movs r7, 0x2 - ldr r6, =gUnknown_0832A328 - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r4, r0, r1 -_0803FAA4: - adds r2, r3, 0 - ands r2, r7 - asrs r2, 1 - add r2, r12 - ldrh r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - adds r3, 0x1 - ldrb r0, [r5] - cmp r3, r0 - blt _0803FAA4 -_0803FAC2: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_803FA70 - - thumb_func_start b_movescr_stack_push -b_movescr_stack_push: @ 803FAD8 - push {r4,lr} - ldr r1, =0x020244a8 - ldr r1, [r1] - ldr r3, [r1, 0x8] - adds r4, r3, 0 - adds r4, 0x20 - ldrb r1, [r4] - adds r2, r1, 0x1 - strb r2, [r4] - lsls r1, 24 - lsrs r1, 22 - adds r3, r1 - str r0, [r3] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end b_movescr_stack_push - - thumb_func_start b_movescr_stack_push_cursor -b_movescr_stack_push_cursor: @ 803FAFC - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r2, [r0, 0x8] - adds r3, r2, 0 - adds r3, 0x20 - ldrb r0, [r3] - adds r1, r0, 0x1 - strb r1, [r3] - lsls r0, 24 - lsrs r0, 22 - adds r2, r0 - ldr r0, =0x02024214 - ldr r0, [r0] - str r0, [r2] - bx lr - .pool - thumb_func_end b_movescr_stack_push_cursor - - thumb_func_start b_movescr_stack_pop_cursor -b_movescr_stack_pop_cursor: @ 803FB24 - ldr r3, =0x02024214 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x8] - adds r2, r1, 0 - adds r2, 0x20 - ldrb r0, [r2] - subs r0, 0x1 - strb r0, [r2] - lsls r0, 24 - lsrs r0, 22 - adds r1, r0 - ldr r0, [r1] - str r0, [r3] - bx lr - .pool - thumb_func_end b_movescr_stack_pop_cursor - - thumb_func_start sub_803FB4C -sub_803FB4C: @ 803FB4C - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r6, 0 - ldr r2, =0x02024084 - ldr r1, =0x02023864 - ldr r3, =0x02024064 - ldrb r4, [r3] - lsls r0, r4, 9 - adds r1, 0x2 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 1 - movs r1, 0x58 - muls r1, r4 - adds r0, r1 - adds r2, 0xC - adds r0, r2 - ldrh r5, [r0] - ldr r1, =0x0202449c - lsls r0, r4, 1 - adds r0, 0xC8 - ldr r1, [r1] - adds r1, r0 - mov r8, r1 - ldr r1, =0x020242bc - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x4] - adds r7, r3, 0 - adds r3, r1, 0 - cmp r0, r5 - bne _0803FC06 - cmp r5, 0 - beq _0803FC06 - ldr r0, =0x02024474 - strb r4, [r0, 0x17] - ldr r0, =0x020241ea - strh r5, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _0803FBF8 - ldr r1, =0x02024230 - ldrb r0, [r7] - lsls r0, 2 - adds r0, r1 - ldr r1, =gUnknown_082DAE2A - str r1, [r0] - ldr r0, =0x0202433c - ldrb r1, [r7] - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1, 0x2] - movs r2, 0x10 - orrs r0, r2 - strb r0, [r1, 0x2] - b _0803FC06 - .pool -_0803FBF8: - ldr r0, =0x02024220 - ldrb r1, [r7] - lsls r1, 2 - adds r1, r0 - ldr r0, =gUnknown_082DAE1F - str r0, [r1] - movs r6, 0x1 -_0803FC06: - ldr r1, =0x02024248 - ldrb r2, [r7] - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r5, r0 - bne _0803FC90 - cmp r5, 0xA5 - beq _0803FC90 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - bge _0803FC90 - adds r0, r2, 0 - bl b_cancel_multi_turn_move_maybe - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _0803FC7C - ldr r1, =0x02024230 - ldrb r0, [r7] - lsls r0, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB098 - str r1, [r0] - ldr r0, =0x0202433c - ldrb r1, [r7] - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1, 0x2] - movs r2, 0x10 - orrs r0, r2 - strb r0, [r1, 0x2] - b _0803FC8E - .pool -_0803FC7C: - ldr r1, =0x02024220 - ldrb r0, [r7] - lsls r0, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB089 - str r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0803FC8E: - ldr r3, =0x020242bc -_0803FC90: - ldrb r0, [r7] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r0, [r1, 0x13] - lsls r0, 28 - cmp r0, 0 - beq _0803FD1A - ldr r0, =gBattleMoves - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0 - bne _0803FD1A - ldr r0, =0x020241ea - strh r5, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _0803FD08 - ldr r1, =0x02024230 - ldrb r0, [r7] - lsls r0, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB0AF - str r1, [r0] - ldr r0, =0x0202433c - ldrb r1, [r7] - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1, 0x2] - movs r2, 0x10 - orrs r0, r2 - strb r0, [r1, 0x2] - b _0803FD1A - .pool -_0803FD08: - ldr r1, =0x02024220 - ldrb r0, [r7] - lsls r0, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB0A0 - str r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0803FD1A: - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r1, r5, 0 - bl sub_8040130 - lsls r0, 24 - cmp r0, 0 - beq _0803FD8E - ldr r0, =0x020241ea - strh r5, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _0803FD7C - ldr r1, =0x02024230 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB185 - str r1, [r0] - ldr r0, =0x0202433c - ldrb r1, [r4] - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1, 0x2] - movs r2, 0x10 - orrs r0, r2 - strb r0, [r1, 0x2] - b _0803FD8E - .pool -_0803FD7C: - ldr r1, =0x02024220 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB181 - str r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0803FD8E: - ldr r1, =0x02024084 - ldr r0, =0x02024064 - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _0803FDC4 - ldr r1, =0x02024404 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r4, [r0, 0x7] - b _0803FDCE - .pool -_0803FDC4: - ldrh r0, [r1, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r4, r0, 24 -_0803FDCE: - ldr r2, =0x0202420f - ldr r1, =0x02024064 - ldrb r0, [r1] - strb r0, [r2] - ldr r0, =0x02024084 - mov r12, r0 - adds r7, r1, 0 - cmp r4, 0x1D - bne _0803FE58 - mov r0, r8 - ldrh r1, [r0] - adds r2, r1, 0 - cmp r2, 0 - beq _0803FE58 - ldr r0, =0x0000ffff - cmp r2, r0 - beq _0803FE58 - cmp r2, r5 - beq _0803FE58 - ldr r0, =0x020241ea - strh r1, [r0] - ldr r2, =0x02024208 - ldrb r1, [r7] - movs r0, 0x58 - muls r0, r1 - add r0, r12 - ldrh r0, [r0, 0x2E] - strh r0, [r2] - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 10 - ands r1, r0 - ldrb r2, [r7] - cmp r1, 0 - beq _0803FE48 - ldr r0, =0x0202433c - lsls r1, r2, 4 - adds r1, r0 - ldrb r0, [r1, 0x2] - movs r2, 0x10 - orrs r0, r2 - strb r0, [r1, 0x2] - b _0803FE58 - .pool -_0803FE48: - ldr r1, =0x02024220 - lsls r0, r2, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB812 - str r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0803FE58: - ldr r0, =0x02023864 - ldrb r3, [r7] - lsls r1, r3, 9 - adds r0, 0x2 - adds r1, r0 - movs r0, 0x58 - muls r0, r3 - ldrb r1, [r1] - adds r0, r1 - mov r1, r12 - adds r1, 0x24 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _0803FEB8 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _0803FEA8 - ldr r0, =0x0202433c - lsls r1, r3, 4 - adds r1, r0 - ldrb r0, [r1, 0x2] - movs r2, 0x10 - orrs r0, r2 - strb r0, [r1, 0x2] - b _0803FEB8 - .pool -_0803FEA8: - ldr r1, =0x02024220 - lsls r0, r3, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB076 - str r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0803FEB8: - adds r0, r6, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_803FB4C - - thumb_func_start sub_803FECC -sub_803FECC: @ 803FECC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - lsls r2, 24 - lsrs r3, r2, 24 - ldr r1, =0x0202449c - lsls r0, r7, 1 - adds r0, 0xC8 - ldr r1, [r1] - adds r1, r0 - str r1, [sp, 0x4] - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r7 - adds r1, r0, r1 - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _0803FF1C - ldr r2, =0x02024404 - lsls r1, r7, 3 - subs r0, r1, r7 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x7] - str r0, [sp] - b _0803FF2E - .pool -_0803FF1C: - ldrh r0, [r1, 0x2E] - str r3, [sp, 0x14] - bl itemid_get_x12 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r1, r7, 3 - ldr r3, [sp, 0x14] -_0803FF2E: - ldr r0, =0x0202420f - strb r7, [r0] - movs r0, 0 - mov r9, r0 - lsls r2, r7, 1 - str r2, [sp, 0xC] - ldr r5, =0x020242bc - mov r12, r5 - ldr r0, =0x02024084 - movs r2, 0x58 - adds r6, r7, 0 - muls r6, r2 - str r6, [sp, 0x8] - ldr r2, =0x02024090 - adds r5, r6, r2 - movs r6, 0 - str r6, [sp, 0x10] - mov r10, r0 - subs r0, r1, r7 - lsls r0, 2 - mov r8, r0 - ldr r6, =gUnknown_0832A328 -_0803FF5A: - ldrh r0, [r5] - cmp r0, 0 - bne _0803FF70 - movs r0, 0x1 - ands r0, r3 - cmp r0, 0 - beq _0803FF70 - ldr r0, [r6] - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_0803FF70: - ldr r0, [sp, 0x8] - add r0, r9 - mov r1, r10 - adds r1, 0x24 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _0803FF90 - movs r0, 0x2 - ands r0, r3 - cmp r0, 0 - beq _0803FF90 - ldr r0, [r6] - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_0803FF90: - mov r1, r8 - add r1, r12 - ldrh r0, [r5] - ldrh r1, [r1, 0x4] - cmp r0, r1 - bne _0803FFAC - movs r0, 0x4 - ands r0, r3 - cmp r0, 0 - beq _0803FFAC - ldr r0, [r6] - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_0803FFAC: - movs r0, 0x58 - adds r2, r7, 0 - muls r2, r0 - ldr r1, [sp, 0x10] - adds r0, r1, r2 - ldr r1, =0x02024090 - adds r0, r1 - mov r12, r0 - ldr r1, =0x02024248 - ldr r0, [sp, 0xC] - adds r1, r0, r1 - str r1, [sp, 0x18] - mov r1, r12 - ldrh r1, [r1] - mov r12, r1 - ldr r0, [sp, 0x18] - ldrh r0, [r0] - cmp r12, r0 - bne _0803FFEE - movs r0, 0x8 - ands r0, r3 - cmp r0, 0 - beq _0803FFEE - mov r0, r10 - adds r0, 0x50 - adds r0, r2, r0 - ldr r0, [r0] - cmp r0, 0 - bge _0803FFEE - ldr r0, [r6] - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_0803FFEE: - ldr r0, =0x020242bc - add r0, r8 - ldrb r0, [r0, 0x13] - lsls r0, 28 - cmp r0, 0 - beq _0804001C - movs r0, 0x10 - ands r0, r3 - cmp r0, 0 - beq _0804001C - ldr r2, =gBattleMoves - ldrh r1, [r5] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _0804001C - ldr r0, [r6] - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_0804001C: - ldrh r1, [r5] - adds r0, r7, 0 - str r3, [sp, 0x14] - bl sub_8040130 - lsls r0, 24 - ldr r3, [sp, 0x14] - cmp r0, 0 - beq _0804003E - movs r0, 0x20 - ands r0, r3 - cmp r0, 0 - beq _0804003E - ldr r0, [r6] - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_0804003E: - ldr r1, =0x020242bc - mov r0, r8 - adds r2, r0, r1 - ldrb r0, [r2, 0xE] - lsls r0, 28 - mov r12, r1 - cmp r0, 0 - beq _0804005E - ldrh r0, [r2, 0x6] - ldrh r1, [r5] - cmp r0, r1 - beq _0804005E - ldr r0, [r6] - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_0804005E: - ldr r2, [sp] - cmp r2, 0x1D - bne _08040080 - ldr r0, [sp, 0x4] - ldrh r1, [r0] - cmp r1, 0 - beq _08040080 - ldr r0, =0x0000ffff - cmp r1, r0 - beq _08040080 - ldrh r2, [r5] - cmp r1, r2 - beq _08040080 - ldr r0, [r6] - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_08040080: - adds r6, 0x4 - adds r5, 0x2 - ldr r0, [sp, 0x10] - adds r0, 0x2 - str r0, [sp, 0x10] - movs r1, 0x1 - add r9, r1 - mov r2, r9 - cmp r2, 0x3 - bgt _08040096 - b _0803FF5A -_08040096: - adds r0, r4, 0 - 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_803FECC - - thumb_func_start sub_80400C8 -sub_80400C8: @ 80400C8 - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - movs r1, 0 - movs r2, 0xFF - bl sub_803FECC - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0xF - bne _0804010C - ldr r0, =0x0202433c - ldrb r1, [r4] - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - ldr r1, =0x02024220 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =gUnknown_082DB072 - str r1, [r0] - b _0804011E - .pool -_0804010C: - ldr r0, =0x0202433c - ldrb r1, [r4] - lsls r1, 4 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] -_0804011E: - movs r0, 0 - cmp r3, 0xF - bne _08040126 - movs r0, 0x1 -_08040126: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80400C8 - - thumb_func_start sub_8040130 -sub_8040130: @ 8040130 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r5, r1, 16 - movs r6, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r6, r0 - bge _080401B4 - ldr r7, =0x02024090 - mov r8, r7 -_0804015A: - lsls r0, r4, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - adds r3, r4, 0x1 - cmp r9, r0 - beq _080401AA - ldr r1, =0x020242ac - lsls r0, r4, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 6 - ands r0, r1 - cmp r0, 0 - beq _080401AA - movs r2, 0 - movs r0, 0x58 - adds r1, r4, 0 - muls r1, r0 - adds r0, r1, r7 - ldrh r0, [r0] - cmp r5, r0 - beq _080401A0 - mov r4, r8 - adds r0, r1, r4 -_08040192: - adds r0, 0x2 - adds r2, 0x1 - cmp r2, 0x3 - bgt _080401AA - ldrh r1, [r0] - cmp r5, r1 - bne _08040192 -_080401A0: - cmp r2, 0x3 - bgt _080401AA - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_080401AA: - adds r4, r3, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _0804015A -_080401B4: - adds r0, r6, 0 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8040130 - - thumb_func_start sub_80401D0 -sub_80401D0: @ 80401D0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r0, 0 - mov r9, r0 - ldr r1, =0x0202420b - mov r2, r9 - strb r2, [r1] - ldr r0, =0x0202406c - ldrb r4, [r0] - adds r6, r1, 0 - mov r10, r0 - ldr r7, =0x0202420c - ldr r3, =0x0202449c - mov r12, r3 - cmp r9, r4 - bcs _08040224 - ldr r2, =0x02024210 - ldrb r1, [r2] - ldr r5, =gUnknown_0832A328 - ldr r0, [r5] - ands r1, r0 - cmp r1, 0 - beq _08040224 - adds r3, r6, 0 -_08040206: - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - lsls r0, 24 - lsrs r0, 24 - cmp r0, r4 - bcs _08040224 - ldrb r0, [r2] - ldrb r1, [r6] - lsls r1, 2 - adds r1, r5 - ldr r1, [r1] - ands r0, r1 - cmp r0, 0 - bne _08040206 -_08040224: - movs r0, 0 - strb r0, [r7] - mov r0, r10 - ldrb r4, [r0] - cmp r4, 0 - beq _0804025E - ldr r2, =0x02024210 - ldrb r1, [r2] - ldr r5, =gUnknown_0832A328 - ldr r0, [r5] - ands r1, r0 - cmp r1, 0 - beq _0804025E - adds r3, r7, 0 -_08040240: - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - lsls r0, 24 - lsrs r0, 24 - cmp r0, r4 - bcs _0804025E - ldrb r0, [r2] - ldrb r1, [r7] - lsls r1, 2 - adds r1, r5 - ldr r1, [r1] - ands r0, r1 - cmp r0, 0 - bne _08040240 -_0804025E: - mov r1, r12 - ldr r0, [r1] - ldrb r0, [r0, 0x3] - cmp r0, 0xA - bls _0804026A - b _080408F6 -_0804026A: - lsls r0, 2 - ldr r1, =_08040290 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08040290: - .4byte _080402BC - .4byte _08040342 - .4byte _08040408 - .4byte _080404D4 - .4byte _080405B0 - .4byte _08040668 - .4byte _0804071C - .4byte _080407A0 - .4byte _08040810 - .4byte _08040868 - .4byte _080408EC -_080402BC: - movs r5, 0 - ldr r1, =0x0202406c - mov r10, r1 - ldrb r2, [r1] - cmp r5, r2 - bge _080402D6 - ldr r2, =0x0202407e -_080402CA: - adds r0, r5, r2 - strb r5, [r0] - adds r5, 0x1 - ldrb r3, [r1] - cmp r5, r3 - blt _080402CA -_080402D6: - movs r5, 0 - b _08040324 - .pool -_080402E4: - adds r4, r5, 0x1 - adds r6, r4, 0 - ldrb r1, [r1] - cmp r6, r1 - bge _08040322 - ldr r7, =0x0202407e - ldr r0, =0x0202406c - mov r10, r0 - lsls r1, r5, 24 - mov r8, r1 -_080402F8: - adds r0, r5, r7 - ldrb r0, [r0] - adds r1, r4, r7 - ldrb r1, [r1] - movs r2, 0 - bl b_first_side - lsls r0, 24 - cmp r0, 0 - beq _08040318 - lsls r1, r4, 24 - lsrs r1, 24 - mov r2, r8 - lsrs r0, r2, 24 - bl sub_803CEDC -_08040318: - adds r4, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _080402F8 -_08040322: - adds r5, r6, 0 -_08040324: - mov r1, r10 - ldrb r0, [r1] - subs r0, 0x1 - cmp r5, r0 - blt _080402E4 - ldr r2, =0x0202449c - ldr r1, [r2] - ldrb r0, [r1, 0x3] - adds r0, 0x1 - strb r0, [r1, 0x3] - ldr r0, [r2] - adds r0, 0xDB - movs r1, 0 - strb r1, [r0] - mov r12, r2 -_08040342: - mov r1, r12 - ldr r0, [r1] - adds r0, 0xDB - ldrb r0, [r0] - cmp r0, 0x1 - bls _08040350 - b _0804062C -_08040350: - ldr r3, =0x02024064 - mov r8, r3 - movs r7, 0 - ldr r6, =0x0202420b - ldr r5, =0x02022f58 -_0804035A: - ldr r0, [r1] - adds r0, 0xDB - ldrb r4, [r0] - ldr r2, =0x02024294 - lsls r1, r4, 1 - adds r0, r1, r4 - lsls r0, 2 - adds r2, r0, r2 - ldrb r0, [r2, 0x1] - strb r0, [r6] - mov r3, r8 - strb r0, [r3] - ldr r0, =0x0202428e - adds r3, r1, r0 - ldrh r1, [r3] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080403BC - ldrb r0, [r2] - subs r0, 0x1 - strb r0, [r2] - movs r4, 0xFF - lsls r0, 24 - cmp r0, 0 - bne _080403BC - ldrh r0, [r3] - ldr r2, =0x0000fffe - adds r1, r2, 0 - ands r0, r1 - strh r0, [r3] - ldr r0, =gUnknown_082DACFA - bl b_call_bc_move_exec - movs r0, 0xFD - strb r0, [r5] - movs r0, 0x2 - strb r0, [r5, 0x1] - movs r0, 0x73 - strb r0, [r5, 0x2] - strb r7, [r5, 0x3] - ldrb r0, [r5, 0x4] - orrs r0, r4 - strb r0, [r5, 0x4] - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_080403BC: - ldr r2, =0x0202449c - ldr r1, [r2] - adds r1, 0xDB - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r12, r2 - mov r3, r9 - cmp r3, 0 - beq _080403D2 - b _080408FE -_080403D2: - mov r1, r12 - ldr r0, [r1] - adds r0, 0xDB - ldrb r0, [r0] - cmp r0, 0x1 - bls _0804035A - b _0804062C - .pool -_08040408: - mov r1, r12 - ldr r0, [r1] - adds r0, 0xDB - ldrb r0, [r0] - cmp r0, 0x1 - bls _08040416 - b _08040570 -_08040416: - movs r0, 0x2 - mov r10, r0 - movs r2, 0 - mov r8, r2 - ldr r7, =0x0202420b - ldr r5, =0x02022f58 -_08040422: - ldr r0, [r1] - adds r0, 0xDB - ldrb r4, [r0] - ldr r2, =0x02024294 - lsls r1, r4, 1 - adds r0, r1, r4 - lsls r0, 2 - adds r2, r0, r2 - ldrb r0, [r2, 0x3] - strb r0, [r7] - ldr r3, =0x02024064 - strb r0, [r3] - ldr r0, =0x0202428e - adds r3, r1, r0 - ldrh r1, [r3] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0804048A - ldrb r0, [r2, 0x2] - subs r0, 0x1 - strb r0, [r2, 0x2] - movs r6, 0xFF - lsls r0, 24 - cmp r0, 0 - bne _0804048A - ldrh r0, [r3] - ldr r2, =0x0000fffd - adds r1, r2, 0 - ands r0, r1 - strh r0, [r3] - ldr r0, =gUnknown_082DACFA - bl b_call_bc_move_exec - ldr r0, =0x02024332 - strb r4, [r0, 0x5] - movs r0, 0xFD - strb r0, [r5] - mov r3, r10 - strb r3, [r5, 0x1] - movs r0, 0x71 - strb r0, [r5, 0x2] - mov r0, r8 - strb r0, [r5, 0x3] - ldrb r0, [r5, 0x4] - orrs r0, r6 - strb r0, [r5, 0x4] - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_0804048A: - ldr r2, =0x0202449c - ldr r1, [r2] - adds r1, 0xDB - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r12, r2 - mov r1, r9 - cmp r1, 0 - beq _080404A0 - b _080408FE -_080404A0: - mov r1, r12 - ldr r0, [r1] - adds r0, 0xDB - ldrb r0, [r0] - cmp r0, 0x1 - bls _08040422 - b _08040570 - .pool -_080404D4: - mov r1, r12 - ldr r0, [r1] - adds r0, 0xDB - ldrb r0, [r0] - cmp r0, 0x1 - bhi _08040570 - ldr r0, =0x02024064 - mov r10, r0 - movs r2, 0 - mov r8, r2 - ldr r7, =0x0202420b - ldr r5, =0x02022f58 -_080404EC: - ldr r0, [r1] - adds r0, 0xDB - ldrb r4, [r0] - ldr r1, =0x02024294 - lsls r3, r4, 1 - adds r0, r3, r4 - lsls r0, 2 - adds r1, r0, r1 - ldrb r0, [r1, 0x5] - strb r0, [r7] - mov r2, r10 - strb r0, [r2] - ldrb r0, [r1, 0x4] - cmp r0, 0 - beq _0804054E - subs r0, 0x1 - strb r0, [r1, 0x4] - movs r6, 0xFF - lsls r0, 24 - cmp r0, 0 - bne _0804054E - ldr r2, =0x0202428e - adds r2, r3, r2 - ldrh r0, [r2] - ldr r3, =0x0000feff - adds r1, r3, 0 - ands r0, r1 - strh r0, [r2] - ldr r0, =gUnknown_082DACFA - bl b_call_bc_move_exec - ldr r0, =0x02024332 - strb r4, [r0, 0x5] - movs r0, 0xFD - strb r0, [r5] - movs r0, 0x2 - strb r0, [r5, 0x1] - movs r0, 0x36 - strb r0, [r5, 0x2] - mov r0, r8 - strb r0, [r5, 0x3] - ldrb r0, [r5, 0x4] - orrs r0, r6 - strb r0, [r5, 0x4] - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_0804054E: - ldr r2, =0x0202449c - ldr r1, [r2] - adds r1, 0xDB - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r12, r2 - mov r1, r9 - cmp r1, 0 - beq _08040564 - b _080408FE -_08040564: - mov r1, r12 - ldr r0, [r1] - adds r0, 0xDB - ldrb r0, [r0] - cmp r0, 0x1 - bls _080404EC -_08040570: - mov r2, r9 - cmp r2, 0 - beq _08040578 - b _080408FE -_08040578: - mov r3, r12 - ldr r0, [r3] - ldrb r1, [r0, 0x3] - adds r1, 0x1 - strb r1, [r0, 0x3] - ldr r0, [r3] - adds r0, 0xDB - strb r2, [r0] - b _080408F6 - .pool -_080405B0: - mov r1, r12 - ldr r0, [r1] - adds r0, 0xDB - ldrb r0, [r0] - cmp r0, 0x1 - bhi _0804062C - ldr r6, =0x02024064 - ldr r5, =0x0202420b -_080405C0: - ldr r0, [r1] - adds r0, 0xDB - ldrb r4, [r0] - ldr r2, =0x02024294 - lsls r1, r4, 1 - adds r0, r1, r4 - lsls r0, 2 - adds r2, r0, r2 - ldrb r0, [r2, 0x7] - strb r0, [r5] - strb r0, [r6] - ldr r0, =0x0202428e - adds r3, r1, r0 - ldrh r1, [r3] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0804060A - ldrb r0, [r2, 0x6] - subs r0, 0x1 - strb r0, [r2, 0x6] - lsls r0, 24 - cmp r0, 0 - bne _0804060A - ldrh r0, [r3] - ldr r2, =0x0000ffdf - adds r1, r2, 0 - ands r0, r1 - strh r0, [r3] - ldr r0, =gUnknown_082DAD0B - bl b_call_bc_move_exec - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_0804060A: - ldr r2, =0x0202449c - ldr r1, [r2] - adds r1, 0xDB - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r12, r2 - mov r3, r9 - cmp r3, 0 - beq _08040620 - b _080408FE -_08040620: - mov r1, r12 - ldr r0, [r1] - adds r0, 0xDB - ldrb r0, [r0] - cmp r0, 0x1 - bls _080405C0 -_0804062C: - mov r0, r9 - cmp r0, 0 - beq _08040634 - b _080408FE -_08040634: - mov r1, r12 - ldr r0, [r1] - ldrb r1, [r0, 0x3] - adds r1, 0x1 - strb r1, [r0, 0x3] - mov r2, r12 - ldr r0, [r2] - adds r0, 0xDB - mov r3, r9 - strb r3, [r0] - b _080408F6 - .pool -_08040668: - mov r2, r12 - ldr r0, [r2] - adds r0, 0xDB - ldr r1, =0x0202406c - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcs _080406E8 - ldr r4, =0x02024064 - ldr r5, =0x0202407e -_0804067C: - ldr r0, [r2] - adds r0, 0xDB - ldrb r0, [r0] - adds r0, r5 - ldrb r0, [r0] - strb r0, [r4] - ldr r0, =0x020243d0 - adds r0, 0x20 - ldrb r2, [r4] - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0 - beq _080406C4 - subs r0, 0x1 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - bne _080406C4 - ldr r1, =0x02024084 - ldrb r2, [r4] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _080406C4 - ldr r0, =0x0202420c - strb r2, [r0] - ldr r0, =gUnknown_082DB0B7 - bl b_call_bc_move_exec - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_080406C4: - ldr r2, =0x0202449c - ldr r1, [r2] - adds r1, 0xDB - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r12, r2 - mov r3, r9 - cmp r3, 0 - beq _080406DA - b _080408FE -_080406DA: - ldr r0, [r2] - adds r0, 0xDB - ldr r1, =0x0202406c - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcc _0804067C -_080406E8: - mov r0, r9 - cmp r0, 0 - beq _080406F0 - b _080408FE -_080406F0: - mov r2, r12 - ldr r1, [r2] - ldrb r0, [r1, 0x3] - adds r0, 0x1 - strb r0, [r1, 0x3] - b _080408F6 - .pool -_0804071C: - ldr r3, =0x020243cc - ldrh r2, [r3] - movs r0, 0x7 - ands r0, r2 - cmp r0, 0 - bne _0804072A - b _080408C8 -_0804072A: - movs r0, 0x4 - ands r0, r2 - cmp r0, 0 - bne _08040776 - ldr r1, =0x020243d0 - adds r1, 0x28 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - bne _08040768 - ldr r0, =0x0000fffe - ands r0, r2 - ldr r1, =0x0000fffd - ands r0, r1 - strh r0, [r3] - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1, 0x5] - b _08040794 - .pool -_08040768: - movs r0, 0x2 - ands r0, r2 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - bne _08040782 - b _08040790 -_08040776: - movs r0, 0x2 - ands r0, r2 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _08040790 -_08040782: - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - b _08040794 - .pool -_08040790: - ldr r0, =0x02024332 - strb r1, [r0, 0x5] -_08040794: - ldr r0, =gUnknown_082DAC2C - b _080408BA - .pool -_080407A0: - ldr r3, =0x020243cc - ldrh r2, [r3] - movs r0, 0x18 - ands r0, r2 - cmp r0, 0 - bne _080407AE - b _080408C8 -_080407AE: - movs r0, 0x10 - ands r0, r2 - cmp r0, 0 - bne _080407E8 - ldr r1, =0x020243d0 - adds r1, 0x28 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - bne _080407E8 - ldr r0, =0x0000fff7 - ands r0, r2 - strh r0, [r3] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DACC9 - b _080407EC - .pool -_080407E8: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAC47 -_080407EC: - str r0, [r1] - adds r3, r1, 0 - ldr r1, =0x02024474 - movs r2, 0 - movs r0, 0xC - strb r0, [r1, 0x10] - ldr r0, =0x02024332 - strb r2, [r0, 0x5] - b _080408B8 - .pool -_08040810: - ldr r3, =0x020243cc - ldrh r2, [r3] - movs r0, 0x60 - ands r0, r2 - cmp r0, 0 - beq _080408C8 - movs r0, 0x40 - ands r0, r2 - cmp r0, 0 - bne _08040854 - ldr r1, =0x020243d0 - adds r1, 0x28 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - bne _08040854 - ldr r0, =0x0000ffdf - ands r0, r2 - strh r0, [r3] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DACE0 - b _08040858 - .pool -_08040854: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DACD2 -_08040858: - str r0, [r1] - adds r3, r1, 0 - b _080408B8 - .pool -_08040868: - ldr r3, =0x020243cc - ldrh r2, [r3] - movs r0, 0x80 - ands r0, r2 - cmp r0, 0 - beq _080408C8 - ldr r1, =0x020243d0 - adds r1, 0x28 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - bne _080408A4 - ldr r0, =0x0000ff7f - ands r0, r2 - strh r0, [r3] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DACC9 - b _080408A8 - .pool -_080408A4: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAC47 -_080408A8: - str r0, [r1] - adds r3, r1, 0 - ldr r1, =0x02024474 - movs r0, 0xD - strb r0, [r1, 0x10] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] -_080408B8: - ldr r0, [r3] -_080408BA: - bl b_call_bc_move_exec - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_080408C8: - ldr r2, =0x0202449c - ldr r1, [r2] - ldrb r0, [r1, 0x3] - adds r0, 0x1 - strb r0, [r1, 0x3] - mov r12, r2 - b _080408F6 - .pool -_080408EC: - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_080408F6: - mov r3, r9 - cmp r3, 0 - bne _080408FE - b _0804025E -_080408FE: - ldr r0, =0x03005d04 - ldr r1, [r0] - ldr r0, =sub_803B9BC - eors r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80401D0 - - thumb_func_start sub_8040924 -sub_8040924: @ 8040924 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - movs r0, 0 - mov r9, r0 - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0x01000020 - orrs r0, r1 - str r0, [r2] - ldr r5, =0x0202449c - ldr r2, [r5] - ldr r0, =0x0202406c - ldrb r1, [r2, 0x1] - adds r7, r5, 0 - mov r8, r0 - ldrb r3, [r0] - cmp r1, r3 - bcc _08040954 - bl _08041338 -_08040954: - bl _0804132E - .pool -_08040968: - ldr r3, =0x02024064 - ldr r4, =0x0202420b - ldr r1, =0x0202407e - ldr r5, [r5] - ldrb r0, [r5, 0x1] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r4] - strb r0, [r3] - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r0, [r3] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - adds r6, r3, 0 - cmp r1, 0 - beq _080409B0 - ldrb r0, [r5, 0x1] - adds r0, 0x1 - strb r0, [r5, 0x1] - bl _0804131C - .pool -_080409B0: - ldrb r0, [r5] - cmp r0, 0x13 - bls _080409BA - bl _08041312 -_080409BA: - lsls r0, 2 - ldr r1, =_080409C8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080409C8: - .4byte _08040A18 - .4byte _08040A78 - .4byte _08040A96 - .4byte _08040AC6 - .4byte _08040B44 - .4byte _08040B8C - .4byte _08040C0C - .4byte _08040C54 - .4byte _08040CB8 - .4byte _08040D00 - .4byte _08040E60 - .4byte _08040F7C - .4byte _08041024 - .4byte _080410E8 - .4byte _0804119C - .4byte _080411BC - .4byte _08041208 - .4byte _08041238 - .4byte _08040AAE - .4byte _08041304 -_08040A18: - ldr r1, =0x020242ac - ldrb r3, [r6] - lsls r0, r3, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 3 - ands r0, r1 - cmp r0, 0 - bne _08040A30 - bl _080412DE -_08040A30: - ldr r0, =0x02024084 - movs r1, 0x58 - muls r1, r3 - adds r0, r1, r0 - ldrh r2, [r0, 0x28] - ldrh r5, [r0, 0x2C] - cmp r2, r5 - bne _08040A44 - bl _080412DE -_08040A44: - cmp r2, 0 - bne _08040A4C - bl _080412DE -_08040A4C: - ldr r1, =0x020241f0 - ldrh r0, [r0, 0x2C] - lsrs r0, 4 - str r0, [r1] - cmp r0, 0 - bne _08040A5C - movs r0, 0x1 - str r0, [r1] -_08040A5C: - ldr r0, [r1] - negs r0, r0 - str r0, [r1] - ldr r0, =gUnknown_082DB0EE - bl _080412D0 - .pool -_08040A78: - ldrb r1, [r6] - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _08040A92 - bl _080412DE -_08040A92: - bl _080412D4 -_08040A96: - ldrb r1, [r6] - movs r0, 0x1 - movs r2, 0 - bl berry_effects_maybe - lsls r0, 24 - cmp r0, 0 - bne _08040AAA - bl _080412DE -_08040AAA: - bl _080412D4 -_08040AAE: - ldrb r1, [r6] - movs r0, 0x1 - movs r2, 0x1 - bl berry_effects_maybe - lsls r0, 24 - cmp r0, 0 - bne _08040AC2 - bl _080412DE -_08040AC2: - bl _080412D4 -_08040AC6: - ldr r0, =0x020242ac - ldrb r2, [r6] - lsls r1, r2, 2 - adds r1, r0 - ldr r1, [r1] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _08040ADC - bl _080412DE -_08040ADC: - ldr r3, =0x02024084 - movs r5, 0x3 - ands r5, r1 - movs r1, 0x58 - adds r0, r5, 0 - muls r0, r1 - adds r0, r3 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08040AF4 - bl _080412DE -_08040AF4: - adds r0, r2, 0 - muls r0, r1 - adds r0, r3 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08040B04 - bl _080412DE -_08040B04: - ldr r0, =0x0202420c - strb r5, [r0] - ldr r2, =0x020241f0 - ldrb r0, [r6] - muls r0, r1 - adds r0, r3 - ldrh r0, [r0, 0x2C] - lsrs r0, 3 - str r0, [r2] - cmp r0, 0 - bne _08040B1E - movs r0, 0x1 - str r0, [r2] -_08040B1E: - ldr r1, =0x02024474 - strb r5, [r1, 0x10] - ldrb r0, [r4] - strb r0, [r1, 0x11] - ldr r0, =gUnknown_082DAD15 - b _080412D0 - .pool -_08040B44: - ldr r2, =0x02024084 - ldrb r1, [r6] - movs r0, 0x58 - adds r3, r1, 0 - muls r3, r0 - adds r0, r2, 0 - adds r0, 0x4C - adds r0, r3, r0 - ldr r0, [r0] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - bne _08040B60 - b _080412DE -_08040B60: - adds r1, r3, r2 - ldrh r0, [r1, 0x28] - cmp r0, 0 - bne _08040B6A - b _080412DE -_08040B6A: - ldr r2, =0x020241f0 - ldrh r0, [r1, 0x2C] - lsrs r0, 3 - str r0, [r2] - cmp r0, 0 - bne _08040B7A - movs r0, 0x1 - str r0, [r2] -_08040B7A: - ldr r0, =gUnknown_082DB23D - b _080412D0 - .pool -_08040B8C: - ldr r4, =0x02024084 - ldrb r0, [r6] - movs r7, 0x58 - mov r8, r7 - mov r2, r8 - muls r2, r0 - adds r3, r4, 0 - adds r3, 0x4C - adds r0, r2, r3 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08040BAA - b _080412DE -_08040BAA: - adds r1, r2, r4 - ldrh r0, [r1, 0x28] - cmp r0, 0 - bne _08040BB4 - b _080412DE -_08040BB4: - ldr r5, =0x020241f0 - ldrh r0, [r1, 0x2C] - lsrs r0, 4 - str r0, [r5] - cmp r0, 0 - bne _08040BC4 - movs r0, 0x1 - str r0, [r5] -_08040BC4: - ldrb r0, [r6] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r2, r0, r3 - ldr r1, [r2] - movs r4, 0xF0 - lsls r4, 4 - adds r0, r1, 0 - ands r0, r4 - cmp r0, r4 - beq _08040BE4 - movs r7, 0x80 - lsls r7, 1 - adds r0, r1, r7 - str r0, [r2] -_08040BE4: - ldrb r0, [r6] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r3 - ldr r0, [r0] - ands r0, r4 - lsrs r0, 8 - ldr r1, [r5] - muls r0, r1 - str r0, [r5] - ldr r0, =gUnknown_082DB23D - b _080412D0 - .pool -_08040C0C: - ldr r2, =0x02024084 - ldrb r1, [r6] - movs r0, 0x58 - adds r3, r1, 0 - muls r3, r0 - adds r0, r2, 0 - adds r0, 0x4C - adds r0, r3, r0 - ldr r0, [r0] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - bne _08040C28 - b _080412DE -_08040C28: - adds r1, r3, r2 - ldrh r0, [r1, 0x28] - cmp r0, 0 - bne _08040C32 - b _080412DE -_08040C32: - ldr r2, =0x020241f0 - ldrh r0, [r1, 0x2C] - lsrs r0, 3 - str r0, [r2] - cmp r0, 0 - bne _08040C42 - movs r0, 0x1 - str r0, [r2] -_08040C42: - ldr r0, =gUnknown_082DB25F - b _080412D0 - .pool -_08040C54: - ldr r4, =0x02024084 - ldrb r1, [r6] - movs r0, 0x58 - muls r1, r0 - adds r0, r4, 0 - adds r0, 0x50 - adds r5, r1, r0 - ldr r2, [r5] - movs r0, 0x80 - lsls r0, 20 - ands r0, r2 - cmp r0, 0 - bne _08040C70 - b _080412DE -_08040C70: - adds r3, r1, r4 - ldrh r0, [r3, 0x28] - cmp r0, 0 - bne _08040C7A - b _080412DE -_08040C7A: - adds r0, r4, 0 - adds r0, 0x4C - adds r0, r1, r0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08040CAC - ldr r1, =0x020241f0 - ldrh r0, [r3, 0x2C] - lsrs r0, 2 - str r0, [r1] - cmp r0, 0 - bne _08040C9A - movs r0, 0x1 - str r0, [r1] -_08040C9A: - ldr r0, =gUnknown_082DB33F - b _080412D0 - .pool -_08040CAC: - ldr r0, =0xf7ffffff - ands r2, r0 - str r2, [r5] - b _080412DE - .pool -_08040CB8: - ldr r2, =0x02024084 - ldrb r1, [r6] - movs r0, 0x58 - adds r3, r1, 0 - muls r3, r0 - adds r0, r2, 0 - adds r0, 0x50 - adds r0, r3, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 21 - ands r0, r1 - cmp r0, 0 - bne _08040CD6 - b _080412DE -_08040CD6: - adds r1, r3, r2 - ldrh r0, [r1, 0x28] - cmp r0, 0 - bne _08040CE0 - b _080412DE -_08040CE0: - ldr r2, =0x020241f0 - ldrh r0, [r1, 0x2C] - lsrs r0, 2 - str r0, [r2] - cmp r0, 0 - bne _08040CF0 - movs r0, 0x1 - str r0, [r2] -_08040CF0: - ldr r0, =gUnknown_082DB350 - b _080412D0 - .pool -_08040D00: - ldr r3, =0x02024084 - mov r8, r3 - ldrb r0, [r6] - movs r3, 0x58 - adds r1, r0, 0 - muls r1, r3 - movs r5, 0x50 - add r5, r8 - mov r10, r5 - adds r4, r1, r5 - ldr r2, [r4] - movs r5, 0xE0 - lsls r5, 8 - adds r0, r2, 0 - ands r0, r5 - cmp r0, 0 - bne _08040D24 - b _080412DE -_08040D24: - mov r7, r8 - adds r0, r1, r7 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08040D30 - b _080412DE -_08040D30: - ldr r1, =0xffffe000 - adds r0, r2, r1 - str r0, [r4] - ldrb r4, [r6] - adds r0, r4, 0 - muls r0, r3 - add r0, r10 - ldr r0, [r0] - ands r0, r5 - cmp r0, 0 - beq _08040DC0 - ldr r1, =0x02024474 - ldr r0, =0x0202449c - ldr r2, [r0] - lsls r0, r4, 1 - adds r0, r2 - ldrb r0, [r0, 0x4] - strb r0, [r1, 0x10] - ldrb r0, [r6] - lsls r0, 1 - adds r0, r2 - ldrb r0, [r0, 0x5] - strb r0, [r1, 0x11] - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - ldrb r0, [r6] - lsls r0, 1 - adds r0, r2 - ldrb r0, [r0, 0x4] - strb r0, [r1, 0x2] - ldrb r0, [r6] - lsls r0, 1 - adds r0, r2 - ldrb r0, [r0, 0x5] - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB30E - str r0, [r1] - ldr r2, =0x020241f0 - ldrb r0, [r6] - muls r0, r3 - add r0, r8 - ldrh r0, [r0, 0x2C] - lsrs r0, 4 - str r0, [r2] - cmp r0, 0 - bne _08040DEC - movs r0, 0x1 - str r0, [r2] - b _08040DEC - .pool -_08040DC0: - ldr r2, =0x02022f58 - movs r0, 0xFD - strb r0, [r2] - movs r0, 0x2 - strb r0, [r2, 0x1] - ldrb r1, [r6] - ldr r0, =0x0202449c - ldr r3, [r0] - lsls r1, 1 - adds r1, r3 - ldrb r0, [r1, 0x4] - strb r0, [r2, 0x2] - ldrb r0, [r6] - lsls r0, 1 - adds r0, r3 - ldrb r0, [r0, 0x5] - strb r0, [r2, 0x3] - movs r0, 0xFF - strb r0, [r2, 0x4] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB320 - str r0, [r1] -_08040DEC: - ldr r0, [r1] - b _080412D0 - .pool -_08040E00: - movs r0, 0x8 - negs r0, r0 - ands r3, r0 - str r3, [r2] - ldrb r0, [r6] - mov r2, r8 - muls r2, r0 - mov r0, r10 - adds r0, 0x50 - adds r2, r0 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - ldr r0, =gUnknown_082DB234 - bl b_call_bc_move_exec - ldr r4, =0x02024064 - ldrb r0, [r6] - strb r0, [r4] - ldrb r0, [r4] - mov r3, r8 - muls r3, r0 - adds r0, r3, 0 - add r0, r9 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _08040EC8 - .pool -_08040E60: - ldr r2, =0x02024084 - ldrb r1, [r6] - movs r0, 0x58 - muls r0, r1 - adds r1, r2, 0 - adds r1, 0x50 - adds r0, r1 - ldr r1, [r0] - movs r0, 0x70 - ands r1, r0 - adds r7, r2, 0 - cmp r1, 0 - beq _08040F6A - movs r0, 0 - strb r0, [r4] - mov r5, r8 - ldrb r0, [r5] - cmp r0, 0 - beq _08040EC8 - mov r10, r7 - adds r6, r4, 0 - movs r1, 0x58 - mov r8, r1 - movs r3, 0x4C - adds r3, r7 - mov r9, r3 - str r0, [sp, 0x4] - movs r5, 0x7 - mov r12, r5 -_08040E9A: - ldrb r4, [r6] - mov r1, r8 - muls r1, r4 - mov r0, r9 - adds r2, r1, r0 - ldr r3, [r2] - adds r0, r3, 0 - mov r5, r12 - ands r0, r5 - cmp r0, 0 - beq _08040EBA - adds r0, r1, r7 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x2B - bne _08040E00 -_08040EBA: - adds r0, r4, 0x1 - strb r0, [r6] - lsls r0, 24 - lsrs r0, 24 - ldr r1, [sp, 0x4] - cmp r0, r1 - bcc _08040E9A -_08040EC8: - ldr r2, =0x0202420b - ldr r1, =0x0202406c - ldrb r0, [r2] - ldrb r1, [r1] - cmp r0, r1 - beq _08040EE8 - movs r3, 0x2 - mov r9, r3 - b _08041318 - .pool -_08040EE8: - ldr r5, =0x02024064 - ldrb r0, [r5] - strb r0, [r2] - ldr r2, =0x02024084 - ldrb r0, [r5] - movs r7, 0x58 - adds r1, r0, 0 - muls r1, r7 - adds r6, r2, 0 - adds r6, 0x50 - adds r1, r6 - ldr r0, [r1] - subs r0, 0x10 - str r0, [r1] - ldrb r0, [r5] - bl sub_803F90C - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _08040F2C - ldrb r0, [r5] - bl b_cancel_multi_turn_move_maybe - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - b _08040F60 - .pool -_08040F2C: - ldrb r3, [r5] - adds r0, r3, 0 - muls r0, r7 - adds r2, r0, r6 - ldr r0, [r2] - movs r1, 0x70 - ands r0, r1 - cmp r0, 0 - beq _08040F54 - ldr r0, =0x02024332 - strb r4, [r0, 0x5] - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 5 - orrs r0, r1 - str r0, [r2] - b _08040F60 - .pool -_08040F54: - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - adds r0, r3, 0 - bl b_cancel_multi_turn_move_maybe -_08040F60: - ldr r0, =gUnknown_082DB2A6 - bl b_call_bc_move_exec - movs r5, 0x1 - mov r9, r5 -_08040F6A: - mov r7, r9 - cmp r7, 0x2 - bne _08040F72 - b _08041312 -_08040F72: - b _080412DE - .pool -_08040F7C: - ldr r1, =0x02024084 - ldrb r0, [r6] - movs r7, 0x58 - muls r0, r7 - adds r5, r1, 0 - adds r5, 0x50 - adds r2, r0, r5 - ldr r1, [r2] - movs r4, 0xC0 - lsls r4, 4 - adds r0, r1, 0 - ands r0, r4 - cmp r0, 0 - bne _08040F9A - b _080412DE -_08040F9A: - ldr r3, =0xfffffc00 - adds r0, r1, r3 - str r0, [r2] - ldrb r0, [r6] - bl sub_803F90C - lsls r0, 24 - cmp r0, 0 - beq _08040FBC - ldrb r0, [r6] - bl b_cancel_multi_turn_move_maybe - b _080412DE - .pool -_08040FBC: - ldrb r0, [r6] - muls r0, r7 - adds r2, r0, r5 - ldr r1, [r2] - adds r0, r1, 0 - ands r0, r4 - cmp r0, 0 - beq _08040FCE - b _080412DE -_08040FCE: - movs r0, 0x80 - lsls r0, 5 - ands r0, r1 - cmp r0, 0 - bne _08040FDA - b _080412DE -_08040FDA: - ldr r0, =0xffffefff - ands r1, r0 - str r1, [r2] - ldrb r0, [r6] - muls r0, r7 - adds r0, r5 - ldr r0, [r0] - movs r4, 0x7 - ands r0, r4 - cmp r0, 0 - beq _08040FF2 - b _080412DE -_08040FF2: - ldr r1, =0x02024332 - movs r0, 0x47 - strb r0, [r1, 0x3] - movs r0, 0x1 - movs r1, 0 - bl sub_8048760 - ldrb r0, [r6] - muls r0, r7 - adds r0, r5 - ldr r0, [r0] - ands r0, r4 - cmp r0, 0 - bne _08041010 - b _080412D4 -_08041010: - ldr r0, =gUnknown_082DB2AF - bl b_call_bc_move_exec - b _080412D4 - .pool -_08041024: - ldr r0, =0x020242bc - ldrb r3, [r6] - lsls r1, r3, 3 - subs r1, r3 - lsls r1, 2 - adds r5, r1, r0 - ldrb r1, [r5, 0xB] - lsls r1, 28 - adds r7, r0, 0 - cmp r1, 0 - bne _0804103C - b _080412DE -_0804103C: - movs r4, 0 - ldr r2, =0x02024084 - movs r0, 0x58 - adds r1, r3, 0 - muls r1, r0 - adds r2, 0xC - adds r1, r2 - ldrh r0, [r5, 0x4] - ldrh r1, [r1] - cmp r0, r1 - beq _0804107A - mov r12, r7 - mov r8, r2 - adds r5, r6, 0 - movs r3, 0x58 -_0804105A: - adds r4, 0x1 - cmp r4, 0x3 - bgt _0804107A - ldrb r2, [r5] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - add r1, r12 - lsls r0, r4, 1 - muls r2, r3 - adds r0, r2 - add r0, r8 - ldrh r1, [r1, 0x4] - ldrh r0, [r0] - cmp r1, r0 - bne _0804105A -_0804107A: - cmp r4, 0x4 - bne _080410AC - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r7 - movs r1, 0 - strh r1, [r0, 0x4] - ldrb r0, [r6] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r7 - ldrb r2, [r1, 0xB] - movs r0, 0x10 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0xB] - b _080412DE - .pool -_080410AC: - ldrb r0, [r6] - lsls r2, r0, 3 - subs r2, r0 - lsls r2, 2 - adds r2, r7 - ldrb r3, [r2, 0xB] - lsls r1, r3, 28 - lsrs r1, 28 - subs r1, 0x1 - movs r0, 0xF - ands r1, r0 - movs r0, 0x10 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0xB] - adds r2, r1, 0 - cmp r2, 0 - beq _080410D4 - b _080412DE -_080410D4: - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x4] - ldr r0, =gUnknown_082DAE23 - b _080412D0 - .pool -_080410E8: - ldr r3, =0x020242bc - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r2, r0, r3 - ldrb r5, [r2, 0xE] - lsls r4, r5, 28 - cmp r4, 0 - bne _080410FE - b _080412DE -_080410FE: - ldr r7, =0x02024084 - mov r8, r7 - ldrb r0, [r2, 0xC] - lsls r0, 1 - movs r7, 0x58 - muls r1, r7 - adds r0, r1 - mov r1, r8 - adds r1, 0xC - adds r0, r1 - ldrh r0, [r0] - ldrh r1, [r2, 0x6] - cmp r0, r1 - beq _0804113C - movs r0, 0 - strh r0, [r2, 0x6] - ldrb r0, [r6] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r2, [r1, 0xE] - movs r0, 0x10 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0xE] - b _080412DE - .pool -_0804113C: - lsrs r1, r4, 28 - subs r1, 0x1 - movs r0, 0xF - ands r1, r0 - movs r4, 0x10 - negs r4, r4 - adds r0, r4, 0 - ands r0, r5 - orrs r0, r1 - strb r0, [r2, 0xE] - cmp r1, 0 - beq _08041172 - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r3 - muls r1, r7 - ldrb r0, [r0, 0xC] - adds r1, r0 - mov r0, r8 - adds r0, 0x24 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _08041172 - b _080412DE -_08041172: - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0 - strh r1, [r0, 0x6] - ldrb r0, [r6] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r2, [r1, 0xE] - adds r0, r4, 0 - ands r0, r2 - strb r0, [r1, 0xE] - ldr r0, =gUnknown_082DAE37 - b _080412D0 - .pool -_0804119C: - ldr r0, =0x020242ac - ldrb r1, [r6] - lsls r1, 2 - adds r1, r0 - ldr r2, [r1] - movs r0, 0x18 - ands r0, r2 - cmp r0, 0 - beq _080411B4 - adds r0, r2, 0 - subs r0, 0x8 - str r0, [r1] -_080411B4: - ldr r1, [r7] - b _080412E2 - .pool -_080411BC: - ldr r2, =0x020242bc - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r3, r0, r2 - ldrb r2, [r3, 0x12] - lsls r1, r2, 28 - cmp r1, 0 - beq _080411F6 - lsrs r1, 28 - subs r1, 0x1 - movs r0, 0xF - ands r1, r0 - movs r0, 0x10 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x12] - cmp r1, 0 - bne _080411F6 - ldr r0, =0x020242ac - ldrb r2, [r6] - lsls r2, 2 - adds r2, r0 - ldr r0, [r2] - ldr r1, =0xfffffdff - ands r0, r1 - str r0, [r2] -_080411F6: - ldr r1, [r7] - b _080412E2 - .pool -_08041208: - ldr r2, =0x020242bc - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r3, r0, r2 - ldrb r2, [r3, 0x13] - lsls r1, r2, 28 - cmp r1, 0 - beq _0804122E - lsrs r1, 28 - subs r1, 0x1 - movs r0, 0xF - ands r1, r0 - movs r0, 0x10 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x13] -_0804122E: - ldr r1, [r7] - b _080412E2 - .pool -_08041238: - ldr r4, =0x020242ac - ldrb r0, [r6] - lsls r0, 2 - adds r2, r0, r4 - ldr r1, [r2] - movs r3, 0xC0 - lsls r3, 5 - adds r0, r1, 0 - ands r0, r3 - cmp r0, 0 - beq _080412DE - ldr r5, =0xfffff800 - adds r0, r1, r5 - str r0, [r2] - ldrb r2, [r6] - lsls r0, r2, 2 - adds r0, r4 - ldr r0, [r0] - ands r0, r3 - cmp r0, 0 - bne _080412DE - ldr r3, =0x02024084 - movs r5, 0x58 - adds r1, r2, 0 - muls r1, r5 - adds r4, r3, 0 - adds r4, 0x4C - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _080412DE - adds r0, r1, r3 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x48 - beq _080412DE - cmp r0, 0xF - beq _080412DE - adds r0, r2, 0 - bl sub_8050650 - lsls r0, 24 - cmp r0, 0 - bne _080412DE - ldrb r0, [r6] - bl b_cancel_multi_turn_move_maybe - bl GenerateRandomNumber - ldrb r1, [r6] - adds r2, r1, 0 - muls r2, r5 - adds r2, r4 - movs r1, 0x3 - ands r1, r0 - adds r1, 0x2 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - ldrb r0, [r6] - muls r0, r5 - adds r0, r4 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r6] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x0202420e - ldrb r0, [r6] - strb r0, [r1] - ldr r0, =gUnknown_082DB378 -_080412D0: - bl b_call_bc_move_exec -_080412D4: - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_080412DE: - ldr r0, =0x0202449c - ldr r1, [r0] -_080412E2: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08041312 - .pool -_08041304: - ldr r1, [r7] - movs r0, 0 - strb r0, [r1] - ldr r1, [r7] - ldrb r0, [r1, 0x1] - adds r0, 0x1 - strb r0, [r1, 0x1] -_08041312: - mov r7, r9 - cmp r7, 0 - beq _0804131C -_08041318: - mov r0, r9 - b _08041344 -_0804131C: - ldr r5, =0x0202449c - ldr r2, [r5] - ldr r0, =0x0202406c - ldrb r1, [r2, 0x1] - adds r7, r5, 0 - mov r8, r0 - ldrb r0, [r0] - cmp r1, r0 - bcs _08041338 -_0804132E: - ldrb r0, [r2] - cmp r0, 0x13 - bhi _08041338 - bl _08040968 -_08041338: - ldr r0, =0x02024280 - ldr r1, [r0] - ldr r2, =0xfeffffdf - ands r1, r2 - str r1, [r0] - movs r0, 0 -_08041344: - 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_8040924 - - thumb_func_start sub_8041364 -sub_8041364: @ 8041364 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0x01000020 - orrs r0, r1 - str r0, [r2] - ldr r1, =0x0202449c - ldr r3, [r1] - movs r4, 0xD0 - lsls r4, 1 - adds r0, r3, r4 - ldrb r0, [r0] - mov r10, r2 - adds r6, r1, 0 - cmp r0, 0x1 - bne _0804138E - b _08041548 -_0804138E: - cmp r0, 0x1 - bgt _080413A4 - cmp r0, 0 - beq _080413AC - b _08041708 - .pool -_080413A4: - cmp r0, 0x2 - bne _080413AA - b _0804169A -_080413AA: - b _08041708 -_080413AC: - ldr r2, =0x000001a1 - adds r0, r3, r2 - ldr r1, =0x0202406c - ldrb r0, [r0] - mov r8, r1 - ldrb r7, [r1] - cmp r0, r7 - bcc _080413BE - b _08041532 -_080413BE: - ldr r4, =0x02024064 - ldr r5, =0x02022f58 - ldr r7, =0x020243d0 - movs r0, 0x18 - adds r0, r7 - mov r12, r0 -_080413CA: - ldr r0, [r6] - adds r3, r0, r2 - ldrb r0, [r3] - strb r0, [r4] - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _0804140C - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - b _08041520 - .pool -_0804140C: - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - ldr r1, =0x020243d0 - ldrb r0, [r4] - adds r2, r0, r1 - ldrb r0, [r2] - mov r9, r1 - cmp r0, 0 - bne _08041422 - b _08041520 -_08041422: - subs r0, 0x1 - strb r0, [r2] - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - bne _08041520 - ldr r1, =0x02024084 - ldrb r2, [r4] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08041520 - lsls r0, r2, 1 - add r0, r12 - ldrh r0, [r0] - cmp r0, 0xF8 - bne _0804145C - ldr r0, =0x02024332 - strb r3, [r0, 0x5] - b _08041462 - .pool -_0804145C: - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] -_08041462: - movs r0, 0xFD - strb r0, [r5] - movs r6, 0x2 - movs r0, 0x2 - strb r0, [r5, 0x1] - ldrb r0, [r4] - lsls r0, 1 - add r0, r12 - ldrh r0, [r0] - strb r0, [r5, 0x2] - ldrb r0, [r4] - lsls r0, 1 - add r0, r12 - ldrh r0, [r0] - lsrs r0, 8 - strb r0, [r5, 0x3] - movs r0, 0xFF - strb r0, [r5, 0x4] - ldr r5, =0x0202420c - ldrb r0, [r4] - strb r0, [r5] - ldr r1, =0x0202420b - adds r0, r7, 0x4 - ldrb r2, [r4] - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - ldr r2, =0x020241f0 - ldrb r0, [r4] - lsls r0, 2 - adds r1, r7, 0 - adds r1, 0x8 - adds r0, r1 - ldr r0, [r0] - str r0, [r2] - ldr r2, =0x0202437c - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x4 - adds r0, r2 - ldr r1, =0x0000ffff - str r1, [r0] - ldr r0, =gUnknown_082DAFE4 - bl b_call_bc_move_exec - ldrb r1, [r4] - adds r0, r1, r7 - ldrb r0, [r0] - cmp r0, 0 - beq _080414CC - b _08041664 -_080414CC: - eors r1, r6 - mov r3, r9 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, 0 - beq _080414DA - b _08041664 -_080414DA: - ldrb r0, [r5] - bl battle_get_per_side_status - ldr r2, =0x0202428e - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - ands r0, r1 - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - ldr r4, =0x0000ffbf - adds r2, r4, 0 - ands r1, r2 - strh r1, [r0] - b _08041664 - .pool -_08041520: - ldr r0, [r6] - ldr r2, =0x000001a1 - adds r0, r2 - ldrb r0, [r0] - mov r1, r8 - ldrb r1, [r1] - cmp r0, r1 - bcs _08041532 - b _080413CA -_08041532: - ldr r0, [r6] - movs r2, 0xD0 - lsls r2, 1 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r6] - ldr r3, =0x000001a1 - adds r1, r0, r3 - movs r0, 0 - strb r0, [r1] -_08041548: - adds r3, r6, 0 - ldr r0, [r6] - ldr r2, =0x000001a1 - adds r0, r2 - ldr r1, =0x0202406c - ldrb r0, [r0] - mov r8, r1 - ldrb r4, [r1] - cmp r0, r4 - bcc _0804155E - b _08041684 -_0804155E: - ldr r5, =0x02024064 - ldr r4, =0x02022f58 - ldr r7, =0x020242bc - mov r12, r7 - ldr r0, =0x0202420b - mov r9, r0 -_0804156A: - ldr r1, =0x0202407e - ldr r0, [r3] - adds r3, r0, r2 - ldrb r0, [r3] - adds r0, r1 - ldrb r0, [r0] - mov r1, r9 - strb r0, [r1] - strb r0, [r5] - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _080415BC - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - b _08041670 - .pool -_080415BC: - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - ldr r7, =0x020242ac - ldrb r0, [r5] - lsls r0, 2 - adds r0, r7 - ldr r0, [r0] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08041670 - movs r0, 0xFD - strb r0, [r4] - movs r0, 0x1 - strb r0, [r4, 0x1] - strb r0, [r4, 0x2] - strb r0, [r4, 0x3] - ldrb r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - ldrb r0, [r0, 0xF] - lsls r0, 28 - lsrs r0, 28 - strb r0, [r4, 0x4] - movs r0, 0xFF - strb r0, [r4, 0x5] - ldrb r2, [r5] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - mov r3, r12 - adds r4, r0, r3 - ldrb r3, [r4, 0xF] - lsls r1, r3, 28 - cmp r1, 0 - bne _08041644 - lsls r2, 2 - adds r2, r7 - ldr r0, [r2] - movs r1, 0x21 - negs r1, r1 - ands r0, r1 - str r0, [r2] - ldr r3, =0x020241f0 - ldr r2, =0x02024084 - ldrb r1, [r5] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x28] - str r0, [r3] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAF05 - b _0804165C - .pool -_08041644: - lsrs r1, 28 - subs r1, 0x1 - movs r0, 0xF - ands r1, r0 - movs r7, 0x10 - negs r7, r7 - adds r0, r7, 0 - ands r0, r3 - orrs r0, r1 - strb r0, [r4, 0xF] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAF20 -_0804165C: - str r0, [r1] - ldr r0, [r1] - bl b_call_bc_move_exec -_08041664: - movs r0, 0x1 - b _08041714 - .pool -_08041670: - adds r3, r6, 0 - ldr r0, [r6] - ldr r2, =0x000001a1 - adds r0, r2 - ldrb r0, [r0] - mov r1, r8 - ldrb r1, [r1] - cmp r0, r1 - bcs _08041684 - b _0804156A -_08041684: - ldr r0, [r6] - movs r2, 0xD0 - lsls r2, 1 - adds r0, r2 - movs r1, 0x2 - strb r1, [r0] - ldr r0, [r6] - ldr r3, =0x000001a1 - adds r1, r0, r3 - movs r0, 0 - strb r0, [r1] -_0804169A: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _08041708 - ldr r0, [r6] - adds r0, 0xDA - ldrb r0, [r0] - cmp r0, 0x2 - bne _08041708 - ldr r1, =0x02024084 - ldrh r0, [r1, 0x28] - cmp r0, 0 - beq _08041708 - adds r0, r1, 0 - adds r0, 0x80 - ldrh r0, [r0] - cmp r0, 0 - beq _08041708 - movs r4, 0 -_080416C6: - lsls r0, r4, 24 - lsrs r0, 24 - bl b_cancel_multi_turn_move_maybe - adds r4, 0x1 - cmp r4, 0x1 - ble _080416C6 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB8F3 - str r0, [r1] - bl b_call_bc_move_exec - ldr r0, =0x0202449c - ldr r1, [r0] - movs r4, 0xD0 - lsls r4, 1 - adds r1, r4 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08041664 - .pool -_08041708: - mov r7, r10 - ldr r0, [r7] - ldr r1, =0xfeffffdf - ands r0, r1 - str r0, [r7] - movs r0, 0 -_08041714: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8041364 - - thumb_func_start sub_8041728 -sub_8041728: @ 8041728 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08041770 - b _08041A0A - .pool -_08041744: - ldr r0, =gUnknown_082DA7C4 - bl b_call_bc_move_exec - ldr r0, [r5] - adds r0, 0x4D - movs r1, 0x2 - b _08041764 - .pool -_08041758: - ldr r0, =gUnknown_082DA7CD - bl b_call_bc_move_exec - ldr r0, [r5] - adds r0, 0x4D - movs r1, 0x5 -_08041764: - strb r1, [r0] -_08041766: - movs r0, 0x1 - b _08041A0C - .pool -_08041770: - ldr r0, =0x0202449c - mov r8, r0 -_08041774: - mov r1, r8 - ldr r0, [r1] - adds r0, 0x4D - ldrb r0, [r0] - cmp r0, 0x7 - bls _08041782 - b _080419FC -_08041782: - lsls r0, 2 - ldr r1, =_08041794 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08041794: - .4byte _080417B4 - .4byte _08041806 - .4byte _080418A0 - .4byte _080418E2 - .4byte _080418F6 - .4byte _08041960 - .4byte _08041994 - .4byte _080419FC -_080417B4: - mov r4, r8 - ldr r0, [r4] - adds r0, 0x4E - movs r1, 0 - strb r1, [r0] - ldr r1, [r4] - adds r1, 0x4D - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r5, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - bge _08041806 - ldr r6, =0x02024210 -_080417D4: - ldrb r0, [r6] - ldr r2, =gUnknown_0832A328 - lsls r1, r5, 2 - adds r1, r2 - ldr r4, [r1] - ands r0, r4 - cmp r0, 0 - beq _080417FC - lsls r0, r5, 24 - lsrs r0, 24 - movs r1, 0x6 - movs r2, 0x6 - bl sub_80423F4 - lsls r0, 24 - cmp r0, 0 - bne _080417FC - ldrb r0, [r6] - bics r0, r4 - strb r0, [r6] -_080417FC: - adds r5, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - blt _080417D4 -_08041806: - ldr r0, =0x0202449c - mov r8, r0 - ldr r1, =0x0202420d - mov r12, r1 - ldr r2, =0x0202420c - mov r5, r8 - ldr r7, =0x02024084 - ldr r6, =0x0202406e -_08041816: - ldr r3, [r5] - adds r1, r3, 0 - adds r1, 0x4E - ldrb r0, [r1] - strb r0, [r2] - mov r4, r12 - strb r0, [r4] - ldrb r4, [r1] - movs r0, 0x58 - muls r0, r4 - adds r0, r7 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _0804185E - adds r0, r3, 0 - adds r0, 0xDF - ldrb r1, [r0] - ldr r3, =gUnknown_0832A328 - lsls r0, r4, 1 - adds r0, r6 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0804185E - ldr r0, =0x02024210 - ldrb r1, [r0] - lsls r0, r4, 2 - adds r0, r3 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0804185E - b _08041744 -_0804185E: - ldr r0, [r5] - adds r0, 0x4E - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - ldr r0, =0x0202406c - lsls r1, 24 - lsrs r1, 24 - ldrb r0, [r0] - cmp r1, r0 - bne _08041816 - mov r1, r8 - ldr r0, [r1] - adds r0, 0x4D - movs r1, 0x3 - strb r1, [r0] - b _080419FC - .pool -_080418A0: - ldr r0, =0x0202420d - ldrb r0, [r0] - bl sub_803F9EC - ldr r2, =0x0202449c - ldr r1, [r2] - adds r1, 0x4E - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bne _080418D8 - ldr r0, [r2] - adds r0, 0x4D - movs r1, 0x3 - strb r1, [r0] - b _080419FA - .pool -_080418D8: - ldr r0, [r2] - adds r0, 0x4D - movs r1, 0x1 - strb r1, [r0] - b _080419FA -_080418E2: - mov r4, r8 - ldr r0, [r4] - adds r0, 0x4E - movs r1, 0 - strb r1, [r0] - ldr r1, [r4] - adds r1, 0x4D - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080418F6: - ldr r0, =0x0202420d - mov r12, r0 - ldr r7, =0x0202420c - ldr r5, =0x0202449c - ldr r2, =0x02024084 - ldr r6, =gUnknown_0832A328 -_08041902: - ldr r0, [r5] - adds r4, r0, 0 - adds r4, 0x4E - ldrb r0, [r4] - strb r0, [r7] - mov r1, r12 - strb r0, [r1] - ldrb r3, [r4] - movs r0, 0x58 - muls r0, r3 - adds r0, r2 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08041930 - ldr r0, =0x02024210 - ldrb r1, [r0] - lsls r0, r3, 2 - adds r0, r6 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08041930 - b _08041758 -_08041930: - adds r0, r3, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bne _08041902 - b _08041978 - .pool -_08041960: - mov r1, r8 - ldr r0, [r1] - adds r0, 0x4E - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - ldr r0, =0x0202406c - lsls r1, 24 - lsrs r1, 24 - ldrb r0, [r0] - cmp r1, r0 - bne _08041988 -_08041978: - mov r4, r8 - ldr r0, [r4] - adds r0, 0x4D - movs r1, 0x6 - strb r1, [r0] - b _080419FC - .pool -_08041988: - mov r1, r8 - ldr r0, [r1] - adds r0, 0x4D - movs r1, 0x4 - strb r1, [r0] - b _080419FC -_08041994: - movs r0, 0 - str r0, [sp] - movs r0, 0x9 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _080419AE - b _08041766 -_080419AE: - str r0, [sp] - movs r0, 0xB - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _080419C4 - b _08041766 -_080419C4: - movs r0, 0x1 - movs r1, 0 - movs r2, 0x1 - bl berry_effects_maybe - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _080419D8 - b _08041766 -_080419D8: - str r0, [sp] - movs r0, 0x6 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _080419EE - b _08041766 -_080419EE: - ldr r2, =0x0202449c - ldr r1, [r2] - adds r1, 0x4D - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080419FA: - mov r8, r2 -_080419FC: - mov r4, r8 - ldr r0, [r4] - adds r0, 0x4D - ldrb r0, [r0] - cmp r0, 0x7 - beq _08041A0A - b _08041774 -_08041A0A: - movs r0, 0 -_08041A0C: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8041728 - - thumb_func_start b_clear_atk_up_if_hit_flag_unless_enraged -b_clear_atk_up_if_hit_flag_unless_enraged: @ 8041A1C - push {r4-r6,lr} - movs r3, 0 - ldr r0, =0x0202406c - adds r5, r0, 0 - ldrb r0, [r5] - cmp r3, r0 - bge _08041A54 - ldr r4, =0x02024274 - movs r6, 0x80 - lsls r6, 16 - ldr r2, =0x020240d4 -_08041A32: - ldr r1, [r2] - adds r0, r1, 0 - ands r0, r6 - cmp r0, 0 - beq _08041A48 - ldrh r0, [r4] - cmp r0, 0x63 - beq _08041A48 - ldr r0, =0xff7fffff - ands r1, r0 - str r1, [r2] -_08041A48: - adds r4, 0x2 - adds r2, 0x58 - adds r3, 0x1 - ldrb r0, [r5] - cmp r3, r0 - blt _08041A32 -_08041A54: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end b_clear_atk_up_if_hit_flag_unless_enraged - - thumb_func_start sub_8041A6C -sub_8041A6C: @ 8041A6C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - movs r0, 0 - mov r9, r0 - ldr r1, =0x02024478 - mov r10, r1 - ldr r2, =0x0202449c - mov r8, r2 - b _08041A9A - .pool -_08041A90: - mov r3, r9 - cmp r3, 0 - beq _08041A9A - bl _08042388 -_08041A9A: - mov r4, r8 - ldr r0, [r4] - ldr r7, =0x000001a3 - adds r0, r7 - ldrb r0, [r0] - cmp r0, 0xE - bls _08041AAC - bl _08042376 -_08041AAC: - lsls r0, 2 - ldr r1, =_08041AC0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08041AC0: - .4byte _08041AFC - .4byte _08041B48 - .4byte _08041C90 - .4byte _08041D50 - .4byte _08041DC4 - .4byte _08041E40 - .4byte _08041EB8 - .4byte _08041F38 - .4byte _08041FC0 - .4byte _08042028 - .4byte _08042114 - .4byte _08042194 - .4byte _08042234 - .4byte _0804231C - .4byte _08042376 -_08041AFC: - ldr r1, =0x02024084 - ldr r3, =0x0202420b - ldrb r2, [r3] - movs r0, 0x58 - muls r2, r0 - adds r1, 0x50 - adds r2, r1 - ldr r0, [r2] - ldr r1, =0xfdffffff - ands r0, r1 - str r0, [r2] - ldr r0, =0x020242ac - ldrb r2, [r3] - lsls r2, 2 - adds r2, r0 - ldr r0, [r2] - ldr r1, =0xffffbfff - ands r0, r1 - str r0, [r2] - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x000001a3 - adds r1, r0, r2 - bl _08042370 - .pool -_08041B48: - ldr r7, =0x02024084 - ldr r4, =0x0202420b - ldrb r1, [r4] - movs r5, 0x58 - adds r0, r1, 0 - muls r0, r5 - adds r6, r7, 0 - adds r6, 0x4C - adds r0, r6 - ldr r0, [r0] - movs r3, 0x7 - mov r8, r3 - ands r0, r3 - cmp r0, 0 - bne _08041B68 - b _08041C6E -_08041B68: - adds r0, r1, 0 - bl sub_8050650 - lsls r0, 24 - cmp r0, 0 - beq _08041BC8 - ldrb r0, [r4] - adds r2, r0, 0 - muls r2, r5 - adds r2, r6 - ldr r0, [r2] - movs r1, 0x8 - negs r1, r1 - ands r0, r1 - str r0, [r2] - ldrb r0, [r4] - adds r2, r0, 0 - muls r2, r5 - adds r0, r7, 0 - adds r0, 0x50 - adds r2, r0 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB220 - str r0, [r1] - movs r4, 0x2 - mov r9, r4 - b _08041C6E - .pool -_08041BC8: - ldrb r0, [r4] - adds r1, r0, 0 - muls r1, r5 - adds r0, r1, r7 - adds r0, 0x20 - ldrb r0, [r0] - movs r3, 0x1 - cmp r0, 0x30 - bne _08041BDC - movs r3, 0x2 -_08041BDC: - adds r2, r1, r6 - ldr r1, [r2] - adds r0, r1, 0 - mov r7, r8 - ands r0, r7 - cmp r0, r3 - bcs _08041BF4 - movs r0, 0x8 - negs r0, r0 - ands r1, r0 - str r1, [r2] - b _08041BF8 -_08041BF4: - subs r0, r1, r3 - str r0, [r2] -_08041BF8: - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r1, r0 - adds r0, r2, 0 - adds r0, 0x4C - adds r0, r1, r0 - ldr r4, [r0] - movs r0, 0x7 - ands r4, r0 - cmp r4, 0 - beq _08041C50 - ldr r0, =0x020241ea - ldrh r0, [r0] - cmp r0, 0xAD - beq _08041C6E - cmp r0, 0xD6 - beq _08041C6E - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB213 - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 12 - orrs r0, r1 - str r0, [r2] - movs r0, 0x2 - mov r9, r0 - b _08041C6E - .pool -_08041C50: - adds r2, 0x50 - adds r2, r1, r2 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] - bl b_movescr_stack_push_cursor - ldr r0, =0x02024332 - strb r4, [r0, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB220 - str r0, [r1] - movs r1, 0x2 - mov r9, r1 -_08041C6E: - ldr r1, =0x0202449c - ldr r0, [r1] - ldr r3, =0x000001a3 - adds r2, r0, r3 - b _0804216A - .pool -_08041C90: - ldr r1, =0x02024084 - ldr r7, =0x0202420b - ldrb r0, [r7] - movs r6, 0x58 - muls r0, r6 - adds r5, r1, 0 - adds r5, 0x4C - adds r0, r5 - ldr r0, [r0] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08041D30 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x5 - bl __umodsi3 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _08041D08 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x7D - bne _08041CD6 - b _08042162 -_08041CD6: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB26A - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 2 - orrs r0, r1 - str r0, [r2] - b _08041D28 - .pool -_08041D08: - ldrb r0, [r7] - adds r2, r0, 0 - muls r2, r6 - adds r2, r5 - ldr r0, [r2] - movs r1, 0x21 - negs r1, r1 - ands r0, r1 - str r0, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB277 - str r0, [r1] - ldr r0, =0x02024332 - strb r4, [r0, 0x5] -_08041D28: - movs r7, 0x2 - mov r9, r7 - ldr r0, =0x0202449c - mov r8, r0 -_08041D30: - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x000001a3 - adds r1, r0, r2 - b _08042370 - .pool -_08041D50: - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x36 - beq _08041D66 - b _08042162 -_08041D66: - ldr r0, =0x020242bc - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x18] - lsls r0, 31 - cmp r0, 0 - bne _08041D7A - b _08042162 -_08041D7A: - adds r0, r2, 0 - bl b_cancel_multi_turn_move_maybe - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 12 - orrs r0, r1 - str r0, [r2] - ldr r1, =0x02024332 - movs r0, 0 - strb r0, [r1, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB6AD - str r0, [r1] - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - b _0804215E - .pool -_08041DC4: - ldr r1, =0x02024084 - ldr r3, =0x0202420b - ldrb r2, [r3] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0x80 - lsls r0, 15 - ands r0, r1 - cmp r0, 0 - beq _08041E10 - ldr r0, =0xffbfffff - ands r1, r0 - str r1, [r2] - ldr r2, =0x020242bc - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strb r1, [r0, 0x19] - ldrb r0, [r3] - bl b_cancel_multi_turn_move_maybe - ldr r1, =0x02024214 - ldr r0, =gUnknown_082D9462 - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 12 - orrs r0, r1 - str r0, [r2] - movs r7, 0x1 - mov r9, r7 -_08041E10: - ldr r1, =0x0202449c - ldr r0, [r1] - ldr r3, =0x000001a3 - adds r2, r0, r3 - b _0804216A - .pool -_08041E40: - ldr r1, =0x02024084 - ldr r3, =0x0202420b - ldrb r2, [r3] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _08041E8C - movs r0, 0x9 - negs r0, r0 - ands r1, r0 - str r1, [r2] - ldr r0, =0x0202433c - ldrb r2, [r3] - lsls r2, 4 - adds r2, r0 - ldrb r0, [r2, 0x2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0x2] - ldrb r0, [r3] - bl b_cancel_multi_turn_move_maybe - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB29B - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 12 - orrs r0, r1 - str r0, [r2] - movs r4, 0x1 - mov r9, r4 -_08041E8C: - ldr r1, =0x0202449c - ldr r0, [r1] - ldr r7, =0x000001a3 - adds r2, r0, r7 - b _0804216A - .pool -_08041EB8: - ldr r0, =0x020242bc - ldr r3, =0x0202420b - ldrb r2, [r3] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldr r0, =0x020241ea - ldrh r1, [r1, 0x4] - ldrh r0, [r0] - cmp r1, r0 - bne _08041F04 - cmp r1, 0 - beq _08041F04 - ldr r0, =0x0202433c - lsls r2, 4 - adds r2, r0 - ldrb r0, [r2, 0x1] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x1] - ldr r1, =0x02024474 - ldrb r0, [r3] - strb r0, [r1, 0x17] - ldrb r0, [r3] - bl b_cancel_multi_turn_move_maybe - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAE14 - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 12 - orrs r0, r1 - str r0, [r2] - movs r0, 0x1 - mov r9, r0 -_08041F04: - ldr r1, =0x0202449c - ldr r0, [r1] - ldr r3, =0x000001a3 - adds r2, r0, r3 - b _0804216A - .pool -_08041F38: - ldr r0, =0x020242bc - ldr r4, =0x0202420b - ldrb r3, [r4] - lsls r1, r3, 3 - subs r1, r3 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x13] - lsls r0, 28 - cmp r0, 0 - beq _08041F8C - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _08041F8C - ldr r0, =0x0202433c - lsls r2, r3, 4 - adds r2, r0 - ldrb r0, [r2, 0x2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x2] - ldrb r0, [r4] - bl b_cancel_multi_turn_move_maybe - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB0A4 - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 12 - orrs r0, r1 - str r0, [r2] - movs r4, 0x1 - mov r9, r4 -_08041F8C: - ldr r1, =0x0202449c - ldr r0, [r1] - ldr r7, =0x000001a3 - adds r2, r0, r7 - b _0804216A - .pool -_08041FC0: - ldr r4, =0x0202420b - ldrb r0, [r4] - ldr r1, =0x020241ea - ldrh r1, [r1] - bl sub_8040130 - lsls r0, 24 - cmp r0, 0 - beq _08041FFE - ldr r0, =0x0202433c - ldrb r2, [r4] - lsls r2, 4 - adds r2, r0 - ldrb r0, [r2, 0x1] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r2, 0x1] - ldrb r0, [r4] - bl b_cancel_multi_turn_move_maybe - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB176 - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 12 - orrs r0, r1 - str r0, [r2] - movs r0, 0x1 - mov r9, r0 -_08041FFE: - ldr r1, =0x0202449c - ldr r0, [r1] - ldr r3, =0x000001a3 - adds r2, r0, r3 - b _0804216A - .pool -_08042028: - ldr r7, =0x02024084 - ldr r5, =0x0202420b - ldrb r0, [r5] - movs r6, 0x58 - muls r0, r6 - adds r4, r7, 0 - adds r4, 0x50 - adds r2, r0, r4 - ldr r1, [r2] - movs r3, 0x7 - adds r0, r1, 0 - ands r0, r3 - cmp r0, 0 - beq _080420FA - subs r0, r1, 0x1 - str r0, [r2] - ldrb r0, [r5] - muls r0, r6 - adds r0, r4 - ldr r0, [r0] - ands r0, r3 - cmp r0, 0 - beq _080420E8 - bl GenerateRandomNumber - movs r1, 0x1 - movs r2, 0x1 - ands r2, r0 - cmp r2, 0 - beq _0804207C - ldr r1, =0x02024332 - movs r0, 0 - strb r0, [r1, 0x5] - bl b_movescr_stack_push_cursor - b _080420C6 - .pool -_0804207C: - ldr r0, =0x02024332 - movs r4, 0x1 - strb r1, [r0, 0x5] - ldr r1, =0x0202420c - ldrb r0, [r5] - strb r0, [r1] - ldrb r0, [r5] - adds r1, r0, 0 - muls r1, r6 - adds r1, r7 - movs r0, 0x28 - str r0, [sp] - str r2, [sp, 0x4] - ldrb r0, [r5] - str r0, [sp, 0x8] - ldrb r0, [r5] - str r0, [sp, 0xC] - adds r0, r1, 0 - movs r2, 0x1 - movs r3, 0 - bl sub_806957C - ldr r1, =0x020241f0 - str r0, [r1] - ldr r0, =0x0202433c - ldrb r1, [r5] - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1, 0x1] - orrs r0, r4 - strb r0, [r1, 0x1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 12 - orrs r0, r1 - str r0, [r2] -_080420C6: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB2BD - b _080420F0 - .pool -_080420E8: - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB300 -_080420F0: - str r0, [r1] - movs r4, 0x1 - mov r9, r4 - ldr r7, =0x0202449c - mov r8, r7 -_080420FA: - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x000001a3 - adds r1, r0, r2 - b _08042370 - .pool -_08042114: - ldr r1, =0x02024084 - ldr r4, =0x0202420b - ldrb r2, [r4] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08042162 - bl GenerateRandomNumber - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - cmp r1, 0 - bne _08042162 - ldr r0, =0x0202433c - ldrb r2, [r4] - lsls r2, 4 - adds r2, r0 - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB28B - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 12 - orrs r0, r1 - str r0, [r2] -_0804215E: - movs r3, 0x1 - mov r9, r3 -_08042162: - ldr r1, =0x0202449c - ldr r0, [r1] - ldr r4, =0x000001a3 - adds r2, r0, r4 -_0804216A: - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - mov r8, r1 - b _08042376 - .pool -_08042194: - ldr r1, =0x02024084 - ldr r4, =0x0202420b - ldrb r2, [r4] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r1, [r0] - movs r0, 0xF0 - lsls r0, 12 - ands r1, r0 - cmp r1, 0 - beq _0804220E - lsrs r0, r1, 16 - bl sub_806F8A8 - ldr r1, =0x02024474 - strb r0, [r1, 0x17] - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _080421D8 - bl b_movescr_stack_push_cursor - b _08042200 - .pool -_080421D8: - ldr r0, =gUnknown_082DB334 - bl b_movescr_stack_push - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 12 - orrs r0, r1 - str r0, [r2] - ldr r0, =0x0202433c - ldrb r2, [r4] - lsls r2, 4 - adds r2, r0 - ldrb r0, [r2, 0x1] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2, 0x1] - ldrb r0, [r4] - bl b_cancel_multi_turn_move_maybe -_08042200: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB327 - str r0, [r1] - movs r7, 0x1 - mov r9, r7 - ldr r0, =0x0202449c - mov r8, r0 -_0804220E: - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x000001a3 - adds r1, r0, r2 - b _08042370 - .pool -_08042234: - ldr r1, =0x02024084 - ldr r6, =0x0202420b - ldrb r0, [r6] - movs r5, 0x58 - muls r0, r5 - adds r1, 0x50 - adds r3, r0, r1 - ldr r2, [r3] - movs r4, 0xC0 - lsls r4, 2 - adds r0, r2, 0 - ands r0, r4 - cmp r0, 0 - beq _08042306 - ldr r7, =0xffffff00 - adds r0, r2, r7 - str r0, [r3] - ldrb r2, [r6] - adds r0, r2, 0 - muls r0, r5 - adds r0, r1 - ldr r0, [r0] - ands r0, r4 - cmp r0, 0 - beq _08042280 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAD71 - b _08042300 - .pool -_08042280: - ldr r3, =0x020241f8 - lsls r0, r2, 2 - adds r0, r3 - ldr r0, [r0] - cmp r0, 0 - beq _080422FC - ldr r1, =0x020241ea - movs r0, 0x75 - strh r0, [r1] - ldrb r0, [r6] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - lsls r0, 1 - mov r1, r10 - str r0, [r1] - ldr r4, =0x0202420c - ldr r1, =0x02024288 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r4] - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _080422CA - movs r0, 0x75 - movs r1, 0x1 - bl sub_80458E0 - strb r0, [r4] -_080422CA: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAD7C - str r0, [r1] - ldr r2, =0x0202449c - mov r8, r2 - b _08042302 - .pool -_080422FC: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DADC4 -_08042300: - str r0, [r1] -_08042302: - movs r3, 0x1 - mov r9, r3 -_08042306: - mov r4, r8 - ldr r0, [r4] - ldr r7, =0x000001a3 - adds r1, r0, r7 - b _08042370 - .pool -_0804231C: - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x4C - adds r4, r0, r1 - ldr r3, [r4] - movs r0, 0x20 - ands r0, r3 - cmp r0, 0 - beq _08042368 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x7D - bne _08042360 - movs r0, 0x21 - negs r0, r0 - ands r3, r0 - str r3, [r4] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB277 - str r0, [r1] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] -_08042360: - movs r0, 0x2 - mov r9, r0 - ldr r1, =0x0202449c - mov r8, r1 -_08042368: - mov r2, r8 - ldr r0, [r2] - ldr r3, =0x000001a3 - adds r1, r0, r3 -_08042370: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_08042376: - mov r4, r8 - ldr r0, [r4] - ldr r7, =0x000001a3 - adds r0, r7 - ldrb r0, [r0] - cmp r0, 0xE - beq _08042388 - bl _08041A90 -_08042388: - mov r0, r9 - cmp r0, 0x2 - bne _080423B4 - ldr r4, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r4] - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - ldr r1, =0x020240d0 - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_080423B4: - mov r0, r9 - 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_8041A6C - - thumb_func_start sub_80423F4 -sub_80423F4: @ 80423F4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08042424 - movs r0, 0 - b _080426A0 - .pool -_08042424: - movs r0, 0x80 - lsls r0, 15 - ands r0, r1 - cmp r0, 0 - beq _0804249C - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x02024744 - mov r8, r1 - cmp r0, 0 - bne _08042442 - ldr r2, =0x020244ec - mov r8, r2 -_08042442: - movs r0, 0x2 - ands r0, r4 - lsls r0, 24 - lsrs r6, r0, 25 - lsls r0, r6, 1 - adds r4, r0, r6 - adds r0, r4, 0x3 - cmp r4, r0 - bge _0804248C - adds r7, r0, 0 -_08042456: - movs r0, 0x64 - muls r0, r4 - mov r1, r8 - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08042486 - adds r0, r5, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _08042486 - adds r0, r5, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _0804248C -_08042486: - adds r4, 0x1 - cmp r4, r7 - blt _08042456 -_0804248C: - movs r1, 0 - lsls r0, r6, 1 - adds r0, r6 - b _08042556 - .pool -_0804249C: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0804256C - movs r0, 0x80 - lsls r0, 16 - ands r1, r0 - cmp r1, 0 - beq _080424E4 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080424D0 - ldr r2, =0x020244ec - mov r8, r2 - adds r0, r4, 0 - bl sub_806D864 - lsls r0, 24 - lsrs r7, r0, 24 - b _08042502 - .pool -_080424D0: - ldr r0, =0x02024744 - mov r8, r0 - movs r1, 0x1 - eors r1, r4 - negs r0, r1 - orrs r0, r1 - lsrs r6, r0, 31 - b _0804250C - .pool -_080424E4: - adds r0, r4, 0 - bl sub_806D864 - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x02024744 - mov r8, r1 - cmp r0, 0 - bne _08042502 - ldr r2, =0x020244ec - mov r8, r2 -_08042502: - adds r0, r7, 0 - bl sub_806D82C - lsls r0, 24 - lsrs r6, r0, 24 -_0804250C: - lsls r0, r6, 1 - adds r4, r0, r6 - adds r1, r4, 0x3 - mov r9, r0 - cmp r4, r1 - bge _08042550 - adds r7, r1, 0 -_0804251A: - movs r0, 0x64 - muls r0, r4 - mov r1, r8 - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _0804254A - adds r0, r5, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _0804254A - adds r0, r5, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _08042550 -_0804254A: - adds r4, 0x1 - cmp r4, r7 - blt _0804251A -_08042550: - movs r1, 0 - mov r2, r9 - adds r0, r2, r6 -_08042556: - adds r0, 0x3 - cmp r4, r0 - bne _0804255E - movs r1, 0x1 -_0804255E: - adds r0, r1, 0 - b _080426A0 - .pool -_0804256C: - movs r0, 0x80 - lsls r0, 8 - ands r1, r0 - cmp r1, 0 - beq _080425DA - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080425DA - ldr r0, =0x02024744 - mov r8, r0 - movs r6, 0x3 - cmp r4, 0x1 - bne _08042590 - movs r6, 0 -_08042590: - adds r4, r6, 0 - adds r6, r4, 0x3 - b _0804259E - .pool -_0804259C: - adds r4, 0x1 -_0804259E: - cmp r4, r6 - bge _080425D2 - movs r0, 0x64 - muls r0, r4 - mov r1, r8 - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _0804259C - adds r0, r5, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _0804259C - adds r0, r5, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _0804259C -_080425D2: - movs r0, 0 - cmp r4, r6 - bne _080426A0 - b _0804269E -_080425DA: - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08042608 - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0x3 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, =0x02024744 - mov r8, r2 - b _08042620 - .pool -_08042608: - movs r0, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0x2 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x020244ec - mov r8, r0 -_08042620: - mov r1, r10 - cmp r1, 0x6 - bne _08042630 - ldr r1, =0x0202406e - lsls r0, r7, 1 - adds r0, r1 - ldrb r0, [r0] - mov r10, r0 -_08042630: - mov r2, r9 - cmp r2, 0x6 - bne _08042640 - ldr r1, =0x0202406e - lsls r0, r6, 1 - adds r0, r1 - ldrb r0, [r0] - mov r9, r0 -_08042640: - movs r4, 0 -_08042642: - movs r0, 0x64 - muls r0, r4 - mov r1, r8 - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08042692 - adds r0, r5, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _08042692 - adds r0, r5, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _08042692 - cmp r4, r10 - beq _08042692 - cmp r4, r9 - beq _08042692 - ldr r0, =0x0202449c - ldr r1, [r0] - adds r0, r7, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r4, r0 - beq _08042692 - adds r0, r6, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r4, r0 - bne _08042698 -_08042692: - adds r4, 0x1 - cmp r4, 0x5 - ble _08042642 -_08042698: - movs r0, 0 - cmp r4, 0x6 - bne _080426A0 -_0804269E: - movs r0, 0x1 -_080426A0: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80423F4 - - thumb_func_start castform_switch -castform_switch: @ 80426BC - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r6 - adds r4, r0, r1 - ldrh r1, [r4] - ldr r0, =0x00000181 - cmp r1, r0 - bne _08042760 - adds r0, r4, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x3B - bne _08042760 - ldrh r0, [r4, 0x28] - cmp r0, 0 - beq _08042760 - str r5, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _0804270E - str r5, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _08042734 -_0804270E: - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0 - beq _08042734 - adds r1, r4, 0 - adds r1, 0x22 - ldrb r0, [r1] - cmp r0, 0 - beq _08042734 - strb r5, [r2] - strb r5, [r1] - movs r0, 0x1 - b _08042818 - .pool -_08042734: - movs r0, 0 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08042760 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _08042764 -_08042760: - movs r0, 0 - b _08042818 -_08042764: - ldr r1, =0x020243cc - ldrh r0, [r1] - movs r2, 0xE7 - ands r2, r0 - adds r4, r1, 0 - cmp r2, 0 - bne _08042792 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r6 - adds r1, r0, r1 - adds r3, r1, 0 - adds r3, 0x21 - ldrb r0, [r3] - cmp r0, 0 - beq _08042792 - adds r1, 0x22 - ldrb r0, [r1] - cmp r0, 0 - beq _08042792 - strb r2, [r3] - strb r2, [r1] - movs r5, 0x1 -_08042792: - ldrh r1, [r4] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _080427BE - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r6 - adds r1, r0, r1 - adds r2, r1, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0xA - beq _080427BE - adds r1, 0x22 - ldrb r0, [r1] - cmp r0, 0xA - beq _080427BE - movs r0, 0xA - strb r0, [r2] - strb r0, [r1] - movs r5, 0x2 -_080427BE: - ldrh r1, [r4] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - beq _080427EA - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r6 - adds r1, r0, r1 - adds r2, r1, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0xB - beq _080427EA - adds r1, 0x22 - ldrb r0, [r1] - cmp r0, 0xB - beq _080427EA - movs r0, 0xB - strb r0, [r2] - strb r0, [r1] - movs r5, 0x3 -_080427EA: - ldrh r1, [r4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08042816 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r6 - adds r1, r0, r1 - adds r2, r1, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0xF - beq _08042816 - adds r1, 0x22 - ldrb r0, [r1] - cmp r0, 0xF - beq _08042816 - movs r0, 0xF - strb r0, [r2] - strb r0, [r1] - movs r5, 0x4 -_08042816: - adds r0, r5, 0 -_08042818: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end castform_switch - - thumb_func_start ability_something -ability_something: @ 8042828 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - ldr r4, [sp, 0x48] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r6, r2, 24 - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0 - mov r9, r0 - ldr r5, =0x0202420b - ldr r1, =0x0202406c - ldrb r0, [r5] - ldrb r1, [r1] - cmp r0, r1 - bcc _08042864 - mov r1, r10 - strb r1, [r5] -_08042864: - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08042894 - ldr r1, =0x0202406e - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - b _080428A4 - .pool -_08042894: - ldr r1, =0x0202406e - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 -_080428A4: - adds r7, r1, r0 - ldr r5, =0x0202420c - ldr r1, =0x0202406c - ldrb r0, [r5] - ldrb r1, [r1] - cmp r0, r1 - bcc _080428B6 - mov r2, r10 - strb r2, [r5] -_080428B6: - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080428E8 - ldr r1, =0x0202406e - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - b _080428F8 - .pool -_080428E8: - ldr r1, =0x0202406e - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 -_080428F8: - adds r5, r1, r0 - adds r0, r7, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x8] - adds r0, r7, 0 - movs r1, 0 - bl pokemon_getattr - str r0, [sp, 0x10] - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0xC] - adds r0, r5, 0 - movs r1, 0 - bl pokemon_getattr - str r0, [sp, 0x14] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0804293A - bl _0804443A -_0804293A: - mov r3, r8 - cmp r3, 0 - beq _08042958 - ldr r0, =0x0202420a - strb r3, [r0] - adds r7, r0, 0 - b _0804296E - .pool -_08042958: - ldr r2, =0x0202420a - ldr r1, =0x02024084 - movs r0, 0x58 - mov r5, r10 - muls r5, r0 - adds r0, r5, 0 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - strb r0, [r2] - adds r7, r2, 0 -_0804296E: - cmp r4, 0 - beq _08042980 - adds r5, r4, 0 - b _08042984 - .pool -_08042980: - ldr r0, =0x020241ea - ldrh r5, [r0] -_08042984: - ldr r1, =0x0202449c - ldr r0, [r1] - ldrb r0, [r0, 0x13] - mov r8, r1 - cmp r0, 0 - beq _080429A0 - movs r3, 0x3F - ands r3, r0 - b _080429AC - .pool -_080429A0: - ldr r1, =gBattleMoves - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r3, [r0, 0x2] -_080429AC: - ldr r0, [sp, 0x4] - cmp r0, 0x13 - bls _080429B6 - bl _0804441E -_080429B6: - lsls r0, 2 - ldr r1, =_080429C8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080429C8: - .4byte _08042A18 - .4byte _08042CDC - .4byte _08042EF8 - .4byte _08042F8C - .4byte _080431AC - .4byte _08043908 - .4byte _08043C6C - .4byte _08043CBC - .4byte _08043D40 - .4byte _08043DC4 - .4byte _08043FE4 - .4byte _08043E08 - .4byte _08044028 - .4byte _08044084 - .4byte _080440E0 - .4byte _080441DC - .4byte _08044220 - .4byte _0804427C - .4byte _080443EC - .4byte _08044196 -_08042A18: - ldr r2, =0x0202420b - ldr r0, =0x0202406c - ldrb r1, [r2] - adds r5, r0, 0 - ldrb r3, [r5] - cmp r1, r3 - bcc _08042A2A - mov r0, r10 - strb r0, [r2] -_08042A2A: - ldrb r0, [r7] - cmp r0, 0x2D - bne _08042A32 - b _08042BA8 -_08042A32: - cmp r0, 0x2D - bgt _08042A64 - cmp r0, 0xD - bne _08042A3C - b _08042CA4 -_08042A3C: - cmp r0, 0xD - bgt _08042A54 - cmp r0, 0x2 - bne _08042A46 - b _08042B78 -_08042A46: - bl _0804441E - .pool -_08042A54: - cmp r0, 0x16 - bne _08042A5A - b _08042C08 -_08042A5A: - cmp r0, 0x24 - bne _08042A60 - b _08042C68 -_08042A60: - bl _0804441E -_08042A64: - cmp r0, 0x46 - bne _08042A6A - b _08042BD8 -_08042A6A: - cmp r0, 0x46 - bgt _08042A78 - cmp r0, 0x3B - bne _08042A74 - b _08042C3C -_08042A74: - bl _0804441E -_08042A78: - cmp r0, 0x4D - bne _08042A7E - b _08042CA4 -_08042A7E: - cmp r0, 0xFF - beq _08042A86 - bl _0804441E -_08042A86: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - bne _08042B4C - bl weather_get_current - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x3 - cmp r0, 0xA - bhi _08042B4C - lsls r0, 2 - ldr r1, =_08042AB4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08042AB4: - .4byte _08042AE0 - .4byte _08042B4C - .4byte _08042AE0 - .4byte _08042B4C - .4byte _08042B4C - .4byte _08042B04 - .4byte _08042B4C - .4byte _08042B4C - .4byte _08042B4C - .4byte _08042B28 - .4byte _08042AE0 -_08042AE0: - ldr r2, =0x020243cc - ldrh r1, [r2] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _08042B4C - movs r0, 0x5 - strh r0, [r2] - ldr r1, =0x02024474 - movs r0, 0xA - strb r0, [r1, 0x10] - mov r2, r10 - strb r2, [r1, 0x17] - b _08042B42 - .pool -_08042B04: - ldr r3, =0x020243cc - ldrh r1, [r3] - movs r2, 0x18 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _08042B4C - strh r2, [r3] - ldr r1, =0x02024474 - movs r0, 0xC - strb r0, [r1, 0x10] - mov r3, r10 - strb r3, [r1, 0x17] - b _08042B42 - .pool -_08042B28: - ldr r3, =0x020243cc - ldrh r1, [r3] - movs r2, 0x60 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _08042B4C - strh r2, [r3] - ldr r1, =0x02024474 - movs r0, 0xB - strb r0, [r1, 0x10] - mov r5, r10 - strb r5, [r1, 0x17] -_08042B42: - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_08042B4C: - mov r0, r9 - cmp r0, 0 - bne _08042B56 - bl _0804443A -_08042B56: - bl weather_get_current - ldr r1, =0x02024332 - strb r0, [r1, 0x5] - ldr r0, =gUnknown_082DACE7 - bl b_push_move_exec - bl _0804441E - .pool -_08042B78: - ldr r2, =0x020243cc - ldrh r1, [r2] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08042B88 - bl _0804441E -_08042B88: - movs r0, 0x5 - strh r0, [r2] - ldr r0, =gUnknown_082DB430 - bl b_push_move_exec - ldr r0, =0x02024474 - mov r1, r10 - strb r1, [r0, 0x17] - bl _080443D0 - .pool -_08042BA8: - ldr r2, =0x020243cc - ldrh r1, [r2] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08042BB8 - bl _0804441E -_08042BB8: - movs r0, 0x18 - strh r0, [r2] - ldr r0, =gUnknown_082DB470 - bl b_push_move_exec - ldr r0, =0x02024474 - mov r2, r10 - strb r2, [r0, 0x17] - bl _080443D0 - .pool -_08042BD8: - ldr r2, =0x020243cc - ldrh r1, [r2] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08042BE8 - bl _0804441E -_08042BE8: - movs r0, 0x60 - strh r0, [r2] - ldr r0, =gUnknown_082DB52A - bl b_push_move_exec - ldr r0, =0x02024474 - mov r3, r10 - strb r3, [r0, 0x17] - bl _080443D0 - .pool -_08042C08: - ldr r0, =0x0202437c - mov r5, r10 - lsls r2, r5, 2 - adds r1, r2, r5 - lsls r1, 2 - adds r3, r1, r0 - ldrb r0, [r3] - lsls r0, 28 - cmp r0, 0 - bge _08042C20 - bl _0804441E -_08042C20: - ldr r1, =0x020242ac - adds r1, r2, r1 - ldr r0, [r1] - movs r2, 0x80 - lsls r2, 12 - orrs r0, r2 - str r0, [r1] - ldrb r0, [r3] - movs r1, 0x8 - b _08042C92 - .pool -_08042C3C: - mov r0, r10 - bl castform_switch - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - cmp r0, 0 - bne _08042C50 - bl _0804443A -_08042C50: - ldr r0, =gUnknown_082DB4A9 - bl b_push_move_exec - ldr r0, =0x02024474 - mov r1, r10 - strb r1, [r0, 0x17] - bl _080442E2 - .pool -_08042C68: - ldr r0, =0x0202437c - mov r3, r10 - lsls r2, r3, 2 - adds r1, r2, r3 - lsls r1, 2 - adds r3, r1, r0 - ldrb r0, [r3] - lsls r0, 27 - cmp r0, 0 - bge _08042C80 - bl _0804441E -_08042C80: - ldr r1, =0x020242ac - adds r1, r2, r1 - ldr r0, [r1] - movs r2, 0x80 - lsls r2, 13 - orrs r0, r2 - str r0, [r1] - ldrb r0, [r3] - movs r1, 0x10 -_08042C92: - orrs r0, r1 - strb r0, [r3] - bl _0804441E - .pool -_08042CA4: - movs r6, 0 - ldrb r5, [r5] - cmp r6, r5 - bcc _08042CB0 - bl _0804441E -_08042CB0: - adds r0, r6, 0 - bl castform_switch - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - cmp r0, 0 - beq _08042CC4 - bl _080442D8 -_08042CC4: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r6, r0 - bcc _08042CB0 - bl _0804441E - .pool -_08042CDC: - ldr r5, =0x02024084 - mov r8, r5 - movs r0, 0x58 - mov r6, r10 - muls r6, r0 - adds r4, r6, r5 - ldrh r0, [r4, 0x28] - cmp r0, 0 - bne _08042CF2 - bl _0804441E -_08042CF2: - ldr r0, =0x0202420b - mov r1, r10 - strb r1, [r0] - ldrb r5, [r7] - cmp r5, 0x2C - beq _08042D22 - cmp r5, 0x2C - bgt _08042D14 - cmp r5, 0x3 - bne _08042D08 - b _08042E84 -_08042D08: - bl _0804441E - .pool -_08042D14: - cmp r5, 0x36 - bne _08042D1A - b _08042ED0 -_08042D1A: - cmp r5, 0x3D - beq _08042DA0 - bl _0804441E -_08042D22: - movs r0, 0 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _08042D3E - bl _0804441E -_08042D3E: - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _08042D56 - bl _0804441E -_08042D56: - ldr r0, =0x020243cc - ldrh r1, [r0] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _08042D66 - bl _0804441E -_08042D66: - ldrh r0, [r4, 0x2C] - ldrh r2, [r4, 0x28] - cmp r0, r2 - bhi _08042D72 - bl _0804441E -_08042D72: - strb r5, [r7] - ldr r0, =gUnknown_082DB45C - bl b_push_move_exec - ldr r1, =0x020241f0 - ldrh r0, [r4, 0x2C] - lsrs r0, 4 - str r0, [r1] - cmp r0, 0 - bne _08042D8A - movs r0, 0x1 - str r0, [r1] -_08042D8A: - ldr r0, [r1] - negs r0, r0 - str r0, [r1] - bl _080443D0 - .pool -_08042DA0: - mov r0, r8 - adds r0, 0x4C - adds r5, r6, r0 - ldrb r0, [r5] - cmp r0, 0 - bne _08042DB0 - bl _0804441E -_08042DB0: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _08042DCA - bl _0804441E -_08042DCA: - ldr r0, [r5] - movs r1, 0x88 - ands r0, r1 - cmp r0, 0 - beq _08042DDC - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC70 - bl CopyString -_08042DDC: - ldr r0, [r5] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08042DEE - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC78 - bl CopyString -_08042DEE: - ldr r0, [r5] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08042E00 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC80 - bl CopyString -_08042E00: - ldr r0, [r5] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08042E12 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC88 - bl CopyString -_08042E12: - ldr r0, [r5] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08042E24 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC90 - bl CopyString -_08042E24: - str r4, [r5] - mov r1, r8 - adds r1, 0x50 - adds r1, r6, r1 - ldr r0, [r1] - ldr r2, =0xf7ffffff - ands r0, r2 - str r0, [r1] - ldr r0, =0x02024474 - ldr r4, =0x02024064 - mov r3, r10 - strb r3, [r4] - strb r3, [r0, 0x17] - ldr r0, =gUnknown_082DB484 - bl b_push_move_exec - str r5, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - bl _080443D0 - .pool -_08042E84: - ldrb r2, [r4, 0x1B] - movs r0, 0x1B - ldrsb r0, [r4, r0] - cmp r0, 0xB - ble _08042E92 - bl _0804441E -_08042E92: - ldr r0, =0x020242bc - mov r5, r10 - lsls r1, r5, 3 - subs r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x16] - cmp r0, 0x2 - bne _08042EA8 - bl _0804441E -_08042EA8: - adds r0, r2, 0x1 - movs r1, 0 - strb r0, [r4, 0x1B] - ldr r4, =0x02024474 - movs r0, 0x11 - strb r0, [r4, 0x10] - strb r1, [r4, 0x11] - ldr r0, =gUnknown_082DB444 - bl b_push_move_exec - strb r5, [r4, 0x17] - bl _080443D0 - .pool -_08042ED0: - ldr r2, =0x020242bc - ldrb r0, [r0] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r3, [r1, 0x18] - lsls r0, r3, 31 - lsrs r0, 31 - movs r2, 0x1 - eors r2, r0 - movs r0, 0x2 - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x18] - bl _0804441E - .pool -_08042EF8: - ldrb r0, [r7] - cmp r0, 0x2B - beq _08042F02 - bl _0804441E -_08042F02: - movs r4, 0 - ldr r0, =gUnknown_0831BCF8 - ldrh r2, [r0] - ldr r3, =0x0000ffff - adds r1, r0, 0 - cmp r2, r3 - bne _08042F14 - bl _0804441E -_08042F14: - cmp r2, r5 - beq _08042F2C - adds r2, r1, 0 -_08042F1A: - adds r2, 0x2 - adds r4, 0x1 - ldrh r0, [r2] - cmp r0, r3 - bne _08042F28 - bl _0804441E -_08042F28: - cmp r0, r5 - bne _08042F1A -_08042F2C: - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08042F3C - bl _0804441E -_08042F3C: - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 5 - ands r0, r1 - cmp r0, 0 - beq _08042F62 - ldr r0, =0x02024280 - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 4 - orrs r1, r2 - str r1, [r0] -_08042F62: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB61F - str r0, [r1] - movs r0, 0x1 - mov r9, r0 - bl _08044424 - .pool -_08042F8C: - cmp r5, 0 - bne _08042F94 - bl _0804441E -_08042F94: - ldrb r0, [r7] - cmp r0, 0xB - beq _08043004 - cmp r0, 0xB - bgt _08042FA4 - cmp r0, 0xA - beq _08042FAA - b _08043126 -_08042FA4: - cmp r0, 0x12 - beq _0804305C - b _08043126 -_08042FAA: - cmp r3, 0xD - beq _08042FB0 - b _08043126 -_08042FB0: - ldr r0, =gBattleMoves - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0 - bne _08042FC2 - b _08043126 -_08042FC2: - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x2] - lsls r0, 28 - cmp r0, 0 - bge _08042FF0 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB56F - b _08042FF4 - .pool -_08042FF0: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB56E -_08042FF4: - str r0, [r1] - movs r1, 0x1 - b _08043124 - .pool -_08043004: - cmp r3, 0xB - beq _0804300A - b _08043126 -_0804300A: - ldr r0, =gBattleMoves - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0 - bne _0804301C - b _08043126 -_0804301C: - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x2] - lsls r0, 28 - cmp r0, 0 - bge _08043048 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB56F - b _0804304C - .pool -_08043048: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB56E -_0804304C: - str r0, [r1] - movs r2, 0x1 - mov r9, r2 - b _08043126 - .pool -_0804305C: - cmp r3, 0xA - bne _08043126 - ldr r1, =0x02024084 - movs r0, 0x58 - mov r3, r10 - muls r3, r0 - adds r0, r3, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - bne _08043126 - ldr r2, =0x020244a8 - ldr r0, [r2] - ldr r0, [r0, 0x4] - mov r5, r10 - lsls r1, r5, 2 - adds r0, r1 - ldr r3, [r0] - movs r4, 0x1 - ands r3, r4 - adds r5, r1, 0 - cmp r3, 0 - bne _080430EC - ldr r0, =0x02024332 - strb r3, [r0, 0x5] - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x2] - lsls r0, 28 - cmp r0, 0 - bge _080430C8 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB5A8 - b _080430CC - .pool -_080430C8: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB5A7 -_080430CC: - str r0, [r1] - ldr r0, [r2] - ldr r1, [r0, 0x4] - adds r1, r5 - ldr r0, [r1] - movs r2, 0x1 - orrs r0, r2 - str r0, [r1] - movs r0, 0x2 - mov r9, r0 - b _08043126 - .pool -_080430EC: - ldr r0, =0x02024332 - strb r4, [r0, 0x5] - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x2] - lsls r0, 28 - cmp r0, 0 - bge _0804311C - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB5A8 - b _08043120 - .pool -_0804311C: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB5A7 -_08043120: - str r0, [r1] - movs r1, 0x2 -_08043124: - mov r9, r1 -_08043126: - mov r2, r9 - cmp r2, 0x1 - beq _08043130 - bl _0804441E -_08043130: - ldr r1, =0x02024084 - movs r0, 0x58 - mov r3, r10 - muls r3, r0 - adds r0, r3, 0 - adds r1, r0, r1 - ldrh r0, [r1, 0x2C] - ldrh r5, [r1, 0x28] - cmp r0, r5 - bne _0804318C - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x2] - lsls r0, 28 - cmp r0, 0 - bge _08043178 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB592 - str r0, [r1] - bl _0804441E - .pool -_08043178: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB591 - str r0, [r1] - bl _0804441E - .pool -_0804318C: - ldr r2, =0x020241f0 - ldrh r0, [r1, 0x2C] - lsrs r0, 2 - str r0, [r2] - cmp r0, 0 - bne _0804319C - mov r0, r9 - str r0, [r2] -_0804319C: - ldr r0, [r2] - negs r0, r0 - str r0, [r2] - bl _0804441E - .pool -_080431AC: - ldrb r0, [r7] - subs r0, 0x9 - cmp r0, 0x2F - bls _080431B8 - bl _0804441E -_080431B8: - lsls r0, 2 - ldr r1, =_080431C8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080431C8: - .4byte _080435E4 - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _08043288 - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _08043350 - .4byte _0804441E - .4byte _0804441E - .4byte _08043410 - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _08043508 - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _080436C0 - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804379C -_08043288: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _08043298 - bl _0804441E -_08043298: - cmp r5, 0xA5 - bne _080432A0 - bl _0804441E -_080432A0: - ldr r0, =gBattleMoves - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0 - bne _080432B4 - bl _0804441E -_080432B4: - ldr r2, =0x0202437c - ldr r0, =0x0202420c - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r1, r0, 2 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _080432DC - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _080432DC - bl _0804441E -_080432DC: - ldr r1, =0x02024084 - movs r0, 0x58 - mov r2, r10 - muls r2, r0 - adds r0, r2, 0 - adds r1, r0, r1 - adds r4, r1, 0 - adds r4, 0x21 - ldrb r0, [r4] - cmp r0, r3 - bne _080432F6 - bl _0804441E -_080432F6: - adds r2, r1, 0 - adds r2, 0x22 - ldrb r0, [r2] - cmp r0, r3 - bne _08043304 - bl _0804441E -_08043304: - ldrh r0, [r1, 0x28] - cmp r0, 0 - bne _0804330E - bl _0804441E -_0804330E: - strb r3, [r4] - strb r3, [r2] - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x3 - strb r0, [r1, 0x1] - strb r3, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB64D - str r0, [r1] - bl _080443D0 - .pool -_08043350: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _08043360 - bl _0804441E -_08043360: - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r3, r0, r1 - ldrh r0, [r3, 0x28] - cmp r0, 0 - bne _08043376 - bl _0804441E -_08043376: - ldr r0, =0x0202433c - lsls r1, r2, 4 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 31 - cmp r0, 0 - beq _08043388 - bl _0804441E -_08043388: - ldr r2, =0x0202437c - ldr r0, =0x0202420c - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r1, r0, 2 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _080433B0 - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _080433B0 - bl _0804441E -_080433B0: - ldr r1, =gBattleMoves - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r2, 0x1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _080433CA - bl _0804441E -_080433CA: - ldr r1, =0x020241f0 - ldrh r0, [r3, 0x2C] - lsrs r0, 4 - str r0, [r1] - cmp r0, 0 - bne _080433D8 - str r2, [r1] -_080433D8: - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB654 - str r0, [r1] - bl _080443D0 - .pool -_08043410: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _08043420 - bl _0804441E -_08043420: - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08043436 - bl _0804441E -_08043436: - ldr r0, =0x0202433c - lsls r1, r2, 4 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 31 - cmp r0, 0 - beq _08043448 - bl _0804441E -_08043448: - ldr r2, =0x0202437c - ldr r0, =0x0202420c - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r1, r0, 2 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043470 - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043470 - bl _0804441E -_08043470: - ldr r1, =gBattleMoves - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08043488 - bl _0804441E -_08043488: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _080434A0 - bl _0804441E -_080434A0: - ldr r5, =0x02024332 - movs r4, 0x3 -_080434A4: - bl GenerateRandomNumber - ands r0, r4 - strb r0, [r5, 0x3] - cmp r0, 0 - beq _080434A4 - ldr r1, =0x02024332 - ldrb r0, [r1, 0x3] - cmp r0, 0x3 - bne _080434BC - adds r0, 0x2 - strb r0, [r1, 0x3] -_080434BC: - ldrb r0, [r1, 0x3] - adds r0, 0x40 - strb r0, [r1, 0x3] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB67C - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 6 - orrs r0, r1 - str r0, [r2] - bl _080443D0 - .pool -_08043508: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _08043518 - bl _0804441E -_08043518: - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _0804352E - bl _0804441E -_0804352E: - ldr r0, =0x0202433c - lsls r1, r2, 4 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 31 - cmp r0, 0 - beq _08043540 - bl _0804441E -_08043540: - ldr r2, =0x0202437c - ldr r0, =0x0202420c - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r1, r0, 2 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043568 - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043568 - bl _0804441E -_08043568: - ldr r1, =gBattleMoves - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08043580 - bl _0804441E -_08043580: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _08043598 - bl _0804441E -_08043598: - ldr r1, =0x02024332 - movs r0, 0x42 - strb r0, [r1, 0x3] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB67C - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 6 - orrs r0, r1 - str r0, [r2] - bl _080443D0 - .pool -_080435E4: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _080435F4 - bl _0804441E -_080435F4: - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _0804360A - bl _0804441E -_0804360A: - ldr r0, =0x0202433c - lsls r1, r2, 4 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 31 - cmp r0, 0 - beq _0804361C - bl _0804441E -_0804361C: - ldr r2, =0x0202437c - ldr r0, =0x0202420c - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r1, r0, 2 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043644 - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043644 - bl _0804441E -_08043644: - ldr r1, =gBattleMoves - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0804365C - bl _0804441E -_0804365C: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _08043674 - bl _0804441E -_08043674: - ldr r1, =0x02024332 - movs r0, 0x45 - strb r0, [r1, 0x3] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB67C - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 6 - orrs r0, r1 - str r0, [r2] - bl _080443D0 - .pool -_080436C0: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _080436D0 - bl _0804441E -_080436D0: - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _080436E6 - bl _0804441E -_080436E6: - ldr r0, =0x0202433c - lsls r1, r2, 4 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 31 - cmp r0, 0 - beq _080436F8 - bl _0804441E -_080436F8: - ldr r1, =gBattleMoves - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08043710 - bl _0804441E -_08043710: - ldr r2, =0x0202437c - ldr r0, =0x0202420c - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r1, r0, 2 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043738 - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043738 - bl _0804441E -_08043738: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _08043750 - bl _0804441E -_08043750: - ldr r1, =0x02024332 - movs r0, 0x43 - strb r0, [r1, 0x3] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB67C - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 6 - orrs r0, r1 - str r0, [r2] - bl _080443D0 - .pool -_0804379C: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _080437AC - bl _0804441E -_080437AC: - ldr r6, =0x02024084 - ldr r3, =0x0202420b - mov r8, r3 - ldrb r1, [r3] - movs r7, 0x58 - adds r0, r1, 0 - muls r0, r7 - adds r0, r6 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _080437C6 - bl _0804441E -_080437C6: - ldr r0, =0x0202433c - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 31 - cmp r0, 0 - beq _080437D8 - bl _0804441E -_080437D8: - ldr r1, =gBattleMoves - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080437F0 - bl _0804441E -_080437F0: - ldr r3, =0x0202437c - ldr r5, =0x0202420c - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r2, r0, 2 - adds r0, r3, 0 - adds r0, 0x8 - adds r0, r2, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043818 - adds r0, r3, 0 - adds r0, 0xC - adds r0, r2, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043818 - bl _0804441E -_08043818: - adds r0, r1, 0 - muls r0, r7 - adds r0, r6 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08043828 - bl _0804441E -_08043828: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _08043840 - bl _0804441E -_08043840: - mov r1, r8 - ldrb r0, [r1] - muls r0, r7 - adds r0, r6 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0xC - bne _08043854 - bl _0804441E -_08043854: - ldr r0, [sp, 0x8] - ldr r1, [sp, 0x10] - bl pokemon_species_get_gender_info - adds r4, r0, 0 - ldr r0, [sp, 0xC] - ldr r1, [sp, 0x14] - bl pokemon_species_get_gender_info - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _08043872 - bl _0804441E -_08043872: - mov r2, r8 - ldrb r0, [r2] - muls r0, r7 - adds r4, r6, 0 - adds r4, 0x50 - adds r0, r4 - ldr r0, [r0] - movs r1, 0xF0 - lsls r1, 12 - ands r0, r1 - cmp r0, 0 - beq _0804388E - bl _0804441E -_0804388E: - ldr r0, [sp, 0x8] - ldr r1, [sp, 0x10] - bl pokemon_species_get_gender_info - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _080438A2 - bl _0804441E -_080438A2: - ldr r0, [sp, 0xC] - ldr r1, [sp, 0x14] - bl pokemon_species_get_gender_info - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _080438B6 - bl _0804441E -_080438B6: - mov r3, r8 - ldrb r0, [r3] - adds r2, r0, 0 - muls r2, r7 - adds r2, r4 - ldr r1, =gUnknown_0832A328 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - lsls r1, 16 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB66F - str r0, [r1] - bl _080443D0 - .pool -_08043908: - movs r5, 0 - mov r10, r5 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r10, r0 - bcc _08043918 - bl _0804441E -_08043918: - ldr r1, =0x02024084 - movs r0, 0x58 - mov r2, r10 - muls r2, r0 - adds r0, r2, 0 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - subs r0, 0x7 - adds r2, r1, 0 - cmp r0, 0x41 - bls _08043932 - b _08043B96 -_08043932: - lsls r0, 2 - ldr r1, =_08043948 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08043948: - .4byte _08043AAC - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B70 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043AD4 - .4byte _08043B96 - .4byte _08043A50 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043A7C - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B40 - .4byte _08043B10 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043AD4 -_08043A50: - movs r0, 0x58 - mov r3, r10 - muls r3, r0 - adds r0, r3, 0 - adds r1, r2, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x00000f88 - ands r0, r1 - cmp r0, 0 - bne _08043A6A - b _08043B96 -_08043A6A: - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC70 - b _08043B5C - .pool -_08043A7C: - movs r0, 0x58 - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - adds r1, r2, 0 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _08043A96 - b _08043B96 -_08043A96: - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC98 - bl CopyString - movs r2, 0x2 - mov r9, r2 - b _08043B9C - .pool -_08043AAC: - movs r0, 0x58 - mov r3, r10 - muls r3, r0 - adds r0, r3, 0 - adds r1, r2, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08043B96 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC80 - b _08043B5C - .pool -_08043AD4: - movs r0, 0x58 - mov r3, r10 - muls r3, r0 - adds r0, r2, 0 - adds r0, 0x4C - adds r0, r3, r0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08043B96 - adds r2, 0x50 - adds r2, r3, r2 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC78 - bl CopyString - movs r0, 0x1 - mov r9, r0 - b _08043B9C - .pool -_08043B10: - movs r0, 0x58 - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - adds r1, r2, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08043B96 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC88 - bl CopyString - movs r2, 0x1 - mov r9, r2 - b _08043B9C - .pool -_08043B40: - movs r0, 0x58 - mov r3, r10 - muls r3, r0 - adds r0, r3, 0 - adds r1, r2, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08043B96 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC90 -_08043B5C: - bl CopyString - movs r5, 0x1 - mov r9, r5 - b _08043B9C - .pool -_08043B70: - movs r0, 0x58 - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - adds r1, r2, 0 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0xF0 - lsls r1, 12 - ands r0, r1 - cmp r0, 0 - beq _08043B96 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BCA0 - bl CopyString - movs r2, 0x3 - mov r9, r2 -_08043B96: - mov r3, r9 - cmp r3, 0 - beq _08043C50 -_08043B9C: - mov r5, r9 - cmp r5, 0x2 - beq _08043BD0 - cmp r5, 0x2 - bgt _08043BB4 - cmp r5, 0x1 - beq _08043BBC - b _08043BFC - .pool -_08043BB4: - mov r0, r9 - cmp r0, 0x3 - beq _08043BE8 - b _08043BFC -_08043BBC: - ldr r1, =0x02024084 - movs r0, 0x58 - mov r2, r10 - muls r2, r0 - adds r1, 0x4C - adds r2, r1 - movs r0, 0 - b _08043BFA - .pool -_08043BD0: - ldr r1, =0x02024084 - movs r0, 0x58 - mov r2, r10 - muls r2, r0 - adds r1, 0x50 - adds r2, r1 - ldr r0, [r2] - movs r1, 0x8 - negs r1, r1 - b _08043BF8 - .pool -_08043BE8: - ldr r1, =0x02024084 - movs r0, 0x58 - mov r2, r10 - muls r2, r0 - adds r1, 0x50 - adds r2, r1 - ldr r0, [r2] - ldr r1, =0xfff0ffff -_08043BF8: - ands r0, r1 -_08043BFA: - str r0, [r2] -_08043BFC: - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB68C - str r0, [r1] - ldr r0, =0x02024474 - mov r1, r10 - strb r1, [r0, 0x17] - ldr r4, =0x02024064 - strb r1, [r4] - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - ldr r1, =0x020240d0 - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - bl _0804443A - .pool -_08043C50: - mov r0, r10 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r10, r0 - bcs _08043C64 - b _08043918 -_08043C64: - bl _0804441E - .pool -_08043C6C: - movs r2, 0 - mov r10, r2 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r10, r0 - bcc _08043C7A - b _0804441E -_08043C7A: - ldr r4, =0x02024084 -_08043C7C: - movs r0, 0x58 - mov r3, r10 - muls r3, r0 - adds r0, r3, 0 - adds r0, r4 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x3B - bne _08043CA0 - mov r0, r10 - bl castform_switch - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - cmp r0, 0 - beq _08043CA0 - b _080442FC -_08043CA0: - mov r0, r10 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r10, r0 - bcc _08043C7C - b _0804441E - .pool -_08043CBC: - ldrb r0, [r7] - cmp r0, 0x1C - beq _08043CC4 - b _0804441E -_08043CC4: - ldr r4, =0x02024280 - ldr r1, [r4] - movs r0, 0x80 - lsls r0, 7 - ands r0, r1 - cmp r0, 0 - bne _08043CD4 - b _0804441E -_08043CD4: - ldr r0, =0xffffbfff - ands r1, r0 - str r1, [r4] - mov r5, r8 - ldr r1, [r5] - adds r1, 0xB2 - ldrb r2, [r1] - movs r0, 0x3F - ands r0, r2 - strb r0, [r1] - ldr r0, [r5] - adds r1, r0, 0 - adds r1, 0xB2 - ldrb r0, [r1] - cmp r0, 0x6 - bne _08043CF8 - movs r0, 0x2 - strb r0, [r1] -_08043CF8: - ldr r1, =0x02024332 - mov r2, r8 - ldr r0, [r2] - adds r0, 0xB2 - ldrb r0, [r0] - adds r0, 0x40 - strb r0, [r1, 0x3] - ldr r1, =0x02024474 - ldr r0, =0x0202420c - ldrb r0, [r0] - strb r0, [r1, 0x17] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB67F - str r0, [r1] - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 6 - orrs r0, r1 - str r0, [r4] - b _080443D0 - .pool -_08043D40: - ldrb r0, [r7] - cmp r0, 0x1C - beq _08043D48 - b _0804441E -_08043D48: - ldr r4, =0x02024280 - ldr r1, [r4] - movs r0, 0x80 - lsls r0, 7 - ands r0, r1 - cmp r0, 0 - bne _08043D58 - b _0804441E -_08043D58: - ldr r0, =0xffffbfff - ands r1, r0 - str r1, [r4] - mov r3, r8 - ldr r1, [r3] - adds r1, 0xB2 - ldrb r2, [r1] - movs r0, 0x3F - ands r0, r2 - strb r0, [r1] - ldr r0, [r3] - adds r1, r0, 0 - adds r1, 0xB2 - ldrb r0, [r1] - cmp r0, 0x6 - bne _08043D7C - movs r0, 0x2 - strb r0, [r1] -_08043D7C: - ldr r1, =0x02024332 - mov r3, r8 - ldr r0, [r3] - adds r0, 0xB2 - ldrb r0, [r0] - strb r0, [r1, 0x3] - ldr r1, =0x02024474 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r1, 0x17] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB67F - str r0, [r1] - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 6 - orrs r0, r1 - str r0, [r4] - b _080443D0 - .pool -_08043DC4: - movs r4, 0 - ldr r0, =0x0202406c - ldrb r1, [r0] - cmp r4, r1 - blt _08043DD0 - b _0804441E -_08043DD0: - ldr r0, =0x02024084 - adds r5, r1, 0 - ldr r2, =0x020242ac - adds r3, r0, 0 - adds r3, 0x20 - movs r6, 0x80 - lsls r6, 12 -_08043DDE: - ldrb r1, [r3] - cmp r1, 0x16 - bne _08043DEE - ldr r0, [r2] - ands r0, r6 - cmp r0, 0 - beq _08043DEE - b _08044324 -_08043DEE: - adds r2, 0x4 - adds r3, 0x58 - adds r4, 0x1 - cmp r4, r5 - blt _08043DDE - b _0804441E - .pool -_08043E08: - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _08043E14 - b _0804441E -_08043E14: - ldr r5, =0x02024064 - mov r8, r5 - ldr r0, =0x02024084 - adds r0, 0x20 - str r0, [sp, 0x1C] - movs r1, 0 - str r1, [sp, 0x20] -_08043E22: - ldr r2, [sp, 0x1C] - ldrb r0, [r2] - cmp r0, 0x24 - beq _08043E2C - b _08043FBE -_08043E2C: - ldr r0, =0x020242ac - ldr r3, [sp, 0x20] - adds r0, r3, r0 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 13 - ands r1, r0 - str r3, [sp, 0x18] - cmp r1, 0 - bne _08043E42 - b _08043FBE -_08043E42: - lsls r0, r4, 24 - lsrs r0, 24 - bl battle_get_per_side_status - movs r1, 0x1 - adds r5, r0, 0 - eors r5, r1 - ands r5, r1 - adds r0, r5, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r5, 0x2 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r2, 0x1 - ands r0, r2 - cmp r0, 0 - bne _08043E74 - b _08043F84 -_08043E74: - movs r1, 0x58 - adds r0, r6, 0 - muls r0, r1 - ldr r3, =0x02024084 - adds r1, r0, r3 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0 - beq _08043F40 - ldrh r0, [r1, 0x28] - cmp r0, 0 - beq _08043EFC - movs r1, 0x58 - adds r0, r7, 0 - muls r0, r1 - adds r1, r0, r3 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0 - beq _08043EFC - ldrh r0, [r1, 0x28] - cmp r0, 0 - beq _08043EFC - str r2, [sp, 0x24] - bl GenerateRandomNumber - ldr r2, [sp, 0x24] - adds r1, r2, 0 - ands r1, r0 - lsls r1, 1 - orrs r5, r1 - adds r0, r5, 0 - bl battle_get_side_with_given_state - mov r2, r8 - strb r0, [r2] - ldrb r0, [r2] - movs r3, 0x58 - muls r0, r3 - ldr r5, =0x02024084 - adds r0, r5 - adds r0, 0x20 - ldrb r0, [r0] - ldr r1, [sp, 0x1C] - strb r0, [r1] - ldrb r0, [r2] - muls r0, r3 - adds r0, r5 - adds r0, 0x20 - ldrb r0, [r0] - ldr r2, =0x0202420a - strb r0, [r2] - b _08043FAC - .pool -_08043EFC: - ldr r3, =0x02024084 - movs r2, 0x58 - adds r0, r6, 0 - muls r0, r2 - adds r1, r0, r3 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0 - beq _08043F40 - ldrh r0, [r1, 0x28] - cmp r0, 0 - beq _08043F40 - mov r5, r8 - strb r6, [r5] - adds r1, r4, 0 - muls r1, r2 - adds r1, r3 - ldrb r0, [r5] - muls r0, r2 - adds r0, r3 - adds r0, 0x20 - ldrb r0, [r0] - adds r1, 0x20 - strb r0, [r1] - ldrb r0, [r5] - muls r0, r2 - adds r0, r3 - adds r0, 0x20 - ldrb r0, [r0] - b _08043FA8 - .pool -_08043F40: - ldr r3, =0x02024084 - movs r2, 0x58 - adds r0, r7, 0 - muls r0, r2 - adds r1, r0, r3 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0 - beq _08043FB6 - ldrh r0, [r1, 0x28] - cmp r0, 0 - beq _08043FB6 - mov r5, r8 - strb r7, [r5] - adds r1, r4, 0 - muls r1, r2 - adds r1, r3 - ldrb r0, [r5] - muls r0, r2 - adds r0, r3 - adds r0, 0x20 - ldrb r0, [r0] - adds r1, 0x20 - strb r0, [r1] - ldrb r0, [r5] - muls r0, r2 - adds r0, r3 - adds r0, 0x20 - ldrb r0, [r0] - b _08043FA8 - .pool -_08043F84: - mov r2, r8 - strb r6, [r2] - movs r3, 0x58 - adds r0, r6, 0 - muls r0, r3 - ldr r5, =0x02024084 - adds r0, r5 - adds r2, r0, 0 - adds r2, 0x20 - ldrb r1, [r2] - cmp r1, 0 - beq _08043FB6 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08043FB6 - ldr r0, [sp, 0x1C] - strb r1, [r0] - ldrb r0, [r2] -_08043FA8: - ldr r1, =0x0202420a - strb r0, [r1] -_08043FAC: - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_08043FB6: - mov r2, r9 - cmp r2, 0 - beq _08043FBE - b _08044340 -_08043FBE: - ldr r3, [sp, 0x1C] - adds r3, 0x58 - str r3, [sp, 0x1C] - ldr r5, [sp, 0x20] - adds r5, 0x4 - str r5, [sp, 0x20] - adds r4, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - bge _08043FD6 - b _08043E22 -_08043FD6: - b _0804441E - .pool -_08043FE4: - movs r4, 0 - ldr r0, =0x0202406c - ldrb r1, [r0] - cmp r4, r1 - blt _08043FF0 - b _0804441E -_08043FF0: - ldr r0, =0x02024084 - adds r5, r1, 0 - ldr r2, =0x020242ac - adds r3, r0, 0 - adds r3, 0x20 - movs r6, 0x80 - lsls r6, 12 -_08043FFE: - ldrb r1, [r3] - cmp r1, 0x16 - bne _0804400E - ldr r0, [r2] - ands r0, r6 - cmp r0, 0 - beq _0804400E - b _080443B4 -_0804400E: - adds r2, 0x4 - adds r3, 0x58 - adds r4, 0x1 - cmp r4, r5 - blt _08043FFE - b _0804441E - .pool -_08044028: - mov r0, r10 - bl battle_side_get_owner - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _0804403E - b _0804441E -_0804403E: - ldr r7, =0x02024084 -_08044040: - lsls r0, r4, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - adds r3, r4, 0x1 - cmp r0, r5 - beq _0804406A - movs r0, 0x58 - muls r0, r4 - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, r6 - bne _0804406A - ldr r0, =0x0202420a - strb r6, [r0] - lsls r0, r3, 24 - lsrs r0, 24 - mov r9, r0 -_0804406A: - adds r4, r3, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _08044040 - b _0804441E - .pool -_08044084: - mov r0, r10 - bl battle_side_get_owner - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _0804409A - b _0804441E -_0804409A: - ldr r7, =0x02024084 -_0804409C: - lsls r0, r4, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - adds r3, r4, 0x1 - cmp r0, r5 - bne _080440C6 - movs r0, 0x58 - muls r0, r4 - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, r6 - bne _080440C6 - ldr r0, =0x0202420a - strb r6, [r0] - lsls r0, r3, 24 - lsrs r0, 24 - mov r9, r0 -_080440C6: - adds r4, r3, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _0804409C - b _0804441E - .pool -_080440E0: - ldrb r0, [r7] - cmp r0, 0xFD - beq _08044104 - cmp r0, 0xFE - beq _0804413C - movs r4, 0 - ldr r0, =0x0202406c - adds r5, r0, 0 - ldrb r0, [r5] - cmp r4, r0 - blt _080440F8 - b _0804441E -_080440F8: - ldr r2, =0x02024084 - b _08044174 - .pool -_08044104: - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _08044110 - b _0804441E -_08044110: - ldr r5, =0x020242ac - movs r2, 0x80 - lsls r2, 9 - adds r1, r0, 0 -_08044118: - lsls r0, r4, 2 - adds r0, r5 - ldr r0, [r0] - ands r0, r2 - adds r3, r4, 0x1 - cmp r0, 0 - beq _0804412C - lsls r0, r3, 24 - lsrs r0, 24 - mov r9, r0 -_0804412C: - adds r4, r3, 0 - cmp r4, r1 - blt _08044118 - b _0804441E - .pool -_0804413C: - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _08044148 - b _0804441E -_08044148: - ldr r5, =0x020242ac - movs r2, 0x80 - lsls r2, 10 - adds r1, r0, 0 -_08044150: - lsls r0, r4, 2 - adds r0, r5 - ldr r0, [r0] - ands r0, r2 - adds r3, r4, 0x1 - cmp r0, 0 - beq _08044164 - lsls r0, r3, 24 - lsrs r0, 24 - mov r9, r0 -_08044164: - adds r4, r3, 0 - cmp r4, r1 - blt _08044150 - b _0804441E - .pool -_08044174: - movs r0, 0x58 - muls r0, r4 - adds r0, r2 - adds r0, 0x20 - ldrb r0, [r0] - adds r3, r4, 0x1 - cmp r0, r6 - bne _0804418C - strb r6, [r7] - lsls r0, r3, 24 - lsrs r0, 24 - mov r9, r0 -_0804418C: - adds r4, r3, 0 - ldrb r1, [r5] - cmp r4, r1 - blt _08044174 - b _0804441E -_08044196: - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _080441A2 - b _0804441E -_080441A2: - ldr r2, =0x02024084 - mov r8, r2 - adds r2, r0, 0 - movs r5, 0x58 -_080441AA: - adds r0, r4, 0 - muls r0, r5 - mov r3, r8 - adds r1, r0, r3 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - adds r3, r4, 0x1 - cmp r0, r6 - bne _080441CC - ldrh r0, [r1, 0x28] - cmp r0, 0 - beq _080441CC - strb r6, [r7] - lsls r0, r3, 24 - lsrs r0, 24 - mov r9, r0 -_080441CC: - adds r4, r3, 0 - cmp r4, r2 - blt _080441AA - b _0804441E - .pool -_080441DC: - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _080441E8 - b _0804441E -_080441E8: - ldr r7, =0x02024084 - adds r1, r0, 0 - movs r5, 0x58 - ldr r2, =0x0202420a -_080441F0: - adds r0, r4, 0 - muls r0, r5 - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - adds r3, r4, 0x1 - cmp r0, r6 - bne _0804420C - cmp r4, r10 - beq _0804420C - strb r6, [r2] - lsls r0, r3, 24 - lsrs r0, 24 - mov r9, r0 -_0804420C: - adds r4, r3, 0 - cmp r4, r1 - blt _080441F0 - b _0804441E - .pool -_08044220: - mov r0, r10 - bl battle_side_get_owner - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _08044236 - b _0804441E -_08044236: - ldr r7, =0x02024084 -_08044238: - lsls r0, r4, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, r5 - beq _08044264 - movs r0, 0x58 - muls r0, r4 - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, r6 - bne _08044264 - ldr r0, =0x0202420a - strb r6, [r0] - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_08044264: - adds r4, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _08044238 - b _0804441E - .pool -_0804427C: - mov r0, r10 - bl battle_side_get_owner - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _08044292 - b _0804441E -_08044292: - ldr r7, =0x02024084 -_08044294: - lsls r0, r4, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, r5 - bne _080442C0 - movs r0, 0x58 - muls r0, r4 - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, r6 - bne _080442C0 - ldr r0, =0x0202420a - strb r6, [r0] - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_080442C0: - adds r4, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _08044294 - b _0804441E - .pool -_080442D8: - ldr r0, =gUnknown_082DB4A9 - bl b_push_move_exec - ldr r0, =0x02024474 - strb r6, [r0, 0x17] -_080442E2: - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x7F - mov r1, r9 - subs r1, 0x1 - strb r1, [r0] - b _0804441E - .pool -_080442FC: - ldr r0, =gUnknown_082DB4A9 - bl b_push_move_exec - ldr r0, =0x02024474 - mov r5, r10 - strb r5, [r0, 0x17] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x7F - mov r1, r9 - subs r1, 0x1 - strb r1, [r0] - b _0804443A - .pool -_08044324: - strb r1, [r7] - ldr r0, [r2] - ldr r1, =0xfff7ffff - ands r0, r1 - str r0, [r2] - ldr r0, =gUnknown_082DB4B8 - bl b_push_move_exec - b _080443C8 - .pool -_08044340: - ldr r0, =gUnknown_082DB452 - bl b_push_move_exec - ldr r1, =0x020242ac - ldr r0, [sp, 0x18] - adds r1, r0, r1 - ldr r0, [r1] - ldr r2, =0xffefffff - ands r0, r2 - str r0, [r1] - ldr r0, =0x02024474 - strb r4, [r0, 0x17] - ldr r1, =0x02022f58 - movs r4, 0xFD - strb r4, [r1] - movs r0, 0x4 - strb r0, [r1, 0x1] - ldr r2, =0x02024064 - ldrb r0, [r2] - strb r0, [r1, 0x2] - ldr r3, =0x0202406e - ldrb r0, [r2] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x02022f68 - strb r4, [r1] - movs r0, 0x9 - strb r0, [r1, 0x1] - ldr r0, =0x0202420a - ldrb r0, [r0] - strb r0, [r1, 0x2] - movs r0, 0x1 - negs r0, r0 - strb r0, [r1, 0x3] - b _0804441E - .pool -_080443B4: - strb r1, [r7] - ldr r0, [r2] - ldr r1, =0xfff7ffff - ands r0, r1 - str r0, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB4C1 - str r0, [r1] -_080443C8: - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0xD8 - strb r4, [r0] -_080443D0: - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - b _0804441E - .pool -_080443EC: - movs r4, 0 - ldr r0, =0x0202406c - ldrb r1, [r0] - cmp r4, r1 - bge _0804441E - ldr r0, =0x02024084 - adds r2, r1, 0 - adds r1, r0, 0 - adds r1, 0x20 - ldr r3, =0x0202420a -_08044400: - ldrb r0, [r1] - cmp r0, r6 - bne _08044416 - cmp r4, r10 - beq _08044416 - strb r6, [r3] - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_08044416: - adds r1, 0x58 - adds r4, 0x1 - cmp r4, r2 - blt _08044400 -_0804441E: - mov r1, r9 - cmp r1, 0 - beq _0804443A -_08044424: - ldr r2, [sp, 0x4] - cmp r2, 0xB - bhi _0804443A - ldr r1, =0x0202420a - ldrb r0, [r1] - cmp r0, 0xFF - beq _0804443A - adds r1, r0, 0 - mov r0, r10 - bl b_history__record_ability_usage_of_player -_0804443A: - mov r0, r9 - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end ability_something - - thumb_func_start b_call_bc_move_exec -b_call_bc_move_exec: @ 8044458 - ldr r1, =0x02024214 - str r0, [r1] - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r2, [r0, 0xC] - adds r3, r2, 0 - adds r3, 0x20 - ldrb r0, [r3] - adds r1, r0, 0x1 - strb r1, [r3] - lsls r0, 24 - lsrs r0, 22 - adds r2, r0 - ldr r1, =0x03005d04 - ldr r0, [r1] - str r0, [r2] - ldr r0, =bc_move_exec_returning - str r0, [r1] - ldr r1, =0x02024083 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end b_call_bc_move_exec - - thumb_func_start b_push_move_exec -b_push_move_exec: @ 8044498 - push {r4,lr} - adds r4, r0, 0 - bl b_movescr_stack_push_cursor - ldr r0, =0x02024214 - str r4, [r0] - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r2, [r0, 0xC] - adds r3, r2, 0 - adds r3, 0x20 - ldrb r0, [r3] - adds r1, r0, 0x1 - strb r1, [r3] - lsls r0, 24 - lsrs r0, 22 - adds r2, r0 - ldr r1, =0x03005d04 - ldr r0, [r1] - str r0, [r2] - ldr r0, =sub_803E08C - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end b_push_move_exec - - thumb_func_start berry_effects_maybe -berry_effects_maybe: @ 80444DC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - movs r0, 0 - mov r10, r0 - movs r1, 0 - str r1, [sp, 0xC] - add r0, sp, 0x4 - strb r1, [r0] - ldr r4, =0x02024208 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r7 - adds r0, r1 - ldrh r0, [r0, 0x2E] - strh r0, [r4] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAF - bne _08044534 - ldr r1, =0x02024404 - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r1 - ldrb r5, [r0, 0x7] - ldrb r0, [r0, 0x1A] - b _08044548 - .pool -_08044534: - ldrh r0, [r4] - bl itemid_get_x12 - lsls r0, 24 - lsrs r5, r0, 24 - ldrh r0, [r4] - bl itemid_get_quality - lsls r0, 24 - lsrs r0, 24 -_08044548: - mov r9, r0 - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x2E] - str r0, [sp, 0x14] - cmp r0, 0xAF - bne _0804457C - ldr r1, =0x02024404 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r3, [r0, 0x7] - mov r8, r3 - ldrb r0, [r0, 0x1A] - b _08044592 - .pool -_0804457C: - ldr r0, [sp, 0x14] - bl itemid_get_x12 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, [sp, 0x14] - bl itemid_get_quality - lsls r0, 24 - lsrs r0, 24 -_08044592: - str r0, [sp, 0x10] - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r4, [r0, 0x2E] - cmp r4, 0xAF - beq _080445B2 - adds r0, r4, 0 - bl itemid_get_x12 - adds r0, r4, 0 - bl itemid_get_quality -_080445B2: - ldr r0, [sp, 0x8] - cmp r0, 0x4 - bls _080445BC - bl _0804582A -_080445BC: - lsls r0, 2 - ldr r1, =_080445D4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080445D4: - .4byte _080445E8 - .4byte _08044688 - .4byte _0804582A - .4byte _08045280 - .4byte _080456D0 -_080445E8: - cmp r5, 0x17 - beq _08044618 - cmp r5, 0x20 - beq _080445F4 - bl _0804582A -_080445F4: - adds r0, r7, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08044604 - bl _0804582A -_08044604: - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x4A - movs r1, 0x2 - strb r1, [r0] - bl _0804582A - .pool -_08044618: - ldr r1, =0x02024084 - mov r8, r1 - movs r0, 0x58 - adds r1, r7, 0 - muls r1, r0 - mov r0, r8 - adds r0, 0x18 - adds r1, r0 - movs r2, 0x6 - movs r3, 0x7 - mov r10, r3 -_0804462E: - movs r0, 0 - ldrsb r0, [r1, r0] - cmp r0, 0x5 - bgt _0804463C - strb r2, [r1] - movs r5, 0x5 - str r5, [sp, 0xC] -_0804463C: - adds r1, 0x1 - movs r0, 0x1 - negs r0, r0 - add r10, r0 - mov r3, r10 - cmp r3, 0 - bge _0804462E - ldr r5, [sp, 0xC] - cmp r5, 0 - bne _08044654 - bl _0804582A -_08044654: - ldr r0, =0x02024474 - strb r7, [r0, 0x17] - ldr r0, =0x0202420f - strb r7, [r0] - ldr r1, =0x02024064 - ldr r0, =0x0202420b - strb r7, [r0] - strb r7, [r1] - ldr r0, =gUnknown_082DB7AE - bl b_call_bc_move_exec - bl _0804582A - .pool -_08044688: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r7 - adds r0, r1 - ldrh r0, [r0, 0x28] - mov r8, r1 - cmp r0, 0 - bne _0804469C - bl _0804582A -_0804469C: - subs r0, r5, 0x1 - cmp r0, 0x2A - bls _080446A6 - bl _080451D6 -_080446A6: - lsls r0, 2 - ldr r1, =_080446B8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080446B8: - .4byte _08044764 - .4byte _08044F44 - .4byte _08045008 - .4byte _08044F74 - .4byte _08044FA8 - .4byte _08044FD8 - .4byte _080447B0 - .4byte _08045044 - .4byte _08045074 - .4byte _0804497C - .4byte _080449FC - .4byte _08044A78 - .4byte _08044B0C - .4byte _08044BA0 - .4byte _08044C34 - .4byte _08044C9C - .4byte _08044CF0 - .4byte _08044D44 - .4byte _08044DAC - .4byte _08044E10 - .4byte _08044E5C - .4byte _080451D6 - .4byte _080448B0 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451A0 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _080451D6 - .4byte _0804491C -_08044764: - movs r0, 0x58 - muls r0, r7 - mov r1, r8 - adds r2, r0, r1 - ldrh r0, [r2, 0x2C] - ldrh r1, [r2, 0x28] - lsrs r0, 1 - cmp r1, r0 - bls _0804477A - bl _080451D6 -_0804477A: - cmp r6, 0 - beq _08044782 - bl _080451D6 -_08044782: - ldr r4, =0x020241f0 - mov r3, r9 - str r3, [r4] - ldrh r3, [r2, 0x28] - mov r5, r9 - adds r0, r3, r5 - ldrh r1, [r2, 0x2C] - cmp r0, r1 - ble _08044798 - subs r0, r1, r3 - str r0, [r4] -_08044798: - ldr r0, [r4] - negs r0, r0 - str r0, [r4] - ldr r0, =gUnknown_082DB7C4 - bl b_call_bc_move_exec - b _08044B02 - .pool -_080447B0: - cmp r6, 0 - beq _080447B8 - bl _080451D6 -_080447B8: - adds r0, r7, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080447DC - ldr r1, =0x0202406e - lsls r0, r7, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - b _080447EA - .pool -_080447DC: - ldr r1, =0x0202406e - lsls r0, r7, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 -_080447EA: - adds r4, r1, r0 - movs r1, 0 - mov r10, r1 - add r5, sp, 0x4 -_080447F2: - mov r1, r10 - adds r1, 0xD - adds r0, r4, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r6, r0, 16 - mov r1, r10 - adds r1, 0x11 - adds r0, r4, 0 - bl pokemon_getattr - strb r0, [r5] - adds r0, r4, 0 - movs r1, 0x15 - bl pokemon_getattr - lsls r0, 24 - lsrs r1, r0, 24 - cmp r6, 0 - beq _08044822 - ldrb r0, [r5] - cmp r0, 0 - beq _0804482C -_08044822: - movs r2, 0x1 - add r10, r2 - mov r3, r10 - cmp r3, 0x3 - ble _080447F2 -_0804482C: - mov r5, r10 - cmp r5, 0x4 - bne _08044836 - bl _080451D6 -_08044836: - lsls r2, r5, 24 - lsrs r2, 24 - adds r0, r6, 0 - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r2, r0, 24 - add r0, sp, 0x4 - ldrb r0, [r0] - mov r3, r9 - adds r1, r0, r3 - cmp r1, r2 - ble _08044860 - add r0, sp, 0x4 - strb r2, [r0] - b _08044864 - .pool -_08044860: - add r0, sp, 0x4 - strb r1, [r0] -_08044864: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - strb r6, [r1, 0x2] - lsrs r0, r6, 8 - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r0, =gUnknown_082DB7E1 - bl b_call_bc_move_exec - mov r1, r10 - adds r1, 0x9 - lsls r1, 24 - lsrs r1, 24 - add r5, sp, 0x4 - str r5, [sp] - movs r0, 0 - movs r2, 0 - movs r3, 0x1 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - movs r0, 0x3 - str r0, [sp, 0xC] - bl _080451DE - .pool -_080448B0: - ldr r0, =0x02024084 - movs r1, 0x58 - muls r1, r7 - adds r0, 0x18 - adds r1, r0 - movs r2, 0x6 - movs r3, 0x7 - mov r10, r3 -_080448C0: - movs r0, 0 - ldrsb r0, [r1, r0] - cmp r0, 0x5 - bgt _080448CE - strb r2, [r1] - movs r5, 0x5 - str r5, [sp, 0xC] -_080448CE: - adds r1, 0x1 - movs r0, 0x1 - negs r0, r0 - add r10, r0 - mov r3, r10 - cmp r3, 0 - bge _080448C0 - movs r5, 0x8 - mov r10, r5 - ldr r0, [sp, 0xC] - cmp r0, 0 - bne _080448EA - bl _0804582A -_080448EA: - ldr r0, =0x02024474 - strb r7, [r0, 0x17] - ldr r0, =0x0202420f - strb r7, [r0] - ldr r1, =0x02024064 - ldr r0, =0x0202420b - strb r7, [r0] - strb r7, [r1] - ldr r0, =gUnknown_082DB7AE - bl b_call_bc_move_exec - bl _080451D6 - .pool -_0804491C: - movs r0, 0x58 - muls r0, r7 - mov r2, r8 - adds r1, r0, r2 - ldrh r0, [r1, 0x28] - ldrh r3, [r1, 0x2C] - cmp r0, r3 - bcc _08044930 - bl _080451D6 -_08044930: - cmp r6, 0 - beq _08044938 - bl _080451D6 -_08044938: - ldr r3, =0x020241f0 - ldrh r0, [r1, 0x2C] - lsrs r0, 4 - str r0, [r3] - cmp r0, 0 - bne _08044948 - movs r0, 0x1 - str r0, [r3] -_08044948: - ldrh r2, [r1, 0x28] - ldr r0, [r3] - adds r0, r2, r0 - ldrh r1, [r1, 0x2C] - cmp r0, r1 - ble _08044958 - subs r0, r1, r2 - str r0, [r3] -_08044958: - ldr r0, [r3] - negs r0, r0 - str r0, [r3] - ldr r0, =gUnknown_082DB7F1 - bl b_call_bc_move_exec - movs r0, 0x4 - str r0, [sp, 0xC] - adds r0, r7, 0 - adds r1, r5, 0 - bl b_history__record_item_x12_of_player - bl _080451D6 - .pool -_0804497C: - movs r0, 0x58 - adds r1, r7, 0 - muls r1, r0 - str r1, [sp, 0x18] - adds r4, r1, 0 - add r4, r8 - ldrh r0, [r4, 0x2C] - ldrh r1, [r4, 0x28] - lsrs r0, 1 - cmp r1, r0 - bls _08044996 - bl _080451D6 -_08044996: - cmp r6, 0 - beq _0804499E - bl _080451D6 -_0804499E: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x8 - strb r0, [r1, 0x1] - strb r6, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r5, =0x020241f0 - ldrh r0, [r4, 0x2C] - mov r1, r9 - bl __divsi3 - str r0, [r5] - cmp r0, 0 - bne _080449C2 - movs r0, 0x1 - str r0, [r5] -_080449C2: - ldrh r2, [r4, 0x28] - ldr r0, [r5] - adds r0, r2, r0 - ldrh r1, [r4, 0x2C] - cmp r0, r1 - ble _080449D2 - subs r0, r1, r2 - str r0, [r5] -_080449D2: - ldr r0, [r5] - negs r0, r0 - str r0, [r5] - mov r0, r8 - adds r0, 0x48 - ldr r2, [sp, 0x18] - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0 - bl sub_806E880 - lsls r0, 24 - cmp r0, 0 - bge _080449F0 - b _08044B7C -_080449F0: - b _08044B90 - .pool -_080449FC: - movs r0, 0x58 - adds r5, r7, 0 - muls r5, r0 - str r5, [sp, 0x1C] - add r5, r8 - ldrh r0, [r5, 0x2C] - ldrh r1, [r5, 0x28] - lsrs r0, 1 - cmp r1, r0 - bls _08044A14 - bl _080451D6 -_08044A14: - cmp r6, 0 - beq _08044A1C - bl _080451D6 -_08044A1C: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x8 - strb r0, [r1, 0x1] - movs r6, 0x1 - strb r6, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r4, =0x020241f0 - ldrh r0, [r5, 0x2C] - mov r1, r9 - bl __divsi3 - str r0, [r4] - cmp r0, 0 - bne _08044A40 - str r6, [r4] -_08044A40: - ldrh r2, [r5, 0x28] - ldr r0, [r4] - adds r0, r2, r0 - ldrh r1, [r5, 0x2C] - cmp r0, r1 - ble _08044A50 - subs r0, r1, r2 - str r0, [r4] -_08044A50: - ldr r0, [r4] - negs r0, r0 - str r0, [r4] - mov r0, r8 - adds r0, 0x48 - ldr r1, [sp, 0x1C] - adds r0, r1, r0 - ldr r0, [r0] - movs r1, 0x1 - bl sub_806E880 - lsls r0, 24 - cmp r0, 0 - bge _08044A6E - b _08044C0E -_08044A6E: - b _08044C24 - .pool -_08044A78: - movs r0, 0x58 - adds r3, r7, 0 - muls r3, r0 - str r3, [sp, 0x20] - adds r5, r3, 0 - add r5, r8 - ldrh r0, [r5, 0x2C] - ldrh r1, [r5, 0x28] - lsrs r0, 1 - cmp r1, r0 - bls _08044A90 - b _080451D6 -_08044A90: - cmp r6, 0 - beq _08044A96 - b _080451D6 -_08044A96: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x8 - strb r0, [r1, 0x1] - movs r0, 0x2 - strb r0, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r4, =0x020241f0 - ldrh r0, [r5, 0x2C] - mov r1, r9 - bl __divsi3 - str r0, [r4] - cmp r0, 0 - bne _08044ABC - movs r0, 0x1 - str r0, [r4] -_08044ABC: - ldrh r2, [r5, 0x28] - ldr r0, [r4] - adds r0, r2, r0 - ldrh r1, [r5, 0x2C] - cmp r0, r1 - ble _08044ACC - subs r0, r1, r2 - str r0, [r4] -_08044ACC: - ldr r0, [r4] - negs r0, r0 - str r0, [r4] - mov r0, r8 - adds r0, 0x48 - ldr r5, [sp, 0x20] - adds r0, r5, r0 - ldr r0, [r0] - movs r1, 0x2 - bl sub_806E880 - lsls r0, 24 - cmp r0, 0 - bge _08044AFC - ldr r0, =gUnknown_082DB824 - bl b_call_bc_move_exec - b _08044B02 - .pool -_08044AFC: - ldr r0, =gUnknown_082DB7C4 - bl b_call_bc_move_exec -_08044B02: - movs r0, 0x4 - str r0, [sp, 0xC] - b _080451DE - .pool -_08044B0C: - movs r0, 0x58 - adds r1, r7, 0 - muls r1, r0 - str r1, [sp, 0x24] - adds r5, r1, 0 - add r5, r8 - ldrh r0, [r5, 0x2C] - ldrh r1, [r5, 0x28] - lsrs r0, 1 - cmp r1, r0 - bls _08044B24 - b _080451D6 -_08044B24: - cmp r6, 0 - beq _08044B2A - b _080451D6 -_08044B2A: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x8 - strb r0, [r1, 0x1] - movs r0, 0x3 - strb r0, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r4, =0x020241f0 - ldrh r0, [r5, 0x2C] - mov r1, r9 - bl __divsi3 - str r0, [r4] - cmp r0, 0 - bne _08044B50 - movs r0, 0x1 - str r0, [r4] -_08044B50: - ldrh r2, [r5, 0x28] - ldr r0, [r4] - adds r0, r2, r0 - ldrh r1, [r5, 0x2C] - cmp r0, r1 - ble _08044B60 - subs r0, r1, r2 - str r0, [r4] -_08044B60: - ldr r0, [r4] - negs r0, r0 - str r0, [r4] - mov r0, r8 - adds r0, 0x48 - ldr r2, [sp, 0x24] - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x3 - bl sub_806E880 - lsls r0, 24 - cmp r0, 0 - bge _08044B90 -_08044B7C: - ldr r0, =gUnknown_082DB824 - bl b_call_bc_move_exec - b _08044B96 - .pool -_08044B90: - ldr r0, =gUnknown_082DB7C4 - bl b_call_bc_move_exec -_08044B96: - movs r3, 0x4 - str r3, [sp, 0xC] - b _080451DE - .pool -_08044BA0: - movs r0, 0x58 - adds r5, r7, 0 - muls r5, r0 - str r5, [sp, 0x28] - add r5, r8 - ldrh r0, [r5, 0x2C] - ldrh r1, [r5, 0x28] - lsrs r0, 1 - cmp r1, r0 - bls _08044BB6 - b _080451D6 -_08044BB6: - cmp r6, 0 - beq _08044BBC - b _080451D6 -_08044BBC: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x8 - strb r0, [r1, 0x1] - movs r0, 0x4 - strb r0, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r4, =0x020241f0 - ldrh r0, [r5, 0x2C] - mov r1, r9 - bl __divsi3 - str r0, [r4] - cmp r0, 0 - bne _08044BE2 - movs r0, 0x1 - str r0, [r4] -_08044BE2: - ldrh r2, [r5, 0x28] - ldr r0, [r4] - adds r0, r2, r0 - ldrh r1, [r5, 0x2C] - cmp r0, r1 - ble _08044BF2 - subs r0, r1, r2 - str r0, [r4] -_08044BF2: - ldr r0, [r4] - negs r0, r0 - str r0, [r4] - mov r0, r8 - adds r0, 0x48 - ldr r1, [sp, 0x28] - adds r0, r1, r0 - ldr r0, [r0] - movs r1, 0x4 - bl sub_806E880 - lsls r0, 24 - cmp r0, 0 - bge _08044C24 -_08044C0E: - ldr r0, =gUnknown_082DB824 - bl b_call_bc_move_exec - b _08044C2A - .pool -_08044C24: - ldr r0, =gUnknown_082DB7C4 - bl b_call_bc_move_exec -_08044C2A: - movs r2, 0x4 - str r2, [sp, 0xC] - b _080451DE - .pool -_08044C34: - movs r0, 0x58 - muls r0, r7 - mov r3, r8 - adds r5, r0, r3 - ldrh r4, [r5, 0x28] - ldrh r0, [r5, 0x2C] - mov r1, r9 - bl __divsi3 - cmp r4, r0 - ble _08044C4C - b _080451D6 -_08044C4C: - cmp r6, 0 - beq _08044C52 - b _080451D6 -_08044C52: - movs r0, 0x19 - ldrsb r0, [r5, r0] - cmp r0, 0xB - ble _08044C5C - b _080451D6 -_08044C5C: - ldr r1, =0x02022f58 - movs r2, 0xFD - strb r2, [r1] - movs r0, 0x5 - strb r0, [r1, 0x1] - movs r0, 0x1 - strb r0, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r1, =0x02022f68 - strb r2, [r1] - strb r6, [r1, 0x1] - movs r0, 0xD2 - strb r0, [r1, 0x2] - strb r6, [r1, 0x3] - subs r0, 0xD3 - strb r0, [r1, 0x4] - ldr r0, =0x0202420e - strb r7, [r0] - ldr r1, =0x02024474 - movs r0, 0x11 - strb r0, [r1, 0x1A] - movs r0, 0xF - b _08044DF0 - .pool -_08044C9C: - movs r0, 0x58 - muls r0, r7 - mov r1, r8 - adds r5, r0, r1 - ldrh r4, [r5, 0x28] - ldrh r0, [r5, 0x2C] - mov r1, r9 - bl __divsi3 - cmp r4, r0 - ble _08044CB4 - b _080451D6 -_08044CB4: - cmp r6, 0 - beq _08044CBA - b _080451D6 -_08044CBA: - movs r0, 0x1A - ldrsb r0, [r5, r0] - cmp r0, 0xB - ble _08044CC4 - b _080451D6 -_08044CC4: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x5 - strb r0, [r1, 0x1] - movs r0, 0x2 - strb r0, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r0, =0x0202420e - strb r7, [r0] - ldr r1, =0x02024474 - movs r0, 0x12 - strb r0, [r1, 0x1A] - movs r0, 0x10 - b _08044D8A - .pool -_08044CF0: - movs r0, 0x58 - muls r0, r7 - mov r3, r8 - adds r5, r0, r3 - ldrh r4, [r5, 0x28] - ldrh r0, [r5, 0x2C] - mov r1, r9 - bl __divsi3 - cmp r4, r0 - ble _08044D08 - b _080451D6 -_08044D08: - cmp r6, 0 - beq _08044D0E - b _080451D6 -_08044D0E: - movs r0, 0x1B - ldrsb r0, [r5, r0] - cmp r0, 0xB - ble _08044D18 - b _080451D6 -_08044D18: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x5 - strb r0, [r1, 0x1] - movs r0, 0x3 - strb r0, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r0, =0x0202420e - strb r7, [r0] - ldr r1, =0x02024474 - movs r0, 0x13 - strb r0, [r1, 0x1A] - movs r0, 0x11 - b _08044DF0 - .pool -_08044D44: - movs r0, 0x58 - muls r0, r7 - mov r1, r8 - adds r5, r0, r1 - ldrh r4, [r5, 0x28] - ldrh r0, [r5, 0x2C] - mov r1, r9 - bl __divsi3 - cmp r4, r0 - ble _08044D5C - b _080451D6 -_08044D5C: - cmp r6, 0 - beq _08044D62 - b _080451D6 -_08044D62: - movs r0, 0x1C - ldrsb r0, [r5, r0] - cmp r0, 0xB - ble _08044D6C - b _080451D6 -_08044D6C: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x5 - strb r0, [r1, 0x1] - movs r0, 0x4 - strb r0, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r0, =0x0202420e - strb r7, [r0] - ldr r1, =0x02024474 - movs r0, 0x14 - strb r0, [r1, 0x1A] - movs r0, 0x12 -_08044D8A: - strb r0, [r1, 0x10] - strb r6, [r1, 0x11] - ldr r0, =gUnknown_082DB84E - bl b_call_bc_move_exec - movs r2, 0x5 - str r2, [sp, 0xC] - b _080451DE - .pool -_08044DAC: - movs r0, 0x58 - muls r0, r7 - mov r3, r8 - adds r5, r0, r3 - ldrh r4, [r5, 0x28] - ldrh r0, [r5, 0x2C] - mov r1, r9 - bl __divsi3 - cmp r4, r0 - ble _08044DC4 - b _080451D6 -_08044DC4: - cmp r6, 0 - beq _08044DCA - b _080451D6 -_08044DCA: - movs r0, 0x1D - ldrsb r0, [r5, r0] - cmp r0, 0xB - ble _08044DD4 - b _080451D6 -_08044DD4: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x5 - strb r0, [r1, 0x1] - strb r0, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r0, =0x0202420e - strb r7, [r0] - ldr r1, =0x02024474 - movs r0, 0x15 - strb r0, [r1, 0x1A] - movs r0, 0x13 -_08044DF0: - strb r0, [r1, 0x10] - strb r6, [r1, 0x11] - ldr r0, =gUnknown_082DB84E - bl b_call_bc_move_exec - movs r5, 0x5 - str r5, [sp, 0xC] - b _080451DE - .pool -_08044E10: - movs r0, 0x58 - adds r5, r7, 0 - muls r5, r0 - mov r1, r8 - adds r0, r5, r1 - ldrh r4, [r0, 0x28] - ldrh r0, [r0, 0x2C] - mov r1, r9 - bl __divsi3 - cmp r4, r0 - ble _08044E2A - b _080451D6 -_08044E2A: - cmp r6, 0 - beq _08044E30 - b _080451D6 -_08044E30: - mov r0, r8 - adds r0, 0x50 - adds r1, r5, r0 - ldr r2, [r1] - movs r3, 0x80 - lsls r3, 13 - adds r0, r2, 0 - ands r0, r3 - cmp r0, 0 - beq _08044E46 - b _080451D6 -_08044E46: - orrs r2, r3 - str r2, [r1] - ldr r0, =gUnknown_082DB869 - bl b_call_bc_move_exec - movs r2, 0x2 - str r2, [sp, 0xC] - b _080451DE - .pool -_08044E5C: - cmp r6, 0 - beq _08044E62 - b _080451D6 -_08044E62: - movs r0, 0x58 - adds r5, r7, 0 - muls r5, r0 - mov r3, r8 - adds r0, r5, r3 - ldrh r4, [r0, 0x28] - ldrh r0, [r0, 0x2C] - mov r1, r9 - bl __divsi3 - cmp r4, r0 - ble _08044E7C - b _080451D6 -_08044E7C: - movs r0, 0 - mov r10, r0 - adds r0, r5, 0x1 - mov r1, r8 - adds r1, 0x18 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0xB - ble _08044EAC - mov r0, r8 - adds r0, 0x19 - adds r1, r5, r0 -_08044E98: - adds r1, 0x1 - movs r2, 0x1 - add r10, r2 - mov r3, r10 - cmp r3, 0x4 - bgt _08044EAC - movs r0, 0 - ldrsb r0, [r1, r0] - cmp r0, 0xB - bgt _08044E98 -_08044EAC: - mov r5, r10 - cmp r5, 0x5 - bne _08044EB4 - b _080451D6 -_08044EB4: - movs r0, 0x58 - muls r0, r7 - adds r4, r0, 0x1 - ldr r5, =0x0202409c -_08044EBC: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x5 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - adds r0, r4 - adds r0, r5 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0xC - beq _08044EBC - ldr r1, =0x02022f58 - movs r2, 0 - movs r3, 0xFD - strb r3, [r1] - movs r0, 0x5 - strb r0, [r1, 0x1] - mov r0, r10 - adds r0, 0x1 - strb r0, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r0, =0x02022f68 - strb r3, [r0] - strb r2, [r0, 0x1] - movs r1, 0xD1 - strb r1, [r0, 0x2] - strb r2, [r0, 0x3] - strb r2, [r0, 0x4] - movs r1, 0xD2 - strb r1, [r0, 0x5] - strb r2, [r0, 0x6] - subs r1, 0xD3 - strb r1, [r0, 0x7] - ldr r0, =0x0202420e - strb r7, [r0] - ldr r1, =0x02024474 - mov r0, r10 - adds r0, 0x21 - strb r0, [r1, 0x1A] - adds r0, 0x6 - strb r0, [r1, 0x10] - strb r2, [r1, 0x11] - ldr r0, =gUnknown_082DB84E - bl b_call_bc_move_exec - movs r0, 0x5 - str r0, [sp, 0xC] - b _080451DE - .pool -_08044F44: - movs r0, 0x58 - adds r1, r7, 0 - muls r1, r0 - mov r0, r8 - adds r0, 0x4C - adds r1, r0 - ldr r2, [r1] - movs r0, 0x40 - ands r0, r2 - cmp r0, 0 - bne _08044F5C - b _080451D6 -_08044F5C: - movs r0, 0x41 - negs r0, r0 - ands r2, r0 - str r2, [r1] - ldr r0, =gUnknown_082DB706 - bl b_call_bc_move_exec - movs r1, 0x1 - str r1, [sp, 0xC] - b _080451DE - .pool -_08044F74: - movs r0, 0x58 - adds r1, r7, 0 - muls r1, r0 - mov r0, r8 - adds r0, 0x4C - adds r1, r0 - ldr r2, [r1] - movs r0, 0x88 - ands r0, r2 - cmp r0, 0 - bne _08044F8C - b _080451D6 -_08044F8C: - ldr r0, =0xfffff077 - ands r2, r0 - str r2, [r1] - ldr r0, =gUnknown_082DB71E - bl b_call_bc_move_exec - movs r2, 0x1 - str r2, [sp, 0xC] - b _080451DE - .pool -_08044FA8: - movs r0, 0x58 - adds r1, r7, 0 - muls r1, r0 - mov r0, r8 - adds r0, 0x4C - adds r1, r0 - ldr r2, [r1] - movs r0, 0x10 - ands r0, r2 - cmp r0, 0 - bne _08044FC0 - b _080451D6 -_08044FC0: - movs r0, 0x11 - negs r0, r0 - ands r2, r0 - str r2, [r1] - ldr r0, =gUnknown_082DB736 - bl b_call_bc_move_exec - movs r3, 0x1 - str r3, [sp, 0xC] - b _080451DE - .pool -_08044FD8: - movs r0, 0x58 - adds r1, r7, 0 - muls r1, r0 - mov r0, r8 - adds r0, 0x4C - adds r1, r0 - ldr r2, [r1] - movs r0, 0x20 - ands r0, r2 - cmp r0, 0 - bne _08044FF0 - b _080451D6 -_08044FF0: - movs r0, 0x21 - negs r0, r0 - ands r2, r0 - str r2, [r1] - ldr r0, =gUnknown_082DB74E - bl b_call_bc_move_exec - movs r5, 0x1 - str r5, [sp, 0xC] - b _080451DE - .pool -_08045008: - movs r0, 0x58 - adds r3, r7, 0 - muls r3, r0 - mov r0, r8 - adds r0, 0x4C - adds r2, r3, r0 - ldr r1, [r2] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _08045020 - b _080451D6 -_08045020: - movs r0, 0x8 - negs r0, r0 - ands r1, r0 - str r1, [r2] - mov r1, r8 - adds r1, 0x50 - adds r1, r3, r1 - ldr r0, [r1] - ldr r2, =0xf7ffffff - ands r0, r2 - str r0, [r1] - ldr r0, =gUnknown_082DB766 - b _0804518A - .pool -_08045044: - movs r0, 0x58 - adds r1, r7, 0 - muls r1, r0 - mov r0, r8 - adds r0, 0x50 - adds r1, r0 - ldr r2, [r1] - movs r0, 0x7 - ands r0, r2 - cmp r0, 0 - bne _0804505C - b _080451D6 -_0804505C: - movs r0, 0x8 - negs r0, r0 - ands r2, r0 - str r2, [r1] - ldr r0, =gUnknown_082DB77E - bl b_call_bc_move_exec - movs r1, 0x2 - str r1, [sp, 0xC] - b _080451DE - .pool -_08045074: - movs r0, 0x58 - adds r5, r7, 0 - muls r5, r0 - mov r0, r8 - adds r0, 0x4C - adds r4, r5, r0 - ldr r2, [r4] - ldrb r0, [r4] - cmp r0, 0 - bne _0804509A - mov r0, r8 - adds r0, 0x50 - adds r0, r5, r0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0804509A - b _080451D6 -_0804509A: - movs r3, 0 - mov r10, r3 - movs r0, 0x88 - ands r2, r0 - cmp r2, 0 - beq _080450B2 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC70 - bl CopyString - movs r0, 0x1 - mov r10, r0 -_080450B2: - ldr r0, [r4] - movs r1, 0x7 - mov r9, r1 - ands r0, r1 - mov r6, r8 - adds r6, 0x50 - cmp r0, 0 - beq _080450D8 - adds r2, r5, r6 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC78 - bl CopyString - movs r2, 0x1 - add r10, r2 -_080450D8: - ldr r0, [r4] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080450EE - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC80 - bl CopyString - movs r3, 0x1 - add r10, r3 -_080450EE: - ldr r0, [r4] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08045104 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC88 - bl CopyString - movs r0, 0x1 - add r10, r0 -_08045104: - ldr r0, [r4] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0804511A - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC90 - bl CopyString - movs r1, 0x1 - add r10, r1 -_0804511A: - adds r0, r5, r6 - ldr r0, [r0] - mov r2, r9 - ands r0, r2 - cmp r0, 0 - beq _08045132 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC98 - bl CopyString - movs r3, 0x1 - add r10, r3 -_08045132: - mov r5, r10 - cmp r5, 0x1 - bgt _08045164 - ldr r1, =0x02024332 - movs r0, 0 - b _08045168 - .pool -_08045164: - ldr r1, =0x02024332 - movs r0, 0x1 -_08045168: - strb r0, [r1, 0x5] - ldr r2, =0x02024084 - movs r0, 0x58 - adds r3, r7, 0 - muls r3, r0 - adds r0, r2, 0 - adds r0, 0x4C - adds r0, r3, r0 - movs r1, 0 - str r1, [r0] - adds r2, 0x50 - adds r3, r2 - ldr r0, [r3] - subs r1, 0x8 - ands r0, r1 - str r0, [r3] - ldr r0, =gUnknown_082DB794 -_0804518A: - bl b_call_bc_move_exec - movs r0, 0x1 - str r0, [sp, 0xC] - b _080451DE - .pool -_080451A0: - movs r0, 0x58 - adds r1, r7, 0 - muls r1, r0 - mov r0, r8 - adds r0, 0x50 - adds r1, r0 - ldr r2, [r1] - movs r0, 0xF0 - lsls r0, 12 - ands r0, r2 - cmp r0, 0 - beq _080451D6 - ldr r0, =0xfff0ffff - ands r2, r0 - str r2, [r1] - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BCA0 - bl CopyString - ldr r0, =gUnknown_082DB794 - bl b_call_bc_move_exec - ldr r1, =0x02024332 - movs r0, 0 - strb r0, [r1, 0x5] - movs r1, 0x2 - str r1, [sp, 0xC] -_080451D6: - ldr r2, [sp, 0xC] - cmp r2, 0 - bne _080451DE - b _0804582A -_080451DE: - ldr r0, =0x02024474 - strb r7, [r0, 0x17] - ldr r0, =0x0202420f - strb r7, [r0] - ldr r4, =0x02024064 - ldr r0, =0x0202420b - strb r7, [r0] - strb r7, [r4] - ldr r3, [sp, 0xC] - cmp r3, 0x1 - beq _08045220 - cmp r3, 0x3 - beq _08045226 - b _0804582A - .pool -_08045220: - movs r0, 0x58 - muls r0, r7 - b _0804568C -_08045226: - ldr r4, =0x02024084 - movs r0, 0x58 - adds r3, r7, 0 - muls r3, r0 - adds r0, r4, 0 - adds r0, 0x50 - adds r0, r3, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - beq _08045242 - b _0804582A -_08045242: - ldr r1, =0x020242bc - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gUnknown_0832A328 - mov r5, r10 - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08045262 - b _0804582A -_08045262: - adds r1, r5, r3 - adds r0, r4, 0 - adds r0, 0x24 - adds r1, r0 - add r0, sp, 0x4 - ldrb r0, [r0] - strb r0, [r1] - b _0804582A - .pool -_08045280: - movs r7, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r7, r0 - bcc _0804528C - b _0804582A -_0804528C: - ldr r4, =0x02024208 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r7 - adds r0, r1 - ldrh r0, [r0, 0x2E] - strh r0, [r4] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAF - bne _080452C0 - ldr r1, =0x02024404 - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r1 - ldrb r5, [r0, 0x7] - b _080452D0 - .pool -_080452C0: - ldrh r0, [r4] - bl itemid_get_x12 - lsls r0, 24 - lsrs r5, r0, 24 - ldrh r0, [r4] - bl itemid_get_quality -_080452D0: - subs r0, r5, 0x2 - cmp r0, 0x1A - bls _080452D8 - b _08045674 -_080452D8: - lsls r0, 2 - ldr r1, =_080452E8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080452E8: - .4byte _08045354 - .4byte _08045444 - .4byte _08045390 - .4byte _080453CC - .4byte _08045408 - .4byte _08045674 - .4byte _0804548C - .4byte _08045520 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045614 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _08045674 - .4byte _080454C8 -_08045354: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r7 - adds r1, 0x4C - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0804536A - b _08045674 -_0804536A: - movs r0, 0x41 - negs r0, r0 - ands r1, r0 - str r1, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB70C - str r0, [r1] - movs r0, 0x1 - str r0, [sp, 0xC] - b _0804567A - .pool -_08045390: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r7 - adds r1, 0x4C - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0x88 - ands r0, r1 - cmp r0, 0 - bne _080453A6 - b _08045674 -_080453A6: - ldr r0, =0xfffff077 - ands r1, r0 - str r1, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB724 - str r0, [r1] - movs r1, 0x1 - str r1, [sp, 0xC] - b _0804567A - .pool -_080453CC: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r7 - adds r1, 0x4C - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _080453E2 - b _08045674 -_080453E2: - movs r0, 0x11 - negs r0, r0 - ands r1, r0 - str r1, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB73C - str r0, [r1] - movs r2, 0x1 - str r2, [sp, 0xC] - b _0804567A - .pool -_08045408: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r7 - adds r1, 0x4C - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _0804541E - b _08045674 -_0804541E: - movs r0, 0x21 - negs r0, r0 - ands r1, r0 - str r1, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB754 - str r0, [r1] - movs r3, 0x1 - str r3, [sp, 0xC] - b _0804567A - .pool -_08045444: - ldr r2, =0x02024084 - movs r0, 0x58 - adds r4, r7, 0 - muls r4, r0 - adds r0, r2, 0 - adds r0, 0x4C - adds r3, r4, r0 - ldr r1, [r3] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0804545E - b _08045674 -_0804545E: - movs r0, 0x8 - negs r0, r0 - ands r1, r0 - str r1, [r3] - adds r2, 0x50 - adds r2, r4, r2 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB76C - b _080455DC - .pool -_0804548C: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r7 - adds r1, 0x50 - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _080454A2 - b _08045674 -_080454A2: - movs r0, 0x8 - negs r0, r0 - ands r1, r0 - str r1, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB784 - str r0, [r1] - movs r0, 0x2 - str r0, [sp, 0xC] - b _0804567A - .pool -_080454C8: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r7 - adds r1, 0x50 - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0xF0 - lsls r0, 12 - ands r0, r1 - cmp r0, 0 - bne _080454E0 - b _08045674 -_080454E0: - ldr r0, =0xfff0ffff - ands r1, r0 - str r1, [r2] - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BCA0 - bl CopyString - bl b_movescr_stack_push_cursor - ldr r1, =0x02024332 - movs r0, 0 - strb r0, [r1, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB79A - str r0, [r1] - movs r1, 0x2 - str r1, [sp, 0xC] - b _0804567A - .pool -_08045520: - ldr r4, =0x02024084 - movs r0, 0x58 - adds r5, r7, 0 - muls r5, r0 - adds r0, r4, 0 - adds r0, 0x4C - adds r6, r5, r0 - ldr r2, [r6] - ldrb r0, [r6] - cmp r0, 0 - bne _08045548 - adds r0, r4, 0 - adds r0, 0x50 - adds r0, r5, r0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _08045548 - b _08045674 -_08045548: - movs r0, 0x88 - ands r2, r0 - cmp r2, 0 - beq _08045558 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC70 - bl CopyString -_08045558: - ldr r0, [r6] - movs r2, 0x7 - mov r8, r2 - ands r0, r2 - adds r4, 0x50 - cmp r0, 0 - beq _08045578 - adds r2, r5, r4 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC78 - bl CopyString -_08045578: - ldr r0, [r6] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0804558A - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC80 - bl CopyString -_0804558A: - ldr r0, [r6] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0804559C - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC88 - bl CopyString -_0804559C: - ldr r0, [r6] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080455AE - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC90 - bl CopyString -_080455AE: - adds r5, r4 - ldr r0, [r5] - mov r3, r8 - ands r0, r3 - cmp r0, 0 - beq _080455C2 - ldr r0, =0x02022f58 - ldr r1, =gUnknown_0831BC98 - bl CopyString -_080455C2: - movs r4, 0 - str r4, [r6] - ldr r0, [r5] - movs r1, 0x8 - negs r1, r1 - ands r0, r1 - str r0, [r5] - bl b_movescr_stack_push_cursor - ldr r0, =0x02024332 - strb r4, [r0, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB79A -_080455DC: - str r0, [r1] - movs r5, 0x1 - str r5, [sp, 0xC] - b _0804567A - .pool -_08045614: - ldr r0, =0x02024084 - mov r8, r0 - movs r0, 0x58 - adds r1, r7, 0 - muls r1, r0 - mov r0, r8 - adds r0, 0x18 - adds r1, r0 - movs r2, 0x6 - movs r3, 0x7 - mov r10, r3 -_0804562A: - movs r0, 0 - ldrsb r0, [r1, r0] - cmp r0, 0x5 - bgt _08045638 - strb r2, [r1] - movs r5, 0x5 - str r5, [sp, 0xC] -_08045638: - adds r1, 0x1 - movs r0, 0x1 - negs r0, r0 - add r10, r0 - mov r3, r10 - cmp r3, 0 - bge _0804562A - ldr r5, [sp, 0xC] - cmp r5, 0 - beq _080456B8 - ldr r0, =0x02024474 - strb r7, [r0, 0x17] - ldr r0, =0x0202420f - strb r7, [r0] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB7B4 - str r0, [r1] - b _0804582A - .pool -_08045674: - ldr r0, [sp, 0xC] - cmp r0, 0 - beq _080456B8 -_0804567A: - ldr r0, =0x02024474 - strb r7, [r0, 0x17] - ldr r0, =0x0202420f - strb r7, [r0] - ldr r4, =0x02024064 - strb r7, [r4] - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 -_0804568C: - ldr r1, =0x020240d0 - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _0804582A - .pool -_080456B8: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r7, r0 - bcs _080456C8 - b _0804528C -_080456C8: - b _0804582A - .pool -_080456D0: - ldr r7, =0x020241f0 - ldr r0, [r7] - cmp r0, 0 - bne _080456DA - b _0804582A -_080456DA: - mov r1, r8 - cmp r1, 0x1E - beq _080456EC - cmp r1, 0x3E - beq _08045794 - b _0804582A - .pool -_080456EC: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _080456FA - b _0804582A -_080456FA: - ldr r2, =0x0202437c - ldr r4, =0x0202420c - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r1, r0, 2 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08045720 - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08045720 - b _0804582A -_08045720: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - ldr r2, [sp, 0x10] - cmp r0, r2 - bcs _0804582A - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x8] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0804582A - ldr r2, =0x02024084 - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _0804582A - ldr r1, =0x02024332 - movs r0, 0x8 - strb r0, [r1, 0x3] - bl b_movescr_stack_push_cursor - movs r0, 0 - movs r1, 0 - bl sub_8048760 - bl b_movescr_stack_pop_cursor - b _0804582A - .pool -_08045794: - ldr r0, =0x0202427c - ldrb r0, [r0] - movs r5, 0x29 - ands r5, r0 - cmp r5, 0 - bne _0804582A - ldr r1, =0x0202437c - ldr r4, =0x0202420c - ldrb r2, [r4] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 2 - adds r6, r1, 0x4 - adds r0, r6 - ldr r1, [r0] - cmp r1, 0 - beq _0804582A - ldr r0, =0x0000ffff - cmp r1, r0 - beq _0804582A - ldr r0, =0x0202420b - ldrb r3, [r0] - cmp r3, r2 - beq _0804582A - ldr r2, =0x02024084 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r1, [r0, 0x28] - ldrh r0, [r0, 0x2C] - cmp r1, r0 - beq _0804582A - cmp r1, 0 - beq _0804582A - ldr r0, =0x02024208 - mov r1, sp - ldrh r1, [r1, 0x14] - strh r1, [r0] - ldr r0, =0x0202420f - strb r3, [r0] - ldr r0, =0x02024474 - strb r3, [r0, 0x17] - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - ldr r1, [sp, 0x10] - bl __divsi3 - negs r0, r0 - str r0, [r7] - ldrb r1, [r4] - cmp r0, 0 - bne _0804580C - movs r0, 0x1 - negs r0, r0 - str r0, [r7] -_0804580C: - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - str r5, [r0] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB7F7 - str r0, [r1] - ldr r0, [sp, 0xC] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0xC] -_0804582A: - ldr r0, [sp, 0xC] - 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 berry_effects_maybe - - thumb_func_start sub_8045868 -sub_8045868: @ 8045868 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x020242bc - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - movs r2, 0 - strb r2, [r1, 0x10] - ldr r1, =0x02024084 - movs r2, 0x58 - adds r3, r0, 0 - muls r3, r2 - adds r1, 0x50 - adds r3, r1 - ldr r1, [r3] - ldr r2, =0xfdffffff - ands r1, r2 - str r1, [r3] - ldr r1, =0x020242ac - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldr r2, =0xffffbfff - ands r1, r2 - str r1, [r0] - bx lr - .pool - thumb_func_end sub_8045868 - - thumb_func_start sub_80458B4 -sub_80458B4: @ 80458B4 - push {lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _080458D0 - ldr r1, =gUnknown_0831BD10 - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 -_080458D0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80458B4 - - thumb_func_start sub_80458E0 -sub_80458E0: @ 80458E0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 16 - lsrs r7, r0, 16 - lsls r1, 24 - lsrs r0, r1, 24 - movs r5, 0 - cmp r0, 0 - beq _080458FE - subs r0, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - b _0804590A -_080458FE: - ldr r1, =gBattleMoves - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 2 - adds r0, r1 - ldrb r6, [r0, 0x6] -_0804590A: - cmp r6, 0x40 - bls _08045910 - b _08045C20 -_08045910: - lsls r0, r6, 2 - ldr r1, =_08045924 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08045924: - .4byte _08045A28 - .4byte _08045B28 - .4byte _08045C1C - .4byte _08045C20 - .4byte _08045B40 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045B28 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C1C - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045B28 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045C20 - .4byte _08045B28 -_08045A28: - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x02024294 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r2, r0, r1 - ldrb r0, [r2, 0x8] - cmp r0, 0 - beq _08045A5A - ldr r1, =0x02024084 - ldrb r4, [r2, 0x9] - movs r0, 0x58 - muls r0, r4 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08045A5A - b _08045B70 -_08045A5A: - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r7, 1 - mov r8, r0 -_08045A6A: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x0202406c - ldrb r1, [r1] - bl __modsi3 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r6, =0x0202420b - ldrb r3, [r6] - cmp r5, r3 - beq _08045A6A - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - beq _08045A6A - ldr r0, =0x02024210 - ldrb r2, [r0] - ldr r1, =gUnknown_0832A328 - lsls r0, r5, 2 - adds r0, r1 - ldr r0, [r0] - ands r2, r0 - cmp r2, 0 - bne _08045A6A - ldr r0, =gBattleMoves - mov r3, r8 - adds r1, r3, r7 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x2] - cmp r0, 0xD - beq _08045AB8 - b _08045C20 -_08045AB8: - ldrb r1, [r6] - str r2, [sp] - movs r0, 0x10 - movs r2, 0x1F - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _08045ACE - b _08045C20 -_08045ACE: - ldr r2, =0x02024084 - movs r1, 0x58 - adds r0, r5, 0 - muls r0, r1 - adds r0, r2 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1F - bne _08045AE2 - b _08045C20 -_08045AE2: - movs r4, 0x2 - eors r5, r4 - adds r0, r5, 0 - muls r0, r1 - adds r0, r2 - adds r0, 0x20 - ldrb r1, [r0] - adds r0, r5, 0 - bl b_history__record_ability_usage_of_player - ldr r1, =0x0202437c - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - orrs r1, r4 - strb r1, [r0] - b _08045C20 - .pool -_08045B28: - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_get_per_side_status - adds r1, r0, 0 - movs r2, 0x1 - movs r0, 0x1 - ands r0, r1 - eors r0, r2 - b _08045BD2 - .pool -_08045B40: - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x02024294 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r2, r0, r1 - ldrb r0, [r2, 0x8] - cmp r0, 0 - beq _08045B80 - ldr r1, =0x02024084 - ldrb r4, [r2, 0x9] - movs r0, 0x58 - muls r0, r4 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08045B80 -_08045B70: - adds r5, r4, 0 - b _08045C20 - .pool -_08045B80: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r4, 0x1 - ands r0, r4 - cmp r0, 0 - beq _08045BFC - movs r0, 0x4 - ands r6, r0 - cmp r6, 0 - beq _08045BFC - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08045BC0 - bl GenerateRandomNumber - adds r1, r4, 0 - ands r1, r0 - cmp r1, 0 - beq _08045BBC - movs r0, 0x1 - b _08045BD2 - .pool -_08045BBC: - movs r0, 0x3 - b _08045BD2 -_08045BC0: - bl GenerateRandomNumber - adds r1, r4, 0 - ands r1, r0 - cmp r1, 0 - beq _08045BD0 - movs r0, 0 - b _08045BD2 -_08045BD0: - movs r0, 0x2 -_08045BD2: - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08045C20 - movs r0, 0x2 - eors r5, r0 - b _08045C20 - .pool -_08045BFC: - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_get_per_side_status - adds r1, r0, 0 - movs r2, 0x1 - movs r0, 0x1 - ands r0, r1 - eors r0, r2 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r5, r0, 24 - b _08045C20 - .pool -_08045C1C: - ldr r0, =0x0202420b - ldrb r5, [r0] -_08045C20: - ldr r0, =0x0202420b - ldrb r0, [r0] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - strb r5, [r0, 0xC] - adds r0, r5, 0 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80458E0 - - thumb_func_start sub_8045C44 -sub_8045C44: @ 8045C44 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08045C8A - ldr r0, =0x0202406e - lsls r4, 1 - adds r5, r4, r0 - ldrh r0, [r5] - movs r7, 0x64 - muls r0, r7 - ldr r6, =0x020244ec - adds r0, r6 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - movs r1, 0xCD - lsls r1, 1 - cmp r0, r1 - beq _08045C98 - ldrh r0, [r5] - muls r0, r7 - adds r0, r6 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - cmp r0, 0x97 - beq _08045C98 -_08045C8A: - movs r0, 0x1 - b _08045CAE - .pool -_08045C98: - ldr r0, =0x0202406e - adds r0, r4, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x50 - movs r2, 0 - bl pokemon_getattr -_08045CAE: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8045C44 - - thumb_func_start sub_8045CBC -sub_8045CBC: @ 8045CBC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - movs r6, 0 - ldr r5, =0x02022fec - ldr r0, [r5] - ldr r1, =0x02000002 - ands r0, r1 - cmp r0, 0 - bne _08045DAC - ldr r4, =0x0202420b - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08045DAC - ldrb r0, [r4] - bl sub_8045C44 - cmp r0, 0 - beq _08045D76 - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _08045D08 - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _08045DAC -_08045D08: - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r0, =0x003f0100 - ands r0, r1 - cmp r0, 0 - bne _08045DAC - movs r0, 0x80 - lsls r0, 17 - ands r1, r0 - cmp r1, 0 - bne _08045DAC - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r1, r0 - adds r0, r2, 0 - adds r0, 0x54 - adds r0, r1, r0 - ldr r0, [r0] - adds r2, 0x3C - adds r1, r2 - bl sub_806E8D4 - lsls r0, 24 - cmp r0, 0 - beq _08045DAC - ldr r0, =0x0000086e - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08045DAC - movs r6, 0xA - ldr r0, =0x00000868 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08045D5A - movs r6, 0x1E -_08045D5A: - ldr r0, =0x0000086a - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08045D68 - movs r6, 0x32 -_08045D68: - ldr r0, =0x0000086c - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08045D76 - movs r6, 0x46 -_08045D76: - ldr r5, =0x02024084 - ldr r0, =0x0202420b - mov r8, r0 - ldrb r0, [r0] - movs r7, 0x58 - muls r0, r7 - adds r0, r5 - adds r0, 0x2A - ldrb r0, [r0] - cmp r0, r6 - bls _08045DAC - bl GenerateRandomNumber - movs r1, 0xFF - ands r1, r0 - mov r2, r8 - ldrb r0, [r2] - adds r2, r0, 0 - muls r2, r7 - adds r0, r2, r5 - adds r0, 0x2A - ldrb r0, [r0] - adds r0, r6 - muls r0, r1 - asrs r4, r0, 8 - cmp r4, r6 - bge _08045DD4 -_08045DAC: - movs r0, 0 - b _08045FD0 - .pool -_08045DD4: - ldr r3, =0x020241ea - ldrh r0, [r3] - cmp r0, 0x63 - bne _08045DEA - adds r0, r5, 0 - adds r0, 0x50 - adds r0, r2, r0 - ldr r1, [r0] - ldr r2, =0xff7fffff - ands r1, r2 - str r1, [r0] -_08045DEA: - mov r1, r8 - ldrb r0, [r1] - muls r0, r7 - adds r1, r5, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08045E20 - ldrh r0, [r3] - cmp r0, 0xAD - beq _08045E0A - cmp r0, 0xD6 - bne _08045E20 -_08045E0A: - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB695 - b _08045F7A - .pool -_08045E20: - bl GenerateRandomNumber - movs r5, 0xFF - adds r1, r5, 0 - ands r1, r0 - ldr r7, =0x02024084 - ldr r2, =0x0202420b - mov r9, r2 - ldrb r3, [r2] - movs r0, 0x58 - mov r8, r0 - mov r0, r8 - muls r0, r3 - adds r0, r7 - adds r0, 0x2A - ldrb r2, [r0] - adds r0, r2, r6 - muls r0, r1 - asrs r4, r0, 8 - cmp r4, r6 - bge _08045EE8 - ldr r6, =gUnknown_0832A328 - ldr r5, =0x020241e8 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r6 - ldrb r1, [r0] - adds r0, r3, 0 - movs r2, 0xFF - bl sub_803FECC - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bne _08045E68 - b _08045F6A -_08045E68: - ldr r1, =0x020241e9 - mov r8, r1 - movs r7, 0x3 -_08045E6E: - bl GenerateRandomNumber - ands r0, r7 - mov r2, r8 - strb r0, [r2] - strb r0, [r5] - ldrb r0, [r5] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - ands r0, r4 - cmp r0, 0 - bne _08045E6E - ldr r4, =0x020241ee - ldr r3, =0x02024084 - ldr r0, =0x020241e8 - ldrb r0, [r0] - lsls r0, 1 - ldr r1, =0x0202420b - ldrb r2, [r1] - movs r1, 0x58 - muls r1, r2 - adds r0, r1 - adds r3, 0xC - adds r0, r3 - ldrh r0, [r0] - strh r0, [r4] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB6A5 - str r0, [r1] - ldrh r0, [r4] - movs r1, 0 - bl sub_80458E0 - ldr r1, =0x0202420c - strb r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 14 - b _08045FCA - .pool -_08045EE8: - subs r0, r2, r6 - lsls r0, 24 - lsrs r6, r0, 24 - bl GenerateRandomNumber - adds r4, r5, 0 - ands r4, r0 - cmp r4, r6 - bge _08045F64 - mov r1, r9 - ldrb r0, [r1] - mov r1, r8 - muls r1, r0 - adds r0, r7, 0 - adds r0, 0x4C - adds r0, r1, r0 - ldr r0, [r0] - ands r0, r5 - cmp r0, 0 - bne _08045F64 - adds r0, r1, r7 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x48 - beq _08045F64 - cmp r0, 0xF - beq _08045F64 - movs r2, 0 - ldr r0, =0x0202406c - ldrb r3, [r0] - mov r8, r0 - cmp r2, r3 - bge _08045F4A - ldr r0, [r7, 0x50] - movs r1, 0x70 - ands r0, r1 - cmp r0, 0 - bne _08045F4A - adds r1, r7, 0 - adds r1, 0x50 - movs r5, 0x70 -_08045F3A: - adds r1, 0x58 - adds r2, 0x1 - cmp r2, r3 - bge _08045F4A - ldr r0, [r1] - ands r0, r5 - cmp r0, 0 - beq _08045F3A -_08045F4A: - mov r0, r8 - ldrb r0, [r0] - cmp r2, r0 - bne _08045F64 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB6D9 - b _08045F7A - .pool -_08045F64: - subs r4, r6 - cmp r4, r6 - blt _08045F8C -_08045F6A: - bl GenerateRandomNumber - ldr r2, =0x02024332 - movs r1, 0x3 - ands r1, r0 - strb r1, [r2, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB6AD -_08045F7A: - str r0, [r1] - movs r0, 0x1 - b _08045FD0 - .pool -_08045F8C: - ldr r4, =0x0202420b - ldrb r1, [r4] - movs r0, 0x58 - muls r1, r0 - ldr r0, =0x02024084 - adds r1, r0 - movs r0, 0x28 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - ldrb r0, [r4] - str r0, [sp, 0x8] - ldrb r0, [r4] - str r0, [sp, 0xC] - adds r0, r1, 0 - movs r2, 0x1 - movs r3, 0 - bl sub_806957C - ldr r1, =0x020241f0 - str r0, [r1] - ldr r1, =0x0202420c - ldrb r0, [r4] - strb r0, [r1] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB6F0 - str r0, [r1] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 12 -_08045FCA: - orrs r0, r1 - str r0, [r2] - movs r0, 0x2 -_08045FD0: - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8045CBC - - thumb_func_start atk00_attackcanceler -atk00_attackcanceler: @ 8045FFC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - ldr r0, =0x0202433a - ldrb r0, [r0] - cmp r0, 0 - beq _08046020 - ldr r1, =0x02024083 - movs r0, 0xC - strb r0, [r1] - b _08046398 - .pool -_08046020: - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08046064 - ldr r2, =0x02024280 - ldr r1, [r2] - movs r0, 0x80 - lsls r0, 2 - ands r0, r1 - cmp r0, 0 - bne _08046064 - movs r0, 0x80 - lsls r0, 12 - orrs r1, r0 - str r1, [r2] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082D8A4E - b _08046396 - .pool -_08046064: - bl sub_8041A6C - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _08046072 - b _08046398 -_08046072: - ldr r0, =0x0202420c - ldrb r1, [r0] - str r2, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _0804608A - b _08046398 -_0804608A: - ldr r4, =0x02024084 - ldr r0, =0x020241e8 - ldrb r1, [r0] - ldr r3, =0x0202420b - ldrb r2, [r3] - movs r0, 0x58 - muls r2, r0 - adds r1, r2 - adds r0, r4, 0 - adds r0, 0x24 - adds r1, r0 - ldrb r0, [r1] - ldr r5, =0x02024280 - cmp r0, 0 - bne _08046108 - ldr r0, =0x020241ea - ldrh r0, [r0] - cmp r0, 0xA5 - beq _08046108 - ldr r0, [r5] - ldr r1, =0x00800200 - ands r0, r1 - cmp r0, 0 - bne _08046108 - adds r0, r4, 0 - adds r0, 0x50 - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 5 - ands r0, r1 - cmp r0, 0 - bne _08046108 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB07A - str r0, [r1] - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - b _08046398 - .pool -_08046108: - ldr r0, [r5] - ldr r1, =0xff7fffff - ands r0, r1 - str r0, [r5] - movs r6, 0x80 - lsls r6, 18 - ands r0, r6 - cmp r0, 0 - bne _08046160 - ldrb r1, [r3] - movs r0, 0x58 - muls r0, r1 - adds r1, r4, 0 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 5 - ands r0, r1 - cmp r0, 0 - bne _08046160 - bl sub_8045CBC - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _08046160 - cmp r2, 0x2 - bne _08046150 - ldr r0, [r5] - orrs r0, r6 - str r0, [r5] - b _08046398 - .pool -_08046150: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - b _08046398 - .pool -_08046160: - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 18 - orrs r0, r1 - str r0, [r2] - ldr r2, =0x0202433c - ldr r1, =0x0202420c - ldrb r3, [r1] - lsls r0, r3, 4 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 27 - mov r8, r1 - mov r9, r2 - cmp r0, 0 - bge _080461E8 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x8] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080461E8 - ldr r0, =0x0202420b - ldrb r0, [r0] - ldr r2, =0x00000115 - adds r1, r3, 0 - bl sub_803F480 - mov r0, r8 - ldrb r1, [r0] - lsls r1, 4 - add r1, r9 - ldrb r2, [r1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB194 - b _08046396 - .pool -_080461E8: - movs r2, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r2, r0 - bge _0804622A - ldr r6, =0x0202433c - ldr r1, =gBattleMoves - mov r12, r1 - adds r5, r0, 0 - ldr r7, =0x0202407e -_080461FC: - adds r4, r2, r7 - ldrb r3, [r4] - lsls r0, r3, 4 - adds r0, r6 - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _08046224 - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - add r0, r12 - ldrb r1, [r0, 0x8] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _08046224 - b _08046350 -_08046224: - adds r2, 0x1 - cmp r2, r5 - blt _080461FC -_0804622A: - ldr r0, =0x0202437c - mov r1, r8 - ldrb r2, [r1] - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r3, [r1] - lsls r0, r3, 30 - cmp r0, 0 - bge _08046288 - movs r0, 0x3 - negs r0, r0 - ands r0, r3 - strb r0, [r1] - ldr r4, =0x0202420a - movs r0, 0x1F - strb r0, [r4] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB53E - str r0, [r1] - mov r1, r8 - ldrb r0, [r1] - ldrb r1, [r4] - bl b_history__record_ability_usage_of_player - b _08046398 - .pool -_08046288: - lsls r0, r2, 4 - add r0, r9 - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - bne _08046296 - b _08046390 -_08046296: - ldr r1, =gBattleMoves - ldr r2, =0x020241ea - ldrh r3, [r2] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x2 - ands r0, r1 - adds r4, r2, 0 - cmp r0, 0 - beq _08046390 - cmp r3, 0xAE - bne _080462D4 - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r1, r0, r2 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x7 - beq _080462D4 - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x7 - bne _08046390 -_080462D4: - ldrh r0, [r4] - bl sub_8052F48 - lsls r0, 24 - cmp r0, 0 - beq _080462FA - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 5 - ands r0, r1 - cmp r0, 0 - beq _08046390 -_080462FA: - ldr r0, =0x0202420b - ldrb r0, [r0] - bl b_cancel_multi_turn_move_maybe - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024250 - ldr r3, =0x0202420c - ldrb r0, [r3] - lsls r0, 1 - adds r0, r1 - movs r2, 0 - strh r2, [r0] - ldr r1, =0x02024258 - ldrb r0, [r3] - lsls r0, 1 - adds r0, r1 - strh r2, [r0] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x6] - b _08046390 - .pool -_08046350: - ldr r0, =0x0202420b - ldrb r0, [r0] - ldr r2, =0x00000121 - adds r1, r3, 0 - bl sub_803F480 - ldrb r1, [r4] - lsls r1, 4 - adds r1, r6 - ldrb r2, [r1] - movs r0, 0x21 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, =0x02024474 - ldrb r0, [r4] - strb r0, [r1, 0x17] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB1AC - b _08046396 - .pool -_08046390: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 -_08046396: - str r0, [r1] -_08046398: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk00_attackcanceler - - thumb_func_start mcmd_jump_if_move_not_executed -mcmd_jump_if_move_not_executed: @ 80463AC - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r6, r1, 16 - ldr r1, =0x02024214 - ldr r5, [r1] - adds r4, r5, r0 - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _0804640C - ldr r1, =0x02024250 - ldr r3, =0x0202420c - ldrb r0, [r3] - lsls r0, 1 - adds r0, r1 - movs r2, 0 - strh r2, [r0] - ldr r1, =0x02024258 - ldrb r0, [r3] - lsls r0, 1 - adds r0, r1 - strh r2, [r0] - ldrb r4, [r5, 0x1] - ldrb r0, [r5, 0x2] - lsls r0, 8 - orrs r4, r0 - ldrb r0, [r5, 0x3] - lsls r0, 16 - orrs r4, r0 - ldrb r0, [r5, 0x4] - lsls r0, 24 - orrs r4, r0 - b _08046426 - .pool -_0804640C: - bl b_feature_update_destiny_bond - ldr r0, =0x0202420c - ldrb r1, [r0] - str r6, [sp] - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _0804642A -_08046426: - ldr r0, =0x02024214 - str r4, [r0] -_0804642A: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end mcmd_jump_if_move_not_executed - - thumb_func_start atk40_801DBA0 -atk40_801DBA0: @ 804643C - push {lr} - ldr r1, =0x0202433c - ldr r0, =0x0202420c - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - beq _0804649C - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x8] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0804649C - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x5 - movs r1, 0 - bl mcmd_jump_if_move_not_executed - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x6] - b _080464A4 - .pool -_0804649C: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_080464A4: - pop {r0} - bx r0 - .pool - thumb_func_end atk40_801DBA0 - - thumb_func_start sub_80464AC -sub_80464AC: @ 80464AC - push {r4,lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r4, 0 - ldr r1, =0x0202433c - ldr r0, =0x0202420c - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - beq _080464F8 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x8] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080464F8 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x7 - adds r1, r3, 0 - bl mcmd_jump_if_move_not_executed - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x6] - movs r4, 0x1 -_080464F8: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80464AC - - thumb_func_start sub_8046518 -sub_8046518: @ 8046518 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r2, =0x020242ac - ldr r3, =0x0202420c - ldrb r4, [r3] - lsls r0, r4, 2 - adds r0, r2 - ldr r1, [r0] - movs r0, 0x18 - ands r1, r0 - adds r6, r2, 0 - cmp r1, 0 - beq _0804654A - ldr r1, =0x020242bc - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r0, r1 - ldr r1, =0x0202420b - ldrb r0, [r0, 0x15] - ldrb r1, [r1] - cmp r0, r1 - beq _08046634 -_0804654A: - ldr r0, =0x02024280 - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 9 - ands r1, r2 - adds r2, r0, 0 - cmp r1, 0 - bne _08046590 - ldrb r0, [r3] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08046590 -_0804656A: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - b _08046634 - .pool -_08046590: - ldr r0, [r2] - ldr r1, =0xfffeffff - ands r0, r1 - str r0, [r2] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - bne _080465B2 - ldrb r0, [r3] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0804656A -_080465B2: - ldr r0, [r2] - ldr r1, =0xfffdffff - ands r0, r1 - str r0, [r2] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - bne _080465D2 - ldrb r0, [r3] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - ands r0, r1 - cmp r0, 0 - bne _0804656A -_080465D2: - ldr r0, [r2] - ldr r1, =0xfffbffff - ands r0, r1 - str r0, [r2] - movs r0, 0 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - lsls r4, r5, 1 - cmp r0, 0 - bne _08046622 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _08046622 - ldr r0, =0x020243cc - ldrh r1, [r0] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08046622 - ldr r0, =gBattleMoves - adds r1, r4, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x98 - beq _08046634 -_08046622: - ldr r1, =gBattleMoves - adds r0, r4, r5 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x11 - beq _08046634 - cmp r0, 0x4E - bne _08046654 -_08046634: - movs r0, 0x7 - adds r1, r5, 0 - bl mcmd_jump_if_move_not_executed - movs r0, 0x1 - b _08046656 - .pool -_08046654: - movs r0, 0 -_08046656: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8046518 - - thumb_func_start atk01_accuracycheck -atk01_accuracycheck: @ 8046660 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r0, =0x02024214 - ldr r5, [r0] - ldrb r6, [r5, 0x5] - ldrb r1, [r5, 0x6] - lsls r1, 8 - orrs r6, r1 - adds r1, r6, 0x2 - lsls r1, 16 - lsrs r1, 16 - adds r7, r0, 0 - cmp r1, 0x1 - bhi _0804671C - ldr r2, =0x020242ac - ldr r3, =0x0202420c - ldrb r4, [r3] - lsls r0, r4, 2 - adds r0, r2 - ldr r1, [r0] - movs r0, 0x18 - ands r1, r0 - cmp r1, 0 - beq _080466D0 - ldr r0, =0x0000ffff - cmp r6, r0 - bne _080466D0 - ldr r1, =0x020242bc - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r0, r1 - ldr r1, =0x0202420b - ldrb r0, [r0, 0x15] - ldrb r1, [r1] - cmp r0, r1 - bne _080466D0 - adds r0, r5, 0x7 - str r0, [r7] - b _080469D2 - .pool -_080466D0: - ldrb r0, [r3] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ldr r1, =0x000400c0 - ands r0, r1 - cmp r0, 0 - beq _08046700 - ldr r2, [r7] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r7] - b _080469D2 - .pool -_08046700: - movs r0, 0 - bl sub_80464AC - lsls r0, 24 - cmp r0, 0 - beq _0804670E - b _080469D2 -_0804670E: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x7 - str r0, [r1] - b _080469D2 - .pool -_0804671C: - cmp r6, 0 - bne _08046724 - ldr r0, =0x020241ea - ldrh r6, [r0] -_08046724: - ldr r0, =0x0202449c - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0 - beq _08046744 - movs r1, 0x3F - mov r10, r1 - mov r2, r10 - ands r2, r0 - mov r10, r2 - b _08046752 - .pool -_08046744: - ldr r1, =gBattleMoves - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x2] - mov r10, r0 -_08046752: - adds r0, r6, 0 - bl sub_80464AC - lsls r0, 24 - cmp r0, 0 - beq _08046760 - b _080469D2 -_08046760: - adds r0, r6, 0 - bl sub_8046518 - lsls r0, 24 - cmp r0, 0 - beq _0804676E - b _080469D2 -_0804676E: - ldr r3, =0x02024084 - ldr r0, =0x0202420c - ldrb r0, [r0] - movs r2, 0x58 - adds r4, r0, 0 - muls r4, r2 - adds r0, r3, 0 - adds r0, 0x50 - adds r0, r4, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 22 - ands r0, r1 - cmp r0, 0 - beq _080467A8 - ldr r0, =0x0202420b - ldrb r0, [r0] - muls r0, r2 - adds r0, r3 - ldrb r5, [r0, 0x1E] - b _080467BE - .pool -_080467A8: - ldr r0, =0x0202420b - ldrb r0, [r0] - muls r0, r2 - adds r0, r3 - ldrb r0, [r0, 0x1E] - adds r0, 0x6 - adds r1, r4, r3 - ldrb r1, [r1, 0x1F] - subs r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 -_080467BE: - lsls r0, r5, 24 - cmp r0, 0 - bge _080467C6 - movs r5, 0 -_080467C6: - lsls r0, r5, 24 - asrs r0, 24 - cmp r0, 0xC - ble _080467D0 - movs r5, 0xC -_080467D0: - ldr r1, =gBattleMoves - lsls r4, r6, 1 - adds r0, r4, r6 - lsls r0, 2 - adds r7, r0, r1 - ldrb r3, [r7, 0x3] - mov r8, r3 - movs r0, 0 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - str r4, [sp, 0x4] - cmp r0, 0 - bne _08046822 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _08046822 - ldr r0, =0x020243cc - ldrh r1, [r0] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _08046822 - ldrb r0, [r7] - cmp r0, 0x98 - bne _08046822 - movs r0, 0x32 - mov r8, r0 -_08046822: - ldr r1, =gUnknown_0831C0F4 - lsls r0, r5, 24 - asrs r0, 22 - adds r0, r1 - ldrb r1, [r0] - mov r4, r8 - muls r4, r1 - ldrb r1, [r0, 0x1] - adds r0, r4, 0 - bl __divsi3 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r7, =0x02024084 - ldr r0, =0x0202420b - ldrb r0, [r0] - movs r5, 0x58 - muls r0, r5 - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0xE - bne _08046860 - lsls r0, r4, 6 - adds r0, r4 - lsls r0, 1 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r4, r0, 16 -_08046860: - movs r0, 0 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _080468B8 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _080468B8 - ldr r0, =0x0202420c - ldrb r0, [r0] - muls r0, r5 - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x8 - bne _080468B8 - ldr r0, =0x020243cc - ldrh r1, [r0] - movs r0, 0x18 - ands r0, r1 - cmp r0, 0 - beq _080468B8 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 4 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r4, r0, 16 -_080468B8: - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x20 - ldrb r0, [r0] - mov r9, r2 - cmp r0, 0x37 - bne _080468E4 - mov r1, r10 - cmp r1, 0x8 - bhi _080468E4 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 4 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r4, r0, 16 -_080468E4: - ldr r2, =0x0202420c - mov r8, r2 - ldrb r2, [r2] - movs r7, 0x58 - adds r0, r2, 0 - muls r0, r7 - mov r3, r9 - adds r1, r0, r3 - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _08046928 - ldr r1, =0x02024404 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r5, [r0, 0x7] - ldrb r2, [r0, 0x1A] - b _08046944 - .pool -_08046928: - ldrh r0, [r1, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r5, r0, 24 - mov r1, r8 - ldrb r0, [r1] - muls r0, r7 - add r0, r9 - ldrh r0, [r0, 0x2E] - bl itemid_get_quality - lsls r0, 24 - lsrs r2, r0, 24 -_08046944: - ldr r0, =0x0202420f - ldr r1, =0x0202420c - ldrb r1, [r1] - strb r1, [r0] - cmp r5, 0x16 - bne _08046960 - movs r0, 0x64 - subs r0, r2 - muls r0, r4 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r4, r0, 16 -_08046960: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r0, 0x1 - cmp r0, r4 - ble _080469CA - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080469C0 - ldr r1, =gBattleMoves - ldr r2, [sp, 0x4] - adds r0, r2, r6 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x6] - cmp r0, 0x8 - beq _080469A2 - cmp r0, 0x20 - bne _080469C0 -_080469A2: - ldr r1, =0x02024332 - movs r0, 0x2 - b _080469C4 - .pool -_080469C0: - ldr r1, =0x02024332 - movs r0, 0 -_080469C4: - strb r0, [r1, 0x6] - bl b_wonderguard_and_levitate -_080469CA: - movs r0, 0x7 - adds r1, r6, 0 - bl mcmd_jump_if_move_not_executed -_080469D2: - 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 atk01_accuracycheck - - thumb_func_start atk02_attackstring -atk02_attackstring: @ 80469E8 - push {r4,r5,lr} - ldr r0, =0x02024068 - ldr r5, [r0] - cmp r5, 0 - bne _08046A20 - ldr r4, =0x02024280 - ldr r0, [r4] - movs r1, 0xC0 - lsls r1, 3 - ands r0, r1 - cmp r0, 0 - bne _08046A14 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x4 - bl b_std_message - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 3 - orrs r0, r1 - str r0, [r4] -_08046A14: - ldr r0, =0x02024214 - ldr r1, [r0] - adds r1, 0x1 - str r1, [r0] - ldr r0, =0x02024332 - strb r5, [r0, 0x7] -_08046A20: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk02_attackstring - - thumb_func_start atk03_ppreduce -atk03_ppreduce: @ 8046A3C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r6, 0x1 - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _08046A54 - b _08046BEE -_08046A54: - ldr r1, =0x0202437c - ldr r2, =0x0202420b - ldrb r3, [r2] - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r4, r0, 31 - mov r9, r2 - cmp r4, 0 - bne _08046AF6 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x6] - cmp r0, 0x20 - beq _08046AA6 - cmp r0, 0x20 - bgt _08046AA0 - cmp r0, 0x8 - beq _08046ABC - b _08046AD6 - .pool -_08046AA0: - cmp r0, 0x40 - beq _08046ABC - b _08046AD6 -_08046AA6: - str r4, [sp] - movs r0, 0x12 - adds r1, r3, 0 - movs r2, 0x2E - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0x1 - b _08046AF6 -_08046ABC: - mov r0, r9 - ldrb r1, [r0] - movs r0, 0 - str r0, [sp] - movs r0, 0x10 - movs r2, 0x2E - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - adds r6, r0 - b _08046AF6 -_08046AD6: - ldr r1, =0x0202420c - mov r2, r9 - ldrb r0, [r2] - ldrb r7, [r1] - cmp r0, r7 - beq _08046AF6 - ldr r2, =0x02024084 - ldrb r1, [r1] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x2E - bne _08046AF6 - adds r6, 0x1 -_08046AF6: - ldr r0, =0x02024280 - ldr r4, [r0] - movs r0, 0xA0 - lsls r0, 4 - ands r4, r0 - cmp r4, 0 - bne _08046BDC - ldr r2, =0x02024084 - ldr r3, =0x020241e8 - ldr r1, =0x0202420b - ldrb r5, [r1] - movs r0, 0x58 - mov r8, r0 - mov r0, r8 - muls r0, r5 - ldrb r7, [r3] - adds r0, r7 - movs r7, 0x24 - adds r7, r2 - mov r12, r7 - add r0, r12 - ldrb r0, [r0] - mov r9, r1 - mov r10, r2 - adds r7, r3, 0 - cmp r0, 0 - beq _08046BDC - ldr r0, =0x0202433c - lsls r1, r5, 4 - adds r1, r0 - ldrb r0, [r1, 0x2] - movs r2, 0x8 - orrs r0, r2 - strb r0, [r1, 0x2] - mov r1, r9 - ldrb r0, [r1] - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - ldrb r1, [r7] - adds r0, r1 - mov r1, r12 - adds r2, r0, r1 - ldrb r0, [r2] - cmp r0, r6 - ble _08046B70 - subs r0, r6 - strb r0, [r2] - b _08046B72 - .pool -_08046B70: - strb r4, [r2] -_08046B72: - mov r2, r9 - ldrb r3, [r2] - movs r4, 0x58 - adds r0, r3, 0 - muls r0, r4 - mov r1, r10 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _08046BDC - ldr r1, =0x020242bc - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gUnknown_0832A328 - ldrb r0, [r7] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08046BDC - ldr r0, =0x02024064 - strb r3, [r0] - ldrb r1, [r7] - adds r1, 0x9 - lsls r1, 24 - lsrs r1, 24 - mov r2, r9 - ldrb r0, [r2] - muls r0, r4 - mov r2, r10 - adds r2, 0x24 - adds r0, r2 - ldrb r7, [r7] - adds r0, r7 - str r0, [sp] - movs r0, 0 - movs r2, 0 - movs r3, 0x1 - bl dp01_build_cmdbuf_x02_a_b_varargs - mov r7, r9 - ldrb r0, [r7] - bl dp01_battle_side_mark_buffer_for_execution -_08046BDC: - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xfffff7ff - ands r0, r1 - str r0, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_08046BEE: - 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 atk03_ppreduce - - thumb_func_start atk04_critcalc -atk04_critcalc: @ 8046C18 - push {r4-r7,lr} - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x2E] - cmp r0, 0xAF - bne _08046C48 - ldr r1, =0x02024404 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r6, [r0, 0x7] - b _08046C50 - .pool -_08046C48: - bl itemid_get_x12 - lsls r0, 24 - lsrs r6, r0, 24 -_08046C50: - ldr r1, =0x0202420f - ldr r3, =0x0202420b - ldrb r0, [r3] - strb r0, [r1] - ldr r4, =0x02024084 - ldrb r1, [r3] - movs r0, 0x58 - adds r7, r1, 0 - muls r7, r0 - adds r0, r4, 0 - adds r0, 0x50 - adds r0, r7, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 13 - ands r0, r1 - negs r0, r0 - asrs r5, r0, 31 - movs r0, 0x2 - ands r5, r0 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - mov r12, r3 - cmp r1, 0x2B - bne _08046C90 - adds r5, 0x1 -_08046C90: - adds r0, r5, 0 - cmp r1, 0x4B - bne _08046C98 - adds r0, 0x1 -_08046C98: - cmp r1, 0xC8 - bne _08046C9E - adds r0, 0x1 -_08046C9E: - adds r2, r0, 0 - cmp r1, 0xD1 - bne _08046CA6 - adds r2, 0x1 -_08046CA6: - movs r1, 0 - cmp r6, 0x3F - bne _08046CB6 - adds r0, r7, r4 - ldrh r0, [r0] - cmp r0, 0x71 - bne _08046CB6 - movs r1, 0x1 -_08046CB6: - lsls r5, r1, 1 - movs r3, 0 - cmp r6, 0x42 - bne _08046CD0 - mov r0, r12 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0x53 - bne _08046CD0 - movs r3, 0x1 -_08046CD0: - lsls r1, r3, 1 - cmp r6, 0x29 - bne _08046CF0 - adds r0, r5, 0x1 - adds r0, r2, r0 - b _08046CF2 - .pool -_08046CF0: - adds r0, r2, r5 -_08046CF2: - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - adds r5, r0, 0 - cmp r5, 0x4 - bls _08046D00 - movs r5, 0x4 -_08046D00: - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r4 - adds r0, 0x20 - ldrb r4, [r0] - cmp r4, 0x4 - beq _08046D70 - cmp r4, 0x4B - beq _08046D70 - ldr r1, =0x020242ac - mov r2, r12 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - bne _08046D70 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x84 - lsls r1, 2 - ands r0, r1 - cmp r0, 0 - bne _08046D70 - bl GenerateRandomNumber - ldr r2, =gUnknown_0831C128 - lsls r1, r5, 1 - adds r1, r2 - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r1] - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _08046D70 - ldr r1, =0x02024211 - movs r0, 0x2 - b _08046D74 - .pool -_08046D70: - ldr r1, =0x02024211 - movs r0, 0x1 -_08046D74: - strb r0, [r1] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk04_critcalc - - thumb_func_start atk05_cmd5 -atk05_cmd5: @ 8046D8C - push {r4-r7,lr} - sub sp, 0x10 - ldr r4, =0x0202428e - ldr r5, =0x0202420c - ldrb r0, [r5] - bl battle_get_per_side_status - movs r1, 0x1 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - ldrh r3, [r1] - ldr r6, =0x0202420b - ldrb r0, [r6] - movs r4, 0x58 - muls r0, r4 - ldr r2, =0x02024084 - adds r0, r2 - ldrb r1, [r5] - muls r1, r4 - adds r1, r2 - ldr r7, =0x020241ea - ldrh r2, [r7] - ldr r4, =0x02024400 - ldrh r4, [r4] - str r4, [sp] - ldr r4, =0x0202449c - ldr r4, [r4] - ldrb r4, [r4, 0x13] - str r4, [sp, 0x4] - ldrb r4, [r6] - str r4, [sp, 0x8] - ldrb r4, [r5] - str r4, [sp, 0xC] - bl sub_806957C - ldr r4, =0x020241f0 - ldr r1, =0x02024211 - ldrb r1, [r1] - muls r1, r0 - ldr r0, =0x02024474 - ldrb r0, [r0, 0xE] - adds r3, r1, 0 - muls r3, r0 - str r3, [r4] - ldr r1, =0x020242ac - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 2 - ands r0, r1 - cmp r0, 0 - beq _08046E10 - ldr r2, =gBattleMoves - ldrh r1, [r7] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x2] - cmp r0, 0xD - bne _08046E10 - lsls r0, r3, 1 - str r0, [r4] -_08046E10: - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 28 - cmp r0, 0 - bge _08046E32 - ldr r4, =0x020241f0 - ldr r1, [r4] - lsls r0, r1, 4 - subs r0, r1 - movs r1, 0xA - bl __divsi3 - str r0, [r4] -_08046E32: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk05_cmd5 - - thumb_func_start sub_8046E7C -sub_8046E7C: @ 8046E7C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - adds r5, r1, 0 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r4, =0x0202428e - adds r0, r5, 0 - bl battle_get_per_side_status - movs r1, 0x1 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - ldrh r3, [r1] - movs r1, 0x58 - adds r0, r7, 0 - muls r0, r1 - ldr r2, =0x02024084 - adds r0, r2 - muls r1, r5 - adds r1, r2 - ldr r2, =0x020241ea - mov r8, r2 - ldrh r2, [r2] - ldr r6, =0x02024400 - ldrh r4, [r6] - str r4, [sp] - ldr r4, =0x0202449c - ldr r4, [r4] - ldrb r4, [r4, 0x13] - str r4, [sp, 0x4] - str r7, [sp, 0x8] - str r5, [sp, 0xC] - bl sub_806957C - ldr r4, =0x020241f0 - movs r1, 0 - strh r1, [r6] - ldr r1, =0x02024211 - ldrb r1, [r1] - muls r1, r0 - ldr r0, =0x02024474 - ldrb r0, [r0, 0xE] - adds r3, r1, 0 - muls r3, r0 - str r3, [r4] - ldr r1, =0x020242ac - lsls r0, r7, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 2 - ands r0, r1 - cmp r0, 0 - beq _08046F0A - ldr r2, =gBattleMoves - mov r0, r8 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x2] - cmp r0, 0xD - bne _08046F0A - lsls r0, r3, 1 - str r0, [r4] -_08046F0A: - ldr r0, =0x0202433c - lsls r1, r7, 4 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 28 - cmp r0, 0 - bge _08046F28 - ldr r4, =0x020241f0 - ldr r1, [r4] - lsls r0, r1, 4 - subs r0, r1 - movs r1, 0xA - bl __divsi3 - str r0, [r4] -_08046F28: - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8046E7C - - thumb_func_start battle_attack_damage_modulate_by_effectivity -battle_attack_damage_modulate_by_effectivity: @ 8046F60 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =0x020241f0 - ldr r0, [r5] - muls r0, r4 - movs r1, 0xA - bl __divsi3 - str r0, [r5] - cmp r0, 0 - bne _08046F80 - cmp r4, 0 - beq _08046F80 - movs r0, 0x1 - str r0, [r5] -_08046F80: - cmp r4, 0x5 - beq _08046FB0 - cmp r4, 0x5 - bgt _08046F94 - cmp r4, 0 - beq _08046F9A - b _08047032 - .pool -_08046F94: - cmp r4, 0x14 - beq _08046FF0 - b _08047032 -_08046F9A: - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x8 - orrs r0, r1 - movs r1, 0xFB - ands r0, r1 - movs r1, 0xFD - ands r0, r1 - b _08047030 - .pool -_08046FB0: - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - beq _08047032 - ldr r2, =0x0202427c - ldrb r1, [r2] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _08047032 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08046FEC - movs r0, 0xFD - ands r0, r1 - b _08047030 - .pool -_08046FEC: - movs r0, 0x4 - b _0804702E -_08046FF0: - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - beq _08047032 - ldr r2, =0x0202427c - ldrb r1, [r2] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _08047032 - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0804702C - movs r0, 0xFB - ands r0, r1 - b _08047030 - .pool -_0804702C: - movs r0, 0x2 -_0804702E: - orrs r0, r1 -_08047030: - strb r0, [r2] -_08047032: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end battle_attack_damage_modulate_by_effectivity - - thumb_func_start sub_8047038 -sub_8047038: @ 8047038 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - movs r3, 0 - ldr r1, =0x020241ea - ldrh r0, [r1] - cmp r0, 0xA5 - bne _0804704C - b _08047260 -_0804704C: - ldr r0, =0x0202449c - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0 - beq _08047068 - movs r1, 0x3F - mov r8, r1 - ands r1, r0 - mov r8, r1 - b _08047078 - .pool -_08047068: - ldr r2, =gBattleMoves - ldrh r1, [r1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x2] - mov r8, r0 -_08047078: - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r1, r0, r2 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - adds r5, r2, 0 - cmp r0, r8 - beq _0804709A - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, r8 - bne _080470B0 -_0804709A: - ldr r4, =0x020241f0 - ldr r1, [r4] - lsls r0, r1, 4 - subs r0, r1 - str r0, [r4] - movs r1, 0xA - str r3, [sp, 0x4] - bl __divsi3 - str r0, [r4] - ldr r3, [sp, 0x4] -_080470B0: - ldr r2, =0x0202420c - ldrb r1, [r2] - movs r0, 0x58 - muls r0, r1 - adds r0, r5 - adds r0, 0x20 - ldrb r0, [r0] - adds r4, r2, 0 - cmp r0, 0x1A - bne _08047128 - mov r1, r8 - cmp r1, 0x4 - bne _08047128 - ldr r3, =0x0202420a - strb r0, [r3] - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x9 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024250 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - movs r2, 0 - strh r2, [r0] - ldr r1, =0x02024258 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - strh r2, [r0] - ldr r0, =0x02024332 - mov r1, r8 - strb r1, [r0, 0x6] - ldrb r0, [r4] - ldrb r1, [r3] - bl b_history__record_ability_usage_of_player - b _080471C4 - .pool -_08047128: - ldr r1, =gUnknown_0831ACE8 - adds r0, r3, r1 - ldrb r0, [r0] - adds r2, r1, 0 - b _080471A4 - .pool -_08047138: - adds r3, 0x3 - b _080471A0 -_0804713C: - ldr r5, =gUnknown_0831ACE8 - adds r0, r3, r5 - ldrb r0, [r0] - cmp r0, r8 - bne _08047198 - adds r1, r3, 0x1 - adds r1, r5 - ldr r2, =0x02024084 - ldr r7, =0x0202420c - ldrb r0, [r7] - movs r6, 0x58 - muls r0, r6 - adds r0, r2 - adds r0, 0x21 - ldrb r4, [r1] - ldrb r0, [r0] - cmp r4, r0 - bne _08047172 - adds r0, r3, 0x2 - adds r0, r5 - ldrb r0, [r0] - str r2, [sp] - str r3, [sp, 0x4] - bl battle_attack_damage_modulate_by_effectivity - ldr r3, [sp, 0x4] - ldr r2, [sp] -_08047172: - ldrb r0, [r7] - muls r0, r6 - adds r0, r2 - adds r1, r0, 0 - adds r1, 0x22 - ldrb r1, [r1] - cmp r4, r1 - bne _08047198 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, r4 - beq _08047198 - adds r0, r3, 0x2 - adds r0, r5 - ldrb r0, [r0] - str r3, [sp, 0x4] - bl battle_attack_damage_modulate_by_effectivity - ldr r3, [sp, 0x4] -_08047198: - adds r3, 0x3 - ldr r5, =0x02024084 - ldr r4, =0x0202420c - ldr r2, =gUnknown_0831ACE8 -_080471A0: - adds r0, r3, r2 - ldrb r0, [r0] -_080471A4: - cmp r0, 0xFF - beq _080471C4 - cmp r0, 0xFE - bne _0804713C - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - adds r1, r5, 0 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 22 - ands r0, r1 - cmp r0, 0 - beq _08047138 -_080471C4: - ldr r2, =0x02024084 - ldr r5, =0x0202420c - ldrb r1, [r5] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x20 - ldrb r6, [r0] - cmp r6, 0x19 - bne _08047242 - ldr r0, =0x0202420b - ldrb r0, [r0] - ldr r7, =0x020241ea - ldrh r1, [r7] - bl move_weather_interaction - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08047242 - ldr r1, =0x0202427c - mov r8, r1 - ldrb r4, [r1] - ands r0, r4 - cmp r0, 0 - beq _08047200 - movs r0, 0x6 - ands r0, r4 - cmp r0, 0x6 - bne _08047242 -_08047200: - ldr r2, =gBattleMoves - ldrh r1, [r7] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - beq _08047242 - ldr r3, =0x0202420a - strb r6, [r3] - movs r0, 0x1 - orrs r0, r4 - mov r1, r8 - strb r0, [r1] - ldr r1, =0x02024250 - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - movs r2, 0 - strh r2, [r0] - ldr r1, =0x02024258 - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - strh r2, [r0] - ldr r1, =0x02024332 - movs r0, 0x3 - strb r0, [r1, 0x6] - ldrb r0, [r5] - ldrb r1, [r3] - bl b_history__record_ability_usage_of_player -_08047242: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _08047260 - ldr r2, =0x0202433c - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r1, 4 - adds r1, r2 - ldrb r0, [r1, 0x1] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r1, 0x1] -_08047260: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8047038 - - thumb_func_start b_wonderguard_and_levitate -b_wonderguard_and_levitate: @ 80472A8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r6, 0 - movs r5, 0 - ldr r0, =0x020241ea - ldrh r1, [r0] - mov r9, r0 - cmp r1, 0xA5 - bne _080472C0 - b _08047508 -_080472C0: - ldr r2, =gBattleMoves - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - ldrb r0, [r1, 0x1] - cmp r0, 0 - bne _080472D2 - b _08047508 -_080472D2: - ldr r0, =0x0202449c - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0 - beq _080472F4 - movs r1, 0x3F - mov r12, r1 - mov r2, r12 - ands r2, r0 - mov r12, r2 - b _080472F8 - .pool -_080472F4: - ldrb r1, [r1, 0x2] - mov r12, r1 -_080472F8: - ldr r2, =0x02024084 - ldr r3, =0x0202420c - ldrb r1, [r3] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x20 - ldrb r1, [r0] - adds r7, r2, 0 - mov r8, r3 - cmp r1, 0x1A - bne _0804733C - mov r0, r12 - cmp r0, 0x4 - bne _0804733C - ldr r0, =0x0202420a - strb r1, [r0] - ldr r0, =0x02024332 - mov r1, r12 - strb r1, [r0, 0x6] - ldrb r0, [r3] - movs r1, 0x1A - bl b_history__record_ability_usage_of_player - b _08047508 - .pool -_0804733C: - ldr r1, =gUnknown_0831ACE8 - adds r0, r5, r1 - ldrb r0, [r0] - adds r4, r1, 0 - b _0804748E - .pool -_0804734C: - adds r0, r5, r4 - ldrb r0, [r0] - cmp r0, r12 - beq _08047356 - b _08047488 -_08047356: - adds r2, r5, 0x1 - adds r3, r2, r4 - mov r0, r8 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r7 - adds r0, 0x21 - ldrb r1, [r3] - adds r3, r2, 0 - ldrb r0, [r0] - cmp r1, r0 - bne _08047396 - adds r0, r5, 0x2 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _08047396 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x8 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r2, [r0] - lsls r2, 4 - adds r2, r1 - ldrb r0, [r2, 0x1] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2, 0x1] -_08047396: - adds r2, r3, r4 - mov r0, r8 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r7 - adds r1, r0, 0 - adds r1, 0x22 - ldrb r2, [r2] - ldrb r1, [r1] - cmp r2, r1 - bne _080473DC - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, r2 - beq _080473DC - adds r0, r5, 0x2 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _080473DC - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x8 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r2, [r0] - lsls r2, 4 - adds r2, r1 - ldrb r0, [r2, 0x1] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2, 0x1] -_080473DC: - adds r2, r3, r4 - mov r0, r8 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r7 - adds r0, 0x21 - ldrb r1, [r2] - ldrb r0, [r0] - cmp r1, r0 - bne _08047400 - adds r0, r5, 0x2 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x14 - bne _08047400 - movs r0, 0x1 - orrs r6, r0 -_08047400: - adds r2, r3, r4 - mov r0, r8 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r7 - adds r1, r0, 0 - adds r1, 0x22 - ldrb r2, [r2] - ldrb r1, [r1] - cmp r2, r1 - bne _0804742E - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, r2 - beq _0804742E - adds r0, r5, 0x2 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x14 - bne _0804742E - movs r0, 0x1 - orrs r6, r0 -_0804742E: - adds r2, r3, r4 - mov r0, r8 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r7 - adds r0, 0x21 - ldrb r1, [r2] - ldrb r0, [r0] - cmp r1, r0 - bne _08047456 - adds r0, r5, 0x2 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x5 - bne _08047456 - movs r0, 0x2 - orrs r6, r0 - lsls r0, r6, 24 - lsrs r6, r0, 24 -_08047456: - adds r2, r3, r4 - mov r0, r8 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r7 - adds r1, r0, 0 - adds r1, 0x22 - ldrb r2, [r2] - ldrb r1, [r1] - cmp r2, r1 - bne _08047488 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, r2 - beq _08047488 - adds r0, r5, 0x2 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x5 - bne _08047488 - movs r0, 0x2 - orrs r6, r0 - lsls r0, r6, 24 - lsrs r6, r0, 24 -_08047488: - adds r5, 0x3 - adds r0, r5, r4 - ldrb r0, [r0] -_0804748E: - cmp r0, 0xFF - beq _080474B2 - cmp r0, 0xFE - beq _08047498 - b _0804734C -_08047498: - mov r2, r8 - ldrb r1, [r2] - movs r0, 0x58 - muls r0, r1 - adds r1, r7, 0 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 22 - ands r0, r1 - cmp r0, 0 - beq _08047488 -_080474B2: - mov r0, r8 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r7 - adds r0, 0x20 - ldrb r4, [r0] - cmp r4, 0x19 - bne _08047508 - ldr r0, =0x0202420b - ldrb r0, [r0] - mov r2, r9 - ldrh r1, [r2] - bl move_weather_interaction - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08047508 - movs r0, 0x3 - ands r6, r0 - cmp r6, 0x1 - beq _08047508 - ldr r2, =gBattleMoves - mov r0, r9 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - beq _08047508 - ldr r0, =0x0202420a - strb r4, [r0] - ldr r1, =0x02024332 - movs r0, 0x3 - strb r0, [r1, 0x6] - mov r1, r8 - ldrb r0, [r1] - movs r1, 0x19 - bl b_history__record_ability_usage_of_player -_08047508: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end b_wonderguard_and_levitate - - thumb_func_start b_attack_effectivity_adapt -b_attack_effectivity_adapt: @ 804752C - push {r4-r7,lr} - adds r6, r2, 0 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 16 - lsrs r5, r1, 16 - ldr r7, =0x020241f0 - ldr r0, [r7] - muls r0, r4 - movs r1, 0xA - bl __divsi3 - str r0, [r7] - cmp r0, 0 - bne _08047552 - cmp r4, 0 - beq _08047552 - movs r0, 0x1 - str r0, [r7] -_08047552: - cmp r4, 0x5 - beq _0804757A - cmp r4, 0x5 - bgt _08047564 - cmp r4, 0 - beq _0804756A - b _080475DE - .pool -_08047564: - cmp r4, 0x14 - beq _080475AC - b _080475DE -_0804756A: - ldrb r0, [r6] - movs r1, 0x8 - orrs r0, r1 - movs r1, 0xFB - ands r0, r1 - movs r1, 0xFD - ands r0, r1 - b _080475DC -_0804757A: - ldr r0, =gBattleMoves - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0 - beq _080475DE - ldrb r1, [r6] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _080475DE - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080475A8 - movs r0, 0xFD - ands r0, r1 - b _080475DC - .pool -_080475A8: - movs r0, 0x4 - b _080475DA -_080475AC: - ldr r0, =gBattleMoves - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0 - beq _080475DE - ldrb r1, [r6] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _080475DE - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080475D8 - movs r0, 0xFB - ands r0, r1 - b _080475DC - .pool -_080475D8: - movs r0, 0x2 -_080475DA: - orrs r0, r1 -_080475DC: - strb r0, [r6] -_080475DE: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end b_attack_effectivity_adapt - - thumb_func_start move_effectiveness_something -move_effectiveness_something: @ 80475E4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x4] - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - movs r0, 0 - mov r8, r0 - mov r0, sp - mov r1, r8 - strb r1, [r0] - mov r2, r10 - cmp r2, 0xA5 - bne _08047616 - movs r0, 0 - b _0804779E -_08047616: - ldr r1, =gBattleMoves - mov r3, r10 - lsls r2, r3, 1 - adds r0, r2, r3 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x2] - str r0, [sp, 0x8] - ldr r1, =0x02024084 - movs r0, 0x58 - ldr r3, [sp, 0x4] - muls r0, r3 - adds r3, r0, r1 - adds r0, r3, 0 - adds r0, 0x21 - ldrb r0, [r0] - str r2, [sp, 0xC] - adds r5, r1, 0 - ldr r1, [sp, 0x8] - cmp r0, r1 - beq _0804764A - adds r0, r3, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, r1 - bne _0804765C -_0804764A: - ldr r4, =0x020241f0 - ldr r1, [r4] - lsls r0, r1, 4 - subs r0, r1 - str r0, [r4] - movs r1, 0xA - bl __divsi3 - str r0, [r4] -_0804765C: - movs r0, 0x58 - mov r2, r9 - muls r2, r0 - adds r0, r2, 0 - adds r0, r5 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1A - bne _08047690 - ldr r3, [sp, 0x8] - cmp r3, 0x4 - bne _08047690 - movs r1, 0x9 - mov r0, sp - ldrb r0, [r0] - orrs r0, r1 - mov r1, sp - strb r0, [r1] - b _08047740 - .pool -_08047690: - ldr r1, =gUnknown_0831ACE8 - mov r2, r8 - adds r0, r2, r1 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0xFF - beq _08047740 - cmp r0, 0xFE - bne _080476B6 - movs r0, 0x58 - mov r3, r9 - muls r3, r0 - adds r0, r3, 0 - b _0804772E - .pool -_080476B0: - movs r0, 0x3 - add r8, r0 - b _08047718 -_080476B6: - ldr r7, =gUnknown_0831ACE8 - mov r1, r8 - adds r0, r1, r7 - ldrb r0, [r0] - ldr r2, [sp, 0x8] - cmp r0, r2 - bne _08047710 - adds r1, 0x1 - adds r1, r7 - ldr r2, =0x02024084 - movs r0, 0x58 - mov r3, r9 - muls r3, r0 - adds r0, r3, 0 - adds r5, r0, r2 - adds r6, r5, 0 - adds r6, 0x21 - ldrb r4, [r1] - ldrb r0, [r6] - cmp r4, r0 - bne _080476F0 - mov r0, r8 - adds r0, 0x2 - adds r0, r7 - ldrb r0, [r0] - mov r1, r10 - mov r2, sp - bl b_attack_effectivity_adapt -_080476F0: - adds r0, r5, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r4, r0 - bne _08047710 - ldrb r0, [r6] - cmp r0, r4 - beq _08047710 - mov r0, r8 - adds r0, 0x2 - adds r0, r7 - ldrb r0, [r0] - mov r1, r10 - mov r2, sp - bl b_attack_effectivity_adapt -_08047710: - movs r1, 0x3 - add r8, r1 - ldr r5, =0x02024084 - ldr r2, =gUnknown_0831ACE8 -_08047718: - mov r3, r8 - adds r0, r3, r2 - ldrb r0, [r0] - cmp r0, 0xFF - beq _08047740 - cmp r0, 0xFE - bne _080476B6 - movs r0, 0x58 - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 -_0804772E: - adds r1, r5, 0 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 22 - ands r0, r1 - cmp r0, 0 - beq _080476B0 -_08047740: - movs r0, 0x58 - mov r2, r9 - muls r2, r0 - adds r0, r2, 0 - adds r0, r5 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x19 - bne _0804779A - mov r0, sp - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0804779A - ldr r0, [sp, 0x4] - mov r1, r10 - bl move_weather_interaction - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x2 - bne _0804779A - mov r0, sp - ldrb r3, [r0] - adds r0, r1, 0 - ands r0, r3 - cmp r0, 0 - beq _08047782 - movs r0, 0x6 - ands r0, r3 - cmp r0, 0x6 - bne _0804779A -_08047782: - ldr r0, =gBattleMoves - ldr r1, [sp, 0xC] - add r1, r10 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0 - beq _0804779A - mov r0, sp - movs r1, 0x1 - orrs r1, r3 - strb r1, [r0] -_0804779A: - mov r0, sp - ldrb r0, [r0] -_0804779E: - 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 move_effectiveness_something - - thumb_func_start ai_rate_move -ai_rate_move: @ 80477BC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x4] - movs r7, 0 - mov r0, sp - strb r7, [r0] - ldr r2, =gBaseStats - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x6] - mov r9, r1 - ldrb r0, [r0, 0x7] - mov r8, r0 - cmp r6, 0xA5 - bne _080477FC - movs r0, 0 - b _080478A0 - .pool -_080477FC: - ldr r2, =gBattleMoves - lsls r1, r6, 1 - adds r0, r1, r6 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x2] - mov r10, r0 - str r1, [sp, 0x8] - ldr r3, [sp, 0x4] - cmp r3, 0x1A - bne _08047824 - cmp r0, 0x4 - bne _08047824 - movs r1, 0x9 - mov r0, sp - strb r1, [r0] - b _0804786A - .pool -_08047824: - ldr r0, =gUnknown_0831ACE8 - adds r1, r7, r0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _0804786A - adds r4, r1, 0 -_08047830: - ldrb r0, [r4] - cmp r0, 0xFE - beq _0804785C - cmp r0, r10 - bne _0804785C - ldrb r5, [r4, 0x1] - cmp r5, r9 - bne _0804784A - ldrb r0, [r4, 0x2] - adds r1, r6, 0 - mov r2, sp - bl b_attack_effectivity_adapt -_0804784A: - cmp r5, r8 - bne _0804785C - cmp r9, r8 - beq _0804785C - ldrb r0, [r4, 0x2] - adds r1, r6, 0 - mov r2, sp - bl b_attack_effectivity_adapt -_0804785C: - adds r4, 0x3 - adds r7, 0x3 - ldr r1, =gUnknown_0831ACE8 - adds r0, r7, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _08047830 -_0804786A: - ldr r3, [sp, 0x4] - cmp r3, 0x19 - bne _0804789C - mov r0, sp - ldrb r2, [r0] - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - beq _08047884 - movs r0, 0x6 - ands r0, r2 - cmp r0, 0x6 - bne _0804789C -_08047884: - ldr r0, =gBattleMoves - ldr r3, [sp, 0x8] - adds r1, r3, r6 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0 - beq _0804789C - mov r0, sp - movs r1, 0x8 - orrs r1, r2 - strb r1, [r0] -_0804789C: - mov r0, sp - ldrb r0, [r0] -_080478A0: - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end ai_rate_move - - thumb_func_start sub_80478B8 -sub_80478B8: @ 80478B8 - push {r4,lr} - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF - ands r0, r1 - movs r1, 0x64 - subs r1, r0 - lsls r1, 16 - lsrs r1, 16 - ldr r4, =0x020241f0 - ldr r0, [r4] - cmp r0, 0 - beq _080478EA - muls r0, r1 - str r0, [r4] - movs r1, 0x64 - bl __divsi3 - str r0, [r4] - cmp r0, 0 - bne _080478EA - movs r0, 0x1 - str r0, [r4] -_080478EA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80478B8 - - thumb_func_start atk07_cmd7 -atk07_cmd7: @ 80478F4 - push {r4-r7,lr} - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF - ands r0, r1 - movs r1, 0x64 - subs r1, r0 - lsls r1, 16 - lsrs r1, 16 - ldr r4, =0x020241f0 - ldr r0, [r4] - cmp r0, 0 - beq _08047926 - muls r0, r1 - str r0, [r4] - movs r1, 0x64 - bl __divsi3 - str r0, [r4] - cmp r0, 0 - bne _08047926 - movs r0, 0x1 - str r0, [r4] -_08047926: - ldr r7, =0x02024084 - ldr r6, =0x0202420c - ldrb r2, [r6] - movs r5, 0x58 - adds r0, r2, 0 - muls r0, r5 - adds r1, r0, r7 - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _0804795C - ldr r1, =0x02024404 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r4, [r0, 0x7] - ldrb r6, [r0, 0x1A] - b _08047976 - .pool -_0804795C: - ldrh r0, [r1, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r4, r0, 24 - ldrb r0, [r6] - muls r0, r5 - adds r0, r7 - ldrh r0, [r0, 0x2E] - bl itemid_get_quality - lsls r0, 24 - lsrs r6, r0, 24 -_08047976: - ldr r1, =0x0202420f - ldr r5, =0x0202420c - ldrb r0, [r5] - strb r0, [r1] - cmp r4, 0x27 - bne _080479B4 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, r6 - bcs _080479B4 - ldrb r0, [r5] - movs r1, 0x27 - bl b_history__record_item_x12_of_player - ldr r2, =0x0202437c - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] -_080479B4: - ldr r2, =0x02024084 - ldr r3, =0x0202420c - ldrb r4, [r3] - movs r0, 0x58 - muls r0, r4 - adds r1, r2, 0 - adds r1, 0x50 - adds r0, r1 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r1, r0 - adds r5, r2, 0 - cmp r1, 0 - bne _08047A84 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x65 - beq _08047A06 - ldr r0, =0x0202433c - lsls r1, r4, 4 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 30 - cmp r0, 0 - blt _08047A06 - ldr r0, =0x0202437c - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - lsrs r0, 7 - cmp r0, 0 - beq _08047A84 -_08047A06: - ldrb r0, [r3] - movs r4, 0x58 - muls r0, r4 - adds r0, r5 - ldrh r1, [r0, 0x28] - ldr r2, =0x020241f0 - ldr r0, [r2] - cmp r1, r0 - bgt _08047A84 - subs r0, r1, 0x1 - str r0, [r2] - ldr r1, =0x0202433c - ldrb r3, [r3] - lsls r0, r3, 4 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - bge _08047A5C - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - b _08047A84 - .pool -_08047A5C: - ldr r0, =0x0202437c - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - lsrs r0, 7 - cmp r0, 0 - beq _08047A84 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024208 - adds r0, r3, 0 - muls r0, r4 - adds r0, r5 - ldrh r0, [r0, 0x2E] - strh r0, [r1] -_08047A84: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk07_cmd7 - - thumb_func_start atk08_cmd8 -atk08_cmd8: @ 8047AA4 - push {r4-r7,lr} - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF - ands r0, r1 - movs r1, 0x64 - subs r1, r0 - lsls r1, 16 - lsrs r1, 16 - ldr r4, =0x020241f0 - ldr r0, [r4] - cmp r0, 0 - beq _08047AD6 - muls r0, r1 - str r0, [r4] - movs r1, 0x64 - bl __divsi3 - str r0, [r4] - cmp r0, 0 - bne _08047AD6 - movs r0, 0x1 - str r0, [r4] -_08047AD6: - ldr r7, =0x02024084 - ldr r6, =0x0202420c - ldrb r2, [r6] - movs r5, 0x58 - adds r0, r2, 0 - muls r0, r5 - adds r1, r0, r7 - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _08047B0C - ldr r1, =0x02024404 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r4, [r0, 0x7] - ldrb r6, [r0, 0x1A] - b _08047B26 - .pool -_08047B0C: - ldrh r0, [r1, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r4, r0, 24 - ldrb r0, [r6] - muls r0, r5 - adds r0, r7 - ldrh r0, [r0, 0x2E] - bl itemid_get_quality - lsls r0, 24 - lsrs r6, r0, 24 -_08047B26: - ldr r1, =0x0202420f - ldr r5, =0x0202420c - ldrb r0, [r5] - strb r0, [r1] - cmp r4, 0x27 - bne _08047B64 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, r6 - bcs _08047B64 - ldrb r0, [r5] - movs r1, 0x27 - bl b_history__record_item_x12_of_player - ldr r2, =0x0202437c - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] -_08047B64: - ldr r4, =0x02024084 - ldr r6, =0x0202420c - ldrb r2, [r6] - movs r7, 0x58 - adds r3, r2, 0 - muls r3, r7 - adds r0, r4, 0 - adds r0, 0x50 - adds r0, r3, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - bne _08047C10 - ldr r5, =0x0202433c - lsls r0, r2, 4 - adds r0, r5 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - blt _08047BA2 - ldr r0, =0x0202437c - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - lsrs r0, 7 - cmp r0, 0 - beq _08047C10 -_08047BA2: - adds r0, r3, r4 - ldrh r1, [r0, 0x28] - ldr r2, =0x020241f0 - ldr r0, [r2] - cmp r1, r0 - bgt _08047C10 - subs r0, r1, 0x1 - str r0, [r2] - ldrb r3, [r6] - lsls r0, r3, 4 - adds r0, r5 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - bge _08047BE8 - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - b _08047C10 - .pool -_08047BE8: - ldr r0, =0x0202437c - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - lsrs r0, 7 - cmp r0, 0 - beq _08047C10 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024208 - adds r0, r3, 0 - muls r0, r7 - adds r0, r4 - ldrh r0, [r0, 0x2E] - strh r0, [r1] -_08047C10: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk08_cmd8 - - thumb_func_start atk09_attackanimation -atk09_attackanimation: @ 8047C30 - push {r4-r7,lr} - sub sp, 0x10 - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _08047C3E - b _08047DB6 -_08047C3E: - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - ldr r5, =0x020241ea - cmp r0, 0 - beq _08047C8C - ldrh r0, [r5] - cmp r0, 0x90 - beq _08047C8C - cmp r0, 0xA4 - beq _08047C8C - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DABB9 - str r0, [r4] - ldr r1, =0x02024474 - ldrb r0, [r1, 0x18] - adds r0, 0x1 - strb r0, [r1, 0x18] - ldrb r0, [r1, 0x19] - adds r0, 0x1 - strb r0, [r1, 0x19] - b _08047DB6 - .pool -_08047C8C: - ldr r2, =gBattleMoves - ldrh r1, [r5] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x6] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - bne _08047CB2 - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _08047CB2 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08047CBA -_08047CB2: - ldr r0, =0x02024474 - ldrb r0, [r0, 0x19] - cmp r0, 0 - bne _08047D88 -_08047CBA: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _08047DA8 - ldr r1, =0x02024064 - ldr r3, =0x0202420b - ldrb r0, [r3] - strb r0, [r1] - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - adds r4, r1, 0 - muls r4, r0 - adds r0, r2, 0 - adds r0, 0x50 - adds r0, r4, r0 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r1, r0 - adds r7, r3, 0 - mov r12, r2 - cmp r1, 0 - beq _08047D18 - ldr r0, =0x02024212 - ldrb r6, [r0] - b _08047D42 - .pool -_08047D18: - ldr r3, =0x02024212 - ldrb r0, [r3] - cmp r0, 0x1 - bls _08047D40 - mov r1, r12 - adds r0, r4, r1 - ldrh r2, [r0, 0x28] - ldr r0, =0x020241f0 - ldr r1, [r0] - movs r6, 0x1 - adds r4, r0, 0 - cmp r2, r1 - ble _08047D44 - ldrb r6, [r3] - b _08047D44 - .pool -_08047D40: - ldrb r6, [r3] -_08047D42: - ldr r4, =0x020241f0 -_08047D44: - ldrh r1, [r5] - ldr r5, =0x02024474 - ldrb r2, [r5, 0x18] - ldr r0, =0x020244e0 - ldrh r3, [r0] - ldr r0, [r4] - str r0, [sp] - ldrb r4, [r7] - movs r0, 0x58 - muls r0, r4 - add r0, r12 - adds r0, 0x2B - ldrb r0, [r0] - str r0, [sp, 0x4] - ldrb r4, [r7] - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - ldr r4, =0x020242bc - adds r0, r4 - str r0, [sp, 0x8] - str r6, [sp, 0xC] - movs r0, 0 - bl dp01_build_cmdbuf_x0F_aa_b_cc_dddd_e_mlc_weather_00_x1Cbytes - ldrb r0, [r5, 0x18] - adds r0, 0x1 - strb r0, [r5, 0x18] - ldrb r0, [r5, 0x19] - adds r0, 0x1 - strb r0, [r5, 0x19] - ldrb r0, [r7] - bl dp01_battle_side_mark_buffer_for_execution -_08047D88: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - b _08047DB6 - .pool -_08047DA8: - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DABB9 - str r0, [r4] -_08047DB6: - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk09_attackanimation - - thumb_func_start sub_8047DC8 -sub_8047DC8: @ 8047DC8 - push {lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _08047DDA - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_08047DDA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8047DC8 - - thumb_func_start atk0B_graphicalhpupdate -atk0B_graphicalhpupdate: @ 8047DE8 - push {r4,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _08047EAA - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _08047EA2 - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r2, =0x02024064 - strb r0, [r2] - ldr r1, =0x02024084 - ldrb r2, [r2] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08047E68 - ldr r0, =0x020242bc - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xA] - cmp r0, 0 - beq _08047E68 - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 1 - ands r0, r1 - cmp r0, 0 - bne _08047E68 - movs r0, 0x80 - adds r1, r2, 0 - bl b_std_message - b _08047EA2 - .pool -_08047E68: - ldr r0, =0x020241f0 - ldr r0, [r0] - ldr r1, =0x00002710 - cmp r0, r1 - bgt _08047E76 - lsls r0, 16 - lsrs r1, r0, 16 -_08047E76: - movs r0, 0 - bl dp01_build_cmdbuf_x18_0_aa_health_bar_update - ldr r4, =0x02024064 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08047EA2 - ldr r0, =0x020241f0 - ldr r0, [r0] - cmp r0, 0 - ble _08047EA2 - ldr r0, =0x03005d10 - ldrb r1, [r0, 0x5] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0, 0x5] -_08047EA2: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] -_08047EAA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk0B_graphicalhpupdate - - thumb_func_start atk0C_datahpupdate -atk0C_datahpupdate: @ 8047EC4 - push {r4-r7,lr} - sub sp, 0x4 - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _08047ED2 - b _080482A2 -_08047ED2: - ldr r0, =0x0202449c - ldr r0, [r0] - ldrb r1, [r0, 0x13] - cmp r1, 0 - beq _08047EF4 - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08047EF4 - movs r6, 0x3F - ands r6, r1 - b _08047F04 - .pool -_08047EF4: - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r6, [r0, 0x2] -_08047F04: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _08047F12 - b _08048274 -_08047F12: - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r7, =0x02024064 - strb r0, [r7] - ldr r1, =0x02024084 - ldrb r2, [r7] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08048028 - ldr r0, =0x020242bc - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r4, r1, r0 - ldrb r1, [r4, 0xA] - mov r12, r0 - cmp r1, 0 - beq _08048028 - ldr r0, =0x02024280 - ldr r3, [r0] - movs r0, 0x80 - lsls r0, 1 - ands r3, r0 - cmp r3, 0 - bne _08048028 - adds r5, r1, 0 - ldr r6, =0x020241f0 - ldr r4, [r6] - cmp r5, r4 - blt _08047FBC - ldr r0, =0x0202437c - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 2 - adds r0, 0x4 - adds r1, r0 - ldr r0, [r1] - cmp r0, 0 - bne _08047F76 - str r4, [r1] -_08047F76: - ldrb r0, [r7] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - add r1, r12 - ldr r2, [r6] - ldrb r0, [r1, 0xA] - subs r0, r2 - strb r0, [r1, 0xA] - ldr r1, =0x020241f4 - ldr r0, [r6] - str r0, [r1] - b _08047FEC - .pool -_08047FBC: - ldr r0, =0x0202437c - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 2 - adds r0, 0x4 - adds r1, r0 - ldr r0, [r1] - cmp r0, 0 - bne _08047FD0 - str r5, [r1] -_08047FD0: - ldr r2, =0x020241f4 - ldrb r1, [r7] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - ldrb r0, [r0, 0xA] - str r0, [r2] - ldrb r1, [r7] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - strb r3, [r0, 0xA] -_08047FEC: - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - ldrb r0, [r0, 0xA] - cmp r0, 0 - beq _08048000 - b _0804829A -_08048000: - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - bl b_movescr_stack_push_cursor - ldr r0, =gUnknown_082DB6FB - str r0, [r4] - b _080482A2 - .pool -_08048028: - ldr r0, =0x02024280 - ldr r2, [r0] - ldr r1, =0xfffffeff - ands r2, r1 - str r2, [r0] - ldr r1, =0x020241f0 - ldr r5, [r1] - mov r12, r0 - adds r7, r1, 0 - cmp r5, 0 - bge _0804807C - ldr r4, =0x02024084 - ldr r2, =0x02024064 - ldrb r0, [r2] - movs r3, 0x58 - adds r1, r0, 0 - muls r1, r3 - adds r1, r4 - ldrh r0, [r1, 0x28] - subs r0, r5 - strh r0, [r1, 0x28] - ldrb r0, [r2] - muls r0, r3 - adds r1, r0, r4 - ldrh r3, [r1, 0x2C] - ldrh r0, [r1, 0x28] - adds r5, r2, 0 - cmp r0, r3 - bhi _08048064 - b _0804823A -_08048064: - strh r3, [r1, 0x28] - b _0804823A - .pool -_0804807C: - movs r0, 0x20 - ands r0, r2 - cmp r0, 0 - beq _08048098 - movs r0, 0x21 - negs r0, r0 - ands r2, r0 - mov r0, r12 - str r2, [r0] - ldr r5, =0x02024064 - b _080480E0 - .pool -_08048098: - ldr r0, =0x020241f8 - ldr r2, =0x02024064 - ldrb r1, [r2] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - adds r0, r5 - str r0, [r1] - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - adds r5, r2, 0 - cmp r0, 0 - bne _080480D4 - ldr r1, =0x02024288 - ldrb r0, [r5] - adds r0, r1 - ldr r1, =0x0202420b - b _080480DC - .pool -_080480D4: - ldr r1, =0x02024288 - ldrb r0, [r5] - adds r0, r1 - ldr r1, =0x0202420c -_080480DC: - ldrb r1, [r1] - strb r1, [r0] -_080480E0: - ldr r4, =0x02024084 - ldrb r0, [r5] - movs r3, 0x58 - muls r0, r3 - adds r2, r0, r4 - ldrh r0, [r2, 0x28] - ldr r1, [r7] - cmp r0, r1 - ble _08048110 - subs r0, r1 - strh r0, [r2, 0x28] - ldr r0, =0x020241f4 - str r1, [r0] - adds r7, r0, 0 - b _08048120 - .pool -_08048110: - ldr r2, =0x020241f4 - str r0, [r2] - ldrb r0, [r5] - muls r0, r3 - adds r0, r4 - movs r1, 0 - strh r1, [r0, 0x28] - adds r7, r2, 0 -_08048120: - ldr r2, =0x0202437c - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r1, r2, 0x4 - adds r3, r0, r1 - ldr r0, [r3] - adds r4, r2, 0 - cmp r0, 0 - bne _08048148 - mov r1, r12 - ldr r0, [r1] - movs r1, 0x80 - lsls r1, 13 - ands r0, r1 - cmp r0, 0 - bne _08048148 - ldr r0, [r7] - str r0, [r3] -_08048148: - cmp r6, 0x8 - bhi _080481D0 - mov r1, r12 - ldr r0, [r1] - movs r1, 0x80 - lsls r1, 13 - ands r0, r1 - cmp r0, 0 - bne _080481CC - ldr r0, =0x020241ea - ldrh r0, [r0] - cmp r0, 0xDC - beq _080481CC - ldr r3, =0x0202433c - ldrb r0, [r5] - lsls r0, 4 - adds r1, r3, 0x4 - adds r0, r1 - ldr r2, [r7] - str r2, [r0] - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x8 - adds r0, r1 - str r2, [r0] - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _080481AC - ldrb r0, [r5] - lsls r0, 4 - adds r0, r3 - ldr r2, =0x0202420b - b _080481B4 - .pool -_080481AC: - ldrb r0, [r5] - lsls r0, 4 - adds r0, r3 - ldr r2, =0x0202420c -_080481B4: - ldrb r1, [r2] - strb r1, [r0, 0xC] - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r2] - strb r1, [r0, 0x10] - b _0804823A - .pool -_080481CC: - cmp r6, 0x8 - bls _0804823A -_080481D0: - mov r1, r12 - ldr r0, [r1] - movs r1, 0x80 - lsls r1, 13 - ands r0, r1 - cmp r0, 0 - bne _0804823A - ldr r3, =0x0202433c - ldrb r0, [r5] - lsls r0, 4 - adds r1, r3, 0 - adds r1, 0x8 - adds r0, r1 - ldr r2, [r7] - str r2, [r0] - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0xC - adds r0, r1 - str r2, [r0] - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _08048220 - ldrb r0, [r5] - lsls r0, 4 - adds r0, r3 - ldr r2, =0x0202420b - b _08048228 - .pool -_08048220: - ldrb r0, [r5] - lsls r0, 4 - adds r0, r3 - ldr r2, =0x0202420c -_08048228: - ldrb r1, [r2] - strb r1, [r0, 0xD] - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r2] - strb r1, [r0, 0x11] -_0804823A: - mov r1, r12 - ldr r0, [r1] - ldr r1, =0xffefffff - ands r0, r1 - mov r1, r12 - str r0, [r1] - ldrb r1, [r5] - movs r0, 0x58 - muls r0, r1 - ldr r1, =0x020240ac - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x2A - movs r2, 0 - movs r3, 0x2 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - b _0804829A - .pool -_08048274: - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r1, =0x02024064 - strb r0, [r1] - ldr r2, =0x0202437c - ldrb r1, [r1] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x4 - adds r1, r0, r2 - ldr r0, [r1] - cmp r0, 0 - bne _0804829A - ldr r0, =0x0000ffff - str r0, [r1] -_0804829A: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] -_080482A2: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk0C_datahpupdate - - thumb_func_start atk0D_critmessage -atk0D_critmessage: @ 80482BC - push {lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _080482F2 - ldr r0, =0x02024211 - ldrb r0, [r0] - cmp r0, 0x2 - bne _080482EA - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _080482EA - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0xD9 - bl b_std_message - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x7] -_080482EA: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_080482F2: - pop {r0} - bx r0 - .pool - thumb_func_end atk0D_critmessage - - thumb_func_start atk0E_missmessage -atk0E_missmessage: @ 8048310 - push {r4,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _080483D0 - ldr r4, =0x02024064 - ldr r0, =0x0202420c - ldrb r0, [r0] - strb r0, [r4] - ldr r1, =0x0202427c - ldrb r2, [r1] - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - bne _080483C8 - movs r0, 0xFE - ands r0, r2 - cmp r0, 0x10 - beq _08048382 - cmp r0, 0x10 - bgt _0804835E - cmp r0, 0x4 - beq _08048372 - cmp r0, 0x4 - bgt _08048358 - cmp r0, 0x2 - beq _0804836C - b _08048382 - .pool -_08048358: - cmp r0, 0x8 - beq _080483C8 - b _08048382 -_0804835E: - cmp r0, 0x40 - beq _08048382 - cmp r0, 0x40 - bgt _08048382 - cmp r0, 0x20 - beq _080483C8 - b _08048382 -_0804836C: - movs r0, 0 - movs r1, 0xE - b _08048376 -_08048372: - movs r0, 0 - movs r1, 0xC -_08048376: - bl dp01_build_cmdbuf_x2B_aa_0 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _080483C8 -_08048382: - ldrb r1, [r1] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08048392 - movs r0, 0 - movs r1, 0xE - b _0804839E -_08048392: - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080483B0 - movs r0, 0 - movs r1, 0xC -_0804839E: - bl dp01_build_cmdbuf_x2B_aa_0 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - b _080483C8 - .pool -_080483B0: - movs r0, 0x28 - ands r0, r1 - cmp r0, 0 - bne _080483C8 - movs r0, 0 - movs r1, 0xD - bl dp01_build_cmdbuf_x2B_aa_0 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution -_080483C8: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_080483D0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk0E_missmessage - - thumb_func_start atk0F_resultmessage -atk0F_resultmessage: @ 80483E0 - push {r4-r7,lr} - movs r3, 0 - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _080483EE - b _08048580 -_080483EE: - ldr r1, =0x0202427c - ldrb r2, [r1] - movs r4, 0x1 - adds r0, r4, 0 - ands r0, r2 - adds r6, r1, 0 - ldr r7, =0x02024332 - cmp r0, 0 - beq _0804842C - movs r0, 0x8 - ands r0, r2 - cmp r0, 0 - beq _0804840E - ldrb r0, [r7, 0x6] - cmp r0, 0x2 - bls _0804842C -_0804840E: - ldr r1, =gUnknown_085CC834 - ldrb r0, [r7, 0x6] - lsls r0, 1 - adds r0, r1 - ldrh r3, [r0] - strb r4, [r7, 0x7] - b _0804856A - .pool -_0804842C: - movs r0, 0x1 - strb r0, [r7, 0x7] - ldrb r5, [r6] - movs r0, 0xFE - ands r0, r5 - cmp r0, 0x10 - beq _08048470 - cmp r0, 0x10 - bgt _08048452 - cmp r0, 0x4 - beq _0804846C - cmp r0, 0x4 - bgt _0804844C - cmp r0, 0x2 - beq _08048468 - b _080484B8 -_0804844C: - cmp r0, 0x8 - beq _080484C4 - b _080484B8 -_08048452: - cmp r0, 0x40 - beq _08048474 - cmp r0, 0x40 - bgt _08048462 - cmp r0, 0x20 - bne _08048460 - b _08048564 -_08048460: - b _080484B8 -_08048462: - cmp r0, 0x80 - beq _08048478 - b _080484B8 -_08048468: - movs r3, 0xDE - b _0804856E -_0804846C: - movs r3, 0xDD - b _0804856E -_08048470: - movs r3, 0xDA - b _0804856E -_08048474: - movs r3, 0x99 - b _0804856E -_08048478: - ldr r4, =0x02024208 - ldr r2, =0x02024084 - ldr r3, =0x0202420c - ldrb r1, [r3] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x2E] - strh r0, [r4] - ldr r1, =0x0202420f - ldrb r0, [r3] - strb r0, [r1] - movs r0, 0x3F - ands r0, r5 - strb r0, [r6] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB816 - b _0804857E - .pool -_080484B8: - adds r2, r6, 0 - ldrb r5, [r2] - movs r0, 0x8 - ands r0, r5 - cmp r0, 0 - beq _080484C8 -_080484C4: - movs r3, 0x1B - b _0804856E -_080484C8: - movs r0, 0x10 - ands r0, r5 - cmp r0, 0 - beq _080484F0 - movs r0, 0xEF - ands r0, r5 - movs r1, 0xFD - ands r0, r1 - movs r1, 0xFB - ands r0, r1 - strb r0, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB1CE - b _0804857E - .pool -_080484F0: - movs r0, 0x40 - ands r0, r5 - cmp r0, 0 - beq _08048510 - movs r0, 0x3F - ands r0, r5 - strb r0, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB1C7 - b _0804857E - .pool -_08048510: - movs r0, 0x80 - ands r0, r5 - cmp r0, 0 - beq _08048558 - ldr r4, =0x02024208 - ldr r2, =0x02024084 - ldr r3, =0x0202420c - ldrb r1, [r3] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x2E] - strh r0, [r4] - ldr r1, =0x0202420f - ldrb r0, [r3] - strb r0, [r1] - movs r0, 0x3F - ands r0, r5 - strb r0, [r6] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB816 - b _0804857E - .pool -_08048558: - movs r0, 0x20 - ands r0, r5 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _08048568 -_08048564: - movs r3, 0xE5 - b _0804856E -_08048568: - strb r0, [r7, 0x7] -_0804856A: - cmp r3, 0 - beq _08048578 -_0804856E: - adds r0, r3, 0 - ldr r1, =0x0202420b - ldrb r1, [r1] - bl b_std_message -_08048578: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 -_0804857E: - str r0, [r1] -_08048580: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk0F_resultmessage - - thumb_func_start atk10_printstring -atk10_printstring: @ 8048590 - push {r4,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _080485BA - ldr r4, =0x02024214 - ldr r1, [r4] - ldrb r0, [r1, 0x1] - ldrb r1, [r1, 0x2] - lsls r1, 8 - orrs r0, r1 - ldr r1, =0x0202420b - ldrb r1, [r1] - bl b_std_message - ldr r0, [r4] - adds r0, 0x3 - str r0, [r4] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x7] -_080485BA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk10_printstring - - thumb_func_start atk11_printstring2 -atk11_printstring2: @ 80485D0 - push {r4,r5,lr} - ldr r5, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r5] - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r1, [r0, 0x1] - ldrb r0, [r0, 0x2] - lsls r0, 8 - orrs r1, r0 - movs r0, 0 - bl dp01_build_cmdbuf_x11_TODO - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r4] - adds r0, 0x3 - str r0, [r4] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x7] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk11_printstring2 - - thumb_func_start atk12_waitmessage -atk12_waitmessage: @ 8048614 - push {r4-r6,lr} - ldr r0, =0x02024068 - ldr r4, [r0] - cmp r4, 0 - bne _08048662 - ldr r6, =0x02024332 - ldrb r0, [r6, 0x7] - cmp r0, 0 - bne _0804863C - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x3 - str r0, [r1] - b _08048662 - .pool -_0804863C: - ldr r5, =0x02024214 - ldr r2, [r5] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldr r3, =0x0202432c - ldrh r0, [r3] - adds r0, 0x1 - strh r0, [r3] - lsls r0, 16 - lsrs r0, 16 - cmp r0, r1 - bcc _08048662 - movs r1, 0 - strh r4, [r3] - adds r0, r2, 0x3 - str r0, [r5] - strb r1, [r6, 0x7] -_08048662: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atk12_waitmessage - - thumb_func_start atk13_printfromtable -atk13_printfromtable: @ 8048670 - push {r4,r5,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _080486AE - ldr r4, =0x02024214 - ldr r2, [r4] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - ldr r5, =0x02024332 - ldrb r0, [r5, 0x5] - lsls r0, 1 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =0x0202420b - ldrb r1, [r1] - bl b_std_message - ldr r0, [r4] - adds r0, 0x5 - str r0, [r4] - movs r0, 0x1 - strb r0, [r5, 0x7] -_080486AE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk13_printfromtable - - thumb_func_start atk14_printfromtable2 -atk14_printfromtable2: @ 80486C4 - push {r4-r6,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0804870E - ldr r5, =0x02024214 - ldr r2, [r5] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - ldr r6, =0x02024332 - ldrb r0, [r6, 0x5] - lsls r0, 1 - adds r1, r0 - ldr r4, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r4] - ldrh r1, [r1] - movs r0, 0 - bl dp01_build_cmdbuf_x11_TODO - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r5] - adds r0, 0x5 - str r0, [r5] - movs r0, 0x1 - strb r0, [r6, 0x7] -_0804870E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atk14_printfromtable2 - - thumb_func_start sub_8048728 -sub_8048728: @ 8048728 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0 - ldr r0, =0x0202406c - ldrb r3, [r0] - cmp r1, r3 - bge _0804874E - ldr r4, =0x0202407e - ldrb r0, [r4] - cmp r0, r2 - beq _0804874E -_08048740: - adds r1, 0x1 - cmp r1, r3 - bge _0804874E - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, r2 - bne _08048740 -_0804874E: - lsls r0, r1, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8048728 - - thumb_func_start sub_8048760 -sub_8048760: @ 8048760 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - movs r0, 0 - mov r10, r0 - movs r7, 0 - movs r1, 0x1 - str r1, [sp, 0x4] - ldr r1, =0x02024332 - ldrb r3, [r1, 0x3] - movs r0, 0x40 - ands r0, r3 - cmp r0, 0 - beq _080487B8 - ldr r2, =0x0202420e - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r2] - movs r0, 0xBF - ands r0, r3 - adds r3, r1, 0 - strb r0, [r3, 0x3] - movs r7, 0x40 - ldr r1, =0x02024474 - ldr r0, =0x0202420c - b _080487C4 - .pool -_080487B8: - ldr r2, =0x0202420e - ldr r0, =0x0202420c - ldrb r0, [r0] - strb r0, [r2] - ldr r1, =0x02024474 - ldr r0, =0x0202420b -_080487C4: - ldrb r0, [r0] - strb r0, [r1, 0x17] - mov r9, r2 - ldr r2, =0x02024084 - mov r4, r9 - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x13 - bne _08048828 - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 6 - ands r0, r1 - cmp r0, 0 - bne _08048828 - cmp r5, 0 - bne _08048828 - ldr r1, =0x02024332 - ldrb r0, [r1, 0x3] - cmp r0, 0x9 - bhi _08048828 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r2, =0x02024332 - strb r5, [r2, 0x3] - bl _080499B8 - .pool -_08048828: - mov r3, r9 - ldrb r0, [r3] - bl battle_get_per_side_status - ldr r2, =0x0202428e - movs r1, 0x1 - ands r1, r0 - lsls r1, 1 - adds r1, r2 - ldrh r1, [r1] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08048880 - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 6 - ands r0, r1 - cmp r0, 0 - bne _08048880 - cmp r5, 0 - bne _08048880 - ldr r0, =0x02024332 - ldrb r1, [r0, 0x3] - cmp r1, 0x7 - bhi _08048880 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r4, =0x02024332 - strb r5, [r4, 0x3] - bl _080499B8 - .pool -_08048880: - ldr r3, =0x02024084 - ldr r2, =0x0202420e - ldrb r1, [r2] - movs r0, 0x58 - muls r0, r1 - adds r0, r3 - ldrh r4, [r0, 0x28] - mov r9, r2 - mov r8, r3 - cmp r4, 0 - bne _080488C4 - ldr r1, =0x02024332 - ldrb r0, [r1, 0x3] - cmp r0, 0xB - beq _080488C4 - cmp r0, 0x1F - beq _080488C4 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r2, =0x02024332 - strb r4, [r2, 0x3] - bl _080499B8 - .pool -_080488C4: - mov r3, r9 - ldrb r1, [r3] - movs r0, 0x58 - muls r0, r1 - mov r1, r8 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _080488FC - cmp r7, 0x40 - beq _080488FC - ldr r0, =0x02024214 - ldr r1, [r0] - adds r1, 0x1 - str r1, [r0] - movs r0, 0 - ldr r4, =0x02024332 - strb r0, [r4, 0x3] - bl _080499B8 - .pool -_080488FC: - ldr r1, =0x02024332 - ldrb r0, [r1, 0x3] - cmp r0, 0x6 - bls _08048906 - b _08048F40 -_08048906: - ldr r1, =gUnknown_0831C134 - ldr r2, =0x02024332 - ldrb r0, [r2, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0x10 - bne _08048918 - b _08048AFC -_08048918: - cmp r0, 0x10 - bhi _08048930 - cmp r0, 0x7 - beq _0804894A - cmp r0, 0x8 - beq _08048A00 - b _08048DF4 - .pool -_08048930: - cmp r0, 0x40 - bne _08048936 - b _08048C84 -_08048936: - cmp r0, 0x40 - bhi _08048942 - cmp r0, 0x20 - bne _08048940 - b _08048BEA -_08048940: - b _08048DF4 -_08048942: - cmp r0, 0x80 - bne _08048948 - b _08048D02 -_08048948: - b _08048DF4 -_0804894A: - mov r3, r9 - ldrb r1, [r3] - movs r0, 0x58 - muls r0, r1 - add r0, r8 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x2B - beq _080489AC - ldr r0, =0x02024064 - movs r1, 0 - strb r1, [r0] - ldr r1, =0x0202406c - ldrb r3, [r1] - adds r7, r0, 0 - mov r12, r1 - cmp r3, 0 - beq _080489B8 - mov r4, r8 - ldr r0, [r4, 0x50] - movs r1, 0x70 - ands r0, r1 - cmp r0, 0 - bne _080489B8 - adds r1, r7, 0 - mov r6, r8 - adds r6, 0x50 - movs r5, 0x58 - movs r4, 0x70 -_08048984: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, r3 - bcs _080489B8 - ldrb r0, [r7] - muls r0, r5 - adds r0, r6 - ldr r0, [r0] - ands r0, r4 - cmp r0, 0 - beq _08048984 - b _080489B8 - .pool -_080489AC: - ldr r0, =0x02024064 - ldr r2, =0x0202406c - ldrb r1, [r2] - strb r1, [r0] - adds r7, r0, 0 - mov r12, r2 -_080489B8: - mov r0, r9 - ldrb r2, [r0] - movs r0, 0x58 - adds r1, r2, 0 - muls r1, r0 - mov r0, r8 - adds r0, 0x4C - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - beq _080489D0 - b _08048DF4 -_080489D0: - ldrb r0, [r7] - mov r3, r12 - ldrb r3, [r3] - cmp r0, r3 - beq _080489DC - b _08048DF4 -_080489DC: - mov r4, r8 - adds r0, r1, r4 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x48 - bne _080489EA - b _08048DF4 -_080489EA: - cmp r0, 0xF - bne _080489F0 - b _08048DF4 -_080489F0: - adds r0, r2, 0 - bl b_cancel_multi_turn_move_maybe - b _08048DE4 - .pool -_08048A00: - mov r2, r9 - ldrb r1, [r2] - movs r0, 0x58 - muls r0, r1 - add r0, r8 - adds r0, 0x20 - ldrb r1, [r0] - cmp r1, 0x11 - bne _08048A70 - cmp r5, 0x1 - beq _08048A1A - cmp r6, 0x80 - bne _08048A70 -_08048A1A: - ldr r0, =0x0202420a - strb r1, [r0] - mov r3, r9 - ldrb r0, [r3] - movs r1, 0x11 - bl b_history__record_ability_usage_of_player - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB5E9 - str r0, [r4] - ldr r2, =0x02024280 - ldr r1, [r2] - movs r0, 0x80 - lsls r0, 6 - ands r0, r1 - cmp r0, 0 - bne _08048A46 - b _08048D20 -_08048A46: - movs r0, 0x1 - ldr r4, =0x02024332 - strb r0, [r4, 0x5] -_08048A4C: - ldr r0, =0xffffdfff - ands r1, r0 - str r1, [r2] - bl _080499B2 - .pool -_08048A70: - mov r2, r9 - ldrb r0, [r2] - movs r1, 0x58 - muls r0, r1 - add r0, r8 - adds r1, r0, 0 - adds r1, 0x21 - ldrb r1, [r1] - cmp r1, 0x3 - beq _08048A94 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x3 - beq _08048A94 - cmp r1, 0x8 - beq _08048A94 - cmp r0, 0x8 - bne _08048AAE -_08048A94: - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 6 - ands r0, r1 - cmp r0, 0 - beq _08048AAE - cmp r5, 0x1 - bne _08048AA8 - b _08048D66 -_08048AA8: - cmp r6, 0x80 - bne _08048AAE - b _08048D66 -_08048AAE: - mov r3, r9 - ldrb r1, [r3] - movs r0, 0x58 - muls r1, r0 - mov r4, r8 - adds r3, r1, r4 - adds r0, r3, 0 - adds r0, 0x21 - ldrb r4, [r0] - cmp r4, 0x3 - bne _08048AC6 - b _08048DF4 -_08048AC6: - adds r0, 0x1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _08048AD0 - b _08048DF4 -_08048AD0: - cmp r4, 0x8 - bne _08048AD6 - b _08048DF4 -_08048AD6: - cmp r0, 0x8 - bne _08048ADC - b _08048DF4 -_08048ADC: - mov r0, r8 - adds r0, 0x4C - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - beq _08048AEA - b _08048DF4 -_08048AEA: - adds r0, r3, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x11 - bne _08048AF6 - b _08048DF4 -_08048AF6: - b _08048DE4 - .pool -_08048AFC: - mov r2, r9 - ldrb r1, [r2] - movs r0, 0x58 - muls r0, r1 - add r0, r8 - adds r0, 0x20 - ldrb r1, [r0] - cmp r1, 0x29 - bne _08048B54 - cmp r5, 0x1 - beq _08048B16 - cmp r6, 0x80 - bne _08048B54 -_08048B16: - ldr r0, =0x0202420a - strb r1, [r0] - mov r3, r9 - ldrb r0, [r3] - movs r1, 0x29 - bl b_history__record_ability_usage_of_player - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB5D1 - str r0, [r4] - ldr r2, =0x02024280 - ldr r1, [r2] - movs r0, 0x80 - lsls r0, 6 - ands r0, r1 - cmp r0, 0 - beq _08048B42 - b _08048A46 -_08048B42: - b _08048D20 - .pool -_08048B54: - mov r2, r9 - ldrb r1, [r2] - movs r0, 0x58 - muls r0, r1 - mov r3, r8 - adds r1, r0, r3 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0xA - beq _08048B74 - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0xA - bne _08048BA4 -_08048B74: - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 6 - ands r0, r1 - cmp r0, 0 - beq _08048BA4 - cmp r5, 0x1 - beq _08048B8A - cmp r6, 0x80 - bne _08048BA4 -_08048B8A: - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB5D1 - b _08048D72 - .pool -_08048BA4: - mov r4, r9 - ldrb r0, [r4] - movs r1, 0x58 - adds r2, r0, 0 - muls r2, r1 - mov r0, r8 - adds r1, r2, r0 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0xA - bne _08048BBE - b _08048DF4 -_08048BBE: - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0xA - bne _08048BCA - b _08048DF4 -_08048BCA: - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x29 - bne _08048BD6 - b _08048DF4 -_08048BD6: - mov r0, r8 - adds r0, 0x4C - adds r0, r2, r0 - ldr r0, [r0] - cmp r0, 0 - beq _08048BE4 - b _08048DF4 -_08048BE4: - movs r1, 0x1 - mov r10, r1 - b _08048DF4 -_08048BEA: - movs r0, 0 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08048C26 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _08048C26 - ldr r0, =0x020243cc - ldrh r1, [r0] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _08048C26 - movs r2, 0 - str r2, [sp, 0x4] -_08048C26: - ldr r4, =0x02024084 - ldr r0, =0x0202420e - ldrb r3, [r0] - movs r0, 0x58 - adds r2, r3, 0 - muls r2, r0 - adds r1, r2, r4 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0xF - bne _08048C40 - b _08048DF4 -_08048C40: - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0xF - bne _08048C4C - b _08048DF4 -_08048C4C: - adds r0, r4, 0 - adds r0, 0x4C - adds r0, r2, r0 - ldr r0, [r0] - cmp r0, 0 - beq _08048C5A - b _08048DF4 -_08048C5A: - ldr r4, [sp, 0x4] - cmp r4, 0 - bne _08048C62 - b _08048DF4 -_08048C62: - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x28 - bne _08048C6E - b _08048DF4 -_08048C6E: - adds r0, r3, 0 - bl b_cancel_multi_turn_move_maybe - b _08048DE4 - .pool -_08048C84: - mov r2, r9 - ldrb r1, [r2] - movs r0, 0x58 - muls r1, r0 - mov r3, r8 - adds r0, r1, r3 - adds r0, 0x20 - ldrb r2, [r0] - cmp r2, 0x7 - bne _08048CF4 - cmp r5, 0x1 - beq _08048CA2 - cmp r6, 0x80 - beq _08048CA2 - b _08048DF4 -_08048CA2: - ldr r0, =0x0202420a - strb r2, [r0] - mov r4, r9 - ldrb r0, [r4] - movs r1, 0x7 - bl b_history__record_ability_usage_of_player - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB5DD - str r0, [r4] - ldr r2, =0x02024280 - ldr r1, [r2] - movs r0, 0x80 - lsls r0, 6 - ands r0, r1 - cmp r0, 0 - beq _08048CE8 - movs r0, 0x1 - ldr r3, =0x02024332 - strb r0, [r3, 0x5] - b _08048A4C - .pool -_08048CE8: - ldr r4, =0x02024332 - strb r0, [r4, 0x5] - bl _080499B2 - .pool -_08048CF4: - mov r0, r8 - adds r0, 0x4C - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08048DF4 - b _08048DE4 -_08048D02: - mov r2, r9 - ldrb r1, [r2] - movs r0, 0x58 - muls r0, r1 - add r0, r8 - adds r0, 0x20 - ldrb r1, [r0] - cmp r1, 0x11 - bne _08048D2C - cmp r5, 0x1 - bne _08048D1A - b _08048A1A -_08048D1A: - cmp r6, 0x80 - bne _08048D2C - b _08048A1A -_08048D20: - ldr r1, =0x02024332 - strb r0, [r1, 0x5] - bl _080499B2 - .pool -_08048D2C: - mov r2, r9 - ldrb r0, [r2] - movs r1, 0x58 - muls r0, r1 - add r0, r8 - adds r1, r0, 0 - adds r1, 0x21 - ldrb r1, [r1] - cmp r1, 0x3 - beq _08048D50 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x3 - beq _08048D50 - cmp r1, 0x8 - beq _08048D50 - cmp r0, 0x8 - bne _08048D94 -_08048D50: - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 6 - ands r0, r1 - cmp r0, 0 - beq _08048D94 - cmp r5, 0x1 - beq _08048D66 - cmp r6, 0x80 - bne _08048D94 -_08048D66: - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB5E9 -_08048D72: - str r0, [r4] - ldr r1, =0x02024332 - movs r2, 0 - movs r0, 0x2 - strb r0, [r1, 0x5] - strb r2, [r1, 0x3] - bl _080499B8 - .pool -_08048D94: - mov r3, r9 - ldrb r0, [r3] - movs r6, 0x58 - muls r0, r6 - mov r2, r8 - adds r2, 0x4C - adds r5, r0, r2 - ldr r4, [r5] - cmp r4, 0 - bne _08048DF4 - mov r3, r8 - adds r1, r0, r3 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r3, [r0] - cmp r3, 0x3 - beq _08048DEA - adds r0, 0x1 - ldrb r0, [r0] - cmp r0, 0x3 - beq _08048DEA - cmp r3, 0x8 - beq _08048DEA - cmp r0, 0x8 - beq _08048DEA - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x11 - beq _08048DF4 - mov r4, r9 - ldrb r0, [r4] - adds r1, r0, 0 - muls r1, r6 - adds r1, r2 - ldr r0, [r1] - movs r2, 0x9 - negs r2, r2 - ands r0, r2 - str r0, [r1] -_08048DE4: - movs r0, 0x1 - mov r10, r0 - b _08048DF4 -_08048DEA: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0] -_08048DF4: - mov r1, r10 - cmp r1, 0x1 - beq _08048DFC - b _08048F1C -_08048DFC: - ldr r0, =0x02024214 - ldr r0, [r0] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r1, =gUnknown_0831C134 - ldr r0, =0x02024332 - ldrb r0, [r0, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r3, [r0] - cmp r3, 0x7 - bne _08048E50 - bl GenerateRandomNumber - ldr r2, =0x02024084 - ldr r1, =0x0202420e - ldrb r3, [r1] - movs r1, 0x58 - muls r3, r1 - adds r2, 0x4C - adds r3, r2 - movs r1, 0x3 - ands r1, r0 - adds r1, 0x2 - ldr r0, [r3] - orrs r0, r1 - str r0, [r3] - b _08048E64 - .pool -_08048E50: - ldr r2, =0x02024084 - ldr r0, =0x0202420e - ldrb r1, [r0] - movs r0, 0x58 - muls r1, r0 - adds r2, 0x4C - adds r1, r2 - ldr r0, [r1] - orrs r0, r3 - str r0, [r1] -_08048E64: - ldr r2, =0x02024214 - ldr r1, =gUnknown_0831C224 - ldr r5, =0x02024332 - ldrb r0, [r5, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [r2] - ldr r4, =0x02024064 - ldr r1, =0x0202420e - ldrb r0, [r1] - strb r0, [r4] - ldrb r1, [r1] - movs r0, 0x58 - muls r0, r1 - ldr r1, =0x020240d0 - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r2, =0x02024280 - ldr r1, [r2] - movs r0, 0x80 - lsls r0, 6 - ands r0, r1 - cmp r0, 0 - beq _08048ED8 - movs r0, 0x1 - strb r0, [r5, 0x5] - ldr r0, =0xffffdfff - ands r1, r0 - str r1, [r2] - b _08048EDA - .pool -_08048ED8: - strb r0, [r5, 0x5] -_08048EDA: - ldr r0, =0x02024332 - ldrb r2, [r0, 0x3] - cmp r2, 0x2 - beq _08048EF2 - cmp r2, 0x6 - beq _08048EF2 - cmp r2, 0x5 - beq _08048EF2 - cmp r2, 0x3 - beq _08048EF2 - bl _080499B8 -_08048EF2: - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0xB2 - ldr r2, =0x02024332 - ldrb r1, [r2, 0x3] - strb r1, [r0] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 7 - orrs r0, r1 - str r0, [r2] - bl _080499B8 - .pool -_08048F1C: - mov r3, r10 - cmp r3, 0 - beq _08048F26 - bl _080499B8 -_08048F26: - ldr r0, =0x02024332 - strb r3, [r0, 0x3] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bl _080499B8 - .pool -_08048F40: - mov r4, r9 - ldrb r1, [r4] - movs r0, 0x58 - muls r1, r0 - mov r0, r8 - adds r0, 0x50 - adds r1, r0 - ldr r2, =gUnknown_0831C134 - ldr r0, =0x02024332 - ldrb r3, [r0, 0x3] - lsls r0, r3, 2 - adds r0, r2 - ldr r1, [r1] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08048F66 - bl _08049994 -_08048F66: - subs r0, r3, 0x7 - cmp r0, 0x34 - bls _08048F70 - bl _080499B2 -_08048F70: - lsls r0, 2 - ldr r1, =_08048F88 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08048F88: - .4byte _0804905C - .4byte _080490D0 - .4byte _08049244 - .4byte _0804915C - .4byte _080491D8 - .4byte _0804927C - .4byte _080492C4 - .4byte _08049390 - .4byte _080493D4 - .4byte _080493D4 - .4byte _080493D4 - .4byte _080493D4 - .4byte _080493D4 - .4byte _080493D4 - .4byte _080493D4 - .4byte _0804941C - .4byte _0804941C - .4byte _0804941C - .4byte _0804941C - .4byte _0804941C - .4byte _0804941C - .4byte _0804941C - .4byte _080494FC - .4byte _08049544 - .4byte _08049564 - .4byte _08049720 - .4byte _0804975C - .4byte _08049778 - .4byte _08049790 - .4byte _080497A8 - .4byte _08049808 - .4byte _08049820 - .4byte _08049468 - .4byte _08049468 - .4byte _08049468 - .4byte _08049468 - .4byte _08049468 - .4byte _08049468 - .4byte _08049468 - .4byte _080494B0 - .4byte _080494B0 - .4byte _080494B0 - .4byte _080494B0 - .4byte _080494B0 - .4byte _080494B0 - .4byte _080494B0 - .4byte _08049864 - .4byte _080498C0 - .4byte _080499B2 - .4byte _080499B2 - .4byte _080499B2 - .4byte _080499B2 - .4byte _080499A4 -_0804905C: - mov r1, r9 - ldrb r0, [r1] - movs r5, 0x58 - adds r1, r0, 0 - muls r1, r5 - mov r2, r8 - adds r0, r1, r2 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x14 - bne _08049076 - bl _08049994 -_08049076: - mov r4, r8 - adds r4, 0x50 - adds r0, r1, r4 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _0804908A - bl _08049994 -_0804908A: - bl GenerateRandomNumber - mov r3, r9 - ldrb r1, [r3] - adds r2, r1, 0 - muls r2, r5 - adds r2, r4 - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - lsrs r1, 16 - adds r1, 0x2 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r1, =gUnknown_0831C224 - ldr r0, =0x02024332 - ldrb r0, [r0, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _080499B0 - .pool -_080490D0: - mov r4, r9 - ldrb r2, [r4] - movs r4, 0x58 - adds r0, r2, 0 - muls r0, r4 - add r0, r8 - adds r0, 0x20 - ldrb r1, [r0] - cmp r1, 0x27 - bne _08049114 - cmp r5, 0x1 - beq _080490F0 - cmp r6, 0x80 - beq _080490F0 - bl _08049994 -_080490F0: - ldr r0, =0x0202420a - strb r1, [r0] - mov r1, r9 - ldrb r0, [r1] - movs r1, 0x27 - bl b_history__record_ability_usage_of_player - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB603 - str r0, [r1] - bl _080499B2 - .pool -_08049114: - adds r0, r2, 0 - bl sub_8048728 - ldr r1, =0x02024082 - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bhi _0804912A - bl _08049994 -_0804912A: - mov r2, r9 - ldrb r0, [r2] - adds r2, r0, 0 - muls r2, r4 - mov r0, r8 - adds r0, 0x50 - adds r2, r0 - ldr r1, =gUnknown_0831C134 - ldr r0, =0x02024332 - ldrb r0, [r0, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r1, [r2] - ldr r0, [r0] - orrs r1, r0 - str r1, [r2] - bl _08049994 - .pool -_0804915C: - mov r3, r9 - ldrb r0, [r3] - movs r5, 0x58 - muls r0, r5 - mov r4, r8 - adds r4, 0x50 - adds r2, r0, r4 - ldr r1, [r2] - movs r0, 0x70 - ands r0, r1 - cmp r0, 0 - beq _08049178 - bl _08049994 -_08049178: - movs r0, 0x80 - lsls r0, 5 - orrs r1, r0 - str r1, [r2] - ldr r1, =0x02024268 - ldrb r0, [r3] - lsls r0, 1 - adds r0, r1 - ldr r1, =0x020241ea - ldrh r1, [r1] - strh r1, [r0] - bl GenerateRandomNumber - mov r2, r9 - ldrb r1, [r2] - adds r2, r1, 0 - muls r2, r5 - adds r2, r4 - movs r1, 0x3 - ands r1, r0 - adds r1, 0x2 - lsls r1, 4 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r1, =gUnknown_0831C224 - ldr r0, =0x02024332 - ldrb r0, [r0, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _080499B0 - .pool -_080491D8: - ldr r5, =0x0202420b - ldrb r0, [r5] - bl battle_get_per_side_status - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - bne _08049210 - ldr r4, =0x0202432e - ldrh r3, [r4] - ldr r2, =0x02024084 - ldrb r1, [r5] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x2A - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - adds r0, r3, r0 - strh r0, [r4] - lsls r0, 16 - lsrs r0, 16 - cmp r3, r0 - bls _08049210 - ldr r3, =0x0000ffff - adds r0, r3, 0 - strh r0, [r4] -_08049210: - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r1, =gUnknown_0831C224 - ldr r0, =0x02024332 - ldrb r0, [r0, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - b _080499B0 - .pool -_08049244: - mov r4, r9 - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - mov r1, r8 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - beq _0804925A - b _08049994 -_0804925A: - bl GenerateRandomNumber - ldr r4, =0x02024332 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - adds r0, 0x3 - strb r0, [r4, 0x3] - movs r0, 0 - movs r1, 0 - bl sub_8048760 - b _080499B2 - .pool -_0804927C: - mov r0, r9 - ldrb r1, [r0] - movs r0, 0x58 - adds r2, r1, 0 - muls r2, r0 - mov r0, r8 - adds r0, 0x50 - adds r2, r0 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 5 - orrs r0, r1 - str r0, [r2] - ldr r1, =0x02024268 - mov r2, r9 - ldrb r0, [r2] - lsls r0, 1 - adds r0, r1 - ldr r1, =0x020241ea - ldrh r1, [r1] - strh r1, [r0] - ldr r0, =0x0202433c - ldrb r1, [r2] - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1, 0x1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1, 0x1] - b _08049994 - .pool -_080492C4: - mov r3, r9 - ldrb r0, [r3] - movs r6, 0x58 - muls r0, r6 - mov r4, r8 - adds r4, 0x50 - adds r0, r4 - ldr r5, [r0] - movs r0, 0xE0 - lsls r0, 8 - ands r5, r0 - cmp r5, 0 - beq _080492E0 - b _08049994 -_080492E0: - bl GenerateRandomNumber - mov r2, r9 - ldrb r1, [r2] - adds r2, r1, 0 - muls r2, r6 - adds r2, r4 - movs r1, 0x3 - ands r1, r0 - adds r1, 0x3 - lsls r1, 13 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - mov r3, r9 - ldrb r1, [r3] - ldr r2, =0x0202449c - ldr r0, [r2] - lsls r1, 1 - adds r1, r0 - ldr r6, =0x020241ea - ldrh r0, [r6] - strb r0, [r1, 0x4] - ldrb r1, [r3] - ldr r0, [r2] - lsls r1, 1 - adds r1, r0 - ldrh r0, [r6] - lsrs r0, 8 - strb r0, [r1, 0x5] - ldrb r1, [r3] - ldr r0, [r2] - adds r1, r0 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r1, 0x14] - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r1, =gUnknown_0831C224 - ldr r2, =0x02024332 - ldrb r0, [r2, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [r4] - strb r5, [r2, 0x5] - ldr r3, =gUnknown_085CC982 - ldrh r0, [r3] - ldrh r4, [r6] - cmp r0, r4 - bne _0804934E - b _080499B2 -_0804934E: - adds r1, r2, 0 - adds r2, r6, 0 -_08049352: - ldrb r0, [r1, 0x5] - adds r0, 0x1 - strb r0, [r1, 0x5] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bls _08049362 - b _080499B2 -_08049362: - ldrb r0, [r1, 0x5] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - ldrh r4, [r2] - cmp r0, r4 - bne _08049352 - b _080499B2 - .pool -_08049390: - ldr r1, =0x020241f0 - ldr r0, =0x020241f4 - ldr r0, [r0] - cmp r0, 0 - bge _0804939C - adds r0, 0x3 -_0804939C: - asrs r0, 2 - str r0, [r1] - cmp r0, 0 - bne _080493A8 - movs r0, 0x1 - str r0, [r1] -_080493A8: - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r1, =gUnknown_0831C224 - ldr r0, =0x02024332 - ldrb r0, [r0, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - b _080499B0 - .pool -_080493D4: - ldr r4, =0x02024332 - ldrb r1, [r4, 0x3] - adds r1, 0xF2 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x10 - adds r2, r7, 0 - movs r3, 0 - bl sub_8050A1C - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _080493F2 - b _08049994 -_080493F2: - ldr r2, =0x02024474 - ldrb r1, [r4, 0x3] - movs r0, 0x3F - ands r0, r1 - strb r0, [r2, 0x10] - strb r3, [r2, 0x11] - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082D8CD4 - b _080499B0 - .pool -_0804941C: - movs r0, 0x70 - negs r0, r0 - ldr r4, =0x02024332 - ldrb r1, [r4, 0x3] - adds r1, 0xEB - lsls r1, 24 - lsrs r1, 24 - adds r2, r7, 0 - movs r3, 0 - bl sub_8050A1C - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _0804943C - b _08049994 -_0804943C: - ldr r2, =0x02024474 - ldrb r1, [r4, 0x3] - movs r0, 0x3F - ands r0, r1 - strb r0, [r2, 0x10] - strb r3, [r2, 0x11] - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082D8D65 - b _080499B0 - .pool -_08049468: - ldr r4, =0x02024332 - ldrb r1, [r4, 0x3] - adds r1, 0xDA - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x20 - adds r2, r7, 0 - movs r3, 0 - bl sub_8050A1C - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _08049486 - b _08049994 -_08049486: - ldr r2, =0x02024474 - ldrb r1, [r4, 0x3] - movs r0, 0x3F - ands r0, r1 - strb r0, [r2, 0x10] - strb r3, [r2, 0x11] - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082D8CD4 - b _080499B0 - .pool -_080494B0: - movs r0, 0x60 - negs r0, r0 - ldr r4, =0x02024332 - ldrb r1, [r4, 0x3] - adds r1, 0xD3 - lsls r1, 24 - lsrs r1, 24 - adds r2, r7, 0 - movs r3, 0 - bl sub_8050A1C - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _080494D0 - b _08049994 -_080494D0: - ldr r2, =0x02024474 - ldrb r1, [r4, 0x3] - movs r0, 0x3F - ands r0, r1 - strb r0, [r2, 0x10] - strb r3, [r2, 0x11] - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082D8D65 - b _080499B0 - .pool -_080494FC: - mov r0, r9 - ldrb r1, [r0] - movs r0, 0x58 - adds r2, r1, 0 - muls r2, r0 - mov r0, r8 - adds r0, 0x50 - adds r2, r0 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 15 - orrs r0, r1 - str r0, [r2] - ldr r2, =0x020242bc - mov r3, r9 - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2 - strb r1, [r0, 0x19] - ldr r1, =0x02024268 - ldrb r0, [r3] - lsls r0, 1 - adds r0, r1 - ldr r1, =0x020241ea - ldrh r1, [r1] - strh r1, [r0] - b _08049994 - .pool -_08049544: - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - adds r2, r1, 0 - muls r2, r0 - mov r0, r8 - adds r0, 0x50 - adds r2, r0 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 16 -_0804955A: - orrs r0, r1 - str r0, [r2] - b _08049994 - .pool -_08049564: - ldr r5, =0x02022fec - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 19 - ands r0, r1 - cmp r0, 0 - beq _08049574 - b _08049994 -_08049574: - ldr r6, =0x0202420b - ldrb r0, [r6] - bl battle_side_get_owner - lsls r0, 24 - lsrs r4, r0, 24 - ldrb r0, [r6] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080495A8 - ldr r0, [r5] - ldr r1, =0x0a3f0902 - ands r0, r1 - cmp r0, 0 - bne _080495D4 - b _08049994 - .pool -_080495A8: - ldr r0, [r5] - ldr r1, =0x0a3f0902 - ands r0, r1 - cmp r0, 0 - bne _080495D4 - ldr r0, =0x020243d0 - adds r0, 0x29 - adds r0, r4, r0 - ldrb r1, [r0] - ldr r3, =gUnknown_0832A328 - ldr r2, =0x0202406e - ldrb r0, [r6] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _080495D4 - b _08049994 -_080495D4: - ldr r2, =0x02024084 - ldr r1, =0x0202420c - ldrb r0, [r1] - movs r5, 0x58 - muls r0, r5 - adds r4, r0, r2 - ldrh r0, [r4, 0x2E] - adds r7, r1, 0 - mov r8, r2 - cmp r0, 0 - beq _0804963C - adds r0, r4, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x3C - bne _0804963C - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB682 - str r0, [r1] - ldr r1, =0x0202420a - ldrb r0, [r7] - muls r0, r5 - add r0, r8 - adds r0, 0x20 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r7] - ldrb r1, [r1] - bl b_history__record_ability_usage_of_player - b _080499B2 - .pool -_0804963C: - ldr r4, =0x0202420b - mov r10, r4 - ldrb r2, [r4] - movs r0, 0x58 - mov r9, r0 - mov r0, r9 - muls r0, r2 - add r0, r8 - ldrh r4, [r0, 0x2E] - cmp r4, 0 - beq _08049654 - b _08049994 -_08049654: - ldrb r0, [r7] - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - add r0, r8 - ldrh r3, [r0, 0x2E] - adds r1, r3, 0 - cmp r1, 0xAF - bne _08049668 - b _08049994 -_08049668: - adds r0, r3, 0 - subs r0, 0x79 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xB - bhi _08049676 - b _08049994 -_08049676: - cmp r1, 0 - bne _0804967C - b _08049994 -_0804967C: - ldr r5, =0x0202449c - lsls r0, r2, 1 - adds r0, 0xD0 - ldr r1, [r5] - adds r1, r0 - ldr r2, =0x02024208 - strh r3, [r1] - strh r3, [r2] - ldrb r0, [r7] - mov r3, r9 - muls r3, r0 - adds r0, r3, 0 - add r0, r8 - movs r6, 0 - strh r4, [r0, 0x2E] - ldr r4, =0x02024064 - mov r1, r10 - ldrb r0, [r1] - strb r0, [r4] - str r2, [sp] - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - movs r3, 0x2 - bl dp01_build_cmdbuf_x02_a_b_varargs - mov r2, r10 - ldrb r0, [r2] - bl dp01_battle_side_mark_buffer_for_execution - ldrb r0, [r7] - strb r0, [r4] - ldrb r0, [r7] - mov r3, r9 - muls r3, r0 - adds r0, r3, 0 - mov r1, r8 - adds r1, 0x2E - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - movs r3, 0x2 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r7] - bl dp01_battle_side_mark_buffer_for_execution - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB422 - str r0, [r4] - ldrb r0, [r7] - ldr r1, [r5] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC8 - strb r6, [r0] - ldrb r0, [r7] - ldr r1, [r5] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC9 - strb r6, [r0] - b _080499B2 - .pool -_08049720: - ldr r3, =0x0202420c - ldrb r1, [r3] - movs r0, 0x58 - adds r2, r1, 0 - muls r2, r0 - mov r0, r8 - adds r0, 0x50 - adds r2, r0 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 19 - orrs r0, r1 - str r0, [r2] - ldr r2, =0x020242bc - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0202420b - ldrb r1, [r1] - strb r1, [r0, 0x14] - b _08049994 - .pool -_0804975C: - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - adds r2, r1, 0 - muls r2, r0 - mov r0, r8 - adds r0, 0x50 - adds r2, r0 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 20 - b _0804955A - .pool -_08049778: - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DAF27 - b _080499B0 - .pool -_08049790: - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DAFC3 - b _080499B0 - .pool -_080497A8: - ldr r6, =0x0202420c - ldrb r0, [r6] - movs r2, 0x58 - muls r0, r2 - mov r1, r8 - adds r1, 0x4C - adds r5, r0, r1 - ldr r4, [r5] - movs r0, 0x40 - ands r0, r4 - cmp r0, 0 - bne _080497C2 - b _08049994 -_080497C2: - movs r0, 0x41 - negs r0, r0 - ands r4, r0 - str r4, [r5] - ldr r4, =0x02024064 - ldrb r0, [r6] - strb r0, [r4] - ldrb r0, [r4] - muls r0, r2 - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB361 - b _080499B0 - .pool -_08049808: - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB117 - b _080499B0 - .pool -_08049820: - ldr r4, =0x020241f0 - ldr r0, =0x020241f4 - ldr r0, [r0] - movs r1, 0x3 - bl __divsi3 - str r0, [r4] - cmp r0, 0 - bne _08049836 - movs r0, 0x1 - str r0, [r4] -_08049836: - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r1, =gUnknown_0831C224 - ldr r0, =0x02024332 - ldrb r0, [r0, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - b _080499B0 - .pool -_08049864: - mov r4, r9 - ldrb r0, [r4] - movs r5, 0x58 - muls r0, r5 - mov r4, r8 - adds r4, 0x50 - adds r2, r0, r4 - ldr r1, [r2] - movs r0, 0xC0 - lsls r0, 4 - ands r0, r1 - cmp r0, 0 - beq _08049880 - b _08049994 -_08049880: - movs r0, 0x80 - lsls r0, 5 - orrs r1, r0 - str r1, [r2] - ldr r1, =0x02024268 - mov r2, r9 - ldrb r0, [r2] - lsls r0, 1 - adds r0, r1 - ldr r1, =0x020241ea - ldrh r1, [r1] - strh r1, [r0] - bl GenerateRandomNumber - mov r3, r9 - ldrb r1, [r3] - adds r2, r1, 0 - muls r2, r5 - adds r2, r4 - movs r1, 0x1 - ands r1, r0 - adds r1, 0x2 - lsls r1, 10 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - b _080499B2 - .pool -_080498C0: - mov r4, r9 - ldrb r3, [r4] - movs r5, 0x58 - adds r0, r3, 0 - muls r0, r5 - mov r2, r8 - adds r1, r0, r2 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r2, [r0] - cmp r2, 0x3C - bne _08049900 - ldrh r0, [r1, 0x2E] - cmp r0, 0 - beq _08049994 - ldr r0, =0x0202420a - strb r2, [r0] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB63F - str r0, [r1] - ldrb r0, [r4] - movs r1, 0x3C - bl b_history__record_ability_usage_of_player - b _080499B2 - .pool -_08049900: - ldrh r0, [r1, 0x2E] - cmp r0, 0 - beq _08049994 - adds r0, r3, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x02024208 - mov r3, r9 - ldrb r0, [r3] - muls r0, r5 - add r0, r8 - ldrh r0, [r0, 0x2E] - strh r0, [r1] - ldrb r0, [r3] - muls r0, r5 - add r0, r8 - movs r5, 0 - movs r1, 0 - strh r1, [r0, 0x2E] - ldr r2, =0x020243d0 - adds r2, 0x29 - adds r2, r4, r2 - ldr r3, =gUnknown_0832A328 - ldr r1, =0x0202406e - mov r4, r9 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB168 - str r0, [r4] - mov r1, r9 - ldrb r0, [r1] - ldr r2, =0x0202449c - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC8 - strb r5, [r0] - mov r3, r9 - ldrb r0, [r3] - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC9 - strb r5, [r0] - b _080499B2 - .pool -_08049994: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - b _080499B2 - .pool -_080499A4: - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB1D5 -_080499B0: - str r0, [r4] -_080499B2: - ldr r1, =0x02024332 - movs r0, 0 - strb r0, [r1, 0x3] -_080499B8: - 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_8048760 - - thumb_func_start atk15_seteffectwithchancetarget -atk15_seteffectwithchancetarget: @ 80499D4 - push {r4,lr} - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x20 - bne _08049A10 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x5] - lsls r4, r0, 1 - b _08049A20 - .pool -_08049A10: - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r4, [r0, 0x5] -_08049A20: - ldr r3, =0x02024332 - ldrb r2, [r3, 0x3] - movs r0, 0x80 - ands r0, r2 - cmp r0, 0 - beq _08049A50 - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _08049A50 - movs r0, 0x7F - ands r0, r2 - strb r0, [r3, 0x3] - b _08049A7E - .pool -_08049A50: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, r4 - bcs _08049A9A - ldr r0, =0x02024332 - ldrb r0, [r0, 0x3] - cmp r0, 0 - beq _08049A9A - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _08049A9A - cmp r4, 0x63 - bls _08049A90 -_08049A7E: - movs r0, 0 - movs r1, 0x80 - bl sub_8048760 - b _08049AA2 - .pool -_08049A90: - movs r0, 0 - movs r1, 0 - bl sub_8048760 - b _08049AA2 -_08049A9A: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_08049AA2: - ldr r0, =0x02024332 - movs r1, 0 - strb r1, [r0, 0x3] - ldr r0, =0x02024474 - strb r1, [r0, 0x16] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk15_seteffectwithchancetarget - - thumb_func_start sub_8049AC0 -sub_8049AC0: @ 8049AC0 - push {lr} - movs r0, 0x1 - movs r1, 0 - bl sub_8048760 - pop {r0} - bx r0 - thumb_func_end sub_8049AC0 - - thumb_func_start sub_8049AD0 -sub_8049AD0: @ 8049AD0 - push {lr} - movs r0, 0 - movs r1, 0 - bl sub_8048760 - pop {r0} - bx r0 - thumb_func_end sub_8049AD0 - - thumb_func_start sub_8049AE0 -sub_8049AE0: @ 8049AE0 - push {lr} - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r2, =0x02024064 - strb r0, [r2] - ldr r3, =0x02024332 - ldrb r0, [r3, 0x3] - cmp r0, 0x6 - bhi _08049B14 - ldr r1, =0x02024084 - ldrb r2, [r2] - movs r0, 0x58 - muls r2, r0 - adds r1, 0x4C - b _08049B1E - .pool -_08049B14: - ldr r1, =0x02024084 - ldrb r2, [r2] - movs r0, 0x58 - muls r2, r0 - adds r1, 0x50 -_08049B1E: - adds r2, r1 - ldr r1, =gUnknown_0831C134 - ldrb r0, [r3, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldr r0, [r2] - bics r0, r1 - str r0, [r2] - ldr r0, =0x02024332 - movs r2, 0 - strb r2, [r0, 0x3] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] - ldr r0, =0x02024474 - strb r2, [r0, 0x16] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8049AE0 - - thumb_func_start atk19_faintpokemon -atk19_faintpokemon: @ 8049B5C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - ldr r0, =0x02024214 - ldr r2, [r0] - ldrb r1, [r2, 0x2] - adds r6, r0, 0 - cmp r1, 0 - beq _08049BE0 - ldrb r0, [r2, 0x1] - bl get_battle_side_of_something - ldr r5, =0x02024064 - strb r0, [r5] - ldr r2, =0x02024280 - ldr r1, =gUnknown_0832A328 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - lsls r1, 28 - ldr r0, [r2] - ands r0, r1 - cmp r0, 0 - bne _08049B94 - b _08049E2C -_08049B94: - ldr r1, [r6] - ldrb r4, [r1, 0x3] - ldrb r0, [r1, 0x4] - lsls r0, 8 - orrs r4, r0 - ldrb r0, [r1, 0x5] - lsls r0, 16 - orrs r4, r0 - ldrb r0, [r1, 0x6] - lsls r0, 24 - orrs r4, r0 - bl b_movescr_stack_pop_cursor - str r4, [r6] - ldrb r0, [r5] - bl battle_side_get_owner - ldr r1, =0x0202428e - lsls r0, 24 - lsrs r0, 23 - adds r0, r1 - ldrh r2, [r0] - ldr r1, =0x0000fdff - ands r1, r2 - strh r1, [r0] - b _08049E32 - .pool -_08049BE0: - ldrb r0, [r2, 0x1] - cmp r0, 0x1 - bne _08049C08 - ldr r1, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r1] - ldr r0, =0x0202420c - ldrb r0, [r0] - mov r9, r0 - ldr r4, =gUnknown_082DA7AA - b _08049C18 - .pool -_08049C08: - ldr r1, =0x02024064 - ldr r0, =0x0202420c - ldrb r0, [r0] - strb r0, [r1] - ldr r0, =0x0202420b - ldrb r0, [r0] - mov r9, r0 - ldr r4, =gUnknown_082DA7B7 -_08049C18: - mov r8, r1 - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - mov r7, r8 - ldrb r3, [r7] - lsls r0, r3, 2 - adds r0, r2 - ldr r2, [r0] - ands r1, r2 - cmp r1, 0 - beq _08049C32 - b _08049E2C -_08049C32: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r3 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08049C42 - b _08049E2C -_08049C42: - ldr r5, =0x02024280 - lsls r1, r2, 28 - ldr r0, [r5] - orrs r0, r1 - str r0, [r5] - ldr r0, [r6] - adds r0, 0x7 - bl b_movescr_stack_push - str r4, [r6] - ldrb r0, [r7] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08049CA4 - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 15 - orrs r0, r1 - str r0, [r5] - ldr r1, =0x03005d10 - ldrb r0, [r1] - cmp r0, 0xFE - bhi _08049C78 - adds r0, 0x1 - strb r0, [r1] -_08049C78: - ldrb r0, [r7] - bl sub_80570F4 - b _08049CCE - .pool -_08049CA4: - ldr r4, =0x03005d10 - ldrb r0, [r4, 0x1] - cmp r0, 0xFE - bhi _08049CB0 - adds r0, 0x1 - strb r0, [r4, 0x1] -_08049CB0: - ldr r1, =0x0202406e - mov r2, r8 - ldrb r0, [r2] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - strh r0, [r4, 0x20] -_08049CCE: - ldr r2, =0x02024280 - ldr r1, [r2] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08049D0C - ldr r6, =0x02024084 - ldr r0, =0x0202420b - ldrb r0, [r0] - movs r5, 0x58 - muls r0, r5 - adds r0, r6 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08049D0C - movs r0, 0x41 - negs r0, r0 - ands r1, r0 - str r1, [r2] - ldr r4, =0x02024214 - ldr r0, [r4] - bl b_movescr_stack_push - ldr r1, =0x020241f0 - mov r0, r9 - muls r0, r5 - adds r0, r6 - ldrh r0, [r0, 0x28] - str r0, [r1] - ldr r0, =gUnknown_082DAE3E - str r0, [r4] -_08049D0C: - ldr r1, =0x020242ac - ldr r6, =0x0202420c - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 7 - ands r0, r1 - cmp r0, 0 - bne _08049D24 - b _08049E32 -_08049D24: - ldr r0, =0x02024280 - ldr r5, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r5, r0 - cmp r5, 0 - beq _08049D34 - b _08049E32 -_08049D34: - ldr r3, =0x0202420b - mov r8, r3 - ldrb r0, [r3] - bl battle_side_get_owner - adds r4, r0, 0 - ldrb r0, [r6] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _08049E32 - ldr r0, =0x02024084 - mov r9, r0 - mov r2, r8 - ldrb r1, [r2] - movs r7, 0x58 - adds r2, r1, 0 - muls r2, r7 - adds r0, r2, r0 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08049E32 - ldr r0, =0x020241ea - ldrh r0, [r0] - cmp r0, 0xA5 - beq _08049E32 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, r1, r0 - adds r0, 0x80 - ldrb r4, [r0] - adds r0, r4, r2 - mov r6, r9 - adds r6, 0x24 - adds r0, r6 - strb r5, [r0] - ldr r5, =0x02024214 - ldr r0, [r5] - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB18D - str r0, [r5] - ldr r5, =0x02024064 - mov r3, r8 - ldrb r0, [r3] - strb r0, [r5] - adds r1, r4, 0 - adds r1, 0x9 - lsls r1, 24 - lsrs r1, 24 - ldrb r0, [r5] - muls r0, r7 - adds r0, r6 - adds r0, r4 - str r0, [sp] - movs r0, 0 - movs r2, 0 - movs r3, 0x1 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - lsls r4, 1 - mov r2, r8 - ldrb r0, [r2] - muls r0, r7 - adds r0, r4, r0 - mov r2, r9 - adds r2, 0xC - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1, 0x2] - mov r3, r8 - ldrb r0, [r3] - muls r0, r7 - adds r4, r0 - adds r4, r2 - ldrh r0, [r4] - lsrs r0, 8 - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - b _08049E32 - .pool -_08049E2C: - ldr r0, [r6] - adds r0, 0x7 - str r0, [r6] -_08049E32: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end atk19_faintpokemon - - thumb_func_start sub_8049E40 -sub_8049E40: @ 8049E40 - push {r4,r5,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _08049E6A - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - movs r0, 0 - bl dp01_build_cmdbuf_x0A_A_A_A - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r5] - adds r0, 0x2 - str r0, [r5] -_08049E6A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8049E40 - - thumb_func_start sub_8049E7C -sub_8049E7C: @ 8049E7C - push {r4,r5,lr} - sub sp, 0x4 - ldr r0, =0x02024068 - ldr r5, [r0] - cmp r5, 0 - bne _08049EE8 - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _08049EB4 - ldr r2, =0x02024084 - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08049EDC -_08049EB4: - ldr r1, =0x02024084 - ldrb r0, [r4] - movs r2, 0x58 - muls r0, r2 - adds r1, 0x4C - adds r0, r1 - str r5, [r0] - ldrb r0, [r4] - muls r0, r2 - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_08049EDC: - bl sub_803A75C - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] -_08049EE8: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8049E7C - - thumb_func_start atk1C_jumpifstatus -atk1C_jumpifstatus: @ 8049F04 - push {r4,r5,lr} - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - lsls r0, 24 - lsrs r0, 24 - ldr r2, [r5] - ldrb r4, [r2, 0x2] - ldrb r1, [r2, 0x3] - lsls r1, 8 - adds r4, r1 - ldrb r1, [r2, 0x4] - lsls r1, 16 - adds r4, r1 - ldrb r1, [r2, 0x5] - lsls r1, 24 - adds r4, r1 - ldrb r3, [r2, 0x6] - ldrb r1, [r2, 0x7] - lsls r1, 8 - adds r3, r1 - ldrb r1, [r2, 0x8] - lsls r1, 16 - adds r3, r1 - ldrb r1, [r2, 0x9] - lsls r1, 24 - adds r3, r1 - ldr r2, =0x02024084 - movs r1, 0x58 - muls r1, r0 - adds r0, r2, 0 - adds r0, 0x4C - adds r0, r1, r0 - ldr r0, [r0] - ands r0, r4 - cmp r0, 0 - beq _08049F68 - adds r0, r1, r2 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08049F68 - str r3, [r5] - b _08049F70 - .pool -_08049F68: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0xA - str r0, [r1] -_08049F70: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk1C_jumpifstatus - - thumb_func_start atk1D_jumpifsecondarystatus -atk1D_jumpifsecondarystatus: @ 8049F7C - push {r4,r5,lr} - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - lsls r0, 24 - lsrs r0, 24 - ldr r2, [r5] - ldrb r4, [r2, 0x2] - ldrb r1, [r2, 0x3] - lsls r1, 8 - adds r4, r1 - ldrb r1, [r2, 0x4] - lsls r1, 16 - adds r4, r1 - ldrb r1, [r2, 0x5] - lsls r1, 24 - adds r4, r1 - ldrb r3, [r2, 0x6] - ldrb r1, [r2, 0x7] - lsls r1, 8 - adds r3, r1 - ldrb r1, [r2, 0x8] - lsls r1, 16 - adds r3, r1 - ldrb r1, [r2, 0x9] - lsls r1, 24 - adds r3, r1 - ldr r2, =0x02024084 - movs r1, 0x58 - muls r1, r0 - adds r0, r2, 0 - adds r0, 0x50 - adds r0, r1, r0 - ldr r0, [r0] - ands r0, r4 - cmp r0, 0 - beq _08049FE0 - adds r0, r1, r2 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08049FE0 - str r3, [r5] - b _08049FE8 - .pool -_08049FE0: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0xA - str r0, [r1] -_08049FE8: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk1D_jumpifsecondarystatus - - thumb_func_start atk1E_jumpifability -atk1E_jumpifability: @ 8049FF4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - ldr r6, =0x02024214 - ldr r2, [r6] - ldrb r5, [r2, 0x2] - mov r8, r5 - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x4] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 24 - adds r7, r1, r0 - ldrb r0, [r2, 0x1] - cmp r0, 0x8 - bne _0804A054 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0 - str r0, [sp] - movs r0, 0xD - adds r2, r5, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0804A0C8 - ldr r1, =0x0202420a - strb r5, [r1] - str r7, [r6] - subs r4, 0x1 - lsls r0, r4, 24 - lsrs r0, 24 - ldrb r1, [r1] - b _0804A0B0 - .pool -_0804A054: - cmp r0, 0x9 - bne _0804A08C - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0 - str r0, [sp] - movs r0, 0xC - adds r2, r5, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0804A0C8 - ldr r1, =0x0202420a - strb r5, [r1] - str r7, [r6] - subs r4, 0x1 - lsls r0, r4, 24 - lsrs r0, 24 - ldrb r1, [r1] - b _0804A0B0 - .pool -_0804A08C: - ldrb r0, [r2, 0x1] - bl get_battle_side_of_something - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r4 - adds r0, r1 - adds r0, 0x20 - ldrb r1, [r0] - cmp r1, r8 - bne _0804A0C8 - ldr r0, =0x0202420a - strb r1, [r0] - str r7, [r6] - ldrb r1, [r0] - adds r0, r4, 0 -_0804A0B0: - bl b_history__record_ability_usage_of_player - ldr r0, =0x02024474 - strb r4, [r0, 0x15] - b _0804A0CE - .pool -_0804A0C8: - ldr r0, [r6] - adds r0, 0x7 - str r0, [r6] -_0804A0CE: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end atk1E_jumpifability - - thumb_func_start sub_804A0DC -sub_804A0DC: @ 804A0DC - push {r4-r6,lr} - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r4, [r0, 0x1] - cmp r4, 0x1 - bne _0804A0FC - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_get_per_side_status - b _0804A106 - .pool -_0804A0FC: - ldr r0, =0x0202420c - ldrb r0, [r0] - bl battle_get_per_side_status - movs r4, 0x1 -_0804A106: - ands r4, r0 - ldr r6, =0x02024214 - ldr r3, [r6] - ldrb r2, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r2, r0 - ldrb r1, [r3, 0x4] - ldrb r0, [r3, 0x5] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r3, 0x6] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r3, 0x7] - lsls r0, 24 - adds r5, r1, r0 - ldr r1, =0x0202428e - lsls r0, r4, 1 - adds r0, r1 - ldrh r0, [r0] - ands r2, r0 - cmp r2, 0 - beq _0804A148 - str r5, [r6] - b _0804A14E - .pool -_0804A148: - adds r0, r3, 0 - adds r0, 0x8 - str r0, [r6] -_0804A14E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_804A0DC - - thumb_func_start sub_804A154 -sub_804A154: @ 804A154 - push {r4,r5,lr} - movs r5, 0 - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02024084 - ldr r3, [r4] - movs r1, 0x58 - muls r0, r1 - ldrb r1, [r3, 0x3] - adds r0, r1 - adds r2, 0x18 - adds r0, r2 - ldrb r2, [r0] - ldrb r0, [r3, 0x2] - cmp r0, 0x5 - bhi _0804A212 - lsls r0, 2 - ldr r1, =_0804A194 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0804A194: - .4byte _0804A1AC - .4byte _0804A1BC - .4byte _0804A1CC - .4byte _0804A1DC - .4byte _0804A1EC - .4byte _0804A200 -_0804A1AC: - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x4] - cmp r2, r0 - bne _0804A212 - b _0804A20C - .pool -_0804A1BC: - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x4] - cmp r2, r0 - beq _0804A212 - b _0804A20C - .pool -_0804A1CC: - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x4] - cmp r2, r0 - bls _0804A212 - b _0804A20C - .pool -_0804A1DC: - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x4] - cmp r2, r0 - bcs _0804A212 - b _0804A20C - .pool -_0804A1EC: - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x4] - ands r2, r0 - cmp r2, 0 - beq _0804A212 - b _0804A20C - .pool -_0804A200: - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x4] - ands r2, r0 - cmp r2, 0 - bne _0804A212 -_0804A20C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_0804A212: - cmp r5, 0 - beq _0804A238 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - adds r1, r0 - str r1, [r3] - b _0804A240 - .pool -_0804A238: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x9 - str r0, [r1] -_0804A240: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804A154 - - thumb_func_start atk21_jumpifspecialstatusflag -atk21_jumpifspecialstatusflag: @ 804A24C - push {r4-r6,lr} - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r5, =0x02024064 - strb r0, [r5] - ldr r2, [r4] - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - adds r6, r1, r0 - ldrb r1, [r2, 0x7] - ldrb r0, [r2, 0x8] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x9] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0xA] - lsls r0, 24 - adds r3, r1, r0 - ldrb r0, [r2, 0x6] - cmp r0, 0 - beq _0804A2AC - ldr r0, =0x020242ac - ldrb r1, [r5] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - ands r0, r6 - cmp r0, 0 - bne _0804A2C4 - b _0804A2BC - .pool -_0804A2AC: - ldr r0, =0x020242ac - ldrb r1, [r5] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - ands r0, r6 - cmp r0, 0 - beq _0804A2C4 -_0804A2BC: - str r3, [r4] - b _0804A2CA - .pool -_0804A2C4: - adds r0, r2, 0 - adds r0, 0xB - str r0, [r4] -_0804A2CA: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end atk21_jumpifspecialstatusflag - - thumb_func_start sub_804A2D0 -sub_804A2D0: @ 804A2D0 - push {r4-r6,lr} - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - lsls r0, 24 - lsrs r0, 24 - ldr r3, [r4] - ldrb r5, [r3, 0x2] - ldrb r2, [r3, 0x3] - ldrb r1, [r3, 0x4] - lsls r1, 8 - adds r2, r1 - ldrb r1, [r3, 0x5] - lsls r1, 16 - adds r2, r1 - ldrb r1, [r3, 0x6] - lsls r1, 24 - adds r6, r2, r1 - ldr r2, =0x02024084 - movs r1, 0x58 - muls r0, r1 - adds r1, r0, r2 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, r5 - beq _0804A314 - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, r5 - bne _0804A320 -_0804A314: - str r6, [r4] - b _0804A324 - .pool -_0804A320: - adds r0, r3, 0x7 - str r0, [r4] -_0804A324: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_804A2D0 - - thumb_func_start sub_804A32C -sub_804A32C: @ 804A32C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r6, 0 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x50 - mov r9, r0 - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r1, =0x0202420d - strb r0, [r1] - ldr r2, =0x020243fe - movs r1, 0x2 - ands r1, r0 - lsls r1, 24 - lsrs r1, 25 - adds r1, r2 - ldrb r1, [r1] - mov r8, r1 - ldr r0, =0x02024474 - ldrb r0, [r0, 0x1C] - cmp r0, 0x6 - bls _0804A368 - bl _0804ACB2 -_0804A368: - lsls r0, 2 - ldr r1, =_0804A38C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0804A38C: - .4byte _0804A3A8 - .4byte _0804A414 - .4byte _0804A52E - .4byte _0804A850 - .4byte _0804A954 - .4byte _0804AC40 - .4byte _0804AC88 -_0804A3A8: - ldr r4, =0x0202420d - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0804A3BC - bl _0804AC7C -_0804A3BC: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x063f0982 - ands r0, r1 - cmp r0, 0 - beq _0804A3CC - bl _0804AC7C -_0804A3CC: - ldr r1, =0x02024474 - ldrb r0, [r1, 0x1C] - adds r0, 0x1 - strb r0, [r1, 0x1C] - ldr r0, =0x0202449c - ldr r2, [r0] - adds r2, 0xDF - ldr r3, =gUnknown_0832A328 - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - bl _0804ACB2 - .pool -_0804A414: - movs r5, 0 - movs r7, 0 -_0804A418: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _0804A486 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _0804A486 - ldr r0, =gUnknown_0832A328 - lsls r1, r7, 2 - adds r1, r0 - ldr r0, [r1] - mov r1, r8 - ands r0, r1 - cmp r0, 0 - beq _0804A44C - adds r5, 0x1 -_0804A44C: - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAF - bne _0804A478 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00003226 - adds r0, r2 - ldrb r4, [r0] - b _0804A480 - .pool -_0804A478: - bl itemid_get_x12 - lsls r0, 24 - lsrs r4, r0, 24 -_0804A480: - cmp r4, 0x19 - bne _0804A486 - adds r6, 0x1 -_0804A486: - adds r7, 0x1 - cmp r7, 0x5 - ble _0804A418 - ldr r3, =gBaseStats - ldr r2, =0x02024084 - ldr r0, =0x0202420d - ldrb r1, [r0] - movs r0, 0x58 - muls r1, r0 - adds r1, r2 - ldrh r2, [r1] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r3 - ldrb r2, [r0, 0x9] - adds r1, 0x2A - ldrb r0, [r1] - muls r0, r2 - movs r1, 0x7 - bl __divsi3 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r6, 0 - beq _0804A4FC - lsrs r4, r0, 17 - adds r0, r4, 0 - adds r1, r5, 0 - bl __divsi3 - mov r1, r9 - strh r0, [r1] - lsls r0, 16 - cmp r0, 0 - bne _0804A4D2 - movs r0, 0x1 - strh r0, [r1] -_0804A4D2: - ldr r5, =0x02024402 - adds r0, r4, 0 - adds r1, r6, 0 - bl __divsi3 - strh r0, [r5] - lsls r0, 16 - cmp r0, 0 - bne _0804A516 - movs r0, 0x1 - strh r0, [r5] - b _0804A516 - .pool -_0804A4FC: - adds r0, r1, 0 - adds r1, r5, 0 - bl __divsi3 - mov r2, r9 - strh r0, [r2] - lsls r0, 16 - cmp r0, 0 - bne _0804A512 - movs r0, 0x1 - strh r0, [r2] -_0804A512: - ldr r0, =0x02024402 - strh r6, [r0] -_0804A516: - ldr r1, =0x02024474 - ldrb r0, [r1, 0x1C] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1, 0x1C] - ldr r1, =0x0202449c - ldr r0, [r1] - strb r2, [r0, 0x10] - ldr r0, [r1] - adds r0, 0x53 - mov r4, r8 - strb r4, [r0] -_0804A52E: - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _0804A538 - b _0804ACB2 -_0804A538: - ldr r0, =0x0202449c - ldr r0, [r0] - ldrb r1, [r0, 0x10] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xC - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAF - bne _0804A57C - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003226 - adds r0, r1 - ldrb r4, [r0] - b _0804A584 - .pool -_0804A57C: - bl itemid_get_x12 - lsls r0, 24 - lsrs r4, r0, 24 -_0804A584: - ldr r5, =0x0202449c - cmp r4, 0x19 - beq _0804A5AC - ldr r0, [r5] - adds r1, r0, 0 - adds r1, 0x53 - ldrb r0, [r1] - movs r2, 0x1 - ands r2, r0 - cmp r2, 0 - bne _0804A5AC - lsrs r0, 1 - strb r0, [r1] - ldr r1, =0x02024474 - b _0804A5D0 - .pool -_0804A5AC: - ldr r0, [r5] - ldrb r1, [r0, 0x10] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x38 - bl pokemon_getattr - cmp r0, 0x64 - bne _0804A5E8 - ldr r1, [r5] - adds r1, 0x53 - ldrb r0, [r1] - lsrs r0, 1 - strb r0, [r1] - ldr r1, =0x02024474 - movs r2, 0 -_0804A5D0: - movs r0, 0x5 - strb r0, [r1, 0x1C] - ldr r0, =0x020241f0 - str r2, [r0] - b _0804ACB2 - .pool -_0804A5E8: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - bne _0804A616 - ldr r0, =0x02024084 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _0804A616 - ldr r0, [r5] - ldrb r0, [r0, 0x12] - cmp r0, 0 - bne _0804A616 - bl sub_805EA60 - ldr r0, =0x00000161 - bl song_play_for_text - ldr r1, [r5] - ldrb r0, [r1, 0x12] - adds r0, 0x1 - strb r0, [r1, 0x12] -_0804A616: - ldr r5, =0x0202449c - ldr r0, [r5] - ldrb r1, [r0, 0x10] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - bne _0804A630 - b _0804A824 -_0804A630: - ldr r0, [r5] - adds r0, 0x53 - ldrb r0, [r0] - movs r3, 0x1 - ands r3, r0 - cmp r3, 0 - beq _0804A664 - ldr r1, =0x020241f0 - mov r2, r9 - ldrh r0, [r2] - str r0, [r1] - mov r9, r1 - b _0804A66A - .pool -_0804A664: - ldr r0, =0x020241f0 - str r3, [r0] - mov r9, r0 -_0804A66A: - cmp r4, 0x19 - bne _0804A67A - ldr r0, =0x02024402 - ldrh r1, [r0] - mov r2, r9 - ldr r0, [r2] - adds r0, r1 - str r0, [r2] -_0804A67A: - cmp r4, 0x28 - bne _0804A68E - mov r4, r9 - ldr r1, [r4] - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - str r0, [r4] -_0804A68E: - ldr r5, =0x02022fec - ldr r0, [r5] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0804A6AA - ldr r4, =0x020241f0 - ldr r1, [r4] - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - str r0, [r4] -_0804A6AA: - ldr r4, =0x0202449c - ldr r0, [r4] - ldrb r1, [r0, 0x10] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - bl sub_806E8A8 - lsls r0, 24 - cmp r0, 0 - beq _0804A714 - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _0804A6F8 - ldr r0, [r4] - ldrb r0, [r0, 0x10] - cmp r0, 0x2 - bls _0804A6F8 - ldr r7, =0x00000149 - ldr r0, =0x020241f0 - mov r9, r0 - b _0804A71A - .pool -_0804A6F8: - ldr r4, =0x020241f0 - ldr r1, [r4] - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - str r0, [r4] - movs r7, 0xA5 - lsls r7, 1 - mov r9, r4 - b _0804A71A - .pool -_0804A714: - ldr r7, =0x00000149 - ldr r1, =0x020241f0 - mov r9, r1 -_0804A71A: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0804A786 - ldr r0, =0x0202406e - ldr r1, =0x0202449c - ldr r4, [r1] - ldrh r0, [r0, 0x4] - adds r5, r1, 0 - ldr r3, =gUnknown_0832A328 - ldr r2, =0x02024210 - ldrb r1, [r4, 0x10] - cmp r0, r1 - bne _0804A76C - ldrb r1, [r2] - ldr r0, [r3, 0x8] - ands r1, r0 - cmp r1, 0 - bne _0804A76C - adds r1, r4, 0 - adds r1, 0x8F - movs r0, 0x2 - strb r0, [r1] - b _0804A78E - .pool -_0804A76C: - ldrb r2, [r2] - ldr r0, [r3] - ands r2, r0 - cmp r2, 0 - bne _0804A77E - ldr r0, [r5] - adds r0, 0x8F - strb r2, [r0] - b _0804A78E -_0804A77E: - ldr r0, [r5] - adds r0, 0x8F - movs r1, 0x2 - b _0804A78C -_0804A786: - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x8F -_0804A78C: - strb r1, [r0] -_0804A78E: - ldr r1, =0x02022f58 - movs r2, 0 - mov r12, r2 - movs r3, 0xFD - strb r3, [r1] - movs r5, 0x4 - strb r5, [r1, 0x1] - ldr r6, =0x0202449c - ldr r2, [r6] - movs r4, 0x8F - adds r4, r2 - mov r8, r4 - ldrb r0, [r4] - strb r0, [r1, 0x2] - ldrb r0, [r2, 0x10] - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x02022f68 - strb r3, [r1] - mov r0, r12 - strb r0, [r1, 0x1] - strb r7, [r1, 0x2] - movs r4, 0xFF - lsls r4, 8 - ands r7, r4 - asrs r0, r7, 8 - strb r0, [r1, 0x3] - movs r0, 0x1 - negs r0, r0 - strb r0, [r1, 0x4] - ldr r1, =0x02022f78 - strb r3, [r1] - movs r0, 0x1 - strb r0, [r1, 0x1] - strb r5, [r1, 0x2] - movs r0, 0x5 - strb r0, [r1, 0x3] - mov r0, r9 - ldr r2, [r0] - strb r2, [r1, 0x4] - adds r0, r2, 0 - ands r0, r4 - asrs r0, 8 - strb r0, [r1, 0x5] - movs r0, 0xFF - lsls r0, 16 - ands r0, r2 - asrs r0, 16 - strb r0, [r1, 0x6] - lsrs r2, 24 - strb r2, [r1, 0x7] - movs r0, 0x1 - negs r0, r0 - strb r0, [r1, 0x8] - mov r2, r8 - ldrb r1, [r2] - movs r0, 0xD - bl b_std_message - ldr r0, [r6] - ldrb r1, [r0, 0x10] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r3, =0x02024084 - ldr r1, =0x0202420d - ldrb r2, [r1] - movs r1, 0x58 - muls r1, r2 - adds r1, r3 - ldrh r1, [r1] - bl sub_806DADC -_0804A824: - ldr r0, =0x0202449c - ldr r1, [r0] - adds r1, 0x53 - ldrb r0, [r1] - lsrs r0, 1 - strb r0, [r1] - b _0804A92A - .pool -_0804A850: - ldr r0, =0x02024068 - ldr r2, [r0] - cmp r2, 0 - beq _0804A85A - b _0804ACB2 -_0804A85A: - ldr r1, =0x02023864 - ldr r7, =0x0202449c - ldr r0, [r7] - adds r0, 0x8F - ldrb r0, [r0] - lsls r0, 9 - adds r0, r1 - strb r2, [r0] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _0804A92A - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r6 - adds r0, r5 - movs r1, 0x38 - bl pokemon_getattr - cmp r0, 0x64 - beq _0804A92A - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r6 - adds r0, r5 - movs r1, 0x3A - bl pokemon_getattr - ldr r4, =0x020244a8 - ldr r1, [r4] - ldr r1, [r1, 0x10] - strh r0, [r1] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r6 - adds r0, r5 - movs r1, 0x3B - bl pokemon_getattr - ldr r1, [r4] - ldr r1, [r1, 0x10] - strh r0, [r1, 0x2] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r6 - adds r0, r5 - movs r1, 0x3C - bl pokemon_getattr - ldr r1, [r4] - ldr r1, [r1, 0x10] - strh r0, [r1, 0x4] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r6 - adds r0, r5 - movs r1, 0x3D - bl pokemon_getattr - ldr r1, [r4] - ldr r1, [r1, 0x10] - strh r0, [r1, 0x6] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r6 - adds r0, r5 - movs r1, 0x3E - bl pokemon_getattr - ldr r1, [r4] - ldr r1, [r1, 0x10] - strh r0, [r1, 0x8] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r6 - adds r0, r5 - movs r1, 0x3F - bl pokemon_getattr - ldr r1, [r4] - ldr r1, [r1, 0x10] - strh r0, [r1, 0xA] - ldr r4, =0x02024064 - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0x8F - ldrb r0, [r0] - strb r0, [r4] - ldrb r1, [r1, 0x10] - ldr r0, =0x020241f0 - ldrh r2, [r0] - movs r0, 0 - bl dp01_build_cmdbuf_x19_a_bb - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0804A92A: - ldr r1, =0x02024474 - ldrb r0, [r1, 0x1C] - adds r0, 0x1 - strb r0, [r1, 0x1C] - b _0804ACB2 - .pool -_0804A954: - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _0804A95E - b _0804ACB2 -_0804A95E: - ldr r1, =0x02024064 - ldr r0, =0x0202449c - ldr r4, [r0] - adds r0, r4, 0 - adds r0, 0x8F - ldrb r0, [r0] - strb r0, [r1] - ldr r3, =0x02023864 - ldrb r2, [r1] - lsls r1, r2, 9 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, 0x21 - beq _0804A97C - b _0804AC28 -_0804A97C: - adds r0, r3, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - cmp r0, 0xB - beq _0804A988 - b _0804AC28 -_0804A988: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0804A9B2 - ldr r0, =0x0202406e - lsls r1, r2, 1 - adds r1, r0 - ldrh r0, [r1] - ldrb r4, [r4, 0x10] - cmp r0, r4 - bne _0804A9B2 - adds r1, r0, 0 - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - adds r1, r2, 0 - bl sub_805E990 -_0804A9B2: - ldr r1, =0x02022f58 - movs r3, 0xFD - strb r3, [r1] - movs r0, 0x4 - strb r0, [r1, 0x1] - ldr r6, =0x02024064 - ldrb r0, [r6] - strb r0, [r1, 0x2] - ldr r4, =0x0202449c - mov r9, r4 - ldr r2, [r4] - ldrb r0, [r2, 0x10] - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r4, =0x02022f68 - strb r3, [r4] - movs r0, 0x1 - strb r0, [r4, 0x1] - strb r0, [r4, 0x2] - movs r0, 0x3 - strb r0, [r4, 0x3] - ldrb r0, [r2, 0x10] - movs r1, 0x64 - mov r8, r1 - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - ldr r7, =0x020244ec - adds r0, r7 - movs r1, 0x38 - bl pokemon_getattr - strb r0, [r4, 0x4] - movs r0, 0x1 - negs r0, r0 - strb r0, [r4, 0x5] - bl b_movescr_stack_push_cursor - ldr r2, =0x03005d54 - ldr r1, =gUnknown_0832A328 - mov r4, r9 - ldr r5, [r4] - ldrb r0, [r5, 0x10] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DABBD - str r0, [r1] - ldr r4, =0x020241f0 - ldr r2, =0x02023864 - ldrb r1, [r6] - lsls r1, 9 - adds r0, r2, 0x2 - adds r0, r1, r0 - ldrb r3, [r0] - adds r2, 0x3 - adds r1, r2 - ldrb r0, [r1] - lsls r0, 8 - orrs r3, r0 - str r3, [r4] - ldrb r0, [r5, 0x10] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r7 - movs r1, 0 - bl happiness_algorithm - ldr r1, =0x0202406e - mov r2, r9 - ldr r0, [r2] - ldrb r2, [r0, 0x10] - ldrh r0, [r1] - cmp r0, r2 - bne _0804AB1E - ldr r4, =0x02024084 - ldrh r0, [r4, 0x28] - cmp r0, 0 - beq _0804AB1E - mov r0, r8 - muls r0, r2 - adds r0, r7 - movs r1, 0x38 - bl pokemon_getattr - adds r1, r4, 0 - adds r1, 0x2A - strb r0, [r1] - mov r1, r9 - ldr r0, [r1] - ldrb r0, [r0, 0x10] - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - adds r0, r7 - movs r1, 0x39 - bl pokemon_getattr - strh r0, [r4, 0x28] - mov r1, r9 - ldr r0, [r1] - ldrb r0, [r0, 0x10] - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - adds r0, r7 - movs r1, 0x3A - bl pokemon_getattr - strh r0, [r4, 0x2C] - mov r1, r9 - ldr r0, [r1] - ldrb r0, [r0, 0x10] - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - adds r0, r7 - movs r1, 0x3B - bl pokemon_getattr - strh r0, [r4, 0x2] - mov r1, r9 - ldr r0, [r1] - ldrb r0, [r0, 0x10] - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - adds r0, r7 - movs r1, 0x3C - bl pokemon_getattr - strh r0, [r4, 0x4] - mov r1, r9 - ldr r0, [r1] - ldrb r0, [r0, 0x10] - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - adds r0, r7 - movs r1, 0x3D - bl pokemon_getattr - strh r0, [r4, 0x6] - mov r1, r9 - ldr r0, [r1] - ldrb r0, [r0, 0x10] - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - adds r0, r7 - movs r1, 0x3D - bl pokemon_getattr - strh r0, [r4, 0x6] - mov r1, r9 - ldr r0, [r1] - ldrb r0, [r0, 0x10] - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - adds r0, r7 - movs r1, 0x3E - bl pokemon_getattr - strh r0, [r4, 0x8] - mov r1, r9 - ldr r0, [r1] - ldrb r0, [r0, 0x10] - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - adds r0, r7 - movs r1, 0x3F - bl pokemon_getattr - strh r0, [r4, 0xA] -_0804AB1E: - ldr r0, =0x0202406e - ldr r7, =0x0202449c - ldr r1, [r7] - ldrb r2, [r1, 0x10] - ldrh r0, [r0, 0x4] - cmp r0, r2 - beq _0804AB2E - b _0804AC2E -_0804AB2E: - ldr r6, =0x02024084 - movs r4, 0xD8 - adds r4, r6 - mov r8, r4 - ldrh r0, [r4] - cmp r0, 0 - beq _0804AC2E - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0804AC2E - movs r5, 0x64 - adds r0, r2, 0 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - movs r1, 0x38 - bl pokemon_getattr - adds r1, r6, 0 - adds r1, 0xDA - strb r0, [r1] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r5 - adds r0, r4 - movs r1, 0x39 - bl pokemon_getattr - mov r1, r8 - strh r0, [r1] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r5 - adds r0, r4 - movs r1, 0x3A - bl pokemon_getattr - adds r1, r6, 0 - adds r1, 0xDC - strh r0, [r1] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r5 - adds r0, r4 - movs r1, 0x3B - bl pokemon_getattr - adds r1, r6, 0 - adds r1, 0xB2 - strh r0, [r1] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r5 - adds r0, r4 - movs r1, 0x3C - bl pokemon_getattr - adds r1, r6, 0 - adds r1, 0xB4 - strh r0, [r1] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r5 - adds r0, r4 - movs r1, 0x3D - bl pokemon_getattr - movs r2, 0xB6 - adds r2, r6 - mov r8, r2 - strh r0, [r2] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r5 - adds r0, r4 - movs r1, 0x3D - bl pokemon_getattr - mov r1, r8 - strh r0, [r1] - ldr r0, [r7] - ldrb r0, [r0, 0x10] - muls r0, r5 - adds r0, r4 - movs r1, 0x3E - bl pokemon_getattr - adds r1, r6, 0 - adds r1, 0xB8 - strh r0, [r1] - b _0804AC2E - .pool -_0804AC28: - ldr r1, =0x020241f0 - movs r0, 0 - str r0, [r1] -_0804AC2E: - ldr r1, =0x02024474 - movs r0, 0x5 - strb r0, [r1, 0x1C] - b _0804ACB2 - .pool -_0804AC40: - ldr r0, =0x020241f0 - ldr r0, [r0] - cmp r0, 0 - beq _0804AC58 - ldr r1, =0x02024474 - movs r0, 0x3 - strb r0, [r1, 0x1C] - b _0804ACB2 - .pool -_0804AC58: - ldr r2, =0x0202449c - ldr r1, [r2] - ldrb r0, [r1, 0x10] - adds r0, 0x1 - strb r0, [r1, 0x10] - ldr r0, [r2] - ldrb r0, [r0, 0x10] - cmp r0, 0x5 - bhi _0804AC7C - ldr r1, =0x02024474 - movs r0, 0x2 - strb r0, [r1, 0x1C] - b _0804ACB2 - .pool -_0804AC7C: - ldr r1, =0x02024474 - movs r0, 0x6 - strb r0, [r1, 0x1C] - b _0804ACB2 - .pool -_0804AC88: - ldr r0, =0x02024068 - ldr r5, [r0] - cmp r5, 0 - bne _0804ACB2 - ldr r4, =0x02024084 - ldr r2, =0x0202420d - ldrb r0, [r2] - movs r1, 0x58 - muls r0, r1 - adds r0, r4 - movs r3, 0 - strh r5, [r0, 0x2E] - ldrb r0, [r2] - muls r0, r1 - adds r0, r4 - adds r0, 0x20 - strb r3, [r0] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] -_0804ACB2: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804A32C - - thumb_func_start sub_804ACD0 -sub_804ACD0: @ 804ACD0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r6, 0 - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _0804ACE2 - b _0804AF22 -_0804ACE2: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _0804AD48 - ldr r0, =0x02038bce - ldrh r1, [r0] - ldr r0, =0x00000c03 - cmp r1, r0 - bne _0804AD48 - movs r5, 0 -_0804ACFC: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _0804AD2C - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0804AD2C - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - adds r0, r6, r0 - lsls r0, 16 - lsrs r6, r0, 16 -_0804AD2C: - adds r5, 0x1 - cmp r5, 0x2 - ble _0804ACFC - b _0804ADA8 - .pool -_0804AD48: - movs r5, 0 -_0804AD4A: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _0804ADA2 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0804ADA2 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _0804AD94 - ldr r0, =0x0202449c - ldr r0, [r0] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0804ADA2 -_0804AD94: - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - adds r0, r6, r0 - lsls r0, 16 - lsrs r6, r0, 16 -_0804ADA2: - adds r5, 0x1 - cmp r5, 0x5 - ble _0804AD4A -_0804ADA8: - cmp r6, 0 - bne _0804ADB6 - ldr r0, =0x0202433a - ldrb r1, [r0] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0] -_0804ADB6: - movs r6, 0 - movs r5, 0 -_0804ADBA: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x02024744 - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _0804AE10 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0804AE10 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _0804AE02 - ldr r0, =0x0202449c - ldr r0, [r0] - ldr r1, =0x000002a1 - adds r0, r1 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0804AE10 -_0804AE02: - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - adds r0, r6, r0 - lsls r0, 16 - lsrs r6, r0, 16 -_0804AE10: - adds r5, 0x1 - cmp r5, 0x5 - ble _0804ADBA - ldr r2, =0x0202433a - cmp r6, 0 - bne _0804AE24 - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] -_0804AE24: - ldrb r0, [r2] - cmp r0, 0 - bne _0804AF1A - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r2, =0x02000002 - ands r1, r2 - mov r8, r0 - cmp r1, 0 - beq _0804AF1A - movs r3, 0 - movs r5, 0 - ldr r0, =0x0202406c - ldrb r1, [r0] - mov r12, r0 - ldr r7, =0x02024214 - cmp r3, r1 - bge _0804AE70 - ldr r0, =0x02024280 - movs r6, 0x80 - lsls r6, 21 - ldr r4, [r0] - adds r2, r1, 0 - ldr r1, =0x0202437c -_0804AE54: - adds r0, r6, 0 - lsls r0, r5 - ands r0, r4 - cmp r0, 0 - beq _0804AE68 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - blt _0804AE68 - adds r3, 0x1 -_0804AE68: - adds r1, 0x28 - adds r5, 0x2 - cmp r5, r2 - blt _0804AE54 -_0804AE70: - movs r2, 0 - movs r5, 0x1 - mov r4, r12 - ldrb r1, [r4] - cmp r5, r1 - bge _0804AEAA - ldr r0, =0x02024280 - movs r4, 0x80 - lsls r4, 21 - mov r12, r4 - ldr r6, [r0] - ldr r0, =0x0202437c - adds r4, r1, 0 - adds r1, r0, 0 - adds r1, 0x14 -_0804AE8E: - mov r0, r12 - lsls r0, r5 - ands r0, r6 - cmp r0, 0 - beq _0804AEA2 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - blt _0804AEA2 - adds r2, 0x1 -_0804AEA2: - adds r1, 0x28 - adds r5, 0x2 - cmp r5, r4 - blt _0804AE8E -_0804AEAA: - mov r1, r8 - ldr r0, [r1] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0804AEF0 - adds r0, r2, r3 - cmp r0, 0x1 - bgt _0804AEF8 - b _0804AF12 - .pool -_0804AEF0: - cmp r2, 0 - beq _0804AF12 - cmp r3, 0 - beq _0804AF12 -_0804AEF8: - ldr r2, [r7] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - adds r1, r0 - str r1, [r7] - b _0804AF22 -_0804AF12: - ldr r0, [r7] - adds r0, 0x5 - str r0, [r7] - b _0804AF22 -_0804AF1A: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_0804AF22: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804ACD0 - - thumb_func_start sub_804AF30 -sub_804AF30: @ 804AF30 - ldr r1, =0x0202427c - movs r0, 0 - strb r0, [r1] - ldr r0, =0x02024474 - movs r2, 0 - movs r1, 0x1 - strb r1, [r0, 0xE] - ldr r0, =0x02024211 - strb r1, [r0] - ldr r0, =0x02024332 - strb r2, [r0, 0x3] - strb r2, [r0, 0x6] - ldr r2, =0x02024280 - ldr r0, [r2] - subs r1, 0x42 - ands r0, r1 - ldr r1, =0xffffbfff - ands r0, r1 - str r0, [r2] - bx lr - .pool - thumb_func_end sub_804AF30 - - thumb_func_start atk25_cmd25 -atk25_cmd25: @ 804AF70 - push {lr} - bl sub_804AF30 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atk25_cmd25 - - thumb_func_start atk26_80225F0_storebyteforjump -atk26_80225F0_storebyteforjump: @ 804AF88 - ldr r3, =0x02024212 - ldr r2, =0x02024214 - ldr r0, [r2] - ldrb r1, [r0, 0x1] - strb r1, [r3] - adds r0, 0x2 - str r0, [r2] - bx lr - .pool - thumb_func_end atk26_80225F0_storebyteforjump - - thumb_func_start atk27_cmd27 -atk27_cmd27: @ 804AFA0 - push {lr} - ldr r1, =0x02024212 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - bne _0804AFC4 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _0804AFDE - .pool -_0804AFC4: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - adds r1, r0 - str r1, [r3] -_0804AFDE: - pop {r0} - bx r0 - .pool - thumb_func_end atk27_cmd27 - - thumb_func_start atk28_goto -atk28_goto: @ 804AFE8 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - adds r1, r0 - str r1, [r3] - bx lr - .pool - thumb_func_end atk28_goto - - thumb_func_start atk29_jumpifbyte -atk29_jumpifbyte: @ 804B008 - push {r4-r6,lr} - ldr r3, =0x02024214 - ldr r1, [r3] - ldrb r6, [r1, 0x1] - ldrb r2, [r1, 0x2] - ldrb r0, [r1, 0x3] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0x4] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0x5] - lsls r0, 24 - adds r5, r2, r0 - ldrb r4, [r1, 0x6] - ldrb r2, [r1, 0x7] - ldrb r0, [r1, 0x8] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0x9] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0xA] - lsls r0, 24 - adds r2, r0 - adds r1, 0xB - str r1, [r3] - cmp r6, 0x5 - bhi _0804B0A0 - lsls r0, r6, 2 - ldr r1, =_0804B054 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0804B054: - .4byte _0804B06C - .4byte _0804B074 - .4byte _0804B07C - .4byte _0804B084 - .4byte _0804B08C - .4byte _0804B096 -_0804B06C: - ldrb r0, [r5] - cmp r0, r4 - bne _0804B0A0 - b _0804B09E -_0804B074: - ldrb r0, [r5] - cmp r0, r4 - beq _0804B0A0 - b _0804B09E -_0804B07C: - ldrb r0, [r5] - cmp r0, r4 - bls _0804B0A0 - b _0804B09E -_0804B084: - ldrb r0, [r5] - cmp r0, r4 - bcs _0804B0A0 - b _0804B09E -_0804B08C: - ldrb r0, [r5] - ands r4, r0 - cmp r4, 0 - beq _0804B0A0 - b _0804B09E -_0804B096: - ldrb r0, [r5] - ands r4, r0 - cmp r4, 0 - bne _0804B0A0 -_0804B09E: - str r2, [r3] -_0804B0A0: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end atk29_jumpifbyte - - thumb_func_start sub_804B0A8 -sub_804B0A8: @ 804B0A8 - push {r4-r6,lr} - ldr r3, =0x02024214 - ldr r1, [r3] - ldrb r6, [r1, 0x1] - ldrb r2, [r1, 0x2] - ldrb r0, [r1, 0x3] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0x4] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0x5] - lsls r0, 24 - adds r5, r2, r0 - ldrb r4, [r1, 0x6] - ldrb r0, [r1, 0x7] - lsls r0, 8 - orrs r4, r0 - ldrb r2, [r1, 0x8] - ldrb r0, [r1, 0x9] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0xA] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0xB] - lsls r0, 24 - adds r2, r0 - adds r1, 0xC - str r1, [r3] - cmp r6, 0x5 - bhi _0804B148 - lsls r0, r6, 2 - ldr r1, =_0804B0FC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0804B0FC: - .4byte _0804B114 - .4byte _0804B11C - .4byte _0804B124 - .4byte _0804B12C - .4byte _0804B134 - .4byte _0804B13E -_0804B114: - ldrh r0, [r5] - cmp r0, r4 - bne _0804B148 - b _0804B146 -_0804B11C: - ldrh r0, [r5] - cmp r0, r4 - beq _0804B148 - b _0804B146 -_0804B124: - ldrh r0, [r5] - cmp r0, r4 - bls _0804B148 - b _0804B146 -_0804B12C: - ldrh r0, [r5] - cmp r0, r4 - bcs _0804B148 - b _0804B146 -_0804B134: - ldrh r0, [r5] - ands r4, r0 - cmp r4, 0 - beq _0804B148 - b _0804B146 -_0804B13E: - ldrh r0, [r5] - ands r4, r0 - cmp r4, 0 - bne _0804B148 -_0804B146: - str r2, [r3] -_0804B148: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_804B0A8 - - thumb_func_start sub_804B150 -sub_804B150: @ 804B150 - push {r4-r6,lr} - ldr r3, =0x02024214 - ldr r1, [r3] - ldrb r6, [r1, 0x1] - ldrb r2, [r1, 0x2] - ldrb r0, [r1, 0x3] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0x4] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0x5] - lsls r0, 24 - adds r5, r2, r0 - ldrb r4, [r1, 0x6] - ldrb r0, [r1, 0x7] - lsls r0, 8 - orrs r4, r0 - ldrb r0, [r1, 0x8] - lsls r0, 16 - orrs r4, r0 - ldrb r0, [r1, 0x9] - lsls r0, 24 - orrs r4, r0 - ldrb r2, [r1, 0xA] - ldrb r0, [r1, 0xB] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0xC] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0xD] - lsls r0, 24 - adds r2, r0 - adds r1, 0xE - str r1, [r3] - cmp r6, 0x5 - bhi _0804B1FC - lsls r0, r6, 2 - ldr r1, =_0804B1B0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0804B1B0: - .4byte _0804B1C8 - .4byte _0804B1D0 - .4byte _0804B1D8 - .4byte _0804B1E0 - .4byte _0804B1E8 - .4byte _0804B1F2 -_0804B1C8: - ldr r0, [r5] - cmp r0, r4 - bne _0804B1FC - b _0804B1FA -_0804B1D0: - ldr r0, [r5] - cmp r0, r4 - beq _0804B1FC - b _0804B1FA -_0804B1D8: - ldr r0, [r5] - cmp r0, r4 - bls _0804B1FC - b _0804B1FA -_0804B1E0: - ldr r0, [r5] - cmp r0, r4 - bcs _0804B1FC - b _0804B1FA -_0804B1E8: - ldr r0, [r5] - ands r0, r4 - cmp r0, 0 - beq _0804B1FC - b _0804B1FA -_0804B1F2: - ldr r0, [r5] - ands r0, r4 - cmp r0, 0 - bne _0804B1FC -_0804B1FA: - str r2, [r3] -_0804B1FC: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_804B150 - - thumb_func_start sub_804B204 -sub_804B204: @ 804B204 - push {r4-r7,lr} - ldr r2, =0x02024214 - ldr r3, [r2] - ldrb r1, [r3, 0x1] - ldrb r0, [r3, 0x2] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r3, 0x3] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 24 - adds r5, r1, r0 - ldrb r1, [r3, 0x5] - ldrb r0, [r3, 0x6] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r3, 0x7] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r3, 0x8] - lsls r0, 24 - adds r4, r1, r0 - ldrb r6, [r3, 0x9] - ldrb r1, [r3, 0xA] - ldrb r0, [r3, 0xB] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r3, 0xC] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r3, 0xD] - lsls r0, 24 - adds r1, r0 - mov r12, r1 - movs r1, 0 - cmp r1, r6 - bcs _0804B27C - ldrb r0, [r5] - ldrb r7, [r4] - cmp r0, r7 - beq _0804B260 - adds r0, r3, 0 - b _0804B278 - .pool -_0804B260: - adds r5, 0x1 - adds r4, 0x1 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, r6 - bcs _0804B27C - ldrb r0, [r5] - ldrb r3, [r4] - cmp r0, r3 - beq _0804B260 - ldr r0, [r2] -_0804B278: - adds r0, 0xE - str r0, [r2] -_0804B27C: - cmp r1, r6 - bne _0804B284 - mov r7, r12 - str r7, [r2] -_0804B284: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_804B204 - - thumb_func_start sub_804B28C -sub_804B28C: @ 804B28C - push {r4-r7,lr} - movs r7, 0 - ldr r3, =0x02024214 - ldr r1, [r3] - ldrb r2, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - adds r5, r2, r0 - ldrb r2, [r1, 0x5] - ldrb r0, [r1, 0x6] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0x7] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0x8] - lsls r0, 24 - adds r4, r2, r0 - ldrb r6, [r1, 0x9] - ldrb r2, [r1, 0xA] - ldrb r0, [r1, 0xB] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0xC] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0xD] - lsls r0, 24 - adds r2, r0 - mov r12, r2 - movs r1, 0 - cmp r7, r6 - bcs _0804B2F6 -_0804B2DA: - ldrb r0, [r5] - ldrb r2, [r4] - cmp r0, r2 - bne _0804B2E8 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 -_0804B2E8: - adds r5, 0x1 - adds r4, 0x1 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, r6 - bcc _0804B2DA -_0804B2F6: - cmp r7, r6 - beq _0804B304 - mov r0, r12 - b _0804B308 - .pool -_0804B304: - ldr r0, [r3] - adds r0, 0xE -_0804B308: - str r0, [r3] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_804B28C - - thumb_func_start sub_804B310 -sub_804B310: @ 804B310 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - adds r1, r0 - ldrb r0, [r2, 0x5] - strb r0, [r1] - ldr r0, [r3] - adds r0, 0x6 - str r0, [r3] - bx lr - .pool - thumb_func_end sub_804B310 - - thumb_func_start sub_804B338 -sub_804B338: @ 804B338 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - adds r1, r0 - ldrb r0, [r2, 0x5] - ldrb r2, [r1] - adds r0, r2 - strb r0, [r1] - ldr r0, [r3] - adds r0, 0x6 - str r0, [r3] - bx lr - .pool - thumb_func_end sub_804B338 - - thumb_func_start sub_804B364 -sub_804B364: @ 804B364 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - adds r1, r0 - ldrb r0, [r1] - ldrb r2, [r2, 0x5] - subs r0, r2 - strb r0, [r1] - ldr r0, [r3] - adds r0, 0x6 - str r0, [r3] - bx lr - .pool - thumb_func_end sub_804B364 - - thumb_func_start atk31_copyarray -atk31_copyarray: @ 804B390 - push {r4-r6,lr} - ldr r3, =0x02024214 - ldr r1, [r3] - ldrb r2, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - adds r6, r2, r0 - ldrb r2, [r1, 0x5] - ldrb r0, [r1, 0x6] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0x7] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0x8] - lsls r0, 24 - adds r5, r2, r0 - ldrb r4, [r1, 0x9] - movs r2, 0 - cmp r2, r4 - bge _0804B3D4 -_0804B3C6: - adds r0, r6, r2 - adds r1, r5, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, r4 - blt _0804B3C6 -_0804B3D4: - ldr r0, [r3] - adds r0, 0xA - str r0, [r3] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atk31_copyarray - - thumb_func_start atk32_memcpy_with_offset -atk32_memcpy_with_offset: @ 804B3E4 - push {r4-r7,lr} - ldr r3, =0x02024214 - ldr r1, [r3] - ldrb r2, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - adds r7, r2, r0 - ldrb r2, [r1, 0x5] - ldrb r0, [r1, 0x6] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0x7] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0x8] - lsls r0, 24 - adds r6, r2, r0 - ldrb r2, [r1, 0x9] - ldrb r0, [r1, 0xA] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r1, 0xB] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r1, 0xC] - lsls r0, 24 - adds r5, r2, r0 - ldrb r4, [r1, 0xD] - movs r2, 0 - cmp r2, r4 - bge _0804B440 -_0804B42E: - adds r0, r7, r2 - ldrb r1, [r5] - adds r1, r2, r1 - adds r1, r6, r1 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, r4 - blt _0804B42E -_0804B440: - ldr r0, [r3] - adds r0, 0xE - str r0, [r3] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk32_memcpy_with_offset - - thumb_func_start atk33_orbyte -atk33_orbyte: @ 804B450 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - adds r1, r0 - ldrb r0, [r1] - ldrb r2, [r2, 0x5] - orrs r0, r2 - strb r0, [r1] - ldr r0, [r3] - adds r0, 0x6 - str r0, [r3] - bx lr - .pool - thumb_func_end atk33_orbyte - - thumb_func_start atk34_orhalfword -atk34_orhalfword: @ 804B47C - push {r4,lr} - ldr r4, =0x02024214 - ldr r3, [r4] - ldrb r2, [r3, 0x1] - ldrb r0, [r3, 0x2] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r3, 0x3] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r3, 0x4] - lsls r0, 24 - adds r2, r0 - ldrb r1, [r3, 0x5] - ldrb r0, [r3, 0x6] - lsls r0, 8 - orrs r1, r0 - ldrh r0, [r2] - orrs r1, r0 - strh r1, [r2] - ldr r0, [r4] - adds r0, 0x7 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk34_orhalfword - - thumb_func_start atk35_orword -atk35_orword: @ 804B4B4 - push {r4,lr} - ldr r4, =0x02024214 - ldr r2, [r4] - ldrb r3, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - adds r3, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - adds r3, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - adds r3, r0 - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - adds r1, r0 - ldr r0, [r3] - orrs r0, r1 - str r0, [r3] - ldr r0, [r4] - adds r0, 0x9 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk35_orword - - thumb_func_start atk36_bicbyte -atk36_bicbyte: @ 804B4F8 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - adds r1, r0 - ldrb r2, [r2, 0x5] - ldrb r0, [r1] - bics r0, r2 - strb r0, [r1] - ldr r0, [r3] - adds r0, 0x6 - str r0, [r3] - bx lr - .pool - thumb_func_end atk36_bicbyte - - thumb_func_start atk37_bichalfword -atk37_bichalfword: @ 804B524 - push {r4,lr} - ldr r4, =0x02024214 - ldr r3, [r4] - ldrb r1, [r3, 0x1] - ldrb r0, [r3, 0x2] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r3, 0x3] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 24 - adds r1, r0 - ldrb r2, [r3, 0x5] - ldrb r0, [r3, 0x6] - lsls r0, 8 - orrs r2, r0 - ldrh r0, [r1] - bics r0, r2 - strh r0, [r1] - ldr r0, [r4] - adds r0, 0x7 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk37_bichalfword - - thumb_func_start atk38_bicword -atk38_bicword: @ 804B55C - push {r4,lr} - ldr r4, =0x02024214 - ldr r2, [r4] - ldrb r3, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - adds r3, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - adds r3, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - adds r3, r0 - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - adds r1, r0 - ldr r0, [r3] - bics r0, r1 - str r0, [r3] - ldr r0, [r4] - adds r0, 0x9 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk38_bicword - - thumb_func_start atk39_pause -atk39_pause: @ 804B5A0 - push {r4,r5,lr} - ldr r0, =0x02024068 - ldr r4, [r0] - cmp r4, 0 - bne _0804B5CC - ldr r5, =0x02024214 - ldr r2, [r5] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldr r3, =0x0202432c - ldrh r0, [r3] - adds r0, 0x1 - strh r0, [r3] - lsls r0, 16 - lsrs r0, 16 - cmp r0, r1 - bcc _0804B5CC - strh r4, [r3] - adds r0, r2, 0x3 - str r0, [r5] -_0804B5CC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk39_pause - - thumb_func_start sub_804B5E0 -sub_804B5E0: @ 804B5E0 - push {lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0804B5F2 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_0804B5F2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_804B5E0 - - thumb_func_start atk3B_8022C68 -atk3B_8022C68: @ 804B600 - push {lr} - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _0804B620 - ldr r0, =0x02024064 - ldr r1, =0x0202420c - b _0804B624 - .pool -_0804B620: - ldr r0, =0x02024064 - ldr r1, =0x0202420b -_0804B624: - ldrb r1, [r1] - strb r1, [r0] - ldr r0, =0x020241f0 - ldrh r1, [r0] - movs r0, 0 - bl dp01_build_cmdbuf_x18_0_aa_health_bar_update - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atk3B_8022C68 - - thumb_func_start atk3C_return -atk3C_return: @ 804B658 - push {lr} - bl b_movescr_stack_pop_cursor - pop {r0} - bx r0 - thumb_func_end atk3C_return - - thumb_func_start sub_804B664 -sub_804B664: @ 804B664 - push {lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _0804B67C - ldr r0, =0x0202420b - ldrb r0, [r0] - bl sub_81A5718 -_0804B67C: - ldr r0, =0x0202427c - movs r1, 0 - strb r1, [r0] - ldr r0, =0x02024064 - strb r1, [r0] - ldr r1, =0x02024083 - movs r0, 0xB - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_804B664 - - thumb_func_start atk3E_end2 -atk3E_end2: @ 804B6A4 - ldr r1, =0x02024064 - movs r0, 0 - strb r0, [r1] - ldr r1, =0x02024083 - movs r0, 0xB - strb r0, [r1] - bx lr - .pool - thumb_func_end atk3E_end2 - - thumb_func_start atk3F_end3 -atk3F_end3: @ 804B6BC - push {lr} - bl b_movescr_stack_pop_cursor - ldr r3, =0x020244a8 - ldr r0, [r3] - ldr r0, [r0, 0xC] - adds r1, r0, 0 - adds r1, 0x20 - ldrb r0, [r1] - cmp r0, 0 - beq _0804B6D6 - subs r0, 0x1 - strb r0, [r1] -_0804B6D6: - ldr r2, =0x03005d04 - ldr r0, [r3] - ldr r1, [r0, 0xC] - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - lsls r0, 2 - adds r1, r0 - ldr r0, [r1] - str r0, [r2] - pop {r0} - bx r0 - .pool - thumb_func_end atk3F_end3 - - thumb_func_start atk41_call -atk41_call: @ 804B6F8 - push {r4,lr} - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x5 - bl b_movescr_stack_push - ldr r2, [r4] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk41_call - - thumb_func_start atk42_jumpiftype2 -atk42_jumpiftype2: @ 804B728 - push {r4,lr} - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - lsls r0, 24 - lsrs r0, 24 - ldr r3, [r4] - ldr r2, =0x02024084 - movs r1, 0x58 - muls r0, r1 - adds r0, r2 - adds r1, r0, 0 - adds r1, 0x21 - ldrb r2, [r3, 0x2] - ldrb r1, [r1] - cmp r2, r1 - beq _0804B756 - adds r0, 0x22 - ldrb r0, [r0] - cmp r2, r0 - bne _0804B778 -_0804B756: - ldrb r1, [r3, 0x3] - ldrb r0, [r3, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _0804B77C - .pool -_0804B778: - adds r0, r3, 0x7 - str r0, [r4] -_0804B77C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end atk42_jumpiftype2 - - thumb_func_start sub_804B784 -sub_804B784: @ 804B784 - push {r4,lr} - sub sp, 0x4 - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r2, [r0, 0x1] - movs r0, 0 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _0804B7C0 - ldr r2, [r4] - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _0804B7C6 - .pool -_0804B7C0: - ldr r0, [r4] - adds r0, 0x6 - str r0, [r4] -_0804B7C6: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_804B784 - - thumb_func_start sub_804B7D0 -sub_804B7D0: @ 804B7D0 - ldr r0, =0x0202420b - ldrb r0, [r0] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - adds r0, 0x54 - movs r1, 0x1 - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_804B7D0 - - thumb_func_start atk46_cmd46 -atk46_cmd46: @ 804B7EC - push {r4-r6,lr} - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r6, =0x02024064 - strb r0, [r6] - ldr r2, [r5] - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x4] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 24 - adds r3, r1, r0 - ldrb r4, [r2, 0x2] - adds r0, r4, 0 - cmp r0, 0x1 - beq _0804B822 - cmp r0, 0x11 - beq _0804B822 - cmp r0, 0x2 - bne _0804B848 -_0804B822: - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r1, [r0, 0x2] - ldrh r2, [r3] - movs r0, 0 - bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r4] - adds r0, 0x7 - str r0, [r4] - b _0804B8AA - .pool -_0804B848: - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0804B868 - adds r0, r2, 0x7 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DABB9 - b _0804B8A8 - .pool -_0804B868: - adds r0, r4, 0 - subs r0, 0xA - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _0804B894 - ldr r1, =0x020242ac - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x000400c0 - ands r0, r1 - cmp r0, 0 - beq _0804B894 - adds r0, r2, 0x7 - b _0804B8A8 - .pool -_0804B894: - ldrb r1, [r2, 0x2] - ldrh r2, [r3] - movs r0, 0 - bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim - ldrb r0, [r6] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r5] - adds r0, 0x7 -_0804B8A8: - str r0, [r5] -_0804B8AA: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end atk46_cmd46 - - thumb_func_start sub_804B8B0 -sub_804B8B0: @ 804B8B0 - push {r4-r7,lr} - ldr r6, =0x02024214 - ldr r0, [r6] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r7, =0x02024064 - strb r0, [r7] - ldr r2, [r6] - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - adds r3, r1, r0 - ldrb r1, [r2, 0x6] - ldrb r0, [r2, 0x7] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x9] - lsls r0, 24 - adds r4, r1, r0 - ldrb r5, [r3] - adds r0, r5, 0 - cmp r0, 0x1 - beq _0804B8FA - cmp r0, 0x11 - beq _0804B8FA - cmp r0, 0x2 - bne _0804B920 -_0804B8FA: - ldrb r1, [r3] - ldrh r2, [r4] - movs r0, 0 - bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0xA - str r0, [r1] - b _0804B976 - .pool -_0804B920: - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0804B934 - adds r0, r2, 0 - b _0804B972 - .pool -_0804B934: - adds r0, r5, 0 - subs r0, 0xA - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _0804B960 - ldr r1, =0x020242ac - ldrb r0, [r7] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x000400c0 - ands r0, r1 - cmp r0, 0 - beq _0804B960 - adds r0, r2, 0 - b _0804B972 - .pool -_0804B960: - ldrb r1, [r3] - ldrh r2, [r4] - movs r0, 0 - bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim - ldrb r0, [r7] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r6] -_0804B972: - adds r0, 0xA - str r0, [r6] -_0804B976: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_804B8B0 - - thumb_func_start sub_804B97C -sub_804B97C: @ 804B97C - push {r4,lr} - movs r3, 0 - ldr r1, =0x02024474 - ldrb r0, [r1, 0x1A] - movs r2, 0xF0 - ands r2, r0 - adds r4, r1, 0 - cmp r2, 0x20 - beq _0804B9AA - cmp r2, 0x20 - bgt _0804B99C - cmp r2, 0x10 - beq _0804B9A6 - b _0804B9B4 - .pool -_0804B99C: - cmp r2, 0x90 - beq _0804B9AE - cmp r2, 0xA0 - beq _0804B9B2 - b _0804B9B4 -_0804B9A6: - movs r3, 0xF - b _0804B9B4 -_0804B9AA: - movs r3, 0x27 - b _0804B9B4 -_0804B9AE: - movs r3, 0x16 - b _0804B9B4 -_0804B9B2: - movs r3, 0x2E -_0804B9B4: - ldrb r1, [r4, 0x1A] - movs r0, 0xF - ands r0, r1 - adds r0, r3, r0 - subs r0, 0x1 - movs r1, 0 - strb r0, [r4, 0x10] - strb r1, [r4, 0x11] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804B97C - - thumb_func_start atk48_playstatchangeanimation -atk48_playstatchangeanimation: @ 804B9D8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r7, 0 - movs r0, 0 - mov r8, r0 - movs r3, 0 - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - str r3, [sp] - bl get_battle_side_of_something - ldr r2, =0x02024064 - strb r0, [r2] - ldr r0, [r5] - ldrb r4, [r0, 0x2] - ldrb r1, [r0, 0x3] - movs r0, 0x1 - ands r0, r1 - ldr r3, [sp] - cmp r0, 0 - beq _0804BAEC - movs r0, 0x2 - ands r0, r1 - movs r1, 0x15 - cmp r0, 0 - beq _0804BA18 - movs r1, 0x2D -_0804BA18: - cmp r4, 0 - beq _0804BAC0 - movs r0, 0x1 - mov r10, r0 - ldr r0, =0x0202409c - mov r9, r0 - lsls r5, r1, 16 -_0804BA26: - adds r0, r4, 0 - mov r1, r10 - ands r0, r1 - cmp r0, 0 - beq _0804BAB2 - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r1, [r0, 0x3] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0804BA58 - ldr r0, =0x02024064 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r7, r0 - b _0804BAA0 - .pool -_0804BA58: - ldr r6, =0x02024064 - ldrb r0, [r6] - str r3, [sp] - bl battle_get_per_side_status - mov r1, r10 - ands r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02024294 - adds r0, r1 - ldrb r0, [r0, 0x4] - ldr r3, [sp] - cmp r0, 0 - bne _0804BAB2 - ldr r0, =0x02024084 - ldrb r2, [r6] - movs r1, 0x58 - muls r2, r1 - adds r0, r2, r0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1D - beq _0804BAB2 - cmp r0, 0x49 - beq _0804BAB2 - cmp r0, 0x33 - bne _0804BA96 - cmp r7, 0x6 - beq _0804BAB2 -_0804BA96: - cmp r0, 0x34 - bne _0804BA9E - cmp r7, 0x1 - beq _0804BAB2 -_0804BA9E: - adds r0, r7, r2 -_0804BAA0: - add r0, r9 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - ble _0804BAB2 - lsrs r0, r5, 16 - mov r8, r0 - adds r3, 0x1 -_0804BAB2: - lsrs r4, 1 - movs r1, 0x80 - lsls r1, 9 - adds r5, r1 - adds r7, 0x1 - cmp r4, 0 - bne _0804BA26 -_0804BAC0: - ldr r0, =0x02024214 - mov r9, r0 - cmp r3, 0x1 - ble _0804BB4E - ldr r0, [r0] - ldrb r1, [r0, 0x3] - movs r0, 0x2 - ands r0, r1 - movs r1, 0x39 - mov r8, r1 - cmp r0, 0 - beq _0804BB4E - movs r0, 0x3A - b _0804BB4C - .pool -_0804BAEC: - movs r0, 0x2 - ands r0, r1 - movs r1, 0xE - cmp r0, 0 - beq _0804BAF8 - movs r1, 0x26 -_0804BAF8: - mov r9, r5 - cmp r4, 0 - beq _0804BB34 - ldr r6, =0x0202409c - adds r5, r2, 0 - lsls r2, r1, 16 -_0804BB04: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0804BB26 - ldrb r1, [r5] - movs r0, 0x58 - muls r0, r1 - adds r0, r7, r0 - adds r0, r6 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0xB - bgt _0804BB26 - lsrs r1, r2, 16 - mov r8, r1 - adds r3, 0x1 -_0804BB26: - lsrs r4, 1 - movs r0, 0x80 - lsls r0, 9 - adds r2, r0 - adds r7, 0x1 - cmp r4, 0 - bne _0804BB04 -_0804BB34: - cmp r3, 0x1 - ble _0804BB4E - mov r1, r9 - ldr r0, [r1] - ldrb r1, [r0, 0x3] - movs r0, 0x2 - ands r0, r1 - movs r1, 0x37 - mov r8, r1 - cmp r0, 0 - beq _0804BB4E - movs r0, 0x38 -_0804BB4C: - mov r8, r0 -_0804BB4E: - mov r1, r9 - ldr r2, [r1] - ldrb r1, [r2, 0x3] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0804BB6C - cmp r3, 0x1 - bgt _0804BB6C - adds r0, r2, 0x4 - mov r1, r9 - b _0804BBBA - .pool -_0804BB6C: - cmp r3, 0 - beq _0804BBB4 - ldr r4, =0x02024474 - ldrb r0, [r4, 0x1B] - cmp r0, 0 - bne _0804BBB4 - movs r0, 0 - movs r1, 0x1 - mov r2, r8 - str r3, [sp] - bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r1, [r0, 0x3] - movs r0, 0x4 - ands r0, r1 - ldr r3, [sp] - cmp r0, 0 - beq _0804BBA4 - cmp r3, 0x1 - ble _0804BBA4 - movs r0, 0x1 - strb r0, [r4, 0x1B] -_0804BBA4: - ldr r1, =0x02024214 - b _0804BBB6 - .pool -_0804BBB4: - mov r1, r9 -_0804BBB6: - ldr r0, [r1] - adds r0, 0x4 -_0804BBBA: - str r0, [r1] - 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 atk48_playstatchangeanimation - - thumb_func_start sub_804BBCC -sub_804BBCC: @ 804BBCC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - movs r0, 0 - mov r10, r0 - ldr r2, =0x020241ec - ldrh r1, [r2] - ldr r0, =0x0000ffff - movs r3, 0 - str r3, [sp, 0x18] - cmp r1, r0 - beq _0804BBEE - ldrh r2, [r2] - str r2, [sp, 0x18] -_0804BBEE: - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r4, [r0, 0x1] - str r4, [sp, 0x10] - ldrb r0, [r0, 0x2] - str r0, [sp, 0x14] - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _0804BC34 - ldr r1, =0x02024404 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x7] - b _0804BC3E - .pool -_0804BC34: - ldrh r0, [r1, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r0, 24 -_0804BC3E: - str r0, [sp, 0x8] - ldr r1, =0x0202449c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, 0xC8 - ldr r1, [r1] - adds r0, r1, r0 - str r0, [sp, 0xC] - ldrb r0, [r1, 0x13] - cmp r0, 0 - beq _0804BCF0 - movs r5, 0x3F - ands r5, r0 - str r5, [sp, 0x4] - b _0804BD02 - .pool -_0804BC68: - ldr r4, =0x02024064 - strb r2, [r4] - movs r0, 0 - movs r1, 0x1 - bl dp01_build_cmdbuf_x33_a_33_33 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _0804C15A - .pool -_0804BC80: - ldr r4, =0x02024064 - strb r2, [r4] - movs r0, 0 - movs r1, 0 - bl dp01_build_cmdbuf_x33_a_33_33 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldrb r1, [r6] - lsls r1, 2 - adds r1, r5 - ldr r0, [r1] - ldr r2, =0xfffbff3f - ands r0, r2 - str r0, [r1] - b _0804C15A - .pool -_0804BCAC: - strb r2, [r7] - ldr r0, [r5] - orrs r0, r6 - str r0, [r5] - ldr r0, =0x02024474 - strb r4, [r0, 0x14] - bl sub_804AF30 - ldr r2, =gUnknown_082D86A8 - mov r0, r8 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - add r0, r9 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - bl b_movescr_stack_push - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB87D - bl _0804C5B8 - .pool -_0804BCF0: - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x2] - str r0, [sp, 0x4] -_0804BD02: - ldr r1, =0x02024474 - mov r12, r1 - b _0804BD1E - .pool -_0804BD14: - mov r2, r10 - cmp r2, 0 - beq _0804BD1E - bl _0804C5A4 -_0804BD1E: - mov r3, r12 - ldrb r0, [r3, 0x14] - cmp r0, 0x11 - bls _0804BD2A - bl _0804C570 -_0804BD2A: - lsls r0, 2 - ldr r1, =_0804BD38 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0804BD38: - .4byte _0804BD80 - .4byte _0804BE5C - .4byte _0804BF18 - .4byte _0804BF3C - .4byte _0804BF54 - .4byte _0804BF7C - .4byte _0804BFA0 - .4byte _0804C048 - .4byte _0804C0BE - .4byte _0804C0F4 - .4byte _0804C194 - .4byte _0804C088 - .4byte _0804C0A8 - .4byte _0804C1D8 - .4byte _0804C21C - .4byte _0804C3FC - .4byte _0804C4E4 - .4byte _0804C570 -_0804BD80: - ldr r6, =0x02024084 - ldr r5, =0x0202420c - ldrb r3, [r5] - movs r7, 0x58 - adds r2, r3, 0 - muls r2, r7 - adds r0, r6, 0 - adds r0, 0x50 - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 16 - ands r0, r1 - cmp r0, 0 - bne _0804BDA0 - b _0804C184 -_0804BDA0: - adds r0, r2, r6 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _0804BDAA - b _0804C184 -_0804BDAA: - ldr r0, =0x0202420b - ldrb r1, [r0] - cmp r1, r3 - bne _0804BDB4 - b _0804C184 -_0804BDB4: - adds r0, r1, 0 - bl battle_side_get_owner - adds r4, r0, 0 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _0804BDCC - b _0804C184 -_0804BDCC: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _0804BDDA - b _0804C184 -_0804BDDA: - ldr r2, =0x0202437c - ldrb r3, [r5] - lsls r0, r3, 2 - adds r0, r3 - lsls r1, r0, 2 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _0804BDFE - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _0804BDFE - b _0804C184 -_0804BDFE: - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _0804BE14 - b _0804C184 -_0804BE14: - adds r0, r3, 0 - muls r0, r7 - adds r1, r0, r6 - ldrb r2, [r1, 0x19] - movs r0, 0x19 - ldrsb r0, [r1, r0] - cmp r0, 0xB - ble _0804BE26 - b _0804C184 -_0804BE26: - adds r0, r2, 0x1 - strb r0, [r1, 0x19] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAE0D - str r0, [r1] - b _0804C0B8 - .pool -_0804BE5C: - ldr r4, =0x02024084 - ldr r6, =0x0202420c - ldrb r2, [r6] - movs r5, 0x58 - mov r12, r5 - mov r1, r12 - muls r1, r2 - adds r7, r4, 0 - adds r7, 0x4C - adds r5, r1, r7 - ldr r3, [r5] - movs r0, 0x20 - ands r0, r3 - cmp r0, 0 - bne _0804BE7C - b _0804C184 -_0804BE7C: - adds r0, r1, r4 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _0804BE86 - b _0804C184 -_0804BE86: - ldr r0, =0x0202420b - ldrb r0, [r0] - cmp r0, r2 - bne _0804BE90 - b _0804C184 -_0804BE90: - ldr r0, =0x0202437c - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 2 - adds r0, 0xC - adds r1, r0 - ldr r0, [r1] - cmp r0, 0 - bne _0804BEA4 - b _0804C184 -_0804BEA4: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _0804BEB2 - b _0804C184 -_0804BEB2: - ldr r0, [sp, 0x4] - cmp r0, 0xA - beq _0804BEBA - b _0804C184 -_0804BEBA: - movs r0, 0x21 - negs r0, r0 - ands r3, r0 - str r3, [r5] - ldr r4, =0x02024064 - ldrb r0, [r6] - strb r0, [r4] - ldrb r0, [r6] - mov r1, r12 - muls r1, r0 - adds r0, r1, 0 - adds r0, r7 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB282 - str r0, [r1] - movs r2, 0x1 - mov r10, r2 - b _0804C184 - .pool -_0804BF18: - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0 - str r0, [sp] - movs r0, 0x7 - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _0804BF32 - b _0804C184 -_0804BF32: - movs r3, 0x1 - mov r10, r3 - b _0804C184 - .pool -_0804BF3C: - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0 - str r0, [sp] - movs r0, 0x4 - movs r2, 0 - movs r3, 0 - bl ability_something - b _0804C0B2 - .pool -_0804BF54: - movs r0, 0 - str r0, [sp] - movs r0, 0x5 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _0804BF6C - b _0804C184 -_0804BF6C: - movs r5, 0x1 - mov r10, r5 - ldr r0, =0x02024474 - mov r12, r0 - b _0804C570 - .pool -_0804BF7C: - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0 - str r0, [sp] - movs r0, 0x8 - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _0804BF96 - b _0804C184 -_0804BF96: - movs r1, 0x1 - mov r10, r1 - b _0804C184 - .pool -_0804BFA0: - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 18 - ands r0, r1 - cmp r0, 0 - beq _0804BFE4 - ldr r2, [sp, 0x8] - cmp r2, 0x1D - bne _0804BFE4 - ldr r0, =0x020241ec - ldrh r2, [r0] - adds r3, r0, 0 - cmp r2, 0xA5 - beq _0804BFE4 - ldr r4, [sp, 0xC] - ldrh r1, [r4] - cmp r1, 0 - beq _0804BFCC - ldr r0, =0x0000ffff - cmp r1, r0 - bne _0804BFE4 -_0804BFCC: - cmp r2, 0xE2 - bne _0804BFDE - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _0804BFDE - b _0804C4B6 -_0804BFDE: - ldrh r0, [r3] - ldr r1, [sp, 0xC] - strh r0, [r1] -_0804BFE4: - movs r4, 0 - ldr r2, =0x02024084 - ldr r3, =0x0202420b - ldrb r1, [r3] - movs r0, 0x58 - muls r0, r1 - adds r2, 0xC - adds r0, r2 - ldrh r0, [r0] - ldr r5, [sp, 0xC] - ldrh r1, [r5] - mov r9, r3 - cmp r0, r1 - beq _0804C01C - mov r6, r9 - movs r3, 0x58 - adds r5, r1, 0 -_0804C006: - adds r4, 0x1 - cmp r4, 0x3 - bgt _0804C01C - lsls r0, r4, 1 - ldrb r1, [r6] - muls r1, r3 - adds r0, r1 - adds r0, r2 - ldrh r0, [r0] - cmp r0, r5 - bne _0804C006 -_0804C01C: - cmp r4, 0x4 - bne _0804C026 - movs r0, 0 - ldr r1, [sp, 0xC] - strh r0, [r1] -_0804C026: - mov r2, r12 - ldrb r0, [r2, 0x14] - adds r0, 0x1 - strb r0, [r2, 0x14] - b _0804C570 - .pool -_0804C048: - movs r4, 0 - ldr r0, =0x0202406c - ldrb r3, [r0] - cmp r4, r3 - blt _0804C054 - b _0804C202 -_0804C054: - ldr r7, =0x0202449c - movs r6, 0 - movs r3, 0xD0 - adds r5, r0, 0 - ldr r2, =0x02024084 -_0804C05E: - ldr r0, [r7] - adds r0, r3 - ldrh r1, [r0] - cmp r1, 0 - beq _0804C06C - strh r1, [r2, 0x2E] - strh r6, [r0] -_0804C06C: - adds r3, 0x2 - adds r2, 0x58 - adds r4, 0x1 - ldrb r0, [r5] - cmp r4, r0 - blt _0804C05E - b _0804C202 - .pool -_0804C088: - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl berry_effects_maybe - lsls r0, 24 - cmp r0, 0 - beq _0804C184 - movs r2, 0x1 - mov r10, r2 - ldr r3, =0x02024474 - mov r12, r3 - b _0804C570 - .pool -_0804C0A8: - movs r0, 0x4 - movs r1, 0 - movs r2, 0 - bl berry_effects_maybe -_0804C0B2: - lsls r0, 24 - cmp r0, 0 - beq _0804C184 -_0804C0B8: - movs r4, 0x1 - mov r10, r4 - b _0804C184 -_0804C0BE: - ldr r1, =0x020242ac - ldr r0, =0x0202420b - ldrb r2, [r0] - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x000400c0 - ands r0, r1 - cmp r0, 0 - bne _0804C0D4 - b _0804C4B6 -_0804C0D4: - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0804C0E2 - b _0804BC68 -_0804C0E2: - b _0804C4B6 - .pool -_0804C0F4: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _0804C120 - ldr r1, =0x020242ac - ldr r0, =0x0202420b - ldrb r2, [r0] - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x000400c0 - ands r0, r1 - cmp r0, 0 - beq _0804C120 - adds r0, r2, 0 - bl sub_803F90C - lsls r0, 24 - cmp r0, 0 - beq _0804C184 -_0804C120: - ldr r4, =0x02024064 - ldr r5, =0x0202420b - ldrb r0, [r5] - strb r0, [r4] - movs r0, 0 - movs r1, 0 - bl dp01_build_cmdbuf_x33_a_33_33 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, =0x020242ac - ldrb r2, [r5] - lsls r2, 2 - adds r2, r0 - ldr r0, [r2] - ldr r1, =0xfffbff3f - ands r0, r1 - str r0, [r2] - ldr r2, =0x0202437c - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_0804C15A: - ldr r1, =0x02024474 - ldrb r0, [r1, 0x14] - adds r0, 0x1 - strb r0, [r1, 0x14] - b _0804C5BA - .pool -_0804C184: - ldr r1, =0x02024474 - ldrb r0, [r1, 0x14] - adds r0, 0x1 - strb r0, [r1, 0x14] - mov r12, r1 - b _0804C570 - .pool -_0804C194: - ldr r0, =0x0202437c - ldr r6, =0x0202420c - ldrb r2, [r6] - lsls r3, r2, 2 - adds r1, r3, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 29 - cmp r0, 0 - blt _0804C202 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r2, r0 - bcs _0804C202 - ldr r5, =0x020242ac - adds r0, r3, r5 - ldr r0, [r0] - ldr r1, =0x000400c0 - ands r0, r1 - cmp r0, 0 - bne _0804C1C2 - b _0804BC80 -_0804C1C2: - b _0804C202 - .pool -_0804C1D8: - movs r4, 0 - ldr r0, =0x0202406c - ldrb r2, [r0] - cmp r4, r2 - bge _0804C202 - ldr r2, =0x020242bc - ldr r5, =0xfeffffff - adds r3, r0, 0 - ldr r1, =0x020240d4 -_0804C1EA: - ldrb r0, [r2, 0xA] - cmp r0, 0 - bne _0804C1F6 - ldr r0, [r1] - ands r0, r5 - str r0, [r1] -_0804C1F6: - adds r2, 0x1C - adds r1, 0x58 - adds r4, 0x1 - ldrb r0, [r3] - cmp r4, r0 - blt _0804C1EA -_0804C202: - mov r1, r12 - ldrb r0, [r1, 0x14] - adds r0, 0x1 - strb r0, [r1, 0x14] - b _0804C570 - .pool -_0804C21C: - ldr r1, =0x02024280 - ldr r3, [r1] - movs r0, 0x80 - lsls r0, 5 - ands r0, r3 - ldr r2, =0x0202420b - mov r9, r2 - adds r5, r1, 0 - cmp r0, 0 - beq _0804C246 - ldr r0, =0x02024064 - ldrb r2, [r2] - strb r2, [r0] - ldr r1, =0x0202420c - ldrb r0, [r1] - mov r4, r9 - strb r0, [r4] - strb r2, [r1] - ldr r0, =0xffffefff - ands r3, r0 - str r3, [r5] -_0804C246: - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 3 - ands r0, r1 - cmp r0, 0 - beq _0804C262 - ldr r0, =0x02024240 - mov r2, r9 - ldrb r1, [r2] - lsls r1, 1 - adds r1, r0 - ldr r0, =0x020241ec - ldrh r0, [r0] - strh r0, [r1] -_0804C262: - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - mov r3, r9 - ldrb r4, [r3] - lsls r0, r4, 2 - adds r0, r2 - ldr r3, [r0] - ands r1, r3 - adds r6, r2, 0 - cmp r1, 0 - beq _0804C27C - b _0804C3E8 -_0804C27C: - ldr r0, =0x0202449c - ldr r1, [r0] - adds r1, 0x91 - ldrb r1, [r1] - ands r1, r3 - adds r7, r0, 0 - cmp r1, 0 - beq _0804C28E - b _0804C3E8 -_0804C28E: - ldr r0, =gBattleMoves - ldr r2, [sp, 0x18] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r1, [r1] - mov r8, r0 - cmp r1, 0x7F - bne _0804C2A4 - b _0804C3E8 -_0804C2A4: - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 18 - ands r0, r1 - cmp r0, 0 - beq _0804C308 - ldr r0, =0x02024248 - lsls r1, r4, 1 - adds r1, r0 - ldr r0, =0x020241ec - ldrh r0, [r0] - strh r0, [r1] - ldr r0, =0x02024260 - mov r3, r9 - ldrb r1, [r3] - lsls r1, 1 - adds r1, r0 - ldr r0, =0x020241ea - ldrh r0, [r0] - strh r0, [r1] - b _0804C322 - .pool -_0804C308: - ldr r1, =0x02024248 - lsls r0, r4, 1 - adds r0, r1 - ldr r1, =0x0000ffff - strh r1, [r0] - ldr r1, =0x02024260 - mov r4, r9 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - movs r1, 0x1 - negs r1, r1 - strh r1, [r0] -_0804C322: - ldr r2, =0x0202420c - ldrb r3, [r2] - lsls r0, r3, 2 - adds r0, r6 - ldr r0, [r0] - lsls r0, 28 - ldr r1, [r5] - ands r1, r0 - cmp r1, 0 - bne _0804C340 - ldr r0, =0x02024270 - adds r0, r3, r0 - mov r3, r9 - ldrb r1, [r3] - strb r1, [r0] -_0804C340: - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 18 - ands r0, r1 - cmp r0, 0 - beq _0804C3DC - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _0804C3DC - ldr r0, =0x020241ec - ldrh r3, [r0] - ldr r0, =0x0000ffff - cmp r3, r0 - bne _0804C390 - ldr r1, =0x02024250 - ldrb r0, [r2] - lsls r0, 1 - adds r0, r1 - strh r3, [r0] - b _0804C3E8 - .pool -_0804C390: - ldr r0, =0x02024250 - ldrb r1, [r2] - lsls r1, 1 - adds r1, r0 - ldr r4, =0x020241ea - ldrh r0, [r4] - strh r0, [r1] - ldr r0, [r7] - ldrb r3, [r0, 0x13] - cmp r3, 0 - beq _0804C3C0 - ldr r0, =0x02024258 - ldrb r1, [r2] - lsls r1, 1 - adds r1, r0 - movs r0, 0x3F - ands r0, r3 - b _0804C3E6 - .pool -_0804C3C0: - ldr r0, =0x02024258 - ldrb r2, [r2] - lsls r2, 1 - adds r2, r0 - ldrh r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldrb r0, [r0, 0x2] - strh r0, [r2] - b _0804C3E8 - .pool -_0804C3DC: - ldr r0, =0x02024250 - ldrb r1, [r2] - lsls r1, 1 - adds r1, r0 - ldr r0, =0x0000ffff -_0804C3E6: - strh r0, [r1] -_0804C3E8: - mov r4, r12 - ldrb r0, [r4, 0x14] - adds r0, 0x1 - strb r0, [r4, 0x14] - b _0804C570 - .pool -_0804C3FC: - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r7, =gUnknown_0832A328 - ldr r2, =0x0202420b - ldrb r3, [r2] - lsls r0, r3, 2 - adds r0, r7 - ldr r4, [r0] - ands r1, r4 - mov r9, r2 - cmp r1, 0 - bne _0804C4B6 - ldr r6, =0x0202449c - ldr r5, [r6] - adds r0, r5, 0 - adds r0, 0x91 - ldrb r0, [r0] - ands r0, r4 - cmp r0, 0 - bne _0804C4B6 - ldr r1, =gBattleMoves - ldr r2, [sp, 0x18] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0804C4B6 - ldr r0, =0x02024280 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 18 - ands r0, r1 - cmp r0, 0 - beq _0804C4B6 - ldr r4, =0x0202420c - ldrb r0, [r4] - cmp r3, r0 - beq _0804C4B6 - ldrb r2, [r4] - lsls r0, r2, 2 - adds r0, r7 - ldr r0, [r0] - lsls r0, 28 - ands r1, r0 - cmp r1, 0 - bne _0804C4B6 - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _0804C4B6 - lsls r1, r2, 1 - adds r1, r5 - adds r1, 0x98 - ldr r3, =0x020241ec - ldrh r0, [r3] - strb r0, [r1] - ldrb r1, [r4] - ldr r0, [r6] - lsls r1, 1 - adds r1, r0 - adds r1, 0x99 - ldrh r0, [r3] - lsrs r0, 8 - strb r0, [r1] - ldrb r0, [r4] - mov r2, r9 - ldrb r1, [r2] - ldr r2, [r6] - lsls r0, 3 - lsls r1, 1 - adds r0, r1 - adds r0, r2 - adds r0, 0xE0 - ldrh r1, [r3] - strb r1, [r0] - ldrb r1, [r4] - mov r4, r9 - ldrb r0, [r4] - ldr r2, [r6] - lsls r1, 3 - lsls r0, 1 - adds r1, r0 - adds r1, r2 - adds r1, 0xE1 - ldrh r0, [r3] - lsrs r0, 8 - strb r0, [r1] -_0804C4B6: - mov r5, r12 - ldrb r0, [r5, 0x14] - adds r0, 0x1 - strb r0, [r5, 0x14] - b _0804C570 - .pool -_0804C4E4: - ldr r5, =0x02024280 - ldr r2, [r5] - movs r0, 0x80 - lsls r0, 12 - ands r0, r2 - cmp r0, 0 - bne _0804C568 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0804C568 - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x1] - lsls r0, 29 - cmp r0, 0 - blt _0804C568 - ldr r0, =gBattleMoves - mov r9, r0 - ldr r1, =0x020241ea - mov r8, r1 - ldrh r0, [r1] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - add r1, r9 - ldrb r0, [r1, 0x6] - cmp r0, 0x8 - bne _0804C568 - movs r6, 0x80 - lsls r6, 2 - adds r4, r6, 0 - ands r4, r2 - cmp r4, 0 - bne _0804C568 - ldr r7, =0x0202420c - ldrb r0, [r7] - bl battle_get_per_side_status - movs r1, 0x2 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _0804C55E - bl _0804BCAC -_0804C55E: - ldr r0, [r5] - orrs r0, r6 - str r0, [r5] - ldr r2, =0x02024474 - mov r12, r2 -_0804C568: - mov r3, r12 - ldrb r0, [r3, 0x14] - adds r0, 0x1 - strb r0, [r3, 0x14] -_0804C570: - ldr r4, [sp, 0x10] - cmp r4, 0x1 - bne _0804C582 - mov r5, r10 - cmp r5, 0 - bne _0804C582 - movs r0, 0x11 - mov r1, r12 - strb r0, [r1, 0x14] -_0804C582: - ldr r2, [sp, 0x10] - cmp r2, 0x2 - bne _0804C598 - ldr r4, [sp, 0x14] - mov r3, r12 - ldrb r3, [r3, 0x14] - cmp r4, r3 - bne _0804C598 - movs r0, 0x11 - mov r4, r12 - strb r0, [r4, 0x14] -_0804C598: - mov r5, r12 - ldrb r0, [r5, 0x14] - cmp r0, 0x11 - beq _0804C5A4 - bl _0804BD14 -_0804C5A4: - mov r1, r12 - ldrb r0, [r1, 0x14] - cmp r0, 0x11 - bne _0804C5BA - mov r2, r10 - cmp r2, 0 - bne _0804C5BA - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x3 -_0804C5B8: - str r0, [r1] -_0804C5BA: - 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_804BBCC - - thumb_func_start atk4A_damagecalc2 -atk4A_damagecalc2: @ 804C5F4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r4, 0 - movs r5, 0 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x2] - mov r8, r0 - ldr r2, =0x02024084 - ldr r3, =0x0202420c - ldrb r1, [r3] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x20 - ldrb r0, [r0] - mov r12, r2 - adds r7, r3, 0 - cmp r0, 0x1A - bne _0804C688 - mov r1, r8 - cmp r1, 0x4 - bne _0804C688 - ldr r3, =0x0202420a - strb r0, [r3] - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x9 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024250 - ldrb r0, [r7] - lsls r0, 1 - adds r0, r1 - strh r4, [r0] - ldr r0, =0x02024332 - mov r2, r8 - strb r2, [r0, 0x6] - ldrb r0, [r7] - ldrb r1, [r3] - bl b_history__record_ability_usage_of_player - b _0804C76A - .pool -_0804C678: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0] - b _0804C76A - .pool -_0804C688: - ldr r1, =gUnknown_0831ACE8 - adds r0, r5, r1 - ldrb r0, [r0] - adds r6, r1, 0 - b _0804C74A - .pool -_0804C698: - adds r0, r5, r6 - ldrb r0, [r0] - cmp r0, r8 - bne _0804C744 - adds r2, r5, 0x1 - adds r3, r2, r6 - ldrb r1, [r7] - movs r0, 0x58 - muls r0, r1 - add r0, r12 - adds r0, 0x21 - ldrb r1, [r3] - adds r3, r2, 0 - ldrb r0, [r0] - cmp r1, r0 - bne _0804C6D6 - adds r0, r5, 0x2 - adds r0, r6 - ldrb r1, [r0] - cmp r1, 0 - beq _0804C678 - cmp r1, 0x5 - bne _0804C6CA - movs r0, 0x4 - orrs r4, r0 -_0804C6CA: - cmp r1, 0x14 - bne _0804C6D6 - movs r0, 0x2 - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_0804C6D6: - adds r2, r3, r6 - ldrb r1, [r7] - movs r0, 0x58 - muls r0, r1 - add r0, r12 - adds r1, r0, 0 - adds r1, 0x22 - ldrb r2, [r2] - ldrb r1, [r1] - cmp r2, r1 - bne _0804C744 - adds r0, 0x21 - ldrb r1, [r0] - cmp r1, r2 - beq _0804C6FE - adds r0, r5, 0x2 - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0 - beq _0804C678 -_0804C6FE: - cmp r1, r2 - beq _0804C714 - adds r0, r5, 0x2 - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0x5 - bne _0804C714 - movs r0, 0x4 - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_0804C714: - adds r2, r3, r6 - ldrb r1, [r7] - movs r0, 0x58 - muls r0, r1 - add r0, r12 - adds r1, r0, 0 - adds r1, 0x22 - ldrb r2, [r2] - ldrb r1, [r1] - cmp r2, r1 - bne _0804C744 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, r2 - beq _0804C744 - adds r0, r5, 0x2 - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0x14 - bne _0804C744 - movs r0, 0x2 - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_0804C744: - adds r5, 0x3 - adds r0, r5, r6 - ldrb r0, [r0] -_0804C74A: - cmp r0, 0xFF - beq _0804C76A - cmp r0, 0xFE - bne _0804C698 - ldrb r1, [r7] - movs r0, 0x58 - muls r0, r1 - mov r1, r12 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 22 - ands r0, r1 - cmp r0, 0 - beq _0804C744 -_0804C76A: - ldr r2, =0x02024084 - ldr r0, =0x0202420c - mov r8, r0 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x20 - ldrb r6, [r0] - cmp r6, 0x19 - bne _0804C7E6 - movs r5, 0x29 - ands r5, r4 - cmp r5, 0 - bne _0804C7E6 - ldr r0, =0x0202420b - ldrb r0, [r0] - ldr r7, =0x020241ea - ldrh r1, [r7] - bl move_weather_interaction - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x2 - bne _0804C7E6 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _0804C7AC - movs r0, 0x6 - ands r4, r0 - cmp r4, 0x6 - bne _0804C7E6 -_0804C7AC: - ldr r2, =gBattleMoves - ldrh r1, [r7] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - beq _0804C7E6 - ldr r3, =0x0202420a - strb r6, [r3] - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024250 - mov r2, r8 - ldrb r0, [r2] - lsls r0, 1 - adds r0, r1 - strh r5, [r0] - ldr r1, =0x02024332 - movs r0, 0x3 - strb r0, [r1, 0x6] - ldrb r0, [r2] - ldrb r1, [r3] - bl b_history__record_ability_usage_of_player -_0804C7E6: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0804C804 - ldr r2, =0x0202433c - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r1, 4 - adds r1, r2 - ldrb r0, [r1, 0x1] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r1, 0x1] -_0804C804: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk4A_damagecalc2 - - thumb_func_start atk4B_cmd4b -atk4B_cmd4b: @ 804C844 - push {r4,lr} - ldr r4, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r4] - ldr r2, =0x02024280 - ldr r1, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - lsls r1, 28 - ldr r0, [r2] - ands r0, r1 - cmp r0, 0 - bne _0804C872 - movs r0, 0 - movs r1, 0 - bl dp01_build_cmdbuf_x06_a - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0804C872: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk4B_cmd4b - - thumb_func_start atk4C_switch1 -atk4C_switch1: @ 804C894 - push {r4,r5,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0804C8E4 - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - ldr r3, =0x0202406e - ldrb r0, [r4] - lsls r2, r0, 1 - adds r2, r3 - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - adds r0, 0x5C - ldrb r0, [r0] - strh r0, [r2] - ldr r1, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0] - movs r0, 0 - movs r1, 0 - bl dp01_build_cmdbuf_x00_a_b_0 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r5] - adds r0, 0x2 - str r0, [r5] -_0804C8E4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk4C_switch1 - - thumb_func_start sub_804C904 -sub_804C904: @ 804C904 - push {r4-r7,lr} - sub sp, 0x58 - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _0804C912 - b _0804CAA4 -_0804C912: - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - ldr r6, =0x02024084 - ldrb r0, [r4] - movs r5, 0x58 - adds r1, r0, 0 - muls r1, r5 - adds r1, r6 - mov r0, sp - movs r2, 0x58 - bl memcpy - ldrb r0, [r4] - muls r0, r5 - adds r3, r0, r6 - movs r2, 0 - ldr r5, =0x02023864 -_0804C93E: - adds r0, r3, r2 - ldrb r1, [r4] - lsls r1, 9 - adds r1, 0x4 - adds r1, r2, r1 - adds r1, r5 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x57 - bls _0804C93E - ldr r4, =0x02024084 - ldr r6, =0x02024064 - ldrb r0, [r6] - movs r7, 0x58 - adds r2, r0, 0 - muls r2, r7 - adds r2, r4 - ldr r3, =gBaseStats - ldrh r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x6] - adds r2, 0x21 - strb r0, [r2] - ldrb r0, [r6] - adds r1, r0, 0 - muls r1, r7 - adds r1, r4 - ldrh r2, [r1] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x7] - adds r1, 0x22 - strb r0, [r1] - ldrb r0, [r6] - adds r1, r0, 0 - muls r1, r7 - adds r1, r4 - ldrh r0, [r1] - ldrb r1, [r1, 0x17] - lsrs r1, 7 - bl sub_806B694 - ldrb r1, [r6] - muls r1, r7 - adds r1, r4 - adds r1, 0x20 - strb r0, [r1] - ldrb r0, [r6] - bl battle_side_get_owner - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x020243d0 - adds r0, 0x29 - adds r0, r2, r0 - ldrb r1, [r0] - ldr r3, =gUnknown_0832A328 - ldr r2, =0x0202406e - ldrb r5, [r6] - lsls r0, r5, 1 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - ands r1, r0 - mov r12, r4 - cmp r1, 0 - beq _0804C9DE - adds r0, r5, 0 - muls r0, r7 - add r0, r12 - movs r1, 0 - strh r1, [r0, 0x2E] -_0804C9DE: - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x7F - bne _0804CA26 - movs r2, 0 - adds r4, r6, 0 - movs r6, 0x58 - mov r5, r12 - adds r5, 0x18 - add r3, sp, 0x18 -_0804C9FE: - ldrb r0, [r4] - adds r1, r0, 0 - muls r1, r6 - adds r1, r2, r1 - adds r1, r5 - adds r0, r3, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r2, 0x1 - cmp r2, 0x7 - ble _0804C9FE - ldr r0, =0x02024064 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - mov r1, r12 - adds r1, 0x50 - adds r0, r1 - ldr r1, [sp, 0x50] - str r1, [r0] -_0804CA26: - bl sub_803A284 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _0804CA78 - ldr r4, =0x02024084 - ldr r0, =0x02024064 - ldrb r3, [r0] - movs r0, 0x58 - adds r2, r3, 0 - muls r2, r0 - adds r1, r2, r4 - ldrh r0, [r1, 0x2C] - lsrs r0, 1 - ldrh r1, [r1, 0x28] - cmp r0, r1 - bcc _0804CA78 - cmp r1, 0 - beq _0804CA78 - adds r0, r4, 0 - adds r0, 0x4C - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0804CA78 - ldr r0, =0x0202449c - ldr r2, [r0] - adds r2, 0x92 - ldr r1, =gUnknown_0832A328 - lsls r0, r3, 2 - adds r0, r1 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] -_0804CA78: - ldr r0, =0x02024474 - ldr r3, =0x02024064 - ldrb r2, [r3] - strb r2, [r0, 0x17] - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x7 - strb r0, [r1, 0x1] - strb r2, [r1, 0x2] - ldr r2, =0x0202406e - ldrb r0, [r3] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] -_0804CAA4: - add sp, 0x58 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804C904 - - thumb_func_start atk4E_switch3 -atk4E_switch3: @ 804CAE8 - push {r4-r6,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0804CB86 - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r6, =0x02024064 - strb r0, [r6] - ldrb r0, [r6] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0804CB3E - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x063f0902 - ands r0, r1 - cmp r0, 0 - bne _0804CB3E - ldr r4, =0x02024084 - ldrb r0, [r6] - movs r5, 0x58 - muls r0, r5 - adds r0, r4 - ldrh r0, [r0] - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r6] - muls r1, r5 - adds r4, 0x48 - adds r1, r4 - ldr r2, [r1] - movs r1, 0x2 - bl SetPokedexFlag -_0804CB3E: - ldr r2, =0x02024210 - ldr r1, =gUnknown_0832A328 - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldrb r0, [r2] - bics r0, r1 - strb r0, [r2] - ldr r1, =0x0202406e - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrb r1, [r0] - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r2, [r0, 0x2] - movs r0, 0 - bl dp01_build_cmdbuf_x05_a_b_c - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r4] - adds r0, 0x3 - str r0, [r4] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _0804CB86 - bl sub_81A56B4 -_0804CB86: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atk4E_switch3 - - thumb_func_start atk4F_jumpifcannotswitch -atk4F_jumpifcannotswitch: @ 804CBB0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r1, [r0, 0x1] - movs r0, 0x7F - ands r0, r1 - bl get_battle_side_of_something - ldr r3, =0x02024064 - strb r0, [r3] - ldr r2, [r4] - ldrb r1, [r2, 0x1] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0804CC28 - ldr r1, =0x02024084 - ldrb r3, [r3] - movs r0, 0x58 - muls r0, r3 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x0400e000 - ands r0, r1 - cmp r0, 0 - bne _0804CBFC - ldr r1, =0x020242ac - lsls r0, r3, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 3 - ands r0, r1 - cmp r0, 0 - beq _0804CC28 -_0804CBFC: - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _0804CF00 - .pool -_0804CC28: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 15 - ands r0, r1 - cmp r0, 0 - beq _0804CCC0 - ldr r5, =0x02024064 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020244ec - mov r8, r1 - cmp r0, 0x1 - bne _0804CC4E - ldr r0, =0x02024744 - mov r8, r0 -_0804CC4E: - movs r4, 0 - ldrb r1, [r5] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0804CC5C - movs r4, 0x3 -_0804CC5C: - adds r6, r4, 0x3 - cmp r4, r6 - bge _0804CCA4 - ldr r7, =0x0202406e -_0804CC64: - movs r0, 0x64 - muls r0, r4 - mov r1, r8 - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _0804CC9E - adds r0, r5, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0804CC9E - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _0804CC9E - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - cmp r0, r4 - bne _0804CCA4 -_0804CC9E: - adds r4, 0x1 - cmp r4, r6 - blt _0804CC64 -_0804CCA4: - cmp r4, r6 - bne _0804CCAA - b _0804CED0 -_0804CCAA: - b _0804CEF8 - .pool -_0804CCC0: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0804CD8C - movs r0, 0x80 - lsls r0, 16 - ands r1, r0 - cmp r1, 0 - beq _0804CD00 - ldr r5, =0x02024064 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0804CCEC - ldr r0, =0x020244ec - b _0804CD16 - .pool -_0804CCEC: - ldr r1, =0x02024744 - mov r8, r1 - ldrb r0, [r5] - movs r4, 0x3 - cmp r0, 0x1 - bne _0804CD32 - movs r4, 0 - b _0804CD32 - .pool -_0804CD00: - ldr r5, =0x02024064 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020244ec - mov r8, r1 - cmp r0, 0x1 - bne _0804CD18 - ldr r0, =0x02024744 -_0804CD16: - mov r8, r0 -_0804CD18: - movs r4, 0 - ldrb r0, [r5] - bl sub_806D864 - lsls r0, 24 - lsrs r0, 24 - bl sub_806D82C - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _0804CD32 - movs r4, 0x3 -_0804CD32: - adds r6, r4, 0x3 - cmp r4, r6 - bge _0804CCA4 - ldr r7, =0x0202406e -_0804CD3A: - movs r0, 0x64 - muls r0, r4 - mov r1, r8 - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _0804CD74 - adds r0, r5, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0804CD74 - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _0804CD74 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - cmp r0, r4 - bne _0804CCA4 -_0804CD74: - adds r4, 0x1 - cmp r4, r6 - blt _0804CD3A - b _0804CCA4 - .pool -_0804CD8C: - movs r0, 0x80 - lsls r0, 8 - ands r1, r0 - cmp r1, 0 - beq _0804CE10 - ldr r5, =0x02024064 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0804CE10 - ldr r0, =0x02024744 - mov r8, r0 - movs r4, 0 - ldrb r0, [r5] - cmp r0, 0x3 - bne _0804CDB4 - movs r4, 0x3 -_0804CDB4: - adds r6, r4, 0x3 - cmp r4, r6 - blt _0804CDBC - b _0804CCA4 -_0804CDBC: - ldr r7, =0x0202406e -_0804CDBE: - movs r0, 0x64 - muls r0, r4 - mov r1, r8 - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _0804CDFA - adds r0, r5, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0804CDFA - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _0804CDFA - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - cmp r0, r4 - beq _0804CDFA - b _0804CCA4 -_0804CDFA: - adds r4, 0x1 - cmp r4, r6 - blt _0804CDBE - b _0804CCA4 - .pool -_0804CE10: - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bne _0804CE54 - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02022fec - ldr r0, [r0] - ands r0, r4 - cmp r0, 0 - beq _0804CE48 - movs r0, 0x3 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r6, r0, 24 - b _0804CE4A - .pool -_0804CE48: - adds r6, r7, 0 -_0804CE4A: - ldr r0, =0x02024744 - mov r8, r0 - b _0804CE82 - .pool -_0804CE54: - movs r0, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0804CE7C - movs r0, 0x2 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r6, r0, 24 - b _0804CE7E - .pool -_0804CE7C: - adds r6, r7, 0 -_0804CE7E: - ldr r1, =0x020244ec - mov r8, r1 -_0804CE82: - movs r4, 0 -_0804CE84: - movs r0, 0x64 - muls r0, r4 - mov r1, r8 - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _0804CEC6 - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _0804CEC6 - adds r0, r5, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0804CEC6 - ldr r1, =0x0202406e - lsls r0, r7, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r4, r0 - beq _0804CEC6 - lsls r0, r6, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r4, r0 - bne _0804CECC -_0804CEC6: - adds r4, 0x1 - cmp r4, 0x5 - ble _0804CE84 -_0804CECC: - cmp r4, 0x6 - bne _0804CEF8 -_0804CED0: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0804CF00 - .pool -_0804CEF8: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x6 - str r0, [r1] -_0804CF00: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk4F_jumpifcannotswitch - - thumb_func_start sub_804CF10 -sub_804CF10: @ 804CF10 - push {r4,r5,lr} - sub sp, 0x4 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r5, =0x02024064 - ldrb r0, [r5] - ldr r4, =0x0202449c - ldr r1, [r4] - adds r1, r0, r1 - adds r1, 0x58 - ldr r3, =0x0202406e - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - strb r0, [r1] - ldrb r0, [r5] - ldr r1, [r4] - adds r0, r1 - adds r0, 0x5C - movs r1, 0x6 - strb r1, [r0] - ldr r1, [r4] - adds r1, 0x93 - ldr r3, =gUnknown_0832A328 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r3 - ldr r3, [r0] - ldrb r0, [r1] - bics r0, r3 - strb r0, [r1] - ldrb r0, [r5] - lsls r1, r0, 1 - adds r1, r0 - adds r1, 0x60 - ldr r0, [r4] - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804CF10 - - thumb_func_start atk50_openpartyscreen -atk50_openpartyscreen: @ 804CF88 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - movs r7, 0 - movs r0, 0 - mov r9, r0 - ldr r6, =0x02024214 - ldr r2, [r6] - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - mov r8, r1 - ldrb r1, [r2, 0x1] - adds r0, r1, 0 - mov r12, r6 - cmp r0, 0x5 - beq _0804CFBE - b _0804D464 -_0804CFBE: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x41 - ands r1, r0 - cmp r1, 0x1 - beq _0804D0B0 - ldr r1, =0x02024064 - strb r7, [r1] - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r7, r0 - bcc _0804CFD8 - b _0804D450 -_0804CFD8: - ldr r7, =0x02024280 - ldr r6, =gUnknown_0832A328 - adds r4, r1, 0 - ldr r2, =0x02024210 - mov r8, r2 -_0804CFE2: - ldrb r2, [r4] - lsls r0, r2, 2 - adds r0, r6 - ldr r1, [r0] - lsls r1, 28 - ldr r0, [r7] - ands r0, r1 - cmp r0, 0 - beq _0804D088 - adds r0, r2, 0 - movs r1, 0x6 - movs r2, 0x6 - bl sub_80423F4 - lsls r0, 24 - cmp r0, 0 - beq _0804D054 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - mov r2, r8 - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldrb r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r1, [r0] - lsls r1, 28 - ldr r0, [r7] - bics r0, r1 - str r0, [r7] - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - bl sub_8034464 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _0804D098 - .pool -_0804D054: - ldr r5, =0x0202437c - ldrb r0, [r4] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - blt _0804D098 - movs r0, 0x6 - bl sub_804CF10 - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - b _0804D098 - .pool -_0804D088: - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - bl sub_8034464 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0804D098: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0804CFE2 - b _0804D450 - .pool -_0804D0B0: - ands r0, r1 - cmp r0, 0 - bne _0804D0B8 - b _0804D450 -_0804D0B8: - ldr r0, =0x02024280 - mov r8, r0 - ldr r0, [r0] - lsrs r5, r0, 28 - ldr r6, =gUnknown_0832A328 - ldr r0, [r6] - ands r0, r5 - cmp r0, 0 - beq _0804D170 - ldr r4, =0x02024064 - strb r7, [r4] - movs r0, 0 - movs r1, 0x6 - movs r2, 0x6 - bl sub_80423F4 - lsls r0, 24 - cmp r0, 0 - beq _0804D120 - ldr r2, =0x02024210 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldrb r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r1, [r0] - lsls r1, 28 - mov r2, r8 - ldr r0, [r2] - bics r0, r1 - str r0, [r2] - movs r0, 0 - bl dp01_build_cmdbuf_x2A_2A_2A_2A - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _0804D170 - .pool -_0804D120: - ldr r6, =0x0202437c - ldrb r0, [r4] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - blt _0804D15C - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x5E - ldrb r0, [r0] - bl sub_804CF10 - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - b _0804D170 - .pool -_0804D15C: - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - bl sub_8034464 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - movs r0, 0x1 - mov r9, r0 -_0804D170: - ldr r6, =gUnknown_0832A328 - ldr r0, [r6, 0x8] - ands r0, r5 - cmp r0, 0 - beq _0804D22E - ldr r0, [r6] - ands r0, r5 - cmp r0, 0 - bne _0804D22E - ldr r4, =0x02024064 - movs r0, 0x2 - strb r0, [r4] - movs r0, 0x2 - movs r1, 0x6 - movs r2, 0x6 - bl sub_80423F4 - lsls r0, 24 - cmp r0, 0 - beq _0804D1D8 - ldr r2, =0x02024210 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldr r2, =0x02024280 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r1, [r0] - lsls r1, 28 - ldr r0, [r2] - bics r0, r1 - str r0, [r2] - movs r0, 0 - bl dp01_build_cmdbuf_x2A_2A_2A_2A - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _0804D22E - .pool -_0804D1D8: - ldr r6, =0x0202437c - ldrb r0, [r4] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - blt _0804D214 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x5C - ldrb r0, [r0] - bl sub_804CF10 - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - b _0804D22E - .pool -_0804D214: - movs r0, 0x1 - mov r1, r9 - ands r0, r1 - cmp r0, 0 - bne _0804D22E - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - bl sub_8034464 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0804D22E: - ldr r6, =gUnknown_0832A328 - ldr r0, [r6, 0x4] - ands r0, r5 - cmp r0, 0 - beq _0804D2E4 - ldr r4, =0x02024064 - movs r0, 0x1 - strb r0, [r4] - movs r0, 0x1 - movs r1, 0x6 - movs r2, 0x6 - bl sub_80423F4 - lsls r0, 24 - cmp r0, 0 - beq _0804D290 - ldr r2, =0x02024210 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldr r2, =0x02024280 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r1, [r0] - lsls r1, 28 - ldr r0, [r2] - bics r0, r1 - str r0, [r2] - movs r0, 0 - bl dp01_build_cmdbuf_x2A_2A_2A_2A - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _0804D2E4 - .pool -_0804D290: - ldr r6, =0x0202437c - ldrb r0, [r4] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - blt _0804D2CC - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x5F - ldrb r0, [r0] - bl sub_804CF10 - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - b _0804D2E4 - .pool -_0804D2CC: - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - bl sub_8034464 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - movs r0, 0x2 - mov r2, r9 - orrs r2, r0 - mov r9, r2 -_0804D2E4: - ldr r6, =gUnknown_0832A328 - ldr r0, [r6, 0xC] - ands r0, r5 - cmp r0, 0 - beq _0804D3A2 - ldr r0, [r6, 0x4] - ands r0, r5 - cmp r0, 0 - bne _0804D3A2 - ldr r4, =0x02024064 - movs r0, 0x3 - strb r0, [r4] - movs r0, 0x3 - movs r1, 0x6 - movs r2, 0x6 - bl sub_80423F4 - lsls r0, 24 - cmp r0, 0 - beq _0804D34C - ldr r2, =0x02024210 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldr r2, =0x02024280 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r1, [r0] - lsls r1, 28 - ldr r0, [r2] - bics r0, r1 - str r0, [r2] - movs r0, 0 - bl dp01_build_cmdbuf_x2A_2A_2A_2A - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _0804D3A2 - .pool -_0804D34C: - ldr r6, =0x0202437c - ldrb r0, [r4] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - blt _0804D388 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x5D - ldrb r0, [r0] - bl sub_804CF10 - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - b _0804D3A2 - .pool -_0804D388: - movs r0, 0x2 - mov r1, r9 - ands r1, r0 - cmp r1, 0 - bne _0804D3A2 - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - bl sub_8034464 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0804D3A2: - ldr r1, =0x0202437c - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - blt _0804D3FA - adds r0, r1, 0 - adds r0, 0x28 - ldrb r0, [r0] - lsls r0, 25 - cmp r0, 0 - blt _0804D3FA - cmp r5, 0 - beq _0804D3FA - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r0, =gUnknown_0832A328 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _0804D3E4 - ldr r1, =0x02024064 - movs r0, 0x2 - strb r0, [r1] - b _0804D3E8 - .pool -_0804D3E4: - ldr r0, =0x02024064 - strb r1, [r0] -_0804D3E8: - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - bl sub_8034464 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution -_0804D3FA: - ldr r1, =0x0202437c - ldrb r0, [r1, 0x14] - lsls r0, 25 - cmp r0, 0 - blt _0804D450 - adds r0, r1, 0 - adds r0, 0x3C - ldrb r0, [r0] - lsls r0, 25 - cmp r0, 0 - blt _0804D450 - cmp r5, 0 - beq _0804D450 - ldr r0, =0x02024210 - ldrb r0, [r0] - ldr r1, =gUnknown_0832A328 - ldr r1, [r1, 0x4] - ands r0, r1 - cmp r0, 0 - beq _0804D438 - ldr r1, =0x02024064 - movs r0, 0x3 - b _0804D43C - .pool -_0804D438: - ldr r1, =0x02024064 - movs r0, 0x1 -_0804D43C: - strb r0, [r1] - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - bl sub_8034464 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution -_0804D450: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x6 - str r0, [r1] - b _0804D804 - .pool -_0804D464: - cmp r0, 0x6 - beq _0804D46A - b _0804D658 -_0804D46A: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0804D478 - b _0804D5F4 -_0804D478: - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - bne _0804D482 - b _0804D5F4 -_0804D482: - ldr r7, =0x02024280 - ldr r0, [r7] - lsrs r5, r0, 28 - ldr r4, =gUnknown_0832A328 - ldr r0, [r4, 0x8] - ands r0, r5 - cmp r0, 0 - beq _0804D52A - ldr r0, [r4] - ands r0, r5 - cmp r0, 0 - beq _0804D52A - ldr r6, =0x02024064 - movs r0, 0x2 - strb r0, [r6] - ldr r0, =0x02023864 - ldrb r1, [r0, 0x1] - movs r0, 0x2 - movs r2, 0x6 - bl sub_80423F4 - lsls r0, 24 - cmp r0, 0 - beq _0804D4F8 - ldr r2, =0x02024210 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldrb r0, [r6] - lsls r0, 2 - adds r0, r4 - ldr r1, [r0] - lsls r1, 28 - ldr r0, [r7] - bics r0, r1 - str r0, [r7] - movs r0, 0 - bl dp01_build_cmdbuf_x2A_2A_2A_2A - ldrb r0, [r6] - bl dp01_battle_side_mark_buffer_for_execution - b _0804D52A - .pool -_0804D4F8: - ldr r4, =0x0202437c - ldrb r0, [r6] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - blt _0804D52A - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x5C - ldrb r0, [r0] - bl sub_804CF10 - ldrb r1, [r6] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] -_0804D52A: - ldr r4, =gUnknown_0832A328 - ldr r0, [r4, 0xC] - ands r0, r5 - cmp r0, 0 - beq _0804D5DA - ldr r0, [r4, 0x4] - ands r5, r0 - cmp r5, 0 - beq _0804D5DA - ldr r5, =0x02024064 - movs r0, 0x3 - strb r0, [r5] - ldr r0, =0x02023864 - ldr r2, =0x00000201 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x3 - movs r2, 0x6 - bl sub_80423F4 - lsls r0, 24 - cmp r0, 0 - beq _0804D5A8 - ldr r2, =0x02024210 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldr r2, =0x02024280 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r4 - ldr r1, [r0] - lsls r1, 28 - ldr r0, [r2] - bics r0, r1 - str r0, [r2] - movs r0, 0 - bl dp01_build_cmdbuf_x2A_2A_2A_2A - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - b _0804D5DA - .pool -_0804D5A8: - ldr r4, =0x0202437c - ldrb r0, [r5] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - blt _0804D5DA - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x5D - ldrb r0, [r0] - bl sub_804CF10 - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] -_0804D5DA: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x6 - str r0, [r1] - mov r12, r1 - b _0804D5F8 - .pool -_0804D5F4: - adds r0, r2, 0x6 - str r0, [r6] -_0804D5F8: - ldr r0, =0x02024280 - ldr r0, [r0] - lsrs r5, r0, 28 - ldr r1, =0x0202420d - movs r0, 0 - strb r0, [r1] - ldr r4, =gUnknown_0832A328 - ldr r2, [r4] - ands r2, r5 - ldr r6, =0x0202406c - cmp r2, 0 - bne _0804D634 - adds r7, r6, 0 - ldrb r0, [r6] - cmp r2, r0 - bcs _0804D634 - adds r3, r1, 0 -_0804D61A: - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - ldrb r2, [r3] - lsls r0, r2, 2 - adds r0, r4 - ldr r0, [r0] - ands r0, r5 - cmp r0, 0 - bne _0804D634 - ldrb r0, [r7] - cmp r2, r0 - bcc _0804D61A -_0804D634: - ldrb r0, [r1] - ldrb r6, [r6] - cmp r0, r6 - beq _0804D63E - b _0804D804 -_0804D63E: - mov r1, r8 - mov r2, r12 - str r1, [r2] - b _0804D804 - .pool -_0804D658: - movs r0, 0x80 - ands r0, r1 - movs r5, 0x1 - cmp r0, 0 - beq _0804D664 - movs r5, 0 -_0804D664: - movs r0, 0x7F - ands r0, r1 - bl get_battle_side_of_something - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x0202437c - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 25 - cmp r0, 0 - bge _0804D690 - ldr r0, [r6] - adds r0, 0x6 - str r0, [r6] - b _0804D804 - .pool -_0804D690: - adds r0, r7, 0 - movs r1, 0x6 - movs r2, 0x6 - bl sub_80423F4 - lsls r0, 24 - cmp r0, 0 - beq _0804D6E0 - ldr r2, =0x02024064 - strb r7, [r2] - ldr r3, =0x02024210 - ldr r4, =gUnknown_0832A328 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - ldrb r1, [r3] - orrs r0, r1 - strb r0, [r3] - ldr r3, =0x02024280 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r4 - ldr r1, [r0] - lsls r1, 28 - ldr r0, [r3] - bics r0, r1 - str r0, [r3] - mov r0, r8 - str r0, [r6] - b _0804D804 - .pool -_0804D6E0: - ldr r4, =0x02024064 - strb r7, [r4] - ldrb r0, [r4] - ldr r3, =0x0202449c - ldr r1, [r3] - adds r1, r0, r1 - adds r1, 0x58 - ldr r2, =0x0202406e - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1] - ldrb r0, [r4] - ldr r1, [r3] - adds r0, r1 - adds r0, 0x5C - movs r1, 0x6 - strb r1, [r0] - ldr r1, [r3] - adds r1, 0x93 - ldr r2, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r2 - ldr r2, [r0] - ldrb r0, [r1] - bics r0, r2 - strb r0, [r1] - ldrb r1, [r4] - movs r0, 0x2 - eors r0, r1 - ldr r3, [r3] - adds r0, r3 - adds r0, 0x5C - ldrb r2, [r0] - ldrb r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - adds r0, 0x60 - adds r3, r0 - str r3, [sp] - movs r0, 0 - adds r1, r5, 0 - movs r3, 0 - bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r6] - adds r0, 0x6 - str r0, [r6] - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - cmp r0, 0 - bne _0804D760 - ldr r1, =0x03005d10 - ldrb r0, [r1, 0x2] - cmp r0, 0xFE - bhi _0804D760 - adds r0, 0x1 - strb r0, [r1, 0x2] -_0804D760: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0804D7C4 - ldr r1, =0x02024064 - movs r0, 0 - strb r0, [r1] - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r0, 0 - beq _0804D804 - adds r4, r1, 0 -_0804D77C: - ldrb r0, [r4] - cmp r0, r7 - beq _0804D792 - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - bl sub_8034464 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0804D792: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _0804D77C - b _0804D804 - .pool -_0804D7C4: - adds r0, r7, 0 - bl battle_get_per_side_status - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - ldr r4, =0x02024064 - strb r0, [r4] - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r3, [r4] - lsls r0, r3, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _0804D7F4 - movs r0, 0x2 - eors r3, r0 - strb r3, [r4] -_0804D7F4: - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - bl sub_8034464 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0804D804: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk50_openpartyscreen - - thumb_func_start atk51_cmd51 -atk51_cmd51: @ 804D820 - push {r4-r7,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _0804D82C - b _0804DA8A -_0804D82C: - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r5, =0x02024064 - strb r0, [r5] - ldr r0, [r4] - ldrb r0, [r0, 0x2] - cmp r0, 0x1 - beq _0804D8CC - cmp r0, 0x1 - bgt _0804D858 - cmp r0, 0 - beq _0804D862 - b _0804DA82 - .pool -_0804D858: - cmp r0, 0x2 - beq _0804D8E8 - cmp r0, 0x3 - beq _0804D922 - b _0804DA82 -_0804D862: - movs r6, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r6, r0 - blt _0804D86E - b _0804DA82 -_0804D86E: - ldr r7, =0x02023864 -_0804D870: - ldrb r0, [r7] - cmp r0, 0x22 - bne _0804D8AA - ldr r5, =0x0202449c - ldr r0, [r5] - adds r0, r6, r0 - adds r0, 0x5C - ldrb r1, [r7, 0x1] - strb r1, [r0] - ldr r0, [r5] - adds r0, 0x93 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - lsls r0, r6, 2 - adds r0, r2 - ldr r4, [r0] - ands r1, r4 - cmp r1, 0 - bne _0804D8AA - lsls r0, r6, 24 - lsrs r0, 24 - ldrb r1, [r7, 0x1] - bl sub_8184FBC - ldr r1, [r5] - adds r1, 0x93 - ldrb r0, [r1] - orrs r4, r0 - strb r4, [r1] -_0804D8AA: - movs r0, 0x80 - lsls r0, 2 - adds r7, r0 - adds r6, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r6, r0 - blt _0804D870 - b _0804DA82 - .pool -_0804D8CC: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0804D8DA - b _0804DA82 -_0804D8DA: - ldrb r0, [r5] - bl sub_803BDA0 - b _0804DA82 - .pool -_0804D8E8: - ldr r4, =0x0202449c - ldr r0, [r4] - adds r0, 0x93 - ldrb r1, [r0] - ldr r6, =gUnknown_0832A328 - ldrb r2, [r5] - lsls r0, r2, 2 - adds r0, r6 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0804D922 - ldr r0, =0x02023864 - lsls r1, r2, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r1, [r1] - adds r0, r2, 0 - bl sub_8184FBC - ldr r2, [r4] - adds r2, 0x93 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] -_0804D922: - ldr r1, =0x02024332 - ldr r6, =0x02023864 - ldr r7, =0x02024064 - ldrb r0, [r7] - lsls r0, 9 - adds r2, r6, 0x1 - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r7] - ldr r1, =0x0202449c - mov r12, r1 - ldr r1, [r1] - adds r1, r0, r1 - adds r1, 0x5C - lsls r0, 9 - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x42 - ands r0, r1 - cmp r0, 0x42 - bne _0804DA14 - ldrb r0, [r7] - mov r3, r12 - ldr r2, [r3] - lsls r1, r0, 1 - adds r1, r0 - adds r1, r2 - adds r1, 0x60 - ldrb r2, [r1] - movs r0, 0xF - ands r0, r2 - strb r0, [r1] - ldrb r0, [r7] - ldr r2, [r3] - lsls r1, r0, 1 - adds r1, r0 - adds r1, r2 - adds r1, 0x60 - lsls r0, 9 - adds r5, r6, 0x2 - adds r0, r5 - ldrb r2, [r0] - movs r3, 0xF0 - adds r0, r3, 0 - ands r0, r2 - ldrb r2, [r1] - orrs r0, r2 - strb r0, [r1] - ldrb r1, [r7] - mov r0, r12 - ldr r2, [r0] - lsls r0, r1, 1 - adds r0, r1 - adds r0, r2 - adds r0, 0x61 - lsls r1, 9 - adds r6, 0x3 - adds r1, r6 - ldrb r1, [r1] - strb r1, [r0] - ldrb r0, [r7] - movs r4, 0x2 - eors r0, r4 - mov r1, r12 - ldr r2, [r1] - lsls r1, r0, 1 - adds r1, r0 - adds r1, r2 - adds r1, 0x60 - ldrb r2, [r1] - adds r0, r3, 0 - ands r0, r2 - strb r0, [r1] - ldrb r0, [r7] - eors r0, r4 - mov r1, r12 - ldr r2, [r1] - lsls r1, r0, 1 - adds r1, r0 - adds r1, r2 - adds r1, 0x60 - ldrb r0, [r7] - lsls r0, 9 - adds r0, r5 - ldrb r0, [r0] - ands r3, r0 - lsrs r3, 4 - ldrb r0, [r1] - orrs r3, r0 - strb r3, [r1] - ldrb r0, [r7] - eors r4, r0 - mov r2, r12 - ldr r0, [r2] - lsls r1, r4, 1 - adds r1, r4 - adds r1, r0 - adds r1, 0x62 - ldrb r0, [r7] - lsls r0, 9 - adds r0, r6 - ldrb r0, [r0] - strb r0, [r1] - b _0804DA36 - .pool -_0804DA14: - movs r0, 0x80 - lsls r0, 15 - ands r1, r0 - cmp r1, 0 - beq _0804DA30 - ldrb r0, [r7] - mov r3, r12 - ldr r1, [r3] - adds r1, r0, r1 - adds r1, 0x5C - ldrb r1, [r1] - bl sub_80571DC - b _0804DA36 -_0804DA30: - ldrb r0, [r7] - bl sub_803BDA0 -_0804DA36: - ldr r1, =0x02022f58 - movs r5, 0xFD - strb r5, [r1] - movs r0, 0x6 - strb r0, [r1, 0x1] - ldr r4, =0x02024084 - ldr r3, =0x0202420b - ldrb r0, [r3] - movs r2, 0x58 - muls r0, r2 - adds r0, r4 - ldrh r0, [r0] - strb r0, [r1, 0x2] - ldrb r0, [r3] - muls r0, r2 - adds r0, r4 - ldrh r0, [r0] - lsrs r0, 8 - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r2, =0x02022f68 - strb r5, [r2] - movs r0, 0x7 - strb r0, [r2, 0x1] - ldr r3, =0x02024064 - ldrb r0, [r3] - strb r0, [r2, 0x2] - ldr r1, =0x02023864 - ldrb r0, [r3] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2, 0x3] - movs r0, 0x1 - negs r0, r0 - strb r0, [r2, 0x4] -_0804DA82: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x3 - str r0, [r1] -_0804DA8A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk51_cmd51 - - thumb_func_start atk52_cmd52 -atk52_cmd52: @ 804DAAC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r0, =0x02024214 - mov r9, r0 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - ldrb r0, [r4] - bl sub_803FA70 - ldr r1, =0x02024280 - mov r8, r1 - ldr r1, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - lsls r1, 28 - mov r2, r8 - ldr r0, [r2] - bics r0, r1 - str r0, [r2] - ldr r2, =0x0202437c - ldrb r0, [r4] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1] - movs r0, 0x41 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldrb r0, [r4] - bl battle_side_get_owner - ldr r5, =0x0202428e - lsls r0, 24 - lsrs r0, 23 - adds r0, r5 - ldrh r1, [r0] - movs r7, 0x80 - lsls r7, 2 - mov r10, r7 - mov r0, r10 - ands r0, r1 - cmp r0, 0 - beq _0804DB1C - b _0804DC30 -_0804DB1C: - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 23 - adds r0, r5 - ldrh r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _0804DB34 - b _0804DC30 -_0804DB34: - ldr r7, =0x02024084 - ldrb r2, [r4] - movs r6, 0x58 - adds r0, r2, 0 - muls r0, r6 - adds r1, r0, r7 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x2 - beq _0804DC30 - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x2 - beq _0804DC30 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1A - beq _0804DC30 - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 23 - adds r0, r5 - ldrh r2, [r0] - mov r1, r10 - orrs r1, r2 - strh r1, [r0] - ldrb r0, [r4] - adds r2, r0, 0 - muls r2, r6 - adds r0, r7, 0 - adds r0, 0x50 - adds r2, r0 - ldr r0, [r2] - ldr r1, =0xfdffffff - ands r0, r1 - str r0, [r2] - mov r1, r8 - ldr r0, [r1] - movs r2, 0x41 - negs r2, r2 - ands r0, r2 - str r0, [r1] - ldrb r0, [r4] - bl battle_side_get_owner - ldr r2, =0x02024294 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0xA] - movs r1, 0x5 - subs r1, r0 - lsls r1, 25 - lsrs r1, 24 - ldr r5, =0x020241f0 - ldrb r0, [r4] - muls r0, r6 - adds r0, r7 - ldrh r0, [r0, 0x2C] - bl __divsi3 - str r0, [r5] - cmp r0, 0 - bne _0804DBC8 - movs r0, 0x1 - str r0, [r5] -_0804DBC8: - ldr r0, =0x02024474 - ldrb r1, [r4] - strb r1, [r0, 0x17] - bl b_movescr_stack_push_cursor - mov r7, r9 - ldr r0, [r7] - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _0804DC14 - ldr r0, =gUnknown_082DAE90 - str r0, [r7] - b _0804DD8E - .pool -_0804DC14: - cmp r0, 0x1 - bne _0804DC24 - ldr r0, =gUnknown_082DAE59 - mov r1, r9 - str r0, [r1] - b _0804DD8E - .pool -_0804DC24: - ldr r0, =gUnknown_082DAEC7 - mov r2, r9 - str r0, [r2] - b _0804DD8E - .pool -_0804DC30: - ldr r2, =0x02024084 - ldr r1, =0x02024064 - ldrb r3, [r1] - movs r0, 0x58 - muls r0, r3 - adds r0, r2 - adds r0, 0x20 - ldrb r0, [r0] - adds r5, r1, 0 - ldr r4, =0x020242bc - cmp r0, 0x36 - bne _0804DC5E - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r2, r0, r4 - ldrb r1, [r2, 0x18] - lsls r0, r1, 30 - cmp r0, 0 - blt _0804DC5E - movs r0, 0x1 - orrs r0, r1 - strb r0, [r2, 0x18] -_0804DC5E: - ldrb r0, [r5] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r2, [r1, 0x18] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x18] - ldrb r1, [r5] - movs r0, 0 - str r0, [sp] - movs r2, 0 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _0804DC88 - b _0804DD8E -_0804DC88: - ldrb r1, [r5] - movs r0, 0 - movs r2, 0 - bl berry_effects_maybe - lsls r0, 24 - cmp r0, 0 - bne _0804DD8E - ldrb r0, [r5] - bl battle_side_get_owner - ldr r1, =0x0202428e - lsls r0, 24 - lsrs r0, 23 - adds r0, r1 - ldrh r2, [r0] - ldr r1, =0x0000fdff - ands r1, r2 - strh r1, [r0] - movs r4, 0 - ldr r0, =0x0202406c - ldrb r7, [r0] - cmp r4, r7 - bge _0804DCD8 - ldr r6, =0x0202407e - adds r1, r5, 0 - ldr r5, =0x0202407a - movs r3, 0xC - adds r2, r0, 0 -_0804DCC2: - adds r0, r4, r6 - ldrb r0, [r0] - ldrb r7, [r1] - cmp r0, r7 - bne _0804DCD0 - adds r0, r4, r5 - strb r3, [r0] -_0804DCD0: - adds r4, 0x1 - ldrb r0, [r2] - cmp r4, r0 - blt _0804DCC2 -_0804DCD8: - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - bge _0804DD0C - ldr r6, =0x0202449c - ldr r5, =0x02024084 -_0804DCE6: - lsls r0, r4, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 23 - adds r0, 0xA8 - ldr r1, [r6] - adds r1, r0 - movs r0, 0x58 - muls r0, r4 - adds r0, r5 - ldrh r0, [r0, 0x28] - strh r0, [r1] - adds r4, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _0804DCE6 -_0804DD0C: - ldr r0, =0x02024214 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r5, r0, 0 - cmp r1, 0x5 - bne _0804DD88 - ldr r0, =0x02024280 - ldr r0, [r0] - lsrs r4, r0, 28 - ldr r1, =0x0202420d - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r2, =gUnknown_0832A328 - b _0804DD6E - .pool -_0804DD60: - ldr r0, =0x0202406c - ldrb r3, [r1] - ldrb r0, [r0] - cmp r3, r0 - bcs _0804DD88 - adds r0, r3, 0x1 - strb r0, [r1] -_0804DD6E: - ldrb r0, [r1] - lsls r0, 2 - adds r0, r2 - ldr r3, [r0] - adds r0, r4, 0 - ands r0, r3 - cmp r0, 0 - beq _0804DD60 - ldr r0, =0x02024210 - ldrb r0, [r0] - ands r0, r3 - cmp r0, 0 - bne _0804DD60 -_0804DD88: - ldr r0, [r5] - adds r0, 0x2 - str r0, [r5] -_0804DD8E: - 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 atk52_cmd52 - - thumb_func_start sub_804DDA8 -sub_804DDA8: @ 804DDA8 - push {r4,r5,lr} - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl battle_get_side_with_given_state - ldr r4, =0x02024064 - strb r0, [r4] - movs r0, 0 - bl dp01_build_cmdbuf_x08_8_8_8 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r5] - adds r0, 0x2 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804DDA8 - - thumb_func_start atk54_802511C -atk54_802511C: @ 804DDD8 - push {r4,r5,lr} - ldr r5, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r5] - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r1, [r0, 0x1] - ldrb r0, [r0, 0x2] - lsls r0, 8 - orrs r1, r0 - movs r0, 0 - bl dp01_build_cmdbuf_x2B_aa_0 - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r4] - adds r0, 0x3 - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk54_802511C - - thumb_func_start sub_804DE14 -sub_804DE14: @ 804DE14 - push {r4,r5,lr} - ldr r5, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r5] - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r1, [r0, 0x1] - ldrb r0, [r0, 0x2] - lsls r0, 8 - orrs r1, r0 - movs r0, 0 - movs r2, 0 - bl sub_8034300 - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r4] - adds r0, 0x3 - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804DE14 - - thumb_func_start atk56_8025194 -atk56_8025194: @ 804DE50 - push {r4,r5,lr} - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - movs r0, 0 - bl dp01_build_cmdbuf_x2D_2D_2D_2D - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r5] - adds r0, 0x2 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk56_8025194 - - thumb_func_start atk57_80251C4_flee -atk57_80251C4_flee: @ 804DE80 - push {r4,lr} - movs r0, 0 - bl battle_get_side_with_given_state - ldr r4, =0x02024064 - strb r0, [r4] - ldr r0, =0x0202433a - ldrb r1, [r0] - movs r0, 0 - bl dp01_build_cmdbuf_x37_a - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk57_80251C4_flee - - thumb_func_start atk58_cmd58 -atk58_cmd58: @ 804DEB8 - push {r4,r5,lr} - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - movs r0, 0 - movs r1, 0x1 - bl dp01_build_cmdbuf_x06_a - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r5] - adds r0, 0x2 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk58_cmd58 - - thumb_func_start atk59_8025230 -atk59_8025230: @ 804DEEC - push {r4-r7,lr} - ldr r0, =0x02024214 - ldr r2, [r0] - ldrb r6, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r6, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r6, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r6, r0 - ldrb r4, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - orrs r4, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - orrs r4, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - orrs r4, r0 - ldr r0, =0x0202449c - ldr r0, [r0] - ldrb r1, [r0, 0x10] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldrb r1, [r2, 0x9] - bl sub_8069318 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x0000fffe - cmp r5, r0 - bne _0804DF56 - adds r7, r5, 0 -_0804DF3A: - ldr r0, =0x0202449c - ldr r0, [r0] - ldrb r1, [r0, 0x10] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0 - bl sub_8069318 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, r7 - beq _0804DF3A -_0804DF56: - cmp r5, 0 - bne _0804DF70 - ldr r0, =0x02024214 - str r4, [r0] - b _0804E018 - .pool -_0804DF70: - ldr r0, =0x0000ffff - cmp r5, r0 - bne _0804DF88 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0xA - str r0, [r1] - b _0804E018 - .pool -_0804DF88: - movs r0, 0 - bl battle_get_side_with_given_state - ldr r1, =0x02024064 - strb r0, [r1] - ldr r2, =0x0202406e - ldrb r3, [r1] - lsls r0, r3, 1 - adds r0, r2 - ldr r1, =0x0202449c - ldr r1, [r1] - ldrh r0, [r0] - ldrb r1, [r1, 0x10] - cmp r0, r1 - bne _0804DFC8 - ldr r4, =0x02024084 - movs r0, 0x58 - adds r2, r3, 0 - muls r2, r0 - adds r0, r4, 0 - adds r0, 0x50 - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _0804DFC8 - adds r0, r2, r4 - adds r1, r5, 0 - bl sub_80691B0 -_0804DFC8: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0804E014 - movs r0, 0x2 - bl battle_get_side_with_given_state - ldr r1, =0x02024064 - strb r0, [r1] - ldr r2, =0x0202406e - ldrb r3, [r1] - lsls r0, r3, 1 - adds r0, r2 - ldr r1, =0x0202449c - ldr r1, [r1] - ldrh r0, [r0] - ldrb r1, [r1, 0x10] - cmp r0, r1 - bne _0804E014 - ldr r4, =0x02024084 - movs r0, 0x58 - adds r2, r3, 0 - muls r2, r0 - adds r0, r4, 0 - adds r0, 0x50 - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _0804E014 - adds r0, r2, r4 - adds r1, r5, 0 - bl sub_80691B0 -_0804E014: - ldr r0, =0x02024214 - str r6, [r0] -_0804E018: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk59_8025230 - - thumb_func_start sub_804E038 -sub_804E038: @ 804E038 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - ldr r0, =0x02024064 - movs r1, 0 - strb r1, [r0] - ldr r0, =0x02024474 - ldrb r1, [r0, 0x1F] - adds r2, r0, 0 - cmp r1, 0x6 - bls _0804E052 - b _0804E3B8 -_0804E052: - lsls r0, r1, 2 - ldr r1, =_0804E068 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0804E068: - .4byte _0804E084 - .4byte _0804E0BC - .4byte _0804E162 - .4byte _0804E1B8 - .4byte _0804E1E4 - .4byte _0804E38C - .4byte _0804E3AC -_0804E084: - movs r4, 0 - str r4, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - ldr r0, =gUnknown_085CCABB - movs r1, 0xC - bl battle_show_message_maybe - ldr r1, =0x02024474 - ldrb r0, [r1, 0x1F] - adds r0, 0x1 - strb r0, [r1, 0x1F] - ldr r0, =0x02024332 - strb r4, [r0, 0x1] - movs r0, 0 - bl sub_8056B74 - b _0804E3B8 - .pool -_0804E0BC: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0804E0E4 - ldr r4, =0x02024332 - ldrb r0, [r4, 0x1] - cmp r0, 0 - beq _0804E0E4 - movs r0, 0x5 - bl audio_play - ldrb r0, [r4, 0x1] - bl sub_8056BAC - movs r0, 0 - strb r0, [r4, 0x1] - bl sub_8056B74 -_0804E0E4: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0804E10C - ldr r4, =0x02024332 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _0804E10C - movs r0, 0x5 - bl audio_play - ldrb r0, [r4, 0x1] - bl sub_8056BAC - movs r0, 0x1 - strb r0, [r4, 0x1] - bl sub_8056B74 -_0804E10C: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r5, 0x1 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _0804E150 - movs r0, 0x5 - bl audio_play - ldr r0, =0x02024332 - ldrb r4, [r0, 0x1] - cmp r4, 0 - bne _0804E20A - str r5, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _0804E192 - .pool -_0804E150: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0804E15A - b _0804E3B8 -_0804E15A: - movs r0, 0x5 - bl audio_play - b _0804E20A -_0804E162: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0804E170 - b _0804E3B8 -_0804E170: - bl FreeAllWindowBuffers - ldr r0, =0x020244ec - ldr r1, =0x0202449c - ldr r1, [r1] - ldrb r1, [r1, 0x10] - ldr r2, =0x020244e9 - ldrb r2, [r2] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldr r3, =sub_80A92F8 - ldr r4, =0x020244e2 - ldrh r4, [r4] - str r4, [sp] - bl sub_81BFA38 -_0804E192: - ldr r1, =0x02024474 - ldrb r0, [r1, 0x1F] - adds r0, 0x1 - strb r0, [r1, 0x1F] - b _0804E3B8 - .pool -_0804E1B8: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0804E1C6 - b _0804E3B8 -_0804E1C6: - ldr r0, =0x030022c0 - ldr r1, [r0, 0x4] - ldr r0, =sub_8038420 - cmp r1, r0 - beq _0804E1D2 - b _0804E3B8 -_0804E1D2: - ldrb r0, [r2, 0x1F] - adds r0, 0x1 - b _0804E3B6 - .pool -_0804E1E4: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0804E1F2 - b _0804E3B8 -_0804E1F2: - ldr r0, =0x030022c0 - ldr r1, [r0, 0x4] - ldr r0, =sub_8038420 - cmp r1, r0 - beq _0804E1FE - b _0804E3B8 -_0804E1FE: - bl sub_81C1B94 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x4 - bne _0804E224 -_0804E20A: - ldr r1, =0x02024474 - movs r0, 0x5 - strb r0, [r1, 0x1F] - b _0804E3B8 - .pool -_0804E224: - ldr r6, =0x0202449c - ldr r0, [r6] - ldrb r0, [r0, 0x10] - movs r1, 0x64 - mov r8, r1 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - ldr r7, =0x020244ec - adds r0, r7 - adds r1, r5, 0 - adds r1, 0xD - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl sub_806E804 - cmp r0, 0 - beq _0804E274 - ldr r0, =0x0000013f - ldr r1, =0x02024064 - ldrb r1, [r1] - bl b_std_message - ldr r1, =0x02024474 - movs r0, 0x6 - strb r0, [r1, 0x1F] - b _0804E3B8 - .pool -_0804E274: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - ldr r1, =0x02022f68 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - strb r4, [r1, 0x2] - lsrs r0, r4, 8 - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r0, [r6] - ldrb r0, [r0, 0x10] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r7 - adds r1, r5, 0 - bl sub_806B9A8 - ldr r0, [r6] - ldrb r0, [r0, 0x10] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r7 - ldr r7, =0x020244e2 - ldrh r1, [r7] - adds r2, r5, 0 - bl sub_80691F4 - ldr r0, =0x0202406e - ldr r1, [r6] - ldrh r0, [r0] - ldrb r1, [r1, 0x10] - cmp r0, r1 - bne _0804E30A - ldr r4, =0x02024084 - ldr r0, [r4, 0x50] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _0804E30A - ldr r0, =0x020242bc - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gUnknown_0832A328 - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0804E30A - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_806B9E4 - ldrh r1, [r7] - adds r0, r4, 0 - adds r2, r5, 0 - bl sub_8069234 -_0804E30A: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0804E3B8 - ldr r2, =0x0202406e - ldr r0, =0x0202449c - ldr r1, [r0] - ldrh r0, [r2, 0x4] - ldrb r1, [r1, 0x10] - cmp r0, r1 - bne _0804E3B8 - ldr r4, =0x02024084 - movs r1, 0x80 - lsls r1, 1 - adds r0, r4, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _0804E3B8 - ldr r0, =0x020242bc - adds r0, 0x50 - ldrb r1, [r0] - lsrs r1, 4 - ldr r2, =gUnknown_0832A328 - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0804E3B8 - adds r4, 0xB0 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_806B9E4 - ldr r0, =0x020244e2 - ldrh r1, [r0] - adds r0, r4, 0 - adds r2, r5, 0 - bl sub_8069234 - b _0804E3B8 - .pool -_0804E38C: - movs r0, 0x1 - str r0, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _0804E3B8 - .pool -_0804E3AC: - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0804E3B8 - movs r0, 0x2 -_0804E3B6: - strb r0, [r2, 0x1F] -_0804E3B8: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804E038 - - thumb_func_start atk5B_80256E0 -atk5B_80256E0: @ 804E3C8 - push {r4,r5,lr} - sub sp, 0x4 - ldr r5, =0x02024474 - ldrb r4, [r5, 0x1F] - cmp r4, 0 - beq _0804E3E0 - cmp r4, 0x1 - beq _0804E410 - b _0804E4FA - .pool -_0804E3E0: - str r4, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - ldr r0, =gUnknown_085CCABB - movs r1, 0xC - bl battle_show_message_maybe - ldrb r0, [r5, 0x1F] - adds r0, 0x1 - strb r0, [r5, 0x1F] - ldr r0, =0x02024332 - strb r4, [r0, 0x1] - movs r0, 0 - bl sub_8056B74 - b _0804E4FA - .pool -_0804E410: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0804E438 - ldr r4, =0x02024332 - ldrb r0, [r4, 0x1] - cmp r0, 0 - beq _0804E438 - movs r0, 0x5 - bl audio_play - ldrb r0, [r4, 0x1] - bl sub_8056BAC - movs r0, 0 - strb r0, [r4, 0x1] - bl sub_8056B74 -_0804E438: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0804E460 - ldr r4, =0x02024332 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _0804E460 - movs r0, 0x5 - bl audio_play - ldrb r0, [r4, 0x1] - bl sub_8056BAC - movs r0, 0x1 - strb r0, [r4, 0x1] - bl sub_8056B74 -_0804E460: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r4, 0x1 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _0804E4C4 - movs r0, 0x5 - bl audio_play - ldr r0, =0x02024332 - ldrb r0, [r0, 0x1] - cmp r0, 0 - beq _0804E4A4 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0804E4AC - .pool -_0804E4A4: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_0804E4AC: - movs r0, 0x1 - str r0, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - b _0804E4FA - .pool -_0804E4C4: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0804E4FA - movs r0, 0x5 - bl audio_play - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - str r4, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C -_0804E4FA: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk5B_80256E0 - - thumb_func_start atk5C_cmd5c -atk5C_cmd5c: @ 804E508 - push {r4,lr} - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r2, =0x02024064 - strb r0, [r2] - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _0804E58C - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 1 - ands r0, r1 - cmp r0, 0 - beq _0804E55A - ldr r1, =0x02024084 - ldrb r2, [r2] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _0804E55A - ldr r0, =0x020242bc - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xA] - cmp r0, 0 - bne _0804E58C -_0804E55A: - movs r0, 0 - bl dp01_build_cmdbuf_x29_29_29_29 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] - b _0804E592 - .pool -_0804E58C: - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] -_0804E592: - pop {r4} - pop {r0} - bx r0 - thumb_func_end atk5C_cmd5c - - thumb_func_start sub_804E598 -sub_804E598: @ 804E598 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r6, r0, 16 - movs r7, 0 - movs r5, 0 - movs r0, 0x80 - lsls r0, 3 - cmp r6, r0 - bne _0804E5D8 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0] - adds r0, 0x94 - ldrb r2, [r0] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x4A - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - muls r0, r2 - b _0804E6CA - .pool -_0804E5D8: - ldr r0, =gTrainers - lsls r2, r6, 2 - adds r1, r2, r6 - lsls r1, 3 - adds r4, r1, r0 - ldrb r3, [r4] - mov r12, r0 - cmp r3, 0x1 - beq _0804E62E - cmp r3, 0x1 - bgt _0804E5F8 - cmp r3, 0 - beq _0804E602 - b _0804E644 - .pool -_0804E5F8: - cmp r3, 0x2 - beq _0804E618 - cmp r3, 0x3 - beq _0804E62E - b _0804E644 -_0804E602: - mov r0, r12 - adds r0, 0x24 - adds r0, r1, r0 - ldr r1, [r0] - adds r0, r4, 0 - adds r0, 0x20 - ldrb r0, [r0] - lsls r0, 3 - adds r0, r1 - subs r0, 0x8 - b _0804E642 -_0804E618: - mov r0, r12 - adds r0, 0x24 - adds r0, r1, r0 - ldr r1, [r0] - adds r0, r4, 0 - adds r0, 0x20 - ldrb r0, [r0] - lsls r0, 3 - adds r0, r1 - subs r0, 0x8 - b _0804E642 -_0804E62E: - mov r0, r12 - adds r0, 0x24 - adds r0, r1, r0 - ldr r1, [r0] - adds r0, r4, 0 - adds r0, 0x20 - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - subs r0, 0x10 -_0804E642: - ldrb r5, [r0, 0x2] -_0804E644: - ldr r1, =gUnknown_0831AEB8 - lsls r0, r7, 2 - adds r4, r0, r1 - ldrb r3, [r4] - ldr r0, =0x0202449c - mov r8, r0 - mov r9, r1 - ldr r1, =0x02022fec - mov r10, r1 - cmp r3, 0xFF - beq _0804E67A - adds r0, r2, r6 - lsls r0, 3 - add r0, r12 - ldrb r1, [r0, 0x1] - cmp r3, r1 - beq _0804E67A - adds r2, r0, 0 - adds r0, r4, 0 -_0804E66A: - adds r0, 0x4 - adds r7, 0x1 - ldrb r1, [r0] - cmp r1, 0xFF - beq _0804E67A - ldrb r3, [r2, 0x1] - cmp r1, r3 - bne _0804E66A -_0804E67A: - mov r0, r10 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 8 - ands r0, r1 - cmp r0, 0 - bne _0804E6B4 - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0804E6B4 - mov r3, r8 - ldr r0, [r3] - adds r0, 0x4A - ldrb r0, [r0] - lsls r0, 2 - adds r1, r5, 0 - muls r1, r0 - lsls r0, r7, 2 - add r0, r9 - ldrb r0, [r0, 0x1] - lsls r0, 1 - b _0804E6C8 - .pool -_0804E6B4: - mov r1, r8 - ldr r0, [r1] - adds r0, 0x4A - ldrb r0, [r0] - lsls r0, 2 - adds r1, r5, 0 - muls r1, r0 - lsls r0, r7, 2 - add r0, r9 - ldrb r0, [r0, 0x1] -_0804E6C8: - muls r0, r1 -_0804E6CA: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_804E598 - - thumb_func_start sub_804E6D8 -sub_804E6D8: @ 804E6D8 - push {r4,lr} - ldr r0, =0x02038bca - ldrh r0, [r0] - bl sub_804E598 - adds r4, r0, 0 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0804E6FC - ldr r0, =0x02038bcc - ldrh r0, [r0] - bl sub_804E598 - adds r4, r0 -_0804E6FC: - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - adds r1, r4, 0 - bl add_money - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x1 - strb r0, [r1, 0x1] - movs r0, 0x4 - strb r0, [r1, 0x2] - movs r0, 0x5 - strb r0, [r1, 0x3] - strb r4, [r1, 0x4] - movs r0, 0xFF - lsls r0, 8 - ands r0, r4 - lsrs r0, 8 - strb r0, [r1, 0x5] - movs r0, 0xFF - lsls r0, 16 - ands r0, r4 - lsrs r0, 16 - strb r0, [r1, 0x6] - lsrs r0, r4, 24 - strb r0, [r1, 0x7] - movs r0, 0xFF - strb r0, [r1, 0x8] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804E6D8 - - thumb_func_start atk5E_8025A70 -atk5E_8025A70: @ 804E764 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r6, =0x02024064 - strb r0, [r6] - ldr r5, =0x02024332 - ldrb r0, [r5] - mov r8, r4 - cmp r0, 0 - beq _0804E794 - cmp r0, 0x1 - beq _0804E7AC - b _0804E800 - .pool -_0804E794: - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl dp01_build_cmdbuf_x00_a_b_0 - ldrb r0, [r6] - bl dp01_battle_side_mark_buffer_for_execution - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - b _0804E800 -_0804E7AC: - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0804E800 - ldrb r0, [r6] - lsls r0, 9 - ldr r1, =0x02023868 - adds r0, r1 - mov r12, r0 - movs r2, 0 - adds r4, r6, 0 - movs r5, 0x58 - ldr r6, =0x020240a8 - adds r7, r6, 0 - subs r7, 0x18 - mov r3, r12 - adds r3, 0xC -_0804E7CE: - lsls r1, r2, 1 - ldrb r0, [r4] - muls r0, r5 - adds r1, r0 - adds r1, r7 - ldrh r0, [r3] - strh r0, [r1] - ldrb r0, [r4] - adds r1, r0, 0 - muls r1, r5 - adds r1, r2, r1 - adds r1, r6 - mov r0, r12 - adds r0, 0x24 - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r3, 0x2 - adds r2, 0x1 - cmp r2, 0x3 - ble _0804E7CE - mov r1, r8 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] -_0804E800: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk5E_8025A70 - - thumb_func_start atk5F_8025B24 -atk5F_8025B24: @ 804E818 - push {lr} - ldr r0, =0x02024064 - ldr r2, =0x0202420b - ldrb r3, [r2] - strb r3, [r0] - ldr r1, =0x0202420c - ldrb r0, [r1] - strb r0, [r2] - strb r3, [r1] - ldr r2, =0x02024280 - ldr r1, [r2] - movs r3, 0x80 - lsls r3, 5 - adds r0, r1, 0 - ands r0, r3 - cmp r0, 0 - beq _0804E854 - ldr r0, =0xffffefff - ands r1, r0 - b _0804E856 - .pool -_0804E854: - orrs r1, r3 -_0804E856: - str r1, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atk5F_8025B24 - - thumb_func_start atk60_cmd60 -atk60_cmd60: @ 804E868 - push {lr} - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0804E882 - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl sav12_xor_increment -_0804E882: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atk60_cmd60 - - thumb_func_start atk61_8025BA4 -atk61_8025BA4: @ 804E898 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x30 - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0804E94C - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r1, =0x02024064 - strb r0, [r1] - ldrb r0, [r1] - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x02024744 - mov r8, r1 - cmp r0, 0 - bne _0804E8CA - ldr r0, =0x020244ec - mov r8, r0 -_0804E8CA: - movs r7, 0 - add r6, sp, 0x4 - mov r5, sp -_0804E8D0: - movs r0, 0x64 - muls r0, r7 - mov r1, r8 - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _0804E8F4 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _0804E914 -_0804E8F4: - ldr r0, =0x0000ffff - strh r0, [r5] - movs r0, 0 - b _0804E926 - .pool -_0804E914: - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr -_0804E926: - str r0, [r6] - adds r6, 0x8 - adds r5, 0x8 - adds r7, 0x1 - cmp r7, 0x5 - ble _0804E8D0 - movs r0, 0 - mov r1, sp - movs r2, 0x1 - bl dp01_build_cmdbuf_x30_TODO - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] -_0804E94C: - add sp, 0x30 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk61_8025BA4 - - thumb_func_start atk62_08025C6C -atk62_08025C6C: @ 804E960 - push {r4,r5,lr} - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - movs r0, 0 - bl dp01_build_cmdbuf_x31_31_31_31 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r5] - adds r0, 0x2 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk62_08025C6C - - thumb_func_start atk63_jumptoattack -atk63_jumptoattack: @ 804E990 - push {r4,lr} - ldr r0, =0x02024214 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0 - beq _0804E9B4 - ldr r0, =0x020241ea - ldr r1, =0x020241ee - ldrh r1, [r1] - strh r1, [r0] - b _0804E9C2 - .pool -_0804E9B4: - ldr r2, =0x020241ec - ldr r1, =0x020241ea - ldr r0, =0x020241ee - ldrh r0, [r0] - strh r0, [r1] - strh r0, [r2] - adds r0, r1, 0 -_0804E9C2: - ldr r3, =gUnknown_082D86A8 - ldr r2, =gBattleMoves - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk63_jumptoattack - - thumb_func_start atk64_statusanimation -atk64_statusanimation: @ 804E9F4 - push {r4,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0804EA5C - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - ldr r1, =0x020242ac - ldrb r2, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x000400c0 - ands r0, r1 - cmp r0, 0 - bne _0804EA54 - ldr r0, =0x020242bc - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xA] - cmp r0, 0 - bne _0804EA54 - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0804EA54 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r2 - adds r1, 0x4C - adds r0, r1 - ldr r2, [r0] - movs r0, 0 - movs r1, 0 - bl dp01_build_cmdbuf_x1B_aaaa_b - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_0804EA54: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] -_0804EA5C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk64_statusanimation - - thumb_func_start atk65_8025D90 -atk65_8025D90: @ 804EA84 - push {r4,r5,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0804EB04 - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r5, =0x02024064 - strb r0, [r5] - ldr r1, [r4] - ldrb r3, [r1, 0x2] - ldrb r0, [r1, 0x3] - lsls r0, 8 - orrs r3, r0 - ldrb r0, [r1, 0x4] - lsls r0, 16 - orrs r3, r0 - ldrb r0, [r1, 0x5] - lsls r0, 24 - orrs r3, r0 - ldr r1, =0x020242ac - ldrb r2, [r5] - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x000400c0 - ands r0, r1 - cmp r0, 0 - bne _0804EAFC - ldr r0, =0x020242bc - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xA] - cmp r0, 0 - bne _0804EAFC - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0804EAFC - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r2, [r0] - ands r2, r3 - movs r0, 0 - movs r1, 0x1 - bl dp01_build_cmdbuf_x1B_aaaa_b - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution -_0804EAFC: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x6 - str r0, [r1] -_0804EB04: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk65_8025D90 - - thumb_func_start atk66_8025E38 -atk66_8025E38: @ 804EB2C - push {r4,r5,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _0804EB9E - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r5, =0x02024064 - strb r0, [r5] - ldr r4, [r4] - ldrb r2, [r4, 0x3] - ldrb r0, [r4, 0x4] - lsls r0, 8 - orrs r2, r0 - ldrb r0, [r4, 0x5] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r4, 0x6] - lsls r0, 24 - orrs r2, r0 - ldr r1, =0x020242ac - ldrb r3, [r5] - lsls r0, r3, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x000400c0 - ands r0, r1 - cmp r0, 0 - bne _0804EB96 - ldr r0, =0x020242bc - lsls r1, r3, 3 - subs r1, r3 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xA] - cmp r0, 0 - bne _0804EB96 - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0804EB96 - ldrb r1, [r4, 0x2] - movs r0, 0 - bl dp01_build_cmdbuf_x1B_aaaa_b - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution -_0804EB96: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x7 - str r0, [r1] -_0804EB9E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk66_8025E38 - - thumb_func_start atk67_8025ECC -atk67_8025ECC: @ 804EBC0 - push {r4,r5,lr} - sub sp, 0x4 - ldr r5, =0x02024332 - ldrb r4, [r5] - cmp r4, 0 - beq _0804EBD8 - cmp r4, 0x1 - beq _0804EC04 - b _0804EC96 - .pool -_0804EBD8: - str r4, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - ldr r0, =gUnknown_085CCABB - movs r1, 0xC - bl battle_show_message_maybe - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - strb r4, [r5, 0x1] - movs r0, 0 - bl sub_8056B74 - b _0804EC96 - .pool -_0804EC04: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0804EC2A - ldrb r0, [r5, 0x1] - cmp r0, 0 - beq _0804EC2A - movs r0, 0x5 - bl audio_play - ldrb r0, [r5, 0x1] - bl sub_8056BAC - movs r0, 0 - strb r0, [r5, 0x1] - bl sub_8056B74 -_0804EC2A: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0804EC52 - ldr r4, =0x02024332 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _0804EC52 - movs r0, 0x5 - bl audio_play - ldrb r0, [r4, 0x1] - bl sub_8056BAC - movs r0, 0x1 - strb r0, [r4, 0x1] - bl sub_8056B74 -_0804EC52: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0804EC70 - ldr r0, =0x02024332 - movs r4, 0x1 - strb r4, [r0, 0x1] - b _0804EC7A - .pool -_0804EC70: - movs r4, 0x1 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _0804EC96 -_0804EC7A: - movs r0, 0x5 - bl audio_play - str r4, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_0804EC96: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk67_8025ECC - - thumb_func_start sub_804ECA4 -sub_804ECA4: @ 804ECA4 - push {r4,r5,lr} - movs r1, 0 - ldr r2, =0x0202406c - ldr r5, =0x02024214 - ldrb r0, [r2] - cmp r1, r0 - bge _0804ECC2 - ldr r4, =0x0202407a - movs r3, 0xC -_0804ECB6: - adds r0, r1, r4 - strb r3, [r0] - adds r1, 0x1 - ldrb r0, [r2] - cmp r1, r0 - blt _0804ECB6 -_0804ECC2: - ldr r0, [r5] - adds r0, 0x1 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804ECA4 - - thumb_func_start atk69_8025FE0 -atk69_8025FE0: @ 804ECDC - push {r4-r7,lr} - ldr r7, =0x02024084 - ldr r6, =0x0202420c - ldrb r2, [r6] - movs r5, 0x58 - adds r0, r2, 0 - muls r0, r5 - adds r1, r0, r7 - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _0804ED10 - ldr r1, =0x02024404 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r4, [r0, 0x7] - ldrb r6, [r0, 0x1A] - b _0804ED2A - .pool -_0804ED10: - ldrh r0, [r1, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r4, r0, 24 - ldrb r0, [r6] - muls r0, r5 - adds r0, r7 - ldrh r0, [r0, 0x2E] - bl itemid_get_quality - lsls r0, 24 - lsrs r6, r0, 24 -_0804ED2A: - ldr r1, =0x0202420f - ldr r5, =0x0202420c - ldrb r0, [r5] - strb r0, [r1] - cmp r4, 0x27 - bne _0804ED68 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, r6 - bcs _0804ED68 - ldrb r0, [r5] - movs r1, 0x27 - bl b_history__record_item_x12_of_player - ldr r2, =0x0202437c - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] -_0804ED68: - ldr r2, =0x02024084 - ldr r3, =0x0202420c - ldrb r4, [r3] - movs r0, 0x58 - muls r0, r4 - adds r1, r2, 0 - adds r1, 0x50 - adds r0, r1 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r1, r0 - adds r5, r2, 0 - cmp r1, 0 - bne _0804EE38 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x65 - beq _0804EDBA - ldr r0, =0x0202433c - lsls r1, r4, 4 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 30 - cmp r0, 0 - blt _0804EDBA - ldr r0, =0x0202437c - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - lsrs r0, 7 - cmp r0, 0 - beq _0804EE38 -_0804EDBA: - ldrb r0, [r3] - movs r4, 0x58 - muls r0, r4 - adds r0, r5 - ldrh r1, [r0, 0x28] - ldr r2, =0x020241f0 - ldr r0, [r2] - cmp r1, r0 - bgt _0804EE38 - subs r0, r1, 0x1 - str r0, [r2] - ldr r1, =0x0202433c - ldrb r3, [r3] - lsls r0, r3, 4 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - bge _0804EE10 - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - b _0804EE38 - .pool -_0804EE10: - ldr r0, =0x0202437c - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - lsrs r0, 7 - cmp r0, 0 - beq _0804EE38 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024208 - adds r0, r3, 0 - muls r0, r4 - adds r0, r5 - ldrh r0, [r0, 0x2E] - strh r0, [r1] -_0804EE38: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk69_8025FE0 - - thumb_func_start atk6A_stash_item_for_side -atk6A_stash_item_for_side: @ 804EE58 - push {r4-r6,lr} - sub sp, 0x4 - ldr r6, =0x02024214 - ldr r0, [r6] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r5, =0x02024064 - strb r0, [r5] - ldr r1, =0x0202449c - ldrb r4, [r5] - lsls r0, r4, 1 - adds r0, 0xB8 - ldr r1, [r1] - adds r1, r0 - ldr r2, =0x02024084 - movs r3, 0x58 - adds r0, r4, 0 - muls r0, r3 - adds r0, r2 - ldrh r0, [r0, 0x2E] - strh r0, [r1] - ldrb r0, [r5] - muls r0, r3 - adds r0, r2 - movs r1, 0 - strh r1, [r0, 0x2E] - ldrb r0, [r5] - muls r0, r3 - adds r2, 0x2E - adds r0, r2 - str r0, [sp] - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - movs r3, 0x2 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r6] - adds r0, 0x2 - str r0, [r6] - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atk6A_stash_item_for_side - - thumb_func_start atk6B_end_battle_80261CC -atk6B_end_battle_80261CC: @ 804EEC8 - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x7 - strb r0, [r1, 0x1] - ldr r2, =0x0202420b - ldrb r0, [r2] - strb r0, [r1, 0x2] - ldr r3, =0x0202406e - ldrb r0, [r2] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end atk6B_end_battle_80261CC - - thumb_func_start atk6C_8026208 -atk6C_8026208: @ 804EF04 - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x02024474 - ldrb r1, [r0, 0x1E] - adds r4, r0, 0 - cmp r1, 0 - bne _0804EF28 - bl sub_804F498 - cmp r0, 0 - beq _0804EF24 - movs r0, 0x3 - b _0804EF26 - .pool -_0804EF24: - movs r0, 0x1 -_0804EF26: - strb r0, [r4, 0x1E] -_0804EF28: - ldrb r0, [r4, 0x1E] - subs r0, 0x1 - cmp r0, 0x9 - bls _0804EF32 - b _0804F0F2 -_0804EF32: - lsls r0, 2 - ldr r1, =_0804EF40 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0804EF40: - .4byte _0804EF68 - .4byte _0804EF94 - .4byte _0804EFAC - .4byte _0804F000 - .4byte _0804F014 - .4byte _0804F02C - .4byte _0804F014 - .4byte _0804F04C - .4byte _0804F07C - .4byte _0804F0C0 -_0804EF68: - ldr r1, =0x02022e1e - movs r0, 0x60 - strh r0, [r1] - movs r0, 0x2 - movs r1, 0x7 - movs r2, 0 - bl SetBgAttribute - movs r0, 0x2 - bl ShowBg - bl sub_804F17C - ldr r1, =0x02024474 - movs r0, 0x2 - strb r0, [r1, 0x1E] - b _0804F0F2 - .pool -_0804EF94: - bl sub_804F1CC - lsls r0, 24 - cmp r0, 0 - beq _0804EFA0 - b _0804F0F2 -_0804EFA0: - ldr r1, =0x02024474 - movs r0, 0x3 - strb r0, [r1, 0x1E] - b _0804F0F2 - .pool -_0804EFAC: - ldr r1, =0x02022e18 - movs r0, 0 - strh r0, [r1] - ldr r1, =0x02022e1a - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r1] - movs r0, 0 - movs r1, 0x7 - movs r2, 0x1 - bl SetBgAttribute - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0 - bl SetBgAttribute - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x80 - str r0, [sp] - movs r0, 0x12 - movs r1, 0x7 - movs r2, 0x1D - movs r3, 0x13 - bl sub_8056A3C - ldr r1, =0x02024474 - movs r0, 0x4 - strb r0, [r1, 0x1E] - b _0804F0F2 - .pool -_0804F000: - bl sub_804F100 - movs r0, 0xD - bl PutWindowTilemap - movs r0, 0xD - movs r1, 0x3 - bl CopyWindowToVram - b _0804F06A -_0804F014: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0804F0F2 - ldr r0, =0x02022e1a - strh r1, [r0] - b _0804F06A - .pool -_0804F02C: - ldr r0, =0x030022c0 - ldrh r0, [r0, 0x2E] - cmp r0, 0 - beq _0804F0F2 - movs r0, 0x5 - bl audio_play - bl sub_804F144 - movs r0, 0xD - movs r1, 0x2 - bl CopyWindowToVram - b _0804F06A - .pool -_0804F04C: - ldr r0, =0x030022c0 - ldrh r0, [r0, 0x2E] - cmp r0, 0 - beq _0804F0F2 - movs r0, 0x5 - bl audio_play - movs r0, 0x81 - str r0, [sp] - movs r0, 0x12 - movs r1, 0x7 - movs r2, 0x1D - movs r3, 0x13 - bl sub_8056A3C -_0804F06A: - ldr r1, =0x02024474 - ldrb r0, [r1, 0x1E] - adds r0, 0x1 - strb r0, [r1, 0x1E] - b _0804F0F2 - .pool -_0804F07C: - bl sub_804F344 - lsls r0, 24 - cmp r0, 0 - bne _0804F0F2 - movs r0, 0xE - bl ClearWindowTilemap - movs r0, 0xE - movs r1, 0x1 - bl CopyWindowToVram - movs r0, 0xD - bl ClearWindowTilemap - movs r0, 0xD - movs r1, 0x1 - bl CopyWindowToVram - movs r0, 0x2 - movs r1, 0x7 - movs r2, 0x2 - bl SetBgAttribute - movs r0, 0x2 - bl ShowBg - ldr r1, =0x02024474 - movs r0, 0xA - strb r0, [r1, 0x1E] - b _0804F0F2 - .pool -_0804F0C0: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0804F0F2 - movs r0, 0 - movs r1, 0x7 - movs r2, 0 - bl SetBgAttribute - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x1 - bl SetBgAttribute - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_0804F0F2: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk6C_8026208 - - thumb_func_start sub_804F100 -sub_804F100: @ 804F100 - push {lr} - sub sp, 0x14 - ldr r0, =0x0202449c - ldr r0, [r0] - ldrb r1, [r0, 0x10] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - add r1, sp, 0x8 - bl sub_81D388C - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x10] - movs r0, 0xD - str r0, [sp] - movs r0, 0xF - str r0, [sp, 0x4] - movs r0, 0xD - add r2, sp, 0x8 - movs r3, 0xE - bl sub_81D3640 - add sp, 0x14 - pop {r0} - bx r0 - .pool - thumb_func_end sub_804F100 - - thumb_func_start sub_804F144 -sub_804F144: @ 804F144 - push {lr} - sub sp, 0x10 - ldr r0, =0x0202449c - ldr r0, [r0] - ldrb r1, [r0, 0x10] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - add r1, sp, 0x4 - bl sub_81D388C - movs r0, 0xF - str r0, [sp] - movs r0, 0xD - add r1, sp, 0x4 - movs r2, 0xE - movs r3, 0xD - bl sub_81D3784 - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end sub_804F144 - - thumb_func_start sub_804F17C -sub_804F17C: @ 804F17C - push {lr} - ldr r1, =0x02022e1e - movs r0, 0 - strh r0, [r1] - ldr r1, =0x02022e1c - movs r2, 0xD0 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r1] - ldr r0, =gUnknown_0831C2C8 - movs r1, 0x60 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =gUnknown_0831C2E8 - movs r0, 0xE - movs r2, 0 - movs r3, 0 - bl CopyToWindowPixelBuffer - movs r0, 0xE - bl PutWindowTilemap - movs r0, 0xE - movs r1, 0x3 - bl CopyWindowToVram - bl sub_804F384 - pop {r0} - bx r0 - .pool - thumb_func_end sub_804F17C - - thumb_func_start sub_804F1CC -sub_804F1CC: @ 804F1CC - push {r4,r5,lr} - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _0804F1DC - movs r0, 0x1 - b _0804F216 -_0804F1DC: - ldr r4, =0x02022e1c - ldrh r1, [r4] - movs r5, 0x80 - lsls r5, 2 - cmp r1, r5 - bne _0804F1F0 - movs r0, 0 - b _0804F216 - .pool -_0804F1F0: - movs r0, 0xD0 - lsls r0, 1 - cmp r1, r0 - bne _0804F1FC - bl sub_804F220 -_0804F1FC: - ldrh r0, [r4] - adds r0, 0x8 - strh r0, [r4] - lsls r0, 16 - ldr r1, =0x01ff0000 - cmp r0, r1 - bls _0804F20C - strh r5, [r4] -_0804F20C: - ldrh r1, [r4] - eors r1, r5 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 -_0804F216: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_804F1CC - - thumb_func_start sub_804F220 -sub_804F220: @ 804F220 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - ldr r6, =0x0202449c - ldr r0, [r6] - ldrb r0, [r0, 0x10] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - movs r1, 0x38 - bl pokemon_getattr - mov r8, r0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r0, [r6] - ldrb r0, [r0, 0x10] - muls r0, r5 - adds r0, r4 - bl pokemon_get_gender - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, [r6] - ldrb r0, [r0, 0x10] - muls r0, r5 - adds r0, r4 - ldr r5, =0x02021fc4 - adds r1, r5, 0 - bl GetMonNickname - str r5, [sp] - mov r2, sp - movs r1, 0 - movs r0, 0xE - strb r0, [r2, 0x4] - mov r0, sp - strb r1, [r0, 0x5] - movs r4, 0x20 - strb r4, [r0, 0x6] - strb r1, [r0, 0x7] - strb r4, [r0, 0x8] - strb r1, [r0, 0x9] - strb r1, [r0, 0xA] - strb r1, [r0, 0xB] - mov r3, sp - ldrb r2, [r3, 0xC] - subs r1, 0x10 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0xC] - mov r2, sp - movs r0, 0x10 - strb r0, [r2, 0xC] - ldrb r0, [r2, 0xD] - ands r1, r0 - strb r1, [r2, 0xD] - mov r0, sp - strb r4, [r0, 0xD] - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - movs r0, 0xF9 - strb r0, [r5] - adds r5, 0x1 - movs r0, 0x5 - strb r0, [r5] - adds r5, 0x1 - adds r4, r5, 0 - adds r0, r4, 0 - mov r1, r8 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r5, r0, 0 - subs r4, r5, r4 - movs r2, 0x4 - subs r2, r4 - lsls r2, 16 - lsrs r2, 16 - movs r1, 0x77 - bl RepeatChar - adds r5, r0, 0 - cmp r7, 0xFF - beq _0804F320 - cmp r7, 0 - bne _0804F300 - movs r1, 0 - movs r2, 0xC - bl WriteColorChangeControlCode - adds r5, r0, 0 - movs r1, 0x1 - movs r2, 0xD - bl WriteColorChangeControlCode - adds r5, r0, 0 - movs r0, 0xB5 - b _0804F318 - .pool -_0804F300: - adds r0, r5, 0 - movs r1, 0 - movs r2, 0xE - bl WriteColorChangeControlCode - adds r5, r0, 0 - movs r1, 0x1 - movs r2, 0xF - bl WriteColorChangeControlCode - adds r5, r0, 0 - movs r0, 0xB6 -_0804F318: - strb r0, [r5] - adds r5, 0x1 - movs r0, 0xFF - strb r0, [r5] -_0804F320: - mov r0, sp - movs r1, 0xA - strb r1, [r0, 0x7] - strb r1, [r0, 0x9] - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - movs r0, 0xE - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_804F220 - - thumb_func_start sub_804F344 -sub_804F344: @ 804F344 - push {lr} - ldr r0, =0x02022e1c - ldrh r1, [r0] - movs r3, 0xD0 - lsls r3, 1 - adds r2, r0, 0 - cmp r1, r3 - bne _0804F35C - movs r0, 0 - b _0804F380 - .pool -_0804F35C: - ldrh r0, [r2] - adds r1, r0, 0 - subs r1, 0x10 - ldr r0, =0x0000019f - cmp r1, r0 - bgt _0804F370 - strh r3, [r2] - b _0804F372 - .pool -_0804F370: - strh r1, [r2] -_0804F372: - ldrh r1, [r2] - movs r0, 0xD0 - lsls r0, 1 - eors r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 -_0804F380: - pop {r1} - bx r1 - thumb_func_end sub_804F344 - - thumb_func_start sub_804F384 -sub_804F384: @ 804F384 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x10 - ldr r0, =0x0202449c - mov r8, r0 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - movs r1, 0xB - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r1, r8 - ldr r0, [r1] - ldrb r0, [r0, 0x10] - muls r0, r6 - adds r0, r5 - movs r1, 0 - bl pokemon_getattr - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0x1 - bl sub_80D2EDC - str r0, [sp] - ldr r5, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r5 - movs r1, 0x80 - lsls r1, 2 - orrs r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - ldr r1, =0xd75a0000 - orrs r0, r1 - str r0, [sp, 0x4] - adds r0, r4, 0 - bl sub_80D30B0 - str r0, [sp, 0x8] - add r4, sp, 0x8 - ldr r0, [r4, 0x4] - ands r0, r5 - ldr r1, =0x0000d75a - orrs r0, r1 - str r0, [r4, 0x4] - mov r0, sp - bl LoadObjectPic - adds r0, r4, 0 - bl LoadTaggedObjectPalette - ldr r0, =gUnknown_0831C3C0 - movs r1, 0x80 - lsls r1, 1 - movs r2, 0xA - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0 - strh r0, [r1, 0x2E] - ldr r0, =0x02022e1c - ldrh r0, [r0] - strh r0, [r1, 0x30] - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804F384 - - thumb_func_start sub_804F450 -sub_804F450: @ 804F450 - push {r4,lr} - adds r2, r0, 0 - ldr r0, =0x02022e1c - ldrh r1, [r2, 0x30] - ldrh r0, [r0] - subs r1, r0 - strh r1, [r2, 0x24] - lsls r1, 16 - cmp r1, 0 - beq _0804F470 - movs r0, 0x1 - strh r0, [r2, 0x2E] - b _0804F48C - .pool -_0804F470: - movs r1, 0x2E - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _0804F48C - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles - ldr r4, =0x0000d75a - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag -_0804F48C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804F450 - - thumb_func_start sub_804F498 -sub_804F498: @ 804F498 - push {lr} - ldr r3, =0x0202406e - ldr r0, =0x0202449c - ldr r0, [r0] - ldrh r1, [r3] - ldrb r2, [r0, 0x10] - cmp r1, r2 - beq _0804F4BA - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0804F4CC - ldrh r0, [r3, 0x4] - cmp r0, r2 - bne _0804F4CC -_0804F4BA: - movs r0, 0x1 - b _0804F4CE - .pool -_0804F4CC: - movs r0, 0 -_0804F4CE: - pop {r1} - bx r1 - thumb_func_end sub_804F498 - - thumb_func_start sub_804F4D4 -sub_804F4D4: @ 804F4D4 - push {lr} - bl sub_803F988 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_804F4D4 - - thumb_func_start atk6E_state0_side_becomes_attacker -atk6E_state0_side_becomes_attacker: @ 804F4EC - push {lr} - movs r0, 0 - bl battle_get_side_with_given_state - ldr r1, =0x0202420b - strb r0, [r1] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atk6E_state0_side_becomes_attacker - - thumb_func_start atk6F_8026810 -atk6F_8026810: @ 804F50C - push {r4,r5,lr} - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - movs r0, 0 - movs r1, 0 - bl dp01_build_cmdbuf_x33_a_33_33 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r5] - adds r0, 0x2 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk6F_8026810 - - thumb_func_start atk70_record_ability_usage_of_side -atk70_record_ability_usage_of_side: @ 804F540 - push {r4,lr} - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r1, =0x02024064 - strb r0, [r1] - ldrb r0, [r1] - ldr r1, =0x0202420a - ldrb r1, [r1] - bl b_history__record_ability_usage_of_player - ldr r0, [r4] - adds r0, 0x1 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk70_record_ability_usage_of_side - - thumb_func_start sub_804F574 -sub_804F574: @ 804F574 - ldr r2, =0x02022f68 - movs r0, 0xFD - strb r0, [r2] - movs r0, 0x2 - strb r0, [r2, 0x1] - ldr r0, =0x020244e2 - ldrh r1, [r0] - strb r1, [r2, 0x2] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - lsrs r0, 8 - strb r0, [r2, 0x3] - movs r0, 0xFF - strb r0, [r2, 0x4] - bx lr - .pool - thumb_func_end sub_804F574 - - thumb_func_start atk71_80268A0 -atk71_80268A0: @ 804F59C - push {lr} - bl sub_804F574 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atk71_80268A0 - - thumb_func_start atk72_flee -atk72_flee: @ 804F5B4 - push {lr} - ldr r0, =0x0202420d - ldrb r0, [r0] - bl sub_803EC20 - lsls r0, 24 - cmp r0, 0 - beq _0804F5E8 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0804F5F0 - .pool -_0804F5E8: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_0804F5F0: - pop {r0} - bx r0 - .pool - thumb_func_end atk72_flee - - thumb_func_start atk73_cmd73 -atk73_cmd73: @ 804F5F8 - push {r4-r6,lr} - ldr r0, =0x02022fec - ldr r4, [r0] - movs r6, 0x1 - ands r4, r6 - cmp r4, 0 - bne _0804F68E - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r1, =0x02024064 - strb r0, [r1] - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02024084 - movs r1, 0x58 - muls r1, r0 - adds r1, r2 - ldrh r5, [r1, 0x28] - movs r0, 0x64 - muls r0, r5 - ldrh r1, [r1, 0x2C] - bl __divsi3 - cmp r0, 0 - bne _0804F636 - movs r0, 0x1 -_0804F636: - cmp r0, 0x45 - bgt _0804F63E - cmp r5, 0 - bne _0804F65C -_0804F63E: - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0xB1 - strb r4, [r0] - b _0804F68E - .pool -_0804F65C: - cmp r0, 0x27 - ble _0804F670 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0xB1 - strb r6, [r0] - b _0804F68E - .pool -_0804F670: - cmp r0, 0x9 - ble _0804F684 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0xB1 - movs r1, 0x2 - b _0804F68C - .pool -_0804F684: - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0xB1 - movs r1, 0x3 -_0804F68C: - strb r1, [r0] -_0804F68E: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atk73_cmd73 - - thumb_func_start atk74_hp_tresholds_2 -atk74_hp_tresholds_2: @ 804F6A4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x02022fec - ldr r7, [r0] - movs r0, 0x1 - mov r8, r0 - ands r7, r0 - cmp r7, 0 - bne _0804F73E - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - adds r4, r0, 0 - ldr r0, =0x02024064 - strb r4, [r0] - movs r0, 0x1 - eors r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x0202449c - ldr r6, [r1] - lsrs r0, 23 - adds r0, r6 - adds r0, 0xA8 - ldrb r5, [r0] - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r4 - adds r0, r1 - ldrh r4, [r0, 0x28] - subs r1, r5, r4 - movs r0, 0x64 - muls r0, r1 - adds r1, r5, 0 - bl __divsi3 - adds r1, r0, 0 - cmp r4, r5 - bcc _0804F71C - adds r0, r6, 0 - adds r0, 0xB1 - strb r7, [r0] - b _0804F73E - .pool -_0804F71C: - cmp r0, 0x1D - bgt _0804F72A - adds r0, r6, 0 - adds r0, 0xB1 - mov r1, r8 - strb r1, [r0] - b _0804F73E -_0804F72A: - cmp r1, 0x45 - bgt _0804F736 - adds r1, r6, 0 - adds r1, 0xB1 - movs r0, 0x2 - b _0804F73C -_0804F736: - adds r1, r6, 0 - adds r1, 0xB1 - movs r0, 0x3 -_0804F73C: - strb r0, [r1] -_0804F73E: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk74_hp_tresholds_2 - - thumb_func_start atk75_8026A58 -atk75_8026A58: @ 804F754 - push {lr} - sub sp, 0x4 - ldr r2, =0x020244b8 - ldr r1, =0x0202420b - ldrb r0, [r1] - strb r0, [r2] - ldr r2, =0x0202406e - ldrb r0, [r1] - lsls r0, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r1, =0x02024744 - adds r0, r1 - ldr r1, =0x02024208 - ldrh r1, [r1] - lsls r2, 24 - lsrs r2, 24 - movs r3, 0x1 - str r3, [sp] - movs r3, 0 - bl ExecuteTableBasedItemEffect - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end atk75_8026A58 - - thumb_func_start sub_804F7AC -sub_804F7AC: @ 804F7AC - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r1, =0x02024064 - strb r0, [r1] - ldr r0, [r4] - ldrb r0, [r0, 0x2] - cmp r0, 0x1A - bls _0804F7CA - b _0804FD70 -_0804F7CA: - lsls r0, 2 - ldr r1, =_0804F7E0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0804F7E0: - .4byte _0804F84C - .4byte _0804F85C - .4byte _0804F8BC - .4byte _0804F8CC - .4byte _0804F8E4 - .4byte _0804F920 - .4byte _0804F958 - .4byte _0804F9E0 - .4byte _0804FA20 - .4byte _0804FACC - .4byte _0804FAE8 - .4byte _0804FB3C - .4byte _0804FB94 - .4byte _0804FC18 - .4byte _0804FC2C - .4byte _0804FC32 - .4byte _0804FC38 - .4byte _0804FC60 - .4byte _0804FC6A - .4byte _0804FC78 - .4byte _0804FC8C - .4byte _0804FCC4 - .4byte _0804FCD8 - .4byte _0804FCF0 - .4byte _0804FD1C - .4byte _0804FD30 - .4byte _0804FD5C -_0804F84C: - ldr r0, =0x02024064 - ldrb r0, [r0] - bl b_cancel_multi_turn_move_maybe - b _0804FD70 - .pool -_0804F85C: - ldr r1, =0x0202420b - ldr r4, =0x0202420c - ldrb r0, [r4] - strb r0, [r1] - ldrb r0, [r1] - bl battle_side_get_owner - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02024294 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r2, r1, r2 - ldrb r0, [r2, 0x8] - cmp r0, 0 - beq _0804F8A8 - ldr r1, =0x02024084 - ldrb r2, [r2, 0x9] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _0804F8A8 - strb r2, [r4] - b _0804FD70 - .pool -_0804F8A8: - ldr r0, =0x0202420c - ldr r1, =0x02024064 - ldrb r1, [r1] - strb r1, [r0] - b _0804FD70 - .pool -_0804F8BC: - bl sub_803BB88 - ldr r1, =0x02024332 - strb r0, [r1] - b _0804FD70 - .pool -_0804F8CC: - ldr r0, =0x020241ea - ldrh r0, [r0] - movs r1, 0 - bl sub_80458E0 - ldr r1, =0x0202420c - strb r0, [r1] - b _0804FD70 - .pool -_0804F8E4: - ldr r2, =0x02024280 - ldr r1, =gUnknown_0832A328 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - lsls r0, 28 - ldr r2, [r2] - ands r2, r0 - cmp r2, 0 - beq _0804F914 - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1] - b _0804FD70 - .pool -_0804F914: - ldr r0, =0x02024332 - strb r2, [r0] - b _0804FD70 - .pool -_0804F920: - ldr r4, =0x0202437c - ldr r3, =0x02024064 - ldrb r0, [r3] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldrb r0, [r3] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r2, [r1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - b _0804FD70 - .pool -_0804F958: - ldr r4, =0x0202406e - ldr r1, =0x0202449c - ldr r0, [r1] - ldrh r3, [r4] - ldrb r2, [r0, 0x10] - adds r6, r1, 0 - cmp r3, r2 - beq _0804F974 - ldrh r0, [r4, 0x4] - cmp r0, r2 - beq _0804F970 - b _0804FD70 -_0804F970: - cmp r3, r0 - bne _0804F988 -_0804F974: - ldr r1, =0x02024064 - movs r0, 0 - b _0804F98C - .pool -_0804F988: - ldr r1, =0x02024064 - movs r0, 0x2 -_0804F98C: - strb r0, [r1] - adds r5, r1, 0 - ldrb r2, [r5] - lsls r0, r2, 1 - adds r0, 0xC8 - ldr r1, [r6] - adds r4, r1, r0 - movs r3, 0 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r2 - adds r1, 0xC - adds r0, r1 - ldrh r0, [r0] - ldrh r2, [r4] - cmp r0, r2 - beq _0804F9CC - adds r6, r5, 0 - movs r5, 0x58 - adds r2, r1, 0 -_0804F9B4: - adds r3, 0x1 - cmp r3, 0x3 - bgt _0804F9CC - lsls r1, r3, 1 - ldrb r0, [r6] - muls r0, r5 - adds r1, r0 - adds r1, r2 - ldrh r0, [r1] - ldrh r1, [r4] - cmp r0, r1 - bne _0804F9B4 -_0804F9CC: - cmp r3, 0x4 - beq _0804F9D2 - b _0804FD70 -_0804F9D2: - movs r0, 0 - strh r0, [r4] - b _0804FD70 - .pool -_0804F9E0: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0xB - ands r0, r1 - cmp r0, 0x8 - beq _0804F9EE - b _0804FD70 -_0804F9EE: - ldr r1, =0x02024084 - ldrh r0, [r1, 0x28] - cmp r0, 0 - bne _0804F9F8 - b _0804FD70 -_0804F9F8: - adds r0, r1, 0 - adds r0, 0x80 - ldrh r0, [r0] - cmp r0, 0 - bne _0804FA04 - b _0804FD70 -_0804FA04: - ldr r0, =0x02024280 - ldr r1, [r0] - ldr r2, =0xffbfffff - ands r1, r2 - str r1, [r0] - b _0804FD70 - .pool -_0804FA20: - ldr r2, =0x02024332 - mov r8, r2 - movs r0, 0 - strb r0, [r2] - ldr r1, =0x02024474 - ldr r6, =0x02024064 - ldrb r0, [r2, 0x1] - strb r0, [r6] - strb r0, [r1, 0x17] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r7, r0, 0 - adds r7, 0x92 - ldrb r3, [r7] - ldr r1, =gUnknown_0832A328 - ldrb r2, [r6] - lsls r0, r2, 2 - adds r0, r1 - ldr r5, [r0] - adds r0, r3, 0 - ands r0, r5 - cmp r0, 0 - beq _0804FA50 - b _0804FD70 -_0804FA50: - ldr r4, =0x02024084 - movs r0, 0x58 - mov r12, r0 - mov r1, r12 - muls r1, r2 - adds r2, r1, 0 - adds r1, r2, r4 - ldrh r0, [r1, 0x2C] - lsrs r0, 1 - ldrh r1, [r1, 0x28] - cmp r0, r1 - bcs _0804FA6A - b _0804FD70 -_0804FA6A: - cmp r1, 0 - bne _0804FA70 - b _0804FD70 -_0804FA70: - adds r0, r4, 0 - adds r0, 0x4C - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _0804FA82 - b _0804FD70 -_0804FA82: - orrs r3, r5 - strb r3, [r7] - movs r0, 0x1 - mov r2, r8 - strb r0, [r2] - ldrb r0, [r6] - mov r1, r12 - muls r1, r0 - adds r0, r1, 0 - adds r1, r4, 0 - adds r1, 0x48 - adds r0, r1 - ldr r0, [r0] - bl GetNatureFromPersonality - ldr r1, =gUnknown_0831C4F8 - lsls r0, 24 - lsrs r0, 24 - adds r0, r1 - ldrb r0, [r0] - mov r2, r8 - strb r0, [r2, 0x5] - b _0804FD70 - .pool -_0804FACC: - ldr r4, =0x02024332 - adds r0, r4, 0 - bl sub_81A5258 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - bne _0804FADE - b _0804FD78 -_0804FADE: - strb r3, [r4, 0x1] - b _0804FD70 - .pool -_0804FAE8: - ldr r0, =0x02024084 - adds r0, 0x80 - movs r1, 0 - strh r1, [r0] - ldr r2, =0x02024280 - ldr r3, =gUnknown_0832A328 - ldr r1, [r3, 0x4] - lsls r1, 28 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - ldr r0, =0x0202449c - ldr r2, [r0] - ldr r0, =0x000002a1 - adds r2, r0 - ldr r0, =0x0202406e - ldrh r0, [r0, 0x2] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x020242bc - adds r1, 0x34 - ldrb r0, [r1] - movs r2, 0x2 - b _0804FBF4 - .pool -_0804FB3C: - ldr r1, =0x02024084 - movs r0, 0 - strh r0, [r1, 0x28] - ldr r2, =0x02024280 - ldr r3, =gUnknown_0832A328 - ldr r1, [r3] - lsls r1, 28 - ldr r0, [r2] - orrs r0, r1 - movs r1, 0x80 - lsls r1, 15 - orrs r0, r1 - str r0, [r2] - ldr r0, =0x0202449c - ldr r2, [r0] - movs r1, 0xA8 - lsls r1, 2 - adds r2, r1 - ldr r0, =0x0202406e - ldrh r0, [r0] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldr r2, =0x020242bc - ldrb r0, [r2, 0x18] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2, 0x18] - b _0804FD70 - .pool -_0804FB94: - ldr r0, =0x02024084 - movs r1, 0 - strh r1, [r0, 0x28] - adds r0, 0x80 - strh r1, [r0] - ldr r2, =0x02024280 - ldr r3, =gUnknown_0832A328 - ldr r0, [r3] - lsls r0, 28 - ldr r1, [r2] - orrs r1, r0 - ldr r0, [r3, 0x4] - lsls r0, 28 - orrs r1, r0 - movs r0, 0x80 - lsls r0, 15 - orrs r1, r0 - str r1, [r2] - ldr r5, =0x0202449c - ldr r2, [r5] - movs r0, 0xA8 - lsls r0, 2 - adds r2, r0 - ldr r4, =0x0202406e - ldrh r0, [r4] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldr r2, [r5] - ldr r1, =0x000002a1 - adds r2, r1 - ldrh r0, [r4, 0x2] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x020242bc - ldrb r0, [r1, 0x18] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r1, 0x18] - adds r1, 0x34 - ldrb r0, [r1] -_0804FBF4: - orrs r0, r2 - strb r0, [r1] - b _0804FD70 - .pool -_0804FC18: - movs r0, 0 - bl sub_8033E10 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - b _0804FD70 - .pool -_0804FC2C: - bl sub_81A5BF8 - b _0804FD70 -_0804FC32: - bl sub_81A5D44 - b _0804FD70 -_0804FC38: - ldr r1, =gUnknown_085CD1C8 - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl get_battle_strings_ - ldr r0, =0x02022e2c - movs r1, 0x16 - bl battle_show_message_maybe - b _0804FD70 - .pool -_0804FC60: - movs r0, 0x16 - bl IsTextPrinterActive - lsls r0, 16 - b _0804FD24 -_0804FC6A: - bl sub_80A3678 - lsls r0, 24 - cmp r0, 0 - bne _0804FC76 - b _0804FD78 -_0804FC76: - b _0804FD70 -_0804FC78: - ldr r4, =0x02024064 - movs r0, 0x1 - strb r0, [r4] - ldr r0, =0x02024084 - adds r0, 0x58 - b _0804FCA2 - .pool -_0804FC8C: - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r0, 0x3 - bls _0804FD70 - ldr r4, =0x02024064 - movs r0, 0x3 - strb r0, [r4] - ldr r0, =0x02024084 - movs r2, 0x84 - lsls r2, 1 - adds r0, r2 -_0804FCA2: - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _0804FD70 - movs r0, 0 - movs r1, 0 - bl dp01_build_cmdbuf_x06_a - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _0804FD70 - .pool -_0804FCC4: - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x55 - bl MPlayVolumeControl - b _0804FD70 - .pool -_0804FCD8: - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl - b _0804FD70 - .pool -_0804FCF0: - ldr r0, =0x0202449c - ldr r2, [r0] - ldr r0, =0x000002a2 - adds r2, r0 - ldr r1, =gUnknown_0832A328 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - b _0804FD70 - .pool -_0804FD1C: - ldr r0, =0x02024064 - ldrb r0, [r0] - bl sub_805725C -_0804FD24: - cmp r0, 0 - bne _0804FD78 - b _0804FD70 - .pool -_0804FD30: - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0804FD50 - ldr r1, =0x0202433a - movs r0, 0x5 - strb r0, [r1] - b _0804FD70 - .pool -_0804FD50: - ldr r1, =0x0202433a - movs r0, 0xA - strb r0, [r1] - b _0804FD70 - .pool -_0804FD5C: - movs r1, 0xCE - lsls r1, 1 - movs r0, 0 - movs r2, 0x1 - bl sub_8034300 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution -_0804FD70: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x3 - str r0, [r1] -_0804FD78: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_804F7AC - - thumb_func_start atk77_setprotect -atk77_setprotect: @ 804FD8C - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r6, 0x1 - ldr r2, =0x02024260 - ldr r1, =0x0202420b - ldrb r3, [r1] - lsls r0, r3, 1 - adds r0, r2 - ldrh r0, [r0] - mov r8, r1 - ldr r7, =0x020242bc - cmp r0, 0xB6 - beq _0804FDBC - cmp r0, 0xC5 - beq _0804FDBC - cmp r0, 0xCB - beq _0804FDBC - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r7 - movs r1, 0 - strb r1, [r0, 0x8] -_0804FDBC: - ldr r0, =0x02024082 - ldrb r1, [r0] - ldr r0, =0x0202406c - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bne _0804FDCC - movs r6, 0 -_0804FDCC: - ldr r2, =gUnknown_0831C3D8 - mov r5, r8 - ldrb r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r7 - ldrb r4, [r0, 0x8] - lsls r4, 1 - adds r4, r2 - bl GenerateRandomNumber - ldrh r1, [r4] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - bcc _0804FE80 - cmp r6, 0 - beq _0804FE80 - ldr r4, =gBattleMoves - ldr r3, =0x020241ea - ldrh r0, [r3] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r1] - cmp r0, 0x6F - bne _0804FE1C - ldr r0, =0x0202433c - ldrb r1, [r5] - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x1 - orrs r0, r2 - strb r0, [r1] - ldr r1, =0x02024332 - movs r0, 0 - strb r0, [r1, 0x5] -_0804FE1C: - ldrh r0, [r3] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r1] - cmp r0, 0x74 - bne _0804FE42 - ldr r0, =0x0202433c - ldrb r1, [r5] - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r1] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] -_0804FE42: - mov r1, r8 - ldrb r0, [r1] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r7 - ldrb r0, [r1, 0x8] - adds r0, 0x1 - strb r0, [r1, 0x8] - b _0804FEA2 - .pool -_0804FE80: - ldr r2, =0x020242bc - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strb r1, [r0, 0x8] - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1, 0x5] - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] -_0804FEA2: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk77_setprotect - - thumb_func_start atk78_faintifabilitynotdamp -atk78_faintifabilitynotdamp: @ 804FEC8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x02024068 - ldr r2, [r0] - cmp r2, 0 - bne _0804FFCC - ldr r1, =0x0202420c - strb r2, [r1] - ldr r0, =0x0202406c - ldrb r3, [r0] - adds r5, r1, 0 - mov r8, r0 - ldr r6, =0x02024084 - cmp r2, r3 - bcs _0804FF14 - adds r0, r6, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x6 - beq _0804FF14 - adds r2, r3, 0 - adds r4, r6, 0 - movs r3, 0x58 -_0804FEF8: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, r2 - bcs _0804FF14 - ldrb r0, [r5] - muls r0, r3 - adds r0, r4 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x6 - bne _0804FEF8 -_0804FF14: - ldrb r0, [r5] - mov r1, r8 - ldrb r1, [r1] - cmp r0, r1 - bne _0804FFB0 - ldr r4, =0x02024064 - ldr r7, =0x0202420b - ldrb r0, [r7] - strb r0, [r4] - ldr r2, =0x020241f0 - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - adds r0, r6 - ldrh r0, [r0, 0x28] - str r0, [r2] - ldr r1, =0x00007fff - movs r0, 0 - bl dp01_build_cmdbuf_x18_0_aa_health_bar_update - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - movs r0, 0 - strb r0, [r5] - mov r2, r8 - ldrb r0, [r2] - cmp r0, 0 - beq _0804FFCC - adds r3, r5, 0 - ldrb r5, [r7] - ldr r7, =gUnknown_0832A328 - adds r4, r0, 0 - ldr r6, =0x02024210 -_0804FF60: - ldrb r2, [r3] - cmp r2, r5 - beq _0804FF76 - ldrb r0, [r6] - ldrb r1, [r3] - lsls r1, 2 - adds r1, r7 - ldr r1, [r1] - ands r0, r1 - cmp r0, 0 - beq _0804FFCC -_0804FF76: - adds r0, r2, 0x1 - strb r0, [r3] - lsls r0, 24 - lsrs r0, 24 - cmp r0, r4 - bcc _0804FF60 - b _0804FFCC - .pool -_0804FFB0: - ldr r1, =0x0202420a - movs r0, 0x6 - strb r0, [r1] - ldrb r0, [r5] - movs r1, 0x58 - muls r1, r0 - adds r1, r6 - adds r1, 0x20 - ldrb r1, [r1] - bl b_history__record_ability_usage_of_player - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB560 - str r0, [r1] -_0804FFCC: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk78_faintifabilitynotdamp - - thumb_func_start atk79_setuserhptozero -atk79_setuserhptozero: @ 804FFE4 - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x02024068 - ldr r3, [r0] - cmp r3, 0 - bne _08050028 - ldr r4, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r4] - ldr r1, =0x02024084 - ldrb r0, [r4] - movs r2, 0x58 - muls r0, r2 - adds r0, r1 - strh r3, [r0, 0x28] - ldrb r0, [r4] - muls r0, r2 - adds r1, 0x28 - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x2A - movs r2, 0 - movs r3, 0x2 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_08050028: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk79_setuserhptozero - - thumb_func_start sub_8050044 -sub_8050044: @ 8050044 - push {r4-r7,lr} - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r4, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r4, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r4, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r4, r0 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - adds r7, r3, 0 - cmp r0, 0 - beq _080500DC - ldr r0, =0x0202420c - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - ldr r2, =0x0202420b - lsls r1, 24 - lsrs r1, 24 - adds r3, r0, 0 - ldr r6, =0x02024210 - ldr r5, =gUnknown_0832A328 - ldr r0, =0x0202406c - mov r12, r0 - ldrb r0, [r2] - cmp r1, r0 - bne _0805009A -_0805008A: - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r2] - cmp r0, r1 - beq _0805008A -_0805009A: - ldrb r0, [r6] - ldrb r1, [r3] - lsls r1, 2 - adds r1, r5 - ldr r1, [r1] - ands r0, r1 - cmp r0, 0 - bne _0805008A - ldrb r0, [r3] - mov r2, r12 - ldrb r2, [r2] - cmp r0, r2 - bcc _080500D8 - ldr r0, [r7] - adds r0, 0x5 - str r0, [r7] - b _080500E0 - .pool -_080500D8: - str r4, [r7] - b _080500E0 -_080500DC: - adds r0, r2, 0x5 - str r0, [r3] -_080500E0: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8050044 - - thumb_func_start sub_80500E8 -sub_80500E8: @ 80500E8 - push {r4-r6,lr} - ldr r4, =0x02024214 - ldr r1, [r4] - ldrb r2, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - orrs r2, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - orrs r2, r0 - ldrb r0, [r1, 0x5] - ldr r3, =0x0202420c - cmp r0, 0x1 - bne _08050110 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r3] -_08050110: - ldr r1, =0x020241f0 - ldr r6, =0x02024084 - ldrb r0, [r3] - movs r5, 0x58 - muls r0, r5 - adds r0, r6 - ldrh r0, [r0, 0x2C] - lsrs r0, 1 - str r0, [r1] - cmp r0, 0 - bne _0805012A - movs r0, 0x1 - str r0, [r1] -_0805012A: - ldr r0, [r1] - negs r0, r0 - str r0, [r1] - ldrb r0, [r3] - muls r0, r5 - adds r0, r6 - ldrh r1, [r0, 0x28] - ldrh r0, [r0, 0x2C] - cmp r1, r0 - bne _08050158 - str r2, [r4] - b _0805015E - .pool -_08050158: - ldr r0, [r4] - adds r0, 0x6 - str r0, [r4] -_0805015E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80500E8 - - thumb_func_start sub_8050164 -sub_8050164: @ 8050164 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r2, =0x0202406c - ldr r0, =0x0202420b - mov r10, r0 - movs r1, 0 - add r0, sp, 0x4 -_0805017A: - strh r1, [r0] - subs r0, 0x2 - cmp r0, sp - bge _0805017A - movs r1, 0 - mov r8, r1 - movs r5, 0 - ldrb r1, [r2] - cmp r5, r1 - bge _080501D0 - ldr r0, =0x0202420b - ldrb r6, [r0] - ldr r2, =0x0000ffff - mov r9, r2 - lsls r4, r6, 3 - mov r2, sp - ldr r0, =0x0202449c - mov r12, r0 - adds r7, r1, 0 -_080501A0: - cmp r5, r6 - beq _080501C8 - mov r1, r12 - ldr r0, [r1] - adds r0, r4, r0 - adds r1, r0, 0 - adds r1, 0xE0 - ldrb r3, [r1] - adds r0, 0xE1 - ldrb r0, [r0] - lsls r0, 8 - orrs r3, r0 - cmp r3, 0 - beq _080501C8 - cmp r3, r9 - beq _080501C8 - strh r3, [r2] - adds r2, 0x2 - movs r0, 0x1 - add r8, r0 -_080501C8: - adds r4, 0x2 - adds r5, 0x1 - cmp r5, r7 - blt _080501A0 -_080501D0: - mov r1, r10 - ldrb r0, [r1] - ldr r2, =0x0202449c - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r1, r0, 0 - adds r1, 0x98 - ldrb r3, [r1] - adds r0, 0x99 - ldrb r0, [r0] - lsls r0, 8 - orrs r3, r0 - cmp r3, 0 - beq _08050220 - ldr r0, =0x0000ffff - cmp r3, r0 - beq _08050220 - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xfffffbff - ands r0, r1 - str r0, [r2] - ldr r4, =0x020241ea - strh r3, [r4] - b _0805024A - .pool -_08050220: - mov r0, r8 - cmp r0, 0 - beq _08050290 - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xfffffbff - ands r0, r1 - str r0, [r2] - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - mov r1, r8 - bl __modsi3 - adds r5, r0, 0 - ldr r4, =0x020241ea - lsls r0, r5, 1 - add r0, sp - ldrh r0, [r0] - strh r0, [r4] -_0805024A: - ldrh r0, [r4] - movs r1, 0 - bl sub_80458E0 - ldr r1, =0x0202420c - strb r0, [r1] - ldr r5, =0x02024214 - ldr r3, =gUnknown_082D86A8 - ldr r2, =gBattleMoves - ldrh r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - str r0, [r5] - b _080502AE - .pool -_08050290: - ldr r2, =0x0202437c - mov r0, r10 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_080502AE: - 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_8050164 - - thumb_func_start sub_80502C8 -sub_80502C8: @ 80502C8 - push {lr} - ldr r2, =0x020243cc - ldrh r0, [r2] - movs r1, 0x7 - ands r1, r0 - cmp r1, 0 - beq _080502F4 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1, 0x5] - b _08050304 - .pool -_080502F4: - movs r0, 0x1 - strh r0, [r2] - ldr r0, =0x02024332 - strb r1, [r0, 0x5] - ldr r0, =0x020243d0 - adds r0, 0x28 - movs r1, 0x5 - strb r1, [r0] -_08050304: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80502C8 - - thumb_func_start atk7E_setreflect -atk7E_setreflect: @ 805031C - push {r4-r6,lr} - ldr r6, =0x0202420b - ldrb r0, [r6] - bl battle_get_per_side_status - ldr r4, =0x0202428e - movs r5, 0x1 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - ldrh r1, [r1] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _0805035C - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0 - b _080503D0 - .pool -_0805035C: - ldrb r0, [r6] - bl battle_get_per_side_status - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - ldrh r0, [r1] - movs r2, 0x1 - orrs r0, r2 - strh r0, [r1] - ldrb r0, [r6] - bl battle_get_per_side_status - ldr r4, =0x02024294 - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x5 - strb r1, [r0] - ldrb r0, [r6] - bl battle_get_per_side_status - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r6] - strb r1, [r0, 0x1] - ldr r0, =0x02022fec - ldr r0, [r0] - ands r0, r5 - cmp r0, 0 - beq _080503CC - movs r0, 0x1 - bl sub_8069DEC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x2 - bne _080503CC - ldr r0, =0x02024332 - strb r1, [r0, 0x5] - b _080503D2 - .pool -_080503CC: - ldr r1, =0x02024332 - movs r0, 0x1 -_080503D0: - strb r0, [r1, 0x5] -_080503D2: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atk7E_setreflect - - thumb_func_start sub_80503E8 -sub_80503E8: @ 80503E8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r7, =0x0202427c - ldrb r5, [r7] - movs r0, 0x29 - ands r0, r5 - cmp r0, 0 - bne _0805041A - ldr r0, =0x020242ac - mov r9, r0 - ldr r1, =0x0202420c - mov r8, r1 - ldrb r4, [r1] - lsls r0, r4, 2 - mov r2, r9 - adds r6, r0, r2 - ldr r2, [r6] - movs r0, 0x4 - mov r12, r0 - adds r3, r2, 0 - ands r3, r0 - cmp r3, 0 - beq _08050438 -_0805041A: - movs r0, 0x1 - orrs r0, r5 - strb r0, [r7] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - b _08050488 - .pool -_08050438: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r4 - adds r1, r0, r1 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0xC - beq _08050454 - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0xC - bne _0805046C -_08050454: - movs r0, 0x1 - orrs r0, r5 - strb r0, [r7] - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1, 0x5] - b _08050488 - .pool -_0805046C: - ldr r0, =0x0202420b - ldrb r0, [r0] - orrs r2, r0 - str r2, [r6] - mov r2, r8 - ldrb r1, [r2] - lsls r1, 2 - add r1, r9 - ldr r0, [r1] - mov r2, r12 - orrs r0, r2 - str r0, [r1] - ldr r0, =0x02024332 - strb r3, [r0, 0x5] -_08050488: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80503E8 - - thumb_func_start atk80_manipulatedamage -atk80_manipulatedamage: @ 80504A8 - push {r4,lr} - ldr r1, =0x02024214 - ldr r0, [r1] - ldrb r2, [r0, 0x1] - adds r4, r1, 0 - cmp r2, 0x1 - beq _080504D8 - cmp r2, 0x1 - bgt _080504C4 - cmp r2, 0 - beq _080504CA - b _08050518 - .pool -_080504C4: - cmp r2, 0x2 - beq _08050510 - b _08050518 -_080504CA: - ldr r1, =0x020241f0 - ldr r0, [r1] - negs r0, r0 - b _08050516 - .pool -_080504D8: - ldr r3, =0x020241f0 - ldr r0, [r3] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - str r0, [r3] - cmp r0, 0 - bne _080504EA - str r2, [r3] -_080504EA: - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x2C] - lsrs r1, r0, 1 - ldr r0, [r3] - cmp r1, r0 - bge _08050518 - str r1, [r3] - b _08050518 - .pool -_08050510: - ldr r1, =0x020241f0 - ldr r0, [r1] - lsls r0, 1 -_08050516: - str r0, [r1] -_08050518: - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk80_manipulatedamage - - thumb_func_start atk81_setrest -atk81_setrest: @ 8050528 - push {r4-r7,lr} - sub sp, 0x4 - ldr r0, =0x02024214 - mov r12, r0 - ldr r1, [r0] - ldrb r6, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - orrs r6, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - orrs r6, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - orrs r6, r0 - ldr r5, =0x02024064 - ldr r2, =0x0202420c - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r2] - strb r0, [r5] - ldr r4, =0x020241f0 - ldr r1, =0x02024084 - ldrb r0, [r2] - movs r3, 0x58 - muls r0, r3 - adds r0, r1 - ldrh r0, [r0, 0x2C] - negs r0, r0 - str r0, [r4] - ldrb r0, [r2] - adds r4, r0, 0 - muls r4, r3 - adds r0, r4, r1 - ldrh r3, [r0, 0x28] - adds r7, r5, 0 - adds r5, r2, 0 - adds r2, r1, 0 - ldrh r0, [r0, 0x2C] - cmp r3, r0 - bne _08050598 - mov r0, r12 - str r6, [r0] - b _080505E8 - .pool -_08050598: - adds r0, r2, 0 - adds r0, 0x4C - adds r0, r4, r0 - ldr r1, [r0] - movs r0, 0xF8 - ands r1, r0 - cmp r1, 0 - beq _080505B4 - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - b _080505B8 - .pool -_080505B4: - ldr r0, =0x02024332 - strb r1, [r0, 0x5] -_080505B8: - ldrb r0, [r5] - movs r3, 0x58 - muls r0, r3 - adds r2, 0x4C - adds r0, r2 - movs r1, 0x3 - str r1, [r0] - ldrb r0, [r7] - muls r0, r3 - adds r0, r2 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r7] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_080505E8: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk81_setrest - - thumb_func_start atk82_jumpifnotfirstturn -atk82_jumpifnotfirstturn: @ 80505F8 - push {r4,r5,lr} - ldr r5, =0x02024214 - ldr r4, [r5] - ldrb r3, [r4, 0x1] - ldrb r0, [r4, 0x2] - lsls r0, 8 - orrs r3, r0 - ldrb r0, [r4, 0x3] - lsls r0, 16 - orrs r3, r0 - ldrb r0, [r4, 0x4] - lsls r0, 24 - orrs r3, r0 - ldr r2, =0x020242bc - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x16] - cmp r0, 0 - beq _08050638 - adds r0, r4, 0x5 - str r0, [r5] - b _0805063A - .pool -_08050638: - str r3, [r5] -_0805063A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end atk82_jumpifnotfirstturn - - thumb_func_start sub_8050640 -sub_8050640: @ 8050640 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8050640 - - thumb_func_start sub_8050650 -sub_8050650: @ 8050650 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r3, r0, 24 - movs r2, 0 - ldr r0, =0x0202406c - ldrb r1, [r0] - mov r8, r0 - cmp r2, r1 - bge _080506C4 - ldr r0, =0x02024084 - mov r12, r0 - movs r0, 0x58 - muls r0, r3 - add r0, r12 - adds r5, r0, 0 - adds r5, 0x20 - adds r4, r1, 0 - movs r3, 0 - ldr r6, =0x02024474 - ldr r7, =0x02024332 -_0805067C: - mov r0, r12 - adds r0, 0x50 - adds r0, r3, r0 - ldr r0, [r0] - movs r1, 0x70 - ands r0, r1 - cmp r0, 0 - beq _080506BC - ldrb r0, [r5] - cmp r0, 0x2B - beq _080506BC - movs r3, 0 - strb r2, [r6, 0x17] - ldr r1, =0x0202420c - ldrb r0, [r1] - cmp r0, 0xFF - beq _080506DC - cmp r0, r2 - beq _080506D0 - movs r0, 0x1 - strb r0, [r7, 0x5] - b _080506C4 - .pool -_080506BC: - adds r3, 0x58 - adds r2, 0x1 - cmp r2, r4 - blt _0805067C -_080506C4: - mov r1, r8 - ldrb r1, [r1] - cmp r2, r1 - beq _080506E0 - movs r0, 0x1 - b _080506E2 -_080506D0: - ldr r0, =0x02024332 - strb r3, [r0, 0x5] - b _080506C4 - .pool -_080506DC: - strb r2, [r1] - b _080506C4 -_080506E0: - movs r0, 0 -_080506E2: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8050650 - - thumb_func_start sub_80506EC -sub_80506EC: @ 80506EC - push {r4-r6,lr} - ldr r5, =0x02024214 - ldr r1, [r5] - ldrb r4, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - orrs r4, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - orrs r4, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - orrs r4, r0 - ldr r6, =0x0202420c - ldrb r0, [r6] - bl sub_8050650 - lsls r0, 24 - cmp r0, 0 - beq _08050720 - str r4, [r5] - b _08050762 - .pool -_08050720: - ldr r1, =0x02024084 - ldrb r3, [r6] - movs r0, 0x58 - muls r0, r3 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - adds r1, r0, 0 - cmp r1, 0xF - beq _08050738 - cmp r1, 0x48 - bne _0805075C -_08050738: - ldr r2, =0x0202420a - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1, 0x5] - str r4, [r5] - ldrb r1, [r2] - adds r0, r3, 0 - bl b_history__record_ability_usage_of_player - b _08050762 - .pool -_0805075C: - ldr r0, [r5] - adds r0, 0x5 - str r0, [r5] -_08050762: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80506EC - - thumb_func_start sub_8050768 -sub_8050768: @ 8050768 - push {r4,r5,lr} - ldr r5, =0x020242bc - ldr r4, =0x0202420b - ldrb r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r0, r5 - ldrb r0, [r1, 0x9] - cmp r0, 0x3 - bne _080507A0 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - b _080507CA - .pool -_080507A0: - adds r0, 0x1 - movs r3, 0 - strb r0, [r1, 0x9] - ldr r2, =0x02022f58 - movs r0, 0xFD - strb r0, [r2] - movs r0, 0x1 - strb r0, [r2, 0x1] - strb r0, [r2, 0x2] - strb r0, [r2, 0x3] - ldrb r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0, 0x9] - strb r0, [r2, 0x4] - movs r0, 0xFF - strb r0, [r2, 0x5] - ldr r0, =0x02024332 - strb r3, [r0, 0x5] -_080507CA: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8050768 - - thumb_func_start atk86_stockpiletobasedamage -atk86_stockpiletobasedamage: @ 80507E4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - ldr r3, =0x02024214 - ldr r1, [r3] - ldrb r2, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - orrs r2, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - orrs r2, r0 - ldr r7, =0x020242bc - ldr r6, =0x0202420b - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r7 - ldrb r0, [r0, 0x9] - cmp r0, 0 - bne _08050828 - str r2, [r3] - b _080508CA - .pool -_08050828: - ldr r0, =0x02024332 - ldrb r0, [r0, 0x6] - cmp r0, 0x1 - beq _080508B0 - ldr r0, =0x020241f0 - mov r8, r0 - ldr r4, =0x0202428e - ldr r5, =0x0202420c - ldrb r0, [r5] - bl battle_get_per_side_status - movs r1, 0x1 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - ldrh r3, [r1] - ldrb r0, [r6] - movs r4, 0x58 - muls r0, r4 - ldr r2, =0x02024084 - adds r0, r2 - ldrb r1, [r5] - muls r1, r4 - adds r1, r2 - ldr r2, =0x020241ea - ldrh r2, [r2] - movs r4, 0 - str r4, [sp] - str r4, [sp, 0x4] - ldrb r4, [r6] - str r4, [sp, 0x8] - ldrb r4, [r5] - str r4, [sp, 0xC] - bl sub_806957C - ldrb r2, [r6] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r7 - ldrb r1, [r1, 0x9] - adds r3, r0, 0 - muls r3, r1 - mov r1, r8 - str r3, [r1] - ldr r2, =0x02024474 - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r7 - ldrb r0, [r0, 0x9] - strb r0, [r2, 0x18] - ldr r1, =0x0202433c - ldrb r0, [r6] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 28 - cmp r0, 0 - bge _080508B0 - lsls r0, r3, 4 - subs r0, r3 - movs r1, 0xA - bl __divsi3 - mov r1, r8 - str r0, [r1] -_080508B0: - ldr r2, =0x020242bc - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strb r1, [r0, 0x9] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_080508CA: - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk86_stockpiletobasedamage - - thumb_func_start atk87_stockpiletohprecovery -atk87_stockpiletohprecovery: @ 8050904 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r7, =0x02024214 - ldr r1, [r7] - ldrb r2, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - orrs r2, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - orrs r2, r0 - ldr r0, =0x020242bc - mov r8, r0 - ldr r6, =0x0202420b - ldrb r3, [r6] - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - mov r1, r8 - adds r4, r0, r1 - ldrb r1, [r4, 0x9] - cmp r1, 0 - bne _08050954 - str r2, [r7] - ldr r0, =0x02024332 - strb r1, [r0, 0x5] - b _080509D0 - .pool -_08050954: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r3 - adds r1, r0, r1 - ldrh r0, [r1, 0x2C] - ldrh r3, [r1, 0x28] - cmp r0, r3 - bne _08050984 - movs r0, 0 - strb r0, [r4, 0x9] - str r2, [r7] - ldr r1, =0x0202420c - ldrb r0, [r6] - strb r0, [r1] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - b _080509D0 - .pool -_08050984: - ldr r5, =0x020241f0 - ldrh r0, [r1, 0x2C] - ldrb r1, [r4, 0x9] - movs r2, 0x3 - subs r2, r1 - movs r4, 0x1 - adds r1, r4, 0 - lsls r1, r2 - bl __divsi3 - str r0, [r5] - cmp r0, 0 - bne _080509A0 - str r4, [r5] -_080509A0: - ldr r0, [r5] - negs r0, r0 - str r0, [r5] - ldr r3, =0x02024474 - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r8 - ldrb r0, [r0, 0x9] - movs r2, 0 - strb r0, [r3, 0x18] - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r8 - strb r2, [r0, 0x9] - ldr r0, [r7] - adds r0, 0x5 - str r0, [r7] - ldr r1, =0x0202420c - ldrb r0, [r6] - strb r0, [r1] -_080509D0: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk87_stockpiletohprecovery - - thumb_func_start atk88_negativedamage -atk88_negativedamage: @ 80509E8 - push {lr} - ldr r2, =0x020241f0 - ldr r0, =0x020241f4 - ldr r0, [r0] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - negs r0, r0 - str r0, [r2] - cmp r0, 0 - bne _08050A04 - movs r0, 0x1 - negs r0, r0 - str r0, [r2] -_08050A04: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atk88_negativedamage - - thumb_func_start sub_8050A1C -sub_8050A1C: @ 8050A1C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r8, r3 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r5, r2, 24 - movs r0, 0 - mov r9, r0 - mov r10, r0 - movs r0, 0x40 - ands r0, r5 - cmp r0, 0 - beq _08050A50 - ldr r0, =0x02024064 - ldr r1, =0x0202420b - b _08050A54 - .pool -_08050A50: - ldr r0, =0x02024064 - ldr r1, =0x0202420c -_08050A54: - ldrb r1, [r1] - strb r1, [r0] - movs r0, 0xBF - ands r5, r0 - movs r0, 0x80 - ands r0, r5 - cmp r0, 0 - beq _08050A6E - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_08050A6E: - movs r0, 0x7F - ands r5, r0 - movs r0, 0x20 - ands r0, r5 - cmp r0, 0 - beq _08050A84 - mov r0, r10 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 -_08050A84: - movs r0, 0xDF - ands r5, r0 - ldr r1, =0x02022f58 - movs r4, 0 - movs r2, 0xFD - strb r2, [r1] - movs r0, 0x5 - strb r0, [r1, 0x1] - strb r7, [r1, 0x2] - movs r3, 0x1 - negs r3, r3 - mov r12, r3 - movs r0, 0xFF - strb r0, [r1, 0x3] - lsls r0, r6, 24 - cmp r0, 0 - blt _08050AA8 - b _08050D8C -_08050AA8: - ldr r4, =0x02024294 - ldr r1, =0x02024064 - ldrb r0, [r1] - bl battle_get_per_side_status - movs r1, 0x1 - ands r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x4] - cmp r0, 0 - beq _08050B48 - mov r2, r9 - cmp r2, 0 - bne _08050B48 - ldr r0, =0x020241ea - ldrh r0, [r0] - cmp r0, 0xAE - beq _08050B78 - cmp r5, 0x1 - bne _08050B68 - ldr r4, =0x0202437c - ldr r3, =0x02024064 - ldrb r0, [r3] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r1] - lsls r0, 31 - cmp r0, 0 - beq _08050B10 - ldr r0, =0x02024214 - mov r4, r8 - str r4, [r0] - b _08050B68 - .pool -_08050B10: - mov r0, r8 - bl b_movescr_stack_push - ldr r1, =0x02024474 - ldr r6, =0x02024064 - ldrb r0, [r6] - strb r0, [r1, 0x17] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAE03 - str r0, [r1] - ldrb r1, [r6] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - b _08050B68 - .pool -_08050B48: - ldr r0, =0x020241ea - ldrh r0, [r0] - cmp r0, 0xAE - beq _08050B78 - mov r0, r10 - cmp r0, 0x1 - beq _08050B78 - movs r0, 0 - bl sub_80464AC - lsls r0, 24 - cmp r0, 0 - beq _08050B78 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082D9F1C - str r0, [r1] -_08050B68: - movs r0, 0x1 - b _08050E80 - .pool -_08050B78: - ldr r2, =0x02024084 - ldr r1, =0x02024064 - ldrb r3, [r1] - movs r4, 0x58 - adds r0, r3, 0 - muls r0, r4 - adds r0, r2 - adds r0, 0x20 - ldrb r0, [r0] - mov r10, r2 - cmp r0, 0x1D - beq _08050B94 - cmp r0, 0x49 - bne _08050C2C -_08050B94: - mov r0, r9 - cmp r0, 0 - bne _08050C2C - ldr r0, =0x020241ea - ldrh r0, [r0] - cmp r0, 0xAE - beq _08050C2C - cmp r5, 0x1 - bne _08050B68 - ldr r4, =0x0202437c - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - beq _08050BD4 - ldr r0, =0x02024214 - mov r1, r8 - str r1, [r0] - b _08050B68 - .pool -_08050BD4: - mov r0, r8 - bl b_movescr_stack_push - ldr r1, =0x02024474 - ldr r2, =0x02024064 - ldrb r0, [r2] - strb r0, [r1, 0x17] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB5C7 - str r0, [r1] - ldr r1, =0x0202420a - ldrb r0, [r2] - movs r3, 0x58 - muls r0, r3 - add r0, r10 - adds r0, 0x20 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r2] - ldrb r1, [r1] - bl b_history__record_ability_usage_of_player - ldr r6, =0x02024064 - ldrb r1, [r6] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - b _08050B68 - .pool -_08050C2C: - ldr r1, =0x02024064 - ldrb r0, [r1] - movs r4, 0x58 - muls r0, r4 - add r0, r10 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x33 - bne _08050C8C - mov r2, r9 - cmp r2, 0 - bne _08050C8C - cmp r7, 0x6 - bne _08050C8C - cmp r5, 0x1 - bne _08050B68 - mov r0, r8 - bl b_movescr_stack_push - ldr r1, =0x02024474 - ldr r3, =0x02024064 - ldrb r0, [r3] - strb r0, [r1, 0x17] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB62F - str r0, [r1] - ldr r1, =0x0202420a - ldrb r0, [r3] - muls r0, r4 - add r0, r10 - adds r0, 0x20 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r3] - ldrb r1, [r1] - bl b_history__record_ability_usage_of_player - b _08050B68 - .pool -_08050C8C: - ldr r4, =0x02024064 - ldrb r0, [r4] - movs r4, 0x58 - muls r0, r4 - add r0, r10 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x34 - bne _08050CF0 - mov r0, r9 - cmp r0, 0 - bne _08050CF0 - cmp r7, 0x1 - bne _08050CF0 - cmp r5, 0x1 - beq _08050CAE - b _08050B68 -_08050CAE: - mov r0, r8 - bl b_movescr_stack_push - ldr r1, =0x02024474 - ldr r2, =0x02024064 - ldrb r0, [r2] - strb r0, [r1, 0x17] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB62F - str r0, [r1] - ldr r1, =0x0202420a - ldrb r0, [r2] - muls r0, r4 - add r0, r10 - adds r0, 0x20 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r2] - ldrb r1, [r1] - bl b_history__record_ability_usage_of_player - b _08050B68 - .pool -_08050CF0: - ldr r3, =0x02024064 - ldrb r1, [r3] - movs r0, 0x58 - muls r0, r1 - add r0, r10 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x13 - bne _08050D08 - cmp r5, 0 - bne _08050D08 - b _08050B68 -_08050D08: - lsls r0, r6, 24 - asrs r0, 28 - movs r1, 0x7 - ands r0, r1 - negs r0, r0 - lsls r0, 24 - ldr r3, =0x02022f68 - movs r4, 0 - movs r1, 0xFD - strb r1, [r3] - movs r2, 0x1 - lsrs r6, r0, 24 - asrs r0, 24 - subs r1, 0xFF - cmp r0, r1 - bne _08050D32 - strb r4, [r3, 0x1] - movs r0, 0xD3 - strb r0, [r3, 0x2] - strb r4, [r3, 0x3] - movs r2, 0x4 -_08050D32: - adds r0, r2, r3 - strb r4, [r0] - adds r2, 0x1 - adds r1, r2, r3 - movs r0, 0xD4 - strb r0, [r1] - adds r2, 0x1 - adds r0, r2, r3 - strb r4, [r0] - adds r2, 0x1 - adds r1, r2, r3 - movs r0, 0xFF - strb r0, [r1] - ldr r4, =0x02024064 - ldrb r2, [r4] - movs r0, 0x58 - muls r0, r2 - adds r0, r7, r0 - mov r1, r10 - adds r1, 0x18 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - beq _08050DE2 - movs r1, 0 - ldr r0, =0x0202420c - ldrb r0, [r0] - ldr r3, =0x02024332 - mov r8, r3 - cmp r0, r2 - bne _08050D76 - movs r1, 0x1 -_08050D76: - mov r4, r8 - strb r1, [r4, 0x5] - b _08050E10 - .pool -_08050D8C: - asrs r6, r0, 28 - movs r0, 0x7 - ands r6, r0 - ldr r3, =0x02022f68 - strb r2, [r3] - movs r2, 0x1 - cmp r6, 0x2 - bne _08050DA6 - strb r4, [r3, 0x1] - movs r0, 0xD1 - strb r0, [r3, 0x2] - strb r4, [r3, 0x3] - movs r2, 0x4 -_08050DA6: - adds r0, r2, r3 - strb r4, [r0] - adds r2, 0x1 - adds r1, r2, r3 - movs r0, 0xD2 - strb r0, [r1] - adds r2, 0x1 - adds r0, r2, r3 - strb r4, [r0] - adds r2, 0x1 - adds r1, r2, r3 - ldrb r0, [r1] - mov r2, r12 - orrs r0, r2 - strb r0, [r1] - ldr r2, =0x02024084 - ldr r4, =0x02024064 - ldrb r3, [r4] - movs r0, 0x58 - muls r0, r3 - adds r0, r7, r0 - adds r1, r2, 0 - adds r1, 0x18 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - mov r10, r2 - cmp r0, 0xC - bne _08050DFC -_08050DE2: - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1, 0x5] - mov r8, r1 - b _08050E10 - .pool -_08050DFC: - movs r1, 0 - ldr r0, =0x0202420c - ldrb r0, [r0] - ldr r2, =0x02024332 - mov r8, r2 - cmp r0, r3 - bne _08050E0C - movs r1, 0x1 -_08050E0C: - mov r3, r8 - strb r1, [r3, 0x5] -_08050E10: - ldr r2, =0x02024064 - ldrb r0, [r2] - movs r4, 0x58 - adds r1, r0, 0 - muls r1, r4 - adds r1, r7, r1 - mov r3, r10 - adds r3, 0x18 - adds r1, r3 - lsls r0, r6, 24 - asrs r0, 24 - ldrb r6, [r1] - adds r0, r6 - strb r0, [r1] - ldrb r0, [r2] - muls r0, r4 - adds r0, r7, r0 - adds r1, r0, r3 - movs r0, 0 - ldrsb r0, [r1, r0] - cmp r0, 0 - bge _08050E40 - movs r0, 0 - strb r0, [r1] -_08050E40: - ldr r1, =0x02024064 - ldrb r0, [r1] - muls r0, r4 - adds r0, r7, r0 - adds r1, r0, r3 - movs r0, 0 - ldrsb r0, [r1, r0] - cmp r0, 0xC - ble _08050E56 - movs r0, 0xC - strb r0, [r1] -_08050E56: - mov r2, r8 - ldrb r0, [r2, 0x5] - cmp r0, 0x2 - bne _08050E7E - movs r3, 0x1 - ands r3, r5 - cmp r3, 0 - beq _08050E70 - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] -_08050E70: - mov r4, r8 - ldrb r0, [r4, 0x5] - cmp r0, 0x2 - bne _08050E7E - cmp r3, 0 - bne _08050E7E - b _08050B68 -_08050E7E: - movs r0, 0 -_08050E80: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8050A1C - - thumb_func_start atk89_statbuffchange -atk89_statbuffchange: @ 8050EA0 - push {r4,r5,lr} - ldr r5, =0x02024214 - ldr r2, [r5] - ldrb r3, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r3, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r3, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r3, r0 - ldr r0, =0x02024474 - ldrb r4, [r0, 0x1A] - movs r0, 0xF0 - ands r0, r4 - lsls r0, 24 - asrs r0, 24 - movs r1, 0xF - ands r1, r4 - ldrb r2, [r2, 0x1] - bl sub_8050A1C - lsls r0, 24 - cmp r0, 0 - bne _08050EDC - ldr r0, [r5] - adds r0, 0x6 - str r0, [r5] -_08050EDC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk89_statbuffchange - - thumb_func_start atk8A_normalisebuffs -atk8A_normalisebuffs: @ 8050EEC - push {r4-r7,lr} - movs r2, 0 - ldr r0, =0x0202406c - ldrb r1, [r0] - ldr r0, =0x02024214 - mov r12, r0 - cmp r2, r1 - bge _08050F24 - ldr r0, =0x02024084 - movs r4, 0x6 - adds r5, r1, 0 - movs r7, 0x58 - adds r6, r0, 0 - adds r6, 0x18 -_08050F08: - adds r3, r2, 0x1 - movs r1, 0x7 - adds r0, r2, 0 - muls r0, r7 - adds r0, r6 - adds r0, 0x7 -_08050F14: - strb r4, [r0] - subs r0, 0x1 - subs r1, 0x1 - cmp r1, 0 - bge _08050F14 - adds r2, r3, 0 - cmp r2, r5 - blt _08050F08 -_08050F24: - mov r1, r12 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk8A_normalisebuffs - - thumb_func_start atk8B_setbide -atk8B_setbide: @ 8050F40 - push {r4,r5,lr} - ldr r4, =0x02024084 - ldr r3, =0x0202420b - ldrb r0, [r3] - movs r5, 0x58 - adds r2, r0, 0 - muls r2, r5 - adds r4, 0x50 - adds r2, r4 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 5 - orrs r0, r1 - str r0, [r2] - ldr r1, =0x02024268 - ldrb r0, [r3] - lsls r0, 1 - adds r0, r1 - ldr r1, =0x020241ea - ldrh r1, [r1] - movs r2, 0 - strh r1, [r0] - ldr r1, =0x020241f8 - ldrb r0, [r3] - lsls r0, 2 - adds r0, r1 - str r2, [r0] - ldrb r0, [r3] - adds r1, r0, 0 - muls r1, r5 - adds r1, r4 - ldr r0, [r1] - movs r2, 0x80 - lsls r2, 2 - orrs r0, r2 - str r0, [r1] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk8B_setbide - - thumb_func_start atk8C_confuseifrepeatingattackends -atk8C_confuseifrepeatingattackends: @ 8050FB0 - push {lr} - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0xC0 - lsls r1, 4 - ands r0, r1 - cmp r0, 0 - bne _08050FD2 - ldr r1, =0x02024332 - movs r0, 0x75 - strb r0, [r1, 0x3] -_08050FD2: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atk8C_confuseifrepeatingattackends - - thumb_func_start atk8D_setloopcounter -atk8D_setloopcounter: @ 8050FF0 - push {r4,r5,lr} - ldr r0, =0x02024214 - ldr r0, [r0] - ldrb r1, [r0, 0x1] - cmp r1, 0 - beq _0805100C - ldr r0, =0x02024212 - strb r1, [r0] - b _08051026 - .pool -_0805100C: - ldr r4, =0x02024212 - bl GenerateRandomNumber - movs r5, 0x3 - ands r0, r5 - strb r0, [r4] - cmp r0, 0x1 - bls _08051022 - bl GenerateRandomNumber - ands r0, r5 -_08051022: - adds r0, 0x2 - strb r0, [r4] -_08051026: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atk8D_setloopcounter - - thumb_func_start atk8E_cmd8e -atk8E_cmd8e: @ 805103C - ldr r1, =0x02024474 - movs r2, 0 - movs r0, 0xFD - strb r0, [r1, 0x8] - movs r0, 0x1 - strb r0, [r1, 0x9] - strb r0, [r1, 0xA] - strb r0, [r1, 0xB] - strb r2, [r1, 0xC] - movs r0, 0xFF - strb r0, [r1, 0xD] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end atk8E_cmd8e - - thumb_func_start sub_8051064 -sub_8051064: @ 8051064 - push {r4-r7,lr} - ldr r6, =0x02024084 - ldr r7, =0x0202420b - ldrb r0, [r7] - movs r5, 0x58 - adds r1, r0, 0 - muls r1, r5 - adds r1, r6 - adds r1, 0x2A - ldr r4, =0x0202420c - ldrb r3, [r4] - adds r0, r3, 0 - muls r0, r5 - adds r0, r6 - adds r0, 0x2A - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - bcc _080510AC - ldr r0, =0x0202449c - ldr r1, [r0] - adds r1, r3, r1 - adds r1, 0x58 - ldr r2, =0x0202406e - lsls r0, r3, 1 - b _08051108 - .pool -_080510AC: - bl GenerateRandomNumber - movs r3, 0xFF - ands r3, r0 - ldrb r0, [r7] - muls r0, r5 - adds r0, r6 - adds r0, 0x2A - ldrb r2, [r0] - ldrb r4, [r4] - adds r0, r4, 0 - muls r0, r5 - adds r0, r6 - adds r0, 0x2A - ldrb r1, [r0] - adds r2, r1 - adds r0, r3, 0 - muls r0, r2 - asrs r0, 8 - adds r0, 0x1 - lsrs r1, 2 - cmp r0, r1 - bhi _080510FC - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - movs r0, 0 - b _08051116 - .pool -_080510FC: - ldr r0, =0x0202449c - ldr r1, [r0] - adds r1, r4, r1 - adds r1, 0x58 - ldr r2, =0x0202406e - lsls r0, r4, 1 -_08051108: - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DADD8 - str r0, [r1] - movs r0, 0x1 -_08051116: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8051064 - - thumb_func_start sub_805112C -sub_805112C: @ 805112C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - movs r0, 0 - str r0, [sp, 0x4] - ldr r5, =0x02022fec - ldr r0, [r5] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - bne _0805114A - b _08051410 -_0805114A: - ldr r4, =0x0202420c - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x02024744 - str r1, [sp] - cmp r0, 0 - bne _08051160 - ldr r0, =0x020244ec - str r0, [sp] -_08051160: - ldr r2, [r5] - movs r1, 0x81 - lsls r1, 1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, r1 - beq _08051182 - ldr r1, =0x02000100 - adds r0, r2, 0 - ands r0, r1 - cmp r0, r1 - beq _08051182 - movs r0, 0x80 - lsls r0, 15 - ands r0, r2 - cmp r0, 0 - beq _080511C8 -_08051182: - ldr r2, =0x0202420c - ldrb r1, [r2] - movs r0, 0x2 - ands r0, r1 - adds r1, r2, 0 - cmp r0, 0 - beq _080511AC - movs r0, 0x3 - mov r9, r0 - movs r0, 0x6 - b _080511B2 - .pool -_080511AC: - movs r0, 0 - mov r9, r0 - movs r0, 0x3 -_080511B2: - mov r8, r0 - movs r0, 0x3 - mov r10, r0 - movs r0, 0x1 - str r0, [sp, 0x8] - ldr r2, =0x0202406e - ldrb r1, [r1] - b _0805128E - .pool -_080511C8: - movs r0, 0x42 - ands r0, r2 - cmp r0, 0x42 - beq _080511DA - ldr r1, =0x02000040 - adds r0, r2, 0 - ands r0, r1 - cmp r0, r1 - bne _0805121C -_080511DA: - ldrb r0, [r4] - bl sub_806D864 - lsls r0, 24 - lsrs r0, 24 - bl sub_806D82C - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _080511FC - movs r1, 0x3 - mov r9, r1 - movs r0, 0x6 - b _08051202 - .pool -_080511FC: - movs r1, 0 - mov r9, r1 - movs r0, 0x3 -_08051202: - mov r8, r0 - movs r1, 0x3 - mov r10, r1 - movs r0, 0x1 - str r0, [sp, 0x8] - ldr r2, =0x0202406e - ldr r0, =0x0202420c - ldrb r1, [r0] - b _0805128E - .pool -_0805121C: - movs r0, 0x80 - lsls r0, 8 - ands r0, r2 - cmp r0, 0 - beq _08051274 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08051240 - movs r1, 0 - mov r9, r1 - movs r0, 0x6 - mov r8, r0 - mov r10, r0 - movs r1, 0x2 - b _08051260 -_08051240: - ldrb r1, [r4] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08051252 - movs r0, 0x3 - mov r9, r0 - movs r1, 0x6 - b _08051258 -_08051252: - movs r0, 0 - mov r9, r0 - movs r1, 0x3 -_08051258: - mov r8, r1 - movs r0, 0x3 - mov r10, r0 - movs r1, 0x1 -_08051260: - str r1, [sp, 0x8] - ldr r2, =0x0202406e - ldr r0, =0x0202420c - ldrb r1, [r0] - b _0805128E - .pool -_08051274: - movs r0, 0x1 - ands r2, r0 - cmp r2, 0 - beq _080512A4 - movs r0, 0 - mov r9, r0 - movs r1, 0x6 - mov r8, r1 - mov r10, r1 - movs r0, 0x2 - str r0, [sp, 0x8] - ldr r2, =0x0202406e - ldrb r1, [r4] -_0805128E: - lsls r0, r1, 1 - adds r0, r2 - ldrh r7, [r0] - movs r0, 0x2 - eors r1, r0 - lsls r1, 1 - adds r1, r2 - ldrh r5, [r1] - b _080512BE - .pool -_080512A4: - movs r1, 0 - mov r9, r1 - movs r0, 0x6 - mov r8, r0 - mov r10, r0 - movs r1, 0x1 - str r1, [sp, 0x8] - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r5, [r0] - adds r7, r5, 0 -_080512BE: - mov r6, r9 - cmp r6, r8 - bge _080512FC -_080512C4: - movs r0, 0x64 - muls r0, r6 - ldr r1, [sp] - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _080512F6 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _080512F6 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _080512F6 - ldr r0, [sp, 0x4] - adds r0, 0x1 - str r0, [sp, 0x4] -_080512F6: - adds r6, 0x1 - cmp r6, r8 - blt _080512C4 -_080512FC: - ldr r1, [sp, 0x4] - ldr r0, [sp, 0x8] - cmp r1, r0 - bgt _08051328 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08051414 - .pool -_08051328: - bl sub_8051064 - lsls r0, 24 - cmp r0, 0 - beq _08051378 -_08051332: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - mov r1, r10 - bl __modsi3 - adds r6, r0, 0 - add r6, r9 - cmp r6, r7 - beq _08051332 - cmp r6, r5 - beq _08051332 - movs r0, 0x64 - muls r0, r6 - ldr r1, [sp] - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _08051332 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0x1 - beq _08051332 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08051332 -_08051378: - ldr r4, =0x0202420c - ldrb r0, [r4] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - adds r0, 0x5C - strb r6, [r0] - bl sub_81B1250 - lsls r0, 24 - cmp r0, 0 - bne _08051396 - ldrb r0, [r4] - bl sub_803BDA0 -_08051396: - ldr r0, =0x02022fec - ldr r2, [r0] - movs r1, 0x81 - lsls r1, 1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, r1 - beq _080513C0 - movs r0, 0x42 - ands r0, r2 - cmp r0, 0x42 - beq _080513C0 - ldr r1, =0x02000100 - adds r0, r2, 0 - ands r0, r1 - cmp r0, r1 - beq _080513C0 - ldr r0, =0x02000040 - ands r2, r0 - cmp r2, r0 - bne _080513DE -_080513C0: - ldr r5, =0x0202420c - ldrb r0, [r5] - lsls r4, r6, 24 - lsrs r4, 24 - adds r1, r4, 0 - movs r2, 0 - bl sub_81B8E80 - ldrb r1, [r5] - movs r0, 0x2 - eors r0, r1 - adds r1, r4, 0 - movs r2, 0x1 - bl sub_81B8E80 -_080513DE: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _08051414 - ldr r0, =0x0202420c - ldrb r0, [r0] - lsls r1, r6, 24 - lsrs r1, 24 - bl sub_80571DC - b _08051414 - .pool -_08051410: - bl sub_8051064 -_08051414: - 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_805112C - - thumb_func_start sub_8051424 -sub_8051424: @ 8051424 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r6, 0 - ldr r2, =0x02024084 - ldr r3, =0x0202420b - ldrb r1, [r3] - movs r0, 0x58 - muls r0, r1 - adds r1, r2, 0 - adds r1, 0xC - adds r0, r1 - ldrh r0, [r0] - mov r8, r2 - cmp r0, 0 - beq _08051466 - movs r5, 0x58 - adds r2, r1, 0 -_0805144C: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x3 - bhi _08051466 - lsls r1, r6, 1 - ldrb r0, [r3] - muls r0, r5 - adds r1, r0 - adds r1, r2 - ldrh r0, [r1] - cmp r0, 0 - bne _0805144C -_08051466: - movs r3, 0 - cmp r3, r6 - bcs _080514E8 - ldr r0, =gBattleMoves - mov r10, r0 - ldr r5, =0x02024084 - mov r12, r5 - ldr r7, =0x0202420b - ldrb r0, [r7] - movs r4, 0x58 - adds r5, r0, 0 - muls r5, r4 - movs r0, 0xC - add r0, r12 - mov r9, r0 -_08051484: - lsls r0, r3, 1 - adds r0, r5 - add r0, r9 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - add r0, r10 - ldrb r2, [r0, 0x2] - cmp r2, 0x9 - bne _080514C6 - mov r0, r8 - adds r1, r5, r0 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x7 - beq _080514B2 - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x7 - bne _080514C4 -_080514B2: - movs r2, 0x7 - b _080514C6 - .pool -_080514C4: - movs r2, 0 -_080514C6: - ldrb r0, [r7] - muls r0, r4 - add r0, r12 - adds r1, r0, 0 - adds r1, 0x21 - ldrb r1, [r1] - cmp r2, r1 - beq _080514DE - adds r0, 0x22 - ldrb r0, [r0] - cmp r2, r0 - bne _080514E8 -_080514DE: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r6 - bcc _08051484 -_080514E8: - cmp r3, r6 - bne _0805150C - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _080515B0 - .pool -_0805150C: - movs r7, 0x3 - ldr r5, =gBattleMoves - mov r9, r5 -_08051512: - bl GenerateRandomNumber - adds r3, r0, 0 - ands r3, r7 - cmp r3, r6 - bcs _08051512 - ldr r4, =0x02024084 - lsls r1, r3, 1 - ldr r3, =0x0202420b - ldrb r2, [r3] - movs r0, 0x58 - adds r5, r2, 0 - muls r5, r0 - adds r1, r5 - adds r0, r4, 0 - adds r0, 0xC - adds r1, r0 - ldrh r1, [r1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - add r0, r9 - ldrb r2, [r0, 0x2] - mov r8, r4 - adds r4, r3, 0 - cmp r2, 0x9 - bne _08051572 - mov r0, r8 - adds r2, r5, r0 - adds r0, r2, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x7 - beq _08051560 - adds r0, r2, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x7 - bne _08051570 -_08051560: - movs r2, 0x7 - b _08051572 - .pool -_08051570: - movs r2, 0 -_08051572: - ldrb r0, [r4] - movs r3, 0x58 - muls r0, r3 - add r0, r8 - adds r1, r0, 0 - adds r1, 0x21 - ldrb r5, [r1] - cmp r2, r5 - beq _08051512 - adds r0, 0x22 - ldrb r0, [r0] - cmp r2, r0 - beq _08051512 - strb r2, [r1] - ldrb r0, [r4] - muls r0, r3 - add r0, r8 - adds r0, 0x22 - strb r2, [r0] - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x3 - strb r0, [r1, 0x1] - strb r2, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_080515B0: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8051424 - - thumb_func_start atk91_givemoney -atk91_givemoney: @ 80515C8 - push {r4,lr} - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x02000002 - ands r0, r1 - cmp r0, 0 - bne _08051650 - ldr r1, =0x0202432e - ldrh r0, [r1] - cmp r0, 0 - beq _08051650 - adds r1, r0, 0 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x4A - ldrb r0, [r0] - adds r4, r1, 0 - muls r4, r0 - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - adds r1, r4, 0 - bl add_money - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x1 - strb r0, [r1, 0x1] - movs r0, 0x2 - strb r0, [r1, 0x2] - movs r0, 0x5 - strb r0, [r1, 0x3] - strb r4, [r1, 0x4] - movs r0, 0xFF - lsls r0, 8 - ands r4, r0 - lsrs r4, 8 - strb r4, [r1, 0x5] - movs r0, 0xFF - strb r0, [r1, 0x6] - ldr r4, =0x02024214 - ldr r0, [r4] - adds r0, 0x1 - bl b_movescr_stack_push - ldr r0, =gUnknown_082DB307 - str r0, [r4] - b _08051658 - .pool -_08051650: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_08051658: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atk91_givemoney - - thumb_func_start atk92_setlightscreen -atk92_setlightscreen: @ 8051664 - push {r4-r6,lr} - ldr r5, =0x0202420b - ldrb r0, [r5] - bl battle_get_per_side_status - ldr r4, =0x0202428e - movs r6, 0x1 - adds r1, r6, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - ldrh r1, [r1] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080516A4 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0 - b _08051718 - .pool -_080516A4: - ldrb r0, [r5] - bl battle_get_per_side_status - adds r1, r6, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - ldrh r0, [r1] - movs r2, 0x2 - orrs r0, r2 - strh r0, [r1] - ldrb r0, [r5] - bl battle_get_per_side_status - ldr r4, =0x02024294 - adds r1, r6, 0 - ands r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x5 - strb r1, [r0, 0x2] - ldrb r0, [r5] - bl battle_get_per_side_status - adds r1, r6, 0 - ands r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r5] - strb r1, [r0, 0x3] - ldr r0, =0x02022fec - ldr r0, [r0] - ands r0, r6 - cmp r0, 0 - beq _08051714 - movs r0, 0x1 - bl sub_8069DEC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08051714 - ldr r1, =0x02024332 - movs r0, 0x4 - b _08051718 - .pool -_08051714: - ldr r1, =0x02024332 - movs r0, 0x3 -_08051718: - strb r0, [r1, 0x5] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atk92_setlightscreen - - thumb_func_start atk93_ko_move -atk93_ko_move: @ 8051730 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r7, =0x02024084 - ldr r6, =0x0202420c - ldrb r2, [r6] - movs r5, 0x58 - adds r0, r2, 0 - muls r0, r5 - adds r1, r0, r7 - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _08051768 - ldr r1, =0x02024404 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r4, [r0, 0x7] - ldrb r6, [r0, 0x1A] - b _08051782 - .pool -_08051768: - ldrh r0, [r1, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r4, r0, 24 - ldrb r0, [r6] - muls r0, r5 - adds r0, r7 - ldrh r0, [r0, 0x2E] - bl itemid_get_quality - lsls r0, 24 - lsrs r6, r0, 24 -_08051782: - ldr r1, =0x0202420f - ldr r5, =0x0202420c - ldrb r0, [r5] - strb r0, [r1] - cmp r4, 0x27 - bne _080517C0 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, r6 - bcs _080517C0 - ldrb r0, [r5] - movs r1, 0x27 - bl b_history__record_item_x12_of_player - ldr r2, =0x0202437c - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] -_080517C0: - ldr r1, =0x02024084 - ldr r2, =0x0202420c - ldrb r3, [r2] - movs r6, 0x58 - adds r0, r3, 0 - muls r0, r6 - adds r5, r0, r1 - adds r0, r5, 0 - adds r0, 0x20 - ldrb r4, [r0] - mov r8, r1 - mov r9, r2 - cmp r4, 0x5 - bne _0805181C - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r0, =0x0202420a - strb r4, [r0] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB552 - str r0, [r1] - mov r1, r9 - ldrb r0, [r1] - movs r1, 0x5 - bl b_history__record_ability_usage_of_player - b _08051A70 - .pool -_0805181C: - ldr r1, =0x020242ac - lsls r0, r3, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x18 - ands r0, r1 - cmp r0, 0 - bne _080518A0 - ldr r1, =gBattleMoves - ldr r0, =0x020241ea - ldrh r0, [r0] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - adds r2, r1 - ldr r7, =0x0202420b - ldrb r0, [r7] - muls r0, r6 - add r0, r8 - adds r0, 0x2A - ldrb r0, [r0] - adds r1, r5, 0 - adds r1, 0x2A - ldrb r1, [r1] - subs r0, r1 - ldrb r2, [r2, 0x3] - adds r0, r2 - lsls r0, 16 - lsrs r4, r0, 16 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r0, 0x1 - cmp r0, r4 - blt _08051870 - b _08051A08 -_08051870: - ldrb r0, [r7] - adds r1, r0, 0 - muls r1, r6 - add r1, r8 - adds r1, 0x2A - mov r2, r9 - ldrb r0, [r2] - muls r0, r6 - add r0, r8 - adds r0, 0x2A - ldrb r1, [r1] - movs r4, 0x1 - ldrb r0, [r0] - cmp r1, r0 - bcs _08051936 - b _08051A08 - .pool -_080518A0: - ldr r1, =0x020242bc - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldr r1, =0x0202420b - ldrb r0, [r0, 0x15] - adds r7, r1, 0 - ldrb r3, [r7] - cmp r0, r3 - bne _080518CA - ldrb r0, [r7] - muls r0, r6 - add r0, r8 - adds r0, 0x2A - adds r1, r5, 0 - adds r1, 0x2A - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcs _08051942 -_080518CA: - ldr r1, =gBattleMoves - ldr r0, =0x020241ea - ldrh r0, [r0] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - adds r2, r1 - ldr r6, =0x02024084 - ldrb r0, [r7] - movs r5, 0x58 - muls r0, r5 - adds r0, r6 - adds r0, 0x2A - ldrb r1, [r0] - ldr r0, =0x0202420c - mov r8, r0 - ldrb r0, [r0] - muls r0, r5 - adds r0, r6 - adds r0, 0x2A - ldrb r0, [r0] - subs r1, r0 - ldrb r2, [r2, 0x3] - adds r1, r2 - lsls r1, 16 - lsrs r4, r1, 16 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r0, 0x1 - cmp r0, r4 - bge _08051934 - ldrb r0, [r7] - adds r1, r0, 0 - muls r1, r5 - adds r1, r6 - adds r1, 0x2A - mov r2, r8 - ldrb r0, [r2] - muls r0, r5 - adds r0, r6 - adds r0, 0x2A - ldrb r1, [r1] - movs r4, 0x1 - ldrb r0, [r0] - cmp r1, r0 - bcs _08051936 -_08051934: - movs r4, 0 -_08051936: - ldr r3, =0x02024084 - mov r8, r3 - ldr r0, =0x0202420c - mov r9, r0 - cmp r4, 0 - beq _08051A08 -_08051942: - ldr r0, =0x0202433c - mov r1, r9 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 30 - cmp r0, 0 - bge _08051990 - ldr r1, =0x020241f0 - movs r0, 0x58 - muls r0, r2 - add r0, r8 - ldrh r0, [r0, 0x28] - subs r0, 0x1 - str r0, [r1] - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x40 - b _080519EE - .pool -_08051990: - ldr r0, =0x0202437c - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - lsrs r0, 7 - cmp r0, 0 - beq _080519DC - ldr r1, =0x020241f0 - movs r3, 0x58 - adds r0, r2, 0 - muls r0, r3 - add r0, r8 - ldrh r0, [r0, 0x28] - subs r0, 0x1 - str r0, [r1] - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024208 - mov r2, r9 - ldrb r0, [r2] - muls r0, r3 - add r0, r8 - ldrh r0, [r0, 0x2E] - strh r0, [r1] - b _080519F2 - .pool -_080519DC: - ldr r1, =0x020241f0 - movs r0, 0x58 - muls r0, r2 - add r0, r8 - ldrh r0, [r0, 0x28] - str r0, [r1] - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x10 -_080519EE: - orrs r0, r1 - strb r0, [r2] -_080519F2: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _08051A70 - .pool -_08051A08: - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r3, =0x02024084 - ldr r0, =0x0202420b - ldrb r0, [r0] - movs r2, 0x58 - adds r1, r0, 0 - muls r1, r2 - adds r1, r3 - adds r1, 0x2A - ldr r0, =0x0202420c - ldrb r0, [r0] - muls r0, r2 - adds r0, r3 - adds r0, 0x2A - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - bcc _08051A50 - ldr r1, =0x02024332 - movs r0, 0 - b _08051A54 - .pool -_08051A50: - ldr r1, =0x02024332 - movs r0, 0x1 -_08051A54: - strb r0, [r1, 0x5] - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08051A70: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk93_ko_move - - thumb_func_start atk94_gethalfcurrentenemyhp -atk94_gethalfcurrentenemyhp: @ 8051A84 - push {lr} - ldr r3, =0x020241f0 - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x28] - lsrs r0, 1 - str r0, [r3] - cmp r0, 0 - bne _08051AA2 - movs r0, 0x1 - str r0, [r3] -_08051AA2: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atk94_gethalfcurrentenemyhp - - thumb_func_start sub_8051AC0 -sub_8051AC0: @ 8051AC0 - push {lr} - ldr r2, =0x020243cc - ldrh r1, [r2] - movs r0, 0x18 - ands r0, r1 - cmp r0, 0 - beq _08051AEC - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1, 0x5] - b _08051AFE - .pool -_08051AEC: - movs r0, 0x8 - strh r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x3 - strb r0, [r1, 0x5] - ldr r0, =0x020243d0 - adds r0, 0x28 - movs r1, 0x5 - strb r1, [r0] -_08051AFE: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8051AC0 - - thumb_func_start sub_8051B18 -sub_8051B18: @ 8051B18 - push {r4,r5,lr} - sub sp, 0x4 - movs r0, 0 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _08051B36 - b _08051C48 -_08051B36: - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _08051B4C - b _08051C48 -_08051B4C: - ldr r2, =0x020243cc - ldrh r1, [r2] - movs r0, 0x18 - ands r0, r1 - adds r4, r2, 0 - ldr r5, =0x0202420b - cmp r0, 0 - beq _08051BDA - ldr r0, =0x02024084 - ldrb r2, [r5] - movs r1, 0x58 - muls r1, r2 - adds r3, r1, r0 - adds r0, r3, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x5 - beq _08051BD4 - cmp r0, 0x8 - beq _08051BD4 - cmp r0, 0x4 - beq _08051BD4 - adds r0, r3, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x5 - beq _08051BD4 - cmp r0, 0x8 - beq _08051BD4 - cmp r0, 0x4 - beq _08051BD4 - adds r0, r3, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x8 - beq _08051BD4 - ldr r0, =0x020242ac - lsls r1, r2, 2 - adds r1, r0 - ldr r1, [r1] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08051BD4 - movs r0, 0x80 - lsls r0, 11 - ands r1, r0 - cmp r1, 0 - bne _08051BD4 - ldr r1, =0x020241f0 - ldrh r0, [r3, 0x2C] - lsrs r0, 4 - str r0, [r1] - cmp r0, 0 - bne _08051BDA - movs r0, 0x1 - b _08051BD8 - .pool -_08051BD4: - ldr r1, =0x020241f0 - movs r0, 0 -_08051BD8: - str r0, [r1] -_08051BDA: - ldrh r1, [r4] - movs r4, 0x80 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _08051C50 - ldr r1, =0x02024084 - ldrb r3, [r5] - movs r0, 0x58 - muls r0, r3 - adds r2, r0, r1 - adds r0, r2, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0xF - beq _08051C3C - adds r0, r2, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0xF - beq _08051C3C - ldr r0, =0x020242ac - lsls r1, r3, 2 - adds r1, r0 - ldr r1, [r1] - adds r0, r1, 0 - ands r0, r4 - cmp r0, 0 - bne _08051C3C - movs r0, 0x80 - lsls r0, 11 - ands r1, r0 - cmp r1, 0 - bne _08051C3C - ldr r1, =0x020241f0 - ldrh r0, [r2, 0x2C] - lsrs r0, 4 - str r0, [r1] - cmp r0, 0 - bne _08051C50 - movs r0, 0x1 - str r0, [r1] - b _08051C50 - .pool -_08051C3C: - ldr r1, =0x020241f0 - movs r0, 0 - str r0, [r1] - b _08051C50 - .pool -_08051C48: - ldr r1, =0x020241f0 - movs r0, 0 - str r0, [r1] - ldr r5, =0x0202420b -_08051C50: - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08051C6A - ldr r1, =0x020241f0 - movs r0, 0 - str r0, [r1] -_08051C6A: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8051B18 - - thumb_func_start atk97_tryinfatuatetarget -atk97_tryinfatuatetarget: @ 8051C90 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r4, =0x0202420b - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08051CC8 - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - b _08051CD8 - .pool -_08051CC8: - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 -_08051CD8: - adds r5, r1, r0 - ldr r4, =0x0202420c - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08051D0C - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - b _08051D1C - .pool -_08051D0C: - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 -_08051D1C: - adds r4, r1, r0 - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - adds r0, r5, 0 - movs r1, 0 - bl pokemon_getattr - mov r9, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - adds r7, r0, 0 - ldr r5, =0x0202420c - ldrb r0, [r5] - movs r6, 0x58 - muls r0, r6 - ldr r1, =0x02024084 - adds r0, r1 - adds r0, 0x20 - ldrb r2, [r0] - cmp r2, 0xC - bne _08051D94 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB5F5 - str r0, [r1] - ldr r0, =0x0202420a - strb r2, [r0] - ldrb r0, [r5] - movs r1, 0xC - bl b_history__record_ability_usage_of_player - b _08051E2C - .pool -_08051D94: - mov r0, r10 - mov r1, r9 - bl pokemon_species_get_gender_info - adds r4, r0, 0 - mov r0, r8 - adds r1, r7, 0 - bl pokemon_species_get_gender_info - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _08051DE4 - ldrb r0, [r5] - muls r0, r6 - ldr r4, =0x02024084 - adds r4, 0x50 - adds r0, r4 - ldr r0, [r0] - movs r1, 0xF0 - lsls r1, 12 - ands r0, r1 - cmp r0, 0 - bne _08051DE4 - mov r0, r10 - mov r1, r9 - bl pokemon_species_get_gender_info - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _08051DE4 - mov r0, r8 - adds r1, r7, 0 - bl pokemon_species_get_gender_info - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _08051E08 -_08051DE4: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08051E2C - .pool -_08051E08: - ldrb r0, [r5] - adds r2, r0, 0 - muls r2, r6 - adds r2, r4 - ldr r1, =gUnknown_0832A328 - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - lsls r1, 16 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_08051E2C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk97_tryinfatuatetarget - - thumb_func_start sub_8051E48 -sub_8051E48: @ 8051E48 - push {r4-r7,lr} - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - bne _08051F34 - ldr r5, =0x02024214 - ldr r1, [r5] - ldrb r0, [r1, 0x1] - cmp r0, 0x4 - beq _08051EA0 - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - ldr r3, =0x02024084 - ldrb r1, [r4] - movs r0, 0x58 - adds r2, r1, 0 - muls r2, r0 - adds r0, r3, 0 - adds r0, 0x4C - adds r0, r2, r0 - ldr r1, [r0] - adds r3, 0x50 - adds r2, r3 - ldr r2, [r2] - movs r0, 0 - bl dp01_build_cmdbuf_x1A_aaaa_bbbb - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r5] - adds r0, 0x2 - str r0, [r5] - b _08051F34 - .pool -_08051EA0: - ldr r4, =0x02024064 - ldr r5, =0x0202420b - ldrb r0, [r5] - strb r0, [r4] - ldr r6, =0x02024210 - ldrb r1, [r6] - ldr r7, =gUnknown_0832A328 - ldrb r2, [r4] - lsls r0, r2, 2 - adds r0, r7 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08051EDC - ldr r3, =0x02024084 - movs r0, 0x58 - muls r2, r0 - adds r0, r3, 0 - adds r0, 0x4C - adds r0, r2, r0 - ldr r1, [r0] - adds r3, 0x50 - adds r2, r3 - ldr r2, [r2] - movs r0, 0 - bl dp01_build_cmdbuf_x1A_aaaa_bbbb - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_08051EDC: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08051F2C - ldrb r0, [r5] - bl battle_get_per_side_status - movs r1, 0x2 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - strb r0, [r4] - ldrb r1, [r6] - ldrb r2, [r4] - lsls r0, r2, 2 - adds r0, r7 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08051F2C - ldr r3, =0x02024084 - movs r0, 0x58 - muls r2, r0 - adds r0, r3, 0 - adds r0, 0x4C - adds r0, r2, r0 - ldr r1, [r0] - adds r3, 0x50 - adds r2, r3 - ldr r2, [r2] - movs r0, 0 - bl dp01_build_cmdbuf_x1A_aaaa_bbbb - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_08051F2C: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] -_08051F34: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8051E48 - - thumb_func_start atk99_setmisteffect -atk99_setmisteffect: @ 8051F58 - push {r4-r6,lr} - ldr r6, =0x02024294 - ldr r4, =0x0202420b - ldrb r0, [r4] - bl battle_get_per_side_status - movs r5, 0x1 - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x4] - cmp r0, 0 - beq _08051F98 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r2] - ldr r0, =0x02024332 - strb r5, [r0, 0x5] - b _08051FE6 - .pool -_08051F98: - ldrb r0, [r4] - bl battle_get_per_side_status - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x5 - strb r1, [r0, 0x4] - ldrb r0, [r4] - bl battle_get_per_side_status - adds r1, r5, 0 - ands r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r1, [r4] - strb r1, [r0, 0x5] - ldrb r0, [r4] - bl battle_get_per_side_status - ldr r2, =0x0202428e - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r3, 0x80 - lsls r3, 1 - adds r0, r3, 0 - movs r3, 0 - orrs r0, r2 - strh r0, [r1] - ldr r0, =0x02024332 - strb r3, [r0, 0x5] -_08051FE6: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atk99_setmisteffect - - thumb_func_start atk9A_setincreasedcriticalchance -atk9A_setincreasedcriticalchance: @ 8052000 - push {lr} - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r1, [r0] - movs r3, 0x80 - lsls r3, 13 - adds r2, r1, 0 - ands r2, r3 - cmp r2, 0 - beq _08052040 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - b _08052048 - .pool -_08052040: - orrs r1, r3 - str r1, [r0] - ldr r0, =0x02024332 - strb r2, [r0, 0x5] -_08052048: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atk9A_setincreasedcriticalchance - - thumb_func_start atk9B_transformdataexecution -atk9B_transformdataexecution: @ 805205C - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r1, =0x020241ec - ldr r2, =0x0000ffff - adds r0, r2, 0 - strh r0, [r1] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r7, =0x02024084 - ldr r0, =0x0202420c - mov r12, r0 - ldrb r1, [r0] - movs r6, 0x58 - adds r0, r1, 0 - muls r0, r6 - adds r5, r7, 0 - adds r5, 0x50 - adds r0, r5 - ldr r0, [r0] - movs r4, 0x80 - lsls r4, 14 - ands r0, r4 - cmp r0, 0 - bne _080520A2 - ldr r0, =0x020242ac - lsls r1, 2 - adds r1, r0 - ldr r2, [r1] - ldr r0, =0x000400c0 - ands r2, r0 - cmp r2, 0 - beq _080520D8 -_080520A2: - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x1 - b _080521EC - .pool -_080520D8: - ldr r3, =0x0202420b - ldrb r0, [r3] - adds r1, r0, 0 - muls r1, r6 - adds r1, r5 - ldr r0, [r1] - orrs r0, r4 - str r0, [r1] - ldr r4, =0x020242bc - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r4 - strh r2, [r0, 0x4] - ldrb r0, [r3] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r2, [r1, 0xB] - movs r0, 0x10 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0xB] - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r4 - mov r2, r12 - ldrb r1, [r2] - muls r1, r6 - adds r2, r7, 0 - adds r2, 0x48 - adds r1, r2 - ldr r1, [r1] - str r1, [r0] - ldrb r0, [r3] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r2, [r1, 0x18] - movs r0, 0xF - ands r0, r2 - strb r0, [r1, 0x18] - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x6 - strb r0, [r1, 0x1] - mov r2, r12 - ldrb r0, [r2] - muls r0, r6 - adds r0, r7 - ldrh r0, [r0] - strb r0, [r1, 0x2] - ldrb r0, [r2] - muls r0, r6 - adds r0, r7 - ldrh r0, [r0] - lsrs r0, 8 - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldrb r0, [r3] - muls r0, r6 - adds r5, r0, r7 - ldrb r0, [r2] - muls r0, r6 - adds r2, r0, r7 - movs r4, 0 - adds r6, r3, 0 - ldr r0, =0x02024064 - mov r8, r0 -_08052170: - adds r0, r5, r4 - adds r1, r2, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x23 - bls _08052170 - movs r4, 0 - ldr r7, =gBattleMoves - ldr r3, =0x02024090 - adds r5, r3, 0 - adds r5, 0x18 -_08052188: - lsls r1, r4, 1 - ldrb r2, [r6] - movs r0, 0x58 - muls r2, r0 - adds r1, r2 - adds r1, r3 - ldrh r1, [r1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldrb r1, [r0, 0x4] - cmp r1, 0x4 - bhi _080521C4 - adds r0, r4, r2 - adds r0, r5 - b _080521CA - .pool -_080521C4: - adds r0, r4, r2 - adds r0, r5 - movs r1, 0x5 -_080521CA: - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x3 - ble _08052188 - ldrb r0, [r6] - mov r1, r8 - strb r0, [r1] - movs r0, 0 - movs r1, 0x2 - bl dp01_build_cmdbuf_x38_a - mov r2, r8 - ldrb r0, [r2] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024332 - movs r0, 0 -_080521EC: - strb r0, [r1, 0x5] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atk9B_transformdataexecution - - thumb_func_start sub_80521FC -sub_80521FC: @ 80521FC - push {r4-r7,lr} - ldr r7, =0x02024084 - ldr r6, =0x0202420b - ldrb r0, [r6] - movs r5, 0x58 - muls r0, r5 - adds r3, r0, r7 - ldrh r0, [r3, 0x2C] - lsrs r1, r0, 2 - adds r2, r1, 0 - cmp r1, 0 - bne _08052216 - movs r2, 0x1 -_08052216: - ldrh r0, [r3, 0x28] - cmp r0, r2 - bhi _0805223C - ldr r1, =0x020241f0 - movs r0, 0 - str r0, [r1] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - b _08052290 - .pool -_0805223C: - ldr r4, =0x020241f0 - str r1, [r4] - cmp r1, 0 - bne _08052248 - movs r0, 0x1 - str r0, [r4] -_08052248: - ldrb r0, [r6] - adds r2, r0, 0 - muls r2, r5 - adds r3, r7, 0 - adds r3, 0x50 - adds r2, r3 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 17 - orrs r0, r1 - str r0, [r2] - ldrb r0, [r6] - adds r1, r0, 0 - muls r1, r5 - adds r1, r3 - ldr r0, [r1] - ldr r2, =0xffff1fff - ands r0, r2 - str r0, [r1] - ldr r2, =0x020242bc - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, [r4] - movs r2, 0 - strb r1, [r0, 0xA] - ldr r0, =0x02024332 - strb r2, [r0, 0x5] - ldr r2, =0x02024280 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 1 - orrs r0, r1 - str r0, [r2] -_08052290: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80521FC - - thumb_func_start sub_80522B8 -sub_80522B8: @ 80522B8 - push {r4,r5,lr} - lsls r0, 16 - lsrs r2, r0, 16 - movs r3, 0 - ldr r0, =gUnknown_0831C3E0 - ldrh r1, [r0] - ldr r4, =0x0000fffe - adds r5, r0, 0 - cmp r1, r4 - beq _080522E0 - cmp r1, r2 - beq _080522E0 - adds r1, r5, 0 -_080522D2: - adds r1, 0x2 - adds r3, 0x1 - ldrh r0, [r1] - cmp r0, r4 - beq _080522E0 - cmp r0, r2 - bne _080522D2 -_080522E0: - lsls r0, r3, 1 - adds r0, r5 - ldrh r1, [r0] - ldr r0, =0x0000fffe - eors r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80522B8 - - thumb_func_start atk9D_copyattack -atk9D_copyattack: @ 8052300 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x020241ec - ldr r1, =0x0000ffff - adds r7, r1, 0 - strh r7, [r0] - ldr r5, =0x02024248 - ldr r6, =0x0202420c - ldrb r0, [r6] - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - bl sub_80522B8 - lsls r0, 24 - cmp r0, 0 - bne _0805235A - ldr r3, =0x02024084 - ldr r2, =0x0202420b - ldrb r1, [r2] - movs r0, 0x58 - adds r4, r1, 0 - muls r4, r0 - adds r0, r3, 0 - adds r0, 0x50 - adds r0, r4, r0 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 14 - ands r1, r0 - mov r12, r3 - mov r9, r2 - cmp r1, 0 - bne _0805235A - ldrb r0, [r6] - lsls r0, 1 - adds r0, r5 - ldrh r1, [r0] - cmp r1, 0 - beq _0805235A - cmp r1, r7 - bne _08052394 -_0805235A: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _080524CC - .pool -_08052394: - movs r2, 0 - mov r3, r12 - adds r3, 0xC - adds r0, r4, r3 - ldrh r0, [r0] - ldr r4, =0x02024214 - mov r10, r4 - cmp r0, r1 - beq _080523CE - mov r8, r3 - adds r7, r5, 0 - adds r5, r6, 0 - mov r4, r9 - movs r3, 0x58 -_080523B0: - adds r2, 0x1 - cmp r2, 0x3 - bgt _080523CE - lsls r1, r2, 1 - ldrb r0, [r4] - muls r0, r3 - adds r1, r0 - add r1, r8 - ldrb r0, [r5] - lsls r0, 1 - adds r0, r7 - ldrh r1, [r1] - ldrh r0, [r0] - cmp r1, r0 - bne _080523B0 -_080523CE: - cmp r2, 0x4 - bne _080524B0 - ldr r5, =0x020241e8 - ldrb r1, [r5] - lsls r1, 1 - mov r2, r9 - ldrb r0, [r2] - movs r6, 0x58 - muls r0, r6 - adds r1, r0 - mov r0, r12 - adds r0, 0xC - adds r1, r0 - ldr r2, =0x02024248 - ldr r3, =0x0202420c - ldrb r0, [r3] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - ldr r4, =gBattleMoves - ldrb r0, [r3] - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r4, [r0, 0x4] - cmp r4, 0x4 - bhi _08052438 - mov r1, r9 - ldrb r0, [r1] - muls r0, r6 - ldrb r1, [r5] - adds r0, r1 - mov r1, r12 - adds r1, 0x24 - adds r0, r1 - strb r4, [r0] - b _0805244C - .pool -_08052438: - mov r4, r9 - ldrb r0, [r4] - muls r0, r6 - ldrb r1, [r5] - adds r0, r1 - mov r1, r12 - adds r1, 0x24 - adds r0, r1 - movs r1, 0x5 - strb r1, [r0] -_0805244C: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - ldrb r0, [r3] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1, 0x2] - ldrb r0, [r3] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - lsrs r0, 8 - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x020242bc - mov r2, r9 - ldrb r0, [r2] - lsls r2, r0, 3 - subs r2, r0 - lsls r2, 2 - adds r2, r1 - ldrb r4, [r2, 0x18] - lsrs r3, r4, 4 - ldr r1, =gUnknown_0832A328 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - orrs r1, r3 - lsls r1, 4 - movs r0, 0xF - ands r0, r4 - orrs r0, r1 - strb r0, [r2, 0x18] - mov r4, r10 - ldr r0, [r4] - adds r0, 0x5 - str r0, [r4] - b _080524CC - .pool -_080524B0: - mov r0, r10 - ldr r2, [r0] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - mov r2, r10 - str r1, [r2] -_080524CC: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end atk9D_copyattack - - thumb_func_start sub_80524DC -sub_80524DC: @ 80524DC - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r7, =0x020241ea - movs r6, 0xB1 - lsls r6, 1 - ldr r5, =gUnknown_0831C3E0 - ldr r0, =0x02024214 - mov r8, r0 -_080524EE: - bl GenerateRandomNumber - ldr r2, =0x000001ff - adds r1, r2, 0 - ands r0, r1 - adds r0, 0x1 - strh r0, [r7] - cmp r0, r6 - bhi _080524EE - movs r0, 0x3 -_08052502: - subs r0, 0x1 - cmp r0, 0 - bge _08052502 - ldr r4, =0x020241ea - ldrh r2, [r4] - ldr r3, =0x0000ffff - subs r0, r5, 0x2 -_08052510: - adds r0, 0x2 - ldrh r1, [r0] - cmp r1, r2 - beq _0805251C - cmp r1, r3 - bne _08052510 -_0805251C: - ldr r0, =0x0000ffff - cmp r1, r0 - bne _080524EE - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xfffffbff - ands r0, r1 - str r0, [r2] - ldr r3, =gUnknown_082D86A8 - ldr r2, =gBattleMoves - ldrh r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - mov r1, r8 - str r0, [r1] - ldrh r0, [r4] - movs r1, 0 - bl sub_80458E0 - ldr r1, =0x0202420c - strb r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80524DC - - thumb_func_start atk9F_nightshadedamageeffect -atk9F_nightshadedamageeffect: @ 8052584 - ldr r3, =0x020241f0 - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x2A - ldrb r0, [r0] - str r0, [r3] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end atk9F_nightshadedamageeffect - - thumb_func_start atkA0_psywavedamageeffect -atkA0_psywavedamageeffect: @ 80525B4 - push {r4,lr} - movs r4, 0xF -_080525B8: - bl GenerateRandomNumber - adds r3, r4, 0 - ands r3, r0 - cmp r3, 0xA - bgt _080525B8 - lsls r0, r3, 2 - adds r0, r3 - lsls r3, r0, 1 - ldr r4, =0x020241f0 - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x2A - ldrb r1, [r0] - adds r0, r3, 0 - adds r0, 0x32 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - str r0, [r4] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkA0_psywavedamageeffect - - thumb_func_start atkA1_counterdamagecalculator -atkA1_counterdamagecalculator: @ 8052608 - push {r4-r6,lr} - ldr r4, =0x0202420b - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r6, r0, 24 - ldr r5, =0x0202433c - ldrb r0, [r4] - lsls r0, 4 - adds r0, r5 - ldrb r0, [r0, 0xC] - bl battle_side_get_owner - lsls r0, 24 - lsrs r2, r0, 24 - ldrb r0, [r4] - lsls r1, r0, 4 - adds r0, r5, 0x4 - adds r0, r1, r0 - ldr r3, [r0] - cmp r3, 0 - beq _080526BC - cmp r6, r2 - beq _080526BC - ldr r6, =0x02024084 - adds r0, r1, r5 - ldrb r0, [r0, 0xC] - movs r4, 0x58 - muls r0, r4 - adds r0, r6 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _080526BC - ldr r1, =0x020241f0 - lsls r0, r3, 1 - str r0, [r1] - ldr r1, =0x02024294 - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r1 - ldrb r0, [r1, 0x8] - cmp r0, 0 - beq _08052690 - ldrb r1, [r1, 0x9] - adds r0, r1, 0 - muls r0, r4 - adds r0, r6 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08052690 - ldr r0, =0x0202420c - strb r1, [r0] - b _080526A0 - .pool -_08052690: - ldr r2, =0x0202420c - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0xC] - strb r0, [r2] -_080526A0: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _080526EC - .pool -_080526BC: - ldr r2, =0x0202437c - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0] - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_080526EC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atkA1_counterdamagecalculator - - thumb_func_start atkA2_mirrorcoatdamagecalculator -atkA2_mirrorcoatdamagecalculator: @ 8052700 - push {r4-r6,lr} - ldr r4, =0x0202420b - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r6, r0, 24 - ldr r5, =0x0202433c - ldrb r0, [r4] - lsls r0, 4 - adds r0, r5 - ldrb r0, [r0, 0xD] - bl battle_side_get_owner - lsls r0, 24 - lsrs r2, r0, 24 - ldrb r0, [r4] - lsls r1, r0, 4 - adds r0, r5, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r3, [r0] - cmp r3, 0 - beq _080527B4 - cmp r6, r2 - beq _080527B4 - ldr r6, =0x02024084 - adds r0, r1, r5 - ldrb r0, [r0, 0xD] - movs r4, 0x58 - muls r0, r4 - adds r0, r6 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _080527B4 - ldr r1, =0x020241f0 - lsls r0, r3, 1 - str r0, [r1] - ldr r1, =0x02024294 - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r1 - ldrb r0, [r1, 0x8] - cmp r0, 0 - beq _08052788 - ldrb r1, [r1, 0x9] - adds r0, r1, 0 - muls r0, r4 - adds r0, r6 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08052788 - ldr r0, =0x0202420c - strb r1, [r0] - b _08052798 - .pool -_08052788: - ldr r2, =0x0202420c - ldr r1, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0xD] - strb r0, [r2] -_08052798: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _080527E4 - .pool -_080527B4: - ldr r2, =0x0202437c - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0] - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_080527E4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atkA2_mirrorcoatdamagecalculator - - thumb_func_start atkA3_disablelastusedattack -atkA3_disablelastusedattack: @ 80527F8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r4, 0 - ldr r2, =0x02024084 - ldr r3, =0x0202420c - ldrb r1, [r3] - movs r0, 0x58 - muls r0, r1 - adds r7, r2, 0 - adds r7, 0xC - adds r0, r7 - ldr r5, =0x02024248 - lsls r1, 1 - adds r1, r5 - ldrh r0, [r0] - mov r9, r2 - adds r6, r3, 0 - ldr r2, =0x020242bc - mov r8, r2 - ldrh r1, [r1] - cmp r0, r1 - beq _0805284C - mov r12, r6 - movs r3, 0x58 -_0805282C: - adds r4, 0x1 - cmp r4, 0x3 - bgt _0805284C - lsls r2, r4, 1 - mov r0, r12 - ldrb r1, [r0] - adds r0, r1, 0 - muls r0, r3 - adds r2, r0 - adds r2, r7 - lsls r1, 1 - adds r1, r5 - ldrh r0, [r2] - ldrh r1, [r1] - cmp r0, r1 - bne _0805282C -_0805284C: - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r8 - ldrh r0, [r0, 0x4] - cmp r0, 0 - bne _08052910 - cmp r4, 0x4 - beq _08052910 - movs r5, 0x58 - adds r0, r1, 0 - muls r0, r5 - adds r0, r4, r0 - mov r1, r9 - adds r1, 0x24 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _08052910 - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - lsls r2, r4, 1 - ldrb r0, [r6] - muls r0, r5 - adds r0, r2, r0 - mov r3, r9 - adds r3, 0xC - adds r0, r3 - ldrh r0, [r0] - strb r0, [r1, 0x2] - ldrb r0, [r6] - muls r0, r5 - adds r0, r2, r0 - adds r0, r3 - ldrh r0, [r0] - lsrs r0, 8 - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r8 - muls r1, r5 - adds r2, r1 - adds r2, r3 - ldrh r1, [r2] - strh r1, [r0, 0x4] - bl GenerateRandomNumber - ldrb r2, [r6] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - add r1, r8 - movs r2, 0x3 - ands r2, r0 - adds r2, 0x2 - ldrb r3, [r1, 0xB] - movs r0, 0x10 - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0xB] - ldrb r0, [r6] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - add r1, r8 - ldrb r3, [r1, 0xB] - lsls r2, r3, 28 - lsrs r2, 24 - movs r0, 0xF - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0xB] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _0805292A - .pool -_08052910: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_0805292A: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkA3_disablelastusedattack - - thumb_func_start atkA4_setencore -atkA4_setencore: @ 805293C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r5, 0 - ldr r3, =0x02024084 - ldr r4, =0x0202420c - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - adds r6, r3, 0 - adds r6, 0xC - adds r0, r6 - ldr r2, =0x02024248 - lsls r1, 1 - adds r1, r2 - ldrh r0, [r0] - mov r10, r3 - mov r8, r2 - ldr r2, =0x020242bc - mov r9, r2 - ldrh r1, [r1] - cmp r0, r1 - beq _08052996 - mov r12, r4 - adds r7, r6, 0 - mov r6, r8 - movs r3, 0x58 -_08052976: - adds r5, 0x1 - cmp r5, 0x3 - bgt _08052996 - lsls r2, r5, 1 - mov r0, r12 - ldrb r1, [r0] - adds r0, r1, 0 - muls r0, r3 - adds r2, r0 - adds r2, r7 - lsls r1, 1 - adds r1, r6 - ldrh r0, [r2] - ldrh r1, [r1] - cmp r0, r1 - bne _08052976 -_08052996: - ldrb r0, [r4] - lsls r0, 1 - add r0, r8 - ldrh r2, [r0] - cmp r2, 0xA5 - beq _080529AA - cmp r2, 0xE3 - beq _080529AA - cmp r2, 0x77 - bne _080529AC -_080529AA: - movs r5, 0x4 -_080529AC: - ldrb r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - mov r2, r9 - adds r3, r0, r2 - ldrh r0, [r3, 0x6] - cmp r0, 0 - bne _08052A44 - cmp r5, 0x4 - beq _08052A44 - movs r0, 0x58 - adds r2, r1, 0 - muls r2, r0 - adds r0, r5, r2 - mov r1, r10 - adds r1, 0x24 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _08052A44 - lsls r0, r5, 1 - adds r0, r2 - subs r1, 0x18 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r3, 0x6] - ldrb r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r9 - strb r5, [r0, 0xC] - bl GenerateRandomNumber - ldrb r2, [r4] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - add r1, r9 - movs r2, 0x3 - ands r2, r0 - adds r2, 0x3 - ldrb r3, [r1, 0xE] - movs r0, 0x10 - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0xE] - ldrb r0, [r4] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - add r1, r9 - ldrb r3, [r1, 0xE] - lsls r2, r3, 28 - lsrs r2, 24 - movs r0, 0xF - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0xE] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _08052A5E - .pool -_08052A44: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08052A5E: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkA4_setencore - - thumb_func_start sub_8052A70 -sub_8052A70: @ 8052A70 - push {r4-r7,lr} - ldr r6, =0x02024084 - ldr r0, =0x0202420c - mov r12, r0 - ldrb r0, [r0] - movs r7, 0x58 - adds r2, r0, 0 - muls r2, r7 - adds r0, r6, 0 - adds r0, 0x50 - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - bne _08052B10 - ldr r5, =0x0202420b - ldrb r0, [r5] - muls r0, r7 - adds r0, r6 - ldrh r3, [r0, 0x28] - adds r0, r2, r6 - ldrh r1, [r0, 0x28] - adds r3, r1 - asrs r3, 1 - ldr r4, =0x020241f0 - subs r1, r3 - str r1, [r4] - ldr r2, =0x02024474 - strb r1, [r2] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - asrs r0, 8 - strb r0, [r2, 0x1] - movs r0, 0xFF - lsls r0, 16 - ands r0, r1 - asrs r0, 16 - strb r0, [r2, 0x2] - lsrs r1, 24 - strb r1, [r2, 0x3] - ldrb r0, [r5] - muls r0, r7 - adds r0, r6 - ldrh r0, [r0, 0x28] - subs r0, r3 - str r0, [r4] - ldr r2, =0x0202437c - mov r0, r12 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x4 - adds r0, r2 - ldr r1, =0x0000ffff - str r1, [r0] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _08052B2A - .pool -_08052B10: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08052B2A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8052A70 - - thumb_func_start atkA6_settypetorandomresistance -atkA6_settypetorandomresistance: @ 8052B34 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r1, =0x02024250 - ldr r4, =0x0202420b - ldrb r0, [r4] - lsls r0, 1 - adds r2, r0, r1 - ldrh r1, [r2] - cmp r1, 0 - beq _08052B7E - ldr r0, =0x0000ffff - cmp r1, r0 - beq _08052B7E - ldrh r0, [r2] - bl sub_8052F48 - lsls r0, 24 - cmp r0, 0 - beq _08052C1C - ldr r1, =0x02024084 - ldr r2, =0x02024270 - ldrb r0, [r4] - adds r0, r2 - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 5 - ands r0, r1 - cmp r0, 0 - beq _08052C1C -_08052B7E: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08052D08 - .pool -_08052BB4: - mov r0, r12 - strb r5, [r0] - mov r1, r10 - ldrb r0, [r1] - muls r0, r2 - adds r0, r7 - adds r0, 0x22 - strb r5, [r0] - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x3 - strb r0, [r1, 0x1] - strb r5, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r1, =0x02024214 - b _08052C0A - .pool -_08052BE0: - mov r0, r8 - adds r0, 0x1 - adds r0, r3 - ldrb r2, [r0] - strb r2, [r4] - mov r4, r10 - ldrb r0, [r4] - muls r0, r6 - ldr r7, =0x02024084 - adds r0, r7 - adds r0, 0x22 - strb r2, [r0] - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x3 - strb r0, [r1, 0x1] - strb r2, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - mov r1, r12 -_08052C0A: - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _08052D08 - .pool -_08052C1C: - movs r4, 0 - mov r8, r4 - movs r7, 0x7F - mov r9, r7 -_08052C24: - bl GenerateRandomNumber - mov r4, r9 - ands r4, r0 - cmp r4, 0x70 - bhi _08052C24 - lsls r0, r4, 1 - adds r4, r0, r4 - ldr r6, =gUnknown_0831ACE8 - adds r3, r4, r6 - ldr r1, =0x02024258 - ldr r2, =0x0202420b - ldrb r5, [r2] - lsls r0, r5, 1 - adds r0, r1 - ldrb r1, [r3] - mov r10, r2 - ldrh r0, [r0] - cmp r1, r0 - bne _08052C80 - adds r0, r4, 0x2 - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0x5 - bhi _08052C80 - ldr r7, =0x02024084 - movs r2, 0x58 - adds r0, r5, 0 - muls r0, r2 - adds r3, r0, r7 - movs r0, 0x21 - adds r0, r3 - mov r12, r0 - adds r0, r4, 0x1 - adds r0, r6 - ldrb r5, [r0] - mov r1, r12 - ldrb r0, [r1] - adds r1, r5, 0 - cmp r0, r1 - beq _08052C80 - adds r0, r3, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, r1 - bne _08052BB4 -_08052C80: - movs r7, 0x1 - add r8, r7 - ldr r0, =0x000003e7 - cmp r8, r0 - ble _08052C24 - movs r0, 0 - mov r8, r0 - ldr r1, =0x02024214 - mov r12, r1 - ldr r3, =gUnknown_0831ACE8 - adds r0, r4, 0x1 - adds r0, r3 - mov r9, r0 - adds r5, r3, 0 -_08052C9C: - ldrb r1, [r5] - cmp r1, 0xFF - bgt _08052CA6 - cmp r1, 0xFE - bge _08052CE0 -_08052CA6: - mov r4, r10 - ldrb r2, [r4] - lsls r0, r2, 1 - ldr r7, =0x02024258 - adds r0, r7 - ldrh r0, [r0] - cmp r1, r0 - bne _08052CE0 - ldrb r0, [r5, 0x2] - cmp r0, 0x5 - bhi _08052CE0 - movs r6, 0x58 - adds r0, r2, 0 - muls r0, r6 - ldr r1, =0x02024084 - adds r2, r0, r1 - adds r4, r2, 0 - adds r4, 0x21 - ldrb r0, [r4] - mov r7, r9 - ldrb r1, [r7] - cmp r0, r1 - beq _08052CE0 - adds r0, r2, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, r1 - beq _08052CE0 - b _08052BE0 -_08052CE0: - adds r5, 0x3 - movs r0, 0x3 - add r8, r0 - ldr r0, =0x0000014f - cmp r8, r0 - bls _08052C9C - mov r1, r12 - ldr r2, [r1] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - mov r4, r12 - str r1, [r4] -_08052D08: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkA6_settypetorandomresistance - - thumb_func_start atkA7_setalwayshitflag -atkA7_setalwayshitflag: @ 8052D34 - push {r4,lr} - ldr r4, =0x020242ac - ldr r3, =0x0202420c - ldrb r1, [r3] - lsls r1, 2 - adds r1, r4 - ldr r0, [r1] - movs r2, 0x19 - negs r2, r2 - ands r0, r2 - str r0, [r1] - ldrb r1, [r3] - lsls r1, 2 - adds r1, r4 - ldr r0, [r1] - movs r2, 0x10 - orrs r0, r2 - str r0, [r1] - ldr r2, =0x020242bc - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0202420b - ldrb r1, [r1] - strb r1, [r0, 0x15] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkA7_setalwayshitflag - - thumb_func_start atkA8_copymovepermanently -atkA8_copymovepermanently: @ 8052D8C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - ldr r0, =0x020241ec - ldr r1, =0x0000ffff - adds r5, r1, 0 - strh r5, [r0] - ldr r3, =0x02024084 - ldr r2, =0x0202420b - ldrb r1, [r2] - movs r0, 0x58 - adds r4, r1, 0 - muls r4, r0 - adds r0, r3, 0 - adds r0, 0x50 - adds r0, r4, r0 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 14 - ands r1, r0 - mov r12, r3 - mov r10, r2 - cmp r1, 0 - beq _08052DC4 - b _08052F18 -_08052DC4: - ldr r0, =0x02024240 - ldr r2, =0x0202420c - ldrb r1, [r2] - lsls r1, 1 - adds r1, r0 - ldrh r1, [r1] - mov r9, r0 - mov r8, r2 - cmp r1, 0xA5 - bne _08052DDA - b _08052F18 -_08052DDA: - cmp r1, 0 - bne _08052DE0 - b _08052F18 -_08052DE0: - cmp r1, r5 - bne _08052DE6 - b _08052F18 -_08052DE6: - cmp r1, 0xA6 - bne _08052DEC - b _08052F18 -_08052DEC: - movs r7, 0 - mov r5, r9 - mov r0, r12 - adds r0, 0xC - adds r1, r4, r0 - mov r3, r8 -_08052DF8: - ldrh r2, [r1] - cmp r2, 0xA6 - beq _08052E0A - ldrb r0, [r3] - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - cmp r2, r0 - beq _08052E12 -_08052E0A: - adds r1, 0x2 - adds r7, 0x1 - cmp r7, 0x3 - ble _08052DF8 -_08052E12: - cmp r7, 0x4 - beq _08052E18 - b _08052F18 -_08052E18: - ldr r4, =0x020241e8 - ldrb r1, [r4] - lsls r1, 1 - mov r2, r10 - ldrb r0, [r2] - movs r3, 0x58 - muls r0, r3 - adds r1, r0 - mov r6, r12 - adds r6, 0xC - adds r1, r6 - mov r2, r8 - ldrb r0, [r2] - lsls r0, 1 - add r0, r9 - ldrh r0, [r0] - strh r0, [r1] - mov r1, r10 - ldrb r0, [r1] - adds r2, r0, 0 - muls r2, r3 - ldrb r4, [r4] - adds r2, r4 - mov r5, r12 - adds r5, 0x24 - adds r2, r5 - ldr r4, =gBattleMoves - mov r1, r8 - ldrb r0, [r1] - lsls r0, 1 - add r0, r9 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x4] - strb r0, [r2] - ldr r1, =0x02024064 - mov r2, r10 - ldrb r0, [r2] - strb r0, [r1] - movs r7, 0 - ldrb r0, [r2] - muls r0, r3 - adds r4, r0, r5 - adds r3, r0, 0 - add r2, sp, 0x4 - add r5, sp, 0xC -_08052E7A: - adds r0, r3, r6 - ldrh r0, [r0] - strh r0, [r2] - adds r1, r5, r7 - ldrb r0, [r4] - strb r0, [r1] - adds r4, 0x1 - adds r3, 0x2 - adds r2, 0x2 - adds r7, 0x1 - cmp r7, 0x3 - ble _08052E7A - add r2, sp, 0x4 - mov r0, r10 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - add r0, r12 - adds r0, 0x3B - ldrb r0, [r0] - strb r0, [r2, 0xC] - str r2, [sp] - movs r0, 0 - movs r1, 0x3 - movs r2, 0 - movs r3, 0x10 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - ldr r3, =0x02024240 - ldr r2, =0x0202420c - ldrb r0, [r2] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - strb r0, [r1, 0x2] - ldrb r0, [r2] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - lsrs r0, 8 - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _08052F32 - .pool -_08052F18: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08052F32: - 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 atkA8_copymovepermanently - - thumb_func_start sub_8052F48 -sub_8052F48: @ 8052F48 - push {lr} - lsls r0, 16 - lsrs r0, 16 - ldr r2, =gBattleMoves - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1] - cmp r0, 0x91 - beq _08052F72 - cmp r0, 0x27 - beq _08052F72 - cmp r0, 0x4B - beq _08052F72 - cmp r0, 0x97 - beq _08052F72 - cmp r0, 0x9B - beq _08052F72 - cmp r0, 0x1A - bne _08052F7C -_08052F72: - movs r0, 0x1 - b _08052F7E - .pool -_08052F7C: - movs r0, 0 -_08052F7E: - pop {r1} - bx r1 - thumb_func_end sub_8052F48 - - thumb_func_start sub_8052F84 -sub_8052F84: @ 8052F84 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _08052FA2 - cmp r1, 0xD6 - beq _08052FA2 - movs r0, 0x89 - lsls r0, 1 - cmp r1, r0 - beq _08052FA2 - cmp r1, 0x77 - beq _08052FA2 - cmp r1, 0x76 - bne _08052FA6 -_08052FA2: - movs r0, 0x1 - b _08052FA8 -_08052FA6: - movs r0, 0 -_08052FA8: - pop {r1} - bx r1 - thumb_func_end sub_8052F84 - - thumb_func_start move_weather_interaction -move_weather_interaction: @ 8052FAC - push {lr} - lsls r1, 16 - lsrs r2, r1, 16 - ldr r1, =gBattleMoves - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0] - adds r3, r1, 0 - cmp r0, 0x97 - bne _08052FD0 - ldr r0, =0x020243cc - ldrh r1, [r0] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - bne _08053010 -_08052FD0: - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0] - cmp r0, 0x91 - beq _08052FF2 - cmp r0, 0x27 - beq _08052FF2 - cmp r0, 0x4B - beq _08052FF2 - cmp r0, 0x97 - beq _08052FF2 - cmp r0, 0x9B - beq _08052FF2 - cmp r0, 0x1A - bne _08053010 -_08052FF2: - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 20 - ands r0, r1 - cmp r0, 0 - beq _08053010 - movs r0, 0x1 - b _08053012 - .pool -_08053010: - movs r0, 0x2 -_08053012: - pop {r1} - bx r1 - thumb_func_end move_weather_interaction - - thumb_func_start sub_8053018 -sub_8053018: @ 8053018 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r6, 0 - movs r5, 0 - ldr r0, =0x0202420b - mov r9, r0 - movs r1, 0x58 - mov r8, r1 - ldr r7, =0x02024090 - movs r0, 0x84 - lsls r0, 1 - mov r10, r0 -_08053036: - lsls r4, r5, 1 - mov r1, r9 - ldrb r0, [r1] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r4, r0 - adds r0, r7 - ldrh r0, [r0] - bl sub_8052F84 - lsls r0, 24 - cmp r0, 0 - bne _08053076 - mov r1, r9 - ldrb r0, [r1] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r4, r0 - adds r0, r7 - ldrh r1, [r0] - cmp r1, r10 - beq _08053076 - cmp r1, 0xFD - beq _08053076 - adds r0, r1, 0 - bl sub_8052F48 - lsls r0, 24 - cmp r0, 0 - beq _08053084 -_08053076: - ldr r1, =gUnknown_0832A328 - lsls r0, r5, 2 - adds r0, r1 - ldr r0, [r0] - orrs r6, r0 - lsls r0, r6, 24 - lsrs r6, r0, 24 -_08053084: - adds r5, 0x1 - cmp r5, 0x3 - ble _08053036 - ldr r0, =0x0202420b - ldrb r0, [r0] - adds r1, r6, 0 - movs r2, 0xFD - bl sub_803FECC - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0xF - bne _080530B8 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _0805311C - .pool -_080530B8: - movs r7, 0x3 - ldr r4, =gUnknown_0832A328 -_080530BC: - bl GenerateRandomNumber - adds r5, r7, 0 - ands r5, r0 - lsls r0, r5, 2 - adds r0, r4 - ldr r0, [r0] - ands r0, r6 - cmp r0, 0 - bne _080530BC - ldr r4, =0x020241ee - ldr r2, =0x02024084 - lsls r1, r5, 1 - ldr r0, =0x0202420b - ldrb r3, [r0] - movs r0, 0x58 - muls r0, r3 - adds r1, r0 - adds r2, 0xC - adds r1, r2 - ldrh r0, [r1] - strh r0, [r4] - ldr r0, =0x020241e8 - strb r5, [r0] - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xfffffbff - ands r0, r1 - str r0, [r2] - ldrh r0, [r4] - movs r1, 0 - bl sub_80458E0 - ldr r1, =0x0202420c - strb r0, [r1] - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_0805311C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8053018 - - thumb_func_start atkAA_destinybondeffect -atkAA_destinybondeffect: @ 8053150 - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r2, r0 - adds r1, 0x50 - adds r2, r1 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 18 - orrs r0, r1 - str r0, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end atkAA_destinybondeffect - - thumb_func_start b_feature_update_destiny_bond -b_feature_update_destiny_bond: @ 8053180 - push {r4,r5,lr} - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x0202420c - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, =0x02024084 - ldrb r2, [r4] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 18 - ands r0, r1 - cmp r0, 0 - beq _080531CA - cmp r5, r3 - beq _080531CA - ldr r2, =0x02024280 - ldr r1, [r2] - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - bne _080531CA - movs r0, 0x40 - orrs r1, r0 - str r1, [r2] -_080531CA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end b_feature_update_destiny_bond - - thumb_func_start atkAB_802A458 -atkAB_802A458: @ 80531E0 - push {lr} - bl b_feature_update_destiny_bond - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atkAB_802A458 - - thumb_func_start atkAC_remaininghptopower -atkAC_remaininghptopower: @ 80531F8 - push {lr} - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r1, r0 - adds r1, r2 - movs r2, 0x28 - ldrsh r0, [r1, r2] - movs r2, 0x2C - ldrsh r1, [r1, r2] - movs r2, 0x30 - bl sub_8075034 - lsls r0, 24 - lsrs r1, r0, 24 - movs r3, 0 - ldr r0, =gUnknown_0831C408 - ldrb r2, [r0] - cmp r1, r2 - ble _08053232 - adds r2, r0, 0 -_08053224: - adds r3, 0x2 - cmp r3, 0xB - bgt _08053232 - adds r0, r3, r2 - ldrb r0, [r0] - cmp r1, r0 - bgt _08053224 -_08053232: - ldr r2, =0x02024400 - ldr r1, =gUnknown_0831C408 - adds r0, r3, 0x1 - adds r0, r1 - ldrb r0, [r0] - strh r0, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atkAC_remaininghptopower - - thumb_func_start atkAD_reducepprandom -atkAD_reducepprandom: @ 8053260 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r4, =0x02024248 - ldr r1, =0x0202420c - ldrb r3, [r1] - lsls r0, r3, 1 - adds r0, r4 - ldrh r2, [r0] - mov r8, r1 - cmp r2, 0 - bne _08053280 - b _08053408 -_08053280: - ldr r0, =0x0000ffff - cmp r2, r0 - bne _08053288 - b _08053408 -_08053288: - movs r7, 0 - ldr r0, =0x02024084 - movs r1, 0x58 - muls r1, r3 - adds r3, r0, 0 - adds r3, 0xC - adds r1, r3 - ldrh r1, [r1] - cmp r2, r1 - beq _080532C0 - adds r6, r4, 0 - mov r5, r8 - adds r4, r3, 0 - movs r3, 0x58 -_080532A4: - adds r7, 0x1 - cmp r7, 0x3 - bgt _080532C0 - ldrb r0, [r5] - lsls r2, r0, 1 - adds r2, r6 - lsls r1, r7, 1 - muls r0, r3 - adds r1, r0 - adds r1, r4 - ldrh r0, [r2] - ldrh r1, [r1] - cmp r0, r1 - bne _080532A4 -_080532C0: - cmp r7, 0x4 - bne _080532C6 - b _08053408 -_080532C6: - mov r4, r8 - ldrb r0, [r4] - movs r1, 0x58 - mov r9, r1 - mov r3, r9 - muls r3, r0 - adds r0, r3, 0 - adds r0, r7, r0 - ldr r1, =0x02024084 - adds r1, 0x24 - mov r10, r1 - add r0, r10 - ldrb r0, [r0] - cmp r0, 0x1 - bhi _080532E6 - b _08053408 -_080532E6: - bl GenerateRandomNumber - movs r1, 0x3 - ands r1, r0 - adds r6, r1, 0x2 - ldrb r0, [r4] - mov r3, r9 - muls r3, r0 - adds r0, r3, 0 - adds r0, r7, r0 - add r0, r10 - ldrb r0, [r0] - cmp r0, r6 - bge _08053304 - adds r6, r0, 0 -_08053304: - ldr r1, =0x02022f58 - movs r5, 0xFD - strb r5, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - ldr r2, =0x02024248 - mov r3, r8 - ldrb r0, [r3] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1, 0x2] - ldrb r0, [r3] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - lsrs r0, 8 - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r4, =0x02022f68 - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalString - strb r5, [r4] - movs r0, 0x1 - strb r0, [r4, 0x1] - strb r0, [r4, 0x2] - strb r0, [r4, 0x3] - strb r6, [r4, 0x4] - subs r0, 0x2 - strb r0, [r4, 0x5] - mov r1, r8 - ldrb r0, [r1] - mov r1, r9 - muls r1, r0 - adds r1, r7, r1 - add r1, r10 - ldrb r0, [r1] - subs r0, r6 - strb r0, [r1] - ldr r4, =0x02024064 - mov r3, r8 - ldrb r0, [r3] - strb r0, [r4] - ldr r1, =0x020242bc - ldrb r3, [r4] - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gUnknown_0832A328 - lsls r0, r7, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _080533B8 - mov r2, r9 - muls r2, r3 - ldr r0, =0x02024084 - adds r0, 0x50 - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _080533B8 - adds r1, r7, 0 - adds r1, 0x9 - lsls r1, 24 - lsrs r1, 24 - mov r3, r10 - adds r0, r2, r3 - adds r0, r7 - str r0, [sp] - movs r0, 0 - movs r2, 0 - movs r3, 0x1 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_080533B8: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - ldr r1, =0x02024084 - ldr r0, =0x0202420c - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r0, r7, r0 - adds r1, 0x24 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _08053422 - adds r0, r2, 0 - bl b_cancel_multi_turn_move_maybe - b _08053422 - .pool -_08053408: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08053422: - 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 atkAD_reducepprandom - - thumb_func_start atkAE_clearstatusifnotsoundproofed -atkAE_clearstatusifnotsoundproofed: @ 8053438 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - movs r4, 0 - str r4, [sp, 0x4] - mov r8, r4 - ldr r0, =0x020241ea - ldrh r0, [r0] - cmp r0, 0xD7 - beq _08053454 - b _0805363E -_08053454: - ldr r6, =0x02024332 - mov r0, r8 - strb r0, [r6, 0x5] - ldr r5, =0x0202420b - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x02024744 - mov r10, r1 - cmp r0, 0 - bne _08053470 - ldr r2, =0x020244ec - mov r10, r2 -_08053470: - ldr r4, =0x02024084 - ldrb r3, [r5] - movs r7, 0x58 - adds r2, r3, 0 - muls r2, r7 - adds r0, r2, r4 - adds r1, r0, 0 - adds r1, 0x20 - ldrb r0, [r1] - cmp r0, 0x2B - beq _080534C4 - adds r0, r4, 0 - adds r0, 0x4C - adds r0, r2, r0 - mov r1, r8 - str r1, [r0] - ldrb r0, [r5] - adds r2, r0, 0 - muls r2, r7 - adds r0, r4, 0 - adds r0, 0x50 - adds r2, r0 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] - b _080534D4 - .pool -_080534C4: - ldrb r1, [r1] - adds r0, r3, 0 - bl b_history__record_ability_usage_of_player - ldrb r0, [r6, 0x5] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r6, 0x5] -_080534D4: - ldr r7, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_get_per_side_status - movs r2, 0x2 - mov r9, r2 - mov r1, r9 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - ldr r1, =0x02024474 - strb r0, [r1, 0x17] - strb r0, [r7] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0805357A - ldr r0, =0x02024210 - ldrb r2, [r0] - ldr r1, =gUnknown_0832A328 - ldrb r3, [r7] - lsls r0, r3, 2 - adds r0, r1 - ldr r0, [r0] - ands r2, r0 - cmp r2, 0 - bne _0805357A - ldr r5, =0x02024084 - movs r6, 0x58 - adds r4, r3, 0 - muls r4, r6 - adds r0, r4, r5 - adds r1, r0, 0 - adds r1, 0x20 - ldrb r0, [r1] - cmp r0, 0x2B - beq _08053568 - adds r0, r5, 0 - adds r0, 0x4C - adds r0, r4, r0 - str r2, [r0] - ldrb r0, [r7] - adds r2, r0, 0 - muls r2, r6 - adds r0, r5, 0 - adds r0, 0x50 - adds r2, r0 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] - b _0805357A - .pool -_08053568: - ldrb r1, [r1] - adds r0, r3, 0 - bl b_history__record_ability_usage_of_player - ldr r1, =0x02024332 - ldrb r0, [r1, 0x5] - mov r2, r9 - orrs r0, r2 - strb r0, [r1, 0x5] -_0805357A: - movs r6, 0 - ldr r7, =0x02024084 -_0805357E: - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - add r4, r10 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0x2E - bl pokemon_getattr - lsls r0, 24 - lsrs r4, r0, 24 - cmp r5, 0 - beq _08053636 - movs r0, 0xCE - lsls r0, 1 - cmp r5, r0 - beq _08053636 - ldr r2, =0x0202406e - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r2 - ldrh r0, [r0] - cmp r0, r6 - bne _080535D0 - movs r0, 0x58 - muls r0, r1 - b _08053600 - .pool -_080535D0: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08053618 - ldr r0, =0x02024064 - ldrb r3, [r0] - lsls r0, r3, 1 - adds r0, r2 - ldrh r0, [r0] - cmp r0, r6 - bne _08053618 - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - lsls r0, r3, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08053618 - movs r0, 0x58 - muls r0, r3 -_08053600: - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - b _08053624 - .pool -_08053618: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_806B694 - lsls r0, 24 - lsrs r0, 24 -_08053624: - cmp r0, 0x2B - beq _08053636 - movs r0, 0x1 - lsls r0, r6 - mov r1, r8 - orrs r1, r0 - lsls r0, r1, 24 - lsrs r0, 24 - mov r8, r0 -_08053636: - adds r6, 0x1 - cmp r6, 0x5 - ble _0805357E - b _080536BC -_0805363E: - ldr r1, =0x02024332 - movs r0, 0x4 - strb r0, [r1, 0x5] - movs r2, 0x3F - mov r8, r2 - ldr r3, =0x02024084 - ldr r2, =0x0202420b - ldrb r0, [r2] - movs r5, 0x58 - muls r0, r5 - movs r1, 0x4C - adds r1, r3 - mov r9, r1 - add r0, r9 - str r4, [r0] - ldrb r0, [r2] - adds r1, r0, 0 - muls r1, r5 - adds r7, r3, 0 - adds r7, 0x50 - adds r1, r7 - ldr r0, [r1] - ldr r6, =0xf7ffffff - ands r0, r6 - str r0, [r1] - ldrb r0, [r2] - bl battle_get_per_side_status - movs r1, 0x2 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - ldr r4, =0x02024064 - strb r0, [r4] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080536BC - ldr r0, =0x02024210 - ldrb r2, [r0] - ldr r1, =gUnknown_0832A328 - ldrb r3, [r4] - lsls r0, r3, 2 - adds r0, r1 - ldr r0, [r0] - ands r2, r0 - cmp r2, 0 - bne _080536BC - adds r0, r3, 0 - muls r0, r5 - add r0, r9 - str r2, [r0] - ldrb r0, [r4] - adds r1, r0, 0 - muls r1, r5 - adds r1, r7 - ldr r0, [r1] - ands r0, r6 - str r0, [r1] -_080536BC: - mov r2, r8 - cmp r2, 0 - beq _080536DE - ldr r4, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r4] - add r0, sp, 0x4 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_080536DE: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - 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 atkAE_clearstatusifnotsoundproofed - - thumb_func_start atkAF_cursetarget -atkAF_cursetarget: @ 805371C - push {r4,r5,lr} - ldr r5, =0x02024084 - ldr r0, =0x0202420c - ldrb r0, [r0] - movs r4, 0x58 - adds r1, r0, 0 - muls r1, r4 - adds r0, r5, 0 - adds r0, 0x50 - adds r1, r0 - ldr r2, [r1] - movs r3, 0x80 - lsls r3, 21 - adds r0, r2, 0 - ands r0, r3 - cmp r0, 0 - beq _08053768 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0805378C - .pool -_08053768: - orrs r2, r3 - str r2, [r1] - ldr r1, =0x020241f0 - ldr r0, =0x0202420b - ldrb r0, [r0] - muls r0, r4 - adds r0, r5 - ldrh r0, [r0, 0x2C] - lsrs r0, 1 - str r0, [r1] - cmp r0, 0 - bne _08053784 - movs r0, 0x1 - str r0, [r1] -_08053784: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_0805378C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atkAF_cursetarget - - thumb_func_start atkB0_setspikes -atkB0_setspikes: @ 80537A0 - push {r4,lr} - ldr r4, =0x0202420b - ldrb r0, [r4] - bl battle_side_get_owner - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02024294 - lsls r2, r0, 1 - adds r0, r2, r0 - lsls r0, 2 - adds r3, r0, r1 - ldrb r0, [r3, 0xA] - cmp r0, 0x3 - bne _08053804 - ldr r2, =0x0202437c - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0] - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0805381E - .pool -_08053804: - ldr r1, =0x0202428e - adds r1, r2, r1 - ldrh r2, [r1] - movs r0, 0x10 - orrs r0, r2 - strh r0, [r1] - ldrb r0, [r3, 0xA] - adds r0, 0x1 - strb r0, [r3, 0xA] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_0805381E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkB0_setspikes - - thumb_func_start atkB1_setforesight -atkB1_setforesight: @ 805382C - ldr r1, =0x02024084 - ldr r0, =0x0202420c - ldrb r2, [r0] - movs r0, 0x58 - muls r2, r0 - adds r1, 0x50 - adds r2, r1 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 22 - orrs r0, r1 - str r0, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end atkB1_setforesight - - thumb_func_start atkB2_setperishsong -atkB2_setperishsong: @ 805385C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r6, 0 - movs r3, 0 - ldr r0, =0x0202406c - adds r7, r0, 0 - ldr r0, =0x0202420b - mov r8, r0 - ldrb r1, [r7] - cmp r6, r1 - bge _080538C8 - movs r5, 0x20 - ldr r0, =0x02024084 - mov r12, r0 - ldr r0, =0x020242bc - adds r4, r0, 0 - adds r4, 0xF - ldr r2, =0x020242ac -_08053884: - ldr r1, [r2] - adds r0, r1, 0 - ands r0, r5 - cmp r0, 0 - bne _0805389C - movs r0, 0x58 - muls r0, r3 - add r0, r12 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x2B - bne _080538B4 -_0805389C: - adds r6, 0x1 - b _080538BC - .pool -_080538B4: - orrs r1, r5 - str r1, [r2] - movs r0, 0x33 - strb r0, [r4] -_080538BC: - adds r4, 0x1C - adds r2, 0x4 - adds r3, 0x1 - ldrb r0, [r7] - cmp r3, r0 - blt _08053884 -_080538C8: - mov r1, r8 - ldrb r0, [r1] - bl sub_803F67C - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r6, r0 - bne _080538FC - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08053904 - .pool -_080538FC: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_08053904: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkB2_setperishsong - - thumb_func_start atkB3_rolloutdamagecalculation -atkB3_rolloutdamagecalculation: @ 8053914 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _08053948 - ldr r0, =0x0202420b - ldrb r0, [r0] - bl b_cancel_multi_turn_move_maybe - ldr r1, =0x02024214 - ldr r0, =gUnknown_082D8A60 - str r0, [r1] - b _08053A60 - .pool -_08053948: - ldr r2, =0x02024084 - ldr r1, =0x0202420b - ldrb r3, [r1] - movs r5, 0x58 - adds r0, r3, 0 - muls r0, r5 - adds r4, r2, 0 - adds r4, 0x50 - adds r0, r4 - ldr r0, [r0] - movs r7, 0x80 - lsls r7, 5 - ands r0, r7 - adds r6, r1, 0 - mov r9, r2 - ldr r1, =0x020242bc - mov r12, r1 - ldr r2, =0x020241ea - mov r8, r2 - cmp r0, 0 - bne _080539BA - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - add r0, r12 - ldrb r2, [r0, 0x11] - movs r1, 0x10 - negs r1, r1 - ands r1, r2 - movs r2, 0x5 - orrs r1, r2 - strb r1, [r0, 0x11] - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r12 - ldrb r2, [r0, 0x11] - movs r1, 0xF - ands r1, r2 - movs r2, 0x50 - orrs r1, r2 - strb r1, [r0, 0x11] - ldrb r0, [r6] - adds r1, r0, 0 - muls r1, r5 - adds r1, r4 - ldr r0, [r1] - orrs r0, r7 - str r0, [r1] - ldr r1, =0x02024268 - ldrb r0, [r6] - lsls r0, 1 - adds r0, r1 - mov r2, r8 - ldrh r1, [r2] - strh r1, [r0] -_080539BA: - ldrb r0, [r6] - lsls r2, r0, 3 - subs r2, r0 - lsls r2, 2 - add r2, r12 - ldrb r3, [r2, 0x11] - lsls r1, r3, 28 - lsrs r1, 28 - subs r1, 0x1 - movs r0, 0xF - ands r1, r0 - movs r0, 0x10 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x11] - cmp r1, 0 - bne _080539EE - ldrb r0, [r6] - adds r1, r0, 0 - muls r1, r5 - adds r1, r4 - ldr r0, [r1] - ldr r2, =0xffffefff - ands r0, r2 - str r0, [r1] -_080539EE: - ldr r3, =0x02024400 - ldr r2, =gBattleMoves - mov r0, r8 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - strh r0, [r3] - movs r2, 0x1 - ldrb r1, [r6] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - mov r1, r12 - adds r4, r0, r1 - ldrb r0, [r4, 0x11] - lsls r0, 28 - lsrs r0, 28 - movs r1, 0x5 - subs r1, r0 - ldr r7, =0x02024214 - adds r5, r3, 0 - cmp r2, r1 - bge _08053A3C - adds r1, r5, 0 - adds r3, r4, 0 - movs r4, 0x5 -_08053A28: - ldrh r0, [r1] - lsls r0, 1 - strh r0, [r1] - adds r2, 0x1 - ldrb r0, [r3, 0x11] - lsls r0, 28 - lsrs r0, 28 - subs r0, r4, r0 - cmp r2, r0 - blt _08053A28 -_08053A3C: - ldrb r1, [r6] - movs r0, 0x58 - muls r0, r1 - mov r1, r9 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 23 - ands r0, r1 - cmp r0, 0 - beq _08053A5A - ldrh r0, [r5] - lsls r0, 1 - strh r0, [r5] -_08053A5A: - ldr r0, [r7] - adds r0, 0x1 - str r0, [r7] -_08053A60: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkB3_rolloutdamagecalculation - - thumb_func_start atkB4_jumpifconfusedandattackmaxed -atkB4_jumpifconfusedandattackmaxed: @ 8053A90 - push {r4,r5,lr} - ldr r5, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - adds r3, r1, 0 - muls r3, r0 - adds r0, r5, 0 - adds r0, 0x50 - adds r0, r3, r0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - ldr r4, =0x02024214 - cmp r0, 0 - beq _08053AEC - ldr r2, [r4] - ldrb r0, [r2, 0x1] - adds r0, r3 - adds r1, r5, 0 - adds r1, 0x18 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0xC - bne _08053AEC - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08053AF2 - .pool -_08053AEC: - ldr r0, [r4] - adds r0, 0x6 - str r0, [r4] -_08053AF2: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end atkB4_jumpifconfusedandattackmaxed - - thumb_func_start sub_8053AF8 -sub_8053AF8: @ 8053AF8 - push {r4,r5,lr} - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _08053B34 - ldr r2, =0x020242bc - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strb r1, [r0, 0x10] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082D8A60 - str r0, [r1] - b _08053B8C - .pool -_08053B34: - ldr r5, =0x020242bc - ldr r4, =0x0202420b - ldrb r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r0, r5 - ldrb r0, [r1, 0x10] - cmp r0, 0x5 - beq _08053B4C - adds r0, 0x1 - strb r0, [r1, 0x10] -_08053B4C: - ldr r3, =0x02024400 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - strh r0, [r3] - movs r2, 0x1 - ldrb r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r4, =0x02024214 - ldrb r1, [r0, 0x10] - cmp r2, r1 - bge _08053B86 - adds r1, r3, 0 - adds r3, r0, 0 -_08053B78: - ldrh r0, [r1] - lsls r0, 1 - strh r0, [r1] - adds r2, 0x1 - ldrb r0, [r3, 0x10] - cmp r2, r0 - blt _08053B78 -_08053B86: - ldr r0, [r4] - adds r0, 0x1 - str r0, [r4] -_08053B8C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8053AF8 - - thumb_func_start atkB6_happinesstodamagecalculation -atkB6_happinesstodamagecalculation: @ 8053BAC - push {r4,lr} - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x79 - bne _08053BEC - ldr r4, =0x02024400 - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x2B - ldrb r1, [r0] - b _08053C02 - .pool -_08053BEC: - ldr r4, =0x02024400 - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x2B - ldrb r0, [r0] - movs r1, 0xFF - subs r1, r0 -_08053C02: - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - movs r1, 0x19 - bl __divsi3 - strh r0, [r4] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkB6_happinesstodamagecalculation - - thumb_func_start atkB7_presentdamagecalculation -atkB7_presentdamagecalculation: @ 8053C30 - push {r4,lr} - bl GenerateRandomNumber - movs r4, 0xFF - ands r4, r0 - cmp r4, 0x65 - bgt _08053C4C - ldr r1, =0x02024400 - movs r0, 0x28 - strh r0, [r1] - b _08053C8E - .pool -_08053C4C: - cmp r4, 0xB1 - bgt _08053C5C - ldr r1, =0x02024400 - movs r0, 0x50 - strh r0, [r1] - b _08053C8E - .pool -_08053C5C: - cmp r4, 0xCB - bgt _08053C6C - ldr r1, =0x02024400 - movs r0, 0x78 - strh r0, [r1] - b _08053C8E - .pool -_08053C6C: - ldr r3, =0x020241f0 - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x2C] - lsrs r0, 2 - str r0, [r3] - cmp r0, 0 - bne _08053C88 - movs r0, 0x1 - str r0, [r3] -_08053C88: - ldr r0, [r3] - negs r0, r0 - str r0, [r3] -_08053C8E: - cmp r4, 0xCB - bgt _08053CAC - ldr r1, =0x02024214 - ldr r0, =gUnknown_082D8A30 - b _08053CE6 - .pool -_08053CAC: - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r1, [r0, 0x2C] - ldrh r0, [r0, 0x28] - cmp r1, r0 - bne _08053CD8 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082D9EFB - b _08053CE6 - .pool -_08053CD8: - ldr r2, =0x0202427c - ldrb r1, [r2] - movs r0, 0xF7 - ands r0, r1 - strb r0, [r2] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082D9EE1 -_08053CE6: - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkB7_presentdamagecalculation - - thumb_func_start atkB8_setsafeguard -atkB8_setsafeguard: @ 8053CFC - push {r4-r7,lr} - ldr r7, =0x0202420b - ldrb r0, [r7] - bl battle_get_per_side_status - ldr r4, =0x0202428e - movs r6, 0x1 - adds r1, r6, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - ldrh r1, [r1] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08053D40 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0 - strb r0, [r1, 0x5] - b _08053D88 - .pool -_08053D40: - ldrb r0, [r7] - bl battle_get_per_side_status - adds r1, r6, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - ldrh r0, [r1] - movs r2, 0x20 - orrs r0, r2 - strh r0, [r1] - ldrb r0, [r7] - bl battle_get_per_side_status - ldr r5, =0x02024294 - adds r1, r6, 0 - ands r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r4, 0x5 - strb r4, [r0, 0x6] - ldrb r0, [r7] - bl battle_get_per_side_status - adds r1, r6, 0 - ands r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r1, [r7] - strb r1, [r0, 0x7] - ldr r0, =0x02024332 - strb r4, [r0, 0x5] -_08053D88: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkB8_setsafeguard - - thumb_func_start atkB9_magnitudedamagecalculation -atkB9_magnitudedamagecalculation: @ 8053DA4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x4 - bgt _08053DD0 - ldr r1, =0x02024400 - movs r0, 0xA - strh r0, [r1] - movs r3, 0x4 - b _08053E3C - .pool -_08053DD0: - cmp r3, 0xE - bgt _08053DE4 - ldr r1, =0x02024400 - movs r0, 0x1E - strh r0, [r1] - movs r3, 0x5 - b _08053E3C - .pool -_08053DE4: - cmp r3, 0x22 - bgt _08053DF8 - ldr r1, =0x02024400 - movs r0, 0x32 - strh r0, [r1] - movs r3, 0x6 - b _08053E3C - .pool -_08053DF8: - cmp r3, 0x40 - bgt _08053E0C - ldr r1, =0x02024400 - movs r0, 0x46 - strh r0, [r1] - movs r3, 0x7 - b _08053E3C - .pool -_08053E0C: - cmp r3, 0x54 - bgt _08053E20 - ldr r1, =0x02024400 - movs r0, 0x5A - strh r0, [r1] - movs r3, 0x8 - b _08053E3C - .pool -_08053E20: - cmp r3, 0x5E - bgt _08053E34 - ldr r1, =0x02024400 - movs r0, 0x6E - strh r0, [r1] - movs r3, 0x9 - b _08053E3C - .pool -_08053E34: - ldr r1, =0x02024400 - movs r0, 0x96 - strh r0, [r1] - movs r3, 0xA -_08053E3C: - ldr r1, =0x02022f58 - movs r2, 0 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x1 - strb r0, [r1, 0x1] - strb r0, [r1, 0x2] - movs r0, 0x2 - strb r0, [r1, 0x3] - strb r3, [r1, 0x4] - movs r0, 0xFF - strb r0, [r1, 0x5] - ldr r1, =0x0202420c - strb r2, [r1] - ldr r0, =0x0202406c - ldrb r3, [r0] - adds r6, r1, 0 - ldr r0, =0x02024214 - mov r8, r0 - cmp r2, r3 - bcs _08053E94 - adds r4, r6, 0 - ldr r0, =0x0202420b - ldrb r5, [r0] - ldr r1, =gUnknown_0832A328 - mov r12, r1 - ldr r7, =0x02024210 -_08053E72: - ldrb r2, [r4] - cmp r2, r5 - beq _08053E88 - ldrb r0, [r7] - ldrb r1, [r6] - lsls r1, 2 - add r1, r12 - ldr r1, [r1] - ands r0, r1 - cmp r0, 0 - beq _08053E94 -_08053E88: - adds r0, r2, 0x1 - strb r0, [r4] - lsls r0, 24 - lsrs r0, 24 - cmp r0, r3 - bcc _08053E72 -_08053E94: - mov r1, r8 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkB9_magnitudedamagecalculation - - thumb_func_start atkBA_802B140 -atkBA_802B140: @ 8053EC8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x02024212 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08053EF8 - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08053EF4 - movs r0, 0x1 - b _08053F12 - .pool -_08053EF4: - movs r0, 0 - b _08053F12 -_08053EF8: - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08053F10 - movs r0, 0x3 - b _08053F12 - .pool -_08053F10: - movs r0, 0x2 -_08053F12: - bl battle_get_side_with_given_state - ldr r1, =0x0202420c - strb r0, [r1] - ldr r0, =0x0202421c - ldr r1, =0x0202420c - ldrb r3, [r1] - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0 - beq _08053F2A - b _08054030 -_08053F2A: - ldr r5, =0x0202420b - ldr r0, =0x0202449c - ldr r1, [r0] - adds r1, r3, r1 - ldrb r2, [r5] - ldrb r1, [r1, 0xC] - cmp r2, r1 - bne _08054030 - ldr r4, =0x02024084 - movs r2, 0x58 - adds r0, r3, 0 - muls r0, r2 - adds r1, r4, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x27 - ands r0, r1 - cmp r0, 0 - bne _08054030 - ldrb r0, [r5] - muls r0, r2 - adds r0, r4 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08054030 - ldr r0, =0x020242bc - lsls r1, r3, 3 - subs r1, r3 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x18] - lsls r0, 31 - cmp r0, 0 - bne _08054030 - ldr r0, =0x02024274 - lsls r1, r3, 1 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0xE4 - bne _08054030 - movs r1, 0 - ldr r0, =0x0202406c - ldr r2, =0x020241ea - mov r8, r2 - ldr r7, =0x020241e8 - mov r10, r7 - ldr r2, =0x020241e9 - mov r9, r2 - ldr r7, =0x02024280 - mov r12, r7 - ldrb r2, [r0] - cmp r1, r2 - bge _08053FB6 - ldr r6, =0x0202407e - ldr r5, =0x0202420c - ldr r4, =0x0202407a - movs r3, 0xB - adds r2, r0, 0 -_08053FA0: - adds r0, r1, r6 - ldrb r0, [r0] - ldrb r7, [r5] - cmp r0, r7 - bne _08053FAE - adds r0, r1, r4 - strb r3, [r0] -_08053FAE: - adds r1, 0x1 - ldrb r0, [r2] - cmp r1, r0 - blt _08053FA0 -_08053FB6: - movs r0, 0xE4 - mov r1, r8 - strh r0, [r1] - ldr r2, =0x0202420c - ldrb r0, [r2] - ldr r7, =0x0202449c - ldr r1, [r7] - adds r0, r1 - adds r0, 0x80 - ldrb r0, [r0] - mov r1, r9 - strb r0, [r1] - mov r2, r10 - strb r0, [r2] - ldr r7, =0x02024214 - ldr r0, [r7] - adds r0, 0x5 - str r0, [r7] - movs r0, 0x1 - ldr r1, =0x02024474 - strb r0, [r1, 0x18] - mov r2, r12 - ldr r0, [r2] - ldr r1, =0xfffffbff - ands r0, r1 - str r0, [r2] - b _0805404A - .pool -_08054030: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_0805404A: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkBA_802B140 - - thumb_func_start sub_805405C -sub_805405C: @ 805405C - push {lr} - ldr r2, =0x020243cc - ldrh r1, [r2] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _08054088 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1, 0x5] - b _0805409A - .pool -_08054088: - movs r0, 0x20 - strh r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x4 - strb r0, [r1, 0x5] - ldr r0, =0x020243d0 - adds r0, 0x28 - movs r1, 0x5 - strb r1, [r0] -_0805409A: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_805405C - - thumb_func_start atkBC_maxattackhalvehp -atkBC_maxattackhalvehp: @ 80540B4 - push {r4,r5,lr} - ldr r5, =0x02024084 - ldr r4, =0x0202420b - ldrb r0, [r4] - movs r3, 0x58 - muls r0, r3 - adds r2, r0, r5 - ldrh r0, [r2, 0x2C] - lsrs r1, r0, 1 - cmp r1, 0 - bne _080540CC - movs r1, 0x1 -_080540CC: - movs r0, 0x19 - ldrsb r0, [r2, r0] - cmp r0, 0xB - bgt _08054110 - ldrh r0, [r2, 0x28] - cmp r0, r1 - bls _08054110 - movs r0, 0xC - strb r0, [r2, 0x19] - ldr r1, =0x020241f0 - ldrb r0, [r4] - muls r0, r3 - adds r0, r5 - ldrh r0, [r0, 0x2C] - lsrs r0, 1 - str r0, [r1] - cmp r0, 0 - bne _080540F4 - movs r0, 0x1 - str r0, [r1] -_080540F4: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _0805412A - .pool -_08054110: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_0805412A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atkBC_maxattackhalvehp - - thumb_func_start atkBD_copyfoestats -atkBD_copyfoestats: @ 8054134 - push {r4-r7,lr} - movs r2, 0 - ldr r7, =0x02024214 - ldr r6, =0x0202420b - movs r4, 0x58 - ldr r3, =0x0202409c - ldr r5, =0x0202420c -_08054142: - ldrb r0, [r6] - adds r1, r0, 0 - muls r1, r4 - adds r1, r2, r1 - adds r1, r3 - ldrb r0, [r5] - muls r0, r4 - adds r0, r2, r0 - adds r0, r3 - ldrb r0, [r0] - strb r0, [r1] - adds r2, 0x1 - cmp r2, 0x7 - ble _08054142 - ldr r0, [r7] - adds r0, 0x5 - str r0, [r7] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkBD_copyfoestats - - thumb_func_start atkBE_breakfree -atkBE_breakfree: @ 805417C - push {r4-r6,lr} - ldr r1, =0x02024084 - ldr r5, =0x0202420b - ldrb r2, [r5] - movs r6, 0x58 - adds r0, r2, 0 - muls r0, r6 - adds r4, r1, 0 - adds r4, 0x50 - adds r0, r4 - ldr r0, [r0] - movs r1, 0xE0 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _08054210 - ldr r1, =0x02024474 - ldr r3, =0x0202420c - ldrb r0, [r3] - strb r0, [r1, 0x17] - ldrb r0, [r5] - adds r1, r0, 0 - muls r1, r6 - adds r1, r4 - ldr r0, [r1] - ldr r2, =0xffff1fff - ands r0, r2 - str r0, [r1] - ldrb r0, [r5] - ldr r1, =0x0202449c - ldr r2, [r1] - adds r0, r2 - ldrb r0, [r0, 0x14] - strb r0, [r3] - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - ldrb r0, [r5] - lsls r0, 1 - adds r0, r2 - ldrb r0, [r0, 0x4] - strb r0, [r1, 0x2] - ldrb r0, [r5] - lsls r0, 1 - adds r0, r2 - ldrb r0, [r0, 0x5] - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAFC5 - b _080542BA - .pool -_08054210: - ldr r4, =0x020242ac - lsls r0, r2, 2 - adds r3, r0, r4 - ldr r1, [r3] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08054250 - movs r0, 0x5 - negs r0, r0 - ands r1, r0 - str r1, [r3] - ldrb r1, [r5] - lsls r1, 2 - adds r1, r4 - ldr r0, [r1] - movs r2, 0x4 - negs r2, r2 - ands r0, r2 - str r0, [r1] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAFD6 - b _080542BA - .pool -_08054250: - adds r0, r2, 0 - bl battle_side_get_owner - ldr r4, =0x0202428e - lsls r0, 24 - lsrs r0, 23 - adds r0, r4 - ldrh r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080542B4 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 23 - adds r0, r4 - ldrh r2, [r0] - ldr r1, =0x0000ffef - ands r1, r2 - movs r4, 0 - strh r1, [r0] - ldrb r0, [r5] - bl battle_side_get_owner - ldr r2, =0x02024294 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - strb r4, [r1, 0xA] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DAFDD - b _080542BA - .pool -_080542B4: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 -_080542BA: - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atkBE_breakfree - - thumb_func_start atkBF_setcurled -atkBF_setcurled: @ 80542C8 - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r2, r0 - adds r1, 0x50 - adds r2, r1 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 23 - orrs r0, r1 - str r0, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end atkBF_setcurled - - thumb_func_start atkC0_recoverbasedonsunlight -atkC0_recoverbasedonsunlight: @ 80542F8 - push {r4-r7,lr} - sub sp, 0x4 - ldr r1, =0x0202420c - ldr r5, =0x0202420b - ldrb r0, [r5] - strb r0, [r1] - ldr r7, =0x02024084 - ldrb r0, [r5] - movs r6, 0x58 - muls r0, r6 - adds r0, r7 - ldrh r1, [r0, 0x28] - ldrh r0, [r0, 0x2C] - cmp r1, r0 - beq _080543D8 - ldr r4, =0x020243cc - ldrh r0, [r4] - cmp r0, 0 - beq _0805434A - movs r0, 0 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0805434A - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _08054378 -_0805434A: - ldr r3, =0x020241f0 - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x2C] - lsrs r0, 1 - str r0, [r3] - adds r1, r3, 0 - b _080543B2 - .pool -_08054378: - ldrh r1, [r4] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _080543A4 - ldr r4, =0x020241f0 - ldrb r0, [r5] - muls r0, r6 - adds r0, r7 - ldrh r1, [r0, 0x2C] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - movs r1, 0x1E - bl __divsi3 - str r0, [r4] - adds r1, r4, 0 - b _080543B2 - .pool -_080543A4: - ldr r1, =0x020241f0 - ldrb r0, [r5] - muls r0, r6 - adds r0, r7 - ldrh r0, [r0, 0x2C] - lsrs r0, 2 - str r0, [r1] -_080543B2: - adds r2, r1, 0 - ldr r0, [r2] - cmp r0, 0 - bne _080543BE - movs r0, 0x1 - str r0, [r2] -_080543BE: - ldr r0, [r1] - negs r0, r0 - str r0, [r1] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _080543F2 - .pool -_080543D8: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_080543F2: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkC0_recoverbasedonsunlight - - thumb_func_start sub_8054400 -sub_8054400: @ 8054400 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - adds r4, r1, 0 - muls r4, r0 - adds r4, r2 - ldrb r0, [r4, 0x14] - mov r10, r0 - mov r7, r10 - lsls r7, 27 - adds r0, r7, 0 - lsrs r0, 27 - mov r10, r0 - movs r1, 0x2 - mov r2, r10 - ands r2, r1 - asrs r2, 1 - ldrh r7, [r4, 0x14] - mov r9, r7 - mov r0, r9 - lsls r0, 22 - mov r9, r0 - lsrs r3, r0, 27 - adds r0, r1, 0 - ands r0, r3 - orrs r2, r0 - ldrb r7, [r4, 0x15] - mov r8, r7 - mov r0, r8 - lsls r0, 25 - mov r8, r0 - lsrs r3, r0, 27 - adds r0, r1, 0 - ands r0, r3 - lsls r0, 1 - orrs r2, r0 - ldr r6, [r4, 0x14] - lsls r6, 12 - lsrs r3, r6, 27 - adds r0, r1, 0 - ands r0, r3 - lsls r0, 2 - orrs r2, r0 - ldrh r5, [r4, 0x16] - lsls r5, 23 - lsrs r3, r5, 27 - adds r0, r1, 0 - ands r0, r3 - lsls r0, 3 - orrs r2, r0 - ldrb r3, [r4, 0x17] - lsls r3, 26 - lsrs r0, r3, 27 - ands r1, r0 - lsls r1, 4 - orrs r2, r1 - movs r1, 0x1 - adds r4, r1, 0 - mov r7, r10 - ands r4, r7 - mov r0, r9 - lsrs r0, 27 - mov r9, r0 - adds r0, r1, 0 - mov r7, r9 - ands r0, r7 - lsls r0, 1 - orrs r4, r0 - mov r0, r8 - lsrs r0, 27 - mov r8, r0 - adds r0, r1, 0 - mov r7, r8 - ands r0, r7 - lsls r0, 2 - orrs r4, r0 - lsrs r6, 27 - adds r0, r1, 0 - ands r0, r6 - lsls r0, 3 - orrs r4, r0 - lsrs r5, 27 - adds r0, r1, 0 - ands r0, r5 - lsls r0, 4 - orrs r4, r0 - lsrs r3, 27 - ands r1, r3 - lsls r1, 5 - orrs r4, r1 - ldr r5, =0x02024400 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - movs r1, 0x3F - bl __divsi3 - adds r0, 0x1E - strh r0, [r5] - ldr r6, =0x0202449c - ldr r5, [r6] - lsls r0, r4, 4 - subs r0, r4 - movs r1, 0x3F - bl __divsi3 - adds r0, 0x1 - strb r0, [r5, 0x13] - ldr r1, [r6] - ldrb r0, [r1, 0x13] - cmp r0, 0x8 - bls _080544F0 - adds r0, 0x1 - strb r0, [r1, 0x13] -_080544F0: - ldr r2, [r6] - ldrb r0, [r2, 0x13] - movs r1, 0xC0 - orrs r0, r1 - strb r0, [r2, 0x13] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8054400 - - thumb_func_start atkC2_selectnexttarget -atkC2_selectnexttarget: @ 8054524 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x0202420c - movs r1, 0 - strb r1, [r0] - ldr r1, =0x0202406c - ldrb r1, [r1] - adds r6, r0, 0 - ldr r0, =0x02024214 - mov r8, r0 - cmp r1, 0 - beq _0805456E - adds r3, r6, 0 - ldr r0, =0x0202420b - ldrb r5, [r0] - ldr r0, =gUnknown_0832A328 - mov r12, r0 - adds r4, r1, 0 - ldr r7, =0x02024210 -_0805454C: - ldrb r2, [r3] - cmp r2, r5 - beq _08054562 - ldrb r0, [r7] - ldrb r1, [r6] - lsls r1, 2 - add r1, r12 - ldr r1, [r1] - ands r0, r1 - cmp r0, 0 - beq _0805456E -_08054562: - adds r0, r2, 0x1 - strb r0, [r3] - lsls r0, 24 - lsrs r0, 24 - cmp r0, r4 - bcc _0805454C -_0805456E: - mov r1, r8 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkC2_selectnexttarget - - thumb_func_start atkC3_setfutureattack -atkC3_setfutureattack: @ 8054598 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - ldr r0, =0x020243d0 - mov r8, r0 - ldr r6, =0x0202420c - ldrb r1, [r6] - adds r0, r1, r0 - ldrb r7, [r0] - cmp r7, 0 - beq _080545DC - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _080546CC - .pool -_080545DC: - adds r0, r1, 0 - bl battle_get_per_side_status - ldr r4, =0x0202428e - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - mov r10, r1 - ands r0, r1 - lsls r0, 1 - adds r0, r4 - ldrh r2, [r0] - movs r1, 0x40 - movs r5, 0 - mov r3, sp - strh r5, [r3, 0x10] - orrs r1, r2 - strh r1, [r0] - ldrb r0, [r6] - lsls r0, 1 - mov r1, r8 - adds r1, 0x18 - adds r0, r1 - ldr r1, =0x020241ea - mov r9, r1 - ldrh r1, [r1] - strh r1, [r0] - mov r0, r8 - adds r0, 0x4 - ldrb r2, [r6] - adds r0, r2 - ldr r5, =0x0202420b - ldrb r1, [r5] - strb r1, [r0] - ldrb r0, [r6] - add r0, r8 - movs r1, 0x3 - strb r1, [r0] - ldrb r0, [r6] - bl battle_get_per_side_status - mov r1, r10 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - ldrh r3, [r1] - ldrb r0, [r5] - movs r4, 0x58 - muls r0, r4 - ldr r2, =0x02024084 - adds r0, r2 - ldrb r1, [r6] - muls r1, r4 - adds r1, r2 - mov r4, r9 - ldrh r2, [r4] - str r7, [sp] - str r7, [sp, 0x4] - ldrb r4, [r5] - str r4, [sp, 0x8] - ldrb r4, [r6] - str r4, [sp, 0xC] - bl sub_806957C - ldrb r1, [r6] - lsls r1, 2 - mov r2, r8 - adds r2, 0x8 - adds r1, r2 - str r0, [r1] - ldr r1, =0x0202433c - ldrb r0, [r5] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 28 - cmp r0, 0 - bge _0805468C - ldrb r4, [r6] - lsls r4, 2 - adds r4, r2 - ldr r1, [r4] - lsls r0, r1, 4 - subs r0, r1 - movs r1, 0xA - bl __divsi3 - str r0, [r4] -_0805468C: - mov r5, r9 - ldrh r1, [r5] - ldr r0, =0x00000161 - cmp r1, r0 - bne _080546BC - ldr r0, =0x02024332 - mov r1, r10 - strb r1, [r0, 0x5] - b _080546C4 - .pool -_080546BC: - ldr r0, =0x02024332 - mov r2, sp - ldrb r2, [r2, 0x10] - strb r2, [r0, 0x5] -_080546C4: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_080546CC: - 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 atkC3_setfutureattack - - thumb_func_start atkC4_802B910 -atkC4_802B910: @ 80546E4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - ldr r7, =0x02024744 - cmp r0, 0 - bne _080546FE - ldr r7, =0x020244ec -_080546FE: - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08054740 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - b _080548DC - .pool -_08054740: - ldr r6, =0x02024332 - ldrb r0, [r6] - mov r8, r0 - cmp r0, 0x5 - bls _0805474C - b _080548A8 -_0805474C: - adds r4, r6, 0 - movs r5, 0x64 -_08054750: - ldrb r0, [r4] - muls r0, r5 - adds r0, r7, r0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08054794 - ldrb r0, [r6] - muls r0, r5 - adds r0, r7, r0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _08054794 - ldrb r0, [r4] - muls r0, r5 - adds r0, r7, r0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _08054794 - ldrb r0, [r4] - muls r0, r5 - adds r0, r7, r0 - movs r1, 0x37 - bl pokemon_getattr - cmp r0, 0 - beq _080547A4 -_08054794: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - adds r6, r4, 0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bls _08054750 -_080547A4: - ldr r1, =0x02024332 - mov r9, r1 - ldrb r2, [r1] - cmp r2, 0x5 - bhi _080548A8 - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x4 - strb r0, [r1, 0x1] - ldr r6, =0x0202420b - ldrb r0, [r6] - strb r0, [r1, 0x2] - strb r2, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x9 - str r0, [r1] - ldr r2, =0x020241f0 - mov r8, r2 - ldr r5, =gBaseStats - mov r1, r9 - ldrb r0, [r1] - movs r4, 0x64 - muls r0, r4 - adds r0, r7, r0 - movs r1, 0xB - bl pokemon_getattr - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r3, [r1, 0x1] - mov r2, r8 - str r3, [r2] - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - muls r0, r3 - mov r1, r8 - str r0, [r1] - mov r2, r9 - ldrb r0, [r2] - muls r0, r4 - adds r0, r7, r0 - movs r1, 0x38 - bl pokemon_getattr - lsls r0, 1 - movs r1, 0x5 - bl __udivsi3 - adds r0, 0x2 - mov r2, r8 - ldr r1, [r2] - muls r0, r1 - str r0, [r2] - ldr r3, =0x02024084 - ldr r1, =0x0202420c - ldrb r2, [r1] - movs r1, 0x58 - muls r1, r2 - adds r1, r3 - ldrh r2, [r1] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r5 - ldrb r1, [r1, 0x2] - bl __divsi3 - mov r1, r8 - str r0, [r1] - movs r1, 0x32 - bl __divsi3 - adds r2, r0, 0x2 - mov r0, r8 - str r2, [r0] - ldr r1, =0x0202433c - ldrb r0, [r6] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 28 - cmp r0, 0 - bge _08054870 - lsls r0, r2, 4 - subs r0, r2 - movs r1, 0xA - bl __divsi3 - mov r1, r8 - str r0, [r1] -_08054870: - mov r2, r9 - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - b _080548E2 - .pool -_080548A8: - mov r0, r8 - cmp r0, 0 - beq _080548C8 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - b _080548DC - .pool -_080548C8: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x8] -_080548DC: - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_080548E2: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkC4_802B910 - - thumb_func_start atkC5_hidepreattack -atkC5_hidepreattack: @ 80548F4 - push {lr} - ldr r0, =0x020241ea - ldrh r1, [r0] - cmp r1, 0x5B - beq _08054934 - cmp r1, 0x5B - bgt _0805490C - cmp r1, 0x13 - beq _08054918 - b _08054960 - .pool -_0805490C: - ldr r0, =0x00000123 - cmp r1, r0 - beq _0805494C - adds r0, 0x31 - cmp r1, r0 - bne _08054960 -_08054918: - ldr r2, =0x020242ac - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r1, 2 - adds r1, r2 - ldr r0, [r1] - movs r2, 0x40 - b _0805495C - .pool -_08054934: - ldr r2, =0x020242ac - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r1, 2 - adds r1, r2 - ldr r0, [r1] - movs r2, 0x80 - b _0805495C - .pool -_0805494C: - ldr r2, =0x020242ac - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r1, 2 - adds r1, r2 - ldr r0, [r1] - movs r2, 0x80 - lsls r2, 11 -_0805495C: - orrs r0, r2 - str r0, [r1] -_08054960: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atkC5_hidepreattack - - thumb_func_start atkC6_unhidepostattack -atkC6_unhidepostattack: @ 8054978 - push {lr} - ldr r0, =0x020241ea - ldrh r1, [r0] - cmp r1, 0x5B - beq _080549BC - cmp r1, 0x5B - bgt _08054990 - cmp r1, 0x13 - beq _0805499C - b _080549EA - .pool -_08054990: - ldr r0, =0x00000123 - cmp r1, r0 - beq _080549D8 - adds r0, 0x31 - cmp r1, r0 - bne _080549EA -_0805499C: - ldr r2, =0x020242ac - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r1, 2 - adds r1, r2 - ldr r0, [r1] - movs r2, 0x41 - negs r2, r2 - b _080549E6 - .pool -_080549BC: - ldr r2, =0x020242ac - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r1, 2 - adds r1, r2 - ldr r0, [r1] - movs r2, 0x81 - negs r2, r2 - b _080549E6 - .pool -_080549D8: - ldr r2, =0x020242ac - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r1, 2 - adds r1, r2 - ldr r0, [r1] - ldr r2, =0xfffbffff -_080549E6: - ands r0, r2 - str r0, [r1] -_080549EA: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atkC6_unhidepostattack - - thumb_func_start atkC7_setminimize -atkC7_setminimize: @ 8054A08 - push {lr} - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 18 - ands r0, r1 - cmp r0, 0 - beq _08054A2C - ldr r2, =0x020242ac - ldr r0, =0x0202420b - ldrb r1, [r0] - lsls r1, 2 - adds r1, r2 - ldr r0, [r1] - movs r2, 0x80 - lsls r2, 1 - orrs r0, r2 - str r0, [r1] -_08054A2C: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atkC7_setminimize - - thumb_func_start sub_8054A48 -sub_8054A48: @ 8054A48 - push {lr} - ldr r3, =0x020243cc - ldrh r1, [r3] - movs r2, 0x80 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _08054A78 - ldr r2, =0x0202427c - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1, 0x5] - b _08054A86 - .pool -_08054A78: - strh r2, [r3] - ldr r0, =0x02024332 - movs r1, 0x5 - strb r1, [r0, 0x5] - ldr r0, =0x020243d0 - adds r0, 0x28 - strb r1, [r0] -_08054A86: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8054A48 - - thumb_func_start atkC9_jumpifattackandspecialattackcannotfall -atkC9_jumpifattackandspecialattackcannotfall: @ 8054AA0 - push {r4,lr} - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r1, r0, r2 - movs r0, 0x19 - ldrsb r0, [r1, r0] - adds r3, r2, 0 - cmp r0, 0 - bne _08054AF4 - movs r0, 0x1C - ldrsb r0, [r1, r0] - cmp r0, 0 - bne _08054AF4 - ldr r0, =0x02024332 - ldrb r0, [r0, 0x6] - cmp r0, 0x1 - beq _08054AF4 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08054B20 - .pool -_08054AF4: - ldr r4, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r4] - ldr r2, =0x020241f0 - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - adds r0, r3 - ldrh r0, [r0, 0x28] - str r0, [r2] - ldr r1, =0x00007fff - movs r0, 0 - bl dp01_build_cmdbuf_x18_0_aa_health_bar_update - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_08054B20: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkC9_jumpifattackandspecialattackcannotfall - - thumb_func_start atkCA_setforcedtarget -atkCA_setforcedtarget: @ 8054B3C - push {r4,r5,lr} - ldr r4, =0x0202420b - ldrb r0, [r4] - bl battle_side_get_owner - ldr r5, =0x02024294 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - movs r0, 0x1 - strb r0, [r1, 0x8] - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r4] - strb r0, [r1, 0x9] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atkCA_setforcedtarget - - thumb_func_start atkCB_setcharge -atkCB_setcharge: @ 8054B88 - push {r4,lr} - ldr r0, =0x020242ac - ldr r3, =0x0202420b - ldrb r1, [r3] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - movs r2, 0x80 - lsls r2, 2 - orrs r0, r2 - str r0, [r1] - ldr r4, =0x020242bc - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r2, [r0, 0x12] - movs r1, 0x10 - negs r1, r1 - ands r1, r2 - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0, 0x12] - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r2, [r0, 0x12] - movs r1, 0xF - ands r1, r2 - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0, 0x12] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkCB_setcharge - - thumb_func_start atkCC_callterrainattack -atkCC_callterrainattack: @ 8054BEC - push {r4,lr} - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xfffffbff - ands r0, r1 - str r0, [r2] - ldr r4, =0x020241ea - ldr r1, =gUnknown_0831C414 - ldr r0, =0x02022ff0 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r4] - ldrh r0, [r4] - movs r1, 0 - bl sub_80458E0 - ldr r1, =0x0202420c - strb r0, [r1] - ldr r3, =gUnknown_082D86A8 - ldr r2, =gBattleMoves - ldrh r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - bl b_movescr_stack_push - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkCC_callterrainattack - - thumb_func_start atkCD_cureifburnedparalysedorpoisoned -atkCD_cureifburnedparalysedorpoisoned: @ 8054C60 - push {r4-r6,lr} - sub sp, 0x4 - ldr r1, =0x02024084 - ldr r3, =0x0202420b - ldrb r0, [r3] - movs r6, 0x58 - muls r0, r6 - adds r5, r1, 0 - adds r5, 0x4C - adds r2, r0, r5 - ldr r0, [r2] - movs r1, 0xD8 - ands r0, r1 - cmp r0, 0 - beq _08054CBC - movs r0, 0 - str r0, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - ldr r4, =0x02024064 - ldrb r0, [r3] - strb r0, [r4] - ldrb r0, [r4] - muls r0, r6 - adds r0, r5 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - b _08054CD6 - .pool -_08054CBC: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08054CD6: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atkCD_cureifburnedparalysedorpoisoned - - thumb_func_start atkCE_settorment -atkCE_settorment: @ 8054CE4 - push {lr} - ldr r1, =0x02024084 - ldr r0, =0x0202420c - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 24 - cmp r1, 0 - bge _08054D28 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08054D34 - .pool -_08054D28: - orrs r1, r2 - str r1, [r0] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_08054D34: - pop {r0} - bx r0 - .pool - thumb_func_end atkCE_settorment - - thumb_func_start atkCF_jumpifnodamage -atkCF_jumpifnodamage: @ 8054D3C - push {lr} - ldr r2, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r1, r0, 4 - adds r0, r2, 0x4 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08054D5C - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - beq _08054D74 -_08054D5C: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _08054D8E - .pool -_08054D74: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08054D8E: - pop {r0} - bx r0 - .pool - thumb_func_end atkCF_jumpifnodamage - - thumb_func_start atkD0_settaunt -atkD0_settaunt: @ 8054D98 - push {r4,lr} - ldr r4, =0x020242bc - ldr r3, =0x0202420c - ldrb r0, [r3] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r2, r1, r4 - ldrb r1, [r2, 0x13] - lsls r0, r1, 28 - cmp r0, 0 - bne _08054DE8 - movs r0, 0x10 - negs r0, r0 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2, 0x13] - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r2, [r0, 0x13] - movs r1, 0xF - ands r1, r2 - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0, 0x13] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _08054E02 - .pool -_08054DE8: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08054E02: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkD0_settaunt - - thumb_func_start atkD1_sethelpinghand -atkD1_sethelpinghand: @ 8054E0C - push {r4,lr} - ldr r4, =0x0202420b - ldrb r0, [r4] - bl battle_get_per_side_status - movs r1, 0x2 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - ldr r3, =0x0202420c - strb r0, [r3] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08054E90 - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r3, [r3] - lsls r0, r3, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08054E90 - ldr r1, =0x0202433c - ldrb r0, [r4] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 28 - cmp r0, 0 - blt _08054E90 - lsls r0, r3, 4 - adds r2, r0, r1 - ldrb r1, [r2] - lsls r0, r1, 28 - cmp r0, 0 - blt _08054E90 - movs r0, 0x8 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _08054EAA - .pool -_08054E90: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08054EAA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkD1_sethelpinghand - - thumb_func_start sub_8054EB4 -sub_8054EB4: @ 8054EB4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r4, =0x02022fec - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 19 - ands r0, r1 - cmp r0, 0 - bne _08054F9A - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08054EE8 - ldr r0, [r4] - ldr r1, =0x0a3f0902 - ands r0, r1 - cmp r0, 0 - beq _08054F9A -_08054EE8: - ldr r6, =0x0202420b - ldrb r0, [r6] - bl battle_side_get_owner - lsls r0, 24 - lsrs r4, r0, 24 - ldr r7, =0x0202420c - ldrb r0, [r7] - bl battle_side_get_owner - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x0a3f0902 - ands r0, r1 - cmp r0, 0 - bne _08054F46 - ldr r0, =0x020243d0 - adds r2, r0, 0 - adds r2, 0x29 - adds r0, r4, r2 - ldrb r1, [r0] - ldr r4, =gUnknown_0832A328 - ldr r3, =0x0202406e - ldrb r0, [r6] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08054F9A - adds r0, r5, r2 - ldrb r1, [r0] - ldrb r0, [r7] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08054F9A -_08054F46: - ldr r0, =0x02024084 - mov r8, r0 - ldr r1, =0x0202420b - ldrb r4, [r1] - movs r5, 0x58 - adds r0, r4, 0 - muls r0, r5 - add r0, r8 - mov r9, r0 - ldrh r3, [r0, 0x2E] - adds r1, r3, 0 - cmp r1, 0 - bne _08054F6E - ldr r0, =0x0202420c - ldrb r0, [r0] - muls r0, r5 - add r0, r8 - ldrh r0, [r0, 0x2E] - cmp r0, 0 - beq _08054F9A -_08054F6E: - cmp r1, 0xAF - beq _08054F9A - ldr r7, =0x0202420c - ldrb r0, [r7] - muls r0, r5 - mov r2, r8 - adds r1, r0, r2 - ldrh r2, [r1, 0x2E] - cmp r2, 0xAF - beq _08054F9A - adds r0, r3, 0 - subs r0, 0x79 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xB - bls _08054F9A - adds r0, r2, 0 - subs r0, 0x79 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xB - bhi _08054FDC -_08054F9A: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08055132 - .pool -_08054FDC: - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x3C - bne _08055010 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB63F - str r0, [r1] - ldr r1, =0x0202420a - ldrb r0, [r7] - muls r0, r5 - add r0, r8 - adds r0, 0x20 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r7] - ldrb r1, [r1] - bl b_history__record_ability_usage_of_player - b _08055132 - .pool -_08055010: - ldr r3, =0x0202449c - mov r10, r3 - lsls r0, r4, 1 - adds r0, 0xD0 - ldr r1, [r3] - adds r6, r1, r0 - mov r0, r9 - ldrh r0, [r0, 0x2E] - mov r9, r0 - strh r2, [r6] - ldr r1, =0x0202420b - ldrb r0, [r1] - muls r0, r5 - add r0, r8 - movs r1, 0 - strh r1, [r0, 0x2E] - ldrb r0, [r7] - muls r0, r5 - add r0, r8 - mov r2, r9 - strh r2, [r0, 0x2E] - ldr r4, =0x02024064 - ldr r3, =0x0202420b - ldrb r0, [r3] - strb r0, [r4] - str r6, [sp] - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - movs r3, 0x2 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldr r1, =0x0202420b - ldrb r0, [r1] - bl dp01_battle_side_mark_buffer_for_execution - ldrb r0, [r7] - strb r0, [r4] - ldrb r0, [r7] - muls r0, r5 - mov r1, r8 - adds r1, 0x2E - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - movs r3, 0x2 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r7] - bl dp01_battle_side_mark_buffer_for_execution - ldrb r0, [r7] - mov r2, r10 - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC8 - movs r3, 0 - strb r3, [r0] - ldrb r0, [r7] - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC9 - strb r3, [r0] - ldr r1, =0x0202420b - ldrb r0, [r1] - ldr r1, [r2] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC8 - strb r3, [r0] - ldr r2, =0x0202420b - ldrb r0, [r2] - mov r3, r10 - ldr r1, [r3] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC9 - movs r1, 0 - strb r1, [r0] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - ldr r1, =0x02022f58 - movs r3, 0xFD - strb r3, [r1] - movs r2, 0xA - strb r2, [r1, 0x1] - ldrh r0, [r6] - strb r0, [r1, 0x2] - ldrh r0, [r6] - lsrs r0, 8 - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x02022f68 - strb r3, [r1] - strb r2, [r1, 0x1] - mov r2, r9 - strb r2, [r1, 0x2] - mov r3, r9 - lsrs r0, r3, 8 - strb r0, [r1, 0x3] - movs r0, 0x1 - negs r0, r0 - strb r0, [r1, 0x4] - cmp r3, 0 - beq _08055118 - ldrh r0, [r6] - cmp r0, 0 - beq _0805512C - ldr r1, =0x02024332 - movs r0, 0x2 - b _08055130 - .pool -_08055118: - ldrh r0, [r6] - cmp r0, 0 - beq _0805512C - ldr r0, =0x02024332 - movs r1, 0 - strb r1, [r0, 0x5] - b _08055132 - .pool -_0805512C: - ldr r1, =0x02024332 - movs r0, 0x1 -_08055130: - strb r0, [r1, 0x5] -_08055132: - 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_8054EB4 - - thumb_func_start sub_8055148 -sub_8055148: @ 8055148 - push {r4,lr} - ldr r3, =0x02024084 - ldr r4, =0x0202420c - ldrb r0, [r4] - movs r2, 0x58 - muls r0, r2 - adds r0, r3 - adds r0, 0x20 - ldrb r1, [r0] - adds r0, r1, 0 - cmp r0, 0 - beq _0805519C - cmp r0, 0x19 - beq _0805519C - ldr r0, =0x0202420b - ldrb r0, [r0] - muls r0, r2 - adds r0, r3 - adds r0, 0x20 - strb r1, [r0] - ldr r1, =0x0202420a - ldrb r0, [r4] - muls r0, r2 - adds r0, r3 - adds r0, 0x20 - ldrb r0, [r0] - strb r0, [r1] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _080551B6 - .pool -_0805519C: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_080551B6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8055148 - - thumb_func_start atkD4_802C408 -atkD4_802C408: @ 80551C0 - push {r4-r7,lr} - ldr r7, =0x02024214 - ldr r2, [r7] - ldrb r3, [r2, 0x1] - cmp r3, 0 - beq _080551D8 - cmp r3, 0x1 - beq _08055210 - b _0805528C - .pool -_080551D8: - ldr r1, =0x020243d0 - ldr r4, =0x0202420b - adds r0, r1, 0 - adds r0, 0x20 - ldrb r5, [r4] - adds r3, r0, r5 - ldrb r0, [r3] - cmp r0, 0 - bne _0805525C - movs r0, 0x2 - strb r0, [r3] - ldrb r0, [r4] - adds r1, 0x24 - adds r1, r0, r1 - ldr r2, =0x0202406e - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1] - ldr r0, [r7] - adds r0, 0x6 - b _0805528A - .pool -_08055210: - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x4 - strb r0, [r1, 0x1] - ldr r4, =0x0202420c - ldrb r0, [r4] - strb r0, [r1, 0x2] - ldr r0, =0x020243d0 - adds r0, 0x24 - ldrb r5, [r4] - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =0x020241f0 - ldr r6, =0x02024084 - ldrb r0, [r4] - movs r5, 0x58 - muls r0, r5 - adds r0, r6 - ldrh r0, [r0, 0x2C] - lsrs r0, 1 - str r0, [r1] - cmp r0, 0 - bne _08055248 - str r3, [r1] -_08055248: - ldr r0, [r1] - negs r0, r0 - str r0, [r1] - ldrb r0, [r4] - muls r0, r5 - adds r0, r6 - ldrh r1, [r0, 0x28] - ldrh r0, [r0, 0x2C] - cmp r1, r0 - bne _08055288 -_0805525C: - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r7] - b _0805528C - .pool -_08055288: - adds r0, r2, 0x6 -_0805528A: - str r0, [r7] -_0805528C: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end atkD4_802C408 - - thumb_func_start sub_8055294 -sub_8055294: @ 8055294 - push {lr} - ldr r1, =0x020242ac - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 2 - adds r2, r0, r1 - ldr r1, [r2] - movs r3, 0x80 - lsls r3, 3 - adds r0, r1, 0 - ands r0, r3 - cmp r0, 0 - beq _080552D8 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _080552E4 - .pool -_080552D8: - orrs r1, r3 - str r1, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_080552E4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8055294 - - thumb_func_start atkD6_doubledamagedealtifdamaged -atkD6_doubledamagedealtifdamaged: @ 80552EC - push {lr} - ldr r3, =0x0202433c - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r2, r0, 4 - adds r0, r3, 0x4 - adds r0, r2, r0 - ldr r0, [r0] - cmp r0, 0 - beq _0805530C - adds r0, r2, r3 - ldr r1, =0x0202420c - ldrb r0, [r0, 0xC] - ldrb r1, [r1] - cmp r0, r1 - beq _08055324 -_0805530C: - adds r0, r3, 0 - adds r0, 0x8 - adds r0, r2, r0 - ldr r0, [r0] - cmp r0, 0 - beq _0805532A - adds r0, r2, r3 - ldr r1, =0x0202420c - ldrb r0, [r0, 0xD] - ldrb r1, [r1] - cmp r0, r1 - bne _0805532A -_08055324: - ldr r1, =0x02024474 - movs r0, 0x2 - strb r0, [r1, 0xE] -_0805532A: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end atkD6_doubledamagedealtifdamaged - - thumb_func_start sub_805534C -sub_805534C: @ 805534C - push {r4,lr} - ldr r1, =0x020242ac - ldr r0, =0x0202420c - ldrb r3, [r0] - lsls r0, r3, 2 - adds r4, r0, r1 - ldr r2, [r4] - movs r0, 0xC0 - lsls r0, 5 - ands r0, r2 - cmp r0, 0 - bne _08055374 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r3 - adds r1, 0x4C - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080553A0 -_08055374: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _080553B0 - .pool -_080553A0: - movs r0, 0x80 - lsls r0, 5 - orrs r2, r0 - str r2, [r4] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_080553B0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805534C - - thumb_func_start atkD8_setdamagetohealthdifference -atkD8_setdamagetohealthdifference: @ 80553BC - push {lr} - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r0, [r0] - movs r1, 0x58 - muls r0, r1 - adds r3, r0, r2 - ldr r0, =0x0202420b - ldrb r0, [r0] - muls r0, r1 - adds r1, r0, r2 - ldrh r0, [r3, 0x28] - ldrh r2, [r1, 0x28] - cmp r0, r2 - bhi _08055408 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0805541A - .pool -_08055408: - ldr r2, =0x020241f0 - ldrh r0, [r3, 0x28] - ldrh r1, [r1, 0x28] - subs r0, r1 - str r0, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_0805541A: - pop {r0} - bx r0 - .pool - thumb_func_end atkD8_setdamagetohealthdifference - - thumb_func_start atkD9_scaledamagebyhealthratio -atkD9_scaledamagebyhealthratio: @ 8055428 - push {r4,lr} - ldr r4, =0x02024400 - ldrh r0, [r4] - cmp r0, 0 - bne _08055464 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r3, [r0, 0x1] - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r1, r0 - adds r1, r2 - ldrh r0, [r1, 0x28] - muls r0, r3 - ldrh r1, [r1, 0x2C] - bl __divsi3 - strh r0, [r4] - lsls r0, 16 - cmp r0, 0 - bne _08055464 - movs r0, 0x1 - strh r0, [r4] -_08055464: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkD9_scaledamagebyhealthratio - - thumb_func_start atkDA_abilityswap -atkDA_abilityswap: @ 805548C - push {r4-r6,lr} - ldr r5, =0x02024084 - ldr r0, =0x0202420b - ldrb r0, [r0] - movs r4, 0x58 - muls r0, r4 - adds r0, r5 - adds r2, r0, 0 - adds r2, 0x20 - ldrb r1, [r2] - cmp r1, 0 - bne _080554B4 - ldr r0, =0x0202420c - ldrb r0, [r0] - muls r0, r4 - adds r0, r5 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0 - beq _080554D4 -_080554B4: - cmp r1, 0x19 - beq _080554D4 - ldr r6, =0x0202420c - ldrb r0, [r6] - muls r0, r4 - adds r0, r5 - adds r0, 0x20 - ldrb r3, [r0] - cmp r3, 0x19 - beq _080554D4 - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _08055504 -_080554D4: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0805551A - .pool -_08055504: - ldrb r1, [r2] - strb r3, [r2] - ldrb r0, [r6] - muls r0, r4 - adds r0, r5 - adds r0, 0x20 - strb r1, [r0] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_0805551A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atkDA_abilityswap - - thumb_func_start atkDB_imprisoneffect -atkDB_imprisoneffect: @ 8055524 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r1, =0x020242ac - ldr r4, =0x0202420b - ldrb r2, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 6 - ands r0, r1 - cmp r0, 0 - beq _08055574 - b _080555F6 - .pool -_0805554C: - ldr r0, =0x020242ac - mov r2, r9 - ldrb r1, [r2] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - movs r2, 0x80 - lsls r2, 6 - orrs r0, r2 - str r0, [r1] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _080555EE - .pool -_08055574: - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrb r0, [r4] - bl sub_803F548 - movs r6, 0 - b _080555E6 -_0805558A: - adds r0, r6, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r8, r0 - beq _080555E0 - movs r4, 0 - ldr r7, =0x0202420b - mov r9, r7 - ldr r0, =0x02024084 - mov r12, r0 - mov r1, r9 - ldrb r0, [r1] - mov r2, r12 - adds r2, 0xC - movs r1, 0x58 - muls r0, r1 - adds r3, r0, r2 - adds r5, r6, 0 - muls r5, r1 -_080555B4: - movs r2, 0 - ldrh r1, [r3] - mov r0, r12 - adds r0, 0xC - adds r0, r5, r0 -_080555BE: - ldrh r7, [r0] - cmp r1, r7 - bne _080555C8 - cmp r1, 0 - bne _080555D0 -_080555C8: - adds r0, 0x2 - adds r2, 0x1 - cmp r2, 0x3 - ble _080555BE -_080555D0: - cmp r2, 0x4 - bne _080555DC - adds r3, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _080555B4 -_080555DC: - cmp r4, 0x4 - bne _0805554C -_080555E0: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_080555E6: - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r6, r0 - bcc _0805558A -_080555EE: - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r6, r0 - bne _08055610 -_080555F6: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08055610: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkDB_imprisoneffect - - thumb_func_start atkDC_setgrudge -atkDC_setgrudge: @ 805562C - push {lr} - ldr r1, =0x020242ac - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 2 - adds r2, r0, r1 - ldr r1, [r2] - movs r3, 0x80 - lsls r3, 7 - adds r0, r1, 0 - ands r0, r3 - cmp r0, 0 - beq _08055670 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0805567C - .pool -_08055670: - orrs r1, r3 - str r1, [r2] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_0805567C: - pop {r0} - bx r0 - .pool - thumb_func_end atkDC_setgrudge - - thumb_func_start atkDD_weightdamagecalculation -atkDD_weightdamagecalculation: @ 8055684 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r5, 0 - ldr r2, =gUnknown_0831C428 - ldrh r0, [r2] - ldr r1, =0x0000ffff - cmp r0, r1 - beq _080556FC - adds r6, r2, 0 - ldr r0, =0x02024084 - mov r8, r0 - adds r7, r1, 0 - adds r4, r6, 0 -_080556A0: - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - add r0, r8 - ldrh r0, [r0] - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - bl sub_80C0630 - ldrh r1, [r4] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - bhi _080556CE - adds r4, 0x4 - adds r5, 0x2 - ldrh r0, [r4] - cmp r0, r7 - bne _080556A0 -_080556CE: - lsls r0, r5, 1 - adds r0, r6 - ldrh r1, [r0] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _080556FC - ldr r0, =0x02024400 - adds r1, r5, 0x1 - lsls r1, 1 - adds r1, r6 - ldrh r1, [r1] - strh r1, [r0] - b _08055702 - .pool -_080556FC: - ldr r1, =0x02024400 - movs r0, 0x78 - strh r0, [r1] -_08055702: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkDD_weightdamagecalculation - - thumb_func_start atkDE_asistattackselect -atkDE_asistattackselect: @ 805571C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - movs r0, 0 - mov r10, r0 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x18 - str r0, [sp, 0x4] - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_get_per_side_status - movs r1, 0x1 - ands r1, r0 - ldr r0, =0x020244ec - str r0, [sp] - cmp r1, 0 - beq _0805574C - ldr r1, =0x02024744 - str r1, [sp] -_0805574C: - movs r2, 0 -_0805574E: - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - adds r1, r2, 0x1 - str r1, [sp, 0x8] - ldrh r0, [r0] - cmp r2, r0 - beq _080557F4 - movs r0, 0x64 - adds r6, r2, 0 - muls r6, r0 - ldr r0, [sp] - adds r4, r0, r6 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _080557F4 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _080557F4 - movs r5, 0 - ldr r1, =0x0000ffff - mov r8, r1 - mov r9, r6 - mov r1, r10 - lsls r0, r1, 1 - ldr r1, [sp, 0x4] - adds r6, r0, r1 -_08055798: - movs r7, 0 - adds r1, r5, 0 - adds r1, 0xD - ldr r0, [sp] - add r0, r9 - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl sub_8052F84 - lsls r0, 24 - adds r1, r5, 0x1 - cmp r0, 0 - bne _080557EE - ldr r0, =gUnknown_0831C3E0 - ldrh r2, [r0] - adds r3, r0, 0 - cmp r2, r8 - beq _080557E2 - cmp r4, r2 - beq _080557D8 - ldr r5, =0x0000ffff - adds r2, r3, 0 -_080557CA: - adds r2, 0x2 - adds r7, 0x1 - ldrh r0, [r2] - cmp r0, r5 - beq _080557E2 - cmp r4, r0 - bne _080557CA -_080557D8: - lsls r0, r7, 1 - adds r0, r3 - ldrh r0, [r0] - cmp r0, r8 - bne _080557EE -_080557E2: - cmp r4, 0 - beq _080557EE - strh r4, [r6] - adds r6, 0x2 - movs r0, 0x1 - add r10, r0 -_080557EE: - adds r5, r1, 0 - cmp r5, 0x3 - ble _08055798 -_080557F4: - ldr r2, [sp, 0x8] - cmp r2, 0x5 - ble _0805574E - mov r1, r10 - cmp r1, 0 - beq _0805586C - ldr r2, =0x02024280 - ldr r0, [r2] - ldr r1, =0xfffffbff - ands r0, r1 - str r0, [r2] - ldr r4, =0x020241ee - bl GenerateRandomNumber - movs r1, 0xFF - ands r1, r0 - mov r0, r10 - muls r0, r1 - asrs r0, 8 - lsls r0, 1 - ldr r1, [sp, 0x4] - adds r0, r1 - ldrh r0, [r0] - strh r0, [r4] - ldrh r0, [r4] - movs r1, 0 - bl sub_80458E0 - ldr r1, =0x0202420c - strb r0, [r1] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _08055886 - .pool -_0805586C: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08055886: - 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 atkDE_asistattackselect - - thumb_func_start atkDF_setmagiccoat -atkDF_setmagiccoat: @ 805589C - push {lr} - ldr r1, =0x0202420c - ldr r3, =0x0202420b - ldrb r0, [r3] - strb r0, [r1] - ldr r2, =0x0202437c - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0] - ldr r0, =0x02024082 - ldrb r1, [r0] - ldr r0, =0x0202406c - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bne _080558FC - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08055914 - .pool -_080558FC: - ldr r0, =0x0202433c - ldrb r1, [r3] - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x10 - orrs r0, r2 - strb r0, [r1] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_08055914: - pop {r0} - bx r0 - .pool - thumb_func_end atkDF_setmagiccoat - - thumb_func_start atkE0_setstealstatchange -atkE0_setstealstatchange: @ 8055920 - push {lr} - ldr r2, =0x0202437c - ldr r3, =0x0202420b - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0] - ldr r0, =0x02024082 - ldrb r1, [r0] - ldr r0, =0x0202406c - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bne _08055978 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0805598E - .pool -_08055978: - ldr r0, =0x0202433c - ldrb r1, [r3] - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1] - orrs r0, r2 - strb r0, [r1] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_0805598E: - pop {r0} - bx r0 - .pool - thumb_func_end atkE0_setstealstatchange - - thumb_func_start atkE1_802CBE4 -atkE1_802CBE4: @ 805599C - push {r4-r6,lr} - ldr r4, =0x02024474 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0xD8 - ldrb r0, [r0] - strb r0, [r4, 0x17] - ldrb r0, [r4, 0x17] - bl battle_side_get_owner - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, =0x02022f58 - movs r0, 0xFD - strb r0, [r2] - movs r0, 0x9 - strb r0, [r2, 0x1] - ldr r3, =0x02024084 - ldrb r1, [r4, 0x17] - movs r0, 0x58 - muls r0, r1 - adds r0, r3 - adds r0, 0x20 - ldrb r0, [r0] - strb r0, [r2, 0x2] - movs r0, 0xFF - strb r0, [r2, 0x3] - ldr r2, =0x0202420c - ldr r1, =0x0202406c - ldrb r0, [r2] - ldrb r1, [r1] - cmp r0, r1 - bcs _08055A22 - adds r4, r2, 0 - ldr r6, =gUnknown_0832A328 -_080559E2: - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, r5 - beq _08055A04 - ldr r0, =0x02024210 - ldrb r1, [r0] - ldrb r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - ands r1, r0 - ldr r2, =0x0202406c - cmp r1, 0 - beq _08055A18 -_08055A04: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - adds r2, r1, 0 - ldrb r1, [r2] - cmp r0, r1 - bcc _080559E2 -_08055A18: - ldr r0, =0x0202420c - ldrb r0, [r0] - ldrb r2, [r2] - cmp r0, r2 - bcc _08055A64 -_08055A22: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08055A6C - .pool -_08055A64: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_08055A6C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atkE1_802CBE4 - - thumb_func_start atkE2_cmde2 -atkE2_cmde2: @ 8055A78 - push {r4-r6,lr} - sub sp, 0x4 - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r4, =0x02024064 - strb r0, [r4] - ldr r3, =0x02024084 - ldrb r0, [r4] - movs r6, 0x58 - adds r1, r0, 0 - muls r1, r6 - adds r0, r1, r3 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1E - bne _08055AD2 - adds r3, 0x4C - adds r1, r3 - movs r0, 0 - str r0, [r1] - ldr r2, =gUnknown_0832A328 - ldrb r1, [r4] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, r1, r0 - adds r0, 0x58 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r2 - ldrb r2, [r0] - adds r0, r1, 0 - muls r0, r6 - adds r0, r3 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_08055AD2: - ldr r0, [r5] - adds r0, 0x2 - str r0, [r5] - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atkE2_cmde2 - - thumb_func_start atkE3_jumpiffainted -atkE3_jumpiffainted: @ 8055AF4 - push {r4,lr} - ldr r4, =0x02024214 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl get_battle_side_of_something - ldr r1, =0x02024064 - strb r0, [r1] - ldr r2, =0x02024084 - ldrb r1, [r1] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08055B3C - ldr r2, [r4] - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08055B42 - .pool -_08055B3C: - ldr r0, [r4] - adds r0, 0x6 - str r0, [r4] -_08055B42: - pop {r4} - pop {r0} - bx r0 - thumb_func_end atkE3_jumpiffainted - - thumb_func_start sub_8055B48 -sub_8055B48: @ 8055B48 - push {lr} - ldr r0, =0x02022ff0 - ldrb r0, [r0] - cmp r0, 0x7 - bhi _08055BE4 - lsls r0, 2 - ldr r1, =_08055B64 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08055B64: - .4byte _08055B84 - .4byte _08055B90 - .4byte _08055B9C - .4byte _08055BA8 - .4byte _08055BB4 - .4byte _08055BC0 - .4byte _08055BCC - .4byte _08055BD8 -_08055B84: - ldr r1, =0x02024332 - movs r0, 0x2 - b _08055BE8 - .pool -_08055B90: - ldr r1, =0x02024332 - movs r0, 0x1 - b _08055BE8 - .pool -_08055B9C: - ldr r1, =0x02024332 - movs r0, 0x1B - b _08055BE8 - .pool -_08055BA8: - ldr r1, =0x02024332 - movs r0, 0x17 - b _08055BE8 - .pool -_08055BB4: - ldr r1, =0x02024332 - movs r0, 0x16 - b _08055BE8 - .pool -_08055BC0: - ldr r1, =0x02024332 - movs r0, 0x18 - b _08055BE8 - .pool -_08055BCC: - ldr r1, =0x02024332 - movs r0, 0x7 - b _08055BE8 - .pool -_08055BD8: - ldr r1, =0x02024332 - movs r0, 0x8 - b _08055BE8 - .pool -_08055BE4: - ldr r1, =0x02024332 - movs r0, 0x5 -_08055BE8: - strb r0, [r1, 0x3] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8055B48 - - thumb_func_start atkE5_pickupitemcalculation -atkE5_pickupitemcalculation: @ 8055C00 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - bl InBattlePike - lsls r0, 24 - cmp r0, 0 - beq _08055C18 - b _08055DD8 -_08055C18: - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _08055CC4 - movs r6, 0 - mov r7, sp - ldr r0, =gBaseStats - mov r8, r0 -_08055C2A: - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr - strh r0, [r7] - adds r0, r4, 0 - movs r1, 0x2E - bl pokemon_getattr - cmp r0, 0 - beq _08055C6C - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - add r0, r8 - ldrb r0, [r0, 0x17] - b _08055C76 - .pool -_08055C6C: - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - add r0, r8 - ldrb r0, [r0, 0x16] -_08055C76: - cmp r0, 0x35 - bne _08055CB6 - cmp r5, 0 - beq _08055CB6 - movs r0, 0xCE - lsls r0, 1 - cmp r5, r0 - beq _08055CB6 - ldrh r0, [r7] - cmp r0, 0 - bne _08055CB6 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _08055CB6 - bl CalculateBattlePyramidPickupItemId - strh r0, [r7] - movs r0, 0x64 - muls r0, r6 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xC - mov r2, sp - bl pokemon_setattr -_08055CB6: - adds r6, 0x1 - cmp r6, 0x5 - ble _08055C2A - b _08055DD8 - .pool -_08055CC4: - movs r6, 0 - movs r1, 0x64 - mov r8, r1 - ldr r7, =0x020244ec - mov r10, sp -_08055CCE: - mov r4, r8 - muls r4, r6 - adds r4, r7 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr - mov r1, r10 - strh r0, [r1] - adds r0, r4, 0 - movs r1, 0x2E - bl pokemon_getattr - cmp r0, 0 - beq _08055D30 - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - ldr r1, =gBaseStats - adds r0, r1 - ldrb r0, [r0, 0x17] - b _08055D3C - .pool -_08055D10: - mov r0, r8 - muls r0, r6 - adds r0, r7 - adds r2, r1, 0 - adds r2, 0x63 - subs r2, r4 - lsls r2, 1 - ldr r1, =gRarePickupItems - adds r2, r1 - movs r1, 0xC - bl pokemon_setattr - b _08055DD0 - .pool -_08055D30: - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - ldr r1, =gBaseStats - adds r0, r1 - ldrb r0, [r0, 0x16] -_08055D3C: - adds r1, r6, 0x1 - mov r9, r1 - cmp r0, 0x35 - bne _08055DD0 - cmp r5, 0 - beq _08055DD0 - movs r0, 0xCE - lsls r0, 1 - cmp r5, r0 - beq _08055DD0 - mov r1, r10 - ldrh r0, [r1] - cmp r0, 0 - bne _08055DD0 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _08055DD0 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r4, r0, 16 - mov r0, r8 - muls r0, r6 - adds r0, r7 - movs r1, 0x38 - bl pokemon_getattr - subs r0, 0x1 - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x9 - bls _08055D9C - movs r1, 0x9 -_08055D9C: - movs r2, 0 - b _08055DAE - .pool -_08055DA4: - adds r0, r4, 0 - subs r0, 0x62 - cmp r0, 0x1 - bls _08055D10 - adds r2, 0x1 -_08055DAE: - cmp r2, 0x8 - bgt _08055DD0 - ldr r0, =gPickupProbabilities - adds r0, r2, r0 - ldrb r0, [r0] - cmp r0, r4 - ble _08055DA4 - mov r0, r8 - muls r0, r6 - adds r0, r7 - adds r2, r1, r2 - lsls r2, 1 - ldr r1, =gPickupItems - adds r2, r1 - movs r1, 0xC - bl pokemon_setattr -_08055DD0: - mov r6, r9 - cmp r6, 0x5 - bgt _08055DD8 - b _08055CCE -_08055DD8: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - 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 atkE5_pickupitemcalculation - - thumb_func_start atkE6_castform_transform -atkE6_castform_transform: @ 8055DFC - push {r4,lr} - ldr r4, =0x02024064 - ldr r0, =0x02024474 - ldrb r0, [r0, 0x17] - strb r0, [r4] - ldr r1, =0x02024084 - ldrb r2, [r4] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - ldr r3, =0x0202449c - cmp r0, 0 - beq _08055E2C - ldr r0, [r3] - adds r0, 0x7F - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] -_08055E2C: - ldr r0, [r3] - adds r0, 0x7F - ldrb r2, [r0] - movs r0, 0 - movs r1, 0 - bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkE6_castform_transform - - thumb_func_start atkE7_castform_switch -atkE7_castform_switch: @ 8055E64 - push {r4,lr} - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r0, =0x02024474 - ldrb r0, [r0, 0x17] - bl castform_switch - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _08055E8E - ldr r0, =gUnknown_082DB4A9 - bl b_push_move_exec - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x7F - subs r1, r4, 0x1 - strb r1, [r0] -_08055E8E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkE7_castform_switch - - thumb_func_start atkE8_settypebasedhalvers -atkE8_settypebasedhalvers: @ 8055EA4 - push {r4,lr} - movs r4, 0 - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0xC9 - bne _08055EF4 - ldr r1, =0x020242ac - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 2 - adds r2, r0, r1 - ldr r1, [r2] - movs r3, 0x80 - lsls r3, 9 - adds r0, r1, 0 - ands r0, r3 - cmp r0, 0 - bne _08055F18 - orrs r1, r3 - str r1, [r2] - ldr r0, =0x02024332 - strb r4, [r0, 0x5] - b _08055F1C - .pool -_08055EF4: - ldr r1, =0x020242ac - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 2 - adds r2, r0, r1 - ldr r1, [r2] - movs r3, 0x80 - lsls r3, 10 - adds r0, r1, 0 - ands r0, r3 - cmp r0, 0 - bne _08055F18 - orrs r1, r3 - str r1, [r2] - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - movs r4, 0x1 -_08055F18: - cmp r4, 0 - beq _08055F38 -_08055F1C: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _08055F52 - .pool -_08055F38: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08055F52: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkE8_settypebasedhalvers - - thumb_func_start atkE9_seteffectbyweather -atkE9_seteffectbyweather: @ 8055F5C - push {lr} - sub sp, 0x4 - movs r0, 0 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08055FFC - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _08055FFC - ldr r2, =0x020243cc - ldrb r0, [r2] - cmp r0, 0 - beq _08055F9A - ldr r1, =0x02024474 - movs r0, 0x2 - strb r0, [r1, 0xE] -_08055F9A: - ldrh r1, [r2] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08055FB8 - ldr r0, =0x0202449c - ldr r1, [r0] - movs r0, 0x8B - b _08055FFA - .pool -_08055FB8: - movs r0, 0x18 - ands r0, r1 - cmp r0, 0 - beq _08055FCC - ldr r0, =0x0202449c - ldr r1, [r0] - movs r0, 0x85 - b _08055FFA - .pool -_08055FCC: - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _08055FE0 - ldr r0, =0x0202449c - ldr r1, [r0] - movs r0, 0x8A - b _08055FFA - .pool -_08055FE0: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08055FF4 - ldr r0, =0x0202449c - ldr r1, [r0] - movs r0, 0x8F - b _08055FFA - .pool -_08055FF4: - ldr r0, =0x0202449c - ldr r1, [r0] - movs r0, 0x80 -_08055FFA: - strb r0, [r1, 0x13] -_08055FFC: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end atkE9_seteffectbyweather - - thumb_func_start atkEA_recycleitem -atkEA_recycleitem: @ 8056014 - push {r4-r7,lr} - sub sp, 0x4 - ldr r7, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r7] - ldr r1, =0x0202449c - ldrb r2, [r7] - lsls r0, r2, 1 - adds r0, 0xB8 - ldr r1, [r1] - adds r6, r1, r0 - ldrh r5, [r6] - cmp r5, 0 - beq _08056094 - ldr r4, =0x02024084 - movs r3, 0x58 - adds r0, r2, 0 - muls r0, r3 - adds r0, r4 - ldrh r0, [r0, 0x2E] - cmp r0, 0 - bne _08056094 - ldr r1, =0x02024208 - strh r5, [r1] - strh r0, [r6] - ldrb r0, [r7] - muls r0, r3 - adds r0, r4 - ldrh r1, [r1] - strh r1, [r0, 0x2E] - ldrb r0, [r7] - muls r0, r3 - adds r1, r4, 0 - adds r1, 0x2E - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x2 - movs r2, 0 - movs r3, 0x2 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r7] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _080560AE - .pool -_08056094: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_080560AE: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkEA_recycleitem - - thumb_func_start atkEB_settypetoterrain -atkEB_settypetoterrain: @ 80560BC - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x02024084 - mov r8, r0 - ldr r7, =0x0202420b - ldrb r0, [r7] - movs r6, 0x58 - muls r0, r6 - mov r1, r8 - adds r3, r0, r1 - movs r0, 0x21 - adds r0, r3 - mov r12, r0 - ldr r5, =gUnknown_0831C483 - ldr r4, =0x02022ff0 - ldrb r0, [r4] - adds r0, r5 - ldrb r2, [r0] - mov r1, r12 - ldrb r0, [r1] - adds r1, r2, 0 - cmp r0, r1 - beq _08056144 - adds r0, r3, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, r1 - beq _08056144 - mov r0, r12 - strb r2, [r0] - ldrb r0, [r7] - adds r1, r0, 0 - muls r1, r6 - add r1, r8 - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - adds r1, 0x22 - strb r0, [r1] - ldr r1, =0x02022f58 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x3 - strb r0, [r1, 0x1] - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _0805615E - .pool -_08056144: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_0805615E: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkEB_settypetoterrain - - thumb_func_start atkEC_802D2A0 -atkEC_802D2A0: @ 805616C - push {r4-r6,lr} - ldr r5, =0x0202420b - ldrb r0, [r5] - bl battle_get_per_side_status - movs r1, 0x2 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - ldr r4, =0x02024064 - strb r0, [r4] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r6, 0x1 - ands r0, r6 - cmp r0, 0 - beq _0805620C - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r3, [r4] - lsls r0, r3, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0805620C - ldr r0, =0x0202421c - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0 - bne _0805620C - ldr r1, =0x02024274 - lsls r0, r3, 1 - adds r0, r1 - ldrh r2, [r0] - cmp r2, 0xE4 - bne _0805620C - ldr r0, =0x0202407a - adds r0, r3, r0 - movs r1, 0xB - strb r1, [r0] - ldr r0, =0x020241ea - strh r2, [r0] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - ldr r0, =0x02024474 - strb r6, [r0, 0x18] - ldrb r1, [r5] - adds r0, 0x20 - strb r1, [r0] - ldrb r0, [r4] - strb r0, [r5] - b _08056226 - .pool -_0805620C: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08056226: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end atkEC_802D2A0 - - thumb_func_start atkED_802D364 -atkED_802D364: @ 8056230 - push {r4,lr} - ldr r1, =0x0202420e - ldr r3, =0x0202420b - ldrb r0, [r3] - strb r0, [r1] - ldr r2, =0x0202420c - lsls r0, 24 - lsrs r0, 24 - adds r4, r1, 0 - ldrb r1, [r2] - cmp r0, r1 - bne _08056264 - ldr r1, =0x02024474 - ldrb r0, [r1, 0x17] - strb r0, [r2] - strb r0, [r3] - b _0805626A - .pool -_08056264: - ldr r1, =0x02024474 - ldrb r0, [r1, 0x17] - strb r0, [r2] -_0805626A: - ldrb r0, [r4] - strb r0, [r1, 0x17] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkED_802D364 - - thumb_func_start atkEE_removereflectlightscreen -atkEE_removereflectlightscreen: @ 8056284 - push {r4,lr} - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02024294 - lsls r3, r0, 1 - adds r0, r3, r0 - lsls r0, 2 - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0 - bne _080562AC - ldrb r1, [r4, 0x2] - cmp r1, 0 - beq _080562E4 -_080562AC: - ldr r2, =0x0202428e - adds r2, r3, r2 - ldrh r1, [r2] - ldr r0, =0x0000fffe - ands r0, r1 - movs r3, 0 - ldr r1, =0x0000fffd - ands r0, r1 - strh r0, [r2] - strb r3, [r4] - strb r3, [r4, 0x2] - ldr r1, =0x02024474 - movs r0, 0x1 - strb r0, [r1, 0x18] - strb r0, [r1, 0x19] - b _080562EA - .pool -_080562E4: - ldr r0, =0x02024474 - strb r1, [r0, 0x18] - strb r1, [r0, 0x19] -_080562EA: - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end atkEE_removereflectlightscreen - - thumb_func_start sub_8056300 -sub_8056300: @ 8056300 - push {r4-r6,lr} - movs r4, 0 - ldr r0, =0x02024068 - ldr r0, [r0] - cmp r0, 0 - beq _0805630E - b _08056696 -_0805630E: - ldr r5, =0x02024064 - ldr r0, =0x0202420b - ldrb r0, [r0] - strb r0, [r5] - ldr r6, =0x0202420c - movs r1, 0x1 - eors r0, r1 - strb r0, [r6] - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0805635C - movs r0, 0 - movs r1, 0x5 - bl dp01_build_cmdbuf_x0D_a - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DBE02 - b _08056694 - .pool -_0805635C: - movs r0, 0x80 - lsls r0, 2 - ands r1, r0 - cmp r1, 0 - beq _08056384 - movs r0, 0 - movs r1, 0x4 - bl dp01_build_cmdbuf_x0D_a - ldrb r0, [r5] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DBDCA - b _08056694 - .pool -_08056384: - ldr r0, =0x02024208 - ldrh r0, [r0] - cmp r0, 0x5 - bne _080563B0 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x7C - ldrb r0, [r0] - lsls r1, r0, 2 - adds r1, r0 - lsls r0, r1, 8 - subs r0, r1 - movs r1, 0x64 - bl __divsi3 - lsls r0, 24 - lsrs r5, r0, 24 - b _080563C8 - .pool -_080563B0: - ldr r3, =gBaseStats - ldr r2, =0x02024084 - ldrb r1, [r6] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r5, [r0, 0x8] -_080563C8: - ldr r2, =0x02024208 - ldrh r0, [r2] - cmp r0, 0x5 - bhi _080563D2 - b _080564C8 -_080563D2: - subs r0, 0x6 - cmp r0, 0x6 - bls _080563DA - b _080564D2 -_080563DA: - lsls r0, 2 - ldr r1, =_080563F4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080563F4: - .4byte _08056410 - .4byte _08056440 - .4byte _08056452 - .4byte _08056480 - .4byte _080564B0 - .4byte _08056472 - .4byte _08056472 -_08056410: - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r1, r0, 0 - adds r1, 0x21 - ldrb r1, [r1] - cmp r1, 0xB - beq _080564A4 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0xB - beq _080564A4 - cmp r1, 0x6 - beq _080564A4 - cmp r0, 0x6 - beq _080564A4 - b _08056472 - .pool -_08056440: - bl sav1_map_get_light_level - lsls r0, 24 - lsrs r0, 24 - movs r4, 0xA - cmp r0, 0x5 - bne _080564D2 - movs r4, 0x23 - b _080564D2 -_08056452: - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x2A - ldrb r1, [r0] - cmp r1, 0x27 - bhi _08056472 - movs r0, 0x28 - subs r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x9 - bhi _080564D2 -_08056472: - movs r4, 0xA - b _080564D2 - .pool -_08056480: - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r0, [r0] - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - movs r4, 0xA - cmp r0, 0 - beq _080564D2 -_080564A4: - movs r4, 0x1E - b _080564D2 - .pool -_080564B0: - ldr r0, =0x03005d10 - ldrb r0, [r0, 0x13] - adds r0, 0xA - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x28 - bls _080564D2 - movs r4, 0x28 - b _080564D2 - .pool -_080564C8: - ldr r1, =gUnknown_0831C48D - ldrh r0, [r2] - subs r0, 0x2 - adds r0, r1 - ldrb r4, [r0] -_080564D2: - adds r0, r5, 0 - muls r0, r4 - movs r1, 0xA - bl __divsi3 - ldr r5, =0x02024084 - ldr r1, =0x0202420c - ldrb r2, [r1] - movs r1, 0x58 - adds r4, r2, 0 - muls r4, r1 - adds r3, r4, r5 - ldrh r2, [r3, 0x2C] - lsls r1, r2, 1 - adds r1, r2 - ldrh r2, [r3, 0x28] - lsls r2, 1 - subs r2, r1, r2 - muls r0, r2 - bl __divsi3 - adds r6, r0, 0 - adds r5, 0x4C - adds r4, r5 - ldr r4, [r4] - movs r0, 0x27 - ands r0, r4 - cmp r0, 0 - beq _0805650E - lsls r6, 1 -_0805650E: - movs r0, 0xD8 - ands r4, r0 - cmp r4, 0 - beq _08056522 - lsls r0, r6, 4 - subs r0, r6 - movs r1, 0xA - bl __udivsi3 - adds r6, r0, 0 -_08056522: - ldr r1, =0x02024208 - ldrh r0, [r1] - cmp r0, 0x5 - beq _08056564 - cmp r0, 0x1 - bne _08056550 - ldr r0, =0x03005d10 - ldrb r1, [r0, 0x5] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0, 0x5] - b _08056564 - .pool -_08056550: - ldr r0, =0x03005d10 - ldrh r1, [r1] - adds r0, r1 - adds r1, r0, 0 - adds r1, 0x34 - ldrb r0, [r1] - cmp r0, 0xFE - bhi _08056564 - adds r0, 0x1 - strb r0, [r1] -_08056564: - cmp r6, 0xFE - bls _080565C8 - movs r0, 0 - movs r1, 0x4 - bl dp01_build_cmdbuf_x0D_a - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DBD84 - str r0, [r1] - ldr r1, =0x0202406e - ldr r0, =0x0202420c - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - ldr r2, =0x02024208 - movs r1, 0x26 - bl pokemon_setattr - bl calc_player_party_count - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6 - beq _08056656 - b _08056680 - .pool -_080565C8: - movs r0, 0xFF - lsls r0, 16 - adds r1, r6, 0 - bl __udivsi3 - bl Sqrt - lsls r0, 16 - lsrs r0, 16 - bl Sqrt - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =0x000ffff0 - adds r1, r6, 0 - bl __udivsi3 - adds r6, r0, 0 - movs r4, 0 - b _080565FA - .pool -_080565F4: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_080565FA: - cmp r4, 0x3 - bhi _0805660A - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - cmp r0, r6 - bcc _080565F4 -_0805660A: - ldr r5, =0x02024208 - ldrh r0, [r5] - cmp r0, 0x1 - bne _08056614 - movs r4, 0x4 -_08056614: - movs r0, 0 - adds r1, r4, 0 - bl dp01_build_cmdbuf_x0D_a - ldr r0, =0x02024064 - ldrb r0, [r0] - bl dp01_battle_side_mark_buffer_for_execution - cmp r4, 0x4 - bne _0805668C - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DBD84 - str r0, [r1] - ldr r1, =0x0202406e - ldr r0, =0x0202420c - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x26 - adds r2, r5, 0 - bl pokemon_setattr - bl calc_player_party_count - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6 - bne _08056680 -_08056656: - ldr r1, =0x02024332 - movs r0, 0 - strb r0, [r1, 0x5] - b _08056696 - .pool -_08056680: - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x5] - b _08056696 - .pool -_0805668C: - ldr r0, =0x02024332 - strb r4, [r0, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DBDD4 -_08056694: - str r0, [r1] -_08056696: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8056300 - - thumb_func_start atkF0_catch_pokemon -atkF0_catch_pokemon: @ 80566A8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x0202406e - mov r9, r0 - ldr r5, =0x0202420b - ldrb r0, [r5] - movs r6, 0x1 - eors r0, r6 - lsls r0, 1 - add r0, r9 - ldrh r0, [r0] - movs r7, 0x64 - muls r0, r7 - ldr r1, =0x02024744 - mov r8, r1 - add r0, r8 - bl pokemon_catch - lsls r0, 24 - cmp r0, 0 - beq _08056792 - bl sub_813B21C - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08056734 - ldr r0, =0x02024332 - strb r1, [r0, 0x5] - ldr r4, =0x02021cc4 - ldr r0, =0x00004036 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - bl sav3_get_box_name - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - ldrb r0, [r5] - eors r0, r6 - lsls r0, 1 - add r0, r9 - ldrh r0, [r0] - muls r0, r7 - add r0, r8 - ldr r2, =0x02021dc4 - movs r1, 0x2 - bl pokemon_getattr - b _0805677E - .pool -_08056734: - ldr r4, =0x02021cc4 - ldr r0, =0x00004036 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - bl sav3_get_box_name - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - ldrb r0, [r5] - eors r0, r6 - lsls r0, 1 - add r0, r9 - ldrh r0, [r0] - muls r0, r7 - add r0, r8 - ldr r2, =0x02021dc4 - movs r1, 0x2 - bl pokemon_getattr - ldr r4, =0x02021ec4 - bl get_unknown_box_id - lsls r0, 24 - lsrs r0, 24 - bl sav3_get_box_name - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - ldr r1, =0x02024332 - movs r0, 0x2 - strb r0, [r1, 0x5] -_0805677E: - ldr r0, =0x000008ab - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08056792 - ldr r1, =0x02024332 - ldrb r0, [r1, 0x5] - adds r0, 0x1 - strb r0, [r1, 0x5] -_08056792: - ldr r0, =0x0202406e - mov r10, r0 - ldr r1, =0x0202420b - mov r9, r1 - ldrb r0, [r1] - movs r4, 0x1 - eors r0, r4 - lsls r0, 1 - add r0, r10 - ldrh r0, [r0] - movs r1, 0x64 - mov r8, r1 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - ldr r6, =0x02024744 - adds r0, r6 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - ldr r5, =0x03005d10 - strh r0, [r5, 0x28] - mov r1, r9 - ldrb r0, [r1] - eors r0, r4 - lsls r0, 1 - add r0, r10 - ldrh r0, [r0] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r6 - adds r2, r5, 0 - adds r2, 0x2A - movs r1, 0x2 - bl pokemon_getattr - mov r1, r9 - ldrb r0, [r1] - eors r4, r0 - lsls r4, 1 - add r4, r10 - ldrh r0, [r4] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r6 - movs r1, 0x26 - movs r2, 0 - bl pokemon_getattr - movs r1, 0xF - ands r0, r1 - lsls r0, 2 - ldrb r2, [r5, 0x5] - movs r1, 0x3D - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r5, 0x5] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end atkF0_catch_pokemon - - thumb_func_start atkF1_802D95C -atkF1_802D95C: @ 8056850 - push {r4,r5,lr} - ldr r4, =0x02024744 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - adds r0, r5, 0 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _080568A8 - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _080568C2 - .pool -_080568A8: - adds r0, r5, 0 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - adds r2, r4, 0 - bl SetPokedexFlag - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_080568C2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end atkF1_802D95C - - thumb_func_start sub_80568CC -sub_80568CC: @ 80568CC - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x02024744 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x02024332 - ldrb r0, [r0] - cmp r0, 0x5 - bls _080568E8 - b _08056A2C -_080568E8: - lsls r0, 2 - ldr r1, =_08056900 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08056900: - .4byte _08056918 - .4byte _0805692A - .4byte _08056978 - .4byte _080569C8 - .4byte _080569E0 - .4byte _08056A18 -_08056918: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _08056A06 -_0805692A: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08056938 - b _08056A2C -_08056938: - bl FreeAllWindowBuffers - adds r0, r4, 0 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - ldr r3, =0x02024084 - ldr r1, =0x0202420c - ldrb r2, [r1] - movs r1, 0x58 - muls r2, r1 - adds r1, r3, 0 - adds r1, 0x54 - adds r1, r2, r1 - ldr r1, [r1] - adds r3, 0x48 - adds r2, r3 - ldr r2, [r2] - bl sub_80BFDF4 - ldr r1, =0x02024332 - strb r0, [r1, 0x1] - b _08056A08 - .pool -_08056978: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08056A2C - ldr r0, =0x030022c0 - ldr r1, [r0, 0x4] - ldr r0, =sub_8038420 - cmp r1, r0 - bne _08056A2C - ldr r2, =0x03005e00 - ldr r4, =0x02024332 - ldrb r1, [r4, 0x1] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x4] - cmp r0, 0 - bne _08056A2C - ldr r0, =vblank_cb_08078BB4 - bl SetVBlankCallback - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _08056A2C - .pool -_080569C8: - bl c2_berry_program_update_menu - bl sub_8035AA4 - ldr r1, =0x02022e20 - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r1] - b _08056A06 - .pool -_080569E0: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08056A2C - ldr r0, =0x0000ffff - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - movs r0, 0 - bl ShowBg - movs r0, 0x3 - bl ShowBg -_08056A06: - ldr r1, =0x02024332 -_08056A08: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08056A2C - .pool -_08056A18: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08056A2C - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] -_08056A2C: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80568CC - - thumb_func_start sub_8056A3C -sub_8056A3C: @ 8056A3C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - ldr r4, [sp, 0x40] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x10] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x1C] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x14] - lsls r4, 24 - lsrs r4, 24 - mov r10, r4 - movs r1, 0 - add r0, sp, 0xC - strh r1, [r0] - ldr r6, [sp, 0x10] - cmp r6, r3 - ble _08056A76 - b _08056B62 -_08056A76: - mov r4, r8 - adds r0, r6, 0x1 - str r0, [sp, 0x18] - ldr r2, [sp, 0x1C] - cmp r4, r2 - bgt _08056B58 - add r5, sp, 0xC - lsls r7, r6, 24 - mov r9, r7 -_08056A88: - ldr r0, [sp, 0x10] - cmp r6, r0 - bne _08056AB4 - cmp r4, r8 - bne _08056A9C - ldr r0, =0x00001022 - b _08056AFE - .pool -_08056A9C: - ldr r2, [sp, 0x1C] - cmp r4, r2 - bne _08056AAC - ldr r0, =0x00001024 - b _08056AFE - .pool -_08056AAC: - ldr r0, =0x00001023 - b _08056AFE - .pool -_08056AB4: - ldr r7, [sp, 0x14] - cmp r6, r7 - bne _08056AE0 - cmp r4, r8 - bne _08056AC8 - ldr r0, =0x00001028 - b _08056AFE - .pool -_08056AC8: - ldr r0, [sp, 0x1C] - cmp r4, r0 - bne _08056AD8 - ldr r0, =0x0000102a - b _08056AFE - .pool -_08056AD8: - ldr r0, =0x00001029 - b _08056AFE - .pool -_08056AE0: - cmp r4, r8 - bne _08056AEC - ldr r0, =0x00001025 - b _08056AFE - .pool -_08056AEC: - ldr r2, [sp, 0x1C] - cmp r4, r2 - bne _08056AFC - ldr r0, =0x00001027 - b _08056AFE - .pool -_08056AFC: - ldr r0, =0x00001026 -_08056AFE: - strh r0, [r5] - movs r1, 0x1 - mov r0, r10 - ands r0, r1 - cmp r0, 0 - beq _08056B0E - movs r0, 0 - strh r0, [r5] -_08056B0E: - movs r0, 0x80 - mov r7, r10 - ands r0, r7 - cmp r0, 0 - beq _08056B38 - lsls r2, r4, 24 - lsrs r2, 24 - str r1, [sp] - str r1, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - add r1, sp, 0xC - mov r7, r9 - lsrs r3, r7, 24 - bl CopyToBgTilemapBufferRect_ChangePalette - b _08056B50 - .pool -_08056B38: - lsls r2, r4, 24 - lsrs r2, 24 - str r1, [sp] - str r1, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - add r1, sp, 0xC - mov r7, r9 - lsrs r3, r7, 24 - bl CopyToBgTilemapBufferRect_ChangePalette -_08056B50: - adds r4, 0x1 - ldr r0, [sp, 0x1C] - cmp r4, r0 - ble _08056A88 -_08056B58: - ldr r6, [sp, 0x18] - ldr r2, [sp, 0x14] - cmp r6, r2 - bgt _08056B62 - b _08056A76 -_08056B62: - 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_8056A3C - - thumb_func_start sub_8056B74 -sub_8056B74: @ 8056B74 - push {lr} - sub sp, 0x10 - adds r3, r0, 0 - add r0, sp, 0xC - movs r2, 0x1 - strh r2, [r0] - movs r1, 0x2 - strh r1, [r0, 0x2] - lsls r3, 25 - movs r0, 0x90 - lsls r0, 20 - adds r3, r0 - lsrs r3, 24 - str r2, [sp] - str r1, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - add r1, sp, 0xC - movs r2, 0x19 - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0x10 - pop {r0} - bx r0 - thumb_func_end sub_8056B74 - - thumb_func_start sub_8056BAC -sub_8056BAC: @ 8056BAC - push {lr} - sub sp, 0x10 - adds r3, r0, 0 - add r0, sp, 0xC - ldr r1, =0x00001016 - strh r1, [r0] - strh r1, [r0, 0x2] - lsls r3, 25 - movs r0, 0x90 - lsls r0, 20 - adds r3, r0 - lsrs r3, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - add r1, sp, 0xC - movs r2, 0x19 - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8056BAC - - thumb_func_start atkF3_receive_new_pokemon_maybe -atkF3_receive_new_pokemon_maybe: @ 8056BEC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r0, =0x02024332 - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0x4 - bls _08056C04 - b _08056E62 -_08056C04: - lsls r0, r1, 2 - ldr r1, =_08056C18 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08056C18: - .4byte _08056C2C - .4byte _08056C60 - .4byte _08056CFC - .4byte _08056DD4 - .4byte _08056E2C -_08056C2C: - movs r4, 0 - str r4, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - ldr r0, =gUnknown_085CCABB - movs r1, 0xC - bl battle_show_message_maybe - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - strb r4, [r1, 0x1] - movs r0, 0 - bl sub_8056B74 - b _08056E62 - .pool -_08056C60: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08056C86 - ldrb r0, [r4, 0x1] - cmp r0, 0 - beq _08056C86 - movs r0, 0x5 - bl audio_play - ldrb r0, [r4, 0x1] - bl sub_8056BAC - movs r0, 0 - strb r0, [r4, 0x1] - bl sub_8056B74 -_08056C86: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08056CAE - ldr r4, =0x02024332 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _08056CAE - movs r0, 0x5 - bl audio_play - ldrb r0, [r4, 0x1] - bl sub_8056BAC - movs r0, 0x1 - strb r0, [r4, 0x1] - bl sub_8056B74 -_08056CAE: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08056CE0 - movs r0, 0x5 - bl audio_play - ldr r1, =0x02024332 - ldrb r0, [r1, 0x1] - cmp r0, 0 - bne _08056CF2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0x3 - bl sub_80A2390 - b _08056E62 - .pool -_08056CE0: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08056CEA - b _08056E62 -_08056CEA: - movs r0, 0x5 - bl audio_play - ldr r1, =0x02024332 -_08056CF2: - movs r0, 0x4 - strb r0, [r1] - b _08056E62 - .pool -_08056CFC: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08056D0A - b _08056E62 -_08056D0A: - ldr r7, =0x0202406e - ldr r0, =0x0202420b - mov r10, r0 - ldrb r0, [r0] - movs r4, 0x1 - eors r0, r4 - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - movs r1, 0x64 - mov r9, r1 - mov r2, r9 - muls r2, r0 - adds r0, r2, 0 - ldr r1, =0x02024744 - mov r8, r1 - add r0, r8 - ldr r1, =0x0202449c - ldr r2, [r1] - adds r2, 0x6D - movs r1, 0x2 - bl pokemon_getattr - bl FreeAllWindowBuffers - mov r2, r10 - ldrb r0, [r2] - eors r0, r4 - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - add r0, r8 - movs r1, 0xB - bl pokemon_getattr - adds r6, r0, 0 - lsls r6, 16 - lsrs r6, 16 - mov r2, r10 - ldrb r0, [r2] - eors r0, r4 - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - add r0, r8 - bl pokemon_get_gender - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - mov r2, r10 - ldrb r0, [r2] - eors r4, r0 - lsls r4, 1 - adds r4, r7 - ldrh r0, [r4] - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - add r0, r8 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - ldr r2, =0x0202449c - ldr r1, [r2] - adds r1, 0x6D - str r0, [sp] - ldr r0, =sub_8038420 - str r0, [sp, 0x4] - movs r0, 0x2 - adds r2, r6, 0 - adds r3, r5, 0 - bl do_choose_name_or_words_screen - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08056E62 - .pool -_08056DD4: - ldr r0, =0x030022c0 - ldr r1, [r0, 0x4] - ldr r0, =sub_8038420 - cmp r1, r0 - bne _08056E62 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08056E62 - ldr r2, =0x0202406e - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x1 - eors r0, r1 - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - ldr r1, =0x0202449c - ldr r2, [r1] - adds r2, 0x6D - movs r1, 0x2 - bl pokemon_setattr - b _08056E48 - .pool -_08056E2C: - bl calc_player_party_count - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6 - bne _08056E48 - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] - b _08056E62 - .pool -_08056E48: - ldr r3, =0x02024214 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] -_08056E62: - 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 atkF3_receive_new_pokemon_maybe - - thumb_func_start sub_8056E78 -sub_8056E78: @ 8056E78 - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r1, r0 - adds r1, r2 - ldr r0, =0x020241f0 - ldr r2, [r0] - ldrh r0, [r1, 0x28] - subs r0, r2 - strh r0, [r1, 0x28] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8056E78 - - thumb_func_start atkF5_reset_attacker_bd_x4C -atkF5_reset_attacker_bd_x4C: @ 8056EA8 - ldr r1, =0x02024084 - ldr r0, =0x0202420b - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x4C - adds r0, r1 - movs r1, 0 - str r1, [r0] - ldr r1, =0x02024214 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end atkF5_reset_attacker_bd_x4C - - thumb_func_start sub_8056ED0 -sub_8056ED0: @ 8056ED0 - ldr r1, =0x02024083 - movs r0, 0xC - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8056ED0 - - thumb_func_start sub_8056EDC -sub_8056EDC: @ 8056EDC - ldr r1, =0x02024083 - movs r0, 0xC - strb r0, [r1] - ldr r1, =0x02024082 - ldr r0, =0x0202406c - ldrb r0, [r0] - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8056EDC - - thumb_func_start sub_8056EF8 -sub_8056EF8: @ 8056EF8 - push {r4,r5,lr} - ldr r5, =0x02024214 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl battle_get_side_with_given_state - ldr r4, =0x02024064 - strb r0, [r4] - movs r0, 0 - bl dp01_build_cmdbuf_x09_9_9_9 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - ldr r0, [r5] - adds r0, 0x2 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8056EF8 - - thumb_func_start sub_8056F28 -sub_8056F28: @ 8056F28 - push {r4-r6,lr} - ldr r5, =0x020244a8 - ldr r6, =0x02022fec - ldr r0, [r6] - movs r1, 0x80 - lsls r1, 19 - ands r0, r1 - cmp r0, 0 - beq _08056F3E - bl sub_81D55D0 -_08056F3E: - ldr r4, =0x0202449c - movs r0, 0xA9 - lsls r0, 2 - bl AllocZeroed - str r0, [r4] - movs r0, 0x20 - bl AllocZeroed - str r0, [r5] - movs r0, 0xA0 - bl AllocZeroed - ldr r1, [r5] - str r0, [r1] - movs r0, 0x10 - bl AllocZeroed - ldr r1, [r5] - str r0, [r1, 0x4] - movs r0, 0x24 - bl AllocZeroed - ldr r1, [r5] - str r0, [r1, 0x8] - movs r0, 0x24 - bl AllocZeroed - ldr r1, [r5] - str r0, [r1, 0xC] - movs r0, 0xC - bl AllocZeroed - ldr r1, [r5] - str r0, [r1, 0x10] - movs r0, 0x1C - bl AllocZeroed - ldr r1, [r5] - str r0, [r1, 0x14] - movs r0, 0x54 - bl AllocZeroed - ldr r1, [r5] - str r0, [r1, 0x18] - movs r0, 0x24 - bl AllocZeroed - ldr r1, [r5] - str r0, [r1, 0x1C] - ldr r4, =0x020244a0 - movs r5, 0x80 - lsls r5, 5 - adds r0, r5, 0 - bl AllocZeroed - str r0, [r4] - ldr r4, =0x020244a4 - adds r0, r5, 0 - bl AllocZeroed - str r0, [r4] - ldr r4, =0x0202305c - movs r0, 0x80 - lsls r0, 6 - bl AllocZeroed - str r0, [r4] - ldr r4, =0x02023060 - adds r0, r5, 0 - bl AllocZeroed - str r0, [r4] - ldr r0, [r6] - movs r1, 0x80 - lsls r1, 20 - ands r0, r1 - cmp r0, 0 - beq _08056FFA - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r2, =0x03005d8c - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 5 - ldr r0, =0x00001a9c - adds r1, r0 - ldr r0, [r2] - adds r0, r1 - bl create_enemy_party -_08056FFA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8056F28 - - thumb_func_start sub_8057028 -sub_8057028: @ 8057028 - push {r4-r6,lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 19 - ands r0, r1 - cmp r0, 0 - beq _0805703C - bl sub_81D5694 -_0805703C: - ldr r6, =0x020244a8 - ldr r0, [r6] - cmp r0, 0 - beq _080570D0 - ldr r4, =0x0202449c - ldr r0, [r4] - bl Free - movs r5, 0 - str r5, [r4] - ldr r0, [r6] - ldr r0, [r0] - bl Free - ldr r0, [r6] - str r5, [r0] - ldr r0, [r0, 0x4] - bl Free - ldr r0, [r6] - str r5, [r0, 0x4] - ldr r0, [r0, 0x8] - bl Free - ldr r0, [r6] - str r5, [r0, 0x8] - ldr r0, [r0, 0xC] - bl Free - ldr r0, [r6] - str r5, [r0, 0xC] - ldr r0, [r0, 0x10] - bl Free - ldr r0, [r6] - str r5, [r0, 0x10] - ldr r0, [r0, 0x14] - bl Free - ldr r0, [r6] - str r5, [r0, 0x14] - ldr r0, [r0, 0x18] - bl Free - ldr r0, [r6] - str r5, [r0, 0x18] - ldr r0, [r0, 0x1C] - bl Free - ldr r0, [r6] - str r5, [r0, 0x1C] - bl Free - str r5, [r6] - ldr r4, =0x020244a0 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x020244a4 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0202305c - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x02023060 - ldr r0, [r4] - bl Free - str r5, [r4] -_080570D0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8057028 - - thumb_func_start sub_80570F4 -sub_80570F4: @ 80570F4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08057140 - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x3 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =0x02024084 - movs r0, 0x58 - adds r1, r3, 0 - muls r1, r0 - adds r1, r2 - adds r1, 0x2A - muls r0, r4 - adds r0, r2 - adds r0, 0x2A - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - bls _0805714A - adds r4, r3, 0 - b _0805714A - .pool -_08057140: - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r4, r0, 24 -_0805714A: - ldr r2, =0x02024084 - movs r1, 0x58 - adds r0, r4, 0 - muls r0, r1 - adds r0, r2 - adds r3, r0, 0 - adds r3, 0x2A - adds r0, r5, 0 - muls r0, r1 - adds r0, r2 - adds r1, r0, 0 - adds r1, 0x2A - ldrb r0, [r3] - ldrb r2, [r1] - cmp r0, r2 - bls _080571B8 - ldrb r1, [r1] - subs r0, r1 - cmp r0, 0x1D - ble _08057198 - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x8 - bl happiness_algorithm - b _080571CE - .pool -_08057198: - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x6 - bl happiness_algorithm - b _080571CE - .pool -_080571B8: - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x6 - bl happiness_algorithm -_080571CE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80570F4 - - thumb_func_start sub_80571DC -sub_80571DC: @ 80571DC - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08057248 - movs r2, 0 - ldr r6, =0x0202406e - lsls r3, r4, 1 - ldr r5, =0x0203cf00 - ldr r4, =0x0202449c -_080571FE: - adds r0, r2, r5 - ldr r1, [r4] - adds r1, r2, r1 - adds r1, 0x60 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x2 - ble _080571FE - adds r0, r3, r6 - ldrb r0, [r0] - bl pokemon_order_func - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r7, 0 - bl pokemon_order_func - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_81B8FB0 - movs r2, 0 - ldr r4, =0x0202449c - ldr r3, =0x0203cf00 -_08057236: - ldr r0, [r4] - adds r0, r2, r0 - adds r0, 0x60 - adds r1, r2, r3 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x2 - ble _08057236 -_08057248: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80571DC - - thumb_func_start sub_805725C -sub_805725C: @ 805725C - 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 - movs r0, 0 - mov r8, r0 - ldr r1, =0x02024332 - mov r10, r1 - b _08057284 - .pool -_0805727C: - mov r2, r8 - cmp r2, 0 - beq _08057284 - b _08057406 -_08057284: - mov r1, r10 - ldrb r0, [r1] - cmp r0, 0x1 - bne _0805728E - b _08057390 -_0805728E: - cmp r0, 0x1 - ble _08057294 - b _080573FC -_08057294: - cmp r0, 0 - beq _0805729A - b _080573FC -_0805729A: - ldr r6, =0x02024084 - movs r0, 0x58 - mov r5, r9 - muls r5, r0 - adds r0, r6, 0 - adds r0, 0x4C - adds r4, r5, r0 - ldr r0, [r4] - movs r7, 0x7 - ands r0, r7 - cmp r0, 0 - beq _08057372 - mov r0, r9 - bl sub_8050650 - lsls r0, 24 - cmp r0, 0 - beq _080572FC - ldr r0, [r4] - movs r1, 0x8 - negs r1, r1 - ands r0, r1 - str r0, [r4] - adds r2, r6, 0 - adds r2, 0x50 - adds r2, r5, r2 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] - bl b_movescr_stack_push_cursor - movs r0, 0x1 - mov r2, r10 - strb r0, [r2, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB220 - str r0, [r1] - movs r0, 0x2 - mov r8, r0 - b _08057372 - .pool -_080572FC: - adds r0, r5, r6 - adds r0, 0x20 - ldrb r0, [r0] - movs r2, 0x1 - cmp r0, 0x30 - bne _0805730A - movs r2, 0x2 -_0805730A: - ldr r1, [r4] - adds r0, r1, 0 - ands r0, r7 - cmp r0, r2 - bcs _0805731E - movs r0, 0x8 - negs r0, r0 - ands r1, r0 - str r1, [r4] - b _08057322 -_0805731E: - subs r0, r1, r2 - str r0, [r4] -_08057322: - ldr r2, =0x02024084 - movs r0, 0x58 - mov r1, r9 - muls r1, r0 - adds r0, r2, 0 - adds r0, 0x4C - adds r0, r1, r0 - ldr r4, [r0] - movs r0, 0x7 - ands r4, r0 - cmp r4, 0 - beq _08057354 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB213 - str r0, [r1] - movs r1, 0x2 - mov r8, r1 - b _08057372 - .pool -_08057354: - adds r2, 0x50 - adds r2, r1, r2 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] - bl b_movescr_stack_push_cursor - ldr r0, =0x02024332 - strb r4, [r0, 0x5] - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB220 - str r0, [r1] - movs r2, 0x2 - mov r8, r2 -_08057372: - ldr r1, =0x02024332 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r10, r1 - b _080573FC - .pool -_08057390: - ldr r1, =0x02024084 - movs r0, 0x58 - mov r2, r9 - muls r2, r0 - adds r0, r2, 0 - adds r1, 0x4C - adds r4, r0, r1 - ldr r0, [r4] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080573F4 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x5 - bl __umodsi3 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - beq _080573D4 - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB26A - str r0, [r1] - b _080573EC - .pool -_080573D4: - ldr r0, [r4] - movs r1, 0x21 - negs r1, r1 - ands r0, r1 - str r0, [r4] - bl b_movescr_stack_push_cursor - ldr r1, =0x02024214 - ldr r0, =gUnknown_082DB277 - str r0, [r1] - mov r0, r10 - strb r5, [r0, 0x5] -_080573EC: - movs r1, 0x2 - mov r8, r1 - ldr r2, =0x02024332 - mov r10, r2 -_080573F4: - mov r1, r10 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080573FC: - mov r2, r10 - ldrb r0, [r2] - cmp r0, 0x2 - beq _08057406 - b _0805727C -_08057406: - mov r0, r8 - cmp r0, 0x2 - bne _08057430 - ldr r4, =0x02024064 - mov r1, r9 - strb r1, [r4] - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - ldr r1, =0x020240d0 - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl dp01_build_cmdbuf_x02_a_b_varargs - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution -_08057430: - mov r0, r8 - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_805725C - - thumb_func_start nullsub_21 -nullsub_21: @ 8057458 - bx lr - thumb_func_end nullsub_21 - - thumb_func_start sub_805745C -sub_805745C: @ 805745C - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_exec_buffer_A_ch0_tbl1 - str r1, [r0] - ldr r0, =0x020244b9 - movs r1, 0 - strb r1, [r0] - ldr r0, =0x020244cc - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_805745C - - thumb_func_start dp01_tbl1_exec_completed -dp01_tbl1_exec_completed: @ 805748C - push {r4,lr} - sub sp, 0x4 - ldr r1, =0x03005d60 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_exec_buffer_A_ch0_tbl1 - str r1, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080574E0 - bl link_get_multiplayer_id - mov r1, sp - strb r0, [r1] - movs r0, 0x2 - movs r1, 0x4 - mov r2, sp - bl dp01_prepare_buffer_wireless_probably - ldr r1, =0x02023064 - ldrb r0, [r4] - lsls r0, 9 - adds r0, r1 - movs r1, 0x38 - strb r1, [r0] - b _080574F2 - .pool -_080574E0: - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldr r0, [r2] - bics r0, r1 - str r0, [r2] -_080574F2: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_tbl1_exec_completed - - thumb_func_start bx_exec_buffer_A_ch0_tbl1 -bx_exec_buffer_A_ch0_tbl1: @ 8057504 - push {lr} - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldr r0, =0x02024064 - ldrb r3, [r0] - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08057550 - ldr r0, =0x02023064 - lsls r1, r3, 9 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x38 - bhi _0805754C - ldr r0, =gUnknown_0831C514 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 - b _08057550 - .pool -_0805754C: - bl dp01_tbl1_exec_completed -_08057550: - pop {r0} - bx r0 - thumb_func_end bx_exec_buffer_A_ch0_tbl1 - - thumb_func_start bx_0802E404 -bx_0802E404: @ 8057554 - push {lr} - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x24 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08057576 - bl dp01_tbl1_exec_completed -_08057576: - pop {r0} - bx r0 - .pool - thumb_func_end bx_0802E404 - - thumb_func_start sub_8057588 -sub_8057588: @ 8057588 - push {r4-r7,lr} - ldr r3, =0x02023064 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r2, r0, 9 - adds r1, r3, 0x2 - adds r1, r2, r1 - ldrb r5, [r1] - adds r3, 0x3 - adds r2, r3 - ldrb r1, [r2] - lsls r1, 8 - orrs r5, r1 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x1 - bl dp11b_obj_instanciate - ldrb r0, [r4] - movs r1, 0 - movs r2, 0x7 - movs r3, 0x1 - bl dp11b_obj_instanciate - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x30] - movs r0, 0xF0 - ands r0, r1 - cmp r0, 0 - beq _080575EC - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0x2 - bne _080575EC - ldr r1, =0x020244cc - ldrb r0, [r1] - adds r0, 0x1 - b _080575F0 - .pool -_080575EC: - ldr r1, =0x020244cc - movs r0, 0 -_080575F0: - strb r0, [r1] - ldr r0, =0x030022c0 - ldrh r2, [r0, 0x2E] - movs r3, 0x1 - adds r0, r3, 0 - ands r0, r2 - cmp r0, 0 - beq _08057658 - movs r0, 0x5 - bl audio_play - ldr r1, =0x020244ac - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08057640 - cmp r0, 0x1 - bgt _08057630 - cmp r0, 0 - beq _0805763A - b _080577C2 - .pool -_08057630: - cmp r0, 0x2 - beq _08057646 - cmp r0, 0x3 - beq _0805764C - b _080577C2 -_0805763A: - movs r0, 0x1 - movs r1, 0 - b _080577BC -_08057640: - movs r0, 0x1 - movs r1, 0x1 - b _080577BC -_08057646: - movs r0, 0x1 - movs r1, 0x2 - b _080577BC -_0805764C: - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - b _080577C2 -_08057658: - movs r0, 0x20 - ands r0, r2 - cmp r0, 0 - beq _08057698 - ldr r5, =0x020244ac - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _08057674 - b _080577E8 -_08057674: - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl sub_8059CF8 - ldrb r1, [r4] - adds r1, r5 - ldrb r0, [r1] - movs r2, 0x1 - b _08057732 - .pool -_08057698: - movs r0, 0x10 - ands r0, r2 - cmp r0, 0 - beq _080576D8 - ldr r5, =0x020244ac - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _080576B4 - b _080577E8 -_080576B4: - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl sub_8059CF8 - ldrb r1, [r4] - adds r1, r5 - ldrb r0, [r1] - movs r2, 0x1 - b _08057732 - .pool -_080576D8: - movs r7, 0x40 - adds r0, r7, 0 - ands r0, r2 - cmp r0, 0 - beq _08057700 - ldr r5, =0x020244ac - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080577E8 - b _0805771A - .pool -_08057700: - movs r0, 0x80 - ands r0, r2 - cmp r0, 0 - beq _0805774C - ldr r5, =0x020244ac - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _080577E8 -_0805771A: - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl sub_8059CF8 - ldrb r1, [r4] - adds r1, r5 - ldrb r0, [r1] - movs r2, 0x2 -_08057732: - eors r0, r2 - strb r0, [r1] - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - movs r1, 0 - bl sub_8059CB4 - b _080577E8 - .pool -_0805774C: - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - bne _0805775A - ldrb r0, [r1] - cmp r0, 0x3B - bls _080577DC -_0805775A: - ldr r4, =0x02022fec - ldr r0, [r4] - ands r0, r3 - cmp r0, 0 - beq _080577E8 - ldr r6, =0x02024064 - ldrb r0, [r6] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _080577E8 - movs r0, 0 - bl battle_get_side_with_given_state - ldr r1, =0x02024210 - ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 - lsls r0, 24 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _080577E8 - ldr r0, [r4] - ands r0, r7 - cmp r0, 0 - bne _080577E8 - ldr r0, =0x02023064 - ldrb r1, [r6] - lsls r1, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x1 - bne _080577B2 - cmp r5, 0xC - bhi _080577E8 - adds r0, r5, 0 - movs r1, 0x1 - bl bag_add_item -_080577B2: - movs r0, 0x5 - bl audio_play - movs r0, 0x1 - movs r1, 0xC -_080577BC: - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb -_080577C2: - bl dp01_tbl1_exec_completed - b _080577E8 - .pool -_080577DC: - movs r0, 0x8 - ands r0, r2 - cmp r0, 0 - beq _080577E8 - bl sub_8073314 -_080577E8: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8057588 - - thumb_func_start sub_80577F0 -sub_80577F0: @ 80577F0 - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - movs r1, 0x1 - bl dp11b_obj_free - ldrb r0, [r4] - movs r1, 0 - bl dp11b_obj_free - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8057824 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80577F0 - - thumb_func_start sub_8057824 -sub_8057824: @ 8057824 - push {r4,r5,lr} - sub sp, 0x4 - ldr r1, =gUnknown_0831C5F8 - mov r0, sp - movs r2, 0x4 - bl memcpy - ldr r0, =0x03005d74 - ldrb r0, [r0] - movs r1, 0x1 - movs r2, 0xF - movs r3, 0x1 - bl dp11b_obj_instanciate - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r0, 0 - beq _08057866 -_0805784A: - ldr r0, =0x03005d74 - ldrb r0, [r0] - cmp r4, r0 - beq _0805785C - lsls r0, r4, 24 - lsrs r0, 24 - movs r1, 0x1 - bl dp11b_obj_free -_0805785C: - adds r4, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - blt _0805784A -_08057866: - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2C] - movs r0, 0xF0 - ands r0, r1 - cmp r0, 0 - beq _0805789C - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0x2 - bne _0805789C - ldr r1, =0x020244cc - ldrb r0, [r1] - adds r0, 0x1 - b _080578A0 - .pool -_0805789C: - ldr r1, =0x020244cc - movs r0, 0 -_080578A0: - strb r0, [r1] - ldrh r2, [r2, 0x2E] - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - beq _08057910 - movs r0, 0x5 - bl audio_play - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r4, =0x03005d74 - 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, =sub_8039B2C - str r1, [r0] - ldr r1, =0x020244b0 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r2, [r0] - ldrb r0, [r4] - lsls r0, 8 - orrs r2, r0 - movs r0, 0x1 - movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb - ldrb r0, [r4] - movs r1, 0x1 - bl dp11b_obj_free - bl dp01_tbl1_exec_completed - b _08057BC8 - .pool -_08057910: - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - bne _0805791E - ldrb r0, [r1] - cmp r0, 0x3B - bls _0805798C -_0805791E: - movs r0, 0x5 - bl audio_play - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r5, =0x03005d74 - 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_8039B2C - str r1, [r0] - ldr r1, =0x03005d60 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8057BFC - str r1, [r0] - ldrb r0, [r4] - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x1 - bl dp11b_obj_instanciate - ldrb r0, [r4] - movs r1, 0 - movs r2, 0x7 - movs r3, 0x1 - bl dp11b_obj_instanciate - ldrb r0, [r5] - movs r1, 0x1 - bl dp11b_obj_free - b _08057BC8 - .pool -_0805798C: - movs r0, 0x60 - ands r0, r2 - cmp r0, 0 - bne _08057996 - b _08057AB0 -_08057996: - movs r0, 0x5 - bl audio_play - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r3, =0x03005d74 - ldrb r0, [r3] - 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_8039B2C - str r1, [r0] - adds r5, r3, 0 -_080579B8: - ldrb r0, [r5] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r1, r0, 24 - movs r4, 0 - mov r0, sp - b _080579E2 - .pool -_080579D8: - adds r4, 0x1 - cmp r4, 0x3 - bgt _080579E8 - mov r2, sp - adds r0, r2, r4 -_080579E2: - ldrb r0, [r0] - cmp r1, r0 - bne _080579D8 -_080579E8: - subs r4, 0x1 - cmp r4, 0 - bge _080579F0 - movs r4, 0x4 -_080579F0: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - bl battle_get_side_with_given_state - strb r0, [r5] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - beq _080579E8 - movs r4, 0 - ldrb r0, [r5] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08057A6E - cmp r0, 0x1 - bgt _08057A28 - cmp r0, 0 - beq _08057A32 - b _08057A70 - .pool -_08057A28: - cmp r0, 0x2 - beq _08057A32 - cmp r0, 0x3 - beq _08057A6E - b _08057A70 -_08057A32: - ldr r2, =0x02024064 - ldrb r0, [r2] - ldrb r1, [r5] - cmp r0, r1 - bne _08057A6E - ldr r1, =0x0202406e - ldrb r2, [r2] - lsls r0, r2, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x020244b0 - adds r2, r1 - ldrb r1, [r2] - adds r1, 0xD - bl pokemon_getattr - ldr r2, =gBattleMoves - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1, 0x6] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08057A70 -_08057A6E: - adds r4, 0x1 -_08057A70: - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - ldr r0, =0x03005d74 - cmp r1, 0 - beq _08057A88 - movs r4, 0 -_08057A88: - cmp r4, 0 - beq _080579B8 - b _08057BB0 - .pool -_08057AB0: - movs r0, 0x90 - ands r0, r2 - cmp r0, 0 - bne _08057ABA - b _08057BC8 -_08057ABA: - movs r0, 0x5 - bl audio_play - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r3, =0x03005d74 - ldrb r0, [r3] - 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_8039B2C - str r1, [r0] - adds r5, r3, 0 -_08057ADC: - ldrb r0, [r5] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r1, r0, 24 - movs r4, 0 - mov r0, sp - b _08057B06 - .pool -_08057AFC: - adds r4, 0x1 - cmp r4, 0x3 - bgt _08057B0C - mov r2, sp - adds r0, r2, r4 -_08057B06: - ldrb r0, [r0] - cmp r1, r0 - bne _08057AFC -_08057B0C: - adds r4, 0x1 - cmp r4, 0x3 - ble _08057B14 - movs r4, 0 -_08057B14: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - bl battle_get_side_with_given_state - strb r0, [r5] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - beq _08057B0C - movs r4, 0 - ldrb r0, [r5] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08057B92 - cmp r0, 0x1 - bgt _08057B4C - cmp r0, 0 - beq _08057B56 - b _08057B94 - .pool -_08057B4C: - cmp r0, 0x2 - beq _08057B56 - cmp r0, 0x3 - beq _08057B92 - b _08057B94 -_08057B56: - ldr r2, =0x02024064 - ldrb r0, [r2] - ldrb r1, [r5] - cmp r0, r1 - bne _08057B92 - ldr r1, =0x0202406e - ldrb r2, [r2] - lsls r0, r2, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x020244b0 - adds r2, r1 - ldrb r1, [r2] - adds r1, 0xD - bl pokemon_getattr - ldr r2, =gBattleMoves - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1, 0x6] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08057B94 -_08057B92: - adds r4, 0x1 -_08057B94: - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - ldr r0, =0x03005d74 - cmp r1, 0 - beq _08057BAC - movs r4, 0 -_08057BAC: - cmp r4, 0 - beq _08057ADC -_08057BB0: - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - 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, =sub_8039AD8 - str r1, [r0] -_08057BC8: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8057824 - - thumb_func_start sub_8057BFC -sub_8057BFC: @ 8057BFC - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r0, 0 - mov r8, r0 - ldr r3, =0x02024064 - ldrb r0, [r3] - lsls r0, 9 - ldr r1, =0x02023068 - adds r6, r0, r1 - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2C] - movs r0, 0xF0 - ands r0, r1 - adds r7, r3, 0 - cmp r0, 0 - beq _08057C44 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0x2 - bne _08057C44 - ldr r1, =0x020244cc - ldrb r0, [r1] - adds r0, 0x1 - b _08057C48 - .pool -_08057C44: - ldr r1, =0x020244cc - movs r0, 0 -_08057C48: - strb r0, [r1] - ldrh r2, [r2, 0x2E] - movs r5, 0x1 - adds r0, r5, 0 - ands r0, r2 - cmp r0, 0 - bne _08057C58 - b _08057E04 -_08057C58: - movs r0, 0x5 - bl audio_play - ldr r1, =0x020244b0 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 1 - adds r1, r6, r0 - ldrh r0, [r1] - cmp r0, 0xAE - bne _08057C98 - ldrb r0, [r6, 0x12] - movs r4, 0 - cmp r0, 0x7 - beq _08057CA6 - ldrb r1, [r6, 0x13] - movs r0, 0x7 - eors r1, r0 - negs r0, r1 - orrs r0, r1 - asrs r4, r0, 31 - movs r0, 0x10 - ands r4, r0 - b _08057CA6 - .pool -_08057C98: - ldr r2, =gBattleMoves - ldrh r1, [r1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r4, [r0, 0x6] -_08057CA6: - movs r0, 0x10 - ands r0, r4 - cmp r0, 0 - beq _08057CC4 - ldr r0, =0x03005d74 - ldr r1, =0x02024064 - ldrb r1, [r1] - strb r1, [r0] - b _08057CDE - .pool -_08057CC4: - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_get_per_side_status - adds r1, r0, 0 - movs r2, 0x1 - movs r0, 0x1 - ands r0, r1 - eors r0, r2 - bl battle_get_side_with_given_state - ldr r1, =0x03005d74 - strb r0, [r1] -_08057CDE: - ldr r5, =0x02023064 - ldr r0, =0x02024064 - ldrb r3, [r0] - lsls r2, r3, 9 - adds r1, r5, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r7, r0, 0 - cmp r1, 0 - bne _08057D18 - movs r0, 0x2 - ands r0, r4 - cmp r0, 0 - beq _08057D5A - adds r0, r5, 0x2 - adds r0, r2, r0 - ldrb r0, [r0] - cmp r0, 0 - bne _08057D5A - movs r0, 0x1 - add r8, r0 - b _08057D5A - .pool -_08057D18: - movs r0, 0x7D - ands r0, r4 - cmp r0, 0 - bne _08057D24 - movs r0, 0x1 - add r8, r0 -_08057D24: - ldr r0, =0x020244b0 - adds r0, r3, r0 - adds r1, r6, 0 - adds r1, 0x8 - ldrb r0, [r0] - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _08057D62 - movs r0, 0x12 - ands r0, r4 - cmp r0, 0 - bne _08057D5A - movs r0, 0 - bl sub_8069DEC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _08057D5A - ldrb r0, [r7] - bl sub_8069F34 - ldr r1, =0x03005d74 - strb r0, [r1] - movs r0, 0 - mov r8, r0 -_08057D5A: - ldr r7, =0x02024064 - mov r0, r8 - cmp r0, 0 - bne _08057D80 -_08057D62: - ldr r1, =0x020244b0 - ldrb r0, [r7] - adds r0, r1 - ldrb r2, [r0] - ldr r0, =0x03005d74 - ldrb r0, [r0] - lsls r0, 8 - orrs r2, r0 - b _08057E1C - .pool -_08057D80: - ldr r1, =0x03005d60 - ldrb r0, [r7] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8057824 - str r1, [r0] - movs r0, 0x12 - ands r4, r0 - cmp r4, 0 - beq _08057DA8 - ldr r1, =0x03005d74 - ldrb r0, [r7] - b _08057DD8 - .pool -_08057DA8: - movs r0, 0x1 - bl battle_get_side_with_given_state - ldr r1, =0x02024210 - ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 - lsls r0, 24 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08057DD0 - movs r0, 0x3 - b _08057DD2 - .pool -_08057DD0: - movs r0, 0x1 -_08057DD2: - bl battle_get_side_with_given_state - ldr r1, =0x03005d74 -_08057DD8: - strb r0, [r1] - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x03005d74 - 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, =sub_8039AD8 - b _08057F9C - .pool -_08057E04: - movs r6, 0x2 - adds r0, r6, 0 - ands r0, r2 - cmp r0, 0 - bne _08057E14 - ldrb r0, [r1] - cmp r0, 0x3B - bls _08057E30 -_08057E14: - movs r0, 0x5 - bl audio_play - ldr r2, =0x0000ffff -_08057E1C: - movs r0, 0x1 - movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb - bl dp01_tbl1_exec_completed - b _08057F9E - .pool -_08057E30: - movs r0, 0x20 - ands r0, r2 - cmp r0, 0 - beq _08057E60 - ldr r4, =0x020244b0 - ldrb r0, [r7] - adds r2, r0, r4 - ldrb r1, [r2] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _08057E4A - b _08057F9E -_08057E4A: - ldrb r0, [r2] - bl battle_menu_cursor_related - ldrb r1, [r7] - adds r1, r4 - ldrb r0, [r1] - movs r2, 0x1 - eors r0, r2 - b _08057F08 - .pool -_08057E60: - movs r0, 0x10 - ands r0, r2 - cmp r0, 0 - beq _08057EA4 - ldr r4, =0x020244b0 - ldrb r0, [r7] - adds r3, r0, r4 - ldrb r2, [r3] - movs r6, 0x1 - adds r0, r5, 0 - ands r0, r2 - cmp r0, 0 - beq _08057E7C - b _08057F9E -_08057E7C: - ldr r1, =0x03005d78 - adds r0, r6, 0 - eors r0, r2 - ldrb r1, [r1] - cmp r0, r1 - bcc _08057E8A - b _08057F9E -_08057E8A: - ldrb r0, [r3] - bl battle_menu_cursor_related - ldrb r1, [r7] - adds r1, r4 - ldrb r0, [r1] - eors r0, r6 - b _08057F08 - .pool -_08057EA4: - movs r0, 0x40 - ands r0, r2 - cmp r0, 0 - beq _08057ED4 - ldr r4, =0x020244b0 - ldrb r0, [r7] - adds r2, r0, r4 - ldrb r1, [r2] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _08057F9E - ldrb r0, [r2] - bl battle_menu_cursor_related - ldrb r1, [r7] - adds r1, r4 - ldrb r0, [r1] - movs r2, 0x2 - eors r0, r2 - b _08057F08 - .pool -_08057ED4: - movs r0, 0x80 - ands r0, r2 - cmp r0, 0 - beq _08057F30 - ldr r4, =0x020244b0 - ldrb r0, [r7] - adds r3, r0, r4 - ldrb r2, [r3] - movs r5, 0x2 - adds r0, r6, 0 - ands r0, r2 - cmp r0, 0 - bne _08057F9E - ldr r1, =0x03005d78 - adds r0, r5, 0 - eors r0, r2 - ldrb r1, [r1] - cmp r0, r1 - bcs _08057F9E - ldrb r0, [r3] - bl battle_menu_cursor_related - ldrb r1, [r7] - adds r1, r4 - ldrb r0, [r1] - eors r0, r5 -_08057F08: - strb r0, [r1] - movs r0, 0x5 - bl audio_play - ldrb r0, [r7] - adds r0, r4 - ldrb r0, [r0] - movs r1, 0 - bl battle_menu_cursor_related_2 - bl sub_8059B3C - bl sub_8059BB0 - b _08057F9E - .pool -_08057F30: - movs r0, 0x4 - ands r0, r2 - cmp r0, 0 - beq _08057F9E - ldr r0, =0x03005d78 - ldrb r0, [r0] - cmp r0, 0x1 - bls _08057F9E - ldr r0, =0x02022fec - ldr r5, [r0] - ands r5, r6 - cmp r5, 0 - bne _08057F9E - ldr r4, =0x020244b0 - ldrb r0, [r7] - adds r0, r4 - ldrb r0, [r0] - movs r1, 0x1D - bl battle_menu_cursor_related_2 - ldrb r0, [r7] - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _08057F78 - ldr r0, =0x03005d74 - strb r5, [r0] - b _08057F80 - .pool -_08057F78: - ldr r1, =0x03005d74 - adds r0, 0x1 - strb r0, [r1] - adds r0, r1, 0 -_08057F80: - ldrb r0, [r0] - movs r1, 0x1B - bl battle_menu_cursor_related_2 - ldr r0, =gUnknown_085CCACA - movs r1, 0xB - bl battle_show_message_maybe - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8058138 -_08057F9C: - str r1, [r0] -_08057F9E: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8057BFC - - thumb_func_start sub_8057FBC -sub_8057FBC: @ 8057FBC - push {r4-r7,lr} - movs r7, 0 - ldr r4, =0x030022c0 - ldrh r1, [r4, 0x2E] - movs r6, 0x1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _08057FD6 - movs r0, 0x5 - bl audio_play - movs r7, 0x1 -_08057FD6: - ldrh r1, [r4, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08057FF8 - movs r0, 0x5 - bl audio_play - ldr r1, =0x02022e14 - movs r0, 0 - strh r0, [r1] - ldr r1, =0x02022e16 - movs r2, 0xA0 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r1] - movs r7, 0xFF -_08057FF8: - ldrh r1, [r4, 0x2E] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08058038 - ldr r5, =0x020244b0 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r2, r0, r5 - ldrb r1, [r2] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _08058038 - ldrb r0, [r2] - bl battle_menu_cursor_related - ldrb r1, [r4] - adds r1, r5 - ldrb r0, [r1] - movs r2, 0x1 - eors r0, r2 - strb r0, [r1] - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - movs r1, 0 - bl battle_menu_cursor_related_2 -_08058038: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08058086 - ldr r5, =0x020244b0 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r3, r0, r5 - ldrb r2, [r3] - movs r6, 0x1 - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - bne _08058086 - ldr r1, =0x03005d78 - adds r0, r6, 0 - eors r0, r2 - ldrb r1, [r1] - cmp r0, r1 - bcs _08058086 - ldrb r0, [r3] - bl battle_menu_cursor_related - ldrb r1, [r4] - adds r1, r5 - ldrb r0, [r1] - eors r0, r6 - strb r0, [r1] - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - movs r1, 0 - bl battle_menu_cursor_related_2 -_08058086: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080580C8 - ldr r5, =0x020244b0 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r2, r0, r5 - ldrb r1, [r2] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080580C8 - ldrb r0, [r2] - bl battle_menu_cursor_related - ldrb r1, [r4] - adds r1, r5 - ldrb r0, [r1] - movs r2, 0x2 - eors r0, r2 - strb r0, [r1] - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - movs r1, 0 - bl battle_menu_cursor_related_2 -_080580C8: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08058116 - ldr r5, =0x020244b0 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r3, r0, r5 - ldrb r2, [r3] - movs r6, 0x2 - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - bne _08058116 - ldr r1, =0x03005d78 - adds r0, r6, 0 - eors r0, r2 - ldrb r1, [r1] - cmp r0, r1 - bcs _08058116 - ldrb r0, [r3] - bl battle_menu_cursor_related - ldrb r1, [r4] - adds r1, r5 - ldrb r0, [r1] - eors r0, r6 - strb r0, [r1] - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - movs r1, 0 - bl battle_menu_cursor_related_2 -_08058116: - adds r0, r7, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8057FBC - - thumb_func_start sub_8058138 -sub_8058138: @ 8058138 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x5 - ands r0, r1 - cmp r0, 0 - bne _08058152 - b _08058500 -_08058152: - movs r0, 0x5 - bl audio_play - ldr r0, =0x020244b0 - mov r10, r0 - ldr r1, =0x02024064 - mov r8, r1 - ldrb r1, [r1] - adds r2, r1, r0 - ldr r5, =0x03005d74 - ldrb r0, [r2] - ldrb r3, [r5] - cmp r0, r3 - bne _08058170 - b _080584A8 -_08058170: - lsls r1, 9 - ldr r0, =0x02023068 - adds r1, r0 - mov r9, r1 - ldrb r1, [r2] - lsls r1, 1 - add r1, r9 - ldrh r6, [r1] - ldrb r0, [r5] - lsls r0, 1 - add r0, r9 - ldrh r0, [r0] - strh r0, [r1] - ldrb r0, [r5] - lsls r0, 1 - add r0, r9 - strh r6, [r0] - mov r1, r8 - ldrb r0, [r1] - add r0, r10 - ldrb r1, [r0] - mov r7, r9 - adds r7, 0x8 - adds r1, r7, r1 - ldrb r6, [r1] - ldrb r0, [r5] - adds r0, r7, r0 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r5] - adds r0, r7, r0 - strb r6, [r0] - mov r2, r8 - ldrb r0, [r2] - add r0, r10 - ldrb r1, [r0] - mov r2, r9 - adds r2, 0xC - adds r1, r2, r1 - ldrb r6, [r1] - ldrb r0, [r5] - adds r0, r2, r0 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r5] - adds r2, r0 - strb r6, [r2] - mov r3, r8 - ldrb r1, [r3] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r2, =0x020242bc - adds r6, r0, r2 - ldrb r4, [r6, 0x18] - lsls r3, r4, 24 - lsrs r2, r3, 28 - ldr r0, =gUnknown_0832A328 - mov r12, r0 - add r1, r10 - ldrb r0, [r1] - lsls r0, 2 - add r0, r12 - ldr r0, [r0] - ands r2, r0 - cmp r2, 0 - beq _0805822A - lsrs r1, r3, 28 - bics r1, r0 - lsls r1, 4 - movs r2, 0xF - adds r0, r2, 0 - ands r0, r4 - orrs r0, r1 - strb r0, [r6, 0x18] - mov r1, r8 - ldrb r0, [r1] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r3, =0x020242bc - adds r1, r3 - ldrb r4, [r1, 0x18] - lsrs r3, r4, 4 - ldrb r0, [r5] - lsls r0, 2 - add r0, r12 - ldr r0, [r0] - orrs r0, r3 - lsls r0, 4 - ands r2, r4 - orrs r2, r0 - strb r2, [r1, 0x18] -_0805822A: - bl sub_8059AAC - movs r6, 0 - mov r12, r7 - mov r5, sp - adds r5, 0x18 - str r5, [sp, 0x1C] - ldr r2, =0x02024084 - mov r0, r8 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r4, r0, 0 - adds r4, 0x3B - mov r7, r8 - mov r10, r2 - movs r5, 0x3 -_0805824E: - mov r1, sp - adds r3, r1, r6 - ldrb r1, [r4] - lsls r2, r6, 1 - adds r0, r5, 0 - lsls r0, r2 - ands r1, r0 - asrs r1, r2 - strb r1, [r3] - adds r6, 0x1 - cmp r6, 0x3 - ble _0805824E - ldr r1, =0x020244b0 - ldrb r0, [r7] - adds r0, r1 - ldrb r0, [r0] - add r0, sp - ldrb r0, [r0] - ldr r2, [sp, 0x1C] - strb r0, [r2] - ldrb r0, [r7] - adds r0, r1 - ldrb r0, [r0] - mov r3, sp - adds r2, r3, r0 - ldr r1, =0x03005d74 - ldrb r0, [r1] - add r0, sp - ldrb r0, [r0] - movs r3, 0 - strb r0, [r2] - ldrb r0, [r1] - mov r5, sp - adds r1, r5, r0 - ldr r2, [sp, 0x1C] - ldrb r0, [r2] - strb r0, [r1] - strb r3, [r2] - movs r6, 0 - ldr r2, [sp, 0x1C] -_0805829E: - mov r3, sp - adds r0, r3, r6 - ldrb r1, [r0] - lsls r0, r6, 1 - lsls r1, r0 - ldrb r0, [r2] - orrs r0, r1 - strb r0, [r2] - adds r6, 0x1 - cmp r6, 0x3 - ble _0805829E - ldrb r1, [r7] - movs r0, 0x58 - muls r0, r1 - add r0, r10 - adds r0, 0x3B - ldr r5, [sp, 0x1C] - ldrb r1, [r5] - strb r1, [r0] - movs r6, 0 - adds r4, r7, 0 - movs r3, 0x58 - movs r0, 0x24 - add r0, r10 - mov r8, r0 - mov r2, r9 - mov r7, r10 - adds r7, 0xC - mov r5, r12 -_080582D8: - lsls r1, r6, 1 - ldrb r0, [r4] - muls r0, r3 - adds r1, r0 - adds r1, r7 - ldrh r0, [r2] - strh r0, [r1] - ldrb r0, [r4] - adds r1, r0, 0 - muls r1, r3 - adds r1, r6, r1 - add r1, r8 - adds r0, r5, r6 - ldrb r0, [r0] - strb r0, [r1] - adds r2, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _080582D8 - ldr r2, =0x02024064 - ldrb r1, [r2] - movs r0, 0x58 - muls r0, r1 - mov r1, r10 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - beq _0805831A - b _080584A8 -_0805831A: - movs r6, 0 - mov r1, sp - adds r1, 0x4 - str r1, [sp, 0x20] - add r3, sp, 0xC - mov r10, r3 - ldr r5, =0x0202406e - mov r9, r5 - mov r8, r2 - movs r7, 0x64 - ldr r5, =0x020244ec - adds r4, r1, 0 -_08058332: - mov r1, r8 - ldrb r0, [r1] - lsls r0, 1 - add r0, r9 - ldrh r0, [r0] - muls r0, r7 - adds r0, r5 - adds r1, r6, 0 - adds r1, 0xD - bl pokemon_getattr - strh r0, [r4] - mov r2, r8 - ldrb r0, [r2] - lsls r0, 1 - add r0, r9 - ldrh r0, [r0] - muls r0, r7 - adds r0, r5 - adds r1, r6, 0 - adds r1, 0x11 - bl pokemon_getattr - mov r3, r10 - adds r1, r3, r6 - strb r0, [r1] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _08058332 - ldr r1, =0x0202406e - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - ldr r5, [sp, 0x1C] - strb r0, [r5] - movs r6, 0 - movs r5, 0x3 - ldr r4, [sp, 0x1C] -_08058392: - mov r0, sp - adds r3, r0, r6 - lsls r2, r6, 1 - adds r1, r5, 0 - lsls r1, r2 - ldrb r0, [r4] - ands r0, r1 - asrs r0, r2 - strb r0, [r3] - adds r6, 0x1 - cmp r6, 0x3 - ble _08058392 - ldr r4, =0x020244b0 - ldr r3, =0x02024064 - ldrb r0, [r3] - adds r0, r4 - ldrb r1, [r0] - lsls r1, 1 - ldr r2, [sp, 0x20] - adds r1, r2, r1 - ldrh r6, [r1] - ldr r2, =0x03005d74 - ldrb r0, [r2] - lsls r0, 1 - ldr r5, [sp, 0x20] - adds r0, r5, r0 - ldrh r0, [r0] - movs r5, 0 - strh r0, [r1] - ldrb r0, [r2] - lsls r0, 1 - ldr r1, [sp, 0x20] - adds r0, r1, r0 - strh r6, [r0] - ldrb r0, [r3] - adds r0, r4 - ldrb r1, [r0] - add r1, r10 - ldrb r6, [r1] - ldrb r0, [r2] - add r0, r10 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r2] - add r0, r10 - strb r6, [r0] - ldrb r0, [r3] - adds r0, r4 - ldrb r0, [r0] - add r0, sp - ldrb r0, [r0] - ldr r1, [sp, 0x1C] - strb r0, [r1] - ldrb r0, [r3] - adds r0, r4 - ldrb r0, [r0] - mov r3, sp - adds r1, r3, r0 - ldrb r0, [r2] - add r0, sp - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r2] - adds r1, r3, r0 - ldr r2, [sp, 0x1C] - ldrb r0, [r2] - strb r0, [r1] - strb r5, [r2] - movs r6, 0 - ldr r2, [sp, 0x1C] -_0805841E: - mov r3, sp - adds r0, r3, r6 - ldrb r1, [r0] - lsls r0, r6, 1 - lsls r1, r0 - ldrb r0, [r2] - orrs r0, r1 - strb r0, [r2] - adds r6, 0x1 - cmp r6, 0x3 - ble _0805841E - movs r6, 0 - ldr r5, =0x0202406e - mov r10, r5 - ldr r0, =0x02024064 - mov r9, r0 - movs r1, 0x64 - mov r8, r1 - ldr r7, =0x020244ec - ldr r5, [sp, 0x20] - adds r5, 0x8 - ldr r4, [sp, 0x20] -_0805844A: - mov r2, r9 - ldrb r0, [r2] - lsls r0, 1 - add r0, r10 - ldrh r0, [r0] - mov r3, r8 - muls r3, r0 - adds r0, r3, 0 - adds r0, r7 - adds r1, r6, 0 - adds r1, 0xD - adds r2, r4, 0 - bl pokemon_setattr - mov r1, r9 - ldrb r0, [r1] - lsls r0, 1 - add r0, r10 - ldrh r0, [r0] - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - adds r0, r7 - adds r1, r6, 0 - adds r1, 0x11 - adds r2, r5, 0 - bl pokemon_setattr - adds r5, 0x1 - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _0805844A - ldr r1, =0x0202406e - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x15 - ldr r2, [sp, 0x1C] - bl pokemon_setattr -_080584A8: - ldr r1, =0x03005d60 - ldr r2, =0x02024064 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8057BFC - str r1, [r0] - ldr r3, =0x020244b0 - ldrb r0, [r2] - adds r0, r3 - ldr r1, =0x03005d74 - ldrb r1, [r1] - strb r1, [r0] - ldrb r0, [r2] - adds r0, r3 - ldrb r0, [r0] - movs r1, 0 - bl battle_menu_cursor_related_2 - b _08058532 - .pool -_08058500: - movs r0, 0x6 - ands r0, r1 - cmp r0, 0 - beq _08058554 - movs r0, 0x5 - bl audio_play - ldr r0, =0x03005d74 - ldrb r0, [r0] - bl battle_menu_cursor_related - ldr r1, =0x020244b0 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r1 - ldrb r0, [r0] - movs r1, 0 - bl battle_menu_cursor_related_2 - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8057BFC - str r1, [r0] -_08058532: - bl sub_8059B18 - bl sub_8059B3C - bl sub_8059BB0 - b _080586E8 - .pool -_08058554: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080585A4 - ldr r3, =0x03005d74 - ldrb r2, [r3] - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - bne _0805856A - b _080586E8 -_0805856A: - ldr r0, =0x020244b0 - ldr r1, =0x02024064 - ldrb r1, [r1] - adds r1, r0 - ldrb r5, [r1] - cmp r2, r5 - bne _08058590 -_08058578: - ldrb r0, [r1] - movs r1, 0x1D - bl battle_menu_cursor_related_2 - b _08058596 - .pool -_08058590: - ldrb r0, [r3] - bl battle_menu_cursor_related -_08058596: - ldr r4, =0x03005d74 - ldrb r0, [r4] - movs r1, 0x1 - b _0805862C - .pool -_080585A4: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080585E8 - ldr r3, =0x03005d74 - ldrb r2, [r3] - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - beq _080585BA - b _080586E8 -_080585BA: - ldr r1, =0x03005d78 - movs r0, 0x1 - eors r0, r2 - ldrb r1, [r1] - cmp r0, r1 - bcc _080585C8 - b _080586E8 -_080585C8: - ldr r0, =0x020244b0 - ldr r1, =0x02024064 - ldrb r1, [r1] - adds r1, r0 - ldrb r0, [r1] - cmp r2, r0 - beq _08058578 - b _08058590 - .pool -_080585E8: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0805865C - ldr r3, =0x03005d74 - ldrb r2, [r3] - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - beq _080586E8 - ldr r0, =0x020244b0 - ldr r1, =0x02024064 - ldrb r1, [r1] - adds r1, r0 - ldrb r5, [r1] - cmp r2, r5 - bne _08058620 - ldrb r0, [r1] - movs r1, 0x1D - bl battle_menu_cursor_related_2 - b _08058626 - .pool -_08058620: - ldrb r0, [r3] - bl battle_menu_cursor_related -_08058626: - ldr r4, =0x03005d74 - ldrb r0, [r4] - movs r1, 0x2 -_0805862C: - eors r0, r1 - strb r0, [r4] - movs r0, 0x5 - bl audio_play - ldr r1, =0x020244b0 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r4] - ldrb r0, [r0] - cmp r1, r0 - beq _080586CA - ldrb r0, [r4] - movs r1, 0x1B - bl battle_menu_cursor_related_2 - b _080586E8 - .pool -_0805865C: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080586E8 - ldr r3, =0x03005d74 - ldrb r2, [r3] - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - bne _080586E8 - ldr r1, =0x03005d78 - movs r0, 0x2 - eors r0, r2 - ldrb r1, [r1] - cmp r0, r1 - bcs _080586E8 - ldr r0, =0x020244b0 - ldr r1, =0x02024064 - ldrb r1, [r1] - adds r1, r0 - ldrb r0, [r1] - cmp r2, r0 - bne _080586A4 - ldrb r0, [r1] - movs r1, 0x1D - bl battle_menu_cursor_related_2 - b _080586AA - .pool -_080586A4: - ldrb r0, [r3] - bl battle_menu_cursor_related -_080586AA: - ldr r4, =0x03005d74 - ldrb r0, [r4] - movs r1, 0x2 - eors r0, r1 - strb r0, [r4] - movs r0, 0x5 - bl audio_play - ldr r1, =0x020244b0 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r4] - ldrb r0, [r0] - cmp r1, r0 - bne _080586E0 -_080586CA: - adds r0, r1, 0 - movs r1, 0 - bl battle_menu_cursor_related_2 - b _080586E8 - .pool -_080586E0: - ldrb r0, [r4] - movs r1, 0x1B - bl battle_menu_cursor_related_2 -_080586E8: - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8058138 - - thumb_func_start sub_80586F8 -sub_80586F8: @ 80586F8 - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _0805875C - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08058798 - movs r0, 0x5A - bl m4aSongNumStop - ldr r3, =0x030022c0 - ldr r0, =0x00000439 - adds r2, r3, r0 - ldrb r1, [r2] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r0, =0x03005d00 - ldr r0, [r0] - str r0, [r3] - ldr r0, =sub_8038D64 - bl SetMainCallback2 - ldr r0, =0x0202433a - ldrb r0, [r0] - cmp r0, 0x1 - bne _08058738 - bl sub_817E3F4 -_08058738: - bl FreeAllWindowBuffers - b _08058798 - .pool -_0805875C: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08058798 - movs r0, 0x5A - bl m4aSongNumStop - ldr r3, =0x030022c0 - ldr r0, =0x00000439 - adds r2, r3, r0 - ldrb r1, [r2] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r0, =0x03005d00 - ldr r0, [r0] - str r0, [r3] - ldr r0, =sub_8038D64 - bl SetMainCallback2 - ldr r0, =0x0202433a - ldrb r0, [r0] - cmp r0, 0x1 - bne _08058794 - bl sub_817E3F4 -_08058794: - bl FreeAllWindowBuffers -_08058798: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80586F8 - - thumb_func_start sub_80587B0 -sub_80587B0: @ 80587B0 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08058832 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08058810 - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08058832 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _080587F0 - bl sub_800AC34 - b _080587F4 - .pool -_080587F0: - bl sub_800ADF8 -_080587F4: - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80586F8 - str r1, [r0] - b _08058832 - .pool -_08058810: - movs r0, 0x5A - bl m4aSongNumStop - ldr r2, =0x030022c0 - ldr r0, =0x00000439 - adds r3, r2, r0 - ldrb r1, [r3] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - ldr r0, =0x03005d00 - ldr r0, [r0] - str r0, [r2] - ldr r0, [r2, 0x8] - bl SetMainCallback2 -_08058832: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80587B0 - - thumb_func_start sub_8058844 -sub_8058844: @ 8058844 - push {lr} - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - 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, =DummyObjectCallback - cmp r1, r0 - bne _08058868 - bl dp01_tbl1_exec_completed -_08058868: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8058844 - - thumb_func_start sub_805887C -sub_805887C: @ 805887C - push {lr} - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - 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, =DummyObjectCallback - cmp r1, r0 - bne _080588A0 - bl dp01_tbl1_exec_completed -_080588A0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805887C - - thumb_func_start bx_802F7A0 -bx_802F7A0: @ 80588B4 - push {r4-r6,lr} - ldr r6, =0x02020630 - ldr r5, =0x020241e4 - ldr r4, =0x02024064 - 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, =DummyObjectCallback - cmp r1, r0 - bne _08058908 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - 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 obj_free_rotscale_entry - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl RemoveObjectAndFreeTiles - bl dp01_tbl1_exec_completed -_08058908: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bx_802F7A0 - - thumb_func_start sub_8058924 -sub_8058924: @ 8058924 - push {r4,lr} - ldr r4, =0x020244d0 - ldr r1, [r4] - ldr r3, =0x02024064 - 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 _0805895C - 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 dp01_tbl1_exec_completed -_0805895C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8058924 - - thumb_func_start sub_805896C -sub_805896C: @ 805896C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r7, 0 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08058998 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _080589D0 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080589D0 -_08058998: - ldr r2, =0x02020630 - ldr r1, =0x03005d70 - ldr r3, =0x02024064 - ldrb r0, [r3] - 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, =DummyObjectCallback - mov r10, r3 - cmp r1, r0 - bne _08058A0A - b _08058A0E - .pool -_080589D0: - ldr r3, =0x02020630 - ldr r6, =0x03005d70 - ldr r2, =0x02024064 - ldrb r4, [r2] - adds r0, r4, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r5, r3, 0 - adds r5, 0x1C - adds r0, r5 - ldr r3, [r0] - ldr r0, =DummyObjectCallback - mov r10, r2 - cmp r3, r0 - bne _08058A0A - movs r0, 0x2 - eors r4, r0 - adds r0, r4, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r0, [r0] - cmp r0, r3 - bne _08058A0A - movs r7, 0x1 -_08058A0A: - cmp r7, 0 - beq _08058B08 -_08058A0E: - ldr r0, =0x020244d0 - mov r9, r0 - ldr r0, [r0] - mov r6, r10 - ldrb r2, [r6] - ldr r3, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r4, r0, r3 - ldrb r1, [r4, 0x1] - movs r5, 0x1 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _08058B08 - 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, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _08058B08 - ldrb r1, [r4] - movs r3, 0x7F - adds r0, r3, 0 - ands r0, r1 - strb r0, [r4] - mov r2, r9 - ldr r0, [r2] - 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, r9 - ldr r2, [r0] - ldrb r0, [r6] - 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, [r6] - 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 FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - ldr r7, =0x0202406e - ldrb r1, [r6] - lsls r0, r1, 1 - adds r0, r7 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - bl sub_805E990 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08058AE4 - ldrb r0, [r6] - mov r1, r8 - eors r1, r0 - lsls r0, r1, 1 - adds r0, r7 - ldrh r0, [r0] - muls r0, r5 - adds r0, r4 - bl sub_805E990 -_08058AE4: - mov r2, r9 - ldr r0, [r2] - mov r2, r10 - 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, =0x03005d60 - mov r2, r10 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8058924 - str r1, [r0] -_08058B08: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805896C - - thumb_func_start sub_8058B40 -sub_8058B40: @ 8058B40 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r0, 0 - mov r9, r0 - mov r8, r0 - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r7, =0x02024064 - 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 _08058B80 - ldr r0, =0x0202406e - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_08058B80: - 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 _08058BB2 - ldr r0, =0x0202406e - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_08058BB2: - 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 _08058C82 - 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 _08058C82 - ldrb r1, [r4, 0x1] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08058C68 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08058C38 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08058C38 - ldr r4, =0x03005d70 - ldrb r0, [r7] - adds r1, r6, 0 - eors r1, r0 - adds r0, r1, r4 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - 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 -_08058C38: - ldr r5, =0x03005d70 - ldr r4, =0x02024064 - ldrb r1, [r4] - adds r0, r1, r5 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - 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 -_08058C68: - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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] -_08058C82: - ldr r5, =0x020244d0 - ldr r0, [r5] - ldr r4, =0x02024064 - 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 _08058D32 - 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 _08058D32 - bl sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - bne _08058D32 - ldr r0, [r5] - ldrb r1, [r4] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _08058D14 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x42 - ands r0, r1 - cmp r0, 0x42 - bne _08058D08 - ldr r0, =0x03007420 - bl m4aMPlayContinue - b _08058D14 - .pool -_08058D08: - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl -_08058D14: - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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 -_08058D32: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08058D52 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08058DAC - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08058DAC -_08058D52: - ldr r2, =0x02020630 - ldr r0, =0x03005d7c - ldr r1, =0x02024064 - 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, =DummyObjectCallback - cmp r3, r0 - bne _08058E0A - ldr r0, =0x020241e4 - 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 _08058E0A - b _08058E06 - .pool -_08058DAC: - ldr r2, =0x02020630 - ldr r7, =0x03005d7c - ldr r0, =0x02024064 - 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, =DummyObjectCallback - cmp r4, r0 - bne _08058E0A - ldr r6, =0x020241e4 - 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 _08058E0A - 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 _08058E0A - 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 _08058E0A -_08058E06: - movs r0, 0x1 - mov r8, r0 -_08058E0A: - mov r0, r9 - cmp r0, 0 - beq _08058EAA - mov r0, r8 - cmp r0, 0 - beq _08058EAA - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08058E48 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08058E48 - ldr r2, =0x03005d7c - ldr r0, =0x02024064 - ldrb r1, [r0] - movs r0, 0x2 - eors r0, r1 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles -_08058E48: - ldr r1, =0x03005d7c - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - ldr r3, =0x020244d0 - 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, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805896C - str r1, [r0] -_08058EAA: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8058B40 - - thumb_func_start sub_8058EDC -sub_8058EDC: @ 8058EDC - push {r4-r6,lr} - ldr r2, =0x02020630 - ldr r0, =0x03005d70 - ldr r6, =0x02024064 - ldrb r3, [r6] - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r4, [r0] - ldr r0, =DummyObjectCallback - cmp r4, r0 - bne _08058F94 - ldr r5, =0x020244d0 - ldr r0, [r5] - ldr r1, [r0, 0x4] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x1] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08058F94 - ldr r0, =0x020241e4 - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - cmp r0, r4 - bne _08058F94 - adds r0, r3, 0 - bl sub_805E408 - ldr r0, [r5] - ldrb r2, [r6] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x7F - ands r0, r2 - strb r0, [r1] - ldr r0, [r5] - 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 r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - ldr r4, =0x000027f9 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - ldr r0, [r5] - 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 _08058F88 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x6 - bl move_anim_start_t4 -_08058F88: - ldr r0, =0x03005d60 - ldrb r1, [r6] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_8058FC0 - str r0, [r1] -_08058F94: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8058EDC - - thumb_func_start sub_8058FC0 -sub_8058FC0: @ 8058FC0 - push {r4,lr} - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r4, =0x02024064 - 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 _0805900E - bl sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - bne _0805900E - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl - ldr r2, =0x0202406e - ldrb r1, [r4] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - adds r0, r2 - bl sub_805E990 - bl dp01_tbl1_exec_completed -_0805900E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8058FC0 - - thumb_func_start sub_805902C -sub_805902C: @ 805902C - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r0, [r6] - ldr r5, =0x02024064 - 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 _0805905E - ldr r0, =0x0202406e - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_0805905E: - ldr r4, =0x02020630 - ldr r0, =0x03005d7c - 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, =DummyObjectCallback - cmp r1, r0 - bne _080590D2 - 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 _080590D2 - adds r0, r3, r4 - bl RemoveObjectAndFreeTiles - ldr r4, =0x03005d70 - ldrb r1, [r5] - adds r0, r1, r4 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - 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 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8058EDC - str r1, [r0] -_080590D2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805902C - - thumb_func_start c3_0802FDF4 -c3_0802FDF4: @ 8059100 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - bne _08059122 - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl - adds r0, r4, 0 - bl DestroyTask -_08059122: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end c3_0802FDF4 - - thumb_func_start bx_t1_healthbar_update -bx_t1_healthbar_update: @ 8059130 - push {r4-r6,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - ldr r6, =0x03005d70 - 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 _08059178 - ldrb r0, [r5] - adds r0, r6 - ldrb r0, [r0] - movs r2, 0 - bl heathbar_draw_hp - b _08059192 - .pool -_08059178: - ldr r2, =0x0202406e - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - adds r0, r2 - bl sub_805E990 - bl dp01_tbl1_exec_completed -_08059192: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bx_t1_healthbar_update - - thumb_func_start sub_80591A0 -sub_80591A0: @ 80591A0 - push {lr} - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _080591B2 - bl dp01_tbl1_exec_completed -_080591B2: - pop {r0} - bx r0 - thumb_func_end sub_80591A0 - - thumb_func_start sub_80591B8 -sub_80591B8: @ 80591B8 - 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 - mov r9, r0 - ldr r1, =0x03005e00 - lsls r0, 2 - add r0, r9 - lsls r0, 3 - adds r0, r1 - mov r8, r0 - ldrb r0, [r0, 0x8] - mov r10, r0 - mov r1, r8 - ldrb r7, [r1, 0xC] - str r7, [sp, 0x8] - ldrh r2, [r1, 0xA] - str r2, [sp, 0xC] - bl battle_type_is_double - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080591FE - ldr r1, =0x0202406e - lsls r0, r7, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r10, r0 - bne _080591FE - b _08059314 -_080591FE: - movs r0, 0x64 - mov r1, r10 - muls r1, r0 - ldr r0, =0x020244ec - adds r6, r1, r0 - adds r0, r6, 0 - movs r1, 0xB - bl pokemon_getattr - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r6, 0 - movs r1, 0x38 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - movs r1, 0x19 - bl pokemon_getattr - str r0, [sp, 0x4] - ldr r3, =gExperienceTables - adds r4, 0x1 - lsls r4, 2 - ldr r2, =gBaseStats - lsls r1, r5, 3 - subs r1, r5 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1, 0x13] - movs r1, 0xCA - lsls r1, 1 - muls r1, r2 - adds r4, r1 - adds r4, r3 - ldr r2, [r4] - str r2, [sp] - ldr r3, [sp, 0xC] - lsls r1, r3, 16 - asrs r1, 16 - adds r0, r1 - cmp r0, r2 - bcc _080592EC - adds r0, r6, 0 - movs r1, 0x19 - mov r2, sp - bl pokemon_setattr - adds r0, r6, 0 - bl pokemon_calc_effective_stats - ldr r2, [sp] - add r0, sp, 0x4 - ldrh r0, [r0] - subs r2, r0 - ldr r0, [sp, 0xC] - subs r2, r0, r2 - ldr r4, =0x02024064 - ldrb r5, [r4] - strb r7, [r4] - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x1 - movs r1, 0xB - bl dp01_build_cmdbuf_x21_a_bb - strb r5, [r4] - bl battle_type_is_double - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080592D4 - ldr r2, =0x0202406e - lsls r0, r7, 1 - adds r0, r2 - mov r1, r10 - ldrh r0, [r0] - cmp r1, r0 - beq _080592B2 - movs r0, 0x2 - eors r7, r0 - lsls r0, r7, 1 - adds r0, r2 - ldrh r0, [r0] - cmp r1, r0 - bne _080592D4 -_080592B2: - ldr r0, =sub_8059544 - b _08059316 - .pool -_080592D4: - ldr r0, =0x03005e00 - mov r2, r9 - lsls r1, r2, 2 - add r1, r9 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_805965C - b _08059318 - .pool -_080592EC: - str r0, [sp, 0x4] - add r2, sp, 0x4 - adds r0, r6, 0 - movs r1, 0x19 - bl pokemon_setattr - ldr r1, =0x03005d60 - ldr r3, [sp, 0x8] - lsls r0, r3, 2 - adds r0, r1 - ldr r1, =sub_80591A0 - str r1, [r0] - mov r0, r9 - bl DestroyTask - b _0805931A - .pool -_08059314: - ldr r0, =sub_8059330 -_08059316: - mov r1, r8 -_08059318: - str r0, [r1] -_0805931A: - 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_80591B8 - - thumb_func_start sub_8059330 -sub_8059330: @ 8059330 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r2, r0, 2 - mov r8, r2 - add r8, r0 - mov r0, r8 - lsls r0, 3 - mov r8, r0 - add r8, r1 - mov r2, r8 - ldrb r1, [r2, 0x8] - movs r0, 0xA - ldrsh r2, [r2, r0] - mov r9, r2 - mov r2, r8 - ldrb r2, [r2, 0xC] - mov r10, r2 - movs r0, 0x64 - adds r6, r1, 0 - muls r6, r0 - ldr r0, =0x020244ec - adds r6, r0 - adds r0, r6, 0 - movs r1, 0x38 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - movs r1, 0xB - bl pokemon_getattr - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r6, 0 - movs r1, 0x19 - bl pokemon_getattr - adds r3, r0, 0 - ldr r6, =gExperienceTables - lsls r1, r4, 2 - ldr r2, =gBaseStats - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r2 - ldrb r2, [r0, 0x13] - movs r0, 0xCA - lsls r0, 1 - muls r0, r2 - adds r1, r0 - adds r1, r6 - ldr r1, [r1] - subs r3, r1 - adds r4, 0x1 - lsls r4, 2 - adds r4, r0 - adds r4, r6 - ldr r2, [r4] - subs r2, r1 - ldr r0, =0x03005d70 - add r0, r10 - ldrb r1, [r0] - mov r0, r9 - negs r0, r0 - str r0, [sp] - mov r0, r10 - bl sub_807294C - movs r0, 0x21 - bl audio_play - ldr r0, =sub_8059400 - mov r1, r8 - str r0, [r1] - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059330 - - thumb_func_start sub_8059400 -sub_8059400: @ 8059400 - 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 - ldr r1, =0x03005e00 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r6, r0, r1 - ldrh r1, [r6, 0x1C] - movs r2, 0x1C - ldrsh r0, [r6, r2] - cmp r0, 0xC - bgt _08059430 - adds r0, r1, 0x1 - strh r0, [r6, 0x1C] - b _0805952C - .pool -_08059430: - ldrb r0, [r6, 0x8] - mov r9, r0 - ldrh r2, [r6, 0xA] - mov r10, r2 - ldrb r7, [r6, 0xC] - ldr r5, =0x03005d70 - adds r5, r7, r5 - ldrb r1, [r5] - adds r0, r7, 0 - movs r2, 0x1 - movs r3, 0 - bl sub_8074AA0 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r5] - bl sub_80729D0 - lsls r4, 16 - asrs r4, 16 - movs r0, 0x1 - negs r0, r0 - cmp r4, r0 - bne _0805952C - movs r0, 0x21 - bl m4aSongNumStop - movs r0, 0x64 - mov r1, r9 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x38 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x19 - bl pokemon_getattr - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - ldr r3, =gExperienceTables - adds r4, 0x1 - lsls r4, 2 - ldr r2, =gBaseStats - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1, 0x13] - movs r0, 0xCA - lsls r0, 1 - muls r0, r1 - adds r4, r0 - adds r4, r3 - ldr r1, [r4] - str r1, [sp] - mov r2, r10 - lsls r0, r2, 16 - asrs r4, r0, 16 - ldr r0, [sp, 0x4] - adds r0, r4 - cmp r0, r1 - blt _08059510 - adds r0, r5, 0 - movs r1, 0x19 - mov r2, sp - bl pokemon_setattr - adds r0, r5, 0 - bl pokemon_calc_effective_stats - ldr r2, [sp] - add r0, sp, 0x4 - ldrh r0, [r0] - subs r2, r0 - subs r2, r4, r2 - ldr r4, =0x02024064 - ldrb r5, [r4] - strb r7, [r4] - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x1 - movs r1, 0xB - bl dp01_build_cmdbuf_x21_a_bb - strb r5, [r4] - ldr r0, =sub_8059544 - str r0, [r6] - b _0805952C - .pool -_08059510: - str r0, [sp, 0x4] - add r2, sp, 0x4 - adds r0, r5, 0 - movs r1, 0x19 - bl pokemon_setattr - ldr r1, =0x03005d60 - lsls r0, r7, 2 - adds r0, r1 - ldr r1, =sub_80591A0 - str r1, [r0] - mov r0, r8 - bl DestroyTask -_0805952C: - 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_8059400 - - thumb_func_start sub_8059544 -sub_8059544: @ 8059544 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldrb r4, [r0, 0xC] - ldrb r6, [r0, 0x8] - bl battle_type_is_double - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08059578 - ldr r1, =0x0202406e - movs r0, 0x2 - adds r2, r4, 0 - eors r2, r0 - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r6, r0 - bne _08059578 - adds r4, r2, 0 -_08059578: - adds r0, r4, 0 - adds r1, r4, 0 - adds r2, r4, 0 - movs r3, 0 - bl move_anim_start_t4 - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80595A4 - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059544 - - thumb_func_start sub_80595A4 -sub_80595A4: @ 80595A4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r2, r0, r1 - ldrb r5, [r2, 0xC] - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08059646 - ldrb r4, [r2, 0x8] - movs r0, 0x64 - adds r1, r4, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0x38 - bl pokemon_getattr - bl battle_type_is_double - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08059624 - ldr r1, =0x0202406e - movs r0, 0x2 - adds r2, r5, 0 - eors r2, r0 - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r4, r0 - bne _08059624 - ldr r0, =0x03005d70 - adds r0, r2, r0 - ldrb r0, [r0] - adds r1, r7, 0 - movs r2, 0 - bl healthbar_draw_field_maybe - b _08059638 - .pool -_08059624: - ldr r0, =0x03005d70 - adds r0, r5, r0 - ldrb r0, [r0] - movs r1, 0x64 - muls r1, r4 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe -_08059638: - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_805965C - str r0, [r1] -_08059646: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80595A4 - - thumb_func_start sub_805965C -sub_805965C: @ 805965C - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =0x03005e00 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - ldrb r1, [r4, 0x8] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x38 - bl pokemon_getattr - ldrb r0, [r4, 0xC] - ldr r1, =0x03005d60 - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80591A0 - str r1, [r0] - adds r0, r5, 0 - bl DestroyTask - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805965C - - thumb_func_start sub_80596A8 -sub_80596A8: @ 80596A8 - push {r4-r6,lr} - ldr r6, =0x02020630 - ldr r5, =0x020241e4 - ldr r4, =0x02024064 - 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 _08059724 - ldr r1, =0x0202406e - lsls r0, r2, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - 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 rotscale_free_entry - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl RemoveObjectAndFreeTiles - ldr r1, =0x03005d70 - ldrb r0, [r4] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl dp01_tbl1_exec_completed -_08059724: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80596A8 - - thumb_func_start sub_8059744 -sub_8059744: @ 8059744 - push {r4-r6,lr} - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r6, =0x02024064 - 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 _08059798 - ldr r5, =0x020241e4 - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r1, =0x03005d70 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl dp01_tbl1_exec_completed -_08059798: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059744 - - thumb_func_start sub_80597B4 -sub_80597B4: @ 80597B4 - push {lr} - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _080597C6 - bl dp01_tbl1_exec_completed -_080597C6: - pop {r0} - bx r0 - thumb_func_end sub_80597B4 - - thumb_func_start sub_80597CC -sub_80597CC: @ 80597CC - push {r4,lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0805980A - ldr r1, =0x03005d60 - ldr r2, =0x02024064 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8059828 - str r1, [r0] - ldr r3, =0x03005e00 - ldr r1, =0x03005d7c - ldrb r0, [r2] - adds r0, r1 - ldrb r0, [r0] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r3 - ldrb r4, [r1, 0x8] - bl DestroyTask - bl FreeAllWindowBuffers - adds r0, r4, 0 - bl sub_81B89AC -_0805980A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80597CC - - thumb_func_start sub_8059828 -sub_8059828: @ 8059828 - push {lr} - ldr r0, =0x030022c0 - ldr r1, [r0, 0x4] - ldr r0, =sub_8038420 - cmp r1, r0 - bne _08059898 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08059898 - ldr r0, =0x0203cee8 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08059870 - ldr r0, =0x0203cee9 - ldrb r1, [r0] - ldr r2, =0x0203cf00 - movs r0, 0x1 - bl dp01_build_cmdbuf_x22_a_three_bytes - b _0805987A - .pool -_08059870: - movs r0, 0x1 - movs r1, 0x6 - movs r2, 0 - bl dp01_build_cmdbuf_x22_a_three_bytes -_0805987A: - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x1 - bne _08059894 - bl b_link_standby_message -_08059894: - bl dp01_tbl1_exec_completed -_08059898: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059828 - - thumb_func_start sub_80598A4 -sub_80598A4: @ 80598A4 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080598CC - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80598E0 - str r1, [r0] - bl nullsub_35 - bl FreeAllWindowBuffers - bl sub_81AABB0 -_080598CC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80598A4 - - thumb_func_start sub_80598E0 -sub_80598E0: @ 80598E0 - push {lr} - ldr r0, =0x030022c0 - ldr r1, [r0, 0x4] - ldr r0, =sub_8038420 - cmp r1, r0 - bne _08059906 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08059906 - ldr r0, =0x0203ce7c - ldrh r1, [r0] - movs r0, 0x1 - bl dp01_build_cmdbuf_x23_aa_0 - bl dp01_tbl1_exec_completed -_08059906: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80598E0 - - thumb_func_start bx_wait_t1 -bx_wait_t1: @ 805991C - push {lr} - ldr r0, =0x020244b9 - ldrb r0, [r0] - cmp r0, 0 - beq _08059942 - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08059946 -_08059942: - bl dp01_tbl1_exec_completed -_08059946: - pop {r0} - bx r0 - .pool - thumb_func_end bx_wait_t1 - - thumb_func_start bx_blink_t1 -bx_blink_t1: @ 8059958 - push {r4,lr} - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - ldr r2, =0x02020630 - 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 _080599A4 - 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, =0x020244b9 - strb r3, [r0] - bl dp01_tbl1_exec_completed - b _080599CE - .pool -_080599A4: - ldrh r0, [r4, 0x30] - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _080599C8 - 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] -_080599C8: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] -_080599CE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end bx_blink_t1 - - thumb_func_start sub_80599D4 -sub_80599D4: @ 80599D4 - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08059A02 - ldr r4, =0x03005d74 - ldrb r0, [r4] - cmp r0, 0 - beq _08059A02 - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - bl sub_8056BAC - movs r0, 0 - strb r0, [r4] - movs r0, 0 - bl sub_8056B74 -_08059A02: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08059A2C - ldr r4, =0x03005d74 - ldrb r0, [r4] - cmp r0, 0 - bne _08059A2C - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - bl sub_8056BAC - movs r0, 0x1 - strb r0, [r4] - movs r0, 0x1 - bl sub_8056B74 -_08059A2C: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r2, 0x1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _08059A7A - str r2, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - movs r0, 0x5 - bl audio_play - ldr r0, =0x03005d74 - ldrb r0, [r0] - cmp r0, 0 - beq _08059A6C - movs r0, 0x1 - movs r1, 0xE - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - b _08059A76 - .pool -_08059A6C: - movs r0, 0x1 - movs r1, 0xD - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb -_08059A76: - bl dp01_tbl1_exec_completed -_08059A7A: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08059AA0 - movs r0, 0x1 - str r0, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - movs r0, 0x5 - bl audio_play - bl dp01_tbl1_exec_completed -_08059AA0: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80599D4 - - thumb_func_start sub_8059AAC -sub_8059AAC: @ 8059AAC - push {r4-r7,lr} - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r1, 9 - ldr r3, =0x02023068 - ldr r2, =0x03005d78 - movs r0, 0 - strb r0, [r2] - movs r5, 0 - ldr r7, =0x02022e2c - adds r4, r1, r3 - adds r6, r2, 0 -_08059AC4: - lsls r0, r5, 24 - lsrs r0, 24 - bl battle_menu_cursor_related - ldrh r1, [r4] - movs r0, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - adds r0, r7, 0 - bl CopyString - adds r1, r5, 0x3 - lsls r1, 24 - lsrs r1, 24 - adds r0, r7, 0 - bl battle_show_message_maybe - ldrh r0, [r4] - cmp r0, 0 - beq _08059AF4 - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] -_08059AF4: - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _08059AC4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059AAC - - thumb_func_start sub_8059B18 -sub_8059B18: @ 8059B18 - push {r4,lr} - ldr r4, =0x02022e2c - ldr r1, =gUnknown_085CCA6F - adds r0, r4, 0 - bl CopyString - adds r0, r4, 0 - movs r1, 0x7 - bl battle_show_message_maybe - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059B18 - - thumb_func_start sub_8059B3C -sub_8059B3C: @ 8059B3C - push {r4-r7,lr} - ldr r5, =0x02023064 - ldr r7, =0x02024064 - ldrb r0, [r7] - lsls r0, 9 - adds r1, r5, 0x2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08059B98 - bl sub_814FBAC - ldrb r1, [r7] - lsls r4, r1, 9 - adds r0, r5, 0x4 - adds r4, r0 - ldr r6, =0x02022e2c - ldr r5, =0x020244b0 - adds r1, r5 - adds r0, r4, 0 - adds r0, 0x8 - ldrb r1, [r1] - adds r0, r1 - ldrb r1, [r0] - adds r0, r6, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - movs r1, 0xBA - strb r1, [r0] - adds r0, 0x1 - ldrb r1, [r7] - adds r1, r5 - adds r4, 0xC - ldrb r1, [r1] - adds r4, r1 - ldrb r1, [r4] - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - adds r0, r6, 0 - movs r1, 0x9 - bl battle_show_message_maybe -_08059B98: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059B3C - - thumb_func_start sub_8059BB0 -sub_8059BB0: @ 8059BB0 - push {r4-r6,lr} - ldr r5, =0x02024064 - ldrb r4, [r5] - lsls r4, 9 - ldr r0, =0x02023068 - adds r4, r0 - ldr r6, =0x02022e2c - ldr r1, =gUnknown_085CCA73 - adds r0, r6, 0 - bl CopyString - movs r1, 0xFC - strb r1, [r0] - adds r0, 0x1 - movs r1, 0x6 - strb r1, [r0] - adds r0, 0x1 - movs r1, 0x1 - strb r1, [r0] - adds r0, 0x1 - ldr r3, =gBattleMoves - ldr r2, =0x020244b0 - ldrb r1, [r5] - adds r1, r2 - ldrb r1, [r1] - lsls r1, 1 - adds r4, r1 - ldrh r2, [r4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - ldrb r2, [r1, 0x2] - lsls r1, r2, 3 - subs r1, r2 - ldr r2, =gTypeNames - adds r1, r2 - bl CopyString - adds r0, r6, 0 - movs r1, 0xA - bl battle_show_message_maybe - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059BB0 - - thumb_func_start battle_menu_cursor_related_2 -battle_menu_cursor_related_2: @ 8059C28 - push {lr} - sub sp, 0x10 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - lsls r1, 24 - lsrs r1, 24 - add r2, sp, 0xC - adds r0, r1, 0x1 - strh r0, [r2] - adds r0, r2, 0 - adds r1, 0x2 - strh r1, [r0, 0x2] - movs r1, 0x1 - adds r0, r3, 0 - ands r0, r1 - lsls r2, r0, 3 - adds r2, r0 - adds r2, 0x1 - movs r0, 0x2 - ands r3, r0 - adds r3, 0x37 - str r1, [sp] - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - add r1, sp, 0xC - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0x10 - pop {r0} - bx r0 - thumb_func_end battle_menu_cursor_related_2 - - thumb_func_start battle_menu_cursor_related -battle_menu_cursor_related: @ 8059C70 - push {lr} - sub sp, 0x10 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - add r0, sp, 0xC - ldr r1, =0x00001016 - strh r1, [r0] - strh r1, [r0, 0x2] - movs r1, 0x1 - adds r0, r3, 0 - ands r0, r1 - lsls r2, r0, 3 - adds r2, r0 - adds r2, 0x1 - movs r0, 0x2 - ands r3, r0 - adds r3, 0x37 - str r1, [sp] - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - add r1, sp, 0xC - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end battle_menu_cursor_related - - thumb_func_start sub_8059CB4 -sub_8059CB4: @ 8059CB4 - push {r4,lr} - sub sp, 0x10 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - add r0, sp, 0xC - movs r4, 0x1 - strh r4, [r0] - movs r1, 0x2 - strh r1, [r0, 0x2] - adds r0, r3, 0 - ands r0, r4 - lsls r2, r0, 3 - subs r2, r0 - adds r2, 0x10 - lsls r2, 24 - lsrs r2, 24 - ands r3, r1 - adds r3, 0x23 - str r4, [sp] - str r1, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - add r1, sp, 0xC - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8059CB4 - - thumb_func_start sub_8059CF8 -sub_8059CF8: @ 8059CF8 - push {lr} - sub sp, 0x10 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - add r0, sp, 0xC - ldr r1, =0x00001016 - strh r1, [r0] - strh r1, [r0, 0x2] - movs r1, 0x1 - adds r0, r3, 0 - ands r0, r1 - lsls r2, r0, 3 - subs r2, r0 - adds r2, 0x10 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x2 - ands r3, r0 - adds r3, 0x23 - str r1, [sp] - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - add r1, sp, 0xC - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059CF8 - - thumb_func_start sub_8059D40 -sub_8059D40: @ 8059D40 - push {lr} - ldr r0, =sub_80A92F8 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059D40 - - thumb_func_start sub_8059D50 -sub_8059D50: @ 8059D50 - push {lr} - ldr r0, =sub_80A92F8 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059D50 - - thumb_func_start sub_8059D60 -sub_8059D60: @ 8059D60 - push {lr} - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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 _08059D82 - bl dp01_tbl1_exec_completed -_08059D82: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8059D60 - - thumb_func_start bx_8030B2C -bx_8030B2C: @ 8059D90 - push {lr} - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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 _08059DB2 - bl dp01_tbl1_exec_completed -_08059DB2: - pop {r0} - bx r0 - .pool - thumb_func_end bx_8030B2C - - thumb_func_start b_link_standby_message -b_link_standby_message: @ 8059DC0 - push {lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08059DE0 - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r0, =gUnknown_085CCA29 - movs r1, 0 - bl battle_show_message_maybe -_08059DE0: - pop {r0} - bx r0 - .pool - thumb_func_end b_link_standby_message - - thumb_func_start dp01t_00_1_getattr -dp01t_00_1_getattr: @ 8059DF4 - push {r4-r6,lr} - sub sp, 0x100 - movs r6, 0 - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _08059E2C - ldr r0, =0x0202406e - lsls r1, r2, 1 - adds r1, r0 - ldrb r0, [r1] - mov r1, sp - bl dp01_getattr_by_ch1_for_player_pokemon_ - adds r6, r0, 0 - b _08059E4E - .pool -_08059E2C: - ldrb r4, [r1] - movs r5, 0 -_08059E30: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _08059E46 - lsls r0, r5, 24 - lsrs r0, 24 - mov r2, sp - adds r1, r2, r6 - bl dp01_getattr_by_ch1_for_player_pokemon_ - adds r6, r0 -_08059E46: - lsrs r4, 1 - adds r5, 0x1 - cmp r5, 0x5 - ble _08059E30 -_08059E4E: - lsls r1, r6, 16 - lsrs r1, 16 - movs r0, 0x1 - mov r2, sp - bl dp01_build_cmdbuf_x1D_1D_numargs_varargs - bl dp01_tbl1_exec_completed - add sp, 0x100 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end dp01t_00_1_getattr - - thumb_func_start dp01_getattr_by_ch1_for_player_pokemon_ -dp01_getattr_by_ch1_for_player_pokemon_: @ 8059E68 - 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, =0x02023064 - ldr r3, =0x02024064 - ldrb r0, [r3] - lsls r0, 9 - adds r1, r2, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3B - bls _08059E92 - bl _0805A5FE -_08059E92: - lsls r0, 2 - ldr r1, =_08059EA8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08059EA8: - .4byte _08059F98 - .4byte _0805A1BC - .4byte _0805A1CC - .4byte _0805A1DC - .4byte _0805A244 - .4byte _0805A244 - .4byte _0805A244 - .4byte _0805A244 - .4byte _0805A260 - .4byte _0805A29C - .4byte _0805A29C - .4byte _0805A29C - .4byte _0805A29C - .4byte _0805A5FE - .4byte _0805A5FE - .4byte _0805A5FE - .4byte _0805A5FE - .4byte _0805A2B8 - .4byte _0805A2C8 - .4byte _0805A2F8 - .4byte _0805A308 - .4byte _0805A318 - .4byte _0805A328 - .4byte _0805A338 - .4byte _0805A348 - .4byte _0805A358 - .4byte _0805A368 - .4byte _0805A378 - .4byte _0805A388 - .4byte _0805A398 - .4byte _0805A3A8 - .4byte _0805A3B8 - .4byte _0805A408 - .4byte _0805A418 - .4byte _0805A428 - .4byte _0805A438 - .4byte _0805A448 - .4byte _0805A458 - .4byte _0805A468 - .4byte _0805A478 - .4byte _0805A488 - .4byte _0805A4BC - .4byte _0805A4CC - .4byte _0805A4DC - .4byte _0805A4EC - .4byte _0805A4FC - .4byte _0805A50C - .4byte _0805A51C - .4byte _0805A52C - .4byte _0805A54C - .4byte _0805A55C - .4byte _0805A56C - .4byte _0805A57C - .4byte _0805A58C - .4byte _0805A59C - .4byte _0805A5AC - .4byte _0805A5BC - .4byte _0805A5CC - .4byte _0805A5DC - .4byte _0805A5EC -_08059F98: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - mov r1, sp - strh r0, [r1] - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr - 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 -_08059FE4: - adds r1, r6, 0 - adds r1, 0xD - mov r0, r8 - bl pokemon_getattr - strh r0, [r4] - adds r1, r6, 0 - adds r1, 0x11 - mov r0, r8 - bl pokemon_getattr - mov r2, r9 - adds r1, r2, r6 - strb r0, [r1] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _08059FE4 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - bl pokemon_getattr - mov r1, r10 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x20 - bl pokemon_getattr - ldr r2, [sp, 0x80] - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x19 - bl pokemon_getattr - str r0, [sp, 0x44] - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - str r0, [sp, 0x48] - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - str r0, [sp, 0x4C] - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - ldr r1, [sp, 0x7C] - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x28] - adds r0, r4, 0 - movs r1, 0x3A - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2C] - adds r0, r4, 0 - movs r1, 0x3B - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2] - adds r0, r4, 0 - movs r1, 0x3C - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x4] - adds r0, r4, 0 - movs r1, 0x3D - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x6] - adds r0, r4, 0 - movs r1, 0x3E - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x8] - adds r0, r4, 0 - movs r1, 0x3F - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0xA] - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - str r0, [sp, 0x54] - adds r0, r4, 0 - movs r1, 0x2 - ldr r2, [sp, 0x8C] - bl pokemon_getattr - ldr r0, [sp, 0x84] - ldr r1, [sp, 0x8C] - bl CopyString_Limit10 - adds r0, r4, 0 - movs r1, 0x7 - ldr r2, [sp, 0x88] - bl pokemon_getattr - mov r2, sp - movs r6, 0 -_0805A19C: - adds r0, r7, r6 - adds r1, r2, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0x57 - bls _0805A19C - b _0805A5FE - .pool -_0805A1BC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - b _0805A536 - .pool -_0805A1CC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xC - b _0805A536 - .pool -_0805A1DC: - 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, =0x020244ec - adds r4, r1, r0 - mov r8, r9 -_0805A1F2: - adds r1, r6, 0 - adds r1, 0xD - adds r0, r4, 0 - bl pokemon_getattr - mov r1, r8 - strh r0, [r1] - adds r1, r6, 0 - adds r1, 0x11 - adds r0, r4, 0 - bl pokemon_getattr - mov r2, r10 - adds r1, r2, r6 - strb r0, [r1] - movs r0, 0x2 - add r8, r0 - adds r6, 0x1 - cmp r6, 0x3 - ble _0805A1F2 - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - mov r1, r9 - strb r0, [r1, 0xC] - mov r2, r9 - movs r6, 0 -_0805A230: - adds r0, r7, r6 - adds r1, r2, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0xF - bls _0805A230 - b _0805A5FE - .pool -_0805A244: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldrb r1, [r3] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - adds r1, 0x9 - b _0805A536 - .pool -_0805A260: - movs r6, 0 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r2, =0x020244ec - mov r8, r2 -_0805A26C: - adds r1, r6, 0 - adds r1, 0x11 - mov r2, r8 - adds r0, r4, r2 - bl pokemon_getattr - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - cmp r6, 0x3 - ble _0805A26C - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - b _0805A5FE - .pool -_0805A29C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldrb r1, [r3] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - adds r1, 0x8 - b _0805A5F6 - .pool -_0805A2B8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1 - b _0805A2D2 - .pool -_0805A2C8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x19 -_0805A2D2: - bl pokemon_getattr - 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 _0805A5FE - .pool -_0805A2F8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1A - b _0805A5F6 - .pool -_0805A308: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1B - b _0805A5F6 - .pool -_0805A318: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1C - b _0805A5F6 - .pool -_0805A328: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1D - b _0805A5F6 - .pool -_0805A338: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1E - b _0805A5F6 - .pool -_0805A348: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1F - b _0805A5F6 - .pool -_0805A358: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x20 - b _0805A5F6 - .pool -_0805A368: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x22 - b _0805A5F6 - .pool -_0805A378: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x23 - b _0805A5F6 - .pool -_0805A388: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x24 - b _0805A5F6 - .pool -_0805A398: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x25 - b _0805A5F6 - .pool -_0805A3A8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x26 - b _0805A5F6 - .pool -_0805A3B8: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_getattr - strb r0, [r7] - adds r0, r4, 0 - movs r1, 0x28 - bl pokemon_getattr - strb r0, [r7, 0x1] - adds r0, r4, 0 - movs r1, 0x29 - bl pokemon_getattr - strb r0, [r7, 0x2] - adds r0, r4, 0 - movs r1, 0x2A - bl pokemon_getattr - strb r0, [r7, 0x3] - adds r0, r4, 0 - movs r1, 0x2B - bl pokemon_getattr - strb r0, [r7, 0x4] - adds r0, r4, 0 - movs r1, 0x2C - bl pokemon_getattr - strb r0, [r7, 0x5] - movs r6, 0x6 - b _0805A5FE - .pool -_0805A408: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x27 - b _0805A5F6 - .pool -_0805A418: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x28 - b _0805A5F6 - .pool -_0805A428: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x29 - b _0805A5F6 - .pool -_0805A438: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2A - b _0805A5F6 - .pool -_0805A448: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2B - b _0805A5F6 - .pool -_0805A458: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2C - b _0805A5F6 - .pool -_0805A468: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0 - b _0805A492 - .pool -_0805A478: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x9 - b _0805A536 - .pool -_0805A488: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x37 -_0805A492: - bl pokemon_getattr - 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 _0805A5FE - .pool -_0805A4BC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x38 - b _0805A5F6 - .pool -_0805A4CC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x39 - b _0805A536 - .pool -_0805A4DC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3A - b _0805A536 - .pool -_0805A4EC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3B - b _0805A536 - .pool -_0805A4FC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3C - b _0805A536 - .pool -_0805A50C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3D - b _0805A536 - .pool -_0805A51C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3E - b _0805A536 - .pool -_0805A52C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3F -_0805A536: - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - strb r0, [r7] - lsrs r0, 8 - strb r0, [r7, 0x1] - movs r6, 0x2 - b _0805A5FE - .pool -_0805A54C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x16 - b _0805A5F6 - .pool -_0805A55C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x17 - b _0805A5F6 - .pool -_0805A56C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x18 - b _0805A5F6 - .pool -_0805A57C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x21 - b _0805A5F6 - .pool -_0805A58C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2F - b _0805A5F6 - .pool -_0805A59C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x30 - b _0805A5F6 - .pool -_0805A5AC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x32 - b _0805A5F6 - .pool -_0805A5BC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x33 - b _0805A5F6 - .pool -_0805A5CC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x34 - b _0805A5F6 - .pool -_0805A5DC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x35 - b _0805A5F6 - .pool -_0805A5EC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x36 -_0805A5F6: - bl pokemon_getattr - strb r0, [r7] - movs r6, 0x1 -_0805A5FE: - 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 dp01_getattr_by_ch1_for_player_pokemon_ - - thumb_func_start sub_805A614 -sub_805A614: @ 805A614 - push {r4-r7,lr} - sub sp, 0x58 - ldr r2, =0x0202406e - ldr r5, =0x02024064 - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - adds r4, r2, 0 - muls r4, r0 - ldr r3, =0x02023064 - lsls r1, 9 - adds r0, r3, 0x1 - adds r0, r1, r0 - ldrb r2, [r0] - ldr r0, =0x020244ec - adds r0, r2, r0 - adds r6, r4, r0 - mov r0, sp - adds r4, r0, r2 - movs r2, 0 - adds r0, r3, 0x2 - adds r1, r0 - adds r7, r5, 0 - mov r12, r3 - ldrb r1, [r1] - cmp r2, r1 - bcs _0805A66A - adds r3, r0, 0 -_0805A650: - adds r1, r4, r2 - adds r0, r6, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - ldrb r0, [r5] - lsls r0, 9 - adds r0, r3 - ldrb r0, [r0] - cmp r2, r0 - bcc _0805A650 -_0805A66A: - ldrb r0, [r7] - lsls r0, 9 - mov r1, r12 - adds r1, 0x2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - adds r2, r4, 0 - bl dp01_build_cmdbuf_x1D_1D_numargs_varargs - bl dp01_tbl1_exec_completed - add sp, 0x58 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805A614 - - thumb_func_start dp01t_02_1_setattr -dp01t_02_1_setattr: @ 805A69C - push {r4,r5,lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _0805A6CC - ldr r0, =0x0202406e - lsls r1, r2, 1 - adds r1, r0 - ldrb r0, [r1] - bl dp01_setattr_by_ch1_for_player_pokemon - b _0805A6EA - .pool -_0805A6CC: - ldrb r4, [r1] - movs r5, 0 -_0805A6D0: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0805A6DE - adds r0, r5, 0 - bl dp01_setattr_by_ch1_for_player_pokemon -_0805A6DE: - lsrs r4, 1 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _0805A6D0 -_0805A6EA: - bl dp01_tbl1_exec_completed - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end dp01t_02_1_setattr - - thumb_func_start dp01_setattr_by_ch1_for_player_pokemon -dp01_setattr_by_ch1_for_player_pokemon: @ 805A6F4 - 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, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - ldr r2, =0x02023067 - 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 _0805A720 - bl _0805B0BA -_0805A720: - lsls r0, 2 - ldr r1, =_0805A738 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0805A738: - .4byte _0805A828 - .4byte _0805A9C0 - .4byte _0805A9E0 - .4byte _0805AA00 - .4byte _0805AA58 - .4byte _0805AA58 - .4byte _0805AA58 - .4byte _0805AA58 - .4byte _0805AA80 - .4byte _0805AAE4 - .4byte _0805AAE4 - .4byte _0805AAE4 - .4byte _0805AAE4 - .4byte _0805B0BA - .4byte _0805B0BA - .4byte _0805B0BA - .4byte _0805B0BA - .4byte _0805AB14 - .4byte _0805AB34 - .4byte _0805AB54 - .4byte _0805AB74 - .4byte _0805AB94 - .4byte _0805ABB4 - .4byte _0805ABD4 - .4byte _0805ABF4 - .4byte _0805AC14 - .4byte _0805AC34 - .4byte _0805AC54 - .4byte _0805AC74 - .4byte _0805AC94 - .4byte _0805ACB4 - .4byte _0805ACD4 - .4byte _0805AD44 - .4byte _0805AD64 - .4byte _0805AD84 - .4byte _0805ADA4 - .4byte _0805ADC4 - .4byte _0805ADE4 - .4byte _0805AE04 - .4byte _0805AE24 - .4byte _0805AE44 - .4byte _0805AE64 - .4byte _0805AE84 - .4byte _0805AEA4 - .4byte _0805AEC4 - .4byte _0805AEE4 - .4byte _0805AF04 - .4byte _0805AF24 - .4byte _0805AF44 - .4byte _0805AF64 - .4byte _0805AF84 - .4byte _0805AFA4 - .4byte _0805AFC4 - .4byte _0805AFE4 - .4byte _0805B004 - .4byte _0805B024 - .4byte _0805B044 - .4byte _0805B064 - .4byte _0805B084 - .4byte _0805B0A4 -_0805A828: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - adds r2, r6, 0 - bl pokemon_setattr - adds r2, r6, 0 - adds r2, 0x2E - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_setattr - 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 -_0805A88E: - mov r1, r8 - adds r1, 0xD - mov r0, r9 - adds r2, r4, 0 - bl pokemon_setattr - mov r1, r8 - adds r1, 0x11 - mov r0, r9 - adds r2, r7, 0 - bl pokemon_setattr - adds r7, 0x1 - adds r4, 0x2 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x3 - ble _0805A88E - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - mov r2, r10 - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x20 - ldr r2, [sp, 0x20] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x19 - ldr r2, [sp, 0x28] - bl pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - adds r0, r4, 0 - movs r1, 0 - ldr r2, [sp, 0x2C] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x37 - ldr r2, [sp, 0x30] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x38 - ldr r2, [sp, 0x1C] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x39 - ldr r2, [sp, 0x18] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3A - ldr r2, [sp, 0x24] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3B - ldr r2, [sp, 0x4] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3C - ldr r2, [sp, 0x8] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3D - ldr r2, [sp, 0xC] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3E - ldr r2, [sp, 0x10] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3F - ldr r2, [sp, 0x14] - bl pokemon_setattr - b _0805B0BA - .pool -_0805A9C0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0xB - bl pokemon_setattr - b _0805B0BA - .pool -_0805A9E0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0xC - bl pokemon_setattr - b _0805B0BA - .pool -_0805AA00: - 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, =0x020244ec - adds r7, r1, r0 - adds r6, r3, 0 - adds r6, 0x8 - adds r4, r3, 0 -_0805AA1A: - mov r1, r8 - adds r1, 0xD - adds r0, r7, 0 - adds r2, r4, 0 - bl pokemon_setattr - mov r1, r8 - adds r1, 0x11 - adds r0, r7, 0 - adds r2, r6, 0 - bl pokemon_setattr - adds r6, 0x1 - adds r4, 0x2 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x3 - ble _0805AA1A - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x15 - mov r2, r9 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AA58: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r3, =0x02023064 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r1, r3, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r1, 0x9 - b _0805AAFC - .pool -_0805AA80: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - ldr r5, =0x02024064 - ldrb r2, [r5] - lsls r2, 9 - adds r2, r7 - adds r0, r4, 0 - movs r1, 0x11 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x1 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x12 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x2 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x13 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x3 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x14 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x4 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x15 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AAE4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r3, =0x02023064 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r1, r3, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r1, 0x8 -_0805AAFC: - adds r3, 0x3 - adds r2, r3 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AB14: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AB34: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x19 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AB54: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1A - bl pokemon_setattr - b _0805B0BA - .pool -_0805AB74: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1B - bl pokemon_setattr - b _0805B0BA - .pool -_0805AB94: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1C - bl pokemon_setattr - b _0805B0BA - .pool -_0805ABB4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1D - bl pokemon_setattr - b _0805B0BA - .pool -_0805ABD4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1E - bl pokemon_setattr - b _0805B0BA - .pool -_0805ABF4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1F - bl pokemon_setattr - b _0805B0BA - .pool -_0805AC14: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x20 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AC34: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x22 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AC54: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x23 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AC74: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x24 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AC94: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x25 - bl pokemon_setattr - b _0805B0BA - .pool -_0805ACB4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x26 - bl pokemon_setattr - b _0805B0BA - .pool -_0805ACD4: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - ldr r5, =0x02024064 - ldrb r2, [r5] - lsls r2, 9 - adds r2, r7 - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x1 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x28 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x2 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x29 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x3 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2A - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x4 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2B - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x5 - adds r2, r0 - adds r0, r4, 0 - b _0805ADF4 - .pool -_0805AD44: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x27 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AD64: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x28 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AD84: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x29 - bl pokemon_setattr - b _0805B0BA - .pool -_0805ADA4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x2A - bl pokemon_setattr - b _0805B0BA - .pool -_0805ADC4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x2B - bl pokemon_setattr - b _0805B0BA - .pool -_0805ADE4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 -_0805ADF4: - movs r1, 0x2C - bl pokemon_setattr - b _0805B0BA - .pool -_0805AE04: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AE24: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x9 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AE44: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x37 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AE64: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x38 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AE84: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x39 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AEA4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3A - bl pokemon_setattr - b _0805B0BA - .pool -_0805AEC4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3B - bl pokemon_setattr - b _0805B0BA - .pool -_0805AEE4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3C - bl pokemon_setattr - b _0805B0BA - .pool -_0805AF04: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3D - bl pokemon_setattr - b _0805B0BA - .pool -_0805AF24: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3E - bl pokemon_setattr - b _0805B0BA - .pool -_0805AF44: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3F - bl pokemon_setattr - b _0805B0BA - .pool -_0805AF64: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x16 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AF84: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x17 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AFA4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x18 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AFC4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x21 - bl pokemon_setattr - b _0805B0BA - .pool -_0805AFE4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x2F - bl pokemon_setattr - b _0805B0BA - .pool -_0805B004: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x30 - bl pokemon_setattr - b _0805B0BA - .pool -_0805B024: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x32 - bl pokemon_setattr - b _0805B0BA - .pool -_0805B044: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x33 - bl pokemon_setattr - b _0805B0BA - .pool -_0805B064: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x34 - bl pokemon_setattr - b _0805B0BA - .pool -_0805B084: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x35 - bl pokemon_setattr - b _0805B0BA - .pool -_0805B0A4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x36 - bl pokemon_setattr -_0805B0BA: - ldr r2, =0x0202406e - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - 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 dp01_setattr_by_ch1_for_player_pokemon - - thumb_func_start sub_805B0F0 -sub_805B0F0: @ 805B0F0 - push {r4-r7,lr} - ldr r1, =0x0202406e - ldr r7, =0x02024064 - 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, =0x02023064 - lsls r2, 9 - adds r0, r4, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - ldr r1, =0x020244ec - adds r0, r1 - adds r5, r3, r0 - movs r3, 0 - adds r0, r4, 0x2 - adds r2, r0 - ldrb r2, [r2] - cmp r3, r2 - bcs _0805B148 - adds r6, r4, 0 - adds r2, r7, 0 - adds r4, r0, 0 -_0805B126: - 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 _0805B126 -_0805B148: - bl dp01_tbl1_exec_completed - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805B0F0 - - thumb_func_start sub_805B164 -sub_805B164: @ 805B164 - push {r4,lr} - ldr r2, =0x0202406e - ldr r4, =0x02024064 - ldrb r1, [r4] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - adds r0, r2 - bl sub_805DD7C - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - ldrb r3, [r4] - adds r0, r3, r0 - ldrb r0, [r0] - 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] - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_0802E404 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805B164 - - thumb_func_start sub_805B1CC -sub_805B1CC: @ 805B1CC - push {r4-r6,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - ldr r4, =0x02023064 - lsls r1, r0, 9 - adds r6, r4, 0x2 - adds r1, r6 - ldrb r1, [r1] - bl sub_805EF84 - ldr r2, =0x0202406e - ldrb r0, [r5] - lsls r1, r0, 1 - adds r1, r2 - lsls r0, 9 - adds r4, 0x1 - adds r0, r4 - ldrb r0, [r0] - movs r4, 0 - strh r0, [r1] - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - adds r0, r2 - bl sub_805DD7C - ldr r1, =0x020244ac - ldrb r0, [r5] - adds r0, r1 - strb r4, [r0] - ldr r1, =0x020244b0 - ldrb r0, [r5] - adds r0, r1 - strb r4, [r0] - ldrb r0, [r5] - lsls r1, r0, 9 - adds r1, r6 - ldrb r1, [r1] - bl sub_805B258 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805902C - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805B1CC - - thumb_func_start sub_805B258 -sub_805B258: @ 805B258 - 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, =0x0202406e - lsls r2, r6, 1 - adds r2, r0 - ldr r0, =0x02023064 - 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, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - mov r8, r0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r0, =sub_805D714 - bl object_new_hidden_with_callback - ldr r1, =0x03005d7c - mov r9, r1 - add r9, r6 - mov r1, r9 - strb r0, [r1] - adds r0, r6, 0 - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl sub_806A068 - ldr r0, =0x0202499c - 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 AddObjectToFront - ldr r4, =0x020241e4 - adds r4, r6, r4 - strb r0, [r4] - ldr r5, =0x02020630 - 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, =0x020244e4 - adds r6, r1 - ldrb r1, [r6] - bl StartObjectImageAnim - 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, =DummyObjectCallback - 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_805B258 - - thumb_func_start sub_805B3D4 -sub_805B3D4: @ 805B3D4 - push {r4-r6,lr} - ldr r1, =0x02023064 - ldr r6, =0x02024064 - ldrb r2, [r6] - lsls r0, r2, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r3, [r0] - cmp r3, 0 - bne _0805B41C - ldr r0, =0x020244d0 - 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, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805B464 - str r1, [r0] - b _0805B452 - .pool -_0805B41C: - ldr r5, =0x020241e4 - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r1, =0x03005d70 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl dp01_tbl1_exec_completed -_0805B452: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805B3D4 - - thumb_func_start sub_805B464 -sub_805B464: @ 805B464 - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r4, [r6] - ldr r5, =0x02024064 - 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 _0805B48C - cmp r0, 0x1 - beq _0805B4BA - b _0805B4E2 - .pool -_0805B48C: - ldr r1, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0805B4A6 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_0805B4A6: - 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 _0805B4E2 -_0805B4BA: - ldrb r1, [r3] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0805B4E2 - 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, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8059744 - str r1, [r0] -_0805B4E2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805B464 - - thumb_func_start sub_805B4F0 -sub_805B4F0: @ 805B4F0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0805B5B4 - bl link_get_multiplayer_id - ldr r5, =0x020229e8 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - movs r4, 0xFF - ldrb r0, [r1] - cmp r0, 0x4 - beq _0805B538 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrh r1, [r1] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x5 - bne _0805B558 -_0805B538: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x13] - adds r4, r0, 0x2 - b _0805B5BA - .pool -_0805B558: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrh r1, [r1] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x2 - beq _0805B58A - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrh r0, [r1] - ands r4, r0 - cmp r4, 0x1 - bne _0805B5A0 -_0805B58A: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x13] - adds r4, r0, 0x4 - b _0805B5BA -_0805B5A0: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r4, [r1, 0x13] - b _0805B5BA -_0805B5B4: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r4, [r0, 0x8] -_0805B5BA: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r2, 0x40 - ands r1, r2 - adds r5, r0, 0 - cmp r1, 0 - beq _0805B63C - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_get_per_side_status - movs r1, 0x2 - ands r1, r0 - movs r0, 0x20 - mov r9, r0 - cmp r1, 0 - beq _0805B5E0 - movs r1, 0x5A - mov r9, r1 -_0805B5E0: - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _0805B618 - ldr r0, =0x02038bce - ldrh r1, [r0] - ldr r0, =0x00000c03 - cmp r1, r0 - beq _0805B618 - movs r0, 0x5A - mov r9, r0 - ldr r1, =gUnknown_083054E0 - b _0805B642 - .pool -_0805B618: - ldr r1, =gUnknown_08305D2C - 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 r5, =0x02022fec - b _0805B656 - .pool -_0805B63C: - movs r0, 0x50 - mov r9, r0 - ldr r1, =gUnknown_08305D2C -_0805B642: - 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 -_0805B656: - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - bne _0805B664 - b _0805B794 -_0805B664: - ldr r0, =0x02038bce - ldrh r1, [r0] - ldr r0, =0x00000c03 - cmp r1, r0 - bne _0805B670 - b _0805B794 -_0805B670: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - bl sub_806F000 - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - ldr r6, =0x02024064 - ldrb r1, [r6] - adds r0, r5, 0 - bl sub_805DF38 - ldrb r0, [r6] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl sub_806A1C0 - ldr r0, =0x0202499c - 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 AddObjectToFront - ldr r4, =0x020241e4 - ldrb r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r0, =gTrainerFrontPicPaletteTable - lsls r5, 3 - adds r5, r0 - ldrh r0, [r5, 0x4] - bl IndexOfObjectPaletteTag - ldr r5, =0x02020630 - 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 _0805B82A - .pool -_0805B794: - ldr r5, =0x02024064 - ldrb r1, [r5] - adds r0, r4, 0 - bl sub_805DF84 - ldrb r0, [r5] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl template_build_for_pokemon_or_trainer - ldr r6, =0x0202499c - 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 AddObjectToFront - ldr r6, =0x020241e4 - ldrb r1, [r5] - adds r1, r6 - strb r0, [r1] - ldr r4, =0x02020630 - 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] -_0805B82A: - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8058844 - str r1, [r0] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805B4F0 - - thumb_func_start dp01t_08_1_8032428 -dp01t_08_1_8032428: @ 805B864 - push {r4-r6,lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0805B920 - bl link_get_multiplayer_id - ldr r5, =0x020229e8 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - movs r4, 0xFF - ldrb r0, [r1] - cmp r0, 0x4 - beq _0805B8A6 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrh r1, [r1] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x5 - bne _0805B8C4 -_0805B8A6: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x13] - adds r4, r0, 0x2 - b _0805B926 - .pool -_0805B8C4: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrh r1, [r1] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x2 - beq _0805B8F6 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrh r0, [r1] - ands r4, r0 - cmp r4, 0x1 - bne _0805B90C -_0805B8F6: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x13] - adds r4, r0, 0x4 - b _0805B926 -_0805B90C: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r4, [r1, 0x13] - b _0805B926 -_0805B920: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r4, [r0, 0x8] -_0805B926: - ldr r5, =0x02024064 - ldrb r1, [r5] - adds r0, r4, 0 - bl sub_805DF84 - ldrb r0, [r5] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl template_build_for_pokemon_or_trainer - ldr r0, =0x0202499c - ldr r1, =gUnknown_08305D2C - lsls r4, 2 - adds r4, r1 - ldrb r1, [r4] - movs r2, 0x8 - subs r2, r1 - lsls r2, 18 - movs r1, 0xA0 - lsls r1, 15 - adds r2, r1 - asrs r2, 16 - movs r1, 0x50 - movs r3, 0x1E - bl AddObjectToFront - ldr r6, =0x020241e4 - ldrb r1, [r5] - adds r1, r6 - strb r0, [r1] - ldr r4, =0x02020630 - 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 - ldr r1, =0x0000ffa0 - 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] - 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, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805887C - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_08_1_8032428 - - thumb_func_start sub_805B9F8 -sub_805B9F8: @ 805B9F8 - push {r4-r6,lr} - ldr r5, =0x020241e4 - ldr r6, =0x02024064 - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - 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 r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =DummyObjectCallback - 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 StartObjectImageAnim - ldr r1, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_802F7A0 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805B9F8 - - thumb_func_start sub_805BAB8 -sub_805BAB8: @ 805BAB8 - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r4, [r6] - ldr r5, =0x02024064 - 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 _0805BB0C - ldr r1, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0805BAEC - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_0805BAEC: - 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 _0805BB82 - .pool -_0805BB0C: - ldrb r1, [r3] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0805BB82 - strb r4, [r3, 0x4] - ldr r2, =0x0202406e - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - adds r0, r2 - bl sub_805E990 - movs r1, 0x40 - negs r1, r1 - movs r0, 0x10 - bl audio_play_and_stuff - ldr r2, =0x02020630 - ldr r3, =0x020241e4 - 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, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80596A8 - str r1, [r0] -_0805BB82: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805BAB8 - - thumb_func_start sub_805BBA4 -sub_805BBA4: @ 805BBA4 - push {lr} - sub sp, 0x4 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r1, 0x2 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - bl dp01_tbl1_exec_completed - add sp, 0x4 - pop {r0} - bx r0 - thumb_func_end sub_805BBA4 - - thumb_func_start sub_805BBC4 -sub_805BBC4: @ 805BBC4 - push {r4,r5,lr} - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0x8] - movs r0, 0x4 - strb r0, [r1, 0x8] - ldr r1, =0x020244b9 - movs r0, 0x1 - strb r0, [r1] - ldr r5, =0x02024064 - ldrb r4, [r5] - movs r0, 0x1 - bl battle_get_side_with_given_state - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r4, 0 - movs r3, 0x3 - bl move_anim_start_t4 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_wait_t1 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805BBC4 - - thumb_func_start sub_805BC18 -sub_805BC18: @ 805BC18 - push {r4,r5,lr} - ldr r1, =0x02023064 - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r1, [r0] - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - strb r1, [r0, 0x8] - ldr r1, =0x020244b9 - movs r0, 0x1 - strb r0, [r1] - ldrb r4, [r5] - movs r0, 0x1 - bl battle_get_side_with_given_state - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r4, 0 - movs r3, 0x3 - bl move_anim_start_t4 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_wait_t1 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805BC18 - - thumb_func_start sub_805BC78 -sub_805BC78: @ 805BC78 - push {lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _0805BC96 -_0805BC8C: - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0805BC8C -_0805BC96: - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_805BC78 - - thumb_func_start dp01t_0F_1_move_anim -dp01t_0F_1_move_anim: @ 805BCA8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r5, =0x02024064 - ldrb r0, [r5] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - beq _0805BCBE - b _0805BDE4 -_0805BCBE: - ldr r0, =0x02023064 - mov r12, r0 - ldrb r1, [r5] - lsls r1, 9 - adds r0, 0x1 - adds r0, r1, r0 - ldrb r6, [r0] - mov r0, r12 - adds r0, 0x2 - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 8 - orrs r6, r0 - ldr r0, =0x02038432 - mov r8, r0 - mov r0, r12 - adds r0, 0x3 - adds r1, r0 - ldrb r0, [r1] - mov r1, r8 - strb r0, [r1] - ldr r3, =0x02038408 - ldrb r1, [r5] - lsls r1, 9 - mov r0, r12 - adds r0, 0x4 - adds r0, r1, r0 - ldrb r2, [r0] - mov r0, r12 - adds r0, 0x5 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 8 - orrs r2, r0 - strh r2, [r3] - ldr r3, =0x02038404 - ldrb r1, [r5] - lsls r1, 9 - mov r0, r12 - adds r0, 0x6 - adds r0, r1, r0 - ldrb r2, [r0] - mov r0, r12 - adds r0, 0x7 - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 8 - orrs r2, r0 - mov r0, r12 - adds r0, 0x8 - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 16 - orrs r2, r0 - mov r0, r12 - adds r0, 0x9 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 24 - orrs r2, r0 - str r2, [r3] - ldr r2, =0x0203841a - ldrb r0, [r5] - lsls r0, 9 - mov r1, r12 - adds r1, 0xA - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r4, =0x0203841c - ldrb r1, [r5] - lsls r1, 9 - mov r0, r12 - adds r0, 0xC - adds r0, r1, r0 - ldrb r2, [r0] - mov r0, r12 - adds r0, 0xD - adds r1, r0 - ldrb r0, [r1] - lsls r0, 8 - orrs r2, r0 - strh r2, [r4] - ldr r7, =0x02038400 - ldrb r1, [r5] - lsls r1, 9 - mov r0, r12 - adds r0, 0x10 - adds r1, r0 - str r1, [r7] - ldr r2, =0x020244bc - ldrb r0, [r5] - lsls r0, 2 - adds r0, r2 - ldr r1, [r1] - str r1, [r0] - mov r0, r8 - ldrb r1, [r0] - adds r0, r6, 0 - bl sub_805DB8C - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _0805BDBC - bl dp01_tbl1_exec_completed - b _0805BDE4 - .pool -_0805BDBC: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r3, [r0, 0x4] - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_move_anim_1 - str r1, [r0] - ldrh r1, [r4] - ldr r2, [r7] - adds r0, r6, 0 - bl sub_817E0FC -_0805BDE4: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_0F_1_move_anim - - thumb_func_start bx_move_anim_1 -bx_move_anim_1: @ 805BDFC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r2, =0x02023064 - ldr r6, =0x02024064 - 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, =0x020244d0 - 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 _0805BE94 - cmp r2, 0x1 - bgt _0805BE54 - cmp r2, 0 - beq _0805BE5E - b _0805BF70 - .pool -_0805BE54: - cmp r2, 0x2 - beq _0805BEBE - cmp r2, 0x3 - beq _0805BF34 - b _0805BF70 -_0805BE5E: - ldr r1, [r5] - lsls r0, r3, 2 - adds r1, r0, r1 - ldrb r2, [r1] - movs r0, 0xC - ands r0, r2 - cmp r0, 0x4 - bne _0805BE80 - 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 -_0805BE80: - 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 _0805BF70 -_0805BE94: - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0805BF70 - 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 _0805BF70 -_0805BEBE: - ldr r0, =0x020383f8 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =0x020383fd - ldrb r0, [r0] - cmp r0, 0 - bne _0805BF70 - 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 _0805BF0C - mov r0, r8 - cmp r0, 0x1 - bhi _0805BF0C - 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] -_0805BF0C: - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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 _0805BF70 - .pool -_0805BF34: - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0805BF70 - 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 dp01_tbl1_exec_completed -_0805BF70: - 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_1 - - thumb_func_start sub_805BF80 -sub_805BF80: @ 805BF80 - push {r4,r5,lr} - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r5, =0x02024064 - ldrb r4, [r5] - lsls r4, 9 - ldr r0, =0x02023066 - adds r4, r0 - ldrh r0, [r4] - bl battle_pick_message - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80597B4 - str r1, [r0] - ldrh r0, [r4] - bl sub_817C95C - ldrb r0, [r5] - ldrh r1, [r4] - bl sub_81A57E4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805BF80 - - thumb_func_start dp01t_11_1_message_for_player_only -dp01t_11_1_message_for_player_only: @ 805BFE0 - push {lr} - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0805BFFC - bl sub_805BF80 - b _0805C000 - .pool -_0805BFFC: - bl dp01_tbl1_exec_completed -_0805C000: - pop {r0} - bx r0 - thumb_func_end dp01t_11_1_message_for_player_only - - thumb_func_start sub_805C004 -sub_805C004: @ 805C004 - push {lr} - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0805C02A - ldr r0, =0x02022e14 - strh r1, [r0] - ldr r1, =0x02022e16 - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8057588 - str r1, [r0] -_0805C02A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C004 - - thumb_func_start dp01t_12_6_battle_menu -dp01t_12_6_battle_menu: @ 805C044 - push {r4,lr} - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805C004 - str r1, [r0] - bl sub_817F2A8 - ldr r0, =gUnknown_085CCA3A - movs r1, 0x2 - bl battle_show_message_maybe - movs r4, 0 -_0805C062: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_8059CF8 - adds r4, 0x1 - cmp r4, 0x3 - ble _0805C062 - ldr r1, =0x020244ac - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - movs r1, 0 - bl sub_8059CB4 - ldr r0, =gUnknown_085CC9F3 - bl get_battle_strings_ - ldr r0, =0x02022e2c - movs r1, 0x1 - bl battle_show_message_maybe - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_12_6_battle_menu - - thumb_func_start sub_805C0B0 -sub_805C0B0: @ 805C0B0 - push {r4,lr} - sub sp, 0x4 - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0805C108 - str r0, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - ldr r0, =gUnknown_085CCABB - movs r1, 0xC - bl battle_show_message_maybe - ldr r1, =0x03005d74 - movs r0, 0x1 - strb r0, [r1] - movs r0, 0x1 - bl sub_8056B74 - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80599D4 - str r1, [r0] - b _0805C10C - .pool -_0805C108: - bl dp01_tbl1_exec_completed -_0805C10C: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_805C0B0 - - thumb_func_start sub_805C114 -sub_805C114: @ 805C114 - push {lr} - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0805C13E - ldr r0, =0x02022e14 - strh r1, [r0] - ldr r1, =0x02022e16 - movs r2, 0xA0 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r1] - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8057BFC - str r1, [r0] -_0805C13E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C114 - - thumb_func_start sub_805C158 -sub_805C158: @ 805C158 - push {lr} - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r1, r0 - movs r0, 0xA6 - lsls r0, 2 - adds r1, r0 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - bne _0805C194 - ldr r1, =0x0203bd30 - ldr r0, =0x03005d80 - ldr r0, [r0] - str r0, [r1] - 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 - bl dp01_tbl1_exec_completed -_0805C194: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C158 - - thumb_func_start dp01t_14_5_move_menu_pokedude -dp01t_14_5_move_menu_pokedude: @ 805C1A8 - push {lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _0805C1EC - ldr r2, =0x02024064 - ldrb r0, [r2] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - movs r1, 0xA6 - lsls r1, 2 - adds r0, r1 - movs r1, 0x8 - strb r1, [r0] - ldr r1, =0x03005d60 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805C158 - b _0805C1FC - .pool -_0805C1EC: - bl sub_805C210 - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805C114 -_0805C1FC: - str r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_14_5_move_menu_pokedude - - thumb_func_start sub_805C210 -sub_805C210: @ 805C210 - push {lr} - bl sub_8059AAC - ldr r1, =0x03005d74 - movs r0, 0xFF - strb r0, [r1] - ldr r1, =0x020244b0 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - movs r1, 0 - bl battle_menu_cursor_related_2 - bl sub_8059B18 - bl sub_8059B3C - bl sub_8059BB0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C210 - - thumb_func_start sub_805C248 -sub_805C248: @ 805C248 - push {r4,r5,lr} - sub sp, 0x4 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x03005d60 - ldr r2, =0x02024064 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80598A4 - str r1, [r0] - ldr r1, =0x020244b8 - ldrb r0, [r2] - strb r0, [r1] - movs r3, 0 - ldr r5, =0x0203cf00 - ldr r4, =0x02023064 -_0805C276: - adds r0, r3, r5 - ldrb r1, [r2] - lsls r1, 9 - adds r1, 0x1 - adds r1, r3, r1 - adds r1, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r3, 0x1 - cmp r3, 0x2 - ble _0805C276 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C248 - - thumb_func_start sub_805C2AC -sub_805C2AC: @ 805C2AC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - movs r3, 0 - ldr r0, =0x0203cf00 - mov r12, r0 - ldr r1, =0x02023064 - mov r8, r1 - ldr r2, =0x02024064 - ldr r7, =0x02022fec - mov r6, r12 - mov r5, r8 - adds r4, r2, 0 -_0805C2C8: - adds r0, r3, r6 - ldrb r1, [r4] - lsls r1, 9 - adds r1, 0x4 - adds r1, r3, r1 - adds r1, r5 - ldrb r1, [r1] - strb r1, [r0] - adds r3, 0x1 - cmp r3, 0x2 - ble _0805C2C8 - ldr r0, [r7] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _0805C330 - ldrb r3, [r2] - lsls r0, r3, 9 - mov r1, r8 - adds r1, 0x1 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x2 - beq _0805C330 - ldr r1, =0x0202406e - lsls r0, r3, 1 - adds r0, r1 - ldrb r1, [r0] - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x1 - mov r2, r12 - bl dp01_build_cmdbuf_x22_a_three_bytes - bl dp01_tbl1_exec_completed - b _0805C3BC - .pool -_0805C330: - ldr r0, =TaskDummy - movs r1, 0xFF - bl CreateTask - ldr r3, =0x03005d7c - ldr r4, =0x02024064 - ldrb r1, [r4] - adds r1, r3 - movs r2, 0 - mov r8, r2 - strb r0, [r1] - ldr r5, =0x03005e00 - ldrb r2, [r4] - adds r3, r2, r3 - ldrb r0, [r3] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r5 - ldr r5, =0x02023064 - lsls r2, 9 - adds r6, r5, 0x1 - adds r2, r6 - ldrb r2, [r2] - movs r0, 0xF - ands r0, r2 - strh r0, [r1, 0x8] - ldr r3, =0x0202449c - ldr r1, [r3] - adds r1, 0x49 - ldrb r0, [r4] - lsls r0, 9 - adds r0, r6 - ldrb r0, [r0] - lsrs r0, 4 - strb r0, [r1] - ldr r2, [r3] - adds r2, 0x8B - ldrb r0, [r4] - lsls r0, 9 - adds r1, r5, 0x2 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r1, [r3] - adds r1, 0xB0 - ldrb r0, [r4] - lsls r0, 9 - adds r5, 0x3 - adds r0, r5 - ldrb r0, [r0] - strb r0, [r1] - movs r0, 0x1 - negs r0, r0 - mov r1, r8 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80597CC - str r1, [r0] - ldr r1, =0x020244b8 - ldrb r0, [r4] - strb r0, [r1] -_0805C3BC: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C2AC - - thumb_func_start sub_805C3EC -sub_805C3EC: @ 805C3EC - push {lr} - sub sp, 0x4 - bl sub_805EA60 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r1, 0x2 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - bl dp01_tbl1_exec_completed - add sp, 0x4 - pop {r0} - bx r0 - thumb_func_end sub_805C3EC - - thumb_func_start sub_805C410 -sub_805C410: @ 805C410 - 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, =0x02023064 - ldr r0, =0x02024064 - mov r9, r0 - ldrb r1, [r0] - lsls r1, 9 - adds r0, r3, 0x2 - adds r0, r1, r0 - ldrb r2, [r0] - adds r3, 0x3 - adds r1, r3 - ldrb r0, [r1] - lsls r0, 8 - orrs r2, r0 - lsls r2, 16 - asrs r7, r2, 16 - cmp r7, 0 - ble _0805C44A - ldr r1, =0x0203cd70 - ldr r0, [r1] - adds r0, r7 - str r0, [r1] -_0805C44A: - ldr r0, =0x00007fff - cmp r7, r0 - beq _0805C4B4 - ldr r6, =0x0202406e - mov r1, r9 - ldrb r0, [r1] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - movs r1, 0x3A - bl pokemon_getattr - mov r8, r0 - mov r2, r9 - ldrb r0, [r2] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - adds r0, r4 - movs r1, 0x39 - bl pokemon_getattr - adds r3, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r1, =0x03005d70 - adds r1, r0, r1 - ldrb r1, [r1] - str r7, [sp] - mov r2, r8 - bl sub_807294C - b _0805C4F2 - .pool -_0805C4B4: - ldr r1, =0x0202406e - mov r2, r9 - ldrb r0, [r2] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3A - bl pokemon_getattr - adds r2, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r4, =0x03005d70 - adds r1, r0, r4 - ldrb r1, [r1] - str r7, [sp] - movs r3, 0 - bl sub_807294C - mov r2, r9 - ldrb r0, [r2] - adds r0, r4 - ldrb r0, [r0] - movs r1, 0 - movs r2, 0 - bl heathbar_draw_hp -_0805C4F2: - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_t1_healthbar_update - 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_805C410 - - thumb_func_start sub_805C528 -sub_805C528: @ 805C528 - push {r4-r7,lr} - ldr r5, =0x02023064 - ldr r6, =0x02024064 - ldrb r0, [r6] - lsls r0, 9 - adds r1, r5, 0x1 - adds r0, r1 - ldrb r7, [r0] - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - cmp r0, 0x63 - bls _0805C560 - bl dp01_tbl1_exec_completed - b _0805C5AC - .pool -_0805C560: - movs r0, 0x1 - bl load_gfxc_health_bar - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - ldrb r1, [r6] - lsls r1, 9 - adds r0, r5, 0x2 - adds r0, r1, r0 - ldrb r4, [r0] - adds r0, r5, 0x3 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 8 - orrs r4, r0 - ldr r0, =sub_80591B8 - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r7, [r1, 0x8] - strh r4, [r1, 0xA] - ldrb r0, [r6] - strh r0, [r1, 0xC] - ldr r1, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =nullsub_21 - str r1, [r0] -_0805C5AC: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C528 - - thumb_func_start sub_805C5C4 -sub_805C5C4: @ 805C5C4 - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _0805C618 - ldr r0, =0x03005d70 - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0x9 - bl healthbar_draw_field_maybe - ldrb r2, [r4] - ldr r0, =0x020244d0 - 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, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8059D60 - str r1, [r0] -_0805C618: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C5C4 - - thumb_func_start sub_805C63C -sub_805C63C: @ 805C63C - push {r4,r5,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _0805C68C - ldr r4, =0x02023064 - 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, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8059D60 - str r1, [r0] -_0805C68C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C63C - - thumb_func_start sub_805C6A4 -sub_805C6A4: @ 805C6A4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - ldr r0, =0x0202406e - mov r8, r0 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - movs r1, 0x37 - bl pokemon_getattr - ldr r2, =0x02023064 - ldrb r1, [r4] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - eors r0, r1 - mov r1, sp - strb r0, [r1] - ldrb r0, [r4] - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - muls r0, r6 - adds r0, r5 - movs r1, 0x37 - mov r2, sp - bl pokemon_setattr - bl dp01_tbl1_exec_completed - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C6A4 - - thumb_func_start sub_805C710 -sub_805C710: @ 805C710 - push {lr} - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_805C710 - - thumb_func_start sub_805C71C -sub_805C71C: @ 805C71C - push {r4,r5,lr} - ldr r3, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r2, 9 - adds r0, r3, 0x1 - adds r0, r2, r0 - ldrb r5, [r0] - adds r0, r3, 0x2 - adds r0, r2, r0 - ldrb r0, [r0] - lsls r0, 8 - orrs r5, r0 - adds r0, r3, 0x3 - adds r0, r2, r0 - ldrb r0, [r0] - lsls r0, 16 - orrs r5, r0 - adds r0, r3, 0x4 - adds r0, r2, r0 - ldrb r4, [r0] - lsls r4, 24 - adds r0, r3, 0x5 - adds r0, r2, r0 - ldrb r1, [r0] - adds r0, r3, 0x6 - adds r0, r2, r0 - ldrb r0, [r0] - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - adds r3, 0x7 - adds r2, r3 - orrs r5, r4 - lsrs r4, r1, 16 - movs r0, 0x80 - lsls r0, 5 - cmp r4, r0 - bhi _0805C78C - ldr r0, =0x040000d4 - str r2, [r0] - str r5, [r0, 0x4] - lsrs r1, 17 - movs r2, 0x80 - lsls r2, 24 - orrs r1, r2 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - b _0805C7B8 - .pool -_0805C78C: - ldr r3, =0x040000d4 - str r2, [r3] - str r5, [r3, 0x4] - ldr r0, =0x80000800 - str r0, [r3, 0x8] - ldr r0, [r3, 0x8] - movs r0, 0x80 - lsls r0, 5 - adds r2, r0 - adds r5, r0 - ldr r1, =0xfffff000 - adds r4, r1 - cmp r4, r0 - bhi _0805C78C - str r2, [r3] - str r5, [r3, 0x4] - lsrs r0, r4, 1 - movs r1, 0x80 - lsls r1, 24 - orrs r0, r1 - str r0, [r3, 0x8] - ldr r0, [r3, 0x8] -_0805C7B8: - bl dp01_tbl1_exec_completed - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C71C - - thumb_func_start sub_805C7D0 -sub_805C7D0: @ 805C7D0 - push {lr} - ldr r2, =0x02023064 - ldr r0, =0x02024064 - ldrb r1, [r0] - 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 - bl song_play_for_text - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C7D0 - - thumb_func_start sub_805C800 -sub_805C800: @ 805C800 - push {lr} - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_805C800 - - thumb_func_start sub_805C80C -sub_805C80C: @ 805C80C - push {lr} - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_805C80C - - thumb_func_start sub_805C820 -sub_805C820: @ 805C820 - push {lr} - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl dp01_build_cmdbuf_x22_a_three_bytes - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_805C820 - - thumb_func_start sub_805C834 -sub_805C834: @ 805C834 - push {lr} - movs r0, 0x1 - movs r1, 0 - bl dp01_build_cmdbuf_x23_aa_0 - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_805C834 - - thumb_func_start sub_805C848 -sub_805C848: @ 805C848 - push {lr} - movs r0, 0x1 - movs r1, 0 - bl dp01_build_cmdbuf_x24_aa_0 - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_805C848 - - thumb_func_start sub_805C85C -sub_805C85C: @ 805C85C - push {lr} - ldr r2, =0x02022d0c - ldrb r1, [r2] - movs r0, 0x80 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C85C - - thumb_func_start sub_805C878 -sub_805C878: @ 805C878 - push {lr} - ldr r3, =0x02022d0c - ldr r1, =0x02023064 - ldr r0, =0x02024064 - 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 dp01_tbl1_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C878 - - thumb_func_start sub_805C8B0 -sub_805C8B0: @ 805C8B0 - push {lr} - ldr r2, =0x02022d0c - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C8B0 - - thumb_func_start sub_805C8C8 -sub_805C8C8: @ 805C8C8 - push {lr} - ldr r3, =0x02022d0c - 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 dp01_tbl1_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C8C8 - - thumb_func_start dp01t_29_1_blink -dp01t_29_1_blink: @ 805C8F0 - push {r4,lr} - ldr r3, =0x02020630 - ldr r2, =0x020241e4 - ldr r4, =0x02024064 - 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 _0805C924 - bl dp01_tbl1_exec_completed - b _0805C94E - .pool -_0805C924: - ldr r1, =0x020244b9 - 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, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_blink_t1 - str r1, [r0] -_0805C94E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_29_1_blink - - thumb_func_start sub_805C960 -sub_805C960: @ 805C960 - push {lr} - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_805C960 - - thumb_func_start sub_805C96C -sub_805C96C: @ 805C96C - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - movs r3, 0x3F - cmp r0, 0 - bne _0805C980 - movs r3, 0xC0 -_0805C980: - ldr r2, =0x02023064 - 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 audio_play_and_stuff - bl dp01_tbl1_exec_completed - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805C96C - - thumb_func_start sub_805C9B0 -sub_805C9B0: @ 805C9B0 - push {r4,r5,lr} - ldr r4, =0x02023064 - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r3, r0, 9 - adds r0, r4, 0x3 - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0 - beq _0805C9EC - 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 song_play_for_text - b _0805CA00 - .pool -_0805C9EC: - 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 fanfare_play -_0805CA00: - bl dp01_tbl1_exec_completed - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_805C9B0 - - thumb_func_start sub_805CA0C -sub_805CA0C: @ 805CA0C - push {lr} - ldr r1, =0x0202406e - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x19 - negs r1, r1 - movs r2, 0x5 - bl sub_80A32E4 - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_805CA0C - - thumb_func_start dp01t_2E_1_battle_intro -dp01t_2E_1_battle_intro: @ 805CA4C - push {lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - bl battle_intro_launch - ldr r2, =0x020243fc - ldrh r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strh r0, [r2] - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_2E_1_battle_intro - - thumb_func_start dp01t_2F_1_pokemon_enter -dp01t_2F_1_pokemon_enter: @ 805CA80 - push {r4-r7,lr} - ldr r6, =0x020241e4 - ldr r7, =0x02024064 - ldrb r0, [r7] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =0x02020630 - adds r0, r5 - bl oamt_add_pos2_onto_pos1 - ldrb r0, [r7] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x32 - strh r1, [r0, 0x2E] - ldrb r0, [r7] - 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, [r7] - 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, [r7] - 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 r2, [r7] - adds r0, r2, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x38] - ldrb r0, [r7] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =sub_805CC00 - bl oamt_set_x3A_32 - ldrb r0, [r7] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x1 - bl StartObjectImageAnim - ldr r0, =0x0000d6f8 - bl AllocObjectPalette - adds r4, r0, 0 - lsls r4, 24 - ldr r1, =gTrainerBackPicPaletteTable - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 3 - adds r0, r1 - ldr r0, [r0] - lsrs r4, 20 - movs r2, 0x80 - lsls r2, 1 - adds r1, r4, r2 - movs r2, 0x20 - bl decompress_palette - ldrb r0, [r7] - adds r0, r6 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r4 - strb r0, [r1, 0x5] - ldr r0, =task05_08033660 - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r4 - ldrb r0, [r7] - strh r0, [r1, 0x8] - ldr r3, =0x020244d0 - ldr r0, [r3] - ldrb r2, [r7] - 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 _0805CBA2 - ldr r0, =0x020244b4 - 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] -_0805CBA2: - ldr r0, [r3] - ldr r2, [r0, 0x8] - ldrb r0, [r2, 0x9] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x9] - ldr r1, =0x03005d60 - ldrb r0, [r7] - lsls r0, 2 - adds r0, r1 - ldr r1, =nullsub_21 - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_2F_1_pokemon_enter - - thumb_func_start sub_805CC00 -sub_805CC00: @ 805CC00 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r4, [r5, 0x38] - lsls r4, 24 - lsrs r4, 24 - bl obj_free_rotscale_entry - ldrb r0, [r5, 0x5] - lsrs r0, 4 - bl GetObjectPaletteTagBySlot - lsls r0, 16 - lsrs r0, 16 - bl FreeObjectPaletteByTag - adds r0, r5, 0 - bl RemoveObjectAndFreeTiles - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - adds r1, r4, 0 - bl sub_805DD7C - ldr r0, =0x020241e4 - adds r4, r0 - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0 - bl StartObjectImageAnim - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805CC00 - - thumb_func_start task05_08033660 -task05_08033660: @ 805CC68 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =0x03005e00 - 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, 0x1E - bgt _0805CC94 - adds r0, r2, 0x1 - strh r0, [r1, 0xA] - b _0805CD50 - .pool -_0805CC94: - ldr r7, =0x02024064 - 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 _0805CCB4 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0805CCE4 -_0805CCB4: - ldr r0, =0x02023064 - ldrb r1, [r7] - lsls r2, r1, 9 - adds r0, 0x1 - adds r2, r0 - ldr r0, =0x0202406e - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - strb r0, [r2] - ldrb r0, [r7] - movs r1, 0 - bl sub_805B258 - b _0805CD38 - .pool -_0805CCE4: - ldr r4, =0x02023064 - ldrb r0, [r7] - lsls r1, r0, 9 - adds r4, 0x1 - adds r1, r4 - ldr r5, =0x0202406e - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - strb r0, [r1] - ldrb r0, [r7] - movs r1, 0 - bl sub_805B258 - 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, =0x020244ec - adds r0, r2 - bl sub_805DD7C - ldrb r0, [r7] - movs r1, 0 - bl sub_805B258 - ldrb r0, [r7] - eors r0, r6 - strb r0, [r7] -_0805CD38: - ldr r1, =0x03005d60 - ldr r2, =0x02024064 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8058B40 - str r1, [r0] - mov r3, r9 - strb r3, [r2] - mov r0, r8 - bl DestroyTask -_0805CD50: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end task05_08033660 - - thumb_func_start sub_805CD74 -sub_805CD74: @ 805CD74 - push {r4-r6,lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _0805CDA4 - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0805CDA4 - bl dp01_tbl1_exec_completed - b _0805CE18 - .pool -_0805CDA4: - ldr r6, =0x020244d0 - ldr r0, [r6] - ldr r5, =0x02024064 - 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, =0x02023068 - 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, =0x020244b4 - 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 _0805CE0C - 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] -_0805CE0C: - ldr r0, =0x03005d60 - ldrb r1, [r5] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_805CE38 - str r0, [r1] -_0805CE18: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805CD74 - - thumb_func_start sub_805CE38 -sub_805CE38: @ 805CE38 - push {r4,lr} - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r3, =0x02024064 - 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 _0805CE70 - 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 dp01_tbl1_exec_completed -_0805CE70: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805CE38 - - thumb_func_start sub_805CE80 -sub_805CE80: @ 805CE80 - push {lr} - ldr r0, =0x020244d0 - ldr r1, [r0] - ldr r0, =0x02024064 - 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 _0805CEB2 - ldr r2, =0x03005e00 - ldr r0, =0x020244b4 - 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] -_0805CEB2: - bl dp01_tbl1_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_805CE80 - - thumb_func_start sub_805CED0 -sub_805CED0: @ 805CED0 - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - movs r1, 0x1 - bl dp11b_obj_free - ldrb r0, [r4] - movs r1, 0 - bl dp11b_obj_free - bl dp01_tbl1_exec_completed - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805CED0 - - thumb_func_start dp01t_33_1_enemy_move -dp01t_33_1_enemy_move: @ 805CEF4 - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl sub_80A6A90 - lsls r0, 24 - cmp r0, 0 - beq _0805CF3A - ldr r3, =0x02020630 - ldr r0, =0x020241e4 - 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, =0x02023064 - 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 -_0805CF3A: - bl dp01_tbl1_exec_completed - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_33_1_enemy_move - - thumb_func_start sub_805CF54 -sub_805CF54: @ 805CF54 - push {r4-r6,lr} - sub sp, 0x4 - ldr r5, =0x02024064 - ldrb r0, [r5] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _0805CFB6 - ldr r4, =0x02023064 - ldrb r2, [r5] - lsls r1, r2, 9 - adds r0, r4, 0x1 - adds r0, r1, r0 - ldrb r6, [r0] - adds r0, r4, 0x2 - adds r0, r1, r0 - ldrb r3, [r0] - adds r4, 0x3 - adds r1, r4 - ldrb r0, [r1] - lsls r0, 8 - orrs r3, r0 - str r3, [sp] - adds r0, r2, 0 - adds r1, r2, 0 - adds r3, r6, 0 - bl move_anim_start_t3 - lsls r0, 24 - cmp r0, 0 - beq _0805CFA4 - bl dp01_tbl1_exec_completed - b _0805CFB0 - .pool -_0805CFA4: - ldr r0, =0x03005d60 - ldrb r1, [r5] - lsls r1, 2 - adds r1, r0 - ldr r0, =bx_8030B2C - str r0, [r1] -_0805CFB0: - adds r0, r6, 0 - bl sub_817E32C -_0805CFB6: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805CF54 - - thumb_func_start dp01t_35_1_link_standby_message_and_free_vram -dp01t_35_1_link_standby_message_and_free_vram: @ 805CFC8 - push {r4,r5,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r0, 9 - ldr r4, =0x02023066 - adds r0, r4 - bl sub_81851A8 - ldrb r0, [r5] - lsls r0, 9 - subs r4, 0x1 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0805D002 - cmp r0, 0x1 - bgt _0805CFF8 - cmp r0, 0 - beq _0805CFFE - b _0805D020 - .pool -_0805CFF8: - cmp r0, 0x2 - beq _0805D01C - b _0805D020 -_0805CFFE: - bl b_link_standby_message -_0805D002: - ldr r4, =0x02024064 - ldrb r0, [r4] - movs r1, 0x1 - bl dp11b_obj_free - ldrb r0, [r4] - movs r1, 0 - bl dp11b_obj_free - b _0805D020 - .pool -_0805D01C: - bl b_link_standby_message -_0805D020: - bl dp01_tbl1_exec_completed - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end dp01t_35_1_link_standby_message_and_free_vram - - thumb_func_start sub_805D02C -sub_805D02C: @ 805D02C - push {r4,lr} - ldr r1, =0x02023064 - ldr r4, =0x02024064 - ldrb r3, [r4] - lsls r0, r3, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r2, [r0] - cmp r2, 0x1 - beq _0805D074 - cmp r2, 0x1 - bgt _0805D054 - cmp r2, 0 - beq _0805D05A - b _0805D084 - .pool -_0805D054: - cmp r2, 0x2 - beq _0805D07C - b _0805D084 -_0805D05A: - ldr r0, =0x020244ac - adds r0, r3, r0 - strb r2, [r0] - ldr r1, =0x020244b0 - ldrb r0, [r4] - adds r0, r1 - strb r2, [r0] - b _0805D084 - .pool -_0805D074: - ldr r0, =0x020244ac - b _0805D07E - .pool -_0805D07C: - ldr r0, =0x020244b0 -_0805D07E: - adds r0, r3, r0 - movs r1, 0 - strb r1, [r0] -_0805D084: - bl dp01_tbl1_exec_completed - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805D02C - - thumb_func_start sub_805D094 -sub_805D094: @ 805D094 - push {r4,r5,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r0, 9 - ldr r4, =0x02023068 - adds r0, r4 - bl sub_81851A8 - ldr r2, =0x0202433a - ldrb r0, [r5] - lsls r0, 9 - subs r1, r4, 0x3 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r0, =0x03005d90 - ldr r3, [r0] - ldrb r0, [r5] - lsls r0, 9 - subs r4, 0x2 - adds r0, r4 - ldrb r0, [r0] - ldr r1, =0x00000ca9 - adds r3, r1 - movs r1, 0x1 - ands r1, r0 - lsls r1, 3 - ldrb r2, [r3] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - movs r0, 0x5 - bl sub_80A2F50 - movs r0, 0x3 - bl sub_80A2390 - bl dp01_tbl1_exec_completed - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80587B0 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805D094 - - thumb_func_start nullsub_22 -nullsub_22: @ 805D114 - bx lr - thumb_func_end nullsub_22 - - thumb_func_start dp11_init -dp11_init: @ 805D118 - push {r4,lr} - ldr r4, =0x020244d0 - movs r0, 0x10 - bl AllocZeroed - str r0, [r4] - movs r0, 0x10 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1] - movs r0, 0x30 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x4] - movs r0, 0x10 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x8] - movs r0, 0x50 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0xC] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp11_init - - thumb_func_start dp11_free -dp11_free: @ 805D158 - push {r4,r5,lr} - ldr r5, =0x020244d0 - ldr r0, [r5] - cmp r0, 0 - beq _0805D192 - ldr r0, [r0, 0xC] - bl Free - ldr r0, [r5] - movs r4, 0 - str r4, [r0, 0xC] - ldr r0, [r0, 0x8] - bl Free - ldr r0, [r5] - str r4, [r0, 0x8] - ldr r0, [r0, 0x4] - bl Free - ldr r0, [r5] - str r4, [r0, 0x4] - ldr r0, [r0] - bl Free - ldr r0, [r5] - str r4, [r0] - bl Free - str r4, [r5] -_0805D192: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end dp11_free - - thumb_func_start sub_805D19C -sub_805D19C: @ 805D19C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r0, 0x1 - negs r0, r0 - mov r9, r0 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r2, r0, 9 - ldr r1, =0x02023068 - adds r2, r1 - mov r10, r2 - movs r1, 0 - movs r2, 0xFF - bl sub_803FECC - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x92 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - negs r0, r1 - orrs r0, r1 - asrs r4, r0, 31 - movs r0, 0x2 - ands r4, r0 - adds r6, r4, 0 - adds r5, r4, 0x2 - b _0805D20E - .pool -_0805D20C: - adds r4, 0x1 -_0805D20E: - cmp r4, r5 - bge _0805D234 - ldr r0, =0x02024064 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - ldr r1, =0x020240cc - adds r0, r1 - ldr r0, [r0] - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r0, 22 - adds r0, r4, r0 - ldr r2, =gUnknown_0831C494 - adds r0, r2 - ldrb r0, [r0] - cmp r0, r7 - ble _0805D20C -_0805D234: - subs r7, r4, r6 - cmp r4, r5 - bne _0805D23C - movs r7, 0x2 -_0805D23C: - movs r6, 0 - movs r4, 0 - mov r1, r10 - ldrh r0, [r1] - cmp r0, 0 - beq _0805D27C - mov r5, r10 -_0805D24A: - ldrh r0, [r5] - bl sub_805D4A8 - lsls r0, 24 - lsrs r0, 24 - cmp r7, r0 - bne _0805D26E - mov r0, r10 - adds r0, 0x8 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _0805D26E - ldr r0, =gUnknown_0832A328 - lsls r1, r4, 2 - adds r1, r0 - ldr r0, [r1] - orrs r6, r0 -_0805D26E: - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - bgt _0805D27C - ldrh r0, [r5] - cmp r0, 0 - bne _0805D24A -_0805D27C: - cmp r6, 0 - beq _0805D2AC - ldr r3, =0x0202449c - ldr r1, [r3] - adds r1, 0x92 - ldrb r2, [r1] - movs r0, 0xF - ands r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, 0x92 - lsls r0, r6, 4 - ldrb r2, [r1] - orrs r0, r2 - strb r0, [r1] - lsls r0, r6, 24 - lsrs r0, 24 - bl sub_8130950 - bl sub_8130BA4 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_0805D2AC: - movs r0, 0x1 - negs r0, r0 - cmp r9, r0 - beq _0805D2B6 - b _0805D40C -_0805D2B6: - mov r2, r8 - cmp r2, 0xF - bne _0805D2BE - b _0805D3EA -_0805D2BE: - movs r5, 0 - movs r6, 0 - ldr r7, =gUnknown_0832A328 - mov r4, r10 -_0805D2C6: - ldrh r0, [r4] - bl sub_805D4A8 - lsls r0, 24 - cmp r0, 0 - bne _0805D2DE - ldr r0, [r7] - mov r1, r8 - ands r0, r1 - cmp r0, 0 - bne _0805D2DE - adds r5, 0x1 -_0805D2DE: - ldrh r0, [r4] - bl sub_805D4A8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0805D2F8 - ldr r0, [r7] - mov r2, r8 - ands r0, r2 - cmp r0, 0 - bne _0805D2F8 - adds r5, 0x10 -_0805D2F8: - ldrh r0, [r4] - bl sub_805D4A8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0805D316 - ldr r0, [r7] - mov r1, r8 - ands r0, r1 - cmp r0, 0 - bne _0805D316 - movs r2, 0x80 - lsls r2, 1 - adds r5, r2 -_0805D316: - adds r7, 0x4 - adds r4, 0x2 - ldr r0, =gUnknown_0832A328 - adds r0, 0xC - cmp r7, r0 - ble _0805D2C6 - movs r1, 0xF - ands r1, r5 - cmp r1, 0x1 - ble _0805D32C - adds r6, 0x1 -_0805D32C: - movs r0, 0xF0 - ands r0, r5 - cmp r0, 0x1F - ble _0805D336 - adds r6, 0x1 -_0805D336: - ldr r2, =0x000001ff - cmp r0, r2 - ble _0805D33E - adds r6, 0x1 -_0805D33E: - cmp r6, 0x1 - bgt _0805D346 - cmp r6, 0 - bne _0805D388 -_0805D346: - ldr r5, =gUnknown_0832A328 -_0805D348: - bl GenerateRandomNumber - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - lsrs r4, r1, 16 - lsls r0, r4, 2 - adds r0, r5 - ldr r0, [r0] - mov r1, r8 - ands r0, r1 - cmp r0, 0 - bne _0805D366 - mov r9, r4 -_0805D366: - movs r0, 0x1 - negs r0, r0 - cmp r9, r0 - beq _0805D348 - b _0805D3D4 - .pool -_0805D388: - cmp r1, 0x1 - ble _0805D38E - movs r6, 0 -_0805D38E: - cmp r0, 0x1F - ble _0805D394 - movs r6, 0x1 -_0805D394: - cmp r0, r2 - ble _0805D39A - movs r6, 0x2 -_0805D39A: - bl GenerateRandomNumber - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - lsrs r4, r1, 16 - ldr r1, =gUnknown_0832A328 - lsls r0, r4, 2 - adds r0, r1 - ldr r0, [r0] - mov r2, r8 - ands r0, r2 - cmp r0, 0 - bne _0805D3CC - lsls r0, r4, 1 - add r0, r10 - ldrh r0, [r0] - bl sub_805D4A8 - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - bne _0805D3CC - mov r9, r4 -_0805D3CC: - movs r0, 0x1 - negs r0, r0 - cmp r9, r0 - beq _0805D39A -_0805D3D4: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x31 - bls _0805D40C -_0805D3EA: - ldr r2, =0x0202433c - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r1, 4 - adds r1, r2 - ldrb r0, [r1, 0x2] - movs r2, 0x10 - orrs r0, r2 - strb r0, [r1, 0x2] - movs r0, 0 - b _0805D496 - .pool -_0805D40C: - mov r1, r9 - lsls r0, r1, 1 - mov r2, r10 - adds r1, r2, r0 - ldrh r0, [r1] - cmp r0, 0xAE - bne _0805D434 - ldrb r0, [r2, 0x12] - movs r5, 0 - cmp r0, 0x7 - beq _0805D442 - ldrb r1, [r2, 0x13] - movs r0, 0x7 - eors r1, r0 - negs r0, r1 - orrs r0, r1 - asrs r5, r0, 31 - movs r0, 0x10 - ands r5, r0 - b _0805D442 -_0805D434: - ldr r2, =gBattleMoves - ldrh r1, [r1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r5, [r0, 0x6] -_0805D442: - movs r0, 0x10 - ands r0, r5 - cmp r0, 0 - beq _0805D45C - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 8 - b _0805D48A - .pool -_0805D45C: - cmp r5, 0 - bne _0805D470 - bl sub_805D5F4 - lsls r0, 16 - lsrs r0, 16 - mov r2, r9 - orrs r2, r0 - mov r9, r2 - b _0805D490 -_0805D470: - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_get_per_side_status - adds r1, r0, 0 - movs r2, 0x1 - movs r0, 0x1 - ands r0, r1 - eors r0, r2 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 16 -_0805D48A: - mov r1, r9 - orrs r1, r0 - mov r9, r1 -_0805D490: - mov r2, r9 - lsls r0, r2, 16 - lsrs r0, 16 -_0805D496: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_805D19C - - thumb_func_start sub_805D4A8 -sub_805D4A8: @ 805D4A8 - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - ldr r1, =gBattleMoves - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x6] - adds r3, r1, 0 - cmp r0, 0x40 - bls _0805D4C2 - b _0805D5EE -_0805D4C2: - lsls r0, 2 - ldr r1, =_0805D4D4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0805D4D4: - .4byte _0805D5D8 - .4byte _0805D5E6 - .4byte _0805D5D8 - .4byte _0805D5EE - .4byte _0805D5D8 - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5D8 - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EA - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5D8 - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5E6 -_0805D5D8: - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _0805D5EE -_0805D5E6: - movs r0, 0x2 - b _0805D5F0 -_0805D5EA: - movs r0, 0x1 - b _0805D5F0 -_0805D5EE: - movs r0, 0 -_0805D5F0: - pop {r1} - bx r1 - thumb_func_end sub_805D4A8 - - thumb_func_start sub_805D5F4 -sub_805D5F4: @ 805D5F4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0805D6FA - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0805D630 - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r0, 0x3 - b _0805D63E - .pool -_0805D630: - movs r0, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r0, 0x2 -_0805D63E: - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x02024084 - movs r2, 0x58 - mov r0, r8 - muls r0, r2 - adds r5, r0, r1 - adds r0, r7, 0 - muls r0, r2 - adds r6, r0, r1 - ldrh r0, [r5, 0x28] - ldrh r3, [r6, 0x28] - cmp r0, r3 - bne _0805D680 - bl GenerateRandomNumber - adds r3, r0, 0 - ldr r0, =0x02024064 - ldrb r1, [r0] - movs r2, 0x1 - movs r0, 0x1 - ands r0, r1 - eors r0, r2 - movs r1, 0x2 - ands r1, r3 - adds r0, r1 - b _0805D702 - .pool -_0805D680: - ldr r4, =gUnknown_0831C604 - ldr r0, =0x02024064 - mov r9, r0 - ldrb r0, [r0] - muls r0, r2 - adds r1, 0x48 - adds r0, r1 - ldr r0, [r0] - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r4, [r0] - cmp r4, 0x1 - beq _0805D6CC - cmp r4, 0x1 - bgt _0805D6B4 - cmp r4, 0 - beq _0805D6BA - b _0805D6FA - .pool -_0805D6B4: - cmp r4, 0x2 - beq _0805D6DE - b _0805D6FA -_0805D6BA: - ldrh r0, [r5, 0x28] - ldrh r6, [r6, 0x28] - cmp r0, r6 - bls _0805D6C8 - mov r1, r8 - lsls r0, r1, 8 - b _0805D704 -_0805D6C8: - lsls r0, r7, 8 - b _0805D704 -_0805D6CC: - ldrh r0, [r5, 0x28] - ldrh r6, [r6, 0x28] - cmp r0, r6 - bcs _0805D6DA - mov r3, r8 - lsls r0, r3, 8 - b _0805D704 -_0805D6DA: - lsls r0, r7, 8 - b _0805D704 -_0805D6DE: - bl GenerateRandomNumber - adds r3, r0, 0 - mov r0, r9 - ldrb r1, [r0] - movs r2, 0x1 - movs r0, 0x1 - ands r0, r1 - eors r0, r2 - ands r4, r3 - adds r0, r4 - lsls r0, 24 - lsrs r0, 16 - b _0805D704 -_0805D6FA: - ldr r0, =0x02024064 - ldrb r1, [r0] - movs r0, 0x1 - eors r0, r1 -_0805D702: - lsls r0, 8 -_0805D704: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_805D5F4 - - thumb_func_start sub_805D714 -sub_805D714: @ 805D714 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x30] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - adds r0, r1, 0 - adds r0, 0x3F - ldrb r3, [r0] - lsls r0, r3, 26 - cmp r0, 0 - bge _0805D766 - adds r0, r1, 0 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _0805D766 - adds r2, r1, 0 - adds r2, 0x2C - ldrb r1, [r2] - lsls r0, r1, 25 - cmp r0, 0 - bge _0805D75C - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - b _0805D766 - .pool -_0805D75C: - lsls r0, r3, 27 - cmp r0, 0 - bge _0805D766 - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] -_0805D766: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805D714 - - thumb_func_start sub_805D770 -sub_805D770: @ 805D770 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - adds r3, r4, 0 - adds r3, 0x2C - ldrb r0, [r3] - movs r2, 0x40 - orrs r0, r2 - strb r0, [r3] - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] - cmp r1, 0 - bne _0805D798 - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - b _0805D7A0 - .pool -_0805D798: - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim -_0805D7A0: - adds r0, r4, 0 - bl AnimateObject - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_805D770 - - thumb_func_start sub_805D7AC -sub_805D7AC: @ 805D7AC - push {lr} - adds r2, r0, 0 - ldr r0, =0x020243fc - ldrh r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0805D7E4 - ldrh r0, [r2, 0x2E] - ldrh r1, [r2, 0x24] - adds r0, r1 - strh r0, [r2, 0x24] - lsls r0, 16 - cmp r0, 0 - bne _0805D7E4 - movs r1, 0x26 - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _0805D7E0 - ldr r0, =sub_805D7EC - b _0805D7E2 - .pool -_0805D7E0: - ldr r0, =DummyObjectCallback -_0805D7E2: - str r0, [r2, 0x1C] -_0805D7E4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805D7AC - - thumb_func_start sub_805D7EC -sub_805D7EC: @ 805D7EC - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x26] - subs r0, 0x2 - strh r0, [r1, 0x26] - lsls r0, 16 - cmp r0, 0 - bne _0805D800 - ldr r0, =DummyObjectCallback - str r0, [r1, 0x1C] -_0805D800: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805D7EC - - thumb_func_start move_anim_start_t2_for_situation -move_anim_start_t2_for_situation: @ 805D808 - push {r4-r6,lr} - adds r4, r1, 0 - lsls r0, 24 - ldr r6, =0x020244d0 - ldr r1, [r6] - ldr r5, =0x02024064 - ldrb r2, [r5] - ldr r3, [r1, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - ldrb r2, [r1] - movs r3, 0x10 - orrs r2, r3 - strb r2, [r1] - cmp r0, 0 - bne _0805D888 - cmp r4, 0x20 - bne _0805D844 - ldrb r0, [r5] - movs r1, 0x6 - bl move_anim_start_t2 - b _0805D902 - .pool -_0805D844: - cmp r4, 0x8 - beq _0805D850 - movs r0, 0x80 - ands r0, r4 - cmp r0, 0 - beq _0805D85A -_0805D850: - ldrb r0, [r5] - movs r1, 0 - bl move_anim_start_t2 - b _0805D902 -_0805D85A: - cmp r4, 0x10 - bne _0805D868 - ldrb r0, [r5] - movs r1, 0x2 - bl move_anim_start_t2 - b _0805D902 -_0805D868: - movs r0, 0x7 - ands r0, r4 - cmp r0, 0 - beq _0805D87A - ldrb r0, [r5] - movs r1, 0x4 - bl move_anim_start_t2 - b _0805D902 -_0805D87A: - cmp r4, 0x40 - bne _0805D8EA - ldrb r0, [r5] - movs r1, 0x5 - bl move_anim_start_t2 - b _0805D902 -_0805D888: - movs r0, 0xF0 - lsls r0, 12 - ands r0, r4 - cmp r0, 0 - beq _0805D89C - ldrb r0, [r5] - movs r1, 0x3 - bl move_anim_start_t2 - b _0805D902 -_0805D89C: - movs r0, 0x7 - ands r0, r4 - cmp r0, 0 - beq _0805D8AE - ldrb r0, [r5] - movs r1, 0x1 - bl move_anim_start_t2 - b _0805D902 -_0805D8AE: - movs r0, 0x80 - lsls r0, 21 - ands r0, r4 - cmp r0, 0 - beq _0805D8C2 - ldrb r0, [r5] - movs r1, 0x7 - bl move_anim_start_t2 - b _0805D902 -_0805D8C2: - movs r0, 0x80 - lsls r0, 20 - ands r0, r4 - cmp r0, 0 - beq _0805D8D6 - ldrb r0, [r5] - movs r1, 0x8 - bl move_anim_start_t2 - b _0805D902 -_0805D8D6: - movs r0, 0xE0 - lsls r0, 8 - ands r0, r4 - cmp r0, 0 - beq _0805D8EA - ldrb r0, [r5] - movs r1, 0x9 - bl move_anim_start_t2 - b _0805D902 -_0805D8EA: - ldr r0, [r6] - ldrb r2, [r5] - 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] -_0805D902: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end move_anim_start_t2_for_situation - - thumb_func_start move_anim_start_t3 -move_anim_start_t3: @ 805D908 - 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 r6, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp] - lsls r3, 24 - lsrs r5, r3, 24 - lsls r4, 16 - lsrs r7, r4, 16 - cmp r5, 0 - bne _0805D950 - movs r0, 0x80 - ands r0, r7 - cmp r0, 0 - beq _0805D950 - ldr r0, =0x020244e4 - adds r0, r6, r0 - movs r2, 0x7F - adds r1, r7, 0 - ands r1, r2 - strb r1, [r0] - movs r0, 0x1 - b _0805DA1E - .pool -_0805D950: - ldr r0, =0x020244d0 - mov r9, r0 - ldr r0, [r0] - ldr r0, [r0] - lsls r4, r6, 2 - adds r0, r4, r0 - ldrb r1, [r0] - movs r2, 0x4 - mov r8, r2 - mov r0, r8 - ands r0, r1 - cmp r0, 0 - beq _0805D9CC - adds r0, r5, 0 - bl sub_805DAA0 - lsls r0, 24 - cmp r0, 0 - bne _0805D980 - movs r0, 0x1 - b _0805DA1E - .pool -_0805D980: - mov r1, r9 - ldr r0, [r1] - ldr r0, [r0] - adds r0, r4, r0 - ldrb r1, [r0] - mov r0, r8 - ands r0, r1 - cmp r0, 0 - beq _0805D9CC - cmp r5, 0x2 - bne _0805D9CC - ldr r1, =0x02020630 - ldr r0, =0x020241e4 - adds r0, r6, r0 - ldrb r2, [r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _0805D9CC - adds r0, r6, 0 - movs r1, 0x1 - bl refresh_graphics_maybe - adds r0, r6, 0 - bl sub_805E974 - movs r0, 0x1 - b _0805DA1E - .pool -_0805D9CC: - ldr r0, =0x02038436 - mov r2, r10 - strb r2, [r0] - ldr r0, =0x02038437 - mov r1, sp - ldrb r1, [r1] - strb r1, [r0] - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r0, [r0, 0x8] - strh r7, [r0] - ldr r0, =gUnknown_082C9320 - adds r1, r5, 0 - movs r2, 0 - bl move_something - ldr r0, =task0A_0803415C - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r6, [r1, 0x8] - ldr r0, [r4] - movs r2, 0x8 - ldrsh r1, [r1, r2] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0] - movs r0, 0 -_0805DA1E: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end move_anim_start_t3 - - thumb_func_start task0A_0803415C -task0A_0803415C: @ 805DA48 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x020383f8 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =0x020383fd - ldrb r0, [r0] - cmp r0, 0 - bne _0805DA8A - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - ldrsh r0, [r0, r1] - ldr r2, [r2, 0x4] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1] - movs r0, 0x21 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - adds r0, r4, 0 - bl DestroyTask -_0805DA8A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task0A_0803415C - - thumb_func_start sub_805DAA0 -sub_805DAA0: @ 805DAA0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD - bgt _0805DAB4 - cmp r0, 0xA - bge _0805DAB8 - cmp r0, 0x2 - beq _0805DAB8 - b _0805DABC -_0805DAB4: - cmp r0, 0x11 - bne _0805DABC -_0805DAB8: - movs r0, 0x1 - b _0805DABE -_0805DABC: - movs r0, 0 -_0805DABE: - pop {r1} - bx r1 - thumb_func_end sub_805DAA0 - - thumb_func_start move_anim_start_t4 -move_anim_start_t4: @ 805DAC4 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =0x02038436 - strb r1, [r0] - ldr r0, =0x02038437 - strb r2, [r0] - ldr r0, =gUnknown_082C937C - adds r1, r3, 0 - movs r2, 0 - bl move_something - ldr r0, =task0A_08034248 - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - ldr r0, =0x020244d0 - ldr r0, [r0] - movs r2, 0x8 - ldrsh r1, [r1, r2] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end move_anim_start_t4 - - thumb_func_start task0A_08034248 -task0A_08034248: @ 805DB34 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x020383f8 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =0x020383fd - ldrb r0, [r0] - cmp r0, 0 - bne _0805DB76 - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - ldrsh r0, [r0, r1] - ldr r2, [r2, 0x4] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1] - movs r0, 0x41 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - adds r0, r4, 0 - bl DestroyTask -_0805DB76: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task0A_08034248 - - thumb_func_start sub_805DB8C -sub_805DB8C: @ 805DB8C - movs r0, 0 - bx lr - thumb_func_end sub_805DB8C - - thumb_func_start mplay_80342A4 -mplay_80342A4: @ 805DB90 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r5, 0 - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - beq _0805DBD8 - ldr r2, =0x020244d0 - ldr r0, [r2] - ldr r1, [r0, 0x4] - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - adds r1, 0x1 - strb r1, [r0, 0x8] - ldr r2, [r2] - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x8] - cmp r0, 0x1D - bls _0805DBDC - ldr r0, =0x030075f0 - bl MPlayStop_rev01 - ldr r0, =0x03007630 - bl MPlayStop_rev01 -_0805DBD8: - cmp r5, 0 - beq _0805DBF0 -_0805DBDC: - movs r0, 0x1 - b _0805DC02 - .pool -_0805DBF0: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - strb r5, [r0, 0x8] - movs r0, 0 -_0805DC02: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end mplay_80342A4 - - thumb_func_start sub_805DC0C -sub_805DC0C: @ 805DC0C - 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, 24 - lsrs r1, 24 - mov r8, r1 - movs r1, 0 - bl pokemon_getattr - str r0, [sp] - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - mov r2, r8 - lsls r1, r2, 2 - adds r2, r1, r0 - ldrh r0, [r2, 0x2] - cmp r0, 0 - bne _0805DC50 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - ldr r6, [sp] - b _0805DC58 - .pool -_0805DC50: - ldrh r5, [r2, 0x2] - ldr r0, =0x020244bc - adds r0, r1, r0 - ldr r6, [r0] -_0805DC58: - adds r0, r4, 0 - movs r1, 0x1 - bl pokemon_getattr - mov r10, r0 - mov r0, r8 - bl battle_get_per_side_status - lsls r0, 24 - lsls r2, r5, 3 - ldr r1, =gMonFrontPicTable - adds r2, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - lsrs r0, 22 - adds r1, 0x4 - adds r1, r0 - ldr r1, [r1] - adds r0, r2, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack - mov r3, r8 - lsls r2, r3, 4 - movs r0, 0x80 - lsls r0, 1 - adds r7, r2, r0 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - lsls r1, r3, 2 - adds r0, r1, r0 - ldrh r0, [r0, 0x2] - str r1, [sp, 0x4] - mov r9, r2 - cmp r0, 0 - bne _0805DCBC - adds r0, r4, 0 - bl pokemon_get_pal - b _0805DCC6 - .pool -_0805DCBC: - adds r0, r5, 0 - mov r1, r10 - ldr r2, [sp] - bl species_and_otid_get_pal -_0805DCC6: - adds r6, r0, 0 - ldr r4, =0x0201c000 - adds r0, r6, 0 - adds r1, r4, 0 - bl LZDecompressWram - adds r0, r4, 0 - adds r1, r7, 0 - movs r2, 0x20 - bl gpu_pal_apply - mov r1, r9 - adds r1, 0x80 - adds r0, r4, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =0x00000181 - cmp r5, r0 - bne _0805DD1A - movs r7, 0x80 - lsls r7, 1 - add r7, r9 - ldr r5, =0x0202449c - ldr r1, [r5] - movs r4, 0x80 - lsls r4, 1 - adds r1, r4 - adds r0, r6, 0 - bl LZDecompressWram - ldr r0, =0x020244e4 - add r0, r8 - ldrb r1, [r0] - lsls r1, 5 - adds r1, r4 - ldr r0, [r5] - adds r0, r1 - adds r1, r7, 0 - movs r2, 0x20 - bl gpu_pal_apply -_0805DD1A: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - ldr r1, [sp, 0x4] - adds r0, r1, r0 - ldrh r0, [r0, 0x2] - cmp r0, 0 - beq _0805DD46 - ldr r3, =0x00007fff - adds r0, r7, 0 - movs r1, 0x10 - movs r2, 0x6 - bl pal_fade_1 - lsls r1, r7, 1 - ldr r0, =0x02037b14 - adds r0, r1, r0 - ldr r2, =0x02037714 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet -_0805DD46: - 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_805DC0C - - thumb_func_start sub_805DD7C -sub_805DD7C: @ 805DD7C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r6, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - movs r1, 0 - bl pokemon_getattr - str r0, [sp] - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - mov r2, r8 - lsls r1, r2, 2 - adds r2, r1, r0 - ldrh r0, [r2, 0x2] - cmp r0, 0 - bne _0805DDC0 - adds r0, r6, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - ldr r4, [sp] - b _0805DDC8 - .pool -_0805DDC0: - ldrh r5, [r2, 0x2] - ldr r0, =0x020244bc - adds r0, r1, r0 - ldr r4, [r0] -_0805DDC8: - adds r0, r6, 0 - movs r1, 0x1 - bl pokemon_getattr - str r0, [sp, 0x4] - mov r0, r8 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0x1 - mov r1, r8 - bl sub_80688F8 - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - lsls r1, 2 - mov r10, r1 - cmp r0, 0x1 - beq _0805DE00 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - add r0, r10 - ldrh r0, [r0, 0x2] - cmp r0, 0 - beq _0805DE2C -_0805DE00: - lsls r0, r5, 3 - ldr r1, =gMonBackPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - lsls r2, r7, 2 - adds r1, 0x4 - adds r1, r2 - ldr r1, [r1] - adds r2, r5, 0 - adds r3, r4, 0 - bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack - b _0805DE46 - .pool -_0805DE2C: - lsls r0, r5, 3 - ldr r1, =gMonBackPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - lsls r2, r7, 2 - adds r1, 0x4 - adds r1, r2 - ldr r1, [r1] - adds r2, r5, 0 - adds r3, r4, 0 - bl DecompressMonPic_DetectFrontOrBack -_0805DE46: - mov r2, r8 - lsls r1, r2, 4 - movs r0, 0x80 - lsls r0, 1 - adds r7, r1, r0 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - add r0, r10 - ldrh r0, [r0, 0x2] - mov r9, r1 - cmp r0, 0 - bne _0805DE74 - adds r0, r6, 0 - bl pokemon_get_pal - b _0805DE7E - .pool -_0805DE74: - adds r0, r5, 0 - ldr r1, [sp, 0x4] - ldr r2, [sp] - bl species_and_otid_get_pal -_0805DE7E: - adds r6, r0, 0 - ldr r4, =0x0201c000 - adds r0, r6, 0 - adds r1, r4, 0 - bl LZDecompressWram - adds r0, r4, 0 - adds r1, r7, 0 - movs r2, 0x20 - bl gpu_pal_apply - mov r1, r9 - adds r1, 0x80 - adds r0, r4, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =0x00000181 - cmp r5, r0 - bne _0805DED2 - movs r7, 0x80 - lsls r7, 1 - add r7, r9 - ldr r5, =0x0202449c - ldr r1, [r5] - movs r4, 0x80 - lsls r4, 1 - adds r1, r4 - adds r0, r6, 0 - bl LZDecompressWram - ldr r0, =0x020244e4 - add r0, r8 - ldrb r1, [r0] - lsls r1, 5 - adds r1, r4 - ldr r0, [r5] - adds r0, r1 - adds r1, r7, 0 - movs r2, 0x20 - bl gpu_pal_apply -_0805DED2: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - add r0, r10 - ldrh r0, [r0, 0x2] - cmp r0, 0 - beq _0805DEFC - ldr r3, =0x00007fff - adds r0, r7, 0 - movs r1, 0x10 - movs r2, 0x6 - bl pal_fade_1 - lsls r1, r7, 1 - ldr r0, =0x02037b14 - adds r0, r1, r0 - ldr r2, =0x02037714 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet -_0805DEFC: - 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_805DD7C - - thumb_func_start nullsub_23 -nullsub_23: @ 805DF30 - bx lr - thumb_func_end nullsub_23 - - thumb_func_start nullsub_24 -nullsub_24: @ 805DF34 - bx lr - thumb_func_end nullsub_24 - - thumb_func_start sub_805DF38 -sub_805DF38: @ 805DF38 - push {r4,lr} - adds r4, r0, 0 - adds r0, r1, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_per_side_status - lsls r0, 24 - lsls r4, 3 - ldr r2, =gTrainerFrontPicTable - adds r2, r4, r2 - ldr r1, =0x020244d4 - ldr r1, [r1] - lsrs r0, 22 - adds r1, 0x4 - adds r1, r0 - ldr r1, [r1] - adds r0, r2, 0 - movs r2, 0 - bl DecompressPicFromTable_2 - ldr r0, =gTrainerFrontPicPaletteTable - adds r4, r0 - adds r0, r4, 0 - bl LoadCompressedObjectPalette - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805DF38 - - thumb_func_start sub_805DF84 -sub_805DF84: @ 805DF84 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - lsls r5, 16 - lsrs r5, 16 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsls r5, 3 - ldr r2, =gTrainerBackPicTable - adds r2, r5, r2 - ldr r1, =0x020244d4 - ldr r1, [r1] - lsrs r0, 22 - adds r1, 0x4 - adds r1, r0 - ldr r1, [r1] - adds r0, r2, 0 - movs r2, 0 - bl DecompressPicFromTable_2 - ldr r0, =gTrainerBackPicPaletteTable - adds r5, r0 - ldr r0, [r5] - lsls r4, 20 - movs r1, 0x80 - lsls r1, 17 - adds r4, r1 - lsrs r4, 16 - adds r1, r4, 0 - movs r2, 0x20 - bl decompress_palette - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805DF84 - - thumb_func_start nullsub_25 -nullsub_25: @ 805DFE0 - bx lr - thumb_func_end nullsub_25 - - thumb_func_start sub_805DFE4 -sub_805DFE4: @ 805DFE4 - push {lr} - lsls r0, 16 - ldr r1, =gTrainerFrontPicPaletteTable - lsrs r0, 13 - adds r0, r1 - ldrh r0, [r0, 0x4] - bl FreeObjectPaletteByTag - pop {r0} - bx r0 - .pool - thumb_func_end sub_805DFE4 - - thumb_func_start sub_805DFFC -sub_805DFFC: @ 805DFFC - push {r4-r7,lr} - ldr r4, =gUnknown_0832C128 - adds r0, r4, 0 - bl LoadTaggedObjectPalette - adds r4, 0x8 - adds r0, r4, 0 - bl LoadTaggedObjectPalette - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _0805E034 - ldr r0, =gUnknown_0832C0D0 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0832C0D8 - bl LoadCompressedObjectPic - movs r5, 0x2 - b _0805E056 - .pool -_0805E034: - ldr r4, =gUnknown_0832C0E0 - adds r0, r4, 0 - bl LoadCompressedObjectPic - adds r4, 0x8 - adds r0, r4, 0 - bl LoadCompressedObjectPic - ldr r4, =gUnknown_0832C0F0 - adds r0, r4, 0 - bl LoadCompressedObjectPic - adds r4, 0x8 - adds r0, r4, 0 - bl LoadCompressedObjectPic - movs r5, 0x4 -_0805E056: - movs r4, 0 - cmp r4, r5 - bcs _0805E076 - ldr r7, =0x02024076 - ldr r6, =gUnknown_0832C108 -_0805E060: - adds r0, r4, r7 - ldrb r0, [r0] - lsls r0, 3 - adds r0, r6 - bl LoadCompressedObjectPic - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _0805E060 -_0805E076: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805DFFC - - thumb_func_start sub_805E08C -sub_805E08C: @ 805E08C - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - movs r6, 0 - cmp r4, 0 - bne _0805E09C - b _0805E1AE -_0805E09C: - cmp r4, 0x1 - bne _0805E0B8 - ldr r4, =gUnknown_0832C128 - adds r0, r4, 0 - bl LoadTaggedObjectPalette - adds r4, 0x8 - adds r0, r4, 0 - bl LoadTaggedObjectPalette - b _0805E1AE - .pool -_0805E0B8: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _0805E120 - cmp r4, 0x2 - bne _0805E0F0 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0805E0E4 - ldr r0, =gUnknown_0832C100 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E0E4: - ldr r0, =gUnknown_0832C0D0 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E0F0: - cmp r4, 0x3 - bne _0805E100 - ldr r0, =gUnknown_0832C0D8 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E100: - cmp r4, 0x4 - bne _0805E110 - ldr r0, =0x02024076 - ldrb r0, [r0] - b _0805E198 - .pool -_0805E110: - cmp r4, 0x5 - bne _0805E1AC - ldr r0, =0x02024076 - ldrb r0, [r0, 0x1] - b _0805E198 - .pool -_0805E120: - cmp r4, 0x2 - bne _0805E130 - ldr r0, =gUnknown_0832C0E0 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E130: - cmp r4, 0x3 - bne _0805E140 - ldr r0, =gUnknown_0832C0E8 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E140: - cmp r4, 0x4 - bne _0805E150 - ldr r0, =gUnknown_0832C0F0 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E150: - cmp r4, 0x5 - bne _0805E160 - ldr r0, =gUnknown_0832C0F8 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E160: - cmp r4, 0x6 - bne _0805E170 - ldr r0, =0x02024076 - ldrb r0, [r0] - b _0805E198 - .pool -_0805E170: - cmp r4, 0x7 - bne _0805E180 - ldr r0, =0x02024076 - ldrb r0, [r0, 0x1] - b _0805E198 - .pool -_0805E180: - cmp r4, 0x8 - bne _0805E190 - ldr r0, =0x02024076 - ldrb r0, [r0, 0x2] - b _0805E198 - .pool -_0805E190: - cmp r5, 0x9 - bne _0805E1AC - ldr r0, =0x02024076 - ldrb r0, [r0, 0x3] -_0805E198: - lsls r0, 3 - ldr r1, =gUnknown_0832C108 - adds r0, r1 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E1AC: - movs r6, 0x1 -_0805E1AE: - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_805E08C - - thumb_func_start load_gfxc_health_bar -load_gfxc_health_bar: @ 805E1B8 - push {lr} - ldr r0, =gUnknown_08C093F0 - ldr r1, =0x020244d4 - ldr r1, [r1] - movs r2, 0xBA - lsls r2, 1 - adds r1, r2 - ldr r1, [r1] - bl LZDecompressWram - pop {r0} - bx r0 - .pool - thumb_func_end load_gfxc_health_bar - - thumb_func_start battle_load_something -battle_load_something: @ 805E1D8 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r6, 0 - ldrb r0, [r5] - cmp r0, 0x6 - bls _0805E1E8 - b _0805E346 -_0805E1E8: - lsls r0, 2 - ldr r1, =_0805E1F8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0805E1F8: - .4byte _0805E214 - .4byte _0805E21A - .4byte _0805E324 - .4byte _0805E230 - .4byte _0805E260 - .4byte _0805E29C - .4byte _0805E33C -_0805E214: - bl sub_805E378 - b _0805E324 -_0805E21A: - ldrb r0, [r4] - bl sub_805E08C - lsls r0, 24 - cmp r0, 0 - beq _0805E228 - b _0805E320 -_0805E228: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _0805E346 -_0805E230: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0805E24C - ldrb r0, [r4] - cmp r0, 0 - bne _0805E24C - bl battle_make_oam_safari_battle - b _0805E252 - .pool -_0805E24C: - ldrb r0, [r4] - bl battle_make_oam_normal_battle -_0805E252: - ldr r2, =0x03005d70 - ldrb r1, [r4] - adds r1, r2 - strb r0, [r1] - b _0805E30E - .pool -_0805E260: - ldrb r0, [r4] - bl sub_8072B18 - ldr r0, =0x02024076 - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - cmp r0, 0x1 - bhi _0805E288 - ldr r0, =0x03005d70 - adds r0, r1, r0 - ldrb r0, [r0] - movs r1, 0 - bl nullsub_30 - b _0805E30E - .pool -_0805E288: - ldr r0, =0x03005d70 - adds r0, r1, r0 - ldrb r0, [r0] - movs r1, 0x1 - bl nullsub_30 - b _0805E30E - .pool -_0805E29C: - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0805E2E4 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0805E302 - ldr r0, =0x03005d70 - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe - b _0805E302 - .pool -_0805E2E4: - ldr r0, =0x03005d70 - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe -_0805E302: - ldr r1, =0x03005d70 - ldrb r0, [r4] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 -_0805E30E: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =0x0202406c - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bne _0805E346 -_0805E320: - movs r0, 0 - strb r0, [r4] -_0805E324: - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - b _0805E346 - .pool -_0805E33C: - bl sub_805EC84 - bl sub_81B8C68 - movs r6, 0x1 -_0805E346: - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end battle_load_something - - thumb_func_start sub_805E350 -sub_805E350: @ 805E350 - push {r4,lr} - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r0, [r0, 0x4] - movs r1, 0 - movs r2, 0x30 - bl memset - ldr r0, [r4] - ldr r0, [r0, 0x8] - movs r1, 0 - movs r2, 0x10 - bl memset - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805E350 - - thumb_func_start sub_805E378 -sub_805E378: @ 805E378 - push {lr} - bl sub_805E350 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - movs r1, 0 - movs r2, 0x10 - bl memset - pop {r0} - bx r0 - .pool - thumb_func_end sub_805E378 - - thumb_func_start sub_805E394 -sub_805E394: @ 805E394 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r4, 0 - ldr r5, =0x0202406c - ldrb r0, [r5] - cmp r4, r0 - bge _0805E3EA - ldr r0, =0x02020630 - mov r9, r0 - movs r0, 0x1 - mov r12, r0 - movs r0, 0x2 - negs r0, r0 - mov r8, r0 - ldr r7, =0x020244d0 - ldr r6, =0x020241e4 -_0805E3B8: - ldr r0, [r7] - ldr r0, [r0] - lsls r3, r4, 2 - adds r3, r0 - adds r0, r4, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - adds r0, 0x3E - ldrb r1, [r0] - lsls r1, 29 - lsrs r1, 31 - mov r0, r12 - ands r1, r0 - ldrb r2, [r3] - mov r0, r8 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - adds r4, 0x1 - ldrb r0, [r5] - cmp r4, r0 - blt _0805E3B8 -_0805E3EA: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805E394 - - thumb_func_start sub_805E408 -sub_805E408: @ 805E408 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020244d0 - ldr r1, [r1] - ldr r1, [r1] - lsls r3, r0, 2 - adds r3, r1 - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - lsls r1, 29 - lsrs r1, 31 - ldrb r2, [r3] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - bx lr - .pool - thumb_func_end sub_805E408 - - thumb_func_start sub_805E448 -sub_805E448: @ 805E448 - 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 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - lsls r2, 24 - cmp r2, 0 - beq _0805E51C - ldr r0, =0x020241e4 - adds r5, r7, r0 - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - mov r8, r1 - add r0, r8 - ldr r4, =0x020244d0 - ldr r1, [r4] - ldr r1, [r1, 0x8] - ldrb r1, [r1] - bl StartObjectImageAnim - lsls r0, r7, 20 - movs r2, 0x80 - lsls r2, 17 - adds r0, r2 - lsrs r6, r0, 16 - ldr r2, =0x0202449c - ldr r0, [r4] - ldr r0, [r0, 0x8] - ldrh r1, [r0] - lsls r1, 5 - movs r3, 0x80 - lsls r3, 1 - adds r1, r3 - ldr r0, [r2] - adds r0, r1 - adds r1, r6, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =0x020244e4 - adds r1, r7, r1 - ldr r0, [r4] - ldr r0, [r0, 0x8] - ldrh r0, [r0] - strb r0, [r1] - ldr r0, [r4] - ldr r1, [r0] - lsls r0, r7, 2 - adds r0, r1 - ldrh r0, [r0, 0x2] - cmp r0, 0 - beq _0805E4DE - ldr r3, =0x00007fff - adds r0, r6, 0 - movs r1, 0x10 - movs r2, 0x6 - bl pal_fade_1 - lsls r1, r6, 1 - ldr r0, =0x02037b14 - adds r0, r1, r0 - ldr r2, =0x02037714 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet -_0805E4DE: - adds r0, r7, 0 - bl sub_80A6138 - ldrb r2, [r5] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x22] - b _0805E77A - .pool -_0805E51C: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0805E558 - movs r0, 0 - mov r10, r0 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0x18] - ldrh r1, [r2, 0x2] - mov r8, r1 - ldr r3, [r2, 0x8] - mov r9, r3 - ldr r4, [r2, 0xC] - lsls r0, r1, 3 - ldr r1, =gMonBackPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - ldr r1, [r1, 0x4] - ldr r3, [r2, 0x10] - b _0805E5FA - .pool -_0805E558: - adds r0, r7, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r0, [sp] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0805E58C - ldr r1, =0x0202406e - ldr r2, [sp] - lsls r0, r2, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - b _0805E59C - .pool -_0805E58C: - ldr r1, =0x0202406e - ldr r3, [sp] - lsls r0, r3, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec -_0805E59C: - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - adds r0, r7, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0805E618 - ldr r0, =0x0202406e - lsls r4, r7, 1 - adds r4, r0 - ldrh r0, [r4] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - movs r1, 0 - bl pokemon_getattr - mov r9, r0 - ldrh r0, [r4] - muls r0, r6 - adds r0, r5 - movs r1, 0x1 - bl pokemon_getattr - adds r4, r0, 0 - mov r1, r8 - lsls r0, r1, 3 - ldr r1, =gMonBackPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - mov r3, r10 - lsls r2, r3, 2 - adds r1, 0x4 - adds r1, r2 - ldr r1, [r1] - ldr r3, =0x020244bc - lsls r2, r7, 2 - adds r2, r3 - ldr r3, [r2] -_0805E5FA: - mov r2, r8 - bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack - b _0805E662 - .pool -_0805E618: - ldr r0, =0x0202406e - lsls r4, r7, 1 - adds r4, r0 - ldrh r0, [r4] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x02024744 - adds r0, r5 - movs r1, 0 - bl pokemon_getattr - mov r9, r0 - ldrh r0, [r4] - muls r0, r6 - adds r0, r5 - movs r1, 0x1 - bl pokemon_getattr - adds r4, r0, 0 - mov r1, r8 - lsls r0, r1, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - mov r3, r10 - lsls r2, r3, 2 - adds r1, 0x4 - adds r1, r2 - ldr r1, [r1] - ldr r3, =0x020244bc - lsls r2, r7, 2 - adds r2, r3 - ldr r3, [r2] - mov r2, r8 - bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack -_0805E662: - ldr r0, =0x020244d4 - ldr r0, [r0] - mov r2, r10 - lsls r1, r2, 2 - adds r0, 0x4 - adds r0, r1 - ldr r2, [r0] - ldr r0, =0x020241e4 - adds r0, r7 - mov r10, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r3, =0x02020630 - adds r0, r3 - ldrh r0, [r0, 0x4] - lsls r0, 22 - lsrs r0, 17 - ldr r1, =0x06010000 - adds r0, r1 - ldr r1, =0x040000d4 - str r2, [r1] - str r0, [r1, 0x4] - ldr r0, =0x84000200 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - lsls r0, r7, 20 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r6, r0, 16 - mov r0, r8 - adds r1, r4, 0 - mov r2, r9 - bl species_and_otid_get_pal - mov r9, r0 - ldr r4, =0x0201c000 - adds r1, r4, 0 - bl LZDecompressWram - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =0x00000181 - cmp r8, r0 - bne _0805E70A - mov r2, r10 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r1, 0x8 - adds r0, r1 - ldr r1, =gUnknown_08309AAC - mov r3, r8 - lsls r2, r3, 2 - adds r1, r2 - ldr r1, [r1] - str r1, [r0] - ldr r5, =0x0202449c - ldr r1, [r5] - movs r4, 0x80 - lsls r4, 1 - adds r1, r4 - mov r0, r9 - bl LZDecompressWram - ldr r0, =0x020244e4 - ldr r1, [sp] - adds r0, r1, r0 - ldrb r1, [r0] - lsls r1, 5 - adds r1, r4 - ldr r0, [r5] - adds r0, r1 - adds r1, r6, 0 - movs r2, 0x20 - bl gpu_pal_apply -_0805E70A: - ldr r3, =0x00007fff - adds r0, r6, 0 - movs r1, 0x10 - movs r2, 0x6 - bl pal_fade_1 - lsls r1, r6, 1 - ldr r0, =0x02037b14 - adds r0, r1, r0 - ldr r2, =0x02037714 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0805E74A - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r7, 2 - adds r0, r1 - mov r2, r8 - strh r2, [r0, 0x2] - ldr r0, =0x020244e4 - adds r1, r7, r0 - ldr r3, [sp] - adds r0, r3, r0 - ldrb r0, [r0] - strb r0, [r1] -_0805E74A: - adds r0, r7, 0 - bl sub_80A6138 - mov r1, r10 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - ldr r2, =0x02020630 - adds r1, r2 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x22] - mov r3, r10 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x020244e4 - adds r1, r7, r1 - ldrb r1, [r1] - bl StartObjectImageAnim -_0805E77A: - 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_805E448 - - thumb_func_start sub_805E7DC -sub_805E7DC: @ 805E7DC - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - lsls r1, 24 - cmp r1, 0 - bne _0805E898 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0805E7F8 - movs r4, 0 - b _0805E802 -_0805E7F8: - adds r0, r4, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r4, r0, 24 -_0805E802: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0805E814 - ldr r0, =gUnknown_08C2D120 - b _0805E822 - .pool -_0805E814: - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0805E83C - ldr r0, =gUnknown_08C2CEE0 -_0805E822: - ldr r1, =0x020244d4 - ldr r1, [r1] - lsls r4, 2 - adds r1, 0x4 - adds r1, r4 - ldr r1, [r1] - bl LZDecompressVram - b _0805E84E - .pool -_0805E83C: - ldr r0, =gUnknown_08C2D120 - ldr r1, =0x020244d4 - ldr r1, [r1] - lsls r4, 2 - adds r1, 0x4 - adds r1, r4 - ldr r1, [r1] - bl LZDecompressVram -_0805E84E: - movs r3, 0x1 - lsls r6, r5, 4 - ldr r7, =gUnknown_08C2CEBC - ldr r0, =0x020244d4 - ldr r0, [r0] - adds r0, 0x4 - adds r4, r0, r4 - ldr r2, =0x040000d4 - ldr r5, =0x84000200 -_0805E860: - ldr r0, [r4] - lsls r1, r3, 11 - adds r1, r0, r1 - str r0, [r2] - str r1, [r2, 0x4] - str r5, [r2, 0x8] - ldr r0, [r2, 0x8] - adds r3, 0x1 - cmp r3, 0x3 - ble _0805E860 - movs r0, 0x80 - lsls r0, 1 - adds r1, r6, r0 - adds r0, r7, 0 - movs r2, 0x20 - bl decompress_palette - b _0805E8E6 - .pool -_0805E898: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0805E8E6 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0805E8D0 - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - adds r1, r4, 0 - bl sub_805DC0C - b _0805E8E6 - .pool -_0805E8D0: - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - adds r1, r5, 0 - bl sub_805DD7C -_0805E8E6: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805E7DC - - thumb_func_start refresh_graphics_maybe -refresh_graphics_maybe: @ 805E8F4 - push {r4-r6,lr} - adds r5, r1, 0 - adds r4, r2, 0 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_805E7DC - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =0x02020630 - adds r4, r0, r1 - ldr r0, =0x020244e4 - adds r0, r6, r0 - ldrb r1, [r0] - adds r0, r4, 0 - bl StartObjectImageAnim - cmp r5, 0 - bne _0805E938 - adds r0, r6, 0 - bl sub_80A614C - b _0805E93E - .pool -_0805E938: - adds r0, r6, 0 - bl sub_80A6138 -_0805E93E: - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end refresh_graphics_maybe - - thumb_func_start sub_805E94C -sub_805E94C: @ 805E94C - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0xA4 - bne _0805E96C - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - lsls r1, r2, 2 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] -_0805E96C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805E94C - - thumb_func_start sub_805E974 -sub_805E974: @ 805E974 - lsls r0, 24 - ldr r1, =0x020244d0 - ldr r1, [r1] - ldr r1, [r1] - lsrs r0, 22 - adds r0, r1 - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_805E974 - - thumb_func_start sub_805E990 -sub_805E990: @ 805E990 - push {r4-r7,lr} - adds r5, r0, 0 - lsls r1, 24 - lsrs r6, r1, 24 - adds r7, r6, 0 - movs r1, 0x39 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x3A - bl pokemon_getattr - adds r1, r0, 0 - lsls r4, 16 - asrs r4, 16 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl sub_8075060 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0805EA08 - ldr r7, =0x020244d0 - ldr r0, [r7] - ldr r2, [r0] - lsls r4, r6, 2 - adds r0, r4, r2 - ldrb r1, [r0] - movs r5, 0x2 - movs r3, 0x2 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _0805EA5A - adds r0, r6, 0 - eors r0, r5 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _0805E9F6 - movs r0, 0x5A - bl audio_play -_0805E9F6: - ldr r0, [r7] - ldr r1, [r0] - adds r1, r4, r1 - ldrb r0, [r1] - orrs r0, r5 - strb r0, [r1] - b _0805EA5A - .pool -_0805EA08: - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r0, [r0] - lsls r1, r6, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _0805EA34 - movs r0, 0x5A - bl m4aSongNumStop - b _0805EA5A - .pool -_0805EA34: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0805EA5A - ldr r1, [r4] - movs r0, 0x2 - eors r7, r0 - ldr r1, [r1] - lsls r0, r7, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0805EA5A - movs r0, 0x5A - bl m4aSongNumStop -_0805EA5A: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_805E990 - - thumb_func_start sub_805EA60 -sub_805EA60: @ 805EA60 - push {r4-r6,lr} - movs r0, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =0x020244d0 - ldr r0, [r5] - ldr r0, [r0] - lsls r1, r4, 2 - adds r1, r0 - ldrb r2, [r1] - movs r6, 0x3 - negs r6, r6 - adds r0, r6, 0 - ands r0, r2 - strb r0, [r1] - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0805EAA2 - ldr r2, [r5] - movs r0, 0x2 - adds r1, r4, 0 - eors r1, r0 - ldr r0, [r2] - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - adds r0, r6, 0 - ands r0, r2 - strb r0, [r1] -_0805EAA2: - movs r0, 0x5A - bl m4aSongNumStop - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805EA60 - - thumb_func_start sub_805EAB4 -sub_805EAB4: @ 805EAB4 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x39 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x3A - bl pokemon_getattr - adds r1, r0, 0 - lsls r4, 16 - asrs r4, 16 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl sub_8075060 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_805EAB4 - - thumb_func_start sub_805EAE8 -sub_805EAE8: @ 805EAE8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0805EB7E - movs r0, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r0, 0x2 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r5, =0x0202406e - mov r1, r8 - lsls r0, r1, 1 - adds r0, r5 - ldrb r0, [r0] - bl pokemon_order_func - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - mov r1, r9 - lsls r0, r1, 1 - adds r0, r5 - ldrb r0, [r0] - bl pokemon_order_func - lsls r0, 24 - lsrs r5, r0, 24 - movs r7, 0x64 - adds r0, r4, 0 - muls r0, r7 - ldr r6, =0x020244ec - adds r4, r0, r6 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _0805EB5A - adds r0, r4, 0 - mov r1, r8 - bl sub_805E990 -_0805EB5A: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0805EB7E - adds r0, r5, 0 - muls r0, r7 - adds r4, r0, r6 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _0805EB7E - adds r0, r4, 0 - mov r1, r9 - bl sub_805E990 -_0805EB7E: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805EAE8 - - thumb_func_start sub_805EB9C -sub_805EB9C: @ 805EB9C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - bge _0805EC6C - movs r0, 0x3 - mov r10, r8 - mov r1, r10 - ands r1, r0 - mov r10, r1 - movs r6, 0 - movs r2, 0x3F - negs r2, r2 - mov r9, r2 -_0805EBC8: - lsls r0, r5, 24 - lsrs r0, 24 - bl sub_80A6A90 - lsls r0, 24 - cmp r0, 0 - beq _0805EC60 - ldr r4, =0x02020630 - ldr r0, =0x020241e4 - adds r3, r5, r0 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x1] - movs r7, 0x4 - negs r7, r7 - adds r2, r7, 0 - ands r1, r2 - mov r2, r10 - orrs r1, r2 - strb r1, [r0, 0x1] - mov r7, r8 - cmp r7, 0 - bne _0805EC3C - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r2, [r0, 0x4] - adds r2, r6, r2 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - strb r0, [r2, 0x6] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x3] - mov r2, r9 - ands r1, r2 - strb r1, [r0, 0x3] - b _0805EC60 - .pool -_0805EC3C: - ldrb r0, [r3] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r4 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - adds r0, r6, r0 - ldrb r1, [r0, 0x6] - movs r0, 0x1F - ands r1, r0 - lsls r1, 1 - ldrb r0, [r2, 0x3] - mov r3, r9 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x3] -_0805EC60: - adds r6, 0xC - adds r5, 0x1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - blt _0805EBC8 -_0805EC6C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805EB9C - - thumb_func_start sub_805EC84 -sub_805EC84: @ 805EC84 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =gUnknown_0831C6A0 - bl LoadCompressedObjectPic - movs r0, 0x1 - bl battle_get_side_with_given_state - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0831C6B0 - mov r8, r0 - adds r0, r5, 0 - movs r1, 0 - bl sub_80A5C6C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A5C6C - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 8 - movs r0, 0xE8 - lsls r0, 13 - adds r2, r0 - asrs r2, 16 - mov r0, r8 - adds r1, r4, 0 - movs r3, 0xC8 - bl AddObjectToFront - ldr r6, =0x020244d0 - ldr r1, [r6] - ldr r2, [r1, 0x4] - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - adds r2, r1, r2 - strb r0, [r2, 0x7] - ldr r7, =0x02020630 - ldr r0, [r6] - ldr r0, [r0, 0x4] - adds r1, r0 - ldrb r1, [r1, 0x7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r5, [r0, 0x2E] - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0805ED56 - movs r0, 0x3 - bl battle_get_side_with_given_state - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r5, 0 - movs r1, 0 - bl sub_80A5C6C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A5C6C - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 8 - movs r0, 0xE8 - lsls r0, 13 - adds r2, r0 - asrs r2, 16 - mov r0, r8 - adds r1, r4, 0 - movs r3, 0xC8 - bl AddObjectToFront - ldr r1, [r6] - ldr r2, [r1, 0x4] - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - adds r2, r1, r2 - strb r0, [r2, 0x7] - ldr r0, [r6] - ldr r0, [r0, 0x4] - adds r1, r0 - ldrb r1, [r1, 0x7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r5, [r0, 0x2E] -_0805ED56: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805EC84 - - thumb_func_start sub_805ED70 -@ int sub_805ED70(obj *a1) -sub_805ED70: @ 805ED70 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - movs r0, 0 - mov r8, r0 - ldrh r0, [r5, 0x2E] - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x020241e4 - adds r0, r4, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r7, r0, r1 - adds r6, r7, 0 - adds r6, 0x3E - ldrb r1, [r6] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0805EDAC - adds r0, r4, 0 - bl sub_80A6A90 - lsls r0, 24 - cmp r0, 0 - bne _0805EDC0 -_0805EDAC: - ldr r0, =sub_805EE48 - str r0, [r5, 0x1C] - b _0805EE36 - .pool -_0805EDC0: - ldr r0, =0x020383fd - ldrb r0, [r0] - cmp r0, 0 - bne _0805EDD2 - ldrb r1, [r6] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0805EDE4 -_0805EDD2: - movs r0, 0x1 - mov r8, r0 - ldr r2, =0x020244d0 - lsls r4, 2 - b _0805EE06 - .pool -_0805EDE4: - ldr r2, =0x020244d0 - ldr r0, [r2] - ldr r0, [r0] - lsls r1, r4, 2 - adds r3, r1, r0 - ldrh r0, [r3, 0x2] - adds r4, r1, 0 - cmp r0, 0 - beq _0805EE06 - ldr r0, =gUnknown_08305DCC - ldrh r1, [r3, 0x2] - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - bne _0805EE06 - movs r0, 0x1 - mov r8, r0 -_0805EE06: - ldr r0, [r2] - ldr r0, [r0] - adds r0, r4, r0 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0805EE1A - movs r0, 0x1 - mov r8, r0 -_0805EE1A: - ldrh r0, [r7, 0x20] - strh r0, [r5, 0x20] - ldrh r0, [r7, 0x24] - strh r0, [r5, 0x24] - adds r2, r5, 0 - adds r2, 0x3E - mov r0, r8 - lsls r3, r0, 2 - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - orrs r0, r3 - strb r0, [r2] -_0805EE36: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805ED70 - - thumb_func_start sub_805EE48 -sub_805EE48: @ 805EE48 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - bx lr - thumb_func_end sub_805EE48 - - thumb_func_start sub_805EE54 -sub_805EE54: @ 805EE54 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - lsls r1, 16 - lsrs r5, r1, 16 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0805EED0 - ldr r0, =0x020244d0 - ldr r3, [r0] - ldr r1, [r3] - lsls r0, r4, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - beq _0805EE7E - adds r5, r0, 0 -_0805EE7E: - ldr r0, =gUnknown_08305DCC - adds r0, r5, r0 - ldrb r0, [r0] - cmp r0, 0 - beq _0805EEB4 - ldr r2, =0x02020630 - ldr r1, [r3, 0x4] - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_805ED70 - b _0805EECE - .pool -_0805EEB4: - ldr r2, =0x02020630 - ldr r1, [r3, 0x4] - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_805EE48 -_0805EECE: - str r1, [r0] -_0805EED0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805EE54 - - thumb_func_start sub_805EEE0 -sub_805EEE0: @ 805EEE0 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - ldr r1, =0x020244d0 - ldr r1, [r1] - ldr r3, [r1, 0x4] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r1, [r1, 0x7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_805EE48 - str r1, [r0] - bx lr - .pool - thumb_func_end sub_805EEE0 - - thumb_func_start sub_805EF14 -sub_805EF14: @ 805EF14 - push {r4-r6,lr} - ldr r3, =0x06000240 - movs r0, 0 - movs r6, 0xF0 - lsls r6, 8 -_0805EF1E: - adds r5, r0, 0x1 - movs r4, 0xF -_0805EF22: - ldrh r1, [r3] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _0805EF32 - adds r0, r6, 0 - orrs r0, r1 - strh r0, [r3] -_0805EF32: - ldrh r1, [r3] - movs r2, 0xF0 - lsls r2, 4 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _0805EF46 - adds r0, r2, 0 - orrs r0, r1 - strh r0, [r3] -_0805EF46: - ldrh r1, [r3] - movs r2, 0xF0 - movs r0, 0xF0 - ands r0, r1 - cmp r0, 0 - bne _0805EF58 - adds r0, r1, 0 - orrs r0, r2 - strh r0, [r3] -_0805EF58: - ldrh r1, [r3] - movs r2, 0xF - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - bne _0805EF6A - adds r0, r1, 0 - orrs r0, r2 - strh r0, [r3] -_0805EF6A: - adds r3, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _0805EF22 - adds r0, r5, 0 - cmp r0, 0x8 - ble _0805EF1E - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805EF14 - - thumb_func_start sub_805EF84 -sub_805EF84: @ 805EF84 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r2, [r0] - lsls r0, r4, 2 - adds r0, r2 - movs r3, 0 - movs r2, 0 - strh r2, [r0, 0x2] - ldr r0, =0x020244e4 - adds r0, r4, r0 - strb r3, [r0] - cmp r1, 0 - bne _0805EFAC - adds r0, r4, 0 - bl sub_805E974 -_0805EFAC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805EF84 - - thumb_func_start init_uns_table_pokemon_copy -init_uns_table_pokemon_copy: @ 805EFBC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r6, 0 - ldr r4, =0x020244d4 - str r6, [r4] - movs r0, 0xC0 - lsls r0, 1 - bl AllocZeroed - str r0, [r4] - movs r0, 0x80 - lsls r0, 8 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1] -_0805EFE2: - ldr r0, =0x020244d4 - ldr r1, [r0] - lsls r4, r6, 2 - adds r2, r1, 0x4 - adds r2, r4 - lsls r3, r6, 13 - ldr r0, [r1] - adds r0, r3 - str r0, [r2] - lsls r3, r6, 1 - adds r0, r3, r6 - lsls r0, 3 - adds r1, r0, r1 - ldr r2, =gUnknown_08329D98 - adds r1, 0x14 - adds r0, r2 - ldm r0!, {r2,r5,r7} - stm r1!, {r2,r5,r7} - ldm r0!, {r2,r5,r7} - stm r1!, {r2,r5,r7} - movs r5, 0 - mov r9, r3 - lsls r0, r6, 5 - mov r8, r0 - adds r1, r6, 0x1 - mov r10, r1 - mov r12, r8 - adds r7, r4, 0 -_0805F01A: - ldr r2, =0x020244d4 - ldr r1, [r2] - lsls r4, r5, 3 - add r4, r12 - adds r3, r1, 0 - adds r3, 0x74 - adds r3, r4 - adds r0, r1, 0x4 - adds r0, r7 - lsls r2, r5, 11 - ldr r0, [r0] - adds r0, r2 - str r0, [r3] - adds r1, r4 - adds r1, 0x78 - movs r0, 0x80 - lsls r0, 4 - strh r0, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _0805F01A - ldr r1, =0x020244d4 - ldr r2, [r1] - mov r5, r9 - adds r0, r5, r6 - lsls r0, 3 - adds r1, r2, 0 - adds r1, 0x20 - adds r1, r0 - mov r0, r8 - adds r0, 0x74 - adds r2, r0 - str r2, [r1] - mov r7, r10 - lsls r0, r7, 24 - lsrs r6, r0, 24 - cmp r6, 0x3 - bls _0805EFE2 - movs r0, 0x80 - lsls r0, 5 - bl AllocZeroed - ldr r1, =0x020244d4 - ldr r1, [r1] - movs r2, 0xBA - lsls r2, 1 - adds r1, r2 - str r0, [r1] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end init_uns_table_pokemon_copy - - thumb_func_start sub_805F094 -sub_805F094: @ 805F094 - push {r4-r6,lr} - ldr r6, =0x020244d4 - ldr r0, [r6] - cmp r0, 0 - beq _0805F106 - movs r1, 0xBE - lsls r1, 1 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - beq _0805F0BA - bl Free - ldr r0, [r6] - movs r1, 0xBE - lsls r1, 1 - adds r0, r1 - movs r1, 0 - str r1, [r0] -_0805F0BA: - ldr r0, [r6] - movs r1, 0xBC - lsls r1, 1 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - beq _0805F0D8 - bl Free - ldr r0, [r6] - movs r1, 0xBC - lsls r1, 1 - adds r0, r1 - movs r1, 0 - str r1, [r0] -_0805F0D8: - ldr r0, [r6] - movs r5, 0xBA - lsls r5, 1 - adds r0, r5 - ldr r0, [r0] - bl Free - ldr r0, [r6] - adds r5, r0, r5 - movs r4, 0 - str r4, [r5] - ldr r0, [r0] - bl Free - ldr r0, [r6] - str r4, [r0] - str r4, [r0, 0x4] - str r4, [r0, 0x8] - str r4, [r0, 0xC] - str r4, [r0, 0x10] - bl Free - str r4, [r6] -_0805F106: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805F094 - - thumb_func_start sub_805F110 -sub_805F110: @ 805F110 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x37 - bl pokemon_getattr - ldr r1, =0x00000fff - ands r1, r0 - cmp r1, 0 - bne _0805F158 - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x3A - bl pokemon_getattr - adds r1, r0, 0 - lsls r4, 16 - asrs r4, 16 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl sub_8075060 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - ble _0805F158 - movs r0, 0x1 - b _0805F15A - .pool -_0805F158: - movs r0, 0 -_0805F15A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_805F110 - - thumb_func_start nullsub_26 -nullsub_26: @ 805F160 - bx lr - thumb_func_end nullsub_26 - - thumb_func_start sub_805F164 -sub_805F164: @ 805F164 - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_exec_buffer_A_ch0_tbl7 - str r1, [r0] - bx lr - .pool - thumb_func_end sub_805F164 - - thumb_func_start bx_exec_buffer_A_ch0_tbl7 -bx_exec_buffer_A_ch0_tbl7: @ 805F180 - push {lr} - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldr r0, =0x02024064 - ldrb r3, [r0] - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _0805F1CC - ldr r0, =0x02023064 - lsls r1, r3, 9 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x38 - bhi _0805F1C8 - ldr r0, =gUnknown_0831C6C8 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 - b _0805F1CC - .pool -_0805F1C8: - bl dp01_tbl7_exec_completed -_0805F1CC: - pop {r0} - bx r0 - thumb_func_end bx_exec_buffer_A_ch0_tbl7 - - thumb_func_start sub_805F1D0 -sub_805F1D0: @ 805F1D0 - push {lr} - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - 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, =DummyObjectCallback - cmp r1, r0 - bne _0805F1F4 - bl dp01_tbl7_exec_completed -_0805F1F4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805F1D0 - - thumb_func_start sub_805F208 -sub_805F208: @ 805F208 - push {lr} - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - 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, =DummyObjectCallback - cmp r1, r0 - bne _0805F22C - bl dp01_tbl7_exec_completed -_0805F22C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805F208 - - thumb_func_start sub_805F240 -sub_805F240: @ 805F240 - push {r4-r6,lr} - ldr r5, =0x02020630 - ldr r6, =0x020241e4 - ldr r4, =0x02024064 - 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, =DummyObjectCallback - cmp r1, r0 - bne _0805F292 - 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 obj_free_rotscale_entry - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - bl dp01_tbl7_exec_completed -_0805F292: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805F240 - - thumb_func_start sub_805F2A8 -sub_805F2A8: @ 805F2A8 - push {r4,lr} - ldr r4, =0x020244d0 - ldr r1, [r4] - ldr r3, =0x02024064 - 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 _0805F2E0 - 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 dp01_tbl7_exec_completed -_0805F2E0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805F2A8 - - thumb_func_start sub_805F2F0 -sub_805F2F0: @ 805F2F0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r0, 0 - mov r10, r0 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0805F32C - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0805F31E - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0805F32C -_0805F31E: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0805F368 -_0805F32C: - ldr r2, =0x02020630 - ldr r1, =0x03005d70 - ldr r3, =0x02024064 - ldrb r0, [r3] - 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, =DummyObjectCallback - cmp r1, r0 - bne _0805F34E - movs r1, 0x1 - mov r10, r1 -_0805F34E: - movs r6, 0 - b _0805F3A2 - .pool -_0805F368: - ldr r3, =0x02020630 - ldr r6, =0x03005d70 - ldr r2, =0x02024064 - ldrb r4, [r2] - adds r0, r4, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, 0x1C - adds r0, r3 - ldr r5, [r0] - ldr r0, =DummyObjectCallback - cmp r5, r0 - bne _0805F3A0 - movs r0, 0x2 - eors r4, r0 - adds r0, r4, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - cmp r0, r5 - bne _0805F3A0 - movs r0, 0x1 - mov r10, r0 -_0805F3A0: - movs r6, 0x1 -_0805F3A2: - ldr r3, =0x020244d8 - ldr r1, =0x020244d0 - mov r8, r1 - ldr r2, [r1] - ldr r7, =0x02024064 - ldrb r1, [r7] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r5, [r2, 0x4] - adds r0, r5, r0 - str r0, [r3] - ldr r2, =0x020244dc - ldrb r0, [r7] - movs r1, 0x2 - mov r9, r1 - mov r1, r9 - eors r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r5, r0 - str r0, [r2] - mov r0, r10 - cmp r0, 0 - bne _0805F3D8 - b _0805F53C -_0805F3D8: - cmp r6, 0x1 - bne _0805F494 - ldrb r2, [r7] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r4, r0, r5 - ldrb r1, [r4, 0x1] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _0805F3F2 - b _0805F53C -_0805F3F2: - mov r0, r9 - eors r0, r2 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x1] - ands r6, r0 - cmp r6, 0 - bne _0805F408 - b _0805F53C -_0805F408: - ldrb r1, [r4] - movs r3, 0x7F - adds r0, r3, 0 - ands r0, r1 - strb r0, [r4] - mov r1, r8 - ldr r0, [r1] - 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 r4, 0x2 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - strb r0, [r1, 0x1] - mov r0, r8 - ldr r2, [r0] - ldrb r0, [r7] - mov r1, r9 - 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, r8 - ldr r2, [r1] - ldrb r0, [r7] - mov r1, r9 - 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 FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - b _0805F51A - .pool -_0805F494: - ldrb r2, [r7] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r5 - ldrb r1, [r0, 0x1] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0805F53C - adds r0, r2, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _0805F4E4 - mov r0, r8 - ldr r2, [r0] - ldrb r0, [r7] - mov r1, r9 - eors r1, r0 - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0] - movs r0, 0xC0 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - bne _0805F53C - ldr r4, =0x000027f9 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag -_0805F4E4: - mov r1, r8 - ldr r0, [r1] - ldr r1, =0x02024064 - ldrb r2, [r1] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x7F - ands r0, r2 - strb r0, [r1] - mov r1, r8 - ldr r0, [r1] - ldr r1, =0x02024064 - ldrb r2, [r1] - 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] -_0805F51A: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r3, =0x02024064 - 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, =0x03005d60 - ldrb r0, [r3] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805F2A8 - str r1, [r0] -_0805F53C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805F2F0 - - thumb_func_start sub_805F560 -sub_805F560: @ 805F560 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r0, 0 - str r0, [sp] - mov r10, r0 - ldr r5, =0x020244d0 - ldr r0, [r5] - ldr r4, =0x02024064 - ldrb r2, [r4] - ldr r1, [r0, 0x4] - lsls r3, r2, 1 - adds r0, r3, r2 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0] - movs r6, 0xC4 - lsls r6, 1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _0805F5A6 - ldr r0, =0x0202406e - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_0805F5A6: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x00008040 - ands r0, r1 - cmp r0, 0 - bne _0805F5EE - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0805F5EE - 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 - ldrh r1, [r0] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _0805F5EE - ldr r0, =0x0202406e - adds r0, r2, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - adds r1, r0 - adds r0, r3, 0 - bl sub_8172EF0 -_0805F5EE: - ldr r2, =0x020244d0 - ldr r0, [r2] - ldr r1, =0x02024064 - mov r8, r1 - ldrb r4, [r1] - ldr r5, [r0, 0x4] - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r3, r0, r5 - ldrb r1, [r3] - movs r6, 0x8 - adds r0, r6, 0 - ands r0, r1 - mov r9, r2 - cmp r0, 0 - bne _0805F6D0 - movs r7, 0x2 - adds r1, r7, 0 - eors r1, r4 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r1, [r0] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _0805F6D0 - ldrb r1, [r3, 0x1] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0805F6B4 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0805F684 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0805F684 - ldr r4, =0x03005d70 - mov r1, r8 - ldrb r0, [r1] - adds r1, r7, 0 - eors r1, r0 - adds r0, r1, r4 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe - mov r1, r8 - ldrb r0, [r1] - eors r0, r7 - bl sub_8076918 - mov r1, r8 - ldrb r0, [r1] - eors r0, r7 - adds r0, r4 - ldrb r0, [r0] - bl sub_80729D0 -_0805F684: - ldr r5, =0x03005d70 - ldr r4, =0x02024064 - ldrb r1, [r4] - adds r0, r1, r5 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - 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 -_0805F6B4: - ldr r3, =0x020244d0 - ldr r2, [r3] - ldr r0, =0x02024064 - 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] - mov r9, r3 -_0805F6D0: - mov r1, r9 - ldr r0, [r1] - ldr r4, =0x02024064 - 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 _0805F792 - 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 _0805F792 - bl sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - bne _0805F792 - mov r1, r9 - ldr r0, [r1] - ldrb r4, [r4] - ldr r1, [r0, 0x4] - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x1] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _0805F774 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x42 - ands r0, r1 - cmp r0, 0x42 - bne _0805F768 - adds r0, r4, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0805F774 - ldr r0, =0x03007420 - bl m4aMPlayContinue - b _0805F774 - .pool -_0805F768: - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl -_0805F774: - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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 - str r0, [sp] -_0805F792: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0805F7B2 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0805F810 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0805F810 -_0805F7B2: - ldr r2, =0x02020630 - ldr r0, =0x03005d7c - ldr r1, =0x02024064 - 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, =DummyObjectCallback - cmp r3, r0 - bne _0805F86E - ldr r0, =0x020241e4 - 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 _0805F86E - movs r1, 0x1 - mov r10, r1 - b _0805F86E - .pool -_0805F810: - ldr r2, =0x02020630 - ldr r7, =0x03005d7c - ldr r0, =0x02024064 - 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, =DummyObjectCallback - cmp r4, r0 - bne _0805F86E - ldr r6, =0x020241e4 - 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 _0805F86E - 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 _0805F86E - 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 _0805F86E - movs r0, 0x1 - mov r10, r0 -_0805F86E: - ldr r1, [sp] - cmp r1, 0 - beq _0805F958 - mov r0, r10 - cmp r0, 0 - beq _0805F958 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0805F8D2 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0805F8D2 - ldr r1, =0x03005d7c - ldr r5, =0x02024064 - 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, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - ldrb r0, [r5] - eors r4, r0 - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_805EE54 -_0805F8D2: - ldr r1, =0x03005d7c - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - ldrb r5, [r4] - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - bl sub_805EE54 - ldr r3, =0x020244d0 - 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, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805F2F0 - str r1, [r0] -_0805F958: - 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_805F560 - - thumb_func_start sub_805F994 -sub_805F994: @ 805F994 - push {r4,r5,lr} - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - ldr r1, =0x02024064 - ldrb r3, [r1] - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x24 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0805F9E0 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r2, r3, 1 - adds r0, r2, r3 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0xC0 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - bne _0805F9E0 - ldr r0, =0x0202406e - adds r0, r2, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - adds r1, r0 - adds r0, r3, 0 - bl sub_8172EF0 -_0805F9E0: - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - ldr r5, =0x02024064 - ldrb r3, [r5] - 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, =DummyObjectCallback - cmp r1, r0 - bne _0805FA48 - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r1, [r0, 0x4] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r2, r0, r1 - ldrb r1, [r2, 0x1] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0805FA48 - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - 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 FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - bl dp01_tbl7_exec_completed -_0805FA48: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805F994 - - thumb_func_start sub_805FA70 -sub_805FA70: @ 805FA70 - push {r4-r6,lr} - ldr r6, =0x02024064 - ldrb r0, [r6] - ldr r5, =0x03005d70 - 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 _0805FAB8 - ldrb r0, [r6] - adds r0, r5 - ldrb r0, [r0] - movs r2, 0 - bl heathbar_draw_hp - b _0805FABC - .pool -_0805FAB8: - bl dp01_tbl7_exec_completed -_0805FABC: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_805FA70 - - thumb_func_start sub_805FAC4 -sub_805FAC4: @ 805FAC4 - push {lr} - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - ldr r1, =0x02024064 - 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 _0805FAF2 - ldr r0, =0x03005d70 - adds r0, r3, r0 - ldrb r0, [r0] - bl sub_8072984 - bl dp01_tbl7_exec_completed -_0805FAF2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805FAC4 - - thumb_func_start sub_805FB08 -sub_805FB08: @ 805FB08 - push {r4-r6,lr} - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r6, =0x02024064 - 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 _0805FB62 - ldr r5, =0x020241e4 - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldrb r0, [r6] - bl sub_805EEE0 - ldr r1, =0x03005d70 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl dp01_tbl7_exec_completed -_0805FB62: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805FB08 - - thumb_func_start bx_t7_button_a -bx_t7_button_a: @ 805FB7C - push {lr} - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _0805FB8E - bl dp01_tbl7_exec_completed -_0805FB8E: - pop {r0} - bx r0 - thumb_func_end bx_t7_button_a - - thumb_func_start bx_blink_t7 -bx_blink_t7: @ 805FB94 - push {r4,lr} - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - ldr r2, =0x02020630 - 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 _0805FBE0 - 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, =0x020244b9 - strb r3, [r0] - bl dp01_tbl7_exec_completed - b _0805FC0A - .pool -_0805FBE0: - ldrh r0, [r4, 0x30] - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _0805FC04 - 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] -_0805FC04: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] -_0805FC0A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end bx_blink_t7 - - thumb_func_start sub_805FC10 -sub_805FC10: @ 805FC10 - push {r4,lr} - ldr r2, =0x02020630 - ldr r0, =0x03005d70 - ldr r4, =0x02024064 - 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, =DummyObjectCallback - cmp r1, r0 - bne _0805FC5C - ldr r0, =0x020244d0 - 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 _0805FC50 - adds r0, r3, 0 - adds r1, r3, 0 - adds r2, r3, 0 - movs r3, 0x6 - bl move_anim_start_t4 -_0805FC50: - ldr r0, =0x03005d60 - ldrb r1, [r4] - lsls r1, 2 - adds r1, r0 - ldr r0, =bx_803AEDC - str r0, [r1] -_0805FC5C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805FC10 - - thumb_func_start bx_803AEDC -bx_803AEDC: @ 805FC80 - push {r4,lr} - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r4, =0x02024064 - 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 _0805FCDA - bl sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - bne _0805FCDA - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - 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, =DummyObjectCallback - cmp r1, r0 - beq _0805FCCA - ldr r0, =nullsub_18 - cmp r1, r0 - bne _0805FCDA -_0805FCCA: - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl - bl dp01_tbl7_exec_completed -_0805FCDA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bx_803AEDC - - thumb_func_start sub_805FD00 -sub_805FD00: @ 805FD00 - push {r4-r7,lr} - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r5, =0x02024064 - 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 _0805FDBC - ldr r7, =0x02020630 - ldr r6, =0x020241e4 - 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, =DummyObjectCallback - cmp r1, r0 - bne _0805FDBC - 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 FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - 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 StartObjectImageAnim - ldr r4, =0x03005d70 - ldrb r1, [r5] - adds r0, r1, r4 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - 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, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805FC10 - str r1, [r0] -_0805FDBC: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805FD00 - - thumb_func_start sub_805FDF0 -sub_805FDF0: @ 805FDF0 - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r0, [r6] - ldr r5, =0x02024064 - 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 _0805FE22 - ldr r0, =0x0202406e - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_0805FE22: - ldr r4, =0x02020630 - ldr r0, =0x03005d7c - 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, =DummyObjectCallback - cmp r1, r0 - bne _0805FE8C - 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 _0805FE8C - adds r0, r3, r4 - bl RemoveObjectAndFreeTiles - ldrb r4, [r5] - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_805EE54 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805FD00 - str r1, [r0] -_0805FE8C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805FDF0 - - thumb_func_start sub_805FEB8 -sub_805FEB8: @ 805FEB8 - push {lr} - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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 _0805FEDA - bl dp01_tbl7_exec_completed -_0805FEDA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805FEB8 - - thumb_func_start bx_803B0F4 -bx_803B0F4: @ 805FEE8 - push {lr} - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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 _0805FF0A - bl dp01_tbl7_exec_completed -_0805FF0A: - pop {r0} - bx r0 - .pool - thumb_func_end bx_803B0F4 - - thumb_func_start dp01_tbl7_exec_completed -dp01_tbl7_exec_completed: @ 805FF18 - push {r4,lr} - sub sp, 0x4 - ldr r1, =0x03005d60 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_exec_buffer_A_ch0_tbl7 - str r1, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0805FF6C - bl link_get_multiplayer_id - mov r1, sp - strb r0, [r1] - movs r0, 0x2 - movs r1, 0x4 - mov r2, sp - bl dp01_prepare_buffer_wireless_probably - ldr r1, =0x02023064 - ldrb r0, [r4] - lsls r0, 9 - adds r0, r1 - movs r1, 0x38 - strb r1, [r0] - b _0805FF7E - .pool -_0805FF6C: - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldr r0, [r2] - bics r0, r1 - str r0, [r2] -_0805FF7E: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_tbl7_exec_completed - - thumb_func_start dp01t_00_7_getattr -dp01t_00_7_getattr: @ 805FF90 - push {r4-r6,lr} - sub sp, 0x100 - movs r6, 0 - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _0805FFC8 - ldr r0, =0x0202406e - lsls r1, r2, 1 - adds r1, r0 - ldrb r0, [r1] - mov r1, sp - bl sub_8060004 - adds r6, r0, 0 - b _0805FFEA - .pool -_0805FFC8: - ldrb r4, [r1] - movs r5, 0 -_0805FFCC: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0805FFE2 - lsls r0, r5, 24 - lsrs r0, 24 - mov r2, sp - adds r1, r2, r6 - bl sub_8060004 - adds r6, r0 -_0805FFE2: - lsrs r4, 1 - adds r5, 0x1 - cmp r5, 0x5 - ble _0805FFCC -_0805FFEA: - lsls r1, r6, 16 - lsrs r1, 16 - movs r0, 0x1 - mov r2, sp - bl dp01_build_cmdbuf_x1D_1D_numargs_varargs - bl dp01_tbl7_exec_completed - add sp, 0x100 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end dp01t_00_7_getattr - - thumb_func_start sub_8060004 -sub_8060004: @ 8060004 - 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, =0x02023064 - ldr r3, =0x02024064 - ldrb r0, [r3] - lsls r0, 9 - adds r1, r2, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3B - bls _0806002E - bl _0806079A -_0806002E: - lsls r0, 2 - ldr r1, =_08060044 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08060044: - .4byte _08060134 - .4byte _08060358 - .4byte _08060368 - .4byte _08060378 - .4byte _080603E0 - .4byte _080603E0 - .4byte _080603E0 - .4byte _080603E0 - .4byte _080603FC - .4byte _08060438 - .4byte _08060438 - .4byte _08060438 - .4byte _08060438 - .4byte _0806079A - .4byte _0806079A - .4byte _0806079A - .4byte _0806079A - .4byte _08060454 - .4byte _08060464 - .4byte _08060494 - .4byte _080604A4 - .4byte _080604B4 - .4byte _080604C4 - .4byte _080604D4 - .4byte _080604E4 - .4byte _080604F4 - .4byte _08060504 - .4byte _08060514 - .4byte _08060524 - .4byte _08060534 - .4byte _08060544 - .4byte _08060554 - .4byte _080605A4 - .4byte _080605B4 - .4byte _080605C4 - .4byte _080605D4 - .4byte _080605E4 - .4byte _080605F4 - .4byte _08060604 - .4byte _08060614 - .4byte _08060624 - .4byte _08060658 - .4byte _08060668 - .4byte _08060678 - .4byte _08060688 - .4byte _08060698 - .4byte _080606A8 - .4byte _080606B8 - .4byte _080606C8 - .4byte _080606E8 - .4byte _080606F8 - .4byte _08060708 - .4byte _08060718 - .4byte _08060728 - .4byte _08060738 - .4byte _08060748 - .4byte _08060758 - .4byte _08060768 - .4byte _08060778 - .4byte _08060788 -_08060134: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - mov r1, sp - strh r0, [r1] - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr - 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 -_08060180: - adds r1, r6, 0 - adds r1, 0xD - mov r0, r8 - bl pokemon_getattr - strh r0, [r4] - adds r1, r6, 0 - adds r1, 0x11 - mov r0, r8 - bl pokemon_getattr - mov r2, r9 - adds r1, r2, r6 - strb r0, [r1] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _08060180 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - bl pokemon_getattr - mov r1, r10 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x20 - bl pokemon_getattr - ldr r2, [sp, 0x80] - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x19 - bl pokemon_getattr - str r0, [sp, 0x44] - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - str r0, [sp, 0x48] - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - str r0, [sp, 0x4C] - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - ldr r1, [sp, 0x7C] - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x28] - adds r0, r4, 0 - movs r1, 0x3A - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2C] - adds r0, r4, 0 - movs r1, 0x3B - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2] - adds r0, r4, 0 - movs r1, 0x3C - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x4] - adds r0, r4, 0 - movs r1, 0x3D - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x6] - adds r0, r4, 0 - movs r1, 0x3E - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x8] - adds r0, r4, 0 - movs r1, 0x3F - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0xA] - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - str r0, [sp, 0x54] - adds r0, r4, 0 - movs r1, 0x2 - ldr r2, [sp, 0x8C] - bl pokemon_getattr - ldr r0, [sp, 0x84] - ldr r1, [sp, 0x8C] - bl CopyString_Limit10 - adds r0, r4, 0 - movs r1, 0x7 - ldr r2, [sp, 0x88] - bl pokemon_getattr - mov r2, sp - movs r6, 0 -_08060338: - adds r0, r7, r6 - adds r1, r2, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0x57 - bls _08060338 - b _0806079A - .pool -_08060358: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - b _080606D2 - .pool -_08060368: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xC - b _080606D2 - .pool -_08060378: - 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, =0x02024744 - adds r4, r1, r0 - mov r8, r9 -_0806038E: - adds r1, r6, 0 - adds r1, 0xD - adds r0, r4, 0 - bl pokemon_getattr - mov r1, r8 - strh r0, [r1] - adds r1, r6, 0 - adds r1, 0x11 - adds r0, r4, 0 - bl pokemon_getattr - mov r2, r10 - adds r1, r2, r6 - strb r0, [r1] - movs r0, 0x2 - add r8, r0 - adds r6, 0x1 - cmp r6, 0x3 - ble _0806038E - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - mov r1, r9 - strb r0, [r1, 0xC] - mov r2, r9 - movs r6, 0 -_080603CC: - adds r0, r7, r6 - adds r1, r2, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0xF - bls _080603CC - b _0806079A - .pool -_080603E0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r1, [r3] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - adds r1, 0x9 - b _080606D2 - .pool -_080603FC: - movs r6, 0 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r2, =0x02024744 - mov r8, r2 -_08060408: - adds r1, r6, 0 - adds r1, 0x11 - mov r2, r8 - adds r0, r4, r2 - bl pokemon_getattr - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - cmp r6, 0x3 - ble _08060408 - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - b _0806079A - .pool -_08060438: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r1, [r3] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - adds r1, 0x8 - b _08060792 - .pool -_08060454: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1 - b _0806046E - .pool -_08060464: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x19 -_0806046E: - bl pokemon_getattr - 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 _0806079A - .pool -_08060494: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1A - b _08060792 - .pool -_080604A4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1B - b _08060792 - .pool -_080604B4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1C - b _08060792 - .pool -_080604C4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1D - b _08060792 - .pool -_080604D4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1E - b _08060792 - .pool -_080604E4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1F - b _08060792 - .pool -_080604F4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x20 - b _08060792 - .pool -_08060504: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x22 - b _08060792 - .pool -_08060514: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x23 - b _08060792 - .pool -_08060524: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x24 - b _08060792 - .pool -_08060534: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x25 - b _08060792 - .pool -_08060544: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x26 - b _08060792 - .pool -_08060554: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_getattr - strb r0, [r7] - adds r0, r4, 0 - movs r1, 0x28 - bl pokemon_getattr - strb r0, [r7, 0x1] - adds r0, r4, 0 - movs r1, 0x29 - bl pokemon_getattr - strb r0, [r7, 0x2] - adds r0, r4, 0 - movs r1, 0x2A - bl pokemon_getattr - strb r0, [r7, 0x3] - adds r0, r4, 0 - movs r1, 0x2B - bl pokemon_getattr - strb r0, [r7, 0x4] - adds r0, r4, 0 - movs r1, 0x2C - bl pokemon_getattr - strb r0, [r7, 0x5] - movs r6, 0x6 - b _0806079A - .pool -_080605A4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x27 - b _08060792 - .pool -_080605B4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x28 - b _08060792 - .pool -_080605C4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x29 - b _08060792 - .pool -_080605D4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2A - b _08060792 - .pool -_080605E4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2B - b _08060792 - .pool -_080605F4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2C - b _08060792 - .pool -_08060604: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0 - b _0806062E - .pool -_08060614: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x9 - b _080606D2 - .pool -_08060624: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x37 -_0806062E: - bl pokemon_getattr - 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 _0806079A - .pool -_08060658: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x38 - b _08060792 - .pool -_08060668: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x39 - b _080606D2 - .pool -_08060678: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3A - b _080606D2 - .pool -_08060688: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3B - b _080606D2 - .pool -_08060698: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3C - b _080606D2 - .pool -_080606A8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3D - b _080606D2 - .pool -_080606B8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3E - b _080606D2 - .pool -_080606C8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3F -_080606D2: - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - strb r0, [r7] - lsrs r0, 8 - strb r0, [r7, 0x1] - movs r6, 0x2 - b _0806079A - .pool -_080606E8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x16 - b _08060792 - .pool -_080606F8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x17 - b _08060792 - .pool -_08060708: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x18 - b _08060792 - .pool -_08060718: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x21 - b _08060792 - .pool -_08060728: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2F - b _08060792 - .pool -_08060738: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x30 - b _08060792 - .pool -_08060748: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x32 - b _08060792 - .pool -_08060758: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x33 - b _08060792 - .pool -_08060768: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x34 - b _08060792 - .pool -_08060778: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x35 - b _08060792 - .pool -_08060788: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x36 -_08060792: - bl pokemon_getattr - strb r0, [r7] - movs r6, 0x1 -_0806079A: - 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_8060004 - - thumb_func_start dp01t_01_2_read_pokmon_data_slice -dp01t_01_2_read_pokmon_data_slice: @ 80607B0 - push {r4-r7,lr} - sub sp, 0x58 - ldr r2, =0x0202406e - ldr r5, =0x02024064 - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - adds r4, r2, 0 - muls r4, r0 - ldr r3, =0x02023064 - lsls r1, 9 - adds r0, r3, 0x1 - adds r0, r1, r0 - ldrb r2, [r0] - ldr r0, =0x02024744 - adds r0, r2, r0 - adds r6, r4, r0 - mov r0, sp - adds r4, r0, r2 - movs r2, 0 - adds r0, r3, 0x2 - adds r1, r0 - adds r7, r5, 0 - mov r12, r3 - ldrb r1, [r1] - cmp r2, r1 - bcs _08060806 - adds r3, r0, 0 -_080607EC: - adds r1, r4, r2 - adds r0, r6, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - ldrb r0, [r5] - lsls r0, 9 - adds r0, r3 - ldrb r0, [r0] - cmp r2, r0 - bcc _080607EC -_08060806: - ldrb r0, [r7] - lsls r0, 9 - mov r1, r12 - adds r1, 0x2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - adds r2, r4, 0 - bl dp01_build_cmdbuf_x1D_1D_numargs_varargs - bl dp01_tbl7_exec_completed - add sp, 0x58 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_01_2_read_pokmon_data_slice - - thumb_func_start dp01t_02_7_setattr -dp01t_02_7_setattr: @ 8060838 - push {r4,r5,lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _08060868 - ldr r0, =0x0202406e - lsls r1, r2, 1 - adds r1, r0 - ldrb r0, [r1] - bl sub_8060890 - b _08060886 - .pool -_08060868: - ldrb r4, [r1] - movs r5, 0 -_0806086C: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0806087A - adds r0, r5, 0 - bl sub_8060890 -_0806087A: - lsrs r4, 1 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _0806086C -_08060886: - bl dp01_tbl7_exec_completed - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end dp01t_02_7_setattr - - thumb_func_start sub_8060890 -sub_8060890: @ 8060890 - 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, =0x02024064 - ldrb r0, [r3] - lsls r0, 9 - ldr r2, =0x02023067 - 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 _080608BE - bl _0806119C -_080608BE: - lsls r0, 2 - ldr r1, =_080608D4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080608D4: - .4byte _080609C4 - .4byte _08060B5C - .4byte _08060B78 - .4byte _08060B94 - .4byte _08060BE8 - .4byte _08060BE8 - .4byte _08060BE8 - .4byte _08060BE8 - .4byte _08060C08 - .4byte _08060C70 - .4byte _08060C70 - .4byte _08060C70 - .4byte _08060C70 - .4byte _0806119C - .4byte _0806119C - .4byte _0806119C - .4byte _0806119C - .4byte _08060C98 - .4byte _08060CB4 - .4byte _08060CD0 - .4byte _08060CEC - .4byte _08060D08 - .4byte _08060D24 - .4byte _08060D40 - .4byte _08060D5C - .4byte _08060D78 - .4byte _08060D94 - .4byte _08060DB0 - .4byte _08060DCC - .4byte _08060DE8 - .4byte _08060E04 - .4byte _08060E20 - .4byte _08060E94 - .4byte _08060EB0 - .4byte _08060ECC - .4byte _08060EE8 - .4byte _08060F04 - .4byte _08060F20 - .4byte _08060F3C - .4byte _08060F58 - .4byte _08060F74 - .4byte _08060F90 - .4byte _08060FAC - .4byte _08060FC8 - .4byte _08060FE4 - .4byte _08061000 - .4byte _0806101C - .4byte _08061038 - .4byte _08061054 - .4byte _08061070 - .4byte _0806108C - .4byte _080610A8 - .4byte _080610C4 - .4byte _080610E0 - .4byte _080610FC - .4byte _08061118 - .4byte _08061134 - .4byte _08061150 - .4byte _0806116C - .4byte _08061188 -_080609C4: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - adds r2, r7, 0 - bl pokemon_setattr - adds r2, r7, 0 - adds r2, 0x2E - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_setattr - 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 -_08060A2A: - mov r1, r8 - adds r1, 0xD - mov r0, r9 - adds r2, r4, 0 - bl pokemon_setattr - mov r1, r8 - adds r1, 0x11 - mov r0, r9 - adds r2, r6, 0 - bl pokemon_setattr - adds r6, 0x1 - adds r4, 0x2 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x3 - ble _08060A2A - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - mov r2, r10 - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x20 - ldr r2, [sp, 0x20] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x19 - ldr r2, [sp, 0x28] - bl pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - adds r0, r4, 0 - movs r1, 0 - ldr r2, [sp, 0x2C] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x37 - ldr r2, [sp, 0x30] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x38 - ldr r2, [sp, 0x1C] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x39 - ldr r2, [sp, 0x18] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3A - ldr r2, [sp, 0x24] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3B - ldr r2, [sp, 0x4] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3C - ldr r2, [sp, 0x8] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3D - ldr r2, [sp, 0xC] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3E - ldr r2, [sp, 0x10] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3F - ldr r2, [sp, 0x14] - bl pokemon_setattr - b _0806119C - .pool -_08060B5C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0xB - bl pokemon_setattr - b _0806119C - .pool -_08060B78: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0xC - bl pokemon_setattr - b _0806119C - .pool -_08060B94: - 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, =0x02024744 - adds r7, r1, r0 - adds r6, r4, 0 - adds r6, 0x8 -_08060BAC: - mov r1, r8 - adds r1, 0xD - adds r0, r7, 0 - adds r2, r4, 0 - bl pokemon_setattr - mov r1, r8 - adds r1, 0x11 - adds r0, r7, 0 - adds r2, r6, 0 - bl pokemon_setattr - adds r6, 0x1 - adds r4, 0x2 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x3 - ble _08060BAC - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x15 - mov r2, r9 - bl pokemon_setattr - b _0806119C - .pool -_08060BE8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldr r3, =0x02023064 - ldrb r2, [r6] - lsls r2, 9 - adds r1, r3, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r1, 0x9 - b _08060C86 - .pool -_08060C08: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - adds r0, r4, 0 - movs r1, 0x11 - str r3, [sp, 0x34] - bl pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - b _0806119C - .pool -_08060C70: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldr r3, =0x02023064 - ldrb r2, [r6] - lsls r2, 9 - adds r1, r3, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r1, 0x8 -_08060C86: - adds r3, 0x3 - adds r2, r3 - bl pokemon_setattr - b _0806119C - .pool -_08060C98: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1 - bl pokemon_setattr - b _0806119C - .pool -_08060CB4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x19 - bl pokemon_setattr - b _0806119C - .pool -_08060CD0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1A - bl pokemon_setattr - b _0806119C - .pool -_08060CEC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1B - bl pokemon_setattr - b _0806119C - .pool -_08060D08: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1C - bl pokemon_setattr - b _0806119C - .pool -_08060D24: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1D - bl pokemon_setattr - b _0806119C - .pool -_08060D40: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1E - bl pokemon_setattr - b _0806119C - .pool -_08060D5C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1F - bl pokemon_setattr - b _0806119C - .pool -_08060D78: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x20 - bl pokemon_setattr - b _0806119C - .pool -_08060D94: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x22 - bl pokemon_setattr - b _0806119C - .pool -_08060DB0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x23 - bl pokemon_setattr - b _0806119C - .pool -_08060DCC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x24 - bl pokemon_setattr - b _0806119C - .pool -_08060DE8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x25 - bl pokemon_setattr - b _0806119C - .pool -_08060E04: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x26 - bl pokemon_setattr - b _0806119C - .pool -_08060E20: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - adds r0, r4, 0 - movs r1, 0x27 - str r3, [sp, 0x34] - bl pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x5 - adds r2, r0 - adds r0, r4, 0 - b _08060F2E - .pool -_08060E94: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x27 - bl pokemon_setattr - b _0806119C - .pool -_08060EB0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x28 - bl pokemon_setattr - b _0806119C - .pool -_08060ECC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x29 - bl pokemon_setattr - b _0806119C - .pool -_08060EE8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x2A - bl pokemon_setattr - b _0806119C - .pool -_08060F04: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x2B - bl pokemon_setattr - b _0806119C - .pool -_08060F20: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 -_08060F2E: - movs r1, 0x2C - bl pokemon_setattr - b _0806119C - .pool -_08060F3C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0 - bl pokemon_setattr - b _0806119C - .pool -_08060F58: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x9 - bl pokemon_setattr - b _0806119C - .pool -_08060F74: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x37 - bl pokemon_setattr - b _0806119C - .pool -_08060F90: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x38 - bl pokemon_setattr - b _0806119C - .pool -_08060FAC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x39 - bl pokemon_setattr - b _0806119C - .pool -_08060FC8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3A - bl pokemon_setattr - b _0806119C - .pool -_08060FE4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3B - bl pokemon_setattr - b _0806119C - .pool -_08061000: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3C - bl pokemon_setattr - b _0806119C - .pool -_0806101C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3D - bl pokemon_setattr - b _0806119C - .pool -_08061038: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3E - bl pokemon_setattr - b _0806119C - .pool -_08061054: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3F - bl pokemon_setattr - b _0806119C - .pool -_08061070: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x16 - bl pokemon_setattr - b _0806119C - .pool -_0806108C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x17 - bl pokemon_setattr - b _0806119C - .pool -_080610A8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x18 - bl pokemon_setattr - b _0806119C - .pool -_080610C4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x21 - bl pokemon_setattr - b _0806119C - .pool -_080610E0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x2F - bl pokemon_setattr - b _0806119C - .pool -_080610FC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x30 - bl pokemon_setattr - b _0806119C - .pool -_08061118: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x32 - bl pokemon_setattr - b _0806119C - .pool -_08061134: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x33 - bl pokemon_setattr - b _0806119C - .pool -_08061150: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x34 - bl pokemon_setattr - b _0806119C - .pool -_0806116C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x35 - bl pokemon_setattr - b _0806119C - .pool -_08061188: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x36 - bl pokemon_setattr -_0806119C: - 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 sub_8060890 - - thumb_func_start sub_80611B0 -sub_80611B0: @ 80611B0 - push {r4-r7,lr} - ldr r1, =0x0202406e - ldr r7, =0x02024064 - 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, =0x02023064 - lsls r2, 9 - adds r0, r4, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - ldr r1, =0x02024744 - adds r0, r1 - adds r5, r3, r0 - movs r3, 0 - adds r0, r4, 0x2 - adds r2, r0 - ldrb r2, [r2] - cmp r3, r2 - bcs _08061208 - adds r6, r4, 0 - adds r2, r7, 0 - adds r4, r0, 0 -_080611E6: - 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 _080611E6 -_08061208: - bl dp01_tbl7_exec_completed - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80611B0 - - thumb_func_start sub_8061224 -sub_8061224: @ 8061224 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r6, =0x02024064 - ldrb r0, [r6] - lsls r0, 1 - ldr r1, =0x0202406e - adds r0, r1 - ldrh r0, [r0] - movs r7, 0x64 - muls r0, r7 - ldr r2, =0x02024744 - mov r10, r2 - add r0, r10 - movs r1, 0xB - bl pokemon_getattr - mov r8, r0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldrb r1, [r6] - lsls r0, r1, 1 - ldr r2, =0x0202406e - adds r0, r2 - ldrh r0, [r0] - muls r0, r7 - add r0, r10 - bl sub_805DC0C - ldrb r0, [r6] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl sub_806A068 - ldr r0, =0x0202499c - mov r9, 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, r9 - adds r1, r5, 0 - adds r2, r4, 0 - bl AddObjectToFront - ldr r4, =0x020241e4 - ldrb r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r5, =0x02020630 - 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 r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r1, r8 - strh r1, [r0, 0x32] - 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, =0x020244e4 - adds r2, r1 - ldrb r1, [r2] - bl StartObjectImageAnim - ldrb r4, [r6] - lsls r0, r4, 1 - ldr r2, =0x0202406e - adds r0, r2 - ldrh r0, [r0] - muls r0, r7 - add r0, r10 - movs r1, 0xB - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_805EE54 - ldr r1, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805F994 - 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_8061224 - - thumb_func_start sub_806137C -sub_806137C: @ 806137C - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - adds r0, 0x5C - movs r1, 0x6 - strb r1, [r0] - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r2, r0, 1 - adds r2, r1 - ldr r3, =0x02023064 - 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_80613DC - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805FDF0 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806137C - - thumb_func_start sub_80613DC -sub_80613DC: @ 80613DC - 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, =0x0202406e - lsls r4, r6, 1 - adds r4, r0 - ldr r0, =0x02023064 - 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, =0x02024744 - adds r0, r5 - movs r1, 0xB - bl pokemon_getattr - mov r8, r0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r0, =sub_805D714 - bl object_new_hidden_with_callback - ldr r1, =0x03005d7c - 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 battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl sub_806A068 - ldr r0, =0x0202499c - 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 AddObjectToFront - ldr r4, =0x020241e4 - adds r4, r6, r4 - strb r0, [r4] - ldr r5, =0x02020630 - 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] - 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 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, =0x020244e4 - adds r6, r1 - ldrb r1, [r6] - bl StartObjectImageAnim - 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, =DummyObjectCallback - 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_80613DC - - thumb_func_start sub_806156C -sub_806156C: @ 806156C - push {r4-r6,lr} - ldr r1, =0x02023064 - ldr r6, =0x02024064 - ldrb r2, [r6] - lsls r0, r2, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r3, [r0] - cmp r3, 0 - bne _080615B4 - ldr r0, =0x020244d0 - 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, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8061604 - str r1, [r0] - b _080615F0 - .pool -_080615B4: - ldr r5, =0x020241e4 - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldrb r0, [r6] - bl sub_805EEE0 - ldr r1, =0x03005d70 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl dp01_tbl7_exec_completed -_080615F0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806156C - - thumb_func_start sub_8061604 -sub_8061604: @ 8061604 - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r4, [r6] - ldr r5, =0x02024064 - 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 _0806162C - cmp r0, 0x1 - beq _0806165A - b _08061682 - .pool -_0806162C: - ldr r1, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08061646 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_08061646: - 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 _08061682 -_0806165A: - ldrb r1, [r3] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08061682 - 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, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805FB08 - str r1, [r0] -_08061682: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8061604 - - thumb_func_start sub_8061690 -sub_8061690: @ 8061690 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =0x02022fec - ldr r2, [r0] - movs r0, 0x80 - lsls r0, 20 - ands r0, r2 - cmp r0, 0 - beq _080616B0 - bl sub_806B830 - b _0806175A - .pool -_080616B0: - ldr r3, =0x02038bca - ldrh r1, [r3] - ldr r0, =0x000003fe - cmp r1, r0 - bne _080616C8 - bl sub_81A4CB0 - b _0806175A - .pool -_080616C8: - movs r0, 0x80 - lsls r0, 19 - ands r0, r2 - cmp r0, 0 - beq _08061708 - movs r0, 0x80 - lsls r0, 8 - ands r2, r0 - cmp r2, 0 - beq _08061700 - ldr r0, =0x02024064 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080616F0 - ldrh r0, [r3] - bl sub_81D5588 - b _0806175A - .pool -_080616F0: - ldr r0, =0x02038bcc - ldrh r0, [r0] - bl sub_81D5588 - b _0806175A - .pool -_08061700: - ldrh r0, [r3] - bl sub_81D5588 - b _0806175A -_08061708: - ldr r0, =0x003f0100 - ands r0, r2 - cmp r0, 0 - beq _0806174C - ldr r0, =0x00808000 - ands r2, r0 - cmp r2, 0 - beq _08061744 - ldr r0, =0x02024064 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08061734 - ldrh r0, [r3] - bl sub_8162AA0 - b _0806175A - .pool -_08061734: - ldr r0, =0x02038bcc - ldrh r0, [r0] - bl sub_8162AA0 - b _0806175A - .pool -_08061744: - ldrh r0, [r3] - bl sub_8162AA0 - b _0806175A -_0806174C: - movs r0, 0x80 - lsls r0, 4 - ands r0, r2 - cmp r0, 0 - beq _08061760 - bl sub_8165244 -_0806175A: - lsls r0, 24 - lsrs r4, r0, 24 - b _08061796 -_08061760: - movs r0, 0x80 - lsls r0, 8 - ands r2, r0 - cmp r2, 0 - beq _08061788 - ldr r0, =0x02024064 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08061788 - ldr r2, =gTrainers - ldr r0, =0x02038bcc - ldrh r1, [r0] - b _0806178C - .pool -_08061788: - ldr r2, =gTrainers - ldrh r1, [r3] -_0806178C: - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r4, [r0, 0x3] -_08061796: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x00008040 - ands r0, r1 - cmp r0, 0 - beq _080617C8 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_get_per_side_status - movs r1, 0x2 - ands r1, r0 - movs r7, 0xC8 - cmp r1, 0 - beq _080617CA - movs r7, 0x98 - b _080617CA - .pool -_080617C8: - movs r7, 0xB0 -_080617CA: - mov r8, r4 - ldr r5, =0x02024064 - ldrb r1, [r5] - mov r0, r8 - bl sub_805DF38 - ldrb r0, [r5] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl template_build_for_pokemon_or_trainer - ldr r6, =0x0202499c - 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 AddObjectToFront - ldr r6, =0x020241e4 - ldrb r1, [r5] - adds r1, r6 - strb r0, [r1] - ldr r4, =0x02020630 - 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 IndexOfObjectPaletteTag - 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, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805F1D0 - str r1, [r0] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8061690 - - thumb_func_start sub_80618D8 -sub_80618D8: @ 80618D8 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =0x02022fec - ldr r2, [r0] - movs r0, 0x80 - lsls r0, 20 - ands r0, r2 - cmp r0, 0 - beq _080618F8 - bl sub_806B830 - b _080619A2 - .pool -_080618F8: - ldr r3, =0x02038bca - ldrh r1, [r3] - ldr r0, =0x000003fe - cmp r1, r0 - bne _08061910 - bl sub_81A4CB0 - b _080619A2 - .pool -_08061910: - movs r0, 0x80 - lsls r0, 19 - ands r0, r2 - cmp r0, 0 - beq _08061950 - movs r0, 0x80 - lsls r0, 8 - ands r2, r0 - cmp r2, 0 - beq _08061948 - ldr r0, =0x02024064 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08061938 - ldrh r0, [r3] - bl sub_81D5588 - b _080619A2 - .pool -_08061938: - ldr r0, =0x02038bcc - ldrh r0, [r0] - bl sub_81D5588 - b _080619A2 - .pool -_08061948: - ldrh r0, [r3] - bl sub_81D5588 - b _080619A2 -_08061950: - ldr r0, =0x003f0100 - ands r0, r2 - cmp r0, 0 - beq _08061994 - ldr r0, =0x00808000 - ands r2, r0 - cmp r2, 0 - beq _0806198C - ldr r0, =0x02024064 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0806197C - ldrh r0, [r3] - bl sub_8162AA0 - b _080619A2 - .pool -_0806197C: - ldr r0, =0x02038bcc - ldrh r0, [r0] - bl sub_8162AA0 - b _080619A2 - .pool -_0806198C: - ldrh r0, [r3] - bl sub_8162AA0 - b _080619A2 -_08061994: - movs r0, 0x80 - lsls r0, 4 - ands r0, r2 - cmp r0, 0 - beq _080619A8 - bl sub_8165244 -_080619A2: - lsls r0, 24 - lsrs r0, 24 - b _080619DE -_080619A8: - movs r0, 0x80 - lsls r0, 8 - ands r2, r0 - cmp r2, 0 - beq _080619D0 - ldr r0, =0x02024064 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080619D0 - ldr r2, =gTrainers - ldr r0, =0x02038bcc - ldrh r1, [r0] - b _080619D4 - .pool -_080619D0: - ldr r2, =gTrainers - ldrh r1, [r3] -_080619D4: - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x3] -_080619DE: - mov r8, r0 - ldr r6, =0x02024064 - ldrb r1, [r6] - bl sub_805DF38 - ldrb r0, [r6] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl template_build_for_pokemon_or_trainer - ldr r0, =0x0202499c - ldr r2, =gUnknown_083054E0 - mov r3, r8 - lsls r1, r3, 2 - adds r1, r2 - ldrb r1, [r1] - movs r2, 0x8 - subs r2, r1 - lsls r2, 18 - movs r1, 0xA0 - lsls r1, 14 - adds r2, r1 - asrs r2, 16 - movs r1, 0xB0 - movs r3, 0x1E - bl AddObjectToFront - ldr r5, =0x020241e4 - ldrb r1, [r6] - adds r1, r5 - strb r0, [r1] - ldr r4, =0x02020630 - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x60 - strh r1, [r0, 0x24] - 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, 0x20] - adds r1, 0x20 - strh r1, [r0, 0x20] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000fffe - strh r1, [r0, 0x2E] - ldr r1, =gTrainerFrontPicPaletteTable - mov r2, r8 - lsls r0, r2, 3 - adds r0, r1 - ldrh r0, [r0, 0x4] - bl IndexOfObjectPaletteTag - ldrb r1, [r6] - adds r1, r5 - 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, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - mov r3, r8 - strh r3, [r0, 0x6] - ldrb r0, [r6] - adds r0, r5 - 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, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805F208 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80618D8 - - thumb_func_start sub_8061AF0 -sub_8061AF0: @ 8061AF0 - push {r4-r6,lr} - ldr r6, =0x020241e4 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =0x02020630 - 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, =DummyObjectCallback - bl oamt_set_x3A_32 - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805F240 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8061AF0 - - thumb_func_start sub_8061B9C -sub_8061B9C: @ 8061B9C - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r4, [r6] - ldr r5, =0x02024064 - 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 _08061BF0 - ldr r1, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08061BD0 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_08061BD0: - 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 _08061C2C - .pool -_08061BF0: - ldrb r1, [r3] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08061C2C - strb r0, [r3, 0x4] - movs r0, 0x10 - movs r1, 0x3F - bl audio_play_and_stuff - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - 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, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805FAC4 - str r1, [r0] -_08061C2C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8061B9C - - thumb_func_start sub_8061C48 -sub_8061C48: @ 8061C48 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8061C48 - - thumb_func_start sub_8061C54 -sub_8061C54: @ 8061C54 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8061C54 - - thumb_func_start sub_8061C60 -sub_8061C60: @ 8061C60 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8061C60 - - thumb_func_start sub_8061C6C -sub_8061C6C: @ 8061C6C - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8061C6C - - thumb_func_start sub_8061C78 -sub_8061C78: @ 8061C78 - push {r4-r6,lr} - ldr r6, =0x02024064 - ldrb r0, [r6] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - beq _08061C8A - b _08061D9E -_08061C8A: - ldr r0, =0x02023064 - 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, =0x02038432 - mov r1, r12 - adds r1, 0x3 - adds r2, r1 - ldrb r1, [r2] - strb r1, [r5] - ldr r4, =0x02038408 - 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, =0x02038404 - 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, =0x0203841a - ldrb r1, [r6] - lsls r1, 9 - mov r2, r12 - adds r2, 0xA - adds r1, r2 - ldrb r1, [r1] - strb r1, [r3] - ldr r4, =0x0203841c - 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, =0x02038400 - ldrb r2, [r6] - lsls r2, 9 - mov r1, r12 - adds r1, 0x10 - adds r2, r1 - str r2, [r3] - ldr r3, =0x020244bc - 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 _08061D80 - bl dp01_tbl7_exec_completed - b _08061D9E - .pool -_08061D80: - ldr r0, =0x020244d0 - 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, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_move_anim_7 - str r1, [r0] -_08061D9E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8061C78 - - thumb_func_start bx_move_anim_7 -bx_move_anim_7: @ 8061DB0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r2, =0x02023064 - ldr r6, =0x02024064 - 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, =0x020244d0 - 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 _08061E48 - cmp r2, 0x1 - bgt _08061E08 - cmp r2, 0 - beq _08061E12 - b _08061F24 - .pool -_08061E08: - cmp r2, 0x2 - beq _08061E72 - cmp r2, 0x3 - beq _08061EE8 - b _08061F24 -_08061E12: - ldr r1, [r5] - lsls r0, r3, 2 - adds r1, r0, r1 - ldrb r2, [r1] - movs r0, 0xC - ands r0, r2 - cmp r0, 0x4 - bne _08061E34 - 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 -_08061E34: - 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 _08061F24 -_08061E48: - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08061F24 - 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 _08061F24 -_08061E72: - ldr r0, =0x020383f8 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =0x020383fd - ldrb r0, [r0] - cmp r0, 0 - bne _08061F24 - 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 _08061EC0 - mov r0, r8 - cmp r0, 0x1 - bhi _08061EC0 - 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] -_08061EC0: - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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 _08061F24 - .pool -_08061EE8: - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _08061F24 - 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 dp01_tbl7_exec_completed -_08061F24: - 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_7 - - thumb_func_start sub_8061F34 -sub_8061F34: @ 8061F34 - push {r4,r5,lr} - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r5, =0x02024064 - ldrb r4, [r5] - lsls r4, 9 - ldr r0, =0x02023066 - adds r4, r0 - ldrh r0, [r4] - bl battle_pick_message - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_t7_button_a - str r1, [r0] - ldrb r0, [r5] - ldrh r1, [r4] - bl sub_81A57E4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8061F34 - - thumb_func_start sub_8061F90 -sub_8061F90: @ 8061F90 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8061F90 - - thumb_func_start sub_8061F9C -sub_8061F9C: @ 8061F9C - push {lr} - bl sub_8063880 - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8061F9C - - thumb_func_start sub_8061FAC -sub_8061FAC: @ 8061FAC - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8061FAC - - thumb_func_start sub_8061FB8 -sub_8061FB8: @ 8061FB8 - push {r4-r6,lr} - ldr r0, =0x02022fec - ldr r2, [r0] - movs r0, 0x80 - lsls r0, 10 - ands r0, r2 - cmp r0, 0 - beq _08061FE4 - bl sub_805D19C - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x1 - movs r1, 0xA -_08061FD6: - bl dp01_build_cmdbuf_x21_a_bb -_08061FDA: - bl dp01_tbl7_exec_completed - b _08062156 - .pool -_08061FE4: - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - ldr r1, =0x02023068 - adds r5, r0, r1 - movs r0, 0x93 - lsls r0, 3 - ands r2, r0 - cmp r2, 0 - beq _080620C4 - movs r0, 0xF - bl sub_8130950 - bl sub_8130BA4 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - beq _08062022 - cmp r4, 0x5 - bgt _0806201C - cmp r4, 0x4 - beq _08062028 - b _08062040 - .pool -_0806201C: - cmp r4, 0x6 - beq _08062030 - b _08062040 -_08062022: - movs r0, 0x1 - movs r1, 0x4 - b _0806202C -_08062028: - movs r0, 0x1 - movs r1, 0x3 -_0806202C: - movs r2, 0 - b _08061FD6 -_08062030: - ldr r0, =0x0202420c - ldrb r2, [r0] - movs r0, 0x1 - movs r1, 0xF - b _08061FD6 - .pool -_08062040: - ldr r3, =gBattleMoves - lsls r0, r4, 1 - adds r2, r5, r0 - ldrh r1, [r2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0, 0x6] - movs r0, 0x12 - ands r0, r1 - cmp r0, 0 - beq _08062062 - ldr r0, =0x0202420c - ldr r1, =0x02024064 - ldrb r1, [r1] - strb r1, [r0] -_08062062: - ldrh r1, [r2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0, 0x6] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0806209C - movs r0, 0 - bl battle_get_side_with_given_state - ldr r5, =0x0202420c - strb r0, [r5] - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _0806209C - movs r0, 0x2 - bl battle_get_side_with_given_state - strb r0, [r5] -_0806209C: - ldr r0, =0x0202420c - ldrb r0, [r0] - lsls r0, 8 - orrs r4, r0 - movs r0, 0x1 - movs r1, 0xA - adds r2, r4, 0 - bl dp01_build_cmdbuf_x21_a_bb - b _08061FDA - .pool -_080620C4: - movs r6, 0x3 -_080620C6: - bl GenerateRandomNumber - adds r4, r0, 0 - ands r4, r6 - lsls r0, r4, 1 - adds r0, r5, r0 - ldrh r2, [r0] - cmp r2, 0 - beq _080620C6 - ldr r1, =gBattleMoves - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x6] - movs r0, 0x12 - ands r0, r1 - cmp r0, 0 - beq _08062108 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 8 - orrs r4, r0 - movs r0, 0x1 - movs r1, 0xA - adds r2, r4, 0 - bl dp01_build_cmdbuf_x21_a_bb - b _08062152 - .pool -_08062108: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0806213C - bl GenerateRandomNumber - movs r1, 0x2 - ands r1, r0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r1, 0 - bl battle_get_side_with_given_state - 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 - b _08062152 - .pool -_0806213C: - movs r0, 0 - bl battle_get_side_with_given_state - 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 -_08062152: - bl dp01_tbl7_exec_completed -_08062156: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8061FB8 - - thumb_func_start sub_806215C -sub_806215C: @ 806215C - push {lr} - ldr r0, =0x02024064 - ldrb r0, [r0] - lsrs r0, 1 - ldr r1, =0x0202449c - ldr r1, [r1] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC0 - ldrb r1, [r0] - movs r0, 0x1 - bl dp01_build_cmdbuf_x23_aa_0 - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_806215C - - thumb_func_start sub_8062188 -sub_8062188: @ 8062188 - push {r4-r7,lr} - ldr r0, =0x02024064 - ldrb r0, [r0] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - movs r2, 0xA5 - lsls r2, 2 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0x6 - bne _08062254 - bl sub_8063A90 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bne _0806225A - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080621D4 - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r5, r0, 24 - adds r7, r5, 0 - b _080621E8 - .pool -_080621D4: - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0x3 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r5, r0, 24 -_080621E8: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x00808000 - ands r0, r1 - cmp r0, 0 - beq _08062214 - ldr r0, =0x02024064 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08062210 - movs r0, 0 - movs r6, 0x3 - b _08062218 - .pool -_08062210: - movs r0, 0x3 - b _08062216 -_08062214: - movs r0, 0 -_08062216: - movs r6, 0x6 -_08062218: - adds r4, r0, 0 - b _0806221E -_0806221C: - adds r4, 0x1 -_0806221E: - cmp r4, r6 - bge _0806225A - movs r0, 0x64 - muls r0, r4 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _0806221C - ldr r1, =0x0202406e - lsls r0, r7, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r4, r0 - beq _0806221C - lsls r0, r5, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r4, r0 - beq _0806221C - b _0806225A - .pool -_08062254: - ldrb r4, [r1] - movs r0, 0x6 - strb r0, [r1] -_0806225A: - ldr r0, =0x02024064 - ldrb r0, [r0] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - adds r0, 0x5C - strb r4, [r0] - lsls r1, r4, 24 - lsrs r1, 24 - movs r0, 0x1 - movs r2, 0 - bl dp01_build_cmdbuf_x22_a_three_bytes - bl dp01_tbl7_exec_completed - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8062188 - - thumb_func_start sub_8062288 -sub_8062288: @ 8062288 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8062288 - - thumb_func_start sub_8062294 -sub_8062294: @ 8062294 - 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, =0x02023064 - ldr r0, =0x02024064 - mov r9, r0 - ldrb r4, [r0] - lsls r2, r4, 9 - adds r0, r3, 0x3 - adds r0, r2, r0 - ldrb r1, [r0] - lsls r1, 8 - adds r3, 0x2 - adds r2, r3 - ldrb r0, [r2] - orrs r0, r1 - lsls r0, 16 - asrs r7, r0, 16 - ldr r0, =0x00007fff - cmp r7, r0 - beq _08062324 - ldr r6, =0x0202406e - lsls r0, r4, 1 - adds r0, r6 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x02024744 - adds r0, r4 - movs r1, 0x3A - bl pokemon_getattr - 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 pokemon_getattr - adds r3, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r1, =0x03005d70 - adds r1, r0, r1 - ldrb r1, [r1] - str r7, [sp] - mov r2, r8 - bl sub_807294C - b _0806234E - .pool -_08062324: - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3A - bl pokemon_getattr - adds r2, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r1, =0x03005d70 - adds r1, r0, r1 - ldrb r1, [r1] - str r7, [sp] - movs r3, 0 - bl sub_807294C -_0806234E: - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805FA70 - 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_8062294 - - thumb_func_start sub_8062384 -sub_8062384: @ 8062384 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8062384 - - thumb_func_start sub_8062390 -sub_8062390: @ 8062390 - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _080623E4 - ldr r0, =0x03005d70 - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - adds r1, r2 - movs r2, 0x9 - bl healthbar_draw_field_maybe - ldrb r2, [r4] - ldr r0, =0x020244d0 - 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, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805FEB8 - str r1, [r0] -_080623E4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8062390 - - thumb_func_start sub_8062408 -sub_8062408: @ 8062408 - push {r4,r5,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _08062458 - ldr r4, =0x02023064 - 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, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805FEB8 - str r1, [r0] -_08062458: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8062408 - - thumb_func_start sub_8062470 -sub_8062470: @ 8062470 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8062470 - - thumb_func_start sub_806247C -sub_806247C: @ 806247C - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_806247C - - thumb_func_start sub_8062488 -sub_8062488: @ 8062488 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8062488 - - thumb_func_start sub_8062494 -sub_8062494: @ 8062494 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8062494 - - thumb_func_start sub_80624A0 -sub_80624A0: @ 80624A0 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_80624A0 - - thumb_func_start sub_80624AC -sub_80624AC: @ 80624AC - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_80624AC - - thumb_func_start sub_80624B8 -sub_80624B8: @ 80624B8 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_80624B8 - - thumb_func_start sub_80624C4 -sub_80624C4: @ 80624C4 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_80624C4 - - thumb_func_start sub_80624D0 -sub_80624D0: @ 80624D0 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_80624D0 - - thumb_func_start sub_80624DC -sub_80624DC: @ 80624DC - push {lr} - ldr r2, =0x02022d0c - ldrb r1, [r2] - movs r0, 0x80 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_80624DC - - thumb_func_start sub_80624F8 -sub_80624F8: @ 80624F8 - push {lr} - ldr r3, =0x02022d0c - ldr r1, =0x02023064 - ldr r0, =0x02024064 - 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 dp01_tbl7_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_80624F8 - - thumb_func_start sub_8062530 -sub_8062530: @ 8062530 - push {lr} - ldr r2, =0x02022d0c - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_8062530 - - thumb_func_start sub_8062548 -sub_8062548: @ 8062548 - push {lr} - ldr r3, =0x02022d0c - 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 dp01_tbl7_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_8062548 - - thumb_func_start dp01t_29_7_blink -dp01t_29_7_blink: @ 8062570 - push {r4,lr} - ldr r3, =0x02020630 - ldr r2, =0x020241e4 - ldr r4, =0x02024064 - 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 _080625A4 - bl dp01_tbl7_exec_completed - b _080625CE - .pool -_080625A4: - ldr r1, =0x020244b9 - 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, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_blink_t7 - str r1, [r0] -_080625CE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_29_7_blink - - thumb_func_start sub_80625E0 -sub_80625E0: @ 80625E0 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_80625E0 - - thumb_func_start sub_80625EC -sub_80625EC: @ 80625EC - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - movs r3, 0x3F - cmp r0, 0 - bne _08062600 - movs r3, 0xC0 -_08062600: - ldr r2, =0x02023064 - 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 audio_play_and_stuff - bl dp01_tbl7_exec_completed - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80625EC - - thumb_func_start sub_8062630 -sub_8062630: @ 8062630 - push {r4,r5,lr} - ldr r4, =0x02023064 - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r3, r0, 9 - adds r0, r4, 0x3 - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0 - beq _0806266C - 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 song_play_for_text - b _08062680 - .pool -_0806266C: - 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 fanfare_play -_08062680: - bl dp01_tbl7_exec_completed - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8062630 - - thumb_func_start sub_806268C -sub_806268C: @ 806268C - push {lr} - ldr r1, =0x0202406e - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x19 - movs r2, 0x5 - bl sub_80A32E4 - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_806268C - - thumb_func_start dp01t_2E_7_battle_intro -dp01t_2E_7_battle_intro: @ 80626C8 - push {lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - bl battle_intro_launch - ldr r2, =0x020243fc - ldrh r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strh r0, [r2] - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_2E_7_battle_intro - - thumb_func_start sub_80626FC -sub_80626FC: @ 80626FC - push {r4-r6,lr} - ldr r5, =0x020241e4 - ldr r6, =0x02024064 - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - 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_806280C - bl oamt_set_x3A_32 - ldr r0, =sub_8062828 - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r4 - ldrb r0, [r6] - strh r0, [r1, 0x8] - ldr r3, =0x020244d0 - 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 _080627BE - ldr r0, =0x020244b4 - 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] -_080627BE: - ldr r0, [r3] - ldr r2, [r0, 0x8] - ldrb r0, [r2, 0x9] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x9] - ldr r1, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =nullsub_26 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80626FC - - thumb_func_start sub_806280C -sub_806280C: @ 806280C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x6] - bl sub_805DFE4 - adds r0, r4, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_806280C - - thumb_func_start sub_8062828 -sub_8062828: @ 8062828 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r7, =0x02024064 - ldrb r0, [r7] - mov r9, r0 - ldr r1, =0x03005e00 - 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 _0806286C - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0806286C - movs r0, 0x80 - lsls r0, 8 - ands r1, r0 - cmp r1, 0 - beq _080628A0 -_0806286C: - ldr r0, =0x02023064 - ldrb r1, [r7] - lsls r2, r1, 9 - adds r0, 0x1 - adds r2, r0 - ldr r0, =0x0202406e - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - strb r0, [r2] - ldrb r0, [r7] - movs r1, 0 - bl sub_80613DC - b _080628E0 - .pool -_080628A0: - ldr r4, =0x02023064 - ldrb r0, [r7] - lsls r1, r0, 9 - adds r4, 0x1 - adds r1, r4 - ldr r6, =0x0202406e - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - strb r0, [r1] - ldrb r0, [r7] - movs r1, 0 - bl sub_80613DC - 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_80613DC - ldrb r0, [r7] - eors r0, r5 - strb r0, [r7] -_080628E0: - ldr r1, =0x03005d60 - ldr r2, =0x02024064 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_805F560 - 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 sub_8062828 - - thumb_func_start dp01t_30_7_0803D67C -dp01t_30_7_0803D67C: @ 8062918 - push {r4-r7,lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _08062948 - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08062948 - bl dp01_tbl7_exec_completed - b _08062A12 - .pool -_08062948: - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r3, =0x02024064 - 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, =0x02023064 - ldrb r2, [r3] - lsls r0, r2, 9 - adds r1, 0x2 - adds r0, r1 - ldrb r0, [r0] - adds r7, r3, 0 - cmp r0, 0 - beq _080629B4 - 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 _080629AC - 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 _08062A12 - .pool -_080629AC: - movs r0, 0x1F - negs r0, r0 - ands r0, r2 - strb r0, [r3, 0x1] -_080629B4: - adds r5, r7, 0 - ldrb r0, [r5] - lsls r3, r0, 9 - ldr r4, =0x02023068 - 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, =0x020244b4 - ldrb r1, [r5] - adds r1, r2 - movs r3, 0 - strb r0, [r1] - ldr r6, =0x020244d0 - 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 _08062A06 - 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] -_08062A06: - ldr r0, =0x03005d60 - ldrb r1, [r7] - lsls r1, 2 - adds r1, r0 - ldr r0, =bx_0803D790_t7 - str r0, [r1] -_08062A12: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_30_7_0803D67C - - thumb_func_start bx_0803D790_t7 -bx_0803D790_t7: @ 8062A2C - push {r4,lr} - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r3, =0x02024064 - 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 _08062A64 - 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 dp01_tbl7_exec_completed -_08062A64: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end bx_0803D790_t7 - - thumb_func_start sub_8062A74 -sub_8062A74: @ 8062A74 - push {lr} - ldr r0, =0x020244d0 - ldr r1, [r0] - ldr r0, =0x02024064 - 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 _08062AA6 - ldr r2, =0x03005e00 - ldr r0, =0x020244b4 - 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] -_08062AA6: - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_8062A74 - - thumb_func_start sub_8062AC4 -sub_8062AC4: @ 8062AC4 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8062AC4 - - thumb_func_start sub_8062AD0 -sub_8062AD0: @ 8062AD0 - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl sub_80A6A90 - lsls r0, 24 - cmp r0, 0 - beq _08062B16 - ldr r3, =0x02020630 - ldr r0, =0x020241e4 - 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, =0x02023064 - 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 -_08062B16: - bl dp01_tbl7_exec_completed - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8062AD0 - - thumb_func_start dp01t_34_7_move_anim_start_t3 -dp01t_34_7_move_anim_start_t3: @ 8062B30 - push {r4-r6,lr} - sub sp, 0x4 - ldr r6, =0x02024064 - ldrb r0, [r6] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _08062B88 - ldr r5, =0x02023064 - 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 _08062B7C - bl dp01_tbl7_exec_completed - b _08062B88 - .pool -_08062B7C: - ldr r0, =0x03005d60 - ldrb r1, [r6] - lsls r1, 2 - adds r1, r0 - ldr r0, =bx_803B0F4 - str r0, [r1] -_08062B88: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_34_7_move_anim_start_t3 - - thumb_func_start sub_8062B98 -sub_8062B98: @ 8062B98 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8062B98 - - thumb_func_start sub_8062BA4 -sub_8062BA4: @ 8062BA4 - push {lr} - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8062BA4 - - thumb_func_start sub_8062BB0 -sub_8062BB0: @ 8062BB0 - push {lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x6 - ands r0, r1 - cmp r0, 0x2 - bne _08062BDA - ldr r2, =0x030022c0 - ldr r0, =0x00000439 - adds r3, r2, r0 - ldrb r1, [r3] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - ldr r0, =0x03005d00 - ldr r0, [r0] - str r0, [r2] - ldr r0, [r2, 0x8] - bl SetMainCallback2 -_08062BDA: - bl dp01_tbl7_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_8062BB0 - - thumb_func_start nullsub_91 -nullsub_91: @ 8062BF4 - bx lr - thumb_func_end nullsub_91 - - thumb_func_start ai_switch_perish_song -ai_switch_perish_song: @ 8062BF8 - push {lr} - ldr r1, =0x020242ac - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08062C50 - ldr r0, =0x020242bc - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xF] - lsls r0, 28 - cmp r0, 0 - bne _08062C50 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, r2, r0 - movs r1, 0xA5 - lsls r1, 2 - adds r0, r1 - movs r1, 0x6 - strb r1, [r0] - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - movs r0, 0x1 - b _08062C52 - .pool -_08062C50: - movs r0, 0 -_08062C52: - pop {r1} - bx r1 - thumb_func_end ai_switch_perish_song - - thumb_func_start sub_8062C58 -sub_8062C58: @ 8062C58 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08062C72 - b _08062E2C -_08062C72: - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_get_per_side_status - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r4, =0x02024084 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x58 - muls r0, r1 - adds r0, r4 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x19 - beq _08062C9E - b _08062E2C -_08062C9E: - mov r0, r10 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r2, r0, 24 - movs r6, 0 - mov r8, r4 - movs r7, 0x58 - adds r0, r2, 0 - muls r0, r7 - adds r4, r0, r4 - movs r0, 0x20 - adds r0, r4 - mov r9, r0 -_08062CBA: - lsls r1, r6, 1 - ldr r5, =0x02024064 - ldrb r0, [r5] - muls r0, r7 - adds r1, r0 - mov r0, r8 - adds r0, 0xC - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _08062CE8 - ldrh r1, [r4] - mov r3, r9 - ldrb r2, [r3] - bl ai_rate_move - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0x2 - ands r1, r0 - cmp r1, 0 - beq _08062CE8 - b _08062E2C -_08062CE8: - adds r6, 0x1 - cmp r6, 0x3 - ble _08062CBA - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x00808000 - ands r0, r1 - cmp r0, 0 - beq _08062D50 - ldrb r1, [r5] - movs r0, 0x2 - ands r0, r1 - adds r1, r5, 0 - cmp r0, 0 - bne _08062D20 - movs r4, 0 - movs r0, 0x3 - str r0, [sp] - b _08062D58 - .pool -_08062D20: - movs r4, 0x3 - movs r3, 0x6 - str r3, [sp] - b _08062D58 -_08062D28: - ldr r0, =0x02024064 - ldrb r0, [r0] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - movs r1, 0xA5 - lsls r1, 2 - adds r0, r1 - strb r6, [r0] - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - movs r0, 0x1 - b _08062E2E - .pool -_08062D50: - movs r4, 0 - movs r3, 0x6 - str r3, [sp] - adds r1, r5, 0 -_08062D58: - ldrb r0, [r1] - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x02024744 - mov r9, r1 - cmp r0, 0 - bne _08062D6C - ldr r3, =0x020244ec - mov r9, r3 -_08062D6C: - adds r6, r4, 0 - ldr r0, [sp] - cmp r6, r0 - bge _08062E2C -_08062D74: - movs r0, 0x64 - adds r5, r6, 0 - muls r5, r0 - mov r1, r9 - adds r4, r1, r5 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08062E24 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _08062E24 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _08062E24 - ldr r1, =0x0202406e - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r6, r0 - beq _08062E24 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - adds r0, r4, 0 - movs r1, 0x2E - bl pokemon_getattr - mov r0, r10 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r2, r0, 24 - movs r4, 0 - mov r8, r5 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r2 - adds r5, r0, r1 - adds r7, r5, 0 - adds r7, 0x20 -_08062DE0: - adds r1, r4, 0 - adds r1, 0xD - mov r0, r9 - add r0, r8 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - beq _08062E1E - ldrh r1, [r5] - ldrb r2, [r7] - bl ai_rate_move - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0x2 - ands r1, r0 - cmp r1, 0 - beq _08062E1E - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bls _08062D28 -_08062E1E: - adds r4, 0x1 - cmp r4, 0x3 - ble _08062DE0 -_08062E24: - adds r6, 0x1 - ldr r3, [sp] - cmp r6, r3 - blt _08062D74 -_08062E2C: - movs r0, 0 -_08062E2E: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8062C58 - - thumb_func_start sub_8062E54 -sub_8062E54: @ 8062E54 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - movs r0, 0x1 - bl ai_has_super_effective_move_on_field - lsls r0, 24 - cmp r0, 0 - beq _08062E82 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _08062E82 - b _080630AC -_08062E82: - ldr r1, =0x02024250 - ldr r5, =0x02024064 - ldrb r3, [r5] - lsls r0, r3, 1 - adds r4, r0, r1 - ldrh r1, [r4] - cmp r1, 0 - bne _08062E94 - b _080630AC -_08062E94: - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08062E9C - b _080630AC -_08062E9C: - ldr r2, =gBattleMoves - ldrh r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _08062EB0 - b _080630AC -_08062EB0: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08062F1A - mov r8, r3 - mov r0, r8 - bl battle_get_per_side_status - movs r4, 0x2 - eors r0, r4 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - ldr r1, =0x02024210 - ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 - lsls r0, 24 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08062F04 - ldrb r7, [r5] - b _08062F1E - .pool -_08062F04: - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r4 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r7, r0, 24 - b _08062F1E -_08062F1A: - adds r7, r3, 0 - mov r8, r7 -_08062F1E: - ldr r3, =gBattleMoves - ldr r1, =0x02024250 - ldr r2, =0x02024064 - ldrb r0, [r2] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x2] - cmp r0, 0xA - bne _08062F4C - movs r0, 0x12 - b _08062F5E - .pool -_08062F4C: - cmp r0, 0xB - bne _08062F56 - movs r1, 0xB - str r1, [sp] - b _08062F60 -_08062F56: - cmp r0, 0xD - beq _08062F5C - b _080630AC -_08062F5C: - movs r0, 0xA -_08062F5E: - str r0, [sp] -_08062F60: - ldr r1, =0x02024084 - ldrb r3, [r2] - movs r0, 0x58 - muls r0, r3 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - ldr r1, [sp] - cmp r0, r1 - bne _08062F76 - b _080630AC -_08062F76: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x00808000 - ands r0, r1 - cmp r0, 0 - beq _08062FCC - movs r0, 0x2 - ands r3, r0 - cmp r3, 0 - bne _08062F9C - movs r4, 0 - movs r0, 0x3 - b _08062FD0 - .pool -_08062F9C: - movs r4, 0x3 - movs r1, 0x6 - mov r10, r1 - b _08062FD2 -_08062FA4: - ldr r0, =0x02024064 - ldrb r0, [r0] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - movs r2, 0xA5 - lsls r2, 2 - adds r0, r2 - strb r5, [r0] - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - movs r0, 0x1 - b _080630AE - .pool -_08062FCC: - movs r4, 0 - movs r0, 0x6 -_08062FD0: - mov r10, r0 -_08062FD2: - ldrb r0, [r2] - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x02024744 - str r1, [sp, 0x4] - cmp r0, 0 - bne _08062FE6 - ldr r2, =0x020244ec - str r2, [sp, 0x4] -_08062FE6: - adds r5, r4, 0 - cmp r5, r10 - bge _080630AC - ldr r0, =gBaseStats - mov r9, r0 -_08062FF0: - movs r0, 0x64 - muls r0, r5 - ldr r1, [sp, 0x4] - adds r6, r1, r0 - adds r0, r6, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _080630A6 - adds r0, r6, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _080630A6 - adds r0, r6, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _080630A6 - ldr r1, =0x0202406e - mov r2, r8 - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r5, r0 - beq _080630A6 - lsls r0, r7, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r5, r0 - beq _080630A6 - ldr r0, =0x0202449c - ldr r1, [r0] - adds r0, r2, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r5, r0 - beq _080630A6 - adds r0, r7, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r5, r0 - beq _080630A6 - adds r0, r6, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r6, 0 - movs r1, 0x2E - bl pokemon_getattr - cmp r0, 0 - beq _08063088 - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - add r0, r9 - ldrb r0, [r0, 0x17] - b _08063092 - .pool -_08063088: - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - add r0, r9 - ldrb r0, [r0, 0x16] -_08063092: - ldr r1, [sp] - cmp r1, r0 - bne _080630A6 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _080630A6 - b _08062FA4 -_080630A6: - adds r5, 0x1 - cmp r5, r10 - blt _08062FF0 -_080630AC: - movs r0, 0 -_080630AE: - 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_8062E54 - - thumb_func_start ai_switchout_natural_cure -ai_switchout_natural_cure: @ 80630C0 - push {r4,r5,lr} - ldr r3, =0x02024084 - ldr r5, =0x02024064 - ldrb r4, [r5] - movs r0, 0x58 - adds r2, r4, 0 - muls r2, r0 - adds r0, r3, 0 - adds r0, 0x4C - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08063188 - adds r1, r2, r3 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1E - bne _08063188 - ldrh r0, [r1, 0x2C] - ldrh r1, [r1, 0x28] - lsrs r0, 1 - cmp r1, r0 - bcc _08063188 - ldr r1, =0x02024250 - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - cmp r1, 0 - beq _08063106 - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08063128 -_08063106: - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _08063128 - ldrb r0, [r5] - b _08063190 - .pool -_08063128: - ldr r2, =gBattleMoves - ldr r1, =0x02024250 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _08063160 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _08063160 - ldrb r0, [r4] - b _08063190 - .pool -_08063160: - movs r0, 0x8 - movs r1, 0x1 - bl ai_switchout_something - lsls r0, 24 - cmp r0, 0 - bne _080631AA - movs r0, 0x4 - movs r1, 0x1 - bl ai_switchout_something - lsls r0, 24 - cmp r0, 0 - bne _080631AA - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - bne _0806318C -_08063188: - movs r0, 0 - b _080631AC -_0806318C: - ldr r0, =0x02024064 - ldrb r0, [r0] -_08063190: - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - movs r1, 0xA5 - lsls r1, 2 - adds r0, r1 - movs r1, 0x6 - strb r1, [r0] - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb -_080631AA: - movs r0, 0x1 -_080631AC: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end ai_switchout_natural_cure - - thumb_func_start ai_has_super_effective_move_on_field -ai_has_super_effective_move_on_field: @ 80631BC - 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 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_get_per_side_status - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - lsls r0, r3, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08063256 - movs r4, 0 - ldr r6, =0x02024084 - movs r7, 0x58 - adds r0, r3, 0 - muls r0, r7 - adds r5, r0, r6 - movs r0, 0x20 - adds r0, r5 - mov r8, r0 -_0806320A: - lsls r1, r4, 1 - ldr r0, =0x02024064 - ldrb r0, [r0] - muls r0, r7 - adds r1, r0 - adds r0, r6, 0 - adds r0, 0xC - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _08063250 - ldrh r1, [r5] - mov r3, r8 - ldrb r2, [r3] - bl ai_rate_move - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0x2 - ands r1, r0 - cmp r1, 0 - beq _08063250 - mov r0, r9 - cmp r0, 0 - bne _08063278 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _08063278 -_08063250: - adds r4, 0x1 - cmp r4, 0x3 - ble _0806320A -_08063256: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0806327C - b _080632FA - .pool -_08063278: - movs r0, 0x1 - b _080632FC -_0806327C: - movs r1, 0x2 - mov r0, r10 - eors r0, r1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - lsls r0, r3, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _080632FA - movs r4, 0 - ldr r6, =0x02024084 - movs r7, 0x58 - adds r0, r3, 0 - muls r0, r7 - adds r5, r0, r6 - movs r3, 0x20 - adds r3, r5 - mov r8, r3 -_080632AE: - lsls r1, r4, 1 - ldr r0, =0x02024064 - ldrb r0, [r0] - muls r0, r7 - adds r1, r0 - adds r0, r6, 0 - adds r0, 0xC - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _080632F4 - ldrh r1, [r5] - mov r3, r8 - ldrb r2, [r3] - bl ai_rate_move - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0x2 - ands r1, r0 - cmp r1, 0 - beq _080632F4 - mov r0, r9 - cmp r0, 0 - bne _08063278 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _08063278 -_080632F4: - adds r4, 0x1 - cmp r4, 0x3 - ble _080632AE -_080632FA: - movs r0, 0 -_080632FC: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end ai_has_super_effective_move_on_field - - thumb_func_start ai_is_too_invested_in_stat_buffs -ai_is_too_invested_in_stat_buffs: @ 806331C - push {r4,lr} - movs r4, 0 - ldr r1, =0x02024084 - ldr r0, =0x02024064 - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x18 - adds r2, r0, r1 - movs r3, 0x7 -_08063330: - ldrb r1, [r2] - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r0, 0x6 - ble _08063346 - subs r1, 0x6 - lsls r0, r4, 24 - asrs r0, 24 - adds r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 -_08063346: - adds r2, 0x1 - subs r3, 0x1 - cmp r3, 0 - bge _08063330 - movs r0, 0 - cmp r4, 0x3 - bls _08063356 - movs r0, 0x1 -_08063356: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end ai_is_too_invested_in_stat_buffs - - thumb_func_start ai_switchout_something -ai_switchout_something: @ 8063364 - 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 r1, 24 - str r1, [sp, 0x4] - ldr r2, =0x02024250 - ldr r1, =0x02024064 - ldrb r3, [r1] - lsls r0, r3, 1 - adds r4, r0, r2 - ldrh r2, [r4] - adds r5, r1, 0 - cmp r2, 0 - bne _08063390 - b _080635EE -_08063390: - ldr r0, =0x0000ffff - cmp r2, r0 - bne _08063398 - b _080635EE -_08063398: - ldr r0, =0x02024270 - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0xFF - bne _080633A4 - b _080635EE -_080633A4: - ldr r2, =gBattleMoves - ldrh r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _080633B8 - b _080635EE -_080633B8: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0806342C - mov r9, r3 - mov r0, r9 - bl battle_get_per_side_status - movs r4, 0x2 - eors r0, r4 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - ldr r1, =0x02024210 - ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 - lsls r0, 24 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08063414 - ldrb r5, [r5] - mov r10, r5 - b _08063430 - .pool -_08063414: - ldrb r0, [r5] - bl battle_get_per_side_status - eors r0, r4 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - b _08063430 -_0806342C: - mov r9, r3 - mov r10, r9 -_08063430: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x00808000 - ands r0, r1 - cmp r0, 0 - beq _08063490 - ldr r2, =0x02024064 - ldrb r1, [r2] - movs r0, 0x2 - ands r0, r1 - adds r5, r2, 0 - cmp r0, 0 - bne _08063460 - movs r4, 0 - movs r0, 0x3 - str r0, [sp, 0x8] - b _08063498 - .pool -_08063460: - movs r4, 0x3 - movs r1, 0x6 - str r1, [sp, 0x8] - b _08063498 -_08063468: - ldr r0, =0x02024064 - ldrb r0, [r0] - ldr r1, =0x0202449c - ldr r1, [r1] - adds r0, r1 - movs r2, 0xA5 - lsls r2, 2 - adds r0, r2 - strb r6, [r0] - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - movs r0, 0x1 - b _080635F0 - .pool -_08063490: - movs r4, 0 - movs r0, 0x6 - str r0, [sp, 0x8] - ldr r5, =0x02024064 -_08063498: - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x02024744 - str r1, [sp, 0xC] - cmp r0, 0 - bne _080634AC - ldr r2, =0x020244ec - str r2, [sp, 0xC] -_080634AC: - adds r6, r4, 0 - b _080635E6 - .pool -_080634BC: - movs r0, 0x64 - muls r0, r6 - ldr r1, [sp, 0xC] - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - bne _080634D2 - b _080635E4 -_080634D2: - adds r0, r5, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - bne _080634E0 - b _080635E4 -_080634E0: - adds r0, r5, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _080635E4 - ldr r1, =0x0202406e - mov r2, r9 - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r6, r0 - beq _080635E4 - mov r2, r10 - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r6, r0 - beq _080635E4 - ldr r0, =0x0202449c - ldr r1, [r0] - mov r2, r9 - adds r0, r2, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r6, r0 - beq _080635E4 - mov r2, r10 - adds r0, r2, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r6, r0 - beq _080635E4 - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r5, 0 - movs r1, 0x2E - bl pokemon_getattr - cmp r0, 0 - beq _08063558 - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - ldr r1, =gBaseStats - adds r0, r1 - ldrb r2, [r0, 0x17] - b _08063564 - .pool -_08063558: - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - ldr r2, =gBaseStats - adds r0, r2 - ldrb r2, [r0, 0x16] -_08063564: - ldr r1, =0x02024250 - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - adds r1, r4, 0 - bl ai_rate_move - ldr r1, [sp] - ands r1, r0 - cmp r1, 0 - beq _080635E4 - ldr r1, =0x02024270 - ldrb r0, [r5] - adds r0, r1 - ldrb r0, [r0] - mov r9, r0 - movs r4, 0 - movs r0, 0x64 - adds r1, r6, 0 - muls r1, r0 - mov r8, r1 - ldr r1, =0x02024084 - movs r0, 0x58 - mov r2, r9 - muls r2, r0 - adds r0, r2, 0 - adds r5, r0, r1 - adds r7, r5, 0 - adds r7, 0x20 -_080635A2: - adds r1, r4, 0 - adds r1, 0xD - ldr r0, [sp, 0xC] - add r0, r8 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - beq _080635DE - ldrh r1, [r5] - ldrb r2, [r7] - bl ai_rate_move - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0x2 - ands r1, r0 - cmp r1, 0 - beq _080635DE - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - ldr r1, [sp, 0x4] - bl __modsi3 - cmp r0, 0 - bne _080635DE - b _08063468 -_080635DE: - adds r4, 0x1 - cmp r4, 0x3 - ble _080635A2 -_080635E4: - adds r6, 0x1 -_080635E6: - ldr r0, [sp, 0x8] - cmp r6, r0 - bge _080635EE - b _080634BC -_080635EE: - movs r0, 0 -_080635F0: - 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 ai_switchout_something - - thumb_func_start sub_8063614 -sub_8063614: @ 8063614 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r6, =0x02024084 - ldr r4, =0x02024064 - ldrb r2, [r4] - movs r5, 0x58 - adds r0, r2, 0 - muls r0, r5 - adds r1, r6, 0 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x0400e000 - ands r0, r1 - cmp r0, 0 - beq _0806363E - b _0806386C -_0806363E: - ldr r0, =0x020242ac - lsls r1, r2, 2 - adds r1, r0 - ldr r1, [r1] - movs r0, 0x80 - lsls r0, 3 - ands r1, r0 - cmp r1, 0 - beq _08063652 - b _0806386C -_08063652: - str r1, [sp] - movs r0, 0xC - adds r1, r2, 0 - movs r2, 0x17 - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _0806366A - b _0806386C -_0806366A: - ldrb r1, [r4] - str r0, [sp] - movs r0, 0xC - movs r2, 0x47 - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _08063682 - b _0806386C -_08063682: - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0x2A - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _080636B4 - ldrb r0, [r4] - muls r0, r5 - adds r1, r0, r6 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x8 - bne _080636A8 - b _0806386C -_080636A8: - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x8 - bne _080636B4 - b _0806386C -_080636B4: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 11 - ands r0, r1 - cmp r0, 0 - beq _080636C4 - b _0806386C -_080636C4: - movs r0, 0 - mov r10, r0 - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0806372E - ldrb r7, [r4] - adds r0, r7, 0 - bl battle_get_per_side_status - movs r5, 0x2 - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - ldr r1, =0x02024210 - ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 - lsls r0, 24 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08063718 - ldrb r6, [r4] - b _08063732 - .pool -_08063718: - ldrb r0, [r4] - bl battle_get_per_side_status - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r6, r0, 24 - b _08063732 -_0806372E: - ldrb r6, [r4] - adds r7, r6, 0 -_08063732: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x00808000 - ands r0, r1 - cmp r0, 0 - beq _08063768 - ldr r2, =0x02024064 - ldrb r1, [r2] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08063760 - movs r4, 0 - movs r1, 0x3 - mov r8, r1 - b _08063770 - .pool -_08063760: - movs r4, 0x3 - movs r0, 0x6 - mov r8, r0 - b _08063770 -_08063768: - movs r4, 0 - movs r1, 0x6 - mov r8, r1 - ldr r2, =0x02024064 -_08063770: - ldrb r0, [r2] - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x02024744 - mov r9, r1 - cmp r0, 0 - bne _08063784 - ldr r0, =0x020244ec - mov r9, r0 -_08063784: - adds r5, r4, 0 - cmp r5, r8 - bge _080637F2 -_0806378A: - movs r0, 0x64 - muls r0, r5 - mov r1, r9 - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _080637EC - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _080637EC - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _080637EC - ldr r1, =0x0202406e - lsls r0, r7, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r5, r0 - beq _080637EC - lsls r0, r6, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r5, r0 - beq _080637EC - ldr r0, =0x0202449c - ldr r1, [r0] - adds r0, r7, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r5, r0 - beq _080637EC - adds r0, r6, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r5, r0 - beq _080637EC - movs r0, 0x1 - add r10, r0 -_080637EC: - adds r5, 0x1 - cmp r5, r8 - blt _0806378A -_080637F2: - mov r1, r10 - cmp r1, 0 - beq _0806386C - bl ai_switch_perish_song - lsls r0, 24 - cmp r0, 0 - bne _08063852 - bl sub_8062C58 - lsls r0, 24 - cmp r0, 0 - bne _08063852 - bl sub_8062E54 - lsls r0, 24 - cmp r0, 0 - bne _08063852 - bl ai_switchout_natural_cure - lsls r0, 24 - cmp r0, 0 - bne _08063852 - movs r0, 0 - bl ai_has_super_effective_move_on_field - lsls r0, 24 - cmp r0, 0 - bne _0806386C - bl ai_is_too_invested_in_stat_buffs - lsls r0, 24 - cmp r0, 0 - bne _0806386C - movs r0, 0x8 - movs r1, 0x2 - bl ai_switchout_something - lsls r0, 24 - cmp r0, 0 - bne _08063852 - movs r0, 0x4 - movs r1, 0x3 - bl ai_switchout_something - lsls r0, 24 - cmp r0, 0 - beq _0806386C -_08063852: - movs r0, 0x1 - b _0806386E - .pool -_0806386C: - movs r0, 0 -_0806386E: - 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_8063614 - - thumb_func_start sub_8063880 -sub_8063880: @ 8063880 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r6, r0, 24 - adds r5, r6, 0 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x02024744 - mov r8, r1 - cmp r0, 0 - bne _080638A8 - ldr r2, =0x020244ec - mov r8, r2 -_080638A8: - ldr r7, =0x02022fec - ldr r0, [r7] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - bne _080638B6 - b _080639E6 -_080638B6: - bl sub_8063614 - lsls r0, 24 - cmp r0, 0 - bne _080638C2 - b _080639DC -_080638C2: - ldrb r0, [r4] - ldr r2, =0x0202449c - ldr r1, [r2] - adds r0, r1 - movs r1, 0xA5 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x6 - bne _080639B8 - bl sub_8063A90 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bne _080639A6 - ldr r0, [r7] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08063910 - adds r0, r6, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - b _08063928 - .pool -_08063910: - adds r0, r5, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0x2 - eors r5, r0 - adds r0, r5, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r5, r0, 24 -_08063928: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x00808000 - ands r0, r1 - cmp r0, 0 - beq _08063958 - ldr r0, =0x02024064 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08063954 - movs r0, 0 - movs r7, 0x3 - b _0806395C - .pool -_08063954: - movs r0, 0x3 - b _0806395A -_08063958: - movs r0, 0 -_0806395A: - movs r7, 0x6 -_0806395C: - adds r4, r0, 0 - cmp r4, r7 - bge _080639A6 -_08063962: - movs r0, 0x64 - muls r0, r4 - add r0, r8 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _080639A0 - ldr r1, =0x0202406e - lsls r0, r6, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r4, r0 - beq _080639A0 - lsls r0, r5, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r4, r0 - beq _080639A0 - ldr r0, =0x0202449c - ldr r1, [r0] - adds r0, r6, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r4, r0 - beq _080639A0 - adds r0, r5, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r4, r0 - bne _080639A6 -_080639A0: - adds r4, 0x1 - cmp r4, r7 - blt _08063962 -_080639A6: - ldr r0, =0x02024064 - ldrb r0, [r0] - ldr r2, =0x0202449c - ldr r1, [r2] - adds r0, r1 - movs r1, 0xA5 - lsls r1, 2 - adds r0, r1 - strb r4, [r0] -_080639B8: - ldr r0, =0x02024064 - ldrb r1, [r0] - ldr r0, [r2] - adds r0, r1, r0 - adds r1, r0, 0 - adds r1, 0x5C - movs r2, 0xA5 - lsls r2, 2 - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - b _080639F8 - .pool -_080639DC: - bl sub_8063EE0 - lsls r0, 24 - cmp r0, 0 - bne _080639F8 -_080639E6: - ldr r0, =0x02024064 - ldrb r0, [r0] - movs r2, 0x1 - eors r2, r0 - lsls r2, 8 - movs r0, 0x1 - movs r1, 0 - bl dp01_build_cmdbuf_x21_a_bb -_080639F8: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8063880 - - thumb_func_start sub_8063A08 -sub_8063A08: @ 8063A08 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r6, r3, 0 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - movs r7, 0 - ldr r0, =gUnknown_0831ACE8 - mov r10, r0 - ldrb r0, [r0] - cmp r0, 0xFF - beq _08063A7A - mov r5, r10 -_08063A36: - ldrb r0, [r5] - cmp r0, 0xFE - beq _08063A6C - ldr r1, [sp] - cmp r0, r1 - bne _08063A6C - ldrb r4, [r5, 0x1] - cmp r4, r9 - bne _08063A56 - ldrb r1, [r6] - ldrb r0, [r5, 0x2] - muls r0, r1 - movs r1, 0xA - bl __divsi3 - strb r0, [r6] -_08063A56: - cmp r4, r8 - bne _08063A6C - cmp r9, r8 - beq _08063A6C - ldrb r1, [r6] - ldrb r0, [r5, 0x2] - muls r0, r1 - movs r1, 0xA - bl __divsi3 - strb r0, [r6] -_08063A6C: - adds r5, 0x3 - adds r7, 0x3 - mov r1, r10 - adds r0, r7, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _08063A36 -_08063A7A: - 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_8063A08 - - thumb_func_start sub_8063A90 -sub_8063A90: @ 8063A90 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - ldr r4, =0x02024064 - ldrb r2, [r4] - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, r2, r0 - adds r1, r0, 0 - adds r1, 0x5C - ldrb r0, [r1] - cmp r0, 0x6 - beq _08063AB2 - b _08063E50 -_08063AB2: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 11 - ands r0, r1 - cmp r0, 0 - beq _08063AE0 - ldr r1, =0x0202406e - lsls r0, r2, 1 - adds r0, r1 - ldrb r0, [r0] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - b _08063E50 - .pool -_08063AE0: - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - beq _08063B6C - str r2, [sp, 0x10] - adds r0, r2, 0 - bl battle_get_per_side_status - movs r5, 0x2 - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - ldr r1, =0x02024210 - ldrb r1, [r1] - ldr r2, =gUnknown_0832A328 - lsls r0, 24 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08063B20 - ldrb r4, [r4] - str r4, [sp, 0x14] - b _08063B36 - .pool -_08063B20: - ldrb r0, [r4] - bl battle_get_per_side_status - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x14] -_08063B36: - bl GenerateRandomNumber - movs r3, 0x2 - ands r0, r3 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - ldr r4, [sp, 0x4] - lsls r0, r4, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08063B8A - eors r4, r3 - lsls r0, r4, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - b _08063B8A - .pool -_08063B6C: - adds r0, r2, 0 - bl battle_get_per_side_status - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - ldrb r4, [r4] - str r4, [sp, 0x14] - str r4, [sp, 0x10] -_08063B8A: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x00808000 - ands r0, r1 - cmp r0, 0 - beq _08063BC2 - ldr r2, =0x02024064 - ldrb r1, [r2] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08063BB8 - movs r0, 0 - str r0, [sp, 0x18] - movs r1, 0x3 - str r1, [sp, 0x1C] - b _08063BCC - .pool -_08063BB8: - movs r4, 0x3 - str r4, [sp, 0x18] - movs r0, 0x6 - str r0, [sp, 0x1C] - b _08063BCC -_08063BC2: - movs r1, 0 - str r1, [sp, 0x18] - movs r2, 0x6 - str r2, [sp, 0x1C] - ldr r2, =0x02024064 -_08063BCC: - ldrb r0, [r2] - bl battle_side_get_owner - lsls r0, 24 - ldr r4, =0x02024744 - str r4, [sp, 0x20] - cmp r0, 0 - bne _08063BE0 - ldr r0, =0x020244ec - str r0, [sp, 0x20] -_08063BE0: - movs r1, 0 - mov r9, r1 -_08063BE4: - movs r2, 0 - str r2, [sp, 0x8] - movs r4, 0x6 - str r4, [sp, 0xC] - ldr r7, [sp, 0x18] - ldr r0, [sp, 0x1C] - cmp r7, r0 - blt _08063BF6 - b _08063CF2 -_08063BF6: - lsls r0, r7, 2 - ldr r1, =gUnknown_0832A328 - adds r0, r1 - mov r8, r0 - mov r10, sp -_08063C00: - movs r0, 0x64 - muls r0, r7 - ldr r2, [sp, 0x20] - adds r4, r2, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - beq _08063CD8 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08063CD8 - mov r4, r8 - ldr r0, [r4] - mov r1, r9 - ands r0, r1 - cmp r0, 0 - bne _08063CD8 - ldr r1, =0x0202406e - ldr r2, [sp, 0x10] - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r7 - beq _08063CD8 - ldr r4, [sp, 0x14] - lsls r0, r4, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r7 - beq _08063CD8 - ldr r0, =0x0202449c - ldr r1, [r0] - adds r0, r2, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r7, r0 - beq _08063CD8 - adds r0, r4, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r7, r0 - beq _08063CD8 - ldr r1, =gBaseStats - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r5, [r0, 0x6] - ldrb r6, [r0, 0x7] - movs r0, 0xA - mov r1, r10 - strb r0, [r1] - movs r0, 0x58 - ldr r2, [sp, 0x4] - adds r4, r2, 0 - muls r4, r0 - ldr r0, =0x02024084 - adds r4, r0 - adds r0, r4, 0 - adds r0, 0x21 - ldrb r0, [r0] - adds r1, r5, 0 - adds r2, r6, 0 - mov r3, sp - bl sub_8063A08 - adds r4, 0x22 - ldrb r0, [r4] - adds r1, r5, 0 - adds r2, r6, 0 - mov r3, sp - bl sub_8063A08 - ldr r2, [sp, 0x8] - mov r1, r10 - ldrb r1, [r1] - cmp r2, r1 - bcs _08063CE6 - mov r2, r10 - ldrb r2, [r2] - str r2, [sp, 0x8] - lsls r0, r7, 24 - lsrs r0, 24 - str r0, [sp, 0xC] - b _08063CE6 - .pool -_08063CD8: - mov r4, r8 - ldr r0, [r4] - mov r1, r9 - orrs r1, r0 - lsls r0, r1, 24 - lsrs r0, 24 - mov r9, r0 -_08063CE6: - movs r2, 0x4 - add r8, r2 - adds r7, 0x1 - ldr r4, [sp, 0x1C] - cmp r7, r4 - blt _08063C00 -_08063CF2: - ldr r0, [sp, 0xC] - cmp r0, 0x6 - beq _08063D54 - movs r7, 0 - movs r0, 0x64 - ldr r1, [sp, 0xC] - adds r5, r1, 0 - muls r5, r0 -_08063D02: - adds r1, r7, 0 - adds r1, 0xD - ldr r2, [sp, 0x20] - adds r0, r2, r5 - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _08063D2A - ldr r0, =0x02024064 - ldrb r1, [r0] - adds r0, r4, 0 - ldr r2, [sp, 0x4] - bl move_effectiveness_something - movs r1, 0x2 - ands r1, r0 - cmp r1, 0 - bne _08063D30 -_08063D2A: - adds r7, 0x1 - cmp r7, 0x3 - ble _08063D02 -_08063D30: - cmp r7, 0x4 - beq _08063D36 - b _08063E4E -_08063D36: - ldr r4, [sp, 0xC] - lsls r0, r4, 2 - ldr r1, =gUnknown_0832A328 - adds r0, r1 - ldr r0, [r0] - mov r2, r9 - orrs r2, r0 - lsls r0, r2, 24 - lsrs r0, 24 - mov r9, r0 - b _08063D58 - .pool -_08063D54: - movs r4, 0x3F - mov r9, r4 -_08063D58: - mov r0, r9 - cmp r0, 0x3F - beq _08063D60 - b _08063BE4 -_08063D60: - ldr r0, =0x02024400 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x0202449c - ldr r0, [r0] - strb r1, [r0, 0x13] - ldr r0, =0x02024474 - movs r2, 0x1 - strb r2, [r0, 0xE] - ldr r0, =0x0202427c - strb r1, [r0] - ldr r0, =0x02024211 - strb r2, [r0] - movs r1, 0 - str r1, [sp, 0x8] - movs r2, 0x6 - str r2, [sp, 0xC] - ldr r7, [sp, 0x18] - ldr r4, [sp, 0x1C] - cmp r7, r4 - bge _08063E4E -_08063D8A: - movs r0, 0x64 - adds r6, r7, 0 - muls r6, r0 - ldr r0, [sp, 0x20] - adds r4, r0, r6 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - adds r1, r7, 0x1 - mov r10, r1 - cmp r0, 0 - beq _08063E46 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08063E46 - ldr r1, =0x0202406e - ldr r2, [sp, 0x10] - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r7 - beq _08063E46 - ldr r4, [sp, 0x14] - lsls r0, r4, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r7 - beq _08063E46 - ldr r0, =0x0202449c - ldr r1, [r0] - adds r0, r2, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r7, r0 - beq _08063E46 - adds r0, r4, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r7, r0 - beq _08063E46 - movs r5, 0 - mov r9, r6 - ldr r0, =0x020241f0 - mov r8, r0 - ldr r6, =0x02024064 -_08063DEE: - adds r1, r5, 0 - adds r1, 0xD - ldr r0, [sp, 0x20] - add r0, r9 - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0 - mov r1, r8 - str r0, [r1] - cmp r4, 0 - beq _08063E2A - ldr r0, =gBattleMoves - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0x1 - beq _08063E2A - ldrb r0, [r6] - ldr r1, [sp, 0x4] - bl sub_8046E7C - ldrb r1, [r6] - adds r0, r4, 0 - ldr r2, [sp, 0x4] - bl move_effectiveness_something -_08063E2A: - mov r2, r8 - ldr r0, [r2] - ldr r4, [sp, 0x8] - cmp r4, r0 - bge _08063E40 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - lsls r0, r7, 24 - lsrs r0, 24 - str r0, [sp, 0xC] -_08063E40: - adds r5, 0x1 - cmp r5, 0x3 - ble _08063DEE -_08063E46: - mov r7, r10 - ldr r0, [sp, 0x1C] - cmp r7, r0 - blt _08063D8A -_08063E4E: - ldr r0, [sp, 0xC] -_08063E50: - 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_8063A90 - - thumb_func_start ai_identify_item_effect -ai_identify_item_effect: @ 8063E84 - push {r4,lr} - adds r2, r1, 0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - bne _08063E94 - movs r0, 0x1 - b _08063EDA -_08063E94: - ldrb r1, [r2, 0x4] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08063EA2 - movs r0, 0x2 - b _08063EDA -_08063EA2: - ldrb r4, [r2, 0x3] - movs r3, 0x3F - adds r0, r3, 0 - ands r0, r4 - cmp r0, 0 - beq _08063EB2 - movs r0, 0x3 - b _08063EDA -_08063EB2: - ldrb r1, [r2] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _08063EC8 - ldrb r0, [r2, 0x1] - cmp r0, 0 - bne _08063EC8 - ldrb r0, [r2, 0x2] - cmp r0, 0 - beq _08063ECC -_08063EC8: - movs r0, 0x4 - b _08063EDA -_08063ECC: - movs r0, 0x80 - ands r0, r4 - cmp r0, 0 - bne _08063ED8 - movs r0, 0x6 - b _08063EDA -_08063ED8: - movs r0, 0x5 -_08063EDA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end ai_identify_item_effect - - thumb_func_start sub_8063EE0 -sub_8063EE0: @ 8063EE0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r0, 0 - mov r10, r0 - movs r7, 0 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _08063F12 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08063F12 - b _0806437C -_08063F12: - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - ldr r5, =0x02024744 - cmp r0, 0 - bne _08063F24 - ldr r5, =0x020244ec -_08063F24: - movs r1, 0 - mov r8, r1 -_08063F28: - movs r0, 0x64 - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - adds r4, r5, r0 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08063F64 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _08063F64 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _08063F64 - mov r0, r10 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 -_08063F64: - movs r0, 0x1 - add r8, r0 - mov r1, r8 - cmp r1, 0x5 - ble _08063F28 - movs r2, 0 - mov r8, r2 -_08063F72: - ldr r1, =0x020244a8 - mov r0, r8 - cmp r0, 0 - beq _08063F8E - ldr r0, [r1] - ldr r0, [r0, 0x18] - adds r0, 0x50 - ldrb r0, [r0] - mov r2, r8 - subs r0, r2 - adds r0, 0x1 - cmp r10, r0 - ble _08063F8E - b _08064370 -_08063F8E: - ldr r0, [r1] - ldr r0, [r0, 0x18] - mov r2, r8 - lsls r1, r2, 1 - adds r0, 0x48 - adds r0, r1 - ldrh r0, [r0] - mov r9, r0 - str r1, [sp] - cmp r0, 0 - bne _08063FA6 - b _08064370 -_08063FA6: - ldr r1, =gItemEffectInfoPointers - subs r0, 0xD - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - cmp r1, 0 - bne _08063FB6 - b _08064370 -_08063FB6: - mov r0, r9 - cmp r0, 0xAF - bne _08063FE8 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003214 - adds r5, r0, r1 - b _08063FEA - .pool -_08063FE8: - adds r5, r1, 0 -_08063FEA: - mov r2, r9 - lsls r0, r2, 24 - lsrs r0, 24 - adds r1, r5, 0 - bl ai_identify_item_effect - ldr r4, =0x02024064 - ldrb r1, [r4] - lsrs r1, 1 - ldr r3, =0x0202449c - ldr r2, [r3] - adds r1, r2 - adds r1, 0xC4 - strb r0, [r1] - ldrb r0, [r4] - lsrs r0, 1 - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC4 - ldrb r0, [r0] - subs r0, 0x1 - cmp r0, 0x5 - bls _0806401A - b _08064324 -_0806401A: - lsls r0, 2 - ldr r1, =_08064030 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08064030: - .4byte _08064048 - .4byte _08064074 - .4byte _080640BC - .4byte _08064214 - .4byte _080642F4 - .4byte _0806437C -_08064048: - ldr r2, =0x02024084 - ldr r0, =0x02024064 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r1, [r0, 0x2C] - ldrh r0, [r0, 0x28] - lsrs r1, 2 - cmp r0, r1 - bcc _08064060 - b _08064324 -_08064060: - cmp r0, 0 - bne _08064066 - b _08064324 -_08064066: - movs r7, 0x1 - b _08064328 - .pool -_08064074: - mov r0, r9 - movs r1, 0x4 - movs r2, 0x4 - bl sub_806CDDC - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _08064088 - b _08064324 -_08064088: - ldr r2, =0x02024084 - ldr r0, =0x02024064 - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r1, r0, r2 - ldrh r2, [r1, 0x28] - cmp r2, 0 - bne _0806409C - b _08064324 -_0806409C: - ldrh r3, [r1, 0x2C] - lsrs r0, r3, 2 - cmp r2, r0 - bcc _08064066 - adds r0, r2, 0 - subs r0, r3, r0 - adds r1, r5, r4 - ldrb r1, [r1] - cmp r0, r1 - bgt _080640B2 - b _08064324 -_080640B2: - b _08064066 - .pool -_080640BC: - ldr r3, =0x02024064 - ldrb r0, [r3] - lsrs r0, 1 - ldr r2, =0x0202449c - ldr r1, [r2] - adds r0, r1 - adds r0, 0xC6 - movs r1, 0 - strb r1, [r0] - ldrb r1, [r5, 0x3] - movs r6, 0x20 - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08064100 - ldr r1, =0x02024084 - ldrb r4, [r3] - movs r0, 0x58 - muls r0, r4 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08064100 - lsrs r1, r4, 1 - ldr r0, [r2] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - orrs r0, r6 - strb r0, [r1] - movs r7, 0x1 -_08064100: - ldrb r1, [r5, 0x3] - movs r6, 0x10 - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0806413A - ldr r1, =0x02024084 - ldrb r4, [r3] - movs r0, 0x58 - muls r0, r4 - adds r1, 0x4C - adds r0, r1 - ldr r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - bne _0806412A - movs r0, 0x80 - ands r1, r0 - cmp r1, 0 - beq _0806413A -_0806412A: - lsrs r1, r4, 1 - ldr r0, [r2] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - orrs r0, r6 - strb r0, [r1] - movs r7, 0x1 -_0806413A: - ldrb r1, [r5, 0x3] - movs r6, 0x8 - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0806416C - ldr r1, =0x02024084 - ldrb r4, [r3] - movs r0, 0x58 - muls r0, r4 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0806416C - lsrs r1, r4, 1 - ldr r0, [r2] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - orrs r0, r6 - strb r0, [r1] - movs r7, 0x1 -_0806416C: - ldrb r1, [r5, 0x3] - movs r6, 0x4 - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0806419E - ldr r1, =0x02024084 - ldrb r4, [r3] - movs r0, 0x58 - muls r0, r4 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0806419E - lsrs r1, r4, 1 - ldr r0, [r2] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - orrs r0, r6 - strb r0, [r1] - movs r7, 0x1 -_0806419E: - ldrb r1, [r5, 0x3] - movs r6, 0x2 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080641D0 - ldr r1, =0x02024084 - ldrb r4, [r3] - movs r0, 0x58 - muls r0, r4 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080641D0 - lsrs r1, r4, 1 - ldr r0, [r2] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - orrs r0, r6 - strb r0, [r1] - movs r7, 0x1 -_080641D0: - ldrb r1, [r5, 0x3] - movs r4, 0x1 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080641DE - b _08064324 -_080641DE: - ldr r1, =0x02024084 - ldrb r3, [r3] - movs r0, 0x58 - muls r0, r3 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _080641F6 - b _08064324 -_080641F6: - lsrs r1, r3, 1 - ldr r0, [r2] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - orrs r0, r4 - strb r0, [r1] - b _08064066 - .pool -_08064214: - ldr r4, =0x02024064 - ldrb r0, [r4] - lsrs r0, 1 - ldr r3, =0x0202449c - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC6 - movs r1, 0 - strb r1, [r0] - ldr r1, =0x020242bc - ldrb r2, [r4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x16] - cmp r0, 0 - beq _08064324 - ldrb r1, [r5] - movs r6, 0xF - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _08064254 - lsrs r2, 1 - ldr r0, [r3] - adds r2, r0 - adds r2, 0xC6 - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] -_08064254: - ldrb r1, [r5, 0x1] - movs r7, 0xF0 - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _08064272 - ldrb r0, [r4] - lsrs r0, 1 - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0] -_08064272: - ldrb r1, [r5, 0x1] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _0806428E - ldrb r0, [r4] - lsrs r0, 1 - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_0806428E: - ldrb r1, [r5, 0x2] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _080642AA - ldrb r0, [r4] - lsrs r0, 1 - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0] -_080642AA: - ldrb r1, [r5, 0x2] - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _080642C6 - ldrb r0, [r4] - lsrs r0, 1 - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0] -_080642C6: - ldrb r1, [r5] - movs r0, 0x30 - ands r0, r1 - cmp r0, 0 - bne _080642D2 - b _08064066 -_080642D2: - ldrb r0, [r4] - lsrs r0, 1 - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] - b _08064066 - .pool -_080642F4: - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =0x020242bc - ldrb r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x16] - cmp r0, 0 - beq _08064324 - ldr r0, =0x02024294 - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x4] - cmp r0, 0 - bne _08064324 - b _08064066 -_08064324: - cmp r7, 0 - beq _08064370 -_08064328: - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - ldr r0, =0x02024064 - ldrb r0, [r0] - lsrs r0, 1 - ldr r1, =0x0202449c - ldr r1, [r1] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC0 - mov r1, r9 - strb r1, [r0] - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x18] - adds r0, 0x48 - ldr r2, [sp] - adds r0, r2 - movs r1, 0 - strh r1, [r0] - adds r0, r7, 0 - b _0806437E - .pool -_08064370: - movs r0, 0x1 - add r8, r0 - mov r1, r8 - cmp r1, 0x3 - bgt _0806437C - b _08063F72 -_0806437C: - movs r0, 0 -_0806437E: - 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_8063EE0 - - thumb_func_start nullsub_28 -nullsub_28: @ 8064390 - bx lr - thumb_func_end nullsub_28 - - thumb_func_start sub_8064394 -sub_8064394: @ 8064394 - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80643B0 - str r1, [r0] - bx lr - .pool - thumb_func_end sub_8064394 - - thumb_func_start sub_80643B0 -sub_80643B0: @ 80643B0 - push {lr} - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldr r0, =0x02024064 - ldrb r3, [r0] - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _080643FC - ldr r0, =0x02023064 - lsls r1, r3, 9 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x38 - bhi _080643F8 - ldr r0, =gUnknown_0831C7B4 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 - b _080643FC - .pool -_080643F8: - bl sub_8065068 -_080643FC: - pop {r0} - bx r0 - thumb_func_end sub_80643B0 - - thumb_func_start sub_8064400 -sub_8064400: @ 8064400 - push {lr} - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - 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, =DummyObjectCallback - cmp r1, r0 - bne _08064424 - bl sub_8065068 -_08064424: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064400 - - thumb_func_start sub_8064438 -sub_8064438: @ 8064438 - push {lr} - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - 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, =DummyObjectCallback - cmp r1, r0 - bne _0806445C - bl sub_8065068 -_0806445C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064438 - - thumb_func_start sub_8064470 -sub_8064470: @ 8064470 - push {r4-r6,lr} - ldr r5, =0x02020630 - ldr r6, =0x020241e4 - ldr r4, =0x02024064 - 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, =DummyObjectCallback - cmp r1, r0 - bne _080644C2 - 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 obj_free_rotscale_entry - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - bl sub_8065068 -_080644C2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064470 - - thumb_func_start sub_80644D8 -sub_80644D8: @ 80644D8 - push {r4,lr} - ldr r4, =0x020244d0 - ldr r1, [r4] - ldr r3, =0x02024064 - 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 _08064510 - 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_8065068 -_08064510: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80644D8 - - thumb_func_start sub_8064520 -sub_8064520: @ 8064520 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r0, 0 - mov r8, r0 - movs r4, 0 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0806454C - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08064584 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08064584 -_0806454C: - ldr r2, =0x02020630 - ldr r1, =0x03005d70 - ldr r3, =0x02024064 - ldrb r0, [r3] - 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, =DummyObjectCallback - adds r7, r3, 0 - cmp r1, r0 - bne _080645C2 - b _080645CA - .pool -_08064584: - ldr r3, =0x02020630 - ldr r6, =0x03005d70 - ldr r2, =0x02024064 - ldrb r4, [r2] - adds r0, r4, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r5, r3, 0 - adds r5, 0x1C - adds r0, r5 - ldr r3, [r0] - ldr r0, =DummyObjectCallback - adds r7, r2, 0 - cmp r3, r0 - bne _080645C0 - movs r0, 0x2 - eors r4, r0 - adds r0, r4, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r0, [r0] - cmp r0, r3 - bne _080645C0 - movs r1, 0x1 - mov r8, r1 -_080645C0: - movs r4, 0x1 -_080645C2: - mov r0, r8 - cmp r0, 0 - bne _080645CA - b _08064714 -_080645CA: - cmp r4, 0 - bne _080645DE - ldrb r1, [r7] - movs r0, 0x2 - eors r0, r1 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - bne _0806469C -_080645DE: - ldr r1, =0x020244d0 - mov r12, r1 - ldr r0, [r1] - ldr r7, =0x02024064 - ldrb r2, [r7] - ldr r3, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r4, r0, r3 - ldrb r1, [r4, 0x1] - movs r5, 0x1 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _08064600 - b _08064714 -_08064600: - movs r6, 0x2 - adds r1, r6, 0 - eors r1, r2 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0, 0x1] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _08064714 - ldrb r1, [r4] - movs r3, 0x7F - adds r0, r3, 0 - ands r0, r1 - strb r0, [r4] - mov r1, r12 - ldr r0, [r1] - 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 r4, 0x2 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - strb r0, [r1, 0x1] - mov r0, r12 - ldr r2, [r0] - ldrb r0, [r7] - adds r1, r6, 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, [r7] - adds r1, r6, 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 FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - b _080646F2 - .pool -_0806469C: - ldr r3, =0x020244d0 - ldr r0, [r3] - 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 _08064714 - 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] - ldrb r0, [r7] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _080646F2 - ldr r4, =0x000027f9 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag -_080646F2: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r3, =0x02024064 - 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, =0x03005d60 - ldrb r0, [r3] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80644D8 - str r1, [r0] -_08064714: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064520 - - thumb_func_start sub_8064734 -sub_8064734: @ 8064734 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r0, 0 - mov r10, r0 - ldr r5, =0x020244d0 - ldr r0, [r5] - ldr r4, =0x02024064 - ldrb r2, [r4] - ldr r1, [r0, 0x4] - lsls r3, r2, 1 - adds r0, r3, r2 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0] - movs r6, 0xC4 - lsls r6, 1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _08064776 - ldr r0, =0x0202406e - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_08064776: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _080647B4 - 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 - ldrh r1, [r0] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _080647B4 - ldr r0, =0x0202406e - adds r0, r2, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - adds r1, r0 - adds r0, r3, 0 - bl sub_8172EF0 -_080647B4: - ldr r3, =0x020244d0 - ldr r0, [r3] - ldr r2, =0x02024064 - 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 r8, r3 - mov r9, r2 - cmp r0, 0 - bne _08064898 - 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 _08064898 - ldrb r1, [r6, 0x1] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0806487A - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0806484A - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0806484A - ldr r4, =0x03005d70 - mov r1, r9 - ldrb r0, [r1] - adds r1, r7, 0 - eors r1, r0 - adds r0, r1, r4 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - 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 -_0806484A: - ldr r5, =0x03005d70 - ldr r4, =0x02024064 - ldrb r1, [r4] - adds r0, r1, r5 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - 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 -_0806487A: - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r3, =0x02024064 - 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 r8, r4 - mov r9, r3 -_08064898: - 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 _0806495A - 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 _0806495A - bl sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - bne _0806495A - 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 _0806493C - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x42 - ands r0, r1 - cmp r0, 0x42 - bne _08064930 - adds r0, r2, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0806493C - ldr r0, =0x03007420 - bl m4aMPlayContinue - b _0806493C - .pool -_08064930: - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl -_0806493C: - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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 -_0806495A: - mov r1, r10 - cmp r1, 0 - bne _08064962 - b _08064AC0 -_08064962: - ldr r2, =0x02020630 - ldr r0, =0x03005d7c - ldr r5, =0x02024064 - ldrb r3, [r5] - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r4, [r0] - ldr r0, =DummyObjectCallback - cmp r4, r0 - beq _08064982 - b _08064AC0 -_08064982: - ldr r0, =0x020241e4 - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - cmp r0, r4 - beq _08064998 - b _08064AC0 -_08064998: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080649E2 - adds r0, r3, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _080649E2 - ldr r3, =0x020244d0 - ldr r0, [r3] - ldrb r2, [r5] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x9] - adds r0, 0x1 - strb r0, [r1, 0x9] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08064AC0 - ldr r0, [r3] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strb r1, [r0, 0x9] -_080649E2: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08064A3A - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08064A3A - ldr r1, =0x03005d7c - ldr r5, =0x02024064 - 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, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - ldrb r0, [r5] - eors r4, r0 - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_805EE54 -_08064A3A: - ldr r1, =0x03005d7c - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - ldrb r5, [r4] - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - bl sub_805EE54 - ldr r3, =0x020244d0 - 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, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064520 - str r1, [r0] -_08064AC0: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064734 - - thumb_func_start sub_8064B04 -sub_8064B04: @ 8064B04 - push {r4-r7,lr} - ldr r4, =0x02020630 - ldr r0, =0x020241e4 - ldr r7, =0x02024064 - 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, =DummyObjectCallback - cmp r1, r0 - bne _08064BB6 - adds r0, r2, r4 - movs r1, 0x24 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08064BB6 - ldr r6, =0x020244d0 - 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 _08064B7C - ldr r0, =0x0202406e - adds r0, r4, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - adds r1, r0 - adds r0, r3, 0 - bl sub_8172EF0 - b _08064BB6 - .pool -_08064B7C: - ldrb r1, [r2, 0x1] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08064BB6 - 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 FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - bl sub_8065068 -_08064BB6: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064B04 - - thumb_func_start sub_8064BC0 -sub_8064BC0: @ 8064BC0 - push {r4-r6,lr} - ldr r6, =0x02024064 - ldrb r0, [r6] - ldr r5, =0x03005d70 - 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 _08064C08 - ldrb r0, [r6] - adds r0, r5 - ldrb r0, [r0] - movs r2, 0 - bl heathbar_draw_hp - b _08064C0C - .pool -_08064C08: - bl sub_8065068 -_08064C0C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8064BC0 - - thumb_func_start sub_8064C14 -sub_8064C14: @ 8064C14 - push {lr} - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - ldr r1, =0x02024064 - 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 _08064C42 - ldr r0, =0x03005d70 - adds r0, r3, r0 - ldrb r0, [r0] - bl sub_8072984 - bl sub_8065068 -_08064C42: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064C14 - - thumb_func_start sub_8064C58 -sub_8064C58: @ 8064C58 - push {r4-r6,lr} - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r6, =0x02024064 - 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 _08064CB2 - ldr r5, =0x020241e4 - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldrb r0, [r6] - bl sub_805EEE0 - ldr r1, =0x03005d70 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl sub_8065068 -_08064CB2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064C58 - - thumb_func_start sub_8064CCC -sub_8064CCC: @ 8064CCC - push {lr} - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _08064CDE - bl sub_8065068 -_08064CDE: - pop {r0} - bx r0 - thumb_func_end sub_8064CCC - - thumb_func_start sub_8064CE4 -sub_8064CE4: @ 8064CE4 - push {r4,lr} - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - ldr r2, =0x02020630 - 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 _08064D30 - 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, =0x020244b9 - strb r3, [r0] - bl sub_8065068 - b _08064D5A - .pool -_08064D30: - ldrh r0, [r4, 0x30] - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _08064D54 - 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] -_08064D54: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] -_08064D5A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8064CE4 - - thumb_func_start sub_8064D60 -sub_8064D60: @ 8064D60 - push {r4,lr} - ldr r2, =0x02020630 - ldr r0, =0x03005d70 - ldr r4, =0x02024064 - 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, =DummyObjectCallback - cmp r1, r0 - bne _08064DAC - ldr r0, =0x020244d0 - 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 _08064DA0 - adds r0, r3, 0 - adds r1, r3, 0 - adds r2, r3, 0 - movs r3, 0x6 - bl move_anim_start_t4 -_08064DA0: - ldr r0, =0x03005d60 - ldrb r1, [r4] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_8064DD0 - str r0, [r1] -_08064DAC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064D60 - - thumb_func_start sub_8064DD0 -sub_8064DD0: @ 8064DD0 - push {r4,lr} - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r4, =0x02024064 - 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 _08064E2A - bl sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - bne _08064E2A - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - 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, =DummyObjectCallback - cmp r1, r0 - beq _08064E1A - ldr r0, =nullsub_18 - cmp r1, r0 - bne _08064E2A -_08064E1A: - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl - bl sub_8065068 -_08064E2A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064DD0 - - thumb_func_start sub_8064E50 -sub_8064E50: @ 8064E50 - push {r4-r7,lr} - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r5, =0x02024064 - 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 _08064F0C - ldr r7, =0x02020630 - ldr r6, =0x020241e4 - 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, =DummyObjectCallback - cmp r1, r0 - bne _08064F0C - 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 FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - 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 StartObjectImageAnim - ldr r4, =0x03005d70 - ldrb r1, [r5] - adds r0, r1, r4 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - 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, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064D60 - str r1, [r0] -_08064F0C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064E50 - - thumb_func_start sub_8064F40 -sub_8064F40: @ 8064F40 - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r0, [r6] - ldr r5, =0x02024064 - 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 _08064F72 - ldr r0, =0x0202406e - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_08064F72: - ldr r4, =0x02020630 - ldr r0, =0x03005d7c - 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, =DummyObjectCallback - cmp r1, r0 - bne _08064FDC - 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 _08064FDC - adds r0, r3, r4 - bl RemoveObjectAndFreeTiles - ldrb r4, [r5] - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_805EE54 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064E50 - str r1, [r0] -_08064FDC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8064F40 - - thumb_func_start sub_8065008 -sub_8065008: @ 8065008 - push {lr} - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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 _0806502A - bl sub_8065068 -_0806502A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8065008 - - thumb_func_start sub_8065038 -sub_8065038: @ 8065038 - push {lr} - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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 _0806505A - bl sub_8065068 -_0806505A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8065038 - - thumb_func_start sub_8065068 -sub_8065068: @ 8065068 - push {r4,lr} - sub sp, 0x4 - ldr r1, =0x03005d60 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80643B0 - str r1, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080650BC - bl link_get_multiplayer_id - mov r1, sp - strb r0, [r1] - movs r0, 0x2 - movs r1, 0x4 - mov r2, sp - bl dp01_prepare_buffer_wireless_probably - ldr r1, =0x02023064 - ldrb r0, [r4] - lsls r0, 9 - adds r0, r1 - movs r1, 0x38 - strb r1, [r0] - b _080650CE - .pool -_080650BC: - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldr r0, [r2] - bics r0, r1 - str r0, [r2] -_080650CE: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8065068 - - thumb_func_start dp01t_00_2_getattr -dp01t_00_2_getattr: @ 80650E0 - push {r4-r6,lr} - sub sp, 0x100 - movs r6, 0 - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _08065118 - ldr r0, =0x0202406e - lsls r1, r2, 1 - adds r1, r0 - ldrb r0, [r1] - mov r1, sp - bl dp01_getattr_by_ch1_for_opponent_pokemon - adds r6, r0, 0 - b _0806513A - .pool -_08065118: - ldrb r4, [r1] - movs r5, 0 -_0806511C: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _08065132 - lsls r0, r5, 24 - lsrs r0, 24 - mov r2, sp - adds r1, r2, r6 - bl dp01_getattr_by_ch1_for_opponent_pokemon - adds r6, r0 -_08065132: - lsrs r4, 1 - adds r5, 0x1 - cmp r5, 0x5 - ble _0806511C -_0806513A: - lsls r1, r6, 16 - lsrs r1, 16 - movs r0, 0x1 - mov r2, sp - bl dp01_build_cmdbuf_x1D_1D_numargs_varargs - bl sub_8065068 - add sp, 0x100 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end dp01t_00_2_getattr - - thumb_func_start dp01_getattr_by_ch1_for_opponent_pokemon -dp01_getattr_by_ch1_for_opponent_pokemon: @ 8065154 - 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, =0x02023064 - ldr r3, =0x02024064 - ldrb r0, [r3] - lsls r0, 9 - adds r1, r2, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3B - bls _0806517E - bl _080658EA -_0806517E: - lsls r0, 2 - ldr r1, =_08065194 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08065194: - .4byte _08065284 - .4byte _080654A8 - .4byte _080654B8 - .4byte _080654C8 - .4byte _08065530 - .4byte _08065530 - .4byte _08065530 - .4byte _08065530 - .4byte _0806554C - .4byte _08065588 - .4byte _08065588 - .4byte _08065588 - .4byte _08065588 - .4byte _080658EA - .4byte _080658EA - .4byte _080658EA - .4byte _080658EA - .4byte _080655A4 - .4byte _080655B4 - .4byte _080655E4 - .4byte _080655F4 - .4byte _08065604 - .4byte _08065614 - .4byte _08065624 - .4byte _08065634 - .4byte _08065644 - .4byte _08065654 - .4byte _08065664 - .4byte _08065674 - .4byte _08065684 - .4byte _08065694 - .4byte _080656A4 - .4byte _080656F4 - .4byte _08065704 - .4byte _08065714 - .4byte _08065724 - .4byte _08065734 - .4byte _08065744 - .4byte _08065754 - .4byte _08065764 - .4byte _08065774 - .4byte _080657A8 - .4byte _080657B8 - .4byte _080657C8 - .4byte _080657D8 - .4byte _080657E8 - .4byte _080657F8 - .4byte _08065808 - .4byte _08065818 - .4byte _08065838 - .4byte _08065848 - .4byte _08065858 - .4byte _08065868 - .4byte _08065878 - .4byte _08065888 - .4byte _08065898 - .4byte _080658A8 - .4byte _080658B8 - .4byte _080658C8 - .4byte _080658D8 -_08065284: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - mov r1, sp - strh r0, [r1] - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr - 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 -_080652D0: - adds r1, r6, 0 - adds r1, 0xD - mov r0, r8 - bl pokemon_getattr - strh r0, [r4] - adds r1, r6, 0 - adds r1, 0x11 - mov r0, r8 - bl pokemon_getattr - mov r2, r9 - adds r1, r2, r6 - strb r0, [r1] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _080652D0 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - bl pokemon_getattr - mov r1, r10 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x20 - bl pokemon_getattr - ldr r2, [sp, 0x80] - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x19 - bl pokemon_getattr - str r0, [sp, 0x44] - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - str r0, [sp, 0x48] - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - str r0, [sp, 0x4C] - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - ldr r1, [sp, 0x7C] - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x28] - adds r0, r4, 0 - movs r1, 0x3A - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2C] - adds r0, r4, 0 - movs r1, 0x3B - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2] - adds r0, r4, 0 - movs r1, 0x3C - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x4] - adds r0, r4, 0 - movs r1, 0x3D - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x6] - adds r0, r4, 0 - movs r1, 0x3E - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x8] - adds r0, r4, 0 - movs r1, 0x3F - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0xA] - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - str r0, [sp, 0x54] - adds r0, r4, 0 - movs r1, 0x2 - ldr r2, [sp, 0x8C] - bl pokemon_getattr - ldr r0, [sp, 0x84] - ldr r1, [sp, 0x8C] - bl CopyString_Limit10 - adds r0, r4, 0 - movs r1, 0x7 - ldr r2, [sp, 0x88] - bl pokemon_getattr - mov r2, sp - movs r6, 0 -_08065488: - adds r0, r7, r6 - adds r1, r2, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0x57 - bls _08065488 - b _080658EA - .pool -_080654A8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - b _08065822 - .pool -_080654B8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xC - b _08065822 - .pool -_080654C8: - 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, =0x02024744 - adds r4, r1, r0 - mov r8, r9 -_080654DE: - adds r1, r6, 0 - adds r1, 0xD - adds r0, r4, 0 - bl pokemon_getattr - mov r1, r8 - strh r0, [r1] - adds r1, r6, 0 - adds r1, 0x11 - adds r0, r4, 0 - bl pokemon_getattr - mov r2, r10 - adds r1, r2, r6 - strb r0, [r1] - movs r0, 0x2 - add r8, r0 - adds r6, 0x1 - cmp r6, 0x3 - ble _080654DE - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - mov r1, r9 - strb r0, [r1, 0xC] - mov r2, r9 - movs r6, 0 -_0806551C: - adds r0, r7, r6 - adds r1, r2, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0xF - bls _0806551C - b _080658EA - .pool -_08065530: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r1, [r3] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - adds r1, 0x9 - b _08065822 - .pool -_0806554C: - movs r6, 0 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r2, =0x02024744 - mov r8, r2 -_08065558: - adds r1, r6, 0 - adds r1, 0x11 - mov r2, r8 - adds r0, r4, r2 - bl pokemon_getattr - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - cmp r6, 0x3 - ble _08065558 - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - b _080658EA - .pool -_08065588: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r1, [r3] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - adds r1, 0x8 - b _080658E2 - .pool -_080655A4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1 - b _080655BE - .pool -_080655B4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x19 -_080655BE: - bl pokemon_getattr - 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 _080658EA - .pool -_080655E4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1A - b _080658E2 - .pool -_080655F4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1B - b _080658E2 - .pool -_08065604: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1C - b _080658E2 - .pool -_08065614: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1D - b _080658E2 - .pool -_08065624: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1E - b _080658E2 - .pool -_08065634: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1F - b _080658E2 - .pool -_08065644: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x20 - b _080658E2 - .pool -_08065654: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x22 - b _080658E2 - .pool -_08065664: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x23 - b _080658E2 - .pool -_08065674: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x24 - b _080658E2 - .pool -_08065684: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x25 - b _080658E2 - .pool -_08065694: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x26 - b _080658E2 - .pool -_080656A4: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_getattr - strb r0, [r7] - adds r0, r4, 0 - movs r1, 0x28 - bl pokemon_getattr - strb r0, [r7, 0x1] - adds r0, r4, 0 - movs r1, 0x29 - bl pokemon_getattr - strb r0, [r7, 0x2] - adds r0, r4, 0 - movs r1, 0x2A - bl pokemon_getattr - strb r0, [r7, 0x3] - adds r0, r4, 0 - movs r1, 0x2B - bl pokemon_getattr - strb r0, [r7, 0x4] - adds r0, r4, 0 - movs r1, 0x2C - bl pokemon_getattr - strb r0, [r7, 0x5] - movs r6, 0x6 - b _080658EA - .pool -_080656F4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x27 - b _080658E2 - .pool -_08065704: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x28 - b _080658E2 - .pool -_08065714: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x29 - b _080658E2 - .pool -_08065724: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2A - b _080658E2 - .pool -_08065734: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2B - b _080658E2 - .pool -_08065744: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2C - b _080658E2 - .pool -_08065754: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0 - b _0806577E - .pool -_08065764: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x9 - b _08065822 - .pool -_08065774: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x37 -_0806577E: - bl pokemon_getattr - 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 _080658EA - .pool -_080657A8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x38 - b _080658E2 - .pool -_080657B8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x39 - b _08065822 - .pool -_080657C8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3A - b _08065822 - .pool -_080657D8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3B - b _08065822 - .pool -_080657E8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3C - b _08065822 - .pool -_080657F8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3D - b _08065822 - .pool -_08065808: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3E - b _08065822 - .pool -_08065818: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3F -_08065822: - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - strb r0, [r7] - lsrs r0, 8 - strb r0, [r7, 0x1] - movs r6, 0x2 - b _080658EA - .pool -_08065838: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x16 - b _080658E2 - .pool -_08065848: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x17 - b _080658E2 - .pool -_08065858: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x18 - b _080658E2 - .pool -_08065868: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x21 - b _080658E2 - .pool -_08065878: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2F - b _080658E2 - .pool -_08065888: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x30 - b _080658E2 - .pool -_08065898: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x32 - b _080658E2 - .pool -_080658A8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x33 - b _080658E2 - .pool -_080658B8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x34 - b _080658E2 - .pool -_080658C8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x35 - b _080658E2 - .pool -_080658D8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x36 -_080658E2: - bl pokemon_getattr - strb r0, [r7] - movs r6, 0x1 -_080658EA: - 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 dp01_getattr_by_ch1_for_opponent_pokemon - - thumb_func_start sub_8065900 -sub_8065900: @ 8065900 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8065900 - - thumb_func_start sub_806590C -sub_806590C: @ 806590C - push {r4,r5,lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _0806593C - ldr r0, =0x0202406e - lsls r1, r2, 1 - adds r1, r0 - ldrb r0, [r1] - bl sub_8065964 - b _0806595A - .pool -_0806593C: - ldrb r4, [r1] - movs r5, 0 -_08065940: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0806594E - adds r0, r5, 0 - bl sub_8065964 -_0806594E: - lsrs r4, 1 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _08065940 -_0806595A: - bl sub_8065068 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_806590C - - thumb_func_start sub_8065964 -sub_8065964: @ 8065964 - 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, =0x02024064 - ldrb r0, [r3] - lsls r0, 9 - ldr r2, =0x02023067 - 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 _08065992 - bl _08066270 -_08065992: - lsls r0, 2 - ldr r1, =_080659A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080659A8: - .4byte _08065A98 - .4byte _08065C30 - .4byte _08065C4C - .4byte _08065C68 - .4byte _08065CBC - .4byte _08065CBC - .4byte _08065CBC - .4byte _08065CBC - .4byte _08065CDC - .4byte _08065D44 - .4byte _08065D44 - .4byte _08065D44 - .4byte _08065D44 - .4byte _08066270 - .4byte _08066270 - .4byte _08066270 - .4byte _08066270 - .4byte _08065D6C - .4byte _08065D88 - .4byte _08065DA4 - .4byte _08065DC0 - .4byte _08065DDC - .4byte _08065DF8 - .4byte _08065E14 - .4byte _08065E30 - .4byte _08065E4C - .4byte _08065E68 - .4byte _08065E84 - .4byte _08065EA0 - .4byte _08065EBC - .4byte _08065ED8 - .4byte _08065EF4 - .4byte _08065F68 - .4byte _08065F84 - .4byte _08065FA0 - .4byte _08065FBC - .4byte _08065FD8 - .4byte _08065FF4 - .4byte _08066010 - .4byte _0806602C - .4byte _08066048 - .4byte _08066064 - .4byte _08066080 - .4byte _0806609C - .4byte _080660B8 - .4byte _080660D4 - .4byte _080660F0 - .4byte _0806610C - .4byte _08066128 - .4byte _08066144 - .4byte _08066160 - .4byte _0806617C - .4byte _08066198 - .4byte _080661B4 - .4byte _080661D0 - .4byte _080661EC - .4byte _08066208 - .4byte _08066224 - .4byte _08066240 - .4byte _0806625C -_08065A98: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - adds r2, r7, 0 - bl pokemon_setattr - adds r2, r7, 0 - adds r2, 0x2E - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_setattr - 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 -_08065AFE: - mov r1, r8 - adds r1, 0xD - mov r0, r9 - adds r2, r4, 0 - bl pokemon_setattr - mov r1, r8 - adds r1, 0x11 - mov r0, r9 - adds r2, r6, 0 - bl pokemon_setattr - adds r6, 0x1 - adds r4, 0x2 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x3 - ble _08065AFE - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - mov r2, r10 - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x20 - ldr r2, [sp, 0x20] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x19 - ldr r2, [sp, 0x28] - bl pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - adds r0, r4, 0 - movs r1, 0 - ldr r2, [sp, 0x2C] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x37 - ldr r2, [sp, 0x30] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x38 - ldr r2, [sp, 0x1C] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x39 - ldr r2, [sp, 0x18] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3A - ldr r2, [sp, 0x24] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3B - ldr r2, [sp, 0x4] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3C - ldr r2, [sp, 0x8] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3D - ldr r2, [sp, 0xC] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3E - ldr r2, [sp, 0x10] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3F - ldr r2, [sp, 0x14] - bl pokemon_setattr - b _08066270 - .pool -_08065C30: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0xB - bl pokemon_setattr - b _08066270 - .pool -_08065C4C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0xC - bl pokemon_setattr - b _08066270 - .pool -_08065C68: - 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, =0x02024744 - adds r7, r1, r0 - adds r6, r4, 0 - adds r6, 0x8 -_08065C80: - mov r1, r8 - adds r1, 0xD - adds r0, r7, 0 - adds r2, r4, 0 - bl pokemon_setattr - mov r1, r8 - adds r1, 0x11 - adds r0, r7, 0 - adds r2, r6, 0 - bl pokemon_setattr - adds r6, 0x1 - adds r4, 0x2 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x3 - ble _08065C80 - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x15 - mov r2, r9 - bl pokemon_setattr - b _08066270 - .pool -_08065CBC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldr r3, =0x02023064 - ldrb r2, [r6] - lsls r2, 9 - adds r1, r3, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r1, 0x9 - b _08065D5A - .pool -_08065CDC: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - adds r0, r4, 0 - movs r1, 0x11 - str r3, [sp, 0x34] - bl pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - b _08066270 - .pool -_08065D44: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldr r3, =0x02023064 - ldrb r2, [r6] - lsls r2, 9 - adds r1, r3, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r1, 0x8 -_08065D5A: - adds r3, 0x3 - adds r2, r3 - bl pokemon_setattr - b _08066270 - .pool -_08065D6C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1 - bl pokemon_setattr - b _08066270 - .pool -_08065D88: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x19 - bl pokemon_setattr - b _08066270 - .pool -_08065DA4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1A - bl pokemon_setattr - b _08066270 - .pool -_08065DC0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1B - bl pokemon_setattr - b _08066270 - .pool -_08065DDC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1C - bl pokemon_setattr - b _08066270 - .pool -_08065DF8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1D - bl pokemon_setattr - b _08066270 - .pool -_08065E14: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1E - bl pokemon_setattr - b _08066270 - .pool -_08065E30: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1F - bl pokemon_setattr - b _08066270 - .pool -_08065E4C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x20 - bl pokemon_setattr - b _08066270 - .pool -_08065E68: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x22 - bl pokemon_setattr - b _08066270 - .pool -_08065E84: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x23 - bl pokemon_setattr - b _08066270 - .pool -_08065EA0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x24 - bl pokemon_setattr - b _08066270 - .pool -_08065EBC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x25 - bl pokemon_setattr - b _08066270 - .pool -_08065ED8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x26 - bl pokemon_setattr - b _08066270 - .pool -_08065EF4: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - adds r0, r4, 0 - movs r1, 0x27 - str r3, [sp, 0x34] - bl pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - ldrb r2, [r6] - lsls r2, 9 - ldr r3, [sp, 0x34] - adds r0, r3, 0x5 - adds r2, r0 - adds r0, r4, 0 - b _08066002 - .pool -_08065F68: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x27 - bl pokemon_setattr - b _08066270 - .pool -_08065F84: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x28 - bl pokemon_setattr - b _08066270 - .pool -_08065FA0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x29 - bl pokemon_setattr - b _08066270 - .pool -_08065FBC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x2A - bl pokemon_setattr - b _08066270 - .pool -_08065FD8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x2B - bl pokemon_setattr - b _08066270 - .pool -_08065FF4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 -_08066002: - movs r1, 0x2C - bl pokemon_setattr - b _08066270 - .pool -_08066010: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0 - bl pokemon_setattr - b _08066270 - .pool -_0806602C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x9 - bl pokemon_setattr - b _08066270 - .pool -_08066048: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x37 - bl pokemon_setattr - b _08066270 - .pool -_08066064: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x38 - bl pokemon_setattr - b _08066270 - .pool -_08066080: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x39 - bl pokemon_setattr - b _08066270 - .pool -_0806609C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3A - bl pokemon_setattr - b _08066270 - .pool -_080660B8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3B - bl pokemon_setattr - b _08066270 - .pool -_080660D4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3C - bl pokemon_setattr - b _08066270 - .pool -_080660F0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3D - bl pokemon_setattr - b _08066270 - .pool -_0806610C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3E - bl pokemon_setattr - b _08066270 - .pool -_08066128: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3F - bl pokemon_setattr - b _08066270 - .pool -_08066144: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x16 - bl pokemon_setattr - b _08066270 - .pool -_08066160: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x17 - bl pokemon_setattr - b _08066270 - .pool -_0806617C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x18 - bl pokemon_setattr - b _08066270 - .pool -_08066198: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x21 - bl pokemon_setattr - b _08066270 - .pool -_080661B4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x2F - bl pokemon_setattr - b _08066270 - .pool -_080661D0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x30 - bl pokemon_setattr - b _08066270 - .pool -_080661EC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x32 - bl pokemon_setattr - b _08066270 - .pool -_08066208: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x33 - bl pokemon_setattr - b _08066270 - .pool -_08066224: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x34 - bl pokemon_setattr - b _08066270 - .pool -_08066240: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x35 - bl pokemon_setattr - b _08066270 - .pool -_0806625C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x36 - bl pokemon_setattr -_08066270: - 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 sub_8065964 - - thumb_func_start sub_8066284 -sub_8066284: @ 8066284 - push {r4-r7,lr} - ldr r1, =0x0202406e - ldr r7, =0x02024064 - 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, =0x02023064 - lsls r2, 9 - adds r0, r4, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - ldr r1, =0x02024744 - adds r0, r1 - adds r5, r3, r0 - movs r3, 0 - adds r0, r4, 0x2 - adds r2, r0 - ldrb r2, [r2] - cmp r3, r2 - bcs _080662DC - adds r6, r4, 0 - adds r2, r7, 0 - adds r4, r0, 0 -_080662BA: - 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 _080662BA -_080662DC: - bl sub_8065068 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8066284 - - thumb_func_start sub_80662F8 -sub_80662F8: @ 80662F8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r7, =0x0202406e - ldr r6, =0x02024064 - 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, =0x02024744 - mov r9, r1 - add r0, r9 - movs r1, 0xB - bl pokemon_getattr - 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 battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_806A068 - ldr r0, =0x0202499c - 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 AddObjectToFront - ldr r4, =0x020241e4 - ldrb r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r5, =0x02020630 - 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, =0x020244e4 - adds r2, r1 - ldrb r1, [r2] - bl StartObjectImageAnim - 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 pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_805EE54 - ldr r1, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064B04 - 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_80662F8 - - thumb_func_start sub_8066448 -sub_8066448: @ 8066448 - push {r4,lr} - ldr r1, =0x0202406e - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r2, r0, 1 - adds r2, r1 - ldr r3, =0x02023064 - 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_8066494 - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064F40 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8066448 - - thumb_func_start sub_8066494 -sub_8066494: @ 8066494 - 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, =0x0202406e - lsls r4, r6, 1 - adds r4, r0 - ldr r0, =0x02023064 - 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, =0x02024744 - adds r0, r5 - movs r1, 0xB - bl pokemon_getattr - mov r8, r0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r0, =sub_805D714 - bl object_new_hidden_with_callback - ldr r1, =0x03005d7c - 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 battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl sub_806A068 - ldr r0, =0x0202499c - 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 AddObjectToFront - ldr r4, =0x020241e4 - adds r4, r6, r4 - strb r0, [r4] - ldr r5, =0x02020630 - 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, =0x020244e4 - adds r6, r1 - ldrb r1, [r6] - bl StartObjectImageAnim - 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, =DummyObjectCallback - 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_8066494 - - thumb_func_start sub_8066624 -sub_8066624: @ 8066624 - push {r4-r6,lr} - ldr r1, =0x02023064 - ldr r6, =0x02024064 - ldrb r2, [r6] - lsls r0, r2, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r3, [r0] - cmp r3, 0 - bne _0806666C - ldr r0, =0x020244d0 - 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, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80666BC - str r1, [r0] - b _080666A8 - .pool -_0806666C: - ldr r5, =0x020241e4 - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldrb r0, [r6] - bl sub_805EEE0 - ldr r1, =0x03005d70 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl sub_8065068 -_080666A8: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8066624 - - thumb_func_start sub_80666BC -sub_80666BC: @ 80666BC - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r4, [r6] - ldr r5, =0x02024064 - 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 _080666E4 - cmp r0, 0x1 - beq _08066712 - b _0806673A - .pool -_080666E4: - ldr r1, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080666FE - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_080666FE: - 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 _0806673A -_08066712: - ldrb r1, [r3] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0806673A - 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, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064C58 - str r1, [r0] -_0806673A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80666BC - - thumb_func_start sub_8066748 -sub_8066748: @ 8066748 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r4, =0x02022fec - ldr r0, [r4] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08066840 - ldr r5, =0x02024064 - ldrb r0, [r5] - bl battle_get_per_side_status - movs r1, 0x2 - ands r1, r0 - movs r7, 0xC8 - cmp r1, 0 - beq _08066770 - movs r7, 0x98 -_08066770: - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 1 - ands r0, r1 - cmp r0, 0 - beq _080667A8 - ldrb r0, [r5] - cmp r0, 0x1 - bne _08066794 - ldr r0, =0x02038bca - b _08066796 - .pool -_08066794: - ldr r0, =0x02038bcc -_08066796: - ldrh r0, [r0] - bl sub_8162AA0 - lsls r0, 24 - lsrs r0, 24 - b _0806694C - .pool -_080667A8: - ldrb r0, [r5] - bl sub_806D864 - ldr r6, =0x020229e8 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - movs r4, 0xFF - ldrb r0, [r1] - cmp r0, 0x4 - beq _080667D8 - ldrb r0, [r5] - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrh r1, [r1] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x5 - bne _080667F4 -_080667D8: - ldrb r0, [r5] - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r1, 0x13] - cmp r0, 0 - bne _080668AA - b _080668BC - .pool -_080667F4: - ldrb r0, [r5] - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrh r1, [r1] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x2 - beq _08066822 - ldrb r0, [r5] - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrh r0, [r1] - ands r4, r0 - cmp r4, 0x1 - bne _08066838 -_08066822: - ldrb r0, [r5] - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r1, 0x13] - cmp r0, 0 - bne _08066916 - b _08066924 -_08066838: - ldrb r0, [r5] - bl sub_806D864 - b _0806693A -_08066840: - movs r7, 0xB0 - ldr r0, =0x02038bca - ldrh r1, [r0] - movs r0, 0xC0 - lsls r0, 4 - cmp r1, r0 - bne _08066858 - bl sub_8068B48 - b _08066948 - .pool -_08066858: - bl link_get_multiplayer_id - ldr r6, =0x020229e8 - movs r5, 0x1 - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - movs r4, 0xFF - ldrb r0, [r1] - cmp r0, 0x4 - beq _08066892 - bl link_get_multiplayer_id - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrh r1, [r1] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x5 - bne _080668C8 -_08066892: - bl link_get_multiplayer_id - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r1, 0x13] - cmp r0, 0 - beq _080668BC -_080668AA: - ldr r0, =gTrainerPicIndices - adds r0, 0x4F - ldrb r0, [r0] - b _0806694C - .pool -_080668BC: - ldr r0, =gTrainerPicIndices - adds r0, 0x4E - ldrb r0, [r0] - b _0806694C - .pool -_080668C8: - bl link_get_multiplayer_id - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrh r1, [r1] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x2 - beq _080668FE - bl link_get_multiplayer_id - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrh r0, [r1] - ands r4, r0 - cmp r4, 0x1 - bne _08066930 -_080668FE: - bl link_get_multiplayer_id - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r1, 0x13] - cmp r0, 0 - beq _08066924 -_08066916: - ldr r0, =gTrainerPicIndices - adds r0, 0x51 - ldrb r0, [r0] - b _0806694C - .pool -_08066924: - ldr r0, =gTrainerPicIndices - adds r0, 0x50 - ldrb r0, [r0] - b _0806694C - .pool -_08066930: - bl link_get_multiplayer_id - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 -_0806693A: - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r1, 0x13] - bl sub_806F000 -_08066948: - lsls r0, 16 - lsrs r0, 16 -_0806694C: - mov r8, r0 - ldr r5, =0x02024064 - ldrb r1, [r5] - bl sub_805DF38 - ldrb r0, [r5] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl template_build_for_pokemon_or_trainer - ldr r6, =0x0202499c - 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 AddObjectToFront - ldr r6, =0x020241e4 - ldrb r1, [r5] - adds r1, r6 - strb r0, [r1] - ldr r4, =0x02020630 - 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 IndexOfObjectPaletteTag - 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, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064400 - str r1, [r0] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8066748 - - thumb_func_start sub_8066A58 -sub_8066A58: @ 8066A58 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =0x02024064 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08066A74 - ldr r0, =0x02038bca - b _08066A76 - .pool -_08066A74: - ldr r0, =0x02038bcc -_08066A76: - ldrh r0, [r0] - bl sub_8162AA0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r6, =0x02024064 - ldrb r1, [r6] - bl sub_805DF38 - ldrb r0, [r6] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl template_build_for_pokemon_or_trainer - ldr r0, =0x0202499c - ldr r2, =gUnknown_083054E0 - mov r3, r8 - lsls r1, r3, 2 - adds r1, r2 - ldrb r1, [r1] - movs r2, 0x8 - subs r2, r1 - lsls r2, 18 - movs r1, 0xA0 - lsls r1, 14 - adds r2, r1 - asrs r2, 16 - movs r1, 0xB0 - movs r3, 0x1E - bl AddObjectToFront - ldr r5, =0x020241e4 - ldrb r1, [r6] - adds r1, r5 - strb r0, [r1] - ldr r4, =0x02020630 - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x60 - strh r1, [r0, 0x24] - 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, 0x20] - adds r1, 0x20 - strh r1, [r0, 0x20] - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000fffe - strh r1, [r0, 0x2E] - ldr r1, =gTrainerFrontPicPaletteTable - mov r2, r8 - lsls r0, r2, 3 - adds r0, r1 - ldrh r0, [r0, 0x4] - bl IndexOfObjectPaletteTag - ldrb r1, [r6] - adds r1, r5 - 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, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - mov r3, r8 - strh r3, [r0, 0x6] - ldrb r0, [r6] - adds r0, r5 - 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, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064438 - str r1, [r0] - bl sub_8065068 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8066A58 - - thumb_func_start sub_8066B94 -sub_8066B94: @ 8066B94 - push {r4-r6,lr} - ldr r6, =0x020241e4 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =0x02020630 - 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, =DummyObjectCallback - bl oamt_set_x3A_32 - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064470 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8066B94 - - thumb_func_start sub_8066C40 -sub_8066C40: @ 8066C40 - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r4, [r6] - ldr r5, =0x02024064 - 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 _08066C94 - ldr r1, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08066C74 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_08066C74: - 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 _08066CD0 - .pool -_08066C94: - ldrb r1, [r3] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08066CD0 - strb r0, [r3, 0x4] - movs r0, 0x10 - movs r1, 0x3F - bl audio_play_and_stuff - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - 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, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064C14 - str r1, [r0] -_08066CD0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8066C40 - - thumb_func_start sub_8066CEC -sub_8066CEC: @ 8066CEC - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8066CEC - - thumb_func_start sub_8066CF8 -sub_8066CF8: @ 8066CF8 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8066CF8 - - thumb_func_start sub_8066D04 -sub_8066D04: @ 8066D04 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8066D04 - - thumb_func_start sub_8066D10 -sub_8066D10: @ 8066D10 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8066D10 - - thumb_func_start sub_8066D1C -sub_8066D1C: @ 8066D1C - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r5, =0x02024064 - ldrb r0, [r5] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - beq _08066D32 - b _08066E58 -_08066D32: - ldr r0, =0x02023064 - mov r12, r0 - ldrb r1, [r5] - lsls r1, 9 - adds r0, 0x1 - adds r0, r1, r0 - ldrb r6, [r0] - mov r0, r12 - adds r0, 0x2 - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 8 - orrs r6, r0 - ldr r0, =0x02038432 - mov r8, r0 - mov r0, r12 - adds r0, 0x3 - adds r1, r0 - ldrb r0, [r1] - mov r1, r8 - strb r0, [r1] - ldr r3, =0x02038408 - ldrb r1, [r5] - lsls r1, 9 - mov r0, r12 - adds r0, 0x4 - adds r0, r1, r0 - ldrb r2, [r0] - mov r0, r12 - adds r0, 0x5 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 8 - orrs r2, r0 - strh r2, [r3] - ldr r3, =0x02038404 - ldrb r1, [r5] - lsls r1, 9 - mov r0, r12 - adds r0, 0x6 - adds r0, r1, r0 - ldrb r2, [r0] - mov r0, r12 - adds r0, 0x7 - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 8 - orrs r2, r0 - mov r0, r12 - adds r0, 0x8 - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 16 - orrs r2, r0 - mov r0, r12 - adds r0, 0x9 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 24 - orrs r2, r0 - str r2, [r3] - ldr r2, =0x0203841a - ldrb r0, [r5] - lsls r0, 9 - mov r1, r12 - adds r1, 0xA - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r4, =0x0203841c - ldrb r1, [r5] - lsls r1, 9 - mov r0, r12 - adds r0, 0xC - adds r0, r1, r0 - ldrb r2, [r0] - mov r0, r12 - adds r0, 0xD - adds r1, r0 - ldrb r0, [r1] - lsls r0, 8 - orrs r2, r0 - strh r2, [r4] - ldr r7, =0x02038400 - ldrb r1, [r5] - lsls r1, 9 - mov r0, r12 - adds r0, 0x10 - adds r1, r0 - str r1, [r7] - ldr r2, =0x020244bc - ldrb r0, [r5] - lsls r0, 2 - adds r0, r2 - ldr r1, [r1] - str r1, [r0] - mov r0, r8 - ldrb r1, [r0] - adds r0, r6, 0 - bl sub_805DB8C - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _08066E30 - bl sub_8065068 - b _08066E58 - .pool -_08066E30: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r3, [r0, 0x4] - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8066E70 - str r1, [r0] - ldrh r1, [r4] - ldr r2, [r7] - adds r0, r6, 0 - bl sub_817E0FC -_08066E58: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8066D1C - - thumb_func_start sub_8066E70 -sub_8066E70: @ 8066E70 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r2, =0x02023064 - ldr r6, =0x02024064 - 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, =0x020244d0 - 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 _08066F08 - cmp r2, 0x1 - bgt _08066EC8 - cmp r2, 0 - beq _08066ED2 - b _08066FE4 - .pool -_08066EC8: - cmp r2, 0x2 - beq _08066F32 - cmp r2, 0x3 - beq _08066FA8 - b _08066FE4 -_08066ED2: - ldr r1, [r5] - lsls r0, r3, 2 - adds r1, r0, r1 - ldrb r2, [r1] - movs r0, 0xC - ands r0, r2 - cmp r0, 0x4 - bne _08066EF4 - 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 -_08066EF4: - 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 _08066FE4 -_08066F08: - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08066FE4 - 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 _08066FE4 -_08066F32: - ldr r0, =0x020383f8 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =0x020383fd - ldrb r0, [r0] - cmp r0, 0 - bne _08066FE4 - 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 _08066F80 - mov r0, r8 - cmp r0, 0x1 - bhi _08066F80 - 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] -_08066F80: - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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 _08066FE4 - .pool -_08066FA8: - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _08066FE4 - 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_8065068 -_08066FE4: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8066E70 - - thumb_func_start sub_8066FF4 -sub_8066FF4: @ 8066FF4 - push {r4,r5,lr} - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r5, =0x02024064 - ldrb r4, [r5] - lsls r4, 9 - ldr r0, =0x02023066 - adds r4, r0 - ldrh r0, [r4] - bl battle_pick_message - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064CCC - str r1, [r0] - ldrh r0, [r4] - bl sub_817C95C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8066FF4 - - thumb_func_start sub_806704C -sub_806704C: @ 806704C - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_806704C - - thumb_func_start sub_8067058 -sub_8067058: @ 8067058 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8067058 - - thumb_func_start sub_8067064 -sub_8067064: @ 8067064 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8067064 - - thumb_func_start sub_8067070 -sub_8067070: @ 8067070 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8067070 - - thumb_func_start sub_806707C -sub_806707C: @ 806707C - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_806707C - - thumb_func_start sub_8067088 -sub_8067088: @ 8067088 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8067088 - - thumb_func_start sub_8067094 -sub_8067094: @ 8067094 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8067094 - - thumb_func_start sub_80670A0 -sub_80670A0: @ 80670A0 - 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, =0x02023064 - ldr r0, =0x02024064 - 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 _08067130 - ldr r6, =0x0202406e - lsls r0, r4, 1 - adds r0, r6 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x02024744 - adds r0, r4 - movs r1, 0x3A - bl pokemon_getattr - 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 pokemon_getattr - adds r3, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r1, =0x03005d70 - adds r1, r0, r1 - ldrb r1, [r1] - str r7, [sp] - mov r2, r8 - bl sub_807294C - b _0806715A - .pool -_08067130: - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3A - bl pokemon_getattr - adds r2, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r1, =0x03005d70 - adds r1, r0, r1 - ldrb r1, [r1] - str r7, [sp] - movs r3, 0 - bl sub_807294C -_0806715A: - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064BC0 - 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_80670A0 - - thumb_func_start sub_8067190 -sub_8067190: @ 8067190 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8067190 - - thumb_func_start sub_806719C -sub_806719C: @ 806719C - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _080671F0 - ldr r0, =0x03005d70 - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - adds r1, r2 - movs r2, 0x9 - bl healthbar_draw_field_maybe - ldrb r2, [r4] - ldr r0, =0x020244d0 - 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, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8065008 - str r1, [r0] -_080671F0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806719C - - thumb_func_start sub_8067214 -sub_8067214: @ 8067214 - push {r4,r5,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _08067264 - ldr r4, =0x02023064 - 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, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8065008 - str r1, [r0] -_08067264: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8067214 - - thumb_func_start sub_806727C -sub_806727C: @ 806727C - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_806727C - - thumb_func_start sub_8067288 -sub_8067288: @ 8067288 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8067288 - - thumb_func_start sub_8067294 -sub_8067294: @ 8067294 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_8067294 - - thumb_func_start sub_80672A0 -sub_80672A0: @ 80672A0 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_80672A0 - - thumb_func_start sub_80672AC -sub_80672AC: @ 80672AC - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_80672AC - - thumb_func_start sub_80672B8 -sub_80672B8: @ 80672B8 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_80672B8 - - thumb_func_start sub_80672C4 -sub_80672C4: @ 80672C4 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_80672C4 - - thumb_func_start sub_80672D0 -sub_80672D0: @ 80672D0 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_80672D0 - - thumb_func_start sub_80672DC -sub_80672DC: @ 80672DC - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_80672DC - - thumb_func_start sub_80672E8 -sub_80672E8: @ 80672E8 - push {lr} - ldr r2, =0x02022d0c - ldrb r1, [r2] - movs r0, 0x80 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - bl sub_8065068 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80672E8 - - thumb_func_start sub_8067304 -sub_8067304: @ 8067304 - push {lr} - ldr r3, =0x02022d0c - ldr r1, =0x02023064 - ldr r0, =0x02024064 - 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_8065068 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8067304 - - thumb_func_start sub_806733C -sub_806733C: @ 806733C - push {lr} - ldr r2, =0x02022d0c - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - bl sub_8065068 - pop {r0} - bx r0 - .pool - thumb_func_end sub_806733C - - thumb_func_start sub_8067354 -sub_8067354: @ 8067354 - push {lr} - ldr r3, =0x02022d0c - 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_8065068 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8067354 - - thumb_func_start sub_806737C -sub_806737C: @ 806737C - push {r4,lr} - ldr r3, =0x02020630 - ldr r2, =0x020241e4 - ldr r4, =0x02024064 - 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 _080673B0 - bl sub_8065068 - b _080673DA - .pool -_080673B0: - ldr r1, =0x020244b9 - 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, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064CE4 - str r1, [r0] -_080673DA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806737C - - thumb_func_start sub_80673EC -sub_80673EC: @ 80673EC - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_80673EC - - thumb_func_start sub_80673F8 -sub_80673F8: @ 80673F8 - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - movs r3, 0x3F - cmp r0, 0 - bne _0806740C - movs r3, 0xC0 -_0806740C: - ldr r2, =0x02023064 - 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 audio_play_and_stuff - bl sub_8065068 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80673F8 - - thumb_func_start sub_806743C -sub_806743C: @ 806743C - push {r4,r5,lr} - ldr r4, =0x02023064 - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r3, r0, 9 - adds r0, r4, 0x3 - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0 - beq _08067478 - 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 song_play_for_text - b _0806748C - .pool -_08067478: - 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 fanfare_play -_0806748C: - bl sub_8065068 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_806743C - - thumb_func_start sub_8067498 -sub_8067498: @ 8067498 - push {lr} - ldr r1, =0x0202406e - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x19 - movs r2, 0x5 - bl sub_80A32E4 - bl sub_8065068 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8067498 - - thumb_func_start sub_80674D4 -sub_80674D4: @ 80674D4 - push {lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - bl battle_intro_launch - ldr r2, =0x020243fc - ldrh r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strh r0, [r2] - bl sub_8065068 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80674D4 - - thumb_func_start sub_8067508 -sub_8067508: @ 8067508 - push {r4-r6,lr} - ldr r5, =0x020241e4 - ldr r6, =0x02024064 - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - 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_80676FC - bl oamt_set_x3A_32 - ldr r0, =c3_08038DC4 - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r4 - ldrb r0, [r6] - strh r0, [r1, 0x8] - ldr r3, =0x020244d0 - 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 _080675CA - ldr r0, =0x020244b4 - 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] -_080675CA: - ldr r0, [r3] - ldr r2, [r0, 0x8] - ldrb r0, [r2, 0x9] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x9] - ldr r1, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =nullsub_28 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8067508 - - thumb_func_start c3_08038DC4 -c3_08038DC4: @ 8067618 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r7, =0x02024064 - ldrb r0, [r7] - mov r9, r0 - ldr r1, =0x03005e00 - 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 _08067652 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08067684 -_08067652: - ldr r0, =0x02023064 - ldrb r1, [r7] - lsls r2, r1, 9 - adds r0, 0x1 - adds r2, r0 - ldr r0, =0x0202406e - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - strb r0, [r2] - ldrb r0, [r7] - movs r1, 0 - bl sub_8066494 - b _080676C4 - .pool -_08067684: - ldr r4, =0x02023064 - ldrb r0, [r7] - lsls r1, r0, 9 - adds r4, 0x1 - adds r1, r4 - ldr r6, =0x0202406e - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - strb r0, [r1] - ldrb r0, [r7] - movs r1, 0 - bl sub_8066494 - 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_8066494 - ldrb r0, [r7] - eors r0, r5 - strb r0, [r7] -_080676C4: - ldr r1, =0x03005d60 - ldr r2, =0x02024064 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8064734 - 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_08038DC4 - - thumb_func_start sub_80676FC -sub_80676FC: @ 80676FC - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x6] - bl sub_805DFE4 - adds r0, r4, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80676FC - - thumb_func_start sub_8067718 -sub_8067718: @ 8067718 - push {r4-r7,lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _08067748 - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08067748 - bl sub_8065068 - b _08067812 - .pool -_08067748: - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r3, =0x02024064 - 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, =0x02023064 - ldrb r2, [r3] - lsls r0, r2, 9 - adds r1, 0x2 - adds r0, r1 - ldrb r0, [r0] - adds r7, r3, 0 - cmp r0, 0 - beq _080677B4 - 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 _080677AC - 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 _08067812 - .pool -_080677AC: - movs r0, 0x1F - negs r0, r0 - ands r0, r2 - strb r0, [r3, 0x1] -_080677B4: - adds r5, r7, 0 - ldrb r0, [r5] - lsls r3, r0, 9 - ldr r4, =0x02023068 - 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, =0x020244b4 - ldrb r1, [r5] - adds r1, r2 - movs r3, 0 - strb r0, [r1] - ldr r6, =0x020244d0 - 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 _08067806 - 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] -_08067806: - ldr r0, =0x03005d60 - ldrb r1, [r7] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_806782C - str r0, [r1] -_08067812: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8067718 - - thumb_func_start sub_806782C -sub_806782C: @ 806782C - push {r4,lr} - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r3, =0x02024064 - 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 _08067864 - 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_8065068 -_08067864: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806782C - - thumb_func_start sub_8067874 -sub_8067874: @ 8067874 - push {lr} - ldr r0, =0x020244d0 - ldr r1, [r0] - ldr r0, =0x02024064 - 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 _080678A6 - ldr r2, =0x03005e00 - ldr r0, =0x020244b4 - 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] -_080678A6: - bl sub_8065068 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8067874 - - thumb_func_start sub_80678C4 -sub_80678C4: @ 80678C4 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_80678C4 - - thumb_func_start sub_80678D0 -sub_80678D0: @ 80678D0 - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl sub_80A6A90 - lsls r0, 24 - cmp r0, 0 - beq _08067916 - ldr r3, =0x02020630 - ldr r0, =0x020241e4 - 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, =0x02023064 - 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 -_08067916: - bl sub_8065068 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80678D0 - - thumb_func_start sub_8067930 -sub_8067930: @ 8067930 - push {r4-r6,lr} - sub sp, 0x4 - ldr r5, =0x02024064 - ldrb r0, [r5] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _08067992 - ldr r4, =0x02023064 - ldrb r2, [r5] - lsls r1, r2, 9 - adds r0, r4, 0x1 - adds r0, r1, r0 - ldrb r6, [r0] - adds r0, r4, 0x2 - adds r0, r1, r0 - ldrb r3, [r0] - adds r4, 0x3 - adds r1, r4 - ldrb r0, [r1] - lsls r0, 8 - orrs r3, r0 - str r3, [sp] - adds r0, r2, 0 - adds r1, r2, 0 - adds r3, r6, 0 - bl move_anim_start_t3 - lsls r0, 24 - cmp r0, 0 - beq _08067980 - bl sub_8065068 - b _0806798C - .pool -_08067980: - ldr r0, =0x03005d60 - ldrb r1, [r5] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_8065038 - str r0, [r1] -_0806798C: - adds r0, r6, 0 - bl sub_817E32C -_08067992: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8067930 - - thumb_func_start sub_80679A4 -sub_80679A4: @ 80679A4 - push {lr} - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - ldr r1, =0x02023066 - adds r0, r1 - bl sub_81851A8 - bl sub_8065068 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80679A4 - - thumb_func_start sub_80679C4 -sub_80679C4: @ 80679C4 - push {lr} - bl sub_8065068 - pop {r0} - bx r0 - thumb_func_end sub_80679C4 - - thumb_func_start sub_80679D0 -sub_80679D0: @ 80679D0 - push {r4,r5,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r0, 9 - ldr r4, =0x02023068 - adds r0, r4 - bl sub_81851A8 - ldrb r0, [r5] - lsls r0, 9 - subs r4, 0x3 - adds r0, r4 - ldrb r2, [r0] - cmp r2, 0x3 - bne _08067A00 - ldr r0, =0x0202433a - strb r2, [r0] - b _08067A08 - .pool -_08067A00: - ldr r0, =0x0202433a - movs r1, 0x3 - eors r1, r2 - strb r1, [r0] -_08067A08: - ldr r0, =0x03005d90 - ldr r3, [r0] - ldr r1, =0x02023064 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 9 - adds r1, 0x2 - adds r0, r1 - ldrb r0, [r0] - ldr r1, =0x00000ca9 - adds r3, r1 - movs r1, 0x1 - ands r1, r0 - lsls r1, 3 - ldrb r2, [r3] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - movs r0, 0x5 - bl sub_80A2F50 - movs r0, 0x3 - bl sub_80A2390 - bl sub_8065068 - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80587B0 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80679D0 - - thumb_func_start nullsub_92 -nullsub_92: @ 8067A70 - bx lr - thumb_func_end nullsub_92 - - thumb_func_start zero_pokemon_boxed_data -@ void zero_pokemon_boxed_data(pokemon *mon) -zero_pokemon_boxed_data: @ 8067A74 - push {lr} - adds r2, r0, 0 - movs r1, 0 - movs r3, 0 -_08067A7C: - adds r0, r2, r1 - strb r3, [r0] - adds r1, 0x1 - cmp r1, 0x4F - bls _08067A7C - pop {r0} - bx r0 - thumb_func_end zero_pokemon_boxed_data - - thumb_func_start zero_pokemon_struct -@ void zero_pokemon_struct(pokemon *mon) -zero_pokemon_struct: @ 8067A8C - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - bl zero_pokemon_boxed_data - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x37 - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x38 - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x39 - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3A - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3B - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3C - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3D - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3E - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3F - mov r2, sp - bl pokemon_setattr - movs r0, 0xFF - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x40 - mov r2, sp - bl pokemon_setattr - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end zero_pokemon_struct - - thumb_func_start zero_player_party_data -@ void zero_player_party_data() -zero_player_party_data: @ 8067B0C - push {r4,r5,lr} - ldr r4, =0x020244ec - movs r0, 0xFA - lsls r0, 1 - adds r5, r4, r0 -_08067B16: - adds r0, r4, 0 - bl zero_pokemon_struct - adds r4, 0x64 - cmp r4, r5 - ble _08067B16 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end zero_player_party_data - - thumb_func_start zero_enemy_party_data -zero_enemy_party_data: @ 8067B2C - push {r4,r5,lr} - ldr r4, =0x02024744 - movs r0, 0xFA - lsls r0, 1 - adds r5, r4, r0 -_08067B36: - adds r0, r4, 0 - bl zero_pokemon_struct - adds r4, 0x64 - cmp r4, r5 - ble _08067B36 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end zero_enemy_party_data - - thumb_func_start create_pokemon_set_level -@ void create_pokemon_set_level(pokemon *mon, s16 species_num, u8 level, u8 forced_iv, char pokemon_id_is_nonrandom, int pokemon_id, u8 trainer_id_mode, int trainer_id) -create_pokemon_set_level: @ 8067B4C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x1C - mov r8, r0 - adds r6, r1, 0 - ldr r4, [sp, 0x34] - ldr r7, [sp, 0x38] - ldr r5, [sp, 0x3C] - lsls r6, 16 - lsrs r6, 16 - add r0, sp, 0x10 - strb r2, [r0] - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - mov r0, r8 - str r3, [sp, 0x18] - bl zero_pokemon_struct - str r4, [sp] - str r7, [sp, 0x4] - str r5, [sp, 0x8] - ldr r0, [sp, 0x40] - str r0, [sp, 0xC] - mov r0, r8 - adds r1, r6, 0 - add r2, sp, 0x10 - ldrb r2, [r2] - ldr r3, [sp, 0x18] - bl create_pokemon - mov r0, r8 - movs r1, 0x38 - add r2, sp, 0x10 - bl pokemon_setattr - movs r0, 0xFF - str r0, [sp, 0x14] - add r2, sp, 0x14 - mov r0, r8 - movs r1, 0x40 - bl pokemon_setattr - mov r0, r8 - bl pokemon_calc_effective_stats - add sp, 0x1C - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end create_pokemon_set_level - - thumb_func_start create_pokemon -@ void create_pokemon(pokemon *mon, s16 species_num, u8 level, u8 forced_iv, char pokemon_id_is_nonrandom, int pokemon_id, u8 trainer_id_mode, int trainer_id) -create_pokemon: @ 8067BBC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - adds r7, r0, 0 - ldr r4, [sp, 0x40] - ldr r0, [sp, 0x48] - movs r5, 0xE - add r5, sp - strh r1, [r5] - add r6, sp, 0x10 - strb r2, [r6] - mov r5, sp - adds r5, 0x11 - strb r3, [r5] - lsls r4, 24 - lsrs r4, 24 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - adds r0, r7, 0 - bl zero_pokemon_boxed_data - cmp r4, 0 - beq _08067BF8 - ldr r0, [sp, 0x44] - str r0, [sp, 0x14] - b _08067C0C -_08067BF8: - bl GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - str r4, [sp, 0x14] -_08067C0C: - add r2, sp, 0x14 - adds r0, r7, 0 - movs r1, 0 - bl pokemon_setattr_encrypted - add r0, sp, 0x18 - mov r9, r0 - add r5, sp, 0xC - mov r1, r10 - cmp r1, 0x2 - bne _08067C64 - ldr r2, =0xffff0000 - mov r8, r2 - ldr r6, =0x0000ffff -_08067C28: - bl GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - str r4, [sp, 0x18] - adds r1, r4, 0 - mov r3, r8 - ands r1, r3 - lsrs r1, 16 - ands r4, r6 - eors r1, r4 - ldr r2, [sp, 0x14] - adds r0, r2, 0 - ands r0, r3 - lsrs r0, 16 - eors r1, r0 - ands r2, r6 - eors r1, r2 - cmp r1, 0x7 - bls _08067C28 - b _08067C8A - .pool -_08067C64: - mov r0, r10 - cmp r0, 0x1 - bne _08067C70 - ldr r0, [sp, 0x4C] - str r0, [sp, 0x18] - b _08067C8A -_08067C70: - ldr r0, =0x03005d90 - ldr r2, [r0] - ldrb r1, [r2, 0xA] - ldrb r0, [r2, 0xB] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0xC] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0xD] - lsls r0, 24 - orrs r1, r0 - str r1, [sp, 0x18] -_08067C8A: - adds r0, r7, 0 - movs r1, 0x1 - mov r2, r9 - bl pokemon_setattr_encrypted - adds r0, r7, 0 - bl pokemon_calc_checksum - strh r0, [r5] - adds r0, r7, 0 - movs r1, 0x9 - adds r2, r5, 0 - bl pokemon_setattr_encrypted - adds r0, r7, 0 - bl pokemon_encrypt - mov r0, sp - ldrh r1, [r0, 0xE] - bl GetSpeciesName - adds r0, r7, 0 - movs r1, 0x2 - mov r2, sp - bl pokemon_setattr_encrypted - ldr r2, =gUnknown_82E9531 - adds r0, r7, 0 - movs r1, 0x3 - bl pokemon_setattr_encrypted - ldr r5, =0x03005d90 - ldr r2, [r5] - adds r0, r7, 0 - movs r1, 0x7 - bl pokemon_setattr_encrypted - adds r0, r7, 0 - movs r1, 0xB - mov r2, sp - adds r2, 0xE - bl pokemon_setattr_encrypted - ldr r4, =gBaseStats - mov r2, sp - ldrh r1, [r2, 0xE] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x13] - movs r0, 0xCA - lsls r0, 1 - adds r2, r1, 0 - muls r2, r0 - mov r3, sp - ldrb r0, [r3, 0x10] - lsls r0, 2 - ldr r1, =gExperienceTables - adds r0, r1 - adds r2, r0 - adds r0, r7, 0 - movs r1, 0x19 - bl pokemon_setattr_encrypted - mov r1, sp - ldrh r0, [r1, 0xE] - lsls r2, r0, 3 - subs r2, r0 - lsls r2, 2 - adds r4, 0x12 - adds r2, r4 - adds r0, r7, 0 - movs r1, 0x20 - bl pokemon_setattr_encrypted - bl sav1_map_get_name - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x18] - adds r0, r7, 0 - movs r1, 0x23 - mov r2, r9 - bl pokemon_setattr_encrypted - adds r0, r7, 0 - movs r1, 0x24 - add r2, sp, 0x10 - bl pokemon_setattr_encrypted - ldr r2, =gUnknown_82E9530 - adds r0, r7, 0 - movs r1, 0x25 - bl pokemon_setattr_encrypted - movs r0, 0x4 - str r0, [sp, 0x18] - adds r0, r7, 0 - movs r1, 0x26 - mov r2, r9 - bl pokemon_setattr_encrypted - ldr r2, [r5] - adds r2, 0x8 - adds r0, r7, 0 - movs r1, 0x31 - bl pokemon_setattr_encrypted - mov r2, sp - ldrb r0, [r2, 0x11] - cmp r0, 0x1F - bhi _08067DC8 - adds r0, r7, 0 - movs r1, 0x27 - adds r2, 0x11 - bl pokemon_setattr_encrypted - adds r0, r7, 0 - movs r1, 0x28 - mov r2, sp - adds r2, 0x11 - bl pokemon_setattr_encrypted - adds r0, r7, 0 - movs r1, 0x29 - mov r2, sp - adds r2, 0x11 - bl pokemon_setattr_encrypted - adds r0, r7, 0 - movs r1, 0x2A - mov r2, sp - adds r2, 0x11 - bl pokemon_setattr_encrypted - adds r0, r7, 0 - movs r1, 0x2B - mov r2, sp - adds r2, 0x11 - bl pokemon_setattr_encrypted - adds r0, r7, 0 - movs r1, 0x2C - mov r2, sp - adds r2, 0x11 - bl pokemon_setattr_encrypted - b _08067E50 - .pool -_08067DC8: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x18] - movs r3, 0x1F - mov r8, r3 - ands r0, r3 - str r0, [sp, 0x1C] - add r4, sp, 0x1C - adds r0, r7, 0 - movs r1, 0x27 - adds r2, r4, 0 - bl pokemon_setattr_encrypted - ldr r0, [sp, 0x18] - movs r6, 0xF8 - lsls r6, 2 - ands r0, r6 - lsrs r0, 5 - str r0, [sp, 0x1C] - adds r0, r7, 0 - movs r1, 0x28 - adds r2, r4, 0 - bl pokemon_setattr_encrypted - ldr r0, [sp, 0x18] - movs r5, 0xF8 - lsls r5, 7 - ands r0, r5 - lsrs r0, 10 - str r0, [sp, 0x1C] - adds r0, r7, 0 - movs r1, 0x29 - adds r2, r4, 0 - bl pokemon_setattr_encrypted - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x18] - mov r1, r8 - ands r0, r1 - str r0, [sp, 0x1C] - adds r0, r7, 0 - movs r1, 0x2A - adds r2, r4, 0 - bl pokemon_setattr_encrypted - ldr r0, [sp, 0x18] - ands r0, r6 - lsrs r0, 5 - str r0, [sp, 0x1C] - adds r0, r7, 0 - movs r1, 0x2B - adds r2, r4, 0 - bl pokemon_setattr_encrypted - ldr r0, [sp, 0x18] - ands r0, r5 - lsrs r0, 10 - str r0, [sp, 0x1C] - adds r0, r7, 0 - movs r1, 0x2C - adds r2, r4, 0 - bl pokemon_setattr_encrypted -_08067E50: - ldr r2, =gBaseStats - mov r3, sp - ldrh r1, [r3, 0xE] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x17] - cmp r0, 0 - beq _08067E76 - ldr r0, [sp, 0x14] - movs r1, 0x1 - ands r0, r1 - str r0, [sp, 0x18] - adds r0, r7, 0 - movs r1, 0x2E - mov r2, r9 - bl pokemon_setattr_encrypted -_08067E76: - adds r0, r7, 0 - bl sub_8069270 - 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 create_pokemon - - thumb_func_start pokemon_make_with_nature -pokemon_make_with_nature: @ 8067E90 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - mov r9, r0 - ldr r0, [sp, 0x2C] - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r6, r3, 24 - lsls r0, 24 - lsrs r5, r0, 24 -_08067EB0: - bl GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - adds r0, r4, 0 - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bne _08067EB0 - movs r0, 0x1 - str r0, [sp] - str r4, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - str r0, [sp, 0xC] - mov r0, r9 - mov r1, r8 - adds r2, r7, 0 - adds r3, r6, 0 - bl create_pokemon_set_level - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end pokemon_make_with_nature - - thumb_func_start sub_8067EF8 -sub_8067EF8: @ 8067EF8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - str r0, [sp, 0x10] - ldr r4, [sp, 0x38] - ldr r5, [sp, 0x3C] - ldr r0, [sp, 0x40] - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x14] - lsls r3, 24 - lsrs r3, 24 - mov r10, r3 - lsls r4, 24 - lsrs r4, 24 - mov r8, r4 - lsls r5, 24 - lsrs r6, r5, 24 - lsls r0, 24 - lsrs r1, r0, 24 - mov r9, r1 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1B - bhi _08067F9E -_08067F38: - bl GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - movs r0, 0xC0 - lsls r0, 18 - ands r0, r4 - lsrs r0, 18 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r4 - lsrs r1, 12 - orrs r0, r1 - movs r1, 0xC0 - lsls r1, 2 - ands r1, r4 - lsrs r1, 6 - orrs r0, r1 - movs r1, 0x3 - ands r1, r4 - orrs r0, r1 - movs r1, 0x1C - bl __umodsi3 - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - bne _08067F38 - adds r0, r7, 0 - adds r1, r4, 0 - bl pokemon_species_get_gender_info - lsls r0, 24 - lsrs r0, 24 - cmp r8, r0 - bne _08067F38 - mov r0, r9 - subs r0, 0x1 - cmp r5, r0 - bne _08067F38 - b _08067FCE -_08067F9E: - bl GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - adds r0, r4, 0 - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - bne _08067F9E - adds r0, r7, 0 - adds r1, r4, 0 - bl pokemon_species_get_gender_info - lsls r0, 24 - lsrs r0, 24 - cmp r8, r0 - bne _08067F9E -_08067FCE: - movs r0, 0x1 - str r0, [sp] - str r4, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - str r0, [sp, 0xC] - ldr r0, [sp, 0x10] - adds r1, r7, 0 - ldr r2, [sp, 0x14] - mov r3, r10 - bl create_pokemon_set_level - 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_8067EF8 - - thumb_func_start sub_8067FF8 -sub_8067FF8: @ 8067FF8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - mov r8, r0 - lsls r1, 16 - lsrs r6, r1, 16 - lsls r2, 24 - lsrs r7, r2, 24 -_0806800A: - bl GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsrs r5, r4, 16 - lsls r0, 16 - orrs r5, r0 - bl GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - adds r0, r6, 0 - adds r1, r4, 0 - bl pokemon_species_get_gender_info - lsls r0, 24 - cmp r0, 0 - bne _0806800A - movs r0, 0x1 - str r0, [sp] - str r4, [sp, 0x4] - str r0, [sp, 0x8] - str r5, [sp, 0xC] - mov r0, r8 - adds r1, r6, 0 - adds r2, r7, 0 - movs r3, 0x20 - bl create_pokemon_set_level - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8067FF8 - - thumb_func_start sub_8068060 -sub_8068060: @ 8068060 - push {r4,lr} - sub sp, 0x14 - adds r4, r0, 0 - str r3, [sp, 0x10] - ldr r3, [sp, 0x1C] - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x1 - str r0, [sp] - str r3, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - str r0, [sp, 0xC] - adds r0, r4, 0 - movs r3, 0 - bl create_pokemon_set_level - adds r0, r4, 0 - movs r1, 0x42 - add r2, sp, 0x10 - bl pokemon_setattr - adds r0, r4, 0 - bl pokemon_calc_effective_stats - add sp, 0x14 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8068060 - - thumb_func_start sub_80680A0 -sub_80680A0: @ 80680A0 - push {r4,r5,lr} - sub sp, 0x10 - adds r5, r0, 0 - adds r4, r3, 0 - ldr r3, [sp, 0x1C] - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - str r3, [sp, 0xC] - adds r0, r5, 0 - movs r3, 0 - bl create_pokemon_set_level - adds r0, r5, 0 - movs r1, 0x27 - adds r2, r4, 0 - bl pokemon_setattr - adds r2, r4, 0x1 - adds r0, r5, 0 - movs r1, 0x28 - bl pokemon_setattr - adds r2, r4, 0x2 - adds r0, r5, 0 - movs r1, 0x29 - bl pokemon_setattr - adds r2, r4, 0x3 - adds r0, r5, 0 - movs r1, 0x2A - bl pokemon_setattr - adds r2, r4, 0x4 - adds r0, r5, 0 - movs r1, 0x2B - bl pokemon_setattr - adds r4, 0x5 - adds r0, r5, 0 - movs r1, 0x2C - adds r2, r4, 0 - bl pokemon_setattr - adds r0, r5, 0 - bl pokemon_calc_effective_stats - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80680A0 - - thumb_func_start pokemon_make_ev_something -pokemon_make_ev_something: @ 8068114 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - adds r7, r0, 0 - ldr r0, [sp, 0x2C] - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r6, 0 - str r6, [sp] - str r6, [sp, 0x4] - str r6, [sp, 0x8] - str r6, [sp, 0xC] - adds r0, r7, 0 - bl create_pokemon_set_level - mov r4, r8 - movs r1, 0x1 - movs r5, 0x5 -_08068148: - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _08068152 - adds r6, 0x1 -_08068152: - lsrs r4, 1 - subs r5, 0x1 - cmp r5, 0 - bge _08068148 - movs r0, 0xFF - lsls r0, 1 - adds r1, r6, 0 - bl __divsi3 - add r1, sp, 0x10 - strh r0, [r1] - movs r4, 0x1 - movs r5, 0 -_0806816C: - mov r0, r8 - ands r0, r4 - cmp r0, 0 - beq _08068180 - adds r1, r5, 0 - adds r1, 0x1A - adds r0, r7, 0 - add r2, sp, 0x10 - bl pokemon_setattr -_08068180: - lsls r0, r4, 25 - lsrs r4, r0, 24 - adds r5, 0x1 - cmp r5, 0x5 - ble _0806816C - adds r0, r7, 0 - bl pokemon_calc_effective_stats - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end pokemon_make_ev_something - - thumb_func_start sub_806819C -sub_806819C: @ 806819C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x34 - adds r7, r0, 0 - adds r6, r1, 0 - ldrh r1, [r6] - ldrb r2, [r6, 0xC] - movs r3, 0x1 - str r3, [sp] - ldr r0, [r6, 0x1C] - str r0, [sp, 0x4] - str r3, [sp, 0x8] - ldr r0, [r6, 0x14] - str r0, [sp, 0xC] - adds r0, r7, 0 - movs r3, 0 - bl create_pokemon_set_level - movs r5, 0 - add r0, sp, 0x30 - mov r9, r0 - movs r1, 0x31 - add r1, sp - mov r8, r1 - adds r4, r6, 0x4 -_080681D2: - ldrh r1, [r4] - lsls r2, r5, 24 - lsrs r2, 24 - adds r0, r7, 0 - bl sub_80691F4 - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _080681D2 - adds r2, r6, 0 - adds r2, 0xD - adds r0, r7, 0 - movs r1, 0x15 - bl pokemon_setattr - adds r2, r6, 0x2 - adds r0, r7, 0 - movs r1, 0xC - bl pokemon_setattr - adds r2, r6, 0 - adds r2, 0x2B - adds r0, r7, 0 - movs r1, 0x20 - bl pokemon_setattr - adds r1, r6, 0 - adds r1, 0x20 - add r0, sp, 0x10 - bl CopyString - add r0, sp, 0x10 - ldrb r0, [r0] - cmp r0, 0xFC - bne _08068230 - add r0, sp, 0x10 - ldrb r0, [r0, 0x1] - cmp r0, 0x15 - bne _08068230 - movs r0, 0x1 - mov r1, r9 - strb r0, [r1] - add r0, sp, 0x10 - bl StripExtendedControlCodes - b _08068236 -_08068230: - movs r0, 0x2 - mov r1, r9 - strb r0, [r1] -_08068236: - adds r0, r7, 0 - movs r1, 0x3 - mov r2, r9 - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x2 - add r2, sp, 0x10 - bl pokemon_setattr - adds r2, r6, 0 - adds r2, 0xE - adds r0, r7, 0 - movs r1, 0x1A - bl pokemon_setattr - adds r2, r6, 0 - adds r2, 0xF - adds r0, r7, 0 - movs r1, 0x1B - bl pokemon_setattr - adds r2, r6, 0 - adds r2, 0x10 - adds r0, r7, 0 - movs r1, 0x1C - bl pokemon_setattr - adds r2, r6, 0 - adds r2, 0x11 - adds r0, r7, 0 - movs r1, 0x1D - bl pokemon_setattr - adds r2, r6, 0 - adds r2, 0x12 - adds r0, r7, 0 - movs r1, 0x1E - bl pokemon_setattr - adds r2, r6, 0 - adds r2, 0x13 - adds r0, r7, 0 - movs r1, 0x1F - bl pokemon_setattr - ldrb r0, [r6, 0x1B] - lsrs r0, 7 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x2E - mov r2, r8 - bl pokemon_setattr - ldrb r0, [r6, 0x18] - lsls r0, 27 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x27 - mov r2, r8 - bl pokemon_setattr - ldrh r0, [r6, 0x18] - lsls r0, 22 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x28 - mov r2, r8 - bl pokemon_setattr - ldrb r0, [r6, 0x19] - lsls r0, 25 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x29 - mov r2, r8 - bl pokemon_setattr - ldr r0, [r6, 0x18] - lsls r0, 12 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x2A - mov r2, r8 - bl pokemon_setattr - ldrh r0, [r6, 0x1A] - lsls r0, 23 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x2B - mov r2, r8 - bl pokemon_setattr - ldrb r0, [r6, 0x1B] - lsls r0, 26 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x2C - mov r2, r8 - bl pokemon_setattr - adds r0, r7, 0 - bl sub_806E924 - adds r0, r7, 0 - bl pokemon_calc_effective_stats - add sp, 0x34 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_806819C - - thumb_func_start sub_8068338 -sub_8068338: @ 8068338 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x58 - adds r7, r0, 0 - adds r6, r1, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08068374 - lsls r0, r1, 30 - lsrs r0, 30 - bl sub_8165C90 - lsls r0, 24 - lsrs r3, r0, 24 - b _0806837C - .pool -_08068374: - movs r3, 0x32 - cmp r2, 0 - bne _0806837C - ldrb r3, [r6, 0xC] -_0806837C: - ldrh r1, [r6] - movs r2, 0x1 - str r2, [sp] - ldr r0, [r6, 0x1C] - str r0, [sp, 0x4] - str r2, [sp, 0x8] - ldr r0, [r6, 0x14] - str r0, [sp, 0xC] - adds r0, r7, 0 - adds r2, r3, 0 - movs r3, 0 - bl create_pokemon_set_level - movs r5, 0 - movs r0, 0xD - adds r0, r6 - mov r10, r0 - adds r1, r6, 0x2 - str r1, [sp, 0x38] - adds r0, r6, 0 - adds r0, 0x2B - str r0, [sp, 0x34] - adds r1, 0x1E - str r1, [sp, 0x54] - add r0, sp, 0x30 - mov r9, r0 - subs r1, 0x12 - str r1, [sp, 0x3C] - adds r0, r6, 0 - adds r0, 0xF - str r0, [sp, 0x40] - adds r1, 0x2 - str r1, [sp, 0x44] - adds r0, 0x2 - str r0, [sp, 0x48] - adds r1, 0x2 - str r1, [sp, 0x4C] - adds r0, 0x2 - str r0, [sp, 0x50] - movs r1, 0x31 - add r1, sp - mov r8, r1 - adds r4, r6, 0x4 -_080683D2: - ldrh r1, [r4] - lsls r2, r5, 24 - lsrs r2, 24 - adds r0, r7, 0 - bl sub_80691F4 - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _080683D2 - adds r0, r7, 0 - movs r1, 0x15 - mov r2, r10 - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0xC - ldr r2, [sp, 0x38] - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x20 - ldr r2, [sp, 0x34] - bl pokemon_setattr - add r0, sp, 0x10 - ldr r1, [sp, 0x54] - bl CopyString - add r0, sp, 0x10 - ldrb r0, [r0] - cmp r0, 0xFC - bne _0806842A - add r0, sp, 0x10 - ldrb r0, [r0, 0x1] - cmp r0, 0x15 - bne _0806842A - movs r0, 0x1 - mov r1, r9 - strb r0, [r1] - add r0, sp, 0x10 - bl StripExtendedControlCodes - b _08068430 -_0806842A: - movs r0, 0x2 - mov r1, r9 - strb r0, [r1] -_08068430: - adds r0, r7, 0 - movs r1, 0x3 - mov r2, r9 - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x2 - add r2, sp, 0x10 - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x1A - ldr r2, [sp, 0x3C] - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x1B - ldr r2, [sp, 0x40] - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x1C - ldr r2, [sp, 0x44] - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x1D - ldr r2, [sp, 0x48] - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x1E - ldr r2, [sp, 0x4C] - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x1F - ldr r2, [sp, 0x50] - bl pokemon_setattr - ldrb r0, [r6, 0x1B] - lsrs r0, 7 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x2E - mov r2, r8 - bl pokemon_setattr - ldrb r0, [r6, 0x18] - lsls r0, 27 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x27 - mov r2, r8 - bl pokemon_setattr - ldrh r0, [r6, 0x18] - lsls r0, 22 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x28 - mov r2, r8 - bl pokemon_setattr - ldrb r0, [r6, 0x19] - lsls r0, 25 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x29 - mov r2, r8 - bl pokemon_setattr - ldr r0, [r6, 0x18] - lsls r0, 12 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x2A - mov r2, r8 - bl pokemon_setattr - ldrh r0, [r6, 0x1A] - lsls r0, 23 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x2B - mov r2, r8 - bl pokemon_setattr - ldrb r0, [r6, 0x1B] - lsls r0, 26 - lsrs r0, 27 - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x2C - mov r2, r8 - bl pokemon_setattr - adds r0, r7, 0 - bl sub_806E924 - adds r0, r7, 0 - bl pokemon_calc_effective_stats - add sp, 0x58 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8068338 - - thumb_func_start sub_8068528 -sub_8068528: @ 8068528 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - adds r7, r0, 0 - mov r9, r1 - lsls r2, 24 - lsrs r2, 24 - ldr r6, =gUnknown_08610970 - ldrb r0, [r1] - lsls r3, r0, 27 - lsrs r1, r3, 27 - movs r5, 0x58 - muls r1, r5 - adds r1, r6 - ldrh r1, [r1, 0x30] - mov r8, r1 - lsrs r1, r3, 27 - muls r1, r5 - adds r1, r6 - ldrh r4, [r1, 0x30] - lsrs r4, 8 - lsrs r3, 27 - adds r1, r3, 0 - muls r1, r5 - adds r1, r6 - ldrh r3, [r1, 0x30] - movs r1, 0xFF - ands r1, r3 - lsls r1, 8 - lsls r5, r2, 1 - adds r5, r2 - lsls r5, 2 - mov r2, r9 - adds r6, r2, r5 - orrs r4, r1 - ldrh r1, [r6, 0x4] - adds r4, r1 - ldrb r1, [r2, 0x2] - adds r4, r1 - lsls r0, 25 - lsrs r0, 30 - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - bl sub_8165C90 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldrh r1, [r6, 0x4] - movs r0, 0x1 - str r0, [sp] - str r4, [sp, 0x4] - str r0, [sp, 0x8] - mov r0, r8 - str r0, [sp, 0xC] - adds r0, r7, 0 - movs r3, 0x1F - bl create_pokemon_set_level - mov r1, r9 - adds r2, r5, r1 - adds r2, 0xE - adds r0, r7, 0 - movs r1, 0xC - bl pokemon_setattr - movs r4, 0 - movs r2, 0x12 - add r2, sp - mov r8, r2 - mov r6, r9 - adds r6, 0x6 -_080685BE: - adds r0, r6, r5 - ldrh r1, [r0] - lsls r2, r4, 24 - lsrs r2, 24 - adds r0, r7, 0 - bl sub_80691F4 - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _080685BE - movs r1, 0x55 - add r0, sp, 0x10 - strh r1, [r0] - movs r4, 0 - mov r5, r9 - adds r5, 0x3F -_080685E0: - adds r1, r4, 0 - adds r1, 0x1A - adds r0, r7, 0 - add r2, sp, 0x10 - bl pokemon_setattr - adds r4, 0x1 - cmp r4, 0x5 - ble _080685E0 - ldrb r0, [r5] - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x3 - mov r2, r8 - bl pokemon_setattr - mov r2, r9 - ldrb r0, [r2] - lsls r0, 27 - lsrs r0, 27 - mov r2, r8 - ldrb r1, [r2] - bl sub_81A1650 - adds r2, r0, 0 - adds r0, r7, 0 - movs r1, 0x7 - bl pokemon_setattr - adds r0, r7, 0 - bl pokemon_calc_effective_stats - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8068528 - - thumb_func_start sub_8068634 -sub_8068634: @ 8068634 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - adds r7, r0, 0 - ldr r0, [sp, 0x38] - ldr r4, [sp, 0x3C] - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0x14] - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - lsls r3, 24 - lsrs r5, r3, 24 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r4, 24 - lsrs r4, 24 - mov r8, r4 - movs r6, 0 -_08068664: - bl GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - adds r0, r4, 0 - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bne _08068664 - movs r0, 0x1 - str r0, [sp] - str r4, [sp, 0x4] - str r0, [sp, 0x8] - ldr r0, [sp, 0x40] - str r0, [sp, 0xC] - adds r0, r7, 0 - ldr r1, [sp, 0x14] - mov r2, r10 - mov r3, r9 - bl create_pokemon_set_level - mov r5, r8 - movs r1, 0x1 - movs r4, 0x5 -_080686A2: - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _080686AC - adds r6, 0x1 -_080686AC: - lsrs r5, 1 - subs r4, 0x1 - cmp r4, 0 - bge _080686A2 - movs r0, 0xFF - lsls r0, 1 - adds r1, r6, 0 - bl __divsi3 - add r1, sp, 0x10 - strh r0, [r1] - movs r5, 0x1 - movs r4, 0 -_080686C6: - mov r0, r8 - ands r0, r5 - cmp r0, 0 - beq _080686DA - adds r1, r4, 0 - adds r1, 0x1A - adds r0, r7, 0 - add r2, sp, 0x10 - bl pokemon_setattr -_080686DA: - lsls r0, r5, 25 - lsrs r5, r0, 24 - adds r4, 0x1 - cmp r4, 0x5 - ble _080686C6 - adds r0, r7, 0 - bl pokemon_calc_effective_stats - 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_8068634 - - thumb_func_start sub_80686FC -sub_80686FC: @ 80686FC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r0, 0 - adds r6, r1, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - strh r0, [r6] - adds r0, r7, 0 - movs r1, 0xC - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAF - bne _08068726 - movs r0, 0 -_08068726: - strh r0, [r6, 0x2] - movs r5, 0 - movs r0, 0x2B - adds r0, r6 - mov r8, r0 - movs r1, 0x20 - adds r1, r6 - mov r9, r1 - adds r4, r6, 0x4 -_08068738: - adds r1, r5, 0 - adds r1, 0xD - adds r0, r7, 0 - movs r2, 0 - bl pokemon_getattr - strh r0, [r4] - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _08068738 - adds r0, r7, 0 - movs r1, 0x38 - movs r2, 0 - bl pokemon_getattr - strb r0, [r6, 0xC] - adds r0, r7, 0 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - strb r0, [r6, 0xD] - adds r0, r7, 0 - movs r1, 0x1 - movs r2, 0 - bl pokemon_getattr - str r0, [r6, 0x14] - adds r0, r7, 0 - movs r1, 0x1A - movs r2, 0 - bl pokemon_getattr - strb r0, [r6, 0xE] - adds r0, r7, 0 - movs r1, 0x1B - movs r2, 0 - bl pokemon_getattr - strb r0, [r6, 0xF] - adds r0, r7, 0 - movs r1, 0x1C - movs r2, 0 - bl pokemon_getattr - strb r0, [r6, 0x10] - adds r0, r7, 0 - movs r1, 0x1D - movs r2, 0 - bl pokemon_getattr - strb r0, [r6, 0x11] - adds r0, r7, 0 - movs r1, 0x1E - movs r2, 0 - bl pokemon_getattr - strb r0, [r6, 0x12] - adds r0, r7, 0 - movs r1, 0x1F - movs r2, 0 - bl pokemon_getattr - strb r0, [r6, 0x13] - adds r0, r7, 0 - movs r1, 0x20 - movs r2, 0 - bl pokemon_getattr - mov r1, r8 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x27 - movs r2, 0 - bl pokemon_getattr - movs r4, 0x1F - ands r0, r4 - ldrb r2, [r6, 0x18] - movs r1, 0x20 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r6, 0x18] - adds r0, r7, 0 - movs r1, 0x28 - movs r2, 0 - bl pokemon_getattr - movs r5, 0x1F - ands r0, r5 - lsls r0, 5 - ldrh r2, [r6, 0x18] - ldr r1, =0xfffffc1f - ands r1, r2 - orrs r1, r0 - strh r1, [r6, 0x18] - adds r0, r7, 0 - movs r1, 0x29 - movs r2, 0 - bl pokemon_getattr - ands r0, r4 - lsls r0, 2 - ldrb r2, [r6, 0x19] - movs r1, 0x7D - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r6, 0x19] - adds r0, r7, 0 - movs r1, 0x2A - movs r2, 0 - bl pokemon_getattr - movs r1, 0x1F - ands r1, r0 - lsls r1, 15 - ldr r0, [r6, 0x18] - ldr r2, =0xfff07fff - ands r0, r2 - orrs r0, r1 - str r0, [r6, 0x18] - adds r0, r7, 0 - movs r1, 0x2B - movs r2, 0 - bl pokemon_getattr - ands r0, r5 - lsls r0, 4 - ldrh r2, [r6, 0x1A] - ldr r1, =0xfffffe0f - ands r1, r2 - orrs r1, r0 - strh r1, [r6, 0x1A] - adds r0, r7, 0 - movs r1, 0x2C - movs r2, 0 - bl pokemon_getattr - ands r0, r4 - lsls r0, 1 - ldrb r2, [r6, 0x1B] - movs r1, 0x3F - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r6, 0x1B] - adds r0, r7, 0 - movs r1, 0x2E - movs r2, 0 - bl pokemon_getattr - lsls r0, 7 - ldrb r2, [r6, 0x1B] - movs r1, 0x7F - ands r1, r2 - orrs r1, r0 - strb r1, [r6, 0x1B] - adds r0, r7, 0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - str r0, [r6, 0x1C] - adds r0, r7, 0 - movs r1, 0x2 - mov r2, r9 - bl pokemon_getattr - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80686FC - - thumb_func_start sub_80688A8 -sub_80688A8: @ 80688A8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - mov r8, r0 - ldr r4, [sp, 0x2C] - ldr r6, [sp, 0x30] - ldr r5, [sp, 0x34] - ldr r7, [sp, 0x38] - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0x1 - str r0, [sp, 0x10] - str r4, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - str r7, [sp, 0xC] - mov r0, r8 - bl create_pokemon_set_level - mov r0, r8 - movs r1, 0x50 - add r2, sp, 0x10 - bl pokemon_setattr - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80688A8 - - thumb_func_start sub_80688F8 -sub_80688F8: @ 80688F8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - cmp r0, 0x5 - bhi _080689CE - lsls r0, 2 - ldr r1, =_08068914 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08068914: - .4byte _080689CE - .4byte _0806892C - .4byte _08068A00 - .4byte _08068958 - .4byte _08068A00 - .4byte _08068990 -_0806892C: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080689CE - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080689CE - b _080689B6 - .pool -_08068958: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080689CE - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080689CE - cmp r5, 0x1 - beq _08068A00 - cmp r5, 0x4 - beq _08068A00 - cmp r5, 0x5 - beq _08068A00 - b _080689CE - .pool -_08068990: - ldr r0, =0x02022fec - ldr r2, [r0] - movs r3, 0x2 - adds r0, r2, 0 - ands r0, r3 - cmp r0, 0 - beq _080689E4 - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _080689CE - movs r0, 0x40 - ands r2, r0 - cmp r2, 0 - beq _080689F4 -_080689B6: - ldr r4, =0x020229e8 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r1, 0x18] - cmp r0, r5 - bne _08068A00 -_080689CE: - movs r0, 0 - b _08068A02 - .pool -_080689E4: - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _080689CE -_080689F4: - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080689CE -_08068A00: - movs r0, 0x1 -_08068A02: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80688F8 - - thumb_func_start get_pokemon_data_3 -get_pokemon_data_3: @ 8068A10 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - bne _08068A34 - adds r0, r5, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - movs r1, 0xCD - lsls r1, 1 - cmp r0, r1 - beq _08068A3C -_08068A34: - movs r0, 0 - b _08068A9A - .pool -_08068A3C: - adds r1, r6, 0 - adds r1, 0x27 - adds r0, r5, 0 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - adds r1, r6, 0 - adds r1, 0x1A - adds r0, r5, 0 - movs r2, 0 - bl pokemon_getattr - ldr r2, =gUnknown_08329D48 - lsls r1, r6, 1 - adds r1, r2 - ldrh r1, [r1] - lsls r1, 1 - adds r1, r4 - cmp r0, 0 - bge _08068A68 - adds r0, 0x3 -_08068A68: - asrs r0, 2 - adds r0, r1, r0 - adds r1, r5, 0 - adds r1, 0x54 - ldrb r1, [r1] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - adds r0, 0x5 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r5, 0 - bl GetNature - lsls r0, 24 - lsrs r0, 24 - lsls r2, r6, 24 - lsrs r2, 24 - adds r1, r4, 0 - bl nature_stat_mod - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 -_08068A9A: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end get_pokemon_data_3 - - thumb_func_start sub_8068AA4 -sub_8068AA4: @ 8068AA4 - push {r4,r5,lr} - sub sp, 0x4 - movs r5, 0 -_08068AAA: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - movs r1, 0xCD - lsls r1, 1 - cmp r0, r1 - bne _08068B34 - adds r0, r4, 0 - movs r1, 0x3B - movs r2, 0 - bl pokemon_getattr - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x3B - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3C - movs r2, 0 - bl pokemon_getattr - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x3C - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3D - movs r2, 0 - bl pokemon_getattr - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x3D - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3E - movs r2, 0 - bl pokemon_getattr - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x3E - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3F - movs r2, 0 - bl pokemon_getattr - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x3F - mov r2, sp - bl pokemon_setattr -_08068B34: - adds r5, 0x1 - cmp r5, 0x5 - ble _08068AAA - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8068AA4 - - thumb_func_start sub_8068B48 -sub_8068B48: @ 8068B48 - push {lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 18 - ands r0, r1 - cmp r0, 0 - beq _08068B6C - ldr r0, =0x0203c7b4 - ldrb r1, [r0] - movs r0, 0x1 - eors r0, r1 - b _08068B78 - .pool -_08068B6C: - bl link_get_multiplayer_id - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 -_08068B78: - ldr r3, =0x020229e8 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r0, r3, 0x4 - adds r0, r1, r0 - ldr r2, [r0] - movs r0, 0x7 - ands r2, r0 - adds r1, r3 - ldrb r0, [r1, 0x13] - lsls r0, 3 - orrs r2, r0 - ldr r0, =gUnknown_08329D54 - lsls r2, 1 - adds r2, r0 - ldrh r0, [r2] - bl TrainerClassToTrainerPic - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8068B48 - - thumb_func_start sub_8068BB0 -sub_8068BB0: @ 8068BB0 - push {lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 18 - ands r0, r1 - cmp r0, 0 - beq _08068BD4 - ldr r0, =0x0203c7b4 - ldrb r1, [r0] - movs r0, 0x1 - eors r0, r1 - b _08068BE0 - .pool -_08068BD4: - bl link_get_multiplayer_id - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 -_08068BE0: - ldr r3, =0x020229e8 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r0, r3, 0x4 - adds r0, r1, r0 - ldr r2, [r0] - movs r0, 0x7 - ands r2, r0 - adds r1, r3 - ldrb r0, [r1, 0x13] - lsls r0, 3 - orrs r2, r0 - ldr r1, =gTrainerClassNameIndices - ldr r0, =gUnknown_08329D54 - lsls r2, 1 - adds r2, r0 - ldrh r0, [r2] - adds r0, r1 - ldrb r0, [r0] - pop {r1} - bx r1 - .pool - thumb_func_end sub_8068BB0 - - thumb_func_start DoScriptedWildBattle -DoScriptedWildBattle: @ 8068C18 - push {r4-r7,lr} - sub sp, 0x14 - ldr r0, =0x020375e0 - ldrh r5, [r0] - ldr r0, =0x020375e2 - ldrh r4, [r0] - ldr r0, =0x020375e4 - ldrh r6, [r0] - bl zero_enemy_party_data - ldr r7, =0x02024744 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - adds r0, r7, 0 - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x20 - bl sub_80688A8 - cmp r6, 0 - beq _08068C60 - add r0, sp, 0x10 - strb r6, [r0] - adds r1, r0, 0 - asrs r0, r6, 8 - strb r0, [r1, 0x1] - adds r0, r7, 0 - movs r1, 0xC - add r2, sp, 0x10 - bl pokemon_setattr -_08068C60: - add sp, 0x14 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DoScriptedWildBattle - - thumb_func_start pokemon_calc_checksum -@ int pokemon_calc_checksum(pokemon *mon) -pokemon_calc_checksum: @ 8068C78 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - movs r6, 0 - ldr r1, [r4] - movs r2, 0 - bl pokemon_data_permutator - adds r5, r0, 0 - ldr r1, [r4] - adds r0, r4, 0 - movs r2, 0x1 - bl pokemon_data_permutator - adds r7, r0, 0 - ldr r1, [r4] - adds r0, r4, 0 - movs r2, 0x2 - bl pokemon_data_permutator - mov r8, r0 - ldr r1, [r4] - adds r0, r4, 0 - movs r2, 0x3 - bl pokemon_data_permutator - adds r3, r0, 0 - movs r1, 0x5 -_08068CB2: - ldrh r0, [r5] - adds r0, r6, r0 - lsls r0, 16 - lsrs r6, r0, 16 - adds r5, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _08068CB2 - adds r2, r7, 0 - movs r1, 0x5 -_08068CC6: - ldrh r0, [r2] - adds r0, r6, r0 - lsls r0, 16 - lsrs r6, r0, 16 - adds r2, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _08068CC6 - mov r2, r8 - movs r1, 0x5 -_08068CDA: - ldrh r0, [r2] - adds r0, r6, r0 - lsls r0, 16 - lsrs r6, r0, 16 - adds r2, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _08068CDA - adds r2, r3, 0 - movs r1, 0x5 -_08068CEE: - ldrh r0, [r2] - adds r0, r6, r0 - lsls r0, 16 - lsrs r6, r0, 16 - adds r2, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _08068CEE - adds r0, r6, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end pokemon_calc_checksum - - thumb_func_start pokemon_calc_effective_stats -pokemon_calc_effective_stats: @ 8068D0C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x40 - adds r5, r0, 0 - movs r1, 0x3A - movs r2, 0 - bl pokemon_getattr - mov r8, r0 - adds r0, r5, 0 - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - str r0, [sp, 0x1C] - adds r0, r5, 0 - movs r1, 0x27 - movs r2, 0 - bl pokemon_getattr - adds r6, r0, 0 - adds r0, r5, 0 - movs r1, 0x1A - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - adds r0, r5, 0 - movs r1, 0x28 - movs r2, 0 - bl pokemon_getattr - mov r10, r0 - adds r0, r5, 0 - movs r1, 0x1B - movs r2, 0 - bl pokemon_getattr - mov r9, r0 - adds r0, r5, 0 - movs r1, 0x29 - movs r2, 0 - bl pokemon_getattr - str r0, [sp, 0x20] - adds r0, r5, 0 - movs r1, 0x1C - movs r2, 0 - bl pokemon_getattr - str r0, [sp, 0x24] - adds r0, r5, 0 - movs r1, 0x2A - movs r2, 0 - bl pokemon_getattr - str r0, [sp, 0x28] - adds r0, r5, 0 - movs r1, 0x1D - movs r2, 0 - bl pokemon_getattr - str r0, [sp, 0x2C] - adds r0, r5, 0 - movs r1, 0x2B - movs r2, 0 - bl pokemon_getattr - str r0, [sp, 0x30] - adds r0, r5, 0 - movs r1, 0x1E - movs r2, 0 - bl pokemon_getattr - str r0, [sp, 0x34] - adds r0, r5, 0 - movs r1, 0x2C - movs r2, 0 - bl pokemon_getattr - str r0, [sp, 0x38] - adds r0, r5, 0 - movs r1, 0x1F - movs r2, 0 - bl pokemon_getattr - str r0, [sp, 0x3C] - adds r0, r5, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r7, r0, 16 - adds r0, r5, 0 - bl level_by_exp - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - adds r0, r5, 0 - movs r1, 0x38 - mov r2, sp - bl pokemon_setattr - ldr r0, =0x0000012f - cmp r7, r0 - bne _08068DF8 - movs r0, 0x1 - str r0, [sp, 0x4] - lsls r6, r7, 3 - b _08068E26 - .pool -_08068DF8: - ldr r1, =gBaseStats - lsls r2, r7, 3 - subs r0, r2, r7 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 1 - adds r1, r0, r6 - adds r0, r4, 0 - adds r6, r2, 0 - cmp r0, 0 - bge _08068E12 - adds r0, 0x3 -_08068E12: - asrs r0, 2 - adds r0, r1, r0 - ldr r4, [sp] - muls r0, r4 - movs r1, 0x64 - bl __divsi3 - adds r0, r4 - adds r0, 0xA - str r0, [sp, 0x4] -_08068E26: - ldr r1, =0x02024474 - add r2, sp, 0x4 - ldrb r0, [r2] - mov r3, r8 - subs r0, r3 - adds r1, 0x23 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - bne _08068E3E - movs r0, 0x1 - strb r0, [r1] -_08068E3E: - adds r0, r5, 0 - movs r1, 0x3A - bl pokemon_setattr - ldr r0, =gBaseStats - subs r1, r6, r7 - lsls r1, 2 - adds r6, r1, r0 - ldrb r0, [r6, 0x1] - lsls r0, 1 - mov r2, r10 - adds r1, r0, r2 - mov r0, r9 - cmp r0, 0 - bge _08068E5E - adds r0, 0x3 -_08068E5E: - asrs r0, 2 - adds r0, r1, r0 - ldr r1, [sp] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - adds r0, 0x5 - str r0, [sp, 0x8] - adds r0, r5, 0 - bl GetNature - lsls r0, 24 - lsrs r0, 24 - add r4, sp, 0x8 - ldrh r1, [r4] - movs r2, 0x1 - bl nature_stat_mod - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0x3B - adds r2, r4, 0 - bl pokemon_setattr - ldrb r0, [r6, 0x2] - lsls r0, 1 - ldr r3, [sp, 0x20] - adds r1, r0, r3 - ldr r0, [sp, 0x24] - cmp r0, 0 - bge _08068EA4 - adds r0, 0x3 -_08068EA4: - asrs r0, 2 - adds r0, r1, r0 - ldr r1, [sp] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - adds r0, 0x5 - str r0, [sp, 0xC] - adds r0, r5, 0 - bl GetNature - lsls r0, 24 - lsrs r0, 24 - add r4, sp, 0xC - ldrh r1, [r4] - movs r2, 0x2 - bl nature_stat_mod - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0xC] - adds r0, r5, 0 - movs r1, 0x3C - adds r2, r4, 0 - bl pokemon_setattr - ldrb r0, [r6, 0x3] - lsls r0, 1 - ldr r2, [sp, 0x28] - adds r1, r0, r2 - ldr r0, [sp, 0x2C] - cmp r0, 0 - bge _08068EEA - adds r0, 0x3 -_08068EEA: - asrs r0, 2 - adds r0, r1, r0 - ldr r1, [sp] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - adds r0, 0x5 - str r0, [sp, 0x10] - adds r0, r5, 0 - bl GetNature - lsls r0, 24 - lsrs r0, 24 - add r4, sp, 0x10 - ldrh r1, [r4] - movs r2, 0x3 - bl nature_stat_mod - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x10] - adds r0, r5, 0 - movs r1, 0x3D - adds r2, r4, 0 - bl pokemon_setattr - ldrb r0, [r6, 0x4] - lsls r0, 1 - ldr r3, [sp, 0x30] - adds r1, r0, r3 - ldr r0, [sp, 0x34] - cmp r0, 0 - bge _08068F30 - adds r0, 0x3 -_08068F30: - asrs r0, 2 - adds r0, r1, r0 - ldr r1, [sp] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - adds r0, 0x5 - str r0, [sp, 0x14] - adds r0, r5, 0 - bl GetNature - lsls r0, 24 - lsrs r0, 24 - add r4, sp, 0x14 - ldrh r1, [r4] - movs r2, 0x4 - bl nature_stat_mod - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x14] - adds r0, r5, 0 - movs r1, 0x3E - adds r2, r4, 0 - bl pokemon_setattr - ldrb r0, [r6, 0x5] - lsls r0, 1 - ldr r2, [sp, 0x38] - adds r1, r0, r2 - ldr r0, [sp, 0x3C] - cmp r0, 0 - bge _08068F76 - adds r0, 0x3 -_08068F76: - asrs r0, 2 - adds r0, r1, r0 - ldr r1, [sp] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - adds r0, 0x5 - str r0, [sp, 0x18] - adds r0, r5, 0 - bl GetNature - lsls r0, 24 - lsrs r0, 24 - add r4, sp, 0x18 - ldrh r1, [r4] - movs r2, 0x5 - bl nature_stat_mod - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x18] - adds r0, r5, 0 - movs r1, 0x3F - adds r2, r4, 0 - bl pokemon_setattr - ldr r0, =0x0000012f - cmp r7, r0 - bne _08068FD0 - ldr r0, [sp, 0x1C] - cmp r0, 0 - bne _08068FBE - mov r3, r8 - cmp r3, 0 - bne _08068FF4 -_08068FBE: - movs r0, 0x1 - b _08068FE8 - .pool -_08068FD0: - ldr r1, [sp, 0x1C] - cmp r1, 0 - bne _08068FE0 - mov r0, r8 - cmp r0, 0 - bne _08068FF4 - ldr r0, [sp, 0x4] - b _08068FE8 -_08068FE0: - ldr r0, [sp, 0x4] - mov r2, r8 - subs r0, r2 - adds r0, r1, r0 -_08068FE8: - str r0, [sp, 0x1C] - add r2, sp, 0x1C - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_setattr -_08068FF4: - add sp, 0x40 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end pokemon_calc_effective_stats - - thumb_func_start sub_8069004 -sub_8069004: @ 8069004 - push {r4,lr} - sub sp, 0x4 - adds r2, r0, 0 - adds r4, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - adds r1, r2, 0 - movs r2, 0x50 - bl memcpy - adds r0, r4, 0 - movs r1, 0x37 - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x39 - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3A - mov r2, sp - bl pokemon_setattr - movs r0, 0xFF - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x40 - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - bl pokemon_calc_effective_stats - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8069004 - - thumb_func_start level_by_exp -level_by_exp: @ 8069054 - push {r4-r6,lr} - adds r5, r0, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x19 - movs r2, 0 - bl pokemon_getattr - adds r3, r0, 0 - movs r2, 0x1 - ldr r6, =gExperienceTables - ldr r1, =gBaseStats - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r1, r0, r1 - ldrb r0, [r1, 0x13] - movs r5, 0xCA - lsls r5, 1 - muls r0, r5 - adds r0, 0x4 - adds r0, r6 - ldr r0, [r0] - cmp r0, r3 - bhi _080690AA - adds r4, r1, 0 -_08069094: - adds r2, 0x1 - cmp r2, 0x64 - bgt _080690AA - lsls r1, r2, 2 - ldrb r0, [r4, 0x13] - muls r0, r5 - adds r1, r0 - adds r1, r6 - ldr r0, [r1] - cmp r0, r3 - bls _08069094 -_080690AA: - subs r0, r2, 0x1 - lsls r0, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end level_by_exp - - thumb_func_start sub_80690C0 -sub_80690C0: @ 80690C0 - push {r4-r6,lr} - adds r5, r0, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr_encrypted - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x19 - movs r2, 0 - bl pokemon_getattr_encrypted - adds r3, r0, 0 - movs r2, 0x1 - ldr r6, =gExperienceTables - ldr r1, =gBaseStats - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r1, r0, r1 - ldrb r0, [r1, 0x13] - movs r5, 0xCA - lsls r5, 1 - muls r0, r5 - adds r0, 0x4 - adds r0, r6 - ldr r0, [r0] - cmp r0, r3 - bhi _08069116 - adds r4, r1, 0 -_08069100: - adds r2, 0x1 - cmp r2, 0x64 - bgt _08069116 - lsls r1, r2, 2 - ldrb r0, [r4, 0x13] - muls r0, r5 - adds r1, r0 - adds r1, r6 - ldr r0, [r1] - cmp r0, r3 - bls _08069100 -_08069116: - subs r0, r2, 0x1 - lsls r0, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80690C0 - - thumb_func_start pokemon_moveset_pad_ -pokemon_moveset_pad_: @ 806912C - push {lr} - lsls r1, 16 - lsrs r1, 16 - bl pokemon_moveset_pad - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end pokemon_moveset_pad_ - - thumb_func_start pokemon_moveset_pad -pokemon_moveset_pad: @ 8069140 - push {r4-r7,lr} - sub sp, 0x4 - adds r7, r0, 0 - mov r0, sp - strh r1, [r0] - movs r5, 0 - mov r6, sp -_0806914E: - adds r4, r5, 0 - adds r4, 0xD - adds r0, r7, 0 - adds r1, r4, 0 - movs r2, 0 - bl pokemon_getattr_encrypted - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _0806918C - adds r0, r7, 0 - adds r1, r4, 0 - mov r2, sp - bl pokemon_setattr_encrypted - adds r1, r5, 0 - adds r1, 0x11 - ldrh r0, [r6] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - ldr r0, =gBattleMoves + 0x4 @ PP offset - adds r2, r0 - adds r0, r7, 0 - bl pokemon_setattr_encrypted - ldrh r0, [r6] - b _080691A4 - .pool -_0806918C: - ldrh r1, [r6] - cmp r0, r1 - bne _0806919C - ldr r0, =0x0000fffe - b _080691A4 - .pool -_0806919C: - adds r5, 0x1 - cmp r5, 0x3 - ble _0806914E - ldr r0, =0x0000ffff -_080691A4: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end pokemon_moveset_pad - - thumb_func_start sub_80691B0 -sub_80691B0: @ 80691B0 - push {r4,r5,lr} - lsls r1, 16 - lsrs r4, r1, 16 - movs r3, 0 - adds r5, r0, 0 - adds r5, 0x24 - ldr r2, =gBattleMoves - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 2 - adds r2, r1, r2 - adds r1, r0, 0 - adds r1, 0xC -_080691CA: - ldrh r0, [r1] - cmp r0, 0 - bne _080691E0 - strh r4, [r1] - adds r1, r5, r3 - ldrb r0, [r2, 0x4] - strb r0, [r1] - adds r0, r4, 0 - b _080691EA - .pool -_080691E0: - adds r1, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - ble _080691CA - ldr r0, =0x0000ffff -_080691EA: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80691B0 - - thumb_func_start sub_80691F4 -sub_80691F4: @ 80691F4 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r4, r2, 0 - mov r0, sp - strh r1, [r0] - lsls r4, 24 - lsrs r4, 24 - adds r1, r4, 0 - adds r1, 0xD - adds r0, r5, 0 - mov r2, sp - bl pokemon_setattr - adds r4, 0x11 - mov r0, sp - ldrh r0, [r0] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - ldr r0, =gBattleMoves + 0x4 @ PP offset - adds r2, r0 - adds r0, r5, 0 - adds r1, r4, 0 - bl pokemon_setattr - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80691F4 - - thumb_func_start sub_8069234 -sub_8069234: @ 8069234 - push {r4,lr} - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - lsls r4, r2, 1 - adds r3, r0, 0 - adds r3, 0xC - adds r3, r4 - strh r1, [r3] - adds r0, 0x24 - adds r0, r2 - ldr r3, =gBattleMoves - lsls r2, r1, 1 - adds r2, r1 - lsls r2, 2 - adds r2, r3 - ldrb r1, [r2, 0x4] - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8069234 - - thumb_func_start sub_8069264 -sub_8069264: @ 8069264 - push {lr} - bl sub_8069270 - pop {r0} - bx r0 - thumb_func_end sub_8069264 - - thumb_func_start sub_8069270 -sub_8069270: @ 8069270 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr_encrypted - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - bl sub_80690C0 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r0, =gLevelUpLearnsetPointers - lsls r6, r4, 2 - adds r0, r6, r0 - ldr r0, [r0] - ldrh r1, [r0] - ldr r2, =0xffff0000 - lsrs r0, r2, 16 - cmp r1, r0 - beq _080692FC - mov r9, r2 - movs r3, 0 -_080692AE: - ldr r0, =gLevelUpLearnsetPointers - adds r7, r6, r0 - ldr r0, [r7] - adds r0, r3, r0 - ldrh r2, [r0] - movs r1, 0xFE - lsls r1, 8 - adds r0, r1, 0 - ands r0, r2 - mov r4, r10 - lsls r1, r4, 9 - cmp r0, r1 - bgt _080692FC - ldr r1, =0x000001ff - adds r0, r1, 0 - adds r4, r0, 0 - ands r4, r2 - mov r0, r8 - adds r1, r4, 0 - str r3, [sp] - bl pokemon_moveset_pad - lsls r0, 16 - mov r1, r9 - lsrs r5, r1, 16 - ldr r3, [sp] - cmp r0, r9 - bne _080692F0 - mov r0, r8 - adds r1, r4, 0 - bl sub_80694D0 - ldr r3, [sp] -_080692F0: - adds r3, 0x2 - ldr r0, [r7] - adds r0, r3, r0 - ldrh r0, [r0] - cmp r0, r5 - bne _080692AE -_080692FC: - 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_8069270 - - thumb_func_start sub_8069318 -sub_8069318: @ 8069318 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r0 - lsls r4, r1, 24 - lsrs r4, 24 - movs r0, 0 - str r0, [sp] - mov r0, r8 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - mov r0, r8 - movs r1, 0x38 - movs r2, 0 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - cmp r4, 0 - beq _080693B0 - ldr r4, =0x020244e8 - mov r1, sp - ldrb r1, [r1] - strb r1, [r4] - ldr r2, =gLevelUpLearnsetPointers - mov r5, r9 - lsls r3, r5, 2 - adds r5, r3, r2 - ldr r0, [r5] - ldrh r1, [r0] - movs r7, 0xFE - lsls r7, 8 - adds r0, r7, 0 - ands r0, r1 - adds r6, r4, 0 - mov r12, r2 - mov r1, r10 - lsls r4, r1, 9 - cmp r0, r4 - beq _080693D8 - adds r2, r6, 0 - ldr r0, =0x0000ffff - mov r12, r0 - adds r6, r7, 0 - adds r3, r5, 0 -_08069384: - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - ldrb r0, [r2] - ldr r1, [r3] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - cmp r1, r12 - bne _080693A8 - movs r0, 0 - b _08069404 - .pool -_080693A8: - adds r0, r6, 0 - ands r0, r1 - cmp r0, r4 - bne _08069384 -_080693B0: - ldr r3, =gLevelUpLearnsetPointers - mov r1, r9 - lsls r4, r1, 2 - adds r1, r4, r3 - ldr r2, =0x020244e8 - ldrb r0, [r2] - ldr r1, [r1] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0xFE - lsls r0, 8 - ands r0, r1 - mov r5, r10 - lsls r1, r5, 9 - adds r6, r2, 0 - mov r12, r3 - adds r3, r4, 0 - cmp r0, r1 - bne _08069402 -_080693D8: - ldr r2, =0x020244e2 - mov r0, r12 - adds r1, r3, r0 - ldrb r0, [r6] - ldr r1, [r1] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - ldr r0, =0x000001ff - ands r0, r1 - strh r0, [r2] - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] - ldrh r1, [r2] - mov r0, r8 - bl pokemon_moveset_pad_ - lsls r0, 16 - lsrs r0, 16 - str r0, [sp] -_08069402: - ldr r0, [sp] -_08069404: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8069318 - - thumb_func_start sub_8069424 -sub_8069424: @ 8069424 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - adds r6, r0, 0 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - movs r4, 0 - add r7, sp, 0x8 - add r0, sp, 0xC - mov r9, r0 - mov r5, sp -_08069440: - adds r1, r4, 0 - adds r1, 0xE - adds r0, r6, 0 - movs r2, 0 - bl pokemon_getattr - strh r0, [r5] - adds r1, r4, 0 - adds r1, 0x12 - adds r0, r6, 0 - movs r2, 0 - bl pokemon_getattr - adds r1, r7, r4 - strb r0, [r1] - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x2 - ble _08069440 - adds r0, r6, 0 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - mov r1, r9 - strb r0, [r1] - ldrb r0, [r1] - lsrs r0, 2 - strb r0, [r1] - mov r0, sp - mov r2, r8 - strh r2, [r0, 0x6] - ldr r1, =gBattleMoves - mov r2, r8 - lsls r0, r2, 1 - add r0, r8 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x4] - strb r0, [r7, 0x3] - movs r4, 0 - mov r5, sp -_08069494: - adds r1, r4, 0 - adds r1, 0xD - adds r0, r6, 0 - adds r2, r5, 0 - bl pokemon_setattr - adds r1, r4, 0 - adds r1, 0x11 - adds r2, r7, r4 - adds r0, r6, 0 - bl pokemon_setattr - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _08069494 - adds r0, r6, 0 - movs r1, 0x15 - mov r2, r9 - bl pokemon_setattr - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8069424 - - thumb_func_start sub_80694D0 -sub_80694D0: @ 80694D0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - adds r6, r0, 0 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - movs r4, 0 - add r7, sp, 0x8 - add r0, sp, 0xC - mov r9, r0 - mov r5, sp -_080694EC: - adds r1, r4, 0 - adds r1, 0xE - adds r0, r6, 0 - movs r2, 0 - bl pokemon_getattr_encrypted - strh r0, [r5] - adds r1, r4, 0 - adds r1, 0x12 - adds r0, r6, 0 - movs r2, 0 - bl pokemon_getattr_encrypted - adds r1, r7, r4 - strb r0, [r1] - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x2 - ble _080694EC - adds r0, r6, 0 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr_encrypted - mov r1, r9 - strb r0, [r1] - ldrb r0, [r1] - lsrs r0, 2 - strb r0, [r1] - mov r0, sp - mov r2, r8 - strh r2, [r0, 0x6] - ldr r1, =gBattleMoves - mov r2, r8 - lsls r0, r2, 1 - add r0, r8 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x4] - strb r0, [r7, 0x3] - movs r4, 0 - mov r5, sp -_08069540: - adds r1, r4, 0 - adds r1, 0xD - adds r0, r6, 0 - adds r2, r5, 0 - bl pokemon_setattr_encrypted - adds r1, r4, 0 - adds r1, 0x11 - adds r2, r7, r4 - adds r0, r6, 0 - bl pokemon_setattr_encrypted - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _08069540 - adds r0, r6, 0 - movs r1, 0x15 - mov r2, r9 - bl pokemon_setattr_encrypted - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80694D0 - - thumb_func_start sub_806957C -sub_806957C: @ 806957C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x30 - adds r6, r0, 0 - str r1, [sp, 0x4] - str r2, [sp, 0x8] - ldr r0, [sp, 0x50] - ldr r1, [sp, 0x54] - ldr r2, [sp, 0x58] - ldr r4, [sp, 0x5C] - lsls r3, 16 - lsrs r3, 16 - str r3, [sp, 0xC] - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x10] - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x14] - movs r5, 0 - cmp r3, 0 - bne _080695D4 - ldr r2, =0x020244e0 - ldr r1, =gBattleMoves - ldr r3, [sp, 0x8] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x1] - strh r0, [r2] - b _080695D8 - .pool -_080695D4: - ldr r0, =0x020244e0 - strh r3, [r0] -_080695D8: - cmp r7, 0 - bne _080695F8 - ldr r1, =gBattleMoves - ldr r7, [sp, 0x8] - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x2] - mov r10, r0 - b _08069602 - .pool -_080695F8: - movs r0, 0x3F - mov r10, r0 - mov r1, r10 - ands r1, r7 - mov r10, r1 -_08069602: - ldrh r7, [r6, 0x2] - ldr r2, [sp, 0x4] - ldrh r2, [r2, 0x4] - str r2, [sp, 0x18] - ldrh r3, [r6, 0x8] - mov r8, r3 - ldr r0, [sp, 0x4] - ldrh r0, [r0, 0xA] - str r0, [sp, 0x1C] - ldrh r0, [r6, 0x2E] - cmp r0, 0xAF - bne _08069634 - ldr r1, =0x02024404 - ldr r2, [sp, 0x10] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r3, [r0, 0x7] - mov r9, r3 - ldrb r0, [r0, 0x1A] - b _0806964A - .pool -_08069634: - ldrh r0, [r6, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldrh r0, [r6, 0x2E] - bl itemid_get_quality - lsls r0, 24 - lsrs r0, 24 -_0806964A: - str r0, [sp, 0x24] - ldr r1, [sp, 0x4] - ldrh r0, [r1, 0x2E] - cmp r0, 0xAF - bne _0806967E - ldr r1, =0x02024404 - ldr r2, [sp, 0x14] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x7] - str r0, [sp, 0x20] - b _08069694 - .pool -_0806966C: - ldr r0, [sp, 0x24] - adds r0, 0x64 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r7, r0, 16 - b _0806977C -_0806967E: - ldr r3, [sp, 0x4] - ldrh r0, [r3, 0x2E] - bl itemid_get_x12 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x20] - ldr r1, [sp, 0x4] - ldrh r0, [r1, 0x2E] - bl itemid_get_quality -_08069694: - adds r0, r6, 0 - adds r0, 0x20 - ldrb r1, [r0] - str r0, [sp, 0x28] - cmp r1, 0x25 - beq _080696A4 - cmp r1, 0x4A - bne _080696A8 -_080696A4: - lsls r0, r7, 17 - lsrs r7, r0, 16 -_080696A8: - ldr r0, =0x00000867 - ldr r1, [sp, 0x10] - bl sub_8069ED8 - lsls r0, 24 - cmp r0, 0 - beq _080696C4 - movs r0, 0x6E - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r7, r0, 16 -_080696C4: - ldr r0, =0x0000086b - ldr r1, [sp, 0x14] - bl sub_8069ED8 - lsls r0, 24 - cmp r0, 0 - beq _080696E4 - movs r0, 0x6E - ldr r2, [sp, 0x18] - muls r0, r2 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x18] -_080696E4: - ldr r4, =0x0000086d - adds r0, r4, 0 - ldr r1, [sp, 0x10] - bl sub_8069ED8 - lsls r0, 24 - cmp r0, 0 - beq _08069708 - movs r0, 0x6E - mov r3, r8 - muls r3, r0 - adds r0, r3, 0 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 -_08069708: - adds r0, r4, 0 - ldr r1, [sp, 0x14] - bl sub_8069ED8 - lsls r0, 24 - cmp r0, 0 - beq _08069728 - movs r0, 0x6E - ldr r1, [sp, 0x1C] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x1C] -_08069728: - movs r2, 0 - ldr r4, =gUnknown_08329D74 - ldr r3, [sp, 0x4] - adds r3, 0x20 - str r3, [sp, 0x2C] - adds r3, r4, 0 -_08069734: - lsls r1, r2, 1 - ldrb r0, [r3] - cmp r9, r0 - bne _08069774 - adds r0, r4, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - cmp r10, r0 - bne _08069774 - mov r1, r10 - cmp r1, 0x8 - bls _0806966C - ldr r0, [sp, 0x24] - adds r0, 0x64 - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - b _0806977C - .pool -_08069774: - adds r3, 0x2 - adds r2, 0x1 - cmp r2, 0x10 - bls _08069734 -_0806977C: - mov r3, r9 - cmp r3, 0x1D - bne _08069790 - movs r0, 0x96 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r7, r0, 16 -_08069790: - mov r0, r9 - cmp r0, 0x22 - bne _080697C6 - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x003f0100 - ands r0, r1 - cmp r0, 0 - bne _080697C6 - ldr r1, =0xfffffe69 - adds r0, r1, 0 - ldrh r2, [r6] - adds r0, r2 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _080697C6 - movs r0, 0x96 - mov r3, r8 - muls r3, r0 - adds r0, r3, 0 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 -_080697C6: - ldr r0, [sp, 0x20] - cmp r0, 0x22 - bne _080697FC - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x003f0100 - ands r0, r1 - cmp r0, 0 - bne _080697FC - ldr r1, =0xfffffe69 - adds r0, r1, 0 - ldr r2, [sp, 0x4] - ldrh r2, [r2] - adds r0, r2 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _080697FC - movs r0, 0x96 - ldr r3, [sp, 0x1C] - muls r0, r3 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x1C] -_080697FC: - mov r0, r9 - cmp r0, 0x23 - bne _08069812 - ldrh r1, [r6] - ldr r0, =0x00000175 - cmp r1, r0 - bne _08069812 - mov r1, r8 - lsls r0, r1, 17 - lsrs r0, 16 - mov r8, r0 -_08069812: - ldr r2, [sp, 0x20] - cmp r2, 0x24 - bne _0806982A - ldr r3, [sp, 0x4] - ldrh r1, [r3] - ldr r0, =0x00000175 - cmp r1, r0 - bne _0806982A - ldr r1, [sp, 0x1C] - lsls r0, r1, 17 - lsrs r0, 16 - str r0, [sp, 0x1C] -_0806982A: - mov r2, r9 - cmp r2, 0x2D - bne _0806983E - ldrh r0, [r6] - cmp r0, 0x19 - bne _0806983E - mov r3, r8 - lsls r0, r3, 17 - lsrs r0, 16 - mov r8, r0 -_0806983E: - ldr r0, [sp, 0x20] - cmp r0, 0x40 - bne _08069854 - ldr r1, [sp, 0x4] - ldrh r0, [r1] - cmp r0, 0x84 - bne _08069854 - ldr r2, [sp, 0x18] - lsls r0, r2, 17 - lsrs r0, 16 - str r0, [sp, 0x18] -_08069854: - mov r3, r9 - cmp r3, 0x41 - bne _0806986A - ldrh r0, [r6] - subs r0, 0x68 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _0806986A - lsls r0, r7, 17 - lsrs r7, r0, 16 -_0806986A: - ldr r1, [sp, 0x2C] - ldrb r0, [r1] - cmp r0, 0x2F - bne _08069882 - mov r2, r10 - cmp r2, 0xA - beq _0806987C - cmp r2, 0xF - bne _08069882 -_0806987C: - mov r3, r8 - lsrs r3, 1 - mov r8, r3 -_08069882: - ldr r0, [sp, 0x28] - ldrb r4, [r0] - cmp r4, 0x37 - bne _08069898 - movs r0, 0x96 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r7, r0, 16 -_08069898: - cmp r4, 0x39 - bne _080698C6 - movs r0, 0 - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0x3A - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _080698C6 - movs r0, 0x96 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 -_080698C6: - ldr r2, [sp, 0x28] - ldrb r0, [r2] - cmp r0, 0x3A - bne _080698F8 - movs r0, 0 - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0x39 - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _080698F8 - movs r0, 0x96 - mov r3, r8 - muls r3, r0 - adds r0, r3, 0 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 -_080698F8: - ldr r1, [sp, 0x28] - ldrb r0, [r1] - cmp r0, 0x3E - bne _08069914 - ldr r0, [r6, 0x4C] - cmp r0, 0 - beq _08069914 - movs r0, 0x96 - muls r0, r7 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r7, r0, 16 -_08069914: - ldr r2, [sp, 0x2C] - ldrb r0, [r2] - cmp r0, 0x3F - bne _08069936 - ldr r3, [sp, 0x4] - ldr r0, [r3, 0x4C] - cmp r0, 0 - beq _08069936 - movs r0, 0x96 - ldr r1, [sp, 0x18] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x18] -_08069936: - mov r2, r10 - cmp r2, 0xD - bne _0806995A - movs r0, 0 - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0 - movs r3, 0xFD - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _0806995A - ldr r1, =0x020244e0 - ldrh r0, [r1] - lsrs r0, 1 - strh r0, [r1] -_0806995A: - mov r3, r10 - cmp r3, 0xA - bne _0806997E - movs r0, 0 - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0 - movs r3, 0xFE - bl ability_something - lsls r0, 24 - cmp r0, 0 - beq _0806997E - ldr r1, =0x020244e0 - ldrh r0, [r1] - lsrs r0, 1 - strh r0, [r1] -_0806997E: - mov r0, r10 - cmp r0, 0xC - bne _080699AE - ldr r1, [sp, 0x28] - ldrb r0, [r1] - cmp r0, 0x41 - bne _080699AE - ldrh r0, [r6, 0x2C] - movs r1, 0x3 - bl __udivsi3 - ldrh r1, [r6, 0x28] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - bhi _080699AE - ldr r4, =0x020244e0 - ldrh r1, [r4] - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - strh r0, [r4] -_080699AE: - mov r2, r10 - cmp r2, 0xA - bne _080699DE - ldr r3, [sp, 0x28] - ldrb r0, [r3] - cmp r0, 0x42 - bne _080699DE - ldrh r0, [r6, 0x2C] - movs r1, 0x3 - bl __udivsi3 - ldrh r1, [r6, 0x28] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - bhi _080699DE - ldr r4, =0x020244e0 - ldrh r1, [r4] - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - strh r0, [r4] -_080699DE: - mov r0, r10 - cmp r0, 0xB - bne _08069A0E - ldr r1, [sp, 0x28] - ldrb r0, [r1] - cmp r0, 0x43 - bne _08069A0E - ldrh r0, [r6, 0x2C] - movs r1, 0x3 - bl __udivsi3 - ldrh r1, [r6, 0x28] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - bhi _08069A0E - ldr r4, =0x020244e0 - ldrh r1, [r4] - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - strh r0, [r4] -_08069A0E: - mov r2, r10 - cmp r2, 0x6 - bne _08069A3E - ldr r3, [sp, 0x28] - ldrb r0, [r3] - cmp r0, 0x44 - bne _08069A3E - ldrh r0, [r6, 0x2C] - movs r1, 0x3 - bl __udivsi3 - ldrh r1, [r6, 0x28] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - bhi _08069A3E - ldr r4, =0x020244e0 - ldrh r1, [r4] - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - strh r0, [r4] -_08069A3E: - ldr r2, =gBattleMoves - ldr r0, =0x020241ea - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x7 - bne _08069A58 - ldr r0, [sp, 0x18] - lsrs r0, 1 - str r0, [sp, 0x18] -_08069A58: - mov r1, r10 - cmp r1, 0x8 - bls _08069A60 - b _08069BC2 -_08069A60: - ldr r0, =0x02024211 - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0x2 - bne _08069AA0 - movs r0, 0x19 - ldrsb r0, [r6, r0] - cmp r0, 0x6 - ble _08069A9C - ldr r2, =gUnknown_08329D2E - b _08069AA6 - .pool -_08069A9C: - adds r5, r7, 0 - b _08069ABE -_08069AA0: - ldr r2, =gUnknown_08329D2E - movs r0, 0x19 - ldrsb r0, [r6, r0] -_08069AA6: - lsls r0, 1 - adds r1, r0, r2 - ldrb r1, [r1] - adds r5, r7, 0 - muls r5, r1 - adds r2, 0x1 - adds r0, r2 - ldrb r1, [r0] - adds r0, r5, 0 - bl __divsi3 - adds r5, r0, 0 -_08069ABE: - ldr r0, =0x020244e0 - ldrh r0, [r0] - muls r5, r0 - adds r0, r6, 0 - adds r0, 0x2A - ldrb r0, [r0] - lsls r0, 1 - movs r1, 0x5 - bl __divsi3 - adds r0, 0x2 - muls r5, r0 - ldrb r0, [r4] - cmp r0, 0x2 - bne _08069AFC - ldr r2, [sp, 0x4] - movs r0, 0x1A - ldrsb r0, [r2, r0] - cmp r0, 0x5 - bgt _08069AF8 - ldr r2, =gUnknown_08329D2E - ldr r3, [sp, 0x4] - movs r0, 0x1A - ldrsb r0, [r3, r0] - b _08069B04 - .pool -_08069AF8: - ldr r3, [sp, 0x18] - b _08069B1E -_08069AFC: - ldr r2, =gUnknown_08329D2E - ldr r1, [sp, 0x4] - movs r0, 0x1A - ldrsb r0, [r1, r0] -_08069B04: - lsls r0, 1 - adds r1, r0, r2 - ldrb r1, [r1] - ldr r7, [sp, 0x18] - adds r3, r7, 0 - muls r3, r1 - adds r2, 0x1 - adds r0, r2 - ldrb r1, [r0] - adds r0, r3, 0 - bl __divsi3 - adds r3, r0, 0 -_08069B1E: - adds r0, r5, 0 - adds r1, r3, 0 - bl __divsi3 - adds r5, r0, 0 - movs r1, 0x32 - bl __divsi3 - adds r5, r0, 0 - ldr r0, [r6, 0x4C] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08069B48 - ldr r1, [sp, 0x28] - ldrb r0, [r1] - cmp r0, 0x3E - beq _08069B48 - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 -_08069B48: - movs r0, 0x1 - ldr r2, [sp, 0xC] - ands r0, r2 - cmp r0, 0 - beq _08069B8A - ldrb r1, [r4] - cmp r1, 0x1 - bne _08069B8A - ldr r0, =0x02022fec - ldr r0, [r0] - ands r0, r1 - cmp r0, 0 - beq _08069B84 - movs r0, 0x2 - bl sub_8069DEC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08069B84 - adds r0, r5, 0 - movs r1, 0x3 - bl __divsi3 - lsls r5, r0, 1 - b _08069B8A - .pool -_08069B84: - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 -_08069B8A: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08069BBC - ldr r0, =gBattleMoves - ldr r3, [sp, 0x8] - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x6] - cmp r0, 0x8 - bne _08069BBC - movs r0, 0x2 - bl sub_8069DEC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08069BBC - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 -_08069BBC: - cmp r5, 0 - bne _08069BC2 - movs r5, 0x1 -_08069BC2: - mov r7, r10 - cmp r7, 0x9 - bne _08069BCA - movs r5, 0 -_08069BCA: - mov r0, r10 - cmp r0, 0x9 - bhi _08069BD2 - b _08069DD4 -_08069BD2: - ldr r0, =0x02024211 - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0x2 - bne _08069BFC - movs r0, 0x1C - ldrsb r0, [r6, r0] - cmp r0, 0x6 - ble _08069BF8 - ldr r2, =gUnknown_08329D2E - b _08069C02 - .pool -_08069BF8: - mov r5, r8 - b _08069C1A -_08069BFC: - ldr r2, =gUnknown_08329D2E - movs r0, 0x1C - ldrsb r0, [r6, r0] -_08069C02: - lsls r0, 1 - adds r1, r0, r2 - ldrb r1, [r1] - mov r5, r8 - muls r5, r1 - adds r2, 0x1 - adds r0, r2 - ldrb r1, [r0] - adds r0, r5, 0 - bl __divsi3 - adds r5, r0, 0 -_08069C1A: - ldr r0, =0x020244e0 - ldrh r0, [r0] - muls r5, r0 - adds r0, r6, 0 - adds r0, 0x2A - ldrb r0, [r0] - lsls r0, 1 - movs r1, 0x5 - bl __divsi3 - adds r0, 0x2 - muls r5, r0 - ldrb r0, [r4] - cmp r0, 0x2 - bne _08069C54 - ldr r1, [sp, 0x4] - movs r0, 0x1D - ldrsb r0, [r1, r0] - cmp r0, 0x5 - bgt _08069C50 - ldr r2, =gUnknown_08329D2E - b _08069C5C - .pool -_08069C50: - ldr r3, [sp, 0x1C] - b _08069C76 -_08069C54: - ldr r2, =gUnknown_08329D2E - ldr r7, [sp, 0x4] - movs r0, 0x1D - ldrsb r0, [r7, r0] -_08069C5C: - lsls r0, 1 - adds r1, r0, r2 - ldrb r1, [r1] - ldr r6, [sp, 0x1C] - adds r3, r6, 0 - muls r3, r1 - adds r2, 0x1 - adds r0, r2 - ldrb r1, [r0] - adds r0, r3, 0 - bl __divsi3 - adds r3, r0, 0 -_08069C76: - adds r0, r5, 0 - adds r1, r3, 0 - bl __divsi3 - adds r5, r0, 0 - movs r1, 0x32 - bl __divsi3 - adds r5, r0, 0 - movs r0, 0x2 - ldr r7, [sp, 0xC] - ands r0, r7 - cmp r0, 0 - beq _08069CCA - ldrb r1, [r4] - cmp r1, 0x1 - bne _08069CCA - ldr r0, =0x02022fec - ldr r0, [r0] - ands r0, r1 - cmp r0, 0 - beq _08069CC4 - movs r0, 0x2 - bl sub_8069DEC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08069CC4 - adds r0, r5, 0 - movs r1, 0x3 - bl __divsi3 - lsls r5, r0, 1 - b _08069CCA - .pool -_08069CC4: - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 -_08069CCA: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08069CFC - ldr r0, =gBattleMoves - ldr r2, [sp, 0x8] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x6] - cmp r0, 0x8 - bne _08069CFC - movs r0, 0x2 - bl sub_8069DEC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08069CFC - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 -_08069CFC: - movs r0, 0 - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl ability_something - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08069DAC - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl ability_something - lsls r0, 24 - cmp r0, 0 - bne _08069DAC - ldr r2, =0x020243cc - ldrh r1, [r2] - movs r0, 0x1 - ands r0, r1 - adds r4, r2, 0 - cmp r0, 0 - beq _08069D64 - mov r3, r10 - cmp r3, 0xA - beq _08069D50 - cmp r3, 0xB - beq _08069D58 - b _08069D64 - .pool -_08069D50: - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 - b _08069D64 -_08069D58: - lsls r0, r5, 4 - subs r0, r5 - movs r1, 0xA - bl __divsi3 - adds r5, r0, 0 -_08069D64: - ldrh r1, [r4] - movs r0, 0x9F - ands r0, r1 - cmp r0, 0 - beq _08069D7C - ldr r0, =0x020241ea - ldrh r0, [r0] - cmp r0, 0x4C - bne _08069D7C - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 -_08069D7C: - ldrh r1, [r4] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _08069DAC - mov r6, r10 - cmp r6, 0xA - beq _08069D98 - cmp r6, 0xB - beq _08069DA6 - b _08069DAC - .pool -_08069D98: - lsls r0, r5, 4 - subs r0, r5 - movs r1, 0xA - bl __divsi3 - adds r5, r0, 0 - b _08069DAC -_08069DA6: - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r5, r0, 1 -_08069DAC: - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x4] - ldr r7, [sp, 0x10] - lsls r1, r7, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08069DD4 - mov r0, r10 - cmp r0, 0xA - bne _08069DD4 - lsls r0, r5, 4 - subs r0, r5 - movs r1, 0xA - bl __divsi3 - adds r5, r0, 0 -_08069DD4: - adds r0, r5, 0x2 - 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 sub_806957C - - thumb_func_start sub_8069DEC -sub_8069DEC: @ 8069DEC - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - movs r6, 0 - cmp r0, 0x1 - beq _08069E40 - cmp r0, 0x1 - bgt _08069E04 - cmp r0, 0 - beq _08069E0A - b _08069EC2 -_08069E04: - cmp r1, 0x2 - beq _08069E88 - b _08069EC2 -_08069E0A: - movs r5, 0 - ldr r0, =0x02024064 - ldrb r3, [r0] - ldr r4, =0x02024210 - ldr r2, =gUnknown_0832A328 -_08069E14: - cmp r5, r3 - beq _08069E28 - ldrb r0, [r4] - ldr r1, [r2] - ands r0, r1 - cmp r0, 0 - bne _08069E28 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_08069E28: - adds r2, 0x4 - adds r5, 0x1 - cmp r5, 0x3 - ble _08069E14 - b _08069EC2 - .pool -_08069E40: - movs r5, 0 -_08069E42: - lsls r0, r5, 24 - lsrs r0, 24 - bl battle_side_get_owner - adds r4, r0, 0 - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _08069E74 - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08069E74 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_08069E74: - adds r5, 0x1 - cmp r5, 0x3 - ble _08069E42 - b _08069EC2 - .pool -_08069E88: - movs r5, 0 -_08069E8A: - lsls r0, r5, 24 - lsrs r0, 24 - bl battle_side_get_owner - adds r4, r0, 0 - ldr r0, =0x0202420c - ldrb r0, [r0] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _08069EBC - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08069EBC - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_08069EBC: - adds r5, 0x1 - cmp r5, 0x3 - ble _08069E8A -_08069EC2: - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8069DEC - - thumb_func_start sub_8069ED8 -sub_8069ED8: @ 8069ED8 - push {r4,r5,lr} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 24 - lsrs r2, r1, 24 - ldr r4, =0x02022fec - ldr r0, [r4] - ldr r1, =0x023f0902 - ands r0, r1 - cmp r0, 0 - bne _08069F1C - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08069F1C - ldr r0, [r4] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - beq _08069F10 - ldr r0, =0x02038bca - ldrh r1, [r0] - movs r0, 0x80 - lsls r0, 3 - cmp r1, r0 - beq _08069F1C -_08069F10: - adds r0, r5, 0 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08069F2C -_08069F1C: - movs r0, 0 - b _08069F2E - .pool -_08069F2C: - movs r0, 0x1 -_08069F2E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8069ED8 - - thumb_func_start sub_8069F34 -sub_8069F34: @ 8069F34 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - bl battle_get_per_side_status - movs r1, 0x1 - movs r6, 0x1 - adds r4, r6, 0 - ands r4, r0 - eors r4, r1 - adds r5, r4, 0 - ldr r0, =0x02022fec - ldr r0, [r0] - ands r0, r6 - cmp r0, 0 - bne _08069F5C - adds r0, r4, 0 - b _08069FA6 - .pool -_08069F5C: - movs r0, 0 - bl sub_8069DEC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _08069F80 - bl GenerateRandomNumber - adds r1, r6, 0 - ands r1, r0 - cmp r1, 0 - bne _08069F7C - movs r0, 0x2 - eors r0, r4 - b _08069FA6 -_08069F7C: - adds r0, r4, 0 - b _08069FA6 -_08069F80: - ldr r0, =0x02024210 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - lsls r0, r4, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08069FA0 - adds r0, r4, 0 - b _08069FA6 - .pool -_08069FA0: - movs r0, 0x2 - eors r5, r0 - adds r0, r5, 0 -_08069FA6: - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8069F34 - - thumb_func_start pokemon_get_gender -pokemon_get_gender: @ 8069FB4 - push {lr} - bl pokemon_roll_gender - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end pokemon_get_gender - - thumb_func_start pokemon_roll_gender -pokemon_roll_gender: @ 8069FC4 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr_encrypted - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr_encrypted - adds r2, r0, 0 - ldr r1, =gBaseStats - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x10] - cmp r0, 0 - beq _0806A01A - cmp r0, 0 - blt _08069FFC - cmp r0, 0xFF - bgt _08069FFC - cmp r0, 0xFE - bge _0806A01A -_08069FFC: - ldr r1, =gBaseStats - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x10] - movs r0, 0xFF - ands r0, r2 - cmp r1, r0 - bhi _0806A018 - movs r0, 0 - b _0806A01A - .pool -_0806A018: - movs r0, 0xFE -_0806A01A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end pokemon_roll_gender - - thumb_func_start pokemon_species_get_gender_info -pokemon_species_get_gender_info: @ 806A020 - push {lr} - adds r3, r1, 0 - lsls r0, 16 - lsrs r2, r0, 16 - ldr r1, =gBaseStats - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x10] - cmp r0, 0 - beq _0806A062 - cmp r0, 0 - blt _0806A044 - cmp r0, 0xFF - bgt _0806A044 - cmp r0, 0xFE - bge _0806A062 -_0806A044: - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x10] - movs r0, 0xFF - ands r0, r3 - cmp r1, r0 - bhi _0806A060 - movs r0, 0 - b _0806A062 - .pool -_0806A060: - movs r0, 0xFE -_0806A062: - pop {r1} - bx r1 - thumb_func_end pokemon_species_get_gender_info - - thumb_func_start sub_806A068 -sub_806A068: @ 806A068 - push {r4-r7,lr} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 24 - lsrs r4, r1, 24 - ldr r0, =0x020244d4 - ldr r2, [r0] - cmp r2, 0 - beq _0806A09C - ldr r0, =0x0202499c - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 3 - adds r1, r2, r1 - adds r2, r0, 0 - adds r1, 0x14 - ldm r1!, {r3,r6,r7} - stm r2!, {r3,r6,r7} - ldm r1!, {r3,r6,r7} - stm r2!, {r3,r6,r7} - adds r3, r0, 0 - b _0806A0DA - .pool -_0806A09C: - ldr r1, =0x020249b4 - ldr r0, [r1] - cmp r0, 0 - beq _0806A0B4 - ldr r3, =0x0202499c - ldr r2, [r0, 0xC] - b _0806A0C8 - .pool -_0806A0B4: - ldr r0, [r1, 0x4] - cmp r0, 0 - beq _0806A0C4 - ldr r3, =0x0202499c - ldr r2, [r0, 0xC] - b _0806A0C8 - .pool -_0806A0C4: - ldr r3, =0x0202499c - ldr r2, =gUnknown_08329D98 -_0806A0C8: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - adds r1, r3, 0 - adds r0, r2 - ldm r0!, {r2,r6,r7} - stm r1!, {r2,r6,r7} - ldm r0!, {r2,r6,r7} - stm r1!, {r2,r6,r7} -_0806A0DA: - adds r2, r3, 0 - strh r5, [r2, 0x2] - cmp r4, 0 - beq _0806A0E6 - cmp r4, 0x2 - bne _0806A0F8 -_0806A0E6: - ldr r0, =gUnknown_082FF70C - str r0, [r2, 0x8] - b _0806A122 - .pool -_0806A0F8: - movs r0, 0xFA - lsls r0, 1 - cmp r5, r0 - bls _0806A118 - ldr r0, =gUnknown_08309AAC - ldr r3, =0xfffffe0c - adds r1, r5, r3 - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - str r0, [r2, 0x8] - b _0806A122 - .pool -_0806A118: - ldr r0, =gUnknown_08309AAC - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - str r0, [r3, 0x8] -_0806A122: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806A068 - - thumb_func_start template_build_for_pokemon_or_trainer -template_build_for_pokemon_or_trainer: @ 806A12C - push {r4-r6,lr} - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 24 - lsrs r3, r1, 24 - ldr r0, =0x0202499c - strh r4, [r0, 0x2] - adds r5, r0, 0 - cmp r3, 0 - beq _0806A144 - cmp r3, 0x2 - bne _0806A170 -_0806A144: - ldr r2, =gUnknown_08329DF8 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - adds r1, r5, 0 - adds r0, r2 - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldr r1, =gUnknown_08305D0C - lsls r0, r4, 2 - adds r0, r1 - ldr r0, [r0] - b _0806A1B0 - .pool -_0806A170: - ldr r0, =0x020244d4 - ldr r1, [r0] - cmp r1, 0 - beq _0806A194 - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 3 - adds r0, r1, r0 - adds r1, r5, 0 - adds r0, 0x14 - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - b _0806A1A8 - .pool -_0806A194: - ldr r0, =gUnknown_08329D98 - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 3 - adds r2, r5, 0 - adds r1, r0 - ldm r1!, {r0,r3,r6} - stm r2!, {r0,r3,r6} - ldm r1!, {r0,r3,r6} - stm r2!, {r0,r3,r6} -_0806A1A8: - ldr r0, =gUnknown_0830536C - lsls r1, r4, 2 - adds r1, r0 - ldr r0, [r1] -_0806A1B0: - str r0, [r5, 0x8] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end template_build_for_pokemon_or_trainer - - thumb_func_start sub_806A1C0 -sub_806A1C0: @ 806A1C0 - push {r4-r6,lr} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 24 - lsrs r4, r1, 24 - ldr r0, =0x020244d4 - ldr r2, [r0] - cmp r2, 0 - beq _0806A1F4 - ldr r0, =0x0202499c - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 3 - adds r1, r2, r1 - adds r2, r0, 0 - adds r1, 0x14 - ldm r1!, {r3,r4,r6} - stm r2!, {r3,r4,r6} - ldm r1!, {r3,r4,r6} - stm r2!, {r3,r4,r6} - adds r3, r0, 0 - b _0806A20A - .pool -_0806A1F4: - ldr r3, =0x0202499c - ldr r2, =gUnknown_08329D98 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - adds r1, r3, 0 - adds r0, r2 - ldm r0!, {r2,r4,r6} - stm r1!, {r2,r4,r6} - ldm r0!, {r2,r4,r6} - stm r1!, {r2,r4,r6} -_0806A20A: - strh r5, [r3, 0x2] - ldr r0, =gUnknown_0830536C - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - str r0, [r3, 0x8] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806A1C0 - - thumb_func_start pokemon_encrypt -@ void pokemon_encrypt(pokemon *mon) -pokemon_encrypt: @ 806A228 - push {r4,lr} - adds r3, r0, 0 - movs r4, 0 - adds r2, r3, 0 - adds r2, 0x20 -_0806A232: - ldr r0, [r2] - ldr r1, [r3] - eors r0, r1 - str r0, [r2] - ldr r1, [r3, 0x4] - eors r0, r1 - stm r2!, {r0} - adds r4, 0x1 - cmp r4, 0xB - bls _0806A232 - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemon_encrypt - - thumb_func_start pokemon_decrypt -@ void pokemon_decrypt(pokemon *mon) -pokemon_decrypt: @ 806A24C - push {r4,lr} - adds r3, r0, 0 - movs r4, 0 - adds r2, r3, 0 - adds r2, 0x20 -_0806A256: - ldr r0, [r2] - ldr r1, [r3, 0x4] - eors r0, r1 - str r0, [r2] - ldr r1, [r3] - eors r0, r1 - stm r2!, {r0} - adds r4, 0x1 - cmp r4, 0xB - bls _0806A256 - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemon_decrypt - - thumb_func_start pokemon_data_permutator -@ int pokemon_data_permutator(pokemon *mon, int a2, u8 a3) -pokemon_data_permutator: @ 806A270 - push {r4-r6,lr} - adds r5, r0, 0 - adds r0, r1, 0 - lsls r2, 24 - lsrs r4, r2, 24 - movs r6, 0 - movs r1, 0x18 - bl __umodsi3 - cmp r0, 0x17 - bls _0806A288 - b _0806A510 -_0806A288: - lsls r0, 2 - ldr r1, =_0806A298 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806A298: - .4byte _0806A2F8 - .4byte _0806A31C - .4byte _0806A338 - .4byte _0806A34E - .4byte _0806A364 - .4byte _0806A380 - .4byte _0806A396 - .4byte _0806A3AC - .4byte _0806A3BC - .4byte _0806A3DA - .4byte _0806A3F2 - .4byte _0806A402 - .4byte _0806A416 - .4byte _0806A428 - .4byte _0806A43A - .4byte _0806A44C - .4byte _0806A45E - .4byte _0806A470 - .4byte _0806A482 - .4byte _0806A498 - .4byte _0806A4AC - .4byte _0806A4BA - .4byte _0806A4CC - .4byte _0806A4E0 -_0806A2F8: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A302 - b _0806A508 -_0806A302: - cmp r4, 0x1 - bgt _0806A30E -_0806A306: - cmp r4, 0 - bne _0806A30C - b _0806A50E -_0806A30C: - b _0806A510 -_0806A30E: - cmp r4, 0x2 - bne _0806A314 - b _0806A502 -_0806A314: - cmp r4, 0x3 - beq _0806A31A - b _0806A510 -_0806A31A: - b _0806A4FC -_0806A31C: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A326 - b _0806A508 -_0806A326: - cmp r4, 0x1 - ble _0806A306 -_0806A32A: - cmp r4, 0x2 - bne _0806A330 - b _0806A4FC -_0806A330: - cmp r4, 0x3 - beq _0806A336 - b _0806A510 -_0806A336: - b _0806A502 -_0806A338: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A342 - b _0806A502 -_0806A342: - cmp r4, 0x1 - ble _0806A306 - cmp r4, 0x2 - bne _0806A34C - b _0806A508 -_0806A34C: - b _0806A314 -_0806A34E: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A358 - b _0806A4FC -_0806A358: - cmp r4, 0x1 - ble _0806A306 - cmp r4, 0x2 - bne _0806A362 - b _0806A508 -_0806A362: - b _0806A330 -_0806A364: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A36E - b _0806A502 -_0806A36E: - cmp r4, 0x1 - ble _0806A306 -_0806A372: - cmp r4, 0x2 - bne _0806A378 - b _0806A4FC -_0806A378: - cmp r4, 0x3 - beq _0806A37E - b _0806A510 -_0806A37E: - b _0806A508 -_0806A380: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A38A - b _0806A4FC -_0806A38A: - cmp r4, 0x1 - ble _0806A306 - cmp r4, 0x2 - bne _0806A394 - b _0806A502 -_0806A394: - b _0806A378 -_0806A396: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A3A0 - b _0806A50E -_0806A3A0: - cmp r4, 0x1 - bgt _0806A30E -_0806A3A4: - cmp r4, 0 - bne _0806A3AA - b _0806A508 -_0806A3AA: - b _0806A510 -_0806A3AC: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A3B6 - b _0806A50E -_0806A3B6: - cmp r4, 0x1 - ble _0806A3A4 - b _0806A32A -_0806A3BC: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A3C6 - b _0806A50E -_0806A3C6: - cmp r4, 0x1 - bgt _0806A3D2 -_0806A3CA: - cmp r4, 0 - bne _0806A3D0 - b _0806A502 -_0806A3D0: - b _0806A510 -_0806A3D2: - cmp r4, 0x2 - bne _0806A3D8 - b _0806A508 -_0806A3D8: - b _0806A314 -_0806A3DA: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A3E4 - b _0806A50E -_0806A3E4: - cmp r4, 0x1 - bgt _0806A3EA - b _0806A4EC -_0806A3EA: - cmp r4, 0x2 - bne _0806A3F0 - b _0806A508 -_0806A3F0: - b _0806A330 -_0806A3F2: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A3FC - b _0806A50E -_0806A3FC: - cmp r4, 0x1 - ble _0806A3CA - b _0806A372 -_0806A402: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - bne _0806A40C - b _0806A50E -_0806A40C: - cmp r4, 0x1 - ble _0806A4EC - cmp r4, 0x2 - beq _0806A502 - b _0806A378 -_0806A416: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A502 - cmp r4, 0x1 - ble _0806A3A4 - cmp r4, 0x2 - beq _0806A50E - b _0806A314 -_0806A428: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A4FC - cmp r4, 0x1 - ble _0806A3A4 - cmp r4, 0x2 - beq _0806A50E - b _0806A330 -_0806A43A: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A508 - cmp r4, 0x1 - ble _0806A3CA - cmp r4, 0x2 - beq _0806A50E - b _0806A314 -_0806A44C: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A508 - cmp r4, 0x1 - ble _0806A4EC - cmp r4, 0x2 - beq _0806A50E - b _0806A330 -_0806A45E: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A4FC - cmp r4, 0x1 - ble _0806A3CA - cmp r4, 0x2 - beq _0806A50E - b _0806A378 -_0806A470: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A502 - cmp r4, 0x1 - ble _0806A4EC - cmp r4, 0x2 - beq _0806A50E - b _0806A378 -_0806A482: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A502 - cmp r4, 0x1 - ble _0806A3A4 -_0806A48E: - cmp r4, 0x2 - beq _0806A4FC -_0806A492: - cmp r4, 0x3 - bne _0806A510 - b _0806A50E -_0806A498: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A4FC - cmp r4, 0x1 - bgt _0806A4A6 - b _0806A3A4 -_0806A4A6: - cmp r4, 0x2 - beq _0806A502 - b _0806A492 -_0806A4AC: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A508 - cmp r4, 0x1 - ble _0806A3CA - b _0806A48E -_0806A4BA: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A508 - cmp r4, 0x1 - ble _0806A4EC - cmp r4, 0x2 - beq _0806A502 - b _0806A492 -_0806A4CC: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A4FC - cmp r4, 0x1 - bgt _0806A4DA - b _0806A3CA -_0806A4DA: - cmp r4, 0x2 - beq _0806A508 - b _0806A492 -_0806A4E0: - adds r0, r5, 0 - adds r0, 0x20 - cmp r4, 0x1 - beq _0806A502 - cmp r4, 0x1 - bgt _0806A4F2 -_0806A4EC: - cmp r4, 0 - beq _0806A4FC - b _0806A510 -_0806A4F2: - cmp r4, 0x2 - beq _0806A508 - cmp r4, 0x3 - beq _0806A50E - b _0806A510 -_0806A4FC: - adds r6, r5, 0 - adds r6, 0x44 - b _0806A510 -_0806A502: - adds r6, r5, 0 - adds r6, 0x38 - b _0806A510 -_0806A508: - adds r6, r5, 0 - adds r6, 0x2C - b _0806A510 -_0806A50E: - adds r6, r0, 0 -_0806A510: - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end pokemon_data_permutator - - thumb_func_start pokemon_getattr -@ int pokemon_getattr(pokemon *mon, enum pokemon_data_request req, void *data) -pokemon_getattr: @ 806A518 - push {r4,lr} - adds r4, r0, 0 - adds r3, r1, 0 - adds r0, r3, 0 - subs r0, 0x37 - cmp r0, 0x21 - bls _0806A528 - b _0806A666 -_0806A528: - lsls r0, 2 - ldr r1, =_0806A538 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806A538: - .4byte _0806A5C0 - .4byte _0806A5C4 - .4byte _0806A5CC - .4byte _0806A5D4 - .4byte _0806A5DC - .4byte _0806A5EE - .4byte _0806A600 - .4byte _0806A612 - .4byte _0806A624 - .4byte _0806A65E - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A666 - .4byte _0806A636 - .4byte _0806A63E - .4byte _0806A646 - .4byte _0806A64E - .4byte _0806A656 -_0806A5C0: - ldr r0, [r4, 0x50] - b _0806A66E -_0806A5C4: - adds r0, r4, 0 - adds r0, 0x54 - ldrb r0, [r0] - b _0806A66E -_0806A5CC: - adds r0, r4, 0 - adds r0, 0x56 - ldrh r0, [r0] - b _0806A66E -_0806A5D4: - adds r0, r4, 0 - adds r0, 0x58 - ldrh r0, [r0] - b _0806A66E -_0806A5DC: - adds r0, r4, 0 - movs r1, 0x1 - bl get_pokemon_data_3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _0806A66E - b _0806A636 -_0806A5EE: - adds r0, r4, 0 - movs r1, 0x2 - bl get_pokemon_data_3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _0806A66E - b _0806A63E -_0806A600: - adds r0, r4, 0 - movs r1, 0x3 - bl get_pokemon_data_3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _0806A66E - b _0806A646 -_0806A612: - adds r0, r4, 0 - movs r1, 0x4 - bl get_pokemon_data_3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _0806A66E - b _0806A64E -_0806A624: - adds r0, r4, 0 - movs r1, 0x5 - bl get_pokemon_data_3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _0806A66E - b _0806A656 -_0806A636: - adds r0, r4, 0 - adds r0, 0x5A - ldrh r0, [r0] - b _0806A66E -_0806A63E: - adds r0, r4, 0 - adds r0, 0x5C - ldrh r0, [r0] - b _0806A66E -_0806A646: - adds r0, r4, 0 - adds r0, 0x5E - ldrh r0, [r0] - b _0806A66E -_0806A64E: - adds r0, r4, 0 - adds r0, 0x60 - ldrh r0, [r0] - b _0806A66E -_0806A656: - adds r0, r4, 0 - adds r0, 0x62 - ldrh r0, [r0] - b _0806A66E -_0806A65E: - adds r0, r4, 0 - adds r0, 0x55 - ldrb r0, [r0] - b _0806A66E -_0806A666: - adds r0, r4, 0 - adds r1, r3, 0 - bl pokemon_getattr_encrypted -_0806A66E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end pokemon_getattr - - thumb_func_start pokemon_getattr_encrypted -@ int pokemon_getattr_encrypted(pokemon *mon, enum pokemon_data_request req, void *data) -pokemon_getattr_encrypted: @ 806A674 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r0 - str r1, [sp] - adds r6, r2, 0 - movs r4, 0 - mov r9, r4 - mov r10, r4 - movs r7, 0 - movs r5, 0 - cmp r1, 0xA - ble _0806A6F2 - ldr r1, [r0] - movs r2, 0 - bl pokemon_data_permutator - mov r9, r0 - mov r0, r8 - ldr r1, [r0] - movs r2, 0x1 - bl pokemon_data_permutator - mov r10, r0 - mov r2, r8 - ldr r1, [r2] - mov r0, r8 - movs r2, 0x2 - bl pokemon_data_permutator - adds r7, r0, 0 - mov r0, r8 - ldr r1, [r0] - movs r2, 0x3 - bl pokemon_data_permutator - adds r5, r0, 0 - mov r0, r8 - bl pokemon_decrypt - mov r0, r8 - bl pokemon_calc_checksum - lsls r0, 16 - lsrs r0, 16 - mov r1, r8 - ldrh r1, [r1, 0x1C] - cmp r0, r1 - beq _0806A6F2 - mov r2, r8 - ldrb r0, [r2, 0x13] - movs r1, 0x1 - orrs r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0x13] - ldrb r0, [r5, 0x7] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r5, 0x7] -_0806A6F2: - ldr r0, [sp] - cmp r0, 0x53 - bls _0806A6FA - b _0806AC8C -_0806A6FA: - lsls r0, 2 - ldr r1, =_0806A708 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806A708: - .4byte _0806A858 - .4byte _0806A85E - .4byte _0806A864 - .4byte _0806A918 - .4byte _0806A91E - .4byte _0806A924 - .4byte _0806A92A - .4byte _0806A930 - .4byte _0806A94C - .4byte _0806A952 - .4byte _0806A958 - .4byte _0806A95E - .4byte _0806A976 - .4byte _0806A98E - .4byte _0806A98E - .4byte _0806A98E - .4byte _0806A98E - .4byte _0806A99A - .4byte _0806A99A - .4byte _0806A99A - .4byte _0806A99A - .4byte _0806A982 - .4byte _0806A9BC - .4byte _0806A9C0 - .4byte _0806A9C4 - .4byte _0806A97C - .4byte _0806A9A4 - .4byte _0806A9A8 - .4byte _0806A9AC - .4byte _0806A9B0 - .4byte _0806A9B4 - .4byte _0806A9B8 - .4byte _0806A988 - .4byte _0806A9C8 - .4byte _0806A9D4 - .4byte _0806A9D8 - .4byte _0806A9DC - .4byte _0806A9E4 - .4byte _0806A9EC - .4byte _0806A9F6 - .4byte _0806A9FE - .4byte _0806AA06 - .4byte _0806AA0E - .4byte _0806AA16 - .4byte _0806AA1E - .4byte _0806AA26 - .4byte _0806AA2A - .4byte _0806A9CC - .4byte _0806A9D0 - .4byte _0806A9F0 - .4byte _0806AA30 - .4byte _0806AA38 - .4byte _0806AA40 - .4byte _0806AA48 - .4byte _0806AA50 - .4byte _0806AC8C - .4byte _0806AC8C - .4byte _0806AC8C - .4byte _0806AC8C - .4byte _0806AC8C - .4byte _0806AC8C - .4byte _0806AC8C - .4byte _0806AC8C - .4byte _0806AC8C - .4byte _0806AC8C - .4byte _0806AAB6 - .4byte _0806AADC - .4byte _0806AA58 - .4byte _0806AA5E - .4byte _0806AA62 - .4byte _0806AA66 - .4byte _0806AA6A - .4byte _0806AA72 - .4byte _0806AA7A - .4byte _0806AA82 - .4byte _0806AA8A - .4byte _0806AA90 - .4byte _0806AA98 - .4byte _0806AAA0 - .4byte _0806AAA8 - .4byte _0806AAB0 - .4byte _0806AB16 - .4byte _0806AB70 - .4byte _0806ABF2 -_0806A858: - mov r1, r8 - ldr r4, [r1] - b _0806AC8C -_0806A85E: - mov r2, r8 - ldr r4, [r2, 0x4] - b _0806AC8C -_0806A864: - mov r0, r8 - ldrb r1, [r0, 0x13] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0806A89C - movs r4, 0 - ldr r0, =gUnknown_085CCB90 - ldrb r1, [r0] - adds r2, r0, 0 - cmp r1, 0xFF - beq _0806A944 - adds r3, r2, 0 -_0806A87E: - adds r0, r6, r4 - adds r1, r4, r3 - ldrb r1, [r1] - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x9 - bhi _0806A944 - adds r0, r4, r2 - ldrb r0, [r0] - cmp r0, 0xFF - bne _0806A87E - b _0806A944 - .pool -_0806A89C: - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0806A8BC - ldr r1, =gUnknown_085E8264 - adds r0, r6, 0 - bl CopyString - adds r0, r6, 0 - bl GetStringLength - lsls r0, 16 - lsrs r4, r0, 16 - b _0806AC8C - .pool -_0806A8BC: - mov r1, r8 - ldrb r0, [r1, 0x12] - cmp r0, 0x1 - bne _0806A902 - movs r0, 0xFC - strb r0, [r6] - movs r0, 0x15 - strb r0, [r6, 0x1] - movs r4, 0x2 - movs r3, 0 - ldrb r0, [r1, 0x8] - cmp r0, 0xFF - beq _0806A8F0 - mov r2, r8 - adds r2, 0x8 -_0806A8DA: - adds r1, r6, r4 - ldrb r0, [r2] - strb r0, [r1] - adds r4, 0x1 - adds r2, 0x1 - adds r3, 0x1 - cmp r3, 0x4 - bgt _0806A8F0 - ldrb r0, [r2] - cmp r0, 0xFF - bne _0806A8DA -_0806A8F0: - adds r1, r6, r4 - movs r0, 0xFC - strb r0, [r1] - adds r4, 0x1 - adds r1, r6, r4 - movs r0, 0x16 - strb r0, [r1] - adds r4, 0x1 - b _0806A944 -_0806A902: - movs r4, 0 - mov r2, r8 - adds r2, 0x8 -_0806A908: - adds r0, r6, r4 - adds r1, r2, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x9 - bls _0806A908 - b _0806A944 -_0806A918: - mov r2, r8 - ldrb r4, [r2, 0x12] - b _0806AC8C -_0806A91E: - mov r6, r8 - ldrb r0, [r6, 0x13] - b _0806AA92 -_0806A924: - mov r1, r8 - ldrb r0, [r1, 0x13] - b _0806AA9A -_0806A92A: - mov r2, r8 - ldrb r0, [r2, 0x13] - b _0806AAA2 -_0806A930: - movs r4, 0 - mov r2, r8 - adds r2, 0x14 -_0806A936: - adds r0, r6, r4 - adds r1, r2, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x6 - bls _0806A936 -_0806A944: - adds r1, r6, r4 - movs r0, 0xFF - strb r0, [r1] - b _0806AC8C -_0806A94C: - mov r6, r8 - ldrb r4, [r6, 0x1B] - b _0806AC8C -_0806A952: - mov r0, r8 - ldrh r4, [r0, 0x1C] - b _0806AC8C -_0806A958: - mov r1, r8 - ldrh r4, [r1, 0x1E] - b _0806AC8C -_0806A95E: - mov r2, r8 - ldrb r1, [r2, 0x13] - movs r0, 0x1 - ands r0, r1 - movs r4, 0xCE - lsls r4, 1 - cmp r0, 0 - beq _0806A970 - b _0806AC8C -_0806A970: - mov r6, r9 - ldrh r4, [r6] - b _0806AC8C -_0806A976: - mov r0, r9 - ldrh r4, [r0, 0x2] - b _0806AC8C -_0806A97C: - mov r1, r9 - ldr r4, [r1, 0x4] - b _0806AC8C -_0806A982: - mov r2, r9 - ldrb r4, [r2, 0x8] - b _0806AC8C -_0806A988: - mov r6, r9 - ldrb r4, [r6, 0x9] - b _0806AC8C -_0806A98E: - ldr r0, [sp] - subs r0, 0xD - lsls r0, 1 - add r0, r10 - ldrh r4, [r0] - b _0806AC8C -_0806A99A: - ldr r0, [sp] - add r0, r10 - subs r0, 0x9 - ldrb r4, [r0] - b _0806AC8C -_0806A9A4: - ldrb r4, [r7] - b _0806AC8C -_0806A9A8: - ldrb r4, [r7, 0x1] - b _0806AC8C -_0806A9AC: - ldrb r4, [r7, 0x2] - b _0806AC8C -_0806A9B0: - ldrb r4, [r7, 0x3] - b _0806AC8C -_0806A9B4: - ldrb r4, [r7, 0x4] - b _0806AC8C -_0806A9B8: - ldrb r4, [r7, 0x5] - b _0806AC8C -_0806A9BC: - ldrb r4, [r7, 0x6] - b _0806AC8C -_0806A9C0: - ldrb r4, [r7, 0x7] - b _0806AC8C -_0806A9C4: - ldrb r4, [r7, 0x8] - b _0806AC8C -_0806A9C8: - ldrb r4, [r7, 0x9] - b _0806AC8C -_0806A9CC: - ldrb r4, [r7, 0xA] - b _0806AC8C -_0806A9D0: - ldrb r4, [r7, 0xB] - b _0806AC8C -_0806A9D4: - ldrb r4, [r5] - b _0806AC8C -_0806A9D8: - ldrb r4, [r5, 0x1] - b _0806AC8C -_0806A9DC: - ldrb r0, [r5, 0x2] - lsls r0, 25 - lsrs r4, r0, 25 - b _0806AC8C -_0806A9E4: - ldrh r0, [r5, 0x2] - lsls r0, 21 - lsrs r4, r0, 28 - b _0806AC8C -_0806A9EC: - ldrb r0, [r5, 0x3] - b _0806AAAA -_0806A9F0: - ldrb r0, [r5, 0x3] - lsrs r4, r0, 7 - b _0806AC8C -_0806A9F6: - ldrb r0, [r5, 0x4] - lsls r0, 27 - lsrs r4, r0, 27 - b _0806AC8C -_0806A9FE: - ldrh r0, [r5, 0x4] - lsls r0, 22 - lsrs r4, r0, 27 - b _0806AC8C -_0806AA06: - ldrb r0, [r5, 0x5] - lsls r0, 25 - lsrs r4, r0, 27 - b _0806AC8C -_0806AA0E: - ldr r0, [r5, 0x4] - lsls r0, 12 - lsrs r4, r0, 27 - b _0806AC8C -_0806AA16: - ldrh r0, [r5, 0x6] - lsls r0, 23 - lsrs r4, r0, 27 - b _0806AC8C -_0806AA1E: - ldrb r0, [r5, 0x7] - lsls r0, 26 - lsrs r4, r0, 27 - b _0806AC8C -_0806AA26: - ldrb r0, [r5, 0x7] - b _0806AA84 -_0806AA2A: - ldrb r0, [r5, 0x7] - lsrs r4, r0, 7 - b _0806AC8C -_0806AA30: - ldrb r0, [r5, 0x8] - lsls r0, 29 - lsrs r4, r0, 29 - b _0806AC8C -_0806AA38: - ldrb r0, [r5, 0x8] - lsls r0, 26 - lsrs r4, r0, 29 - b _0806AC8C -_0806AA40: - ldrh r0, [r5, 0x8] - lsls r0, 23 - lsrs r4, r0, 29 - b _0806AC8C -_0806AA48: - ldrb r0, [r5, 0x9] - lsls r0, 28 - lsrs r4, r0, 29 - b _0806AC8C -_0806AA50: - ldrb r0, [r5, 0x9] - lsls r0, 25 - lsrs r4, r0, 29 - b _0806AC8C -_0806AA58: - ldrb r0, [r5, 0x9] - lsrs r4, r0, 7 - b _0806AC8C -_0806AA5E: - ldrb r0, [r5, 0xA] - b _0806AA92 -_0806AA62: - ldrb r0, [r5, 0xA] - b _0806AA9A -_0806AA66: - ldrb r0, [r5, 0xA] - b _0806AAA2 -_0806AA6A: - ldrb r0, [r5, 0xA] - lsls r0, 28 - lsrs r4, r0, 31 - b _0806AC8C -_0806AA72: - ldrb r0, [r5, 0xA] - lsls r0, 27 - lsrs r4, r0, 31 - b _0806AC8C -_0806AA7A: - ldrb r0, [r5, 0xA] - lsls r0, 26 - lsrs r4, r0, 31 - b _0806AC8C -_0806AA82: - ldrb r0, [r5, 0xA] -_0806AA84: - lsls r0, 25 - lsrs r4, r0, 31 - b _0806AC8C -_0806AA8A: - ldrb r0, [r5, 0xA] - lsrs r4, r0, 7 - b _0806AC8C -_0806AA90: - ldrb r0, [r5, 0xB] -_0806AA92: - lsls r0, 31 - lsrs r4, r0, 31 - b _0806AC8C -_0806AA98: - ldrb r0, [r5, 0xB] -_0806AA9A: - lsls r0, 30 - lsrs r4, r0, 31 - b _0806AC8C -_0806AAA0: - ldrb r0, [r5, 0xB] -_0806AAA2: - lsls r0, 29 - lsrs r4, r0, 31 - b _0806AC8C -_0806AAA8: - ldrb r0, [r5, 0xB] -_0806AAAA: - lsls r0, 25 - lsrs r4, r0, 28 - b _0806AC8C -_0806AAB0: - ldrb r0, [r5, 0xB] - lsrs r4, r0, 7 - b _0806AC8C -_0806AAB6: - mov r0, r9 - ldrh r4, [r0] - cmp r4, 0 - bne _0806AAC0 - b _0806AC8C -_0806AAC0: - ldrb r0, [r5, 0x7] - lsls r0, 25 - cmp r0, 0 - blt _0806AAD6 - mov r2, r8 - ldrb r1, [r2, 0x13] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0806AAD6 - b _0806AC8C -_0806AAD6: - movs r4, 0xCE - lsls r4, 1 - b _0806AC8C -_0806AADC: - ldrb r0, [r5, 0x4] - lsls r0, 27 - lsrs r4, r0, 27 - ldrh r1, [r5, 0x4] - movs r0, 0xF8 - lsls r0, 2 - ands r0, r1 - orrs r4, r0 - ldrb r0, [r5, 0x5] - lsls r0, 25 - lsrs r0, 27 - lsls r0, 10 - orrs r4, r0 - ldr r0, [r5, 0x4] - movs r1, 0xF8 - lsls r1, 12 - ands r0, r1 - orrs r4, r0 - ldrh r0, [r5, 0x6] - lsls r0, 23 - lsrs r0, 27 - lsls r0, 20 - orrs r4, r0 - ldrb r0, [r5, 0x7] - lsls r0, 26 - lsrs r0, 27 - lsls r0, 25 - orrs r4, r0 - b _0806AC8C -_0806AB16: - mov r1, r9 - ldrh r0, [r1] - cmp r0, 0 - bne _0806AB20 - b _0806AC8C -_0806AB20: - ldrb r0, [r5, 0x7] - lsls r0, 25 - cmp r0, 0 - bge _0806AB2A - b _0806AC8C -_0806AB2A: - ldrh r0, [r6] - ldr r1, =0x00000163 - cmp r0, r1 - bne _0806AB34 - b _0806AC8C -_0806AB34: - mov r2, r10 - ldrh r5, [r2] - adds r7, r1, 0 - adds r2, r6, 0 - ldr r1, =gUnknown_0832A328 -_0806AB3E: - ldrh r3, [r2] - cmp r5, r3 - beq _0806AB58 - mov r6, r10 - ldrh r0, [r6, 0x2] - cmp r0, r3 - beq _0806AB58 - ldrh r0, [r6, 0x4] - cmp r0, r3 - beq _0806AB58 - ldrh r0, [r6, 0x6] - cmp r0, r3 - bne _0806AB5C -_0806AB58: - ldr r0, [r1] - orrs r4, r0 -_0806AB5C: - adds r2, 0x2 - adds r1, 0x4 - ldrh r0, [r2] - cmp r0, r7 - bne _0806AB3E - b _0806AC8C - .pool -_0806AB70: - movs r4, 0 - mov r1, r9 - ldrh r0, [r1] - cmp r0, 0 - bne _0806AB7C - b _0806AC8C -_0806AB7C: - ldrb r0, [r5, 0x7] - lsls r0, 25 - cmp r0, 0 - bge _0806AB86 - b _0806AC8C -_0806AB86: - ldrb r0, [r5, 0x8] - lsls r1, r0, 29 - lsrs r4, r1, 29 - lsls r0, 26 - lsrs r0, 29 - adds r4, r0 - ldrh r0, [r5, 0x8] - lsls r0, 23 - lsrs r0, 29 - adds r4, r0 - ldrb r1, [r5, 0x9] - lsls r0, r1, 28 - lsrs r0, 29 - adds r4, r0 - lsls r0, r1, 25 - lsrs r0, 29 - adds r4, r0 - lsrs r1, 7 - adds r4, r1 - ldrb r1, [r5, 0xA] - lsls r0, r1, 31 - lsrs r0, 31 - adds r4, r0 - lsls r0, r1, 30 - lsrs r0, 31 - adds r4, r0 - lsls r0, r1, 29 - lsrs r0, 31 - adds r4, r0 - lsls r0, r1, 28 - lsrs r0, 31 - adds r4, r0 - lsls r0, r1, 27 - lsrs r0, 31 - adds r4, r0 - lsls r0, r1, 26 - lsrs r0, 31 - adds r4, r0 - lsls r0, r1, 25 - lsrs r0, 31 - adds r4, r0 - lsrs r1, 7 - adds r4, r1 - ldrb r1, [r5, 0xB] - lsls r0, r1, 31 - lsrs r0, 31 - adds r4, r0 - lsls r0, r1, 30 - lsrs r0, 31 - adds r4, r0 - lsls r1, 29 - lsrs r1, 31 - adds r4, r1 - b _0806AC8C -_0806ABF2: - movs r4, 0 - mov r2, r9 - ldrh r0, [r2] - cmp r0, 0 - beq _0806AC8C - ldrb r0, [r5, 0x7] - lsls r0, 25 - cmp r0, 0 - blt _0806AC8C - ldrb r2, [r5, 0x9] - lsrs r4, r2, 7 - ldrb r1, [r5, 0x8] - lsls r0, r1, 29 - lsrs r0, 28 - orrs r4, r0 - lsls r1, 26 - lsrs r1, 29 - lsls r1, 4 - orrs r4, r1 - ldrh r0, [r5, 0x8] - lsls r0, 23 - lsrs r0, 29 - lsls r0, 7 - orrs r4, r0 - lsls r0, r2, 28 - lsrs r0, 29 - lsls r0, 10 - orrs r4, r0 - lsls r2, 25 - lsrs r2, 29 - lsls r2, 13 - orrs r4, r2 - ldrb r1, [r5, 0xA] - lsls r0, r1, 31 - lsrs r0, 31 - lsls r0, 16 - orrs r4, r0 - lsls r0, r1, 30 - lsrs r0, 31 - lsls r0, 17 - orrs r4, r0 - lsls r0, r1, 29 - lsrs r0, 31 - lsls r0, 18 - orrs r4, r0 - lsls r0, r1, 28 - lsrs r0, 31 - lsls r0, 19 - orrs r4, r0 - lsls r0, r1, 27 - lsrs r0, 31 - lsls r0, 20 - orrs r4, r0 - lsls r0, r1, 26 - lsrs r0, 31 - lsls r0, 21 - orrs r4, r0 - lsls r0, r1, 25 - lsrs r0, 31 - lsls r0, 22 - orrs r4, r0 - lsrs r1, 7 - lsls r1, 23 - orrs r4, r1 - ldrb r1, [r5, 0xB] - lsls r0, r1, 31 - lsrs r0, 31 - lsls r0, 24 - orrs r4, r0 - lsls r0, r1, 30 - lsrs r0, 31 - lsls r0, 25 - orrs r4, r0 - lsls r1, 29 - lsrs r1, 31 - lsls r1, 26 - orrs r4, r1 -_0806AC8C: - ldr r6, [sp] - cmp r6, 0xA - ble _0806AC98 - mov r0, r8 - bl pokemon_encrypt -_0806AC98: - adds r0, r4, 0 - 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 pokemon_getattr_encrypted - - thumb_func_start pokemon_setattr -@ int pokemon_setattr(pokemon *mon, enum pokemon_data_request req, void *data) -pokemon_setattr: @ 806ACAC - push {lr} - adds r3, r0, 0 - adds r0, r1, 0 - subs r0, 0x37 - cmp r0, 0xA - bhi _0806AD90 - lsls r0, 2 - ldr r1, =_0806ACC8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806ACC8: - .4byte _0806ACF4 - .4byte _0806AD0C - .4byte _0806AD16 - .4byte _0806AD26 - .4byte _0806AD36 - .4byte _0806AD46 - .4byte _0806AD56 - .4byte _0806AD66 - .4byte _0806AD76 - .4byte _0806AD86 - .4byte _0806AD96 -_0806ACF4: - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - adds r1, r0 - str r1, [r3, 0x50] - b _0806AD96 -_0806AD0C: - ldrb r1, [r2] - adds r0, r3, 0 - adds r0, 0x54 - strb r1, [r0] - b _0806AD96 -_0806AD16: - ldrb r0, [r2] - ldrb r1, [r2, 0x1] - lsls r1, 8 - adds r0, r1 - adds r1, r3, 0 - adds r1, 0x56 - strh r0, [r1] - b _0806AD96 -_0806AD26: - ldrb r0, [r2] - ldrb r1, [r2, 0x1] - lsls r1, 8 - adds r0, r1 - adds r1, r3, 0 - adds r1, 0x58 - strh r0, [r1] - b _0806AD96 -_0806AD36: - ldrb r0, [r2] - ldrb r1, [r2, 0x1] - lsls r1, 8 - adds r0, r1 - adds r1, r3, 0 - adds r1, 0x5A - strh r0, [r1] - b _0806AD96 -_0806AD46: - ldrb r0, [r2] - ldrb r1, [r2, 0x1] - lsls r1, 8 - adds r0, r1 - adds r1, r3, 0 - adds r1, 0x5C - strh r0, [r1] - b _0806AD96 -_0806AD56: - ldrb r0, [r2] - ldrb r1, [r2, 0x1] - lsls r1, 8 - adds r0, r1 - adds r1, r3, 0 - adds r1, 0x5E - strh r0, [r1] - b _0806AD96 -_0806AD66: - ldrb r0, [r2] - ldrb r1, [r2, 0x1] - lsls r1, 8 - adds r0, r1 - adds r1, r3, 0 - adds r1, 0x60 - strh r0, [r1] - b _0806AD96 -_0806AD76: - ldrb r0, [r2] - ldrb r1, [r2, 0x1] - lsls r1, 8 - adds r0, r1 - adds r1, r3, 0 - adds r1, 0x62 - strh r0, [r1] - b _0806AD96 -_0806AD86: - ldrb r1, [r2] - adds r0, r3, 0 - adds r0, 0x55 - strb r1, [r0] - b _0806AD96 -_0806AD90: - adds r0, r3, 0 - bl pokemon_setattr_encrypted -_0806AD96: - pop {r0} - bx r0 - thumb_func_end pokemon_setattr - - thumb_func_start pokemon_setattr_encrypted -@ int pokemon_setattr_encrypted(pokemon *mon, enum pokemon_data_request req, void *data) -pokemon_setattr_encrypted: @ 806AD9C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r7, r0, 0 - mov r10, r1 - adds r4, r2, 0 - movs r0, 0 - mov r8, r0 - mov r9, r0 - movs r6, 0 - movs r5, 0 - cmp r1, 0xA - ble _0806AE1C - ldr r1, [r7] - adds r0, r7, 0 - movs r2, 0 - bl pokemon_data_permutator - mov r8, r0 - ldr r1, [r7] - adds r0, r7, 0 - movs r2, 0x1 - bl pokemon_data_permutator - mov r9, r0 - ldr r1, [r7] - adds r0, r7, 0 - movs r2, 0x2 - bl pokemon_data_permutator - adds r6, r0, 0 - ldr r1, [r7] - adds r0, r7, 0 - movs r2, 0x3 - bl pokemon_data_permutator - adds r5, r0, 0 - adds r0, r7, 0 - bl pokemon_decrypt - adds r0, r7, 0 - bl pokemon_calc_checksum - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r7, 0x1C] - cmp r0, r1 - beq _0806AE1C - ldrb r0, [r7, 0x13] - movs r1, 0x1 - orrs r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r7, 0x13] - ldrb r0, [r5, 0x7] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r5, 0x7] - adds r0, r7, 0 - bl pokemon_encrypt - b _0806B3EC -_0806AE1C: - mov r0, r10 - cmp r0, 0x50 - bls _0806AE24 - b _0806B3D8 -_0806AE24: - lsls r0, 2 - ldr r1, =_0806AE34 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806AE34: - .4byte _0806AF78 - .4byte _0806AF90 - .4byte _0806AFA8 - .4byte _0806AFBE - .4byte _0806AFC4 - .4byte _0806AFD4 - .4byte _0806AFE6 - .4byte _0806AFF8 - .4byte _0806B00E - .4byte _0806B014 - .4byte _0806B020 - .4byte _0806B02C - .4byte _0806B04C - .4byte _0806B084 - .4byte _0806B084 - .4byte _0806B084 - .4byte _0806B084 - .4byte _0806B098 - .4byte _0806B098 - .4byte _0806B098 - .4byte _0806B098 - .4byte _0806B074 - .4byte _0806B0C8 - .4byte _0806B0CE - .4byte _0806B0D4 - .4byte _0806B05A - .4byte _0806B0A4 - .4byte _0806B0AA - .4byte _0806B0B0 - .4byte _0806B0B6 - .4byte _0806B0BC - .4byte _0806B0C2 - .4byte _0806B07C - .4byte _0806B0DA - .4byte _0806B0EC - .4byte _0806B0F2 - .4byte _0806B0F8 - .4byte _0806B10C - .4byte _0806B124 - .4byte _0806B14A - .4byte _0806B15E - .4byte _0806B178 - .4byte _0806B18E - .4byte _0806B1A8 - .4byte _0806B1C0 - .4byte _0806B1D4 - .4byte _0806B204 - .4byte _0806B0E0 - .4byte _0806B0E6 - .4byte _0806B13A - .4byte _0806B214 - .4byte _0806B222 - .4byte _0806B238 - .4byte _0806B250 - .4byte _0806B260 - .4byte _0806B3D8 - .4byte _0806B3D8 - .4byte _0806B3D8 - .4byte _0806B3D8 - .4byte _0806B3D8 - .4byte _0806B3D8 - .4byte _0806B3D8 - .4byte _0806B3D8 - .4byte _0806B3D8 - .4byte _0806B3D8 - .4byte _0806B3D8 - .4byte _0806B35E - .4byte _0806B276 - .4byte _0806B286 - .4byte _0806B294 - .4byte _0806B2A4 - .4byte _0806B2B4 - .4byte _0806B2C4 - .4byte _0806B2D4 - .4byte _0806B2E4 - .4byte _0806B2FA - .4byte _0806B30A - .4byte _0806B318 - .4byte _0806B328 - .4byte _0806B338 - .4byte _0806B34E -_0806AF78: - ldrb r1, [r4] - ldrb r0, [r4, 0x1] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r4, 0x2] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r4, 0x3] - lsls r0, 24 - adds r1, r0 - str r1, [r7] - b _0806B3D8 -_0806AF90: - ldrb r1, [r4] - ldrb r0, [r4, 0x1] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r4, 0x2] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r4, 0x3] - lsls r0, 24 - adds r1, r0 - str r1, [r7, 0x4] - b _0806B3D8 -_0806AFA8: - movs r2, 0 - adds r3, r7, 0 - adds r3, 0x8 -_0806AFAE: - adds r0, r3, r2 - adds r1, r4, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x9 - ble _0806AFAE - b _0806B3D8 -_0806AFBE: - ldrb r0, [r4] - strb r0, [r7, 0x12] - b _0806B3D8 -_0806AFC4: - ldrb r0, [r4] - movs r1, 0x1 - ands r1, r0 - ldrb r2, [r7, 0x13] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - b _0806B1F2 -_0806AFD4: - ldrb r0, [r4] - movs r1, 0x1 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r7, 0x13] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - b _0806B1F2 -_0806AFE6: - ldrb r0, [r4] - movs r1, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r7, 0x13] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - b _0806B1F2 -_0806AFF8: - movs r2, 0 - adds r3, r7, 0 - adds r3, 0x14 -_0806AFFE: - adds r0, r3, r2 - adds r1, r4, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x6 - ble _0806AFFE - b _0806B3D8 -_0806B00E: - ldrb r0, [r4] - strb r0, [r7, 0x1B] - b _0806B3D8 -_0806B014: - ldrb r1, [r4] - ldrb r0, [r4, 0x1] - lsls r0, 8 - adds r1, r0 - strh r1, [r7, 0x1C] - b _0806B3D8 -_0806B020: - ldrb r1, [r4] - ldrb r0, [r4, 0x1] - lsls r0, 8 - adds r1, r0 - strh r1, [r7, 0x1E] - b _0806B3D8 -_0806B02C: - ldrb r1, [r4] - ldrb r0, [r4, 0x1] - lsls r0, 8 - adds r1, r0 - mov r0, r8 - strh r1, [r0] - lsls r1, 16 - cmp r1, 0 - beq _0806B044 - ldrb r0, [r7, 0x13] - movs r1, 0x2 - b _0806B1F2 -_0806B044: - ldrb r1, [r7, 0x13] - movs r0, 0x3 - negs r0, r0 - b _0806B1FE -_0806B04C: - ldrb r1, [r4] - ldrb r0, [r4, 0x1] - lsls r0, 8 - adds r1, r0 - mov r0, r8 - strh r1, [r0, 0x2] - b _0806B3D8 -_0806B05A: - ldrb r1, [r4] - ldrb r0, [r4, 0x1] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r4, 0x2] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r4, 0x3] - lsls r0, 24 - adds r1, r0 - mov r0, r8 - str r1, [r0, 0x4] - b _0806B3D8 -_0806B074: - ldrb r0, [r4] - mov r1, r8 - strb r0, [r1, 0x8] - b _0806B3D8 -_0806B07C: - ldrb r0, [r4] - mov r1, r8 - strb r0, [r1, 0x9] - b _0806B3D8 -_0806B084: - mov r2, r10 - subs r2, 0xD - lsls r2, 1 - add r2, r9 - ldrb r1, [r4] - ldrb r0, [r4, 0x1] - lsls r0, 8 - adds r1, r0 - strh r1, [r2] - b _0806B3D8 -_0806B098: - mov r0, r9 - add r0, r10 - subs r0, 0x9 - ldrb r1, [r4] - strb r1, [r0] - b _0806B3D8 -_0806B0A4: - ldrb r0, [r4] - strb r0, [r6] - b _0806B3D8 -_0806B0AA: - ldrb r0, [r4] - strb r0, [r6, 0x1] - b _0806B3D8 -_0806B0B0: - ldrb r0, [r4] - strb r0, [r6, 0x2] - b _0806B3D8 -_0806B0B6: - ldrb r0, [r4] - strb r0, [r6, 0x3] - b _0806B3D8 -_0806B0BC: - ldrb r0, [r4] - strb r0, [r6, 0x4] - b _0806B3D8 -_0806B0C2: - ldrb r0, [r4] - strb r0, [r6, 0x5] - b _0806B3D8 -_0806B0C8: - ldrb r0, [r4] - strb r0, [r6, 0x6] - b _0806B3D8 -_0806B0CE: - ldrb r0, [r4] - strb r0, [r6, 0x7] - b _0806B3D8 -_0806B0D4: - ldrb r0, [r4] - strb r0, [r6, 0x8] - b _0806B3D8 -_0806B0DA: - ldrb r0, [r4] - strb r0, [r6, 0x9] - b _0806B3D8 -_0806B0E0: - ldrb r0, [r4] - strb r0, [r6, 0xA] - b _0806B3D8 -_0806B0E6: - ldrb r0, [r4] - strb r0, [r6, 0xB] - b _0806B3D8 -_0806B0EC: - ldrb r0, [r4] - strb r0, [r5] - b _0806B3D8 -_0806B0F2: - ldrb r0, [r4] - strb r0, [r5, 0x1] - b _0806B3D8 -_0806B0F8: - ldrb r1, [r4] - movs r0, 0x7F - ands r1, r0 - ldrb r2, [r5, 0x2] - movs r0, 0x80 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x2] - b _0806B3D8 -_0806B10C: - ldrb r1, [r4] - movs r0, 0xF - ands r1, r0 - lsls r1, 7 - ldrh r2, [r5, 0x2] - ldr r0, =0xfffff87f - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x2] - b _0806B3D8 - .pool -_0806B124: - ldrb r1, [r4] - movs r0, 0xF - ands r1, r0 - lsls r1, 3 - ldrb r2, [r5, 0x3] - movs r0, 0x79 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x3] - b _0806B3D8 -_0806B13A: - ldrb r0, [r4] - lsls r0, 7 - ldrb r2, [r5, 0x3] - movs r1, 0x7F - ands r1, r2 - orrs r1, r0 - strb r1, [r5, 0x3] - b _0806B3D8 -_0806B14A: - ldrb r1, [r4] - movs r0, 0x1F - ands r1, r0 - ldrb r2, [r5, 0x4] - movs r0, 0x20 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x4] - b _0806B3D8 -_0806B15E: - ldrb r1, [r4] - movs r0, 0x1F - ands r1, r0 - lsls r1, 5 - ldrh r2, [r5, 0x4] - ldr r0, =0xfffffc1f - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x4] - b _0806B3D8 - .pool -_0806B178: - ldrb r1, [r4] - movs r0, 0x1F - ands r1, r0 - lsls r1, 2 - ldrb r2, [r5, 0x5] - movs r0, 0x7D - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - b _0806B3D8 -_0806B18E: - ldrb r2, [r4] - movs r0, 0x1F - ands r2, r0 - lsls r2, 15 - ldr r0, [r5, 0x4] - ldr r1, =0xfff07fff - ands r0, r1 - orrs r0, r2 - str r0, [r5, 0x4] - b _0806B3D8 - .pool -_0806B1A8: - ldrb r1, [r4] - movs r0, 0x1F - ands r1, r0 - lsls r1, 4 - ldrh r2, [r5, 0x6] - ldr r0, =0xfffffe0f - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x6] - b _0806B3D8 - .pool -_0806B1C0: - ldrb r1, [r4] - movs r0, 0x1F - ands r1, r0 - lsls r1, 1 - ldrb r2, [r5, 0x7] - movs r0, 0x3F - negs r0, r0 - ands r0, r2 - orrs r0, r1 - b _0806B3D6 -_0806B1D4: - ldrb r1, [r4] - movs r0, 0x1 - ands r1, r0 - lsls r1, 6 - ldrb r2, [r5, 0x7] - movs r0, 0x41 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x7] - lsls r0, 25 - cmp r0, 0 - bge _0806B1F8 - ldrb r0, [r7, 0x13] - movs r1, 0x4 -_0806B1F2: - orrs r0, r1 - strb r0, [r7, 0x13] - b _0806B3D8 -_0806B1F8: - ldrb r1, [r7, 0x13] - movs r0, 0x5 - negs r0, r0 -_0806B1FE: - ands r0, r1 - strb r0, [r7, 0x13] - b _0806B3D8 -_0806B204: - ldrb r0, [r4] - lsls r0, 7 - ldrb r2, [r5, 0x7] - movs r1, 0x7F - ands r1, r2 - orrs r1, r0 - strb r1, [r5, 0x7] - b _0806B3D8 -_0806B214: - ldrb r1, [r4] - movs r0, 0x7 - ands r1, r0 - ldrb r2, [r5, 0x8] - movs r0, 0x8 - negs r0, r0 - b _0806B230 -_0806B222: - ldrb r1, [r4] - movs r0, 0x7 - ands r1, r0 - lsls r1, 3 - ldrb r2, [r5, 0x8] - movs r0, 0x39 - negs r0, r0 -_0806B230: - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x8] - b _0806B3D8 -_0806B238: - ldrb r1, [r4] - movs r0, 0x7 - ands r1, r0 - lsls r1, 6 - ldrh r2, [r5, 0x8] - ldr r0, =0xfffffe3f - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x8] - b _0806B3D8 - .pool -_0806B250: - ldrb r1, [r4] - movs r0, 0x7 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r5, 0x9] - movs r0, 0xF - negs r0, r0 - b _0806B26E -_0806B260: - ldrb r1, [r4] - movs r0, 0x7 - ands r1, r0 - lsls r1, 4 - ldrb r2, [r5, 0x9] - movs r0, 0x71 - negs r0, r0 -_0806B26E: - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x9] - b _0806B3D8 -_0806B276: - ldrb r0, [r4] - lsls r0, 7 - ldrb r2, [r5, 0x9] - movs r1, 0x7F - ands r1, r2 - orrs r1, r0 - strb r1, [r5, 0x9] - b _0806B3D8 -_0806B286: - ldrb r1, [r4] - movs r0, 0x1 - ands r1, r0 - ldrb r2, [r5, 0xA] - movs r0, 0x2 - negs r0, r0 - b _0806B2F2 -_0806B294: - ldrb r1, [r4] - movs r0, 0x1 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r5, 0xA] - movs r0, 0x3 - negs r0, r0 - b _0806B2F2 -_0806B2A4: - ldrb r1, [r4] - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r5, 0xA] - movs r0, 0x5 - negs r0, r0 - b _0806B2F2 -_0806B2B4: - ldrb r1, [r4] - movs r0, 0x1 - ands r1, r0 - lsls r1, 3 - ldrb r2, [r5, 0xA] - movs r0, 0x9 - negs r0, r0 - b _0806B2F2 -_0806B2C4: - ldrb r1, [r4] - movs r0, 0x1 - ands r1, r0 - lsls r1, 4 - ldrb r2, [r5, 0xA] - movs r0, 0x11 - negs r0, r0 - b _0806B2F2 -_0806B2D4: - ldrb r1, [r4] - movs r0, 0x1 - ands r1, r0 - lsls r1, 5 - ldrb r2, [r5, 0xA] - movs r0, 0x21 - negs r0, r0 - b _0806B2F2 -_0806B2E4: - ldrb r1, [r4] - movs r0, 0x1 - ands r1, r0 - lsls r1, 6 - ldrb r2, [r5, 0xA] - movs r0, 0x41 - negs r0, r0 -_0806B2F2: - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0xA] - b _0806B3D8 -_0806B2FA: - ldrb r0, [r4] - lsls r0, 7 - ldrb r2, [r5, 0xA] - movs r1, 0x7F - ands r1, r2 - orrs r1, r0 - strb r1, [r5, 0xA] - b _0806B3D8 -_0806B30A: - ldrb r1, [r4] - movs r0, 0x1 - ands r1, r0 - ldrb r2, [r5, 0xB] - movs r0, 0x2 - negs r0, r0 - b _0806B346 -_0806B318: - ldrb r1, [r4] - movs r0, 0x1 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r5, 0xB] - movs r0, 0x3 - negs r0, r0 - b _0806B346 -_0806B328: - ldrb r1, [r4] - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r5, 0xB] - movs r0, 0x5 - negs r0, r0 - b _0806B346 -_0806B338: - ldrb r1, [r4] - movs r0, 0xF - ands r1, r0 - lsls r1, 3 - ldrb r2, [r5, 0xB] - movs r0, 0x79 - negs r0, r0 -_0806B346: - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0xB] - b _0806B3D8 -_0806B34E: - ldrb r0, [r4] - lsls r0, 7 - ldrb r2, [r5, 0xB] - movs r1, 0x7F - ands r1, r2 - orrs r1, r0 - strb r1, [r5, 0xB] - b _0806B3D8 -_0806B35E: - ldrb r3, [r4] - ldrb r0, [r4, 0x1] - lsls r0, 8 - orrs r3, r0 - ldrb r0, [r4, 0x2] - lsls r0, 16 - orrs r3, r0 - ldrb r0, [r4, 0x3] - lsls r0, 24 - orrs r3, r0 - movs r4, 0x1F - adds r1, r3, 0 - ands r1, r4 - ldrb r2, [r5, 0x4] - movs r0, 0x20 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x4] - lsrs r1, r3, 5 - ands r1, r4 - lsls r1, 5 - ldrh r2, [r5, 0x4] - ldr r0, =0xfffffc1f - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x4] - lsrs r1, r3, 10 - ands r1, r4 - lsls r1, 2 - ldrb r2, [r5, 0x5] - movs r0, 0x7D - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - lsrs r1, r3, 15 - ands r1, r4 - lsls r1, 15 - ldr r0, [r5, 0x4] - ldr r2, =0xfff07fff - ands r0, r2 - orrs r0, r1 - str r0, [r5, 0x4] - lsrs r1, r3, 20 - ands r1, r4 - lsls r1, 4 - ldrh r2, [r5, 0x6] - ldr r0, =0xfffffe0f - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x6] - lsrs r3, 25 - ands r3, r4 - lsls r3, 1 - ldrb r1, [r5, 0x7] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - orrs r0, r3 -_0806B3D6: - strb r0, [r5, 0x7] -_0806B3D8: - mov r0, r10 - cmp r0, 0xA - ble _0806B3EC - adds r0, r7, 0 - bl pokemon_calc_checksum - strh r0, [r7, 0x1C] - adds r0, r7, 0 - bl pokemon_encrypt -_0806B3EC: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end pokemon_setattr_encrypted - - thumb_func_start memcpy_pokemon -@ void *memcpy_pokemon(void *dest, void *src, unsigned int size) -memcpy_pokemon: @ 806B408 - push {lr} - bl memcpy - pop {r0} - bx r0 - thumb_func_end memcpy_pokemon - - thumb_func_start pokemon_catch -@ int pokemon_catch(pokemon *mon) -pokemon_catch: @ 806B414 - push {r4-r6,lr} - adds r6, r0, 0 - ldr r4, =0x03005d90 - ldr r2, [r4] - movs r1, 0x7 - bl pokemon_setattr - ldr r2, [r4] - adds r2, 0x8 - adds r0, r6, 0 - movs r1, 0x31 - bl pokemon_setattr - ldr r2, [r4] - adds r2, 0xA - adds r0, r6, 0 - movs r1, 0x1 - bl pokemon_setattr - movs r5, 0 - b _0806B446 - .pool -_0806B444: - adds r5, 0x1 -_0806B446: - cmp r5, 0x5 - bgt _0806B480 - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - bne _0806B444 - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0x64 - bl memcpy_pokemon - ldr r1, =0x020244e9 - adds r0, r5, 0x1 - strb r0, [r1] - movs r0, 0 - b _0806B48A - .pool -_0806B480: - adds r0, r6, 0 - bl pokemon_add_to_pc - lsls r0, 24 - lsrs r0, 24 -_0806B48A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end pokemon_catch - - thumb_func_start pokemon_add_to_pc -@ int pokemon_add_to_pc(pokemon *mon) -pokemon_add_to_pc: @ 806B490 - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r0 - ldr r0, =0x00004036 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - bl set_unknown_box_id - bl get_preferred_box - lsls r0, 24 - lsrs r5, r0, 24 -_0806B4AE: - movs r6, 0 - lsls r7, r5, 24 -_0806B4B2: - lsls r1, r6, 24 - lsrs r1, 24 - lsrs r0, r7, 24 - bl get_pokemon_by_box_and_pos - adds r4, r0, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr_encrypted - cmp r0, 0 - bne _0806B514 - mov r0, r8 - bl sub_806E924 - adds r0, r4, 0 - mov r1, r8 - movs r2, 0x50 - bl memcpy_pokemon - ldr r0, =0x020375f6 - strh r5, [r0] - ldr r0, =0x020375f8 - strh r6, [r0] - bl get_unknown_box_id - lsls r0, 16 - lsrs r0, 16 - cmp r0, r5 - beq _0806B4F4 - ldr r0, =0x000008d7 - bl FlagReset -_0806B4F4: - lsls r1, r5, 16 - ldr r0, =0x00004036 - lsrs r1, 16 - bl VarSet - movs r0, 0x1 - b _0806B530 - .pool -_0806B514: - adds r6, 0x1 - cmp r6, 0x1D - ble _0806B4B2 - adds r5, 0x1 - cmp r5, 0xE - bne _0806B522 - movs r5, 0 -_0806B522: - bl get_preferred_box - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bne _0806B4AE - movs r0, 0x2 -_0806B530: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end pokemon_add_to_pc - - thumb_func_start calc_player_party_count -@ u8 calc_player_party_count() -calc_player_party_count: @ 806B53C - push {r4,lr} - ldr r0, =0x020244e9 - movs r1, 0 - strb r1, [r0] - b _0806B554 - .pool -_0806B54C: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - adds r0, r4, 0 -_0806B554: - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0x5 - bhi _0806B572 - adds r1, r0, 0 - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - bne _0806B54C -_0806B572: - ldrb r0, [r4] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end calc_player_party_count - - thumb_func_start calc_enemy_party_count -@ u8 calc_enemy_party_count() -calc_enemy_party_count: @ 806B580 - push {r4,lr} - ldr r0, =0x020244ea - movs r1, 0 - strb r1, [r0] - b _0806B598 - .pool -_0806B590: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - adds r0, r4, 0 -_0806B598: - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0x5 - bhi _0806B5B6 - adds r1, r0, 0 - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - bne _0806B590 -_0806B5B6: - ldrb r0, [r4] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end calc_enemy_party_count - - thumb_func_start sub_806B5C4 -sub_806B5C4: @ 806B5C4 - push {r4-r6,lr} - movs r6, 0 - bl calc_player_party_count - ldr r1, =0x020244e9 - ldrb r0, [r1] - cmp r0, 0x1 - beq _0806B628 - movs r5, 0 - ldrb r1, [r1] - cmp r6, r1 - bge _0806B620 -_0806B5DC: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _0806B616 - adds r0, r4, 0 - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - beq _0806B616 - adds r0, r4, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - beq _0806B616 - adds r6, 0x1 -_0806B616: - adds r5, 0x1 - ldr r0, =0x020244e9 - ldrb r0, [r0] - cmp r5, r0 - blt _0806B5DC -_0806B620: - movs r0, 0 - cmp r6, 0x1 - bgt _0806B628 - movs r0, 0x2 -_0806B628: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806B5C4 - - thumb_func_start CheckPlayerPartySize -@ u8 CheckPlayerPartySize() -CheckPlayerPartySize: @ 806B638 - push {r4-r6,lr} - movs r6, 0 - movs r5, 0 -_0806B63E: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - beq _0806B670 - cmp r1, 0 - beq _0806B670 - adds r0, r4, 0 - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - beq _0806B670 - adds r6, 0x1 -_0806B670: - adds r5, 0x1 - cmp r5, 0x5 - ble _0806B63E - cmp r6, 0x1 - bne _0806B684 - movs r0, 0x1 - b _0806B68C - .pool -_0806B684: - movs r0, 0 - cmp r6, 0x1 - bgt _0806B68C - movs r0, 0x2 -_0806B68C: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end CheckPlayerPartySize - - thumb_func_start sub_806B694 -@ int sub_806B694(u16 a1, int a2) -sub_806B694: @ 806B694 - push {lr} - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, 24 - cmp r1, 0 - beq _0806B6B8 - ldr r2, =0x0202420a - ldr r1, =gBaseStats - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x17] - b _0806B6C6 - .pool -_0806B6B8: - ldr r2, =0x0202420a - ldr r1, =gBaseStats - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x16] -_0806B6C6: - strb r0, [r2] - ldrb r0, [r2] - pop {r1} - bx r1 - .pool - thumb_func_end sub_806B694 - - thumb_func_start GetMonAbility -@ u8 GetMonAbility(pokemon *mon) -GetMonAbility: @ 806B6D8 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x2E - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_806B694 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end GetMonAbility - - thumb_func_start create_enemy_party -create_enemy_party: @ 806B70C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - adds r5, r0, 0 - bl zero_enemy_party_data - ldr r4, =0x020244a8 - ldr r0, [r4] - ldr r0, [r0] - adds r1, r5, 0 - movs r2, 0xA0 - bl memcpy - movs r0, 0 - mov r9, r0 -_0806B730: - ldr r1, =0x020244a8 - ldr r3, [r1] - ldr r2, [r3] - mov r4, r9 - lsls r7, r4, 1 - adds r0, r2, 0 - adds r0, 0x7C - adds r1, r0, r7 - ldrh r0, [r1] - adds r4, 0x1 - str r4, [sp, 0x10] - cmp r0, 0 - beq _0806B80A - movs r0, 0x64 - mov r6, r9 - muls r6, r0 - ldr r4, =0x02024744 - mov r8, r4 - adds r5, r6, r4 - ldrh r1, [r1] - adds r0, r2, 0 - adds r0, 0x94 - add r0, r9 - ldrb r2, [r0] - movs r0, 0x1 - str r0, [sp] - ldr r0, [r3] - mov r3, r9 - lsls r4, r3, 2 - adds r0, 0x34 - adds r0, r4 - ldr r0, [r0] - str r0, [sp, 0x4] - movs r0, 0x2 - str r0, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - adds r0, r5, 0 - movs r3, 0xF - bl create_pokemon_set_level - ldr r1, =0x020244a8 - ldr r0, [r1] - adds r1, r7, 0 - adds r1, 0x88 - ldr r2, [r0] - adds r2, r1 - adds r0, r5, 0 - movs r1, 0xC - bl pokemon_setattr - movs r5, 0 - mov r10, r4 - mov r7, r9 - adds r7, 0x9A - mov r4, r8 -_0806B7A0: - adds r1, r5, 0 - adds r1, 0x1A - ldr r2, =0x020244a8 - ldr r0, [r2] - ldr r2, [r0] - adds r2, r7 - adds r0, r6, r4 - bl pokemon_setattr - adds r5, 0x1 - cmp r5, 0x5 - ble _0806B7A0 - movs r5, 0 - movs r3, 0x64 - mov r0, r9 - muls r0, r3 - ldr r1, =0x02024744 - adds r7, r0, r1 - mov r4, r10 - lsls r0, r4, 1 - adds r6, r0, 0 - adds r6, 0x4C - adds r4, r0, 0 -_0806B7CE: - adds r1, r5, 0 - adds r1, 0xD - ldr r2, =0x020244a8 - ldr r0, [r2] - ldr r2, [r0] - adds r2, r6 - adds r0, r7, 0 - bl pokemon_setattr - adds r1, r5, 0 - adds r1, 0x11 - ldr r3, =0x020244a8 - ldr r0, [r3] - ldr r0, [r0] - adds r0, 0x4C - adds r0, r4 - ldrh r0, [r0] - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - ldr r0, =gBattleMoves + 0x4 @ PP offset - adds r2, r0 - adds r0, r7, 0 - bl pokemon_setattr - adds r6, 0x2 - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _0806B7CE -_0806B80A: - ldr r4, [sp, 0x10] - mov r9, r4 - cmp r4, 0x5 - ble _0806B730 - 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 create_enemy_party - - thumb_func_start sub_806B830 -sub_806B830: @ 806B830 - push {r4,r5,lr} - ldr r5, =gUnknown_08329EB8 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r4, [r0] - ldrb r0, [r4, 0x9] - movs r1, 0x5 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - ldrb r2, [r4, 0x1] - lsls r2, 27 - lsrs r2, 31 - lsls r1, r2, 2 - adds r1, r2 - adds r0, r1 - adds r0, r5 - ldrb r0, [r0] - ldr r1, =gTrainerPicIndices - adds r0, r1 - ldrb r0, [r0] - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806B830 - - thumb_func_start sub_806B870 -sub_806B870: @ 806B870 - push {r4,r5,lr} - ldr r5, =gUnknown_08329EB8 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r4, [r0] - ldrb r0, [r4, 0x9] - movs r1, 0x5 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - ldrb r2, [r4, 0x1] - lsls r2, 27 - lsrs r2, 31 - lsls r1, r2, 2 - adds r1, r2 - adds r0, r1 - adds r0, r5 - ldrb r0, [r0] - ldr r1, =gTrainerClassNameIndices - adds r0, r1 - ldrb r0, [r0] - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806B870 - - thumb_func_start sub_806B8B0 -sub_806B8B0: @ 806B8B0 - push {r4,lr} - movs r4, 0 -_0806B8B4: - movs r0, 0x64 - muls r0, r4 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - bne _0806B8D0 - movs r0, 0 - b _0806B8DE - .pool -_0806B8D0: - adds r4, 0x1 - cmp r4, 0x5 - ble _0806B8B4 - bl sub_806B8E4 - lsls r0, 24 - lsrs r0, 24 -_0806B8DE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_806B8B0 - - thumb_func_start sub_806B8E4 -sub_806B8E4: @ 806B8E4 - push {r4-r6,lr} - movs r6, 0 -_0806B8E8: - movs r4, 0 - lsls r5, r6, 24 -_0806B8EC: - lsls r1, r4, 24 - lsrs r1, 24 - lsrs r0, r5, 24 - movs r2, 0xB - bl get_pokemon_data_from_any_box - cmp r0, 0 - bne _0806B900 - movs r0, 0 - b _0806B90E -_0806B900: - adds r4, 0x1 - cmp r4, 0x1D - ble _0806B8EC - adds r6, 0x1 - cmp r6, 0xD - ble _0806B8E8 - movs r0, 0x1 -_0806B90E: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_806B8E4 - - thumb_func_start GetSpeciesName -@ void GetSpeciesName(u8 *dest, u16 speciesId) -GetSpeciesName: @ 806B914 - push {r4-r7,lr} - adds r6, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - movs r1, 0 - movs r0, 0xCE - lsls r0, 1 - mov r12, r0 - ldr r7, =gSpeciesNames - movs r0, 0xB - muls r0, r5 - adds r3, r0, r7 - adds r2, r6, 0 - b _0806B93A - .pool -_0806B934: - adds r3, 0x1 - adds r2, 0x1 - adds r1, 0x1 -_0806B93A: - adds r4, r6, r1 - cmp r1, 0xA - bgt _0806B954 - cmp r5, r12 - bls _0806B94A - adds r0, r1, r7 - ldrb r0, [r0] - b _0806B94C -_0806B94A: - ldrb r0, [r3] -_0806B94C: - strb r0, [r2] - ldrb r0, [r4] - cmp r0, 0xFF - bne _0806B934 -_0806B954: - movs r0, 0xFF - strb r0, [r4] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end GetSpeciesName - - thumb_func_start CalcPPWithPPUps -@ u16 CalcPPWithPPUps(u16 moveId, s32 ppUpCounts, u8 monMoveIndex) -CalcPPWithPPUps: @ 806B960 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - lsls r2, 24 - lsrs r2, 24 - ldr r4, =gBattleMoves - lsls r3, r0, 1 - adds r3, r0 - lsls r3, 2 - adds r3, r4 - ldrb r4, [r3, 0x4] - ldr r0, =gUnknown_08329D22 - adds r0, r2, r0 - ldrb r3, [r0] - ands r3, r1 - lsls r2, 1 - asrs r3, r2 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 2 - muls r0, r4 - movs r1, 0x64 - bl __divsi3 - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end CalcPPWithPPUps - - thumb_func_start sub_806B9A8 -sub_806B9A8: @ 806B9A8 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - lsls r4, r1, 24 - lsrs r4, 24 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - strb r0, [r1] - ldr r1, =gUnknown_08329D26 - adds r4, r1 - ldrb r1, [r4] - ands r1, r0 - mov r0, sp - strb r1, [r0] - adds r0, r5, 0 - movs r1, 0x15 - mov r2, sp - bl pokemon_setattr - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806B9A8 - - thumb_func_start sub_806B9E4 -sub_806B9E4: @ 806B9E4 - lsls r1, 24 - lsrs r1, 24 - adds r0, 0x3B - ldr r2, =gUnknown_08329D26 - adds r1, r2 - ldrb r2, [r0] - ldrb r1, [r1] - ands r1, r2 - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_806B9E4 - - thumb_func_start battle_data_fill -battle_data_fill: @ 806B9FC - 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, 0x14] - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - movs r0, 0x64 - mov r5, r9 - muls r5, r0 - ldr r0, =0x020244ec - adds r5, r0 - adds r0, r5, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - ldr r1, =0x02024084 - mov r8, r1 - movs r1, 0x58 - ldr r2, [sp, 0x14] - adds r4, r2, 0 - muls r4, r1 - mov r3, r8 - adds r6, r4, r3 - strh r0, [r6] - adds r0, r5, 0 - movs r1, 0xC - movs r2, 0 - bl pokemon_getattr - strh r0, [r6, 0x2E] - movs r6, 0 - mov r0, r8 - adds r0, 0x24 - adds r7, r4, r0 -_0806BA4E: - adds r1, r6, 0 - adds r1, 0xD - adds r0, r5, 0 - movs r2, 0 - bl pokemon_getattr - movs r1, 0xC - add r1, r8 - mov r10, r1 - adds r1, r4, r1 - strh r0, [r1] - adds r1, r6, 0 - adds r1, 0x11 - adds r0, r5, 0 - movs r2, 0 - bl pokemon_getattr - strb r0, [r7] - adds r7, 0x1 - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _0806BA4E - movs r0, 0x64 - mov r4, r9 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - movs r2, 0xC - negs r2, r2 - add r2, r10 - mov r9, r2 - movs r1, 0x58 - ldr r3, [sp, 0x14] - adds r5, r3, 0 - muls r5, r1 - adds r7, r5, r2 - adds r1, r7, 0 - adds r1, 0x3B - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x20 - movs r2, 0 - bl pokemon_getattr - adds r1, r7, 0 - adds r1, 0x2B - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x19 - movs r2, 0 - bl pokemon_getattr - mov r1, r10 - adds r1, 0x38 - adds r1, r5, r1 - str r0, [r1] - adds r0, r4, 0 - movs r1, 0x27 - movs r2, 0 - bl pokemon_getattr - movs r6, 0x1F - ands r0, r6 - ldrb r2, [r7, 0x14] - movs r1, 0x20 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r7, 0x14] - adds r0, r4, 0 - movs r1, 0x28 - movs r2, 0 - bl pokemon_getattr - movs r1, 0x1F - mov r8, r1 - mov r2, r8 - ands r0, r2 - lsls r0, 5 - ldrh r2, [r7, 0x14] - ldr r1, =0xfffffc1f - ands r1, r2 - orrs r1, r0 - strh r1, [r7, 0x14] - adds r0, r4, 0 - movs r1, 0x29 - movs r2, 0 - bl pokemon_getattr - ands r0, r6 - lsls r0, 2 - ldrb r2, [r7, 0x15] - movs r1, 0x7D - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r7, 0x15] - adds r0, r4, 0 - movs r1, 0x2A - movs r2, 0 - bl pokemon_getattr - movs r1, 0x1F - ands r1, r0 - lsls r1, 15 - ldr r0, [r7, 0x14] - ldr r2, =0xfff07fff - ands r0, r2 - orrs r0, r1 - str r0, [r7, 0x14] - adds r0, r4, 0 - movs r1, 0x2B - movs r2, 0 - bl pokemon_getattr - mov r3, r8 - ands r0, r3 - lsls r0, 4 - ldrh r2, [r7, 0x16] - ldr r1, =0xfffffe0f - ands r1, r2 - orrs r1, r0 - strh r1, [r7, 0x16] - adds r0, r4, 0 - movs r1, 0x2C - movs r2, 0 - bl pokemon_getattr - ands r0, r6 - lsls r0, 1 - ldrb r2, [r7, 0x17] - movs r1, 0x3F - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r7, 0x17] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - mov r1, r10 - adds r1, 0x3C - adds r1, r5, r1 - str r0, [r1] - adds r0, r4, 0 - movs r1, 0x37 - movs r2, 0 - bl pokemon_getattr - mov r1, r10 - adds r1, 0x40 - adds r1, r5, r1 - str r0, [r1] - adds r0, r4, 0 - movs r1, 0x38 - movs r2, 0 - bl pokemon_getattr - adds r1, r7, 0 - adds r1, 0x2A - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0x28] - adds r0, r4, 0 - movs r1, 0x3A - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0x2C] - adds r0, r4, 0 - movs r1, 0x3B - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0x2] - adds r0, r4, 0 - movs r1, 0x3C - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0x4] - adds r0, r4, 0 - movs r1, 0x3D - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0x6] - adds r0, r4, 0 - movs r1, 0x3E - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0x8] - adds r0, r4, 0 - movs r1, 0x3F - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0xA] - adds r0, r4, 0 - movs r1, 0x2D - movs r2, 0 - bl pokemon_getattr - movs r1, 0x1 - ands r0, r1 - lsls r0, 6 - ldrb r2, [r7, 0x17] - movs r1, 0x41 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r7, 0x17] - adds r0, r4, 0 - movs r1, 0x2E - movs r2, 0 - bl pokemon_getattr - lsls r0, 7 - ldrb r2, [r7, 0x17] - movs r1, 0x7F - ands r1, r2 - orrs r1, r0 - strb r1, [r7, 0x17] - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl pokemon_getattr - mov r1, r10 - adds r1, 0x48 - adds r1, r5, r1 - str r0, [r1] - ldr r2, =gBaseStats - ldrh r1, [r7] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x6] - adds r1, r7, 0 - adds r1, 0x21 - strb r0, [r1] - ldrh r1, [r7] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x7] - adds r1, r7, 0 - adds r1, 0x22 - strb r0, [r1] - ldrh r0, [r7] - ldrb r1, [r7, 0x17] - lsrs r1, 7 - bl sub_806B694 - adds r1, r7, 0 - adds r1, 0x20 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - mov r0, r10 - adds r0, 0x24 - adds r0, r5, r0 - mov r1, sp - bl CopyString_Limit10 - mov r2, r10 - adds r2, 0x30 - adds r2, r5, r2 - adds r0, r4, 0 - movs r1, 0x7 - bl pokemon_getattr - ldr r0, [sp, 0x14] - bl battle_side_get_owner - ldr r1, =0x0202449c - lsls r0, 24 - lsrs r0, 23 - adds r0, 0xA8 - ldr r1, [r1] - adds r1, r0 - ldrh r0, [r7, 0x28] - strh r0, [r1] - movs r2, 0x6 - mov r1, r9 - movs r6, 0x7 - add r5, r10 - adds r0, r5, 0 - adds r0, 0x13 -_0806BCB2: - strb r2, [r0] - subs r0, 0x1 - subs r6, 0x1 - cmp r6, 0 - bge _0806BCB2 - movs r2, 0 - movs r0, 0x58 - ldr r3, [sp, 0x14] - muls r0, r3 - adds r1, 0x50 - adds r0, r1 - str r2, [r0] - ldr r0, [sp, 0x14] - bl sub_803FA70 - ldr r0, [sp, 0x14] - movs r1, 0 - bl sub_805EF84 - 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 battle_data_fill - - thumb_func_start ExecuteTableBasedItemEffect_ -@ bool8 ExecuteTableBasedItemEffect_(struct pokemon *mon, u16 itemId, u8 a3, u8 monMoveIndex) -ExecuteTableBasedItemEffect_: @ 806BD04 - push {r4,lr} - sub sp, 0x4 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - movs r4, 0 - str r4, [sp] - bl ExecuteTableBasedItemEffect - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end ExecuteTableBasedItemEffect_ - - thumb_func_start ExecuteTableBasedItemEffect -@ bool8 ExecuteTableBasedItemEffect(struct pokemon *mon, u16 itemId, u8 a3, u8 monMoveIndex, u8 a5) -ExecuteTableBasedItemEffect: @ 806BD28 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x44 - mov r8, r0 - ldr r0, [sp, 0x64] - lsls r1, 16 - lsrs r1, 16 - 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 r0, 24 - lsrs r0, 24 - str r0, [sp, 0x18] - movs r0, 0x1 - str r0, [sp, 0x20] - movs r1, 0x6 - str r1, [sp, 0x28] - movs r2, 0 - str r2, [sp, 0x30] - movs r3, 0x4 - str r3, [sp, 0x38] - movs r5, 0 - str r5, [sp, 0x3C] - mov r0, r8 - movs r1, 0xC - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAF - bne _0806BDBC - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806BDA8 - ldr r2, =0x02024404 - ldr r0, =0x020244b8 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x7] - b _0806BDC4 - .pool -_0806BDA8: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00003226 - adds r0, r2 - ldrb r0, [r0] - b _0806BDC4 - .pool -_0806BDBC: - bl itemid_get_x12 - lsls r0, 24 - lsrs r0, 24 -_0806BDC4: - str r0, [sp, 0x34] - ldr r1, =0x0202420f - ldr r0, =0x020244b8 - ldrb r2, [r0] - strb r2, [r1] - ldr r0, =0x030022c0 - ldr r3, =0x00000439 - adds r0, r3 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _0806BE64 - ldr r0, =0x02024064 - strb r2, [r0] - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - negs r1, r0 - orrs r1, r0 - lsrs r1, 31 - str r1, [sp, 0x1C] - ldr r0, =0x0202406c - ldr r4, [sp, 0xC] - subs r4, 0xD - ldrb r0, [r0] - cmp r1, r0 - bge _0806BE70 - ldr r2, =0x0202406e - lsls r0, r1, 1 - adds r0, r2 - ldrh r3, [r0] - ldr r5, [sp, 0x10] - lsls r0, r5, 16 - lsrs r1, r0, 16 - adds r5, r0, 0 - cmp r3, r1 - bne _0806BE3C - ldr r0, [sp, 0x1C] - str r0, [sp, 0x38] - b _0806BE70 - .pool -_0806BE3C: - ldr r1, [sp, 0x1C] - adds r1, 0x2 - str r1, [sp, 0x1C] - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r1, r0 - bge _0806BE70 - lsls r0, r1, 1 - adds r0, r2 - ldrh r1, [r0] - lsrs r0, r5, 16 - cmp r1, r0 - bne _0806BE3C - ldr r2, [sp, 0x1C] - lsls r0, r2, 24 - lsrs r0, 24 - str r0, [sp, 0x38] - b _0806BE70 - .pool -_0806BE64: - ldr r0, =0x02024064 - strb r1, [r0] - movs r3, 0x4 - str r3, [sp, 0x38] - ldr r4, [sp, 0xC] - subs r4, 0xD -_0806BE70: - lsls r0, r4, 16 - lsrs r0, 16 - cmp r0, 0xA5 - bhi _0806BEF0 - ldr r1, =gItemEffectInfoPointers - lsls r0, r4, 2 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - bne _0806BE94 - ldr r5, [sp, 0xC] - cmp r5, 0xAF - beq _0806BE9A - b _0806BEF0 - .pool -_0806BE94: - ldr r1, [sp, 0xC] - cmp r1, 0xAF - bne _0806BEF6 -_0806BE9A: - ldr r0, =0x030022c0 - ldr r2, =0x00000439 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806BECC - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r1, =0x0202440c - adds r0, r1 - b _0806BEF6 - .pool -_0806BECC: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r3, =0x00003214 - adds r3, r0, r3 - str r3, [sp, 0x24] - b _0806BEF8 - .pool -_0806BEE0: - mov r0, r8 - movs r2, 0 - ldr r3, [sp, 0x10] - bl sub_813DA40 - movs r0, 0 - bl _0806CD5C -_0806BEF0: - movs r0, 0x1 - bl _0806CD5C -_0806BEF6: - str r0, [sp, 0x24] -_0806BEF8: - movs r5, 0 - str r5, [sp, 0x1C] -_0806BEFC: - ldr r0, [sp, 0x1C] - cmp r0, 0x5 - bls _0806BF06 - bl _0806CD4C -_0806BF06: - lsls r0, 2 - ldr r1, =_0806BF14 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806BF14: - .4byte _0806BF2C - .4byte _0806BFFC - .4byte _0806C08C - .4byte _0806C120 - .4byte _0806C300 - .4byte _0806C9BE -_0806BF2C: - ldr r1, [sp, 0x24] - ldr r3, [sp, 0x1C] - adds r2, r1, r3 - ldrb r1, [r2] - movs r0, 0x80 - ands r0, r1 - adds r6, r2, 0 - cmp r0, 0 - beq _0806BF76 - ldr r0, =0x030022c0 - ldr r5, =0x00000439 - adds r0, r5 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806BF76 - ldr r0, [sp, 0x38] - cmp r0, 0x4 - beq _0806BF76 - ldr r1, =0x02024084 - movs r0, 0x58 - ldr r2, [sp, 0x38] - muls r0, r2 - adds r1, 0x50 - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0xF0 - lsls r0, 12 - ands r0, r1 - cmp r0, 0 - beq _0806BF76 - ldr r0, =0xfff0ffff - ands r1, r0 - str r1, [r2] - movs r3, 0 - str r3, [sp, 0x20] -_0806BF76: - ldrb r1, [r6] - movs r0, 0x30 - ands r0, r1 - cmp r0, 0 - beq _0806BFA4 - ldr r1, =0x02024084 - ldr r0, =0x02024064 - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r2, r0, r1 - ldr r1, [r2] - movs r3, 0x80 - lsls r3, 13 - adds r0, r1, 0 - ands r0, r3 - cmp r0, 0 - bne _0806BFA4 - orrs r1, r3 - str r1, [r2] - movs r5, 0 - str r5, [sp, 0x20] -_0806BFA4: - ldrb r0, [r6] - movs r3, 0xF - ands r3, r0 - cmp r3, 0 - bne _0806BFB2 - bl _0806CD4C -_0806BFB2: - ldr r6, =0x02024084 - ldr r5, =0x02024064 - ldrb r0, [r5] - movs r4, 0x58 - muls r0, r4 - adds r1, r0, r6 - ldrb r2, [r1, 0x19] - movs r0, 0x19 - ldrsb r0, [r1, r0] - cmp r0, 0xB - ble _0806BFCC - bl _0806CD4C -_0806BFCC: - adds r0, r2, r3 - strb r0, [r1, 0x19] - ldrb r0, [r5] - muls r0, r4 - adds r1, r0, r6 - movs r0, 0x19 - ldrsb r0, [r1, r0] - cmp r0, 0xC - bgt _0806BFE0 - b _0806C110 -_0806BFE0: - movs r0, 0xC - strb r0, [r1, 0x19] - b _0806C110 - .pool -_0806BFFC: - ldr r1, [sp, 0x24] - ldr r3, [sp, 0x1C] - adds r2, r1, r3 - ldrb r1, [r2] - movs r0, 0xF0 - ands r0, r1 - lsls r3, r0, 24 - adds r6, r2, 0 - cmp r3, 0 - beq _0806C042 - ldr r7, =0x02024084 - ldr r5, =0x02024064 - ldrb r0, [r5] - movs r4, 0x58 - muls r0, r4 - adds r1, r0, r7 - ldrb r2, [r1, 0x1A] - movs r0, 0x1A - ldrsb r0, [r1, r0] - cmp r0, 0xB - bgt _0806C042 - lsrs r0, r3, 28 - adds r0, r2, r0 - strb r0, [r1, 0x1A] - ldrb r0, [r5] - muls r0, r4 - adds r1, r0, r7 - movs r0, 0x1A - ldrsb r0, [r1, r0] - cmp r0, 0xC - ble _0806C03E - movs r0, 0xC - strb r0, [r1, 0x1A] -_0806C03E: - movs r5, 0 - str r5, [sp, 0x20] -_0806C042: - ldrb r0, [r6] - movs r3, 0xF - ands r3, r0 - cmp r3, 0 - bne _0806C050 - bl _0806CD4C -_0806C050: - ldr r6, =0x02024084 - ldr r5, =0x02024064 - ldrb r0, [r5] - movs r4, 0x58 - muls r0, r4 - adds r1, r0, r6 - ldrb r2, [r1, 0x1B] - movs r0, 0x1B - ldrsb r0, [r1, r0] - cmp r0, 0xB - ble _0806C06A - bl _0806CD4C -_0806C06A: - adds r0, r2, r3 - strb r0, [r1, 0x1B] - ldrb r0, [r5] - muls r0, r4 - adds r1, r0, r6 - movs r0, 0x1B - ldrsb r0, [r1, r0] - cmp r0, 0xC - ble _0806C110 - movs r0, 0xC - strb r0, [r1, 0x1B] - b _0806C110 - .pool -_0806C08C: - ldr r1, [sp, 0x24] - ldr r3, [sp, 0x1C] - adds r2, r1, r3 - ldrb r1, [r2] - movs r0, 0xF0 - ands r0, r1 - lsls r3, r0, 24 - adds r6, r2, 0 - cmp r3, 0 - beq _0806C0D2 - ldr r7, =0x02024084 - ldr r5, =0x02024064 - ldrb r0, [r5] - movs r4, 0x58 - muls r0, r4 - adds r1, r0, r7 - ldrb r2, [r1, 0x1E] - movs r0, 0x1E - ldrsb r0, [r1, r0] - cmp r0, 0xB - bgt _0806C0D2 - lsrs r0, r3, 28 - adds r0, r2, r0 - strb r0, [r1, 0x1E] - ldrb r0, [r5] - muls r0, r4 - adds r1, r0, r7 - movs r0, 0x1E - ldrsb r0, [r1, r0] - cmp r0, 0xC - ble _0806C0CE - movs r0, 0xC - strb r0, [r1, 0x1E] -_0806C0CE: - movs r5, 0 - str r5, [sp, 0x20] -_0806C0D2: - ldrb r0, [r6] - movs r3, 0xF - ands r3, r0 - cmp r3, 0 - bne _0806C0E0 - bl _0806CD4C -_0806C0E0: - ldr r6, =0x02024084 - ldr r5, =0x02024064 - ldrb r0, [r5] - movs r4, 0x58 - muls r0, r4 - adds r1, r0, r6 - ldrb r2, [r1, 0x1C] - movs r0, 0x1C - ldrsb r0, [r1, r0] - cmp r0, 0xB - ble _0806C0FA - bl _0806CD4C -_0806C0FA: - adds r0, r2, r3 - strb r0, [r1, 0x1C] - ldrb r0, [r5] - muls r0, r4 - adds r1, r0, r6 - movs r0, 0x1C - ldrsb r0, [r1, r0] - cmp r0, 0xC - ble _0806C110 - movs r0, 0xC - strb r0, [r1, 0x1C] -_0806C110: - movs r0, 0 - str r0, [sp, 0x20] - bl _0806CD4C - .pool -_0806C120: - ldr r1, [sp, 0x24] - ldr r3, [sp, 0x1C] - adds r2, r1, r3 - ldrb r1, [r2] - movs r0, 0x80 - ands r0, r1 - adds r6, r2, 0 - cmp r0, 0 - beq _0806C168 - ldr r5, =0x02024294 - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x4] - cmp r0, 0 - bne _0806C168 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - movs r0, 0x5 - strb r0, [r1, 0x4] - movs r5, 0 - str r5, [sp, 0x20] -_0806C168: - ldrb r1, [r6] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0806C1CA - mov r0, r8 - movs r1, 0x38 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0x64 - beq _0806C1CA - ldr r5, =gExperienceTables - mov r0, r8 - movs r1, 0x38 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - mov r0, r8 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - adds r4, 0x1 - lsls r4, 2 - ldr r2, =gBaseStats - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1, 0x13] - movs r0, 0xCA - lsls r0, 1 - muls r0, r1 - adds r4, r0 - adds r4, r5 - ldr r0, [r4] - str r0, [sp] - mov r0, r8 - movs r1, 0x19 - mov r2, sp - bl pokemon_setattr - mov r0, r8 - bl pokemon_calc_effective_stats - movs r0, 0 - str r0, [sp, 0x20] -_0806C1CA: - ldrb r1, [r6] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0806C206 - mov r0, r8 - ldr r1, [sp, 0x10] - movs r2, 0x7 - ldr r3, [sp, 0x38] - bl HealStatusConditions - lsls r0, 24 - cmp r0, 0 - bne _0806C206 - ldr r1, [sp, 0x38] - cmp r1, 0x4 - beq _0806C202 - ldr r1, =0x02024084 - movs r0, 0x58 - ldr r3, [sp, 0x38] - adds r2, r3, 0 - muls r2, r0 - adds r1, 0x50 - adds r2, r1 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] -_0806C202: - movs r5, 0 - str r5, [sp, 0x20] -_0806C206: - ldrb r1, [r6] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0806C226 - ldr r2, =0x00000f88 - mov r0, r8 - ldr r1, [sp, 0x10] - ldr r3, [sp, 0x38] - bl HealStatusConditions - lsls r0, 24 - cmp r0, 0 - bne _0806C226 - movs r0, 0 - str r0, [sp, 0x20] -_0806C226: - ldrb r1, [r6] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0806C246 - mov r0, r8 - ldr r1, [sp, 0x10] - movs r2, 0x10 - ldr r3, [sp, 0x38] - bl HealStatusConditions - lsls r0, 24 - cmp r0, 0 - bne _0806C246 - movs r1, 0 - str r1, [sp, 0x20] -_0806C246: - ldrb r1, [r6] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0806C266 - mov r0, r8 - ldr r1, [sp, 0x10] - movs r2, 0x20 - ldr r3, [sp, 0x38] - bl HealStatusConditions - lsls r0, 24 - cmp r0, 0 - bne _0806C266 - movs r2, 0 - str r2, [sp, 0x20] -_0806C266: - ldrb r1, [r6] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806C286 - mov r0, r8 - ldr r1, [sp, 0x10] - movs r2, 0x40 - ldr r3, [sp, 0x38] - bl HealStatusConditions - lsls r0, 24 - cmp r0, 0 - bne _0806C286 - movs r3, 0 - str r3, [sp, 0x20] -_0806C286: - ldrb r1, [r6] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0806C294 - bl _0806CD4C -_0806C294: - ldr r0, =0x030022c0 - ldr r5, =0x00000439 - adds r0, r5 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0806C2A8 - bl _0806CD4C -_0806C2A8: - ldr r0, [sp, 0x38] - cmp r0, 0x4 - bne _0806C2B2 - bl _0806CD4C -_0806C2B2: - ldr r1, =0x02024084 - movs r0, 0x58 - ldr r2, [sp, 0x38] - muls r0, r2 - adds r1, 0x50 - adds r2, r0, r1 - ldr r1, [r2] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0806C2CC - bl _0806CD4C -_0806C2CC: - movs r0, 0x8 - negs r0, r0 - ands r1, r0 - str r1, [r2] - movs r3, 0 - str r3, [sp, 0x20] - bl _0806CD4C - .pool -_0806C300: - ldr r5, [sp, 0x24] - ldr r1, [sp, 0x1C] - adds r0, r5, r1 - ldrb r0, [r0] - mov r10, r0 - movs r0, 0x20 - mov r2, r10 - ands r0, r2 - cmp r0, 0 - beq _0806C3D8 - movs r0, 0xDF - ands r2, r0 - mov r10, r2 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - ldr r1, =gUnknown_08329D22 - ldr r3, [sp, 0x14] - adds r1, r3, r1 - ldrb r1, [r1] - ands r0, r1 - lsls r1, r3, 1 - lsrs r0, r1 - str r0, [sp] - adds r5, r3, 0 - adds r5, 0xD - mov r0, r8 - adds r1, r5, 0 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - ldr r2, [sp, 0x14] - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x2C] - ldr r0, [sp] - cmp r0, 0x2 - bhi _0806C3D8 - ldr r0, [sp, 0x2C] - cmp r0, 0x4 - bls _0806C3D8 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - ldr r1, =gUnknown_08329D2A - ldr r2, [sp, 0x14] - adds r1, r2, r1 - ldrb r1, [r1] - adds r0, r1 - str r0, [sp] - mov r0, r8 - movs r1, 0x15 - mov r2, sp - bl pokemon_setattr - mov r0, r8 - adds r1, r5, 0 - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - ldr r1, [sp] - lsls r1, 24 - lsrs r1, 24 - ldr r2, [sp, 0x14] - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - ldr r3, [sp, 0x2C] - subs r0, r3 - str r0, [sp] - ldr r4, [sp, 0x14] - adds r4, 0x11 - mov r0, r8 - adds r1, r4, 0 - movs r2, 0 - bl pokemon_getattr - ldr r1, [sp] - adds r0, r1 - str r0, [sp] - mov r0, r8 - adds r1, r4, 0 - mov r2, sp - bl pokemon_setattr - movs r5, 0 - str r5, [sp, 0x20] -_0806C3D8: - movs r0, 0 - str r0, [sp, 0x2C] - mov r1, r10 - cmp r1, 0 - bne _0806C3E6 - bl _0806CD4C -_0806C3E6: - movs r0, 0x1 - mov r2, r10 - ands r0, r2 - cmp r0, 0 - bne _0806C3F2 - b _0806C9AA -_0806C3F2: - ldr r3, [sp, 0x2C] - cmp r3, 0x7 - bls _0806C3FA - b _0806C9AA -_0806C3FA: - lsls r0, r3, 2 - ldr r1, =_0806C410 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806C410: - .4byte _0806C430 - .4byte _0806C430 - .4byte _0806C4DC - .4byte _0806C700 - .4byte _0806C9AA - .4byte _0806C9AA - .4byte _0806C9AA - .4byte _0806C994 -_0806C430: - mov r0, r8 - bl sub_806DC8C - lsls r0, 16 - lsrs r6, r0, 16 - ldr r5, [sp, 0x24] - ldr r1, [sp, 0x28] - adds r0, r5, r1 - ldrb r5, [r0] - ldr r0, =gUnknown_08329EC2 - ldr r2, [sp, 0x2C] - adds r0, r2, r0 - ldrb r1, [r0] - mov r0, r8 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - str r1, [sp, 0x4] - lsls r0, r5, 24 - asrs r2, r0, 24 - cmp r2, 0 - ble _0806C498 - ldr r0, =0x000001fd - cmp r6, r0 - bls _0806C466 - b _0806BEF0 -_0806C466: - adds r3, r1, 0 - cmp r3, 0x63 - ble _0806C46E - b _0806C9AA -_0806C46E: - adds r1, r3, r2 - cmp r1, 0x64 - ble _0806C484 - adds r0, r2, 0 - adds r0, 0x64 - subs r5, r0, r1 - b _0806C486 - .pool -_0806C484: - adds r5, r2, 0 -_0806C486: - adds r1, r6, r5 - movs r0, 0xFF - lsls r0, 1 - cmp r1, r0 - bls _0806C494 - adds r0, r5, r0 - subs r5, r0, r1 -_0806C494: - adds r0, r3, r5 - b _0806C4B2 -_0806C498: - cmp r1, 0 - bne _0806C4A8 - movs r3, 0x1 - str r3, [sp, 0x3C] - ldr r0, [sp, 0x28] - adds r0, 0x1 - lsls r0, 24 - b _0806C83E -_0806C4A8: - adds r0, r1, r2 - str r0, [sp, 0x4] - cmp r0, 0 - bge _0806C4B4 - movs r0, 0 -_0806C4B2: - str r0, [sp, 0x4] -_0806C4B4: - ldr r0, =gUnknown_08329EC2 - ldr r5, [sp, 0x2C] - adds r0, r5, r0 - ldrb r1, [r0] - add r2, sp, 0x4 - mov r0, r8 - bl pokemon_setattr - mov r0, r8 - bl pokemon_calc_effective_stats - ldr r0, [sp, 0x28] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x28] - b _0806C978 - .pool -_0806C4DC: - movs r0, 0x10 - mov r1, r10 - ands r0, r1 - cmp r0, 0 - beq _0806C59C - mov r0, r8 - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - beq _0806C4FC - ldr r0, [sp, 0x28] - adds r0, 0x1 - lsls r0, 24 - b _0806C83E -_0806C4FC: - ldr r0, =0x030022c0 - ldr r2, =0x00000439 - adds r0, r2 - ldrb r1, [r0] - movs r4, 0x2 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806C5B2 - ldr r3, [sp, 0x38] - cmp r3, 0x4 - beq _0806C55C - ldr r2, =0x02024210 - ldr r1, =gUnknown_0832A328 - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r0] - ldrb r0, [r2] - bics r0, r1 - strb r0, [r2] - ldr r1, =0x0202406e - lsls r0, r3, 1 - adds r0, r1 - ldrb r0, [r0] - bl pokemon_order_func - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, [sp, 0x38] - bl battle_data_fill - ldr r0, =0x02024064 - ldrb r0, [r0] - b _0806C574 - .pool -_0806C55C: - ldr r3, =0x02024210 - ldr r1, =gUnknown_0832A328 - ldr r2, =0x02024064 - ldrb r0, [r2] - eors r0, r4 - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldrb r0, [r3] - bics r0, r1 - strb r0, [r3] - ldrb r0, [r2] -_0806C574: - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0806C5B2 - ldr r1, =0x03005d10 - ldrb r0, [r1, 0x4] - cmp r0, 0xFE - bhi _0806C5B2 - adds r0, 0x1 - strb r0, [r1, 0x4] - b _0806C5B2 - .pool -_0806C59C: - mov r0, r8 - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - bne _0806C5B2 - ldr r0, [sp, 0x28] - adds r0, 0x1 - lsls r0, 24 - b _0806C83E -_0806C5B2: - ldr r1, [sp, 0x28] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x28] - ldr r5, [sp, 0x24] - adds r1, r5, r1 - ldrb r1, [r1] - str r1, [sp] - adds r0, r1, 0 - cmp r0, 0xFE - beq _0806C5F4 - cmp r0, 0xFE - bhi _0806C5D4 - cmp r0, 0xFD - beq _0806C60A - b _0806C612 -_0806C5D4: - cmp r1, 0xFF - bne _0806C612 - mov r0, r8 - movs r1, 0x3A - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - mov r0, r8 - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - subs r4, r0 - str r4, [sp] - b _0806C612 -_0806C5F4: - mov r0, r8 - movs r1, 0x3A - movs r2, 0 - bl pokemon_getattr - lsrs r0, 1 - str r0, [sp] - cmp r0, 0 - bne _0806C612 - movs r0, 0x1 - b _0806C610 -_0806C60A: - ldr r0, =0x02024474 - adds r0, 0x23 - ldrb r0, [r0] -_0806C610: - str r0, [sp] -_0806C612: - mov r0, r8 - movs r1, 0x3A - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - mov r0, r8 - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - cmp r4, r0 - beq _0806C6F0 - ldr r0, [sp, 0x18] - cmp r0, 0 - bne _0806C6E4 - mov r0, r8 - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - ldr r1, [sp] - adds r0, r1 - str r0, [sp] - mov r0, r8 - movs r1, 0x3A - movs r2, 0 - bl pokemon_getattr - ldr r1, [sp] - cmp r1, r0 - bls _0806C65E - mov r0, r8 - movs r1, 0x3A - movs r2, 0 - bl pokemon_getattr - str r0, [sp] -_0806C65E: - mov r0, r8 - movs r1, 0x39 - mov r2, sp - bl pokemon_setattr - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806C6EC - ldr r2, [sp, 0x38] - cmp r2, 0x4 - beq _0806C6EC - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldr r1, [sp] - strh r1, [r0, 0x28] - movs r0, 0x10 - mov r3, r10 - ands r0, r3 - cmp r0, 0 - bne _0806C6EC - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0806C6EC - ldr r1, =0x03005d10 - ldrb r0, [r1, 0x3] - cmp r0, 0xFE - bhi _0806C6AE - adds r0, 0x1 - strb r0, [r1, 0x3] -_0806C6AE: - ldrb r5, [r4] - add r0, sp, 0x38 - ldrb r0, [r0] - strb r0, [r4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl dp01_build_cmdbuf_x00_a_b_0 - ldrb r0, [r4] - bl dp01_battle_side_mark_buffer_for_execution - strb r5, [r4] - b _0806C6EC - .pool -_0806C6E4: - ldr r1, =0x020241f0 - ldr r0, [sp] - negs r0, r0 - str r0, [r1] -_0806C6EC: - movs r1, 0 - str r1, [sp, 0x20] -_0806C6F0: - movs r0, 0xEF - mov r2, r10 - ands r2, r0 - mov r10, r2 - b _0806C9AA - .pool -_0806C700: - movs r7, 0x2 - mov r0, r10 - ands r0, r7 - cmp r0, 0 - beq _0806C70C - b _0806C858 -_0806C70C: - movs r5, 0 - ldr r3, [sp, 0x28] - adds r3, 0x1 - str r3, [sp, 0x40] -_0806C714: - movs r0, 0x11 - adds r0, r5 - mov r9, r0 - mov r0, r8 - mov r1, r9 - movs r2, 0 - bl pokemon_getattr - str r0, [sp] - adds r7, r5, 0 - adds r7, 0xD - mov r0, r8 - adds r1, r7, 0 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r5, 24 - lsrs r6, r0, 24 - adds r0, r4, 0 - adds r2, r6, 0 - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - ldr r1, [sp] - cmp r1, r0 - beq _0806C832 - ldr r2, [sp, 0x24] - ldr r3, [sp, 0x28] - adds r0, r2, r3 - ldrb r0, [r0] - adds r0, r1, r0 - str r0, [sp] - mov r0, r8 - adds r1, r7, 0 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - adds r2, r6, 0 - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - ldr r1, [sp] - cmp r1, r0 - bls _0806C7CC - mov r0, r8 - adds r1, r7, 0 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - adds r2, r6, 0 - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] -_0806C7CC: - mov r0, r8 - mov r1, r9 - mov r2, sp - bl pokemon_setattr - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806C82E - ldr r2, [sp, 0x38] - cmp r2, 0x4 - beq _0806C82E - ldr r4, =0x02024084 - movs r0, 0x58 - adds r3, r2, 0 - muls r3, r0 - adds r0, r4, 0 - adds r0, 0x50 - adds r0, r3, r0 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 14 - ands r1, r0 - cmp r1, 0 - bne _0806C82E - ldr r1, =0x020242bc - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gUnknown_0832A328 - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0806C82E - adds r0, r5, r3 - adds r1, r4, 0 - adds r1, 0x24 - adds r0, r1 - ldr r1, [sp] - strb r1, [r0] -_0806C82E: - movs r3, 0 - str r3, [sp, 0x20] -_0806C832: - adds r5, 0x1 - cmp r5, 0x3 - bgt _0806C83A - b _0806C714 -_0806C83A: - ldr r5, [sp, 0x40] - lsls r0, r5, 24 -_0806C83E: - lsrs r0, 24 - str r0, [sp, 0x28] - b _0806C9AA - .pool -_0806C858: - ldr r6, [sp, 0x14] - adds r6, 0x11 - mov r0, r8 - adds r1, r6, 0 - movs r2, 0 - bl pokemon_getattr - str r0, [sp] - ldr r5, [sp, 0x14] - adds r5, 0xD - mov r0, r8 - adds r1, r5, 0 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - ldr r2, [sp, 0x14] - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - ldr r2, [sp] - cmp r2, r0 - bne _0806C8A0 - b _0806C9AA -_0806C8A0: - ldr r1, [sp, 0x28] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x28] - ldr r0, [sp, 0x24] - adds r1, r0, r1 - ldrb r0, [r1] - adds r0, r2, r0 - str r0, [sp] - mov r0, r8 - adds r1, r5, 0 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - ldr r2, [sp, 0x14] - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - ldr r1, [sp] - cmp r1, r0 - bls _0806C914 - mov r0, r8 - adds r1, r5, 0 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - ldr r2, [sp, 0x14] - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] -_0806C914: - mov r0, r8 - adds r1, r6, 0 - mov r2, sp - bl pokemon_setattr - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _0806C978 - ldr r2, [sp, 0x38] - cmp r2, 0x4 - beq _0806C978 - ldr r4, =0x02024084 - movs r0, 0x58 - adds r3, r2, 0 - muls r3, r0 - adds r0, r4, 0 - adds r0, 0x50 - adds r0, r3, r0 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - bne _0806C978 - ldr r1, =0x020242bc - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gUnknown_0832A328 - ldr r5, [sp, 0x14] - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _0806C978 - adds r0, r5, r3 - adds r1, r4, 0 - adds r1, 0x24 - adds r0, r1 - ldr r1, [sp] - strb r1, [r0] -_0806C978: - movs r0, 0 - str r0, [sp, 0x20] - b _0806C9AA - .pool -_0806C994: - mov r0, r8 - movs r1, 0x2 - ldr r2, [sp, 0xC] - bl GetEvolutionTargetSpecies - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _0806C9AA - bl _0806BEE0 -_0806C9AA: - ldr r1, [sp, 0x2C] - adds r1, 0x1 - str r1, [sp, 0x2C] - mov r2, r10 - lsrs r2, 1 - mov r10, r2 - cmp r2, 0 - beq _0806C9BC - b _0806C3E6 -_0806C9BC: - b _0806CD4C -_0806C9BE: - ldr r3, [sp, 0x24] - ldr r5, [sp, 0x1C] - adds r0, r3, r5 - ldrb r0, [r0] - mov r10, r0 - movs r0, 0 - str r0, [sp, 0x2C] - mov r1, r10 - cmp r1, 0 - bne _0806C9D4 - b _0806CD4C -_0806C9D4: - movs r0, 0x1 - mov r2, r10 - ands r0, r2 - cmp r0, 0 - bne _0806C9E0 - b _0806CD3A -_0806C9E0: - ldr r3, [sp, 0x2C] - cmp r3, 0x7 - bls _0806C9E8 - b _0806CD3A -_0806C9E8: - lsls r0, r3, 2 - ldr r1, =_0806C9F8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806C9F8: - .4byte _0806CA18 - .4byte _0806CA18 - .4byte _0806CA18 - .4byte _0806CA18 - .4byte _0806CAB8 - .4byte _0806CB94 - .4byte _0806CC00 - .4byte _0806CC68 -_0806CA18: - mov r0, r8 - bl sub_806DC8C - lsls r0, 16 - lsrs r6, r0, 16 - ldr r5, [sp, 0x24] - ldr r1, [sp, 0x28] - adds r0, r5, r1 - ldrb r5, [r0] - ldr r0, =gUnknown_08329EC2 - ldr r4, [sp, 0x2C] - adds r4, 0x2 - adds r0, r4, r0 - ldrb r1, [r0] - mov r0, r8 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - str r1, [sp, 0x4] - lsls r0, r5, 24 - asrs r2, r0, 24 - cmp r2, 0 - ble _0806CA84 - ldr r0, =0x000001fd - cmp r6, r0 - bls _0806CA52 - bl _0806BEF0 -_0806CA52: - adds r3, r1, 0 - cmp r3, 0x63 - ble _0806CA5A - b _0806CD3A -_0806CA5A: - adds r1, r3, r2 - cmp r1, 0x64 - ble _0806CA70 - adds r0, r2, 0 - adds r0, 0x64 - subs r5, r0, r1 - b _0806CA72 - .pool -_0806CA70: - adds r5, r2, 0 -_0806CA72: - adds r1, r6, r5 - movs r0, 0xFF - lsls r0, 1 - cmp r1, r0 - bls _0806CA80 - adds r0, r5, r0 - subs r5, r0, r1 -_0806CA80: - adds r0, r3, r5 - b _0806CA98 -_0806CA84: - cmp r1, 0 - bne _0806CA8E - movs r2, 0x1 - str r2, [sp, 0x3C] - b _0806CD30 -_0806CA8E: - adds r0, r1, r2 - str r0, [sp, 0x4] - cmp r0, 0 - bge _0806CA9A - movs r0, 0 -_0806CA98: - str r0, [sp, 0x4] -_0806CA9A: - ldr r0, =gUnknown_08329EC2 - adds r0, r4, r0 - ldrb r1, [r0] - add r2, sp, 0x4 - mov r0, r8 - bl pokemon_setattr - mov r0, r8 - bl pokemon_calc_effective_stats - movs r3, 0 - str r3, [sp, 0x20] - b _0806CD30 - .pool -_0806CAB8: - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - ldr r1, =gUnknown_08329D22 - ldr r5, [sp, 0x14] - adds r1, r5, r1 - ldrb r1, [r1] - ands r0, r1 - lsls r1, r5, 1 - lsrs r0, r1 - str r0, [sp] - adds r6, r5, 0 - adds r6, 0xD - mov r0, r8 - adds r1, r6, 0 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - ldr r2, [sp, 0x14] - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [sp] - cmp r0, 0x2 - bls _0806CB0A - b _0806CD3A -_0806CB0A: - cmp r5, 0x4 - bhi _0806CB10 - b _0806CD3A -_0806CB10: - mov r0, r8 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - str r0, [sp] - ldr r1, =gUnknown_08329D26 - ldr r2, [sp, 0x14] - adds r1, r2, r1 - ldrb r2, [r1] - ands r2, r0 - str r2, [sp] - ldr r0, =gUnknown_08329D2A - ldr r3, [sp, 0x14] - adds r0, r3, r0 - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - adds r2, r0 - str r2, [sp] - mov r0, r8 - movs r1, 0x15 - mov r2, sp - bl pokemon_setattr - mov r0, r8 - adds r1, r6, 0 - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - ldr r1, [sp] - lsls r1, 24 - lsrs r1, 24 - ldr r2, [sp, 0x14] - bl CalcPPWithPPUps - lsls r0, 24 - lsrs r0, 24 - subs r0, r5 - str r0, [sp] - ldr r4, [sp, 0x14] - adds r4, 0x11 - mov r0, r8 - adds r1, r4, 0 - movs r2, 0 - bl pokemon_getattr - ldr r1, [sp] - adds r0, r1 - str r0, [sp] - mov r0, r8 - adds r1, r4, 0 - mov r2, sp - bl pokemon_setattr - movs r5, 0 - str r5, [sp, 0x20] - b _0806CD3A - .pool -_0806CB94: - mov r0, r8 - movs r1, 0x20 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0x63 - bls _0806CBA4 - b _0806CD30 -_0806CBA4: - ldr r0, [sp, 0x20] - cmp r0, 0 - beq _0806CBB2 - ldr r1, [sp, 0x3C] - cmp r1, 0 - bne _0806CBB2 - b _0806CD30 -_0806CBB2: - bl sub_806F104 - lsls r0, 24 - cmp r0, 0 - beq _0806CBBE - b _0806CD30 -_0806CBBE: - ldr r2, [sp, 0x30] - cmp r2, 0 - beq _0806CBC6 - b _0806CD30 -_0806CBC6: - ldr r3, [sp, 0x24] - ldr r5, [sp, 0x28] - adds r0, r3, r5 - ldrb r0, [r0] - str r0, [sp, 0x30] - mov r0, r8 - movs r1, 0x20 - movs r2, 0 - bl pokemon_getattr - adds r5, r0, 0 - str r5, [sp, 0x8] - ldr r0, [sp, 0x30] - lsls r4, r0, 24 - asrs r1, r4, 24 - cmp r1, 0 - ble _0806CCCC - ldr r2, [sp, 0x34] - cmp r2, 0x1B - bne _0806CCCC - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - adds r0, r5, r0 - str r0, [sp, 0x8] - adds r2, r4, 0 - b _0806CCD8 -_0806CC00: - mov r0, r8 - movs r1, 0x20 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0x63 - bhi _0806CC10 - b _0806CD30 -_0806CC10: - mov r0, r8 - movs r1, 0x20 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0xC7 - bls _0806CC20 - b _0806CD30 -_0806CC20: - ldr r0, [sp, 0x20] - cmp r0, 0 - beq _0806CC2E - ldr r1, [sp, 0x3C] - cmp r1, 0 - bne _0806CC2E - b _0806CD30 -_0806CC2E: - bl sub_806F104 - lsls r0, 24 - cmp r0, 0 - bne _0806CD30 - ldr r2, [sp, 0x30] - cmp r2, 0 - bne _0806CD30 - ldr r3, [sp, 0x24] - ldr r5, [sp, 0x28] - adds r0, r3, r5 - ldrb r0, [r0] - str r0, [sp, 0x30] - mov r0, r8 - movs r1, 0x20 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - str r4, [sp, 0x8] - ldr r0, [sp, 0x30] - lsls r5, r0, 24 - asrs r1, r5, 24 - cmp r1, 0 - ble _0806CCCC - ldr r2, [sp, 0x34] - cmp r2, 0x1B - beq _0806CCBA - b _0806CCCC -_0806CC68: - mov r0, r8 - movs r1, 0x20 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0xC7 - bls _0806CD30 - ldr r0, [sp, 0x20] - cmp r0, 0 - beq _0806CC82 - ldr r1, [sp, 0x3C] - cmp r1, 0 - beq _0806CD30 -_0806CC82: - bl sub_806F104 - lsls r0, 24 - cmp r0, 0 - bne _0806CD30 - ldr r2, [sp, 0x30] - cmp r2, 0 - bne _0806CD30 - ldr r3, [sp, 0x24] - ldr r5, [sp, 0x28] - adds r0, r3, r5 - ldrb r0, [r0] - str r0, [sp, 0x30] - mov r0, r8 - movs r1, 0x20 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - str r4, [sp, 0x8] - ldr r0, [sp, 0x30] - lsls r5, r0, 24 - asrs r1, r5, 24 - cmp r1, 0 - ble _0806CCCC - ldr r2, [sp, 0x34] - cmp r2, 0x1B - bne _0806CCCC -_0806CCBA: - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - adds r0, r4, r0 - str r0, [sp, 0x8] - adds r2, r5, 0 - b _0806CCD8 -_0806CCCC: - ldr r3, [sp, 0x30] - lsls r2, r3, 24 - asrs r1, r2, 24 - ldr r0, [sp, 0x8] - adds r0, r1 - str r0, [sp, 0x8] -_0806CCD8: - cmp r2, 0 - ble _0806CD0E - mov r0, r8 - movs r1, 0x26 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0xB - bne _0806CCF0 - ldr r0, [sp, 0x8] - adds r0, 0x1 - str r0, [sp, 0x8] -_0806CCF0: - mov r0, r8 - movs r1, 0x23 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - bl sav1_map_get_name - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _0806CD0E - ldr r0, [sp, 0x8] - adds r0, 0x1 - str r0, [sp, 0x8] -_0806CD0E: - ldr r0, [sp, 0x8] - cmp r0, 0 - bge _0806CD18 - movs r0, 0 - str r0, [sp, 0x8] -_0806CD18: - ldr r0, [sp, 0x8] - cmp r0, 0xFF - ble _0806CD22 - movs r0, 0xFF - str r0, [sp, 0x8] -_0806CD22: - add r2, sp, 0x8 - mov r0, r8 - movs r1, 0x20 - bl pokemon_setattr - movs r5, 0 - str r5, [sp, 0x20] -_0806CD30: - ldr r0, [sp, 0x28] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x28] -_0806CD3A: - ldr r0, [sp, 0x2C] - adds r0, 0x1 - str r0, [sp, 0x2C] - mov r1, r10 - lsrs r1, 1 - mov r10, r1 - cmp r1, 0 - beq _0806CD4C - b _0806C9D4 -_0806CD4C: - ldr r2, [sp, 0x1C] - adds r2, 0x1 - str r2, [sp, 0x1C] - cmp r2, 0x5 - bgt _0806CD5A - bl _0806BEFC -_0806CD5A: - ldr r0, [sp, 0x20] -_0806CD5C: - add sp, 0x44 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end ExecuteTableBasedItemEffect - - thumb_func_start HealStatusConditions -@ bool8 HealStatusConditions(struct pokemon *a1, int a2, u32 healMask, u8 a4) -HealStatusConditions: @ 806CD6C - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r4, r2, 0 - lsls r3, 24 - lsrs r6, r3, 24 - movs r1, 0x37 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - str r1, [sp] - ands r0, r4 - cmp r0, 0 - beq _0806CDD0 - mvns r4, r4 - ands r1, r4 - str r1, [sp] - adds r0, r5, 0 - movs r1, 0x37 - mov r2, sp - bl pokemon_setattr - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806CDBE - cmp r6, 0x4 - beq _0806CDBE - ldr r0, =0x02024084 - movs r1, 0x58 - muls r1, r6 - adds r0, 0x4C - adds r1, r0 - ldr r0, [r1] - ands r0, r4 - str r0, [r1] -_0806CDBE: - movs r0, 0 - b _0806CDD2 - .pool -_0806CDD0: - movs r0, 0x1 -_0806CDD2: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end HealStatusConditions - - thumb_func_start sub_806CDDC -sub_806CDDC: @ 806CDDC - push {r4-r7,lr} - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, 24 - lsrs r4, r1, 24 - lsls r2, 24 - lsrs r5, r2, 24 - movs r7, 0x6 - ldr r1, =gItemEffectInfoPointers - adds r0, r3, 0 - subs r0, 0xD - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - bne _0806CE08 - cmp r3, 0xAF - beq _0806CE0C -_0806CE00: - movs r0, 0 - b _0806CF1C - .pool -_0806CE08: - cmp r3, 0xAF - bne _0806CE1A -_0806CE0C: - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r1, =0x0202440c - adds r0, r1 -_0806CE1A: - mov r12, r0 - movs r2, 0 -_0806CE1E: - cmp r2, 0x4 - beq _0806CE3E - cmp r2, 0x4 - ble _0806CE34 - cmp r2, 0x5 - beq _0806CEC8 - b _0806CF12 - .pool -_0806CE34: - cmp r2, 0 - blt _0806CF12 - cmp r2, r4 - bne _0806CF12 - b _0806CE00 -_0806CE3E: - mov r0, r12 - ldrb r3, [r0, 0x4] - movs r0, 0x20 - ands r0, r3 - cmp r0, 0 - beq _0806CE4E - movs r0, 0xDF - ands r3, r0 -_0806CE4E: - movs r6, 0 - cmp r3, 0 - beq _0806CF12 -_0806CE54: - movs r0, 0x1 - ands r0, r3 - cmp r0, 0 - beq _0806CEB4 - cmp r6, 0x7 - bhi _0806CEB4 - lsls r0, r6, 2 - ldr r1, =_0806CE70 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806CE70: - .4byte _0806CE9C - .4byte _0806CE9C - .4byte _0806CE90 - .4byte _0806CE9C - .4byte _0806CEB4 - .4byte _0806CEB4 - .4byte _0806CEB4 - .4byte _0806CEB0 -_0806CE90: - movs r0, 0x10 - ands r0, r3 - cmp r0, 0 - beq _0806CE9C - movs r0, 0xEF - ands r3, r0 -_0806CE9C: - cmp r2, r4 - bne _0806CEA8 - adds r0, r3, 0 - ands r0, r5 - cmp r0, 0 - bne _0806CF1A -_0806CEA8: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - b _0806CEB4 -_0806CEB0: - cmp r2, r4 - beq _0806CE00 -_0806CEB4: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - lsrs r3, 1 - cmp r2, r4 - bne _0806CEC2 - lsrs r5, 1 -_0806CEC2: - cmp r3, 0 - bne _0806CE54 - b _0806CF12 -_0806CEC8: - mov r0, r12 - ldrb r3, [r0, 0x5] - movs r6, 0 -_0806CECE: - cmp r3, 0 - beq _0806CF12 - movs r0, 0x1 - ands r0, r3 - cmp r0, 0 - beq _0806CF02 - cmp r6, 0 - blt _0806CF02 - cmp r6, 0x6 - ble _0806CEE8 - cmp r6, 0x7 - beq _0806CEFC - b _0806CF02 -_0806CEE8: - cmp r2, r4 - bne _0806CEF4 - adds r0, r3, 0 - ands r0, r5 - cmp r0, 0 - bne _0806CF1A -_0806CEF4: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - b _0806CF02 -_0806CEFC: - cmp r2, r4 - bne _0806CF02 - b _0806CE00 -_0806CF02: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - lsrs r3, 1 - cmp r2, r4 - bne _0806CECE - lsrs r5, 1 - b _0806CECE -_0806CF12: - adds r2, 0x1 - cmp r2, 0x5 - bgt _0806CF1A - b _0806CE1E -_0806CF1A: - adds r0, r7, 0 -_0806CF1C: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_806CDDC - - thumb_func_start sub_806CF24 -sub_806CF24: @ 806CF24 - push {lr} - ldr r2, =0x0202420c - ldr r1, =0x020244b8 - ldrb r1, [r1] - strb r1, [r2] - ldr r3, =0x02022f58 - ldr r2, =gUnknown_085CBE00 - ldr r1, =gUnknown_08329EC8 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r2 - ldr r1, [r0] - adds r0, r3, 0 - bl CopyString - ldr r0, =0x02022f68 - ldr r1, =gUnknown_085CB38A - bl CopyString - ldr r0, =gUnknown_085CB3AA - bl get_battle_strings_ - pop {r0} - bx r0 - .pool - thumb_func_end sub_806CF24 - - thumb_func_start sub_806CF78 -sub_806CF78: @ 806CF78 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAF - bne _0806CFCC - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806CFB8 - ldr r2, =0x020244b8 - ldrb r1, [r2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r1, =0x0202440c - adds r7, r0, r1 - b _0806CFD8 - .pool -_0806CFB8: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003214 - adds r7, r0, r1 - b _0806CFD6 - .pool -_0806CFCC: - ldr r1, =gItemEffectInfoPointers - subs r0, 0xD - lsls r0, 2 - adds r0, r1 - ldr r7, [r0] -_0806CFD6: - ldr r2, =0x020244b8 -_0806CFD8: - ldr r1, =0x0202420f - ldrb r0, [r2] - strb r0, [r1] - movs r5, 0 - ldr r0, =0x0202420b - mov r8, r0 - movs r6, 0 -_0806CFE6: - adds r4, r7, r5 - ldrb r1, [r4] - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - beq _0806CFF8 - adds r0, r6, 0 - bl sub_806CF24 -_0806CFF8: - ldrb r1, [r4] - movs r0, 0xF0 - ands r0, r1 - cmp r0, 0 - beq _0806D02E - cmp r5, 0 - beq _0806D020 - adds r0, r6, 0x1 - bl sub_806CF24 - b _0806D02E - .pool -_0806D020: - ldr r0, =0x020244b8 - ldrb r0, [r0] - mov r1, r8 - strb r0, [r1] - ldr r0, =gUnknown_085CA459 - bl get_battle_strings_ -_0806D02E: - adds r6, 0x2 - adds r5, 0x1 - cmp r5, 0x2 - ble _0806CFE6 - ldrb r1, [r7, 0x3] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0806D04E - ldr r1, =0x0202420b - ldr r0, =0x020244b8 - ldrb r0, [r0] - strb r0, [r1] - ldr r0, =gUnknown_085CA424 - bl get_battle_strings_ -_0806D04E: - ldr r0, =0x02022e2c - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806CF78 - - thumb_func_start GetNature -@ u8 GetNature(pokemon *mon) -GetNature: @ 806D070 - push {lr} - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - movs r1, 0x19 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end GetNature - - thumb_func_start GetNatureFromPersonality -@ u8 GetNatureFromPersonality(u32 personality) -GetNatureFromPersonality: @ 806D088 - push {lr} - movs r1, 0x19 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end GetNatureFromPersonality - - thumb_func_start GetEvolutionTargetSpecies -GetEvolutionTargetSpecies: @ 806D098 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - mov r8, r0 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 16 - lsrs r2, 16 - mov r9, r2 - movs r0, 0 - mov r10, r0 - mov r0, r8 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r7, r0, 16 - mov r0, r8 - movs r1, 0xC - movs r2, 0 - bl pokemon_getattr - mov r1, sp - strh r0, [r1] - mov r0, r8 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - mov r0, r8 - movs r1, 0x17 - movs r2, 0 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0xC] - lsrs r4, 16 - str r4, [sp, 0x10] - mov r0, sp - ldrh r0, [r0] - cmp r0, 0xAF - bne _0806D10C - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003226 - adds r0, r1 - ldrb r0, [r0] - b _0806D114 - .pool -_0806D10C: - bl itemid_get_x12 - lsls r0, 24 - lsrs r0, 24 -_0806D114: - cmp r0, 0x26 - bne _0806D120 - cmp r5, 0x3 - beq _0806D120 - movs r0, 0 - b _0806D3B0 -_0806D120: - cmp r5, 0x1 - bne _0806D126 - b _0806D340 -_0806D126: - cmp r5, 0x1 - bgt _0806D130 - cmp r5, 0 - beq _0806D144 - b _0806D3AE -_0806D130: - cmp r5, 0x3 - ble _0806D136 - b _0806D3AE -_0806D136: - movs r2, 0 - str r2, [sp, 0x4] - ldr r3, =gEvolutionTable - lsls r6, r7, 2 - b _0806D38E - .pool -_0806D144: - mov r0, r8 - movs r1, 0x38 - movs r2, 0 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - mov r0, r8 - movs r1, 0x20 - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0x4] - lsls r6, r7, 2 -_0806D16A: - ldr r1, =gEvolutionTable - ldr r0, [sp, 0x4] - lsls r2, r0, 3 - adds r0, r6, r7 - lsls r0, 3 - adds r0, r2, r0 - adds r0, r1 - ldrh r0, [r0] - subs r0, 0x1 - adds r3, r1, 0 - adds r4, r2, 0 - cmp r0, 0xE - bls _0806D186 - b _0806D332 -_0806D186: - lsls r0, 2 - ldr r1, =_0806D198 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806D198: - .4byte _0806D1D4 - .4byte _0806D1E6 - .4byte _0806D208 - .4byte _0806D238 - .4byte _0806D332 - .4byte _0806D332 - .4byte _0806D332 - .4byte _0806D248 - .4byte _0806D272 - .4byte _0806D29C - .4byte _0806D2CA - .4byte _0806D2EA - .4byte _0806D30E - .4byte _0806D332 - .4byte _0806D31E -_0806D1D4: - ldr r1, [sp, 0x8] - cmp r1, 0xDB - bhi _0806D1DC - b _0806D332 -_0806D1DC: - adds r0, r6, r7 - lsls r0, 3 - adds r0, r4, r0 - adds r0, r3 - b _0806D228 -_0806D1E6: - bl GameFreakRTC_CalcLocalDateTime - ldr r0, =0x03005cf8 - ldrb r0, [r0, 0x2] - subs r0, 0xC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB - bls _0806D1FA - b _0806D332 -_0806D1FA: - ldr r2, [sp, 0x8] - cmp r2, 0xDB - bhi _0806D202 - b _0806D332 -_0806D202: - b _0806D21E - .pool -_0806D208: - bl GameFreakRTC_CalcLocalDateTime - ldr r0, =0x03005cf8 - ldrb r0, [r0, 0x2] - cmp r0, 0xB - bls _0806D216 - b _0806D332 -_0806D216: - ldr r0, [sp, 0x8] - cmp r0, 0xDB - bhi _0806D21E - b _0806D332 -_0806D21E: - ldr r1, =gEvolutionTable - adds r0, r6, r7 - lsls r0, 3 - adds r0, r4, r0 - adds r0, r1 -_0806D228: - ldrh r0, [r0, 0x4] - mov r10, r0 - b _0806D332 - .pool -_0806D238: - adds r0, r6, r7 - lsls r0, 3 - adds r0, r4, r0 - adds r1, r0, r3 - ldrh r0, [r1, 0x2] - cmp r0, r9 - bhi _0806D332 - b _0806D32E -_0806D248: - adds r0, r6, r7 - lsls r0, 3 - adds r0, r4, r0 - adds r5, r0, r3 - ldrh r0, [r5, 0x2] - cmp r0, r9 - bhi _0806D332 - mov r0, r8 - movs r1, 0x3B - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - mov r0, r8 - movs r1, 0x3C - movs r2, 0 - bl pokemon_getattr - cmp r4, r0 - bls _0806D332 - b _0806D2C4 -_0806D272: - adds r0, r6, r7 - lsls r0, 3 - adds r0, r4, r0 - adds r5, r0, r3 - ldrh r0, [r5, 0x2] - cmp r0, r9 - bhi _0806D332 - mov r0, r8 - movs r1, 0x3B - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - mov r0, r8 - movs r1, 0x3C - movs r2, 0 - bl pokemon_getattr - cmp r4, r0 - bne _0806D332 - b _0806D2C4 -_0806D29C: - adds r0, r6, r7 - lsls r0, 3 - adds r0, r4, r0 - adds r5, r0, r3 - ldrh r0, [r5, 0x2] - cmp r0, r9 - bhi _0806D332 - mov r0, r8 - movs r1, 0x3B - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - mov r0, r8 - movs r1, 0x3C - movs r2, 0 - bl pokemon_getattr - cmp r4, r0 - bcs _0806D332 -_0806D2C4: - ldrh r5, [r5, 0x4] - mov r10, r5 - b _0806D332 -_0806D2CA: - adds r0, r6, r7 - lsls r0, 3 - adds r0, r4, r0 - adds r4, r0, r3 - ldrh r0, [r4, 0x2] - cmp r0, r9 - bhi _0806D332 - ldr r0, [sp, 0x10] - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x4 - bhi _0806D332 - b _0806D308 -_0806D2EA: - adds r0, r6, r7 - lsls r0, 3 - adds r0, r4, r0 - adds r4, r0, r3 - ldrh r0, [r4, 0x2] - cmp r0, r9 - bhi _0806D332 - ldr r0, [sp, 0x10] - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x4 - bls _0806D332 -_0806D308: - ldrh r4, [r4, 0x4] - mov r10, r4 - b _0806D332 -_0806D30E: - adds r0, r6, r7 - lsls r0, 3 - adds r0, r4, r0 - adds r1, r0, r3 - ldrh r0, [r1, 0x2] - cmp r0, r9 - bhi _0806D332 - b _0806D32E -_0806D31E: - adds r0, r6, r7 - lsls r0, 3 - adds r0, r4, r0 - adds r1, r0, r3 - ldrh r0, [r1, 0x2] - ldr r2, [sp, 0xC] - cmp r0, r2 - bhi _0806D332 -_0806D32E: - ldrh r1, [r1, 0x4] - mov r10, r1 -_0806D332: - ldr r0, [sp, 0x4] - adds r0, 0x1 - str r0, [sp, 0x4] - cmp r0, 0x4 - bgt _0806D33E - b _0806D16A -_0806D33E: - b _0806D3AE -_0806D340: - lsls r6, r7, 2 - ldr r1, =gEvolutionTable - adds r0, r6, r7 - lsls r0, 3 - adds r4, r0, r1 - mov r5, sp - movs r1, 0x4 - str r1, [sp, 0x4] -_0806D350: - ldrh r0, [r4] - cmp r0, 0x5 - beq _0806D370 - cmp r0, 0x6 - bne _0806D374 - ldrh r0, [r4, 0x2] - ldrh r1, [r5] - cmp r0, r1 - bne _0806D374 - movs r0, 0 - strh r0, [r5] - mov r0, r8 - movs r1, 0xC - mov r2, sp - bl pokemon_setattr -_0806D370: - ldrh r2, [r4, 0x4] - mov r10, r2 -_0806D374: - adds r4, 0x8 - ldr r0, [sp, 0x4] - subs r0, 0x1 - str r0, [sp, 0x4] - cmp r0, 0 - bge _0806D350 - b _0806D3AE - .pool -_0806D388: - ldrh r1, [r1, 0x4] - mov r10, r1 - b _0806D3AE -_0806D38E: - adds r0, r6, r7 - ldr r1, [sp, 0x4] - adds r0, r1 - lsls r0, 3 - adds r1, r0, r3 - ldrh r0, [r1] - cmp r0, 0x7 - bne _0806D3A4 - ldrh r0, [r1, 0x2] - cmp r0, r9 - beq _0806D388 -_0806D3A4: - ldr r2, [sp, 0x4] - adds r2, 0x1 - str r2, [sp, 0x4] - cmp r2, 0x4 - ble _0806D38E -_0806D3AE: - mov r0, r10 -_0806D3B0: - 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 GetEvolutionTargetSpecies - - thumb_func_start HoennPokedexNumToSpecies -HoennPokedexNumToSpecies: @ 806D3C0 - push {r4,lr} - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0 - beq _0806D404 - movs r1, 0 - ldr r3, =gSpeciesToHoennPokedexNum - ldrh r0, [r3] - cmp r0, r2 - beq _0806D3EC - movs r4, 0xCD - lsls r4, 1 -_0806D3D8: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r4 - bhi _0806D3EC - lsls r0, r1, 1 - adds r0, r3 - ldrh r0, [r0] - cmp r0, r2 - bne _0806D3D8 -_0806D3EC: - ldr r0, =0x0000019b - cmp r1, r0 - beq _0806D404 - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r0, 16 - b _0806D406 - .pool -_0806D404: - movs r0, 0 -_0806D406: - pop {r4} - pop {r1} - bx r1 - thumb_func_end HoennPokedexNumToSpecies - - thumb_func_start NationalPokedexNumToSpecies -NationalPokedexNumToSpecies: @ 806D40C - push {r4,lr} - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0 - beq _0806D450 - movs r1, 0 - ldr r3, =gSpeciesToNationalPokedexNum - ldrh r0, [r3] - cmp r0, r2 - beq _0806D438 - movs r4, 0xCD - lsls r4, 1 -_0806D424: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r4 - bhi _0806D438 - lsls r0, r1, 1 - adds r0, r3 - ldrh r0, [r0] - cmp r0, r2 - bne _0806D424 -_0806D438: - ldr r0, =0x0000019b - cmp r1, r0 - beq _0806D450 - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r0, 16 - b _0806D452 - .pool -_0806D450: - movs r0, 0 -_0806D452: - pop {r4} - pop {r1} - bx r1 - thumb_func_end NationalPokedexNumToSpecies - - thumb_func_start NationalToHoennOrder -NationalToHoennOrder: @ 806D458 - push {r4,lr} - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0 - beq _0806D49C - movs r1, 0 - ldr r3, =gHoennToNationalOrder - ldrh r0, [r3] - cmp r0, r2 - beq _0806D484 - movs r4, 0xCD - lsls r4, 1 -_0806D470: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r4 - bhi _0806D484 - lsls r0, r1, 1 - adds r0, r3 - ldrh r0, [r0] - cmp r0, r2 - bne _0806D470 -_0806D484: - ldr r0, =0x0000019b - cmp r1, r0 - beq _0806D49C - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r0, 16 - b _0806D49E - .pool -_0806D49C: - movs r0, 0 -_0806D49E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end NationalToHoennOrder - - thumb_func_start SpeciesToNationalPokedexNum -SpeciesToNationalPokedexNum: @ 806D4A4 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _0806D4C0 - ldr r0, =gSpeciesToNationalPokedexNum - subs r1, 0x1 - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - b _0806D4C2 - .pool -_0806D4C0: - movs r0, 0 -_0806D4C2: - pop {r1} - bx r1 - thumb_func_end SpeciesToNationalPokedexNum - - thumb_func_start SpeciesToHoennPokedexNum -SpeciesToHoennPokedexNum: @ 806D4C8 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _0806D4E4 - ldr r0, =gSpeciesToHoennPokedexNum - subs r1, 0x1 - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - b _0806D4E6 - .pool -_0806D4E4: - movs r0, 0 -_0806D4E6: - pop {r1} - bx r1 - thumb_func_end SpeciesToHoennPokedexNum - - thumb_func_start HoennToNationalOrder -HoennToNationalOrder: @ 806D4EC - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _0806D508 - ldr r0, =gHoennToNationalOrder - subs r1, 0x1 - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - b _0806D50A - .pool -_0806D508: - movs r0, 0 -_0806D50A: - pop {r1} - bx r1 - thumb_func_end HoennToNationalOrder - - thumb_func_start speciesid_conv -speciesid_conv: @ 806D510 - push {lr} - lsls r0, 16 - lsrs r0, 16 - adds r1, r0, 0 - cmp r0, 0xFA - bls _0806D53E - ldr r0, =0x00000113 - cmp r1, r0 - bls _0806D53C - ldr r0, =gSpeciesIdToCryId - ldr r2, =0xfffffeec - adds r1, r2 - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - b _0806D53E - .pool -_0806D53C: - movs r0, 0xC8 -_0806D53E: - pop {r1} - bx r1 - thumb_func_end speciesid_conv - - thumb_func_start sub_806D544 -sub_806D544: @ 806D544 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r6, r1, 0 - mov r10, r2 - lsls r0, 16 - movs r1, 0x9A - lsls r1, 17 - cmp r0, r1 - bne _0806D652 - ldr r0, =0x020244d4 - ldr r1, [r0] - ldr r0, [r1, 0x4] - cmp r10, r0 - beq _0806D652 - ldr r0, [r1, 0xC] - cmp r10, r0 - beq _0806D652 - movs r5, 0 -_0806D570: - lsls r3, r5, 3 - adds r3, r5 - lsls r3, 2 - ldr r0, =gSpindaSpotGraphics - adds r4, r3, r0 - ldrb r1, [r4] - adds r1, 0xF8 - movs r2, 0xF - adds r0, r6, 0 - ands r0, r2 - adds r1, r0 - lsls r1, 24 - lsrs r1, 24 - mov r12, r1 - ldrb r1, [r4, 0x1] - adds r1, 0xF8 - movs r0, 0xF0 - ands r0, r6 - lsrs r0, 4 - adds r1, r0 - lsls r1, 24 - lsrs r1, 24 - movs r2, 0 - lsrs r6, 8 - str r6, [sp, 0x4] - adds r5, 0x1 - str r5, [sp] - mov r9, r3 -_0806D5A8: - lsls r0, r2, 1 - add r0, r9 - ldr r3, =gSpindaSpotGraphics + 0x2 - adds r0, r3 - ldrh r3, [r0] - mov r4, r12 - adds r0, r4, 0 - adds r0, 0x10 - adds r7, r1, 0x1 - adds r2, 0x1 - mov r8, r2 - cmp r4, r0 - bge _0806D640 - lsrs r0, r1, 3 - lsls r6, r0, 8 - movs r0, 0x7 - ands r1, r0 - lsls r5, r1, 2 -_0806D5CC: - adds r0, r4, 0 - cmp r4, 0 - bge _0806D5D4 - adds r0, r4, 0x7 -_0806D5D4: - asrs r0, 3 - lsls r2, r0, 5 - add r2, r10 - lsls r0, 3 - subs r0, r4, r0 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - adds r2, r0 - adds r2, r6 - adds r2, r5 - movs r1, 0x1 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _0806D634 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _0806D620 - ldrb r1, [r2] - movs r0, 0xF0 - ands r0, r1 - subs r0, 0x10 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x20 - bhi _0806D634 - adds r0, r1, 0 - adds r0, 0x40 - b _0806D632 - .pool -_0806D620: - ldrb r1, [r2] - movs r0, 0xF - ands r0, r1 - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bhi _0806D634 - adds r0, r1, 0x4 -_0806D632: - strb r0, [r2] -_0806D634: - asrs r3, 1 - adds r4, 0x1 - mov r0, r12 - adds r0, 0x10 - cmp r4, r0 - blt _0806D5CC -_0806D640: - lsls r0, r7, 24 - lsrs r1, r0, 24 - mov r2, r8 - cmp r2, 0xF - ble _0806D5A8 - ldr r6, [sp, 0x4] - ldr r5, [sp] - cmp r5, 0x3 - ble _0806D570 -_0806D652: - 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 sub_806D544 - - thumb_func_start DrawSpindaSpots -@ void DrawSpindaSpots(u16 species, u32 personality, u8 *pixels, u8 isFrontPic) -DrawSpindaSpots: @ 806D664 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r5, r1, 0 - str r2, [sp] - lsls r0, 16 - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x9A - lsls r1, 17 - cmp r0, r1 - bne _0806D766 - cmp r3, 0 - beq _0806D766 - movs r6, 0 -_0806D688: - lsls r3, r6, 3 - adds r3, r6 - lsls r3, 2 - ldr r0, =gSpindaSpotGraphics - adds r4, r3, r0 - ldrb r1, [r4] - adds r1, 0xF8 - movs r2, 0xF - adds r0, r5, 0 - ands r0, r2 - adds r1, r0 - lsls r1, 24 - lsrs r1, 24 - mov r12, r1 - ldrb r1, [r4, 0x1] - adds r1, 0xF8 - movs r0, 0xF0 - ands r0, r5 - lsrs r0, 4 - adds r1, r0 - lsls r1, 24 - lsrs r1, 24 - movs r2, 0 - lsrs r5, 8 - str r5, [sp, 0x4] - adds r6, 0x1 - mov r10, r6 - mov r9, r3 -_0806D6C0: - lsls r0, r2, 1 - add r0, r9 - ldr r3, =gSpindaSpotGraphics + 0x2 - adds r0, r3 - ldrh r3, [r0] - mov r4, r12 - adds r0, r4, 0 - adds r0, 0x10 - adds r7, r1, 0x1 - adds r2, 0x1 - mov r8, r2 - cmp r4, r0 - bge _0806D754 - lsrs r0, r1, 3 - lsls r6, r0, 8 - movs r0, 0x7 - ands r1, r0 - lsls r5, r1, 2 -_0806D6E4: - adds r0, r4, 0 - cmp r4, 0 - bge _0806D6EC - adds r0, r4, 0x7 -_0806D6EC: - asrs r0, 3 - lsls r2, r0, 5 - ldr r1, [sp] - adds r2, r1, r2 - lsls r0, 3 - subs r0, r4, r0 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - adds r2, r0 - adds r2, r6 - adds r2, r5 - movs r1, 0x1 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _0806D748 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _0806D734 - ldrb r1, [r2] - movs r0, 0xF0 - ands r0, r1 - subs r0, 0x10 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x20 - bhi _0806D748 - adds r0, r1, 0 - adds r0, 0x40 - b _0806D746 - .pool -_0806D734: - ldrb r1, [r2] - movs r0, 0xF - ands r0, r1 - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bhi _0806D748 - adds r0, r1, 0x4 -_0806D746: - strb r0, [r2] -_0806D748: - asrs r3, 1 - adds r4, 0x1 - mov r0, r12 - adds r0, 0x10 - cmp r4, r0 - blt _0806D6E4 -_0806D754: - lsls r0, r7, 24 - lsrs r1, r0, 24 - mov r2, r8 - cmp r2, 0xF - ble _0806D6C0 - ldr r5, [sp, 0x4] - mov r6, r10 - cmp r6, 0x3 - ble _0806D688 -_0806D766: - 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 DrawSpindaSpots - - thumb_func_start sub_806D778 -sub_806D778: @ 806D778 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - adds r5, r0, 0 - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 16 - lsrs r2, 16 - mov r8, r2 - ldr r0, =0x02021cc4 - mov r9, r0 - adds r0, r5, 0 - movs r1, 0x2 - mov r2, r9 - bl pokemon_getattr - mov r4, sp - adds r0, r5, 0 - movs r1, 0x3 - mov r2, sp - bl pokemon_getattr - strb r0, [r4] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0806D7D4 - movs r6, 0xB - adds r0, r7, 0 - muls r0, r6 - ldr r4, =gSpeciesNames - adds r0, r4 - mov r1, r9 - bl CompareString - cmp r0, 0 - bne _0806D7D4 - mov r2, r8 - muls r2, r6 - adds r2, r4 - adds r0, r5, 0 - movs r1, 0x2 - bl pokemon_setattr -_0806D7D4: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806D778 - - thumb_func_start sub_806D7EC -sub_806D7EC: @ 806D7EC - push {r4,r5,lr} - movs r5, 0 - ldr r4, =0x020229e8 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r1, 0x18] - cmp r0, 0x2 - bgt _0806D818 - cmp r0, 0x1 - bge _0806D820 - cmp r0, 0 - beq _0806D81C - b _0806D822 - .pool -_0806D818: - cmp r0, 0x3 - bne _0806D822 -_0806D81C: - movs r5, 0 - b _0806D822 -_0806D820: - movs r5, 0x1 -_0806D822: - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_806D7EC - - thumb_func_start sub_806D82C -sub_806D82C: @ 806D82C - push {lr} - lsls r0, 24 - lsrs r0, 24 - movs r3, 0 - ldr r2, =0x020229e8 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x18] - cmp r0, 0x2 - bgt _0806D854 - cmp r0, 0x1 - bge _0806D85C - cmp r0, 0 - beq _0806D858 - b _0806D85E - .pool -_0806D854: - cmp r0, 0x3 - bne _0806D85E -_0806D858: - movs r3, 0 - b _0806D85E -_0806D85C: - movs r3, 0x1 -_0806D85E: - adds r0, r3, 0 - pop {r1} - bx r1 - thumb_func_end sub_806D82C - - thumb_func_start sub_806D864 -sub_806D864: @ 806D864 - push {lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - ldr r1, =0x020229e8 - b _0806D87C - .pool -_0806D874: - adds r1, 0x1C - adds r2, 0x1 - cmp r2, 0x3 - bgt _0806D882 -_0806D87C: - ldrh r0, [r1, 0x18] - cmp r0, r3 - bne _0806D874 -_0806D882: - adds r0, r2, 0 - pop {r1} - bx r1 - thumb_func_end sub_806D864 - - thumb_func_start GetTrainerEncounterMusicId -@ u8 GetTrainerEncounterMusicId(u16 trainerOpponentId) -GetTrainerEncounterMusicId: @ 806D888 - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0806D8A2 - adds r0, r4, 0 - bl sub_81A9F3C - b _0806D8CA -_0806D8A2: - bl sub_81D5C18 - lsls r0, 24 - cmp r0, 0 - bne _0806D8C4 - ldr r1, =gTrainers - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x2] - movs r0, 0x7F - ands r0, r1 - b _0806D8CE - .pool -_0806D8C4: - adds r0, r5, 0 - bl sub_81D63C8 -_0806D8CA: - lsls r0, 24 - lsrs r0, 24 -_0806D8CE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end GetTrainerEncounterMusicId - - thumb_func_start nature_stat_mod -nature_stat_mod: @ 806D8D4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 16 - lsrs r3, r1, 16 - lsls r2, 24 - lsrs r5, r2, 24 - movs r0, 0xFF - lsls r0, 24 - adds r2, r0 - lsrs r2, 24 - cmp r2, 0x4 - bls _0806D8F2 - adds r0, r3, 0 - b _0806D92E -_0806D8F2: - ldr r0, =gNatureStatTable - lsls r1, r4, 2 - adds r1, r4 - subs r1, 0x1 - adds r1, r5, r1 - adds r1, r0 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _0806D918 - cmp r1, 0x1 - bne _0806D92C - movs r0, 0x6E - b _0806D91A - .pool -_0806D918: - movs r0, 0x5A -_0806D91A: - muls r0, r3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - b _0806D92E -_0806D92C: - adds r0, r3, 0 -_0806D92E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end nature_stat_mod - - thumb_func_start happiness_algorithm -happiness_algorithm: @ 806D934 - push {r4-r7,lr} - sub sp, 0x4 - adds r7, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - bl sub_806F104 - lsls r0, 24 - cmp r0, 0 - beq _0806D94A - b _0806DAC2 -_0806D94A: - adds r0, r7, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r7, 0 - movs r1, 0xC - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAF - bne _0806D9A0 - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806D98C - ldr r0, =0x02024404 - ldrb r4, [r0, 0x7] - b _0806D9A8 - .pool -_0806D98C: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003226 - adds r0, r1 - ldrb r4, [r0] - b _0806D9A8 - .pool -_0806D9A0: - bl itemid_get_x12 - lsls r0, 24 - lsrs r4, r0, 24 -_0806D9A8: - cmp r6, 0 - bne _0806D9AE - b _0806DAC2 -_0806D9AE: - movs r0, 0xCE - lsls r0, 1 - cmp r6, r0 - bne _0806D9B8 - b _0806DAC2 -_0806D9B8: - movs r6, 0 - adds r0, r7, 0 - movs r1, 0x20 - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - mov r1, sp - strh r0, [r1] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x63 - ble _0806D9D6 - movs r6, 0x1 -_0806D9D6: - cmp r0, 0xC7 - ble _0806D9E0 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0806D9E0: - cmp r5, 0x5 - bne _0806D9F0 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - bne _0806DAC2 -_0806D9F0: - cmp r5, 0x3 - bne _0806DA20 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0806DAC2 - ldr r2, =gTrainers - ldr r0, =0x02038bca - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r1, [r0, 0x1] - adds r0, r1, 0 - subs r0, 0x1F - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _0806DA20 - cmp r1, 0x26 - bne _0806DAC2 -_0806DA20: - ldr r1, =gUnknown_08329ECE - lsls r0, r5, 1 - adds r0, r5 - adds r0, r6, r0 - adds r0, r1 - ldrb r2, [r0] - movs r1, 0 - ldrsb r1, [r0, r1] - cmp r1, 0 - ble _0806DA46 - cmp r4, 0x1B - bne _0806DA46 - movs r0, 0x96 - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - lsls r0, 24 - lsrs r2, r0, 24 -_0806DA46: - lsls r2, 24 - asrs r2, 24 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - adds r0, r2 - mov r1, sp - strh r0, [r1] - cmp r2, 0 - ble _0806DA98 - adds r0, r7, 0 - movs r1, 0x26 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0xB - bne _0806DA74 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - adds r0, 0x1 - mov r1, sp - strh r0, [r1] -_0806DA74: - adds r0, r7, 0 - movs r1, 0x23 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - bl sav1_map_get_name - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _0806DA98 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - adds r0, 0x1 - mov r1, sp - strh r0, [r1] -_0806DA98: - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _0806DAA8 - movs r1, 0 - mov r0, sp - strh r1, [r0] -_0806DAA8: - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0xFF - ble _0806DAB8 - movs r1, 0xFF - mov r0, sp - strh r1, [r0] -_0806DAB8: - adds r0, r7, 0 - movs r1, 0x20 - mov r2, sp - bl pokemon_setattr -_0806DAC2: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end happiness_algorithm - - thumb_func_start sub_806DADC -sub_806DADC: @ 806DADC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - mov r8, r0 - lsls r1, 16 - lsrs r5, r1, 16 - movs r4, 0 - movs r7, 0 - movs r6, 0 -_0806DAF0: - adds r1, r6, 0 - adds r1, 0x1A - mov r0, r8 - movs r2, 0 - bl pokemon_getattr - mov r2, sp - adds r1, r2, r6 - strb r0, [r1] - ldrb r0, [r1] - adds r0, r7, r0 - lsls r0, 16 - lsrs r7, r0, 16 - adds r6, 0x1 - cmp r6, 0x5 - ble _0806DAF0 - movs r6, 0 - b _0806DC72 -_0806DB14: - mov r0, r8 - movs r1, 0 - bl sub_806DDE4 - lsls r0, 24 - movs r2, 0x1 - cmp r0, 0 - beq _0806DB26 - movs r2, 0x2 -_0806DB26: - cmp r6, 0x5 - bhi _0806DBC8 - lsls r0, r6, 2 - ldr r1, =_0806DB38 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806DB38: - .4byte _0806DB50 - .4byte _0806DB64 - .4byte _0806DB78 - .4byte _0806DB8C - .4byte _0806DBA0 - .4byte _0806DBB4 -_0806DB50: - ldr r0, =gBaseStats - lsls r1, r5, 3 - subs r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xA] - lsls r0, 30 - b _0806DBC2 - .pool -_0806DB64: - ldr r0, =gBaseStats - lsls r1, r5, 3 - subs r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xA] - b _0806DBC0 - .pool -_0806DB78: - ldr r0, =gBaseStats - lsls r1, r5, 3 - subs r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xA] - lsls r0, 26 - b _0806DBC2 - .pool -_0806DB8C: - ldr r0, =gBaseStats - lsls r1, r5, 3 - subs r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xA] - lsrs r0, 6 - b _0806DBC4 - .pool -_0806DBA0: - ldr r0, =gBaseStats - lsls r1, r5, 3 - subs r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xB] - lsls r0, 30 - b _0806DBC2 - .pool -_0806DBB4: - ldr r0, =gBaseStats - lsls r1, r5, 3 - subs r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xB] -_0806DBC0: - lsls r0, 28 -_0806DBC2: - lsrs r0, 30 -_0806DBC4: - adds r4, r0, 0 - muls r4, r2 -_0806DBC8: - mov r0, r8 - movs r1, 0xC - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAF - bne _0806DC14 - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806DC00 - ldr r0, =0x02024404 - ldrb r0, [r0, 0x7] - b _0806DC1C - .pool -_0806DC00: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00003226 - adds r0, r2 - ldrb r0, [r0] - b _0806DC1C - .pool -_0806DC14: - bl itemid_get_x12 - lsls r0, 24 - lsrs r0, 24 -_0806DC1C: - cmp r0, 0x18 - bne _0806DC24 - lsls r0, r4, 17 - lsrs r4, r0, 16 -_0806DC24: - lsls r0, r4, 16 - asrs r2, r0, 16 - adds r1, r7, r2 - movs r0, 0xFF - lsls r0, 1 - cmp r1, r0 - ble _0806DC3C - adds r0, r2, r0 - adds r1, r7, r4 - subs r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 -_0806DC3C: - mov r0, sp - adds r2, r0, r6 - ldrb r3, [r2] - lsls r0, r4, 16 - asrs r1, r0, 16 - adds r0, r3, r1 - cmp r0, 0xFF - ble _0806DC58 - adds r0, r1, 0 - adds r0, 0xFF - adds r1, r3, r4 - subs r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 -_0806DC58: - adds r0, r3, r4 - strb r0, [r2] - adds r0, r7, r4 - lsls r0, 16 - lsrs r7, r0, 16 - adds r1, r6, 0 - adds r1, 0x1A - mov r0, r8 - bl pokemon_setattr - adds r6, 0x1 - cmp r6, 0x5 - bgt _0806DC7A -_0806DC72: - ldr r0, =0x000001fd - cmp r7, r0 - bhi _0806DC7A - b _0806DB14 -_0806DC7A: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806DADC - - thumb_func_start sub_806DC8C -sub_806DC8C: @ 806DC8C - push {r4-r6,lr} - adds r6, r0, 0 - movs r5, 0 - movs r4, 0 -_0806DC94: - adds r1, r4, 0 - adds r1, 0x1A - adds r0, r6, 0 - movs r2, 0 - bl pokemon_getattr - adds r0, r5, r0 - lsls r0, 16 - lsrs r5, r0, 16 - adds r4, 0x1 - cmp r4, 0x5 - ble _0806DC94 - adds r0, r5, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_806DC8C - - thumb_func_start sub_806DCB4 -sub_806DCB4: @ 806DCB4 - push {r4-r6,lr} - sub sp, 0x4 - adds r6, r0, 0 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r5, r0, 16 - movs r0, 0x80 - lsls r0, 7 - cmp r5, r0 - beq _0806DCDA - movs r0, 0x80 - lsls r0, 8 - cmp r5, r0 - beq _0806DCDA - movs r0, 0xC0 - lsls r0, 8 - cmp r5, r0 - bne _0806DD70 -_0806DCDA: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - bl __umodsi3 - lsls r0, 16 - lsrs r5, r0, 16 - movs r0, 0x64 - muls r0, r5 - adds r4, r6, r0 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - beq _0806DCDA - adds r0, r4, 0 - movs r1, 0x2D - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - bne _0806DCDA - ldr r1, =gUnknown_0832A328 - lsls r0, r5, 2 - adds r0, r1 - ldrb r1, [r0] - adds r0, r6, 0 - bl sub_806DDE4 - lsls r0, 24 - cmp r0, 0 - bne _0806DD70 - movs r4, 0x7 -_0806DD24: - bl GenerateRandomNumber - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - strb r0, [r1] - adds r2, r0, 0 - adds r1, r2, 0 - ands r1, r4 - cmp r1, 0 - beq _0806DD24 - movs r0, 0xF0 - ands r0, r2 - cmp r0, 0 - beq _0806DD46 - mov r0, sp - strb r1, [r0] -_0806DD46: - mov r0, sp - ldrb r0, [r0] - lsls r1, r0, 4 - orrs r0, r1 - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - strb r0, [r1] - movs r1, 0xF3 - ands r1, r0 - mov r0, sp - strb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - movs r0, 0x64 - muls r0, r5 - adds r0, r6, r0 - movs r1, 0x22 - mov r2, sp - bl pokemon_setattr -_0806DD70: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806DCB4 - - thumb_func_start sub_806DD7C -sub_806DD7C: @ 806DD7C - push {r4-r7,lr} - sub sp, 0x4 - adds r7, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - movs r3, 0 - movs r6, 0x1 - movs r5, 0 - cmp r4, 0 - beq _0806DDC4 -_0806DD90: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0806DDB8 - movs r0, 0x64 - muls r0, r3 - adds r0, r7, r0 - movs r1, 0x22 - movs r2, 0 - str r3, [sp] - bl pokemon_getattr - movs r1, 0xF - ands r1, r0 - ldr r3, [sp] - cmp r1, 0 - beq _0806DDB8 - orrs r5, r6 - lsls r0, r5, 24 - lsrs r5, r0, 24 -_0806DDB8: - adds r3, 0x1 - lsls r6, 1 - lsrs r4, 1 - cmp r4, 0 - bne _0806DD90 - b _0806DDD8 -_0806DDC4: - adds r0, r7, 0 - movs r1, 0x22 - movs r2, 0 - bl pokemon_getattr - movs r1, 0xF - ands r1, r0 - cmp r1, 0 - beq _0806DDD8 - movs r5, 0x1 -_0806DDD8: - adds r0, r5, 0 - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_806DD7C - - thumb_func_start sub_806DDE4 -sub_806DDE4: @ 806DDE4 - push {r4-r7,lr} - sub sp, 0x4 - adds r7, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - movs r3, 0 - movs r6, 0x1 - movs r5, 0 - cmp r4, 0 - beq _0806DE28 -_0806DDF8: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0806DE1C - movs r0, 0x64 - muls r0, r3 - adds r0, r7, r0 - movs r1, 0x22 - movs r2, 0 - str r3, [sp] - bl pokemon_getattr - ldr r3, [sp] - cmp r0, 0 - beq _0806DE1C - orrs r5, r6 - lsls r0, r5, 24 - lsrs r5, r0, 24 -_0806DE1C: - adds r3, 0x1 - lsls r6, 1 - lsrs r4, 1 - cmp r4, 0 - bne _0806DDF8 - b _0806DE38 -_0806DE28: - adds r0, r7, 0 - movs r1, 0x22 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - beq _0806DE38 - movs r5, 0x1 -_0806DE38: - adds r0, r5, 0 - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_806DDE4 - - thumb_func_start sub_806DE44 -sub_806DE44: @ 806DE44 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r7, r0, 16 - movs r6, 0 - mov r5, sp -_0806DE50: - movs r0, 0x64 - adds r1, r6, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - beq _0806DEB2 - adds r0, r4, 0 - movs r1, 0x22 - movs r2, 0 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - strb r0, [r5] - movs r1, 0xF - adds r2, r0, 0 - ands r1, r2 - cmp r1, 0 - beq _0806DEB2 - cmp r1, r7 - bcc _0806DE8A - cmp r7, 0x4 - bls _0806DE94 -_0806DE8A: - movs r0, 0xF0 - ands r0, r2 - b _0806DE96 - .pool -_0806DE94: - subs r0, r2, r7 -_0806DE96: - strb r0, [r5] - ldrb r0, [r5] - cmp r0, 0 - bne _0806DEA2 - movs r0, 0x10 - strb r0, [r5] -_0806DEA2: - movs r0, 0x64 - muls r0, r6 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x22 - mov r2, sp - bl pokemon_setattr -_0806DEB2: - adds r6, 0x1 - cmp r6, 0x5 - ble _0806DE50 - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806DE44 - - thumb_func_start sub_806DEC4 -sub_806DEC4: @ 806DEC4 - push {r4-r7,lr} - sub sp, 0x4 - adds r7, r0, 0 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _0806DF6A - movs r5, 0 -_0806DEE0: - movs r0, 0x64 - adds r6, r5, 0 - muls r6, r0 - adds r4, r7, r6 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - beq _0806DF64 - adds r0, r4, 0 - movs r1, 0x22 - movs r2, 0 - bl pokemon_getattr - lsls r0, 24 - lsrs r1, r0, 24 - mov r0, sp - strb r1, [r0] - cmp r1, 0 - beq _0806DF64 - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - beq _0806DF64 - cmp r5, 0 - beq _0806DF3A - adds r0, r6, 0 - subs r0, 0x64 - adds r4, r7, r0 - adds r0, r4, 0 - movs r1, 0x22 - movs r2, 0 - bl pokemon_getattr - movs r1, 0xF0 - ands r1, r0 - cmp r1, 0 - bne _0806DF3A - adds r0, r4, 0 - movs r1, 0x22 - mov r2, sp - bl pokemon_setattr -_0806DF3A: - cmp r5, 0x5 - beq _0806DF64 - movs r0, 0x64 - muls r0, r5 - adds r0, 0x64 - adds r4, r7, r0 - adds r0, r4, 0 - movs r1, 0x22 - movs r2, 0 - bl pokemon_getattr - movs r1, 0xF0 - ands r1, r0 - cmp r1, 0 - bne _0806DF64 - adds r0, r4, 0 - movs r1, 0x22 - mov r2, sp - bl pokemon_setattr - adds r5, 0x1 -_0806DF64: - adds r5, 0x1 - cmp r5, 0x5 - ble _0806DEE0 -_0806DF6A: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_806DEC4 - - thumb_func_start sub_806DF74 -sub_806DF74: @ 806DF74 - push {r4-r6,lr} - sub sp, 0x8 - adds r5, r0, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x38 - movs r2, 0 - bl pokemon_getattr - adds r0, 0x1 - mov r1, sp - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x19 - movs r2, 0 - bl pokemon_getattr - str r0, [sp, 0x4] - ldr r6, =gExperienceTables - ldr r2, =gBaseStats - lsls r1, r4, 3 - subs r1, r4 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1, 0x13] - movs r1, 0xCA - lsls r1, 1 - adds r4, r2, 0 - muls r4, r1 - movs r2, 0xC8 - lsls r2, 1 - adds r1, r6, r2 - adds r1, r4, r1 - ldr r1, [r1] - cmp r0, r1 - bls _0806DFD4 - str r1, [sp, 0x4] - add r2, sp, 0x4 - adds r0, r5, 0 - movs r1, 0x19 - bl pokemon_setattr -_0806DFD4: - mov r0, sp - ldrb r0, [r0] - cmp r0, 0x64 - bhi _0806DFEA - lsls r0, 2 - adds r0, r4 - adds r0, r6 - ldr r1, [sp, 0x4] - ldr r0, [r0] - cmp r1, r0 - bcs _0806DFF8 -_0806DFEA: - movs r0, 0 - b _0806E004 - .pool -_0806DFF8: - adds r0, r5, 0 - movs r1, 0x38 - mov r2, sp - bl pokemon_setattr - movs r0, 0x1 -_0806E004: - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_806DF74 - - thumb_func_start sub_806E00C -sub_806E00C: @ 806E00C - push {r4,r5,lr} - lsls r1, 24 - lsrs r4, r1, 24 - adds r5, r4, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r1, r0, 16 - adds r3, r1, 0 - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - bne _0806E02E - movs r0, 0 - b _0806E05A -_0806E02E: - cmp r4, 0x1F - bls _0806E04C - adds r0, r4, 0 - subs r0, 0x20 - movs r2, 0x1 - lsls r2, r0 - ldr r0, =gTMHMLearnsets - lsls r1, 3 - adds r0, 0x4 - adds r1, r0 - ldr r0, [r1] - ands r0, r2 - b _0806E05A - .pool -_0806E04C: - movs r1, 0x1 - lsls r1, r5 - ldr r2, =gTMHMLearnsets - lsls r0, r3, 3 - adds r0, r2 - ldr r0, [r0] - ands r0, r1 -_0806E05A: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806E00C - - thumb_func_start sub_806E064 -sub_806E064: @ 806E064 - push {r4,lr} - lsls r0, 16 - lsrs r3, r0, 16 - adds r4, r3, 0 - lsls r1, 24 - lsrs r1, 24 - adds r2, r1, 0 - movs r0, 0xCE - lsls r0, 1 - cmp r3, r0 - bne _0806E07E - movs r0, 0 - b _0806E0AA -_0806E07E: - cmp r1, 0x1F - bls _0806E09C - adds r0, r1, 0 - subs r0, 0x20 - movs r2, 0x1 - lsls r2, r0 - ldr r0, =gTMHMLearnsets - lsls r1, r3, 3 - adds r0, 0x4 - adds r1, r0 - ldr r0, [r1] - ands r0, r2 - b _0806E0AA - .pool -_0806E09C: - movs r1, 0x1 - lsls r1, r2 - ldr r2, =gTMHMLearnsets - lsls r0, r4, 3 - adds r0, r2 - ldr r0, [r0] - ands r0, r1 -_0806E0AA: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806E064 - - thumb_func_start sub_806E0B4 -sub_806E0B4: @ 806E0B4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - adds r6, r0, 0 - str r1, [sp, 0x8] - movs r0, 0 - mov r10, r0 - adds r0, r6, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r7, r0, 16 - adds r0, r6, 0 - movs r1, 0x38 - movs r2, 0 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0xC] - movs r5, 0 - mov r4, sp -_0806E0EA: - adds r1, r5, 0 - adds r1, 0xD - adds r0, r6, 0 - movs r2, 0 - bl pokemon_getattr - strh r0, [r4] - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _0806E0EA - movs r5, 0 - ldr r6, =gLevelUpLearnsetPointers - lsls r1, r7, 2 - adds r2, r1, r6 - ldr r3, [r2] - ldrh r0, [r3] - ldr r4, =0x0000ffff - str r1, [sp, 0x14] - cmp r0, r4 - beq _0806E1E4 - mov r9, r2 - str r3, [sp, 0x10] -_0806E118: - lsls r2, r5, 1 - ldr r1, [sp, 0x10] - adds r0, r2, r1 - ldrh r3, [r0] - movs r0, 0xFE - lsls r0, 8 - ands r0, r3 - ldr r4, [sp, 0xC] - lsls r1, r4, 9 - adds r7, r2, 0 - adds r5, 0x1 - mov r12, r5 - cmp r0, r1 - bgt _0806E1CE - movs r4, 0 - mov r0, sp - ldrh r1, [r0] - ldr r0, =0x000001ff - ands r0, r3 - cmp r1, r0 - beq _0806E168 - ldr r0, [sp, 0x14] - ldr r1, =gLevelUpLearnsetPointers - adds r6, r0, r1 - ldr r2, =0x000001ff - mov r8, r2 - mov r3, sp - adds r5, r7, 0 -_0806E150: - adds r3, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - bgt _0806E168 - ldr r0, [r6] - adds r0, r5, r0 - ldrh r1, [r0] - ldrh r2, [r3] - mov r0, r8 - ands r0, r1 - cmp r2, r0 - bne _0806E150 -_0806E168: - cmp r4, 0x4 - bne _0806E1CE - movs r4, 0 - cmp r4, r10 - bge _0806E1AC - mov r1, r9 - ldr r0, [r1] - adds r0, r7, r0 - ldrh r1, [r0] - ldr r0, [sp, 0x8] - ldrh r2, [r0] - ldr r0, =0x000001ff - ands r0, r1 - cmp r2, r0 - beq _0806E1AC - ldr r1, [sp, 0x14] - ldr r2, =gLevelUpLearnsetPointers - adds r6, r1, r2 - ldr r0, =0x000001ff - mov r8, r0 - ldr r3, [sp, 0x8] - adds r5, r7, 0 -_0806E194: - adds r3, 0x2 - adds r4, 0x1 - cmp r4, r10 - bge _0806E1AC - ldr r0, [r6] - adds r0, r5, r0 - ldrh r1, [r0] - ldrh r2, [r3] - mov r0, r8 - ands r0, r1 - cmp r2, r0 - bne _0806E194 -_0806E1AC: - cmp r4, r10 - bne _0806E1CE - mov r0, r10 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r2, r4, 1 - ldr r1, [sp, 0x8] - adds r2, r1 - mov r4, r9 - ldr r0, [r4] - adds r0, r7, r0 - ldrh r1, [r0] - ldr r0, =0x000001ff - ands r0, r1 - strh r0, [r2] -_0806E1CE: - mov r5, r12 - cmp r5, 0x13 - bgt _0806E1E4 - mov r1, r9 - ldr r0, [r1] - lsls r1, r5, 1 - adds r1, r0 - ldrh r0, [r1] - ldr r2, =0x0000ffff - cmp r0, r2 - bne _0806E118 -_0806E1E4: - mov r0, r10 - 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_806E0B4 - - thumb_func_start sub_806E204 -sub_806E204: @ 806E204 - push {r4-r7,lr} - adds r6, r1, 0 - lsls r0, 16 - movs r5, 0 - movs r4, 0 - ldr r1, =gLevelUpLearnsetPointers - lsrs r0, 14 - adds r0, r1 - ldr r2, [r0] - ldrh r0, [r2] - ldr r1, =0x0000ffff - cmp r0, r1 - beq _0806E248 - ldr r0, =0x000001ff - mov r12, r0 - adds r7, r1, 0 - adds r3, r2, 0 -_0806E226: - adds r1, r5, 0 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 1 - adds r1, r6 - ldrh r2, [r3] - mov r0, r12 - ands r0, r2 - strh r0, [r1] - adds r3, 0x2 - adds r4, 0x1 - cmp r4, 0x13 - bgt _0806E248 - ldrh r0, [r3] - cmp r0, r7 - bne _0806E226 -_0806E248: - adds r0, r5, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806E204 - - thumb_func_start sub_806E25C -sub_806E25C: @ 806E25C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x3C - adds r6, r0, 0 - movs r0, 0 - mov r10, r0 - adds r0, r6, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r6, 0 - movs r1, 0x38 - movs r2, 0 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x30] - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - bne _0806E298 - movs r0, 0 - b _0806E3A2 -_0806E298: - movs r5, 0 - lsls r4, 2 - str r4, [sp, 0x38] - mov r4, sp -_0806E2A0: - adds r1, r5, 0 - adds r1, 0xD - adds r0, r6, 0 - movs r2, 0 - bl pokemon_getattr - strh r0, [r4] - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _0806E2A0 - movs r5, 0 - ldr r3, =gLevelUpLearnsetPointers - ldr r2, [sp, 0x38] - adds r1, r2, r3 - ldr r0, [r1] - ldrh r0, [r0] - ldr r2, =0x0000ffff - cmp r0, r2 - beq _0806E3A0 - mov r9, r1 - mov r4, sp - adds r4, 0x8 - str r4, [sp, 0x34] -_0806E2D0: - mov r1, r9 - ldr r0, [r1] - lsls r2, r5, 1 - adds r0, r2, r0 - ldrh r3, [r0] - movs r0, 0xFE - lsls r0, 8 - ands r0, r3 - ldr r4, [sp, 0x30] - lsls r1, r4, 9 - adds r7, r2, 0 - adds r5, 0x1 - mov r12, r5 - cmp r0, r1 - bgt _0806E38A - movs r4, 0 - mov r0, sp - ldrh r1, [r0] - ldr r0, =0x000001ff - ands r0, r3 - cmp r1, r0 - beq _0806E322 - ldr r0, [sp, 0x38] - ldr r1, =gLevelUpLearnsetPointers - adds r6, r0, r1 - ldr r2, =0x000001ff - mov r8, r2 - mov r3, sp - adds r5, r7, 0 -_0806E30A: - adds r3, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - bgt _0806E322 - ldr r0, [r6] - adds r0, r5, r0 - ldrh r1, [r0] - ldrh r2, [r3] - mov r0, r8 - ands r0, r1 - cmp r2, r0 - bne _0806E30A -_0806E322: - cmp r4, 0x4 - bne _0806E38A - movs r4, 0 - cmp r4, r10 - bge _0806E368 - mov r1, r9 - ldr r0, [r1] - adds r0, r7, r0 - ldrh r1, [r0] - ldr r0, [sp, 0x34] - ldrh r2, [r0] - ldr r0, =0x000001ff - ands r0, r1 - add r1, sp, 0x8 - cmp r2, r0 - beq _0806E368 - ldr r2, [sp, 0x38] - ldr r0, =gLevelUpLearnsetPointers - adds r6, r2, r0 - ldr r2, =0x000001ff - mov r8, r2 - adds r3, r1, 0 - adds r5, r7, 0 -_0806E350: - adds r3, 0x2 - adds r4, 0x1 - cmp r4, r10 - bge _0806E368 - ldr r0, [r6] - adds r0, r5, r0 - ldrh r1, [r0] - ldrh r2, [r3] - mov r0, r8 - ands r0, r1 - cmp r2, r0 - bne _0806E350 -_0806E368: - cmp r4, r10 - bne _0806E38A - mov r0, r10 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r2, r4, 1 - ldr r4, [sp, 0x34] - adds r2, r4, r2 - mov r1, r9 - ldr r0, [r1] - adds r0, r7, r0 - ldrh r1, [r0] - ldr r0, =0x000001ff - ands r0, r1 - strh r0, [r2] -_0806E38A: - mov r5, r12 - cmp r5, 0x13 - bgt _0806E3A0 - mov r2, r9 - ldr r0, [r2] - lsls r1, r5, 1 - adds r1, r0 - ldrh r0, [r1] - ldr r4, =0x0000ffff - cmp r0, r4 - bne _0806E2D0 -_0806E3A0: - mov r0, r10 -_0806E3A2: - add sp, 0x3C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806E25C - - thumb_func_start sub_806E3C0 -sub_806E3C0: @ 806E3C0 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - bl sub_809D42C - cmp r0, 0 - beq _0806E3DA - adds r0, r4, 0 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - b _0806E3F2 -_0806E3DA: - adds r0, r4, 0 - bl SpeciesToHoennPokedexNum - adds r4, r0, 0 - cmp r4, 0xCA - bls _0806E3F0 - ldr r0, =0x0000ffff - b _0806E3F2 - .pool -_0806E3F0: - adds r0, r4, 0 -_0806E3F2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_806E3C0 - - thumb_func_start sub_806E3F8 -sub_806E3F8: @ 806E3F8 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl SpeciesToHoennPokedexNum - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xCA - bhi _0806E40E - movs r0, 0x1 - b _0806E410 -_0806E40E: - movs r0, 0 -_0806E410: - pop {r1} - bx r1 - thumb_func_end sub_806E3F8 - - thumb_func_start sub_806E414 -sub_806E414: @ 806E414 - push {lr} - ldr r1, =0x020244e4 - movs r2, 0 - adds r0, r1, 0x3 -_0806E41C: - strb r2, [r0] - subs r0, 0x1 - cmp r0, r1 - bge _0806E41C - pop {r0} - bx r0 - .pool - thumb_func_end sub_806E414 - - thumb_func_start song_id_for_battle -song_id_for_battle: @ 806E42C - push {lr} - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 5 - ands r0, r1 - cmp r0, 0 - beq _0806E448 - movs r0, 0xF0 - lsls r0, 1 - b _0806E646 - .pool -_0806E448: - movs r0, 0x80 - lsls r0, 7 - ands r0, r1 - cmp r0, 0 - beq _0806E45C - ldr r0, =0x000001df - b _0806E646 - .pool -_0806E45C: - ldr r0, =0x02000002 - ands r0, r1 - cmp r0, 0 - beq _0806E466 - b _0806E63C -_0806E466: - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - bne _0806E470 - b _0806E642 -_0806E470: - ldr r0, =0x003f0100 - ands r0, r1 - cmp r0, 0 - beq _0806E494 - ldr r0, =0x02038bca - ldrh r0, [r0] - bl sub_8162BD8 - lsls r0, 24 - lsrs r0, 24 - b _0806E4B2 - .pool -_0806E494: - movs r0, 0x80 - lsls r0, 19 - ands r1, r0 - cmp r1, 0 - beq _0806E4A2 - movs r0, 0xA - b _0806E4B2 -_0806E4A2: - ldr r2, =gTrainers - ldr r0, =0x02038bca - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x1] -_0806E4B2: - subs r0, 0x3 - cmp r0, 0x3D - bls _0806E4BA - b _0806E63C -_0806E4BA: - lsls r0, 2 - ldr r1, =_0806E4D0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0806E4D0: - .4byte _0806E5D0 - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E5D0 - .4byte _0806E63C - .4byte _0806E5D0 - .4byte _0806E63C - .4byte _0806E5C8 - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E62C - .4byte _0806E5D8 - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E5E0 - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E5D0 - .4byte _0806E5E6 - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E5C8 - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E63C - .4byte _0806E632 - .4byte _0806E632 - .4byte _0806E632 - .4byte _0806E632 - .4byte _0806E632 - .4byte _0806E632 - .4byte _0806E632 -_0806E5C8: - ldr r0, =0x000001e3 - b _0806E646 - .pool -_0806E5D0: - ldr r0, =0x000001db - b _0806E646 - .pool -_0806E5D8: - ldr r0, =0x000001dd - b _0806E646 - .pool -_0806E5E0: - movs r0, 0xEF - lsls r0, 1 - b _0806E646 -_0806E5E6: - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x003f0100 - ands r0, r1 - cmp r0, 0 - beq _0806E604 -_0806E5F2: - ldr r0, =0x000001e1 - b _0806E646 - .pool -_0806E604: - ldr r0, =0x02038bca - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =gTrainers + 0x4 @ name offset - adds r0, r1 - ldr r1, =gUnknown_085CCB98 - bl CompareString - cmp r0, 0 - beq _0806E63C - b _0806E5F2 - .pool -_0806E62C: - movs r0, 0xF1 - lsls r0, 1 - b _0806E646 -_0806E632: - ldr r0, =0x000001d7 - b _0806E646 - .pool -_0806E63C: - movs r0, 0xEE - lsls r0, 1 - b _0806E646 -_0806E642: - movs r0, 0xED - lsls r0, 1 -_0806E646: - pop {r1} - bx r1 - thumb_func_end song_id_for_battle - - thumb_func_start sub_806E64C -sub_806E64C: @ 806E64C - push {lr} - bl map_music_set_to_zero - bl m4aMPlayAllStop - bl song_id_for_battle - lsls r0, 16 - lsrs r0, 16 - bl song_play_for_text - pop {r0} - bx r0 - thumb_func_end sub_806E64C - - thumb_func_start current_map_music_set__default_for_battle -current_map_music_set__default_for_battle: @ 806E668 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - bl map_music_set_to_zero - bl m4aMPlayAllStop - cmp r4, 0 - beq _0806E682 - adds r0, r4, 0 - bl current_map_music_set - b _0806E68E -_0806E682: - bl song_id_for_battle - lsls r0, 16 - lsrs r0, 16 - bl current_map_music_set -_0806E68E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end current_map_music_set__default_for_battle - - thumb_func_start sub_806E694 -sub_806E694: @ 806E694 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl map_music_set_to_zero - bl m4aMPlayAllStop - ldr r0, =sub_806E6CC - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806E694 - - thumb_func_start sub_806E6CC -sub_806E6CC: @ 806E6CC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r1 - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _0806E6F0 - ldrh r0, [r1, 0x8] - bl current_map_music_set - b _0806E6FC - .pool -_0806E6F0: - bl song_id_for_battle - lsls r0, 16 - lsrs r0, 16 - bl current_map_music_set -_0806E6FC: - adds r0, r4, 0 - bl DestroyTask - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_806E6CC - - thumb_func_start pokemon_get_pal -pokemon_get_pal: @ 806E708 - push {r4-r6,lr} - adds r5, r0, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x1 - movs r2, 0 - bl pokemon_getattr - adds r6, r0, 0 - adds r0, r5, 0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - adds r2, r0, 0 - adds r0, r4, 0 - adds r1, r6, 0 - bl species_and_otid_get_pal - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end pokemon_get_pal - - thumb_func_start species_and_otid_get_pal -species_and_otid_get_pal: @ 806E740 - push {r4,r5,lr} - adds r3, r2, 0 - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - bls _0806E75C - ldr r0, =gMonPaletteTable - ldr r0, [r0] - b _0806E788 - .pool -_0806E75C: - lsrs r0, r1, 16 - ldr r2, =0x0000ffff - ands r1, r2 - eors r0, r1 - lsrs r1, r3, 16 - eors r0, r1 - ands r3, r2 - eors r0, r3 - cmp r0, 0x7 - bls _0806E780 - ldr r0, =gMonPaletteTable - lsls r1, r4, 3 - b _0806E784 - .pool -_0806E780: - ldr r0, =gMonShinyPaletteTable - lsls r1, r5, 3 -_0806E784: - adds r1, r0 - ldr r0, [r1] -_0806E788: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end species_and_otid_get_pal - - thumb_func_start sub_806E794 -sub_806E794: @ 806E794 - push {r4-r6,lr} - adds r5, r0, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x1 - movs r2, 0 - bl pokemon_getattr - adds r6, r0, 0 - adds r0, r5, 0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - adds r2, r0, 0 - adds r0, r4, 0 - adds r1, r6, 0 - bl sub_806E7CC - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_806E794 - - thumb_func_start sub_806E7CC -sub_806E7CC: @ 806E7CC - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - lsrs r0, r1, 16 - ldr r3, =0x0000ffff - ands r1, r3 - eors r0, r1 - lsrs r1, r2, 16 - eors r0, r1 - ands r2, r3 - eors r0, r2 - cmp r0, 0x7 - bls _0806E7F4 - lsls r0, r4, 3 - ldr r1, =gMonPaletteTable - b _0806E7F8 - .pool -_0806E7F4: - lsls r0, r4, 3 - ldr r1, =gMonShinyPaletteTable -_0806E7F8: - adds r0, r1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806E7CC - - thumb_func_start sub_806E804 -sub_806E804: @ 806E804 - push {r4,lr} - lsls r0, 16 - lsrs r3, r0, 16 - ldr r2, =gUnknown_08329EEA - ldrh r0, [r2] - ldr r1, =0x0000ffff - cmp r0, r1 - beq _0806E836 - adds r4, r1, 0 - adds r1, r2, 0 -_0806E818: - ldrh r0, [r2] - adds r1, 0x2 - adds r2, 0x2 - cmp r0, r3 - bne _0806E830 - movs r0, 0x1 - b _0806E838 - .pool -_0806E830: - ldrh r0, [r1] - cmp r0, r4 - bne _0806E818 -_0806E836: - movs r0, 0 -_0806E838: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_806E804 - - thumb_func_start sub_806E840 -sub_806E840: @ 806E840 - lsls r0, 16 - lsrs r0, 16 - ldr r2, =gBaseStats - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x19] - lsrs r0, 7 - bx lr - .pool - thumb_func_end sub_806E840 - - thumb_func_start sub_806E858 -sub_806E858: @ 806E858 - push {r4,lr} - lsls r4, r1, 24 - lsrs r4, 24 - bl GetNature - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_085B25A0 - lsls r1, r0, 2 - adds r1, r0 - adds r1, r4 - adds r1, r2 - movs r0, 0 - ldrsb r0, [r1, r0] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806E858 - - thumb_func_start sub_806E880 -sub_806E880: @ 806E880 - push {r4,lr} - lsls r4, r1, 24 - lsrs r4, 24 - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_085B25A0 - lsls r1, r0, 2 - adds r1, r0 - adds r1, r4 - adds r1, r2 - movs r0, 0 - ldrsb r0, [r1, r0] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806E880 - - thumb_func_start sub_806E8A8 -sub_806E8A8: @ 806E8A8 - push {r4,lr} - sub sp, 0x8 - adds r4, r0, 0 - movs r1, 0x7 - mov r2, sp - bl pokemon_getattr - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl pokemon_getattr - mov r1, sp - bl sub_806E8D4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_806E8A8 - - thumb_func_start sub_806E8D4 -sub_806E8D4: @ 806E8D4 - push {r4,r5,lr} - adds r5, r1, 0 - ldr r1, =0x03005d90 - ldr r3, [r1] - ldrb r2, [r3, 0xA] - ldrb r1, [r3, 0xB] - lsls r1, 8 - orrs r2, r1 - ldrb r1, [r3, 0xC] - lsls r1, 16 - orrs r2, r1 - ldrb r1, [r3, 0xD] - lsls r1, 24 - orrs r2, r1 - cmp r0, r2 - bne _0806E91C - movs r4, 0 - ldrb r0, [r5] - cmp r0, 0xFF - beq _0806E912 - adds r2, r5, 0 -_0806E8FE: - adds r1, r3, r4 - ldrb r0, [r2] - ldrb r1, [r1] - cmp r0, r1 - bne _0806E91C - adds r2, 0x1 - adds r4, 0x1 - ldrb r0, [r2] - cmp r0, 0xFF - bne _0806E8FE -_0806E912: - movs r0, 0 - b _0806E91E - .pool -_0806E91C: - movs r0, 0x1 -_0806E91E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_806E8D4 - - thumb_func_start sub_806E924 -sub_806E924: @ 806E924 - push {lr} - bl pokemon_restore_pp - pop {r0} - bx r0 - thumb_func_end sub_806E924 - - thumb_func_start pokemon_restore_pp -pokemon_restore_pp: @ 806E930 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - movs r6, 0 -_0806E938: - adds r4, r6, 0 - adds r4, 0xD - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0 - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _0806E984 - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0 - bl pokemon_getattr_encrypted - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr_encrypted - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r2, r6, 24 - lsrs r2, 24 - adds r0, r4, 0 - bl CalcPPWithPPUps - mov r1, sp - strb r0, [r1] - adds r1, r6, 0 - adds r1, 0x11 - adds r0, r5, 0 - mov r2, sp - bl pokemon_setattr_encrypted -_0806E984: - adds r6, 0x1 - cmp r6, 0x3 - ble _0806E938 - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end pokemon_restore_pp - - thumb_func_start sub_806E994 -sub_806E994: @ 806E994 - push {r4,r5,lr} - ldr r2, =0x0202420a - ldr r5, =0x0202449c - ldr r1, [r5] - adds r0, r1, 0 - adds r0, 0xB0 - ldrb r0, [r0] - strb r0, [r2] - ldr r4, =0x02022f58 - movs r0, 0xFD - strb r0, [r4] - movs r0, 0x4 - strb r0, [r4, 0x1] - adds r1, 0x49 - ldrb r0, [r1] - strb r0, [r4, 0x2] - movs r0, 0xFF - strb r0, [r4, 0x4] - ldrb r0, [r1] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0806E9E8 - ldr r1, =0x0202406e - ldr r0, [r5] - adds r0, 0x49 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrb r0, [r0] - bl pokemon_order_func - b _0806E9F6 - .pool -_0806E9E8: - ldr r1, =0x0202406e - ldr r0, [r5] - adds r0, 0x49 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] -_0806E9F6: - strb r0, [r4, 0x3] - ldr r4, =0x02022f68 - movs r0, 0xFD - strb r0, [r4] - movs r0, 0x4 - strb r0, [r4, 0x1] - ldr r1, =0x020244b8 - ldrb r0, [r1] - strb r0, [r4, 0x2] - ldr r2, =0x0202406e - ldrb r0, [r1] - lsls r0, 1 - adds r0, r2 - ldrb r0, [r0] - bl pokemon_order_func - strb r0, [r4, 0x3] - movs r0, 0xFF - strb r0, [r4, 0x4] - ldr r0, =gUnknown_085CB2A1 - ldr r1, =0x02021fc4 - bl get_battle_strings - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806E994 - - thumb_func_start sub_806EA40 -sub_806EA40: @ 806EA40 - push {lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r1, 0 - ldr r2, =gUnknown_08329EFC -_0806EA4A: - ldrh r0, [r2] - cmp r0, r3 - bne _0806EA58 - adds r0, r1, 0 - b _0806EA62 - .pool -_0806EA58: - adds r2, 0x4 - adds r1, 0x1 - cmp r1, 0x8 - ble _0806EA4A - movs r0, 0 -_0806EA62: - pop {r1} - bx r1 - thumb_func_end sub_806EA40 - - thumb_func_start sub_806EA68 -sub_806EA68: @ 806EA68 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x00302008 - ands r0, r1 - cmp r0, 0 - beq _0806EA7C - b _0806EB90 -_0806EA7C: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =0x02024744 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x2D - mov r8, r0 - movs r7, 0x5F - ldr r5, =0x020244ec - adds r0, r5, 0 - movs r1, 0x6 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - bne _0806EAC6 - adds r0, r5, 0 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE - bne _0806EAC6 - movs r2, 0x14 - mov r8, r2 - movs r7, 0x50 -_0806EAC6: - ldr r0, =0x02037318 - ldrh r1, [r0, 0x12] - movs r0, 0xD2 - lsls r0, 1 - cmp r1, r0 - bne _0806EB2C - adds r0, r4, 0 - bl sub_806EA40 - adds r2, r0, 0 - cmp r2, 0 - beq _0806EB04 - cmp r6, r7 - bcc _0806EB90 - ldr r0, =0x02024744 - lsls r2, 2 - ldr r1, =gUnknown_08329EFE - b _0806EB6C - .pool -_0806EB04: - cmp r6, r8 - bcc _0806EB90 - cmp r6, r7 - bcs _0806EB18 - ldr r0, =0x02024744 - lsls r2, r4, 3 - b _0806EB66 - .pool -_0806EB18: - ldr r0, =0x02024744 - lsls r2, r4, 3 - subs r2, r4 - lsls r2, 2 - ldr r1, =gBaseStats + 0xe @ item 2 offset - b _0806EB6C - .pool -_0806EB2C: - ldr r0, =gBaseStats - mov r12, r0 - lsls r0, r4, 3 - subs r1, r0, r4 - lsls r5, r1, 2 - mov r2, r12 - adds r1, r5, r2 - ldrh r3, [r1, 0xC] - adds r2, r0, 0 - ldrh r1, [r1, 0xE] - cmp r3, r1 - bne _0806EB5C - cmp r3, 0 - beq _0806EB5C - ldr r0, =0x02024744 - mov r2, r12 - adds r2, 0xC - adds r2, r5, r2 - b _0806EB6E - .pool -_0806EB5C: - cmp r6, r8 - bcc _0806EB90 - cmp r6, r7 - bcs _0806EB80 - ldr r0, =0x02024744 -_0806EB66: - subs r2, r4 - lsls r2, 2 - ldr r1, =gBaseStats + 0xc @ item 1 offset -_0806EB6C: - adds r2, r1 -_0806EB6E: - movs r1, 0xC - bl pokemon_setattr - b _0806EB90 - .pool -_0806EB80: - ldr r0, =0x02024744 - subs r2, r4 - lsls r2, 2 - ldr r1, =gBaseStats + 0xe @ item 2 offset - adds r2, r1 - movs r1, 0xC - bl pokemon_setattr -_0806EB90: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806EA68 - - thumb_func_start sub_806EBA4 -sub_806EBA4: @ 806EBA4 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x1 - movs r2, 0 - bl pokemon_getattr - adds r5, r0, 0 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - adds r0, r5, 0 - bl sub_806EBD0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_806EBA4 - - thumb_func_start sub_806EBD0 -sub_806EBD0: @ 806EBD0 - push {r4,lr} - movs r4, 0 - lsrs r2, r0, 16 - ldr r3, =0x0000ffff - ands r0, r3 - eors r2, r0 - lsrs r0, r1, 16 - eors r2, r0 - ands r1, r3 - eors r2, r1 - cmp r2, 0x7 - bhi _0806EBEA - movs r4, 0x1 -_0806EBEA: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806EBD0 - - thumb_func_start sub_806EBF8 -sub_806EBF8: @ 806EBF8 - push {r4,lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _0806EC3C - ldr r2, =0x02038bce - ldrh r1, [r2] - ldr r0, =0x00000c03 - cmp r1, r0 - bne _0806EC28 - ldr r0, =gTrainers + TRAINER_STEVEN * 0x28 + 0x4 @ Steven's name - b _0806EC64 - .pool -_0806EC28: - ldr r4, =0x02021cc4 - ldrh r1, [r2] - adds r0, r4, 0 - bl sub_8162E20 - adds r0, r4, 0 - b _0806EC64 - .pool -_0806EC3C: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x020229e8 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x18] - movs r0, 0x2 - eors r0, r1 - bl sub_806D864 - adds r1, r0, 0 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r4, 0x8 - adds r0, r4 -_0806EC64: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806EBF8 - - thumb_func_start sub_806EC70 -sub_806EC70: @ 806EC70 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r1 - ldrh r0, [r2, 0xE] - subs r0, 0x1 - strh r0, [r2, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _0806ECA0 - ldrh r0, [r2, 0x8] - ldrh r1, [r2, 0xA] - lsls r1, 16 - orrs r0, r1 - ldrb r1, [r2, 0xC] - bl sub_817F544 - adds r0, r4, 0 - bl DestroyTask -_0806ECA0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806EC70 - - thumb_func_start sub_806ECAC -sub_806ECAC: @ 806ECAC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r1 - ldrh r0, [r2, 0xE] - subs r0, 0x1 - strh r0, [r2, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _0806ECE2 - ldrh r0, [r2, 0x8] - ldrh r1, [r2, 0xA] - lsls r1, 16 - orrs r0, r1 - ldrb r1, [r2, 0xC] - bl sub_817F578 - movs r0, 0xFF - bl sub_81C488C - adds r0, r4, 0 - bl DestroyTask -_0806ECE2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806ECAC - - thumb_func_start sub_806ECEC -sub_806ECEC: @ 806ECEC - push {r4,r5,lr} - adds r5, r0, 0 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0806ED30 - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x02000002 - ands r0, r1 - cmp r0, 0 - bne _0806ED30 - movs r0, 0x80 - orrs r3, r0 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_806ED40 - b _0806ED38 - .pool -_0806ED30: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_806ED40 -_0806ED38: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_806ECEC - - thumb_func_start sub_806ED40 -sub_806ED40: @ 806ED40 - push {r4-r6,lr} - adds r5, r0, 0 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x7F - ands r0, r3 - cmp r0, 0 - beq _0806ED60 - cmp r0, 0x1 - beq _0806ED64 - movs r1, 0 - b _0806ED66 -_0806ED60: - movs r1, 0xE7 - b _0806ED66 -_0806ED64: - movs r1, 0x19 -_0806ED66: - movs r0, 0x80 - ands r0, r3 - cmp r0, 0 - beq _0806ED84 - cmp r2, 0 - bne _0806ED7C - lsls r1, 24 - asrs r1, 24 - adds r0, r4, 0 - bl cry_related -_0806ED7C: - ldr r0, =DummyObjectCallback - b _0806EDFA - .pool -_0806ED84: - cmp r2, 0 - bne _0806EDA6 - lsls r1, 24 - asrs r1, 24 - adds r0, r4, 0 - bl cry_related - adds r0, r4, 0 - bl sub_806F0D4 - lsls r0, 24 - cmp r0, 0 - beq _0806EDA6 - adds r0, r5, 0 - movs r1, 0x1 - bl StartObjectImageAnim -_0806EDA6: - ldr r0, =gUnknown_08329B87 - subs r4, 0x1 - adds r6, r4, r0 - ldrb r0, [r6] - cmp r0, 0 - beq _0806EDEC - ldr r0, =sub_806EC70 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r5, [r1, 0x8] - lsrs r0, r5, 16 - strh r0, [r1, 0xA] - ldr r0, =gUnknown_083299EC - adds r0, r4, r0 - ldrb r0, [r0] - strh r0, [r1, 0xC] - ldrb r0, [r6] - strh r0, [r1, 0xE] - b _0806EDF8 - .pool -_0806EDEC: - ldr r0, =gUnknown_083299EC - adds r0, r4, r0 - ldrb r1, [r0] - adds r0, r5, 0 - bl sub_817F544 -_0806EDF8: - ldr r0, =nullsub_18 -_0806EDFA: - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806ED40 - - thumb_func_start sub_806EE0C -sub_806EE0C: @ 806EE0C - push {r4-r6,lr} - adds r5, r0, 0 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 24 - cmp r2, 0 - bne _0806EE2E - adds r0, r4, 0 - bl sub_806F0D4 - lsls r0, 24 - cmp r0, 0 - beq _0806EE2E - adds r0, r5, 0 - movs r1, 0x1 - bl StartObjectImageAnim -_0806EE2E: - ldr r0, =gUnknown_08329B87 - subs r4, 0x1 - adds r6, r4, r0 - ldrb r0, [r6] - cmp r0, 0 - beq _0806EE80 - ldr r0, =sub_806ECAC - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - adds r2, r1 - strh r5, [r2, 0x8] - lsrs r1, r5, 16 - strh r1, [r2, 0xA] - ldr r1, =gUnknown_083299EC - adds r1, r4, r1 - ldrb r1, [r1] - strh r1, [r2, 0xC] - ldrb r1, [r6] - strh r1, [r2, 0xE] - bl sub_81C488C - adds r0, r5, 0 - bl sub_817F60C - b _0806EE8C - .pool -_0806EE80: - ldr r0, =gUnknown_083299EC - adds r0, r4, r0 - ldrb r1, [r0] - adds r0, r5, 0 - bl sub_817F578 -_0806EE8C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806EE0C - - thumb_func_start sub_806EE98 -sub_806EE98: @ 806EE98 - push {lr} - ldr r0, =sub_806ECAC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _0806EEAC - bl DestroyTask -_0806EEAC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_806EE98 - - thumb_func_start sub_806EEB4 -sub_806EEB4: @ 806EEB4 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r2, r1, 16 - ldr r0, =0x02024280 - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0806EEE8 - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x02000002 - ands r0, r1 - cmp r0, 0 - bne _0806EEE8 - ldr r0, =DummyObjectCallback - b _0806EEFC - .pool -_0806EEE8: - adds r0, r2, 0 - bl sub_817F474 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_817F594 - ldr r0, =nullsub_18 -_0806EEFC: - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806EEB4 - - thumb_func_start sub_806EF08 -sub_806EF08: @ 806EF08 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r5, 0 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x020229e8 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x18] - cmp r0, 0x1 - beq _0806EF4C - cmp r0, 0x1 - bgt _0806EF38 - cmp r0, 0 - beq _0806EF42 - b _0806EF56 - .pool -_0806EF38: - cmp r0, 0x2 - beq _0806EF42 - cmp r0, 0x3 - beq _0806EF4C - b _0806EF56 -_0806EF42: - movs r5, 0x3 - cmp r4, 0 - beq _0806EF56 - movs r5, 0x1 - b _0806EF56 -_0806EF4C: - negs r0, r4 - orrs r0, r4 - asrs r5, r0, 31 - movs r0, 0x2 - ands r5, r0 -_0806EF56: - movs r2, 0 - ldr r4, =0x020229e8 - ldrh r0, [r4, 0x18] - adds r1, r5, 0 - cmp r0, r1 - beq _0806EF74 - adds r3, r1, 0 - adds r1, r4, 0 -_0806EF66: - adds r1, 0x1C - adds r2, 0x1 - cmp r2, 0x3 - bgt _0806EF74 - ldrh r0, [r1, 0x18] - cmp r0, r3 - bne _0806EF66 -_0806EF74: - lsls r0, r2, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806EF08 - - thumb_func_start sub_806EF84 -sub_806EF84: @ 806EF84 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 24 - lsrs r1, 24 - movs r4, 0 - ldr r2, =0x020229e8 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x18] - cmp r0, 0x1 - beq _0806EFC4 - cmp r0, 0x1 - bgt _0806EFB0 - cmp r0, 0 - beq _0806EFBA - b _0806EFCE - .pool -_0806EFB0: - cmp r0, 0x2 - beq _0806EFBA - cmp r0, 0x3 - beq _0806EFC4 - b _0806EFCE -_0806EFBA: - movs r4, 0x3 - cmp r3, 0 - beq _0806EFCE - movs r4, 0x1 - b _0806EFCE -_0806EFC4: - negs r0, r3 - orrs r0, r3 - asrs r4, r0, 31 - movs r0, 0x2 - ands r4, r0 -_0806EFCE: - movs r3, 0 - ldrh r0, [r2, 0x18] - adds r1, r4, 0 - cmp r0, r1 - beq _0806EFE6 -_0806EFD8: - adds r2, 0x1C - adds r3, 0x1 - cmp r3, 0x3 - bgt _0806EFE6 - ldrh r0, [r2, 0x18] - cmp r0, r1 - bne _0806EFD8 -_0806EFE6: - lsls r0, r3, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_806EF84 - - thumb_func_start TrainerClassToTrainerPic -@ u8 TrainerClassToTrainerPic(u16 trainerClassId) -TrainerClassToTrainerPic: @ 806EFF0 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gTrainerPicIndices - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end TrainerClassToTrainerPic - - thumb_func_start sub_806F000 -sub_806F000: @ 806F000 - push {lr} - lsls r0, 24 - cmp r0, 0 - bne _0806F00C - movs r0, 0x3C - b _0806F00E -_0806F00C: - movs r0, 0x3F -_0806F00E: - bl TrainerClassToTrainerPic - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_806F000 - - thumb_func_start SetPokedexFlag -@ void SetPokedexFlag(u16 nationalPokedexNum, u8 op, u32 personality) -SetPokedexFlag: @ 806F01C - push {r4-r7,lr} - adds r7, r2, 0 - lsls r0, 16 - lsrs r4, r0, 16 - adds r6, r4, 0 - lsls r1, 24 - lsrs r5, r1, 24 - movs r0, 0x2 - eors r0, r5 - negs r1, r0 - orrs r1, r0 - lsrs r1, 31 - adds r0, r4, 0 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - bne _0806F072 - adds r0, r4, 0 - adds r1, r5, 0 - bl pokedex_flag_operation - adds r0, r4, 0 - bl NationalPokedexNumToSpecies - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xC9 - bne _0806F05C - ldr r0, =0x03005d90 - ldr r0, [r0] - str r7, [r0, 0x1C] -_0806F05C: - adds r0, r6, 0 - bl NationalPokedexNumToSpecies - lsls r0, 16 - movs r1, 0x9A - lsls r1, 17 - cmp r0, r1 - bne _0806F072 - ldr r0, =0x03005d90 - ldr r0, [r0] - str r7, [r0, 0x20] -_0806F072: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end SetPokedexFlag - - thumb_func_start sub_806F07C -sub_806F07C: @ 806F07C - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =0x00000356 - cmp r2, r0 - bls _0806F08A - movs r2, 0 -_0806F08A: - ldr r1, =gTrainers - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x1] - movs r0, 0xD - muls r0, r1 - ldr r1, =gTrainerClassNames - adds r0, r1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_806F07C - - thumb_func_start sub_806F0B0 -sub_806F0B0: @ 806F0B0 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x00000356 - cmp r1, r0 - bls _0806F0BE - movs r1, 0 -_0806F0BE: - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =gTrainers + 0x4 @ name offset - adds r0, r1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_806F0B0 - - thumb_func_start sub_806F0D4 -sub_806F0D4: @ 806F0D4 - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - movs r1, 0 - ldr r0, =0x00000181 - cmp r2, r0 - beq _0806F0F8 - adds r0, 0x19 - cmp r2, r0 - beq _0806F0F8 - subs r0, 0x66 - cmp r2, r0 - beq _0806F0F8 - movs r1, 0xC9 - eors r1, r2 - negs r0, r1 - orrs r0, r1 - lsrs r1, r0, 31 -_0806F0F8: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_806F0D4 - - thumb_func_start sub_806F104 -sub_806F104: @ 806F104 - push {lr} - ldr r2, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0806F122 - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x003f0100 - ands r0, r1 - cmp r0, 0 - bne _0806F144 -_0806F122: - ldr r1, =0x00000439 - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0806F158 - bl InBattlePike - lsls r0, 24 - cmp r0, 0 - bne _0806F144 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0806F158 -_0806F144: - movs r0, 0x1 - b _0806F15A - .pool -_0806F158: - movs r0, 0 -_0806F15A: - pop {r1} - bx r1 - thumb_func_end sub_806F104 - - thumb_func_start sub_806F160 -sub_806F160: @ 806F160 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r6, r0, 0 - ldrb r0, [r6] - lsls r0, 28 - movs r4, 0 - cmp r0, 0 - beq _0806F1EA -_0806F176: - ldr r0, [r6, 0xC] - lsls r2, r4, 1 - adds r1, r2, r4 - lsls r1, 3 - adds r0, r1, r0 - ldr r3, =gUnknown_08329D98 - adds r1, r3 - ldm r1!, {r3,r5,r7} - stm r0!, {r3,r5,r7} - ldm r1!, {r3,r5,r7} - stm r0!, {r3,r5,r7} - movs r5, 0 - ldrb r3, [r6, 0x1] - ldr r7, [r6, 0xC] - mov r9, r7 - mov r8, r2 - ldr r0, [r6, 0x10] - mov r12, r0 - adds r1, r4, 0x1 - mov r10, r1 - cmp r5, r3 - bcs _0806F1C8 - mov r7, r12 - ldr r1, [r6, 0x8] - lsls r0, r4, 2 - adds r0, r1 - ldr r2, [r0] -_0806F1AC: - adds r0, r4, 0 - muls r0, r3 - adds r0, r5 - lsls r0, 3 - adds r0, r7 - lsls r1, r5, 11 - adds r1, r2, r1 - str r1, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldrb r3, [r6, 0x1] - cmp r5, r3 - bcc _0806F1AC -_0806F1C8: - mov r3, r8 - adds r1, r3, r4 - lsls r1, 3 - add r1, r9 - ldrb r0, [r6, 0x1] - muls r0, r4 - lsls r0, 3 - add r0, r12 - str r0, [r1, 0xC] - mov r5, r10 - lsls r0, r5, 16 - lsrs r4, r0, 16 - ldrb r0, [r6] - lsls r0, 28 - lsrs r0, 28 - cmp r4, r0 - blt _0806F176 -_0806F1EA: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806F160 - - thumb_func_start sub_806F1FC -sub_806F1FC: @ 806F1FC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r4, r0, 0 - ldrb r0, [r4] - lsls r0, 28 - movs r3, 0 - cmp r0, 0 - beq _0806F296 - ldr r0, =gUnknown_08329F28 - mov r10, r0 -_0806F216: - ldr r0, [r4, 0xC] - lsls r2, r3, 1 - adds r1, r2, r3 - lsls r1, 3 - adds r1, r0 - mov r0, r10 - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - movs r5, 0 - ldr r0, [r4, 0xC] - mov r8, r0 - mov r12, r2 - ldr r7, [r4, 0x10] - adds r1, r3, 0x1 - mov r9, r1 - ldrb r6, [r4, 0x1] - cmp r5, r6 - bcs _0806F26A - adds r6, r7, 0 - ldr r1, [r4, 0x8] - lsls r0, r3, 2 - adds r0, r1 - ldr r2, [r0] -_0806F248: - ldrb r0, [r4] - lsls r0, 28 - lsrs r0, 28 - adds r1, r3, 0 - muls r1, r0 - adds r1, r5 - lsls r1, 3 - adds r1, r6 - lsls r0, r5, 11 - adds r0, r2, r0 - str r0, [r1] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldrb r0, [r4, 0x1] - cmp r5, r0 - bcc _0806F248 -_0806F26A: - mov r5, r12 - adds r1, r5, r3 - lsls r1, 3 - add r1, r8 - ldrb r0, [r4] - lsls r0, 28 - lsrs r0, 28 - muls r0, r3 - lsls r0, 3 - adds r0, r7, r0 - str r0, [r1, 0xC] - ldr r6, =gUnknown_082FF70C - str r6, [r1, 0x8] - strh r3, [r1, 0x2] - mov r7, r9 - lsls r0, r7, 16 - lsrs r3, r0, 16 - ldrb r0, [r4] - lsls r0, 28 - lsrs r0, 28 - cmp r3, r0 - blt _0806F216 -_0806F296: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806F1FC - - thumb_func_start sub_806F2AC -sub_806F2AC: @ 806F2AC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - movs r7, 0 - movs r0, 0x1 - ands r6, r0 - movs r0, 0x14 - bl AllocZeroed - adds r4, r0, 0 - cmp r4, 0 - bne _0806F2D0 - movs r0, 0 - b _0806F46E -_0806F2D0: - cmp r5, 0 - beq _0806F2E6 - cmp r5, 0x2 - bne _0806F2E6 - movs r0, 0x77 - strb r0, [r4] - movs r0, 0x4 - strb r0, [r4, 0x1] - movs r0, 0x21 - strb r0, [r4, 0x3] - b _0806F30E -_0806F2E6: - ldrb r1, [r4] - movs r2, 0x10 - negs r2, r2 - adds r0, r2, 0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - movs r3, 0xF - ands r0, r3 - movs r1, 0x40 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x4 - strb r0, [r4, 0x1] - ldrb r0, [r4, 0x3] - ands r2, r0 - movs r0, 0x1 - orrs r2, r0 - ands r2, r3 - strb r2, [r4, 0x3] -_0806F30E: - ldrb r1, [r4, 0x3] - lsls r1, 28 - lsrs r1, 28 - ldrb r0, [r4] - lsls r0, 28 - lsrs r0, 15 - muls r0, r1 - bl AllocZeroed - str r0, [r4, 0x4] - ldrb r0, [r4] - lsls r0, 28 - lsrs r0, 23 - bl AllocZeroed - adds r1, r0, 0 - str r1, [r4, 0x8] - ldr r2, [r4, 0x4] - cmp r2, 0 - beq _0806F33A - cmp r1, 0 - bne _0806F344 -_0806F33A: - movs r0, 0x1 - orrs r7, r0 - lsls r6, 2 - mov r8, r6 - b _0806F378 -_0806F344: - ldrb r0, [r4] - lsls r0, 28 - movs r3, 0 - lsls r6, 2 - mov r8, r6 - cmp r0, 0 - beq _0806F378 - adds r6, r1, 0 - adds r5, r2, 0 -_0806F356: - lsls r2, r3, 2 - adds r2, r6 - ldrb r0, [r4, 0x3] - lsls r0, 28 - lsrs r0, 28 - lsls r1, r3, 13 - muls r0, r1 - adds r0, r5, r0 - str r0, [r2] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldrb r0, [r4] - lsls r0, 28 - lsrs r0, 28 - cmp r3, r0 - blt _0806F356 -_0806F378: - ldrb r1, [r4] - lsls r1, 28 - lsrs r1, 28 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - bl AllocZeroed - str r0, [r4, 0xC] - ldrb r1, [r4] - lsls r1, 28 - lsrs r1, 28 - ldrb r0, [r4, 0x1] - lsls r0, 3 - muls r0, r1 - bl AllocZeroed - adds r1, r0, 0 - str r1, [r4, 0x10] - ldr r0, [r4, 0xC] - cmp r0, 0 - beq _0806F3A8 - cmp r1, 0 - bne _0806F3B2 -_0806F3A8: - movs r0, 0x2 - orrs r7, r0 - lsls r0, r7, 24 - lsrs r7, r0, 24 - b _0806F400 -_0806F3B2: - movs r3, 0 - ldrb r0, [r4, 0x1] - ldrb r1, [r4] - lsls r1, 28 - lsrs r1, 28 - muls r0, r1 - cmp r3, r0 - bge _0806F3E2 - movs r2, 0x80 - lsls r2, 4 -_0806F3C6: - ldr r1, [r4, 0x10] - lsls r0, r3, 3 - adds r0, r1 - strh r2, [r0, 0x4] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldrb r1, [r4, 0x1] - ldrb r0, [r4] - lsls r0, 28 - lsrs r0, 28 - muls r0, r1 - cmp r3, r0 - blt _0806F3C6 -_0806F3E2: - ldrb r0, [r4, 0x3] - lsrs r0, 4 - cmp r0, 0 - blt _0806F3FA - cmp r0, 0x1 - ble _0806F3FA - cmp r0, 0x2 - bne _0806F3FA - adds r0, r4, 0 - bl sub_806F1FC - b _0806F400 -_0806F3FA: - adds r0, r4, 0 - bl sub_806F160 -_0806F400: - movs r0, 0x2 - ands r0, r7 - cmp r0, 0 - beq _0806F424 - ldr r0, [r4, 0x10] - cmp r0, 0 - beq _0806F416 - bl Free - movs r0, 0 - str r0, [r4, 0x10] -_0806F416: - ldr r0, [r4, 0xC] - cmp r0, 0 - beq _0806F424 - bl Free - movs r0, 0 - str r0, [r4, 0xC] -_0806F424: - movs r0, 0x1 - ands r0, r7 - cmp r0, 0 - beq _0806F448 - ldr r0, [r4, 0x8] - cmp r0, 0 - beq _0806F43A - bl Free - movs r0, 0 - str r0, [r4, 0x8] -_0806F43A: - ldr r0, [r4, 0x4] - cmp r0, 0 - beq _0806F448 - bl Free - movs r0, 0 - str r0, [r4, 0x4] -_0806F448: - cmp r7, 0 - beq _0806F45E - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x14 - bl memset - adds r0, r4, 0 - bl Free - b _0806F468 -_0806F45E: - movs r0, 0xA3 - strb r0, [r4, 0x2] - ldr r0, =0x020249b4 - add r0, r8 - str r4, [r0] -_0806F468: - ldr r0, =0x020249b4 - add r0, r8 - ldr r0, [r0] -_0806F46E: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806F2AC - - thumb_func_start sub_806F47C -sub_806F47C: @ 806F47C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - ands r0, r1 - ldr r1, =0x020249b4 - lsls r0, 2 - adds r0, r1 - ldr r4, [r0] - cmp r4, 0 - beq _0806F4F0 - ldrb r0, [r4, 0x2] - cmp r0, 0xA3 - beq _0806F4A8 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x14 - bl memset - b _0806F4F0 - .pool -_0806F4A8: - ldr r0, [r4, 0x10] - cmp r0, 0 - beq _0806F4B6 - bl Free - movs r0, 0 - str r0, [r4, 0x10] -_0806F4B6: - ldr r0, [r4, 0xC] - cmp r0, 0 - beq _0806F4C4 - bl Free - movs r0, 0 - str r0, [r4, 0xC] -_0806F4C4: - ldr r0, [r4, 0x8] - cmp r0, 0 - beq _0806F4D2 - bl Free - movs r0, 0 - str r0, [r4, 0x8] -_0806F4D2: - ldr r0, [r4, 0x4] - cmp r0, 0 - beq _0806F4E0 - bl Free - movs r0, 0 - str r0, [r4, 0x4] -_0806F4E0: - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x14 - bl memset - adds r0, r4, 0 - bl Free -_0806F4F0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_806F47C - - thumb_func_start sub_806F4F8 -sub_806F4F8: @ 806F4F8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r3, r1, 24 - ldr r2, =0x020249b4 - movs r1, 0x1 - ands r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, [r0] - ldrb r0, [r1, 0x2] - cmp r0, 0xA3 - beq _0806F51C - movs r0, 0 - b _0806F530 - .pool -_0806F51C: - ldrb r0, [r1] - lsls r0, 28 - lsrs r0, 28 - cmp r3, r0 - blt _0806F528 - movs r3, 0 -_0806F528: - ldr r0, [r1, 0x8] - lsls r1, r3, 2 - adds r1, r0 - ldr r0, [r1] -_0806F530: - pop {r1} - bx r1 - thumb_func_end sub_806F4F8 - - thumb_func_start sine -@ s16 sine(s16 t, s16 amplitude) -sine: @ 806F534 - lsls r1, 16 - asrs r1, 16 - ldr r2, =gUnknown_08329F40 - lsls r0, 16 - asrs r0, 15 - adds r0, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - muls r0, r1 - lsls r0, 8 - asrs r0, 16 - bx lr - .pool - thumb_func_end sine - - thumb_func_start cosine -@ s16 cosine(s16 t, s16 amplitude) -cosine: @ 806F550 - lsls r1, 16 - asrs r1, 16 - ldr r2, =gUnknown_08329F40 - lsls r0, 16 - asrs r0, 15 - adds r0, 0x80 - adds r0, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - muls r0, r1 - lsls r0, 8 - asrs r0, 16 - bx lr - .pool - thumb_func_end cosine - - thumb_func_start sine2 -@ s16 sine2(u16 angle) -sine2: @ 806F570 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r5, 0 - movs r1, 0xB4 - bl __umodsi3 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0xB4 - bl __udivsi3 - movs r1, 0x1 - ands r0, r1 - ldr r1, =gUnknown_0832A1C0 - lsls r4, 1 - adds r4, r1 - ldrh r1, [r4] - cmp r0, 0 - bne _0806F5A8 - lsls r0, r1, 16 - b _0806F5AC - .pool -_0806F5A8: - lsls r0, r1, 16 - negs r0, r0 -_0806F5AC: - asrs r0, 16 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sine2 - - thumb_func_start cosine2 -@ s16 cosine2(u16 angle) -cosine2: @ 806F5B4 - push {lr} - lsls r0, 16 - movs r1, 0xB4 - lsls r1, 15 - adds r0, r1 - lsrs r0, 16 - bl sine2 - lsls r0, 16 - asrs r0, 16 - pop {r1} - bx r1 - thumb_func_end cosine2 - - thumb_func_start GenerateRandomNumber -@ u16 GenerateRandomNumber() -GenerateRandomNumber: @ 806F5CC - ldr r2, =0x03005d80 - ldr r1, [r2] - ldr r0, =0x41c64e6d - muls r0, r1 - ldr r1, =0x00006073 - adds r0, r1 - str r0, [r2] - ldr r2, =0x020249c0 - ldr r1, [r2] - adds r1, 0x1 - str r1, [r2] - lsrs r0, 16 - bx lr - .pool - thumb_func_end GenerateRandomNumber - - thumb_func_start SeedRng -@ void SeedRng(u16 seed) -SeedRng: @ 806F5F8 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x03005d80 - str r0, [r1] - ldr r1, =0x020249bc - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end SeedRng - - thumb_func_start SeedRng2 -SeedRng2: @ 806F610 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x03005d84 - str r0, [r1] - bx lr - .pool - thumb_func_end SeedRng2 - - thumb_func_start GenerateRandomNumber2 -GenerateRandomNumber2: @ 806F620 - ldr r2, =0x03005d84 - ldr r1, [r2] - ldr r0, =0x41c64e6d - muls r0, r1 - ldr r1, =0x00006073 - adds r0, r1 - str r0, [r2] - lsrs r0, 16 - bx lr - .pool - thumb_func_end GenerateRandomNumber2 - - thumb_func_start object_new_hidden_with_callback -object_new_hidden_with_callback: @ 806F640 - push {r4-r6,lr} - adds r6, r0, 0 - ldr r0, =gUnknown_0832A3A8 - movs r1, 0xF8 - movs r2, 0xA8 - movs r3, 0xE - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r5, =0x02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r3, r2, r5 - adds r3, 0x3E - ldrb r1, [r3] - movs r4, 0x4 - orrs r1, r4 - strb r1, [r3] - adds r5, 0x1C - adds r2, r5 - str r6, [r2] - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end object_new_hidden_with_callback - - thumb_func_start sub_806F67C -sub_806F67C: @ 806F67C - strh r1, [r0] - lsrs r1, 16 - strh r1, [r0, 0x2] - bx lr - thumb_func_end sub_806F67C - - thumb_func_start sub_806F684 -sub_806F684: @ 806F684 - ldrh r2, [r0] - movs r3, 0x2 - ldrsh r0, [r0, r3] - lsls r0, 16 - orrs r2, r0 - str r2, [r1] - bx lr - thumb_func_end sub_806F684 - - thumb_func_start sub_806F694 -sub_806F694: @ 806F694 - 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 - str r1, [r0] - str r2, [r0, 0x4] - strh r3, [r0, 0x8] - strh r4, [r0, 0xA] - strh r5, [r0, 0xC] - strh r6, [r0, 0xE] - mov r1, r8 - strh r1, [r0, 0x10] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_806F694 - - thumb_func_start sub_806F6C0 -sub_806F6C0: @ 806F6C0 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x24 - mov r8, r0 - ldr r0, [sp, 0x38] - ldr r4, [sp, 0x3C] - ldr r5, [sp, 0x40] - ldr r6, [sp, 0x44] - lsls r6, 16 - lsrs r6, 16 - lsls r3, 16 - asrs r3, 16 - lsls r0, 16 - asrs r0, 16 - str r0, [sp] - lsls r4, 16 - asrs r4, 16 - str r4, [sp, 0x4] - lsls r5, 16 - asrs r5, 16 - str r5, [sp, 0x8] - str r6, [sp, 0xC] - add r0, sp, 0x10 - bl sub_806F694 - add r0, sp, 0x10 - mov r1, r8 - movs r2, 0x1 - bl BgAffineSet - add sp, 0x24 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_806F6C0 - - thumb_func_start rfu_MBOOT_CHILD_inheritanceLinkStatus -rfu_MBOOT_CHILD_inheritanceLinkStatus: @ 806F70C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x38 - str r2, [sp, 0x20] - adds r4, r3, 0 - ldr r7, [sp, 0x58] - lsls r0, 24 - lsls r1, 24 - ldr r2, =gUnknown_0832A3C0 - lsrs r1, 23 - lsrs r0, 21 - adds r1, r0 - adds r0, r2, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - str r0, [sp, 0x24] - adds r1, r2 - ldrb r1, [r1] - str r1, [sp, 0x28] - movs r0, 0 - b _0806F88C - .pool -_0806F740: - movs r5, 0 - adds r0, 0x1 - str r0, [sp, 0x30] - b _0806F874 -_0806F748: - ldrh r0, [r4] - ldr r2, =0x000003ff - adds r1, r2, 0 - ands r1, r0 - lsls r1, 5 - mov r8, r1 - movs r2, 0xC0 - lsls r2, 4 - adds r1, r2, 0 - ands r1, r0 - mov r2, sp - strh r0, [r2, 0x34] - cmp r1, 0 - bne _0806F788 - ldr r0, [sp, 0x20] - add r0, r8 - adds r1, r7, 0 - ldr r2, =0x04000008 - bl CpuSet - adds r4, 0x2 - str r4, [sp, 0x2C] - adds r7, 0x20 - mov r10, r7 - adds r5, 0x1 - mov r9, r5 - b _0806F86A - .pool -_0806F788: - movs r0, 0x80 - lsls r0, 4 - cmp r1, r0 - bne _0806F7CC - movs r1, 0 - adds r4, 0x2 - str r4, [sp, 0x2C] - movs r2, 0x20 - adds r2, r7 - mov r10, r2 - adds r5, 0x1 - mov r9, r5 -_0806F7A0: - lsls r4, r1, 24 - asrs r4, 24 - movs r0, 0x7 - subs r0, r4 - lsls r0, 2 - add r0, r8 - ldr r1, [sp, 0x20] - adds r0, r1, r0 - lsls r1, r4, 2 - adds r1, r7, r1 - ldr r2, =0x04000001 - bl CpuSet - adds r4, 0x1 - lsls r4, 24 - lsrs r1, r4, 24 - asrs r4, 24 - cmp r4, 0x7 - ble _0806F7A0 - b _0806F86A - .pool -_0806F7CC: - movs r1, 0 - adds r4, 0x2 - str r4, [sp, 0x2C] - movs r2, 0x20 - adds r2, r7 - mov r10, r2 - adds r5, 0x1 - mov r9, r5 - movs r0, 0xF - mov r12, r0 -_0806F7E0: - movs r2, 0 - lsls r4, r1, 24 - lsls r0, r4, 2 - lsrs r0, 24 - adds r6, r0, 0x3 - mov r1, r8 - adds r5, r1, r0 -_0806F7EE: - lsls r1, r2, 24 - asrs r1, 24 - subs r0, r6, r1 - mov r2, sp - adds r3, r2, r0 - adds r0, r5, r1 - ldr r2, [sp, 0x20] - adds r0, r2, r0 - ldrb r2, [r0] - mov r0, r12 - ands r0, r2 - lsls r0, 4 - lsrs r2, 4 - orrs r0, r2 - strb r0, [r3] - adds r1, 0x1 - lsls r1, 24 - lsrs r2, r1, 24 - asrs r1, 24 - cmp r1, 0x3 - ble _0806F7EE - movs r1, 0x80 - lsls r1, 17 - adds r0, r4, r1 - lsrs r1, r0, 24 - asrs r0, 24 - cmp r0, 0x7 - ble _0806F7E0 - mov r2, sp - ldrh r0, [r2, 0x34] - movs r2, 0x80 - lsls r2, 4 - ands r0, r2 - cmp r0, 0 - beq _0806F860 - movs r1, 0 -_0806F836: - lsls r4, r1, 24 - asrs r4, 24 - movs r0, 0x7 - subs r0, r4 - lsls r0, 2 - add r0, sp - lsls r1, r4, 2 - adds r1, r7, r1 - ldr r2, =0x04000001 - bl CpuSet - adds r4, 0x1 - lsls r4, 24 - lsrs r1, r4, 24 - asrs r4, 24 - cmp r4, 0x7 - ble _0806F836 - b _0806F86A - .pool -_0806F860: - mov r0, sp - adds r1, r7, 0 - ldr r2, =0x04000008 - bl CpuSet -_0806F86A: - ldr r4, [sp, 0x2C] - mov r7, r10 - mov r1, r9 - lsls r0, r1, 24 - lsrs r5, r0, 24 -_0806F874: - ldr r2, [sp, 0x28] - cmp r5, r2 - bcs _0806F87C - b _0806F748 -_0806F87C: - movs r0, 0x20 - ldr r1, [sp, 0x28] - subs r0, r1 - lsls r0, 1 - adds r4, r0 - ldr r2, [sp, 0x30] - lsls r0, r2, 24 - lsrs r0, 24 -_0806F88C: - ldr r1, [sp, 0x24] - cmp r0, r1 - bcs _0806F894 - b _0806F740 -_0806F894: - 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 rfu_MBOOT_CHILD_inheritanceLinkStatus - - thumb_func_start sub_806F8A8 -sub_806F8A8: @ 806F8A8 - push {lr} - adds r2, r0, 0 - movs r1, 0 - movs r3, 0x1 -_0806F8B0: - adds r0, r2, 0 - ands r0, r3 - cmp r0, 0 - beq _0806F8BC - adds r0, r1, 0 - b _0806F8CA -_0806F8BC: - lsrs r2, 1 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1F - bls _0806F8B0 - movs r0, 0 -_0806F8CA: - pop {r1} - bx r1 - thumb_func_end sub_806F8A8 - - thumb_func_start sub_806F8D0 -sub_806F8D0: @ 806F8D0 - push {r4-r7,lr} - adds r7, r0, 0 - adds r4, r1, 0 - ldr r2, =0x00001121 - movs r3, 0 - cmp r3, r4 - bge _0806F91C - movs r6, 0x1 - ldr r0, =0x00008408 - adds r5, r0, 0 -_0806F8E4: - adds r0, r7, r3 - ldrb r0, [r0] - eors r2, r0 - movs r1, 0 - adds r3, 0x1 -_0806F8EE: - adds r0, r2, 0 - ands r0, r6 - cmp r0, 0 - beq _0806F908 - lsrs r0, r2, 1 - eors r0, r5 - lsls r0, 16 - lsrs r2, r0, 16 - b _0806F90A - .pool -_0806F908: - lsrs r2, 1 -_0806F90A: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x7 - bls _0806F8EE - lsls r0, r3, 16 - lsrs r3, r0, 16 - cmp r3, r4 - blt _0806F8E4 -_0806F91C: - mvns r0, r2 - lsls r0, 16 - lsrs r0, 16 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_806F8D0 - - thumb_func_start sub_806F928 -sub_806F928: @ 806F928 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r1, 0 - ldr r2, =0x00001121 - movs r3, 0 - cmp r3, r4 - bcs _0806F956 - ldr r6, =gUnknown_0832A3D8 -_0806F938: - lsrs r1, r2, 8 - adds r0, r5, r3 - ldrb r0, [r0] - eors r2, r0 - lsls r0, r2, 24 - lsrs r0, 23 - adds r0, r6 - ldrh r0, [r0] - adds r2, r0, 0 - eors r2, r1 - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r4 - bcc _0806F938 -_0806F956: - mvns r0, r2 - lsls r0, 16 - lsrs r0, 16 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806F928 - - thumb_func_start sub_806F96C -sub_806F96C: @ 806F96C - push {r4,lr} - adds r4, r0, 0 - movs r3, 0 - movs r2, 0 - cmp r3, r1 - bcs _0806F984 -_0806F978: - adds r0, r4, r2 - ldrb r0, [r0] - adds r3, r0 - adds r2, 0x1 - cmp r2, r1 - bcc _0806F978 -_0806F984: - adds r0, r3, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_806F96C - - thumb_func_start pal_fade_1 -pal_fade_1: @ 806F98C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 16 - lsrs r1, 16 - mov r12, r1 - lsls r2, 24 - lsrs r7, r2, 24 - mov r0, sp - strh r3, [r0] - movs r6, 0 - cmp r6, r12 - bcs _0806FA12 - ldr r0, =0x02037714 - mov r10, r0 - ldr r1, =0x02037b14 - mov r9, r1 -_0806F9BA: - mov r0, r8 - adds r5, r6, r0 - lsls r5, 16 - lsrs r5, 15 - mov r1, r10 - adds r0, r5, r1 - ldr r3, [r0] - lsls r4, r3, 27 - lsls r2, r3, 22 - lsls r3, 17 - add r5, r9 - lsrs r4, 27 - ldr r1, [sp] - lsls r0, r1, 27 - lsrs r0, 27 - subs r0, r4 - muls r0, r7 - asrs r0, 4 - adds r4, r0 - lsrs r2, 27 - lsls r0, r1, 22 - lsrs r0, 27 - subs r0, r2 - muls r0, r7 - asrs r0, 4 - adds r2, r0 - lsls r2, 5 - orrs r4, r2 - lsrs r3, 27 - lsls r1, 17 - lsrs r1, 27 - subs r1, r3 - adds r0, r1, 0 - muls r0, r7 - asrs r0, 4 - adds r3, r0 - lsls r3, 10 - orrs r4, r3 - strh r4, [r5] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, r12 - bcc _0806F9BA -_0806FA12: - 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 pal_fade_1 - - thumb_func_start pokemon_get_nick -pokemon_get_nick: @ 806FA2C - push {r4,lr} - sub sp, 0x14 - adds r4, r1, 0 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - adds r0, r4, 0 - mov r1, sp - bl CopyString_Limit10 - add sp, 0x14 - pop {r4} - pop {r1} - bx r1 - thumb_func_end pokemon_get_nick - - thumb_func_start pokemon_get_nick_ -pokemon_get_nick_: @ 806FA4C - push {r4,lr} - sub sp, 0x14 - adds r4, r1, 0 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr_encrypted - adds r0, r4, 0 - mov r1, sp - bl CopyString_Limit10 - add sp, 0x14 - pop {r4} - pop {r1} - bx r1 - thumb_func_end pokemon_get_nick_ - - thumb_func_start daycare_count_pokemon -daycare_count_pokemon: @ 806FA6C - push {r4-r6,lr} - adds r6, r0, 0 - movs r5, 0 - movs r4, 0 -_0806FA74: - movs r0, 0x8C - muls r0, r4 - adds r0, r6, r0 - movs r1, 0xB - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _0806FA8A - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_0806FA8A: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0806FA74 - adds r0, r5, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end daycare_count_pokemon - - thumb_func_start sub_806FA9C -sub_806FA9C: @ 806FA9C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r9, r0 - mov r10, r1 - movs r7, 0 - movs r5, 0 - mov r6, r10 - adds r6, 0x74 - movs r0, 0x1 - mov r8, r0 -_0806FAB6: - movs r0, 0x8C - muls r0, r5 - mov r1, r9 - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _0806FAE4 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr_encrypted - adds r1, r0, 0 - cmp r1, 0 - bne _0806FAE4 - lsls r0, r5, 1 - adds r0, r6, r0 - b _0806FAEA -_0806FAE4: - lsls r0, r5, 1 - adds r0, r6, r0 - mov r1, r8 -_0806FAEA: - strh r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bls _0806FAB6 - mov r0, r10 - str r7, [r0, 0x70] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_806FA9C - - thumb_func_start daycare_empty_slot -@ u8 daycare_empty_slot(struct daycare_mon *dayCareMons) -daycare_empty_slot: @ 806FB08 - push {r4,r5,lr} - adds r5, r0, 0 - movs r4, 0 -_0806FB0E: - movs r0, 0x8C - muls r0, r4 - adds r0, r5, r0 - movs r1, 0xB - bl pokemon_getattr_encrypted - cmp r0, 0 - bne _0806FB24 - lsls r0, r4, 24 - asrs r0, 24 - b _0806FB32 -_0806FB24: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0806FB0E - movs r0, 0x1 - negs r0, r0 -_0806FB32: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end daycare_empty_slot - - thumb_func_start sub_806FB38 -@ void sub_806FB38(struct pokemon *mon, struct daycare_mon *dayCareMon) -sub_806FB38: @ 806FB38 - push {r4-r6,lr} - adds r6, r0, 0 - adds r5, r1, 0 - bl sub_80D43F0 - lsls r0, 24 - cmp r0, 0 - beq _0806FBBC - adds r0, r5, 0 - adds r0, 0x74 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - adds r4, r5, 0 - adds r4, 0x7C - adds r0, r6, 0 - adds r1, r4, 0 - bl pokemon_get_nick - adds r0, r4, 0 - bl StripExtendedControlCodes - adds r4, 0xB - ldrb r1, [r4] - movs r0, 0x10 - negs r0, r0 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - adds r0, r6, 0 - movs r1, 0x3 - bl pokemon_getattr - lsls r0, 4 - ldrb r2, [r4] - movs r1, 0xF - ands r1, r2 - orrs r1, r0 - strb r1, [r4] - adds r0, r6, 0 - movs r1, 0x40 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005d8c - ldr r1, [r1] - lsls r2, r0, 3 - adds r2, r0 - lsls r2, 2 - adds r1, r2 - adds r0, r5, 0 - adds r0, 0x50 - ldr r2, =0x00002be0 - adds r1, r2 - ldm r1!, {r2-r4} - stm r0!, {r2-r4} - ldm r1!, {r2-r4} - stm r0!, {r2-r4} - ldm r1!, {r2-r4} - stm r0!, {r2-r4} - adds r0, r6, 0 - bl sub_80D4680 -_0806FBBC: - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x50 - bl memcpy - adds r0, r5, 0 - bl pokemon_restore_pp - adds r1, r5, 0 - adds r1, 0x88 - movs r0, 0 - str r0, [r1] - adds r0, r6, 0 - bl zero_pokemon_struct - bl party_compaction - bl calc_player_party_count - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806FB38 - - thumb_func_start daycare_send -@ void daycare_send(struct pokemon *mon, struct daycare_mon *dayCareMons) -daycare_send: @ 806FBF4 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r0, r4, 0 - bl daycare_empty_slot - lsls r0, 24 - asrs r0, 24 - movs r1, 0x8C - muls r0, r1 - adds r4, r0 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_806FB38 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end daycare_send - - thumb_func_start daycare_send_selected_pokemon -daycare_send_selected_pokemon: @ 806FC18 - push {lr} - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x03005d8c - ldr r1, [r1] - ldr r2, =0x00003030 - adds r1, r2 - bl daycare_send - pop {r0} - bx r0 - .pool - thumb_func_end daycare_send_selected_pokemon - - thumb_func_start sub_806FC48 -sub_806FC48: @ 806FC48 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r5, 0 - adds r4, 0x8C - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _0806FC9E - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr_encrypted - adds r6, r0, 0 - cmp r6, 0 - bne _0806FC9E - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x50 - bl memcpy - adds r0, r4, 0 - bl zero_pokemon_boxed_data - adds r4, 0x50 - adds r0, r5, 0 - adds r0, 0x50 - adds r1, r4, 0 - movs r2, 0x38 - bl memcpy - adds r2, r5, 0 - adds r2, 0x88 - movs r0, 0x8A - lsls r0, 1 - adds r1, r5, r0 - ldr r0, [r1] - str r0, [r2] - str r6, [r1] - adds r0, r4, 0 - bl sub_806FF80 -_0806FC9E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_806FC48 - - thumb_func_start sub_806FCA4 -sub_806FCA4: @ 806FCA4 - push {r4-r7,lr} - adds r4, r0, 0 - movs r5, 0 - ldr r7, =0x0000ffff -_0806FCAC: - adds r0, r4, 0 - bl sub_806DF74 - lsls r0, 24 - cmp r0, 0 - beq _0806FCE8 - movs r6, 0x1 - adds r5, 0x1 - b _0806FCD4 - .pool -_0806FCC4: - movs r6, 0 - cmp r0, r7 - bne _0806FCD4 - ldr r0, =0x020244e2 - ldrh r1, [r0] - adds r0, r4, 0 - bl sub_8069424 -_0806FCD4: - adds r0, r4, 0 - adds r1, r6, 0 - bl sub_8069318 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _0806FCC4 - cmp r5, 0x63 - ble _0806FCAC -_0806FCE8: - adds r0, r4, 0 - bl pokemon_calc_effective_stats - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806FCA4 - - thumb_func_start sub_806FCF8 -sub_806FCF8: @ 806FCF8 - push {r4-r7,lr} - sub sp, 0x68 - adds r5, r0, 0 - ldr r1, =0x02021cc4 - bl pokemon_get_nick_ - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr_encrypted - lsls r0, 16 - lsrs r7, r0, 16 - adds r0, r5, 0 - mov r1, sp - bl sub_8069004 - mov r0, sp - movs r1, 0x38 - bl pokemon_getattr - cmp r0, 0x64 - beq _0806FD46 - mov r0, sp - movs r1, 0x19 - bl pokemon_getattr - adds r1, r5, 0 - adds r1, 0x88 - ldr r1, [r1] - adds r0, r1 - str r0, [sp, 0x64] - add r2, sp, 0x64 - mov r0, sp - movs r1, 0x19 - bl pokemon_setattr - mov r0, sp - bl sub_806FCA4 -_0806FD46: - ldr r0, =0x020244ec - movs r1, 0xFA - lsls r1, 1 - adds r6, r0, r1 - adds r0, r6, 0 - mov r1, sp - movs r2, 0x64 - bl memcpy - adds r0, r5, 0 - adds r0, 0x70 - ldrh r0, [r0] - cmp r0, 0 - beq _0806FD74 - adds r4, r5, 0 - adds r4, 0x50 - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_80D460C - adds r0, r4, 0 - bl sub_806FF80 -_0806FD74: - adds r0, r5, 0 - bl zero_pokemon_boxed_data - adds r1, r5, 0 - adds r1, 0x88 - movs r0, 0 - str r0, [r1] - bl party_compaction - bl calc_player_party_count - adds r0, r7, 0 - add sp, 0x68 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806FCF8 - - thumb_func_start sub_806FD9C -sub_806FD9C: @ 806FD9C - push {r4,r5,lr} - adds r5, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x8C - muls r0, r1 - adds r0, r5, r0 - bl sub_806FCF8 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl sub_806FC48 - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_806FD9C - - thumb_func_start sub_806FDC4 -sub_806FDC4: @ 806FDC4 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - ldr r1, =0x020375e0 - ldrb r1, [r1] - bl sub_806FD9C - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end sub_806FDC4 - - thumb_func_start sub_806FDEC -sub_806FDEC: @ 806FDEC - push {r4,r5,lr} - sub sp, 0x54 - adds r4, r0, 0 - adds r5, r1, 0 - mov r0, sp - adds r1, r4, 0 - movs r2, 0x50 - bl memcpy - adds r0, r4, 0 - movs r1, 0x19 - bl pokemon_getattr_encrypted - adds r0, r5 - str r0, [sp, 0x50] - add r2, sp, 0x50 - mov r0, sp - movs r1, 0x19 - bl pokemon_setattr_encrypted - mov r0, sp - bl sub_80690C0 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x54 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_806FDEC - - thumb_func_start sub_806FE28 -sub_806FE28: @ 806FE28 - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_80690C0 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - adds r0, 0x88 - ldr r1, [r0] - adds r0, r5, 0 - bl sub_806FDEC - lsls r0, 24 - lsrs r0, 24 - subs r0, r4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_806FE28 - - thumb_func_start sub_806FE54 -sub_806FE54: @ 806FE54 - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_806FE28 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x02021dc4 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r1, =0x02021cc4 - adds r0, r5, 0 - bl pokemon_get_nick_ - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806FE54 - - thumb_func_start sub_806FE88 -sub_806FE88: @ 806FE88 - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_806FE28 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =0x02021cc4 - adds r0, r5, 0 - bl pokemon_get_nick_ - movs r0, 0x64 - muls r4, r0 - adds r4, 0x64 - ldr r0, =0x02021dc4 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x5 - bl ConvertIntToDecimalString - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806FE88 - - thumb_func_start sub_806FEC0 -sub_806FEC0: @ 806FEC0 - push {lr} - lsls r1, 24 - lsrs r1, 24 - movs r2, 0x8C - muls r1, r2 - adds r0, r1 - bl sub_806FE88 - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_806FEC0 - - thumb_func_start sub_806FED8 -sub_806FED8: @ 806FED8 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - ldr r1, =0x020375e0 - ldrb r1, [r1] - bl sub_806FEC0 - ldr r1, =0x020375e2 - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_806FED8 - - thumb_func_start sub_806FF04 -sub_806FF04: @ 806FF04 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x03005d8c - ldr r2, [r1] - ldr r1, =0x000030b8 - adds r3, r2, r1 - ldr r1, [r3] - adds r1, r0 - str r1, [r3] - ldr r1, =0x00003144 - adds r2, r1 - ldr r1, [r2] - adds r1, r0 - str r1, [r2] - bx lr - .pool - thumb_func_end sub_806FF04 - - thumb_func_start sub_806FF30 -sub_806FF30: @ 806FF30 - push {r4-r6,lr} - ldr r6, =0x03005d8c - ldr r5, =0x020375e0 - ldrh r0, [r5] - movs r4, 0x8C - adds r1, r0, 0 - muls r1, r4 - ldr r0, =0x00003030 - adds r1, r0 - ldr r0, [r6] - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr_encrypted - cmp r0, 0 - bne _0806FF60 - movs r0, 0 - b _0806FF76 - .pool -_0806FF60: - ldrh r0, [r5] - adds r1, r0, 0 - muls r1, r4 - ldr r0, =0x00003030 - adds r1, r0 - ldr r0, [r6] - adds r0, r1 - bl sub_806FE54 - lsls r0, 24 - lsrs r0, 24 -_0806FF76: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806FF30 - - thumb_func_start sub_806FF80 -sub_806FF80: @ 806FF80 - push {lr} - movs r3, 0 - movs r2, 0x7 - adds r1, r0, 0 - adds r1, 0x2B -_0806FF8A: - strb r3, [r1] - subs r1, 0x1 - subs r2, 0x1 - cmp r2, 0 - bge _0806FF8A - adds r2, r0, 0 - adds r2, 0x2C - movs r3, 0 - adds r1, r0, 0 - adds r1, 0x36 -_0806FF9E: - strb r3, [r1] - subs r1, 0x1 - cmp r1, r2 - bge _0806FF9E - bl sub_80D439C - pop {r0} - bx r0 - thumb_func_end sub_806FF80 - - thumb_func_start sub_806FFB0 -sub_806FFB0: @ 806FFB0 - push {r4,lr} - adds r4, r0, 0 - bl zero_pokemon_boxed_data - adds r1, r4, 0 - adds r1, 0x88 - movs r0, 0 - str r0, [r1] - adds r4, 0x50 - adds r0, r4, 0 - bl sub_806FF80 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_806FFB0 - - thumb_func_start sub_806FFD0 -sub_806FFD0: @ 806FFD0 - push {r4-r6,lr} - adds r5, r0, 0 - movs r4, 0 - movs r6, 0x8C -_0806FFD8: - adds r0, r4, 0 - muls r0, r6 - adds r0, r5, r0 - bl sub_806FFB0 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0806FFD8 - movs r1, 0x8C - lsls r1, 1 - adds r0, r5, r1 - movs r1, 0 - str r1, [r0] - movs r2, 0x8E - lsls r2, 1 - adds r0, r5, r2 - strb r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_806FFD0 - - thumb_func_start sub_8070004 -sub_8070004: @ 8070004 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r2, r0, 16 - movs r0, 0 - mov r8, r0 - ldr r0, =gEvolutionTable - mov r12, r0 -_08070016: - movs r7, 0 - movs r6, 0x1 - movs r4, 0x80 - lsls r4, 9 - movs r5, 0x28 - mov r3, r12 - adds r3, 0x28 -_08070024: - movs r1, 0 - ldrh r0, [r3, 0x4] - cmp r0, r2 - bne _08070034 - lsrs r2, r4, 16 - b _08070060 - .pool -_08070034: - adds r1, 0x1 - cmp r1, 0x4 - bgt _0807004A - lsls r0, r1, 3 - adds r0, r5 - add r0, r12 - ldrh r0, [r0, 0x4] - cmp r0, r2 - bne _08070034 - lsrs r2, r4, 16 - movs r7, 0x1 -_0807004A: - cmp r7, 0 - bne _08070060 - movs r0, 0x80 - lsls r0, 9 - adds r4, r0 - adds r5, 0x28 - adds r3, 0x28 - adds r6, 0x1 - ldr r0, =0x0000019b - cmp r6, r0 - ble _08070024 -_08070060: - movs r0, 0xCE - lsls r0, 1 - cmp r6, r0 - beq _08070072 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x4 - ble _08070016 -_08070072: - adds r0, r2, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8070004 - - thumb_func_start sub_8070084 -sub_8070084: @ 8070084 - push {r4-r7,lr} - sub sp, 0x8 - adds r6, r0, 0 - movs r7, 0x1 - negs r7, r7 - movs r4, 0 -_08070090: - movs r0, 0x8C - muls r0, r4 - adds r0, r6, r0 - bl pokemon_roll_gender - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFE - bne _080700A4 - adds r7, r4, 0 -_080700A4: - adds r4, 0x1 - cmp r4, 0x1 - ble _08070090 - movs r5, 0 - movs r4, 0 -_080700AE: - movs r0, 0x8C - muls r0, r4 - adds r0, r6, r0 - movs r1, 0xB - bl pokemon_getattr_encrypted - lsls r1, r4, 2 - add r1, sp - str r0, [r1] - cmp r0, 0x84 - bne _080700C8 - adds r5, 0x1 - adds r7, r4, 0 -_080700C8: - adds r4, 0x1 - cmp r4, 0x1 - ble _080700AE - cmp r5, 0x2 - bne _080700E2 - bl GenerateRandomNumber - lsls r0, 16 - ldr r1, =0x7ffe0000 - movs r7, 0x1 - cmp r0, r1 - bls _080700E2 - movs r7, 0 -_080700E2: - movs r0, 0x8C - muls r0, r7 - adds r0, r6, r0 - movs r1, 0xC - bl pokemon_getattr_encrypted - cmp r0, 0xC3 - bne _080700FE - bl GenerateRandomNumber - lsls r0, 16 - ldr r1, =0x7ffe0000 - cmp r0, r1 - bls _08070108 -_080700FE: - movs r0, 0x1 - negs r0, r0 - b _0807010A - .pool -_08070108: - adds r0, r7, 0 -_0807010A: - add sp, 0x8 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8070084 - - thumb_func_start sub_8070114 -sub_8070114: @ 8070114 - push {r4-r7,lr} - adds r5, r0, 0 - movs r6, 0 - ldr r0, =0x030022c0 - ldrh r0, [r0, 0x24] - bl SeedRng2 - adds r0, r5, 0 - bl sub_8070084 - adds r1, r0, 0 - cmp r1, 0 - bge _08070160 - bl GenerateRandomNumber2 - adds r4, r0, 0 - bl GenerateRandomNumber - movs r1, 0x8C - lsls r1, 1 - adds r5, r1 - lsls r4, 16 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x0000fffe - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r0, 0x1 - orrs r4, r0 - str r4, [r5] - b _080701AC - .pool -_08070160: - movs r0, 0x8C - muls r0, r1 - adds r0, r5, r0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr_encrypted - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r7, r0, 24 -_08070176: - bl GenerateRandomNumber2 - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsls r0, 16 - lsrs r0, 16 - orrs r4, r0 - adds r0, r4, 0 - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r0, 24 - cmp r7, r0 - bne _0807019A - cmp r4, 0 - bne _080701A4 -_0807019A: - adds r6, 0x1 - movs r0, 0x96 - lsls r0, 4 - cmp r6, r0 - ble _08070176 -_080701A4: - movs r1, 0x8C - lsls r1, 1 - adds r0, r5, r1 - str r4, [r0] -_080701AC: - movs r0, 0x86 - bl FlagSet - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8070114 - - thumb_func_start sub_80701B8 -sub_80701B8: @ 80701B8 - push {r4,lr} - adds r4, r0, 0 - bl GenerateRandomNumber - movs r1, 0x8C - lsls r1, 1 - adds r4, r1 - movs r2, 0x80 - lsls r2, 8 - adds r1, r2, 0 - orrs r0, r1 - lsls r0, 16 - lsrs r0, 16 - str r0, [r4] - movs r0, 0x86 - bl FlagSet - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80701B8 - - thumb_func_start sub_80701E0 -sub_80701E0: @ 80701E0 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl sub_8070114 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80701E0 - - thumb_func_start sub_80701FC -sub_80701FC: @ 80701FC - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl sub_80701B8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80701FC - - thumb_func_start sub_8070218 -sub_8070218: @ 8070218 - push {r4,lr} - sub sp, 0x8 - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r1, r4, r1 - movs r0, 0xFF - strb r0, [r1] - movs r2, 0 -_0807022A: - mov r1, sp - adds r0, r1, r2 - adds r1, r4, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x5 - ble _0807022A - movs r3, 0 - movs r2, 0 -_0807023E: - mov r1, sp - adds r0, r1, r2 - ldrb r1, [r0] - adds r0, r1, 0 - cmp r0, 0xFF - beq _08070250 - adds r0, r4, r3 - strb r1, [r0] - adds r3, 0x1 -_08070250: - adds r2, 0x1 - cmp r2, 0x5 - ble _0807023E - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8070218 - - thumb_func_start sub_8070260 -sub_8070260: @ 8070260 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - mov r9, r0 - mov r8, r1 - movs r5, 0 - add r1, sp, 0x4 - add r7, sp, 0xC - adds r2, r1, 0 -_08070276: - adds r0, r2, r5 - strb r5, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _08070276 - movs r5, 0 - adds r6, r1, 0 -_08070288: - bl GenerateRandomNumber - mov r1, sp - adds r4, r1, r5 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - subs r1, r5 - bl __modsi3 - adds r0, r6, r0 - ldrb r0, [r0] - strb r0, [r4] - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_8070218 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _08070288 - movs r5, 0 - movs r4, 0x1 -_080702B8: - bl GenerateRandomNumber - adds r1, r7, r5 - lsls r0, 16 - lsrs r0, 16 - ands r0, r4 - strb r0, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _080702B8 - movs r5, 0 -_080702D2: - mov r1, sp - adds r0, r1, r5 - ldrb r0, [r0] - cmp r0, 0x5 - bhi _080703AE - lsls r0, 2 - ldr r1, =_080702EC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080702EC: - .4byte _08070304 - .4byte _08070322 - .4byte _0807033C - .4byte _08070356 - .4byte _08070370 - .4byte _08070390 -_08070304: - adds r0, r7, r5 - ldrb r1, [r0] - movs r0, 0x8C - muls r0, r1 - add r0, r8 - movs r1, 0x27 - bl pokemon_getattr_encrypted - add r2, sp, 0x10 - strb r0, [r2] - mov r0, r9 - movs r1, 0x27 - bl pokemon_setattr - b _080703AE -_08070322: - add r4, sp, 0x10 - adds r0, r7, r5 - ldrb r1, [r0] - movs r0, 0x8C - muls r0, r1 - add r0, r8 - movs r1, 0x28 - bl pokemon_getattr_encrypted - strb r0, [r4] - mov r0, r9 - movs r1, 0x28 - b _08070388 -_0807033C: - add r4, sp, 0x10 - adds r0, r7, r5 - ldrb r1, [r0] - movs r0, 0x8C - muls r0, r1 - add r0, r8 - movs r1, 0x29 - bl pokemon_getattr_encrypted - strb r0, [r4] - mov r0, r9 - movs r1, 0x29 - b _08070388 -_08070356: - add r4, sp, 0x10 - adds r0, r7, r5 - ldrb r1, [r0] - movs r0, 0x8C - muls r0, r1 - add r0, r8 - movs r1, 0x2A - bl pokemon_getattr_encrypted - strb r0, [r4] - mov r0, r9 - movs r1, 0x2A - b _08070388 -_08070370: - add r4, sp, 0x10 - adds r0, r7, r5 - ldrb r1, [r0] - movs r0, 0x8C - muls r0, r1 - add r0, r8 - movs r1, 0x2B - bl pokemon_getattr_encrypted - strb r0, [r4] - mov r0, r9 - movs r1, 0x2B -_08070388: - adds r2, r4, 0 - bl pokemon_setattr - b _080703AE -_08070390: - add r4, sp, 0x10 - adds r0, r7, r5 - ldrb r1, [r0] - movs r0, 0x8C - muls r0, r1 - add r0, r8 - movs r1, 0x2C - bl pokemon_getattr_encrypted - strb r0, [r4] - mov r0, r9 - movs r1, 0x2C - adds r2, r4, 0 - bl pokemon_setattr -_080703AE: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _080702D2 - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8070260 - - thumb_func_start pokemon_get_eggmoves -pokemon_get_eggmoves: @ 80703C8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r1 - movs r6, 0 - movs r4, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - ldr r5, =gEggMoves - ldrh r1, [r5] - ldr r7, =0x00004e20 - adds r0, r3, r7 - cmp r1, r0 - bne _080703F8 - movs r4, 0x1 - b _0807041A - .pool -_080703F8: - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =0x00000471 - ldr r5, =gEggMoves - cmp r2, r0 - bhi _0807041A - lsls r0, r2, 1 - adds r0, r5 - ldrh r1, [r0] - ldr r7, =0x00004e20 - adds r0, r3, r7 - cmp r1, r0 - bne _080703F8 - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_0807041A: - movs r2, 0 - lsls r0, r4, 1 - adds r0, r5 - ldrh r0, [r0] - ldr r1, =0x00004e20 - cmp r0, r1 - bhi _08070456 - adds r7, r5, 0 - adds r3, r1, 0 -_0807042C: - lsls r1, r2, 1 - add r1, r8 - adds r0, r4, r2 - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x9 - bhi _08070456 - adds r0, r4, r2 - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - cmp r0, r3 - bls _0807042C -_08070456: - lsls r0, r6, 24 - lsrs r0, 24 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end pokemon_get_eggmoves - - thumb_func_start daycare_build_child_moveset -daycare_build_child_moveset: @ 8070470 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - adds r7, r0, 0 - mov r10, r1 - mov r9, r2 - movs r0, 0 - str r0, [sp] - movs r6, 0 - ldr r5, =0x02024a4c - movs r2, 0 - ldr r4, =0x02024a28 - ldr r3, =0x02024a30 -_08070490: - lsls r1, r6, 1 - adds r0, r1, r5 - strh r2, [r0] - adds r0, r1, r4 - strh r2, [r0] - adds r1, r3 - strh r2, [r1] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x3 - bls _08070490 - movs r6, 0 - ldr r2, =0x02024a38 - movs r1, 0 -_080704AE: - lsls r0, r6, 1 - adds r0, r2 - strh r1, [r0] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x9 - bls _080704AE - movs r6, 0 - ldr r2, =0x020249c4 - movs r1, 0 -_080704C4: - lsls r0, r6, 1 - adds r0, r2 - strh r1, [r0] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x31 - bls _080704C4 - adds r0, r7, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x020249c4 - bl sub_806E204 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - movs r6, 0 - ldr r1, =0x02024a28 - mov r8, r1 -_080704F2: - adds r5, r6, 0 - adds r5, 0xD - mov r0, r10 - adds r1, r5, 0 - bl pokemon_getattr_encrypted - lsls r4, r6, 1 - mov r2, r8 - adds r1, r4, r2 - strh r0, [r1] - mov r0, r9 - adds r1, r5, 0 - bl pokemon_getattr_encrypted - ldr r1, =0x02024a4c - adds r4, r1 - strh r0, [r4] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x3 - bls _080704F2 - ldr r1, =0x02024a38 - adds r0, r7, 0 - bl pokemon_get_eggmoves - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r6, 0 -_0807052E: - ldr r0, =0x02024a28 - lsls r1, r6, 1 - adds r2, r1, r0 - ldrh r1, [r2] - mov r9, r0 - cmp r1, 0 - beq _080705A4 - movs r5, 0 - cmp r5, r8 - bcs _08070596 - adds r4, r2, 0 - ldr r2, =0x0000ffff -_08070546: - ldr r0, =0x02024a38 - lsls r1, r5, 1 - adds r1, r0 - ldrh r0, [r4] - ldrh r1, [r1] - cmp r0, r1 - bne _0807058C - adds r1, r0, 0 - adds r0, r7, 0 - str r2, [sp, 0x8] - bl pokemon_moveset_pad_ - lsls r0, 16 - lsrs r0, 16 - ldr r2, [sp, 0x8] - cmp r0, r2 - bne _08070596 - ldrh r1, [r4] - adds r0, r7, 0 - bl sub_8069424 - b _08070596 - .pool -_0807058C: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, r8 - bcc _08070546 -_08070596: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r3, =0x02024a28 - mov r9, r3 - cmp r6, 0x3 - bls _0807052E -_080705A4: - movs r6, 0 -_080705A6: - lsls r0, r6, 1 - mov r2, r9 - adds r1, r0, r2 - ldrh r1, [r1] - adds r2, r0, 0 - adds r6, 0x1 - mov r8, r6 - cmp r1, 0 - beq _08070608 - movs r5, 0 - ldr r0, =0x02024a28 - adds r4, r2, r0 - ldr r6, =0x0000ffff - mov r9, r0 -_080705C2: - ldr r3, =0x00000121 - adds r0, r5, r3 - lsls r0, 16 - lsrs r0, 16 - bl ItemIdToBattleMoveId - ldrh r1, [r4] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - bne _080705FE - lsls r1, r5, 24 - lsrs r1, 24 - adds r0, r7, 0 - bl sub_806E00C - cmp r0, 0 - beq _080705FE - ldrh r1, [r4] - adds r0, r7, 0 - bl pokemon_moveset_pad_ - lsls r0, 16 - lsrs r0, 16 - cmp r0, r6 - bne _080705FE - ldrh r1, [r4] - adds r0, r7, 0 - bl sub_8069424 -_080705FE: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x39 - bls _080705C2 -_08070608: - mov r1, r8 - lsls r0, r1, 16 - lsrs r6, r0, 16 - cmp r6, 0x3 - bls _080705A6 - movs r6, 0 - mov r2, r9 - ldrh r0, [r2] - ldr r3, =0x02024a30 - mov r10, r3 - cmp r0, 0 - beq _08070672 - mov r4, r9 - ldr r0, =0x02024a4c - mov r9, r0 - mov r12, r10 -_08070628: - movs r5, 0 - lsls r2, r6, 1 - adds r6, 0x1 - mov r8, r6 - adds r3, r2, r4 -_08070632: - lsls r0, r5, 1 - add r0, r9 - ldrh r2, [r3] - adds r1, r2, 0 - ldrh r0, [r0] - cmp r1, r0 - bne _08070654 - cmp r1, 0 - beq _08070654 - ldr r1, [sp] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp] - lsls r1, 1 - add r1, r12 - strh r2, [r1] -_08070654: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x3 - bls _08070632 - mov r1, r8 - lsls r0, r1, 16 - lsrs r6, r0, 16 - cmp r6, 0x3 - bhi _08070672 - lsls r0, r6, 1 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0 - bne _08070628 -_08070672: - movs r6, 0 - mov r2, r10 - ldrh r0, [r2] - cmp r0, 0 - beq _080706FC -_0807067C: - movs r5, 0 - adds r3, r6, 0x1 - mov r8, r3 - ldr r0, [sp, 0x4] - cmp r5, r0 - bcs _080706E4 - ldr r2, =0x0000ffff -_0807068A: - ldr r1, =0x020249c4 - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - cmp r1, 0 - beq _080706D8 - lsls r0, r6, 1 - mov r3, r10 - adds r4, r0, r3 - ldrh r0, [r4] - cmp r0, r1 - bne _080706D8 - adds r1, r0, 0 - adds r0, r7, 0 - str r2, [sp, 0x8] - bl pokemon_moveset_pad_ - lsls r0, 16 - lsrs r0, 16 - ldr r2, [sp, 0x8] - cmp r0, r2 - bne _080706E4 - ldrh r1, [r4] - adds r0, r7, 0 - bl sub_8069424 - b _080706E4 - .pool -_080706D8: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, [sp, 0x4] - cmp r5, r0 - bcc _0807068A -_080706E4: - mov r1, r8 - lsls r0, r1, 16 - lsrs r6, r0, 16 - cmp r6, 0x3 - bhi _080706FC - ldr r0, =0x02024a30 - lsls r1, r6, 1 - adds r1, r0 - ldrh r1, [r1] - mov r10, r0 - cmp r1, 0 - bne _0807067C -_080706FC: - 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 daycare_build_child_moveset - - thumb_func_start sub_8070710 -sub_8070710: @ 8070710 - adds r2, r0, 0 - movs r1, 0x8C - lsls r1, 1 - adds r0, r2, r1 - movs r1, 0 - str r1, [r0] - movs r3, 0x8E - lsls r3, 1 - adds r0, r2, r3 - strb r1, [r0] - bx lr - thumb_func_end sub_8070710 - - thumb_func_start sub_8070728 -sub_8070728: @ 8070728 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl sub_8070710 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8070728 - - thumb_func_start incense_effects -incense_effects: @ 8070744 - push {r4-r7,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrh r1, [r4] - movs r7, 0xB4 - lsls r7, 1 - cmp r1, r7 - beq _0807075C - movs r0, 0xAF - lsls r0, 1 - cmp r1, r0 - bne _0807079E -_0807075C: - adds r0, r5, 0 - movs r1, 0xC - bl pokemon_getattr_encrypted - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r5, 0 - adds r0, 0x8C - movs r1, 0xC - bl pokemon_getattr_encrypted - lsls r0, 16 - lsrs r2, r0, 16 - ldrh r0, [r4] - cmp r0, r7 - bne _08070788 - cmp r6, 0xDD - beq _08070788 - cmp r2, 0xDD - beq _08070788 - movs r0, 0xCA - strh r0, [r4] -_08070788: - ldrh r1, [r4] - movs r0, 0xAF - lsls r0, 1 - cmp r1, r0 - bne _0807079E - cmp r6, 0xDC - beq _0807079E - cmp r2, 0xDC - beq _0807079E - movs r0, 0xB7 - strh r0, [r4] -_0807079E: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end incense_effects - - thumb_func_start sub_80707A4 -sub_80707A4: @ 80707A4 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr_encrypted - adds r5, r0, 0 - adds r4, 0x8C - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr_encrypted - cmp r5, 0xCA - beq _080707C6 - cmp r0, 0xCA - bne _080707E2 -_080707C6: - movs r4, 0xAC - lsls r4, 1 - adds r0, r6, 0 - adds r1, r4, 0 - bl pokemon_moveset_pad_ - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - bne _080707E2 - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_8069424 -_080707E2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80707A4 - - thumb_func_start sub_80707EC -sub_80707EC: @ 80707EC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r7, r0, 0 - adds r6, r1, 0 - movs r4, 0 - movs r0, 0x1 - mov r8, r0 -_080707FE: - movs r0, 0x8C - muls r0, r4 - adds r5, r7, r0 - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr_encrypted - lsls r1, r4, 1 - add r1, sp - strh r0, [r1] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x84 - bne _08070826 - adds r0, r4, 0 - mov r1, r8 - eors r0, r1 - strb r0, [r6] - strb r4, [r6, 0x1] - b _0807083E -_08070826: - adds r0, r5, 0 - bl pokemon_roll_gender - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFE - bne _0807083E - strb r4, [r6] - adds r0, r4, 0 - mov r1, r8 - eors r0, r1 - strb r0, [r6, 0x1] -_0807083E: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x1 - bls _080707FE - ldrb r0, [r6] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - bl sub_8070004 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x1D - bne _08070870 - movs r1, 0x8C - lsls r1, 1 - adds r0, r7, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _08070870 - movs r4, 0x20 -_08070870: - ldr r0, =0x00000183 - cmp r4, r0 - bne _0807088C - movs r1, 0x8C - lsls r1, 1 - adds r0, r7, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0807088C - movs r4, 0xC1 - lsls r4, 1 -_0807088C: - ldrb r0, [r6, 0x1] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - cmp r0, 0x84 - bne _080708B4 - ldrb r1, [r6] - movs r0, 0x8C - muls r0, r1 - adds r0, r7, r0 - bl pokemon_roll_gender - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFE - beq _080708B4 - ldrb r1, [r6, 0x1] - ldrb r0, [r6] - strb r0, [r6, 0x1] - strb r1, [r6] -_080708B4: - adds r0, r4, 0 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80707EC - - thumb_func_start sub_80708C8 -sub_80708C8: @ 80708C8 - push {r4-r6,lr} - sub sp, 0x6C - adds r6, r0, 0 - add r5, sp, 0x64 - adds r1, r5, 0 - bl sub_80707EC - add r4, sp, 0x68 - strh r0, [r4] - adds r0, r4, 0 - adds r1, r6, 0 - bl incense_effects - ldrh r1, [r4] - mov r0, sp - adds r2, r6, 0 - bl sub_8070A0C - mov r0, sp - adds r1, r6, 0 - bl sub_8070260 - ldrb r0, [r5, 0x1] - movs r2, 0x8C - adds r1, r0, 0 - muls r1, r2 - adds r1, r6, r1 - ldrb r0, [r5] - muls r2, r0 - adds r2, r6, r2 - mov r0, sp - bl daycare_build_child_moveset - ldrh r0, [r4] - cmp r0, 0xAC - bne _08070918 - mov r0, sp - adds r1, r6, 0 - bl sub_80707A4 -_08070918: - mov r2, sp - adds r2, 0x6A - movs r0, 0x1 - strb r0, [r2] - mov r0, sp - movs r1, 0x2D - bl pokemon_setattr - ldr r0, =0x020244ec - movs r1, 0xFA - lsls r1, 1 - adds r0, r1 - mov r1, sp - movs r2, 0x64 - bl memcpy - bl party_compaction - bl calc_player_party_count - adds r0, r6, 0 - bl sub_8070710 - add sp, 0x6C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80708C8 - - thumb_func_start sub_8070954 -sub_8070954: @ 8070954 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - adds r7, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 24 - lsrs r6, 24 - movs r4, 0 - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - str r4, [sp, 0xC] - adds r1, r5, 0 - movs r2, 0x5 - movs r3, 0x20 - bl create_pokemon_set_level - movs r0, 0x12 - add r0, sp - mov r8, r0 - strb r4, [r0] - movs r1, 0x4 - add r0, sp, 0x10 - strh r1, [r0] - mov r4, sp - adds r4, 0x13 - movs r0, 0x1 - mov r9, r0 - mov r0, r9 - strb r0, [r4] - adds r0, r7, 0 - movs r1, 0x26 - add r2, sp, 0x10 - bl pokemon_setattr - ldr r2, =gEggName - adds r0, r7, 0 - movs r1, 0x2 - bl pokemon_setattr - lsls r2, r5, 3 - subs r2, r5 - lsls r2, 2 - ldr r0, =gBaseStats + 0x11 @ egg cycles offset - adds r2, r0 - adds r0, r7, 0 - movs r1, 0x20 - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x24 - mov r2, r8 - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x3 - adds r2, r4, 0 - bl pokemon_setattr - cmp r6, 0 - beq _080709E6 - add r2, sp, 0x14 - movs r0, 0xFD - strb r0, [r2] - adds r0, r7, 0 - movs r1, 0x23 - bl pokemon_setattr -_080709E6: - mov r2, sp - adds r2, 0x15 - mov r0, r9 - strb r0, [r2] - adds r0, r7, 0 - movs r1, 0x2D - bl pokemon_setattr - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8070954 - - thumb_func_start sub_8070A0C -sub_8070A0C: @ 8070A0C - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x14 - adds r6, r0, 0 - adds r5, r1, 0 - lsls r5, 16 - lsrs r5, 16 - movs r0, 0x8C - lsls r0, 1 - adds r2, r0 - ldr r0, [r2] - movs r1, 0x1 - mov r8, r1 - str r1, [sp] - str r0, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - str r4, [sp, 0xC] - adds r0, r6, 0 - adds r1, r5, 0 - movs r2, 0x5 - movs r3, 0x20 - bl create_pokemon_set_level - movs r0, 0x12 - add r0, sp - mov r9, r0 - strb r4, [r0] - movs r1, 0x4 - add r0, sp, 0x10 - strh r1, [r0] - mov r4, sp - adds r4, 0x13 - mov r1, r8 - strb r1, [r4] - adds r0, r6, 0 - movs r1, 0x26 - add r2, sp, 0x10 - bl pokemon_setattr - ldr r2, =gEggName - adds r0, r6, 0 - movs r1, 0x2 - bl pokemon_setattr - lsls r2, r5, 3 - subs r2, r5 - lsls r2, 2 - ldr r0, =gBaseStats + 0x11 @ egg cycles offset - adds r2, r0 - adds r0, r6, 0 - movs r1, 0x20 - bl pokemon_setattr - adds r0, r6, 0 - movs r1, 0x24 - mov r2, r9 - bl pokemon_setattr - adds r0, r6, 0 - movs r1, 0x3 - adds r2, r4, 0 - bl pokemon_setattr - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8070A0C - - thumb_func_start sp0B8_daycare -sp0B8_daycare: @ 8070AA8 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl sub_80708C8 - pop {r0} - bx r0 - .pool - thumb_func_end sp0B8_daycare - - thumb_func_start sub_8070AC4 -sub_8070AC4: @ 8070AC4 - push {r4-r7,lr} - sub sp, 0x4 - adds r6, r0, 0 - movs r7, 0 - movs r5, 0 -_08070ACE: - movs r0, 0x8C - adds r4, r5, 0 - muls r4, r0 - adds r0, r6, r4 - movs r1, 0x5 - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _08070AEE - adds r1, r6, 0 - adds r1, 0x88 - adds r1, r4 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - adds r7, 0x1 -_08070AEE: - adds r5, 0x1 - cmp r5, 0x1 - bls _08070ACE - movs r1, 0x8C - lsls r1, 1 - adds r0, r6, r1 - ldr r0, [r0] - cmp r0, 0 - bne _08070B34 - cmp r7, 0x2 - bne _08070B34 - subs r1, 0x4 - adds r0, r6, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _08070B34 - adds r0, r6, 0 - bl daycare_relationship_score - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x0000ffff - bl __udivsi3 - cmp r4, r0 - bls _08070B34 - bl sub_80701E0 -_08070B34: - movs r0, 0x8E - lsls r0, 1 - adds r1, r6, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _08070BC0 - bl sub_807228C - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - ldr r0, =0x020244e9 - ldrb r0, [r0] - cmp r5, r0 - bcs _08070BC0 - ldr r4, =0x020244ec -_08070B5C: - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - beq _08070BB4 - adds r0, r4, 0 - movs r1, 0x4 - bl pokemon_getattr - cmp r0, 0 - bne _08070BB4 - adds r0, r4, 0 - movs r1, 0x20 - bl pokemon_getattr - adds r1, r0, 0 - str r1, [sp] - cmp r0, 0 - beq _08070BA8 - cmp r0, r6 - bcc _08070B98 - subs r0, r6 - b _08070B9A - .pool -_08070B98: - subs r0, r1, 0x1 -_08070B9A: - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x20 - mov r2, sp - bl pokemon_setattr - b _08070BB4 -_08070BA8: - ldr r0, =0x020375e0 - strh r5, [r0] - movs r0, 0x1 - b _08070BC2 - .pool -_08070BB4: - adds r4, 0x64 - adds r5, 0x1 - ldr r0, =0x020244e9 - ldrb r0, [r0] - cmp r5, r0 - bcc _08070B5C -_08070BC0: - movs r0, 0 -_08070BC2: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8070AC4 - - thumb_func_start sub_8070BD0 -sub_8070BD0: @ 8070BD0 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl sub_8070AC4 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8070BD0 - - thumb_func_start sub_8070BF0 -sub_8070BF0: @ 8070BF0 - push {lr} - movs r1, 0x8C - lsls r1, 1 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - beq _08070C00 - movs r0, 0x1 -_08070C00: - pop {r1} - bx r1 - thumb_func_end sub_8070BF0 - - thumb_func_start sub_8070C04 -sub_8070C04: @ 8070C04 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r1, 0xB - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _08070C2E - ldr r1, =0x02021cc4 - adds r0, r4, 0 - bl pokemon_get_nick_ - adds r0, r4, 0 - movs r1, 0x7 - mov r2, sp - bl pokemon_getattr_encrypted - ldr r0, =0x02021ec4 - mov r1, sp - bl CopyString -_08070C2E: - adds r4, 0x8C - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _08070C44 - ldr r1, =0x02021dc4 - adds r0, r4, 0 - bl pokemon_get_nick_ -_08070C44: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8070C04 - - thumb_func_start sub_8070C58 -sub_8070C58: @ 8070C58 - push {r4,r5,lr} - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - ldr r1, =0x02021cc4 - bl pokemon_get_nick_ - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - muls r0, r5 - adds r0, r4 - movs r1, 0xB - bl pokemon_getattr_encrypted - lsls r0, 16 - lsrs r0, 16 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8070C58 - - thumb_func_start sp0B5_daycare -sp0B5_daycare: @ 8070C94 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl sub_8070C04 - pop {r0} - bx r0 - .pool - thumb_func_end sp0B5_daycare - - thumb_func_start sp0B6_daycare -sp0B6_daycare: @ 8070CB0 - push {r4,lr} - ldr r4, =0x03005d8c - ldr r0, [r4] - ldr r1, =0x00003030 - adds r0, r1 - bl sub_8070BF0 - lsls r0, 24 - cmp r0, 0 - beq _08070CD0 - movs r0, 0x1 - b _08070CF2 - .pool -_08070CD0: - ldr r0, [r4] - ldr r1, =0x00003030 - adds r0, r1 - bl daycare_count_pokemon - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08070CEC - movs r0, 0 - b _08070CF2 - .pool -_08070CEC: - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 -_08070CF2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sp0B6_daycare - - thumb_func_start sub_8070CF8 -sub_8070CF8: @ 8070CF8 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl daycare_count_pokemon - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08070D10 - movs r0, 0 -_08070D10: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8070CF8 - - thumb_func_start sub_8070D1C -sub_8070D1C: @ 8070D1C - push {r4-r6,lr} - adds r5, r1, 0 - movs r4, 0 - adds r1, r0, 0 -_08070D24: - movs r3, 0 - ldrh r0, [r1] - adds r2, r5, 0 -_08070D2A: - ldrh r6, [r2] - cmp r0, r6 - bne _08070D34 - movs r0, 0x1 - b _08070D46 -_08070D34: - adds r2, 0x2 - adds r3, 0x1 - cmp r3, 0x1 - ble _08070D2A - adds r1, 0x2 - adds r4, 0x1 - cmp r4, 0x1 - ble _08070D24 - movs r0, 0 -_08070D46: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8070D1C - - thumb_func_start daycare_relationship_score -daycare_relationship_score: @ 8070D4C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x30 - str r0, [sp, 0x1C] - movs r7, 0 - mov r0, sp - adds r0, 0x8 - str r0, [sp, 0x20] - add r1, sp, 0xC - mov r9, r1 - mov r2, sp - adds r2, 0x14 - str r2, [sp, 0x24] - subs r0, 0x6 - ldr r1, =gBaseStats - mov r10, r1 - ldr r5, [sp, 0x20] - mov r8, r0 - mov r6, sp - str r2, [sp, 0x28] - mov r2, r9 - str r2, [sp, 0x2C] -_08070D7E: - movs r0, 0x8C - adds r4, r7, 0 - muls r4, r0 - ldr r0, [sp, 0x1C] - adds r4, r0, r4 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr_encrypted - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0x1 - bl pokemon_getattr_encrypted - ldr r1, [sp, 0x2C] - stm r1!, {r0} - str r1, [sp, 0x2C] - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr_encrypted - adds r1, r0, 0 - ldrh r0, [r5] - bl pokemon_species_get_gender_info - lsls r0, 24 - lsrs r0, 24 - ldr r2, [sp, 0x28] - stm r2!, {r0} - str r2, [sp, 0x28] - ldrh r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r10 - ldrb r0, [r0, 0x14] - strh r0, [r6] - ldrh r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r10 - ldrb r0, [r0, 0x15] - mov r1, r8 - strh r0, [r1] - adds r5, 0x2 - movs r2, 0x4 - add r8, r2 - adds r6, 0x4 - adds r7, 0x1 - cmp r7, 0x1 - bls _08070D7E - mov r0, sp - ldrh r1, [r0] - cmp r1, 0xF - beq _08070DFC - ldrh r0, [r0, 0x4] - cmp r0, 0xF - beq _08070DFC - cmp r1, 0xD - bne _08070E04 - cmp r0, 0xD - bne _08070E08 -_08070DFC: - movs r0, 0 - b _08070E5C - .pool -_08070E04: - cmp r0, 0xD - bne _08070E14 -_08070E08: - ldr r1, [sp, 0xC] - mov r2, r9 - ldr r0, [r2, 0x4] - cmp r1, r0 - beq _08070E56 - b _08070E5A -_08070E14: - ldr r0, [sp, 0x14] - ldr r2, [sp, 0x24] - ldr r1, [r2, 0x4] - cmp r0, r1 - beq _08070DFC - cmp r0, 0xFF - beq _08070DFC - cmp r1, 0xFF - beq _08070DFC - add r1, sp, 0x4 - mov r0, sp - bl sub_8070D1C - lsls r0, 24 - cmp r0, 0 - beq _08070DFC - ldr r0, [sp, 0x20] - ldrh r1, [r0, 0x2] - ldrh r0, [r0] - cmp r0, r1 - bne _08070E4C - ldr r1, [sp, 0xC] - mov r2, r9 - ldr r0, [r2, 0x4] - cmp r1, r0 - beq _08070E5A - movs r0, 0x46 - b _08070E5C -_08070E4C: - ldr r1, [sp, 0xC] - mov r2, r9 - ldr r0, [r2, 0x4] - cmp r1, r0 - bne _08070E5A -_08070E56: - movs r0, 0x14 - b _08070E5C -_08070E5A: - movs r0, 0x32 -_08070E5C: - add sp, 0x30 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end daycare_relationship_score - - thumb_func_start daycare_relationship_score_from_savegame -daycare_relationship_score_from_savegame: @ 8070E6C - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl daycare_relationship_score - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end daycare_relationship_score_from_savegame - - thumb_func_start sp0B9_daycare_relationship_comment -sp0B9_daycare_relationship_comment: @ 8070E8C - push {lr} - bl daycare_relationship_score_from_savegame - lsls r0, 24 - lsrs r0, 24 - adds r2, r0, 0 - movs r1, 0 - cmp r0, 0 - bne _08070EA0 - movs r1, 0x3 -_08070EA0: - cmp r0, 0x14 - bne _08070EA6 - movs r1, 0x2 -_08070EA6: - cmp r0, 0x32 - bne _08070EAC - movs r1, 0x1 -_08070EAC: - cmp r2, 0x46 - bne _08070EB2 - movs r1, 0 -_08070EB2: - ldr r0, =0x02021fc4 - ldr r2, =gUnknown_0832B6F8 - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl CopyString - pop {r0} - bx r0 - .pool - thumb_func_end sp0B9_daycare_relationship_comment - - thumb_func_start sub_8070ECC -sub_8070ECC: @ 8070ECC - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - mov r2, sp - mov r1, sp - movs r0, 0 - strb r0, [r1, 0x1] - strb r0, [r2] - movs r3, 0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _08070F10 -_08070EE8: - adds r1, r4, r3 - ldrb r0, [r1] - cmp r0, 0xB5 - bne _08070EF6 - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] -_08070EF6: - ldrb r0, [r1] - cmp r0, 0xB6 - bne _08070F02 - ldrb r0, [r2, 0x1] - adds r0, 0x1 - strb r0, [r2, 0x1] -_08070F02: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - adds r0, r4, r3 - ldrb r0, [r0] - cmp r0, 0xFF - bne _08070EE8 -_08070F10: - cmp r5, 0 - bne _08070F24 - mov r0, sp - ldrb r0, [r0] - cmp r0, 0 - beq _08070F24 - mov r0, sp - ldrb r0, [r0, 0x1] - cmp r0, 0 - beq _08070F38 -_08070F24: - cmp r5, 0xFE - bne _08070F3C - mov r0, sp - ldrb r0, [r0, 0x1] - cmp r0, 0 - beq _08070F3C - mov r0, sp - ldrb r0, [r0] - cmp r0, 0 - bne _08070F3C -_08070F38: - movs r0, 0x1 - b _08070F3E -_08070F3C: - movs r0, 0 -_08070F3E: - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8070ECC - - thumb_func_start sub_8070F48 -sub_8070F48: @ 8070F48 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0 - bne _08070F68 - movs r1, 0 - bl sub_8070ECC - lsls r0, 24 - cmp r0, 0 - bne _08070F84 - ldr r1, =gUnknown_0832DAC7 - b _08070F86 - .pool -_08070F68: - cmp r1, 0xFE - bne _08070F84 - adds r0, r4, 0 - movs r1, 0xFE - bl sub_8070ECC - lsls r0, 24 - cmp r0, 0 - bne _08070F84 - ldr r1, =gUnknown_0832DAC9 - b _08070F86 - .pool -_08070F84: - ldr r1, =gUnknown_0832DACB -_08070F86: - adds r0, r4, 0 - bl AppendString - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8070F48 - - thumb_func_start sub_8070F98 -sub_8070F98: @ 8070F98 - push {r4,lr} - adds r4, r0, 0 - adds r0, r1, 0 - bl pokemon_roll_gender - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_8070F48 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8070F98 - - thumb_func_start sub_8070FB4 -sub_8070FB4: @ 8070FB4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x28 - mov r8, r0 - adds r7, r1, 0 - movs r0, 0xFF - strb r0, [r7] - movs r6, 0 - add r0, sp, 0x14 - mov r9, r0 -_08070FCC: - movs r0, 0x8C - adds r4, r6, 0 - muls r4, r0 - add r4, r8 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 2 - mov r1, sp - adds r5, r1, r0 - adds r0, r4, 0 - adds r1, r5, 0 - bl pokemon_get_nick_ - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8070F98 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x1 - bls _08070FCC - adds r0, r7, 0 - mov r1, sp - bl CopyString - ldr r4, =gUnknown_085EF881 - adds r0, r7, 0 - adds r1, r4, 0 - bl AppendString - adds r0, r7, 0 - mov r1, r9 - bl AppendString - adds r0, r7, 0 - adds r1, r4, 0 - bl AppendString - ldr r1, =gUnknown_085EF883 - adds r0, r7, 0 - bl AppendString - add sp, 0x28 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8070FB4 - - thumb_func_start sub_8071038 -sub_8071038: @ 8071038 - push {r4-r6,lr} - sub sp, 0x14 - adds r6, r0, 0 - adds r4, r1, 0 - movs r0, 0xFF - strb r0, [r4] - movs r5, 0 -_08071046: - adds r0, r4, 0 - ldr r1, =gUnknown_085EF888 - bl AppendString - movs r0, 0x8C - adds r2, r5, 0 - muls r2, r0 - adds r0, r6, r2 - adds r1, r6, 0 - adds r1, 0x88 - adds r1, r2 - ldr r1, [r1] - bl sub_806FDEC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, sp - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r0, r4, 0 - mov r1, sp - bl AppendString - adds r0, r4, 0 - ldr r1, =gUnknown_085EF881 - bl AppendString - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bls _08071046 - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8071038 - - thumb_func_start sub_807109C -sub_807109C: @ 807109C - push {r4-r6,lr} - sub sp, 0x10 - str r1, [sp] - mov r1, sp - movs r5, 0 - strb r0, [r1, 0x4] - mov r0, sp - movs r6, 0x1 - movs r4, 0x1 - strb r4, [r0, 0x5] - strb r2, [r0, 0x6] - strb r3, [r0, 0x7] - strb r2, [r0, 0x8] - strb r3, [r0, 0x9] - mov r3, sp - ldrb r1, [r3, 0xC] - movs r2, 0x10 - negs r2, r2 - adds r0, r2, 0 - ands r0, r1 - strb r0, [r3, 0xC] - ldr r3, =0x03003014 - ldrb r1, [r3] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - mov r0, sp - strb r5, [r0, 0xA] - strb r4, [r0, 0xB] - mov r3, sp - ldrb r1, [r3, 0xC] - movs r4, 0xF - adds r0, r4, 0 - ands r0, r1 - movs r1, 0x20 - orrs r0, r1 - strb r0, [r3, 0xC] - mov r1, sp - ldrb r0, [r1, 0xD] - ands r2, r0 - orrs r2, r6 - strb r2, [r1, 0xD] - ands r2, r4 - movs r0, 0x30 - orrs r2, r0 - strb r2, [r1, 0xD] - mov r0, sp - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807109C - - thumb_func_start sub_8071110 -sub_8071110: @ 8071110 - push {r4-r6,lr} - sub sp, 0x14 - adds r5, r0, 0 - adds r4, r1, 0 - adds r6, r3, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x8C - muls r0, r2 - adds r5, r0 - adds r0, r5, 0 - mov r1, sp - bl pokemon_get_nick_ - mov r0, sp - adds r1, r5, 0 - bl sub_8070F98 - adds r0, r4, 0 - mov r1, sp - movs r2, 0x8 - adds r3, r6, 0 - bl sub_807109C - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8071110 - - thumb_func_start sub_8071148 -sub_8071148: @ 8071148 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x14 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - mov r8, r3 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =gUnknown_085EF888 - mov r0, sp - bl CopyString - movs r0, 0x8C - adds r1, r6, 0 - muls r1, r0 - adds r0, r4, r1 - adds r4, 0x88 - adds r4, r1 - ldr r1, [r4] - bl sub_806FDEC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - add r4, sp, 0xC - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - mov r0, sp - adds r1, r4, 0 - bl AppendString - movs r0, 0x1 - mov r1, sp - movs r2, 0x70 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - adds r0, r5, 0 - mov r1, sp - mov r3, r8 - bl sub_807109C - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8071148 - - thumb_func_start sub_80711B8 -sub_80711B8: @ 80711B8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r1, 0 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r2, 24 - lsrs r5, r2, 24 - cmp r6, 0x1 - bhi _080711F0 - ldr r0, =0x03005d8c - mov r8, r0 - ldr r0, [r0] - ldr r4, =0x00003030 - adds r0, r4 - adds r1, r7, 0 - adds r2, r6, 0 - adds r3, r5, 0 - bl sub_8071110 - mov r1, r8 - ldr r0, [r1] - adds r0, r4 - adds r1, r7, 0 - adds r2, r6, 0 - adds r3, r5, 0 - bl sub_8071148 -_080711F0: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80711B8 - - thumb_func_start c3_080469FC -c3_080469FC: @ 8071204 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrb r0, [r4, 0x8] - bl ListMenuHandleInput - adds r1, r0, 0 - ldr r0, =0x030022c0 - ldrh r2, [r0, 0x2E] - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - beq _08071284 - cmp r1, 0x1 - bls _0807123C - cmp r1, 0x5 - beq _08071248 - b _0807124E - .pool -_0807123C: - ldr r0, =0x020375f0 - strh r1, [r0] - b _0807124E - .pool -_08071248: - ldr r1, =0x020375f0 - movs r0, 0x2 - strh r0, [r1] -_0807124E: - ldr r0, =0x03005e00 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - ldrb r0, [r4, 0x8] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - ldrb r0, [r4, 0xA] - movs r1, 0x1 - bl sub_819746C - ldrb r0, [r4, 0xA] - bl RemoveWindow - adds r0, r5, 0 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running - b _080712B4 - .pool -_08071284: - movs r1, 0x2 - adds r0, r1, 0 - ands r0, r2 - cmp r0, 0 - beq _080712B4 - ldr r0, =0x020375f0 - strh r1, [r0] - ldrb r0, [r4, 0x8] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - ldrb r0, [r4, 0xA] - movs r1, 0x1 - bl sub_819746C - ldrb r0, [r4, 0xA] - bl RemoveWindow - adds r0, r5, 0 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running -_080712B4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end c3_080469FC - - thumb_func_start sub_80712C0 -sub_80712C0: @ 80712C0 - push {r4,r5,lr} - sub sp, 0x18 - ldr r0, =gUnknown_0832B6C0 - bl AddWindow - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0 - bl sub_81973FC - mov r1, sp - ldr r0, =gUnknown_0832B6E0 - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - mov r0, sp - strb r4, [r0, 0x10] - movs r1, 0 - movs r2, 0 - bl ListMenuInit - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =c3_080469FC - movs r1, 0x3 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r5, [r1, 0x8] - strh r4, [r1, 0xA] - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80712C0 - - thumb_func_start sub_8071330 -sub_8071330: @ 8071330 - push {lr} - bl sub_81B9328 - ldr r1, =0x030022c0 - ldr r0, =c2_exit_to_overworld_2_switch - str r0, [r1, 0x8] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8071330 - - thumb_func_start sub_8071348 -sub_8071348: @ 8071348 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x50 - adds r5, r0, 0 - adds r6, r1, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x3C] - movs r4, 0 - add r7, sp, 0x18 - add r0, sp, 0x30 - mov r8, r0 - movs r1, 0x31 - add r1, sp - mov r10, r1 - mov r0, sp - adds r0, 0x32 - str r0, [sp, 0x40] - mov r1, sp - adds r1, 0x34 - str r1, [sp, 0x48] - adds r0, 0x1 - str r0, [sp, 0x44] - adds r1, 0x4 - str r1, [sp, 0x4C] -_08071386: - adds r1, r4, 0 - adds r1, 0xD - adds r0, r5, 0 - bl pokemon_getattr - lsls r1, r4, 1 - add r1, sp - adds r1, 0x10 - strh r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _08071386 - adds r0, r5, 0 - movs r1, 0 - bl pokemon_getattr - mov r9, r0 - movs r4, 0 -_080713AE: - adds r1, r4, 0 - adds r1, 0x27 - adds r0, r5, 0 - bl pokemon_getattr - lsls r1, r4, 2 - adds r1, r7, r1 - str r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _080713AE - adds r0, r5, 0 - movs r1, 0x3 - bl pokemon_getattr - mov r1, r8 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x25 - bl pokemon_getattr - mov r1, r10 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x8 - bl pokemon_getattr - ldr r1, [sp, 0x40] - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x22 - bl pokemon_getattr - str r0, [sp, 0x38] - adds r0, r5, 0 - movs r1, 0x50 - bl pokemon_getattr - ldr r1, [sp, 0x48] - strb r0, [r1] - movs r0, 0x1 - str r0, [sp] - mov r0, r9 - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - str r0, [sp, 0xC] - adds r0, r6, 0 - ldr r1, [sp, 0x3C] - movs r2, 0x5 - movs r3, 0x20 - bl create_pokemon_set_level - movs r4, 0 -_0807141E: - adds r1, r4, 0 - adds r1, 0xD - lsls r0, r4, 1 - mov r2, sp - adds r2, r0 - adds r2, 0x10 - adds r0, r6, 0 - bl pokemon_setattr - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _0807141E - movs r4, 0 -_0807143C: - adds r1, r4, 0 - adds r1, 0x27 - lsls r2, r4, 2 - adds r2, r7, r2 - adds r0, r6, 0 - bl pokemon_setattr - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _0807143C - movs r0, 0x2 - mov r1, r8 - strb r0, [r1] - adds r0, r6, 0 - movs r1, 0x3 - mov r2, r8 - bl pokemon_setattr - adds r0, r6, 0 - movs r1, 0x25 - mov r2, r10 - bl pokemon_setattr - adds r0, r6, 0 - movs r1, 0x8 - ldr r2, [sp, 0x40] - bl pokemon_setattr - movs r0, 0x78 - ldr r1, [sp, 0x44] - strb r0, [r1] - adds r0, r6, 0 - movs r1, 0x20 - ldr r2, [sp, 0x44] - bl pokemon_setattr - adds r0, r6, 0 - movs r1, 0x22 - ldr r2, [sp, 0x4C] - bl pokemon_setattr - adds r0, r6, 0 - movs r1, 0x50 - ldr r2, [sp, 0x48] - bl pokemon_setattr - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x64 - bl memcpy - add sp, 0x50 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8071348 - - thumb_func_start sub_80714B8 -sub_80714B8: @ 80714B8 - push {r4,r5,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r0, 24 - add r4, sp, 0xC - movs r1, 0x46 - strb r1, [r4] - movs r1, 0x64 - adds r5, r0, 0 - muls r5, r1 - ldr r0, =0x020244ec - adds r5, r0 - ldr r1, =0x02024744 - adds r0, r5, 0 - bl sub_8071348 - adds r0, r5, 0 - movs r1, 0x2D - adds r2, r4, 0 - bl pokemon_setattr - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, sp - adds r1, r4, 0 - bl GetSpeciesName - adds r0, r5, 0 - movs r1, 0x2 - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - bl SpeciesToNationalPokedexNum - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r4, 0 - movs r1, 0x2 - bl pokedex_flag_operation - adds r0, r4, 0 - movs r1, 0x3 - bl pokedex_flag_operation - ldr r1, =0x02021cc4 - adds r0, r5, 0 - bl pokemon_get_nick - mov r2, sp - adds r2, 0xE - movs r0, 0x4 - strh r0, [r2] - adds r0, r5, 0 - movs r1, 0x26 - bl pokemon_setattr - add r2, sp, 0x10 - movs r0, 0 - strh r0, [r2] - adds r0, r5, 0 - movs r1, 0x24 - bl pokemon_setattr - bl sav1_map_get_name - mov r2, sp - adds r2, 0x12 - strb r0, [r2] - adds r0, r5, 0 - movs r1, 0x23 - bl pokemon_setattr - adds r0, r5, 0 - bl sub_806E924 - adds r0, r5, 0 - bl pokemon_calc_effective_stats - add sp, 0x14 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80714B8 - - thumb_func_start sub_8071578 -sub_8071578: @ 8071578 - push {lr} - ldr r0, =0x020375e0 - ldrb r0, [r0] - bl sub_80714B8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8071578 - - thumb_func_start sub_807158C -sub_807158C: @ 807158C - push {r4-r6,lr} - sub sp, 0x20 - lsls r1, 24 - lsrs r1, 24 - movs r2, 0x8C - muls r1, r2 - adds r4, r0, r1 - adds r0, r4, 0 - mov r1, sp - bl pokemon_get_nick_ - adds r0, r4, 0 - adds r0, 0x70 - ldrh r0, [r0] - cmp r0, 0 - beq _08071608 - adds r6, r4, 0 - adds r6, 0x7C - mov r0, sp - adds r1, r6, 0 - bl CompareStringWithoutExtendedControlCodes - adds r5, r4, 0 - adds r5, 0x74 - cmp r0, 0 - bne _080715CE - ldr r0, =0x03005d90 - ldr r0, [r0] - adds r1, r5, 0 - bl CompareStringWithoutExtendedControlCodes - cmp r0, 0 - beq _08071608 -_080715CE: - ldr r0, =0x02021cc4 - mov r1, sp - bl CopyString - ldr r0, =0x02021dc4 - adds r4, 0x87 - ldrb r2, [r4] - lsls r2, 28 - lsrs r2, 28 - adds r1, r5, 0 - bl sub_81DB5E8 - ldr r0, =0x02021ec4 - ldrb r2, [r4] - lsrs r2, 4 - adds r1, r6, 0 - bl sub_81DB5E8 - movs r0, 0x1 - b _0807160A - .pool -_08071608: - movs r0, 0 -_0807160A: - add sp, 0x20 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_807158C - - thumb_func_start sub_8071614 -sub_8071614: @ 8071614 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - ldr r1, =0x020375e0 - ldrb r1, [r1] - bl sub_807158C - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8071614 - - thumb_func_start sub_807163C -sub_807163C: @ 807163C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r9, r3 - lsls r0, 24 - lsrs r3, r0, 24 - mov r8, r3 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r1, r2, 24 - adds r2, r1, 0 - movs r4, 0 - movs r7, 0 - movs r5, 0 - cmp r3, 0 - bne _0807166A - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - movs r4, 0x1 -_0807166A: - cmp r3, 0x1 - bne _0807167A - movs r0, 0x64 - adds r1, r2, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - movs r4, 0x3 -_0807167A: - cmp r6, 0 - beq _08071688 - cmp r6, 0x1 - beq _080716D8 - b _08071712 - .pool -_08071688: - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0 - bl pokemon_getattr - adds r3, r0, 0 - lsls r0, r4, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r2, [r1] - mov r6, r8 - lsls r1, r6, 1 - adds r1, 0x1 - lsls r1, 2 - adds r2, 0x4 - adds r2, r1 - ldr r1, [r2] - adds r2, r4, 0 - bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack - adds r0, r5, 0 - bl sub_806E794 - bl LoadCompressedObjectPalette - mov r0, r9 - strh r4, [r0] - b _08071712 - .pool -_080716D8: - adds r0, r5, 0 - bl sub_806E794 - ldrh r0, [r0, 0x4] - adds r1, r4, 0 - bl sub_806A068 - ldr r0, =0x0202499c - movs r1, 0x78 - movs r2, 0x4B - movs r3, 0x6 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =0x02020630 - lsls r1, r7, 4 - adds r1, r7 - lsls r1, 2 - adds r2, r1, r4 - adds r2, 0x3E - ldrb r0, [r2] - movs r3, 0x4 - orrs r0, r3 - strb r0, [r2] - adds r4, 0x1C - adds r1, r4 - ldr r0, =DummyObjectCallback - str r0, [r1] -_08071712: - adds r0, r7, 0 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_807163C - - thumb_func_start sub_807172C -sub_807172C: @ 807172C - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_807172C - - thumb_func_start sub_8071740 -sub_8071740: @ 8071740 - push {lr} - bl script_env_2_enable - ldr r0, =sub_8071760 - movs r1, 0xA - bl CreateTask - movs r0, 0x1 - movs r1, 0 - bl fade_screen - pop {r0} - bx r0 - .pool - thumb_func_end sub_8071740 - - thumb_func_start sub_8071760 -sub_8071760: @ 8071760 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08071788 - bl overworld_free_bg_tilemaps - ldr r0, =c1_hatching_egg - bl SetMainCallback2 - ldr r1, =0x03005dac - ldr r0, =sub_80AF168 - str r0, [r1] - adds r0, r4, 0 - bl DestroyTask -_08071788: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8071760 - - thumb_func_start c1_hatching_egg -c1_hatching_egg: @ 80717A0 - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x8 - bls _080717B4 - b _080719D6 -_080717B4: - lsls r0, 2 - ldr r1, =_080717C8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080717C8: - .4byte _080717EC - .4byte _080718B8 - .4byte _080718D0 - .4byte _08071904 - .4byte _08071924 - .4byte _0807193C - .4byte _08071954 - .4byte _08071970 - .4byte _080719C8 -_080717EC: - movs r0, 0 - movs r1, 0 - bl SetGpuReg - ldr r4, =0x03000de0 - movs r0, 0x14 - bl Alloc - str r0, [r4] - bl init_uns_table_pokemon_copy - ldr r2, [r4] - ldr r0, =0x020375e0 - ldrh r0, [r0] - movs r1, 0 - strb r0, [r2, 0x4] - ldr r0, [r4] - strb r1, [r0, 0x7] - ldr r0, =sub_807172C - bl SetVBlankCallback - bl current_map_music_get - ldr r1, =0x020375e2 - strh r0, [r1] - bl reset_temp_tile_data_buffers - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0832C064 - movs r0, 0 - movs r2, 0x2 - bl InitBgsFromTemplates - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - 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, 0x7 - movs r2, 0x2 - bl SetBgAttribute - movs r0, 0x80 - lsls r0, 5 - bl Alloc - adds r1, r0, 0 - movs r0, 0x1 - bl SetBgTilemapBuffer - movs r0, 0x80 - lsls r0, 6 - bl Alloc - adds r1, r0, 0 - movs r0, 0 - bl SetBgTilemapBuffer - bl DeactivateAllTextPrinters - bl sub_80A1A74 - bl ResetObjectPaletteAllocator - bl ResetAllObjectData - bl ResetTasks - bl remove_some_task - bl SoundVSyncOn_rev01 - b _080719A6 - .pool -_080718B8: - ldr r0, =gUnknown_0832C06C - bl InitWindows - ldr r0, =0x03000de0 - ldr r1, [r0] - movs r0, 0 - strb r0, [r1, 0x8] - b _080719A6 - .pool -_080718D0: - ldr r1, =gUnknown_08C00000 - movs r0, 0 - str r0, [sp] - movs r2, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_08C00524 - movs r0, 0 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r0, =gUnknown_08C004E0 - movs r1, 0 - movs r2, 0x20 - bl decompress_palette - b _080719A6 - .pool -_08071904: - ldr r0, =gUnknown_0832BFE4 - bl LoadObjectPic - ldr r0, =gUnknown_0832BFEC - bl LoadObjectPic - ldr r0, =gUnknown_0832BFF4 - bl LoadTaggedObjectPalette - b _080719A6 - .pool -_08071924: - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, =0x03000de0 - ldr r0, [r0] - ldrb r0, [r0, 0x4] - bl sub_80714B8 - b _080719A6 - .pool -_0807193C: - ldr r0, =0x03000de0 - ldr r3, [r0] - ldrb r2, [r3, 0x4] - adds r3, 0xC - movs r0, 0 - movs r1, 0 - bl sub_807163C - b _080719A6 - .pool -_08071954: - ldr r4, =0x03000de0 - ldr r3, [r4] - ldrb r2, [r3, 0x4] - adds r3, 0xC - movs r0, 0 - movs r1, 0x1 - bl sub_807163C - ldr r1, [r4] - strb r0, [r1, 0x1] - b _080719A6 - .pool -_08071970: - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r0, =gUnknown_08DD7300 - movs r1, 0x10 - movs r2, 0xA0 - bl gpu_pal_apply - ldr r1, =gUnknown_08DD7360 - movs r2, 0xA1 - lsls r2, 5 - movs r0, 0x1 - movs r3, 0 - bl LoadBgTiles - ldr r1, =gUnknown_08331F60 - movs r2, 0x80 - lsls r2, 5 - movs r0, 0x1 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x1 - bl CopyBgTilemapBufferToVram -_080719A6: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080719D6 - .pool -_080719C8: - ldr r0, =sub_8071A94 - bl SetMainCallback2 - ldr r0, =0x03000de0 - ldr r1, [r0] - movs r0, 0 - strb r0, [r1, 0x2] -_080719D6: - bl RunTasks - bl RunTextPrinters - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end c1_hatching_egg - - thumb_func_start sub_80719FC -sub_80719FC: @ 80719FC - push {lr} - ldr r0, =0x020375e0 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r2, =0x02021ec4 - movs r1, 0x2 - bl pokemon_setattr - bl sub_805F094 - ldr r0, =0x03000de0 - ldr r0, [r0] - bl Free - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80719FC - - thumb_func_start c3_080472E4 -c3_080472E4: @ 8071A3C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08071A5C - bl sub_80A2F30 - bl play_some_sound -_08071A5C: - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _08071A6C - movs r0, 0xBC - lsls r0, 1 - bl song_play_for_text -_08071A6C: - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x3C - ble _08071A80 - ldr r0, =0x00000179 - bl song_play_for_text - adds r0, r5, 0 - bl DestroyTask -_08071A80: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end c3_080472E4 - - thumb_func_start sub_8071A94 -sub_8071A94: @ 8071A94 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - ldr r1, =0x03000de0 - ldr r0, [r1] - ldrb r0, [r0, 0x2] - adds r5, r1, 0 - cmp r0, 0xC - bls _08071AAC - b _08071E06 -_08071AAC: - lsls r0, 2 - ldr r1, =_08071AC0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08071AC0: - .4byte _08071AF4 - .4byte _08071B40 - .4byte _08071B68 - .4byte _08071BA0 - .4byte _08071BF8 - .4byte _08071C24 - .4byte _08071C88 - .4byte _08071C96 - .4byte _08071CA4 - .4byte _08071CE8 - .4byte _08071D1C - .4byte _08071DB4 - .4byte _08071DD4 -_08071AF4: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =gUnknown_0832BFFC - movs r1, 0x78 - movs r2, 0x4B - movs r3, 0x5 - bl AddObjectToFront - ldr r4, =0x03000de0 - ldr r1, [r4] - strb r0, [r1] - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - ldr r1, [r4] - ldrb r0, [r1, 0x2] - adds r0, 0x1 - strb r0, [r1, 0x2] - ldr r0, =c3_080472E4 - movs r1, 0x5 - bl CreateTask - b _08071E06 - .pool -_08071B40: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _08071B52 - b _08071E06 -_08071B52: - ldr r0, [r5] - ldrb r0, [r0, 0x8] - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, [r5] - strb r4, [r0, 0x3] - ldr r1, [r5] - b _08071DC8 - .pool -_08071B68: - ldr r1, [r5] - ldrb r0, [r1, 0x3] - adds r0, 0x1 - strb r0, [r1, 0x3] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1E - bhi _08071B7A - b _08071E06 -_08071B7A: - ldr r1, [r5] - ldrb r0, [r1, 0x2] - adds r0, 0x1 - strb r0, [r1, 0x2] - ldr r2, =0x02020630 - ldr r0, [r5] - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_8071E34 - str r1, [r0] - b _08071E06 - .pool -_08071BA0: - ldr r4, =0x02020630 - ldr r2, [r5] - ldrb r1, [r2] - 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, =DummyObjectCallback - cmp r1, r0 - beq _08071BBC - b _08071E06 -_08071BBC: - ldrb r1, [r2, 0x4] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, [r5] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r1, r7, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_806ED40 - ldr r1, [r5] - b _08071DC8 - .pool -_08071BF8: - ldr r2, =0x02020630 - ldr r3, [r5] - ldrb r1, [r3, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - beq _08071C12 - b _08071E06 -_08071C12: - ldrb r0, [r3, 0x2] - adds r0, 0x1 - strb r0, [r3, 0x2] - b _08071E06 - .pool -_08071C24: - ldr r0, [r5] - ldrb r1, [r0, 0x4] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02021cc4 - bl pokemon_get_nick - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085ED5A5 - adds r0, r4, 0 - bl ExpandStringRefs - ldr r0, [r5] - ldrb r0, [r0, 0x8] - movs r1, 0xFF - str r1, [sp] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x3 - bl sub_8072214 - ldr r0, =0x00000173 - bl fanfare_play - ldr r1, [r5] - ldrb r0, [r1, 0x2] - adds r0, 0x1 - strb r0, [r1, 0x2] - ldr r0, [r5] - ldrb r0, [r0, 0x8] - bl PutWindowTilemap - ldr r0, [r5] - ldrb r0, [r0, 0x8] - movs r1, 0x3 - bl CopyWindowToVram - b _08071E06 - .pool -_08071C88: - bl task_is_not_running_overworld_fanfare - lsls r0, 24 - cmp r0, 0 - bne _08071C94 - b _08071E06 -_08071C94: - b _08071DC4 -_08071C96: - bl task_is_not_running_overworld_fanfare - lsls r0, 24 - cmp r0, 0 - bne _08071CA2 - b _08071E06 -_08071CA2: - b _08071DC4 -_08071CA4: - ldr r0, [r5] - ldrb r1, [r0, 0x4] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02021cc4 - bl pokemon_get_nick - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085ED5BE - adds r0, r4, 0 - bl ExpandStringRefs - ldr r0, [r5] - ldrb r0, [r0, 0x8] - movs r1, 0x1 - str r1, [sp] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x2 - bl sub_8072214 - ldr r1, [r5] - b _08071DC8 - .pool -_08071CE8: - ldr r0, [r5] - ldrb r0, [r0, 0x8] - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - beq _08071CF8 - b _08071E06 -_08071CF8: - ldr r0, [r5] - ldrb r0, [r0, 0x8] - movs r4, 0xA0 - lsls r4, 1 - adds r1, r4, 0 - movs r2, 0xE0 - bl sub_809882C - ldr r0, =gUnknown_0832C07C - adds r1, r4, 0 - movs r2, 0xE - movs r3, 0 - bl CreateYesNoMenu - ldr r1, [r5] - b _08071DC8 - .pool -_08071D1C: - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _08071D3C - cmp r1, 0 - bgt _08071D36 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08071DC4 - b _08071E06 -_08071D36: - cmp r1, 0x1 - beq _08071DC4 - b _08071E06 -_08071D3C: - ldr r0, =0x03000de0 - mov r8, r0 - ldr r0, [r0] - ldrb r0, [r0, 0x4] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - ldr r1, =0x02021ec4 - mov r9, r1 - bl pokemon_get_nick - mov r1, r8 - ldr r0, [r1] - ldrb r0, [r0, 0x4] - muls r0, r6 - adds r0, r5 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r7, r0, 16 - mov r1, r8 - ldr r0, [r1] - ldrb r0, [r0, 0x4] - muls r0, r6 - adds r0, r5 - bl pokemon_get_gender - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - mov r1, r8 - ldr r0, [r1] - ldrb r0, [r0, 0x4] - muls r0, r6 - adds r0, r5 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - str r0, [sp] - ldr r0, =sub_80719FC - str r0, [sp, 0x4] - movs r0, 0x3 - mov r1, r9 - adds r2, r7, 0 - adds r3, r4, 0 - bl do_choose_name_or_words_screen - b _08071E06 - .pool -_08071DB4: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe -_08071DC4: - ldr r0, =0x03000de0 - ldr r1, [r0] -_08071DC8: - ldrb r0, [r1, 0x2] - adds r0, 0x1 - strb r0, [r1, 0x2] - b _08071E06 - .pool -_08071DD4: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08071E06 - bl sub_805F094 - ldr r4, =0x03000de0 - ldr r0, [r4] - ldrb r0, [r0, 0x8] - bl RemoveWindow - movs r0, 0 - bl UnsetBgTilemapBuffer - movs r0, 0x1 - bl UnsetBgTilemapBuffer - ldr r0, [r4] - bl Free - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 -_08071E06: - bl RunTasks - bl RunTextPrinters - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8071A94 - - thumb_func_start sub_8071E34 -sub_8071E34: @ 8071E34 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _08071E54 - ldr r0, =sub_8071E8C - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x2E] - b _08071E84 - .pool -_08071E54: - ldrh r0, [r4, 0x30] - adds r0, 0x14 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x1 - bl sine - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0xF - bne _08071E84 - movs r0, 0x17 - bl audio_play - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnim - bl sub_8072140 -_08071E84: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8071E34 - - thumb_func_start sub_8071E8C -sub_8071E8C: @ 8071E8C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1E - ble _08071EE8 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _08071EBC - ldr r0, =sub_8071EF0 - str r0, [r4, 0x1C] - strh r1, [r4, 0x2E] - strh r1, [r4, 0x32] - b _08071EE8 - .pool -_08071EBC: - ldrh r0, [r4, 0x30] - adds r0, 0x14 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x2 - bl sine - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0xF - bne _08071EE8 - movs r0, 0x17 - bl audio_play - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectImageAnim -_08071EE8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8071E8C - - thumb_func_start sub_8071EF0 -sub_8071EF0: @ 8071EF0 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - movs r5, 0 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1E - ble _08071F9E - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x26 - ble _08071F5C - ldr r0, =sub_8071FA4 - str r0, [r4, 0x1C] - strh r5, [r4, 0x2E] - ldr r4, =0x03000de0 - ldr r0, [r4] - ldrb r1, [r0, 0x4] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - ldr r3, =0x02020630 - ldr r2, [r4] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r5, [r0, 0x24] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r5, [r0, 0x26] - b _08071F9E - .pool -_08071F5C: - ldrh r0, [r4, 0x30] - adds r0, 0x14 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x2 - bl sine - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0xF - bne _08071F90 - movs r0, 0x17 - bl audio_play - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectImageAnim - bl sub_8072140 - bl sub_8072140 -_08071F90: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1E - bne _08071F9E - movs r0, 0x17 - bl audio_play -_08071F9E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8071EF0 - - thumb_func_start sub_8071FA4 -sub_8071FA4: @ 8071FA4 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x32 - ble _08071FBE - ldr r0, =sub_8071FC8 - str r0, [r1, 0x1C] - movs r0, 0 - strh r0, [r1, 0x2E] -_08071FBE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8071FA4 - - thumb_func_start sub_8071FC8 -sub_8071FC8: @ 8071FC8 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _08071FE8 - movs r1, 0x1 - negs r1, r1 - ldr r0, =0x0000ffff - str r0, [sp] - adds r0, r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe -_08071FE8: - ldrh r0, [r5, 0x2E] - cmp r0, 0x3 - bhi _08072004 - movs r4, 0 -_08071FF0: - bl sub_8072140 - lsls r0, r4, 16 - movs r1, 0x80 - lsls r1, 9 - adds r0, r1 - lsrs r4, r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _08071FF0 -_08072004: - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _08072032 - movs r0, 0x71 - bl audio_play - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_8072048 - str r0, [r5, 0x1C] - strh r4, [r5, 0x2E] -_08072032: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8071FC8 - - thumb_func_start sub_8072048 -sub_8072048: @ 8072048 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _08072084 - ldr r4, =0x02020630 - ldr r3, =0x03000de0 - ldr r0, [r3] - ldrb r1, [r0, 0x1] - 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] - ldr r0, [r3] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartObjectRotScalAnim -_08072084: - movs r2, 0x2E - ldrsh r0, [r5, r2] - cmp r0, 0x8 - bne _0807209E - movs r1, 0x1 - negs r1, r1 - ldr r0, =0x0000ffff - str r0, [sp] - adds r0, r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe -_0807209E: - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0x9 - bgt _080720BC - ldr r2, =0x02020630 - ldr r0, =0x03000de0 - ldr r0, [r0] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - subs r1, 0x1 - strh r1, [r0, 0x22] -_080720BC: - ldrh r1, [r5, 0x2E] - movs r2, 0x2E - ldrsh r0, [r5, r2] - cmp r0, 0x28 - ble _080720CA - ldr r0, =DummyObjectCallback - str r0, [r5, 0x1C] -_080720CA: - adds r0, r1, 0x1 - strh r0, [r5, 0x2E] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8072048 - - thumb_func_start sub_80720E8 -sub_80720E8: @ 80720E8 - push {r4,lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x30] - ldrh r1, [r2, 0x36] - adds r0, r1 - strh r0, [r2, 0x36] - ldrh r1, [r2, 0x32] - ldrh r3, [r2, 0x38] - adds r0, r1, r3 - strh r0, [r2, 0x38] - movs r4, 0x36 - ldrsh r0, [r2, r4] - cmp r0, 0 - bge _08072106 - adds r0, 0xFF -_08072106: - asrs r0, 8 - strh r0, [r2, 0x24] - movs r3, 0x38 - ldrsh r0, [r2, r3] - cmp r0, 0 - bge _08072114 - adds r0, 0xFF -_08072114: - asrs r0, 8 - strh r0, [r2, 0x26] - ldrh r0, [r2, 0x34] - adds r3, r1, r0 - strh r3, [r2, 0x32] - movs r4, 0x22 - ldrsh r1, [r2, r4] - movs r4, 0x26 - ldrsh r0, [r2, r4] - adds r0, r1, r0 - adds r1, 0x14 - cmp r0, r1 - ble _0807213A - lsls r0, r3, 16 - cmp r0, 0 - ble _0807213A - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles -_0807213A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80720E8 - - thumb_func_start sub_8072140 -sub_8072140: @ 8072140 - push {r4-r6,lr} - sub sp, 0x8 - ldr r2, =gUnknown_0832C084 - ldr r0, =0x03000de0 - ldr r6, [r0] - ldrb r3, [r6, 0x7] - lsls r0, r3, 2 - adds r1, r0, r2 - ldrh r5, [r1] - adds r2, 0x2 - adds r0, r2 - ldrh r4, [r0] - adds r3, 0x1 - strb r3, [r6, 0x7] - bl GenerateRandomNumber - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - lsls r5, 16 - asrs r5, 16 - lsls r4, 16 - asrs r4, 16 - movs r0, 0x64 - str r0, [sp] - lsrs r1, 16 - str r1, [sp, 0x4] - movs r0, 0x78 - movs r1, 0x3C - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_8072194 - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8072140 - - thumb_func_start sub_8072194 -sub_8072194: @ 8072194 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - mov r8, r3 - ldr r0, [sp, 0x1C] - mov r9, r0 - ldr r1, [sp, 0x20] - mov r10, r1 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 16 - lsrs r6, 16 - mov r0, r8 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - mov r1, r9 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - mov r0, r10 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r0, =gUnknown_0832C04C - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0x4 - bl AddObjectToFront - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r6, [r0, 0x30] - mov r1, r8 - strh r1, [r0, 0x32] - mov r1, r9 - strh r1, [r0, 0x34] - mov r1, r10 - bl StartObjectImageAnim - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8072194 - - thumb_func_start sub_8072214 -sub_8072214: @ 8072214 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x14 - adds r5, r0, 0 - mov r9, r1 - adds r6, r2, 0 - mov r8, r3 - ldr r4, [sp, 0x2C] - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0xFF - bl FillWindowPixelBuffer - ldr r3, =0x03000de0 - ldr r0, [r3] - movs r2, 0 - strb r2, [r0, 0xE] - ldr r1, [r3] - movs r0, 0x5 - strb r0, [r1, 0xF] - ldr r1, [r3] - movs r0, 0x6 - strb r0, [r1, 0x10] - str r2, [sp] - str r2, [sp, 0x4] - ldr r0, [r3] - adds r0, 0xE - str r0, [sp, 0x8] - lsls r4, 24 - asrs r4, 24 - str r4, [sp, 0xC] - mov r0, r9 - str r0, [sp, 0x10] - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r6, 0 - mov r3, r8 - bl AddTextPrinterParametrized2 - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8072214 - - thumb_func_start sub_807228C -sub_807228C: @ 807228C - push {r4-r6,lr} - bl calc_player_party_count - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - cmp r5, r6 - bcs _080722D6 -_0807229C: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x6 - bl pokemon_getattr - cmp r0, 0 - bne _080722CC - adds r0, r4, 0 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x28 - beq _080722C4 - cmp r0, 0x31 - bne _080722CC -_080722C4: - movs r0, 0x2 - b _080722D8 - .pool -_080722CC: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r6 - bcc _0807229C -_080722D6: - movs r0, 0x1 -_080722D8: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_807228C - - thumb_func_start sub_80722E0 -sub_80722E0: @ 80722E0 - push {r4,lr} - bl sub_80D22D0 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0x6 - bl sub_80C7050 - lsls r0, 24 - lsrs r0, 24 - adds r4, r0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80722E0 - - thumb_func_start sub_8072304 -sub_8072304: @ 8072304 - movs r0, 0x9 - bx lr - thumb_func_end sub_8072304 - - thumb_func_start sub_8072308 -sub_8072308: @ 8072308 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r7, r1, 0 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - movs r3, 0 - movs r2, 0 -_08072324: - lsls r0, r3, 24 - asrs r0, 24 - mov r3, sp - adds r1, r3, r0 - strb r2, [r1] - adds r0, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - asrs r0, 24 - cmp r0, 0x3 - ble _08072324 - movs r3, 0x3 - movs r0, 0x1 - negs r0, r0 - mov r9, r0 - mov r8, sp -_08072344: - lsls r0, r5, 16 - asrs r6, r0, 16 - cmp r6, 0 - ble _08072372 - lsls r4, r3, 24 - asrs r4, 24 - mov r1, sp - adds r5, r1, r4 - adds r0, r6, 0 - movs r1, 0xA - bl __modsi3 - strb r0, [r5] - adds r0, r6, 0 - movs r1, 0xA - bl __divsi3 - lsls r0, 16 - lsrs r5, r0, 16 - subs r4, 0x1 - lsls r4, 24 - lsrs r3, r4, 24 - b _08072344 -_08072372: - lsls r1, r3, 24 - asrs r0, r1, 24 - cmp r0, r9 - ble _08072396 - movs r4, 0xFF - movs r3, 0x1 - negs r3, r3 -_08072380: - asrs r2, r1, 24 - mov r5, sp - adds r1, r5, r2 - ldrb r0, [r1] - orrs r0, r4 - strb r0, [r1] - subs r2, 0x1 - lsls r1, r2, 24 - asrs r0, r1, 24 - cmp r0, r3 - bgt _08072380 -_08072396: - mov r1, r8 - ldrb r0, [r1, 0x3] - cmp r0, 0xFF - bne _080723A2 - movs r0, 0 - strb r0, [r1, 0x3] -_080723A2: - mov r2, r10 - cmp r2, 0 - bne _08072432 - movs r3, 0 - movs r1, 0 - movs r6, 0xFC - lsls r6, 8 - movs r5, 0x1E - mov r12, r5 -_080723B4: - lsls r1, 24 - asrs r2, r1, 24 - mov r0, sp - adds r5, r0, r2 - ldrb r0, [r5] - mov r8, r1 - cmp r0, 0xFF - bne _080723EA - lsls r1, r2, 1 - adds r1, r7 - ldrh r2, [r1] - adds r0, r6, 0 - ands r0, r2 - mov r2, r12 - orrs r0, r2 - strh r0, [r1] - lsls r3, 24 - asrs r1, r3, 23 - adds r1, r7 - adds r1, 0x40 - ldrh r2, [r1] - adds r0, r6, 0 - ands r0, r2 - mov r5, r12 - orrs r0, r5 - strh r0, [r1] - b _0807241A -_080723EA: - lsls r2, 1 - adds r2, r7 - ldrh r0, [r2] - adds r1, r6, 0 - ands r1, r0 - ldrb r0, [r5] - adds r0, 0x14 - orrs r1, r0 - strh r1, [r2] - lsls r4, r3, 24 - asrs r3, r4, 24 - lsls r2, r3, 1 - adds r2, r7 - adds r2, 0x40 - ldrh r0, [r2] - adds r1, r6, 0 - ands r1, r0 - mov r5, sp - adds r0, r5, r3 - ldrb r0, [r0] - adds r0, 0x34 - orrs r1, r0 - strh r1, [r2] - adds r3, r4, 0 -_0807241A: - movs r0, 0x80 - lsls r0, 17 - add r0, r8 - lsrs r1, r0, 24 - movs r2, 0x80 - lsls r2, 17 - adds r0, r3, r2 - lsrs r3, r0, 24 - asrs r0, 24 - cmp r0, 0x3 - ble _080723B4 - b _08072496 -_08072432: - movs r3, 0 - movs r4, 0xFC - lsls r4, 8 - movs r6, 0x1E -_0807243A: - lsls r1, r3, 24 - asrs r2, r1, 24 - mov r3, sp - adds r5, r3, r2 - ldrb r0, [r5] - adds r3, r1, 0 - cmp r0, 0xFF - bne _08072466 - lsls r1, r2, 1 - adds r1, r7 - ldrh r2, [r1] - adds r0, r4, 0 - ands r0, r2 - orrs r0, r6 - strh r0, [r1] - adds r1, 0x40 - ldrh r2, [r1] - adds r0, r4, 0 - ands r0, r2 - orrs r0, r6 - strh r0, [r1] - b _08072488 -_08072466: - lsls r2, 1 - adds r2, r7 - ldrh r0, [r2] - adds r1, r4, 0 - ands r1, r0 - ldrb r0, [r5] - adds r0, 0x14 - orrs r1, r0 - strh r1, [r2] - adds r2, 0x40 - ldrh r0, [r2] - adds r1, r4, 0 - ands r1, r0 - ldrb r0, [r5] - adds r0, 0x34 - orrs r1, r0 - strh r1, [r2] -_08072488: - movs r5, 0x80 - lsls r5, 17 - adds r0, r3, r5 - lsrs r3, r0, 24 - asrs r0, 24 - cmp r0, 0x3 - ble _0807243A -_08072496: - 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_8072308 - - thumb_func_start sub_80724A8 -sub_80724A8: @ 80724A8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r0, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsrs r4, 16 - movs r1, 0x1E - strh r1, [r5, 0x8] - lsls r0, 16 - asrs r0, 16 - adds r1, r5, 0 - movs r2, 0 - bl sub_8072308 - lsls r4, 16 - asrs r4, 16 - adds r5, 0xA - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl sub_8072308 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80724A8 - - thumb_func_start battle_make_oam_normal_battle -battle_make_oam_normal_battle: @ 80724DC - 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 r10, r0 - movs r0, 0 - str r0, [sp] - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _080725F0 - mov r0, r10 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08072574 - ldr r4, =gUnknown_0832C140 - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0xA0 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0xA0 - movs r3, 0x1 - bl AddObjectToBack - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =0x02020630 - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - adds r1, r4 - ldrb r2, [r1, 0x1] - movs r3, 0x3F - adds r0, r3, 0 - ands r0, r2 - strb r0, [r1, 0x1] - lsls r2, r7, 4 - adds r2, r7 - lsls r2, 2 - adds r2, r4 - ldrb r0, [r2, 0x1] - ands r3, r0 - strb r3, [r2, 0x1] - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x40 - ldr r4, =0x000003ff - adds r0, r4, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] - b _080725BA - .pool -_08072574: - ldr r4, =gUnknown_0832C170 - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0xA0 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0xA0 - movs r3, 0x1 - bl AddObjectToBack - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02020630 - lsls r2, r7, 4 - adds r2, r7 - lsls r2, 2 - adds r2, r0 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x20 - ldr r5, =0x000003ff - adds r0, r5, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] - movs r0, 0x2 - str r0, [sp] -_080725BA: - ldr r2, =0x02020630 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r0, r2 - strh r7, [r0, 0x6] - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r1, r0, r2 - strh r6, [r1, 0x38] - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_8072924 - str r1, [r0] - b _08072718 - .pool -_080725F0: - mov r0, r10 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08072694 - mov r0, r10 - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 25 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - ldr r4, =gUnknown_0832C140 - adds r0, r4 - movs r1, 0xF0 - movs r2, 0xA0 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - mov r0, r10 - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 25 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r1, 0xF0 - movs r2, 0xA0 - movs r3, 0x1 - bl AddObjectToBack - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =0x02020630 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r0, r4 - strh r7, [r0, 0x6] - lsls r2, r7, 4 - adds r2, r7 - lsls r2, 2 - adds r3, r2, r4 - strh r6, [r3, 0x38] - ldrh r1, [r3, 0x4] - mov r8, r1 - mov r5, r8 - lsls r1, r5, 22 - lsrs r1, 22 - adds r1, 0x20 - ldr r5, =0x000003ff - adds r0, r5, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - mov r5, r8 - ands r0, r5 - orrs r0, r1 - strh r0, [r3, 0x4] - adds r4, 0x1C - adds r2, r4 - ldr r0, =sub_8072924 - str r0, [r2] - movs r0, 0x1 - b _08072716 - .pool -_08072694: - mov r0, r10 - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 25 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - ldr r4, =gUnknown_0832C170 - adds r0, r4 - movs r1, 0xF0 - movs r2, 0xA0 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - mov r0, r10 - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 25 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r1, 0xF0 - movs r2, 0xA0 - movs r3, 0x1 - bl AddObjectToBack - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =0x02020630 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r0, r4 - strh r7, [r0, 0x6] - lsls r2, r7, 4 - adds r2, r7 - lsls r2, 2 - adds r3, r2, r4 - strh r6, [r3, 0x38] - ldrh r1, [r3, 0x4] - mov r8, r1 - mov r5, r8 - lsls r1, r5, 22 - lsrs r1, 22 - adds r1, 0x20 - ldr r5, =0x000003ff - adds r0, r5, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - mov r5, r8 - ands r0, r5 - orrs r0, r1 - strh r0, [r3, 0x4] - adds r4, 0x1C - adds r2, r4 - ldr r0, =sub_8072924 - str r0, [r2] - movs r0, 0x2 -_08072716: - str r0, [sp] -_08072718: - ldr r0, =0x02024076 - add r0, r10 - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - ldr r1, =gUnknown_0832C1C0 - adds r0, r1 - movs r1, 0x8C - movs r2, 0x3C - movs r3, 0 - bl AddObjectToBack - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - ldr r1, =0x02020630 - mov r8, r1 - add r4, r8 - mov r0, r10 - bl battle_side_get_owner - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 21 - ldr r0, =gUnknown_0832C28C - adds r1, r0 - adds r0, r4, 0 - bl SetSpriteOamTables_NoPriorityFromTable - adds r2, r4, 0 - adds r2, 0x42 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldrb r1, [r4, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r2, 0x4 - mov r9, r2 - mov r1, r9 - orrs r0, r1 - strb r0, [r4, 0x5] - movs r0, 0x1 - bl sub_80728A4 - ldrh r1, [r4, 0x4] - lsls r1, 22 - lsrs r1, 17 - ldr r2, =0x06010000 - adds r1, r2 - ldr r2, =0x04000010 - bl CpuSet - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - add r0, r8 - strh r5, [r0, 0x38] - mov r2, r10 - strh r2, [r0, 0x3A] - adds r0, 0x3E - ldrb r1, [r0] - mov r5, r9 - orrs r1, r5 - strb r1, [r0] - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - add r0, r8 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r5 - strb r1, [r0] - strh r6, [r4, 0x38] - mov r0, sp - ldrh r0, [r0] - strh r0, [r4, 0x3A] - adds r4, 0x3E - ldrb r0, [r4] - orrs r0, r5 - strb r0, [r4] - adds r0, r6, 0 - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end battle_make_oam_normal_battle - - thumb_func_start battle_make_oam_safari_battle -battle_make_oam_safari_battle: @ 8072804 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r4, =gUnknown_0832C1A0 - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0xA0 - movs r3, 0x1 - bl AddObjectToFront - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0xA0 - movs r3, 0x1 - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02020630 - mov r9, r1 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - add r4, r9 - ldrb r3, [r4, 0x1] - movs r2, 0x3F - adds r1, r2, 0 - ands r1, r3 - strb r1, [r4, 0x1] - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - mov r7, r9 - adds r5, r3, r7 - ldrb r1, [r5, 0x1] - ands r2, r1 - strb r2, [r5, 0x1] - ldrh r1, [r5, 0x4] - mov r8, r1 - mov r7, r8 - lsls r2, r7, 22 - lsrs r2, 22 - adds r2, 0x40 - ldr r7, =0x000003ff - adds r1, r7, 0 - ands r2, r1 - ldr r1, =0xfffffc00 - mov r7, r8 - ands r1, r7 - orrs r1, r2 - strh r1, [r5, 0x4] - strh r0, [r4, 0x6] - strh r6, [r5, 0x38] - movs r0, 0x1C - add r9, r0 - add r3, r9 - ldr r0, =sub_8072924 - str r0, [r3] - adds r0, r6, 0 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end battle_make_oam_safari_battle - - thumb_func_start sub_80728A4 -sub_80728A4: @ 80728A4 - lsls r0, 24 - lsrs r0, 19 - ldr r1, =gUnknown_08C11BDC - adds r0, r1 - bx lr - .pool - thumb_func_end sub_80728A4 - - thumb_func_start sub_80728B4 -sub_80728B4: @ 80728B4 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x38] - lsls r0, 24 - lsrs r5, r0, 24 - movs r1, 0x3A - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080728E4 - cmp r0, 0x1 - bgt _080728F8 - cmp r0, 0 - bne _080728F8 - ldr r2, =0x02020630 - lsls r3, r5, 4 - adds r1, r3, r5 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x20] - adds r0, 0x10 - b _08072906 - .pool -_080728E4: - ldr r2, =0x02020630 - lsls r3, r5, 4 - adds r1, r3, r5 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x20] - adds r0, 0x10 - b _08072906 - .pool -_080728F8: - ldr r2, =0x02020630 - lsls r3, r5, 4 - adds r1, r3, r5 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x20] - adds r0, 0x8 -_08072906: - strh r0, [r4, 0x20] - ldrh r0, [r1, 0x22] - strh r0, [r4, 0x22] - adds r0, r3, r5 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x24] - strh r1, [r4, 0x24] - ldrh r0, [r0, 0x26] - strh r0, [r4, 0x26] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80728B4 - - thumb_func_start sub_8072924 -sub_8072924: @ 8072924 - ldrh r1, [r0, 0x38] - lsls r1, 24 - lsrs r1, 24 - ldr r3, =0x02020630 - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r3 - ldrh r1, [r2, 0x20] - adds r1, 0x40 - strh r1, [r0, 0x20] - ldrh r1, [r2, 0x22] - strh r1, [r0, 0x22] - ldrh r1, [r2, 0x24] - strh r1, [r0, 0x24] - ldrh r1, [r2, 0x26] - strh r1, [r0, 0x26] - bx lr - .pool - thumb_func_end sub_8072924 - - thumb_func_start sub_807294C -sub_807294C: @ 807294C - push {r4-r7,lr} - ldr r7, [sp, 0x14] - lsls r0, 24 - lsrs r0, 24 - ldr r6, =0x020244d0 - ldr r4, [r6] - ldr r5, [r4, 0xC] - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 2 - adds r5, r4, r5 - strb r1, [r5] - ldr r0, [r6] - ldr r0, [r0, 0xC] - adds r4, r0 - str r2, [r4, 0x4] - str r3, [r4, 0x8] - str r7, [r4, 0xC] - ldr r0, =0xffff8000 - str r0, [r4, 0x10] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807294C - - thumb_func_start sub_8072984 -sub_8072984: @ 8072984 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r4 - adds r1, r2, 0 - adds r1, 0x3E - ldrb r0, [r1] - movs r3, 0x4 - orrs r0, r3 - strb r0, [r1] - movs r0, 0x38 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] - ldrh r1, [r2, 0x6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8072984 - - thumb_func_start sub_80729D0 -sub_80729D0: @ 80729D0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =0x02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r5 - adds r4, r2, 0 - adds r4, 0x3E - ldrb r1, [r4] - movs r3, 0x5 - negs r3, r3 - adds r0, r3, 0 - ands r0, r1 - strb r0, [r4] - movs r0, 0x38 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r4, [r0] - adds r1, r3, 0 - ands r1, r4 - strb r1, [r0] - ldrh r1, [r2, 0x6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - ands r3, r1 - strb r3, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80729D0 - - thumb_func_start sub_8072A24 -sub_8072A24: @ 8072A24 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x02020630 - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - adds r3, r4 - strh r1, [r3, 0x20] - strh r2, [r3, 0x22] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8072A24 - - thumb_func_start sub_8072A44 -sub_8072A44: @ 8072A44 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =0x02020630 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - adds r4, r5 - ldrh r1, [r4, 0x6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - movs r0, 0x38 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8072A44 - - thumb_func_start nullsub_30 -nullsub_30: @ 8072A84 - bx lr - thumb_func_end nullsub_30 - - thumb_func_start sub_8072A88 -sub_8072A88: @ 8072A88 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - movs r6, 0 - ldr r1, =0x0202406c - mov r8, r1 - ldrb r2, [r1] - cmp r6, r2 - bge _08072B00 - ldr r1, =0x02020630 - mov r12, r1 - movs r1, 0x3 - ands r0, r1 - lsls r5, r0, 2 - movs r7, 0xD - negs r7, r7 - ldr r2, =0x03005d70 - mov r9, r2 -_08072AB2: - mov r1, r9 - adds r0, r6, r1 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r12 - ldrb r4, [r1, 0x6] - ldrh r3, [r1, 0x38] - lsls r3, 24 - lsrs r3, 24 - ldrb r2, [r1, 0x5] - adds r0, r7, 0 - ands r0, r2 - orrs r0, r5 - strb r0, [r1, 0x5] - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - add r1, r12 - ldrb r2, [r1, 0x5] - adds r0, r7, 0 - ands r0, r2 - orrs r0, r5 - strb r0, [r1, 0x5] - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - add r1, r12 - ldrb r2, [r1, 0x5] - adds r0, r7, 0 - ands r0, r2 - orrs r0, r5 - strb r0, [r1, 0x5] - adds r6, 0x1 - mov r2, r8 - ldrb r2, [r2] - cmp r6, r2 - blt _08072AB2 -_08072B00: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8072A88 - - thumb_func_start sub_8072B18 -sub_8072B18: @ 8072B18 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - movs r4, 0 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _08072B44 - adds r0, r6, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08072B3E - movs r5, 0x2C - movs r4, 0x1E - b _08072B7C -_08072B3E: - movs r5, 0x9E - movs r4, 0x58 - b _08072B7C -_08072B44: - adds r0, r6, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08072B72 - cmp r0, 0x1 - bgt _08072B5C - cmp r0, 0 - beq _08072B66 - b _08072B7C -_08072B5C: - cmp r0, 0x2 - beq _08072B6C - cmp r0, 0x3 - beq _08072B78 - b _08072B7C -_08072B66: - movs r5, 0x9F - movs r4, 0x4C - b _08072B7C -_08072B6C: - movs r5, 0xAB - movs r4, 0x65 - b _08072B7C -_08072B72: - movs r5, 0x2C - movs r4, 0x13 - b _08072B7C -_08072B78: - movs r5, 0x20 - movs r4, 0x2C -_08072B7C: - ldr r0, =0x03005d70 - adds r0, r6, r0 - ldrb r0, [r0] - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_8072A24 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8072B18 - - thumb_func_start healthbar_draw_level -healthbar_draw_level: @ 8072B94 - push {r4,r5,lr} - sub sp, 0x18 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r1, 24 - add r2, sp, 0x4 - movs r0, 0xF9 - strb r0, [r2] - movs r0, 0x5 - strb r0, [r2, 0x1] - mov r0, sp - adds r0, 0x6 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r1, r0, 0 - subs r1, 0x2 - add r0, sp, 0x4 - subs r1, r0 - movs r0, 0x3 - subs r0, r1 - lsls r1, r0, 2 - adds r1, r0 - add r0, sp, 0x14 - str r0, [sp] - add r0, sp, 0x4 - movs r2, 0x3 - movs r3, 0x2 - bl write_to_rbox - adds r5, r0, 0 - ldr r0, =0x02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x4] - lsls r0, 22 - lsrs r4, r0, 17 - ldrh r0, [r1, 0x3A] - lsls r0, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08072C18 - bl battle_type_is_double - lsls r0, 24 - ldr r2, =0x06010420 - adds r1, r4, r2 - cmp r0, 0 - bne _08072C1C - ldr r0, =0x06010820 - adds r1, r4, r0 - b _08072C1C - .pool -_08072C18: - ldr r2, =0x06010400 - adds r1, r4, r2 -_08072C1C: - adds r0, r1, 0 - adds r1, r5, 0 - movs r2, 0x3 - bl sub_8075198 - ldr r0, [sp, 0x14] - bl sub_807512C - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end healthbar_draw_level - - thumb_func_start heathbar_draw_hp -heathbar_draw_hp: @ 8072C38 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - ldr r1, =0x02020630 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r4, r0, r1 - ldrh r0, [r4, 0x3A] - lsls r0, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08072D10 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _08072D10 - ldrh r0, [r4, 0x4] - lsls r0, 22 - lsrs r5, r0, 17 - mov r0, r8 - cmp r0, 0 - beq _08072CB8 - mov r2, r9 - lsls r1, r2, 16 - asrs r1, 16 - add r0, sp, 0x4 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - add r0, sp, 0x24 - str r0, [sp] - add r0, sp, 0x4 - movs r1, 0 - movs r2, 0x5 - movs r3, 0x2 - bl write_to_rbox - adds r4, r0, 0 - ldr r1, =0x06010b40 - adds r0, r5, r1 - adds r1, r4, 0 - b _08072CF8 - .pool -_08072CB8: - mov r2, r9 - lsls r1, r2, 16 - asrs r1, 16 - add r0, sp, 0x4 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - add r1, sp, 0x4 - movs r0, 0xBA - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - add r0, sp, 0x24 - str r0, [sp] - adds r0, r1, 0 - movs r1, 0x4 - movs r2, 0x5 - movs r3, 0x2 - bl write_to_rbox - adds r4, r0, 0 - ldr r1, =0x060103e0 - adds r0, r5, r1 - adds r1, r4, 0 - movs r2, 0x1 - bl sub_8075170 - ldr r2, =0x06010b00 - adds r0, r5, r2 - adds r1, r4, 0 - adds r1, 0x20 -_08072CF8: - movs r2, 0x2 - bl sub_8075170 - ldr r0, [sp, 0x24] - bl sub_807512C - b _08072DEA - .pool -_08072D10: - ldr r1, =gUnknown_0832C3C4 - add r0, sp, 0x4 - movs r2, 0x14 - bl memcpy - ldr r1, =0x02020630 - lsls r4, r7, 4 - adds r0, r4, r7 - lsls r0, 2 - adds r6, r0, r1 - ldrh r0, [r6, 0x3A] - lsls r0, 24 - lsrs r5, r0, 24 - bl battle_type_is_double - lsls r0, 24 - lsrs r0, 24 - mov r10, r4 - cmp r0, 0x1 - beq _08072D46 - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08072D60 -_08072D46: - mov r0, r9 - lsls r1, r0, 16 - asrs r1, 16 - adds r0, r7, 0 - mov r2, r8 - bl sub_8072E0C - b _08072DEA - .pool -_08072D60: - ldrh r0, [r6, 0x3A] - lsls r0, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08072D7C - movs r6, 0x59 - mov r1, r8 - cmp r1, 0 - bne _08072D86 - movs r6, 0x1D - b _08072D86 -_08072D7C: - movs r6, 0x30 - mov r2, r8 - cmp r2, 0 - bne _08072D86 - movs r6, 0x14 -_08072D86: - mov r0, sp - adds r0, 0xA - mov r2, r9 - lsls r1, r2, 16 - asrs r1, 16 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r0, =0x020244d4 - ldr r0, [r0] - movs r1, 0xBA - lsls r1, 1 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x9 - add r2, sp, 0x4 - bl RenderTextFont9 - movs r4, 0 - ldr r1, =0x02020630 - mov r2, r10 - adds r0, r2, r7 - lsls r0, 2 - adds r5, r0, r1 -_08072DB8: - ldr r0, =0x020244d4 - ldr r0, [r0] - movs r1, 0xBA - lsls r1, 1 - adds r0, r1 - lsls r1, r4, 6 - adds r1, 0x20 - ldr r0, [r0] - adds r0, r1 - ldrh r1, [r5, 0x4] - lsls r1, 22 - lsrs r1, 22 - adds r1, r6 - adds r1, r4 - lsls r1, 5 - ldr r2, =0x06010000 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _08072DB8 -_08072DEA: - 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 heathbar_draw_hp - - thumb_func_start sub_8072E0C -sub_8072E0C: @ 8072E0C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x30 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r1, 16 - lsrs r4, r1, 16 - mov r10, r4 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - ldr r5, =0x02020630 - lsls r0, 4 - add r0, r9 - lsls r0, 2 - adds r7, r0, r5 - ldrh r0, [r7, 0x3A] - lsls r0, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08072F28 - ldr r0, =0x020244d0 - ldr r1, [r0] - movs r2, 0x3A - ldrsh r0, [r7, r2] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _08072E5E - b _080730B8 -_08072E5E: - movs r3, 0x38 - ldrsh r1, [r7, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r0, [r0, 0x4] - lsls r0, 22 - lsrs r5, r0, 17 - ldr r0, =0x06010000 - adds r6, r5, r0 - mov r0, r8 - cmp r0, 0 - beq _08072EDC - lsls r1, r4, 16 - asrs r1, 16 - add r0, sp, 0x4 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - add r0, sp, 0x28 - str r0, [sp] - add r0, sp, 0x4 - movs r1, 0 - movs r2, 0x5 - movs r3, 0 - bl write_to_rbox - adds r4, r0, 0 - ldr r1, =0x060100c0 - adds r0, r5, r1 - adds r1, r4, 0 - movs r2, 0x2 - bl sub_8075170 - ldr r0, [sp, 0x28] - bl sub_807512C - movs r0, 0x74 - bl sub_80728A4 - ldrh r1, [r7, 0x4] - lsls r1, 22 - lsrs r1, 17 - ldr r2, =0x06010680 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - b _080730B8 - .pool -_08072EDC: - lsls r1, r4, 16 - asrs r1, 16 - add r0, sp, 0x4 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - add r1, sp, 0x4 - movs r0, 0xBA - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - add r0, sp, 0x28 - str r0, [sp] - adds r0, r1, 0 - movs r1, 0x4 - movs r2, 0x5 - movs r3, 0 - bl write_to_rbox - adds r4, r0, 0 - adds r0, r6, 0 - movs r1, 0 - movs r2, 0x3 - bl sub_807513C - ldr r3, =0x06010060 - adds r0, r5, r3 - adds r1, r4, 0 - movs r2, 0x3 - bl sub_8075170 - ldr r0, [sp, 0x28] - bl sub_807512C - b _080730B8 - .pool -_08072F28: - ldr r1, =gUnknown_0832C3D8 - add r0, sp, 0x4 - movs r2, 0x14 - bl memcpy - ldrh r0, [r7, 0x3A] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x2C] - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0] - ldr r2, [sp, 0x2C] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _08072F52 - b _080730B8 -_08072F52: - movs r6, 0x4 - mov r3, r8 - negs r0, r3 - orrs r0, r3 - asrs r0, 31 - ands r6, r0 - ldrh r0, [r7, 0x38] - lsls r0, 24 - lsrs r7, r0, 24 - mov r0, sp - adds r0, 0xA - mov r2, r10 - lsls r1, r2, 16 - asrs r1, 16 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - mov r3, r8 - cmp r3, 0 - bne _08072F82 - ldr r1, =gUnknown_085E8D3E - bl CopyString -_08072F82: - ldr r0, =0x020244d4 - ldr r0, [r0] - movs r1, 0xBA - lsls r1, 1 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x9 - add r2, sp, 0x4 - bl RenderTextFont9 - adds r4, r6, 0 - adds r0, r4, 0x3 - cmp r4, r0 - bge _08073024 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r5, r0, r5 -_08072FA6: - cmp r4, 0x2 - bhi _08072FF0 - ldr r0, =0x020244d4 - ldr r0, [r0] - movs r2, 0xBA - lsls r2, 1 - adds r0, r2 - subs r1, r4, r6 - lsls r1, 6 - adds r1, 0x20 - ldr r0, [r0] - adds r0, r1 - ldrh r1, [r5, 0x4] - lsls r1, 22 - lsrs r1, 22 - adds r4, 0x1 - adds r1, r4 - lsls r1, 5 - ldr r3, =0x06010000 - adds r1, r3 - ldr r2, =0x04000008 - bl CpuSet - b _0807301A - .pool -_08072FF0: - ldr r0, =0x020244d4 - ldr r0, [r0] - movs r1, 0xBA - lsls r1, 1 - adds r0, r1 - subs r1, r4, r6 - lsls r1, 6 - adds r1, 0x20 - ldr r0, [r0] - adds r0, r1 - ldrh r1, [r5, 0x4] - lsls r1, 22 - lsrs r1, 22 - adds r1, r4, r1 - lsls r1, 5 - ldr r2, =0x06010020 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - adds r4, 0x1 -_0807301A: - lsls r0, r4, 24 - lsrs r4, r0, 24 - adds r0, r6, 0x3 - cmp r4, r0 - blt _08072FA6 -_08073024: - mov r3, r8 - cmp r3, 0 - bne _08073084 - ldr r0, =0x020244d4 - ldr r0, [r0] - movs r1, 0xBA - lsls r1, 1 - adds r0, r1 - ldr r0, [r0] - adds r0, 0xE0 - ldr r1, =0x02020630 - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - adds r4, r1 - ldrh r1, [r4, 0x4] - lsls r1, 22 - lsrs r1, 17 - adds r1, 0x80 - ldr r5, =0x06010000 - adds r1, r5 - ldr r2, =0x04000008 - bl CpuSet - mov r2, r8 - str r2, [sp, 0x24] - add r0, sp, 0x24 - ldrh r1, [r4, 0x4] - lsls r1, 22 - lsrs r1, 17 - adds r1, r5 - ldr r2, =0x05000008 - bl CpuSet - b _080730B8 - .pool -_08073084: - ldr r0, [sp, 0x2C] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080730B8 - movs r0, 0x74 - bl sub_80728A4 - ldr r2, =0x02020630 - mov r3, r9 - lsls r1, r3, 4 - add r1, r9 - lsls r1, 2 - adds r1, r2 - ldrh r1, [r1, 0x4] - lsls r1, 22 - lsrs r1, 17 - movs r2, 0xD0 - lsls r2, 3 - adds r1, r2 - ldr r2, =0x06010000 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet -_080730B8: - 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_8072E0C - - thumb_func_start sub_80730D4 -sub_80730D4: @ 80730D4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x14] - ldr r1, =gUnknown_0832C3C4 - mov r0, sp - movs r2, 0x14 - bl memcpy - ldr r1, =0x02020630 - ldr r2, [sp, 0x14] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x3A] - lsls r0, 24 - lsrs r0, 24 - bl battle_get_per_side_status - ldr r1, =0x020244d4 - ldr r2, [r1] - movs r3, 0xBA - lsls r3, 1 - adds r2, r3 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 7 - movs r0, 0xA4 - lsls r0, 3 - adds r1, r0 - ldr r0, [r2] - adds r6, r0, r1 - movs r1, 0x5 - mov r8, r1 - adds r0, r4, 0 - bl GetNature - lsls r0, 24 - mov r4, sp - adds r4, 0x6 - ldr r1, =gNatureNamePointers - lsrs r0, 22 - adds r0, r1 - ldr r1, [r0] - adds r0, r4, 0 - bl CopyString - adds r0, r6, 0 - movs r1, 0x9 - mov r2, sp - bl RenderTextFont9 - movs r7, 0x6 - movs r5, 0 - mov r2, sp - adds r2, 0x9 - str r2, [sp, 0x1C] -_08073158: - mov r3, sp - adds r0, r3, r7 - ldrb r1, [r0] - adds r0, r1, 0 - subs r0, 0x37 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - bls _08073176 - adds r0, r1, 0 - adds r0, 0x79 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - bhi _0807318C -_08073176: - movs r0, 0x2C - b _080731AA - .pool -_0807318C: - adds r0, r1, 0 - subs r0, 0x4B - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bls _080731A4 - adds r0, r1, 0 - adds r0, 0x65 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bhi _080731A8 -_080731A4: - movs r0, 0x2D - b _080731AA -_080731A8: - movs r0, 0x2B -_080731AA: - bl sub_80728A4 - lsls r1, r5, 6 - adds r1, r6, r1 - ldr r2, =0x04000008 - bl CpuSet - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r7, 0x1 - cmp r5, r8 - bcc _08073158 - movs r7, 0x1 - ldr r0, [sp, 0x14] - lsls r0, 4 - str r0, [sp, 0x18] - movs r1, 0x1 - add r1, r8 - mov r9, r1 - cmp r7, r9 - bge _08073236 - ldr r1, =0x02020630 - ldr r2, =0x04000008 - mov r10, r2 - ldr r3, [sp, 0x14] - adds r0, r3 - lsls r0, 2 - adds r0, r1 - mov r8, r0 -_080731E6: - mov r1, r8 - ldrh r0, [r1, 0x4] - lsls r0, 22 - lsrs r0, 22 - adds r5, r7, 0 - cmp r7, 0 - bge _080731F6 - adds r5, r7, 0x7 -_080731F6: - asrs r5, 3 - lsls r4, r5, 3 - subs r4, r7, r4 - adds r0, r4 - lsls r5, 6 - adds r0, r5 - lsls r0, 5 - ldr r2, =0x06010000 - adds r1, r0, r2 - adds r0, r6, 0 - mov r2, r10 - bl CpuSet - adds r6, 0x20 - mov r3, r8 - ldrh r0, [r3, 0x4] - lsls r0, 22 - lsrs r0, 22 - adds r4, 0x8 - adds r0, r4 - adds r0, r5 - lsls r0, 5 - ldr r2, =0x06010000 - adds r1, r0, r2 - adds r0, r6, 0 - mov r2, r10 - bl CpuSet - adds r6, 0x20 - adds r7, 0x1 - cmp r7, r9 - blt _080731E6 -_08073236: - ldr r6, =0x02020630 - ldr r3, [sp, 0x18] - ldr r1, [sp, 0x14] - adds r0, r3, r1 - lsls r0, 2 - adds r0, r6 - ldrh r4, [r0, 0x38] - lsls r4, 24 - lsrs r4, 24 - ldr r5, =0x0202449c - ldr r0, [r5] - adds r0, 0x7C - ldrb r1, [r0] - mov r0, sp - adds r0, 0x6 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, [r5] - adds r0, 0x7B - ldrb r1, [r0] - ldr r0, [sp, 0x1C] - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - mov r1, sp - movs r0, 0 - strb r0, [r1, 0x5] - movs r0, 0xBA - strb r0, [r1, 0x8] - ldr r5, =0x020244d4 - ldr r0, [r5] - movs r2, 0xBA - lsls r2, 1 - adds r0, r2 - ldr r0, [r0] - movs r1, 0x9 - mov r2, sp - bl RenderTextFont9 - movs r7, 0 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r6, r0, r6 - movs r4, 0x20 -_08073296: - cmp r7, 0x1 - bgt _080732D4 - ldr r0, [r5] - movs r3, 0xBA - lsls r3, 1 - adds r0, r3 - ldr r0, [r0] - adds r0, r4 - ldrh r1, [r6, 0x4] - lsls r1, 22 - lsrs r1, 22 - adds r2, r7, 0x2 - adds r1, r2 - lsls r1, 5 - ldr r2, =0x06010000 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - b _080732F4 - .pool -_080732D4: - ldr r0, [r5] - movs r3, 0xBA - lsls r3, 1 - adds r0, r3 - ldr r0, [r0] - adds r0, r4 - ldrh r1, [r6, 0x4] - lsls r1, 22 - lsrs r1, 22 - adds r1, r7, r1 - lsls r1, 5 - ldr r2, =0x060100c0 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet -_080732F4: - adds r4, 0x40 - adds r7, 0x1 - cmp r7, 0x4 - ble _08073296 - 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_80730D4 - - thumb_func_start sub_8073314 -sub_8073314: @ 8073314 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r0, 0 - mov r9, r0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r9, r0 - blt _0807332E - b _080735BA -_0807332E: - ldr r1, =0x02020630 - mov r10, r1 - ldr r2, =0x0202406e - mov r8, r2 -_08073336: - ldr r0, =0x03005d70 - mov r1, r9 - adds r6, r1, r0 - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - mov r1, r10 - adds r1, 0x1C - adds r0, r1 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - beq _08073354 - b _080735A8 -_08073354: - mov r2, r9 - lsls r0, r2, 24 - lsrs r7, r0, 24 - adds r0, r7, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0807336A - b _080735A8 -_0807336A: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _08073382 - adds r0, r7, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08073382 - b _080735A8 -_08073382: - ldr r5, =0x020244d0 - ldr r0, [r5] - ldr r3, [r0] - mov r0, r9 - lsls r4, r0, 2 - adds r3, r4, r3 - ldr r0, [r3] - lsls r0, 27 - lsrs r0, 31 - movs r2, 0x1 - eors r2, r0 - lsls r2, 4 - mov r12, r2 - ldrb r0, [r3] - movs r2, 0x11 - negs r2, r2 - adds r1, r2, 0 - ands r0, r1 - mov r1, r12 - orrs r0, r1 - strb r0, [r3] - ldr r0, [r5] - ldr r0, [r0] - adds r4, r0 - ldr r0, [r4] - lsls r0, 27 - lsrs r4, r0, 31 - adds r0, r7, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080734B0 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _080733D0 - b _080735A8 -_080733D0: - ldr r0, =0x02022fec - ldr r2, [r0] - movs r0, 0x80 - ands r2, r0 - cmp r2, 0 - beq _080733DE - b _080735A8 -_080733DE: - cmp r4, 0x1 - bne _08073468 - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - ldrh r0, [r0, 0x38] - lsls r0, 24 - lsrs r1, r0, 24 - str r2, [sp] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - ldrh r1, [r0, 0x4] - lsls r1, 22 - lsrs r1, 17 - ldr r2, =0x06010000 - adds r1, r2 - mov r0, sp - ldr r2, =0x05000040 - bl CpuSet - ldrb r4, [r6] - mov r1, r8 - ldrh r0, [r1] - movs r2, 0x64 - muls r0, r2 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x39 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - movs r2, 0 - bl sub_8072E0C - ldrb r4, [r6] - mov r2, r8 - ldrh r0, [r2] - movs r1, 0x64 - muls r0, r1 - ldr r2, =0x020244ec - b _08073536 - .pool -_08073468: - ldrb r0, [r6] - bl draw_status_ailment_maybe - ldrb r0, [r6] - mov r2, r8 - ldrh r1, [r2] - movs r2, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0x5 - bl healthbar_draw_field_maybe - movs r0, 0x75 - bl sub_80728A4 - ldrb r2, [r6] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r10 - ldrh r1, [r1, 0x4] - lsls r1, 22 - lsrs r1, 17 - ldr r2, =0x06010680 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - b _08073592 - .pool -_080734B0: - cmp r4, 0x1 - bne _0807355C - ldr r0, =0x02022fec - ldr r2, [r0] - movs r0, 0x80 - ands r2, r0 - cmp r2, 0 - beq _080734DC - ldrb r0, [r6] - mov r2, r8 - ldrh r1, [r2] - movs r2, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - adds r1, r2 - bl sub_80730D4 - b _08073592 - .pool -_080734DC: - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - ldrh r0, [r0, 0x38] - lsls r0, 24 - lsrs r1, r0, 24 - str r2, [sp] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - ldrh r1, [r0, 0x4] - lsls r1, 22 - lsrs r1, 17 - ldr r0, =0x06010000 - adds r1, r0 - mov r0, sp - ldr r2, =0x05000040 - bl CpuSet - ldrb r4, [r6] - mov r1, r8 - ldrh r0, [r1] - movs r2, 0x64 - muls r0, r2 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x39 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - movs r2, 0 - bl sub_8072E0C - ldrb r4, [r6] - mov r2, r8 - ldrh r0, [r2] - movs r1, 0x64 - muls r0, r1 - ldr r2, =0x02024744 -_08073536: - adds r0, r2 - movs r1, 0x3A - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - movs r2, 0x1 - bl sub_8072E0C - b _08073592 - .pool -_0807355C: - ldrb r0, [r6] - bl draw_status_ailment_maybe - ldrb r0, [r6] - mov r2, r8 - ldrh r1, [r2] - movs r5, 0x64 - muls r1, r5 - ldr r4, =0x02024744 - adds r1, r4 - movs r2, 0x5 - bl healthbar_draw_field_maybe - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08073592 - ldrb r0, [r6] - mov r2, r8 - ldrh r1, [r2] - muls r1, r5 - adds r1, r4 - movs r2, 0x4 - bl healthbar_draw_field_maybe -_08073592: - ldr r0, =0x03005d70 - add r0, r9 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - ldrh r1, [r0, 0x3C] - movs r2, 0x1 - eors r1, r2 - strh r1, [r0, 0x3C] -_080735A8: - movs r0, 0x2 - add r8, r0 - movs r1, 0x1 - add r9, r1 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r9, r0 - bge _080735BA - b _08073336 -_080735BA: - 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_8073314 - - thumb_func_start sub_80735DC -sub_80735DC: @ 80735DC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - str r1, [sp, 0xC] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - lsls r2, 24 - lsrs r2, 24 - adds r4, r2, 0 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x10] - cmp r4, 0 - beq _0807360C - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - beq _0807365C -_0807360C: - ldr r0, [sp, 0x8] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08073630 - movs r0, 0 - mov r9, r0 - movs r5, 0x88 - movs r4, 0x60 - movs r1, 0x64 - mov r10, r1 - ldr r2, =0x0000fffb - mov r8, r2 - b _0807366C - .pool -_08073630: - movs r3, 0x1 - mov r9, r3 - cmp r4, 0 - beq _08073642 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _08073648 -_08073642: - movs r5, 0x68 - movs r4, 0x28 - b _0807364C -_08073648: - movs r5, 0x68 - movs r4, 0x10 -_0807364C: - ldr r6, =0x0000ff9c - mov r10, r6 - movs r0, 0x5 - mov r8, r0 - b _0807366C - .pool -_0807365C: - movs r1, 0x1 - mov r9, r1 - movs r5, 0x68 - movs r4, 0x28 - ldr r2, =0x0000ff9c - mov r10, r2 - movs r3, 0x5 - mov r8, r3 -_0807366C: - ldr r0, =gUnknown_0832C334 - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_0832C34C - bl LoadObjectPic - ldr r0, =gUnknown_0832C33C - bl LoadTaggedObjectPalette - ldr r0, =gUnknown_0832C344 - bl LoadTaggedObjectPalette - mov r0, r9 - lsls r6, r0, 1 - adds r0, r6, r0 - lsls r0, 3 - ldr r1, =gUnknown_0832C364 - adds r0, r1 - lsls r5, 16 - asrs r1, r5, 16 - lsls r4, 16 - asrs r2, r4, 16 - movs r3, 0xA - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x14] - lsls r0, 4 - ldr r1, [sp, 0x14] - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r7, r0, r1 - ldr r1, =gUnknown_0832C2C4 - adds r0, r7, 0 - bl SetSpriteOamTables_NoPriorityFromTable - mov r2, r10 - strh r2, [r7, 0x24] - mov r3, r8 - strh r3, [r7, 0x2E] - str r5, [sp, 0x1C] - str r4, [sp, 0x20] - mov r5, r9 - cmp r5, 0 - beq _08073700 - ldrh r0, [r7, 0x20] - subs r0, 0x60 - strh r0, [r7, 0x20] - ldrb r1, [r7, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r7, 0x3] - b _08073706 - .pool -_08073700: - ldrh r0, [r7, 0x20] - adds r0, 0x60 - strh r0, [r7, 0x20] -_08073706: - movs r0, 0 - mov r8, r0 - ldr r1, =0x02020630 - mov r10, r1 - mov r7, sp - mov r2, r9 - adds r0, r6, r2 - lsls r0, 3 - str r0, [sp, 0x18] - movs r6, 0xA - movs r5, 0 -_0807371C: - ldr r0, =gUnknown_0832C394 - ldr r3, [sp, 0x20] - ldr r1, =0xfffc0000 - adds r2, r3, r1 - ldr r3, [sp, 0x18] - adds r0, r3, r0 - ldr r3, [sp, 0x1C] - asrs r1, r3, 16 - asrs r2, 16 - movs r3, 0x9 - bl AddObjectToBack - strb r0, [r7] - ldr r0, [sp, 0x10] - cmp r0, 0 - bne _0807374C - ldrb r0, [r7] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r2, =0x0202064c - adds r1, r2 - ldr r0, =sub_80741C8 - str r0, [r1] -_0807374C: - ldr r4, =0x02020630 - mov r3, r9 - cmp r3, 0 - bne _0807376E - ldrb r1, [r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - strh r3, [r0, 0x24] - ldrb r1, [r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - mov r1, r9 - strh r1, [r0, 0x26] -_0807376E: - ldrb r1, [r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0 - mov r2, sp - ldrh r2, [r2, 0x14] - strh r2, [r0, 0x2E] - mov r3, r9 - cmp r3, 0 - bne _080737C8 - ldrb r0, [r7] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r1, 0x20] - adds r0, 0x18 - adds r0, r5 - strh r0, [r1, 0x20] - ldrb r1, [r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r6, [r0, 0x30] - ldrb r1, [r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x78 - b _0807380A - .pool -_080737C8: - ldrb r0, [r7] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r4 - ldrh r3, [r2, 0x20] - subs r3, 0x18 - movs r1, 0x5 - mov r0, r8 - subs r1, r0 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - subs r3, r0 - strh r3, [r2, 0x20] - ldrb r0, [r7] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r4 - movs r1, 0x6 - mov r3, r8 - subs r1, r3 - lsls r0, r1, 3 - subs r0, r1 - adds r0, 0xA - strh r0, [r2, 0x30] - ldrb r1, [r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000ff88 -_0807380A: - strh r1, [r0, 0x24] - ldrb r1, [r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - mov r1, r9 - strh r1, [r0, 0x32] - adds r7, 0x1 - adds r6, 0x7 - adds r5, 0xA - movs r2, 0x1 - add r8, r2 - mov r3, r8 - cmp r3, 0x5 - bgt _0807382C - b _0807371C -_0807382C: - ldr r0, [sp, 0x8] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0807383A - b _080739E8 -_0807383A: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r2, 0x40 - ands r1, r2 - cmp r1, 0 - beq _080738F4 - ldr r5, =0x0000ffff - mov r10, r5 - ldr r6, =0x02020630 - ldr r0, =0x000003ff - adds r7, r0, 0 - ldr r1, =0xfffffc00 - mov r9, r1 - mov r4, sp - ldr r5, [sp, 0xC] - movs r2, 0x5 - mov r8, r2 -_0807385C: - ldrh r0, [r5] - cmp r0, r10 - bne _080738A8 - ldrb r0, [r4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r6 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x1 - ands r1, r7 - mov r0, r9 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x1 - strh r1, [r0, 0x3C] - b _080738E2 - .pool -_080738A8: - cmp r0, 0 - bne _080738C0 - ldrb r0, [r4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r6 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x3 - b _080738D8 -_080738C0: - ldr r0, [r5, 0x4] - cmp r0, 0 - beq _080738E2 - ldrb r0, [r4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r6 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x2 -_080738D8: - ands r1, r7 - mov r0, r9 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] -_080738E2: - adds r4, 0x1 - adds r5, 0x8 - movs r3, 0x1 - negs r3, r3 - add r8, r3 - mov r0, r8 - cmp r0, 0 - bge _0807385C - b _08073B9A -_080738F4: - movs r1, 0x5 - mov r10, r1 - movs r7, 0 - ldr r2, =0x02020630 - mov r8, r2 - ldr r3, =0x000003ff - mov r9, r3 - ldr r5, =0xfffffc00 - mov r12, r5 - ldr r6, [sp, 0xC] - mov r5, sp -_0807390A: - ldrh r0, [r6] - ldr r1, =0x0000ffff - cmp r0, r1 - bne _08073958 - mov r4, sp - add r4, r10 - ldrb r0, [r4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r8 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x1 - mov r0, r9 - ands r1, r0 - mov r0, r12 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - movs r1, 0x1 - strh r1, [r0, 0x3C] - subs r1, 0x2 - add r10, r1 - b _080739DE - .pool -_08073958: - cmp r0, 0 - bne _08073970 - ldrb r0, [r5] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r8 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x3 - b _080739D0 -_08073970: - ldr r1, =0x02022fec - ldr r0, [r1] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _080739B8 - ldr r0, =0x0202449c - ldr r0, [r0] - movs r2, 0xA8 - lsls r2, 2 - adds r0, r2 - ldrb r1, [r0] - ldr r2, =gUnknown_0832A328 - lsls r0, r7, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _080739B8 - ldrb r0, [r5] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r8 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x3 - b _080739D0 - .pool -_080739B8: - ldr r0, [r6, 0x4] - cmp r0, 0 - beq _080739DC - ldrb r0, [r5] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r8 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x2 -_080739D0: - mov r0, r9 - ands r1, r0 - mov r0, r12 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] -_080739DC: - adds r5, 0x1 -_080739DE: - adds r6, 0x8 - adds r7, 0x1 - cmp r7, 0x5 - ble _0807390A - b _08073B9A -_080739E8: - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r2, =0x00008040 - ands r1, r2 - cmp r1, 0 - beq _08073AA4 - ldr r1, =0x0000ffff - mov r10, r1 - ldr r6, =0x02020630 - ldr r2, =0x000003ff - adds r7, r2, 0 - ldr r3, =0xfffffc00 - mov r9, r3 - ldr r5, [sp, 0xC] - mov r4, sp - adds r4, 0x5 - movs r0, 0x5 - mov r8, r0 -_08073A0C: - ldrh r0, [r5] - cmp r0, r10 - bne _08073A58 - ldrb r0, [r4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r6 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x1 - ands r1, r7 - mov r0, r9 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x1 - strh r1, [r0, 0x3C] - b _08073A92 - .pool -_08073A58: - cmp r0, 0 - bne _08073A70 - ldrb r0, [r4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r6 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x3 - b _08073A88 -_08073A70: - ldr r0, [r5, 0x4] - cmp r0, 0 - beq _08073A92 - ldrb r0, [r4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r6 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x2 -_08073A88: - ands r1, r7 - mov r0, r9 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] -_08073A92: - subs r4, 0x1 - adds r5, 0x8 - movs r1, 0x1 - negs r1, r1 - add r8, r1 - mov r2, r8 - cmp r2, 0 - bge _08073A0C - b _08073B9A -_08073AA4: - movs r3, 0 - mov r8, r3 - movs r7, 0 - ldr r5, =0x02020630 - mov r9, r5 - ldr r6, =0x000003ff - mov r12, r6 - ldr r0, =0xfffffc00 - mov r10, r0 - ldr r6, [sp, 0xC] - mov r5, sp - adds r5, 0x5 -_08073ABC: - ldrh r0, [r6] - ldr r1, =0x0000ffff - cmp r0, r1 - bne _08073B08 - mov r4, sp - add r4, r8 - ldrb r0, [r4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r9 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x1 - mov r0, r12 - ands r1, r0 - mov r0, r10 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - movs r1, 0x1 - strh r1, [r0, 0x3C] - add r8, r1 - b _08073B92 - .pool -_08073B08: - cmp r0, 0 - bne _08073B20 - ldrb r0, [r5] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r9 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x3 - b _08073B84 -_08073B20: - ldr r1, =0x02022fec - ldr r0, [r1] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _08073B6C - ldr r2, =0x0202449c - ldr r0, [r2] - ldr r3, =0x000002a1 - adds r0, r3 - ldrb r1, [r0] - lsls r0, r7, 2 - ldr r2, =gUnknown_0832A328 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08073B6C - ldrb r0, [r5] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r9 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x3 - b _08073B84 - .pool -_08073B6C: - ldr r0, [r6, 0x4] - cmp r0, 0 - beq _08073B90 - ldrb r0, [r5] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r9 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x2 -_08073B84: - mov r0, r12 - ands r1, r0 - mov r0, r10 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] -_08073B90: - subs r5, 0x1 -_08073B92: - adds r6, 0x8 - adds r7, 0x1 - cmp r7, 0x5 - ble _08073ABC -_08073B9A: - ldr r0, =TaskDummy - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - ldr r2, =0x03005e00 - lsls r3, r4, 2 - adds r1, r3, r4 - lsls r1, 3 - adds r0, r1, r2 - mov r5, sp - ldrh r5, [r5, 0x8] - strh r5, [r0, 0x8] - mov r6, sp - ldrh r6, [r6, 0x14] - strh r6, [r0, 0xA] - movs r0, 0 - mov r8, r0 - adds r0, r2, 0 - adds r0, 0xE - adds r1, r0 -_08073BC6: - mov r0, sp - add r0, r8 - ldrb r0, [r0] - strh r0, [r1] - adds r1, 0x2 - movs r5, 0x1 - add r8, r5 - mov r6, r8 - cmp r6, 0x5 - ble _08073BC6 - adds r0, r3, r4 - lsls r0, 3 - adds r0, r2 - mov r1, sp - ldrh r1, [r1, 0x10] - strh r1, [r0, 0x1C] - ldr r2, [sp, 0x10] - cmp r2, 0 - beq _08073C0A - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r3, [r0, 0x8] - ldrb r2, [r3, 0x9] - lsls r1, r2, 27 - lsrs r1, 29 - adds r1, 0x1 - movs r0, 0x7 - ands r1, r0 - lsls r1, 2 - movs r0, 0x1D - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x9] -_08073C0A: - movs r0, 0x72 - movs r1, 0 - bl audio_play_and_stuff - adds r0, r4, 0 - 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_80735DC - - thumb_func_start sub_8073C30 -sub_8073C30: @ 8073C30 - 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 - mov r8, r0 - ldr r2, =0x03005e00 - lsls r3, r0, 2 - adds r1, r3, r0 - lsls r1, 3 - adds r0, r1, r2 - ldrb r7, [r0, 0x1C] - ldrb r4, [r0, 0xA] - mov r10, r4 - ldrb r0, [r0, 0x8] - str r0, [sp, 0x8] - movs r5, 0 - str r3, [sp, 0xC] - adds r2, 0xE - adds r2, r1, r2 -_08073C5E: - mov r0, sp - adds r1, r0, r5 - ldrh r0, [r2] - strb r0, [r1] - adds r2, 0x2 - adds r5, 0x1 - cmp r5, 0x5 - ble _08073C5E - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0x10 - bl SetGpuReg - ldr r1, =0x03005e00 - ldr r0, [sp, 0xC] - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0x10 - strh r1, [r0, 0x26] - movs r5, 0 - mov r1, r10 - lsls r1, 4 - str r1, [sp, 0x10] - ldr r3, =0x02020630 - movs r6, 0xD - negs r6, r6 - mov r12, r3 - movs r4, 0x4 -_08073CA0: - mov r2, sp - adds r0, r2, r5 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r2, [r1, 0x1] - adds r0, r6, 0 - ands r0, r2 - orrs r0, r4 - strb r0, [r1, 0x1] - adds r5, 0x1 - cmp r5, 0x5 - ble _08073CA0 - ldr r2, [sp, 0x10] - add r2, r10 - lsls r2, 2 - add r2, r12 - ldrb r1, [r2, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0x1] - cmp r7, 0 - bne _08073CDA - b _08073DE0 -_08073CDA: - movs r5, 0 - mov r6, r12 - mov r9, r5 - adds r3, r6, 0 - adds r3, 0x1C - mov r4, sp - movs r7, 0 -_08073CE8: - ldr r0, [sp, 0x8] - str r3, [sp, 0x14] - bl battle_side_get_owner - lsls r0, 24 - lsrs r2, r0, 24 - ldr r3, [sp, 0x14] - cmp r2, 0 - beq _08073D4C - movs r0, 0x5 - subs r0, r5 - mov r1, sp - adds r2, r1, r0 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r7, [r0, 0x30] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r1, r9 - strh r1, [r0, 0x34] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r1, r9 - strh r1, [r0, 0x36] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldr r1, =sub_8074158 - str r1, [r0] - ldr r2, =0x02020630 - mov r12, r2 - b _08073D82 - .pool -_08073D4C: - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r7, [r0, 0x30] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x34] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r2, [r0, 0x36] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldr r1, =sub_8074158 - str r1, [r0] - ldr r0, =0x02020630 - mov r12, r0 -_08073D82: - adds r4, 0x1 - adds r7, 0x7 - adds r5, 0x1 - cmp r5, 0x5 - ble _08073CE8 - ldr r3, [sp, 0x10] - add r3, r10 - lsls r3, 2 - mov r1, r12 - adds r0, r3, r1 - movs r2, 0x2E - ldrsh r1, [r0, r2] - lsrs r2, r1, 31 - adds r1, r2 - asrs r1, 1 - movs r2, 0 - strh r1, [r0, 0x2E] - strh r2, [r0, 0x30] - mov r1, r12 - adds r1, 0x1C - adds r3, r1 - ldr r1, =sub_8074090 - str r1, [r3] - ldr r1, =gUnknown_0832C2CC - bl SetSpriteOamTables_NoPriorityFromTable - ldr r1, =0x03005e00 - ldr r0, [sp, 0xC] - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_battle_throw_own_ball - str r1, [r0] - b _08073DEE - .pool -_08073DE0: - ldr r0, =0x03005e00 - ldr r1, [sp, 0xC] - add r1, r8 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8073F98 - str r0, [r1] -_08073DEE: - 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_8073C30 - - thumb_func_start task_battle_throw_own_ball -task_battle_throw_own_ball: @ 8073E08 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0x1E] - adds r1, r0, 0x1 - strh r1, [r4, 0x1E] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08073E48 - ldrh r0, [r4, 0x26] - subs r1, r0, 0x1 - strh r1, [r4, 0x26] - lsls r0, r1, 16 - cmp r0, 0 - blt _08073E54 - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg -_08073E48: - movs r1, 0x26 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08073E54 - ldr r0, =sub_8073E64 - str r0, [r4] -_08073E54: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_battle_throw_own_ball - - thumb_func_start sub_8073E64 -sub_8073E64: @ 8073E64 - push {r4-r7,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r7, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r3, r0, 3 - adds r4, r3, r7 - ldrb r2, [r4, 0x8] - ldrh r0, [r4, 0x26] - subs r0, 0x1 - strh r0, [r4, 0x26] - lsls r0, 16 - asrs r1, r0, 16 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _08073F54 - ldrb r5, [r4, 0xA] - movs r4, 0 - ldr r6, =0x020244d0 - adds r0, r7, 0 - adds r0, 0xE - adds r2, r3, r0 -_08073E96: - mov r0, sp - adds r1, r0, r4 - ldrh r0, [r2] - strb r0, [r1] - adds r2, 0x2 - adds r4, 0x1 - cmp r4, 0x5 - ble _08073E96 - ldr r0, [r6] - ldr r3, [r0, 0x8] - ldrb r2, [r3, 0x9] - lsls r1, r2, 27 - lsrs r1, 29 - subs r1, 0x1 - movs r0, 0x7 - ands r1, r0 - lsls r1, 2 - movs r0, 0x1D - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x9] - ldr r0, [r6] - ldr r0, [r0, 0x8] - ldrb r1, [r0, 0x9] - movs r0, 0x1C - ands r0, r1 - cmp r0, 0 - bne _08073EFC - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl RemoveObjectAndFreeResources - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeResources - b _08073F32 - .pool -_08073EFC: - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - ldr r5, =0x02020630 - adds r4, r5 - adds r0, r4, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl obj_free_rotscale_entry - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles -_08073F32: - movs r4, 0x1 - ldr r5, =0x02020630 -_08073F36: - mov r1, sp - adds r0, r1, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - adds r4, 0x1 - cmp r4, 0x5 - ble _08073F36 - b _08073F8A - .pool -_08073F54: - movs r0, 0x3 - negs r0, r0 - cmp r1, r0 - bne _08073F8A - ldr r0, =0x020244d0 - 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, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r5, 0 - bl DestroyTask -_08073F8A: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8073E64 - - thumb_func_start sub_8073F98 -sub_8073F98: @ 8073F98 - push {r4-r7,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - ldr r7, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r6, r0, 3 - adds r3, r6, r7 - ldrb r5, [r3, 0x8] - ldrh r0, [r3, 0x26] - subs r1, r0, 0x1 - strh r1, [r3, 0x26] - lsls r0, r1, 16 - asrs r2, r0, 16 - cmp r2, 0 - blt _08073FD4 - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - b _0807406A - .pool -_08073FD4: - movs r0, 0x1 - negs r0, r0 - cmp r2, r0 - bne _08074034 - ldrb r3, [r3, 0xA] - movs r5, 0 - adds r0, r7, 0 - adds r0, 0xE - adds r2, r6, r0 -_08073FE6: - mov r0, sp - adds r1, r0, r5 - ldrh r0, [r2] - strb r0, [r1] - adds r2, 0x2 - adds r5, 0x1 - cmp r5, 0x5 - ble _08073FE6 - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl RemoveObjectAndFreeResources - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeResources - movs r5, 0x1 -_08074016: - mov r1, sp - adds r0, r1, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - adds r5, 0x1 - cmp r5, 0x5 - ble _08074016 - b _0807406A - .pool -_08074034: - movs r0, 0x3 - negs r0, r0 - cmp r2, r0 - bne _0807406A - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl DestroyTask -_0807406A: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8073F98 - - thumb_func_start sub_8074078 -sub_8074078: @ 8074078 - push {lr} - adds r1, r0, 0 - ldrh r2, [r1, 0x24] - movs r3, 0x24 - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _0807408C - ldrh r0, [r1, 0x2E] - adds r0, r2, r0 - strh r0, [r1, 0x24] -_0807408C: - pop {r0} - bx r0 - thumb_func_end sub_8074078 - - thumb_func_start sub_8074090 -sub_8074090: @ 8074090 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x30] - adds r1, r0, 0 - adds r1, 0x20 - strh r1, [r2, 0x30] - movs r3, 0x2E - ldrsh r0, [r2, r3] - cmp r0, 0 - ble _080740AE - lsls r0, r1, 16 - asrs r0, 20 - ldrh r1, [r2, 0x24] - adds r0, r1 - b _080740B6 -_080740AE: - lsls r1, 16 - asrs r1, 20 - ldrh r0, [r2, 0x24] - subs r0, r1 -_080740B6: - strh r0, [r2, 0x24] - ldrh r1, [r2, 0x30] - movs r0, 0xF - ands r0, r1 - strh r0, [r2, 0x30] - pop {r0} - bx r0 - thumb_func_end sub_8074090 - - thumb_func_start sub_80740C4 -sub_80740C4: @ 80740C4 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x30] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _080740D8 - subs r0, r1, 0x1 - strh r0, [r4, 0x30] - b _0807414E -_080740D8: - ldrh r0, [r4, 0x32] - lsls r0, 24 - lsrs r3, r0, 24 - ldrh r2, [r4, 0x34] - adds r0, r2, 0 - adds r0, 0x38 - lsls r1, r0, 16 - lsrs r2, r1, 16 - ldr r0, =0x0000fff0 - ands r2, r0 - strh r2, [r4, 0x34] - cmp r3, 0 - beq _0807410C - lsrs r0, r1, 20 - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - lsls r0, 16 - cmp r0, 0 - ble _0807411C - movs r0, 0 - strh r0, [r4, 0x24] - b _0807411C - .pool -_0807410C: - lsrs r1, 20 - ldrh r0, [r4, 0x24] - subs r0, r1 - strh r0, [r4, 0x24] - lsls r0, 16 - cmp r0, 0 - bge _0807411C - strh r3, [r4, 0x24] -_0807411C: - movs r2, 0x24 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0807414E - movs r1, 0x3F - cmp r3, 0 - beq _0807412C - movs r1, 0xC0 -_0807412C: - movs r2, 0x3C - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08074140 - lsls r1, 24 - asrs r1, 24 - movs r0, 0x74 - bl sub_80A383C - b _0807414A -_08074140: - lsls r1, 24 - asrs r1, 24 - movs r0, 0x73 - bl sub_80A3808 -_0807414A: - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] -_0807414E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80740C4 - - thumb_func_start sub_8074158 -sub_8074158: @ 8074158 - push {r4,lr} - adds r3, r0, 0 - ldrh r1, [r3, 0x30] - movs r2, 0x30 - ldrsh r0, [r3, r2] - cmp r0, 0 - ble _0807416C - subs r0, r1, 0x1 - strh r0, [r3, 0x30] - b _080741BC -_0807416C: - ldrh r0, [r3, 0x32] - lsls r0, 24 - ldrh r2, [r3, 0x34] - adds r1, r2, 0 - adds r1, 0x38 - lsls r4, r1, 16 - lsrs r2, r4, 16 - ldr r1, =0x0000fff0 - ands r2, r1 - strh r2, [r3, 0x34] - cmp r0, 0 - beq _08074190 - lsrs r0, r4, 20 - ldrh r1, [r3, 0x24] - adds r0, r1 - b _08074196 - .pool -_08074190: - lsrs r1, r4, 20 - ldrh r0, [r3, 0x24] - subs r0, r1 -_08074196: - strh r0, [r3, 0x24] - movs r2, 0x24 - ldrsh r0, [r3, r2] - movs r2, 0x20 - ldrsh r1, [r3, r2] - adds r0, r1 - adds r0, 0x8 - movs r1, 0x80 - lsls r1, 1 - cmp r0, r1 - bls _080741BC - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =DummyObjectCallback - str r0, [r3, 0x1C] -_080741BC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8074158 - - thumb_func_start sub_80741C8 -sub_80741C8: @ 80741C8 - ldrh r2, [r0, 0x2E] - lsls r2, 24 - lsrs r2, 24 - ldr r3, =0x02020630 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - ldrh r2, [r1, 0x24] - strh r2, [r0, 0x24] - ldrh r1, [r1, 0x26] - strh r1, [r0, 0x26] - bx lr - .pool - thumb_func_end sub_80741C8 - - thumb_func_start sub_80741E8 -sub_80741E8: @ 80741E8 - push {r4-r7,lr} - sub sp, 0x14 - adds r4, r1, 0 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r5, =0x02022e2c - ldr r1, =gUnknown_085ED228 - adds r0, r5, 0 - bl CopyString - adds r0, r4, 0 - movs r1, 0x2 - add r2, sp, 0x4 - bl pokemon_getattr - add r0, sp, 0x4 - bl GetStringEnd_Limit7 - adds r0, r5, 0 - add r1, sp, 0x4 - bl AppendString - adds r5, r0, 0 - adds r0, r4, 0 - bl pokemon_get_gender - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - adds r1, r0, 0 - cmp r0, 0x1D - beq _08074236 - cmp r0, 0x20 - bne _0807424A -_08074236: - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - add r0, sp, 0x4 - bl CompareString - cmp r0, 0 - bne _0807424A - movs r6, 0x64 -_0807424A: - cmp r6, 0 - beq _08074268 - cmp r6, 0xFE - beq _08074270 - ldr r1, =gUnknown_085ED238 - b _08074272 - .pool -_08074268: - ldr r1, =gUnknown_085ED22E - b _08074272 - .pool -_08074270: - ldr r1, =gUnknown_085ED233 -_08074272: - adds r0, r5, 0 - bl CopyString - ldr r0, =0x02022e2c - add r1, sp, 0x10 - str r1, [sp] - movs r1, 0 - movs r2, 0x3 - movs r3, 0x2 - bl write_to_rbox - adds r6, r0, 0 - ldr r0, =0x02020630 - lsls r1, r7, 4 - adds r1, r7 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x4] - lsls r0, 22 - lsrs r4, r0, 17 - ldrh r0, [r1, 0x3A] - lsls r0, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080742F0 - ldr r1, =0x06010040 - adds r0, r4, r1 - adds r1, r6, 0 - movs r2, 0x6 - bl sub_8075198 - bl battle_type_is_double - lsls r0, 24 - ldr r1, =0x06010400 - adds r5, r4, r1 - cmp r0, 0 - bne _080742C8 - ldr r0, =0x06010800 - adds r5, r4, r0 -_080742C8: - adds r1, r6, 0 - adds r1, 0xC0 - adds r0, r5, 0 - movs r2, 0x1 - bl sub_8075198 - b _080742FC - .pool -_080742F0: - ldr r1, =0x06010020 - adds r0, r4, r1 - adds r1, r6, 0 - movs r2, 0x7 - bl sub_8075198 -_080742FC: - ldr r0, [sp, 0x10] - bl sub_807512C - add sp, 0x14 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80741E8 - - thumb_func_start sub_8074310 -sub_8074310: @ 8074310 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 2 - ands r0, r1 - cmp r0, 0 - bne _080743E6 - movs r0, 0x8 - ands r1, r0 - cmp r1, 0 - bne _080743E6 - ldr r6, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r5, r0, r6 - ldrh r0, [r5, 0x3A] - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080743E6 - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _080743E6 - ldrh r0, [r5, 0x38] - lsls r0, 24 - lsrs r4, r0, 24 - cmp r7, 0 - beq _080743C4 - movs r0, 0x46 - bl sub_80728A4 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r6 - ldrh r1, [r1, 0x4] - lsls r1, 22 - lsrs r1, 17 - movs r2, 0x80 - lsls r2, 1 - adds r1, r2 - ldr r2, =0x06010000 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - b _080743E6 - .pool -_080743C4: - str r7, [sp] - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r6 - ldrh r1, [r0, 0x4] - lsls r1, 22 - lsrs r1, 17 - movs r0, 0x80 - lsls r0, 1 - adds r1, r0 - ldr r0, =0x06010000 - adds r1, r0 - ldr r2, =0x05000008 - mov r0, sp - bl CpuSet -_080743E6: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8074310 - - thumb_func_start draw_status_ailment_maybe -draw_status_ailment_maybe: @ 80743F8 - 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 - ldr r0, =0x02020630 - mov r2, r9 - lsls r1, r2, 4 - add r1, r9 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x3A] - lsls r0, 24 - lsrs r7, r0, 24 - ldrh r0, [r1, 0x38] - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - adds r0, r7, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08074468 - ldr r1, =0x0202406e - lsls r0, r7, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x37 - bl pokemon_getattr - adds r4, r0, 0 - bl battle_type_is_double - lsls r0, 24 - movs r3, 0x12 - mov r8, r3 - cmp r0, 0 - bne _08074484 - movs r0, 0x1A - mov r8, r0 - b _08074484 - .pool -_08074468: - ldr r1, =0x0202406e - lsls r0, r7, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x37 - bl pokemon_getattr - adds r4, r0, 0 - movs r1, 0x11 - mov r8, r1 -_08074484: - movs r0, 0x7 - ands r0, r4 - cmp r0, 0 - beq _080744AC - movs r0, 0x1B - adds r1, r7, 0 - bl sub_80746A8 - lsls r0, 24 - lsrs r0, 24 - bl sub_80728A4 - adds r6, r0, 0 - movs r0, 0x2 - b _080745B8 - .pool -_080744AC: - movs r0, 0x88 - ands r0, r4 - cmp r0, 0 - beq _080744CA - movs r0, 0x15 - adds r1, r7, 0 - bl sub_80746A8 - lsls r0, 24 - lsrs r0, 24 - bl sub_80728A4 - adds r6, r0, 0 - movs r0, 0 - b _080745B8 -_080744CA: - movs r0, 0x10 - ands r0, r4 - cmp r0, 0 - beq _080744E8 - movs r0, 0x21 - adds r1, r7, 0 - bl sub_80746A8 - lsls r0, 24 - lsrs r0, 24 - bl sub_80728A4 - adds r6, r0, 0 - movs r0, 0x4 - b _080745B8 -_080744E8: - movs r0, 0x20 - ands r0, r4 - cmp r0, 0 - beq _08074506 - movs r0, 0x1E - adds r1, r7, 0 - bl sub_80746A8 - lsls r0, 24 - lsrs r0, 24 - bl sub_80728A4 - adds r6, r0, 0 - movs r0, 0x3 - b _080745B8 -_08074506: - movs r0, 0x40 - ands r0, r4 - cmp r0, 0 - beq _08074524 - movs r0, 0x18 - adds r1, r7, 0 - bl sub_80746A8 - lsls r0, 24 - lsrs r0, 24 - bl sub_80728A4 - adds r6, r0, 0 - movs r0, 0x1 - b _080745B8 -_08074524: - movs r0, 0x27 - bl sub_80728A4 - adds r6, r0, 0 - movs r4, 0 - mov r2, r9 - lsls r0, r2, 4 - mov r3, r8 - lsls r3, 16 - mov r8, r3 - lsls r7, 2 - ldr r1, =0x02020630 - add r0, r9 - lsls r0, 2 - adds r5, r0, r1 -_08074542: - ldrh r1, [r5, 0x4] - lsls r1, 22 - lsrs r1, 22 - mov r2, r8 - asrs r0, r2, 16 - adds r1, r0 - adds r1, r4 - lsls r1, 5 - ldr r3, =0x06010000 - adds r1, r3 - adds r0, r6, 0 - ldr r2, =0x04000008 - bl CpuSet - adds r4, 0x1 - cmp r4, 0x2 - ble _08074542 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - adds r0, r7, r0 - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _08074598 - movs r0, 0x1 - bl sub_80728A4 - ldr r2, =0x02020630 - mov r3, r10 - lsls r1, r3, 4 - add r1, r10 - lsls r1, 2 - adds r1, r2 - ldrh r1, [r1, 0x4] - lsls r1, 22 - lsrs r1, 17 - ldr r2, =0x06010000 - adds r1, r2 - ldr r2, =0x04000010 - bl CpuSet -_08074598: - mov r0, r9 - movs r1, 0x1 - bl sub_8074310 - b _0807467A - .pool -_080745B8: - mov r1, r9 - lsls r5, r1, 4 - add r5, r9 - lsls r5, 2 - ldr r2, =0x02020630 - adds r5, r2 - ldrb r4, [r5, 0x5] - lsrs r4, 4 - lsls r4, 4 - adds r4, 0xC - adds r4, r7 - ldr r1, =gUnknown_0832C3EC - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - movs r3, 0x80 - lsls r3, 1 - adds r1, r4, r3 - movs r2, 0x2 - bl rboxid_80040B8 - lsls r4, 1 - ldr r0, =0x02037914 - adds r0, r4, r0 - ldr r1, =0x05000200 - adds r4, r1 - adds r1, r4, 0 - movs r2, 0x1 - bl CpuSet - ldrh r1, [r5, 0x4] - lsls r1, 22 - lsrs r1, 22 - add r1, r8 - lsls r1, 5 - ldr r2, =0x06010000 - mov r8, r2 - add r1, r8 - ldr r2, =0x04000018 - adds r0, r6, 0 - bl CpuSet - bl battle_type_is_double - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08074626 - adds r0, r7, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08074672 -_08074626: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r7, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _08074672 - movs r0, 0 - bl sub_80728A4 - mov r3, r10 - lsls r4, r3, 4 - add r4, r10 - lsls r4, 2 - ldr r1, =0x02020630 - adds r4, r1 - ldrh r1, [r4, 0x4] - lsls r1, 22 - lsrs r1, 17 - add r1, r8 - ldr r5, =0x04000008 - adds r2, r5, 0 - bl CpuSet - movs r0, 0x41 - bl sub_80728A4 - ldrh r1, [r4, 0x4] - lsls r1, 22 - lsrs r1, 17 - adds r1, 0x20 - add r1, r8 - adds r2, r5, 0 - bl CpuSet -_08074672: - mov r0, r9 - movs r1, 0 - bl sub_8074310 -_0807467A: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end draw_status_ailment_maybe - - thumb_func_start sub_80746A8 -sub_80746A8: @ 80746A8 - push {lr} - lsls r0, 24 - lsls r1, 24 - lsrs r3, r1, 24 - lsrs r2, r0, 24 - adds r0, r2, 0 - subs r0, 0x15 - cmp r0, 0xC - bhi _08074768 - lsls r0, 2 - ldr r1, =_080746C8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080746C8: - .4byte _080746FC - .4byte _08074768 - .4byte _08074768 - .4byte _08074712 - .4byte _08074768 - .4byte _08074768 - .4byte _08074728 - .4byte _08074768 - .4byte _08074768 - .4byte _0807473E - .4byte _08074768 - .4byte _08074768 - .4byte _08074754 -_080746FC: - movs r2, 0x15 - cmp r3, 0 - beq _08074768 - movs r2, 0x47 - cmp r3, 0x1 - beq _08074768 - movs r2, 0x65 - cmp r3, 0x2 - bne _08074768 - movs r2, 0x56 - b _08074768 -_08074712: - movs r2, 0x18 - cmp r3, 0 - beq _08074768 - movs r2, 0x4A - cmp r3, 0x1 - beq _08074768 - movs r2, 0x68 - cmp r3, 0x2 - bne _08074768 - movs r2, 0x59 - b _08074768 -_08074728: - movs r2, 0x1B - cmp r3, 0 - beq _08074768 - movs r2, 0x4D - cmp r3, 0x1 - beq _08074768 - movs r2, 0x6B - cmp r3, 0x2 - bne _08074768 - movs r2, 0x5C - b _08074768 -_0807473E: - movs r2, 0x1E - cmp r3, 0 - beq _08074768 - movs r2, 0x50 - cmp r3, 0x1 - beq _08074768 - movs r2, 0x6E - cmp r3, 0x2 - bne _08074768 - movs r2, 0x5F - b _08074768 -_08074754: - movs r2, 0x21 - cmp r3, 0 - beq _08074768 - movs r2, 0x53 - cmp r3, 0x1 - beq _08074768 - movs r2, 0x71 - cmp r3, 0x2 - bne _08074768 - movs r2, 0x62 -_08074768: - adds r0, r2, 0 - pop {r1} - bx r1 - thumb_func_end sub_80746A8 - - thumb_func_start sub_8074770 -sub_8074770: @ 8074770 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_085CCB2C - add r1, sp, 0x4 - str r1, [sp] - movs r1, 0 - movs r2, 0x3 - movs r3, 0x2 - bl write_to_rbox - adds r5, r0, 0 - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrh r4, [r0, 0x4] - lsls r4, 22 - lsrs r4, 17 - ldr r1, =0x06010040 - adds r0, r4, r1 - adds r1, r5, 0 - movs r2, 0x6 - bl sub_8075198 - ldr r0, =0x06010800 - adds r4, r0 - adds r5, 0xC0 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - bl sub_8075198 - ldr r0, [sp, 0x4] - bl sub_807512C - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8074770 - - thumb_func_start sub_80747D8 -sub_80747D8: @ 80747D8 - push {r4,r5,lr} - sub sp, 0x18 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gUnknown_085CCB3C - add r0, sp, 0x4 - bl CopyString - ldr r1, =0x0203a04c - ldrb r1, [r1] - movs r2, 0 - movs r3, 0x2 - bl ConvertIntToDecimalString - movs r0, 0 - add r1, sp, 0x4 - movs r2, 0x2F - bl GetStringRightAlignXOffset - adds r1, r0, 0 - add r0, sp, 0x14 - str r0, [sp] - add r0, sp, 0x4 - movs r2, 0x3 - movs r3, 0x2 - bl write_to_rbox - adds r5, r0, 0 - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrh r4, [r0, 0x4] - lsls r4, 22 - lsrs r4, 17 - ldr r1, =0x060102c0 - adds r0, r4, r1 - adds r1, r5, 0 - movs r2, 0x2 - bl sub_80751E4 - ldr r0, =0x06010a00 - adds r4, r0 - adds r5, 0x40 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x4 - bl sub_80751E4 - ldr r0, [sp, 0x14] - bl sub_807512C - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80747D8 - - thumb_func_start healthbar_draw_field_maybe -healthbar_draw_field_maybe: @ 8074860 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r1 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r2, 24 - lsrs r7, r2, 24 - ldr r1, =0x02020630 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x3A] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - cmp r7, 0 - bne _0807489C - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _0807489C - mov r0, r9 - bl battle_side_get_owner -_0807489C: - ldr r1, =0x02020630 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x3A] - lsls r0, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080748B8 - b _08074A18 -_080748B8: - cmp r7, 0x3 - beq _080748C0 - cmp r7, 0 - bne _080748D4 -_080748C0: - mov r0, r8 - movs r1, 0x38 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl healthbar_draw_level -_080748D4: - cmp r7, 0x1 - bhi _080748EE - mov r0, r8 - movs r1, 0x39 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r6, 0 - movs r2, 0 - bl heathbar_draw_hp -_080748EE: - cmp r7, 0x2 - beq _080748F6 - cmp r7, 0 - bne _0807490C -_080748F6: - mov r0, r8 - movs r1, 0x3A - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r6, 0 - movs r2, 0x1 - bl heathbar_draw_hp -_0807490C: - cmp r7, 0x5 - beq _08074914 - cmp r7, 0 - bne _08074948 -_08074914: - movs r0, 0 - bl load_gfxc_health_bar - mov r0, r8 - movs r1, 0x3A - bl pokemon_getattr - adds r4, r0, 0 - mov r0, r8 - movs r1, 0x39 - bl pokemon_getattr - adds r3, r0, 0 - movs r0, 0 - str r0, [sp] - mov r0, r9 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_807294C - mov r0, r9 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0 - bl sub_8074AA0 -_08074948: - bl battle_type_is_double - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - cmp r0, 0 - bne _080749CE - cmp r7, 0x6 - beq _0807495E - cmp r7, 0 - bne _080749CE -_0807495E: - movs r0, 0x3 - bl load_gfxc_health_bar - mov r0, r8 - movs r1, 0xB - bl pokemon_getattr - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - mov r0, r8 - movs r1, 0x38 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - mov r0, r8 - movs r1, 0x19 - bl pokemon_getattr - adds r3, r0, 0 - ldr r0, =gExperienceTables - mov r12, r0 - lsls r1, r4, 2 - ldr r2, =gBaseStats - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r2 - ldrb r2, [r0, 0x13] - movs r0, 0xCA - lsls r0, 1 - muls r0, r2 - adds r1, r0 - add r1, r12 - ldr r1, [r1] - subs r3, r1 - adds r4, 0x1 - lsls r4, 2 - adds r4, r0 - add r4, r12 - ldr r2, [r4] - subs r2, r1 - mov r0, r10 - str r0, [sp] - mov r0, r9 - adds r1, r6, 0 - bl sub_807294C - mov r0, r9 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0 - bl sub_8074AA0 -_080749CE: - cmp r7, 0x4 - beq _080749D6 - cmp r7, 0 - bne _080749DE -_080749D6: - adds r0, r6, 0 - mov r1, r8 - bl sub_80741E8 -_080749DE: - cmp r7, 0x9 - beq _080749E6 - cmp r7, 0 - bne _080749EC -_080749E6: - adds r0, r6, 0 - bl draw_status_ailment_maybe -_080749EC: - cmp r7, 0xA - bne _080749F6 - adds r0, r6, 0 - bl sub_8074770 -_080749F6: - adds r0, r7, 0 - subs r0, 0xA - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _08074A8E - adds r0, r6, 0 - bl sub_80747D8 - b _08074A8E - .pool -_08074A18: - cmp r7, 0x3 - beq _08074A20 - cmp r7, 0 - bne _08074A34 -_08074A20: - mov r0, r8 - movs r1, 0x38 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl healthbar_draw_level -_08074A34: - cmp r7, 0x5 - beq _08074A3C - cmp r7, 0 - bne _08074A70 -_08074A3C: - movs r0, 0 - bl load_gfxc_health_bar - mov r0, r8 - movs r1, 0x3A - bl pokemon_getattr - adds r4, r0, 0 - mov r0, r8 - movs r1, 0x39 - bl pokemon_getattr - adds r3, r0, 0 - movs r0, 0 - str r0, [sp] - mov r0, r9 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_807294C - mov r0, r9 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0 - bl sub_8074AA0 -_08074A70: - cmp r7, 0x4 - beq _08074A78 - cmp r7, 0 - bne _08074A80 -_08074A78: - adds r0, r6, 0 - mov r1, r8 - bl sub_80741E8 -_08074A80: - cmp r7, 0x9 - beq _08074A88 - cmp r7, 0 - bne _08074A8E -_08074A88: - adds r0, r6, 0 - bl draw_status_ailment_maybe -_08074A8E: - 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 healthbar_draw_field_maybe - - thumb_func_start sub_8074AA0 -sub_8074AA0: @ 8074AA0 - 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 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - cmp r2, 0 - bne _08074AEC - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0xC] - mov r1, r8 - lsls r5, r1, 2 - adds r3, r5, r1 - lsls r3, 2 - adds r3, r0 - ldr r0, [r3, 0x4] - ldr r1, [r3, 0x8] - ldr r2, [r3, 0xC] - adds r3, 0x10 - movs r4, 0x6 - str r4, [sp] - movs r4, 0x1 - str r4, [sp, 0x4] - bl sub_8074DB8 - adds r4, r0, 0 - adds r7, r5, 0 - b _08074B48 - .pool -_08074AEC: - ldr r2, =0x020244d0 - mov r10, r2 - ldr r0, [r2] - ldr r2, [r0, 0xC] - mov r0, r8 - lsls r4, r0, 2 - adds r0, r4, r0 - lsls r6, r0, 2 - adds r2, r6, r2 - ldr r0, [r2, 0x8] - ldr r1, [r2, 0xC] - ldr r2, [r2, 0x4] - movs r3, 0x8 - bl sub_8074FE8 - lsls r0, 24 - lsrs r5, r0, 24 - adds r7, r4, 0 - cmp r5, 0 - bne _08074B16 - movs r5, 0x1 -_08074B16: - mov r1, r10 - ldr r0, [r1] - ldr r0, [r0, 0xC] - adds r4, r6, r0 - ldr r6, [r4, 0xC] - adds r0, r6, 0 - adds r1, r5, 0 - bl __divsi3 - cmp r0, 0 - bge _08074B2E - negs r0, r0 -_08074B2E: - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, [r4, 0x4] - ldr r1, [r4, 0x8] - adds r3, r4, 0 - adds r3, 0x10 - movs r2, 0x8 - str r2, [sp] - str r5, [sp, 0x4] - adds r2, r6, 0 - bl sub_8074DB8 - adds r4, r0, 0 -_08074B48: - mov r2, r9 - cmp r2, 0x1 - beq _08074B64 - cmp r2, 0 - bne _08074B6C - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - adds r0, r7, r0 - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _08074B6C -_08074B64: - mov r0, r8 - mov r1, r9 - bl sub_8074B9C -_08074B6C: - movs r0, 0x1 - negs r0, r0 - cmp r4, r0 - bne _08074B86 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0xC] - mov r2, r8 - adds r0, r7, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0 - str r1, [r0, 0x10] -_08074B86: - adds r0, r4, 0 - 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_8074AA0 - - thumb_func_start sub_8074B9C -sub_8074B9C: @ 8074B9C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0 - beq _08074BB8 - cmp r1, 0x1 - beq _08074CA0 - b _08074D9E -_08074BB8: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0xC] - lsls r5, r6, 2 - adds r3, r5, r6 - lsls r3, 2 - adds r3, r0 - ldr r0, [r3, 0x4] - ldr r1, [r3, 0x8] - ldr r2, [r3, 0xC] - adds r3, 0x10 - add r4, sp, 0x8 - str r4, [sp] - movs r4, 0x6 - str r4, [sp, 0x4] - bl sub_8074E8C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - mov r9, r1 - adds r7, r5, 0 - cmp r0, 0x18 - bhi _08074BF4 - movs r2, 0x38 - mov r9, r2 - cmp r0, 0x9 - bls _08074BF4 - movs r4, 0x2F - mov r9, r4 -_08074BF4: - movs r5, 0 - ldr r0, =0x02020630 - mov r8, r0 -_08074BFA: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0xC] - adds r0, r7, r6 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldrh r0, [r0, 0x38] - lsls r0, 24 - lsrs r4, r0, 24 - cmp r5, 0x1 - bhi _08074C5C - mov r0, r9 - bl sub_80728A4 - mov r1, sp - adds r1, r5 - adds r1, 0x8 - ldrb r1, [r1] - lsls r1, 5 - adds r0, r1 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - add r1, r8 - ldrh r1, [r1, 0x4] - lsls r1, 22 - lsrs r1, 22 - adds r2, r5, 0x2 - adds r1, r2 - lsls r1, 5 - ldr r2, =0x06010000 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - b _08074C8A - .pool -_08074C5C: - mov r0, r9 - bl sub_80728A4 - mov r1, sp - adds r1, r5 - adds r1, 0x8 - ldrb r1, [r1] - lsls r1, 5 - adds r0, r1 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - add r1, r8 - ldrh r1, [r1, 0x4] - lsls r1, 22 - lsrs r1, 22 - adds r1, r5, r1 - lsls r1, 5 - ldr r4, =0x06010040 - adds r1, r4 - ldr r2, =0x04000008 - bl CpuSet -_08074C8A: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _08074BFA - b _08074D9E - .pool -_08074CA0: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0xC] - lsls r5, r6, 2 - adds r3, r5, r6 - lsls r3, 2 - adds r3, r0 - ldr r0, [r3, 0x4] - ldr r1, [r3, 0x8] - ldr r2, [r3, 0xC] - adds r3, 0x10 - add r4, sp, 0x8 - str r4, [sp] - movs r4, 0x8 - str r4, [sp, 0x4] - bl sub_8074E8C - ldr r1, =0x0202406e - lsls r0, r6, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x38 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - adds r7, r5, 0 - cmp r0, 0x64 - bne _08074CF8 - movs r5, 0 - movs r1, 0 -_08074CE6: - mov r0, sp - adds r0, r5 - adds r0, 0x8 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x7 - bls _08074CE6 -_08074CF8: - movs r5, 0 - ldr r0, =0x02020630 - mov r8, r0 - adds r0, r7, r6 - lsls r4, r0, 2 -_08074D02: - cmp r5, 0x3 - bhi _08074D5C - movs r0, 0xC - bl sub_80728A4 - mov r1, sp - adds r1, r5 - adds r1, 0x8 - ldrb r1, [r1] - lsls r1, 5 - adds r0, r1 - ldr r1, =0x020244d0 - ldr r1, [r1] - ldr r1, [r1, 0xC] - adds r1, r4, r1 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r8 - ldrh r1, [r1, 0x4] - lsls r1, 22 - lsrs r1, 22 - adds r2, r5, 0 - adds r2, 0x24 - adds r1, r2 - lsls r1, 5 - ldr r2, =0x06010000 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - b _08074D94 - .pool -_08074D5C: - movs r0, 0xC - bl sub_80728A4 - mov r1, sp - adds r1, r5 - adds r1, 0x8 - ldrb r1, [r1] - lsls r1, 5 - adds r0, r1 - ldr r1, =0x020244d0 - ldr r1, [r1] - ldr r1, [r1, 0xC] - adds r1, r4, r1 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r8 - ldrh r1, [r1, 0x4] - lsls r1, 22 - lsrs r1, 22 - adds r1, r5, r1 - lsls r1, 5 - ldr r2, =0x06010b80 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet -_08074D94: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x7 - bls _08074D02 -_08074D9E: - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8074B9C - - thumb_func_start sub_8074DB8 -sub_8074DB8: @ 8074DB8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r0, 0 - adds r4, r1, 0 - mov r8, r2 - adds r5, r3, 0 - ldr r1, [sp, 0x18] - ldr r0, [sp, 0x1C] - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, 27 - lsrs r2, r1, 24 - ldr r1, [r5] - ldr r0, =0xffff8000 - cmp r1, r0 - bne _08074DEA - cmp r7, r2 - bge _08074DE8 - lsls r0, r4, 8 - str r0, [r5] - b _08074DEA - .pool -_08074DE8: - str r4, [r5] -_08074DEA: - mov r0, r8 - subs r4, r0 - cmp r4, 0 - bge _08074DF6 - movs r4, 0 - b _08074DFC -_08074DF6: - cmp r4, r7 - ble _08074DFC - adds r4, r7, 0 -_08074DFC: - cmp r7, r2 - bge _08074E18 - ldr r0, [r5] - asrs r1, r0, 8 - adds r6, r0, 0 - cmp r4, r1 - bne _08074E24 - movs r0, 0xFF - ands r0, r6 - cmp r0, 0 - bne _08074E24 - movs r0, 0x1 - negs r0, r0 - b _08074E80 -_08074E18: - ldr r6, [r5] - cmp r4, r6 - bne _08074E24 - movs r0, 0x1 - negs r0, r0 - b _08074E80 -_08074E24: - cmp r7, r2 - bge _08074E5E - lsls r0, r7, 8 - adds r1, r2, 0 - bl __divsi3 - mov r1, r8 - cmp r1, 0 - bge _08074E42 - adds r0, r6, r0 - str r0, [r5] - asrs r2, r0, 8 - cmp r2, r4 - blt _08074E7E - b _08074E56 -_08074E42: - subs r0, r6, r0 - str r0, [r5] - asrs r2, r0, 8 - movs r1, 0xFF - ands r0, r1 - cmp r0, 0 - ble _08074E52 - adds r2, 0x1 -_08074E52: - cmp r2, r4 - bgt _08074E7E -_08074E56: - lsls r0, r4, 8 - str r0, [r5] - adds r2, r4, 0 - b _08074E7E -_08074E5E: - mov r0, r8 - cmp r0, 0 - bge _08074E70 - ldr r0, [r5] - adds r0, r3 - str r0, [r5] - cmp r0, r4 - ble _08074E7C - b _08074E7A -_08074E70: - ldr r0, [r5] - subs r0, r3 - str r0, [r5] - cmp r0, r4 - bge _08074E7C -_08074E7A: - str r4, [r5] -_08074E7C: - ldr r2, [r5] -_08074E7E: - adds r0, r2, 0 -_08074E80: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8074DB8 - - thumb_func_start sub_8074E8C -sub_8074E8C: @ 8074E8C - push {r4-r7,lr} - adds r4, r0, 0 - mov r12, r3 - ldr r7, [sp, 0x14] - ldr r0, [sp, 0x18] - lsls r0, 24 - lsrs r6, r0, 24 - subs r5, r1, r2 - cmp r5, 0 - bge _08074EA4 - movs r5, 0 - b _08074EAA -_08074EA4: - cmp r5, r4 - ble _08074EAA - adds r5, r4, 0 -_08074EAA: - lsls r0, r6, 27 - lsrs r3, r0, 24 - movs r1, 0 - cmp r1, r6 - bcs _08074EC4 - movs r2, 0 -_08074EB6: - adds r0, r7, r1 - strb r2, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, r6 - bcc _08074EB6 -_08074EC4: - cmp r4, r3 - bge _08074ED8 - mov r1, r12 - ldr r0, [r1] - muls r0, r3 - adds r1, r4, 0 - bl __divsi3 - asrs r0, 8 - b _08074EE4 -_08074ED8: - mov r1, r12 - ldr r0, [r1] - muls r0, r3 - adds r1, r4, 0 - bl __divsi3 -_08074EE4: - lsls r0, 24 - lsrs r2, r0, 24 - adds r3, r2, 0 - cmp r3, 0 - bne _08074EFA - cmp r5, 0 - ble _08074EFA - movs r0, 0x1 - strb r0, [r7] - movs r3, 0x1 - b _08074F1E -_08074EFA: - movs r1, 0 - movs r4, 0x8 -_08074EFE: - cmp r1, r6 - bcs _08074F1E - cmp r2, 0x7 - bls _08074F1A - adds r0, r7, r1 - strb r4, [r0] - adds r0, r2, 0 - subs r0, 0x8 - lsls r0, 24 - lsrs r2, r0, 24 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - b _08074EFE -_08074F1A: - adds r0, r7, r1 - strb r2, [r0] -_08074F1E: - adds r0, r3, 0 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8074E8C - - thumb_func_start sub_8074F28 -sub_8074F28: @ 8074F28 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r5, r0, 0 - adds r6, r1, 0 - adds r4, r2, 0 - mov r8, r3 - ldr r0, [r5] - ldr r1, [r5, 0x4] - ldr r2, [r5, 0x8] - movs r3, 0x6 - str r3, [sp] - movs r3, 0x1 - str r3, [sp, 0x4] - adds r3, r6, 0 - bl sub_8074DB8 - lsls r0, 16 - lsrs r7, r0, 16 - adds r0, r5, 0 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_8074F88 - ldr r0, [r5] - cmp r0, 0x2F - bgt _08074F68 - ldr r0, [r6] - lsls r0, 8 - lsrs r1, r0, 16 - b _08074F6A -_08074F68: - ldrh r1, [r6] -_08074F6A: - movs r2, 0 - ldrsh r0, [r5, r2] - lsls r1, 16 - asrs r1, 16 - mov r2, r8 - bl sub_8072304 - lsls r0, r7, 16 - asrs r0, 16 - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8074F28 - - thumb_func_start sub_8074F88 -sub_8074F88: @ 8074F88 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x1C - adds r5, r0, 0 - adds r3, r1, 0 - mov r8, r2 - ldr r0, [r5] - ldr r1, [r5, 0x4] - ldr r2, [r5, 0x8] - add r4, sp, 0x8 - str r4, [sp] - movs r4, 0x6 - str r4, [sp, 0x4] - bl sub_8074E8C - movs r3, 0 - add r7, sp, 0x10 - mov r12, r7 - ldrb r0, [r5, 0xC] - lsls r6, r0, 27 - ldr r4, [r5, 0x10] -_08074FB4: - lsls r2, r3, 1 - add r2, r12 - lsrs r1, r6, 15 - mov r0, sp - adds r0, r3 - adds r0, 0x8 - ldrb r0, [r0] - adds r0, r4, r0 - orrs r1, r0 - strh r1, [r2] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x5 - bls _08074FB4 - adds r0, r7, 0 - mov r1, r8 - movs r2, 0x6 - bl CpuSet - add sp, 0x1C - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8074F88 - - thumb_func_start sub_8074FE8 -sub_8074FE8: @ 8074FE8 - push {r4-r7,lr} - adds r6, r2, 0 - lsls r3, 27 - lsrs r7, r3, 24 - subs r5, r0, r1 - cmp r5, 0 - bge _08074FFA - movs r5, 0 - b _08075000 -_08074FFA: - cmp r5, r6 - ble _08075000 - adds r5, r6, 0 -_08075000: - muls r0, r7 - adds r1, r6, 0 - bl __divsi3 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - muls r0, r7 - adds r1, r6, 0 - bl __divsi3 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - subs r0, r4, r0 - cmp r0, 0 - bge _08075028 - negs r0, r0 -_08075028: - lsls r0, 24 - lsrs r0, 24 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8074FE8 - - thumb_func_start sub_8075034 -sub_8075034: @ 8075034 - push {r4,lr} - lsls r2, 24 - lsrs r2, 24 - lsls r0, 16 - asrs r4, r0, 16 - adds r0, r4, 0 - muls r0, r2 - lsls r1, 16 - asrs r1, 16 - bl __divsi3 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08075058 - cmp r4, 0 - ble _08075058 - movs r0, 0x1 -_08075058: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8075034 - - thumb_func_start sub_8075060 -sub_8075060: @ 8075060 - push {lr} - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - cmp r0, r1 - bne _08075072 - movs r0, 0x4 - b _0807508E -_08075072: - movs r2, 0x30 - bl sub_8075034 - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0x3 - cmp r1, 0x18 - bhi _0807508E - movs r0, 0x2 - cmp r1, 0x9 - bhi _0807508E - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 -_0807508E: - pop {r1} - bx r1 - thumb_func_end sub_8075060 - - thumb_func_start write_to_rbox -write_to_rbox: @ 8075094 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - mov r10, r0 - mov r8, r1 - mov r9, r2 - adds r5, r3, 0 - ldr r7, [sp, 0x40] - ldr r0, =gUnknown_0832C3F8 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x18] - str r1, [sp, 0x1C] - add r0, sp, 0x18 - bl AddWindow - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r6, r4, 24 - lsrs r6, 24 - lsls r1, r5, 4 - orrs r1, r5 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl FillWindowPixelBuffer - add r0, sp, 0x14 - movs r2, 0 - strb r5, [r0] - adds r1, r0, 0 - movs r0, 0x1 - strb r0, [r1, 0x1] - movs r0, 0x3 - strb r0, [r1, 0x2] - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - str r2, [sp] - str r2, [sp, 0x4] - str r1, [sp, 0x8] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0xC] - mov r0, r10 - str r0, [sp, 0x10] - adds r0, r6, 0 - movs r1, 0 - mov r2, r8 - mov r3, r9 - bl AddTextPrinterParametrized2 - str r4, [r7] - adds r0, r6, 0 - movs r1, 0x7 - bl GetWindowAttribute - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end write_to_rbox - - thumb_func_start sub_807512C -sub_807512C: @ 807512C - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl RemoveWindow - pop {r0} - bx r0 - thumb_func_end sub_807512C - - thumb_func_start sub_807513C -sub_807513C: @ 807513C - push {lr} - sub sp, 0x4 - adds r3, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r1, r0, 8 - adds r0, r1 - lsls r1, r0, 16 - adds r0, r1 - str r0, [sp] - lsls r2, 3 - ldr r0, =0x001fffff - ands r2, r0 - movs r0, 0xA0 - lsls r0, 19 - orrs r2, r0 - mov r0, sp - adds r1, r3, 0 - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_807513C - - thumb_func_start sub_8075170 -sub_8075170: @ 8075170 - push {lr} - adds r3, r0, 0 - adds r0, r1, 0 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - lsls r2, 3 - ldr r1, =0x001fffff - ands r2, r1 - movs r1, 0x80 - lsls r1, 19 - orrs r2, r1 - adds r1, r3, 0 - bl CpuSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_8075170 - - thumb_func_start sub_8075198 -sub_8075198: @ 8075198 - push {r4-r6,lr} - adds r6, r0, 0 - adds r5, r1, 0 - adds r4, r2, 0 - movs r1, 0x80 - lsls r1, 1 - adds r0, r5, r1 - adds r1, r6, r1 - lsls r2, r4, 3 - ldr r3, =0x001fffff - ands r2, r3 - movs r3, 0x80 - lsls r3, 19 - orrs r2, r3 - bl CpuSet - cmp r4, 0 - ble _080751D4 -_080751BC: - adds r0, r5, 0 - adds r0, 0x14 - adds r1, r6, 0 - adds r1, 0x14 - ldr r2, =0x04000003 - bl CpuSet - adds r6, 0x20 - adds r5, 0x20 - subs r4, 0x1 - cmp r4, 0 - bne _080751BC -_080751D4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8075198 - - thumb_func_start sub_80751E4 -sub_80751E4: @ 80751E4 - push {r4-r6,lr} - adds r6, r0, 0 - adds r5, r1, 0 - lsls r4, r2, 3 - ldr r0, =0x001fffff - ands r4, r0 - movs r0, 0x80 - lsls r0, 19 - orrs r4, r0 - adds r0, r5, 0 - adds r1, r6, 0 - adds r2, r4, 0 - bl CpuSet - movs r0, 0x80 - lsls r0, 1 - adds r5, r0 - adds r6, r0 - adds r0, r5, 0 - adds r1, r6, 0 - adds r2, r4, 0 - bl CpuSet - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80751E4 - - thumb_func_start sub_807521C -sub_807521C: @ 807521C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 24 - lsrs r4, r2, 24 - ldr r5, =gUnknown_0831C620 - ldrh r0, [r5, 0x6] - bl GetObjectTileRangeStartByTag - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - bne _0807524E - adds r0, r5, 0 - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_0831C628 - bl LoadCompressedObjectPaletteUsingHeap -_0807524E: - ldr r0, =sub_8075370 - bl object_new_hidden_with_callback - mov r8, r0 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r5, r0, 4 - add r5, r8 - lsls r5, 2 - ldr r0, =0x02020630 - adds r5, r0 - strh r4, [r5, 0x30] - ldr r0, =gUnknown_0831C688 - mov r9, r0 - lsls r6, 16 - asrs r0, r6, 16 - mov r10, r0 - ldr r0, =0xfff00000 - adds r6, r0 - asrs r6, 16 - lsls r4, r7, 16 - asrs r7, r4, 16 - adds r4, r0 - asrs r4, 16 - mov r0, r9 - adds r1, r6, 0 - adds r2, r4, 0 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - mov r0, r8 - strh r0, [r1, 0x2E] - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - adds r0, r1, 0 - bl AnimateObject - mov r0, r9 - mov r1, r10 - adds r2, r4, 0 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - mov r0, r8 - strh r0, [r4, 0x2E] - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnim - adds r0, r4, 0 - bl AnimateObject - mov r0, r9 - adds r1, r6, 0 - adds r2, r7, 0 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - mov r0, r8 - strh r0, [r4, 0x2E] - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectImageAnim - adds r0, r4, 0 - bl AnimateObject - mov r0, r9 - mov r1, r10 - adds r2, r7, 0 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - mov r0, r8 - strh r0, [r4, 0x2E] - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - adds r0, r4, 0 - movs r1, 0x3 - bl StartObjectImageAnim - adds r0, r4, 0 - bl AnimateObject - mov r0, r8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_807521C - - thumb_func_start sub_8075370 -sub_8075370: @ 8075370 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080753A8 - ldr r0, =gUnknown_0831C620 - ldrh r0, [r0, 0x6] - bl FreeObjectTilesByTag - ldr r0, =gUnknown_0831C628 - ldrh r0, [r0, 0x4] - bl FreeObjectPaletteByTag - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080753A4 - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - b _080753A8 - .pool -_080753A4: - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] -_080753A8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8075370 - - thumb_func_start sub_80753B4 -sub_80753B4: @ 80753B4 - push {lr} - adds r3, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080753DE - ldr r2, =0x02020630 - movs r0, 0x2E - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x2E] - subs r1, 0x1 - strh r1, [r0, 0x2E] - adds r0, r3, 0 - bl RemoveObjectAndFreeTiles -_080753DE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80753B4 - - thumb_func_start sub_80753E8 -sub_80753E8: @ 80753E8 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =0x020244b9 - movs r0, 0x1 - strb r0, [r1] - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r6, =0x02024064 - ldrb r1, [r6] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0] - ldr r0, =sub_8075450 - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0xA] - strh r5, [r1, 0xC] - ldrb r0, [r6] - strh r0, [r1, 0xE] - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80753E8 - - thumb_func_start sub_8075450 -sub_8075450: @ 8075450 - 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 r10, r0 - movs r0, 0 - str r0, [sp] - ldr r1, =0x03005e00 - mov r2, r10 - lsls r0, r2, 2 - add r0, r10 - lsls r0, 3 - adds r1, r0, r1 - ldrh r2, [r1, 0x8] - movs r3, 0x8 - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _08075488 - adds r0, r2, 0x1 - strh r0, [r1, 0x8] - b _08075602 - .pool -_08075488: - ldrh r0, [r1, 0xC] - mov r8, r0 - ldrb r5, [r1, 0xE] - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080754B4 - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - b _080754C2 - .pool -_080754B4: - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec -_080754C2: - adds r0, r1 - movs r1, 0x26 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - bl ball_number_to_ball_processing_index - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_8076A78 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - ldr r1, =gUnknown_0832C588 - adds r0, r1 - movs r1, 0x20 - movs r2, 0x50 - movs r3, 0x1D - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - ldr r2, =0x02020630 - mov r9, r2 - lsls r0, r7, 4 - adds r0, r7 - lsls r6, r0, 2 - adds r4, r6, r2 - movs r0, 0x80 - strh r0, [r4, 0x2E] - movs r3, 0 - strh r3, [r4, 0x30] - mov r0, r8 - strh r0, [r4, 0x3C] - mov r2, r8 - cmp r2, 0xFE - beq _08075548 - cmp r2, 0xFF - bne _08075584 - ldr r0, =0x0202420c - strb r5, [r0] - movs r0, 0x18 - strh r0, [r4, 0x20] - movs r0, 0x44 - strh r0, [r4, 0x22] - mov r0, r9 - adds r0, 0x1C - adds r0, r6, r0 - ldr r1, =sub_80761B4 - str r1, [r0] - b _08075592 - .pool -_08075548: - adds r0, r5, 0 - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x20] - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x18 - strh r0, [r4, 0x22] - ldr r0, =0x0202420c - strb r5, [r0] - movs r3, 0 - strh r3, [r4, 0x2E] - mov r0, r9 - adds r0, 0x1C - adds r0, r6, r0 - ldr r1, =sub_8076398 - str r1, [r0] - b _08075592 - .pool -_08075584: - movs r0, 0x1 - bl battle_get_side_with_given_state - ldr r1, =0x0202420c - strb r0, [r1] - movs r0, 0x1 - str r0, [sp] -_08075592: - ldr r0, =0x02020630 - lsls r1, r7, 4 - adds r1, r7 - lsls r1, 2 - adds r4, r1, r0 - ldr r5, =0x0202420c - ldrb r0, [r5] - strh r0, [r4, 0x3A] - ldr r2, [sp] - cmp r2, 0 - bne _080755B8 - mov r0, r10 - bl DestroyTask - b _08075602 - .pool -_080755B8: - movs r0, 0x22 - strh r0, [r4, 0x2E] - ldrb r0, [r5] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrb r0, [r5] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x10 - strh r0, [r4, 0x36] - ldr r0, =0x0000ffd8 - strh r0, [r4, 0x38] - adds r0, r4, 0 - bl sub_80A68D4 - mov r3, r10 - strh r3, [r4, 0x6] - ldr r1, =0x03005e00 - mov r2, r10 - lsls r0, r2, 2 - add r0, r10 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r5] - strh r1, [r0, 0x10] - ldr r1, =TaskDummy - str r1, [r0] - movs r0, 0x3D - bl audio_play -_08075602: - 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_8075450 - - thumb_func_start objc_0804ABD4 -objc_0804ABD4: @ 8075620 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r7, r0, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _080756C0 - ldrb r6, [r7, 0x6] - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldrb r5, [r0, 0x10] - ldrb r0, [r0, 0xC] - mov r8, r0 - adds r0, r7, 0 - movs r1, 0x1 - bl StartObjectImageAnim - adds r2, r7, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r7, 0x24] - ldrh r1, [r7, 0x20] - adds r0, r1 - movs r1, 0 - strh r0, [r7, 0x20] - ldrh r0, [r7, 0x26] - ldrh r2, [r7, 0x22] - adds r0, r2 - strh r0, [r7, 0x22] - strh r1, [r7, 0x24] - strh r1, [r7, 0x26] - strh r1, [r7, 0x38] - adds r0, r5, 0 - bl sub_8076B14 - lsls r0, 16 - lsrs r0, 16 - bl ball_number_to_ball_processing_index - adds r4, r0, 0 - ldrh r0, [r7, 0x20] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r7, 0x22] - subs r1, 0x5 - lsls r1, 24 - lsrs r1, 24 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp] - movs r2, 0x1 - movs r3, 0x1C - bl sub_8171D98 - movs r0, 0 - adds r1, r5, 0 - movs r2, 0xE - adds r3, r4, 0 - bl sub_81729E8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x2E] - strh r5, [r7, 0x3A] - mov r0, r8 - strh r0, [r7, 0x3C] - adds r0, r6, 0 - bl DestroyTask - ldr r0, =sub_80756D4 - str r0, [r7, 0x1C] -_080756C0: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end objc_0804ABD4 - - thumb_func_start sub_80756D4 -sub_80756D4: @ 80756D4 - ldr r1, =sub_80756E0 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_80756D4 - - thumb_func_start sub_80756E0 -sub_80756E0: @ 80756E0 - push {r4-r7,lr} - adds r6, r0, 0 - ldrh r0, [r6, 0x38] - adds r0, 0x1 - movs r7, 0 - strh r0, [r6, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bne _0807573A - strh r7, [r6, 0x38] - ldr r0, =sub_807574C - str r0, [r6, 0x1C] - ldr r5, =0x020241e4 - movs r1, 0x3A - ldrsh r0, [r6, r1] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - movs r1, 0x2 - bl StartObjectRotScalAnim - movs r1, 0x3A - ldrsh r0, [r6, r1] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl AnimateObject - movs r1, 0x3A - ldrsh r0, [r6, r1] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r7, [r0, 0x30] -_0807573A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80756E0 - - thumb_func_start sub_807574C -sub_807574C: @ 807574C - push {r4-r6,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB - bne _08075764 - movs r0, 0x3C - bl audio_play -_08075764: - ldr r6, =0x02020630 - ldr r5, =0x020241e4 - movs r1, 0x3A - ldrsh r0, [r4, r1] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r6 - adds r0, r1, 0 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _080757BC - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectImageAnim - movs r2, 0x3A - ldrsh r0, [r4, r2] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - movs r0, 0 - strh r0, [r4, 0x38] - ldr r0, =sub_80757E4 - str r0, [r4, 0x1C] - b _080757DC - .pool -_080757BC: - ldrh r0, [r1, 0x30] - adds r0, 0x60 - strh r0, [r1, 0x30] - movs r1, 0x3A - ldrsh r0, [r4, r1] - adds r0, r5 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - movs r2, 0x30 - ldrsh r0, [r1, r2] - negs r0, r0 - asrs r0, 8 - strh r0, [r1, 0x26] -_080757DC: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_807574C - - thumb_func_start sub_80757E4 -sub_80757E4: @ 80757E4 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0807582C - ldrh r0, [r4, 0x38] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _0807582C - strh r1, [r4, 0x34] - movs r0, 0x20 - strh r0, [r4, 0x36] - strh r1, [r4, 0x38] - movs r0, 0 - movs r1, 0x20 - bl cosine - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - movs r0, 0x36 - ldrsh r1, [r4, r0] - movs r0, 0 - bl cosine - negs r0, r0 - strh r0, [r4, 0x26] - ldr r0, =sub_8075838 - str r0, [r4, 0x1C] -_0807582C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80757E4 - - thumb_func_start sub_8075838 -sub_8075838: @ 8075838 - push {r4,r5,lr} - adds r4, r0, 0 - movs r5, 0 - ldrh r0, [r4, 0x34] - movs r1, 0xFF - ands r1, r0 - cmp r1, 0 - beq _0807584E - cmp r1, 0x1 - beq _080758C2 - b _080758EE -_0807584E: - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl cosine - negs r0, r0 - strh r0, [r4, 0x26] - ldrh r1, [r4, 0x38] - adds r1, 0x4 - ldrh r2, [r4, 0x34] - lsls r0, r2, 16 - asrs r0, 24 - adds r1, r0 - strh r1, [r4, 0x38] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x3F - ble _080758EE - ldrh r0, [r4, 0x36] - subs r0, 0xA - strh r0, [r4, 0x36] - ldr r1, =0x00000101 - adds r0, r2, r1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 24 - cmp r0, 0x4 - bne _0807588A - movs r5, 0x1 -_0807588A: - cmp r0, 0x2 - beq _080758AA - cmp r0, 0x2 - bgt _0807589C - cmp r0, 0x1 - beq _080758A2 - b _080758BA - .pool -_0807589C: - cmp r0, 0x3 - beq _080758B2 - b _080758BA -_080758A2: - movs r0, 0x38 - bl audio_play - b _080758EE -_080758AA: - movs r0, 0x39 - bl audio_play - b _080758EE -_080758B2: - movs r0, 0x3A - bl audio_play - b _080758EE -_080758BA: - movs r0, 0x3B - bl audio_play - b _080758EE -_080758C2: - movs r2, 0x38 - ldrsh r0, [r4, r2] - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl cosine - negs r0, r0 - strh r0, [r4, 0x26] - ldrh r1, [r4, 0x38] - subs r1, 0x4 - ldrh r2, [r4, 0x34] - lsls r0, r2, 16 - asrs r0, 24 - subs r1, r0 - strh r1, [r4, 0x38] - lsls r1, 16 - cmp r1, 0 - bgt _080758EE - strh r5, [r4, 0x38] - ldr r0, =0xffffff00 - ands r0, r2 - strh r0, [r4, 0x34] -_080758EE: - cmp r5, 0 - beq _08075926 - movs r5, 0 - strh r5, [r4, 0x34] - movs r0, 0x40 - movs r1, 0x20 - bl cosine - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - strh r5, [r4, 0x26] - movs r2, 0x3C - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0807591C - ldr r0, =sub_8075D14 - str r0, [r4, 0x1C] - b _08075926 - .pool -_0807591C: - ldr r0, =sub_8075930 - str r0, [r4, 0x1C] - movs r0, 0x1 - strh r0, [r4, 0x36] - strh r5, [r4, 0x38] -_08075926: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8075838 - - thumb_func_start sub_8075930 -sub_8075930: @ 8075930 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1F - bne _08075964 - movs r0, 0 - strh r0, [r4, 0x34] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - ldr r0, =sub_8075970 - str r0, [r4, 0x1C] - movs r0, 0x17 - bl audio_play -_08075964: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8075930 - - thumb_func_start sub_8075970 -sub_8075970: @ 8075970 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x34] - movs r1, 0xFF - ands r1, r0 - cmp r1, 0x4 - bhi _08075A70 - lsls r0, r1, 2 - ldr r1, =_0807598C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807598C: - .4byte _080759A0 - .4byte _080759D2 - .4byte _080759A0 - .4byte _08075A26 - .4byte _08075A70 -_080759A0: - ldrh r0, [r4, 0x36] - ldrh r2, [r4, 0x24] - adds r1, r0, r2 - strh r1, [r4, 0x24] - ldrh r1, [r4, 0x38] - adds r0, r1 - strh r0, [r4, 0x38] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x38] - adds r0, 0x3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x6 - bls _08075AB6 - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - movs r0, 0 - strh r0, [r4, 0x38] - b _08075AB6 -_080759D2: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _08075A18 - movs r0, 0 - strh r0, [r4, 0x38] - ldrh r0, [r4, 0x36] - negs r0, r0 - strh r0, [r4, 0x36] - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - movs r2, 0x36 - ldrsh r0, [r4, r2] - cmp r0, 0 - bge _08075A0E - adds r0, r4, 0 - movs r1, 0x2 - bl sub_80082B8 - b _08075AB6 -_08075A0E: - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80082B8 - b _08075AB6 -_08075A18: - adds r0, r4, 0 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] - b _08075AB6 -_08075A26: - movs r1, 0x80 - lsls r1, 1 - adds r0, r1, 0 - ldrh r2, [r4, 0x34] - adds r0, r2 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 24 - movs r2, 0x3C - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _08075A48 - ldr r0, =sub_8075D14 - str r0, [r4, 0x1C] - b _08075AB6 - .pool -_08075A48: - cmp r1, 0x4 - bne _08075A5C - cmp r0, 0x3 - bne _08075A5C - ldr r0, =sub_8075FB4 - str r0, [r4, 0x1C] - b _08075A62 - .pool -_08075A5C: - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] -_08075A62: - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - b _08075AB6 -_08075A70: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1F - bne _08075AB6 - movs r0, 0 - strh r0, [r4, 0x38] - ldrh r1, [r4, 0x34] - ldr r0, =0xffffff00 - ands r0, r1 - strh r0, [r4, 0x34] - adds r0, r4, 0 - movs r1, 0x3 - bl StartObjectRotScalAnim - movs r1, 0x36 - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _08075AA8 - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectRotScalAnim - b _08075AB0 - .pool -_08075AA8: - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim -_08075AB0: - movs r0, 0x17 - bl audio_play -_08075AB6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8075970 - - thumb_func_start c3_0804B070 -c3_0804B070: @ 8075ABC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r2, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r2 - ldrb r1, [r0, 0xC] - mov r12, r1 - ldrb r5, [r0, 0xA] - ldrh r6, [r0, 0x8] - ldrb r3, [r0, 0xE] - mov r8, r3 - ldrb r7, [r0, 0x10] - movs r3, 0x12 - ldrsh r1, [r0, r3] - lsls r3, r1, 16 - ldrh r1, [r0, 0x14] - orrs r3, r1 - movs r1, 0x26 - ldrsh r0, [r0, r1] - cmp r0, 0x20 - bhi _08075B88 - lsls r0, 2 - ldr r1, =_08075B04 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08075B04: - .4byte _08075B88 - .4byte _08075BB4 - .4byte _08075BDA - .4byte _08075C54 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075BF8 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075B88 - .4byte _08075C66 - .4byte _08075C7E - .4byte _08075CA8 -_08075B88: - ldr r0, =0x02020630 - lsls r1, r7, 4 - adds r1, r7 - lsls r1, 2 - adds r1, r0 - adds r1, 0x3F - ldrb r0, [r1] - lsls r0, 26 - cmp r0, 0 - blt _08075B9E - b _08075D04 -_08075B9E: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r2 - mov r1, r12 - adds r1, 0x1 - strh r1, [r0, 0x26] - b _08075D04 - .pool -_08075BB4: - adds r0, r3, 0 - bl sub_805F110 - cmp r0, 0x1 - bne _08075BCC - lsls r1, r5, 24 - asrs r1, 24 - adds r0, r6, 0 - movs r2, 0 - bl sub_80A32E4 - b _08075C2E -_08075BCC: - lsls r1, r5, 24 - asrs r1, 24 - adds r0, r6, 0 - movs r2, 0xB - bl sub_80A32E4 - b _08075C2E -_08075BDA: - bl sub_80A369C - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0x3 - strh r1, [r0, 0x1C] - movs r1, 0x14 - strh r1, [r0, 0x26] - b _08075D04 - .pool -_08075BF8: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r2 - ldrh r2, [r1, 0x1C] - movs r7, 0x1C - ldrsh r0, [r1, r7] - cmp r0, 0 - bne _08075CBA - adds r0, r3, 0 - bl sub_805F110 - cmp r0, 0x1 - bne _08075C22 - lsls r1, r5, 24 - asrs r1, 24 - adds r0, r6, 0 - movs r2, 0x1 - bl sub_80A3344 - b _08075C2E -_08075C22: - lsls r1, r5, 24 - asrs r1, 24 - adds r0, r6, 0 - movs r2, 0xC - bl sub_80A3344 -_08075C2E: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - mov r2, r8 - lsls r1, r2, 1 - add r1, r8 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x41 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - adds r0, r4, 0 - bl DestroyTask - b _08075D04 - .pool -_08075C54: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r2 - movs r1, 0x6 - strh r1, [r0, 0x1C] - movs r1, 0x1E - strh r1, [r0, 0x26] - b _08075D04 -_08075C66: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r2 - ldrh r2, [r1, 0x1C] - movs r3, 0x1C - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _08075CBA - ldrh r0, [r1, 0x26] - adds r0, 0x1 - strh r0, [r1, 0x26] -_08075C7E: - bl sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - bne _08075D04 - bl sub_80A369C - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0x3 - strh r0, [r1, 0x1C] - ldrh r0, [r1, 0x26] - adds r0, 0x1 - strh r0, [r1, 0x26] - b _08075D04 - .pool -_08075CA8: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r2 - ldrh r2, [r1, 0x1C] - movs r7, 0x1C - ldrsh r0, [r1, r7] - cmp r0, 0 - beq _08075CC0 -_08075CBA: - subs r0, r2, 0x1 - strh r0, [r1, 0x1C] - b _08075D04 -_08075CC0: - adds r0, r3, 0 - bl sub_805F110 - cmp r0, 0x1 - bne _08075CD8 - lsls r1, r5, 24 - asrs r1, 24 - adds r0, r6, 0 - movs r2, 0 - bl sub_80A3344 - b _08075CE4 -_08075CD8: - lsls r1, r5, 24 - asrs r1, 24 - adds r0, r6, 0 - movs r2, 0xB - bl sub_80A3344 -_08075CE4: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - mov r2, r8 - lsls r1, r2, 1 - add r1, r8 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x1] - movs r0, 0x41 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - adds r0, r4, 0 - bl DestroyTask -_08075D04: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end c3_0804B070 - - thumb_func_start sub_8075D14 -sub_8075D14: @ 8075D14 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r6, r0, 0 - ldrh r0, [r6, 0x3A] - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r6, 0 - movs r1, 0x1 - bl StartObjectImageAnim - adds r0, r5, 0 - bl sub_8076B14 - lsls r0, 16 - lsrs r0, 16 - bl ball_number_to_ball_processing_index - adds r4, r0, 0 - ldrh r0, [r6, 0x20] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x22] - subs r1, 0x5 - lsls r1, 24 - lsrs r1, 24 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp] - movs r2, 0x1 - movs r3, 0x1C - bl sub_8171D98 - ldrh r1, [r6, 0x3A] - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x1 - movs r2, 0xE - adds r3, r4, 0 - bl sub_81729E8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x2E] - ldr r0, =sub_8075FD4 - str r0, [r6, 0x1C] - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08075D88 - b _08075EF4 -_08075D88: - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08075DC0 - ldr r0, =0x0202406e - lsls r2, r5, 1 - adds r0, r2, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - adds r7, r1, r0 - movs r4, 0x19 - mov r10, r4 - b _08075DD4 - .pool -_08075DC0: - ldr r0, =0x0202406e - lsls r2, r5, 1 - adds r0, r2, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r7, r1, r0 - movs r0, 0xE7 - mov r10, r0 -_08075DD4: - mov r8, r2 - adds r0, r7, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - movs r0, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - beq _08075E00 - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bne _08075E56 -_08075E00: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08075E56 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r1, [r0, 0x9] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08075E56 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x42 - ands r0, r1 - cmp r0, 0x42 - bne _08075E4C - bl sub_80A38E4 - lsls r0, 24 - cmp r0, 0 - beq _08075E56 - ldr r0, =0x03007420 - bl MPlayStop_rev01 - b _08075E56 - .pool -_08075E4C: - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - bl MPlayVolumeControl -_08075E56: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08075E70 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r1, [r0, 0x9] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08075E80 -_08075E70: - movs r4, 0 - b _08075EA2 - .pool -_08075E80: - movs r0, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - beq _08075E9C - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bne _08075EA0 -_08075E9C: - movs r4, 0x1 - b _08075EA2 -_08075EA0: - movs r4, 0x2 -_08075EA2: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - mov r2, r8 - adds r1, r2, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - movs r2, 0x40 - orrs r0, r2 - strb r0, [r1, 0x1] - ldr r0, =c3_0804B070 - movs r1, 0x3 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r3, 0 - mov r0, r9 - strh r0, [r1, 0x8] - mov r2, r10 - lsls r0, r2, 24 - asrs r0, 24 - strh r0, [r1, 0xA] - strh r4, [r1, 0xC] - strh r5, [r1, 0xE] - ldr r2, =0x020241e4 - movs r4, 0x3A - ldrsh r0, [r6, r4] - adds r0, r2 - ldrb r0, [r0] - strh r0, [r1, 0x10] - lsrs r0, r7, 16 - strh r0, [r1, 0x12] - strh r7, [r1, 0x14] - strh r3, [r1, 0x26] -_08075EF4: - ldr r4, =0x020241e4 - movs r1, 0x3A - ldrsh r0, [r6, r1] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =0x02020630 - adds r0, r5 - movs r1, 0x1 - bl StartObjectRotScalAnim - ldrh r0, [r6, 0x3A] - lsls r0, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08075F50 - movs r2, 0x3A - ldrsh r0, [r6, r2] - 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_8039B58 - b _08075F66 - .pool -_08075F50: - movs r1, 0x3A - ldrsh r0, [r6, r1] - 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_8039E44 -_08075F66: - str r1, [r0] - ldr r5, =0x020241e4 - movs r2, 0x3A - ldrsh r0, [r6, r2] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl AnimateObject - movs r1, 0x3A - ldrsh r0, [r6, r1] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x80 - lsls r1, 5 - strh r1, [r0, 0x30] - 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_8075D14 - - thumb_func_start sub_8075FB4 -sub_8075FB4: @ 8075FB4 - adds r3, r0, 0 - adds r3, 0x2C - ldrb r1, [r3] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r3] - ldr r1, =sub_80760F8 - str r1, [r0, 0x1C] - movs r1, 0 - strh r1, [r0, 0x34] - strh r1, [r0, 0x36] - strh r1, [r0, 0x38] - bx lr - .pool - thumb_func_end sub_8075FB4 - - thumb_func_start sub_8075FD4 -sub_8075FD4: @ 8075FD4 - push {r4-r7,lr} - adds r5, r0, 0 - movs r7, 0 - ldrh r0, [r5, 0x3A] - lsls r0, 24 - lsrs r6, r0, 24 - ldr r4, =0x02020630 - ldr r0, =0x020241e4 - adds r3, r6, r0 - ldrb r1, [r3] - 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] - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08076016 - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_08076016: - ldrb r0, [r3] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r0, r1, 0 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _08076040 - adds r0, r1, 0 - movs r1, 0 - bl StartObjectRotScalAnim - movs r7, 0x1 - b _0807605C - .pool -_08076040: - ldr r2, =0xfffffee0 - adds r0, r2, 0 - ldrh r2, [r1, 0x30] - adds r0, r2 - strh r0, [r1, 0x30] - ldrb r0, [r3] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r1, 0x30] - lsls r0, 16 - asrs r0, 24 - strh r0, [r1, 0x26] -_0807605C: - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080760DE - cmp r7, 0 - beq _080760DE - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - adds r0, r6, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r2, 0 - movs r1, 0 - strh r1, [r0, 0x26] - ldr r0, =0x020244b9 - strb r2, [r0] - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r0, [r0, 0x4] - lsls r1, r6, 1 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - adds r0, r5, 0 - bl obj_free_rotscale_entry - adds r0, r5, 0 - bl RemoveObjectAndFreeTiles - movs r3, 0 - ldr r0, [r4] - ldr r2, [r0, 0x4] - movs r5, 0x8 - movs r4, 0x3 -_080760B6: - ldrb r1, [r2] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _080760C2 - adds r3, 0x1 -_080760C2: - adds r2, 0xC - subs r4, 0x1 - cmp r4, 0 - bge _080760B6 - cmp r3, 0x4 - bne _080760DE - movs r4, 0 -_080760D0: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_8076AE8 - adds r4, 0x1 - cmp r4, 0xB - ble _080760D0 -_080760DE: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8075FD4 - - thumb_func_start sub_80760F8 -sub_80760F8: @ 80760F8 - push {r4-r7,lr} - adds r6, r0, 0 - ldrh r0, [r6, 0x3A] - lsls r0, 24 - lsrs r7, r0, 24 - ldrh r0, [r6, 0x36] - adds r0, 0x1 - strh r0, [r6, 0x36] - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0x28 - beq _08076196 - cmp r1, 0x5F - bne _08076130 - ldr r0, =0x020244b9 - movs r1, 0 - strb r1, [r0] - bl m4aMPlayAllStop - ldr r0, =0x00000173 - bl audio_play - b _08076196 - .pool -_08076130: - ldr r0, =0x0000013b - cmp r1, r0 - bne _08076196 - ldr r5, =0x02020630 - ldr r4, =0x020241e4 - movs r1, 0x3A - ldrsh r0, [r6, r1] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - movs r1, 0x3A - ldrsh r0, [r6, r1] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - adds r0, r6, 0 - bl RemoveObjectAndFreeResources - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08076196 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - lsls r1, r7, 1 - adds r1, r7 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - strb r0, [r1] -_08076196: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80760F8 - - thumb_func_start sub_80761B4 -sub_80761B4: @ 80761B4 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x19 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x3A] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x3A] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x18 - strh r0, [r4, 0x36] - ldr r0, =0x0000ffe2 - strh r0, [r4, 0x38] - ldrh r0, [r4, 0x3A] - strh r0, [r4, 0x6] - adds r0, r4, 0 - bl sub_80A68D4 - ldr r0, =sub_8076204 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80761B4 - - thumb_func_start sub_8076204 -sub_8076204: @ 8076204 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - ldrh r0, [r5, 0x3C] - movs r1, 0xFF - mov r8, r1 - lsrs r0, 8 - subs r0, 0x23 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2C - bhi _080762F8 - ldrh r1, [r5, 0x6] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - cmp r0, 0 - bne _08076266 - ldrh r0, [r5, 0x30] - movs r1, 0x1 - adds r6, r1, 0 - ands r6, r0 - ldrh r0, [r5, 0x32] - adds r7, r1, 0 - ands r7, r0 - movs r2, 0x30 - ldrsh r0, [r5, r2] - movs r1, 0x3 - bl __divsi3 - movs r1, 0x2 - negs r1, r1 - adds r4, r1, 0 - ands r0, r4 - orrs r6, r0 - strh r6, [r5, 0x30] - movs r2, 0x32 - ldrsh r0, [r5, r2] - movs r1, 0x3 - bl __divsi3 - ands r0, r4 - orrs r7, r0 - strh r7, [r5, 0x32] - adds r0, r5, 0 - movs r1, 0x4 - bl StartObjectRotScalAnim -_08076266: - ldrh r4, [r5, 0x2E] - adds r0, r5, 0 - bl sub_80A6F3C - movs r1, 0x3A - ldrsh r0, [r5, r1] - movs r1, 0x3 - bl __divsi3 - adds r1, r0, 0 - ldrh r0, [r5, 0x3C] - adds r0, r1 - strh r0, [r5, 0x3C] - lsls r0, 16 - asrs r0, 24 - mov r2, r8 - ands r0, r2 - movs r2, 0x38 - ldrsh r1, [r5, r2] - bl sine - ldrh r1, [r5, 0x26] - adds r0, r1 - strh r0, [r5, 0x26] - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 - ldrh r1, [r5, 0x6] - adds r0, r1 - strh r0, [r5, 0x6] - lsls r0, 16 - lsrs r0, 24 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _080762B6 - strh r4, [r5, 0x2E] - b _080762BE -_080762B6: - lsls r0, r4, 16 - asrs r0, 16 - subs r0, 0x1 - strh r0, [r5, 0x2E] -_080762BE: - ldrh r0, [r5, 0x3C] - lsrs r0, 8 - cmp r0, 0x4F - ble _08076364 - ldrh r0, [r5, 0x30] - movs r1, 0x1 - adds r6, r1, 0 - ands r6, r0 - ldrh r0, [r5, 0x32] - adds r7, r1, 0 - ands r7, r0 - movs r2, 0x30 - ldrsh r1, [r5, r2] - lsls r0, r1, 1 - adds r0, r1 - movs r1, 0x2 - negs r1, r1 - adds r2, r1, 0 - ands r0, r2 - orrs r0, r6 - strh r0, [r5, 0x30] - movs r0, 0x32 - ldrsh r1, [r5, r0] - lsls r0, r1, 1 - adds r0, r1 - ands r0, r2 - orrs r0, r7 - strh r0, [r5, 0x32] - b _08076364 -_080762F8: - adds r0, r5, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _08076364 - ldrh r0, [r5, 0x24] - ldrh r1, [r5, 0x20] - adds r0, r1 - movs r1, 0 - strh r0, [r5, 0x20] - ldrh r0, [r5, 0x26] - ldrh r2, [r5, 0x22] - adds r0, r2 - strh r0, [r5, 0x22] - strh r1, [r5, 0x26] - strh r1, [r5, 0x24] - ldrb r0, [r5, 0x6] - strh r0, [r5, 0x3A] - strh r1, [r5, 0x2E] - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08076358 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r1, [r0, 0x9] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08076358 - movs r0, 0x3A - ldrsh r4, [r5, r0] - movs r0, 0x2 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _08076358 - ldr r0, =sub_8076374 - b _0807635A - .pool -_08076358: - ldr r0, =sub_8075D14 -_0807635A: - str r0, [r5, 0x1C] - adds r0, r5, 0 - movs r1, 0 - bl StartObjectRotScalAnim -_08076364: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8076204 - - thumb_func_start sub_8076374 -sub_8076374: @ 8076374 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - adds r1, r0, 0x1 - strh r1, [r2, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x18 - ble _0807638E - movs r0, 0 - strh r0, [r2, 0x2E] - ldr r0, =sub_8075D14 - str r0, [r2, 0x1C] -_0807638E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8076374 - - thumb_func_start sub_8076398 -sub_8076398: @ 8076398 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - ble _080763EC - movs r0, 0 - strh r0, [r5, 0x2E] - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _080763E8 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r1, [r0, 0x9] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080763E8 - movs r0, 0x3A - ldrsh r4, [r5, r0] - movs r0, 0x3 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _080763E8 - ldr r0, =sub_8076374 - b _080763EA - .pool -_080763E8: - ldr r0, =sub_8075D14 -_080763EA: - str r0, [r5, 0x1C] -_080763EC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8076398 - - thumb_func_start sub_80763F8 -sub_80763F8: @ 80763F8 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - movs r4, 0 - str r4, [sp] - bl sub_8171D98 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80763F8 - - thumb_func_start sub_8076420 -sub_8076420: @ 8076420 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - movs r3, 0 - bl sub_81729E8 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_8076420 - - thumb_func_start sub_8076438 -sub_8076438: @ 8076438 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r5, r0, 0 - mov r9, r2 - mov r10, r3 - ldr r6, [sp, 0x28] - ldr r4, [sp, 0x2C] - ldr r0, [sp, 0x30] - ldr r2, [sp, 0x38] - lsls r5, 24 - lsrs r5, 24 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - mov r1, r9 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - lsls r3, 24 - lsrs r3, 24 - mov r10, r3 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - lsls r0, r2, 16 - lsrs r7, r0, 16 - ldr r0, =gUnknown_0832C400 - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_0832C460 - bl LoadCompressedObjectPaletteUsingHeap - ldr r0, =gUnknown_0832C588 - mov r1, r9 - mov r2, r10 - adds r3, r4, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02020630 - mov r8, r1 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - adds r2, r4, r1 - strh r5, [r2, 0x2E] - lsls r1, r5, 4 - adds r1, r5 - lsls r1, 2 - add r1, r8 - ldrh r0, [r1, 0x20] - strh r0, [r2, 0x38] - ldrh r0, [r1, 0x22] - strh r0, [r2, 0x3A] - mov r3, r9 - strh r3, [r1, 0x20] - mov r0, r10 - strh r0, [r1, 0x22] - strh r7, [r1, 0x3C] - mov r3, sp - ldrh r3, [r3, 0x4] - strh r3, [r2, 0x30] - mov r0, sp - ldrh r0, [r0] - strh r0, [r2, 0x32] - mov r3, sp - ldrh r3, [r3, 0x34] - strh r3, [r2, 0x34] - ldr r3, [sp, 0x34] - lsrs r0, r3, 16 - strh r0, [r2, 0x36] - movs r0, 0x3 - ands r6, r0 - lsls r6, 2 - ldrb r3, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r6 - strb r0, [r2, 0x5] - movs r0, 0x1C - add r8, r0 - add r4, r8 - ldr r0, =sub_8076524 - str r0, [r4] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - 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_8076438 - - thumb_func_start sub_8076524 -sub_8076524: @ 8076524 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - ldrh r1, [r6, 0x30] - movs r2, 0x30 - ldrsh r0, [r6, r2] - cmp r0, 0 - bne _080765D0 - ldrh r0, [r6, 0x2E] - lsls r0, 24 - lsrs r7, r0, 24 - ldrh r0, [r6, 0x32] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrh r4, [r6, 0x34] - ldrh r0, [r6, 0x36] - lsls r0, 16 - orrs r4, r0 - adds r0, r6, 0 - adds r0, 0x43 - ldrb r0, [r0] - cmp r0, 0 - beq _0807655E - subs r0, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - b _08076560 -_0807655E: - movs r5, 0 -_08076560: - adds r0, r6, 0 - movs r1, 0x1 - bl StartObjectImageAnim - ldrh r0, [r6, 0x20] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x22] - subs r1, 0x5 - lsls r1, 24 - lsrs r1, 24 - ldrb r2, [r6, 0x5] - lsls r2, 28 - lsrs r2, 30 - adds r3, r5, 0 - bl sub_80763F8 - movs r0, 0x1 - mov r1, r8 - adds r2, r4, 0 - bl sub_8076420 - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - strh r0, [r6, 0x30] - ldr r0, =sub_80765E0 - str r0, [r6, 0x1C] - ldr r0, =0x02020630 - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - adds r4, r0 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - adds r0, r4, 0 - bl AnimateObject - movs r0, 0x80 - lsls r0, 5 - strh r0, [r4, 0x30] - strh r5, [r6, 0x3C] - b _080765D4 - .pool -_080765D0: - subs r0, r1, 0x1 - strh r0, [r6, 0x30] -_080765D4: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8076524 - - thumb_func_start sub_80765E0 -sub_80765E0: @ 80765E0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r4, r0, 0 - movs r0, 0 - mov r12, r0 - movs r7, 0 - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08076610 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_08076610: - ldr r1, =0x02020630 - lsls r2, r6, 4 - adds r0, r2, r6 - lsls r0, 2 - adds r5, r0, r1 - adds r0, r5, 0 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - mov r8, r2 - cmp r0, 0 - bge _08076634 - adds r0, r5, 0 - movs r1, 0 - bl StartObjectRotScalAnim - movs r1, 0x1 - mov r12, r1 -_08076634: - movs r2, 0x38 - ldrsh r0, [r4, r2] - movs r3, 0x20 - ldrsh r1, [r4, r3] - subs r0, r1 - movs r1, 0x3C - ldrsh r2, [r4, r1] - muls r0, r2 - cmp r0, 0 - bge _0807664A - adds r0, 0x7F -_0807664A: - asrs r0, 7 - ldrh r3, [r4, 0x20] - adds r0, r3 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - movs r1, 0x3A - ldrsh r0, [r4, r1] - movs r3, 0x22 - ldrsh r1, [r4, r3] - subs r0, r1 - muls r0, r2 - cmp r0, 0 - bge _08076668 - adds r0, 0x7F -_08076668: - asrs r0, 7 - ldrh r1, [r4, 0x22] - adds r0, r1 - mov r2, r9 - strh r2, [r5, 0x20] - strh r0, [r5, 0x22] - ldrh r2, [r4, 0x3C] - movs r3, 0x3C - ldrsh r0, [r4, r3] - cmp r0, 0x7F - bgt _080766AC - ldr r1, =gUnknown_08329F40 - lsls r0, r2, 24 - lsrs r0, 23 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _08076690 - adds r0, 0x7 -_08076690: - asrs r0, 3 - negs r0, r0 - lsls r0, 16 - lsrs r0, 16 - adds r1, r2, 0x4 - strh r1, [r4, 0x3C] - strh r0, [r5, 0x24] - strh r0, [r5, 0x26] - b _080766BA - .pool -_080766AC: - ldrh r0, [r4, 0x38] - strh r0, [r5, 0x20] - ldrh r0, [r4, 0x3A] - strh r0, [r5, 0x22] - strh r7, [r5, 0x24] - strh r7, [r5, 0x26] - movs r7, 0x1 -_080766BA: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0807670E - mov r2, r12 - cmp r2, 0 - beq _0807670E - cmp r7, 0 - beq _0807670E - ldr r1, =0x02020630 - mov r3, r8 - adds r0, r3, r6 - lsls r0, 2 - adds r2, r0, r1 - movs r0, 0x3C - ldrsh r1, [r2, r0] - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - bne _080766FC - ldrh r1, [r2, 0x3C] - adds r0, r2, 0 - movs r2, 0x1 - movs r3, 0 - bl sub_806ED40 - b _08076708 - .pool -_080766FC: - ldrh r1, [r2, 0x3C] - adds r0, r2, 0 - movs r2, 0 - movs r3, 0 - bl sub_806ED40 -_08076708: - adds r0, r4, 0 - bl RemoveObjectAndFreeResources -_0807670E: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80765E0 - - thumb_func_start sub_807671C -sub_807671C: @ 807671C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r10, r0 - adds r6, r2, 0 - mov r8, r3 - ldr r5, [sp, 0x20] - ldr r4, [sp, 0x24] - ldr r0, [sp, 0x28] - mov r9, r0 - mov r0, r10 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r6, 24 - lsrs r6, 24 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r5, 24 - lsrs r5, 24 - lsls r4, 24 - lsrs r4, 24 - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r0, =gUnknown_0832C400 - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_0832C460 - bl LoadCompressedObjectPaletteUsingHeap - ldr r0, =gUnknown_0832C588 - adds r1, r6, 0 - mov r2, r8 - adds r3, r4, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r6, =0x02020630 - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - adds r2, r3, r6 - mov r1, r10 - strh r1, [r2, 0x2E] - mov r4, r9 - strh r4, [r2, 0x30] - strh r7, [r2, 0x32] - mov r1, sp - ldrh r1, [r1, 0x2C] - strh r1, [r2, 0x34] - ldr r4, [sp, 0x2C] - lsrs r1, r4, 16 - strh r1, [r2, 0x36] - movs r1, 0x3 - ands r5, r1 - lsls r5, 2 - ldrb r4, [r2, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r4 - orrs r1, r5 - strb r1, [r2, 0x5] - adds r6, 0x1C - adds r3, r6 - ldr r1, =sub_80767D4 - str r1, [r3] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_807671C - - thumb_func_start sub_80767D4 -sub_80767D4: @ 80767D4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - ldrh r1, [r4, 0x30] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0807686C - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r7, r0, 24 - ldrh r0, [r4, 0x32] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrh r5, [r4, 0x34] - ldrh r0, [r4, 0x36] - lsls r0, 16 - orrs r5, r0 - adds r0, r4, 0 - adds r0, 0x43 - ldrb r0, [r0] - cmp r0, 0 - beq _0807680E - subs r0, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - b _08076810 -_0807680E: - movs r6, 0 -_08076810: - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnim - ldrh r0, [r4, 0x20] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x22] - subs r1, 0x5 - lsls r1, 24 - lsrs r1, 24 - ldrb r2, [r4, 0x5] - lsls r2, 28 - lsrs r2, 30 - adds r3, r6, 0 - bl sub_80763F8 - movs r0, 0x1 - mov r1, r8 - adds r2, r5, 0 - bl sub_8076420 - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - strh r0, [r4, 0x30] - ldr r0, =sub_807687C - str r0, [r4, 0x1C] - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectRotScalAnim - adds r0, r4, 0 - bl AnimateObject - strh r5, [r4, 0x30] - b _08076870 - .pool -_0807686C: - subs r0, r1, 0x1 - strh r0, [r4, 0x30] -_08076870: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80767D4 - - thumb_func_start sub_807687C -sub_807687C: @ 807687C - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0x38] - adds r0, 0x1 - strh r0, [r5, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB - bne _08076894 - movs r0, 0x3C - bl audio_play -_08076894: - ldrh r1, [r5, 0x2E] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r0, r2 - adds r0, r4, 0 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _080768D8 - adds r0, r5, 0 - movs r1, 0x2 - bl StartObjectImageAnim - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - movs r0, 0 - strh r0, [r5, 0x38] - ldr r0, =sub_80768F0 - str r0, [r5, 0x1C] - b _080768E8 - .pool -_080768D8: - ldrh r0, [r4, 0x30] - adds r0, 0x60 - strh r0, [r4, 0x30] - movs r1, 0x30 - ldrsh r0, [r4, r1] - negs r0, r0 - asrs r0, 8 - strh r0, [r4, 0x26] -_080768E8: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_807687C - - thumb_func_start sub_80768F0 -sub_80768F0: @ 80768F0 - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08076904 - ldr r0, =DummyObjectCallback - str r0, [r2, 0x1C] -_08076904: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80768F0 - - thumb_func_start obj_delete_and_free_associated_resources_ -obj_delete_and_free_associated_resources_: @ 807690C - push {lr} - bl RemoveObjectAndFreeResources - pop {r0} - bx r0 - thumb_func_end obj_delete_and_free_associated_resources_ - - thumb_func_start sub_8076918 -sub_8076918: @ 8076918 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r0, =0x03005d70 - adds r0, r5, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r6, =0x02020630 - adds r4, r0, r6 - movs r1, 0 - movs r0, 0x5 - strh r0, [r4, 0x2E] - strh r1, [r4, 0x30] - movs r0, 0x73 - strh r0, [r4, 0x24] - strh r1, [r4, 0x26] - ldr r0, =sub_80769CC - str r0, [r4, 0x1C] - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08076966 - ldrh r0, [r4, 0x2E] - negs r0, r0 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x30] - negs r0, r0 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x24] - negs r0, r0 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x26] - negs r0, r0 - strh r0, [r4, 0x26] -_08076966: - movs r0, 0x38 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r6, 0 - adds r1, 0x1C - adds r1, r0, r1 - adds r0, r6 - ldr r1, [r1] - bl _call_via_r1 - adds r0, r5, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08076990 - ldr r0, =sub_80769A8 - str r0, [r4, 0x1C] -_08076990: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8076918 - - thumb_func_start sub_80769A8 -sub_80769A8: @ 80769A8 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x30] - adds r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - bne _080769C2 - movs r0, 0 - strh r0, [r1, 0x30] - ldr r0, =sub_80769CC - str r0, [r1, 0x1C] -_080769C2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80769A8 - - thumb_func_start sub_80769CC -sub_80769CC: @ 80769CC - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x24] - ldrh r1, [r2, 0x2E] - subs r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x26] - ldrh r1, [r2, 0x30] - subs r0, r1 - strh r0, [r2, 0x26] - ldr r0, [r2, 0x24] - cmp r0, 0 - bne _080769EA - ldr r0, =DummyObjectCallback - str r0, [r2, 0x1C] -_080769EA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80769CC - - thumb_func_start sub_80769F4 -sub_80769F4: @ 80769F4 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =oamc_804BEB4 - adds r0, r5, 0 - bl object_new_hidden_with_callback - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r3, r1, r2 - movs r0, 0x1 - strh r0, [r3, 0x2E] - ldr r0, =0x03005d70 - adds r4, r0 - ldrb r0, [r4] - strh r0, [r3, 0x30] - adds r2, 0x1C - adds r1, r2 - str r5, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80769F4 - - thumb_func_start oamc_804BEB4 -oamc_804BEB4: @ 8076A38 - push {lr} - adds r3, r0, 0 - ldrh r1, [r3, 0x30] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - ldrh r0, [r3, 0x2E] - movs r2, 0 - strh r0, [r1, 0x26] - ldrh r0, [r3, 0x2E] - negs r0, r0 - strh r0, [r3, 0x2E] - ldrh r0, [r3, 0x32] - adds r0, 0x1 - strh r0, [r3, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x15 - bne _08076A70 - strh r2, [r1, 0x24] - strh r2, [r1, 0x26] - adds r0, r3, 0 - bl RemoveObjectAndFreeTiles -_08076A70: - pop {r0} - bx r0 - .pool - thumb_func_end oamc_804BEB4 - - thumb_func_start sub_8076A78 -sub_8076A78: @ 8076A78 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_0832C400 - lsls r6, r4, 3 - adds r5, r6, r0 - ldrh r0, [r5, 0x6] - bl GetObjectTileRangeStartByTag - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - bne _08076AA0 - adds r0, r5, 0 - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_0832C460 - adds r0, r6, r0 - bl LoadCompressedObjectPaletteUsingHeap -_08076AA0: - cmp r4, 0x6 - beq _08076ACC - cmp r4, 0x6 - blt _08076AB0 - cmp r4, 0xB - bgt _08076AB0 - cmp r4, 0xA - bge _08076ACC -_08076AB0: - ldr r1, =gUnknown_0832C400 - lsls r0, r4, 3 - adds r0, r1 - ldrh r0, [r0, 0x6] - bl GetObjectTileRangeStartByTag - adds r1, r0, 0 - lsls r1, 16 - ldr r0, =gUnknown_08C02300 - lsrs r1, 11 - ldr r2, =0x06010100 - adds r1, r2 - bl LZDecompressVram -_08076ACC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8076A78 - - thumb_func_start sub_8076AE8 -sub_8076AE8: @ 8076AE8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - ldr r0, =gUnknown_0832C400 - lsrs r4, 21 - adds r0, r4, r0 - ldrh r0, [r0, 0x6] - bl FreeObjectTilesByTag - ldr r0, =gUnknown_0832C460 - adds r4, r0 - ldrh r0, [r4, 0x4] - bl FreeObjectPaletteByTag - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8076AE8 - - thumb_func_start sub_8076B14 -sub_8076B14: @ 8076B14 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08076B40 - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - b _08076B4E - .pool -_08076B40: - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec -_08076B4E: - adds r0, r1 - movs r1, 0x26 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8076B14 - - thumb_func_start CheckForFlashMemory -@ void CheckForFlashMemory() -CheckForFlashMemory: @ 8076B68 - push {lr} - bl IdentifyFlash - lsls r0, 16 - cmp r0, 0 - bne _08076B84 - ldr r1, =0x03005d88 - movs r0, 0x1 - str r0, [r1] - bl StartFlashMemoryTimer - b _08076B8A - .pool -_08076B84: - ldr r1, =0x03005d88 - movs r0, 0 - str r0, [r1] -_08076B8A: - pop {r0} - bx r0 - .pool - thumb_func_end CheckForFlashMemory - - thumb_func_start memclr_stdsav2 -memclr_stdsav2: @ 8076B94 - push {lr} - sub sp, 0x4 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, =0x02024a54 - ldr r2, =0x010007d6 - mov r0, sp - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end memclr_stdsav2 - - thumb_func_start clear_sav1 -clear_sav1: @ 8076BB8 - push {lr} - sub sp, 0x4 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, =0x02025a00 - ldr r2, =0x01001f04 - mov r0, sp - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end clear_sav1 - - thumb_func_start InitSaveBlockPointersWithRandomOffset -@ void InitSaveBlockPointersWithRandomOffset(u8 offset) -InitSaveBlockPointersWithRandomOffset: @ 8076BDC - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r5, =0x03005d8c - bl GenerateRandomNumber - adds r4, r0 - movs r0, 0x7C - ands r4, r0 - ldr r1, =0x03005d90 - ldr r0, =0x02024a54 - adds r0, r4, r0 - str r0, [r1] - ldr r0, =0x02025a00 - adds r0, r4, r0 - str r0, [r5] - ldr r1, =0x03005d94 - ldr r0, =0x02029808 - adds r4, r0 - str r4, [r1] - bl init_bag_pockets - bl sub_81617F4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end InitSaveBlockPointersWithRandomOffset - - thumb_func_start saveblock_randomize_and_relocate -saveblock_randomize_and_relocate: @ 8076C2C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r5, =0x030022c0 - ldr r0, [r5, 0xC] - str r0, [sp] - ldr r1, [r5, 0x10] - str r1, [sp, 0x4] - movs r0, 0 - str r0, [r5, 0xC] - str r0, [r5, 0x10] - ldr r1, =0x0203cf5c - str r0, [r1] - ldr r4, =0x02000000 - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r6, =0x00000f2c - adds r0, r4, 0 - adds r2, r6, 0 - bl memcpy - ldr r1, =0x03005d8c - mov r10, r1 - ldr r1, [r1] - ldr r7, =0x00003d88 - ldr r0, =0x02000f2c - adds r2, r7, 0 - bl memcpy - ldr r0, =0x03005d94 - mov r8, r0 - ldr r1, [r0] - ldr r0, =0x000083d0 - mov r9, r0 - ldr r0, =0x02004cb4 - mov r2, r9 - bl memcpy - ldrb r1, [r4, 0xA] - ldrb r0, [r4, 0xB] - adds r1, r0 - ldrb r0, [r4, 0xC] - adds r1, r0 - ldrb r0, [r4, 0xD] - adds r0, r1 - bl InitSaveBlockPointersWithRandomOffset - ldr r1, =0x03005d90 - ldr r0, [r1] - adds r1, r4, 0 - adds r2, r6, 0 - bl memcpy - mov r1, r10 - ldr r0, [r1] - ldr r1, =0x02000f2c - adds r2, r7, 0 - bl memcpy - mov r1, r8 - ldr r0, [r1] - ldr r1, =0x02004cb4 - mov r2, r9 - bl memcpy - movs r1, 0xE0 - lsls r1, 9 - adds r0, r4, 0 - bl InitHeap - ldr r0, [sp, 0x4] - str r0, [r5, 0x10] - ldr r1, [sp] - str r1, [r5, 0xC] - bl GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsls r0, 16 - lsrs r0, 16 - adds r4, r0 - adds r0, r4, 0 - bl saveblock_apply_crypto - ldr r1, =0x03005d90 - ldr r0, [r1] - adds r0, 0xAC - str r4, [r0] - 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 saveblock_randomize_and_relocate - - thumb_func_start sav2_x1_query_bit1 -sav2_x1_query_bit1: @ 8076D24 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r1, [r0, 0x9] - movs r0, 0x1 - ands r0, r1 - bx lr - .pool - thumb_func_end sav2_x1_query_bit1 - - thumb_func_start sav2_x9_clear_bit1 -sav2_x9_clear_bit1: @ 8076D34 - ldr r0, =0x03005d90 - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0xFE - ands r0, r1 - strb r0, [r2, 0x9] - bx lr - .pool - thumb_func_end sav2_x9_clear_bit1 - - thumb_func_start sub_8076D48 -sub_8076D48: @ 8076D48 - ldr r0, =0x03005d90 - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0x1 - orrs r0, r1 - strb r0, [r2, 0x9] - bx lr - .pool - thumb_func_end sub_8076D48 - - thumb_func_start sub_8076D5C -sub_8076D5C: @ 8076D5C - push {lr} - movs r0, 0 - bl sub_8084FAC - ldr r0, =0x03005d90 - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0x1 - orrs r0, r1 - strb r0, [r2, 0x9] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8076D5C - - thumb_func_start sav2_gender2_inplace_and_xFE -sav2_gender2_inplace_and_xFE: @ 8076D78 - ldr r0, =0x03005d90 - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0xFE - ands r0, r1 - strb r0, [r2, 0x9] - bx lr - .pool - thumb_func_end sav2_gender2_inplace_and_xFE - - thumb_func_start copy_player_party_to_sav1 -@ void copy_player_party_to_sav1() -copy_player_party_to_sav1: @ 8076D8C - push {r4,lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x020244e9 - ldrb r1, [r1] - movs r2, 0x8D - lsls r2, 2 - adds r0, r2 - strb r1, [r0] - movs r4, 0 -_08076DA0: - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x64 - muls r1, r4 - adds r0, r1 - movs r2, 0x8E - lsls r2, 2 - adds r0, r2 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0x64 - bl memcpy - adds r4, 0x1 - cmp r4, 0x5 - ble _08076DA0 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end copy_player_party_to_sav1 - - thumb_func_start copy_player_party_from_sav1 -copy_player_party_from_sav1: @ 8076DD4 - push {r4,r5,lr} - ldr r1, =0x020244e9 - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r2, 0x8D - lsls r2, 2 - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - movs r4, 0 - ldr r5, =0x020244ec -_08076DEA: - movs r0, 0x64 - adds r2, r4, 0 - muls r2, r0 - adds r0, r2, r5 - ldr r1, =0x03005d8c - ldr r1, [r1] - adds r1, r2 - movs r2, 0x8E - lsls r2, 2 - adds r1, r2 - movs r2, 0x64 - bl memcpy - adds r4, 0x1 - cmp r4, 0x5 - ble _08076DEA - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end copy_player_party_from_sav1 - - thumb_func_start save_serialize_npcs -save_serialize_npcs: @ 8076E1C - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x03005d8c - mov r12, r0 - movs r5, 0xA3 - lsls r5, 4 - mov r8, r5 - ldr r4, =0x02037350 - movs r3, 0 - movs r2, 0xF -_08076E32: - mov r6, r12 - ldr r1, [r6] - adds r1, r3 - add r1, r8 - adds r0, r4, 0 - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - adds r4, 0x24 - adds r3, 0x24 - subs r2, 0x1 - cmp r2, 0 - bge _08076E32 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end save_serialize_npcs - - thumb_func_start save_deserialize_npcs -save_deserialize_npcs: @ 8076E64 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x03005d8c - mov r12, r0 - movs r5, 0xA3 - lsls r5, 4 - mov r8, r5 - ldr r4, =0x02037350 - movs r3, 0 - movs r2, 0xF -_08076E7A: - mov r6, r12 - ldr r1, [r6] - adds r1, r3 - adds r0, r4, 0 - add r1, r8 - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - adds r4, 0x24 - adds r3, 0x24 - subs r2, 0x1 - cmp r2, 0 - bge _08076E7A - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end save_deserialize_npcs - - thumb_func_start save_serialize_game -save_serialize_game: @ 8076EAC - push {lr} - bl copy_player_party_to_sav1 - bl save_serialize_npcs - pop {r0} - bx r0 - thumb_func_end save_serialize_game - - thumb_func_start save_deserialize_game -save_deserialize_game: @ 8076EBC - push {lr} - bl copy_player_party_from_sav1 - bl save_deserialize_npcs - pop {r0} - bx r0 - thumb_func_end save_deserialize_game - - thumb_func_start copy_bags_and_unk_data_from_save_blocks -copy_bags_and_unk_data_from_save_blocks: @ 8076ECC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r2, 0 - ldr r0, =0x02032180 - mov r12, r0 - ldr r1, =0x03005d90 - mov r10, r1 - ldr r5, =0x03005d8c - movs r3, 0xAC - lsls r3, 3 - ldr r4, =0x02031c58 -_08076EE8: - lsls r0, r2, 2 - ldr r1, [r5] - adds r1, r3 - adds r1, r0 - ldr r0, [r1] - stm r4!, {r0} - adds r2, 0x1 - cmp r2, 0x1D - ble _08076EE8 - movs r2, 0 - ldr r0, =0x02031c58 - ldr r5, =0x03005d8c - movs r3, 0xBB - lsls r3, 3 - adds r4, r0, 0 - adds r4, 0x78 -_08076F08: - lsls r0, r2, 2 - ldr r1, [r5] - adds r1, r3 - adds r1, r0 - ldr r0, [r1] - stm r4!, {r0} - adds r2, 0x1 - cmp r2, 0x1D - ble _08076F08 - movs r2, 0 - ldr r0, =0x02031c58 - ldr r5, =0x03005d8c - movs r3, 0xCA - lsls r3, 3 - adds r4, r0, 0 - adds r4, 0xF0 -_08076F28: - lsls r0, r2, 2 - ldr r1, [r5] - adds r1, r3 - adds r1, r0 - ldr r0, [r1] - stm r4!, {r0} - adds r2, 0x1 - cmp r2, 0xF - ble _08076F28 - movs r2, 0 - ldr r0, =0x02031c58 - ldr r5, =0x03005d8c - movs r6, 0x98 - lsls r6, 1 - adds r4, r0, r6 - movs r3, 0xD2 - lsls r3, 3 -_08076F4A: - lsls r0, r2, 2 - ldr r1, [r5] - adds r1, r3 - adds r1, r0 - ldr r0, [r1] - stm r4!, {r0} - adds r2, 0x1 - cmp r2, 0x3F - ble _08076F4A - movs r2, 0 - ldr r0, =0x02031c58 - ldr r5, =0x03005d8c - movs r7, 0x8C - lsls r7, 2 - adds r4, r0, r7 - movs r3, 0xF2 - lsls r3, 3 -_08076F6C: - lsls r0, r2, 2 - ldr r1, [r5] - adds r1, r3 - adds r1, r0 - ldr r0, [r1] - stm r4!, {r0} - adds r2, 0x1 - cmp r2, 0x2D - ble _08076F6C - ldr r0, =0x02031c58 - ldr r1, =0x03005d8c - mov r8, r1 - movs r5, 0xBA - lsls r5, 2 - adds r4, r0, r5 - movs r3, 0 - ldr r6, =0x00002be0 - mov r9, r6 - movs r2, 0xF -_08076F92: - mov r7, r8 - ldr r1, [r7] - adds r1, r3 - adds r0, r4, 0 - add r1, r9 - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - adds r4, 0x24 - adds r3, 0x24 - subs r2, 0x1 - cmp r2, 0 - bge _08076F92 - mov r1, r10 - ldr r0, [r1] - adds r0, 0xAC - ldr r0, [r0] - mov r5, r12 - str r0, [r5] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end copy_bags_and_unk_data_from_save_blocks - - thumb_func_start copy_bags_and_unk_data_to_save_blocks -copy_bags_and_unk_data_to_save_blocks: @ 8076FE0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r2, 0 - ldr r0, =0x03005d90 - mov r8, r0 - ldr r1, =0x02032180 - mov r12, r1 - ldr r5, =0x03005d8c - movs r3, 0xAC - lsls r3, 3 - ldr r4, =0x02031c58 -_08076FFC: - ldr r0, [r5] - lsls r1, r2, 2 - adds r0, r3 - adds r0, r1 - ldm r4!, {r1} - str r1, [r0] - adds r2, 0x1 - cmp r2, 0x1D - ble _08076FFC - movs r2, 0 - ldr r5, =0x03005d8c - movs r4, 0xBB - lsls r4, 3 - ldr r0, =0x02031c58 - adds r3, r0, 0 - adds r3, 0x78 -_0807701C: - ldr r0, [r5] - lsls r1, r2, 2 - adds r0, r4 - adds r0, r1 - ldm r3!, {r1} - str r1, [r0] - adds r2, 0x1 - cmp r2, 0x1D - ble _0807701C - movs r2, 0 - ldr r5, =0x03005d8c - movs r4, 0xCA - lsls r4, 3 - ldr r0, =0x02031c58 - adds r3, r0, 0 - adds r3, 0xF0 -_0807703C: - ldr r0, [r5] - lsls r1, r2, 2 - adds r0, r4 - adds r0, r1 - ldm r3!, {r1} - str r1, [r0] - adds r2, 0x1 - cmp r2, 0xF - ble _0807703C - movs r2, 0 - ldr r5, =0x03005d8c - movs r4, 0xD2 - lsls r4, 3 - ldr r0, =0x02031c58 - movs r6, 0x98 - lsls r6, 1 - adds r3, r0, r6 -_0807705E: - ldr r0, [r5] - lsls r1, r2, 2 - adds r0, r4 - adds r0, r1 - ldm r3!, {r1} - str r1, [r0] - adds r2, 0x1 - cmp r2, 0x3F - ble _0807705E - movs r2, 0 - ldr r5, =0x03005d8c - movs r4, 0xF2 - lsls r4, 3 - ldr r0, =0x02031c58 - movs r7, 0x8C - lsls r7, 2 - adds r3, r0, r7 -_08077080: - ldr r0, [r5] - lsls r1, r2, 2 - adds r0, r4 - adds r0, r1 - ldm r3!, {r1} - str r1, [r0] - adds r2, 0x1 - cmp r2, 0x2D - ble _08077080 - ldr r0, =0x03005d8c - mov r9, r0 - ldr r1, =0x00002be0 - mov r10, r1 - ldr r4, =0x02031c58 - movs r3, 0 - movs r2, 0xF -_080770A0: - mov r5, r9 - ldr r1, [r5] - adds r1, r3 - add r1, r10 - movs r6, 0xBA - lsls r6, 2 - adds r0, r4, r6 - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - adds r4, 0x24 - adds r3, 0x24 - subs r2, 0x1 - cmp r2, 0 - bge _080770A0 - mov r7, r8 - ldr r0, [r7] - adds r0, 0xAC - ldr r4, [r0] - mov r2, r12 - ldr r1, [r2] - str r1, [r0] - adds r0, r4, 0 - bl encrypt_decrypt_all_item_quantities - ldr r0, [r7] - adds r0, 0xAC - str r4, [r0] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end copy_bags_and_unk_data_to_save_blocks - - thumb_func_start apply_u16_xor_crypto -apply_u16_xor_crypto: @ 8077100 - ldr r2, =0x03005d90 - ldr r2, [r2] - adds r2, 0xAC - ldr r2, [r2] - ldrh r3, [r0] - eors r2, r3 - eors r2, r1 - strh r2, [r0] - bx lr - .pool - thumb_func_end apply_u16_xor_crypto - - thumb_func_start apply_u32_xor_crypto -apply_u32_xor_crypto: @ 8077118 - ldr r2, =0x03005d90 - ldr r3, [r2] - adds r3, 0xAC - ldr r2, [r0] - ldr r3, [r3] - eors r2, r3 - eors r2, r1 - str r2, [r0] - bx lr - .pool - thumb_func_end apply_u32_xor_crypto - - thumb_func_start saveblock_apply_crypto -saveblock_apply_crypto: @ 8077130 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_8084864 - adds r0, r4, 0 - bl call_encrypt_decrypt_all_item_quantities - adds r0, r4, 0 - bl sub_8024690 - ldr r5, =0x03005d8c - ldr r0, [r5] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - adds r1, r4, 0 - bl apply_u32_xor_crypto - ldr r0, [r5] - ldr r1, =0x00000494 - adds r0, r1 - adds r1, r4, 0 - bl apply_u16_xor_crypto - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end saveblock_apply_crypto - - thumb_func_start sub_8077170 -sub_8077170: @ 8077170 - push {r4,lr} - adds r4, r0, 0 - adds r3, r1, 0 - ldr r0, =0x02022c2c - ldrb r0, [r0] - cmp r0, 0x1D - beq _08077194 - lsls r2, r3, 16 - lsrs r2, 16 - movs r0, 0 - adds r1, r4, 0 - bl link_0800A448 - lsls r0, 24 - lsrs r0, 24 - b _080771A2 - .pool -_08077194: - ldr r0, =0x03004140 - ldrb r0, [r0] - movs r1, 0x54 - adds r2, r4, 0 - bl rfu_NI_setSendData - movs r0, 0x1 -_080771A2: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8077170 - - thumb_func_start sub_80771AC -sub_80771AC: @ 80771AC - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_800A4D8 - pop {r0} - bx r0 - thumb_func_end sub_80771AC - - thumb_func_start sub_80771BC -sub_80771BC: @ 80771BC - push {r4,lr} - ldr r0, =0x02022c2c - ldrb r0, [r0] - cmp r0, 0x1D - bne _080771F0 - ldr r4, =0x03007880 - ldr r0, =0x03004140 - ldrb r0, [r0] - bl sub_800E87C - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - ldrh r0, [r0] - cmp r0, 0 - bne _080771EC - movs r0, 0x1 - b _080771F8 - .pool -_080771EC: - movs r0, 0 - b _080771F8 -_080771F0: - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 -_080771F8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80771BC - - thumb_func_start sub_8077200 -sub_8077200: @ 8077200 - push {lr} - bl sub_800A550 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_8077200 - - thumb_func_start sub_8077210 -sub_8077210: @ 8077210 - push {lr} - bl sub_8077260 - cmp r0, 0 - beq _0807722C - ldr r0, =0x03004140 - ldrb r1, [r0] - movs r0, 0xC - bl rfu_clearSlot - b _08077230 - .pool -_0807722C: - bl sub_800A5B4 -_08077230: - pop {r0} - bx r0 - thumb_func_end sub_8077210 - - thumb_func_start sub_8077234 -sub_8077234: @ 8077234 - push {r4,lr} - adds r4, r0, 0 - bl sub_8077260 - cmp r0, 0 - beq _08077250 - ldr r0, =0x03004140 - ldrb r1, [r0] - movs r0, 0xC - bl rfu_clearSlot - b _08077258 - .pool -_08077250: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_800A5EC -_08077258: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8077234 - - thumb_func_start sub_8077260 -sub_8077260: @ 8077260 - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08077280 - ldr r0, =0x02022c2c - ldrb r0, [r0] - cmp r0, 0x1D - bne _08077280 - movs r0, 0x1 - b _08077282 - .pool -_08077280: - movs r0, 0 -_08077282: - pop {r1} - bx r1 - thumb_func_end sub_8077260 - - thumb_func_start sub_8077288 -sub_8077288: @ 8077288 - push {lr} - bl sub_800ADF8 - pop {r0} - bx r0 - thumb_func_end sub_8077288 - - thumb_func_start sub_8077294 -sub_8077294: @ 8077294 - push {lr} - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_8077294 - - thumb_func_start sub_80772A4 -sub_80772A4: @ 80772A4 - push {r4,r5,lr} - sub sp, 0xC - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - bl ResetTasks - bl sub_80A1A74 - ldr r2, =0x02037fd4 - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - ldr r0, =sub_807811C - bl SetVBlankCallback - ldr r4, =gUnknown_0860F074 - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0x14 - bl gpu_pal_apply - adds r0, r4, 0 - movs r1, 0xD0 - movs r2, 0x14 - bl gpu_pal_apply - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0832DEE4 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r0, =0x0203229c - ldr r1, [r0] - movs r0, 0x8F - lsls r0, 4 - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r0, =gUnknown_0832DEF4 - bl InitWindows - lsls r0, 16 - cmp r0, 0 - beq _0807738C - bl DeactivateAllTextPrinters - movs r5, 0 -_08077310: - lsls r4, r5, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl ClearWindowTilemap - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r5, 0x1 - cmp r5, 0x11 - bls _08077310 - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect - movs r0, 0 - movs r1, 0x14 - movs r2, 0xC0 - bl box_border_load_tiles_and_pal - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0xE0 - bl sub_809882C - bl sub_80D2F04 - ldr r2, =0x0203229c - ldr r0, [r2] - adds r0, 0x69 - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0x6F - strb r1, [r0] - ldr r0, [r2] - adds r0, 0x70 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0x74 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0x75 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0x7A - strb r1, [r0] - ldr r0, [r2] - adds r0, 0x7B - strb r1, [r0] - ldr r0, [r2] - adds r0, 0xA8 - strb r1, [r0] -_0807738C: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80772A4 - - thumb_func_start sub_80773AC -sub_80773AC: @ 80773AC - push {lr} - ldr r0, =sub_80773D0 - bl SetMainCallback2 - ldr r0, =0x030022c0 - movs r1, 0 - str r1, [r0] - ldr r0, =0x020244ea - strb r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80773AC - - thumb_func_start sub_80773D0 -sub_80773D0: @ 80773D0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x28 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r3, r1, 0 - cmp r0, 0x16 - bls _080773EA - b _08077B46 -_080773EA: - lsls r0, 2 - ldr r1, =_080773FC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080773FC: - .4byte _08077458 - .4byte _080774A4 - .4byte _08077560 - .4byte _0807758C - .4byte _080775E8 - .4byte _08077648 - .4byte _08077688 - .4byte _080776A8 - .4byte _080777E8 - .4byte _08077810 - .4byte _08077834 - .4byte _080778BC - .4byte _080778CA - .4byte _08077970 - .4byte _08077A40 - .4byte _08077A80 - .4byte _08077A9A - .4byte _08077AA8 - .4byte _08077ABC - .4byte _08077ADC - .4byte _08077AFC - .4byte _08077B10 - .4byte _08077B30 -_08077458: - ldr r4, =0x0203229c - ldr r0, =0x000010f0 - bl AllocZeroed - str r0, [r4] - bl sub_80772A4 - ldr r4, =0x02032184 - movs r0, 0xE0 - lsls r0, 4 - bl AllocZeroed - str r0, [r4] - movs r6, 0 - ldr r2, =0x02032188 -_08077476: - lsls r1, r6, 8 - ldr r0, [r4] - adds r0, r1 - stm r2!, {r0} - adds r6, 0x1 - cmp r6, 0xD - ble _08077476 - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _08077B22 - .pool -_080774A4: - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] - movs r6, 0 - movs r4, 0 -_080774B2: - movs r0, 0x64 - muls r0, r6 - ldr r1, =0x02024744 - adds r0, r1 - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - str r4, [sp, 0xC] - movs r1, 0 - movs r2, 0 - movs r3, 0x20 - bl create_pokemon_set_level - adds r6, 0x1 - cmp r6, 0x5 - ble _080774B2 - movs r0, 0 - bl sub_807A19C - movs r0, 0 - bl ShowBg - ldr r0, =0x03003124 - ldrb r2, [r0] - cmp r2, 0 - bne _0807754C - ldr r1, =0x020229c6 - ldr r5, =0x00001122 - adds r0, r5, 0 - strh r0, [r1] - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0xA8 - strb r2, [r0] - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08077528 - bl sub_800B488 - bl sub_8009734 - bl sub_8011BA4 - b _08077B46 - .pool -_08077528: - bl sub_8009734 - ldr r0, =0x030022c0 - movs r7, 0x87 - lsls r7, 3 - adds r0, r7 - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - ldr r0, =task00_08081A90 - movs r1, 0x1 - bl CreateTask - b _08077B46 - .pool -_0807754C: - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0x4 - strb r1, [r0] - b _08077B46 - .pool -_08077560: - ldr r2, =0x0203229c - ldr r1, [r2] - adds r1, 0xA8 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r2] - adds r1, r0, 0 - adds r1, 0xA8 - ldrb r0, [r1] - cmp r0, 0xB - bhi _0807757A - b _08077B46 -_0807757A: - movs r0, 0 - strb r0, [r1] - movs r2, 0x87 - lsls r2, 3 - adds r1, r3, r2 - b _08077B22 - .pool -_0807758C: - bl sub_800ABAC - adds r4, r0, 0 - bl sub_800AA48 - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bcs _080775A0 - b _08077B46 -_080775A0: - bl sub_800ABBC - lsls r0, 24 - cmp r0, 0 - beq _080775D8 - ldr r0, =0x0203229c - ldr r1, [r0] - adds r1, 0xA8 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1E - bhi _080775C0 - b _08077B46 -_080775C0: - bl sub_800A620 - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _08077B22 - .pool -_080775D8: - ldr r1, =0x030022c0 - movs r5, 0x87 - lsls r5, 3 - adds r1, r5 - b _08077B22 - .pool -_080775E8: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080775F2 - b _08077B46 -_080775F2: - bl sub_800A23C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08077600 - b _08077B46 -_08077600: - bl sub_8011BD0 - bl calc_player_party_count - ldr r1, =0x030022c0 - movs r7, 0x87 - lsls r7, 3 - adds r1, r7 - ldrb r0, [r1] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1] - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0xA8 - strb r2, [r0] - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _0807762A - b _08077B46 -_0807762A: - movs r0, 0x1 - bl sub_801048C - bl sub_800ADF8 - b _08077B46 - .pool -_08077648: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08077680 - bl sub_8010500 - lsls r0, 24 - cmp r0, 0 - bne _0807765C - b _08077B46 -_0807765C: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - b _08077B46 - .pool -_08077680: - movs r2, 0x87 - lsls r2, 3 - adds r1, r3, r2 - b _08077B22 -_08077688: - bl shedinja_maker_maybe - lsls r0, 24 - cmp r0, 0 - bne _08077694 - b _08077B46 -_08077694: - bl sub_807A5B0 - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _08077B22 - .pool -_080776A8: - bl calc_enemy_party_count - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - ldr r2, =0x0203229c - ldr r0, [r2] - ldr r1, =0x020244e9 - ldrb r1, [r1] - adds r0, 0x36 - strb r1, [r0] - ldr r0, [r2] - ldr r1, =0x020244ea - ldrb r1, [r1] - adds r0, 0x37 - strb r1, [r0] - movs r6, 0 - ldr r0, [r2] - adds r0, 0x36 - ldrb r0, [r0] - cmp r6, r0 - bge _08077740 - mov r8, r2 - ldr r7, =gUnknown_0832DE24 -_080776E2: - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - ldrb r2, [r7] - lsls r2, 19 - movs r1, 0xE0 - lsls r1, 12 - adds r2, r1 - asrs r2, 16 - ldrb r3, [r7, 0x1] - lsls r3, 19 - ldr r1, =0xfff40000 - adds r3, r1 - asrs r3, 16 - movs r1, 0x1 - str r1, [sp] - str r0, [sp, 0x4] - str r1, [sp, 0x8] - adds r0, r5, 0 - ldr r1, =sub_80D3014 - bl sub_80D2CC4 - mov r2, r8 - ldr r1, [r2] - adds r1, 0x28 - adds r1, r6 - strb r0, [r1] - adds r7, 0x2 - adds r6, 0x1 - ldr r0, [r2] - adds r0, 0x36 - ldrb r0, [r0] - cmp r6, r0 - blt _080776E2 -_08077740: - movs r6, 0 - ldr r1, =0x0203229c - ldr r0, [r1] - adds r0, 0x37 - ldrb r0, [r0] - cmp r6, r0 - bge _080777B8 - ldr r0, =gUnknown_0832DE24 - mov r8, r1 - adds r7, r0, 0 - adds r7, 0xC -_08077756: - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - ldrb r2, [r7] - lsls r2, 19 - movs r3, 0xE0 - lsls r3, 12 - adds r2, r3 - asrs r2, 16 - ldrb r3, [r7, 0x1] - lsls r3, 19 - ldr r1, =0xfff40000 - adds r3, r1 - asrs r3, 16 - movs r1, 0x1 - str r1, [sp] - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r5, 0 - ldr r1, =sub_80D3014 - bl sub_80D2CC4 - mov r2, r8 - ldr r1, [r2] - adds r1, 0x2E - adds r1, r6 - strb r0, [r1] - adds r7, 0x2 - adds r6, 0x1 - ldr r0, [r2] - adds r0, 0x37 - ldrb r0, [r0] - cmp r6, r0 - blt _08077756 -_080777B8: - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _08077B22 - .pool -_080777E8: - bl sub_81B5D30 - ldr r0, =0x0203229c - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x36 - adds r1, 0x28 - movs r2, 0 - bl sub_81B5D4C - ldr r1, =0x030022c0 - movs r5, 0x87 - lsls r5, 3 - adds r1, r5 - b _08077B22 - .pool -_08077810: - ldr r0, =0x0203229c - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x36 - adds r1, 0x28 - movs r2, 0x1 - bl sub_81B5D4C - ldr r1, =0x030022c0 - movs r7, 0x87 - lsls r7, 3 - adds r1, r7 - b _08077B22 - .pool -_08077834: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r5, =0x02032188 - ldr r1, [r5] - movs r4, 0x3 - str r4, [sp] - movs r2, 0 - movs r3, 0 - bl sub_80C6D80 - bl link_get_multiplayer_id - lsls r0, 24 - movs r1, 0x80 - lsls r1, 17 - eors r1, r0 - lsrs r1, 24 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r1, =0x020229f0 - adds r0, r1 - ldr r1, [r5, 0xC] - str r4, [sp] - movs r2, 0 - movs r3, 0 - bl sub_80C6D80 - ldr r4, =gUnknown_0832DE94 - ldr r0, [r4] - ldr r1, [r5, 0x18] - movs r2, 0x2 - str r2, [sp] - movs r2, 0 - movs r3, 0 - bl sub_80C6D80 - ldr r0, [r4, 0x4] - ldr r1, [r5, 0x20] - movs r2, 0x18 - bl sub_807A308 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1] - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0xA8 - strb r2, [r0] - b _08077B46 - .pool -_080778BC: - bl sub_807A1F0 - lsls r0, 24 - cmp r0, 0 - bne _080778C8 - b _08077B46 -_080778C8: - b _08077B1A -_080778CA: - ldr r0, =0x03005d90 - ldr r1, [r0] - movs r0, 0x1 - movs r2, 0x78 - bl GetStringCenterAlignXOffset - movs r6, 0 - add r5, sp, 0x10 - adds r4, r0, 0 - adds r4, 0x10 -_080778DE: - add r1, sp, 0x10 - ldr r0, =gUnknown_0832DCAC - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldrh r0, [r5] - adds r0, r6 - strh r0, [r5] - lsls r1, r4, 16 - asrs r1, 16 - add r0, sp, 0x10 - movs r2, 0xA - movs r3, 0x1 - bl AddObjectToFront - adds r4, 0x20 - adds r6, 0x1 - cmp r6, 0x2 - ble _080778DE - bl link_get_multiplayer_id - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r0, =0x020229f0 - adds r1, r0 - movs r0, 0x1 - movs r2, 0x78 - bl GetStringCenterAlignXOffset - movs r6, 0 - add r5, sp, 0x10 - adds r4, r0, 0 - adds r4, 0x88 -_0807792C: - add r1, sp, 0x10 - ldr r0, =gUnknown_0832DCAC - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - adds r0, r6, 0x3 - ldrh r3, [r5] - adds r0, r3 - strh r0, [r5] - lsls r1, r4, 16 - asrs r1, 16 - add r0, sp, 0x10 - movs r2, 0xA - movs r3, 0x1 - bl AddObjectToFront - adds r4, 0x20 - adds r6, 0x1 - cmp r6, 0x2 - ble _0807792C - ldr r1, =0x030022c0 - movs r5, 0x87 - lsls r5, 3 - adds r1, r5 - b _08077B22 - .pool -_08077970: - ldr r4, =gUnknown_0832DCAC - add r1, sp, 0x10 - adds r0, r4, 0 - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r5,r7} - stm r1!, {r2,r5,r7} - add r1, sp, 0x10 - adds r0, r1, 0 - ldrh r0, [r0] - adds r0, 0x6 - strh r0, [r1] - adds r0, r1, 0 - movs r1, 0xD7 - movs r2, 0x98 - movs r3, 0x1 - bl AddObjectToFront - add r0, sp, 0x10 - ldm r4!, {r3,r5,r7} - stm r0!, {r3,r5,r7} - ldm r4!, {r1-r3} - stm r0!, {r1-r3} - add r1, sp, 0x10 - adds r0, r1, 0 - ldrh r0, [r0] - adds r0, 0x7 - strh r0, [r1] - adds r0, r1, 0 - movs r1, 0xF7 - movs r2, 0x98 - movs r3, 0x1 - bl AddObjectToFront - movs r6, 0 - add r4, sp, 0x10 - movs r5, 0xC0 - lsls r5, 13 -_080779BC: - add r1, sp, 0x10 - ldr r0, =gUnknown_0832DCAC - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - adds r0, r6, 0 - adds r0, 0x8 - ldrh r7, [r4] - adds r0, r7 - strh r0, [r4] - asrs r1, r5, 16 - add r0, sp, 0x10 - movs r2, 0x96 - movs r3, 0x1 - bl AddObjectToFront - movs r0, 0x80 - lsls r0, 14 - adds r5, r0 - adds r6, 0x1 - cmp r6, 0x5 - ble _080779BC - ldr r0, =gUnknown_0832DC94 - ldr r2, =gUnknown_0832DE24 - ldrb r1, [r2] - lsls r1, 19 - movs r3, 0x80 - lsls r3, 14 - adds r1, r3 - asrs r1, 16 - ldrb r2, [r2, 0x1] - lsls r2, 3 - movs r3, 0x2 - bl AddObjectToFront - ldr r2, =0x0203229c - ldr r1, [r2] - adds r1, 0x34 - movs r3, 0 - strb r0, [r1] - ldr r0, [r2] - adds r0, 0x35 - strb r3, [r0] - ldr r1, =0x030022c0 - movs r5, 0x87 - lsls r5, 3 - adds r1, r5 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0 - bl rbox_fill_rectangle - b _08077B46 - .pool -_08077A40: - movs r0, 0 - bl sub_807A320 - movs r0, 0 - bl sub_8079BE0 - ldr r2, =0x0203229c - ldr r0, [r2] - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - strb r1, [r0, 0x1] - bl sub_8078388 - ldr r1, =0x030022c0 - movs r7, 0x87 - lsls r7, 3 - adds r1, r7 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, =0x000001b3 - bl song_play_for_text - b _08077B46 - .pool -_08077A80: - movs r0, 0x1 - bl sub_807A320 - movs r0, 0x1 - bl sub_8079BE0 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_08077A9A: - movs r0, 0 - bl sub_80782B8 - b _08077B1A - .pool -_08077AA8: - movs r0, 0x1 - bl sub_80782B8 - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _08077B22 - .pool -_08077ABC: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r1, =0x030022c0 - movs r5, 0x87 - lsls r5, 3 - adds r1, r5 - b _08077B22 - .pool -_08077ADC: - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0x2 - bl sub_80782B8 - ldr r1, =0x030022c0 - movs r7, 0x87 - lsls r7, 3 - adds r1, r7 - b _08077B22 - .pool -_08077AFC: - movs r0, 0 - bl sub_807A468 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _08077B22 - .pool -_08077B10: - movs r0, 0x1 - bl sub_807A468 - bl sub_807A53C -_08077B1A: - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_08077B22: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08077B46 - .pool -_08077B30: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08077B46 - ldr r0, =sub_8078C34 - str r0, [r3] - ldr r0, =sub_807825C - bl SetMainCallback2 -_08077B46: - bl RunTextPrinters - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - add sp, 0x28 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80773D0 - - thumb_func_start sub_8077B74 -sub_8077B74: @ 8077B74 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x24 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0x16 - bls _08077B8E - b _080780F6 -_08077B8E: - lsls r0, 2 - ldr r1, =_08077BA0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08077BA0: - .4byte _08077BFC - .4byte _08077C10 - .4byte _08077C18 - .4byte _08077C20 - .4byte _08077C28 - .4byte _08077C3C - .4byte _08077C64 - .4byte _08077C6C - .4byte _08077DB0 - .4byte _08077DD8 - .4byte _08077DFC - .4byte _08077E84 - .4byte _08077EA0 - .4byte _08077F48 - .4byte _080780F6 - .4byte _080780F6 - .4byte _08078038 - .4byte _08078040 - .4byte _08078068 - .4byte _080780A4 - .4byte _080780C4 - .4byte _080780CC - .4byte _080780E4 -_08077BFC: - bl sub_80772A4 - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _080780D8 - .pool -_08077C10: - movs r5, 0x87 - lsls r5, 3 - adds r1, r2, r5 - b _08077E58 -_08077C18: - movs r7, 0x87 - lsls r7, 3 - adds r1, r2, r7 - b _080780D8 -_08077C20: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - b _080780D8 -_08077C28: - bl calc_player_party_count - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _080780D8 - .pool -_08077C3C: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08077C50 - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 -_08077C50: - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _080780D8 - .pool -_08077C64: - movs r5, 0x87 - lsls r5, 3 - adds r1, r2, r5 - b _080780D8 -_08077C6C: - bl calc_enemy_party_count - ldr r4, =0x0203229c - ldr r0, [r4] - ldr r1, =0x020244e9 - ldrb r1, [r1] - adds r0, 0x36 - strb r1, [r0] - ldr r0, [r4] - ldr r1, =0x020244ea - ldrb r1, [r1] - adds r0, 0x37 - strb r1, [r0] - movs r0, 0 - bl ClearWindowTilemap - movs r0, 0 - bl sub_8079BE0 - movs r0, 0x1 - bl sub_8079BE0 - movs r6, 0 - ldr r0, [r4] - adds r0, 0x36 - ldrb r0, [r0] - cmp r6, r0 - bge _08077D08 - mov r8, r4 - ldr r7, =gUnknown_0832DE24 -_08077CA8: - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - ldrb r2, [r7] - lsls r2, 19 - movs r1, 0xE0 - lsls r1, 12 - adds r2, r1 - asrs r2, 16 - ldrb r3, [r7, 0x1] - lsls r3, 19 - ldr r1, =0xfff40000 - adds r3, r1 - asrs r3, 16 - movs r1, 0x1 - str r1, [sp] - str r0, [sp, 0x4] - str r1, [sp, 0x8] - adds r0, r5, 0 - ldr r1, =sub_80D3014 - bl sub_80D2CC4 - mov r2, r8 - ldr r1, [r2] - adds r1, 0x28 - adds r1, r6 - strb r0, [r1] - adds r7, 0x2 - adds r6, 0x1 - ldr r0, [r2] - adds r0, 0x36 - ldrb r0, [r0] - cmp r6, r0 - blt _08077CA8 -_08077D08: - movs r6, 0 - ldr r1, =0x0203229c - ldr r0, [r1] - adds r0, 0x37 - ldrb r0, [r0] - cmp r6, r0 - bge _08077D80 - ldr r0, =gUnknown_0832DE24 - mov r8, r1 - adds r7, r0, 0 - adds r7, 0xC -_08077D1E: - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - ldrb r2, [r7] - lsls r2, 19 - movs r3, 0xE0 - lsls r3, 12 - adds r2, r3 - asrs r2, 16 - ldrb r3, [r7, 0x1] - lsls r3, 19 - ldr r1, =0xfff40000 - adds r3, r1 - asrs r3, 16 - movs r1, 0x1 - str r1, [sp] - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r5, 0 - ldr r1, =sub_80D3014 - bl sub_80D2CC4 - mov r2, r8 - ldr r1, [r2] - adds r1, 0x2E - adds r1, r6 - strb r0, [r1] - adds r7, 0x2 - adds r6, 0x1 - ldr r0, [r2] - adds r0, 0x37 - ldrb r0, [r0] - cmp r6, r0 - blt _08077D1E -_08077D80: - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _080780D8 - .pool -_08077DB0: - bl sub_81B5D30 - ldr r0, =0x0203229c - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x36 - adds r1, 0x28 - movs r2, 0 - bl sub_81B5D4C - ldr r1, =0x030022c0 - movs r5, 0x87 - lsls r5, 3 - adds r1, r5 - b _080780D8 - .pool -_08077DD8: - ldr r0, =0x0203229c - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x36 - adds r1, 0x28 - movs r2, 0x1 - bl sub_81B5D4C - ldr r1, =0x030022c0 - movs r7, 0x87 - lsls r7, 3 - adds r1, r7 - b _080780D8 - .pool -_08077DFC: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r5, =0x02032188 - ldr r1, [r5] - movs r4, 0x3 - str r4, [sp] - movs r2, 0 - movs r3, 0 - bl sub_80C6D80 - bl link_get_multiplayer_id - lsls r0, 24 - movs r1, 0x80 - lsls r1, 17 - eors r1, r0 - lsrs r1, 24 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - ldr r1, =0x020229f0 - adds r0, r1 - ldr r1, [r5, 0xC] - str r4, [sp] - movs r2, 0 - movs r3, 0 - bl sub_80C6D80 - ldr r4, =gUnknown_0832DE94 - ldr r0, [r4] - ldr r1, [r5, 0x18] - movs r2, 0x2 - str r2, [sp] - movs r2, 0 - movs r3, 0 - bl sub_80C6D80 - ldr r0, [r4, 0x4] - ldr r1, [r5, 0x20] - movs r2, 0x18 - bl sub_807A308 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 -_08077E58: - ldrb r0, [r1] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1] - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0xA8 - strb r2, [r0] - b _080780F6 - .pool -_08077E84: - bl sub_807A1F0 - lsls r0, 24 - cmp r0, 0 - bne _08077E90 - b _080780F6 -_08077E90: - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _080780D8 - .pool -_08077EA0: - ldr r0, =0x03005d90 - ldr r1, [r0] - movs r0, 0x1 - movs r2, 0x78 - bl GetStringCenterAlignXOffset - movs r6, 0 - add r5, sp, 0xC - adds r4, r0, 0 - adds r4, 0x10 -_08077EB4: - add r1, sp, 0xC - ldr r0, =gUnknown_0832DCAC - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldrh r0, [r5] - adds r0, r6 - strh r0, [r5] - lsls r1, r4, 16 - asrs r1, 16 - add r0, sp, 0xC - movs r2, 0xA - movs r3, 0x1 - bl AddObjectToFront - adds r4, 0x20 - adds r6, 0x1 - cmp r6, 0x2 - ble _08077EB4 - bl link_get_multiplayer_id - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r0, =0x020229f0 - adds r1, r0 - movs r0, 0x1 - movs r2, 0x78 - bl GetStringCenterAlignXOffset - movs r6, 0 - add r5, sp, 0xC - adds r4, r0, 0 - adds r4, 0x88 -_08077F02: - add r1, sp, 0xC - ldr r0, =gUnknown_0832DCAC - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - adds r0, r6, 0x3 - ldrh r3, [r5] - adds r0, r3 - strh r0, [r5] - lsls r1, r4, 16 - asrs r1, 16 - add r0, sp, 0xC - movs r2, 0xA - movs r3, 0x1 - bl AddObjectToFront - adds r4, 0x20 - adds r6, 0x1 - cmp r6, 0x2 - ble _08077F02 - ldr r1, =0x030022c0 - movs r5, 0x87 - lsls r5, 3 - adds r1, r5 - b _080780D8 - .pool -_08077F48: - ldr r4, =gUnknown_0832DCAC - add r1, sp, 0xC - adds r0, r4, 0 - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r5,r7} - stm r1!, {r2,r5,r7} - add r1, sp, 0xC - adds r0, r1, 0 - ldrh r0, [r0] - adds r0, 0x6 - strh r0, [r1] - adds r0, r1, 0 - movs r1, 0xD7 - movs r2, 0x98 - movs r3, 0x1 - bl AddObjectToFront - add r0, sp, 0xC - ldm r4!, {r3,r5,r7} - stm r0!, {r3,r5,r7} - ldm r4!, {r1-r3} - stm r0!, {r1-r3} - add r1, sp, 0xC - adds r0, r1, 0 - ldrh r0, [r0] - adds r0, 0x7 - strh r0, [r1] - adds r0, r1, 0 - movs r1, 0xF7 - movs r2, 0x98 - movs r3, 0x1 - bl AddObjectToFront - movs r6, 0 - add r4, sp, 0xC - movs r5, 0xC0 - lsls r5, 13 -_08077F94: - add r1, sp, 0xC - ldr r0, =gUnknown_0832DCAC - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - adds r0, r6, 0 - adds r0, 0x8 - ldrh r7, [r4] - adds r0, r7 - strh r0, [r4] - asrs r1, r5, 16 - add r0, sp, 0xC - movs r2, 0x96 - movs r3, 0x1 - bl AddObjectToFront - movs r0, 0x80 - lsls r0, 14 - adds r5, r0 - adds r6, 0x1 - cmp r6, 0x5 - ble _08077F94 - ldr r0, =0x0203229c - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x35 - ldrb r1, [r2] - adds r4, r0, 0 - cmp r1, 0x5 - bhi _08077FE4 - ldr r0, =0x0203cf20 - ldrb r0, [r0] - b _08077FEA - .pool -_08077FE4: - ldr r0, =0x0203cf20 - ldrb r0, [r0] - adds r0, 0x6 -_08077FEA: - strb r0, [r2] - ldr r0, =gUnknown_0832DC94 - ldr r3, =gUnknown_0832DE24 - ldr r1, [r4] - adds r1, 0x35 - ldrb r2, [r1] - lsls r2, 1 - adds r1, r2, r3 - ldrb r1, [r1] - lsls r1, 19 - movs r5, 0x80 - lsls r5, 14 - adds r1, r5 - asrs r1, 16 - adds r3, 0x1 - adds r2, r3 - ldrb r2, [r2] - lsls r2, 3 - movs r3, 0x2 - bl AddObjectToFront - ldr r1, [r4] - adds r1, 0x34 - strb r0, [r1] - ldr r0, =0x030022c0 - movs r7, 0x87 - lsls r7, 3 - adds r0, r7 - movs r1, 0x10 - strb r1, [r0] - b _080780F6 - .pool -_08078038: - movs r0, 0 - bl sub_80782B8 - b _080780D0 -_08078040: - movs r0, 0x1 - bl sub_80782B8 - ldr r2, =0x0203229c - ldr r0, [r2] - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - strb r1, [r0, 0x1] - bl sub_8078388 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _080780D8 - .pool -_08078068: - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] - movs r4, 0x1 - negs r4, r4 - adds r0, r4, 0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _080780D8 - .pool -_080780A4: - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0x2 - bl sub_80782B8 - ldr r1, =0x030022c0 - movs r5, 0x87 - lsls r5, 3 - adds r1, r5 - b _080780D8 - .pool -_080780C4: - movs r7, 0x87 - lsls r7, 3 - adds r1, r2, r7 - b _080780D8 -_080780CC: - bl sub_807A53C -_080780D0: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 -_080780D8: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080780F6 - .pool -_080780E4: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080780F6 - ldr r0, =sub_807825C - bl SetMainCallback2 -_080780F6: - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - add sp, 0x24 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8077B74 - - thumb_func_start sub_807811C -sub_807811C: @ 807811C - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_807811C - - thumb_func_start sub_8078130 -sub_8078130: @ 8078130 - push {r4,lr} - sub sp, 0x4 - ldr r4, =0x0203229c - ldr r1, [r4] - adds r1, 0xA8 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xF - bls _08078160 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, [r4] - adds r0, 0x6F - movs r1, 0xA - strb r1, [r0] -_08078160: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8078130 - - thumb_func_start sub_807816C -sub_807816C: @ 807816C - push {r4,lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080781C2 - ldr r1, =0x02032298 - ldr r4, =0x0203229c - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0x35 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r2, 0 - adds r0, 0x7E - ldrb r0, [r0] - strb r0, [r1, 0x1] - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _080781B4 - adds r1, r2, 0 - adds r1, 0x6F - movs r0, 0x10 - strb r0, [r1] - b _080781C2 - .pool -_080781B4: - movs r0, 0x20 - bl sub_800ABF4 - ldr r0, [r4] - adds r0, 0x6F - movs r1, 0xD - strb r1, [r0] -_080781C2: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_807816C - - thumb_func_start sub_80781C8 -sub_80781C8: @ 80781C8 - push {r4,r5,lr} - ldr r5, =0x030022c0 - ldr r0, =sub_80773AC - str r0, [r5, 0x8] - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08078220 - bl sub_8010500 - lsls r0, 24 - cmp r0, 0 - beq _08078244 - ldr r0, =0x02032184 - ldr r0, [r0] - bl Free - bl FreeAllWindowBuffers - ldr r0, =0x0203229c - ldr r0, [r0] - bl Free - movs r0, 0 - str r0, [r5] - bl sub_800E084 - ldr r0, =sub_807AE50 - bl SetMainCallback2 - b _08078244 - .pool -_08078220: - ldr r0, =0x03003124 - ldrb r4, [r0] - cmp r4, 0 - bne _08078244 - ldr r0, =0x02032184 - ldr r0, [r0] - bl Free - bl FreeAllWindowBuffers - ldr r0, =0x0203229c - ldr r0, [r0] - bl Free - str r4, [r5] - ldr r0, =sub_807AE50 - bl SetMainCallback2 -_08078244: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80781C8 - - thumb_func_start sub_807825C -sub_807825C: @ 807825C - push {r4,lr} - bl sub_80795AC - bl sub_807A0C4 - movs r0, 0 - bl sub_80796B4 - movs r0, 0x1 - bl sub_80796B4 - ldr r4, =0x0203229c - ldr r2, [r4] - ldrb r1, [r2] - adds r0, r1, 0x1 - strb r0, [r2] - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x18 - bl SetGpuReg - ldr r2, [r4] - ldrb r1, [r2, 0x1] - adds r0, r1, 0 - adds r0, 0xFF - strb r0, [r2, 0x1] - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x1C - bl SetGpuReg - bl sub_8197224 - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807825C - - thumb_func_start sub_80782B8 -sub_80782B8: @ 80782B8 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - beq _08078324 - cmp r4, 0x1 - bgt _080782CE - cmp r4, 0 - beq _080782D4 - b _0807837E -_080782CE: - cmp r4, 0x2 - beq _0807834C - b _0807837E -_080782D4: - ldr r0, =gUnknown_08DDB3E4 - movs r1, 0 - movs r2, 0x60 - bl gpu_pal_apply - ldr r1, =gUnknown_08DDB464 - movs r2, 0x94 - lsls r2, 5 - movs r0, 0x1 - movs r3, 0 - bl LoadBgTiles - ldr r1, =gUnknown_08DDCF04 - movs r0, 0x20 - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - ldr r1, =gUnknown_0832CABC - movs r2, 0x80 - lsls r2, 4 - movs r0, 0x2 - movs r3, 0 - bl LoadBgTilemap - b _0807837E - .pool -_08078324: - ldr r1, =gUnknown_0832D2BC - movs r2, 0x80 - lsls r2, 4 - movs r0, 0x3 - movs r3, 0 - bl LoadBgTilemap - movs r0, 0 - bl sub_8079E44 - movs r0, 0x1 - bl sub_8079E44 - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - b _0807837E - .pool -_0807834C: - movs r5, 0x80 - lsls r5, 21 - movs r4, 0x3 -_08078352: - lsrs r0, r5, 24 - movs r1, 0 - bl SetGpuReg - movs r0, 0x80 - lsls r0, 18 - adds r5, r0 - subs r4, 0x1 - cmp r4, 0 - bge _08078352 - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg -_0807837E: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80782B8 - - thumb_func_start sub_8078388 -sub_8078388: @ 8078388 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r3, 0 - ldr r5, =0x0203229c - mov r8, r5 - ldr r0, =0x02020630 - mov r12, r0 - movs r1, 0x5 - negs r1, r1 - mov r9, r1 - movs r4, 0x6 - movs r7, 0x1 - movs r6, 0 -_080783A6: - mov r1, r8 - ldr r0, [r1] - adds r1, r0, 0 - adds r1, 0x36 - ldrb r1, [r1] - cmp r3, r1 - bge _080783E0 - adds r0, 0x28 - adds r0, r3 - 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] - ldr r0, [r5] - adds r0, 0x38 - adds r0, r3 - strb r7, [r0] - b _080783E6 - .pool -_080783E0: - adds r0, 0x38 - adds r0, r3 - strb r6, [r0] -_080783E6: - mov r1, r8 - ldr r0, [r1] - adds r1, r0, 0 - adds r1, 0x37 - ldrb r1, [r1] - cmp r3, r1 - bge _08078416 - adds r0, 0x2E - adds r0, r3 - 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] - ldr r0, [r5] - adds r0, 0x38 - adds r0, r4 - strb r7, [r0] - b _0807841C -_08078416: - adds r0, 0x38 - adds r0, r4 - strb r6, [r0] -_0807841C: - adds r4, 0x1 - adds r3, 0x1 - cmp r3, 0x5 - ble _080783A6 - ldr r0, [r5] - adds r0, 0x44 - movs r1, 0x1 - strb r1, [r0] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8078388 - - thumb_func_start sub_8078438 -sub_8078438: @ 8078438 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r3, 0 - cmp r3, r2 - bcs _08078452 -_08078444: - adds r0, r5, r3 - adds r1, r4, r3 - ldrb r1, [r1] - strb r1, [r0] - adds r3, 0x1 - cmp r3, r2 - bcc _08078444 -_08078452: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8078438 - - thumb_func_start shedinja_maker_maybe -shedinja_maker_maybe: @ 8078458 - push {r4-r6,lr} - sub sp, 0xC - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x69 - ldrb r0, [r0] - cmp r0, 0x15 - bls _08078472 - b _080787AA -_08078472: - lsls r0, 2 - ldr r1, =_08078484 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08078484: - .4byte _080784DC - .4byte _08078508 - .4byte _08078784 - .4byte _08078534 - .4byte _08078548 - .4byte _0807857C - .4byte _08078784 - .4byte _08078598 - .4byte _080785AC - .4byte _080785E0 - .4byte _08078784 - .4byte _080785FC - .4byte _08078610 - .4byte _08078644 - .4byte _08078784 - .4byte _0807866C - .4byte _08078680 - .4byte _080786B4 - .4byte _08078784 - .4byte _080786DC - .4byte _080786F0 - .4byte _08078720 -_080784DC: - ldr r0, =0x020228c4 - ldr r1, =0x020244ec - movs r2, 0xC8 - bl sub_8078438 - ldr r3, =0x0203229c - ldr r1, [r3] - adds r1, 0x69 - ldrb r0, [r1] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1] - ldr r0, [r3] - adds r0, 0xA8 - strb r2, [r0] - b _080787AA - .pool -_08078508: - bl sub_80771BC - cmp r0, 0 - bne _08078512 - b _080787AA -_08078512: - bl sub_8077200 - cmp r0, 0 - bne _08078524 - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_08078524: - bl sub_8077210 - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_08078534: - cmp r5, 0 - bne _0807853E - movs r0, 0x1 - bl sub_80771AC -_0807853E: - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_08078548: - bl sub_8077200 - cmp r0, 0x3 - beq _08078552 - b _080787AA -_08078552: - ldr r0, =0x02024744 - movs r2, 0x1 - adds r1, r5, 0 - eors r1, r2 - lsls r1, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0xC8 - bl sub_8078438 - bl sub_8077210 - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_0807857C: - ldr r0, =0x020228c4 - ldr r1, =0x020245b4 - movs r2, 0xC8 - bl sub_8078438 - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_08078598: - cmp r5, 0 - bne _080785A2 - movs r0, 0x1 - bl sub_80771AC -_080785A2: - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_080785AC: - bl sub_8077200 - cmp r0, 0x3 - beq _080785B6 - b _080787AA -_080785B6: - ldr r0, =0x0202480c - movs r2, 0x1 - adds r1, r5, 0 - eors r1, r2 - lsls r1, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0xC8 - bl sub_8078438 - bl sub_8077210 - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_080785E0: - ldr r0, =0x020228c4 - ldr r1, =0x0202467c - movs r2, 0xC8 - bl sub_8078438 - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_080785FC: - cmp r5, 0 - bne _08078606 - movs r0, 0x1 - bl sub_80771AC -_08078606: - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_08078610: - bl sub_8077200 - cmp r0, 0x3 - beq _0807861A - b _080787AA -_0807861A: - ldr r0, =0x020248d4 - movs r2, 0x1 - adds r1, r5, 0 - eors r1, r2 - lsls r1, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0xC8 - bl sub_8078438 - bl sub_8077210 - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_08078644: - ldr r0, =0x020228c4 - ldr r1, =0x03005d8c - ldr r1, [r1] - ldr r2, =0x00002be0 - adds r1, r2 - movs r2, 0xDC - bl sub_8078438 - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_0807866C: - cmp r5, 0 - bne _08078676 - movs r0, 0x3 - bl sub_80771AC -_08078676: - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_08078680: - bl sub_8077200 - cmp r0, 0x3 - beq _0807868A - b _080787AA -_0807868A: - ldr r0, =0x020321c0 - movs r2, 0x1 - adds r1, r5, 0 - eors r1, r2 - lsls r1, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0xD8 - bl sub_8078438 - bl sub_8077210 - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_080786B4: - ldr r0, =0x020228c4 - ldr r1, =0x03005d8c - ldr r1, [r1] - ldr r2, =0x000031a8 - adds r1, r2 - movs r2, 0xB - bl sub_8078438 - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_080786DC: - cmp r5, 0 - bne _080786E6 - movs r0, 0x4 - bl sub_80771AC -_080786E6: - ldr r0, =0x0203229c - ldr r1, [r0] - b _080787A2 - .pool -_080786F0: - bl sub_8077200 - cmp r0, 0x3 - bne _080787AA - ldr r4, =0x0203229c - ldr r0, [r4] - adds r0, 0xA9 - movs r2, 0x1 - adds r1, r5, 0 - eors r1, r2 - lsls r1, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0xB - bl sub_8078438 - bl sub_8077210 - ldr r1, [r4] - b _080787A2 - .pool -_08078720: - ldr r4, =0x02024744 - ldr r6, =0x0000012f - movs r5, 0x5 -_08078726: - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - beq _08078766 - cmp r0, r6 - bne _08078766 - adds r0, r4, 0 - movs r1, 0x3 - bl pokemon_getattr - cmp r0, 0x1 - beq _08078766 - adds r0, r4, 0 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - mov r0, sp - ldr r1, =gUnknown_0832DF94 - bl CompareStringWithoutExtendedControlCodes - cmp r0, 0 - bne _08078766 - adds r0, r4, 0 - movs r1, 0x2 - ldr r2, =gSpeciesNames + SPECIES_SHEDINJA * POKEMON_NAME_LENGTH - bl pokemon_setattr -_08078766: - adds r4, 0x64 - subs r5, 0x1 - cmp r5, 0 - bge _08078726 - movs r0, 0x1 - b _080787AC - .pool -_08078784: - ldr r2, =0x0203229c - ldr r1, [r2] - adds r1, 0xA8 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r2] - adds r1, r0, 0 - adds r1, 0xA8 - ldrb r0, [r1] - cmp r0, 0xA - bls _080787AA - movs r0, 0 - strb r0, [r1] - ldr r1, [r2] -_080787A2: - adds r1, 0x69 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080787AA: - movs r0, 0 -_080787AC: - add sp, 0xC - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end shedinja_maker_maybe - - thumb_func_start sub_80787B8 -sub_80787B8: @ 80787B8 - push {lr} - ldr r0, =gUnknown_0832DAE5 - ldr r1, =0x0203229c - ldr r1, [r1] - adds r1, 0x72 - ldrh r1, [r1] - lsls r1, 5 - ldr r2, =0x06010000 - adds r1, r2 - movs r2, 0x18 - bl sub_807A308 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80787B8 - - thumb_func_start sub_80787E0 -sub_80787E0: @ 80787E0 - push {r4,lr} - lsls r1, 24 - lsrs r4, r1, 24 - movs r2, 0x1 - adds r0, r4, 0 - ands r0, r2 - cmp r0, 0 - beq _08078864 - ldr r0, =0x020223c4 - ldrh r1, [r0] - ldr r0, =0x0000bbbb - cmp r1, r0 - beq _08078844 - cmp r1, r0 - bgt _08078814 - ldr r0, =0x0000aabb - cmp r1, r0 - beq _08078834 - b _0807885E - .pool -_08078814: - ldr r0, =0x0000bbcc - cmp r1, r0 - beq _08078854 - ldr r0, =0x0000eeaa - cmp r1, r0 - bne _0807885E - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x78 - b _0807885A - .pool -_08078834: - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x78 - strb r2, [r0] - b _0807885E - .pool -_08078844: - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x7A - strb r2, [r0] - b _0807885E - .pool -_08078854: - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x7A -_0807885A: - movs r1, 0x2 - strb r1, [r0] -_0807885E: - movs r0, 0 - bl sub_8077234 -_08078864: - movs r2, 0x2 - adds r0, r4, 0 - ands r0, r2 - cmp r0, 0 - beq _080788F6 - ldr r3, =0x020223c4 - movs r1, 0x80 - lsls r1, 1 - adds r0, r3, r1 - ldrh r1, [r0] - ldr r0, =0x0000bbbb - cmp r1, r0 - beq _080788D8 - cmp r1, r0 - bgt _0807889C - ldr r0, =0x0000aabb - cmp r1, r0 - beq _080788BC - b _080788F0 - .pool -_0807889C: - ldr r0, =0x0000bbcc - cmp r1, r0 - beq _080788E8 - ldr r0, =0x0000eeaa - cmp r1, r0 - bne _080788F0 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x79 - b _080788EE - .pool -_080788BC: - ldr r2, =0x0203229c - ldr r1, [r2] - movs r4, 0x81 - lsls r4, 1 - adds r0, r3, r4 - ldrb r0, [r0] - adds r0, 0x6 - adds r1, 0x7E - strb r0, [r1] - ldr r0, [r2] - adds r0, 0x79 - b _080788DE - .pool -_080788D8: - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x7B -_080788DE: - movs r1, 0x1 - strb r1, [r0] - b _080788F0 - .pool -_080788E8: - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x7B -_080788EE: - strb r2, [r0] -_080788F0: - movs r0, 0x1 - bl sub_8077234 -_080788F6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80787E0 - - thumb_func_start sub_8078900 -sub_8078900: @ 8078900 - push {r4,r5,lr} - sub sp, 0x4 - lsls r1, 24 - lsrs r5, r1, 24 - movs r0, 0x1 - ands r0, r5 - cmp r0, 0 - beq _080789E2 - ldr r2, =0x020223c4 - ldrh r1, [r2] - ldr r0, =0x0000ddee - cmp r1, r0 - beq _080789CC - cmp r1, r0 - bgt _0807893C - ldr r0, =0x0000ccdd - cmp r1, r0 - beq _080789AC - ldr r0, =0x0000dddd - cmp r1, r0 - beq _08078978 - b _080789DC - .pool -_0807893C: - ldr r0, =0x0000eebb - cmp r1, r0 - beq _08078950 - adds r0, 0x11 - cmp r1, r0 - beq _08078974 - b _080789DC - .pool -_08078950: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - movs r0, 0x4 - bl sub_807A19C - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0xB - b _080789DA - .pool -_08078974: - movs r0, 0x5 - b _080789CE -_08078978: - ldr r4, =0x0203229c - ldr r1, [r4] - ldrb r0, [r2, 0x2] - adds r0, 0x6 - adds r1, 0x7E - strb r0, [r1] - movs r0, 0 - bl rbox_fill_rectangle - ldr r0, [r4] - adds r0, 0x35 - ldrb r0, [r0] - bl sub_807967C - ldr r0, [r4] - adds r0, 0x7E - ldrb r0, [r0] - bl sub_807967C - ldr r0, [r4] - adds r0, 0x6F - movs r1, 0x7 - b _080789DA - .pool -_080789AC: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0xA - b _080789DA - .pool -_080789CC: - movs r0, 0x1 -_080789CE: - bl sub_807A19C - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0x8 -_080789DA: - strb r1, [r0] -_080789DC: - movs r0, 0 - bl sub_8077234 -_080789E2: - movs r0, 0x2 - ands r0, r5 - cmp r0, 0 - beq _080789F0 - movs r0, 0x1 - bl sub_8077234 -_080789F0: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8078900 - - thumb_func_start sub_80789FC -sub_80789FC: @ 80789FC - push {r4-r6,lr} - sub sp, 0x4 - ldr r6, =0x0203229c - ldr r2, [r6] - adds r1, r2, 0 - adds r1, 0x78 - ldrb r0, [r1] - cmp r0, 0 - bne _08078A10 - b _08078B44 -_08078A10: - adds r0, r2, 0 - adds r0, 0x79 - ldrb r0, [r0] - cmp r0, 0 - bne _08078A1C - b _08078B44 -_08078A1C: - ldrh r1, [r1] - ldr r0, =0x00000101 - cmp r1, r0 - bne _08078A64 - adds r1, r2, 0 - adds r1, 0x6F - movs r0, 0x6 - strb r0, [r1] - ldr r2, [r6] - adds r1, r2, 0 - adds r1, 0x80 - movs r4, 0 - ldr r0, =0x0000dddd - strh r0, [r1] - adds r0, r2, 0 - adds r0, 0x35 - ldrb r1, [r0] - adds r0, 0x4D - strh r1, [r0] - movs r0, 0x5 - movs r1, 0 - bl sub_807A048 - ldr r0, [r6] - adds r2, r0, 0 - adds r2, 0x79 - strb r4, [r2] - adds r0, 0x78 - strb r4, [r0] - b _08078B44 - .pool -_08078A64: - ldr r0, =0x00000201 - cmp r1, r0 - bne _08078AB4 - movs r0, 0x1 - bl sub_807A19C - ldr r1, [r6] - adds r2, r1, 0 - adds r2, 0x80 - movs r4, 0 - movs r3, 0 - ldr r0, =0x0000eecc - strh r0, [r2] - adds r1, 0x82 - strh r3, [r1] - movs r0, 0x5 - movs r1, 0 - bl sub_807A048 - ldr r0, [r6] - adds r1, r0, 0 - adds r1, 0x7B - strb r4, [r1] - adds r0, 0x7A - strb r4, [r0] - ldr r0, [r6] - adds r1, r0, 0 - adds r1, 0x79 - strb r4, [r1] - adds r0, 0x78 - strb r4, [r0] - ldr r0, [r6] - adds r0, 0x6F - movs r1, 0x8 - b _08078B42 - .pool -_08078AB4: - movs r0, 0x81 - lsls r0, 1 - cmp r1, r0 - bne _08078B00 - movs r0, 0x5 - bl sub_807A19C - ldr r1, [r6] - adds r2, r1, 0 - adds r2, 0x80 - movs r4, 0 - movs r3, 0 - ldr r0, =0x0000ddee - strh r0, [r2] - adds r1, 0x82 - strh r3, [r1] - movs r0, 0x5 - movs r1, 0 - bl sub_807A048 - ldr r0, [r6] - adds r1, r0, 0 - adds r1, 0x7B - strb r4, [r1] - adds r0, 0x7A - strb r4, [r0] - ldr r0, [r6] - adds r1, r0, 0 - adds r1, 0x79 - strb r4, [r1] - adds r0, 0x78 - strb r4, [r0] - ldr r0, [r6] - adds r0, 0x6F - movs r1, 0x8 - b _08078B42 - .pool -_08078B00: - ldr r0, =0x00000202 - cmp r1, r0 - bne _08078B44 - adds r1, r2, 0 - adds r1, 0x80 - movs r5, 0 - movs r4, 0 - ldr r0, =0x0000eebb - strh r0, [r1] - adds r0, r2, 0 - adds r0, 0x82 - strh r4, [r0] - movs r0, 0x5 - movs r1, 0 - bl sub_807A048 - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, [r6] - adds r1, r0, 0 - adds r1, 0x79 - strb r5, [r1] - adds r0, 0x78 - strb r5, [r0] - ldr r0, [r6] - adds r0, 0x6F - movs r1, 0xB -_08078B42: - strb r1, [r0] -_08078B44: - ldr r5, =0x0203229c - ldr r3, [r5] - adds r1, r3, 0 - adds r1, 0x7A - ldrb r0, [r1] - cmp r0, 0 - beq _08078BDC - adds r0, r3, 0 - adds r0, 0x7B - ldrb r0, [r0] - cmp r0, 0 - beq _08078BDC - ldrh r1, [r1] - ldr r0, =0x00000101 - cmp r1, r0 - bne _08078B92 - adds r1, r3, 0 - adds r1, 0x80 - movs r4, 0 - movs r2, 0 - ldr r0, =0x0000ccdd - strh r0, [r1] - adds r0, r3, 0 - adds r0, 0x82 - strh r2, [r0] - movs r0, 0x5 - movs r1, 0 - bl sub_807A048 - ldr r0, [r5] - adds r0, 0x7A - strb r4, [r0] - ldr r0, [r5] - adds r0, 0x7B - strb r4, [r0] - ldr r0, [r5] - adds r0, 0x6F - movs r1, 0x9 - strb r1, [r0] -_08078B92: - ldr r1, [r5] - adds r0, r1, 0 - adds r0, 0x7A - ldrb r0, [r0] - cmp r0, 0x2 - beq _08078BA8 - adds r0, r1, 0 - adds r0, 0x7B - ldrb r0, [r0] - cmp r0, 0x2 - bne _08078BDC -_08078BA8: - movs r0, 0x1 - bl sub_807A19C - ldr r1, [r5] - adds r2, r1, 0 - adds r2, 0x80 - movs r4, 0 - movs r3, 0 - ldr r0, =0x0000ddee - strh r0, [r2] - adds r1, 0x82 - strh r3, [r1] - movs r0, 0x5 - movs r1, 0 - bl sub_807A048 - ldr r0, [r5] - adds r0, 0x7A - strb r4, [r0] - ldr r0, [r5] - adds r0, 0x7B - strb r4, [r0] - ldr r0, [r5] - adds r0, 0x6F - movs r1, 0x8 - strb r1, [r0] -_08078BDC: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80789FC - - thumb_func_start sub_8078BFC -sub_8078BFC: @ 8078BFC - push {lr} - strh r1, [r0] - strh r2, [r0, 0x2] - movs r0, 0x5 - movs r1, 0 - bl sub_807A048 - pop {r0} - bx r0 - thumb_func_end sub_8078BFC - - thumb_func_start sub_8078C10 -sub_8078C10: @ 8078C10 - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - lsls r3, 16 - lsrs r3, 16 - lsls r2, 16 - lsrs r2, 16 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x80 - adds r1, r3, 0 - bl sub_8078BFC - pop {r0} - bx r0 - .pool - thumb_func_end sub_8078C10 - - thumb_func_start sub_8078C34 -sub_8078C34: @ 8078C34 - push {r4,lr} - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8077200 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _08078C5C - cmp r4, 0 - bne _08078C56 - movs r0, 0 - bl sub_80787E0 - b _08078C5C -_08078C56: - adds r0, r4, 0 - bl sub_8078900 -_08078C5C: - cmp r4, 0 - bne _08078C64 - bl sub_80789FC -_08078C64: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8078C34 - - thumb_func_start sub_8078C6C -sub_8078C6C: @ 8078C6C - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - movs r6, 0 - movs r5, 0 - ldr r2, =0x0203229c - ldr r3, [r2] - ldr r4, =gUnknown_0832DCEC - lsls r2, r1, 1 - adds r2, r1 - lsls r2, 1 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 3 - adds r3, 0x38 - adds r2, r1 - adds r2, r4 -_08078C92: - ldrb r1, [r2] - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08078CA8 - adds r6, r1, 0 - b _08078CB0 - .pool -_08078CA8: - adds r2, 0x1 - adds r5, 0x1 - cmp r5, 0x5 - ble _08078C92 -_08078CB0: - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8078C6C - - thumb_func_start sub_8078CB8 -sub_8078CB8: @ 8078CB8 - push {r4-r7,lr} - adds r7, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldrb r0, [r7] - bl sub_8078C6C - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0xC - bne _08078D10 - ldr r5, =0x0203229c - ldr r0, [r5] - adds r0, 0x34 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - movs r1, 0x1 - bl StartObjectImageAnim - ldr r2, [r5] - adds r2, 0x34 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xE0 - strh r1, [r0, 0x20] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xA0 - strh r1, [r0, 0x22] - b _08078D58 - .pool -_08078D10: - ldr r4, =0x0203229c - ldr r0, [r4] - adds r0, 0x34 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =0x02020630 - adds r0, r5 - movs r1, 0 - bl StartObjectImageAnim - ldr r4, [r4] - adds r4, 0x34 - ldrb r0, [r4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldr r2, =gUnknown_0832DE24 - lsls r3, r6, 1 - adds r0, r3, r2 - ldrb r0, [r0] - lsls r0, 3 - adds r0, 0x20 - strh r0, [r1, 0x20] - ldrb r0, [r4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r2, 0x1 - adds r3, r2 - ldrb r0, [r3] - lsls r0, 3 - strh r0, [r1, 0x22] -_08078D58: - ldrb r0, [r7] - cmp r0, r6 - beq _08078D64 - movs r0, 0x5 - bl audio_play -_08078D64: - strb r6, [r7] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8078CB8 - - thumb_func_start sub_8078D78 -sub_8078D78: @ 8078D78 - push {r4,lr} - movs r0, 0 - bl sub_807A19C - ldr r4, =0x0203229c - ldr r0, [r4] - adds r0, 0x6F - movs r1, 0x64 - strb r1, [r0] - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08078DAC - ldr r0, =0x0000aabb - ldr r1, [r4] - adds r1, 0x35 - ldrb r1, [r1] - bl sub_8078C10 - b _08078DB4 - .pool -_08078DAC: - ldr r0, [r4] - adds r0, 0x78 - movs r1, 0x1 - strb r1, [r0] -_08078DB4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8078D78 - - thumb_func_start sub_8078DBC -sub_8078DBC: @ 8078DBC - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08078DE4 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x35 - movs r1, 0 - bl sub_8078CB8 - b _08078E30 - .pool -_08078DE4: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08078E00 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x35 - movs r1, 0x1 - bl sub_8078CB8 - b _08078E30 - .pool -_08078E00: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08078E1C - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x35 - movs r1, 0x2 - bl sub_8078CB8 - b _08078E30 - .pool -_08078E1C: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08078E30 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x35 - movs r1, 0x3 - bl sub_8078CB8 -_08078E30: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08078EE4 - movs r0, 0x5 - bl audio_play - ldr r4, =0x0203229c - ldr r0, [r4] - adds r0, 0x35 - ldrb r0, [r0] - cmp r0, 0x5 - bhi _08078E98 - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0xE - bl sub_8098858 - movs r0, 0x1 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_0832DEAC - movs r0, 0x1 - movs r1, 0x2 - bl PrintMenuTable - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, [r4] - adds r0, 0x6F - movs r1, 0x1 - strb r1, [r0] - b _08078EE4 - .pool -_08078E98: - cmp r0, 0xB - bhi _08078EB6 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, [r4] - adds r0, 0x6F - movs r1, 0x2 - strb r1, [r0] - b _08078EE4 -_08078EB6: - cmp r0, 0xC - bne _08078EE4 - ldr r0, =gUnknown_0832DF8C - movs r1, 0x1 - movs r2, 0xE - movs r3, 0 - bl CreateYesNoMenu - ldr r0, [r4] - adds r0, 0x6F - movs r1, 0x4 - strb r1, [r0] - ldr r0, =gUnknown_0832DE94 - ldr r0, [r0, 0x10] - ldr r1, [r4] - adds r1, 0x72 - ldrh r1, [r1] - lsls r1, 5 - ldr r2, =0x06010000 - adds r1, r2 - movs r2, 0x18 - bl sub_807A308 -_08078EE4: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8078DBC - - thumb_func_start sub_8078EF8 -sub_8078EF8: @ 8078EF8 - push {lr} - bl sub_8079F74 - ldr r3, =0x0203229c - ldr r0, [r3] - adds r0, 0x6F - movs r1, 0 - strb r1, [r0] - ldr r2, =0x02020630 - ldr r0, [r3] - adds r0, 0x34 - ldrb r1, [r0] - 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] - ldr r0, =gUnknown_0832DE94 - ldr r0, [r0, 0x4] - ldr r1, [r3] - adds r1, 0x72 - ldrh r1, [r1] - lsls r1, 5 - ldr r2, =0x06010000 - adds r1, r2 - movs r2, 0x18 - bl sub_807A308 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8078EF8 - - thumb_func_start sub_8078F50 -sub_8078F50: @ 8078F50 - push {lr} - sub sp, 0x4 - bl ProcessMenuInputNoWrapAround - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _08078F72 - cmp r0, r1 - ble _0807902A - cmp r0, 0 - beq _08078F7E - cmp r0, 0x1 - beq _08078F9C - b _0807902A -_08078F72: - movs r0, 0x5 - bl audio_play - bl sub_8078EF8 - b _0807902A -_08078F7E: - str r0, [sp] - adds r0, r1, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0x2 - b _08079028 - .pool -_08078F9C: - ldr r0, =0x020244ec - ldr r1, =0x020244e9 - ldrb r1, [r1] - ldr r2, =0x0203229c - ldr r2, [r2] - adds r2, 0x35 - ldrb r2, [r2] - bl sub_807A5F4 - cmp r0, 0x5 - bhi _0807902A - lsls r0, 2 - ldr r1, =_08078FCC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08078FCC: - .4byte _08078FE4 - .4byte _0807900C - .4byte _08079012 - .4byte _08079018 - .4byte _08079012 - .4byte _08079018 -_08078FE4: - bl sub_8078D78 - ldr r2, =0x02020630 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x34 - 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 - b _08079028 - .pool -_0807900C: - movs r0, 0x3 - movs r1, 0x3 - b _0807901C -_08079012: - movs r0, 0x3 - movs r1, 0x6 - b _0807901C -_08079018: - movs r0, 0x3 - movs r1, 0x7 -_0807901C: - bl sub_807A048 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0x8 -_08079028: - strb r1, [r0] -_0807902A: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8078F50 - - thumb_func_start sub_8079034 -sub_8079034: @ 8079034 - push {lr} - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0807904A - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08079054 -_0807904A: - movs r0, 0x5 - bl audio_play - bl sub_8078EF8 -_08079054: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079034 - - thumb_func_start sub_807905C -sub_807905C: @ 807905C - push {lr} - sub sp, 0x4 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080790C4 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r3, r0, 0 - adds r3, 0x35 - ldrb r2, [r3] - cmp r2, 0x5 - bhi _080790A4 - ldr r1, =0x020244ec - ldrb r2, [r3] - adds r0, 0x36 - ldrb r3, [r0] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =sub_8077B74 - str r0, [sp] - movs r0, 0x1 - bl sub_81BF8EC - b _080790C0 - .pool -_080790A4: - ldr r1, =0x02024744 - subs r2, 0x6 - lsls r2, 24 - lsrs r2, 24 - adds r0, 0x37 - ldrb r3, [r0] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =sub_8077B74 - str r0, [sp] - movs r0, 0x1 - bl sub_81BF8EC -_080790C0: - bl FreeAllWindowBuffers -_080790C4: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_807905C - - thumb_func_start sub_80790D4 -sub_80790D4: @ 80790D4 - push {r4-r7,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r6, r3, 24 - movs r5, 0 - movs r3, 0 - ldr r7, =0x02024744 - cmp r5, r1 - bge _08079102 -_080790EE: - cmp r2, r3 - beq _080790FC - adds r0, r4, r3 - ldrb r0, [r0] - adds r0, r5, r0 - lsls r0, 24 - lsrs r5, r0, 24 -_080790FC: - adds r3, 0x1 - cmp r3, r1 - blt _080790EE -_08079102: - adds r0, r6, 0 - movs r1, 0x6 - bl __umodsi3 - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0x64 - muls r0, r6 - adds r7, r0, r7 - adds r0, r7, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0xCD - lsls r0, 1 - cmp r4, r0 - beq _0807912C - cmp r4, 0x97 - bne _08079138 -_0807912C: - adds r0, r7, 0 - movs r1, 0x50 - bl pokemon_getattr - cmp r0, 0 - beq _08079158 -_08079138: - bl sub_809D42C - cmp r0, 0 - bne _08079164 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x57 - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0 - bne _08079158 - adds r0, r4, 0 - bl sub_806E3F8 - cmp r0, 0 - bne _08079164 -_08079158: - movs r0, 0x2 - b _0807916C - .pool -_08079164: - cmp r5, 0 - beq _0807916A - movs r5, 0x1 -_0807916A: - adds r0, r5, 0 -_0807916C: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80790D4 - - thumb_func_start sub_8079174 -sub_8079174: @ 8079174 - push {r4,r5,lr} - sub sp, 0xC - movs r2, 0 - ldr r0, =0x0203229c - ldr r1, [r0] - adds r3, r1, 0 - adds r3, 0x36 - adds r5, r0, 0 - ldrb r0, [r3] - cmp r2, r0 - bge _080791A0 - adds r4, r1, 0 - adds r4, 0x45 -_0807918E: - mov r1, sp - adds r0, r1, r2 - adds r1, r4, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - ldrb r0, [r3] - cmp r2, r0 - blt _0807918E -_080791A0: - ldr r0, [r5] - adds r1, r0, 0 - adds r1, 0x36 - ldrb r1, [r1] - adds r2, r0, 0 - adds r2, 0x35 - ldrb r2, [r2] - adds r0, 0x7E - ldrb r3, [r0] - mov r0, sp - bl sub_80790D4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080791E8 - cmp r0, 0x1 - bgt _080791D0 - cmp r0, 0 - beq _080791D6 - b _0807920C - .pool -_080791D0: - cmp r0, 0x2 - beq _08079200 - b _0807920C -_080791D6: - movs r0, 0x3 - movs r1, 0x3 - bl sub_807A048 - ldr r0, =0x0000bbcc - b _080791F2 - .pool -_080791E8: - movs r0, 0x3 - movs r1, 0x1 - bl sub_807A048 - ldr r0, =0x0000bbbb -_080791F2: - movs r1, 0 - bl sub_8078C10 - b _0807920C - .pool -_08079200: - movs r0, 0x3 - movs r1, 0x8 - bl sub_807A048 - movs r0, 0x1 - b _0807920E -_0807920C: - movs r0, 0 -_0807920E: - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8079174 - - thumb_func_start sub_8079218 -sub_8079218: @ 8079218 - push {lr} - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _0807923A - cmp r1, 0 - bgt _08079234 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08079268 - b _08079290 -_08079234: - cmp r1, 0x1 - beq _08079268 - b _08079290 -_0807923A: - bl sub_8079174 - cmp r0, 0 - bne _08079250 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0x64 - b _08079258 - .pool -_08079250: - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0x11 -_08079258: - strb r1, [r0] - movs r0, 0x11 - bl PutWindowTilemap - b _08079290 - .pool -_08079268: - movs r0, 0x3 - movs r1, 0x1 - bl sub_807A048 - bl sub_80771BC - cmp r0, 0 - beq _08079280 - ldr r0, =0x0000bbcc - movs r1, 0 - bl sub_8078C10 -_08079280: - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0x64 - strb r1, [r0] - movs r0, 0x11 - bl PutWindowTilemap -_08079290: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079218 - - thumb_func_start sub_807929C -sub_807929C: @ 807929C - push {r4-r6,lr} - movs r5, 0 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x37 - ldrb r0, [r0] - subs r0, 0x4 - cmp r5, r0 - bge _080792D8 - movs r6, 0xC0 - lsls r6, 20 -_080792B2: - lsrs r4, r6, 24 - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x1 - bl CopyWindowToVram - movs r0, 0x80 - lsls r0, 17 - adds r6, r0 - adds r5, 0x1 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x37 - ldrb r0, [r0] - subs r0, 0x4 - cmp r5, r0 - blt _080792B2 -_080792D8: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807929C - - thumb_func_start sub_80792E4 -sub_80792E4: @ 80792E4 - push {lr} - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _08079306 - cmp r1, 0 - bgt _08079300 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _0807934C - b _08079356 -_08079300: - cmp r1, 0x1 - beq _0807934C - b _08079356 -_08079306: - movs r0, 0x4 - bl sub_807A19C - ldr r0, =0x0000eeaa - movs r1, 0 - bl sub_8078C10 - ldr r2, =0x02020630 - ldr r3, =0x0203229c - ldr r0, [r3] - adds r0, 0x34 - 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] - ldr r0, [r3] - adds r0, 0x6F - movs r1, 0x64 - strb r1, [r0] - bl sub_807929C - b _08079356 - .pool -_0807934C: - movs r0, 0x5 - bl audio_play - bl sub_8078EF8 -_08079356: - pop {r0} - bx r0 - thumb_func_end sub_80792E4 - - thumb_func_start sub_807935C -sub_807935C: @ 807935C - push {r4,lr} - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _08079384 - movs r0, 0 - bl rbox_fill_rectangle - ldr r4, =0x0203229c - ldr r0, [r4] - adds r0, 0x35 - ldrb r0, [r0] - bl sub_807967C - ldr r0, [r4] - adds r0, 0x7E - ldrb r0, [r0] - bl sub_807967C -_08079384: - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0x7 - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807935C - - thumb_func_start sub_8079398 -sub_8079398: @ 8079398 - push {r4,lr} - ldr r4, =0x0203229c - ldr r0, [r4] - adds r0, 0x74 - ldrh r1, [r0] - ldr r0, =0x00000505 - cmp r1, r0 - bne _080793B4 - bl sub_80787B8 - ldr r0, [r4] - adds r0, 0x6F - movs r1, 0xE - strb r1, [r0] -_080793B4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079398 - - thumb_func_start sub_80793C4 -sub_80793C4: @ 80793C4 - push {r4,lr} - ldr r4, =0x0203229c - ldr r1, [r4] - adds r1, 0xA8 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r4] - adds r0, 0xA8 - ldrb r0, [r0] - cmp r0, 0x78 - bls _080793F8 - ldr r0, =gUnknown_0832DF8C - movs r1, 0x1 - movs r2, 0xE - movs r3, 0 - bl CreateYesNoMenu - ldr r0, [r4] - adds r0, 0xA8 - movs r1, 0 - strb r1, [r0] - ldr r0, [r4] - adds r0, 0x6F - movs r1, 0x3 - strb r1, [r0] -_080793F8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80793C4 - - thumb_func_start sub_8079408 -sub_8079408: @ 8079408 - push {r4-r6,lr} - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0807947C - movs r0, 0x5 - bl audio_play - movs r0, 0 - bl rbox_fill_rectangle - movs r0, 0x1 - bl rbox_fill_rectangle - movs r6, 0 - movs r5, 0xE0 - lsls r5, 20 -_0807942E: - lsrs r4, r5, 24 - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0 - bl rbox_fill_rectangle - movs r0, 0x80 - lsls r0, 17 - adds r5, r0 - adds r6, 0x1 - cmp r6, 0x3 - ble _0807942E - movs r0, 0 - bl sub_8079F88 - movs r0, 0x1 - bl sub_8079F88 - ldr r2, =0x0203229c - ldr r0, [r2] - adds r0, 0x6F - movs r1, 0 - strb r1, [r0] - ldr r3, =0x02020630 - ldr r0, [r2] - adds r0, 0x34 - ldrb r1, [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] -_0807947C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079408 - - thumb_func_start sub_8079490 -sub_8079490: @ 8079490 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080794C4 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _080794B4 - bl sub_800ADF8 - b _080794BA - .pool -_080794B4: - movs r0, 0xC - bl sub_800ABF4 -_080794BA: - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0xC - strb r1, [r0] -_080794C4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079490 - - thumb_func_start sub_80794CC -sub_80794CC: @ 80794CC - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08079518 - bl sub_80771BC - cmp r0, 0 - beq _0807953A - bl sub_807A09C - cmp r0, 0 - bne _0807953A - ldr r0, =0x02032184 - ldr r0, [r0] - bl Free - ldr r0, =0x0203229c - ldr r0, [r0] - bl Free - bl FreeAllWindowBuffers - bl sub_800E084 - ldr r0, =c2_8056854 - bl SetMainCallback2 - b _0807953A - .pool -_08079518: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0807953A - ldr r0, =0x02032184 - ldr r0, [r0] - bl Free - ldr r0, =0x0203229c - ldr r0, [r0] - bl Free - bl FreeAllWindowBuffers - ldr r0, =c2_8056854 - bl SetMainCallback2 -_0807953A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80794CC - - thumb_func_start sub_8079550 -sub_8079550: @ 8079550 - push {lr} - movs r0, 0 - bl sub_801048C - lsls r0, 24 - cmp r0, 0 - bne _08079574 - bl sub_807A09C - cmp r0, 0 - bne _08079574 - bl sub_800ADF8 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0xD - strb r1, [r0] -_08079574: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079550 - - thumb_func_start sub_807957C -sub_807957C: @ 807957C - push {lr} - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0807959C - ldr r0, =0x0000bbcc - movs r1, 0 - bl sub_8078C10 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - movs r1, 0x64 - strb r1, [r0] -_0807959C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_807957C - - thumb_func_start sub_80795AC -sub_80795AC: @ 80795AC - push {lr} - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x6F - ldrb r0, [r0] - cmp r0, 0x11 - bhi _08079678 - lsls r0, 2 - ldr r1, =_080795CC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080795CC: - .4byte _08079614 - .4byte _0807961A - .4byte _08079620 - .4byte _08079626 - .4byte _0807962C - .4byte _08079678 - .4byte _08079632 - .4byte _08079638 - .4byte _0807963E - .4byte _08079644 - .4byte _0807964A - .4byte _08079650 - .4byte _08079656 - .4byte _0807965C - .4byte _08079662 - .4byte _08079668 - .4byte _0807966E - .4byte _08079674 -_08079614: - bl sub_8078DBC - b _08079678 -_0807961A: - bl sub_8078F50 - b _08079678 -_08079620: - bl sub_807905C - b _08079678 -_08079626: - bl sub_8079218 - b _08079678 -_0807962C: - bl sub_80792E4 - b _08079678 -_08079632: - bl sub_807935C - b _08079678 -_08079638: - bl sub_8079398 - b _08079678 -_0807963E: - bl sub_8079408 - b _08079678 -_08079644: - bl sub_8078130 - b _08079678 -_0807964A: - bl sub_807816C - b _08079678 -_08079650: - bl sub_8079490 - b _08079678 -_08079656: - bl sub_80794CC - b _08079678 -_0807965C: - bl sub_80781C8 - b _08079678 -_08079662: - bl sub_80793C4 - b _08079678 -_08079668: - bl sub_8079034 - b _08079678 -_0807966E: - bl sub_8079550 - b _08079678 -_08079674: - bl sub_807957C -_08079678: - pop {r0} - bx r0 - thumb_func_end sub_80795AC - - thumb_func_start sub_807967C -sub_807967C: @ 807967C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - movs r1, 0x6 - bl __udivsi3 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r3, =0x0203229c - ldr r0, [r3] - adds r0, 0x74 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0 - bne _080796A8 - movs r0, 0x1 - strb r0, [r1] - ldr r0, [r3] - adds r0, 0x76 - adds r0, r2 - strb r4, [r0] -_080796A8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807967C - - thumb_func_start sub_80796B4 -sub_80796B4: @ 80796B4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x68 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x0203229c - ldr r4, [r0] - adds r0, r4, 0 - adds r0, 0x76 - adds r0, r7 - ldrb r0, [r0] - movs r1, 0x1 - str r1, [sp, 0x60] - cmp r0, 0x5 - bhi _080796DC - movs r2, 0 - str r2, [sp, 0x60] -_080796DC: - movs r1, 0x6 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - movs r0, 0 - mov r8, r0 - adds r0, r4, 0 - adds r0, 0x74 - adds r3, r0, r7 - ldrb r0, [r3] - cmp r0, 0x2 - bne _080796FA - b _08079884 -_080796FA: - cmp r0, 0x2 - bgt _08079708 - cmp r0, 0x1 - beq _08079716 - b _08079A24 - .pool -_08079708: - cmp r0, 0x3 - bne _0807970E - b _080798BC -_0807970E: - cmp r0, 0x4 - bne _08079714 - b _080799EC -_08079714: - b _08079A24 -_08079716: - movs r5, 0 - adds r0, r4, 0 - adds r0, 0x36 - adds r0, r7 - ldr r1, [sp, 0x60] - lsls r1, 1 - mov r9, r1 - lsls r6, r7, 1 - lsls r2, r7, 4 - str r2, [sp, 0x64] - ldrb r0, [r0] - cmp r8, r0 - bcs _0807976A - ldr r0, =0x02020630 - mov r8, r0 - ldr r4, =0x0203229c - ldr r0, [sp, 0x60] - add r0, r9 - lsls r2, r0, 1 - movs r3, 0x4 -_0807973E: - ldr r0, [r4] - adds r1, r5, r2 - adds r0, 0x28 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r4] - adds r0, 0x36 - adds r0, r7 - ldrb r0, [r0] - cmp r5, r0 - bcc _0807973E -_0807976A: - movs r5, 0 - adds r0, r6, r7 - lsls r0, 1 - adds r4, r0, 0x2 -_08079772: - lsls r0, r5, 24 - asrs r0, 24 - adds r0, r4 - lsls r0, 24 - lsrs r0, 24 - bl ClearWindowTilemap - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _08079772 - ldr r1, =0x02020630 - mov r8, r1 - ldr r2, =0x0203229c - ldr r0, [r2] - ldr r6, [sp, 0x60] - add r6, r9 - lsls r3, r6, 1 - add r10, r3 - adds r0, 0x28 - add r0, r10 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldr r0, =0x0203229c - ldr r4, [r0] - adds r4, 0x28 - add r4, r10 - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - movs r1, 0x14 - strh r1, [r0, 0x2E] - ldrb r0, [r4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r8 - ldr r5, =gUnknown_0832DE24 - lsls r6, 2 - adds r0, r6, r5 - ldrb r0, [r0] - adds r3, 0x1 - lsls r3, 1 - adds r3, r5 - ldrb r1, [r3] - adds r0, r1 - asrs r0, 1 - lsls r0, 3 - adds r0, 0xE - strh r0, [r2, 0x32] - ldrb r0, [r4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r8 - adds r5, 0x1 - adds r6, r5 - ldrb r0, [r6] - lsls r0, 3 - subs r0, 0xC - strh r0, [r1, 0x36] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldr r1, =sub_80D3014 - bl oamt_set_x3A_32 - ldr r2, =0x0203229c - ldr r1, [r2] - adds r1, 0x74 - adds r1, r7 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r2] - adds r0, 0x28 - add r0, r10 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - bl sub_80A6DEC - ldr r1, =gUnknown_0832C8BE - ldr r0, [sp, 0x64] - subs r2, r0, r7 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0xF - str r0, [sp] - movs r0, 0x11 - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r3, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r1, [sp, 0x60] - cmp r1, 0 - beq _08079868 - b _08079A24 -_08079868: - bl sub_8079F74 - b _08079A24 - .pool -_08079884: - ldr r2, =0x02020630 - ldr r1, [sp, 0x60] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - add r0, r10 - adds r1, r4, 0 - adds r1, 0x28 - adds r1, r0 - ldrb r1, [r1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =sub_80D3014 - cmp r1, r0 - beq _080798AC - b _08079A24 -_080798AC: - movs r0, 0x3 - strb r0, [r3] - b _08079A24 - .pool -_080798BC: - ldr r1, =gUnknown_0832C6C0 - ldr r0, [sp, 0x60] - lsls r2, r0, 4 - subs r2, r0 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0xF - str r0, [sp] - movs r0, 0x11 - str r0, [sp, 0x4] - mov r0, r8 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r3, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - ldr r6, =0x02020630 - ldr r1, =0x0203229c - ldr r4, [r1] - ldr r2, [sp, 0x60] - lsls r3, r2, 1 - adds r3, r2 - lsls r1, r3, 1 - mov r2, r10 - adds r0, r2, r1 - adds r4, 0x28 - adds r4, r0 - ldrb r0, [r4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r6 - ldr r5, =gUnknown_0832DE24 - lsls r3, 2 - adds r0, r3, r5 - ldrb r0, [r0] - adds r1, 0x1 - lsls r1, 1 - adds r1, r5 - ldrb r1, [r1] - adds r0, r1 - asrs r0, 1 - lsls r0, 3 - adds r0, 0xE - strh r0, [r2, 0x20] - ldrb r0, [r4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - adds r5, 0x1 - adds r3, r5 - ldrb r0, [r3] - lsls r0, 3 - subs r0, 0xC - strh r0, [r1, 0x22] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r1, r8 - strh r1, [r0, 0x24] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r2, r8 - strh r2, [r0, 0x26] - add r0, sp, 0x14 - ldr r1, [sp, 0x60] - mov r2, r10 - bl sub_8079A3C - lsls r4, r7, 1 - adds r5, r4, 0 - adds r5, 0xE - lsls r5, 24 - lsrs r5, 24 - lsls r0, 24 - asrs r0, 24 - movs r2, 0x50 - subs r2, r0 - lsrs r0, r2, 31 - adds r2, r0 - asrs r2, 1 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_0832DEE0 - mov r8, r0 - str r0, [sp] - movs r1, 0 - str r1, [sp, 0x4] - add r0, sp, 0x14 - str r0, [sp, 0x8] - adds r0, r5, 0 - movs r3, 0x4 - bl box_print - add r6, sp, 0x28 - adds r0, r6, 0 - ldr r1, [sp, 0x60] - mov r2, r10 - bl sub_8079AA4 - adds r4, 0xF - lsls r4, 24 - lsrs r4, 24 - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - mov r2, r8 - str r2, [sp, 0x8] - str r1, [sp, 0xC] - str r6, [sp, 0x10] - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - movs r3, 0 - bl AddTextPrinterParametrized2 - adds r0, r5, 0 - bl PutWindowTilemap - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =0x0203229c - ldr r1, [r0] - b _08079A1A - .pool -_080799EC: - ldr r0, =gUnknown_0832DF99 - lsls r1, r7, 1 - adds r4, r1, r0 - ldrb r2, [r4] - adds r2, 0x4 - lsls r2, 24 - lsrs r2, 24 - adds r0, 0x1 - adds r1, r0 - ldrb r3, [r1] - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldrb r0, [r4] - str r0, [sp] - ldrb r0, [r1] - str r0, [sp, 0x4] - adds r0, r7, 0 - mov r1, r10 - bl sub_8079C4C - ldr r2, =0x0203229c - ldr r1, [r2] -_08079A1A: - adds r1, 0x74 - adds r1, r7 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_08079A24: - add sp, 0x68 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80796B4 - - thumb_func_start sub_8079A3C -sub_8079A3C: @ 8079A3C - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - lsls r1, 24 - lsls r2, 24 - lsrs r2, 24 - cmp r1, 0 - bne _08079A64 - movs r0, 0x64 - muls r0, r2 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - b _08079A74 - .pool -_08079A64: - movs r0, 0x64 - muls r0, r2 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr -_08079A74: - adds r0, r4, 0 - mov r1, sp - bl CopyString_Limit10 - movs r0, 0 - movs r1, 0x2 - bl GetFontAttribute - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0 - adds r1, r4, 0 - bl GetStringWidth - lsls r0, 24 - lsrs r0, 24 - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8079A3C - - thumb_func_start sub_8079AA4 -sub_8079AA4: @ 8079AA4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - adds r6, r0, 0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =0x0203229c - ldr r1, [r0] - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 1 - adds r0, r2, r0 - adds r1, 0x51 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - bne _08079B5C - movs r4, 0 - movs r0, 0x64 - adds r5, r2, 0 - muls r5, r0 - ldr r0, =0x020244ec - mov r9, r0 - ldr r2, =0x02024744 - mov r8, r2 -_08079ADE: - cmp r7, 0 - bne _08079AF8 - adds r1, r4, 0 - adds r1, 0xD - mov r2, r9 - b _08079AFE - .pool -_08079AF8: - adds r1, r4, 0 - adds r1, 0xD - mov r2, r8 -_08079AFE: - adds r0, r5, r2 - movs r2, 0 - bl pokemon_getattr - lsls r1, r4, 1 - add r1, sp - strh r0, [r1] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x3 - bls _08079ADE - ldr r1, =gUnknown_0832DABC - adds r0, r6, 0 - bl CopyString - movs r4, 0 -_08079B20: - lsls r0, r4, 1 - mov r2, sp - adds r1, r2, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _08079B3C - adds r1, r0, 0 - movs r0, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - adds r0, r6, 0 - bl AppendString -_08079B3C: - adds r0, r6, 0 - ldr r1, =gUnknown_0832DAD2 - bl AppendString - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x3 - bls _08079B20 - b _08079B6C - .pool -_08079B5C: - ldr r1, =gUnknown_0832DABC - adds r0, r6, 0 - bl CopyString - ldr r1, =gUnknown_0832DADF - adds r0, r6, 0 - bl AppendString -_08079B6C: - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079AA4 - - thumb_func_start sub_8079B84 -sub_8079B84: @ 8079B84 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r1, 0 - adds r5, r2, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 1 - adds r1, 0x2 - lsls r4, 24 - asrs r4, 24 - adds r4, r1 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - adds r1, r5, 0 - movs r2, 0x40 - bl GetStringCenterAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_0832DEE0 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r5, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0 - movs r3, 0x4 - bl box_print - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079B84 - - thumb_func_start sub_8079BE0 -sub_8079BE0: @ 8079BE0 - push {r4-r7,lr} - sub sp, 0x34 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r7, =0x02024744 - cmp r6, 0 - bne _08079BF0 - ldr r7, =0x020244ec -_08079BF0: - movs r4, 0 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x36 - adds r0, r6 - ldrb r0, [r0] - cmp r4, r0 - bcs _08079C36 - add r5, sp, 0x14 -_08079C02: - movs r0, 0x64 - muls r0, r4 - adds r0, r7, r0 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - adds r0, r5, 0 - mov r1, sp - bl CopyString_Limit10 - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_8079B84 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x36 - adds r0, r6 - ldrb r0, [r0] - cmp r4, r0 - bcc _08079C02 -_08079C36: - add sp, 0x34 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079BE0 - - thumb_func_start sub_8079C4C -sub_8079C4C: @ 8079C4C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - ldr r4, [sp, 0x3C] - ldr r5, [sp, 0x40] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r3, 24 - mov r10, r3 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =gUnknown_08DDD704 - movs r0, 0x6 - str r0, [sp] - movs r0, 0x3 - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - movs r0, 0x1 - adds r2, r4, 0 - adds r3, r5, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - mov r0, r8 - cmp r0, 0 - bne _08079CB0 - movs r0, 0x64 - muls r0, r7 - ldr r1, =0x020244ec - b _08079CB6 - .pool -_08079CB0: - movs r0, 0x64 - muls r0, r7 - ldr r1, =0x02024744 -_08079CB6: - adds r0, r1 - movs r1, 0x38 - movs r2, 0 - bl pokemon_getattr - lsls r0, 24 - lsrs r6, r0, 24 - ldr r4, =0x0203229c - ldr r5, [r4] - mov r1, r8 - lsls r2, r1, 1 - adds r1, r2, r1 - lsls r1, 1 - adds r1, r7, r1 - adds r0, r5, 0 - adds r0, 0x51 - adds r0, r1 - ldrb r0, [r0] - str r2, [sp, 0x18] - cmp r0, 0 - bne _08079D34 - adds r0, r6, 0 - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r2, r0, 24 - mov r0, r10 - lsls r3, r0, 5 - cmp r2, 0 - beq _08079D08 - mov r1, r9 - adds r0, r1, r3 - lsls r0, 1 - movs r1, 0x8F - lsls r1, 4 - adds r5, r1 - adds r1, r5, r0 - adds r0, r2, 0 - adds r0, 0x60 - strh r0, [r1] -_08079D08: - ldr r4, [r4] - mov r1, r9 - adds r0, r1, r3 - adds r0, 0x1 - lsls r0, 1 - movs r3, 0x8F - lsls r3, 4 - adds r4, r3 - adds r4, r0 - adds r0, r6, 0 - movs r1, 0xA - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x70 - strh r0, [r4] - b _08079D72 - .pool -_08079D34: - mov r1, r10 - lsls r0, r1, 5 - mov r1, r9 - adds r3, r1, r0 - adds r1, r3, 0 - subs r1, 0x20 - lsls r1, 1 - movs r0, 0x8F - lsls r0, 4 - adds r2, r5, r0 - adds r1, r2, r1 - adds r0, r3, 0 - subs r0, 0x21 - lsls r0, 1 - adds r0, r2, r0 - ldrh r0, [r0] - strh r0, [r1] - adds r1, r3, 0 - subs r1, 0x1F - lsls r1, 1 - adds r1, r2, r1 - adds r0, r3, 0 - subs r0, 0x24 - lsls r0, 1 - adds r2, r0 - ldrh r2, [r2] - movs r3, 0x80 - lsls r3, 3 - adds r0, r3, 0 - orrs r0, r2 - strh r0, [r1] -_08079D72: - ldr r0, =0x0203229c - ldr r1, [r0] - ldr r0, [sp, 0x18] - add r0, r8 - lsls r0, 1 - adds r0, r7, r0 - adds r1, 0x51 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _08079D94 - movs r2, 0x90 - lsls r2, 3 - b _08079E16 - .pool -_08079D94: - mov r0, r8 - cmp r0, 0 - bne _08079DC0 - movs r0, 0x64 - adds r4, r7, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - bl pokemon_get_gender - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - movs r1, 0x2 - add r2, sp, 0xC - bl pokemon_getattr - b _08079DDE - .pool -_08079DC0: - movs r0, 0x64 - adds r4, r7, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - bl pokemon_get_gender - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - movs r1, 0x2 - add r2, sp, 0xC - bl pokemon_getattr -_08079DDE: - cmp r5, 0 - beq _08079DF0 - cmp r5, 0xFE - beq _08079E04 - movs r2, 0x83 - b _08079E16 - .pool -_08079DF0: - add r0, sp, 0xC - movs r1, 0 - bl sub_8070ECC - lsls r0, 24 - movs r2, 0x83 - cmp r0, 0 - bne _08079E16 - movs r2, 0x84 - b _08079E16 -_08079E04: - add r0, sp, 0xC - movs r1, 0xFE - bl sub_8070ECC - lsls r0, 24 - movs r2, 0x83 - cmp r0, 0 - bne _08079E16 - movs r2, 0x85 -_08079E16: - ldr r0, =0x0203229c - ldr r1, [r0] - mov r0, r10 - subs r0, 0x1 - lsls r0, 5 - add r0, r9 - adds r0, 0x1 - lsls r0, 1 - movs r3, 0x8F - lsls r3, 4 - adds r1, r3 - adds r1, r0 - strh r2, [r1] - 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_8079C4C - - thumb_func_start sub_8079E44 -sub_8079E44: @ 8079E44 - push {r4-r7,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r6, r0, 24 - movs r7, 0 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x36 - adds r0, r6 - ldrb r0, [r0] - cmp r7, r0 - bge _08079E94 - lsls r0, r6, 1 - adds r0, r6 - ldr r1, =gUnknown_0832DE3E - lsls r0, 2 - adds r5, r0, r1 - ldr r1, =gUnknown_0832DE56 - adds r4, r0, r1 -_08079E6A: - lsls r1, r7, 24 - lsrs r1, 24 - ldrb r2, [r5] - ldrb r3, [r5, 0x1] - ldrb r0, [r4] - str r0, [sp] - ldrb r0, [r4, 0x1] - str r0, [sp, 0x4] - adds r0, r6, 0 - bl sub_8079C4C - adds r5, 0x2 - adds r4, 0x2 - adds r7, 0x1 - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x36 - adds r0, r6 - ldrb r0, [r0] - cmp r7, r0 - blt _08079E6A -_08079E94: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079E44 - - thumb_func_start sub_8079EA8 -sub_8079EA8: @ 8079EA8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r12, r0 - movs r7, 0 - ldr r3, =0x0203229c - ldr r0, [r3] - adds r0, 0x36 - add r0, r12 - ldrb r0, [r0] - cmp r7, r0 - bge _08079F5A - ldr r6, =0x02020630 - mov r9, r3 - mov r1, r12 - lsls r0, r1, 1 - add r0, r12 - lsls r2, r0, 1 - mov r10, r2 - ldr r1, =gUnknown_0832DE24 - movs r2, 0 - mov r8, r2 - lsls r0, 2 - adds r5, r0, r1 -_08079EE0: - mov r1, r9 - ldr r0, [r1] - mov r2, r10 - adds r4, r7, r2 - adds r0, 0x28 - adds r0, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - adds r1, 0x3E - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - mov r0, r9 - ldr r3, [r0] - adds r2, r3, 0 - adds r2, 0x28 - adds r2, r4 - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r5] - lsls r0, 3 - adds r0, 0xE - strh r0, [r1, 0x20] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r5, 0x1] - lsls r0, 3 - subs r0, 0xC - strh r0, [r1, 0x22] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r1, r8 - strh r1, [r0, 0x24] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r2, r8 - strh r2, [r0, 0x26] - adds r5, 0x2 - adds r7, 0x1 - adds r3, 0x36 - add r3, r12 - ldrb r3, [r3] - cmp r7, r3 - blt _08079EE0 -_08079F5A: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079EA8 - - thumb_func_start sub_8079F74 -sub_8079F74: @ 8079F74 - push {lr} - movs r0, 0x1 - bl rbox_fill_rectangle - movs r0, 0x1 - bl sub_8079BE0 - pop {r0} - bx r0 - thumb_func_end sub_8079F74 - - thumb_func_start sub_8079F88 -sub_8079F88: @ 8079F88 - push {r4-r6,lr} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gUnknown_0832C8BE - lsls r2, r4, 4 - subs r2, r4 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0xF - str r0, [sp] - movs r0, 0x11 - str r0, [sp, 0x4] - movs r6, 0 - str r6, [sp, 0x8] - movs r0, 0x1 - movs r3, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - adds r0, r4, 0 - bl sub_8079E44 - adds r0, r4, 0 - bl sub_8079BE0 - adds r0, r4, 0 - bl sub_8079EA8 - ldr r0, =gUnknown_0832DE94 - ldr r0, [r0, 0x4] - ldr r5, =0x0203229c - ldr r1, [r5] - adds r1, 0x72 - ldrh r1, [r1] - lsls r1, 5 - ldr r2, =0x06010000 - adds r1, r2 - movs r2, 0x18 - bl sub_807A308 - ldr r0, [r5] - adds r0, 0x74 - adds r0, r4 - strb r6, [r0] - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8079F88 - - thumb_func_start sub_807A000 -sub_807A000: @ 807A000 - push {lr} - sub sp, 0x8 - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0x8 - pop {r0} - bx r0 - thumb_func_end sub_807A000 - - thumb_func_start sub_807A024 -sub_807A024: @ 807A024 - push {lr} - sub sp, 0x8 - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0x8 - pop {r0} - bx r0 - thumb_func_end sub_807A024 - - thumb_func_start sub_807A048 -sub_807A048: @ 807A048 - push {r4-r7,lr} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 24 - lsrs r6, r1, 24 - movs r3, 0 - ldr r4, =0x0203229c - mov r12, r4 - movs r7, 0x8D - lsls r7, 4 -_0807A05C: - mov r1, r12 - ldr r0, [r1] - lsls r1, r3, 3 - adds r2, r0, r1 - adds r0, r2, r7 - ldrb r0, [r0] - cmp r0, 0 - bne _0807A090 - ldr r3, =0x000008d2 - adds r0, r2, r3 - strh r5, [r0] - adds r3, 0x2 - adds r0, r2, r3 - strb r6, [r0] - ldr r0, [r4] - adds r0, r1 - movs r1, 0x8D - lsls r1, 4 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - b _0807A096 - .pool -_0807A090: - adds r3, 0x1 - cmp r3, 0x3 - ble _0807A05C -_0807A096: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_807A048 - - thumb_func_start sub_807A09C -sub_807A09C: @ 807A09C - push {lr} - movs r3, 0 - ldr r0, =0x0203229c - ldr r0, [r0] - movs r2, 0x8D - lsls r2, 4 - adds r1, r0, r2 - movs r2, 0x3 -_0807A0AC: - ldrb r0, [r1] - adds r3, r0 - adds r1, 0x8 - subs r2, 0x1 - cmp r2, 0 - bge _0807A0AC - adds r0, r3, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_807A09C - - thumb_func_start sub_807A0C4 -sub_807A0C4: @ 807A0C4 - push {r4,r5,lr} - movs r4, 0 - ldr r3, =0x0203229c -_0807A0CA: - ldr r0, [r3] - lsls r1, r4, 3 - adds r2, r0, r1 - movs r5, 0x8D - lsls r5, 4 - adds r0, r2, r5 - ldrb r0, [r0] - adds r5, r1, 0 - cmp r0, 0 - beq _0807A18C - ldr r0, =0x000008d2 - adds r1, r2, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _0807A0F8 - subs r0, 0x1 - strh r0, [r1] - b _0807A18C - .pool -_0807A0F8: - ldr r1, =0x000008d4 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x8 - bhi _0807A17A - lsls r0, 2 - ldr r1, =_0807A114 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807A114: - .4byte _0807A138 - .4byte _0807A14C - .4byte _0807A154 - .4byte _0807A15C - .4byte _0807A15C - .4byte _0807A15C - .4byte _0807A164 - .4byte _0807A16C - .4byte _0807A174 -_0807A138: - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0x80 - movs r1, 0x14 - bl sub_8077170 - b _0807A17A - .pool -_0807A14C: - movs r0, 0 - bl sub_807A19C - b _0807A17A -_0807A154: - movs r0, 0x2 - bl sub_807A19C - b _0807A17A -_0807A15C: - movs r0, 0x3 - bl sub_807A19C - b _0807A17A -_0807A164: - movs r0, 0x6 - bl sub_807A19C - b _0807A17A -_0807A16C: - movs r0, 0x7 - bl sub_807A19C - b _0807A17A -_0807A174: - movs r0, 0x8 - bl sub_807A19C -_0807A17A: - ldr r0, =0x0203229c - ldr r1, [r0] - adds r1, r5 - movs r2, 0x8D - lsls r2, 4 - adds r1, r2 - movs r2, 0 - strb r2, [r1] - adds r3, r0, 0 -_0807A18C: - adds r4, 0x1 - cmp r4, 0x3 - ble _0807A0CA - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807A0C4 - - thumb_func_start sub_807A19C -sub_807A19C: @ 807A19C - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_0832DEBC - lsls r4, 2 - adds r4, r0 - ldr r2, [r4] - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0 - movs r1, 0x14 - movs r2, 0xC - bl sub_8098858 - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807A19C - - thumb_func_start sub_807A1F0 -sub_807A1F0: @ 807A1F0 - push {r4,lr} - sub sp, 0x8 - ldr r0, =0x0203229c - ldr r1, [r0] - adds r3, r1, 0 - adds r3, 0xA8 - ldrb r1, [r3] - adds r4, r0, 0 - cmp r1, 0xD - bhi _0807A22C - ldr r1, =0x02032188 - ldrb r0, [r3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [sp] - ldr r0, =0xffff0000 - ldr r2, [sp, 0x4] - ands r2, r0 - movs r0, 0x80 - lsls r0, 1 - orrs r2, r0 - str r2, [sp, 0x4] - ldrb r1, [r3] - adds r1, 0xC8 - lsls r1, 16 - ldr r0, =0x0000ffff - ands r0, r2 - orrs r0, r1 - str r0, [sp, 0x4] -_0807A22C: - ldr r0, [r4] - adds r0, 0xA8 - ldrb r0, [r0] - cmp r0, 0x11 - bhi _0807A2FC - lsls r0, 2 - ldr r1, =_0807A254 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807A254: - .4byte _0807A29C - .4byte _0807A29C - .4byte _0807A29C - .4byte _0807A29C - .4byte _0807A29C - .4byte _0807A29C - .4byte _0807A29C - .4byte _0807A29C - .4byte _0807A2A0 - .4byte _0807A2B8 - .4byte _0807A2B8 - .4byte _0807A2B8 - .4byte _0807A2B8 - .4byte _0807A2B8 - .4byte _0807A2BC - .4byte _0807A2C8 - .4byte _0807A2D4 - .4byte _0807A2F0 -_0807A29C: - mov r0, sp - b _0807A2D6 -_0807A2A0: - mov r0, sp - bl LoadObjectPic - ldr r1, =0x0203229c - ldr r1, [r1] - adds r2, r1, 0 - adds r2, 0x72 - strh r0, [r2] - b _0807A2DE - .pool -_0807A2B8: - mov r0, sp - b _0807A2D6 -_0807A2BC: - ldr r0, =gUnknown_0832DCE4 - bl LoadTaggedObjectPalette - b _0807A2DA - .pool -_0807A2C8: - ldr r0, =gUnknown_0832DC44 - bl LoadTaggedObjectPalette - b _0807A2DA - .pool -_0807A2D4: - ldr r0, =gUnknown_0832DC3C -_0807A2D6: - bl LoadObjectPic -_0807A2DA: - ldr r0, =0x0203229c - ldr r1, [r0] -_0807A2DE: - adds r1, 0xA8 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0807A2FC - .pool -_0807A2F0: - ldr r0, [r4] - adds r0, 0xA8 - movs r1, 0 - strb r1, [r0] - movs r0, 0x1 - b _0807A2FE -_0807A2FC: - movs r0, 0 -_0807A2FE: - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_807A1F0 - - thumb_func_start sub_807A308 -sub_807A308: @ 807A308 - push {lr} - sub sp, 0x4 - movs r2, 0x6 - str r2, [sp] - movs r2, 0 - movs r3, 0 - bl sub_80C6D80 - add sp, 0x4 - pop {r0} - bx r0 - thumb_func_end sub_807A308 - - thumb_func_start sub_807A320 -sub_807A320: @ 807A320 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0 - beq _0807A338 - cmp r0, 0x1 - beq _0807A3CC - b _0807A458 -_0807A338: - movs r7, 0 - ldr r1, =0x0203229c - ldr r0, [r1] - adds r0, 0x36 - ldrb r0, [r0] - cmp r7, r0 - blt _0807A348 - b _0807A458 -_0807A348: - adds r6, r1, 0 - movs r5, 0 - mov r9, r5 -_0807A34E: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - adds r1, r0, 0 - cmp r1, 0x1 - bne _0807A380 - ldr r0, [r6] - adds r0, 0x45 - adds r0, r5 - mov r2, r9 - strb r2, [r0] - ldr r0, [r6] - adds r0, 0x51 - adds r0, r5 - b _0807A3B0 - .pool -_0807A380: - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - adds r1, r0, 0 - cmp r1, 0 - bne _0807A39E - ldr r0, [r6] - adds r0, 0x45 - adds r0, r5 - strb r1, [r0] - ldr r0, [r6] - adds r0, 0x51 - adds r0, r5 - b _0807A3B0 -_0807A39E: - ldr r0, [r6] - adds r0, 0x45 - adds r0, r5 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r6] - adds r0, 0x51 - adds r0, r5 - mov r1, r9 -_0807A3B0: - strb r1, [r0] - ldr r0, =0x0203229c - adds r5, 0x1 - adds r7, 0x1 - ldr r0, [r0] - adds r0, 0x36 - add r0, r8 - ldrb r0, [r0] - cmp r7, r0 - blt _0807A34E - b _0807A458 - .pool -_0807A3CC: - movs r7, 0 - ldr r1, =0x0203229c - ldr r0, [r1] - adds r0, 0x37 - ldrb r0, [r0] - cmp r7, r0 - bge _0807A458 - adds r6, r1, 0 - movs r5, 0x6 - movs r2, 0 - mov r9, r2 -_0807A3E2: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =0x02024744 - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - adds r1, r0, 0 - cmp r1, 0x1 - bne _0807A414 - ldr r0, [r6] - adds r0, 0x45 - adds r0, r5 - mov r2, r9 - strb r2, [r0] - ldr r0, [r6] - adds r0, 0x51 - adds r0, r5 - b _0807A444 - .pool -_0807A414: - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - adds r1, r0, 0 - cmp r1, 0 - bne _0807A432 - ldr r0, [r6] - adds r0, 0x45 - adds r0, r5 - strb r1, [r0] - ldr r0, [r6] - adds r0, 0x51 - adds r0, r5 - b _0807A444 -_0807A432: - ldr r0, [r6] - adds r0, 0x45 - adds r0, r5 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r6] - adds r0, 0x51 - adds r0, r5 - mov r1, r9 -_0807A444: - strb r1, [r0] - ldr r0, =0x0203229c - adds r5, 0x1 - adds r7, 0x1 - ldr r0, [r0] - adds r0, 0x36 - add r0, r8 - ldrb r0, [r0] - cmp r7, r0 - blt _0807A3E2 -_0807A458: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807A320 - - thumb_func_start sub_807A468 -sub_807A468: @ 807A468 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _0807A478 - cmp r0, 0x1 - beq _0807A4D8 - b _0807A52C -_0807A478: - movs r6, 0 - ldr r1, =0x0203229c - ldr r0, [r1] - adds r0, 0x36 - ldrb r0, [r0] - cmp r6, r0 - bcs _0807A52C - adds r7, r1, 0 -_0807A488: - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0x3A - bl pokemon_getattr - adds r1, r0, 0 - lsls r0, r5, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl sub_8075060 - ldr r1, [r7] - adds r1, 0x5D - adds r1, r6 - strb r0, [r1] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, [r7] - adds r0, 0x36 - ldrb r0, [r0] - cmp r6, r0 - bcc _0807A488 - b _0807A52C - .pool -_0807A4D8: - movs r6, 0 - ldr r1, =0x0203229c - ldr r0, [r1] - adds r0, 0x37 - ldrb r0, [r0] - cmp r6, r0 - bcs _0807A52C - adds r7, r1, 0 -_0807A4E8: - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0x3A - bl pokemon_getattr - adds r1, r0, 0 - lsls r0, r5, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl sub_8075060 - ldr r1, [r7] - adds r1, 0x63 - adds r1, r6 - strb r0, [r1] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, [r7] - adds r0, 0x37 - ldrb r0, [r0] - cmp r6, r0 - bcc _0807A4E8 -_0807A52C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807A468 - - thumb_func_start sub_807A53C -sub_807A53C: @ 807A53C - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r5, 0 -_0807A544: - movs r4, 0 - ldr r2, =0x0203229c - ldr r0, [r2] - adds r0, 0x36 - adds r0, r5 - adds r1, r5, 0x1 - mov r8, r1 - ldrb r0, [r0] - cmp r4, r0 - bge _0807A596 - adds r6, r2, 0 - lsls r0, r5, 1 - adds r0, r5 - lsls r7, r0, 1 -_0807A560: - ldr r2, [r6] - adds r3, r4, r7 - adds r0, r2, 0 - adds r0, 0x28 - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - adds r2, 0x5D - adds r2, r3 - ldrb r2, [r2] - movs r1, 0x4 - subs r1, r2 - lsls r1, 24 - lsrs r1, 24 - bl sub_80D32C8 - adds r4, 0x1 - ldr r0, [r6] - adds r0, 0x36 - adds r0, r5 - ldrb r0, [r0] - cmp r4, r0 - blt _0807A560 -_0807A596: - mov r5, r8 - cmp r5, 0x1 - ble _0807A544 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807A53C - - thumb_func_start sub_807A5B0 -sub_807A5B0: @ 807A5B0 - push {r4,r5,lr} - movs r3, 0 - ldr r5, =0x03005d8c - ldr r4, =0x000031a8 -_0807A5B8: - ldr r0, [r5] - adds r0, r4 - adds r2, r0, r3 - ldrb r0, [r2] - cmp r0, 0 - bne _0807A5DA - ldr r0, =0x0203229c - ldr r0, [r0] - adds r0, 0xA9 - adds r0, r3 - ldrb r0, [r0] - adds r1, r0, 0 - cmp r1, 0 - beq _0807A5DA - cmp r1, 0x3F - bhi _0807A5DA - strb r0, [r2] -_0807A5DA: - adds r3, 0x1 - cmp r3, 0xA - ble _0807A5B8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807A5B0 - - thumb_func_start sub_807A5F4 -sub_807A5F4: @ 807A5F4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x30 - mov r8, r0 - adds r7, r1, 0 - mov r9, r2 - movs r5, 0 - cmp r5, r7 - bge _0807A62E - mov r6, sp -_0807A60C: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - add r4, r8 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - str r0, [r6, 0x18] - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - stm r6!, {r0} - adds r5, 0x1 - cmp r5, r7 - blt _0807A60C -_0807A62E: - bl sub_809D42C - mov r1, r9 - lsls r4, r1, 2 - cmp r0, 0 - bne _0807A65C - add r0, sp, 0x18 - adds r0, r4 - ldr r1, [r0] - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - bne _0807A64C - movs r0, 0x3 - b _0807A718 -_0807A64C: - lsls r0, r1, 16 - lsrs r0, 16 - bl sub_806E3F8 - cmp r0, 0 - bne _0807A65C - movs r0, 0x2 - b _0807A718 -_0807A65C: - bl link_get_multiplayer_id - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r0, =0x020229e8 - adds r1, r0 - ldrb r0, [r1] - subs r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bls _0807A6AC - ldrb r1, [r1, 0x12] - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - bne _0807A6AC - add r0, sp, 0x18 - adds r0, r4 - ldr r1, [r0] - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - bne _0807A6A0 - movs r0, 0x5 - b _0807A718 - .pool -_0807A6A0: - lsls r0, r1, 16 - lsrs r0, 16 - bl sub_806E3F8 - cmp r0, 0 - beq _0807A6D2 -_0807A6AC: - mov r1, sp - adds r0, r1, r4 - ldr r1, [r0] - movs r0, 0xCD - lsls r0, 1 - cmp r1, r0 - beq _0807A6BE - cmp r1, 0x97 - bne _0807A6D6 -_0807A6BE: - movs r0, 0x64 - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - add r0, r8 - movs r1, 0x50 - bl pokemon_getattr - cmp r0, 0 - bne _0807A6D6 -_0807A6D2: - movs r0, 0x4 - b _0807A718 -_0807A6D6: - cmp r7, 0 - ble _0807A6F4 - movs r3, 0xCE - lsls r3, 1 - movs r2, 0 - add r1, sp, 0x18 - adds r5, r7, 0 -_0807A6E4: - ldr r0, [r1] - cmp r0, r3 - bne _0807A6EC - str r2, [r1] -_0807A6EC: - adds r1, 0x4 - subs r5, 0x1 - cmp r5, 0 - bne _0807A6E4 -_0807A6F4: - movs r2, 0 - movs r5, 0 - cmp r2, r7 - bge _0807A70E - add r1, sp, 0x18 -_0807A6FE: - cmp r5, r9 - beq _0807A706 - ldr r0, [r1] - adds r2, r0 -_0807A706: - adds r1, 0x4 - adds r5, 0x1 - cmp r5, r7 - blt _0807A6FE -_0807A70E: - cmp r2, 0 - bne _0807A716 - movs r0, 0x1 - b _0807A718 -_0807A716: - movs r0, 0 -_0807A718: - add sp, 0x30 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_807A5F4 - - thumb_func_start sub_807A728 -sub_807A728: @ 807A728 - push {r4-r7,lr} - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _0807A7B4 - movs r4, 0 - bl link_get_multiplayer_id - ldr r5, =0x020229e8 - movs r7, 0x1 - eors r0, r7 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r1, [r1] - subs r0, r1, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bls _0807A7B4 - subs r0, r1, 0x4 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _0807A762 - movs r4, 0x2 -_0807A762: - cmp r4, 0 - ble _0807A7B4 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r1, [r1, 0x12] - movs r6, 0xF0 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _0807A7B0 - cmp r4, 0x2 - bne _0807A7B4 - bl link_get_multiplayer_id - eors r0, r7 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r1, [r1, 0x12] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _0807A7B4 - movs r0, 0x2 - b _0807A7B6 - .pool -_0807A7B0: - movs r0, 0x1 - b _0807A7B6 -_0807A7B4: - movs r0, 0 -_0807A7B6: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_807A728 - - thumb_func_start sub_807A7BC -sub_807A7BC: @ 807A7BC - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0xCD - lsls r0, 1 - cmp r2, r0 - beq _0807A7D2 - cmp r2, 0x97 - bne _0807A7DA -_0807A7D2: - cmp r1, 0 - bne _0807A7DA - movs r0, 0x1 - b _0807A7DC -_0807A7DA: - movs r0, 0 -_0807A7DC: - pop {r1} - bx r1 - thumb_func_end sub_807A7BC - - thumb_func_start sub_807A7E0 -sub_807A7E0: @ 807A7E0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r4, [sp, 0x20] - ldr r5, [sp, 0x24] - ldr r6, [sp, 0x28] - lsls r2, 16 - lsrs r7, r2, 16 - lsls r3, 16 - lsrs r3, 16 - mov r8, r3 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 24 - lsrs r6, 24 - lsls r2, r0, 23 - lsrs r2, 31 - mov r9, r2 - lsls r0, 24 - lsrs r2, r0, 31 - lsls r0, r1, 23 - lsrs r0, 31 - mov r10, r0 - lsls r0, r1, 24 - lsrs r0, 31 - lsls r1, 18 - lsrs r1, 28 - cmp r1, 0x3 - beq _0807A832 - cmp r2, 0 - bne _0807A82A - movs r0, 0x8 - b _0807A8C0 -_0807A82A: - cmp r0, 0 - bne _0807A832 - movs r0, 0x9 - b _0807A8C0 -_0807A832: - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_807A7BC - cmp r0, 0 - bne _0807A898 - movs r0, 0xCE - lsls r0, 1 - cmp r8, r0 - bne _0807A84E - cmp r7, r8 - beq _0807A86C - movs r0, 0x2 - b _0807A8C0 -_0807A84E: - ldr r0, =gBaseStats - lsls r1, r7, 3 - subs r1, r7 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x6] - cmp r0, r4 - beq _0807A86C - ldrb r0, [r1, 0x7] - cmp r0, r4 - beq _0807A86C - movs r0, 0x1 - b _0807A8C0 - .pool -_0807A86C: - movs r0, 0xCE - lsls r0, 1 - cmp r7, r0 - bne _0807A87C - cmp r7, r8 - beq _0807A87C - movs r0, 0x3 - b _0807A8C0 -_0807A87C: - mov r0, r9 - cmp r0, 0 - bne _0807A8AA - movs r0, 0xCE - lsls r0, 1 - cmp r7, r0 - bne _0807A88E - movs r0, 0x6 - b _0807A8C0 -_0807A88E: - adds r0, r7, 0 - bl sub_806E3F8 - cmp r0, 0 - bne _0807A89C -_0807A898: - movs r0, 0x4 - b _0807A8C0 -_0807A89C: - mov r0, r8 - bl sub_806E3F8 - cmp r0, 0 - bne _0807A8AA - movs r0, 0x5 - b _0807A8C0 -_0807A8AA: - mov r0, r10 - cmp r0, 0 - bne _0807A8BE - adds r0, r7, 0 - bl sub_806E3F8 - cmp r0, 0 - bne _0807A8BE - movs r0, 0x7 - b _0807A8C0 -_0807A8BE: - movs r0, 0 -_0807A8C0: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_807A7E0 - - thumb_func_start sub_807A8D0 -sub_807A8D0: @ 807A8D0 - push {r4-r6,lr} - lsls r1, 16 - lsrs r5, r1, 16 - adds r6, r5, 0 - lsls r2, 16 - lsrs r2, 16 - lsls r3, 24 - lsrs r3, 24 - lsls r0, 23 - lsrs r4, r0, 31 - adds r0, r2, 0 - adds r1, r3, 0 - bl sub_807A7BC - cmp r0, 0 - bne _0807A90A - cmp r4, 0 - bne _0807A90E - movs r0, 0xCE - lsls r0, 1 - cmp r5, r0 - bne _0807A900 - movs r0, 0x2 - b _0807A910 -_0807A900: - adds r0, r6, 0 - bl sub_806E3F8 - cmp r0, 0 - bne _0807A90E -_0807A90A: - movs r0, 0x1 - b _0807A910 -_0807A90E: - movs r0, 0 -_0807A910: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_807A8D0 - - thumb_func_start sub_807A918 -sub_807A918: @ 807A918 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x18 - adds r6, r0, 0 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - movs r5, 0 - ldr r0, =0x020244e9 - ldrb r0, [r0] - cmp r5, r0 - bge _0807A95A - mov r4, sp -_0807A934: - movs r0, 0x64 - muls r0, r5 - adds r0, r6, r0 - movs r1, 0x41 - bl pokemon_getattr - str r0, [r4] - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _0807A94E - movs r0, 0 - str r0, [r4] -_0807A94E: - adds r4, 0x4 - adds r5, 0x1 - ldr r0, =0x020244e9 - ldrb r0, [r0] - cmp r5, r0 - blt _0807A934 -_0807A95A: - movs r7, 0 - movs r6, 0x1 - movs r5, 0 - ldr r4, =0x020229e8 - b _0807A980 - .pool -_0807A96C: - ldrb r0, [r4] - subs r0, 0x4 - cmp r0, 0x1 - bhi _0807A978 - movs r7, 0 - b _0807A97C -_0807A978: - movs r0, 0x1 - orrs r7, r0 -_0807A97C: - adds r4, 0x1C - adds r5, 0x1 -_0807A980: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - blt _0807A96C - movs r5, 0 - movs r4, 0 - b _0807A9B4 -_0807A992: - ldr r0, =0x020229e8 - adds r2, r4, r0 - ldrb r1, [r2, 0x10] - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - bne _0807A9A2 - movs r6, 0 -_0807A9A2: - cmp r7, 0 - beq _0807A9B0 - ldrb r0, [r2, 0x10] - lsrs r0, 4 - cmp r0, 0 - beq _0807A9B0 - movs r6, 0 -_0807A9B0: - adds r4, 0x1C - adds r5, 0x1 -_0807A9B4: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - blt _0807A992 - cmp r6, 0 - bne _0807A9EA - mov r1, r8 - lsls r0, r1, 2 - mov r1, sp - adds r4, r1, r0 - ldrh r0, [r4] - bl sub_806E3F8 - cmp r0, 0 - bne _0807A9E0 - movs r0, 0x2 - b _0807AA1A - .pool -_0807A9E0: - ldr r0, [r4] - cmp r0, 0 - bne _0807A9EA - movs r0, 0x3 - b _0807AA1A -_0807A9EA: - movs r2, 0 - movs r5, 0 - ldr r0, =0x020244e9 - ldrb r0, [r0] - cmp r2, r0 - bge _0807AA0A - adds r3, r0, 0 - mov r1, sp -_0807A9FA: - cmp r8, r5 - beq _0807AA02 - ldr r0, [r1] - adds r2, r0 -_0807AA02: - adds r1, 0x4 - adds r5, 0x1 - cmp r5, r3 - blt _0807A9FA -_0807AA0A: - cmp r2, 0 - beq _0807AA18 - movs r0, 0 - b _0807AA1A - .pool -_0807AA18: - movs r0, 0x1 -_0807AA1A: - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_807A918 - - thumb_func_start sub_807AA28 -sub_807AA28: @ 807AA28 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bne _0807AA44 - movs r0, 0x17 - bl audio_play - movs r0, 0 - strh r0, [r4, 0x2E] -_0807AA44: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_807AA28 - - thumb_func_start sub_807AA4C -sub_807AA4C: @ 807AA4C - push {r4,r5,lr} - adds r4, r0, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0807AA76 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bne _0807AA76 - movs r0, 0xC2 - bl audio_play - strh r5, [r4, 0x2E] -_0807AA76: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_807AA4C - - thumb_func_start sub_807AA7C -sub_807AA7C: @ 807AA7C - push {lr} - adds r2, r0, 0 - movs r0, 0x30 - ldrsh r1, [r2, r0] - cmp r1, 0 - bne _0807AAB2 - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - bne _0807AA98 - strh r1, [r2, 0x2E] -_0807AA98: - movs r1, 0x2E - ldrsh r0, [r2, r1] - lsls r0, 1 - ldr r1, =gUnknown_08338EA4 - adds r0, r1 - ldrb r1, [r2, 0x5] - lsrs r1, 4 - adds r1, 0x10 - lsls r1, 4 - adds r1, 0x4 - movs r2, 0x2 - bl gpu_pal_apply -_0807AAB2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_807AA7C - - thumb_func_start sub_807AABC -sub_807AABC: @ 807AABC - push {lr} - adds r2, r0, 0 - ldrh r1, [r2, 0x2E] - adds r1, 0x1 - strh r1, [r2, 0x2E] - ldrh r0, [r2, 0x26] - adds r0, 0x1 - strh r0, [r2, 0x26] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0xA - bne _0807AADA - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles -_0807AADA: - pop {r0} - bx r0 - thumb_func_end sub_807AABC - - thumb_func_start sub_807AAE0 -sub_807AAE0: @ 807AAE0 - push {lr} - adds r2, r0, 0 - ldrh r1, [r2, 0x2E] - adds r1, 0x1 - strh r1, [r2, 0x2E] - ldrh r0, [r2, 0x26] - subs r0, 0x1 - strh r0, [r2, 0x26] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0xA - bne _0807AAFE - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles -_0807AAFE: - pop {r0} - bx r0 - thumb_func_end sub_807AAE0 - - thumb_func_start sub_807AB04 -sub_807AB04: @ 807AB04 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - bne _0807AB20 - movs r0, 0xCC - bl audio_play - movs r0, 0 - strh r0, [r4, 0x2E] -_0807AB20: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_807AB04 - - thumb_func_start sub_807AB28 -sub_807AB28: @ 807AB28 - push {r4,r5,lr} - sub sp, 0x20 - ldr r0, =0x020322a0 - ldr r0, [r0] - mov r12, r0 - adds r0, 0xD4 - ldrh r1, [r0] - lsls r1, 8 - adds r0, 0x2 - ldrh r2, [r0] - lsls r2, 8 - adds r0, 0x6 - movs r4, 0 - ldrsh r3, [r0, r4] - adds r0, 0x2 - movs r5, 0 - ldrsh r0, [r0, r5] - str r0, [sp] - mov r4, r12 - adds r4, 0xE8 - movs r5, 0 - ldrsh r0, [r4, r5] - str r0, [sp, 0x4] - movs r5, 0 - ldrsh r0, [r4, r5] - str r0, [sp, 0x8] - mov r0, r12 - adds r0, 0xEC - ldrh r0, [r0] - str r0, [sp, 0xC] - add r0, sp, 0x10 - bl sub_806F6C0 - add r0, sp, 0x10 - ldrh r1, [r0] - movs r0, 0x20 - bl SetGpuReg - add r0, sp, 0x10 - ldrh r1, [r0, 0x2] - movs r0, 0x22 - bl SetGpuReg - add r0, sp, 0x10 - ldrh r1, [r0, 0x4] - movs r0, 0x24 - bl SetGpuReg - add r0, sp, 0x10 - ldrh r1, [r0, 0x6] - movs r0, 0x26 - bl SetGpuReg - ldr r1, [sp, 0x18] - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x28 - bl SetGpuReg - ldr r1, [sp, 0x18] - lsrs r1, 16 - movs r0, 0x2A - bl SetGpuReg - ldr r1, [sp, 0x1C] - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x2C - bl SetGpuReg - ldr r1, [sp, 0x1C] - lsrs r1, 16 - movs r0, 0x2E - bl SetGpuReg - add sp, 0x20 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807AB28 - - thumb_func_start sub_807ABCC -sub_807ABCC: @ 807ABCC - push {r4,lr} - ldr r4, =0x020322a0 - ldr r0, [r4] - adds r0, 0xE0 - ldrh r1, [r0] - movs r0, 0x16 - bl SetGpuReg - ldr r0, [r4] - adds r0, 0xE2 - ldrh r1, [r0] - movs r0, 0x14 - bl SetGpuReg - movs r0, 0 - bl GetGpuReg - lsls r0, 16 - movs r1, 0xE0 - lsls r1, 11 - ands r1, r0 - cmp r1, 0 - bne _0807AC18 - ldr r0, [r4] - adds r0, 0xE4 - ldrh r1, [r0] - movs r0, 0x1A - bl SetGpuReg - ldr r0, [r4] - adds r0, 0xE6 - ldrh r1, [r0] - movs r0, 0x18 - bl SetGpuReg - b _0807AC1C - .pool -_0807AC18: - bl sub_807AB28 -_0807AC1C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_807ABCC - - thumb_func_start sub_807AC24 -sub_807AC24: @ 807AC24 - push {lr} - bl sub_807ABCC - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_807AC24 - - thumb_func_start sub_807AC3C -sub_807AC3C: @ 807AC3C - push {r4,lr} - ldr r3, =0x020322a0 - ldr r1, [r3] - movs r0, 0x8A - adds r0, r1 - mov r12, r0 - movs r2, 0 - movs r0, 0 - mov r4, r12 - strh r0, [r4] - adds r1, 0x88 - strb r2, [r1] - ldr r0, [r3] - adds r0, 0x89 - strb r2, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807AC3C - - thumb_func_start sub_807AC64 -sub_807AC64: @ 807AC64 - push {r4,r5,lr} - ldr r0, =0x020322a0 - ldr r2, [r0] - adds r1, r2, 0 - adds r1, 0x88 - adds r3, r2, 0 - adds r3, 0x89 - ldrb r1, [r1] - adds r5, r0, 0 - ldrb r3, [r3] - cmp r1, r3 - bne _0807AC8C - adds r1, r2, 0 - adds r1, 0x8A - ldrh r0, [r1] - adds r0, 0x1 - b _0807AC92 - .pool -_0807AC8C: - adds r1, r2, 0 - adds r1, 0x8A - movs r0, 0 -_0807AC92: - strh r0, [r1] - adds r4, r5, 0 - ldr r0, [r4] - adds r0, 0x8A - ldrh r1, [r0] - movs r0, 0x96 - lsls r0, 1 - cmp r1, r0 - bls _0807ACC4 - bl sub_80097E8 - ldr r0, =c2_800ACD4 - bl SetMainCallback2 - ldr r1, [r4] - adds r3, r1, 0 - adds r3, 0x8A - movs r2, 0 - movs r0, 0 - strh r0, [r3] - adds r1, 0x89 - strb r2, [r1] - ldr r0, [r4] - adds r0, 0x88 - strb r2, [r0] -_0807ACC4: - ldr r0, [r5] - adds r1, r0, 0 - adds r1, 0x88 - ldrb r1, [r1] - adds r0, 0x89 - strb r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807AC64 - - thumb_func_start sub_807ACDC -sub_807ACDC: @ 807ACDC - push {lr} - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0807ACF0 - movs r0, 0 - b _0807ACF8 - .pool -_0807ACF0: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 -_0807ACF8: - pop {r1} - bx r1 - thumb_func_end sub_807ACDC - - thumb_func_start sub_807ACFC -sub_807ACFC: @ 807ACFC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - movs r4, 0 - mov r8, r4 - cmp r6, 0 - bne _0807AD22 - ldr r0, =0x02032298 - ldrb r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r1, r0 - mov r8, r1 - movs r4, 0x1 -_0807AD22: - cmp r6, 0x1 - bne _0807AD40 - ldr r0, =0x02032298 - ldrb r0, [r0, 0x1] - movs r1, 0x6 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - adds r1, r0 - mov r8, r1 - movs r4, 0x3 -_0807AD40: - cmp r5, 0 - beq _0807AD58 - cmp r5, 0x1 - beq _0807ADE0 - b _0807AE36 - .pool -_0807AD58: - mov r0, r8 - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - mov r0, r8 - movs r1, 0 - bl pokemon_getattr - adds r7, r0, 0 - cmp r6, 0 - bne _0807AD94 - lsls r0, r5, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - ldr r1, [r1, 0x8] - adds r2, r5, 0 - adds r3, r7, 0 - bl DecompressMonPic_DetectFrontOrBack_2 - movs r4, 0 - b _0807ADB2 - .pool -_0807AD94: - lsls r0, r5, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r2, [r1] - lsls r4, r6, 1 - adds r1, r4, 0x1 - lsls r1, 2 - adds r2, 0x4 - adds r2, r1 - ldr r1, [r2] - adds r2, r5, 0 - adds r3, r7, 0 - bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack -_0807ADB2: - mov r0, r8 - bl sub_806E794 - bl LoadCompressedObjectPalette - ldr r0, =0x020322a0 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xF0 - adds r0, r4 - strh r5, [r0] - lsls r0, r6, 2 - adds r1, 0x68 - adds r1, r0 - str r7, [r1] - b _0807AE36 - .pool -_0807ADE0: - mov r0, r8 - bl sub_806E794 - ldrh r0, [r0, 0x4] - adds r1, r4, 0 - bl sub_806A068 - ldr r0, =0x0202499c - movs r1, 0x78 - movs r2, 0x3C - movs r3, 0x6 - bl AddObjectToFront - ldr r4, =0x020322a0 - ldr r1, [r4] - adds r1, 0x8E - adds r1, r6 - strb r0, [r1] - ldr r3, =0x02020630 - ldr r0, [r4] - adds r0, 0x8E - adds r0, r6 - ldrb r1, [r0] - 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] - ldr r0, [r4] - adds r0, 0x8E - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, 0x1C - adds r0, r3 - ldr r1, =DummyObjectCallback - str r1, [r0] -_0807AE36: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807ACFC - - thumb_func_start sub_807AE50 -sub_807AE50: @ 807AE50 - push {r4,r5,lr} - sub sp, 0x4 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0xC - bls _0807AE66 - b _0807B116 -_0807AE66: - lsls r0, 2 - ldr r1, =_0807AE78 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807AE78: - .4byte _0807AEAC - .4byte _0807AF58 - .4byte _0807AF9C - .4byte _0807AFBC - .4byte _0807B006 - .4byte _0807B034 - .4byte _0807B058 - .4byte _0807B070 - .4byte _0807B07A - .4byte _0807B094 - .4byte _0807B0B0 - .4byte _0807B0D4 - .4byte _0807B0F0 -_0807AEAC: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0807AEC0 - ldr r1, =0x020229c6 - ldr r2, =0x00001144 - adds r0, r2, 0 - strh r0, [r1] - bl sub_80097E8 -_0807AEC0: - ldr r4, =0x020322a0 - movs r5, 0x80 - lsls r5, 1 - adds r0, r5, 0 - bl AllocZeroed - str r0, [r4] - bl init_uns_table_pokemon_copy - bl ResetTasks - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - ldr r0, =sub_807AC24 - bl SetVBlankCallback - bl sub_807B170 - bl sub_807AC3C - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1] - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x8C - strh r2, [r0] - adds r0, 0x8 - strh r2, [r0] - adds r1, 0xEE - movs r0, 0x1 - strb r0, [r1] - ldr r3, [r4] - adds r0, r3, 0 - adds r0, 0xD4 - movs r1, 0x40 - strh r1, [r0] - adds r0, 0x2 - strh r1, [r0] - adds r0, 0x2 - strh r2, [r0] - adds r0, 0x2 - strh r2, [r0] - adds r1, r3, 0 - adds r1, 0xDC - movs r0, 0x78 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0x50 - strh r0, [r1] - adds r0, r3, 0 - adds r0, 0xE8 - strh r5, [r0] - adds r0, 0x4 - strh r2, [r0] - b _0807B116 - .pool -_0807AF58: - ldr r0, =0x03003124 - ldrb r5, [r0] - cmp r5, 0 - bne _0807AF90 - ldr r4, =0x020322a0 - ldr r0, [r4] - adds r0, 0xFA - movs r1, 0x1 - strb r1, [r0] - bl sub_8009734 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r4] - str r5, [r0, 0x64] - b _0807B116 - .pool -_0807AF90: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - movs r0, 0x4 - strb r0, [r1] - b _0807B116 -_0807AF9C: - ldr r0, =0x020322a0 - ldr r1, [r0] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x3C - bhi _0807AFAC - b _0807B116 -_0807AFAC: - movs r0, 0 - str r0, [r1, 0x64] - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - b _0807B0E4 - .pool -_0807AFBC: - bl sub_800ABBC - lsls r0, 24 - cmp r0, 0 - bne _0807AFC8 - b _0807B0DC -_0807AFC8: - bl sub_800ABAC - adds r4, r0, 0 - bl sub_800AA48 - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bcc _0807B000 - ldr r0, =0x020322a0 - ldr r1, [r0] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x1E - bhi _0807AFEA - b _0807B116 -_0807AFEA: - bl sub_800A620 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _0807B0E4 - .pool -_0807B000: - bl sub_807AC64 - b _0807B116 -_0807B006: - bl sub_807AC64 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0807B014 - b _0807B116 -_0807B014: - bl sub_800A23C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0807B022 - b _0807B116 -_0807B022: - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _0807B0E4 - .pool -_0807B034: - ldr r2, =0x020322a0 - ldr r0, [r2] - adds r0, 0x72 - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0x73 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0x93 - strb r1, [r0] - movs r0, 0 - bl sub_807ACFC - b _0807B0DC - .pool -_0807B058: - movs r0, 0 - movs r1, 0x1 - bl sub_807ACFC - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _0807B0E4 - .pool -_0807B070: - movs r0, 0x1 - movs r1, 0 - bl sub_807ACFC - b _0807B0DC -_0807B07A: - movs r0, 0x1 - movs r1, 0x1 - bl sub_807ACFC - bl sub_807B154 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _0807B0E4 - .pool -_0807B094: - bl sub_807BA94 - ldr r0, =gUnknown_08338D18 - bl LoadObjectPic - ldr r0, =gUnknown_08338D20 - bl LoadTaggedObjectPalette - b _0807B0DC - .pool -_0807B0B0: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - movs r0, 0 - bl ShowBg - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _0807B0E4 - .pool -_0807B0D4: - bl sub_807B140 - bl sub_807BAD8 -_0807B0DC: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 -_0807B0E4: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0807B116 - .pool -_0807B0F0: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0807B116 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _0807B110 - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 -_0807B110: - ldr r0, =sub_807EA2C - bl SetMainCallback2 -_0807B116: - bl RunTasks - bl RunTextPrinters - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807AE50 - - thumb_func_start sub_807B140 -sub_807B140: @ 807B140 - push {lr} - movs r0, 0x5 - bl sub_807B62C - movs r0, 0 - bl sub_807B62C - pop {r0} - bx r0 - thumb_func_end sub_807B140 - - thumb_func_start sub_807B154 -sub_807B154: @ 807B154 - push {lr} - movs r0, 0 - movs r1, 0xFF - bl FillWindowPixelBuffer - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - pop {r0} - bx r0 - thumb_func_end sub_807B154 - - thumb_func_start sub_807B170 -sub_807B170: @ 807B170 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0x4 - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_08339014 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r5, 0x80 - lsls r5, 4 - adds r0, r5, 0 - bl Alloc - adds r1, r0, 0 - movs r0, 0 - bl SetBgTilemapBuffer - adds r0, r5, 0 - bl Alloc - adds r1, r0, 0 - movs r0, 0x1 - bl SetBgTilemapBuffer - adds r0, r5, 0 - bl Alloc - adds r1, r0, 0 - movs r0, 0x3 - bl SetBgTilemapBuffer - bl DeactivateAllTextPrinters - ldr r0, =gUnknown_08C00000 - mov r10, r0 - movs r0, 0 - mov r9, r0 - str r0, [sp] - mov r1, r10 - movs r2, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r0, =gUnknown_08C00524 - mov r8, r0 - ldr r4, =0x0201c000 - adds r1, r4, 0 - bl LZDecompressWram - movs r0, 0 - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r6, =gUnknown_08C004E0 - adds r0, r6, 0 - movs r1, 0 - movs r2, 0x20 - bl decompress_palette - ldr r0, =gUnknown_08338FFC - bl InitWindows - mov r0, r9 - str r0, [sp] - movs r0, 0 - mov r1, r10 - movs r2, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - mov r0, r8 - adds r1, r4, 0 - bl LZDecompressWram - movs r0, 0 - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - adds r0, r6, 0 - movs r1, 0 - movs r2, 0x20 - bl decompress_palette - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807B170 - - thumb_func_start sub_807B270 -sub_807B270: @ 807B270 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0xC - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0xC - bls _0807B288 - b _0807B43E -_0807B288: - lsls r0, 2 - ldr r1, =_0807B29C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807B29C: - .4byte _0807B2D0 - .4byte _0807B43E - .4byte _0807B43E - .4byte _0807B43E - .4byte _0807B43E - .4byte _0807B3AC - .4byte _0807B3B6 - .4byte _0807B3C0 - .4byte _0807B3D0 - .4byte _0807B3F0 - .4byte _0807B40C - .4byte _0807B414 - .4byte _0807B438 -_0807B2D0: - ldr r1, =0x02032298 - ldr r0, =0x020375e2 - ldrh r0, [r0] - movs r6, 0 - strb r0, [r1] - movs r0, 0x6 - strb r0, [r1, 0x1] - ldr r4, =0x020229f0 - ldr r0, =0x03005d90 - ldr r1, [r0] - adds r0, r4, 0 - bl CopyString - ldr r5, =0x02024744 - adds r0, r5, 0 - movs r1, 0x7 - mov r2, sp - bl pokemon_getattr - adds r0, r4, 0 - adds r0, 0x1C - mov r1, sp - bl CopyString - subs r4, 0x8 - movs r0, 0 - mov r8, r0 - movs r0, 0x2 - strh r0, [r4, 0x1A] - adds r0, r5, 0 - movs r1, 0x3 - bl pokemon_getattr - strh r0, [r4, 0x36] - ldr r4, =0x020322a0 - movs r5, 0x80 - lsls r5, 1 - adds r0, r5, 0 - bl AllocZeroed - str r0, [r4] - bl init_uns_table_pokemon_copy - bl ResetTasks - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - ldr r0, =sub_807AC24 - bl SetVBlankCallback - bl sub_807B170 - ldr r0, [r4] - adds r0, 0xEE - mov r1, r8 - strb r1, [r0] - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0x8C - strh r6, [r0] - adds r0, 0x8 - strh r6, [r0] - adds r0, 0x40 - movs r1, 0x40 - strh r1, [r0] - adds r0, 0x2 - strh r1, [r0] - adds r0, 0x2 - strh r6, [r0] - adds r0, 0x2 - strh r6, [r0] - adds r1, r2, 0 - adds r1, 0xDC - movs r0, 0x78 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0x50 - strh r0, [r1] - adds r0, r2, 0 - adds r0, 0xE8 - strh r5, [r0] - adds r0, 0x4 - strh r6, [r0] - str r6, [r2, 0x64] - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0x5 - strb r1, [r0] - b _0807B43E - .pool -_0807B3AC: - movs r0, 0 - movs r1, 0 - bl sub_807ACFC - b _0807B424 -_0807B3B6: - movs r0, 0 - movs r1, 0x1 - bl sub_807ACFC - b _0807B424 -_0807B3C0: - movs r0, 0x1 - movs r1, 0 - bl sub_807ACFC - movs r0, 0 - bl ShowBg - b _0807B424 -_0807B3D0: - movs r0, 0x1 - movs r1, 0x1 - bl sub_807ACFC - movs r0, 0 - movs r1, 0xFF - bl FillWindowPixelBuffer - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - b _0807B424 -_0807B3F0: - bl sub_807BA94 - ldr r0, =gUnknown_08338D18 - bl LoadObjectPic - ldr r0, =gUnknown_08338D20 - bl LoadTaggedObjectPalette - b _0807B424 - .pool -_0807B40C: - movs r0, 0 - bl ShowBg - b _0807B424 -_0807B414: - movs r0, 0x5 - bl sub_807B62C - movs r0, 0 - bl sub_807B62C - bl sub_807BAD8 -_0807B424: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0807B43E - .pool -_0807B438: - ldr r0, =sub_807B60C - bl SetMainCallback2 -_0807B43E: - bl RunTasks - bl RunTextPrinters - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807B270 - - thumb_func_start sub_807B464 -sub_807B464: @ 807B464 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0807B4B8 - adds r0, r5, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - adds r5, r0, 0 - adds r0, r4, 0 - bl SpeciesToNationalPokedexNum - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r4, 0 - movs r1, 0x2 - bl pokedex_flag_operation - adds r0, r4, 0 - movs r1, 0x3 - adds r2, r5, 0 - bl SetPokedexFlag -_0807B4B8: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807B464 - - thumb_func_start sub_807B4C4 -sub_807B4C4: @ 807B4C4 - push {lr} - bl link_get_multiplayer_id - pop {r0} - bx r0 - thumb_func_end sub_807B4C4 - - thumb_func_start sub_807B4D0 -sub_807B4D0: @ 807B4D0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r4, 24 - lsrs r4, 24 - movs r5, 0x64 - mov r1, r9 - muls r1, r5 - ldr r0, =0x020244ec - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0x40 - bl pokemon_getattr - lsls r0, 16 - lsrs r6, r0, 16 - adds r1, r4, 0 - muls r1, r5 - ldr r0, =0x02024744 - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x40 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r6, 0xFF - beq _0807B52A - ldr r0, =0x03005d8c - lsls r1, r6, 3 - adds r1, r6 - lsls r1, 2 - ldr r2, =0x00002be0 - adds r1, r2 - ldr r0, [r0] - adds r0, r1 - bl sub_80D439C -_0807B52A: - ldr r4, =0x020322a0 - ldr r0, [r4] - adds r1, r7, 0 - movs r2, 0x64 - bl memcpy - adds r0, r7, 0 - adds r1, r5, 0 - movs r2, 0x64 - bl memcpy - ldr r1, [r4] - adds r0, r5, 0 - movs r2, 0x64 - bl memcpy - movs r1, 0x46 - mov r0, sp - strb r1, [r0] - adds r0, r7, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0807B566 - adds r0, r7, 0 - movs r1, 0x20 - mov r2, sp - bl pokemon_setattr -_0807B566: - mov r0, r8 - cmp r0, 0xFF - beq _0807B57C - lsls r1, r0, 3 - add r1, r8 - lsls r1, 2 - ldr r0, =0x020321c0 - adds r1, r0 - adds r0, r7, 0 - bl sub_80D460C -_0807B57C: - mov r0, r9 - bl sub_807B464 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _0807B58E - bl sub_807B4C4 -_0807B58E: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807B4D0 - - thumb_func_start sub_807B5B8 -sub_807B5B8: @ 807B5B8 - push {r4,lr} - ldr r4, =0x020322a0 - ldr r0, [r4] - adds r0, 0x93 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0807B5D0 - cmp r0, 0x2 - beq _0807B5F6 - b _0807B600 - .pool -_0807B5D0: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0807B5F6 - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, [r4] - adds r1, 0x74 - movs r2, 0x14 - bl link_0800A448 - ldr r1, [r4] - adds r1, 0x93 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0807B5F6: - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x93 - movs r1, 0 - strb r1, [r0] -_0807B600: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807B5B8 - - thumb_func_start sub_807B60C -sub_807B60C: @ 807B60C - push {lr} - bl sub_807BBC8 - bl RunTasks - bl RunTextPrinters - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_807B60C - - thumb_func_start sub_807B62C -sub_807B62C: @ 807B62C - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x7 - bls _0807B638 - b _0807BA68 -_0807B638: - lsls r0, 2 - ldr r1, =_0807B648 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807B648: - .4byte _0807B668 - .4byte _0807B6DC - .4byte _0807B784 - .4byte _0807B7F8 - .4byte _0807B840 - .4byte _0807B90C - .4byte _0807B924 - .4byte _0807B9FC -_0807B668: - ldr r0, =0x020322a0 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0xE4 - movs r0, 0 - strh r0, [r2] - adds r1, 0xE6 - movs r0, 0xB4 - strh r0, [r1] - movs r1, 0xAA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r1, =0x00005206 - movs r0, 0xC - bl SetGpuReg - ldr r0, =gUnknown_08DD7300 - movs r1, 0x10 - movs r2, 0x60 - bl gpu_pal_apply - ldr r3, =gUnknown_08DD7360 - ldr r4, =0x06004000 - movs r5, 0xA1 - lsls r5, 5 - ldr r1, =0x040000d4 - ldr r6, =0x80000800 - movs r2, 0x80 - lsls r2, 5 - movs r7, 0x80 - lsls r7, 24 -_0807B6AA: - str r3, [r1] - str r4, [r1, 0x4] - str r6, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r3, r2 - adds r4, r2 - subs r5, r2 - cmp r5, r2 - bhi _0807B6AA - b _0807BA4C - .pool -_0807B6DC: - ldr r4, =0x020322a0 - ldr r2, [r4] - adds r1, r2, 0 - adds r1, 0xE2 - movs r0, 0 - strh r0, [r1] - adds r2, 0xE0 - movs r1, 0xAE - lsls r1, 1 - strh r1, [r2] - movs r0, 0x16 - bl SetGpuReg - ldr r1, =0x00008502 - movs r0, 0xA - bl SetGpuReg - ldr r1, =0x00009206 - movs r0, 0xC - bl SetGpuReg - ldr r0, [r4] - adds r0, 0xFA - ldrb r0, [r0] - cmp r0, 0 - beq _0807B724 - ldr r1, =gUnknown_083369A0 - b _0807B726 - .pool -_0807B724: - ldr r1, =gUnknown_083359A0 -_0807B726: - ldr r2, =0x06002800 - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x80000800 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - ldr r3, =gUnknown_08DD7360 - movs r4, 0xC0 - lsls r4, 19 - movs r5, 0xA1 - lsls r5, 5 - ldr r1, =0x040000d4 - ldr r6, =0x80000800 - movs r2, 0x80 - lsls r2, 5 - movs r7, 0x80 - lsls r7, 24 -_0807B74A: - str r3, [r1] - str r4, [r1, 0x4] - str r6, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r3, r2 - adds r4, r2 - subs r5, r2 - cmp r5, r2 - bhi _0807B74A - str r3, [r1] - str r4, [r1, 0x4] - lsrs r0, r5, 1 - orrs r0, r7 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r1, 0x92 - lsls r1, 5 - b _0807B820 - .pool -_0807B784: - ldr r0, =0x020322a0 - ldr r2, [r0] - adds r0, r2, 0 - adds r0, 0xE0 - movs r1, 0 - strh r1, [r0] - adds r0, 0x2 - strh r1, [r0] - adds r0, 0x18 - ldrb r0, [r0] - cmp r0, 0 - bne _0807B7C0 - ldr r1, =0x00001241 - movs r0, 0 - bl SetGpuReg - ldr r0, =gUnknown_083379A0 - ldr r1, =0x06002800 - bl LZ77UnCompVram - movs r0, 0x8 - b _0807B7DA - .pool -_0807B7C0: - ldr r1, =0x00001241 - movs r0, 0 - bl SetGpuReg - ldr r1, =gUnknown_0832FFC0 - ldr r2, =0x06002800 - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x80000400 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - movs r0, 0x1 -_0807B7DA: - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - b _0807BA68 - .pool -_0807B7F8: - ldr r0, =gUnknown_08337EA0 - movs r1, 0x30 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_08337EC0 - ldr r1, =0x06004000 - bl LZ77UnCompVram - ldr r0, =gUnknown_08338550 - ldr r1, =0x06009000 - bl LZ77UnCompVram - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0xE4 - movs r1, 0x50 - strh r1, [r0] - movs r1, 0xB2 - lsls r1, 5 -_0807B820: - movs r0, 0 - bl SetGpuReg - b _0807BA68 - .pool -_0807B840: - ldr r1, =0x00001441 - movs r0, 0 - bl SetGpuReg - ldr r1, =0x00001287 - movs r0, 0xC - bl SetGpuReg - ldr r0, =0x020322a0 - ldr r3, [r0] - adds r1, r3, 0 - adds r1, 0xD4 - movs r2, 0 - movs r0, 0x40 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0x5C - strh r0, [r1] - adds r1, 0x12 - movs r0, 0x20 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0x80 - lsls r0, 3 - strh r0, [r1] - adds r0, r3, 0 - adds r0, 0xEC - strh r2, [r0] - ldr r3, =gUnknown_08332F60 - ldr r4, =0x06004000 - movs r5, 0xA1 - lsls r5, 6 - ldr r1, =0x040000d4 - ldr r6, =0x80000800 - movs r2, 0x80 - lsls r2, 5 - movs r7, 0x80 - lsls r7, 24 -_0807B88C: - str r3, [r1] - str r4, [r1, 0x4] - str r6, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r3, r2 - adds r4, r2 - subs r5, r2 - cmp r5, r2 - bhi _0807B88C - str r3, [r1] - str r4, [r1, 0x4] - lsrs r0, r5, 1 - orrs r0, r7 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0xFA - ldrb r0, [r0] - cmp r0, 0 - beq _0807B8EC - ldr r1, =gUnknown_083357A0 - ldr r2, =0x06009000 - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x80000080 - b _0807BA64 - .pool -_0807B8EC: - ldr r1, =gUnknown_083358A0 - ldr r2, =0x06009000 - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x80000080 - b _0807BA64 - .pool -_0807B90C: - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0xE0 - movs r2, 0 - strh r2, [r1] - adds r0, 0xE2 - strh r2, [r0] - b _0807BA68 - .pool -_0807B924: - ldr r1, =0x00001441 - movs r0, 0 - bl SetGpuReg - ldr r1, =0x00001287 - movs r0, 0xC - bl SetGpuReg - ldr r0, =0x020322a0 - ldr r3, [r0] - adds r1, r3, 0 - adds r1, 0xD4 - movs r2, 0 - movs r0, 0x40 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0x5C - strh r0, [r1] - adds r1, 0x12 - adds r0, 0xA4 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0x80 - strh r0, [r1] - subs r1, 0xE - movs r0, 0x78 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0x50 - strh r0, [r1] - adds r0, r3, 0 - adds r0, 0xEC - strh r2, [r0] - ldr r3, =gUnknown_08332F60 - ldr r4, =0x06004000 - movs r5, 0xA1 - lsls r5, 6 - ldr r1, =0x040000d4 - ldr r6, =0x80000800 - movs r2, 0x80 - lsls r2, 5 - movs r7, 0x80 - lsls r7, 24 -_0807B97A: - str r3, [r1] - str r4, [r1, 0x4] - str r6, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r3, r2 - adds r4, r2 - subs r5, r2 - cmp r5, r2 - bhi _0807B97A - str r3, [r1] - str r4, [r1, 0x4] - lsrs r0, r5, 1 - orrs r0, r7 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0xFA - ldrb r0, [r0] - cmp r0, 0 - beq _0807B9DC - ldr r1, =gUnknown_083357A0 - ldr r2, =0x06009000 - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x80000080 - b _0807BA64 - .pool -_0807B9DC: - ldr r1, =gUnknown_083358A0 - ldr r2, =0x06009000 - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x80000080 - b _0807BA64 - .pool -_0807B9FC: - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0xE4 - movs r2, 0 - strh r2, [r1] - adds r0, 0xE6 - strh r2, [r0] - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - ldr r1, =0x00005206 - movs r0, 0xC - bl SetGpuReg - ldr r0, =gUnknown_08DD7300 - movs r1, 0x10 - movs r2, 0x60 - bl gpu_pal_apply - ldr r3, =gUnknown_08DD7360 - ldr r4, =0x06004000 - movs r5, 0xA1 - lsls r5, 5 - ldr r1, =0x040000d4 - ldr r6, =0x80000800 - movs r2, 0x80 - lsls r2, 5 - movs r7, 0x80 - lsls r7, 24 -_0807BA3A: - str r3, [r1] - str r4, [r1, 0x4] - str r6, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r3, r2 - adds r4, r2 - subs r5, r2 - cmp r5, r2 - bhi _0807BA3A -_0807BA4C: - str r3, [r1] - str r4, [r1, 0x4] - lsrs r0, r5, 1 - orrs r0, r7 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - ldr r1, =gUnknown_08331F60 - ldr r2, =0x06009000 - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x80000800 -_0807BA64: - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] -_0807BA68: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807B62C - - thumb_func_start sub_807BA94 -sub_807BA94: @ 807BA94 - push {lr} - ldr r0, =gUnknown_08338D70 - bl LoadObjectPic - ldr r0, =gUnknown_08338DC0 - bl LoadObjectPic - ldr r0, =gUnknown_08338DF4 - bl LoadObjectPic - ldr r0, =gUnknown_08338E6C - bl LoadObjectPic - ldr r0, =gUnknown_08338D78 - bl LoadTaggedObjectPalette - ldr r0, =gUnknown_08338D80 - bl LoadTaggedObjectPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_807BA94 - - thumb_func_start sub_807BAD8 -sub_807BAD8: @ 807BAD8 - push {r4,r5,lr} - sub sp, 0x14 - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0xEE - ldrb r0, [r0] - cmp r0, 0 - beq _0807BB68 - bl link_get_multiplayer_id - lsls r0, 24 - ldr r3, =0x02021cc4 - movs r2, 0x80 - lsls r2, 17 - eors r2, r0 - lsrs r2, 24 - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - ldr r0, =0x020229f0 - adds r1, r0 - adds r0, r3, 0 - bl CopyString - ldr r5, =0x02032298 - ldrb r0, [r5, 0x1] - movs r1, 0x6 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - movs r4, 0x64 - muls r0, r4 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - ldr r0, =0x02021ec4 - mov r1, sp - bl CopyString_Limit10 - ldrb r0, [r5] - muls r0, r4 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - ldr r0, =0x02021dc4 - mov r1, sp - bl CopyString_Limit10 - b _0807BBA4 - .pool -_0807BB68: - ldr r0, =0x020375e0 - ldrh r0, [r0] - lsls r4, r0, 4 - subs r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_08338ED0 - adds r4, r0 - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x2B - bl CopyString - ldr r0, =0x02021ec4 - adds r1, r4, 0 - bl CopyString_Limit10 - ldr r0, =0x020375e2 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - ldr r0, =0x02021dc4 - mov r1, sp - bl CopyString_Limit10 -_0807BBA4: - add sp, 0x14 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807BAD8 - - thumb_func_start sub_807BBC8 -sub_807BBC8: @ 807BBC8 - push {lr} - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0xFA - ldrb r0, [r0] - cmp r0, 0 - bne _0807BBE0 - bl sub_807CFC8 - b _0807BBE4 - .pool -_0807BBE0: - bl sub_807BBEC -_0807BBE4: - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_807BBC8 - - thumb_func_start sub_807BBEC -sub_807BBEC: @ 807BBEC - push {r4-r7,lr} - sub sp, 0x14 - ldr r0, =0x020322a0 - ldr r1, [r0] - adds r1, 0x94 - ldrh r5, [r1] - ldr r1, =0x0000010b - adds r7, r0, 0 - cmp r5, r1 - bls _0807BC04 - bl _0807CFB4 -_0807BC04: - lsls r0, r5, 2 - ldr r1, =_0807BC1C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807BC1C: - .4byte _0807C04C - .4byte _0807C0C4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807C120 - .4byte _0807C168 - .4byte _0807C1DC - .4byte _0807CFB4 - .4byte _0807C248 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807C26C - .4byte _0807C29C - .4byte _0807C2AE - .4byte _0807C2D0 - .4byte _0807C318 - .4byte _0807C348 - .4byte _0807C390 - .4byte _0807C3E0 - .4byte _0807C434 - .4byte _0807C4B8 - .4byte _0807C4DC - .4byte _0807C528 - .4byte _0807C574 - .4byte _0807C5D0 - .4byte _0807C630 - .4byte _0807C644 - .4byte _0807C658 - .4byte _0807C66C - .4byte _0807C794 - .4byte _0807C864 - .4byte _0807C8EC - .4byte _0807C964 - .4byte _0807C974 - .4byte _0807C994 - .4byte _0807C9E4 - .4byte _0807CA02 - .4byte _0807CA40 - .4byte _0807CA50 - .4byte _0807CAC8 - .4byte _0807CFB4 - .4byte _0807CAF0 - .4byte _0807CB30 - .4byte _0807CB70 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CB90 - .4byte _0807CBB8 - .4byte _0807CBD4 - .4byte _0807CBF4 - .4byte _0807CC9C - .4byte _0807CCD0 - .4byte _0807CD1C - .4byte _0807CDDC - .4byte _0807CE54 - .4byte _0807CEA0 - .4byte _0807CEB0 - .4byte _0807CEB6 - .4byte _0807CEDC - .4byte _0807CF38 - .4byte _0807CF5C - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CE18 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807C460 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CFB4 - .4byte _0807CE38 -_0807C04C: - ldr r3, =0x02020630 - ldr r0, [r7] - adds r0, 0x8E - ldrb r1, [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] - ldr r4, [r7] - adds r2, r4, 0 - adds r2, 0x8E - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldr r1, =0x0000ff4c - strh r1, [r0, 0x24] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldr r2, =gUnknown_08300D38 - adds r0, r4, 0 - adds r0, 0xF0 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - strh r0, [r1, 0x26] - adds r1, r4, 0 - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - bl current_map_music_get - ldr r1, [r7] - adds r1, 0xF4 - strh r0, [r1] - ldr r0, =0x00000179 - bl current_map_music_set - bl _0807CFB4 - .pool -_0807C0C4: - ldr r5, [r7] - adds r6, r5, 0 - adds r6, 0xE6 - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - ble _0807C0F8 - ldr r2, =0x02020630 - adds r0, r5, 0 - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x24] - adds r1, 0x3 - strh r1, [r0, 0x24] - ldrh r0, [r6] - subs r0, 0x3 - strh r0, [r6] - bl _0807CFB4 - .pool -_0807C0F8: - ldr r2, =0x02020630 - adds r0, r5, 0 - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strh r1, [r0, 0x24] - strh r1, [r6] - adds r1, r5, 0 - adds r1, 0x94 - movs r0, 0xA - strh r0, [r1] - bl _0807CFB4 - .pool -_0807C120: - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EE942 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_807F1A8 - ldr r4, =0x020322a0 - ldr r0, [r4] - adds r2, r0, 0 - adds r2, 0xF0 - ldrh r1, [r2] - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - beq _0807C14E - adds r0, r1, 0 - movs r1, 0 - bl cry_related -_0807C14E: - ldr r3, [r4] - adds r1, r3, 0 - adds r1, 0x94 - movs r2, 0 - movs r0, 0xB - bl _0807CE06 - .pool -_0807C168: - ldr r1, [r7] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x50 - beq _0807C178 - bl _0807CFB4 -_0807C178: - adds r0, r1, 0 - adds r0, 0x8E - ldrb r0, [r0] - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1, 0x5] - lsrs r1, 4 - movs r2, 0x2 - str r2, [sp] - movs r2, 0x1 - str r2, [sp, 0x4] - movs r2, 0x14 - str r2, [sp, 0x8] - ldr r2, =0x000fffff - str r2, [sp, 0xC] - movs r2, 0x78 - movs r3, 0x20 - bl sub_807671C - ldr r1, [r7] - adds r1, 0xD2 - strb r0, [r1] - ldr r1, [r7] - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EE959 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_807F1A8 - bl _0807CFB4 - .pool -_0807C1DC: - ldr r5, =0x02020630 - ldr r0, [r7] - adds r0, 0xD2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r5, 0 - adds r4, 0x1C - adds r0, r4 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - beq _0807C1FC - bl _0807CFB4 -_0807C1FC: - ldr r0, =gUnknown_08338D28 - movs r1, 0x78 - movs r2, 0x20 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0xD3 - strb r0, [r1] - ldr r2, [r7] - adds r0, r2, 0 - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_807E5D8 - str r1, [r0] - adds r2, 0xD2 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - ldr r1, [r7] - bl _0807CF4C - .pool -_0807C248: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x94 - movs r1, 0x14 - strh r1, [r0] - bl _0807CFB4 - .pool -_0807C26C: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807C27C - bl _0807CFB4 -_0807C27C: - movs r0, 0x4 - bl sub_807B62C - movs r0, 0 - movs r1, 0xFF - bl FillWindowPixelBuffer - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - bl _0807CF48 - .pool -_0807C29C: - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0x10 - movs r3, 0 - bl _0807CF44 -_0807C2AE: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807C2BE - bl _0807CFB4 -_0807C2BE: - ldr r0, [r7] - adds r0, 0x94 - movs r1, 0x17 - strh r1, [r0] - bl _0807CFB4 - .pool -_0807C2D0: - ldr r4, =0x020322a0 - ldr r0, [r4] - adds r2, r0, 0 - adds r2, 0xEA - ldrh r1, [r2] - movs r0, 0x80 - lsls r0, 1 - cmp r1, r0 - bls _0807C2F0 - adds r0, r1, 0 - subs r0, 0x34 - strh r0, [r2] - b _0807C30C - .pool -_0807C2F0: - movs r0, 0x1 - bl sub_807B62C - ldr r3, [r4] - adds r1, r3, 0 - adds r1, 0xEA - movs r2, 0 - movs r0, 0x80 - strh r0, [r1] - subs r1, 0x56 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - str r2, [r3, 0x64] -_0807C30C: - ldr r0, =0x020322a0 - ldr r4, [r0] - bl _0807CB5C - .pool -_0807C318: - ldr r1, [r7] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x14 - bhi _0807C328 - bl _0807CFB4 -_0807C328: - bl sub_807AB28 - ldr r0, =gUnknown_08338E74 - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0x91 - strb r0, [r1] - ldr r1, [r7] - bl _0807CF4C - .pool -_0807C348: - ldr r2, =0x02020630 - ldr r0, [r7] - adds r0, 0x91 - 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 - blt _0807C368 - bl _0807CFB4 -_0807C368: - adds r0, r1, 0 - bl RemoveObjectAndFreeTiles - movs r1, 0xC8 - lsls r1, 3 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x0000040c - movs r0, 0x52 - bl SetGpuReg - ldr r1, [r7] - bl _0807CF4C - .pool -_0807C390: - ldr r2, [r7] - adds r0, r2, 0 - adds r0, 0xE0 - ldrh r1, [r0] - subs r1, 0x1 - strh r1, [r0] - lsls r1, 16 - movs r0, 0x9E - lsls r0, 17 - cmp r1, r0 - bne _0807C3B0 - adds r1, r2, 0 - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0807C3B0: - ldr r0, [r7] - adds r0, 0xE0 - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0xA4 - lsls r0, 1 - cmp r1, r0 - beq _0807C3C4 - bl _0807CFB4 -_0807C3C4: - ldr r0, =gUnknown_08338DFC - movs r1, 0x80 - movs r2, 0x41 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0x92 - strb r0, [r1] - bl _0807CFB4 - .pool -_0807C3E0: - ldr r0, =gUnknown_08338D88 - movs r1, 0x80 - movs r2, 0x50 - movs r3, 0x3 - bl AddObjectToFront - ldr r4, =0x020322a0 - ldr r1, [r4] - adds r1, 0x90 - strb r0, [r1] - ldr r0, =gUnknown_08338DC8 - movs r1, 0x80 - movs r2, 0x50 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r4] - adds r1, 0x91 - strb r0, [r1] - ldr r0, [r4] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0x1 - bl StartObjectImageAnim - ldr r1, [r4] - bl _0807CF4C - .pool -_0807C434: - ldr r2, [r7] - adds r1, r2, 0 - adds r1, 0xE0 - ldrh r0, [r1] - subs r0, 0x2 - strh r0, [r1] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA6 - bne _0807C44E - subs r1, 0x4C - movs r0, 0xC8 - strh r0, [r1] -_0807C44E: - ldr r1, =0x00001241 - movs r0, 0 - bl SetGpuReg - bl _0807CFB4 - .pool -_0807C460: - ldr r2, =0x02020630 - ldr r4, [r7] - adds r3, r4, 0 - adds r3, 0x90 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - subs r1, 0x2 - strh r1, [r0, 0x22] - adds r0, r4, 0 - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - subs r1, 0x2 - strh r1, [r0, 0x22] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r3, 0x22 - ldrsh r1, [r0, r3] - movs r0, 0x8 - negs r0, r0 - cmp r1, r0 - blt _0807C4A6 - bl _0807CFB4 -_0807C4A6: - adds r1, r4, 0 - adds r1, 0x94 - movs r0, 0x1D - strh r0, [r1] - bl _0807CFB4 - .pool -_0807C4B8: - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x94 - movs r1, 0x1E - strh r1, [r0] - bl _0807CFB4 - .pool -_0807C4DC: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807C4EC - bl _0807CFB4 -_0807C4EC: - ldr r0, [r7] - adds r0, 0x90 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r0, [r7] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - movs r0, 0x2 - bl sub_807B62C - ldr r1, [r7] - bl _0807CF4C - .pool -_0807C528: - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r5, =gUnknown_08338DC8 - adds r0, r5, 0 - movs r1, 0x6F - movs r2, 0xAA - movs r3, 0 - bl AddObjectToFront - ldr r4, =0x020322a0 - ldr r1, [r4] - adds r1, 0x90 - strb r0, [r1] - movs r2, 0xA - negs r2, r2 - adds r0, r5, 0 - movs r1, 0x81 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r4] - adds r1, 0x91 - strb r0, [r1] - ldr r1, [r4] - bl _0807CF4C - .pool -_0807C574: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0807C592 - movs r0, 0x2E - bl audio_play - ldr r0, =0x020322a0 - ldr r1, [r0] - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0807C592: - ldr r3, =0x02020630 - ldr r0, =0x020322a0 - ldr r2, [r0] - adds r0, r2, 0 - adds r0, 0x90 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x26] - subs r1, 0x3 - strh r1, [r0, 0x26] - adds r2, 0x91 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x26] - adds r1, 0x3 - strh r1, [r0, 0x26] - bl _0807CFB4 - .pool -_0807C5D0: - ldr r5, =0x02020630 - ldr r4, [r7] - adds r2, r4, 0 - adds r2, 0x90 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r0, 0x26] - subs r1, 0x3 - strh r1, [r0, 0x26] - adds r6, r4, 0 - adds r6, 0x91 - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r0, 0x26] - adds r1, 0x3 - strh r1, [r0, 0x26] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, r0, r5 - movs r0, 0x26 - ldrsh r1, [r3, r0] - movs r0, 0x5A - negs r0, r0 - cmp r1, r0 - ble _0807C616 - bl _0807CFB4 -_0807C616: - movs r2, 0x1 - strh r2, [r3, 0x30] - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x30] - adds r1, r4, 0 - bl _0807CF4C - .pool -_0807C630: - ldr r2, =0x0000ffff - movs r0, 0x1 - movs r1, 0x10 - bl sub_80A2A20 - bl _0807CF48 - .pool -_0807C644: - ldr r2, =0x0000ffff - movs r0, 0x1 - movs r1, 0 - bl sub_80A2A20 - bl _0807CF48 - .pool -_0807C658: - ldr r2, =0x0000ffff - movs r0, 0x1 - movs r1, 0x10 - bl sub_80A2A20 - bl _0807CF48 - .pool -_0807C66C: - ldr r5, =0x020322a0 - ldr r0, [r5] - adds r0, 0xF0 - ldrh r0, [r0] - bl sub_806E840 - lsls r0, 24 - cmp r0, 0 - bne _0807C6E4 - ldr r4, =0x02020630 - ldr r2, [r5] - adds r2, 0x8E - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x10 - adds r0, r1 - ldr r1, =gUnknown_08338ECC - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x1] - movs r2, 0x3 - orrs r1, r2 - strb r1, [r0, 0x1] - ldr r0, [r5] - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0 - movs r2, 0x3 - movs r3, 0x3 - bl CalcVecFromObjectCenterToObjectUpperLeft - ldr r0, [r5] - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0 - bl StartObjectRotScalAnim - b _0807C6FA - .pool -_0807C6E4: - ldr r0, [r5] - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0 - bl StartObjectRotScalAnim -_0807C6FA: - ldr r5, =0x020322a0 - ldr r0, [r5] - adds r0, 0x8F - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - movs r1, 0 - bl StartObjectRotScalAnim - ldr r2, [r5] - adds r3, r2, 0 - adds r3, 0x8E - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x3C - strh r1, [r0, 0x20] - adds r2, 0x8F - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xB4 - strh r1, [r0, 0x20] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xC0 - strh r1, [r0, 0x22] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000ffe0 - strh r1, [r0, 0x22] - ldrb r0, [r3] - 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] - adds r0, 0x8F - ldrb r1, [r0] - 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] - ldr r1, [r5] - bl _0807CF4C - .pool -_0807C794: - ldr r4, =0x02020630 - ldr r2, [r7] - adds r3, r2, 0 - adds r3, 0x8E - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x26] - subs r1, 0x3 - movs r5, 0 - strh r1, [r0, 0x26] - adds r2, 0x8F - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x26] - adds r1, 0x3 - strh r1, [r0, 0x26] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x26] - adds r0, 0xA3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bhi _0807C7DC - movs r0, 0x2D - bl audio_play -_0807C7DC: - ldr r2, [r7] - adds r3, r2, 0 - adds r3, 0x8E - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r6, 0x26 - ldrsh r1, [r0, r6] - movs r0, 0xDE - negs r0, r0 - cmp r1, r0 - blt _0807C7FC - bl _0807CFB4 -_0807C7FC: - adds r0, r2, 0 - adds r0, 0x90 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r5, [r0, 0x30] - adds r0, r2, 0 - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r5, [r0, 0x30] - adds r1, r2, 0 - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - ldrb r1, [r3] - 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, [r7] - adds r0, 0x8F - ldrb r1, [r0] - 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 r2, =0x0000ffff - movs r0, 0x1 - movs r1, 0 - bl sub_80A2A20 - b _0807CFB4 - .pool -_0807C864: - ldr r4, =0x02020630 - ldr r2, [r7] - adds r3, r2, 0 - adds r3, 0x90 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x26] - subs r1, 0x3 - strh r1, [r0, 0x26] - adds r2, 0x91 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x26] - adds r1, 0x3 - strh r1, [r0, 0x26] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r2, 0x26 - ldrsh r1, [r0, r2] - movs r0, 0xDE - negs r0, r0 - cmp r1, r0 - ble _0807C8A6 - b _0807CFB4 -_0807C8A6: - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, [r7] - adds r2, r1, 0 - adds r2, 0x94 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x90 - ldrb r1, [r1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r0, [r7] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - b _0807CFB4 - .pool -_0807C8EC: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807C8FA - b _0807CFB4 -_0807C8FA: - ldr r1, [r7] - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - movs r0, 0x1 - bl sub_807B62C - ldr r0, [r7] - adds r0, 0xE0 - movs r1, 0xA6 - strh r1, [r0] - ldr r0, =gUnknown_08338D88 - movs r4, 0x14 - negs r4, r4 - movs r1, 0x80 - adds r2, r4, 0 - movs r3, 0x3 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0x90 - strb r0, [r1] - ldr r0, =gUnknown_08338DC8 - movs r1, 0x80 - adds r2, r4, 0 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0x91 - strb r0, [r1] - ldr r0, [r7] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0x1 - bl StartObjectImageAnim - b _0807CFB4 - .pool -_0807C964: - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0x10 - movs r3, 0 - b _0807CF44 -_0807C974: - movs r1, 0x92 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807C98C - b _0807CFB4 -_0807C98C: - b _0807CF48 - .pool -_0807C994: - ldr r2, =0x02020630 - ldr r4, [r7] - adds r3, r4, 0 - adds r3, 0x90 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x26] - adds r1, 0x3 - strh r1, [r0, 0x26] - adds r0, r4, 0 - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x26] - adds r1, 0x3 - strh r1, [r0, 0x26] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r3, 0x26 - ldrsh r1, [r0, r3] - movs r6, 0x22 - ldrsh r0, [r0, r6] - adds r1, r0 - cmp r1, 0x40 - beq _0807C9DA - b _0807CFB4 -_0807C9DA: - adds r1, r4, 0 - b _0807CF4C - .pool -_0807C9E4: - ldr r1, [r7] - adds r5, r1, 0 - adds r5, 0xE0 - ldrh r0, [r5] - adds r0, 0x2 - strh r0, [r5] - lsls r0, 16 - asrs r0, 16 - movs r6, 0x9E - lsls r6, 1 - cmp r0, r6 - bgt _0807C9FE - b _0807CFB4 -_0807C9FE: - strh r6, [r5] - b _0807CF4C -_0807CA02: - ldr r0, [r7] - adds r0, 0x90 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r0, [r7] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r3, [r7] - adds r2, r3, 0 - adds r2, 0x94 - ldrh r0, [r2] - adds r0, 0x1 - movs r1, 0 - strh r0, [r2] - str r1, [r3, 0x64] - b _0807CFB4 - .pool -_0807CA40: - ldr r1, [r7] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0xA - beq _0807CA4E - b _0807CFB4 -_0807CA4E: - b _0807CF4C -_0807CA50: - ldr r1, [r7] - adds r2, r1, 0 - adds r2, 0xE0 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - lsls r0, 16 - asrs r0, 16 - movs r3, 0xAE - lsls r3, 1 - cmp r0, r3 - ble _0807CA72 - strh r3, [r2] - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0807CA72: - ldr r2, [r7] - adds r0, r2, 0 - adds r0, 0xE0 - movs r3, 0 - ldrsh r1, [r0, r3] - movs r0, 0xA4 - lsls r0, 1 - cmp r1, r0 - beq _0807CA86 - b _0807CFB4 -_0807CA86: - adds r0, r2, 0 - adds r0, 0xFA - ldrb r0, [r0] - cmp r0, 0 - bne _0807CA92 - b _0807CFB4 -_0807CA92: - ldr r0, =gUnknown_08338DFC - movs r1, 0x80 - movs r2, 0x41 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0x92 - strb r0, [r1] - ldr r2, =0x02020630 - ldr r0, [r7] - adds r0, 0x92 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_807AAE0 - str r1, [r0] - b _0807CFB4 - .pool -_0807CAC8: - ldr r0, =gUnknown_08338E74 - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0 - bl AddObjectToFront - ldr r2, =0x020322a0 - ldr r1, [r2] - adds r1, 0x91 - strb r0, [r1] - ldr r0, [r2] - adds r0, 0x94 - movs r1, 0x32 - strh r1, [r0] - b _0807CFB4 - .pool -_0807CAF0: - ldr r2, =0x02020630 - ldr r0, [r7] - adds r0, 0x91 - 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 - blt _0807CB0E - b _0807CFB4 -_0807CB0E: - adds r0, r1, 0 - bl RemoveObjectAndFreeTiles - movs r0, 0x6 - bl sub_807B62C - ldr r1, [r7] - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - movs r0, 0x9F - bl audio_play - b _0807CFB4 - .pool -_0807CB30: - ldr r1, [r7] - adds r2, r1, 0 - adds r2, 0xEA - ldrh r3, [r2] - ldr r0, =0x000003ff - cmp r3, r0 - bhi _0807CB4C - adds r0, r3, 0 - adds r0, 0x34 - strh r0, [r2] - b _0807CB5A - .pool -_0807CB4C: - movs r0, 0x80 - lsls r0, 3 - strh r0, [r2] - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0807CB5A: - ldr r4, [r7] -_0807CB5C: - adds r0, r4, 0 - adds r0, 0xEA - ldrh r1, [r0] - movs r0, 0x80 - lsls r0, 8 - bl __divsi3 - adds r4, 0xE8 - strh r0, [r4] - b _0807CFB4 -_0807CB70: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x94 - movs r1, 0x3C - strh r1, [r0] - b _0807CFB4 - .pool -_0807CB90: - ldr r4, =0x02037fd4 - ldrb r1, [r4, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807CB9E - b _0807CFB4 -_0807CB9E: - movs r0, 0x5 - bl sub_807B62C - movs r0, 0x7 - bl sub_807B62C - ldrb r0, [r4, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r4, 0x8] - b _0807CF48 - .pool -_0807CBB8: - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - b _0807CF44 - .pool -_0807CBD4: - movs r1, 0xA2 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807CBEC - b _0807CFB4 -_0807CBEC: - b _0807CF48 - .pool -_0807CBF4: - ldr r0, =gUnknown_08338D28 - movs r2, 0x8 - negs r2, r2 - movs r1, 0x78 - movs r3, 0 - bl AddObjectToFront - ldr r5, =0x020322a0 - ldr r1, [r5] - adds r1, 0xD3 - movs r6, 0 - strb r0, [r1] - ldr r4, =0x02020630 - ldr r2, [r5] - adds r2, 0xD3 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x4A - strh r1, [r0, 0x34] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_807E6AC - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartObjectImageAnim - ldr r0, [r5] - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x2 - bl StartObjectRotScalAnim - ldr r0, [r5] - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x5] - lsrs r1, 4 - adds r1, 0x10 - movs r0, 0x1 - lsls r0, r1 - ldr r2, =0x0000ffff - movs r1, 0x10 - bl sub_80A2A20 - ldr r2, [r5] - adds r1, r2, 0 - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - str r6, [r2, 0x64] - b _0807CFB4 - .pool -_0807CC9C: - ldr r2, =0x02020630 - ldr r0, [r7] - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x5] - lsrs r1, 4 - adds r1, 0x10 - movs r0, 0x1 - lsls r0, r1 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r1, [r7] - b _0807CF4C - .pool -_0807CCD0: - ldr r2, =0x02020630 - ldr r3, [r7] - adds r0, r3, 0 - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - beq _0807CCEE - b _0807CFB4 -_0807CCEE: - adds r0, r3, 0 - adds r0, 0xF2 - ldrh r2, [r0] - lsls r0, r2, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - ldr r1, [r1, 0x10] - ldr r3, [r3, 0x6C] - bl DecompressMonPic_DetectFrontOrBack_2 - ldr r1, [r7] - b _0807CF4C - .pool -_0807CD1C: - ldr r4, =0x02020630 - ldr r2, [r7] - adds r6, r2, 0 - adds r6, 0x8F - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r5, 0 - movs r1, 0x78 - strh r1, [r0, 0x20] - ldrb r0, [r6] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldr r3, =gUnknown_08300D38 - adds r2, 0xF2 - ldrh r0, [r2] - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x1] - adds r0, 0x3C - strh r0, [r1, 0x22] - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r5, [r0, 0x24] - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r5, [r0, 0x26] - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0 - bl StartObjectImageAnim - ldr r3, [r7] - adds r0, r3, 0 - adds r0, 0x8F - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r1, [r1, 0x5] - lsrs r1, 4 - movs r2, 0x2 - str r2, [sp] - movs r2, 0x1 - str r2, [sp, 0x4] - movs r2, 0x14 - str r2, [sp, 0x8] - ldr r2, =0x000fffff - str r2, [sp, 0xC] - adds r3, 0xF2 - ldrh r2, [r3] - str r2, [sp, 0x10] - movs r2, 0x78 - movs r3, 0x54 - bl sub_8076438 - ldr r0, [r7] - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl obj_free_rotscale_entry - ldr r0, [r7] - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r1, [r7] - b _0807CF4C - .pool -_0807CDDC: - movs r1, 0xAA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EE966 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_807F1A8 - ldr r0, =0x020322a0 - ldr r3, [r0] - adds r1, r3, 0 - adds r1, 0x94 - movs r2, 0 - movs r0, 0xA7 -_0807CE06: - strh r0, [r1] - str r2, [r3, 0x64] - b _0807CFB4 - .pool -_0807CE18: - ldr r3, [r7] - ldr r0, [r3, 0x64] - adds r0, 0x1 - str r0, [r3, 0x64] - cmp r0, 0x3C - bhi _0807CE26 - b _0807CFB4 -_0807CE26: - adds r0, r3, 0 - adds r0, 0x94 - movs r2, 0 - ldr r1, =0x0000010b - strh r1, [r0] - str r2, [r3, 0x64] - b _0807CFB4 - .pool -_0807CE38: - bl sub_80A3678 - lsls r0, 24 - cmp r0, 0 - bne _0807CE44 - b _0807CFB4 -_0807CE44: - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x94 - movs r1, 0x44 - strh r1, [r0] - b _0807CFB4 - .pool -_0807CE54: - ldr r1, [r7] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0xA - bne _0807CE66 - ldr r0, =0x00000173 - bl fanfare_play -_0807CE66: - ldr r1, [r7] - ldr r0, [r1, 0x64] - cmp r0, 0xFA - beq _0807CE70 - b _0807CFB4 -_0807CE70: - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - movs r5, 0 - strh r0, [r1] - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EE977 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_807F1A8 - ldr r0, [r7] - str r5, [r0, 0x64] - b _0807CFB4 - .pool -_0807CEA0: - ldr r1, [r7] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x3C - beq _0807CEAE - b _0807CFB4 -_0807CEAE: - b _0807CF4C -_0807CEB0: - bl sub_807F14C - b _0807CF48 -_0807CEB6: - ldr r2, [r7] - adds r0, r2, 0 - adds r0, 0xEE - ldrb r0, [r0] - cmp r0, 0 - beq _0807CEC6 - movs r0, 0x1 - b _0807CFB6 -_0807CEC6: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0807CFB4 - adds r1, r2, 0 - b _0807CF4C - .pool -_0807CEDC: - ldr r0, =0x020375e2 - ldrb r0, [r0] - movs r1, 0 - bl sub_807B4D0 - ldr r1, =0x030061e8 - ldr r0, =sub_807B60C - str r0, [r1] - ldr r7, =0x02032298 - ldrb r0, [r7] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - movs r1, 0x1 - movs r2, 0 - bl GetEvolutionTargetSpecies - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _0807CF48 - ldrb r3, [r7] - adds r0, r3, 0 - muls r0, r6 - adds r0, r5 - ldr r1, =0x020322a0 - ldr r1, [r1] - adds r1, 0x8F - ldrb r2, [r1] - adds r1, r4, 0 - bl sub_813E1D4 - b _0807CF48 - .pool -_0807CF38: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 -_0807CF44: - bl pal_fade_maybe -_0807CF48: - ldr r0, =0x020322a0 - ldr r1, [r0] -_0807CF4C: - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0807CFB4 - .pool -_0807CF5C: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0807CFB4 - ldr r0, [r7] - adds r0, 0xF4 - ldrh r0, [r0] - bl current_map_music_set - ldr r0, [r7] - cmp r0, 0 - beq _0807CFAA - bl FreeAllWindowBuffers - movs r0, 0x3 - bl GetBgTilemapBuffer - bl Free - movs r0, 0x1 - bl GetBgTilemapBuffer - bl Free - movs r0, 0 - bl GetBgTilemapBuffer - bl Free - bl sub_805F094 - ldr r0, [r7] - bl Free - str r4, [r7] -_0807CFAA: - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - bl sub_807E784 -_0807CFB4: - movs r0, 0 -_0807CFB6: - add sp, 0x14 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_807BBEC - - thumb_func_start sub_807CFC8 -sub_807CFC8: @ 807CFC8 - push {r4-r7,lr} - sub sp, 0x14 - ldr r0, =0x020322a0 - ldr r1, [r0] - adds r1, 0x94 - ldrh r5, [r1] - ldr r1, =0x0000010b - adds r7, r0, 0 - cmp r5, r1 - bls _0807CFE0 - bl _0807E400 -_0807CFE0: - lsls r0, r5, 2 - ldr r1, =_0807CFF8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807CFF8: - .4byte _0807D428 - .4byte _0807D4A0 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807D4FC - .4byte _0807D544 - .4byte _0807D5B8 - .4byte _0807E400 - .4byte _0807D624 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807D648 - .4byte _0807D678 - .4byte _0807D68A - .4byte _0807D6AC - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807D7A4 - .4byte _0807D7C4 - .4byte _0807D830 - .4byte _0807D8B4 - .4byte _0807D8D8 - .4byte _0807D924 - .4byte _0807D970 - .4byte _0807D9CC - .4byte _0807DA38 - .4byte _0807DA4C - .4byte _0807DA60 - .4byte _0807DA74 - .4byte _0807DB9C - .4byte _0807DC6C - .4byte _0807DCF4 - .4byte _0807DD94 - .4byte _0807DDA4 - .4byte _0807DDC4 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807DEE8 - .4byte _0807DEF8 - .4byte _0807DF16 - .4byte _0807E400 - .4byte _0807DF3C - .4byte _0807DF7C - .4byte _0807DFBC - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807DFDC - .4byte _0807E004 - .4byte _0807E020 - .4byte _0807E040 - .4byte _0807E0E8 - .4byte _0807E11C - .4byte _0807E168 - .4byte _0807E228 - .4byte _0807E2A0 - .4byte _0807E2EC - .4byte _0807E2FC - .4byte _0807E302 - .4byte _0807E328 - .4byte _0807E384 - .4byte _0807E3A8 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807D6F4 - .4byte _0807D728 - .4byte _0807D77C - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807DE1C - .4byte _0807DE84 - .4byte _0807DEC0 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E264 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807D85C - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E400 - .4byte _0807E284 -_0807D428: - ldr r3, =0x02020630 - ldr r0, [r7] - adds r0, 0x8E - ldrb r1, [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] - ldr r4, [r7] - adds r2, r4, 0 - adds r2, 0x8E - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldr r1, =0x0000ff4c - strh r1, [r0, 0x24] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldr r2, =gUnknown_08300D38 - adds r0, r4, 0 - adds r0, 0xF0 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - strh r0, [r1, 0x26] - adds r1, r4, 0 - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - bl current_map_music_get - ldr r1, [r7] - adds r1, 0xF4 - strh r0, [r1] - ldr r0, =0x00000179 - bl current_map_music_set - bl _0807E400 - .pool -_0807D4A0: - ldr r5, [r7] - adds r6, r5, 0 - adds r6, 0xE6 - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - ble _0807D4D4 - ldr r2, =0x02020630 - adds r0, r5, 0 - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x24] - adds r1, 0x3 - strh r1, [r0, 0x24] - ldrh r0, [r6] - subs r0, 0x3 - strh r0, [r6] - bl _0807E400 - .pool -_0807D4D4: - ldr r2, =0x02020630 - adds r0, r5, 0 - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strh r1, [r0, 0x24] - strh r1, [r6] - adds r1, r5, 0 - adds r1, 0x94 - movs r0, 0xA - strh r0, [r1] - bl _0807E400 - .pool -_0807D4FC: - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EE942 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_807F1A8 - ldr r4, =0x020322a0 - ldr r0, [r4] - adds r2, r0, 0 - adds r2, 0xF0 - ldrh r1, [r2] - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - beq _0807D52A - adds r0, r1, 0 - movs r1, 0 - bl cry_related -_0807D52A: - ldr r3, [r4] - adds r1, r3, 0 - adds r1, 0x94 - movs r2, 0 - movs r0, 0xB - bl _0807E252 - .pool -_0807D544: - ldr r1, [r7] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x50 - beq _0807D554 - bl _0807E400 -_0807D554: - adds r0, r1, 0 - adds r0, 0x8E - ldrb r0, [r0] - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1, 0x5] - lsrs r1, 4 - movs r2, 0x2 - str r2, [sp] - movs r2, 0x1 - str r2, [sp, 0x4] - movs r2, 0x14 - str r2, [sp, 0x8] - ldr r2, =0x000fffff - str r2, [sp, 0xC] - movs r2, 0x78 - movs r3, 0x20 - bl sub_807671C - ldr r1, [r7] - adds r1, 0xD2 - strb r0, [r1] - ldr r1, [r7] - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EE959 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_807F1A8 - bl _0807E400 - .pool -_0807D5B8: - ldr r5, =0x02020630 - ldr r0, [r7] - adds r0, 0xD2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r5, 0 - adds r4, 0x1C - adds r0, r4 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - beq _0807D5D8 - bl _0807E400 -_0807D5D8: - ldr r0, =gUnknown_08338D28 - movs r1, 0x78 - movs r2, 0x20 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0xD3 - strb r0, [r1] - ldr r2, [r7] - adds r0, r2, 0 - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_807E5D8 - str r1, [r0] - adds r2, 0xD2 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - ldr r1, [r7] - bl _0807E398 - .pool -_0807D624: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x94 - movs r1, 0x14 - strh r1, [r0] - bl _0807E400 - .pool -_0807D648: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807D658 - bl _0807E400 -_0807D658: - movs r0, 0x4 - bl sub_807B62C - movs r0, 0 - movs r1, 0xFF - bl FillWindowPixelBuffer - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - bl _0807E394 - .pool -_0807D678: - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0x10 - movs r3, 0 - bl _0807E390 -_0807D68A: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807D69A - bl _0807E400 -_0807D69A: - ldr r0, [r7] - adds r0, 0x94 - movs r1, 0x17 - strh r1, [r0] - bl _0807E400 - .pool -_0807D6AC: - ldr r4, =0x020322a0 - ldr r0, [r4] - adds r2, r0, 0 - adds r2, 0xEA - ldrh r1, [r2] - movs r0, 0x80 - lsls r0, 1 - cmp r1, r0 - bls _0807D6CC - adds r0, r1, 0 - subs r0, 0x34 - strh r0, [r2] - b _0807D6E6 - .pool -_0807D6CC: - movs r0, 0x1 - bl sub_807B62C - ldr r3, [r4] - adds r1, r3, 0 - adds r1, 0xEA - movs r2, 0 - movs r0, 0x80 - strh r0, [r1] - subs r1, 0x56 - movs r0, 0x7C - strh r0, [r1] - str r2, [r3, 0x64] -_0807D6E6: - ldr r0, =0x020322a0 - ldr r4, [r0] - bl _0807DFA8 - .pool -_0807D6F4: - ldr r1, [r7] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x14 - bhi _0807D704 - bl _0807E400 -_0807D704: - movs r0, 0x3 - bl sub_807B62C - ldr r0, =gUnknown_08338E8C - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0x91 - strb r0, [r1] - ldr r1, [r7] - bl _0807E398 - .pool -_0807D728: - ldr r2, =0x02020630 - ldr r0, [r7] - adds r0, 0x91 - 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 - blt _0807D748 - bl _0807E400 -_0807D748: - adds r0, r1, 0 - bl RemoveObjectAndFreeTiles - ldr r1, =0x00000452 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x82 - lsls r1, 3 - movs r0, 0x52 - bl SetGpuReg - ldr r0, =c3_08054588 - movs r1, 0x5 - bl CreateTask - ldr r1, [r7] - bl _0807E398 - .pool -_0807D77C: - ldr r0, =c3_08054588 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - beq _0807D78C - bl _0807E400 -_0807D78C: - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x94 - movs r1, 0x1A - strh r1, [r0] - bl _0807E400 - .pool -_0807D7A4: - ldr r2, [r7] - adds r0, r2, 0 - adds r0, 0xE0 - ldrh r1, [r0] - subs r1, 0x1 - strh r1, [r0] - lsls r1, 16 - movs r0, 0x9E - lsls r0, 17 - cmp r1, r0 - beq _0807D7BE - bl _0807E400 -_0807D7BE: - adds r1, r2, 0 - bl _0807E398 -_0807D7C4: - ldr r0, =gUnknown_08338D88 - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0x3 - bl AddObjectToFront - ldr r4, =0x020322a0 - ldr r1, [r4] - adds r1, 0x90 - strb r0, [r1] - ldr r5, =0x02020630 - ldr r0, [r4] - adds r0, 0x90 - 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_807AA4C - str r1, [r0] - ldr r0, =gUnknown_08338DC8 - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r4] - adds r1, 0x91 - strb r0, [r1] - ldr r0, [r4] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x1 - bl StartObjectImageAnim - ldr r1, [r4] - bl _0807E398 - .pool -_0807D830: - ldr r2, [r7] - adds r1, r2, 0 - adds r1, 0xE0 - ldrh r0, [r1] - subs r0, 0x3 - strh r0, [r1] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA6 - bne _0807D84A - subs r1, 0x4C - movs r0, 0xC8 - strh r0, [r1] -_0807D84A: - ldr r1, =0x00001241 - movs r0, 0 - bl SetGpuReg - bl _0807E400 - .pool -_0807D85C: - ldr r2, =0x02020630 - ldr r4, [r7] - adds r3, r4, 0 - adds r3, 0x90 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - subs r1, 0x2 - strh r1, [r0, 0x22] - adds r0, r4, 0 - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - subs r1, 0x2 - strh r1, [r0, 0x22] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r2, 0x22 - ldrsh r1, [r0, r2] - movs r0, 0x8 - negs r0, r0 - cmp r1, r0 - blt _0807D8A2 - bl _0807E400 -_0807D8A2: - adds r1, r4, 0 - adds r1, 0x94 - movs r0, 0x1D - strh r0, [r1] - bl _0807E400 - .pool -_0807D8B4: - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x94 - movs r1, 0x1E - strh r1, [r0] - bl _0807E400 - .pool -_0807D8D8: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807D8E8 - bl _0807E400 -_0807D8E8: - ldr r0, [r7] - adds r0, 0x90 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r0, [r7] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - movs r0, 0x2 - bl sub_807B62C - ldr r1, [r7] - bl _0807E398 - .pool -_0807D924: - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r5, =gUnknown_08338DC8 - adds r0, r5, 0 - movs r1, 0x6F - movs r2, 0xAA - movs r3, 0 - bl AddObjectToFront - ldr r4, =0x020322a0 - ldr r1, [r4] - adds r1, 0x90 - strb r0, [r1] - movs r2, 0xA - negs r2, r2 - adds r0, r5, 0 - movs r1, 0x81 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r4] - adds r1, 0x91 - strb r0, [r1] - ldr r1, [r4] - bl _0807E398 - .pool -_0807D970: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0807D98E - movs r0, 0x2E - bl audio_play - ldr r0, =0x020322a0 - ldr r1, [r0] - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0807D98E: - ldr r3, =0x02020630 - ldr r0, =0x020322a0 - ldr r2, [r0] - adds r0, r2, 0 - adds r0, 0x90 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x26] - subs r1, 0x3 - strh r1, [r0, 0x26] - adds r2, 0x91 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x26] - adds r1, 0x3 - strh r1, [r0, 0x26] - bl _0807E400 - .pool -_0807D9CC: - ldr r5, =0x02020630 - ldr r4, [r7] - adds r2, r4, 0 - adds r2, 0x90 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r0, 0x26] - subs r1, 0x3 - strh r1, [r0, 0x26] - adds r6, r4, 0 - adds r6, 0x91 - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r0, 0x26] - adds r1, 0x3 - strh r1, [r0, 0x26] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, r0, r5 - movs r0, 0x26 - ldrsh r1, [r3, r0] - movs r0, 0x5A - negs r0, r0 - cmp r1, r0 - ble _0807DA12 - bl _0807E400 -_0807DA12: - movs r2, 0x1 - strh r2, [r3, 0x30] - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x30] - adds r1, r4, 0 - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - ldr r0, =c3_0805465C - b _0807DC5A - .pool -_0807DA38: - ldr r2, =0x0000ffff - movs r0, 0x8 - movs r1, 0x10 - bl sub_80A2A20 - bl _0807E394 - .pool -_0807DA4C: - ldr r2, =0x0000ffff - movs r0, 0x8 - movs r1, 0x10 - bl sub_80A2A20 - bl _0807E394 - .pool -_0807DA60: - ldr r2, =0x0000ffff - movs r0, 0x8 - movs r1, 0x10 - bl sub_80A2A20 - bl _0807E394 - .pool -_0807DA74: - ldr r5, =0x020322a0 - ldr r0, [r5] - adds r0, 0xF0 - ldrh r0, [r0] - bl sub_806E840 - lsls r0, 24 - cmp r0, 0 - bne _0807DAEC - ldr r4, =0x02020630 - ldr r2, [r5] - adds r2, 0x8E - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x10 - adds r0, r1 - ldr r1, =gUnknown_08338ECC - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x1] - movs r2, 0x3 - orrs r1, r2 - strb r1, [r0, 0x1] - ldr r0, [r5] - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0 - movs r2, 0x3 - movs r3, 0x3 - bl CalcVecFromObjectCenterToObjectUpperLeft - ldr r0, [r5] - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0 - bl StartObjectRotScalAnim - b _0807DB02 - .pool -_0807DAEC: - ldr r0, [r5] - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0 - bl StartObjectRotScalAnim -_0807DB02: - ldr r5, =0x020322a0 - ldr r0, [r5] - adds r0, 0x8F - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - movs r1, 0 - bl StartObjectRotScalAnim - ldr r2, [r5] - adds r3, r2, 0 - adds r3, 0x8E - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x28 - strh r1, [r0, 0x20] - adds r2, 0x8F - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xC8 - strh r1, [r0, 0x20] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xC0 - strh r1, [r0, 0x22] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000ffe0 - strh r1, [r0, 0x22] - ldrb r0, [r3] - 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] - adds r0, 0x8F - ldrb r1, [r0] - 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] - ldr r1, [r5] - bl _0807E398 - .pool -_0807DB9C: - ldr r4, =0x02020630 - ldr r2, [r7] - adds r3, r2, 0 - adds r3, 0x8E - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x26] - subs r1, 0x3 - movs r5, 0 - strh r1, [r0, 0x26] - adds r2, 0x8F - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x26] - adds r1, 0x3 - strh r1, [r0, 0x26] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x26] - adds r0, 0xA3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bhi _0807DBE4 - movs r0, 0x2D - bl audio_play -_0807DBE4: - ldr r2, [r7] - adds r3, r2, 0 - adds r3, 0x8E - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r6, 0x26 - ldrsh r1, [r0, r6] - movs r0, 0xDE - negs r0, r0 - cmp r1, r0 - blt _0807DC04 - bl _0807E400 -_0807DC04: - adds r0, r2, 0 - adds r0, 0x90 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r5, [r0, 0x30] - adds r0, r2, 0 - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r5, [r0, 0x30] - adds r1, r2, 0 - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - ldrb r1, [r3] - 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, [r7] - adds r0, 0x8F - ldrb r1, [r0] - 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, =sub_807F39C -_0807DC5A: - movs r1, 0x5 - bl CreateTask - b _0807E400 - .pool -_0807DC6C: - ldr r4, =0x02020630 - ldr r2, [r7] - adds r3, r2, 0 - adds r3, 0x90 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x26] - subs r1, 0x3 - strh r1, [r0, 0x26] - adds r2, 0x91 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x26] - adds r1, 0x3 - strh r1, [r0, 0x26] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r2, 0x26 - ldrsh r1, [r0, r2] - movs r0, 0xDE - negs r0, r0 - cmp r1, r0 - ble _0807DCAE - b _0807E400 -_0807DCAE: - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, [r7] - adds r2, r1, 0 - adds r2, 0x94 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x90 - ldrb r1, [r1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r0, [r7] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - b _0807E400 - .pool -_0807DCF4: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807DD02 - b _0807E400 -_0807DD02: - ldr r1, [r7] - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - movs r0, 0x1 - bl sub_807B62C - ldr r0, [r7] - adds r0, 0xE0 - movs r1, 0xA6 - strh r1, [r0] - movs r0, 0x3 - bl sub_807B62C - ldr r0, [r7] - adds r0, 0xE4 - movs r1, 0xCE - lsls r1, 1 - strh r1, [r0] - ldr r0, =gUnknown_08338D88 - movs r4, 0x14 - negs r4, r4 - movs r1, 0x78 - adds r2, r4, 0 - movs r3, 0x3 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0x90 - strb r0, [r1] - ldr r5, =0x02020630 - ldr r0, [r7] - adds r0, 0x90 - 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_807AA4C - str r1, [r0] - ldr r0, =gUnknown_08338DC8 - movs r1, 0x78 - adds r2, r4, 0 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0x91 - strb r0, [r1] - ldr r0, [r7] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x1 - bl StartObjectImageAnim - b _0807E400 - .pool -_0807DD94: - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0x10 - movs r3, 0 - b _0807E390 -_0807DDA4: - movs r1, 0x92 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807DDBC - b _0807E400 -_0807DDBC: - b _0807E394 - .pool -_0807DDC4: - ldr r2, =0x02020630 - ldr r4, [r7] - adds r3, r4, 0 - adds r3, 0x90 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x26] - adds r1, 0x4 - strh r1, [r0, 0x26] - adds r0, r4, 0 - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x26] - adds r1, 0x4 - strh r1, [r0, 0x26] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r6, 0x26 - ldrsh r1, [r0, r6] - movs r2, 0x22 - ldrsh r0, [r0, r2] - adds r1, r0 - cmp r1, 0x40 - beq _0807DE0A - b _0807E400 -_0807DE0A: - adds r0, r4, 0 - adds r0, 0x94 - movs r1, 0x90 - strh r1, [r0] - movs r0, 0 - str r0, [r4, 0x64] - b _0807E400 - .pool -_0807DE1C: - movs r1, 0xB2 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r4, =0x020322a0 - ldr r2, [r4] - adds r1, r2, 0 - adds r1, 0xE0 - ldrh r0, [r1] - adds r0, 0x3 - strh r0, [r1] - adds r1, 0x4 - ldrh r0, [r1] - adds r0, 0x3 - strh r0, [r1] - ldr r0, [r2, 0x64] - adds r0, 0x1 - str r0, [r2, 0x64] - cmp r0, 0xA - bne _0807DE60 - ldr r0, =c3_08054588 - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0x1 - strh r0, [r1, 0xC] -_0807DE60: - ldr r1, [r4] - adds r3, r1, 0 - adds r3, 0xE0 - movs r6, 0 - ldrsh r0, [r3, r6] - movs r2, 0x9E - lsls r2, 1 - cmp r0, r2 - bgt _0807DE74 - b _0807E400 -_0807DE74: - strh r2, [r3] - b _0807E398 - .pool -_0807DE84: - ldr r0, [r7] - adds r0, 0x90 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r0, [r7] - adds r0, 0x91 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r3, [r7] - adds r2, r3, 0 - adds r2, 0x94 - ldrh r0, [r2] - adds r0, 0x1 - movs r1, 0 - strh r0, [r2] - str r1, [r3, 0x64] - b _0807E400 - .pool -_0807DEC0: - ldr r0, =c3_08054588 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _0807DED0 - b _0807E400 -_0807DED0: - ldr r0, =0x020322a0 - ldr r2, [r0] - adds r1, r2, 0 - adds r1, 0x94 - movs r0, 0x2E - strh r0, [r1] - str r3, [r2, 0x64] - b _0807E400 - .pool -_0807DEE8: - ldr r1, [r7] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0xA - beq _0807DEF6 - b _0807E400 -_0807DEF6: - b _0807E398 -_0807DEF8: - ldr r1, [r7] - adds r5, r1, 0 - adds r5, 0xE0 - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - lsls r0, 16 - asrs r0, 16 - movs r6, 0xAE - lsls r6, 1 - cmp r0, r6 - bgt _0807DF12 - b _0807E400 -_0807DF12: - strh r6, [r5] - b _0807E398 -_0807DF16: - ldr r0, =gUnknown_08338E74 - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0 - bl AddObjectToFront - ldr r2, =0x020322a0 - ldr r1, [r2] - adds r1, 0x91 - strb r0, [r1] - ldr r0, [r2] - adds r0, 0x94 - movs r1, 0x32 - strh r1, [r0] - b _0807E400 - .pool -_0807DF3C: - ldr r2, =0x02020630 - ldr r0, [r7] - adds r0, 0x91 - 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 - blt _0807DF5A - b _0807E400 -_0807DF5A: - adds r0, r1, 0 - bl RemoveObjectAndFreeTiles - movs r0, 0x6 - bl sub_807B62C - ldr r1, [r7] - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - movs r0, 0x9F - bl audio_play - b _0807E400 - .pool -_0807DF7C: - ldr r1, [r7] - adds r2, r1, 0 - adds r2, 0xEA - ldrh r3, [r2] - ldr r0, =0x000003ff - cmp r3, r0 - bhi _0807DF98 - adds r0, r3, 0 - adds r0, 0x34 - strh r0, [r2] - b _0807DFA6 - .pool -_0807DF98: - movs r0, 0x80 - lsls r0, 3 - strh r0, [r2] - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0807DFA6: - ldr r4, [r7] -_0807DFA8: - adds r0, r4, 0 - adds r0, 0xEA - ldrh r1, [r0] - movs r0, 0x80 - lsls r0, 8 - bl __divsi3 - adds r4, 0xE8 - strh r0, [r4] - b _0807E400 -_0807DFBC: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x94 - movs r1, 0x3C - strh r1, [r0] - b _0807E400 - .pool -_0807DFDC: - ldr r4, =0x02037fd4 - ldrb r1, [r4, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807DFEA - b _0807E400 -_0807DFEA: - movs r0, 0x5 - bl sub_807B62C - movs r0, 0x7 - bl sub_807B62C - ldrb r0, [r4, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r4, 0x8] - b _0807E394 - .pool -_0807E004: - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - b _0807E390 - .pool -_0807E020: - movs r1, 0xA2 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0807E038 - b _0807E400 -_0807E038: - b _0807E394 - .pool -_0807E040: - ldr r0, =gUnknown_08338D28 - movs r2, 0x8 - negs r2, r2 - movs r1, 0x78 - movs r3, 0 - bl AddObjectToFront - ldr r5, =0x020322a0 - ldr r1, [r5] - adds r1, 0xD3 - movs r6, 0 - strb r0, [r1] - ldr r4, =0x02020630 - ldr r2, [r5] - adds r2, 0xD3 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x4A - strh r1, [r0, 0x34] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_807E6AC - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartObjectImageAnim - ldr r0, [r5] - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x2 - bl StartObjectRotScalAnim - ldr r0, [r5] - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x5] - lsrs r1, 4 - adds r1, 0x10 - movs r0, 0x1 - lsls r0, r1 - ldr r2, =0x0000ffff - movs r1, 0x10 - bl sub_80A2A20 - ldr r2, [r5] - adds r1, r2, 0 - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - str r6, [r2, 0x64] - b _0807E400 - .pool -_0807E0E8: - ldr r2, =0x02020630 - ldr r0, [r7] - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x5] - lsrs r1, 4 - adds r1, 0x10 - movs r0, 0x1 - lsls r0, r1 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r1, [r7] - b _0807E398 - .pool -_0807E11C: - ldr r2, =0x02020630 - ldr r3, [r7] - adds r0, r3, 0 - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - beq _0807E13A - b _0807E400 -_0807E13A: - adds r0, r3, 0 - adds r0, 0xF2 - ldrh r2, [r0] - lsls r0, r2, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - ldr r1, [r1, 0x10] - ldr r3, [r3, 0x6C] - bl DecompressMonPic_DetectFrontOrBack_2 - ldr r1, [r7] - b _0807E398 - .pool -_0807E168: - ldr r4, =0x02020630 - ldr r2, [r7] - adds r6, r2, 0 - adds r6, 0x8F - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r5, 0 - movs r1, 0x78 - strh r1, [r0, 0x20] - ldrb r0, [r6] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldr r3, =gUnknown_08300D38 - adds r2, 0xF2 - ldrh r0, [r2] - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x1] - adds r0, 0x3C - strh r0, [r1, 0x22] - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r5, [r0, 0x24] - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r5, [r0, 0x26] - ldrb r1, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0 - bl StartObjectImageAnim - ldr r3, [r7] - adds r0, r3, 0 - adds r0, 0x8F - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r1, [r1, 0x5] - lsrs r1, 4 - movs r2, 0x2 - str r2, [sp] - movs r2, 0x1 - str r2, [sp, 0x4] - movs r2, 0x14 - str r2, [sp, 0x8] - ldr r2, =0x000fffff - str r2, [sp, 0xC] - adds r3, 0xF2 - ldrh r2, [r3] - str r2, [sp, 0x10] - movs r2, 0x78 - movs r3, 0x54 - bl sub_8076438 - ldr r0, [r7] - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl obj_free_rotscale_entry - ldr r0, [r7] - adds r0, 0xD3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r1, [r7] - b _0807E398 - .pool -_0807E228: - movs r1, 0xAA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EE966 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_807F1A8 - ldr r0, =0x020322a0 - ldr r3, [r0] - adds r1, r3, 0 - adds r1, 0x94 - movs r2, 0 - movs r0, 0xA7 -_0807E252: - strh r0, [r1] - str r2, [r3, 0x64] - b _0807E400 - .pool -_0807E264: - ldr r3, [r7] - ldr r0, [r3, 0x64] - adds r0, 0x1 - str r0, [r3, 0x64] - cmp r0, 0x3C - bhi _0807E272 - b _0807E400 -_0807E272: - adds r0, r3, 0 - adds r0, 0x94 - movs r2, 0 - ldr r1, =0x0000010b - strh r1, [r0] - str r2, [r3, 0x64] - b _0807E400 - .pool -_0807E284: - bl sub_80A3678 - lsls r0, 24 - cmp r0, 0 - bne _0807E290 - b _0807E400 -_0807E290: - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x94 - movs r1, 0x44 - strh r1, [r0] - b _0807E400 - .pool -_0807E2A0: - ldr r1, [r7] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0xA - bne _0807E2B2 - ldr r0, =0x00000173 - bl fanfare_play -_0807E2B2: - ldr r1, [r7] - ldr r0, [r1, 0x64] - cmp r0, 0xFA - beq _0807E2BC - b _0807E400 -_0807E2BC: - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - movs r5, 0 - strh r0, [r1] - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EE977 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_807F1A8 - ldr r0, [r7] - str r5, [r0, 0x64] - b _0807E400 - .pool -_0807E2EC: - ldr r1, [r7] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x3C - beq _0807E2FA - b _0807E400 -_0807E2FA: - b _0807E398 -_0807E2FC: - bl sub_807F14C - b _0807E394 -_0807E302: - ldr r2, [r7] - adds r0, r2, 0 - adds r0, 0xEE - ldrb r0, [r0] - cmp r0, 0 - beq _0807E312 - movs r0, 0x1 - b _0807E402 -_0807E312: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0807E400 - adds r1, r2, 0 - b _0807E398 - .pool -_0807E328: - ldr r0, =0x020375e2 - ldrb r0, [r0] - movs r1, 0 - bl sub_807B4D0 - ldr r1, =0x030061e8 - ldr r0, =sub_807B60C - str r0, [r1] - ldr r7, =0x02032298 - ldrb r0, [r7] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - movs r1, 0x1 - movs r2, 0 - bl GetEvolutionTargetSpecies - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _0807E394 - ldrb r3, [r7] - adds r0, r3, 0 - muls r0, r6 - adds r0, r5 - ldr r1, =0x020322a0 - ldr r1, [r1] - adds r1, 0x8F - ldrb r2, [r1] - adds r1, r4, 0 - bl sub_813E1D4 - b _0807E394 - .pool -_0807E384: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 -_0807E390: - bl pal_fade_maybe -_0807E394: - ldr r0, =0x020322a0 - ldr r1, [r0] -_0807E398: - adds r1, 0x94 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0807E400 - .pool -_0807E3A8: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0807E400 - ldr r0, [r7] - adds r0, 0xF4 - ldrh r0, [r0] - bl current_map_music_set - ldr r0, [r7] - cmp r0, 0 - beq _0807E3F6 - bl FreeAllWindowBuffers - movs r0, 0x3 - bl GetBgTilemapBuffer - bl Free - movs r0, 0x1 - bl GetBgTilemapBuffer - bl Free - movs r0, 0 - bl GetBgTilemapBuffer - bl Free - bl sub_805F094 - ldr r0, [r7] - bl Free - str r4, [r7] -_0807E3F6: - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - bl sub_807E784 -_0807E400: - movs r0, 0 -_0807E402: - add sp, 0x14 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_807CFC8 - - thumb_func_start c2_08053788 -c2_08053788: @ 807E414 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0 - beq _0807E434 - cmp r0, 0x4 - beq _0807E444 - b _0807E4B4 - .pool -_0807E434: - movs r0, 0x4 - strb r0, [r1] - ldr r1, =0x03002700 - movs r0, 0x1 - b _0807E4B2 - .pool -_0807E444: - ldr r0, =0x030061e8 - ldr r1, =sub_807EB50 - mov r8, r1 - str r1, [r0] - ldr r7, =0x02032298 - ldrb r0, [r7] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - movs r1, 0x1 - movs r2, 0 - bl GetEvolutionTargetSpecies - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _0807E494 - ldrb r3, [r7] - adds r0, r3, 0 - muls r0, r6 - adds r0, r5 - ldr r1, =0x020322a0 - ldr r1, [r1] - adds r1, 0x8F - ldrb r2, [r1] - adds r1, r4, 0 - bl sub_813E1D4 - b _0807E4AE - .pool -_0807E494: - bl sub_8077260 - cmp r0, 0 - beq _0807E4A8 - ldr r0, =sub_807F464 - bl SetMainCallback2 - b _0807E4AE - .pool -_0807E4A8: - mov r0, r8 - bl SetMainCallback2 -_0807E4AE: - ldr r1, =0x02032298 - movs r0, 0xFF -_0807E4B2: - strb r0, [r1] -_0807E4B4: - bl sub_800B33C - lsls r0, 24 - cmp r0, 0 - bne _0807E4C2 - bl RunTasks -_0807E4C2: - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end c2_08053788 - - thumb_func_start sub_807E4DC -sub_807E4DC: @ 807E4DC - push {r4-r6,lr} - bl sub_807ACDC - bl sub_800A550 - lsls r0, 24 - lsrs r5, r0, 24 - movs r6, 0x1 - adds r0, r5, 0 - ands r0, r6 - cmp r0, 0 - beq _0807E51A - ldr r4, =0x020223c4 - ldrh r1, [r4] - ldr r0, =0x0000dcba - cmp r1, r0 - bne _0807E504 - ldr r0, =c2_08053788 - bl SetMainCallback2 -_0807E504: - ldrh r1, [r4] - ldr r0, =0x0000abcd - cmp r1, r0 - bne _0807E514 - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x72 - strb r6, [r0] -_0807E514: - movs r0, 0 - bl sub_800A5EC -_0807E51A: - movs r0, 0x2 - ands r0, r5 - cmp r0, 0 - beq _0807E542 - ldr r0, =0x020223c4 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - ldrh r1, [r0] - ldr r0, =0x0000abcd - cmp r1, r0 - bne _0807E53C - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x73 - movs r1, 0x1 - strb r1, [r0] -_0807E53C: - movs r0, 0x1 - bl sub_800A5EC -_0807E542: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807E4DC - - thumb_func_start sub_807E55C -sub_807E55C: @ 807E55C - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - movs r1, 0xA - bl __divsi3 - ldrh r4, [r5, 0x22] - adds r4, r0 - strh r4, [r5, 0x22] - ldrh r0, [r5, 0x30] - ldrh r2, [r5, 0x38] - adds r0, r2 - strh r0, [r5, 0x38] - movs r1, 0x38 - ldrsh r0, [r5, r1] - movs r1, 0xA - bl __divsi3 - strh r0, [r5, 0x20] - lsls r4, 16 - asrs r4, 16 - cmp r4, 0x4C - ble _0807E5AA - movs r0, 0x4C - strh r0, [r5, 0x22] - movs r2, 0x2E - ldrsh r1, [r5, r2] - movs r2, 0x32 - ldrsh r0, [r5, r2] - muls r0, r1 - negs r0, r0 - movs r1, 0x64 - bl __divsi3 - strh r0, [r5, 0x2E] - ldrh r0, [r5, 0x34] - adds r0, 0x1 - strh r0, [r5, 0x34] -_0807E5AA: - movs r1, 0x20 - ldrsh r0, [r5, r1] - cmp r0, 0x78 - bne _0807E5B6 - movs r0, 0 - strh r0, [r5, 0x30] -_0807E5B6: - ldrh r0, [r5, 0x36] - ldrh r2, [r5, 0x2E] - adds r0, r2 - strh r0, [r5, 0x2E] - movs r1, 0x34 - ldrsh r0, [r5, r1] - cmp r0, 0x4 - bne _0807E5CE - movs r0, 0x1 - strh r0, [r5, 0x3C] - ldr r0, =DummyObjectCallback - str r0, [r5, 0x1C] -_0807E5CE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807E55C - - thumb_func_start sub_807E5D8 -sub_807E5D8: @ 807E5D8 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldr r1, =gUnknown_08339024 - movs r2, 0x2E - ldrsh r0, [r4, r2] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0x16 - bne _0807E600 - movs r0, 0x38 - bl audio_play -_0807E600: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2C - bne _0807E636 - movs r0, 0x8C - bl audio_play - ldr r0, =sub_807E64C - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x2E] - ldrb r1, [r4, 0x5] - lsrs r1, 4 - adds r1, 0x10 - movs r0, 0x1 - lsls r0, r1 - movs r1, 0x1 - negs r1, r1 - ldr r2, =0x0000ffff - str r2, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe -_0807E636: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807E5D8 - - thumb_func_start sub_807E64C -sub_807E64C: @ 807E64C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0x14 - bne _0807E660 - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim -_0807E660: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _0807E69E - ldr r1, =gUnknown_08339024 - movs r2, 0x2E - ldrsh r0, [r4, r2] - adds r0, r1 - movs r1, 0 - ldrsb r1, [r0, r1] - ldrh r0, [r4, 0x26] - subs r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x17 - bne _0807E69E - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - ldr r0, =0x020322a0 - ldr r0, [r0] - adds r0, 0x94 - movs r1, 0xE - strh r1, [r0] -_0807E69E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807E64C - - thumb_func_start sub_807E6AC -sub_807E6AC: @ 807E6AC - push {r4,lr} - adds r4, r0, 0 - ldrh r2, [r4, 0x32] - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0807E6DC - ldrh r0, [r4, 0x22] - adds r0, 0x4 - strh r0, [r4, 0x22] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x34 - ldrsh r1, [r4, r3] - cmp r0, r1 - ble _0807E72C - adds r0, r2, 0x1 - strh r0, [r4, 0x32] - movs r0, 0x16 - strh r0, [r4, 0x2E] - movs r0, 0x38 - bl audio_play - b _0807E72C -_0807E6DC: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x42 - bne _0807E6EA - movs r0, 0x39 - bl audio_play -_0807E6EA: - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0x5C - bne _0807E6F8 - movs r0, 0x3A - bl audio_play -_0807E6F8: - movs r3, 0x2E - ldrsh r0, [r4, r3] - cmp r0, 0x6B - bne _0807E706 - movs r0, 0x3B - bl audio_play -_0807E706: - ldr r1, =gUnknown_08339024 - movs r2, 0x2E - ldrsh r0, [r4, r2] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrh r3, [r4, 0x26] - adds r0, r3 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6C - bne _0807E72C - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] -_0807E72C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807E6AC - - thumb_func_start sub_807E73C -sub_807E73C: @ 807E73C - push {r4-r6,lr} - ldr r0, =0x020375e0 - ldrh r0, [r0] - lsls r4, r0, 4 - subs r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_08338ED0 - adds r4, r0 - ldr r0, =0x02021cc4 - ldrh r1, [r4, 0x38] - movs r6, 0xB - muls r1, r6 - ldr r5, =gSpeciesNames - adds r1, r5 - bl CopyString - ldr r0, =0x02021dc4 - ldrh r1, [r4, 0xC] - muls r1, r6 - adds r1, r5 - bl CopyString - ldrh r0, [r4, 0x38] - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_807E73C - - thumb_func_start sub_807E784 -sub_807E784: @ 807E784 - push {r4,lr} - sub sp, 0x20 - ldr r0, =0x020375e0 - ldrh r0, [r0] - lsls r4, r0, 4 - subs r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_08338ED0 - adds r4, r0 - ldr r0, =0x020375e2 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - ldr r0, =0x02021cc4 - mov r1, sp - bl CopyString_Limit10 - ldr r0, =0x02021dc4 - ldrh r2, [r4, 0xC] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - add sp, 0x20 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807E784 - - thumb_func_start sub_807E7E8 -sub_807E7E8: @ 807E7E8 - push {r4-r7,lr} - sub sp, 0x38 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, r1, 4 - subs r2, r1 - lsls r2, 2 - ldr r1, =gUnknown_08338ED0 - adds r5, r2, r1 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x38 - bl pokemon_getattr - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - add r4, sp, 0x34 - movs r0, 0xFE - strb r0, [r4] - ldr r6, =0x02024744 - ldrh r1, [r5, 0xC] - movs r3, 0x1 - str r3, [sp] - ldr r0, [r5, 0x24] - str r0, [sp, 0x4] - str r3, [sp, 0x8] - ldr r0, [r5, 0x18] - str r0, [sp, 0xC] - adds r0, r6, 0 - movs r3, 0x20 - bl create_pokemon_set_level - adds r2, r5, 0 - adds r2, 0xE - adds r0, r6, 0 - movs r1, 0x27 - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0xF - adds r0, r6, 0 - movs r1, 0x28 - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x10 - adds r0, r6, 0 - movs r1, 0x29 - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x11 - adds r0, r6, 0 - movs r1, 0x2A - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x12 - adds r0, r6, 0 - movs r1, 0x2B - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x13 - adds r0, r6, 0 - movs r1, 0x2C - bl pokemon_setattr - adds r0, r6, 0 - movs r1, 0x2 - adds r2, r5, 0 - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x2B - adds r0, r6, 0 - movs r1, 0x7 - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x36 - adds r0, r6, 0 - movs r1, 0x31 - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x14 - adds r0, r6, 0 - movs r1, 0x2E - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x1D - adds r0, r6, 0 - movs r1, 0x17 - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x1E - adds r0, r6, 0 - movs r1, 0x18 - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x1C - adds r0, r6, 0 - movs r1, 0x16 - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x1F - adds r0, r6, 0 - movs r1, 0x21 - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x20 - adds r0, r6, 0 - movs r1, 0x2F - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x37 - adds r0, r6, 0 - movs r1, 0x30 - bl pokemon_setattr - adds r0, r6, 0 - movs r1, 0x23 - adds r2, r4, 0 - bl pokemon_setattr - mov r4, sp - adds r4, 0x35 - movs r0, 0 - strb r0, [r4] - ldrh r0, [r5, 0x28] - cmp r0, 0 - beq _0807E960 - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _0807E954 - add r0, sp, 0x10 - adds r1, r5, 0 - bl sub_807E974 - ldr r0, =0x020321c0 - add r1, sp, 0x10 - ldm r1!, {r2,r3,r7} - stm r0!, {r2,r3,r7} - ldm r1!, {r2,r3,r7} - stm r0!, {r2,r3,r7} - ldm r1!, {r2,r3,r7} - stm r0!, {r2,r3,r7} - adds r0, r6, 0 - movs r1, 0x40 - adds r2, r4, 0 - bl pokemon_setattr - adds r2, r5, 0 - adds r2, 0x28 - adds r0, r6, 0 - movs r1, 0xC - bl pokemon_setattr - b _0807E960 - .pool -_0807E954: - adds r2, r5, 0 - adds r2, 0x28 - adds r0, r6, 0 - movs r1, 0xC - bl pokemon_setattr -_0807E960: - ldr r0, =0x02024744 - bl pokemon_calc_effective_stats - add sp, 0x38 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807E7E8 - - thumb_func_start sub_807E974 -sub_807E974: @ 807E974 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - ldr r2, =gUnknown_08338FC0 - adds r0, r6, 0 - adds r0, 0x2A - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, r0, r2 - adds r1, r5, 0 - movs r3, 0x8 -_0807E98E: - ldrh r0, [r2] - strh r0, [r1] - adds r2, 0x2 - adds r1, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _0807E98E - adds r4, r5, 0 - adds r4, 0x12 - adds r1, r6, 0 - adds r1, 0x2B - adds r0, r4, 0 - bl CopyString - adds r0, r4, 0 - movs r1, 0 - bl sub_81DB4DC - ldr r1, [r6, 0x18] - lsrs r0, r1, 24 - strb r0, [r5, 0x1A] - lsrs r0, r1, 16 - strb r0, [r5, 0x1B] - lsrs r0, r1, 8 - strb r0, [r5, 0x1C] - strb r1, [r5, 0x1D] - ldrh r0, [r6, 0xC] - strh r0, [r5, 0x1E] - ldrh r0, [r6, 0x28] - strh r0, [r5, 0x20] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807E974 - - thumb_func_start sub_807E9D4 -sub_807E9D4: @ 807E9D4 - push {r4-r6,lr} - ldr r6, =0x020375e2 - ldrh r0, [r6] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0807EA08 - ldrh r0, [r6] - muls r0, r5 - adds r0, r4 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - b _0807EA0A - .pool -_0807EA08: - movs r0, 0 -_0807EA0A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_807E9D4 - - thumb_func_start sub_807EA10 -sub_807EA10: @ 807EA10 - push {lr} - ldr r0, =0x020375e2 - ldrb r0, [r0] - ldr r1, =0x020375e0 - ldrb r1, [r1] - bl sub_807E7E8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_807EA10 - - thumb_func_start sub_807EA2C -sub_807EA2C: @ 807EA2C - push {r4-r6,lr} - bl sub_807BBC8 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x1 - bne _0807EA96 - ldr r5, =0x020322a0 - ldr r0, [r5] - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r0, [r5] - adds r0, 0x8F - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl obj_free_rotscale_entry - ldr r0, =0x02032298 - ldrb r4, [r0] - ldrb r0, [r0, 0x1] - movs r1, 0x6 - bl __umodsi3 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_807B4D0 - bl sub_8077260 - cmp r0, 0 - bne _0807EA90 - ldr r0, [r5] - adds r2, r0, 0 - adds r2, 0x74 - ldr r1, =0x0000abcd - strh r1, [r2] - adds r0, 0x93 - strb r6, [r0] -_0807EA90: - ldr r0, =sub_807EACC - bl SetMainCallback2 -_0807EA96: - bl sub_807B5B8 - bl sub_807E4DC - bl RunTasks - bl RunTextPrinters - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807EA2C - - thumb_func_start sub_807EACC -sub_807EACC: @ 807EACC - push {r4,lr} - bl sub_807ACDC - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8077260 - cmp r0, 0 - beq _0807EAEC - ldr r0, =c2_08053788 - bl SetMainCallback2 - b _0807EB2C - .pool -_0807EAEC: - bl sub_807E4DC - cmp r4, 0 - bne _0807EB2C - ldr r4, =0x020322a0 - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0x72 - ldrh r1, [r0] - ldr r0, =0x00000101 - cmp r1, r0 - bne _0807EB2C - adds r1, r2, 0 - adds r1, 0x74 - ldr r0, =0x0000dcba - strh r0, [r1] - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, [r4] - adds r1, 0x74 - movs r2, 0x14 - bl link_0800A448 - ldr r0, [r4] - adds r0, 0x72 - movs r1, 0x2 - strb r1, [r0] - ldr r0, [r4] - adds r0, 0x73 - strb r1, [r0] -_0807EB2C: - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807EACC - - thumb_func_start sub_807EB50 -sub_807EB50: @ 807EB50 - push {r4,lr} - sub sp, 0x4 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0x65 - bls _0807EB66 - b _0807F03A -_0807EB66: - lsls r0, 2 - ldr r1, =_0807EB78 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807EB78: - .4byte _0807ED10 - .4byte _0807ED2C - .4byte _0807ED98 - .4byte _0807F03A - .4byte _0807EE78 - .4byte _0807EF3C - .4byte _0807EF64 - .4byte _0807EF7E - .4byte _0807EFA4 - .4byte _0807EFF0 - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807EE9C - .4byte _0807EEEC - .4byte _0807EF1A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807EDC0 - .4byte _0807EE1C - .4byte _0807EE38 - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807F03A - .4byte _0807ED44 - .4byte _0807ED7C -_0807ED10: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EF6D2 - b _0807EDA6 - .pool -_0807ED2C: - movs r0, 0 - bl sub_8077288 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r2, 0 - movs r1, 0x64 - b _0807EE88 - .pool -_0807ED44: - ldr r0, =0x020322a0 - ldr r3, [r0] - ldr r0, [r3, 0x64] - adds r0, 0x1 - str r0, [r3, 0x64] - cmp r0, 0xB4 - bls _0807ED60 - movs r1, 0x87 - lsls r1, 3 - adds r0, r2, r1 - movs r2, 0 - movs r1, 0x65 - strb r1, [r0] - str r2, [r3, 0x64] -_0807ED60: - bl sub_8077294 - cmp r0, 0 - bne _0807ED6A - b _0807F03A -_0807ED6A: - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - b _0807ED8E - .pool -_0807ED7C: - bl sub_8077294 - cmp r0, 0 - bne _0807ED86 - b _0807F03A -_0807ED86: - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 -_0807ED8E: - movs r1, 0x2 - strb r1, [r0] - b _0807F03A - .pool -_0807ED98: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - movs r0, 0x32 - strb r0, [r1] - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_082C8959 -_0807EDA6: - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_807F1A8 - b _0807F03A - .pool -_0807EDC0: - bl InUnionRoom - cmp r0, 0 - bne _0807EDCE - movs r0, 0x15 - bl sav12_xor_increment -_0807EDCE: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _0807EDF6 - ldr r4, =0x020229e8 - bl link_get_multiplayer_id - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r4, 0x4 - adds r1, r4 - ldr r1, [r1] - movs r0, 0x2 - bl sub_801B990 -_0807EDF6: - bl sub_8076D5C - bl sub_8153380 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - ldrb r0, [r1] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1] - b _0807EE8A - .pool -_0807EE1C: - ldr r0, =0x020322a0 - ldr r1, [r0] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x5 - beq _0807EE2C - b _0807F03A -_0807EE2C: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - b _0807EFE4 - .pool -_0807EE38: - bl sub_81533AC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _0807EE5C - bl sav2_gender2_inplace_and_xFE - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0x4 - strb r1, [r0] - b _0807F03A - .pool -_0807EE5C: - ldr r0, =0x020322a0 - ldr r0, [r0] - str r1, [r0, 0x64] - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0x33 - strb r1, [r0] - b _0807F03A - .pool -_0807EE78: - bl sub_81533E0 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r2, 0 - movs r1, 0x28 -_0807EE88: - strb r1, [r0] -_0807EE8A: - ldr r0, =0x020322a0 - ldr r0, [r0] - str r2, [r0, 0x64] - b _0807F03A - .pool -_0807EE9C: - ldr r4, =0x020322a0 - ldr r1, [r4] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x32 - bhi _0807EEAC - b _0807F03A -_0807EEAC: - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _0807EED4 - bl GenerateRandomNumber - ldr r4, [r4] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1E - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - str r0, [r4, 0x64] - b _0807EEDA - .pool -_0807EED4: - ldr r1, [r4] - movs r0, 0 - str r0, [r1, 0x64] -_0807EEDA: - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0x29 - strb r1, [r0] - b _0807F03A - .pool -_0807EEEC: - ldr r0, =0x020322a0 - ldr r1, [r0] - ldr r0, [r1, 0x64] - cmp r0, 0 - bne _0807EF14 - movs r0, 0x1 - bl sub_8077288 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0x2A - strb r1, [r0] - b _0807F03A - .pool -_0807EF14: - subs r0, 0x1 - str r0, [r1, 0x64] - b _0807F03A -_0807EF1A: - bl sub_8077294 - cmp r0, 0 - bne _0807EF24 - b _0807F03A -_0807EF24: - bl sub_8153408 - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0x5 - strb r1, [r0] - b _0807F03A - .pool -_0807EF3C: - ldr r0, =0x020322a0 - ldr r1, [r0] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x3C - bls _0807F03A - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0x2 - bl sub_8077288 - b _0807F03A - .pool -_0807EF64: - bl sub_8077294 - cmp r0, 0 - beq _0807F03A - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _0807EFDC -_0807EF7E: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0807F03A - movs r0, 0x3 - bl play_sound_effect - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0807EFE4 - .pool -_0807EFA4: - bl sub_80A3258 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0807F03A - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _0807EFD8 - ldr r0, =0x030022c0 - ldr r1, [r0, 0x8] - ldr r0, =sub_80773AC - cmp r1, r0 - bne _0807EFD8 - movs r0, 0x3 - bl sub_8077288 - b _0807EFDC - .pool -_0807EFD8: - bl sub_800AC34 -_0807EFDC: - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_0807EFE4: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0807F03A - .pool -_0807EFF0: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _0807F028 - ldr r1, [r2, 0x8] - ldr r0, =sub_80773AC - cmp r1, r0 - bne _0807F028 - bl sub_8077294 - cmp r0, 0 - beq _0807F03A - ldr r0, =0x03002700 - movs r1, 0 - strb r1, [r0] - ldr r0, =c2_080543C4 - bl SetMainCallback2 - b _0807F03A - .pool -_0807F028: - ldr r0, =0x03003124 - ldrb r1, [r0] - cmp r1, 0 - bne _0807F03A - ldr r0, =0x03002700 - strb r1, [r0] - ldr r0, =c2_080543C4 - bl SetMainCallback2 -_0807F03A: - bl sub_800B33C - lsls r0, 24 - cmp r0, 0 - bne _0807F048 - bl RunTasks -_0807F048: - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807EB50 - - thumb_func_start c2_080543C4 -c2_080543C4: @ 807F068 - push {r4,r5,lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0807F0BE - bl FreeAllWindowBuffers - movs r0, 0x3 - bl GetBgTilemapBuffer - bl Free - movs r0, 0x1 - bl GetBgTilemapBuffer - bl Free - movs r0, 0 - bl GetBgTilemapBuffer - bl Free - bl sub_805F094 - ldr r4, =0x020322a0 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _0807F0B6 - bl sub_800E084 -_0807F0B6: - ldr r0, =0x030022c0 - ldr r0, [r0, 0x8] - bl SetMainCallback2 -_0807F0BE: - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end c2_080543C4 - - thumb_func_start sub_807F0E4 -sub_807F0E4: @ 807F0E4 - push {lr} - sub sp, 0x4 - bl script_env_2_enable - ldr r0, =sub_807F110 - movs r1, 0xA - bl CreateTask - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_807F0E4 - - thumb_func_start sub_807F110 -sub_807F110: @ 807F110 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0807F134 - ldr r0, =sub_807B270 - bl SetMainCallback2 - ldr r1, =0x03005dac - ldr r0, =sub_80AF168 - str r0, [r1] - adds r0, r4, 0 - bl DestroyTask -_0807F134: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807F110 - - thumb_func_start sub_807F14C -sub_807F14C: @ 807F14C - push {r4,r5,lr} - movs r5, 0 - movs r4, 0 -_0807F152: - ldr r0, =0x02032298 - ldrb r0, [r0, 0x1] - movs r1, 0x6 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - adds r1, r4, 0 - adds r1, 0x43 - bl pokemon_getattr - adds r0, r5, r0 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xB - bls _0807F152 - cmp r5, 0 - beq _0807F18A - ldr r0, =0x0000089b - bl FlagSet -_0807F18A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807F14C - - thumb_func_start sub_807F19C -sub_807F19C: @ 807F19C - push {lr} - bl sub_807B170 - pop {r0} - bx r0 - thumb_func_end sub_807F19C - - thumb_func_start sub_807F1A8 -sub_807F1A8: @ 807F1A8 - push {r4-r6,lr} - sub sp, 0x14 - adds r5, r0, 0 - adds r6, r1, 0 - adds r4, r2, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0xFF - bl FillWindowPixelBuffer - ldr r2, =0x020322a0 - ldr r0, [r2] - adds r0, 0xF6 - movs r3, 0 - movs r1, 0xF - strb r1, [r0] - ldr r0, [r2] - adds r0, 0xF7 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0xF8 - movs r1, 0x6 - strb r1, [r0] - str r3, [sp] - str r3, [sp, 0x4] - ldr r0, [r2] - adds r0, 0xF6 - str r0, [sp, 0x8] - lsls r4, 24 - asrs r4, 24 - str r4, [sp, 0xC] - str r6, [sp, 0x10] - adds r0, r5, 0 - movs r1, 0x1 - movs r2, 0 - movs r3, 0x2 - bl AddTextPrinterParametrized2 - adds r0, r5, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807F1A8 - - thumb_func_start c3_08054588 -c3_08054588: @ 807F210 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldr r1, =gUnknown_08339090 - movs r2, 0 - ldrsh r0, [r4, r2] - lsls r0, 1 - adds r0, r1 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r2, r1, 0 - movs r3, 0x4 - ldrsh r0, [r4, r3] - cmp r0, 0 - bne _0807F254 - movs r0, 0x80 - lsls r0, 1 - cmp r1, r0 - beq _0807F25C - lsls r0, r1, 1 - ldr r1, =gUnknown_08337AA0 - adds r0, r1 - b _0807F25E - .pool -_0807F254: - movs r0, 0x80 - lsls r0, 1 - cmp r1, r0 - bne _0807F26C -_0807F25C: - ldr r0, =gUnknown_08337EA0 -_0807F25E: - movs r1, 0x30 - movs r2, 0x20 - bl gpu_pal_apply - b _0807F27A - .pool -_0807F26C: - lsls r0, r2, 1 - ldr r1, =gUnknown_08337CA0 - adds r0, r1 - movs r1, 0x30 - movs r2, 0x20 - bl gpu_pal_apply -_0807F27A: - ldr r0, =gUnknown_08339090 - movs r2, 0 - ldrsh r1, [r4, r2] - lsls r1, 1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - bne _0807F298 - movs r3, 0x2 - ldrsh r0, [r4, r3] - cmp r0, 0 - bne _0807F298 - movs r0, 0xC3 - bl audio_play -_0807F298: - movs r0, 0x2 - ldrsh r2, [r4, r0] - ldr r1, =gUnknown_08339090 - movs r3, 0 - ldrsh r0, [r4, r3] - lsls r0, 1 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r2, r0 - bne _0807F2D8 - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - movs r0, 0 - strh r0, [r4, 0x2] - movs r2, 0 - ldrsh r0, [r4, r2] - lsls r0, 1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _0807F2DE - adds r0, r5, 0 - bl DestroyTask - b _0807F2DE - .pool -_0807F2D8: - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] -_0807F2DE: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end c3_08054588 - - thumb_func_start c3_0805465C -c3_0805465C: @ 807F2E4 - 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, =0x03005e08 - adds r5, r0, r1 - movs r0, 0 - ldrsh r4, [r5, r0] - cmp r4, 0 - bne _0807F336 - ldr r2, =0x020322a0 - ldr r0, [r2] - adds r3, r0, 0 - adds r3, 0xFD - movs r1, 0x78 - strb r1, [r3] - adds r0, 0xFB - strb r1, [r0] - ldr r0, [r2] - adds r0, 0xFC - strb r4, [r0] - ldr r0, [r2] - adds r0, 0xFE - movs r1, 0xA0 - strb r1, [r0] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl SetGpuRegBits - movs r0, 0x4A - movs r1, 0x10 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x13 - bl SetGpuReg -_0807F336: - ldr r4, =0x020322a0 - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0xFD - ldrb r1, [r1] - adds r0, 0xFB - ldrb r0, [r0] - lsls r0, 8 - orrs r1, r0 - movs r0, 0x40 - bl SetGpuReg - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0xFE - ldrb r1, [r1] - adds r0, 0xFC - ldrb r0, [r0] - lsls r0, 8 - orrs r1, r0 - movs r0, 0x44 - bl SetGpuReg - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - ldr r1, [r4] - adds r1, 0xFB - ldrb r0, [r1] - subs r0, 0x5 - strb r0, [r1] - ldr r1, [r4] - adds r1, 0xFD - ldrb r0, [r1] - adds r0, 0x5 - strb r0, [r1] - ldr r0, [r4] - adds r0, 0xFB - ldrb r0, [r0] - cmp r0, 0x4F - bhi _0807F38E - adds r0, r6, 0 - bl DestroyTask -_0807F38E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end c3_0805465C - - thumb_func_start sub_807F39C -sub_807F39C: @ 807F39C - 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, =0x03005e08 - adds r5, r0, r1 - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0807F3D8 - ldr r2, =0x020322a0 - ldr r0, [r2] - adds r0, 0xFB - movs r1, 0x50 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0xFD - movs r1, 0xA0 - strb r1, [r0] - movs r0, 0x4A - movs r1, 0x10 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x13 - bl SetGpuReg -_0807F3D8: - ldr r4, =0x020322a0 - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0xFD - ldrb r1, [r1] - adds r0, 0xFB - ldrb r0, [r0] - lsls r0, 8 - orrs r1, r0 - movs r0, 0x40 - bl SetGpuReg - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0xFE - ldrb r1, [r1] - adds r0, 0xFC - ldrb r0, [r0] - lsls r0, 8 - orrs r1, r0 - movs r0, 0x44 - bl SetGpuReg - ldr r0, [r4] - adds r0, 0xFB - ldrb r0, [r0] - cmp r0, 0x78 - beq _0807F44C - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - ldr r1, [r4] - adds r1, 0xFB - ldrb r0, [r1] - adds r0, 0x5 - strb r0, [r1] - ldr r1, [r4] - adds r1, 0xFD - ldrb r0, [r1] - subs r0, 0x5 - strb r0, [r1] - ldr r0, [r4] - adds r0, 0xFB - ldrb r0, [r0] - cmp r0, 0x73 - bls _0807F45C - ldr r2, =0x0000ffff - movs r0, 0x8 - movs r1, 0 - bl sub_80A2A20 - b _0807F45C - .pool -_0807F44C: - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl ClearGpuRegBits - adds r0, r6, 0 - bl DestroyTask -_0807F45C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_807F39C - - thumb_func_start sub_807F464 -sub_807F464: @ 807F464 - push {r4,r5,lr} - sub sp, 0x4 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0xC - bls _0807F47A - b _0807F70C -_0807F47A: - lsls r0, 2 - ldr r1, =_0807F48C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807F48C: - .4byte _0807F4C0 - .4byte _0807F4E8 - .4byte _0807F500 - .4byte _0807F550 - .4byte _0807F570 - .4byte _0807F5AC - .4byte _0807F5D0 - .4byte _0807F620 - .4byte _0807F64E - .4byte _0807F66C - .4byte _0807F694 - .4byte _0807F6C4 - .4byte _0807F6F8 -_0807F4C0: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - movs r0, 0x1 - strb r0, [r1] - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EF6D2 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_807F1A8 - b _0807F70C - .pool -_0807F4E8: - movs r0, 0 - bl sub_8077288 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r2, 0 - movs r1, 0x2 - b _0807F5BC - .pool -_0807F500: - bl sub_8077294 - cmp r0, 0 - bne _0807F50A - b _0807F70C -_0807F50A: - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r5, 0 - movs r1, 0x3 - strb r1, [r0] - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_082C8959 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_807F1A8 - movs r0, 0x15 - bl sav12_xor_increment - bl sub_8153380 - ldr r0, =0x020322a0 - ldr r0, [r0] - str r5, [r0, 0x64] - b _0807F70C - .pool -_0807F550: - ldr r0, =0x020322a0 - ldr r1, [r0] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x5 - beq _0807F560 - b _0807F70C -_0807F560: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - movs r0, 0x4 - strb r0, [r1] - b _0807F70C - .pool -_0807F570: - bl sub_81533AC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _0807F590 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0x5 - strb r1, [r0] - b _0807F70C - .pool -_0807F590: - ldr r0, =0x020322a0 - ldr r0, [r0] - str r1, [r0, 0x64] - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0x3 - strb r1, [r0] - b _0807F70C - .pool -_0807F5AC: - bl sub_81533E0 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r2, 0 - movs r1, 0x6 -_0807F5BC: - strb r1, [r0] - ldr r0, =0x020322a0 - ldr r0, [r0] - str r2, [r0, 0x64] - b _0807F70C - .pool -_0807F5D0: - ldr r4, =0x020322a0 - ldr r1, [r4] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0xA - bhi _0807F5E0 - b _0807F70C -_0807F5E0: - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _0807F608 - bl GenerateRandomNumber - ldr r4, [r4] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1E - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - str r0, [r4, 0x64] - b _0807F60E - .pool -_0807F608: - ldr r1, [r4] - movs r0, 0 - str r0, [r1, 0x64] -_0807F60E: - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0x7 - strb r1, [r0] - b _0807F70C - .pool -_0807F620: - ldr r0, =0x020322a0 - ldr r1, [r0] - ldr r0, [r1, 0x64] - cmp r0, 0 - bne _0807F648 - movs r0, 0x1 - bl sub_8077288 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0x8 - strb r1, [r0] - b _0807F70C - .pool -_0807F648: - subs r0, 0x1 - str r0, [r1, 0x64] - b _0807F70C -_0807F64E: - bl sub_8077294 - cmp r0, 0 - beq _0807F70C - bl sub_8153408 - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0x9 - strb r1, [r0] - b _0807F70C - .pool -_0807F66C: - ldr r0, =0x020322a0 - ldr r1, [r0] - ldr r0, [r1, 0x64] - adds r0, 0x1 - str r0, [r1, 0x64] - cmp r0, 0x3C - bls _0807F70C - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0x2 - bl sub_8077288 - b _0807F70C - .pool -_0807F694: - bl sub_8077294 - cmp r0, 0 - beq _0807F70C - movs r0, 0x3 - bl play_sound_effect - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0xB - strb r1, [r0] - b _0807F70C - .pool -_0807F6C4: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0807F70C - bl sub_80A3258 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0807F70C - movs r0, 0x3 - bl sub_8077288 - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0xC - strb r1, [r0] - b _0807F70C - .pool -_0807F6F8: - bl sub_8077294 - cmp r0, 0 - beq _0807F70C - ldr r0, =0x03002700 - movs r1, 0 - strb r1, [r0] - ldr r0, =c2_080543C4 - bl SetMainCallback2 -_0807F70C: - bl sub_800B33C - lsls r0, 24 - cmp r0, 0 - bne _0807F71A - bl RunTasks -_0807F71A: - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807F464 - - thumb_func_start sub_807F738 -sub_807F738: @ 807F738 - push {lr} - ldr r0, =0x03007630 - ldr r1, =0x0000ffff - ldr r2, =0x020322a4 - ldr r2, [r2] - adds r2, 0x4C - movs r3, 0 - ldrsh r2, [r2, r3] - subs r2, 0x80 - lsls r2, 17 - asrs r2, 16 - bl MPlayPitchControl - pop {r0} - bx r0 - .pool - thumb_func_end sub_807F738 - - thumb_func_start sub_807F764 -sub_807F764: @ 807F764 - push {r4,lr} - sub sp, 0x10 - bl sub_8082DF4 - ldr r0, =0x020322a4 - ldr r0, [r0] - mov r12, r0 - movs r0, 0xA0 - lsls r0, 1 - add r0, r12 - ldr r1, [r0] - movs r0, 0xA2 - lsls r0, 1 - add r0, r12 - ldr r2, [r0] - movs r0, 0xA4 - lsls r0, 1 - add r0, r12 - movs r4, 0 - ldrsh r3, [r0, r4] - movs r0, 0xA5 - lsls r0, 1 - add r0, r12 - movs r4, 0 - ldrsh r0, [r0, r4] - str r0, [sp] - movs r0, 0xA6 - lsls r0, 1 - add r0, r12 - movs r4, 0 - ldrsh r0, [r0, r4] - str r0, [sp, 0x4] - movs r0, 0xA7 - lsls r0, 1 - add r0, r12 - movs r4, 0 - ldrsh r0, [r0, r4] - str r0, [sp, 0x8] - movs r0, 0xA8 - lsls r0, 1 - add r0, r12 - ldrh r0, [r0] - str r0, [sp, 0xC] - movs r0, 0x2 - bl SetBgAffine - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807F764 - - thumb_func_start sub_807F7D8 -sub_807F7D8: @ 807F7D8 - push {r4,r5,lr} - ldr r1, =0x020322a4 - ldr r0, [r1] - ldrb r0, [r0, 0x1] - adds r5, r1, 0 - cmp r0, 0x9 - bls _0807F7E8 - b _0807F9C8 -_0807F7E8: - lsls r0, 2 - ldr r1, =_0807F7FC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807F7FC: - .4byte _0807F824 - .4byte _0807F854 - .4byte _0807F880 - .4byte _0807F8AC - .4byte _0807F8C8 - .4byte _0807F8F4 - .4byte _0807F910 - .4byte _0807F940 - .4byte _0807F950 - .4byte _0807F980 -_0807F824: - ldr r5, =gUnknown_08D91598 - adds r0, r5, 0 - bl sub_8034974 - adds r0, 0x64 - bl AllocZeroed - adds r1, r0, 0 - ldr r4, =0x020322a4 - ldr r0, [r4] - ldr r2, =0x000011bc - adds r0, r2 - str r1, [r0] - adds r0, r5, 0 - bl LZDecompressWram - ldr r1, [r4] - b _0807F966 - .pool -_0807F854: - ldr r1, =gUnknown_083390F4 - movs r2, 0x80 - lsls r2, 3 - movs r0, 0x2 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - ldr r0, =gUnknown_083390D4 - movs r2, 0x80 - lsls r2, 1 - movs r1, 0 - bl gpu_pal_apply - b _0807F962 - .pool -_0807F880: - ldr r0, [r5] - ldr r1, =0x000011bc - adds r0, r1 - ldr r4, [r0] - ldr r0, =gUnknown_08D91598 - bl sub_8034974 - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x2 - adds r1, r4, 0 - movs r3, 0 - bl LoadBgTiles - ldr r1, [r5] - b _0807F966 - .pool -_0807F8AC: - ldr r0, =gUnknown_08D91DB8 - ldr r1, [r5] - ldr r2, =0x000011bc - adds r1, r2 - ldr r1, [r1] - bl LZDecompressWram - ldr r1, [r5] - b _0807F966 - .pool -_0807F8C8: - ldr r0, [r5] - ldr r1, =0x000011bc - adds r0, r1 - ldr r4, [r0] - ldr r0, =gUnknown_08D91DB8 - bl sub_8034974 - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x1 - adds r1, r4, 0 - movs r3, 0 - bl LoadBgTiles - ldr r1, [r5] - b _0807F966 - .pool -_0807F8F4: - ldr r0, =gUnknown_08D927EC - ldr r1, [r5] - ldr r2, =0x000011bc - adds r1, r2 - ldr r1, [r1] - bl LZDecompressWram - ldr r1, [r5] - b _0807F966 - .pool -_0807F910: - ldr r0, [r5] - ldr r1, =0x000011bc - adds r0, r1 - ldr r4, [r0] - ldr r0, =gUnknown_08D927EC - bl sub_8034974 - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x1 - adds r1, r4, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - ldr r1, [r5] - b _0807F966 - .pool -_0807F940: - ldr r0, =gUnknown_083394F4 - movs r1, 0x80 - movs r2, 0x20 - bl gpu_pal_apply - b _0807F962 - .pool -_0807F950: - ldr r0, =gUnknown_08339AC0 - bl LoadObjectPic - ldr r0, =gUnknown_08339BD8 - bl LoadObjectPic - ldr r0, =gUnknown_08339B38 - bl LoadObjectPic -_0807F962: - ldr r0, =0x020322a4 - ldr r1, [r0] -_0807F966: - ldrb r0, [r1, 0x1] - adds r0, 0x1 - strb r0, [r1, 0x1] - b _0807F9C8 - .pool -_0807F980: - ldr r0, =gUnknown_08339C24 - bl LoadObjectPic - ldr r0, =gUnknown_08339C58 - bl LoadObjectPic - ldr r0, =gUnknown_08339AD0 - bl LoadTaggedObjectPalette - ldr r0, =gUnknown_08339AC8 - bl LoadTaggedObjectPalette - ldr r4, =0x020322a4 - ldr r0, [r4] - ldr r2, =0x000011bc - adds r0, r2 - ldr r0, [r0] - bl Free - ldr r1, [r4] - movs r0, 0 - strb r0, [r1, 0x1] - movs r0, 0x1 - b _0807F9CA - .pool -_0807F9C8: - movs r0, 0 -_0807F9CA: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_807F7D8 - - thumb_func_start sub_807F9D0 -sub_807F9D0: @ 807F9D0 - push {lr} - sub sp, 0x8 - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuRegBits - 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 - add sp, 0x8 - pop {r0} - bx r0 - thumb_func_end sub_807F9D0 - - thumb_func_start sub_807FA34 -sub_807FA34: @ 807FA34 - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_08339980 - bl InitWindows - lsls r0, 16 - cmp r0, 0 - beq _0807FA74 - bl DeactivateAllTextPrinters - movs r4, 0 -_0807FA4A: - lsls r0, r4, 24 - lsrs r0, 24 - movs r1, 0 - bl FillWindowPixelBuffer - adds r4, 0x1 - cmp r4, 0x4 - ble _0807FA4A - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0xE0 - bl sub_81978B0 -_0807FA74: - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807FA34 - - thumb_func_start sub_807FA80 -sub_807FA80: @ 807FA80 - push {r4,lr} - ldr r4, =0x020322a4 - ldr r0, [r4] - cmp r0, 0 - bne _0807FA94 - movs r0, 0x8F - lsls r0, 5 - bl AllocZeroed - str r0, [r4] -_0807FA94: - ldr r0, [r4] - adds r0, 0x63 - movs r1, 0 - strb r1, [r0] - ldr r0, [r4] - strb r1, [r0] - ldr r0, [r4] - adds r0, 0x63 - strb r1, [r0] - ldr r0, =0x020375e0 - ldrb r0, [r0] - bl sub_807FE54 - ldr r0, =sub_807FAC8 - bl SetMainCallback2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807FA80 - - thumb_func_start sub_807FAC8 -sub_807FAC8: @ 807FAC8 - push {r4-r6,lr} - sub sp, 0x4 - ldr r1, =0x020322a4 - ldr r0, [r1] - ldrb r0, [r0] - adds r6, r1, 0 - cmp r0, 0x6 - bls _0807FADA - b _0807FCE2 -_0807FADA: - lsls r0, 2 - ldr r1, =_0807FAEC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0807FAEC: - .4byte _0807FB08 - .4byte _0807FBAC - .4byte _0807FC38 - .4byte _0807FC4E - .4byte _0807FC64 - .4byte _0807FC90 - .4byte _0807FCB0 -_0807FB08: - movs r0, 0 - movs r1, 0 - bl SetGpuReg - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_08339974 - movs r0, 0x1 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r4, =0x020322a4 - ldr r1, [r4] - movs r0, 0xDC - lsls r0, 1 - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x000009b8 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - movs r0, 0 - movs r1, 0x1 - movs r2, 0xD0 - bl sub_809882C - movs r0, 0 - movs r1, 0x14 - movs r2, 0xF0 - bl copy_textbox_border_tile_patterns_to_vram - bl sub_807FA34 - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1] - ldr r3, [r4] - movs r1, 0x8C - lsls r1, 1 - adds r0, r3, r1 - movs r1, 0 - strh r2, [r0] - movs r4, 0x8B - lsls r4, 1 - adds r0, r3, r4 - strh r2, [r0] - movs r0, 0x8D - lsls r0, 1 - adds r4, r3, r0 - movs r0, 0x50 - strh r0, [r4] - movs r4, 0x8E - lsls r4, 1 - adds r0, r3, r4 - strh r2, [r0] - adds r4, 0x2 - adds r0, r3, r4 - strh r2, [r0] - strb r1, [r3, 0x1] - bl sub_8082D28 - b _0807FCE2 - .pool -_0807FBAC: - bl sub_807F7D8 - lsls r0, 24 - cmp r0, 0 - bne _0807FBB8 - b _0807FCE2 -_0807FBB8: - movs r4, 0 - ldr r5, =gUnknown_083399C8 - ldr r6, =0x020322a4 -_0807FBBE: - ldrb r1, [r5] - ldrb r2, [r5, 0x1] - ldr r0, =gUnknown_08339AD8 - movs r3, 0x1 - bl AddObjectToFront - ldr r1, [r6] - adds r1, 0x50 - adds r1, r4 - strb r0, [r1] - ldr r0, [r6] - adds r0, 0x50 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - adds r1, r4, 0 - adds r1, 0x8 - lsls r1, 24 - lsrs r1, 24 - bl StartObjectImageAnim - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _0807FBBE - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _0807FC14 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _0807FC14 - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 -_0807FC14: - ldr r0, =sub_807F764 - bl SetVBlankCallback - b _0807FCA0 - .pool -_0807FC38: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - bl sub_8082D28 - b _0807FCA0 -_0807FC4E: - bl sub_807F9D0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0807FCE2 - b _0807FCA0 - .pool -_0807FC64: - ldr r4, [r6] - ldr r0, =0x000011b8 - adds r4, r0 - ldr r5, =gUnknown_0833973A - bl sav2_get_text_speed - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_808417C - cmp r0, 0 - beq _0807FCE2 - ldr r1, [r6] - b _0807FCA4 - .pool -_0807FC90: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe -_0807FCA0: - ldr r0, =0x020322a4 - ldr r1, [r0] -_0807FCA4: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0807FCE2 - .pool -_0807FCB0: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0807FCE2 - bl FreeAllWindowBuffers - movs r0, 0x2 - bl UnsetBgTilemapBuffer - movs r0, 0x1 - bl UnsetBgTilemapBuffer - movs r0, 0 - bl SetVBlankCallback - ldr r0, =sub_807FFA4 - bl sub_81AABF0 - ldr r0, =0x020322a4 - ldr r0, [r0] - strb r4, [r0] -_0807FCE2: - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807FAC8 - - thumb_func_start sub_807FD08 -sub_807FD08: @ 807FD08 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x3A] - ldrh r1, [r4, 0x30] - adds r0, r1 - strh r0, [r4, 0x30] - ldrh r1, [r4, 0x32] - ldrh r2, [r4, 0x36] - subs r1, r2 - ldrh r0, [r4, 0x3C] - adds r1, r0 - strh r1, [r4, 0x32] - ldrh r3, [r4, 0x2E] - adds r0, r3 - strh r0, [r4, 0x2E] - subs r2, 0x1 - strh r2, [r4, 0x36] - lsls r0, 16 - lsls r1, 16 - cmp r0, r1 - bge _0807FD56 - ldrh r0, [r4, 0x34] - subs r0, 0x1 - strh r0, [r4, 0x36] - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _0807FD50 - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - b _0807FD56 -_0807FD50: - movs r0, 0x74 - bl audio_play -_0807FD56: - ldrh r0, [r4, 0x30] - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x32] - strh r0, [r4, 0x22] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_807FD08 - - thumb_func_start sub_807FD64 -sub_807FD64: @ 807FD64 - push {r4-r6,lr} - ldr r5, [sp, 0x10] - ldr r6, [sp, 0x14] - lsls r2, 16 - lsrs r2, 16 - movs r4, 0 - strh r2, [r0, 0x2E] - strh r1, [r0, 0x30] - strh r2, [r0, 0x32] - strh r3, [r0, 0x34] - movs r1, 0xA - strh r1, [r0, 0x36] - strh r4, [r0, 0x38] - strh r5, [r0, 0x3A] - strh r6, [r0, 0x3C] - ldr r1, =sub_807FD08 - str r1, [r0, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807FD64 - - thumb_func_start sub_807FD90 -sub_807FD90: @ 807FD90 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x8 - adds r6, r1, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r0, 24 - movs r1, 0xF6 - lsls r1, 23 - adds r0, r1 - lsrs r0, 24 - movs r3, 0x1 - ands r3, r6 - movs r1, 0 - movs r2, 0x50 - bl sub_80D511C - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 4 - mov r8, r2 - add r8, r0 - mov r3, r8 - lsls r3, 2 - mov r8, r3 - ldr r0, =0x02020630 - add r8, r0 - ldr r5, =gUnknown_08339C78 - lsls r4, r6, 2 - adds r4, r6 - lsls r4, 1 - adds r0, r4, r5 - movs r6, 0 - ldrsh r1, [r0, r6] - adds r0, r5, 0x2 - adds r0, r4, r0 - movs r3, 0 - ldrsh r2, [r0, r3] - adds r0, r5, 0x4 - adds r0, r4, r0 - movs r6, 0 - ldrsh r3, [r0, r6] - adds r0, r5, 0x6 - adds r0, r4, r0 - movs r6, 0 - ldrsh r0, [r0, r6] - str r0, [sp] - adds r5, 0x8 - adds r4, r5 - movs r5, 0 - ldrsh r0, [r4, r5] - str r0, [sp, 0x4] - mov r0, r8 - bl sub_807FD64 - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807FD90 - - thumb_func_start sub_807FE14 -sub_807FE14: @ 807FE14 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r5, r1, 16 - lsrs r5, 16 - adds r0, r5, 0 - adds r0, 0x7C - lsls r0, 24 - lsrs r0, 24 - bl GetBerryInfo - adds r4, r0, 0 - strh r5, [r6] - adds r0, r6, 0x2 - adds r1, r4, 0 - bl CopyString - ldrb r0, [r4, 0x15] - strb r0, [r6, 0x9] - ldrb r0, [r4, 0x16] - strb r0, [r6, 0xA] - ldrb r0, [r4, 0x17] - strb r0, [r6, 0xB] - ldrb r0, [r4, 0x18] - strb r0, [r6, 0xC] - ldrb r0, [r4, 0x19] - strb r0, [r6, 0xD] - ldrb r0, [r4, 0x1A] - strb r0, [r6, 0xE] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_807FE14 - - thumb_func_start sub_807FE54 -sub_807FE54: @ 807FE54 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - beq _0807FE7C - cmp r5, 0x1 - bgt _0807FE68 - cmp r5, 0 - beq _0807FE72 - b _0807FF88 -_0807FE68: - cmp r5, 0x2 - beq _0807FEE8 - cmp r5, 0x3 - beq _0807FF3C - b _0807FF88 -_0807FE72: - ldr r0, =0x03005d98 - strb r5, [r0] - b _0807FF88 - .pool -_0807FE7C: - ldr r0, =0x03005d98 - strb r5, [r0] - ldr r0, =0x020322a4 - ldr r0, [r0] - adds r0, 0x7C - movs r1, 0x2 - strb r1, [r0] - ldr r4, =0x020229f0 - ldr r0, =0x03005d90 - ldr r1, [r0] - adds r0, r4, 0 - bl CopyString - movs r0, 0xD0 - lsls r0, 2 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _0807FEC8 - adds r0, r4, 0 - adds r0, 0x1C - ldr r1, =gUnknown_083397D0 - ldr r1, [r1, 0xC] - bl CopyString - b _0807FED4 - .pool -_0807FEC8: - adds r0, r4, 0 - adds r0, 0x1C - ldr r1, =gUnknown_083397D0 - ldr r1, [r1] - bl CopyString -_0807FED4: - ldr r1, =0x020229e8 - movs r0, 0x2 - strh r0, [r1, 0x1A] - strh r0, [r1, 0x36] - b _0807FF88 - .pool -_0807FEE8: - ldr r0, =0x03005d98 - strb r5, [r0] - ldr r0, =0x020322a4 - ldr r0, [r0] - adds r0, 0x7C - movs r1, 0x3 - strb r1, [r0] - ldr r6, =0x020229f0 - ldr r0, =0x03005d90 - ldr r1, [r0] - adds r0, r6, 0 - bl CopyString - adds r0, r6, 0 - adds r0, 0x1C - ldr r4, =gUnknown_083397D0 - ldr r1, [r4, 0x10] - bl CopyString - adds r0, r6, 0 - adds r0, 0x38 - ldr r1, [r4, 0x8] - bl CopyString - adds r0, r6, 0 - subs r0, 0x8 - strh r5, [r0, 0x1A] - strh r5, [r0, 0x36] - adds r0, 0x52 - strh r5, [r0] - b _0807FF88 - .pool -_0807FF3C: - ldr r0, =0x03005d98 - strb r5, [r0] - ldr r0, =0x020322a4 - ldr r0, [r0] - adds r0, 0x7C - movs r1, 0x4 - strb r1, [r0] - ldr r5, =0x020229f0 - ldr r0, =0x03005d90 - ldr r1, [r0] - adds r0, r5, 0 - bl CopyString - adds r0, r5, 0 - adds r0, 0x1C - ldr r4, =gUnknown_083397D0 - ldr r1, [r4, 0x14] - bl CopyString - adds r0, r5, 0 - adds r0, 0x38 - ldr r1, [r4, 0x4] - bl CopyString - adds r0, r5, 0 - adds r0, 0x54 - ldr r1, [r4, 0x8] - bl CopyString - adds r0, r5, 0 - subs r0, 0x8 - movs r1, 0x2 - strh r1, [r0, 0x1A] - strh r1, [r0, 0x36] - adds r0, 0x52 - strh r1, [r0] - adds r0, 0x1C - strh r1, [r0] -_0807FF88: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807FE54 - - thumb_func_start sub_807FFA4 -sub_807FFA4: @ 807FFA4 - push {r4,r5,lr} - movs r0, 0 - movs r1, 0 - bl SetGpuReg - ldr r4, =0x020322a4 - ldr r0, [r4] - cmp r0, 0 - bne _0807FFC0 - movs r0, 0x8F - lsls r0, 5 - bl AllocZeroed - str r0, [r4] -_0807FFC0: - ldr r0, [r4] - movs r1, 0 - strb r1, [r0] - ldr r0, [r4] - movs r2, 0x86 - lsls r2, 1 - adds r0, r2 - str r1, [r0] - movs r2, 0 - ldr r5, =0x020375e0 - movs r3, 0 -_0807FFD6: - ldr r0, [r4] - lsls r1, r2, 1 - adds r0, 0x74 - adds r0, r1 - strh r3, [r0] - adds r2, 0x1 - cmp r2, 0x3 - ble _0807FFD6 - ldrb r0, [r5] - bl sub_807FE54 - ldrh r0, [r5] - cmp r0, 0 - bne _08080008 - ldr r0, =sub_8080018 - bl SetMainCallback2 - b _0808000E - .pool -_08080008: - ldr r0, =sub_80808D4 - bl SetMainCallback2 -_0808000E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807FFA4 - - thumb_func_start sub_8080018 -sub_8080018: @ 8080018 - push {r4-r7,lr} - sub sp, 0x4 - ldr r1, =0x020322a4 - ldr r0, [r1] - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0x15 - bls _0808002A - b _08080546 -_0808002A: - lsls r0, 2 - ldr r1, =_0808003C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0808003C: - .4byte _08080094 - .4byte _08080100 - .4byte _08080120 - .4byte _0808019C - .4byte _080801AE - .4byte _080801C8 - .4byte _08080546 - .4byte _08080546 - .4byte _080801F8 - .4byte _08080248 - .4byte _0808026C - .4byte _08080302 - .4byte _0808035C - .4byte _080803D4 - .4byte _08080408 - .4byte _0808049C - .4byte _080804D0 - .4byte _08080546 - .4byte _080804F8 - .4byte _080804E4 - .4byte _080804EA - .4byte _08080508 -_08080094: - bl sub_8080588 - ldr r1, =0x020229c6 - ldr r2, =0x00004422 - adds r0, r2, 0 - strh r0, [r1] - ldr r2, =0x020322a4 - ldr r0, [r2] - adds r0, 0x72 - movs r1, 0 - strb r1, [r0] - movs r5, 0 - movs r6, 0 - movs r7, 0x92 - lsls r7, 1 -_080800B2: - ldr r0, [r2] - lsls r1, r5, 1 - adds r0, 0x64 - adds r0, r1 - strh r6, [r0] - adds r4, r5, 0x1 - adds r1, r5 - lsls r1, 1 - movs r3, 0x2 -_080800C4: - ldr r0, [r2] - adds r0, r7 - adds r0, r1 - strh r6, [r0] - adds r1, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _080800C4 - adds r5, r4, 0 - cmp r5, 0x3 - ble _080800B2 - ldr r3, =0x020322a4 - ldr r4, [r3] - adds r1, r4, 0 - adds r1, 0x70 - movs r2, 0 - movs r0, 0 - strh r0, [r1] - subs r1, 0x22 - strh r0, [r1] - strb r2, [r4, 0x1] - ldr r1, [r3] - b _080804FC - .pool -_08080100: - bl sub_807F7D8 - lsls r0, 24 - cmp r0, 0 - bne _0808010C - b _08080546 -_0808010C: - ldr r0, =0x020322a4 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - bl sub_8082D28 - b _08080546 - .pool -_08080120: - movs r5, 0 - ldr r4, =gUnknown_083399C8 - ldr r6, =0x020322a4 -_08080126: - ldrb r1, [r4] - ldrb r2, [r4, 0x1] - ldr r0, =gUnknown_08339AD8 - movs r3, 0x1 - bl AddObjectToFront - ldr r1, [r6] - adds r1, 0x54 - adds r1, r5 - strb r0, [r1] - ldr r0, [r6] - adds r0, 0x54 - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - adds r1, r5, 0 - adds r1, 0x8 - lsls r1, 24 - lsrs r1, 24 - bl StartObjectImageAnim - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _08080126 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0808016A - b _080804F8 -_0808016A: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _08080174 - b _080804F8 -_08080174: - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - b _080804F8 - .pool -_0808019C: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - b _080804F8 -_080801AE: - bl sub_807F9D0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080801C0 - b _08080546 -_080801C0: - b _080804F8 - .pool -_080801C8: - ldr r4, =0x020322a4 - ldr r0, [r4] - ldr r3, =0x000011b8 - adds r0, r3 - ldr r1, =gUnknown_0833981A - movs r2, 0 - bl sub_808417C - ldr r1, [r4] - movs r2, 0 - movs r0, 0x8 - strb r0, [r1] - ldr r0, [r4] - movs r1, 0x84 - lsls r1, 1 - adds r0, r1 - str r2, [r0] - b _08080546 - .pool -_080801F8: - ldr r4, =0x020322a4 - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - movs r6, 0 - strb r0, [r1] - ldr r0, [r4] - movs r2, 0x8A - lsls r2, 1 - adds r0, r2 - strb r6, [r0] - ldr r0, [r4] - movs r5, 0xAC - lsls r5, 1 - adds r0, r5 - ldr r1, =0x0203ce7c - ldrh r1, [r1] - bl sub_807FE14 - ldr r0, =0x020228c4 - ldr r1, [r4] - adds r1, r5 - movs r2, 0x10 - bl memcpy - bl sub_800ADF8 - ldr r0, [r4] - movs r3, 0x84 - lsls r3, 1 - adds r0, r3 - str r6, [r0] - b _08080546 - .pool -_08080248: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _08080254 - b _08080546 -_08080254: - bl sub_800A5B4 - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - beq _08080264 - b _080804F8 -_08080264: - movs r0, 0x4 - bl sub_800A4D8 - b _080804F8 -_0808026C: - ldr r6, =0x020322a4 - ldr r1, [r6] - movs r0, 0x84 - lsls r0, 1 - adds r1, r0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - cmp r0, 0x14 - bgt _08080282 - b _08080546 -_08080282: - movs r0, 0x4 - movs r1, 0x1 - bl sub_8197DF8 - bl sub_800A550 - adds r4, r0, 0 - bl sub_800A9D8 - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _0808029E - b _08080546 -_0808029E: - movs r5, 0 - adds r7, r6, 0 - movs r6, 0xAC - lsls r6, 1 - b _080802D4 - .pool -_080802AC: - ldr r0, [r7] - lsls r4, r5, 4 - adds r0, r4, r0 - adds r0, r6 - lsls r1, r5, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0x10 - bl memcpy - ldr r0, [r7] - lsls r2, r5, 1 - adds r1, r0, 0 - adds r1, 0x74 - adds r1, r2 - adds r0, r4 - adds r0, r6 - ldrh r0, [r0] - strh r0, [r1] - adds r5, 0x1 -_080802D4: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - blt _080802AC - bl sub_800A5B4 - b _080804F8 - .pool -_080802EC: - ldrb r1, [r4] - lsls r1, 1 - adds r0, r2, 0 - adds r0, 0x74 - adds r0, r1 - ldrh r0, [r0] - lsls r1, r5, 24 - lsrs r1, 24 - bl sub_807FD90 - b _08080336 -_08080302: - bl sub_8009FCC - ldr r2, =0x020322a4 - ldr r1, [r2] - adds r1, 0x7C - strb r0, [r1] - movs r5, 0 - ldr r2, [r2] - movs r1, 0x8A - lsls r1, 1 - adds r4, r2, r1 - ldr r1, =gUnknown_083399D0 - adds r0, r2, 0 - adds r0, 0x7C - ldrb r0, [r0] - subs r0, 0x2 - lsls r0, 2 - ldrb r3, [r4] - adds r0, r1 -_08080328: - ldrb r1, [r0] - cmp r3, r1 - beq _080802EC - adds r0, 0x1 - adds r5, 0x1 - cmp r5, 0x3 - ble _08080328 -_08080336: - ldr r3, =0x020322a4 - ldr r1, [r3] - movs r0, 0x84 - lsls r0, 1 - adds r2, r1, r0 - movs r0, 0 - str r0, [r2] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r1, [r3] - movs r2, 0x8A - lsls r2, 1 - adds r1, r2 - b _080804FC - .pool -_0808035C: - ldr r3, [r2] - movs r0, 0x84 - lsls r0, 1 - adds r1, r3, r0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - cmp r0, 0x3C - bgt _08080370 - b _08080546 -_08080370: - movs r1, 0x8A - lsls r1, 1 - adds r0, r3, r1 - adds r1, r3, 0 - adds r1, 0x7C - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcc _080803B8 - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - ldr r2, [r2] - ldr r3, =gUnknown_083399DC - ldr r1, =gUnknown_083399E4 - adds r0, r2, 0 - adds r0, 0x7C - ldrb r0, [r0] - subs r0, 0x2 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r3 - ldr r3, =0xffffa800 - adds r1, r3, 0 - ldrh r0, [r0] - adds r1, r0 - adds r2, 0x4A - strh r1, [r2] - b _080803BE - .pool -_080803B8: - ldrb r0, [r3] - subs r0, 0x1 - strb r0, [r3] -_080803BE: - ldr r0, =0x020322a4 - ldr r0, [r0] - movs r1, 0x84 - lsls r1, 1 - adds r0, r1 - movs r1, 0 - str r1, [r0] - b _08080546 - .pool -_080803D4: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _080803E0 - b _08080546 -_080803E0: - ldr r2, =0x020322a4 - ldr r1, [r2] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r2] - movs r2, 0xA0 - lsls r2, 1 - adds r0, r2 - bl sub_8082CB4 - movs r0, 0x2B - bl audio_play - movs r0, 0x2 - bl ShowBg - b _08080546 - .pool -_08080408: - movs r1, 0x80 - lsls r1, 3 - movs r0, 0 - bl SetGpuRegBits - ldr r4, =0x020322a4 - ldr r2, [r4] - adds r1, r2, 0 - adds r1, 0x4A - movs r3, 0x80 - lsls r3, 2 - adds r0, r3, 0 - ldrh r3, [r1] - adds r0, r3 - strh r0, [r1] - movs r0, 0x8D - lsls r0, 1 - adds r1, r2, r0 - ldrh r0, [r1] - adds r0, 0x4 - strh r0, [r1] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xFF - bls _0808048C - movs r0, 0xC - movs r1, 0x2 - bl SetGpuRegBits - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r3, [r4] - movs r2, 0x8D - lsls r2, 1 - adds r1, r3, r2 - movs r0, 0x80 - lsls r0, 1 - strh r0, [r1] - ldr r2, =gUnknown_083399DC - ldr r1, =gUnknown_083399E4 - adds r0, r3, 0 - adds r0, 0x7C - ldrb r0, [r0] - subs r0, 0x2 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - adds r1, r3, 0 - adds r1, 0x4A - strh r0, [r1] - movs r0, 0x84 - lsls r0, 1 - adds r1, r3, r0 - movs r0, 0 - str r0, [r1] - movs r0, 0x34 - bl audio_play - bl sub_808074C - bl sub_80807BC -_0808048C: - ldr r0, [r4] - b _080804BE - .pool -_0808049C: - bl sub_8083380 - lsls r0, 24 - cmp r0, 0 - beq _080804BA - ldr r0, =0x020322a4 - ldr r1, [r0] - movs r3, 0x84 - lsls r3, 1 - adds r2, r1, r3 - movs r0, 0 - str r0, [r2] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080804BA: - ldr r0, =0x020322a4 - ldr r0, [r0] -_080804BE: - movs r1, 0xA0 - lsls r1, 1 - adds r0, r1 - bl sub_8082CB4 - b _08080546 - .pool -_080804D0: - ldr r0, =gUnknown_08339C2C - movs r2, 0x10 - negs r2, r2 - movs r1, 0x78 - movs r3, 0x3 - bl AddObjectToFront - b _080804F8 - .pool -_080804E4: - bl sub_800ADF8 - b _080804F8 -_080804EA: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08080546 - bl sub_800A418 -_080804F8: - ldr r0, =0x020322a4 - ldr r1, [r0] -_080804FC: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08080546 - .pool -_08080508: - ldr r5, =0x020322a4 - ldr r3, [r5] - adds r1, r3, 0 - adds r1, 0x4C - movs r2, 0 - movs r0, 0x80 - strh r0, [r1] - movs r1, 0x82 - lsls r1, 1 - adds r0, r3, r1 - str r2, [r0] - ldr r0, =sub_8081898 - bl SetMainCallback2 - bl current_map_music_get - lsls r0, 16 - lsrs r0, 16 - ldr r4, =0x00000193 - cmp r0, r4 - beq _08080540 - bl current_map_music_get - ldr r1, [r5] - movs r2, 0xAA - lsls r2, 1 - adds r1, r2 - strh r0, [r1] -_08080540: - adds r0, r4, 0 - bl song_play_for_text -_08080546: - ldr r0, =0x020322a4 - ldr r1, [r0] - movs r3, 0x8E - lsls r3, 1 - adds r0, r1, r3 - movs r2, 0 - ldrsh r0, [r0, r2] - adds r3, 0x2 - adds r1, r3 - movs r2, 0 - ldrsh r1, [r1, r2] - bl nullsub_31 - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8080018 - - thumb_func_start sub_8080588 -sub_8080588: @ 8080588 - push {r4,lr} - movs r0, 0 - movs r1, 0 - bl SetGpuReg - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - bl ResetTasks - ldr r0, =sub_807F764 - bl SetVBlankCallback - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_08339974 - movs r0, 0x1 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r4, =0x020322a4 - ldr r1, [r4] - movs r0, 0xDC - lsls r0, 1 - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r3, =0x000009b8 - adds r1, r3 - movs r0, 0x2 - bl SetBgTilemapBuffer - movs r0, 0 - movs r1, 0x1 - movs r2, 0xD0 - bl sub_809882C - movs r0, 0 - movs r1, 0x14 - movs r2, 0xF0 - bl copy_textbox_border_tile_patterns_to_vram - bl sub_807FA34 - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0x44 - movs r1, 0 - strh r1, [r0] - adds r0, 0x8 - strh r1, [r0] - subs r0, 0x2 - strh r1, [r0] - adds r0, 0x4 - strh r1, [r0] - movs r3, 0x8E - lsls r3, 1 - adds r0, r2, r3 - strh r1, [r0] - adds r3, 0x2 - adds r0, r2, r3 - strh r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8080588 - - thumb_func_start task_tutorial_oak_boy_girl -task_tutorial_oak_boy_girl: @ 8080624 - push {lr} - lsls r0, 16 - lsls r1, 24 - lsrs r0, 24 - adds r2, r0, 0 - adds r2, 0x18 - ldr r0, =0x020322a4 - ldr r0, [r0] - lsrs r1, 23 - adds r0, 0x96 - adds r0, r1 - ldrb r0, [r0] - ldr r1, =gUnknown_083399E7 - adds r0, r1 - ldrb r1, [r0] - cmp r2, r1 - bcc _0808066C - adds r0, r1, 0 - adds r0, 0x30 - cmp r2, r0 - bcs _0808066C - subs r0, 0x1C - cmp r2, r0 - bcc _08080668 - adds r0, 0x8 - cmp r2, r0 - bcs _08080668 - movs r0, 0x2 - b _0808066E - .pool -_08080668: - movs r0, 0x1 - b _0808066E -_0808066C: - movs r0, 0 -_0808066E: - pop {r1} - bx r1 - thumb_func_end task_tutorial_oak_boy_girl - - thumb_func_start sub_8080674 -sub_8080674: @ 8080674 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 24 - lsrs r1, 24 - movs r6, 0 - cmp r5, 0xAF - bne _080806AC - movs r4, 0 - subs r7, r1, 0x1 - adds r2, 0x9 -_08080690: - adds r0, r2, r6 - adds r1, r2, r4 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bls _0808069E - adds r6, r4, 0 -_0808069E: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x4 - bls _08080690 - adds r0, r6, 0x5 - b _080806C4 -_080806AC: - adds r0, r5, 0 - subs r0, 0x85 - lsls r0, 16 - lsrs r6, r0, 16 - subs r7, r1, 0x1 - cmp r6, 0x4 - bls _080806C8 - adds r0, r6, 0 - movs r1, 0x5 - bl __umodsi3 - adds r0, 0x5 -_080806C4: - lsls r0, 16 - lsrs r6, r0, 16 -_080806C8: - movs r4, 0 - cmp r4, r7 - bge _08080734 - ldr r0, =gUnknown_08339CA0 - mov r9, r0 - adds r0, r5, 0 - subs r0, 0xA3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 -_080806DC: - lsls r0, r6, 1 - adds r0, r6 - adds r0, r4, r0 - add r0, r9 - ldrb r5, [r0] - movs r0, 0xD0 - lsls r0, 2 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _0808071A - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0x1 - bne _0808071A - adds r0, r6, 0 - movs r1, 0x5 - bl __umodsi3 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =gUnknown_08339CBE - adds r0, r6, r0 - ldrb r5, [r0] - mov r0, r8 - cmp r0, 0x4 - bhi _0808071A - subs r0, r5, 0x5 - lsls r0, 16 - lsrs r5, r0, 16 -_0808071A: - adds r4, 0x1 - lsls r0, r4, 24 - lsrs r0, 24 - adds r1, r5, 0 - adds r1, 0x85 - lsls r1, 16 - lsrs r1, 16 - bl sub_8082FDC - lsls r4, 16 - lsrs r4, 16 - cmp r4, r7 - blt _080806DC -_08080734: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8080674 - - thumb_func_start sub_808074C -sub_808074C: @ 808074C - push {r4-r7,lr} - movs r4, 0 - ldr r7, =0x020322a4 - movs r6, 0xFF - ldr r5, =gUnknown_083399D0 -_08080756: - ldr r3, [r7] - lsls r2, r4, 1 - adds r0, r3, 0 - adds r0, 0x96 - adds r0, r2 - strh r6, [r0] - adds r1, r3, 0 - adds r1, 0x8E - adds r1, r2 - adds r0, r3, 0 - adds r0, 0x7C - ldrb r0, [r0] - subs r0, 0x2 - lsls r0, 2 - adds r0, r4, r0 - adds r0, r5 - ldrb r0, [r0] - strh r0, [r1] - adds r4, 0x1 - cmp r4, 0x3 - ble _08080756 - movs r3, 0 - ldr r7, =0x020322a4 -_08080784: - movs r4, 0 - adds r6, r3, 0x1 - lsls r5, r3, 1 -_0808078A: - ldr r2, [r7] - lsls r0, r4, 1 - adds r1, r2, 0 - adds r1, 0x8E - adds r1, r0 - ldrh r0, [r1] - cmp r0, r3 - bne _080807A2 - adds r0, r2, 0 - adds r0, 0x96 - adds r0, r5 - strh r4, [r0] -_080807A2: - adds r4, 0x1 - cmp r4, 0x3 - ble _0808078A - adds r3, r6, 0 - cmp r3, 0x3 - ble _08080784 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808074C - - thumb_func_start sub_80807BC -sub_80807BC: @ 80807BC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - movs r0, 0 - mov r10, r0 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _080807DE - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 -_080807DE: - movs r6, 0 - ldr r7, =0x020322a4 - mov r8, r6 -_080807E4: - ldr r2, [r7] - lsls r5, r6, 1 - adds r0, r2, 0 - adds r0, 0x8E - adds r3, r0, r5 - ldrh r0, [r3] - cmp r0, 0xFF - beq _080808B6 - adds r1, r2, 0 - adds r1, 0x50 - ldrh r3, [r3] - adds r1, r3 - adds r0, r2, 0 - adds r0, 0x54 - adds r0, r6 - ldrb r0, [r0] - movs r2, 0 - mov r9, r2 - strb r0, [r1] - ldr r0, [r7] - adds r1, r0, 0 - adds r1, 0x8E - adds r1, r5 - adds r0, 0x50 - ldrh r1, [r1] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - mov r1, r8 - lsrs r4, r1, 24 - adds r1, r4, 0 - bl StartObjectImageAnim - add r1, sp, 0x8 - movs r0, 0xFF - strb r0, [r1] - ldr r0, [r7] - adds r0, 0x8E - adds r0, r5 - ldrh r0, [r0] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r0, =0x020229f0 - adds r1, r0 - add r0, sp, 0x8 - bl CopyString - movs r0, 0x1 - add r1, sp, 0x8 - movs r2, 0x38 - bl GetStringCenterAlignXOffset - adds r2, r0, 0 - ldr r0, [r7] - adds r0, 0x8E - adds r0, r5 - mov r5, r8 - ldrh r0, [r0] - cmp r10, r0 - bne _08080890 - lsls r2, 24 - lsrs r2, 24 - mov r0, r9 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - adds r0, r4, 0 - add r1, sp, 0x8 - movs r3, 0x1 - bl sub_80840D4 - b _080808A6 - .pool -_08080890: - lsls r2, 24 - lsrs r2, 24 - mov r1, r9 - str r1, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - adds r0, r4, 0 - add r1, sp, 0x8 - movs r3, 0x1 - bl sub_80840D4 -_080808A6: - lsrs r4, r5, 24 - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram -_080808B6: - movs r2, 0x80 - lsls r2, 17 - add r8, r2 - adds r6, 0x1 - cmp r6, 0x3 - ble _080807E4 - 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_80807BC - - thumb_func_start sub_80808D4 -sub_80808D4: @ 80808D4 - push {r4-r7,lr} - sub sp, 0x4 - ldr r1, =0x020322a4 - ldr r0, [r1] - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0x15 - bls _080808E6 - b _08080DAE -_080808E6: - lsls r0, 2 - ldr r1, =_080808F8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080808F8: - .4byte _08080950 - .4byte _080809E4 - .4byte _08080A04 - .4byte _08080A58 - .4byte _08080A84 - .4byte _08080DAE - .4byte _08080DAE - .4byte _08080DAE - .4byte _08080ABC - .4byte _08080DAE - .4byte _08080DAE - .4byte _08080AEC - .4byte _08080B3C - .4byte _08080BB0 - .4byte _08080BDC - .4byte _08080C78 - .4byte _08080CA0 - .4byte _08080DAE - .4byte _08080CAE - .4byte _08080CAE - .4byte _08080CAE - .4byte _08080CC4 -_08080950: - bl sub_800B4C0 - bl sub_8080588 - ldr r4, =0x0203ce7c - ldrh r1, [r4] - movs r0, 0 - bl sub_8082FDC - ldr r5, =0x020322a4 - ldr r0, [r5] - movs r6, 0xAC - lsls r6, 1 - adds r0, r6 - ldrh r1, [r4] - bl sub_807FE14 - ldrh r0, [r4] - ldr r2, [r5] - adds r1, r2, 0 - adds r1, 0x7C - ldrb r1, [r1] - adds r2, r6 - bl sub_8080674 - movs r4, 0 - movs r6, 0 - ldr r0, =0x020229c6 - mov r12, r0 - movs r7, 0x92 - lsls r7, 1 -_0808098E: - ldr r0, [r5] - lsls r1, r4, 1 - adds r0, 0x64 - adds r0, r1 - strh r6, [r0] - adds r3, r4, 0x1 - adds r1, r4 - lsls r1, 1 - movs r2, 0x2 -_080809A0: - ldr r0, [r5] - adds r0, r7 - adds r0, r1 - strh r6, [r0] - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _080809A0 - adds r4, r3, 0 - cmp r4, 0x3 - ble _0808098E - ldr r4, =0x020322a4 - ldr r3, [r4] - adds r1, r3, 0 - adds r1, 0x70 - movs r2, 0 - movs r0, 0 - strh r0, [r1] - strb r2, [r3, 0x1] - ldr r1, =0x00004422 - adds r0, r1, 0 - mov r2, r12 - strh r0, [r2] - ldr r1, [r4] - b _08080CB2 - .pool -_080809E4: - bl sub_807F7D8 - lsls r0, 24 - cmp r0, 0 - bne _080809F0 - b _08080DAE -_080809F0: - ldr r0, =0x020322a4 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - bl sub_8082D28 - b _08080DAE - .pool -_08080A04: - movs r4, 0 - ldr r5, =gUnknown_083399C8 - ldr r6, =0x020322a4 -_08080A0A: - ldrb r1, [r5] - ldrb r2, [r5, 0x1] - ldr r0, =gUnknown_08339AD8 - movs r3, 0x1 - bl AddObjectToFront - ldr r1, [r6] - adds r1, 0x54 - adds r1, r4 - strb r0, [r1] - ldr r0, [r6] - adds r0, 0x54 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - adds r1, r4, 0 - adds r1, 0x8 - lsls r1, 24 - lsrs r1, 24 - bl StartObjectImageAnim - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _08080A0A - b _08080CAE - .pool -_08080A58: - movs r0, 0x1 - negs r0, r0 - movs r4, 0 - str r4, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r2, =0x020322a4 - ldr r1, [r2] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r2] - movs r3, 0x84 - lsls r3, 1 - adds r0, r3 - str r4, [r0] - b _08080DAE - .pool -_08080A84: - ldr r4, =0x020322a4 - ldr r1, [r4] - movs r5, 0x84 - lsls r5, 1 - adds r1, r5 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - cmp r0, 0x2 - bne _08080A9C - bl sub_807F9D0 -_08080A9C: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08080AAA - b _08080DAE -_08080AAA: - ldr r1, [r4] - movs r0, 0x8 - strb r0, [r1] - b _08080DAE - .pool -_08080ABC: - ldr r2, =0x020322a4 - ldr r1, [r2] - movs r3, 0 - movs r0, 0xB - strb r0, [r1] - ldr r0, [r2] - movs r1, 0x8A - lsls r1, 1 - adds r0, r1 - strb r3, [r0] - b _08080DAE - .pool -_08080AD8: - lsls r1, 1 - adds r0, r3, 0 - adds r0, 0x74 - adds r0, r1 - ldrh r0, [r0] - lsls r1, r4, 24 - lsrs r1, 24 - bl sub_807FD90 - b _08080B16 -_08080AEC: - movs r4, 0 - ldr r2, =gUnknown_083399D0 - ldr r0, =0x020322a4 - ldr r3, [r0] - adds r0, r3, 0 - adds r0, 0x7C - ldrb r0, [r0] - subs r0, 0x2 - lsls r0, 2 - movs r5, 0x8A - lsls r5, 1 - adds r1, r3, r5 - ldrb r1, [r1] - adds r0, r2 -_08080B08: - ldrb r2, [r0] - cmp r1, r2 - beq _08080AD8 - adds r0, 0x1 - adds r4, 0x1 - cmp r4, 0x3 - ble _08080B08 -_08080B16: - ldr r3, =0x020322a4 - ldr r1, [r3] - movs r5, 0x84 - lsls r5, 1 - adds r2, r1, r5 - movs r0, 0 - str r0, [r2] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r1, [r3] - movs r0, 0x8A - lsls r0, 1 - adds r1, r0 - b _08080CB2 - .pool -_08080B3C: - ldr r3, [r2] - movs r2, 0x84 - lsls r2, 1 - adds r1, r3, r2 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - cmp r0, 0x3C - bgt _08080B50 - b _08080DAE -_08080B50: - movs r5, 0x8A - lsls r5, 1 - adds r0, r3, r5 - adds r4, r3, 0 - adds r4, 0x7C - ldrb r0, [r0] - ldrb r1, [r4] - cmp r0, r1 - bcc _08080B94 - ldr r2, =gUnknown_083399DC - ldr r1, =gUnknown_083399E4 - ldrb r0, [r4] - subs r0, 0x2 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r2 - ldr r2, =0xffffa800 - adds r1, r2, 0 - ldrh r0, [r0] - adds r1, r0 - adds r0, r3, 0 - adds r0, 0x4A - strh r1, [r0] - ldrb r0, [r3] - adds r0, 0x1 - b _08080B98 - .pool -_08080B94: - ldrb r0, [r3] - subs r0, 0x1 -_08080B98: - strb r0, [r3] - ldr r0, =0x020322a4 - ldr r0, [r0] - movs r3, 0x84 - lsls r3, 1 - adds r0, r3 - movs r1, 0 - str r1, [r0] - b _08080DAE - .pool -_08080BB0: - ldr r4, =0x020322a4 - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - bl sub_808074C - movs r0, 0x2B - bl audio_play - ldr r0, [r4] - movs r5, 0xA0 - lsls r5, 1 - adds r0, r5 - bl sub_8082CB4 - movs r0, 0x2 - bl ShowBg - b _08080DAE - .pool -_08080BDC: - movs r1, 0x80 - lsls r1, 3 - movs r0, 0 - bl SetGpuRegBits - ldr r4, =0x020322a4 - ldr r2, [r4] - adds r1, r2, 0 - adds r1, 0x4A - movs r3, 0x80 - lsls r3, 2 - adds r0, r3, 0 - ldrh r5, [r1] - adds r0, r5 - strh r0, [r1] - movs r0, 0x8D - lsls r0, 1 - adds r1, r2, r0 - ldrh r0, [r1] - adds r0, 0x4 - strh r0, [r1] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xFF - bls _08080C5C - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - ldr r3, [r4] - movs r2, 0x8D - lsls r2, 1 - adds r1, r3, r2 - movs r0, 0x80 - lsls r0, 1 - strh r0, [r1] - ldr r2, =gUnknown_083399DC - ldr r1, =gUnknown_083399E4 - adds r0, r3, 0 - adds r0, 0x7C - ldrb r0, [r0] - subs r0, 0x2 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - adds r0, r3, 0 - adds r0, 0x4A - strh r1, [r0] - movs r0, 0xC - movs r1, 0x2 - bl SetGpuRegBits - ldr r0, [r4] - movs r3, 0x84 - lsls r3, 1 - adds r0, r3 - movs r1, 0 - str r1, [r0] - movs r0, 0x34 - bl audio_play - bl sub_80807BC -_08080C5C: - ldr r0, [r4] - movs r5, 0xA0 - lsls r5, 1 - adds r0, r5 - bl sub_8082CB4 - b _08080DAE - .pool -_08080C78: - bl sub_8083380 - lsls r0, 24 - cmp r0, 0 - beq _08080C8C - ldr r0, =0x020322a4 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_08080C8C: - ldr r0, =0x020322a4 - ldr r0, [r0] - movs r1, 0xA0 - lsls r1, 1 - adds r0, r1 - bl sub_8082CB4 - b _08080DAE - .pool -_08080CA0: - ldr r0, =gUnknown_08339C2C - movs r2, 0x10 - negs r2, r2 - movs r1, 0x78 - movs r3, 0x3 - bl AddObjectToFront -_08080CAE: - ldr r0, =0x020322a4 - ldr r1, [r0] -_08080CB2: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08080DAE - .pool -_08080CC4: - bl sub_8080DF8 - ldr r5, =0x020322a4 - ldr r4, [r5] - adds r1, r4, 0 - adds r1, 0x4C - movs r3, 0 - movs r2, 0 - movs r0, 0x80 - strh r0, [r1] - movs r1, 0x82 - lsls r1, 1 - adds r0, r4, r1 - str r2, [r0] - ldr r2, =0x00000123 - adds r0, r4, r2 - strb r3, [r0] - ldr r0, [r5] - adds r0, 0x72 - strb r3, [r0] - ldr r0, =sub_8081898 - bl SetMainCallback2 - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0x1 - bne _08080D44 - movs r0, 0xD0 - lsls r0, 2 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08080D30 - ldr r0, =sub_8081224 - movs r1, 0xA - bl CreateTask - ldr r1, [r5] - movs r3, 0x90 - lsls r3, 1 - adds r1, r3 - b _08080D42 - .pool -_08080D30: - ldr r0, =gUnknown_083399EC - ldr r0, [r0] - movs r1, 0xA - bl CreateTask - ldr r1, [r5] - movs r5, 0x90 - lsls r5, 1 - adds r1, r5 -_08080D42: - strb r0, [r1] -_08080D44: - ldr r1, =0x020375e0 - ldrh r0, [r1] - cmp r0, 0x1 - bls _08080D80 - movs r4, 0 - ldrh r1, [r1] - cmp r4, r1 - bge _08080D80 - movs r5, 0xA0 - lsls r5, 20 - ldr r6, =gUnknown_083399EC -_08080D5A: - ldm r6!, {r0} - lsrs r1, r5, 24 - bl CreateTask - ldr r1, =0x020322a4 - ldr r1, [r1] - movs r2, 0x90 - lsls r2, 1 - adds r1, r2 - adds r1, r4 - strb r0, [r1] - movs r3, 0x80 - lsls r3, 17 - adds r5, r3 - adds r4, 0x1 - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r4, r0 - blt _08080D5A -_08080D80: - bl current_map_music_get - lsls r0, 16 - lsrs r0, 16 - ldr r4, =0x00000193 - cmp r0, r4 - beq _08080D9E - bl current_map_music_get - ldr r1, =0x020322a4 - ldr r1, [r1] - movs r5, 0xAA - lsls r5, 1 - adds r1, r5 - strh r0, [r1] -_08080D9E: - adds r0, r4, 0 - bl song_play_for_text - movs r0, 0x35 - bl audio_play - bl sub_807F738 -_08080DAE: - ldr r0, =0x020322a4 - ldr r1, [r0] - movs r2, 0x8E - lsls r2, 1 - adds r0, r1, r2 - movs r3, 0 - ldrsh r0, [r0, r3] - movs r5, 0x8F - lsls r5, 1 - adds r1, r5 - movs r2, 0 - ldrsh r1, [r1, r2] - bl nullsub_31 - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80808D4 - - thumb_func_start sub_8080DF8 -sub_8080DF8: @ 8080DF8 - push {lr} - ldr r3, =0x03003110 - movs r0, 0 - ldr r1, =0x03003090 - movs r2, 0x3 -_08080E02: - strh r0, [r3] - strh r0, [r3, 0x4] - strh r0, [r1] - strh r0, [r1, 0x4] - adds r1, 0x10 - subs r2, 0x1 - cmp r2, 0 - bge _08080E02 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8080DF8 - - thumb_func_start sub_8080E20 -sub_8080E20: @ 8080E20 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r2, r0, r1 - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - lsls r0, 16 - asrs r0, 16 - movs r4, 0xA - ldrsh r1, [r2, r4] - cmp r0, r1 - ble _08080E58 - ldr r0, =0x03003090 - movs r4, 0xC - ldrsh r1, [r2, r4] - lsls r1, 4 - adds r0, 0x4 - adds r1, r0 - ldr r0, =0x00002345 - strh r0, [r1] - adds r0, r3, 0 - bl DestroyTask -_08080E58: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8080E20 - - thumb_func_start sub_8080E6C -sub_8080E6C: @ 8080E6C - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =sub_8080E20 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0xA] - strh r5, [r1, 0xC] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8080E6C - - thumb_func_start sub_8080EA4 -sub_8080EA4: @ 8080EA4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x020322a4 - ldr r0, [r4] - adds r0, 0x4A - ldrh r0, [r0] - movs r1, 0x1 - bl task_tutorial_oak_boy_girl - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _08080EC2 - b _08080FB8 -_08080EC2: - ldr r2, =0x03005e00 - lsls r1, r5, 2 - adds r0, r1, r5 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r6, r1, 0 - cmp r0, 0 - beq _08080ED8 - b _08080FC6 -_08080ED8: - ldr r0, [r4] - ldr r1, =0x00000123 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _08080F9A - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x0000028f - bl __udivsi3 - lsls r0, 24 - lsrs r1, r0, 24 - adds r3, r1, 0 - ldr r0, [r4] - adds r0, 0x4C - movs r4, 0 - ldrsh r2, [r0, r4] - ldr r0, =0x000001f3 - cmp r2, r0 - bgt _08080F40 - cmp r1, 0x4B - bls _08080F2C - ldr r1, =0x03003090 - ldr r0, =0x00004523 - b _08080F30 - .pool -_08080F2C: - ldr r1, =0x03003090 - ldr r0, =0x00005432 -_08080F30: - strh r0, [r1, 0x14] - ldr r0, =0x00005432 - b _08080F9E - .pool -_08080F40: - ldr r0, =0x000005db - cmp r2, r0 - bgt _08080F6E - cmp r1, 0x50 - bhi _08080F9A - adds r0, r1, 0 - subs r0, 0x15 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3B - bhi _08080F68 - ldr r1, =0x03003090 - ldr r0, =0x00005432 - b _08080F9E - .pool -_08080F68: - cmp r1, 0x9 - bhi _08080FA0 - b _08080F90 -_08080F6E: - cmp r1, 0x5A - bhi _08080F9A - adds r0, r1, 0 - subs r0, 0x47 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - bhi _08080F8C - ldr r1, =0x03003090 - ldr r0, =0x00005432 - b _08080F9E - .pool -_08080F8C: - cmp r3, 0x1D - bhi _08080FA0 -_08080F90: - movs r0, 0x1 - movs r1, 0x5 - bl sub_8080E6C - b _08080FA0 -_08080F9A: - ldr r1, =0x03003090 - ldr r0, =0x00004523 -_08080F9E: - strh r0, [r1, 0x14] -_08080FA0: - ldr r0, =0x03005e00 - adds r1, r6, r5 - lsls r1, 3 - adds r1, r0 - movs r0, 0x1 - b _08080FC4 - .pool -_08080FB8: - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r0, 0 -_08080FC4: - strh r0, [r1, 0x8] -_08080FC6: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8080EA4 - - thumb_func_start sub_8080FD0 -sub_8080FD0: @ 8080FD0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r6, =0x020322a4 - ldr r3, [r6] - adds r0, r3, 0 - adds r0, 0x4A - ldrh r0, [r0] - movs r1, 0xC0 - lsls r1, 5 - adds r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - adds r1, r3, 0 - adds r1, 0x9A - ldrb r1, [r1] - lsrs r2, r0, 8 - ldr r0, =gUnknown_083399E7 - adds r1, r0 - ldrb r1, [r1] - adds r0, r1, 0 - adds r0, 0x14 - cmp r2, r0 - bls _080810E0 - adds r0, 0x14 - cmp r2, r0 - bcs _080810E0 - ldr r2, =0x03005e00 - lsls r1, r4, 2 - adds r0, r1, r4 - lsls r0, 3 - adds r2, r0, r2 - movs r5, 0x8 - ldrsh r0, [r2, r5] - adds r5, r1, 0 - cmp r0, 0 - bne _080810EE - ldr r1, =0x00000123 - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080810CC - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x0000028f - bl __udivsi3 - lsls r0, 24 - lsrs r2, r0, 24 - adds r3, r2, 0 - ldr r0, [r6] - adds r0, 0x4C - movs r6, 0 - ldrsh r1, [r0, r6] - ldr r0, =0x000001f3 - cmp r1, r0 - bgt _08081088 - cmp r2, 0x42 - bls _08081078 - ldr r1, =0x03003090 - ldr r0, =0x00004523 - strh r0, [r1, 0x24] - b _080810B0 - .pool -_08081078: - ldr r1, =0x03003090 - ldr r0, =0x00005432 - strh r0, [r1, 0x24] - b _080810B0 - .pool -_08081088: - cmp r2, 0x41 - bls _08081092 - ldr r1, =0x03003090 - ldr r0, =0x00004523 - strh r0, [r1, 0x24] -_08081092: - adds r0, r2, 0 - subs r0, 0x29 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x18 - bhi _080810A4 - ldr r1, =0x03003090 - ldr r0, =0x00005432 - strh r0, [r1, 0x24] -_080810A4: - cmp r3, 0x9 - bhi _080810B0 - movs r0, 0x2 - movs r1, 0x5 - bl sub_8080E6C -_080810B0: - ldr r0, =0x03005e00 - adds r1, r5, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0x1 - b _080810EC - .pool -_080810CC: - ldr r0, =0x03003090 - ldr r1, =0x00004523 - strh r1, [r0, 0x24] - movs r0, 0x1 - strh r0, [r2, 0x8] - b _080810EE - .pool -_080810E0: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0 -_080810EC: - strh r0, [r1, 0x8] -_080810EE: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8080FD0 - - thumb_func_start sub_80810F8 -sub_80810F8: @ 80810F8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =0x020322a4 - ldr r3, [r5] - adds r0, r3, 0 - adds r0, 0x4A - ldrh r0, [r0] - movs r1, 0xC0 - lsls r1, 5 - adds r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - adds r1, r3, 0 - adds r1, 0x9C - ldrb r1, [r1] - lsrs r2, r0, 8 - ldr r0, =gUnknown_083399E7 - adds r1, r0 - ldrb r1, [r1] - adds r0, r1, 0 - adds r0, 0x14 - cmp r2, r0 - bls _0808120C - adds r0, 0x14 - cmp r2, r0 - bcs _0808120C - ldr r2, =0x03005e00 - lsls r1, r4, 2 - adds r0, r1, r4 - lsls r0, 3 - adds r2, r0, r2 - movs r6, 0x8 - ldrsh r0, [r2, r6] - adds r6, r1, 0 - cmp r0, 0 - bne _0808121A - ldr r1, =0x00000123 - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080811F8 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x0000028f - bl __udivsi3 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, [r5] - adds r0, 0x4C - movs r3, 0 - ldrsh r1, [r0, r3] - ldr r0, =0x000001f3 - cmp r1, r0 - bgt _080811AC - cmp r2, 0x58 - bls _0808119C - ldr r1, =0x03003090 - ldr r0, =0x00004523 - strh r0, [r1, 0x34] - b _080811DE - .pool -_0808119C: - ldr r1, =0x03003090 - ldr r0, =0x00005432 - strh r0, [r1, 0x34] - b _080811DE - .pool -_080811AC: - cmp r2, 0x3C - bls _080811C0 - ldr r1, =0x03003090 - ldr r0, =0x00004523 - b _080811D0 - .pool -_080811C0: - adds r0, r2, 0 - subs r0, 0x38 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bhi _080811D2 - ldr r1, =0x03003090 - ldr r0, =0x00005432 -_080811D0: - strh r0, [r1, 0x34] -_080811D2: - cmp r2, 0x4 - bhi _080811DE - movs r0, 0x3 - movs r1, 0x5 - bl sub_8080E6C -_080811DE: - ldr r0, =0x03005e00 - adds r1, r6, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0x1 - b _08081218 - .pool -_080811F8: - ldr r0, =0x03003090 - ldr r1, =0x00004523 - strh r1, [r0, 0x34] - movs r0, 0x1 - strh r0, [r2, 0x8] - b _0808121A - .pool -_0808120C: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0 -_08081218: - strh r0, [r1, 0x8] -_0808121A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80810F8 - - thumb_func_start sub_8081224 -sub_8081224: @ 8081224 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x020322a4 - ldr r0, [r0] - adds r0, 0x4A - ldrh r0, [r0] - movs r1, 0x1 - bl task_tutorial_oak_boy_girl - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08081270 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r2, r1, r0 - movs r1, 0x8 - ldrsh r0, [r2, r1] - cmp r0, 0 - bne _0808127E - ldr r0, =0x03003090 - ldr r1, =0x00004523 - strh r1, [r0, 0x14] - movs r0, 0x1 - strh r0, [r2, 0x8] - b _0808127E - .pool -_08081270: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0 - strh r0, [r1, 0x8] -_0808127E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8081224 - - thumb_func_start sub_8081288 -sub_8081288: @ 8081288 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r7, r0, 16 - mov r8, r7 - lsls r1, 24 - ldr r0, =gUnknown_08339B40 - ldr r4, =gUnknown_083399C8 - lsrs r1, 23 - adds r2, r1, r4 - ldrb r6, [r2] - ldr r5, =gUnknown_083399C0 - adds r2, r1, r5 - movs r3, 0 - ldrsb r3, [r2, r3] - lsls r2, r3, 2 - adds r2, r3 - lsls r2, 1 - subs r6, r2 - adds r4, 0x1 - adds r4, r1, r4 - ldrb r2, [r4] - adds r5, 0x1 - adds r1, r5 - movs r3, 0 - ldrsb r3, [r1, r3] - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 1 - subs r2, r1 - adds r1, r6, 0 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - adds r2, r1, 0 - ldr r0, =0x00004523 - cmp r7, r0 - bne _08081314 - lsls r4, r1, 4 - adds r4, r1 - lsls r4, 2 - ldr r5, =0x02020630 - adds r0, r4, r5 - movs r1, 0x2 - bl StartObjectImageAnim - adds r5, 0x1C - adds r4, r5 - ldr r0, =sub_8082F9C - str r0, [r4] - movs r0, 0x28 - bl audio_play - b _08081358 - .pool -_08081314: - ldr r0, =0x00005432 - cmp r7, r0 - bne _0808133C - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0 - bl StartObjectImageAnim - movs r0, 0x1F - bl audio_play - b _08081358 - .pool -_0808133C: - ldr r0, =0x00002345 - cmp r8, r0 - bne _08081358 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0x1 - bl StartObjectImageAnim - movs r0, 0x20 - bl audio_play -_08081358: - bl sub_8082E84 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8081288 - - thumb_func_start sub_8081370 -sub_8081370: @ 8081370 - push {r4-r7,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - bl sub_807F738 - ldr r0, =0x00004523 - cmp r4, r0 - beq _080813A4 - cmp r4, r0 - bgt _08081398 - ldr r0, =0x00002345 - cmp r4, r0 - beq _08081474 - b _080814A0 - .pool -_08081398: - ldr r0, =0x00005432 - cmp r5, r0 - beq _0808143C - b _080814A0 - .pool -_080813A4: - ldr r7, =0x020322a4 - ldr r4, [r7] - adds r5, r4, 0 - adds r5, 0x4C - ldrh r6, [r5] - movs r0, 0 - ldrsh r1, [r5, r0] - ldr r0, =0x000005db - cmp r1, r0 - bgt _080813E0 - ldr r1, =gUnknown_08339CC3 - adds r0, r4, 0 - adds r0, 0x7C - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - movs r0, 0xC0 - lsls r0, 1 - bl __divsi3 - adds r0, r6, r0 - strh r0, [r5] - b _080814A0 - .pool -_080813E0: - ldr r1, =gUnknown_08339CC3 - adds r0, r4, 0 - adds r0, 0x7C - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x80 - bl __divsi3 - adds r0, r6, r0 - strh r0, [r5] - movs r1, 0x8E - lsls r1, 1 - adds r4, r1 - movs r1, 0 - ldrsh r0, [r5, r1] - movs r1, 0x64 - bl __divsi3 - adds r1, r0, 0 - subs r1, 0xA - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_80832BC - ldr r0, [r7] - movs r1, 0x8F - lsls r1, 1 - adds r4, r0, r1 - adds r0, 0x4C - movs r1, 0 - ldrsh r0, [r0, r1] - movs r1, 0x64 - bl __divsi3 - adds r1, r0, 0 - subs r1, 0xA - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_80832BC - b _080814A0 - .pool -_0808143C: - ldr r0, =0x020322a4 - ldr r2, [r0] - adds r4, r2, 0 - adds r4, 0x4C - ldrh r5, [r4] - movs r0, 0 - ldrsh r1, [r4, r0] - ldr r0, =0x000005db - cmp r1, r0 - bgt _080814A0 - ldr r1, =gUnknown_08339CC3 - adds r0, r2, 0 - adds r0, 0x7C - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x80 - lsls r0, 1 - bl __divsi3 - adds r0, r5, r0 - b _0808149E - .pool -_08081474: - ldr r0, =0x020322a4 - ldr r0, [r0] - adds r4, r0, 0 - adds r4, 0x4C - ldr r1, =gUnknown_08339CC3 - adds r0, 0x7C - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x80 - lsls r0, 1 - bl __divsi3 - ldrh r1, [r4] - subs r1, r0 - strh r1, [r4] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x7F - bgt _080814A0 - movs r0, 0x80 -_0808149E: - strh r0, [r4] -_080814A0: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8081370 - - thumb_func_start sub_80814B0 -sub_80814B0: @ 80814B0 - push {lr} - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _080814E4 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _080814E4 - movs r0, 0xFF - lsls r0, 8 - ands r0, r3 - cmp r0, r2 - bne _080814EC - movs r0, 0x1 - b _080814EE - .pool -_080814E4: - cmp r3, r1 - bne _080814EC - movs r0, 0x1 - b _080814EE -_080814EC: - movs r0, 0 -_080814EE: - pop {r1} - bx r1 - thumb_func_end sub_80814B0 - - thumb_func_start sub_80814F4 -sub_80814F4: @ 80814F4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0 - beq _0808153C - ldr r3, =0x03003110 - ldrh r0, [r3, 0x4] - ldr r2, =0x03003090 - cmp r0, 0 - beq _0808151C - movs r1, 0 - strh r0, [r2, 0x4] - ldr r0, =0x00004444 - strh r0, [r2] - strh r1, [r3, 0x4] -_0808151C: - ldr r0, =0x03003090 - ldr r3, =0x00004444 - adds r1, r2, 0 - adds r1, 0x10 - adds r2, r0, 0 - adds r2, 0x14 - movs r7, 0x2 -_0808152A: - ldrh r0, [r2] - cmp r0, 0 - beq _08081532 - strh r3, [r1] -_08081532: - adds r1, 0x10 - adds r2, 0x10 - subs r7, 0x1 - cmp r7, 0 - bge _0808152A -_0808153C: - movs r7, 0 - ldr r1, =0x020322a4 - ldr r0, [r1] - adds r0, 0x7C - ldrb r0, [r0] - cmp r7, r0 - blt _0808154C - b _080816F6 -_0808154C: - ldr r0, =0x03003090 - adds r2, r0, 0 - adds r2, 0x20 - str r2, [sp] - movs r1, 0 - mov r9, r1 - movs r2, 0 - str r2, [sp, 0x4] - mov r8, r0 - ldr r0, =0x00005432 - mov r10, r0 -_08081562: - mov r1, r8 - ldrh r0, [r1] - ldr r1, =0x00004444 - movs r2, 0x88 - lsls r2, 7 - bl sub_80814B0 - cmp r0, 0 - bne _08081576 - b _080816D2 -_08081576: - ldr r6, =0x020322a4 - ldr r0, [r6] - adds r0, 0x96 - ldr r2, [sp, 0x4] - adds r0, r2 - ldrh r5, [r0] - mov r0, r8 - ldrh r4, [r0, 0x4] - ldr r1, =0x00004523 - cmp r4, r1 - bne _080815F4 - adds r0, r1, 0 - bl sub_8081370 - ldr r0, [r6] - movs r2, 0x8B - lsls r2, 1 - adds r4, r0, r2 - adds r0, 0x4C - movs r1, 0 - ldrsh r0, [r0, r1] - movs r1, 0x37 - bl __divsi3 - ldrh r1, [r4] - adds r1, r0 - strh r1, [r4] - lsls r1, 16 - ldr r0, =0x03e70000 - cmp r1, r0 - bls _080815BA - movs r0, 0xFA - lsls r0, 2 - strh r0, [r4] -_080815BA: - lsls r1, r5, 24 - lsrs r1, 24 - ldr r0, =0x00004523 - bl sub_8081288 - ldr r1, [r6] - movs r2, 0x92 - lsls r2, 1 - adds r1, r2 - add r1, r9 - ldrh r0, [r1] - adds r0, 0x1 - b _0808165E - .pool -_080815F4: - cmp r4, r10 - bne _08081632 - mov r0, r10 - bl sub_8081370 - ldr r0, [r6] - movs r1, 0x8B - lsls r1, 1 - adds r4, r0, r1 - adds r0, 0x4C - movs r2, 0 - ldrsh r0, [r0, r2] - movs r1, 0x46 - bl __divsi3 - ldrh r1, [r4] - adds r1, r0 - strh r1, [r4] - lsls r1, r5, 24 - lsrs r1, 24 - mov r0, r10 - bl sub_8081288 - ldr r1, [r6] - movs r0, 0x93 - lsls r0, 1 - adds r1, r0 - add r1, r9 - ldrh r0, [r1] - adds r0, 0x1 - b _0808165E -_08081632: - ldr r0, =0x00002345 - cmp r4, r0 - bne _0808166A - lsls r1, r5, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_8081288 - adds r0, r4, 0 - bl sub_8081370 - ldr r0, [r6] - movs r1, 0x94 - lsls r1, 1 - adds r0, r1 - mov r2, r9 - adds r1, r0, r2 - ldrh r2, [r1] - ldr r0, =0x000003e6 - cmp r2, r0 - bhi _08081660 - adds r0, r2, 0x1 -_0808165E: - strh r0, [r1] -_08081660: - mov r0, r8 - ldrh r1, [r0, 0x4] - ldr r0, =0x00002345 - cmp r1, r0 - beq _08081678 -_0808166A: - ldr r1, [sp] - ldrh r0, [r1] - ldr r2, =0x00004523 - cmp r0, r2 - beq _08081678 - cmp r0, r10 - bne _080816D2 -_08081678: - ldr r0, =0x020322a4 - ldr r0, [r0] - adds r2, r0, 0 - adds r2, 0x4C - movs r0, 0 - ldrsh r1, [r2, r0] - ldr r0, =0x000005dc - cmp r1, r0 - ble _080816C8 - adds r0, r1, 0 - ldr r2, =0xfffffd12 - adds r0, r2 - movs r1, 0x14 - bl __divsi3 - adds r1, r0, 0 - movs r0, 0x80 - lsls r0, 1 - adds r1, r0 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =0x03007420 - bl MPlayTempoControl - b _080816D2 - .pool -_080816C8: - ldr r0, =0x03007420 - movs r1, 0x80 - lsls r1, 1 - bl MPlayTempoControl -_080816D2: - ldr r1, [sp] - adds r1, 0x2 - str r1, [sp] - movs r2, 0x6 - add r9, r2 - ldr r0, [sp, 0x4] - adds r0, 0x2 - str r0, [sp, 0x4] - movs r1, 0x10 - add r8, r1 - adds r7, 0x1 - ldr r0, =0x020322a4 - ldr r0, [r0] - adds r0, 0x7C - ldrb r0, [r0] - cmp r7, r0 - bge _080816F6 - b _08081562 -_080816F6: - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0 - beq _08081722 - movs r7, 0 - ldr r3, =0x020322a4 - ldr r0, [r3] - adds r0, 0x7C - ldrb r0, [r0] - cmp r7, r0 - bge _08081722 - movs r2, 0 - ldr r1, =0x03003090 -_08081710: - strh r2, [r1] - strh r2, [r1, 0x4] - adds r1, 0x10 - adds r7, 0x1 - ldr r0, [r3] - adds r0, 0x7C - ldrb r0, [r0] - cmp r7, r0 - blt _08081710 -_08081722: - 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_80814F4 - - thumb_func_start sub_8081744 -sub_8081744: @ 8081744 - push {r4-r6,lr} - movs r4, 0 - movs r6, 0 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _0808175A - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r6, r0, 24 -_0808175A: - ldr r3, =0x020322a4 - ldr r1, [r3] - lsls r2, r6, 1 - adds r0, r1, 0 - adds r0, 0x96 - adds r0, r2 - ldrb r5, [r0] - adds r1, 0x63 - ldrb r0, [r1] - cmp r0, 0 - bne _0808182C - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0x2 - bne _080817A8 - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080817B6 - ldrh r2, [r2, 0x28] - ldr r1, =0x00000201 - adds r0, r1, 0 - ands r0, r2 - cmp r0, r1 - beq _080817B6 - b _080817BA - .pool -_080817A8: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080817B6 - movs r4, 0x1 -_080817B6: - cmp r4, 0 - beq _0808182C -_080817BA: - ldr r4, =0x020322a4 - ldr r1, [r4] - lsls r2, r5, 1 - adds r0, r1, 0 - adds r0, 0x8E - adds r0, r2 - adds r1, 0x50 - ldrh r0, [r0] - adds r1, r0 - ldrb r1, [r1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - adds r1, r5, 0x4 - lsls r1, 24 - lsrs r1, 24 - bl StartObjectImageAnim - ldr r0, [r4] - adds r0, 0x4A - ldrh r0, [r0] - adds r1, r6, 0 - bl task_tutorial_oak_boy_girl - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08081810 - ldr r1, =0x03003110 - ldr r0, =0x00004523 - b _08081828 - .pool -_08081810: - cmp r0, 0x1 - bne _08081824 - ldr r1, =0x03003110 - ldr r0, =0x00005432 - b _08081828 - .pool -_08081824: - ldr r1, =0x03003110 - ldr r0, =0x00002345 -_08081828: - strh r0, [r1, 0x4] - adds r3, r4, 0 -_0808182C: - ldr r1, [r3] - adds r1, 0x72 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bls _0808185A - ldr r0, [r3] - adds r1, r0, 0 - adds r1, 0x4C - ldrh r2, [r1] - movs r4, 0 - ldrsh r0, [r1, r4] - cmp r0, 0x80 - ble _08081852 - subs r0, r2, 0x1 - strh r0, [r1] -_08081852: - ldr r0, [r3] - adds r0, 0x72 - movs r1, 0 - strb r1, [r0] -_0808185A: - ldr r0, =0x020322d5 - ldrb r0, [r0] - cmp r0, 0 - beq _0808187E - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x80 - lsls r0, 2 - ands r0, r1 - cmp r0, 0 - beq _0808187E - ldr r0, [r3] - ldr r1, =0x00000123 - adds r2, r0, r1 - ldrb r0, [r2] - movs r1, 0x1 - eors r0, r1 - strb r0, [r2] -_0808187E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8081744 - - thumb_func_start sub_8081898 -sub_8081898: @ 8081898 - push {r4-r6,lr} - bl sub_8082D28 - ldr r4, =0x020322a4 - ldr r0, [r4] - movs r1, 0x82 - lsls r1, 1 - adds r2, r0, r1 - ldr r1, [r2] - ldr r0, =0x00057e03 - cmp r1, r0 - bhi _080818B4 - adds r0, r1, 0x1 - str r0, [r2] -_080818B4: - bl sub_8081744 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x4C - ldrh r0, [r0] - movs r5, 0x8B - lsls r5, 1 - adds r1, r5 - ldrh r1, [r1] - bl sub_800A994 - bl sub_80814F4 - ldr r0, [r4] - adds r0, r5 - ldrh r0, [r0] - movs r6, 0xFA - lsls r6, 2 - adds r1, r6, 0 - bl sub_8083140 - ldr r0, [r4] - adds r0, 0x4C - ldrh r0, [r0] - bl sub_8083230 - bl sub_808330C - bl sub_8082AD4 - ldr r2, [r4] - adds r3, r2, 0 - adds r3, 0x63 - ldrb r0, [r3] - cmp r0, 0 - bne _0808191A - movs r1, 0x8C - lsls r1, 1 - adds r0, r2, r1 - ldrh r1, [r0] - ldr r0, =0x000003e7 - cmp r1, r0 - bls _0808191A - adds r0, r2, r5 - strh r6, [r0] - movs r0, 0x1 - strb r0, [r3] - ldr r0, =sub_8081FC8 - bl SetMainCallback2 -_0808191A: - ldr r0, =0x020322a4 - ldr r1, [r0] - movs r2, 0x8E - lsls r2, 1 - adds r0, r1, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - movs r2, 0x8F - lsls r2, 1 - adds r1, r2 - movs r2, 0 - ldrsh r1, [r1, r2] - bl nullsub_31 - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8081898 - - thumb_func_start nullsub_31 -nullsub_31: @ 8081960 - bx lr - thumb_func_end nullsub_31 - - thumb_func_start help_system_is_not_first_time -help_system_is_not_first_time: @ 8081964 - push {r4,r5,lr} - lsls r1, 24 - lsls r2, 24 - lsrs r1, 20 - adds r4, r1, r0 - lsrs r2, 20 - adds r5, r2, r0 - ldrh r0, [r4] - ldrh r1, [r5] - cmp r0, r1 - bne _080819A2 - adds r0, r4, 0x2 - adds r1, r5, 0x2 - bl CompareString - cmp r0, 0 - bne _080819B0 - ldr r0, [r4, 0x8] - ldr r2, =0xffffff00 - ands r0, r2 - ldr r1, [r5, 0x8] - ands r1, r2 - cmp r0, r1 - bne _080819B0 - ldr r0, [r4, 0xC] - ldr r2, =0x00ffffff - ands r0, r2 - ldr r1, [r5, 0xC] - ands r1, r2 - cmp r0, r1 - bne _080819B0 -_080819A2: - movs r0, 0x1 - b _080819B2 - .pool -_080819B0: - movs r0, 0 -_080819B2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end help_system_is_not_first_time - - thumb_func_start sub_80819B8 -sub_80819B8: @ 80819B8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - mov r10, r0 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x10] - lsls r3, 24 - lsrs r3, 24 - mov r2, sp - movs r4, 0x5 -_080819D4: - ldrh r0, [r1] - strh r0, [r2] - adds r1, 0x2 - adds r2, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _080819D4 - movs r6, 0 - mov r1, sp - movs r4, 0x4 -_080819E8: - movs r2, 0 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _080819F2 - adds r6, 0x1 -_080819F2: - adds r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _080819E8 - cmp r6, 0x5 - beq _08081A46 - cmp r3, 0x3 - bhi _08081A46 - movs r4, 0 - ldr r3, [sp, 0x10] - cmp r4, r3 - bge _08081A5E - mov r3, r10 -_08081A0C: - movs r6, 0 - ldr r7, [sp, 0x10] - cmp r6, r7 - bge _08081A54 - mov r9, r3 - mov r5, r10 - lsls r0, r4, 24 - mov r8, r0 -_08081A1C: - mov r1, r9 - ldrh r0, [r1] - ldrh r2, [r5] - cmp r0, r2 - bne _08081A4A - cmp r4, r6 - beq _08081A4A - cmp r0, 0xAF - bne _08081A46 - lsls r2, r6, 24 - lsrs r2, 24 - mov r0, r10 - mov r7, r8 - lsrs r1, r7, 24 - str r3, [sp, 0xC] - bl help_system_is_not_first_time - lsls r0, 24 - ldr r3, [sp, 0xC] - cmp r0, 0 - beq _08081A4A -_08081A46: - movs r0, 0xC - b _08081B9E -_08081A4A: - adds r5, 0x10 - adds r6, 0x1 - ldr r0, [sp, 0x10] - cmp r6, r0 - blt _08081A1C -_08081A54: - adds r3, 0x10 - adds r4, 0x1 - ldr r1, [sp, 0x10] - cmp r4, r1 - blt _08081A0C -_08081A5E: - movs r2, 0 - mov r1, sp - movs r4, 0x4 -_08081A64: - movs r3, 0 - ldrsh r0, [r1, r3] - cmp r0, 0 - ble _08081A72 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_08081A72: - adds r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _08081A64 - cmp r2, 0x3 - bls _08081A82 - movs r0, 0xD - b _08081B9E -_08081A82: - cmp r2, 0x3 - bne _08081A8A - movs r0, 0xB - b _08081B9E -_08081A8A: - movs r4, 0 - mov r1, sp -_08081A8E: - movs r7, 0 - ldrsh r0, [r1, r7] - cmp r0, 0x32 - ble _08081A98 - b _08081B98 -_08081A98: - adds r1, 0x2 - adds r4, 0x1 - cmp r4, 0x4 - ble _08081A8E - cmp r2, 0x1 - bne _08081AEA - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - ble _08081AB2 - movs r0, 0x1 - b _08081B9E -_08081AB2: - mov r0, sp - ldrh r0, [r0, 0x2] - lsls r0, 16 - cmp r0, 0 - ble _08081AC0 - movs r0, 0x2 - b _08081B9E -_08081AC0: - mov r0, sp - movs r3, 0x4 - ldrsh r0, [r0, r3] - cmp r0, 0 - ble _08081ACE - movs r0, 0x3 - b _08081B9E -_08081ACE: - mov r0, sp - movs r4, 0x6 - ldrsh r0, [r0, r4] - cmp r0, 0 - ble _08081ADC - movs r0, 0x4 - b _08081B9E -_08081ADC: - mov r0, sp - movs r7, 0x8 - ldrsh r0, [r0, r7] - cmp r0, 0 - ble _08081AEA - movs r0, 0x5 - b _08081B9E -_08081AEA: - cmp r2, 0x2 - bne _08081B9C - movs r4, 0 - ldr r5, =0x03000df8 - mov r1, sp - adds r2, r5, 0 -_08081AF6: - movs r3, 0 - ldrsh r0, [r1, r3] - cmp r0, 0 - ble _08081B02 - strh r4, [r2] - adds r2, 0x2 -_08081B02: - adds r1, 0x2 - adds r4, 0x1 - cmp r4, 0x4 - ble _08081AF6 - movs r4, 0 - ldrsh r3, [r5, r4] - lsls r0, r3, 1 - mov r7, sp - adds r1, r7, r0 - movs r0, 0x2 - ldrsh r2, [r5, r0] - lsls r0, r2, 1 - add r0, sp - movs r4, 0 - ldrsh r1, [r1, r4] - movs r7, 0 - ldrsh r0, [r0, r7] - cmp r1, r0 - blt _08081B58 - adds r0, r3, 0 - cmp r0, 0 - bne _08081B38 - lsls r0, r2, 16 - b _08081B62 - .pool -_08081B38: - cmp r0, 0x1 - bne _08081B40 - lsls r0, r2, 16 - b _08081B6E -_08081B40: - cmp r0, 0x2 - bne _08081B48 - lsls r0, r2, 16 - b _08081B7A -_08081B48: - cmp r0, 0x3 - bne _08081B50 - lsls r0, r2, 16 - b _08081B86 -_08081B50: - cmp r0, 0x4 - bne _08081B9C - lsls r0, r2, 16 - b _08081B92 -_08081B58: - movs r2, 0x2 - ldrsh r0, [r5, r2] - cmp r0, 0 - bne _08081B68 - lsls r0, r3, 16 -_08081B62: - movs r1, 0x6 - orrs r0, r1 - b _08081B9E -_08081B68: - cmp r0, 0x1 - bne _08081B74 - lsls r0, r3, 16 -_08081B6E: - movs r1, 0x7 - orrs r0, r1 - b _08081B9E -_08081B74: - cmp r0, 0x2 - bne _08081B80 - lsls r0, r3, 16 -_08081B7A: - movs r1, 0x8 - orrs r0, r1 - b _08081B9E -_08081B80: - cmp r0, 0x3 - bne _08081B8C - lsls r0, r3, 16 -_08081B86: - movs r1, 0x9 - orrs r0, r1 - b _08081B9E -_08081B8C: - cmp r0, 0x4 - bne _08081B9C - lsls r0, r3, 16 -_08081B92: - movs r1, 0xA - orrs r0, r1 - b _08081B9E -_08081B98: - movs r0, 0xE - b _08081B9E -_08081B9C: - movs r0, 0 -_08081B9E: - 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_80819B8 - - thumb_func_start sub_8081BB0 -sub_8081BB0: @ 8081BB0 - ldr r1, =0x03000e04 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_8081BB0 - - thumb_func_start sub_8081BBC -sub_8081BBC: @ 8081BBC - ldr r0, =0x03000e04 - movs r1, 0 - ldrsh r0, [r0, r1] - bx lr - .pool - thumb_func_end sub_8081BBC - - thumb_func_start sub_8081BC8 -sub_8081BC8: @ 8081BC8 - ldr r1, =0x03000e06 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_8081BC8 - - thumb_func_start sub_8081BD4 -sub_8081BD4: @ 8081BD4 - ldr r0, =0x03000e06 - movs r1, 0 - ldrsh r0, [r0, r1] - bx lr - .pool - thumb_func_end sub_8081BD4 - - thumb_func_start sub_8081BE0 -sub_8081BE0: @ 8081BE0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - str r0, [sp] - mov r8, r1 - str r3, [sp, 0x4] - ldr r0, [sp, 0x30] - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x8] - ldr r7, =0x03000de8 - adds r2, r7, 0 - movs r1, 0 - adds r0, r7, 0 - adds r0, 0xA -_08081C0A: - strh r1, [r0] - subs r0, 0x2 - cmp r0, r2 - bge _08081C0A - movs r6, 0 - cmp r6, r9 - bge _08081C40 - ldr r0, =0x03000de8 - mov r12, r0 - ldr r5, [sp] - adds r5, 0x9 -_08081C20: - movs r3, 0 - adds r4, r5, 0 - mov r2, r12 -_08081C26: - adds r1, r4, r3 - ldrh r0, [r2] - ldrb r1, [r1] - adds r0, r1 - strh r0, [r2] - adds r2, 0x2 - adds r3, 0x1 - cmp r3, 0x5 - ble _08081C26 - adds r5, 0x10 - adds r6, 0x1 - cmp r6, r9 - blt _08081C20 -_08081C40: - movs r1, 0 - ldrsh r3, [r7, r1] - ldrh r0, [r7] - ldrh r1, [r7, 0x2] - subs r0, r1 - strh r0, [r7] - ldrh r0, [r7, 0x4] - subs r1, r0 - strh r1, [r7, 0x2] - ldrh r1, [r7, 0x6] - subs r0, r1 - strh r0, [r7, 0x4] - ldrh r0, [r7, 0x8] - subs r1, r0 - strh r1, [r7, 0x6] - subs r0, r3 - strh r0, [r7, 0x8] - movs r3, 0 - movs r2, 0 - adds r1, r7, 0 - movs r6, 0x4 -_08081C6A: - movs r4, 0 - ldrsh r0, [r1, r4] - cmp r0, 0 - bge _08081C76 - strh r2, [r1] - adds r3, 0x1 -_08081C76: - adds r1, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _08081C6A - lsls r0, r3, 24 - lsrs r0, 24 - mov r10, r0 - movs r4, 0 - ldr r1, =0x03000de8 - movs r6, 0x4 -_08081C8A: - ldrh r2, [r1] - movs r5, 0 - ldrsh r0, [r1, r5] - cmp r0, 0 - ble _08081CA4 - cmp r0, r3 - bge _08081CA0 - strh r4, [r1] - b _08081CA4 - .pool -_08081CA0: - subs r0, r2, r3 - strh r0, [r1] -_08081CA4: - adds r1, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _08081C8A - ldr r1, =0x03000de8 - ldr r2, =0x020322a8 - movs r6, 0x4 -_08081CB2: - movs r3, 0 - ldrsh r0, [r1, r3] - stm r2!, {r0} - adds r1, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _08081CB2 - ldr r1, =0x0000014d - ldr r0, [sp, 0x8] - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - adds r3, r0, 0 - adds r3, 0x64 - ldr r4, =0x020322d0 - str r3, [r4] - movs r6, 0x4 -_08081CD6: - movs r0, 0 - ldrsh r5, [r7, r0] - adds r0, r5, 0 - muls r0, r3 - movs r1, 0xA - str r3, [sp, 0xC] - bl __divsi3 - adds r5, r0, 0 - movs r1, 0xA - bl __modsi3 - adds r4, r0, 0 - adds r0, r5, 0 - movs r1, 0xA - bl __divsi3 - adds r5, r0, 0 - ldr r3, [sp, 0xC] - cmp r4, 0x4 - ble _08081D02 - adds r5, 0x1 -_08081D02: - strh r5, [r7] - adds r7, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _08081CD6 - ldr r1, =0x03000de8 - ldr r2, =0x020322bc - movs r6, 0x4 -_08081D12: - movs r3, 0 - ldrsh r0, [r1, r3] - stm r2!, {r0} - adds r1, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _08081D12 - ldr r4, =0x03000de8 - ldr r0, [sp] - adds r1, r4, 0 - mov r2, r9 - mov r3, r10 - bl sub_80819B8 - mov r5, r8 - strb r0, [r5] - movs r1, 0xA - ldrsh r0, [r4, r1] - mov r1, r9 - bl __divsi3 - mov r3, r9 - subs r0, r3 - strh r0, [r4, 0xA] - lsls r0, 16 - cmp r0, 0 - bge _08081D4C - movs r0, 0 - strh r0, [r4, 0xA] -_08081D4C: - mov r5, r8 - ldrb r0, [r5] - cmp r0, 0xC - bne _08081DA6 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - lsrs r3, r0, 16 - movs r6, 0 - ldr r0, =gUnknown_08339CC8 - adds r0, r3, r0 - ldrb r0, [r0] - adds r1, r4, 0 - movs r4, 0x1 - movs r3, 0x2 -_08081D74: - adds r2, r0, 0 - asrs r2, r6 - ands r2, r4 - cmp r2, 0 - beq _08081D9C - strh r3, [r1] - b _08081D9E - .pool -_08081D9C: - strh r2, [r1] -_08081D9E: - adds r1, 0x2 - adds r6, 0x1 - cmp r6, 0x4 - ble _08081D74 -_08081DA6: - ldr r7, =0x03000de8 - movs r2, 0xFF - adds r1, r7, 0 - movs r6, 0x5 -_08081DAE: - movs r3, 0 - ldrsh r0, [r1, r3] - cmp r0, 0xFF - ble _08081DB8 - strh r2, [r1] -_08081DB8: - adds r1, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _08081DAE - ldrh r0, [r7] - mov r4, r8 - strb r0, [r4, 0x1] - ldrh r0, [r7, 0x2] - strb r0, [r4, 0x2] - ldrh r0, [r7, 0x4] - strb r0, [r4, 0x3] - ldrh r0, [r7, 0x6] - strb r0, [r4, 0x4] - ldrh r0, [r7, 0x8] - strb r0, [r4, 0x5] - ldrh r0, [r7, 0xA] - strb r0, [r4, 0x6] - movs r6, 0 - adds r2, r7, 0 -_08081DDE: - ldr r5, [sp, 0x4] - adds r1, r5, r6 - ldrh r0, [r2] - strb r0, [r1] - adds r2, 0x2 - adds r6, 0x1 - cmp r6, 0x5 - ble _08081DDE - 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_8081BE0 - - thumb_func_start sub_8081E04 -sub_8081E04: @ 8081E04 - push {r4,lr} - sub sp, 0x4 - ldr r4, [sp, 0xC] - lsls r2, 24 - lsrs r2, 24 - lsls r4, 16 - lsrs r4, 16 - str r4, [sp] - bl sub_8081BE0 - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8081E04 - - thumb_func_start sub_8081E20 -sub_8081E20: @ 8081E20 - push {r4-r6,lr} - ldr r0, =0x020322a4 - ldr r0, [r0] - movs r2, 0x82 - lsls r2, 1 - adds r1, r0, r2 - ldrh r1, [r1] - adds r0, 0x4E - ldrh r4, [r0] - movs r2, 0 - ldr r5, =0x00000383 - cmp r1, r5 - bhi _08081E48 - movs r2, 0x5 - b _08081E9A - .pool -_08081E48: - ldr r3, =0xfffffc7c - adds r0, r1, r3 - lsls r0, 16 - lsrs r0, 16 - ldr r3, =0x00000257 - cmp r0, r3 - bhi _08081E64 - movs r2, 0x4 - b _08081E9A - .pool -_08081E64: - ldr r6, =0xfffffa24 - adds r0, r1, r6 - lsls r0, 16 - lsrs r0, 16 - cmp r0, r3 - bhi _08081E78 - movs r2, 0x3 - b _08081E9A - .pool -_08081E78: - ldr r3, =0xfffff7cc - adds r0, r1, r3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, r5 - bhi _08081E8C - movs r2, 0x2 - b _08081E9A - .pool -_08081E8C: - ldr r6, =0xfffff31c - adds r0, r1, r6 - lsls r0, 16 - ldr r1, =0x012b0000 - cmp r0, r1 - bhi _08081E9A - movs r2, 0x1 -_08081E9A: - lsls r0, r2, 16 - asrs r0, 16 - bl sub_8081BC8 - movs r2, 0 - cmp r4, 0x40 - bhi _08081F7C - adds r0, r4, 0 - subs r0, 0x32 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x31 - bhi _08081EC4 - ldr r2, =0x0000ffff - b _08081F7C - .pool -_08081EC4: - adds r0, r4, 0 - subs r0, 0x64 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x31 - bhi _08081ED8 - ldr r2, =0x0000fffe - b _08081F7C - .pool -_08081ED8: - adds r0, r4, 0 - subs r0, 0x96 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x31 - bhi _08081EEC - ldr r2, =0x0000fffd - b _08081F7C - .pool -_08081EEC: - adds r0, r4, 0 - subs r0, 0xC8 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x31 - bhi _08081F00 - ldr r2, =0x0000fffc - b _08081F7C - .pool -_08081F00: - adds r0, r4, 0 - subs r0, 0xFA - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x31 - bhi _08081F14 - ldr r2, =0x0000fffb - b _08081F7C - .pool -_08081F14: - ldr r1, =0xfffffea2 - adds r0, r4, r1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x31 - bhi _08081F2C - ldr r2, =0x0000fffa - b _08081F7C - .pool -_08081F2C: - ldr r3, =0xfffffe70 - adds r0, r4, r3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x31 - bhi _08081F44 - ldr r2, =0x0000fff9 - b _08081F7C - .pool -_08081F44: - ldr r6, =0xfffffe0c - adds r0, r4, r6 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x31 - bhi _08081F5C - ldr r2, =0x0000fff8 - b _08081F7C - .pool -_08081F5C: - ldr r1, =0xfffffdda - adds r0, r4, r1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x31 - bhi _08081F74 - ldr r2, =0x0000fff7 - b _08081F7C - .pool -_08081F74: - ldr r0, =0x00000257 - cmp r4, r0 - bls _08081F7C - ldr r2, =0x0000fff6 -_08081F7C: - lsls r0, r2, 16 - asrs r0, 16 - bl sub_8081BB0 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8081E20 - - thumb_func_start sub_8081F94 -sub_8081F94: @ 8081F94 - push {lr} - adds r1, r0, 0 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _08081FB8 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08081FB8 - movs r2, 0xBC - lsls r2, 6 - b _08081FBA - .pool -_08081FB8: - ldr r2, =0x00002fff -_08081FBA: - adds r0, r2, 0 - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8081F94 - - thumb_func_start sub_8081FC8 -sub_8081FC8: @ 8081FC8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, =0x020322a4 - ldr r0, [r4] - adds r0, 0x63 - ldrb r0, [r0] - cmp r0, 0x2 - bhi _08081FDE - bl sub_8082D28 -_08081FDE: - bl link_get_multiplayer_id - ldr r0, [r4] - adds r0, 0x63 - ldrb r0, [r0] - subs r0, 0x1 - cmp r0, 0xC - bls _08081FF0 - b _0808249E -_08081FF0: - lsls r0, 2 - ldr r1, =_08082004 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08082004: - .4byte _08082038 - .4byte _08082078 - .4byte _080820D4 - .4byte _080821C8 - .4byte _08082278 - .4byte _08082286 - .4byte _080822B0 - .4byte _08082458 - .4byte _080822E4 - .4byte _08082308 - .4byte _080823B0 - .4byte _08082430 - .4byte _0808246C -_08082038: - ldr r0, =0x03007420 - movs r1, 0x80 - lsls r1, 1 - bl MPlayTempoControl - movs r4, 0 - b _08082064 - .pool -_0808204C: - ldr r0, =0x020322a4 - ldr r0, [r0] - movs r1, 0x90 - lsls r1, 1 - adds r0, r1 - adds r0, r4 - ldrb r0, [r0] - bl DestroyTask - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_08082064: - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r4, r0 - bcc _0808204C - b _08082458 - .pool -_08082078: - ldr r4, =0x020322a4 - ldr r1, [r4] - adds r1, 0x4C - ldrh r0, [r1] - subs r0, 0x20 - strh r0, [r1] - lsls r0, 16 - cmp r0, 0 - bgt _080820C6 - bl sub_8009F8C - ldr r2, [r4] - adds r1, r2, 0 - adds r1, 0x4C - movs r0, 0 - strh r0, [r1] - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _080820B0 - adds r1, 0x17 - ldrb r0, [r1] - adds r0, 0x1 - b _080820B6 - .pool -_080820B0: - adds r1, r2, 0 - adds r1, 0x63 - movs r0, 0x5 -_080820B6: - strb r0, [r1] - ldr r0, =0x020322a4 - ldr r1, [r0] - movs r0, 0 - strb r0, [r1] - ldr r0, =0x03007630 - bl MPlayStop_rev01 -_080820C6: - bl sub_807F738 - b _0808249E - .pool -_080820D4: - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - beq _080820E0 - b _08082458 -_080820E0: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _080820EC - b _0808249E -_080820EC: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _0808218C - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _0808218C - ldr r3, =0x020322a4 - ldr r1, [r3] - movs r4, 0x8E - lsls r4, 5 - adds r2, r1, r4 - movs r5, 0x82 - lsls r5, 1 - adds r0, r1, r5 - ldr r0, [r0] - str r0, [r2] - adds r0, r1, 0 - adds r0, 0x4E - ldrh r0, [r0] - ldr r2, =0x000011c4 - adds r1, r2 - strh r0, [r1] - movs r4, 0 - mov r8, r3 - mov r12, r8 - ldr r7, =0x000011c8 - movs r6, 0x92 - lsls r6, 1 -_08082128: - movs r3, 0 - adds r5, r4, 0x1 - lsls r0, r4, 1 - adds r0, r4 - lsls r4, r0, 1 -_08082132: - mov r1, r12 - ldr r0, [r1] - lsls r1, r3, 1 - adds r1, r4 - adds r2, r0, r7 - adds r2, r1 - adds r0, r6 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x2 - bls _08082132 - lsls r0, r5, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _08082128 - mov r2, r8 - ldr r1, [r2] - movs r4, 0x8E - lsls r4, 5 - adds r1, r4 - movs r0, 0 - movs r2, 0x20 - bl link_0800A448 - lsls r0, 24 - cmp r0, 0 - bne _08082172 - b _0808249E -_08082172: - mov r5, r8 - ldr r1, [r5] - b _0808245C - .pool -_0808218C: - ldr r4, =0x020322a4 - ldr r3, [r4] - movs r0, 0xCC - lsls r0, 1 - adds r1, r3, r0 - movs r2, 0x82 - lsls r2, 1 - adds r0, r3, r2 - ldr r0, [r0] - str r0, [r1] - adds r0, r3, 0 - adds r0, 0x4E - ldrh r2, [r0] - movs r5, 0xCE - lsls r5, 1 - adds r0, r3, r5 - strh r2, [r0] - movs r0, 0 - movs r2, 0x28 - bl link_0800A448 - lsls r0, 24 - cmp r0, 0 - bne _080821BE - b _0808249E -_080821BE: - ldr r1, [r4] - b _0808245C - .pool -_080821C8: - bl sub_800A550 - lsls r0, 24 - cmp r0, 0 - bne _080821D4 - b _0808249E -_080821D4: - bl sub_800A5B4 - ldr r5, =0x020322a4 - ldr r1, [r5] - adds r1, 0x63 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _08082254 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08082254 - ldr r2, =0x020223c4 - ldr r3, [r5] - ldrh r0, [r2, 0x4] - adds r1, r3, 0 - adds r1, 0x4E - strh r0, [r1] - movs r0, 0x82 - lsls r0, 1 - adds r1, r3, r0 - ldr r0, [r2] - str r0, [r1] - movs r4, 0 - adds r7, r2, 0 - adds r7, 0x8 - adds r6, r5, 0 - movs r2, 0x92 - lsls r2, 1 -_08082216: - movs r3, 0 - adds r5, r4, 0x1 - lsls r0, r4, 1 - adds r0, r4 - lsls r4, r0, 1 -_08082220: - ldr r1, [r6] - lsls r0, r3, 1 - adds r0, r4 - adds r1, r2 - adds r1, r0 - adds r0, r7, r0 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x2 - bls _08082220 - lsls r0, r5, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _08082216 - b _0808249E - .pool -_08082254: - ldr r2, =0x020223c4 - ldr r0, =0x020322a4 - ldr r3, [r0] - ldrh r0, [r2, 0x4] - adds r1, r3, 0 - adds r1, 0x4E - strh r0, [r1] - movs r4, 0x82 - lsls r4, 1 - adds r1, r3, r4 - ldr r0, [r2] - str r0, [r1] - b _0808249E - .pool -_08082278: - bl sub_8083B08 - lsls r0, 24 - cmp r0, 0 - bne _08082284 - b _0808249E -_08082284: - b _08082458 -_08082286: - bl berry_blender_related - lsls r0, 24 - cmp r0, 0 - bne _08082292 - b _0808249E -_08082292: - ldr r0, =0x03005d98 - ldrb r0, [r0] - cmp r0, 0 - bne _080822A8 - movs r0, 0x22 - bl sav12_xor_increment - b _08082458 - .pool -_080822A8: - movs r0, 0x21 - bl sav12_xor_increment - b _08082458 -_080822B0: - ldr r6, =0x020322a4 - ldr r4, [r6] - ldr r5, =0x000011b8 - adds r4, r5 - ldr r5, =gUnknown_08339831 - bl sav2_get_text_speed - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_808417C - cmp r0, 0 - bne _080822D2 - b _0808249E -_080822D2: - ldr r1, [r6] - b _0808245C - .pool -_080822E4: - ldr r4, =0x020322a4 - ldr r0, [r4] - adds r0, 0x9E - movs r1, 0 - strb r1, [r0] - ldr r0, =gUnknown_083399B8 - movs r1, 0x1 - movs r2, 0xD - movs r3, 0 - bl CreateYesNoMenu - ldr r1, [r4] - b _0808245C - .pool -_08082308: - bl sub_8198C58 - lsls r0, 24 - asrs r2, r0, 24 - cmp r2, 0 - beq _0808236C - cmp r2, 0 - bgt _08082322 - movs r0, 0x1 - negs r0, r0 - cmp r2, r0 - beq _08082328 - b _0808249E -_08082322: - cmp r2, 0x1 - beq _08082328 - b _0808249E -_08082328: - ldr r2, =0x020322a4 - ldr r0, [r2] - adds r0, 0x9E - movs r1, 0x1 - strb r1, [r0] - ldr r1, [r2] - adds r1, 0x63 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r4, 0 -_0808233E: - ldr r0, =0x020322a4 - ldr r0, [r0] - lsls r1, r4, 1 - adds r0, 0x8E - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0xFF - beq _0808235C - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram -_0808235C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _0808233E - b _0808249E - .pool -_0808236C: - ldr r1, =0x020322a4 - ldr r0, [r1] - adds r0, 0x9E - strb r2, [r0] - ldr r1, [r1] - adds r1, 0x63 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r4, 0 -_08082380: - ldr r0, =0x020322a4 - ldr r0, [r0] - lsls r1, r4, 1 - adds r0, 0x8E - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0xFF - beq _0808239E - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram -_0808239E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _08082380 - b _0808249E - .pool -_080823B0: - ldr r6, =0x03003110 - adds r0, r6, 0 - bl sub_8081F94 - ldr r4, =0x020322a4 - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0x9E - ldrb r5, [r0] - cmp r5, 0 - bne _0808241C - movs r0, 0x4 - bl IsBagPocketNonEmpty - lsls r0, 24 - cmp r0, 0 - bne _080823EC - ldr r0, [r4] - adds r0, 0x70 - movs r1, 0x2 - strh r1, [r0] - ldr r0, =0x00009999 - b _08082414 - .pool -_080823EC: - bl sub_8136EF4 - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0808240C - ldr r0, [r4] - adds r0, 0x70 - movs r1, 0x3 - strh r1, [r0] - ldr r0, =0x0000aaaa - b _08082414 - .pool -_0808240C: - ldr r0, [r4] - adds r0, 0x70 - strh r5, [r0] - ldr r0, =0x00007779 -_08082414: - strh r0, [r6, 0x2] - b _08082458 - .pool -_0808241C: - adds r1, r2, 0 - adds r1, 0x70 - movs r0, 0x1 - strh r0, [r1] - ldr r0, =0x00008888 - strh r0, [r6, 0x2] - subs r1, 0xD - b _0808245E - .pool -_08082430: - ldr r0, =0x03005d98 - ldrb r0, [r0] - cmp r0, 0 - beq _08082458 - ldr r0, =sub_8082924 - bl SetMainCallback2 - ldr r2, =0x020322a4 - ldr r0, [r2] - adds r0, 0x63 - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - b _0808249C - .pool -_08082458: - ldr r0, =0x020322a4 - ldr r1, [r0] -_0808245C: - adds r1, 0x63 -_0808245E: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0808249E - .pool -_0808246C: - ldr r6, =0x020322a4 - ldr r4, [r6] - ldr r0, =0x000011b8 - adds r4, r0 - ldr r5, =gUnknown_0833981A - bl sav2_get_text_speed - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_808417C - cmp r0, 0 - beq _0808249E - ldr r0, =sub_8082644 - bl SetMainCallback2 - ldr r0, [r6] - adds r0, 0x63 - movs r1, 0 - strb r1, [r0] - ldr r0, [r6] -_0808249C: - strb r1, [r0] -_0808249E: - bl sub_808330C - ldr r4, =0x020322a4 - ldr r0, [r4] - adds r0, 0x4C - ldrh r0, [r0] - bl sub_8083230 - bl sub_8082AD4 - ldr r1, [r4] - movs r2, 0x8E - lsls r2, 1 - adds r0, r1, r2 - movs r4, 0 - ldrsh r0, [r0, r4] - movs r5, 0x8F - lsls r5, 1 - adds r1, r5 - movs r2, 0 - ldrsh r1, [r1, r2] - bl nullsub_31 - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8081FC8 - - thumb_func_start sub_80824FC -sub_80824FC: @ 80824FC - push {r4,lr} - ldr r1, =0x020322a4 - ldr r0, [r1] - movs r2, 0xD0 - lsls r2, 1 - adds r0, r2 - ldr r0, [r0] - adds r4, r1, 0 - cmp r0, 0x6 - bls _08082512 - b _0808263C -_08082512: - lsls r0, 2 - ldr r1, =_08082524 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08082524: - .4byte _08082540 - .4byte _08082558 - .4byte _08082584 - .4byte _08082594 - .4byte _080825BA - .4byte _08082600 - .4byte _0808261A -_08082540: - bl sub_800ADF8 - ldr r0, =0x020322a4 - ldr r2, [r0] - movs r3, 0xD0 - lsls r3, 1 - adds r1, r2, r3 - movs r0, 0x1 - b _0808260C - .pool -_08082558: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0808263C - ldr r0, =0x020322a4 - ldr r1, [r0] - movs r2, 0xD0 - lsls r2, 1 - adds r1, r2 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r1, =0x03002700 - movs r0, 0x1 - strb r0, [r1] - b _0808263C - .pool -_08082584: - bl sub_8153430 - ldr r0, =0x020322a4 - ldr r2, [r0] - b _08082602 - .pool -_08082594: - ldr r1, [r4] - movs r2, 0x84 - lsls r2, 1 - adds r1, r2 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - cmp r0, 0xA - bne _0808263C - bl sub_800ADF8 - ldr r1, [r4] - movs r3, 0xD0 - lsls r3, 1 - adds r1, r3 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - b _0808263C -_080825BA: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _0808263C - bl sub_8153474 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _080825E4 - ldr r0, =0x020322a4 - ldr r0, [r0] - movs r1, 0xD0 - lsls r1, 1 - adds r0, r1 - movs r1, 0x5 - str r1, [r0] - b _0808263C - .pool -_080825E4: - ldr r0, =0x020322a4 - ldr r1, [r0] - movs r3, 0x84 - lsls r3, 1 - adds r0, r1, r3 - str r2, [r0] - movs r0, 0xD0 - lsls r0, 1 - adds r1, r0 - movs r0, 0x3 - str r0, [r1] - b _0808263C - .pool -_08082600: - ldr r2, [r4] -_08082602: - movs r3, 0xD0 - lsls r3, 1 - adds r1, r2, r3 - ldr r0, [r1] - adds r0, 0x1 -_0808260C: - str r0, [r1] - movs r0, 0x84 - lsls r0, 1 - adds r1, r2, r0 - movs r0, 0 - str r0, [r1] - b _0808263C -_0808261A: - ldr r1, [r4] - movs r2, 0x84 - lsls r2, 1 - adds r1, r2 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - cmp r0, 0x5 - ble _0808263C - ldr r1, =0x03002700 - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - b _0808263E - .pool -_0808263C: - movs r0, 0 -_0808263E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80824FC - - thumb_func_start sub_8082644 -sub_8082644: @ 8082644 - push {r4-r6,lr} - sub sp, 0x4 - ldr r1, =0x020322a4 - ldr r0, [r1] - adds r0, 0x63 - ldrb r0, [r0] - adds r6, r1, 0 - cmp r0, 0xC - bls _08082658 - b _080828DC -_08082658: - lsls r0, 2 - ldr r1, =_0808266C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0808266C: - .4byte _080826A0 - .4byte _080826EC - .4byte _0808271C - .4byte _08082754 - .4byte _0808278C - .4byte _080827AA - .4byte _080827C8 - .4byte _080827FC - .4byte _08082818 - .4byte _08082828 - .4byte _0808284C - .4byte _080828A4 - .4byte _080828C6 -_080826A0: - ldr r1, [r6] - adds r0, r1, 0 - adds r0, 0x64 - ldrh r2, [r0] - ldr r0, =0x00002222 - cmp r2, r0 - bne _080826B0 - b _080827A2 -_080826B0: - ldr r0, =0x00001111 - cmp r2, r0 - beq _080826B8 - b _080828DC -_080826B8: - adds r0, r1, 0 - adds r0, 0x6C - ldrh r2, [r0] - ldr r0, =0x00009999 - cmp r2, r0 - bne _080826D8 - adds r1, 0x63 - movs r0, 0x2 - strb r0, [r1] - b _080828DC - .pool -_080826D8: - ldr r0, =0x0000aaaa - cmp r2, r0 - bne _080827A2 - adds r1, 0x63 - movs r0, 0x1 - strb r0, [r1] - b _080828DC - .pool -_080826EC: - ldr r0, [r6] - adds r0, 0x63 - movs r1, 0x3 - strb r1, [r0] - ldr r4, =0x02021fc4 - ldr r0, [r6] - adds r0, 0x6E - ldrh r0, [r0] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r0, =0x020229f0 - adds r1, r0 - adds r0, r4, 0 - bl CopyString - ldr r1, =gUnknown_083398DD - b _08082740 - .pool -_0808271C: - ldr r1, [r6] - adds r1, 0x63 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r4, =0x02021fc4 - ldr r0, [r6] - adds r0, 0x6E - ldrh r0, [r0] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r0, =0x020229f0 - adds r1, r0 - adds r0, r4, 0 - bl CopyString - ldr r1, =gUnknown_083398B0 -_08082740: - adds r0, r4, 0 - bl AppendString - b _080828DC - .pool -_08082754: - ldr r4, [r6] - ldr r0, =0x000011b8 - adds r4, r0 - ldr r5, =0x02021fc4 - bl sav2_get_text_speed - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_808417C - cmp r0, 0 - bne _08082774 - b _080828DC -_08082774: - ldr r1, [r6] - movs r0, 0x84 - lsls r0, 1 - adds r2, r1, r0 - movs r0, 0 - str r0, [r2] - b _080828BC - .pool -_0808278C: - ldr r4, [r6] - movs r2, 0x84 - lsls r2, 1 - adds r1, r4, r2 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - cmp r0, 0x3C - bgt _080827A0 - b _080828DC -_080827A0: - adds r1, r4, 0 -_080827A2: - adds r1, 0x63 - movs r0, 0x5 - strb r0, [r1] - b _080828DC -_080827AA: - ldr r0, [r6] - ldr r1, =0x000011b8 - adds r0, r1 - ldr r1, =gUnknown_085EE42D - movs r2, 0 - bl sub_808417C - bl sub_800ADF8 - b _080828BA - .pool -_080827C8: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _080827D4 - b _080828DC -_080827D4: - ldr r3, =0x020322a4 - ldr r1, [r3] - movs r2, 0x84 - lsls r2, 1 - adds r0, r1, r2 - movs r2, 0 - str r2, [r0] - adds r1, 0x63 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r3] - movs r1, 0xD0 - lsls r1, 1 - adds r0, r1 - str r2, [r0] - b _080828DC - .pool -_080827FC: - bl sub_80824FC - lsls r0, 24 - cmp r0, 0 - beq _080828DC - movs r0, 0x37 - bl audio_play - ldr r0, =0x020322a4 - ldr r1, [r0] - b _080828BC - .pool -_08082818: - ldr r1, [r6] - adds r1, 0x63 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - bl sub_800ADF8 - b _080828DC -_08082828: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080828DC - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x020322a4 - ldr r1, [r0] - b _080828BC - .pool -_0808284C: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _080828DC - ldr r2, [r6] - adds r0, r2, 0 - adds r0, 0x64 - ldrh r1, [r0] - ldr r0, =0x00002222 - cmp r1, r0 - bne _08082898 - bl FreeAllWindowBuffers - movs r0, 0x2 - bl UnsetBgTilemapBuffer - movs r0, 0x1 - bl UnsetBgTilemapBuffer - ldr r0, [r6] - bl Free - str r4, [r6] - ldr r0, =sub_807FA80 - bl SetMainCallback2 - b _080828DC - .pool -_08082898: - movs r1, 0x84 - lsls r1, 1 - adds r0, r2, r1 - str r4, [r0] - adds r1, r2, 0 - b _080828BC -_080828A4: - ldr r1, [r6] - movs r2, 0x84 - lsls r2, 1 - adds r1, r2 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - cmp r0, 0x1E - ble _080828DC - bl sub_800AC34 -_080828BA: - ldr r1, [r6] -_080828BC: - adds r1, 0x63 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080828DC -_080828C6: - ldr r0, =0x03003124 - ldrb r4, [r0] - cmp r4, 0 - bne _080828DC - ldr r0, [r6] - bl Free - str r4, [r6] - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 -_080828DC: - bl sub_8082AD4 - ldr r0, =0x020322a4 - ldr r1, [r0] - movs r2, 0x8E - lsls r2, 1 - adds r0, r1, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - movs r2, 0x8F - lsls r2, 1 - adds r1, r2 - movs r2, 0 - ldrsh r1, [r1, r2] - bl nullsub_31 - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8082644 - - thumb_func_start sub_8082924 -sub_8082924: @ 8082924 - push {r4-r6,lr} - ldr r1, =0x020322a4 - ldr r0, [r1] - adds r0, 0x63 - ldrb r0, [r0] - adds r6, r1, 0 - cmp r0, 0xA - bls _08082936 - b _08082A92 -_08082936: - lsls r0, 2 - ldr r1, =_08082948 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08082948: - .4byte _08082974 - .4byte _080829AA - .4byte _080829D4 - .4byte _08082A00 - .4byte _08082A92 - .4byte _08082A92 - .4byte _08082A92 - .4byte _08082A92 - .4byte _08082A92 - .4byte _08082A30 - .4byte _08082A48 -_08082974: - ldr r1, [r6] - adds r0, r1, 0 - adds r0, 0x70 - ldrh r0, [r0] - cmp r0, 0x1 - bhi _08082986 - adds r1, 0x63 - movs r0, 0x9 - strb r0, [r1] -_08082986: - ldr r2, [r6] - adds r0, r2, 0 - adds r0, 0x70 - ldrh r1, [r0] - cmp r1, 0x2 - bne _08082996 - subs r0, 0xD - strb r1, [r0] -_08082996: - ldr r1, [r6] - adds r0, r1, 0 - adds r0, 0x70 - ldrh r0, [r0] - cmp r0, 0x3 - bne _08082A92 - adds r1, 0x63 - movs r0, 0x1 - strb r0, [r1] - b _08082A92 -_080829AA: - ldr r0, [r6] - adds r0, 0x63 - movs r2, 0 - movs r1, 0x3 - strb r1, [r0] - ldr r0, [r6] - ldr r1, =0x000011b8 - adds r0, r1 - strh r2, [r0] - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_08339896 - bl CopyString - b _08082A92 - .pool -_080829D4: - ldr r1, [r6] - adds r1, 0x63 - ldrb r0, [r1] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1] - ldr r0, [r6] - ldr r1, =0x000011b8 - adds r0, r1 - strh r2, [r0] - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_08339858 - bl CopyString - b _08082A92 - .pool -_08082A00: - ldr r4, [r6] - ldr r2, =0x000011b8 - adds r4, r2 - ldr r5, =0x02021fc4 - bl sav2_get_text_speed - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_808417C - cmp r0, 0 - beq _08082A92 - ldr r0, [r6] - adds r0, 0x63 - movs r1, 0x9 - strb r1, [r0] - b _08082A92 - .pool -_08082A30: - movs r0, 0x3 - bl sub_80A2390 - ldr r0, =0x020322a4 - ldr r1, [r0] - adds r1, 0x63 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08082A92 - .pool -_08082A48: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08082A92 - ldr r0, [r6] - adds r0, 0x70 - ldrh r0, [r0] - cmp r0, 0 - bne _08082A70 - ldr r0, =sub_807FA80 - bl SetMainCallback2 - b _08082A76 - .pool -_08082A70: - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 -_08082A76: - bl FreeAllWindowBuffers - movs r0, 0x2 - bl UnsetBgTilemapBuffer - movs r0, 0x1 - bl UnsetBgTilemapBuffer - ldr r4, =0x020322a4 - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] -_08082A92: - bl sub_8082AD4 - ldr r0, =0x020322a4 - ldr r1, [r0] - movs r2, 0x8E - lsls r2, 1 - adds r0, r1, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - movs r2, 0x8F - lsls r2, 1 - adds r1, r2 - movs r2, 0 - ldrsh r1, [r1, r2] - bl nullsub_31 - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8082924 - - thumb_func_start sub_8082AD4 -sub_8082AD4: @ 8082AD4 - push {r4-r7,lr} - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08082AE0 - b _08082CA4 -_08082AE0: - ldr r4, =0x03003090 - ldrh r0, [r4] - ldr r1, =0x00002fff - movs r2, 0xBC - lsls r2, 6 - bl sub_80814B0 - cmp r0, 0 - beq _08082B66 - ldrh r1, [r4, 0x2] - ldr r0, =0x00001111 - cmp r1, r0 - bne _08082B58 - ldrh r3, [r4, 0x4] - ldr r0, =0x00009999 - cmp r3, r0 - beq _08082B38 - cmp r3, r0 - bgt _08082B24 - ldr r0, =0x00008888 - b _08082B26 - .pool -_08082B24: - ldr r0, =0x0000aaaa -_08082B26: - cmp r3, r0 - beq _08082B38 - ldr r2, =0x020322a4 - b _08082B48 - .pool -_08082B38: - ldr r2, =0x020322a4 - ldr r0, [r2] - adds r1, r0, 0 - adds r1, 0x6C - strh r3, [r1] - ldrh r1, [r4, 0x6] - adds r0, 0x6E - strh r1, [r0] -_08082B48: - ldr r0, [r2] - adds r0, 0x64 - ldr r1, =0x00001111 - b _08082B64 - .pool -_08082B58: - ldr r0, =0x00002222 - cmp r1, r0 - bne _08082B66 - ldr r0, =0x020322a4 - ldr r0, [r0] - adds r0, 0x64 -_08082B64: - strh r1, [r0] -_08082B66: - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - beq _08082B72 - b _08082CA4 -_08082B72: - ldr r2, =0x020322a4 - ldr r0, [r2] - adds r0, 0x64 - ldrh r1, [r0] - ldr r0, =0x00001111 - cmp r1, r0 - bne _08082B82 - b _08082CA4 -_08082B82: - ldr r0, =0x00002222 - cmp r1, r0 - bne _08082B8A - b _08082CA4 -_08082B8A: - movs r5, 0 - adds r7, r2, 0 - b _08082BF4 - .pool -_08082B9C: - ldr r6, =0x03003090 - lsls r4, r5, 4 - adds r0, r4, r6 - ldrh r0, [r0] - ldr r1, =0x00002fff - movs r2, 0xBC - lsls r2, 6 - bl sub_80814B0 - cmp r0, 0 - beq _08082BEE - adds r0, r6, 0x2 - adds r0, r4, r0 - ldrh r2, [r0] - ldr r0, =0x00008888 - cmp r2, r0 - beq _08082BE4 - cmp r2, r0 - bgt _08082BD8 - ldr r0, =0x00007779 - b _08082BE0 - .pool -_08082BD8: - ldr r0, =0x00009999 - cmp r2, r0 - beq _08082BE4 - ldr r0, =0x0000aaaa -_08082BE0: - cmp r2, r0 - bne _08082BEE -_08082BE4: - ldr r0, [r7] - lsls r1, r5, 1 - adds r0, 0x64 - adds r0, r1 - strh r2, [r0] -_08082BEE: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_08082BF4: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bcc _08082B9C - movs r5, 0 - b _08082C12 - .pool -_08082C0C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_08082C12: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bcs _08082C2E - ldr r0, =0x020322a4 - ldr r0, [r0] - lsls r1, r5, 1 - adds r0, 0x64 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - bne _08082C0C -_08082C2E: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bne _08082CA4 - movs r5, 0 - ldr r4, =0x00007779 - b _08082C4E - .pool -_08082C48: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_08082C4E: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bcs _08082C6A - ldr r0, =0x020322a4 - ldr r0, [r0] - lsls r1, r5, 1 - adds r0, 0x64 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r4 - beq _08082C48 -_08082C6A: - ldr r4, =0x03003110 - adds r0, r4, 0 - bl sub_8081F94 - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bne _08082C90 - ldr r0, =0x00002222 - strh r0, [r4, 0x2] - b _08082CA4 - .pool -_08082C90: - ldr r0, =0x00001111 - strh r0, [r4, 0x2] - ldr r0, =0x020322a4 - ldr r0, [r0] - lsls r1, r5, 1 - adds r0, 0x64 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r4, 0x4] - strh r5, [r4, 0x6] -_08082CA4: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8082AD4 - - thumb_func_start sub_8082CB4 -sub_8082CB4: @ 8082CB4 - push {r4,lr} - sub sp, 0x14 - movs r1, 0xF0 - lsls r1, 7 - str r1, [sp] - movs r1, 0xA0 - lsls r1, 7 - str r1, [sp, 0x4] - mov r3, sp - ldr r1, =0x020322a4 - ldr r1, [r1] - mov r12, r1 - movs r1, 0x8E - lsls r1, 1 - add r1, r12 - ldrh r2, [r1] - movs r1, 0x78 - subs r1, r2 - strh r1, [r3, 0x8] - movs r1, 0x8F - lsls r1, 1 - add r1, r12 - ldrh r2, [r1] - movs r1, 0x50 - subs r1, r2 - strh r1, [r3, 0xA] - mov r2, sp - movs r3, 0x8D - lsls r3, 1 - add r3, r12 - ldrh r1, [r3] - strh r1, [r2, 0xC] - ldrh r1, [r3] - strh r1, [r2, 0xE] - mov r1, r12 - adds r1, 0x4A - ldrh r1, [r1] - strh r1, [r2, 0x10] - mov r1, sp - ldm r1!, {r2-r4} - stm r0!, {r2-r4} - ldm r1!, {r2,r3} - stm r0!, {r2,r3} - add sp, 0x14 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8082CB4 - - thumb_func_start sub_8082D18 -sub_8082D18: @ 8082D18 - ldr r0, =0x020322a4 - ldr r0, [r0] - adds r0, 0x4A - ldrh r0, [r0] - bx lr - .pool - thumb_func_end sub_8082D18 - - thumb_func_start sub_8082D28 -sub_8082D28: @ 8082D28 - push {r4,lr} - movs r1, 0 - ldr r4, =0x03003124 - ldrb r0, [r4] - cmp r0, 0 - beq _08082D3C - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r1, r0, 24 -_08082D3C: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08082DCC - ldrb r0, [r4] - cmp r0, 0 - beq _08082DCC - cmp r1, 0 - bne _08082D90 - ldr r0, =0x020322a4 - ldr r3, [r0] - adds r2, r3, 0 - adds r2, 0x4A - adds r0, r3, 0 - adds r0, 0x4C - ldrh r0, [r0] - ldrh r1, [r2] - adds r0, r1 - strh r0, [r2] - ldr r1, =0x03003110 - movs r4, 0x8B - lsls r4, 1 - adds r0, r3, r4 - ldrh r0, [r0] - strh r0, [r1, 0xA] - ldrh r0, [r2] - strh r0, [r1, 0xC] - movs r1, 0xA0 - lsls r1, 1 - adds r0, r3, r1 - bl sub_8082CB4 - b _08082DEA - .pool -_08082D90: - ldr r3, =0x03003090 - ldrh r0, [r3] - movs r1, 0xFF - lsls r1, 8 - ands r1, r0 - movs r0, 0x88 - lsls r0, 7 - cmp r1, r0 - bne _08082DEA - ldr r0, =0x020322a4 - ldr r2, [r0] - ldrh r0, [r3, 0xA] - movs r4, 0x8B - lsls r4, 1 - adds r1, r2, r4 - strh r0, [r1] - ldrh r0, [r3, 0xC] - adds r1, r2, 0 - adds r1, 0x4A - strh r0, [r1] - movs r1, 0xA0 - lsls r1, 1 - adds r0, r2, r1 - bl sub_8082CB4 - b _08082DEA - .pool -_08082DCC: - ldr r0, =0x020322a4 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x4A - adds r0, r1, 0 - adds r0, 0x4C - ldrh r0, [r0] - ldrh r3, [r2] - adds r0, r3 - strh r0, [r2] - movs r4, 0xA0 - lsls r4, 1 - adds r0, r1, r4 - bl sub_8082CB4 -_08082DEA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8082D28 - - thumb_func_start sub_8082DF4 -sub_8082DF4: @ 8082DF4 - push {r4-r6,lr} - ldr r4, =0x020322a4 - ldr r0, [r4] - movs r6, 0x8E - lsls r6, 1 - adds r0, r6 - ldrh r1, [r0] - movs r0, 0x14 - bl SetGpuReg - ldr r0, [r4] - movs r5, 0x8F - lsls r5, 1 - adds r0, r5 - ldrh r1, [r0] - movs r0, 0x16 - bl SetGpuReg - ldr r0, [r4] - adds r0, r6 - ldrh r1, [r0] - movs r0, 0x10 - bl SetGpuReg - ldr r0, [r4] - adds r0, r5 - ldrh r1, [r0] - movs r0, 0x12 - bl SetGpuReg - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8082DF4 - - thumb_func_start sub_8082E3C -sub_8082E3C: @ 8082E3C - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - ldrh r1, [r2, 0x32] - adds r0, r1 - strh r0, [r2, 0x32] - ldrh r0, [r2, 0x30] - ldrh r1, [r2, 0x34] - adds r0, r1 - strh r0, [r2, 0x34] - movs r1, 0x32 - ldrsh r0, [r2, r1] - cmp r0, 0 - bge _08082E5A - adds r0, 0x7 -_08082E5A: - asrs r0, 3 - strh r0, [r2, 0x24] - movs r1, 0x34 - ldrsh r0, [r2, r1] - cmp r0, 0 - bge _08082E68 - adds r0, 0x7 -_08082E68: - asrs r0, 3 - strh r0, [r2, 0x26] - adds r0, r2, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08082E80 - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles -_08082E80: - pop {r0} - bx r0 - thumb_func_end sub_8082E3C - - thumb_func_start sub_8082E84 -sub_8082E84: @ 8082E84 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - bl GenerateRandomNumber - lsls r0, 16 - lsrs r1, r0, 16 - movs r0, 0x1 - ands r1, r0 - adds r0, r1, 0x1 - cmp r0, 0 - beq _08082F40 - ldr r0, =gUnknown_08329F40 - mov r9, r0 - ldr r2, =0x02020630 - mov r10, r2 - adds r6, r1, 0x1 - movs r3, 0x1F - mov r8, r3 - movs r7, 0x10 -_08082EB0: - bl GenerateRandomNumber - ldr r1, =0x020322a4 - ldr r4, [r1] - adds r4, 0x4A - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x14 - bl __umodsi3 - ldrh r1, [r4] - adds r1, r0 - lsls r1, 16 - movs r0, 0xFF - lsls r0, 16 - ands r0, r1 - lsrs r2, r0, 16 - adds r0, r2, 0 - adds r0, 0x40 - lsls r0, 1 - add r0, r9 - movs r3, 0 - ldrsh r1, [r0, r3] - cmp r1, 0 - bge _08082EE4 - adds r1, 0x3 -_08082EE4: - asrs r1, 2 - lsls r0, r2, 1 - add r0, r9 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0 - bge _08082EF4 - adds r0, 0x3 -_08082EF4: - asrs r2, r0, 2 - adds r1, 0x78 - adds r2, 0x50 - ldr r0, =gUnknown_08339BE0 - movs r3, 0x1 - bl AddObjectToFront - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl GenerateRandomNumber - lsls r5, r4, 4 - adds r5, r4 - lsls r5, 2 - mov r3, r10 - adds r4, r5, r3 - lsls r0, 16 - lsrs r0, 16 - mov r1, r8 - ands r0, r1 - subs r0, r7, r0 - strh r0, [r4, 0x2E] - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - mov r2, r8 - ands r0, r2 - subs r0, r7, r0 - strh r0, [r4, 0x30] - ldr r3, =0x0202064c - adds r5, r3 - ldr r0, =sub_8082E3C - str r0, [r5] - subs r6, 0x1 - cmp r6, 0 - bne _08082EB0 -_08082F40: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8082E84 - - thumb_func_start sub_8082F68 -sub_8082F68: @ 8082F68 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r1, 0x3 - bl __divsi3 - negs r0, r0 - strh r0, [r4, 0x26] - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08082F94 - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_08082F94: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8082F68 - - thumb_func_start sub_8082F9C -sub_8082F9C: @ 8082F9C - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - movs r1, 0x2E - ldrsh r0, [r2, r1] - lsls r0, 1 - negs r0, r0 - strh r0, [r2, 0x26] - lsls r0, 16 - asrs r0, 16 - movs r1, 0xC - negs r1, r1 - cmp r0, r1 - bge _08082FC0 - ldr r0, =0x0000fff4 - strh r0, [r2, 0x26] -_08082FC0: - adds r0, r2, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08082FD4 - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles -_08082FD4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8082F9C - - thumb_func_start sub_8082FDC -sub_8082FDC: @ 8082FDC - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - ldr r2, =0x020322a4 - ldr r3, [r2] - lsls r4, r0, 1 - adds r2, r3, 0 - adds r2, 0x74 - adds r2, r4 - strh r1, [r2] - lsls r0, 4 - movs r2, 0xAC - lsls r2, 1 - adds r0, r2 - adds r3, r0 - adds r0, r3, 0 - bl sub_807FE14 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8082FDC - - thumb_func_start sub_8083010 -sub_8083010: @ 8083010 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0808304C - cmp r0, 0x1 - bgt _08083026 - cmp r0, 0 - beq _0808302C - b _080830B2 -_08083026: - cmp r0, 0x2 - beq _08083066 - b _080830B2 -_0808302C: - ldrh r0, [r4, 0x30] - adds r0, 0x8 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x58 - ble _080830B2 - movs r0, 0x58 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0x38 - bl audio_play - b _080830B2 -_0808304C: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _080830B2 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0 - strh r0, [r4, 0x32] - b _080830B2 -_08083066: - ldrh r0, [r4, 0x30] - adds r0, 0x4 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB0 - ble _080830B2 - ldrh r0, [r4, 0x34] - adds r0, 0x1 - adds r1, r0, 0 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bne _080830A0 - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - ldr r0, =gUnknown_08339C60 - movs r2, 0x14 - negs r2, r2 - movs r1, 0x78 - movs r3, 0x2 - bl AddObjectToFront - b _080830B2 - .pool -_080830A0: - movs r0, 0 - strh r0, [r4, 0x2E] - ldr r0, =0x0000fff0 - strh r0, [r4, 0x30] - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim -_080830B2: - ldrh r0, [r4, 0x30] - strh r0, [r4, 0x26] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8083010 - - thumb_func_start sub_80830C0 -sub_80830C0: @ 80830C0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080830FC - cmp r0, 0x1 - bgt _080830D6 - cmp r0, 0 - beq _080830DC - b _08083130 -_080830D6: - cmp r0, 0x2 - beq _08083112 - b _08083130 -_080830DC: - ldrh r0, [r4, 0x30] - adds r0, 0x8 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5C - ble _08083130 - movs r0, 0x5C - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0x15 - bl audio_play - b _08083130 -_080830FC: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _08083130 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _08083130 -_08083112: - ldrh r0, [r4, 0x30] - adds r0, 0x4 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB0 - ble _08083130 - ldr r0, =0x020322a4 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_08083130: - ldrh r0, [r4, 0x30] - strh r0, [r4, 0x26] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80830C0 - - thumb_func_start sub_8083140 -sub_8083140: @ 8083140 - push {lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - lsrs r3, r1, 16 - ldr r1, =0x020322a4 - ldr r1, [r1] - movs r2, 0x8C - lsls r2, 1 - adds r1, r2 - ldrh r2, [r1] - cmp r2, r0 - bcs _08083166 - adds r0, r2, 0x2 - strh r0, [r1] - ldrh r0, [r1] - adds r1, r3, 0 - bl sub_8083170 -_08083166: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8083140 - - thumb_func_start sub_8083170 -sub_8083170: @ 8083170 - push {r4-r7,lr} - lsls r0, 16 - lsls r1, 16 - lsrs r1, 16 - ldr r7, =0x06006000 - lsrs r0, 10 - bl __divsi3 - adds r1, r0, 0 - cmp r1, 0 - bge _08083188 - adds r0, r1, 0x7 -_08083188: - asrs r4, r0, 3 - movs r3, 0 - cmp r3, r4 - bge _080831B0 - ldr r0, =0x000080e9 - adds r6, r0, 0 - adds r0, 0x10 - adds r5, r0, 0 - adds r2, r7, 0 - adds r2, 0x56 - adds r0, r7, 0 - adds r3, r4, 0 -_080831A0: - strh r6, [r0, 0x16] - strh r5, [r2] - adds r2, 0x2 - adds r0, 0x2 - subs r3, 0x1 - cmp r3, 0 - bne _080831A0 - adds r3, r4, 0 -_080831B0: - adds r0, r1, 0 - cmp r1, 0 - bge _080831B8 - adds r0, r1, 0x7 -_080831B8: - asrs r2, r0, 3 - lsls r0, r2, 3 - subs r2, r1, r0 - cmp r2, 0 - beq _080831D6 - lsls r0, r3, 1 - adds r0, r7 - ldr r4, =0xffff80e1 - adds r1, r2, r4 - strh r1, [r0, 0x16] - adds r0, 0x56 - adds r4, 0x10 - adds r1, r2, r4 - strh r1, [r0] - adds r3, 0x1 -_080831D6: - cmp r3, 0x7 - bgt _080831FA - ldr r0, =0x000080e1 - adds r4, r0, 0 - adds r0, 0x10 - adds r2, r0, 0 - lsls r1, r3, 1 - adds r0, r1, 0 - adds r0, 0x56 - adds r0, r7 - adds r1, r7 -_080831EC: - strh r4, [r1, 0x16] - strh r2, [r0] - adds r0, 0x2 - adds r1, 0x2 - adds r3, 0x1 - cmp r3, 0x7 - ble _080831EC -_080831FA: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8083170 - - thumb_func_start sub_8083210 -sub_8083210: @ 8083210 - push {lr} - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x00057e40 - muls r0, r1 - cmp r0, 0 - bge _08083222 - ldr r1, =0x0000ffff - adds r0, r1 -_08083222: - asrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8083210 - - thumb_func_start sub_8083230 -sub_8083230: @ 8083230 - push {r4-r6,lr} - sub sp, 0x8 - lsls r0, 16 - lsrs r0, 16 - bl sub_8083210 - adds r5, r0, 0 - ldr r0, =0x020322a4 - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x4E - ldrh r0, [r1] - cmp r0, r5 - bcs _0808324E - strh r5, [r1] -_0808324E: - movs r6, 0 -_08083250: - mov r0, sp - adds r4, r0, r6 - adds r0, r5, 0 - movs r1, 0xA - bl __umodsi3 - strb r0, [r4] - adds r0, r5, 0 - movs r1, 0xA - bl __udivsi3 - adds r5, r0, 0 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x4 - bls _08083250 - ldr r2, =0x06006458 - mov r0, sp - ldr r3, =0x00008072 - adds r1, r3, 0 - ldrb r0, [r0, 0x4] - adds r0, r1, r0 - strh r0, [r2] - adds r2, 0x2 - mov r0, sp - ldrb r0, [r0, 0x3] - adds r0, r1 - strh r0, [r2] - adds r2, 0x2 - mov r0, sp - ldrb r0, [r0, 0x2] - adds r0, r1 - strh r0, [r2] - adds r2, 0x4 - mov r0, sp - ldrb r0, [r0, 0x1] - adds r0, r1 - strh r0, [r2] - adds r2, 0x2 - mov r0, sp - ldrb r0, [r0] - adds r1, r0 - strh r1, [r2] - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8083230 - - thumb_func_start sub_80832BC -sub_80832BC: @ 80832BC - push {r4-r6,lr} - adds r6, r0, 0 - lsls r4, r1, 16 - lsrs r5, r4, 16 - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _080832E0 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __umodsi3 - lsrs r1, r4, 17 - subs r0, r1 - strh r0, [r6] -_080832E0: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80832BC - - thumb_func_start sub_80832E8 -sub_80832E8: @ 80832E8 - push {lr} - adds r1, r0, 0 - ldrh r2, [r1] - movs r3, 0 - ldrsh r0, [r1, r3] - cmp r0, 0 - bge _080832FA - adds r0, r2, 0x1 - strh r0, [r1] -_080832FA: - ldrh r2, [r1] - movs r3, 0 - ldrsh r0, [r1, r3] - cmp r0, 0 - ble _08083308 - subs r0, r2, 0x1 - strh r0, [r1] -_08083308: - pop {r0} - bx r0 - thumb_func_end sub_80832E8 - - thumb_func_start sub_808330C -sub_808330C: @ 808330C - push {r4,lr} - ldr r4, =0x020322a4 - ldr r0, [r4] - movs r1, 0x8E - lsls r1, 1 - adds r0, r1 - bl sub_80832E8 - ldr r0, [r4] - movs r1, 0x8F - lsls r1, 1 - adds r0, r1 - bl sub_80832E8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808330C - - thumb_func_start sub_8083334 -sub_8083334: @ 8083334 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r1, 16 - movs r5, 0x8 - cmp r1, 0x9 - bhi _08083344 - movs r5, 0x10 -_08083344: - ldrh r0, [r4] - movs r2, 0 - ldrsh r1, [r4, r2] - cmp r1, 0 - bne _08083362 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __modsi3 - lsrs r1, r5, 1 - subs r0, r1 - b _08083376 -_08083362: - cmp r1, 0 - bge _0808336A - adds r0, 0x1 - strh r0, [r4] -_0808336A: - ldrh r1, [r4] - movs r2, 0 - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _08083378 - subs r0, r1, 0x1 -_08083376: - strh r0, [r4] -_08083378: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8083334 - - thumb_func_start sub_8083380 -sub_8083380: @ 8083380 - push {r4,r5,lr} - ldr r5, =0x020322a4 - ldr r2, [r5] - movs r4, 0x84 - lsls r4, 1 - adds r0, r2, r4 - ldr r1, [r0] - cmp r1, 0 - bne _080833A0 - movs r3, 0x8E - lsls r3, 1 - adds r0, r2, r3 - strh r1, [r0] - adds r3, 0x2 - adds r0, r2, r3 - strh r1, [r0] -_080833A0: - ldr r0, [r5] - adds r2, r0, r4 - ldr r1, [r2] - adds r1, 0x1 - str r1, [r2] - movs r2, 0x8E - lsls r2, 1 - adds r0, r2 - lsls r1, 16 - lsrs r1, 16 - bl sub_8083334 - ldr r1, [r5] - movs r3, 0x8F - lsls r3, 1 - adds r0, r1, r3 - adds r1, r4 - ldrh r1, [r1] - bl sub_8083334 - ldr r2, [r5] - adds r0, r2, r4 - ldr r0, [r0] - cmp r0, 0x14 - beq _080833DC - movs r0, 0 - b _080833F0 - .pool -_080833DC: - movs r1, 0x8E - lsls r1, 1 - adds r0, r2, r1 - movs r1, 0 - strh r1, [r0] - movs r3, 0x8F - lsls r3, 1 - adds r0, r2, r3 - strh r1, [r0] - movs r0, 0x1 -_080833F0: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8083380 - - thumb_func_start sub_80833F8 -sub_80833F8: @ 80833F8 - ldr r1, =0x020322a4 - ldr r2, [r1] - movs r3, 0x8E - lsls r3, 1 - adds r1, r2, r3 - ldrh r1, [r1] - negs r1, r1 - strh r1, [r0, 0x24] - adds r3, 0x2 - adds r1, r2, r3 - ldrh r1, [r1] - negs r1, r1 - strh r1, [r0, 0x26] - bx lr - .pool - thumb_func_end sub_80833F8 - - thumb_func_start UpdateBerryBlenderRecord -@ void UpdateBerryBlenderRecord() -UpdateBerryBlenderRecord: @ 8083418 - push {lr} - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r0, =0x020322a4 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x7C - ldrb r0, [r0] - subs r0, 0x2 - lsls r0, 1 - ldr r3, =0x000009bc - adds r2, r3 - adds r2, r0 - adds r1, 0x4E - ldrh r1, [r1] - ldrh r0, [r2] - cmp r0, r1 - bcs _0808343E - strh r1, [r2] -_0808343E: - pop {r0} - bx r0 - .pool - thumb_func_end UpdateBerryBlenderRecord - - thumb_func_start berry_blender_related -berry_blender_related: @ 8083450 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4C - ldr r1, =0x020322a4 - ldr r0, [r1] - ldrb r0, [r0] - adds r4, r1, 0 - cmp r0, 0x6 - bls _0808346A - b _08083898 -_0808346A: - lsls r0, 2 - ldr r1, =_0808347C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0808347C: - .4byte _08083498 - .4byte _080834AE - .4byte _080834C8 - .4byte _08083518 - .4byte _08083790 - .4byte _080837A8 - .4byte _0808386C -_08083498: - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r4] - movs r1, 0x84 - lsls r1, 1 - adds r0, r1 - movs r1, 0x11 - str r1, [r0] - b _08083898 -_080834AE: - ldr r1, [r4] - movs r3, 0x84 - lsls r3, 1 - adds r2, r1, r3 - ldr r0, [r2] - subs r0, 0xA - str r0, [r2] - cmp r0, 0 - blt _080834C2 - b _08083898 -_080834C2: - movs r0, 0 - str r0, [r2] - b _08083854 -_080834C8: - ldr r1, [r4] - movs r0, 0x84 - lsls r0, 1 - adds r1, r0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - cmp r0, 0x14 - bgt _080834DC - b _08083898 -_080834DC: - movs r6, 0 -_080834DE: - ldr r4, =0x020322a4 - ldr r0, [r4] - adds r0, 0x46 - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x2 - bls _080834DE - ldr r1, [r4] - movs r3, 0x84 - lsls r3, 1 - adds r2, r1, r3 - movs r0, 0 - str r0, [r2] - b _08083854 - .pool -_08083518: - ldr r4, =gUnknown_083398F5 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xA8 - bl GetStringCenterAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - movs r0, 0xFF - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - movs r0, 0x5 - adds r1, r4, 0 - movs r3, 0x1 - bl sub_80840D4 - ldr r1, =0x020322a4 - ldr r0, [r1] - adds r2, r0, 0 - adds r2, 0x7C - ldrb r0, [r2] - movs r3, 0x15 - mov r9, r3 - cmp r0, 0x4 - bne _08083550 - movs r0, 0x11 - mov r9, r0 -_08083550: - movs r6, 0 - mov r3, sp - adds r3, 0x10 - str r3, [sp, 0x48] - ldrb r2, [r2] - cmp r6, r2 - bcs _0808361A - adds r7, r1, 0 - movs r0, 0x3 - mov r10, r0 -_08083564: - ldr r0, [r7] - movs r2, 0x9E - lsls r2, 1 - adds r1, r0, r2 - adds r1, r6 - ldrb r5, [r1] - adds r0, 0x9F - adds r6, 0x1 - mov r8, r6 - mov r1, r8 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalString - ldr r0, [r7] - adds r0, 0x9F - ldr r1, =gUnknown_08339941 - bl AppendString - ldr r0, [r7] - adds r0, 0x9F - ldr r1, =gUnknown_085E8D5E - bl AppendString - ldr r0, [r7] - adds r0, 0x9F - lsls r4, r5, 3 - subs r4, r5 - lsls r4, 2 - ldr r3, =0x020229f0 - adds r1, r4, r3 - bl AppendString - ldr r1, [r7] - adds r1, 0x9F - mov r0, r9 - lsls r6, r0, 24 - lsrs r6, 24 - movs r2, 0xFF - str r2, [sp] - mov r3, r10 - str r3, [sp, 0x4] - movs r0, 0x5 - movs r2, 0x8 - adds r3, r6, 0 - bl sub_80840D4 - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0x9F - lsls r5, 4 - adds r5, r1 - movs r1, 0xAD - lsls r1, 1 - adds r5, r1 - adds r1, r5, 0 - bl CopyString - ldr r0, [r7] - adds r0, 0x9F - ldr r2, =0x020229e8 - adds r4, r2 - ldrb r1, [r4, 0x1A] - bl StopMusicWhileStringIsPrinted - ldr r0, [r7] - adds r0, 0x9F - ldr r1, =gUnknown_08339914 - bl AppendString - ldr r1, [r7] - adds r1, 0x9F - movs r3, 0xFF - str r3, [sp] - mov r0, r10 - str r0, [sp, 0x4] - movs r0, 0x5 - movs r2, 0x54 - adds r3, r6, 0 - bl sub_80840D4 - movs r1, 0x10 - add r9, r1 - mov r2, r8 - lsls r2, 16 - lsrs r6, r2, 16 - ldr r0, [r7] - adds r0, 0x7C - ldrb r0, [r0] - cmp r6, r0 - bcc _08083564 -_0808361A: - ldr r1, =gUnknown_0833992E - movs r3, 0xFF - mov r10, r3 - str r3, [sp] - movs r0, 0x3 - mov r9, r0 - str r0, [sp, 0x4] - movs r0, 0x5 - movs r2, 0 - movs r3, 0x51 - bl sub_80840D4 - ldr r6, =0x020322a4 - ldr r0, [r6] - adds r4, r0, 0 - adds r4, 0x9F - adds r0, 0x4E - ldrh r0, [r0] - movs r1, 0x64 - bl __udivsi3 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r0, [r6] - adds r0, 0x9F - ldr r1, =gUnknown_08339941 - bl AppendString - ldr r0, [r6] - adds r0, 0x4E - ldrh r0, [r0] - movs r1, 0x64 - bl __umodsi3 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x48] - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, [r6] - adds r0, 0x9F - ldr r1, [sp, 0x48] - bl AppendString - ldr r0, [r6] - adds r0, 0x9F - ldr r1, =gUnknown_0833993C - bl AppendString - ldr r1, [r6] - adds r1, 0x9F - movs r0, 0x1 - movs r2, 0xA8 - bl GetStringRightAlignXOffset - ldr r1, [r6] - adds r1, 0x9F - lsls r2, r0, 24 - lsrs r2, 24 - mov r3, r10 - str r3, [sp] - mov r0, r9 - str r0, [sp, 0x4] - movs r0, 0x5 - movs r3, 0x51 - bl sub_80840D4 - ldr r1, =gUnknown_0833991B - mov r2, r10 - str r2, [sp] - mov r3, r9 - str r3, [sp, 0x4] - movs r0, 0x5 - movs r2, 0 - movs r3, 0x61 - bl sub_80840D4 - ldr r5, [r6] - movs r1, 0x82 - lsls r1, 1 - adds r0, r5, r1 - ldr r0, [r0] - mov r8, r0 - movs r1, 0x3C - bl __udivsi3 - movs r1, 0x3C - bl __umodsi3 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - movs r1, 0xE1 - lsls r1, 4 - mov r0, r8 - bl __udivsi3 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r5, 0x9F - adds r0, r5, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, [r6] - adds r0, 0x9F - ldr r1, =gUnknown_08339921 - bl AppendString - adds r1, r4, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, [r6] - adds r0, 0x9F - ldr r1, =gUnknown_08339928 - bl AppendString - ldr r1, [r6] - adds r1, 0x9F - movs r0, 0x1 - movs r2, 0xA8 - bl GetStringRightAlignXOffset - ldr r1, [r6] - adds r1, 0x9F - lsls r2, r0, 24 - lsrs r2, 24 - mov r3, r10 - str r3, [sp] - mov r0, r9 - str r0, [sp, 0x4] - movs r0, 0x5 - movs r3, 0x61 - bl sub_80840D4 - ldr r1, [r6] - movs r3, 0x84 - lsls r3, 1 - adds r2, r1, r3 - movs r0, 0 - str r0, [r2] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0x5 - movs r1, 0x2 - bl CopyWindowToVram - b _08083898 - .pool -_08083790: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0808379E - b _08083898 -_0808379E: - ldr r1, [r4] - b _08083854 - .pool -_080837A8: - movs r0, 0x5 - movs r1, 0x1 - bl sub_8198070 - movs r6, 0 - add r7, sp, 0x40 - ldr r5, =0x020322a4 -_080837B6: - ldr r0, [r5] - lsls r2, r6, 1 - adds r0, 0x74 - adds r0, r2 - ldrh r1, [r0] - cmp r1, 0 - beq _080837CC - add r0, sp, 0x38 - adds r0, r2 - subs r1, 0x85 - strh r1, [r0] -_080837CC: - ldr r0, [r5] - adds r0, 0x8E - adds r0, r2 - ldrh r0, [r0] - cmp r0, 0xFF - beq _080837EA - lsls r4, r6, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram -_080837EA: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x3 - bls _080837B6 - bl sub_8081E20 - ldr r4, =0x020322a4 - ldr r3, [r4] - movs r1, 0xAC - lsls r1, 1 - adds r0, r3, r1 - adds r1, r3, 0 - adds r1, 0x7C - ldrb r2, [r1] - subs r1, 0x2E - ldrh r1, [r1] - str r1, [sp] - adds r1, r7, 0 - add r3, sp, 0x8 - bl sub_8081BE0 - ldr r1, [r4] - adds r1, 0x9F - adds r0, r7, 0 - bl sub_80838AC - ldr r1, [r4] - movs r2, 0xD4 - lsls r2, 1 - adds r1, r2 - adds r0, r7, 0 - bl sub_8083F94 - ldr r0, =sub_8083F3C - movs r1, 0x6 - bl CreateTask - bl sub_80EECEC - ldr r0, =0x0203ce7c - ldrh r0, [r0] - movs r1, 0x1 - bl remove_item - adds r0, r7, 0 - bl sub_8136F2C - ldr r1, [r4] - ldr r3, =0x000011b8 - adds r2, r1, r3 - movs r0, 0 - strh r0, [r2] -_08083854: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08083898 - .pool -_0808386C: - ldr r4, [r4] - ldr r0, =0x000011b8 - adds r5, r4, r0 - adds r4, 0x9F - bl sav2_get_text_speed - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_808417C - cmp r0, 0 - beq _08083898 - bl UpdateBerryBlenderRecord - movs r0, 0x1 - b _0808389A - .pool -_08083898: - movs r0, 0 -_0808389A: - add sp, 0x4C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end berry_blender_related - - thumb_func_start sub_80838AC -sub_80838AC: @ 80838AC - push {r4-r6,lr} - sub sp, 0xC - adds r5, r0, 0 - adds r6, r1, 0 - movs r0, 0xFF - strb r0, [r6] - ldr r1, =gUnknown_085B262C - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r6, 0 - bl CopyString - ldr r1, =gUnknown_0833979D - adds r0, r6, 0 - bl AppendString - ldr r1, =gUnknown_08339943 - adds r0, r6, 0 - bl AppendString - adds r0, r5, 0 - bl sub_8136EA4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - bl sub_8136EDC - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =gUnknown_0833994F - adds r0, r6, 0 - bl AppendString - mov r0, sp - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r0, r6, 0 - mov r1, sp - bl AppendString - ldr r1, =gUnknown_0833995D - adds r0, r6, 0 - bl AppendString - mov r0, sp - adds r1, r5, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r0, r6, 0 - mov r1, sp - bl AppendString - ldr r1, =gUnknown_08339970 - adds r0, r6, 0 - bl AppendString - ldr r1, =gUnknown_0833979B - adds r0, r6, 0 - bl AppendString - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80838AC - - thumb_func_start sub_808395C -sub_808395C: @ 808395C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r9, r0 - mov r12, r2 - lsls r1, 24 - lsrs r7, r1, 24 - movs r0, 0 - cmp r0, r7 - bge _080839A8 -_08083972: - movs r5, 0 - adds r1, r0, 0x1 - mov r8, r1 - cmp r5, r7 - bge _080839A2 - mov r1, r9 - adds r6, r1, r0 -_08083980: - ldrb r4, [r6] - lsls r1, r4, 2 - add r1, r12 - mov r0, r9 - adds r2, r0, r5 - ldrb r3, [r2] - lsls r0, r3, 2 - add r0, r12 - ldr r1, [r1] - ldr r0, [r0] - cmp r1, r0 - bls _0808399C - strb r3, [r6] - strb r4, [r2] -_0808399C: - adds r5, 0x1 - cmp r5, r7 - blt _08083980 -_080839A2: - mov r0, r8 - cmp r0, r7 - blt _08083972 -_080839A8: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_808395C - - thumb_func_start sub_80839B4 -sub_80839B4: @ 80839B4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - movs r5, 0 - ldr r2, =0x020322a4 - ldr r0, [r2] - adds r0, 0x7C - adds r1, r2, 0 - add r3, sp, 0x4 - mov r10, r3 - b _080839E4 - .pool -_080839D4: - mov r4, sp - adds r0, r4, r5 - strb r5, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r2] - adds r0, 0x7C -_080839E4: - ldrb r0, [r0] - cmp r5, r0 - bcc _080839D4 - movs r5, 0 - ldr r0, [r1] - adds r1, r0, 0 - adds r1, 0x7C - ldrb r2, [r1] - cmp r5, r2 - bcs _08083A5E - mov r9, r10 - movs r3, 0x92 - lsls r3, 1 - adds r3, r0 - mov r8, r3 - mov r12, r1 - movs r4, 0x93 - lsls r4, 1 - adds r7, r0, r4 - movs r1, 0x94 - lsls r1, 1 - adds r6, r0, r1 -_08083A10: - lsls r4, r5, 2 - add r4, r9 - lsls r3, r5, 1 - adds r3, r5 - lsls r3, 1 - mov r2, r8 - adds r0, r2, r3 - ldrh r2, [r0] - lsls r0, r2, 5 - subs r0, r2 - lsls r1, r0, 6 - subs r1, r0 - lsls r1, 3 - adds r1, r2 - lsls r1, 6 - str r1, [r4] - adds r0, r7, r3 - ldrh r2, [r0] - lsls r0, r2, 5 - subs r0, r2 - lsls r0, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - str r1, [r4] - movs r0, 0xFA - lsls r0, 2 - adds r1, r0 - adds r3, r6, r3 - ldrh r0, [r3] - subs r1, r0 - str r1, [r4] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - mov r1, r12 - ldrb r1, [r1] - cmp r5, r1 - bcc _08083A10 -_08083A5E: - ldr r4, =0x020322a4 - ldr r0, [r4] - adds r0, 0x7C - ldrb r1, [r0] - mov r0, sp - mov r2, r10 - bl sub_808395C - movs r5, 0 - ldr r0, [r4] - adds r0, 0x7C - ldrb r0, [r0] - cmp r5, r0 - bcs _08083A9E - adds r2, r4, 0 - movs r3, 0x9E - lsls r3, 1 -_08083A80: - ldr r1, [r2] - adds r1, r3 - adds r1, r5 - mov r4, sp - adds r0, r4, r5 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r2] - adds r0, 0x7C - ldrb r0, [r0] - cmp r5, r0 - bcc _08083A80 -_08083A9E: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08083AB4 - movs r3, 0 - b _08083ABC - .pool -_08083AB4: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r3, r0, 24 -_08083ABC: - movs r5, 0 - ldr r1, =0x020322a4 - ldr r0, [r1] - adds r0, 0x7C - ldrb r0, [r0] - cmp r5, r0 - bcs _08083AF2 - movs r6, 0x9E - lsls r6, 1 - movs r4, 0xD2 - lsls r4, 1 -_08083AD2: - ldr r2, [r1] - adds r0, r2, r6 - adds r0, r5 - ldrb r0, [r0] - cmp r0, r3 - bne _08083AE2 - adds r0, r2, r4 - strb r5, [r0] -_08083AE2: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r1] - adds r0, 0x7C - ldrb r0, [r0] - cmp r5, r0 - bcc _08083AD2 -_08083AF2: - 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_80839B4 - - thumb_func_start sub_8083B08 -sub_8083B08: @ 8083B08 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - ldr r1, =0x020322a4 - ldr r0, [r1] - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0x6 - bls _08083B22 - b _08083E12 -_08083B22: - lsls r0, 2 - ldr r1, =_08083B34 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08083B34: - .4byte _08083B50 - .4byte _08083B66 - .4byte _08083B80 - .4byte _08083B9A - .4byte _08083DC8 - .4byte _08083DE2 - .4byte _08083E08 -_08083B50: - ldr r1, [r2] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r2] - movs r1, 0x84 - lsls r1, 1 - adds r0, r1 - movs r1, 0xFF - str r1, [r0] - b _08083E12 -_08083B66: - ldr r1, [r2] - movs r3, 0x84 - lsls r3, 1 - adds r2, r1, r3 - ldr r0, [r2] - subs r0, 0xA - str r0, [r2] - cmp r0, 0 - blt _08083B7A - b _08083E12 -_08083B7A: - movs r0, 0 - str r0, [r2] - b _08083DF8 -_08083B80: - ldr r1, [r2] - movs r0, 0x84 - lsls r0, 1 - adds r2, r1, r0 - ldr r0, [r2] - adds r0, 0x1 - str r0, [r2] - cmp r0, 0x14 - bgt _08083B94 - b _08083E12 -_08083B94: - movs r0, 0 - str r0, [r2] - b _08083DF8 -_08083B9A: - movs r0, 0x5 - movs r1, 0 - movs r2, 0x1 - movs r3, 0xD - bl SetWindowBorderStyle - ldr r4, =gUnknown_08339947 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xA8 - bl GetStringCenterAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0xFF - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - movs r0, 0x5 - adds r1, r4, 0 - movs r3, 0x1 - bl sub_80840D4 - ldr r1, =gUnknown_08339B40 - mov r8, r1 - mov r0, r8 - movs r1, 0x80 - movs r2, 0x34 - movs r3, 0 - bl AddObjectToFront - ldr r7, =0x020322a4 - ldr r1, [r7] - adds r1, 0x46 - strb r0, [r1] - ldr r0, [r7] - adds r0, 0x46 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r6, =0x02020630 - adds r0, r6 - movs r1, 0x3 - bl StartObjectImageAnim - ldr r0, [r7] - adds r0, 0x46 - 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, =DummyObjectCallback - str r4, [r0] - mov r0, r8 - movs r1, 0xA0 - movs r2, 0x34 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0x47 - strb r0, [r1] - ldr r0, [r7] - adds r0, 0x47 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - str r4, [r0] - mov r0, r8 - movs r1, 0xC0 - movs r2, 0x34 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - adds r1, 0x48 - strb r0, [r1] - ldr r0, [r7] - adds r0, 0x48 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x1 - bl StartObjectImageAnim - ldr r0, [r7] - adds r0, 0x48 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - str r4, [r0] - bl sub_80839B4 - movs r2, 0x29 - str r2, [sp, 0x8] - movs r2, 0 - ldr r0, [r7] - adds r0, 0x7C - ldrb r0, [r0] - cmp r2, r0 - bcc _08083C7C - b _08083D8A -_08083C7C: - movs r3, 0xFF - mov r10, r3 - movs r0, 0x3 - mov r9, r0 -_08083C84: - ldr r0, [r7] - movs r3, 0x9E - lsls r3, 1 - adds r1, r0, r3 - adds r1, r2 - ldrb r5, [r1] - adds r0, 0x9F - adds r2, 0x1 - mov r8, r2 - mov r1, r8 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalString - ldr r0, [r7] - adds r0, 0x9F - ldr r1, =gUnknown_08339941 - bl AppendString - ldr r0, [r7] - adds r0, 0x9F - ldr r1, =gUnknown_085E8D5E - bl AppendString - ldr r0, [r7] - adds r0, 0x9F - lsls r1, r5, 3 - subs r1, r5 - lsls r1, 2 - ldr r2, =0x020229f0 - adds r1, r2 - bl AppendString - ldr r1, [r7] - adds r1, 0x9F - ldr r0, [sp, 0x8] - lsls r6, r0, 24 - lsrs r6, 24 - mov r2, r10 - str r2, [sp] - mov r3, r9 - str r3, [sp, 0x4] - movs r0, 0x5 - movs r2, 0 - adds r3, r6, 0 - bl sub_80840D4 - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0x9F - lsls r4, r5, 1 - adds r4, r5 - lsls r4, 1 - movs r2, 0x92 - lsls r2, 1 - adds r1, r2 - adds r1, r4 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r1, [r7] - adds r1, 0x9F - mov r3, r10 - str r3, [sp] - mov r0, r9 - str r0, [sp, 0x4] - movs r0, 0x5 - movs r2, 0x4E - adds r3, r6, 0 - bl sub_80840D4 - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0x9F - movs r2, 0x93 - lsls r2, 1 - adds r1, r2 - adds r1, r4 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r1, [r7] - adds r1, 0x9F - mov r3, r10 - str r3, [sp] - mov r0, r9 - str r0, [sp, 0x4] - movs r0, 0x5 - movs r2, 0x6E - adds r3, r6, 0 - bl sub_80840D4 - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0x9F - movs r2, 0x94 - lsls r2, 1 - adds r1, r2 - adds r1, r4 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r1, [r7] - adds r1, 0x9F - mov r3, r10 - str r3, [sp] - mov r0, r9 - str r0, [sp, 0x4] - movs r0, 0x5 - movs r2, 0x8E - adds r3, r6, 0 - bl sub_80840D4 - ldr r1, [sp, 0x8] - adds r1, 0x10 - str r1, [sp, 0x8] - mov r2, r8 - lsls r2, 16 - lsrs r2, 16 - ldr r0, [r7] - adds r0, 0x7C - ldrb r0, [r0] - cmp r2, r0 - bcs _08083D8A - b _08083C84 -_08083D8A: - movs r0, 0x5 - bl PutWindowTilemap - movs r0, 0x5 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =0x020322a4 - ldr r1, [r0] - movs r3, 0x84 - lsls r3, 1 - adds r2, r1, r3 - movs r0, 0 - str r0, [r2] - b _08083DF8 - .pool -_08083DC8: - ldr r2, [r2] - movs r0, 0x84 - lsls r0, 1 - adds r1, r2, r0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - cmp r0, 0x14 - ble _08083E12 - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - b _08083E12 -_08083DE2: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08083E12 - movs r0, 0x5 - bl audio_play - ldr r0, =0x020322a4 - ldr r1, [r0] -_08083DF8: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08083E12 - .pool -_08083E08: - ldr r1, [r2] - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - b _08083E14 -_08083E12: - movs r0, 0 -_08083E14: - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8083B08 - - thumb_func_start ShowBerryBlenderRecordWindow -ShowBerryBlenderRecordWindow: @ 8083E24 - push {r4-r7,lr} - sub sp, 0x34 - ldr r0, =gUnknown_08339D14 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x2C] - str r1, [sp, 0x30] - ldr r5, =0x0203ab74 - add r0, sp, 0x2C - bl AddWindow - strb r0, [r5] - ldrb r0, [r5] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r5] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r6, =gUnknown_085EE44F - movs r0, 0x1 - adds r1, r6, 0 - movs r2, 0x90 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - ldrb r0, [r5] - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x1 - str r1, [sp] - movs r4, 0 - str r4, [sp, 0x4] - str r4, [sp, 0x8] - adds r2, r6, 0 - bl Print - ldrb r0, [r5] - ldr r2, =gUnknown_085EE473 - movs r1, 0x29 - str r1, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x4 - bl Print - movs r6, 0 - movs r7, 0xA4 - lsls r7, 22 -_08083E8A: - ldr r0, =0x03005d8c - ldr r0, [r0] - lsls r1, r6, 1 - ldr r2, =0x000009bc - adds r0, r2 - adds r0, r1 - ldrh r4, [r0] - adds r0, r4, 0 - movs r1, 0x64 - bl __udivsi3 - adds r1, r0, 0 - add r0, sp, 0xC - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r5, r0, 0 - ldr r1, =gUnknown_08339941 - bl AppendString - adds r5, r0, 0 - adds r0, r4, 0 - movs r1, 0x64 - bl __umodsi3 - adds r1, r0, 0 - adds r0, r5, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - adds r5, r0, 0 - ldr r1, =gUnknown_0833993C - bl AppendString - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0x8C - bl GetStringRightAlignXOffset - adds r3, r0, 0 - ldr r4, =0x0203ab74 - ldrb r0, [r4] - lsls r3, 24 - lsrs r3, 24 - lsrs r1, r7, 24 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - add r2, sp, 0xC - bl Print - movs r0, 0x80 - lsls r0, 21 - adds r7, r0 - adds r6, 0x1 - cmp r6, 0x2 - ble _08083E8A - ldrb r0, [r4] - bl PutWindowTilemap - ldrb r0, [r4] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0x34 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ShowBerryBlenderRecordWindow - - thumb_func_start sub_8083F3C -sub_8083F3C: @ 8083F3C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08083F62 - ldr r0, =0x0000016f - bl fanfare_play - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_08083F62: - bl task_is_not_running_overworld_fanfare - lsls r0, 24 - cmp r0, 0 - beq _08083F82 - ldr r0, =0x020322a4 - ldr r0, [r0] - movs r1, 0xAA - lsls r1, 1 - adds r0, r1 - ldrh r0, [r0] - bl song_play_for_text - adds r0, r5, 0 - bl DestroyTask -_08083F82: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8083F3C - - thumb_func_start sub_8083F94 -sub_8083F94: @ 8083F94 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - adds r6, r0, 0 - adds r7, r1, 0 - bl sub_8136EA4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - bl sub_8136EDC - adds r1, r0, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 1 - lsls r1, 24 - lsrs r1, 24 - bl __divsi3 - lsls r0, 16 - lsrs r3, r0, 16 - strb r3, [r7, 0xD] - ldrb r0, [r6] - strb r0, [r7, 0xC] - movs r0, 0xFF - strb r0, [r7] - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _080840C4 - ldr r0, =0x020322a4 - ldr r2, [r0] - movs r4, 0xD2 - lsls r4, 1 - adds r1, r2, r4 - ldrb r1, [r1] - mov r8, r0 - cmp r1, 0 - bne _08084058 - cmp r3, 0x14 - bls _08084058 - adds r0, r2, 0 - adds r0, 0x7C - ldrb r1, [r0] - subs r1, 0x1 - movs r0, 0x9E - lsls r0, 1 - mov r9, r0 - adds r0, r2, r0 - adds r0, r1 - ldrb r0, [r0] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r5, =0x020229f0 - adds r1, r5 - adds r0, r7, 0 - bl CopyString - adds r0, r6, 0 - bl sub_81370B4 - strb r0, [r7, 0xB] - ldrb r1, [r7, 0xB] - ldrb r2, [r7, 0xC] - ldrb r3, [r7, 0xD] - mov r6, r8 - ldr r4, [r6] - adds r0, r4, 0 - adds r0, 0x7C - ldrb r0, [r0] - subs r0, 0x1 - add r4, r9 - adds r4, r0 - ldrb r4, [r4] - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r5, r0 - ldrb r0, [r5, 0x12] - str r0, [sp] - adds r0, r7, 0 - bl sub_80ECC04 - lsls r0, 24 - cmp r0, 0 - bne _080840BA - b _080840C4 - .pool -_08084058: - mov r0, r8 - ldr r2, [r0] - movs r1, 0xD2 - lsls r1, 1 - adds r0, r2, r1 - ldrb r1, [r0] - adds r0, r2, 0 - adds r0, 0x7C - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bne _080840C4 - cmp r3, 0x14 - bhi _080840C4 - movs r4, 0x9E - lsls r4, 1 - adds r0, r2, r4 - ldrb r0, [r0] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r5, =0x020229f0 - adds r1, r5 - adds r0, r7, 0 - bl CopyString - adds r0, r6, 0 - bl sub_81370B4 - strb r0, [r7, 0xB] - ldrb r1, [r7, 0xB] - ldrb r2, [r7, 0xC] - ldrb r3, [r7, 0xD] - mov r6, r8 - ldr r0, [r6] - adds r0, r4 - ldrb r4, [r0] - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r5, r0 - ldrb r0, [r5, 0x12] - str r0, [sp] - adds r0, r7, 0 - bl sub_80ECC04 - lsls r0, 24 - cmp r0, 0 - beq _080840C4 -_080840BA: - movs r0, 0x1 - b _080840C6 - .pool -_080840C4: - movs r0, 0 -_080840C6: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8083F94 - - thumb_func_start sub_80840D4 -sub_80840D4: @ 80840D4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - mov r9, r1 - ldr r4, [sp, 0x38] - lsls r0, 24 - lsrs r6, r0, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 24 - lsrs r7, r3, 24 - movs r5, 0 - cmp r4, 0x1 - beq _08084116 - cmp r4, 0x1 - bgt _08084100 - cmp r4, 0 - beq _08084108 - b _08084132 -_08084100: - cmp r4, 0x2 - beq _08084124 - cmp r4, 0x3 - bne _08084136 -_08084108: - add r1, sp, 0x14 - movs r0, 0x1 - strb r0, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - movs r0, 0x3 - b _08084130 -_08084116: - add r0, sp, 0x14 - strb r5, [r0] - adds r1, r0, 0 - movs r0, 0x2 - strb r0, [r1, 0x1] - movs r0, 0x3 - b _08084130 -_08084124: - add r0, sp, 0x14 - strb r5, [r0] - adds r1, r0, 0 - movs r0, 0x4 - strb r0, [r1, 0x1] - movs r0, 0x5 -_08084130: - strb r0, [r1, 0x2] -_08084132: - cmp r4, 0x3 - beq _08084148 -_08084136: - add r0, sp, 0x14 - ldrb r0, [r0] - lsls r1, r0, 4 - orrs r1, r0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl FillWindowPixelBuffer -_08084148: - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - add r0, sp, 0x14 - str r0, [sp, 0x8] - ldr r0, [sp, 0x34] - lsls r0, 24 - asrs r0, 24 - str r0, [sp, 0xC] - mov r0, r9 - str r0, [sp, 0x10] - adds r0, r6, 0 - movs r1, 0x1 - mov r2, r8 - adds r3, r7, 0 - bl AddTextPrinterParametrized2 - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80840D4 - - thumb_func_start sub_808417C -sub_808417C: @ 808417C - push {r4-r7,lr} - sub sp, 0x8 - adds r5, r0, 0 - adds r7, r1, 0 - adds r6, r2, 0 - movs r0, 0 - ldrsh r4, [r5, r0] - cmp r4, 0 - beq _08084194 - cmp r4, 0x1 - beq _080841C6 - b _080841DA -_08084194: - movs r0, 0x4 - movs r1, 0 - movs r2, 0x14 - movs r3, 0xF - bl sub_8197B1C - str r6, [sp] - str r4, [sp, 0x4] - movs r0, 0x4 - adds r1, r7, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_80840D4 - movs r0, 0x4 - bl PutWindowTilemap - movs r0, 0x4 - movs r1, 0x3 - bl CopyWindowToVram - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - b _080841DA -_080841C6: - movs r0, 0x4 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _080841DA - strh r0, [r5] - movs r0, 0x1 - b _080841DC -_080841DA: - movs r0, 0 -_080841DC: - add sp, 0x8 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808417C - - thumb_func_start reset_playtime -reset_playtime: @ 80841E4 - ldr r1, =0x03000e08 - movs r0, 0 - strb r0, [r1] - ldr r2, =0x03005d90 - ldr r3, [r2] - movs r1, 0 - movs r0, 0 - strh r0, [r3, 0xE] - strb r1, [r3, 0x10] - ldr r0, [r2] - strb r1, [r0, 0x11] - ldr r0, [r2] - strb r1, [r0, 0x12] - bx lr - .pool - thumb_func_end reset_playtime - - thumb_func_start set_max_playtime_if_appropriate -set_max_playtime_if_appropriate: @ 8084208 - push {lr} - ldr r1, =0x03000e08 - movs r0, 0x1 - strb r0, [r1] - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrh r1, [r0, 0xE] - ldr r0, =0x000003e7 - cmp r1, r0 - bls _08084220 - bl set_max_playtime -_08084220: - pop {r0} - bx r0 - .pool - thumb_func_end set_max_playtime_if_appropriate - - thumb_func_start sub_8084230 -sub_8084230: @ 8084230 - ldr r1, =0x03000e08 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8084230 - - thumb_func_start gametime_increment -gametime_increment: @ 808423C - push {lr} - ldr r0, =0x03000e08 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08084294 - ldr r2, =0x03005d90 - ldr r0, [r2] - ldrb r1, [r0, 0x12] - adds r1, 0x1 - movs r3, 0 - strb r1, [r0, 0x12] - ldr r1, [r2] - ldrb r0, [r1, 0x12] - cmp r0, 0x3B - bls _08084294 - strb r3, [r1, 0x12] - ldr r0, [r2] - ldrb r1, [r0, 0x11] - adds r1, 0x1 - strb r1, [r0, 0x11] - ldr r1, [r2] - ldrb r0, [r1, 0x11] - cmp r0, 0x3B - bls _08084294 - strb r3, [r1, 0x11] - ldr r0, [r2] - ldrb r1, [r0, 0x10] - adds r1, 0x1 - strb r1, [r0, 0x10] - ldr r1, [r2] - ldrb r0, [r1, 0x10] - cmp r0, 0x3B - bls _08084294 - strb r3, [r1, 0x10] - ldr r0, [r2] - ldrh r1, [r0, 0xE] - adds r1, 0x1 - strh r1, [r0, 0xE] - lsls r1, 16 - ldr r0, =0x03e70000 - cmp r1, r0 - bls _08084294 - bl set_max_playtime -_08084294: - pop {r0} - bx r0 - .pool - thumb_func_end gametime_increment - - thumb_func_start set_max_playtime -set_max_playtime: @ 80842A4 - ldr r1, =0x03000e08 - movs r0, 0x2 - strb r0, [r1] - ldr r2, =0x03005d90 - ldr r3, [r2] - ldr r0, =0x000003e7 - strh r0, [r3, 0xE] - movs r1, 0x3B - strb r1, [r3, 0x10] - ldr r0, [r2] - strb r1, [r0, 0x11] - ldr r0, [r2] - strb r1, [r0, 0x12] - bx lr - .pool - thumb_func_end set_max_playtime - - thumb_func_start write_word_to_mem -@ void write_word_to_mem(int value, int *mem) -write_word_to_mem: @ 80842CC - strb r0, [r1] - lsrs r2, r0, 8 - strb r2, [r1, 0x1] - lsrs r2, r0, 16 - strb r2, [r1, 0x2] - lsrs r0, 24 - strb r0, [r1, 0x3] - bx lr - thumb_func_end write_word_to_mem - - thumb_func_start sub_80842DC -sub_80842DC: @ 80842DC - adds r2, r0, 0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - ldrb r1, [r2, 0x2] - lsls r1, 16 - orrs r0, r1 - ldrb r1, [r2, 0x1] - lsls r1, 8 - orrs r0, r1 - ldrb r1, [r2] - orrs r0, r1 - bx lr - thumb_func_end sub_80842DC - - thumb_func_start sub_80842F4 -sub_80842F4: @ 80842F4 - push {r4,lr} - adds r4, r0, 0 - adds r3, r1, 0 - movs r2, 0 -_080842FC: - adds r0, r4, r2 - adds r1, r3, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x3 - ble _080842FC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80842F4 - - thumb_func_start set_player_trainer_id -set_player_trainer_id: @ 8084310 - push {r4,lr} - bl GenerateRandomNumber - adds r4, r0, 0 - bl GetTrainerId - lsls r4, 16 - lsls r0, 16 - lsrs r0, 16 - orrs r4, r0 - ldr r0, =0x03005d90 - ldr r1, [r0] - adds r1, 0xA - adds r0, r4, 0 - bl write_word_to_mem - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end set_player_trainer_id - - thumb_func_start init_options -init_options: @ 808433C - ldr r3, =0x03005d90 - ldr r2, [r3] - ldrb r1, [r2, 0x14] - movs r0, 0x8 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x14] - ldr r2, [r3] - ldrb r1, [r2, 0x14] - movs r0, 0x7 - ands r0, r1 - strb r0, [r2, 0x14] - ldr r2, [r3] - ldrb r1, [r2, 0x15] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x15] - ldr r2, [r3] - ldrb r1, [r2, 0x15] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x15] - ldr r2, [r3] - ldrb r1, [r2, 0x15] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x15] - ldr r2, [r3] - ldrb r1, [r2, 0x15] - movs r0, 0x9 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x15] - bx lr - .pool - thumb_func_end init_options - - thumb_func_start sub_8084390 -sub_8084390: @ 8084390 - push {r4,lr} - ldr r1, =0x030060b0 - movs r0, 0 - strb r0, [r1] - ldr r4, =0x03005d90 - ldr r0, [r4] - adds r0, 0x28 - movs r1, 0 - movs r2, 0x34 - bl memset - ldr r0, [r4] - adds r0, 0x5C - movs r1, 0 - movs r2, 0x34 - bl memset - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084390 - - thumb_func_start sub_80843C0 -sub_80843C0: @ 80843C0 - push {r4-r7,lr} - bl sub_80DF040 - movs r2, 0x8 - ldr r0, =0x03005d8c - mov r12, r0 - ldr r4, =0x00002e90 - ldr r3, =gUnknown_08339D1C -_080843D0: - mov r1, r12 - ldr r0, [r1] - lsls r1, r2, 5 - adds r0, r1 - adds r0, r4 - adds r1, r3, 0 - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldm r1!, {r5,r6} - stm r0!, {r5,r6} - adds r2, 0x1 - cmp r2, 0xC - ble _080843D0 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80843C0 - - thumb_func_start sub_8084400 -sub_8084400: @ 8084400 - push {r4,lr} - sub sp, 0x4 - movs r0, 0 - str r0, [sp] - ldr r4, =0x03005d90 - ldr r1, [r4] - ldr r0, =0x0000064c - adds r1, r0 - ldr r2, =0x05000238 - mov r0, sp - bl CpuSet - ldr r0, [r4] - ldr r1, =0x00000ee1 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r4] - ldr r1, =0x00000ee9 - adds r0, r1 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084400 - - thumb_func_start sub_808444C -sub_808444C: @ 808444C - push {lr} - sub sp, 0x4 - movs r3, 0x1 - negs r3, r3 - str r3, [sp] - movs r0, 0x19 - movs r1, 0x28 - adds r2, r3, 0 - bl warp1_set - bl warp_in - add sp, 0x4 - pop {r0} - bx r0 - thumb_func_end sub_808444C - - thumb_func_start init_sav2 -init_sav2: @ 808446C - push {lr} - bl memclr_stdsav2 - bl init_options - pop {r0} - bx r0 - thumb_func_end init_sav2 - - thumb_func_start sub_808447C -sub_808447C: @ 808447C - push {lr} - ldr r1, =0x020322d4 - movs r0, 0 - strb r0, [r1] - bl sub_80BB358 - bl zero_player_party_data - bl zero_enemy_party_data - bl sub_81AAB70 - bl sub_813624C - pop {r0} - bx r0 - .pool - thumb_func_end sub_808447C - - thumb_func_start NewGameInitData -@ void NewGameInitData() -NewGameInitData: @ 80844A0 - push {r4,r5,lr} - ldr r0, =0x03006210 - ldrh r0, [r0] - cmp r0, 0 - beq _080844AE - cmp r0, 0x2 - bne _080844B2 -_080844AE: - bl GameFreakRTC_Reset -_080844B2: - ldr r1, =0x020322d4 - movs r0, 0x1 - strb r0, [r1] - ldr r4, =0x03005d90 - ldr r0, [r4] - adds r0, 0xAC - movs r5, 0 - str r5, [r0] - bl zero_player_party_data - bl zero_enemy_party_data - bl sub_80BB2D0 - bl sub_8084400 - bl clear_sav1 - bl sub_80D436C - ldr r0, [r4] - strb r5, [r0, 0x9] - ldr r0, [r4] - adds r0, 0xA8 - str r5, [r0] - bl set_player_trainer_id - bl reset_playtime - bl sub_8084390 - bl sub_809D300 - bl sub_80EBEE0 - bl GabbyAndTyNewGameInitData - bl sub_80E8B28 - bl RemoveAllBerryTrees - ldr r4, =0x03005d8c - ldr r0, [r4] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - ldr r1, =0x00000bb8 - bl EncryptMoney - movs r0, 0 - bl SetCoins - bl sub_80D766C - bl sub_80847A8 - bl sub_80843C0 - bl sub_813C1F8 - bl sub_80F9A7C - bl sub_80F9AD4 - ldr r0, =0x020244e9 - strb r5, [r0] - bl zero_player_party_data - bl sub_80C7770 - bl sub_8161B34 - bl sub_8161B60 - ldr r0, [r4] - ldr r1, =0x00000496 - adds r0, r1 - strh r5, [r0] - bl sub_80D7094 - bl sub_816ADF4 - bl sub_8136E88 - bl sub_81618B4 - bl sub_811F184 - bl sub_8120160 - bl sub_81224D4 - bl sub_813BA10 - bl sub_8177558 - bl sub_808444C - ldr r0, =gUnknown_082715DE - bl script_env_2_execute_new_script - bl sub_80845CC - bl copy_strings_to_sav1 - bl sub_818DA30 - bl sub_819FAA0 - bl sub_81A4B14 - bl sub_8195E10 - bl sub_801AFD8 - bl sub_800E5AC - bl sub_81D54BC - bl sub_80DED74 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end NewGameInitData - - thumb_func_start sub_80845CC -sub_80845CC: @ 80845CC - push {r4-r6,lr} - sub sp, 0x4 - mov r0, sp - movs r5, 0 - strh r5, [r0] - ldr r4, =0x03005d90 - ldr r1, [r4] - movs r0, 0xF6 - lsls r0, 1 - adds r1, r0 - ldr r6, =0x01000008 - mov r0, sp - adds r2, r6, 0 - bl CpuSet - ldr r0, [r4] - movs r1, 0xFA - lsls r1, 1 - adds r0, r1 - movs r1, 0 - bl sub_802467C - bl sub_802E33C - mov r0, sp - adds r0, 0x2 - strh r5, [r0] - ldr r1, [r4] - movs r2, 0x83 - lsls r2, 2 - adds r1, r2 - adds r2, r6, 0 - bl CpuSet - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80845CC - - thumb_func_start sub_8084620 -sub_8084620: @ 8084620 - push {r4,lr} - ldr r0, =gUnknown_08271857 - bl script_env_2_execute_new_script - ldr r0, =0x03005d8c - ldr r4, [r0] - movs r0, 0x92 - lsls r0, 3 - adds r4, r0 - adds r0, r4, 0 - bl DecryptMoney - adds r1, r0, 0 - lsrs r1, 1 - adds r0, r4, 0 - bl EncryptMoney - bl sp000_heal_pokemon - bl sub_8084720 - bl copy_saved_warp3_bank_and_enter_x_to_warp1 - bl warp_in - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084620 - - thumb_func_start flag_var_implications_of_teleport_ -flag_var_implications_of_teleport_: @ 8084660 - push {lr} - bl player_avatar_init_params_reset - ldr r0, =0x0000088b - bl FlagReset - ldr r0, =0x0000088d - bl FlagReset - ldr r0, =0x0000088c - bl FlagReset - ldr r0, =0x00000889 - bl FlagReset - ldr r0, =0x00000888 - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end flag_var_implications_of_teleport_ - - thumb_func_start sub_808469C -sub_808469C: @ 808469C - push {lr} - bl player_avatar_init_params_reset - ldr r0, =0x0000088b - bl FlagReset - ldr r0, =0x0000088d - bl FlagReset - ldr r0, =0x0000088c - bl FlagReset - ldr r0, =0x00000889 - bl FlagReset - ldr r0, =0x00000888 - bl FlagReset - ldr r0, =gUnknown_08271862 - bl script_env_2_execute_new_script - pop {r0} - bx r0 - .pool - thumb_func_end sub_808469C - - thumb_func_start flagmods_08054D70 -flagmods_08054D70: @ 80846E4 - push {lr} - bl player_avatar_init_params_reset - ldr r0, =0x0000088b - bl FlagReset - ldr r0, =0x0000088d - bl FlagReset - ldr r0, =0x0000088c - bl FlagReset - ldr r0, =0x00000889 - bl FlagReset - ldr r0, =0x00000888 - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end flagmods_08054D70 - - thumb_func_start sub_8084720 -sub_8084720: @ 8084720 - push {r4,lr} - bl player_avatar_init_params_reset - ldr r0, =0x0000088b - bl FlagReset - ldr r0, =0x0000088d - bl FlagReset - ldr r0, =0x0000088c - bl FlagReset - ldr r0, =0x00000889 - bl FlagReset - ldr r0, =0x00000888 - bl FlagReset - ldr r4, =0x00004039 - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _08084764 - adds r0, r4, 0 - movs r1, 0 - bl VarSet - ldr r0, =0x00004037 - movs r1, 0 - bl VarSet -_08084764: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084720 - - thumb_func_start sub_8084788 -sub_8084788: @ 8084788 - push {lr} - ldr r0, =0x0000088c - bl FlagReset - bl sub_8085B2C - bl wild_pokemon_reroll - bl mapnumbers_history_shift_sav1_0_2_4_out - bl sub_8161D00 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084788 - - thumb_func_start sub_80847A8 -sub_80847A8: @ 80847A8 - push {r4,lr} - movs r4, 0 -_080847AC: - lsls r0, r4, 24 - lsrs r0, 24 - movs r1, 0 - bl sav12_xor_set - adds r4, 0x1 - cmp r4, 0x3F - ble _080847AC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80847A8 - - thumb_func_start sav12_xor_increment -@ void sav12_xor_increment(u8 a1) -sav12_xor_increment: @ 80847C4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x33 - bhi _080847EC - adds r0, r4, 0 - bl sub_80847F8 - adds r1, r0, 0 - ldr r0, =0x00fffffe - cmp r1, r0 - bhi _080847E4 - adds r1, 0x1 - b _080847E6 - .pool -_080847E4: - ldr r1, =0x00ffffff -_080847E6: - adds r0, r4, 0 - bl sav12_xor_set -_080847EC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sav12_xor_increment - - thumb_func_start sub_80847F8 -sub_80847F8: @ 80847F8 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x33 - bhi _08084828 - ldr r0, =0x03005d8c - ldr r2, [r0] - lsls r0, r1, 2 - ldr r1, =0x0000159c - adds r2, r1 - adds r2, r0 - ldr r0, =0x03005d90 - ldr r1, [r0] - adds r1, 0xAC - ldr r0, [r2] - ldr r1, [r1] - eors r0, r1 - b _0808482A - .pool -_08084828: - movs r0, 0 -_0808482A: - pop {r1} - bx r1 - thumb_func_end sub_80847F8 - - thumb_func_start sav12_xor_set -sav12_xor_set: @ 8084830 - push {lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x33 - bhi _08084854 - ldr r0, =0x03005d8c - ldr r1, [r0] - lsls r0, r2, 2 - ldr r2, =0x0000159c - adds r1, r2 - adds r1, r0 - ldr r0, =0x03005d90 - ldr r0, [r0] - adds r0, 0xAC - ldr r0, [r0] - eors r0, r3 - str r0, [r1] -_08084854: - pop {r0} - bx r0 - .pool - thumb_func_end sav12_xor_set - - thumb_func_start sub_8084864 -sub_8084864: @ 8084864 - push {r4-r6,lr} - adds r5, r0, 0 - movs r4, 0 - ldr r6, =0x03005d8c -_0808486C: - lsls r1, r4, 2 - ldr r0, =0x0000159c - adds r1, r0 - ldr r0, [r6] - adds r0, r1 - adds r1, r5, 0 - bl apply_u32_xor_crypto - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3F - bls _0808486C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084864 - - thumb_func_start CopyFieldObjectTemplatesToSav1 -@ void CopyFieldObjectTemplatesToSav1() -CopyFieldObjectTemplatesToSav1: @ 8084894 - push {r4,r5,lr} - sub sp, 0x4 - movs r0, 0 - str r0, [sp] - ldr r5, =0x03005d8c - ldr r1, [r5] - movs r4, 0xC7 - lsls r4, 4 - adds r1, r4 - ldr r2, =0x05000180 - mov r0, sp - bl CpuSet - ldr r0, =0x02037318 - ldr r2, [r0, 0x4] - ldr r0, [r2, 0x4] - ldr r1, [r5] - adds r1, r4 - ldrb r3, [r2] - lsls r2, r3, 1 - adds r2, r3 - lsls r2, 1 - movs r3, 0x80 - lsls r3, 19 - orrs r2, r3 - bl CpuSet - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end CopyFieldObjectTemplatesToSav1 - - thumb_func_start CopyFieldObjectTemplateCoordsToSav1 -@ void CopyFieldObjectTemplateCoordsToSav1() -CopyFieldObjectTemplateCoordsToSav1: @ 80848E0 - push {lr} - ldr r0, =0x02037318 - ldr r1, [r0, 0x4] - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, [r1, 0x4] - movs r3, 0xC7 - lsls r3, 4 - adds r1, r0, r3 - movs r3, 0x3F -_080848F4: - ldr r0, [r2, 0x10] - str r0, [r1, 0x10] - adds r2, 0x18 - adds r1, 0x18 - subs r3, 0x1 - cmp r3, 0 - bge _080848F4 - pop {r0} - bx r0 - .pool - thumb_func_end CopyFieldObjectTemplateCoordsToSav1 - - thumb_func_start update_saveblock1_field_object_coords -update_saveblock1_field_object_coords: @ 8084910 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 16 - lsrs r2, 16 - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0 - movs r6, 0xC7 - lsls r6, 4 - adds r3, r0, r6 -_0808492A: - ldrb r0, [r3] - cmp r0, r5 - bne _0808493C - strh r4, [r3, 0x4] - strh r2, [r3, 0x6] - b _08084944 - .pool -_0808493C: - adds r3, 0x18 - adds r1, 0x1 - cmp r1, 0x3F - ble _0808492A -_08084944: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end update_saveblock1_field_object_coords - - thumb_func_start update_saveblock1_field_object_movement_behavior -update_saveblock1_field_object_movement_behavior: @ 808494C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r3, 0 - movs r5, 0xC7 - lsls r5, 4 - adds r2, r0, r5 -_08084962: - ldrb r0, [r2] - cmp r0, r4 - bne _08084970 - strb r1, [r2, 0x9] - b _08084978 - .pool -_08084970: - adds r2, 0x18 - adds r3, 0x1 - cmp r3, 0x3F - ble _08084962 -_08084978: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end update_saveblock1_field_object_movement_behavior - - thumb_func_start mapdata_load_assets_to_gpu_and_full_redraw -mapdata_load_assets_to_gpu_and_full_redraw: @ 8084980 - push {r4,lr} - bl move_tilemap_camera_to_upper_left_corner - ldr r4, =0x02037318 - ldr r0, [r4] - bl copy_map_tileset1_tileset2_to_vram - ldr r0, [r4] - bl apply_map_tileset1_tileset2_palette - bl DrawWholeMapView - bl cur_mapheader_run_tileset_funcs_after_some_cpuset - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end mapdata_load_assets_to_gpu_and_full_redraw - - thumb_func_start get_mapdata_header -@ mapdata_header *get_mapdata_header() -get_mapdata_header: @ 80849A8 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x32] - cmp r1, 0 - bne _080849BC - movs r0, 0 - b _080849C6 - .pool -_080849BC: - ldr r0, =gUnknown_08481DD4 - subs r1, 0x1 - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] -_080849C6: - pop {r1} - bx r1 - .pool - thumb_func_end get_mapdata_header - - thumb_func_start warp_shift -@ void warp_shift() -warp_shift: @ 80849D0 - ldr r3, =0x020322dc - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r0, [r2, 0x4] - ldr r1, [r2, 0x8] - str r0, [r3] - str r1, [r3, 0x4] - ldr r0, =0x020322e4 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r2, 0x4] - str r1, [r2, 0x8] - ldr r2, =0x020322ec - ldr r0, =gUnknown_08339D3C - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r2] - str r1, [r2, 0x4] - ldr r2, =0x020322f4 - str r0, [r2] - str r1, [r2, 0x4] - bx lr - .pool - thumb_func_end warp_shift - - thumb_func_start set_warp2_warp3_to_neg_1 -@ void set_warp2_warp3_to_neg_1() -set_warp2_warp3_to_neg_1: @ 8084A14 - ldr r2, =0x020322ec - ldr r0, =gUnknown_08339D3C - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r2] - str r1, [r2, 0x4] - ldr r2, =0x020322f4 - str r0, [r2] - str r1, [r2, 0x4] - bx lr - .pool - thumb_func_end set_warp2_warp3_to_neg_1 - - thumb_func_start warp_set -@ void warp_set(warpdata *warp, char bank, char map, char warpid, char enter_x, char enter_y) -warp_set: @ 8084A34 - push {r4,r5,lr} - ldr r4, [sp, 0xC] - ldr r5, [sp, 0x10] - strb r1, [r0] - strb r2, [r0, 0x1] - strb r3, [r0, 0x2] - lsls r4, 24 - asrs r4, 24 - strh r4, [r0, 0x4] - lsls r5, 24 - asrs r5, 24 - strh r5, [r0, 0x6] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end warp_set - - thumb_func_start warp_data_is_not_neg_1 -@ int warp_data_is_not_neg_1(warpdata *warp) -warp_data_is_not_neg_1: @ 8084A54 - push {lr} - adds r1, r0, 0 - movs r2, 0 - ldrsb r2, [r1, r2] - movs r0, 0x1 - negs r0, r0 - cmp r2, r0 - bne _08084A88 - movs r0, 0x1 - ldrsb r0, [r1, r0] - cmp r0, r2 - bne _08084A88 - movs r2, 0x2 - ldrsb r2, [r1, r2] - cmp r2, r0 - bne _08084A88 - movs r0, 0x4 - ldrsh r3, [r1, r0] - cmp r3, r2 - bne _08084A88 - movs r2, 0x6 - ldrsh r0, [r1, r2] - cmp r0, r3 - bne _08084A88 - movs r0, 0x1 - b _08084A8A -_08084A88: - movs r0, 0 -_08084A8A: - pop {r1} - bx r1 - thumb_func_end warp_data_is_not_neg_1 - - thumb_func_start get_mapheader_by_bank_and_number -@ struct mapheader *get_mapheader_by_bank_and_number(unsigned int bank, unsigned int num) -get_mapheader_by_bank_and_number: @ 8084A90 - lsls r0, 16 - lsls r1, 16 - ldr r2, =gUnknown_08486578 - lsrs r0, 14 - adds r0, r2 - ldr r0, [r0] - lsrs r1, 14 - adds r1, r0 - ldr r0, [r1] - bx lr - .pool - thumb_func_end get_mapheader_by_bank_and_number - - thumb_func_start warp1_get_mapheader -@ struct mapheader *warp1_get_mapheader() -warp1_get_mapheader: @ 8084AA8 - push {lr} - ldr r1, =0x020322e4 - movs r0, 0 - ldrsb r0, [r1, r0] - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x1] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - pop {r1} - bx r1 - .pool - thumb_func_end warp1_get_mapheader - - thumb_func_start set_current_map_header_from_sav1_save_old_name -@ void set_current_map_header_from_sav1_save_old_name() -set_current_map_header_from_sav1_save_old_name: @ 8084ACC - push {r4-r6,lr} - ldr r1, =0x020322fc - ldr r4, =0x02037318 - ldrb r0, [r4, 0x14] - strh r0, [r1] - ldr r5, =0x03005d8c - ldr r1, [r5] - movs r0, 0x4 - ldrsb r0, [r1, r0] - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x5] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - adds r1, r4, 0 - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldr r0, [r0] - str r0, [r1] - ldr r1, [r5] - ldrh r0, [r4, 0x12] - strh r0, [r1, 0x32] - bl get_mapdata_header - str r0, [r4] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end set_current_map_header_from_sav1_save_old_name - - thumb_func_start set_current_map_header_from_sav1 -set_current_map_header_from_sav1: @ 8084B1C - push {r4,r5,lr} - ldr r4, =0x02037318 - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r0, 0x4 - ldrsb r0, [r1, r0] - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x5] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - adds r1, r4, 0 - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldr r0, [r0] - str r0, [r1] - bl get_mapdata_header - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end set_current_map_header_from_sav1 - - thumb_func_start update_camera_pos_from_warpid -@ void update_camera_pos_from_warpid() -update_camera_pos_from_warpid: @ 8084B5C - push {r4,r5,lr} - ldr r0, =0x03005d8c - ldr r2, [r0] - movs r1, 0x6 - ldrsb r1, [r2, r1] - adds r4, r0, 0 - cmp r1, 0 - blt _08084B94 - ldr r3, =0x02037318 - ldr r0, [r3, 0x4] - ldrb r5, [r0, 0x1] - cmp r1, r5 - bge _08084B94 - ldr r0, [r0, 0x8] - lsls r1, 3 - adds r0, r1, r0 - ldrh r0, [r0] - strh r0, [r2] - ldr r0, [r3, 0x4] - ldr r0, [r0, 0x8] - adds r1, r0 - ldrh r0, [r1, 0x2] - strh r0, [r2, 0x2] - b _08084BCC - .pool -_08084B94: - ldr r1, [r4] - ldrh r3, [r1, 0x8] - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0 - blt _08084BB0 - ldrh r2, [r1, 0xA] - movs r5, 0xA - ldrsh r0, [r1, r5] - cmp r0, 0 - blt _08084BB0 - strh r3, [r1] - strh r2, [r1, 0x2] - b _08084BCC -_08084BB0: - ldr r3, [r4] - ldr r2, =0x02037318 - ldr r0, [r2] - ldr r0, [r0] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r3] - ldr r0, [r2] - ldr r0, [r0, 0x4] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r3, 0x2] -_08084BCC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end update_camera_pos_from_warpid - - thumb_func_start warp_in -warp_in: @ 8084BD8 - push {lr} - bl warp_shift - bl set_current_map_header_from_sav1_save_old_name - bl update_camera_pos_from_warpid - pop {r0} - bx r0 - thumb_func_end warp_in - - thumb_func_start warp1_set -@ void warp1_set(char bank, char map, char warpid, char enter_x, char enter_y) -warp1_set: @ 8084BEC - push {r4-r6,lr} - sub sp, 0x8 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - ldr r1, [sp, 0x18] - ldr r0, =0x020322e4 - lsls r4, 24 - asrs r4, 24 - lsls r5, 24 - asrs r5, 24 - lsls r6, 24 - asrs r6, 24 - lsls r3, 24 - asrs r3, 24 - str r3, [sp] - lsls r1, 24 - asrs r1, 24 - str r1, [sp, 0x4] - adds r1, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl warp_set - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end warp1_set - - thumb_func_start warp1_set_2 -@ void warp1_set_2(char bank, char map, char warpid) -warp1_set_2: @ 8084C28 - push {lr} - sub sp, 0x4 - lsls r0, 24 - asrs r0, 24 - lsls r1, 24 - asrs r1, 24 - lsls r2, 24 - asrs r2, 24 - movs r3, 0x1 - negs r3, r3 - str r3, [sp] - bl warp1_set - add sp, 0x4 - pop {r0} - bx r0 - thumb_func_end warp1_set_2 - - thumb_func_start saved_warp2_set -@ void saved_warp2_set(char bank, char map, char warpid) -saved_warp2_set: @ 8084C48 - push {r4,r5,lr} - sub sp, 0x8 - ldr r0, =0x03005d8c - ldr r5, [r0] - adds r0, r5, 0 - adds r0, 0x14 - lsls r1, 24 - asrs r1, 24 - lsls r2, 24 - asrs r2, 24 - lsls r3, 24 - asrs r3, 24 - movs r4, 0 - ldrsb r4, [r5, r4] - str r4, [sp] - movs r4, 0x2 - ldrsb r4, [r5, r4] - str r4, [sp, 0x4] - bl warp_set - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end saved_warp2_set - - thumb_func_start saved_warp2_set_2 -saved_warp2_set_2: @ 8084C7C - push {r4,r5,lr} - sub sp, 0x8 - ldr r4, [sp, 0x14] - ldr r5, [sp, 0x18] - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r0, 0x14 - lsls r1, 24 - asrs r1, 24 - lsls r2, 24 - asrs r2, 24 - lsls r3, 24 - asrs r3, 24 - lsls r4, 24 - asrs r4, 24 - str r4, [sp] - lsls r5, 24 - asrs r5, 24 - str r5, [sp, 0x4] - bl warp_set - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end saved_warp2_set_2 - - thumb_func_start copy_saved_warp2_bank_and_enter_x_to_warp1 -copy_saved_warp2_bank_and_enter_x_to_warp1: @ 8084CB4 - ldr r2, =0x020322e4 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, [r0, 0x18] - ldr r0, [r0, 0x14] - str r0, [r2] - str r1, [r2, 0x4] - bx lr - .pool - thumb_func_end copy_saved_warp2_bank_and_enter_x_to_warp1 - - thumb_func_start sub_8084CCC -@ void sub_8084CCC(int a1) -sub_8084CCC: @ 8084CCC - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - bl sub_8122CBC - adds r4, r0, 0 - cmp r4, 0 - beq _08084CFA - movs r0, 0 - ldrsb r0, [r4, r0] - movs r1, 0x1 - ldrsb r1, [r4, r1] - movs r2, 0x1 - negs r2, r2 - movs r3, 0x2 - ldrsb r3, [r4, r3] - ldrb r4, [r4, 0x4] - lsls r4, 24 - asrs r4, 24 - str r4, [sp] - bl warp1_set -_08084CFA: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8084CCC - - thumb_func_start copy_saved_warp3_bank_and_enter_x_to_warp1 -@ void copy_saved_warp3_bank_and_enter_x_to_warp1() -copy_saved_warp3_bank_and_enter_x_to_warp1: @ 8084D04 - ldr r2, =0x020322e4 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, [r0, 0x20] - ldr r0, [r0, 0x1C] - str r0, [r2] - str r1, [r2, 0x4] - bx lr - .pool - thumb_func_end copy_saved_warp3_bank_and_enter_x_to_warp1 - - thumb_func_start sub_8084D1C -sub_8084D1C: @ 8084D1C - push {r4,r5,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - bl sub_8122CBC - adds r5, r0, 0 - cmp r5, 0 - beq _08084D50 - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r0, 0x1C - movs r1, 0 - ldrsb r1, [r5, r1] - movs r2, 0x1 - ldrsb r2, [r5, r2] - movs r3, 0x1 - negs r3, r3 - movs r4, 0x2 - ldrsb r4, [r5, r4] - str r4, [sp] - movs r4, 0x4 - ldrsb r4, [r5, r4] - str r4, [sp, 0x4] - bl warp_set -_08084D50: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084D1C - - thumb_func_start sub_8084D5C -sub_8084D5C: @ 8084D5C - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 16 - lsrs r7, r1, 16 - bl sav1_map_get_light_level - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =0x020322e4 - movs r0, 0 - ldrsb r0, [r1, r0] - ldrb r1, [r1, 0x1] - lsls r1, 24 - asrs r1, 24 - bl get_map_light_level_by_bank_and_number - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - bl is_light_level_1_2_3_5_or_6 - lsls r0, 24 - cmp r0, 0 - beq _08084DC4 - adds r0, r5, 0 - bl is_light_level_1_2_3_5_or_6 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08084DC4 - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r0, 0x4 - ldrsb r0, [r1, r0] - ldrb r1, [r1, 0x5] - lsls r1, 24 - asrs r1, 24 - movs r2, 0x1 - negs r2, r2 - subs r3, r6, 0x7 - lsls r3, 24 - asrs r3, 24 - subs r4, r7, 0x6 - lsls r4, 24 - asrs r4, 24 - str r4, [sp] - bl sub_8084DD4 -_08084DC4: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084D5C - - thumb_func_start sub_8084DD4 -sub_8084DD4: @ 8084DD4 - push {r4-r6,lr} - sub sp, 0x8 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - ldr r1, [sp, 0x18] - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r0, 0x24 - lsls r4, 24 - asrs r4, 24 - lsls r5, 24 - asrs r5, 24 - lsls r6, 24 - asrs r6, 24 - lsls r3, 24 - asrs r3, 24 - str r3, [sp] - lsls r1, 24 - asrs r1, 24 - str r1, [sp, 0x4] - adds r1, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl warp_set - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084DD4 - - thumb_func_start sub_8084E14 -sub_8084E14: @ 8084E14 - ldr r2, =0x020322e4 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, [r0, 0x28] - ldr r0, [r0, 0x24] - str r0, [r2] - str r1, [r2, 0x4] - bx lr - .pool - thumb_func_end sub_8084E14 - - thumb_func_start sub_8084E2C -sub_8084E2C: @ 8084E2C - push {r4-r6,lr} - sub sp, 0x8 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - ldr r1, [sp, 0x18] - ldr r0, =0x020322ec - lsls r4, 24 - asrs r4, 24 - lsls r5, 24 - asrs r5, 24 - lsls r6, 24 - asrs r6, 24 - lsls r3, 24 - asrs r3, 24 - str r3, [sp] - lsls r1, 24 - asrs r1, 24 - str r1, [sp, 0x4] - adds r1, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl warp_set - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084E2C - - thumb_func_start warp1_set_to_warp2 -warp1_set_to_warp2: @ 8084E68 - ldr r2, =0x020322e4 - ldr r0, =0x020322ec - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r2] - str r1, [r2, 0x4] - bx lr - .pool - thumb_func_end warp1_set_to_warp2 - - thumb_func_start sub_8084E80 -sub_8084E80: @ 8084E80 - push {r4-r6,lr} - sub sp, 0x8 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - ldr r1, [sp, 0x18] - ldr r0, =0x020322f4 - lsls r4, 24 - asrs r4, 24 - lsls r5, 24 - asrs r5, 24 - lsls r6, 24 - asrs r6, 24 - lsls r3, 24 - asrs r3, 24 - str r3, [sp] - lsls r1, 24 - asrs r1, 24 - str r1, [sp, 0x4] - adds r1, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl warp_set - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084E80 - - thumb_func_start sub_8084EBC -sub_8084EBC: @ 8084EBC - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 16 - lsrs r6, r1, 16 - ldr r4, =0x020322f4 - adds r0, r4, 0 - bl warp_data_is_not_neg_1 - cmp r0, 0x1 - bne _08084EF0 - ldr r2, =0x020322e4 - ldr r0, =0x020322dc - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r2] - str r1, [r2, 0x4] - b _08084F0A - .pool -_08084EF0: - movs r0, 0 - ldrsb r0, [r4, r0] - movs r1, 0x1 - ldrsb r1, [r4, r1] - movs r2, 0x1 - negs r2, r2 - lsls r3, r5, 24 - asrs r3, 24 - lsls r4, r6, 24 - asrs r4, 24 - str r4, [sp] - bl warp1_set -_08084F0A: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8084EBC - - thumb_func_start warp1_set_to_sav1w -warp1_set_to_sav1w: @ 8084F14 - ldr r2, =0x020322e4 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, [r0, 0x10] - ldr r0, [r0, 0xC] - str r0, [r2] - str r1, [r2, 0x4] - bx lr - .pool - thumb_func_end warp1_set_to_sav1w - - thumb_func_start sub_8084F2C -sub_8084F2C: @ 8084F2C - push {r4-r6,lr} - sub sp, 0x8 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - ldr r1, [sp, 0x18] - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r0, 0xC - lsls r4, 24 - asrs r4, 24 - lsls r5, 24 - asrs r5, 24 - lsls r6, 24 - asrs r6, 24 - lsls r3, 24 - asrs r3, 24 - str r3, [sp] - lsls r1, 24 - asrs r1, 24 - str r1, [sp, 0x4] - adds r1, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl warp_set - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084F2C - - thumb_func_start sub_8084F6C -sub_8084F6C: @ 8084F6C - push {r4,r5,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - bl sub_8122CBC - adds r5, r0, 0 - cmp r5, 0 - beq _08084FA0 - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r0, 0xC - movs r1, 0 - ldrsb r1, [r5, r1] - movs r2, 0x1 - ldrsb r2, [r5, r2] - movs r3, 0x1 - negs r3, r3 - movs r4, 0x2 - ldrsb r4, [r5, r4] - str r4, [sp] - movs r4, 0x4 - ldrsb r4, [r5, r4] - str r4, [sp, 0x4] - bl warp_set -_08084FA0: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8084F6C - - thumb_func_start sub_8084FAC -sub_8084FAC: @ 8084FAC - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r0, [r2, 0x14] - ldr r1, [r2, 0x18] - str r0, [r2, 0xC] - str r1, [r2, 0x10] - bx lr - .pool - thumb_func_end sub_8084FAC - - thumb_func_start sub_8084FC0 -sub_8084FC0: @ 8084FC0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037318 - ldr r0, [r0, 0xC] - ldr r3, [r0] - ldr r1, [r0, 0x4] - cmp r1, 0 - bne _08084FDC - b _08084FF0 - .pool -_08084FD8: - adds r0, r1, 0 - b _08084FF2 -_08084FDC: - movs r2, 0 - cmp r2, r3 - bge _08084FF0 -_08084FE2: - ldrb r0, [r1] - cmp r0, r4 - beq _08084FD8 - adds r2, 0x1 - adds r1, 0xC - cmp r2, r3 - blt _08084FE2 -_08084FF0: - movs r0, 0 -_08084FF2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8084FC0 - - thumb_func_start sub_8084FF8 -sub_8084FF8: @ 8084FF8 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 16 - lsrs r5, r2, 16 - bl sub_8084FC0 - adds r1, r0, 0 - cmp r1, 0 - beq _08085030 - movs r0, 0x8 - ldrsb r0, [r1, r0] - ldrb r1, [r1, 0x9] - lsls r1, 24 - asrs r1, 24 - movs r2, 0x1 - negs r2, r2 - lsls r3, r4, 24 - asrs r3, 24 - lsls r4, r5, 24 - asrs r4, 24 - str r4, [sp] - bl warp1_set - b _0808504C -_08085030: - bl mapheader_run_script_with_tag_x6 - ldr r0, =0x020322ec - bl warp_data_is_not_neg_1 - cmp r0, 0 - beq _08085048 - movs r0, 0 - b _0808504E - .pool -_08085048: - bl warp1_set_to_warp2 -_0808504C: - movs r0, 0x1 -_0808504E: - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8084FF8 - - thumb_func_start sub_8085058 -sub_8085058: @ 8085058 - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - lsls r3, 16 - lsrs r3, 16 - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x6 - adds r1, r3, 0 - bl sub_8084FF8 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_8085058 - - thumb_func_start sub_8085078 -sub_8085078: @ 8085078 - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - lsls r3, 16 - lsrs r3, 16 - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x5 - adds r1, r3, 0 - bl sub_8084FF8 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_8085078 - - thumb_func_start mliX_load_map -mliX_load_map: @ 8085098 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r5, r1, 0 - lsls r0, r6, 24 - asrs r0, 24 - lsls r1, r5, 24 - asrs r1, 24 - movs r3, 0x1 - negs r3, r3 - str r3, [sp] - adds r2, r3, 0 - bl warp1_set - ldr r4, =0x02037318 - ldrb r0, [r4, 0x14] - cmp r0, 0x3A - beq _080850C8 - bl sub_8085810 -_080850C8: - bl warp_shift - bl set_current_map_header_from_sav1_save_old_name - bl CopyFieldObjectTemplatesToSav1 - bl sav2_set_x9_depending_on_sav1_map - bl sub_809D344 - bl wild_pokemon_reroll - bl prev_quest_postbuffer_cursor_backup_reset - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_80B21B4 - bl sub_809E7B0 - bl sub_80AEDBC - bl sub_8085B2C - bl update_sav1_flash_used_on_map - bl sav1_reset_battle_music_maybe - bl mapheader_run_script_with_tag_x3 - bl not_trainer_hill_battle_pyramid - ldr r0, [r4] - bl copy_map_tileset2_to_vram_2 - ldr r0, [r4] - bl apply_map_tileset2_palette - movs r4, 0x6 -_08085116: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_80ABF00 - adds r4, 0x1 - cmp r4, 0xC - ble _08085116 - bl sub_80A0A2C - bl mapnumbers_history_shift_sav1_0_2_4_out - bl sub_8161D54 - bl sub_80AEE20 - bl wild_encounter_reset_coro_args - bl mapheader_run_script_with_tag_x5 - ldr r2, =0x02037318 - ldrb r0, [r2, 0x14] - cmp r0, 0x3A - bne _0808514C - ldr r1, =0x020322fc - ldrh r1, [r1] - cmp r0, r1 - beq _08085150 -_0808514C: - bl AddMapNamePopUpWindowTask -_08085150: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end mliX_load_map - - thumb_func_start mli0_load_map -mli0_load_map: @ 8085160 - push {r4-r7,lr} - adds r7, r0, 0 - bl set_current_map_header_from_sav1_save_old_name - ldr r0, =0x020322d8 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080851A2 - ldr r0, =0x02037318 - ldrh r1, [r0, 0x12] - ldr r0, =0x00000169 - cmp r1, r0 - bne _08085190 - bl sub_81AA1D8 - b _080851A2 - .pool -_08085190: - bl InTrainerHill - cmp r0, 0 - beq _0808519E - bl sub_81D5DF8 - b _080851A2 -_0808519E: - bl CopyFieldObjectTemplatesToSav1 -_080851A2: - ldr r4, =0x02037318 - ldrb r0, [r4, 0x17] - bl is_light_level_1_2_3_5_or_6 - lsls r0, 24 - lsrs r5, r0, 24 - ldrb r0, [r4, 0x17] - bl is_light_level_8_or_9 - lsls r0, 24 - lsrs r6, r0, 24 - bl sub_80EB218 - bl sav2_set_x9_depending_on_sav1_map - bl sub_809D344 - bl wild_pokemon_reroll - bl prev_quest_postbuffer_cursor_backup_reset - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r0, 0x4 - ldrsb r0, [r1, r0] - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x5] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl sub_80B21B4 - cmp r7, 0x1 - beq _080851EE - bl sub_809E7B0 -_080851EE: - bl sub_80AEDBC - bl sub_8085B2C - cmp r5, 0 - beq _08085200 - ldr r0, =0x00000888 - bl FlagReset -_08085200: - bl update_sav1_flash_used_on_map - bl sav1_reset_battle_music_maybe - bl mapheader_run_script_with_tag_x3 - bl mapnumbers_history_shift_sav1_0_2_4_out - bl sub_8161D00 - ldrh r1, [r4, 0x12] - ldr r0, =0x00000169 - cmp r1, r0 - bne _08085234 - movs r0, 0 - bl battle_pyramid_map_load_related - b _08085246 - .pool -_08085234: - bl InTrainerHill - cmp r0, 0 - beq _08085242 - bl trainer_hill_map_load_related - b _08085246 -_08085242: - bl not_trainer_hill_battle_pyramid -_08085246: - cmp r7, 0x1 - beq _0808525E - cmp r6, 0 - beq _0808525E - ldr r1, =0x03005dc0 - ldr r0, [r1] - ldr r1, [r1, 0x4] - bl UpdateTVScreensOnMap - movs r0, 0x1 - bl sub_80E9238 -_0808525E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end mli0_load_map - - thumb_func_start player_avatar_init_params_reset -player_avatar_init_params_reset: @ 8085268 - ldr r1, =0x02032300 - movs r0, 0x1 - strb r0, [r1, 0x1] - strb r0, [r1] - bx lr - .pool - thumb_func_end player_avatar_init_params_reset - - thumb_func_start walkrun_find_lowest_active_bit_in_bitfield -walkrun_find_lowest_active_bit_in_bitfield: @ 8085278 - push {r4,lr} - bl player_get_direction_lower_nybble - ldr r4, =0x02032300 - strb r0, [r4, 0x1] - movs r0, 0x2 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _08085298 - movs r0, 0x2 - b _080852CA - .pool -_08085298: - movs r0, 0x4 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _080852A8 - movs r0, 0x4 - b _080852CA -_080852A8: - movs r0, 0x8 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _080852B8 - movs r0, 0x8 - b _080852CA -_080852B8: - movs r0, 0x10 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _080852C8 - movs r0, 0x10 - b _080852CA -_080852C8: - movs r0, 0x1 -_080852CA: - strb r0, [r4] - pop {r4} - pop {r0} - bx r0 - thumb_func_end walkrun_find_lowest_active_bit_in_bitfield - - thumb_func_start sub_80852D4 -sub_80852D4: @ 80852D4 - push {r4-r7,lr} - bl sav1_map_get_light_level - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - bl cur_mapdata_block_role_at_screen_center_acc_to_sav1 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r6, =0x02032300 - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_808532C - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0xffffff00 - ands r7, r0 - orrs r7, r1 - adds r0, r6, 0 - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_808538C - lsls r0, 24 - lsrs r0, 16 - ldr r1, =0xffff00ff - ands r7, r1 - orrs r7, r0 - str r7, [r6] - adds r0, r6, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80852D4 - - thumb_func_start sub_808532C -sub_808532C: @ 808532C - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - lsls r2, 24 - lsrs r4, r2, 24 - cmp r4, 0x8 - beq _08085348 - ldr r0, =0x0000088d - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08085382 -_08085348: - cmp r4, 0x5 - bne _08085354 - movs r0, 0x10 - b _08085384 - .pool -_08085354: - lsls r0, r5, 24 - lsrs r0, 24 - bl MetatileBehavior_IsSurfableWaterOrUnderwater - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08085368 - movs r0, 0x8 - b _08085384 -_08085368: - bl sav1_map_is_biking_allowed - cmp r0, 0x1 - bne _08085382 - ldrb r0, [r6] - cmp r0, 0x2 - bne _0808537A - movs r0, 0x2 - b _08085384 -_0808537A: - cmp r0, 0x4 - bne _08085382 - movs r0, 0x4 - b _08085384 -_08085382: - movs r0, 0x1 -_08085384: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_808532C - - thumb_func_start sub_808538C -sub_808538C: @ 808538C - push {r4-r7,lr} - adds r6, r0, 0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 16 - lsrs r4, r2, 16 - lsls r3, 24 - lsrs r5, r3, 24 - ldr r0, =0x0000088d - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080853AC - cmp r5, 0x6 - beq _0808540C -_080853AC: - lsls r4, 24 - lsrs r5, r4, 24 - adds r0, r5, 0 - bl sub_8088F74 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080853E8 - adds r0, r5, 0 - bl sub_8088F58 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08085442 - adds r0, r5, 0 - bl sub_8088EFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08085442 - adds r0, r5, 0 - bl MetatileBehavior_IsSouthArrowWarp - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080853F0 -_080853E8: - movs r0, 0x2 - b _08085448 - .pool -_080853F0: - adds r0, r5, 0 - bl MetatileBehavior_IsNorthArrowWarp - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08085442 - adds r0, r5, 0 - bl MetatileBehavior_IsWestArrowWarp - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08085410 -_0808540C: - movs r0, 0x4 - b _08085448 -_08085410: - adds r0, r5, 0 - bl MetatileBehavior_IsEastArrowWarp - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08085422 - movs r0, 0x3 - b _08085448 -_08085422: - ldrb r0, [r6] - cmp r0, 0x10 - bne _0808542C - cmp r7, 0x8 - beq _08085446 -_0808542C: - cmp r0, 0x8 - bne _08085434 - cmp r7, 0x10 - beq _08085446 -_08085434: - lsrs r0, r4, 24 - bl MetatileBehavior_IsLadder - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08085446 -_08085442: - movs r0, 0x1 - b _08085448 -_08085446: - ldrb r0, [r6, 0x1] -_08085448: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808538C - - thumb_func_start cur_mapdata_block_role_at_screen_center_acc_to_sav1 -cur_mapdata_block_role_at_screen_center_acc_to_sav1: @ 8085450 - push {lr} - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r2, 0 - ldrsh r0, [r1, r2] - adds r0, 0x7 - movs r2, 0x2 - ldrsh r1, [r1, r2] - adds r1, 0x7 - bl MapGridGetMetatileBehaviorAt - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end cur_mapdata_block_role_at_screen_center_acc_to_sav1 - - thumb_func_start sav1_map_is_biking_allowed -sav1_map_is_biking_allowed: @ 8085474 - push {lr} - ldr r0, =0x02037318 - ldrb r1, [r0, 0x1A] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0808548C - movs r0, 0x1 - b _0808548E - .pool -_0808548C: - movs r0, 0 -_0808548E: - pop {r1} - bx r1 - thumb_func_end sav1_map_is_biking_allowed - - thumb_func_start update_sav1_flash_used_on_map -update_sav1_flash_used_on_map: @ 8085494 - push {lr} - ldr r0, =0x02037318 - ldrb r1, [r0, 0x15] - cmp r1, 0 - bne _080854B0 - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r0, 0x30 - strb r1, [r0] - b _080854DE - .pool -_080854B0: - ldr r0, =0x00000888 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080854D0 - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r0, 0x30 - movs r1, 0x1 - strb r1, [r0] - b _080854DE - .pool -_080854D0: - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =gUnknown_0854FE78 - ldr r0, [r0] - subs r0, 0x1 - adds r1, 0x30 - strb r0, [r1] -_080854DE: - pop {r0} - bx r0 - .pool - thumb_func_end update_sav1_flash_used_on_map - - thumb_func_start sub_80854EC -sub_80854EC: @ 80854EC - push {lr} - adds r1, r0, 0 - cmp r1, 0 - blt _080854FC - ldr r0, =gUnknown_0854FE78 - ldr r0, [r0] - cmp r1, r0 - ble _080854FE -_080854FC: - movs r1, 0 -_080854FE: - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r0, 0x30 - strb r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80854EC - - thumb_func_start sav1_get_flash_used_on_map -sav1_get_flash_used_on_map: @ 8085514 - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r0, 0x30 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sav1_get_flash_used_on_map - - thumb_func_start sub_8085524 -sub_8085524: @ 8085524 - push {lr} - ldr r1, =0x03005d8c - ldr r1, [r1] - strh r0, [r1, 0x32] - bl get_mapdata_header - ldr r1, =0x02037318 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8085524 - - thumb_func_start sub_8085540 -sub_8085540: @ 8085540 - ldr r1, =0x020322d8 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8085540 - - thumb_func_start sub_808554C -sub_808554C: @ 808554C - ldr r0, =0x020322d8 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_808554C - - thumb_func_start sub_8085558 -sub_8085558: @ 8085558 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0000088a - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080855AC - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0 - bne _080855AC - movs r0, 0x1 - ldrsb r0, [r4, r0] - cmp r0, 0x5 - blt _08085584 - cmp r0, 0x8 - ble _0808559E - cmp r0, 0x2B - bgt _08085584 - cmp r0, 0x27 - bge _0808559E -_08085584: - ldr r0, =0x0000405e - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x3 - bls _080855AC - movs r0, 0x1 - ldrsb r0, [r4, r0] - cmp r0, 0x2E - bgt _080855AC - cmp r0, 0x2C - blt _080855AC -_0808559E: - movs r0, 0x1 - b _080855AE - .pool -_080855AC: - movs r0, 0 -_080855AE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8085558 - - thumb_func_start sub_80855B4 -sub_80855B4: @ 80855B4 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x000040ca - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _080855D6 - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0 - bne _080855D6 - movs r0, 0x1 - ldrsb r0, [r4, r0] - cmp r0, 0x7 - beq _080855E0 -_080855D6: - movs r0, 0 - b _080855E2 - .pool -_080855E0: - movs r0, 0x1 -_080855E2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80855B4 - - thumb_func_start sub_80855E8 -sub_80855E8: @ 80855E8 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x000040b3 - bl VarGet - lsls r0, 16 - cmp r0, 0 - bne _08085606 - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0x20 - bne _08085606 - ldrb r0, [r4, 0x1] - cmp r0, 0x1 - bls _08085610 -_08085606: - movs r0, 0 - b _08085612 - .pool -_08085610: - movs r0, 0x1 -_08085612: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80855E8 - - thumb_func_start sub_8085618 -sub_8085618: @ 8085618 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x0000405d - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _0808564C - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bhi _0808564C - movs r0, 0 - ldrsb r0, [r5, r0] - cmp r0, 0xE - bne _0808564C - ldrb r0, [r5, 0x1] - subs r0, 0x9 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _08085654 -_0808564C: - movs r0, 0 - b _08085656 - .pool -_08085654: - movs r0, 0x1 -_08085656: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8085618 - - thumb_func_start warp_target_get_music -warp_target_get_music: @ 808565C - push {r4,lr} - adds r4, r0, 0 - bl sub_80855B4 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _08085674 - ldr r0, =0x0000ffff - b _080856CE - .pool -_08085674: - adds r0, r4, 0 - bl sub_8085558 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _0808568C - ldr r0, =0x000001bb - b _080856CE - .pool -_0808568C: - adds r0, r4, 0 - bl sub_8085618 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _080856A4 - ldr r0, =0x000001b9 - b _080856CE - .pool -_080856A4: - adds r0, r4, 0 - bl sub_80855E8 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - beq _080856CA - movs r0, 0 - ldrsb r0, [r4, r0] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ldrsb r1, [r4, r1] - lsls r1, 16 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - ldrh r0, [r0, 0x10] - b _080856CE -_080856CA: - movs r0, 0xCB - lsls r0, 1 -_080856CE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end warp_target_get_music - - thumb_func_start sav1_map_get_music -sav1_map_get_music: @ 80856D4 - push {r4,lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - movs r0, 0xD0 - lsls r0, 5 - cmp r1, r0 - bne _080856FC - bl sav1_get_weather_probably - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8 - bne _080856FC - ldr r0, =0x00000199 - b _08085730 - .pool -_080856FC: - ldr r4, =0x03005d8c - ldr r0, [r4] - adds r0, 0x4 - bl warp_target_get_music - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x00007fff - cmp r1, r0 - beq _0808571C - adds r0, r1, 0 - b _08085730 - .pool -_0808571C: - ldr r0, [r4] - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x17 - ble _0808572C - movs r0, 0xC9 - lsls r0, 1 - b _08085730 -_0808572C: - movs r0, 0xB4 - lsls r0, 1 -_08085730: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sav1_map_get_music - - thumb_func_start warp1_target_get_music -warp1_target_get_music: @ 8085738 - push {lr} - ldr r0, =0x020322e4 - bl warp_target_get_music - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x00007fff - cmp r1, r0 - beq _08085758 - adds r0, r1, 0 - b _08085774 - .pool -_08085758: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - movs r0, 0x80 - lsls r0, 2 - cmp r1, r0 - beq _08085770 - subs r0, 0x6E - b _08085774 - .pool -_08085770: - movs r0, 0xB4 - lsls r0, 1 -_08085774: - pop {r1} - bx r1 - thumb_func_end warp1_target_get_music - - thumb_func_start call_map_music_set_to_zero -call_map_music_set_to_zero: @ 8085778 - push {lr} - bl map_music_set_to_zero - pop {r0} - bx r0 - thumb_func_end call_map_music_set_to_zero - - thumb_func_start sub_8085784 -sub_8085784: @ 8085784 - push {r4,lr} - bl sav1_map_get_music - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x000001bb - cmp r4, r0 - beq _080857D6 - ldr r0, =0x0000ffff - cmp r4, r0 - beq _080857D6 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldrh r0, [r1, 0x2C] - cmp r0, 0 - beq _080857B4 - adds r4, r0, 0 - b _080857D6 - .pool -_080857B4: - bl sav1_map_get_light_level - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bne _080857C8 - ldr r4, =0x0000019b - b _080857D6 - .pool -_080857C8: - movs r0, 0x8 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _080857D6 - ldr r4, =0x0000016d -_080857D6: - bl current_map_music_get - lsls r0, 16 - lsrs r0, 16 - cmp r4, r0 - beq _080857E8 - adds r0, r4, 0 - bl current_map_music_set -_080857E8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8085784 - - thumb_func_start sav1_set_battle_music_maybe -sav1_set_battle_music_maybe: @ 80857F4 - ldr r1, =0x03005d8c - ldr r1, [r1] - strh r0, [r1, 0x2C] - bx lr - .pool - thumb_func_end sav1_set_battle_music_maybe - - thumb_func_start sav1_reset_battle_music_maybe -sav1_reset_battle_music_maybe: @ 8085800 - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r0, 0 - strh r0, [r1, 0x2C] - bx lr - .pool - thumb_func_end sav1_reset_battle_music_maybe - - thumb_func_start sub_8085810 -sub_8085810: @ 8085810 - push {r4-r6,lr} - ldr r0, =0x00004001 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08085890 - bl warp1_target_get_music - lsls r0, 16 - lsrs r4, r0, 16 - bl current_map_music_get - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x000001bb - cmp r4, r0 - beq _08085856 - ldr r0, =0x0000ffff - cmp r4, r0 - beq _08085856 - ldr r0, =0x0000019b - cmp r5, r0 - beq _08085890 - ldr r6, =0x0000016d - cmp r5, r6 - beq _08085890 - movs r0, 0x8 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _08085856 - adds r4, r6, 0 -_08085856: - cmp r4, r5 - beq _08085890 - movs r0, 0x6 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _08085888 - adds r0, r4, 0 - movs r1, 0x4 - movs r2, 0x4 - bl sub_80A2FBC - b _08085890 - .pool -_08085888: - adds r0, r4, 0 - movs r1, 0x8 - bl sub_80A2F88 -_08085890: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8085810 - - thumb_func_start sub_8085898 -sub_8085898: @ 8085898 - push {r4,lr} - bl current_map_music_get - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sav1_map_get_music - lsls r0, 16 - lsrs r0, 16 - cmp r4, r0 - beq _080858BE - bl sav1_map_get_music - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x8 - bl sub_80A2F88 -_080858BE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8085898 - - thumb_func_start sub_80858C4 -sub_80858C4: @ 80858C4 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - bl current_map_music_get - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r4 - beq _080858E4 - ldr r0, =0x000001bb - cmp r1, r0 - beq _080858E4 - adds r0, r4, 0 - movs r1, 0x8 - bl sub_80A2F88 -_080858E4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80858C4 - - thumb_func_start is_warp1_light_level_8_or_9 -is_warp1_light_level_8_or_9: @ 80858F0 - push {lr} - bl warp1_get_mapheader - ldrb r0, [r0, 0x17] - bl is_light_level_8_or_9 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08085908 - movs r0, 0x4 - b _0808590A -_08085908: - movs r0, 0x2 -_0808590A: - pop {r1} - bx r1 - thumb_func_end is_warp1_light_level_8_or_9 - - thumb_func_start music_something -music_something: @ 8085910 - push {r4,r5,lr} - bl current_map_music_get - lsls r0, 16 - lsrs r5, r0, 16 - bl warp1_target_get_music - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x00004001 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0808597E - bl current_map_music_get - lsls r0, 16 - lsrs r0, 16 - cmp r4, r0 - beq _0808597E - ldr r0, =0x0000016d - cmp r5, r0 - bne _08085972 - ldr r0, =0x000040ca - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bne _08085972 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x0000ffff - ldrh r2, [r0, 0x4] - movs r0, 0xE0 - lsls r0, 3 - cmp r2, r0 - bne _08085972 - ldr r3, =0x020322e4 - ldrh r0, [r3] - ands r1, r0 - cmp r1, r2 - bne _08085972 - ldr r1, [r3, 0x4] - ldr r0, =0x0035001d - cmp r1, r0 - beq _0808597E -_08085972: - bl is_warp1_light_level_8_or_9 - lsls r0, 24 - lsrs r0, 24 - bl sub_80A2F50 -_0808597E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end music_something - - thumb_func_start sub_80859A0 -sub_80859A0: @ 80859A0 - push {lr} - bl sub_80A303C - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_80859A0 - - thumb_func_start sub_80859B0 -sub_80859B0: @ 80859B0 - push {lr} - movs r0, 0x4 - bl sub_80A2F50 - pop {r0} - bx r0 - thumb_func_end sub_80859B0 - - thumb_func_start sub_80859BC -sub_80859BC: @ 80859BC - push {r4,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - ldr r0, =0x02032306 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080859F0 - 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_IsSurfableWaterOrUnderwater - lsls r0, 24 - cmp r0, 0 - beq _08085A2C -_080859F0: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x58 - bl __umodsi3 - adds r4, r0, 0 - adds r4, 0xD4 - lsls r4, 24 - lsrs r4, 24 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1E - bl __umodsi3 - adds r2, r0, 0 - adds r2, 0x32 - ldr r0, =0x02032304 - ldrh r0, [r0] - lsls r4, 24 - asrs r4, 24 - lsls r2, 24 - asrs r2, 24 - adds r1, r4, 0 - movs r3, 0x1 - bl sub_80A32C0 -_08085A2C: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80859BC - - thumb_func_start wild_encounter_related -wild_encounter_related: @ 8085A3C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r6, r0, 0 - adds r7, r1, 0 - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0x4 - bhi _08085B20 - lsls r0, 2 - ldr r1, =_08085A60 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08085A60: - .4byte _08085A74 - .4byte _08085A88 - .4byte _08085AA4 - .4byte _08085B0C - .4byte _08085B20 -_08085A74: - ldr r0, =0x02032304 - ldrh r0, [r0] - cmp r0, 0 - bne _08085A84 - movs r0, 0x4 - b _08085B1E - .pool -_08085A84: - movs r0, 0x1 - b _08085B1E -_08085A88: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x96 - lsls r1, 4 - bl __umodsi3 - movs r1, 0x96 - lsls r1, 3 - adds r0, r1 - strh r0, [r7] - movs r0, 0x3 - b _08085B1E -_08085AA4: - movs r0, 0x1 - mov r9, r0 - bl calc_player_party_count - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0 - b _08085ABC -_08085AB6: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_08085ABC: - cmp r5, r8 - bcs _08085AE4 - movs r0, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - movs r1, 0x6 - bl pokemon_getattr - cmp r0, 0 - bne _08085AB6 - adds r0, r4, 0 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x44 - bne _08085AB6 - movs r1, 0x2 - mov r9, r1 -_08085AE4: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r4, 0x96 - lsls r4, 3 - adds r1, r4, 0 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r0, r4 - mov r1, r9 - bl __divsi3 - strh r0, [r7] - movs r0, 0x3 - b _08085B1E - .pool -_08085B0C: - ldrh r0, [r7] - subs r0, 0x1 - strh r0, [r7] - lsls r0, 16 - cmp r0, 0 - bne _08085B20 - bl sub_80859BC - movs r0, 0x2 -_08085B1E: - strh r0, [r6] -_08085B20: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end wild_encounter_related - - thumb_func_start sub_8085B2C -sub_8085B2C: @ 8085B2C - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - movs r0, 0xB4 - lsls r0, 6 - cmp r1, r0 - bne _08085B5C - bl sub_813793C - lsls r0, 24 - cmp r0, 0 - bne _08085B5C - ldr r1, =0x02032306 - movs r0, 0x1 - strb r0, [r1] - bl sub_80B582C - b _08085B62 - .pool -_08085B5C: - ldr r0, =0x02032306 - bl wild_pokemon_rand_for_map -_08085B62: - ldr r1, =0x02032304 - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8085B2C - - thumb_func_start get_map_light_level_by_bank_and_number -@ int get_map_light_level_by_bank_and_number(int bank, int number) -get_map_light_level_by_bank_and_number: @ 8085B74 - push {lr} - lsls r0, 24 - asrs r0, 8 - lsrs r0, 16 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - ldrb r0, [r0, 0x17] - pop {r1} - bx r1 - thumb_func_end get_map_light_level_by_bank_and_number - - thumb_func_start get_map_light_level_from_warp -@ int get_map_light_level_from_warp(warpdata *warp) -get_map_light_level_from_warp: @ 8085B8C - push {lr} - movs r2, 0 - ldrsb r2, [r0, r2] - movs r1, 0x1 - ldrsb r1, [r0, r1] - adds r0, r2, 0 - bl get_map_light_level_by_bank_and_number - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end get_map_light_level_from_warp - - thumb_func_start sav1_map_get_light_level -sav1_map_get_light_level: @ 8085BA4 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r0, 0x4 - bl get_map_light_level_from_warp - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sav1_map_get_light_level - - thumb_func_start get_map_light_from_warp0 -get_map_light_from_warp0: @ 8085BBC - push {lr} - ldr r0, =0x020322dc - bl get_map_light_level_from_warp - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end get_map_light_from_warp0 - - thumb_func_start is_light_level_1_2_3_5_or_6 -is_light_level_1_2_3_5_or_6: @ 8085BD0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - beq _08085BEA - cmp r0, 0x1 - beq _08085BEA - cmp r0, 0x5 - beq _08085BEA - cmp r0, 0x2 - beq _08085BEA - cmp r0, 0x6 - bne _08085BEE -_08085BEA: - movs r0, 0x1 - b _08085BF0 -_08085BEE: - movs r0, 0 -_08085BF0: - pop {r1} - bx r1 - thumb_func_end is_light_level_1_2_3_5_or_6 - - thumb_func_start is_light_level_1_2_3_or_6 -is_light_level_1_2_3_or_6: @ 8085BF4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - beq _08085C0A - cmp r0, 0x1 - beq _08085C0A - cmp r0, 0x6 - beq _08085C0A - cmp r0, 0x2 - bne _08085C0E -_08085C0A: - movs r0, 0x1 - b _08085C10 -_08085C0E: - movs r0, 0 -_08085C10: - pop {r1} - bx r1 - thumb_func_end is_light_level_1_2_3_or_6 - - thumb_func_start is_light_level_8_or_9 -is_light_level_8_or_9: @ 8085C14 - push {lr} - lsls r0, 24 - movs r1, 0xF8 - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _08085C28 - movs r0, 0 - b _08085C2A -_08085C28: - movs r0, 0x1 -_08085C2A: - pop {r1} - bx r1 - thumb_func_end is_light_level_8_or_9 - - thumb_func_start sav1_saved_warp2_map_get_name -sav1_saved_warp2_map_get_name: @ 8085C30 - push {lr} - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r0, 0x14 - ldrsb r0, [r1, r0] - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x15] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - ldrb r0, [r0, 0x14] - pop {r1} - bx r1 - .pool - thumb_func_end sav1_saved_warp2_map_get_name - - thumb_func_start sav1_map_get_name -sav1_map_get_name: @ 8085C58 - push {lr} - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r0, 0x4 - ldrsb r0, [r1, r0] - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x5] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - ldrb r0, [r0, 0x14] - pop {r1} - bx r1 - .pool - thumb_func_end sav1_map_get_name - - thumb_func_start sav1_map_get_battletype -sav1_map_get_battletype: @ 8085C80 - push {lr} - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r0, 0x4 - ldrsb r0, [r1, r0] - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x5] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - ldrb r0, [r0, 0x1B] - pop {r1} - bx r1 - .pool - thumb_func_end sav1_map_get_battletype - - thumb_func_start overworld_bg_setup -@ void overworld_bg_setup() -overworld_bg_setup: @ 8085CA8 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r1, =gUnknown_08339DAC - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - movs r0, 0x1 - movs r1, 0x5 - movs r2, 0x1 - bl SetBgAttribute - movs r0, 0x2 - movs r1, 0x5 - movs r2, 0x1 - bl SetBgAttribute - movs r0, 0x3 - movs r1, 0x5 - movs r2, 0x1 - bl SetBgAttribute - ldr r0, =0x03005da0 - mov r8, r0 - movs r4, 0x80 - lsls r4, 4 - adds r0, r4, 0 - bl AllocZeroed - mov r1, r8 - str r0, [r1] - ldr r6, =0x03005d9c - adds r0, r4, 0 - bl AllocZeroed - str r0, [r6] - ldr r5, =0x03005da4 - adds r0, r4, 0 - bl AllocZeroed - str r0, [r5] - mov r0, r8 - ldr r1, [r0] - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r6] - movs r0, 0x2 - bl SetBgTilemapBuffer - ldr r1, [r5] - movs r0, 0x3 - bl SetBgTilemapBuffer - bl sub_81971D0 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end overworld_bg_setup - - thumb_func_start overworld_free_bg_tilemaps -overworld_free_bg_tilemaps: @ 8085D34 - push {r4,lr} - bl sub_81BE72C - bl sub_81971F4 - ldr r4, =0x03005da4 - ldr r0, [r4] - cmp r0, 0 - beq _08085D4E - bl Free - movs r0, 0 - str r0, [r4] -_08085D4E: - ldr r4, =0x03005d9c - ldr r0, [r4] - cmp r0, 0 - beq _08085D5E - bl Free - movs r0, 0 - str r0, [r4] -_08085D5E: - ldr r4, =0x03005da0 - ldr r0, [r4] - cmp r0, 0 - beq _08085D6E - bl Free - movs r0, 0 - str r0, [r4] -_08085D6E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end overworld_free_bg_tilemaps - - thumb_func_start ResetSafariZoneFlag_ -ResetSafariZoneFlag_: @ 8085D80 - push {lr} - bl ResetSafariZoneFlag - pop {r0} - bx r0 - thumb_func_end ResetSafariZoneFlag_ - - thumb_func_start is_c1_link_related_active -@ _BOOL4 is_c1_link_related_active() -is_c1_link_related_active: @ 8085D8C - push {lr} - ldr r0, =0x030022c0 - ldr r1, [r0] - ldr r0, =c1_link_related - cmp r1, r0 - beq _08085DA4 - movs r0, 0 - b _08085DA6 - .pool -_08085DA4: - movs r0, 0x1 -_08085DA6: - pop {r1} - bx r1 - thumb_func_end is_c1_link_related_active - - thumb_func_start c1_overworld_normal -@ void c1_overworld_normal(int buttons_new, int buttons_held) -c1_overworld_normal: @ 8085DAC - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r0, 16 - adds r5, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r4, r1, 0 - bl sub_808B578 - mov r6, sp - mov r0, sp - bl sub_809BEDC - mov r0, sp - adds r1, r5, 0 - adds r2, r4, 0 - bl process_overworld_input - bl script_env_2_is_enabled - lsls r0, 24 - cmp r0, 0 - bne _08085DFA - mov r0, sp - bl sub_809C014 - cmp r0, 0x1 - bne _08085DF0 - bl script_env_2_enable - bl HideMapNamePopUpWindow - b _08085DFA -_08085DF0: - ldrb r0, [r6, 0x2] - adds r1, r5, 0 - adds r2, r4, 0 - bl player_step -_08085DFA: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end c1_overworld_normal - - thumb_func_start c1_overworld -c1_overworld: @ 8085E04 - push {lr} - ldr r2, =0x030022c0 - ldr r1, [r2, 0x4] - ldr r0, =c2_overworld - cmp r1, r0 - bne _08085E18 - ldrh r0, [r2, 0x2E] - ldrh r1, [r2, 0x2C] - bl c1_overworld_normal -_08085E18: - pop {r0} - bx r0 - .pool - thumb_func_end c1_overworld - - thumb_func_start c2_overworld_basic -@ void c2_overworld_basic() -c2_overworld_basic: @ 8085E24 - push {lr} - bl script_env_2_run_current_script - bl RunTasks - bl CallObjectCallbacks - bl CameraUpdate - bl UpdateCameraPanning - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - bl sub_80A0A38 - bl do_scheduled_bg_tilemap_copies_to_vram - pop {r0} - bx r0 - thumb_func_end c2_overworld_basic - - thumb_func_start sub_8085E50 -sub_8085E50: @ 8085E50 - push {lr} - bl c2_overworld_basic - pop {r0} - bx r0 - thumb_func_end sub_8085E50 - - thumb_func_start c2_overworld -c2_overworld: @ 8085E5C - push {r4,lr} - ldr r0, =0x02037fd4 - ldrb r0, [r0, 0x7] - lsrs r0, 7 - adds r4, r0, 0 - cmp r4, 0 - beq _08085E70 - movs r0, 0 - bl SetVBlankCallback -_08085E70: - bl c2_overworld_basic - cmp r4, 0 - beq _08085E7C - bl SetFieldVBlankCallback -_08085E7C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end c2_overworld - - thumb_func_start set_callback1 -set_callback1: @ 8085E88 - ldr r1, =0x030022c0 - str r0, [r1] - bx lr - .pool - thumb_func_end set_callback1 - - thumb_func_start sub_8085E94 -sub_8085E94: @ 8085E94 - ldr r1, =0x03000e0c - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8085E94 - - thumb_func_start map_post_load_hook_exec -map_post_load_hook_exec: @ 8085EA0 - push {r4,lr} - ldr r4, =0x03005db0 - ldr r0, [r4] - cmp r0, 0 - beq _08085ECC - bl _call_via_r0 - lsls r0, 24 - cmp r0, 0 - bne _08085EBC - movs r0, 0 - b _08085EEC - .pool -_08085EBC: - movs r1, 0 - str r1, [r4] - ldr r0, =0x03005dac - str r1, [r0] - b _08085EEA - .pool -_08085ECC: - ldr r0, =0x03005dac - ldr r0, [r0] - cmp r0, 0 - beq _08085EE0 - bl _call_via_r0 - b _08085EE4 - .pool -_08085EE0: - bl mapldr_default -_08085EE4: - ldr r1, =0x03005dac - movs r0, 0 - str r0, [r1] -_08085EEA: - movs r0, 0x1 -_08085EEC: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end map_post_load_hook_exec - - thumb_func_start CB2_NewGame -CB2_NewGame: @ 8085EF8 - push {lr} - bl sub_808631C - bl sub_80A2F30 - bl ResetSafariZoneFlag_ - bl NewGameInitData - bl player_avatar_init_params_reset - bl set_max_playtime_if_appropriate - bl script_env_1_init - bl script_env_2_disable - ldr r1, =0x03005dac - ldr r0, =sub_80FB4E0 - str r0, [r1] - ldr r1, =0x03005db0 - movs r0, 0 - str r0, [r1] - ldr r0, =0x030026f8 - bl do_load_map_stuff_loop - bl SetFieldVBlankCallback - ldr r0, =c1_overworld - bl set_callback1 - ldr r0, =c2_overworld - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end CB2_NewGame - - thumb_func_start c2_whiteout -c2_whiteout: @ 8085F58 - push {lr} - sub sp, 0x4 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x77 - bls _08085FB0 - bl sub_808631C - bl sub_80A2F30 - bl ResetSafariZoneFlag_ - bl sub_8084620 - bl player_avatar_init_params_reset - bl script_env_1_init - bl script_env_2_disable - ldr r1, =0x03005dac - ldr r0, =sub_80AF3C8 - str r0, [r1] - mov r1, sp - movs r0, 0 - strb r0, [r1] - mov r0, sp - bl do_load_map_stuff_loop - bl SetFieldVBlankCallback - ldr r0, =c1_overworld - bl set_callback1 - ldr r0, =c2_overworld - bl SetMainCallback2 -_08085FB0: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end c2_whiteout - - thumb_func_start c2_load_new_map -c2_load_new_map: @ 8085FCC - push {lr} - bl sub_808631C - bl script_env_1_init - bl script_env_2_disable - movs r0, 0 - bl set_callback1 - ldr r0, =c2_change_map - bl SetMainCallback2 - ldr r1, =0x030022c0 - ldr r0, =c2_load_new_map_2 - str r0, [r1, 0x8] - pop {r0} - bx r0 - .pool - thumb_func_end c2_load_new_map - - thumb_func_start c2_load_new_map_2 -c2_load_new_map_2: @ 8085FFC - push {lr} - ldr r0, =0x030026f8 - bl do_load_map_stuff_loop - bl SetFieldVBlankCallback - ldr r0, =c1_overworld - bl set_callback1 - ldr r0, =c2_overworld - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end c2_load_new_map_2 - - thumb_func_start sub_8086024 -sub_8086024: @ 8086024 - push {r4,lr} - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0 - bne _08086046 - bl sub_808631C - bl script_env_1_init - bl script_env_2_disable - movs r0, 0 - bl set_callback1 -_08086046: - adds r0, r4, 0 - movs r1, 0x1 - bl load_map_stuff - cmp r0, 0 - beq _08086062 - bl SetFieldVBlankCallback - ldr r0, =c1_overworld - bl set_callback1 - ldr r0, =c2_overworld - bl SetMainCallback2 -_08086062: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086024 - - thumb_func_start sub_8086074 -sub_8086074: @ 8086074 - push {lr} - bl sub_808631C - ldr r0, =0x03005dac - ldr r1, =sub_80AF314 - str r1, [r0] - ldr r0, =c2_80567AC - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086074 - - thumb_func_start c2_80567AC -c2_80567AC: @ 8086098 - push {lr} - ldr r0, =0x030026f8 - bl map_loading_iteration_3 - cmp r0, 0 - beq _080860B8 - bl SetFieldVBlankCallback - ldr r0, =c1_link_related - bl set_callback1 - bl sub_8086C2C - ldr r0, =c2_overworld - bl SetMainCallback2 -_080860B8: - pop {r0} - bx r0 - .pool - thumb_func_end c2_80567AC - - thumb_func_start c2_exit_to_overworld_2_switch -c2_exit_to_overworld_2_switch: @ 80860C8 - push {lr} - bl is_c1_link_related_active - cmp r0, 0x1 - bne _080860E0 - ldr r0, =c2_exit_to_overworld_2_link - bl SetMainCallback2 - b _080860EA - .pool -_080860E0: - bl sub_808631C - ldr r0, =c2_exit_to_overworld_2_local - bl SetMainCallback2 -_080860EA: - pop {r0} - bx r0 - .pool - thumb_func_end c2_exit_to_overworld_2_switch - - thumb_func_start c2_exit_to_overworld_2_local -c2_exit_to_overworld_2_local: @ 80860F4 - push {lr} - ldr r0, =0x030026f8 - bl sub_8086638 - cmp r0, 0 - beq _0808610A - bl SetFieldVBlankCallback - ldr r0, =c2_overworld - bl SetMainCallback2 -_0808610A: - pop {r0} - bx r0 - .pool - thumb_func_end c2_exit_to_overworld_2_local - - thumb_func_start c2_exit_to_overworld_2_link -c2_exit_to_overworld_2_link: @ 8086118 - push {lr} - bl sub_8087598 - cmp r0, 0 - bne _08086132 - ldr r0, =0x030026f8 - bl map_loading_iteration_2_link - cmp r0, 0 - beq _08086132 - ldr r0, =c2_overworld - bl SetMainCallback2 -_08086132: - pop {r0} - bx r0 - .pool - thumb_func_end c2_exit_to_overworld_2_link - - thumb_func_start c2_8056854 -c2_8056854: @ 8086140 - push {lr} - bl sub_808631C - bl sub_80A2F30 - ldr r0, =c1_link_related - bl set_callback1 - bl sub_8086C2C - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08086174 - ldr r1, =0x03005dac - ldr r0, =sub_80AF314 - b _08086178 - .pool -_08086174: - ldr r1, =0x03005dac - ldr r0, =sub_80AF214 -_08086178: - str r0, [r1] - bl script_env_1_init - bl script_env_2_disable - bl c2_exit_to_overworld_2_switch - pop {r0} - bx r0 - .pool - thumb_func_end c2_8056854 - - thumb_func_start sub_8086194 -sub_8086194: @ 8086194 - push {lr} - bl sub_808631C - ldr r1, =0x03005db0 - ldr r0, =sub_80AF6A4 - str r0, [r1] - bl c2_exit_to_overworld_2_switch - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086194 - - thumb_func_start sub_80861B0 -sub_80861B0: @ 80861B0 - push {lr} - bl sub_808631C - ldr r1, =0x03005dac - ldr r0, =sub_80AF188 - str r0, [r1] - bl c2_exit_to_overworld_2_switch - pop {r0} - bx r0 - .pool - thumb_func_end sub_80861B0 - - thumb_func_start c2_exit_to_overworld_1_continue_scripts_restart_music -c2_exit_to_overworld_1_continue_scripts_restart_music: @ 80861CC - push {lr} - bl sub_808631C - ldr r1, =0x03005dac - ldr r0, =sub_80AF168 - str r0, [r1] - bl c2_exit_to_overworld_2_switch - pop {r0} - bx r0 - .pool - thumb_func_end c2_exit_to_overworld_1_continue_scripts_restart_music - - thumb_func_start sub_80861E8 -sub_80861E8: @ 80861E8 - push {lr} - bl sub_808631C - ldr r1, =0x03005dac - ldr r0, =sub_80AF3C8 - str r0, [r1] - bl c2_exit_to_overworld_2_switch - pop {r0} - bx r0 - .pool - thumb_func_end sub_80861E8 - - thumb_func_start sub_8086204 -sub_8086204: @ 8086204 - push {lr} - ldr r0, =0x02037318 - ldrb r1, [r0, 0x1A] - movs r0, 0xF8 - ands r0, r1 - cmp r0, 0x8 - bne _08086222 - bl sub_80E909C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08086222 - bl AddMapNamePopUpWindowTask -_08086222: - bl sub_80AF3C8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086204 - - thumb_func_start sub_8086230 -sub_8086230: @ 8086230 - push {r4,lr} - bl sub_808631C - bl sub_80A2F30 - bl ResetSafariZoneFlag_ - ldr r0, =0x03006210 - ldrh r0, [r0] - cmp r0, 0xFF - bne _0808624A - bl sub_81A3908 -_0808624A: - bl set_current_map_header_from_sav1 - bl set_warp2_warp3_to_neg_1 - bl GetCurrentTrainerHillMapId - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037318 - ldrh r1, [r0, 0x12] - ldr r0, =0x00000169 - cmp r1, r0 - bne _08086278 - bl sub_81AA2F8 - b _0808628A - .pool -_08086278: - cmp r4, 0 - beq _08086286 - cmp r4, 0x6 - beq _08086286 - bl sub_81D5F48 - b _0808628A -_08086286: - bl CopyFieldObjectTemplateCoordsToSav1 -_0808628A: - bl sub_809757C - bl sub_809E7B0 - bl sub_8084788 - ldr r0, =0x02037318 - ldrh r1, [r0, 0x12] - ldr r0, =0x00000169 - cmp r1, r0 - bne _080862B0 - movs r0, 0x1 - bl battle_pyramid_map_load_related - b _080862BE - .pool -_080862B0: - cmp r4, 0 - beq _080862BA - bl trainer_hill_map_load_related - b _080862BE -_080862BA: - bl sub_8087D74 -_080862BE: - bl set_max_playtime_if_appropriate - bl script_env_1_init - bl script_env_2_disable - bl sub_8195E10 - bl sav2_x1_query_bit1 - cmp r0, 0x1 - bne _080862F4 - bl sav2_x9_clear_bit1 - bl warp1_set_to_sav1w - bl warp_in - bl sub_80EDB44 - ldr r0, =c2_load_new_map - bl SetMainCallback2 - b _08086308 - .pool -_080862F4: - bl sub_80EDB44 - ldr r0, =0x03005dac - ldr r1, =sub_8086204 - str r1, [r0] - ldr r0, =c1_overworld - bl set_callback1 - bl c2_exit_to_overworld_2_switch -_08086308: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086230 - - thumb_func_start sub_808631C -@ void sub_808631C() -sub_808631C: @ 808631C - push {r4,lr} - bl warp0_in_pokecenter - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0808632E - bl sub_80097E8 -_0808632E: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08086348 - movs r0, 0xC5 - bl EnableInterrupts - movs r0, 0x2 - bl DisableInterrupts - b _08086362 - .pool -_08086348: - ldr r4, =0x04000208 - ldrh r3, [r4] - strh r0, [r4] - ldr r2, =0x04000200 - ldrh r1, [r2] - ldr r0, =0x0000fffd - ands r0, r1 - strh r0, [r2] - ldrh r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strh r0, [r2] - strh r3, [r4] -_08086362: - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - bl SetHBlankCallback - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808631C - - thumb_func_start SetFieldVBlankCallback -@ void SetFieldVBlankCallback() -SetFieldVBlankCallback: @ 8086380 - push {lr} - ldr r0, =VBlankCB_Field - bl SetVBlankCallback - pop {r0} - bx r0 - .pool - thumb_func_end SetFieldVBlankCallback - - thumb_func_start VBlankCB_Field -VBlankCB_Field: @ 8086390 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl sub_80BA0A8 - bl FieldUpdateBgTilemapScroll - bl copy_pal_bg_faded_to_pal_ram - bl sub_80A09D0 - pop {r0} - bx r0 - thumb_func_end VBlankCB_Field - - thumb_func_start sub_80863B0 -sub_80863B0: @ 80863B0 - push {lr} - bl sub_81A9E6C - lsls r0, 24 - cmp r0, 0 - beq _080863D4 - bl door_upload_tiles - ldr r2, =gUnknown_08339DBC - ldr r0, [r2] - ldr r1, [r2, 0x4] - ldr r2, [r2, 0x8] - bl sub_80BA038 - b _080863F0 - .pool -_080863D4: - bl sav1_get_flash_used_on_map - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _080863F0 - bl sub_80B00E8 - ldr r2, =gUnknown_08339DBC - ldr r0, [r2] - ldr r1, [r2, 0x4] - ldr r2, [r2, 0x8] - bl sub_80BA038 -_080863F0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80863B0 - - thumb_func_start map_loading_iteration_3 -map_loading_iteration_3: @ 80863F8 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0xD - bls _08086404 - b _08086512 -_08086404: - lsls r0, 2 - ldr r1, =_08086414 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08086414: - .4byte _0808644C - .4byte _08086462 - .4byte _0808646A - .4byte _08086472 - .4byte _08086484 - .4byte _08086492 - .4byte _08086498 - .4byte _080864A8 - .4byte _080864B8 - .4byte _080864D4 - .4byte _080864DA - .4byte _080864E0 - .4byte _080864FC - .4byte _0808650E -_0808644C: - bl overworld_bg_setup - bl script_env_1_init - bl script_env_2_disable - bl saveblock_randomize_and_relocate_ - bl sub_80867D8 - b _08086506 -_08086462: - movs r0, 0x1 - bl mli0_load_map - b _08086506 -_0808646A: - movs r0, 0x1 - bl sub_8086988 - b _08086506 -_08086472: - bl sub_8086AE4 - bl sub_80869DC - bl sub_8086B14 - bl sub_8086AAC - b _08086506 -_08086484: - bl sub_80863B0 - bl map_loading_lcd_reset - bl sub_8197200 - b _08086506 -_08086492: - bl move_tilemap_camera_to_upper_left_corner - b _08086506 -_08086498: - ldr r0, =0x02037318 - ldr r0, [r0] - bl copy_map_tileset1_to_vram - b _08086506 - .pool -_080864A8: - ldr r0, =0x02037318 - ldr r0, [r0] - bl copy_map_tileset2_to_vram - b _08086506 - .pool -_080864B8: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08086512 - ldr r0, =0x02037318 - ldr r0, [r0] - bl apply_map_tileset1_tileset2_palette - b _08086506 - .pool -_080864D4: - bl DrawWholeMapView - b _08086506 -_080864DA: - bl cur_mapheader_run_tileset_funcs_after_some_cpuset - b _08086506 -_080864E0: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08086506 - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - b _08086506 - .pool -_080864FC: - bl map_post_load_hook_exec - lsls r0, 24 - cmp r0, 0 - beq _08086512 -_08086506: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _08086512 -_0808650E: - movs r0, 0x1 - b _08086514 -_08086512: - movs r0, 0 -_08086514: - pop {r4} - pop {r1} - bx r1 - thumb_func_end map_loading_iteration_3 - - thumb_func_start load_map_stuff -@ int load_map_stuff(u8 *a1, int a2) -load_map_stuff: @ 808651C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4] - cmp r0, 0xD - bls _0808652A - b _0808662E -_0808652A: - lsls r0, 2 - ldr r1, =_08086538 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08086538: - .4byte _08086570 - .4byte _0808657C - .4byte _08086586 - .4byte _0808658E - .4byte _08086598 - .4byte _080865A6 - .4byte _080865AC - .4byte _080865BC - .4byte _080865CC - .4byte _080865E8 - .4byte _080865EE - .4byte _080865F4 - .4byte _08086618 - .4byte _0808662A -_08086570: - bl sub_808631C - adds r0, r5, 0 - bl mli0_load_map - b _08086622 -_0808657C: - bl saveblock_randomize_and_relocate_ - bl sub_80867D8 - b _08086622 -_08086586: - adds r0, r5, 0 - bl sub_8086988 - b _08086622 -_0808658E: - bl mli4_mapscripts_and_other - bl sub_8086A80 - b _08086622 -_08086598: - bl sub_80863B0 - bl map_loading_lcd_reset - bl sub_8197200 - b _08086622 -_080865A6: - bl move_tilemap_camera_to_upper_left_corner - b _08086622 -_080865AC: - ldr r0, =0x02037318 - ldr r0, [r0] - bl copy_map_tileset1_to_vram - b _08086622 - .pool -_080865BC: - ldr r0, =0x02037318 - ldr r0, [r0] - bl copy_map_tileset2_to_vram - b _08086622 - .pool -_080865CC: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0808662E - ldr r0, =0x02037318 - ldr r0, [r0] - bl apply_map_tileset1_tileset2_palette - b _08086622 - .pool -_080865E8: - bl DrawWholeMapView - b _08086622 -_080865EE: - bl cur_mapheader_run_tileset_funcs_after_some_cpuset - b _08086622 -_080865F4: - ldr r0, =0x02037318 - ldrb r1, [r0, 0x1A] - movs r0, 0xF8 - ands r0, r1 - cmp r0, 0x8 - bne _08086622 - bl sub_80E909C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08086622 - bl AddMapNamePopUpWindowTask - b _08086622 - .pool -_08086618: - bl map_post_load_hook_exec - lsls r0, 24 - cmp r0, 0 - beq _0808662E -_08086622: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _0808662E -_0808662A: - movs r0, 0x1 - b _08086630 -_0808662E: - movs r0, 0 -_08086630: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end load_map_stuff - - thumb_func_start sub_8086638 -sub_8086638: @ 8086638 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0x1 - beq _0808666E - cmp r0, 0x1 - bgt _0808664C - cmp r0, 0 - beq _08086656 - b _0808668E -_0808664C: - cmp r0, 0x2 - beq _08086678 - cmp r0, 0x3 - beq _0808668A - b _0808668E -_08086656: - bl saveblock_randomize_and_relocate_ - bl sub_80867D8 - movs r0, 0 - bl sub_8086988 - bl sub_8086A68 - bl sub_8086A80 - b _08086682 -_0808666E: - bl sub_8086860 - bl sub_81D64C0 - b _08086682 -_08086678: - bl map_post_load_hook_exec - lsls r0, 24 - cmp r0, 0 - beq _0808668E -_08086682: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _0808668E -_0808668A: - movs r0, 0x1 - b _08086690 -_0808668E: - movs r0, 0 -_08086690: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8086638 - - thumb_func_start map_loading_iteration_2_link -map_loading_iteration_2_link: @ 8086698 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4] - cmp r0, 0xD - bls _080866A4 - b _080867A8 -_080866A4: - lsls r0, 2 - ldr r1, =_080866B4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080866B4: - .4byte _080866EC - .4byte _080866FA - .4byte _08086702 - .4byte _08086710 - .4byte _0808671E - .4byte _08086724 - .4byte _08086734 - .4byte _08086744 - .4byte _08086760 - .4byte _08086766 - .4byte _08086792 - .4byte _0808676C - .4byte _08086788 - .4byte _0808679A -_080866EC: - bl sub_808631C - bl saveblock_randomize_and_relocate_ - bl sub_80867D8 - b _08086792 -_080866FA: - movs r0, 0x1 - bl sub_8086988 - b _08086792 -_08086702: - bl sub_8086B9C - bl sub_8086A68 - bl sub_8086AC8 - b _08086792 -_08086710: - bl sub_80863B0 - bl map_loading_lcd_reset - bl sub_8197200 - b _08086792 -_0808671E: - bl move_tilemap_camera_to_upper_left_corner - b _08086792 -_08086724: - ldr r0, =0x02037318 - ldr r0, [r0] - bl copy_map_tileset1_to_vram - b _08086792 - .pool -_08086734: - ldr r0, =0x02037318 - ldr r0, [r0] - bl copy_map_tileset2_to_vram - b _08086792 - .pool -_08086744: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080867A8 - ldr r0, =0x02037318 - ldr r0, [r0] - bl apply_map_tileset1_tileset2_palette - b _08086792 - .pool -_08086760: - bl DrawWholeMapView - b _08086792 -_08086766: - bl cur_mapheader_run_tileset_funcs_after_some_cpuset - b _08086792 -_0808676C: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08086792 - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - b _08086792 - .pool -_08086788: - bl map_post_load_hook_exec - lsls r0, 24 - cmp r0, 0 - beq _080867A8 -_08086792: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _080867A8 -_0808679A: - bl SetFieldVBlankCallback - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - movs r0, 0x1 - b _080867AA -_080867A8: - movs r0, 0 -_080867AA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end map_loading_iteration_2_link - - thumb_func_start do_load_map_stuff_loop -do_load_map_stuff_loop: @ 80867B0 - push {r4,lr} - adds r4, r0, 0 -_080867B4: - adds r0, r4, 0 - movs r1, 0 - bl load_map_stuff - cmp r0, 0 - beq _080867B4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end do_load_map_stuff_loop - - thumb_func_start saveblock_randomize_and_relocate_ -saveblock_randomize_and_relocate_: @ 80867C8 - push {lr} - bl sub_81BE6AC - bl saveblock_randomize_and_relocate - pop {r0} - bx r0 - thumb_func_end saveblock_randomize_and_relocate_ - - thumb_func_start sub_80867D8 -sub_80867D8: @ 80867D8 - push {r4-r7,lr} - sub sp, 0x4 - movs r0, 0 - movs r1, 0 - bl SetGpuReg - bl remove_some_task - ldr r2, =0x05000002 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, =0x040000d4 - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - ldr r0, =0x810001ff - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r2, 0xC0 - lsls r2, 19 - movs r3, 0xC0 - lsls r3, 9 - mov r4, sp - movs r6, 0 - movs r5, 0x80 - lsls r5, 5 - ldr r7, =0x81000800 - movs r0, 0x81 - lsls r0, 24 - mov r12, r0 -_08086816: - strh r6, [r4] - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - str r7, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r2, r5 - subs r3, r5 - cmp r3, r5 - bhi _08086816 - strh r6, [r4] - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - lsrs r0, r3, 1 - mov r2, r12 - orrs r0, r2 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r0, 0 - movs r1, 0x80 - bl ResetSpriteRange - bl LoadOamFromSprites - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80867D8 - - thumb_func_start sub_8086860 -sub_8086860: @ 8086860 - push {lr} - bl sub_80863B0 - bl map_loading_lcd_reset - bl sub_8197200 - bl mapdata_load_assets_to_gpu_and_full_redraw - pop {r0} - bx r0 - thumb_func_end sub_8086860 - - thumb_func_start map_loading_lcd_reset -map_loading_lcd_reset: @ 8086878 - push {r4,lr} - bl clear_scheduled_bg_copies_to_vram - bl reset_temp_tile_data_buffers - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - ldr r1, =0x00001f1f - movs r0, 0x48 - bl SetGpuReg - ldr r1, =0x00000101 - movs r0, 0x4A - bl SetGpuReg - movs r0, 0x40 - movs r1, 0xFF - bl SetGpuReg - movs r0, 0x44 - movs r1, 0xFF - bl SetGpuReg - ldr r4, =0x0000ffff - movs r0, 0x42 - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x46 - adds r1, r4, 0 - bl SetGpuReg - ldr r0, =gUnknown_82EC7C4 - ldrh r1, [r0, 0x2] - ldrh r2, [r0, 0x4] - orrs r1, r2 - ldrh r0, [r0, 0x6] - orrs r1, r0 - movs r2, 0x82 - lsls r2, 5 - adds r0, r2, 0 - orrs r1, r0 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x0000070d - movs r0, 0x52 - bl SetGpuReg - bl overworld_bg_setup - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - 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 - ldr r1, =0x00007060 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - bl sub_8098128 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end map_loading_lcd_reset - - thumb_func_start sub_8086988 -sub_8086988: @ 8086988 - push {r4,lr} - adds r4, r0, 0 - bl ResetTasks - bl ResetAllObjectData - bl sub_80A1A74 - bl dp12_8087EA4 - bl dp13_810BB8C - bl ResetCameraUpdateInfo - bl InstallCameraPanAheadCallback - cmp r4, 0 - bne _080869B4 - movs r0, 0 - bl npc_paltag_set_load - b _080869BA -_080869B4: - movs r0, 0x1 - bl npc_paltag_set_load -_080869BA: - bl FieldEffectActiveListClear - bl sub_80AAFA4 - bl sub_80AEE84 - cmp r4, 0 - bne _080869CE - bl overworld_ensure_per_step_coros_running -_080869CE: - bl mapheader_run_script_with_tag_x5 - bl sub_81BE6B8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8086988 - - thumb_func_start sub_80869DC -sub_80869DC: @ 80869DC - push {lr} - ldr r0, =0x03005dec - movs r1, 0 - strh r1, [r0] - ldr r0, =0x03005de8 - strh r1, [r0] - bl sub_808D438 - movs r0, 0 - movs r1, 0 - bl SpawnFieldObjectsInView - bl mapheader_run_first_tag4_script_list_match - pop {r0} - bx r0 - .pool - thumb_func_end sub_80869DC - - thumb_func_start mli4_mapscripts_and_other -mli4_mapscripts_and_other: @ 8086A04 - push {r4,r5,lr} - sub sp, 0x4 - ldr r0, =0x03005dec - movs r1, 0 - strh r1, [r0] - ldr r0, =0x03005de8 - strh r1, [r0] - bl sub_808D438 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl sav1_camera_get_focus_coords - bl sub_80852D4 - adds r5, r0, 0 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - ldrb r2, [r5, 0x1] - ldr r3, =0x03005d90 - ldr r3, [r3] - ldrb r3, [r3, 0x8] - bl InitPlayerAvatar - ldrb r0, [r5] - bl SetPlayerAvatarTransitionFlags - bl player_avatar_init_params_reset - movs r0, 0 - movs r1, 0 - bl SpawnFieldObjectsInView - bl mapheader_run_first_tag4_script_list_match - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end mli4_mapscripts_and_other - - thumb_func_start sub_8086A68 -sub_8086A68: @ 8086A68 - push {lr} - movs r0, 0 - movs r1, 0 - bl sub_808E16C - bl sub_80FBED0 - bl mapheader_run_script_with_tag_x7 - pop {r0} - bx r0 - thumb_func_end sub_8086A68 - - thumb_func_start sub_8086A80 -sub_8086A80: @ 8086A80 - push {lr} - ldr r2, =0x02037350 - ldr r3, =0x02037590 - ldrb r1, [r3, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0, 0x1] - ldrb r0, [r3, 0x4] - bl InitCameraUpdateCallback - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086A80 - - thumb_func_start sub_8086AAC -sub_8086AAC: @ 8086AAC - push {lr} - ldr r0, =0x03005db4 - ldrb r0, [r0] - bl sub_8087858 - lsls r0, 24 - lsrs r0, 24 - bl InitCameraUpdateCallback - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086AAC - - thumb_func_start sub_8086AC8 -sub_8086AC8: @ 8086AC8 - push {lr} - ldr r0, =0x03005db4 - ldrb r0, [r0] - bl sub_8087858 - lsls r0, 24 - lsrs r0, 24 - bl InitCameraUpdateCallback - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086AC8 - - thumb_func_start sub_8086AE4 -sub_8086AE4: @ 8086AE4 - push {r4,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl sav1_camera_get_focus_coords - mov r2, sp - ldr r0, =0x03005db4 - ldrb r1, [r0] - ldrh r0, [r2] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r4] - bl sub_8088B3C - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086AE4 - - thumb_func_start sub_8086B14 -sub_8086B14: @ 8086B14 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl sav1_camera_get_focus_coords - mov r3, sp - mov r2, sp - ldr r0, =0x03005db4 - ldrb r1, [r0] - ldrh r0, [r2] - subs r0, r1 - strh r0, [r3] - movs r6, 0 - ldr r0, =0x03005db8 - mov r8, r4 - ldrb r0, [r0] - cmp r6, r0 - bcs _08086B7E - ldr r7, =0x020229e8 -_08086B44: - lsls r5, r6, 24 - lsrs r5, 24 - mov r0, sp - ldrh r1, [r0] - adds r1, r6, r1 - lsls r1, 16 - asrs r1, 16 - mov r0, r8 - movs r3, 0 - ldrsh r2, [r0, r3] - lsls r4, r6, 3 - subs r4, r6 - lsls r4, 2 - adds r4, r7 - ldrb r3, [r4, 0x13] - adds r0, r5, 0 - bl sub_80876F0 - ldrb r1, [r4] - adds r0, r5, 0 - bl sub_8087BCC - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =0x03005db8 - ldrb r0, [r0] - cmp r6, r0 - bcc _08086B44 -_08086B7E: - bl sub_8086C40 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086B14 - - thumb_func_start sub_8086B9C -sub_8086B9C: @ 8086B9C - push {r4,r5,lr} - movs r4, 0 - ldr r0, =0x03005db8 - ldrb r0, [r0] - cmp r4, r0 - bcs _08086BCA - ldr r5, =0x020229e8 -_08086BAA: - lsls r0, r4, 24 - lsrs r0, 24 - lsls r1, r4, 3 - subs r1, r4 - lsls r1, 2 - adds r1, r5 - ldrb r1, [r1] - bl sub_8087BCC - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x03005db8 - ldrb r0, [r0] - cmp r4, r0 - bcc _08086BAA -_08086BCA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086B9C - - thumb_func_start c1_link_related -c1_link_related: @ 8086BD8 - push {r4,lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08086BF2 - bl sub_800F0B8 - cmp r0, 0 - beq _08086BF2 - bl sub_8009F3C - cmp r0, 0 - bne _08086C14 -_08086BF2: - ldr r0, =0x03005db4 - ldrb r4, [r0] - ldr r0, =0x03003020 - adds r1, r4, 0 - bl sub_8086F38 - ldr r0, =0x03000e14 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - lsls r0, 16 - lsrs r0, 16 - bl sub_8086FA0 - bl sub_8086C40 -_08086C14: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end c1_link_related - - thumb_func_start sub_8086C2C -sub_8086C2C: @ 8086C2C - push {lr} - bl sub_8086C90 - ldr r0, =sub_80870B0 - bl c1_link_related_func_set - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086C2C - - thumb_func_start sub_8086C40 -sub_8086C40: @ 8086C40 - push {lr} - ldr r0, =0x03003020 - bl sub_808709C - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086C40 - - thumb_func_start c1_link_related_func_set -c1_link_related_func_set: @ 8086C50 - ldr r2, =0x03000e19 - movs r1, 0 - strb r1, [r2] - ldr r1, =0x03000e14 - str r0, [r1] - bx lr - .pool - thumb_func_end c1_link_related_func_set - - thumb_func_start sub_8086C64 -sub_8086C64: @ 8086C64 - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08086C82 - ldr r1, =0x03000e19 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3C - bls _08086C82 - bl sub_8010198 -_08086C82: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086C64 - - thumb_func_start sub_8086C90 -sub_8086C90: @ 8086C90 - push {lr} - ldr r1, =0x03000e10 - movs r2, 0x80 - adds r0, r1, 0x3 -_08086C98: - strb r2, [r0] - subs r0, 0x1 - cmp r0, r1 - bge _08086C98 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086C90 - - thumb_func_start sub_8086CA8 -sub_8086CA8: @ 8086CA8 - push {r4,lr} - lsls r0, 16 - lsrs r3, r0, 16 - ldr r0, =0x03005db8 - ldrb r2, [r0] - movs r1, 0 - cmp r1, r2 - bge _08086CD6 - ldr r4, =0x03000e10 -_08086CBA: - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, r3 - beq _08086CD0 - movs r0, 0 - b _08086CD8 - .pool -_08086CD0: - adds r1, 0x1 - cmp r1, r2 - blt _08086CBA -_08086CD6: - movs r0, 0x1 -_08086CD8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8086CA8 - - thumb_func_start sub_8086CE0 -sub_8086CE0: @ 8086CE0 - push {r4,lr} - lsls r0, 16 - lsrs r3, r0, 16 - ldr r0, =0x03005db8 - ldrb r2, [r0] - movs r1, 0 - cmp r1, r2 - bge _08086D0E - ldr r4, =0x03000e10 -_08086CF2: - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, r3 - bne _08086D08 - movs r0, 0x1 - b _08086D10 - .pool -_08086D08: - adds r1, 0x1 - cmp r1, r2 - blt _08086CF2 -_08086D0E: - movs r0, 0 -_08086D10: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8086CE0 - - thumb_func_start sub_8086D18 -sub_8086D18: @ 8086D18 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r0, 0 - adds r6, r2, 0 - mov r9, r3 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - ldr r0, =0x03000e10 - adds r5, r7, r0 - ldrb r0, [r5] - cmp r0, 0x80 - beq _08086D38 - b _08086EB2 -_08086D38: - adds r0, r6, 0 - bl sub_8087370 - adds r4, r0, 0 - cmp r4, 0 - beq _08086D70 - bl sub_8087480 - mov r1, r9 - strh r0, [r1] - movs r0, 0x81 - strb r0, [r5] - ldrb r0, [r6, 0x1] - cmp r0, 0 - bne _08086D58 - b _08086F26 -_08086D58: - ldr r0, =sub_80870F8 - bl c1_link_related_func_set - adds r0, r4, 0 - bl sub_8087530 - b _08086F26 - .pool -_08086D70: - movs r0, 0x83 - bl sub_8086CE0 - cmp r0, 0x1 - bne _08086D98 - movs r0, 0x81 - strb r0, [r5] - ldrb r0, [r6, 0x1] - cmp r0, 0 - bne _08086D86 - b _08086F26 -_08086D86: - ldr r0, =sub_80870F8 - bl c1_link_related_func_set - bl sub_8087584 - b _08086F26 - .pool -_08086D98: - mov r0, r8 - subs r0, 0x12 - cmp r0, 0xA - bls _08086DA2 - b _08086EB2 -_08086DA2: - lsls r0, 2 - ldr r1, =_08086DB0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08086DB0: - .4byte _08086E08 - .4byte _08086EB2 - .4byte _08086EB2 - .4byte _08086EB2 - .4byte _08086EB2 - .4byte _08086EB2 - .4byte _08086DDC - .4byte _08086E34 - .4byte _08086EB2 - .4byte _08086E64 - .4byte _08086E90 -_08086DDC: - adds r0, r6, 0 - bl sub_8087358 - cmp r0, 0 - beq _08086EB2 - ldr r0, =0x03000e10 - adds r0, r7, r0 - movs r1, 0x81 - strb r1, [r0] - ldrb r0, [r6, 0x1] - cmp r0, 0 - beq _08086EB2 - ldr r0, =sub_80870F8 - bl c1_link_related_func_set - bl sub_808751C - b _08086EB2 - .pool -_08086E08: - adds r0, r6, 0 - bl sub_8087388 - cmp r0, 0x1 - bne _08086EB2 - ldr r0, =0x03000e10 - adds r0, r7, r0 - movs r1, 0x81 - strb r1, [r0] - ldrb r0, [r6, 0x1] - cmp r0, 0 - beq _08086EB2 - ldr r0, =sub_80870F8 - bl c1_link_related_func_set - bl sub_808754C - b _08086EB2 - .pool -_08086E34: - adds r0, r6, 0 - bl sub_80873B4 - adds r4, r0, 0 - cmp r4, 0 - beq _08086EB2 - ldr r0, =0x03000e10 - adds r0, r7, r0 - movs r1, 0x81 - strb r1, [r0] - ldrb r0, [r6, 0x1] - cmp r0, 0 - beq _08086EB2 - ldr r0, =sub_80870F8 - bl c1_link_related_func_set - adds r0, r4, 0 - bl sub_8087568 - b _08086EB2 - .pool -_08086E64: - adds r0, r6, 0 - bl sub_8087340 - cmp r0, 0 - beq _08086EB2 - ldr r0, =0x03000e10 - adds r0, r7, r0 - movs r1, 0x81 - strb r1, [r0] - ldrb r0, [r6, 0x1] - cmp r0, 0 - beq _08086EB2 - ldr r0, =sub_808711C - bl c1_link_related_func_set - bl sub_8087510 - b _08086EB2 - .pool -_08086E90: - adds r0, r6, 0 - bl sub_8087340 - cmp r0, 0 - beq _08086EB2 - ldr r0, =0x03000e10 - adds r0, r7, r0 - movs r1, 0x81 - strb r1, [r0] - ldrb r0, [r6, 0x1] - cmp r0, 0 - beq _08086EB2 - ldr r0, =sub_8087140 - bl c1_link_related_func_set - bl sub_8087510 -_08086EB2: - mov r0, r8 - cmp r0, 0x17 - beq _08086ED8 - cmp r0, 0x17 - bgt _08086ECC - cmp r0, 0x16 - beq _08086EE8 - b _08086F26 - .pool -_08086ECC: - mov r1, r8 - cmp r1, 0x1A - beq _08086EF8 - cmp r1, 0x1D - beq _08086F18 - b _08086F26 -_08086ED8: - ldr r0, =0x03000e10 - adds r0, r7, r0 - movs r1, 0x83 - strb r1, [r0] - b _08086F26 - .pool -_08086EE8: - ldr r0, =0x03000e10 - adds r0, r7, r0 - movs r1, 0x82 - strb r1, [r0] - b _08086F26 - .pool -_08086EF8: - ldr r0, =0x03000e10 - adds r0, r7, r0 - movs r1, 0x80 - strb r1, [r0] - ldrb r0, [r6, 0x1] - cmp r0, 0 - beq _08086F26 - ldr r0, =sub_80870B0 - bl c1_link_related_func_set - b _08086F26 - .pool -_08086F18: - ldr r0, =0x03000e10 - adds r1, r7, r0 - ldrb r0, [r1] - cmp r0, 0x82 - bne _08086F26 - movs r0, 0x81 - strb r0, [r1] -_08086F26: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086D18 - - thumb_func_start sub_8086F38 -sub_8086F38: @ 8086F38 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - mov r8, r1 - movs r6, 0 - add r5, sp, 0x10 - mov r9, r5 - adds r7, r0, 0 -_08086F4C: - ldrb r4, [r7] - movs r0, 0 - strh r0, [r5] - adds r0, r6, 0 - mov r1, r8 - mov r2, sp - bl sub_80872D8 - adds r0, r6, 0 - adds r1, r4, 0 - mov r2, sp - adds r3, r5, 0 - bl sub_8086D18 - ldr r0, =0x03000e10 - adds r0, r6, r0 - ldrb r0, [r0] - cmp r0, 0x80 - bne _08086F7C - adds r0, r4, 0 - bl sub_8087068 - mov r1, r9 - strh r0, [r1] -_08086F7C: - lsls r0, r6, 24 - lsrs r0, 24 - ldrb r1, [r5] - bl sub_808796C - adds r7, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _08086F4C - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086F38 - - thumb_func_start sub_8086FA0 -sub_8086FA0: @ 8086FA0 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - ldr r1, =0xffef0000 - adds r0, r1 - lsrs r0, 16 - cmp r0, 0xC - bhi _08086FC0 - ldr r0, =0x03005da8 - strh r4, [r0] - b _08086FC6 - .pool -_08086FC0: - ldr r1, =0x03005da8 - movs r0, 0x11 - strh r0, [r1] -_08086FC6: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08086FFC - bl sub_8087690 - cmp r0, 0x1 - bls _08086FFC - bl is_c1_link_related_active - cmp r0, 0x1 - bne _08086FFC - bl sub_8009F3C - cmp r0, 0x1 - bne _08086FFC - cmp r4, 0x11 - blt _08086FFC - cmp r4, 0x15 - ble _08086FF6 - cmp r4, 0x19 - bgt _08086FFC - cmp r4, 0x18 - blt _08086FFC -_08086FF6: - ldr r1, =0x03005da8 - movs r0, 0 - strh r0, [r1] -_08086FFC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8086FA0 - - thumb_func_start sub_808700C -sub_808700C: @ 808700C - push {lr} - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2C] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08087024 - movs r0, 0x13 - b _08087064 - .pool -_08087024: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08087030 - movs r0, 0x12 - b _08087064 -_08087030: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0808703C - movs r0, 0x14 - b _08087064 -_0808703C: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08087048 - movs r0, 0x15 - b _08087064 -_08087048: - ldrh r1, [r2, 0x2E] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _08087056 - movs r0, 0x18 - b _08087064 -_08087056: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08087062 - movs r0, 0x11 - b _08087064 -_08087062: - movs r0, 0x19 -_08087064: - pop {r1} - bx r1 - thumb_func_end sub_808700C - - thumb_func_start sub_8087068 -sub_8087068: @ 8087068 - push {lr} - lsls r0, 16 - lsrs r0, 16 - adds r1, r0, 0 - cmp r0, 0x13 - beq _0808708E - cmp r0, 0x13 - bgt _0808707E - cmp r0, 0x12 - beq _08087092 - b _08087096 -_0808707E: - cmp r1, 0x14 - beq _0808708A - cmp r1, 0x15 - bne _08087096 - movs r0, 0x4 - b _08087098 -_0808708A: - movs r0, 0x3 - b _08087098 -_0808708E: - movs r0, 0x1 - b _08087098 -_08087092: - movs r0, 0x2 - b _08087098 -_08087096: - movs r0, 0 -_08087098: - pop {r1} - bx r1 - thumb_func_end sub_8087068 - - thumb_func_start sub_808709C -sub_808709C: @ 808709C - push {lr} - movs r2, 0x11 - adds r1, r0, 0x6 -_080870A2: - strh r2, [r1] - subs r1, 0x2 - cmp r1, r0 - bge _080870A2 - pop {r0} - bx r0 - thumb_func_end sub_808709C - - thumb_func_start sub_80870B0 -sub_80870B0: @ 80870B0 - push {r4,lr} - adds r4, r0, 0 - bl script_env_2_is_enabled - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080870C4 - movs r0, 0x11 - b _080870E6 -_080870C4: - bl sub_800B4DC - cmp r0, 0x4 - bls _080870D0 - movs r0, 0x1B - b _080870E6 -_080870D0: - bl sub_8087690 - cmp r0, 0x4 - bls _080870DC - movs r0, 0x1C - b _080870E6 -_080870DC: - adds r0, r4, 0 - bl sub_808700C - lsls r0, 16 - lsrs r0, 16 -_080870E6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80870B0 - - thumb_func_start sub_80870EC -sub_80870EC: @ 80870EC - push {lr} - bl sub_8086C64 - movs r0, 0x11 - pop {r1} - bx r1 - thumb_func_end sub_80870EC - - thumb_func_start sub_80870F8 -sub_80870F8: @ 80870F8 - push {r4,lr} - bl script_env_2_is_enabled - lsls r0, 24 - lsrs r0, 24 - movs r4, 0x11 - cmp r0, 0x1 - beq _08087110 - movs r4, 0x1A - ldr r0, =sub_80870EC - bl c1_link_related_func_set -_08087110: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80870F8 - - thumb_func_start sub_808711C -sub_808711C: @ 808711C - push {r4,lr} - bl sub_800B4DC - movs r4, 0x11 - cmp r0, 0x2 - bhi _08087134 - movs r4, 0x1A - bl script_env_2_disable - ldr r0, =sub_80870EC - bl c1_link_related_func_set -_08087134: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808711C - - thumb_func_start sub_8087140 -sub_8087140: @ 8087140 - push {r4,lr} - bl sub_8087690 - movs r4, 0x11 - cmp r0, 0x2 - bhi _08087158 - movs r4, 0x1A - bl script_env_2_disable - ldr r0, =sub_80870EC - bl c1_link_related_func_set -_08087158: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8087140 - - thumb_func_start sub_8087164 -sub_8087164: @ 8087164 - push {lr} - bl sub_8086C64 - movs r0, 0x11 - pop {r1} - bx r1 - thumb_func_end sub_8087164 - - thumb_func_start sub_8087170 -sub_8087170: @ 8087170 - push {lr} - ldr r1, =0x03000e10 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x82 - bne _080871A0 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080871A4 - ldr r0, =sub_8087164 - bl c1_link_related_func_set - movs r0, 0x1D - b _080871A6 - .pool -_080871A0: - bl sub_8086C64 -_080871A4: - movs r0, 0x11 -_080871A6: - pop {r1} - bx r1 - thumb_func_end sub_8087170 - - thumb_func_start sub_80871AC -sub_80871AC: @ 80871AC - push {lr} - ldr r0, =sub_8087170 - bl c1_link_related_func_set - movs r0, 0x16 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80871AC - - thumb_func_start sub_80871C0 -sub_80871C0: @ 80871C0 - movs r0, 0x11 - bx lr - thumb_func_end sub_80871C0 - - thumb_func_start sub_80871C4 -sub_80871C4: @ 80871C4 - push {lr} - ldr r1, =0x03000e10 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x83 - beq _080871D4 - bl sub_8086C64 -_080871D4: - movs r0, 0x83 - bl sub_8086CA8 - cmp r0, 0x1 - bne _080871EA - ldr r0, =gUnknown_08277513 - bl script_env_1_execute_new_script - ldr r0, =sub_80871C0 - bl c1_link_related_func_set -_080871EA: - movs r0, 0x11 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80871C4 - - thumb_func_start sub_80871FC -sub_80871FC: @ 80871FC - push {lr} - ldr r0, =sub_80871C4 - bl c1_link_related_func_set - movs r0, 0x17 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80871FC - - thumb_func_start sub_8087210 -sub_8087210: @ 8087210 - movs r0, 0x11 - bx lr - thumb_func_end sub_8087210 - - thumb_func_start sub_8087214 -sub_8087214: @ 8087214 - push {lr} - movs r0, 0x83 - bl sub_8086CE0 - cmp r0, 0x1 - beq _08087250 - ldr r0, =0x03000e14 - ldr r2, [r0] - ldr r1, =sub_8087170 - adds r3, r0, 0 - cmp r2, r1 - bne _0808723A - ldr r1, =0x03000e10 - ldr r0, =0x03005db4 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x82 - bne _08087272 -_0808723A: - ldr r1, [r3] - ldr r0, =sub_8087164 - cmp r1, r0 - bne _08087268 - ldr r1, =0x03000e10 - ldr r0, =0x03005db4 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x81 - bne _08087268 -_08087250: - movs r0, 0x2 - b _08087278 - .pool -_08087268: - movs r0, 0x82 - bl sub_8086CA8 - cmp r0, 0 - bne _08087276 -_08087272: - movs r0, 0 - b _08087278 -_08087276: - movs r0, 0x1 -_08087278: - pop {r1} - bx r1 - thumb_func_end sub_8087214 - - thumb_func_start sub_808727C -sub_808727C: @ 808727C - push {lr} - movs r0, 0x83 - bl sub_8086CE0 - pop {r1} - bx r1 - thumb_func_end sub_808727C - - thumb_func_start sub_8087288 -sub_8087288: @ 8087288 - push {lr} - ldr r0, =sub_80871AC - bl c1_link_related_func_set - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8087288 - - thumb_func_start sub_808729C -sub_808729C: @ 808729C - push {lr} - ldr r0, =sub_80870F8 - bl c1_link_related_func_set - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_808729C - - thumb_func_start sub_80872B0 -sub_80872B0: @ 80872B0 - push {lr} - ldr r0, =sub_80871FC - bl c1_link_related_func_set - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80872B0 - - thumb_func_start sub_80872C4 -sub_80872C4: @ 80872C4 - push {lr} - ldr r0, =sub_8087210 - bl c1_link_related_func_set - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80872C4 - - thumb_func_start sub_80872D8 -sub_80872D8: @ 80872D8 - push {r4-r6,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r6, r2, 0 - strb r4, [r6] - movs r0, 0 - cmp r4, r1 - bne _080872EA - movs r0, 0x1 -_080872EA: - strb r0, [r6, 0x1] - ldr r1, =0x02032308 - lsls r0, r4, 2 - adds r0, r1 - ldrb r0, [r0, 0x3] - strb r0, [r6, 0x2] - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_80878A0 - strb r0, [r6, 0x3] - mov r5, sp - adds r5, 0x2 - adds r0, r4, 0 - mov r1, sp - adds r2, r5, 0 - bl sub_8087878 - mov r0, sp - ldrh r0, [r0] - strh r0, [r6, 0x4] - ldrh r0, [r5] - strh r0, [r6, 0x6] - adds r0, r4, 0 - bl sub_80878C0 - strb r0, [r6, 0x8] - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - strh r0, [r6, 0xC] - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80872D8 - - thumb_func_start sub_8087340 -sub_8087340: @ 8087340 - push {lr} - ldrb r0, [r0, 0x2] - cmp r0, 0x2 - beq _0808734C - cmp r0, 0 - bne _08087350 -_0808734C: - movs r0, 0x1 - b _08087352 -_08087350: - movs r0, 0 -_08087352: - pop {r1} - bx r1 - thumb_func_end sub_8087340 - - thumb_func_start sub_8087358 -sub_8087358: @ 8087358 - push {lr} - ldrb r0, [r0, 0x2] - cmp r0, 0x2 - beq _08087364 - cmp r0, 0 - bne _08087368 -_08087364: - movs r0, 0x1 - b _0808736A -_08087368: - movs r0, 0 -_0808736A: - pop {r1} - bx r1 - thumb_func_end sub_8087358 - - thumb_func_start sub_8087370 -sub_8087370: @ 8087370 - push {lr} - adds r1, r0, 0 - ldrb r0, [r1, 0x2] - cmp r0, 0x2 - bne _08087382 - adds r0, r1, 0x4 - bl sub_809D0F4 - b _08087384 -_08087382: - movs r0, 0 -_08087384: - pop {r1} - bx r1 - thumb_func_end sub_8087370 - - thumb_func_start sub_8087388 -sub_8087388: @ 8087388 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0x2] - cmp r0, 0x2 - beq _08087396 - cmp r0, 0 - bne _080873AC -_08087396: - ldrb r0, [r4, 0xC] - bl MetatileBehavior_IsSouthArrowWarp - lsls r0, 24 - cmp r0, 0 - beq _080873AC - ldrb r0, [r4, 0x3] - cmp r0, 0x1 - bne _080873AC - movs r0, 0x1 - b _080873AE -_080873AC: - movs r0, 0 -_080873AE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8087388 - - thumb_func_start sub_80873B4 -sub_80873B4: @ 80873B4 - push {r4,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldrb r0, [r4, 0x2] - cmp r0, 0 - beq _080873C8 - cmp r0, 0x2 - beq _080873C8 - movs r0, 0 - b _08087476 -_080873C8: - ldr r0, [r4, 0x4] - ldr r1, [r4, 0x8] - str r0, [sp] - str r1, [sp, 0x4] - ldr r3, =gUnknown_08339D64 - ldrb r0, [r4, 0x3] - lsls r0, 3 - adds r0, r3 - ldr r0, [r0] - mov r1, sp - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0xffff0000 - ldr r2, [sp] - ands r2, r1 - orrs r2, r0 - str r2, [sp] - asrs r1, r2, 16 - ldrb r0, [r4, 0x3] - lsls r0, 3 - adds r3, 0x4 - adds r0, r3 - ldr r0, [r0] - adds r0, r1 - lsls r0, 16 - ldr r1, =0x0000ffff - ands r1, r2 - orrs r1, r0 - str r1, [sp] - ldr r2, =0xffffff00 - ldr r0, [sp, 0x4] - ands r0, r2 - str r0, [sp, 0x4] - mov r0, sp - movs r2, 0 - ldrsh r0, [r0, r2] - asrs r1, 16 - bl sub_808790C - lsls r0, 24 - lsrs r1, r0, 24 - adds r2, r1, 0 - cmp r1, 0x4 - beq _0808746C - ldrb r0, [r4, 0x1] - cmp r0, 0 - beq _08087434 - ldr r0, =0x03000e10 - adds r0, r1, r0 - ldrb r0, [r0] - cmp r0, 0x80 - beq _08087450 -_08087434: - ldr r0, =gUnknown_0827749C - b _08087476 - .pool -_08087450: - adds r0, r2, 0 - bl sub_80B39D4 - cmp r0, 0 - bne _08087464 - ldr r0, =gUnknown_0827747E - b _08087476 - .pool -_08087464: - ldr r0, =gUnknown_0827748D - b _08087476 - .pool -_0808746C: - ldrb r1, [r4, 0xC] - ldrb r2, [r4, 0x3] - mov r0, sp - bl sub_809C2C8 -_08087476: - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80873B4 - - thumb_func_start sub_8087480 -sub_8087480: @ 8087480 - push {lr} - adds r1, r0, 0 - ldr r0, =gUnknown_08277388 - cmp r1, r0 - beq _080874C6 - ldr r0, =gUnknown_082773A3 - cmp r1, r0 - beq _08087508 - ldr r0, =gUnknown_082773BE - cmp r1, r0 - beq _080874C6 - ldr r0, =gUnknown_082773D9 - cmp r1, r0 - beq _08087508 - ldr r0, =gUnknown_0827741D - cmp r1, r0 - beq _080874C6 - ldr r0, =gUnknown_08277432 - cmp r1, r0 - beq _08087508 - ldr r0, =gUnknown_08277447 - cmp r1, r0 - beq _080874C6 - ldr r0, =gUnknown_0827745C - cmp r1, r0 - beq _08087508 - ldr r0, =gUnknown_08277374 - cmp r1, r0 - beq _080874C6 - ldr r0, =gUnknown_0827737E - cmp r1, r0 - beq _08087508 - ldr r0, =gUnknown_082773F5 - cmp r1, r0 - bne _080874F8 -_080874C6: - movs r0, 0xA - b _0808750A - .pool -_080874F8: - ldr r0, =gUnknown_082773FF - cmp r1, r0 - beq _08087508 - movs r0, 0 - b _0808750A - .pool -_08087508: - movs r0, 0x9 -_0808750A: - pop {r1} - bx r1 - thumb_func_end sub_8087480 - - thumb_func_start sub_8087510 -sub_8087510: @ 8087510 - push {lr} - bl script_env_2_enable - pop {r0} - bx r0 - thumb_func_end sub_8087510 - - thumb_func_start sub_808751C -sub_808751C: @ 808751C - push {lr} - movs r0, 0x6 - bl audio_play - bl sub_809FA9C - bl script_env_2_enable - pop {r0} - bx r0 - thumb_func_end sub_808751C - - thumb_func_start sub_8087530 -sub_8087530: @ 8087530 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x5 - bl audio_play - adds r0, r4, 0 - bl script_env_1_execute_new_script - bl script_env_2_enable - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8087530 - - thumb_func_start sub_808754C -sub_808754C: @ 808754C - push {lr} - movs r0, 0x6 - bl audio_play - ldr r0, =gUnknown_082774EF - bl script_env_1_execute_new_script - bl script_env_2_enable - pop {r0} - bx r0 - .pool - thumb_func_end sub_808754C - - thumb_func_start sub_8087568 -sub_8087568: @ 8087568 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x5 - bl audio_play - adds r0, r4, 0 - bl script_env_1_execute_new_script - bl script_env_2_enable - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8087568 - - thumb_func_start sub_8087584 -sub_8087584: @ 8087584 - push {lr} - ldr r0, =gUnknown_08277509 - bl script_env_1_execute_new_script - bl script_env_2_enable - pop {r0} - bx r0 - .pool - thumb_func_end sub_8087584 - - thumb_func_start sub_8087598 -sub_8087598: @ 8087598 - push {lr} - bl is_c1_link_related_active - cmp r0, 0 - bne _080875A6 - movs r0, 0 - b _080875C0 -_080875A6: - bl sub_800B4DC - cmp r0, 0x2 - bls _080875B8 - ldr r1, =0x03000e18 - movs r0, 0x1 - b _080875BC - .pool -_080875B8: - ldr r1, =0x03000e18 - movs r0, 0 -_080875BC: - strb r0, [r1] - ldrb r0, [r1] -_080875C0: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8087598 - - thumb_func_start sub_80875C8 -sub_80875C8: @ 80875C8 - push {lr} - bl sub_800B4DC - cmp r0, 0x1 - bls _0808762C - bl is_c1_link_related_active - cmp r0, 0x1 - bne _0808762C - bl sub_8009F3C - cmp r0, 0x1 - bne _0808762C - ldr r0, =0x03000e14 - ldr r1, [r0] - ldr r0, =sub_808711C - cmp r1, r0 - beq _08087614 - ldr r0, =sub_80870F8 - cmp r1, r0 - bne _0808762C - ldr r0, =0x03000e18 - ldrb r2, [r0] - movs r1, 0 - strb r1, [r0] - cmp r2, 0x1 - beq _08087614 - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0808762C - ldrb r1, [r2, 0xA] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0808762C -_08087614: - movs r0, 0x1 - b _0808762E - .pool -_0808762C: - movs r0, 0 -_0808762E: - pop {r1} - bx r1 - thumb_func_end sub_80875C8 - - thumb_func_start sub_8087634 -sub_8087634: @ 8087634 - push {lr} - bl sub_8087690 - cmp r0, 0x1 - bls _08087658 - bl is_c1_link_related_active - cmp r0, 0x1 - bne _08087658 - bl sub_8009F3C - cmp r0, 0x1 - bne _08087658 - ldr r0, =0x03000e14 - ldr r1, [r0] - ldr r0, =sub_8087140 - cmp r1, r0 - beq _08087664 -_08087658: - movs r0, 0 - b _08087666 - .pool -_08087664: - movs r0, 0x1 -_08087666: - pop {r1} - bx r1 - thumb_func_end sub_8087634 - - thumb_func_start sub_808766C -sub_808766C: @ 808766C - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _08087688 - bl sub_8009F3C - cmp r0, 0 - beq _08087688 - movs r0, 0x1 - b _0808768A - .pool -_08087688: - movs r0, 0 -_0808768A: - pop {r1} - bx r1 - thumb_func_end sub_808766C - - thumb_func_start sub_8087690 -sub_8087690: @ 8087690 - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _080876B0 - ldr r0, =0x03003170 - ldr r1, =0x00000339 - adds r0, r1 - ldrb r0, [r0] - b _080876B8 - .pool -_080876B0: - ldr r0, =0x03005000 - ldr r1, =0x00000c1a - adds r0, r1 - ldrb r0, [r0] -_080876B8: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8087690 - - thumb_func_start sub_80876C4 -sub_80876C4: @ 80876C4 - movs r1, 0 - str r1, [r0] - bx lr - thumb_func_end sub_80876C4 - - thumb_func_start strange_npc_table_clear -strange_npc_table_clear: @ 80876CC - push {lr} - ldr r0, =0x02032308 - movs r1, 0 - movs r2, 0x10 - bl memset - pop {r0} - bx r0 - .pool - thumb_func_end strange_npc_table_clear - - thumb_func_start sub_80876E0 -sub_80876E0: @ 80876E0 - push {lr} - movs r1, 0 - movs r2, 0x24 - bl memset - pop {r0} - bx r0 - thumb_func_end sub_80876E0 - - thumb_func_start sub_80876F0 -sub_80876F0: @ 80876F0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r9, r1 - mov r10, r2 - mov r8, r3 - lsls r0, 24 - lsrs r7, r0, 24 - mov r0, r9 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - mov r1, r10 - lsls r1, 16 - lsrs r1, 16 - mov r10, r1 - mov r2, r8 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - bl sub_808D4F4 - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r4, r7, 2 - ldr r0, =0x02032308 - adds r4, r0 - lsls r5, r6, 3 - adds r5, r6 - lsls r5, 2 - ldr r0, =0x02037350 - adds r5, r0 - adds r0, r4, 0 - bl sub_80876C4 - adds r0, r5, 0 - bl sub_80876E0 - movs r2, 0 - movs r1, 0x1 - movs r0, 0x1 - strb r0, [r4] - strb r7, [r4, 0x1] - strb r6, [r4, 0x2] - strb r2, [r4, 0x3] - ldrb r0, [r5] - orrs r0, r1 - mov r2, r8 - ands r2, r1 - lsls r2, 1 - movs r1, 0x3 - negs r1, r1 - ands r0, r1 - orrs r0, r2 - strb r0, [r5] - movs r0, 0x2 - strb r0, [r5, 0x19] - movs r0, 0x40 - strb r0, [r5, 0x4] - mov r0, r9 - lsls r0, 16 - asrs r0, 16 - mov r9, r0 - mov r1, r10 - lsls r1, 16 - asrs r1, 16 - mov r10, r1 - adds r0, r5, 0 - mov r1, r9 - mov r2, r10 - bl sub_808779C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80876F0 - - thumb_func_start sub_808779C -sub_808779C: @ 808779C - push {r4,lr} - adds r4, r0, 0 - adds r0, r1, 0 - adds r1, r2, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - lsrs r1, 16 - strh r0, [r4, 0x10] - strh r1, [r4, 0x12] - strh r0, [r4, 0x14] - strh r1, [r4, 0x16] - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - adds r2, r4, 0 - adds r2, 0xC - adds r3, r4, 0 - adds r3, 0xE - bl sub_8093038 - ldrh r0, [r4, 0xC] - adds r0, 0x8 - strh r0, [r4, 0xC] - adds r0, r4, 0 - bl FieldObjectUpdateZCoord - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_808779C - - thumb_func_start sub_80877DC -sub_80877DC: @ 80877DC - push {lr} - lsls r0, 24 - lsls r1, 24 - lsrs r2, r1, 24 - ldr r1, =0x02032308 - lsrs r0, 22 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - beq _080877FE - ldrb r0, [r1, 0x2] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02037350 - adds r1, r0 - strb r2, [r1, 0x19] -_080877FE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80877DC - - thumb_func_start sub_808780C -sub_808780C: @ 808780C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 22 - ldr r1, =0x02032308 - adds r5, r0, r1 - ldrb r1, [r5, 0x2] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - ldrb r0, [r4, 0x4] - cmp r0, 0x40 - beq _08087838 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles -_08087838: - movs r0, 0 - strb r0, [r5] - ldrb r1, [r4] - subs r0, 0x2 - ands r0, r1 - strb r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808780C - - thumb_func_start sub_8087858 -sub_8087858: @ 8087858 - lsls r0, 24 - ldr r1, =0x02032308 - lsrs r0, 22 - adds r0, r1 - ldrb r1, [r0, 0x2] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldrb r0, [r0, 0x4] - bx lr - .pool - thumb_func_end sub_8087858 - - thumb_func_start sub_8087878 -sub_8087878: @ 8087878 - lsls r0, 24 - ldr r3, =0x02032308 - lsrs r0, 22 - adds r0, r3 - ldrb r3, [r0, 0x2] - lsls r0, r3, 3 - adds r0, r3 - lsls r0, 2 - ldr r3, =0x02037350 - adds r0, r3 - ldrh r3, [r0, 0x10] - strh r3, [r1] - ldrh r0, [r0, 0x12] - strh r0, [r2] - bx lr - .pool - thumb_func_end sub_8087878 - - thumb_func_start sub_80878A0 -sub_80878A0: @ 80878A0 - lsls r0, 24 - ldr r1, =0x02032308 - lsrs r0, 22 - adds r0, r1 - ldrb r1, [r0, 0x2] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldrb r0, [r0, 0x19] - bx lr - .pool - thumb_func_end sub_80878A0 - - thumb_func_start sub_80878C0 -sub_80878C0: @ 80878C0 - lsls r0, 24 - ldr r1, =0x02032308 - lsrs r0, 22 - adds r0, r1 - ldrb r1, [r0, 0x2] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldrb r0, [r0, 0xB] - lsls r0, 28 - lsrs r0, 28 - bx lr - .pool - thumb_func_end sub_80878C0 - - thumb_func_start sub_80878E4 -sub_80878E4: @ 80878E4 - lsls r0, 24 - ldr r1, =0x02032308 - lsrs r0, 22 - adds r0, r1 - ldrb r1, [r0, 0x2] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - adds r0, 0x21 - movs r1, 0 - ldrsb r1, [r0, r1] - movs r0, 0x10 - subs r0, r1 - bx lr - .pool - thumb_func_end sub_80878E4 - - thumb_func_start sub_808790C -sub_808790C: @ 808790C - push {r4-r6,lr} - movs r2, 0 - ldr r5, =0x02032308 - lsls r0, 16 - asrs r4, r0, 16 - lsls r1, 16 - asrs r3, r1, 16 -_0808791A: - lsls r0, r2, 2 - adds r1, r0, r5 - ldrb r0, [r1] - cmp r0, 0 - beq _08087958 - ldrb r0, [r1, 0x3] - cmp r0, 0 - beq _0808792E - cmp r0, 0x2 - bne _08087958 -_0808792E: - ldrb r1, [r1, 0x2] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r1, r0, r1 - movs r6, 0x10 - ldrsh r0, [r1, r6] - cmp r0, r4 - bne _08087958 - movs r6, 0x12 - ldrsh r0, [r1, r6] - cmp r0, r3 - bne _08087958 - adds r0, r2, 0 - b _08087964 - .pool -_08087958: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _0808791A - movs r0, 0x4 -_08087964: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_808790C - - thumb_func_start sub_808796C -sub_808796C: @ 808796C - push {r4-r6,lr} - lsls r0, 24 - lsls r1, 24 - lsrs r3, r1, 24 - adds r2, r3, 0 - lsrs r0, 22 - ldr r1, =0x02032308 - adds r5, r0, r1 - ldrb r1, [r5, 0x2] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r6, r0, r1 - ldrb r0, [r5] - cmp r0, 0 - beq _080879C8 - cmp r3, 0xA - bls _080879A4 - ldrb r0, [r6] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r6] - b _080879C8 - .pool -_080879A4: - ldr r4, =gUnknown_08339E00 - ldr r1, =gUnknown_08339DC8 - ldrb r0, [r5, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r3, [r0] - adds r0, r5, 0 - adds r1, r6, 0 - bl _call_via_r3 - lsls r0, 24 - lsrs r0, 22 - adds r0, r4 - ldr r2, [r0] - adds r0, r5, 0 - adds r1, r6, 0 - bl _call_via_r2 -_080879C8: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808796C - - thumb_func_start sub_80879D8 -sub_80879D8: @ 80879D8 - push {r4,lr} - lsls r2, 24 - lsrs r2, 24 - ldr r4, =gUnknown_08339DD4 - lsls r3, r2, 2 - adds r3, r4 - ldr r3, [r3] - bl _call_via_r3 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80879D8 - - thumb_func_start sub_80879F8 -sub_80879F8: @ 80879F8 - movs r0, 0x1 - bx lr - thumb_func_end sub_80879F8 - - thumb_func_start sub_80879FC -sub_80879FC: @ 80879FC - push {r4,lr} - lsls r2, 24 - lsrs r2, 24 - ldr r4, =gUnknown_08339DD4 - lsls r3, r2, 2 - adds r3, r4 - ldr r3, [r3] - bl _call_via_r3 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80879FC - - thumb_func_start sub_8087A1C -sub_8087A1C: @ 8087A1C - movs r0, 0 - bx lr - thumb_func_end sub_8087A1C - - thumb_func_start sub_8087A20 -sub_8087A20: @ 8087A20 - push {r4-r6,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - lsls r0, r2, 24 - lsrs r0, 24 - ldrb r1, [r5, 0x19] - bl npc_something3 - strb r0, [r5, 0x19] - ldrb r1, [r5, 0x19] - mov r6, sp - adds r6, 0x2 - adds r0, r5, 0 - mov r2, sp - adds r3, r6, 0 - bl FieldObjectMoveDestCoords - ldrb r0, [r4, 0x2] - ldrb r1, [r5, 0x19] - mov r2, sp - movs r3, 0 - ldrsh r2, [r2, r3] - movs r4, 0 - ldrsh r3, [r6, r4] - bl npc_080587EC - lsls r0, 24 - cmp r0, 0 - bne _08087A7E - adds r1, r5, 0 - adds r1, 0x21 - movs r0, 0x10 - strb r0, [r1] - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r3, 0 - ldrsh r2, [r6, r3] - adds r0, r5, 0 - bl npc_coords_shift - adds r0, r5, 0 - bl FieldObjectUpdateZCoord - movs r0, 0x1 - b _08087A80 -_08087A7E: - movs r0, 0 -_08087A80: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8087A20 - - thumb_func_start sub_8087A88 -sub_8087A88: @ 8087A88 - push {r4,lr} - adds r4, r1, 0 - lsls r0, r2, 24 - lsrs r0, 24 - ldrb r1, [r4, 0x19] - bl npc_something3 - strb r0, [r4, 0x19] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8087A88 - - thumb_func_start sub_8087AA0 -sub_8087AA0: @ 8087AA0 - movs r1, 0 - strb r1, [r0, 0x3] - bx lr - thumb_func_end sub_8087AA0 - - thumb_func_start sub_8087AA8 -sub_8087AA8: @ 8087AA8 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - adds r5, r4, 0 - adds r5, 0x21 - ldrb r0, [r5] - subs r0, 0x1 - strb r0, [r5] - movs r0, 0x1 - strb r0, [r6, 0x3] - ldrb r0, [r4, 0x19] - adds r1, 0xC - adds r2, r4, 0 - adds r2, 0xE - bl MoveCoords - ldrb r0, [r5] - cmp r0, 0 - bne _08087AD8 - adds r0, r4, 0 - bl npc_coords_shift_still - movs r0, 0x2 - strb r0, [r6, 0x3] -_08087AD8: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8087AA8 - - thumb_func_start npc_something3 -npc_something3: @ 8087AE0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r2, r1, 24 - subs r0, 0x1 - cmp r0, 0x9 - bhi _08087B38 - lsls r0, 2 - ldr r1, =_08087B00 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08087B00: - .4byte _08087B28 - .4byte _08087B2C - .4byte _08087B30 - .4byte _08087B34 - .4byte _08087B38 - .4byte _08087B38 - .4byte _08087B28 - .4byte _08087B2C - .4byte _08087B30 - .4byte _08087B34 -_08087B28: - movs r0, 0x2 - b _08087B3A -_08087B2C: - movs r0, 0x1 - b _08087B3A -_08087B30: - movs r0, 0x3 - b _08087B3A -_08087B34: - movs r0, 0x4 - b _08087B3A -_08087B38: - adds r0, r2, 0 -_08087B3A: - pop {r1} - bx r1 - thumb_func_end npc_something3 - - thumb_func_start npc_080587EC -npc_080587EC: @ 8087B40 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r2, 16 - lsrs r2, 16 - mov r12, r2 - lsls r3, 16 - movs r4, 0 - ldr r0, =0x02037350 - mov r9, r0 - lsrs r2, r3, 16 - mov r10, r2 - asrs r6, r3, 16 -_08087B64: - mov r7, r12 - lsls r3, r7, 16 - mov r0, r10 - lsls r5, r0, 16 - cmp r4, r8 - beq _08087BA8 - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - mov r2, r9 - adds r1, r0, r2 - movs r7, 0x10 - ldrsh r0, [r1, r7] - asrs r2, r3, 16 - cmp r0, r2 - bne _08087B8C - movs r7, 0x12 - ldrsh r0, [r1, r7] - cmp r0, r6 - beq _08087B9E -_08087B8C: - movs r7, 0x14 - ldrsh r0, [r1, r7] - cmp r0, r2 - bne _08087BA8 - movs r0, 0x16 - ldrsh r1, [r1, r0] - asrs r0, r5, 16 - cmp r1, r0 - bne _08087BA8 -_08087B9E: - movs r0, 0x1 - b _08087BBE - .pool -_08087BA8: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _08087B64 - asrs r0, r3, 16 - asrs r1, r5, 16 - bl MapGridIsImpassableAt - lsls r0, 24 - lsrs r0, 24 -_08087BBE: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end npc_080587EC - - thumb_func_start sub_8087BCC -sub_8087BCC: @ 8087BCC - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r3, r1, 24 - lsls r2, r5, 2 - ldr r0, =0x02032308 - adds r2, r0 - ldrb r1, [r2, 0x2] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - ldrb r0, [r2] - cmp r0, 0 - beq _08087C7A - subs r0, r3, 0x1 - cmp r0, 0x4 - bhi _08087C56 - lsls r0, 2 - ldr r1, =_08087C0C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08087C0C: - .4byte _08087C2C - .4byte _08087C2C - .4byte _08087C38 - .4byte _08087C20 - .4byte _08087C20 -_08087C20: - ldrb r0, [r4] - lsls r0, 30 - lsrs r0, 31 - bl sub_808BD6C - b _08087C44 -_08087C2C: - ldrb r0, [r4] - lsls r0, 30 - lsrs r0, 31 - bl sub_808BD7C - b _08087C44 -_08087C38: - ldrb r1, [r4] - lsls r1, 30 - lsrs r1, 31 - movs r0, 0 - bl sub_808BD3C -_08087C44: - lsls r0, 24 - lsrs r0, 24 - ldr r1, =sub_8087C8C - movs r2, 0 - str r2, [sp] - movs r3, 0 - bl AddPseudoFieldObject - strb r0, [r4, 0x4] -_08087C56: - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - adds r3, r0, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r3] - strh r5, [r0, 0x2E] - ldrb r1, [r4] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r4] -_08087C7A: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8087BCC - - thumb_func_start sub_8087C8C -sub_8087C8C: @ 8087C8C - push {r4-r6,lr} - adds r5, r0, 0 - movs r0, 0x2E - ldrsh r4, [r5, r0] - lsls r4, 2 - ldr r0, =0x02032308 - adds r4, r0 - ldrb r1, [r4, 0x2] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r6, r0, r1 - ldrh r0, [r6, 0xC] - strh r0, [r5, 0x20] - ldrh r0, [r6, 0xE] - strh r0, [r5, 0x22] - ldrb r0, [r6, 0xB] - lsrs r0, 4 - adds r1, r5, 0 - movs r2, 0x1 - bl SetObjectSubpriorityByZCoord - ldrb r0, [r6, 0xB] - lsrs r0, 4 - bl ZCoordToPriority - movs r1, 0x3 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r5, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - ldrb r0, [r4, 0x3] - cmp r0, 0 - bne _08087CF8 - ldrb r0, [r6, 0x19] - bl FieldObjectDirectionToImageAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl StartObjectImageAnim - b _08087D0A - .pool -_08087CF8: - ldrb r0, [r6, 0x19] - bl get_go_image_anim_num - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl StartObjectImageAnimIfDifferent -_08087D0A: - adds r0, r5, 0 - movs r1, 0 - bl sub_80979D4 - ldrb r0, [r6] - lsls r0, 29 - cmp r0, 0 - bge _08087D3C - ldrh r0, [r5, 0x3C] - movs r1, 0x4 - ands r1, r0 - lsls r1, 16 - adds r3, r5, 0 - adds r3, 0x3E - lsrs r1, 18 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - ldrh r0, [r5, 0x3C] - adds r0, 0x1 - strh r0, [r5, 0x3C] -_08087D3C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8087C8C - - thumb_func_start mapconnection_get_mapheader -mapconnection_get_mapheader: @ 8087D44 - push {lr} - ldrb r2, [r0, 0x8] - ldrb r1, [r0, 0x9] - adds r0, r2, 0 - bl get_mapheader_by_bank_and_number - pop {r1} - bx r1 - thumb_func_end mapconnection_get_mapheader - - thumb_func_start not_trainer_hill_battle_pyramid -not_trainer_hill_battle_pyramid: @ 8087D54 - push {r4,lr} - ldr r4, =0x02037318 - adds r0, r4, 0 - bl mapheader_copy_mapdata_with_padding - ldr r0, [r4, 0x4] - bl sub_80E8EE0 - bl mapheader_run_script_with_tag_x1 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end not_trainer_hill_battle_pyramid - - thumb_func_start sub_8087D74 -sub_8087D74: @ 8087D74 - push {r4,lr} - ldr r4, =0x02037318 - adds r0, r4, 0 - bl mapheader_copy_mapdata_with_padding - movs r0, 0 - bl sub_80E9238 - ldr r0, [r4, 0x4] - bl sub_80E8EE0 - bl mapdata_from_sav2 - bl mapheader_run_script_with_tag_x1 - ldr r1, =0x03005dc0 - ldr r0, [r1] - ldr r1, [r1, 0x4] - bl UpdateTVScreensOnMap - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8087D74 - - thumb_func_start battle_pyramid_map_load_related -battle_pyramid_map_load_related: @ 8087DAC - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x03ff03ff - str r0, [sp] - ldr r5, =0x02032318 - ldr r2, =0x01001400 - mov r0, sp - adds r1, r5, 0 - bl CpuFastSet - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_81AA078 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end battle_pyramid_map_load_related - - thumb_func_start trainer_hill_map_load_related -trainer_hill_map_load_related: @ 8087DE4 - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x03ff03ff - str r0, [sp] - ldr r4, =0x02032318 - ldr r2, =0x01001400 - mov r0, sp - adds r1, r4, 0 - bl CpuFastSet - adds r0, r4, 0 - bl sub_81D5FB4 - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end trainer_hill_map_load_related - - thumb_func_start mapheader_copy_mapdata_with_padding -@ void mapheader_copy_mapdata_with_padding(struct mapheader *mapHeader) -mapheader_copy_mapdata_with_padding: @ 8087E14 - push {r4-r6,lr} - sub sp, 0x4 - adds r6, r0, 0 - ldr r5, [r6] - ldr r0, =0x03ff03ff - str r0, [sp] - ldr r4, =0x02032318 - ldr r2, =0x01001400 - mov r0, sp - adds r1, r4, 0 - bl CpuFastSet - ldr r2, =0x03005dc0 - str r4, [r2, 0x8] - ldr r1, [r5] - adds r1, 0xF - str r1, [r2] - ldr r0, [r5, 0x4] - adds r0, 0xE - str r0, [r2, 0x4] - muls r1, r0 - movs r0, 0xA0 - lsls r0, 6 - cmp r1, r0 - bgt _08087E56 - ldr r0, [r5, 0xC] - ldrh r1, [r5] - ldrh r2, [r5, 0x4] - bl map_copy_with_padding - adds r0, r6, 0 - bl mapheader_copy_mapdata_of_adjacent_maps -_08087E56: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end mapheader_copy_mapdata_with_padding - - thumb_func_start map_copy_with_padding -@ int map_copy_with_padding(void *src) -map_copy_with_padding: @ 8087E70 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r0, 0 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - lsls r2, 16 - lsrs r2, 16 - ldr r0, =0x03005dc0 - ldr r4, [r0, 0x8] - ldr r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 1 - adds r0, 0xE - adds r4, r0 - cmp r2, 0 - beq _08087EB8 - mov r0, r8 - lsls r6, r0, 1 - adds r5, r2, 0 - movs r0, 0x1E - adds r0, r6 - mov r9, r0 -_08087EA4: - adds r0, r7, 0 - adds r1, r4, 0 - mov r2, r8 - bl CpuSet - add r4, r9 - adds r7, r6 - subs r5, 0x1 - cmp r5, 0 - bne _08087EA4 -_08087EB8: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end map_copy_with_padding - - thumb_func_start mapheader_copy_mapdata_of_adjacent_maps -@ void mapheader_copy_mapdata_of_adjacent_maps(struct mapheader *mapHeader) -mapheader_copy_mapdata_of_adjacent_maps: @ 8087EC8 - push {r4-r7,lr} - adds r6, r0, 0 - ldr r0, [r6, 0xC] - cmp r0, 0 - beq _08087F4C - ldr r1, [r0] - ldr r5, [r0, 0x4] - ldr r2, =0x02037340 - ldr r0, =gUnknown_08486EF8 - ldr r0, [r0] - str r0, [r2] - cmp r1, 0 - ble _08087F4C - adds r4, r2, 0 - adds r7, r1, 0 -_08087EE6: - adds r0, r5, 0 - bl mapconnection_get_mapheader - adds r1, r0, 0 - ldr r2, [r5, 0x4] - ldrb r0, [r5] - cmp r0, 0x2 - beq _08087F1E - cmp r0, 0x2 - bgt _08087F08 - cmp r0, 0x1 - beq _08087F12 - b _08087F44 - .pool -_08087F08: - cmp r0, 0x3 - beq _08087F2A - cmp r0, 0x4 - beq _08087F36 - b _08087F44 -_08087F12: - adds r0, r6, 0 - bl sub_8087FB8 - ldrb r0, [r4] - movs r1, 0x1 - b _08087F40 -_08087F1E: - adds r0, r6, 0 - bl sub_8088020 - ldrb r0, [r4] - movs r1, 0x2 - b _08087F40 -_08087F2A: - adds r0, r6, 0 - bl sub_8088080 - ldrb r0, [r4] - movs r1, 0x4 - b _08087F40 -_08087F36: - adds r0, r6, 0 - bl sub_80880E0 - ldrb r0, [r4] - movs r1, 0x8 -_08087F40: - orrs r0, r1 - strb r0, [r4] -_08087F44: - subs r7, 0x1 - adds r5, 0xC - cmp r7, 0 - bne _08087EE6 -_08087F4C: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end mapheader_copy_mapdata_of_adjacent_maps - - thumb_func_start sub_8087F54 -sub_8087F54: @ 8087F54 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r5, [sp, 0x18] - ldr r4, [r2] - ldr r7, [r4] - adds r2, r7, 0 - muls r2, r5 - adds r2, r3 - lsls r2, 1 - ldr r3, [r4, 0xC] - adds r6, r3, r2 - ldr r3, =0x03005dc0 - ldr r2, [r3] - muls r1, r2 - adds r1, r0 - lsls r1, 1 - ldr r0, [r3, 0x8] - adds r5, r0, r1 - ldr r0, [sp, 0x20] - cmp r0, 0 - ble _08087FA6 - adds r4, r0, 0 - ldr r3, =0x001fffff - mov r8, r3 -_08087F86: - adds r0, r6, 0 - adds r1, r5, 0 - ldr r2, [sp, 0x1C] - mov r3, r8 - ands r2, r3 - bl CpuSet - ldr r0, =0x03005dc0 - ldr r0, [r0] - lsls r0, 1 - adds r5, r0 - lsls r0, r7, 1 - adds r6, r0 - subs r4, 0x1 - cmp r4, 0 - bne _08087F86 -_08087FA6: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8087F54 - - thumb_func_start sub_8087FB8 -sub_8087FB8: @ 8087FB8 - push {r4-r7,lr} - sub sp, 0xC - adds r3, r0, 0 - adds r5, r1, 0 - cmp r5, 0 - beq _08088012 - ldr r0, [r5] - ldr r4, [r0] - adds r2, 0x7 - ldr r0, [r3] - ldr r0, [r0, 0x4] - adds r7, r0, 0x7 - cmp r2, 0 - bge _08087FEC - negs r6, r2 - adds r2, r4 - ldr r0, =0x03005dc0 - ldr r3, [r0] - cmp r2, r3 - bge _08087FE2 - adds r3, r2, 0 -_08087FE2: - movs r2, 0 - b _08087FFC - .pool -_08087FEC: - movs r6, 0 - adds r0, r2, r4 - ldr r1, =0x03005dc0 - ldr r1, [r1] - subs r3, r1, r2 - cmp r0, r1 - bge _08087FFC - adds r3, r4, 0 -_08087FFC: - movs r0, 0 - str r0, [sp] - str r3, [sp, 0x4] - movs r0, 0x7 - str r0, [sp, 0x8] - adds r0, r2, 0 - adds r1, r7, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl sub_8087F54 -_08088012: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8087FB8 - - thumb_func_start sub_8088020 -sub_8088020: @ 8088020 - push {r4-r7,lr} - sub sp, 0xC - adds r5, r1, 0 - cmp r5, 0 - beq _08088074 - ldr r0, [r5] - ldr r4, [r0] - ldr r0, [r0, 0x4] - adds r2, 0x7 - subs r7, r0, 0x7 - cmp r2, 0 - bge _08088050 - negs r6, r2 - adds r2, r4 - ldr r0, =0x03005dc0 - ldr r3, [r0] - cmp r2, r3 - bge _08088046 - adds r3, r2, 0 -_08088046: - movs r2, 0 - b _08088060 - .pool -_08088050: - movs r6, 0 - adds r0, r2, r4 - ldr r1, =0x03005dc0 - ldr r1, [r1] - subs r3, r1, r2 - cmp r0, r1 - bge _08088060 - adds r3, r4, 0 -_08088060: - str r7, [sp] - str r3, [sp, 0x4] - movs r0, 0x7 - str r0, [sp, 0x8] - adds r0, r2, 0 - movs r1, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl sub_8087F54 -_08088074: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8088020 - - thumb_func_start sub_8088080 -sub_8088080: @ 8088080 - push {r4-r7,lr} - sub sp, 0xC - adds r5, r1, 0 - cmp r5, 0 - beq _080880D4 - ldr r0, [r5] - ldr r1, [r0] - ldr r4, [r0, 0x4] - adds r2, 0x7 - subs r7, r1, 0x7 - cmp r2, 0 - bge _080880B0 - negs r6, r2 - adds r1, r2, r4 - ldr r0, =0x03005dc0 - ldr r3, [r0, 0x4] - cmp r1, r3 - bge _080880A6 - adds r3, r1, 0 -_080880A6: - movs r2, 0 - b _080880C0 - .pool -_080880B0: - movs r6, 0 - adds r0, r2, r4 - ldr r1, =0x03005dc0 - ldr r1, [r1, 0x4] - subs r3, r1, r2 - cmp r0, r1 - bge _080880C0 - adds r3, r4, 0 -_080880C0: - str r6, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - str r3, [sp, 0x8] - movs r0, 0 - adds r1, r2, 0 - adds r2, r5, 0 - adds r3, r7, 0 - bl sub_8087F54 -_080880D4: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8088080 - - thumb_func_start sub_80880E0 -sub_80880E0: @ 80880E0 - push {r4-r7,lr} - sub sp, 0xC - adds r3, r0, 0 - adds r5, r1, 0 - cmp r5, 0 - beq _08088138 - ldr r0, [r5] - ldr r4, [r0, 0x4] - ldr r0, [r3] - ldr r0, [r0] - adds r7, r0, 0x7 - adds r2, 0x7 - cmp r2, 0 - bge _08088114 - negs r6, r2 - adds r1, r2, r4 - ldr r0, =0x03005dc0 - ldr r3, [r0, 0x4] - cmp r1, r3 - bge _0808810A - adds r3, r1, 0 -_0808810A: - movs r2, 0 - b _08088124 - .pool -_08088114: - movs r6, 0 - adds r0, r2, r4 - ldr r1, =0x03005dc0 - ldr r1, [r1, 0x4] - subs r3, r1, r2 - cmp r0, r1 - bge _08088124 - adds r3, r4, 0 -_08088124: - str r6, [sp] - movs r0, 0x8 - str r0, [sp, 0x4] - str r3, [sp, 0x8] - adds r0, r7, 0 - adds r1, r2, 0 - adds r2, r5, 0 - movs r3, 0 - bl sub_8087F54 -_08088138: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80880E0 - - thumb_func_start MapGridGetZCoordAt -@ u8 MapGridGetZCoordAt(s32 x, s32 y) -MapGridGetZCoordAt: @ 8088144 - push {r4,lr} - adds r2, r0, 0 - adds r4, r1, 0 - cmp r2, 0 - blt _08088174 - ldr r1, =0x03005dc0 - ldr r3, [r1] - cmp r2, r3 - bge _08088174 - cmp r4, 0 - blt _08088174 - ldr r0, [r1, 0x4] - cmp r4, r0 - bge _08088174 - adds r0, r3, 0 - muls r0, r4 - adds r0, r2, r0 - ldr r1, [r1, 0x8] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - b _08088196 - .pool -_08088174: - ldr r0, =0x02037318 - ldr r3, [r0] - adds r1, r2, 0x1 - movs r2, 0x1 - ands r1, r2 - adds r0, r4, 0x1 - ands r0, r2 - lsls r0, 1 - adds r1, r0 - ldr r0, [r3, 0x8] - lsls r1, 1 - adds r1, r0 - ldrh r1, [r1] - movs r2, 0xC0 - lsls r2, 4 - adds r0, r2, 0 - orrs r1, r0 -_08088196: - ldr r0, =0x000003ff - cmp r1, r0 - beq _080881A8 - lsrs r0, r1, 12 - b _080881AA - .pool -_080881A8: - movs r0, 0 -_080881AA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end MapGridGetZCoordAt - - thumb_func_start MapGridIsImpassableAt -@ u8 MapGridIsImpassableAt(s32 x, s32 y) -MapGridIsImpassableAt: @ 80881B0 - push {r4,lr} - adds r2, r0, 0 - adds r4, r1, 0 - cmp r2, 0 - blt _080881E0 - ldr r1, =0x03005dc0 - ldr r3, [r1] - cmp r2, r3 - bge _080881E0 - cmp r4, 0 - blt _080881E0 - ldr r0, [r1, 0x4] - cmp r4, r0 - bge _080881E0 - adds r0, r3, 0 - muls r0, r4 - adds r0, r2, r0 - ldr r1, [r1, 0x8] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - b _08088202 - .pool -_080881E0: - ldr r0, =0x02037318 - ldr r3, [r0] - adds r1, r2, 0x1 - movs r2, 0x1 - ands r1, r2 - adds r0, r4, 0x1 - ands r0, r2 - lsls r0, 1 - adds r1, r0 - ldr r0, [r3, 0x8] - lsls r1, 1 - adds r1, r0 - ldrh r1, [r1] - movs r2, 0xC0 - lsls r2, 4 - adds r0, r2, 0 - orrs r1, r0 -_08088202: - ldr r0, =0x000003ff - cmp r1, r0 - beq _0808821C - movs r0, 0xC0 - lsls r0, 4 - ands r1, r0 - lsrs r0, r1, 10 - b _0808821E - .pool -_0808821C: - movs r0, 0x1 -_0808821E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end MapGridIsImpassableAt - - thumb_func_start MapGridGetMetatileIdAt -@ u16 MapGridGetMetatileIdAt(s32 x, s32 y) -MapGridGetMetatileIdAt: @ 8088224 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - cmp r5, 0 - blt _08088254 - ldr r1, =0x03005dc0 - ldr r2, [r1] - cmp r5, r2 - bge _08088254 - cmp r6, 0 - blt _08088254 - ldr r0, [r1, 0x4] - cmp r6, r0 - bge _08088254 - adds r0, r2, 0 - muls r0, r6 - adds r0, r5, r0 - ldr r1, [r1, 0x8] - lsls r0, 1 - adds r0, r1 - ldrh r4, [r0] - b _08088278 - .pool -_08088254: - ldr r0, =0x02037318 - ldr r3, [r0] - adds r1, r5, 0x1 - movs r2, 0x1 - ands r1, r2 - adds r0, r6, 0x1 - ands r0, r2 - lsls r0, 1 - adds r1, r0 - ldr r0, [r3, 0x8] - lsls r1, 1 - adds r1, r0 - ldrh r1, [r1] - movs r2, 0xC0 - lsls r2, 4 - adds r0, r2, 0 - adds r4, r0, 0 - orrs r4, r1 -_08088278: - ldr r0, =0x000003ff - cmp r4, r0 - beq _0808828C - ands r4, r0 - adds r0, r4, 0 - b _080882B0 - .pool -_0808828C: - ldr r0, =0x02037318 - ldr r3, [r0] - adds r1, r5, 0x1 - movs r2, 0x1 - ands r1, r2 - adds r0, r6, 0x1 - ands r0, r2 - lsls r0, 1 - adds r1, r0 - ldr r0, [r3, 0x8] - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - movs r2, 0xC0 - lsls r2, 4 - adds r1, r2, 0 - orrs r0, r1 - ands r0, r4 -_080882B0: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end MapGridGetMetatileIdAt - - thumb_func_start MapGridGetMetatileBehaviorAt -@ u8 MapGridGetMetatileBehaviorAt(s32 x, s32 y) -MapGridGetMetatileBehaviorAt: @ 80882BC - push {lr} - bl MapGridGetMetatileIdAt - lsls r0, 16 - lsrs r0, 16 - bl GetBehaviorByMetatileId - adds r1, r0, 0 - movs r0, 0xFF - ands r0, r1 - pop {r1} - bx r1 - thumb_func_end MapGridGetMetatileBehaviorAt - - thumb_func_start MapGridGetMetatileLayerTypeAt -@ u8 MapGridGetMetatileLayerTypeAt(s32 x, s32 y) -MapGridGetMetatileLayerTypeAt: @ 80882D4 - push {lr} - bl MapGridGetMetatileIdAt - lsls r0, 16 - lsrs r0, 16 - bl GetBehaviorByMetatileId - adds r1, r0, 0 - movs r0, 0xF0 - lsls r0, 8 - ands r0, r1 - lsrs r0, 12 - pop {r1} - bx r1 - thumb_func_end MapGridGetMetatileLayerTypeAt - - thumb_func_start MapGridSetMetatileIdAt -@ void MapGridSetMetatileIdAt(s32 x, s32 y, u16 metatileId) -MapGridSetMetatileIdAt: @ 80882F0 - push {r4,r5,lr} - adds r3, r0, 0 - lsls r2, 16 - lsrs r5, r2, 16 - cmp r3, 0 - blt _08088328 - ldr r2, =0x03005dc0 - ldr r4, [r2] - cmp r3, r4 - bge _08088328 - cmp r1, 0 - blt _08088328 - ldr r0, [r2, 0x4] - cmp r1, r0 - bge _08088328 - muls r1, r4 - adds r1, r3, r1 - ldr r0, [r2, 0x8] - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - movs r2, 0xF0 - lsls r2, 8 - ands r2, r0 - ldr r0, =0x00000fff - ands r0, r5 - orrs r2, r0 - strh r2, [r1] -_08088328: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end MapGridSetMetatileIdAt - - thumb_func_start MapGridSetMetatileEntryAt -@ void MapGridSetMetatileEntryAt(s32 x, s32 y, u16 metatileEntry) -MapGridSetMetatileEntryAt: @ 8088338 - push {r4,r5,lr} - adds r3, r0, 0 - lsls r2, 16 - lsrs r5, r2, 16 - cmp r3, 0 - blt _08088364 - ldr r2, =0x03005dc0 - ldr r4, [r2] - cmp r3, r4 - bge _08088364 - cmp r1, 0 - blt _08088364 - ldr r0, [r2, 0x4] - cmp r1, r0 - bge _08088364 - adds r0, r4, 0 - muls r0, r1 - adds r0, r3, r0 - ldr r1, [r2, 0x8] - lsls r0, 1 - adds r0, r1 - strh r5, [r0] -_08088364: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end MapGridSetMetatileEntryAt - - thumb_func_start GetBehaviorByMetatileId -@ u16 GetBehaviorByMetatileId(u16 metatileId) -GetBehaviorByMetatileId: @ 8088370 - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - adds r3, r2, 0 - ldr r0, =0x000001ff - cmp r2, r0 - bhi _08088394 - ldr r0, =0x02037318 - ldr r0, [r0] - ldr r0, [r0, 0x10] - ldr r1, [r0, 0x10] - lsls r0, r2, 1 - b _080883B2 - .pool -_08088394: - ldr r0, =0x000003ff - cmp r2, r0 - bls _080883A4 - movs r0, 0xFF - b _080883B6 - .pool -_080883A4: - ldr r0, =0x02037318 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r1, [r0, 0x10] - lsls r0, r3, 1 - adds r0, r1 - ldr r1, =0xfffffc00 -_080883B2: - adds r0, r1 - ldrh r0, [r0] -_080883B6: - pop {r1} - bx r1 - .pool - thumb_func_end GetBehaviorByMetatileId - - thumb_func_start save_serialize_map -save_serialize_map: @ 80883C4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =0x03005d8c - ldr r1, [r0] - adds r4, r1, 0 - adds r4, 0x34 - ldr r0, =0x03005dc0 - ldr r0, [r0] - mov r8, r0 - movs r0, 0 - ldrsh r6, [r1, r0] - movs r2, 0x2 - ldrsh r0, [r1, r2] - adds r1, r0, 0 - adds r1, 0xE - cmp r0, r1 - bge _08088420 - mov r12, r1 - ldr r1, =0x02032318 - mov r9, r1 - lsls r7, r6, 1 -_080883F2: - adds r1, r6, 0 - adds r3, r1, 0 - adds r3, 0xF - adds r5, r0, 0x1 - cmp r1, r3 - bge _0808841A - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - lsls r0, 1 - add r0, r9 - adds r2, r7, r0 - subs r1, r3, r1 -_0808840C: - ldrh r0, [r2] - strh r0, [r4] - adds r4, 0x2 - adds r2, 0x2 - subs r1, 0x1 - cmp r1, 0 - bne _0808840C -_0808841A: - adds r0, r5, 0 - cmp r0, r12 - blt _080883F2 -_08088420: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end save_serialize_map - - thumb_func_start sub_8088438 -sub_8088438: @ 8088438 - push {r4,lr} - movs r2, 0 - movs r1, 0 - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r3, r0, 0 - adds r3, 0x34 - ldr r4, =0x000001ff -_08088448: - lsls r0, r1, 1 - adds r0, r3, r0 - ldrh r0, [r0] - orrs r2, r0 - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r4 - bls _08088448 - cmp r2, 0 - beq _0808846C - movs r0, 0 - b _0808846E - .pool -_0808846C: - movs r0, 0x1 -_0808846E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8088438 - - thumb_func_start sav2_mapdata_clear -sav2_mapdata_clear: @ 8088474 - push {lr} - sub sp, 0x4 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r0, =0x03005d8c - ldr r1, [r0] - adds r1, 0x34 - ldr r2, =0x01000100 - mov r0, sp - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sav2_mapdata_clear - - thumb_func_start mapdata_from_sav2 -mapdata_from_sav2: @ 808849C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - ldr r4, =0x03005d8c - ldr r0, [r4] - adds r7, r0, 0 - adds r7, 0x34 - bl sub_8088438 - cmp r0, 0 - bne _080885AC - ldr r0, =0x03005dc0 - ldr r0, [r0] - str r0, [sp] - ldr r0, [r4] - movs r2, 0 - ldrsh r1, [r0, r2] - mov r10, r1 - movs r2, 0x2 - ldrsh r1, [r0, r2] - mov r8, r1 - mov r6, r8 - adds r0, r6, 0 - adds r0, 0xE - cmp r6, r0 - bge _0808855A -_080884D6: - cmp r6, r8 - bne _080884EC - cmp r6, 0 - beq _080884EC - movs r0, 0 - mov r9, r0 - b _08088508 - .pool -_080884EC: - mov r0, r8 - adds r0, 0xD - movs r1, 0xFF - mov r9, r1 - cmp r6, r0 - bne _08088508 - ldr r0, =0x02037318 - ldr r0, [r0] - ldr r0, [r0, 0x4] - subs r0, 0x1 - cmp r6, r0 - beq _08088508 - movs r2, 0x1 - mov r9, r2 -_08088508: - mov r5, r10 - adds r0, r5, 0 - adds r0, 0xF - mov r1, r8 - adds r1, 0xE - str r1, [sp, 0x8] - adds r2, r6, 0x1 - str r2, [sp, 0x4] - cmp r5, r0 - bge _08088552 - ldr r0, [sp] - lsls r3, r0, 16 -_08088520: - ldr r1, [sp] - adds r0, r1, 0 - muls r0, r6 - adds r0, r5, r0 - lsls r0, 1 - ldr r1, =0x02032318 - adds r4, r0, r1 - adds r0, r4, 0 - lsrs r1, r3, 16 - mov r2, r9 - str r3, [sp, 0xC] - bl sub_8088BF0 - lsls r0, 24 - ldr r3, [sp, 0xC] - cmp r0, 0 - bne _08088546 - ldrh r0, [r7] - strh r0, [r4] -_08088546: - adds r7, 0x2 - adds r5, 0x1 - mov r0, r10 - adds r0, 0xF - cmp r5, r0 - blt _08088520 -_08088552: - ldr r6, [sp, 0x4] - ldr r2, [sp, 0x8] - cmp r6, r2 - blt _080884D6 -_0808855A: - mov r5, r10 - adds r0, r5, 0 - adds r0, 0xF - cmp r5, r0 - bge _080885A8 - mov r0, r8 - subs r0, 0x1 - lsls r0, 16 - mov r9, r0 - lsls r4, r5, 16 - mov r0, r8 - adds r0, 0xD - lsls r7, r0, 16 -_08088574: - mov r0, r8 - cmp r0, 0 - beq _08088584 - asrs r0, r4, 16 - mov r2, r9 - asrs r1, r2, 16 - bl sub_80D423C -_08088584: - ldr r0, =0x02037318 - ldr r0, [r0] - ldr r0, [r0, 0x4] - subs r0, 0x1 - cmp r6, r0 - bge _08088598 - asrs r0, r4, 16 - asrs r1, r7, 16 - bl sub_80D42B8 -_08088598: - movs r0, 0x80 - lsls r0, 9 - adds r4, r0 - adds r5, 0x1 - mov r0, r10 - adds r0, 0xF - cmp r5, r0 - blt _08088574 -_080885A8: - bl sav2_mapdata_clear -_080885AC: - 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 mapdata_from_sav2 - - thumb_func_start sub_80885C4 -sub_80885C4: @ 80885C4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r3, r0, 24 - adds r2, r3, 0 - ldr r0, =0x03005d8c - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x34 - str r0, [sp, 0x4] - ldr r0, =0x03005dc0 - ldr r0, [r0] - str r0, [sp] - movs r4, 0 - mov r9, r4 - mov r8, r4 - movs r0, 0 - ldrsh r6, [r1, r0] - str r6, [sp, 0x8] - movs r4, 0x2 - ldrsh r5, [r1, r4] - movs r7, 0xF - movs r6, 0xE - mov r12, r6 - cmp r3, 0x2 - beq _0808861E - cmp r3, 0x2 - bgt _08088614 - cmp r3, 0x1 - beq _08088626 - b _0808863E - .pool -_08088614: - cmp r2, 0x3 - beq _08088630 - cmp r2, 0x4 - beq _08088638 - b _0808863E -_0808861E: - adds r5, 0x1 - movs r0, 0xD - mov r12, r0 - b _0808863E -_08088626: - movs r1, 0x1 - mov r8, r1 - movs r3, 0xD - mov r12, r3 - b _0808863E -_08088630: - ldr r4, [sp, 0x8] - adds r4, 0x1 - str r4, [sp, 0x8] - b _0808863C -_08088638: - movs r6, 0x1 - mov r9, r6 -_0808863C: - movs r7, 0xE -_0808863E: - movs r1, 0 - cmp r1, r12 - bge _08088682 - ldr r0, =0x02032318 - mov r10, r0 -_08088648: - adds r4, r1, 0x1 - cmp r7, 0 - beq _0808867C - adds r0, r1, r5 - ldr r3, [sp] - adds r2, r3, 0 - muls r2, r0 - add r1, r8 - lsls r0, r1, 4 - subs r0, r1 - add r0, r9 - ldr r6, [sp, 0x8] - adds r2, r6, r2 - adds r3, r7, 0 - lsls r2, 1 - add r2, r10 - lsls r0, 1 - ldr r6, [sp, 0x4] - adds r1, r0, r6 -_0808866E: - ldrh r0, [r1] - strh r0, [r2] - adds r1, 0x2 - adds r2, 0x2 - subs r3, 0x1 - cmp r3, 0 - bne _0808866E -_0808867C: - adds r1, r4, 0 - cmp r1, r12 - blt _08088648 -_08088682: - bl sav2_mapdata_clear - 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_80885C4 - - thumb_func_start GetMapBorderIdAt -@ u32 GetMapBorderIdAt(s32 x, s32 y) -GetMapBorderIdAt: @ 808869C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - cmp r4, 0 - blt _080886D8 - ldr r1, =0x03005dc0 - ldr r2, [r1] - cmp r4, r2 - bge _080886D8 - cmp r5, 0 - blt _080886D8 - ldr r0, [r1, 0x4] - cmp r5, r0 - bge _080886D8 - adds r0, r2, 0 - muls r0, r5 - adds r0, r4, r0 - ldr r1, [r1, 0x8] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - ldr r0, =0x000003ff - cmp r1, r0 - beq _08088770 - b _08088700 - .pool -_080886D8: - ldr r0, =0x02037318 - ldr r3, [r0] - adds r1, r4, 0x1 - movs r2, 0x1 - ands r1, r2 - adds r0, r5, 0x1 - ands r0, r2 - lsls r0, 1 - adds r1, r0 - ldr r0, [r3, 0x8] - lsls r1, 1 - adds r1, r0 - ldrh r1, [r1] - movs r2, 0xC0 - lsls r2, 4 - adds r0, r2, 0 - orrs r0, r1 - ldr r1, =0x000003ff - cmp r0, r1 - beq _08088770 -_08088700: - ldr r1, =0x03005dc0 - ldr r0, [r1] - subs r0, 0x8 - cmp r4, r0 - blt _0808872C - ldr r0, =0x02037340 - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _08088770 - movs r0, 0x4 - b _08088782 - .pool -_0808872C: - cmp r4, 0x6 - bgt _08088744 - ldr r0, =0x02037340 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08088770 - movs r0, 0x3 - b _08088782 - .pool -_08088744: - ldr r0, [r1, 0x4] - subs r0, 0x7 - cmp r5, r0 - blt _08088760 - ldr r0, =0x02037340 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08088770 - movs r0, 0x1 - b _08088782 - .pool -_08088760: - cmp r5, 0x6 - bgt _08088780 - ldr r0, =0x02037340 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0808877C -_08088770: - movs r0, 0x1 - negs r0, r0 - b _08088782 - .pool -_0808877C: - movs r0, 0x2 - b _08088782 -_08088780: - movs r0, 0 -_08088782: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end GetMapBorderIdAt - - thumb_func_start GetPostCameraMoveMapBorderId -@ u32 GetPostCameraMoveMapBorderId(s32 deltaX, s32 deltaY) -GetPostCameraMoveMapBorderId: @ 8088788 - push {r4,lr} - adds r3, r1, 0 - ldr r1, =0x03005d8c - ldr r1, [r1] - movs r4, 0 - ldrsh r2, [r1, r4] - adds r0, 0x7 - adds r2, r0 - movs r0, 0x2 - ldrsh r1, [r1, r0] - adds r3, 0x7 - adds r1, r3 - adds r0, r2, 0 - bl GetMapBorderIdAt - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetPostCameraMoveMapBorderId - - thumb_func_start CanCameraMoveInDirection -@ bool32 CanCameraMoveInDirection(u8 direction) -CanCameraMoveInDirection: @ 80887B0 - push {r4,r5,lr} - ldr r1, =0x03005d8c - ldr r4, [r1] - movs r1, 0 - ldrsh r3, [r4, r1] - ldr r2, =gUnknown_08339D64 - lsls r0, 3 - adds r1, r0, r2 - ldr r1, [r1] - adds r1, 0x7 - adds r3, r1 - movs r5, 0x2 - ldrsh r1, [r4, r5] - adds r2, 0x4 - adds r0, r2 - ldr r0, [r0] - adds r0, 0x7 - adds r1, r0 - adds r0, r3, 0 - bl GetMapBorderIdAt - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080887F0 - movs r0, 0x1 - b _080887F2 - .pool -_080887F0: - movs r0, 0 -_080887F2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end CanCameraMoveInDirection - - thumb_func_start sub_80887F8 -sub_80887F8: @ 80887F8 - push {r4-r7,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r6, r2, 0 - adds r7, r3, 0 - bl mapconnection_get_mapheader - adds r3, r0, 0 - cmp r4, 0x2 - beq _08088860 - cmp r4, 0x2 - bgt _08088816 - cmp r4, 0x1 - beq _0808884C - b _08088872 -_08088816: - cmp r4, 0x3 - beq _08088834 - cmp r4, 0x4 - bne _08088872 - ldr r0, =0x03005d8c - ldr r1, [r0] - negs r0, r6 - strh r0, [r1] - ldr r2, [r5, 0x4] - ldrh r0, [r1, 0x2] - subs r0, r2 - b _08088870 - .pool -_08088834: - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, [r3] - ldr r0, [r0] - strh r0, [r1] - ldr r2, [r5, 0x4] - ldrh r0, [r1, 0x2] - subs r0, r2 - b _08088870 - .pool -_0808884C: - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r2, [r5, 0x4] - ldrh r0, [r1] - subs r0, r2 - strh r0, [r1] - negs r0, r7 - b _08088870 - .pool -_08088860: - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r2, [r5, 0x4] - ldrh r0, [r1] - subs r0, r2 - strh r0, [r1] - ldr r0, [r3] - ldr r0, [r0, 0x4] -_08088870: - strh r0, [r1, 0x2] -_08088872: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80887F8 - - thumb_func_start CameraMove -@ u8 CameraMove(s32 deltaX, s32 deltaY) -CameraMove: @ 808887C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r10, r0 - mov r9, r1 - ldr r1, =0x02037334 - ldrb r0, [r1] - movs r1, 0x2 - negs r1, r1 - ands r1, r0 - ldr r2, =0x02037334 - strb r1, [r2] - mov r0, r10 - mov r1, r9 - bl GetPostCameraMoveMapBorderId - adds r7, r0, 0 - adds r0, r7, 0x1 - cmp r0, 0x1 - bhi _080888C4 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldrh r0, [r1] - add r0, r10 - strh r0, [r1] - ldrh r0, [r1, 0x2] - add r0, r9 - strh r0, [r1, 0x2] - b _08088932 - .pool -_080888C4: - bl save_serialize_map - bl sub_81BE72C - ldr r1, =0x03005d8c - ldr r0, [r1] - movs r2, 0 - ldrsh r5, [r0, r2] - movs r1, 0x2 - ldrsh r6, [r0, r1] - lsls r2, r7, 24 - lsrs r2, 24 - mov r8, r2 - mov r0, r8 - adds r1, r5, 0 - adds r2, r6, 0 - bl sub_8088950 - adds r4, r0, 0 - adds r1, r7, 0 - mov r2, r10 - mov r3, r9 - bl sub_80887F8 - ldrb r0, [r4, 0x8] - ldrb r1, [r4, 0x9] - bl mliX_load_map - ldr r1, =0x02037334 - ldrb r0, [r1] - movs r1, 0x1 - orrs r0, r1 - ldr r2, =0x02037334 - strb r0, [r2] - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r2, 0 - ldrsh r0, [r1, r2] - subs r5, r0 - ldr r0, =0x02037334 - str r5, [r0, 0x4] - movs r2, 0x2 - ldrsh r0, [r1, r2] - subs r6, r0 - ldr r0, =0x02037334 - str r6, [r0, 0x8] - ldrh r0, [r1] - add r0, r10 - strh r0, [r1] - ldrh r0, [r1, 0x2] - add r0, r9 - strh r0, [r1, 0x2] - mov r0, r8 - bl sub_80885C4 -_08088932: - ldr r0, =0x02037334 - ldrb r0, [r0] - lsls r0, 31 - lsrs r0, 31 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end CameraMove - - thumb_func_start sub_8088950 -sub_8088950: @ 8088950 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r9, r1 - mov r8, r2 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x02037318 - ldr r0, [r0, 0xC] - ldr r7, [r0] - ldr r4, [r0, 0x4] - movs r5, 0 - cmp r5, r7 - bge _08088998 -_0808896E: - ldrb r0, [r4] - cmp r0, r6 - bne _08088990 - adds r0, r6, 0 - mov r1, r9 - mov r2, r8 - adds r3, r4, 0 - bl sub_80889A8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08088990 - adds r0, r4, 0 - b _0808899A - .pool -_08088990: - adds r5, 0x1 - adds r4, 0xC - cmp r5, r7 - blt _0808896E -_08088998: - movs r0, 0 -_0808899A: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8088950 - - thumb_func_start sub_80889A8 -sub_80889A8: @ 80889A8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r1, 0 - mov r8, r2 - adds r5, r3, 0 - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - adds r0, r5, 0 - bl mapconnection_get_mapheader - adds r2, r0, 0 - cmp r4, 0x1 - blt _08088A00 - cmp r4, 0x2 - bgt _080889E0 - ldr r0, =0x02037318 - ldr r0, [r0] - ldr r1, [r0] - ldr r0, [r2] - ldr r2, [r0] - ldr r3, [r5, 0x4] - adds r0, r7, 0 - b _080889F2 - .pool -_080889E0: - cmp r6, 0x4 - bgt _08088A00 - ldr r0, =0x02037318 - ldr r0, [r0] - ldr r1, [r0, 0x4] - ldr r0, [r2] - ldr r2, [r0, 0x4] - ldr r3, [r5, 0x4] - mov r0, r8 -_080889F2: - bl sub_8088A0C - lsls r0, 24 - lsrs r0, 24 - b _08088A02 - .pool -_08088A00: - movs r0, 0 -_08088A02: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80889A8 - - thumb_func_start sub_8088A0C -sub_8088A0C: @ 8088A0C - push {r4,lr} - adds r4, r0, 0 - adds r0, r2, 0 - adds r2, r3, 0 - cmp r3, 0 - bge _08088A1A - movs r3, 0 -_08088A1A: - adds r2, r0, r2 - cmp r2, r1 - bge _08088A22 - adds r1, r2, 0 -_08088A22: - cmp r3, r4 - bgt _08088A2E - cmp r4, r1 - bgt _08088A2E - movs r0, 0x1 - b _08088A30 -_08088A2E: - movs r0, 0 -_08088A30: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8088A0C - - thumb_func_start sub_8088A38 -sub_8088A38: @ 8088A38 - push {lr} - cmp r0, 0 - blt _08088A46 - cmp r0, r1 - bge _08088A46 - movs r0, 0x1 - b _08088A48 -_08088A46: - movs r0, 0 -_08088A48: - pop {r1} - bx r1 - thumb_func_end sub_8088A38 - - thumb_func_start sub_8088A4C -sub_8088A4C: @ 8088A4C - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - bl mapconnection_get_mapheader - adds r1, r0, 0 - ldrb r0, [r4] - cmp r0, 0x1 - blt _08088A84 - cmp r0, 0x2 - bgt _08088A72 - ldr r0, [r4, 0x4] - subs r0, r5, r0 - ldr r1, [r1] - ldr r1, [r1] - bl sub_8088A38 - b _08088A86 -_08088A72: - cmp r0, 0x4 - bgt _08088A84 - ldr r0, [r4, 0x4] - subs r0, r6, r0 - ldr r1, [r1] - ldr r1, [r1, 0x4] - bl sub_8088A38 - b _08088A86 -_08088A84: - movs r0, 0 -_08088A86: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8088A4C - - thumb_func_start sub_8088A8C -sub_8088A8C: @ 8088A8C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 16 - lsrs r1, 16 - ldr r2, =0x02037318 - ldr r0, [r2, 0xC] - cmp r0, 0 - bne _08088AB4 - b _08088B2A - .pool -_08088AB0: - adds r0, r4, 0 - b _08088B2C -_08088AB4: - ldr r7, [r0] - ldr r4, [r0, 0x4] - movs r6, 0 - cmp r6, r7 - bge _08088B2A - lsls r0, r1, 16 - asrs r5, r0, 16 - mov r9, r2 - mov r1, r8 - lsls r0, r1, 16 - asrs r0, 16 - mov r10, r0 -_08088ACC: - ldrb r1, [r4] - adds r3, r1, 0 - subs r0, r1, 0x5 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _08088B22 - cmp r1, 0x2 - bne _08088AE2 - cmp r5, 0x6 - bgt _08088B22 -_08088AE2: - cmp r1, 0x1 - bne _08088AF2 - mov r2, r9 - ldr r0, [r2] - ldr r0, [r0, 0x4] - adds r0, 0x7 - cmp r5, r0 - blt _08088B22 -_08088AF2: - mov r0, r8 - lsls r2, r0, 16 - cmp r1, 0x3 - bne _08088B00 - mov r1, r10 - cmp r1, 0x6 - bgt _08088B22 -_08088B00: - cmp r3, 0x4 - bne _08088B12 - asrs r1, r2, 16 - mov r3, r9 - ldr r0, [r3] - ldr r0, [r0] - adds r0, 0x7 - cmp r1, r0 - blt _08088B22 -_08088B12: - asrs r1, r2, 16 - subs r1, 0x7 - adds r0, r4, 0 - subs r2, r5, 0x7 - bl sub_8088A4C - cmp r0, 0x1 - beq _08088AB0 -_08088B22: - adds r6, 0x1 - adds r4, 0xC - cmp r6, r7 - blt _08088ACC -_08088B2A: - movs r0, 0 -_08088B2C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8088A8C - - thumb_func_start sub_8088B3C -sub_8088B3C: @ 8088B3C - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - lsrs r1, 16 - ldr r2, =0x03005d8c - ldr r2, [r2] - subs r0, 0x7 - strh r0, [r2] - subs r1, 0x7 - strh r1, [r2, 0x2] - bx lr - .pool - thumb_func_end sub_8088B3C - - thumb_func_start sav1_camera_get_focus_coords -sav1_camera_get_focus_coords: @ 8088B58 - ldr r2, =0x03005d8c - ldr r3, [r2] - ldrh r2, [r3] - adds r2, 0x7 - strh r2, [r0] - ldrh r0, [r3, 0x2] - adds r0, 0x7 - strh r0, [r1] - bx lr - .pool - thumb_func_end sav1_camera_get_focus_coords - - thumb_func_start SetCameraCoords -@ void SetCameraCoords(u16 x, u16 y) -SetCameraCoords: @ 8088B70 - ldr r2, =0x03005d8c - ldr r2, [r2] - strh r0, [r2] - strh r1, [r2, 0x2] - bx lr - .pool - thumb_func_end SetCameraCoords - - thumb_func_start GetCameraCoords -@ void GetCameraCoords(u16 *x, u16 *y) -GetCameraCoords: @ 8088B80 - ldr r2, =0x03005d8c - ldr r3, [r2] - ldrh r2, [r3] - strh r2, [r0] - ldrh r0, [r3, 0x2] - strh r0, [r1] - bx lr - .pool - thumb_func_end GetCameraCoords - - thumb_func_start sub_8088B94 -sub_8088B94: @ 8088B94 - push {r4,r5,lr} - adds r4, r0, 0 - adds r3, r1, 0 - adds r5, r2, 0 - cmp r4, 0 - blt _08088BE6 - ldr r2, =0x03005dc0 - ldr r1, [r2] - cmp r4, r1 - bge _08088BE6 - cmp r3, 0 - blt _08088BE6 - ldr r0, [r2, 0x4] - cmp r3, r0 - bge _08088BE6 - cmp r5, 0 - beq _08088BD4 - adds r0, r1, 0 - muls r0, r3 - adds r0, r4, r0 - ldr r1, [r2, 0x8] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r3, 0xC0 - lsls r3, 4 - adds r2, r3, 0 - orrs r1, r2 - strh r1, [r0] - b _08088BE6 - .pool -_08088BD4: - muls r1, r3 - adds r1, r4, r1 - ldr r0, [r2, 0x8] - lsls r1, 1 - adds r1, r0 - ldrh r2, [r1] - ldr r0, =0x0000f3ff - ands r0, r2 - strh r0, [r1] -_08088BE6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8088B94 - - thumb_func_start sub_8088BF0 -sub_8088BF0: @ 8088BF0 - push {lr} - adds r3, r0, 0 - lsls r1, 16 - lsrs r0, r1, 16 - adds r1, r0, 0 - lsls r2, 24 - lsrs r2, 24 - cmp r2, 0xFF - beq _08088C24 - cmp r2, 0 - bne _08088C0C - lsls r0, 1 - subs r3, r0 - b _08088C10 -_08088C0C: - lsls r0, r1, 1 - adds r3, r0 -_08088C10: - ldrh r1, [r3] - ldr r0, =0x000003ff - ands r0, r1 - adds r1, r2, 0 - bl sub_80FADE4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08088C2C -_08088C24: - movs r0, 0 - b _08088C2E - .pool -_08088C2C: - movs r0, 0x1 -_08088C2E: - pop {r1} - bx r1 - thumb_func_end sub_8088BF0 - - thumb_func_start copy_tileset_patterns_to_vram -@ void copy_tileset_patterns_to_vram(tileset *tileset, int num_tiles, int offset) -copy_tileset_patterns_to_vram: @ 8088C34 - push {r4-r7,lr} - sub sp, 0x4 - adds r3, r0, 0 - lsls r1, 16 - lsrs r4, r1, 16 - adds r6, r4, 0 - lsls r2, 16 - lsrs r5, r2, 16 - adds r7, r5, 0 - cmp r3, 0 - beq _08088C70 - ldrb r0, [r3] - cmp r0, 0 - bne _08088C60 - ldr r1, [r3, 0x4] - lsls r2, r4, 21 - lsrs r2, 16 - movs r0, 0x2 - adds r3, r5, 0 - bl LoadBgTiles - b _08088C70 -_08088C60: - ldr r1, [r3, 0x4] - lsls r2, r6, 5 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - adds r3, r7, 0 - bl decompress_and_copy_tile_data_to_vram -_08088C70: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end copy_tileset_patterns_to_vram - - thumb_func_start copy_tileset_patterns_to_vram2 -@ void copy_tileset_patterns_to_vram2(tileset *tileset, int num_tiles, int offset) -copy_tileset_patterns_to_vram2: @ 8088C78 - push {r4-r7,lr} - sub sp, 0x4 - adds r3, r0, 0 - lsls r1, 16 - lsrs r4, r1, 16 - adds r6, r4, 0 - lsls r2, 16 - lsrs r5, r2, 16 - adds r7, r5, 0 - cmp r3, 0 - beq _08088CB4 - ldrb r0, [r3] - cmp r0, 0 - bne _08088CA4 - ldr r1, [r3, 0x4] - lsls r2, r4, 21 - lsrs r2, 16 - movs r0, 0x2 - adds r3, r5, 0 - bl LoadBgTiles - b _08088CB4 -_08088CA4: - ldr r1, [r3, 0x4] - lsls r2, r6, 5 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - adds r3, r7, 0 - bl copy_decompressed_tile_data_to_vram_autofree -_08088CB4: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end copy_tileset_patterns_to_vram2 - - thumb_func_start nullsub_3 -nullsub_3: @ 8088CBC - bx lr - thumb_func_end nullsub_3 - - thumb_func_start nullsub_90 -nullsub_90: @ 8088CC0 - bx lr - thumb_func_end nullsub_90 - - thumb_func_start apply_map_tileset_palette -@ void apply_map_tileset_palette(tileset *tileset, int dest_offset, int size) -apply_map_tileset_palette: @ 8088CC4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - mov r8, r5 - lsls r6, r2, 16 - lsrs r7, r6, 16 - adds r2, r7, 0 - movs r1, 0 - mov r0, sp - strh r1, [r0] - cmp r4, 0 - beq _08088D42 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _08088D18 - mov r0, sp - adds r1, r5, 0 - movs r2, 0x2 - bl gpu_pal_apply - ldr r0, [r4, 0x8] - adds r0, 0x2 - adds r5, 0x1 - lsls r5, 16 - lsrs r5, 16 - subs r4, r7, 0x2 - lsls r2, r4, 16 - lsrs r2, 16 - adds r1, r5, 0 - bl gpu_pal_apply - lsls r4, 15 - lsrs r4, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl nullsub_3 - b _08088D42 -_08088D18: - cmp r0, 0x1 - bne _08088D32 - ldr r0, [r4, 0x8] - adds r0, 0xC0 - adds r1, r5, 0 - adds r2, r7, 0 - bl gpu_pal_apply - lsrs r1, r6, 17 - adds r0, r5, 0 - bl nullsub_3 - b _08088D42 -_08088D32: - ldr r0, [r4, 0x8] - mov r1, r8 - bl decompress_palette - lsrs r1, r6, 17 - mov r0, r8 - bl nullsub_3 -_08088D42: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end apply_map_tileset_palette - - thumb_func_start copy_map_tileset1_to_vram -@ void copy_map_tileset1_to_vram(mapdata_header *a1) -copy_map_tileset1_to_vram: @ 8088D50 - push {lr} - ldr r0, [r0, 0x10] - movs r1, 0x80 - lsls r1, 2 - movs r2, 0 - bl copy_tileset_patterns_to_vram - pop {r0} - bx r0 - thumb_func_end copy_map_tileset1_to_vram - - thumb_func_start copy_map_tileset2_to_vram -@ void copy_map_tileset2_to_vram(mapdata_header *a1) -copy_map_tileset2_to_vram: @ 8088D64 - push {lr} - ldr r0, [r0, 0x14] - movs r2, 0x80 - lsls r2, 2 - adds r1, r2, 0 - bl copy_tileset_patterns_to_vram - pop {r0} - bx r0 - thumb_func_end copy_map_tileset2_to_vram - - thumb_func_start copy_map_tileset2_to_vram_2 -@ void copy_map_tileset2_to_vram_2(mapdata_header *a1) -copy_map_tileset2_to_vram_2: @ 8088D78 - push {lr} - ldr r0, [r0, 0x14] - movs r2, 0x80 - lsls r2, 2 - adds r1, r2, 0 - bl copy_tileset_patterns_to_vram2 - pop {r0} - bx r0 - thumb_func_end copy_map_tileset2_to_vram_2 - - thumb_func_start apply_map_tileset1_palette -@ void apply_map_tileset1_palette(mapdata_header *a1) -apply_map_tileset1_palette: @ 8088D8C - push {lr} - ldr r0, [r0, 0x10] - movs r1, 0 - movs r2, 0xC0 - bl apply_map_tileset_palette - pop {r0} - bx r0 - thumb_func_end apply_map_tileset1_palette - - thumb_func_start apply_map_tileset2_palette -@ void apply_map_tileset2_palette(mapdata_header *a1) -apply_map_tileset2_palette: @ 8088D9C - push {lr} - ldr r0, [r0, 0x14] - movs r1, 0x60 - movs r2, 0xE0 - bl apply_map_tileset_palette - pop {r0} - bx r0 - thumb_func_end apply_map_tileset2_palette - - thumb_func_start copy_map_tileset1_tileset2_to_vram -@ void copy_map_tileset1_tileset2_to_vram(mapdata_header *a1) -copy_map_tileset1_tileset2_to_vram: @ 8088DAC - push {r4,r5,lr} - adds r5, r0, 0 - cmp r5, 0 - beq _08088DCC - ldr r0, [r5, 0x10] - movs r4, 0x80 - lsls r4, 2 - adds r1, r4, 0 - movs r2, 0 - bl copy_tileset_patterns_to_vram2 - ldr r0, [r5, 0x14] - adds r1, r4, 0 - adds r2, r4, 0 - bl copy_tileset_patterns_to_vram2 -_08088DCC: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end copy_map_tileset1_tileset2_to_vram - - thumb_func_start apply_map_tileset1_tileset2_palette -@ void apply_map_tileset1_tileset2_palette(mapdata_header *a1) -apply_map_tileset1_tileset2_palette: @ 8088DD4 - push {r4,lr} - adds r4, r0, 0 - cmp r4, 0 - beq _08088DE6 - bl apply_map_tileset1_palette - adds r0, r4, 0 - bl apply_map_tileset2_palette -_08088DE6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end apply_map_tileset1_tileset2_palette - - thumb_func_start ShouldDoJumpLandingDustEffect -ShouldDoJumpLandingDustEffect: @ 8088DEC - movs r0, 0x1 - bx lr - thumb_func_end ShouldDoJumpLandingDustEffect - - thumb_func_start sub_8088DF0 -sub_8088DF0: @ 8088DF0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_08486EFC - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08088E0C - movs r0, 0 - b _08088E0E - .pool -_08088E0C: - movs r0, 0x1 -_08088E0E: - pop {r1} - bx r1 - thumb_func_end sub_8088DF0 - - thumb_func_start MetatileBehavior_IsJumpEast -MetatileBehavior_IsJumpEast: @ 8088E14 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x38 - beq _08088E22 - movs r0, 0 - b _08088E24 -_08088E22: - movs r0, 0x1 -_08088E24: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsJumpEast - - thumb_func_start MetatileBehavior_IsJumpWest -MetatileBehavior_IsJumpWest: @ 8088E28 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x39 - beq _08088E36 - movs r0, 0 - b _08088E38 -_08088E36: - movs r0, 0x1 -_08088E38: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsJumpWest - - thumb_func_start MetatileBehavior_IsJumpNorth -MetatileBehavior_IsJumpNorth: @ 8088E3C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3A - beq _08088E4A - movs r0, 0 - b _08088E4C -_08088E4A: - movs r0, 0x1 -_08088E4C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsJumpNorth - - thumb_func_start MetatileBehavior_IsJumpSouth -MetatileBehavior_IsJumpSouth: @ 8088E50 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3B - beq _08088E5E - movs r0, 0 - b _08088E60 -_08088E5E: - movs r0, 0x1 -_08088E60: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsJumpSouth - - thumb_func_start sub_8088E64 -sub_8088E64: @ 8088E64 - push {lr} - lsls r0, 24 - movs r1, 0xFE - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _08088E78 - movs r0, 0 - b _08088E7A -_08088E78: - movs r0, 0x1 -_08088E7A: - pop {r1} - bx r1 - thumb_func_end sub_8088E64 - - thumb_func_start MetatileBehavior_IsSandOrDeepSand -MetatileBehavior_IsSandOrDeepSand: @ 8088E80 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x21 - beq _08088E8E - cmp r0, 0x6 - bne _08088E92 -_08088E8E: - movs r0, 0x1 - b _08088E94 -_08088E92: - movs r0, 0 -_08088E94: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSandOrDeepSand - - thumb_func_start MetatileBehavior_IsDeepSand -MetatileBehavior_IsDeepSand: @ 8088E98 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6 - beq _08088EA6 - movs r0, 0 - b _08088EA8 -_08088EA6: - movs r0, 0x1 -_08088EA8: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsDeepSand - - thumb_func_start MetatileBehavior_IsReflective -MetatileBehavior_IsReflective: @ 8088EAC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - beq _08088ECA - cmp r0, 0x16 - beq _08088ECA - cmp r0, 0x1A - beq _08088ECA - cmp r0, 0x20 - beq _08088ECA - cmp r0, 0x14 - beq _08088ECA - cmp r0, 0x2B - bne _08088ECE -_08088ECA: - movs r0, 0x1 - b _08088ED0 -_08088ECE: - movs r0, 0 -_08088ED0: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsReflective - - thumb_func_start MetatileBehavior_IsIce -MetatileBehavior_IsIce: @ 8088ED4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x20 - beq _08088EE2 - movs r0, 0 - b _08088EE4 -_08088EE2: - movs r0, 0x1 -_08088EE4: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsIce - - thumb_func_start is_tile_x69_2_warp_door -is_tile_x69_2_warp_door: @ 8088EE8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x69 - beq _08088EF6 - movs r0, 0 - b _08088EF8 -_08088EF6: - movs r0, 0x1 -_08088EF8: - pop {r1} - bx r1 - thumb_func_end is_tile_x69_2_warp_door - - thumb_func_start sub_8088EFC -sub_8088EFC: @ 8088EFC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8D - beq _08088F0A - cmp r0, 0x69 - bne _08088F0E -_08088F0A: - movs r0, 0x1 - b _08088F10 -_08088F0E: - movs r0, 0 -_08088F10: - pop {r1} - bx r1 - thumb_func_end sub_8088EFC - - thumb_func_start MetatileBehavior_IsEscalator -MetatileBehavior_IsEscalator: @ 8088F14 - push {lr} - lsls r0, 24 - movs r1, 0x96 - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _08088F28 - movs r0, 0 - b _08088F2A -_08088F28: - movs r0, 0x1 -_08088F2A: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsEscalator - - thumb_func_start sub_8088F30 -sub_8088F30: @ 8088F30 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - beq _08088F3E - movs r0, 0 - b _08088F40 -_08088F3E: - movs r0, 0x1 -_08088F40: - pop {r1} - bx r1 - thumb_func_end sub_8088F30 - - thumb_func_start MetatileBehavior_IsLadder -MetatileBehavior_IsLadder: @ 8088F44 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x61 - beq _08088F52 - movs r0, 0 - b _08088F54 -_08088F52: - movs r0, 0x1 -_08088F54: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsLadder - - thumb_func_start sub_8088F58 -sub_8088F58: @ 8088F58 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x60 - beq _08088F6A - cmp r0, 0x6C - beq _08088F6A - cmp r0, 0x6E - bne _08088F6E -_08088F6A: - movs r0, 0x1 - b _08088F70 -_08088F6E: - movs r0, 0 -_08088F70: - pop {r1} - bx r1 - thumb_func_end sub_8088F58 - - thumb_func_start sub_8088F74 -sub_8088F74: @ 8088F74 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6E - beq _08088F82 - movs r0, 0 - b _08088F84 -_08088F82: - movs r0, 0x1 -_08088F84: - pop {r1} - bx r1 - thumb_func_end sub_8088F74 - - thumb_func_start MetatileBehavior_IsSurfableWaterOrUnderwater -MetatileBehavior_IsSurfableWaterOrUnderwater: @ 8088F88 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_08486EFC - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08088FA4 - movs r0, 0 - b _08088FA6 - .pool -_08088FA4: - movs r0, 0x1 -_08088FA6: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSurfableWaterOrUnderwater - - thumb_func_start MetatileBehavior_IsEastArrowWarp -MetatileBehavior_IsEastArrowWarp: @ 8088FAC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x62 - beq _08088FBA - movs r0, 0 - b _08088FBC -_08088FBA: - movs r0, 0x1 -_08088FBC: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsEastArrowWarp - - thumb_func_start MetatileBehavior_IsWestArrowWarp -MetatileBehavior_IsWestArrowWarp: @ 8088FC0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x63 - beq _08088FCE - movs r0, 0 - b _08088FD0 -_08088FCE: - movs r0, 0x1 -_08088FD0: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWestArrowWarp - - thumb_func_start MetatileBehavior_IsNorthArrowWarp -MetatileBehavior_IsNorthArrowWarp: @ 8088FD4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x64 - beq _08088FE2 - cmp r0, 0x1B - bne _08088FE6 -_08088FE2: - movs r0, 0x1 - b _08088FE8 -_08088FE6: - movs r0, 0 -_08088FE8: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsNorthArrowWarp - - thumb_func_start MetatileBehavior_IsSouthArrowWarp -MetatileBehavior_IsSouthArrowWarp: @ 8088FEC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x65 - beq _08088FFE - cmp r0, 0x6D - beq _08088FFE - cmp r0, 0x1C - bne _08089002 -_08088FFE: - movs r0, 0x1 - b _08089004 -_08089002: - movs r0, 0 -_08089004: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSouthArrowWarp - - thumb_func_start sub_8089008 -sub_8089008: @ 8089008 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r5, 0 - adds r0, r4, 0 - bl MetatileBehavior_IsEastArrowWarp - lsls r0, 24 - cmp r0, 0 - bne _08089040 - adds r0, r4, 0 - bl MetatileBehavior_IsWestArrowWarp - lsls r0, 24 - cmp r0, 0 - bne _08089040 - adds r0, r4, 0 - bl MetatileBehavior_IsNorthArrowWarp - lsls r0, 24 - cmp r0, 0 - bne _08089040 - adds r0, r4, 0 - bl MetatileBehavior_IsSouthArrowWarp - lsls r0, 24 - cmp r0, 0 - beq _08089042 -_08089040: - movs r5, 0x1 -_08089042: - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8089008 - - thumb_func_start sub_808904C -sub_808904C: @ 808904C - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xC0 - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0x8 - bls _08089082 - adds r0, r1, 0 - subs r0, 0x50 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _08089082 - cmp r1, 0xD0 - beq _08089082 - cmp r1, 0xD2 - beq _08089082 - cmp r1, 0x13 - beq _08089082 - cmp r1, 0x20 - beq _08089082 - cmp r1, 0xBB - beq _08089082 - cmp r1, 0xBC - bne _08089086 -_08089082: - movs r0, 0x1 - b _08089088 -_08089086: - movs r0, 0 -_08089088: - pop {r1} - bx r1 - thumb_func_end sub_808904C - - thumb_func_start MetatileBehavior_IsIce_2 -@ bool8 MetatileBehavior_IsIce_2(u8 metatileBehavior) -MetatileBehavior_IsIce_2: @ 808908C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x20 - beq _0808909A - movs r0, 0 - b _0808909C -_0808909A: - movs r0, 0x1 -_0808909C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsIce_2 - - thumb_func_start MetatileBehavior_IsTrickHouseSlipperyFloor -@ bool8 MetatileBehavior_IsTrickHouseSlipperyFloor(u8 metatileBehavior) -MetatileBehavior_IsTrickHouseSlipperyFloor: @ 80890A0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x48 - beq _080890AE - movs r0, 0 - b _080890B0 -_080890AE: - movs r0, 0x1 -_080890B0: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsTrickHouseSlipperyFloor - - thumb_func_start MetatileBehavior_0x05 -MetatileBehavior_0x05: @ 80890B4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - beq _080890C2 - movs r0, 0 - b _080890C4 -_080890C2: - movs r0, 0x1 -_080890C4: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_0x05 - - thumb_func_start MetatileBehavior_IsWalkNorth -@ bool8 MetatileBehavior_IsWalkNorth(u8 metatileBehavior) -MetatileBehavior_IsWalkNorth: @ 80890C8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x42 - beq _080890D6 - movs r0, 0 - b _080890D8 -_080890D6: - movs r0, 0x1 -_080890D8: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWalkNorth - - thumb_func_start MetatileBehavior_IsWalkSouth -@ bool8 MetatileBehavior_IsWalkSouth(u8 metatileBehavior) -MetatileBehavior_IsWalkSouth: @ 80890DC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x43 - beq _080890EA - movs r0, 0 - b _080890EC -_080890EA: - movs r0, 0x1 -_080890EC: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWalkSouth - - thumb_func_start MetatileBehavior_IsWalkWest -@ bool8 MetatileBehavior_IsWalkWest(u8 metatileBehavior) -MetatileBehavior_IsWalkWest: @ 80890F0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x41 - beq _080890FE - movs r0, 0 - b _08089100 -_080890FE: - movs r0, 0x1 -_08089100: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWalkWest - - thumb_func_start MetatileBehavior_IsWalkEast -@ bool8 MetatileBehavior_IsWalkEast(u8 metatileBehavior) -MetatileBehavior_IsWalkEast: @ 8089104 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _08089112 - movs r0, 0 - b _08089114 -_08089112: - movs r0, 0x1 -_08089114: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWalkEast - - thumb_func_start MetatileBehavior_IsNorthwardCurrent -@ bool8 MetatileBehavior_IsNorthwardCurrent(u8 metatileBehavior) -MetatileBehavior_IsNorthwardCurrent: @ 8089118 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x52 - beq _08089126 - movs r0, 0 - b _08089128 -_08089126: - movs r0, 0x1 -_08089128: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsNorthwardCurrent - - thumb_func_start MetatileBehavior_IsSouthwardCurrent -@ bool8 MetatileBehavior_IsSouthwardCurrent(u8 metatileBehavior) -MetatileBehavior_IsSouthwardCurrent: @ 808912C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x53 - beq _0808913A - movs r0, 0 - b _0808913C -_0808913A: - movs r0, 0x1 -_0808913C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSouthwardCurrent - - thumb_func_start MetatileBehavior_IsWestwardCurrent -@ bool8 MetatileBehavior_IsWestwardCurrent(u8 metatileBehavior) -MetatileBehavior_IsWestwardCurrent: @ 8089140 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x51 - beq _0808914E - movs r0, 0 - b _08089150 -_0808914E: - movs r0, 0x1 -_08089150: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWestwardCurrent - - thumb_func_start MetatileBehavior_IsEastwardCurrent -@ bool8 MetatileBehavior_IsEastwardCurrent(u8 metatileBehavior) -MetatileBehavior_IsEastwardCurrent: @ 8089154 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x50 - beq _08089162 - movs r0, 0 - b _08089164 -_08089162: - movs r0, 0x1 -_08089164: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsEastwardCurrent - - thumb_func_start MetatileBehavior_IsSlideNorth -@ bool8 MetatileBehavior_IsSlideNorth(u8 metatileBehavior) -MetatileBehavior_IsSlideNorth: @ 8089168 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x46 - beq _08089176 - movs r0, 0 - b _08089178 -_08089176: - movs r0, 0x1 -_08089178: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSlideNorth - - thumb_func_start MetatileBehavior_IsSlideSouth -@ bool8 MetatileBehavior_IsSlideSouth(u8 metatileBehavior) -MetatileBehavior_IsSlideSouth: @ 808917C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x47 - beq _0808918A - movs r0, 0 - b _0808918C -_0808918A: - movs r0, 0x1 -_0808918C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSlideSouth - - thumb_func_start MetatileBehavior_IsSlideWest -@ bool8 MetatileBehavior_IsSlideWest(u8 metatileBehavior) -MetatileBehavior_IsSlideWest: @ 8089190 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x45 - beq _0808919E - movs r0, 0 - b _080891A0 -_0808919E: - movs r0, 0x1 -_080891A0: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSlideWest - - thumb_func_start MetatileBehavior_IsSlideEast -@ bool8 MetatileBehavior_IsSlideEast(u8 metatileBehavior) -MetatileBehavior_IsSlideEast: @ 80891A4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x44 - beq _080891B2 - movs r0, 0 - b _080891B4 -_080891B2: - movs r0, 0x1 -_080891B4: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSlideEast - - thumb_func_start MetatileBehavior_IsCounter -MetatileBehavior_IsCounter: @ 80891B8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x80 - beq _080891C6 - movs r0, 0 - b _080891C8 -_080891C6: - movs r0, 0x1 -_080891C8: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsCounter - - thumb_func_start MetatileBehavior_IsPlayerFacingTVScreen -@ bool8 MetatileBehavior_IsPlayerFacingTVScreen(u8 behavior, u8 direction) -MetatileBehavior_IsPlayerFacingTVScreen: @ 80891CC - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x2 - bne _080891DE - cmp r0, 0x86 - beq _080891E2 -_080891DE: - movs r0, 0 - b _080891E4 -_080891E2: - movs r0, 0x1 -_080891E4: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsPlayerFacingTVScreen - - thumb_func_start MetatileBehavior_IsPC -MetatileBehavior_IsPC: @ 80891E8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x83 - beq _080891F6 - movs r0, 0 - b _080891F8 -_080891F6: - movs r0, 0x1 -_080891F8: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsPC - - thumb_func_start is_tile_x84 -is_tile_x84: @ 80891FC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x84 - beq _0808920A - movs r0, 0 - b _0808920C -_0808920A: - movs r0, 0x1 -_0808920C: - pop {r1} - bx r1 - thumb_func_end is_tile_x84 - - thumb_func_start sub_8089210 -sub_8089210: @ 8089210 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x91 - beq _08089232 - cmp r0, 0x93 - beq _08089232 - cmp r0, 0x95 - beq _08089232 - cmp r0, 0x97 - beq _08089232 - cmp r0, 0x99 - beq _08089232 - cmp r0, 0x9B - beq _08089232 - cmp r0, 0x9D - bne _08089236 -_08089232: - movs r0, 0x1 - b _08089238 -_08089236: - movs r0, 0 -_08089238: - pop {r1} - bx r1 - thumb_func_end sub_8089210 - - thumb_func_start sub_808923C -sub_808923C: @ 808923C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x90 - beq _08089252 - cmp r0, 0x92 - beq _08089252 - cmp r0, 0x94 - beq _08089252 - cmp r0, 0x9A - bne _08089256 -_08089252: - movs r0, 0x1 - b _08089258 -_08089256: - movs r0, 0 -_08089258: - pop {r1} - bx r1 - thumb_func_end sub_808923C - - thumb_func_start sub_808925C -sub_808925C: @ 808925C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x96 - beq _0808926A - cmp r0, 0x9C - bne _0808926E -_0808926A: - movs r0, 0x1 - b _08089270 -_0808926E: - movs r0, 0 -_08089270: - pop {r1} - bx r1 - thumb_func_end sub_808925C - - thumb_func_start is_tile_x98 -is_tile_x98: @ 8089274 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x98 - beq _08089282 - movs r0, 0 - b _08089284 -_08089282: - movs r0, 0x1 -_08089284: - pop {r1} - bx r1 - thumb_func_end is_tile_x98 - - thumb_func_start sub_8089288 -sub_8089288: @ 8089288 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB0 - beq _08089296 - movs r0, 0 - b _08089298 -_08089296: - movs r0, 0x1 -_08089298: - pop {r1} - bx r1 - thumb_func_end sub_8089288 - - thumb_func_start sub_808929C -sub_808929C: @ 808929C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB1 - beq _080892AA - movs r0, 0 - b _080892AC -_080892AA: - movs r0, 0x1 -_080892AC: - pop {r1} - bx r1 - thumb_func_end sub_808929C - - thumb_func_start sub_80892B0 -sub_80892B0: @ 80892B0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB2 - beq _080892BE - movs r0, 0 - b _080892C0 -_080892BE: - movs r0, 0x1 -_080892C0: - pop {r1} - bx r1 - thumb_func_end sub_80892B0 - - thumb_func_start sub_80892C4 -sub_80892C4: @ 80892C4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB3 - beq _080892D2 - movs r0, 0 - b _080892D4 -_080892D2: - movs r0, 0x1 -_080892D4: - pop {r1} - bx r1 - thumb_func_end sub_80892C4 - - thumb_func_start sub_80892D8 -sub_80892D8: @ 80892D8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB9 - beq _080892E6 - movs r0, 0 - b _080892E8 -_080892E6: - movs r0, 0x1 -_080892E8: - pop {r1} - bx r1 - thumb_func_end sub_80892D8 - - thumb_func_start sub_80892EC -sub_80892EC: @ 80892EC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xC6 - beq _080892FA - movs r0, 0 - b _080892FC -_080892FA: - movs r0, 0x1 -_080892FC: - pop {r1} - bx r1 - thumb_func_end sub_80892EC - - thumb_func_start sub_8089300 -sub_8089300: @ 8089300 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xC7 - beq _0808930E - movs r0, 0 - b _08089310 -_0808930E: - movs r0, 0x1 -_08089310: - pop {r1} - bx r1 - thumb_func_end sub_8089300 - - thumb_func_start sub_8089314 -sub_8089314: @ 8089314 - push {lr} - lsls r0, 24 - cmp r0, 0 - beq _08089320 - movs r0, 0 - b _08089322 -_08089320: - movs r0, 0x1 -_08089322: - pop {r1} - bx r1 - thumb_func_end sub_8089314 - - thumb_func_start sub_8089328 -sub_8089328: @ 8089328 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB7 - beq _08089336 - movs r0, 0 - b _08089338 -_08089336: - movs r0, 0x1 -_08089338: - pop {r1} - bx r1 - thumb_func_end sub_8089328 - - thumb_func_start sub_808933C -sub_808933C: @ 808933C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB2 - beq _0808934A - movs r0, 0 - b _0808934C -_0808934A: - movs r0, 0x1 -_0808934C: - pop {r1} - bx r1 - thumb_func_end sub_808933C - - thumb_func_start sub_8089350 -sub_8089350: @ 8089350 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB5 - beq _0808935E - movs r0, 0 - b _08089360 -_0808935E: - movs r0, 0x1 -_08089360: - pop {r1} - bx r1 - thumb_func_end sub_8089350 - - thumb_func_start sub_8089364 -sub_8089364: @ 8089364 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xC3 - beq _08089372 - movs r0, 0 - b _08089374 -_08089372: - movs r0, 0x1 -_08089374: - pop {r1} - bx r1 - thumb_func_end sub_8089364 - - thumb_func_start sub_8089378 -sub_8089378: @ 8089378 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xC2 - beq _08089386 - movs r0, 0 - b _08089388 -_08089386: - movs r0, 0x1 -_08089388: - pop {r1} - bx r1 - thumb_func_end sub_8089378 - - thumb_func_start sub_808938C -sub_808938C: @ 808938C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB8 - beq _0808939A - movs r0, 0 - b _0808939C -_0808939A: - movs r0, 0x1 -_0808939C: - pop {r1} - bx r1 - thumb_func_end sub_808938C - - thumb_func_start sub_80893A0 -sub_80893A0: @ 80893A0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xBE - beq _080893AE - movs r0, 0 - b _080893B0 -_080893AE: - movs r0, 0x1 -_080893B0: - pop {r1} - bx r1 - thumb_func_end sub_80893A0 - - thumb_func_start sub_80893B4 -sub_80893B4: @ 80893B4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xBD - beq _080893C2 - movs r0, 0 - b _080893C4 -_080893C2: - movs r0, 0x1 -_080893C4: - pop {r1} - bx r1 - thumb_func_end sub_80893B4 - - thumb_func_start sub_80893C8 -sub_80893C8: @ 80893C8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xBA - beq _080893D6 - movs r0, 0 - b _080893D8 -_080893D6: - movs r0, 0x1 -_080893D8: - pop {r1} - bx r1 - thumb_func_end sub_80893C8 - - thumb_func_start sub_80893DC -sub_80893DC: @ 80893DC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xBF - beq _080893EA - movs r0, 0 - b _080893EC -_080893EA: - movs r0, 0x1 -_080893EC: - pop {r1} - bx r1 - thumb_func_end sub_80893DC - - thumb_func_start sub_80893F0 -sub_80893F0: @ 80893F0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xC4 - beq _080893FE - movs r0, 0 - b _08089400 -_080893FE: - movs r0, 0x1 -_08089400: - pop {r1} - bx r1 - thumb_func_end sub_80893F0 - - thumb_func_start sub_8089404 -sub_8089404: @ 8089404 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xC5 - beq _08089412 - movs r0, 0 - b _08089414 -_08089412: - movs r0, 0x1 -_08089414: - pop {r1} - bx r1 - thumb_func_end sub_8089404 - - thumb_func_start MetatileBehavior_HasRipples -MetatileBehavior_HasRipples: @ 8089418 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - beq _0808942A - cmp r0, 0x16 - beq _0808942A - cmp r0, 0x14 - bne _0808942E -_0808942A: - movs r0, 0x1 - b _08089430 -_0808942E: - movs r0, 0 -_08089430: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_HasRipples - - thumb_func_start MetatileBehavior_IsPuddle -MetatileBehavior_IsPuddle: @ 8089434 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x16 - beq _08089442 - movs r0, 0 - b _08089444 -_08089442: - movs r0, 0x1 -_08089444: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsPuddle - - thumb_func_start MetatileBehavior_IsTallGrass -MetatileBehavior_IsTallGrass: @ 8089448 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _08089456 - movs r0, 0 - b _08089458 -_08089456: - movs r0, 0x1 -_08089458: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsTallGrass - - thumb_func_start MetatileBehavior_IsLongGrass -MetatileBehavior_IsLongGrass: @ 808945C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - beq _0808946A - movs r0, 0 - b _0808946C -_0808946A: - movs r0, 0x1 -_0808946C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsLongGrass - - thumb_func_start MetatileBehavior_IsBerryTreeSoil -MetatileBehavior_IsBerryTreeSoil: @ 8089470 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xA0 - beq _0808947E - movs r0, 0 - b _08089480 -_0808947E: - movs r0, 0x1 -_08089480: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsBerryTreeSoil - - thumb_func_start MetatileBehavior_IsAsh -MetatileBehavior_IsAsh: @ 8089484 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x24 - beq _08089492 - movs r0, 0 - b _08089494 -_08089492: - movs r0, 0x1 -_08089494: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsAsh - - thumb_func_start MetatileBehavior_IsUnusedFootprintMetatile -MetatileBehavior_IsUnusedFootprintMetatile: @ 8089498 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x25 - beq _080894A6 - movs r0, 0 - b _080894A8 -_080894A6: - movs r0, 0x1 -_080894A8: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsUnusedFootprintMetatile - - thumb_func_start sub_80894AC -sub_80894AC: @ 80894AC - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0x90 - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0x3 - bls _080894CA - adds r0, r1, 0 - subs r0, 0x7C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bhi _080894CE -_080894CA: - movs r0, 0x1 - b _080894D0 -_080894CE: - movs r0, 0 -_080894D0: - pop {r1} - bx r1 - thumb_func_end sub_80894AC - - thumb_func_start sub_80894D4 -sub_80894D4: @ 80894D4 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - adds r2, r1, 0 - adds r0, r1, 0 - subs r0, 0x70 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _0808950A - adds r0, r1, 0 - subs r0, 0x7A - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _080894F8 - movs r0, 0x2 - b _0808950A -_080894F8: - adds r0, r2, 0 - subs r0, 0x7C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _08089508 - movs r0, 0 - b _0808950A -_08089508: - movs r0, 0x3 -_0808950A: - pop {r1} - bx r1 - thumb_func_end sub_80894D4 - - thumb_func_start sub_8089510 -sub_8089510: @ 8089510 - push {lr} - lsls r0, 24 - movs r1, 0x90 - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x3 - bls _08089524 - movs r0, 0 - b _08089526 -_08089524: - movs r0, 0x1 -_08089526: - pop {r1} - bx r1 - thumb_func_end sub_8089510 - - thumb_func_start sub_808952C -sub_808952C: @ 808952C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl MetatileBehavior_IsSurfableWaterOrUnderwater - lsls r0, 24 - cmp r0, 0 - bne _08089550 - adds r0, r4, 0 - bl sub_8088DF0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08089550 - movs r0, 0x1 - b _08089552 -_08089550: - movs r0, 0 -_08089552: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808952C - - thumb_func_start sub_8089558 -sub_8089558: @ 8089558 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl MetatileBehavior_IsSurfableWaterOrUnderwater - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0808957E - adds r0, r4, 0 - bl sub_8088DF0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0808957E - movs r0, 0x1 - b _08089580 -_0808957E: - movs r0, 0 -_08089580: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8089558 - - thumb_func_start sub_8089588 -sub_8089588: @ 8089588 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB - beq _08089596 - movs r0, 0 - b _08089598 -_08089596: - movs r0, 0x1 -_08089598: - pop {r1} - bx r1 - thumb_func_end sub_8089588 - - thumb_func_start sub_808959C -sub_808959C: @ 808959C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xC - beq _080895AA - movs r0, 0 - b _080895AC -_080895AA: - movs r0, 0x1 -_080895AC: - pop {r1} - bx r1 - thumb_func_end sub_808959C - - thumb_func_start sub_80895B0 -sub_80895B0: @ 80895B0 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xEF - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0x1 - bls _080895C6 - cmp r1, 0x14 - bne _080895CA -_080895C6: - movs r0, 0x1 - b _080895CC -_080895CA: - movs r0, 0 -_080895CC: - pop {r1} - bx r1 - thumb_func_end sub_80895B0 - - thumb_func_start sub_80895D0 -sub_80895D0: @ 80895D0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x19 - beq _080895DE - cmp r0, 0x2A - bne _080895E2 -_080895DE: - movs r0, 0x1 - b _080895E4 -_080895E2: - movs r0, 0 -_080895E4: - pop {r1} - bx r1 - thumb_func_end sub_80895D0 - - thumb_func_start MetatileBehavior_IsShallowFlowingWater -MetatileBehavior_IsShallowFlowingWater: @ 80895E8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x17 - beq _080895FA - cmp r0, 0x1B - beq _080895FA - cmp r0, 0x1C - bne _080895FE -_080895FA: - movs r0, 0x1 - b _08089600 -_080895FE: - movs r0, 0 -_08089600: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsShallowFlowingWater - - thumb_func_start sub_8089604 -sub_8089604: @ 8089604 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x26 - beq _08089612 - movs r0, 0 - b _08089614 -_08089612: - movs r0, 0x1 -_08089614: - pop {r1} - bx r1 - thumb_func_end sub_8089604 - - thumb_func_start sub_8089618 -sub_8089618: @ 8089618 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x27 - beq _08089626 - movs r0, 0 - b _08089628 -_08089626: - movs r0, 0x1 -_08089628: - pop {r1} - bx r1 - thumb_func_end sub_8089618 - - thumb_func_start sub_808962C -sub_808962C: @ 808962C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x15 - beq _0808963E - cmp r0, 0x11 - beq _0808963E - cmp r0, 0x12 - bne _08089642 -_0808963E: - movs r0, 0x1 - b _08089644 -_08089642: - movs r0, 0 -_08089644: - pop {r1} - bx r1 - thumb_func_end sub_808962C - - thumb_func_start sub_8089648 -sub_8089648: @ 8089648 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x18 - beq _08089656 - cmp r0, 0x1A - bne _0808965A -_08089656: - movs r0, 0x1 - b _0808965C -_0808965A: - movs r0, 0 -_0808965C: - pop {r1} - bx r1 - thumb_func_end sub_8089648 - - thumb_func_start sub_8089660 -sub_8089660: @ 8089660 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl MetatileBehavior_IsSurfableWaterOrUnderwater - lsls r0, 24 - cmp r0, 0 - beq _08089682 - adds r0, r4, 0 - bl MetatileBehavior_IsWaterfall - lsls r0, 24 - cmp r0, 0 - bne _08089682 - movs r0, 0x1 - b _08089684 -_08089682: - movs r0, 0 -_08089684: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8089660 - - thumb_func_start MetatileBehavior_IsEastBlocked -MetatileBehavior_IsEastBlocked: @ 808968C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x30 - beq _080896A6 - cmp r0, 0x34 - beq _080896A6 - cmp r0, 0x36 - beq _080896A6 - cmp r0, 0xC1 - beq _080896A6 - cmp r0, 0xBE - bne _080896AA -_080896A6: - movs r0, 0x1 - b _080896AC -_080896AA: - movs r0, 0 -_080896AC: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsEastBlocked - - thumb_func_start MetatileBehavior_IsWestBlocked -MetatileBehavior_IsWestBlocked: @ 80896B0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x31 - beq _080896CA - cmp r0, 0x35 - beq _080896CA - cmp r0, 0x37 - beq _080896CA - cmp r0, 0xC1 - beq _080896CA - cmp r0, 0xBE - bne _080896CE -_080896CA: - movs r0, 0x1 - b _080896D0 -_080896CE: - movs r0, 0 -_080896D0: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWestBlocked - - thumb_func_start MetatileBehavior_IsNorthBlocked -MetatileBehavior_IsNorthBlocked: @ 80896D4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x32 - beq _080896EA - cmp r0, 0x34 - beq _080896EA - cmp r0, 0x35 - beq _080896EA - cmp r0, 0xC0 - bne _080896EE -_080896EA: - movs r0, 0x1 - b _080896F0 -_080896EE: - movs r0, 0 -_080896F0: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsNorthBlocked - - thumb_func_start MetatileBehavior_IsSouthBlocked -MetatileBehavior_IsSouthBlocked: @ 80896F4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x33 - beq _0808970A - cmp r0, 0x36 - beq _0808970A - cmp r0, 0x37 - beq _0808970A - cmp r0, 0xC0 - bne _0808970E -_0808970A: - movs r0, 0x1 - b _08089710 -_0808970E: - movs r0, 0 -_08089710: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSouthBlocked - - thumb_func_start MetatileBehavior_IsShortGrass -MetatileBehavior_IsShortGrass: @ 8089714 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x7 - beq _08089722 - movs r0, 0 - b _08089724 -_08089722: - movs r0, 0x1 -_08089724: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsShortGrass - - thumb_func_start MetatileBehavior_IsHotSprings -MetatileBehavior_IsHotSprings: @ 8089728 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x28 - beq _08089736 - movs r0, 0 - b _08089738 -_08089736: - movs r0, 0x1 -_08089738: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsHotSprings - - thumb_func_start MetatileBehavior_IsWaterfall -@ bool8 MetatileBehavior_IsWaterfall(u8 metatileBehavior) -MetatileBehavior_IsWaterfall: @ 808973C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - beq _0808974A - movs r0, 0 - b _0808974C -_0808974A: - movs r0, 0x1 -_0808974C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsWaterfall - - thumb_func_start MetatileBehavior_IsFortreeBridge -MetatileBehavior_IsFortreeBridge: @ 8089750 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x78 - beq _0808975E - movs r0, 0 - b _08089760 -_0808975E: - movs r0, 0x1 -_08089760: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsFortreeBridge - - thumb_func_start sub_8089764 -sub_8089764: @ 8089764 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x74 - beq _08089772 - movs r0, 0 - b _08089774 -_08089772: - movs r0, 0x1 -_08089774: - pop {r1} - bx r1 - thumb_func_end sub_8089764 - - thumb_func_start sub_8089778 -sub_8089778: @ 8089778 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x75 - beq _08089786 - movs r0, 0 - b _08089788 -_08089786: - movs r0, 0x1 -_08089788: - pop {r1} - bx r1 - thumb_func_end sub_8089778 - - thumb_func_start sub_808978C -sub_808978C: @ 808978C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x76 - beq _0808979A - movs r0, 0 - b _0808979C -_0808979A: - movs r0, 0x1 -_0808979C: - pop {r1} - bx r1 - thumb_func_end sub_808978C - - thumb_func_start sub_80897A0 -sub_80897A0: @ 80897A0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x77 - beq _080897AE - movs r0, 0 - b _080897B0 -_080897AE: - movs r0, 0x1 -_080897B0: - pop {r1} - bx r1 - thumb_func_end sub_80897A0 - - thumb_func_start MetatileBehavior_IsPacifidlogLog -MetatileBehavior_IsPacifidlogLog: @ 80897B4 - push {lr} - lsls r0, 24 - movs r1, 0x8C - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x3 - bls _080897C8 - movs r0, 0 - b _080897CA -_080897C8: - movs r0, 0x1 -_080897CA: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsPacifidlogLog - - thumb_func_start is_tile_x8C -is_tile_x8C: @ 80897D0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8C - beq _080897DE - movs r0, 0 - b _080897E0 -_080897DE: - movs r0, 0x1 -_080897E0: - pop {r1} - bx r1 - thumb_func_end is_tile_x8C - - thumb_func_start is_tile_x85 -is_tile_x85: @ 80897E4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x85 - beq _080897F2 - movs r0, 0 - b _080897F4 -_080897F2: - movs r0, 0x1 -_080897F4: - pop {r1} - bx r1 - thumb_func_end is_tile_x85 - - thumb_func_start is_tile_x8B -is_tile_x8B: @ 80897F8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8B - beq _08089806 - movs r0, 0 - b _08089808 -_08089806: - movs r0, 0x1 -_08089808: - pop {r1} - bx r1 - thumb_func_end is_tile_x8B - - thumb_func_start is_tile_xEA -is_tile_xEA: @ 808980C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xEA - beq _0808981A - movs r0, 0 - b _0808981C -_0808981A: - movs r0, 0x1 -_0808981C: - pop {r1} - bx r1 - thumb_func_end is_tile_xEA - - thumb_func_start is_tile_x8A -is_tile_x8A: @ 8089820 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8A - beq _0808982E - movs r0, 0 - b _08089830 -_0808982E: - movs r0, 0x1 -_08089830: - pop {r1} - bx r1 - thumb_func_end is_tile_x8A - - thumb_func_start is_tile_x87 -is_tile_x87: @ 8089834 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x87 - beq _08089842 - movs r0, 0 - b _08089844 -_08089842: - movs r0, 0x1 -_08089844: - pop {r1} - bx r1 - thumb_func_end is_tile_x87 - - thumb_func_start MetatileBehavior_0xBB -@ bool8 MetatileBehavior_0xBB(u8 metatileBehavior) -MetatileBehavior_0xBB: @ 8089848 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xBB - beq _08089856 - movs r0, 0 - b _08089858 -_08089856: - movs r0, 0x1 -_08089858: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_0xBB - - thumb_func_start MetatileBehavior_0xBC -@ bool8 MetatileBehavior_0xBC(u8 metatileBehavior) -MetatileBehavior_0xBC: @ 808985C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xBC - beq _0808986A - movs r0, 0 - b _0808986C -_0808986A: - movs r0, 0x1 -_0808986C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_0xBC - - thumb_func_start sub_8089870 -sub_8089870: @ 8089870 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x29 - beq _0808987E - movs r0, 0 - b _08089880 -_0808987E: - movs r0, 0x1 -_08089880: - pop {r1} - bx r1 - thumb_func_end sub_8089870 - - thumb_func_start is_role_x68 -is_role_x68: @ 8089884 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x68 - beq _08089892 - movs r0, 0 - b _08089894 -_08089892: - movs r0, 0x1 -_08089894: - pop {r1} - bx r1 - thumb_func_end is_role_x68 - - thumb_func_start MetatileBehavior_IsAquaHideoutWarp -MetatileBehavior_IsAquaHideoutWarp: @ 8089898 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x67 - beq _080898A6 - movs r0, 0 - b _080898A8 -_080898A6: - movs r0, 0x1 -_080898A8: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsAquaHideoutWarp - - thumb_func_start sub_80898AC -sub_80898AC: @ 80898AC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x70 - beq _080898BA - movs r0, 0 - b _080898BC -_080898BA: - movs r0, 0x1 -_080898BC: - pop {r1} - bx r1 - thumb_func_end sub_80898AC - - thumb_func_start sub_80898C0 -sub_80898C0: @ 80898C0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE - beq _080898CE - movs r0, 0 - b _080898D0 -_080898CE: - movs r0, 0x1 -_080898D0: - pop {r1} - bx r1 - thumb_func_end sub_80898C0 - - thumb_func_start MetatileBehavior_IsSurfableFishableWater -MetatileBehavior_IsSurfableFishableWater: @ 80898D4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - beq _080898F8 - cmp r0, 0x15 - beq _080898F8 - cmp r0, 0x11 - beq _080898F8 - cmp r0, 0x12 - beq _080898F8 - cmp r0, 0x14 - beq _080898F8 - subs r0, 0x50 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bhi _080898FC -_080898F8: - movs r0, 0x1 - b _080898FE -_080898FC: - movs r0, 0 -_080898FE: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSurfableFishableWater - - thumb_func_start sub_8089904 -sub_8089904: @ 8089904 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xF - beq _08089912 - movs r0, 0 - b _08089914 -_08089912: - movs r0, 0x1 -_08089914: - pop {r1} - bx r1 - thumb_func_end sub_8089904 - - thumb_func_start sub_8089918 -sub_8089918: @ 8089918 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x66 - beq _08089926 - movs r0, 0 - b _08089928 -_08089926: - movs r0, 0x1 -_08089928: - pop {r1} - bx r1 - thumb_func_end sub_8089918 - - thumb_func_start sub_808992C -sub_808992C: @ 808992C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD2 - beq _0808993A - movs r0, 0 - b _0808993C -_0808993A: - movs r0, 0x1 -_0808993C: - pop {r1} - bx r1 - thumb_func_end sub_808992C - - thumb_func_start MetatileBehavior_IsMuddySlope -@ bool8 MetatileBehavior_IsMuddySlope(u8 metatileBehavior) -MetatileBehavior_IsMuddySlope: @ 8089940 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD0 - beq _0808994E - movs r0, 0 - b _08089950 -_0808994E: - movs r0, 0x1 -_08089950: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsMuddySlope - - thumb_func_start MetatileBehavior_IsBumpySlope -MetatileBehavior_IsBumpySlope: @ 8089954 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD1 - beq _08089962 - movs r0, 0 - b _08089964 -_08089962: - movs r0, 0x1 -_08089964: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsBumpySlope - - thumb_func_start MetatileBehavior_IsIsolatedVerticalRail -MetatileBehavior_IsIsolatedVerticalRail: @ 8089968 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD3 - beq _08089976 - movs r0, 0 - b _08089978 -_08089976: - movs r0, 0x1 -_08089978: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsIsolatedVerticalRail - - thumb_func_start MetatileBehavior_IsIsolatedHorizontalRail -MetatileBehavior_IsIsolatedHorizontalRail: @ 808997C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD4 - beq _0808998A - movs r0, 0 - b _0808998C -_0808998A: - movs r0, 0x1 -_0808998C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsIsolatedHorizontalRail - - thumb_func_start MetatileBehavior_IsVerticalRail -MetatileBehavior_IsVerticalRail: @ 8089990 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD5 - beq _0808999E - movs r0, 0 - b _080899A0 -_0808999E: - movs r0, 0x1 -_080899A0: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsVerticalRail - - thumb_func_start MetatileBehavior_IsHorizontalRail -MetatileBehavior_IsHorizontalRail: @ 80899A4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD6 - beq _080899B2 - movs r0, 0 - b _080899B4 -_080899B2: - movs r0, 0x1 -_080899B4: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsHorizontalRail - - thumb_func_start MetatileBehavior_IsSeaweed -MetatileBehavior_IsSeaweed: @ 80899B8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x22 - beq _080899C6 - cmp r0, 0x2A - bne _080899CA -_080899C6: - movs r0, 0x1 - b _080899CC -_080899CA: - movs r0, 0 -_080899CC: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsSeaweed - - thumb_func_start MetatileBehavior_IsRunningDisallowed -MetatileBehavior_IsRunningDisallowed: @ 80899D0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xA - beq _080899EC - cmp r0, 0x3 - beq _080899EC - cmp r0, 0x28 - beq _080899EC - bl MetatileBehavior_IsPacifidlogLog - lsls r0, 24 - cmp r0, 0 - beq _080899F0 -_080899EC: - movs r0, 0x1 - b _080899F2 -_080899F0: - movs r0, 0 -_080899F2: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsRunningDisallowed - - thumb_func_start sub_80899F8 -sub_80899F8: @ 80899F8 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xFE - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0x1 - bls _08089A12 - cmp r1, 0x24 - beq _08089A12 - cmp r1, 0x9 - bne _08089A16 -_08089A12: - movs r0, 0x1 - b _08089A18 -_08089A16: - movs r0, 0 -_08089A18: - pop {r1} - bx r1 - thumb_func_end sub_80899F8 - - thumb_func_start sub_8089A1C -sub_8089A1C: @ 8089A1C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8E - beq _08089A2A - movs r0, 0 - b _08089A2C -_08089A2A: - movs r0, 0x1 -_08089A2C: - pop {r1} - bx r1 - thumb_func_end sub_8089A1C - - thumb_func_start sub_8089A30 -sub_8089A30: @ 8089A30 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE0 - beq _08089A3E - movs r0, 0 - b _08089A40 -_08089A3E: - movs r0, 0x1 -_08089A40: - pop {r1} - bx r1 - thumb_func_end sub_8089A30 - - thumb_func_start sub_8089A44 -sub_8089A44: @ 8089A44 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE1 - beq _08089A52 - movs r0, 0 - b _08089A54 -_08089A52: - movs r0, 0x1 -_08089A54: - pop {r1} - bx r1 - thumb_func_end sub_8089A44 - - thumb_func_start sub_8089A58 -sub_8089A58: @ 8089A58 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE2 - beq _08089A66 - movs r0, 0 - b _08089A68 -_08089A66: - movs r0, 0x1 -_08089A68: - pop {r1} - bx r1 - thumb_func_end sub_8089A58 - - thumb_func_start sub_8089A6C -sub_8089A6C: @ 8089A6C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE3 - beq _08089A7A - movs r0, 0 - b _08089A7C -_08089A7A: - movs r0, 0x1 -_08089A7C: - pop {r1} - bx r1 - thumb_func_end sub_8089A6C - - thumb_func_start sub_8089A80 -sub_8089A80: @ 8089A80 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE4 - beq _08089A8E - movs r0, 0 - b _08089A90 -_08089A8E: - movs r0, 0x1 -_08089A90: - pop {r1} - bx r1 - thumb_func_end sub_8089A80 - - thumb_func_start sub_8089A94 -sub_8089A94: @ 8089A94 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE5 - beq _08089AA2 - movs r0, 0 - b _08089AA4 -_08089AA2: - movs r0, 0x1 -_08089AA4: - pop {r1} - bx r1 - thumb_func_end sub_8089A94 - - thumb_func_start sub_8089AA8 -sub_8089AA8: @ 8089AA8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE6 - beq _08089AB6 - movs r0, 0 - b _08089AB8 -_08089AB6: - movs r0, 0x1 -_08089AB8: - pop {r1} - bx r1 - thumb_func_end sub_8089AA8 - - thumb_func_start sub_8089ABC -sub_8089ABC: @ 8089ABC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD - beq _08089ACA - movs r0, 0 - b _08089ACC -_08089ACA: - movs r0, 0x1 -_08089ACC: - pop {r1} - bx r1 - thumb_func_end sub_8089ABC - - thumb_func_start sub_8089AD0 -sub_8089AD0: @ 8089AD0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x2 - bne _08089AE2 - cmp r0, 0xE8 - beq _08089AE6 -_08089AE2: - movs r0, 0 - b _08089AE8 -_08089AE6: - movs r0, 0x1 -_08089AE8: - pop {r1} - bx r1 - thumb_func_end sub_8089AD0 - - thumb_func_start sub_8089AEC -sub_8089AEC: @ 8089AEC - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x2 - bne _08089AFE - cmp r0, 0xE7 - beq _08089B02 -_08089AFE: - movs r0, 0 - b _08089B04 -_08089B02: - movs r0, 0x1 -_08089B04: - pop {r1} - bx r1 - thumb_func_end sub_8089AEC - - thumb_func_start MetatileBehavior_IsQuestionnaire -MetatileBehavior_IsQuestionnaire: @ 8089B08 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8F - beq _08089B16 - movs r0, 0 - b _08089B18 -_08089B16: - movs r0, 0x1 -_08089B18: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsQuestionnaire - - thumb_func_start MetatileBehavior_IsLongGrass2 -MetatileBehavior_IsLongGrass2: @ 8089B1C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - beq _08089B2A - movs r0, 0 - b _08089B2C -_08089B2A: - movs r0, 0x1 -_08089B2C: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsLongGrass2 - - thumb_func_start MetatileBehavior_IsLongGrassSouthEdge -MetatileBehavior_IsLongGrassSouthEdge: @ 8089B30 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x9 - beq _08089B3E - movs r0, 0 - b _08089B40 -_08089B3E: - movs r0, 0x1 -_08089B40: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsLongGrassSouthEdge - - thumb_func_start MetatileBehavior_IsTrainerHillTimer -MetatileBehavior_IsTrainerHillTimer: @ 8089B44 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE9 - beq _08089B52 - movs r0, 0 - b _08089B54 -_08089B52: - movs r0, 0x1 -_08089B54: - pop {r1} - bx r1 - thumb_func_end MetatileBehavior_IsTrainerHillTimer - - thumb_func_start move_tilemap_camera_to_upper_left_corner_ -@ void move_tilemap_camera_to_upper_left_corner_(struc_28 *a1) -move_tilemap_camera_to_upper_left_corner_: @ 8089B58 - movs r1, 0 - strb r1, [r0, 0x2] - strb r1, [r0, 0x3] - strb r1, [r0] - strb r1, [r0, 0x1] - movs r1, 0x1 - strb r1, [r0, 0x4] - bx lr - thumb_func_end move_tilemap_camera_to_upper_left_corner_ - - thumb_func_start tilemap_move_something -@ void tilemap_move_something(struct struc_28 *, u8 deltaX, u8 deltaY) -tilemap_move_something: @ 8089B68 - ldrb r3, [r0, 0x2] - adds r3, r1 - strb r3, [r0, 0x2] - ldrb r1, [r0, 0x2] - movs r3, 0x1F - ands r1, r3 - strb r1, [r0, 0x2] - ldrb r1, [r0, 0x3] - adds r1, r2 - strb r1, [r0, 0x3] - ldrb r1, [r0, 0x3] - ands r1, r3 - strb r1, [r0, 0x3] - bx lr - thumb_func_end tilemap_move_something - - thumb_func_start coords8_add -@ void coords8_add(struct coords8 *coords, u8 x, u8 y) -coords8_add: @ 8089B84 - ldrb r3, [r0] - adds r3, r1 - strb r3, [r0] - ldrb r1, [r0, 0x1] - adds r1, r2 - strb r1, [r0, 0x1] - bx lr - thumb_func_end coords8_add - - thumb_func_start move_tilemap_camera_to_upper_left_corner -@ void move_tilemap_camera_to_upper_left_corner() -move_tilemap_camera_to_upper_left_corner: @ 8089B94 - push {lr} - ldr r0, =0x03000e20 - bl move_tilemap_camera_to_upper_left_corner_ - pop {r0} - bx r0 - .pool - thumb_func_end move_tilemap_camera_to_upper_left_corner - - thumb_func_start FieldUpdateBgTilemapScroll -@ void FieldUpdateBgTilemapScroll() -FieldUpdateBgTilemapScroll: @ 8089BA4 - push {r4,r5,lr} - ldr r1, =0x03000e20 - ldr r0, =0x03000e28 - movs r2, 0 - ldrsh r5, [r0, r2] - ldrb r0, [r1] - adds r5, r0 - ldr r0, =0x03000e2a - movs r2, 0 - ldrsh r4, [r0, r2] - ldrb r1, [r1, 0x1] - adds r4, r1 - adds r4, 0x8 - lsls r5, 16 - lsrs r5, 16 - movs r0, 0x14 - adds r1, r5, 0 - bl SetGpuReg - lsls r4, 16 - lsrs r4, 16 - movs r0, 0x16 - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x18 - adds r1, r5, 0 - bl SetGpuReg - movs r0, 0x1A - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x1C - adds r1, r5, 0 - bl SetGpuReg - movs r0, 0x1E - adds r1, r4, 0 - bl SetGpuReg - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end FieldUpdateBgTilemapScroll - - thumb_func_start sub_8089C08 -sub_8089C08: @ 8089C08 - push {r4,lr} - ldr r3, =0x03000e20 - ldr r2, =0x03000e28 - ldrh r2, [r2] - ldrb r4, [r3] - adds r2, r4 - strh r2, [r0] - ldr r0, =0x03000e2a - ldrh r0, [r0] - ldrb r3, [r3, 0x1] - adds r0, r3 - adds r0, 0x8 - strh r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8089C08 - - thumb_func_start DrawWholeMapView -@ void DrawWholeMapView() -DrawWholeMapView: @ 8089C34 - push {lr} - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r2, 0 - ldrsh r0, [r1, r2] - movs r2, 0x2 - ldrsh r1, [r1, r2] - ldr r2, =0x02037318 - ldr r2, [r2] - bl DrawWholeMapViewInternal - ldr r1, =0x03000e20 - movs r0, 0x1 - strb r0, [r1, 0x4] - pop {r0} - bx r0 - .pool - thumb_func_end DrawWholeMapView - - thumb_func_start DrawWholeMapViewInternal -@ void DrawWholeMapViewInternal(s32 x, s32 y, struct mapdata_header *mapGrid) -DrawWholeMapViewInternal: @ 8089C60 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r10, r0 - mov r9, r1 - mov r8, r2 - movs r1, 0 -_08089C74: - ldr r2, =0x03000e20 - ldrb r0, [r2, 0x3] - adds r0, r1, r0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1F - bls _08089C88 - subs r0, 0x20 - lsls r0, 24 - lsrs r0, 24 -_08089C88: - lsls r6, r0, 5 - movs r4, 0 - adds r7, r1, 0x2 - str r7, [sp] - lsrs r5, r1, 1 -_08089C92: - ldr r1, =0x03000e20 - ldrb r0, [r1, 0x2] - adds r0, r4, r0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1F - bls _08089CA6 - subs r0, 0x20 - lsls r0, 24 - lsrs r0, 24 -_08089CA6: - adds r1, r6, r0 - lsls r1, 16 - lsrs r1, 16 - lsrs r2, r4, 1 - add r2, r10 - mov r0, r8 - mov r7, r9 - adds r3, r7, r5 - bl DrawMetatileAt - adds r0, r4, 0x2 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1F - bls _08089C92 - ldr r1, [sp] - lsls r0, r1, 24 - lsrs r1, r0, 24 - cmp r1, 0x1F - bls _08089C74 - 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 DrawWholeMapViewInternal - - thumb_func_start RedrawMapSlicesForCameraUpdate -@ void RedrawMapSlicesForCameraUpdate(struct struc_28 *, u8 deltaX, u8 deltaY) -RedrawMapSlicesForCameraUpdate: @ 8089CE4 - push {r4-r7,lr} - adds r5, r0, 0 - adds r6, r1, 0 - adds r7, r2, 0 - ldr r0, =0x02037318 - ldr r4, [r0] - cmp r6, 0 - ble _08089CFC - adds r0, r5, 0 - adds r1, r4, 0 - bl RedrawMapSliceWest -_08089CFC: - cmp r6, 0 - bge _08089D08 - adds r0, r5, 0 - adds r1, r4, 0 - bl RedrawMapSliceEast -_08089D08: - cmp r7, 0 - ble _08089D14 - adds r0, r5, 0 - adds r1, r4, 0 - bl RedrawMapSliceNorth -_08089D14: - cmp r7, 0 - bge _08089D20 - adds r0, r5, 0 - adds r1, r4, 0 - bl RedrawMapSliceSouth -_08089D20: - movs r0, 0x1 - strb r0, [r5, 0x4] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end RedrawMapSlicesForCameraUpdate - - thumb_func_start RedrawMapSliceNorth -@ void RedrawMapSliceNorth(struct struc_28 *, struct mapdata_header *mapGrid) -RedrawMapSliceNorth: @ 8089D30 - push {r4-r7,lr} - adds r5, r0, 0 - adds r7, r1, 0 - ldrb r0, [r5, 0x3] - adds r0, 0x1C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1F - bls _08089D48 - subs r0, 0x20 - lsls r0, 24 - lsrs r0, 24 -_08089D48: - lsls r6, r0, 5 - movs r4, 0 -_08089D4C: - ldrb r0, [r5, 0x2] - adds r0, r4, r0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1F - bls _08089D5E - subs r0, 0x20 - lsls r0, 24 - lsrs r0, 24 -_08089D5E: - adds r1, r6, r0 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =0x03005d8c - ldr r3, [r0] - movs r0, 0 - ldrsh r2, [r3, r0] - lsrs r0, r4, 1 - adds r2, r0 - movs r0, 0x2 - ldrsh r3, [r3, r0] - adds r3, 0xE - adds r0, r7, 0 - bl DrawMetatileAt - adds r0, r4, 0x2 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1F - bls _08089D4C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end RedrawMapSliceNorth - - thumb_func_start RedrawMapSliceSouth -@ void RedrawMapSliceSouth(struct struc_28 *, struct mapdata_header *mapGrid) -RedrawMapSliceSouth: @ 8089D90 - push {r4-r7,lr} - adds r5, r0, 0 - adds r7, r1, 0 - ldrb r0, [r5, 0x3] - lsls r6, r0, 5 - movs r4, 0 -_08089D9C: - ldrb r0, [r5, 0x2] - adds r0, r4, r0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1F - bls _08089DAE - subs r0, 0x20 - lsls r0, 24 - lsrs r0, 24 -_08089DAE: - adds r1, r6, r0 - ldr r0, =0x03005d8c - ldr r3, [r0] - movs r0, 0 - ldrsh r2, [r3, r0] - lsrs r0, r4, 1 - adds r2, r0 - movs r0, 0x2 - ldrsh r3, [r3, r0] - adds r0, r7, 0 - bl DrawMetatileAt - adds r0, r4, 0x2 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1F - bls _08089D9C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end RedrawMapSliceSouth - - thumb_func_start RedrawMapSliceEast -@ void RedrawMapSliceEast(struct struc_28 *, struct mapdata_header *mapGrid) -RedrawMapSliceEast: @ 8089DDC - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - mov r8, r1 - ldrb r6, [r5, 0x2] - movs r4, 0 -_08089DEA: - ldrb r0, [r5, 0x3] - adds r0, r4, r0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1F - bls _08089DFC - subs r0, 0x20 - lsls r0, 24 - lsrs r0, 24 -_08089DFC: - lsls r1, r0, 5 - adds r1, r6 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r3, 0 - ldrsh r2, [r0, r3] - movs r7, 0x2 - ldrsh r3, [r0, r7] - lsrs r0, r4, 1 - adds r3, r0 - mov r0, r8 - bl DrawMetatileAt - adds r0, r4, 0x2 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1F - bls _08089DEA - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end RedrawMapSliceEast - - thumb_func_start RedrawMapSliceWest -@ void RedrawMapSliceWest(struct struc_28 *, struct mapdata_header *mapGrid) -RedrawMapSliceWest: @ 8089E34 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - mov r8, r1 - ldrb r0, [r6, 0x2] - adds r0, 0x1C - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1F - bls _08089E52 - adds r0, r5, 0 - subs r0, 0x20 - lsls r0, 24 - lsrs r5, r0, 24 -_08089E52: - movs r4, 0 -_08089E54: - ldrb r0, [r6, 0x3] - adds r0, r4, r0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1F - bls _08089E66 - subs r0, 0x20 - lsls r0, 24 - lsrs r0, 24 -_08089E66: - lsls r1, r0, 5 - adds r1, r5 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r3, 0 - ldrsh r2, [r0, r3] - adds r2, 0xE - movs r7, 0x2 - ldrsh r3, [r0, r7] - lsrs r0, r4, 1 - adds r3, r0 - mov r0, r8 - bl DrawMetatileAt - adds r0, r4, 0x2 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1F - bls _08089E54 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end RedrawMapSliceWest - - thumb_func_start CurrentMapDrawMetatileAt -@ void CurrentMapDrawMetatileAt(u32 x, u32 y) -CurrentMapDrawMetatileAt: @ 8089EA0 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r6, =0x03000e20 - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl MapPosToBgTilemapOffset - adds r1, r0, 0 - cmp r1, 0 - blt _08089ECC - ldr r0, =0x02037318 - ldr r0, [r0] - lsls r1, 16 - lsrs r1, 16 - adds r2, r4, 0 - adds r3, r5, 0 - bl DrawMetatileAt - movs r0, 0x1 - strb r0, [r6, 0x4] -_08089ECC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end CurrentMapDrawMetatileAt - - thumb_func_start DrawDoorMetatileAt -@ void DrawDoorMetatileAt(u32 x, u32 y, u16 *metatile) -DrawDoorMetatileAt: @ 8089EDC - push {r4-r6,lr} - adds r3, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - ldr r6, =0x03000e20 - adds r0, r6, 0 - adds r1, r3, 0 - adds r2, r4, 0 - bl MapPosToBgTilemapOffset - cmp r0, 0 - blt _08089F04 - lsls r2, r0, 16 - lsrs r2, 16 - movs r0, 0x1 - adds r1, r5, 0 - bl DrawMetatile - movs r0, 0x1 - strb r0, [r6, 0x4] -_08089F04: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end DrawDoorMetatileAt - - thumb_func_start DrawMetatileAt -@ void DrawMetatileAt(struct mapdata_header *mapGrid, u16 offset, s32 x, s32 y) -DrawMetatileAt: @ 8089F10 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - adds r6, r2, 0 - adds r7, r3, 0 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - adds r0, r6, 0 - adds r1, r7, 0 - bl MapGridGetMetatileIdAt - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x80 - lsls r0, 3 - cmp r4, r0 - bls _08089F38 - movs r4, 0 -_08089F38: - ldr r0, =0x000001ff - cmp r4, r0 - bhi _08089F48 - ldr r0, [r5, 0x10] - ldr r5, [r0, 0xC] - b _08089F54 - .pool -_08089F48: - ldr r0, [r5, 0x14] - ldr r5, [r0, 0xC] - ldr r1, =0xfffffe00 - adds r0, r4, r1 - lsls r0, 16 - lsrs r4, r0, 16 -_08089F54: - adds r0, r6, 0 - adds r1, r7, 0 - bl MapGridGetMetatileLayerTypeAt - lsls r0, 24 - lsrs r0, 24 - lsls r1, r4, 4 - adds r1, r5, r1 - mov r2, r8 - bl DrawMetatile - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DrawMetatileAt - - thumb_func_start DrawMetatile -@ void DrawMetatile(u32 layerType, u16 *metatile, u16 offset) -DrawMetatile: @ 8089F78 - push {r4,lr} - adds r4, r1, 0 - lsls r2, 16 - lsrs r2, 16 - cmp r0, 0x1 - beq _08089FD0 - cmp r0, 0x1 - bgt _08089F8E - cmp r0, 0 - beq _0808A030 - b _0808A082 -_08089F8E: - cmp r0, 0x2 - bne _0808A082 - ldr r0, =0x03005da4 - ldr r0, [r0] - lsls r3, r2, 1 - adds r0, r3, r0 - ldrh r1, [r4] - strh r1, [r0] - ldrh r1, [r4, 0x2] - strh r1, [r0, 0x2] - adds r2, r0, 0 - adds r2, 0x40 - ldrh r1, [r4, 0x4] - strh r1, [r2] - adds r0, 0x42 - ldrh r1, [r4, 0x6] - strh r1, [r0] - ldr r0, =0x03005d9c - ldr r0, [r0] - adds r0, r3, r0 - movs r2, 0 - strh r2, [r0] - strh r2, [r0, 0x2] - adds r1, r0, 0 - adds r1, 0x40 - strh r2, [r1] - adds r0, 0x42 - strh r2, [r0] - b _0808A066 - .pool -_08089FD0: - ldr r0, =0x03005da4 - ldr r0, [r0] - lsls r3, r2, 1 - adds r0, r3, r0 - ldrh r1, [r4] - strh r1, [r0] - ldrh r1, [r4, 0x2] - strh r1, [r0, 0x2] - adds r2, r0, 0 - adds r2, 0x40 - ldrh r1, [r4, 0x4] - strh r1, [r2] - adds r0, 0x42 - ldrh r1, [r4, 0x6] - strh r1, [r0] - ldr r0, =0x03005d9c - ldr r0, [r0] - adds r0, r3, r0 - ldrh r1, [r4, 0x8] - strh r1, [r0] - ldrh r1, [r4, 0xA] - strh r1, [r0, 0x2] - adds r2, r0, 0 - adds r2, 0x40 - ldrh r1, [r4, 0xC] - strh r1, [r2] - adds r0, 0x42 - ldrh r1, [r4, 0xE] - strh r1, [r0] - ldr r0, =0x03005da0 - ldr r0, [r0] - adds r3, r0 - movs r1, 0 - strh r1, [r3] - strh r1, [r3, 0x2] - adds r0, r3, 0 - adds r0, 0x40 - strh r1, [r0] - adds r3, 0x42 - strh r1, [r3] - b _0808A082 - .pool -_0808A030: - ldr r0, =0x03005da4 - ldr r0, [r0] - lsls r3, r2, 1 - adds r0, r3, r0 - ldr r1, =0x00003014 - adds r2, r1, 0 - strh r2, [r0] - strh r2, [r0, 0x2] - adds r1, r0, 0 - adds r1, 0x40 - strh r2, [r1] - adds r0, 0x42 - strh r2, [r0] - ldr r0, =0x03005d9c - ldr r0, [r0] - adds r0, r3, r0 - ldrh r1, [r4] - strh r1, [r0] - ldrh r1, [r4, 0x2] - strh r1, [r0, 0x2] - adds r2, r0, 0 - adds r2, 0x40 - ldrh r1, [r4, 0x4] - strh r1, [r2] - adds r0, 0x42 - ldrh r1, [r4, 0x6] - strh r1, [r0] -_0808A066: - ldr r0, =0x03005da0 - ldr r0, [r0] - adds r3, r0 - ldrh r0, [r4, 0x8] - strh r0, [r3] - ldrh r0, [r4, 0xA] - strh r0, [r3, 0x2] - adds r1, r3, 0 - adds r1, 0x40 - ldrh r0, [r4, 0xC] - strh r0, [r1] - adds r3, 0x42 - ldrh r0, [r4, 0xE] - strh r0, [r3] -_0808A082: - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end DrawMetatile - - thumb_func_start MapPosToBgTilemapOffset -@ u32 MapPosToBgTilemapOffset(struct struc_28 *, u32 x, u32 y) -MapPosToBgTilemapOffset: @ 808A0AC - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, =0x03005d8c - ldr r3, [r0] - movs r5, 0 - ldrsh r0, [r3, r5] - subs r1, r0 - lsls r1, 1 - cmp r1, 0x1F - bhi _0808A0D6 - ldrb r0, [r4, 0x2] - adds r1, r0 - cmp r1, 0x1F - ble _0808A0CA - subs r1, 0x20 -_0808A0CA: - movs r5, 0x2 - ldrsh r0, [r3, r5] - subs r0, r2, r0 - lsls r2, r0, 1 - cmp r2, 0x1F - bls _0808A0E0 -_0808A0D6: - movs r0, 0x1 - negs r0, r0 - b _0808A0EE - .pool -_0808A0E0: - ldrb r0, [r4, 0x3] - adds r2, r0 - cmp r2, 0x1F - ble _0808A0EA - subs r2, 0x20 -_0808A0EA: - lsls r0, r2, 5 - adds r0, r1 -_0808A0EE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end MapPosToBgTilemapOffset - - thumb_func_start CameraUpdateCallback -@ void CameraUpdateCallback(struct CameraUpdateInfo *info) -CameraUpdateCallback: @ 808A0F4 - push {lr} - adds r3, r0, 0 - ldr r2, [r3, 0x4] - cmp r2, 0 - beq _0808A114 - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r2, 0x32 - ldrsh r1, [r0, r2] - str r1, [r3, 0x8] - movs r1, 0x34 - ldrsh r0, [r0, r1] - str r0, [r3, 0xC] -_0808A114: - pop {r0} - bx r0 - .pool - thumb_func_end CameraUpdateCallback - - thumb_func_start ResetCameraUpdateInfo -@ void ResetCameraUpdateInfo() -ResetCameraUpdateInfo: @ 808A11C - ldr r1, =0x03005dd0 - movs r0, 0 - str r0, [r1, 0x8] - str r0, [r1, 0xC] - str r0, [r1, 0x10] - str r0, [r1, 0x14] - str r0, [r1, 0x4] - str r0, [r1] - bx lr - .pool - thumb_func_end ResetCameraUpdateInfo - - thumb_func_start InitCameraUpdateCallback -@ u8 InitCameraUpdateCallback(u8 followedObjectId) -InitCameraUpdateCallback: @ 808A134 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x03005dd0 - ldr r1, [r4, 0x4] - cmp r1, 0 - beq _0808A150 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles -_0808A150: - adds r0, r5, 0 - bl AddCameraObject - lsls r0, 24 - lsrs r0, 24 - str r0, [r4, 0x4] - ldr r0, =CameraUpdateCallback - str r0, [r4] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end InitCameraUpdateCallback - - thumb_func_start CameraUpdate -@ void CameraUpdate() -CameraUpdate: @ 808A174 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r6, =0x03005dd0 - ldr r1, [r6] - cmp r1, 0 - beq _0808A188 - adds r0, r6, 0 - bl _call_via_r1 -_0808A188: - ldr r7, [r6, 0x8] - ldr r0, [r6, 0xC] - mov r8, r0 - movs r4, 0 - movs r5, 0 - ldr r1, [r6, 0x10] - ldr r0, [r6, 0x14] - cmp r1, 0 - bne _0808A1A6 - cmp r7, 0 - beq _0808A1A6 - subs r4, 0x1 - cmp r7, 0 - ble _0808A1A6 - movs r4, 0x1 -_0808A1A6: - cmp r0, 0 - bne _0808A1BA - mov r2, r8 - cmp r2, 0 - beq _0808A1BA - movs r5, 0x1 - negs r5, r5 - cmp r2, 0 - ble _0808A1BA - movs r5, 0x1 -_0808A1BA: - cmp r1, 0 - beq _0808A1CC - cmn r1, r7 - bne _0808A1CC - movs r4, 0x1 - negs r4, r4 - cmp r7, 0 - ble _0808A1CC - movs r4, 0x1 -_0808A1CC: - cmp r0, 0 - beq _0808A1E0 - mov r3, r8 - cmn r0, r3 - bne _0808A1E0 - movs r4, 0x1 - negs r4, r4 - cmp r3, 0 - ble _0808A1E0 - movs r4, 0x1 -_0808A1E0: - ldr r2, =0x03005dd0 - ldr r0, [r2, 0x10] - adds r1, r0, r7 - str r1, [r2, 0x10] - adds r0, r1, 0 - cmp r1, 0 - bge _0808A1F0 - adds r0, 0xF -_0808A1F0: - asrs r0, 4 - lsls r0, 4 - subs r0, r1, r0 - str r0, [r2, 0x10] - ldr r0, [r2, 0x14] - mov r3, r8 - adds r1, r0, r3 - str r1, [r2, 0x14] - adds r0, r1, 0 - cmp r1, 0 - bge _0808A208 - adds r0, 0xF -_0808A208: - asrs r0, 4 - lsls r0, 4 - subs r0, r1, r0 - str r0, [r2, 0x14] - cmp r4, 0 - bne _0808A218 - cmp r5, 0 - beq _0808A24E -_0808A218: - adds r0, r4, 0 - adds r1, r5, 0 - bl CameraMove - adds r0, r4, 0 - adds r1, r5, 0 - bl UpdateFieldObjectsForCameraUpdate - adds r0, r4, 0 - adds r1, r5, 0 - bl RotatingGatePuzzleCameraUpdate - bl ResetBerryTreeSparkleFlags - ldr r6, =0x03000e20 - lsls r4, 1 - lsls r5, 1 - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl tilemap_move_something - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl RedrawMapSlicesForCameraUpdate -_0808A24E: - ldr r0, =0x03000e20 - adds r1, r7, 0 - mov r2, r8 - bl coords8_add - ldr r1, =0x03005dec - ldrh r0, [r1] - subs r0, r7 - strh r0, [r1] - ldr r1, =0x03005de8 - ldrh r0, [r1] - mov r2, r8 - subs r0, r2 - strh r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end CameraUpdate - - thumb_func_start sub_808A284 -sub_808A284: @ 808A284 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl CameraMove - lsls r0, r4, 16 - asrs r0, 16 - lsls r1, r5, 16 - asrs r1, 16 - bl UpdateFieldObjectsForCameraUpdate - bl DrawWholeMapView - ldr r1, =0x03005dec - lsls r4, 4 - ldrh r0, [r1] - subs r0, r4 - strh r0, [r1] - ldr r1, =0x03005de8 - lsls r5, 4 - ldrh r0, [r1] - subs r0, r5 - strh r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808A284 - - thumb_func_start SetCameraPanningCallback -@ void SetCameraPanningCallback(void ( *callback)()) -SetCameraPanningCallback: @ 808A2C0 - ldr r1, =0x03000e30 - str r0, [r1] - bx lr - .pool - thumb_func_end SetCameraPanningCallback - - thumb_func_start SetCameraPanning -@ void SetCameraPanning(s16 x, s16 y) -SetCameraPanning: @ 808A2CC - ldr r2, =0x03000e28 - strh r0, [r2] - ldr r0, =0x03000e2a - lsls r1, 16 - asrs r1, 16 - adds r1, 0x20 - strh r1, [r0] - bx lr - .pool - thumb_func_end SetCameraPanning - - thumb_func_start InstallCameraPanAheadCallback -@ void InstallCameraPanAheadCallback() -InstallCameraPanAheadCallback: @ 808A2E4 - ldr r1, =0x03000e30 - ldr r0, =CameraPanningCB_PanAhead - str r0, [r1] - ldr r1, =0x03000e2c - movs r0, 0 - strb r0, [r1] - ldr r1, =0x03000e28 - movs r0, 0 - strh r0, [r1] - ldr r1, =0x03000e2a - movs r0, 0x20 - strh r0, [r1] - bx lr - .pool - thumb_func_end InstallCameraPanAheadCallback - - thumb_func_start UpdateCameraPanning -@ void UpdateCameraPanning() -UpdateCameraPanning: @ 808A314 - push {lr} - ldr r0, =0x03000e30 - ldr r0, [r0] - cmp r0, 0 - beq _0808A322 - bl _call_via_r0 -_0808A322: - ldr r2, =0x02021bbc - ldr r0, =0x03005dec - ldr r1, =0x03000e28 - ldrh r0, [r0] - ldrh r1, [r1] - subs r0, r1 - strh r0, [r2] - ldr r2, =0x02021bbe - ldr r0, =0x03005de8 - ldr r1, =0x03000e2a - ldrh r0, [r0] - ldrh r1, [r1] - subs r0, r1 - subs r0, 0x8 - strh r0, [r2] - pop {r0} - bx r0 - .pool - thumb_func_end UpdateCameraPanning - - thumb_func_start CameraPanningCB_PanAhead -@ void CameraPanningCB_PanAhead() -CameraPanningCB_PanAhead: @ 808A360 - push {lr} - ldr r0, =0x02037348 - ldrb r0, [r0] - cmp r0, 0 - bne _0808A374 - bl InstallCameraPanAheadCallback - b _0808A3FC - .pool -_0808A374: - ldr r0, =0x02037590 - ldrb r0, [r0, 0x3] - cmp r0, 0x1 - bne _0808A394 - ldr r0, =0x03000e2c - ldrb r1, [r0] - movs r2, 0x1 - eors r1, r2 - strb r1, [r0] - cmp r1, 0 - beq _0808A3FC - b _0808A39A - .pool -_0808A394: - ldr r1, =0x03000e2c - movs r0, 0 - strb r0, [r1] -_0808A39A: - bl player_get_direction_upper_nybble - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0808A3C4 - ldr r2, =0x03000e2a - ldrh r3, [r2] - movs r0, 0 - ldrsh r1, [r2, r0] - movs r0, 0x8 - negs r0, r0 - cmp r1, r0 - ble _0808A3FC - subs r0, r3, 0x2 - b _0808A3FA - .pool -_0808A3C4: - cmp r0, 0x1 - bne _0808A3E0 - ldr r1, =0x03000e2a - ldrh r2, [r1] - movs r3, 0 - ldrsh r0, [r1, r3] - cmp r0, 0x47 - bgt _0808A3FC - adds r0, r2, 0x2 - strh r0, [r1] - b _0808A3FC - .pool -_0808A3E0: - ldr r2, =0x03000e2a - ldrh r0, [r2] - movs r3, 0 - ldrsh r1, [r2, r3] - cmp r1, 0x1F - bgt _0808A3F4 - adds r0, 0x2 - b _0808A3FA - .pool -_0808A3F4: - cmp r1, 0x20 - ble _0808A3FC - subs r0, 0x2 -_0808A3FA: - strh r0, [r2] -_0808A3FC: - pop {r0} - bx r0 - thumb_func_end CameraPanningCB_PanAhead - - thumb_func_start sub_808A400 -sub_808A400: @ 808A400 - push {lr} - adds r2, r0, 0 - ldrb r0, [r2, 0x3] - cmp r0, 0x2 - bne _0808A420 - ldrh r1, [r1, 0x2] - ldr r0, [r2, 0x4] - adds r0, r1 - ldr r1, =0x06007e00 - movs r2, 0x80 - bl CpuFastSet - b _0808A42E - .pool -_0808A420: - ldrh r1, [r1, 0x2] - ldr r0, [r2, 0x4] - adds r0, r1 - ldr r1, =0x06007f00 - movs r2, 0x40 - bl CpuFastSet -_0808A42E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_808A400 - - thumb_func_start door_build_blockdef -door_build_blockdef: @ 808A438 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - movs r4, 0 - adds r1, r6, 0 -_0808A444: - ldrb r0, [r2] - lsls r0, 28 - lsrs r3, r0, 16 - adds r2, 0x1 - adds r0, r5, r4 - orrs r3, r0 - strh r3, [r1] - adds r1, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _0808A444 - cmp r4, 0x7 - bgt _0808A472 - lsls r0, r4, 1 - adds r1, r0, r6 -_0808A462: - ldrb r0, [r2] - lsls r3, r0, 12 - adds r2, 0x1 - strh r3, [r1] - adds r1, 0x2 - adds r4, 0x1 - cmp r4, 0x7 - ble _0808A462 -_0808A472: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end door_build_blockdef - - thumb_func_start door_patch_tilemap -door_patch_tilemap: @ 808A478 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x30 - adds r7, r1, 0 - mov r9, r2 - adds r5, r3, 0 - ldrb r0, [r0, 0x3] - cmp r0, 0x2 - bne _0808A4F4 - add r4, sp, 0x10 - movs r1, 0xFC - lsls r1, 2 - adds r0, r4, 0 - adds r2, r5, 0 - bl door_build_blockdef - mov r6, r9 - subs r6, 0x1 - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r4, 0 - bl DrawDoorMetatileAt - movs r1, 0xFD - lsls r1, 2 - adds r0, r5, 0x4 - mov r8, r0 - adds r0, r4, 0 - mov r2, r8 - bl door_build_blockdef - adds r0, r7, 0 - mov r1, r9 - adds r2, r4, 0 - bl DrawDoorMetatileAt - movs r1, 0xFE - lsls r1, 2 - adds r0, r4, 0 - adds r2, r5, 0 - bl door_build_blockdef - adds r5, r7, 0x1 - adds r0, r5, 0 - adds r1, r6, 0 - adds r2, r4, 0 - bl DrawDoorMetatileAt - movs r1, 0xFF - lsls r1, 2 - adds r0, r4, 0 - mov r2, r8 - bl door_build_blockdef - adds r0, r5, 0 - mov r1, r9 - adds r2, r4, 0 - bl DrawDoorMetatileAt - b _0808A522 -_0808A4F4: - movs r1, 0xFE - lsls r1, 2 - mov r0, sp - adds r2, r5, 0 - bl door_build_blockdef - mov r1, r9 - subs r1, 0x1 - adds r0, r7, 0 - mov r2, sp - bl DrawDoorMetatileAt - movs r1, 0xFF - lsls r1, 2 - adds r2, r5, 0x4 - mov r0, sp - bl door_build_blockdef - adds r0, r7, 0 - mov r1, r9 - mov r2, sp - bl DrawDoorMetatileAt -_0808A522: - add sp, 0x30 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end door_patch_tilemap - - thumb_func_start sub_808A530 -sub_808A530: @ 808A530 - push {r4-r7,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - subs r7, r6, 0x1 - adds r0, r5, 0 - adds r1, r7, 0 - bl CurrentMapDrawMetatileAt - adds r0, r5, 0 - adds r1, r6, 0 - bl CurrentMapDrawMetatileAt - ldrb r0, [r4, 0x3] - cmp r0, 0x2 - bne _0808A562 - adds r4, r5, 0x1 - adds r0, r4, 0 - adds r1, r7, 0 - bl CurrentMapDrawMetatileAt - adds r0, r4, 0 - adds r1, r6, 0 - bl CurrentMapDrawMetatileAt -_0808A562: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_808A530 - - thumb_func_start sub_808A568 -sub_808A568: @ 808A568 - push {r4-r7,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - adds r7, r3, 0 - ldrh r1, [r5, 0x2] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _0808A5B0 - adds r0, r4, 0 - adds r1, r6, 0 - adds r2, r7, 0 - bl sub_808A530 - bl sub_808A964 - lsls r0, 24 - cmp r0, 0 - beq _0808A5E2 - ldr r0, =0x020375e0 - ldrh r1, [r0] - adds r1, 0x7 - ldr r0, =0x020375e2 - ldrh r2, [r0] - adds r2, 0x7 - adds r0, r4, 0 - bl sub_808A530 - b _0808A5E2 - .pool -_0808A5B0: - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_808A400 - ldr r3, [r4, 0x8] - adds r0, r4, 0 - adds r1, r6, 0 - adds r2, r7, 0 - bl door_patch_tilemap - bl sub_808A964 - lsls r0, 24 - cmp r0, 0 - beq _0808A5E2 - ldr r0, =0x020375e0 - ldrh r1, [r0] - adds r1, 0x7 - ldr r0, =0x020375e2 - ldrh r2, [r0] - adds r2, 0x7 - ldr r3, [r4, 0x8] - adds r0, r4, 0 - bl door_patch_tilemap -_0808A5E2: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808A568 - - thumb_func_start sub_808A5F0 -sub_808A5F0: @ 808A5F0 - push {r4-r6,lr} - adds r6, r0, 0 - adds r5, r1, 0 - adds r4, r2, 0 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0808A616 - movs r2, 0x8 - ldrsh r1, [r4, r2] - lsls r1, 2 - adds r1, r5, r1 - movs r0, 0xC - ldrsh r2, [r4, r0] - movs r0, 0xE - ldrsh r3, [r4, r0] - adds r0, r6, 0 - bl sub_808A568 -_0808A616: - movs r2, 0xA - ldrsh r1, [r4, r2] - movs r2, 0x8 - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0] - cmp r1, r0 - bne _0808A644 - movs r0, 0 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0] - cmp r0, 0 - bne _0808A64A - movs r0, 0 - b _0808A64C -_0808A644: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] -_0808A64A: - movs r0, 0x1 -_0808A64C: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_808A5F0 - - thumb_func_start task50_overworld_door -task50_overworld_door: @ 808A654 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r2, r4, 2 - adds r2, r4 - lsls r2, 3 - ldr r0, =0x03005e08 - adds r2, r0 - ldrh r1, [r2] - lsls r1, 16 - ldrh r0, [r2, 0x2] - orrs r1, r0 - ldrh r0, [r2, 0x4] - lsls r0, 16 - ldrh r3, [r2, 0x6] - orrs r0, r3 - bl sub_808A5F0 - cmp r0, 0 - bne _0808A682 - adds r0, r4, 0 - bl DestroyTask -_0808A682: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task50_overworld_door - - thumb_func_start door_frame_last -door_frame_last: @ 808A68C - push {lr} - adds r1, r0, 0 - b _0808A694 -_0808A692: - adds r1, 0x4 -_0808A694: - ldrb r0, [r1] - cmp r0, 0 - bne _0808A692 - subs r0, r1, 0x4 - pop {r1} - bx r1 - thumb_func_end door_frame_last - - thumb_func_start door_find -door_find: @ 808A6A0 - push {lr} - adds r2, r0, 0 - lsls r1, 16 - lsrs r1, 16 - b _0808A6B6 -_0808A6AA: - ldrh r0, [r2] - cmp r0, r1 - bne _0808A6B4 - adds r0, r2, 0 - b _0808A6BE -_0808A6B4: - adds r2, 0xC -_0808A6B6: - ldr r0, [r2, 0x4] - cmp r0, 0 - bne _0808A6AA - movs r0, 0 -_0808A6BE: - pop {r1} - bx r1 - thumb_func_end door_find - - thumb_func_start task_overworld_door_add_if_inactive -task_overworld_door_add_if_inactive: @ 808A6C4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - adds r5, r1, 0 - adds r7, r2, 0 - mov r8, r3 - ldr r4, =task50_overworld_door - adds r0, r4, 0 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0808A718 - adds r0, r4, 0 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r2, =0x03005e08 - adds r1, r2 - strh r7, [r1, 0xC] - mov r2, r8 - strh r2, [r1, 0xE] - strh r5, [r1, 0x2] - lsrs r2, r5, 16 - strh r2, [r1] - strh r6, [r1, 0x6] - lsrs r2, r6, 16 - strh r2, [r1, 0x4] - lsls r0, 24 - asrs r0, 24 - b _0808A71C - .pool -_0808A718: - movs r0, 0x1 - negs r0, r0 -_0808A71C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end task_overworld_door_add_if_inactive - - thumb_func_start sub_808A728 -sub_808A728: @ 808A728 - push {lr} - bl sub_808A530 - pop {r0} - bx r0 - thumb_func_end sub_808A728 - - thumb_func_start sub_808A734 -sub_808A734: @ 808A734 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - adds r0, r5, 0 - adds r1, r6, 0 - bl MapGridGetMetatileIdAt - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl door_find - adds r4, r0, 0 - cmp r4, 0 - beq _0808A76A - ldr r1, =gUnknown_08496F8C - adds r0, r1, 0 - bl door_frame_last - adds r1, r0, 0 - adds r0, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl sub_808A568 -_0808A76A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808A734 - - thumb_func_start task_overworld_door_add_for_opening_door_at -@ s32 task_overworld_door_add_for_opening_door_at(void *a1, s32 x, s32 y) -task_overworld_door_add_for_opening_door_at: @ 808A774 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - adds r0, r5, 0 - adds r1, r6, 0 - bl MapGridGetMetatileIdAt - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl door_find - adds r2, r0, 0 - adds r4, r2, 0 - cmp r2, 0 - bne _0808A79E - movs r0, 0x1 - negs r0, r0 - b _0808A7C0 -_0808A79E: - ldrb r0, [r2, 0x3] - cmp r0, 0x2 - beq _0808A7B0 - ldr r1, =gUnknown_08496F8C - adds r0, r2, 0 - b _0808A7B4 - .pool -_0808A7B0: - ldr r1, =gUnknown_08496FB4 - adds r0, r4, 0 -_0808A7B4: - adds r2, r5, 0 - adds r3, r6, 0 - bl task_overworld_door_add_if_inactive - lsls r0, 24 - asrs r0, 24 -_0808A7C0: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end task_overworld_door_add_for_opening_door_at - - thumb_func_start sub_808A7CC -sub_808A7CC: @ 808A7CC - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - adds r0, r5, 0 - adds r1, r6, 0 - bl MapGridGetMetatileIdAt - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl door_find - cmp r0, 0 - beq _0808A800 - ldr r1, =gUnknown_08496FA0 - adds r2, r5, 0 - adds r3, r6, 0 - bl task_overworld_door_add_if_inactive - lsls r0, 24 - asrs r0, 24 - b _0808A804 - .pool -_0808A800: - movs r0, 0x1 - negs r0, r0 -_0808A804: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_808A7CC - - thumb_func_start cur_mapdata_get_door_x2_at -cur_mapdata_get_door_x2_at: @ 808A80C - push {r4,lr} - adds r4, r0, 0 - adds r0, r1, 0 - adds r1, r2, 0 - bl MapGridGetMetatileIdAt - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl door_find - cmp r0, 0 - beq _0808A830 - ldrb r0, [r0, 0x2] - lsls r0, 24 - asrs r0, 24 - b _0808A834 -_0808A830: - movs r0, 0x1 - negs r0, r0 -_0808A834: - pop {r4} - pop {r1} - bx r1 - thumb_func_end cur_mapdata_get_door_x2_at - - thumb_func_start sub_808A83C -sub_808A83C: @ 808A83C - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - ldr r0, =gUnknown_08497174 - adds r1, r3, 0 - bl task_overworld_door_add_for_opening_door_at - pop {r0} - bx r0 - .pool - thumb_func_end sub_808A83C - - thumb_func_start sub_808A854 -sub_808A854: @ 808A854 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl sub_8088EFC - lsls r0, 24 - cmp r0, 0 - beq _0808A876 - ldr r0, =gUnknown_08497174 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_808A734 -_0808A876: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808A854 - - thumb_func_start sub_808A880 -sub_808A880: @ 808A880 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl sub_8088EFC - lsls r0, 24 - cmp r0, 0 - beq _0808A8A2 - ldr r0, =gUnknown_08497174 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_808A728 -_0808A8A2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808A880 - - thumb_func_start sub_808A8AC -sub_808A8AC: @ 808A8AC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl sub_8088EFC - lsls r0, 24 - cmp r0, 0 - beq _0808A8D8 - ldr r0, =gUnknown_08497174 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_808A7CC - lsls r0, 24 - asrs r0, 24 - b _0808A8DC - .pool -_0808A8D8: - movs r0, 0x1 - negs r0, r0 -_0808A8DC: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808A8AC - - thumb_func_start task_overworld_door_add_if_role_69_for_opening_door_at -task_overworld_door_add_if_role_69_for_opening_door_at: @ 808A8E4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl sub_8088EFC - lsls r0, 24 - cmp r0, 0 - beq _0808A910 - ldr r0, =gUnknown_08497174 - adds r1, r4, 0 - adds r2, r5, 0 - bl task_overworld_door_add_for_opening_door_at - lsls r0, 24 - asrs r0, 24 - b _0808A914 - .pool -_0808A910: - movs r0, 0x1 - negs r0, r0 -_0808A914: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end task_overworld_door_add_if_role_69_for_opening_door_at - - thumb_func_start sub_808A91C -sub_808A91C: @ 808A91C - push {lr} - ldr r0, =task50_overworld_door - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_808A91C - - thumb_func_start cur_mapdata_get_door_sound_at -cur_mapdata_get_door_sound_at: @ 808A930 - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - ldr r0, =gUnknown_08497174 - adds r1, r3, 0 - bl cur_mapdata_get_door_x2_at - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - beq _0808A958 - cmp r0, 0x1 - bne _0808A954 - movs r0, 0x12 - b _0808A95E - .pool -_0808A954: - cmp r0, 0x2 - beq _0808A95C -_0808A958: - movs r0, 0x8 - b _0808A95E -_0808A95C: - movs r0, 0x2F -_0808A95E: - pop {r1} - bx r1 - thumb_func_end cur_mapdata_get_door_sound_at - - thumb_func_start sub_808A964 -sub_808A964: @ 808A964 - push {lr} - ldr r0, =0x00004002 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0808A990 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - ldr r0, =0x0000101a - cmp r1, r0 - bne _0808A990 - movs r0, 0x1 - b _0808A992 - .pool -_0808A990: - movs r0, 0 -_0808A992: - pop {r1} - bx r1 - thumb_func_end sub_808A964 - - thumb_func_start FieldObjectCB_NoMovement2 -@ void FieldObjectCB_NoMovement2(struct obj *object) -FieldObjectCB_NoMovement2: @ 808A998 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =FieldObjectCB2_NoMovement2 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_NoMovement2 - - thumb_func_start FieldObjectCB2_NoMovement2 -FieldObjectCB2_NoMovement2: @ 808A9BC - movs r0, 0 - bx lr - thumb_func_end FieldObjectCB2_NoMovement2 - - thumb_func_start player_step -@ void player_step(int dpad_direction, int buttons_new, int buttons_held) -player_step: @ 808A9C0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 16 - lsrs r6, r2, 16 - ldr r4, =0x02037590 - ldrb r1, [r4, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r5, r0, r1 - adds r0, r5, 0 - bl sub_808C280 - ldrb r0, [r4, 0x6] - cmp r0, 0 - bne _0808AA26 - adds r0, r7, 0 - adds r1, r6, 0 - bl sub_8119C3C - adds r0, r5, 0 - mov r1, r8 - bl TryInterruptFieldObjectSpecialAnim - lsls r0, 24 - cmp r0, 0 - bne _0808AA26 - adds r0, r5, 0 - bl npc_clear_strange_bits - bl DoPlayerAvatarTransition - bl TryDoMetatileBehaviorForcedMovment - lsls r0, 24 - cmp r0, 0 - bne _0808AA26 - mov r0, r8 - adds r1, r7, 0 - adds r2, r6, 0 - bl MovePlayerAvatarUsingKeypadInput - bl PlayerAllowForcedMovementIfMovingSameDirection -_0808AA26: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end player_step - - thumb_func_start TryInterruptFieldObjectSpecialAnim -@ bool8 TryInterruptFieldObjectSpecialAnim(struct npc_state *fieldObject, u8 direction) -TryInterruptFieldObjectSpecialAnim: @ 808AA38 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - adds r6, r5, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _0808AA92 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - bne _0808AA92 - adds r0, r4, 0 - bl FieldObjectGetSpecialAnim - lsls r0, 24 - movs r1, 0xE7 - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x3 - bhi _0808AA70 - cmp r5, 0 - bne _0808AA74 -_0808AA70: - movs r0, 0x1 - b _0808AA94 -_0808AA74: - ldrb r0, [r4, 0x18] - lsrs r0, 4 - cmp r0, r5 - beq _0808AA84 -_0808AA7C: - adds r0, r4, 0 - bl FieldObjectClearAnim - b _0808AA92 -_0808AA84: - adds r0, r6, 0 - bl sub_808B028 - lsls r0, 24 - cmp r0, 0 - beq _0808AA7C - b _0808AA70 -_0808AA92: - movs r0, 0 -_0808AA94: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end TryInterruptFieldObjectSpecialAnim - - thumb_func_start npc_clear_strange_bits -@ void npc_clear_strange_bits(struct npc_state *fieldObject) -npc_clear_strange_bits: @ 808AA9C - ldrb r2, [r0, 0x1] - movs r1, 0x11 - negs r1, r1 - ands r1, r2 - movs r2, 0x5 - negs r2, r2 - ands r1, r2 - adds r2, 0x2 - ands r1, r2 - strb r1, [r0, 0x1] - ldr r2, =0x02037590 - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - bx lr - .pool - thumb_func_end npc_clear_strange_bits - - thumb_func_start MovePlayerAvatarUsingKeypadInput -@ void MovePlayerAvatarUsingKeypadInput(int dpad_direction, int buttons_new, int buttons_held) -MovePlayerAvatarUsingKeypadInput: @ 808AAC0 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 16 - lsrs r2, 16 - ldr r0, =0x02037590 - ldrb r1, [r0] - movs r0, 0x6 - ands r0, r1 - cmp r0, 0 - beq _0808AAE8 - adds r0, r3, 0 - adds r1, r4, 0 - bl MovePlayerOnBike - b _0808AAF0 - .pool -_0808AAE8: - adds r0, r3, 0 - adds r1, r2, 0 - bl MovePlayerNotOnBike -_0808AAF0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end MovePlayerAvatarUsingKeypadInput - - thumb_func_start PlayerAllowForcedMovementIfMovingSameDirection -@ void PlayerAllowForcedMovementIfMovingSameDirection() -PlayerAllowForcedMovementIfMovingSameDirection: @ 808AAF8 - push {lr} - ldr r2, =0x02037590 - ldrb r0, [r2, 0x2] - cmp r0, 0x2 - bne _0808AB0A - ldrb r1, [r2] - movs r0, 0xDF - ands r0, r1 - strb r0, [r2] -_0808AB0A: - pop {r0} - bx r0 - .pool - thumb_func_end PlayerAllowForcedMovementIfMovingSameDirection - - thumb_func_start TryDoMetatileBehaviorForcedMovment -@ bool8 TryDoMetatileBehaviorForcedMovment() -TryDoMetatileBehaviorForcedMovment: @ 808AB14 - push {r4,lr} - ldr r4, =gUnknown_08497444 - bl GetForcedMovementByMetatileBehavior - lsls r0, 24 - lsrs r0, 22 - adds r0, r4 - ldr r0, [r0] - bl _call_via_r0 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end TryDoMetatileBehaviorForcedMovment - - thumb_func_start GetForcedMovementByMetatileBehavior -@ u8 GetForcedMovementByMetatileBehavior() -GetForcedMovementByMetatileBehavior: @ 808AB38 - push {r4-r6,lr} - ldr r3, =0x02037590 - ldrb r1, [r3] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _0808AB8A - ldr r2, =0x02037350 - ldrb r1, [r3, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r5, [r0, 0x1E] - movs r4, 0 - ldr r6, =gUnknown_084973FC -_0808AB58: - lsls r0, r4, 2 - adds r0, r6 - ldr r1, [r0] - adds r0, r5, 0 - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - beq _0808AB80 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r0, 24 - b _0808AB8C - .pool -_0808AB80: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x11 - bls _0808AB58 -_0808AB8A: - movs r0, 0 -_0808AB8C: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end GetForcedMovementByMetatileBehavior - - thumb_func_start ForcedMovement_None -ForcedMovement_None: @ 808AB94 - push {r4,lr} - ldr r4, =0x02037590 - ldrb r1, [r4] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0808ABCE - ldrb r1, [r4, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldrb r2, [r0, 0x1] - movs r1, 0x3 - negs r1, r1 - ands r1, r2 - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0, 0x1] - ldrb r1, [r0, 0x18] - lsls r1, 28 - lsrs r1, 28 - bl FieldObjectSetDirection - ldrb r1, [r4] - movs r0, 0xBF - ands r0, r1 - strb r0, [r4] -_0808ABCE: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_None - - thumb_func_start DoForcedMovement -DoForcedMovement: @ 808ABE0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r9, r1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r6, =0x02037590 - adds r0, r5, 0 - bl CheckForPlayerAvatarCollision - lsls r0, 24 - lsrs r4, r0, 24 - adds r7, r4, 0 - ldrb r0, [r6] - movs r1, 0x40 - mov r10, r1 - movs r1, 0 - mov r8, r1 - mov r1, r10 - orrs r0, r1 - strb r0, [r6] - cmp r4, 0 - beq _0808AC3C - bl ForcedMovement_None - cmp r4, 0x4 - bhi _0808AC24 - movs r0, 0 - b _0808AC48 - .pool -_0808AC24: - cmp r7, 0x6 - bne _0808AC2E - adds r0, r5, 0 - bl PlayerJumpLedge -_0808AC2E: - ldrb r0, [r6] - mov r1, r10 - orrs r0, r1 - strb r0, [r6] - movs r0, 0x2 - strb r0, [r6, 0x2] - b _0808AC46 -_0808AC3C: - movs r0, 0x2 - strb r0, [r6, 0x2] - adds r0, r5, 0 - bl _call_via_r9 -_0808AC46: - movs r0, 0x1 -_0808AC48: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end DoForcedMovement - - thumb_func_start DoForcedMovementInCurrentDirection -DoForcedMovementInCurrentDirection: @ 808AC58 - push {lr} - adds r1, r0, 0 - ldr r0, =0x02037590 - ldrb r2, [r0, 0x5] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldrb r2, [r0, 0x1] - movs r3, 0x4 - orrs r2, r3 - strb r2, [r0, 0x1] - ldrb r0, [r0, 0x18] - lsrs r0, 4 - bl DoForcedMovement - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end DoForcedMovementInCurrentDirection - - thumb_func_start ForcedMovement_Slip -ForcedMovement_Slip: @ 808AC8C - push {lr} - ldr r0, =PlayerGoSpeed1 - bl DoForcedMovementInCurrentDirection - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_Slip - - thumb_func_start ForcedMovement_WalkSouth -ForcedMovement_WalkSouth: @ 808ACA0 - push {lr} - ldr r1, =PlayerGoSpeed0 - movs r0, 0x1 - bl DoForcedMovement - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_WalkSouth - - thumb_func_start ForcedMovement_WalkNorth -ForcedMovement_WalkNorth: @ 808ACB8 - push {lr} - ldr r1, =PlayerGoSpeed0 - movs r0, 0x2 - bl DoForcedMovement - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_WalkNorth - - thumb_func_start ForcedMovement_WalkWest -ForcedMovement_WalkWest: @ 808ACD0 - push {lr} - ldr r1, =PlayerGoSpeed0 - movs r0, 0x3 - bl DoForcedMovement - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_WalkWest - - thumb_func_start ForcedMovement_WalkEast -ForcedMovement_WalkEast: @ 808ACE8 - push {lr} - ldr r1, =PlayerGoSpeed0 - movs r0, 0x4 - bl DoForcedMovement - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_WalkEast - - thumb_func_start ForcedMovement_PushedSouthByCurrent -ForcedMovement_PushedSouthByCurrent: @ 808AD00 - push {lr} - ldr r1, =PlayerGoSpeed2 - movs r0, 0x1 - bl DoForcedMovement - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_PushedSouthByCurrent - - thumb_func_start ForcedMovement_PushedNorthByCurrent -ForcedMovement_PushedNorthByCurrent: @ 808AD18 - push {lr} - ldr r1, =PlayerGoSpeed2 - movs r0, 0x2 - bl DoForcedMovement - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_PushedNorthByCurrent - - thumb_func_start ForcedMovement_PushedWestByCurrent -ForcedMovement_PushedWestByCurrent: @ 808AD30 - push {lr} - ldr r1, =PlayerGoSpeed2 - movs r0, 0x3 - bl DoForcedMovement - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_PushedWestByCurrent - - thumb_func_start ForcedMovement_PushedEastByCurrent -ForcedMovement_PushedEastByCurrent: @ 808AD48 - push {lr} - ldr r1, =PlayerGoSpeed2 - movs r0, 0x4 - bl DoForcedMovement - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_PushedEastByCurrent - - thumb_func_start ForcedMovement_Slide -ForcedMovement_Slide: @ 808AD60 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02037590 - ldrb r3, [r2, 0x5] - lsls r2, r3, 3 - adds r2, r3 - lsls r2, 2 - ldr r3, =0x02037350 - adds r2, r3 - ldrb r3, [r2, 0x1] - movs r4, 0x4 - orrs r3, r4 - movs r4, 0x2 - orrs r3, r4 - strb r3, [r2, 0x1] - bl DoForcedMovement - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_Slide - - thumb_func_start ForcedMovement_SlideSouth -ForcedMovement_SlideSouth: @ 808AD98 - push {lr} - ldr r1, =PlayerGoSpeed1 - movs r0, 0x1 - bl ForcedMovement_Slide - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_SlideSouth - - thumb_func_start ForcedMovement_SlideNorth -ForcedMovement_SlideNorth: @ 808ADB0 - push {lr} - ldr r1, =PlayerGoSpeed1 - movs r0, 0x2 - bl ForcedMovement_Slide - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_SlideNorth - - thumb_func_start ForcedMovement_SlideWest -ForcedMovement_SlideWest: @ 808ADC8 - push {lr} - ldr r1, =PlayerGoSpeed1 - movs r0, 0x3 - bl ForcedMovement_Slide - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_SlideWest - - thumb_func_start ForcedMovement_SlideEast -ForcedMovement_SlideEast: @ 808ADE0 - push {lr} - ldr r1, =PlayerGoSpeed1 - movs r0, 0x4 - bl ForcedMovement_Slide - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end ForcedMovement_SlideEast - - thumb_func_start ForcedMovement_0xBB -ForcedMovement_0xBB: @ 808ADF8 - push {lr} - bl sub_808C4D8 - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end ForcedMovement_0xBB - - thumb_func_start ForcedMovement_0xBC -ForcedMovement_0xBC: @ 808AE04 - push {lr} - bl sub_808C5B0 - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end ForcedMovement_0xBC - - thumb_func_start ForcedMovement_MuddySlope -ForcedMovement_MuddySlope: @ 808AE10 - push {r4,lr} - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - ldrb r1, [r4, 0x18] - movs r0, 0xF0 - ands r0, r1 - cmp r0, 0x20 - bne _0808AE36 - bl sub_811A138 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bgt _0808AE60 -_0808AE36: - movs r0, 0 - bl sub_811A114 - ldrb r0, [r4, 0x1] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4, 0x1] - ldr r1, =PlayerGoSpeed1 - movs r0, 0x1 - bl DoForcedMovement - lsls r0, 24 - lsrs r0, 24 - b _0808AE62 - .pool -_0808AE60: - movs r0, 0 -_0808AE62: - pop {r4} - pop {r1} - bx r1 - thumb_func_end ForcedMovement_MuddySlope - - thumb_func_start MovePlayerNotOnBike -@ void MovePlayerNotOnBike(u8 direction, u8 heldKeys) -MovePlayerNotOnBike: @ 808AE68 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 16 - lsrs r5, 16 - ldr r6, =gUnknown_08497490 - adds r0, r4, 0 - bl CheckMovementInputNotOnBike - lsls r0, 24 - lsrs r0, 22 - adds r0, r6 - ldr r2, [r0] - adds r0, r4, 0 - adds r1, r5, 0 - bl _call_via_r2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end MovePlayerNotOnBike - - thumb_func_start CheckMovementInputNotOnBike -@ u8 CheckMovementInputNotOnBike(u8 direction) -CheckMovementInputNotOnBike: @ 808AE98 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0808AEB0 - ldr r0, =0x02037590 - strb r4, [r0, 0x2] - movs r0, 0 - b _0808AED2 - .pool -_0808AEB0: - bl player_get_direction_upper_nybble - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - beq _0808AECC - ldr r1, =0x02037590 - ldrb r0, [r1, 0x2] - cmp r0, 0x2 - beq _0808AECC - movs r0, 0x1 - b _0808AED0 - .pool -_0808AECC: - ldr r1, =0x02037590 - movs r0, 0x2 -_0808AED0: - strb r0, [r1, 0x2] -_0808AED2: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end CheckMovementInputNotOnBike - - thumb_func_start PlayerNotOnBikeNotMoving -@ void PlayerNotOnBikeNotMoving(u8 direction, u8 heldKeys) -PlayerNotOnBikeNotMoving: @ 808AEDC - push {lr} - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - bl PlayerFaceDirection - pop {r0} - bx r0 - thumb_func_end PlayerNotOnBikeNotMoving - - thumb_func_start PlayerNotOnBikeTurningInPlace -@ void PlayerNotOnBikeTurningInPlace(u8 direction, u8 heldKeys) -PlayerNotOnBikeTurningInPlace: @ 808AEF0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl PlayerTurnInPlace - pop {r0} - bx r0 - thumb_func_end PlayerNotOnBikeTurningInPlace - - thumb_func_start PlayerNotOnBikeMoving -@ void PlayerNotOnBikeMoving(u8 direction, u8 heldKeys) -PlayerNotOnBikeMoving: @ 808AF00 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 16 - lsrs r6, r1, 16 - adds r0, r5, 0 - bl CheckForPlayerAvatarCollision - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0808AF4E - cmp r4, 0x6 - bne _0808AF24 - adds r0, r5, 0 - bl PlayerJumpLedge - b _0808AFB6 -_0808AF24: - cmp r4, 0x4 - bne _0808AF3C - adds r0, r5, 0 - bl IsPlayerCollidingWithFarawayIslandMew - lsls r0, 24 - cmp r0, 0 - beq _0808AF3C - adds r0, r5, 0 - bl PlayerNotOnBikeCollideWithFarawayIslandMew - b _0808AFB6 -_0808AF3C: - subs r0, r4, 0x5 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _0808AFB6 - adds r0, r5, 0 - bl PlayerNotOnBikeCollide - b _0808AFB6 -_0808AF4E: - ldr r4, =0x02037590 - ldrb r1, [r4] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0808AF68 - adds r0, r5, 0 - bl PlayerGoSpeed1 - b _0808AFB6 - .pool -_0808AF68: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _0808AFB0 - movs r0, 0x2 - ands r6, r0 - cmp r6, 0 - beq _0808AFB0 - movs r0, 0x8C - lsls r0, 4 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0808AFB0 - ldr r2, =0x02037350 - ldrb r1, [r4, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1E] - bl IsRunningDisallowed - cmp r0, 0 - bne _0808AFB0 - adds r0, r5, 0 - bl PlayerRun - ldrb r1, [r4] - movs r0, 0x80 - orrs r0, r1 - strb r0, [r4] - b _0808AFB6 - .pool -_0808AFB0: - adds r0, r5, 0 - bl PlayerGoSpeed0 -_0808AFB6: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end PlayerNotOnBikeMoving - - thumb_func_start CheckForPlayerAvatarCollision -CheckForPlayerAvatarCollision: @ 808AFBC - push {r4-r6,lr} - sub sp, 0x8 - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - ldrh r1, [r4, 0x10] - add r0, sp, 0x4 - strh r1, [r0] - ldrh r0, [r4, 0x12] - mov r5, sp - adds r5, 0x6 - strh r0, [r5] - adds r0, r6, 0 - add r1, sp, 0x4 - adds r2, r5, 0 - bl MoveCoords - add r0, sp, 0x4 - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - add r1, sp, 0x4 - movs r3, 0 - ldrsh r1, [r1, r3] - movs r3, 0 - ldrsh r2, [r5, r3] - str r0, [sp] - adds r0, r4, 0 - adds r3, r6, 0 - bl CheckForFieldObjectCollision - lsls r0, 24 - lsrs r0, 24 - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end CheckForPlayerAvatarCollision - - thumb_func_start sub_808B028 -sub_808B028: @ 808B028 - push {r4-r6,lr} - sub sp, 0x8 - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - ldrh r1, [r4, 0x10] - add r0, sp, 0x4 - strh r1, [r0] - ldrh r0, [r4, 0x12] - mov r5, sp - adds r5, 0x6 - strh r0, [r5] - adds r0, r6, 0 - add r1, sp, 0x4 - adds r2, r5, 0 - bl MoveCoords - add r0, sp, 0x4 - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - add r1, sp, 0x4 - movs r3, 0 - ldrsh r1, [r1, r3] - movs r3, 0 - ldrsh r2, [r5, r3] - str r0, [sp] - adds r0, r4, 0 - adds r3, r6, 0 - bl sub_808B164 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808B028 - - thumb_func_start CheckForFieldObjectCollision -@ u8 CheckForFieldObjectCollision(struct npc_state *fieldObject, u16 x, u16 y, u8 direction, u8 metatileBehavior) -CheckForFieldObjectCollision: @ 808B094 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r4, [sp, 0x24] - lsls r1, 16 - lsls r2, 16 - lsls r3, 24 - lsrs r6, r3, 24 - lsls r4, 24 - lsrs r4, 24 - mov r10, r4 - lsrs r7, r1, 16 - asrs r5, r1, 16 - lsrs r1, r2, 16 - mov r9, r1 - asrs r4, r2, 16 - adds r1, r5, 0 - adds r2, r4, 0 - adds r3, r6, 0 - bl npc_block_way - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - strb r0, [r1] - cmp r0, 0x3 - bne _0808B0E4 - adds r0, r5, 0 - adds r1, r4, 0 - adds r2, r6, 0 - bl sub_808B1BC - lsls r0, 24 - cmp r0, 0 - beq _0808B0E4 - movs r0, 0x5 - b _0808B152 -_0808B0E4: - lsls r5, r7, 16 - asrs r0, r5, 16 - mov r8, r0 - mov r1, r9 - lsls r4, r1, 16 - asrs r7, r4, 16 - adds r1, r7, 0 - adds r2, r6, 0 - bl ShouldJumpLedge - lsls r0, 24 - cmp r0, 0 - beq _0808B108 - movs r0, 0x2B - bl sav12_xor_increment - movs r0, 0x6 - b _0808B152 -_0808B108: - mov r0, sp - ldrb r0, [r0] - cmp r0, 0x4 - bne _0808B124 - mov r0, r8 - adds r1, r7, 0 - adds r2, r6, 0 - bl sub_808B238 - lsls r0, 24 - cmp r0, 0 - beq _0808B124 - movs r0, 0x7 - b _0808B152 -_0808B124: - mov r0, sp - ldrb r0, [r0] - cmp r0, 0 - bne _0808B14E - asrs r5, 16 - asrs r4, 16 - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl CheckForRotatingGatePuzzleCollision - cmp r0, 0 - beq _0808B142 - movs r0, 0x8 - b _0808B152 -_0808B142: - adds r0, r5, 0 - adds r1, r4, 0 - mov r2, r10 - mov r3, sp - bl check_acro_bike_metatile -_0808B14E: - mov r0, sp - ldrb r0, [r0] -_0808B152: - 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 CheckForFieldObjectCollision - - thumb_func_start sub_808B164 -sub_808B164: @ 808B164 - push {r4-r7,lr} - sub sp, 0x4 - ldr r4, [sp, 0x18] - lsls r3, 24 - lsrs r6, r3, 24 - lsls r4, 24 - lsrs r7, r4, 24 - lsls r1, 16 - asrs r5, r1, 16 - lsls r2, 16 - asrs r4, r2, 16 - adds r1, r5, 0 - adds r2, r4, 0 - adds r3, r6, 0 - bl npc_block_way - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - strb r0, [r1] - cmp r0, 0 - bne _0808B1AE - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_80FBFD4 - cmp r0, 0 - beq _0808B1A2 - movs r0, 0x8 - b _0808B1B2 -_0808B1A2: - adds r0, r5, 0 - adds r1, r4, 0 - adds r2, r7, 0 - mov r3, sp - bl check_acro_bike_metatile -_0808B1AE: - mov r0, sp - ldrb r0, [r0] -_0808B1B2: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808B164 - - thumb_func_start sub_808B1BC -@ bool8 sub_808B1BC(u16 x, u16 y, u8 direction) -sub_808B1BC: @ 808B1BC - push {r4-r6,lr} - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r0, =0x02037590 - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0808B20C - lsls r5, r3, 16 - asrs r0, r5, 16 - lsls r4, 16 - asrs r1, r4, 16 - bl MapGridGetZCoordAt - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _0808B20C - lsrs r0, r5, 16 - lsrs r1, r4, 16 - movs r2, 0x3 - bl GetFieldObjectIdByXYZ - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - bne _0808B20C - adds r0, r6, 0 - bl sub_808C750 - movs r0, 0x1 - b _0808B20E - .pool -_0808B20C: - movs r0, 0 -_0808B20E: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_808B1BC - - thumb_func_start ShouldJumpLedge -@ bool8 ShouldJumpLedge(s16 x, s16 y, u8 direction) -ShouldJumpLedge: @ 808B214 - push {lr} - lsls r2, 24 - lsrs r2, 24 - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl GetLedgeJumpDirection - lsls r0, 24 - cmp r0, 0 - bne _0808B230 - movs r0, 0 - b _0808B232 -_0808B230: - movs r0, 0x1 -_0808B232: - pop {r1} - bx r1 - thumb_func_end ShouldJumpLedge - - thumb_func_start sub_808B238 -sub_808B238: @ 808B238 - push {r4-r7,lr} - sub sp, 0x4 - mov r3, sp - strh r0, [r3] - mov r5, sp - adds r5, 0x2 - strh r1, [r5] - lsls r2, 24 - lsrs r7, r2, 24 - ldr r0, =0x00000889 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0808B2D8 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r5, r2] - bl GetFieldObjectIdByXY - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x10 - beq _0808B2D8 - ldr r0, =0x02037350 - lsls r1, r6, 3 - adds r1, r6 - lsls r1, 2 - adds r4, r1, r0 - ldrb r0, [r4, 0x5] - cmp r0, 0x57 - bne _0808B2D8 - ldrh r1, [r4, 0x10] - mov r0, sp - strh r1, [r0] - ldrh r0, [r4, 0x12] - strh r0, [r5] - adds r0, r7, 0 - mov r1, sp - adds r2, r5, 0 - bl MoveCoords - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0 - ldrsh r2, [r5, r0] - adds r0, r4, 0 - adds r3, r7, 0 - bl npc_block_way - lsls r0, 24 - cmp r0, 0 - bne _0808B2D8 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl sub_8088F58 - lsls r0, 24 - cmp r0, 0 - bne _0808B2D8 - adds r0, r6, 0 - adds r1, r7, 0 - bl task_add_bump_boulder - movs r0, 0x1 - b _0808B2DA - .pool -_0808B2D8: - movs r0, 0 -_0808B2DA: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808B238 - - thumb_func_start check_acro_bike_metatile -@ void check_acro_bike_metatile(s16 x, s16 y, u8 metatileBehavior, u8 *returnValue) -check_acro_bike_metatile: @ 808B2E4 - push {r4-r7,lr} - adds r6, r3, 0 - lsls r2, 24 - lsrs r5, r2, 24 - movs r4, 0 - ldr r7, =gUnknown_0849749C -_0808B2F0: - lsls r0, r4, 2 - adds r0, r7 - ldr r1, [r0] - adds r0, r5, 0 - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - beq _0808B314 - ldr r0, =gUnknown_084974B0 - adds r0, r4, r0 - ldrb r0, [r0] - strb r0, [r6] - b _0808B31E - .pool -_0808B314: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _0808B2F0 -_0808B31E: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end check_acro_bike_metatile - - thumb_func_start IsPlayerCollidingWithFarawayIslandMew -@ bool8 IsPlayerCollidingWithFarawayIslandMew(u8 direction) -IsPlayerCollidingWithFarawayIslandMew: @ 808B324 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02037590 - ldrb r2, [r1, 0x5] - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - ldr r5, =0x02037350 - adds r3, r1, r5 - ldrh r2, [r3, 0x10] - mov r1, sp - strh r2, [r1] - ldrh r1, [r3, 0x12] - mov r4, sp - adds r4, 0x2 - strh r1, [r4] - mov r1, sp - adds r2, r4, 0 - bl MoveCoords - movs r0, 0x1 - movs r1, 0x39 - movs r2, 0x1A - bl GetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - lsrs r1, r0, 24 - adds r6, r4, 0 - cmp r1, 0x10 - beq _0808B3C0 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r3, r0, r5 - mov r0, sp - movs r1, 0x14 - ldrsh r2, [r3, r1] - movs r4, 0 - ldrsh r0, [r0, r4] - cmp r2, r0 - bne _0808B3C0 - movs r5, 0x16 - ldrsh r1, [r3, r5] - movs r4, 0 - ldrsh r0, [r6, r4] - ldrh r4, [r3, 0x16] - cmp r1, r0 - bne _0808B398 - movs r5, 0x10 - ldrsh r0, [r3, r5] - cmp r0, r2 - bne _0808B398 - movs r2, 0x12 - ldrsh r0, [r3, r2] - cmp r0, r1 - beq _0808B3C0 -_0808B398: - mov r0, sp - movs r5, 0x14 - ldrsh r1, [r3, r5] - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r1, r0 - bne _0808B3C0 - lsls r0, r4, 16 - asrs r0, 16 - movs r4, 0 - ldrsh r1, [r6, r4] - cmp r0, r1 - bne _0808B3C0 - movs r0, 0x1 - b _0808B3C2 - .pool -_0808B3C0: - movs r0, 0 -_0808B3C2: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end IsPlayerCollidingWithFarawayIslandMew - - thumb_func_start SetPlayerAvatarTransitionFlags -@ void SetPlayerAvatarTransitionFlags(u16 transitionFlags) -SetPlayerAvatarTransitionFlags: @ 808B3CC - push {lr} - lsls r0, 16 - lsrs r0, 16 - ldr r2, =0x02037590 - ldrb r1, [r2, 0x1] - orrs r0, r1 - strb r0, [r2, 0x1] - bl DoPlayerAvatarTransition - pop {r0} - bx r0 - .pool - thumb_func_end SetPlayerAvatarTransitionFlags - - thumb_func_start DoPlayerAvatarTransition -@ void DoPlayerAvatarTransition() -DoPlayerAvatarTransition: @ 808B3E8 - push {r4,r5,lr} - ldr r0, =0x02037590 - ldrb r4, [r0, 0x1] - cmp r4, 0 - beq _0808B428 - movs r5, 0 -_0808B3F4: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0808B416 - ldr r0, =gUnknown_084974B8 - lsls r2, r5, 2 - adds r2, r0 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldr r1, [r2] - bl _call_via_r1 -_0808B416: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - lsrs r4, 1 - cmp r5, 0x7 - bls _0808B3F4 - ldr r1, =0x02037590 - movs r0, 0 - strb r0, [r1, 0x1] -_0808B428: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoPlayerAvatarTransition - - thumb_func_start PlayerAvatarTransition_Dummy -@ void PlayerAvatarTransition_Dummy(struct npc_state *fieldObject) -PlayerAvatarTransition_Dummy: @ 808B43C - bx lr - thumb_func_end PlayerAvatarTransition_Dummy - - thumb_func_start PlayerAvatarTransition_Normal -@ void PlayerAvatarTransition_Normal(struct npc_state *fieldObject) -PlayerAvatarTransition_Normal: @ 808B440 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r1, [r4, 0x18] - lsrs r1, 4 - adds r0, r4, 0 - bl FieldObjectTurn - movs r0, 0x1 - bl SetPlayerAvatarStateMask - pop {r4} - pop {r0} - bx r0 - thumb_func_end PlayerAvatarTransition_Normal - - thumb_func_start PlayerAvatarTransition_MachBike -@ void PlayerAvatarTransition_MachBike(struct npc_state *fieldObject) -PlayerAvatarTransition_MachBike: @ 808B46C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x1 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r1, [r4, 0x18] - lsrs r1, 4 - adds r0, r4, 0 - bl FieldObjectTurn - movs r0, 0x2 - bl SetPlayerAvatarStateMask - movs r0, 0 - movs r1, 0 - bl sub_811A0D0 - pop {r4} - pop {r0} - bx r0 - thumb_func_end PlayerAvatarTransition_MachBike - - thumb_func_start PlayerAvatarTransition_AcroBike -@ void PlayerAvatarTransition_AcroBike(struct npc_state *fieldObject) -PlayerAvatarTransition_AcroBike: @ 808B4A0 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x2 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r1, [r4, 0x18] - lsrs r1, 4 - adds r0, r4, 0 - bl FieldObjectTurn - movs r0, 0x4 - bl SetPlayerAvatarStateMask - movs r0, 0 - movs r1, 0 - bl sub_811A0D0 - bl sub_811A188 - pop {r4} - pop {r0} - bx r0 - thumb_func_end PlayerAvatarTransition_AcroBike - - thumb_func_start PlayerAvatarTransition_Surfing -@ void PlayerAvatarTransition_Surfing(struct npc_state *fieldObject) -PlayerAvatarTransition_Surfing: @ 808B4D8 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x3 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r1, [r4, 0x18] - lsrs r1, 4 - adds r0, r4, 0 - bl FieldObjectTurn - movs r0, 0x8 - bl SetPlayerAvatarStateMask - ldr r1, =0x02038c08 - movs r2, 0x10 - ldrsh r0, [r4, r2] - str r0, [r1] - movs r2, 0x12 - ldrsh r0, [r4, r2] - str r0, [r1, 0x4] - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - str r0, [r1, 0x8] - movs r0, 0x8 - bl FieldEffectStart - lsls r0, 24 - lsrs r0, 24 - strb r0, [r4, 0x1A] - movs r1, 0x1 - bl sub_81555AC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end PlayerAvatarTransition_Surfing - - thumb_func_start PlayerAvatarTransition_Underwater -@ void PlayerAvatarTransition_Underwater(struct npc_state *fieldObject) -PlayerAvatarTransition_Underwater: @ 808B534 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x4 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r1, [r4, 0x18] - lsrs r1, 4 - adds r0, r4, 0 - bl FieldObjectTurn - movs r0, 0x10 - bl SetPlayerAvatarStateMask - ldrb r0, [r4, 0x4] - bl sub_8155800 - strb r0, [r4, 0x1A] - pop {r4} - pop {r0} - bx r0 - thumb_func_end PlayerAvatarTransition_Underwater - - thumb_func_start PlayerAvatarTransition_ReturnToField -@ void PlayerAvatarTransition_ReturnToField(struct npc_state *fieldObject) -PlayerAvatarTransition_ReturnToField: @ 808B568 - ldr r2, =0x02037590 - ldrb r1, [r2] - movs r0, 0x20 - orrs r0, r1 - strb r0, [r2] - bx lr - .pool - thumb_func_end PlayerAvatarTransition_ReturnToField - - thumb_func_start sub_808B578 -sub_808B578: @ 808B578 - push {r4,lr} - ldr r4, =0x02037590 - movs r0, 0 - strb r0, [r4, 0x3] - bl PlayerIsAnimActive - lsls r0, 24 - cmp r0, 0 - beq _0808B5B6 - bl PlayerCheckIfAnimFinishedOrInactive - lsls r0, 24 - cmp r0, 0 - bne _0808B5A8 - bl player_is_anim_in_certain_ranges - lsls r0, 24 - cmp r0, 0 - bne _0808B5B6 - movs r0, 0x1 - b _0808B5B4 - .pool -_0808B5A8: - bl sub_808B618 - lsls r0, 24 - cmp r0, 0 - bne _0808B5B6 - movs r0, 0x2 -_0808B5B4: - strb r0, [r4, 0x3] -_0808B5B6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_808B578 - - thumb_func_start player_is_anim_in_certain_ranges -player_is_anim_in_certain_ranges: @ 808B5BC - push {lr} - ldr r2, =0x02037350 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1C] - cmp r1, 0x3 - bls _0808B602 - adds r0, r1, 0 - subs r0, 0x10 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bls _0808B602 - adds r0, r1, 0 - subs r0, 0x19 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xF - bls _0808B602 - adds r0, r1, 0 - subs r0, 0x64 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB - bls _0808B602 - adds r0, r1, 0 - subs r0, 0x7C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bhi _0808B610 -_0808B602: - movs r0, 0x1 - b _0808B612 - .pool -_0808B610: - movs r0, 0 -_0808B612: - pop {r1} - bx r1 - thumb_func_end player_is_anim_in_certain_ranges - - thumb_func_start sub_808B618 -sub_808B618: @ 808B618 - push {lr} - bl player_is_anim_in_certain_ranges - lsls r0, 24 - cmp r0, 0 - beq _0808B634 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x2] - cmp r0, 0x1 - beq _0808B634 - movs r0, 0x1 - b _0808B636 - .pool -_0808B634: - movs r0, 0 -_0808B636: - pop {r1} - bx r1 - thumb_func_end sub_808B618 - - thumb_func_start PlayerIsAnimActive -@ bool8 PlayerIsAnimActive() -PlayerIsAnimActive: @ 808B63C - push {lr} - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end PlayerIsAnimActive - - thumb_func_start PlayerCheckIfAnimFinishedOrInactive -@ bool8 PlayerCheckIfAnimFinishedOrInactive() -PlayerCheckIfAnimFinishedOrInactive: @ 808B660 - push {lr} - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - bl FieldObjectCheckIfSpecialAnimFinishedOrInactive - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end PlayerCheckIfAnimFinishedOrInactive - - thumb_func_start player_set_x22 -player_set_x22: @ 808B684 - ldr r3, =0x02037350 - ldr r1, =0x02037590 - ldrb r2, [r1, 0x5] - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - adds r1, 0x22 - strb r0, [r1] - bx lr - .pool - thumb_func_end player_set_x22 - - thumb_func_start player_get_x22 -player_get_x22: @ 808B6A0 - ldr r2, =0x02037350 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x22 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end player_get_x22 - - thumb_func_start sub_808B6BC -sub_808B6BC: @ 808B6BC - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0x02037590 - ldrb r2, [r0, 0x5] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - bl FieldObjectForceSetSpecialAnim - pop {r0} - bx r0 - .pool - thumb_func_end sub_808B6BC - - thumb_func_start player_npc_set_state_and_x22_etc -@ void player_npc_set_state_and_x22_etc(u8 animState, u8 a2) -player_npc_set_state_and_x22_etc: @ 808B6E4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - bl PlayerIsAnimActive - lsls r0, 24 - cmp r0, 0 - bne _0808B712 - adds r0, r4, 0 - bl player_set_x22 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - adds r1, r5, 0 - bl FieldObjectSetSpecialAnim -_0808B712: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end player_npc_set_state_and_x22_etc - - thumb_func_start PlayerGoSpeed0 -@ void PlayerGoSpeed0(u8 direction) -PlayerGoSpeed0: @ 808B720 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetGoSpeed0AnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end PlayerGoSpeed0 - - thumb_func_start PlayerGoSpeed1 -@ void PlayerGoSpeed1(u8 direction) -PlayerGoSpeed1: @ 808B738 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetGoSpeed1AnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end PlayerGoSpeed1 - - thumb_func_start PlayerGoSpeed2 -@ void PlayerGoSpeed2(u8 direction) -PlayerGoSpeed2: @ 808B750 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetGoSpeed2AnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end PlayerGoSpeed2 - - thumb_func_start PlayerGoSpeed3 -@ void PlayerGoSpeed3(u8 direction) -PlayerGoSpeed3: @ 808B768 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetGoSpeed3AnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end PlayerGoSpeed3 - - thumb_func_start PlayerRun -@ void PlayerRun(u8 direction) -PlayerRun: @ 808B780 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetRunAnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end PlayerRun - - thumb_func_start PlayerOnBikeCollide -@ void PlayerOnBikeCollide(u8 direction) -PlayerOnBikeCollide: @ 808B798 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl PlayCollisionSoundIfNotFacingWarp - adds r0, r4, 0 - bl GetStepInPlaceDelay16AnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r4} - pop {r0} - bx r0 - thumb_func_end PlayerOnBikeCollide - - thumb_func_start PlayerOnBikeCollideWithFarawayIslandMew -@ void PlayerOnBikeCollideWithFarawayIslandMew(u8 direction) -PlayerOnBikeCollideWithFarawayIslandMew: @ 808B7BC - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetStepInPlaceDelay16AnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end PlayerOnBikeCollideWithFarawayIslandMew - - thumb_func_start PlayerNotOnBikeCollide -@ void PlayerNotOnBikeCollide(u8 direction) -PlayerNotOnBikeCollide: @ 808B7D4 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl PlayCollisionSoundIfNotFacingWarp - adds r0, r4, 0 - bl GetStepInPlaceDelay32AnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r4} - pop {r0} - bx r0 - thumb_func_end PlayerNotOnBikeCollide - - thumb_func_start PlayerNotOnBikeCollideWithFarawayIslandMew -@ void PlayerNotOnBikeCollideWithFarawayIslandMew(u8 direction) -PlayerNotOnBikeCollideWithFarawayIslandMew: @ 808B7F8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetStepInPlaceDelay32AnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end PlayerNotOnBikeCollideWithFarawayIslandMew - - thumb_func_start PlayerFaceDirection -@ void PlayerFaceDirection(u8 direction) -PlayerFaceDirection: @ 808B810 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetFaceDirectionAnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end PlayerFaceDirection - - thumb_func_start PlayerTurnInPlace -@ void PlayerTurnInPlace(u8 direction) -PlayerTurnInPlace: @ 808B828 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetStepInPlaceDelay8AnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end PlayerTurnInPlace - - thumb_func_start PlayerJumpLedge -@ void PlayerJumpLedge(u8 direction) -PlayerJumpLedge: @ 808B840 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0xA - bl audio_play - adds r0, r4, 0 - bl GetJumpLedgeAnimId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x8 - bl player_npc_set_state_and_x22_etc - pop {r4} - pop {r0} - bx r0 - thumb_func_end PlayerJumpLedge - - thumb_func_start sub_808B864 -sub_808B864: @ 808B864 - push {r4,lr} - ldr r4, =0x02037590 - ldrb r0, [r4, 0x3] - cmp r0, 0x2 - beq _0808B872 - cmp r0, 0 - bne _0808B89A -_0808B872: - bl player_should_look_direction_be_enforced_upon_movement - lsls r0, 24 - cmp r0, 0 - beq _0808B89A - ldr r2, =0x02037350 - ldrb r1, [r4, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - lsls r0, 24 - lsrs r0, 24 - bl sub_808B6BC -_0808B89A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808B864 - - thumb_func_start sub_808B8A8 -sub_808B8A8: @ 808B8A8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_8093648 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end sub_808B8A8 - - thumb_func_start sub_808B8C0 -sub_808B8C0: @ 808B8C0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_8093674 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end sub_808B8C0 - - thumb_func_start sub_808B8D8 -sub_808B8D8: @ 808B8D8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_80936A0 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end sub_808B8D8 - - thumb_func_start sub_808B8F0 -sub_808B8F0: @ 808B8F0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x22 - bl audio_play - adds r0, r4, 0 - bl sub_80936CC - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl player_npc_set_state_and_x22_etc - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_808B8F0 - - thumb_func_start sub_808B914 -sub_808B914: @ 808B914 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x22 - bl audio_play - adds r0, r4, 0 - bl sub_80936F8 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_808B914 - - thumb_func_start sub_808B938 -sub_808B938: @ 808B938 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x22 - bl audio_play - adds r0, r4, 0 - bl sub_8093724 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x8 - bl player_npc_set_state_and_x22_etc - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_808B938 - - thumb_func_start sub_808B95C -sub_808B95C: @ 808B95C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x22 - bl audio_play - adds r0, r4, 0 - bl sub_80934E8 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl player_npc_set_state_and_x22_etc - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_808B95C - - thumb_func_start sub_808B980 -sub_808B980: @ 808B980 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x7 - bl audio_play - adds r0, r4, 0 - bl sub_8093750 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_808B980 - - thumb_func_start sub_808B9A4 -sub_808B9A4: @ 808B9A4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_809377C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end sub_808B9A4 - - thumb_func_start sub_808B9BC -sub_808B9BC: @ 808B9BC - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_80937A8 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end sub_808B9BC - - thumb_func_start npc_use_some_d2s -npc_use_some_d2s: @ 808B9D4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl d2s_08064034 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc - pop {r0} - bx r0 - thumb_func_end npc_use_some_d2s - - thumb_func_start PlayCollisionSoundIfNotFacingWarp -@ void PlayCollisionSoundIfNotFacingWarp(u8 direction) -PlayCollisionSoundIfNotFacingWarp: @ 808B9EC - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r2, =0x02037350 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1E] - ldr r2, =gUnknown_084974D8 - subs r1, r4, 0x1 - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - bne _0808BA54 - cmp r4, 0x2 - bne _0808BA4E - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - movs r0, 0x2 - mov r1, sp - adds r2, r4, 0 - bl MoveCoords - 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 is_tile_x69_2_warp_door - lsls r0, 24 - cmp r0, 0 - bne _0808BA54 -_0808BA4E: - movs r0, 0x7 - bl audio_play -_0808BA54: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end PlayCollisionSoundIfNotFacingWarp - - thumb_func_start GetXYCoordsOneStepInFrontOfPlayer -GetXYCoordsOneStepInFrontOfPlayer: @ 808BA68 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r3, =0x02037350 - ldr r2, =0x02037590 - ldrb r1, [r2, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0, 0x10] - strh r0, [r4] - ldrb r1, [r2, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0, 0x12] - strh r0, [r5] - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - adds r2, r5, 0 - bl MoveCoords - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end GetXYCoordsOneStepInFrontOfPlayer - - thumb_func_start PlayerGetDestCoords -@ void PlayerGetDestCoords(u16 *x, u16 *y) -PlayerGetDestCoords: @ 808BAAC - push {r4,r5,lr} - ldr r5, =0x02037350 - ldr r4, =0x02037590 - ldrb r3, [r4, 0x5] - lsls r2, r3, 3 - adds r2, r3 - lsls r2, 2 - adds r2, r5 - ldrh r2, [r2, 0x10] - strh r2, [r0] - ldrb r2, [r4, 0x5] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r0, r5 - ldrh r0, [r0, 0x12] - strh r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end PlayerGetDestCoords - - thumb_func_start plaer_get_pos_including_state_based_drift -plaer_get_pos_including_state_based_drift: @ 808BADC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r3, r0, r1 - ldrb r1, [r3] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0x40 - beq _0808BAFC - b _0808BC24 -_0808BAFC: - ldr r2, =0x02020630 - ldrb r1, [r3, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x32 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _0808BB12 - b _0808BC24 -_0808BB12: - ldrh r0, [r3, 0x10] - strh r0, [r4] - ldrh r0, [r3, 0x12] - strh r0, [r5] - ldrb r0, [r3, 0x1C] - subs r0, 0x8 - cmp r0, 0x30 - bls _0808BB24 - b _0808BC24 -_0808BB24: - lsls r0, 2 - ldr r1, =_0808BB40 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0808BB40: - .4byte _0808BC04 - .4byte _0808BC0A - .4byte _0808BC14 - .4byte _0808BC1A - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC24 - .4byte _0808BC04 - .4byte _0808BC0A - .4byte _0808BC14 - .4byte _0808BC1A -_0808BC04: - ldrh r0, [r5] - adds r0, 0x1 - b _0808BC0E -_0808BC0A: - ldrh r0, [r5] - subs r0, 0x1 -_0808BC0E: - strh r0, [r5] - movs r0, 0x1 - b _0808BC30 -_0808BC14: - ldrh r0, [r4] - subs r0, 0x1 - b _0808BC1E -_0808BC1A: - ldrh r0, [r4] - adds r0, 0x1 -_0808BC1E: - strh r0, [r4] - movs r0, 0x1 - b _0808BC30 -_0808BC24: - movs r1, 0x1 - negs r1, r1 - adds r0, r1, 0 - strh r0, [r4] - strh r0, [r5] - movs r0, 0 -_0808BC30: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end plaer_get_pos_including_state_based_drift - - thumb_func_start player_get_direction_lower_nybble -@ u8 player_get_direction_lower_nybble() -player_get_direction_lower_nybble: @ 808BC38 - ldr r2, =0x02037350 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x18] - lsls r0, 28 - lsrs r0, 28 - bx lr - .pool - thumb_func_end player_get_direction_lower_nybble - - thumb_func_start player_get_direction_upper_nybble -@ u8 player_get_direction_upper_nybble() -player_get_direction_upper_nybble: @ 808BC58 - ldr r2, =0x02037350 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x18] - lsrs r0, 4 - bx lr - .pool - thumb_func_end player_get_direction_upper_nybble - - thumb_func_start PlayerGetZCoord -@ u8 PlayerGetZCoord() -PlayerGetZCoord: @ 808BC74 - ldr r2, =0x02037350 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0xB] - lsrs r0, 4 - bx lr - .pool - thumb_func_end PlayerGetZCoord - - thumb_func_start sub_808BC90 -sub_808BC90: @ 808BC90 - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - lsls r3, 16 - asrs r3, 16 - lsls r2, 16 - asrs r2, 16 - adds r1, r3, 0 - bl sub_808EB08 - pop {r0} - bx r0 - .pool - thumb_func_end sub_808BC90 - - thumb_func_start TestPlayerAvatarFlags -@ u32 TestPlayerAvatarFlags(u32 mask) -TestPlayerAvatarFlags: @ 808BCC0 - ldr r1, =0x02037590 - ldrb r1, [r1] - ands r1, r0 - adds r0, r1, 0 - bx lr - .pool - thumb_func_end TestPlayerAvatarFlags - - thumb_func_start sub_808BCD0 -sub_808BCD0: @ 808BCD0 - ldr r0, =0x02037590 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_808BCD0 - - thumb_func_start GetPlayerAvatarObjectId -@ u8 GetPlayerAvatarObjectId() -GetPlayerAvatarObjectId: @ 808BCDC - ldr r0, =0x02037590 - ldrb r0, [r0, 0x4] - bx lr - .pool - thumb_func_end GetPlayerAvatarObjectId - - thumb_func_start sub_808BCE8 -sub_808BCE8: @ 808BCE8 - push {lr} - bl ForcedMovement_None - pop {r0} - bx r0 - thumb_func_end sub_808BCE8 - - thumb_func_start sub_808BCF4 -sub_808BCF4: @ 808BCF4 - push {r4,lr} - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - adds r0, r4, 0 - bl npc_clear_strange_bits - ldrb r1, [r4, 0x18] - lsls r1, 28 - lsrs r1, 28 - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x6 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _0808BD2C - bl sub_811A188 - movs r0, 0 - bl sub_811A114 -_0808BD2C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808BCF4 - - thumb_func_start sub_808BD3C -sub_808BD3C: @ 808BD3C - lsls r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_084974E8 - lsrs r0, 23 - adds r1, r0 - adds r1, r2 - ldrb r0, [r1] - bx lr - .pool - thumb_func_end sub_808BD3C - - thumb_func_start GetPlayerAvatarGraphicsIdByStateIdAndGender -@ u8 GetPlayerAvatarGraphicsIdByStateIdAndGender(u8 stateId, u8 gender) -GetPlayerAvatarGraphicsIdByStateIdAndGender: @ 808BD54 - lsls r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_084974F8 - lsrs r0, 23 - adds r1, r0 - adds r1, r2 - ldrb r0, [r1] - bx lr - .pool - thumb_func_end GetPlayerAvatarGraphicsIdByStateIdAndGender - - thumb_func_start sub_808BD6C -sub_808BD6C: @ 808BD6C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_08497508 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_808BD6C - - thumb_func_start sub_808BD7C -sub_808BD7C: @ 808BD7C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0849750A - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_808BD7C - - thumb_func_start GetPlayerAvatarGraphicsIdByStateId -@ u8 GetPlayerAvatarGraphicsIdByStateId(u8 stateId) -GetPlayerAvatarGraphicsIdByStateId: @ 808BD8C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02037590 - ldrb r1, [r1, 0x7] - bl GetPlayerAvatarGraphicsIdByStateIdAndGender - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end GetPlayerAvatarGraphicsIdByStateId - - thumb_func_start sub_808BDA8 -sub_808BDA8: @ 808BDA8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x70 - beq _0808BDCA - cmp r0, 0x70 - bgt _0808BDC2 - cmp r0, 0x6D - bgt _0808BDCE - cmp r0, 0x69 - blt _0808BDCE - b _0808BDCA -_0808BDC2: - cmp r1, 0x8A - beq _0808BDCA - cmp r1, 0xC0 - bne _0808BDCE -_0808BDCA: - movs r0, 0x1 - b _0808BDD0 -_0808BDCE: - movs r0, 0 -_0808BDD0: - pop {r1} - bx r1 - thumb_func_end sub_808BDA8 - - thumb_func_start GetPlayerAvatarGenderByGraphicsId -@ u8 GetPlayerAvatarGenderByGraphicsId(u8 graphicsId) -GetPlayerAvatarGenderByGraphicsId: @ 808BDD4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x70 - beq _0808BDF6 - cmp r0, 0x70 - bgt _0808BDEE - cmp r0, 0x5D - bgt _0808BDFA - cmp r0, 0x59 - blt _0808BDFA - b _0808BDF6 -_0808BDEE: - cmp r1, 0x8A - beq _0808BDF6 - cmp r1, 0xC0 - bne _0808BDFA -_0808BDF6: - movs r0, 0x1 - b _0808BDFC -_0808BDFA: - movs r0, 0 -_0808BDFC: - pop {r1} - bx r1 - thumb_func_end GetPlayerAvatarGenderByGraphicsId - - thumb_func_start PartyHasMonWithSurf -@ bool8 PartyHasMonWithSurf() -PartyHasMonWithSurf: @ 808BE00 - push {r4,r5,lr} - movs r0, 0x8 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - bne _0808BE44 - movs r5, 0 - b _0808BE2A -_0808BE12: - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_has_move - lsls r0, 24 - cmp r0, 0 - beq _0808BE24 - movs r0, 0x1 - b _0808BE46 -_0808BE24: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_0808BE2A: - cmp r5, 0x5 - bhi _0808BE44 - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - bne _0808BE12 -_0808BE44: - movs r0, 0 -_0808BE46: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end PartyHasMonWithSurf - - thumb_func_start IsPlayerSurfingNorth -@ bool8 IsPlayerSurfingNorth() -IsPlayerSurfingNorth: @ 808BE50 - push {lr} - bl player_get_direction_upper_nybble - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0808BE6E - movs r0, 0x8 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _0808BE6E - movs r0, 0x1 - b _0808BE70 -_0808BE6E: - movs r0, 0 -_0808BE70: - pop {r1} - bx r1 - thumb_func_end IsPlayerSurfingNorth - - thumb_func_start IsPlayerFacingSurfableFishableWater -@ bool8 IsPlayerFacingSurfableFishableWater() -IsPlayerFacingSurfableFishableWater: @ 808BE74 - push {r4,r5,lr} - sub sp, 0x4 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - ldrh r1, [r4, 0x10] - mov r0, sp - strh r1, [r0] - ldrh r0, [r4, 0x12] - mov r5, sp - adds r5, 0x2 - strh r0, [r5] - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - mov r1, sp - adds r2, r5, 0 - bl MoveCoords - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0 - ldrsh r2, [r5, r0] - ldrb r3, [r4, 0x18] - lsls r3, 28 - lsrs r3, 28 - adds r0, r4, 0 - bl npc_block_way - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _0808BEF4 - bl PlayerGetZCoord - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _0808BEF4 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsSurfableFishableWater - lsls r0, 24 - cmp r0, 0 - beq _0808BEF4 - movs r0, 0x1 - b _0808BEF6 - .pool -_0808BEF4: - movs r0, 0 -_0808BEF6: - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end IsPlayerFacingSurfableFishableWater - - thumb_func_start ClearPlayerAvatarInfo -@ void ClearPlayerAvatarInfo() -ClearPlayerAvatarInfo: @ 808BF00 - push {lr} - ldr r0, =0x02037590 - movs r1, 0 - movs r2, 0x24 - bl memset - pop {r0} - bx r0 - .pool - thumb_func_end ClearPlayerAvatarInfo - - thumb_func_start SetPlayerAvatarStateMask -@ void SetPlayerAvatarStateMask(u8 stateMask) -SetPlayerAvatarStateMask: @ 808BF14 - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x02037590 - ldrb r2, [r3] - movs r1, 0xE0 - ands r1, r2 - orrs r0, r1 - strb r0, [r3] - bx lr - .pool - thumb_func_end SetPlayerAvatarStateMask - - thumb_func_start GetPlayerAvatarStateTransitionByGraphicsId -@ u8 GetPlayerAvatarStateTransitionByGraphicsId(u8 graphicsId, u8 gender) -GetPlayerAvatarStateTransitionByGraphicsId: @ 808BF2C - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r1, 24 - movs r2, 0 - ldr r3, =gUnknown_0849750C - lsls r0, r1, 2 - adds r0, r1 - lsls r4, r0, 1 - adds r6, r3, 0x1 -_0808BF42: - lsls r0, r2, 1 - adds r1, r0, r4 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r5 - bne _0808BF58 - adds r0, r1, r6 - ldrb r0, [r0] - b _0808BF64 - .pool -_0808BF58: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x4 - bls _0808BF42 - movs r0, 0x1 -_0808BF64: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end GetPlayerAvatarStateTransitionByGraphicsId - - thumb_func_start GetPlayerAvatarGraphicsIdByCurrentState -@ u8 GetPlayerAvatarGraphicsIdByCurrentState() -GetPlayerAvatarGraphicsIdByCurrentState: @ 808BF6C - push {r4-r6,lr} - ldr r0, =0x02037590 - ldrb r5, [r0] - movs r2, 0 - ldr r3, =gUnknown_0849750C - ldrb r1, [r0, 0x7] - lsls r0, r1, 2 - adds r0, r1 - lsls r4, r0, 1 - adds r6, r3, 0x1 -_0808BF80: - lsls r0, r2, 1 - adds r1, r0, r4 - adds r0, r1, r6 - ldrb r0, [r0] - ands r0, r5 - cmp r0, 0 - beq _0808BF9C - adds r0, r1, r3 - ldrb r0, [r0] - b _0808BFA8 - .pool -_0808BF9C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x4 - bls _0808BF80 - movs r0, 0 -_0808BFA8: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end GetPlayerAvatarGraphicsIdByCurrentState - - thumb_func_start SetPlayerAvatarExtraStateTransition -@ void SetPlayerAvatarExtraStateTransition(u8 graphicsId, u8 state) -SetPlayerAvatarExtraStateTransition: @ 808BFB0 - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =0x02037590 - ldrb r1, [r5, 0x7] - bl GetPlayerAvatarStateTransitionByGraphicsId - lsls r0, 24 - lsrs r0, 24 - orrs r0, r4 - ldrb r1, [r5, 0x1] - orrs r0, r1 - strb r0, [r5, 0x1] - bl DoPlayerAvatarTransition - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end SetPlayerAvatarExtraStateTransition - - thumb_func_start InitPlayerAvatar -@ void InitPlayerAvatar(u16 x, u16 y, u8 direction, u8 gender) -InitPlayerAvatar: @ 808BFE0 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x18 - adds r4, r0, 0 - adds r5, r1, 0 - mov r9, r2 - mov r8, r3 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - mov r1, sp - movs r0, 0xFF - strb r0, [r1] - movs r0, 0 - mov r1, r8 - bl GetPlayerAvatarGraphicsIdByStateIdAndGender - mov r1, sp - movs r3, 0 - strb r0, [r1, 0x1] - mov r0, sp - lsls r4, 16 - asrs r4, 16 - subs r4, 0x7 - movs r6, 0 - strh r4, [r0, 0x4] - lsls r5, 16 - asrs r5, 16 - subs r5, 0x7 - strh r5, [r0, 0x6] - strb r6, [r0, 0x8] - movs r0, 0xB - strb r0, [r1, 0x9] - mov r2, sp - ldrb r1, [r2, 0xA] - subs r0, 0x1B - ands r0, r1 - strb r0, [r2, 0xA] - mov r0, sp - strb r6, [r0, 0xA] - strh r3, [r0, 0xC] - strh r3, [r0, 0xE] - str r3, [sp, 0x10] - strh r3, [r0, 0x14] - bl SpawnSpecialFieldObject - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 3 - adds r4, r5 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - ldrb r0, [r4, 0x2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r4, 0x2] - bl sub_8154228 - strb r0, [r4, 0x1B] - adds r0, r4, 0 - mov r1, r9 - bl FieldObjectTurn - bl ClearPlayerAvatarInfo - ldr r0, =0x02037590 - strb r6, [r0, 0x2] - strb r6, [r0, 0x3] - strb r5, [r0, 0x5] - ldrb r1, [r4, 0x4] - strb r1, [r0, 0x4] - mov r1, r8 - strb r1, [r0, 0x7] - movs r0, 0x21 - bl SetPlayerAvatarStateMask - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end InitPlayerAvatar - - thumb_func_start sub_808C0A8 -sub_808C0A8: @ 808C0A8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r6, =0x02037350 - ldr r5, =0x02037590 - ldrb r0, [r5, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - movs r0, 0x1 - ands r4, r0 - lsls r3, r4, 5 - ldrb r2, [r1, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x1] - movs r0, 0x8 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _0808C100 - ldr r2, =0x02020630 - ldrb r1, [r5, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x1A] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x3E - lsls r3, r4, 2 - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r3 - strb r0, [r1] -_0808C100: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808C0A8 - - thumb_func_start sub_808C114 -sub_808C114: @ 808C114 - push {r4,r5,lr} - ldr r5, =0x02037590 - ldrb r0, [r5, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - movs r0, 0x5 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0 - bl StartObjectImageAnim - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808C114 - - thumb_func_start sub_808C15C -sub_808C15C: @ 808C15C - push {r4-r6,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r6, =0x02037590 - ldrb r0, [r6, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - movs r0, 0x6 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r0, [r6, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - adds r0, r5, 0 - bl sub_8092A0C - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808C15C - - thumb_func_start sub_808C1B4 -sub_808C1B4: @ 808C1B4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r6, =0x02037590 - ldrb r0, [r6, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - movs r0, 0x2 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r0, [r6, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - mov r8, r0 - add r4, r8 - adds r0, r5, 0 - bl sub_80929BC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - ldrb r1, [r6, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - movs r1, 0x1 - bl SeekObjectImageAnim - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808C1B4 - - thumb_func_start sub_808C228 -sub_808C228: @ 808C228 - push {r4-r6,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r6, =0x02037590 - ldrb r0, [r6, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - movs r0, 0x7 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r0, [r6, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - adds r0, r5, 0 - bl FieldObjectDirectionToImageAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808C228 - - thumb_func_start sub_808C280 -sub_808C280: @ 808C280 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - adds r5, r0, 0 - ldrb r0, [r5, 0x1E] - mov r8, r0 - movs r1, 0 - mov r0, sp - strh r1, [r0] - movs r6, 0x1 - ldr r1, =gUnknown_08497520 - mov r9, r1 - mov r4, sp - mov r7, sp - adds r7, 0x2 -_0808C2A2: - movs r1, 0 - ldrsh r0, [r4, r1] - lsls r0, 2 - add r0, r9 - ldr r1, [r0] - mov r0, r8 - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - beq _0808C2E8 - ldrb r0, [r5, 0x18] - lsrs r0, 4 - cmp r6, r0 - bne _0808C2E8 - ldrh r0, [r5, 0x10] - strh r0, [r4] - ldrh r0, [r5, 0x12] - strh r0, [r7] - adds r0, r6, 0 - mov r1, sp - adds r2, r7, 0 - bl MoveCoords - ldrb r0, [r5, 0x1B] - movs r1, 0 - ldrsh r2, [r4, r1] - movs r1, 0 - ldrsh r3, [r7, r1] - adds r1, r6, 0 - bl sub_8154298 - b _0808C302 - .pool -_0808C2E8: - ldrh r1, [r4] - adds r1, 0x1 - strh r1, [r4] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x3 - ble _0808C2A2 - ldrb r0, [r5, 0x1B] - bl objid_set_invisible -_0808C302: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_808C280 - - thumb_func_start task_add_bump_boulder -task_add_bump_boulder: @ 808C310 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r6, =taskFF_bump_boulder - adds r0, r6, 0 - movs r1, 0xFF - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0xA] - strh r5, [r1, 0xC] - bl _call_via_r6 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task_add_bump_boulder - - thumb_func_start taskFF_bump_boulder -taskFF_bump_boulder: @ 808C34C - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r6, =gUnknown_08497530 - ldr r2, =0x03005e00 - ldr r5, =0x02037350 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0808C360: - movs r0, 0x8 - ldrsh r3, [r4, r0] - lsls r3, 2 - adds r3, r6 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - movs r2, 0xA - ldrsh r0, [r4, r2] - lsls r2, r0, 3 - adds r2, r0 - lsls r2, 2 - adds r2, r5 - ldr r3, [r3] - adds r0, r4, 0 - bl _call_via_r3 - lsls r0, 24 - cmp r0, 0 - bne _0808C360 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end taskFF_bump_boulder - - thumb_func_start sub_808C3A4 -sub_808C3A4: @ 808C3A4 - push {r4,lr} - adds r4, r0, 0 - bl script_env_2_enable - ldr r1, =0x02037590 - movs r0, 0x1 - strb r0, [r1, 0x6] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808C3A4 - - thumb_func_start do_boulder_dust -@ int do_boulder_dust(int a1, struct npc_state *a2, struct npc_state *a3) -do_boulder_dust: @ 808C3C4 - push {r4-r6,lr} - adds r6, r0, 0 - adds r5, r1, 0 - adds r4, r2, 0 - adds r0, r5, 0 - bl FieldObjectIsSpecialAnimActive - lsls r0, 24 - cmp r0, 0 - beq _0808C3DE - adds r0, r5, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished -_0808C3DE: - adds r0, r4, 0 - bl FieldObjectIsSpecialAnimActive - lsls r0, 24 - cmp r0, 0 - beq _0808C3F0 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished -_0808C3F0: - adds r0, r5, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - bne _0808C472 - adds r0, r4, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - bne _0808C472 - adds r0, r5, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - ldrb r0, [r6, 0xC] - bl GetStepInPlaceDelay16AnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl FieldObjectSetSpecialAnim - ldrb r0, [r6, 0xC] - bl GetSimpleGoAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - ldr r2, =0x02038c08 - movs r1, 0x10 - ldrsh r0, [r4, r1] - str r0, [r2] - movs r1, 0x12 - ldrsh r0, [r4, r1] - str r0, [r2, 0x4] - ldrb r0, [r4, 0xB] - lsrs r0, 4 - str r0, [r2, 0x8] - ldr r3, =0x02020630 - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x5] - lsls r0, 28 - lsrs r0, 30 - str r0, [r2, 0xC] - movs r0, 0xA - bl FieldEffectStart - movs r0, 0xD6 - bl audio_play - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] -_0808C472: - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end do_boulder_dust - - thumb_func_start sub_808C484 -sub_808C484: @ 808C484 - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - adds r0, r4, 0 - bl FieldObjectCheckIfSpecialAnimFinishedOrInactive - lsls r0, 24 - cmp r0, 0 - beq _0808C4C6 - adds r0, r5, 0 - bl FieldObjectCheckIfSpecialAnimFinishedOrInactive - lsls r0, 24 - cmp r0, 0 - beq _0808C4C6 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - adds r0, r5, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - ldr r1, =0x02037590 - movs r0, 0 - strb r0, [r1, 0x6] - bl script_env_2_disable - ldr r0, =taskFF_bump_boulder - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_0808C4C6: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808C484 - - thumb_func_start sub_808C4D8 -sub_808C4D8: @ 808C4D8 - push {r4,lr} - ldr r4, =sub_808C4F8 - adds r0, r4, 0 - movs r1, 0xFF - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808C4D8 - - thumb_func_start sub_808C4F8 -sub_808C4F8: @ 808C4F8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_0849753C - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0808C50A: - movs r0, 0x8 - ldrsh r2, [r4, r0] - lsls r2, 2 - adds r2, r5 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02037350 - adds r1, r0 - ldr r2, [r2] - adds r0, r4, 0 - bl _call_via_r2 - lsls r0, 24 - cmp r0, 0 - bne _0808C50A - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808C4F8 - - thumb_func_start sub_808C544 -sub_808C544: @ 808C544 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - ldr r5, =0x02037590 - movs r0, 0x1 - strb r0, [r5, 0x6] - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _0808C5A0 - movs r0, 0xA - bl audio_play - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl sub_80934BC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - ldrh r0, [r6, 0xA] - adds r0, 0x1 - strh r0, [r6, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0808C5A0 - movs r0, 0 - strb r0, [r5, 0x6] - ldrb r0, [r5, 0x1] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r5, 0x1] - ldr r0, =sub_808C4F8 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_0808C5A0: - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808C544 - - thumb_func_start sub_808C5B0 -sub_808C5B0: @ 808C5B0 - push {r4,lr} - ldr r4, =sub_808C5D0 - adds r0, r4, 0 - movs r1, 0xFF - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808C5B0 - - thumb_func_start sub_808C5D0 -sub_808C5D0: @ 808C5D0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_08497540 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0808C5E2: - movs r0, 0x8 - ldrsh r2, [r4, r0] - lsls r2, 2 - adds r2, r5 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02037350 - adds r1, r0 - ldr r2, [r2] - adds r0, r4, 0 - bl _call_via_r2 - lsls r0, 24 - cmp r0, 0 - bne _0808C5E2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808C5D0 - - thumb_func_start sub_808C61C -sub_808C61C: @ 808C61C - push {lr} - ldrh r2, [r0, 0x8] - adds r2, 0x1 - strh r2, [r0, 0x8] - ldrb r1, [r1, 0x18] - lsrs r1, 4 - strh r1, [r0, 0xA] - ldr r1, =0x02037590 - movs r0, 0x1 - strb r0, [r1, 0x6] - bl script_env_2_enable - movs r0, 0x2D - bl audio_play - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_808C61C - - thumb_func_start sub_808C644 -sub_808C644: @ 808C644 - push {r4-r6,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_08497550 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r0, r5, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _0808C6AC - ldrb r0, [r5, 0x18] - lsrs r0, 4 - subs r0, 0x1 - add r0, sp - ldrb r6, [r0] - adds r0, r6, 0 - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl FieldObjectSetSpecialAnim - ldrb r0, [r4, 0xA] - cmp r6, r0 - bne _0808C68A - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] -_0808C68A: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0x3 - ble _0808C6AC - ldrb r0, [r4, 0xA] - bl GetOppositeDirection - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - bne _0808C6AC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0808C6AC: - movs r0, 0 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808C644 - - thumb_func_start sub_808C6BC -sub_808C6BC: @ 808C6BC - push {r4,r5,lr} - sub sp, 0x8 - adds r5, r0, 0 - adds r4, r1, 0 - ldr r1, =gUnknown_08497554 - mov r0, sp - movs r2, 0x5 - bl memcpy - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _0808C6EC - movs r1, 0xC - ldrsh r0, [r5, r1] - add r0, sp - ldrb r1, [r0] - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - movs r0, 0x1 - strh r0, [r5, 0x8] -_0808C6EC: - movs r0, 0 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808C6BC - - thumb_func_start sub_808C6FC -sub_808C6FC: @ 808C6FC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _0808C740 - ldrb r0, [r4, 0xA] - bl GetOppositeDirection - lsls r0, 24 - lsrs r0, 24 - bl GetSimpleGoAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl FieldObjectSetSpecialAnim - bl script_env_2_disable - ldr r1, =0x02037590 - movs r0, 0 - strb r0, [r1, 0x6] - ldr r0, =sub_808C5D0 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_0808C740: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808C6FC - - thumb_func_start sub_808C750 -sub_808C750: @ 808C750 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl script_env_2_enable - bl sav1_reset_battle_music_maybe - bl sub_8085898 - ldr r2, =0x02037590 - ldrb r1, [r2] - movs r0, 0xF7 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x1 - strb r0, [r2, 0x6] - ldr r5, =taskFF_0805D1D4 - adds r0, r5, 0 - movs r1, 0xFF - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - bl _call_via_r5 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808C750 - - thumb_func_start taskFF_0805D1D4 -taskFF_0805D1D4: @ 808C7A8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r5, r0, r1 - adds r0, r5, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _0808C7D4 - adds r0, r5, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _0808C7FC -_0808C7D4: - ldrb r0, [r5, 0x1A] - movs r1, 0x2 - bl sub_81555AC - ldr r0, =0x03005e00 - lsls r4, r6, 2 - adds r4, r6 - lsls r4, 3 - adds r4, r0 - ldrb r0, [r4, 0x8] - bl sub_8093540 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl FieldObjectSetSpecialAnim - ldr r0, =sub_808C814 - str r0, [r4] -_0808C7FC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end taskFF_0805D1D4 - - thumb_func_start sub_808C814 -sub_808C814: @ 808C814 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r6, =0x02037590 - ldrb r1, [r6, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _0808C87A - movs r0, 0 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - movs r0, 0 - strb r0, [r6, 0x6] - bl script_env_2_disable - ldrb r1, [r4, 0x1A] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - adds r0, r5, 0 - bl DestroyTask -_0808C87A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808C814 - - thumb_func_start StartFishing -StartFishing: @ 808C88C - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =Task_Fish - adds r0, r5, 0 - movs r1, 0xFF - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x26] - bl _call_via_r5 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end StartFishing - - thumb_func_start Task_Fish -Task_Fish: @ 808C8C0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_0849755C - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0808C8D2: - 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 _0808C8D2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end Task_Fish - - thumb_func_start fish0 -fish0: @ 808C8F8 - push {r4,lr} - adds r4, r0, 0 - bl script_env_2_enable - ldr r1, =0x02037590 - movs r0, 0x1 - strb r0, [r1, 0x6] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end fish0 - - thumb_func_start fish1 -fish1: @ 808C918 - push {r4-r6,lr} - sub sp, 0x10 - adds r5, r0, 0 - ldr r1, =gUnknown_0849759C - mov r0, sp - movs r2, 0x6 - bl memcpy - add r4, sp, 0x8 - ldr r1, =gUnknown_084975A2 - adds r0, r4, 0 - movs r2, 0x6 - bl memcpy - movs r0, 0 - strh r0, [r5, 0x20] - bl GenerateRandomNumber - movs r2, 0x26 - ldrsh r1, [r5, r2] - lsls r1, 1 - mov r2, sp - adds r6, r2, r1 - lsls r0, 16 - lsrs r0, 16 - adds r4, r1 - movs r2, 0 - ldrsh r1, [r4, r2] - bl __modsi3 - ldrh r1, [r6] - adds r1, r0 - strh r1, [r5, 0x22] - ldr r3, =0x02037350 - ldr r2, =0x02037590 - ldrb r1, [r2, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x5] - strh r0, [r5, 0x24] - ldrb r0, [r2, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - adds r4, r3 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimActive - ldrb r0, [r4, 0x1] - movs r1, 0x8 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl sub_808C15C - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0 - add sp, 0x10 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end fish1 - - thumb_func_start fish2 -fish2: @ 808C9B0 - push {r4,lr} - adds r4, r0, 0 - bl sub_808CF78 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3B - ble _0808C9CC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0808C9CC: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end fish2 - - thumb_func_start fish3 -fish3: @ 808C9D4 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0 - movs r1, 0x1 - bl sub_819786C - ldrh r0, [r4, 0x8] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x8] - strh r1, [r4, 0xA] - strh r1, [r4, 0xC] - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - adds r1, r0, 0 - adds r0, r1, 0x1 - strh r0, [r4, 0xE] - movs r2, 0x20 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0808CA0C - adds r0, r1, 0x4 - strh r0, [r4, 0xE] -_0808CA0C: - movs r1, 0xE - ldrsh r0, [r4, r1] - cmp r0, 0x9 - ble _0808CA18 - movs r0, 0xA - strh r0, [r4, 0xE] -_0808CA18: - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - thumb_func_end fish3 - - thumb_func_start fish4 -fish4: @ 808CA20 - push {r4,r5,lr} - sub sp, 0x10 - adds r4, r0, 0 - ldr r1, =gUnknown_084975A8 - add r0, sp, 0xC - movs r2, 0x2 - bl memcpy - bl sub_808CF78 - ldrh r0, [r4, 0xA] - adds r1, r0, 0x1 - strh r1, [r4, 0xA] - ldr r0, =0x030022c0 - ldrh r0, [r0, 0x2E] - movs r5, 0x1 - adds r2, r5, 0 - ands r2, r0 - cmp r2, 0 - beq _0808CA64 - movs r0, 0xB - strh r0, [r4, 0x8] - movs r1, 0x20 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0808CA58 - movs r0, 0xC - strh r0, [r4, 0x8] -_0808CA58: - movs r0, 0x1 - b _0808CAB4 - .pool -_0808CA64: - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _0808CAB2 - strh r2, [r4, 0xA] - movs r3, 0xC - ldrsh r1, [r4, r3] - movs r3, 0xE - ldrsh r0, [r4, r3] - cmp r1, r0 - blt _0808CA94 - ldrh r0, [r4, 0x8] - adds r1, r0, 0x1 - strh r1, [r4, 0x8] - ldrh r2, [r4, 0x20] - movs r3, 0x20 - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _0808CA8E - adds r0, r1, 0x1 - strh r0, [r4, 0x8] -_0808CA8E: - adds r0, r2, 0x1 - strh r0, [r4, 0x20] - b _0808CAB2 -_0808CA94: - movs r0, 0xC - ldrsh r3, [r4, r0] - lsls r3, 27 - lsrs r3, 24 - str r5, [sp] - str r2, [sp, 0x4] - str r2, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - add r2, sp, 0xC - bl Print - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] -_0808CAB2: - movs r0, 0 -_0808CAB4: - add sp, 0x10 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end fish4 - - thumb_func_start fish5 -fish5: @ 808CABC - push {r4-r6,lr} - adds r5, r0, 0 - bl sub_808CF78 - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r6, 0 - bl GetFishingWildMonListHeader - lsls r0, 24 - cmp r0, 0 - bne _0808CADC - movs r0, 0xB - strh r0, [r5, 0x8] - b _0808CB5C -_0808CADC: - ldr r4, =0x020244ec - adds r0, r4, 0 - movs r1, 0x6 - bl pokemon_getattr - cmp r0, 0 - bne _0808CB14 - adds r0, r4, 0 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x15 - beq _0808CAFC - cmp r0, 0x3C - bne _0808CB14 -_0808CAFC: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xE - bls _0808CB14 - movs r6, 0x1 -_0808CB14: - cmp r6, 0 - bne _0808CB32 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0808CB30 - movs r0, 0xB - strh r0, [r5, 0x8] - b _0808CB32 - .pool -_0808CB30: - movs r6, 0x1 -_0808CB32: - cmp r6, 0x1 - bne _0808CB5C - ldr r0, =0x02037590 - ldrb r0, [r0, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - bl sub_8092A2C - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim -_0808CB5C: - movs r0, 0x1 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end fish5 - - thumb_func_start fish6 -fish6: @ 808CB6C - push {r4,r5,lr} - sub sp, 0xC - adds r5, r0, 0 - bl sub_808CF78 - ldr r2, =gUnknown_085EE8F7 - movs r0, 0x11 - str r0, [sp] - movs r4, 0 - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl Print - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - strh r4, [r5, 0xA] - movs r0, 0 - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end fish6 - - thumb_func_start fish7 -fish7: @ 808CBA4 - push {r4,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r1, =gUnknown_084975AA - mov r0, sp - movs r2, 0x6 - bl memcpy - bl sub_808CF78 - ldrh r1, [r4, 0xA] - adds r1, 0x1 - strh r1, [r4, 0xA] - movs r2, 0x26 - ldrsh r0, [r4, r2] - lsls r0, 1 - add r0, sp - lsls r1, 16 - asrs r1, 16 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r1, r0 - blt _0808CBDC - movs r0, 0xC - b _0808CBEC - .pool -_0808CBDC: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0808CBEE - ldrh r0, [r4, 0x8] - adds r0, 0x1 -_0808CBEC: - strh r0, [r4, 0x8] -_0808CBEE: - movs r0, 0 - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end fish7 - - thumb_func_start fish8 -fish8: @ 808CBFC - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - ldr r1, =gUnknown_084975B0 - mov r0, sp - movs r2, 0xC - bl memcpy - bl sub_808CF78 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x20 - ldrsh r1, [r4, r0] - movs r2, 0x22 - ldrsh r0, [r4, r2] - cmp r1, r0 - blt _0808CC52 - cmp r1, 0x1 - bgt _0808CC56 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - movs r3, 0x20 - ldrsh r2, [r4, r3] - lsls r2, 1 - movs r3, 0x26 - ldrsh r1, [r4, r3] - lsls r1, 2 - adds r2, r1 - mov r3, sp - adds r1, r3, r2 - movs r2, 0 - ldrsh r1, [r1, r2] - lsls r0, 16 - asrs r0, 16 - cmp r1, r0 - ble _0808CC56 -_0808CC52: - movs r0, 0x3 - strh r0, [r4, 0x8] -_0808CC56: - movs r0, 0 - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end fish8 - - thumb_func_start fish9 -fish9: @ 808CC64 - push {r4,r5,lr} - sub sp, 0x10 - adds r4, r0, 0 - bl sub_808CF78 - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_085EE903 - movs r5, 0 - str r5, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - movs r3, 0x1 - bl AddTextPrinterParametrized - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - strh r5, [r4, 0xA] - movs r0, 0 - add sp, 0x10 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end fish9 - - thumb_func_start fishA_wait_for_a_pressed -fishA_wait_for_a_pressed: @ 808CCA8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0808CCBC - bl sub_808CF78 -_0808CCBC: - bl RunTextPrinters - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0808CD58 - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0 - bne _0808CD50 - ldr r7, =0x02037590 - ldrb r0, [r7, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - mov r8, r0 - add r4, r8 - ldrh r1, [r5, 0x24] - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r1, [r4, 0x18] - lsrs r1, 4 - adds r0, r4, 0 - bl FieldObjectTurn - ldrb r1, [r7] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0808CD1A - ldrb r0, [r7, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - add r1, r8 - ldrb r0, [r1, 0x1A] - movs r1, 0 - movs r2, 0 - bl sub_8155604 -_0808CD1A: - ldr r2, =0x02020630 - ldrb r1, [r7, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r6, [r0, 0x24] - ldrb r1, [r7, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r6, [r0, 0x26] - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - ldrh r0, [r5, 0xA] - adds r0, 0x1 - strh r0, [r5, 0xA] - b _0808CD80 - .pool -_0808CD50: - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _0808CD80 -_0808CD58: - ldr r1, =0x02037590 - movs r0, 0 - strb r0, [r1, 0x6] - bl script_env_2_disable - ldrh r0, [r5, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl sub_80B5734 - movs r0, 0x1 - bl sub_80ED950 - ldr r0, =Task_Fish - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_0808CD80: - movs r0, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end fishA_wait_for_a_pressed - - thumb_func_start fishB -fishB: @ 808CD94 - push {r4,r5,lr} - sub sp, 0x10 - adds r5, r0, 0 - bl sub_808CF78 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - bl sub_8092A1C - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_085EE91E - 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, 0 - movs r1, 0x1 - movs r3, 0x1 - bl AddTextPrinterParametrized - movs r0, 0xD - strh r0, [r5, 0x8] - movs r0, 0x1 - add sp, 0x10 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end fishB - - thumb_func_start fishC -fishC: @ 808CE04 - push {r4,r5,lr} - sub sp, 0x10 - adds r5, r0, 0 - bl sub_808CF78 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - bl sub_8092A1C - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_085EE933 - 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, 0 - movs r1, 0x1 - movs r3, 0x1 - bl AddTextPrinterParametrized - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0x1 - add sp, 0x10 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end fishC - - thumb_func_start fishD -fishD: @ 808CE74 - push {r4,lr} - adds r4, r0, 0 - bl sub_808CF78 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end fishD - - thumb_func_start fishE -fishE: @ 808CE8C - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - bl sub_808CF78 - ldr r7, =0x02020630 - ldr r5, =0x02037590 - ldrb r0, [r5, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - adds r1, 0x3F - ldrb r0, [r1] - lsls r0, 27 - cmp r0, 0 - bge _0808CF12 - ldrb r0, [r5, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - mov r8, r0 - add r4, r8 - ldrh r1, [r6, 0x24] - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r1, [r4, 0x18] - lsrs r1, 4 - adds r0, r4, 0 - bl FieldObjectTurn - ldrb r1, [r5] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0808CEF2 - ldrb r0, [r5, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - add r1, r8 - ldrb r0, [r1, 0x1A] - movs r1, 0 - movs r2, 0 - bl sub_8155604 -_0808CEF2: - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - movs r2, 0 - strh r2, [r0, 0x24] - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] -_0808CF12: - movs r0, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end fishE - - thumb_func_start fishF -fishF: @ 808CF2C - push {lr} - bl RunTextPrinters - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - bne _0808CF68 - ldr r0, =0x02037590 - strb r1, [r0, 0x6] - bl script_env_2_disable - bl sub_809757C - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - movs r0, 0 - bl sub_80ED950 - ldr r0, =Task_Fish - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_0808CF68: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end fishF - - thumb_func_start sub_808CF78 -sub_808CF78: @ 808CF78 - push {r4-r7,lr} - ldr r0, =0x02037590 - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r4, r0, r1 - adds r0, r4, 0 - bl AnimateObject - movs r0, 0 - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - adds r0, r4, 0 - adds r0, 0x2B - ldrb r5, [r0] - movs r0, 0x2A - adds r0, r4 - mov r12, r0 - ldrb r0, [r0] - ldr r1, [r4, 0x8] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - lsls r6, r5, 2 - adds r0, r6, r0 - movs r1, 0 - ldrsh r0, [r0, r1] - movs r7, 0x1 - negs r7, r7 - cmp r0, r7 - beq _0808CFEA - adds r3, r4, 0 - adds r3, 0x2C - ldrb r2, [r3] - lsls r1, r2, 26 - lsrs r1, 26 - adds r1, 0x1 - movs r0, 0x3F - ands r1, r0 - movs r0, 0x40 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - mov r1, r12 - ldrb r0, [r1] - ldr r1, [r4, 0x8] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - adds r0, r6, r0 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, r7 - bne _0808CFF0 -_0808CFEA: - subs r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_0808CFF0: - adds r0, r4, 0 - adds r0, 0x2A - ldrb r0, [r0] - ldr r1, [r4, 0x8] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - lsls r0, r5, 2 - adds r0, r1 - ldrb r5, [r0] - subs r0, r5, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bhi _0808D022 - movs r0, 0x8 - strh r0, [r4, 0x24] - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _0808D022 - ldr r0, =0x0000fff8 - strh r0, [r4, 0x24] -_0808D022: - cmp r5, 0x5 - bne _0808D02A - ldr r0, =0x0000fff8 - strh r0, [r4, 0x26] -_0808D02A: - adds r0, r5, 0 - subs r0, 0xA - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _0808D03A - movs r0, 0x8 - strh r0, [r4, 0x26] -_0808D03A: - ldr r3, =0x02037590 - ldrb r1, [r3] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0808D05E - ldr r2, =0x02037350 - ldrb r1, [r3, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1A] - movs r1, 0x26 - ldrsh r2, [r4, r1] - movs r1, 0x1 - bl sub_8155604 -_0808D05E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808CF78 - - thumb_func_start sub_808D074 -sub_808D074: @ 808D074 - ldr r1, =0x0203734c - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_808D074 - - thumb_func_start sub_808D080 -sub_808D080: @ 808D080 - push {lr} - ldr r1, =0x0203734c - ldrb r0, [r1] - cmp r0, 0 - bne _0808D08C - movs r0, 0x1 -_0808D08C: - pop {r1} - bx r1 - .pool - thumb_func_end sub_808D080 - - thumb_func_start sub_808D094 -sub_808D094: @ 808D094 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - adds r2, r0, 0 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r7, r0, r1 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - movs r0, 0 - ldrsh r6, [r5, r0] - cmp r6, 0x1 - beq _0808D14A - cmp r6, 0x1 - bgt _0808D0E8 - cmp r6, 0 - beq _0808D0EE - b _0808D18A - .pool -_0808D0E8: - cmp r6, 0x2 - beq _0808D184 - b _0808D18A -_0808D0EE: - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _0808D18A - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl sub_808D074 - movs r1, 0 - mov r8, r1 - strh r6, [r5, 0x2] - movs r0, 0x1 - strh r0, [r5, 0x4] - ldrh r0, [r7, 0x26] - ldrh r2, [r7, 0x22] - adds r0, r2 - lsls r0, 4 - strh r0, [r5, 0x6] - strh r6, [r7, 0x26] - bl CameraObjectReset2 - ldrb r0, [r4, 0x3] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4, 0x3] - ldrb r1, [r7, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - strb r0, [r7, 0x5] - adds r0, r7, 0 - adds r0, 0x43 - mov r1, r8 - strb r1, [r0] - adds r2, r7, 0 - adds r2, 0x42 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - strb r0, [r2] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] -_0808D14A: - adds r1, r5, 0x2 - adds r0, r4, 0 - bl sub_808D38C - ldrh r0, [r5, 0x6] - ldrh r1, [r5, 0x4] - subs r0, r1 - strh r0, [r5, 0x6] - adds r1, 0x3 - strh r1, [r5, 0x4] - lsls r0, 16 - asrs r0, 20 - strh r0, [r7, 0x22] - movs r2, 0x22 - ldrsh r1, [r7, r2] - ldr r0, =0x03005de8 - movs r2, 0 - ldrsh r0, [r0, r2] - adds r1, r0 - movs r0, 0x20 - negs r0, r0 - cmp r1, r0 - bge _0808D18A - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - b _0808D18A - .pool -_0808D184: - adds r0, r2, 0 - bl DestroyTask -_0808D18A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_808D094 - - thumb_func_start sub_808D194 -sub_808D194: @ 808D194 - push {r4,lr} - ldr r4, =sub_808D1FC - adds r0, r4, 0 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808D194 - - thumb_func_start sub_808D1B4 -sub_808D1B4: @ 808D1B4 - push {lr} - ldr r0, =sub_808D1FC - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_808D1B4 - - thumb_func_start sub_808D1C8 -sub_808D1C8: @ 808D1C8 - push {r4,lr} - ldr r4, =sub_808D094 - adds r0, r4, 0 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808D1C8 - - thumb_func_start sub_808D1E8 -sub_808D1E8: @ 808D1E8 - push {lr} - ldr r0, =sub_808D094 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_808D1E8 - - thumb_func_start sub_808D1FC -sub_808D1FC: @ 808D1FC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r7, r0, r1 - mov r1, r8 - lsls r0, r1, 2 - add r0, r8 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - movs r2, 0 - ldrsh r6, [r5, r2] - cmp r6, 0x1 - beq _0808D2DE - cmp r6, 0x1 - bgt _0808D254 - cmp r6, 0 - beq _0808D25E - b _0808D37E - .pool -_0808D254: - cmp r6, 0x2 - beq _0808D31C - cmp r6, 0x3 - beq _0808D33A - b _0808D37E -_0808D25E: - bl sub_808D080 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0xA] - ldr r1, =gUnknown_084975BC - movs r3, 0xA - ldrsh r0, [r5, r3] - adds r0, r1 - ldrb r0, [r0] - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectForceSetSpecialAnim - movs r0, 0 - mov r9, r0 - strh r6, [r5, 0x2] - movs r0, 0x74 - strh r0, [r5, 0x4] - ldrh r0, [r7, 0x22] - strh r0, [r5, 0x8] - ldrb r0, [r7, 0x5] - lsls r0, 28 - lsrs r0, 30 - strh r0, [r5, 0xC] - movs r1, 0x43 - adds r1, r7 - mov r8, r1 - ldrb r0, [r1] - strh r0, [r5, 0xE] - ldrh r0, [r7, 0x26] - adds r0, 0x20 - negs r0, r0 - lsls r0, 4 - strh r0, [r5, 0x6] - strh r6, [r7, 0x26] - bl CameraObjectReset2 - ldrb r0, [r4, 0x3] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r4, 0x3] - ldrb r1, [r7, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - orrs r0, r2 - strb r0, [r7, 0x5] - mov r3, r9 - mov r2, r8 - strb r3, [r2] - adds r2, r7, 0 - adds r2, 0x42 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - strb r0, [r2] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] -_0808D2DE: - adds r1, r5, 0x2 - adds r0, r4, 0 - bl sub_808D38C - ldrh r0, [r5, 0x4] - ldrh r2, [r5, 0x6] - adds r1, r0, r2 - strh r1, [r5, 0x6] - subs r0, 0x3 - strh r0, [r5, 0x4] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bgt _0808D2FE - movs r0, 0x4 - strh r0, [r5, 0x4] -_0808D2FE: - ldrh r0, [r5, 0x6] - lsls r0, 16 - asrs r0, 20 - strh r0, [r7, 0x22] - ldrh r2, [r5, 0x8] - movs r3, 0x8 - ldrsh r1, [r5, r3] - cmp r0, r1 - blt _0808D37E - strh r2, [r7, 0x22] - movs r0, 0 - strh r0, [r5, 0x10] - b _0808D332 - .pool -_0808D31C: - adds r1, r5, 0x2 - adds r0, r4, 0 - bl sub_808D38C - ldrh r0, [r5, 0x10] - adds r0, 0x1 - strh r0, [r5, 0x10] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _0808D37E -_0808D332: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - b _0808D37E -_0808D33A: - movs r0, 0xA - ldrsh r6, [r5, r0] - adds r1, r5, 0x2 - adds r0, r4, 0 - bl sub_808D38C - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - bne _0808D37E - ldrb r1, [r4, 0x3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x3] - movs r0, 0x3 - ldrb r1, [r5, 0xC] - ands r1, r0 - lsls r1, 2 - ldrb r2, [r7, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r7, 0x5] - ldrh r1, [r5, 0xE] - adds r0, r7, 0 - adds r0, 0x43 - strb r1, [r0] - bl CameraObjectReset1 - mov r0, r8 - bl DestroyTask -_0808D37E: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_808D1FC - - thumb_func_start sub_808D38C -sub_808D38C: @ 808D38C - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - ldrh r1, [r6] - movs r2, 0 - ldrsh r0, [r6, r2] - cmp r0, 0x7 - bgt _0808D3A8 - adds r0, r1, 0x1 - strh r0, [r6] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _0808D3E4 -_0808D3A8: - adds r0, r5, 0 - bl FieldObjectCheckIfSpecialAnimFinishedOrInactive - lsls r0, 24 - cmp r0, 0 - beq _0808D3E4 - ldr r4, =gUnknown_084975BC - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - adds r0, r4 - ldrb r0, [r0] - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl FieldObjectForceSetSpecialAnim - movs r0, 0 - strh r0, [r6] - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - adds r0, r4 - ldrb r0, [r0] - b _0808D3EA - .pool -_0808D3E4: - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 -_0808D3EA: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_808D38C - - thumb_func_start npc_clear_ids_and_state -npc_clear_ids_and_state: @ 808D3F0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - movs r2, 0x24 - bl memset - movs r0, 0xFF - strb r0, [r4, 0x8] - movs r0, 0x1 - negs r0, r0 - strb r0, [r4, 0x9] - strb r0, [r4, 0xA] - strb r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - thumb_func_end npc_clear_ids_and_state - - thumb_func_start npcs_clear_ids_and_state -npcs_clear_ids_and_state: @ 808D410 - push {r4,r5,lr} - movs r4, 0 - ldr r5, =0x02037350 -_0808D416: - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - adds r0, r5 - bl npc_clear_ids_and_state - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _0808D416 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end npcs_clear_ids_and_state - - thumb_func_start sub_808D438 -sub_808D438: @ 808D438 - push {lr} - bl strange_npc_table_clear - bl npcs_clear_ids_and_state - bl ClearPlayerAvatarInfo - bl sub_808D450 - pop {r0} - bx r0 - thumb_func_end sub_808D438 - - thumb_func_start sub_808D450 -sub_808D450: @ 808D450 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x54] - mov r9, r0 - movs r1, 0 - movs r2, 0 - movs r3, 0x1F - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02020630 - mov r10, r1 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - add r4, r10 - ldrb r1, [r4, 0x1] - movs r5, 0x4 - negs r5, r5 - adds r0, r5, 0 - ands r0, r1 - movs r1, 0x1 - mov r8, r1 - mov r1, r8 - orrs r0, r1 - strb r0, [r4, 0x1] - adds r0, r4, 0 - bl obj_alloc_rotscale_entry - adds r0, r4, 0 - movs r1, 0 - bl StartObjectRotScalAnim - adds r4, 0x3E - ldrb r0, [r4] - movs r6, 0x4 - orrs r0, r6 - strb r0, [r4] - mov r0, r9 - movs r1, 0 - movs r2, 0 - movs r3, 0x1F - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - add r4, r10 - ldrb r0, [r4, 0x1] - ands r5, r0 - mov r0, r8 - orrs r5, r0 - strb r5, [r4, 0x1] - adds r0, r4, 0 - bl obj_alloc_rotscale_entry - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - adds r4, 0x3E - ldrb r0, [r4] - orrs r0, r6 - strb r0, [r4] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808D450 - - thumb_func_start sub_808D4F4 -sub_808D4F4: @ 808D4F4 - push {lr} - movs r1, 0 - ldr r2, =0x02037350 - ldrb r0, [r2] - b _0808D518 - .pool -_0808D504: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bhi _0808D51E - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] -_0808D518: - lsls r0, 31 - cmp r0, 0 - bne _0808D504 -_0808D51E: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end sub_808D4F4 - - thumb_func_start GetFieldObjectIdByLocalIdAndMap -@ u8 GetFieldObjectIdByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) -GetFieldObjectIdByLocalIdAndMap: @ 808D524 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - cmp r0, 0xFE - bls _0808D53C - bl GetFieldObjectIdByLocalId - b _0808D540 -_0808D53C: - bl GetFieldObjectIdByLocalIdAndMapInternal -_0808D540: - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end GetFieldObjectIdByLocalIdAndMap - - thumb_func_start TryGetFieldObjectIdByLocalIdAndMap -@ bool8 TryGetFieldObjectIdByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId, u8 *fieldObjectId) -TryGetFieldObjectIdByLocalIdAndMap: @ 808D548 - push {r4,lr} - adds r4, r3, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - bl GetFieldObjectIdByLocalIdAndMap - strb r0, [r4] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - beq _0808D56A - movs r0, 0 - b _0808D56C -_0808D56A: - movs r0, 0x1 -_0808D56C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end TryGetFieldObjectIdByLocalIdAndMap - - thumb_func_start GetFieldObjectIdByXY -@ u8 GetFieldObjectIdByXY(s16 x, s16 y) -GetFieldObjectIdByXY: @ 808D574 - push {r4-r6,lr} - movs r3, 0 - ldr r5, =0x02037350 - lsls r0, 16 - asrs r4, r0, 16 - lsls r1, 16 - asrs r1, 16 -_0808D582: - lsls r0, r3, 3 - adds r0, r3 - lsls r0, 2 - adds r2, r0, r5 - ldrb r0, [r2] - lsls r0, 31 - cmp r0, 0 - beq _0808D5A2 - movs r6, 0x10 - ldrsh r0, [r2, r6] - cmp r0, r4 - bne _0808D5A2 - movs r6, 0x12 - ldrsh r0, [r2, r6] - cmp r0, r1 - beq _0808D5AC -_0808D5A2: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0xF - bls _0808D582 -_0808D5AC: - adds r0, r3, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end GetFieldObjectIdByXY - - thumb_func_start GetFieldObjectIdByLocalIdAndMapInternal -@ u8 GetFieldObjectIdByLocalIdAndMapInternal(u8 localId, u8 mapId, u8 mapGroupId) -GetFieldObjectIdByLocalIdAndMapInternal: @ 808D5B8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - lsls r2, 24 - lsrs r2, 24 - movs r1, 0 - ldr r6, =0x02037350 -_0808D5CA: - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r3, r0, r6 - ldrb r0, [r3] - lsls r0, 31 - cmp r0, 0 - beq _0808D5F4 - ldrb r0, [r3, 0x8] - cmp r0, r5 - bne _0808D5F4 - ldrb r0, [r3, 0x9] - cmp r0, r4 - bne _0808D5F4 - ldrb r0, [r3, 0xA] - cmp r0, r2 - bne _0808D5F4 - adds r0, r1, 0 - b _0808D600 - .pool -_0808D5F4: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bls _0808D5CA - movs r0, 0x10 -_0808D600: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end GetFieldObjectIdByLocalIdAndMapInternal - - thumb_func_start GetFieldObjectIdByLocalId -@ u8 GetFieldObjectIdByLocalId(u8 localId) -GetFieldObjectIdByLocalId: @ 808D608 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - movs r2, 0 - ldr r4, =0x02037350 -_0808D612: - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r4 - ldrb r0, [r1] - lsls r0, 31 - cmp r0, 0 - beq _0808D630 - ldrb r0, [r1, 0x8] - cmp r0, r3 - bne _0808D630 - adds r0, r2, 0 - b _0808D63C - .pool -_0808D630: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bls _0808D612 - movs r0, 0x10 -_0808D63C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetFieldObjectIdByLocalId - - thumb_func_start InitFieldObjectStateFromTemplate -@ u8 InitFieldObjectStateFromTemplate(struct FieldObjectTemplate *fieldObjectTemplate, u8 mapId, u8 mapGroupId) -InitFieldObjectStateFromTemplate: @ 808D644 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - adds r5, r0, 0 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r7, r2, 24 - ldrb r0, [r5] - adds r1, r6, 0 - adds r2, r7, 0 - mov r3, sp - bl GetAvailableFieldObjectSlot - lsls r0, 24 - cmp r0, 0 - beq _0808D66E - movs r0, 0x10 - b _0808D762 -_0808D66E: - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - adds r0, r4, 0 - bl npc_clear_ids_and_state - ldrh r3, [r5, 0x4] - adds r3, 0x7 - lsls r3, 16 - lsrs r3, 16 - ldrh r2, [r5, 0x6] - adds r2, 0x7 - lsls r2, 16 - lsrs r2, 16 - ldrb r0, [r4] - movs r1, 0x1 - orrs r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4] - ldrb r0, [r5, 0x1] - strb r0, [r4, 0x5] - ldrb r0, [r5, 0x9] - strb r0, [r4, 0x6] - ldrb r0, [r5] - strb r0, [r4, 0x8] - strb r6, [r4, 0x9] - strb r7, [r4, 0xA] - strh r3, [r4, 0xC] - strh r2, [r4, 0xE] - strh r3, [r4, 0x10] - strh r2, [r4, 0x12] - strh r3, [r4, 0x14] - strh r2, [r4, 0x16] - ldrb r0, [r5, 0x8] - movs r7, 0xF - adds r1, r7, 0 - ands r1, r0 - ldrb r2, [r4, 0xB] - movs r0, 0x10 - negs r0, r0 - mov r8, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0xB] - ldrb r1, [r5, 0x8] - lsls r1, 4 - ands r0, r7 - orrs r0, r1 - strb r0, [r4, 0xB] - ldrb r1, [r5, 0xA] - lsls r1, 28 - movs r0, 0xF - mov r9, r0 - lsrs r1, 28 - ldrb r2, [r4, 0x19] - mov r0, r8 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x19] - ldrb r1, [r5, 0xA] - lsrs r1, 4 - lsls r1, 4 - ands r0, r7 - orrs r0, r1 - strb r0, [r4, 0x19] - ldrh r0, [r5, 0xC] - strb r0, [r4, 0x7] - ldrh r0, [r5, 0xE] - strb r0, [r4, 0x1D] - ldr r1, =gUnknown_085055CD - ldrb r0, [r5, 0x9] - adds r0, r1 - ldrb r1, [r0] - adds r0, r4, 0 - adds r0, 0x20 - strb r1, [r0] - ldrb r1, [r0] - adds r0, r4, 0 - bl FieldObjectSetDirection - adds r0, r4, 0 - bl FieldObjectHandleDynamicGraphicsId - ldr r1, =gUnknown_0850557C - ldrb r0, [r4, 0x6] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _0808D75E - ldrb r2, [r4, 0x19] - adds r0, r7, 0 - ands r0, r2 - cmp r0, 0 - bne _0808D746 - lsls r0, r2, 28 - lsrs r0, 28 - adds r0, 0x1 - mov r1, r9 - ands r0, r1 - mov r1, r8 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0x19] -_0808D746: - ldrb r2, [r4, 0x19] - movs r0, 0xF0 - ands r0, r2 - cmp r0, 0 - bne _0808D75E - lsrs r1, r2, 4 - adds r1, 0x1 - lsls r1, 4 - adds r0, r7, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x19] -_0808D75E: - mov r0, sp - ldrb r0, [r0] -_0808D762: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end InitFieldObjectStateFromTemplate - - thumb_func_start sub_808D77C -sub_808D77C: @ 808D77C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r4, =0x02037318 - ldr r0, [r4, 0x4] - cmp r0, 0 - beq _0808D7FE - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0808D7A8 - bl sub_81AAA40 - lsls r0, 24 - lsrs r6, r0, 24 - b _0808D7CA - .pool -_0808D7A8: - bl InTrainerHill - cmp r0, 0 - beq _0808D7C6 - movs r6, 0x2 - b _0808D7CA -_0808D7B4: - ldr r0, [r7] - ldrb r1, [r0, 0x5] - ldrb r2, [r0, 0x4] - adds r0, r4, 0 - bl InitFieldObjectStateFromTemplate - lsls r0, 24 - lsrs r0, 24 - b _0808D800 -_0808D7C6: - ldr r0, [r4, 0x4] - ldrb r6, [r0] -_0808D7CA: - movs r5, 0 - cmp r5, r6 - bcs _0808D7FE - ldr r7, =0x03005d8c -_0808D7D2: - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 3 - movs r1, 0xC7 - lsls r1, 4 - adds r0, r1 - ldr r1, [r7] - adds r4, r1, r0 - ldrb r0, [r4] - cmp r0, r8 - bne _0808D7F4 - ldrh r0, [r4, 0x14] - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0808D7B4 -_0808D7F4: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r6 - bcc _0808D7D2 -_0808D7FE: - movs r0, 0x10 -_0808D800: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808D77C - - thumb_func_start GetAvailableFieldObjectSlot -@ bool8 GetAvailableFieldObjectSlot(u16 localId, u8 mapId, u8 mapGroupId, u8 *fieldObjectId) -GetAvailableFieldObjectSlot: @ 808D810 - push {r4-r7,lr} - mov r12, r3 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r4, r2, 24 - movs r2, 0 - ldr r1, =0x02037350 - ldrb r0, [r1] - lsls r0, 31 - adds r7, r1, 0 - cmp r0, 0 - beq _0808D864 - adds r3, r1, 0 -_0808D830: - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r3 - ldrb r0, [r1, 0x8] - cmp r0, r6 - bne _0808D84A - ldrb r0, [r1, 0x9] - cmp r0, r5 - bne _0808D84A - ldrb r0, [r1, 0xA] - cmp r0, r4 - beq _0808D868 -_0808D84A: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bhi _0808D868 - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r0, r7 - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - bne _0808D830 -_0808D864: - cmp r2, 0xF - bls _0808D870 -_0808D868: - movs r0, 0x1 - b _0808D8A4 - .pool -_0808D870: - mov r0, r12 - strb r2, [r0] - ldr r1, =0x02037350 -_0808D876: - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r3, r0, r1 - ldrb r0, [r3] - lsls r0, 31 - cmp r0, 0 - beq _0808D898 - ldrb r0, [r3, 0x8] - cmp r0, r6 - bne _0808D898 - ldrb r0, [r3, 0x9] - cmp r0, r5 - bne _0808D898 - ldrb r0, [r3, 0xA] - cmp r0, r4 - beq _0808D868 -_0808D898: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bls _0808D876 - movs r0, 0 -_0808D8A4: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end GetAvailableFieldObjectSlot - - thumb_func_start RemoveFieldObject -@ void RemoveFieldObject(npc_state *fieldObject) -RemoveFieldObject: @ 808D8B0 - push {lr} - ldrb r2, [r0] - movs r1, 0x2 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - bl RemoveFieldObjectInternal - pop {r0} - bx r0 - thumb_func_end RemoveFieldObject - - thumb_func_start RemoveFieldObjectByLocalIdAndMap -@ void RemoveFieldObjectByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapBank) -RemoveFieldObjectByLocalIdAndMap: @ 808D8C4 - push {lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808D902 - mov r0, sp - ldrb r0, [r0] - bl GetFieldObjectFlagIdByFieldObjectId - lsls r0, 16 - lsrs r0, 16 - bl FlagSet - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - bl RemoveFieldObject -_0808D902: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end RemoveFieldObjectByLocalIdAndMap - - thumb_func_start RemoveFieldObjectInternal -@ void RemoveFieldObjectInternal(npc_state *fieldObject) -RemoveFieldObjectInternal: @ 808D90C - push {r4,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldrb r0, [r4, 0x5] - bl GetFieldObjectGraphicsInfo - ldrh r2, [r0, 0x6] - ldr r1, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r1 - orrs r0, r2 - str r0, [sp, 0x4] - ldr r2, =0x02020630 - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r2, 0 - adds r1, 0xC - adds r0, r1 - mov r1, sp - str r1, [r0] - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - bl RemoveObjectAndFreeTiles - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end RemoveFieldObjectInternal - - thumb_func_start sub_808D958 -sub_808D958: @ 808D958 - push {r4,lr} - movs r4, 0 -_0808D95C: - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - cmp r4, r0 - beq _0808D972 - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - bl RemoveFieldObject -_0808D972: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _0808D95C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808D958 - - thumb_func_start SpawnFieldObjectInternal -@ u8 SpawnFieldObjectInternal(struct FieldObjectTemplate *romFieldObject, struct objtemplate *template, int mapId, int mapGroupId, u16 movingCameraOffsetX, u16 movingCameraOffsetY) -SpawnFieldObjectInternal: @ 808D98C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r1 - adds r1, r2, 0 - adds r2, r3, 0 - ldr r3, [sp, 0x24] - ldr r4, [sp, 0x28] - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 16 - lsrs r3, 16 - mov r10, r3 - lsls r4, 16 - lsrs r4, 16 - str r4, [sp] - bl InitFieldObjectStateFromTemplate - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - cmp r0, 0x10 - bne _0808D9C8 - movs r0, 0x10 - b _0808DB2C -_0808D9C8: - mov r0, r9 - lsls r4, r0, 3 - adds r0, r4, r0 - lsls r0, 2 - ldr r1, =0x02037350 - adds r6, r0, r1 - ldrb r0, [r6, 0x5] - bl GetFieldObjectGraphicsInfo - adds r7, r0, 0 - ldrb r0, [r7, 0xC] - lsls r0, 28 - lsrs r5, r0, 28 - cmp r5, 0 - bne _0808D9F4 - ldrh r0, [r7, 0x2] - movs r1, 0 - bl npc_load_two_palettes__no_record - b _0808DA16 - .pool -_0808D9F4: - cmp r5, 0xA - bne _0808DA02 - ldrh r0, [r7, 0x2] - movs r1, 0xA - bl npc_load_two_palettes__and_record - b _0808DA16 -_0808DA02: - cmp r5, 0xF - bls _0808DA16 - adds r0, r5, 0 - subs r0, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - ldrh r0, [r7, 0x2] - adds r1, r5, 0 - bl sub_808EAB0 -_0808DA16: - ldrb r0, [r6, 0x6] - cmp r0, 0x4C - bne _0808DA24 - ldrb r0, [r6, 0x1] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r6, 0x1] -_0808DA24: - ldr r1, =0x0000ffff - adds r0, r1, 0 - mov r2, r8 - strh r0, [r2, 0x2] - mov r0, r8 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x40 - bne _0808DA64 - ldr r0, =0x02037350 - mov r2, r9 - adds r1, r4, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - movs r0, 0x10 - b _0808DB2C - .pool -_0808DA64: - mov r1, r8 - lsls r0, r1, 4 - add r0, r8 - lsls r0, 2 - ldr r1, =0x02020630 - adds r4, r0, r1 - mov r2, r10 - lsls r0, r2, 16 - asrs r0, 16 - ldrh r1, [r6, 0x10] - adds r0, r1 - lsls r0, 16 - asrs r0, 16 - ldr r2, [sp] - lsls r1, r2, 16 - asrs r1, 16 - ldrh r2, [r6, 0x12] - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - adds r2, r4, 0 - adds r2, 0x20 - adds r3, r4, 0 - adds r3, 0x22 - bl sub_8092FF0 - ldrh r0, [r7, 0x8] - lsls r0, 16 - asrs r0, 17 - negs r0, r0 - adds r1, r4, 0 - adds r1, 0x28 - strb r0, [r1] - ldrh r0, [r7, 0xA] - lsls r0, 16 - asrs r0, 17 - negs r0, r0 - adds r2, r4, 0 - adds r2, 0x29 - strb r0, [r2] - ldrh r0, [r4, 0x20] - adds r0, 0x8 - strh r0, [r4, 0x20] - ldrh r1, [r4, 0x22] - adds r1, 0x10 - movs r0, 0 - ldrsb r0, [r2, r0] - adds r0, r1 - strh r0, [r4, 0x22] - lsls r2, r5, 4 - ldrb r1, [r4, 0x5] - movs r0, 0xF - ands r0, r1 - orrs r0, r2 - strb r0, [r4, 0x5] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] - mov r0, r9 - strh r0, [r4, 0x2E] - mov r1, r8 - strb r1, [r6, 0x4] - ldrb r1, [r7, 0xC] - lsls r1, 25 - lsrs r1, 31 - lsls r1, 4 - ldrb r2, [r6, 0x1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r6, 0x1] - lsls r0, 27 - cmp r0, 0 - blt _0808DB16 - ldrb r0, [r6, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl FieldObjectDirectionToImageAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim -_0808DB16: - ldrb r0, [r6, 0xB] - lsrs r0, 4 - adds r1, r4, 0 - movs r2, 0x1 - bl SetObjectSubpriorityByZCoord - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_8096518 - mov r0, r9 -_0808DB2C: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end SpawnFieldObjectInternal - - thumb_func_start SpawnFieldObject -@ u8 SpawnFieldObject(struct FieldObjectTemplate *romNpc, u8 mapId, u8 mapGroupId, u16 movingCameraOffsetX, u16 movingCameraOffsetY) -SpawnFieldObject: @ 808DB40 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x2C - mov r9, r0 - adds r6, r1, 0 - mov r8, r2 - adds r4, r3, 0 - ldr r5, [sp, 0x48] - lsls r6, 24 - lsrs r6, 24 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - movs r0, 0 - str r0, [sp, 0x20] - mov r1, r9 - ldrb r0, [r1, 0x1] - bl GetFieldObjectGraphicsInfo - adds r7, r0, 0 - add r2, sp, 0x20 - mov r0, r9 - add r1, sp, 0x8 - bl MakeObjectTemplateFromFieldObjectTemplate - ldrh r3, [r7, 0x6] - ldr r2, =0xffff0000 - add r1, sp, 0x24 - ldr r0, [r1, 0x4] - ands r0, r2 - orrs r0, r3 - str r0, [r1, 0x4] - str r1, [sp, 0x14] - lsls r4, 16 - asrs r4, 16 - str r4, [sp] - lsls r5, 16 - asrs r5, 16 - str r5, [sp, 0x4] - mov r0, r9 - add r1, sp, 0x8 - adds r2, r6, 0 - mov r3, r8 - bl SpawnFieldObjectInternal - lsls r0, 24 - lsrs r2, r0, 24 - adds r5, r2, 0 - cmp r2, 0x10 - bne _0808DBBC - movs r0, 0x10 - b _0808DBF2 - .pool -_0808DBBC: - ldr r4, =0x02020630 - ldr r1, =0x02037350 - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r3, r0, r1 - ldrb r1, [r3, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0xC - adds r0, r1 - ldr r1, [r7, 0x1C] - str r1, [r0] - ldr r2, [sp, 0x20] - cmp r2, 0 - beq _0808DBF0 - ldrb r1, [r3, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r1, r2, 0 - bl SetSpriteOamTables_NoPriorityFromTable -_0808DBF0: - adds r0, r5, 0 -_0808DBF2: - add sp, 0x2C - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end SpawnFieldObject - - thumb_func_start SpawnSpecialFieldObject -@ u8 SpawnSpecialFieldObject(struct FieldObjectTemplate *romFieldObject) -SpawnSpecialFieldObject: @ 808DC08 - push {r4-r6,lr} - sub sp, 0x8 - adds r5, r0, 0 - mov r4, sp - adds r4, 0x6 - add r0, sp, 0x4 - adds r1, r4, 0 - bl GetFieldObjectMovingCameraOffset - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrb r1, [r0, 0x5] - ldrb r2, [r0, 0x4] - add r0, sp, 0x4 - movs r6, 0 - ldrsh r3, [r0, r6] - movs r6, 0 - ldrsh r0, [r4, r6] - str r0, [sp] - adds r0, r5, 0 - bl SpawnFieldObject - lsls r0, 24 - lsrs r0, 24 - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end SpawnSpecialFieldObject - - thumb_func_start SpawnSpecialFieldObjectParametrized -@ u8 SpawnSpecialFieldObjectParametrized(u8 graphicsId, u8 movementBehavior, u8 localId, u16 x, u16 y, u8 z) -SpawnSpecialFieldObjectParametrized: @ 808DC44 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x18 - ldr r4, [sp, 0x2C] - ldr r5, [sp, 0x30] - mov r8, r5 - lsls r0, 24 - lsrs r0, 24 - lsls r3, 16 - ldr r5, =0xfff90000 - adds r3, r5 - lsrs r3, 16 - lsls r4, 16 - adds r4, r5 - lsrs r4, 16 - mov r5, sp - movs r6, 0 - strb r2, [r5] - mov r2, sp - strb r0, [r2, 0x1] - mov r0, sp - strb r6, [r0, 0x2] - movs r5, 0 - strh r3, [r0, 0x4] - strh r4, [r0, 0x6] - mov r2, r8 - strb r2, [r0, 0x8] - strb r1, [r0, 0x9] - mov r2, sp - ldrb r1, [r2, 0xA] - movs r0, 0x10 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0xA] - mov r0, sp - strb r5, [r0, 0xA] - strh r6, [r0, 0xC] - strh r6, [r0, 0xE] - bl SpawnSpecialFieldObject - lsls r0, 24 - lsrs r0, 24 - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end SpawnSpecialFieldObjectParametrized - - thumb_func_start show_sprite -show_sprite: @ 808DCAC - push {r4-r7,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - adds r1, r7, 0 - adds r2, r6, 0 - bl GetFieldObjectTemplateByLocalIdAndMap - adds r5, r0, 0 - cmp r5, 0 - beq _0808DCF2 - mov r4, sp - adds r4, 0x6 - add r0, sp, 0x4 - adds r1, r4, 0 - bl GetFieldObjectMovingCameraOffset - add r0, sp, 0x4 - movs r1, 0 - ldrsh r3, [r0, r1] - movs r1, 0 - ldrsh r0, [r4, r1] - str r0, [sp] - adds r0, r5, 0 - adds r1, r7, 0 - adds r2, r6, 0 - bl SpawnFieldObject - lsls r0, 24 - lsrs r0, 24 - b _0808DCF4 -_0808DCF2: - movs r0, 0x10 -_0808DCF4: - add sp, 0x8 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end show_sprite - - thumb_func_start MakeObjectTemplateFromFieldObjectGraphicsInfo -@ void MakeObjectTemplateFromFieldObjectGraphicsInfo(u8 graphicsId, void ( *callback)(), struct objtemplate *objectTemplate, SpriteOamTable **spriteOamTables) -MakeObjectTemplateFromFieldObjectGraphicsInfo: @ 808DCFC - push {r4-r6,lr} - adds r5, r1, 0 - adds r4, r2, 0 - adds r6, r3, 0 - lsls r0, 24 - lsrs r0, 24 - bl GetFieldObjectGraphicsInfo - ldrh r1, [r0] - strh r1, [r4] - ldrh r1, [r0, 0x2] - strh r1, [r4, 0x2] - ldr r1, [r0, 0x10] - str r1, [r4, 0x4] - ldr r1, [r0, 0x18] - str r1, [r4, 0x8] - ldr r1, [r0, 0x1C] - str r1, [r4, 0xC] - ldr r1, [r0, 0x20] - str r1, [r4, 0x10] - str r5, [r4, 0x14] - ldr r0, [r0, 0x14] - str r0, [r6] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end MakeObjectTemplateFromFieldObjectGraphicsInfo - - thumb_func_start MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex -@ void MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex(u16 graphicsId, u16 callbackIndex, struct objtemplate *objectTemplate, SpriteOamTable **spriteOamTables) -MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex: @ 808DD30 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - ldr r4, =gUnknown_08505438 - lsrs r1, 14 - adds r1, r4 - ldr r1, [r1] - bl MakeObjectTemplateFromFieldObjectGraphicsInfo - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex - - thumb_func_start MakeObjectTemplateFromFieldObjectTemplate -@ void MakeObjectTemplateFromFieldObjectTemplate(struct FieldObjectTemplate *fieldObjectTemplate, struct objtemplate *objectTemplate, SpriteOamTable **spriteOamTables) -MakeObjectTemplateFromFieldObjectTemplate: @ 808DD50 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r3, r2, 0 - ldrb r0, [r4, 0x1] - ldrb r1, [r4, 0x9] - adds r2, r5, 0 - bl MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end MakeObjectTemplateFromFieldObjectTemplate - - thumb_func_start AddPseudoFieldObject -@ void AddPseudoFieldObject(u8 graphicsId, void ( *callback)(), u16 x, u16 y, u8 subpriority) -AddPseudoFieldObject: @ 808DD68 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, [sp, 0x20] - lsls r4, 16 - lsrs r4, 16 - lsls r2, 16 - lsrs r2, 16 - mov r8, r2 - lsls r3, 16 - lsrs r7, r3, 16 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r0, 0x18 - bl Alloc - adds r6, r0, 0 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - mov r3, sp - bl MakeObjectTemplateFromFieldObjectGraphicsInfo - ldrh r1, [r6, 0x2] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _0808DDAE - adds r0, r1, 0 - bl sub_808E894 -_0808DDAE: - mov r0, r8 - lsls r1, r0, 16 - asrs r1, 16 - lsls r2, r7, 16 - asrs r2, 16 - adds r0, r6, 0 - mov r3, r9 - bl AddObjectToFront - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r6, 0 - bl Free - cmp r5, 0x40 - beq _0808DDF2 - ldr r1, [sp] - cmp r1, 0 - beq _0808DDF2 - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - adds r0, r4, 0 - bl SetSpriteOamTables_NoPriorityFromTable - adds r4, 0x42 - ldrb r1, [r4] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x80 - orrs r0, r1 - strb r0, [r4] -_0808DDF2: - adds r0, r5, 0 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end AddPseudoFieldObject - - thumb_func_start sprite_new -sprite_new: @ 808DE0C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - adds r5, r0, 0 - ldr r0, [sp, 0x40] - ldr r4, [sp, 0x44] - lsls r5, 24 - lsrs r5, 24 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - add r1, sp, 0x18 - mov r8, r1 - strh r2, [r1] - mov r6, sp - adds r6, 0x1A - strh r3, [r6] - lsls r0, 24 - lsrs r7, r0, 24 - lsls r4, 24 - lsrs r4, 24 - mov r10, r4 - adds r0, r5, 0 - bl GetFieldObjectGraphicsInfo - adds r4, r0, 0 - ldr r1, =sub_8097AC8 - add r3, sp, 0x1C - adds r0, r5, 0 - mov r2, sp - bl MakeObjectTemplateFromFieldObjectGraphicsInfo - mov r1, sp - ldr r2, =0x0000ffff - adds r0, r2, 0 - strh r0, [r1, 0x2] - mov r1, r8 - movs r2, 0 - ldrsh r0, [r1, r2] - adds r0, 0x7 - strh r0, [r1] - movs r1, 0 - ldrsh r0, [r6, r1] - adds r0, 0x7 - strh r0, [r6] - mov r0, r8 - adds r1, r6, 0 - movs r2, 0x8 - movs r3, 0x10 - bl sub_80930E0 - mov r2, r8 - movs r0, 0 - ldrsh r1, [r2, r0] - movs r0, 0 - ldrsh r2, [r6, r0] - mov r0, sp - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x40 - beq _0808DF6C - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - ldr r1, =0x02020630 - adds r5, r0, r1 - ldrh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 17 - negs r0, r0 - adds r1, r5, 0 - adds r1, 0x28 - strb r0, [r1] - ldrh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 17 - negs r0, r0 - adds r1, 0x1 - strb r0, [r1] - movs r0, 0 - ldrsb r0, [r1, r0] - ldrh r1, [r5, 0x22] - adds r0, r1 - strh r0, [r5, 0x22] - ldrb r0, [r4, 0xC] - lsls r0, 28 - lsrs r0, 24 - ldrb r1, [r5, 0x5] - movs r3, 0xF - adds r2, r3, 0 - ands r2, r1 - orrs r2, r0 - strb r2, [r5, 0x5] - lsls r1, r2, 24 - lsrs r0, r1, 28 - cmp r0, 0xF - bls _0808DEE4 - subs r0, 0x10 - lsls r0, 4 - ands r2, r3 - orrs r2, r0 - strb r2, [r5, 0x5] -_0808DEE4: - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] - mov r2, r9 - strh r2, [r5, 0x2E] - strh r7, [r5, 0x30] - ldrb r1, [r4, 0xC] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0xA - bne _0808DF18 - ldrh r0, [r4, 0x2] - lsls r1, 28 - lsrs r1, 28 - bl npc_load_two_palettes__and_record - b _0808DF2C - .pool -_0808DF18: - lsls r1, 28 - lsrs r0, r1, 28 - cmp r0, 0xF - bls _0808DF2C - ldrh r0, [r4, 0x2] - lsrs r2, r1, 28 - movs r1, 0xF0 - orrs r1, r2 - bl sub_808EAB0 -_0808DF2C: - ldr r1, [sp, 0x1C] - cmp r1, 0 - beq _0808DF48 - adds r0, r5, 0 - bl SetSpriteOamTables_NoPriorityFromTable - adds r2, r5, 0 - adds r2, 0x42 - ldrb r0, [r2] - movs r1, 0x3F - ands r1, r0 - movs r0, 0x80 - orrs r1, r0 - strb r1, [r2] -_0808DF48: - adds r0, r5, 0 - adds r1, r7, 0 - bl InitObjectPriorityByZCoord - adds r0, r7, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl SetObjectSubpriorityByZCoord - mov r0, r10 - bl FieldObjectDirectionToImageAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl StartObjectImageAnim -_0808DF6C: - adds r0, r6, 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 sprite_new - - thumb_func_start SpawnFieldObjectsInView -@ void SpawnFieldObjectsInView(u16 movingCameraOffsetX, u16 movingCameraOffsetY) -SpawnFieldObjectsInView: @ 808DF80 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x4] - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0x8] - ldr r5, =0x02037318 - ldr r0, [r5, 0x4] - cmp r0, 0 - beq _0808E078 - ldr r0, =0x03005d8c - ldr r2, [r0] - ldrh r1, [r2] - subs r0, r1, 0x2 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - adds r1, 0x11 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0xC] - ldrh r4, [r2, 0x2] - adds r0, r4, 0 - adds r0, 0x10 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0808DFE0 - bl sub_81AAA40 - lsls r0, 24 - lsrs r6, r0, 24 - b _0808DFF0 - .pool -_0808DFE0: - bl InTrainerHill - cmp r0, 0 - beq _0808DFEC - movs r6, 0x2 - b _0808DFF0 -_0808DFEC: - ldr r0, [r5, 0x4] - ldrb r6, [r0] -_0808DFF0: - movs r5, 0 - cmp r5, r6 - bcs _0808E078 - lsls r0, r4, 16 - asrs r0, 16 - mov r9, r0 - mov r1, r8 - lsls r0, r1, 16 - asrs r0, 16 - mov r8, r0 -_0808E004: - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 3 - movs r2, 0xC7 - lsls r2, 4 - adds r0, r2 - ldr r3, =0x03005d8c - ldr r1, [r3] - adds r4, r1, r0 - ldrh r0, [r4, 0x4] - adds r0, 0x7 - lsls r0, 16 - lsrs r2, r0, 16 - ldrh r0, [r4, 0x6] - adds r0, 0x7 - lsls r0, 16 - asrs r1, r0, 16 - cmp r9, r1 - bgt _0808E06E - mov r7, r10 - lsls r0, r7, 16 - asrs r0, 16 - cmp r0, r1 - blt _0808E06E - lsls r0, r2, 16 - asrs r1, r0, 16 - cmp r8, r1 - bgt _0808E06E - ldr r2, [sp, 0xC] - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, r1 - blt _0808E06E - ldrh r0, [r4, 0x14] - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _0808E06E - ldr r3, =0x03005d8c - ldr r0, [r3] - ldrb r1, [r0, 0x5] - ldrb r2, [r0, 0x4] - ldr r7, [sp, 0x4] - lsls r3, r7, 16 - ldr r7, [sp, 0x8] - lsls r0, r7, 16 - asrs r0, 16 - str r0, [sp] - adds r0, r4, 0 - asrs r3, 16 - bl SpawnFieldObject -_0808E06E: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r6 - bcc _0808E004 -_0808E078: - 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 SpawnFieldObjectsInView - - thumb_func_start RemoveFieldObjectsOutsideView -@ void RemoveFieldObjectsOutsideView() -RemoveFieldObjectsOutsideView: @ 808E08C - push {r4-r6,lr} - movs r3, 0 - ldr r6, =0x02032308 -_0808E092: - movs r2, 0 - movs r4, 0 - adds r5, r3, 0x1 -_0808E098: - lsls r0, r2, 2 - adds r1, r0, r6 - ldrb r0, [r1] - cmp r0, 0 - beq _0808E0AA - ldrb r1, [r1, 0x2] - cmp r3, r1 - bne _0808E0AA - movs r4, 0x1 -_0808E0AA: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _0808E098 - cmp r4, 0 - bne _0808E0D2 - lsls r0, r3, 3 - adds r0, r3 - lsls r0, 2 - ldr r1, =0x02037350 - adds r2, r0, r1 - ldr r0, [r2] - ldr r1, =0x00010001 - ands r0, r1 - cmp r0, 0x1 - bne _0808E0D2 - adds r0, r2, 0 - bl RemoveFieldObjectIfOutsideView -_0808E0D2: - lsls r0, r5, 24 - lsrs r3, r0, 24 - cmp r3, 0xF - bls _0808E092 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end RemoveFieldObjectsOutsideView - - thumb_func_start RemoveFieldObjectIfOutsideView -@ void RemoveFieldObjectIfOutsideView(npc_state *fieldObject) -RemoveFieldObjectIfOutsideView: @ 808E0EC - push {r4-r7,lr} - adds r3, r0, 0 - ldr r0, =0x03005d8c - ldr r2, [r0] - ldrh r0, [r2] - subs r1, r0, 0x2 - lsls r1, 16 - adds r0, 0x11 - lsls r0, 16 - lsrs r5, r0, 16 - ldrh r4, [r2, 0x2] - adds r0, r4, 0 - adds r0, 0x10 - lsls r0, 16 - lsrs r6, r0, 16 - movs r0, 0x10 - ldrsh r2, [r3, r0] - lsrs r7, r1, 16 - asrs r1, 16 - cmp r2, r1 - blt _0808E132 - lsls r0, r5, 16 - asrs r0, 16 - cmp r2, r0 - bgt _0808E132 - movs r0, 0x12 - ldrsh r1, [r3, r0] - lsls r0, r4, 16 - asrs r0, 16 - cmp r1, r0 - blt _0808E132 - lsls r0, r6, 16 - asrs r0, 16 - cmp r1, r0 - ble _0808E160 -_0808E132: - movs r0, 0xC - ldrsh r1, [r3, r0] - lsls r0, r7, 16 - asrs r0, 16 - cmp r1, r0 - blt _0808E15A - lsls r0, r5, 16 - asrs r0, 16 - cmp r1, r0 - bgt _0808E15A - movs r0, 0xE - ldrsh r1, [r3, r0] - lsls r0, r4, 16 - asrs r0, 16 - cmp r1, r0 - blt _0808E15A - lsls r0, r6, 16 - asrs r0, 16 - cmp r1, r0 - ble _0808E160 -_0808E15A: - adds r0, r3, 0 - bl RemoveFieldObject -_0808E160: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end RemoveFieldObjectIfOutsideView - - thumb_func_start sub_808E16C -sub_808E16C: @ 808E16C - push {r4-r7,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - bl ClearPlayerAvatarInfo - movs r6, 0 - ldr r7, =0x02037350 - lsls r4, 16 - lsls r5, 16 -_0808E186: - lsls r0, r6, 3 - adds r0, r6 - lsls r0, 2 - adds r0, r7 - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - beq _0808E1A0 - adds r0, r6, 0 - asrs r1, r4, 16 - asrs r2, r5, 16 - bl sub_808E1B8 -_0808E1A0: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0xF - bls _0808E186 - bl sub_808D450 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808E16C - - thumb_func_start sub_808E1B8 -sub_808E1B8: @ 808E1B8 - 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 r9, r0 - lsls r1, 16 - lsrs r1, 16 - mov r10, r1 - lsls r2, 16 - lsrs r2, 16 - str r2, [sp, 0x24] - movs r7, 0 - ldr r2, =0x02032308 -_0808E1DA: - lsls r0, r7, 2 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0 - beq _0808E1EC - ldrb r1, [r1, 0x2] - cmp r9, r1 - bne _0808E1EC - b _0808E374 -_0808E1EC: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x3 - bls _0808E1DA - mov r1, r9 - lsls r0, r1, 3 - add r0, r9 - lsls r0, 2 - ldr r1, =0x02037350 - adds r6, r0, r1 - movs r0, 0 - str r0, [sp, 0x20] - ldrb r0, [r6, 0x5] - bl GetFieldObjectGraphicsInfo - adds r5, r0, 0 - ldrh r2, [r5, 0x6] - ldr r1, =0xffff0000 - add r4, sp, 0x18 - ldr r0, [r4, 0x4] - ands r0, r1 - orrs r0, r2 - str r0, [r4, 0x4] - ldrb r0, [r6, 0x5] - ldrb r1, [r6, 0x6] - add r3, sp, 0x20 - mov r2, sp - bl MakeObjectTemplateFromFieldObjectGraphicsInfoWithCallbackIndex - str r4, [sp, 0xC] - mov r1, sp - ldr r2, =0x0000ffff - adds r0, r2, 0 - strh r0, [r1, 0x2] - ldrb r0, [r5, 0xC] - lsls r1, r0, 28 - lsrs r0, r1, 28 - mov r8, r0 - cmp r0, 0 - bne _0808E258 - ldrh r0, [r5, 0x2] - lsrs r1, 28 - bl npc_load_two_palettes__no_record - b _0808E27E - .pool -_0808E258: - mov r2, r8 - cmp r2, 0xA - bne _0808E268 - ldrh r0, [r5, 0x2] - lsrs r1, 28 - bl npc_load_two_palettes__and_record - b _0808E27E -_0808E268: - mov r0, r8 - cmp r0, 0xF - bls _0808E27E - subs r0, 0x10 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrh r0, [r5, 0x2] - mov r1, r8 - bl sub_808EAB0 -_0808E27E: - mov r1, sp - ldr r2, =0x0000ffff - adds r0, r2, 0 - strh r0, [r1, 0x2] - mov r0, sp - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x40 - beq _0808E374 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - ldr r1, =0x02020630 - adds r4, r0, r1 - mov r1, r10 - lsls r0, r1, 16 - asrs r0, 16 - ldrh r2, [r6, 0x10] - adds r0, r2 - lsls r0, 16 - asrs r0, 16 - ldr r2, [sp, 0x24] - lsls r1, r2, 16 - asrs r1, 16 - ldrh r2, [r6, 0x12] - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - adds r2, r4, 0 - adds r2, 0x20 - adds r3, r4, 0 - adds r3, 0x22 - bl sub_8092FF0 - ldrh r0, [r5, 0x8] - lsls r0, 16 - asrs r0, 17 - negs r0, r0 - adds r1, r4, 0 - adds r1, 0x28 - strb r0, [r1] - ldrh r0, [r5, 0xA] - lsls r0, 16 - asrs r0, 17 - negs r0, r0 - adds r2, r4, 0 - adds r2, 0x29 - strb r0, [r2] - ldrh r0, [r4, 0x20] - adds r0, 0x8 - strh r0, [r4, 0x20] - ldrh r1, [r4, 0x22] - adds r1, 0x10 - movs r0, 0 - ldrsb r0, [r2, r0] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r0, [r5, 0x1C] - str r0, [r4, 0xC] - ldrb r0, [r6, 0x6] - cmp r0, 0xB - bne _0808E312 - mov r0, r9 - adds r1, r7, 0 - bl SetPlayerAvatarFieldObjectIdAndObjectId - bl sub_8154228 - strb r0, [r6, 0x1B] -_0808E312: - ldr r1, [sp, 0x20] - cmp r1, 0 - beq _0808E31E - adds r0, r4, 0 - bl SetSpriteOamTables_NoPriorityFromTable -_0808E31E: - mov r0, r8 - lsls r2, r0, 4 - ldrb r1, [r4, 0x5] - movs r0, 0xF - ands r0, r1 - orrs r0, r2 - strb r0, [r4, 0x5] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] - mov r1, r9 - strh r1, [r4, 0x2E] - strb r7, [r6, 0x4] - ldrb r0, [r6, 0x1] - lsls r0, 27 - cmp r0, 0 - blt _0808E362 - ldrb r0, [r6, 0x6] - cmp r0, 0xB - beq _0808E362 - ldrb r0, [r6, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl FieldObjectDirectionToImageAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim -_0808E362: - adds r0, r6, 0 - bl sub_808E38C - ldrb r0, [r6, 0xB] - lsrs r0, 4 - adds r1, r4, 0 - movs r2, 0x1 - bl SetObjectSubpriorityByZCoord -_0808E374: - 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_808E1B8 - - thumb_func_start sub_808E38C -@ void sub_808E38C(struct npc_state *fieldObject) -sub_808E38C: @ 808E38C - push {lr} - ldrb r2, [r0] - movs r3, 0x3 - negs r3, r3 - adds r1, r3, 0 - ands r1, r2 - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldrb r2, [r0, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r2 - ands r1, r3 - movs r2, 0x5 - negs r2, r2 - ands r1, r2 - subs r2, 0x4 - ands r1, r2 - subs r2, 0x8 - ands r1, r2 - subs r2, 0x10 - ands r1, r2 - strb r1, [r0, 0x2] - bl FieldObjectClearAnim - pop {r0} - bx r0 - thumb_func_end sub_808E38C - - thumb_func_start SetPlayerAvatarFieldObjectIdAndObjectId -@ void SetPlayerAvatarFieldObjectIdAndObjectId(u8 fieldObjectId, u8 objectId) -SetPlayerAvatarFieldObjectIdAndObjectId: @ 808E3C4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =0x02037590 - strb r0, [r5, 0x5] - strb r1, [r5, 0x4] - ldr r1, =0x02037350 - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - adds r4, r1 - ldrb r0, [r4, 0x5] - bl GetPlayerAvatarGenderByGraphicsId - strb r0, [r5, 0x7] - ldrb r0, [r4, 0x5] - movs r1, 0x20 - bl SetPlayerAvatarExtraStateTransition - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end SetPlayerAvatarFieldObjectIdAndObjectId - - thumb_func_start FieldObjectSetGraphicsId -@ void FieldObjectSetGraphicsId(npc_state *npcState, u8 graphicsId) -FieldObjectSetGraphicsId: @ 808E3F8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - mov r0, r8 - bl GetFieldObjectGraphicsInfo - adds r6, r0, 0 - ldrb r1, [r7, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r4, r0, r1 - ldrb r0, [r6, 0xC] - lsls r1, r0, 28 - lsrs r5, r1, 28 - cmp r5, 0 - bne _0808E434 - ldrh r0, [r6, 0x2] - adds r1, r5, 0 - bl pal_patch_for_npc - b _0808E456 - .pool -_0808E434: - cmp r5, 0xA - bne _0808E442 - ldrh r0, [r6, 0x2] - lsrs r1, 28 - bl npc_load_two_palettes__and_record - b _0808E456 -_0808E442: - cmp r5, 0xF - bls _0808E456 - adds r0, r5, 0 - subs r0, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - ldrh r0, [r6, 0x2] - adds r1, r5, 0 - bl sub_808EAB0 -_0808E456: - ldr r0, [r6, 0x10] - ldrb r2, [r0, 0x1] - lsrs r2, 6 - lsls r2, 6 - ldrb r3, [r4, 0x1] - movs r1, 0x3F - adds r0, r1, 0 - ands r0, r3 - orrs r0, r2 - strb r0, [r4, 0x1] - ldr r0, [r6, 0x10] - ldrb r0, [r0, 0x3] - lsrs r0, 6 - lsls r0, 6 - ldrb r2, [r4, 0x3] - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0x3] - ldr r0, [r6, 0x1C] - str r0, [r4, 0xC] - ldr r0, [r6, 0x18] - str r0, [r4, 0x8] - ldr r0, [r6, 0x14] - str r0, [r4, 0x18] - lsls r2, r5, 4 - ldrb r1, [r4, 0x5] - movs r0, 0xF - ands r0, r1 - orrs r0, r2 - strb r0, [r4, 0x5] - ldrb r1, [r6, 0xC] - lsls r1, 25 - lsrs r1, 31 - lsls r1, 4 - ldrb r2, [r7, 0x1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r7, 0x1] - mov r0, r8 - strb r0, [r7, 0x5] - movs r1, 0x10 - ldrsh r0, [r7, r1] - movs r2, 0x12 - ldrsh r1, [r7, r2] - adds r2, r4, 0 - adds r2, 0x20 - adds r3, r4, 0 - adds r3, 0x22 - bl sub_8093038 - ldrh r0, [r6, 0x8] - lsls r0, 16 - asrs r0, 17 - negs r0, r0 - adds r1, r4, 0 - adds r1, 0x28 - strb r0, [r1] - ldrh r0, [r6, 0xA] - lsls r0, 16 - asrs r0, 17 - negs r0, r0 - adds r2, r4, 0 - adds r2, 0x29 - strb r0, [r2] - ldrh r0, [r4, 0x20] - adds r0, 0x8 - strh r0, [r4, 0x20] - ldrh r1, [r4, 0x22] - adds r1, 0x10 - movs r0, 0 - ldrsb r0, [r2, r0] - adds r0, r1 - strh r0, [r4, 0x22] - ldrb r0, [r7, 0x1] - lsrs r0, 7 - cmp r0, 0 - beq _0808E4F8 - bl CameraObjectReset1 -_0808E4F8: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end FieldObjectSetGraphicsId - - thumb_func_start sub_808E504 -sub_808E504: @ 808E504 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r4, r3, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808E538 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - adds r1, r4, 0 - bl FieldObjectSetGraphicsId -_0808E538: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808E504 - - thumb_func_start FieldObjectTurn -@ void FieldObjectTurn(struct npc_state *fieldObject, u8 direction) -FieldObjectTurn: @ 808E544 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 24 - lsrs r1, 24 - bl FieldObjectSetDirection - ldrb r0, [r6, 0x1] - lsls r0, 27 - cmp r0, 0 - blt _0808E58A - ldrb r0, [r6, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r5, =0x02020630 - adds r4, r5 - ldrb r0, [r6, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl FieldObjectDirectionToImageAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - ldrb r1, [r6, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0 - bl SeekObjectImageAnim -_0808E58A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectTurn - - thumb_func_start FieldObjectTurnByLocalIdAndMap -@ void FieldObjectTurnByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) -FieldObjectTurnByLocalIdAndMap: @ 808E594 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r4, r3, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808E5C8 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - adds r1, r4, 0 - bl FieldObjectTurn -_0808E5C8: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectTurnByLocalIdAndMap - - thumb_func_start sub_808E5D4 -sub_808E5D4: @ 808E5D4 - push {lr} - lsls r1, 24 - lsrs r1, 24 - ldrb r2, [r0, 0x5] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - bl FieldObjectTurn - pop {r0} - bx r0 - .pool - thumb_func_end sub_808E5D4 - - thumb_func_start get_berry_tree_graphics -@ void get_berry_tree_graphics(npc_state *npcState, struct obj *obj) -get_berry_tree_graphics: @ 808E5F4 - push {r4-r7,lr} - adds r5, r0, 0 - adds r7, r1, 0 - ldrb r0, [r5, 0x1] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r5, 0x1] - adds r4, r7, 0 - adds r4, 0x3E - ldrb r0, [r4] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4] - ldrb r0, [r5, 0x1D] - bl GetStageByBerryTreeId - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - beq _0808E680 - ldrb r1, [r5, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r1 - strb r0, [r5, 0x1] - ldrb r1, [r4] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r4] - ldrb r0, [r5, 0x1D] - bl GetBerryTypeByBerryTreeId - subs r0, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - subs r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r4, 0x2B - bls _0808E648 - movs r4, 0 -_0808E648: - ldr r0, =gBerryTreeFieldObjectGraphicsIdTablePointers - lsls r4, 2 - adds r0, r4, r0 - ldr r0, [r0] - adds r0, r6 - ldrb r1, [r0] - adds r0, r5, 0 - bl FieldObjectSetGraphicsId - ldr r0, =gBerryTreePicTablePointers - adds r0, r4, r0 - ldr r0, [r0] - str r0, [r7, 0xC] - ldr r0, =gBerryTreePaletteSlotTablePointers - adds r4, r0 - ldr r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r1, 4 - ldrb r2, [r7, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r1 - strb r0, [r7, 0x5] - adds r0, r7, 0 - adds r1, r6, 0 - bl StartObjectImageAnim -_0808E680: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end get_berry_tree_graphics - - thumb_func_start GetFieldObjectGraphicsInfo -@ FieldObjectGraphicsInfo *GetFieldObjectGraphicsInfo(u8 graphicsId) -GetFieldObjectGraphicsInfo: @ 808E694 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xEF - bls _0808E6AC - adds r0, r1, 0 - adds r0, 0x10 - lsls r0, 24 - lsrs r0, 24 - bl VarGetFieldObjectGraphicsId - adds r1, r0, 0 -_0808E6AC: - cmp r1, 0x45 - bne _0808E6C4 - bl sub_81201C8 - lsls r0, 24 - ldr r1, =gMauvilleOldManGraphicsInfoPointers - lsrs r0, 22 - adds r0, r1 - ldr r0, [r0] - b _0808E6D2 - .pool -_0808E6C4: - cmp r1, 0xEE - bls _0808E6CA - movs r1, 0x5 -_0808E6CA: - ldr r0, =gFieldObjectGraphicsInfoPointers - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] -_0808E6D2: - pop {r1} - bx r1 - .pool - thumb_func_end GetFieldObjectGraphicsInfo - - thumb_func_start FieldObjectHandleDynamicGraphicsId -@ void FieldObjectHandleDynamicGraphicsId(struct npc_state *fieldObject) -FieldObjectHandleDynamicGraphicsId: @ 808E6DC - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0x5] - cmp r0, 0xEF - bls _0808E6F2 - adds r0, 0x10 - lsls r0, 24 - lsrs r0, 24 - bl VarGetFieldObjectGraphicsId - strb r0, [r4, 0x5] -_0808E6F2: - pop {r4} - pop {r0} - bx r0 - thumb_func_end FieldObjectHandleDynamicGraphicsId - - thumb_func_start npc_by_local_id_and_map_set_field_1_bit_x20 -npc_by_local_id_and_map_set_field_1_bit_x20: @ 808E6F8 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r4, r3, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808E73A - ldr r2, =0x02037350 - mov r0, sp - ldrb r0, [r0] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x1 - adds r2, r4, 0 - ands r2, r0 - lsls r2, 5 - ldrb r3, [r1, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x1] -_0808E73A: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end npc_by_local_id_and_map_set_field_1_bit_x20 - - thumb_func_start FieldObjectGetLocalIdAndMap -@ void FieldObjectGetLocalIdAndMap(struct npc_state *fieldObject, u8 *localId, u8 *mapId, u8 *mapGroupId) -FieldObjectGetLocalIdAndMap: @ 808E748 - push {r4,lr} - ldrb r4, [r0, 0x8] - strb r4, [r1] - ldrb r1, [r0, 0x9] - strb r1, [r2] - ldrb r0, [r0, 0xA] - strb r0, [r3] - pop {r4} - pop {r0} - bx r0 - thumb_func_end FieldObjectGetLocalIdAndMap - - thumb_func_start sub_808E75C -sub_808E75C: @ 808E75C - push {lr} - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl GetFieldObjectIdByXY - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x10 - beq _0808E784 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_0808E784: - pop {r0} - bx r0 - .pool - thumb_func_end sub_808E75C - - thumb_func_start sub_808E78C -sub_808E78C: @ 808E78C - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r4, r3, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808E7D2 - mov r0, sp - ldrb r0, [r0] - lsls r2, r0, 3 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x02037350 - adds r2, r0 - ldrb r1, [r2, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - ldrb r1, [r2, 0x3] - movs r3, 0x4 - orrs r1, r3 - strb r1, [r2, 0x3] - adds r0, 0x43 - strb r4, [r0] -_0808E7D2: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808E78C - - thumb_func_start sub_808E7E4 -sub_808E7E4: @ 808E7E4 - push {lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808E820 - mov r0, sp - ldrb r0, [r0] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02037350 - adds r1, r0 - ldrb r2, [r1, 0x3] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x3] - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] -_0808E820: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_808E7E4 - - thumb_func_start sub_808E82C -sub_808E82C: @ 808E82C - push {r4,r5,lr} - sub sp, 0x4 - ldr r4, [sp, 0x10] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 16 - lsrs r5, r3, 16 - lsls r4, 16 - lsrs r4, 16 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808E870 - ldr r2, =0x02037350 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - strh r5, [r0, 0x24] - strh r4, [r0, 0x26] -_0808E870: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808E82C - - thumb_func_start gpu_pal_allocator_reset__manage_upper_four -gpu_pal_allocator_reset__manage_upper_four: @ 808E880 - push {lr} - bl ResetObjectPaletteAllocator - ldr r1, =0x0300301c - movs r0, 0xC - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end gpu_pal_allocator_reset__manage_upper_four - - thumb_func_start sub_808E894 -sub_808E894: @ 808E894 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl FindFieldObjectPaletteIndexByTag - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =0x000011ff - cmp r1, r0 - beq _0808E8B2 - lsls r0, r1, 3 - ldr r1, =gUnknown_0850BBC8 - adds r0, r1 - bl sub_808E8F4 -_0808E8B2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_808E894 - - thumb_func_start sub_808E8C0 -sub_808E8C0: @ 808E8C0 - push {r4-r6,lr} - adds r5, r0, 0 - movs r4, 0 - ldrh r0, [r5] - ldr r1, =0x000011ff - cmp r0, r1 - beq _0808E8EA - adds r6, r1, 0 -_0808E8D0: - lsls r0, r4, 1 - adds r0, r5 - ldrh r0, [r0] - bl sub_808E894 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 1 - adds r0, r5 - ldrh r0, [r0] - cmp r0, r6 - bne _0808E8D0 -_0808E8EA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808E8C0 - - thumb_func_start sub_808E8F4 -@ u8 sub_808E8F4(struct TaggedObjectPalette *taggedPalette) -sub_808E8F4: @ 808E8F4 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x4] - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _0808E912 - adds r0, r4, 0 - bl LoadTaggedObjectPalette - lsls r0, 24 - lsrs r0, 24 - b _0808E914 -_0808E912: - movs r0, 0xFF -_0808E914: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808E8F4 - - thumb_func_start pal_patch_for_npc -@ void pal_patch_for_npc(u16 tag, u8 slot) -pal_patch_for_npc: @ 808E91C - push {r4,lr} - adds r4, r1, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 24 - lsrs r4, 24 - bl FindFieldObjectPaletteIndexByTag - lsls r0, 24 - ldr r1, =gUnknown_0850BBC8 - lsrs r0, 21 - adds r0, r1 - ldr r0, [r0] - lsls r4, 20 - movs r1, 0x80 - lsls r1, 17 - adds r4, r1 - lsrs r4, 16 - adds r1, r4, 0 - movs r2, 0x20 - bl gpu_pal_apply - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pal_patch_for_npc - - thumb_func_start pal_patch_for_npc_range -@ void pal_patch_for_npc_range(u16 *tags, u8 minSlot, u8 maxSlot) -pal_patch_for_npc_range: @ 808E954 - push {r4-r6,lr} - adds r5, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - cmp r4, r6 - bcs _0808E978 -_0808E964: - ldrh r0, [r5] - adds r1, r4, 0 - bl pal_patch_for_npc - adds r5, 0x2 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r6 - bcc _0808E964 -_0808E978: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end pal_patch_for_npc_range - - thumb_func_start FindFieldObjectPaletteIndexByTag -@ u8 FindFieldObjectPaletteIndexByTag(u16 tag) -FindFieldObjectPaletteIndexByTag: @ 808E980 - push {r4-r6,lr} - lsls r0, 16 - lsrs r5, r0, 16 - movs r2, 0 - ldr r0, =gUnknown_0850BBC8 - ldrh r1, [r0, 0x4] - ldr r3, =0x000011ff - adds r4, r0, 0 - cmp r1, r3 - beq _0808E9C0 - adds r6, r4, 0 - adds r1, r3, 0 -_0808E998: - lsls r0, r2, 3 - adds r0, r6 - ldrh r0, [r0, 0x4] - cmp r0, r5 - bne _0808E9B0 - adds r0, r2, 0 - b _0808E9C2 - .pool -_0808E9B0: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 3 - adds r0, r4 - ldrh r0, [r0, 0x4] - cmp r0, r1 - bne _0808E998 -_0808E9C0: - movs r0, 0xFF -_0808E9C2: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end FindFieldObjectPaletteIndexByTag - - thumb_func_start npc_load_two_palettes__no_record -@ void npc_load_two_palettes__no_record(u16 tag, u8 slot) -npc_load_two_palettes__no_record: @ 808E9C8 - push {r4-r6,lr} - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 24 - lsrs r5, r1, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl pal_patch_for_npc - movs r3, 0 - ldr r1, =gUnknown_0850BD00 - ldrh r0, [r1] - ldr r2, =0x000011ff - cmp r0, r2 - beq _0808EA30 - ldr r0, =gUnknown_084975C4 - adds r5, r0 - adds r6, r2, 0 -_0808E9EC: - lsls r2, r3, 3 - adds r0, r2, r1 - ldrh r0, [r0] - cmp r0, r4 - bne _0808EA20 - adds r1, 0x4 - adds r1, r2, r1 - ldr r0, =0x020375b4 - ldrb r0, [r0] - ldr r1, [r1] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - ldrb r1, [r5] - bl pal_patch_for_npc - b _0808EA30 - .pool -_0808EA20: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 3 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r6 - bne _0808E9EC -_0808EA30: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end npc_load_two_palettes__no_record - - thumb_func_start npc_load_two_palettes__and_record -@ void npc_load_two_palettes__and_record(u16 tag, u8 slot) -npc_load_two_palettes__and_record: @ 808EA38 - push {r4-r6,lr} - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 24 - lsrs r5, r1, 24 - ldr r0, =0x020375b6 - strh r4, [r0] - adds r0, r4, 0 - adds r1, r5, 0 - bl pal_patch_for_npc - movs r3, 0 - ldr r1, =gUnknown_0850BD78 - ldrh r0, [r1] - ldr r2, =0x000011ff - cmp r0, r2 - beq _0808EAA8 - ldr r0, =gUnknown_084975C4 - adds r5, r0 - adds r6, r2, 0 -_0808EA60: - lsls r2, r3, 3 - adds r0, r2, r1 - ldrh r0, [r0] - cmp r0, r4 - bne _0808EA98 - adds r1, 0x4 - adds r1, r2, r1 - ldr r0, =0x020375b4 - ldrb r0, [r0] - ldr r1, [r1] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - ldrb r1, [r5] - bl pal_patch_for_npc - b _0808EAA8 - .pool -_0808EA98: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 3 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r6 - bne _0808EA60 -_0808EAA8: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end npc_load_two_palettes__and_record - - thumb_func_start sub_808EAB0 -sub_808EAB0: @ 808EAB0 - push {lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 24 - lsrs r1, 24 - bl pal_patch_for_npc - pop {r0} - bx r0 - thumb_func_end sub_808EAB0 - - thumb_func_start sub_808EAC4 -sub_808EAC4: @ 808EAC4 - push {r4,lr} - ldrh r3, [r0, 0x10] - strh r3, [r0, 0x14] - ldrh r4, [r0, 0x12] - strh r4, [r0, 0x16] - lsls r1, 16 - asrs r1, 16 - adds r1, r3 - strh r1, [r0, 0x10] - lsls r2, 16 - asrs r2, 16 - adds r2, r4 - strh r2, [r0, 0x12] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_808EAC4 - - thumb_func_start npc_coords_shift -@ void npc_coords_shift(struct npc_state *fieldObject, u16 x, u16 y) -npc_coords_shift: @ 808EAE4 - ldrh r3, [r0, 0x10] - strh r3, [r0, 0x14] - ldrh r3, [r0, 0x12] - strh r3, [r0, 0x16] - strh r1, [r0, 0x10] - strh r2, [r0, 0x12] - bx lr - thumb_func_end npc_coords_shift - - thumb_func_start npc_coords_set -@ void npc_coords_set(struct npc_state *fieldObject, u16 x, u16 y) -npc_coords_set: @ 808EAF4 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - strh r1, [r0, 0x14] - strh r2, [r0, 0x16] - strh r1, [r0, 0x10] - strh r2, [r0, 0x12] - bx lr - thumb_func_end npc_coords_set - - thumb_func_start sub_808EB08 -sub_808EB08: @ 808EB08 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - ldrb r1, [r6, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r7, r0, r1 - ldrb r0, [r6, 0x5] - bl GetFieldObjectGraphicsInfo - mov r8, r0 - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl npc_coords_set - movs r1, 0x10 - ldrsh r0, [r6, r1] - movs r2, 0x12 - ldrsh r1, [r6, r2] - adds r2, r7, 0 - adds r2, 0x20 - adds r3, r7, 0 - adds r3, 0x22 - bl sub_8093038 - mov r1, r8 - ldrh r0, [r1, 0x8] - lsls r0, 16 - asrs r0, 17 - negs r0, r0 - adds r1, r7, 0 - adds r1, 0x28 - strb r0, [r1] - mov r2, r8 - ldrh r0, [r2, 0xA] - lsls r0, 16 - asrs r0, 17 - negs r0, r0 - adds r2, r7, 0 - adds r2, 0x29 - strb r0, [r2] - ldrh r0, [r7, 0x20] - adds r0, 0x8 - strh r0, [r7, 0x20] - ldrh r1, [r7, 0x22] - adds r1, 0x10 - movs r0, 0 - ldrsb r0, [r2, r0] - adds r0, r1 - strh r0, [r7, 0x22] - adds r0, r6, 0 - bl sub_808E38C - ldrb r0, [r6, 0x1] - lsrs r0, 7 - cmp r0, 0 - beq _0808EB9A - bl CameraObjectReset1 -_0808EB9A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808EB08 - - thumb_func_start sub_808EBA8 -sub_808EBA8: @ 808EBA8 - push {r4,r5,lr} - sub sp, 0x4 - ldr r4, [sp, 0x10] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 16 - lsrs r5, r3, 16 - lsls r4, 16 - lsrs r4, 16 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808EBF0 - lsls r1, r5, 16 - lsls r2, r4, 16 - mov r0, sp - ldrb r3, [r0] - lsls r0, r3, 3 - adds r0, r3 - lsls r0, 2 - ldr r3, =0x02037350 - adds r0, r3 - movs r3, 0xE0 - lsls r3, 11 - adds r1, r3 - asrs r1, 16 - adds r2, r3 - asrs r2, 16 - bl sub_808EB08 -_0808EBF0: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808EBA8 - - thumb_func_start npc_coords_shift_still -@ void npc_coords_shift_still(struct npc_state *fieldObject) -npc_coords_shift_still: @ 808EBFC - push {lr} - movs r2, 0x10 - ldrsh r1, [r0, r2] - movs r3, 0x12 - ldrsh r2, [r0, r3] - bl npc_coords_shift - pop {r0} - bx r0 - thumb_func_end npc_coords_shift_still - - thumb_func_start UpdateFieldObjectCoordsForCameraUpdate -@ void UpdateFieldObjectCoordsForCameraUpdate() -UpdateFieldObjectCoordsForCameraUpdate: @ 808EC10 - push {r4,r5,lr} - ldr r2, =0x02037334 - ldrb r1, [r2] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0808EC68 - movs r3, 0 - ldr r5, =0x02037350 - movs r0, 0x4 - ldrsh r4, [r2, r0] - movs r0, 0x8 - ldrsh r1, [r2, r0] -_0808EC2A: - lsls r0, r3, 3 - adds r0, r3 - lsls r0, 2 - adds r2, r0, r5 - ldrb r0, [r2] - lsls r0, 31 - cmp r0, 0 - beq _0808EC5E - ldrh r0, [r2, 0xC] - subs r0, r4 - strh r0, [r2, 0xC] - ldrh r0, [r2, 0xE] - subs r0, r1 - strh r0, [r2, 0xE] - ldrh r0, [r2, 0x10] - subs r0, r4 - strh r0, [r2, 0x10] - ldrh r0, [r2, 0x12] - subs r0, r1 - strh r0, [r2, 0x12] - ldrh r0, [r2, 0x14] - subs r0, r4 - strh r0, [r2, 0x14] - ldrh r0, [r2, 0x16] - subs r0, r1 - strh r0, [r2, 0x16] -_0808EC5E: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0xF - bls _0808EC2A -_0808EC68: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end UpdateFieldObjectCoordsForCameraUpdate - - thumb_func_start GetFieldObjectIdByXYZ -@ u8 GetFieldObjectIdByXYZ(u16 x, u16 y, u8 z) -GetFieldObjectIdByXYZ: @ 808EC78 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r7, r0, 16 - lsls r1, 16 - lsrs r6, r1, 16 - lsls r2, 24 - lsrs r5, r2, 24 - movs r4, 0 - ldr r0, =0x02037350 - mov r8, r0 -_0808EC90: - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - mov r2, r8 - adds r1, r0, r2 - ldrb r0, [r1] - lsls r0, 31 - cmp r0, 0 - beq _0808ECC8 - movs r2, 0x10 - ldrsh r0, [r1, r2] - cmp r0, r7 - bne _0808ECC8 - movs r2, 0x12 - ldrsh r0, [r1, r2] - cmp r0, r6 - bne _0808ECC8 - adds r0, r1, 0 - adds r1, r5, 0 - bl FieldObjectDoesZCoordMatch - lsls r0, 24 - cmp r0, 0 - beq _0808ECC8 - adds r0, r4, 0 - b _0808ECD4 - .pool -_0808ECC8: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _0808EC90 - movs r0, 0x10 -_0808ECD4: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end GetFieldObjectIdByXYZ - - thumb_func_start FieldObjectDoesZCoordMatch -@ bool8 FieldObjectDoesZCoordMatch(struct npc_state *fieldObject) -FieldObjectDoesZCoordMatch: @ 808ECE0 - push {lr} - lsls r1, 24 - lsrs r1, 24 - ldrb r2, [r0, 0xB] - movs r0, 0xF - ands r0, r2 - cmp r0, 0 - beq _0808ED00 - cmp r1, 0 - beq _0808ED00 - lsls r0, r2, 28 - lsrs r0, 28 - cmp r0, r1 - beq _0808ED00 - movs r0, 0 - b _0808ED02 -_0808ED00: - movs r0, 0x1 -_0808ED02: - pop {r1} - bx r1 - thumb_func_end FieldObjectDoesZCoordMatch - - thumb_func_start UpdateFieldObjectsForCameraUpdate -@ void UpdateFieldObjectsForCameraUpdate(u16 movingCameraOffsetX, u16 movingCameraOffsetY) -UpdateFieldObjectsForCameraUpdate: @ 808ED08 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - bl UpdateFieldObjectCoordsForCameraUpdate - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - adds r0, r4, 0 - adds r1, r5, 0 - bl SpawnFieldObjectsInView - bl RemoveFieldObjectsOutsideView - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end UpdateFieldObjectsForCameraUpdate - - thumb_func_start AddCameraObject -@ u8 AddCameraObject(u8 followedObjectId) -AddCameraObject: @ 808ED34 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_084975D4 - movs r1, 0 - movs r2, 0 - movs r3, 0x4 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r2, 0x3E - adds r2, r1 - mov r12, r2 - ldrb r2, [r2] - movs r3, 0x4 - orrs r2, r3 - mov r3, r12 - strb r2, [r3] - strh r4, [r1, 0x2E] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end AddCameraObject - - thumb_func_start ObjectCB_CameraObject -@ void ObjectCB_CameraObject(struct obj *object) -ObjectCB_CameraObject: @ 808ED78 - push {r4,r5,lr} - sub sp, 0xC - mov r2, sp - ldr r1, =gUnknown_084975EC - ldm r1!, {r3-r5} - stm r2!, {r3-r5} - movs r2, 0x30 - ldrsh r1, [r0, r2] - lsls r1, 2 - add r1, sp - ldr r1, [r1] - bl _call_via_r1 - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ObjectCB_CameraObject - - thumb_func_start CameraObject_0 -@ void CameraObject_0(struct obj *object) -CameraObject_0: @ 808EDA0 - push {lr} - ldr r3, =0x02020630 - movs r1, 0x2E - ldrsh r2, [r0, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - ldrh r1, [r1, 0x20] - strh r1, [r0, 0x20] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - ldrh r1, [r1, 0x22] - strh r1, [r0, 0x22] - adds r3, r0, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r3] - movs r1, 0x1 - strh r1, [r0, 0x30] - bl CameraObject_1 - pop {r0} - bx r0 - .pool - thumb_func_end CameraObject_0 - - thumb_func_start CameraObject_1 -@ void CameraObject_1(struct obj *object) -CameraObject_1: @ 808EDDC - push {r4,r5,lr} - ldr r3, =0x02020630 - movs r1, 0x2E - ldrsh r2, [r0, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - ldrh r3, [r1, 0x22] - ldrh r2, [r0, 0x20] - ldrh r4, [r1, 0x20] - movs r5, 0x20 - ldrsh r1, [r1, r5] - subs r1, r2 - strh r1, [r0, 0x32] - ldrh r2, [r0, 0x22] - lsls r1, r3, 16 - asrs r1, 16 - subs r1, r2 - strh r1, [r0, 0x34] - strh r4, [r0, 0x20] - strh r3, [r0, 0x22] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end CameraObject_1 - - thumb_func_start CameraObject_2 -@ void CameraObject_2(struct obj *object) -CameraObject_2: @ 808EE14 - push {r4,lr} - ldr r4, =0x02020630 - movs r1, 0x2E - ldrsh r2, [r0, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x20] - movs r3, 0 - strh r1, [r0, 0x20] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x22] - strh r1, [r0, 0x22] - strh r3, [r0, 0x32] - strh r3, [r0, 0x34] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end CameraObject_2 - - thumb_func_start FindCameraObject -@ struct obj *FindCameraObject() -FindCameraObject: @ 808EE44 - push {r4,r5,lr} - movs r3, 0 - ldr r4, =0x02020630 - adds r5, r4, 0 - adds r5, 0x1C -_0808EE4E: - lsls r0, r3, 4 - adds r0, r3 - lsls r1, r0, 2 - adds r2, r1, r4 - adds r0, r2, 0 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - beq _0808EE78 - adds r0, r1, r5 - ldr r1, [r0] - ldr r0, =ObjectCB_CameraObject - cmp r1, r0 - bne _0808EE78 - adds r0, r2, 0 - b _0808EE84 - .pool -_0808EE78: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3F - bls _0808EE4E - movs r0, 0 -_0808EE84: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end FindCameraObject - - thumb_func_start CameraObjectReset1 -@ void CameraObjectReset1() -CameraObjectReset1: @ 808EE8C - push {lr} - bl FindCameraObject - adds r2, r0, 0 - cmp r2, 0 - beq _0808EEA4 - movs r0, 0 - strh r0, [r2, 0x30] - ldr r1, [r2, 0x1C] - adds r0, r2, 0 - bl _call_via_r1 -_0808EEA4: - pop {r0} - bx r0 - thumb_func_end CameraObjectReset1 - - thumb_func_start CameraObjectSetFollowedObjectId -@ void CameraObjectSetFollowedObjectId(u8 objectId) -CameraObjectSetFollowedObjectId: @ 808EEA8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl FindCameraObject - cmp r0, 0 - beq _0808EEBC - strh r4, [r0, 0x2E] - bl CameraObjectReset1 -_0808EEBC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end CameraObjectSetFollowedObjectId - - thumb_func_start CameraObjectGetFollowedObjectId -@ u8 CameraObjectGetFollowedObjectId() -CameraObjectGetFollowedObjectId: @ 808EEC4 - push {lr} - bl FindCameraObject - cmp r0, 0 - beq _0808EED6 - ldrh r0, [r0, 0x2E] - lsls r0, 24 - lsrs r0, 24 - b _0808EED8 -_0808EED6: - movs r0, 0x40 -_0808EED8: - pop {r1} - bx r1 - thumb_func_end CameraObjectGetFollowedObjectId - - thumb_func_start CameraObjectReset2 -@ void CameraObjectReset2() -CameraObjectReset2: @ 808EEDC - push {lr} - bl FindCameraObject - movs r1, 0x2 - strh r1, [r0, 0x30] - pop {r0} - bx r0 - thumb_func_end CameraObjectReset2 - - thumb_func_start sub_808EEEC -sub_808EEEC: @ 808EEEC - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r12, r0 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - lsls r2, 16 - lsrs r6, r2, 16 - lsls r3, 24 - lsrs r7, r3, 24 - movs r5, 0 - ldr r1, =0x02020630 -_0808EF06: - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r4, r0, r1 - adds r0, r4, 0 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - bne _0808EF38 - adds r0, r4, 0 - mov r1, r12 - movs r2, 0x44 - bl memcpy - mov r0, r8 - strh r0, [r4, 0x20] - strh r6, [r4, 0x22] - adds r0, r4, 0 - adds r0, 0x43 - strb r7, [r0] - b _0808EF42 - .pool -_0808EF38: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3F - bls _0808EF06 -_0808EF42: - adds r0, r5, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808EEEC - - thumb_func_start obj_unfreeze -obj_unfreeze: @ 808EF50 - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r12, r0 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - lsls r2, 16 - lsrs r6, r2, 16 - lsls r3, 24 - lsrs r7, r3, 24 - movs r5, 0x3F - ldr r3, =0x02020630 - movs r2, 0x1 - negs r2, r2 -_0808EF6E: - lsls r0, r5, 16 - asrs r1, r0, 16 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r0, r3 - adds r0, r4, 0 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - bne _0808EFA8 - adds r0, r4, 0 - mov r1, r12 - movs r2, 0x44 - bl memcpy - mov r0, r8 - strh r0, [r4, 0x20] - strh r6, [r4, 0x22] - adds r0, r4, 0 - adds r0, 0x43 - strb r7, [r0] - lsls r0, r5, 24 - lsrs r0, 24 - b _0808EFB6 - .pool -_0808EFA8: - subs r0, r1, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, r2 - bgt _0808EF6E - movs r0, 0x40 -_0808EFB6: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end obj_unfreeze - - thumb_func_start FieldObjectSetDirection -@ void FieldObjectSetDirection(struct npc_state *fieldObject, u8 direction) -FieldObjectSetDirection: @ 808EFC0 - push {r4,lr} - adds r3, r0, 0 - lsls r1, 24 - lsrs r2, r1, 24 - adds r4, r2, 0 - ldrb r0, [r3, 0x18] - lsls r0, 28 - lsrs r0, 28 - adds r1, r3, 0 - adds r1, 0x20 - strb r0, [r1] - ldrb r0, [r3, 0x1] - lsls r0, 30 - cmp r0, 0 - blt _0808EFF0 - movs r0, 0xF - adds r1, r2, 0 - ands r1, r0 - ldrb r2, [r3, 0x18] - movs r0, 0x10 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x18] -_0808EFF0: - lsls r2, r4, 4 - ldrb r1, [r3, 0x18] - movs r0, 0xF - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0x18] - pop {r4} - pop {r0} - bx r0 - thumb_func_end FieldObjectSetDirection - - thumb_func_start GetFieldObjectScriptPointerByLocalIdAndMap -@ u32 GetFieldObjectScriptPointerByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) -GetFieldObjectScriptPointerByLocalIdAndMap: @ 808F004 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - bl GetFieldObjectTemplateByLocalIdAndMap - ldr r0, [r0, 0x10] - pop {r1} - bx r1 - thumb_func_end GetFieldObjectScriptPointerByLocalIdAndMap - - thumb_func_start GetFieldObjectScriptPointerByFieldObjectId -@ u32 GetFieldObjectScriptPointerByFieldObjectId(u8 fieldObjectId) -GetFieldObjectScriptPointerByFieldObjectId: @ 808F01C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02037350 - lsls r2, r0, 3 - adds r2, r0 - lsls r2, 2 - adds r2, r1 - ldrb r0, [r2, 0x8] - ldrb r1, [r2, 0x9] - ldrb r2, [r2, 0xA] - bl GetFieldObjectScriptPointerByLocalIdAndMap - pop {r1} - bx r1 - .pool - thumb_func_end GetFieldObjectScriptPointerByFieldObjectId - - thumb_func_start GetFieldObjectFlagIdByLocalIdAndMap -@ u16 GetFieldObjectFlagIdByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) -GetFieldObjectFlagIdByLocalIdAndMap: @ 808F040 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - bl GetFieldObjectTemplateByLocalIdAndMap - ldrh r0, [r0, 0x14] - pop {r1} - bx r1 - thumb_func_end GetFieldObjectFlagIdByLocalIdAndMap - - thumb_func_start GetFieldObjectFlagIdByFieldObjectId -@ u16 GetFieldObjectFlagIdByFieldObjectId(u8 fieldObjectId) -GetFieldObjectFlagIdByFieldObjectId: @ 808F058 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02037350 - lsls r2, r0, 3 - adds r2, r0 - lsls r2, 2 - adds r2, r1 - ldrb r0, [r2, 0x8] - ldrb r1, [r2, 0x9] - ldrb r2, [r2, 0xA] - bl GetFieldObjectFlagIdByLocalIdAndMap - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end GetFieldObjectFlagIdByFieldObjectId - - thumb_func_start sub_808F080 -sub_808F080: @ 808F080 - push {lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808F0B4 - ldr r2, =0x02037350 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x7] - b _0808F0B6 - .pool -_0808F0B4: - movs r0, 0xFF -_0808F0B6: - add sp, 0x4 - pop {r1} - bx r1 - thumb_func_end sub_808F080 - - thumb_func_start sub_808F0BC -sub_808F0BC: @ 808F0BC - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02037350 - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x7] - bx lr - .pool - thumb_func_end sub_808F0BC - - thumb_func_start sub_808F0D4 -sub_808F0D4: @ 808F0D4 - push {lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808F108 - ldr r2, =0x02037350 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1D] - b _0808F10A - .pool -_0808F108: - movs r0, 0xFF -_0808F10A: - add sp, 0x4 - pop {r1} - bx r1 - thumb_func_end sub_808F0D4 - - thumb_func_start FieldObjectGetBerryTreeId -@ u8 FieldObjectGetBerryTreeId(u8 fieldObjectId) -FieldObjectGetBerryTreeId: @ 808F110 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02037350 - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x1D] - bx lr - .pool - thumb_func_end FieldObjectGetBerryTreeId - - thumb_func_start GetFieldObjectTemplateByLocalIdAndMap -@ struct FieldObjectTemplate *GetFieldObjectTemplateByLocalIdAndMap(u8 localId, u8 mapId, u8 mapGroupId) -GetFieldObjectTemplateByLocalIdAndMap: @ 808F128 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r3, r1, 24 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r0, 0x5 - ldrsb r0, [r1, r0] - cmp r0, r3 - bne _0808F160 - movs r0, 0x4 - ldrsb r0, [r1, r0] - cmp r0, r2 - bne _0808F160 - movs r0, 0xC7 - lsls r0, 4 - adds r1, r0 - ldr r0, =0x02037318 - ldr r0, [r0, 0x4] - b _0808F16C - .pool -_0808F160: - adds r0, r2, 0 - adds r1, r3, 0 - bl get_mapheader_by_bank_and_number - ldr r0, [r0, 0x4] - ldr r1, [r0, 0x4] -_0808F16C: - ldrb r2, [r0] - adds r0, r4, 0 - bl FindFieldObjectTemplateInArrayByLocalId - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetFieldObjectTemplateByLocalIdAndMap - - thumb_func_start FindFieldObjectTemplateInArrayByLocalId -@ struct FieldObjectTemplate *FindFieldObjectTemplateInArrayByLocalId(u8 localId, struct FieldObjectTemplate *templates, u8 numTemplates) -FindFieldObjectTemplateInArrayByLocalId: @ 808F17C - push {r4,r5,lr} - adds r5, r1, 0 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r2, 24 - lsrs r2, 24 - movs r1, 0 - cmp r1, r2 - bcs _0808F1AA -_0808F18E: - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r3, r0, r5 - ldrb r0, [r3] - cmp r0, r4 - bne _0808F1A0 - adds r0, r3, 0 - b _0808F1AC -_0808F1A0: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, r2 - bcc _0808F18E -_0808F1AA: - movs r0, 0 -_0808F1AC: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end FindFieldObjectTemplateInArrayByLocalId - - thumb_func_start sub_808F1B4 -@ int sub_808F1B4(struct npc_state *fieldObject) -sub_808F1B4: @ 808F1B4 - push {r4,r5,lr} - adds r3, r0, 0 - ldrb r0, [r3, 0x9] - ldr r1, =0x03005d8c - ldr r2, [r1] - movs r1, 0x5 - ldrsb r1, [r2, r1] - cmp r0, r1 - bne _0808F200 - ldrb r1, [r3, 0xA] - movs r0, 0x4 - ldrsb r0, [r2, r0] - cmp r1, r0 - beq _0808F1E2 - b _0808F200 - .pool -_0808F1D8: - movs r1, 0xC7 - lsls r1, 4 - adds r0, r1 - adds r0, r4, r0 - b _0808F202 -_0808F1E2: - movs r1, 0 - adds r4, r2, 0 - ldrb r3, [r3, 0x8] - movs r5, 0xC7 - lsls r5, 4 - adds r2, r4, r5 - movs r0, 0 -_0808F1F0: - ldrb r5, [r2] - cmp r3, r5 - beq _0808F1D8 - adds r2, 0x18 - adds r0, 0x18 - adds r1, 0x1 - cmp r1, 0x3F - ble _0808F1F0 -_0808F200: - movs r0, 0 -_0808F202: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808F1B4 - - thumb_func_start sub_808F208 -@ void sub_808F208(struct npc_state *fieldObject) -sub_808F208: @ 808F208 - push {r4,lr} - adds r4, r0, 0 - bl sub_808F1B4 - adds r1, r0, 0 - cmp r1, 0 - beq _0808F222 - ldrh r0, [r4, 0x10] - subs r0, 0x7 - strh r0, [r1, 0x4] - ldrh r0, [r4, 0x12] - subs r0, 0x7 - strh r0, [r1, 0x6] -_0808F222: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_808F208 - - thumb_func_start sub_808F228 -sub_808F228: @ 808F228 - push {r4,lr} - adds r4, r1, 0 - bl sub_808F1B4 - cmp r0, 0 - beq _0808F236 - str r4, [r0, 0x10] -_0808F236: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_808F228 - - thumb_func_start sub_808F23C -sub_808F23C: @ 808F23C - push {r4,lr} - lsls r1, 24 - lsrs r4, r1, 24 - bl sub_808F1B4 - cmp r0, 0 - beq _0808F24C - strb r4, [r0, 0x9] -_0808F24C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_808F23C - - thumb_func_start sub_808F254 -@ void sub_808F254(u8 localId, u8 mapId, u8 mapGroupId) -sub_808F254: @ 808F254 - push {lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808F282 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - bl sub_808F208 -_0808F282: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_808F254 - - thumb_func_start sub_808F28C -sub_808F28C: @ 808F28C - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r4, r3, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _0808F2E8 - cmp r4, 0x6 - beq _0808F2B6 - cmp r4, 0x7 - beq _0808F2D4 - b _0808F2E8 -_0808F2B6: - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldr r1, =gUnknown_082766A2 - bl sub_808F228 - b _0808F2E8 - .pool -_0808F2D4: - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldr r1, =gUnknown_082766A6 - bl sub_808F228 -_0808F2E8: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_808F28C - - thumb_func_start npc_paltag_set_load -npc_paltag_set_load: @ 808F2F8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl gpu_pal_allocator_reset__manage_upper_four - ldr r1, =0x020375b6 - ldr r2, =0x000011ff - adds r0, r2, 0 - strh r0, [r1] - ldr r2, =0x020375b4 - strb r4, [r2] - cmp r4, 0x1 - bne _0808F344 - ldr r1, =gUnknown_0850BE38 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0 - movs r2, 0x6 - bl pal_patch_for_npc_range - ldr r1, =0x0300301c - movs r0, 0x8 - strb r0, [r1] - b _0808F356 - .pool -_0808F344: - ldr r0, =gUnknown_0850BE38 - ldrb r1, [r2] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - movs r1, 0 - movs r2, 0xA - bl pal_patch_for_npc_range -_0808F356: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end npc_paltag_set_load - - thumb_func_start npc_paltag_by_palslot -npc_paltag_by_palslot: @ 808F360 - push {r4-r6,lr} - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x9 - bhi _0808F39C - ldr r1, =gUnknown_0850BE38 - ldr r0, =0x020375b4 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - lsls r0, r2, 1 - b _0808F390 - .pool -_0808F384: - adds r1, r4, 0x4 - adds r1, r2, r1 - ldr r0, =0x020375b4 - ldrb r0, [r0] - ldr r1, [r1] - lsls r0, 1 -_0808F390: - adds r0, r1 - ldrh r0, [r0] - b _0808F3CE - .pool -_0808F39C: - movs r3, 0 - ldr r0, =gUnknown_0850BD78 - ldrh r1, [r0] - ldr r2, =0x000011ff - adds r4, r0, 0 - cmp r1, r2 - beq _0808F3CC - adds r6, r4, 0 - ldr r0, =0x020375b6 - ldrh r1, [r0] - adds r5, r2, 0 -_0808F3B2: - lsls r2, r3, 3 - adds r0, r2, r6 - ldrh r0, [r0] - cmp r0, r1 - beq _0808F384 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 3 - adds r0, r4 - ldrh r0, [r0] - cmp r0, r5 - bne _0808F3B2 -_0808F3CC: - ldr r0, =0x000011ff -_0808F3CE: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end npc_paltag_by_palslot - - thumb_func_start FieldObjectCB_NoMovement1 -FieldObjectCB_NoMovement1: @ 808F3E0 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =FieldObjectCB2_NoMovement1 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_NoMovement1 - - thumb_func_start FieldObjectCB2_NoMovement1 -FieldObjectCB2_NoMovement1: @ 808F404 - movs r0, 0 - bx lr - thumb_func_end FieldObjectCB2_NoMovement1 - - thumb_func_start FieldObjectCB_GoRandomDirections -FieldObjectCB_GoRandomDirections: @ 808F408 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =FieldObjectCB2_GoRandomDirections - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoRandomDirections - - thumb_func_start FieldObjectCB2_GoRandomDirections -FieldObjectCB2_GoRandomDirections: @ 808F42C - push {r4,lr} - ldr r3, =gUnknown_0850D6F4 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end FieldObjectCB2_GoRandomDirections - - thumb_func_start sub_808F44C -sub_808F44C: @ 808F44C - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808F44C - - thumb_func_start sub_808F460 -sub_808F460: @ 808F460 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808F460 - - thumb_func_start sub_808F48C -sub_808F48C: @ 808F48C - push {r4-r6,lr} - adds r6, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0808F4C0 - ldr r5, =gUnknown_0850D6DC - bl GenerateRandomNumber - movs r4, 0x3 - adds r1, r4, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r5 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r6, 0 - bl sub_8097978 - strh r4, [r6, 0x30] - movs r0, 0x1 - b _0808F4C2 - .pool -_0808F4C0: - movs r0, 0 -_0808F4C2: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_808F48C - - thumb_func_start sub_808F4C8 -sub_808F4C8: @ 808F4C8 - push {r4,lr} - adds r4, r1, 0 - adds r0, r4, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _0808F4DC - movs r0, 0 - b _0808F4E2 -_0808F4DC: - movs r0, 0x4 - strh r0, [r4, 0x30] - movs r0, 0x1 -_0808F4E2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808F4C8 - - thumb_func_start sub_808F4E8 -sub_808F4E8: @ 808F4E8 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - ldr r1, =gUnknown_0850D710 - mov r0, sp - movs r2, 0x4 - bl memcpy - bl GenerateRandomNumber - movs r1, 0x3 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r4, [r0] - adds r0, r5, 0 - adds r1, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x5 - strh r0, [r6, 0x30] - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8092B88 - lsls r0, 24 - cmp r0, 0 - beq _0808F526 - movs r0, 0x1 - strh r0, [r6, 0x30] -_0808F526: - movs r0, 0x1 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808F4E8 - - thumb_func_start sub_808F534 -sub_808F534: @ 808F534 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl GetGoSpeed0AnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x6 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808F534 - - thumb_func_start sub_808F564 -sub_808F564: @ 808F564 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0808F582 - ldrb r0, [r4] - movs r1, 0x3 - negs r1, r1 - ands r1, r0 - strb r1, [r4] - movs r0, 0x1 - strh r0, [r5, 0x30] -_0808F582: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808F564 - - thumb_func_start FieldObjectIsTrainerAndCloseToPlayer -@ bool8 FieldObjectIsTrainerAndCloseToPlayer(struct npc_state *fieldObject) -FieldObjectIsTrainerAndCloseToPlayer: @ 808F58C - push {r4-r7,lr} - sub sp, 0x4 - adds r5, r0, 0 - movs r0, 0x80 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _0808F5F8 - ldrb r0, [r5, 0x7] - cmp r0, 0x1 - beq _0808F5A8 - cmp r0, 0x3 - bne _0808F5F8 -_0808F5A8: - mov r7, sp - adds r7, 0x2 - mov r0, sp - adds r1, r7, 0 - bl PlayerGetDestCoords - ldrh r2, [r5, 0x10] - ldrh r4, [r5, 0x12] - ldrb r1, [r5, 0x1D] - subs r3, r2, r1 - subs r0, r4, r1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r2, r1, r2 - lsls r2, 16 - lsrs r2, 16 - adds r1, r4 - lsls r1, 16 - lsrs r6, r1, 16 - mov r0, sp - lsls r3, 16 - asrs r3, 16 - movs r1, 0 - ldrsh r4, [r0, r1] - cmp r3, r4 - bgt _0808F5F8 - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, r4 - blt _0808F5F8 - lsls r0, r5, 16 - asrs r0, 16 - movs r2, 0 - ldrsh r1, [r7, r2] - cmp r0, r1 - bgt _0808F5F8 - lsls r0, r6, 16 - asrs r0, 16 - cmp r0, r1 - bge _0808F5FC -_0808F5F8: - movs r0, 0 - b _0808F5FE -_0808F5FC: - movs r0, 0x1 -_0808F5FE: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end FieldObjectIsTrainerAndCloseToPlayer - - thumb_func_start sub_808F608 -sub_808F608: @ 808F608 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 16 - lsrs r0, r1, 16 - lsls r2, 16 - lsls r3, 16 - cmp r2, r3 - ble _0808F626 - movs r2, 0x4 - lsls r0, r4, 16 - cmp r0, 0 - bge _0808F630 - movs r2, 0x3 - b _0808F630 -_0808F626: - movs r2, 0x1 - lsls r0, 16 - cmp r0, 0 - bge _0808F630 - movs r2, 0x2 -_0808F630: - adds r0, r2, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808F608 - - thumb_func_start sub_808F638 -sub_808F638: @ 808F638 - push {lr} - movs r0, 0x1 - lsls r1, 16 - cmp r1, 0 - bge _0808F644 - movs r0, 0x2 -_0808F644: - pop {r1} - bx r1 - thumb_func_end sub_808F638 - - thumb_func_start sub_808F648 -sub_808F648: @ 808F648 - push {lr} - movs r1, 0x4 - lsls r0, 16 - cmp r0, 0 - bge _0808F654 - movs r1, 0x3 -_0808F654: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end sub_808F648 - - thumb_func_start sub_808F65C -sub_808F65C: @ 808F65C - push {r4-r7,lr} - lsls r0, 16 - asrs r4, r0, 16 - lsls r1, 16 - asrs r5, r1, 16 - lsls r2, 16 - asrs r6, r2, 16 - lsls r3, 16 - asrs r7, r3, 16 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F608 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0808F698 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F648 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bne _0808F6B2 - b _0808F6B0 -_0808F698: - cmp r0, 0x4 - bne _0808F6B2 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F638 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0808F6B2 -_0808F6B0: - movs r0, 0x2 -_0808F6B2: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808F65C - - thumb_func_start sub_808F6B8 -sub_808F6B8: @ 808F6B8 - push {r4-r7,lr} - lsls r0, 16 - asrs r4, r0, 16 - lsls r1, 16 - asrs r5, r1, 16 - lsls r2, 16 - asrs r6, r2, 16 - lsls r3, 16 - asrs r7, r3, 16 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F608 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0808F6F4 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F648 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _0808F70E - b _0808F70C -_0808F6F4: - cmp r0, 0x3 - bne _0808F70E - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F638 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0808F70E -_0808F70C: - movs r0, 0x2 -_0808F70E: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808F6B8 - - thumb_func_start sub_808F714 -sub_808F714: @ 808F714 - push {r4-r7,lr} - lsls r0, 16 - asrs r4, r0, 16 - lsls r1, 16 - asrs r5, r1, 16 - lsls r2, 16 - asrs r6, r2, 16 - lsls r3, 16 - asrs r7, r3, 16 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F608 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0808F750 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F648 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bne _0808F76A - b _0808F768 -_0808F750: - cmp r0, 0x4 - bne _0808F76A - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F638 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0808F76A -_0808F768: - movs r0, 0x1 -_0808F76A: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808F714 - - thumb_func_start sub_808F770 -sub_808F770: @ 808F770 - push {r4-r7,lr} - lsls r0, 16 - asrs r4, r0, 16 - lsls r1, 16 - asrs r5, r1, 16 - lsls r2, 16 - asrs r6, r2, 16 - lsls r3, 16 - asrs r7, r3, 16 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F608 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0808F7AC - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F648 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _0808F7C6 - b _0808F7C4 -_0808F7AC: - cmp r0, 0x3 - bne _0808F7C6 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_808F638 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0808F7C6 -_0808F7C4: - movs r0, 0x1 -_0808F7C6: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808F770 - - thumb_func_start sub_808F7CC -sub_808F7CC: @ 808F7CC - push {r4-r7,lr} - lsls r0, 16 - asrs r7, r0, 16 - lsls r1, 16 - asrs r6, r1, 16 - lsls r2, 16 - asrs r5, r2, 16 - lsls r3, 16 - asrs r4, r3, 16 - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_808F608 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bne _0808F802 - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_808F638 - lsls r0, 24 - lsrs r0, 24 -_0808F802: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808F7CC - - thumb_func_start sub_808F808 -sub_808F808: @ 808F808 - push {r4-r7,lr} - lsls r0, 16 - asrs r7, r0, 16 - lsls r1, 16 - asrs r6, r1, 16 - lsls r2, 16 - asrs r5, r2, 16 - lsls r3, 16 - asrs r4, r3, 16 - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_808F608 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _0808F83E - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_808F638 - lsls r0, 24 - lsrs r0, 24 -_0808F83E: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808F808 - - thumb_func_start sub_808F844 -sub_808F844: @ 808F844 - push {r4-r7,lr} - lsls r0, 16 - asrs r7, r0, 16 - lsls r1, 16 - asrs r6, r1, 16 - lsls r2, 16 - asrs r5, r2, 16 - lsls r3, 16 - asrs r4, r3, 16 - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_808F608 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0808F87A - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_808F648 - lsls r0, 24 - lsrs r0, 24 -_0808F87A: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808F844 - - thumb_func_start sub_808F880 -sub_808F880: @ 808F880 - push {r4-r7,lr} - lsls r0, 16 - asrs r7, r0, 16 - lsls r1, 16 - asrs r6, r1, 16 - lsls r2, 16 - asrs r5, r2, 16 - lsls r3, 16 - asrs r4, r3, 16 - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_808F608 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0808F8B6 - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_808F648 - lsls r0, 24 - lsrs r0, 24 -_0808F8B6: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_808F880 - - thumb_func_start sub_808F8BC -sub_808F8BC: @ 808F8BC - push {r4-r6,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r1, 24 - lsrs r6, r1, 24 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - bne _0808F8D4 - movs r0, 0 - b _0808F938 -_0808F8D4: - mov r5, sp - adds r5, 0x2 - mov r0, sp - adds r1, r5, 0 - bl PlayerGetDestCoords - mov r2, sp - mov r0, sp - ldrh r0, [r0] - ldrh r1, [r4, 0x10] - subs r0, r1 - strh r0, [r2] - ldrh r0, [r5] - ldrh r1, [r4, 0x12] - subs r0, r1 - strh r0, [r5] - mov r0, sp - ldrh r3, [r5] - ldrh r2, [r0] - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _0808F908 - negs r0, r0 - lsls r0, 16 - lsrs r2, r0, 16 -_0808F908: - lsls r0, r3, 16 - asrs r0, 16 - cmp r0, 0 - bge _0808F916 - negs r0, r0 - lsls r0, 16 - lsrs r3, r0, 16 -_0808F916: - ldr r0, =gUnknown_0850D714 - lsls r4, r6, 2 - adds r4, r0 - mov r0, sp - movs r6, 0 - ldrsh r0, [r0, r6] - movs r6, 0 - ldrsh r1, [r5, r6] - lsls r2, 16 - asrs r2, 16 - lsls r3, 16 - asrs r3, 16 - ldr r4, [r4] - bl _call_via_r4 - lsls r0, 24 - lsrs r0, 24 -_0808F938: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808F8BC - - thumb_func_start FieldObjectCB_LookRandomDirections -FieldObjectCB_LookRandomDirections: @ 808F944 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =FieldObjectCB2_LookRandomDirections - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_LookRandomDirections - - thumb_func_start FieldObjectCB2_LookRandomDirections -@ bool8 FieldObjectCB2_LookRandomDirections(struct npc_state *fieldObject, struct obj *object) -FieldObjectCB2_LookRandomDirections: @ 808F968 - push {r4,lr} - ldr r3, =gUnknown_0850D740 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end FieldObjectCB2_LookRandomDirections - - thumb_func_start sub_808F988 -@ bool8 sub_808F988(struct npc_state *fieldObject, struct obj *object) -sub_808F988: @ 808F988 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808F988 - - thumb_func_start sub_808F99C -@ bool8 sub_808F99C(struct npc_state *fieldObject, struct obj *object) -sub_808F99C: @ 808F99C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808F99C - - thumb_func_start sub_808F9C8 -@ bool8 sub_808F9C8(struct npc_state *fieldObject, struct obj *object) -sub_808F9C8: @ 808F9C8 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0808F9FE - ldr r4, =gUnknown_0850D6DC - bl GenerateRandomNumber - movs r5, 0x3 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r7, 0 - bl sub_8097978 - ldrb r1, [r6] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - strh r5, [r7, 0x30] -_0808F9FE: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808F9C8 - - thumb_func_start sub_808FA0C -@ bool8 sub_808FA0C(struct npc_state *fieldObject, struct obj *object) -sub_808FA0C: @ 808FA0C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _0808FA2A - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _0808FA32 -_0808FA2A: - movs r0, 0x4 - strh r0, [r5, 0x30] - movs r0, 0x1 - b _0808FA34 -_0808FA32: - movs r0, 0 -_0808FA34: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808FA0C - - thumb_func_start sub_808FA3C -@ bool8 sub_808FA3C(struct npc_state *fieldObject, struct obj *object) -sub_808FA3C: @ 808FA3C - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D710 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r0, r4, 0 - movs r1, 0 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0808FA6C - bl GenerateRandomNumber - movs r1, 0x3 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r1, [r0] -_0808FA6C: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x30] - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808FA3C - - thumb_func_start FieldObjectCB_RandomlyGoNorthOrSouth -FieldObjectCB_RandomlyGoNorthOrSouth: @ 808FA84 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =FieldObjectCB2_RandomlyGoNorthOrSouth - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyGoNorthOrSouth - - thumb_func_start FieldObjectCB2_RandomlyGoNorthOrSouth -FieldObjectCB2_RandomlyGoNorthOrSouth: @ 808FAA8 - push {r4,lr} - ldr r3, =gUnknown_0850D754 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end FieldObjectCB2_RandomlyGoNorthOrSouth - - thumb_func_start sub_808FAC8 -sub_808FAC8: @ 808FAC8 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808FAC8 - - thumb_func_start sub_808FADC -sub_808FADC: @ 808FADC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808FADC - - thumb_func_start sub_808FB08 -@ bool8 sub_808FB08(struct npc_state *fieldObject, struct obj *object) -sub_808FB08: @ 808FB08 - push {r4-r6,lr} - adds r6, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0808FB3C - ldr r5, =gUnknown_0850D6DC - bl GenerateRandomNumber - movs r4, 0x3 - adds r1, r4, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r5 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r6, 0 - bl sub_8097978 - strh r4, [r6, 0x30] - movs r0, 0x1 - b _0808FB3E - .pool -_0808FB3C: - movs r0, 0 -_0808FB3E: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_808FB08 - - thumb_func_start sub_808FB44 -@ bool8 sub_808FB44(struct npc_state *fieldObject, struct obj *object) -sub_808FB44: @ 808FB44 - push {r4,lr} - adds r4, r1, 0 - adds r0, r4, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _0808FB58 - movs r0, 0 - b _0808FB5E -_0808FB58: - movs r0, 0x4 - strh r0, [r4, 0x30] - movs r0, 0x1 -_0808FB5E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808FB44 - - thumb_func_start sub_808FB64 -@ bool8 sub_808FB64(struct npc_state *fieldObject, struct obj *object) -sub_808FB64: @ 808FB64 - push {r4-r7,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - ldr r1, =gUnknown_0850D770 - mov r0, sp - movs r2, 0x2 - bl memcpy - bl GenerateRandomNumber - movs r7, 0x1 - adds r1, r7, 0 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r4, [r0] - adds r0, r5, 0 - adds r1, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x5 - strh r0, [r6, 0x30] - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8092B88 - lsls r0, 24 - cmp r0, 0 - beq _0808FBA2 - strh r7, [r6, 0x30] -_0808FBA2: - movs r0, 0x1 - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808FB64 - - thumb_func_start sub_808FBB0 -sub_808FBB0: @ 808FBB0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl GetGoSpeed0AnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x6 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808FBB0 - - thumb_func_start sub_808FBE0 -sub_808FBE0: @ 808FBE0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0808FBFE - ldrb r0, [r4] - movs r1, 0x3 - negs r1, r1 - ands r1, r0 - strb r1, [r4] - movs r0, 0x1 - strh r0, [r5, 0x30] -_0808FBFE: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808FBE0 - - thumb_func_start FieldObjectCB_RandomlyGoEastOrWest -FieldObjectCB_RandomlyGoEastOrWest: @ 808FC08 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =FieldObjectCB2_RandomlyGoEastOrWest - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyGoEastOrWest - - thumb_func_start FieldObjectCB2_RandomlyGoEastOrWest -FieldObjectCB2_RandomlyGoEastOrWest: @ 808FC2C - push {r4,lr} - ldr r3, =gUnknown_0850D774 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end FieldObjectCB2_RandomlyGoEastOrWest - - thumb_func_start sub_808FC4C -sub_808FC4C: @ 808FC4C - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808FC4C - - thumb_func_start sub_808FC60 -sub_808FC60: @ 808FC60 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808FC60 - - thumb_func_start sub_808FC8C -sub_808FC8C: @ 808FC8C - push {r4-r6,lr} - adds r6, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0808FCC0 - ldr r5, =gUnknown_0850D6DC - bl GenerateRandomNumber - movs r4, 0x3 - adds r1, r4, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r5 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r6, 0 - bl sub_8097978 - strh r4, [r6, 0x30] - movs r0, 0x1 - b _0808FCC2 - .pool -_0808FCC0: - movs r0, 0 -_0808FCC2: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_808FC8C - - thumb_func_start sub_808FCC8 -sub_808FCC8: @ 808FCC8 - push {r4,lr} - adds r4, r1, 0 - adds r0, r4, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _0808FCDC - movs r0, 0 - b _0808FCE2 -_0808FCDC: - movs r0, 0x4 - strh r0, [r4, 0x30] - movs r0, 0x1 -_0808FCE2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808FCC8 - - thumb_func_start sub_808FCE8 -sub_808FCE8: @ 808FCE8 - push {r4-r7,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - ldr r1, =gUnknown_0850D790 - mov r0, sp - movs r2, 0x2 - bl memcpy - bl GenerateRandomNumber - movs r7, 0x1 - adds r1, r7, 0 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r4, [r0] - adds r0, r5, 0 - adds r1, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x5 - strh r0, [r6, 0x30] - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8092B88 - lsls r0, 24 - cmp r0, 0 - beq _0808FD26 - strh r7, [r6, 0x30] -_0808FD26: - movs r0, 0x1 - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_808FCE8 - - thumb_func_start sub_808FD34 -sub_808FD34: @ 808FD34 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl GetGoSpeed0AnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x6 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808FD34 - - thumb_func_start sub_808FD64 -sub_808FD64: @ 808FD64 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0808FD82 - ldrb r0, [r4] - movs r1, 0x3 - negs r1, r1 - ands r1, r0 - strb r1, [r4] - movs r0, 0x1 - strh r0, [r5, 0x30] -_0808FD82: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808FD64 - - thumb_func_start FieldObjectCB_FaceFixedDirection -FieldObjectCB_FaceFixedDirection: @ 808FD8C - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =FieldObjectCB2_FaceFixedDirection - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_FaceFixedDirection - - thumb_func_start FieldObjectCB2_FaceFixedDirection -@ bool8 FieldObjectCB2_FaceFixedDirection(struct npc_state *fieldObject, struct obj *object) -FieldObjectCB2_FaceFixedDirection: @ 808FDB0 - push {r4,lr} - ldr r3, =gUnknown_0850D794 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end FieldObjectCB2_FaceFixedDirection - - thumb_func_start sub_808FDD0 -@ bool8 sub_808FDD0(struct npc_state *fieldObject, struct obj *object) -sub_808FDD0: @ 808FDD0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl npc_reset - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x1 - strh r0, [r5, 0x30] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_808FDD0 - - thumb_func_start sub_808FDFC -@ bool8 sub_808FDFC(struct npc_state *fieldObject, struct obj *object) -sub_808FDFC: @ 808FDFC - push {r4,lr} - adds r4, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - bne _0808FE0E - movs r0, 0 - b _0808FE14 -_0808FE0E: - movs r0, 0x2 - strh r0, [r4, 0x30] - movs r0, 0x1 -_0808FE14: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808FDFC - - thumb_func_start sub_808FE1C -@ bool8 sub_808FE1C(struct npc_state *fieldObject, struct obj *object) -sub_808FE1C: @ 808FE1C - ldrb r2, [r0] - movs r1, 0x3 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - movs r0, 0 - bx lr - thumb_func_end sub_808FE1C - - thumb_func_start FieldObjectCB_BerryTree -FieldObjectCB_BerryTree: @ 808FE2C - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r5, r0, r1 - ldrh r1, [r4, 0x3C] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0808FE58 - adds r0, r5, 0 - adds r1, r4, 0 - bl get_berry_tree_graphics - ldrh r1, [r4, 0x3C] - movs r0, 0x1 - orrs r0, r1 - strh r0, [r4, 0x3C] -_0808FE58: - ldr r2, =FieldObjectCB2_BerryTree - adds r0, r5, 0 - adds r1, r4, 0 - bl FieldObjectStep - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_BerryTree - - thumb_func_start FieldObjectCB2_BerryTree -FieldObjectCB2_BerryTree: @ 808FE70 - push {r4,lr} - ldr r3, =gUnknown_0850D7A0 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end FieldObjectCB2_BerryTree - - thumb_func_start do_berry_tree_growth_sparkle_1 -@ bool8 do_berry_tree_growth_sparkle_1(struct npc_state *fieldObject, struct obj *object) -do_berry_tree_growth_sparkle_1: @ 808FE90 - push {r4-r7,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl npc_reset - ldrb r0, [r4, 0x1] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r4, 0x1] - adds r6, r5, 0 - adds r6, 0x3E - ldrb r0, [r6] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r6] - ldrb r0, [r4, 0x1D] - bl GetStageByBerryTreeId - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0 - bne _0808FF00 - ldrh r1, [r5, 0x3C] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _0808FEF6 - subs r6, 0x14 - ldrb r0, [r6] - cmp r0, 0x4 - bne _0808FEF6 - ldr r1, =0x02038c08 - movs r2, 0x10 - ldrsh r0, [r4, r2] - str r0, [r1] - movs r2, 0x12 - ldrsh r0, [r4, r2] - str r0, [r1, 0x4] - adds r0, r5, 0 - adds r0, 0x43 - ldrb r0, [r0] - subs r0, 0x1 - str r0, [r1, 0x8] - ldrb r0, [r5, 0x5] - lsls r0, 28 - lsrs r0, 30 - str r0, [r1, 0xC] - movs r0, 0x17 - bl FieldEffectStart - strb r7, [r6] -_0808FEF6: - movs r0, 0 - b _0808FF42 - .pool -_0808FF00: - ldrb r1, [r4, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x1] - ldrb r1, [r6] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - subs r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r5, 0 - adds r0, 0x2A - ldrb r0, [r0] - cmp r0, r7 - bne _0808FF3C - adds r0, r4, 0 - adds r1, r5, 0 - bl get_berry_tree_graphics - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x39 - bl FieldObjectSetRegularAnim - movs r0, 0x1 - strh r0, [r5, 0x30] - b _0808FF42 -_0808FF3C: - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 -_0808FF42: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end do_berry_tree_growth_sparkle_1 - - thumb_func_start sub_808FF48 -@ bool8 sub_808FF48(struct npc_state *fieldObject, struct obj *object) -sub_808FF48: @ 808FF48 - push {r4,lr} - adds r4, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - bne _0808FF5A - movs r0, 0 - b _0808FF60 -_0808FF5A: - movs r0, 0 - strh r0, [r4, 0x30] - movs r0, 0x1 -_0808FF60: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808FF48 - - thumb_func_start do_berry_tree_growth_sparkle_2 -@ bool8 do_berry_tree_growth_sparkle_2(struct npc_state *fieldObject, struct obj *object) -do_berry_tree_growth_sparkle_2: @ 808FF68 - push {r4,lr} - ldrb r2, [r0] - movs r3, 0x2 - orrs r2, r3 - strb r2, [r0] - movs r3, 0 - movs r2, 0x3 - strh r2, [r1, 0x30] - strh r3, [r1, 0x32] - ldrh r3, [r1, 0x3C] - movs r2, 0x2 - orrs r2, r3 - strh r2, [r1, 0x3C] - ldr r3, =0x02038c08 - movs r4, 0x10 - ldrsh r2, [r0, r4] - str r2, [r3] - movs r2, 0x12 - ldrsh r0, [r0, r2] - str r0, [r3, 0x4] - adds r0, r1, 0 - adds r0, 0x43 - ldrb r0, [r0] - subs r0, 0x1 - str r0, [r3, 0x8] - ldrb r0, [r1, 0x5] - lsls r0, 28 - lsrs r0, 30 - str r0, [r3, 0xC] - movs r0, 0x17 - bl FieldEffectStart - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end do_berry_tree_growth_sparkle_2 - - thumb_func_start sub_808FFB4 -@ bool8 sub_808FFB4(struct npc_state *fieldObject, struct obj *object) -sub_808FFB4: @ 808FFB4 - push {r4,lr} - adds r3, r0, 0 - adds r4, r1, 0 - ldrh r1, [r4, 0x32] - adds r1, 0x1 - strh r1, [r4, 0x32] - movs r0, 0x2 - ands r1, r0 - lsls r1, 16 - lsrs r1, 17 - lsls r1, 5 - ldrb r2, [r3, 0x1] - subs r0, 0x23 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x1] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x40 - bgt _0808FFEC - movs r0, 0 - b _0808FFFE -_0808FFEC: - adds r0, r3, 0 - adds r1, r4, 0 - bl get_berry_tree_graphics - movs r0, 0x4 - strh r0, [r4, 0x30] - movs r0, 0 - strh r0, [r4, 0x32] - movs r0, 0x1 -_0808FFFE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_808FFB4 - - thumb_func_start sub_8090004 -@ bool8 sub_8090004(struct npc_state *fieldObject, struct obj *object) -sub_8090004: @ 8090004 - push {r4,lr} - adds r4, r1, 0 - ldrh r2, [r4, 0x32] - adds r2, 0x1 - strh r2, [r4, 0x32] - movs r1, 0x2 - ands r2, r1 - lsls r2, 16 - lsrs r2, 17 - lsls r2, 5 - ldrb r3, [r0, 0x1] - subs r1, 0x23 - ands r1, r3 - orrs r1, r2 - strb r1, [r0, 0x1] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x40 - bgt _0809003A - movs r0, 0 - b _08090048 -_0809003A: - movs r0, 0 - strh r0, [r4, 0x30] - ldrh r1, [r4, 0x3C] - subs r0, 0x3 - ands r0, r1 - strh r0, [r4, 0x3C] - movs r0, 0x1 -_08090048: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090004 - - thumb_func_start FieldObjectCB_RandomlyLookNorthOrSouth -FieldObjectCB_RandomlyLookNorthOrSouth: @ 8090050 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =FieldObjectCB2_RandomlyLookNorthOrSouth - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyLookNorthOrSouth - - thumb_func_start FieldObjectCB2_RandomlyLookNorthOrSouth -FieldObjectCB2_RandomlyLookNorthOrSouth: @ 8090074 - push {r4,lr} - ldr r3, =gUnknown_0850D7B4 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end FieldObjectCB2_RandomlyLookNorthOrSouth - - thumb_func_start sub_8090094 -sub_8090094: @ 8090094 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090094 - - thumb_func_start sub_80900A8 -sub_80900A8: @ 80900A8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80900A8 - - thumb_func_start sub_80900D4 -sub_80900D4: @ 80900D4 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0809010A - ldr r4, =gUnknown_0850D6DC - bl GenerateRandomNumber - movs r5, 0x3 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r7, 0 - bl sub_8097978 - ldrb r1, [r6] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - strh r5, [r7, 0x30] -_0809010A: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80900D4 - - thumb_func_start sub_8090118 -sub_8090118: @ 8090118 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _08090136 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _0809013E -_08090136: - movs r0, 0x4 - strh r0, [r5, 0x30] - movs r0, 0x1 - b _08090140 -_0809013E: - movs r0, 0 -_08090140: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090118 - - thumb_func_start sub_8090148 -sub_8090148: @ 8090148 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D770 - mov r0, sp - movs r2, 0x2 - bl memcpy - adds r0, r4, 0 - movs r1, 0x1 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08090178 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r1, [r0] -_08090178: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x30] - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090148 - - thumb_func_start FieldObjectCB_RandomlyLookEastOrWest -FieldObjectCB_RandomlyLookEastOrWest: @ 8090190 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =FieldObjectCB2_RandomlyLookEastOrWest - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyLookEastOrWest - - thumb_func_start FieldObjectCB2_RandomlyLookEastOrWest -FieldObjectCB2_RandomlyLookEastOrWest: @ 80901B4 - push {r4,lr} - ldr r3, =gUnknown_0850D7C8 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end FieldObjectCB2_RandomlyLookEastOrWest - - thumb_func_start sub_80901D4 -sub_80901D4: @ 80901D4 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80901D4 - - thumb_func_start sub_80901E8 -sub_80901E8: @ 80901E8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80901E8 - - thumb_func_start sub_8090214 -sub_8090214: @ 8090214 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0809024A - ldr r4, =gUnknown_0850D6DC - bl GenerateRandomNumber - movs r5, 0x3 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r7, 0 - bl sub_8097978 - ldrb r1, [r6] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - strh r5, [r7, 0x30] -_0809024A: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090214 - - thumb_func_start sub_8090258 -sub_8090258: @ 8090258 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _08090276 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _0809027E -_08090276: - movs r0, 0x4 - strh r0, [r5, 0x30] - movs r0, 0x1 - b _08090280 -_0809027E: - movs r0, 0 -_08090280: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090258 - - thumb_func_start sub_8090288 -sub_8090288: @ 8090288 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D790 - mov r0, sp - movs r2, 0x2 - bl memcpy - adds r0, r4, 0 - movs r1, 0x2 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _080902B8 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r1, [r0] -_080902B8: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x30] - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090288 - - thumb_func_start FieldObjectCB_RandomlyLookNorthOrWest -FieldObjectCB_RandomlyLookNorthOrWest: @ 80902D0 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =FieldObjectCB2_RandomlyLookNorthOrWest - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyLookNorthOrWest - - thumb_func_start FieldObjectCB2_RandomlyLookNorthOrWest -FieldObjectCB2_RandomlyLookNorthOrWest: @ 80902F4 - push {r4,lr} - ldr r3, =gUnknown_0850D7DC - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end FieldObjectCB2_RandomlyLookNorthOrWest - - thumb_func_start sub_8090314 -sub_8090314: @ 8090314 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090314 - - thumb_func_start sub_8090328 -sub_8090328: @ 8090328 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090328 - - thumb_func_start sub_8090354 -sub_8090354: @ 8090354 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0809038A - ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber - movs r5, 0x3 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r7, 0 - bl sub_8097978 - ldrb r1, [r6] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - strh r5, [r7, 0x30] -_0809038A: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090354 - - thumb_func_start sub_8090398 -sub_8090398: @ 8090398 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _080903B6 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _080903BE -_080903B6: - movs r0, 0x4 - strh r0, [r5, 0x30] - movs r0, 0x1 - b _080903C0 -_080903BE: - movs r0, 0 -_080903C0: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090398 - - thumb_func_start sub_80903C8 -sub_80903C8: @ 80903C8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D7F0 - mov r0, sp - movs r2, 0x2 - bl memcpy - adds r0, r4, 0 - movs r1, 0x3 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _080903F8 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r1, [r0] -_080903F8: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x30] - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80903C8 - - thumb_func_start FieldObjectCB_RandomlyLookNorthOrEast -FieldObjectCB_RandomlyLookNorthOrEast: @ 8090410 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8090434 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyLookNorthOrEast - - thumb_func_start sub_8090434 -sub_8090434: @ 8090434 - push {r4,lr} - ldr r3, =gUnknown_0850D7F4 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090434 - - thumb_func_start sub_8090454 -sub_8090454: @ 8090454 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090454 - - thumb_func_start sub_8090468 -sub_8090468: @ 8090468 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090468 - - thumb_func_start sub_8090494 -sub_8090494: @ 8090494 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _080904CA - ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber - movs r5, 0x3 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r7, 0 - bl sub_8097978 - ldrb r1, [r6] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - strh r5, [r7, 0x30] -_080904CA: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090494 - - thumb_func_start sub_80904D8 -sub_80904D8: @ 80904D8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _080904F6 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _080904FE -_080904F6: - movs r0, 0x4 - strh r0, [r5, 0x30] - movs r0, 0x1 - b _08090500 -_080904FE: - movs r0, 0 -_08090500: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80904D8 - - thumb_func_start sub_8090508 -sub_8090508: @ 8090508 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D808 - mov r0, sp - movs r2, 0x2 - bl memcpy - adds r0, r4, 0 - movs r1, 0x4 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08090538 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r1, [r0] -_08090538: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x30] - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090508 - - thumb_func_start FieldObjectCB_RandomlyLookSouthOrWest -FieldObjectCB_RandomlyLookSouthOrWest: @ 8090550 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8090574 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyLookSouthOrWest - - thumb_func_start sub_8090574 -sub_8090574: @ 8090574 - push {r4,lr} - ldr r3, =gUnknown_0850D80C - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090574 - - thumb_func_start sub_8090594 -sub_8090594: @ 8090594 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090594 - - thumb_func_start sub_80905A8 -sub_80905A8: @ 80905A8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80905A8 - - thumb_func_start sub_80905D4 -sub_80905D4: @ 80905D4 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0809060A - ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber - movs r5, 0x3 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r7, 0 - bl sub_8097978 - ldrb r1, [r6] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - strh r5, [r7, 0x30] -_0809060A: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80905D4 - - thumb_func_start sub_8090618 -sub_8090618: @ 8090618 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _08090636 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _0809063E -_08090636: - movs r0, 0x4 - strh r0, [r5, 0x30] - movs r0, 0x1 - b _08090640 -_0809063E: - movs r0, 0 -_08090640: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090618 - - thumb_func_start sub_8090648 -sub_8090648: @ 8090648 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D820 - mov r0, sp - movs r2, 0x2 - bl memcpy - adds r0, r4, 0 - movs r1, 0x5 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08090678 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r1, [r0] -_08090678: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x30] - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090648 - - thumb_func_start FieldObjectCB_RandomlyLookSouthOrEast -FieldObjectCB_RandomlyLookSouthOrEast: @ 8090690 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_80906B4 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyLookSouthOrEast - - thumb_func_start sub_80906B4 -sub_80906B4: @ 80906B4 - push {r4,lr} - ldr r3, =gUnknown_0850D824 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80906B4 - - thumb_func_start sub_80906D4 -sub_80906D4: @ 80906D4 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80906D4 - - thumb_func_start sub_80906E8 -sub_80906E8: @ 80906E8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80906E8 - - thumb_func_start sub_8090714 -sub_8090714: @ 8090714 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0809074A - ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber - movs r5, 0x3 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r7, 0 - bl sub_8097978 - ldrb r1, [r6] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - strh r5, [r7, 0x30] -_0809074A: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090714 - - thumb_func_start sub_8090758 -sub_8090758: @ 8090758 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _08090776 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _0809077E -_08090776: - movs r0, 0x4 - strh r0, [r5, 0x30] - movs r0, 0x1 - b _08090780 -_0809077E: - movs r0, 0 -_08090780: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090758 - - thumb_func_start sub_8090788 -sub_8090788: @ 8090788 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D838 - mov r0, sp - movs r2, 0x2 - bl memcpy - adds r0, r4, 0 - movs r1, 0x6 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _080907B8 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r1, [r0] -_080907B8: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x30] - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090788 - - thumb_func_start FieldObjectCB_RandomlyLookNorthOrSouthOrWest -FieldObjectCB_RandomlyLookNorthOrSouthOrWest: @ 80907D0 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_80907F4 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyLookNorthOrSouthOrWest - - thumb_func_start sub_80907F4 -sub_80907F4: @ 80907F4 - push {r4,lr} - ldr r3, =gUnknown_0850D83C - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80907F4 - - thumb_func_start sub_8090814 -sub_8090814: @ 8090814 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090814 - - thumb_func_start sub_8090828 -sub_8090828: @ 8090828 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090828 - - thumb_func_start sub_8090854 -sub_8090854: @ 8090854 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0809088A - ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber - movs r5, 0x3 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r7, 0 - bl sub_8097978 - ldrb r1, [r6] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - strh r5, [r7, 0x30] -_0809088A: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090854 - - thumb_func_start sub_8090898 -sub_8090898: @ 8090898 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _080908B6 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _080908BE -_080908B6: - movs r0, 0x4 - strh r0, [r5, 0x30] - movs r0, 0x1 - b _080908C0 -_080908BE: - movs r0, 0 -_080908C0: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090898 - - thumb_func_start sub_80908C8 -sub_80908C8: @ 80908C8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D850 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r0, r4, 0 - movs r1, 0x7 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _080908F8 - bl GenerateRandomNumber - movs r1, 0x3 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r1, [r0] -_080908F8: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x30] - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80908C8 - - thumb_func_start FieldObjectCB_RandomlyLookNorthOrSouthOrEast -FieldObjectCB_RandomlyLookNorthOrSouthOrEast: @ 8090910 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8090934 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyLookNorthOrSouthOrEast - - thumb_func_start sub_8090934 -sub_8090934: @ 8090934 - push {r4,lr} - ldr r3, =gUnknown_0850D854 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090934 - - thumb_func_start sub_8090954 -sub_8090954: @ 8090954 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090954 - - thumb_func_start sub_8090968 -sub_8090968: @ 8090968 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090968 - - thumb_func_start sub_8090994 -sub_8090994: @ 8090994 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _080909CA - ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber - movs r5, 0x3 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r7, 0 - bl sub_8097978 - ldrb r1, [r6] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - strh r5, [r7, 0x30] -_080909CA: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090994 - - thumb_func_start sub_80909D8 -sub_80909D8: @ 80909D8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _080909F6 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _080909FE -_080909F6: - movs r0, 0x4 - strh r0, [r5, 0x30] - movs r0, 0x1 - b _08090A00 -_080909FE: - movs r0, 0 -_08090A00: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80909D8 - - thumb_func_start sub_8090A08 -sub_8090A08: @ 8090A08 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D868 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r0, r4, 0 - movs r1, 0x8 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08090A38 - bl GenerateRandomNumber - movs r1, 0x3 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r1, [r0] -_08090A38: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x30] - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090A08 - - thumb_func_start FieldObjectCB_RandomlyLookNorthOrEastOrWest -FieldObjectCB_RandomlyLookNorthOrEastOrWest: @ 8090A50 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8090A74 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyLookNorthOrEastOrWest - - thumb_func_start sub_8090A74 -sub_8090A74: @ 8090A74 - push {r4,lr} - ldr r3, =gUnknown_0850D86C - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090A74 - - thumb_func_start sub_8090A94 -sub_8090A94: @ 8090A94 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090A94 - - thumb_func_start sub_8090AA8 -sub_8090AA8: @ 8090AA8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090AA8 - - thumb_func_start sub_8090AD4 -sub_8090AD4: @ 8090AD4 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _08090B0A - ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber - movs r5, 0x3 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r7, 0 - bl sub_8097978 - ldrb r1, [r6] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - strh r5, [r7, 0x30] -_08090B0A: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090AD4 - - thumb_func_start sub_8090B18 -sub_8090B18: @ 8090B18 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _08090B36 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _08090B3E -_08090B36: - movs r0, 0x4 - strh r0, [r5, 0x30] - movs r0, 0x1 - b _08090B40 -_08090B3E: - movs r0, 0 -_08090B40: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090B18 - - thumb_func_start sub_8090B48 -sub_8090B48: @ 8090B48 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D880 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r0, r4, 0 - movs r1, 0x9 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08090B78 - bl GenerateRandomNumber - movs r1, 0x3 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r1, [r0] -_08090B78: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x30] - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090B48 - - thumb_func_start FieldObjectCB_RandomlyLookSouthOrEastOrWest -FieldObjectCB_RandomlyLookSouthOrEastOrWest: @ 8090B90 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8090BB4 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_RandomlyLookSouthOrEastOrWest - - thumb_func_start sub_8090BB4 -sub_8090BB4: @ 8090BB4 - push {r4,lr} - ldr r3, =gUnknown_0850D884 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090BB4 - - thumb_func_start sub_8090BD4 -sub_8090BD4: @ 8090BD4 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090BD4 - - thumb_func_start sub_8090BE8 -sub_8090BE8: @ 8090BE8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090BE8 - - thumb_func_start sub_8090C14 -sub_8090C14: @ 8090C14 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _08090C4A - ldr r4, =gUnknown_0850D6EC - bl GenerateRandomNumber - movs r5, 0x3 - adds r1, r5, 0 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r7, 0 - bl sub_8097978 - ldrb r1, [r6] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r6] - strh r5, [r7, 0x30] -_08090C4A: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090C14 - - thumb_func_start sub_8090C58 -sub_8090C58: @ 8090C58 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _08090C76 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _08090C7E -_08090C76: - movs r0, 0x4 - strh r0, [r5, 0x30] - movs r0, 0x1 - b _08090C80 -_08090C7E: - movs r0, 0 -_08090C80: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090C58 - - thumb_func_start sub_8090C88 -sub_8090C88: @ 8090C88 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D898 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r0, r4, 0 - movs r1, 0xA - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08090CB8 - bl GenerateRandomNumber - movs r1, 0x3 - ands r1, r0 - mov r2, sp - adds r0, r2, r1 - ldrb r1, [r0] -_08090CB8: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x30] - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090C88 - - thumb_func_start FieldObjectCB_LookAroundCounterclockwise -FieldObjectCB_LookAroundCounterclockwise: @ 8090CD0 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8090CF4 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_LookAroundCounterclockwise - - thumb_func_start sub_8090CF4 -sub_8090CF4: @ 8090CF4 - push {r4,lr} - ldr r3, =gUnknown_0850D89C - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090CF4 - - thumb_func_start sub_8090D14 -sub_8090D14: @ 8090D14 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl npc_reset - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x1 - strh r0, [r5, 0x30] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090D14 - - thumb_func_start sub_8090D40 -sub_8090D40: @ 8090D40 - push {r4,lr} - adds r4, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _08090D5A - adds r0, r4, 0 - movs r1, 0x30 - bl sub_8097978 - movs r0, 0x2 - strh r0, [r4, 0x30] -_08090D5A: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090D40 - - thumb_func_start sub_8090D64 -sub_8090D64: @ 8090D64 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _08090D82 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _08090D86 -_08090D82: - movs r0, 0x3 - strh r0, [r5, 0x30] -_08090D86: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090D64 - - thumb_func_start sub_8090D90 -@ bool8 sub_8090D90(struct npc_state *fieldObject, struct obj *object) -sub_8090D90: @ 8090D90 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D8AC - mov r0, sp - movs r2, 0x5 - bl memcpy - adds r0, r4, 0 - movs r1, 0 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08090DBC - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - add r0, sp - ldrb r1, [r0] -_08090DBC: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0 - strh r0, [r5, 0x30] - movs r0, 0x1 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090D90 - - thumb_func_start FieldObjectCB_LookAroundClockwise -FieldObjectCB_LookAroundClockwise: @ 8090DD4 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8090DF8 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_LookAroundClockwise - - thumb_func_start sub_8090DF8 -sub_8090DF8: @ 8090DF8 - push {r4,lr} - ldr r3, =gUnknown_0850D8B4 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090DF8 - - thumb_func_start sub_8090E18 -sub_8090E18: @ 8090E18 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl npc_reset - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x1 - strh r0, [r5, 0x30] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090E18 - - thumb_func_start sub_8090E44 -sub_8090E44: @ 8090E44 - push {r4,lr} - adds r4, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _08090E5E - adds r0, r4, 0 - movs r1, 0x30 - bl sub_8097978 - movs r0, 0x2 - strh r0, [r4, 0x30] -_08090E5E: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090E44 - - thumb_func_start sub_8090E68 -sub_8090E68: @ 8090E68 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - bne _08090E86 - adds r0, r4, 0 - bl FieldObjectIsTrainerAndCloseToPlayer - lsls r0, 24 - cmp r0, 0 - beq _08090E8A -_08090E86: - movs r0, 0x3 - strh r0, [r5, 0x30] -_08090E8A: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8090E68 - - thumb_func_start sub_8090E94 -sub_8090E94: @ 8090E94 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D8C4 - mov r0, sp - movs r2, 0x5 - bl memcpy - adds r0, r4, 0 - movs r1, 0 - bl sub_808F8BC - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08090EC0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - add r0, sp - ldrb r1, [r0] -_08090EC0: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0 - strh r0, [r5, 0x30] - movs r0, 0x1 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090E94 - - thumb_func_start FieldObjectCB_AlternatelyGoInOppositeDirections -FieldObjectCB_AlternatelyGoInOppositeDirections: @ 8090ED8 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8090EFC - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_AlternatelyGoInOppositeDirections - - thumb_func_start sub_8090EFC -sub_8090EFC: @ 8090EFC - push {r4,lr} - ldr r3, =gUnknown_0850D8CC - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090EFC - - thumb_func_start sub_8090F1C -sub_8090F1C: @ 8090F1C - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8090F1C - - thumb_func_start sub_8090F30 -@ bool8 sub_8090F30(struct npc_state *fieldObject, struct obj *object) -sub_8090F30: @ 8090F30 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, =gUnknown_085055CD - ldrb r1, [r4, 0x6] - adds r1, r0 - ldrb r1, [r1] - adds r0, r4, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0 - beq _08090F52 - adds r0, r1, 0 - bl GetOppositeDirection - lsls r0, 24 - lsrs r1, r0, 24 -_08090F52: - adds r0, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8090F30 - - thumb_func_start sub_8090F68 -@ bool8 sub_8090F68(struct npc_state *fieldObject, struct obj *object) -sub_8090F68: @ 8090F68 - push {r4-r7,lr} - adds r4, r0, 0 - adds r7, r1, 0 - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0 - beq _08090F98 - ldr r1, [r4, 0xC] - ldr r0, [r4, 0x10] - cmp r1, r0 - bne _08090F98 - movs r0, 0 - strb r0, [r2] - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl GetOppositeDirection - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetDirection -_08090F98: - ldrb r1, [r4, 0x18] - lsrs r1, 4 - adds r0, r4, 0 - bl sub_8092B88 - lsls r0, 24 - lsrs r5, r0, 24 - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl GetGoSpeed0AnimId - lsls r0, 24 - lsrs r6, r0, 24 - cmp r5, 0x1 - bne _08090FEE - adds r1, r4, 0 - adds r1, 0x21 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl GetOppositeDirection - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetDirection - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl GetGoSpeed0AnimId - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r1, [r4, 0x18] - lsrs r1, 4 - adds r0, r4, 0 - bl sub_8092B88 - lsls r0, 24 - lsrs r5, r0, 24 -_08090FEE: - cmp r5, 0 - beq _08091000 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetStepInPlaceDelay16AnimId - lsls r0, 24 - lsrs r6, r0, 24 -_08091000: - adds r0, r4, 0 - adds r1, r7, 0 - adds r2, r6, 0 - bl FieldObjectSetRegularAnim - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x3 - strh r0, [r7, 0x30] - movs r0, 0x1 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8090F68 - - thumb_func_start sub_8091020 -@ bool8 sub_8091020(struct npc_state *fieldObject, struct obj *object) -sub_8091020: @ 8091020 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0809103E - ldrb r0, [r4] - movs r1, 0x3 - negs r1, r1 - ands r1, r0 - strb r1, [r4] - movs r0, 0x1 - strh r0, [r5, 0x30] -_0809103E: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8091020 - - thumb_func_start sub_8091048 -@ bool8 sub_8091048(struct npc_state *fieldObject, struct obj *object) -sub_8091048: @ 8091048 - push {r4,lr} - adds r4, r1, 0 - bl npc_reset - movs r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8091048 - - thumb_func_start MoveFieldObjectInNextDirectionInSequence -@ bool8 MoveFieldObjectInNextDirectionInSequence(struct npc_state *fieldObject, struct obj *object, u8 *directions) -MoveFieldObjectInNextDirectionInSequence: @ 809105C - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - mov r8, r1 - adds r7, r2, 0 - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x3 - bne _0809107E - ldr r1, [r4, 0xC] - ldr r0, [r4, 0x10] - cmp r1, r0 - bne _0809107E - movs r0, 0 - strb r0, [r2] -_0809107E: - adds r5, r4, 0 - adds r5, 0x21 - ldrb r0, [r5] - adds r0, r7, r0 - ldrb r1, [r0] - adds r0, r4, 0 - bl FieldObjectSetDirection - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl GetGoSpeed0AnimId - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r1, [r4, 0x18] - lsrs r1, 4 - adds r0, r4, 0 - bl sub_8092B88 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080910D8 - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - ldrb r0, [r5] - adds r0, r7, r0 - ldrb r1, [r0] - adds r0, r4, 0 - bl FieldObjectSetDirection - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl GetGoSpeed0AnimId - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r1, [r4, 0x18] - lsrs r1, 4 - adds r0, r4, 0 - bl sub_8092B88 - lsls r0, 24 - lsrs r0, 24 -_080910D8: - cmp r0, 0 - beq _080910EA - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetStepInPlaceDelay16AnimId - lsls r0, 24 - lsrs r6, r0, 24 -_080910EA: - adds r0, r4, 0 - mov r1, r8 - adds r2, r6, 0 - bl FieldObjectSetRegularAnim - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x2 - mov r1, r8 - strh r0, [r1, 0x30] - movs r0, 0x1 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end MoveFieldObjectInNextDirectionInSequence - - thumb_func_start sub_8091110 -@ bool8 sub_8091110(struct npc_state *fieldObject, struct obj *object) -sub_8091110: @ 8091110 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _0809112E - ldrb r0, [r4] - movs r1, 0x3 - negs r1, r1 - ands r1, r0 - strb r1, [r4] - movs r0, 0x1 - strh r0, [r5, 0x30] -_0809112E: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8091110 - - thumb_func_start FieldObjectCB_GoInDirectionSequence1 -FieldObjectCB_GoInDirectionSequence1: @ 8091138 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_809115C - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence1 - - thumb_func_start sub_809115C -sub_809115C: @ 809115C - push {r4,lr} - ldr r3, =gUnknown_0850D8DC - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809115C - - thumb_func_start sub_809117C -sub_809117C: @ 809117C - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D8E8 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _080911A8 - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _080911A8 - movs r0, 0x3 - strb r0, [r2] -_080911A8: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809117C - - thumb_func_start FieldObjectCB_GoInDirectionSequence2 -FieldObjectCB_GoInDirectionSequence2: @ 80911C4 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_80911E8 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence2 - - thumb_func_start sub_80911E8 -sub_80911E8: @ 80911E8 - push {r4,lr} - ldr r3, =gUnknown_0850D8EC - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80911E8 - - thumb_func_start sub_8091208 -sub_8091208: @ 8091208 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D8F8 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x1 - bne _08091234 - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091234 - movs r0, 0x2 - strb r0, [r2] -_08091234: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091208 - - thumb_func_start FieldObjectCB_GoInDirectionSequence3 -FieldObjectCB_GoInDirectionSequence3: @ 8091250 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091274 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence3 - - thumb_func_start sub_8091274 -sub_8091274: @ 8091274 - push {r4,lr} - ldr r3, =gUnknown_0850D8FC - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091274 - - thumb_func_start sub_8091294 -sub_8091294: @ 8091294 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D908 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x1 - bne _080912C0 - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _080912C0 - movs r0, 0x2 - strb r0, [r2] -_080912C0: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091294 - - thumb_func_start FieldObjectCB_GoInDirectionSequence4 -FieldObjectCB_GoInDirectionSequence4: @ 80912DC - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091300 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence4 - - thumb_func_start sub_8091300 -sub_8091300: @ 8091300 - push {r4,lr} - ldr r3, =gUnknown_0850D90C - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091300 - - thumb_func_start sub_8091320 -sub_8091320: @ 8091320 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D918 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _0809134C - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _0809134C - movs r0, 0x3 - strb r0, [r2] -_0809134C: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091320 - - thumb_func_start FieldObjectCB_GoInDirectionSequence5 -FieldObjectCB_GoInDirectionSequence5: @ 8091368 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_809138C - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence5 - - thumb_func_start sub_809138C -sub_809138C: @ 809138C - push {r4,lr} - ldr r3, =gUnknown_0850D91C - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809138C - - thumb_func_start sub_80913AC -@ bool8 sub_80913AC(struct npc_state *fieldObject, struct obj *object) -sub_80913AC: @ 80913AC - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D928 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _080913D8 - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _080913D8 - movs r0, 0x3 - strb r0, [r2] -_080913D8: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80913AC - - thumb_func_start FieldObjectCB_GoInDirectionSequence6 -FieldObjectCB_GoInDirectionSequence6: @ 80913F4 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091418 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence6 - - thumb_func_start sub_8091418 -sub_8091418: @ 8091418 - push {r4,lr} - ldr r3, =gUnknown_0850D92C - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091418 - - thumb_func_start sub_8091438 -sub_8091438: @ 8091438 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D938 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x1 - bne _08091464 - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091464 - movs r0, 0x2 - strb r0, [r2] -_08091464: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091438 - - thumb_func_start FieldObjectCB_GoInDirectionSequence7 -FieldObjectCB_GoInDirectionSequence7: @ 8091480 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_80914A4 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence7 - - thumb_func_start sub_80914A4 -sub_80914A4: @ 80914A4 - push {r4,lr} - ldr r3, =gUnknown_0850D93C - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80914A4 - - thumb_func_start sub_80914C4 -sub_80914C4: @ 80914C4 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D710 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x1 - bne _080914F0 - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _080914F0 - movs r0, 0x2 - strb r0, [r2] -_080914F0: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80914C4 - - thumb_func_start FieldObjectCB_GoInDirectionSequence8 -FieldObjectCB_GoInDirectionSequence8: @ 809150C - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091530 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence8 - - thumb_func_start sub_8091530 -sub_8091530: @ 8091530 - push {r4,lr} - ldr r3, =gUnknown_0850D948 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091530 - - thumb_func_start sub_8091550 -sub_8091550: @ 8091550 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D954 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _0809157C - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _0809157C - movs r0, 0x3 - strb r0, [r2] -_0809157C: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091550 - - thumb_func_start FieldObjectCB_GoInDirectionSequence9 -FieldObjectCB_GoInDirectionSequence9: @ 8091598 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_80915BC - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence9 - - thumb_func_start sub_80915BC -sub_80915BC: @ 80915BC - push {r4,lr} - ldr r3, =gUnknown_0850D958 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80915BC - - thumb_func_start sub_80915DC -sub_80915DC: @ 80915DC - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D964 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _08091608 - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091608 - movs r0, 0x3 - strb r0, [r2] -_08091608: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80915DC - - thumb_func_start FieldObjectCB_GoInDirectionSequence10 -FieldObjectCB_GoInDirectionSequence10: @ 8091624 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091648 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence10 - - thumb_func_start sub_8091648 -sub_8091648: @ 8091648 - push {r4,lr} - ldr r3, =gUnknown_0850D968 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091648 - - thumb_func_start sub_8091668 -sub_8091668: @ 8091668 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D974 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x1 - bne _08091694 - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091694 - movs r0, 0x2 - strb r0, [r2] -_08091694: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091668 - - thumb_func_start FieldObjectCB_GoInDirectionSequence11 -FieldObjectCB_GoInDirectionSequence11: @ 80916B0 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_80916D4 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence11 - - thumb_func_start sub_80916D4 -sub_80916D4: @ 80916D4 - push {r4,lr} - ldr r3, =gUnknown_0850D978 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80916D4 - - thumb_func_start sub_80916F4 -sub_80916F4: @ 80916F4 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D984 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x1 - bne _08091720 - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091720 - movs r0, 0x2 - strb r0, [r2] -_08091720: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80916F4 - - thumb_func_start FieldObjectCB_GoInDirectionSequence12 -FieldObjectCB_GoInDirectionSequence12: @ 809173C - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091760 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence12 - - thumb_func_start sub_8091760 -sub_8091760: @ 8091760 - push {r4,lr} - ldr r3, =gUnknown_0850D988 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091760 - - thumb_func_start sub_8091780 -sub_8091780: @ 8091780 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D994 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _080917AC - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _080917AC - movs r0, 0x3 - strb r0, [r2] -_080917AC: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091780 - - thumb_func_start FieldObjectCB_GoInDirectionSequence13 -FieldObjectCB_GoInDirectionSequence13: @ 80917C8 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_80917EC - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence13 - - thumb_func_start sub_80917EC -sub_80917EC: @ 80917EC - push {r4,lr} - ldr r3, =gUnknown_0850D998 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80917EC - - thumb_func_start sub_809180C -sub_809180C: @ 809180C - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D9A4 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _08091838 - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091838 - movs r0, 0x3 - strb r0, [r2] -_08091838: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809180C - - thumb_func_start FieldObjectCB_GoInDirectionSequence14 -FieldObjectCB_GoInDirectionSequence14: @ 8091854 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091878 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence14 - - thumb_func_start sub_8091878 -sub_8091878: @ 8091878 - push {r4,lr} - ldr r3, =gUnknown_0850D9A8 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091878 - - thumb_func_start sub_8091898 -sub_8091898: @ 8091898 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D9B4 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x1 - bne _080918C4 - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _080918C4 - movs r0, 0x2 - strb r0, [r2] -_080918C4: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091898 - - thumb_func_start FieldObjectCB_GoInDirectionSequence15 -FieldObjectCB_GoInDirectionSequence15: @ 80918E0 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091904 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence15 - - thumb_func_start sub_8091904 -sub_8091904: @ 8091904 - push {r4,lr} - ldr r3, =gUnknown_0850D9B8 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091904 - - thumb_func_start sub_8091924 -sub_8091924: @ 8091924 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D9C4 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x1 - bne _08091950 - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091950 - movs r0, 0x2 - strb r0, [r2] -_08091950: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091924 - - thumb_func_start FieldObjectCB_GoInDirectionSequence16 -FieldObjectCB_GoInDirectionSequence16: @ 809196C - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091990 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence16 - - thumb_func_start sub_8091990 -sub_8091990: @ 8091990 - push {r4,lr} - ldr r3, =gUnknown_0850D9C8 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091990 - - thumb_func_start sub_80919B0 -sub_80919B0: @ 80919B0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D9D4 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _080919DC - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _080919DC - movs r0, 0x3 - strb r0, [r2] -_080919DC: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80919B0 - - thumb_func_start FieldObjectCB_GoInDirectionSequence17 -FieldObjectCB_GoInDirectionSequence17: @ 80919F8 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091A1C - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence17 - - thumb_func_start sub_8091A1C -sub_8091A1C: @ 8091A1C - push {r4,lr} - ldr r3, =gUnknown_0850D9D8 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091A1C - - thumb_func_start sub_8091A3C -sub_8091A3C: @ 8091A3C - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D9E4 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _08091A68 - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091A68 - movs r0, 0x3 - strb r0, [r2] -_08091A68: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091A3C - - thumb_func_start FieldObjectCB_GoInDirectionSequence18 -FieldObjectCB_GoInDirectionSequence18: @ 8091A84 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091AA8 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence18 - - thumb_func_start sub_8091AA8 -sub_8091AA8: @ 8091AA8 - push {r4,lr} - ldr r3, =gUnknown_0850D9E8 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091AA8 - - thumb_func_start sub_8091AC8 -sub_8091AC8: @ 8091AC8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850D9F4 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _08091AF4 - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091AF4 - movs r0, 0x3 - strb r0, [r2] -_08091AF4: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091AC8 - - thumb_func_start FieldObjectCB_GoInDirectionSequence19 -FieldObjectCB_GoInDirectionSequence19: @ 8091B10 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091B34 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence19 - - thumb_func_start sub_8091B34 -sub_8091B34: @ 8091B34 - push {r4,lr} - ldr r3, =gUnknown_0850D9F8 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091B34 - - thumb_func_start sub_8091B54 -sub_8091B54: @ 8091B54 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850DA04 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _08091B80 - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091B80 - movs r0, 0x3 - strb r0, [r2] -_08091B80: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091B54 - - thumb_func_start FieldObjectCB_GoInDirectionSequence20 -FieldObjectCB_GoInDirectionSequence20: @ 8091B9C - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091BC0 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence20 - - thumb_func_start sub_8091BC0 -sub_8091BC0: @ 8091BC0 - push {r4,lr} - ldr r3, =gUnknown_0850DA08 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091BC0 - - thumb_func_start sub_8091BE0 -sub_8091BE0: @ 8091BE0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850DA14 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _08091C0C - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091C0C - movs r0, 0x3 - strb r0, [r2] -_08091C0C: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091BE0 - - thumb_func_start FieldObjectCB_GoInDirectionSequence21 -FieldObjectCB_GoInDirectionSequence21: @ 8091C28 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091C4C - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence21 - - thumb_func_start sub_8091C4C -sub_8091C4C: @ 8091C4C - push {r4,lr} - ldr r3, =gUnknown_0850DA18 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091C4C - - thumb_func_start sub_8091C6C -sub_8091C6C: @ 8091C6C - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850DA24 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _08091C98 - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091C98 - movs r0, 0x3 - strb r0, [r2] -_08091C98: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091C6C - - thumb_func_start FieldObjectCB_GoInDirectionSequence22 -FieldObjectCB_GoInDirectionSequence22: @ 8091CB4 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091CD8 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence22 - - thumb_func_start sub_8091CD8 -sub_8091CD8: @ 8091CD8 - push {r4,lr} - ldr r3, =gUnknown_0850DA28 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091CD8 - - thumb_func_start sub_8091CF8 -sub_8091CF8: @ 8091CF8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850DA34 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _08091D24 - movs r0, 0xE - ldrsh r1, [r4, r0] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091D24 - movs r0, 0x3 - strb r0, [r2] -_08091D24: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091CF8 - - thumb_func_start FieldObjectCB_GoInDirectionSequence23 -FieldObjectCB_GoInDirectionSequence23: @ 8091D40 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091D64 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence23 - - thumb_func_start sub_8091D64 -sub_8091D64: @ 8091D64 - push {r4,lr} - ldr r3, =gUnknown_0850DA38 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091D64 - - thumb_func_start sub_8091D84 -sub_8091D84: @ 8091D84 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850DA44 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _08091DB0 - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091DB0 - movs r0, 0x3 - strb r0, [r2] -_08091DB0: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091D84 - - thumb_func_start FieldObjectCB_GoInDirectionSequence24 -FieldObjectCB_GoInDirectionSequence24: @ 8091DCC - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091DF0 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_GoInDirectionSequence24 - - thumb_func_start sub_8091DF0 -sub_8091DF0: @ 8091DF0 - push {r4,lr} - ldr r3, =gUnknown_0850DA48 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091DF0 - - thumb_func_start sub_8091E10 -sub_8091E10: @ 8091E10 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850DA54 - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0x2 - bne _08091E3C - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _08091E3C - movs r0, 0x3 - strb r0, [r2] -_08091E3C: - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl MoveFieldObjectInNextDirectionInSequence - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091E10 - - thumb_func_start FieldObjectCB_CopyPlayer1 -FieldObjectCB_CopyPlayer1: @ 8091E58 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8091E7C - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_CopyPlayer1 - - thumb_func_start sub_8091E7C -sub_8091E7C: @ 8091E7C - push {r4,lr} - ldr r3, =gUnknown_0850DA58 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091E7C - - thumb_func_start mss_npc_reset_oampriv3_1_unk2_unk3 -@ bool8 mss_npc_reset_oampriv3_1_unk2_unk3(struct npc_state *fieldObject, struct obj *object) -mss_npc_reset_oampriv3_1_unk2_unk3: @ 8091E9C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl npc_reset - adds r4, 0x21 - ldrb r0, [r4] - cmp r0, 0 - bne _08091EB4 - bl player_get_direction_lower_nybble - strb r0, [r4] -_08091EB4: - movs r0, 0x1 - strh r0, [r5, 0x30] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end mss_npc_reset_oampriv3_1_unk2_unk3 - - thumb_func_start sub_8091EC0 -@ bool8 sub_8091EC0(struct npc_state *fieldObject, struct obj *object) -sub_8091EC0: @ 8091EC0 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - ldr r2, =0x02037350 - ldr r3, =0x02037590 - ldrb r1, [r3, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1C] - cmp r0, 0xFF - beq _08091EE0 - ldrb r0, [r3, 0x3] - cmp r0, 0x2 - bne _08091EEC -_08091EE0: - movs r0, 0 - b _08091F14 - .pool -_08091EEC: - ldr r5, =gUnknown_0850DA64 - bl player_get_x22 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 22 - adds r4, r5 - bl player_get_direction_upper_nybble - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r4, [r4] - adds r0, r6, 0 - adds r1, r7, 0 - movs r3, 0 - bl _call_via_r4 - lsls r0, 24 - lsrs r0, 24 -_08091F14: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091EC0 - - thumb_func_start sub_8091F20 -sub_8091F20: @ 8091F20 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _08091F3E - ldrb r0, [r4] - movs r1, 0x3 - negs r1, r1 - ands r1, r0 - strb r1, [r4] - movs r0, 0x1 - strh r0, [r5, 0x30] -_08091F3E: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8091F20 - - thumb_func_start sub_8091F48 -sub_8091F48: @ 8091F48 - movs r0, 0 - bx lr - thumb_func_end sub_8091F48 - - thumb_func_start sub_8091F4C -sub_8091F4C: @ 8091F4C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r1, =gUnknown_085055CD - ldrb r0, [r4, 0x6] - adds r0, r1 - ldrb r0, [r0] - adds r1, r4, 0 - adds r1, 0x21 - ldrb r1, [r1] - bl state_to_direction - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091F4C - - thumb_func_start sub_8091F94 -sub_8091F94: @ 8091F94 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - adds r7, r1, 0 - mov r8, r3 - lsls r2, 24 - lsrs r5, r2, 24 - adds r6, r5, 0 - bl FieldObjectIsFarawayIslandMew - lsls r0, 24 - cmp r0, 0 - beq _08091FFC - bl sub_81D427C - adds r5, r0, 0 - cmp r5, 0 - bne _08092012 - adds r5, r6, 0 - ldr r1, =gUnknown_085055CD - ldrb r0, [r4, 0x6] - adds r0, r1 - ldrb r0, [r0] - adds r1, r4, 0 - adds r1, 0x21 - ldrb r1, [r1] - adds r2, r5, 0 - bl state_to_direction - adds r5, r0, 0 - mov r3, sp - adds r3, 0x2 - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - bl FieldObjectMoveDestCoords - adds r0, r5, 0 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim - b _08092084 - .pool -_08091FFC: - ldr r1, =gUnknown_085055CD - ldrb r0, [r4, 0x6] - adds r0, r1 - ldrb r0, [r0] - adds r1, r4, 0 - adds r1, 0x21 - ldrb r1, [r1] - adds r2, r5, 0 - bl state_to_direction - adds r5, r0, 0 -_08092012: - mov r6, sp - adds r6, 0x2 - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - adds r3, r6, 0 - bl FieldObjectMoveDestCoords - adds r0, r5, 0 - bl GetGoSpeed0AnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0 - ldrsh r2, [r6, r0] - adds r0, r4, 0 - adds r3, r5, 0 - bl npc_block_way - lsls r0, 24 - cmp r0, 0 - bne _08092070 - mov r1, r8 - cmp r1, 0 - beq _08092084 - mov r0, sp - movs r2, 0 - ldrsh r0, [r0, r2] - movs r2, 0 - ldrsh r1, [r6, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r8 - lsls r0, 24 - cmp r0, 0 - bne _08092084 -_08092070: - adds r0, r5, 0 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim -_08092084: - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x2 - strh r0, [r7, 0x30] - movs r0, 0x1 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8091F94 - - thumb_func_start sub_80920A4 -sub_80920A4: @ 80920A4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - adds r7, r1, 0 - mov r8, r3 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r1, =gUnknown_085055CD - ldrb r0, [r4, 0x6] - adds r0, r1 - ldrb r0, [r0] - adds r1, r4, 0 - adds r1, 0x21 - ldrb r1, [r1] - adds r2, r6, 0 - bl state_to_direction - adds r6, r0, 0 - mov r5, sp - adds r5, 0x2 - adds r0, r4, 0 - adds r1, r6, 0 - mov r2, sp - adds r3, r5, 0 - bl FieldObjectMoveDestCoords - adds r0, r6, 0 - bl GetGoSpeed1AnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0 - ldrsh r2, [r5, r0] - adds r0, r4, 0 - adds r3, r6, 0 - bl npc_block_way - lsls r0, 24 - cmp r0, 0 - bne _0809212A - mov r1, r8 - cmp r1, 0 - beq _0809213E - mov r0, sp - movs r2, 0 - ldrsh r0, [r0, r2] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r8 - lsls r0, 24 - cmp r0, 0 - bne _0809213E -_0809212A: - adds r0, r6, 0 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim -_0809213E: - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x2 - strh r0, [r7, 0x30] - movs r0, 0x1 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80920A4 - - thumb_func_start sub_809215C -sub_809215C: @ 809215C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - adds r7, r1, 0 - mov r8, r3 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r1, =gUnknown_085055CD - ldrb r0, [r4, 0x6] - adds r0, r1 - ldrb r0, [r0] - adds r1, r4, 0 - adds r1, 0x21 - ldrb r1, [r1] - adds r2, r6, 0 - bl state_to_direction - adds r6, r0, 0 - mov r5, sp - adds r5, 0x2 - adds r0, r4, 0 - adds r1, r6, 0 - mov r2, sp - adds r3, r5, 0 - bl FieldObjectMoveDestCoords - adds r0, r6, 0 - bl GetGoSpeed3AnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0 - ldrsh r2, [r5, r0] - adds r0, r4, 0 - adds r3, r6, 0 - bl npc_block_way - lsls r0, 24 - cmp r0, 0 - bne _080921E2 - mov r1, r8 - cmp r1, 0 - beq _080921F6 - mov r0, sp - movs r2, 0 - ldrsh r0, [r0, r2] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r8 - lsls r0, 24 - cmp r0, 0 - bne _080921F6 -_080921E2: - adds r0, r6, 0 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim -_080921F6: - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x2 - strh r0, [r7, 0x30] - movs r0, 0x1 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809215C - - thumb_func_start sub_8092214 -sub_8092214: @ 8092214 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - adds r7, r1, 0 - mov r8, r3 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r1, =gUnknown_085055CD - ldrb r0, [r4, 0x6] - adds r0, r1 - ldrb r0, [r0] - adds r1, r4, 0 - adds r1, 0x21 - ldrb r1, [r1] - adds r2, r6, 0 - bl state_to_direction - adds r6, r0, 0 - mov r5, sp - adds r5, 0x2 - adds r0, r4, 0 - adds r1, r6, 0 - mov r2, sp - adds r3, r5, 0 - bl FieldObjectMoveDestCoords - adds r0, r6, 0 - bl sub_8093438 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0 - ldrsh r2, [r5, r0] - adds r0, r4, 0 - adds r3, r6, 0 - bl npc_block_way - lsls r0, 24 - cmp r0, 0 - bne _0809229A - mov r1, r8 - cmp r1, 0 - beq _080922AE - mov r0, sp - movs r2, 0 - ldrsh r0, [r0, r2] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r8 - lsls r0, 24 - cmp r0, 0 - bne _080922AE -_0809229A: - adds r0, r6, 0 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim -_080922AE: - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x2 - strh r0, [r7, 0x30] - movs r0, 0x1 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8092214 - - thumb_func_start cph_IM_DIFFERENT -cph_IM_DIFFERENT: @ 80922CC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r1, =gUnknown_085055CD - ldrb r0, [r4, 0x6] - adds r0, r1 - ldrb r0, [r0] - adds r1, r4, 0 - adds r1, 0x21 - ldrb r1, [r1] - bl state_to_direction - bl sub_80934BC - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x2 - strh r0, [r5, 0x30] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end cph_IM_DIFFERENT - - thumb_func_start sub_8092314 -sub_8092314: @ 8092314 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - adds r7, r1, 0 - mov r8, r3 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r1, =gUnknown_085055CD - ldrb r0, [r4, 0x6] - adds r0, r1 - ldrb r0, [r0] - adds r1, r4, 0 - adds r1, 0x21 - ldrb r1, [r1] - adds r2, r6, 0 - bl state_to_direction - adds r6, r0, 0 - mov r5, sp - adds r5, 0x2 - adds r0, r4, 0 - adds r1, r6, 0 - mov r2, sp - adds r3, r5, 0 - bl FieldObjectMoveDestCoords - adds r0, r6, 0 - bl sub_8093514 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0 - ldrsh r2, [r5, r0] - adds r0, r4, 0 - adds r3, r6, 0 - bl npc_block_way - lsls r0, 24 - cmp r0, 0 - bne _0809239A - mov r1, r8 - cmp r1, 0 - beq _080923AE - mov r0, sp - movs r2, 0 - ldrsh r0, [r0, r2] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r8 - lsls r0, 24 - cmp r0, 0 - bne _080923AE -_0809239A: - adds r0, r6, 0 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim -_080923AE: - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x2 - strh r0, [r7, 0x30] - movs r0, 0x1 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8092314 - - thumb_func_start oac_hopping -oac_hopping: @ 80923CC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r4, r0, 0 - adds r7, r1, 0 - mov r8, r3 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r1, =gUnknown_085055CD - ldrb r0, [r4, 0x6] - adds r0, r1 - ldrb r0, [r0] - adds r1, r4, 0 - adds r1, 0x21 - ldrb r1, [r1] - adds r2, r6, 0 - bl state_to_direction - adds r6, r0, 0 - ldrh r1, [r4, 0x10] - add r0, sp, 0x4 - strh r1, [r0] - ldrh r0, [r4, 0x12] - mov r5, sp - adds r5, 0x6 - strh r0, [r5] - movs r0, 0x2 - str r0, [sp] - adds r0, r6, 0 - add r1, sp, 0x4 - adds r2, r5, 0 - movs r3, 0x2 - bl sub_8092F88 - adds r0, r6, 0 - bl GetJumpLedgeAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim - add r0, sp, 0x4 - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0 - ldrsh r2, [r5, r0] - adds r0, r4, 0 - adds r3, r6, 0 - bl npc_block_way - lsls r0, 24 - cmp r0, 0 - bne _08092460 - mov r1, r8 - cmp r1, 0 - beq _08092474 - add r0, sp, 0x4 - movs r2, 0 - ldrsh r0, [r0, r2] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r8 - lsls r0, 24 - cmp r0, 0 - bne _08092474 -_08092460: - adds r0, r6, 0 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r7, 0 - bl FieldObjectSetRegularAnim -_08092474: - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x2 - strh r0, [r7, 0x30] - movs r0, 0x1 - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end oac_hopping - - thumb_func_start FieldObjectCB_CopyPlayer2 -FieldObjectCB_CopyPlayer2: @ 8092494 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_80924B8 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_CopyPlayer2 - - thumb_func_start sub_80924B8 -sub_80924B8: @ 80924B8 - push {r4,lr} - ldr r3, =gUnknown_0850DA90 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80924B8 - - thumb_func_start mss_08062EA4 -mss_08062EA4: @ 80924D8 - push {r4-r7,lr} - adds r6, r0, 0 - adds r7, r1, 0 - ldr r2, =0x02037350 - ldr r3, =0x02037590 - ldrb r1, [r3, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1C] - cmp r0, 0xFF - beq _080924F8 - ldrb r0, [r3, 0x3] - cmp r0, 0x2 - bne _08092504 -_080924F8: - movs r0, 0 - b _0809252C - .pool -_08092504: - ldr r5, =gUnknown_0850DA64 - bl player_get_x22 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 22 - adds r4, r5 - bl player_get_direction_upper_nybble - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r3, =sub_8088E64 - ldr r4, [r4] - adds r0, r6, 0 - adds r1, r7, 0 - bl _call_via_r4 - lsls r0, 24 - lsrs r0, 24 -_0809252C: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end mss_08062EA4 - - thumb_func_start FieldObjectCB_TreeDisguise -@ void FieldObjectCB_TreeDisguise(struct obj *object) -FieldObjectCB_TreeDisguise: @ 809253C - push {r4-r6,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02037350 - adds r4, r1, r0 - adds r6, r4, 0 - adds r6, 0x21 - ldrb r0, [r6] - cmp r0, 0 - beq _08092564 - cmp r0, 0x1 - bne _08092584 - movs r1, 0x3C - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _08092584 -_08092564: - ldr r1, =0x02038c08 - adds r2, r1, 0x4 - adds r3, r1, 0 - adds r3, 0x8 - adds r0, r4, 0 - bl FieldObjectGetLocalIdAndMap - movs r0, 0x1C - bl FieldEffectStart - strb r0, [r4, 0x1A] - movs r0, 0x1 - strb r0, [r6] - ldrh r0, [r5, 0x3C] - adds r0, 0x1 - strh r0, [r5, 0x3C] -_08092584: - movs r0, 0x2E - ldrsh r1, [r5, r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldr r2, =sub_80925AC - adds r1, r5, 0 - bl FieldObjectStep - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_TreeDisguise - - thumb_func_start sub_80925AC -sub_80925AC: @ 80925AC - push {lr} - bl npc_reset - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_80925AC - - thumb_func_start FieldObjectCB_MountainDisguise -FieldObjectCB_MountainDisguise: @ 80925B8 - push {r4-r6,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02037350 - adds r4, r1, r0 - adds r6, r4, 0 - adds r6, 0x21 - ldrb r0, [r6] - cmp r0, 0 - beq _080925E0 - cmp r0, 0x1 - bne _08092600 - movs r1, 0x3C - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _08092600 -_080925E0: - ldr r1, =0x02038c08 - adds r2, r1, 0x4 - adds r3, r1, 0 - adds r3, 0x8 - adds r0, r4, 0 - bl FieldObjectGetLocalIdAndMap - movs r0, 0x1D - bl FieldEffectStart - strb r0, [r4, 0x1A] - movs r0, 0x1 - strb r0, [r6] - ldrh r0, [r5, 0x3C] - adds r0, 0x1 - strh r0, [r5, 0x3C] -_08092600: - movs r0, 0x2E - ldrsh r1, [r5, r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldr r2, =sub_80925AC - adds r1, r5, 0 - bl FieldObjectStep - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_MountainDisguise - - thumb_func_start FieldObjectCB_Hidden1 -@ void FieldObjectCB_Hidden1(struct obj *object) -FieldObjectCB_Hidden1: @ 8092628 - push {r4,lr} - adds r3, r0, 0 - movs r1, 0x3C - ldrsh r0, [r3, r1] - ldr r4, =0x02037350 - cmp r0, 0 - bne _08092668 - movs r0, 0x2E - ldrsh r1, [r3, r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x3] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0, 0x3] - adds r2, r3, 0 - adds r2, 0x42 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldrb r0, [r3, 0x5] - movs r1, 0xC - orrs r0, r1 - strb r0, [r3, 0x5] - ldrh r0, [r3, 0x3C] - adds r0, 0x1 - strh r0, [r3, 0x3C] -_08092668: - movs r0, 0x2E - ldrsh r1, [r3, r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r2, =sub_809268C - adds r1, r3, 0 - bl FieldObjectStep - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_Hidden1 - - thumb_func_start sub_809268C -sub_809268C: @ 809268C - push {r4,lr} - ldr r3, =gUnknown_0850DA9C - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809268C - - thumb_func_start sub_80926AC -sub_80926AC: @ 80926AC - push {lr} - bl npc_reset - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_80926AC - - thumb_func_start sub_80926B8 -@ bool8 sub_80926B8(struct npc_state *fieldObject, struct obj *object) -sub_80926B8: @ 80926B8 - push {r4,lr} - adds r4, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - beq _080926CA - movs r0, 0 - strh r0, [r4, 0x30] -_080926CA: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80926B8 - - thumb_func_start FieldObjectCB_WalkInPlace1 -FieldObjectCB_WalkInPlace1: @ 80926D4 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_80926F8 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_WalkInPlace1 - - thumb_func_start sub_80926F8 -sub_80926F8: @ 80926F8 - push {r4,lr} - ldr r3, =gUnknown_0850DAA0 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80926F8 - - thumb_func_start sub_8092718 -sub_8092718: @ 8092718 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl npc_reset - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetStepInPlaceDelay16AnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x1 - strh r0, [r5, 0x30] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8092718 - - thumb_func_start FieldObjectCB_WalkInPlace4 -FieldObjectCB_WalkInPlace4: @ 8092744 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8092768 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_WalkInPlace4 - - thumb_func_start sub_8092768 -sub_8092768: @ 8092768 - push {r4,lr} - ldr r3, =gUnknown_0850DAA8 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8092768 - - thumb_func_start sub_8092788 -sub_8092788: @ 8092788 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl npc_reset - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetStepInPlaceDelay32AnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x1 - strh r0, [r5, 0x30] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8092788 - - thumb_func_start FieldObjectCB_WalkInPlace2 -FieldObjectCB_WalkInPlace2: @ 80927B4 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_80927D8 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_WalkInPlace2 - - thumb_func_start sub_80927D8 -sub_80927D8: @ 80927D8 - push {r4,lr} - ldr r3, =gUnknown_0850DAB0 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80927D8 - - thumb_func_start sub_80927F8 -@ bool8 sub_80927F8(struct npc_state *fieldObject, struct obj *object) -sub_80927F8: @ 80927F8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl npc_reset - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetStepInPlaceDelay8AnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x1 - strh r0, [r5, 0x30] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80927F8 - - thumb_func_start FieldObjectCB_WalkInPlace3 -FieldObjectCB_WalkInPlace3: @ 8092824 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_8092848 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_WalkInPlace3 - - thumb_func_start sub_8092848 -sub_8092848: @ 8092848 - push {r4,lr} - ldr r3, =gUnknown_0850DAB8 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8092848 - - thumb_func_start sub_8092868 -sub_8092868: @ 8092868 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl npc_reset - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetStepInPlaceDelay4AnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - movs r0, 0x1 - strh r0, [r5, 0x30] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8092868 - - thumb_func_start FieldObjectCB_Hidden2 -FieldObjectCB_Hidden2: @ 8092894 - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02037350 - adds r0, r2 - ldr r2, =sub_80928B8 - bl FieldObjectStep - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectCB_Hidden2 - - thumb_func_start sub_80928B8 -sub_80928B8: @ 80928B8 - push {r4,lr} - ldr r3, =gUnknown_0850DAC0 - movs r4, 0x30 - ldrsh r2, [r1, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80928B8 - - thumb_func_start sub_80928D8 -sub_80928D8: @ 80928D8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl npc_reset - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetRegularAnim - ldrb r0, [r4, 0x1] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r4, 0x1] - movs r0, 0x1 - strh r0, [r5, 0x30] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80928D8 - - thumb_func_start sub_809290C -sub_809290C: @ 809290C - push {r4,lr} - adds r4, r1, 0 - bl FieldObjectExecRegularAnim - lsls r0, 24 - cmp r0, 0 - bne _0809291E - movs r0, 0 - b _08092924 -_0809291E: - movs r0, 0x2 - strh r0, [r4, 0x30] - movs r0, 0x1 -_08092924: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_809290C - - thumb_func_start sub_809292C -sub_809292C: @ 809292C - ldrb r2, [r0] - movs r1, 0x3 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - movs r0, 0 - bx lr - thumb_func_end sub_809292C - - thumb_func_start npc_reset -@ void npc_reset(struct npc_state *fieldObject, struct obj *object) -npc_reset: @ 809293C - ldrb r3, [r0] - movs r2, 0x3 - negs r2, r2 - ands r2, r3 - movs r3, 0x41 - negs r3, r3 - ands r2, r3 - movs r3, 0x7F - ands r2, r3 - strb r2, [r0] - movs r2, 0xFF - strb r2, [r0, 0x1C] - movs r0, 0 - strh r0, [r1, 0x30] - bx lr - thumb_func_end npc_reset - - thumb_func_start FieldObjectDirectionToImageAnimId -@ u8 FieldObjectDirectionToImageAnimId(u8 direction) -FieldObjectDirectionToImageAnimId: @ 809295C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DACC - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end FieldObjectDirectionToImageAnimId - - thumb_func_start get_go_image_anim_num -get_go_image_anim_num: @ 809296C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DAD5 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end get_go_image_anim_num - - thumb_func_start get_go_fast_image_anim_num -get_go_fast_image_anim_num: @ 809297C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DADE - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end get_go_fast_image_anim_num - - thumb_func_start get_go_faster_image_anim_num -get_go_faster_image_anim_num: @ 809298C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DAE7 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end get_go_faster_image_anim_num - - thumb_func_start get_go_fastest_image_anim_num -get_go_fastest_image_anim_num: @ 809299C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DAF0 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end get_go_fastest_image_anim_num - - thumb_func_start sub_80929AC -sub_80929AC: @ 80929AC - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DAF9 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80929AC - - thumb_func_start sub_80929BC -sub_80929BC: @ 80929BC - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DB02 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80929BC - - thumb_func_start sub_80929CC -sub_80929CC: @ 80929CC - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DB0B - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80929CC - - thumb_func_start sub_80929DC -sub_80929DC: @ 80929DC - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DB14 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80929DC - - thumb_func_start sub_80929EC -sub_80929EC: @ 80929EC - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DB1D - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80929EC - - thumb_func_start sub_80929FC -sub_80929FC: @ 80929FC - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DB26 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80929FC - - thumb_func_start sub_8092A0C -sub_8092A0C: @ 8092A0C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DB2F - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8092A0C - - thumb_func_start sub_8092A1C -sub_8092A1C: @ 8092A1C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DB38 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8092A1C - - thumb_func_start sub_8092A2C -sub_8092A2C: @ 8092A2C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DB41 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8092A2C - - thumb_func_start get_run_image_anim_num -get_run_image_anim_num: @ 8092A3C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DB4A - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end get_run_image_anim_num - - thumb_func_start sub_8092A4C -sub_8092A4C: @ 8092A4C - push {lr} - adds r2, r0, 0 - ldr r1, =gUnknown_085094AC - b _08092A64 - .pool -_08092A58: - ldr r0, [r1] - cmp r0, r2 - bne _08092A62 - adds r0, r1, 0 - b _08092A6C -_08092A62: - adds r1, 0x8 -_08092A64: - ldr r0, [r1] - cmp r0, 0 - bne _08092A58 - movs r0, 0 -_08092A6C: - pop {r1} - bx r1 - thumb_func_end sub_8092A4C - - thumb_func_start npc_apply_anim_looping -@ void npc_apply_anim_looping(struct npc_state *fieldObject, struct obj *object, u8 anim) -npc_apply_anim_looping: @ 8092A70 - push {r4,lr} - adds r4, r1, 0 - lsls r2, 24 - lsrs r2, 24 - ldrb r0, [r0, 0x1] - lsls r0, 27 - cmp r0, 0 - blt _08092AB2 - adds r0, r4, 0 - adds r0, 0x2A - strb r2, [r0] - ldr r0, [r4, 0x8] - bl sub_8092A4C - adds r1, r4, 0 - adds r1, 0x2B - cmp r0, 0 - beq _08092AAA - ldrb r2, [r1] - ldrb r3, [r0, 0x4] - cmp r2, r3 - bne _08092AA0 - ldrb r0, [r0, 0x7] - b _08092AA8 -_08092AA0: - ldrb r3, [r0, 0x5] - cmp r2, r3 - bne _08092AAA - ldrb r0, [r0, 0x6] -_08092AA8: - strb r0, [r1] -_08092AAA: - ldrb r1, [r1] - adds r0, r4, 0 - bl SeekObjectImageAnim -_08092AB2: - pop {r4} - pop {r0} - bx r0 - thumb_func_end npc_apply_anim_looping - - thumb_func_start obj_npc_animation_step -@ void obj_npc_animation_step(struct npc_state *fieldObject, struct obj *object, u8 anim) -obj_npc_animation_step: @ 8092AB8 - push {r4,lr} - adds r4, r1, 0 - lsls r2, 24 - lsrs r2, 24 - ldrb r0, [r0, 0x1] - lsls r0, 27 - cmp r0, 0 - blt _08092AF0 - adds r0, r4, 0 - adds r0, 0x2A - strb r2, [r0] - ldr r0, [r4, 0x8] - bl sub_8092A4C - adds r2, r0, 0 - cmp r2, 0 - beq _08092AF0 - ldrb r1, [r2, 0x5] - adds r0, r4, 0 - adds r0, 0x2B - ldrb r0, [r0] - ldrb r3, [r2, 0x4] - cmp r0, r3 - bhi _08092AEA - ldrb r1, [r2, 0x4] -_08092AEA: - adds r0, r4, 0 - bl SeekObjectImageAnim -_08092AF0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end obj_npc_animation_step - - thumb_func_start sub_8092AF8 -sub_8092AF8: @ 8092AF8 - push {lr} - lsls r1, 16 - lsrs r1, 16 - lsls r3, 16 - lsrs r3, 16 - lsls r0, 16 - asrs r0, 16 - lsls r2, 16 - asrs r2, 16 - cmp r0, r2 - ble _08092B12 - movs r0, 0x3 - b _08092B28 -_08092B12: - cmp r0, r2 - bge _08092B1A - movs r0, 0x4 - b _08092B28 -_08092B1A: - lsls r1, 16 - lsls r0, r3, 16 - cmp r1, r0 - bgt _08092B26 - movs r0, 0x1 - b _08092B28 -_08092B26: - movs r0, 0x2 -_08092B28: - pop {r1} - bx r1 - thumb_func_end sub_8092AF8 - - thumb_func_start npc_set_running_behaviour_etc -npc_set_running_behaviour_etc: @ 8092B2C - push {r4,lr} - mov r12, r0 - lsls r1, 24 - lsrs r1, 24 - movs r3, 0 - strb r1, [r0, 0x6] - adds r0, 0x21 - strb r3, [r0] - adds r0, 0x1 - strb r3, [r0] - ldr r4, =0x02020630 - mov r0, r12 - ldrb r2, [r0, 0x4] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r2, r4, 0 - adds r2, 0x1C - adds r0, r2 - ldr r2, =gUnknown_08505438 - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - str r1, [r0] - mov r0, r12 - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r3, [r0, 0x30] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end npc_set_running_behaviour_etc - - thumb_func_start npc_running_behaviour_by_direction -npc_running_behaviour_by_direction: @ 8092B78 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850DB53 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end npc_running_behaviour_by_direction - - thumb_func_start sub_8092B88 -sub_8092B88: @ 8092B88 - push {r4-r6,lr} - sub sp, 0x4 - adds r6, r0, 0 - lsls r5, r1, 24 - lsrs r5, 24 - ldrh r1, [r6, 0x10] - mov r0, sp - strh r1, [r0] - ldrh r0, [r6, 0x12] - mov r4, sp - adds r4, 0x2 - strh r0, [r4] - adds r0, r5, 0 - mov r1, sp - adds r2, r4, 0 - bl MoveCoords - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0 - ldrsh r2, [r4, r0] - adds r0, r6, 0 - adds r3, r5, 0 - bl npc_block_way - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8092B88 - - thumb_func_start npc_block_way -@ u8 npc_block_way(struct npc_state *fieldObject, u16 x, u16 y, u8 direction) -npc_block_way: @ 8092BC8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r6, r0, 0 - lsls r1, 16 - lsls r2, 16 - lsls r3, 24 - lsrs r7, r3, 24 - mov r8, r7 - lsrs r0, r1, 16 - mov r9, r0 - asrs r5, r1, 16 - lsrs r0, r2, 16 - mov r10, r0 - asrs r4, r2, 16 - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl IsCoordOutsideFieldObjectMovementRect - lsls r0, 24 - cmp r0, 0 - beq _08092BFE - movs r0, 0x1 - b _08092C7E -_08092BFE: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridIsImpassableAt - lsls r0, 24 - cmp r0, 0 - bne _08092C40 - adds r0, r5, 0 - adds r1, r4, 0 - bl GetMapBorderIdAt - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _08092C40 - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - adds r3, r7, 0 - bl IsMetatileDirectionallyImpassable - lsls r0, 24 - cmp r0, 0 - bne _08092C40 - ldrb r0, [r6, 0x1] - lsrs r0, 7 - cmp r0, 0 - beq _08092C44 - mov r0, r8 - bl CanCameraMoveInDirection - cmp r0, 0 - bne _08092C44 -_08092C40: - movs r0, 0x2 - b _08092C7E -_08092C44: - ldrb r0, [r6, 0xB] - lsls r0, 28 - lsrs r0, 28 - mov r2, r9 - lsls r1, r2, 16 - asrs r5, r1, 16 - mov r2, r10 - lsls r1, r2, 16 - asrs r4, r1, 16 - adds r1, r5, 0 - adds r2, r4, 0 - bl IsZCoordMismatchAt - lsls r0, 24 - cmp r0, 0 - beq _08092C68 - movs r0, 0x3 - b _08092C7E -_08092C68: - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl CheckForCollisionBetweenFieldObjects - lsls r0, 24 - cmp r0, 0 - bne _08092C7C - movs r0, 0 - b _08092C7E -_08092C7C: - movs r0, 0x4 -_08092C7E: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end npc_block_way - - thumb_func_start sub_8092C8C -sub_8092C8C: @ 8092C8C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r7, r0, 0 - lsls r1, 16 - lsls r2, 16 - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - lsrs r0, r1, 16 - mov r9, r0 - asrs r6, r1, 16 - lsrs r0, r2, 16 - mov r10, r0 - asrs r5, r2, 16 - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - bl IsCoordOutsideFieldObjectMovementRect - lsls r0, 24 - lsrs r0, 24 - negs r1, r0 - orrs r1, r0 - lsrs r4, r1, 31 - adds r0, r6, 0 - adds r1, r5, 0 - bl MapGridIsImpassableAt - lsls r0, 24 - cmp r0, 0 - bne _08092D04 - adds r0, r6, 0 - adds r1, r5, 0 - bl GetMapBorderIdAt - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _08092D04 - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - mov r3, r8 - bl IsMetatileDirectionallyImpassable - lsls r0, 24 - cmp r0, 0 - bne _08092D04 - ldrb r0, [r7, 0x1] - lsrs r0, 7 - cmp r0, 0 - beq _08092D08 - mov r0, r8 - bl CanCameraMoveInDirection - cmp r0, 0 - bne _08092D08 -_08092D04: - movs r0, 0x2 - orrs r4, r0 -_08092D08: - ldrb r0, [r7, 0xB] - lsls r0, 28 - lsrs r0, 28 - mov r2, r9 - lsls r1, r2, 16 - asrs r6, r1, 16 - mov r2, r10 - lsls r1, r2, 16 - asrs r5, r1, 16 - adds r1, r6, 0 - adds r2, r5, 0 - bl IsZCoordMismatchAt - lsls r0, 24 - cmp r0, 0 - beq _08092D30 - movs r0, 0x4 - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_08092D30: - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - bl CheckForCollisionBetweenFieldObjects - lsls r0, 24 - cmp r0, 0 - beq _08092D48 - movs r0, 0x8 - orrs r4, r0 - lsls r0, r4, 24 - lsrs r4, r0, 24 -_08092D48: - 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_8092C8C - - thumb_func_start IsCoordOutsideFieldObjectMovementRect -@ bool8 IsCoordOutsideFieldObjectMovementRect(struct npc_state *fieldObject, u16 x, u16 y) -IsCoordOutsideFieldObjectMovementRect: @ 8092D58 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r3, r1, 16 - lsls r2, 16 - lsrs r5, r2, 16 - ldrb r1, [r4, 0x19] - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - beq _08092D90 - lsls r1, 28 - lsrs r2, r1, 28 - ldrh r0, [r4, 0xC] - subs r2, r0, r2 - lsrs r1, 28 - adds r0, r1 - lsls r0, 16 - lsrs r1, r0, 16 - lsls r2, 16 - lsls r0, r3, 16 - asrs r3, r0, 16 - cmp r2, r0 - bgt _08092DBC - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, r3 - blt _08092DBC -_08092D90: - ldrb r1, [r4, 0x19] - movs r0, 0xF0 - ands r0, r1 - cmp r0, 0 - beq _08092DC0 - lsls r1, 24 - lsrs r2, r1, 28 - ldrh r0, [r4, 0xE] - subs r2, r0, r2 - lsrs r1, 28 - adds r0, r1 - lsls r0, 16 - lsrs r1, r0, 16 - lsls r2, 16 - lsls r0, r5, 16 - asrs r3, r0, 16 - cmp r2, r0 - bgt _08092DBC - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, r3 - bge _08092DC0 -_08092DBC: - movs r0, 0x1 - b _08092DC2 -_08092DC0: - movs r0, 0 -_08092DC2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end IsCoordOutsideFieldObjectMovementRect - - thumb_func_start IsMetatileDirectionallyImpassable -@ bool8 IsMetatileDirectionallyImpassable(struct npc_state *fieldObject, u16 x, u16 y, u8 direction) -IsMetatileDirectionallyImpassable: @ 8092DC8 - push {r4-r7,lr} - lsls r1, 16 - lsrs r6, r1, 16 - lsls r2, 16 - lsrs r7, r2, 16 - lsls r3, 24 - ldr r1, =gUnknown_0850DB5C - lsrs r3, 22 - subs r5, r3, 0x4 - adds r1, r5, r1 - ldrb r0, [r0, 0x1E] - ldr r1, [r1] - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - bne _08092E0A - ldr r4, =gUnknown_0850DB6C - adds r4, r5, r4 - lsls r0, r6, 16 - asrs r0, 16 - lsls r1, r7, 16 - asrs r1, 16 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - ldr r1, [r4] - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - beq _08092E18 -_08092E0A: - movs r0, 0x1 - b _08092E1A - .pool -_08092E18: - movs r0, 0 -_08092E1A: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end IsMetatileDirectionallyImpassable - - thumb_func_start CheckForCollisionBetweenFieldObjects -@ bool8 CheckForCollisionBetweenFieldObjects(struct npc_state *fieldObject, u16 x, u16 y) -CheckForCollisionBetweenFieldObjects: @ 8092E20 - push {r4-r7,lr} - adds r6, r0, 0 - lsls r1, 16 - lsrs r7, r1, 16 - movs r4, 0 - lsls r2, 16 - asrs r5, r2, 16 -_08092E2E: - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - ldr r1, =0x02037350 - adds r2, r0, r1 - ldrb r0, [r2] - lsls r0, 31 - cmp r0, 0 - beq _08092E88 - cmp r2, r6 - beq _08092E88 - movs r0, 0x10 - ldrsh r1, [r2, r0] - lsls r0, r7, 16 - asrs r3, r0, 16 - cmp r1, r3 - bne _08092E58 - movs r1, 0x12 - ldrsh r0, [r2, r1] - cmp r0, r5 - beq _08092E68 -_08092E58: - movs r1, 0x14 - ldrsh r0, [r2, r1] - cmp r0, r3 - bne _08092E88 - movs r1, 0x16 - ldrsh r0, [r2, r1] - cmp r0, r5 - bne _08092E88 -_08092E68: - ldrb r0, [r6, 0xB] - lsls r0, 28 - lsrs r0, 28 - ldrb r1, [r2, 0xB] - lsls r1, 28 - lsrs r1, 28 - bl AreZCoordsCompatible - lsls r0, 24 - cmp r0, 0 - beq _08092E88 - movs r0, 0x1 - b _08092E94 - .pool -_08092E88: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _08092E2E - movs r0, 0 -_08092E94: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end CheckForCollisionBetweenFieldObjects - - thumb_func_start sub_8092E9C -sub_8092E9C: @ 8092E9C - push {lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _08092EE8 - ldr r3, =0x02020630 - ldr r2, =0x02037350 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x3C] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08092EE8 - movs r0, 0x1 - b _08092EEA - .pool -_08092EE8: - movs r0, 0 -_08092EEA: - add sp, 0x4 - pop {r1} - bx r1 - thumb_func_end sub_8092E9C - - thumb_func_start sub_8092EF0 -sub_8092EF0: @ 8092EF0 - push {lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _08092F2E - ldr r3, =0x02020630 - ldr r2, =0x02037350 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r2, [r1, 0x3C] - movs r0, 0x4 - orrs r0, r2 - strh r0, [r1, 0x3C] -_08092F2E: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8092EF0 - - thumb_func_start MoveCoords -@ void MoveCoords(u8 direction, u16 *x, u16 *y) -MoveCoords: @ 8092F3C - push {r4,lr} - lsls r0, 24 - ldr r3, =gUnknown_0850DB7C - lsrs r0, 22 - adds r0, r3 - ldrh r3, [r0] - ldrh r4, [r1] - adds r3, r4 - strh r3, [r1] - ldrh r0, [r0, 0x2] - ldrh r1, [r2] - adds r0, r1 - strh r0, [r2] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end MoveCoords - - thumb_func_start sub_8092F60 -sub_8092F60: @ 8092F60 - push {r4,lr} - lsls r0, 24 - ldr r3, =gUnknown_0850DB7C - lsrs r0, 22 - adds r0, r3 - ldrh r3, [r0] - lsls r3, 4 - ldrh r4, [r1] - adds r3, r4 - strh r3, [r1] - ldrh r0, [r0, 0x2] - lsls r0, 4 - ldrh r1, [r2] - adds r0, r1 - strh r0, [r2] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8092F60 - - thumb_func_start sub_8092F88 -sub_8092F88: @ 8092F88 - push {r4-r7,lr} - adds r4, r1, 0 - ldr r1, [sp, 0x14] - lsls r0, 24 - lsls r3, 16 - lsrs r3, 16 - adds r7, r3, 0 - lsls r1, 16 - lsrs r6, r1, 16 - mov r12, r6 - ldr r1, =gUnknown_0850DB7C - lsrs r0, 22 - adds r5, r0, r1 - movs r0, 0 - ldrsh r1, [r5, r0] - cmp r1, 0 - ble _08092FB4 - lsls r0, r3, 16 - asrs r0, 16 - ldrh r3, [r4] - adds r0, r3 - strh r0, [r4] -_08092FB4: - cmp r1, 0 - bge _08092FC2 - ldrh r1, [r4] - lsls r0, r7, 16 - asrs r0, 16 - subs r1, r0 - strh r1, [r4] -_08092FC2: - movs r0, 0x2 - ldrsh r1, [r5, r0] - cmp r1, 0 - ble _08092FD4 - lsls r0, r6, 16 - asrs r0, 16 - ldrh r3, [r2] - adds r0, r3 - strh r0, [r2] -_08092FD4: - cmp r1, 0 - bge _08092FE4 - ldrh r1, [r2] - mov r3, r12 - lsls r0, r3, 16 - asrs r0, 16 - subs r1, r0 - strh r1, [r2] -_08092FE4: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8092F88 - - thumb_func_start sub_8092FF0 -sub_8092FF0: @ 8092FF0 - push {r4,r5,lr} - ldr r5, =0x03005d8c - ldr r4, [r5] - ldrh r4, [r4] - lsls r0, 16 - asrs r0, 16 - subs r0, r4 - lsls r0, 4 - strh r0, [r2] - ldr r0, [r5] - ldrh r0, [r0, 0x2] - lsls r1, 16 - asrs r1, 16 - subs r1, r0 - lsls r1, 4 - strh r1, [r3] - ldr r1, =0x03005dec - ldrh r0, [r2] - ldrh r1, [r1] - subs r0, r1 - strh r0, [r2] - ldr r1, =0x03005de8 - ldrh r0, [r3] - ldrh r1, [r1] - subs r0, r1 - strh r0, [r3] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8092FF0 - - thumb_func_start sub_8093038 -sub_8093038: @ 8093038 - push {r4-r7,lr} - adds r7, r2, 0 - mov r12, r3 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 16 - lsrs r6, r1, 16 - ldr r0, =0x03005dec - ldrh r0, [r0] - negs r0, r0 - ldr r1, =0x03005dd0 - ldr r2, [r1, 0x10] - subs r0, r2 - lsls r0, 16 - lsrs r3, r0, 16 - ldr r0, =0x03005de8 - ldrh r0, [r0] - negs r0, r0 - ldr r1, [r1, 0x14] - subs r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r2, 0 - ble _08093072 - lsls r0, r3, 16 - movs r3, 0x80 - lsls r3, 13 - adds r0, r3 - lsrs r3, r0, 16 -_08093072: - cmp r2, 0 - bge _0809307E - lsls r0, r3, 16 - ldr r2, =0xfff00000 - adds r0, r2 - lsrs r3, r0, 16 -_0809307E: - cmp r1, 0 - ble _0809308C - lsls r0, r4, 16 - movs r2, 0x80 - lsls r2, 13 - adds r0, r2 - lsrs r4, r0, 16 -_0809308C: - cmp r1, 0 - bge _08093098 - lsls r0, r4, 16 - ldr r1, =0xfff00000 - adds r0, r1 - lsrs r4, r0, 16 -_08093098: - ldr r2, =0x03005d8c - ldr r0, [r2] - ldrh r1, [r0] - lsls r0, r5, 16 - asrs r0, 16 - subs r0, r1 - lsls r0, 4 - lsls r1, r3, 16 - asrs r1, 16 - adds r1, r0 - strh r1, [r7] - ldr r0, [r2] - ldrh r1, [r0, 0x2] - lsls r0, r6, 16 - asrs r0, 16 - subs r0, r1 - lsls r0, 4 - lsls r1, r4, 16 - asrs r1, 16 - adds r1, r0 - mov r2, r12 - strh r1, [r2] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8093038 - - thumb_func_start sub_80930E0 -sub_80930E0: @ 80930E0 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r6, r0, 0 - mov r8, r1 - adds r4, r2, 0 - adds r5, r3, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - movs r1, 0 - ldrsh r0, [r6, r1] - mov r2, r8 - movs r3, 0 - ldrsh r1, [r2, r3] - adds r2, r6, 0 - mov r3, r8 - bl sub_8093038 - lsls r4, 16 - asrs r4, 16 - ldrh r0, [r6] - adds r4, r0 - strh r4, [r6] - lsls r5, 16 - asrs r5, 16 - mov r1, r8 - ldrh r1, [r1] - adds r5, r1 - mov r2, r8 - strh r5, [r2] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80930E0 - - thumb_func_start GetFieldObjectMovingCameraOffset -@ void GetFieldObjectMovingCameraOffset(s16 *x, s16 *y) -GetFieldObjectMovingCameraOffset: @ 809312C - push {lr} - adds r2, r0, 0 - movs r0, 0 - strh r0, [r2] - strh r0, [r1] - ldr r3, =0x03005dd0 - ldr r0, [r3, 0x10] - cmp r0, 0 - ble _08093142 - movs r0, 0x1 - strh r0, [r2] -_08093142: - ldr r0, [r3, 0x10] - cmp r0, 0 - bge _0809314E - ldrh r0, [r2] - subs r0, 0x1 - strh r0, [r2] -_0809314E: - ldr r2, [r3, 0x14] - cmp r2, 0 - ble _0809315A - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0809315A: - cmp r2, 0 - bge _08093164 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] -_08093164: - pop {r0} - bx r0 - .pool - thumb_func_end GetFieldObjectMovingCameraOffset - - thumb_func_start FieldObjectMoveDestCoords -@ void FieldObjectMoveDestCoords(struct npc_state *fieldObject, u8 direction) -FieldObjectMoveDestCoords: @ 809316C - push {r4,lr} - lsls r1, 24 - lsrs r1, 24 - ldrh r4, [r0, 0x10] - strh r4, [r2] - ldrh r0, [r0, 0x12] - strh r0, [r3] - adds r0, r1, 0 - adds r1, r2, 0 - adds r2, r3, 0 - bl MoveCoords - pop {r4} - pop {r0} - bx r0 - thumb_func_end FieldObjectMoveDestCoords - - thumb_func_start FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive -@ bool8 FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive(struct npc_state *fieldObject) -FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive: @ 809318C - push {lr} - ldrb r1, [r0] - movs r0, 0x42 - ands r0, r1 - cmp r0, 0 - bne _0809319C - movs r0, 0 - b _0809319E -_0809319C: - movs r0, 0x1 -_0809319E: - pop {r1} - bx r1 - thumb_func_end FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - - thumb_func_start FieldObjectIsSpecialAnimActive -@ bool8 FieldObjectIsSpecialAnimActive(struct npc_state *fieldObject) -FieldObjectIsSpecialAnimActive: @ 80931A4 - push {lr} - adds r1, r0, 0 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - bge _080931BA - ldrb r0, [r1, 0x1C] - cmp r0, 0xFF - beq _080931BA - movs r0, 0x1 - b _080931BC -_080931BA: - movs r0, 0 -_080931BC: - pop {r1} - bx r1 - thumb_func_end FieldObjectIsSpecialAnimActive - - thumb_func_start FieldObjectSetSpecialAnim -@ bool8 FieldObjectSetSpecialAnim(struct npc_state *fieldObject, u8 animId) -FieldObjectSetSpecialAnim: @ 80931C0 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _08093200 - adds r0, r4, 0 - bl npc_sync_anim_pause_bits - strb r5, [r4, 0x1C] - ldrb r0, [r4] - movs r1, 0x40 - orrs r0, r1 - movs r1, 0x7F - ands r0, r1 - strb r0, [r4] - ldr r2, =0x02020630 - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r6, [r0, 0x32] - movs r0, 0 - b _08093202 - .pool -_08093200: - movs r0, 0x1 -_08093202: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end FieldObjectSetSpecialAnim - - thumb_func_start FieldObjectForceSetSpecialAnim -@ void FieldObjectForceSetSpecialAnim(struct npc_state *fieldObject, u8 animId) -FieldObjectForceSetSpecialAnim: @ 8093208 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r4, r1, 24 - lsrs r4, 24 - bl FieldObjectClearAnimIfSpecialAnimActive - adds r0, r5, 0 - adds r1, r4, 0 - bl FieldObjectSetSpecialAnim - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end FieldObjectForceSetSpecialAnim - - thumb_func_start FieldObjectClearAnimIfSpecialAnimActive -@ void FieldObjectClearAnimIfSpecialAnimActive(struct npc_state *fieldObject) -FieldObjectClearAnimIfSpecialAnimActive: @ 8093224 - push {lr} - adds r1, r0, 0 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - bge _08093236 - adds r0, r1, 0 - bl FieldObjectClearAnim -_08093236: - pop {r0} - bx r0 - thumb_func_end FieldObjectClearAnimIfSpecialAnimActive - - thumb_func_start FieldObjectClearAnim -@ void FieldObjectClearAnim(struct npc_state *fieldObject) -FieldObjectClearAnim: @ 809323C - movs r1, 0xFF - strb r1, [r0, 0x1C] - ldrb r2, [r0] - movs r1, 0x41 - negs r1, r1 - ands r1, r2 - movs r2, 0x7F - ands r1, r2 - strb r1, [r0] - ldr r3, =0x02020630 - ldrb r2, [r0, 0x4] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - movs r2, 0 - strh r2, [r1, 0x30] - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r2, [r0, 0x32] - bx lr - .pool - thumb_func_end FieldObjectClearAnim - - thumb_func_start FieldObjectCheckIfSpecialAnimFinishedOrInactive -@ u8 FieldObjectCheckIfSpecialAnimFinishedOrInactive(struct npc_state *fieldObject) -FieldObjectCheckIfSpecialAnimFinishedOrInactive: @ 8093270 - push {lr} - ldrb r1, [r0] - lsls r0, r1, 25 - cmp r0, 0 - blt _0809327E - movs r0, 0x10 - b _08093280 -_0809327E: - lsrs r0, r1, 7 -_08093280: - pop {r1} - bx r1 - thumb_func_end FieldObjectCheckIfSpecialAnimFinishedOrInactive - - thumb_func_start FieldObjectClearAnimIfSpecialAnimFinished -@ u8 FieldObjectClearAnimIfSpecialAnimFinished(struct npc_state *fieldObject) -FieldObjectClearAnimIfSpecialAnimFinished: @ 8093284 - push {r4,r5,lr} - adds r5, r0, 0 - bl FieldObjectCheckIfSpecialAnimFinishedOrInactive - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0809329E - cmp r4, 0x10 - beq _0809329E - adds r0, r5, 0 - bl FieldObjectClearAnimIfSpecialAnimActive -_0809329E: - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end FieldObjectClearAnimIfSpecialAnimFinished - - thumb_func_start FieldObjectGetSpecialAnim -@ u8 FieldObjectGetSpecialAnim(struct npc_state *fieldObject) -FieldObjectGetSpecialAnim: @ 80932A8 - push {lr} - adds r1, r0, 0 - ldrb r0, [r1] - lsls r0, 25 - cmp r0, 0 - blt _080932B8 - movs r0, 0xFF - b _080932BA -_080932B8: - ldrb r0, [r1, 0x1C] -_080932BA: - pop {r1} - bx r1 - thumb_func_end FieldObjectGetSpecialAnim - - thumb_func_start FieldObjectStep -@ void FieldObjectStep(struct npc_state *fieldObject, struct obj *object, bool8 ( *callback)(struct npc_state *fieldObject, struct obj *object)) -FieldObjectStep: @ 80932C0 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - bl DoGroundEffects_OnSpawn - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80964E8 - adds r0, r4, 0 - bl FieldObjectIsSpecialAnimActive - lsls r0, 24 - cmp r0, 0 - beq _080932EA - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectExecSpecialAnim - b _08093300 -_080932EA: - ldrb r0, [r4, 0x1] - lsls r0, 31 - cmp r0, 0 - bne _08093300 -_080932F2: - adds r0, r4, 0 - adds r1, r5, 0 - bl _call_via_r6 - lsls r0, 24 - cmp r0, 0 - bne _080932F2 -_08093300: - adds r0, r4, 0 - adds r1, r5, 0 - bl DoGroundEffects_OnBeginStep - adds r0, r4, 0 - adds r1, r5, 0 - bl DoGroundEffects_OnFinishStep - adds r0, r4, 0 - adds r1, r5, 0 - bl npc_obj_transfer_image_anim_pause_flag - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8096518 - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectUpdateSubpriority - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end FieldObjectStep - - thumb_func_start GetFaceDirectionAnimId -@ u8 GetFaceDirectionAnimId(u8 direction) -GetFaceDirectionAnimId: @ 8093330 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBA0 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093348 - movs r4, 0 -_08093348: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetFaceDirectionAnimId - - thumb_func_start GetSimpleGoAnimId -@ u8 GetSimpleGoAnimId(u8 direction) -GetSimpleGoAnimId: @ 809335C - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBA5 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093374 - movs r4, 0 -_08093374: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetSimpleGoAnimId - - thumb_func_start GetGoSpeed0AnimId -@ u8 GetGoSpeed0AnimId(u8 direction) -GetGoSpeed0AnimId: @ 8093388 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBAA - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _080933A0 - movs r4, 0 -_080933A0: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetGoSpeed0AnimId - - thumb_func_start GetGoSpeed1AnimId -@ u8 GetGoSpeed1AnimId(u8 direction) -GetGoSpeed1AnimId: @ 80933B4 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBAF - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _080933CC - movs r4, 0 -_080933CC: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetGoSpeed1AnimId - - thumb_func_start GetGoSpeed2AnimId -@ u8 GetGoSpeed2AnimId(u8 direction) -GetGoSpeed2AnimId: @ 80933E0 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBB4 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _080933F8 - movs r4, 0 -_080933F8: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetGoSpeed2AnimId - - thumb_func_start GetGoSpeed3AnimId -@ u8 GetGoSpeed3AnimId(u8 direction) -GetGoSpeed3AnimId: @ 809340C - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBB9 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093424 - movs r4, 0 -_08093424: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetGoSpeed3AnimId - - thumb_func_start sub_8093438 -@ u8 sub_8093438(u8 direction) -sub_8093438: @ 8093438 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBBE - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093450 - movs r4, 0 -_08093450: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8093438 - - thumb_func_start GetRunAnimId -@ u8 GetRunAnimId(u8 direction) -GetRunAnimId: @ 8093464 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBC3 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _0809347C - movs r4, 0 -_0809347C: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetRunAnimId - - thumb_func_start GetJumpLedgeAnimId -@ u8 GetJumpLedgeAnimId(u8 direction) -GetJumpLedgeAnimId: @ 8093490 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBC8 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _080934A8 - movs r4, 0 -_080934A8: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetJumpLedgeAnimId - - thumb_func_start sub_80934BC -@ u8 sub_80934BC(u8 direction) -sub_80934BC: @ 80934BC - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBCD - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _080934D4 - movs r4, 0 -_080934D4: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80934BC - - thumb_func_start sub_80934E8 -@ u8 sub_80934E8(u8 direction) -sub_80934E8: @ 80934E8 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBD2 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093500 - movs r4, 0 -_08093500: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80934E8 - - thumb_func_start sub_8093514 -@ u8 sub_8093514(u8 direction) -sub_8093514: @ 8093514 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBD7 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _0809352C - movs r4, 0 -_0809352C: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8093514 - - thumb_func_start sub_8093540 -@ u8 sub_8093540(u8 direction) -sub_8093540: @ 8093540 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBDC - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093558 - movs r4, 0 -_08093558: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8093540 - - thumb_func_start GetStepInPlaceDelay32AnimId -@ u8 GetStepInPlaceDelay32AnimId(u8 direction) -GetStepInPlaceDelay32AnimId: @ 809356C - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBE1 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093584 - movs r4, 0 -_08093584: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetStepInPlaceDelay32AnimId - - thumb_func_start GetStepInPlaceDelay16AnimId -@ u8 GetStepInPlaceDelay16AnimId(u8 direction) -GetStepInPlaceDelay16AnimId: @ 8093598 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBE6 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _080935B0 - movs r4, 0 -_080935B0: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetStepInPlaceDelay16AnimId - - thumb_func_start GetStepInPlaceDelay8AnimId -@ u8 GetStepInPlaceDelay8AnimId(u8 direction) -GetStepInPlaceDelay8AnimId: @ 80935C4 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBEB - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _080935DC - movs r4, 0 -_080935DC: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetStepInPlaceDelay8AnimId - - thumb_func_start GetStepInPlaceDelay4AnimId -@ u8 GetStepInPlaceDelay4AnimId(u8 direction) -GetStepInPlaceDelay4AnimId: @ 80935F0 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBF0 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093608 - movs r4, 0 -_08093608: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetStepInPlaceDelay4AnimId - - thumb_func_start FieldObjectFaceOppositeDirection -@ bool8 FieldObjectFaceOppositeDirection(struct npc_state *fieldObject, u8 direction) -FieldObjectFaceOppositeDirection: @ 809361C - push {r4,lr} - adds r4, r0, 0 - lsls r0, r1, 24 - lsrs r0, 24 - bl GetOppositeDirection - lsls r0, 24 - lsrs r0, 24 - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - thumb_func_end FieldObjectFaceOppositeDirection - - thumb_func_start sub_8093648 -sub_8093648: @ 8093648 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBF5 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093660 - movs r4, 0 -_08093660: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8093648 - - thumb_func_start sub_8093674 -sub_8093674: @ 8093674 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBFA - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _0809368C - movs r4, 0 -_0809368C: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8093674 - - thumb_func_start sub_80936A0 -sub_80936A0: @ 80936A0 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DBFF - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _080936B8 - movs r4, 0 -_080936B8: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80936A0 - - thumb_func_start sub_80936CC -sub_80936CC: @ 80936CC - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DC04 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _080936E4 - movs r4, 0 -_080936E4: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80936CC - - thumb_func_start sub_80936F8 -sub_80936F8: @ 80936F8 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DC09 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093710 - movs r4, 0 -_08093710: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80936F8 - - thumb_func_start sub_8093724 -sub_8093724: @ 8093724 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DC0E - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _0809373C - movs r4, 0 -_0809373C: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8093724 - - thumb_func_start sub_8093750 -sub_8093750: @ 8093750 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DC13 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093768 - movs r4, 0 -_08093768: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8093750 - - thumb_func_start sub_809377C -sub_809377C: @ 809377C - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DC18 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _08093794 - movs r4, 0 -_08093794: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809377C - - thumb_func_start sub_80937A8 -sub_80937A8: @ 80937A8 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DC1D - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _080937C0 - movs r4, 0 -_080937C0: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80937A8 - - thumb_func_start d2s_08064034 -d2s_08064034: @ 80937D4 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DC22 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x4 - bls _080937EC - movs r4, 0 -_080937EC: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end d2s_08064034 - - thumb_func_start GetOppositeDirection -@ u8 GetOppositeDirection(u8 direction) -GetOppositeDirection: @ 8093800 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0850DC27 - mov r0, sp - movs r2, 0x8 - bl memcpy - subs r1, r4, 0x1 - lsls r0, r1, 24 - lsrs r0, 24 - cmp r0, 0x7 - bhi _08093828 - mov r2, sp - adds r0, r2, r1 - ldrb r0, [r0] - b _0809382A - .pool -_08093828: - adds r0, r4, 0 -_0809382A: - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetOppositeDirection - - thumb_func_start zffu_offset_calc -zffu_offset_calc: @ 8093834 - lsls r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_0850DC2F - lsrs r0, 22 - subs r0, 0x5 - adds r1, r0 - adds r1, r2 - ldrb r0, [r1] - bx lr - .pool - thumb_func_end zffu_offset_calc - - thumb_func_start state_to_direction -state_to_direction: @ 809384C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r1, 24 - adds r0, r1, 0 - lsls r2, 24 - lsrs r2, 24 - cmp r1, 0 - beq _0809386C - cmp r2, 0 - beq _0809386C - cmp r1, 0x4 - bhi _0809386C - cmp r2, 0x4 - bls _08093870 -_0809386C: - movs r0, 0 - b _08093882 -_08093870: - adds r1, r2, 0 - bl zffu_offset_calc - ldr r2, =gUnknown_0850DC3F - lsls r1, r4, 2 - subs r1, 0x5 - adds r0, r1 - adds r0, r2 - ldrb r0, [r0] -_08093882: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end state_to_direction - - thumb_func_start FieldObjectExecSpecialAnim -@ void FieldObjectExecSpecialAnim(struct npc_state *fieldObject, struct obj *object) -FieldObjectExecSpecialAnim: @ 809388C - push {r4,lr} - adds r4, r0, 0 - ldr r2, =gUnknown_0850DC50 - ldrb r0, [r4, 0x1C] - lsls r0, 2 - adds r0, r2 - movs r3, 0x32 - ldrsh r2, [r1, r3] - ldr r0, [r0] - lsls r2, 2 - adds r2, r0 - ldr r2, [r2] - adds r0, r4, 0 - bl _call_via_r2 - lsls r0, 24 - cmp r0, 0 - beq _080938B8 - ldrb r0, [r4] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r4] -_080938B8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectExecSpecialAnim - - thumb_func_start FieldObjectExecRegularAnim -@ bool8 FieldObjectExecRegularAnim(struct npc_state *fieldObject, struct obj *object) -FieldObjectExecRegularAnim: @ 80938C4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_0850DC50 - ldrb r0, [r4, 0x1C] - lsls r0, 2 - adds r0, r1 - movs r2, 0x32 - ldrsh r1, [r5, r2] - ldr r0, [r0] - lsls r1, 2 - adds r1, r0 - ldr r2, [r1] - adds r0, r4, 0 - adds r1, r5, 0 - bl _call_via_r2 - lsls r0, 24 - cmp r0, 0 - bne _080938F4 - movs r0, 0 - b _080938FE - .pool -_080938F4: - movs r0, 0xFF - strb r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r5, 0x32] - movs r0, 0x1 -_080938FE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end FieldObjectExecRegularAnim - - thumb_func_start FieldObjectSetRegularAnim -@ void FieldObjectSetRegularAnim(struct npc_state *fieldObject, struct obj *object, u8 animState) -FieldObjectSetRegularAnim: @ 8093904 - movs r3, 0 - strb r2, [r0, 0x1C] - strh r3, [r1, 0x32] - bx lr - thumb_func_end FieldObjectSetRegularAnim - - thumb_func_start an_look_any -@ void an_look_any(struct npc_state *fieldObject, struct obj *object, u8 direction) -an_look_any: @ 809390C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r1, r2, 24 - lsrs r1, 24 - bl FieldObjectSetDirection - adds r0, r4, 0 - bl npc_coords_shift_still - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl get_go_image_anim_num - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl obj_npc_animation_step - adds r2, r5, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x1 - strh r0, [r5, 0x32] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end an_look_any - - thumb_func_start sub_8093950 -sub_8093950: @ 8093950 - push {lr} - movs r2, 0x1 - bl an_look_any - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_8093950 - - thumb_func_start sub_8093960 -sub_8093960: @ 8093960 - push {lr} - movs r2, 0x2 - bl an_look_any - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_8093960 - - thumb_func_start sub_8093970 -sub_8093970: @ 8093970 - push {lr} - movs r2, 0x3 - bl an_look_any - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_8093970 - - thumb_func_start sub_8093980 -sub_8093980: @ 8093980 - push {lr} - movs r2, 0x4 - bl an_look_any - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_8093980 - - thumb_func_start npc_apply_direction -@ void npc_apply_direction(struct npc_state *fieldObject, struct obj *object, u8 direction, u8 speed) -npc_apply_direction: @ 8093990 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r7, r0, 0 - mov r8, r1 - adds r4, r2, 0 - adds r6, r3, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r6, 24 - lsrs r6, 24 - ldrh r1, [r7, 0x10] - mov r0, sp - strh r1, [r0] - ldrh r0, [r7, 0x12] - mov r5, sp - adds r5, 0x2 - strh r0, [r5] - adds r0, r7, 0 - adds r1, r4, 0 - bl FieldObjectSetDirection - adds r0, r4, 0 - mov r1, sp - adds r2, r5, 0 - bl MoveCoords - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0 - ldrsh r2, [r5, r0] - adds r0, r7, 0 - bl npc_coords_shift - mov r0, r8 - adds r1, r4, 0 - adds r2, r6, 0 - bl oamt_npc_ministep_reset - mov r4, r8 - adds r4, 0x2C - ldrb r1, [r4] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r4] - ldr r0, =0x020375b8 - ldr r0, [r0] - cmp r0, 0 - beq _08093A0E - adds r0, r7, 0 - bl sub_8097F78 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - beq _08093A0E - ldrb r0, [r4] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r4] -_08093A0E: - ldrb r0, [r7] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r7] - movs r0, 0x1 - mov r1, r8 - strh r0, [r1, 0x32] - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end npc_apply_direction - - thumb_func_start do_go_anim -@ void do_go_anim(struct npc_state *fieldObject, struct obj *object, u8 direction, u8 speed) -do_go_anim: @ 8093A2C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - adds r5, r0, 0 - mov r8, r1 - adds r4, r3, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r4, 24 - lsrs r4, 24 - mov r1, sp - ldr r0, =gUnknown_0850DEE8 - ldm r0!, {r3,r6,r7} - stm r1!, {r3,r6,r7} - ldm r0!, {r3,r6} - stm r1!, {r3,r6} - adds r0, r5, 0 - mov r1, r8 - adds r3, r4, 0 - bl npc_apply_direction - lsls r4, 2 - mov r7, sp - adds r1, r7, r4 - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - ldr r1, [r1] - bl _call_via_r1 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r5, 0 - mov r1, r8 - bl npc_apply_anim_looping - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end do_go_anim - - thumb_func_start do_run_anim -@ void do_run_anim(struct npc_state *fieldObject, struct obj *object, u8 direction) -do_run_anim: @ 8093A88 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r2, 24 - lsrs r2, 24 - movs r3, 0x1 - bl npc_apply_direction - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl get_run_image_anim_num - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl npc_apply_anim_looping - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end do_run_anim - - thumb_func_start npc_obj_ministep_stop_on_arrival -@ bool8 npc_obj_ministep_stop_on_arrival(struct npc_state *fieldObject, struct obj *object) -npc_obj_ministep_stop_on_arrival: @ 8093AB8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl obj_npc_ministep - lsls r0, 24 - cmp r0, 0 - bne _08093ACE - movs r0, 0 - b _08093AEA -_08093ACE: - adds r0, r4, 0 - bl npc_coords_shift_still - ldrb r0, [r4] - movs r1, 0x8 - orrs r0, r1 - strb r0, [r4] - adds r2, r5, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x1 -_08093AEA: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end npc_obj_ministep_stop_on_arrival - - thumb_func_start sub_8093AF0 -@ void sub_8093AF0(struct npc_state *fieldObject, struct obj *object, u8 direction) -sub_8093AF0: @ 8093AF0 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - adds r6, r0, 0 - mov r8, r1 - lsls r5, r2, 24 - lsrs r5, 24 - ldrh r1, [r6, 0x10] - mov r0, sp - strh r1, [r0] - ldrh r0, [r6, 0x12] - mov r4, sp - adds r4, 0x2 - strh r0, [r4] - adds r0, r6, 0 - adds r1, r5, 0 - bl FieldObjectSetDirection - adds r0, r5, 0 - mov r1, sp - adds r2, r4, 0 - bl MoveCoords - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0 - ldrsh r2, [r4, r0] - adds r0, r6, 0 - bl npc_coords_shift - mov r0, r8 - adds r1, r5, 0 - bl sub_80976DC - mov r2, r8 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldrb r0, [r6] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r6] - movs r0, 0x1 - mov r1, r8 - strh r0, [r1, 0x32] - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8093AF0 - - thumb_func_start sub_8093B60 -@ void sub_8093B60(struct npc_state *fieldObject, struct obj *object, u8 direction) -sub_8093B60: @ 8093B60 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r2, 24 - lsrs r2, 24 - bl sub_8093AF0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl get_go_image_anim_num - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl npc_apply_anim_looping - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8093B60 - - thumb_func_start an_walk_any_2 -@ bool8 an_walk_any_2(struct npc_state *fieldObject, struct obj *object) -an_walk_any_2: @ 8093B8C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_80976EC - lsls r0, 24 - cmp r0, 0 - bne _08093BA2 - movs r0, 0 - b _08093BBE -_08093BA2: - adds r0, r4, 0 - bl npc_coords_shift_still - ldrb r0, [r4] - movs r1, 0x8 - orrs r0, r1 - strb r0, [r4] - adds r2, r5, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x1 -_08093BBE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end an_walk_any_2 - - thumb_func_start sub_8093BC4 -sub_8093BC4: @ 8093BC4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x7 - bl sub_8093B60 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093BE4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093BC4 - - thumb_func_start sub_8093BE4 -sub_8093BE4: @ 8093BE4 - push {r4,lr} - adds r4, r1, 0 - bl an_walk_any_2 - lsls r0, 24 - cmp r0, 0 - bne _08093BF6 - movs r0, 0 - b _08093BFC -_08093BF6: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093BFC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093BE4 - - thumb_func_start sub_8093C04 -sub_8093C04: @ 8093C04 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x8 - bl sub_8093B60 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093C24 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093C04 - - thumb_func_start sub_8093C24 -sub_8093C24: @ 8093C24 - push {r4,lr} - adds r4, r1, 0 - bl an_walk_any_2 - lsls r0, 24 - cmp r0, 0 - bne _08093C36 - movs r0, 0 - b _08093C3C -_08093C36: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093C3C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093C24 - - thumb_func_start sub_8093C44 -sub_8093C44: @ 8093C44 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x5 - bl sub_8093B60 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093C64 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093C44 - - thumb_func_start sub_8093C64 -sub_8093C64: @ 8093C64 - push {r4,lr} - adds r4, r1, 0 - bl an_walk_any_2 - lsls r0, 24 - cmp r0, 0 - bne _08093C76 - movs r0, 0 - b _08093C7C -_08093C76: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093C7C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093C64 - - thumb_func_start sub_8093C84 -sub_8093C84: @ 8093C84 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x6 - bl sub_8093B60 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093CA4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093C84 - - thumb_func_start sub_8093CA4 -sub_8093CA4: @ 8093CA4 - push {r4,lr} - adds r4, r1, 0 - bl an_walk_any_2 - lsls r0, 24 - cmp r0, 0 - bne _08093CB6 - movs r0, 0 - b _08093CBC -_08093CB6: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093CBC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093CA4 - - thumb_func_start sub_8093CC4 -@ bool8 sub_8093CC4(struct npc_state *fieldObject, struct obj *object) -sub_8093CC4: @ 8093CC4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x1 - bl sub_8093B60 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093CE4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093CC4 - - thumb_func_start sub_8093CE4 -@ bool8 sub_8093CE4(struct npc_state *fieldObject, struct obj *object) -sub_8093CE4: @ 8093CE4 - push {r4,lr} - adds r4, r1, 0 - bl an_walk_any_2 - lsls r0, 24 - cmp r0, 0 - bne _08093CF6 - movs r0, 0 - b _08093CFC -_08093CF6: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093CFC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093CE4 - - thumb_func_start sub_8093D04 -sub_8093D04: @ 8093D04 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x2 - bl sub_8093B60 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093D24 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093D04 - - thumb_func_start sub_8093D24 -sub_8093D24: @ 8093D24 - push {r4,lr} - adds r4, r1, 0 - bl an_walk_any_2 - lsls r0, 24 - cmp r0, 0 - bne _08093D36 - movs r0, 0 - b _08093D3C -_08093D36: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093D3C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093D24 - - thumb_func_start sub_8093D44 -sub_8093D44: @ 8093D44 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x3 - bl sub_8093B60 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093D64 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093D44 - - thumb_func_start sub_8093D64 -sub_8093D64: @ 8093D64 - push {r4,lr} - adds r4, r1, 0 - bl an_walk_any_2 - lsls r0, 24 - cmp r0, 0 - bne _08093D76 - movs r0, 0 - b _08093D7C -_08093D76: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093D7C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093D64 - - thumb_func_start sub_8093D84 -sub_8093D84: @ 8093D84 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x4 - bl sub_8093B60 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093DA4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093D84 - - thumb_func_start sub_8093DA4 -sub_8093DA4: @ 8093DA4 - push {r4,lr} - adds r4, r1, 0 - bl an_walk_any_2 - lsls r0, 24 - cmp r0, 0 - bne _08093DB6 - movs r0, 0 - b _08093DBC -_08093DB6: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093DBC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093DA4 - - thumb_func_start sub_8093DC4 -sub_8093DC4: @ 8093DC4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x7 - movs r3, 0 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093DE4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093DC4 - - thumb_func_start sub_8093DE4 -@ bool8 sub_8093DE4(struct npc_state *fieldObject, struct obj *object) -sub_8093DE4: @ 8093DE4 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08093DF6 - movs r0, 0 - b _08093DFC -_08093DF6: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093DFC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093DE4 - - thumb_func_start sub_8093E04 -sub_8093E04: @ 8093E04 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x8 - movs r3, 0 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093E24 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093E04 - - thumb_func_start sub_8093E24 -sub_8093E24: @ 8093E24 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08093E36 - movs r0, 0 - b _08093E3C -_08093E36: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093E3C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093E24 - - thumb_func_start sub_8093E44 -sub_8093E44: @ 8093E44 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x5 - movs r3, 0 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093E64 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093E44 - - thumb_func_start sub_8093E64 -sub_8093E64: @ 8093E64 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08093E76 - movs r0, 0 - b _08093E7C -_08093E76: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093E7C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093E64 - - thumb_func_start sub_8093E84 -sub_8093E84: @ 8093E84 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x6 - movs r3, 0 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093EA4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093E84 - - thumb_func_start sub_8093EA4 -sub_8093EA4: @ 8093EA4 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08093EB6 - movs r0, 0 - b _08093EBC -_08093EB6: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093EBC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093EA4 - - thumb_func_start sub_8093EC4 -sub_8093EC4: @ 8093EC4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x1 - movs r3, 0 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093EE4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093EC4 - - thumb_func_start sub_8093EE4 -sub_8093EE4: @ 8093EE4 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08093EF6 - movs r0, 0 - b _08093EFC -_08093EF6: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093EFC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093EE4 - - thumb_func_start sub_8093F04 -sub_8093F04: @ 8093F04 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x2 - movs r3, 0 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093F24 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093F04 - - thumb_func_start sub_8093F24 -sub_8093F24: @ 8093F24 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08093F36 - movs r0, 0 - b _08093F3C -_08093F36: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093F3C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093F24 - - thumb_func_start sub_8093F44 -sub_8093F44: @ 8093F44 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x3 - movs r3, 0 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093F64 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093F44 - - thumb_func_start sub_8093F64 -sub_8093F64: @ 8093F64 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08093F76 - movs r0, 0 - b _08093F7C -_08093F76: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093F7C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093F64 - - thumb_func_start sub_8093F84 -sub_8093F84: @ 8093F84 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x4 - movs r3, 0 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8093FA4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8093F84 - - thumb_func_start sub_8093FA4 -sub_8093FA4: @ 8093FA4 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08093FB6 - movs r0, 0 - b _08093FBC -_08093FB6: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08093FBC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8093FA4 - - thumb_func_start sub_8093FC4 -sub_8093FC4: @ 8093FC4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - adds r7, r0, 0 - mov r10, r1 - adds r4, r2, 0 - mov r8, r3 - ldr r0, [sp, 0x30] - lsls r4, 24 - lsrs r4, 24 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r1, =gUnknown_0850DFBC - add r0, sp, 0x4 - movs r2, 0x6 - bl memcpy - add r5, sp, 0xC - movs r0, 0 - strh r0, [r5] - mov r6, sp - adds r6, 0xE - strh r0, [r6] - adds r0, r7, 0 - adds r1, r4, 0 - bl FieldObjectSetDirection - mov r1, r8 - lsls r0, r1, 1 - add r0, sp - adds r0, 0x4 - movs r1, 0 - ldrsh r3, [r0, r1] - str r3, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - bl sub_8092F88 - ldrh r1, [r5] - ldrh r0, [r7, 0x10] - adds r1, r0 - lsls r1, 16 - asrs r1, 16 - ldrh r2, [r6] - ldrh r0, [r7, 0x12] - adds r2, r0 - lsls r2, 16 - asrs r2, 16 - adds r0, r7, 0 - bl npc_coords_shift - mov r0, r10 - adds r1, r4, 0 - mov r2, r8 - mov r3, r9 - bl sub_809783C - movs r0, 0x1 - mov r1, r10 - strh r0, [r1, 0x32] - movs r0, 0x2C - add r10, r0 - mov r0, r10 - ldrb r1, [r0] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - mov r1, r10 - strb r0, [r1] - ldrb r0, [r7] - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r7] - 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_8093FC4 - - thumb_func_start maybe_shadow_1 -maybe_shadow_1: @ 8094080 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, [sp, 0x10] - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - adds r0, r4, 0 - bl sub_8093FC4 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl get_go_image_anim_num - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl npc_apply_anim_looping - adds r0, r4, 0 - bl DoShadowFieldEffect - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end maybe_shadow_1 - - thumb_func_start sub_80940C4 -@ int sub_80940C4(int a1, int a2, int a3) -sub_80940C4: @ 80940C4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - adds r6, r0, 0 - adds r7, r1, 0 - adds r4, r2, 0 - ldr r1, =gUnknown_0850DFC2 - add r0, sp, 0x4 - movs r2, 0x6 - bl memcpy - adds r0, r7, 0 - bl _call_via_r4 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x1 - bne _08094154 - movs r1, 0x36 - ldrsh r0, [r7, r1] - lsls r0, 1 - add r0, sp - adds r0, 0x4 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0 - beq _08094154 - add r4, sp, 0xC - movs r0, 0 - strh r0, [r4] - mov r5, sp - adds r5, 0xE - strh r0, [r5] - ldrb r0, [r6, 0x18] - lsrs r0, 4 - movs r2, 0x36 - ldrsh r1, [r7, r2] - lsls r1, 1 - add r1, sp - adds r1, 0x4 - movs r2, 0 - ldrsh r3, [r1, r2] - str r3, [sp] - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_8092F88 - ldrh r1, [r4] - ldrh r0, [r6, 0x10] - adds r1, r0 - lsls r1, 16 - asrs r1, 16 - ldrh r2, [r5] - ldrh r0, [r6, 0x12] - adds r2, r0 - lsls r2, 16 - asrs r2, 16 - adds r0, r6, 0 - bl npc_coords_shift - ldrb r0, [r6] - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r6] - b _08094178 - .pool -_08094154: - mov r1, r8 - cmp r1, 0xFF - bne _08094178 - adds r0, r6, 0 - bl npc_coords_shift_still - ldrb r0, [r6] - movs r1, 0x8 - orrs r0, r1 - movs r1, 0x20 - orrs r0, r1 - strb r0, [r6] - adds r2, r7, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] -_08094178: - mov r0, r8 - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80940C4 - - thumb_func_start sub_8094188 -sub_8094188: @ 8094188 - push {lr} - ldr r2, =sub_809785C - bl sub_80940C4 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8094188 - - thumb_func_start sub_809419C -sub_809419C: @ 809419C - push {lr} - ldr r2, =sub_80978E4 - bl sub_80940C4 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809419C - - thumb_func_start sub_80941B0 -sub_80941B0: @ 80941B0 - push {lr} - bl sub_8094188 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _080941C2 - movs r0, 0 - b _080941C4 -_080941C2: - movs r0, 0x1 -_080941C4: - pop {r1} - bx r1 - thumb_func_end sub_80941B0 - - thumb_func_start sub_80941C8 -sub_80941C8: @ 80941C8 - push {lr} - bl sub_809419C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _080941DA - movs r0, 0 - b _080941DC -_080941DA: - movs r0, 0x1 -_080941DC: - pop {r1} - bx r1 - thumb_func_end sub_80941C8 - - thumb_func_start sub_80941E0 -sub_80941E0: @ 80941E0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_8094188 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080941FA - cmp r0, 0xFF - bne _08094226 - movs r0, 0x1 - b _08094228 -_080941FA: - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl GetOppositeDirection - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetDirection - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl get_go_image_anim_num - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl obj_npc_animation_step -_08094226: - movs r0, 0 -_08094228: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80941E0 - - thumb_func_start sub_8094230 -sub_8094230: @ 8094230 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x2 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809425C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094230 - - thumb_func_start sub_809425C -sub_809425C: @ 809425C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08094270 - movs r0, 0 - b _08094280 -_08094270: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08094280: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809425C - - thumb_func_start sub_8094288 -sub_8094288: @ 8094288 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0x2 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80942B4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094288 - - thumb_func_start sub_80942B4 -sub_80942B4: @ 80942B4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _080942C8 - movs r0, 0 - b _080942D8 -_080942C8: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_080942D8: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80942B4 - - thumb_func_start sub_80942E0 -sub_80942E0: @ 80942E0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x3 - movs r3, 0x2 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809430C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80942E0 - - thumb_func_start sub_809430C -sub_809430C: @ 809430C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08094320 - movs r0, 0 - b _08094330 -_08094320: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08094330: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809430C - - thumb_func_start sub_8094338 -sub_8094338: @ 8094338 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x4 - movs r3, 0x2 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094364 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094338 - - thumb_func_start sub_8094364 -sub_8094364: @ 8094364 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08094378 - movs r0, 0 - b _08094388 -_08094378: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08094388: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094364 - - thumb_func_start sub_8094390 -sub_8094390: @ 8094390 - movs r2, 0x1 - strh r2, [r0, 0x32] - strh r1, [r0, 0x34] - bx lr - thumb_func_end sub_8094390 - - thumb_func_start sub_8094398 -sub_8094398: @ 8094398 - push {lr} - ldrh r0, [r1, 0x34] - subs r0, 0x1 - strh r0, [r1, 0x34] - lsls r0, 16 - cmp r0, 0 - beq _080943AA - movs r0, 0 - b _080943B0 -_080943AA: - movs r0, 0x2 - strh r0, [r1, 0x32] - movs r0, 0x1 -_080943B0: - pop {r1} - bx r1 - thumb_func_end sub_8094398 - - thumb_func_start sub_80943B4 -sub_80943B4: @ 80943B4 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_8094390 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8094398 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80943B4 - - thumb_func_start sub_80943D4 -sub_80943D4: @ 80943D4 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r0, r4, 0 - movs r1, 0x2 - bl sub_8094390 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8094398 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80943D4 - - thumb_func_start sub_80943F4 -sub_80943F4: @ 80943F4 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r0, r4, 0 - movs r1, 0x4 - bl sub_8094390 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8094398 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80943F4 - - thumb_func_start sub_8094414 -sub_8094414: @ 8094414 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r0, r4, 0 - movs r1, 0x8 - bl sub_8094390 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8094398 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094414 - - thumb_func_start sub_8094434 -sub_8094434: @ 8094434 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r0, r4, 0 - movs r1, 0x10 - bl sub_8094390 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8094398 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094434 - - thumb_func_start sub_8094454 -sub_8094454: @ 8094454 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x1 - movs r3, 0x1 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094474 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094454 - - thumb_func_start sub_8094474 -sub_8094474: @ 8094474 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094486 - movs r0, 0 - b _0809448C -_08094486: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_0809448C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094474 - - thumb_func_start sub_8094494 -sub_8094494: @ 8094494 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x2 - movs r3, 0x1 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80944B4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094494 - - thumb_func_start sub_80944B4 -sub_80944B4: @ 80944B4 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _080944C6 - movs r0, 0 - b _080944CC -_080944C6: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080944CC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80944B4 - - thumb_func_start sub_80944D4 -sub_80944D4: @ 80944D4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x3 - movs r3, 0x1 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80944F4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80944D4 - - thumb_func_start sub_80944F4 -sub_80944F4: @ 80944F4 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094506 - movs r0, 0 - b _0809450C -_08094506: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_0809450C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80944F4 - - thumb_func_start sub_8094514 -sub_8094514: @ 8094514 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x4 - movs r3, 0x1 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094534 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094514 - - thumb_func_start sub_8094534 -sub_8094534: @ 8094534 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094546 - movs r0, 0 - b _0809454C -_08094546: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_0809454C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094534 - - thumb_func_start sub_8094554 -sub_8094554: @ 8094554 - push {r4-r6,lr} - mov r6, r8 - push {r6} - mov r8, r0 - adds r6, r1, 0 - adds r1, r2, 0 - adds r4, r3, 0 - ldr r5, [sp, 0x14] - lsls r1, 24 - lsrs r1, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 16 - lsrs r5, 16 - bl FieldObjectSetDirection - mov r0, r8 - adds r1, r6, 0 - adds r2, r4, 0 - bl npc_apply_anim_looping - adds r2, r6, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - movs r0, 0x1 - strh r0, [r6, 0x32] - strh r5, [r6, 0x34] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8094554 - - thumb_func_start sub_809459C -@ signed int sub_809459C(int a1, obj *a2) -sub_809459C: @ 809459C - push {lr} - ldrh r0, [r1, 0x34] - subs r0, 0x1 - strh r0, [r1, 0x34] - lsls r0, 16 - cmp r0, 0 - beq _080945AE - movs r0, 0 - b _080945C0 -_080945AE: - movs r0, 0x2 - strh r0, [r1, 0x32] - adds r2, r1, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x1 -_080945C0: - pop {r1} - bx r1 - thumb_func_end sub_809459C - - thumb_func_start sub_80945C4 -@ int sub_80945C4(int a1, obj *a2) -sub_80945C4: @ 80945C4 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - ldrh r1, [r4, 0x34] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080945EE - adds r3, r4, 0 - adds r3, 0x2C - ldrb r2, [r3] - lsls r1, r2, 26 - lsrs r1, 26 - adds r1, 0x1 - movs r0, 0x3F - ands r1, r0 - movs r0, 0x40 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_080945EE: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80945C4 - - thumb_func_start sub_8094600 -sub_8094600: @ 8094600 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - bl get_go_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x20 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80945C4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094600 - - thumb_func_start sub_8094638 -sub_8094638: @ 8094638 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - bl get_go_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x20 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80945C4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094638 - - thumb_func_start sub_8094670 -sub_8094670: @ 8094670 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x3 - bl get_go_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x20 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x3 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80945C4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094670 - - thumb_func_start sub_80946A8 -sub_80946A8: @ 80946A8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x4 - bl get_go_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x20 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x4 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80945C4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80946A8 - - thumb_func_start sub_80946E0 -sub_80946E0: @ 80946E0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - bl get_go_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x10 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80946E0 - - thumb_func_start sub_8094718 -sub_8094718: @ 8094718 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - bl get_go_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x10 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094718 - - thumb_func_start sub_8094750 -sub_8094750: @ 8094750 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x3 - bl get_go_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x10 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x3 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094750 - - thumb_func_start sub_8094788 -sub_8094788: @ 8094788 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x4 - bl get_go_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x10 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x4 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094788 - - thumb_func_start sub_80947C0 -sub_80947C0: @ 80947C0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - bl get_go_fast_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x8 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80947C0 - - thumb_func_start sub_80947F8 -sub_80947F8: @ 80947F8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - bl get_go_fast_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x8 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80947F8 - - thumb_func_start sub_8094830 -sub_8094830: @ 8094830 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x3 - bl get_go_fast_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x8 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x3 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094830 - - thumb_func_start sub_8094868 -sub_8094868: @ 8094868 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x4 - bl get_go_fast_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x8 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x4 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094868 - - thumb_func_start sub_80948A0 -sub_80948A0: @ 80948A0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - bl get_go_faster_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x4 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80948A0 - - thumb_func_start sub_80948D8 -sub_80948D8: @ 80948D8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - bl get_go_faster_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x4 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80948D8 - - thumb_func_start sub_8094910 -sub_8094910: @ 8094910 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x3 - bl get_go_faster_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x4 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x3 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094910 - - thumb_func_start sub_8094948 -sub_8094948: @ 8094948 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x4 - bl get_go_faster_image_anim_num - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x4 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x4 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094948 - - thumb_func_start sub_8094980 -sub_8094980: @ 8094980 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x1 - movs r3, 0x2 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80949A0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094980 - - thumb_func_start sub_80949A0 -sub_80949A0: @ 80949A0 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _080949B2 - movs r0, 0 - b _080949B8 -_080949B2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080949B8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80949A0 - - thumb_func_start sub_80949C0 -sub_80949C0: @ 80949C0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x2 - movs r3, 0x2 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80949E0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80949C0 - - thumb_func_start sub_80949E0 -sub_80949E0: @ 80949E0 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _080949F2 - movs r0, 0 - b _080949F8 -_080949F2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080949F8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80949E0 - - thumb_func_start sub_8094A00 -sub_8094A00: @ 8094A00 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x3 - movs r3, 0x2 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094A20 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094A00 - - thumb_func_start sub_8094A20 -sub_8094A20: @ 8094A20 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094A32 - movs r0, 0 - b _08094A38 -_08094A32: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094A38: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094A20 - - thumb_func_start sub_8094A40 -sub_8094A40: @ 8094A40 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x4 - movs r3, 0x2 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094A60 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094A40 - - thumb_func_start sub_8094A60 -sub_8094A60: @ 8094A60 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094A72 - movs r0, 0 - b _08094A78 -_08094A72: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094A78: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094A60 - - thumb_func_start sub_8094A80 -sub_8094A80: @ 8094A80 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x1 - movs r3, 0x3 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094AA0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094A80 - - thumb_func_start sub_8094AA0 -sub_8094AA0: @ 8094AA0 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094AB2 - movs r0, 0 - b _08094AB8 -_08094AB2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094AB8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094AA0 - - thumb_func_start sub_8094AC0 -sub_8094AC0: @ 8094AC0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x2 - movs r3, 0x3 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094AE0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094AC0 - - thumb_func_start sub_8094AE0 -sub_8094AE0: @ 8094AE0 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094AF2 - movs r0, 0 - b _08094AF8 -_08094AF2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094AF8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094AE0 - - thumb_func_start sub_8094B00 -sub_8094B00: @ 8094B00 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x3 - movs r3, 0x3 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094B20 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094B00 - - thumb_func_start sub_8094B20 -sub_8094B20: @ 8094B20 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094B32 - movs r0, 0 - b _08094B38 -_08094B32: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094B38: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094B20 - - thumb_func_start sub_8094B40 -sub_8094B40: @ 8094B40 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x4 - movs r3, 0x3 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094B60 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094B40 - - thumb_func_start sub_8094B60 -sub_8094B60: @ 8094B60 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094B72 - movs r0, 0 - b _08094B78 -_08094B72: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094B78: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094B60 - - thumb_func_start sub_8094B80 -sub_8094B80: @ 8094B80 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x1 - movs r3, 0x4 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094BA0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094B80 - - thumb_func_start sub_8094BA0 -sub_8094BA0: @ 8094BA0 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094BB2 - movs r0, 0 - b _08094BB8 -_08094BB2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094BB8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094BA0 - - thumb_func_start sub_8094BC0 -sub_8094BC0: @ 8094BC0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x2 - movs r3, 0x4 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094BE0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094BC0 - - thumb_func_start sub_8094BE0 -sub_8094BE0: @ 8094BE0 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094BF2 - movs r0, 0 - b _08094BF8 -_08094BF2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094BF8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094BE0 - - thumb_func_start sub_8094C00 -sub_8094C00: @ 8094C00 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x3 - movs r3, 0x4 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094C20 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094C00 - - thumb_func_start sub_8094C20 -sub_8094C20: @ 8094C20 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094C32 - movs r0, 0 - b _08094C38 -_08094C32: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094C38: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094C20 - - thumb_func_start sub_8094C40 -sub_8094C40: @ 8094C40 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x4 - movs r3, 0x4 - bl do_go_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094C60 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094C40 - - thumb_func_start sub_8094C60 -sub_8094C60: @ 8094C60 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094C72 - movs r0, 0 - b _08094C78 -_08094C72: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094C78: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094C60 - - thumb_func_start do_run_south_anim -@ bool8 do_run_south_anim(struct npc_state *fieldObject, struct obj *object) -do_run_south_anim: @ 8094C80 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x1 - bl do_run_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094CA0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end do_run_south_anim - - thumb_func_start sub_8094CA0 -@ bool8 sub_8094CA0(struct npc_state *fieldObject, struct obj *object) -sub_8094CA0: @ 8094CA0 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094CB2 - movs r0, 0 - b _08094CB8 -_08094CB2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094CB8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094CA0 - - thumb_func_start do_run_north_anim -do_run_north_anim: @ 8094CC0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x2 - bl do_run_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094CE0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end do_run_north_anim - - thumb_func_start sub_8094CE0 -sub_8094CE0: @ 8094CE0 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094CF2 - movs r0, 0 - b _08094CF8 -_08094CF2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094CF8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094CE0 - - thumb_func_start do_run_west_anim -do_run_west_anim: @ 8094D00 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x3 - bl do_run_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094D20 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end do_run_west_anim - - thumb_func_start sub_8094D20 -sub_8094D20: @ 8094D20 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094D32 - movs r0, 0 - b _08094D38 -_08094D32: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094D38: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094D20 - - thumb_func_start do_run_east_anim -do_run_east_anim: @ 8094D40 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x4 - bl do_run_anim - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094D60 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end do_run_east_anim - - thumb_func_start sub_8094D60 -sub_8094D60: @ 8094D60 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08094D72 - movs r0, 0 - b _08094D78 -_08094D72: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094D78: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094D60 - - thumb_func_start npc_set_direction_and_anim__an_proceed -npc_set_direction_and_anim__an_proceed: @ 8094D80 - push {r4-r6,lr} - adds r6, r0, 0 - adds r5, r1, 0 - adds r4, r2, 0 - adds r1, r3, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - movs r2, 0 - bl obj_anim_image_set_and_seek - adds r0, r6, 0 - adds r1, r4, 0 - bl FieldObjectSetDirection - movs r0, 0x1 - strh r0, [r5, 0x32] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end npc_set_direction_and_anim__an_proceed - - thumb_func_start sub_8094DAC -sub_8094DAC: @ 8094DAC - push {lr} - ldrb r2, [r0, 0x18] - lsrs r2, 4 - adds r3, r1, 0 - adds r3, 0x2A - ldrb r3, [r3] - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_8094DAC - - thumb_func_start sub_8094DC4 -sub_8094DC4: @ 8094DC4 - push {r4,lr} - adds r4, r1, 0 - adds r0, r4, 0 - bl sub_80979BC - lsls r0, 24 - cmp r0, 0 - bne _08094DD8 - movs r0, 0 - b _08094DDE -_08094DD8: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08094DDE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8094DC4 - - thumb_func_start sub_8094DE4 -sub_8094DE4: @ 8094DE4 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r1, 0 - lsls r4, r2, 24 - lsrs r4, 24 - movs r1, 0 - str r1, [sp] - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x1 - bl sub_8093FC4 - adds r0, r4, 0 - bl sub_80929AC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl StartObjectImageAnim - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8094DE4 - - thumb_func_start sub_8094E18 -sub_8094E18: @ 8094E18 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x1 - bl sub_8094DE4 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094E38 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094E18 - - thumb_func_start sub_8094E38 -sub_8094E38: @ 8094E38 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941C8 - lsls r0, 24 - cmp r0, 0 - bne _08094E4C - movs r0, 0 - b _08094E5A -_08094E4C: - movs r0, 0x2 - strh r0, [r5, 0x32] - ldrb r1, [r4] - subs r0, 0x23 - ands r0, r1 - strb r0, [r4] - movs r0, 0x1 -_08094E5A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094E38 - - thumb_func_start sub_8094E60 -sub_8094E60: @ 8094E60 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x2 - bl sub_8094DE4 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094E80 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094E60 - - thumb_func_start sub_8094E80 -sub_8094E80: @ 8094E80 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941C8 - lsls r0, 24 - cmp r0, 0 - bne _08094E94 - movs r0, 0 - b _08094EA2 -_08094E94: - movs r0, 0x2 - strh r0, [r5, 0x32] - ldrb r1, [r4] - subs r0, 0x23 - ands r0, r1 - strb r0, [r4] - movs r0, 0x1 -_08094EA2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094E80 - - thumb_func_start sub_8094EA8 -sub_8094EA8: @ 8094EA8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x3 - bl sub_8094DE4 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094EC8 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094EA8 - - thumb_func_start sub_8094EC8 -sub_8094EC8: @ 8094EC8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941C8 - lsls r0, 24 - cmp r0, 0 - bne _08094EDC - movs r0, 0 - b _08094EEA -_08094EDC: - movs r0, 0x2 - strh r0, [r5, 0x32] - ldrb r1, [r4] - subs r0, 0x23 - ands r0, r1 - strb r0, [r4] - movs r0, 0x1 -_08094EEA: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094EC8 - - thumb_func_start sub_8094EF0 -sub_8094EF0: @ 8094EF0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x4 - bl sub_8094DE4 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8094F10 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094EF0 - - thumb_func_start sub_8094F10 -sub_8094F10: @ 8094F10 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941C8 - lsls r0, 24 - cmp r0, 0 - bne _08094F24 - movs r0, 0 - b _08094F32 -_08094F24: - movs r0, 0x2 - strh r0, [r5, 0x32] - ldrb r1, [r4] - subs r0, 0x23 - ands r0, r1 - strb r0, [r4] - movs r0, 0x1 -_08094F32: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8094F10 - - thumb_func_start sub_8094F38 -sub_8094F38: @ 8094F38 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - movs r0, 0xFF - movs r1, 0 - movs r2, 0 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _08094F82 - movs r1, 0x10 - ldrsh r0, [r5, r1] - movs r2, 0x12 - ldrsh r1, [r5, r2] - ldr r4, =0x02037350 - mov r2, sp - ldrb r2, [r2] - lsls r3, r2, 3 - adds r3, r2 - lsls r3, 2 - adds r3, r4 - movs r4, 0x10 - ldrsh r2, [r3, r4] - movs r4, 0x12 - ldrsh r3, [r3, r4] - bl sub_8092AF8 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r5, 0 - adds r1, r6, 0 - bl an_look_any -_08094F82: - movs r0, 0x1 - strh r0, [r6, 0x32] - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8094F38 - - thumb_func_start sub_8094F94 -sub_8094F94: @ 8094F94 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - movs r0, 0xFF - movs r1, 0 - movs r2, 0 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _08094FE6 - movs r1, 0x10 - ldrsh r0, [r5, r1] - movs r2, 0x12 - ldrsh r1, [r5, r2] - ldr r4, =0x02037350 - mov r2, sp - ldrb r2, [r2] - lsls r3, r2, 3 - adds r3, r2 - lsls r3, 2 - adds r3, r4 - movs r4, 0x10 - ldrsh r2, [r3, r4] - movs r4, 0x12 - ldrsh r3, [r3, r4] - bl sub_8092AF8 - lsls r0, 24 - lsrs r0, 24 - bl GetOppositeDirection - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r5, 0 - adds r1, r6, 0 - bl an_look_any -_08094FE6: - movs r0, 0x1 - strh r0, [r6, 0x32] - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8094F94 - - thumb_func_start sub_8094FF8 -sub_8094FF8: @ 8094FF8 - ldrb r2, [r0, 0x1] - movs r3, 0x2 - orrs r2, r3 - strb r2, [r0, 0x1] - movs r0, 0x1 - strh r0, [r1, 0x32] - bx lr - thumb_func_end sub_8094FF8 - - thumb_func_start sub_8095008 -sub_8095008: @ 8095008 - ldrb r3, [r0, 0x1] - movs r2, 0x3 - negs r2, r2 - ands r2, r3 - strb r2, [r0, 0x1] - movs r0, 0x1 - strh r0, [r1, 0x32] - bx lr - thumb_func_end sub_8095008 - - thumb_func_start sub_8095018 -sub_8095018: @ 8095018 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x1 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095044 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095018 - - thumb_func_start sub_8095044 -sub_8095044: @ 8095044 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095058 - movs r0, 0 - b _08095068 -_08095058: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095068: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095044 - - thumb_func_start sub_8095070 -sub_8095070: @ 8095070 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0x1 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809509C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095070 - - thumb_func_start sub_809509C -sub_809509C: @ 809509C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _080950B0 - movs r0, 0 - b _080950C0 -_080950B0: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_080950C0: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809509C - - thumb_func_start sub_80950C8 -sub_80950C8: @ 80950C8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x3 - movs r3, 0x1 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80950F4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80950C8 - - thumb_func_start sub_80950F4 -sub_80950F4: @ 80950F4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095108 - movs r0, 0 - b _08095118 -_08095108: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095118: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80950F4 - - thumb_func_start sub_8095120 -sub_8095120: @ 8095120 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x4 - movs r3, 0x1 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809514C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095120 - - thumb_func_start sub_809514C -sub_809514C: @ 809514C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095160 - movs r0, 0 - b _08095170 -_08095160: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095170: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809514C - - thumb_func_start sub_8095178 -sub_8095178: @ 8095178 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80951A4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095178 - - thumb_func_start sub_80951A4 -sub_80951A4: @ 80951A4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _080951B8 - movs r0, 0 - b _080951C8 -_080951B8: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_080951C8: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80951A4 - - thumb_func_start sub_80951D0 -sub_80951D0: @ 80951D0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80951FC - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80951D0 - - thumb_func_start sub_80951FC -sub_80951FC: @ 80951FC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095210 - movs r0, 0 - b _08095220 -_08095210: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095220: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80951FC - - thumb_func_start sub_8095228 -sub_8095228: @ 8095228 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x3 - movs r3, 0 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095254 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095228 - - thumb_func_start sub_8095254 -sub_8095254: @ 8095254 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095268 - movs r0, 0 - b _08095278 -_08095268: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095278: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095254 - - thumb_func_start sub_8095280 -sub_8095280: @ 8095280 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x4 - movs r3, 0 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80952AC - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095280 - - thumb_func_start sub_80952AC -sub_80952AC: @ 80952AC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _080952C0 - movs r0, 0 - b _080952D0 -_080952C0: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_080952D0: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80952AC - - thumb_func_start sub_80952D8 -sub_80952D8: @ 80952D8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095304 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80952D8 - - thumb_func_start sub_8095304 -sub_8095304: @ 8095304 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941E0 - lsls r0, 24 - cmp r0, 0 - bne _08095318 - movs r0, 0 - b _08095328 -_08095318: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095328: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095304 - - thumb_func_start sub_8095330 -sub_8095330: @ 8095330 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809535C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095330 - - thumb_func_start sub_809535C -sub_809535C: @ 809535C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941E0 - lsls r0, 24 - cmp r0, 0 - bne _08095370 - movs r0, 0 - b _08095380 -_08095370: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095380: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809535C - - thumb_func_start sub_8095388 -sub_8095388: @ 8095388 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x3 - movs r3, 0 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80953B4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095388 - - thumb_func_start sub_80953B4 -sub_80953B4: @ 80953B4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941E0 - lsls r0, 24 - cmp r0, 0 - bne _080953C8 - movs r0, 0 - b _080953D8 -_080953C8: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_080953D8: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80953B4 - - thumb_func_start sub_80953E0 -sub_80953E0: @ 80953E0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x4 - movs r3, 0 - bl maybe_shadow_1 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809540C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80953E0 - - thumb_func_start sub_809540C -sub_809540C: @ 809540C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941E0 - lsls r0, 24 - cmp r0, 0 - bne _08095420 - movs r0, 0 - b _08095430 -_08095420: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095430: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809540C - - thumb_func_start sub_8095438 -sub_8095438: @ 8095438 - push {lr} - ldr r3, =gUnknown_085055CD - ldrb r2, [r0, 0x6] - adds r2, r3 - ldrb r2, [r2] - bl an_look_any - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8095438 - - thumb_func_start sub_8095450 -sub_8095450: @ 8095450 - push {lr} - movs r2, 0x1 - movs r3, 0x14 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_8095450 - - thumb_func_start sub_8095460 -sub_8095460: @ 8095460 - ldrb r3, [r0, 0x3] - movs r2, 0x3 - negs r2, r2 - ands r2, r3 - strb r2, [r0, 0x3] - movs r0, 0x1 - strh r0, [r1, 0x32] - bx lr - thumb_func_end sub_8095460 - - thumb_func_start sub_8095470 -sub_8095470: @ 8095470 - ldrb r2, [r0, 0x3] - movs r3, 0x2 - orrs r2, r3 - strb r2, [r0, 0x3] - movs r0, 0x1 - strh r0, [r1, 0x32] - bx lr - thumb_func_end sub_8095470 - - thumb_func_start sub_8095480 -sub_8095480: @ 8095480 - ldrb r2, [r0, 0x1] - movs r3, 0x10 - orrs r2, r3 - strb r2, [r0, 0x1] - movs r0, 0x1 - strh r0, [r1, 0x32] - bx lr - thumb_func_end sub_8095480 - - thumb_func_start sub_8095490 -@ int sub_8095490(npc_state *npcState, int a2) -sub_8095490: @ 8095490 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x5] - bl GetFieldObjectGraphicsInfo - ldrb r1, [r0, 0xC] - lsls r1, 25 - lsrs r1, 31 - lsls r1, 4 - ldrb r2, [r4, 0x1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x1] - movs r0, 0x1 - strh r0, [r5, 0x32] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095490 - - thumb_func_start sub_80954BC -sub_80954BC: @ 80954BC - ldrb r2, [r0, 0x1] - movs r3, 0x20 - orrs r2, r3 - strb r2, [r0, 0x1] - movs r0, 0x1 - strh r0, [r1, 0x32] - bx lr - thumb_func_end sub_80954BC - - thumb_func_start sub_80954CC -sub_80954CC: @ 80954CC - ldrb r3, [r0, 0x1] - movs r2, 0x21 - negs r2, r2 - ands r2, r3 - strb r2, [r0, 0x1] - movs r0, 0x1 - strh r0, [r1, 0x32] - bx lr - thumb_func_end sub_80954CC - - thumb_func_start do_exclamation_mark_bubble_1 -do_exclamation_mark_bubble_1: @ 80954DC - push {r4,lr} - adds r4, r1, 0 - ldr r1, =0x02038c08 - adds r2, r1, 0x4 - adds r3, r1, 0 - adds r3, 0x8 - bl FieldObjectGetLocalIdAndMap - movs r0, 0 - bl FieldEffectStart - movs r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end do_exclamation_mark_bubble_1 - - thumb_func_start do_exclamation_mark_bubble_2 -do_exclamation_mark_bubble_2: @ 8095500 - push {r4,lr} - adds r4, r1, 0 - ldr r1, =0x02038c08 - adds r2, r1, 0x4 - adds r3, r1, 0 - adds r3, 0x8 - bl FieldObjectGetLocalIdAndMap - movs r0, 0x21 - bl FieldEffectStart - movs r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end do_exclamation_mark_bubble_2 - - thumb_func_start do_heart_bubble -do_heart_bubble: @ 8095524 - push {r4,lr} - adds r4, r1, 0 - ldr r1, =0x02038c08 - adds r2, r1, 0x4 - adds r3, r1, 0 - adds r3, 0x8 - bl FieldObjectGetLocalIdAndMap - movs r0, 0x2E - bl FieldEffectStart - movs r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end do_heart_bubble - - thumb_func_start sub_8095548 -sub_8095548: @ 8095548 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x6] - cmp r0, 0x3F - bne _0809555E - adds r0, r4, 0 - bl sub_80B4578 - movs r0, 0 - b _08095586 -_0809555E: - subs r0, 0x39 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _08095580 - adds r0, r4, 0 - bl sub_8155D78 - movs r0, 0x1 - strh r0, [r5, 0x32] - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809558C - lsls r0, 24 - lsrs r0, 24 - b _08095586 -_08095580: - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095586: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095548 - - thumb_func_start sub_809558C -sub_809558C: @ 809558C - push {r4,lr} - adds r4, r1, 0 - bl sub_8155DA0 - lsls r0, 24 - cmp r0, 0 - bne _0809559E - movs r0, 0 - b _080955A4 -_0809559E: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080955A4: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_809558C - - thumb_func_start sub_80955AC -sub_80955AC: @ 80955AC - push {r4,lr} - adds r4, r1, 0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl obj_anim_image_set_and_seek - movs r0, 0x1 - strh r0, [r4, 0x32] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80955AC - - thumb_func_start sub_80955C8 -sub_80955C8: @ 80955C8 - push {r4,lr} - adds r4, r1, 0 - adds r0, r4, 0 - bl sub_80979BC - lsls r0, 24 - cmp r0, 0 - beq _080955E4 - adds r0, r4, 0 - movs r1, 0x20 - bl sub_8097978 - movs r0, 0x2 - strh r0, [r4, 0x32] -_080955E4: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80955C8 - - thumb_func_start sub_80955EC -sub_80955EC: @ 80955EC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r2, [r4, 0x1] - lsls r1, r2, 26 - lsrs r1, 31 - movs r0, 0x1 - eors r1, r0 - lsls r1, 5 - subs r0, 0x22 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x1] - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - beq _0809561E - ldrb r0, [r4, 0x1] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r4, 0x1] - movs r0, 0x3 - strh r0, [r5, 0x32] -_0809561E: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80955EC - - thumb_func_start sub_8095628 -sub_8095628: @ 8095628 - push {r4,lr} - adds r4, r1, 0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl obj_anim_image_set_and_seek - movs r0, 0x1 - strh r0, [r4, 0x32] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8095628 - - thumb_func_start sub_8095644 -sub_8095644: @ 8095644 - push {r4,lr} - adds r4, r1, 0 - adds r0, r4, 0 - bl sub_80979BC - lsls r0, 24 - cmp r0, 0 - beq _08095660 - adds r0, r4, 0 - movs r1, 0x20 - bl sub_8097978 - movs r0, 0x2 - strh r0, [r4, 0x32] -_08095660: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8095644 - - thumb_func_start sub_8095668 -sub_8095668: @ 8095668 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r2, [r4, 0x1] - lsls r1, r2, 26 - lsrs r1, 31 - movs r0, 0x1 - eors r1, r0 - lsls r1, 5 - subs r0, 0x22 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x1] - adds r0, r5, 0 - bl sub_809797C - lsls r0, 24 - cmp r0, 0 - beq _0809569A - ldrb r0, [r4, 0x1] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r4, 0x1] - movs r0, 0x3 - strh r0, [r5, 0x32] -_0809569A: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095668 - - thumb_func_start sub_80956A4 -sub_80956A4: @ 80956A4 - ldrb r2, [r0, 0x3] - movs r3, 0x4 - orrs r2, r3 - strb r2, [r0, 0x3] - movs r0, 0x1 - strh r0, [r1, 0x32] - bx lr - thumb_func_end sub_80956A4 - - thumb_func_start sub_80956B4 -sub_80956B4: @ 80956B4 - ldrb r3, [r0, 0x3] - movs r2, 0x5 - negs r2, r2 - ands r2, r3 - strb r2, [r0, 0x3] - movs r0, 0x1 - strh r0, [r1, 0x32] - bx lr - thumb_func_end sub_80956B4 - - thumb_func_start sub_80956C4 -sub_80956C4: @ 80956C4 - push {r4,lr} - adds r4, r1, 0 - ldrb r0, [r4, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r4, 0x1] - adds r0, r4, 0 - bl obj_alloc_rotscale_entry - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - adds r4, 0x42 - ldrb r1, [r4] - movs r0, 0x3F - ands r0, r1 - strb r0, [r4] - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80956C4 - - thumb_func_start sub_80956F4 -sub_80956F4: @ 80956F4 - push {r4,lr} - adds r4, r1, 0 - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - ldrb r0, [r4, 0x1] - movs r1, 0x4 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x1] - lsrs r1, 6 - ldrb r2, [r4, 0x3] - lsrs r2, 6 - movs r3, 0 - adds r0, r4, 0 - bl CalcVecFromObjectCenterToObjectUpperLeft - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80956F4 - - thumb_func_start sub_8095724 -sub_8095724: @ 8095724 - ldrb r1, [r0, 0x3] - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0, 0x3] - movs r0, 0x1 - bx lr - thumb_func_end sub_8095724 - - thumb_func_start sub_8095730 -sub_8095730: @ 8095730 - ldrb r2, [r0, 0x3] - movs r1, 0x9 - negs r1, r1 - ands r1, r2 - strb r1, [r0, 0x3] - movs r0, 0x1 - bx lr - thumb_func_end sub_8095730 - - thumb_func_start sub_8095740 -sub_8095740: @ 8095740 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r2, 0x1 - bl sub_8093B60 - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0 - bl StartObjectRotScalAnimIfDifferent - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8095774 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095740 - - thumb_func_start sub_8095774 -sub_8095774: @ 8095774 - push {r4,lr} - adds r4, r1, 0 - bl an_walk_any_2 - lsls r0, 24 - cmp r0, 0 - bne _08095786 - movs r0, 0 - b _08095798 -_08095786: - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08095798: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8095774 - - thumb_func_start sub_80957A0 -sub_80957A0: @ 80957A0 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r2, 0x1 - bl sub_8093B60 - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80082F0 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_80957D4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80957A0 - - thumb_func_start sub_80957D4 -sub_80957D4: @ 80957D4 - push {r4,lr} - adds r4, r1, 0 - bl an_walk_any_2 - lsls r0, 24 - cmp r0, 0 - bne _080957E6 - movs r0, 0 - b _080957F8 -_080957E6: - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080957F8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80957D4 - - thumb_func_start sub_8095800 -sub_8095800: @ 8095800 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r2, 0x3 - movs r3, 0x1 - bl do_go_anim - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x2 - bl sub_80082F0 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8095834 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095800 - - thumb_func_start sub_8095834 -sub_8095834: @ 8095834 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08095846 - movs r0, 0 - b _08095858 -_08095846: - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08095858: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8095834 - - thumb_func_start sub_8095860 -sub_8095860: @ 8095860 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r2, 0x4 - movs r3, 0x1 - bl do_go_anim - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x3 - bl sub_80082F0 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8095894 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095860 - - thumb_func_start sub_8095894 -sub_8095894: @ 8095894 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _080958A6 - movs r0, 0 - b _080958B8 -_080958A6: - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080958B8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8095894 - - thumb_func_start sub_80958C0 -sub_80958C0: @ 80958C0 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - lsls r4, r2, 24 - lsrs r4, 24 - adds r1, r4, 0 - bl FieldObjectSetDirection - adds r0, r5, 0 - bl npc_coords_shift_still - adds r0, r4, 0 - bl sub_80929FC - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r5, 0 - adds r1, r6, 0 - bl obj_npc_animation_step - adds r2, r6, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x1 - strh r0, [r6, 0x32] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80958C0 - - thumb_func_start sub_8095900 -sub_8095900: @ 8095900 - push {lr} - movs r2, 0x1 - bl sub_80958C0 - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_8095900 - - thumb_func_start sub_8095910 -sub_8095910: @ 8095910 - push {lr} - movs r2, 0x2 - bl sub_80958C0 - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_8095910 - - thumb_func_start sub_8095920 -sub_8095920: @ 8095920 - push {lr} - movs r2, 0x3 - bl sub_80958C0 - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_8095920 - - thumb_func_start sub_8095930 -sub_8095930: @ 8095930 - push {lr} - movs r2, 0x4 - bl sub_80958C0 - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_8095930 - - thumb_func_start sub_8095940 -sub_8095940: @ 8095940 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - bl sub_80929BC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095940 - - thumb_func_start sub_8095964 -sub_8095964: @ 8095964 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - bl sub_80929BC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095964 - - thumb_func_start sub_8095988 -sub_8095988: @ 8095988 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x3 - bl sub_80929BC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x3 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095988 - - thumb_func_start sub_80959AC -sub_80959AC: @ 80959AC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x4 - bl sub_80929BC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x4 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80959AC - - thumb_func_start sub_80959D0 -sub_80959D0: @ 80959D0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - bl sub_80929DC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80959D0 - - thumb_func_start sub_80959F4 -sub_80959F4: @ 80959F4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - bl sub_80929DC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80959F4 - - thumb_func_start sub_8095A18 -sub_8095A18: @ 8095A18 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x3 - bl sub_80929DC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x3 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095A18 - - thumb_func_start sub_8095A3C -sub_8095A3C: @ 8095A3C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x4 - bl sub_80929DC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x4 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095A3C - - thumb_func_start sub_8095A60 -sub_8095A60: @ 8095A60 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - bl sub_80929EC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095A60 - - thumb_func_start sub_8095A84 -sub_8095A84: @ 8095A84 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - bl sub_80929EC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095A84 - - thumb_func_start sub_8095AA8 -sub_8095AA8: @ 8095AA8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x3 - bl sub_80929EC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x3 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095AA8 - - thumb_func_start sub_8095ACC -sub_8095ACC: @ 8095ACC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x4 - bl sub_80929EC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x4 - bl npc_set_direction_and_anim__an_proceed - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095ACC - - thumb_func_start sub_8095AF0 -sub_8095AF0: @ 8095AF0 - push {r4,lr} - adds r4, r1, 0 - adds r0, r4, 0 - bl sub_8097750 - adds r4, 0x2C - ldrb r1, [r4] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r4] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8095AF0 - - thumb_func_start sub_8095B0C -sub_8095B0C: @ 8095B0C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r0, r5, 0 - bl sub_8097758 - lsls r0, 24 - cmp r0, 0 - bne _08095B22 - movs r0, 0 - b _08095B3E -_08095B22: - adds r0, r4, 0 - bl npc_coords_shift_still - ldrb r0, [r4] - movs r1, 0x8 - orrs r0, r1 - strb r0, [r4] - adds r2, r5, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x1 -_08095B3E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095B0C - - thumb_func_start sub_8095B44 -sub_8095B44: @ 8095B44 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - bl sub_8095AF0 - movs r0, 0x1 - strh r0, [r4, 0x32] - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8095B64 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095B44 - - thumb_func_start sub_8095B64 -sub_8095B64: @ 8095B64 - push {r4,lr} - adds r4, r1, 0 - bl sub_8095B0C - lsls r0, 24 - cmp r0, 0 - bne _08095B76 - movs r0, 0 - b _08095B7C -_08095B76: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08095B7C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8095B64 - - thumb_func_start sub_8095B84 -sub_8095B84: @ 8095B84 - push {r4-r6,lr} - sub sp, 0x4 - adds r6, r0, 0 - adds r5, r1, 0 - adds r4, r2, 0 - ldr r0, [sp, 0x14] - lsls r4, 24 - lsrs r4, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - adds r0, r6, 0 - adds r2, r4, 0 - bl sub_8093FC4 - adds r0, r4, 0 - bl sub_80929BC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl StartObjectImageAnimIfDifferent - adds r0, r6, 0 - bl DoShadowFieldEffect - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8095B84 - - thumb_func_start sub_8095BC8 -sub_8095BC8: @ 8095BC8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095BF4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095BC8 - - thumb_func_start sub_8095BF4 -sub_8095BF4: @ 8095BF4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095C08 - movs r0, 0 - b _08095C18 -_08095C08: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095C18: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095BF4 - - thumb_func_start sub_8095C20 -sub_8095C20: @ 8095C20 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095C4C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095C20 - - thumb_func_start sub_8095C4C -sub_8095C4C: @ 8095C4C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095C60 - movs r0, 0 - b _08095C70 -_08095C60: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095C70: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095C4C - - thumb_func_start sub_8095C78 -sub_8095C78: @ 8095C78 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x3 - movs r3, 0 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095CA4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095C78 - - thumb_func_start sub_8095CA4 -sub_8095CA4: @ 8095CA4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095CB8 - movs r0, 0 - b _08095CC8 -_08095CB8: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095CC8: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095CA4 - - thumb_func_start sub_8095CD0 -sub_8095CD0: @ 8095CD0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x4 - movs r3, 0 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095CFC - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095CD0 - - thumb_func_start sub_8095CFC -sub_8095CFC: @ 8095CFC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095D10 - movs r0, 0 - b _08095D20 -_08095D10: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095D20: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095CFC - - thumb_func_start sub_8095D28 -sub_8095D28: @ 8095D28 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x1 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095D54 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095D28 - - thumb_func_start sub_8095D54 -sub_8095D54: @ 8095D54 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095D68 - movs r0, 0 - b _08095D78 -_08095D68: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095D78: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095D54 - - thumb_func_start sub_8095D80 -sub_8095D80: @ 8095D80 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0x1 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095DAC - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095D80 - - thumb_func_start sub_8095DAC -sub_8095DAC: @ 8095DAC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095DC0 - movs r0, 0 - b _08095DD0 -_08095DC0: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095DD0: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095DAC - - thumb_func_start sub_8095DD8 -sub_8095DD8: @ 8095DD8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x3 - movs r3, 0x1 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095E04 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095DD8 - - thumb_func_start sub_8095E04 -sub_8095E04: @ 8095E04 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095E18 - movs r0, 0 - b _08095E28 -_08095E18: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095E28: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095E04 - - thumb_func_start sub_8095E30 -sub_8095E30: @ 8095E30 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x4 - movs r3, 0x1 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095E5C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095E30 - - thumb_func_start sub_8095E5C -sub_8095E5C: @ 8095E5C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095E70 - movs r0, 0 - b _08095E80 -_08095E70: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095E80: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095E5C - - thumb_func_start sub_8095E88 -sub_8095E88: @ 8095E88 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x2 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095EB4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095E88 - - thumb_func_start sub_8095EB4 -sub_8095EB4: @ 8095EB4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095EC8 - movs r0, 0 - b _08095ED8 -_08095EC8: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095ED8: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095EB4 - - thumb_func_start sub_8095EE0 -sub_8095EE0: @ 8095EE0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0x2 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095F0C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095EE0 - - thumb_func_start sub_8095F0C -sub_8095F0C: @ 8095F0C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095F20 - movs r0, 0 - b _08095F30 -_08095F20: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095F30: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095F0C - - thumb_func_start sub_8095F38 -sub_8095F38: @ 8095F38 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x3 - movs r3, 0x2 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095F64 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095F38 - - thumb_func_start sub_8095F64 -sub_8095F64: @ 8095F64 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095F78 - movs r0, 0 - b _08095F88 -_08095F78: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095F88: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095F64 - - thumb_func_start sub_8095F90 -sub_8095F90: @ 8095F90 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x4 - movs r3, 0x2 - bl sub_8095B84 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8095FBC - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095F90 - - thumb_func_start sub_8095FBC -sub_8095FBC: @ 8095FBC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_80941B0 - lsls r0, 24 - cmp r0, 0 - bne _08095FD0 - movs r0, 0 - b _08095FE0 -_08095FD0: - ldrb r0, [r4, 0x2] - movs r1, 0x41 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x2] - movs r0, 0x2 - strh r0, [r5, 0x32] - movs r0, 0x1 -_08095FE0: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095FBC - - thumb_func_start sub_8095FE8 -sub_8095FE8: @ 8095FE8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x1 - bl sub_80929FC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x8 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8095FE8 - - thumb_func_start sub_8096020 -sub_8096020: @ 8096020 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x2 - bl sub_80929FC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x8 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8096020 - - thumb_func_start sub_8096058 -sub_8096058: @ 8096058 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x3 - bl sub_80929FC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x8 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x3 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8096058 - - thumb_func_start sub_8096090 -sub_8096090: @ 8096090 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - movs r0, 0x4 - bl sub_80929FC - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x8 - str r0, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x4 - bl sub_8094554 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809459C - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8096090 - - thumb_func_start sub_80960C8 -sub_80960C8: @ 80960C8 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - bl npc_apply_direction - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl sub_80929BC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - adds r0, r4, 0 - movs r1, 0 - bl SeekObjectImageAnim - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80960C8 - - thumb_func_start sub_8096100 -sub_8096100: @ 8096100 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x1 - movs r3, 0x1 - bl sub_80960C8 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8096120 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8096100 - - thumb_func_start sub_8096120 -sub_8096120: @ 8096120 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08096132 - movs r0, 0 - b _08096138 -_08096132: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08096138: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8096120 - - thumb_func_start sub_8096140 -sub_8096140: @ 8096140 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x2 - movs r3, 0x1 - bl sub_80960C8 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8096160 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8096140 - - thumb_func_start sub_8096160 -sub_8096160: @ 8096160 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08096172 - movs r0, 0 - b _08096178 -_08096172: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08096178: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8096160 - - thumb_func_start sub_8096180 -sub_8096180: @ 8096180 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x3 - movs r3, 0x1 - bl sub_80960C8 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80961A0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8096180 - - thumb_func_start sub_80961A0 -sub_80961A0: @ 80961A0 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _080961B2 - movs r0, 0 - b _080961B8 -_080961B2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080961B8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80961A0 - - thumb_func_start sub_80961C0 -sub_80961C0: @ 80961C0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x4 - movs r3, 0x1 - bl sub_80960C8 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80961E0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80961C0 - - thumb_func_start sub_80961E0 -sub_80961E0: @ 80961E0 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _080961F2 - movs r0, 0 - b _080961F8 -_080961F2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080961F8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80961E0 - - thumb_func_start sub_8096200 -sub_8096200: @ 8096200 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - bl npc_apply_direction - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl sub_80929FC - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl npc_apply_anim_looping - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8096200 - - thumb_func_start sub_8096230 -sub_8096230: @ 8096230 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x1 - movs r3, 0x1 - bl sub_8096200 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8096250 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8096230 - - thumb_func_start sub_8096250 -sub_8096250: @ 8096250 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08096262 - movs r0, 0 - b _08096268 -_08096262: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08096268: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8096250 - - thumb_func_start sub_8096270 -sub_8096270: @ 8096270 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x2 - movs r3, 0x1 - bl sub_8096200 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8096290 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8096270 - - thumb_func_start sub_8096290 -sub_8096290: @ 8096290 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _080962A2 - movs r0, 0 - b _080962A8 -_080962A2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080962A8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8096290 - - thumb_func_start sub_80962B0 -sub_80962B0: @ 80962B0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x3 - movs r3, 0x1 - bl sub_8096200 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80962D0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80962B0 - - thumb_func_start sub_80962D0 -sub_80962D0: @ 80962D0 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _080962E2 - movs r0, 0 - b _080962E8 -_080962E2: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080962E8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80962D0 - - thumb_func_start sub_80962F0 -sub_80962F0: @ 80962F0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x4 - movs r3, 0x1 - bl sub_8096200 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8096310 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80962F0 - - thumb_func_start sub_8096310 -sub_8096310: @ 8096310 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _08096322 - movs r0, 0 - b _08096328 -_08096322: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08096328: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8096310 - - thumb_func_start sub_8096330 -sub_8096330: @ 8096330 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - bl npc_apply_direction - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl sub_80929DC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - adds r0, r4, 0 - movs r1, 0 - bl SeekObjectImageAnim - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8096330 - - thumb_func_start sub_8096368 -sub_8096368: @ 8096368 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x1 - movs r3, 0x1 - bl sub_8096330 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8096388 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8096368 - - thumb_func_start sub_8096388 -sub_8096388: @ 8096388 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _0809639A - movs r0, 0 - b _080963A0 -_0809639A: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080963A0: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8096388 - - thumb_func_start sub_80963A8 -sub_80963A8: @ 80963A8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x2 - movs r3, 0x1 - bl sub_8096330 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80963C8 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80963A8 - - thumb_func_start sub_80963C8 -sub_80963C8: @ 80963C8 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _080963DA - movs r0, 0 - b _080963E0 -_080963DA: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_080963E0: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80963C8 - - thumb_func_start sub_80963E8 -sub_80963E8: @ 80963E8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x3 - movs r3, 0x1 - bl sub_8096330 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8096408 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80963E8 - - thumb_func_start sub_8096408 -sub_8096408: @ 8096408 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _0809641A - movs r0, 0 - b _08096420 -_0809641A: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08096420: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8096408 - - thumb_func_start sub_8096428 -sub_8096428: @ 8096428 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x4 - movs r3, 0x1 - bl sub_8096330 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8096448 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8096428 - - thumb_func_start sub_8096448 -sub_8096448: @ 8096448 - push {r4,lr} - adds r4, r1, 0 - bl npc_obj_ministep_stop_on_arrival - lsls r0, 24 - cmp r0, 0 - bne _0809645A - movs r0, 0 - b _08096460 -_0809645A: - movs r0, 0x2 - strh r0, [r4, 0x32] - movs r0, 0x1 -_08096460: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8096448 - - thumb_func_start sub_8096468 -sub_8096468: @ 8096468 - push {r4,lr} - adds r4, r1, 0 - bl sub_8097FA4 - movs r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8096468 - - thumb_func_start sub_809647C -sub_809647C: @ 809647C - push {r4,lr} - adds r4, r1, 0 - ldrb r0, [r0, 0x1B] - bl sub_8098044 - movs r0, 0 - strh r0, [r4, 0x26] - movs r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_809647C - - thumb_func_start sub_8096494 -sub_8096494: @ 8096494 - push {r4,lr} - adds r2, r0, 0 - adds r4, r1, 0 - movs r1, 0x26 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080964A6 - movs r0, 0 - b _080964B0 -_080964A6: - ldrb r0, [r2, 0x1B] - bl sub_8098044 - movs r0, 0x1 - strh r0, [r4, 0x32] -_080964B0: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8096494 - - thumb_func_start sub_80964B8 -sub_80964B8: @ 80964B8 - movs r0, 0x1 - bx lr - thumb_func_end sub_80964B8 - - thumb_func_start sub_80964BC -@ bool8 sub_80964BC(struct npc_state *fieldObject, struct obj *object) -sub_80964BC: @ 80964BC - adds r1, 0x2C - ldrb r0, [r1] - movs r2, 0x40 - orrs r0, r2 - strb r0, [r1] - movs r0, 0x1 - bx lr - thumb_func_end sub_80964BC - - thumb_func_start npc_obj_transfer_image_anim_pause_flag -@ void npc_obj_transfer_image_anim_pause_flag(struct npc_state *fieldObject, struct obj *object) -npc_obj_transfer_image_anim_pause_flag: @ 80964CC - push {lr} - ldrb r0, [r0, 0x1] - lsls r0, 29 - cmp r0, 0 - bge _080964E2 - adds r0, r1, 0 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] -_080964E2: - pop {r0} - bx r0 - thumb_func_end npc_obj_transfer_image_anim_pause_flag - - thumb_func_start sub_80964E8 -@ void sub_80964E8(struct npc_state *fieldObject, struct obj *object) -sub_80964E8: @ 80964E8 - push {r4,lr} - adds r4, r0, 0 - ldrb r3, [r4, 0x1] - lsls r0, r3, 28 - cmp r0, 0 - bge _08096510 - adds r2, r1, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - movs r1, 0x9 - negs r1, r1 - ands r0, r1 - strb r0, [r4, 0x1] -_08096510: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80964E8 - - thumb_func_start sub_8096518 -@ void sub_8096518(struct npc_state *fieldObject, struct obj *object) -sub_8096518: @ 8096518 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl sub_8096530 - adds r0, r4, 0 - adds r1, r5, 0 - bl npc_update_obj_anim_flag - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8096518 - - thumb_func_start sub_8096530 -sub_8096530: @ 8096530 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r1, 0 - ldrb r1, [r5, 0x1] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r5, 0x1] - ldrb r0, [r5, 0x5] - bl GetFieldObjectGraphicsInfo - adds r6, r0, 0 - adds r0, r4, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08096594 - ldrh r1, [r4, 0x24] - ldrh r0, [r4, 0x20] - adds r1, r0 - adds r0, r4, 0 - adds r0, 0x28 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldr r2, =0x02021bbc - adds r0, r1 - ldrh r2, [r2] - adds r0, r2 - lsls r0, 16 - lsrs r3, r0, 16 - ldrh r1, [r4, 0x26] - ldrh r0, [r4, 0x22] - adds r1, r0 - adds r0, r4, 0 - adds r0, 0x29 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldr r2, =0x02021bbe - adds r0, r1 - ldrh r2, [r2] - adds r0, r2 - b _080965BC - .pool -_08096594: - ldrh r1, [r4, 0x24] - ldrh r0, [r4, 0x20] - adds r1, r0 - adds r0, r4, 0 - adds r0, 0x28 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - adds r0, r1 - lsls r0, 16 - lsrs r3, r0, 16 - ldrh r1, [r4, 0x26] - ldrh r0, [r4, 0x22] - adds r1, r0 - adds r0, r4, 0 - adds r0, 0x29 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - adds r0, r1 -_080965BC: - lsls r0, 16 - lsrs r2, r0, 16 - ldrh r0, [r6, 0x8] - adds r0, r3 - lsls r0, 16 - lsrs r1, r0, 16 - ldrh r0, [r6, 0xA] - adds r0, r2 - lsls r0, 16 - lsrs r4, r0, 16 - lsls r0, r3, 16 - asrs r0, 16 - cmp r0, 0xFF - bgt _080965E4 - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bge _080965EC -_080965E4: - ldrb r0, [r5, 0x1] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r5, 0x1] -_080965EC: - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, 0xAF - bgt _08096600 - lsls r0, r4, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bge _08096608 -_08096600: - ldrb r0, [r5, 0x1] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r5, 0x1] -_08096608: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8096530 - - thumb_func_start npc_update_obj_anim_flag -@ void npc_update_obj_anim_flag(struct npc_state *fieldObject, struct obj *object) -npc_update_obj_anim_flag: @ 8096610 - push {lr} - adds r2, r1, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r3, 0x5 - negs r3, r3 - ands r3, r1 - strb r3, [r2] - ldrb r1, [r0, 0x1] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _08096632 - movs r1, 0x4 - adds r0, r3, 0 - orrs r0, r1 - strb r0, [r2] -_08096632: - pop {r0} - bx r0 - thumb_func_end npc_update_obj_anim_flag - - thumb_func_start GetAllGroundEffectFlags_OnSpawn -@ void GetAllGroundEffectFlags_OnSpawn(struct npc_state *fieldObject, u32 *flags) -GetAllGroundEffectFlags_OnSpawn: @ 8096638 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl FieldObjectUpdateMetatileBehaviors - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_Reflection - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_TallGrassOnSpawn - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_LongGrassOnSpawn - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_SandHeap - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_ShallowFlowingWater - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_ShortGrass - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_HotSprings - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end GetAllGroundEffectFlags_OnSpawn - - thumb_func_start GetAllGroundEffectFlags_OnBeginStep -@ void GetAllGroundEffectFlags_OnBeginStep(struct npc_state *fieldObject, u32 *flags) -GetAllGroundEffectFlags_OnBeginStep: @ 8096680 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl FieldObjectUpdateMetatileBehaviors - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_Reflection - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_TallGrassOnBeginStep - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_LongGrassOnBeginStep - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_Tracks - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_SandHeap - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_ShallowFlowingWater - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_Puddle - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_ShortGrass - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_HotSprings - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end GetAllGroundEffectFlags_OnBeginStep - - thumb_func_start GetAllGroundEffectFlags_OnFinishStep -@ void GetAllGroundEffectFlags_OnFinishStep(struct npc_state *fieldObject, u32 *flags) -GetAllGroundEffectFlags_OnFinishStep: @ 80966D8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl FieldObjectUpdateMetatileBehaviors - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_ShallowFlowingWater - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_SandHeap - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_Puddle - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_Ripple - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_ShortGrass - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_HotSprings - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_Seaweed - adds r0, r4, 0 - adds r1, r5, 0 - bl GetGroundEffectFlags_JumpLanding - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end GetAllGroundEffectFlags_OnFinishStep - - thumb_func_start FieldObjectUpdateMetatileBehaviors -@ void FieldObjectUpdateMetatileBehaviors(struct npc_state *fieldObject) -FieldObjectUpdateMetatileBehaviors: @ 8096728 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x14 - ldrsh r0, [r4, r1] - movs r2, 0x16 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - strb r0, [r4, 0x1F] - movs r1, 0x10 - ldrsh r0, [r4, r1] - movs r2, 0x12 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - strb r0, [r4, 0x1E] - pop {r4} - pop {r0} - bx r0 - thumb_func_end FieldObjectUpdateMetatileBehaviors - - thumb_func_start GetGroundEffectFlags_Reflection -@ void GetGroundEffectFlags_Reflection(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_Reflection: @ 8096750 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, =gUnknown_0850E5DC - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp] - str r1, [sp, 0x4] - adds r0, r4, 0 - bl FieldObjectCheckForReflectiveSurface - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _08096798 - ldrb r1, [r4, 0x2] - lsls r0, r1, 30 - cmp r0, 0 - blt _080967A2 - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4, 0x2] - subs r0, r2, 0x1 - lsls r0, 2 - add r0, sp - ldr r1, [r5] - ldr r0, [r0] - orrs r1, r0 - str r1, [r5] - b _080967A2 - .pool -_08096798: - ldrb r1, [r4, 0x2] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x2] -_080967A2: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_Reflection - - thumb_func_start GetGroundEffectFlags_TallGrassOnSpawn -@ void GetGroundEffectFlags_TallGrassOnSpawn(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_TallGrassOnSpawn: @ 80967AC - push {r4,lr} - adds r4, r1, 0 - ldrb r0, [r0, 0x1E] - bl MetatileBehavior_IsTallGrass - lsls r0, 24 - cmp r0, 0 - beq _080967C4 - ldr r0, [r4] - movs r1, 0x1 - orrs r0, r1 - str r0, [r4] -_080967C4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_TallGrassOnSpawn - - thumb_func_start GetGroundEffectFlags_TallGrassOnBeginStep -@ void GetGroundEffectFlags_TallGrassOnBeginStep(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_TallGrassOnBeginStep: @ 80967CC - push {r4,lr} - adds r4, r1, 0 - ldrb r0, [r0, 0x1E] - bl MetatileBehavior_IsTallGrass - lsls r0, 24 - cmp r0, 0 - beq _080967E4 - ldr r0, [r4] - movs r1, 0x2 - orrs r0, r1 - str r0, [r4] -_080967E4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_TallGrassOnBeginStep - - thumb_func_start GetGroundEffectFlags_LongGrassOnSpawn -@ void GetGroundEffectFlags_LongGrassOnSpawn(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_LongGrassOnSpawn: @ 80967EC - push {r4,lr} - adds r4, r1, 0 - ldrb r0, [r0, 0x1E] - bl MetatileBehavior_IsLongGrass - lsls r0, 24 - cmp r0, 0 - beq _08096804 - ldr r0, [r4] - movs r1, 0x4 - orrs r0, r1 - str r0, [r4] -_08096804: - pop {r4} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_LongGrassOnSpawn - - thumb_func_start GetGroundEffectFlags_LongGrassOnBeginStep -@ void GetGroundEffectFlags_LongGrassOnBeginStep(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_LongGrassOnBeginStep: @ 809680C - push {r4,lr} - adds r4, r1, 0 - ldrb r0, [r0, 0x1E] - bl MetatileBehavior_IsLongGrass - lsls r0, 24 - cmp r0, 0 - beq _08096824 - ldr r0, [r4] - movs r1, 0x8 - orrs r0, r1 - str r0, [r4] -_08096824: - pop {r4} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_LongGrassOnBeginStep - - thumb_func_start GetGroundEffectFlags_Tracks -@ void GetGroundEffectFlags_Tracks(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_Tracks: @ 809682C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x1F] - bl MetatileBehavior_IsDeepSand - lsls r0, 24 - cmp r0, 0 - beq _08096846 - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 1 - b _08096862 -_08096846: - ldrb r0, [r4, 0x1F] - bl MetatileBehavior_IsSandOrDeepSand - lsls r0, 24 - cmp r0, 0 - bne _0809685E - ldrb r0, [r4, 0x1F] - bl MetatileBehavior_IsUnusedFootprintMetatile - lsls r0, 24 - cmp r0, 0 - beq _08096866 -_0809685E: - ldr r0, [r5] - movs r1, 0x80 -_08096862: - orrs r0, r1 - str r0, [r5] -_08096866: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_Tracks - - thumb_func_start GetGroundEffectFlags_SandHeap -@ void GetGroundEffectFlags_SandHeap(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_SandHeap: @ 809686C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x1E] - bl MetatileBehavior_IsDeepSand - lsls r0, 24 - cmp r0, 0 - beq _080968AA - ldrb r0, [r4, 0x1F] - bl MetatileBehavior_IsDeepSand - lsls r0, 24 - cmp r0, 0 - beq _080968AA - ldrb r1, [r4, 0x2] - lsls r0, r1, 27 - cmp r0, 0 - blt _080968B4 - movs r0, 0x11 - negs r0, r0 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r4, 0x2] - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 4 - orrs r0, r1 - str r0, [r5] - b _080968B4 -_080968AA: - ldrb r1, [r4, 0x2] - movs r0, 0x11 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x2] -_080968B4: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_SandHeap - - thumb_func_start GetGroundEffectFlags_ShallowFlowingWater -@ void GetGroundEffectFlags_ShallowFlowingWater(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_ShallowFlowingWater: @ 80968BC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x1E] - bl MetatileBehavior_IsShallowFlowingWater - lsls r0, 24 - cmp r0, 0 - beq _080968DA - ldrb r0, [r4, 0x1F] - bl MetatileBehavior_IsShallowFlowingWater - lsls r0, 24 - cmp r0, 0 - bne _080968F2 -_080968DA: - ldrb r0, [r4, 0x1E] - bl MetatileBehavior_IsPacifidlogLog - lsls r0, 24 - cmp r0, 0 - beq _08096910 - ldrb r0, [r4, 0x1F] - bl MetatileBehavior_IsPacifidlogLog - lsls r0, 24 - cmp r0, 0 - beq _08096910 -_080968F2: - ldrb r1, [r4, 0x2] - lsls r0, r1, 28 - cmp r0, 0 - blt _0809691A - movs r0, 0x9 - negs r0, r0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r4, 0x2] - ldr r0, [r5] - movs r1, 0x40 - orrs r0, r1 - str r0, [r5] - b _0809691A -_08096910: - ldrb r1, [r4, 0x2] - movs r0, 0x9 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x2] -_0809691A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_ShallowFlowingWater - - thumb_func_start GetGroundEffectFlags_Puddle -@ void GetGroundEffectFlags_Puddle(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_Puddle: @ 8096920 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x1E] - bl MetatileBehavior_IsPuddle - lsls r0, 24 - cmp r0, 0 - beq _08096948 - ldrb r0, [r4, 0x1F] - bl MetatileBehavior_IsPuddle - lsls r0, 24 - cmp r0, 0 - beq _08096948 - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 3 - orrs r0, r1 - str r0, [r5] -_08096948: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_Puddle - - thumb_func_start GetGroundEffectFlags_Ripple -@ void GetGroundEffectFlags_Ripple(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_Ripple: @ 8096950 - push {r4,lr} - adds r4, r1, 0 - ldrb r0, [r0, 0x1E] - bl MetatileBehavior_HasRipples - lsls r0, 24 - cmp r0, 0 - beq _0809696A - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 2 - orrs r0, r1 - str r0, [r4] -_0809696A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_Ripple - - thumb_func_start GetGroundEffectFlags_ShortGrass -@ void GetGroundEffectFlags_ShortGrass(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_ShortGrass: @ 8096970 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x1E] - bl MetatileBehavior_IsShortGrass - lsls r0, 24 - cmp r0, 0 - beq _080969AE - ldrb r0, [r4, 0x1F] - bl MetatileBehavior_IsShortGrass - lsls r0, 24 - cmp r0, 0 - beq _080969AE - ldrb r1, [r4, 0x2] - lsls r0, r1, 29 - cmp r0, 0 - blt _080969B8 - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4, 0x2] - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 10 - orrs r0, r1 - str r0, [r5] - b _080969B8 -_080969AE: - ldrb r1, [r4, 0x2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x2] -_080969B8: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_ShortGrass - - thumb_func_start GetGroundEffectFlags_HotSprings -@ void GetGroundEffectFlags_HotSprings(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_HotSprings: @ 80969C0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x1E] - bl MetatileBehavior_IsHotSprings - lsls r0, 24 - cmp r0, 0 - beq _080969FE - ldrb r0, [r4, 0x1F] - bl MetatileBehavior_IsHotSprings - lsls r0, 24 - cmp r0, 0 - beq _080969FE - ldrb r1, [r4, 0x2] - lsls r0, r1, 26 - cmp r0, 0 - blt _08096A08 - movs r0, 0x21 - negs r0, r0 - ands r0, r1 - movs r1, 0x20 - orrs r0, r1 - strb r0, [r4, 0x2] - ldr r0, [r5] - movs r1, 0x80 - lsls r1, 11 - orrs r0, r1 - str r0, [r5] - b _08096A08 -_080969FE: - ldrb r1, [r4, 0x2] - movs r0, 0x21 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x2] -_08096A08: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_HotSprings - - thumb_func_start GetGroundEffectFlags_Seaweed -@ void GetGroundEffectFlags_Seaweed(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_Seaweed: @ 8096A10 - push {r4,lr} - adds r4, r1, 0 - ldrb r0, [r0, 0x1E] - bl MetatileBehavior_IsSeaweed - lsls r0, 24 - cmp r0, 0 - beq _08096A2A - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 12 - orrs r0, r1 - str r0, [r4] -_08096A2A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_Seaweed - - thumb_func_start GetGroundEffectFlags_JumpLanding -@ void GetGroundEffectFlags_JumpLanding(struct npc_state *fieldObject, u32 *flags) -GetGroundEffectFlags_JumpLanding: @ 8096A30 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r0, 0 - adds r6, r1, 0 - ldr r0, [r7] - ldr r1, =0x02000020 - ands r0, r1 - cmp r0, 0x20 - bne _08096A82 - movs r5, 0 - ldr r0, =gUnknown_0850E5E4 - mov r8, r0 -_08096A4A: - lsls r4, r5, 2 - mov r0, r8 - adds r1, r4, r0 - ldrb r0, [r7, 0x1E] - ldr r1, [r1] - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - beq _08096A78 - ldr r0, =gUnknown_0850E5FC - adds r0, r4, r0 - ldr r1, [r6] - ldr r0, [r0] - orrs r1, r0 - str r1, [r6] - b _08096A82 - .pool -_08096A78: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _08096A4A -_08096A82: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end GetGroundEffectFlags_JumpLanding - - thumb_func_start FieldObjectCheckForReflectiveSurface -@ u8 FieldObjectCheckForReflectiveSurface(struct npc_state *fieldObject) -FieldObjectCheckForReflectiveSurface: @ 8096A8C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r5, r0, 0 - ldrb r0, [r5, 0x5] - bl GetFieldObjectGraphicsInfo - movs r2, 0x8 - ldrsh r1, [r0, r2] - adds r1, 0x8 - lsls r1, 12 - lsrs r1, 16 - str r1, [sp] - movs r1, 0xA - ldrsh r0, [r0, r1] - adds r0, 0x8 - lsls r0, 12 - movs r4, 0 - lsrs r2, r0, 16 - str r2, [sp, 0x4] - asrs r0, 16 - cmp r4, r0 - blt _08096AC2 - b _08096BC8 -_08096AC2: - movs r0, 0x1 - mov r10, r0 -_08096AC6: - movs r1, 0x10 - ldrsh r0, [r5, r1] - movs r2, 0x12 - ldrsh r1, [r5, r2] - add r1, r10 - lsls r4, 16 - asrs r6, r4, 16 - adds r1, r6 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl GetReflectionTypeByMetatileBehavior - lsls r0, 24 - lsrs r0, 24 - mov r9, r4 - cmp r0, 0 - bne _08096BCA - movs r1, 0x14 - ldrsh r0, [r5, r1] - movs r2, 0x16 - ldrsh r1, [r5, r2] - add r1, r10 - adds r1, r6 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl GetReflectionTypeByMetatileBehavior - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08096BCA - movs r2, 0x1 - ldr r1, [sp] - lsls r0, r1, 16 - asrs r1, r0, 16 - mov r8, r0 - cmp r2, r1 - bge _08096BB6 - movs r0, 0x80 - lsls r0, 9 - asrs r7, r0, 16 -_08096B20: - movs r1, 0x10 - ldrsh r0, [r5, r1] - lsls r1, r2, 16 - asrs r4, r1, 16 - adds r0, r4 - movs r2, 0x12 - ldrsh r1, [r5, r2] - adds r1, r7 - adds r1, r6 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl GetReflectionTypeByMetatileBehavior - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08096BCA - movs r1, 0x10 - ldrsh r0, [r5, r1] - subs r0, r4 - movs r2, 0x12 - ldrsh r1, [r5, r2] - adds r1, r7 - adds r1, r6 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl GetReflectionTypeByMetatileBehavior - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08096BCA - movs r1, 0x14 - ldrsh r0, [r5, r1] - adds r0, r4 - movs r2, 0x16 - ldrsh r1, [r5, r2] - adds r1, r7 - adds r1, r6 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl GetReflectionTypeByMetatileBehavior - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08096BCA - movs r1, 0x14 - ldrsh r0, [r5, r1] - subs r0, r4 - movs r2, 0x16 - ldrsh r1, [r5, r2] - adds r1, r7 - adds r1, r6 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl GetReflectionTypeByMetatileBehavior - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08096BCA - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r0, r8 - blt _08096B20 -_08096BB6: - movs r1, 0x80 - lsls r1, 9 - add r1, r9 - lsrs r4, r1, 16 - ldr r2, [sp, 0x4] - lsls r0, r2, 16 - cmp r1, r0 - bge _08096BC8 - b _08096AC6 -_08096BC8: - movs r0, 0 -_08096BCA: - 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 FieldObjectCheckForReflectiveSurface - - thumb_func_start GetReflectionTypeByMetatileBehavior -@ u8 GetReflectionTypeByMetatileBehavior(u8 metatileBehavior) -GetReflectionTypeByMetatileBehavior: @ 8096BDC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl MetatileBehavior_IsIce - lsls r0, 24 - cmp r0, 0 - beq _08096BF2 - movs r0, 0x1 - b _08096C04 -_08096BF2: - adds r0, r4, 0 - bl MetatileBehavior_IsReflective - lsls r0, 24 - cmp r0, 0 - bne _08096C02 - movs r0, 0 - b _08096C04 -_08096C02: - movs r0, 0x2 -_08096C04: - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetReflectionTypeByMetatileBehavior - - thumb_func_start GetLedgeJumpDirection -@ u8 GetLedgeJumpDirection(u16 x, u16 y, u8 direction) -GetLedgeJumpDirection: @ 8096C0C - push {r4,lr} - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r4, r2, 24 - cmp r4, 0 - beq _08096C52 - cmp r4, 0x4 - bls _08096C28 - subs r0, r4, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 -_08096C28: - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r3, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_0850E614 - lsls r1, r4, 2 - adds r1, r2 - ldr r1, [r1] - bl _call_via_r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08096C5C -_08096C52: - movs r0, 0 - b _08096C62 - .pool -_08096C5C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r0, 24 -_08096C62: - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetLedgeJumpDirection - - thumb_func_start FieldObjectSetSpriteOamTableForLongGrass -@ void FieldObjectSetSpriteOamTableForLongGrass(struct npc_state *fieldObject, struct obj *object) -FieldObjectSetSpriteOamTableForLongGrass: @ 8096C68 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r1, 0 - ldrb r0, [r5] - lsls r0, 27 - cmp r0, 0 - blt _08096CBC - ldrb r0, [r5, 0x1E] - bl MetatileBehavior_IsLongGrass - lsls r0, 24 - cmp r0, 0 - beq _08096CBC - ldrb r0, [r5, 0x1F] - bl MetatileBehavior_IsLongGrass - lsls r0, 24 - cmp r0, 0 - beq _08096CBC - adds r4, 0x42 - ldrb r1, [r4] - movs r6, 0x40 - negs r6, r6 - adds r0, r6, 0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4] - ldrb r0, [r5, 0xB] - lsrs r0, 4 - bl ZCoordToPriority - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08096CBC - ldrb r0, [r4] - adds r1, r6, 0 - ands r1, r0 - movs r0, 0x5 - orrs r1, r0 - strb r1, [r4] -_08096CBC: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end FieldObjectSetSpriteOamTableForLongGrass - - thumb_func_start IsZCoordMismatchAt -@ bool8 IsZCoordMismatchAt(u8 z, u16 x, u16 y) -IsZCoordMismatchAt: @ 8096CC4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 16 - lsrs r0, r1, 16 - lsls r2, 16 - lsrs r1, r2, 16 - cmp r4, 0 - beq _08096CF2 - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl MapGridGetZCoordAt - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _08096CF2 - cmp r0, 0xF - beq _08096CF2 - cmp r0, r4 - bne _08096CF6 -_08096CF2: - movs r0, 0 - b _08096CF8 -_08096CF6: - movs r0, 0x1 -_08096CF8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end IsZCoordMismatchAt - - thumb_func_start FieldObjectUpdateZCoordAndPriority -@ void FieldObjectUpdateZCoordAndPriority(struct npc_state *fieldObject, struct obj *object) -FieldObjectUpdateZCoordAndPriority: @ 8096D00 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x3] - lsls r0, 29 - cmp r0, 0 - blt _08096D4E - adds r0, r4, 0 - bl FieldObjectUpdateZCoord - ldr r1, =gUnknown_0850E644 - ldrb r2, [r4, 0xB] - lsls r2, 24 - lsrs r0, r2, 28 - adds r0, r1 - ldrb r0, [r0] - adds r4, r5, 0 - adds r4, 0x42 - movs r1, 0x3F - ands r1, r0 - ldrb r3, [r4] - movs r0, 0x40 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r4] - ldr r0, =gUnknown_0850E634 - lsrs r2, 28 - adds r2, r0 - movs r0, 0x3 - ldrb r1, [r2] - ands r1, r0 - lsls r1, 2 - ldrb r2, [r5, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] -_08096D4E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectUpdateZCoordAndPriority - - thumb_func_start InitObjectPriorityByZCoord -@ void InitObjectPriorityByZCoord(struct obj *object, u8 z) -InitObjectPriorityByZCoord: @ 8096D5C - push {r4,lr} - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_0850E644 - adds r2, r1, r2 - ldrb r2, [r2] - movs r3, 0x42 - adds r3, r0 - mov r12, r3 - movs r3, 0x3F - ands r3, r2 - mov r2, r12 - ldrb r4, [r2] - movs r2, 0x40 - negs r2, r2 - ands r2, r4 - orrs r2, r3 - mov r3, r12 - strb r2, [r3] - ldr r2, =gUnknown_0850E634 - adds r1, r2 - movs r3, 0x3 - ldrb r2, [r1] - ands r2, r3 - lsls r2, 2 - ldrb r3, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r3 - orrs r1, r2 - strb r1, [r0, 0x5] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end InitObjectPriorityByZCoord - - thumb_func_start ZCoordToPriority -@ u8 ZCoordToPriority(u8 z) -ZCoordToPriority: @ 8096DA8 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0850E634 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end ZCoordToPriority - - thumb_func_start FieldObjectUpdateZCoord -@ void FieldObjectUpdateZCoord(struct npc_state *fieldObject) -FieldObjectUpdateZCoord: @ 8096DB8 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x10 - ldrsh r0, [r4, r1] - movs r2, 0x12 - ldrsh r1, [r4, r2] - bl MapGridGetZCoordAt - lsls r0, 24 - lsrs r5, r0, 24 - movs r1, 0x14 - ldrsh r0, [r4, r1] - movs r2, 0x16 - ldrsh r1, [r4, r2] - bl MapGridGetZCoordAt - lsls r0, 24 - lsrs r0, 24 - cmp r5, 0xF - beq _08096E06 - cmp r0, 0xF - beq _08096E06 - movs r3, 0xF - adds r0, r5, 0 - ands r0, r3 - ldrb r1, [r4, 0xB] - movs r2, 0x10 - negs r2, r2 - ands r2, r1 - orrs r2, r0 - strb r2, [r4, 0xB] - cmp r5, 0 - beq _08096E06 - cmp r5, 0xF - beq _08096E06 - lsls r0, r5, 4 - ands r2, r3 - orrs r2, r0 - strb r2, [r4, 0xB] -_08096E06: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end FieldObjectUpdateZCoord - - thumb_func_start SetObjectSubpriorityByZCoord -@ void SetObjectSubpriorityByZCoord(u8 z, struct obj *object, u8 offset) -SetObjectSubpriorityByZCoord: @ 8096E0C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - adds r3, r1, 0 - adds r3, 0x29 - movs r5, 0 - ldrsb r5, [r3, r5] - ldrh r4, [r1, 0x22] - ldr r3, =0x02021bbe - subs r4, r5 - ldrh r3, [r3] - adds r4, r3 - adds r4, 0x8 - movs r3, 0xFF - ands r4, r3 - lsrs r4, 4 - movs r3, 0x10 - subs r3, r4 - lsls r3, 17 - ldr r4, =gUnknown_0850E624 - adds r0, r4 - lsrs r3, 16 - ldrb r0, [r0] - adds r3, r0 - adds r2, r3 - adds r1, 0x43 - strb r2, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end SetObjectSubpriorityByZCoord - - thumb_func_start FieldObjectUpdateSubpriority -@ void FieldObjectUpdateSubpriority(struct npc_state *fieldObject, struct obj *object) -FieldObjectUpdateSubpriority: @ 8096E54 - push {lr} - adds r2, r0, 0 - ldrb r0, [r2, 0x3] - lsls r0, 29 - cmp r0, 0 - blt _08096E6A - ldrb r0, [r2, 0xB] - lsrs r0, 4 - movs r2, 0x1 - bl SetObjectSubpriorityByZCoord -_08096E6A: - pop {r0} - bx r0 - thumb_func_end FieldObjectUpdateSubpriority - - thumb_func_start AreZCoordsCompatible -@ bool8 AreZCoordsCompatible(u8 z1, u8 z2) -AreZCoordsCompatible: @ 8096E70 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r0, 0 - beq _08096E86 - cmp r1, 0 - beq _08096E86 - cmp r0, r1 - bne _08096E8A -_08096E86: - movs r0, 0x1 - b _08096E8C -_08096E8A: - movs r0, 0 -_08096E8C: - pop {r1} - bx r1 - thumb_func_end AreZCoordsCompatible - - thumb_func_start GroundEffect_SpawnOnTallGrass -@ void GroundEffect_SpawnOnTallGrass(struct npc_state *fieldObject, struct obj *object) -GroundEffect_SpawnOnTallGrass: @ 8096E90 - push {lr} - ldr r3, =0x02038c08 - movs r2, 0x10 - ldrsh r1, [r0, r2] - str r1, [r3] - movs r2, 0x12 - ldrsh r1, [r0, r2] - str r1, [r3, 0x4] - ldrb r1, [r0, 0xB] - lsrs r1, 4 - str r1, [r3, 0x8] - movs r1, 0x2 - str r1, [r3, 0xC] - ldrb r1, [r0, 0x8] - lsls r1, 8 - ldrb r2, [r0, 0x9] - orrs r1, r2 - str r1, [r3, 0x10] - ldrb r0, [r0, 0xA] - str r0, [r3, 0x14] - ldr r0, =0x03005d8c - ldr r1, [r0] - ldrb r0, [r1, 0x5] - lsls r0, 8 - ldrb r1, [r1, 0x4] - orrs r0, r1 - str r0, [r3, 0x18] - movs r0, 0x1 - str r0, [r3, 0x1C] - movs r0, 0x4 - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_SpawnOnTallGrass - - thumb_func_start GroundEffect_StepOnTallGrass -@ void GroundEffect_StepOnTallGrass(struct npc_state *fieldObject, struct obj *object) -GroundEffect_StepOnTallGrass: @ 8096EDC - push {lr} - ldr r3, =0x02038c08 - movs r2, 0x10 - ldrsh r1, [r0, r2] - str r1, [r3] - movs r2, 0x12 - ldrsh r1, [r0, r2] - str r1, [r3, 0x4] - ldrb r1, [r0, 0xB] - lsrs r1, 4 - str r1, [r3, 0x8] - movs r1, 0x2 - str r1, [r3, 0xC] - ldrb r1, [r0, 0x8] - lsls r1, 8 - ldrb r2, [r0, 0x9] - orrs r1, r2 - str r1, [r3, 0x10] - ldrb r0, [r0, 0xA] - str r0, [r3, 0x14] - ldr r0, =0x03005d8c - ldr r1, [r0] - ldrb r0, [r1, 0x5] - lsls r0, 8 - ldrb r1, [r1, 0x4] - orrs r0, r1 - str r0, [r3, 0x18] - movs r0, 0 - str r0, [r3, 0x1C] - movs r0, 0x4 - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_StepOnTallGrass - - thumb_func_start GroundEffect_SpawnOnLongGrass -@ void GroundEffect_SpawnOnLongGrass(struct npc_state *fieldObject, struct obj *object) -GroundEffect_SpawnOnLongGrass: @ 8096F28 - push {lr} - ldr r3, =0x02038c08 - movs r2, 0x10 - ldrsh r1, [r0, r2] - str r1, [r3] - movs r2, 0x12 - ldrsh r1, [r0, r2] - str r1, [r3, 0x4] - ldrb r1, [r0, 0xB] - lsrs r1, 4 - str r1, [r3, 0x8] - movs r1, 0x2 - str r1, [r3, 0xC] - ldrb r1, [r0, 0x8] - lsls r1, 8 - ldrb r2, [r0, 0x9] - orrs r1, r2 - str r1, [r3, 0x10] - ldrb r0, [r0, 0xA] - str r0, [r3, 0x14] - ldr r0, =0x03005d8c - ldr r1, [r0] - ldrb r0, [r1, 0x5] - lsls r0, 8 - ldrb r1, [r1, 0x4] - orrs r0, r1 - str r0, [r3, 0x18] - movs r0, 0x1 - str r0, [r3, 0x1C] - movs r0, 0x11 - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_SpawnOnLongGrass - - thumb_func_start GroundEffect_StepOnLongGrass -@ void GroundEffect_StepOnLongGrass(struct npc_state *fieldObject, struct obj *object) -GroundEffect_StepOnLongGrass: @ 8096F74 - push {lr} - ldr r3, =0x02038c08 - movs r2, 0x10 - ldrsh r1, [r0, r2] - str r1, [r3] - movs r2, 0x12 - ldrsh r1, [r0, r2] - str r1, [r3, 0x4] - ldrb r1, [r0, 0xB] - lsrs r1, 4 - str r1, [r3, 0x8] - movs r1, 0x2 - str r1, [r3, 0xC] - ldrb r1, [r0, 0x8] - lsls r1, 8 - ldrb r2, [r0, 0x9] - orrs r1, r2 - str r1, [r3, 0x10] - ldrb r0, [r0, 0xA] - str r0, [r3, 0x14] - ldr r0, =0x03005d8c - ldr r1, [r0] - ldrb r0, [r1, 0x5] - lsls r0, 8 - ldrb r1, [r1, 0x4] - orrs r0, r1 - str r0, [r3, 0x18] - movs r0, 0 - str r0, [r3, 0x1C] - movs r0, 0x11 - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_StepOnLongGrass - - thumb_func_start GroundEffect_WaterReflection -@ void GroundEffect_WaterReflection(struct npc_state *fieldObject, struct obj *object) -GroundEffect_WaterReflection: @ 8096FC0 - push {lr} - movs r2, 0 - bl SetUpReflection - pop {r0} - bx r0 - thumb_func_end GroundEffect_WaterReflection - - thumb_func_start GroundEffect_IceReflection -@ void GroundEffect_IceReflection(struct npc_state *fieldObject, struct obj *object) -GroundEffect_IceReflection: @ 8096FCC - push {lr} - movs r2, 0x1 - bl SetUpReflection - pop {r0} - bx r0 - thumb_func_end GroundEffect_IceReflection - - thumb_func_start GroundEffect_FlowingWater -@ void GroundEffect_FlowingWater(struct npc_state *fieldObject, struct obj *object) -GroundEffect_FlowingWater: @ 8096FD8 - push {lr} - adds r1, r0, 0 - movs r0, 0x22 - bl oe_exec_and_other_stuff - pop {r0} - bx r0 - thumb_func_end GroundEffect_FlowingWater - - thumb_func_start GroundEffect_SandTracks -@ void GroundEffect_SandTracks(struct npc_state *fieldObject, struct obj *object) -GroundEffect_SandTracks: @ 8096FE8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x5] - bl GetFieldObjectGraphicsInfo - ldr r1, =gUnknown_0850E654 - ldrb r0, [r0, 0xD] - lsls r0, 2 - adds r0, r1 - ldr r3, [r0] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0 - bl _call_via_r3 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_SandTracks - - thumb_func_start GroundEffect_DeepSandTracks -@ void GroundEffect_DeepSandTracks(struct npc_state *fieldObject, struct obj *object) -GroundEffect_DeepSandTracks: @ 8097014 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4, 0x5] - bl GetFieldObjectGraphicsInfo - ldr r1, =gUnknown_0850E654 - ldrb r0, [r0, 0xD] - lsls r0, 2 - adds r0, r1 - ldr r3, [r0] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl _call_via_r3 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_DeepSandTracks - - thumb_func_start DoTracksGroundEffect_None -@ void DoTracksGroundEffect_None(struct npc_state *fieldObject, struct obj *object) -DoTracksGroundEffect_None: @ 8097040 - bx lr - thumb_func_end DoTracksGroundEffect_None - - thumb_func_start DoTracksGroundEffect_Footprints -@ void DoTracksGroundEffect_Footprints(struct npc_state *fieldObject, struct obj *object) -DoTracksGroundEffect_Footprints: @ 8097044 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - lsls r4, r2, 24 - lsrs r4, 24 - ldr r1, =gUnknown_0850E660 - mov r0, sp - movs r2, 0x4 - bl memcpy - ldr r1, =0x02038c08 - movs r2, 0x14 - ldrsh r0, [r5, r2] - str r0, [r1] - movs r2, 0x16 - ldrsh r0, [r5, r2] - str r0, [r1, 0x4] - movs r0, 0x95 - str r0, [r1, 0x8] - movs r0, 0x2 - str r0, [r1, 0xC] - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - str r0, [r1, 0x10] - lsls r4, 1 - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - bl FieldEffectStart - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTracksGroundEffect_Footprints - - thumb_func_start DoTracksGroundEffect_BikeTireTracks -@ void DoTracksGroundEffect_BikeTireTracks(struct npc_state *fieldObject, struct obj *object) -DoTracksGroundEffect_BikeTireTracks: @ 8097094 - push {r4,lr} - adds r4, r0, 0 - ldr r1, [r4, 0x10] - ldr r0, [r4, 0x14] - cmp r1, r0 - beq _080970D6 - ldr r2, =0x02038c08 - movs r1, 0x14 - ldrsh r0, [r4, r1] - str r0, [r2] - movs r1, 0x16 - ldrsh r0, [r4, r1] - str r0, [r2, 0x4] - movs r0, 0x95 - str r0, [r2, 0x8] - movs r0, 0x2 - str r0, [r2, 0xC] - ldr r3, =gUnknown_0850E664 - ldrb r1, [r4, 0x18] - lsls r1, 28 - lsrs r1, 28 - adds r0, r4, 0 - adds r0, 0x20 - ldrb r0, [r0] - lsls r0, 2 - subs r0, 0x5 - adds r1, r0 - adds r1, r3 - ldrb r0, [r1] - str r0, [r2, 0x10] - movs r0, 0x23 - bl FieldEffectStart -_080970D6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end DoTracksGroundEffect_BikeTireTracks - - thumb_func_start GroundEffect_Ripple -@ void GroundEffect_Ripple(struct npc_state *fieldObject, struct obj *object) -GroundEffect_Ripple: @ 80970E4 - push {lr} - bl DoRippleFieldEffect - pop {r0} - bx r0 - thumb_func_end GroundEffect_Ripple - - thumb_func_start GroundEffect_StepOnPuddle -@ void GroundEffect_StepOnPuddle(struct npc_state *fieldObject, struct obj *object) -GroundEffect_StepOnPuddle: @ 80970F0 - push {lr} - adds r1, r0, 0 - movs r0, 0xF - bl oe_exec_and_other_stuff - pop {r0} - bx r0 - thumb_func_end GroundEffect_StepOnPuddle - - thumb_func_start GroundEffect_SandHeap -@ void GroundEffect_SandHeap(struct npc_state *fieldObject, struct obj *object) -GroundEffect_SandHeap: @ 8097100 - push {lr} - adds r1, r0, 0 - movs r0, 0x27 - bl oe_exec_and_other_stuff - pop {r0} - bx r0 - thumb_func_end GroundEffect_SandHeap - - thumb_func_start GroundEffect_JumpOnTallGrass -@ void GroundEffect_JumpOnTallGrass(struct npc_state *fieldObject, struct obj *object) -GroundEffect_JumpOnTallGrass: @ 8097110 - push {r4-r7,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - ldr r1, =0x02038c08 - movs r2, 0x10 - ldrsh r0, [r5, r2] - str r0, [r1] - movs r4, 0x12 - ldrsh r0, [r5, r4] - str r0, [r1, 0x4] - ldrb r0, [r5, 0xB] - lsrs r0, 4 - str r0, [r1, 0x8] - movs r0, 0x2 - str r0, [r1, 0xC] - movs r0, 0xC - bl FieldEffectStart - ldrb r0, [r5, 0x8] - ldrb r1, [r5, 0x9] - ldrb r2, [r5, 0xA] - movs r7, 0x10 - ldrsh r3, [r5, r7] - movs r7, 0x12 - ldrsh r4, [r5, r7] - str r4, [sp] - bl sub_81546C8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - bne _0809715A - adds r0, r5, 0 - adds r1, r6, 0 - bl GroundEffect_SpawnOnTallGrass -_0809715A: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_JumpOnTallGrass - - thumb_func_start GroundEffect_JumpOnLongGrass -@ void GroundEffect_JumpOnLongGrass(struct npc_state *fieldObject, struct obj *object) -GroundEffect_JumpOnLongGrass: @ 8097168 - push {lr} - ldr r2, =0x02038c08 - movs r3, 0x10 - ldrsh r1, [r0, r3] - str r1, [r2] - movs r3, 0x12 - ldrsh r1, [r0, r3] - str r1, [r2, 0x4] - ldrb r0, [r0, 0xB] - lsrs r0, 4 - str r0, [r2, 0x8] - movs r0, 0x2 - str r0, [r2, 0xC] - movs r0, 0x12 - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_JumpOnLongGrass - - thumb_func_start GroundEffect_JumpOnShallowWater -@ void GroundEffect_JumpOnShallowWater(struct npc_state *fieldObject, struct obj *object) -GroundEffect_JumpOnShallowWater: @ 8097190 - push {r4,lr} - ldr r3, =0x02038c08 - movs r4, 0x10 - ldrsh r2, [r0, r4] - str r2, [r3] - movs r4, 0x12 - ldrsh r2, [r0, r4] - str r2, [r3, 0x4] - ldrb r0, [r0, 0xB] - lsrs r0, 4 - str r0, [r3, 0x8] - ldrb r0, [r1, 0x5] - lsls r0, 28 - lsrs r0, 30 - str r0, [r3, 0xC] - movs r0, 0x10 - bl FieldEffectStart - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_JumpOnShallowWater - - thumb_func_start GroundEffect_JumpOnWater -@ void GroundEffect_JumpOnWater(struct npc_state *fieldObject, struct obj *object) -GroundEffect_JumpOnWater: @ 80971C0 - push {r4,lr} - ldr r3, =0x02038c08 - movs r4, 0x10 - ldrsh r2, [r0, r4] - str r2, [r3] - movs r4, 0x12 - ldrsh r2, [r0, r4] - str r2, [r3, 0x4] - ldrb r0, [r0, 0xB] - lsrs r0, 4 - str r0, [r3, 0x8] - ldrb r0, [r1, 0x5] - lsls r0, 28 - lsrs r0, 30 - str r0, [r3, 0xC] - movs r0, 0xE - bl FieldEffectStart - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_JumpOnWater - - thumb_func_start GroundEffect_JumpLandingDust -@ void GroundEffect_JumpLandingDust(struct npc_state *fieldObject, struct obj *object) -GroundEffect_JumpLandingDust: @ 80971F0 - push {r4,lr} - ldr r3, =0x02038c08 - movs r4, 0x10 - ldrsh r2, [r0, r4] - str r2, [r3] - movs r4, 0x12 - ldrsh r2, [r0, r4] - str r2, [r3, 0x4] - ldrb r0, [r0, 0xB] - lsrs r0, 4 - str r0, [r3, 0x8] - ldrb r0, [r1, 0x5] - lsls r0, 28 - lsrs r0, 30 - str r0, [r3, 0xC] - movs r0, 0xA - bl FieldEffectStart - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_JumpLandingDust - - thumb_func_start GroundEffect_ShortGrass -@ void GroundEffect_ShortGrass(struct npc_state *fieldObject, struct obj *object) -GroundEffect_ShortGrass: @ 8097220 - push {lr} - adds r1, r0, 0 - movs r0, 0x29 - bl oe_exec_and_other_stuff - pop {r0} - bx r0 - thumb_func_end GroundEffect_ShortGrass - - thumb_func_start GroundEffect_HotSprings -@ void GroundEffect_HotSprings(struct npc_state *fieldObject, struct obj *object) -GroundEffect_HotSprings: @ 8097230 - push {lr} - adds r1, r0, 0 - movs r0, 0x2A - bl oe_exec_and_other_stuff - pop {r0} - bx r0 - thumb_func_end GroundEffect_HotSprings - - thumb_func_start GroundEffect_Seaweed -@ void GroundEffect_Seaweed(struct npc_state *fieldObject, struct obj *object) -GroundEffect_Seaweed: @ 8097240 - push {lr} - ldr r2, =0x02038c08 - movs r3, 0x10 - ldrsh r1, [r0, r3] - str r1, [r2] - movs r1, 0x12 - ldrsh r0, [r0, r1] - str r0, [r2, 0x4] - movs r0, 0x35 - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end GroundEffect_Seaweed - - thumb_func_start DoFlaggedGroundEffects -@ void DoFlaggedGroundEffects(struct npc_state *fieldObject, struct obj *object, u32 flags) -DoFlaggedGroundEffects: @ 8097260 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - adds r7, r1, 0 - adds r5, r2, 0 - bl FieldObjectIsFarawayIslandMew - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08097284 - adds r0, r6, 0 - bl sub_81D4A58 - lsls r0, 24 - cmp r0, 0 - beq _080972AC -_08097284: - movs r4, 0 - ldr r0, =gUnknown_0850E674 - mov r8, r0 -_0809728A: - movs r0, 0x1 - ands r0, r5 - cmp r0, 0 - beq _080972A0 - lsls r0, r4, 2 - add r0, r8 - ldr r2, [r0] - adds r0, r6, 0 - adds r1, r7, 0 - bl _call_via_r2 -_080972A0: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - lsrs r5, 1 - cmp r4, 0x13 - bls _0809728A -_080972AC: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DoFlaggedGroundEffects - - thumb_func_start filters_out_some_ground_effects -@ void filters_out_some_ground_effects(struct npc_state *fieldObject, u32 *flags) -filters_out_some_ground_effects: @ 80972BC - push {lr} - adds r2, r0, 0 - adds r3, r1, 0 - ldrb r0, [r2] - lsls r0, 27 - cmp r0, 0 - bge _080972EA - ldrb r1, [r2, 0x2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - adds r1, 0x8 - ands r0, r1 - subs r1, 0x18 - ands r0, r1 - strb r0, [r2, 0x2] - ldr r0, [r3] - ldr r1, =0xfff9f7bd - ands r0, r1 - str r0, [r3] -_080972EA: - pop {r0} - bx r0 - .pool - thumb_func_end filters_out_some_ground_effects - - thumb_func_start FilterOutStepOnPuddleGroundEffectIfJumping -@ void FilterOutStepOnPuddleGroundEffectIfJumping(struct npc_state *fieldObject, u32 *flags) -FilterOutStepOnPuddleGroundEffectIfJumping: @ 80972F4 - push {lr} - adds r2, r1, 0 - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _08097308 - ldr r0, [r2] - ldr r1, =0xfffffbff - ands r0, r1 - str r0, [r2] -_08097308: - pop {r0} - bx r0 - .pool - thumb_func_end FilterOutStepOnPuddleGroundEffectIfJumping - - thumb_func_start DoGroundEffects_OnSpawn -@ void DoGroundEffects_OnSpawn(struct npc_state *fieldObject, struct obj *object) -DoGroundEffects_OnSpawn: @ 8097310 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4] - lsls r0, 29 - cmp r0, 0 - bge _08097354 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - bl FieldObjectUpdateZCoordAndPriority - adds r0, r4, 0 - mov r1, sp - bl GetAllGroundEffectFlags_OnSpawn - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetSpriteOamTableForLongGrass - ldr r2, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - bl DoFlaggedGroundEffects - ldrb r1, [r4] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - strb r0, [r4] -_08097354: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end DoGroundEffects_OnSpawn - - thumb_func_start DoGroundEffects_OnBeginStep -@ void DoGroundEffects_OnBeginStep(struct npc_state *fieldObject, struct obj *object) -DoGroundEffects_OnBeginStep: @ 809735C - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4] - lsls r0, 29 - cmp r0, 0 - bge _080973A8 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - bl FieldObjectUpdateZCoordAndPriority - adds r0, r4, 0 - mov r1, sp - bl GetAllGroundEffectFlags_OnBeginStep - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetSpriteOamTableForLongGrass - adds r0, r4, 0 - mov r1, sp - bl filters_out_some_ground_effects - ldr r2, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - bl DoFlaggedGroundEffects - ldrb r1, [r4] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - strb r0, [r4] -_080973A8: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end DoGroundEffects_OnBeginStep - - thumb_func_start DoGroundEffects_OnFinishStep -@ void DoGroundEffects_OnFinishStep(struct npc_state *fieldObject, struct obj *object) -DoGroundEffects_OnFinishStep: @ 80973B0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r0, [r4] - lsls r0, 28 - cmp r0, 0 - bge _080973FC - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - bl FieldObjectUpdateZCoordAndPriority - adds r0, r4, 0 - mov r1, sp - bl GetAllGroundEffectFlags_OnFinishStep - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldObjectSetSpriteOamTableForLongGrass - adds r0, r4, 0 - mov r1, sp - bl FilterOutStepOnPuddleGroundEffectIfJumping - ldr r2, [sp] - adds r0, r4, 0 - adds r1, r5, 0 - bl DoFlaggedGroundEffects - ldrb r1, [r4] - movs r0, 0x9 - negs r0, r0 - ands r0, r1 - movs r1, 0x21 - negs r1, r1 - ands r0, r1 - strb r0, [r4] -_080973FC: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end DoGroundEffects_OnFinishStep - - thumb_func_start sub_8097404 -@ bool8 sub_8097404(struct npc_state *fieldObject) -sub_8097404: @ 8097404 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r1, [r5] - movs r0, 0xA0 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - bne _0809748C - ldrb r0, [r5, 0x1] - movs r4, 0x1 - orrs r0, r4 - strb r0, [r5, 0x1] - ldr r3, =0x02020630 - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x2C - ldrb r1, [r0] - lsls r1, 25 - lsrs r1, 31 - lsls r1, 7 - ldrb r2, [r5, 0x2] - movs r0, 0x7F - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x2] - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x2C - ldrb r1, [r0] - lsrs r1, 7 - ands r1, r4 - ldrb r2, [r5, 0x3] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x3] - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] - movs r0, 0 - b _0809748E - .pool -_0809748C: - movs r0, 0x1 -_0809748E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8097404 - - thumb_func_start player_bitmagic -@ void player_bitmagic() -player_bitmagic: @ 8097494 - push {r4,r5,lr} - movs r4, 0 - ldr r5, =0x02037350 -_0809749A: - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - adds r1, r0, r5 - ldrb r0, [r1] - lsls r0, 31 - cmp r0, 0 - beq _080974B8 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - cmp r4, r0 - beq _080974B8 - adds r0, r1, 0 - bl sub_8097404 -_080974B8: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _0809749A - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end player_bitmagic - - thumb_func_start sub_80974D0 -sub_80974D0: @ 80974D0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r6, =0x02037350 -_080974DA: - cmp r4, r5 - beq _080974FC - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - adds r1, r0, r6 - ldrb r0, [r1] - lsls r0, 31 - cmp r0, 0 - beq _080974FC - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - cmp r4, r0 - beq _080974FC - adds r0, r1, 0 - bl sub_8097404 -_080974FC: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _080974DA - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80974D0 - - thumb_func_start npc_sync_anim_pause_bits -@ void npc_sync_anim_pause_bits(struct npc_state *fieldObject) -npc_sync_anim_pause_bits: @ 8097514 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r2, [r5] - ldr r1, =0x00000101 - adds r0, r1, 0 - ands r0, r2 - cmp r0, r1 - bne _0809756C - ldrb r1, [r5, 0x1] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r5, 0x1] - ldr r4, =0x02020630 - ldrb r0, [r5, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r2, [r5, 0x2] - adds r1, 0x2C - lsrs r2, 7 - lsls r2, 6 - ldrb r3, [r1] - movs r0, 0x41 - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1] - ldrb r0, [r5, 0x4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r4 - ldrb r1, [r5, 0x3] - lsls r1, 31 - lsrs r1, 31 - adds r2, 0x2C - lsls r1, 7 - ldrb r3, [r2] - movs r0, 0x7F - ands r0, r3 - orrs r0, r1 - strb r0, [r2] -_0809756C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end npc_sync_anim_pause_bits - - thumb_func_start sub_809757C -sub_809757C: @ 809757C - push {r4,r5,lr} - movs r4, 0 - ldr r5, =0x02037350 -_08097582: - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - adds r1, r0, r5 - ldrb r0, [r1] - lsls r0, 31 - cmp r0, 0 - beq _08097598 - adds r0, r1, 0 - bl npc_sync_anim_pause_bits -_08097598: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _08097582 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809757C - - thumb_func_start little_step -@ void little_step(struct obj *object, u8 direction) -little_step: @ 80975AC - lsls r1, 24 - ldr r2, =gUnknown_0850DB7C - lsrs r1, 22 - adds r1, r2 - ldrh r2, [r1] - ldrh r3, [r0, 0x20] - adds r2, r3 - strh r2, [r0, 0x20] - ldrh r1, [r1, 0x2] - ldrh r2, [r0, 0x22] - adds r1, r2 - strh r1, [r0, 0x22] - bx lr - .pool - thumb_func_end little_step - - thumb_func_start double_little_steps -double_little_steps: @ 80975CC - lsls r1, 24 - ldr r2, =gUnknown_0850DB7C - lsrs r1, 22 - adds r1, r2 - ldrh r2, [r1] - lsls r2, 1 - ldrh r3, [r0, 0x20] - adds r2, r3 - strh r2, [r0, 0x20] - ldrh r1, [r1, 0x2] - lsls r1, 1 - ldrh r2, [r0, 0x22] - adds r1, r2 - strh r1, [r0, 0x22] - bx lr - .pool - thumb_func_end double_little_steps - - thumb_func_start triple_little_steps -triple_little_steps: @ 80975F0 - lsls r1, 24 - ldr r2, =gUnknown_0850DB7C - lsrs r1, 22 - adds r1, r2 - ldrh r2, [r1] - lsls r3, r2, 1 - adds r2, r3 - ldrh r3, [r0, 0x20] - adds r2, r3 - strh r2, [r0, 0x20] - ldrh r1, [r1, 0x2] - lsls r2, r1, 1 - adds r1, r2 - ldrh r2, [r0, 0x22] - adds r1, r2 - strh r1, [r0, 0x22] - bx lr - .pool - thumb_func_end triple_little_steps - - thumb_func_start quad_little_steps -quad_little_steps: @ 8097618 - lsls r1, 24 - ldr r2, =gUnknown_0850DB7C - lsrs r1, 22 - adds r1, r2 - ldrh r2, [r1] - lsls r2, 2 - ldrh r3, [r0, 0x20] - adds r2, r3 - strh r2, [r0, 0x20] - ldrh r1, [r1, 0x2] - lsls r1, 2 - ldrh r2, [r0, 0x22] - adds r1, r2 - strh r1, [r0, 0x22] - bx lr - .pool - thumb_func_end quad_little_steps - - thumb_func_start oct_little_steps -@ void oct_little_steps(struct obj *object, u8 direction) -oct_little_steps: @ 809763C - lsls r1, 24 - ldr r2, =gUnknown_0850DB7C - lsrs r1, 22 - adds r1, r2 - ldrh r2, [r1] - lsls r2, 3 - ldrh r3, [r0, 0x20] - adds r2, r3 - strh r2, [r0, 0x20] - ldrh r1, [r1, 0x2] - lsls r1, 3 - ldrh r2, [r0, 0x22] - adds r1, r2 - strh r1, [r0, 0x22] - bx lr - .pool - thumb_func_end oct_little_steps - - thumb_func_start oamt_npc_ministep_reset -@ void oamt_npc_ministep_reset(struct obj *object, u8 direction, u8 speed) -oamt_npc_ministep_reset: @ 8097660 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - movs r3, 0 - strh r1, [r0, 0x34] - strh r2, [r0, 0x36] - strh r3, [r0, 0x38] - bx lr - thumb_func_end oamt_npc_ministep_reset - - thumb_func_start obj_npc_ministep -@ bool8 obj_npc_ministep(struct obj *object) -obj_npc_ministep: @ 8097674 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =gUnknown_0850E768 - movs r0, 0x36 - ldrsh r2, [r4, r0] - lsls r0, r2, 1 - adds r0, r5 - movs r3, 0x38 - ldrsh r1, [r4, r3] - movs r3, 0 - ldrsh r0, [r0, r3] - cmp r1, r0 - bge _080976D4 - ldr r1, =gUnknown_0850E754 - lsls r0, r2, 2 - adds r0, r1 - movs r1, 0x38 - ldrsh r2, [r4, r1] - ldr r0, [r0] - lsls r2, 2 - adds r2, r0 - ldrh r1, [r4, 0x34] - lsls r1, 24 - lsrs r1, 24 - ldr r2, [r2] - adds r0, r4, 0 - bl _call_via_r2 - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - movs r2, 0x36 - ldrsh r1, [r4, r2] - lsls r1, 1 - adds r1, r5 - lsls r0, 16 - asrs r0, 16 - movs r3, 0 - ldrsh r1, [r1, r3] - cmp r0, r1 - blt _080976D4 - movs r0, 0x1 - b _080976D6 - .pool -_080976D4: - movs r0, 0 -_080976D6: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end obj_npc_ministep - - thumb_func_start sub_80976DC -@ void sub_80976DC(struct obj *object, u8 direction) -sub_80976DC: @ 80976DC - lsls r1, 24 - lsrs r1, 24 - movs r2, 0 - strh r1, [r0, 0x34] - strh r2, [r0, 0x36] - strh r2, [r0, 0x38] - bx lr - thumb_func_end sub_80976DC - - thumb_func_start sub_80976EC -@ bool8 sub_80976EC(struct obj *object) -sub_80976EC: @ 80976EC - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x36] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0809770C - ldrh r1, [r4, 0x34] - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl little_step - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] -_0809770C: - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] - movs r1, 0x38 - ldrsh r0, [r4, r1] - cmp r0, 0xF - bgt _0809771E - movs r0, 0 - b _08097720 -_0809771E: - movs r0, 0x1 -_08097720: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80976EC - - thumb_func_start sub_8097728 -sub_8097728: @ 8097728 - ldr r1, =gUnknown_0850E7BA - lsls r0, 16 - asrs r0, 16 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - bx lr - .pool - thumb_func_end sub_8097728 - - thumb_func_start sub_809773C -sub_809773C: @ 809773C - ldr r1, =gUnknown_0850E772 - lsls r0, 16 - asrs r0, 16 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - bx lr - .pool - thumb_func_end sub_809773C - - thumb_func_start sub_8097750 -sub_8097750: @ 8097750 - movs r1, 0 - strh r1, [r0, 0x3A] - strh r1, [r0, 0x3C] - bx lr - thumb_func_end sub_8097750 - - thumb_func_start sub_8097758 -sub_8097758: @ 8097758 - push {r4-r6,lr} - adds r5, r0, 0 - movs r6, 0 - movs r1, 0x3C - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _0809778E - cmp r0, 0x1 - bgt _08097770 - cmp r0, 0 - beq _0809777A - b _080977F2 -_08097770: - cmp r0, 0x2 - beq _080977B6 - cmp r0, 0x3 - beq _080977CA - b _080977F2 -_0809777A: - movs r2, 0x3A - ldrsh r0, [r5, r2] - bl sub_809773C - ldrh r1, [r5, 0x24] - adds r0, r1 - strh r0, [r5, 0x24] - movs r2, 0x3A - ldrsh r0, [r5, r2] - b _080977E8 -_0809778E: - ldrh r0, [r5, 0x3A] - movs r4, 0x47 - subs r0, r4, r0 - lsls r0, 16 - asrs r0, 16 - bl sub_809773C - ldrh r1, [r5, 0x24] - subs r1, r0 - strh r1, [r5, 0x24] - ldrh r0, [r5, 0x3A] - subs r4, r0 - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 - bl sub_8097728 - ldrh r2, [r5, 0x26] - adds r0, r2 - b _080977F0 -_080977B6: - movs r1, 0x3A - ldrsh r0, [r5, r1] - bl sub_809773C - ldrh r1, [r5, 0x24] - subs r1, r0 - strh r1, [r5, 0x24] - movs r2, 0x3A - ldrsh r0, [r5, r2] - b _080977E8 -_080977CA: - ldrh r0, [r5, 0x3A] - movs r4, 0x47 - subs r0, r4, r0 - lsls r0, 16 - asrs r0, 16 - bl sub_809773C - ldrh r2, [r5, 0x24] - adds r0, r2 - strh r0, [r5, 0x24] - ldrh r0, [r5, 0x3A] - subs r4, r0 - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 -_080977E8: - bl sub_8097728 - ldrh r1, [r5, 0x26] - adds r0, r1 -_080977F0: - strh r0, [r5, 0x26] -_080977F2: - ldrh r0, [r5, 0x3A] - adds r0, 0x1 - movs r1, 0 - strh r0, [r5, 0x3A] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x48 - bne _0809780A - strh r1, [r5, 0x3A] - ldrh r0, [r5, 0x3C] - adds r0, 0x1 - strh r0, [r5, 0x3C] -_0809780A: - movs r2, 0x3C - ldrsh r0, [r5, r2] - cmp r0, 0x4 - bne _08097818 - strh r1, [r5, 0x26] - strh r1, [r5, 0x24] - movs r6, 0x1 -_08097818: - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8097758 - - thumb_func_start sub_8097820 -sub_8097820: @ 8097820 - lsls r1, 24 - ldr r2, =gUnknown_0850E834 - lsrs r1, 22 - adds r1, r2 - lsls r0, 16 - asrs r0, 16 - ldr r1, [r1] - adds r1, r0 - movs r0, 0 - ldrsb r0, [r1, r0] - bx lr - .pool - thumb_func_end sub_8097820 - - thumb_func_start sub_809783C -sub_809783C: @ 809783C - push {r4,lr} - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - movs r4, 0 - strh r1, [r0, 0x34] - strh r2, [r0, 0x36] - strh r3, [r0, 0x38] - strh r4, [r0, 0x3A] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_809783C - - thumb_func_start sub_809785C -sub_809785C: @ 809785C - push {r4-r6,lr} - sub sp, 0xC - adds r4, r0, 0 - ldr r1, =gUnknown_0850E840 - mov r0, sp - movs r2, 0x6 - bl memcpy - add r5, sp, 0x8 - ldr r1, =gUnknown_0850E846 - adds r0, r5, 0 - movs r2, 0x3 - bl memcpy - movs r6, 0 - movs r1, 0x36 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0809788E - ldrh r1, [r4, 0x34] - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl little_step -_0809788E: - movs r2, 0x3A - ldrsh r0, [r4, r2] - movs r2, 0x36 - ldrsh r1, [r4, r2] - adds r1, r5, r1 - ldrb r1, [r1] - asrs r0, r1 - ldrh r1, [r4, 0x38] - lsls r1, 24 - lsrs r1, 24 - bl sub_8097820 - strh r0, [r4, 0x26] - ldrh r1, [r4, 0x3A] - adds r1, 0x1 - strh r1, [r4, 0x3A] - movs r2, 0x36 - ldrsh r0, [r4, r2] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - lsls r0, 16 - asrs r2, r0, 16 - lsls r1, 16 - asrs r1, 16 - asrs r0, 17 - cmp r1, r0 - bne _080978C8 - movs r6, 0x1 -_080978C8: - cmp r1, r2 - blt _080978D2 - movs r0, 0 - strh r0, [r4, 0x26] - movs r6, 0xFF -_080978D2: - adds r0, r6, 0 - add sp, 0xC - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809785C - - thumb_func_start sub_80978E4 -sub_80978E4: @ 80978E4 - push {r4-r6,lr} - sub sp, 0xC - adds r5, r0, 0 - ldr r1, =gUnknown_0850E84A - mov r0, sp - movs r2, 0x6 - bl memcpy - add r4, sp, 0x8 - ldr r1, =gUnknown_0850E850 - adds r0, r4, 0 - movs r2, 0x3 - bl memcpy - movs r6, 0 - movs r1, 0x36 - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08097920 - ldrh r1, [r5, 0x3A] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08097920 - ldrh r1, [r5, 0x34] - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl little_step -_08097920: - movs r2, 0x3A - ldrsh r0, [r5, r2] - movs r2, 0x36 - ldrsh r1, [r5, r2] - adds r1, r4, r1 - ldrb r1, [r1] - asrs r0, r1 - ldrh r1, [r5, 0x38] - lsls r1, 24 - lsrs r1, 24 - bl sub_8097820 - strh r0, [r5, 0x26] - ldrh r1, [r5, 0x3A] - adds r1, 0x1 - strh r1, [r5, 0x3A] - movs r2, 0x36 - ldrsh r0, [r5, r2] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - lsls r0, 16 - asrs r2, r0, 16 - lsls r1, 16 - asrs r1, 16 - asrs r0, 17 - cmp r1, r0 - bne _0809795A - movs r6, 0x1 -_0809795A: - cmp r1, r2 - blt _08097964 - movs r0, 0 - strh r0, [r5, 0x26] - movs r6, 0xFF -_08097964: - adds r0, r6, 0 - add sp, 0xC - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80978E4 - - thumb_func_start sub_8097978 -@ void sub_8097978(struct obj *object, u16 a2) -sub_8097978: @ 8097978 - strh r1, [r0, 0x34] - bx lr - thumb_func_end sub_8097978 - - thumb_func_start sub_809797C -@ bool8 sub_809797C(struct obj *object) -sub_809797C: @ 809797C - push {lr} - ldrh r1, [r0, 0x34] - subs r1, 0x1 - strh r1, [r0, 0x34] - lsls r1, 16 - cmp r1, 0 - beq _0809798E - movs r0, 0 - b _08097990 -_0809798E: - movs r0, 0x1 -_08097990: - pop {r1} - bx r1 - thumb_func_end sub_809797C - - thumb_func_start obj_anim_image_set_and_seek -obj_anim_image_set_and_seek: @ 8097994 - push {r4,lr} - lsls r2, 24 - lsrs r2, 24 - adds r3, r0, 0 - adds r3, 0x2A - strb r1, [r3] - adds r4, r0, 0 - adds r4, 0x2C - ldrb r3, [r4] - movs r1, 0x41 - negs r1, r1 - ands r1, r3 - strb r1, [r4] - adds r1, r2, 0 - bl SeekObjectImageAnim - pop {r4} - pop {r0} - bx r0 - thumb_func_end obj_anim_image_set_and_seek - - thumb_func_start sub_80979BC -sub_80979BC: @ 80979BC - push {lr} - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _080979CE - movs r0, 0 - b _080979D0 -_080979CE: - movs r0, 0x1 -_080979D0: - pop {r1} - bx r1 - thumb_func_end sub_80979BC - - thumb_func_start sub_80979D4 -sub_80979D4: @ 80979D4 - push {r4-r6,lr} - mov r12, r0 - lsls r1, 24 - lsrs r1, 24 - mov r3, r12 - adds r3, 0x3E - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08097A3C - mov r0, r12 - ldrh r1, [r0, 0x24] - ldrh r2, [r0, 0x20] - adds r1, r2 - mov r4, r12 - adds r4, 0x28 - movs r0, 0 - ldrsb r0, [r4, r0] - ldr r2, =0x02021bbc - adds r0, r1 - ldrh r2, [r2] - adds r0, r2 - lsls r0, 16 - lsrs r6, r0, 16 - mov r0, r12 - ldrh r1, [r0, 0x26] - ldrh r2, [r0, 0x22] - adds r1, r2 - subs r3, 0x15 - movs r0, 0 - ldrsb r0, [r3, r0] - ldr r2, =0x02021bbe - adds r0, r1 - ldrh r2, [r2] - adds r0, r2 - lsls r0, 16 - lsrs r5, r0, 16 - adds r2, r3, 0 - b _08097A6A - .pool -_08097A3C: - mov r0, r12 - ldrh r1, [r0, 0x24] - ldrh r2, [r0, 0x20] - adds r1, r2 - mov r3, r12 - adds r3, 0x28 - movs r0, 0 - ldrsb r0, [r3, r0] - adds r0, r1 - lsls r0, 16 - lsrs r6, r0, 16 - mov r0, r12 - ldrh r1, [r0, 0x26] - ldrh r2, [r0, 0x22] - adds r1, r2 - mov r2, r12 - adds r2, 0x29 - movs r0, 0 - ldrsb r0, [r2, r0] - adds r0, r1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r4, r3, 0 -_08097A6A: - ldrb r0, [r4] - lsls r0, 24 - asrs r0, 25 - subs r0, r6, r0 - lsls r0, 16 - lsrs r3, r0, 16 - ldrb r0, [r2] - lsls r0, 24 - asrs r0, 25 - subs r0, r5, r0 - lsls r0, 16 - lsrs r2, r0, 16 - lsls r0, r6, 16 - asrs r0, 16 - cmp r0, 0xFF - bgt _08097A96 - lsls r0, r3, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bge _08097AA2 -_08097A96: - mov r4, r12 - adds r4, 0x3E - ldrb r0, [r4] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4] -_08097AA2: - lsls r0, r5, 16 - asrs r0, 16 - cmp r0, 0xAF - bgt _08097AB6 - lsls r0, r2, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bge _08097AC2 -_08097AB6: - mov r0, r12 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_08097AC2: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80979D4 - - thumb_func_start sub_8097AC8 -sub_8097AC8: @ 8097AC8 - push {r4,lr} - adds r4, r0, 0 - bl sub_8097D68 - ldrh r0, [r4, 0x30] - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - movs r2, 0x1 - bl SetObjectSubpriorityByZCoord - ldrh r1, [r4, 0x32] - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_80979D4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8097AC8 - - thumb_func_start sub_8097AF0 -sub_8097AF0: @ 8097AF0 - push {r4,r5,lr} - movs r5, 0 - movs r4, 0x3F -_08097AF6: - ldr r0, =0x02020630 - adds r2, r5, r0 - adds r0, r2, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08097B16 - ldr r1, [r2, 0x1C] - ldr r0, =sub_8097AC8 - cmp r1, r0 - bne _08097B16 - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles -_08097B16: - adds r5, 0x44 - subs r4, 0x1 - cmp r4, 0 - bge _08097AF6 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8097AF0 - - thumb_func_start sub_8097B2C -sub_8097B2C: @ 8097B2C - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r3, 0 - ldr r6, =0x02020630 - movs r4, 0 -_08097B38: - adds r2, r4, r6 - adds r0, r2, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08097B68 - ldr r1, [r2, 0x1C] - ldr r0, =sub_8097AC8 - cmp r1, r0 - bne _08097B68 - ldrh r0, [r2, 0x2E] - lsls r0, 24 - lsrs r0, 24 - cmp r0, r5 - bne _08097B68 - adds r0, r3, 0 - b _08097B72 - .pool -_08097B68: - adds r4, 0x44 - adds r3, 0x1 - cmp r3, 0x3F - ble _08097B38 - movs r0, 0x40 -_08097B72: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8097B2C - - thumb_func_start sub_8097B78 -sub_8097B78: @ 8097B78 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - bl sub_8097B2C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _08097BAA - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - adds r0, r5, 0 - bl FieldObjectDirectionToImageAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim -_08097BAA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8097B78 - - thumb_func_start sub_8097BB4 -sub_8097BB4: @ 8097BB4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - bl sub_8097B2C - adds r1, r0, 0 - cmp r1, 0x40 - beq _08097C3E - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r4, r0, r1 - adds r0, r5, 0 - bl GetFieldObjectGraphicsInfo - ldrh r3, [r4, 0x4] - lsls r3, 22 - ldr r1, [r0, 0x10] - ldr r2, [r1, 0x4] - ldr r1, [r1] - str r1, [r4] - str r2, [r4, 0x4] - lsrs r3, 22 - ldrh r2, [r4, 0x4] - ldr r1, =0xfffffc00 - ands r1, r2 - orrs r1, r3 - strh r1, [r4, 0x4] - ldrb r2, [r0, 0xC] - lsls r2, 28 - lsrs r2, 24 - ldrb r3, [r4, 0x5] - movs r1, 0xF - ands r1, r3 - orrs r1, r2 - strb r1, [r4, 0x5] - ldr r1, [r0, 0x1C] - str r1, [r4, 0xC] - ldr r1, [r0, 0x14] - cmp r1, 0 - bne _08097C20 - str r1, [r4, 0x18] - adds r0, r4, 0 - adds r0, 0x42 - strb r1, [r0] - b _08097C36 - .pool -_08097C20: - adds r0, r4, 0 - bl SetSpriteOamTables_NoPriorityFromTable - adds r2, r4, 0 - adds r2, 0x42 - ldrb r0, [r2] - movs r1, 0x3F - ands r1, r0 - movs r0, 0x80 - orrs r1, r0 - strb r1, [r2] -_08097C36: - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnim -_08097C3E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8097BB4 - - thumb_func_start sub_8097C44 -sub_8097C44: @ 8097C44 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - bl sub_8097B2C - lsls r0, 24 - lsrs r2, r0, 24 - adds r3, r2, 0 - cmp r2, 0x40 - beq _08097C80 - cmp r4, 0 - beq _08097C74 - ldr r0, =0x02020630 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x32] - b _08097C80 - .pool -_08097C74: - ldr r1, =0x02020630 - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - strh r4, [r0, 0x32] -_08097C80: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8097C44 - - thumb_func_start sub_8097C8C -sub_8097C8C: @ 8097C8C - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_8097B2C - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - bne _08097CA2 - movs r0, 0 - b _08097CBA -_08097CA2: - movs r3, 0 - ldr r0, =0x02020630 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - movs r2, 0x32 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - bne _08097CB8 - movs r3, 0x1 -_08097CB8: - adds r0, r3, 0 -_08097CBA: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8097C8C - - thumb_func_start sub_8097CC4 -sub_8097CC4: @ 8097CC4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - bl sub_8097B2C - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - beq _08097CEA - ldr r0, =0x02020630 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - movs r0, 0 - strh r4, [r1, 0x34] - strh r0, [r1, 0x36] -_08097CEA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8097CC4 - - thumb_func_start sub_8097CF4 -sub_8097CF4: @ 8097CF4 - push {lr} - adds r2, r0, 0 - movs r1, 0x36 - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _08097D06 - cmp r0, 0x1 - beq _08097D0E - b _08097D2C -_08097D06: - strh r0, [r2, 0x26] - ldrh r0, [r2, 0x36] - adds r0, 0x1 - strh r0, [r2, 0x36] -_08097D0E: - ldrh r0, [r2, 0x26] - subs r0, 0x8 - movs r3, 0 - strh r0, [r2, 0x26] - lsls r0, 16 - asrs r0, 16 - movs r1, 0xA0 - negs r1, r1 - cmp r0, r1 - bne _08097D2C - strh r3, [r2, 0x26] - movs r0, 0x1 - strh r0, [r2, 0x32] - strh r3, [r2, 0x34] - strh r3, [r2, 0x36] -_08097D2C: - pop {r0} - bx r0 - thumb_func_end sub_8097CF4 - - thumb_func_start sub_8097D30 -sub_8097D30: @ 8097D30 - push {lr} - adds r1, r0, 0 - movs r2, 0x36 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _08097D42 - cmp r0, 0x1 - beq _08097D4C - b _08097D5E -_08097D42: - ldr r0, =0x0000ff60 - strh r0, [r1, 0x26] - ldrh r0, [r1, 0x36] - adds r0, 0x1 - strh r0, [r1, 0x36] -_08097D4C: - ldrh r0, [r1, 0x26] - adds r0, 0x8 - strh r0, [r1, 0x26] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bne _08097D5E - strh r0, [r1, 0x34] - strh r0, [r1, 0x36] -_08097D5E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8097D30 - - thumb_func_start sub_8097D68 -sub_8097D68: @ 8097D68 - push {lr} - adds r1, r0, 0 - movs r2, 0x34 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - beq _08097D84 - cmp r0, 0x1 - bgt _08097D7E - cmp r0, 0 - beq _08097D98 - b _08097D94 -_08097D7E: - cmp r0, 0x2 - beq _08097D8C - b _08097D94 -_08097D84: - adds r0, r1, 0 - bl sub_8097D30 - b _08097D98 -_08097D8C: - adds r0, r1, 0 - bl sub_8097CF4 - b _08097D98 -_08097D94: - movs r0, 0 - strh r0, [r1, 0x34] -_08097D98: - pop {r0} - bx r0 - thumb_func_end sub_8097D68 - - thumb_func_start sub_8097D9C -sub_8097D9C: @ 8097D9C - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_8097B2C - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - beq _08097DC0 - ldr r0, =0x02020630 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - movs r2, 0x34 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _08097DC8 -_08097DC0: - movs r0, 0 - b _08097DCA - .pool -_08097DC8: - movs r0, 0x1 -_08097DCA: - pop {r1} - bx r1 - thumb_func_end sub_8097D9C - - thumb_func_start oe_exec_and_other_stuff -oe_exec_and_other_stuff: @ 8097DD0 - push {r4,lr} - adds r4, r0, 0 - adds r0, r1, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =0x02038c08 - adds r2, r1, 0x4 - adds r3, r1, 0 - adds r3, 0x8 - bl FieldObjectGetLocalIdAndMap - adds r0, r4, 0 - bl FieldEffectStart - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end oe_exec_and_other_stuff - - thumb_func_start DoShadowFieldEffect -DoShadowFieldEffect: @ 8097DF8 - push {lr} - adds r1, r0, 0 - ldrb r2, [r1, 0x2] - lsls r0, r2, 25 - cmp r0, 0 - blt _08097E10 - movs r0, 0x40 - orrs r0, r2 - strb r0, [r1, 0x2] - movs r0, 0x3 - bl oe_exec_and_other_stuff -_08097E10: - pop {r0} - bx r0 - thumb_func_end DoShadowFieldEffect - - thumb_func_start DoRippleFieldEffect -@ void DoRippleFieldEffect(struct npc_state *fieldObject, struct obj *object) -DoRippleFieldEffect: @ 8097E14 - push {r4,lr} - adds r4, r1, 0 - ldrb r0, [r0, 0x5] - bl GetFieldObjectGraphicsInfo - ldr r2, =0x02038c08 - movs r3, 0x20 - ldrsh r1, [r4, r3] - str r1, [r2] - movs r3, 0x22 - ldrsh r1, [r4, r3] - ldrh r0, [r0, 0xA] - lsls r0, 16 - asrs r0, 17 - adds r1, r0 - subs r1, 0x2 - str r1, [r2, 0x4] - movs r0, 0x97 - str r0, [r2, 0x8] - movs r0, 0x3 - str r0, [r2, 0xC] - movs r0, 0x5 - bl FieldEffectStart - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end DoRippleFieldEffect - - thumb_func_start sub_8097E50 -sub_8097E50: @ 8097E50 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - mov r8, r1 - movs r0, 0 - mov r12, r0 - ldr r0, =0x020375b8 - ldr r1, [r0] - adds r6, r0, 0 - cmp r1, 0 - bne _08097E80 - movs r0, 0x14 - bl AllocZeroed - str r0, [r6] - ldrb r1, [r4, 0x8] - strb r1, [r0] - ldr r1, [r6] - movs r0, 0x1 - strb r0, [r1, 0x10] - b _08097ECC - .pool -_08097E80: - movs r2, 0x10 - movs r5, 0 - movs r1, 0 - adds r3, r6, 0 - b _08097E90 -_08097E8A: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 -_08097E90: - cmp r1, 0xF - bhi _08097EB2 - cmp r2, 0x10 - bne _08097EA4 - ldr r0, [r3] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _08097EA4 - adds r2, r1, 0 -_08097EA4: - ldr r0, [r3] - adds r0, r1 - ldrb r0, [r0] - ldrb r7, [r4, 0x8] - cmp r0, r7 - bne _08097E8A - movs r5, 0x1 -_08097EB2: - cmp r5, 0 - bne _08097ECE - cmp r2, 0x10 - beq _08097ECE - ldr r0, [r6] - adds r0, r2 - ldrb r1, [r4, 0x8] - strb r1, [r0] - ldr r1, [r6] - ldrb r0, [r1, 0x10] - adds r0, 0x1 - strb r0, [r1, 0x10] - movs r0, 0x1 -_08097ECC: - mov r12, r0 -_08097ECE: - mov r1, r12 - cmp r1, 0x1 - bne _08097EE0 - ldrb r0, [r4, 0x1] - movs r1, 0x10 - orrs r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4, 0x1] -_08097EE0: - movs r0, 0x1 - mov r7, r8 - strh r0, [r7, 0x32] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8097E50 - - thumb_func_start sub_8097EF0 -sub_8097EF0: @ 8097EF0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - mov r8, r1 - movs r0, 0x1 - strh r0, [r1, 0x32] - ldr r5, =0x020375b8 - ldr r0, [r5] - cmp r0, 0 - beq _08097F68 - movs r7, 0 - adds r0, r6, 0 - bl sub_8097F78 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x10 - beq _08097F28 - ldr r0, [r5] - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r1, [r5] - ldrb r0, [r1, 0x10] - subs r0, 0x1 - strb r0, [r1, 0x10] - movs r7, 0x1 -_08097F28: - ldr r0, [r5] - ldrb r4, [r0, 0x10] - cmp r4, 0 - bne _08097F36 - bl Free - str r4, [r5] -_08097F36: - cmp r7, 0x1 - bne _08097F68 - ldrb r0, [r6, 0x5] - bl GetFieldObjectGraphicsInfo - ldrb r1, [r0, 0xC] - lsls r1, 25 - lsrs r1, 31 - lsls r1, 4 - ldrb r2, [r6, 0x1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - movs r1, 0x3 - negs r1, r1 - ands r0, r1 - strb r0, [r6, 0x1] - mov r2, r8 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_08097F68: - movs r0, 0x1 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8097EF0 - - thumb_func_start sub_8097F78 -@ signed int sub_8097F78(npc_state *a1) -sub_8097F78: @ 8097F78 - push {lr} - movs r2, 0 - ldr r1, =0x020375b8 - ldr r1, [r1] - ldrb r3, [r0, 0x8] -_08097F82: - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, r3 - bne _08097F94 - adds r0, r2, 0 - b _08097FA0 - .pool -_08097F94: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bls _08097F82 - movs r0, 0x10 -_08097FA0: - pop {r1} - bx r1 - thumb_func_end sub_8097F78 - - thumb_func_start sub_8097FA4 -sub_8097FA4: @ 8097FA4 - push {r4-r6,lr} - adds r6, r0, 0 - ldr r0, =sub_8097FE4 - movs r1, 0xFF - bl CreateTask - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - adds r0, r4, 0 - adds r0, 0x8 - adds r1, r6, 0 - bl sub_806F67C - strb r5, [r6, 0x1B] - ldr r0, =0x0000ffff - strh r0, [r4, 0xE] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8097FA4 - - thumb_func_start sub_8097FE4 -sub_8097FE4: @ 8097FE4 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r4, r1, r0 - adds r0, r4, 0 - adds r0, 0x8 - mov r1, sp - bl sub_806F684 - ldr r0, [sp] - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r2, r0, r1 - ldrh r1, [r4, 0xC] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _08098020 - ldrh r0, [r4, 0xE] - ldrh r1, [r2, 0x26] - adds r0, r1 - strh r0, [r2, 0x26] -_08098020: - ldrh r1, [r4, 0xC] - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - bne _08098030 - ldrh r0, [r4, 0xE] - negs r0, r0 - strh r0, [r4, 0xE] -_08098030: - adds r0, r1, 0x1 - strh r0, [r4, 0xC] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8097FE4 - - thumb_func_start sub_8098044 -sub_8098044: @ 8098044 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r0, r1 - adds r0, 0x8 - mov r1, sp - bl sub_806F684 - adds r0, r4, 0 - bl DestroyTask - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8098044 - - thumb_func_start sub_8098074 -sub_8098074: @ 8098074 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - movs r4, 0 - ldr r7, =0x02037350 -_08098082: - cmp r4, r6 - beq _080980A8 - cmp r4, r5 - beq _080980A8 - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - adds r1, r0, r7 - ldrb r0, [r1] - lsls r0, 31 - cmp r0, 0 - beq _080980A8 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - cmp r4, r0 - beq _080980A8 - adds r0, r1, 0 - bl sub_8097404 -_080980A8: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _08098082 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8098074 - - thumb_func_start sub_80980C0 -sub_80980C0: @ 80980C0 - movs r0, 0 - strh r0, [r1, 0x26] - ldrh r0, [r1, 0x32] - adds r0, 0x1 - strh r0, [r1, 0x32] - movs r0, 0 - bx lr - thumb_func_end sub_80980C0 - - thumb_func_start sub_80980D0 -sub_80980D0: @ 80980D0 - push {lr} - adds r2, r1, 0 - ldrh r0, [r2, 0x26] - subs r0, 0x8 - strh r0, [r2, 0x26] - lsls r0, 16 - asrs r0, 16 - movs r1, 0xA0 - negs r1, r1 - cmp r0, r1 - bne _080980EC - ldrh r0, [r2, 0x32] - adds r0, 0x1 - strh r0, [r2, 0x32] -_080980EC: - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_80980D0 - - thumb_func_start sub_80980F4 -sub_80980F4: @ 80980F4 - ldr r0, =0x0000ff60 - strh r0, [r1, 0x26] - ldrh r0, [r1, 0x32] - adds r0, 0x1 - strh r0, [r1, 0x32] - movs r0, 0 - bx lr - .pool - thumb_func_end sub_80980F4 - - thumb_func_start sub_8098108 -sub_8098108: @ 8098108 - push {lr} - ldrh r0, [r1, 0x26] - adds r0, 0x8 - strh r0, [r1, 0x26] - lsls r0, 16 - cmp r0, 0 - bne _0809811C - ldrh r0, [r1, 0x32] - adds r0, 0x1 - strh r0, [r1, 0x32] -_0809811C: - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_8098108 - - thumb_func_start sub_8098124 -sub_8098124: @ 8098124 - movs r0, 0x1 - bx lr - thumb_func_end sub_8098124 - - thumb_func_start sub_8098128 -sub_8098128: @ 8098128 - ldr r1, =0x020375bc - movs r0, 0 - strb r0, [r1] - ldr r2, =0x03003014 - ldrb r1, [r2] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - movs r1, 0x3 - negs r1, r1 - ands r0, r1 - subs r1, 0x2 - ands r0, r1 - subs r1, 0x4 - ands r0, r1 - strb r0, [r2] - bx lr - .pool - thumb_func_end sub_8098128 - - thumb_func_start sub_8098154 -sub_8098154: @ 8098154 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _08098188 - cmp r0, 0x1 - bgt _0809817C - cmp r0, 0 - beq _08098182 - b _080981B0 - .pool -_0809817C: - cmp r0, 0x2 - beq _08098198 - b _080981B0 -_08098182: - bl sub_81973A4 - b _08098190 -_08098188: - movs r0, 0 - movs r1, 0x1 - bl sub_81973C4 -_08098190: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080981B0 -_08098198: - bl sub_8197224 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - beq _080981B0 - ldr r1, =0x020375bc - movs r0, 0 - strb r0, [r1] - adds r0, r5, 0 - bl DestroyTask -_080981B0: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8098154 - - thumb_func_start task_add_textbox -task_add_textbox: @ 80981BC - push {lr} - ldr r0, =sub_8098154 - movs r1, 0x50 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end task_add_textbox - - thumb_func_start task_del_textbox -task_del_textbox: @ 80981D0 - push {lr} - ldr r0, =sub_8098154 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _080981E4 - bl DestroyTask -_080981E4: - pop {r0} - bx r0 - .pool - thumb_func_end task_del_textbox - - thumb_func_start box_related_two__2 -box_related_two__2: @ 80981EC - push {r4,lr} - adds r1, r0, 0 - ldr r4, =0x020375bc - ldrb r0, [r4] - cmp r0, 0 - bne _0809820C - adds r0, r1, 0 - movs r1, 0x1 - bl textbox_fdecode_auto_and_task_add - movs r0, 0x2 - strb r0, [r4] - movs r0, 0x1 - b _0809820E - .pool -_0809820C: - movs r0, 0 -_0809820E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end box_related_two__2 - - thumb_func_start sub_8098214 -sub_8098214: @ 8098214 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8196094 - adds r1, r0, 0 - cmp r1, 0 - bne _0809822E - ldr r0, =0x020375bc - strb r1, [r0] - adds r0, r4, 0 - bl DestroyTask -_0809822E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8098214 - - thumb_func_start sub_8098238 -sub_8098238: @ 8098238 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x020375bc - ldrb r0, [r5] - cmp r0, 0 - bne _08098270 - ldr r0, =0x02021fc4 - adds r1, r4, 0 - bl ExpandStringRefs - ldr r0, =sub_8098214 - movs r1, 0 - bl CreateTask - adds r0, r4, 0 - bl sub_8196080 - movs r0, 0x2 - strb r0, [r5] - movs r0, 0x1 - b _08098272 - .pool -_08098270: - movs r0, 0 -_08098272: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8098238 - - thumb_func_start box_related_two__3 -box_related_two__3: @ 8098278 - push {lr} - adds r1, r0, 0 - ldr r2, =0x020375bc - ldrb r0, [r2] - cmp r0, 0 - bne _08098298 - movs r0, 0x3 - strb r0, [r2] - adds r0, r1, 0 - movs r1, 0 - bl textbox_fdecode_auto_and_task_add - movs r0, 0x1 - b _0809829A - .pool -_08098298: - movs r0, 0 -_0809829A: - pop {r1} - bx r1 - thumb_func_end box_related_two__3 - - thumb_func_start sub_80982A0 -sub_80982A0: @ 80982A0 - push {lr} - ldr r2, =0x020375bc - movs r1, 0x3 - strb r1, [r2] - movs r1, 0x1 - bl textbox_fdecode_auto_and_task_add - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80982A0 - - thumb_func_start sub_80982B8 -sub_80982B8: @ 80982B8 - push {lr} - ldr r1, =0x020375bc - ldrb r0, [r1] - cmp r0, 0 - bne _080982D4 - movs r0, 0x2 - strb r0, [r1] - bl textbox_auto_and_task_add - movs r0, 0x1 - b _080982D6 - .pool -_080982D4: - movs r0, 0 -_080982D6: - pop {r1} - bx r1 - thumb_func_end sub_80982B8 - - thumb_func_start textbox_fdecode_auto_and_task_add -textbox_fdecode_auto_and_task_add: @ 80982DC - push {r4,lr} - adds r2, r0, 0 - adds r4, r1, 0 - ldr r0, =0x02021fc4 - adds r1, r2, 0 - bl ExpandStringRefs - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl AddTextPrinterForMessage - bl task_add_textbox - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end textbox_fdecode_auto_and_task_add - - thumb_func_start textbox_auto_and_task_add -textbox_auto_and_task_add: @ 8098304 - push {lr} - movs r0, 0x1 - bl AddTextPrinterForMessage - bl task_add_textbox - pop {r0} - bx r0 - thumb_func_end textbox_auto_and_task_add - - thumb_func_start textbox_close -textbox_close: @ 8098314 - push {lr} - bl task_del_textbox - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - ldr r1, =0x020375bc - movs r0, 0 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end textbox_close - - thumb_func_start textbox_any_visible -textbox_any_visible: @ 8098330 - ldr r0, =0x020375bc - ldrb r0, [r0] - bx lr - .pool - thumb_func_end textbox_any_visible - - thumb_func_start sub_809833C -sub_809833C: @ 809833C - push {lr} - ldr r0, =0x020375bc - ldrb r0, [r0] - cmp r0, 0 - beq _08098350 - movs r0, 0 - b _08098352 - .pool -_08098350: - movs r0, 0x1 -_08098352: - pop {r1} - bx r1 - thumb_func_end sub_809833C - - thumb_func_start sub_8098358 -sub_8098358: @ 8098358 - push {lr} - bl task_del_textbox - movs r0, 0 - movs r1, 0x1 - bl sub_81973FC - ldr r1, =0x020375bc - movs r0, 0 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8098358 - - thumb_func_start sub_8098374 -sub_8098374: @ 8098374 - push {lr} - bl task_del_textbox - ldr r1, =0x020375bc - movs r0, 0 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8098374 - - thumb_func_start walkrun_is_standing_still -walkrun_is_standing_still: @ 8098388 - push {lr} - ldr r0, =0x02037590 - ldrb r0, [r0, 0x3] - cmp r0, 0x1 - beq _0809839C - movs r0, 0x1 - b _0809839E - .pool -_0809839C: - movs r0, 0 -_0809839E: - pop {r1} - bx r1 - thumb_func_end walkrun_is_standing_still - - thumb_func_start sub_80983A4 -sub_80983A4: @ 80983A4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl walkrun_is_standing_still - lsls r0, 24 - cmp r0, 0 - beq _080983BE - bl sub_808B864 - adds r0, r4, 0 - bl DestroyTask -_080983BE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80983A4 - - thumb_func_start sub_80983C4 -sub_80983C4: @ 80983C4 - push {lr} - ldr r0, =sub_80983A4 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _080983E0 - bl sub_808BCF4 - movs r0, 0x1 - b _080983E2 - .pool -_080983E0: - movs r0, 0 -_080983E2: - pop {r1} - bx r1 - thumb_func_end sub_80983C4 - - thumb_func_start sub_80983E8 -sub_80983E8: @ 80983E8 - push {lr} - bl player_bitmagic - ldr r0, =sub_80983A4 - movs r1, 0x50 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80983E8 - - thumb_func_start sub_8098400 -sub_8098400: @ 8098400 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0809842A - bl walkrun_is_standing_still - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bne _0809842A - bl sub_808B864 - strh r4, [r5, 0x8] -_0809842A: - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _08098452 - ldr r2, =0x02037350 - ldr r0, =0x03005df0 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - ldrb r0, [r1] - lsls r0, 30 - cmp r0, 0 - blt _08098452 - adds r0, r1, 0 - bl sub_8097404 - movs r0, 0x1 - strh r0, [r5, 0xA] -_08098452: - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08098468 - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08098468 - adds r0, r6, 0 - bl DestroyTask -_08098468: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8098400 - - thumb_func_start sub_809847C -sub_809847C: @ 809847C - push {lr} - ldr r0, =sub_8098400 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _08098498 - bl sub_808BCF4 - movs r0, 0x1 - b _0809849A - .pool -_08098498: - movs r0, 0 -_0809849A: - pop {r1} - bx r1 - thumb_func_end sub_809847C - - thumb_func_start sub_80984A0 -sub_80984A0: @ 80984A0 - push {r4,r5,lr} - ldr r4, =0x03005df0 - ldrb r0, [r4] - bl sub_80974D0 - ldr r0, =sub_8098400 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, =0x02037350 - ldrb r1, [r4] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - ldrb r0, [r1] - lsls r0, 30 - cmp r0, 0 - blt _080984DE - adds r0, r1, 0 - bl sub_8097404 - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0xA] -_080984DE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80984A0 - - thumb_func_start sub_80984F4 -sub_80984F4: @ 80984F4 - push {lr} - 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, =0x02037350 - adds r0, r1 - bl FieldObjectClearAnimIfSpecialAnimFinished - bl sub_80D338C - bl sub_809757C - pop {r0} - bx r0 - .pool - thumb_func_end sub_80984F4 - - thumb_func_start sub_8098524 -sub_8098524: @ 8098524 - push {r4,lr} - ldr r4, =0x02037350 - ldr r0, =0x03005df0 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r4 - ldrb r0, [r1] - lsls r0, 31 - cmp r0, 0 - beq _08098542 - adds r0, r1, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished -_08098542: - 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 - adds r0, r4 - bl FieldObjectClearAnimIfSpecialAnimFinished - bl sub_80D338C - bl sub_809757C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8098524 - - thumb_func_start sub_8098574 -sub_8098574: @ 8098574 - push {lr} - ldr r0, =0x03005df0 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldr r1, =0x020375f4 - ldrb r1, [r1] - bl FieldObjectFaceOppositeDirection - pop {r0} - bx r0 - .pool - thumb_func_end sub_8098574 - - thumb_func_start sub_809859C -sub_809859C: @ 809859C - push {lr} - ldr r0, =0x03005df0 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - bl FieldObjectClearAnimIfSpecialAnimActive - pop {r0} - bx r0 - .pool - thumb_func_end sub_809859C - - thumb_func_start sub_80985BC -sub_80985BC: @ 80985BC - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r5, r0, r1 - ldrb r7, [r5, 0xC] - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _080985E8 - bl walkrun_is_standing_still - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bne _080985E8 - bl sub_808B864 - strh r4, [r5, 0x8] -_080985E8: - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0809860C - ldr r0, =0x02037350 - lsls r1, r7, 3 - adds r1, r7 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 30 - cmp r0, 0 - blt _0809860C - adds r0, r1, 0 - bl sub_8097404 - movs r0, 0x1 - strh r0, [r5, 0xA] -_0809860C: - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08098622 - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08098622 - adds r0, r6, 0 - bl DestroyTask -_08098622: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80985BC - - thumb_func_start sub_8098630 -sub_8098630: @ 8098630 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r0, 0 - bl sub_80B47E0 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x030060a8 - ldrb r0, [r0] - cmp r0, 0x2 - bne _080986E0 - movs r0, 0x1 - bl sub_80B47E0 - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8098074 - ldr r7, =sub_80985BC - adds r0, r7, 0 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x03005e00 - mov r9, r0 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - mov r1, r9 - adds r6, r0, r1 - strh r4, [r6, 0xC] - ldr r2, =0x02037350 - mov r8, r2 - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - adds r1, r0, r2 - ldrb r0, [r1] - lsls r0, 30 - cmp r0, 0 - blt _0809869A - adds r0, r1, 0 - bl sub_8097404 - movs r0, 0x1 - strh r0, [r6, 0xA] -_0809869A: - adds r0, r7, 0 - movs r1, 0x51 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - mov r1, r9 - adds r4, r0, r1 - strh r5, [r4, 0xC] - lsls r0, r5, 3 - adds r0, r5 - lsls r0, 2 - mov r2, r8 - adds r1, r0, r2 - ldrb r0, [r1] - lsls r0, 30 - cmp r0, 0 - blt _0809871A - adds r0, r1, 0 - bl sub_8097404 - movs r0, 0x1 - strh r0, [r4, 0xA] - b _0809871A - .pool -_080986E0: - adds r0, r4, 0 - bl sub_80974D0 - ldr r0, =sub_80985BC - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r5, r0, r1 - strh r4, [r5, 0xC] - ldr r1, =0x02037350 - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - adds r1, r0, r1 - ldrb r0, [r1] - lsls r0, 30 - cmp r0, 0 - blt _0809871A - adds r0, r1, 0 - bl sub_8097404 - movs r0, 0x1 - strh r0, [r5, 0xA] -_0809871A: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8098630 - - thumb_func_start sub_8098734 -sub_8098734: @ 8098734 - push {lr} - ldr r0, =sub_80985BC - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _08098750 - bl sub_808BCF4 - movs r0, 0x1 - b _08098752 - .pool -_08098750: - movs r0, 0 -_08098752: - pop {r1} - bx r1 - thumb_func_end sub_8098734 - - thumb_func_start sub_8098758 -sub_8098758: @ 8098758 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - bhi _08098770 - lsls r0, 3 - ldr r1, =gUnknown_0851021C - adds r0, r1 - b _08098772 - .pool -_08098770: - ldr r0, =gUnknown_0851021C -_08098772: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8098758 - - thumb_func_start copy_textbox_border_tile_patterns_to_vram -@ void copy_textbox_border_tile_patterns_to_vram(u8 rbox_id, u16 tile_pattern_dest_offset, u8 pal_dest_offset) -copy_textbox_border_tile_patterns_to_vram: @ 809877C - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - movs r1, 0 - bl GetWindowAttribute - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_08DDD748 - movs r2, 0xE0 - lsls r2, 1 - adds r3, r4, 0 - bl LoadBgTiles - bl sub_8098C64 - adds r1, r5, 0 - movs r2, 0x20 - bl gpu_pal_apply - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end copy_textbox_border_tile_patterns_to_vram - - thumb_func_start box_border_load_tiles_and_pal -box_border_load_tiles_and_pal: @ 80987BC - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - bl sub_809882C - pop {r0} - bx r0 - thumb_func_end box_border_load_tiles_and_pal - - thumb_func_start sub_80987D4 -sub_80987D4: @ 80987D4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r4, r1, 0 - adds r6, r2, 0 - mov r8, r3 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r6, 16 - lsrs r6, 16 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - movs r1, 0 - bl GetWindowAttribute - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_0851021C - lsls r4, 3 - adds r1, r4, r5 - ldr r1, [r1] - movs r2, 0x90 - lsls r2, 1 - adds r3, r6, 0 - bl LoadBgTiles - adds r5, 0x4 - adds r4, r5 - ldr r0, [r4] - mov r1, r8 - movs r2, 0x20 - bl gpu_pal_apply - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80987D4 - - thumb_func_start sub_809882C -sub_809882C: @ 809882C - push {r4,lr} - adds r4, r1, 0 - adds r3, r2, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 16 - lsrs r4, 16 - lsls r3, 24 - lsrs r3, 24 - ldr r1, =0x03005d90 - ldr r1, [r1] - ldrb r1, [r1, 0x14] - lsrs r1, 3 - adds r2, r4, 0 - bl sub_80987D4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809882C - - thumb_func_start sub_8098858 -sub_8098858: @ 8098858 - 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 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 16 - lsrs r5, 16 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0xC] - adds r0, r4, 0 - movs r1, 0 - bl GetWindowAttribute - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r4, 0 - movs r1, 0x1 - bl GetWindowAttribute - mov r8, r0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - adds r0, r4, 0 - movs r1, 0x2 - bl GetWindowAttribute - adds r6, r0, 0 - lsls r6, 16 - lsrs r6, 16 - adds r0, r4, 0 - movs r1, 0x3 - bl GetWindowAttribute - mov r9, r0 - mov r2, r9 - lsls r2, 16 - lsrs r2, 16 - mov r9, r2 - adds r0, r4, 0 - movs r1, 0x4 - bl GetWindowAttribute - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x10] - mov r0, r8 - subs r0, 0x1 - lsls r2, r0, 24 - lsrs r2, 24 - str r2, [sp, 0x14] - subs r4, r6, 0x1 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - mov r10, r0 - str r0, [sp] - str r0, [sp, 0x4] - ldr r2, [sp, 0xC] - str r2, [sp, 0x8] - adds r0, r7, 0 - adds r1, r5, 0 - ldr r2, [sp, 0x14] - adds r3, r4, 0 - bl FillBgTilemapBufferRect - adds r1, r5, 0x1 - lsls r1, 16 - lsrs r1, 16 - mov r0, r8 - lsls r2, r0, 24 - lsrs r2, 24 - str r2, [sp, 0x18] - mov r2, r9 - lsls r0, r2, 24 - lsrs r0, 24 - str r0, [sp, 0x1C] - str r0, [sp] - mov r0, r10 - str r0, [sp, 0x4] - ldr r2, [sp, 0xC] - str r2, [sp, 0x8] - adds r0, r7, 0 - ldr r2, [sp, 0x18] - adds r3, r4, 0 - bl FillBgTilemapBufferRect - adds r1, r5, 0x2 - lsls r1, 16 - lsrs r1, 16 - add r8, r9 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - mov r2, r10 - str r2, [sp] - str r2, [sp, 0x4] - ldr r0, [sp, 0xC] - str r0, [sp, 0x8] - adds r0, r7, 0 - mov r2, r8 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - adds r1, r5, 0x3 - lsls r1, 16 - lsrs r1, 16 - lsls r2, r6, 24 - lsrs r2, 24 - mov r9, r2 - mov r0, r10 - str r0, [sp] - ldr r2, [sp, 0x10] - lsls r4, r2, 24 - lsrs r4, 24 - str r4, [sp, 0x4] - ldr r0, [sp, 0xC] - str r0, [sp, 0x8] - adds r0, r7, 0 - ldr r2, [sp, 0x14] - mov r3, r9 - bl FillBgTilemapBufferRect - adds r1, r5, 0x5 - lsls r1, 16 - lsrs r1, 16 - mov r2, r10 - str r2, [sp] - str r4, [sp, 0x4] - ldr r0, [sp, 0xC] - str r0, [sp, 0x8] - adds r0, r7, 0 - mov r2, r8 - mov r3, r9 - bl FillBgTilemapBufferRect - adds r1, r5, 0x6 - lsls r1, 16 - lsrs r1, 16 - ldr r2, [sp, 0x10] - adds r6, r2 - lsls r6, 24 - lsrs r6, 24 - mov r0, r10 - str r0, [sp] - str r0, [sp, 0x4] - ldr r2, [sp, 0xC] - str r2, [sp, 0x8] - adds r0, r7, 0 - ldr r2, [sp, 0x14] - adds r3, r6, 0 - bl FillBgTilemapBufferRect - adds r1, r5, 0x7 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x1C] - str r0, [sp] - mov r2, r10 - str r2, [sp, 0x4] - ldr r0, [sp, 0xC] - str r0, [sp, 0x8] - adds r0, r7, 0 - ldr r2, [sp, 0x18] - adds r3, r6, 0 - bl FillBgTilemapBufferRect - adds r5, 0x8 - lsls r5, 16 - lsrs r5, 16 - mov r2, r10 - str r2, [sp] - str r2, [sp, 0x4] - ldr r0, [sp, 0xC] - str r0, [sp, 0x8] - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, r8 - adds r3, r6, 0 - bl FillBgTilemapBufferRect - 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_8098858 - - thumb_func_start sub_80989E0 -sub_80989E0: @ 80989E0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - adds r4, r0, 0 - mov r9, r1 - lsls r4, 24 - lsrs r4, 24 - mov r0, r9 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - adds r0, r4, 0 - movs r1, 0 - bl GetWindowAttribute - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r4, 0 - movs r1, 0x1 - bl GetWindowAttribute - mov r8, r0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - adds r0, r4, 0 - movs r1, 0x2 - bl GetWindowAttribute - adds r6, r0, 0 - lsls r6, 16 - lsrs r6, 16 - adds r0, r4, 0 - movs r1, 0x3 - bl GetWindowAttribute - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0x4 - bl GetWindowAttribute - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0xC] - mov r0, r8 - lsls r2, r0, 24 - lsrs r2, 24 - str r2, [sp, 0x10] - lsls r4, r6, 24 - lsrs r4, 24 - movs r0, 0x1 - str r0, [sp] - str r0, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - adds r0, r7, 0 - mov r1, r9 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - mov r1, r9 - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - mov r0, r8 - adds r0, 0x1 - lsls r2, r0, 24 - lsrs r2, 24 - str r2, [sp, 0x14] - subs r0, r5, 0x2 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x18] - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - adds r0, r7, 0 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - mov r1, r9 - adds r1, 0x2 - lsls r1, 16 - lsrs r1, 16 - add r8, r5 - movs r0, 0x1 - negs r0, r0 - add r8, r0 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r0, 0x1 - str r0, [sp] - str r0, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - adds r0, r7, 0 - mov r2, r8 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - mov r1, r9 - adds r1, 0x3 - lsls r1, 16 - lsrs r1, 16 - adds r5, r6, 0x1 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0x1 - str r0, [sp] - ldr r4, [sp, 0xC] - subs r4, 0x2 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - adds r0, r7, 0 - ldr r2, [sp, 0x10] - adds r3, r5, 0 - bl FillBgTilemapBufferRect - mov r1, r9 - adds r1, 0x5 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x1 - str r0, [sp] - str r4, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - adds r0, r7, 0 - mov r2, r8 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - mov r1, r9 - adds r1, 0x6 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0xC] - adds r6, r0 - subs r6, 0x1 - lsls r6, 24 - lsrs r6, 24 - movs r0, 0x1 - str r0, [sp] - str r0, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - adds r0, r7, 0 - ldr r2, [sp, 0x10] - adds r3, r6, 0 - bl FillBgTilemapBufferRect - mov r1, r9 - adds r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [sp, 0x18] - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - adds r0, r7, 0 - ldr r2, [sp, 0x14] - adds r3, r6, 0 - bl FillBgTilemapBufferRect - movs r0, 0x8 - add r9, r0 - mov r0, r9 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - movs r0, 0x1 - str r0, [sp] - str r0, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - adds r0, r7, 0 - mov r1, r9 - mov r2, r8 - adds r3, r6, 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 - thumb_func_end sub_80989E0 - - thumb_func_start rbox_fill_rectangle -rbox_fill_rectangle: @ 8098B7C - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0xC - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - adds r0, r6, 0 - movs r1, 0 - bl GetWindowAttribute - mov r9, r0 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - adds r0, r6, 0 - movs r1, 0x1 - bl GetWindowAttribute - mov r8, r0 - mov r1, r8 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - adds r0, r6, 0 - movs r1, 0x2 - bl GetWindowAttribute - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r6, 0 - movs r1, 0x3 - bl GetWindowAttribute - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r6, 0 - movs r1, 0x4 - bl GetWindowAttribute - movs r1, 0x1 - negs r1, r1 - add r8, r1 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - subs r5, 0x1 - lsls r5, 24 - lsrs r5, 24 - adds r4, 0x2 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp] - lsls r0, 24 - movs r1, 0x80 - lsls r1, 18 - adds r0, r1 - lsrs r0, 24 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - mov r0, r9 - movs r1, 0 - mov r2, r8 - adds r3, r5, 0 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end rbox_fill_rectangle - - thumb_func_start stdpal_get -stdpal_get: @ 8098C18 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bhi _08098C54 - lsls r0, 2 - ldr r1, =_08098C30 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08098C30: - .4byte _08098C44 - .4byte _08098C48 - .4byte _08098C4C - .4byte _08098C50 - .4byte _08098C54 -_08098C44: - movs r0, 0 - b _08098C56 -_08098C48: - movs r0, 0x10 - b _08098C56 -_08098C4C: - movs r0, 0x20 - b _08098C56 -_08098C50: - movs r0, 0x30 - b _08098C56 -_08098C54: - movs r0, 0x40 -_08098C56: - lsls r0, 1 - ldr r1, =gUnknown_0851017C - adds r0, r1 - pop {r1} - bx r1 - .pool - thumb_func_end stdpal_get - - thumb_func_start sub_8098C64 -sub_8098C64: @ 8098C64 - ldr r0, =gUnknown_08DDD728 - bx lr - .pool - thumb_func_end sub_8098C64 - - thumb_func_start sub_8098C6C -sub_8098C6C: @ 8098C6C - push {r4,r5,lr} - adds r3, r1, 0 - adds r4, r2, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r3, 16 - lsrs r3, 16 - lsls r4, 24 - lsrs r4, 24 - ldr r2, =gUnknown_0851021C - ldr r5, =0x03005d90 - ldr r1, [r5] - ldrb r1, [r1, 0x14] - lsrs r1, 3 - lsls r1, 3 - adds r1, r2 - ldr r1, [r1] - movs r2, 0x90 - lsls r2, 1 - bl LoadBgTiles - ldr r0, [r5] - ldrb r0, [r0, 0x14] - lsrs r0, 3 - bl sub_8098758 - ldr r0, [r0, 0x4] - adds r1, r4, 0 - movs r2, 0x20 - bl gpu_pal_apply - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8098C6C - - thumb_func_start script_env_init -@ void script_env_init(script_env *env, int a2, int a3) -script_env_init: @ 8098CB8 - push {lr} - adds r3, r0, 0 - movs r0, 0 - strb r0, [r3, 0x1] - str r0, [r3, 0x8] - strb r0, [r3] - str r0, [r3, 0x4] - str r1, [r3, 0x5C] - str r2, [r3, 0x60] - movs r2, 0 - movs r1, 0x3 - adds r0, r3, 0 - adds r0, 0x70 -_08098CD2: - str r2, [r0] - subs r0, 0x4 - subs r1, 0x1 - cmp r1, 0 - bge _08098CD2 - adds r1, r3, 0 - adds r1, 0xC - movs r2, 0 - adds r0, r3, 0 - adds r0, 0x58 -_08098CE6: - str r2, [r0] - subs r0, 0x4 - cmp r0, r1 - bge _08098CE6 - pop {r0} - bx r0 - thumb_func_end script_env_init - - thumb_func_start script_setup_bytecode_script -@ int script_setup_bytecode_script(script_env *env, void *script_ptr) -script_setup_bytecode_script: @ 8098CF4 - str r1, [r0, 0x8] - movs r1, 0x1 - strb r1, [r0, 0x1] - movs r0, 0x1 - bx lr - thumb_func_end script_setup_bytecode_script - - thumb_func_start script_setup_asm_script -script_setup_asm_script: @ 8098D00 - movs r2, 0x2 - strb r2, [r0, 0x1] - str r1, [r0, 0x4] - bx lr - thumb_func_end script_setup_asm_script - - thumb_func_start script_stop -@ void script_stop(script_env *env) -script_stop: @ 8098D08 - movs r1, 0 - strb r1, [r0, 0x1] - str r1, [r0, 0x8] - bx lr - thumb_func_end script_stop - - thumb_func_start script_main_handler -@ int script_main_handler(script_env *env) -script_main_handler: @ 8098D10 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _08098D1E -_08098D1A: - movs r0, 0 - b _08098D90 -_08098D1E: - ldrb r0, [r4, 0x1] - cmp r0, 0x1 - beq _08098D56 - cmp r0, 0x1 - bgt _08098D2E - cmp r0, 0 - beq _08098D1A - b _08098D8E -_08098D2E: - cmp r0, 0x2 - bne _08098D8E - ldr r0, [r4, 0x4] - cmp r0, 0 - beq _08098D52 - bl _call_via_r0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08098D8E - strb r0, [r4, 0x1] - b _08098D8E -_08098D48: - strb r2, [r4, 0x1] - b _08098D1A -_08098D4C: - movs r0, 0 - strb r0, [r4, 0x1] - b _08098D90 -_08098D52: - movs r0, 0x1 - strb r0, [r4, 0x1] -_08098D56: - ldr r2, [r4, 0x8] - cmp r2, 0 - beq _08098D48 - ldr r0, =gUnknown_085102BC - ldr r0, [r0] - cmp r2, r0 - bne _08098D6C -_08098D64: - swi 0x2 - b _08098D64 - .pool -_08098D6C: - ldrb r1, [r2] - adds r0, r2, 0x1 - str r0, [r4, 0x8] - lsls r1, 2 - ldr r0, [r4, 0x5C] - adds r1, r0, r1 - ldr r0, [r4, 0x60] - cmp r1, r0 - bcs _08098D4C - ldr r1, [r1] - adds r0, r4, 0 - bl _call_via_r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08098D56 -_08098D8E: - movs r0, 0x1 -_08098D90: - pop {r4} - pop {r1} - bx r1 - thumb_func_end script_main_handler - - thumb_func_start script_stack_push -@ int script_stack_push(script_env *env, int value) -script_stack_push: @ 8098D98 - push {lr} - adds r2, r0, 0 - adds r3, r1, 0 - ldrb r1, [r2] - adds r0, r1, 0x1 - cmp r0, 0x13 - bgt _08098DBA - lsls r0, r1, 2 - adds r1, r2, 0 - adds r1, 0xC - adds r1, r0 - str r3, [r1] - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - movs r0, 0 - b _08098DBC -_08098DBA: - movs r0, 0x1 -_08098DBC: - pop {r1} - bx r1 - thumb_func_end script_stack_push - - thumb_func_start script_stack_pop -@ int script_stack_pop(script_env *env) -script_stack_pop: @ 8098DC0 - push {lr} - adds r2, r0, 0 - ldrb r0, [r2] - cmp r0, 0 - beq _08098DDC - subs r0, 0x1 - strb r0, [r2] - ldrb r1, [r2] - lsls r1, 2 - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1 - ldr r0, [r0] - b _08098DDE -_08098DDC: - movs r0, 0 -_08098DDE: - pop {r1} - bx r1 - thumb_func_end script_stack_pop - - thumb_func_start script_jump -@ void script_jump(script_env *env, int address) -script_jump: @ 8098DE4 - str r1, [r0, 0x8] - bx lr - thumb_func_end script_jump - - thumb_func_start script_call -@ void script_call(script_env *env, int address) -script_call: @ 8098DE8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, [r4, 0x8] - bl script_stack_push - str r5, [r4, 0x8] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end script_call - - thumb_func_start script_return -@ void script_return(script_env *env) -script_return: @ 8098DFC - push {r4,lr} - adds r4, r0, 0 - bl script_stack_pop - str r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - thumb_func_end script_return - - thumb_func_start script_read_halfword -@ int script_read_halfword(script_env *env) -script_read_halfword: @ 8098E0C - adds r3, r0, 0 - ldr r2, [r3, 0x8] - ldrb r0, [r2] - adds r2, 0x1 - str r2, [r3, 0x8] - ldrb r1, [r2] - lsls r1, 8 - orrs r0, r1 - adds r2, 0x1 - str r2, [r3, 0x8] - bx lr - thumb_func_end script_read_halfword - - thumb_func_start script_read_word -@ int script_read_word(script_env *env) -script_read_word: @ 8098E24 - push {r4-r6,lr} - adds r3, r0, 0 - ldr r0, [r3, 0x8] - ldrb r6, [r0] - adds r0, 0x1 - str r0, [r3, 0x8] - ldrb r5, [r0] - adds r2, r0, 0x1 - str r2, [r3, 0x8] - ldrb r4, [r0, 0x1] - adds r1, r2, 0x1 - str r1, [r3, 0x8] - ldrb r0, [r2, 0x1] - adds r1, 0x1 - str r1, [r3, 0x8] - lsls r0, 8 - adds r0, r4 - lsls r0, 8 - adds r0, r5 - lsls r0, 8 - adds r0, r6 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end script_read_word - - thumb_func_start script_env_2_enable -script_env_2_enable: @ 8098E54 - ldr r1, =0x03000f2c - movs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end script_env_2_enable - - thumb_func_start script_env_2_disable -@ void script_env_2_disable() -script_env_2_disable: @ 8098E60 - ldr r1, =0x03000f2c - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end script_env_2_disable - - thumb_func_start script_env_2_is_enabled -@ int script_env_2_is_enabled() -script_env_2_is_enabled: @ 8098E6C - ldr r0, =0x03000f2c - ldrb r0, [r0] - bx lr - .pool - thumb_func_end script_env_2_is_enabled - - thumb_func_start script_env_context_is_running -@ int script_env_context_is_running() -script_env_context_is_running: @ 8098E78 - push {lr} - ldr r0, =0x03000e38 - ldrb r0, [r0] - cmp r0, 0 - beq _08098E8C - movs r0, 0 - b _08098E8E - .pool -_08098E8C: - movs r0, 0x1 -_08098E8E: - pop {r1} - bx r1 - thumb_func_end script_env_context_is_running - - thumb_func_start script_env_1_init -script_env_1_init: @ 8098E94 - push {lr} - ldr r0, =0x03000e40 - ldr r1, =gEventScriptCommandFunctionTable - ldr r2, =gUnknown_081DBA08 - bl script_env_init - ldr r1, =0x03000e38 - movs r0, 0x2 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end script_env_1_init - - thumb_func_start script_env_2_run_current_script -script_env_2_run_current_script: @ 8098EBC - push {r4,lr} - ldr r4, =0x03000e38 - ldrb r0, [r4] - cmp r0, 0x2 - beq _08098EF0 - cmp r0, 0x1 - beq _08098EF0 - bl script_env_2_enable - ldr r0, =0x03000e40 - bl script_main_handler - lsls r0, 24 - cmp r0, 0 - beq _08098EE8 - movs r0, 0x1 - b _08098EF2 - .pool -_08098EE8: - movs r0, 0x2 - strb r0, [r4] - bl script_env_2_disable -_08098EF0: - movs r0, 0 -_08098EF2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end script_env_2_run_current_script - - thumb_func_start script_env_1_execute_new_script -script_env_1_execute_new_script: @ 8098EF8 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x03000e40 - ldr r1, =gEventScriptCommandFunctionTable - ldr r2, =gUnknown_081DBA08 - adds r0, r4, 0 - bl script_env_init - adds r0, r4, 0 - adds r1, r5, 0 - bl script_setup_bytecode_script - bl script_env_2_enable - ldr r1, =0x03000e38 - movs r0, 0 - strb r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end script_env_1_execute_new_script - - thumb_func_start script_env_2_set_ctx_paused -script_env_2_set_ctx_paused: @ 8098F30 - ldr r1, =0x03000e38 - movs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end script_env_2_set_ctx_paused - - thumb_func_start script_env_2_enable_and_set_ctx_running -script_env_2_enable_and_set_ctx_running: @ 8098F3C - push {lr} - ldr r1, =0x03000e38 - movs r0, 0 - strb r0, [r1] - bl script_env_2_enable - pop {r0} - bx r0 - .pool - thumb_func_end script_env_2_enable_and_set_ctx_running - - thumb_func_start script_env_2_execute_new_script -@ void script_env_2_execute_new_script(void *script_ptr) -script_env_2_execute_new_script: @ 8098F50 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x03000eb8 - ldr r1, =gEventScriptCommandFunctionTable - ldr r2, =gUnknown_081DBA08 - adds r0, r4, 0 - bl script_env_init - adds r0, r4, 0 - adds r1, r5, 0 - bl script_setup_bytecode_script -_08098F68: - ldr r0, =0x03000eb8 - bl script_main_handler - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08098F68 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end script_env_2_execute_new_script - - thumb_func_start mapheader_get_tagged_pointer -mapheader_get_tagged_pointer: @ 8098F88 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =0x02037318 - ldr r2, [r0, 0x8] - cmp r2, 0 - beq _08098F9C -_08098F96: - ldrb r0, [r2] - cmp r0, 0 - bne _08098FA4 -_08098F9C: - movs r0, 0 - b _08098FC2 - .pool -_08098FA4: - cmp r0, r1 - beq _08098FAC - adds r2, 0x5 - b _08098F96 -_08098FAC: - adds r2, 0x1 - ldrb r0, [r2] - ldrb r1, [r2, 0x1] - lsls r1, 8 - adds r0, r1 - ldrb r1, [r2, 0x2] - lsls r1, 16 - adds r0, r1 - ldrb r1, [r2, 0x3] - lsls r1, 24 - adds r0, r1 -_08098FC2: - pop {r1} - bx r1 - thumb_func_end mapheader_get_tagged_pointer - - thumb_func_start mapheader_run_script_by_tag -mapheader_run_script_by_tag: @ 8098FC8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl mapheader_get_tagged_pointer - cmp r0, 0 - beq _08098FDA - bl script_env_2_execute_new_script -_08098FDA: - pop {r0} - bx r0 - thumb_func_end mapheader_run_script_by_tag - - thumb_func_start mapheader_get_first_match_from_tagged_ptr_list -@ int mapheader_get_first_match_from_tagged_ptr_list(int tag) -mapheader_get_first_match_from_tagged_ptr_list: @ 8098FE0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - bl mapheader_get_tagged_pointer - adds r6, r0, 0 - cmp r6, 0 - beq _08098FFC -_08098FF0: - ldrb r1, [r6] - ldrb r0, [r6, 0x1] - lsls r0, 8 - orrs r1, r0 - cmp r1, 0 - bne _08099000 -_08098FFC: - movs r0, 0 - b _0809903A -_08099000: - adds r6, 0x2 - ldrb r5, [r6] - ldrb r0, [r6, 0x1] - lsls r0, 8 - orrs r5, r0 - adds r6, 0x2 - adds r0, r1, 0 - bl VarGet - adds r4, r0, 0 - adds r0, r5, 0 - bl VarGet - lsls r4, 16 - lsls r0, 16 - cmp r4, r0 - beq _08099026 - adds r6, 0x4 - b _08098FF0 -_08099026: - ldrb r0, [r6] - ldrb r1, [r6, 0x1] - lsls r1, 8 - adds r0, r1 - ldrb r1, [r6, 0x2] - lsls r1, 16 - adds r0, r1 - ldrb r1, [r6, 0x3] - lsls r1, 24 - adds r0, r1 -_0809903A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end mapheader_get_first_match_from_tagged_ptr_list - - thumb_func_start mapheader_run_script_with_tag_x1 -mapheader_run_script_with_tag_x1: @ 8099040 - push {lr} - movs r0, 0x1 - bl mapheader_run_script_by_tag - pop {r0} - bx r0 - thumb_func_end mapheader_run_script_with_tag_x1 - - thumb_func_start mapheader_run_script_with_tag_x3 -mapheader_run_script_with_tag_x3: @ 809904C - push {lr} - movs r0, 0x3 - bl mapheader_run_script_by_tag - pop {r0} - bx r0 - thumb_func_end mapheader_run_script_with_tag_x3 - - thumb_func_start mapheader_run_script_with_tag_x5 -mapheader_run_script_with_tag_x5: @ 8099058 - push {lr} - movs r0, 0x5 - bl mapheader_run_script_by_tag - pop {r0} - bx r0 - thumb_func_end mapheader_run_script_with_tag_x5 - - thumb_func_start mapheader_run_script_with_tag_x7 -mapheader_run_script_with_tag_x7: @ 8099064 - push {lr} - movs r0, 0x7 - bl mapheader_run_script_by_tag - pop {r0} - bx r0 - thumb_func_end mapheader_run_script_with_tag_x7 - - thumb_func_start mapheader_run_script_with_tag_x6 -mapheader_run_script_with_tag_x6: @ 8099070 - push {lr} - movs r0, 0x6 - bl mapheader_run_script_by_tag - pop {r0} - bx r0 - thumb_func_end mapheader_run_script_with_tag_x6 - - thumb_func_start mapheader_run_first_tag2_script_list_match -@ int mapheader_run_first_tag2_script_list_match() -mapheader_run_first_tag2_script_list_match: @ 809907C - push {lr} - movs r0, 0x2 - bl mapheader_get_first_match_from_tagged_ptr_list - cmp r0, 0 - beq _08099090 - bl script_env_1_execute_new_script - movs r0, 0x1 - b _08099092 -_08099090: - movs r0, 0 -_08099092: - pop {r1} - bx r1 - thumb_func_end mapheader_run_first_tag2_script_list_match - - thumb_func_start mapheader_run_first_tag4_script_list_match -@ void mapheader_run_first_tag4_script_list_match() -mapheader_run_first_tag4_script_list_match: @ 8099098 - push {lr} - movs r0, 0x4 - bl mapheader_get_first_match_from_tagged_ptr_list - cmp r0, 0 - beq _080990A8 - bl script_env_2_execute_new_script -_080990A8: - pop {r0} - bx r0 - thumb_func_end mapheader_run_first_tag4_script_list_match - - thumb_func_start sub_80990AC -sub_80990AC: @ 80990AC - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x0000372c - adds r0, r1 - movs r1, 0xFA - lsls r1, 2 - bl sub_806F928 - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80990AC - - thumb_func_start killram -killram: @ 80990D0 - push {lr} - sub sp, 0x4 - movs r0, 0 - str r0, [sp] - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x00003728 - adds r1, r0 - ldr r2, =0x050000fb - mov r0, sp - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end killram - - thumb_func_start sub_80990FC -sub_80990FC: @ 80990FC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - str r0, [sp] - ldr r0, [sp, 0x24] - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r7, r3, 24 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x03005d8c - mov r10, r0 - ldr r5, [r0] - ldr r1, =0x0000372c - adds r4, r5, r1 - bl killram - ldr r0, =0x000003e3 - cmp r8, r0 - bhi _08099174 - movs r0, 0x33 - strb r0, [r4] - mov r2, r9 - strb r2, [r4, 0x1] - strb r7, [r4, 0x2] - strb r6, [r4, 0x3] - ldr r1, =0x00003730 - adds r0, r5, r1 - ldr r1, [sp] - mov r2, r8 - bl memcpy - bl sub_80990AC - mov r2, r10 - ldr r1, [r2] - ldr r2, =0x00003728 - adds r1, r2 - str r0, [r1] - movs r0, 0x1 - b _08099176 - .pool -_08099174: - movs r0, 0 -_08099176: - 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_80990FC - - thumb_func_start sub_8099188 -@ u32 sub_8099188(u8 a1, u32 script) -sub_8099188: @ 8099188 - push {r4-r7,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r3, r0, 24 - ldr r6, =0x03005d8c - ldr r5, [r6] - ldr r0, =0x0000372c - adds r2, r5, r0 - ldr r7, =0x020375c0 - movs r0, 0 - str r0, [r7] - ldrb r0, [r2] - cmp r0, 0x33 - bne _080991F0 - ldrb r1, [r2, 0x1] - movs r0, 0x4 - ldrsb r0, [r5, r0] - cmp r1, r0 - bne _080991F0 - ldrb r1, [r2, 0x2] - movs r0, 0x5 - ldrsb r0, [r5, r0] - cmp r1, r0 - bne _080991F0 - ldrb r0, [r2, 0x3] - cmp r0, r3 - bne _080991F0 - bl sub_80990AC - ldr r1, [r6] - ldr r2, =0x00003728 - adds r1, r2 - ldr r1, [r1] - cmp r0, r1 - bne _080991EC - str r4, [r7] - ldr r1, =0x00003730 - adds r0, r5, r1 - b _080991F2 - .pool -_080991EC: - bl killram -_080991F0: - adds r0, r4, 0 -_080991F2: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8099188 - - thumb_func_start sub_80991F8 -sub_80991F8: @ 80991F8 - push {r4,lr} - ldr r4, =0x03005d8c - ldr r0, [r4] - ldr r2, =0x0000372c - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0x33 - bne _0809923C - ldrb r0, [r1, 0x1] - cmp r0, 0xFF - bne _0809923C - ldrb r0, [r1, 0x2] - cmp r0, 0xFF - bne _0809923C - ldrb r0, [r1, 0x3] - cmp r0, 0xFF - bne _0809923C - bl sub_80990AC - ldr r1, [r4] - ldr r2, =0x00003728 - adds r1, r2 - ldr r1, [r1] - cmp r0, r1 - bne _0809923C - movs r0, 0x1 - b _0809923E - .pool -_0809923C: - movs r0, 0 -_0809923E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80991F8 - - thumb_func_start sub_8099244 -sub_8099244: @ 8099244 - push {r4-r6,lr} - ldr r6, =0x03005d8c - ldr r5, [r6] - ldr r0, =0x0000372c - adds r4, r5, r0 - bl sub_801B27C - cmp r0, 0 - beq _08099298 - ldrb r0, [r4] - cmp r0, 0x33 - bne _08099298 - ldrb r0, [r4, 0x1] - cmp r0, 0xFF - bne _08099298 - ldrb r0, [r4, 0x2] - cmp r0, 0xFF - bne _08099298 - ldrb r0, [r4, 0x3] - cmp r0, 0xFF - bne _08099298 - bl sub_80990AC - ldr r1, [r6] - ldr r2, =0x00003728 - adds r1, r2 - ldr r1, [r1] - cmp r0, r1 - bne _08099294 - ldr r1, =0x00003730 - adds r0, r5, r1 - b _0809929A - .pool -_08099294: - bl killram -_08099298: - movs r0, 0 -_0809929A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8099244 - - thumb_func_start sub_80992A0 -sub_80992A0: @ 80992A0 - push {lr} - sub sp, 0x4 - adds r2, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =0x000003e3 - cmp r1, r0 - bls _080992B2 - adds r1, r0, 0 -_080992B2: - movs r0, 0xFF - str r0, [sp] - adds r0, r2, 0 - movs r2, 0xFF - movs r3, 0xFF - bl sub_80990FC - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80992A0 - - thumb_func_start s00_nop -s00_nop: @ 80992CC - movs r0, 0 - bx lr - thumb_func_end s00_nop - - thumb_func_start s01_nop -s01_nop: @ 80992D0 - movs r0, 0 - bx lr - thumb_func_end s01_nop - - thumb_func_start s02_end -s02_end: @ 80992D4 - push {lr} - bl script_stop - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s02_end - - thumb_func_start s24_execute_ASM_2 -s24_execute_ASM_2: @ 80992E0 - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - adds r1, r0, 0 - adds r0, r4, 0 - bl script_setup_asm_script - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s24_execute_ASM_2 - - thumb_func_start s25_extended_cmd -s25_extended_cmd: @ 80992F8 - push {lr} - bl script_read_halfword - lsls r0, 16 - ldr r1, =gUnknown_081DBA64 - lsrs r0, 14 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end s25_extended_cmd - - thumb_func_start s26_extended_cmd_setvar -s26_extended_cmd_setvar: @ 8099318 - push {r4-r6,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - adds r6, r0, 0 - ldr r4, =gUnknown_081DBA64 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 14 - adds r0, r4 - ldr r0, [r0] - bl _call_via_r0 - strh r0, [r6] - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end s26_extended_cmd_setvar - - thumb_func_start s23_execute_ASM -s23_execute_ASM: @ 809934C - push {lr} - bl script_read_word - bl _call_via_r0 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s23_execute_ASM - - thumb_func_start s27_set_to_waitstate -s27_set_to_waitstate: @ 809935C - push {lr} - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end s27_set_to_waitstate - - thumb_func_start s05_goto -s05_goto: @ 8099368 - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - adds r1, r0, 0 - adds r0, r4, 0 - bl script_jump - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s05_goto - - thumb_func_start s03_return -s03_return: @ 8099380 - push {lr} - bl script_return - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s03_return - - thumb_func_start s04_call -s04_call: @ 809938C - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - adds r1, r0, 0 - adds r0, r4, 0 - bl script_call - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s04_call - - thumb_func_start s06_if_jump -@ int s06_if_jump(script_env *env) -s06_if_jump: @ 80993A4 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r4, [r0] - adds r0, 0x1 - str r0, [r5, 0x8] - adds r0, r5, 0 - bl script_read_word - adds r2, r0, 0 - ldr r1, =gUnknown_085102C0 - lsls r0, r4, 1 - adds r0, r4 - ldrb r3, [r5, 0x2] - adds r0, r3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080993D2 - adds r0, r5, 0 - adds r1, r2, 0 - bl script_jump -_080993D2: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end s06_if_jump - - thumb_func_start s07_if_call -s07_if_call: @ 80993E0 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r4, [r0] - adds r0, 0x1 - str r0, [r5, 0x8] - adds r0, r5, 0 - bl script_read_word - adds r2, r0, 0 - ldr r1, =gUnknown_085102C0 - lsls r0, r4, 1 - adds r0, r4 - ldrb r3, [r5, 0x2] - adds r0, r3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0809940E - adds r0, r5, 0 - adds r1, r2, 0 - bl script_call -_0809940E: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end s07_if_call - - thumb_func_start sB8_set_virtual_address -@ int sB8_set_virtual_address(script_env *env) -sB8_set_virtual_address: @ 809941C - push {r4,lr} - ldr r4, [r0, 0x8] - subs r4, 0x1 - bl script_read_word - ldr r1, =0x020375c4 - subs r0, r4 - str r0, [r1] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sB8_set_virtual_address - - thumb_func_start sB9_virtual_jump -@ int sB9_virtual_jump(script_env *env) -sB9_virtual_jump: @ 8099438 - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - adds r1, r0, 0 - ldr r0, =0x020375c4 - ldr r0, [r0] - subs r1, r0 - adds r0, r4, 0 - bl script_jump - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sB9_virtual_jump - - thumb_func_start sBA_virtual_call -sBA_virtual_call: @ 809945C - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - adds r1, r0, 0 - ldr r0, =0x020375c4 - ldr r0, [r0] - subs r1, r0 - adds r0, r4, 0 - bl script_call - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sBA_virtual_call - - thumb_func_start sBB_virtual_if_jump -sBB_virtual_if_jump: @ 8099480 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r4, [r0] - adds r0, 0x1 - str r0, [r5, 0x8] - adds r0, r5, 0 - bl script_read_word - ldr r1, =0x020375c4 - ldr r1, [r1] - subs r2, r0, r1 - ldr r1, =gUnknown_085102C0 - lsls r0, r4, 1 - adds r0, r4 - ldrb r3, [r5, 0x2] - adds r0, r3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080994B2 - adds r0, r5, 0 - adds r1, r2, 0 - bl script_jump -_080994B2: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sBB_virtual_if_jump - - thumb_func_start sBC_virtual_if_call -sBC_virtual_if_call: @ 80994C4 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r4, [r0] - adds r0, 0x1 - str r0, [r5, 0x8] - adds r0, r5, 0 - bl script_read_word - ldr r1, =0x020375c4 - ldr r1, [r1] - subs r2, r0, r1 - ldr r1, =gUnknown_085102C0 - lsls r0, r4, 1 - adds r0, r4 - ldrb r3, [r5, 0x2] - adds r0, r3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080994F6 - adds r0, r5, 0 - adds r1, r2, 0 - bl script_call -_080994F6: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sBC_virtual_if_call - - thumb_func_start s08_jumpstd -s08_jumpstd: @ 8099508 - push {lr} - adds r2, r0, 0 - ldr r0, [r2, 0x8] - ldrb r1, [r0] - adds r0, 0x1 - str r0, [r2, 0x8] - lsls r1, 2 - ldr r0, =gUnknown_081DC2A0 - adds r1, r0 - ldr r0, =gUnknown_081DC2CC - cmp r1, r0 - bcs _08099528 - ldr r1, [r1] - adds r0, r2, 0 - bl script_jump -_08099528: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end s08_jumpstd - - thumb_func_start s09_callstd -s09_callstd: @ 8099538 - push {lr} - adds r2, r0, 0 - ldr r0, [r2, 0x8] - ldrb r1, [r0] - adds r0, 0x1 - str r0, [r2, 0x8] - lsls r1, 2 - ldr r0, =gUnknown_081DC2A0 - adds r1, r0 - ldr r0, =gUnknown_081DC2CC - cmp r1, r0 - bcs _08099558 - ldr r1, [r1] - adds r0, r2, 0 - bl script_call -_08099558: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end s09_callstd - - thumb_func_start s0A_jumpstd_if -s0A_jumpstd_if: @ 8099568 - push {r4,lr} - adds r3, r0, 0 - ldr r0, [r3, 0x8] - ldrb r2, [r0] - adds r0, 0x1 - str r0, [r3, 0x8] - ldrb r4, [r0] - adds r0, 0x1 - str r0, [r3, 0x8] - ldr r1, =gUnknown_085102C0 - lsls r0, r2, 1 - adds r0, r2 - ldrb r2, [r3, 0x2] - adds r0, r2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080995A0 - lsls r0, r4, 2 - ldr r1, =gUnknown_081DC2A0 - adds r1, r0, r1 - ldr r0, =gUnknown_081DC2CC - cmp r1, r0 - bcs _080995A0 - ldr r1, [r1] - adds r0, r3, 0 - bl script_jump -_080995A0: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s0A_jumpstd_if - - thumb_func_start s0B_callstd_if -s0B_callstd_if: @ 80995B4 - push {r4,lr} - adds r3, r0, 0 - ldr r0, [r3, 0x8] - ldrb r2, [r0] - adds r0, 0x1 - str r0, [r3, 0x8] - ldrb r4, [r0] - adds r0, 0x1 - str r0, [r3, 0x8] - ldr r1, =gUnknown_085102C0 - lsls r0, r2, 1 - adds r0, r2 - ldrb r2, [r3, 0x2] - adds r0, r2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080995EC - lsls r0, r4, 2 - ldr r1, =gUnknown_081DC2A0 - adds r1, r0, r1 - ldr r0, =gUnknown_081DC2CC - cmp r1, r0 - bcs _080995EC - ldr r1, [r1] - adds r0, r3, 0 - bl script_call -_080995EC: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s0B_callstd_if - - thumb_func_start s0C_restore_execution_after_sCF -s0C_restore_execution_after_sCF: @ 8099600 - push {lr} - ldr r1, =0x020375c0 - ldr r1, [r1] - bl script_jump - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end s0C_restore_execution_after_sCF - - thumb_func_start s0D_endscript_killram -s0D_endscript_killram: @ 8099614 - push {r4,lr} - adds r4, r0, 0 - bl killram - adds r0, r4, 0 - bl script_stop - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s0D_endscript_killram - - thumb_func_start s0E_set_byte -s0E_set_byte: @ 809962C - push {lr} - ldr r1, [r0, 0x8] - ldrb r2, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - adds r0, r2, 0 - bl sub_81538C4 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s0E_set_byte - - thumb_func_start s0F_u32_var_to_const -@ int s0F_u32_var_to_const(script_env *env) -s0F_u32_var_to_const: @ 8099644 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, [r4, 0x8] - ldrb r5, [r0] - adds r0, 0x1 - str r0, [r4, 0x8] - adds r0, r4, 0 - bl script_read_word - lsls r5, 2 - adds r4, 0x64 - adds r4, r5 - str r0, [r4] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s0F_u32_var_to_const - - thumb_func_start s12_u32_var_to_ptr -@ int s12_u32_var_to_ptr(script_env *env) -s12_u32_var_to_ptr: @ 8099668 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, [r4, 0x8] - ldrb r5, [r0] - adds r0, 0x1 - str r0, [r4, 0x8] - adds r0, r4, 0 - bl script_read_word - lsls r5, 2 - adds r4, 0x64 - adds r4, r5 - ldrb r0, [r0] - str r0, [r4] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s12_u32_var_to_ptr - - thumb_func_start s11_u8_ptr_to_const -@ int s11_u8_ptr_to_const(script_env *env) -s11_u8_ptr_to_const: @ 809968C - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_word - strb r4, [r0] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s11_u8_ptr_to_const - - thumb_func_start s10_u8_var_to_const -@ int s10_u8_var_to_const(script_env *env) -s10_u8_var_to_const: @ 80996A4 - ldr r1, [r0, 0x8] - ldrb r3, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - lsls r3, 2 - adds r2, r0, 0 - adds r2, 0x64 - adds r2, r3 - ldrb r3, [r1] - str r3, [r2] - adds r1, 0x1 - str r1, [r0, 0x8] - movs r0, 0 - bx lr - thumb_func_end s10_u8_var_to_const - - thumb_func_start s13_u8_var_to_ptr -@ int s13_u8_var_to_ptr(script_env *env) -s13_u8_var_to_ptr: @ 80996C0 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, [r4, 0x8] - ldrb r5, [r0] - adds r0, 0x1 - str r0, [r4, 0x8] - adds r0, r4, 0 - bl script_read_word - lsls r5, 2 - adds r4, 0x64 - adds r4, r5 - ldr r1, [r4] - strb r1, [r0] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s13_u8_var_to_ptr - - thumb_func_start s14_u32_var_to_var -s14_u32_var_to_var: @ 80996E4 - ldr r1, [r0, 0x8] - ldrb r3, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - ldrb r2, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - lsls r3, 2 - adds r0, 0x64 - adds r3, r0, r3 - lsls r2, 2 - adds r0, r2 - ldr r0, [r0] - str r0, [r3] - movs r0, 0 - bx lr - thumb_func_end s14_u32_var_to_var - - thumb_func_start s15_u8_ptr_to_ptr -s15_u8_ptr_to_ptr: @ 8099704 - push {r4,r5,lr} - adds r4, r0, 0 - bl script_read_word - adds r5, r0, 0 - adds r0, r4, 0 - bl script_read_word - ldrb r0, [r0] - strb r0, [r5] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s15_u8_ptr_to_ptr - - thumb_func_start s16_u16_gvar_to_const -s16_u16_gvar_to_const: @ 8099720 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - adds r4, r0, 0 - adds r0, r5, 0 - bl script_read_halfword - strh r0, [r4] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s16_u16_gvar_to_const - - thumb_func_start s19_u16_gvar_gvar -s19_u16_gvar_gvar: @ 8099744 - push {r4,r5,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - adds r5, r0, 0 - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - ldrh r0, [r0] - strh r0, [r5] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s19_u16_gvar_gvar - - thumb_func_start s1A_u16_gvar_gvar -s1A_u16_gvar_gvar: @ 8099770 - push {r4,r5,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - adds r5, r0, 0 - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - strh r0, [r5] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s1A_u16_gvar_gvar - - thumb_func_start compare_012 -compare_012: @ 809979C - push {lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - lsrs r1, 16 - cmp r0, r1 - bcs _080997AE - movs r0, 0 - b _080997B8 -_080997AE: - cmp r0, r1 - beq _080997B6 - movs r0, 0x2 - b _080997B8 -_080997B6: - movs r0, 0x1 -_080997B8: - pop {r1} - bx r1 - thumb_func_end compare_012 - - thumb_func_start s1B_cmp_u8_var_var -s1B_cmp_u8_var_var: @ 80997BC - push {r4,lr} - adds r4, r0, 0 - ldr r2, [r4, 0x8] - ldrb r0, [r2] - lsls r0, 2 - adds r3, r4, 0 - adds r3, 0x64 - adds r0, r3, r0 - ldrb r0, [r0] - adds r2, 0x1 - str r2, [r4, 0x8] - ldrb r1, [r2] - lsls r1, 2 - adds r3, r1 - ldrb r1, [r3] - adds r2, 0x1 - str r2, [r4, 0x8] - bl compare_012 - strb r0, [r4, 0x2] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s1B_cmp_u8_var_var - - thumb_func_start s1C_cmp_u8_var_const -s1C_cmp_u8_var_const: @ 80997EC - push {r4,lr} - adds r4, r0, 0 - ldr r2, [r4, 0x8] - ldrb r1, [r2] - lsls r1, 2 - adds r0, 0x64 - adds r0, r1 - ldrb r0, [r0] - adds r2, 0x1 - str r2, [r4, 0x8] - ldrb r1, [r2] - adds r2, 0x1 - str r2, [r4, 0x8] - bl compare_012 - strb r0, [r4, 0x2] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s1C_cmp_u8_var_const - - thumb_func_start s1D_cmp_u8_var_ptr -s1D_cmp_u8_var_ptr: @ 8099814 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r2, [r4, 0x8] - ldrb r1, [r2] - lsls r1, 2 - adds r0, 0x64 - adds r0, r1 - ldrb r5, [r0] - adds r2, 0x1 - str r2, [r4, 0x8] - adds r0, r4, 0 - bl script_read_word - ldrb r1, [r0] - adds r0, r5, 0 - bl compare_012 - strb r0, [r4, 0x2] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s1D_cmp_u8_var_ptr - - thumb_func_start s1E_cmp_u8_ptr_var -s1E_cmp_u8_ptr_var: @ 8099840 - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - ldrb r0, [r0] - ldr r3, [r4, 0x8] - ldrb r2, [r3] - lsls r2, 2 - adds r1, r4, 0 - adds r1, 0x64 - adds r1, r2 - ldrb r1, [r1] - adds r3, 0x1 - str r3, [r4, 0x8] - bl compare_012 - strb r0, [r4, 0x2] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s1E_cmp_u8_ptr_var - - thumb_func_start s1F_cmp_u8_ptr_const -s1F_cmp_u8_ptr_const: @ 809986C - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - ldrb r0, [r0] - ldr r2, [r4, 0x8] - ldrb r1, [r2] - adds r2, 0x1 - str r2, [r4, 0x8] - bl compare_012 - strb r0, [r4, 0x2] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s1F_cmp_u8_ptr_const - - thumb_func_start s20_cmp_u8_ptr_ptr -s20_cmp_u8_ptr_ptr: @ 809988C - push {r4,r5,lr} - adds r4, r0, 0 - bl script_read_word - ldrb r5, [r0] - adds r0, r4, 0 - bl script_read_word - ldrb r1, [r0] - adds r0, r5, 0 - bl compare_012 - strb r0, [r4, 0x2] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s20_cmp_u8_ptr_ptr - - thumb_func_start s21_cmp_u16_gvar_const -s21_cmp_u16_gvar_const: @ 80998B0 - push {r4,r5,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - ldrh r5, [r0] - adds r0, r4, 0 - bl script_read_halfword - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - bl compare_012 - strb r0, [r4, 0x2] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s21_cmp_u16_gvar_const - - thumb_func_start s22_cmp_u16_gvar_gvar -s22_cmp_u16_gvar_gvar: @ 80998E0 - push {r4,r5,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - adds r5, r0, 0 - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - ldrh r2, [r5] - ldrh r1, [r0] - adds r0, r2, 0 - bl compare_012 - strb r0, [r4, 0x2] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s22_cmp_u16_gvar_gvar - - thumb_func_start s17_u16_gvar_add_const -s17_u16_gvar_add_const: @ 8099914 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - adds r4, r0, 0 - adds r0, r5, 0 - bl script_read_halfword - ldrh r1, [r4] - adds r0, r1 - strh r0, [r4] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s17_u16_gvar_add_const - - thumb_func_start sub_809993C -sub_809993C: @ 809993C - push {r4,r5,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - adds r5, r0, 0 - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldrh r1, [r5] - subs r1, r0 - strh r1, [r5] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809993C - - thumb_func_start s8F_get_random_val -s8F_get_random_val: @ 809996C - push {r4,r5,lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r5, =0x020375f0 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __umodsi3 - strh r0, [r5] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end s8F_get_random_val - - thumb_func_start sub_80999A0 -sub_80999A0: @ 80999A0 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - ldr r5, =0x020375f0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl bag_add_item - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80999A0 - - thumb_func_start sub_80999E4 -sub_80999E4: @ 80999E4 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - ldr r5, =0x020375f0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl remove_item - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80999E4 - - thumb_func_start sub_8099A28 -sub_8099A28: @ 8099A28 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - ldr r5, =0x020375f0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_80D6800 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8099A28 - - thumb_func_start sub_8099A6C -sub_8099A6C: @ 8099A6C - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - ldr r5, =0x020375f0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_80D6724 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8099A6C - - thumb_func_start s48_get_item_type -s48_get_item_type: @ 8099AB0 - push {r4,lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r4, =0x020375f0 - bl sub_80D6C68 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s48_get_item_type - - thumb_func_start sub_8099ADC -sub_8099ADC: @ 8099ADC - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r5, =0x020375f0 - adds r0, r4, 0 - bl sub_80D6D70 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8099ADC - - thumb_func_start sub_8099B20 -sub_8099B20: @ 8099B20 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r5, =0x020375f0 - adds r0, r4, 0 - bl sub_80D6D1C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8099B20 - - thumb_func_start sub_8099B64 -sub_8099B64: @ 8099B64 - push {r4,lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r4, =0x020375f0 - lsls r0, 24 - lsrs r0, 24 - bl IsThereStorageSpaceForDecoration - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8099B64 - - thumb_func_start sub_8099B90 -sub_8099B90: @ 8099B90 - push {r4,lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r4, =0x020375f0 - lsls r0, 24 - lsrs r0, 24 - bl sub_81619DC - lsls r0, 24 - asrs r0, 24 - strh r0, [r4] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8099B90 - - thumb_func_start sub_8099BBC -sub_8099BBC: @ 8099BBC - push {r4,lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r4, =0x020375f0 - lsls r0, 24 - lsrs r0, 24 - bl sub_81619A8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8099BBC - - thumb_func_start sub_8099BE8 -sub_8099BE8: @ 8099BE8 - push {r4,lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r4, =0x020375f0 - lsls r0, 24 - lsrs r0, 24 - bl sub_8161918 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8099BE8 - - thumb_func_start s29_flag_set -@ int s29_flag_set(script_env *env) -s29_flag_set: @ 8099C14 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl FlagSet - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s29_flag_set - - thumb_func_start s2A_flag_clear -@ int s2A_flag_clear(script_env *env) -s2A_flag_clear: @ 8099C28 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl FlagReset - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s2A_flag_clear - - thumb_func_start s2B_flag_check -@ int s2B_flag_check(script_env *env) -s2B_flag_check: @ 8099C3C - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl FlagGet - strb r0, [r4, 0x2] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s2B_flag_check - - thumb_func_start sC3_unknown -@ int sC3_unknown(script_env *env) -sC3_unknown: @ 8099C58 - push {lr} - ldr r1, [r0, 0x8] - ldrb r2, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - adds r0, r2, 0 - bl sav12_xor_increment - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sC3_unknown - - thumb_func_start s9A_unknown -@ int s9A_unknown(script_env *env) -s9A_unknown: @ 8099C70 - push {lr} - ldr r1, [r0, 0x8] - ldrb r2, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - adds r0, r2, 0 - bl sub_80B009C - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end s9A_unknown - - thumb_func_start s99_unknown -@ int s99_unknown(script_env *env) -s99_unknown: @ 8099C8C - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - bl sub_80854EC - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s99_unknown - - thumb_func_start sub_8099CA8 -sub_8099CA8: @ 8099CA8 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08099CC0 - movs r0, 0 - b _08099CC2 - .pool -_08099CC0: - movs r0, 0x1 -_08099CC2: - pop {r1} - bx r1 - thumb_func_end sub_8099CA8 - - thumb_func_start s97_screen_special_effect -@ int s97_screen_special_effect(script_env *env) -s97_screen_special_effect: @ 8099CC8 - push {r4,lr} - adds r4, r0, 0 - ldr r1, [r4, 0x8] - ldrb r0, [r1] - adds r1, 0x1 - str r1, [r4, 0x8] - movs r1, 0 - bl fade_screen - ldr r1, =sub_8099CA8 - adds r0, r4, 0 - bl script_setup_asm_script - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s97_screen_special_effect - - thumb_func_start s98_refade_with_timer -@ int s98_refade_with_timer(script_env *env) -s98_refade_with_timer: @ 8099CF0 - push {r4,lr} - adds r4, r0, 0 - ldr r2, [r4, 0x8] - ldrb r0, [r2] - adds r2, 0x1 - str r2, [r4, 0x8] - ldrb r1, [r2] - adds r2, 0x1 - str r2, [r4, 0x8] - lsls r1, 24 - asrs r1, 24 - bl fade_screen - ldr r1, =sub_8099CA8 - adds r0, r4, 0 - bl script_setup_asm_script - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s98_refade_with_timer - - thumb_func_start sub_8099D20 -@ int sub_8099D20(script_env *env) -sub_8099D20: @ 8099D20 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r4, [r0] - adds r0, 0x1 - str r0, [r5, 0x8] - cmp r4, 0x1 - beq _08099D3E - cmp r4, 0x1 - bgt _08099D3A - cmp r4, 0 - beq _08099D60 - b _08099D3E -_08099D3A: - cmp r4, 0x2 - beq _08099D60 -_08099D3E: - ldr r0, =0x02037714 - ldr r1, =0x02037fe8 - ldr r2, =0x04000100 - bl CpuSet - adds r0, r4, 0 - movs r1, 0 - bl fade_screen - b _08099D72 - .pool -_08099D60: - ldr r0, =0x02037fe8 - ldr r1, =0x02037714 - ldr r2, =0x04000100 - bl CpuSet - adds r0, r4, 0 - movs r1, 0 - bl fade_screen -_08099D72: - ldr r1, =sub_8099CA8 - adds r0, r5, 0 - bl script_setup_asm_script - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8099D20 - - thumb_func_start s28_pause_asm -s28_pause_asm: @ 8099D94 - push {lr} - ldr r1, =0x020375c8 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - lsls r0, 16 - cmp r0, 0 - beq _08099DAC - movs r0, 0 - b _08099DAE - .pool -_08099DAC: - movs r0, 0x1 -_08099DAE: - pop {r1} - bx r1 - thumb_func_end s28_pause_asm - - thumb_func_start s28_pause -@ int s28_pause(script_env *env) -s28_pause: @ 8099DB4 - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - ldr r1, =0x020375c8 - strh r0, [r1] - ldr r1, =s28_pause_asm - adds r0, r4, 0 - bl script_setup_asm_script - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s28_pause - - thumb_func_start s2C_unknown -@ int s2C_unknown(script_env *env) -s2C_unknown: @ 8099DD8 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl GameFreakRTC_CalcRTCToLocalDelta_DayZero - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s2C_unknown - - thumb_func_start s2D_unknown -@ int s2D_unknown(script_env *env) -s2D_unknown: @ 8099E10 - push {lr} - bl sub_809E7B0 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s2D_unknown - - thumb_func_start s2E_unknown -@ int s2E_unknown(script_env *env) -s2E_unknown: @ 8099E1C - push {lr} - bl GameFreakRTC_CalcLocalDateTime - ldr r2, =0x020375d8 - ldr r1, =0x03005cf8 - movs r0, 0x2 - ldrsb r0, [r1, r0] - strh r0, [r2] - ldr r2, =0x020375da - movs r0, 0x3 - ldrsb r0, [r1, r0] - strh r0, [r2] - ldr r2, =0x020375dc - movs r0, 0x4 - ldrsb r0, [r1, r0] - strh r0, [r2] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end s2E_unknown - - thumb_func_start sA4_set_weather_data -@ int sA4_set_weather_data(script_env *env) -sA4_set_weather_data: @ 8099E54 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - bl sub_80AED7C - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sA4_set_weather_data - - thumb_func_start sA3_set_standard_weather_data -@ int sA3_set_standard_weather_data(script_env *env) -sA3_set_standard_weather_data: @ 8099E70 - push {lr} - bl sub_80AEDBC - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sA3_set_standard_weather_data - - thumb_func_start sub_8099E7C -@ int sub_8099E7C(script_env *env) -sub_8099E7C: @ 8099E7C - push {lr} - bl sub_80AEE20 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_8099E7C - - thumb_func_start sA6_activate_per_step_callback_eg_ash -@ int sA6_activate_per_step_callback_eg_ash(script_env *env) -sA6_activate_per_step_callback_eg_ash: @ 8099E88 - push {lr} - ldr r1, [r0, 0x8] - ldrb r2, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - adds r0, r2, 0 - bl activate_per_step_callback - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sA6_activate_per_step_callback_eg_ash - - thumb_func_start sA7_set_new_map_footer -@ int sA7_set_new_map_footer(script_env *env) -sA7_set_new_map_footer: @ 8099EA0 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - bl sub_8085524 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sA7_set_new_map_footer - - thumb_func_start s39_warp_sfx -@ int s39_warp_sfx(script_env *env) -s39_warp_sfx: @ 8099EBC - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl warp1_set - bl sub_80AF734 - bl player_avatar_init_params_reset - movs r0, 0x1 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end s39_warp_sfx - - thumb_func_start s3A_warp_new_music -@ int s3A_warp_new_music(script_env *env) -s3A_warp_new_music: @ 8099F44 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl warp1_set - bl sp13E_warp_to_last_warp - bl player_avatar_init_params_reset - movs r0, 0x1 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end s3A_warp_new_music - - thumb_func_start s3B_warp_keep_music -@ int s3B_warp_keep_music(script_env *env) -s3B_warp_keep_music: @ 8099FCC - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl warp1_set - bl sub_80AF7D0 - bl player_avatar_init_params_reset - movs r0, 0x1 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end s3B_warp_keep_music - - thumb_func_start sub_809A054 -sub_809A054: @ 809A054 - push {r4-r6,lr} - sub sp, 0x8 - ldr r1, [r0, 0x8] - ldrb r6, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - ldrb r5, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - mov r4, sp - adds r4, 0x6 - add r0, sp, 0x4 - adds r1, r4, 0 - bl PlayerGetDestCoords - cmp r6, 0xFF - bne _0809A092 - cmp r5, 0xFF - bne _0809A092 - add r0, sp, 0x4 - ldrh r0, [r0] - subs r0, 0x7 - lsls r0, 16 - asrs r0, 16 - ldrh r1, [r4] - subs r1, 0x7 - lsls r1, 16 - asrs r1, 16 - bl sub_8084EBC - b _0809A0B6 -_0809A092: - lsls r0, r6, 24 - asrs r0, 24 - lsls r1, r5, 24 - asrs r1, 24 - movs r2, 0x1 - negs r2, r2 - add r3, sp, 0x4 - ldrb r3, [r3] - subs r3, 0x7 - lsls r3, 24 - asrs r3, 24 - ldrb r4, [r4] - subs r4, 0x7 - lsls r4, 24 - asrs r4, 24 - str r4, [sp] - bl warp1_set -_0809A0B6: - bl sp13F_fall_to_last_warp - bl player_avatar_init_params_reset - movs r0, 0x1 - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_809A054 - - thumb_func_start s3D_warp_v4 -s3D_warp_v4: @ 809A0C8 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl warp1_set - bl sub_80AF848 - bl player_avatar_init_params_reset - movs r0, 0x1 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end s3D_warp_v4 - - thumb_func_start sub_809A150 -sub_809A150: @ 809A150 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl warp1_set - bl sub_80AF87C - bl player_avatar_init_params_reset - movs r0, 0x1 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_809A150 - - thumb_func_start s3E_set_new_map -s3E_set_new_map: @ 809A1D8 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl warp1_set - movs r0, 0 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end s3E_set_new_map - - thumb_func_start s3F_set_new_map_DMA -s3F_set_new_map_DMA: @ 809A258 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x8 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - str r4, [sp] - lsls r0, 24 - asrs r0, 24 - str r0, [sp, 0x4] - movs r0, 0 - mov r1, r9 - mov r2, r8 - adds r3, r6, 0 - bl saved_warp2_set_2 - movs r0, 0 - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end s3F_set_new_map_DMA - - thumb_func_start sub_809A2DC -sub_809A2DC: @ 809A2DC - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl sub_8084E2C - movs r0, 0 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_809A2DC - - thumb_func_start sub_809A35C -sub_809A35C: @ 809A35C - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl sub_8084E80 - movs r0, 0 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_809A35C - - thumb_func_start sC4_unknown -sC4_unknown: @ 809A3DC - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl sub_8084DD4 - movs r0, 0 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sC4_unknown - - thumb_func_start s42_get_map_camera_pos -@ int s42_get_map_camera_pos(script_env *env) -s42_get_map_camera_pos: @ 809A45C - push {r4,r5,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - adds r5, r0, 0 - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - ldr r2, =0x03005d8c - ldr r1, [r2] - ldrh r1, [r1] - strh r1, [r5] - ldr r1, [r2] - ldrh r1, [r1, 0x2] - strh r1, [r0] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end s42_get_map_camera_pos - - thumb_func_start s43_get_player_party_count -s43_get_player_party_count: @ 809A498 - push {r4,lr} - ldr r4, =0x020375f0 - bl calc_player_party_count - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s43_get_player_party_count - - thumb_func_start s2F_music_play -s2F_music_play: @ 809A4B4 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl audio_play - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s2F_music_play - - thumb_func_start s30_music_check_asm -s30_music_check_asm: @ 809A4C8 - push {lr} - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - beq _0809A4D8 - movs r0, 0 - b _0809A4DA -_0809A4D8: - movs r0, 0x1 -_0809A4DA: - pop {r1} - bx r1 - thumb_func_end s30_music_check_asm - - thumb_func_start s30_music_check -s30_music_check: @ 809A4E0 - push {lr} - ldr r1, =s30_music_check_asm - bl script_setup_asm_script - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end s30_music_check - - thumb_func_start s31_fanfare_play -s31_fanfare_play: @ 809A4F4 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl fanfare_play - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s31_fanfare_play - - thumb_func_start s32_fanfare_wait_asm -s32_fanfare_wait_asm: @ 809A508 - push {lr} - bl task_is_not_running_overworld_fanfare - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end s32_fanfare_wait_asm - - thumb_func_start s32_fanfare_wait -s32_fanfare_wait: @ 809A518 - push {lr} - ldr r1, =s32_fanfare_wait_asm - bl script_setup_asm_script - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end s32_fanfare_wait - - thumb_func_start s33_play_music -@ int s33_play_music(script_env *env) -s33_play_music: @ 809A52C - push {r4,r5,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r2, r0, 16 - adds r5, r2, 0 - ldr r0, [r4, 0x8] - ldrb r1, [r0] - adds r0, 0x1 - str r0, [r4, 0x8] - cmp r1, 0x1 - bne _0809A54C - adds r0, r2, 0 - bl sav1_set_battle_music_maybe -_0809A54C: - adds r0, r5, 0 - bl current_map_music_set - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s33_play_music - - thumb_func_start s34_unknown -s34_unknown: @ 809A55C - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl sav1_set_battle_music_maybe - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s34_unknown - - thumb_func_start s35_fade_to_default -s35_fade_to_default: @ 809A570 - push {lr} - bl sub_8085898 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s35_fade_to_default - - thumb_func_start s36_fade_to_music -s36_fade_to_music: @ 809A57C - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl sub_80858C4 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s36_fade_to_music - - thumb_func_start s37_fadeout -s37_fadeout: @ 809A590 - push {r4,lr} - adds r4, r0, 0 - ldr r0, [r4, 0x8] - ldrb r1, [r0] - adds r0, 0x1 - str r0, [r4, 0x8] - cmp r1, 0 - beq _0809A5AA - lsls r0, r1, 26 - lsrs r0, 24 - bl sub_80A31E8 - b _0809A5B0 -_0809A5AA: - movs r0, 0x4 - bl sub_80A31E8 -_0809A5B0: - ldr r1, =sub_80A3200 - adds r0, r4, 0 - bl script_setup_asm_script - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s37_fadeout - - thumb_func_start s38_fadein -s38_fadein: @ 809A5C4 - push {lr} - ldr r1, [r0, 0x8] - ldrb r2, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - cmp r2, 0 - beq _0809A5DC - lsls r0, r2, 26 - lsrs r0, 24 - bl sub_80A3228 - b _0809A5E2 -_0809A5DC: - movs r0, 0x4 - bl sub_80A3228 -_0809A5E2: - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s38_fadein - - thumb_func_start s4F_execute_movement -s4F_execute_movement: @ 809A5E8 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_word - adds r3, r0, 0 - lsls r0, r4, 24 - lsrs r0, 24 - ldr r1, =0x03005d8c - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl exec_movement - ldr r0, =0x020375ca - strh r4, [r0] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end s4F_execute_movement - - thumb_func_start s50_execute_movement_remote -s50_execute_movement_remote: @ 809A62C - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_word - adds r3, r0, 0 - ldr r0, [r5, 0x8] - ldrb r2, [r0] - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - adds r0, 0x1 - str r0, [r5, 0x8] - lsls r0, r4, 24 - lsrs r0, 24 - bl exec_movement - ldr r0, =0x020375ca - strh r4, [r0] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end s50_execute_movement_remote - - thumb_func_start s51a_0806B288 -s51a_0806B288: @ 809A670 - push {lr} - ldr r0, =0x020375ca - ldrb r0, [r0] - ldr r1, =0x020375ce - ldrb r1, [r1] - ldr r2, =0x020375cc - ldrb r2, [r2] - bl sub_80D3340 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end s51a_0806B288 - - thumb_func_start s51_waitmove -s51_waitmove: @ 809A698 - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _0809A6B4 - ldr r0, =0x020375ca - strh r1, [r0] -_0809A6B4: - ldr r1, =0x020375cc - ldr r0, =0x03005d8c - ldr r2, [r0] - movs r0, 0x4 - ldrsb r0, [r2, r0] - strh r0, [r1] - ldr r1, =0x020375ce - movs r0, 0x5 - ldrsb r0, [r2, r0] - strh r0, [r1] - ldr r1, =s51a_0806B288 - adds r0, r4, 0 - bl script_setup_asm_script - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s51_waitmove - - thumb_func_start s52_waitmove_remote -s52_waitmove_remote: @ 809A6EC - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _0809A708 - ldr r0, =0x020375ca - strh r1, [r0] -_0809A708: - ldr r0, [r4, 0x8] - ldrb r2, [r0] - adds r0, 0x1 - str r0, [r4, 0x8] - ldrb r1, [r0] - adds r0, 0x1 - str r0, [r4, 0x8] - ldr r0, =0x020375cc - strh r2, [r0] - ldr r0, =0x020375ce - strh r1, [r0] - ldr r1, =s51a_0806B288 - adds r0, r4, 0 - bl script_setup_asm_script - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s52_waitmove_remote - - thumb_func_start s53_hide_sprite -s53_hide_sprite: @ 809A740 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005d8c - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl RemoveFieldObjectByLocalIdAndMap - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end s53_hide_sprite - - thumb_func_start s54_hide_sprite_set_coords -s54_hide_sprite_set_coords: @ 809A768 - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r3, [r4, 0x8] - ldrb r2, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - ldrb r1, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - lsls r0, 24 - lsrs r0, 24 - bl RemoveFieldObjectByLocalIdAndMap - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s54_hide_sprite_set_coords - - thumb_func_start s55_show_sprite -s55_show_sprite: @ 809A798 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005d8c - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl show_sprite - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end s55_show_sprite - - thumb_func_start s56_show_sprite_set_coords -s56_show_sprite_set_coords: @ 809A7C0 - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r3, [r4, 0x8] - ldrb r2, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - ldrb r1, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - lsls r0, 24 - lsrs r0, 24 - bl show_sprite - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s56_show_sprite_set_coords - - thumb_func_start s57_move_sprites -s57_move_sprites: @ 809A7F0 - push {r4-r6,lr} - sub sp, 0x4 - adds r6, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r6, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r6, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r5, 24 - lsrs r5, 24 - ldr r1, =0x03005d8c - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - lsls r4, 16 - asrs r4, 16 - lsls r0, 16 - asrs r0, 16 - str r0, [sp] - adds r0, r5, 0 - adds r3, r4, 0 - bl sub_808EBA8 - movs r0, 0 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end s57_move_sprites - - thumb_func_start s63_new_sprite_location_permanent -s63_new_sprite_location_permanent: @ 809A858 - push {r4-r6,lr} - adds r6, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r6, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r6, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r2, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, 16 - asrs r4, 16 - lsls r2, 16 - asrs r2, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl update_saveblock1_field_object_coords - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end s63_new_sprite_location_permanent - - thumb_func_start s64_set_sprite_top_left_corner -s64_set_sprite_top_left_corner: @ 809A8B0 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005d8c - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl sub_808F254 - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end s64_set_sprite_top_left_corner - - thumb_func_start s58_npc_f1_clear_x20 -s58_npc_f1_clear_x20: @ 809A8D8 - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r3, [r4, 0x8] - ldrb r2, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - ldrb r1, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - lsls r0, 24 - lsrs r0, 24 - movs r3, 0 - bl npc_by_local_id_and_map_set_field_1_bit_x20 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s58_npc_f1_clear_x20 - - thumb_func_start s59_npc_f1_set_x20 -s59_npc_f1_set_x20: @ 809A908 - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r3, [r4, 0x8] - ldrb r2, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - ldrb r1, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - lsls r0, 24 - lsrs r0, 24 - movs r3, 0x1 - bl npc_by_local_id_and_map_set_field_1_bit_x20 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s59_npc_f1_set_x20 - - thumb_func_start sA8_unknown -sA8_unknown: @ 809A938 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r3, [r5, 0x8] - ldrb r2, [r3] - adds r3, 0x1 - str r3, [r5, 0x8] - ldrb r1, [r3] - adds r4, r3, 0x1 - str r4, [r5, 0x8] - ldrb r3, [r3, 0x1] - adds r4, 0x1 - str r4, [r5, 0x8] - lsls r0, 24 - lsrs r0, 24 - adds r3, 0x53 - lsls r3, 24 - lsrs r3, 24 - bl sub_808E78C - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sA8_unknown - - thumb_func_start sA9_unknown -sA9_unknown: @ 809A974 - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r3, [r4, 0x8] - ldrb r2, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - ldrb r1, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - lsls r0, 24 - lsrs r0, 24 - bl sub_808E7E4 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sA9_unknown - - thumb_func_start s5A_face_player -s5A_face_player: @ 809A9A4 - push {r4,lr} - ldr r2, =0x02037350 - ldr r0, =0x03005df0 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r4, r0, r2 - ldrb r0, [r4] - lsls r0, 31 - cmp r0, 0 - beq _0809A9CC - bl player_get_direction_lower_nybble - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectFaceOppositeDirection -_0809A9CC: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s5A_face_player - - thumb_func_start s5B_npc_set_direction -s5B_npc_set_direction: @ 809A9DC - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r1, [r4, 0x8] - ldrb r3, [r1] - adds r1, 0x1 - str r1, [r4, 0x8] - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005d8c - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl FieldObjectTurnByLocalIdAndMap - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s5B_npc_set_direction - - thumb_func_start s65_set_sprite_behaviour -s65_set_sprite_behaviour: @ 809AA10 - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r2, [r4, 0x8] - ldrb r1, [r2] - adds r2, 0x1 - str r2, [r4, 0x8] - lsls r0, 24 - lsrs r0, 24 - bl update_saveblock1_field_object_movement_behavior - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s65_set_sprite_behaviour - - thumb_func_start sAA_create_new_sprite -sAA_create_new_sprite: @ 809AA38 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x8 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r6, [r0] - adds r0, 0x1 - str r0, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r3, r0, 0 - ldr r0, [r5, 0x8] - ldrb r2, [r0] - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - adds r0, 0x1 - str r0, [r5, 0x8] - lsls r4, 16 - asrs r4, 16 - lsls r3, 16 - asrs r3, 16 - str r2, [sp] - str r1, [sp, 0x4] - mov r0, r8 - adds r1, r6, 0 - adds r2, r4, 0 - bl sprite_new - movs r0, 0 - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sAA_create_new_sprite - - thumb_func_start sAB_unknown -sAB_unknown: @ 809AAA8 - push {lr} - ldr r2, [r0, 0x8] - ldrb r3, [r2] - adds r2, 0x1 - str r2, [r0, 0x8] - ldrb r1, [r2] - adds r2, 0x1 - str r2, [r0, 0x8] - adds r0, r3, 0 - bl sub_8097B78 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sAB_unknown - - thumb_func_start sub_809AAC4 -sub_809AAC4: @ 809AAC4 - push {r4,lr} - adds r4, r0, 0 - bl is_c1_link_related_active - cmp r0, 0 - bne _0809AAE4 - bl sub_80983E8 - ldr r1, =sub_80983C4 - adds r0, r4, 0 - bl script_setup_asm_script - movs r0, 0x1 - b _0809AAE6 - .pool -_0809AAE4: - movs r0, 0 -_0809AAE6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_809AAC4 - - thumb_func_start sub_809AAEC -sub_809AAEC: @ 809AAEC - push {r4,lr} - adds r4, r0, 0 - bl is_c1_link_related_active - cmp r0, 0 - beq _0809AAFC - movs r0, 0 - b _0809AB3A -_0809AAFC: - ldr r2, =0x02037350 - ldr r0, =0x03005df0 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - beq _0809AB2C - bl sub_80984A0 - ldr r1, =sub_809847C - adds r0, r4, 0 - bl script_setup_asm_script - b _0809AB38 - .pool -_0809AB2C: - bl sub_80983E8 - ldr r1, =sub_80983C4 - adds r0, r4, 0 - bl script_setup_asm_script -_0809AB38: - movs r0, 0x1 -_0809AB3A: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809AAEC - - thumb_func_start s6B_release -s6B_release: @ 809AB44 - push {lr} - bl textbox_close - 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, =0x02037350 - adds r0, r1 - bl FieldObjectClearAnimIfSpecialAnimFinished - bl sub_80D338C - bl sub_809757C - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end s6B_release - - thumb_func_start s6C_release_2 -s6C_release_2: @ 809AB7C - push {r4,lr} - bl textbox_close - ldr r4, =0x02037350 - ldr r0, =0x03005df0 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r4 - ldrb r0, [r1] - lsls r0, 31 - cmp r0, 0 - beq _0809AB9E - adds r0, r1, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished -_0809AB9E: - 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 - adds r0, r4 - bl FieldObjectClearAnimIfSpecialAnimFinished - bl sub_80D338C - bl sub_809757C - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s6C_release_2 - - thumb_func_start s67_execute_box -s67_execute_box: @ 809ABD4 - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - cmp r0, 0 - bne _0809ABE2 - ldr r0, [r4, 0x64] -_0809ABE2: - bl box_related_two__2 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s67_execute_box - - thumb_func_start sub_809ABF0 -sub_809ABF0: @ 809ABF0 - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - cmp r0, 0 - bne _0809ABFE - ldr r0, [r4, 0x64] -_0809ABFE: - bl sub_8098238 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_809ABF0 - - thumb_func_start s9B_unknown -s9B_unknown: @ 809AC0C - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - adds r3, r0, 0 - cmp r3, 0 - bne _0809AC1C - ldr r3, [r4, 0x64] -_0809AC1C: - ldr r2, =0x03003014 - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r2] - adds r0, r3, 0 - bl box_related_two__3 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s9B_unknown - - thumb_func_start sub_809AC3C -sub_809AC3C: @ 809AC3C - push {r4,r5,lr} - sub sp, 0xC - adds r5, r0, 0 - bl script_read_word - adds r4, r0, 0 - cmp r4, 0 - bne _0809AC4E - ldr r4, [r5, 0x64] -_0809AC4E: - bl sub_81973A4 - movs r0, 0 - movs r1, 0x1 - bl sub_81973C4 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0 - bl Print - movs r0, 0 - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809AC3C - - thumb_func_start sub_809AC78 -sub_809AC78: @ 809AC78 - push {lr} - ldr r1, =sub_809833C - bl script_setup_asm_script - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809AC78 - - thumb_func_start s68_close_box -s68_close_box: @ 809AC8C - push {lr} - bl textbox_close - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s68_close_box - - thumb_func_start sub_809AC98 -sub_809AC98: @ 809AC98 - push {lr} - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0809ACB8 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0809ACB8 - movs r0, 0 - b _0809ACBA - .pool -_0809ACB8: - movs r0, 0x1 -_0809ACBA: - pop {r1} - bx r1 - thumb_func_end sub_809AC98 - - thumb_func_start sub_809ACC0 -sub_809ACC0: @ 809ACC0 - push {lr} - ldr r1, =sub_809AC98 - bl script_setup_asm_script - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809ACC0 - - thumb_func_start s6E_yes_no -s6E_yes_no: @ 809ACD4 - push {lr} - ldr r2, [r0, 0x8] - ldrb r3, [r2] - adds r2, 0x1 - str r2, [r0, 0x8] - ldrb r1, [r2] - adds r2, 0x1 - str r2, [r0, 0x8] - adds r0, r3, 0 - bl yes_no_box - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809ACF6 - movs r0, 0 - b _0809ACFC -_0809ACF6: - bl script_env_2_set_ctx_paused - movs r0, 0x1 -_0809ACFC: - pop {r1} - bx r1 - thumb_func_end s6E_yes_no - - thumb_func_start s6F_multichoice -s6F_multichoice: @ 809AD00 - push {r4,r5,lr} - ldr r2, [r0, 0x8] - ldrb r5, [r2] - adds r2, 0x1 - str r2, [r0, 0x8] - ldrb r1, [r2] - adds r3, r2, 0x1 - str r3, [r0, 0x8] - ldrb r2, [r2, 0x1] - adds r4, r3, 0x1 - str r4, [r0, 0x8] - ldrb r3, [r3, 0x1] - adds r4, 0x1 - str r4, [r0, 0x8] - adds r0, r5, 0 - bl Multichoice - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809AD2E - movs r0, 0 - b _0809AD34 -_0809AD2E: - bl script_env_2_set_ctx_paused - movs r0, 0x1 -_0809AD34: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s6F_multichoice - - thumb_func_start sub_809AD3C -sub_809AD3C: @ 809AD3C - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - ldr r2, [r0, 0x8] - ldrb r1, [r2] - mov r8, r1 - adds r2, 0x1 - str r2, [r0, 0x8] - ldrb r1, [r2] - adds r3, r2, 0x1 - str r3, [r0, 0x8] - ldrb r2, [r2, 0x1] - adds r5, r3, 0x1 - str r5, [r0, 0x8] - ldrb r6, [r3, 0x1] - adds r4, r5, 0x1 - str r4, [r0, 0x8] - ldrb r3, [r5, 0x1] - adds r4, 0x1 - str r4, [r0, 0x8] - str r6, [sp] - mov r0, r8 - bl sub_80E1E58 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809AD7A - movs r0, 0 - b _0809AD80 -_0809AD7A: - bl script_env_2_set_ctx_paused - movs r0, 0x1 -_0809AD80: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_809AD3C - - thumb_func_start sub_809AD8C -sub_809AD8C: @ 809AD8C - movs r0, 0 - bx lr - thumb_func_end sub_809AD8C - - thumb_func_start sub_809AD90 -sub_809AD90: @ 809AD90 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - ldr r2, [r0, 0x8] - ldrb r1, [r2] - mov r8, r1 - adds r2, 0x1 - str r2, [r0, 0x8] - ldrb r1, [r2] - adds r3, r2, 0x1 - str r3, [r0, 0x8] - ldrb r2, [r2, 0x1] - adds r5, r3, 0x1 - str r5, [r0, 0x8] - ldrb r6, [r3, 0x1] - adds r4, r5, 0x1 - str r4, [r0, 0x8] - ldrb r3, [r5, 0x1] - adds r4, 0x1 - str r4, [r0, 0x8] - str r6, [sp] - mov r0, r8 - bl sub_80E21D0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809ADCE - movs r0, 0 - b _0809ADD4 -_0809ADCE: - bl script_env_2_set_ctx_paused - movs r0, 0x1 -_0809ADD4: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_809AD90 - - thumb_func_start s73_nop_skip_word -s73_nop_skip_word: @ 809ADE0 - ldr r1, [r0, 0x8] - adds r1, 0x4 - str r1, [r0, 0x8] - movs r0, 0 - bx lr - thumb_func_end s73_nop_skip_word - - thumb_func_start sub_809ADEC -sub_809ADEC: @ 809ADEC - ldr r1, [r0, 0x8] - adds r1, 0x4 - str r1, [r0, 0x8] - movs r0, 0 - bx lr - thumb_func_end sub_809ADEC - - thumb_func_start sub_809ADF8 -sub_809ADF8: @ 809ADF8 - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r3, [r4, 0x8] - ldrb r1, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - ldrb r2, [r3] - adds r3, 0x1 - str r3, [r4, 0x8] - bl sub_80E2900 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_809ADF8 - - thumb_func_start s76_close_picture_box -s76_close_picture_box: @ 809AE28 - push {r4,lr} - adds r4, r0, 0 - bl picbox_close - adds r1, r0, 0 - cmp r1, 0 - beq _0809AE40 - adds r0, r4, 0 - bl script_setup_asm_script - movs r0, 0x1 - b _0809AE42 -_0809AE40: - movs r0, 0 -_0809AE42: - pop {r4} - pop {r1} - bx r1 - thumb_func_end s76_close_picture_box - - thumb_func_start sub_809AE48 -sub_809AE48: @ 809AE48 - push {lr} - ldr r1, [r0, 0x8] - ldrb r2, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - cmp r2, 0 - beq _0809AE5C - adds r0, r2, 0 - bl sub_812FDA8 -_0809AE5C: - bl sub_80F8ADC - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_809AE48 - - thumb_func_start sub_809AE6C -sub_809AE6C: @ 809AE6C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x20 - bl script_read_word - adds r1, r0, 0 - ldr r4, =0x02021fc4 - adds r1, 0x6 - adds r0, r4, 0 - bl ExpandStringRefs - movs r2, 0x1 - negs r2, r2 - movs r0, 0x6 - adds r1, r4, 0 - bl GetStringWidth - lsrs r0, 3 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x1C - bls _0809AE9C - movs r7, 0x1C -_0809AE9C: - movs r5, 0x4 - ldrb r0, [r4] - adds r2, r7, 0x2 - add r1, sp, 0x18 - mov r8, r1 - cmp r0, 0xFF - beq _0809AEC0 - adds r1, r4, 0 -_0809AEAC: - ldrb r0, [r1] - adds r1, 0x1 - cmp r0, 0xFE - bne _0809AEBA - adds r0, r5, 0x3 - lsls r0, 24 - lsrs r5, r0, 24 -_0809AEBA: - ldrb r0, [r1] - cmp r0, 0xFF - bne _0809AEAC -_0809AEC0: - cmp r5, 0x12 - bls _0809AEC6 - movs r5, 0x12 -_0809AEC6: - lsls r0, r2, 24 - lsrs r0, 24 - movs r2, 0x1E - subs r2, r0 - lsrs r0, r2, 31 - adds r2, r0 - asrs r2, 1 - lsls r2, 24 - adds r0, r5, 0x2 - lsls r0, 24 - lsrs r0, 24 - movs r4, 0x14 - subs r4, r0 - lsrs r0, r4, 31 - adds r4, r0 - asrs r4, 1 - lsls r4, 24 - lsrs r6, r2, 24 - movs r0, 0x80 - lsls r0, 17 - adds r2, r0 - lsrs r2, 24 - lsrs r3, r4, 24 - movs r1, 0x80 - lsls r1, 18 - adds r4, r1 - lsrs r4, 24 - subs r6, r2, r6 - subs r6, 0x1 - lsls r6, 3 - adds r6, 0x3 - lsls r6, 24 - lsrs r6, 24 - subs r4, r3 - subs r4, 0x1 - lsls r4, 27 - lsrs r4, 24 - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - str r7, [sp] - str r5, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - movs r0, 0x1 - str r0, [sp, 0xC] - add r0, sp, 0x10 - movs r1, 0 - bl sub_8198A50 - ldr r0, [sp, 0x10] - ldr r1, [sp, 0x14] - str r0, [sp, 0x18] - str r1, [sp, 0x1C] - ldr r5, =0x03000f30 - mov r0, r8 - bl AddWindow - strb r0, [r5] - ldrb r0, [r5] - movs r1, 0x85 - lsls r1, 2 - movs r2, 0xE0 - bl sub_809882C - ldrb r0, [r5] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r5] - bl PutWindowTilemap - ldrb r0, [r5] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldrb r0, [r5] - ldr r2, =0x02021fc4 - str r4, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x6 - adds r3, r6, 0 - bl Print - ldrb r0, [r5] - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0 - add sp, 0x20 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809AE6C - - thumb_func_start sub_809AF94 -sub_809AF94: @ 809AF94 - push {lr} - bl sub_809BDB4 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_809AF94 - - thumb_func_start sBD_virtual_message -sBD_virtual_message: @ 809AFA0 - push {lr} - bl script_read_word - ldr r1, =0x020375c4 - ldr r1, [r1] - subs r0, r1 - bl box_related_two__2 - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sBD_virtual_message - - thumb_func_start s7D_load_pokename -s7D_load_pokename: @ 809AFBC - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r1 - ldr r2, [r4] - movs r1, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r2, 0 - bl CopyString - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s7D_load_pokename - - thumb_func_start s7E_load_first_pokenames -s7E_load_first_pokenames: @ 809AFFC - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r2, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - ldr r0, =gUnknown_085102D4 - lsls r2, 2 - adds r2, r0 - ldr r4, [r2] - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - movs r1, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r4, 0 - bl CopyString - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s7E_load_first_pokenames - - thumb_func_start s7F_load_pokename_team -s7F_load_pokename_team: @ 809B048 - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r1 - ldr r4, [r4] - movs r1, 0x2 - adds r2, r4, 0 - bl pokemon_getattr - adds r0, r4, 0 - bl GetStringEnd_Limit7 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s7F_load_pokename_team - - thumb_func_start s80_load_item_name -s80_load_item_name: @ 809B090 - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r1 - ldr r1, [r4] - bl itemid_get_name - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s80_load_item_name - - thumb_func_start sub_809B0C4 -sub_809B0C4: @ 809B0C4 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r6, [r0] - adds r0, 0x1 - str r0, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - ldr r0, =gUnknown_085102D4 - lsls r6, 2 - adds r6, r0 - ldr r1, [r6] - adds r0, r4, 0 - bl sub_80D6660 - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809B0C4 - - thumb_func_start sub_809B114 -sub_809B114: @ 809B114 - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - lsls r1, 16 - ldr r0, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r0 - ldr r0, [r4] - lsrs r1, 11 - ldr r2, =gUnknown_085A5C09 - adds r1, r2 - bl CopyString - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809B114 - - thumb_func_start s82_load_item_name -s82_load_item_name: @ 809B150 - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r1 - ldr r2, [r4] - movs r1, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - adds r0, r2, 0 - bl CopyString - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s82_load_item_name - - thumb_func_start s83_load_textvar_var -s83_load_textvar_var: @ 809B190 - push {r4,r5,lr} - ldr r1, [r0, 0x8] - ldrb r5, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r4, 0 - bl sub_80EF370 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gUnknown_085102D4 - lsls r5, 2 - adds r5, r0 - ldr r0, [r5] - adds r1, r4, 0 - movs r2, 0 - bl ConvertIntToDecimalString - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end s83_load_textvar_var - - thumb_func_start s84_load_textvar_std_expression -s84_load_textvar_std_expression: @ 809B1D4 - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - ldr r1, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r1 - ldr r2, [r4] - ldr r1, =gUnknown_0858BAF0 - lsrs r0, 14 - adds r0, r1 - ldr r1, [r0] - adds r0, r2, 0 - bl CopyString - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s84_load_textvar_std_expression - - thumb_func_start sub_809B214 -sub_809B214: @ 809B214 - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - ldr r0, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r0 - ldr r0, [r4] - lsls r1, 24 - lsrs r1, 24 - bl sub_818E868 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809B214 - - thumb_func_start s85_load_textvar_pointer -s85_load_textvar_pointer: @ 809B248 - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_word - adds r1, r0, 0 - ldr r0, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r0 - ldr r0, [r4] - bl CopyString - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s85_load_textvar_pointer - - thumb_func_start sBE_virtual_load_text -sBE_virtual_load_text: @ 809B270 - push {lr} - bl script_read_word - adds r1, r0, 0 - ldr r0, =0x020375c4 - ldr r0, [r0] - subs r1, r0 - ldr r0, =0x02021fc4 - bl ExpandStringRefs - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sBE_virtual_load_text - - thumb_func_start sBF_virtual_load_textbuffer -sBF_virtual_load_textbuffer: @ 809B294 - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_word - adds r1, r0, 0 - ldr r0, =0x020375c4 - ldr r0, [r0] - subs r1, r0 - ldr r0, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r0 - ldr r0, [r4] - bl CopyString - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sBF_virtual_load_textbuffer - - thumb_func_start sC6_load_textvar_box_label -sC6_load_textvar_box_label: @ 809B2C8 - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r1, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r1 - ldr r4, [r4] - lsls r0, 24 - lsrs r0, 24 - bl sav3_get_box_name - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sC6_load_textvar_box_label - - thumb_func_start s79_give_pokemon -s79_give_pokemon: @ 809B304 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x8 - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r6, r0, 0 - lsls r6, 16 - lsrs r6, 16 - ldr r0, [r4, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r4, 0x8] - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - bl script_read_word - mov r8, r0 - adds r0, r4, 0 - bl script_read_word - ldr r1, [r4, 0x8] - ldrb r2, [r1] - adds r1, 0x1 - str r1, [r4, 0x8] - ldr r4, =0x020375f0 - str r0, [sp] - str r2, [sp, 0x4] - adds r0, r6, 0 - mov r1, r9 - adds r2, r5, 0 - mov r3, r8 - bl sub_80F9244 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - movs r0, 0 - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end s79_give_pokemon - - thumb_func_start s7A_create_egg -s7A_create_egg: @ 809B384 - push {r4,lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r4, =0x020375f0 - bl sub_80F92C8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s7A_create_egg - - thumb_func_start s7B_change_pokedata_AP -s7B_change_pokedata_AP: @ 809B3B0 - push {r4,r5,lr} - ldr r1, [r0, 0x8] - ldrb r5, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - adds r2, r4, 0 - bl sub_80F9400 - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end s7B_change_pokedata_AP - - thumb_func_start sub_809B3DC -sub_809B3DC: @ 809B3DC - push {r4-r7,lr} - bl script_read_halfword - lsls r0, 16 - lsrs r7, r0, 16 - ldr r1, =0x020375f0 - movs r0, 0x6 - strh r0, [r1] - movs r6, 0 - b _0809B42A - .pool -_0809B3F4: - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0809B424 - adds r0, r4, 0 - adds r1, r7, 0 - bl pokemon_has_move - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809B424 - ldr r0, =0x020375f0 - strh r6, [r0] - ldr r0, =0x020375e0 - strh r5, [r0] - b _0809B44A - .pool -_0809B424: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0809B42A: - cmp r6, 0x5 - bhi _0809B44A - movs r0, 0x64 - adds r1, r6, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - bne _0809B3F4 -_0809B44A: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809B3DC - - thumb_func_start s90_add_money -@ int s90_add_money(script_env *env) -s90_add_money: @ 809B458 - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - adds r2, r0, 0 - ldr r0, [r4, 0x8] - ldrb r1, [r0] - adds r0, 0x1 - str r0, [r4, 0x8] - cmp r1, 0 - bne _0809B47E - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - adds r1, r2, 0 - bl add_money -_0809B47E: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s90_add_money - - thumb_func_start s91_subtract_money -@ int s91_subtract_money(script_env *env) -s91_subtract_money: @ 809B48C - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - adds r2, r0, 0 - ldr r0, [r4, 0x8] - ldrb r1, [r0] - adds r0, 0x1 - str r0, [r4, 0x8] - cmp r1, 0 - bne _0809B4B2 - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - adds r1, r2, 0 - bl subtract_money -_0809B4B2: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s91_subtract_money - - thumb_func_start s92_check_money -@ int s92_check_money(script_env *env) -s92_check_money: @ 809B4C0 - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - adds r2, r0, 0 - ldr r0, [r4, 0x8] - ldrb r1, [r0] - adds r0, 0x1 - str r0, [r4, 0x8] - cmp r1, 0 - bne _0809B4EE - ldr r4, =0x020375f0 - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - adds r1, r2, 0 - bl IsEnoughMoney - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] -_0809B4EE: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s92_check_money - - thumb_func_start s93_display_money -@ int s93_display_money(script_env *env) -s93_display_money: @ 809B500 - push {r4,r5,lr} - ldr r1, [r0, 0x8] - ldrb r5, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - ldrb r4, [r1] - adds r2, r1, 0x1 - str r2, [r0, 0x8] - ldrb r1, [r1, 0x1] - adds r2, 0x1 - str r2, [r0, 0x8] - cmp r1, 0 - bne _0809B530 - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - bl DecryptMoney - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_80E52EC -_0809B530: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end s93_display_money - - thumb_func_start s94_hide_money -s94_hide_money: @ 809B53C - push {lr} - bl sub_80E5384 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s94_hide_money - - thumb_func_start s95_update_money -@ int s95_update_money(script_env *env) -s95_update_money: @ 809B548 - push {lr} - ldr r1, [r0, 0x8] - adds r1, 0x1 - adds r2, r1, 0x1 - str r2, [r0, 0x8] - ldrb r1, [r1, 0x1] - adds r2, 0x1 - str r2, [r0, 0x8] - cmp r1, 0 - bne _0809B56E - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - bl DecryptMoney - bl sub_80E52D4 -_0809B56E: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end s95_update_money - - thumb_func_start sub_809B578 -sub_809B578: @ 809B578 - push {r4,r5,lr} - ldr r1, [r0, 0x8] - ldrb r5, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl GetCoins - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - adds r2, r4, 0 - bl ShowCoinsWindow - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809B578 - - thumb_func_start sC1_hide_coins -sC1_hide_coins: @ 809B5A0 - push {lr} - ldr r1, [r0, 0x8] - adds r1, 0x2 - str r1, [r0, 0x8] - bl HideCoinsWindow - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sC1_hide_coins - - thumb_func_start sC2_update_coins -sC2_update_coins: @ 809B5B4 - push {lr} - ldr r1, [r0, 0x8] - adds r1, 0x2 - str r1, [r0, 0x8] - bl GetCoins - lsls r0, 16 - lsrs r0, 16 - bl PrintCoinsString - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sC2_update_coins - - thumb_func_start s5C_trainer_battle_configure_and_start -s5C_trainer_battle_configure_and_start: @ 809B5D0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, [r4, 0x8] - bl TrainerBattleConfigure - str r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s5C_trainer_battle_configure_and_start - - thumb_func_start sub_809B5E4 -sub_809B5E4: @ 809B5E4 - push {lr} - bl sub_80B17E0 - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_809B5E4 - - thumb_func_start sub_809B5F0 -sub_809B5F0: @ 809B5F0 - push {r4,lr} - adds r4, r0, 0 - bl sub_80B1AF8 - str r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_809B5F0 - - thumb_func_start sub_809B604 -@ bool8 sub_809B604(struct script_env *env) -sub_809B604: @ 809B604 - push {r4,lr} - adds r4, r0, 0 - bl sub_80B1B10 - str r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_809B604 - - thumb_func_start s60_check_trainer_flag -s60_check_trainer_flag: @ 809B618 - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - bl trainer_flag_check - strb r0, [r4, 0x2] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end s60_check_trainer_flag - - thumb_func_start s61_set_trainer_flag -s61_set_trainer_flag: @ 809B63C - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - bl trainer_flag_set - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s61_set_trainer_flag - - thumb_func_start s62_unset_trainer_flag -s62_unset_trainer_flag: @ 809B658 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - bl trainer_flag_clear - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s62_unset_trainer_flag - - thumb_func_start sB6_load_battle -sB6_load_battle: @ 809B674 - push {r4-r6,lr} - adds r4, r0, 0 - bl script_read_halfword - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - ldr r0, [r4, 0x8] - ldrb r6, [r0] - adds r0, 0x1 - str r0, [r4, 0x8] - adds r0, r4, 0 - bl script_read_halfword - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_80F93A0 - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sB6_load_battle - - thumb_func_start sub_809B6A8 -sub_809B6A8: @ 809B6A8 - push {lr} - bl sub_80B08A8 - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_809B6A8 - - thumb_func_start s86_pokemart -s86_pokemart: @ 809B6B8 - push {lr} - bl script_read_word - bl CreatePokemartMenu - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end s86_pokemart - - thumb_func_start s87_pokemartdecor -s87_pokemartdecor: @ 809B6CC - push {lr} - bl script_read_word - bl CreateDecorationShop1Menu - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end s87_pokemartdecor - - thumb_func_start s88_pokemartbp -s88_pokemartbp: @ 809B6E0 - push {lr} - bl script_read_word - bl CreateDecorationShop2Menu - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end s88_pokemartbp - - thumb_func_start s89_open_casino_game1 -s89_open_casino_game1: @ 809B6F4 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - ldr r1, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl sub_812A540 - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end s89_open_casino_game1 - - thumb_func_start berry_script_cmd -@ bool8 berry_script_cmd(struct script_env *env) -berry_script_cmd: @ 809B71C - push {r4,r5,lr} - ldr r1, [r0, 0x8] - ldrb r5, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - ldrb r3, [r1] - adds r2, r1, 0x1 - str r2, [r0, 0x8] - ldrb r4, [r1, 0x1] - adds r2, 0x1 - str r2, [r0, 0x8] - cmp r3, 0 - bne _0809B744 - adds r0, r5, 0 - movs r1, 0 - adds r2, r4, 0 - movs r3, 0 - bl PlantBerryTree - b _0809B750 -_0809B744: - adds r0, r5, 0 - adds r1, r3, 0 - adds r2, r4, 0 - movs r3, 0 - bl PlantBerryTree -_0809B750: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end berry_script_cmd - - thumb_func_start sub_809B758 -sub_809B758: @ 809B758 - push {r4,lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r4, =0x020375f0 - lsls r0, 24 - lsrs r0, 24 - bl GetPriceReduction - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809B758 - - thumb_func_start sub_809B784 -sub_809B784: @ 809B784 - push {lr} - bl sub_81B9404 - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_809B784 - - thumb_func_start sub_809B794 -sub_809B794: @ 809B794 - push {lr} - bl sub_80F840C - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_809B794 - - thumb_func_start sub_809B7A4 -sub_809B7A4: @ 809B7A4 - push {lr} - bl sub_80F8484 - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_809B7A4 - - thumb_func_start sub_809B7B4 -sub_809B7B4: @ 809B7B4 - push {lr} - ldr r0, =0x02039f2c - ldrb r0, [r0] - bl sub_80F84C4 - bl script_env_2_set_ctx_paused - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809B7B4 - - thumb_func_start s9C_execute_HM -s9C_execute_HM: @ 809B7CC - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x020375d0 - strh r0, [r1] - lsls r0, 24 - lsrs r0, 24 - bl FieldEffectStart - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end s9C_execute_HM - - thumb_func_start s9D_set_HM_animation_data -s9D_set_HM_animation_data: @ 809B7F4 - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r1, =0x02038c08 - lsls r4, 2 - adds r4, r1 - lsls r0, 16 - asrs r0, 16 - str r0, [r4] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s9D_set_HM_animation_data - - thumb_func_start sub_809B824 -sub_809B824: @ 809B824 - push {lr} - ldr r0, =0x020375d0 - ldrb r0, [r0] - bl FieldEffectActiveListContains - lsls r0, 24 - cmp r0, 0 - beq _0809B83C - movs r0, 0 - b _0809B83E - .pool -_0809B83C: - movs r0, 0x1 -_0809B83E: - pop {r1} - bx r1 - thumb_func_end sub_809B824 - - thumb_func_start s9E_checkarray_HM_animation -s9E_checkarray_HM_animation: @ 809B844 - push {r4,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - ldr r1, =0x020375d0 - strh r0, [r1] - ldr r1, =sub_809B824 - adds r0, r4, 0 - bl script_setup_asm_script - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end s9E_checkarray_HM_animation - - thumb_func_start s9F_changeposition_fly -s9F_changeposition_fly: @ 809B870 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - bl sub_8084D1C - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end s9F_changeposition_fly - - thumb_func_start sA0_check_gender -sA0_check_gender: @ 809B88C - ldr r1, =0x020375f0 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - strh r0, [r1] - movs r0, 0 - bx lr - .pool - thumb_func_end sA0_check_gender - - thumb_func_start sA1_play_cry -sA1_play_cry: @ 809B8A4 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_80A3404 - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sA1_play_cry - - thumb_func_start sub_809B8DC -sub_809B8DC: @ 809B8DC - push {lr} - ldr r1, =sub_80A3678 - bl script_setup_asm_script - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809B8DC - - thumb_func_start sA2_setmaptile -sA2_setmaptile: @ 809B8F0 - push {r4-r7,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r7, r0, 16 - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - adds r1, r6, 0x7 - lsls r1, 16 - lsrs r6, r1, 16 - adds r1, r5, 0x7 - lsls r1, 16 - lsrs r5, r1, 16 - cmp r0, 0 - bne _0809B954 - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r7, 0 - bl MapGridSetMetatileIdAt - b _0809B966 -_0809B954: - movs r1, 0xC0 - lsls r1, 4 - adds r0, r1, 0 - adds r2, r7, 0 - orrs r2, r0 - adds r0, r6, 0 - adds r1, r5, 0 - bl MapGridSetMetatileIdAt -_0809B966: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sA2_setmaptile - - thumb_func_start sAC_open_door -sAC_open_door: @ 809B970 - push {r4,r5,lr} - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - adds r5, 0x7 - lsls r5, 16 - lsrs r5, 16 - movs r0, 0xE0 - lsls r0, 11 - adds r4, r0 - lsrs r4, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl cur_mapdata_get_door_sound_at - lsls r0, 16 - lsrs r0, 16 - bl audio_play - adds r0, r5, 0 - adds r1, r4, 0 - bl task_overworld_door_add_if_role_69_for_opening_door_at - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sAC_open_door - - thumb_func_start sub_809B9C8 -sub_809B9C8: @ 809B9C8 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - lsls r1, 16 - adds r4, 0x7 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0xE0 - lsls r0, 11 - adds r1, r0 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_808A8AC - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809B9C8 - - thumb_func_start sub_809BA0C -sub_809BA0C: @ 809BA0C - push {lr} - bl sub_808A91C - lsls r0, 24 - cmp r0, 0 - beq _0809BA1C - movs r0, 0 - b _0809BA1E -_0809BA1C: - movs r0, 0x1 -_0809BA1E: - pop {r1} - bx r1 - thumb_func_end sub_809BA0C - - thumb_func_start sub_809BA24 -sub_809BA24: @ 809BA24 - push {lr} - ldr r1, =sub_809BA0C - bl script_setup_asm_script - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809BA24 - - thumb_func_start sub_809BA38 -sub_809BA38: @ 809BA38 - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - lsls r1, 16 - adds r4, 0x7 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0xE0 - lsls r0, 11 - adds r1, r0 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_808A854 - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809BA38 - - thumb_func_start sub_809BA7C -sub_809BA7C: @ 809BA7C - push {r4,r5,lr} - adds r5, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r1, r0, 0 - lsls r1, 16 - adds r4, 0x7 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0xE0 - lsls r0, 11 - adds r1, r0 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_808A880 - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809BA7C - - thumb_func_start sub_809BAC0 -sub_809BAC0: @ 809BAC0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, [r4, 0x8] - adds r0, 0x1 - str r0, [r4, 0x8] - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r0, r4, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_809BAC0 - - thumb_func_start sub_809BAFC -sub_809BAFC: @ 809BAFC - movs r0, 0 - bx lr - thumb_func_end sub_809BAFC - - thumb_func_start sB3_get_coin_amount -sB3_get_coin_amount: @ 809BB00 - push {r4,lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl GetVarPointer - adds r4, r0, 0 - bl GetCoins - strh r0, [r4] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sB3_get_coin_amount - - thumb_func_start sub_809BB20 -sub_809BB20: @ 809BB20 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - bl AddCoins - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809BB48 - ldr r1, =0x020375f0 - movs r0, 0 - b _0809BB4C - .pool -_0809BB48: - ldr r1, =0x020375f0 - movs r0, 0x1 -_0809BB4C: - strh r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809BB20 - - thumb_func_start sub_809BB58 -sub_809BB58: @ 809BB58 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - bl SubtractCoins - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809BB80 - ldr r1, =0x020375f0 - movs r0, 0 - b _0809BB84 - .pool -_0809BB80: - ldr r1, =0x020375f0 - movs r0, 0x1 -_0809BB84: - strh r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809BB58 - - thumb_func_start sub_809BB90 -sub_809BB90: @ 809BB90 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - bl sub_81A89A0 - ldr r1, =0x020375ca - strh r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809BB90 - - thumb_func_start sub_809BBB4 -sub_809BBB4: @ 809BBB4 - push {lr} - bl sub_81A8AF8 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_809BBB4 - - thumb_func_start ScrCmd_MossdeepGymSwitch -ScrCmd_MossdeepGymSwitch: @ 809BBC0 - push {lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - bl sub_81A8934 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end ScrCmd_MossdeepGymSwitch - - thumb_func_start sub_809BBDC -sub_809BBDC: @ 809BBDC - push {lr} - bl sub_81A895C - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_809BBDC - - thumb_func_start sub_809BBE8 -sub_809BBE8: @ 809BBE8 - push {lr} - bl sub_80B47BC - ldr r1, =0x03005df0 - strb r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809BBE8 - - thumb_func_start sub_809BBFC -sub_809BBFC: @ 809BBFC - push {r4,lr} - adds r4, r0, 0 - bl is_c1_link_related_active - cmp r0, 0 - beq _0809BC0C - movs r0, 0 - b _0809BC30 -_0809BC0C: - ldr r2, =0x02037350 - ldr r0, =0x03005df0 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - beq _0809BC2E - bl sub_8098630 - ldr r1, =sub_8098734 - adds r0, r4, 0 - bl script_setup_asm_script -_0809BC2E: - movs r0, 0x1 -_0809BC30: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809BBFC - - thumb_func_start sCD_set_obedient_bit -sCD_set_obedient_bit: @ 809BC44 - push {lr} - sub sp, 0x4 - movs r2, 0x1 - mov r1, sp - strb r2, [r1] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x50 - mov r2, sp - bl pokemon_setattr - movs r0, 0 - add sp, 0x4 - pop {r1} - bx r1 - .pool - thumb_func_end sCD_set_obedient_bit - - thumb_func_start sCE_check_obedient_bit -sCE_check_obedient_bit: @ 809BC7C - push {r4,lr} - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r4, =0x020375f0 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x50 - movs r2, 0 - bl pokemon_getattr - strh r0, [r4] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sCE_check_obedient_bit - - thumb_func_start sCF_execute_RAM_script_DMA -sCF_execute_RAM_script_DMA: @ 809BCB4 - push {r4,lr} - adds r4, r0, 0 - bl sub_8099244 - adds r2, r0, 0 - cmp r2, 0 - beq _0809BCD0 - ldr r1, =0x020375c0 - ldr r0, [r4, 0x8] - str r0, [r1] - adds r0, r4, 0 - adds r1, r2, 0 - bl script_jump -_0809BCD0: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sCF_execute_RAM_script_DMA - - thumb_func_start sD1_warp_v5 -sD1_warp_v5: @ 809BCDC - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl warp1_set - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - bl sub_808D074 - bl sub_80B0244 - bl player_avatar_init_params_reset - movs r0, 0x1 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sD1_warp_v5 - - thumb_func_start sub_809BD70 -sub_809BD70: @ 809BD70 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r3, r0, 16 - ldr r0, [r4, 0x8] - ldrb r2, [r0] - mov r1, sp - strb r2, [r1] - adds r0, 0x1 - str r0, [r4, 0x8] - cmp r3, 0x5 - bhi _0809BDA6 - movs r0, 0x64 - muls r0, r3 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x23 - mov r2, sp - bl pokemon_setattr -_0809BDA6: - movs r0, 0 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809BD70 - - thumb_func_start sub_809BDB4 -sub_809BDB4: @ 809BDB4 - push {r4,lr} - ldr r4, =0x03000f30 - ldrb r0, [r4] - movs r1, 0x1 - bl sub_819746C - ldrb r0, [r4] - bl RemoveWindow - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809BDB4 - - thumb_func_start sub_809BDD0 -sub_809BDD0: @ 809BDD0 - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r1 - ldr r4, [r4] - bl sub_806F07C - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809BDD0 - - thumb_func_start sub_809BE0C -sub_809BE0C: @ 809BE0C - push {r4,lr} - ldr r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gUnknown_085102D4 - lsls r4, 2 - adds r4, r1 - ldr r4, [r4] - bl sub_806F0B0 - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809BE0C - - thumb_func_start sub_809BE48 -sub_809BE48: @ 809BE48 - ldr r1, =0x020375ca - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_809BE48 - - thumb_func_start sub_809BE54 -sub_809BE54: @ 809BE54 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r5, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r5, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r5, 0x8] - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl script_read_halfword - lsls r0, 16 - lsrs r0, 16 - bl VarGet - mov r1, r9 - lsls r1, 24 - asrs r1, 24 - mov r9, r1 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - lsls r6, 24 - asrs r6, 24 - lsls r4, 24 - asrs r4, 24 - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl warp1_set - bl sub_80AF79C - bl player_avatar_init_params_reset - movs r0, 0x1 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_809BE54 - - thumb_func_start sub_809BEDC -sub_809BEDC: @ 809BEDC - push {r4,r5,lr} - movs r1, 0x2 - negs r1, r1 - movs r3, 0x3 - negs r3, r3 - movs r4, 0x5 - negs r4, r4 - movs r5, 0x9 - negs r5, r5 - movs r2, 0 - strb r2, [r0] - ldrb r2, [r0, 0x1] - ands r1, r2 - ands r1, r3 - ands r1, r4 - ands r1, r5 - strb r1, [r0, 0x1] - movs r1, 0 - strb r1, [r0, 0x2] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_809BEDC - - thumb_func_start process_overworld_input -@ void process_overworld_input(overworld_input_data *input_data, char buttons_new, char buttons_held) -process_overworld_input: @ 809BF08 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r4, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - lsls r2, 16 - lsrs r2, 16 - mov r8, r2 - ldr r0, =0x02037590 - ldrb r6, [r0, 0x3] - ldrb r0, [r0, 0x2] - mov r9, r0 - bl cur_mapdata_block_role_at_player_pos - lsls r0, 24 - lsrs r0, 24 - bl sub_808904C - lsls r0, 24 - lsrs r7, r0, 24 - cmp r6, 0x2 - bne _0809BF3C - cmp r7, 0 - beq _0809BF40 -_0809BF3C: - cmp r6, 0 - bne _0809BFA2 -_0809BF40: - bl sub_811A138 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - beq _0809BF8C - movs r0, 0x8 - ands r0, r5 - cmp r0, 0 - beq _0809BF5C - ldrb r0, [r4] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4] -_0809BF5C: - movs r0, 0x4 - ands r0, r5 - cmp r0, 0 - beq _0809BF6C - ldrb r0, [r4] - movs r1, 0x8 - orrs r0, r1 - strb r0, [r4] -_0809BF6C: - movs r0, 0x1 - ands r0, r5 - cmp r0, 0 - beq _0809BF7C - ldrb r0, [r4] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r4] -_0809BF7C: - movs r0, 0x2 - ands r0, r5 - cmp r0, 0 - beq _0809BF8C - ldrb r0, [r4] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r4] -_0809BF8C: - movs r0, 0xF0 - mov r1, r8 - ands r0, r1 - cmp r0, 0 - beq _0809BFA2 - ldrb r0, [r4] - movs r1, 0x10 - orrs r0, r1 - movs r1, 0x20 - orrs r0, r1 - strb r0, [r4] -_0809BFA2: - cmp r7, 0 - bne _0809BFC8 - cmp r6, 0x2 - bne _0809BFB8 - mov r0, r9 - cmp r0, 0x2 - bne _0809BFB8 - ldrb r0, [r4] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r4] -_0809BFB8: - cmp r7, 0 - bne _0809BFC8 - cmp r6, 0x2 - bne _0809BFC8 - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] -_0809BFC8: - movs r0, 0x40 - mov r1, r8 - ands r0, r1 - cmp r0, 0 - beq _0809BFDC - movs r0, 0x2 - b _0809C004 - .pool -_0809BFDC: - movs r0, 0x80 - mov r1, r8 - ands r0, r1 - cmp r0, 0 - beq _0809BFEA - movs r0, 0x1 - b _0809C004 -_0809BFEA: - movs r0, 0x20 - mov r1, r8 - ands r0, r1 - cmp r0, 0 - beq _0809BFF8 - movs r0, 0x3 - b _0809C004 -_0809BFF8: - movs r0, 0x10 - mov r1, r8 - ands r0, r1 - cmp r0, 0 - beq _0809C006 - movs r0, 0x4 -_0809C004: - strb r0, [r4, 0x2] -_0809C006: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end process_overworld_input - - thumb_func_start sub_809C014 -@ int sub_809C014(overworld_input_data *input_data) -sub_809C014: @ 809C014 - push {r4-r6,lr} - sub sp, 0x8 - adds r5, r0, 0 - ldr r0, =0x020375f2 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x03005df0 - strb r1, [r0] - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r6, r0, 24 - mov r4, sp - mov r0, sp - bl player_get_pos_to_and_height - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0x2 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 16 - lsrs r4, r0, 16 - bl CheckForTrainersWantingBattle - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C14E - bl mapheader_run_first_tag2_script_list_match - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C14E - ldrb r1, [r5] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0809C070 - bl sub_809C89C - cmp r0, 0x1 - beq _0809C14E -_0809C070: - ldrb r1, [r5] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0809C096 - movs r0, 0x5 - bl sav12_xor_increment - bl increment_var_x4026_on_birth_island_modulo_100 - mov r0, sp - adds r1, r4, 0 - adds r2, r6, 0 - bl sub_809C8DC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C14E -_0809C096: - ldrb r1, [r5] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0809C0AE - adds r0, r4, 0 - bl is_it_battle_time_3 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C14E -_0809C0AE: - ldrb r1, [r5] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0809C0D0 - ldrb r0, [r5, 0x2] - cmp r0, r6 - bne _0809C0D0 - mov r0, sp - adds r1, r4, 0 - adds r2, r6, 0 - bl mapheader_run_first_tag2_script_list_match_conditionally - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C14E -_0809C0D0: - mov r4, sp - mov r0, sp - bl player_get_next_pos_and_height - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0x2 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 16 - lsrs r4, r0, 16 - ldrb r1, [r5] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0809C106 - mov r0, sp - adds r1, r4, 0 - adds r2, r6, 0 - bl sub_809C1FC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C14E -_0809C106: - ldrb r1, [r5] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0809C128 - ldrb r0, [r5, 0x2] - cmp r0, r6 - bne _0809C128 - mov r0, sp - adds r1, r4, 0 - adds r2, r6, 0 - bl map_warp_consider_2_to_inside - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C14E -_0809C128: - ldrb r1, [r5] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0809C13A - bl sub_809C868 - cmp r0, 0x1 - beq _0809C14E -_0809C13A: - ldrb r1, [r5] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0809C15C - movs r0, 0x6 - bl audio_play - bl sub_809FA9C -_0809C14E: - movs r0, 0x1 - b _0809C172 - .pool -_0809C15C: - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0809C170 - bl UseRegisteredKeyItemOnField - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C14E -_0809C170: - movs r0, 0 -_0809C172: - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_809C014 - - thumb_func_start player_get_pos_to_and_height -player_get_pos_to_and_height: @ 809C17C - push {r4,lr} - adds r4, r0, 0 - adds r1, r4, 0x2 - bl PlayerGetDestCoords - bl PlayerGetZCoord - strb r0, [r4, 0x4] - pop {r4} - pop {r0} - bx r0 - thumb_func_end player_get_pos_to_and_height - - thumb_func_start player_get_next_pos_and_height -player_get_next_pos_and_height: @ 809C194 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r1, r5, 0x2 - bl GetXYCoordsOneStepInFrontOfPlayer - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetZCoordAt - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _0809C1C6 - bl PlayerGetZCoord -_0809C1C6: - strb r0, [r5, 0x4] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end player_get_next_pos_and_height - - thumb_func_start cur_mapdata_block_role_at_player_pos -cur_mapdata_block_role_at_player_pos: @ 809C1D0 - push {r4,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 16 - lsrs r0, 16 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end cur_mapdata_block_role_at_player_pos - - thumb_func_start sub_809C1FC -sub_809C1FC: @ 809C1FC - push {r4,lr} - lsls r2, 24 - lsrs r2, 24 - lsls r1, 24 - lsrs r1, 24 - bl TryGetScriptOnPressingA - adds r4, r0, 0 - cmp r4, 0 - bne _0809C214 - movs r0, 0 - b _0809C24C -_0809C214: - ldr r0, =gUnknown_081F860D - cmp r4, r0 - beq _0809C244 - ldr r0, =gUnknown_081F9553 - cmp r4, r0 - beq _0809C244 - ldr r0, =gUnknown_0823B4BB - cmp r4, r0 - beq _0809C244 - ldr r0, =gUnknown_0823B589 - cmp r4, r0 - beq _0809C244 - ldr r0, =gUnknown_082766A2 - cmp r4, r0 - beq _0809C244 - ldr r0, =gUnknown_082766A6 - cmp r4, r0 - beq _0809C244 - ldr r0, =gUnknown_08271D92 - cmp r4, r0 - beq _0809C244 - movs r0, 0x5 - bl audio_play -_0809C244: - adds r0, r4, 0 - bl script_env_1_execute_new_script - movs r0, 0x1 -_0809C24C: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809C1FC - - thumb_func_start TryGetScriptOnPressingA -TryGetScriptOnPressingA: @ 809C270 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - mov r8, r5 - lsls r2, 24 - lsrs r4, r2, 24 - adds r7, r4, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl TryGetMapObjectScript - cmp r0, 0 - bne _0809C2BC - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl TryGetInvisibleMapObjectScript - cmp r0, 0 - bne _0809C2BC - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl TryGetMetatileBehaviorScript - cmp r0, 0 - bne _0809C2BC - adds r0, r6, 0 - mov r1, r8 - adds r2, r7, 0 - bl TryGetFieldMoveScript - cmp r0, 0 - bne _0809C2BC - movs r0, 0 -_0809C2BC: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end TryGetScriptOnPressingA - - thumb_func_start sub_809C2C8 -sub_809C2C8: @ 809C2C8 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r2, 24 - lsrs r6, r2, 24 - movs r1, 0 - ldrsh r0, [r4, r1] - movs r2, 0x2 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsCounter - lsls r0, 24 - cmp r0, 0 - bne _0809C2F0 - ldrh r0, [r4] - ldrh r1, [r4, 0x2] - b _0809C30E -_0809C2F0: - ldr r1, =gUnknown_08339D64 - lsls r2, r6, 3 - adds r0, r2, r1 - ldr r3, [r0] - ldrh r0, [r4] - adds r0, r3 - lsls r0, 16 - lsrs r0, 16 - adds r1, 0x4 - adds r2, r1 - ldr r2, [r2] - ldrh r1, [r4, 0x2] - adds r1, r2 - lsls r1, 16 - lsrs r1, 16 -_0809C30E: - ldrb r2, [r4, 0x4] - bl GetFieldObjectIdByXYZ - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x10 - beq _0809C32E - ldr r1, =0x02037350 - lsls r2, r3, 3 - adds r0, r2, r3 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x8] - adds r5, r1, 0 - cmp r0, 0xFF - bne _0809C33C -_0809C32E: - movs r0, 0 - b _0809C36E - .pool -_0809C33C: - movs r4, 0 - ldr r1, =0x02032308 -_0809C340: - ldrb r0, [r1] - cmp r0, 0x1 - bne _0809C34C - ldrb r0, [r1, 0x2] - cmp r0, r3 - beq _0809C32E -_0809C34C: - adds r1, 0x4 - adds r4, 0x1 - cmp r4, 0x3 - ble _0809C340 - ldr r0, =0x03005df0 - strb r3, [r0] - ldr r1, =0x020375f2 - adds r0, r2, r3 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0, 0x8] - strh r0, [r1] - ldr r0, =0x020375f4 - strh r6, [r0] - adds r0, r3, 0 - bl GetFieldObjectScriptPointerByFieldObjectId -_0809C36E: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809C2C8 - - thumb_func_start TryGetMapObjectScript -TryGetMapObjectScript: @ 809C384 - push {r4-r7,lr} - adds r5, r0, 0 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r7, r2, 24 - ldrh r0, [r5] - ldrh r1, [r5, 0x2] - ldrb r2, [r5, 0x4] - bl GetFieldObjectIdByXYZ - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x10 - beq _0809C3B4 - ldr r1, =0x02037350 - lsls r2, r4, 3 - adds r0, r2, r4 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x8] - adds r3, r1, 0 - cmp r0, 0xFF - bne _0809C40C -_0809C3B4: - adds r0, r6, 0 - bl MetatileBehavior_IsCounter - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C400 - ldr r1, =gUnknown_08339D64 - lsls r2, r7, 3 - adds r0, r2, r1 - ldr r3, [r0] - ldrh r0, [r5] - adds r0, r3 - lsls r0, 16 - lsrs r0, 16 - adds r1, 0x4 - adds r2, r1 - ldr r2, [r2] - ldrh r1, [r5, 0x2] - adds r1, r2 - lsls r1, 16 - lsrs r1, 16 - ldrb r2, [r5, 0x4] - bl GetFieldObjectIdByXYZ - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x10 - beq _0809C400 - ldr r1, =0x02037350 - lsls r2, r4, 3 - adds r0, r2, r4 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x8] - adds r3, r1, 0 - cmp r0, 0xFF - bne _0809C40C -_0809C400: - movs r0, 0 - b _0809C44E - .pool -_0809C40C: - ldr r0, =0x03005df0 - strb r4, [r0] - ldr r1, =0x020375f2 - adds r0, r2, r4 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x8] - strh r0, [r1] - ldr r0, =0x020375f4 - strh r7, [r0] - bl InTrainerHill - cmp r0, 0x1 - bne _0809C43C - bl sub_81D62AC - b _0809C442 - .pool -_0809C43C: - adds r0, r4, 0 - bl GetFieldObjectScriptPointerByFieldObjectId -_0809C442: - adds r1, r0, 0 - ldr r0, =0x020375f2 - ldrb r0, [r0] - bl sub_8099188 - adds r1, r0, 0 -_0809C44E: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end TryGetMapObjectScript - - thumb_func_start TryGetInvisibleMapObjectScript -@ signed int TryGetInvisibleMapObjectScript(int a1, int a2, u8 playerFacingDirection) -TryGetInvisibleMapObjectScript: @ 809C458 - push {r4,r5,lr} - lsls r2, 24 - lsrs r5, r2, 24 - ldr r4, =0x02037318 - ldrh r1, [r0] - subs r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - ldrh r2, [r0, 0x2] - subs r2, 0x7 - lsls r2, 16 - lsrs r2, 16 - ldrb r3, [r0, 0x4] - adds r0, r4, 0 - bl FindInvisibleMapObjectByPosition - cmp r0, 0 - beq _0809C4CC - ldr r2, [r0, 0x8] - cmp r2, 0 - bne _0809C490 - ldr r0, =gUnknown_082C8436 - b _0809C532 - .pool -_0809C490: - ldrb r0, [r0, 0x5] - cmp r0, 0x8 - bhi _0809C530 - lsls r0, 2 - ldr r1, =_0809C4A4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0809C4A4: - .4byte _0809C530 - .4byte _0809C4C8 - .4byte _0809C4D0 - .4byte _0809C4D6 - .4byte _0809C4DC - .4byte _0809C4E2 - .4byte _0809C4E2 - .4byte _0809C4E2 - .4byte _0809C510 -_0809C4C8: - cmp r5, 0x2 - beq _0809C530 -_0809C4CC: - movs r0, 0 - b _0809C532 -_0809C4D0: - cmp r5, 0x1 - beq _0809C530 - b _0809C4CC -_0809C4D6: - cmp r5, 0x4 - beq _0809C530 - b _0809C4CC -_0809C4DC: - cmp r5, 0x3 - beq _0809C530 - b _0809C4CC -_0809C4E2: - ldr r1, =0x020375e0 - lsrs r0, r2, 16 - movs r3, 0xFA - lsls r3, 1 - adds r0, r3 - strh r0, [r1] - ldr r0, =0x020375e2 - strh r2, [r0] - ldrh r0, [r1] - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C4CC - ldr r0, =gUnknown_08271CB7 - b _0809C532 - .pool -_0809C510: - cmp r5, 0x2 - bne _0809C4CC - ldr r0, =0x020375e0 - strh r2, [r0] - bl sub_80E9680 - lsls r0, 24 - cmp r0, 0 - beq _0809C4CC - ldr r0, =gUnknown_082759F1 - b _0809C532 - .pool -_0809C530: - adds r0, r2, 0 -_0809C532: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end TryGetInvisibleMapObjectScript - - thumb_func_start TryGetMetatileBehaviorScript -TryGetMetatileBehaviorScript: @ 809C538 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r4, r2, 24 - adds r0, r5, 0 - adds r1, r4, 0 - bl MetatileBehavior_IsPlayerFacingTVScreen - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C55C - ldr r0, =gUnknown_0827EE0B - b _0809C7E4 - .pool -_0809C55C: - adds r0, r5, 0 - bl MetatileBehavior_IsPC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C574 - ldr r0, =gUnknown_08271D92 - b _0809C7E4 - .pool -_0809C574: - adds r0, r5, 0 - bl is_tile_x8B - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C58C - ldr r0, =gUnknown_081E615D - b _0809C7E4 - .pool -_0809C58C: - adds r0, r5, 0 - bl is_tile_xEA - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C5A4 - ldr r0, =gUnknown_082393F9 - b _0809C7E4 - .pool -_0809C5A4: - adds r0, r5, 0 - bl is_tile_x84 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C5B4 - b _0809C6E4 -_0809C5B4: - adds r0, r5, 0 - bl is_tile_x87 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C5CC - ldr r0, =gUnknown_082A4BAC - b _0809C7E4 - .pool -_0809C5CC: - adds r0, r5, 0 - bl is_tile_x8C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C5E4 - ldr r0, =gUnknown_0826A22A - b _0809C7E4 - .pool -_0809C5E4: - adds r0, r5, 0 - bl is_tile_x85 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C5FC - ldr r0, =gUnknown_0827208F - b _0809C7E4 - .pool -_0809C5FC: - adds r0, r5, 0 - bl sub_8089A1C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C614 - ldr r0, =gUnknown_08292DE5 - b _0809C7E4 - .pool -_0809C614: - adds r0, r5, 0 - bl sub_8089A30 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C62C - ldr r0, =gUnknown_082725CE - b _0809C7E4 - .pool -_0809C62C: - adds r0, r5, 0 - bl sub_8089A44 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C644 - ldr r0, =gUnknown_082725D7 - b _0809C7E4 - .pool -_0809C644: - adds r0, r5, 0 - bl sub_8089A58 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C65C - ldr r0, =gUnknown_082725E0 - b _0809C7E4 - .pool -_0809C65C: - adds r0, r5, 0 - bl sub_8089A6C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C674 - ldr r0, =gUnknown_082725E9 - b _0809C7E4 - .pool -_0809C674: - adds r0, r5, 0 - bl sub_8089A80 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C68C - ldr r0, =gUnknown_082725F2 - b _0809C7E4 - .pool -_0809C68C: - adds r0, r5, 0 - bl sub_8089A94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C6A4 - ldr r0, =gUnknown_082725FB - b _0809C7E4 - .pool -_0809C6A4: - adds r0, r5, 0 - bl sub_8089AA8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C6BC - ldr r0, =gUnknown_08272604 - b _0809C7E4 - .pool -_0809C6BC: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8089AD0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C6D4 - ldr r0, =gUnknown_08277B8A - b _0809C7E4 - .pool -_0809C6D4: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8089AEC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C6EC -_0809C6E4: - ldr r0, =gUnknown_08277365 - b _0809C7E4 - .pool -_0809C6EC: - adds r0, r5, 0 - bl MetatileBehavior_IsQuestionnaire - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C704 - ldr r0, =gUnknown_0827381B - b _0809C7E4 - .pool -_0809C704: - adds r0, r5, 0 - bl MetatileBehavior_IsTrainerHillTimer - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C71C - ldr r0, =gUnknown_082C8393 - b _0809C7E4 - .pool -_0809C71C: - movs r4, 0x4 - ldrsb r4, [r6, r4] - movs r1, 0 - ldrsh r0, [r6, r1] - movs r2, 0x2 - ldrsh r1, [r6, r2] - bl MapGridGetZCoordAt - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _0809C7D0 - adds r0, r5, 0 - bl sub_8089288 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C74C - ldr r0, =gUnknown_0823B4BB - b _0809C7E4 - .pool -_0809C74C: - adds r0, r5, 0 - bl sub_808929C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C764 - ldr r0, =gUnknown_0823B589 - b _0809C7E4 - .pool -_0809C764: - adds r0, r5, 0 - bl sub_80893DC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C77C - ldr r0, =gUnknown_0823B684 - b _0809C7E4 - .pool -_0809C77C: - adds r0, r5, 0 - bl sub_80893F0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C794 - ldr r0, =gUnknown_0823B68C - b _0809C7E4 - .pool -_0809C794: - adds r0, r5, 0 - bl sub_80892EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C7A8 - bl sub_80EB56C - b _0809C7E2 -_0809C7A8: - adds r0, r5, 0 - bl sub_8089364 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C7BC - bl sub_80EB9E0 - b _0809C7E2 -_0809C7BC: - adds r0, r5, 0 - bl sub_8089350 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C7E2 - bl sub_80EBB28 - b _0809C7E2 -_0809C7D0: - adds r0, r5, 0 - bl sub_8089300 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C7E2 - bl sub_80EB498 -_0809C7E2: - movs r0, 0 -_0809C7E4: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end TryGetMetatileBehaviorScript - - thumb_func_start TryGetFieldMoveScript -TryGetFieldMoveScript: @ 809C7EC - push {r4,lr} - lsls r1, 24 - lsrs r4, r1, 24 - ldr r0, =0x0000086b - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C824 - bl PartyHasMonWithSurf - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C824 - bl IsPlayerFacingSurfableFishableWater - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C824 - ldr r0, =gUnknown_08271EA0 - b _0809C862 - .pool -_0809C824: - adds r0, r4, 0 - bl MetatileBehavior_IsWaterfall - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C860 - ldr r0, =0x0000086e - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C858 - bl IsPlayerSurfingNorth - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C858 - ldr r0, =gUnknown_08290A49 - b _0809C862 - .pool -_0809C858: - ldr r0, =gUnknown_08290A83 - b _0809C862 - .pool -_0809C860: - movs r0, 0 -_0809C862: - pop {r4} - pop {r1} - bx r1 - thumb_func_end TryGetFieldMoveScript - - thumb_func_start sub_809C868 -sub_809C868: @ 809C868 - push {lr} - ldr r0, =0x0000086d - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0809C894 - bl sub_809D1E8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0809C894 - ldr r0, =gUnknown_08290B0F - bl script_env_1_execute_new_script - movs r0, 0x1 - b _0809C896 - .pool -_0809C894: - movs r0, 0 -_0809C896: - pop {r1} - bx r1 - thumb_func_end sub_809C868 - - thumb_func_start sub_809C89C -sub_809C89C: @ 809C89C - push {lr} - ldr r0, =0x0000086d - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0809C8D4 - ldr r0, =0x02037318 - ldrb r0, [r0, 0x17] - cmp r0, 0x5 - bne _0809C8D4 - bl sub_809D1E8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C8D4 - ldr r0, =gUnknown_08290B5A - bl script_env_1_execute_new_script - movs r0, 0x1 - b _0809C8D6 - .pool -_0809C8D4: - movs r0, 0 -_0809C8D6: - pop {r1} - bx r1 - thumb_func_end sub_809C89C - - thumb_func_start sub_809C8DC -sub_809C8DC: @ 809C8DC - push {r4-r6,lr} - adds r5, r0, 0 - lsls r1, 16 - lsrs r4, r1, 16 - adds r6, r4, 0 - bl mapheader_trigger_activate_at__run_now - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C92E - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_809CC9C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C92E - adds r0, r4, 0 - bl sub_809C96C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C92E - adds r0, r6, 0 - bl per_step_scripts - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C92E - bl sub_80B5870 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809C92E - movs r0, 0 - b _0809C930 -_0809C92E: - movs r0, 0x1 -_0809C930: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_809C8DC - - thumb_func_start mapheader_trigger_activate_at__run_now -mapheader_trigger_activate_at__run_now: @ 809C938 - push {r4,lr} - ldr r4, =0x02037318 - ldrh r1, [r0] - subs r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - ldrh r2, [r0, 0x2] - subs r2, 0x7 - lsls r2, 16 - lsrs r2, 16 - ldrb r3, [r0, 0x4] - adds r0, r4, 0 - bl mapheader_trigger_activate_at - cmp r0, 0 - beq _0809C964 - bl script_env_1_execute_new_script - movs r0, 0x1 - b _0809C966 - .pool -_0809C964: - movs r0, 0 -_0809C966: - pop {r4} - pop {r1} - bx r1 - thumb_func_end mapheader_trigger_activate_at__run_now - - thumb_func_start sub_809C96C -sub_809C96C: @ 809C96C - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_8089918 - lsls r0, 24 - cmp r0, 0 - beq _0809C988 - ldr r0, =gUnknown_082A8337 - b _0809C996 - .pool -_0809C988: - adds r0, r4, 0 - bl sub_8089ABC - lsls r0, 24 - cmp r0, 0 - beq _0809C9A4 - ldr r0, =gUnknown_08252BE8 -_0809C996: - bl script_env_1_execute_new_script - movs r0, 0x1 - b _0809C9EA - .pool -_0809C9A4: - adds r0, r4, 0 - bl sub_80893C8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C9B8 - bl sub_80FA9D0 - b _0809C9E8 -_0809C9B8: - adds r0, r4, 0 - bl sub_80893B4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809C9E8 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileIdAt - lsls r0, 16 - asrs r0, 16 - bl sub_80FA970 -_0809C9E8: - movs r0, 0 -_0809C9EA: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_809C96C - - thumb_func_start per_step_scripts -per_step_scripts: @ 809C9F4 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - bl InUnionRoom - cmp r0, 0x1 - bne _0809CA04 - b _0809CB24 -_0809CA04: - bl sub_80B215C - bl happiness_algorithm_step - bl sub_81D4998 - ldr r0, =0x02037590 - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0809CAF8 - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_808904C - lsls r0, 24 - cmp r0, 0 - bne _0809CAF8 - bl overworld_poison_step - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CA48 - ldr r0, =gUnknown_082736BC - bl script_env_1_execute_new_script - b _0809CB28 - .pool -_0809CA48: - bl sub_8070BD0 - lsls r0, 24 - cmp r0, 0 - beq _0809CA64 - movs r0, 0xD - bl sav12_xor_increment - ldr r0, =gUnknown_08291FC0 - bl script_env_1_execute_new_script - b _0809CB28 - .pool -_0809CA64: - bl sub_813B3B0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CA7C - ldr r0, =gUnknown_08273D1F - bl script_env_1_execute_new_script - b _0809CB28 - .pool -_0809CA7C: - bl sub_8179A04 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CA94 - ldr r0, =gUnknown_08238EAF - bl script_env_1_execute_new_script - b _0809CB28 - .pool -_0809CA94: - bl is_tile_that_overrides_player_control - cmp r0, 0x1 - bne _0809CAA8 - ldr r0, =gUnknown_081DF7BA - bl script_env_1_execute_new_script - b _0809CB28 - .pool -_0809CAA8: - bl sub_8138120 - cmp r0, 0x1 - bne _0809CABC - ldr r0, =gUnknown_081F49EC - bl script_env_1_execute_new_script - b _0809CB28 - .pool -_0809CABC: - bl sub_8138168 - cmp r0, 0x1 - bne _0809CAD0 - ldr r0, =gUnknown_081FA4D6 - bl script_env_1_execute_new_script - b _0809CB28 - .pool -_0809CAD0: - bl sub_81381B0 - cmp r0, 0x1 - bne _0809CAE4 - ldr r0, =gUnknown_0821307B - bl script_env_1_execute_new_script - b _0809CB28 - .pool -_0809CAE4: - bl sub_81381F8 - cmp r0, 0x1 - bne _0809CAF8 - ldr r0, =gUnknown_08224175 - bl script_env_1_execute_new_script - b _0809CB28 - .pool -_0809CAF8: - bl safari_step - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CB28 - movs r0, 0x1 - bl sub_8137FC0 - cmp r0, 0x1 - bne _0809CB1C - ldr r0, =gUnknown_0823C050 - bl script_env_1_execute_new_script - b _0809CB28 - .pool -_0809CB1C: - bl sub_8196034 - cmp r0, 0 - bne _0809CB28 -_0809CB24: - movs r0, 0 - b _0809CB2A -_0809CB28: - movs r0, 0x1 -_0809CB2A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end per_step_scripts - - thumb_func_start sub_809CB30 -sub_809CB30: @ 809CB30 - push {lr} - ldr r0, =0x0000402a - movs r1, 0 - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_809CB30 - - thumb_func_start happiness_algorithm_step -happiness_algorithm_step: @ 809CB44 - push {r4,r5,lr} - ldr r0, =0x0000402a - bl GetVarPointer - ldrh r1, [r0] - adds r1, 0x1 - strh r1, [r0] - ldrh r1, [r0] - movs r2, 0x7F - ands r1, r2 - strh r1, [r0] - cmp r1, 0 - bne _0809CB72 - ldr r5, =0x020244ec - movs r4, 0x5 -_0809CB62: - adds r0, r5, 0 - movs r1, 0x5 - bl happiness_algorithm - adds r5, 0x64 - subs r4, 0x1 - cmp r4, 0 - bge _0809CB62 -_0809CB72: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end happiness_algorithm_step - - thumb_func_start overworld_poison_timer_set -overworld_poison_timer_set: @ 809CB80 - push {lr} - ldr r0, =0x0000402b - movs r1, 0 - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end overworld_poison_timer_set - - thumb_func_start overworld_poison_step -overworld_poison_step: @ 809CB94 - push {lr} - ldr r0, =0x02037318 - ldrb r0, [r0, 0x17] - cmp r0, 0x9 - beq _0809CBD4 - ldr r0, =0x0000402b - bl GetVarPointer - ldrh r1, [r0] - adds r1, 0x1 - strh r1, [r0] - ldrh r1, [r0] - movs r2, 0x3 - ands r1, r2 - strh r1, [r0] - cmp r1, 0 - bne _0809CBD4 - bl overworld_poison - cmp r0, 0x1 - beq _0809CBD4 - cmp r0, 0x1 - ble _0809CBD4 - cmp r0, 0x2 - bne _0809CBD4 - movs r0, 0x1 - b _0809CBD6 - .pool -_0809CBD4: - movs r0, 0 -_0809CBD6: - pop {r1} - bx r1 - thumb_func_end overworld_poison_step - - thumb_func_start prev_quest_postbuffer_cursor_backup_reset -prev_quest_postbuffer_cursor_backup_reset: @ 809CBDC - ldr r1, =0x020375d4 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end prev_quest_postbuffer_cursor_backup_reset - - thumb_func_start is_it_battle_time_3 -is_it_battle_time_3: @ 809CBE8 - push {r4-r7,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r7, r4, 0 - ldr r6, =0x020375d4 - ldrb r0, [r6] - cmp r0, 0x3 - bhi _0809CC0C - adds r0, 0x1 - strb r0, [r6] - ldr r0, =0x020375d6 - strh r4, [r0] - movs r0, 0 - b _0809CC30 - .pool -_0809CC0C: - ldr r5, =0x020375d6 - ldrh r1, [r5] - adds r0, r4, 0 - bl is_it_battle_time_2 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CC28 - strh r4, [r5] - movs r0, 0 - b _0809CC30 - .pool -_0809CC28: - movs r0, 0 - strb r0, [r6] - strh r7, [r5] - movs r0, 0x1 -_0809CC30: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end is_it_battle_time_3 - - thumb_func_start mapheader_run_first_tag2_script_list_match_conditionally -mapheader_run_first_tag2_script_list_match_conditionally: @ 809CC38 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =0x02037318 - mov r8, r0 - adds r1, r7, 0 - bl map_warp_check_packed - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl is_non_stair_warp_tile - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CC90 - lsls r0, r6, 24 - asrs r4, r0, 24 - movs r0, 0x1 - negs r0, r0 - cmp r4, r0 - beq _0809CC90 - bl walkrun_find_lowest_active_bit_in_bitfield - mov r0, r8 - adds r1, r4, 0 - adds r2, r7, 0 - bl sub_809CEB0 - bl sub_80AF734 - movs r0, 0x1 - b _0809CC92 - .pool -_0809CC90: - movs r0, 0 -_0809CC92: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end mapheader_run_first_tag2_script_list_match_conditionally - - thumb_func_start sub_809CC9C -sub_809CC9C: @ 809CC9C - push {r4-r7,lr} - adds r6, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - ldr r7, =0x02037318 - adds r0, r7, 0 - adds r1, r6, 0 - bl map_warp_check_packed - lsls r0, 24 - asrs r4, r0, 24 - movs r0, 0x1 - negs r0, r0 - cmp r4, r0 - beq _0809CD8A - adds r0, r5, 0 - bl is_warp_tile - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CD8A - bl walkrun_find_lowest_active_bit_in_bitfield - adds r0, r7, 0 - adds r1, r4, 0 - adds r2, r6, 0 - bl sub_809CEB0 - lsls r0, r5, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl MetatileBehavior_IsEscalator - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CCF8 - adds r0, r4, 0 - bl sub_80AF80C - movs r0, 0x1 - b _0809CD8C - .pool -_0809CCF8: - adds r0, r4, 0 - bl sub_8089870 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CD0E - bl sub_80AF828 - movs r0, 0x1 - b _0809CD8C -_0809CD0E: - adds r0, r4, 0 - bl is_role_x68 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CD24 - bl sub_80AF838 - movs r0, 0x1 - b _0809CD8C -_0809CD24: - adds r0, r4, 0 - bl MetatileBehavior_IsAquaHideoutWarp - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CD3A - bl sub_80AF848 - movs r0, 0x1 - b _0809CD8C -_0809CD3A: - adds r0, r4, 0 - bl sub_80898AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CD50 - bl sub_80B0268 - movs r0, 0x1 - b _0809CD8C -_0809CD50: - adds r0, r4, 0 - bl sub_8089904 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CD6C - ldr r0, =gUnknown_082A8350 - bl script_env_1_execute_new_script - movs r0, 0x1 - b _0809CD8C - .pool -_0809CD6C: - adds r0, r4, 0 - bl sub_80898C0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CD82 - bl sub_80AF87C - movs r0, 0x1 - b _0809CD8C -_0809CD82: - bl sub_80AF734 - movs r0, 0x1 - b _0809CD8C -_0809CD8A: - movs r0, 0 -_0809CD8C: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_809CC9C - - thumb_func_start is_warp_tile -is_warp_tile: @ 809CD94 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl is_tile_x69_2_warp_door - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CE2A - adds r0, r4, 0 - bl MetatileBehavior_IsLadder - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CE2A - adds r0, r4, 0 - bl MetatileBehavior_IsEscalator - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CE2A - adds r0, r4, 0 - bl sub_8088F58 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CE2A - adds r0, r4, 0 - bl sub_8089870 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CE2A - adds r0, r4, 0 - bl is_role_x68 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CE2A - adds r0, r4, 0 - bl MetatileBehavior_IsAquaHideoutWarp - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CE2A - adds r0, r4, 0 - bl sub_8089904 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CE2A - adds r0, r4, 0 - bl sub_80898C0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CE2A - adds r0, r4, 0 - bl sub_80898AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809CE2A - movs r0, 0 - b _0809CE2C -_0809CE2A: - movs r0, 0x1 -_0809CE2C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end is_warp_tile - - thumb_func_start is_non_stair_warp_tile -is_non_stair_warp_tile: @ 809CE34 - push {lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 24 - lsrs r1, 24 - adds r2, r1, 0 - cmp r1, 0x2 - beq _0809CE58 - cmp r1, 0x2 - bgt _0809CE4E - cmp r1, 0x1 - beq _0809CE62 - b _0809CE84 -_0809CE4E: - cmp r2, 0x3 - beq _0809CE6C - cmp r2, 0x4 - beq _0809CE76 - b _0809CE84 -_0809CE58: - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsNorthArrowWarp - b _0809CE7E -_0809CE62: - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsSouthArrowWarp - b _0809CE7E -_0809CE6C: - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsWestArrowWarp - b _0809CE7E -_0809CE76: - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsEastArrowWarp -_0809CE7E: - lsls r0, 24 - lsrs r0, 24 - b _0809CE86 -_0809CE84: - movs r0, 0 -_0809CE86: - pop {r1} - bx r1 - thumb_func_end is_non_stair_warp_tile - - thumb_func_start map_warp_check_packed -map_warp_check_packed: @ 809CE8C - push {lr} - adds r3, r1, 0 - ldrh r1, [r3] - subs r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - ldrh r2, [r3, 0x2] - subs r2, 0x7 - lsls r2, 16 - lsrs r2, 16 - ldrb r3, [r3, 0x4] - bl map_warp_check - lsls r0, 24 - asrs r0, 24 - pop {r1} - bx r1 - thumb_func_end map_warp_check_packed - - thumb_func_start sub_809CEB0 -sub_809CEB0: @ 809CEB0 - push {r4-r7,lr} - adds r7, r2, 0 - lsls r1, 24 - lsrs r4, r1, 24 - bl GetCurrentTrainerHillMapId - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - cmp r5, 0 - beq _0809CF00 - bl sub_81D6490 - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bne _0809CEF0 - lsls r0, r4, 24 - adds r4, r0, 0 - cmp r4, 0 - bne _0809CEE8 - ldr r0, =0x02037318 - ldr r0, [r0, 0x4] - ldr r5, [r0, 0x8] - b _0809CF0E - .pool -_0809CEE8: - bl sub_81D6120 - adds r5, r0, 0 - b _0809CF0E -_0809CEF0: - cmp r6, 0x5 - bne _0809CF00 - lsls r4, 24 - lsrs r0, r4, 24 - bl sub_81D6134 - adds r5, r0, 0 - b _0809CF0E -_0809CF00: - ldr r0, =0x02037318 - ldr r0, [r0, 0x4] - lsls r2, r4, 24 - asrs r1, r2, 21 - ldr r0, [r0, 0x8] - adds r5, r0, r1 - adds r4, r2, 0 -_0809CF0E: - ldrb r0, [r5, 0x6] - cmp r0, 0x7F - bne _0809CF20 - ldrb r0, [r5, 0x5] - bl copy_saved_warp2_bank_and_enter_x_to_warp1 - b _0809CF6E - .pool -_0809CF20: - movs r0, 0x7 - ldrsb r0, [r5, r0] - movs r1, 0x6 - ldrsb r1, [r5, r1] - movs r2, 0x5 - ldrsb r2, [r5, r2] - bl warp1_set_2 - movs r1, 0 - ldrsh r0, [r7, r1] - movs r2, 0x2 - ldrsh r1, [r7, r2] - bl sub_8084D5C - ldrb r0, [r5, 0x7] - ldrb r1, [r5, 0x6] - bl get_mapheader_by_bank_and_number - ldr r1, [r0, 0x4] - ldrb r0, [r5, 0x5] - ldr r1, [r1, 0x8] - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0, 0x6] - cmp r0, 0x7F - bne _0809CF6E - asrs r3, r4, 24 - lsls r0, r3, 3 - adds r0, r1 - ldrb r0, [r0, 0x5] - ldr r1, =0x03005d8c - ldr r2, [r1] - movs r1, 0x4 - ldrsb r1, [r2, r1] - ldrb r2, [r2, 0x5] - lsls r2, 24 - asrs r2, 24 - bl saved_warp2_set -_0809CF6E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809CEB0 - - thumb_func_start map_warp_consider_2_to_inside -map_warp_consider_2_to_inside: @ 809CF78 - push {r4-r7,lr} - adds r5, r0, 0 - lsls r1, 16 - lsrs r0, r1, 16 - adds r7, r0, 0 - lsls r2, 24 - lsrs r2, 24 - cmp r2, 0x2 - bne _0809CFFC - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_8089210 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CFB0 - ldr r0, =0x02037318 - ldr r1, [r0, 0x4] - adds r0, r5, 0 - bl sub_80E9668 - movs r0, 0x1 - b _0809CFFE - .pool -_0809CFB0: - adds r0, r4, 0 - bl is_tile_x69_2_warp_door - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CFFC - ldr r6, =0x02037318 - adds r0, r6, 0 - adds r1, r5, 0 - bl map_warp_check_packed - lsls r0, 24 - asrs r4, r0, 24 - movs r0, 0x1 - negs r0, r0 - cmp r4, r0 - beq _0809CFFC - adds r0, r7, 0 - bl is_warp_tile - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809CFFC - bl walkrun_find_lowest_active_bit_in_bitfield - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_809CEB0 - bl sub_80AF7D0 - movs r0, 0x1 - b _0809CFFE - .pool -_0809CFFC: - movs r0, 0 -_0809CFFE: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end map_warp_consider_2_to_inside - - thumb_func_start map_warp_check -map_warp_check: @ 809D004 - push {r4-r6,lr} - lsls r1, 16 - lsrs r6, r1, 16 - lsls r2, 16 - lsrs r5, r2, 16 - lsls r3, 24 - lsrs r4, r3, 24 - ldr r0, [r0, 0x4] - ldr r1, [r0, 0x8] - ldrb r3, [r0, 0x1] - movs r2, 0 - cmp r2, r3 - bge _0809D042 -_0809D01E: - ldrh r0, [r1] - cmp r0, r6 - bne _0809D03A - ldrh r0, [r1, 0x2] - cmp r0, r5 - bne _0809D03A - ldrb r0, [r1, 0x4] - cmp r0, r4 - beq _0809D034 - cmp r0, 0 - bne _0809D03A -_0809D034: - lsls r0, r2, 24 - asrs r0, 24 - b _0809D046 -_0809D03A: - adds r2, 0x1 - adds r1, 0x8 - cmp r2, r3 - blt _0809D01E -_0809D042: - movs r0, 0x1 - negs r0, r0 -_0809D046: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end map_warp_check - - thumb_func_start trigger_activate -trigger_activate: @ 809D04C - push {r4,lr} - adds r4, r0, 0 - cmp r4, 0 - beq _0809D082 - ldr r1, [r4, 0xC] - cmp r1, 0 - bne _0809D062 - ldrb r0, [r4, 0x6] - bl trigger_activate_weather - b _0809D082 -_0809D062: - ldrh r0, [r4, 0x6] - cmp r0, 0 - beq _0809D07C - ldrh r0, [r4, 0x6] - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r4, 0x8] - cmp r0, r1 - bne _0809D082 - ldr r0, [r4, 0xC] - b _0809D084 -_0809D07C: - adds r0, r1, 0 - bl script_env_2_execute_new_script -_0809D082: - movs r0, 0 -_0809D084: - pop {r4} - pop {r1} - bx r1 - thumb_func_end trigger_activate - - thumb_func_start mapheader_trigger_activate_at -mapheader_trigger_activate_at: @ 809D08C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r1, 16 - lsrs r1, 16 - mov r10, r1 - lsls r2, 16 - lsrs r2, 16 - mov r9, r2 - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - ldr r0, [r0, 0x4] - ldr r1, [r0, 0xC] - ldrb r7, [r0, 0x2] - movs r6, 0 - cmp r6, r7 - bge _0809D0E2 - adds r5, r1, 0 - adds r4, r5, 0 -_0809D0B8: - ldrh r0, [r4] - cmp r0, r10 - bne _0809D0D8 - ldrh r0, [r4, 0x2] - cmp r0, r9 - bne _0809D0D8 - ldrb r0, [r4, 0x4] - cmp r0, r8 - beq _0809D0CE - cmp r0, 0 - bne _0809D0D8 -_0809D0CE: - adds r0, r5, 0 - bl trigger_activate - cmp r0, 0 - bne _0809D0E4 -_0809D0D8: - adds r4, 0x10 - adds r5, 0x10 - adds r6, 0x1 - cmp r6, r7 - blt _0809D0B8 -_0809D0E2: - movs r0, 0 -_0809D0E4: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end mapheader_trigger_activate_at - - thumb_func_start sub_809D0F4 -sub_809D0F4: @ 809D0F4 - push {r4,lr} - ldr r4, =0x02037318 - ldrh r1, [r0] - subs r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - ldrh r2, [r0, 0x2] - subs r2, 0x7 - lsls r2, 16 - lsrs r2, 16 - ldrb r3, [r0, 0x4] - adds r0, r4, 0 - bl mapheader_trigger_activate_at - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809D0F4 - - thumb_func_start FindInvisibleMapObjectByPosition -@ int FindInvisibleMapObjectByPosition(struct mapheader *mapHeader, u16 x, u16 y, u8 elevation) -FindInvisibleMapObjectByPosition: @ 809D11C - push {r4-r7,lr} - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 16 - lsrs r6, r2, 16 - lsls r3, 24 - lsrs r5, r3, 24 - ldr r0, [r0, 0x4] - ldr r4, [r0, 0x10] - ldrb r3, [r0, 0x3] - movs r2, 0 - cmp r2, r3 - bcs _0809D162 -_0809D136: - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r4 - ldrh r0, [r1] - cmp r0, r7 - bne _0809D158 - ldrh r0, [r1, 0x2] - cmp r0, r6 - bne _0809D158 - ldrb r0, [r1, 0x4] - cmp r0, r5 - beq _0809D154 - cmp r0, 0 - bne _0809D158 -_0809D154: - adds r0, r1, 0 - b _0809D164 -_0809D158: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r3 - bcc _0809D136 -_0809D162: - movs r0, 0 -_0809D164: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end FindInvisibleMapObjectByPosition - - thumb_func_start dive_warp -dive_warp: @ 809D16C - push {r4,r5,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - ldr r0, =0x02037318 - ldrb r0, [r0, 0x17] - cmp r0, 0x5 - bne _0809D1A4 - lsls r0, r5, 24 - lsrs r0, 24 - bl sub_80895D0 - lsls r0, 24 - cmp r0, 0 - bne _0809D1A4 - ldrh r0, [r4] - subs r0, 0x7 - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r4, 0x2] - subs r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - bl sub_8085058 - b _0809D1C8 - .pool -_0809D1A4: - lsls r0, r5, 24 - lsrs r0, 24 - bl sub_80895B0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809D1E0 - ldrh r0, [r4] - subs r0, 0x7 - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r4, 0x2] - subs r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - bl sub_8085078 -_0809D1C8: - lsls r0, 24 - cmp r0, 0 - beq _0809D1E0 - bl walkrun_find_lowest_active_bit_in_bitfield - bl sp13E_warp_to_last_warp - movs r0, 0xE9 - bl audio_play - movs r0, 0x1 - b _0809D1E2 -_0809D1E0: - movs r0, 0 -_0809D1E2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end dive_warp - - thumb_func_start sub_809D1E8 -sub_809D1E8: @ 809D1E8 - push {r4,r5,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02037318 - ldrb r0, [r0, 0x17] - cmp r0, 0x5 - bne _0809D244 - adds r0, r5, 0 - bl sub_80895D0 - lsls r0, 24 - cmp r0, 0 - bne _0809D244 - mov r0, sp - ldrh r0, [r0] - subs r0, 0x7 - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r4] - subs r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - bl sub_8085058 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809D274 - movs r0, 0x1 - b _0809D276 - .pool -_0809D244: - adds r0, r5, 0 - bl sub_80895B0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809D274 - mov r0, sp - ldrh r0, [r0] - subs r0, 0x7 - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r4] - subs r1, 0x7 - lsls r1, 16 - lsrs r1, 16 - bl sub_8085078 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809D274 - movs r0, 0x2 - b _0809D276 -_0809D274: - movs r0, 0 -_0809D276: - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809D1E8 - - thumb_func_start GetFieldObjectScriptPointerForComparison -@ u8 *GetFieldObjectScriptPointerForComparison() -GetFieldObjectScriptPointerForComparison: @ 809D280 - push {r4,r5,lr} - sub sp, 0x8 - bl player_get_direction_upper_nybble - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - mov r5, sp - mov r0, sp - bl player_get_next_pos_and_height - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0x2 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, sp - adds r2, r4, 0 - bl TryGetMapObjectScript - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end GetFieldObjectScriptPointerForComparison - - thumb_func_start sub_809D2BC -sub_809D2BC: @ 809D2BC - push {r4,lr} - sub sp, 0x8 - bl player_get_direction_upper_nybble - mov r4, sp - mov r0, sp - bl player_get_pos_to_and_height - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0x2 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - ldr r4, =0x02037318 - adds r0, r4, 0 - mov r1, sp - bl map_warp_check_packed - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - adds r0, r4, 0 - mov r2, sp - bl sub_809CEB0 - movs r0, 0 - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_809D2BC - - thumb_func_start sub_809D300 -sub_809D300: @ 809D300 - push {r4,lr} - ldr r4, =0x03005d8c - ldr r0, [r4] - ldr r1, =0x00001270 - adds r0, r1 - movs r2, 0x96 - lsls r2, 1 - movs r1, 0 - bl memset - ldr r0, [r4] - ldr r1, =0x0000139c - adds r0, r1 - movs r2, 0x80 - lsls r2, 2 - movs r1, 0 - bl memset - ldr r0, =0x020375fc - movs r1, 0 - movs r2, 0x10 - bl memset - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D300 - - thumb_func_start sub_809D344 -sub_809D344: @ 809D344 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00001270 - adds r2, r0, r1 - movs r1, 0 - str r1, [r2] - ldr r1, =0x0000139c - adds r0, r1 - movs r1, 0 - movs r2, 0x20 - bl memset - ldr r0, =0x000008ad - bl FlagReset - ldr r0, =0x000008ae - bl FlagReset - ldr r0, =0x00000889 - bl FlagReset - ldr r0, =0x000008c1 - bl FlagReset - movs r0, 0x88 - lsls r0, 4 - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D344 - - thumb_func_start sub_809D3A0 -sub_809D3A0: @ 809D3A0 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00001394 - adds r0, r1 - movs r1, 0 - movs r2, 0x8 - bl memset - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D3A0 - - thumb_func_start sub_809D3C0 -sub_809D3C0: @ 809D3C0 - push {lr} - ldr r0, =0x00004046 - bl GetVarPointer - ldr r1, =0x03005d90 - ldr r2, [r1] - movs r1, 0 - strb r1, [r2, 0x1A] - strh r1, [r0] - ldr r0, =0x00000896 - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D3C0 - - thumb_func_start sub_809D3E8 -sub_809D3E8: @ 809D3E8 - push {r4,r5,lr} - ldr r0, =0x00004046 - bl GetVarPointer - ldr r4, =0x03005d90 - ldr r2, [r4] - movs r5, 0 - movs r1, 0xDA - strb r1, [r2, 0x1A] - ldr r2, =0x00000302 - adds r1, r2, 0 - strh r1, [r0] - ldr r0, =0x00000896 - bl FlagSet - ldr r1, [r4] - movs r0, 0x1 - strb r0, [r1, 0x19] - ldr r0, [r4] - strb r5, [r0, 0x18] - bl sub_80BB358 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D3E8 - - thumb_func_start sub_809D42C -sub_809D42C: @ 809D42C - push {lr} - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x1A] - cmp r0, 0xDA - bne _0809D468 - ldr r0, =0x00004046 - bl VarGet - lsls r0, 16 - ldr r1, =0x03020000 - cmp r0, r1 - bne _0809D468 - ldr r0, =0x00000896 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0809D468 - movs r0, 0x1 - b _0809D46A - .pool -_0809D468: - movs r0, 0 -_0809D46A: - pop {r1} - bx r1 - thumb_func_end sub_809D42C - - thumb_func_start sub_809D470 -sub_809D470: @ 809D470 - push {lr} - ldr r0, =0x000008ac - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D470 - - thumb_func_start sub_809D480 -sub_809D480: @ 809D480 - push {lr} - ldr r0, =0x000008ac - bl FlagSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D480 - - thumb_func_start sub_809D490 -sub_809D490: @ 809D490 - push {lr} - ldr r0, =0x000008ac - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809D490 - - thumb_func_start sub_809D4A4 -sub_809D4A4: @ 809D4A4 - push {lr} - ldr r0, =0x000008db - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D4A4 - - thumb_func_start sub_809D4B4 -sub_809D4B4: @ 809D4B4 - push {lr} - ldr r0, =0x000008db - bl FlagSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D4B4 - - thumb_func_start sub_809D4C4 -sub_809D4C4: @ 809D4C4 - push {lr} - ldr r0, =0x000008db - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809D4C4 - - thumb_func_start sub_809D4D8 -sub_809D4D8: @ 809D4D8 - push {lr} - movs r0, 0xF2 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001e5 - bl FlagReset - movs r0, 0xF3 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001e7 - bl FlagReset - movs r0, 0xF4 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001e9 - bl FlagReset - movs r0, 0xF5 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001eb - bl FlagReset - movs r0, 0xF6 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001ed - bl FlagReset - movs r0, 0xF7 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001ef - bl FlagReset - movs r0, 0xF8 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001f1 - bl FlagReset - movs r0, 0xF9 - lsls r0, 1 - bl FlagReset - ldr r0, =0x000001f3 - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D4D8 - - thumb_func_start sub_809D570 -sub_809D570: @ 809D570 - push {lr} - ldr r0, =0x000040dd - movs r1, 0 - bl VarSet - ldr r0, =0x000040de - movs r1, 0 - bl VarSet - ldr r0, =0x000040df - movs r1, 0 - bl VarSet - ldr r0, =0x000040e0 - movs r1, 0 - bl VarSet - ldr r0, =0x000040e1 - movs r1, 0 - bl VarSet - ldr r0, =0x000040e2 - movs r1, 0 - bl VarSet - ldr r0, =0x000040e3 - movs r1, 0 - bl VarSet - ldr r0, =0x000040e4 - movs r1, 0 - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D570 - - thumb_func_start sub_809D5D8 -sub_809D5D8: @ 809D5D8 - push {lr} - ldr r0, =0x0000402c - movs r1, 0 - bl VarSet - ldr r0, =0x000008c2 - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D5D8 - - thumb_func_start sub_809D5F4 -sub_809D5F4: @ 809D5F4 - push {lr} - ldr r0, =0x0000402c - movs r1, 0x92 - lsls r1, 4 - bl VarSet - ldr r0, =0x000008c2 - bl FlagSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D5F4 - - thumb_func_start sub_809D614 -sub_809D614: @ 809D614 - push {lr} - ldr r0, =0x000008c2 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0809D640 - ldr r0, =0x0000402c - bl VarGet - lsls r0, 16 - movs r1, 0x92 - lsls r1, 20 - cmp r0, r1 - bne _0809D640 - movs r0, 0x1 - b _0809D642 - .pool -_0809D640: - movs r0, 0 -_0809D642: - pop {r1} - bx r1 - thumb_func_end sub_809D614 - - thumb_func_start GetVarPointer -@ u16 *GetVarPointer(u16 varId) -GetVarPointer: @ 809D648 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - adds r2, r1, 0 - ldr r0, =0x00003fff - cmp r1, r0 - bhi _0809D660 - movs r0, 0 - b _0809D688 - .pool -_0809D660: - lsls r0, r1, 16 - cmp r0, 0 - bge _0809D67C - ldr r0, =gUnknown_081DBA0C - ldr r2, =0xffff8000 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - b _0809D688 - .pool -_0809D67C: - ldr r0, =0x03005d8c - lsls r1, r2, 1 - ldr r2, =0xffff939c - adds r1, r2 - ldr r0, [r0] - adds r0, r1 -_0809D688: - pop {r1} - bx r1 - .pool - thumb_func_end GetVarPointer - - thumb_func_start VarGet -@ u16 VarGet(u16 varId) -VarGet: @ 809D694 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl GetVarPointer - cmp r0, 0 - beq _0809D6A8 - ldrh r0, [r0] - b _0809D6AA -_0809D6A8: - adds r0, r4, 0 -_0809D6AA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end VarGet - - thumb_func_start VarSet -@ bool8 VarSet(u16 varId, u16 value) -VarSet: @ 809D6B0 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - lsrs r4, r1, 16 - bl GetVarPointer - cmp r0, 0 - beq _0809D6C8 - strh r4, [r0] - movs r0, 0x1 - b _0809D6CA -_0809D6C8: - movs r0, 0 -_0809D6CA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end VarSet - - thumb_func_start VarGetFieldObjectGraphicsId -@ u8 VarGetFieldObjectGraphicsId(u8 index) -VarGetFieldObjectGraphicsId: @ 809D6D0 - push {lr} - lsls r0, 24 - lsrs r0, 8 - ldr r1, =0x40100000 - adds r0, r1 - lsrs r0, 16 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end VarGetFieldObjectGraphicsId - - thumb_func_start GetFlagPointer -@ u8 *GetFlagPointer(u16 flagId) -GetFlagPointer: @ 809D6EC - push {lr} - lsls r1, r0, 16 - lsrs r2, r1, 16 - adds r3, r2, 0 - cmp r2, 0 - bne _0809D6FC - movs r0, 0 - b _0809D72E -_0809D6FC: - ldr r0, =0x00003fff - cmp r2, r0 - bhi _0809D71C - ldr r0, =0x03005d8c - lsrs r1, 19 - ldr r2, =0x00001270 - adds r1, r2 - ldr r0, [r0] - b _0809D72C - .pool -_0809D71C: - ldr r1, =0xffffc000 - adds r0, r3, r1 - cmp r0, 0 - bge _0809D728 - ldr r2, =0xffffc007 - adds r0, r3, r2 -_0809D728: - asrs r0, 3 - ldr r1, =0x020375fc -_0809D72C: - adds r0, r1 -_0809D72E: - pop {r1} - bx r1 - .pool - thumb_func_end GetFlagPointer - - thumb_func_start FlagSet -@ bool8 FlagSet(u16 flagId) -FlagSet: @ 809D740 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl GetFlagPointer - adds r2, r0, 0 - cmp r2, 0 - beq _0809D760 - movs r0, 0x7 - ands r0, r4 - movs r1, 0x1 - lsls r1, r0 - ldrb r0, [r2] - orrs r1, r0 - strb r1, [r2] -_0809D760: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end FlagSet - - thumb_func_start FlagReset -@ bool8 FlagReset(u16 flagId) -FlagReset: @ 809D768 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl GetFlagPointer - adds r2, r0, 0 - cmp r2, 0 - beq _0809D788 - movs r0, 0x7 - ands r0, r4 - movs r1, 0x1 - lsls r1, r0 - ldrb r0, [r2] - bics r0, r1 - strb r0, [r2] -_0809D788: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end FlagReset - - thumb_func_start FlagGet -@ bool8 FlagGet(u16 flagId) -FlagGet: @ 809D790 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl GetFlagPointer - cmp r0, 0 - beq _0809D7B4 - ldrb r0, [r0] - movs r1, 0x7 - ands r1, r4 - asrs r0, r1 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0809D7B4 - movs r0, 0x1 - b _0809D7B6 -_0809D7B4: - movs r0, 0 -_0809D7B6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end FlagGet - - thumb_func_start sub_809D7BC -sub_809D7BC: @ 809D7BC - push {lr} - movs r0, 0x1 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D7BC - - thumb_func_start sub_809D7C8 -sub_809D7C8: @ 809D7C8 - push {lr} - movs r0, 0x2 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D7C8 - - thumb_func_start sub_809D7D4 -sub_809D7D4: @ 809D7D4 - push {lr} - movs r0, 0x3 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D7D4 - - thumb_func_start sub_809D7E0 -sub_809D7E0: @ 809D7E0 - push {lr} - movs r0, 0x4 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D7E0 - - thumb_func_start sub_809D7EC -sub_809D7EC: @ 809D7EC - push {lr} - movs r0, 0x5 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D7EC - - thumb_func_start sub_809D7F8 -sub_809D7F8: @ 809D7F8 - push {lr} - movs r0, 0x6 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D7F8 - - thumb_func_start sub_809D804 -sub_809D804: @ 809D804 - push {lr} - movs r0, 0x9 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D804 - - thumb_func_start sub_809D810 -sub_809D810: @ 809D810 - push {lr} - movs r0, 0x7 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D810 - - thumb_func_start sub_809D81C -sub_809D81C: @ 809D81C - push {lr} - movs r0, 0x8 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D81C - - thumb_func_start sub_809D828 -sub_809D828: @ 809D828 - push {lr} - movs r0, 0xB - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D828 - - thumb_func_start sub_809D834 -sub_809D834: @ 809D834 - push {lr} - movs r0, 0xC - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D834 - - thumb_func_start sub_809D840 -sub_809D840: @ 809D840 - push {lr} - movs r0, 0x14 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D840 - - thumb_func_start sub_809D84C -sub_809D84C: @ 809D84C - push {lr} - movs r0, 0x15 - bl sub_80AEDF0 - pop {r0} - bx r0 - thumb_func_end sub_809D84C - - thumb_func_start trigger_activate_weather -trigger_activate_weather: @ 809D858 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r2, 0 - ldr r3, =gUnknown_085102E0 -_0809D862: - lsls r1, r2, 3 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r4 - bne _0809D87C - adds r0, r3, 0x4 - adds r0, r1, r0 - ldr r0, [r0] - bl _call_via_r0 - b _0809D886 - .pool -_0809D87C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xC - bls _0809D862 -_0809D886: - pop {r4} - pop {r0} - bx r0 - thumb_func_end trigger_activate_weather - - thumb_func_start task_per_step_callback_manager -task_per_step_callback_manager: @ 809D88C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0x8 - ldrsh r1, [r1, r2] - ldr r2, =gUnknown_08510348 - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end task_per_step_callback_manager - - thumb_func_start sub_809D8B8 -sub_809D8B8: @ 809D8B8 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0809D8CA - cmp r0, 0x1 - beq _0809D8E8 - b _0809D8FC -_0809D8CA: - ldr r0, =0x030022c0 - ldr r0, [r0, 0x20] - movs r1, 0x80 - lsls r1, 5 - ands r0, r1 - cmp r0, 0 - beq _0809D8FC - bl sub_809E7B0 - ldrh r0, [r4] - adds r0, 0x1 - b _0809D8FA - .pool -_0809D8E8: - ldr r0, =0x030022c0 - ldr r0, [r0, 0x20] - movs r1, 0x80 - lsls r1, 5 - ands r0, r1 - cmp r0, 0 - bne _0809D8FC - ldrh r0, [r4] - subs r0, 0x1 -_0809D8FA: - strh r0, [r4] -_0809D8FC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D8B8 - - thumb_func_start sub_809D908 -sub_809D908: @ 809D908 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r4, r1, r0 - bl script_env_2_is_enabled - lsls r0, 24 - cmp r0, 0 - bne _0809D930 - adds r0, r4, 0 - bl sub_809D8B8 - adds r0, r4, 0x2 - adds r1, r4, 0x4 - bl wild_encounter_related -_0809D930: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809D908 - - thumb_func_start overworld_ensure_per_step_coros_running -overworld_ensure_per_step_coros_running: @ 809D93C - push {r4,r5,lr} - ldr r5, =task_per_step_callback_manager - adds r0, r5, 0 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0809D966 - adds r0, r5, 0 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] -_0809D966: - ldr r4, =sub_809E638 - adds r0, r4, 0 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _0809D97C - adds r0, r4, 0 - movs r1, 0x50 - bl CreateTask -_0809D97C: - ldr r4, =sub_809D908 - adds r0, r4, 0 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _0809D992 - adds r0, r4, 0 - movs r1, 0x50 - bl CreateTask -_0809D992: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end overworld_ensure_per_step_coros_running - - thumb_func_start activate_per_step_callback -activate_per_step_callback: @ 809D9A8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =task_per_step_callback_manager - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xFF - beq _0809D9EA - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r1, r0, r1 - movs r2, 0 - adds r0, r1, 0 - adds r0, 0x1E -_0809D9CC: - strh r2, [r0] - subs r0, 0x2 - cmp r0, r1 - bge _0809D9CC - cmp r4, 0x7 - bls _0809D9E8 - movs r0, 0 - strh r0, [r1] - b _0809D9EA - .pool -_0809D9E8: - strh r4, [r1] -_0809D9EA: - pop {r4} - pop {r0} - bx r0 - thumb_func_end activate_per_step_callback - - thumb_func_start wild_encounter_reset_coro_args -wild_encounter_reset_coro_args: @ 809D9F0 - push {lr} - ldr r0, =task_per_step_callback_manager - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =sub_809D908 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xFF - beq _0809DA1A - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x2] - strh r1, [r0, 0x4] -_0809DA1A: - pop {r0} - bx r0 - .pool - thumb_func_end wild_encounter_reset_coro_args - - thumb_func_start nullsub_34 -nullsub_34: @ 809DA2C - bx lr - thumb_func_end nullsub_34 - - thumb_func_start sub_809DA30 -sub_809DA30: @ 809DA30 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - adds r0, r4, 0 - bl sub_8089764 - lsls r0, 24 - cmp r0, 0 - beq _0809DA48 - adds r0, r5, 0 - b _0809DA80 -_0809DA48: - adds r0, r4, 0 - bl sub_8089778 - lsls r0, 24 - cmp r0, 0 - beq _0809DA5A - adds r0, r5, 0 - adds r0, 0x8 - b _0809DA80 -_0809DA5A: - adds r0, r4, 0 - bl sub_808978C - lsls r0, 24 - cmp r0, 0 - beq _0809DA6C - adds r0, r5, 0 - adds r0, 0x10 - b _0809DA80 -_0809DA6C: - adds r0, r4, 0 - bl sub_80897A0 - lsls r0, 24 - cmp r0, 0 - bne _0809DA7C - movs r0, 0 - b _0809DA80 -_0809DA7C: - adds r0, r5, 0 - adds r0, 0x18 -_0809DA80: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809DA30 - - thumb_func_start sub_809DA88 -sub_809DA88: @ 809DA88 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - mov r8, r3 - lsls r1, 16 - asrs r6, r1, 16 - lsls r2, 16 - asrs r7, r2, 16 - adds r0, r6, 0 - adds r1, r7, 0 - bl MapGridGetMetatileBehaviorAt - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - bl sub_809DA30 - adds r4, r0, 0 - adds r5, r4, 0 - cmp r4, 0 - beq _0809DB06 - movs r0, 0 - ldrsb r0, [r4, r0] - adds r0, r6, r0 - movs r1, 0x1 - ldrsb r1, [r4, r1] - adds r1, r7, r1 - ldrh r2, [r4, 0x2] - bl MapGridSetMetatileIdAt - mov r0, r8 - cmp r0, 0 - beq _0809DADE - movs r0, 0 - ldrsb r0, [r4, r0] - adds r0, r6, r0 - movs r1, 0x1 - ldrsb r1, [r4, r1] - adds r1, r7, r1 - bl CurrentMapDrawMetatileAt -_0809DADE: - movs r0, 0x4 - ldrsb r0, [r5, r0] - adds r0, r6, r0 - movs r1, 0x5 - ldrsb r1, [r5, r1] - adds r1, r7, r1 - ldrh r2, [r5, 0x6] - bl MapGridSetMetatileIdAt - mov r0, r8 - cmp r0, 0 - beq _0809DB06 - movs r0, 0x4 - ldrsb r0, [r5, r0] - adds r0, r6, r0 - movs r1, 0x5 - ldrsb r1, [r5, r1] - adds r1, r7, r1 - bl CurrentMapDrawMetatileAt -_0809DB06: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_809DA88 - - thumb_func_start sub_809DB10 -sub_809DB10: @ 809DB10 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r3, r2, 0 - ldr r0, =gUnknown_08510368 - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_809DA88 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809DB10 - - thumb_func_start sub_809DB34 -sub_809DB34: @ 809DB34 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r3, r2, 0 - ldr r0, =gUnknown_08510388 - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_809DA88 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809DB34 - - thumb_func_start sub_809DB58 -sub_809DB58: @ 809DB58 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r3, r2, 0 - ldr r0, =gUnknown_085103A8 - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_809DA88 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809DB58 - - thumb_func_start sub_809DB7C -sub_809DB7C: @ 809DB7C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - mov r10, r8 - lsls r1, 16 - lsrs r7, r1, 16 - mov r9, r7 - lsls r2, 16 - asrs r6, r2, 16 - lsls r3, 16 - asrs r5, r3, 16 - adds r0, r6, 0 - adds r1, r5, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_8089764 - lsls r0, 24 - cmp r0, 0 - beq _0809DBC0 - lsls r0, r7, 16 - asrs r0, 16 - cmp r0, r5 - ble _0809DC06 -_0809DBBC: - movs r0, 0 - b _0809DC08 -_0809DBC0: - adds r0, r4, 0 - bl sub_8089778 - lsls r0, 24 - cmp r0, 0 - beq _0809DBD8 - mov r1, r9 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, r5 - bge _0809DC06 - b _0809DBBC -_0809DBD8: - adds r0, r4, 0 - bl sub_808978C - lsls r0, 24 - cmp r0, 0 - beq _0809DBF0 - mov r1, r8 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, r6 - ble _0809DC06 - b _0809DBBC -_0809DBF0: - adds r0, r4, 0 - bl sub_80897A0 - lsls r0, 24 - cmp r0, 0 - beq _0809DC06 - mov r1, r10 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, r6 - blt _0809DBBC -_0809DC06: - movs r0, 0x1 -_0809DC08: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_809DB7C - - thumb_func_start sub_809DC18 -sub_809DC18: @ 809DC18 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r2, 16 - lsrs r2, 16 - mov r8, r2 - mov r10, r8 - lsls r3, 16 - lsrs r7, r3, 16 - mov r9, r7 - lsls r0, 16 - asrs r6, r0, 16 - lsls r1, 16 - asrs r5, r1, 16 - adds r0, r6, 0 - adds r1, r5, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_8089764 - lsls r0, 24 - cmp r0, 0 - beq _0809DC5C - lsls r0, r7, 16 - asrs r0, 16 - cmp r5, r0 - bge _0809DCA2 -_0809DC58: - movs r0, 0 - b _0809DCA4 -_0809DC5C: - adds r0, r4, 0 - bl sub_8089778 - lsls r0, 24 - cmp r0, 0 - beq _0809DC74 - mov r1, r9 - lsls r0, r1, 16 - asrs r0, 16 - cmp r5, r0 - ble _0809DCA2 - b _0809DC58 -_0809DC74: - adds r0, r4, 0 - bl sub_808978C - lsls r0, 24 - cmp r0, 0 - beq _0809DC8C - mov r1, r8 - lsls r0, r1, 16 - asrs r0, 16 - cmp r6, r0 - bge _0809DCA2 - b _0809DC58 -_0809DC8C: - adds r0, r4, 0 - bl sub_80897A0 - lsls r0, 24 - cmp r0, 0 - beq _0809DCA2 - mov r1, r10 - lsls r0, r1, 16 - asrs r0, 16 - cmp r6, r0 - bgt _0809DC58 -_0809DCA2: - movs r0, 0x1 -_0809DCA4: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_809DC18 - - thumb_func_start sub_809DCB4 -sub_809DCB4: @ 809DCB4 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r4, r1, r0 - mov r5, sp - adds r5, 0x2 - mov r0, sp - adds r1, r5, 0 - bl PlayerGetDestCoords - movs r1, 0x2 - ldrsh r0, [r4, r1] - adds r6, r5, 0 - cmp r0, 0x1 - beq _0809DD0E - cmp r0, 0x1 - bgt _0809DCEC - cmp r0, 0 - beq _0809DCF2 - b _0809DE1E - .pool -_0809DCEC: - cmp r0, 0x2 - beq _0809DDDC - b _0809DE1E -_0809DCF2: - mov r0, sp - ldrh r0, [r0] - strh r0, [r4, 0x4] - ldrh r0, [r5] - strh r0, [r4, 0x6] - mov r0, sp - movs r2, 0 - ldrsh r0, [r0, r2] - movs r3, 0 - ldrsh r1, [r5, r3] - movs r2, 0x1 - bl sub_809DB34 - b _0809DE1A -_0809DD0E: - mov r0, sp - movs r7, 0 - ldrsh r1, [r0, r7] - movs r2, 0x4 - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _0809DD28 - movs r3, 0 - ldrsh r1, [r5, r3] - movs r7, 0x6 - ldrsh r0, [r4, r7] - cmp r1, r0 - beq _0809DE1E -_0809DD28: - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r5, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - movs r5, 0x6 - ldrsh r3, [r4, r5] - bl sub_809DB7C - cmp r0, 0 - beq _0809DD70 - movs r7, 0x4 - ldrsh r0, [r4, r7] - movs r2, 0x6 - ldrsh r1, [r4, r2] - movs r2, 0x1 - bl sub_809DB10 - movs r3, 0x4 - ldrsh r0, [r4, r3] - movs r5, 0x6 - ldrsh r1, [r4, r5] - movs r2, 0 - bl sub_809DB58 - ldrh r0, [r4, 0x4] - strh r0, [r4, 0x8] - ldrh r0, [r4, 0x6] - strh r0, [r4, 0xA] - movs r0, 0x2 - strh r0, [r4, 0x2] - movs r0, 0x8 - strh r0, [r4, 0xC] - b _0809DD7A -_0809DD70: - movs r7, 0x1 - negs r7, r7 - adds r0, r7, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0xA] -_0809DD7A: - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - adds r5, r6, 0 - movs r2, 0 - ldrsh r1, [r5, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - movs r7, 0x6 - ldrsh r3, [r4, r7] - bl sub_809DC18 - cmp r0, 0 - beq _0809DDAE - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r5, r2] - movs r2, 0x1 - bl sub_809DB10 - movs r0, 0x2 - strh r0, [r4, 0x2] - movs r0, 0x8 - strh r0, [r4, 0xC] -_0809DDAE: - mov r0, sp - ldrh r0, [r0] - strh r0, [r4, 0x4] - ldrh r0, [r6] - strh r0, [r4, 0x6] - mov r0, sp - movs r3, 0 - ldrsh r0, [r0, r3] - movs r5, 0 - ldrsh r1, [r6, r5] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsPacifidlogLog - lsls r0, 24 - cmp r0, 0 - beq _0809DE1E - movs r0, 0x46 - bl audio_play - b _0809DE1E -_0809DDDC: - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _0809DE1E - mov r0, sp - movs r7, 0 - ldrsh r0, [r0, r7] - movs r2, 0 - ldrsh r1, [r5, r2] - movs r2, 0x1 - bl sub_809DB34 - movs r3, 0x8 - ldrsh r0, [r4, r3] - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _0809DE1A - movs r5, 0xA - ldrsh r0, [r4, r5] - cmp r0, r1 - beq _0809DE1A - movs r7, 0x8 - ldrsh r0, [r4, r7] - movs r2, 0xA - ldrsh r1, [r4, r2] - movs r2, 0x1 - bl sub_809DB58 -_0809DE1A: - movs r0, 0x1 - strh r0, [r4, 0x2] -_0809DE1E: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_809DCB4 - - thumb_func_start sub_809DE28 -sub_809DE28: @ 809DE28 - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 16 - lsrs r5, r1, 16 - bl PlayerGetZCoord - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0809DE82 - lsls r0, r4, 16 - asrs r4, r0, 16 - lsls r0, r5, 16 - asrs r5, r0, 16 - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridGetMetatileIdAt - adds r1, r0, 0 - ldr r0, =0x0000024e - cmp r1, r0 - beq _0809DE68 - adds r0, 0x8 - cmp r1, r0 - beq _0809DE78 - b _0809DE82 - .pool -_0809DE68: - ldr r2, =0x0000024f - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridSetMetatileIdAt - b _0809DE82 - .pool -_0809DE78: - ldr r2, =0x00000257 - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridSetMetatileIdAt -_0809DE82: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809DE28 - - thumb_func_start sub_809DE8C -sub_809DE8C: @ 809DE8C - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 16 - lsrs r5, r1, 16 - bl PlayerGetZCoord - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0809DEE6 - lsls r0, r4, 16 - asrs r4, r0, 16 - lsls r0, r5, 16 - asrs r5, r0, 16 - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridGetMetatileIdAt - adds r1, r0, 0 - ldr r0, =0x0000024f - cmp r1, r0 - beq _0809DECC - adds r0, 0x8 - cmp r1, r0 - beq _0809DEDC - b _0809DEE6 - .pool -_0809DECC: - ldr r2, =0x0000024e - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridSetMetatileIdAt - b _0809DEE6 - .pool -_0809DEDC: - ldr r2, =0x00000256 - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridSetMetatileIdAt -_0809DEE6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809DE8C - - thumb_func_start sub_809DEF0 -sub_809DEF0: @ 809DEF0 - 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 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r6, r1, r0 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - movs r0, 0x2 - ldrsh r5, [r6, r0] - mov r9, r4 - cmp r5, 0x1 - beq _0809DF84 - cmp r5, 0x1 - bgt _0809DF30 - cmp r5, 0 - beq _0809DF38 - b _0809E0F6 - .pool -_0809DF30: - cmp r5, 0x2 - bne _0809DF36 - b _0809E064 -_0809DF36: - b _0809E0F6 -_0809DF38: - mov r0, sp - ldrh r0, [r0] - strh r0, [r6, 0x4] - mov r1, r9 - ldrh r0, [r1] - strh r0, [r6, 0x6] - mov r0, sp - movs r2, 0 - ldrsh r0, [r0, r2] - movs r3, 0 - ldrsh r1, [r1, r3] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsFortreeBridge - lsls r0, 24 - cmp r0, 0 - bne _0809DF62 - b _0809E0F2 -_0809DF62: - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - mov r2, r9 - movs r3, 0 - ldrsh r1, [r2, r3] - bl sub_809DE28 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - mov r2, r9 - movs r3, 0 - ldrsh r1, [r2, r3] - bl CurrentMapDrawMetatileAt - b _0809E0F2 -_0809DF84: - ldrh r0, [r6, 0x6] - mov r8, r0 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - ldrh r2, [r6, 0x4] - mov r10, r2 - movs r3, 0x4 - ldrsh r7, [r6, r3] - cmp r0, r7 - bne _0809DFAC - mov r0, r9 - movs r2, 0 - ldrsh r1, [r0, r2] - mov r3, r8 - lsls r0, r3, 16 - asrs r0, 16 - cmp r1, r0 - bne _0809DFAC - b _0809E0F6 -_0809DFAC: - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - mov r2, r9 - movs r3, 0 - ldrsh r1, [r2, r3] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsFortreeBridge - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - mov r0, r8 - lsls r4, r0, 16 - asrs r1, r4, 16 - adds r0, r7, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsFortreeBridge - lsls r0, 24 - lsrs r7, r0, 24 - bl PlayerGetZCoord - movs r1, 0 - ands r5, r0 - lsls r0, r5, 24 - adds r5, r4, 0 - cmp r0, 0 - bne _0809DFF4 - movs r1, 0x1 -_0809DFF4: - cmp r1, 0 - beq _0809E008 - ldr r1, [sp, 0x4] - cmp r1, 0x1 - beq _0809E002 - cmp r7, 0x1 - bne _0809E008 -_0809E002: - movs r0, 0x47 - bl audio_play -_0809E008: - cmp r7, 0 - beq _0809E044 - mov r2, r10 - lsls r4, r2, 16 - asrs r4, 16 - asrs r5, 16 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_809DE8C - adds r0, r4, 0 - adds r1, r5, 0 - bl CurrentMapDrawMetatileAt - mov r0, sp - movs r3, 0 - ldrsh r0, [r0, r3] - mov r2, r9 - movs r3, 0 - ldrsh r1, [r2, r3] - bl sub_809DE28 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - mov r2, r9 - movs r3, 0 - ldrsh r1, [r2, r3] - bl CurrentMapDrawMetatileAt -_0809E044: - mov r0, r10 - strh r0, [r6, 0x8] - mov r1, r8 - strh r1, [r6, 0xA] - mov r0, sp - ldrh r0, [r0] - strh r0, [r6, 0x4] - mov r2, r9 - ldrh r0, [r2] - strh r0, [r6, 0x6] - cmp r7, 0 - beq _0809E0F6 - movs r0, 0x10 - strh r0, [r6, 0xC] - movs r0, 0x2 - strh r0, [r6, 0x2] -_0809E064: - ldrh r0, [r6, 0xC] - subs r0, 0x1 - strh r0, [r6, 0xC] - ldrh r3, [r6, 0x8] - mov r10, r3 - ldrh r0, [r6, 0xA] - mov r8, r0 - movs r1, 0xC - ldrsh r0, [r6, r1] - movs r1, 0x7 - bl __modsi3 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - bhi _0809E0EA - lsls r0, 2 - ldr r1, =_0809E094 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0809E094: - .4byte _0809E0B4 - .4byte _0809E0EA - .4byte _0809E0EA - .4byte _0809E0EA - .4byte _0809E0C6 - .4byte _0809E0EA - .4byte _0809E0EA - .4byte _0809E0EA -_0809E0B4: - mov r2, r10 - lsls r0, r2, 16 - asrs r0, 16 - mov r3, r8 - lsls r1, r3, 16 - asrs r1, 16 - bl CurrentMapDrawMetatileAt - b _0809E0EA -_0809E0C6: - mov r0, r10 - lsls r5, r0, 16 - asrs r5, 16 - mov r1, r8 - lsls r4, r1, 16 - asrs r4, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_809DE28 - adds r0, r5, 0 - adds r1, r4, 0 - bl CurrentMapDrawMetatileAt - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_809DE8C -_0809E0EA: - movs r2, 0xC - ldrsh r0, [r6, r2] - cmp r0, 0 - bne _0809E0F6 -_0809E0F2: - movs r0, 0x1 - strh r0, [r6, 0x2] -_0809E0F6: - 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 sub_809DEF0 - - thumb_func_start sub_809E108 -sub_809E108: @ 809E108 - push {lr} - lsls r1, 16 - lsrs r1, 16 - lsls r0, 16 - ldr r2, =0xfffd0000 - adds r0, r2 - lsrs r0, 16 - cmp r0, 0xA - bhi _0809E144 - lsls r0, r1, 16 - asrs r1, r0, 16 - ldr r2, =0xfffa0000 - adds r0, r2 - lsrs r0, 16 - cmp r0, 0xD - bhi _0809E144 - ldr r0, =gUnknown_085103C8 - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _0809E144 - movs r0, 0x1 - b _0809E146 - .pool -_0809E144: - movs r0, 0 -_0809E146: - pop {r1} - bx r1 - thumb_func_end sub_809E108 - - thumb_func_start sub_809E14C -sub_809E14C: @ 809E14C - push {r4,r5,lr} - lsls r0, 16 - asrs r5, r0, 16 - lsls r1, 16 - asrs r4, r1, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_809E108 - cmp r0, 0 - beq _0809E17A - ldr r1, =gUnknown_085103C8 - lsls r0, r4, 1 - adds r0, r1 - ldrh r0, [r0] - bl GetVarPointer - subs r2, r5, 0x3 - movs r1, 0x1 - lsls r1, r2 - ldrh r2, [r0] - orrs r1, r2 - strh r1, [r0] -_0809E17A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E14C - - thumb_func_start sub_809E184 -sub_809E184: @ 809E184 - push {r4,r5,lr} - lsls r0, 16 - asrs r5, r0, 16 - lsls r1, 16 - asrs r4, r1, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_809E108 - cmp r0, 0 - beq _0809E1B6 - ldr r1, =gUnknown_085103C8 - lsls r0, r4, 1 - adds r0, r1 - ldrh r0, [r0] - bl VarGet - lsls r0, 16 - subs r2, r5, 0x3 - movs r1, 0x80 - lsls r1, 9 - lsls r1, r2 - ands r1, r0 - cmp r1, 0 - bne _0809E1C0 -_0809E1B6: - movs r0, 0 - b _0809E1C2 - .pool -_0809E1C0: - movs r0, 0x1 -_0809E1C2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809E184 - - thumb_func_start sub_809E1C8 -sub_809E1C8: @ 809E1C8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =0x02037318 - ldr r0, [r0] - ldr r1, [r0] - mov r9, r1 - ldr r7, [r0, 0x4] - movs r5, 0 - cmp r5, r9 - bge _0809E210 -_0809E1E0: - movs r4, 0 - adds r0, r5, 0x1 - mov r8, r0 - cmp r4, r7 - bge _0809E20A - lsls r6, r5, 16 -_0809E1EC: - lsls r1, r4, 16 - asrs r1, 16 - asrs r0, r6, 16 - bl sub_809E184 - cmp r0, 0x1 - bne _0809E204 - adds r1, r4, 0x7 - adds r0, r5, 0x7 - ldr r2, =0x0000020e - bl MapGridSetMetatileIdAt -_0809E204: - adds r4, 0x1 - cmp r4, r7 - blt _0809E1EC -_0809E20A: - mov r5, r8 - cmp r5, r9 - blt _0809E1E0 -_0809E210: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E1C8 - - thumb_func_start sub_809E224 -sub_809E224: @ 809E224 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r5, r1, r0 - movs r1, 0x2 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _0809E270 - cmp r0, 0x1 - bgt _0809E24C - cmp r0, 0 - beq _0809E258 - b _0809E3A6 - .pool -_0809E24C: - cmp r0, 0x2 - beq _0809E306 - cmp r0, 0x3 - bne _0809E256 - b _0809E360 -_0809E256: - b _0809E3A6 -_0809E258: - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - ldrh r0, [r0] - strh r0, [r5, 0x4] - ldrh r0, [r4] - strh r0, [r5, 0x6] - b _0809E3A2 -_0809E270: - mov r7, sp - adds r7, 0x2 - mov r0, sp - adds r1, r7, 0 - bl PlayerGetDestCoords - mov r0, sp - ldrh r2, [r0] - movs r3, 0 - ldrsh r1, [r0, r3] - movs r3, 0x4 - ldrsh r0, [r5, r3] - cmp r1, r0 - bne _0809E29A - movs r0, 0 - ldrsh r1, [r7, r0] - movs r3, 0x6 - ldrsh r0, [r5, r3] - cmp r1, r0 - bne _0809E29A - b _0809E3A6 -_0809E29A: - strh r2, [r5, 0x4] - ldrh r0, [r7] - strh r0, [r5, 0x6] - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r7, r2] - bl MapGridGetMetatileBehaviorAt - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =0x00004022 - bl GetVarPointer - adds r6, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_8089604 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809E2E0 - ldrh r0, [r6] - adds r0, 0x1 - strh r0, [r6] - movs r0, 0x4 - strh r0, [r5, 0xC] - movs r0, 0x2 - b _0809E2F8 - .pool -_0809E2E0: - adds r0, r4, 0 - bl sub_8089618 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809E3A6 - movs r0, 0 - strh r0, [r6] - movs r0, 0x4 - strh r0, [r5, 0xC] - movs r0, 0x3 -_0809E2F8: - strh r0, [r5, 0x2] - mov r0, sp - ldrh r0, [r0] - strh r0, [r5, 0x8] - ldrh r0, [r7] - strh r0, [r5, 0xA] - b _0809E3A6 -_0809E306: - ldrh r1, [r5, 0xC] - movs r3, 0xC - ldrsh r0, [r5, r3] - cmp r0, 0 - bne _0809E36A - mov r1, sp - ldrh r0, [r5, 0x8] - strh r0, [r1] - mov r4, sp - adds r4, 0x2 - ldrh r0, [r5, 0xA] - strh r0, [r4] - movs r0, 0x2A - bl audio_play - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - ldr r2, =0x0000020e - bl MapGridSetMetatileIdAt - mov r0, sp - movs r3, 0 - ldrsh r0, [r0, r3] - movs r2, 0 - ldrsh r1, [r4, r2] - bl CurrentMapDrawMetatileAt - mov r0, sp - ldrh r0, [r0] - subs r0, 0x7 - lsls r0, 16 - asrs r0, 16 - ldrh r1, [r4] - subs r1, 0x7 - lsls r1, 16 - asrs r1, 16 - bl sub_809E14C - b _0809E3A2 - .pool -_0809E360: - ldrh r1, [r5, 0xC] - movs r3, 0xC - ldrsh r0, [r5, r3] - cmp r0, 0 - beq _0809E370 -_0809E36A: - subs r0, r1, 0x1 - strh r0, [r5, 0xC] - b _0809E3A6 -_0809E370: - mov r1, sp - ldrh r0, [r5, 0x8] - strh r0, [r1] - mov r4, sp - adds r4, 0x2 - ldrh r0, [r5, 0xA] - strh r0, [r4] - movs r0, 0x29 - bl audio_play - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - ldr r2, =0x00000206 - bl MapGridSetMetatileIdAt - mov r0, sp - movs r3, 0 - ldrsh r0, [r0, r3] - movs r2, 0 - ldrsh r1, [r4, r2] - bl CurrentMapDrawMetatileAt -_0809E3A2: - movs r0, 0x1 - strh r0, [r5, 0x2] -_0809E3A6: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E224 - - thumb_func_start sub_809E3B4 -sub_809E3B4: @ 809E3B4 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r5, r1, r0 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - ldrh r2, [r0] - movs r3, 0 - ldrsh r1, [r0, r3] - movs r3, 0x2 - ldrsh r0, [r5, r3] - cmp r1, r0 - bne _0809E3EE - movs r0, 0 - ldrsh r1, [r4, r0] - movs r3, 0x4 - ldrsh r0, [r5, r3] - cmp r1, r0 - beq _0809E47A -_0809E3EE: - strh r2, [r5, 0x2] - ldrh r0, [r4] - strh r0, [r5, 0x4] - 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_IsAsh - lsls r0, 24 - cmp r0, 0 - beq _0809E47A - mov r0, sp - movs r3, 0 - ldrsh r0, [r0, r3] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileIdAt - ldr r1, =0x0000020a - cmp r0, r1 - bne _0809E444 - mov r0, sp - movs r3, 0 - ldrsh r0, [r0, r3] - movs r2, 0 - ldrsh r1, [r4, r2] - ldr r2, =0x00000212 - movs r3, 0x4 - bl ash - b _0809E456 - .pool -_0809E444: - mov r0, sp - movs r3, 0 - ldrsh r0, [r0, r3] - movs r2, 0 - ldrsh r1, [r4, r2] - ldr r2, =0x00000206 - movs r3, 0x4 - bl ash -_0809E456: - movs r0, 0x87 - lsls r0, 1 - movs r1, 0x1 - bl sub_80D6724 - lsls r0, 24 - cmp r0, 0 - beq _0809E47A - ldr r0, =0x00004048 - bl GetVarPointer - adds r2, r0, 0 - ldrh r1, [r2] - ldr r0, =0x0000270e - cmp r1, r0 - bhi _0809E47A - adds r0, r1, 0x1 - strh r0, [r2] -_0809E47A: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E3B4 - - thumb_func_start sub_809E490 -sub_809E490: @ 809E490 - push {r4,r5,lr} - lsls r0, 16 - asrs r5, r0, 16 - lsls r1, 16 - asrs r4, r1, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - ldr r1, =0x0000022f - ldr r2, =0x00000237 - cmp r0, r1 - bne _0809E4AC - subs r2, 0x31 -_0809E4AC: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt - adds r0, r5, 0 - adds r1, r4, 0 - bl CurrentMapDrawMetatileAt - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E490 - - thumb_func_start sub_809E4CC -sub_809E4CC: @ 809E4CC - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r5, r1, r0 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 16 - lsrs r6, r0, 16 - ldrh r1, [r5, 0x8] - movs r3, 0x8 - ldrsh r0, [r5, r3] - adds r7, r4, 0 - cmp r0, 0 - beq _0809E51E - subs r0, r1, 0x1 - strh r0, [r5, 0x8] - lsls r0, 16 - cmp r0, 0 - bne _0809E51E - movs r1, 0xA - ldrsh r0, [r5, r1] - movs r2, 0xC - ldrsh r1, [r5, r2] - bl sub_809E490 -_0809E51E: - ldrh r1, [r5, 0xE] - movs r3, 0xE - ldrsh r0, [r5, r3] - cmp r0, 0 - beq _0809E53E - subs r0, r1, 0x1 - strh r0, [r5, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _0809E53E - movs r1, 0x10 - ldrsh r0, [r5, r1] - movs r2, 0x12 - ldrsh r1, [r5, r2] - bl sub_809E490 -_0809E53E: - lsls r0, r6, 24 - lsrs r6, r0, 24 - adds r0, r6, 0 - bl sub_8089918 - lsls r0, 24 - cmp r0, 0 - beq _0809E556 - ldr r0, =0x00004022 - movs r1, 0 - bl VarSet -_0809E556: - mov r0, sp - ldrh r2, [r0] - movs r3, 0 - ldrsh r1, [r0, r3] - movs r3, 0x4 - ldrsh r0, [r5, r3] - cmp r1, r0 - bne _0809E572 - movs r0, 0 - ldrsh r1, [r7, r0] - movs r3, 0x6 - ldrsh r0, [r5, r3] - cmp r1, r0 - beq _0809E5D2 -_0809E572: - strh r2, [r5, 0x4] - adds r4, r7, 0 - ldrh r0, [r4] - strh r0, [r5, 0x6] - adds r0, r6, 0 - bl sub_808992C - lsls r0, 24 - cmp r0, 0 - beq _0809E5D2 - bl sub_811A138 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - beq _0809E59A - ldr r0, =0x00004022 - movs r1, 0 - bl VarSet -_0809E59A: - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0809E5BC - movs r0, 0x3 - strh r0, [r5, 0x8] - mov r0, sp - ldrh r0, [r0] - strh r0, [r5, 0xA] - ldrh r0, [r4] - strh r0, [r5, 0xC] - b _0809E5D2 - .pool -_0809E5BC: - movs r2, 0xE - ldrsh r0, [r5, r2] - cmp r0, 0 - bne _0809E5D2 - movs r0, 0x3 - strh r0, [r5, 0xE] - mov r0, sp - ldrh r0, [r0] - strh r0, [r5, 0x10] - ldrh r0, [r7] - strh r0, [r5, 0x12] -_0809E5D2: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_809E4CC - - thumb_func_start sub_809E5DC -sub_809E5DC: @ 809E5DC - push {r4,r5,lr} - adds r3, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - lsls r2, 16 - lsrs r4, r2, 16 - ldrh r0, [r3] - subs r0, 0x1 - strh r0, [r3] - lsls r0, 16 - cmp r0, 0 - bne _0809E5F8 - movs r2, 0xE8 - b _0809E60C -_0809E5F8: - ldr r1, =gUnknown_085103FC - movs r2, 0 - ldrsh r0, [r3, r2] - cmp r0, 0 - bge _0809E604 - adds r0, 0x7 -_0809E604: - asrs r0, 3 - lsls r0, 1 - adds r0, r1 - ldrh r2, [r0] -_0809E60C: - lsls r5, 16 - asrs r5, 16 - lsls r4, 16 - asrs r4, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt - adds r0, r5, 0 - adds r1, r4, 0 - bl CurrentMapDrawMetatileAt - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0xE8 - bl MapGridSetMetatileIdAt - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E5DC - - thumb_func_start sub_809E638 -sub_809E638: @ 809E638 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r4, r1, r0 - mov r5, sp - adds r5, 0x2 - mov r0, sp - adds r1, r5, 0 - bl PlayerGetDestCoords - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x4 - ldrsb r1, [r0, r1] - lsls r1, 8 - ldrb r0, [r0, 0x5] - lsls r0, 24 - asrs r0, 24 - orrs r0, r1 - lsls r0, 16 - lsrs r7, r0, 16 - movs r0, 0x2 - ldrsh r1, [r4, r0] - mov r8, r5 - cmp r1, 0 - beq _0809E688 - cmp r1, 0x1 - beq _0809E6B4 - b _0809E708 - .pool -_0809E688: - strh r7, [r4] - mov r0, sp - ldrh r0, [r0] - strh r0, [r4, 0x4] - ldrh r0, [r5] - strh r0, [r4, 0x6] - movs r0, 0x1 - strh r0, [r4, 0x2] - strh r1, [r4, 0x8] - strh r1, [r4, 0xE] - strh r1, [r4, 0x14] - strh r1, [r4, 0x1A] - b _0809E708 -_0809E6A2: - movs r0, 0x20 - strh r0, [r1] - mov r0, sp - ldrh r0, [r0] - strh r0, [r1, 0x2] - mov r2, r8 - ldrh r0, [r2] - strh r0, [r1, 0x4] - b _0809E708 -_0809E6B4: - mov r0, sp - movs r3, 0x4 - ldrsh r1, [r4, r3] - ldrh r2, [r0] - movs r3, 0 - ldrsh r0, [r0, r3] - cmp r1, r0 - bne _0809E6D0 - movs r0, 0x6 - ldrsh r1, [r4, r0] - movs r3, 0 - ldrsh r0, [r5, r3] - cmp r1, r0 - beq _0809E708 -_0809E6D0: - strh r2, [r4, 0x4] - ldrh r0, [r5] - strh r0, [r4, 0x6] - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsMuddySlope - lsls r0, 24 - cmp r0, 0 - beq _0809E708 - movs r6, 0x4 - adds r1, r4, 0 - adds r1, 0x8 -_0809E6F8: - movs r3, 0 - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _0809E6A2 - adds r1, 0x6 - adds r6, 0x3 - cmp r6, 0xD - ble _0809E6F8 -_0809E708: - ldr r2, =0x02037334 - ldrb r1, [r2] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0809E728 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r7, r0 - beq _0809E728 - strh r7, [r4] - ldrh r0, [r2, 0x4] - ldrh r1, [r2, 0x8] - b _0809E72C - .pool -_0809E728: - movs r0, 0 - movs r1, 0 -_0809E72C: - lsls r0, 16 - asrs r0, 16 - mov r8, r0 - lsls r0, r1, 16 - asrs r7, r0, 16 - adds r5, r4, 0 - adds r5, 0x8 - adds r4, r5, 0 - movs r6, 0x9 -_0809E73E: - movs r2, 0 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0809E762 - ldrh r0, [r4, 0x2] - mov r3, r8 - subs r0, r3 - strh r0, [r4, 0x2] - ldrh r0, [r4, 0x4] - subs r0, r7 - strh r0, [r4, 0x4] - movs r0, 0x2 - ldrsh r1, [r4, r0] - movs r3, 0x4 - ldrsh r2, [r4, r3] - adds r0, r5, 0 - bl sub_809E5DC -_0809E762: - adds r4, 0x6 - adds r5, 0x6 - subs r6, 0x3 - cmp r6, 0 - bge _0809E73E - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_809E638 - - thumb_func_start sub_809E778 -sub_809E778: @ 809E778 - push {lr} - ldr r0, =0x00000895 - bl FlagSet - bl GameFreakRTC_CalcLocalDateTime - ldr r0, =0x03005d90 - ldr r2, [r0] - adds r2, 0xA0 - ldr r3, =0x03005cf8 - ldr r0, [r3] - ldr r1, [r3, 0x4] - str r0, [r2] - str r1, [r2, 0x4] - ldr r0, =0x00004040 - ldrh r1, [r3] - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E778 - - thumb_func_start sub_809E7B0 -sub_809E7B0: @ 809E7B0 - push {r4,lr} - ldr r0, =0x00000895 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0809E7DA - bl sub_813B9C0 - lsls r0, 24 - cmp r0, 0 - bne _0809E7DA - bl GameFreakRTC_CalcLocalDateTime - ldr r4, =0x03005cf8 - adds r0, r4, 0 - bl sub_809E7E8 - adds r0, r4, 0 - bl sub_809E858 -_0809E7DA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E7B0 - - thumb_func_start sub_809E7E8 -sub_809E7E8: @ 809E7E8 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r0, =0x00004040 - bl GetVarPointer - adds r6, r0, 0 - ldrh r0, [r6] - movs r2, 0 - ldrsh r1, [r5, r2] - cmp r0, r1 - beq _0809E84E - cmp r0, r1 - bgt _0809E84E - ldrh r4, [r5] - subs r4, r0 - lsls r4, 16 - lsrs r4, 16 - bl sub_809D3A0 - adds r0, r4, 0 - bl sub_8122580 - adds r0, r4, 0 - bl sub_80ED888 - adds r0, r4, 0 - bl sub_80AEFBC - adds r0, r4, 0 - bl sub_806DE44 - adds r0, r4, 0 - bl sub_8137904 - adds r0, r4, 0 - bl sub_8137A20 - adds r0, r4, 0 - bl sub_8139EF4 - adds r0, r4, 0 - bl sub_813A7F4 - adds r0, r4, 0 - bl sub_813945C - adds r0, r4, 0 - bl sub_8177584 - ldrh r0, [r5] - strh r0, [r6] -_0809E84E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E7E8 - - thumb_func_start sub_809E858 -sub_809E858: @ 809E858 - push {r4-r6,lr} - sub sp, 0x8 - adds r5, r0, 0 - mov r4, sp - ldr r6, =0x03005d90 - ldr r1, [r6] - adds r1, 0xA0 - mov r0, sp - adds r2, r5, 0 - bl GameFreakRTC_GetDelta - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - lsls r0, r1, 1 - adds r0, r1 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 5 - movs r2, 0x2 - ldrsb r2, [r4, r2] - lsls r0, r2, 4 - subs r0, r2 - lsls r0, 2 - adds r1, r0 - movs r0, 0x3 - ldrsb r0, [r4, r0] - adds r0, r1, r0 - cmp r0, 0 - beq _0809E8A8 - cmp r0, 0 - blt _0809E8A8 - bl BerryTreeTimeUpdate - ldr r2, [r6] - adds r2, 0xA0 - ldr r0, [r5] - ldr r1, [r5, 0x4] - str r0, [r2] - str r1, [r2, 0x4] -_0809E8A8: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E858 - - thumb_func_start sub_809E8B4 -sub_809E8B4: @ 809E8B4 - push {lr} - bl sub_809E778 - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_809E8B4 - - thumb_func_start Special_StartWallClock -Special_StartWallClock: @ 809E8C8 - push {lr} - ldr r0, =Cb2_StartWallClock - bl SetMainCallback2 - ldr r1, =0x030022c0 - ldr r0, =sub_809E8B4 - str r0, [r1, 0x8] - pop {r0} - bx r0 - .pool - thumb_func_end Special_StartWallClock - - thumb_func_start sub_809E8E8 -sub_809E8E8: @ 809E8E8 - push {lr} - adds r3, r0, 0 - ldr r2, =0x03005e00 - movs r0, 0x2E - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0xC - ldrsh r1, [r0, r2] - movs r2, 0x30 - ldrsh r0, [r3, r2] - cmp r1, r0 - beq _0809E9FE - strh r1, [r3, 0x30] - subs r0, r1, 0x1 - cmp r0, 0x5 - bhi _0809E9FE - lsls r0, 2 - ldr r1, =_0809E920 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0809E920: - .4byte _0809E938 - .4byte _0809E95C - .4byte _0809E980 - .4byte _0809E9A4 - .4byte _0809E9CE - .4byte _0809E9F8 -_0809E938: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r1, r3, 0 - adds r1, 0x2A - movs r0, 0x1 - strb r0, [r1] - subs r2, 0x12 - ldrb r1, [r2] - subs r0, 0x41 - ands r0, r1 - strb r0, [r2] - movs r0, 0x35 - b _0809E9C6 -_0809E95C: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r1, r3, 0 - adds r1, 0x2A - movs r0, 0x1 - strb r0, [r1] - subs r2, 0x12 - ldrb r1, [r2] - subs r0, 0x41 - ands r0, r1 - strb r0, [r2] - movs r0, 0x56 - b _0809E9C6 -_0809E980: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r1, r3, 0 - adds r1, 0x2A - movs r0, 0x1 - strb r0, [r1] - subs r2, 0x12 - ldrb r1, [r2] - subs r0, 0x41 - ands r0, r1 - strb r0, [r2] - movs r0, 0x65 - b _0809E9C6 -_0809E9A4: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r1, r3, 0 - adds r1, 0x2A - movs r0, 0x1 - strb r0, [r1] - subs r2, 0x12 - ldrb r1, [r2] - subs r0, 0x41 - ands r0, r1 - strb r0, [r2] - movs r0, 0x74 -_0809E9C6: - strh r0, [r3, 0x20] - movs r0, 0x44 - strh r0, [r3, 0x22] - b _0809E9FE -_0809E9CE: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r1, r3, 0 - adds r1, 0x2A - movs r0, 0x2 - strb r0, [r1] - subs r2, 0x12 - ldrb r1, [r2] - subs r0, 0x42 - ands r0, r1 - strb r0, [r2] - movs r0, 0x99 - strh r0, [r3, 0x20] - movs r0, 0x50 - strh r0, [r3, 0x22] - b _0809E9FE -_0809E9F8: - adds r0, r3, 0 - bl RemoveObjectAndFreeTiles -_0809E9FE: - pop {r0} - bx r0 - thumb_func_end sub_809E8E8 - - thumb_func_start sub_809EA04 -sub_809EA04: @ 809EA04 - push {lr} - adds r3, r0, 0 - ldr r2, =0x03005e00 - movs r0, 0x2E - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0xC - ldrsh r1, [r0, r2] - movs r2, 0x30 - ldrsh r0, [r3, r2] - cmp r1, r0 - beq _0809EAFE - strh r1, [r3, 0x30] - subs r0, r1, 0x1 - cmp r0, 0x5 - bhi _0809EAFE - lsls r0, 2 - ldr r1, =_0809EA3C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0809EA3C: - .4byte _0809EA54 - .4byte _0809EA78 - .4byte _0809EA9C - .4byte _0809EAC0 - .4byte _0809EAEA - .4byte _0809EAF8 -_0809EA54: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r1, r3, 0 - adds r1, 0x2A - movs r0, 0 - strb r0, [r1] - subs r2, 0x12 - ldrb r1, [r2] - subs r0, 0x40 - ands r0, r1 - strb r0, [r2] - movs r0, 0x35 - b _0809EAE2 -_0809EA78: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r1, r3, 0 - adds r1, 0x2A - movs r0, 0 - strb r0, [r1] - subs r2, 0x12 - ldrb r1, [r2] - subs r0, 0x40 - ands r0, r1 - strb r0, [r2] - movs r0, 0x56 - b _0809EAE2 -_0809EA9C: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r1, r3, 0 - adds r1, 0x2A - movs r0, 0 - strb r0, [r1] - subs r2, 0x12 - ldrb r1, [r2] - subs r0, 0x40 - ands r0, r1 - strb r0, [r2] - movs r0, 0x65 - b _0809EAE2 -_0809EAC0: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r1, r3, 0 - adds r1, 0x2A - movs r0, 0 - strb r0, [r1] - subs r2, 0x12 - ldrb r1, [r2] - subs r0, 0x40 - ands r0, r1 - strb r0, [r2] - movs r0, 0x74 -_0809EAE2: - strh r0, [r3, 0x20] - movs r0, 0x5C - strh r0, [r3, 0x22] - b _0809EAFE -_0809EAEA: - adds r0, r3, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - b _0809EAFE -_0809EAF8: - adds r0, r3, 0 - bl RemoveObjectAndFreeTiles -_0809EAFE: - pop {r0} - bx r0 - thumb_func_end sub_809EA04 - - thumb_func_start sub_809EB04 -sub_809EB04: @ 809EB04 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_085104C4 - bl LoadTaggedObjectPalette - ldr r0, =gUnknown_085104F0 - mov r8, r0 - movs r1, 0x35 - movs r2, 0x44 - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r1, r0, 24 - ldr r6, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r6, 0 - adds r4, 0x1C - adds r2, r0, r4 - ldr r1, =sub_809E8E8 - str r1, [r2] - adds r0, r6 - strh r5, [r0, 0x2E] - ldr r1, =0x0000ffff - strh r1, [r0, 0x30] - mov r0, r8 - movs r1, 0x35 - movs r2, 0x44 - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r0, r4 - ldr r1, =sub_809EA04 - str r1, [r4] - adds r0, r6 - strh r5, [r0, 0x2E] - movs r1, 0x1 - negs r1, r1 - strh r1, [r0, 0x30] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809EB04 - - thumb_func_start sub_809EB8C -sub_809EB8C: @ 809EB8C - push {lr} - ldr r0, =gUnknown_085104C4 - ldrh r0, [r0, 0x4] - bl FreeObjectPaletteByTag - pop {r0} - bx r0 - .pool - thumb_func_end sub_809EB8C - - thumb_func_start sub_809EBA0 -sub_809EBA0: @ 809EBA0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0 - bl sub_8198070 - adds r0, r4, 0 - bl RemoveWindow - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_809EBA0 - - thumb_func_start sub_809EBC4 -sub_809EBC4: @ 809EBC4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - mov r10, r0 - adds r0, r1, 0 - mov r9, r2 - adds r1, r3, 0 - ldr r5, [sp, 0x30] - ldr r6, [sp, 0x34] - ldr r2, [sp, 0x38] - mov r8, r2 - mov r2, r10 - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - lsls r3, r0, 24 - lsrs r3, 24 - str r3, [sp, 0xC] - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r1, 16 - lsrs r1, 16 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - mov r2, r8 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - ldr r7, =0x02021fc4 - ldr r4, =0x02021cc4 - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalString - adds r0, r7, 0 - adds r1, r4, 0 - bl CopyString - adds r7, r0, 0 - ldr r1, =gUnknown_085EE68A - bl CopyString - adds r7, r0, 0 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r0, r7, 0 - adds r1, r4, 0 - bl CopyString - adds r7, r0, 0 - ldr r5, =gUnknown_085EE68E - adds r1, r5, 0 - bl CopyString - adds r7, r0, 0 - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - adds r0, r7, 0 - adds r1, r4, 0 - bl CopyString - adds r7, r0, 0 - adds r1, r5, 0 - bl CopyString - adds r7, r0, 0 - adds r0, r4, 0 - mov r1, r8 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - adds r0, r7, 0 - adds r1, r4, 0 - bl CopyString - ldr r2, =0x02021fc4 - mov r0, r9 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - mov r0, r10 - movs r1, 0x1 - 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_809EBC4 - - thumb_func_start sub_809ECB4 -sub_809ECB4: @ 809ECB4 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0xC - adds r4, r0, 0 - mov r9, r1 - adds r5, r2, 0 - adds r6, r3, 0 - ldr r0, [sp, 0x24] - mov r8, r0 - lsls r4, 24 - lsrs r4, 24 - mov r0, r9 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r2, 0x85 - lsls r2, 2 - adds r0, r4, 0 - movs r1, 0 - movs r3, 0xE - bl SetWindowBorderStyle - str r5, [sp] - str r6, [sp, 0x4] - mov r0, r8 - str r0, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x1 - mov r3, r9 - bl sub_809EBC4 - ldr r2, =gUnknown_085EE690 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - movs r3, 0x7E - bl Print - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809ECB4 - - thumb_func_start sub_809ED38 -sub_809ED38: @ 809ED38 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r3, 16 - lsrs r3, 16 - adds r1, r3, 0 - movs r0, 0x80 - ands r0, r3 - cmp r0, 0 - beq _0809ED52 - ldrh r0, [r4] - subs r0, 0x1 - b _0809ED6C -_0809ED52: - movs r0, 0x40 - ands r0, r3 - cmp r0, 0 - beq _0809ED60 - ldrh r0, [r4] - adds r0, 0x1 - b _0809ED8A -_0809ED60: - movs r0, 0x20 - ands r0, r3 - cmp r0, 0 - beq _0809ED7A - ldrh r0, [r4] - subs r0, 0xA -_0809ED6C: - strh r0, [r4] - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, r5 - bge _0809ED96 - strh r2, [r4] - b _0809ED96 -_0809ED7A: - movs r0, 0x10 - ands r1, r0 - cmp r1, 0 - bne _0809ED86 - movs r0, 0 - b _0809ED98 -_0809ED86: - ldrh r0, [r4] - adds r0, 0xA -_0809ED8A: - strh r0, [r4] - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, r2 - ble _0809ED96 - strh r5, [r4] -_0809ED96: - movs r0, 0x1 -_0809ED98: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_809ED38 - - thumb_func_start sub_809EDA0 -sub_809EDA0: @ 809EDA0 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0x1 - strh r0, [r1, 0x8] - bx lr - .pool - thumb_func_end sub_809EDA0 - - thumb_func_start sub_809EDB8 -sub_809EDB8: @ 809EDB8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r5, =0x03005e08 - adds r0, r4, r5 - ldrb r0, [r0, 0x10] - bl sub_809EBA0 - bl sub_809EB8C - subs r5, 0x8 - adds r4, r5 - ldr r0, =sub_809EDA0 - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809EDB8 - - thumb_func_start sub_809EDE8 -sub_809EDE8: @ 809EDE8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r7, r0, 3 - ldr r0, =0x03005e08 - mov r8, r0 - adds r5, r7, r0 - ldrb r4, [r5, 0x4] - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - ldr r1, =gUnknown_0851041C - adds r2, r0, r1 - ldr r1, =0x030022c0 - ldrh r3, [r1, 0x2E] - movs r0, 0x2 - ands r0, r3 - mov r12, r1 - cmp r0, 0 - beq _0809EE3C - mov r0, r8 - subs r0, 0x8 - adds r0, r7, r0 - ldr r1, =sub_809EDB8 - str r1, [r0] - movs r0, 0 - strh r0, [r5, 0x2] - movs r0, 0x6 - b _0809EE5C - .pool -_0809EE3C: - movs r0, 0x10 - ands r0, r3 - cmp r0, 0 - beq _0809EE4A - ldrb r0, [r2, 0x7] - cmp r0, 0 - bne _0809EE5C -_0809EE4A: - mov r3, r12 - ldrh r1, [r3, 0x2E] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0809EE66 - ldrb r0, [r2, 0x6] - cmp r0, 0 - beq _0809EE66 -_0809EE5C: - strh r0, [r5, 0x4] - movs r0, 0x5 - bl audio_play - b _0809EEF4 -_0809EE66: - cmp r4, 0x5 - bne _0809EEB4 - mov r0, r12 - ldrh r1, [r0, 0x2E] - movs r4, 0x1 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _0809EEF4 - ldr r1, =0x03005cf8 - ldrh r0, [r5, 0x6] - strh r0, [r1] - ldrh r0, [r5, 0x8] - strb r0, [r1, 0x2] - ldrh r0, [r5, 0xA] - strb r0, [r1, 0x3] - ldrh r0, [r5, 0xC] - strb r0, [r1, 0x4] - movs r0, 0x5 - bl audio_play - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_809EDB8 - str r1, [r0] - strh r4, [r5, 0x2] - movs r0, 0x6 - strh r0, [r5, 0x4] - b _0809EEF4 - .pool -_0809EEB4: - ldrb r0, [r2] - lsls r0, 1 - adds r0, r5, r0 - ldrh r1, [r2, 0x2] - ldrh r2, [r2, 0x4] - mov r3, r12 - ldrh r4, [r3, 0x30] - movs r3, 0xC0 - ands r3, r4 - bl sub_809ED38 - cmp r0, 0 - beq _0809EEF4 - movs r0, 0x5 - bl audio_play - ldrb r0, [r5, 0x10] - ldrh r3, [r5, 0x6] - ldrb r1, [r5, 0x8] - str r1, [sp] - ldrb r1, [r5, 0xA] - str r1, [sp, 0x4] - ldrb r1, [r5, 0xC] - str r1, [sp, 0x8] - movs r1, 0 - movs r2, 0x1 - bl sub_809EBC4 - ldrb r0, [r5, 0x10] - movs r1, 0x2 - bl CopyWindowToVram -_0809EEF4: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_809EDE8 - - thumb_func_start sub_809EF00 -sub_809EF00: @ 809EF00 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - mov r8, r0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r6, r0, 2 - add r6, r8 - lsls r6, 3 - ldr r0, =0x03005e08 - mov r9, r0 - adds r5, r6, r0 - movs r0, 0 - strh r0, [r5] - ldr r1, =0x03005cf8 - ldrh r0, [r1] - strh r0, [r5, 0x6] - movs r0, 0x2 - ldrsb r0, [r1, r0] - strh r0, [r5, 0x8] - movs r0, 0x3 - ldrsb r0, [r1, r0] - strh r0, [r5, 0xA] - movs r0, 0x4 - ldrsb r0, [r1, r0] - strh r0, [r5, 0xC] - ldr r0, =gUnknown_08510420 - bl AddWindow - strh r0, [r5, 0x10] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r5, 0x6] - ldrb r2, [r5, 0x8] - ldrb r3, [r5, 0xA] - ldrb r4, [r5, 0xC] - str r4, [sp] - bl sub_809ECB4 - mov r0, r8 - bl sub_809EB04 - movs r0, 0x2 - strh r0, [r5, 0x4] - movs r0, 0x8 - negs r0, r0 - add r9, r0 - add r6, r9 - ldr r0, =sub_809EDE8 - str r0, [r6] - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809EF00 - - thumb_func_start sub_809EF88 -sub_809EF88: @ 809EF88 - push {r4-r7,lr} - sub sp, 0x4 - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl SetVBlankCallback - movs r2, 0xA0 - lsls r2, 19 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, =0x040000d4 - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - ldr r0, =0x81000200 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r2, 0xC0 - lsls r2, 19 - movs r3, 0xC0 - lsls r3, 9 - mov r4, sp - movs r6, 0 - movs r5, 0x80 - lsls r5, 5 - ldr r7, =0x81000800 - movs r0, 0x81 - lsls r0, 24 - mov r12, r0 -_0809EFCA: - strh r6, [r4] - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - str r7, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r2, r5 - subs r3, r5 - cmp r3, r5 - bhi _0809EFCA - strh r6, [r4] - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - lsrs r0, r3, 1 - mov r2, r12 - orrs r0, r2 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r0, 0 - movs r1, 0x80 - bl ResetSpriteRange - bl LoadOamFromSprites - bl remove_some_task - bl dp12_8087EA4 - bl ResetAllObjectData - bl ResetTasks - bl sub_80A1A74 - bl sub_809F048 - ldr r0, =sub_809F0AC - bl SetVBlankCallback - ldr r0, =sub_809F090 - bl SetMainCallback2 - ldr r0, =sub_809F200 - movs r1, 0x50 - bl CreateTask - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809EF88 - - thumb_func_start sub_809F048 -sub_809F048: @ 809F048 - push {lr} - bl clear_scheduled_bg_copies_to_vram - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_08510404 - movs r0, 0 - movs r2, 0x1 - bl InitBgsFromTemplates - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - ldr r0, =gUnknown_08510408 - bl InitWindows - bl DeactivateAllTextPrinters - bl sub_81973A4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_809F048 - - thumb_func_start sub_809F090 -sub_809F090: @ 809F090 - push {lr} - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_809F090 - - thumb_func_start sub_809F0AC -sub_809F0AC: @ 809F0AC - push {lr} - bl ProcessObjectCopyRequests - bl LoadOamFromSprites - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_809F0AC - - thumb_func_start sub_809F0C0 -sub_809F0C0: @ 809F0C0 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r2, 0x80 - lsls r2, 2 - movs r0, 0x1 - movs r1, 0 - movs r3, 0xF - bl sub_8197B1C - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0 - bl Print - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_809F0C0 - - thumb_func_start sub_809F0F8 -sub_809F0F8: @ 809F0F8 - 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, =0x03005e08 - adds r6, r0, r1 - movs r0, 0 - ldrsh r5, [r6, r0] - cmp r5, 0 - beq _0809F11C - cmp r5, 0x1 - beq _0809F1B2 - b _0809F1F8 - .pool -_0809F11C: - movs r2, 0x85 - lsls r2, 2 - movs r0, 0 - movs r1, 0 - movs r3, 0xE - bl SetWindowBorderStyle - ldr r2, =gUnknown_085ECA0D - movs r0, 0x1 - str r0, [sp] - movs r4, 0xFF - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl Print - ldr r1, =0x03005cf8 - ldrh r3, [r1] - ldrb r0, [r1, 0x2] - str r0, [sp] - ldrb r0, [r1, 0x3] - str r0, [sp, 0x4] - ldrb r0, [r1, 0x4] - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0x11 - bl sub_809EBC4 - ldr r2, =gUnknown_085ECA22 - movs r0, 0x21 - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl Print - ldr r0, =0x03005d90 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xA0 - ldrh r3, [r0] - adds r0, 0x2 - ldrb r0, [r0] - str r0, [sp] - adds r0, r1, 0 - adds r0, 0xA3 - ldrb r0, [r0] - str r0, [sp, 0x4] - adds r0, r1, 0 - adds r0, 0xA4 - ldrb r0, [r0] - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0x31 - bl sub_809EBC4 - ldr r0, =gUnknown_085EC9EC - bl sub_809F0C0 - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldrh r0, [r6] - adds r0, 0x1 - strh r0, [r6] -_0809F1B2: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0809F1E4 - adds r0, r7, 0 - bl DestroyTask - bl Reset - b _0809F1F8 - .pool -_0809F1E4: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0809F1F8 - movs r0, 0x5 - bl audio_play - adds r0, r7, 0 - bl DestroyTask -_0809F1F8: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_809F0F8 - - thumb_func_start sub_809F200 -sub_809F200: @ 809F200 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0x6 - bls _0809F21C - b _0809F404 -_0809F21C: - lsls r0, 2 - ldr r1, =_0809F230 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0809F230: - .4byte _0809F24C - .4byte _0809F268 - .4byte _0809F2B4 - .4byte _0809F310 - .4byte _0809F398 - .4byte _0809F3C8 - .4byte _0809F3EA -_0809F24C: - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - movs r0, 0x1 - strh r0, [r5] - b _0809F404 - .pool -_0809F268: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0809F276 - b _0809F404 -_0809F276: - ldr r0, =0x03006210 - ldrh r0, [r0] - cmp r0, 0 - beq _0809F282 - cmp r0, 0x2 - bne _0809F29C -_0809F282: - ldr r0, =gUnknown_085ECAA7 - bl sub_809F0C0 - movs r0, 0x5 - strh r0, [r5] - b _0809F404 - .pool -_0809F29C: - bl GameFreakRTC_CalcLocalDateTime - ldr r0, =sub_809F0F8 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x2] - b _0809F334 - .pool -_0809F2B4: - ldr r2, =0x03005e00 - movs r0, 0x2 - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x4] - cmp r0, 0x1 - bne _0809F2CA - b _0809F404 -_0809F2CA: - movs r0, 0 - movs r1, 0 - bl sub_8198070 - ldr r0, =gUnknown_085ECA38 - bl sub_809F0C0 - ldr r2, =0x03005cf8 - ldr r0, =0x03005d90 - ldr r0, [r0] - adds r0, 0xA0 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r2] - str r1, [r2, 0x4] - ldr r0, =sub_809EF00 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x2] - movs r0, 0x3 - strh r0, [r5] - b _0809F404 - .pool -_0809F310: - ldr r2, =0x03005e00 - movs r0, 0x2 - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r1, r0, r2 - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _0809F404 - movs r2, 0xA - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _0809F340 - ldrb r0, [r5, 0x2] - bl DestroyTask -_0809F334: - movs r0, 0x2 - strh r0, [r5] - b _0809F404 - .pool -_0809F340: - ldrb r0, [r5, 0x2] - bl DestroyTask - bl GameFreakRTC_Reset - ldr r4, =0x03005cf8 - movs r1, 0 - ldrsh r0, [r4, r1] - movs r1, 0x2 - ldrsb r1, [r4, r1] - movs r2, 0x3 - ldrsb r2, [r4, r2] - movs r3, 0x4 - ldrsb r3, [r4, r3] - bl GameFreakRTC_CalcRTCToLocalDelta - ldr r0, =0x03005d90 - ldr r2, [r0] - adds r2, 0xA0 - ldr r0, [r4] - ldr r1, [r4, 0x4] - str r0, [r2] - str r1, [r2, 0x4] - ldr r0, =0x00004040 - ldrh r1, [r4] - bl VarSet - bl sub_809D5D8 - ldr r0, =gUnknown_085ECA4F - bl sub_809F0C0 - movs r0, 0x4 - strh r0, [r5] - b _0809F404 - .pool -_0809F398: - movs r0, 0 - bl save_game_when_memory_present - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809F3B8 - ldr r0, =gUnknown_085ECA8A - bl sub_809F0C0 - movs r0, 0x49 - bl audio_play - b _0809F3C4 - .pool -_0809F3B8: - ldr r0, =gUnknown_085ECA9A - bl sub_809F0C0 - movs r0, 0x16 - bl audio_play -_0809F3C4: - movs r0, 0x5 - strh r0, [r5] -_0809F3C8: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0809F404 - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0x1 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - movs r0, 0x6 - strh r0, [r5] -_0809F3EA: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0809F404 - adds r0, r4, 0 - bl DestroyTask - bl FreeAllWindowBuffers - bl Reset -_0809F404: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809F200 - - thumb_func_start sub_809F41C -sub_809F41C: @ 809F41C - push {lr} - ldr r0, =0x00000861 - bl FlagSet - movs r0, 0x86 - lsls r0, 4 - bl FlagSet - ldr r0, =0x00000862 - bl FlagSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_809F41C - - thumb_func_start BuildStartMenuActions -BuildStartMenuActions: @ 809F440 - push {lr} - ldr r0, =0x0203760f - movs r1, 0 - strb r1, [r0] - bl is_c1_link_related_active - cmp r0, 0x1 - bne _0809F45C - bl BuildStartMenuActions_LinkMode - b _0809F4AC - .pool -_0809F45C: - bl InUnionRoom - cmp r0, 0x1 - bne _0809F46A - bl BuildStartMenuActions_UnionRoom - b _0809F4AC -_0809F46A: - bl GetSafariZoneFlag - cmp r0, 0x1 - bne _0809F478 - bl BuildStartMenuActions_SafariZone - b _0809F4AC -_0809F478: - bl InBattlePike - lsls r0, 24 - cmp r0, 0 - beq _0809F488 - bl BuildStartMenuActions_BattlePike - b _0809F4AC -_0809F488: - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0809F498 - bl BuildStartMenuActions_BattlePyramid - b _0809F4AC -_0809F498: - bl in_multi_battle_room_with_var_condition - lsls r0, 24 - cmp r0, 0 - beq _0809F4A8 - bl BuildStartMenuActions_MultiBattleRoom - b _0809F4AC -_0809F4A8: - bl BuildStartMenuActions_Normal -_0809F4AC: - pop {r0} - bx r0 - thumb_func_end BuildStartMenuActions - - thumb_func_start AddStartMenuAction -@ void AddStartMenuAction(u8 entry) -AddStartMenuAction: @ 809F4B0 - push {lr} - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =0x02037610 - ldr r1, =0x0203760f - bl append_byte - pop {r0} - bx r0 - .pool - thumb_func_end AddStartMenuAction - - thumb_func_start BuildStartMenuActions_Normal -BuildStartMenuActions_Normal: @ 809F4CC - push {lr} - ldr r0, =0x00000861 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809F4E2 - movs r0, 0 - bl AddStartMenuAction -_0809F4E2: - movs r0, 0x86 - lsls r0, 4 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809F4F8 - movs r0, 0x1 - bl AddStartMenuAction -_0809F4F8: - movs r0, 0x2 - bl AddStartMenuAction - ldr r0, =0x00000862 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809F512 - movs r0, 0x3 - bl AddStartMenuAction -_0809F512: - movs r0, 0x4 - bl AddStartMenuAction - movs r0, 0x5 - bl AddStartMenuAction - movs r0, 0x6 - bl AddStartMenuAction - movs r0, 0x7 - bl AddStartMenuAction - pop {r0} - bx r0 - .pool - thumb_func_end BuildStartMenuActions_Normal - - thumb_func_start BuildStartMenuActions_SafariZone -BuildStartMenuActions_SafariZone: @ 809F538 - push {lr} - movs r0, 0x8 - bl AddStartMenuAction - movs r0, 0 - bl AddStartMenuAction - movs r0, 0x1 - bl AddStartMenuAction - movs r0, 0x2 - bl AddStartMenuAction - movs r0, 0x4 - bl AddStartMenuAction - movs r0, 0x6 - bl AddStartMenuAction - movs r0, 0x7 - bl AddStartMenuAction - pop {r0} - bx r0 - thumb_func_end BuildStartMenuActions_SafariZone - - thumb_func_start BuildStartMenuActions_LinkMode -BuildStartMenuActions_LinkMode: @ 809F568 - push {lr} - movs r0, 0x1 - bl AddStartMenuAction - movs r0, 0x2 - bl AddStartMenuAction - ldr r0, =0x00000862 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809F58A - movs r0, 0x3 - bl AddStartMenuAction -_0809F58A: - movs r0, 0x9 - bl AddStartMenuAction - movs r0, 0x6 - bl AddStartMenuAction - movs r0, 0x7 - bl AddStartMenuAction - pop {r0} - bx r0 - .pool - thumb_func_end BuildStartMenuActions_LinkMode - - thumb_func_start BuildStartMenuActions_UnionRoom -BuildStartMenuActions_UnionRoom: @ 809F5A4 - push {lr} - movs r0, 0x1 - bl AddStartMenuAction - movs r0, 0x2 - bl AddStartMenuAction - ldr r0, =0x00000862 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809F5C6 - movs r0, 0x3 - bl AddStartMenuAction -_0809F5C6: - movs r0, 0x4 - bl AddStartMenuAction - movs r0, 0x6 - bl AddStartMenuAction - movs r0, 0x7 - bl AddStartMenuAction - pop {r0} - bx r0 - .pool - thumb_func_end BuildStartMenuActions_UnionRoom - - thumb_func_start BuildStartMenuActions_BattlePike -BuildStartMenuActions_BattlePike: @ 809F5E0 - push {lr} - movs r0, 0 - bl AddStartMenuAction - movs r0, 0x1 - bl AddStartMenuAction - movs r0, 0x4 - bl AddStartMenuAction - movs r0, 0x6 - bl AddStartMenuAction - movs r0, 0x7 - bl AddStartMenuAction - pop {r0} - bx r0 - thumb_func_end BuildStartMenuActions_BattlePike - - thumb_func_start BuildStartMenuActions_BattlePyramid -BuildStartMenuActions_BattlePyramid: @ 809F604 - push {lr} - movs r0, 0x1 - bl AddStartMenuAction - movs r0, 0xC - bl AddStartMenuAction - movs r0, 0x4 - bl AddStartMenuAction - movs r0, 0xA - bl AddStartMenuAction - movs r0, 0xB - bl AddStartMenuAction - movs r0, 0x6 - bl AddStartMenuAction - movs r0, 0x7 - bl AddStartMenuAction - pop {r0} - bx r0 - thumb_func_end BuildStartMenuActions_BattlePyramid - - thumb_func_start BuildStartMenuActions_MultiBattleRoom -BuildStartMenuActions_MultiBattleRoom: @ 809F634 - push {lr} - movs r0, 0x1 - bl AddStartMenuAction - movs r0, 0x4 - bl AddStartMenuAction - movs r0, 0x6 - bl AddStartMenuAction - movs r0, 0x7 - bl AddStartMenuAction - pop {r0} - bx r0 - thumb_func_end BuildStartMenuActions_MultiBattleRoom - - thumb_func_start sub_809F654 -sub_809F654: @ 809F654 - push {r4,r5,lr} - sub sp, 0xC - ldr r4, =0x0203760c - ldr r0, =gUnknown_08510508 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - bl PutWindowTilemap - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldr r0, =0x02021cc4 - ldr r1, =0x0203a04c - ldrb r1, [r1] - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r5, =0x02021fc4 - ldr r1, =gUnknown_085EE6FF - adds r0, r5, 0 - bl ExpandStringRefs - ldrb r0, [r4] - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0 - bl Print - ldrb r0, [r4] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809F654 - - thumb_func_start sub_809F6C8 -sub_809F6C8: @ 809F6C8 - push {r4,r5,lr} - sub sp, 0xC - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0x7 - bne _0809F6F0 - ldr r4, =0x0203760d - ldr r0, =gUnknown_08510538 - b _0809F6F4 - .pool -_0809F6F0: - ldr r4, =0x0203760d - ldr r0, =gUnknown_08510530 -_0809F6F4: - bl AddWindow - strb r0, [r4] - ldr r4, =0x0203760d - ldrb r0, [r4] - bl PutWindowTilemap - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldr r0, =0x02021cc4 - ldr r2, =gUnknown_08510510 - ldr r1, =0x03005d90 - ldr r1, [r1] - ldr r3, =0x00000cb2 - adds r1, r3 - ldrh r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl CopyString - ldr r5, =0x02021fc4 - ldr r1, =gUnknown_085EE716 - adds r0, r5, 0 - bl ExpandStringRefs - ldrb r0, [r4] - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0 - bl Print - ldrb r0, [r4] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809F6C8 - - thumb_func_start RemoveExtraStartMenuWindows -RemoveExtraStartMenuWindows: @ 809F774 - push {r4,lr} - bl GetSafariZoneFlag - cmp r0, 0 - beq _0809F796 - ldr r4, =0x0203760c - ldrb r0, [r4] - movs r1, 0 - bl sub_8198070 - ldrb r0, [r4] - movs r1, 0x2 - bl CopyWindowToVram - ldrb r0, [r4] - bl RemoveWindow -_0809F796: - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0809F7B0 - ldr r4, =0x0203760d - ldrb r0, [r4] - movs r1, 0 - bl sub_8198070 - ldrb r0, [r4] - bl RemoveWindow -_0809F7B0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end RemoveExtraStartMenuWindows - - thumb_func_start PrintStartMenuActions -PrintStartMenuActions: @ 809F7C0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - mov r8, r0 - adds r6, r1, 0 - ldrb r2, [r0] - ldr r0, =gUnknown_08510540 - mov r9, r0 - ldr r1, =0x02021fc4 - mov r10, r1 -_0809F7DA: - ldr r0, =0x02037610 - lsls r2, 24 - asrs r4, r2, 24 - adds r5, r4, r0 - ldrb r0, [r5] - lsls r3, r0, 3 - mov r0, r9 - adds r0, 0x4 - adds r0, r3, r0 - ldr r1, [r0] - ldr r0, =StartMenu_PlayerName - adds r7, r2, 0 - cmp r1, r0 - bne _0809F828 - bl get_start_menu_window_id_maybe - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r5] - lsls r1, 3 - add r1, r9 - ldr r1, [r1] - lsls r3, r4, 4 - adds r3, 0x9 - lsls r3, 16 - lsrs r3, 16 - movs r2, 0x8 - bl sub_819A024 - b _0809F858 - .pool -_0809F828: - mov r1, r9 - adds r0, r3, r1 - ldr r1, [r0] - mov r0, r10 - bl ExpandStringRefs - bl get_start_menu_window_id_maybe - lsls r0, 24 - lsrs r0, 24 - lsls r1, r4, 4 - adds r1, 0x9 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - mov r2, r10 - movs r3, 0x8 - bl Print -_0809F858: - movs r0, 0x80 - lsls r0, 17 - adds r1, r7, r0 - lsrs r2, r1, 24 - asrs r1, 24 - ldr r0, =0x0203760f - ldrb r0, [r0] - cmp r1, r0 - bge _0809F87C - subs r6, 0x1 - cmp r6, 0 - bne _0809F7DA - mov r1, r8 - strb r2, [r1] - movs r0, 0 - b _0809F882 - .pool -_0809F87C: - mov r0, r8 - strb r2, [r0] - movs r0, 0x1 -_0809F882: - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end PrintStartMenuActions - - thumb_func_start sub_809F894 -sub_809F894: @ 809F894 - push {r4,lr} - sub sp, 0xC - ldr r0, =0x02037619 - movs r1, 0 - ldrsb r1, [r0, r1] - adds r2, r0, 0 - cmp r1, 0x5 - bhi _0809F98C - lsls r0, r1, 2 - ldr r1, =_0809F8B8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0809F8B8: - .4byte _0809F8D0 - .4byte _0809F8D8 - .4byte _0809F8E4 - .4byte _0809F90C - .4byte _0809F930 - .4byte _0809F94C -_0809F8D0: - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - b _0809F98C -_0809F8D8: - bl BuildStartMenuActions - ldr r1, =0x02037619 - b _0809F940 - .pool -_0809F8E4: - bl sub_81973A4 - ldr r0, =0x0203760f - ldrb r0, [r0] - bl sub_81979C4 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_81973FC - ldr r1, =0x02037619 - movs r0, 0 - strb r0, [r1, 0x1] - b _0809F940 - .pool -_0809F90C: - bl GetSafariZoneFlag - cmp r0, 0 - beq _0809F918 - bl sub_809F654 -_0809F918: - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0809F926 - bl sub_809F6C8 -_0809F926: - ldr r1, =0x02037619 - b _0809F940 - .pool -_0809F930: - ldr r4, =0x0203761a - adds r0, r4, 0 - movs r1, 0x2 - bl PrintStartMenuActions - cmp r0, 0 - beq _0809F98C - subs r1, r4, 0x1 -_0809F940: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0809F98C - .pool -_0809F94C: - bl get_start_menu_window_id_maybe - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x10 - str r1, [sp] - ldr r1, =0x0203760f - ldrb r1, [r1] - str r1, [sp, 0x4] - ldr r4, =0x0203760e - ldrb r1, [r4] - str r1, [sp, 0x8] - movs r1, 0x1 - movs r2, 0 - movs r3, 0x9 - bl sub_81983AC - strb r0, [r4] - bl get_start_menu_window_id_maybe - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl CopyWindowToVram - movs r0, 0x1 - b _0809F98E - .pool -_0809F98C: - movs r0, 0 -_0809F98E: - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_809F894 - - thumb_func_start sub_809F998 -sub_809F998: @ 809F998 - push {lr} - ldr r1, =0x02037619 - movs r0, 0 - strb r0, [r1] - strb r0, [r1, 0x1] -_0809F9A2: - bl sub_809F894 - cmp r0, 0 - beq _0809F9A2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_809F998 - - thumb_func_start task50_startmenu -task50_startmenu: @ 809F9B4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_809F894 - cmp r0, 0x1 - bne _0809F9C8 - adds r0, r4, 0 - bl SwitchTaskToFollowupFunc -_0809F9C8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end task50_startmenu - - thumb_func_start sub_809F9D0 -sub_809F9D0: @ 809F9D0 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r1, =0x02037619 - movs r0, 0 - strb r0, [r1] - strb r0, [r1, 0x1] - ldr r4, =task50_startmenu - adds r0, r4, 0 - movs r1, 0x50 - 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_809F9D0 - - thumb_func_start sub_809FA00 -sub_809FA00: @ 809FA00 - push {lr} - bl sub_809F894 - cmp r0, 0 - beq _0809FA12 - bl sub_80AF688 - movs r0, 0x1 - b _0809FA14 -_0809FA12: - movs r0, 0 -_0809FA14: - pop {r1} - bx r1 - thumb_func_end sub_809FA00 - - thumb_func_start sub_809FA18 -sub_809FA18: @ 809FA18 - ldr r1, =0x02037619 - movs r0, 0 - strb r0, [r1] - strb r0, [r1, 0x1] - ldr r1, =0x03005db0 - ldr r0, =sub_809FA00 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_809FA18 - - thumb_func_start sub_809FA34 -sub_809FA34: @ 809FA34 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0809FA58 - cmp r0, 0x1 - beq _0809FA7C - b _0809FA92 - .pool -_0809FA58: - bl InUnionRoom - cmp r0, 0x1 - bne _0809FA64 - bl var_800D_set_xB -_0809FA64: - ldr r1, =0x03005df4 - ldr r0, =HandleStartMenuInput - str r0, [r1] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0809FA92 - .pool -_0809FA7C: - ldr r0, =0x03005df4 - ldr r0, [r0] - bl _call_via_r0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0809FA92 - adds r0, r5, 0 - bl DestroyTask -_0809FA92: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809FA34 - - thumb_func_start sub_809FA9C -sub_809FA9C: @ 809FA9C - push {lr} - bl is_c1_link_related_active - cmp r0, 0 - bne _0809FAB2 - bl player_bitmagic - bl sub_808B864 - bl sub_808BCF4 -_0809FAB2: - ldr r0, =sub_809FA34 - bl sub_809F9D0 - bl script_env_2_enable - pop {r0} - bx r0 - .pool - thumb_func_end sub_809FA9C - - thumb_func_start HandleStartMenuInput -HandleStartMenuInput: @ 809FAC4 - push {r4,lr} - ldr r4, =0x030022c0 - ldrh r1, [r4, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0809FAE4 - movs r0, 0x5 - bl audio_play - movs r0, 0x1 - negs r0, r0 - bl MoveMenuCursor - ldr r1, =0x0203760e - strb r0, [r1] -_0809FAE4: - ldrh r1, [r4, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0809FAFE - movs r0, 0x5 - bl audio_play - movs r0, 0x1 - bl MoveMenuCursor - ldr r1, =0x0203760e - strb r0, [r1] -_0809FAFE: - ldrh r1, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0809FB98 - movs r0, 0x5 - bl audio_play - ldr r1, =gUnknown_08510540 - ldr r2, =0x02037610 - ldr r0, =0x0203760e - ldrb r0, [r0] - adds r0, r2 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - adds r0, r1 - ldr r1, [r0] - ldr r0, =StartMenu_Pokedex - cmp r1, r0 - bne _0809FB34 - movs r0, 0 - bl pokedex_count - lsls r0, 16 - cmp r0, 0 - beq _0809FBA0 -_0809FB34: - ldr r3, =0x03005df4 - ldr r1, =gUnknown_08510540 - ldr r2, =0x02037610 - ldr r0, =0x0203760e - ldrb r0, [r0] - adds r0, r2 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - adds r0, r1 - ldr r1, [r0] - str r1, [r3] - ldr r0, =StartMenu_Save - cmp r1, r0 - beq _0809FBA0 - ldr r0, =StartMenu_Exit - cmp r1, r0 - beq _0809FBA0 - ldr r0, =StartMenu_SafariZoneRetire - cmp r1, r0 - beq _0809FBA0 - ldr r0, =StartMenu_BattlePyramidRetire - cmp r1, r0 - beq _0809FBA0 - movs r0, 0x1 - movs r1, 0 - bl fade_screen - b _0809FBA0 - .pool -_0809FB98: - movs r0, 0xA - ands r0, r1 - cmp r0, 0 - bne _0809FBA4 -_0809FBA0: - movs r0, 0 - b _0809FBAE -_0809FBA4: - bl RemoveExtraStartMenuWindows - bl sub_80A0934 - movs r0, 0x1 -_0809FBAE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end HandleStartMenuInput - - thumb_func_start StartMenu_Pokedex -StartMenu_Pokedex: @ 809FBB4 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0809FBCC - movs r0, 0 - b _0809FBE6 - .pool -_0809FBCC: - movs r0, 0x29 - bl sav12_xor_increment - bl play_some_sound - bl RemoveExtraStartMenuWindows - bl overworld_free_bg_tilemaps - ldr r0, =sub_80BB534 - bl SetMainCallback2 - movs r0, 0x1 -_0809FBE6: - pop {r1} - bx r1 - .pool - thumb_func_end StartMenu_Pokedex - - thumb_func_start StartMenu_Pokemon -StartMenu_Pokemon: @ 809FBF0 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0809FC08 - movs r0, 0 - b _0809FC1C - .pool -_0809FC08: - bl play_some_sound - bl RemoveExtraStartMenuWindows - bl overworld_free_bg_tilemaps - ldr r0, =CB2_PartyMenuFromStartMenu - bl SetMainCallback2 - movs r0, 0x1 -_0809FC1C: - pop {r1} - bx r1 - .pool - thumb_func_end StartMenu_Pokemon - - thumb_func_start StartMenu_Bag -StartMenu_Bag: @ 809FC24 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0809FC3C - movs r0, 0 - b _0809FC50 - .pool -_0809FC3C: - bl play_some_sound - bl RemoveExtraStartMenuWindows - bl overworld_free_bg_tilemaps - ldr r0, =CB2_BagMenuFromStartMenu - bl SetMainCallback2 - movs r0, 0x1 -_0809FC50: - pop {r1} - bx r1 - .pool - thumb_func_end StartMenu_Bag - - thumb_func_start StartMenu_PokeNav -StartMenu_PokeNav: @ 809FC58 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0809FC70 - movs r0, 0 - b _0809FC84 - .pool -_0809FC70: - bl play_some_sound - bl RemoveExtraStartMenuWindows - bl overworld_free_bg_tilemaps - ldr r0, =CB2_PokeNav - bl SetMainCallback2 - movs r0, 0x1 -_0809FC84: - pop {r1} - bx r1 - .pool - thumb_func_end StartMenu_PokeNav - - thumb_func_start StartMenu_PlayerName -StartMenu_PlayerName: @ 809FC8C - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0809FCF4 - bl play_some_sound - bl RemoveExtraStartMenuWindows - bl overworld_free_bg_tilemaps - bl is_c1_link_related_active - cmp r0, 0 - bne _0809FCB6 - bl InUnionRoom - cmp r0, 0 - beq _0809FCC8 -_0809FCB6: - ldr r0, =sub_8086194 - bl sub_80C4DDC - b _0809FCEA - .pool -_0809FCC8: - ldr r0, =0x000008d2 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0809FCE4 - ldr r0, =sub_8086194 - bl sub_80C51C4 - b _0809FCEA - .pool -_0809FCE4: - ldr r0, =sub_8086194 - bl sub_80C4DDC -_0809FCEA: - movs r0, 0x1 - b _0809FCF6 - .pool -_0809FCF4: - movs r0, 0 -_0809FCF6: - pop {r1} - bx r1 - thumb_func_end StartMenu_PlayerName - - thumb_func_start StartMenu_Save -StartMenu_Save: @ 809FCFC - push {lr} - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _0809FD0C - bl RemoveExtraStartMenuWindows -_0809FD0C: - ldr r1, =0x03005df4 - ldr r0, =sub_809FE28 - str r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end StartMenu_Save - - thumb_func_start StartMenu_Option -StartMenu_Option: @ 809FD20 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0809FD38 - movs r0, 0 - b _0809FD52 - .pool -_0809FD38: - bl play_some_sound - bl RemoveExtraStartMenuWindows - bl overworld_free_bg_tilemaps - ldr r0, =CB2_OptionsMenu - bl SetMainCallback2 - ldr r1, =0x030022c0 - ldr r0, =sub_8086194 - str r0, [r1, 0x8] - movs r0, 0x1 -_0809FD52: - pop {r1} - bx r1 - .pool - thumb_func_end StartMenu_Option - - thumb_func_start StartMenu_Exit -StartMenu_Exit: @ 809FD64 - push {lr} - bl RemoveExtraStartMenuWindows - bl sub_80A0934 - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end StartMenu_Exit - - thumb_func_start StartMenu_SafariZoneRetire -StartMenu_SafariZoneRetire: @ 809FD74 - push {lr} - bl RemoveExtraStartMenuWindows - bl sub_80A0934 - bl sub_80FC180 - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end StartMenu_SafariZoneRetire - - thumb_func_start StartMenu_LinkModePlayerName -StartMenu_LinkModePlayerName: @ 809FD88 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0809FDA0 - movs r0, 0 - b _0809FDB4 - .pool -_0809FDA0: - bl play_some_sound - bl overworld_free_bg_tilemaps - ldr r0, =0x03005db4 - ldrb r0, [r0] - ldr r1, =sub_8086194 - bl sub_80C4E74 - movs r0, 0x1 -_0809FDB4: - pop {r1} - bx r1 - .pool - thumb_func_end StartMenu_LinkModePlayerName - - thumb_func_start StartMenu_BattlePyramidRetire -StartMenu_BattlePyramidRetire: @ 809FDC0 - ldr r1, =0x03005df4 - ldr r0, =sub_809FE9C - str r0, [r1] - movs r0, 0 - bx lr - .pool - thumb_func_end StartMenu_BattlePyramidRetire - - thumb_func_start sub_809FDD4 -sub_809FDD4: @ 809FDD4 - push {lr} - movs r0, 0 - movs r1, 0 - bl sub_8197DF8 - bl sub_80984F4 - ldr r0, =sub_809FA34 - bl sub_809F9D0 - bl script_env_2_enable - pop {r0} - bx r0 - .pool - thumb_func_end sub_809FDD4 - - thumb_func_start StartMenu_BattlePyramidBag -StartMenu_BattlePyramidBag: @ 809FDF4 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0809FE0C - movs r0, 0 - b _0809FE20 - .pool -_0809FE0C: - bl play_some_sound - bl RemoveExtraStartMenuWindows - bl overworld_free_bg_tilemaps - ldr r0, =sub_81C4EFC - bl SetMainCallback2 - movs r0, 0x1 -_0809FE20: - pop {r1} - bx r1 - .pool - thumb_func_end StartMenu_BattlePyramidBag - - thumb_func_start sub_809FE28 -sub_809FE28: @ 809FE28 - push {lr} - bl sub_809FF28 - ldr r1, =0x03005df4 - ldr r0, =sub_809FE44 - str r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809FE28 - - thumb_func_start sub_809FE44 -sub_809FE44: @ 809FE44 - push {lr} - bl sub_809FF4C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809FE7C - cmp r0, 0x1 - ble _0809FE94 - cmp r0, 0x2 - beq _0809FE60 - cmp r0, 0x3 - beq _0809FE7C - b _0809FE94 -_0809FE60: - movs r0, 0 - movs r1, 0 - bl sub_8197DF8 - bl sub_809F998 - ldr r1, =0x03005df4 - ldr r0, =HandleStartMenuInput - str r0, [r1] - b _0809FE94 - .pool -_0809FE7C: - movs r0, 0 - movs r1, 0x1 - bl sub_8197DF8 - bl sub_80984F4 - bl script_env_2_disable - bl sub_81A9EC8 - movs r0, 0x1 - b _0809FE96 -_0809FE94: - movs r0, 0 -_0809FE96: - pop {r1} - bx r1 - thumb_func_end sub_809FE44 - - thumb_func_start sub_809FE9C -sub_809FE9C: @ 809FE9C - push {lr} - bl sub_80A0340 - ldr r1, =0x03005df4 - ldr r0, =sub_809FED4 - str r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809FE9C - - thumb_func_start sub_809FEB8 -sub_809FEB8: @ 809FEB8 - push {lr} - bl sub_809F998 - ldr r1, =0x03005df4 - ldr r0, =HandleStartMenuInput - str r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_809FEB8 - - thumb_func_start sub_809FED4 -sub_809FED4: @ 809FED4 - push {lr} - bl sub_809FF4C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0809FEEC - cmp r0, 0x1 - ble _0809FF20 - cmp r0, 0x2 - beq _0809FF00 - b _0809FF20 -_0809FEEC: - bl RemoveExtraStartMenuWindows - ldr r1, =0x03005df4 - ldr r0, =sub_809FEB8 - str r0, [r1] - b _0809FF20 - .pool -_0809FF00: - movs r0, 0 - movs r1, 0x1 - bl sub_8197DF8 - bl sub_80984F4 - bl script_env_2_disable - ldr r0, =gUnknown_08252C88 - bl script_env_1_execute_new_script - movs r0, 0x1 - b _0809FF22 - .pool -_0809FF20: - movs r0, 0 -_0809FF22: - pop {r1} - bx r1 - thumb_func_end sub_809FED4 - - thumb_func_start sub_809FF28 -sub_809FF28: @ 809FF28 - push {lr} - bl save_serialize_map - ldr r1, =0x0203761c - ldr r0, =sub_80A00A0 - str r0, [r1] - ldr r1, =0x02037621 - movs r0, 0 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_809FF28 - - thumb_func_start sub_809FF4C -sub_809FF4C: @ 809FF4C - push {lr} - bl sub_8197224 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - beq _0809FF78 - ldr r1, =0x02037621 - movs r0, 0 - strb r0, [r1] - ldr r0, =0x0203761c - ldr r0, [r0] - bl _call_via_r0 - lsls r0, 24 - lsrs r0, 24 - b _0809FF7A - .pool -_0809FF78: - movs r0, 0 -_0809FF7A: - pop {r1} - bx r1 - thumb_func_end sub_809FF4C - - thumb_func_start sub_809FF80 -sub_809FF80: @ 809FF80 - push {lr} - bl sub_809FF28 - ldr r0, =task50_save_game - movs r1, 0x50 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_809FF80 - - thumb_func_start sub_809FF98 -sub_809FF98: @ 809FF98 - push {r4,lr} - adds r2, r0, 0 - adds r4, r1, 0 - ldr r0, =0x02021fc4 - adds r1, r2, 0 - bl ExpandStringRefs - movs r0, 0 - movs r1, 0x1 - bl sub_819786C - movs r0, 0x1 - bl AddTextPrinterForMessage_2 - ldr r1, =0x02037621 - movs r0, 0x1 - strb r0, [r1] - ldr r0, =0x0203761c - str r4, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_809FF98 - - thumb_func_start task50_save_game -task50_save_game: @ 809FFD0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_809FF4C - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1 - beq _0809FFFC - cmp r1, 0x1 - bgt _0809FFEC - cmp r1, 0 - beq _080A000A - b _080A0000 -_0809FFEC: - cmp r1, 0x3 - bgt _080A0000 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - b _080A0000 - .pool -_0809FFFC: - ldr r0, =0x020375f0 - strh r1, [r0] -_080A0000: - adds r0, r4, 0 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running -_080A000A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task50_save_game - - thumb_func_start sub_80A0014 -sub_80A0014: @ 80A0014 - push {lr} - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - pop {r0} - bx r0 - thumb_func_end sub_80A0014 - - thumb_func_start sub_80A0024 -sub_80A0024: @ 80A0024 - push {lr} - bl sub_80A0888 - pop {r0} - bx r0 - thumb_func_end sub_80A0024 - - thumb_func_start sub_80A0030 -sub_80A0030: @ 80A0030 - ldr r1, =0x02037620 - movs r0, 0x3C - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_80A0030 - - thumb_func_start sub_80A003C -sub_80A003C: @ 80A003C - push {lr} - ldr r1, =0x02037620 - ldrb r0, [r1] - subs r2, r0, 0x1 - strb r2, [r1] - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2C] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080A0064 - lsls r0, r2, 24 - cmp r0, 0 - beq _080A006A - movs r0, 0 - b _080A006C - .pool -_080A0064: - movs r0, 0x5 - bl audio_play -_080A006A: - movs r0, 0x1 -_080A006C: - pop {r1} - bx r1 - thumb_func_end sub_80A003C - - thumb_func_start sub_80A0070 -sub_80A0070: @ 80A0070 - push {lr} - ldr r1, =0x02037620 - ldrb r0, [r1] - cmp r0, 0 - bne _080A0094 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2C] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080A0098 - movs r0, 0x1 - b _080A009A - .pool -_080A0094: - subs r0, 0x1 - strb r0, [r1] -_080A0098: - movs r0, 0 -_080A009A: - pop {r1} - bx r1 - thumb_func_end sub_80A0070 - - thumb_func_start sub_80A00A0 -sub_80A00A0: @ 80A00A0 - push {lr} - bl get_start_menu_window_id_maybe - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_819746C - bl remove_start_menu_window_maybe - bl sub_80A06B4 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _080A00D4 - ldr r0, =gUnknown_08252CA7 - ldr r1, =sub_80A00EC - bl sub_809FF98 - b _080A00DC - .pool -_080A00D4: - ldr r0, =gUnknown_082C87B4 - ldr r1, =sub_80A00EC - bl sub_809FF98 -_080A00DC: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A00A0 - - thumb_func_start sub_80A00EC -sub_80A00EC: @ 80A00EC - push {lr} - bl sub_8197930 - ldr r1, =0x0203761c - ldr r0, =sub_80A0108 - str r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A00EC - - thumb_func_start sub_80A0108 -sub_80A0108: @ 80A0108 - push {lr} - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _080A012A - cmp r1, 0 - bgt _080A0124 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _080A0168 - b _080A0174 -_080A0124: - cmp r1, 0x1 - beq _080A0168 - b _080A0174 -_080A012A: - ldr r0, =0x03006210 - ldrh r0, [r0] - cmp r0, 0 - beq _080A0136 - cmp r0, 0x2 - bne _080A013E -_080A0136: - ldr r0, =0x020322d4 - ldrb r0, [r0] - cmp r0, 0 - bne _080A0158 -_080A013E: - ldr r1, =0x0203761c - ldr r0, =sub_80A017C - str r0, [r1] - b _080A0174 - .pool -_080A0158: - ldr r1, =0x0203761c - ldr r0, =sub_80A0234 - str r0, [r1] - b _080A0174 - .pool -_080A0168: - bl sub_80A0024 - bl sub_80A0014 - movs r0, 0x2 - b _080A0176 -_080A0174: - movs r0, 0 -_080A0176: - pop {r1} - bx r1 - thumb_func_end sub_80A0108 - - thumb_func_start sub_80A017C -sub_80A017C: @ 80A017C - push {lr} - ldr r0, =0x020322d4 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080A019C - ldr r0, =gUnknown_082C8845 - ldr r1, =sub_80A01B4 - bl sub_809FF98 - b _080A01A4 - .pool -_080A019C: - ldr r0, =gUnknown_082C87D5 - ldr r1, =sub_80A01D0 - bl sub_809FF98 -_080A01A4: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A017C - - thumb_func_start sub_80A01B4 -sub_80A01B4: @ 80A01B4 - push {lr} - movs r0, 0x1 - bl sub_8197948 - ldr r1, =0x0203761c - ldr r0, =sub_80A01EC - str r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A01B4 - - thumb_func_start sub_80A01D0 -sub_80A01D0: @ 80A01D0 - push {lr} - bl sub_8197930 - ldr r1, =0x0203761c - ldr r0, =sub_80A01EC - str r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A01D0 - - thumb_func_start sub_80A01EC -sub_80A01EC: @ 80A01EC - push {lr} - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _080A020E - cmp r1, 0 - bgt _080A0208 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _080A0220 - b _080A022C -_080A0208: - cmp r1, 0x1 - beq _080A0220 - b _080A022C -_080A020E: - ldr r1, =0x0203761c - ldr r0, =sub_80A0234 - str r0, [r1] - b _080A022C - .pool -_080A0220: - bl sub_80A0024 - bl sub_80A0014 - movs r0, 0x2 - b _080A022E -_080A022C: - movs r0, 0 -_080A022E: - pop {r1} - bx r1 - thumb_func_end sub_80A01EC - - thumb_func_start sub_80A0234 -sub_80A0234: @ 80A0234 - push {lr} - ldr r0, =gUnknown_082C8810 - ldr r1, =sub_80A024C - bl sub_809FF98 - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A0234 - - thumb_func_start sub_80A024C -sub_80A024C: @ 80A024C - push {r4,lr} - movs r0, 0 - bl sav12_xor_increment - bl sub_81A9E90 - ldr r4, =0x020322d4 - ldrb r0, [r4] - cmp r0, 0x1 - bne _080A0274 - movs r0, 0x4 - bl save_game_when_memory_present - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0 - strb r0, [r4] - b _080A027E - .pool -_080A0274: - movs r0, 0 - bl save_game_when_memory_present - lsls r0, 24 - lsrs r1, r0, 24 -_080A027E: - cmp r1, 0x1 - bne _080A0294 - ldr r0, =gUnknown_082C8832 - ldr r1, =sub_80A02B0 - bl sub_809FF98 - b _080A029C - .pool -_080A0294: - ldr r0, =gUnknown_082C892A - ldr r1, =sub_80A02FC - bl sub_809FF98 -_080A029C: - bl sub_80A0030 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A024C - - thumb_func_start sub_80A02B0 -sub_80A02B0: @ 80A02B0 - push {lr} - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _080A02CA - movs r0, 0x37 - bl audio_play - ldr r1, =0x0203761c - ldr r0, =sub_80A02D8 - str r0, [r1] -_080A02CA: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A02B0 - - thumb_func_start sub_80A02D8 -sub_80A02D8: @ 80A02D8 - push {lr} - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - bne _080A02F6 - bl sub_80A003C - lsls r0, 24 - cmp r0, 0 - beq _080A02F6 - bl sub_80A0024 - movs r0, 0x1 - b _080A02F8 -_080A02F6: - movs r0, 0 -_080A02F8: - pop {r1} - bx r1 - thumb_func_end sub_80A02D8 - - thumb_func_start sub_80A02FC -sub_80A02FC: @ 80A02FC - push {lr} - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _080A0316 - movs r0, 0x16 - bl audio_play - ldr r1, =0x0203761c - ldr r0, =sub_80A0324 - str r0, [r1] -_080A0316: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A02FC - - thumb_func_start sub_80A0324 -sub_80A0324: @ 80A0324 - push {lr} - bl sub_80A0070 - lsls r0, 24 - cmp r0, 0 - beq _080A0338 - bl sub_80A0024 - movs r0, 0x3 - b _080A033A -_080A0338: - movs r0, 0 -_080A033A: - pop {r1} - bx r1 - thumb_func_end sub_80A0324 - - thumb_func_start sub_80A0340 -sub_80A0340: @ 80A0340 - ldr r1, =0x0203761c - ldr r0, =sub_80A035C - str r0, [r1] - ldr r1, =0x02037621 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_80A0340 - - thumb_func_start sub_80A035C -sub_80A035C: @ 80A035C - push {lr} - bl get_start_menu_window_id_maybe - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_819746C - bl remove_start_menu_window_maybe - ldr r0, =gUnknown_08252CFB - ldr r1, =sub_80A0388 - bl sub_809FF98 - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A035C - - thumb_func_start sub_80A0388 -sub_80A0388: @ 80A0388 - push {lr} - movs r0, 0x1 - bl sub_8197948 - ldr r1, =0x0203761c - ldr r0, =sub_80A03A4 - str r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A0388 - - thumb_func_start sub_80A03A4 -sub_80A03A4: @ 80A03A4 - push {lr} - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _080A03C6 - cmp r1, 0 - bgt _080A03C0 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _080A03CA - b _080A03D2 -_080A03C0: - cmp r1, 0x1 - beq _080A03CA - b _080A03D2 -_080A03C6: - movs r0, 0x2 - b _080A03D4 -_080A03CA: - bl sub_80A0014 - movs r0, 0x1 - b _080A03D4 -_080A03D2: - movs r0, 0 -_080A03D4: - pop {r1} - bx r1 - thumb_func_end sub_80A03A4 - - thumb_func_start sub_80A03D8 -sub_80A03D8: @ 80A03D8 - push {lr} - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_80A03D8 - - thumb_func_start sub_80A03E4 -sub_80A03E4: @ 80A03E4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - mov r8, r0 - ldrb r0, [r0] - cmp r0, 0x4 - bls _080A03F6 - b _080A04FC -_080A03F6: - lsls r0, 2 - ldr r1, =_080A0404 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080A0404: - .4byte _080A0418 - .4byte _080A0490 - .4byte _080A04A2 - .4byte _080A04D4 - .4byte _080A04F8 -_080A0418: - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl SetVBlankCallback - bl remove_some_task - movs r2, 0xA0 - lsls r2, 19 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, =0x040000d4 - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - ldr r0, =0x81000200 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r2, 0xC0 - lsls r2, 19 - movs r3, 0xC0 - lsls r3, 9 - mov r4, sp - movs r6, 0 - movs r5, 0x80 - lsls r5, 5 - ldr r7, =0x81000800 - movs r0, 0x81 - lsls r0, 24 - mov r12, r0 -_080A045A: - strh r6, [r4] - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - str r7, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r2, r5 - subs r3, r5 - cmp r3, r5 - bhi _080A045A - strh r6, [r4] - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - lsrs r0, r3, 1 - mov r2, r12 - orrs r0, r2 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - b _080A04FC - .pool -_080A0490: - bl ResetAllObjectData - bl ResetTasks - bl sub_80A1A74 - bl dp12_8087EA4 - b _080A04FC -_080A04A2: - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085105A8 - movs r0, 0 - movs r2, 0x1 - bl InitBgsFromTemplates - ldr r0, =gUnknown_085105AC - bl InitWindows - movs r0, 0 - movs r1, 0x8 - movs r2, 0xE0 - bl box_border_load_tiles_and_pal - movs r0, 0xF0 - bl sub_81978B0 - b _080A04FC - .pool -_080A04D4: - movs r0, 0 - bl ShowBg - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - ldr r0, =sub_80A03D8 - bl SetVBlankCallback - movs r0, 0x1 - bl EnableInterrupts - b _080A04FC - .pool -_080A04F8: - movs r0, 0x1 - b _080A0506 -_080A04FC: - mov r1, r8 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0 -_080A0506: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80A03E4 - - thumb_func_start sub_80A0514 -sub_80A0514: @ 80A0514 - push {lr} - ldr r0, =0x030026f8 - bl sub_80A03E4 - cmp r0, 0 - beq _080A052E - ldr r0, =sub_80A0550 - movs r1, 0x50 - bl CreateTask - ldr r0, =sub_80A0540 - bl SetMainCallback2 -_080A052E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A0514 - - thumb_func_start sub_80A0540 -sub_80A0540: @ 80A0540 - push {lr} - bl RunTasks - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_80A0540 - - thumb_func_start sub_80A0550 -sub_80A0550: @ 80A0550 - push {r4-r6,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080A0570 - b _080A06A8 -_080A0570: - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0x6 - bls _080A057A - b _080A06A8 -_080A057A: - lsls r0, 2 - ldr r1, =_080A0590 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080A0590: - .4byte _080A05AC - .4byte _080A0630 - .4byte _080A063C - .4byte _080A065C - .4byte _080A0670 - .4byte _080A0688 - .4byte _080A0698 -_080A05AC: - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_082C8959 - movs r4, 0 - str r4, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r6, 0x1 - str r6, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - movs r3, 0xFF - bl AddTextPrinterParametrized - movs r0, 0 - movs r1, 0x8 - movs r2, 0xE - bl sub_8098858 - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _080A0620 - bl InUnionRoom - cmp r0, 0 - beq _080A0620 - bl sub_800A07C - cmp r0, 0 - beq _080A061C - strh r6, [r5] - b _080A06A8 - .pool -_080A061C: - movs r0, 0x5 - b _080A06A6 -_080A0620: - ldr r0, =0x03002700 - movs r1, 0x1 - strb r1, [r0] - movs r0, 0x1 - b _080A06A6 - .pool -_080A0630: - bl sub_8076D5C - bl sub_8153430 - movs r0, 0x2 - b _080A06A6 -_080A063C: - bl sub_8153474 - lsls r0, 24 - cmp r0, 0 - beq _080A06A8 - bl sav2_gender2_inplace_and_xFE - movs r0, 0x3 - strh r0, [r5] - ldr r1, =0x03002700 - movs r0, 0 - strb r0, [r1] - b _080A06A8 - .pool -_080A065C: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - movs r0, 0x4 - b _080A06A6 -_080A0670: - bl FreeAllWindowBuffers - ldr r0, =0x030022c0 - ldr r0, [r0, 0x8] - bl SetMainCallback2 - adds r0, r4, 0 - bl DestroyTask - b _080A06A8 - .pool -_080A0688: - ldr r0, =sub_8153688 - movs r1, 0x5 - bl CreateTask - movs r0, 0x6 - b _080A06A6 - .pool -_080A0698: - ldr r0, =sub_8153688 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _080A06A8 - movs r0, 0x3 -_080A06A6: - strh r0, [r5] -_080A06A8: - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A0550 - - thumb_func_start sub_80A06B4 -sub_80A06B4: @ 80A06B4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - ldr r0, =gUnknown_085105BC - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0xC] - str r1, [sp, 0x10] - ldr r0, =0x00000861 - mov r10, r0 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _080A06EC - add r0, sp, 0xC - ldrb r1, [r0, 0x4] - subs r1, 0x2 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0xffffff00 - ldr r0, [sp, 0x10] - ands r0, r2 - orrs r0, r1 - str r0, [sp, 0x10] -_080A06EC: - ldr r6, =0x02037622 - add r0, sp, 0xC - bl AddWindow - strb r0, [r6] - ldrb r0, [r6] - movs r1, 0 - bl sub_81973FC - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - movs r1, 0x4 - mov r9, r1 - cmp r0, 0 - bne _080A0710 - movs r0, 0x8 - mov r9, r0 -_080A0710: - movs r4, 0x1 - ldr r5, =0x02021fc4 - movs r0, 0x3 - adds r1, r5, 0 - movs r2, 0x6 - bl sub_819A344 - ldrb r0, [r6] - str r4, [sp] - movs r1, 0xFF - mov r8, r1 - str r1, [sp, 0x4] - movs r7, 0 - str r7, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0 - bl Print - movs r4, 0x11 - ldrb r0, [r6] - ldr r2, =gUnknown_085EED26 - str r4, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r7, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0 - adds r1, r5, 0 - mov r2, r9 - bl sub_819A344 - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x70 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - ldrb r0, [r6] - lsls r2, 16 - lsrs r2, 16 - adds r1, r5, 0 - movs r3, 0x11 - bl sub_819A024 - movs r4, 0x21 - ldrb r0, [r6] - ldr r2, =gUnknown_085EED2D - str r4, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r7, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0x4 - adds r1, r5, 0 - mov r2, r9 - bl sub_819A344 - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x70 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - ldrb r0, [r6] - lsls r3, r2, 24 - lsrs r3, 24 - str r4, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r7, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - bl Print - mov r0, r10 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080A0802 - movs r4, 0x31 - ldrb r0, [r6] - ldr r2, =gUnknown_085EED34 - str r4, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r7, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0x1 - adds r1, r5, 0 - mov r2, r9 - bl sub_819A344 - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x70 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - ldrb r0, [r6] - lsls r3, r2, 24 - lsrs r3, 24 - str r4, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r7, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - bl Print -_080A0802: - adds r4, 0x10 - ldrb r0, [r6] - ldr r2, =gUnknown_085EED3C - lsls r4, 24 - lsrs r4, 24 - str r4, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r7, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0x2 - adds r1, r5, 0 - mov r2, r9 - bl sub_819A344 - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x70 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - ldrb r0, [r6] - lsls r3, r2, 24 - lsrs r3, 24 - str r4, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r7, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - bl Print - ldrb r0, [r6] - 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 - .pool - thumb_func_end sub_80A06B4 - - thumb_func_start sub_80A0888 -sub_80A0888: @ 80A0888 - push {r4,lr} - ldr r4, =0x02037622 - ldrb r0, [r4] - movs r1, 0 - bl sub_819746C - ldrb r0, [r4] - bl RemoveWindow - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A0888 - - thumb_func_start sub_80A08A4 -sub_80A08A4: @ 80A08A4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =sub_8153688 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _080A08C0 - adds r0, r4, 0 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running -_080A08C0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A08A4 - - thumb_func_start sub_80A08CC -sub_80A08CC: @ 80A08CC - push {r4,r5,lr} - ldr r0, =sub_8153688 - movs r1, 0x5 - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r5 - movs r1, 0x1 - strh r1, [r0, 0xC] - ldr r0, =sub_80A08A4 - movs r1, 0x6 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r5 - strh r4, [r1, 0xA] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A08CC - - thumb_func_start sub_80A0914 -sub_80A0914: @ 80A0914 - push {lr} - bl get_start_menu_window_id_maybe - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_819746C - bl remove_start_menu_window_maybe - bl sub_80984F4 - bl script_env_2_disable - pop {r0} - bx r0 - thumb_func_end sub_80A0914 - - thumb_func_start sub_80A0934 -sub_80A0934: @ 80A0934 - push {lr} - movs r0, 0x5 - bl audio_play - bl sub_80A0914 - pop {r0} - bx r0 - thumb_func_end sub_80A0934 - - thumb_func_start append_byte -append_byte: @ 80A0944 - ldrb r3, [r1] - adds r0, r3 - strb r2, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - bx lr - thumb_func_end append_byte - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_8034C54.s b/asm/rom_8034C54.s new file mode 100644 index 000000000..40aa9bc45 --- /dev/null +++ b/asm/rom_8034C54.s @@ -0,0 +1,92399 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8034C54 +sub_8034C54: @ 8034C54 + push {r4-r7,lr} + adds r4, r0, 0 + ldr r5, =0x02022e10 + ldr r0, [r5] + cmp r0, 0 + beq _08034C64 + bl sub_8034CC8 +_08034C64: + movs r0, 0x8 + bl Alloc + str r0, [r5] + cmp r0, 0 + bne _08034C78 + movs r0, 0 + b _08034CC0 + .pool +_08034C78: + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + bl Alloc + ldr r1, [r5] + str r0, [r1, 0x4] + cmp r0, 0 + bne _08034C94 + adds r0, r1, 0 + bl Free + movs r0, 0 + b _08034CC0 +_08034C94: + str r4, [r1] + movs r3, 0 + cmp r3, r4 + bcs _08034CBE + movs r7, 0 + movs r6, 0xFF + movs r2, 0 +_08034CA2: + ldr r0, [r5] + ldr r0, [r0, 0x4] + adds r0, r2, r0 + strb r7, [r0] + ldr r0, [r5] + ldr r1, [r0, 0x4] + adds r1, r2, r1 + ldrb r0, [r1, 0x1] + orrs r0, r6 + strb r0, [r1, 0x1] + adds r2, 0x1C + adds r3, 0x1 + cmp r3, r4 + bcc _08034CA2 +_08034CBE: + movs r0, 0x1 +_08034CC0: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8034C54 + + thumb_func_start sub_8034CC8 +sub_8034CC8: @ 8034CC8 + push {r4,r5,lr} + ldr r2, =0x02022e10 + ldr r1, [r2] + cmp r1, 0 + beq _08034D08 + ldr r0, [r1, 0x4] + cmp r0, 0 + beq _08034CFC + movs r4, 0 + ldr r0, [r1] + cmp r4, r0 + bcs _08034CF2 + adds r5, r2, 0 +_08034CE2: + adds r0, r4, 0 + bl sub_80353DC + adds r4, 0x1 + ldr r0, [r5] + ldr r0, [r0] + cmp r4, r0 + bcc _08034CE2 +_08034CF2: + ldr r0, =0x02022e10 + ldr r0, [r0] + ldr r0, [r0, 0x4] + bl Free +_08034CFC: + ldr r4, =0x02022e10 + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] +_08034D08: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8034CC8 + + thumb_func_start sub_8034D14 +sub_8034D14: @ 8034D14 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r8, r0 + mov r10, r1 + adds r5, r2, 0 + ldr r6, =0x02022e10 + ldr r0, [r6] + cmp r0, 0 + beq _08034DD4 + ldr r1, [r0, 0x4] + mov r0, r8 + lsls r2, r0, 3 + subs r0, r2, r0 + lsls r4, r0, 2 + adds r1, r4, r1 + ldrb r0, [r1] + mov r9, r2 + cmp r0, 0 + bne _08034DD4 + ldrb r0, [r5, 0x1] + bl sub_8035518 + ldr r1, [r6] + ldr r1, [r1, 0x4] + adds r1, r4, r1 + strb r0, [r1, 0x1] + ldr r0, [r6] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + ldrb r0, [r0, 0x1] + cmp r0, 0xFF + beq _08034DD4 + ldr r0, [r5, 0x8] + ldrh r0, [r0, 0x6] + bl GetObjectTileRangeStartByTag + ldr r2, [r6] + ldr r1, [r2, 0x4] + adds r1, r4, r1 + strh r0, [r1, 0xA] + ldr r0, [r2, 0x4] + adds r0, r4, r0 + ldrh r1, [r0, 0xA] + ldr r7, =0xffff0000 + lsrs r0, r7, 16 + cmp r1, r0 + bne _08034DE0 + ldr r2, [r5, 0x8] + ldrh r0, [r2, 0x4] + adds r1, r2, 0 + cmp r0, 0 + beq _08034D94 + adds r0, r1, 0 + bl LoadObjectPic + b _08034DB4 + .pool +_08034D94: + ldr r0, [r2] + ldr r1, [r2, 0x4] + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, [r2] + bl sub_8034974 + lsls r0, 16 + lsrs r0, 16 + ldr r1, [sp, 0x4] + ands r1, r7 + orrs r1, r0 + str r1, [sp, 0x4] + mov r0, sp + bl LoadCompressedObjectPic +_08034DB4: + ldr r1, [r6] + ldr r1, [r1, 0x4] + adds r1, r4, r1 + strh r0, [r1, 0xA] + ldr r0, =0x02022e10 + ldr r0, [r0] + ldr r1, [r0, 0x4] + mov r2, r9 + mov r3, r8 + subs r0, r2, r3 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0, 0xA] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _08034DE0 +_08034DD4: + movs r0, 0 + b _08034EE8 + .pool +_08034DE0: + ldr r0, [r5, 0xC] + ldrh r0, [r0, 0x4] + bl IndexOfObjectPaletteTag + ldr r6, =0x02022e10 + ldr r1, [r6] + ldr r1, [r1, 0x4] + mov r4, r9 + mov r3, r8 + subs r2, r4, r3 + lsls r4, r2, 2 + adds r1, r4, r1 + strb r0, [r1, 0x4] + ldr r0, [r6] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + ldrb r0, [r0, 0x4] + cmp r0, 0xFF + bne _08034E14 + ldr r0, [r5, 0xC] + bl LoadTaggedObjectPalette + ldr r1, [r6] + ldr r1, [r1, 0x4] + adds r1, r4, r1 + strb r0, [r1, 0x4] +_08034E14: + ldr r0, [r6] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r0, [r5] + lsls r0, 30 + lsrs r0, 30 + strb r0, [r1, 0x2] + ldr r0, [r6] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + ldrb r1, [r5, 0x1] + strb r1, [r0, 0x3] + ldr r2, [r6] + ldr r0, [r2, 0x4] + adds r0, r4, r0 + ldrh r1, [r5, 0x4] + strh r1, [r0, 0xC] + ldr r0, [r2, 0x4] + adds r0, r4, r0 + ldrh r1, [r5, 0x6] + strh r1, [r0, 0xE] + ldr r1, [r2, 0x4] + adds r1, r4, r1 + ldrb r0, [r5] + lsls r0, 28 + lsrs r0, 30 + strb r0, [r1, 0x6] + ldr r0, [r6] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r0, [r5] + lsls r0, 26 + lsrs r0, 30 + strb r0, [r1, 0x5] + ldr r0, [r6] + ldr r1, [r0, 0x4] + adds r1, r4, r1 + ldrb r0, [r5] + lsrs r0, 6 + strb r0, [r1, 0x7] + ldr r0, [r6] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + ldrb r1, [r5, 0x2] + strb r1, [r0, 0x8] + ldrb r1, [r5] + lsls r0, r1, 28 + lsrs r0, 30 + lsls r1, 26 + lsrs r1, 30 + bl sub_80355F8 + ldr r1, [r6] + ldr r1, [r1, 0x4] + adds r1, r4, r1 + strb r0, [r1, 0x9] + ldr r2, [r6] + ldr r0, [r2, 0x4] + adds r0, r4, r0 + ldr r1, [r5, 0x8] + ldrh r1, [r1, 0x6] + strh r1, [r0, 0x10] + ldr r0, [r2, 0x4] + adds r0, r4, r0 + ldr r1, [r5, 0xC] + ldrh r1, [r1, 0x4] + strh r1, [r0, 0x12] + ldr r0, [r2, 0x4] + adds r0, r4, r0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r6] + ldr r0, [r0, 0x4] + adds r0, r4, r0 + str r1, [r0, 0x14] + movs r3, 0x1 + ldrb r0, [r5, 0x1] + cmp r3, r0 + bcs _08034ECA +_08034EB2: + ldr r0, [r6] + ldr r2, [r0, 0x4] + adds r2, r4, r2 + ldr r1, [r2, 0x14] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + str r0, [r2, 0x14] + adds r3, 0x1 + ldrb r2, [r5, 0x1] + cmp r3, r2 + bcc _08034EB2 +_08034ECA: + ldr r0, =0x02022e10 + ldr r0, [r0] + mov r3, r9 + mov r4, r8 + subs r1, r3, r4 + lsls r1, 2 + ldr r0, [r0, 0x4] + adds r0, r1 + bl sub_8034EFC + mov r0, r8 + mov r1, r10 + bl sub_8035044 + movs r0, 0x1 +_08034EE8: + 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_8034D14 + + thumb_func_start sub_8034EFC +sub_8034EFC: @ 8034EFC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r4, r0, 0 + ldrb r5, [r4, 0x1] + movs r0, 0xC + ldrsh r7, [r4, r0] + ldrb r0, [r4, 0x3] + adds r0, 0x1 + mov r8, r0 + mov r1, sp + movs r0, 0 + strh r0, [r1] + lsls r1, r5, 3 + ldr r2, =0x030022f8 + mov r9, r2 + add r1, r9 + mov r0, r8 + lsls r2, r0, 2 + movs r0, 0x80 + lsls r0, 17 + orrs r2, r0 + mov r0, sp + bl CpuSet + movs r6, 0 + ldrb r5, [r4, 0x1] + cmp r6, r8 + bcs _08034FCE + movs r1, 0x3F + mov r10, r1 + movs r2, 0xD + negs r2, r2 + mov r9, r2 +_08034F46: + lsls r0, r5, 3 + ldr r1, =0x030022c0 + adds r3, r0, r1 + ldrh r1, [r4, 0xE] + adds r0, r3, 0 + adds r0, 0x38 + strb r1, [r0] + ldr r2, =0x000001ff + adds r0, r2, 0 + adds r1, r7, 0 + ands r1, r0 + ldrh r2, [r3, 0x3A] + ldr r0, =0xfffffe00 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x3A] + ldrb r1, [r4, 0x6] + movs r0, 0x39 + adds r0, r3 + mov r12, r0 + lsls r1, 6 + ldrb r2, [r0] + mov r0, r10 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + ldrb r1, [r4, 0x5] + movs r2, 0x3B + adds r2, r3 + mov r12, r2 + lsls r1, 6 + ldrb r2, [r2] + mov r0, r10 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + ldrh r0, [r4, 0xA] + ldr r1, =0x000003ff + ands r1, r0 + ldrh r2, [r3, 0x3C] + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x3C] + adds r3, 0x3D + movs r0, 0x3 + ldrb r1, [r4, 0x7] + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3] + mov r0, r9 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + ldrb r2, [r4, 0x4] + lsls r2, 4 + movs r1, 0xF + ands r0, r1 + orrs r0, r2 + strb r0, [r3] + ldrb r0, [r4, 0x8] + adds r7, r0 + adds r6, 0x1 + adds r5, 0x1 + cmp r6, r8 + bcc _08034F46 +_08034FCE: + subs r5, 0x1 + ldr r0, =0x030022c0 + lsls r3, r5, 3 + adds r3, r0 + movs r2, 0xC + ldrsh r1, [r4, r2] + ldrb r0, [r4, 0x8] + subs r1, r0 + ldr r2, =0x000001ff + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r3, 0x3A] + ldr r0, =0xfffffe00 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x3A] + adds r2, r3, 0 + adds r2, 0x39 + ldrb r1, [r2] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r4, 0x9] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 1 + ldrh r4, [r4, 0xA] + adds r1, r4 + ldr r2, =0x000003ff + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r3, 0x3C] + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x3C] + 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_8034EFC + + thumb_func_start sub_8035044 +sub_8035044: @ 8035044 + push {r4-r6,lr} + adds r3, r0, 0 + adds r4, r1, 0 + ldr r0, =0x02022e10 + ldr r1, [r0] + adds r6, r0, 0 + cmp r1, 0 + beq _080350A8 + ldr r2, [r1, 0x4] + lsls r1, r3, 3 + subs r0, r1, r3 + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2] + adds r5, r1, 0 + cmp r0, 0 + beq _080350A8 + str r4, [r2, 0x18] + cmp r4, 0 + bge _08035078 + movs r2, 0x1 + negs r4, r4 + b _0803507A + .pool +_08035078: + movs r2, 0 +_0803507A: + ldr r0, [r6] + ldr r1, [r0, 0x4] + subs r0, r5, r3 + lsls r0, 2 + adds r0, r1 + ldrb r3, [r0, 0x2] + cmp r3, 0x1 + beq _0803509A + cmp r3, 0x1 + ble _08035092 + cmp r3, 0x2 + beq _080350A2 +_08035092: + adds r1, r4, 0 + bl sub_80350B0 + b _080350A8 +_0803509A: + adds r1, r4, 0 + bl sub_8035164 + b _080350A8 +_080350A2: + adds r1, r4, 0 + bl sub_80352C0 +_080350A8: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8035044 + + thumb_func_start sub_80350B0 +sub_80350B0: @ 80350B0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r0 + mov r9, r1 + str r2, [sp] + ldr r5, [r0, 0x14] + ldrb r7, [r0, 0x1] + ldr r0, =0x030022c0 + mov r10, r0 + cmp r5, 0 + beq _0803511A + lsls r0, r7, 3 + adds r0, 0x3C + mov r1, r10 + adds r6, r0, r1 +_080350D6: + mov r0, r9 + adds r1, r5, 0 + bl __udivsi3 + adds r4, r0, 0 + adds r0, r4, 0 + muls r0, r5 + mov r2, r9 + subs r2, r0 + mov r9, r2 + adds r0, r5, 0 + movs r1, 0xA + bl __udivsi3 + adds r5, r0, 0 + mov r1, r8 + ldrb r0, [r1, 0x9] + adds r1, r4, 0 + muls r1, r0 + mov r2, r8 + ldrh r2, [r2, 0xA] + adds r1, r2 + ldr r2, =0x000003ff + adds r0, r2, 0 + ands r1, r0 + ldrh r0, [r6] + ldr r2, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r6] + adds r6, 0x8 + adds r7, 0x1 + cmp r5, 0 + bne _080350D6 +_0803511A: + ldr r0, [sp] + cmp r0, 0 + beq _08035140 + lsls r0, r7, 3 + add r0, r10 + adds r0, 0x39 + ldrb r2, [r0] + movs r1, 0x4 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + b _08035154 + .pool +_08035140: + lsls r2, r7, 3 + add r2, r10 + adds r2, 0x39 + ldrb r1, [r2] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] +_08035154: + 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_80350B0 + + thumb_func_start sub_8035164 +sub_8035164: @ 8035164 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r6, r0, 0 + mov r8, r1 + str r2, [sp] + ldr r5, [r6, 0x14] + ldr r3, =0x03000dd4 + ldrb r0, [r6, 0x1] + str r0, [r3] + ldr r2, =0x03000dd8 + movs r0, 0 + str r0, [r2] + ldr r1, =0x03000ddc + subs r0, 0x1 + str r0, [r1] + adds r7, r3, 0 + mov r10, r1 + ldr r0, =0x030022c0 + mov r9, r0 + cmp r5, 0 + beq _0803524C +_08035196: + mov r0, r8 + adds r1, r5, 0 + bl __udivsi3 + adds r4, r0, 0 + adds r0, r4, 0 + muls r0, r5 + mov r1, r8 + subs r1, r0 + mov r8, r1 + adds r0, r5, 0 + movs r1, 0xA + bl __udivsi3 + adds r5, r0, 0 + cmp r4, 0 + bne _080351C8 + mov r2, r10 + ldr r1, [r2] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080351C8 + cmp r5, 0 + bne _08035224 +_080351C8: + ldr r2, [r7] + lsls r2, 3 + add r2, r9 + ldrb r0, [r6, 0x9] + adds r3, r4, 0 + muls r3, r0 + ldrh r4, [r6, 0xA] + adds r3, r4 + ldr r1, =0x000003ff + adds r0, r1, 0 + ands r3, r0 + ldrh r0, [r2, 0x3C] + ldr r4, =0xfffffc00 + adds r1, r4, 0 + ands r0, r1 + orrs r0, r3 + strh r0, [r2, 0x3C] + adds r2, 0x39 + ldrb r0, [r2] + movs r1, 0x4 + negs r1, r1 + ands r0, r1 + strb r0, [r2] + mov r2, r10 + ldr r1, [r2] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _0803523A + ldr r4, =0x03000dd8 + ldr r0, [r4] + str r0, [r2] + b _0803523A + .pool +_08035224: + ldr r0, [r7] + lsls r0, 3 + add r0, r9 + adds r0, 0x39 + ldrb r1, [r0] + movs r2, 0x4 + negs r2, r2 + ands r1, r2 + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0] +_0803523A: + ldr r0, [r7] + adds r0, 0x1 + str r0, [r7] + ldr r4, =0x03000dd8 + ldr r0, [r4] + adds r0, 0x1 + str r0, [r4] + cmp r5, 0 + bne _08035196 +_0803524C: + ldr r0, [sp] + cmp r0, 0 + beq _08035298 + ldr r1, [r7] + lsls r1, 3 + add r1, r9 + adds r1, 0x39 + ldrb r2, [r1] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r3, [r7] + lsls r3, 3 + add r3, r9 + movs r1, 0xC + ldrsh r2, [r6, r1] + mov r4, r10 + ldr r0, [r4] + subs r0, 0x1 + ldrb r1, [r6, 0x8] + muls r0, r1 + adds r2, r0 + ldr r1, =0x000001ff + adds r0, r1, 0 + ands r2, r0 + ldrh r1, [r3, 0x3A] + ldr r0, =0xfffffe00 + ands r0, r1 + orrs r0, r2 + strh r0, [r3, 0x3A] + b _080352AE + .pool +_08035298: + ldr r0, [r7] + lsls r0, 3 + add r0, r9 + adds r0, 0x39 + ldrb r2, [r0] + movs r1, 0x4 + negs r1, r1 + ands r1, r2 + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0] +_080352AE: + 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_8035164 + + thumb_func_start sub_80352C0 +sub_80352C0: @ 80352C0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r8, r0 + mov r10, r1 + str r2, [sp] + ldr r5, [r0, 0x14] + ldrb r3, [r0, 0x1] + movs r0, 0 + str r0, [sp, 0x4] + mov r9, r0 + cmp r5, 0 + beq _0803535A +_080352E0: + lsls r0, r3, 3 + adds r1, r0, 0 + adds r1, 0x39 + ldr r2, =0x030022c0 + adds r7, r1, r2 + adds r0, 0x3C + adds r6, r0, r2 +_080352EE: + mov r0, r10 + adds r1, r5, 0 + str r3, [sp, 0x8] + bl __udivsi3 + adds r4, r0, 0 + adds r0, r4, 0 + muls r0, r5 + mov r1, r10 + subs r1, r0 + mov r10, r1 + adds r0, r5, 0 + movs r1, 0xA + bl __udivsi3 + adds r5, r0, 0 + ldr r3, [sp, 0x8] + cmp r4, 0 + bne _0803531E + ldr r2, [sp, 0x4] + cmp r2, 0 + bne _0803531E + cmp r5, 0 + bne _080352E0 +_0803531E: + movs r0, 0x1 + str r0, [sp, 0x4] + mov r1, r8 + ldrb r0, [r1, 0x9] + adds r2, r4, 0 + muls r2, r0 + ldrh r4, [r1, 0xA] + adds r2, r4 + ldr r1, =0x000003ff + adds r0, r1, 0 + ands r2, r0 + ldrh r0, [r6] + ldr r4, =0xfffffc00 + adds r1, r4, 0 + ands r0, r1 + orrs r0, r2 + strh r0, [r6] + ldrb r0, [r7] + movs r2, 0x4 + negs r2, r2 + adds r1, r2, 0 + ands r0, r1 + strb r0, [r7] + adds r7, 0x8 + adds r6, 0x8 + adds r3, 0x1 + movs r4, 0x1 + add r9, r4 + cmp r5, 0 + bne _080352EE +_0803535A: + mov r0, r8 + ldrb r0, [r0, 0x3] + cmp r9, r0 + bge _0803538A + ldr r1, =0x030022c0 + movs r5, 0x4 + negs r5, r5 + movs r4, 0x2 + lsls r0, r3, 3 + adds r0, 0x39 + adds r2, r0, r1 +_08035370: + ldrb r1, [r2] + adds r0, r5, 0 + ands r0, r1 + orrs r0, r4 + strb r0, [r2] + adds r2, 0x8 + adds r3, 0x1 + movs r1, 0x1 + add r9, r1 + mov r0, r8 + ldrb r0, [r0, 0x3] + cmp r9, r0 + blt _08035370 +_0803538A: + ldr r1, [sp] + cmp r1, 0 + beq _080353B0 + lsls r0, r3, 3 + ldr r2, =0x030022c0 + adds r0, r2 + adds r0, 0x39 + ldrb r2, [r0] + movs r1, 0x4 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + b _080353C6 + .pool +_080353B0: + lsls r2, r3, 3 + ldr r4, =0x030022c0 + adds r2, r4 + adds r2, 0x39 + ldrb r1, [r2] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] +_080353C6: + 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_80352C0 + + thumb_func_start sub_80353DC +sub_80353DC: @ 80353DC + push {r4-r7,lr} + adds r4, r0, 0 + ldr r0, =0x02022e10 + ldr r0, [r0] + cmp r0, 0 + beq _0803546E + ldr r2, [r0, 0x4] + lsls r1, r4, 3 + subs r0, r1, r4 + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2] + adds r5, r1, 0 + cmp r0, 0 + beq _0803546E + ldrb r3, [r2, 0x3] + adds r0, r3, 0x1 + ldrb r2, [r2, 0x1] + cmp r0, 0 + beq _08035426 + ldr r1, =0x030022c0 + movs r7, 0x4 + negs r7, r7 + movs r6, 0x2 + adds r3, r0, 0 + lsls r0, r2, 3 + adds r0, 0x39 + adds r2, r0, r1 +_08035414: + ldrb r1, [r2] + adds r0, r7, 0 + ands r0, r1 + orrs r0, r6 + strb r0, [r2] + subs r3, 0x1 + adds r2, 0x8 + cmp r3, 0 + bne _08035414 +_08035426: + adds r0, r4, 0 + bl sub_8035570 + cmp r0, 0 + bne _08035442 + ldr r0, =0x02022e10 + ldr r0, [r0] + ldr r1, [r0, 0x4] + subs r0, r5, r4 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x10] + bl FreeObjectTilesByTag +_08035442: + adds r0, r4, 0 + bl sub_80355B4 + cmp r0, 0 + bne _0803545E + ldr r0, =0x02022e10 + ldr r0, [r0] + ldr r1, [r0, 0x4] + subs r0, r5, r4 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x12] + bl FreeObjectPaletteByTag +_0803545E: + ldr r0, =0x02022e10 + ldr r0, [r0] + ldr r1, [r0, 0x4] + subs r0, r5, r4 + lsls r0, 2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_0803546E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80353DC + + thumb_func_start sub_803547C +sub_803547C: @ 803547C + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, =0x02022e10 + ldr r1, [r0] + adds r7, r0, 0 + cmp r1, 0 + beq _0803550C + ldr r2, [r1, 0x4] + lsls r1, r4, 3 + subs r0, r1, r4 + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2] + adds r6, r1, 0 + cmp r0, 0 + beq _0803550C + ldrb r3, [r2, 0x3] + adds r1, r3, 0x1 + ldrb r0, [r2, 0x1] + cmp r5, 0 + beq _080354D8 + cmp r1, 0 + beq _0803550C + ldr r1, =0x030022c0 + movs r5, 0x4 + negs r5, r5 + movs r4, 0x2 + adds r3, 0x1 + lsls r0, 3 + adds r0, 0x39 + adds r2, r0, r1 +_080354BC: + ldrb r1, [r2] + adds r0, r5, 0 + ands r0, r1 + orrs r0, r4 + strb r0, [r2] + subs r3, 0x1 + adds r2, 0x8 + cmp r3, 0 + bne _080354BC + b _0803550C + .pool +_080354D8: + cmp r1, 0 + beq _080354FA + ldr r1, =0x030022c0 + movs r5, 0x4 + negs r5, r5 + adds r3, 0x1 + lsls r0, 3 + adds r0, 0x39 + adds r2, r0, r1 +_080354EA: + ldrb r1, [r2] + adds r0, r5, 0 + ands r0, r1 + strb r0, [r2] + subs r3, 0x1 + adds r2, 0x8 + cmp r3, 0 + bne _080354EA +_080354FA: + ldr r0, [r7] + ldr r1, [r0, 0x4] + subs r0, r6, r4 + lsls r0, 2 + adds r0, r1 + ldr r1, [r0, 0x18] + adds r0, r4, 0 + bl sub_8035044 +_0803550C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803547C + + thumb_func_start sub_8035518 +sub_8035518: @ 8035518 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r5, 0x40 + movs r3, 0 + ldr r0, =0x02022e10 + ldr r0, [r0] + ldr r2, [r0] + cmp r3, r2 + bcs _0803555A + ldr r1, [r0, 0x4] +_0803552E: + ldrb r0, [r1] + cmp r0, 0 + bne _08035548 + ldrb r0, [r1, 0x1] + cmp r0, 0xFF + beq _08035552 + ldrb r0, [r1, 0x3] + cmp r0, r4 + bhi _08035552 + ldrb r0, [r1, 0x1] + b _0803556A + .pool +_08035548: + adds r0, r5, 0x1 + ldrb r5, [r1, 0x3] + adds r0, r5 + lsls r0, 16 + lsrs r5, r0, 16 +_08035552: + adds r1, 0x1C + adds r3, 0x1 + cmp r3, r2 + bcc _0803552E +_0803555A: + adds r0, r5, r4 + adds r0, 0x1 + cmp r0, 0x80 + bgt _08035568 + lsls r0, r5, 24 + lsrs r0, 24 + b _0803556A +_08035568: + movs r0, 0xFF +_0803556A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8035518 + + thumb_func_start sub_8035570 +sub_8035570: @ 8035570 + push {r4-r6,lr} + adds r3, r0, 0 + movs r2, 0 + ldr r0, =0x02022e10 + ldr r0, [r0] + ldr r4, [r0] + cmp r2, r4 + bcs _080355AC + ldr r1, [r0, 0x4] + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r5, r0, r1 +_0803558A: + ldrb r0, [r1] + cmp r0, 0 + beq _080355A4 + cmp r2, r3 + beq _080355A4 + ldrh r0, [r1, 0x10] + ldrh r6, [r5, 0x10] + cmp r0, r6 + bne _080355A4 + movs r0, 0x1 + b _080355AE + .pool +_080355A4: + adds r1, 0x1C + adds r2, 0x1 + cmp r2, r4 + bcc _0803558A +_080355AC: + movs r0, 0 +_080355AE: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8035570 + + thumb_func_start sub_80355B4 +sub_80355B4: @ 80355B4 + push {r4-r6,lr} + adds r3, r0, 0 + movs r2, 0 + ldr r0, =0x02022e10 + ldr r0, [r0] + ldr r4, [r0] + cmp r2, r4 + bcs _080355F0 + ldr r1, [r0, 0x4] + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r5, r0, r1 +_080355CE: + ldrb r0, [r1] + cmp r0, 0 + beq _080355E8 + cmp r2, r3 + beq _080355E8 + ldrh r0, [r1, 0x12] + ldrh r6, [r5, 0x12] + cmp r0, r6 + bne _080355E8 + movs r0, 0x1 + b _080355F2 + .pool +_080355E8: + adds r1, 0x1C + adds r2, 0x1 + cmp r2, r4 + bcc _080355CE +_080355F0: + movs r0, 0 +_080355F2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80355B4 + + thumb_func_start sub_80355F8 +sub_80355F8: @ 80355F8 + ldr r2, =gUnknown_082FF1C8 + lsls r0, 2 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + bx lr + .pool + thumb_func_end sub_80355F8 + + thumb_func_start sub_8035608 +sub_8035608: @ 8035608 + push {lr} + bl ResetAllObjectData + ldr r0, =gUnknown_0831AC88 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldr r0, =sub_8035648 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8035608 + + thumb_func_start sub_8035648 +sub_8035648: @ 8035648 + push {lr} + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + pop {r0} + bx r0 + thumb_func_end sub_8035648 + + thumb_func_start trs_config +trs_config: @ 8035658 + push {r4,lr} + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0831AA08 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 11 + ands r1, r0 + cmp r1, 0 + beq _080356A4 + ldr r0, =0x02024474 + adds r0, 0x24 + movs r1, 0x1 + strb r1, [r0] + ldr r4, =0x02023060 + ldr r1, [r4] + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + movs r0, 0x2 + bl SetBgTilemapBuffer + b _080356AA + .pool +_080356A4: + ldr r0, =0x02024474 + adds r0, 0x24 + strb r1, [r0] +_080356AA: + ldr r1, =gUnknown_0831ABA0 + ldr r0, =0x02024474 + adds r0, 0x24 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl InitWindows + bl DeactivateAllTextPrinters + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end trs_config + + thumb_func_start c2_berry_program_update_menu +c2_berry_program_update_menu: @ 80356D0 + push {lr} + movs r0, 0x2 + bl DisableInterrupts + movs r0, 0xC5 + bl EnableInterrupts + bl trs_config + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + ldr r1, =0x0000b040 + movs r0, 0 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end c2_berry_program_update_menu + + thumb_func_start sub_803570C +sub_803570C: @ 803570C + push {lr} + movs r0, 0x2 + movs r1, 0x12 + movs r2, 0x10 + bl sub_809882C + movs r0, 0x2 + movs r1, 0x22 + movs r2, 0x10 + bl sub_809882C + ldr r0, =gUnknown_08D85600 + movs r1, 0x50 + movs r2, 0x20 + bl decompress_palette + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0803575A + movs r0, 0x70 + bl sub_81978B0 + movs r0, 0 + movs r1, 0x30 + movs r2, 0x70 + bl copy_textbox_border_tile_patterns_to_vram + ldr r0, =0x02037714 + adds r0, 0xEC + movs r1, 0 + strh r1, [r0] + ldr r1, =0x02037c00 + movs r2, 0x1 + bl CpuSet +_0803575A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_803570C + + thumb_func_start load_battle_oval_graphics +load_battle_oval_graphics: @ 8035770 + push {r4,r5,lr} + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r0, =0x023f0902 + ands r0, r1 + cmp r0, 0 + beq _080357B0 + ldr r0, =gUnknown_08D7C440 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7CA28 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7C9EC + b _08035A52 + .pool +_080357B0: + movs r0, 0x80 + lsls r0, 21 + ands r0, r1 + cmp r0, 0 + beq _080357E4 + ldr r0, =gUnknown_08D7BB14 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7C154 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7DF30 + b _08035A52 + .pool +_080357E4: + movs r0, 0x80 + lsls r0, 22 + ands r0, r1 + cmp r0, 0 + beq _08035818 + ldr r0, =gUnknown_08D7A108 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7A720 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7DEF4 + b _08035A52 + .pool +_08035818: + movs r0, 0x80 + lsls r0, 23 + ands r0, r1 + cmp r0, 0 + beq _0803584C + ldr r0, =gUnknown_08D7D590 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7DC04 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7E234 + b _08035A52 + .pool +_0803584C: + movs r0, 0x8 + ands r1, r0 + cmp r1, 0 + beq _080358C4 + ldr r2, =gTrainers + ldr r0, =0x02038bca + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0x20 + bne _08035898 + ldr r0, =gUnknown_08D7C440 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7CA28 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7DFC4 + b _08035A52 + .pool +_08035898: + cmp r0, 0x26 + bne _080358C4 + ldr r0, =gUnknown_08D7CCD8 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7D2E0 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7E1F8 + b _08035A52 + .pool +_080358C4: + bl sav1_map_get_battletype + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8 + bhi _08035904 + lsls r0, 2 + ldr r1, =_080358E0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080358E0: + .4byte _08035904 + .4byte _08035950 + .4byte _08035978 + .4byte _080359A0 + .4byte _080359C8 + .4byte _080359F0 + .4byte _08035A18 + .4byte _08035A40 + .4byte _08035A70 +_08035904: + ldr r4, =gUnknown_0831ABA8 + ldr r5, =0x02022ff0 + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + ldr r1, =0x06008000 + bl LZDecompressVram + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0x4 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x0600d000 + bl LZDecompressVram + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r4, 0x10 + adds r0, r4 + ldr r0, [r0] + b _08035A52 + .pool +_08035950: + ldr r0, =gUnknown_08D7C440 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7CA28 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7DF88 + b _08035A52 + .pool +_08035978: + ldr r0, =gUnknown_08D7CCD8 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7D2E0 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7E060 + b _08035A52 + .pool +_080359A0: + ldr r0, =gUnknown_08D7CCD8 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7D2E0 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7E000 + b _08035A52 + .pool +_080359C8: + ldr r0, =gUnknown_08D7CCD8 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7D2E0 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7E0CC + b _08035A52 + .pool +_080359F0: + ldr r0, =gUnknown_08D7CCD8 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7D2E0 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7E11C + b _08035A52 + .pool +_08035A18: + ldr r0, =gUnknown_08D7CCD8 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7D2E0 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7E164 + b _08035A52 + .pool +_08035A40: + ldr r0, =gUnknown_08D7CCD8 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7D2E0 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7E1A8 +_08035A52: + movs r1, 0x20 + movs r2, 0x60 + bl decompress_palette + b _08035A8A + .pool +_08035A70: + ldr r0, =gUnknown_08D7C440 + ldr r1, =0x06008000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7CA28 + ldr r1, =0x0600d000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7C9EC + movs r1, 0x20 + movs r2, 0x60 + bl decompress_palette +_08035A8A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end load_battle_oval_graphics + + thumb_func_start sub_8035AA4 +sub_8035AA4: @ 8035AA4 + push {lr} + ldr r0, =gUnknown_08C00000 + movs r1, 0xC0 + lsls r1, 19 + bl LZDecompressVram + ldr r1, =gUnknown_08C00524 + movs r0, 0 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r0, =gUnknown_08C004E0 + movs r1, 0 + movs r2, 0x40 + bl decompress_palette + bl sub_803570C + bl load_battle_oval_graphics + pop {r0} + bx r0 + .pool + thumb_func_end sub_8035AA4 + + thumb_func_start sub_8035AE4 +sub_8035AE4: @ 8035AE4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + ldr r4, [sp, 0x34] + lsls r0, 24 + lsrs r6, r0, 24 + adds r7, r6, 0 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r3, 24 + mov r12, r3 + lsls r4, 24 + lsrs r4, 24 + mov r9, r4 + movs r4, 0 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08035BCC + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + movs r2, 0x12 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _08035B56 + cmp r5, 0x1 + beq _08035B7E + cmp r5, 0x1 + bgt _08035B44 + cmp r5, 0 + beq _08035B4E + b _08035B88 + .pool +_08035B44: + cmp r5, 0x2 + beq _08035B52 + cmp r5, 0x3 + beq _08035B72 + b _08035B88 +_08035B4E: + ldrh r0, [r1, 0xE] + b _08035B74 +_08035B52: + ldrh r1, [r1, 0xE] + b _08035B80 +_08035B56: + cmp r5, 0x1 + beq _08035B72 + cmp r5, 0x1 + bgt _08035B64 + cmp r5, 0 + beq _08035B6E + b _08035B88 +_08035B64: + cmp r5, 0x2 + beq _08035B7A + cmp r5, 0x3 + beq _08035B7E + b _08035B88 +_08035B6E: + ldrh r0, [r1, 0xE] + b _08035B74 +_08035B72: + ldrh r0, [r1, 0x10] +_08035B74: + movs r4, 0x3F + ands r4, r0 + b _08035B88 +_08035B7A: + ldrh r1, [r1, 0xE] + b _08035B80 +_08035B7E: + ldrh r1, [r1, 0x10] +_08035B80: + movs r0, 0xFC + lsls r0, 4 + ands r0, r1 + lsrs r4, r0, 6 +_08035B88: + movs r2, 0 + movs r6, 0x3 + ldr r0, =0x00006001 + adds r5, r0, 0 + add r3, sp, 0xC +_08035B92: + lsls r1, r2, 1 + adds r0, r6, 0 + lsls r0, r1 + ands r0, r4 + asrs r0, r1 + adds r0, r5 + strh r0, [r3] + adds r3, 0x2 + adds r2, 0x1 + cmp r2, 0x2 + ble _08035B92 + movs r0, 0x3 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + mov r0, r8 + add r1, sp, 0xC + mov r2, r12 + mov r3, r9 + bl CopyToBgTilemapBufferRect_ChangePalette + mov r0, r8 + bl CopyBgTilemapBufferToVram + b _08035C36 + .pool +_08035BCC: + ldr r0, =0x02024474 + adds r0, 0x25 + ldrb r0, [r0] + cmp r5, r0 + bne _08035BEC + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldrh r4, [r0, 0xE] + b _08035BF8 + .pool +_08035BEC: + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldrh r4, [r0, 0x10] +_08035BF8: + movs r2, 0 + movs r6, 0x3 + ldr r0, =0x00006001 + adds r5, r0, 0 + add r3, sp, 0xC +_08035C02: + lsls r1, r2, 1 + adds r0, r6, 0 + lsls r0, r1 + ands r0, r4 + asrs r0, r1 + adds r0, r5 + strh r0, [r3] + adds r3, 0x2 + adds r2, 0x1 + cmp r2, 0x5 + ble _08035C02 + movs r0, 0x6 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + mov r0, r8 + add r1, sp, 0xC + mov r2, r12 + mov r3, r9 + bl CopyToBgTilemapBufferRect_ChangePalette + mov r0, r8 + bl CopyBgTilemapBufferToVram +_08035C36: + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8035AE4 + + thumb_func_start sub_8035C4C +sub_8035C4C: @ 8035C4C + push {lr} + ldr r0, =0x0202433a + ldrb r2, [r0] + cmp r2, 0x3 + bne _08035C68 + ldr r0, =gUnknown_085CCBAD + movs r1, 0x15 + bl battle_show_message_maybe + b _08035D68 + .pool +_08035C68: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08035CE2 + cmp r2, 0x1 + bne _08035CAE + ldr r2, =0x020229e8 + ldr r0, =0x02024474 + adds r0, 0x25 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x18] + cmp r0, 0x1 + beq _08035CFC + cmp r0, 0x1 + bgt _08035CA4 + cmp r0, 0 + beq _08035D36 + b _08035D68 + .pool +_08035CA4: + cmp r0, 0x2 + beq _08035D36 + cmp r0, 0x3 + bne _08035D68 + b _08035CFC +_08035CAE: + ldr r2, =0x020229e8 + ldr r0, =0x02024474 + adds r0, 0x25 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x18] + cmp r0, 0x1 + beq _08035D36 + cmp r0, 0x1 + bgt _08035CD8 + cmp r0, 0 + beq _08035CFC + b _08035D68 + .pool +_08035CD8: + cmp r0, 0x2 + beq _08035CFC + cmp r0, 0x3 + bne _08035D68 + b _08035D36 +_08035CE2: + cmp r2, 0x1 + bne _08035D20 + ldr r2, =0x020229e8 + ldr r0, =0x02024474 + adds r0, 0x25 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x18] + cmp r0, 0 + beq _08035D36 +_08035CFC: + ldr r0, =gUnknown_085CCB9E + movs r1, 0x17 + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCBA5 + movs r1, 0x16 + bl battle_show_message_maybe + b _08035D68 + .pool +_08035D20: + ldr r2, =0x020229e8 + ldr r0, =0x02024474 + adds r0, 0x25 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x18] + cmp r0, 0 + beq _08035D58 +_08035D36: + ldr r0, =gUnknown_085CCB9E + movs r1, 0x16 + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCBA5 + movs r1, 0x17 + bl battle_show_message_maybe + b _08035D68 + .pool +_08035D58: + ldr r0, =gUnknown_085CCB9E + movs r1, 0x17 + bl battle_show_message_maybe + ldr r0, =gUnknown_085CCBA5 + movs r1, 0x16 + bl battle_show_message_maybe +_08035D68: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8035C4C + + thumb_func_start task00_0800F6FC +task00_0800F6FC: @ 8035D74 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r7, 2 + mov r8, r0 + adds r0, r7 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _08035D96 + b _08035EC4 +_08035D96: + cmp r0, 0x1 + bgt _08035DA4 + cmp r0, 0 + beq _08035DAC + b _08036138 + .pool +_08035DA4: + cmp r0, 0x2 + bne _08035DAA + b _08035F64 +_08035DAA: + b _08036138 +_08035DAC: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08035E44 + movs r5, 0 + movs r6, 0x3 +_08035DBC: + ldr r0, =0x020229f0 + adds r1, r5, r0 + subs r0, 0x8 + adds r4, r5, r0 + ldrh r0, [r4, 0x18] + cmp r0, 0x1 + beq _08035DF4 + cmp r0, 0x1 + bgt _08035DDC + cmp r0, 0 + beq _08035DE6 + b _08035E3A + .pool +_08035DDC: + cmp r0, 0x2 + beq _08035E08 + cmp r0, 0x3 + beq _08035E22 + b _08035E3A +_08035DE6: + adds r0, r1, 0 + movs r1, 0x11 + bl battle_show_message_maybe + ldrb r1, [r4, 0x18] + movs r0, 0x4 + b _08035E14 +_08035DF4: + adds r0, r1, 0 + movs r1, 0x12 + bl battle_show_message_maybe + ldrb r1, [r4, 0x18] + movs r0, 0x4 + str r0, [sp] + adds r0, r7, 0 + movs r2, 0x2 + b _08035E1A +_08035E08: + adds r0, r1, 0 + movs r1, 0x13 + bl battle_show_message_maybe + ldrb r1, [r4, 0x18] + movs r0, 0x8 +_08035E14: + str r0, [sp] + adds r0, r7, 0 + movs r2, 0x1 +_08035E1A: + movs r3, 0x2 + bl sub_8035AE4 + b _08035E3A +_08035E22: + adds r0, r1, 0 + movs r1, 0x14 + bl battle_show_message_maybe + ldrb r1, [r4, 0x18] + movs r0, 0x8 + str r0, [sp] + adds r0, r7, 0 + movs r2, 0x2 + movs r3, 0x2 + bl sub_8035AE4 +_08035E3A: + adds r5, 0x1C + subs r6, 0x1 + cmp r6, 0 + bge _08035DBC + b _08035EA6 +_08035E44: + ldr r0, =0x02024474 + adds r0, 0x25 + ldrb r5, [r0] + movs r0, 0x1 + adds r6, r5, 0 + eors r6, r0 + adds r1, r6, 0 + ldr r4, =0x020229e8 + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x18] + cmp r0, 0 + beq _08035E66 + adds r6, r5, 0 + adds r5, r1, 0 +_08035E66: + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r4, 0x8 + adds r1, r0, r4 + adds r0, r1, 0 + movs r1, 0xF + bl battle_show_message_maybe + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r1, r0, r4 + adds r0, r1, 0 + movs r1, 0x10 + bl battle_show_message_maybe + movs r4, 0x7 + str r4, [sp] + adds r0, r7, 0 + adds r1, r5, 0 + movs r2, 0x1 + movs r3, 0x2 + bl sub_8035AE4 + str r4, [sp] + adds r0, r7, 0 + adds r1, r6, 0 + movs r2, 0x2 + movs r3, 0x2 + bl sub_8035AE4 +_08035EA6: + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _08036138 + .pool +_08035EC4: + ldr r0, =0x00002710 + bl AllocObjectPalette + lsls r0, 24 + ldr r2, =0x02037714 + lsrs r0, 19 + ldr r3, =0x0000021e + adds r0, r3 + adds r2, r0, r2 + ldr r1, =0x02037b14 + adds r0, r1 + ldr r1, =0x00007fff + strh r1, [r0] + strh r1, [r2] + ldr r0, =gUnknown_0831A9D0 + movs r1, 0x6F + movs r2, 0x50 + movs r3, 0 + bl AddObjectToFront + ldr r4, =0x0202449c + ldr r1, [r4] + adds r1, 0x7D + strb r0, [r1] + ldr r0, =gUnknown_0831A9E8 + movs r1, 0x81 + movs r2, 0x50 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r4] + adds r1, 0x7E + strb r0, [r1] + ldr r3, =0x02020630 + ldr r0, [r4] + adds r0, 0x7D + ldrb r1, [r0] + 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] + ldr r0, [r4] + adds r0, 0x7E + 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] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _08036138 + .pool +_08035F64: + movs r1, 0x12 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08035FCC + ldr r4, =0x02022e18 + ldrh r0, [r5, 0xA] + bl sine2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08035F7E + adds r0, 0x1F +_08035F7E: + asrs r1, r0, 5 + movs r2, 0x14 + negs r2, r2 + adds r0, r2, 0 + subs r0, r1 + strh r0, [r4] + ldr r4, =0x02022e1c + ldrh r0, [r5, 0xC] + bl sine2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08035F9C + adds r0, 0x1F +_08035F9C: + asrs r1, r0, 5 + movs r3, 0x8C + negs r3, r3 + adds r0, r3, 0 + subs r0, r1 + strh r0, [r4] + ldr r0, =0x02022e1a + ldr r2, =0x0000ffdc + adds r1, r2, 0 + strh r1, [r0] + ldr r0, =0x02022e1e + strh r1, [r0] + b _08036038 + .pool +_08035FCC: + ldr r4, =0x02022e18 + ldrh r0, [r5, 0xA] + bl sine2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08035FDE + adds r0, 0x1F +_08035FDE: + asrs r1, r0, 5 + movs r3, 0x14 + negs r3, r3 + adds r0, r3, 0 + subs r0, r1 + strh r0, [r4] + ldr r4, =0x02022e1a + ldrh r0, [r5, 0xA] + bl cosine2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08035FFC + adds r0, 0x1F +_08035FFC: + asrs r0, 5 + subs r0, 0xA4 + strh r0, [r4] + ldr r4, =0x02022e1c + ldrh r0, [r5, 0xC] + bl sine2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08036014 + adds r0, 0x1F +_08036014: + asrs r1, r0, 5 + movs r2, 0x8C + negs r2, r2 + adds r0, r2, 0 + subs r0, r1 + strh r0, [r4] + ldr r4, =0x02022e1e + ldrh r0, [r5, 0xC] + bl cosine2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08036032 + adds r0, 0x1F +_08036032: + asrs r0, 5 + subs r0, 0xA4 + strh r0, [r4] +_08036038: + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r1, r0, r1 + ldrh r0, [r1, 0xC] + movs r2, 0xC + ldrsh r3, [r1, r2] + mov r8, r3 + cmp r3, 0 + beq _08036070 + subs r0, 0x2 + strh r0, [r1, 0xC] + ldrh r0, [r1, 0xA] + adds r0, 0x2 + strh r0, [r1, 0xA] + b _08036138 + .pool +_08036070: + movs r3, 0x12 + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _0803607C + bl sub_8035C4C +_0803607C: + movs r0, 0x78 + bl audio_play + adds r0, r7, 0 + bl DestroyTask + ldr r4, =0x02020630 + ldr r5, =0x0202449c + ldr r0, [r5] + adds r0, 0x7D + ldrb r0, [r0] + 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] + adds r0, 0x7E + ldrb r1, [r0] + 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] + ldr r5, [r5] + adds r6, r5, 0 + adds r6, 0x7E + ldrb r0, [r6] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x40 + ldr r7, =0x000003ff + adds r0, r7, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] + adds r5, 0x7D + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + mov r1, r8 + strh r1, [r0, 0x2E] + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + strh r1, [r0, 0x2E] + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x20] + strh r1, [r0, 0x30] + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x20] + strh r1, [r0, 0x30] + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + mov r2, r8 + strh r2, [r0, 0x32] + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r2, [r0, 0x32] +_08036138: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end task00_0800F6FC + + thumb_func_start sub_8036154 +sub_8036154: @ 8036154 + push {r4,r5,lr} + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08036208 + ldr r0, =gUnknown_08D778F0 + ldr r1, =0x06004000 + bl LZDecompressVram + ldr r0, =gUnknown_08D77B0C + ldr r1, =0x06010000 + bl LZDecompressVram + ldr r0, =gUnknown_08D77AE4 + movs r1, 0x60 + movs r2, 0x20 + bl decompress_palette + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl SetBgAttribute + ldr r1, =0x00005c04 + movs r0, 0xA + bl SetGpuReg + ldr r4, =gUnknown_08D779D8 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + movs r0, 0x48 + movs r1, 0x36 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x36 + bl SetGpuReg + ldr r0, =0x02022e1a + ldr r2, =0x0000ff5c + adds r1, r2, 0 + strh r1, [r0] + ldr r0, =0x02022e1e + strh r1, [r0] + ldr r0, =gUnknown_0831AA00 + bl LoadCompressedObjectPicUsingHeap + b _080363AC + .pool +_08036208: + ldr r0, =0x023f0902 + ands r0, r1 + cmp r0, 0 + beq _0803628C + movs r0, 0x80 + lsls r0, 15 + ands r1, r0 + cmp r1, 0 + beq _08036224 + ldr r0, =0x02038bce + ldrh r1, [r0] + ldr r0, =0x00000c03 + cmp r1, r0 + bne _08036248 +_08036224: + ldr r0, =gUnknown_08D820D4 + ldr r1, =0x06004000 + bl LZDecompressVram + ldr r0, =gUnknown_08D824E4 + b _08036382 + .pool +_08036248: + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x2 + bl SetBgAttribute + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0x2 + bl SetBgAttribute + ldr r1, =gUnknown_08D857A8 + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + ldr r1, =gUnknown_08D85A1C + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + b _080363AC + .pool +_0803628C: + movs r0, 0x80 + lsls r0, 21 + ands r0, r1 + cmp r0, 0 + beq _080362B0 + ldr r0, =gUnknown_08D81610 + ldr r1, =0x06004000 + bl LZDecompressVram + ldr r0, =gUnknown_08D81E2C + b _08036382 + .pool +_080362B0: + movs r0, 0x80 + lsls r0, 22 + ands r0, r1 + cmp r0, 0 + beq _080362D4 + ldr r0, =gUnknown_08D7F9F8 + ldr r1, =0x06004000 + bl LZDecompressVram + ldr r0, =gUnknown_08D7FEC4 + b _08036382 + .pool +_080362D4: + movs r0, 0x80 + lsls r0, 23 + ands r0, r1 + cmp r0, 0 + beq _080362F8 + ldr r0, =gUnknown_08D82608 + ldr r1, =0x06004000 + bl LZDecompressVram + ldr r0, =gUnknown_08D82C70 + b _08036382 + .pool +_080362F8: + movs r0, 0x8 + ands r1, r0 + cmp r1, 0 + beq _08036350 + ldr r2, =gTrainers + ldr r0, =0x02038bca + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0x20 + bne _08036334 + ldr r0, =gUnknown_08D820D4 + ldr r1, =0x06004000 + bl LZDecompressVram + ldr r0, =gUnknown_08D824E4 + b _08036382 + .pool +_08036334: + cmp r0, 0x26 + bne _08036350 + ldr r0, =gUnknown_08D820D4 + ldr r1, =0x06004000 + bl LZDecompressVram + ldr r0, =gUnknown_08D824E4 + b _08036382 + .pool +_08036350: + bl sav1_map_get_battletype + lsls r0, 24 + cmp r0, 0 + bne _0803639C + ldr r4, =gUnknown_0831ABA8 + ldr r5, =0x02022ff0 + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x8 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x06004000 + bl LZDecompressVram + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r4, 0xC + adds r0, r4 + ldr r0, [r0] +_08036382: + ldr r1, =0x0600e000 + bl LZDecompressVram + b _080363AC + .pool +_0803639C: + ldr r0, =gUnknown_08D820D4 + ldr r1, =0x06004000 + bl LZDecompressVram + ldr r0, =gUnknown_08D824E4 + ldr r1, =0x0600e000 + bl LZDecompressVram +_080363AC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8036154 + + thumb_func_start sub_80363C4 +sub_80363C4: @ 80363C4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + movs r4, 0 + cmp r0, 0x6 + bls _080363D2 + b _08036756 +_080363D2: + lsls r0, 2 + ldr r1, =_080363E0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080363E0: + .4byte _080363FC + .4byte _0803640C + .4byte _08036424 + .4byte _08036434 + .4byte _0803652C + .4byte _08036638 + .4byte _08036750 +_080363FC: + ldr r0, =gUnknown_08C00000 + movs r1, 0xC0 + lsls r1, 19 + bl LZDecompressVram + b _08036758 + .pool +_0803640C: + ldr r1, =gUnknown_08C00524 + movs r0, 0 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + movs r0, 0 + bl CopyBgTilemapBufferToVram + b _08036758 + .pool +_08036424: + ldr r0, =gUnknown_08C004E0 + movs r1, 0 + movs r2, 0x40 + bl decompress_palette + b _08036758 + .pool +_08036434: + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r0, =0x023f0902 + ands r0, r1 + cmp r0, 0 + bne _08036518 + movs r0, 0x80 + lsls r0, 21 + ands r0, r1 + cmp r0, 0 + beq _0803645C + ldr r0, =gUnknown_08D7BB14 + b _0803651A + .pool +_0803645C: + movs r0, 0x8 + ands r1, r0 + cmp r1, 0 + beq _0803648C + ldr r2, =gTrainers + ldr r0, =0x02038bca + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0x20 + beq _08036518 + cmp r0, 0x26 + bne _0803648C + ldr r0, =gUnknown_08D7CCD8 + b _0803651A + .pool +_0803648C: + bl sav1_map_get_battletype + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8 + bhi _080364CC + lsls r0, 2 + ldr r1, =_080364A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080364A8: + .4byte _080364CC + .4byte _08036518 + .4byte _080364E8 + .4byte _080364F0 + .4byte _080364F8 + .4byte _08036500 + .4byte _08036508 + .4byte _08036510 + .4byte _08036518 +_080364CC: + ldr r2, =gUnknown_0831ABA8 + ldr r0, =0x02022ff0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + b _0803651A + .pool +_080364E8: + ldr r0, =gUnknown_08D7CCD8 + b _0803651A + .pool +_080364F0: + ldr r0, =gUnknown_08D7CCD8 + b _0803651A + .pool +_080364F8: + ldr r0, =gUnknown_08D7CCD8 + b _0803651A + .pool +_08036500: + ldr r0, =gUnknown_08D7CCD8 + b _0803651A + .pool +_08036508: + ldr r0, =gUnknown_08D7CCD8 + b _0803651A + .pool +_08036510: + ldr r0, =gUnknown_08D7CCD8 + b _0803651A + .pool +_08036518: + ldr r0, =gUnknown_08D7C440 +_0803651A: + ldr r1, =0x06008000 + bl LZDecompressVram + b _08036758 + .pool +_0803652C: + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r0, =0x023f0902 + ands r0, r1 + cmp r0, 0 + beq _0803653A + b _08036624 +_0803653A: + movs r0, 0x80 + lsls r0, 5 + ands r0, r1 + cmp r0, 0 + beq _08036568 + ldr r0, =gUnknown_82E9530 + ldrb r0, [r0] + cmp r0, 0x2 + bne _08036560 + ldr r0, =gUnknown_08D7C154 + b _08036626 + .pool +_08036560: + ldr r0, =gUnknown_08D7A720 + b _08036626 + .pool +_08036568: + movs r0, 0x8 + ands r1, r0 + cmp r1, 0 + beq _08036598 + ldr r2, =gTrainers + ldr r0, =0x02038bca + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0x20 + beq _08036624 + cmp r0, 0x26 + bne _08036598 + ldr r0, =gUnknown_08D7D2E0 + b _08036626 + .pool +_08036598: + bl sav1_map_get_battletype + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8 + bhi _080365D8 + lsls r0, 2 + ldr r1, =_080365B4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080365B4: + .4byte _080365D8 + .4byte _08036624 + .4byte _080365F4 + .4byte _080365FC + .4byte _08036604 + .4byte _0803660C + .4byte _08036614 + .4byte _0803661C + .4byte _08036624 +_080365D8: + ldr r2, =gUnknown_0831ABA8 + ldr r0, =0x02022ff0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x4 + adds r0, r2 + ldr r0, [r0] + b _08036626 + .pool +_080365F4: + ldr r0, =gUnknown_08D7D2E0 + b _08036626 + .pool +_080365FC: + ldr r0, =gUnknown_08D7D2E0 + b _08036626 + .pool +_08036604: + ldr r0, =gUnknown_08D7D2E0 + b _08036626 + .pool +_0803660C: + ldr r0, =gUnknown_08D7D2E0 + b _08036626 + .pool +_08036614: + ldr r0, =gUnknown_08D7D2E0 + b _08036626 + .pool +_0803661C: + ldr r0, =gUnknown_08D7D2E0 + b _08036626 + .pool +_08036624: + ldr r0, =gUnknown_08D7CA28 +_08036626: + ldr r1, =0x0600d000 + bl LZDecompressVram + b _08036758 + .pool +_08036638: + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r0, =0x023f0902 + ands r0, r1 + cmp r0, 0 + beq _08036646 + b _08036740 +_08036646: + movs r0, 0x80 + lsls r0, 5 + ands r0, r1 + cmp r0, 0 + beq _08036674 + ldr r0, =gUnknown_82E9530 + ldrb r0, [r0] + cmp r0, 0x2 + bne _0803666C + ldr r0, =gUnknown_08D7DF30 + b _08036742 + .pool +_0803666C: + ldr r0, =gUnknown_08D7DEF4 + b _08036742 + .pool +_08036674: + movs r0, 0x8 + ands r1, r0 + cmp r1, 0 + beq _080366AC + ldr r2, =gTrainers + ldr r0, =0x02038bca + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0x20 + bne _080366A0 + ldr r0, =gUnknown_08D7DFC4 + b _08036742 + .pool +_080366A0: + cmp r0, 0x26 + bne _080366AC + ldr r0, =gUnknown_08D7E1F8 + b _08036742 + .pool +_080366AC: + bl sav1_map_get_battletype + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8 + bhi _080366EC + lsls r0, 2 + ldr r1, =_080366C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080366C8: + .4byte _080366EC + .4byte _08036708 + .4byte _08036710 + .4byte _08036718 + .4byte _08036720 + .4byte _08036728 + .4byte _08036730 + .4byte _08036738 + .4byte _08036740 +_080366EC: + ldr r2, =gUnknown_0831ABA8 + ldr r0, =0x02022ff0 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x10 + adds r0, r2 + ldr r0, [r0] + b _08036742 + .pool +_08036708: + ldr r0, =gUnknown_08D7DF88 + b _08036742 + .pool +_08036710: + ldr r0, =gUnknown_08D7E060 + b _08036742 + .pool +_08036718: + ldr r0, =gUnknown_08D7E000 + b _08036742 + .pool +_08036720: + ldr r0, =gUnknown_08D7E0CC + b _08036742 + .pool +_08036728: + ldr r0, =gUnknown_08D7E11C + b _08036742 + .pool +_08036730: + ldr r0, =gUnknown_08D7E164 + b _08036742 + .pool +_08036738: + ldr r0, =gUnknown_08D7E1A8 + b _08036742 + .pool +_08036740: + ldr r0, =gUnknown_08D7C9EC +_08036742: + movs r1, 0x20 + movs r2, 0x60 + bl decompress_palette + b _08036758 + .pool +_08036750: + bl sub_803570C + b _08036758 +_08036756: + movs r4, 0x1 +_08036758: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80363C4 + + thumb_func_start sub_8036760 +sub_8036760: @ 8036760 + push {lr} + bl saveblock_randomize_and_relocate + bl sub_8056F28 + bl dp11_init + bl init_uns_table_pokemon_copy + bl sub_8185F84 + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080367CC + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + beq _08036798 + bl sub_80367D4 + b _080367BA + .pool +_08036798: + movs r0, 0x80 + lsls r0, 15 + ands r1, r0 + cmp r1, 0 + bne _080367B4 + bl battle_wireless_setup_if_required_maybe + ldr r0, =sub_8037ADC + bl SetMainCallback2 + b _080367BA + .pool +_080367B4: + ldr r0, =intro_end + bl SetMainCallback2 +_080367BA: + ldr r1, =0x02024332 + movs r0, 0 + strb r0, [r1] + b _080367D0 + .pool +_080367CC: + bl sub_80367D4 +_080367D0: + pop {r0} + bx r0 + thumb_func_end sub_8036760 + + thumb_func_start sub_80367D4 +sub_80367D4: @ 80367D4 + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + str r0, [sp] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + mov r0, sp + bl CpuSet + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + movs r0, 0x40 + movs r1, 0xF0 + bl SetGpuReg + ldr r1, =0x00005051 + movs r0, 0x44 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0 + bl SetGpuReg + ldr r0, =0x02022e24 + movs r2, 0xF0 + strh r2, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _08036870 + ldr r0, =0x02038bce + ldrh r1, [r0] + ldr r0, =0x00000c03 + cmp r1, r0 + beq _08036870 + ldr r1, =0x02022e26 + movs r0, 0x9F + strh r0, [r1] + ldr r0, =0x02022e28 + strh r2, [r0] + ldr r1, =0x02022e2a + movs r0, 0x20 + strh r0, [r1] + b _080368BE + .pool +_08036870: + ldr r0, =0x02022e26 + ldr r2, =0x00005051 + adds r1, r2, 0 + strh r1, [r0] + bl dp12_8087EA4 + ldr r0, =0x02038c28 + movs r3, 0xF0 + movs r5, 0xF0 + lsls r5, 3 + adds r2, r0, r5 + movs r1, 0x4F +_08036888: + strh r3, [r0] + strh r3, [r2] + adds r2, 0x2 + adds r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08036888 + movs r1, 0x50 + ldr r4, =gUnknown_0831AC70 + ldr r0, =0x02038c28 + ldr r3, =0x0000ff10 + movs r5, 0x82 + lsls r5, 4 + adds r2, r0, r5 + adds r0, 0xA0 +_080368A6: + strh r3, [r0] + strh r3, [r2] + adds r2, 0x2 + adds r0, 0x2 + adds r1, 0x1 + cmp r1, 0x9F + ble _080368A6 + ldr r0, [r4] + ldr r1, [r4, 0x4] + ldr r2, [r4, 0x8] + bl sub_80BA038 +_080368BE: + bl sub_80A1A74 + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r0, =0x02022e18 + strh r1, [r0] + ldr r0, =0x02022e1a + strh r1, [r0] + ldr r0, =0x02022e1c + strh r1, [r0] + ldr r0, =0x02022e1e + strh r1, [r0] + ldr r0, =0x02022e20 + strh r1, [r0] + ldr r0, =0x02022e22 + strh r1, [r0] + bl sub_80B0BD0 + ldr r2, =0x02022ff0 + strb r0, [r2] + ldr r4, =0x02022fec + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _080368FE + movs r0, 0x8 + strb r0, [r2] +_080368FE: + bl c2_berry_program_update_menu + bl sub_8035AA4 + bl ResetAllObjectData + bl ResetTasks + bl sub_8036154 + bl ResetObjectPaletteAllocator + ldr r1, =0x0300301c + movs r0, 0x4 + strb r0, [r1] + ldr r0, =vblank_cb_08078BB4 + bl SetVBlankCallback + bl sub_803269C + ldr r2, [r4] + movs r1, 0xA0 + lsls r1, 1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, r1 + beq _0803693E + ldr r1, =0x00400040 + adds r0, r2, 0 + ands r0, r1 + cmp r0, r1 + bne _08036994 +_0803693E: + ldr r0, =sub_8037458 + bl SetMainCallback2 + b _080369AE + .pool +_08036994: + movs r0, 0x40 + ands r2, r0 + cmp r2, 0 + beq _080369A8 + ldr r0, =sub_8037DF4 + bl SetMainCallback2 + b _080369AE + .pool +_080369A8: + ldr r0, =sub_8036FAC + bl SetMainCallback2 +_080369AE: + ldr r5, =0x02022fec + ldr r0, [r5] + ldr r1, =0x01000002 + ands r0, r1 + cmp r0, 0 + bne _080369E8 + ldr r4, =0x02024744 + ldr r0, =0x02038bca + ldrh r1, [r0] + adds r0, r4, 0 + movs r2, 0x1 + bl LoadTrainerParty + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _080369E4 + movs r1, 0x96 + lsls r1, 1 + adds r0, r4, r1 + ldr r1, =0x02038bcc + ldrh r1, [r1] + movs r2, 0 + bl LoadTrainerParty +_080369E4: + bl sub_806EA68 +_080369E8: + ldr r1, =0x030022c0 + ldr r2, =0x00000439 + adds r1, r2 + ldrb r0, [r1] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r1] + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r5, =0x00000ca9 + adds r1, r5 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r4, =0x020244ec + movs r0, 0xFA + lsls r0, 1 + adds r5, r4, r0 +_08036A10: + adds r0, r4, 0 + movs r1, 0x3 + bl happiness_algorithm + adds r4, 0x64 + cmp r4, r5 + ble _08036A10 + movs r1, 0 + ldr r0, =0x02024332 + strb r1, [r0] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80367D4 + + thumb_func_start sub_8036A5C +sub_8036A5C: @ 8036A5C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r6, 0 + mov r9, r6 + movs r0, 0xCE + lsls r0, 1 + mov r10, r0 + mov r8, r6 +_08036A72: + movs r0, 0x64 + mov r4, r9 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + adds r1, r0, 0 + cmp r5, 0 + beq _08036AEE + cmp r5, r10 + beq _08036ABA + cmp r7, 0 + beq _08036ABA + cmp r1, 0 + bne _08036ABA + movs r0, 0x1 + mov r2, r8 + lsls r0, r2 + orrs r6, r0 + lsls r0, r6, 16 + lsrs r6, r0, 16 +_08036ABA: + cmp r5, 0 + beq _08036AEE + cmp r7, 0 + beq _08036AD6 + cmp r5, r10 + beq _08036ACA + cmp r1, 0 + beq _08036AD6 +_08036ACA: + movs r0, 0x2 + mov r1, r8 + lsls r0, r1 + orrs r6, r0 + lsls r0, r6, 16 + lsrs r6, r0, 16 +_08036AD6: + cmp r5, 0 + beq _08036AEE + cmp r5, r10 + beq _08036AEE + cmp r7, 0 + bne _08036AEE + movs r0, 0x3 + mov r2, r8 + lsls r0, r2 + orrs r6, r0 + lsls r0, r6, 16 + lsrs r6, r0, 16 +_08036AEE: + movs r0, 0x2 + add r8, r0 + movs r1, 0x1 + add r9, r1 + mov r2, r9 + cmp r2, 0x5 + ble _08036A72 + ldr r4, =0x0202449c + ldr r0, [r4] + movs r1, 0xC1 + lsls r1, 1 + adds r0, r1 + strb r6, [r0] + ldr r0, [r4] + ldr r5, =0x00000183 + adds r0, r5 + lsrs r1, r6, 8 + strb r1, [r0] + ldr r0, =0x000008d2 + bl FlagGet + ldr r1, [r4] + adds r1, r5 + lsls r0, 7 + ldrb r2, [r1] + orrs r0, r2 + strb r0, [r1] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8036A5C + + thumb_func_start sub_8036B44 +sub_8036B44: @ 8036B44 + push {r4-r7,lr} + ldr r0, =0x0202449c + ldr r5, [r0] + movs r0, 0xC2 + lsls r0, 1 + adds r4, r5, r0 + bl sub_80E162C + cmp r0, 0x1 + bne _08036BC0 + movs r2, 0 + ldr r7, =0x03005d8c + movs r1, 0xC6 + lsls r1, 1 + adds r5, r1 + adds r6, r7, 0 + ldr r3, =0x000031f8 +_08036B66: + adds r0, r4, r2 + ldr r1, [r6] + adds r1, r3 + adds r1, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x5 + ble _08036B66 + adds r1, r4, r2 + movs r0, 0xFF + strb r0, [r1] + movs r2, 0 + adds r3, r5, 0 + ldr r6, =0x03005d8c + ldr r5, =0x00003214 +_08036B86: + adds r0, r3, r2 + ldr r1, [r6] + adds r1, r5 + adds r1, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x11 + ble _08036B86 + ldr r0, [r7] + ldr r1, =0x00003226 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r4, 0x7] + ldr r0, [r7] + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + b _08036C00 + .pool +_08036BC0: + movs r0, 0xAF + bl ItemIdToBerryType + lsls r0, 24 + lsrs r0, 24 + bl GetBerryInfo + adds r3, r0, 0 + movs r2, 0 + movs r0, 0xC6 + lsls r0, 1 + adds r5, r0 +_08036BD8: + adds r0, r4, r2 + adds r1, r3, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x5 + ble _08036BD8 + adds r1, r4, r2 + movs r0, 0xFF + strb r0, [r1] + adds r0, r5, 0 + movs r2, 0 + adds r1, r0, 0 + adds r1, 0x11 +_08036BF4: + strb r2, [r1] + subs r1, 0x1 + cmp r1, r0 + bge _08036BF4 + movs r0, 0 + strb r0, [r4, 0x7] +_08036C00: + strb r0, [r4, 0x1A] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8036B44 + + thumb_func_start berry_801017C +berry_801017C: @ 8036C08 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08036C20 + b _08036D4C +_08036C20: + bl sub_80E162C + cmp r0, 0x1 + bne _08036CDC + movs r5, 0 + ldr r3, =0x02024404 + ldr r0, =0x03005d8c + mov r8, r0 + adds r6, r3, 0 + mov r4, r8 + ldr r2, =0x000031f8 + adds r7, r3, 0 + adds r7, 0x38 +_08036C3A: + adds r1, r5, r6 + ldr r0, [r4] + adds r0, r2 + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r5, r7 + ldr r0, [r4] + adds r0, r2 + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + adds r5, 0x1 + cmp r5, 0x5 + ble _08036C3A + adds r1, r5, r3 + movs r0, 0xFF + strb r0, [r1] + adds r0, r3, 0 + adds r0, 0x38 + adds r0, r5, r0 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + movs r5, 0 + adds r7, r3, 0 + adds r7, 0x8 + ldr r4, =0x03005d8c + ldr r2, =0x00003214 + adds r6, r3, 0 + adds r6, 0x40 +_08036C78: + adds r1, r5, r7 + ldr r0, [r4] + adds r0, r2 + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r5, r6 + ldr r0, [r4] + adds r0, r2 + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + adds r5, 0x1 + cmp r5, 0x11 + ble _08036C78 + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x00003226 + adds r0, r2 + ldrb r1, [r0] + strb r1, [r3, 0x7] + ldrb r0, [r0] + adds r1, r3, 0 + adds r1, 0x3F + strb r0, [r1] + mov r4, r8 + ldr r0, [r4] + ldr r1, =0x00003227 + adds r0, r1 + ldrb r1, [r0] + strb r1, [r3, 0x1A] + ldrb r1, [r0] + adds r0, r3, 0 + adds r0, 0x52 + strb r1, [r0] + b _08036EA0 + .pool +_08036CDC: + movs r0, 0xAF + bl ItemIdToBerryType + lsls r0, 24 + lsrs r0, 24 + bl GetBerryInfo + adds r6, r0, 0 + movs r5, 0 + ldr r4, =0x02024404 + adds r7, r4, 0 + adds r7, 0x38 + adds r3, r4, 0 +_08036CF6: + adds r1, r5, r4 + adds r2, r6, r5 + ldrb r0, [r2] + strb r0, [r1] + adds r1, r5, r7 + ldrb r0, [r2] + strb r0, [r1] + adds r5, 0x1 + cmp r5, 0x5 + ble _08036CF6 + adds r1, r5, r3 + movs r0, 0xFF + strb r0, [r1] + adds r0, r3, 0 + adds r0, 0x38 + adds r0, r5, r0 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + movs r5, 0 + adds r4, r3, 0 + adds r4, 0x8 + movs r1, 0 + adds r2, r3, 0 + adds r2, 0x40 +_08036D28: + adds r0, r5, r4 + strb r1, [r0] + adds r0, r5, r2 + strb r1, [r0] + adds r5, 0x1 + cmp r5, 0x11 + ble _08036D28 + movs r1, 0 + strb r1, [r3, 0x7] + adds r0, r3, 0 + adds r0, 0x3F + strb r1, [r0] + strb r1, [r3, 0x1A] + adds r0, 0x13 + strb r1, [r0] + b _08036EA0 + .pool +_08036D4C: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08036DF0 + movs r0, 0x80 + lsls r0, 1 + ands r1, r0 + movs r2, 0x4 + mov r8, r2 + cmp r1, 0 + beq _08036D66 + movs r4, 0x2 + mov r8, r4 +_08036D66: + movs r5, 0 + cmp r5, r8 + blt _08036D6E + b _08036EA0 +_08036D6E: + ldr r0, =0x020229e8 + mov r12, r0 + ldr r3, =0x02024404 + adds r6, r3, 0 + movs r1, 0x8 + adds r1, r6 + mov r9, r1 +_08036D7C: + lsls r1, r5, 8 + ldr r0, =0x020223c8 + adds r7, r1, r0 + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + add r0, r12 + ldrb r3, [r0, 0x18] + movs r4, 0 + adds r5, 0x1 + mov r10, r5 + lsls r1, r3, 3 + subs r0, r1, r3 + adds r5, r1, 0 + lsls r0, 2 + adds r1, r0, r6 +_08036D9C: + adds r0, r7, r4 + ldrb r0, [r0] + strb r0, [r1] + adds r1, 0x1 + adds r4, 0x1 + cmp r4, 0x5 + ble _08036D9C + subs r0, r5, r3 + lsls r0, 2 + adds r1, r4, r0 + adds r1, r6 + movs r2, 0xFF + strb r2, [r1] + movs r4, 0 + mov r2, r9 + adds r1, r0, r2 + adds r2, r7, 0 + adds r2, 0x8 +_08036DC0: + adds r0, r2, r4 + ldrb r0, [r0] + strb r0, [r1] + adds r1, 0x1 + adds r4, 0x1 + cmp r4, 0x11 + ble _08036DC0 + subs r0, r5, r3 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r7, 0x7] + strb r1, [r0, 0x7] + ldrb r1, [r7, 0x1A] + strb r1, [r0, 0x1A] + mov r5, r10 + cmp r5, r8 + blt _08036D7C + b _08036EA0 + .pool +_08036DF0: + movs r5, 0 + ldr r4, =0x02024404 + mov r9, r4 +_08036DF6: + lsls r0, r5, 8 + ldr r1, =0x020223c8 + adds r7, r0, r1 + movs r4, 0 + adds r2, r5, 0x1 + mov r10, r2 + lsls r0, r5, 3 + mov r8, r0 + adds r1, r5, 0x2 + mov r12, r1 + subs r1, r0, r5 + mov r2, r12 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + mov r2, r9 + adds r3, r0, r2 + lsls r1, 2 + adds r2, r1, r2 +_08036E1C: + adds r0, r7, r4 + ldrb r1, [r0] + strb r1, [r2] + ldrb r0, [r0] + strb r0, [r3] + adds r3, 0x1 + adds r2, 0x1 + adds r4, 0x1 + cmp r4, 0x5 + ble _08036E1C + mov r0, r8 + subs r3, r0, r5 + lsls r3, 2 + adds r1, r4, r3 + add r1, r9 + ldrb r0, [r1] + movs r2, 0xFF + orrs r0, r2 + strb r0, [r1] + mov r0, r12 + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 2 + adds r1, r4, r2 + add r1, r9 + ldrb r0, [r1] + movs r4, 0xFF + orrs r0, r4 + strb r0, [r1] + movs r4, 0 + ldr r0, =0x02024404 + adds r0, 0x8 + adds r2, r0 + adds r3, r0 + adds r6, r7, 0 + adds r6, 0x8 +_08036E64: + adds r0, r6, r4 + ldrb r1, [r0] + strb r1, [r3] + ldrb r0, [r0] + strb r0, [r2] + adds r2, 0x1 + adds r3, 0x1 + adds r4, 0x1 + cmp r4, 0x11 + ble _08036E64 + mov r0, r8 + subs r2, r0, r5 + lsls r2, 2 + add r2, r9 + ldrb r0, [r7, 0x7] + strb r0, [r2, 0x7] + mov r1, r12 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r9 + ldrb r1, [r7, 0x7] + strb r1, [r0, 0x7] + ldrb r1, [r7, 0x1A] + strb r1, [r2, 0x1A] + ldrb r1, [r7, 0x1A] + strb r1, [r0, 0x1A] + mov r5, r10 + cmp r5, 0x1 + ble _08036DF6 +_08036EA0: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end berry_801017C + + thumb_func_start sub_8036EB8 +sub_8036EB8: @ 8036EB8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + movs r6, 0 + ldr r0, =0x020223c4 + ldrh r2, [r0] + movs r1, 0x80 + lsls r1, 1 + mov r12, r0 + cmp r2, r1 + bne _08036EFC + cmp r3, 0 + bne _08036EEC + ldr r0, =0x02022fec + ldr r1, [r0] + movs r2, 0xC + b _08036EF2 + .pool +_08036EEC: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r2, 0x8 +_08036EF2: + orrs r1, r2 + str r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_08036EFC: + cmp r6, 0 + bne _08036FA0 + movs r2, 0 + cmp r2, r4 + bge _08036F20 + ldr r1, =0x020223c4 + mov r8, r1 + movs r5, 0x80 + lsls r5, 1 +_08036F0E: + adds r1, r5 + adds r2, 0x1 + cmp r2, r4 + bge _08036F20 + mov r7, r8 + ldrh r0, [r7] + ldrh r7, [r1] + cmp r0, r7 + beq _08036F0E +_08036F20: + cmp r2, r4 + bne _08036F48 + cmp r3, 0 + bne _08036F38 + ldr r0, =0x02022fec + ldr r1, [r0] + movs r2, 0xC + b _08036F3E + .pool +_08036F38: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r2, 0x8 +_08036F3E: + orrs r1, r2 + str r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_08036F48: + cmp r6, 0 + bne _08036FA0 + movs r2, 0 + ldr r5, =0x02022fec + cmp r2, r4 + bge _08036F8A + mov r0, r12 + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 2 + cmp r1, r0 + beq _08036F82 +_08036F60: + lsls r0, r2, 8 + add r0, r12 + ldrh r0, [r0] + movs r1, 0xC0 + lsls r1, 2 + cmp r0, r1 + bls _08036F72 + cmp r2, r3 + bne _08036F8A +_08036F72: + adds r2, 0x1 + cmp r2, r4 + bge _08036F8A + lsls r0, r2, 8 + add r0, r12 + ldrh r0, [r0] + cmp r0, r1 + bne _08036F60 +_08036F82: + cmp r2, r3 + beq _08036F60 + cmp r2, r3 + bge _08036F60 +_08036F8A: + cmp r2, r4 + bne _08036F98 + ldr r0, [r5] + movs r1, 0xC + b _08036F9C + .pool +_08036F98: + ldr r0, [r5] + movs r1, 0x8 +_08036F9C: + orrs r0, r1 + str r0, [r5] +_08036FA0: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8036EB8 + + thumb_func_start sub_8036FAC +sub_8036FAC: @ 8036FAC + push {r4-r6,lr} + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x02024474 + adds r0, 0x25 + strb r6, [r0] + movs r0, 0x1 + adds r5, r6, 0 + eors r5, r0 + ldr r0, =0x02024332 + ldrb r0, [r0] + cmp r0, 0x12 + bls _08036FD8 + b _0803744C +_08036FD8: + lsls r0, 2 + ldr r1, =_08036FF0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08036FF0: + .4byte _0803703C + .4byte _08037080 + .4byte _08037144 + .4byte _080371D8 + .4byte _08037200 + .4byte _0803742C + .4byte _08037438 + .4byte _08037230 + .4byte _08037258 + .4byte _0803742C + .4byte _08037438 + .4byte _08037288 + .4byte _080372B0 + .4byte _0803742C + .4byte _08037438 + .4byte _08037318 + .4byte _08037378 + .4byte _080373A0 + .4byte _080373E0 +_0803703C: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _08037068 + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + bl sub_805EF14 + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1] +_08037068: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _08037072 + b _0803744C +_08037072: + bl sub_800E0E8 + b _0803744C + .pool +_08037080: + ldr r2, =0x02022fec + ldr r1, [r2] + movs r6, 0x2 + adds r0, r1, 0 + ands r0, r6 + cmp r0, 0 + beq _08037124 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08037098 + b _0803744C +_08037098: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080370EE + ldr r4, =0x0202449c + ldr r0, [r4] + movs r5, 0xC0 + lsls r5, 1 + adds r0, r5 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + ldr r2, =0x00000181 + adds r1, r0, r2 + movs r0, 0x3 + strb r0, [r1] + bl sub_8036A5C + bl sub_8036B44 + ldr r0, =0x02038bca + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 4 + cmp r1, r0 + bne _080370D8 + ldr r0, =0x020229e8 + movs r1, 0 + strh r1, [r0, 0x18] + movs r1, 0x1 + strh r1, [r0, 0x34] +_080370D8: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r4] + adds r1, r5 + movs r2, 0x20 + bl link_0800A448 + ldr r0, =0x02024332 + strb r6, [r0] +_080370EE: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _080370F8 + b _0803744C +_080370F8: + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _0803744C + .pool +_08037124: + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + bne _08037134 + movs r0, 0x4 + orrs r1, r0 + str r1, [r2] +_08037134: + ldr r1, =0x02024332 + movs r0, 0xF + strb r0, [r1] + bl berry_801017C + b _0803744C + .pool +_08037144: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _08037152 + b _0803744C +_08037152: + bl sub_800A5B4 + movs r0, 0x2 + adds r1, r6, 0 + bl sub_8036EB8 + bl berry_801017C + ldr r0, =task00_0800F6FC + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r1 + movs r1, 0 + movs r0, 0x87 + lsls r0, 1 + strh r0, [r2, 0xA] + movs r0, 0x5A + strh r0, [r2, 0xC] + strh r1, [r2, 0x12] + ldr r0, =0x0202449c + ldr r3, [r0] + movs r4, 0xC1 + lsls r4, 1 + adds r0, r3, r4 + ldrb r1, [r0] + adds r4, 0x1 + adds r0, r3, r4 + ldrb r0, [r0] + lsls r0, 8 + orrs r1, r0 + strh r1, [r2, 0xE] + ldr r1, =0x020223c4 + lsls r4, r5, 8 + adds r1, 0x2 + adds r4, r1 + ldrh r0, [r4] + strh r0, [r2, 0x10] + lsls r0, r6, 8 + adds r0, r1 + ldrh r0, [r0] + bl sub_8185F90 + ldrh r0, [r4] + bl sub_8185F90 + bl sub_8068AA4 + ldr r1, =0x02024332 + b _08037446 + .pool +_080371D8: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _080371E4 + b _0803744C +_080371E4: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020244ec + movs r2, 0xC8 + bl link_0800A448 + ldr r1, =0x02024332 + b _08037446 + .pool +_08037200: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _0803720E + b _0803744C +_0803720E: + bl sub_800A5B4 + ldr r0, =0x02024744 + lsls r1, r5, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0xC8 + bl memcpy + ldr r1, =0x02024332 + b _08037446 + .pool +_08037230: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _0803723C + b _0803744C +_0803723C: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020245b4 + movs r2, 0xC8 + bl link_0800A448 + ldr r1, =0x02024332 + b _08037446 + .pool +_08037258: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _08037266 + b _0803744C +_08037266: + bl sub_800A5B4 + ldr r0, =0x0202480c + lsls r1, r5, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0xC8 + bl memcpy + ldr r1, =0x02024332 + b _08037446 + .pool +_08037288: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08037294 + b _0803744C +_08037294: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0202467c + movs r2, 0xC8 + bl link_0800A448 + ldr r1, =0x02024332 + b _08037446 + .pool +_080372B0: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _080372BE + b _0803744C +_080372BE: + bl sub_800A5B4 + ldr r4, =0x020248d4 + lsls r1, r5, 8 + ldr r0, =0x020223c4 + adds r1, r0 + adds r0, r4, 0 + movs r2, 0xC8 + bl memcpy + ldr r1, =0xfffffe70 + adds r0, r4, r1 + bl shedinja_something + ldr r2, =0xfffffed4 + adds r0, r4, r2 + bl shedinja_something + adds r0, r4, 0 + subs r0, 0xC8 + bl shedinja_something + adds r0, r4, 0 + subs r0, 0x64 + bl shedinja_something + adds r0, r4, 0 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0x64 + bl shedinja_something + ldr r1, =0x02024332 + b _08037446 + .pool +_08037318: + bl sub_8032768 + bl sub_8184E58 + ldr r2, =0x02024332 + movs r0, 0 + strb r0, [r2, 0x1] + strb r0, [r2, 0x2] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08037372 + movs r3, 0 + ldr r1, =0x020229e8 + ldrb r0, [r1] + adds r5, r2, 0 + cmp r0, 0x3 + bne _08037356 + movs r4, 0xFF + adds r2, r1, 0 +_08037344: + adds r2, 0x1C + adds r3, 0x1 + cmp r3, 0x1 + bgt _08037356 + ldrh r1, [r2] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x3 + beq _08037344 +_08037356: + cmp r3, 0x2 + bne _0803736C + movs r0, 0x10 + strb r0, [r5] + b _0803744C + .pool +_0803736C: + movs r0, 0x12 + strb r0, [r5] + b _0803744C +_08037372: + movs r0, 0x12 + strb r0, [r2] + b _0803744C +_08037378: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0803744C + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0203bd2c + movs r2, 0x4 + bl link_0800A448 + ldr r1, =0x02024332 + b _08037446 + .pool +_080373A0: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + bne _0803744C + bl sub_800A5B4 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080373CA + ldr r0, =0x0203bd2c + lsls r1, r5, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0x4 + bl memcpy +_080373CA: + ldr r1, =0x02024332 + b _08037446 + .pool +_080373E0: + ldr r0, =0x02024333 + adds r1, r0, 0x1 + bl battle_load_something + lsls r0, 24 + cmp r0, 0 + beq _0803744C + ldr r2, =0x03005d00 + ldr r1, =0x030022c0 + ldr r0, [r1] + str r0, [r2] + ldr r0, =sub_8039EF0 + str r0, [r1] + ldr r0, =sub_8038420 + bl SetMainCallback2 + ldr r2, =0x02022fec + ldr r1, [r2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0803744C + movs r0, 0x20 + orrs r1, r0 + str r1, [r2] + b _0803744C + .pool +_0803742C: + ldr r0, =0x02024332 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + movs r1, 0x1 + strb r1, [r0, 0x1] +_08037438: + ldr r1, =0x02024332 + ldrb r0, [r1, 0x1] + subs r0, 0x1 + strb r0, [r1, 0x1] + lsls r0, 24 + cmp r0, 0 + bne _0803744C +_08037446: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0803744C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8036FAC + + thumb_func_start sub_8037458 +sub_8037458: @ 8037458 + push {r4-r7,lr} + sub sp, 0x4 + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x02024474 + adds r0, 0x25 + strb r6, [r0] + movs r0, 0x1 + adds r7, r6, 0 + eors r7, r0 + ldr r0, =0x02024332 + ldrb r0, [r0] + cmp r0, 0x10 + bls _08037486 + b _080379D6 +_08037486: + lsls r0, 2 + ldr r1, =_0803749C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0803749C: + .4byte _080374E0 + .4byte _08037518 + .4byte _0803761C + .4byte _08037670 + .4byte _08037694 + .4byte _08037710 + .4byte _08037734 + .4byte _080377B0 + .4byte _080377CC + .4byte _080377FC + .4byte _08037818 + .4byte _08037848 + .4byte _08037864 + .4byte _08037908 + .4byte _0803793A + .4byte _0803795C + .4byte _080379A0 +_080374E0: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0803750C + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + bl sub_805EF14 + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1] +_0803750C: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08037518 + bl sub_800E0E8 +_08037518: + ldr r2, =0x02022fec + ldr r1, [r2] + movs r3, 0x2 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + beq _080375FC + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08037530 + b _080379D6 +_08037530: + ldr r6, =0x020229e8 + movs r0, 0 + strh r0, [r6, 0x18] + strh r3, [r6, 0x34] + adds r1, r6, 0 + adds r1, 0x50 + movs r0, 0x1 + strh r0, [r1] + adds r1, 0x1C + movs r0, 0x3 + strh r0, [r1] + adds r0, r6, 0 + adds r0, 0x40 + ldr r4, =0x02038bca + ldrh r1, [r4] + bl sub_8162E20 + adds r0, r6, 0 + adds r0, 0x5C + ldr r5, =0x02038bcc + ldrh r1, [r5] + bl sub_8162E20 + ldrh r1, [r4] + mov r0, sp + bl sub_8165B88 + mov r0, sp + ldrb r0, [r0] + adds r1, r6, 0 + adds r1, 0x52 + strh r0, [r1] + ldrh r1, [r5] + mov r0, sp + bl sub_8165B88 + mov r0, sp + ldrb r1, [r0] + adds r0, r6, 0 + adds r0, 0x6E + strh r1, [r0] + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080375C4 + ldr r4, =0x0202449c + ldr r0, [r4] + movs r5, 0xC0 + lsls r5, 1 + adds r0, r5 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + ldr r2, =0x00000181 + adds r1, r0, r2 + movs r0, 0x3 + strb r0, [r1] + bl sub_8036A5C + bl sub_8036B44 + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r4] + adds r1, r5 + movs r2, 0x20 + bl link_0800A448 + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1] +_080375C4: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _080375CE + b _080379D6 +_080375CE: + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _080379D6 + .pool +_080375FC: + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + bne _0803760C + movs r0, 0x4 + orrs r1, r0 + str r1, [r2] +_0803760C: + ldr r1, =0x02024332 + movs r0, 0xD + strb r0, [r1] + bl berry_801017C + b _080379D6 + .pool +_0803761C: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _0803762A + b _080379D6 +_0803762A: + bl sub_800A5B4 + movs r0, 0x2 + adds r1, r6, 0 + bl sub_8036EB8 + bl berry_801017C + ldr r0, =task00_0800F6FC + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + movs r0, 0x87 + lsls r0, 1 + strh r0, [r1, 0xA] + movs r0, 0x5A + strh r0, [r1, 0xC] + strh r2, [r1, 0x12] + adds r0, 0xEB + strh r0, [r1, 0xE] + strh r0, [r1, 0x10] + b _08037986 + .pool +_08037670: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _0803767C + b _080379D6 +_0803767C: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020244ec +_08037686: + movs r2, 0xC8 + bl link_0800A448 + b _08037986 + .pool +_08037694: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _080376A2 + b _080379D6 +_080376A2: + bl sub_800A5B4 + ldr r0, =0x020229e8 + lsls r1, r6, 3 + subs r1, r6 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x18] + cmp r0, 0 + beq _080376E8 + ldr r4, =0x020244ec + lsls r1, r7, 8 + ldr r5, =0x020223c4 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0xC8 + bl memcpy + movs r0, 0x96 + lsls r0, 1 + adds r4, r0 + lsls r1, r6, 8 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0xC8 + bl memcpy + b _08037986 + .pool +_080376E8: + ldr r4, =0x020244ec + lsls r1, r6, 8 + ldr r5, =0x020223c4 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0xC8 + bl memcpy + movs r1, 0x96 + lsls r1, 1 + adds r4, r1 + lsls r1, r7, 8 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0xC8 + b _08037982 + .pool +_08037710: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _0803771C + b _080379D6 +_0803771C: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020245b4 + movs r2, 0x64 + bl link_0800A448 + b _08037986 + .pool +_08037734: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _08037742 + b _080379D6 +_08037742: + bl sub_800A5B4 + ldr r0, =0x020229e8 + lsls r1, r6, 3 + subs r1, r6 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x18] + cmp r0, 0 + beq _08037788 + ldr r4, =0x020245b4 + lsls r1, r7, 8 + ldr r5, =0x020223c4 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0x64 + bl memcpy + movs r2, 0x96 + lsls r2, 1 + adds r4, r2 + lsls r1, r6, 8 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0x64 + bl memcpy + b _08037986 + .pool +_08037788: + ldr r4, =0x020245b4 + lsls r1, r6, 8 + ldr r5, =0x020223c4 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0x64 + bl memcpy + movs r0, 0x96 + lsls r0, 1 + adds r4, r0 + lsls r1, r7, 8 + adds r1, r5 + adds r0, r4, 0 + movs r2, 0x64 + b _08037982 + .pool +_080377B0: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _080377BC + b _080379D6 +_080377BC: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02024744 + b _08037686 + .pool +_080377CC: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _080377DA + b _080379D6 +_080377DA: + bl sub_800A5B4 + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _080377EA + b _08037986 +_080377EA: + ldr r0, =0x02024744 + ldr r1, =0x020223c4 + movs r2, 0xC8 + b _08037982 + .pool +_080377FC: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08037808 + b _080379D6 +_08037808: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0202480c + b _08037686 + .pool +_08037818: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _08037826 + b _080379D6 +_08037826: + bl sub_800A5B4 + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _08037836 + b _08037986 +_08037836: + ldr r0, =0x0202480c + ldr r1, =0x020223c4 + movs r2, 0xC8 + b _08037982 + .pool +_08037848: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08037854 + b _080379D6 +_08037854: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020248d4 + b _08037686 + .pool +_08037864: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _08037872 + b _080379D6 +_08037872: + bl sub_800A5B4 + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + beq _0803788A + ldr r0, =0x020248d4 + ldr r1, =0x020223c4 + movs r2, 0xC8 + bl memcpy +_0803788A: + ldr r4, =0x020244ec + adds r0, r4, 0 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0x64 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0xC8 + bl shedinja_something + movs r1, 0x96 + lsls r1, 1 + adds r0, r4, r1 + bl shedinja_something + movs r2, 0xC8 + lsls r2, 1 + adds r0, r4, r2 + bl shedinja_something + movs r1, 0xFA + lsls r1, 1 + adds r0, r4, r1 + bl shedinja_something + ldr r4, =0x02024744 + adds r0, r4, 0 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0x64 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0xC8 + bl shedinja_something + movs r2, 0x96 + lsls r2, 1 + adds r0, r4, r2 + bl shedinja_something + movs r1, 0xC8 + lsls r1, 1 + adds r0, r4, r1 + bl shedinja_something + movs r2, 0xFA + lsls r2, 1 + adds r0, r4, r2 + bl shedinja_something + b _08037986 + .pool +_08037908: + bl sub_8032768 + bl sub_8184E58 + ldr r2, =0x02024332 + movs r0, 0 + strb r0, [r2, 0x1] + strb r0, [r2, 0x2] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08037934 + movs r0, 0xE + strb r0, [r2] + b _080379D6 + .pool +_08037934: + movs r0, 0x10 + strb r0, [r2] + b _080379D6 +_0803793A: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080379D6 + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0203bd2c + movs r2, 0x4 + bl link_0800A448 + b _08037986 + .pool +_0803795C: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + bne _080379D6 + bl sub_800A5B4 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + bne _08037986 + ldr r0, =0x0203bd2c + lsls r1, r7, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0x4 +_08037982: + bl memcpy +_08037986: + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080379D6 + .pool +_080379A0: + ldr r0, =0x02024333 + adds r1, r0, 0x1 + bl battle_load_something + lsls r0, 24 + cmp r0, 0 + beq _080379D6 + bl sub_8166188 + ldr r2, =0x03005d00 + ldr r1, =0x030022c0 + ldr r0, [r1] + str r0, [r2] + ldr r0, =sub_8039EF0 + str r0, [r1] + ldr r0, =sub_8038420 + bl SetMainCallback2 + ldr r2, =0x02022fec + ldr r1, [r2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080379D6 + movs r0, 0x20 + orrs r1, r0 + str r1, [r2] +_080379D6: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8037458 + + thumb_func_start sub_80379F8 +sub_80379F8: @ 80379F8 + 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] + movs r0, 0 + mov r8, r0 + ldr r6, =0x02022ff8 + mov r10, r6 +_08037A12: + ldr r1, [sp] + add r1, r8 + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + mov r1, r8 + lsls r5, r1, 5 + strh r0, [r6] + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + strh r0, [r6, 0x2] + movs r0, 0x4 + add r0, r10 + mov r9, r0 + adds r7, r5, r0 + adds r0, r4, 0 + movs r1, 0x2 + adds r2, r7, 0 + bl pokemon_getattr + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + strb r0, [r6, 0xF] + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + strh r0, [r6, 0x10] + adds r0, r4, 0 + movs r1, 0x3A + bl pokemon_getattr + strh r0, [r6, 0x12] + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + mov r1, r10 + adds r1, 0x14 + adds r5, r1 + str r0, [r5] + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + str r0, [r6, 0x18] + adds r0, r4, 0 + bl pokemon_get_gender + strb r0, [r6, 0x1C] + adds r0, r7, 0 + bl StripExtendedControlCodes + adds r0, r4, 0 + movs r1, 0x3 + bl pokemon_getattr + cmp r0, 0x1 + beq _08037AA4 + adds r0, r7, 0 + movs r1, 0 + bl sub_81DB4DC +_08037AA4: + adds r6, 0x20 + movs r1, 0x1 + add r8, r1 + mov r0, r8 + cmp r0, 0x2 + ble _08037A12 + ldr r0, =0x02023058 + ldr r0, [r0] + mov r1, r9 + subs r1, 0x4 + movs r2, 0x60 + bl memcpy + 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_80379F8 + + thumb_func_start sub_8037ADC +sub_8037ADC: @ 8037ADC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r0, 0x4 + mov r9, r0 + movs r4, 0xF + ldr r6, =0x02022fec + ldr r0, [r6] + movs r1, 0x80 + lsls r1, 1 + ands r0, r1 + cmp r0, 0 + beq _08037B02 + movs r1, 0x2 + mov r9, r1 + movs r4, 0x3 +_08037B02: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02024474 + adds r0, 0x25 + movs r2, 0 + mov r8, r2 + strb r7, [r0] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0xB4 + str r1, [sp] + adds r0, 0xAC + mov r10, r0 + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + ldr r5, =0x02024332 + ldrb r0, [r5] + cmp r0, 0x1 + beq _08037BA4 + cmp r0, 0x1 + bgt _08037B50 + cmp r0, 0 + beq _08037B5E + b _08037D0A + .pool +_08037B50: + cmp r0, 0x2 + bne _08037B56 + b _08037C64 +_08037B56: + cmp r0, 0x3 + bne _08037B5C + b _08037C9E +_08037B5C: + b _08037D0A +_08037B5E: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08037B68 + b _08037D0A +_08037B68: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08037B74 + b _08037D0A +_08037B74: + ldr r4, =0x02023058 + movs r0, 0x60 + bl Alloc + str r0, [r4] + movs r0, 0 + bl sub_80379F8 + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r4] + movs r2, 0x60 + bl link_0800A448 + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + b _08037D0A + .pool +_08037BA4: + bl sub_800A550 + adds r1, r4, 0 + ands r1, r0 + cmp r1, r4 + beq _08037BB2 + b _08037D0A +_08037BB2: + bl sub_800A5B4 + movs r5, 0 + cmp r8, r9 + bge _08037C2E + lsls r0, r7, 3 + subs r0, r7 + lsls r6, r0, 2 + mov r8, r5 + ldr r4, =0x020223c4 +_08037BC6: + cmp r5, r7 + beq _08037C1E + mov r2, r9 + cmp r2, 0x4 + bne _08037C14 + ldr r2, =0x020229e8 + mov r1, r8 + adds r0, r1, r2 + ldrh r1, [r0, 0x18] + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _08037BF8 + adds r0, r6, r2 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08037C04 + b _08037C1E + .pool +_08037BF8: + adds r0, r6, r2 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08037C1E +_08037C04: + ldr r0, =0x02022ff8 + adds r1, r4, 0 + movs r2, 0x60 + bl memcpy + b _08037C1E + .pool +_08037C14: + ldr r0, =0x02022ff8 + adds r1, r4, 0 + movs r2, 0x60 + bl memcpy +_08037C1E: + movs r2, 0x80 + lsls r2, 1 + adds r4, r2 + movs r0, 0x1C + add r8, r0 + adds r5, 0x1 + cmp r5, r9 + blt _08037BC6 +_08037C2E: + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, =0x030022c0 + ldr r0, [r1, 0x8] + ldr r2, [sp] + str r0, [r2] + ldr r0, =0x02022fec + ldr r0, [r0] + mov r2, r10 + str r0, [r2] + ldr r0, =sub_8037ADC + str r0, [r1, 0x8] + bl sub_81B9150 + b _08037D0A + .pool +_08037C64: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08037D0A + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08037D0A + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08037C98 + bl sub_800ADF8 + b _08037D0A + .pool +_08037C98: + bl sub_800AC34 + b _08037D0A +_08037C9E: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08037CE4 + bl sub_8010500 + lsls r0, 24 + cmp r0, 0 + beq _08037D0A + mov r1, r10 + ldr r0, [r1] + str r0, [r6] + ldr r1, =0x030022c0 + ldr r2, [sp] + ldr r0, [r2] + str r0, [r1, 0x8] + ldr r0, =sub_80367D4 + bl SetMainCallback2 + ldr r4, =0x02023058 + ldr r0, [r4] + bl Free + mov r0, r8 + str r0, [r4] + b _08037D0A + .pool +_08037CE4: + ldr r0, =0x03003124 + ldrb r5, [r0] + cmp r5, 0 + bne _08037D0A + mov r1, r10 + ldr r0, [r1] + str r0, [r6] + ldr r1, =0x030022c0 + ldr r2, [sp] + ldr r0, [r2] + str r0, [r1, 0x8] + ldr r0, =sub_80367D4 + bl SetMainCallback2 + ldr r4, =0x02023058 + ldr r0, [r4] + bl Free + str r5, [r4] +_08037D0A: + 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_8037ADC + + thumb_func_start intro_end +intro_end: @ 8037D2C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x0202449c + ldr r0, [r0] + movs r1, 0xB4 + adds r1, r0 + mov r8, r1 + adds r7, r0, 0 + adds r7, 0xAC + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + ldr r5, =0x02024332 + ldrb r0, [r5] + cmp r0, 0 + beq _08037D64 + cmp r0, 0x1 + beq _08037DA4 + b _08037DD6 + .pool +_08037D64: + ldr r4, =0x02023058 + movs r0, 0x60 + bl Alloc + str r0, [r4] + movs r0, 0x3 + bl sub_80379F8 + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + ldr r1, =0x030022c0 + ldr r0, [r1, 0x8] + mov r2, r8 + str r0, [r2] + ldr r0, =0x02022fec + ldr r0, [r0] + str r0, [r7] + ldr r0, =intro_end + str r0, [r1, 0x8] + bl sub_81B9150 + b _08037DD6 + .pool +_08037DA4: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _08037DD6 + movs r0, 0x2 + strb r0, [r5] + ldr r1, =0x02022fec + ldr r0, [r7] + str r0, [r1] + ldr r1, =0x030022c0 + mov r2, r8 + ldr r0, [r2] + str r0, [r1, 0x8] + ldr r0, =sub_80367D4 + bl SetMainCallback2 + ldr r4, =0x02023058 + ldr r0, [r4] + bl Free + str r6, [r4] +_08037DD6: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end intro_end + + thumb_func_start sub_8037DF4 +sub_8037DF4: @ 8037DF4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02024474 + adds r0, 0x25 + strb r7, [r0] + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + ldr r0, =0x02024332 + ldrb r0, [r0] + cmp r0, 0xA + bls _08037E20 + b _080383F8 +_08037E20: + lsls r0, 2 + ldr r1, =_08037E38 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08037E38: + .4byte _08037E64 + .4byte _08037EA8 + .4byte _08037F50 + .4byte _08038026 + .4byte _0803804C + .4byte _08038140 + .4byte _08038164 + .4byte _080382CC + .4byte _0803832C + .4byte _0803836C + .4byte _080383BC +_08037E64: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _08037E90 + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + bl sub_805EF14 + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1] +_08037E90: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _08037E9A + b _080383F8 +_08037E9A: + bl sub_800E0E8 + b _080383F8 + .pool +_08037EA8: + ldr r2, =0x02022fec + ldr r1, [r2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08037F30 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08037EBE + b _080383F8 +_08037EBE: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08037F02 + ldr r4, =0x0202449c + ldr r0, [r4] + movs r5, 0xC0 + lsls r5, 1 + adds r0, r5 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + ldr r2, =0x00000181 + adds r1, r0, r2 + movs r0, 0x3 + strb r0, [r1] + bl sub_8036A5C + bl sub_8036B44 + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r4] + adds r1, r5 + movs r2, 0x20 + bl link_0800A448 + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08037F02: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _08037F0C + b _080383F8 +_08037F0C: + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _080383F8 + .pool +_08037F30: + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + bne _08037F40 + movs r0, 0x4 + orrs r1, r0 + str r1, [r2] +_08037F40: + ldr r1, =0x02024332 + movs r0, 0x7 + strb r0, [r1] + bl berry_801017C + b _080383F8 + .pool +_08037F50: + bl sub_800A550 + movs r1, 0xF + ands r1, r0 + cmp r1, 0xF + beq _08037F5E + b _080383F8 +_08037F5E: + bl sub_800A5B4 + movs r0, 0x4 + adds r1, r7, 0 + bl sub_8036EB8 + bl berry_801017C + bl sub_8068AA4 + ldr r0, =task00_0800F6FC + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x87 + lsls r1, 1 + strh r1, [r0, 0xA] + movs r1, 0x5A + strh r1, [r0, 0xC] + strh r2, [r0, 0x12] + strh r2, [r0, 0xE] + strh r2, [r0, 0x10] + ldr r1, =0x020223c4 + adds r4, r0, 0 + adds r5, r1, 0x2 + movs r7, 0x3F + movs r6, 0x3 +_08037FA4: + ldrh r0, [r5] + str r2, [sp] + bl sub_8185F90 + ldr r0, =0x020229e8 + ldr r2, [sp] + adds r0, r2, r0 + ldrh r0, [r0, 0x18] + cmp r0, 0x1 + beq _08037FE6 + cmp r0, 0x1 + bgt _08037FD4 + cmp r0, 0 + beq _08037FDE + b _0803800C + .pool +_08037FD4: + cmp r0, 0x2 + beq _08037FEE + cmp r0, 0x3 + beq _08037FFE + b _0803800C +_08037FDE: + ldrh r0, [r5] + adds r1, r7, 0 + ands r1, r0 + b _08037FF6 +_08037FE6: + ldrh r0, [r5] + adds r1, r7, 0 + ands r1, r0 + b _08038006 +_08037FEE: + ldrh r0, [r5] + adds r1, r7, 0 + ands r1, r0 + lsls r1, 6 +_08037FF6: + ldrh r0, [r4, 0xE] + orrs r1, r0 + strh r1, [r4, 0xE] + b _0803800C +_08037FFE: + ldrh r0, [r5] + adds r1, r7, 0 + ands r1, r0 + lsls r1, 6 +_08038006: + ldrh r0, [r4, 0x10] + orrs r1, r0 + strh r1, [r4, 0x10] +_0803800C: + movs r0, 0x80 + lsls r0, 1 + adds r5, r0 + adds r2, 0x1C + subs r6, 0x1 + cmp r6, 0 + bge _08037FA4 + bl zero_enemy_party_data + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08038026: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08038032 + b _080383F8 +_08038032: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020244ec + movs r2, 0xC8 + bl link_0800A448 + b _080383A6 + .pool +_0803804C: + bl sub_800A550 + movs r1, 0xF + ands r1, r0 + cmp r1, 0xF + beq _0803805A + b _080383F8 +_0803805A: + bl sub_800A5B4 + movs r6, 0 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + mov r8, r0 + ldr r4, =0x020223c4 + movs r5, 0 +_0803806C: + cmp r6, r7 + bne _080380A0 + ldr r0, =0x020229e8 + adds r0, r5, r0 + ldrh r0, [r0, 0x18] + cmp r0, 0x2 + bgt _0803808C + cmp r0, 0x1 + bge _08038098 + cmp r0, 0 + beq _08038090 + b _0803812A + .pool +_0803808C: + cmp r0, 0x3 + bne _0803812A +_08038090: + ldr r0, =0x020244ec + b _08038110 + .pool +_08038098: + ldr r0, =0x02024618 + b _08038110 + .pool +_080380A0: + ldr r2, =0x020229e8 + adds r0, r5, r2 + ldrh r1, [r0, 0x18] + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _080380C4 + mov r1, r8 + adds r0, r1, r2 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _080380D2 + b _080380F8 + .pool +_080380C4: + mov r1, r8 + adds r0, r1, r2 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _080380F8 +_080380D2: + adds r0, r5, r2 + ldrh r0, [r0, 0x18] + cmp r0, 0x2 + bgt _080380E4 + cmp r0, 0x1 + bge _080380F0 + cmp r0, 0 + beq _080380E8 + b _0803812A +_080380E4: + cmp r0, 0x3 + bne _0803812A +_080380E8: + ldr r0, =0x020244ec + b _08038110 + .pool +_080380F0: + ldr r0, =0x02024618 + b _08038110 + .pool +_080380F8: + adds r0, r5, r2 + ldrh r0, [r0, 0x18] + cmp r0, 0x2 + bgt _0803810A + cmp r0, 0x1 + bge _08038120 + cmp r0, 0 + beq _0803810E + b _0803812A +_0803810A: + cmp r0, 0x3 + bne _0803812A +_0803810E: + ldr r0, =0x02024744 +_08038110: + adds r1, r4, 0 + movs r2, 0xC8 + bl memcpy + b _0803812A + .pool +_08038120: + ldr r0, =0x02024870 + adds r1, r4, 0 + movs r2, 0xC8 + bl memcpy +_0803812A: + movs r2, 0x80 + lsls r2, 1 + adds r4, r2 + adds r5, 0x1C + adds r6, 0x1 + cmp r6, 0x3 + ble _0803806C + b _080383A6 + .pool +_08038140: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _0803814C + b _080383F8 +_0803814C: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020245b4 + movs r2, 0x64 + bl link_0800A448 + b _080383A6 + .pool +_08038164: + bl sub_800A550 + movs r1, 0xF + ands r1, r0 + cmp r1, 0xF + beq _08038172 + b _080383F8 +_08038172: + bl sub_800A5B4 + movs r6, 0 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + mov r8, r0 + ldr r4, =0x020223c4 + movs r5, 0 +_08038184: + cmp r6, r7 + bne _080381B8 + ldr r0, =0x020229e8 + adds r0, r5, r0 + ldrh r0, [r0, 0x18] + cmp r0, 0x2 + bgt _080381A4 + cmp r0, 0x1 + bge _080381B0 + cmp r0, 0 + beq _080381A8 + b _08038242 + .pool +_080381A4: + cmp r0, 0x3 + bne _08038242 +_080381A8: + ldr r0, =0x020245b4 + b _08038228 + .pool +_080381B0: + ldr r0, =0x020246e0 + b _08038228 + .pool +_080381B8: + ldr r2, =0x020229e8 + adds r0, r5, r2 + ldrh r1, [r0, 0x18] + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _080381DC + mov r1, r8 + adds r0, r1, r2 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _080381EA + b _08038210 + .pool +_080381DC: + mov r1, r8 + adds r0, r1, r2 + ldrh r1, [r0, 0x18] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08038210 +_080381EA: + adds r0, r5, r2 + ldrh r0, [r0, 0x18] + cmp r0, 0x2 + bgt _080381FC + cmp r0, 0x1 + bge _08038208 + cmp r0, 0 + beq _08038200 + b _08038242 +_080381FC: + cmp r0, 0x3 + bne _08038242 +_08038200: + ldr r0, =0x020245b4 + b _08038228 + .pool +_08038208: + ldr r0, =0x020246e0 + b _08038228 + .pool +_08038210: + adds r0, r5, r2 + ldrh r0, [r0, 0x18] + cmp r0, 0x2 + bgt _08038222 + cmp r0, 0x1 + bge _08038238 + cmp r0, 0 + beq _08038226 + b _08038242 +_08038222: + cmp r0, 0x3 + bne _08038242 +_08038226: + ldr r0, =0x0202480c +_08038228: + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy + b _08038242 + .pool +_08038238: + ldr r0, =0x02024938 + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy +_08038242: + movs r2, 0x80 + lsls r2, 1 + adds r4, r2 + adds r5, 0x1C + adds r6, 0x1 + cmp r6, 0x3 + ble _08038184 + ldr r4, =0x020244ec + adds r0, r4, 0 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0x64 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0xC8 + bl shedinja_something + movs r1, 0x96 + lsls r1, 1 + adds r0, r4, r1 + bl shedinja_something + movs r2, 0xC8 + lsls r2, 1 + adds r0, r4, r2 + bl shedinja_something + movs r1, 0xFA + lsls r1, 1 + adds r0, r4, r1 + bl shedinja_something + ldr r4, =0x02024744 + adds r0, r4, 0 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0x64 + bl shedinja_something + adds r0, r4, 0 + adds r0, 0xC8 + bl shedinja_something + movs r2, 0x96 + lsls r2, 1 + adds r0, r4, r2 + bl shedinja_something + movs r1, 0xC8 + lsls r1, 1 + adds r0, r4, r1 + bl shedinja_something + movs r2, 0xFA + lsls r2, 1 + adds r0, r4, r2 + bl shedinja_something + b _080383A6 + .pool +_080382CC: + bl sub_8032768 + bl sub_8184E58 + ldr r3, =0x02024332 + movs r0, 0 + strb r0, [r3, 0x1] + strb r0, [r3, 0x2] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08038326 + movs r6, 0 + ldr r0, =0x020229e8 + ldrb r1, [r0] + adds r4, r3, 0 + adds r2, r0, 0 + cmp r1, 0x3 + bne _0803830A + movs r3, 0xFF +_080382F8: + adds r2, 0x1C + adds r6, 0x1 + cmp r6, 0x3 + bgt _0803830A + ldrh r1, [r2] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0x3 + beq _080382F8 +_0803830A: + cmp r6, 0x4 + bne _08038320 + movs r0, 0x8 + strb r0, [r4] + b _080383F8 + .pool +_08038320: + movs r0, 0xA + strb r0, [r4] + b _080383F8 +_08038326: + movs r0, 0xA + strb r0, [r3] + b _080383F8 +_0803832C: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080383F8 + ldr r0, =0x0202449c + ldr r4, [r0] + movs r0, 0xC0 + lsls r0, 1 + adds r4, r0 + ldr r0, =0x02022fec + ldr r0, [r0] + str r0, [r4] + ldr r0, =0x0203bd2c + ldr r0, [r0] + str r0, [r4, 0x4] + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + movs r2, 0x8 + bl link_0800A448 + b _080383A6 + .pool +_0803836C: + bl sub_800A550 + movs r1, 0xF + ands r1, r0 + cmp r1, 0xF + bne _080383F8 + bl sub_800A5B4 + movs r2, 0 + b _08038386 +_08038380: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_08038386: + cmp r2, 0x3 + bhi _080383A6 + ldr r4, =0x020223c4 + lsls r3, r2, 8 + adds r0, r3, r4 + ldrh r0, [r0] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08038380 + adds r1, r4, 0x4 + adds r1, r3, r1 + ldr r0, =0x0203bd2c + movs r2, 0x4 + bl memcpy +_080383A6: + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080383F8 + .pool +_080383BC: + ldr r0, =0x02024333 + adds r1, r0, 0x1 + bl battle_load_something + lsls r0, 24 + cmp r0, 0 + beq _080383F8 + ldr r2, =0x03005d00 + ldr r1, =0x030022c0 + ldr r0, [r1] + str r0, [r2] + ldr r0, =sub_8039EF0 + str r0, [r1] + ldr r0, =sub_8038420 + bl SetMainCallback2 + ldr r3, =0x02022fec + ldr r2, [r3] + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _080383F8 + ldr r0, =0x02038bca + movs r4, 0x80 + lsls r4, 4 + adds r1, r4, 0 + strh r1, [r0] + movs r0, 0x20 + orrs r2, r0 + str r2, [r3] +_080383F8: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8037DF4 + + thumb_func_start sub_8038420 +sub_8038420: @ 8038420 + push {lr} + sub sp, 0x4 + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + bl RunTasks + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2C] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08038482 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08038482 + bl rfu_lacks_rfufunc + lsls r0, 24 + cmp r0, 0 + beq _08038482 + ldr r2, =0x020375f0 + ldr r1, =0x0202433a + movs r0, 0x5 + strb r0, [r1] + movs r0, 0x5 + strh r0, [r2] + bl pal_fade_control_reset_maybe + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_80384E4 + bl SetMainCallback2 +_08038482: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8038420 + + thumb_func_start sub_803849C +sub_803849C: @ 803849C + push {lr} + ldr r1, =0x030022c0 + ldr r0, =0x03005d00 + ldr r0, [r0] + str r0, [r1] + ldr r2, =0x02039b28 + movs r0, 0x3 + strb r0, [r2, 0x15] + ldr r0, =0x00000439 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + bl zero_enemy_party_data + movs r0, 0x5A + bl m4aSongNumStop + bl sub_805F094 + bl dp11_free + bl sub_8057028 + pop {r0} + bx r0 + .pool + thumb_func_end sub_803849C + + thumb_func_start sub_80384E4 +sub_80384E4: @ 80384E4 + push {lr} + bl fade_and_return_progress_probably + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08038512 + ldr r0, =0x030075f0 + bl MPlayStop_rev01 + ldr r0, =0x03007630 + bl MPlayStop_rev01 + bl sub_803849C + bl FreeAllWindowBuffers + ldr r0, =0x030022c0 + ldr r0, [r0, 0x8] + bl SetMainCallback2 +_08038512: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80384E4 + + thumb_func_start sub_8038528 +sub_8038528: @ 8038528 + movs r1, 0 + strh r1, [r0, 0x2E] + ldr r1, =sub_8038538 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_8038528 + + thumb_func_start sub_8038538 +sub_8038538: @ 8038538 + push {r4,r5,lr} + adds r3, r0, 0 + ldr r5, =0x0201c000 + movs r0, 0x2E + ldrsh r1, [r3, r0] + cmp r1, 0x1 + beq _0803856C + cmp r1, 0x1 + bgt _08038554 + cmp r1, 0 + beq _0803855A + b _080385DC + .pool +_08038554: + cmp r1, 0x2 + beq _080385C8 + b _080385DC +_0803855A: + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + strh r1, [r3, 0x30] + ldr r0, =0x00000281 + strh r0, [r3, 0x32] + strh r1, [r3, 0x34] + movs r0, 0x1 + strh r0, [r3, 0x36] +_0803856C: + ldrh r0, [r3, 0x36] + subs r0, 0x1 + strh r0, [r3, 0x36] + lsls r0, 16 + cmp r0, 0 + bne _080385DC + movs r0, 0x2 + strh r0, [r3, 0x36] + movs r4, 0x30 + ldrsh r2, [r3, r4] + movs r0, 0x34 + ldrsh r1, [r3, r0] + lsls r1, 5 + adds r2, r1 + movs r4, 0x32 + ldrsh r0, [r3, r4] + subs r0, r1 + movs r4, 0x3D + lsls r0, 1 + adds r0, r5 + lsls r2, 1 + adds r2, r5 + movs r1, 0x1C +_0803859A: + strh r4, [r2] + strh r4, [r0] + adds r0, 0x4 + adds r2, 0x4 + subs r1, 0x2 + cmp r1, 0 + bge _0803859A + ldrh r0, [r3, 0x34] + adds r0, 0x1 + strh r0, [r3, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x15 + bne _080385DC + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + movs r0, 0x20 + strh r0, [r3, 0x30] + b _080385DC + .pool +_080385C8: + ldrh r0, [r3, 0x30] + subs r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + bne _080385DC + ldr r0, =sub_8036760 + bl SetMainCallback2 +_080385DC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8038538 + + thumb_func_start LoadTrainerParty +LoadTrainerParty: @ 80385E8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + str r0, [sp, 0x10] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x14] + lsls r2, 24 + lsrs r2, 24 + movs r0, 0 + mov r9, r0 + movs r0, 0x80 + lsls r0, 3 + cmp r1, r0 + bne _08038610 + movs r0, 0 + b _080389E2 +_08038610: + ldr r4, =0x02022fec + ldr r0, [r4] + ldr r1, =0x043f0908 + ands r0, r1 + ldr r1, [sp, 0x14] + lsls r1, 2 + str r1, [sp, 0x20] + cmp r0, 0x8 + beq _08038624 + b _080389D2 +_08038624: + cmp r2, 0x1 + bne _0803862C + bl zero_enemy_party_data +_0803862C: + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _08038668 + ldr r0, =gTrainers + ldr r2, [sp, 0x20] + ldr r3, [sp, 0x14] + adds r1, r2, r3 + lsls r1, 3 + adds r1, r0 + adds r2, r1, 0 + adds r2, 0x20 + ldrb r1, [r2] + movs r4, 0x3 + str r4, [sp, 0x1C] + adds r4, r0, 0 + cmp r1, 0x3 + bhi _0803867C + adds r2, r1, 0 + str r2, [sp, 0x1C] + b _0803867C + .pool +_08038668: + ldr r1, =gTrainers + ldr r2, [sp, 0x20] + ldr r3, [sp, 0x14] + adds r0, r2, r3 + lsls r0, 3 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + str r0, [sp, 0x1C] + adds r4, r1, 0 +_0803867C: + movs r0, 0 + str r0, [sp, 0x18] + b _080389B4 + .pool +_08038688: + ldr r2, [sp, 0x20] + ldr r3, [sp, 0x14] + adds r0, r2, r3 + lsls r0, 3 + adds r1, r0, r4 + ldrb r0, [r1, 0x18] + cmp r0, 0x1 + bne _0803869E + movs r0, 0x80 + mov r10, r0 + b _080386B0 +_0803869E: + ldrb r1, [r1, 0x2] + movs r0, 0x80 + ands r0, r1 + movs r1, 0x88 + mov r10, r1 + cmp r0, 0 + beq _080386B0 + movs r2, 0x78 + mov r10, r2 +_080386B0: + movs r6, 0 + ldr r2, [sp, 0x20] + ldr r3, [sp, 0x14] + adds r0, r2, r3 + lsls r0, 3 + adds r1, r4, 0x4 + adds r0, r1 + ldrb r0, [r0] + ldr r3, [sp, 0x18] + adds r3, 0x1 + str r3, [sp, 0x24] + cmp r0, 0xFF + beq _080386E6 + adds r3, r1, 0 +_080386CC: + ldr r0, [sp, 0x14] + adds r1, r2, r0 + lsls r1, 3 + adds r0, r6, r1 + adds r0, r3 + ldrb r0, [r0] + add r9, r0 + adds r6, 0x1 + adds r1, r6, r1 + adds r1, r3 + ldrb r0, [r1] + cmp r0, 0xFF + bne _080386CC +_080386E6: + ldr r1, [sp, 0x20] + ldr r2, [sp, 0x14] + adds r0, r1, r2 + lsls r1, r0, 3 + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08038794 + cmp r0, 0x1 + bgt _08038700 + cmp r0, 0 + beq _0803870E + b _080389AC +_08038700: + cmp r0, 0x2 + bne _08038706 + b _08038854 +_08038706: + cmp r0, 0x3 + bne _0803870C + b _080388E8 +_0803870C: + b _080389AC +_0803870E: + adds r0, r4, 0 + adds r0, 0x24 + adds r0, r1, r0 + ldr r4, [r0] + movs r6, 0 + ldr r3, [sp, 0x18] + lsls r2, r3, 3 + adds r0, r2, r4 + ldrh r1, [r0, 0x4] + movs r0, 0xB + muls r0, r1 + ldr r1, =gSpeciesNames + adds r0, r1 + ldrb r0, [r0] + adds r5, r2, 0 + cmp r0, 0xFF + beq _08038750 + adds r3, r1, 0 + movs r7, 0xB +_08038734: + adds r0, r2, r4 + ldrh r0, [r0, 0x4] + adds r1, r0, 0 + muls r1, r7 + adds r0, r6, r1 + adds r0, r3 + ldrb r0, [r0] + add r9, r0 + adds r6, 0x1 + adds r1, r6, r1 + adds r1, r3 + ldrb r0, [r1] + cmp r0, 0xFF + bne _08038734 +_08038750: + mov r2, r9 + lsls r0, r2, 8 + add r10, r0 + adds r4, r5, r4 + ldrh r1, [r4] + lsls r0, r1, 5 + subs r0, r1 + movs r1, 0xFF + bl __divsi3 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r3, [sp, 0x18] + movs r1, 0x64 + adds r0, r3, 0 + muls r0, r1 + ldr r2, [sp, 0x10] + adds r0, r2, r0 + ldrh r1, [r4, 0x4] + ldrb r2, [r4, 0x2] + movs r3, 0x1 + str r3, [sp] + mov r3, r10 + str r3, [sp, 0x4] + movs r3, 0x2 + str r3, [sp, 0x8] + movs r3, 0 + str r3, [sp, 0xC] + adds r3, r6, 0 + bl create_pokemon_set_level + b _080389AC + .pool +_08038794: + adds r0, r4, 0 + adds r0, 0x24 + adds r0, r1, r0 + ldr r7, [r0] + movs r6, 0 + ldr r4, [sp, 0x18] + lsls r2, r4, 4 + adds r0, r2, r7 + ldrh r1, [r0, 0x4] + movs r0, 0xB + muls r0, r1 + ldr r1, =gSpeciesNames + adds r0, r1 + ldrb r0, [r0] + mov r8, r2 + cmp r0, 0xFF + beq _080387D6 + adds r3, r1, 0 + movs r4, 0xB +_080387BA: + adds r0, r2, r7 + ldrh r0, [r0, 0x4] + adds r1, r0, 0 + muls r1, r4 + adds r0, r6, r1 + adds r0, r3 + ldrb r0, [r0] + add r9, r0 + adds r6, 0x1 + adds r1, r6, r1 + adds r1, r3 + ldrb r0, [r1] + cmp r0, 0xFF + bne _080387BA +_080387D6: + mov r2, r9 + lsls r0, r2, 8 + add r10, r0 + mov r3, r8 + adds r4, r3, r7 + ldrh r1, [r4] + lsls r0, r1, 5 + subs r0, r1 + movs r1, 0xFF + bl __divsi3 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, [sp, 0x18] + movs r1, 0x64 + adds r5, r0, 0 + muls r5, r1 + ldr r2, [sp, 0x10] + adds r5, r2, r5 + ldrh r1, [r4, 0x4] + ldrb r2, [r4, 0x2] + movs r0, 0x1 + str r0, [sp] + mov r3, r10 + str r3, [sp, 0x4] + movs r0, 0x2 + str r0, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + adds r0, r5, 0 + adds r3, r6, 0 + bl create_pokemon_set_level + movs r6, 0 + mov r0, r8 + adds r0, 0x6 + adds r4, r7, r0 +_08038820: + adds r1, r6, 0 + adds r1, 0xD + adds r0, r5, 0 + adds r2, r4, 0 + bl pokemon_setattr + adds r1, r6, 0 + adds r1, 0x11 + ldrh r0, [r4] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + ldr r0, =gBattleMoves + 0x4 @ PP offset + adds r2, r0 + adds r0, r5, 0 + bl pokemon_setattr + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _08038820 + b _080389AC + .pool +_08038854: + adds r0, r4, 0 + adds r0, 0x24 + adds r0, r1, r0 + ldr r4, [r0] + movs r6, 0 + ldr r0, [sp, 0x18] + lsls r2, r0, 3 + adds r0, r2, r4 + ldrh r1, [r0, 0x4] + movs r0, 0xB + muls r0, r1 + ldr r1, =gSpeciesNames + adds r0, r1 + ldrb r0, [r0] + adds r5, r2, 0 + cmp r0, 0xFF + beq _08038896 + adds r3, r1, 0 + movs r7, 0xB +_0803887A: + adds r0, r2, r4 + ldrh r0, [r0, 0x4] + adds r1, r0, 0 + muls r1, r7 + adds r0, r6, r1 + adds r0, r3 + ldrb r0, [r0] + add r9, r0 + adds r6, 0x1 + adds r1, r6, r1 + adds r1, r3 + ldrb r0, [r1] + cmp r0, 0xFF + bne _0803887A +_08038896: + mov r2, r9 + lsls r0, r2, 8 + add r10, r0 + adds r5, r4 + ldrh r1, [r5] + lsls r0, r1, 5 + subs r0, r1 + movs r1, 0xFF + bl __divsi3 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r3, [sp, 0x18] + movs r0, 0x64 + adds r4, r3, 0 + muls r4, r0 + ldr r1, [sp, 0x10] + adds r4, r1, r4 + ldrh r1, [r5, 0x4] + ldrb r2, [r5, 0x2] + movs r0, 0x1 + str r0, [sp] + mov r3, r10 + str r3, [sp, 0x4] + movs r0, 0x2 + str r0, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + adds r0, r4, 0 + adds r3, r6, 0 + bl create_pokemon_set_level + adds r5, 0x6 + adds r0, r4, 0 + movs r1, 0xC + adds r2, r5, 0 + bl pokemon_setattr + b _080389AC + .pool +_080388E8: + adds r0, r4, 0 + adds r0, 0x24 + adds r0, r1, r0 + ldr r7, [r0] + movs r6, 0 + ldr r4, [sp, 0x18] + lsls r2, r4, 4 + adds r0, r2, r7 + ldrh r1, [r0, 0x4] + movs r0, 0xB + muls r0, r1 + ldr r1, =gSpeciesNames + adds r0, r1 + ldrb r0, [r0] + mov r8, r2 + cmp r0, 0xFF + beq _0803892A + adds r3, r1, 0 + movs r4, 0xB +_0803890E: + adds r0, r2, r7 + ldrh r0, [r0, 0x4] + adds r1, r0, 0 + muls r1, r4 + adds r0, r6, r1 + adds r0, r3 + ldrb r0, [r0] + add r9, r0 + adds r6, 0x1 + adds r1, r6, r1 + adds r1, r3 + ldrb r0, [r1] + cmp r0, 0xFF + bne _0803890E +_0803892A: + mov r2, r9 + lsls r0, r2, 8 + add r10, r0 + mov r3, r8 + adds r5, r3, r7 + ldrh r1, [r5] + lsls r0, r1, 5 + subs r0, r1 + movs r1, 0xFF + bl __divsi3 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, [sp, 0x18] + movs r1, 0x64 + adds r4, r0, 0 + muls r4, r1 + ldr r2, [sp, 0x10] + adds r4, r2, r4 + ldrh r1, [r5, 0x4] + ldrb r2, [r5, 0x2] + movs r0, 0x1 + str r0, [sp] + mov r3, r10 + str r3, [sp, 0x4] + movs r0, 0x2 + str r0, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + adds r0, r4, 0 + adds r3, r6, 0 + bl create_pokemon_set_level + adds r5, 0x6 + adds r0, r4, 0 + movs r1, 0xC + adds r2, r5, 0 + bl pokemon_setattr + movs r6, 0 + adds r5, r4, 0 + mov r0, r8 + adds r0, 0x8 + adds r4, r7, r0 +_08038982: + adds r1, r6, 0 + adds r1, 0xD + adds r0, r5, 0 + adds r2, r4, 0 + bl pokemon_setattr + adds r1, r6, 0 + adds r1, 0x11 + ldrh r0, [r4] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + ldr r0, =gBattleMoves + 0x4 @ PP offset + adds r2, r0 + adds r0, r5, 0 + bl pokemon_setattr + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _08038982 +_080389AC: + ldr r4, [sp, 0x24] + str r4, [sp, 0x18] + ldr r4, =gTrainers + ldr r0, [sp, 0x18] +_080389B4: + ldr r1, [sp, 0x1C] + cmp r0, r1 + bge _080389BC + b _08038688 +_080389BC: + ldr r2, =0x02022fec + ldr r1, =gTrainers + ldr r3, [sp, 0x20] + ldr r4, [sp, 0x14] + adds r0, r3, r4 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x18] + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] +_080389D2: + ldr r0, =gTrainers + ldr r2, [sp, 0x20] + ldr r3, [sp, 0x14] + adds r1, r2, r3 + lsls r1, 3 + adds r1, r0 + adds r1, 0x20 + ldrb r0, [r1] +_080389E2: + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end LoadTrainerParty + + thumb_func_start sub_8038A04 +sub_8038A04: @ 8038A04 + push {lr} + ldr r0, =0x04000006 + ldrh r0, [r0] + subs r0, 0x6F + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x30 + bhi _08038A1E + movs r1, 0x98 + lsls r1, 8 + movs r0, 0x8 + bl SetGpuReg +_08038A1E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8038A04 + + thumb_func_start vblank_cb_08078BB4 +vblank_cb_08078BB4: @ 8038A28 + push {lr} + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x013f0102 + ands r0, r1 + cmp r0, 0 + bne _08038A3A + bl GenerateRandomNumber +_08038A3A: + ldr r0, =0x02022e14 + ldrh r1, [r0] + movs r0, 0x10 + bl SetGpuReg + ldr r0, =0x02022e16 + ldrh r1, [r0] + movs r0, 0x12 + bl SetGpuReg + ldr r0, =0x02022e18 + ldrh r1, [r0] + movs r0, 0x14 + bl SetGpuReg + ldr r0, =0x02022e1a + ldrh r1, [r0] + movs r0, 0x16 + bl SetGpuReg + ldr r0, =0x02022e1c + ldrh r1, [r0] + movs r0, 0x18 + bl SetGpuReg + ldr r0, =0x02022e1e + ldrh r1, [r0] + movs r0, 0x1A + bl SetGpuReg + ldr r0, =0x02022e20 + ldrh r1, [r0] + movs r0, 0x1C + bl SetGpuReg + ldr r0, =0x02022e22 + ldrh r1, [r0] + movs r0, 0x1E + bl SetGpuReg + ldr r0, =0x02022e24 + ldrh r1, [r0] + movs r0, 0x40 + bl SetGpuReg + ldr r0, =0x02022e26 + ldrh r1, [r0] + movs r0, 0x44 + bl SetGpuReg + ldr r0, =0x02022e28 + ldrh r1, [r0] + movs r0, 0x42 + bl SetGpuReg + ldr r0, =0x02022e2a + ldrh r1, [r0] + movs r0, 0x46 + bl SetGpuReg + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + bl sub_80BA0A8 + pop {r0} + bx r0 + .pool + thumb_func_end vblank_cb_08078BB4 + + thumb_func_start nullsub_17 +nullsub_17: @ 8038B00 + bx lr + thumb_func_end nullsub_17 + + thumb_func_start sub_8038B04 +sub_8038B04: @ 8038B04 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08038B24 + movs r1, 0x32 + ldrsh r0, [r5, r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + lsrs r0, 8 + ldrh r1, [r5, 0x30] + adds r0, r1 + strh r0, [r5, 0x20] + b _08038B36 +_08038B24: + movs r1, 0x32 + ldrsh r0, [r5, r1] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + asrs r0, 8 + ldrh r1, [r5, 0x30] + subs r1, r0 + strh r1, [r5, 0x20] +_08038B36: + movs r1, 0xC0 + lsls r1, 1 + adds r0, r1, 0 + ldrh r1, [r5, 0x32] + adds r0, r1 + strh r0, [r5, 0x32] + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08038B6A + ldr r4, =0x00002710 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + adds r0, r5, 0 + bl obj_free_rotscale_entry + adds r0, r5, 0 + bl RemoveObjectAndFreeTiles +_08038B6A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8038B04 + + thumb_func_start sub_8038B74 +sub_8038B74: @ 8038B74 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + ldr r0, =sub_8038B04 + str r0, [r4, 0x1C] + movs r0, 0x68 + bl audio_play + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8038B74 + + thumb_func_start sub_8038B94 +sub_8038B94: @ 8038B94 + 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, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + ldr r0, =0x02024474 + adds r0, 0x25 + ldrb r2, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08038C04 + ldr r1, =0x020229e8 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x18] + cmp r0, 0x1 + beq _08038BF0 + cmp r0, 0x1 + bgt _08038BE8 + cmp r0, 0 + beq _08038C04 + b _08038C0C + .pool +_08038BE8: + cmp r0, 0x2 + beq _08038C04 + cmp r0, 0x3 + bne _08038C0C +_08038BF0: + ldr r0, =0x02024744 + str r0, [sp, 0x4] + ldr r1, =0x020244ec + str r1, [sp, 0x8] + b _08038C0C + .pool +_08038C04: + ldr r2, =0x020244ec + str r2, [sp, 0x4] + ldr r3, =0x02024744 + str r3, [sp, 0x8] +_08038C0C: + movs r7, 0 + movs r0, 0 + mov r8, r0 + ldr r1, [sp] + lsls r1, 2 + str r1, [sp, 0xC] + movs r2, 0xCE + lsls r2, 1 + mov r10, r2 + mov r9, r0 +_08038C20: + movs r0, 0x64 + mov r4, r8 + muls r4, r0 + ldr r3, [sp, 0x4] + adds r4, r3, r4 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + adds r1, r0, 0 + cmp r5, 0 + beq _08038C90 + cmp r5, r10 + beq _08038C64 + cmp r6, 0 + beq _08038C64 + cmp r1, 0 + bne _08038C64 + movs r0, 0x1 + mov r2, r9 + lsls r0, r2 + orrs r7, r0 +_08038C64: + cmp r5, 0 + beq _08038C90 + cmp r6, 0 + beq _08038C7C + cmp r5, r10 + beq _08038C74 + cmp r1, 0 + beq _08038C7C +_08038C74: + movs r0, 0x2 + mov r3, r9 + lsls r0, r3 + orrs r7, r0 +_08038C7C: + cmp r5, 0 + beq _08038C90 + cmp r5, r10 + beq _08038C90 + cmp r6, 0 + bne _08038C90 + movs r0, 0x3 + mov r1, r9 + lsls r0, r1 + orrs r7, r0 +_08038C90: + movs r2, 0x2 + add r9, r2 + movs r3, 0x1 + add r8, r3 + mov r0, r8 + cmp r0, 0x5 + ble _08038C20 + ldr r1, =0x03005e00 + ldr r2, [sp, 0xC] + ldr r3, [sp] + adds r0, r2, r3 + lsls r0, 3 + adds r0, r1 + strh r7, [r0, 0xE] + movs r7, 0 + movs r0, 0 + mov r8, r0 + movs r1, 0xCE + lsls r1, 1 + mov r10, r1 + mov r9, r0 +_08038CBA: + movs r0, 0x64 + mov r4, r8 + muls r4, r0 + ldr r2, [sp, 0x8] + adds r4, r2, r4 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + adds r1, r0, 0 + cmp r5, 0 + beq _08038D2A + cmp r5, r10 + beq _08038CFE + cmp r6, 0 + beq _08038CFE + cmp r1, 0 + bne _08038CFE + movs r0, 0x1 + mov r3, r9 + lsls r0, r3 + orrs r7, r0 +_08038CFE: + cmp r5, 0 + beq _08038D2A + cmp r6, 0 + beq _08038D16 + cmp r5, r10 + beq _08038D0E + cmp r1, 0 + beq _08038D16 +_08038D0E: + movs r0, 0x2 + mov r1, r9 + lsls r0, r1 + orrs r7, r0 +_08038D16: + cmp r5, 0 + beq _08038D2A + cmp r5, r10 + beq _08038D2A + cmp r6, 0 + bne _08038D2A + movs r0, 0x3 + mov r2, r9 + lsls r0, r2 + orrs r7, r0 +_08038D2A: + movs r3, 0x2 + add r9, r3 + movs r0, 0x1 + add r8, r0 + mov r1, r8 + cmp r1, 0x5 + ble _08038CBA + ldr r1, =0x03005e00 + ldr r2, [sp, 0xC] + ldr r3, [sp] + adds r0, r2, r3 + lsls r0, 3 + adds r0, r1 + strh r7, [r0, 0x10] + 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_8038B94 + + thumb_func_start sub_8038D64 +sub_8038D64: @ 8038D64 + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + ldr r0, =0x02022fec + ldr r1, [r0] + movs r2, 0x21 + negs r2, r2 + ands r1, r2 + str r1, [r0] + ldr r0, =0x003f0100 + ands r0, r1 + cmp r0, 0 + beq _08038DAC + ldr r0, =0x030022c0 + ldr r0, [r0, 0x8] + bl SetMainCallback2 + bl sub_8057028 + bl dp11_free + bl sub_805F094 + b _08038EB6 + .pool +_08038DAC: + str r0, [sp] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + mov r0, sp + bl CpuSet + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + movs r0, 0x40 + movs r1, 0xF0 + bl SetGpuReg + ldr r4, =0x00005051 + movs r0, 0x44 + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0 + bl SetGpuReg + ldr r1, =0x02022e24 + movs r0, 0xF0 + strh r0, [r1] + ldr r0, =0x02022e26 + strh r4, [r0] + bl dp12_8087EA4 + ldr r0, =0x02038c28 + movs r3, 0xF0 + movs r1, 0xF0 + lsls r1, 3 + adds r2, r0, r1 + movs r1, 0x4F +_08038DFE: + strh r3, [r0] + strh r3, [r2] + adds r2, 0x2 + adds r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08038DFE + movs r1, 0x50 + ldr r0, =0x02038c28 + ldr r3, =0x0000ff10 + movs r4, 0x82 + lsls r4, 4 + adds r2, r0, r4 + adds r0, 0xA0 +_08038E1A: + strh r3, [r0] + strh r3, [r2] + adds r2, 0x2 + adds r0, 0x2 + adds r1, 0x1 + cmp r1, 0x9F + ble _08038E1A + bl sub_80A1A74 + ldr r0, =0x02022e14 + movs r4, 0 + strh r4, [r0] + ldr r0, =0x02022e16 + strh r4, [r0] + ldr r0, =0x02022e18 + strh r4, [r0] + ldr r0, =0x02022e1a + strh r4, [r0] + ldr r0, =0x02022e1c + strh r4, [r0] + ldr r0, =0x02022e1e + strh r4, [r0] + ldr r0, =0x02022e20 + strh r4, [r0] + ldr r0, =0x02022e22 + strh r4, [r0] + bl c2_berry_program_update_menu + ldr r0, =gUnknown_08C004E0 + movs r1, 0 + movs r2, 0x40 + bl decompress_palette + bl sub_803570C + bl ResetAllObjectData + bl ResetTasks + bl sub_8036154 + movs r0, 0x4A + movs r1, 0x37 + bl SetGpuReg + bl ResetObjectPaletteAllocator + ldr r1, =0x0300301c + movs r0, 0x4 + strb r0, [r1] + ldr r0, =vblank_cb_08078BB4 + bl SetVBlankCallback + ldr r0, =task00_0800F6FC + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x87 + lsls r2, 1 + strh r2, [r1, 0xA] + movs r2, 0x5A + strh r2, [r1, 0xC] + movs r2, 0x1 + strh r2, [r1, 0x12] + bl sub_8038B94 + ldr r0, =sub_8038F14 + bl SetMainCallback2 + ldr r0, =0x02024332 + strb r4, [r0] +_08038EB6: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8038D64 + + thumb_func_start sub_8038F14 +sub_8038F14: @ 8038F14 + push {lr} + bl sub_8038F34 + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + bl RunTasks + pop {r0} + bx r0 + thumb_func_end sub_8038F14 + + thumb_func_start sub_8038F34 +sub_8038F34: @ 8038F34 + push {r4-r6,lr} + sub sp, 0x8 + ldr r0, =0x02024332 + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0x9 + bls _08038F44 + b _080391C6 +_08038F44: + lsls r0, r1, 2 + ldr r1, =_08038F58 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08038F58: + .4byte _08038F80 + .4byte _08038FA0 + .4byte _08038FC2 + .4byte _080390C8 + .4byte _08039100 + .4byte _08039118 + .4byte _0803912C + .4byte _0803914C + .4byte _08039166 + .4byte _08039184 +_08038F80: + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + ldr r1, =0x02024332 + movs r0, 0xFF + strb r0, [r1, 0x1] + b _08039174 + .pool +_08038FA0: + ldrb r0, [r4, 0x1] + subs r0, 0x1 + strb r0, [r4, 0x1] + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08038FB0 + b _080391C6 +_08038FB0: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _0803910C +_08038FC2: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08038FD0 + b _080391C6 +_08038FD0: + bl sub_8185FAC + ldr r2, =0x030022c0 + ldr r1, =0x00000439 + adds r2, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + movs r3, 0x2 + cmp r0, 0 + beq _08038FFC + movs r3, 0x4 +_08038FFC: + movs r4, 0 + ldr r6, =0x03005d90 + cmp r4, r3 + bge _08039022 + ldr r1, =0x020229e8 + ldrb r0, [r1] + cmp r0, 0x3 + bne _08039022 + movs r5, 0xFF + adds r2, r1, 0 +_08039010: + adds r2, 0x1C + adds r4, 0x1 + cmp r4, r3 + bge _08039022 + ldrh r1, [r2] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0x3 + beq _08039010 +_08039022: + ldr r0, [r6] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _080390AC + cmp r4, r3 + bne _080390AC + ldr r0, =0x000008d2 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08039074 + bl FreeAllWindowBuffers + ldr r0, =sub_80392A8 + bl SetMainCallback2 + b _080391C6 + .pool +_08039074: + ldr r2, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _08039090 + ldr r0, [r2, 0x8] + b _080390B0 + .pool +_08039090: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08039172 + ldr r0, =sub_80B3AF8 + movs r1, 0x5 + bl CreateTask + b _08039172 + .pool +_080390AC: + ldr r0, =0x030022c0 + ldr r0, [r0, 0x8] +_080390B0: + bl SetMainCallback2 + bl sub_8057028 + bl dp11_free + bl sub_805F094 + b _080391C6 + .pool +_080390C8: + movs r0, 0 + str r0, [sp, 0x4] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + add r0, sp, 0x4 + bl CpuSet + movs r4, 0 +_080390DA: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80363C4 + adds r4, 0x1 + cmp r4, 0x1 + ble _080390DA + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + b _08039172 + .pool +_08039100: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080391C6 +_0803910C: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _080391C6 + .pool +_08039118: + ldr r0, =sub_80B3AF8 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + bne _080391C6 + b _08039172 + .pool +_0803912C: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080391C6 + bl sub_800ADF8 + ldr r0, =gUnknown_0824978D + movs r1, 0 + bl battle_show_message_maybe + b _08039172 + .pool +_0803914C: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _080391C6 + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080391C6 + b _08039172 +_08039166: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _08039172 + bl sub_800AC34 +_08039172: + ldr r1, =0x02024332 +_08039174: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080391C6 + .pool +_08039184: + ldr r2, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + adds r3, r2, 0 + cmp r0, 0 + beq _080391A6 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _080391A6 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080391C6 +_080391A6: + ldr r0, =0x00000439 + adds r2, r3, r0 + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, [r3, 0x8] + bl SetMainCallback2 + bl sub_8057028 + bl dp11_free + bl sub_805F094 +_080391C6: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8038F34 + + thumb_func_start sub_80391E0 +sub_80391E0: @ 80391E0 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + cmp r1, 0x6 + bhi _080392A0 + lsls r0, r1, 2 + ldr r1, =_08039200 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08039200: + .4byte _0803921C + .4byte _08039230 + .4byte _08039244 + .4byte _08039258 + .4byte _0803926C + .4byte _08039280 + .4byte _08039294 +_0803921C: + ldr r0, =gUnknown_0831AA08 + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 30 + lsrs r0, 30 + b _080392A0 + .pool +_08039230: + ldr r0, =gUnknown_0831AA08 + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 28 + lsrs r0, 30 + b _080392A0 + .pool +_08039244: + ldr r0, =gUnknown_0831AA08 + lsls r1, r2, 2 + adds r1, r0 + ldrh r0, [r1] + lsls r0, 23 + lsrs r0, 27 + b _080392A0 + .pool +_08039258: + ldr r0, =gUnknown_0831AA08 + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 29 + lsrs r0, 30 + b _080392A0 + .pool +_0803926C: + ldr r0, =gUnknown_0831AA08 + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 28 + lsrs r0, 31 + b _080392A0 + .pool +_08039280: + ldr r0, =gUnknown_0831AA08 + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 26 + lsrs r0, 30 + b _080392A0 + .pool +_08039294: + ldr r0, =gUnknown_0831AA08 + lsls r1, r2, 2 + adds r1, r0 + ldr r0, [r1] + lsls r0, 8 + lsrs r0, 22 +_080392A0: + pop {r1} + bx r1 + .pool + thumb_func_end sub_80391E0 + + thumb_func_start sub_80392A8 +sub_80392A8: @ 80392A8 + push {r4,lr} + sub sp, 0x8 + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + bl SetVBlankCallback + movs r4, 0 + str r4, [sp, 0x4] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + add r0, sp, 0x4 + bl CpuSet + bl sub_80A1A74 + ldr r0, =0x02022e14 + strh r4, [r0] + ldr r0, =0x02022e16 + strh r4, [r0] + ldr r0, =0x02022e18 + strh r4, [r0] + ldr r0, =0x02022e1a + strh r4, [r0] + ldr r0, =0x02022e1c + strh r4, [r0] + ldr r0, =0x02022e1e + strh r4, [r0] + ldr r0, =0x02022e20 + strh r4, [r0] + ldr r0, =0x02022e22 + strh r4, [r0] + bl c2_berry_program_update_menu + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + bl sub_803570C +_080392FE: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80363C4 + adds r4, 0x1 + cmp r4, 0x1 + ble _080392FE + bl ResetAllObjectData + bl ResetTasks + bl ResetObjectPaletteAllocator + ldr r1, =0x0300301c + movs r0, 0x4 + strb r0, [r1] + ldr r0, =vblank_cb_08078BB4 + bl SetVBlankCallback + ldr r0, =sub_803937C + bl SetMainCallback2 + movs r0, 0x1 + negs r0, r0 + movs r4, 0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =0x02024332 + strb r4, [r0] + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80392A8 + + thumb_func_start sub_803937C +sub_803937C: @ 803937C + push {lr} + bl sub_803939C + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + bl RunTasks + pop {r0} + bx r0 + thumb_func_end sub_803937C + + thumb_func_start sub_803939C +sub_803939C: @ 803939C + push {r4,r5,lr} + sub sp, 0x4 + ldr r0, =0x02024332 + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0xC + bls _080393AC + b _0803975E +_080393AC: + lsls r0, r1, 2 + ldr r1, =_080393C0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080393C0: + .4byte _080393F4 + .4byte _08039414 + .4byte _08039450 + .4byte _08039470 + .4byte _0803949C + .4byte _080394D8 + .4byte _0803957C + .4byte _08039704 + .4byte _080395CC + .4byte _08039610 + .4byte _08039678 + .4byte _080396A8 + .4byte _08039704 +_080393F4: + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .pool +_08039414: + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08039434 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08039434 + ldr r0, =sub_80B3AF8 + movs r1, 0x5 + bl CreateTask +_08039434: + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .pool +_08039450: + ldr r0, =sub_80B3AF8 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + beq _0803945E + b _0803975E +_0803945E: + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .pool +_08039470: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0803947E + b _0803975E +_0803947E: + ldr r0, =gUnknown_085CD28F + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .pool +_0803949C: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _080394AC + b _0803975E +_080394AC: + str r0, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r0, =gUnknown_085CCABB + movs r1, 0xC + bl battle_show_message_maybe + ldr r4, =0x02024332 + movs r0, 0x1 + strb r0, [r4, 0x1] + bl sub_8056B74 + b _080396EA + .pool +_080394D8: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08039500 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _080394EC + b _0803975E +_080394EC: + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0 + b _0803951E + .pool +_08039500: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08039526 + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _08039510 + b _0803975E +_08039510: + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0x1 +_0803951E: + strb r0, [r4, 0x1] + bl sub_8056B74 + b _0803975E +_08039526: + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08039560 + movs r0, 0x5 + bl audio_play + ldr r4, =0x02024332 + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _08039540 + b _080396EA +_08039540: + str r5, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + bl sub_8185338 + strb r0, [r4, 0x1] + movs r0, 0xA + strb r0, [r4] + b _0803975E + .pool +_08039560: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0803956A + b _0803975E +_0803956A: + movs r0, 0x5 + bl audio_play + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .pool +_0803957C: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0803958A + b _0803975E +_0803958A: + str r0, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080395B4 + bl sub_800ADF8 + ldr r0, =gUnknown_0824978D + movs r1, 0 + bl battle_show_message_maybe +_080395B4: + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .pool +_080395CC: + ldrb r0, [r4, 0x1] + subs r0, 0x1 + strb r0, [r4, 0x1] + lsls r0, 24 + cmp r0, 0 + beq _080395DA + b _0803975E +_080395DA: + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080395F6 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _080395F6 + bl sub_800AC34 +_080395F6: + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + b _0803975C + .pool +_08039610: + ldr r2, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + adds r3, r2, 0 + cmp r0, 0 + beq _08039634 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _08039634 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08039634 + b _0803975E +_08039634: + ldr r0, =0x00000439 + adds r2, r3, r0 + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08039650 + b _0803975E +_08039650: + ldr r0, [r3, 0x8] + bl SetMainCallback2 + bl sub_8057028 + bl dp11_free + bl sub_805F094 + b _0803975E + .pool +_08039678: + ldrb r0, [r4, 0x1] + cmp r0, 0x1 + bne _080396A0 + movs r0, 0x37 + bl audio_play + ldr r0, =gUnknown_085CD2CB +_08039686: + bl get_battle_strings_ + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + movs r0, 0x80 + strb r0, [r4, 0x1] + b _080396EA + .pool +_080396A0: + ldr r0, =gUnknown_08242481 + b _08039686 + .pool +_080396A8: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803975E + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _0803975E + ldr r4, =0x02024332 + ldrb r0, [r4, 0x1] + subs r0, 0x1 + strb r0, [r4, 0x1] + lsls r0, 24 + cmp r0, 0 + bne _0803975E + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080396EA + bl sub_800ADF8 + ldr r0, =gUnknown_0824978D + movs r1, 0 + bl battle_show_message_maybe +_080396EA: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0803975E + .pool +_08039704: + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + bne _0803975E + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08039744 + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803975E + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + b _0803974A + .pool +_08039744: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] +_0803974A: + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x02024332 + movs r0, 0x20 + strb r0, [r1, 0x1] + movs r0, 0x8 +_0803975C: + strb r0, [r1] +_0803975E: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803939C + + thumb_func_start shedinja_something +shedinja_something: @ 803976C + push {r4,r5,lr} + sub sp, 0x10 + adds r4, r0, 0 + add r5, sp, 0xC + movs r0, 0x1 + strb r0, [r5] + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + ldr r1, =0x0000012f + cmp r0, r1 + bne _080397B4 + adds r0, r4, 0 + movs r1, 0x3 + bl pokemon_getattr + ldrb r1, [r5] + cmp r0, r1 + beq _080397B4 + adds r0, r4, 0 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + ldr r1, =gUnknown_0831ACA0 + mov r0, sp + bl CompareStringWithoutExtendedControlCodes + cmp r0, 0 + bne _080397B4 + adds r0, r4, 0 + movs r1, 0x3 + adds r2, r5, 0 + bl pokemon_setattr +_080397B4: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end shedinja_something + + thumb_func_start sub_80397C4 +sub_80397C4: @ 80397C4 + ldr r2, =gUnknown_0831ABA0 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + lsls r1, 3 + adds r1, r0 + ldrb r0, [r1, 0x3] + lsls r0, 3 + bx lr + .pool + thumb_func_end sub_80397C4 + + thumb_func_start oac_poke_opponent +oac_poke_opponent: @ 80397DC + push {lr} + sub sp, 0x4 + ldr r1, =sub_803980C + str r1, [r0, 0x1C] + movs r1, 0 + bl StartObjectImageAnimIfDifferent + movs r0, 0x80 + lsls r0, 10 + ldr r1, =0x00002108 + str r1, [sp] + movs r1, 0 + movs r2, 0xA + movs r3, 0xA + bl pal_fade_maybe + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end oac_poke_opponent + + thumb_func_start sub_803980C +sub_803980C: @ 803980C + push {lr} + adds r2, r0, 0 + ldr r0, =0x020243fc + ldrh r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0803982C + ldrh r0, [r2, 0x24] + adds r0, 0x2 + strh r0, [r2, 0x24] + lsls r0, 16 + cmp r0, 0 + bne _0803982C + ldr r0, =sub_8039838 + str r0, [r2, 0x1C] +_0803982C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_803980C + + thumb_func_start sub_8039838 +sub_8039838: @ 8039838 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08039880 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + bl sub_8076918 + ldr r1, =0x03005d70 + movs r2, 0x2E + ldrsh r0, [r4, r2] + adds r0, r1 + ldrb r0, [r0] + bl sub_80729D0 + ldr r0, =sub_8039894 + str r0, [r4, 0x1C] + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnimIfDifferent + movs r0, 0x80 + lsls r0, 10 + ldr r1, =0x00002108 + str r1, [sp] + movs r1, 0 + movs r2, 0xA + movs r3, 0 + bl pal_fade_maybe +_08039880: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039838 + + thumb_func_start sub_8039894 +sub_8039894: @ 8039894 + push {lr} + adds r2, r0, 0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080398B0 + ldrh r1, [r2, 0x32] + adds r0, r2, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_806ECEC +_080398B0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039894 + + thumb_func_start nullsub_18 +nullsub_18: @ 80398B8 + bx lr + thumb_func_end nullsub_18 + + thumb_func_start sub_80398BC +sub_80398BC: @ 80398BC + movs r1, 0x6 + strh r1, [r0, 0x34] + movs r1, 0x1 + strh r1, [r0, 0x36] + ldr r1, =sub_80398D0 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_80398BC + + thumb_func_start sub_80398D0 +sub_80398D0: @ 80398D0 + push {r4,lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x36] + subs r0, 0x1 + strh r0, [r3, 0x36] + lsls r0, 16 + cmp r0, 0 + bne _08039924 + movs r0, 0x8 + strh r0, [r3, 0x36] + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r2, [r0] + lsls r0, r2, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r4, 0x5 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + ldrh r0, [r3, 0x34] + subs r0, 0x1 + strh r0, [r3, 0x34] + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + bne _08039924 + ldrb r1, [r1] + adds r0, r4, 0 + ands r0, r1 + mov r1, r12 + strb r0, [r1] + ldr r0, =nullsub_18 + str r0, [r3, 0x1C] + ldr r0, =0x02022f88 + str r2, [r0] +_08039924: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80398D0 + + thumb_func_start sub_8039934 +sub_8039934: @ 8039934 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r0 + ldrh r0, [r0, 0x2E] + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r6, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + beq _0803995C + adds r4, r0, 0 + b _08039960 + .pool +_0803995C: + mov r0, r9 + ldrh r4, [r0, 0x32] +_08039960: + ldr r1, =0x0202406e + lsls r0, r6, 1 + adds r5, r0, r1 + ldrh r0, [r5] + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r7, =0x02024744 + adds r0, r7 + movs r1, 0 + bl pokemon_getattr + cmp r4, 0xC9 + bne _080399E4 + ldrh r0, [r5] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r7 + movs r1, 0 + bl pokemon_getattr + adds r2, r0, 0 + movs r0, 0xC0 + lsls r0, 18 + ands r0, r2 + lsrs r0, 18 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r2 + lsrs r1, 12 + orrs r0, r1 + movs r1, 0xC0 + lsls r1, 2 + ands r1, r2 + lsrs r1, 6 + orrs r0, r1 + movs r1, 0x3 + ands r1, r2 + orrs r0, r1 + movs r1, 0x1C + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _080399D0 + movs r0, 0xC9 + b _080399DA + .pool +_080399D0: + movs r1, 0xCE + lsls r1, 1 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 +_080399DA: + ldr r1, =gUnknown_08300D38 + lsls r0, 2 + b _08039A1C + .pool +_080399E4: + ldr r0, =0x00000181 + cmp r4, r0 + bne _08039A08 + ldr r0, =gUnknown_08525F78 + ldr r1, =0x020244e4 + adds r1, r6, r1 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + b _08039A20 + .pool +_08039A08: + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + bls _08039A18 + ldr r0, =gUnknown_08300D38 + b _08039A1E + .pool +_08039A18: + ldr r1, =gUnknown_08300D38 + lsls r0, r4, 2 +_08039A1C: + adds r0, r1 +_08039A1E: + ldrb r0, [r0, 0x1] +_08039A20: + lsrs r1, r0, 3 + movs r0, 0x8 + subs r0, r1 + mov r1, r9 + strh r0, [r1, 0x34] + movs r0, 0x1 + strh r0, [r1, 0x36] + ldr r0, =sub_8039A48 + str r0, [r1, 0x1C] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039934 + + thumb_func_start sub_8039A48 +sub_8039A48: @ 8039A48 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x36] + subs r0, 0x1 + strh r0, [r4, 0x36] + lsls r0, 16 + cmp r0, 0 + bne _08039AC8 + movs r0, 0x2 + strh r0, [r4, 0x36] + ldrh r0, [r4, 0x26] + adds r0, 0x8 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x34] + subs r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + cmp r0, 0 + bge _08039A7C + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + b _08039AC8 +_08039A7C: + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + bl battle_get_per_side_status + ldr r1, =0x020244d4 + ldr r1, [r1] + lsls r0, 24 + lsrs r0, 22 + adds r1, 0x4 + adds r1, r0 + ldr r2, =0x020244e4 + movs r3, 0x2E + ldrsh r0, [r4, r3] + adds r0, r2 + ldrb r0, [r0] + lsls r0, 11 + ldr r1, [r1] + adds r1, r0 + movs r2, 0x34 + ldrsh r0, [r4, r2] + lsls r0, 8 + adds r1, r0 + movs r2, 0 + movs r0, 0xFF +_08039AAE: + strb r2, [r1] + adds r1, 0x1 + subs r0, 0x1 + cmp r0, 0 + bge _08039AAE + ldr r0, =0x020244e4 + movs r3, 0x2E + ldrsh r1, [r4, r3] + adds r1, r0 + ldrb r1, [r1] + adds r0, r4, 0 + bl StartObjectImageAnim +_08039AC8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039A48 + + thumb_func_start sub_8039AD8 +sub_8039AD8: @ 8039AD8 + movs r1, 0x8 + strh r1, [r0, 0x34] + adds r1, r0, 0 + adds r1, 0x3E + ldrb r1, [r1] + lsls r1, 29 + lsrs r1, 31 + strh r1, [r0, 0x36] + ldr r1, =sub_8039AF4 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_8039AD8 + + thumb_func_start sub_8039AF4 +sub_8039AF4: @ 8039AF4 + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x34] + subs r0, 0x1 + strh r0, [r3, 0x34] + lsls r0, 16 + cmp r0, 0 + bne _08039B26 + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r2, [r0] + 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 + mov r1, r12 + strb r0, [r1] + movs r0, 0x8 + strh r0, [r3, 0x34] +_08039B26: + pop {r0} + bx r0 + thumb_func_end sub_8039AF4 + + thumb_func_start sub_8039B2C +sub_8039B2C: @ 8039B2C + movs r1, 0x3E + adds r1, r0 + mov r12, r1 + movs r1, 0x1 + ldrh r2, [r0, 0x36] + ands r2, r1 + lsls r2, 2 + mov r1, r12 + ldrb r3, [r1] + movs r1, 0x5 + negs r1, r1 + ands r1, r3 + orrs r1, r2 + mov r2, r12 + strb r1, [r2] + movs r1, 0 + strh r1, [r0, 0x36] + ldr r1, =nullsub_18 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_8039B2C + + thumb_func_start sub_8039B58 +sub_8039B58: @ 8039B58 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08039BA0 + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08039B80 + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x02000002 + ands r0, r1 + cmp r0, 0 + beq _08039B94 +_08039B80: + ldrh r0, [r4, 0x32] + bl sub_806F0D4 + lsls r0, 24 + cmp r0, 0 + beq _08039B94 + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnim +_08039B94: + ldrh r1, [r4, 0x32] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_806ECEC +_08039BA0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039B58 + + thumb_func_start sub_8039BB4 +sub_8039BB4: @ 8039BB4 + ldr r1, =oac_poke_ally_ + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_8039BB4 + + thumb_func_start oac_poke_ally_ +oac_poke_ally_: @ 8039BC0 + push {lr} + adds r2, r0, 0 + ldr r0, =0x020243fc + ldrh r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08039BE4 + ldrh r0, [r2, 0x24] + subs r0, 0x2 + strh r0, [r2, 0x24] + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + bne _08039BE4 + ldr r0, =nullsub_19 + str r0, [r2, 0x1C] + strh r1, [r2, 0x30] +_08039BE4: + pop {r0} + bx r0 + .pool + thumb_func_end oac_poke_ally_ + + thumb_func_start sub_8039BF0 +sub_8039BF0: @ 8039BF0 + ldr r1, =nullsub_19 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_8039BF0 + + thumb_func_start nullsub_19 +nullsub_19: @ 8039BFC + bx lr + thumb_func_end nullsub_19 + + thumb_func_start sub_8039C00 +sub_8039C00: @ 8039C00 + push {lr} + adds r2, r0, 0 + ldr r0, =0x020243fc + ldrh r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08039C20 + ldrh r0, [r2, 0x30] + ldrh r1, [r2, 0x24] + adds r0, r1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x32] + ldrh r1, [r2, 0x26] + adds r0, r1 + strh r0, [r2, 0x26] +_08039C20: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039C00 + + thumb_func_start dp11b_obj_instanciate +dp11b_obj_instanciate: @ 8039C28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + mov r10, r3 + cmp r1, 0 + beq _08039C64 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r2, r4, 1 + adds r0, r2, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + b _08039C76 + .pool +_08039C64: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r2, r4, 1 + adds r0, r2, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 +_08039C76: + ands r0, r1 + adds r6, r2, 0 + cmp r0, 0 + bne _08039D2C + ldr r0, =objc_dp11b_pingpong + bl object_new_hidden_with_callback + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, r8 + cmp r0, 0x1 + bne _08039CD0 + ldr r0, =0x03005d70 + adds r0, r4, r0 + ldrb r7, [r0] + ldr r2, =0x020244d0 + ldr r0, [r2] + ldr r0, [r0, 0x4] + adds r1, r6, r4 + lsls r1, 2 + adds r0, r1, r0 + strb r5, [r0, 0x2] + ldr r0, [r2] + ldr r0, [r0, 0x4] + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r1] + ldr r2, =0x02020630 + lsls r3, r5, 4 + adds r0, r3, r5 + lsls r0, 2 + adds r0, r2 + movs r1, 0x80 + b _08039CFE + .pool +_08039CD0: + ldr r0, =0x020241e4 + adds r0, r4, r0 + ldrb r7, [r0] + ldr r2, =0x020244d0 + ldr r0, [r2] + ldr r0, [r0, 0x4] + adds r1, r6, r4 + lsls r1, 2 + adds r0, r1, r0 + strb r5, [r0, 0x3] + ldr r0, [r2] + ldr r0, [r0, 0x4] + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldr r2, =0x02020630 + lsls r3, r5, 4 + adds r0, r3, r5 + lsls r0, 2 + adds r0, r2 + movs r1, 0xC0 +_08039CFE: + strh r1, [r0, 0x2E] + adds r4, r2, 0 + adds r1, r3, r5 + lsls r1, 2 + adds r1, r4 + mov r2, r9 + lsls r0, r2, 24 + asrs r0, 24 + movs r2, 0 + strh r0, [r1, 0x30] + mov r3, r10 + lsls r0, r3, 24 + asrs r0, 24 + strh r0, [r1, 0x32] + strh r7, [r1, 0x34] + mov r0, r8 + strh r0, [r1, 0x36] + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r0, r4 + strh r2, [r0, 0x24] + strh r2, [r0, 0x26] +_08039D2C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp11b_obj_instanciate + + thumb_func_start dp11b_obj_free +dp11b_obj_free: @ 8039D48 + push {r4-r6,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + bne _08039D9C + ldr r6, =0x020244d0 + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r5, r0, 2 + adds r3, r5, r1 + ldrb r1, [r3] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08039DEA + ldr r2, =0x02020630 + ldrb r1, [r3, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x34] + lsls r1, 24 + lsrs r4, r1, 24 + bl RemoveObjectAndFreeTiles + ldr r0, [r6] + ldr r1, [r0, 0x4] + adds r1, r5, r1 + ldrb r2, [r1] + movs r0, 0x3 + negs r0, r0 + b _08039DD6 + .pool +_08039D9C: + ldr r6, =0x020244d0 + ldr r0, [r6] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r5, r0, 2 + adds r3, r5, r1 + ldrb r1, [r3] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08039DEA + ldr r2, =0x02020630 + ldrb r1, [r3, 0x3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x34] + lsls r1, 24 + lsrs r4, r1, 24 + bl RemoveObjectAndFreeTiles + ldr r0, [r6] + ldr r1, [r0, 0x4] + adds r1, r5, r1 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 +_08039DD6: + ands r0, r2 + strb r0, [r1] + ldr r0, =0x02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + movs r0, 0 + strh r0, [r1, 0x24] + strh r0, [r1, 0x26] +_08039DEA: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end dp11b_obj_free + + thumb_func_start objc_dp11b_pingpong +objc_dp11b_pingpong: @ 8039DF8 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x34] + lsls r0, 24 + lsrs r5, r0, 24 + movs r1, 0x36 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _08039E10 + movs r2, 0x2E + ldrsh r0, [r4, r2] + b _08039E14 +_08039E10: + movs r1, 0x2E + ldrsh r0, [r4, r1] +_08039E14: + movs r2, 0x32 + ldrsh r1, [r4, r2] + bl sine + ldr r2, =0x02020630 + lsls r1, r5, 4 + adds r1, r5 + lsls r1, 2 + adds r1, r2 + ldrh r2, [r4, 0x32] + adds r0, r2 + strh r0, [r1, 0x26] + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x2E] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end objc_dp11b_pingpong + + thumb_func_start sub_8039E44 +sub_8039E44: @ 8039E44 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08039E5C + ldrh r1, [r2, 0x32] + adds r0, r2, 0 + bl sub_806EEB4 +_08039E5C: + pop {r0} + bx r0 + thumb_func_end sub_8039E44 + + thumb_func_start sub_8039E60 +sub_8039E60: @ 8039E60 + push {r4,lr} + adds r4, r0, 0 + bl sub_8039E9C + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08039E7A + ldr r0, =nullsub_19 + str r0, [r4, 0x1C] +_08039E7A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039E60 + + thumb_func_start sub_8039E84 +sub_8039E84: @ 8039E84 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1 + bl StartObjectImageAnim + ldr r0, =sub_8039E60 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039E84 + + thumb_func_start sub_8039E9C +sub_8039E9C: @ 8039E9C + push {lr} + adds r2, r0, 0 + adds r0, 0x2C + ldrb r1, [r0] + movs r0, 0x3F + ands r0, r1 + cmp r0, 0 + bne _08039EBE + ldr r1, =gUnknown_0831ACE0 + adds r0, r2, 0 + adds r0, 0x2B + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + adds r0, r2, 0 + adds r0, 0x28 + strb r1, [r0] +_08039EBE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039E9C + + thumb_func_start nullsub_20 +nullsub_20: @ 8039EC8 + bx lr + thumb_func_end nullsub_20 + + thumb_func_start sub_8039ECC +sub_8039ECC: @ 8039ECC + push {lr} + bl sub_8039F40 + ldr r1, =0x02024332 + movs r0, 0 + strb r0, [r1, 0x1] + ldr r1, =0x03005d04 + ldr r0, =bc_8012FAC + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039ECC + + thumb_func_start sub_8039EF0 +sub_8039EF0: @ 8039EF0 + push {r4,r5,lr} + ldr r0, =0x03005d04 + ldr r0, [r0] + bl _call_via_r0 + ldr r1, =0x02024064 + movs r0, 0 + strb r0, [r1] + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r0, 0 + beq _08039F2A + ldr r5, =0x03005d60 + adds r4, r1, 0 +_08039F0C: + ldrb r0, [r4] + lsls r0, 2 + adds r0, r5 + ldr r0, [r0] + bl _call_via_r0 + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _08039F0C +_08039F2A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8039EF0 + + thumb_func_start sub_8039F40 +sub_8039F40: @ 8039F40 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r0, 0 + bl sub_803D580 + bl sub_803D6A0 + movs r2, 0 + movs r3, 0 + ldr r0, =0x02024260 + mov r10, r0 + ldr r1, =0x02024258 + mov r9, r1 + ldr r0, =0x02024250 + mov r8, r0 + ldr r1, =0x02024248 + mov r12, r1 + ldr r5, =0x020242bc + movs r4, 0 + ldr r7, =0x02024240 + ldr r6, =0x02024268 +_08039F70: + ldr r0, =0x020242ac + adds r0, r4, r0 + str r3, [r0] + movs r1, 0 +_08039F78: + adds r0, r5, r1 + strb r3, [r0] + adds r1, 0x1 + cmp r1, 0x1B + bls _08039F78 + movs r0, 0x2 + strb r0, [r5, 0x16] + ldr r1, =0x02024284 + adds r0, r2, r1 + strb r3, [r0] + mov r0, r12 + strh r3, [r0] + mov r1, r8 + strh r3, [r1] + mov r0, r9 + strh r3, [r0] + mov r1, r10 + strh r3, [r1] + ldr r0, =0x02024270 + adds r1, r2, r0 + movs r0, 0xFF + strb r0, [r1] + strh r3, [r6] + strh r3, [r7] + ldr r1, =0x020244a8 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r0, r4 + str r3, [r0] + ldr r1, =0x02024230 + adds r0, r4, r1 + str r3, [r0] + movs r0, 0x2 + add r10, r0 + add r9, r0 + add r8, r0 + add r12, r0 + adds r5, 0x1C + adds r4, 0x4 + adds r7, 0x2 + adds r6, 0x2 + adds r2, 0x1 + cmp r2, 0x3 + ble _08039F70 + movs r5, 0 + ldr r3, =0x02024294 + ldr r4, =0x0202428e + movs r2, 0x1 +_08039FD8: + strh r5, [r4] + movs r1, 0 +_08039FDC: + adds r0, r3, r1 + strb r5, [r0] + adds r1, 0x1 + cmp r1, 0xB + bls _08039FDC + adds r3, 0xC + adds r4, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08039FD8 + movs r1, 0 + ldr r2, =0x0202420b + strb r1, [r2] + ldr r0, =0x0202420c + strb r1, [r0] + ldr r2, =0x020243cc + strh r1, [r2] + ldr r1, =0x020243d0 + movs r2, 0 + movs r3, 0 +_0803A004: + adds r0, r1, r2 + strb r3, [r0] + adds r2, 0x1 + cmp r2, 0x2B + bls _0803A004 + ldr r2, =0x02024280 + movs r0, 0 + str r0, [r2] + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + bne _0803A090 + movs r0, 0x2 + ands r1, r0 + cmp r1, 0 + bne _0803A0AE + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r1, [r0, 0x15] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0803A0AE + movs r0, 0x80 + b _0803A0AC + .pool +_0803A090: + ldr r0, =0x02000002 + ands r1, r0 + cmp r1, 0 + bne _0803A0AE + bl sub_8185FB8 + lsls r0, 24 + cmp r0, 0 + beq _0803A0AE + ldr r1, =0x02024280 + ldr r0, [r1] + movs r1, 0x80 + orrs r0, r1 + ldr r2, =0x02024280 +_0803A0AC: + str r0, [r2] +_0803A0AE: + ldr r3, =0x02024474 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + lsls r0, 30 + lsrs r0, 31 + movs r1, 0 + strb r0, [r3, 0x1D] + ldr r0, =0x02024212 + strb r1, [r0] + ldr r0, =0x0202433a + strb r1, [r0] + ldr r0, =0x02024068 + str r1, [r0] + ldr r0, =0x0202432e + movs r2, 0 + strh r1, [r0] + ldr r1, =0x020244a8 + ldr r0, [r1] + ldr r0, [r0, 0x8] + adds r0, 0x20 + strb r2, [r0] + ldr r0, [r1] + ldr r0, [r0, 0xC] + adds r0, 0x20 + strb r2, [r0] + ldr r5, =0x0202432c + ldr r6, =0x020241f0 + ldr r7, =0x020243fc + ldr r0, =0x03005d54 + mov r8, r0 + ldr r1, =0x02024210 + mov r9, r1 + ldr r2, =0x02024744 + mov r10, r2 + ldr r1, =0x02024332 + movs r2, 0 + adds r0, r1, 0x7 +_0803A0FA: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _0803A0FA + movs r4, 0 + strh r4, [r5] + movs r0, 0 + str r0, [r6] + strh r0, [r7] + strb r4, [r3, 0x18] + strb r4, [r3, 0x19] + mov r0, r8 + strb r4, [r0] + mov r1, r9 + strb r4, [r1] + ldr r5, =0x0202449c + ldr r0, [r5] + adds r0, 0x6C + strb r4, [r0] + ldr r0, [r5] + adds r0, 0x79 + strb r4, [r0] + ldr r0, [r5] + adds r0, 0x7A + strb r4, [r0] + mov r0, r10 + movs r1, 0xB + bl pokemon_getattr + ldr r6, [r5] + adds r6, 0x7C + ldr r2, =gBaseStats + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x8] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x000004fb + bl __divsi3 + strb r0, [r6] + ldr r0, [r5] + adds r0, 0x7B + movs r1, 0x3 + strb r1, [r0] + ldr r0, [r5] + strb r4, [r0, 0x12] + ldr r0, [r5] + adds r0, 0x4A + movs r1, 0x1 + strb r1, [r0] + movs r2, 0 + movs r1, 0 + adds r6, r5, 0 +_0803A16A: + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0x98 + strb r1, [r0] + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0xB8 + strb r1, [r0] + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0xC8 + strb r1, [r0] + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0xD0 + strb r1, [r0] + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0xE0 + strb r1, [r0] + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0xE8 + strb r1, [r0] + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0xF0 + strb r1, [r0] + ldr r0, [r5] + adds r0, r2, r0 + adds r0, 0xF8 + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x7 + ble _0803A16A + movs r2, 0 + ldr r4, =0x0202449c + movs r3, 0xA5 + lsls r3, 2 + movs r1, 0x6 +_0803A1BA: + ldr r0, [r4] + adds r0, r2, r0 + adds r0, r3 + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x3 + ble _0803A1BA + ldr r0, [r6] + adds r0, 0xDF + movs r1, 0 + strb r1, [r0] + ldr r0, [r6] + adds r0, 0x92 + strb r1, [r0] + bl GenerateRandomNumber + ldr r1, =0x02024330 + strh r0, [r1] + ldr r1, =0x03005d10 + movs r2, 0 + movs r3, 0 +_0803A1E4: + adds r0, r1, r2 + strb r3, [r0] + adds r2, 0x1 + cmp r2, 0x43 + bls _0803A1E4 + ldr r0, =0x02024744 + bl sub_806EBA4 + ldr r3, =0x03005d10 + movs r1, 0x1 + ands r1, r0 + lsls r1, 6 + ldrb r2, [r3, 0x5] + movs r0, 0x41 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x5] + ldr r2, =0x0202449c + ldr r0, [r2] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + ldr r2, =0x000002a1 + adds r0, r2 + strb 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_8039F40 + + thumb_func_start sub_803A284 +sub_803A284: @ 803A284 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + ldr r4, =0x020242bc + ldr r5, =0x02024064 + ldrb r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + mov r1, sp + adds r0, r4 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldr r0, [r0] + str r0, [r1] + ldr r2, =gBattleMoves + ldr r3, =0x020241ea + ldrh r1, [r3] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + mov r12, r4 + mov r9, r5 + ldr r6, =0x020242ac + mov r10, r6 + cmp r0, 0x7F + beq _0803A35C + movs r5, 0 + mov r6, r9 + movs r4, 0x58 + ldr r2, =0x02024084 + adds r2, 0x18 + movs r1, 0x6 +_0803A2D4: + ldrb r0, [r6] + muls r0, r4 + adds r0, r5, r0 + adds r0, r2 + strb r1, [r0] + adds r5, 0x1 + cmp r5, 0x7 + ble _0803A2D4 + movs r5, 0 + ldr r7, =0x0202406c + ldrb r7, [r7] + cmp r5, r7 + bge _0803A348 + ldr r0, =0x020240d4 + mov r8, r0 + ldr r4, =0x020242bc + ldr r3, =0x020242ac +_0803A2F6: + movs r0, 0x58 + muls r0, r5 + mov r1, r8 + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x80 + lsls r0, 19 + ands r0, r1 + cmp r0, 0 + beq _0803A31A + ldrb r0, [r4, 0x14] + ldr r6, =0x02024064 + ldrb r6, [r6] + cmp r0, r6 + bne _0803A31A + ldr r0, =0xfbffffff + ands r1, r0 + str r1, [r2] +_0803A31A: + ldr r1, [r3] + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + beq _0803A33A + ldrb r0, [r4, 0x15] + ldr r7, =0x02024064 + ldrb r7, [r7] + cmp r0, r7 + bne _0803A33A + movs r0, 0x19 + negs r0, r0 + ands r1, r0 + str r1, [r3] + movs r0, 0 + strb r0, [r4, 0x15] +_0803A33A: + adds r4, 0x1C + adds r3, 0x4 + adds r5, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + blt _0803A2F6 +_0803A348: + ldr r1, =0x020241ea + ldrh r0, [r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + ldr r2, =gBattleMoves + adds r1, r2 + ldrb r0, [r1] + cmp r0, 0x7F + bne _0803A414 +_0803A35C: + mov r3, r9 + ldrb r1, [r3] + movs r0, 0x58 + adds r2, r1, 0 + muls r2, r0 + ldr r0, =0x02024084 + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + ldr r1, =0x15100007 + ands r0, r1 + str r0, [r2] + ldrb r1, [r3] + lsls r1, 2 + add r1, r10 + ldr r0, [r1] + ldr r2, =0x0003043f + ands r0, r2 + str r0, [r1] + movs r5, 0 + ldr r6, =0x0202406c + ldrb r6, [r6] + cmp r5, r6 + bge _0803A430 + mov r7, r9 + movs r6, 0 +_0803A390: + ldrb r0, [r7] + bl battle_side_get_owner + adds r4, r0, 0 + lsls r0, r5, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _0803A3D0 + ldr r1, =0x020242ac + lsls r0, r5, 2 + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + beq _0803A3D0 + ldr r0, =0x020242bc + adds r0, r6, r0 + ldrb r0, [r0, 0x15] + ldrb r3, [r7] + cmp r0, r3 + bne _0803A3D0 + movs r0, 0x19 + negs r0, r0 + ands r1, r0 + movs r0, 0x10 + orrs r1, r0 + str r1, [r2] +_0803A3D0: + adds r6, 0x1C + adds r5, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + blt _0803A390 + ldr r6, =0x020242bc + mov r12, r6 + ldr r7, =0x02024064 + mov r9, r7 + b _0803A430 + .pool +_0803A414: + mov r0, r9 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + ldr r1, =0x02024084 + adds r1, 0x50 + adds r0, r1 + movs r1, 0 + str r1, [r0] + mov r2, r9 + ldrb r0, [r2] + lsls r0, 2 + add r0, r10 + str r1, [r0] +_0803A430: + movs r5, 0 + ldr r3, =0x0202449c + mov r8, r3 + ldr r6, =0x020244ac + mov r10, r6 + ldr r7, =0x0202406c + ldrb r7, [r7] + cmp r5, r7 + bge _0803A490 + ldr r3, =0x020240d4 + ldr r7, =gUnknown_0832A328 + ldr r6, =0x02024064 +_0803A448: + movs r0, 0x58 + muls r0, r5 + adds r4, r0, r3 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r7 + ldr r0, [r0] + lsls r2, r0, 16 + ldr r1, [r4] + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + beq _0803A466 + bics r1, r2 + str r1, [r4] +_0803A466: + ldr r1, [r4] + movs r0, 0xE0 + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _0803A486 + mov r2, r8 + ldr r0, [r2] + adds r0, r5, r0 + ldrb r0, [r0, 0x14] + ldrb r2, [r6] + cmp r0, r2 + bne _0803A486 + ldr r0, =0xffff1fff + ands r1, r0 + str r1, [r4] +_0803A486: + adds r5, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + blt _0803A448 +_0803A490: + mov r1, r9 + ldrb r0, [r1] + add r0, r10 + movs r1, 0 + strb r1, [r0] + mov r2, r9 + ldrb r0, [r2] + ldr r3, =0x020244b0 + adds r0, r3 + strb r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + mov r6, r12 + adds r1, r0, r6 + movs r5, 0 + movs r2, 0 +_0803A4B4: + adds r0, r1, r5 + strb r2, [r0] + adds r5, 0x1 + cmp r5, 0x1B + bls _0803A4B4 + ldr r7, =0x020241ea + ldrh r0, [r7] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + ldr r0, =gBattleMoves + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x7F + bne _0803A540 + mov r2, r9 + ldrb r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + mov r1, sp + ldrb r1, [r1, 0xA] + strb r1, [r0, 0xA] + ldrb r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + mov r1, sp + ldrb r1, [r1, 0x15] + strb r1, [r0, 0x15] + ldrb r0, [r2] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + add r1, r12 + mov r0, sp + ldrb r2, [r0, 0xF] + lsls r2, 28 + movs r4, 0xF + lsrs r2, 28 + ldrb r3, [r1, 0xF] + movs r0, 0x10 + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0xF] + mov r3, r9 + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + mov r1, sp + ldrb r1, [r1, 0xF] + lsrs r1, 4 + lsls r1, 4 + ldrb r2, [r0, 0xF] + ands r4, r2 + orrs r4, r1 + strb r4, [r0, 0xF] + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + mov r1, sp + ldrb r1, [r1, 0x14] + strb r1, [r0, 0x14] +_0803A540: + movs r0, 0 + ldr r6, =0x0202427c + strb r0, [r6] + mov r7, r9 + ldrb r1, [r7] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + movs r4, 0 + movs r1, 0x2 + strb r1, [r0, 0x16] + ldrb r0, [r7] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + add r1, r12 + mov r0, sp + ldrb r0, [r0, 0x18] + movs r2, 0x2 + ands r2, r0 + ldrb r3, [r1, 0x18] + movs r0, 0x3 + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x18] + ldrb r0, [r7] + lsls r0, 1 + ldr r1, =0x02024248 + adds r0, r1 + movs r2, 0 + strh r4, [r0] + ldrb r0, [r7] + lsls r0, 1 + ldr r3, =0x02024250 + adds r0, r3 + strh r4, [r0] + ldrb r0, [r7] + lsls r0, 1 + ldr r6, =0x02024258 + adds r0, r6 + strh r4, [r0] + ldrb r0, [r7] + lsls r0, 1 + ldr r7, =0x02024260 + adds r0, r7 + strh r4, [r0] + mov r1, r9 + ldrb r0, [r1] + lsls r0, 1 + ldr r3, =0x02024240 + adds r0, r3 + strh r4, [r0] + ldrb r0, [r1] + ldr r6, =0x02024270 + adds r0, r6 + movs r1, 0xFF + strb r1, [r0] + mov r7, r9 + ldrb r0, [r7] + mov r3, r8 + ldr r1, [r3] + lsls r0, 1 + adds r0, r1 + adds r0, 0x98 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 1 + adds r0, r1 + adds r0, 0x99 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE0 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE1 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE2 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE3 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE4 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE5 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE6 + strb r2, [r0] + ldrb r0, [r7] + ldr r1, [r3] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE7 + strb r2, [r0] + ldr r1, [r3] + adds r1, 0x92 + ldrb r0, [r7] + lsls r0, 2 + ldr r6, =gUnknown_0832A328 + adds r0, r6 + ldr r2, [r0] + ldrb r0, [r1] + bics r0, r2 + strb r0, [r1] + movs r5, 0 + ldr r7, =0x0202406c + ldrb r7, [r7] + cmp r5, r7 + bge _0803A6B4 + mov r3, r9 + mov r7, r8 + movs r6, 0 +_0803A656: + ldrb r0, [r3] + cmp r5, r0 + beq _0803A68C + lsls r0, r5, 24 + lsrs r0, 24 + str r3, [sp, 0x1C] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r3, [sp, 0x1C] + ldrb r0, [r3] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + ldr r3, [sp, 0x1C] + cmp r4, r0 + beq _0803A68C + ldr r0, [r7] + lsls r1, r5, 1 + adds r0, r1, r0 + adds r0, 0x98 + strb r6, [r0] + ldr r0, [r7] + adds r1, r0 + adds r1, 0x99 + strb r6, [r1] +_0803A68C: + ldrb r0, [r3] + ldr r1, [r7] + lsls r0, 1 + lsls r2, r5, 3 + adds r0, r2 + adds r0, r1 + adds r0, 0xE0 + strb r6, [r0] + ldrb r0, [r3] + ldr r1, [r7] + lsls r0, 1 + adds r0, r2 + adds r0, r1 + adds r0, 0xE1 + strb r6, [r0] + adds r5, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + blt _0803A656 +_0803A6B4: + mov r1, r9 + ldrb r0, [r1] + mov r2, r8 + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC8 + movs r2, 0 + strb r2, [r0] + mov r3, r9 + ldrb r0, [r3] + mov r6, r8 + ldr r1, [r6] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC9 + strb r2, [r0] + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x4] + ldrb r0, [r3] + lsls r0, 2 + adds r1, r0 + movs r2, 0 + str r2, [r1] + ldr r0, =0x020241ea + strh r2, [r0] + ldr r0, [r6] + adds r0, 0xDA + movs r1, 0xFF + strb r1, [r0] + ldrb r0, [r3] + bl sub_81310F0 + mov r7, r9 + ldrb r0, [r7] + bl sub_8131130 + 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_803A284 + + thumb_func_start sub_803A75C +sub_803A75C: @ 803A75C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r5, 0 + ldr r6, =0x02024084 + ldr r0, =0x020242ac + mov r8, r0 + ldr r1, =0x0202449c + mov r12, r1 + ldr r2, =0x020244ac + mov r9, r2 + ldr r3, =0x020244b0 + mov r10, r3 + ldr r7, =0x0202433c + ldr r4, =0x02024064 + movs r3, 0x58 + adds r2, r6, 0 + adds r2, 0x18 + movs r1, 0x6 +_0803A788: + ldrb r0, [r4] + muls r0, r3 + adds r0, r5, r0 + adds r0, r2 + strb r1, [r0] + adds r5, 0x1 + cmp r5, 0x7 + ble _0803A788 + ldr r0, =0x02024064 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r2, r6, 0 + adds r2, 0x50 + adds r0, r2 + movs r1, 0 + str r1, [r0] + ldr r3, =0x02024064 + ldrb r0, [r3] + lsls r0, 2 + add r0, r8 + str r1, [r0] + movs r5, 0 + ldr r6, =0x0202406c + ldrb r6, [r6] + cmp r5, r6 + bge _0803A830 + adds r3, r2, 0 + movs r4, 0 + ldr r0, =gUnknown_0832A328 + mov r8, r0 +_0803A7C6: + ldr r1, [r3] + movs r0, 0x80 + lsls r0, 19 + ands r0, r1 + cmp r0, 0 + beq _0803A7E6 + ldr r2, =0x020242bc + adds r0, r4, r2 + ldrb r0, [r0, 0x14] + ldr r6, =0x02024064 + ldrb r6, [r6] + cmp r0, r6 + bne _0803A7E6 + ldr r0, =0xfbffffff + ands r1, r0 + str r1, [r3] +_0803A7E6: + ldr r1, =0x02024064 + ldrb r0, [r1] + lsls r0, 2 + add r0, r8 + ldr r0, [r0] + lsls r2, r0, 16 + ldr r1, [r3] + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + beq _0803A800 + bics r1, r2 + str r1, [r3] +_0803A800: + ldr r1, [r3] + movs r0, 0xE0 + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _0803A822 + mov r2, r12 + ldr r0, [r2] + adds r0, r5, r0 + ldrb r0, [r0, 0x14] + ldr r6, =0x02024064 + ldrb r6, [r6] + cmp r0, r6 + bne _0803A822 + ldr r0, =0xffff1fff + ands r1, r0 + str r1, [r3] +_0803A822: + adds r3, 0x58 + adds r4, 0x1C + adds r5, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + blt _0803A7C6 +_0803A830: + ldr r1, =0x02024064 + ldrb r0, [r1] + add r0, r9 + movs r1, 0 + strb r1, [r0] + ldr r2, =0x02024064 + ldrb r0, [r2] + add r0, r10 + strb r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r3, =0x020242bc + adds r1, r0, r3 + movs r5, 0 + movs r2, 0 +_0803A852: + adds r0, r1, r5 + strb r2, [r0] + adds r5, 0x1 + cmp r5, 0x1B + bls _0803A852 + ldr r6, =0x02024064 + ldrb r1, [r6] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r0, 0x2 + negs r0, r0 + mov r9, r0 + ands r0, r2 + strb r0, [r1] + ldrb r1, [r6] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r3, 0x3 + negs r3, r3 + mov r8, r3 + mov r0, r8 + ands r0, r2 + strb r0, [r1] + ldrb r1, [r6] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r6, 0x5 + negs r6, r6 + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1] + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + subs r3, 0x6 + mov r10, r3 + mov r0, r10 + ands r0, r2 + strb r0, [r1] + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r2, =0x02024064 + ldrb r1, [r2] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r5, 0x21 + negs r5, r5 + adds r0, r5, 0 + ands r0, r2 + strb r0, [r1] + ldr r3, =0x02024064 + ldrb r1, [r3] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r4, 0x41 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1] + ldrb r1, [r3] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r3, 0x7F + adds r0, r3, 0 + ands r0, r2 + strb r0, [r1] + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1, 0x1] + mov r0, r9 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r2, =0x02024064 + ldrb r1, [r2] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1, 0x1] + mov r0, r8 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1, 0x1] + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r2, =0x02024064 + ldrb r1, [r2] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1, 0x1] + movs r0, 0x19 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r1, =0x02024064 + ldrb r0, [r1] + lsls r0, 4 + adds r0, r7 + ldrb r1, [r0, 0x1] + ands r5, r1 + strb r5, [r0, 0x1] + ldr r2, =0x02024064 + ldrb r0, [r2] + lsls r0, 4 + adds r0, r7 + ldrb r1, [r0, 0x1] + ands r4, r1 + strb r4, [r0, 0x1] + ldrb r0, [r2] + lsls r0, 4 + adds r0, r7 + ldrb r1, [r0, 0x1] + ands r3, r1 + strb r3, [r0, 0x1] + ldrb r0, [r2] + lsls r0, 4 + adds r0, r7 + ldrb r1, [r0, 0x2] + mov r3, r9 + ands r3, r1 + strb r3, [r0, 0x2] + ldrb r0, [r2] + lsls r0, 4 + adds r0, r7 + ldrb r1, [r0, 0x2] + mov r2, r8 + ands r2, r1 + strb r2, [r0, 0x2] + ldr r3, =0x02024064 + ldrb r0, [r3] + lsls r0, 4 + adds r0, r7 + ldrb r1, [r0, 0x2] + ands r6, r1 + strb r6, [r0, 0x2] + ldrb r0, [r3] + lsls r0, 4 + adds r0, r7 + ldrb r1, [r0, 0x2] + mov r6, r10 + ands r6, r1 + strb r6, [r0, 0x2] + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r1, =0x020242bc + adds r0, r1 + movs r2, 0 + movs r1, 0x2 + strb r1, [r0, 0x16] + ldrb r0, [r3] + lsls r0, 1 + ldr r3, =0x02024248 + adds r0, r3 + movs r3, 0 + strh r2, [r0] + ldr r6, =0x02024064 + ldrb r0, [r6] + lsls r0, 1 + ldr r1, =0x02024250 + adds r0, r1 + strh r2, [r0] + ldrb r0, [r6] + lsls r0, 1 + ldr r6, =0x02024258 + adds r0, r6 + strh r2, [r0] + ldr r1, =0x02024064 + ldrb r0, [r1] + lsls r0, 1 + ldr r6, =0x02024260 + adds r0, r6 + strh r2, [r0] + ldrb r0, [r1] + lsls r0, 1 + ldr r1, =0x02024240 + adds r0, r1 + strh r2, [r0] + ldr r2, =0x02024064 + ldrb r0, [r2] + ldr r6, =0x02024270 + adds r0, r6 + movs r1, 0xFF + strb r1, [r0] + ldrb r0, [r2] + mov r2, r12 + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC8 + strb r3, [r0] + ldr r6, =0x02024064 + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC9 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0x98 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0x99 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE0 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE1 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE2 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE3 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE4 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE5 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE6 + strb r3, [r0] + ldrb r0, [r6] + ldr r1, [r2] + lsls r0, 3 + adds r0, r1 + adds r0, 0xE7 + strb r3, [r0] + ldr r1, [r2] + adds r1, 0x92 + ldrb r0, [r6] + lsls r0, 2 + ldr r2, =gUnknown_0832A328 + adds r0, r2 + ldr r2, [r0] + ldrb r0, [r1] + bics r0, r2 + strb r0, [r1] + movs r5, 0 + ldr r3, =0x0202406c + ldrb r3, [r3] + cmp r5, r3 + bge _0803AB02 + adds r3, r6, 0 + mov r7, r12 + movs r6, 0 +_0803AAA4: + ldrb r0, [r3] + cmp r5, r0 + beq _0803AADA + lsls r0, r5, 24 + lsrs r0, 24 + str r3, [sp] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r3, [sp] + ldrb r0, [r3] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + ldr r3, [sp] + cmp r4, r0 + beq _0803AADA + ldr r0, [r7] + lsls r1, r5, 1 + adds r0, r1, r0 + adds r0, 0x98 + strb r6, [r0] + ldr r0, [r7] + adds r1, r0 + adds r1, 0x99 + strb r6, [r1] +_0803AADA: + ldrb r0, [r3] + ldr r1, [r7] + lsls r0, 1 + lsls r2, r5, 3 + adds r0, r2 + adds r0, r1 + adds r0, 0xE0 + strb r6, [r0] + ldrb r0, [r3] + ldr r1, [r7] + lsls r0, 1 + adds r0, r2 + adds r0, r1 + adds r0, 0xE1 + strb r6, [r0] + adds r5, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + blt _0803AAA4 +_0803AB02: + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x4] + ldr r2, =0x02024064 + ldrb r0, [r2] + lsls r0, 2 + adds r1, r0 + movs r0, 0 + str r0, [r1] + ldr r4, =0x02024084 + ldrb r0, [r2] + movs r3, 0x58 + adds r2, r0, 0 + muls r2, r3 + b _0803AB6C + .pool +_0803AB6C: + adds r2, r4 + ldr r5, =gBaseStats + ldrh r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0, 0x6] + adds r2, 0x21 + strb r0, [r2] + ldr r6, =0x02024064 + ldrb r0, [r6] + adds r1, r0, 0 + muls r1, r3 + adds r1, r4 + ldrh r2, [r1] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0, 0x7] + adds r1, 0x22 + strb r0, [r1] + ldrb r0, [r6] + bl sub_81310F0 + ldrb r0, [r6] + bl sub_8131130 + 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_803A75C + + thumb_func_start bc_8012FAC +bc_8012FAC: @ 803ABC0 + push {r4,r5,lr} + ldr r5, =0x02024332 + ldrb r0, [r5] + cmp r0, 0 + beq _0803ABD4 + cmp r0, 0x1 + beq _0803ABF8 + b _0803AC2E + .pool +_0803ABD4: + ldr r4, =0x02024064 + ldrb r0, [r5, 0x1] + strb r0, [r4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl dp01_build_cmdbuf_x00_a_b_0 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + b _0803AC2E + .pool +_0803ABF8: + ldr r0, =0x02024068 + ldr r2, [r0] + cmp r2, 0 + bne _0803AC2E + ldrb r0, [r5, 0x1] + adds r0, 0x1 + strb r0, [r5, 0x1] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bne _0803AC2C + ldr r1, =0x03005d04 + ldr r0, =bc_load_battlefield + str r0, [r1] + b _0803AC2E + .pool +_0803AC2C: + strb r2, [r5] +_0803AC2E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end bc_8012FAC + + thumb_func_start bc_load_battlefield +bc_load_battlefield: @ 803AC34 + push {r4,r5,lr} + ldr r0, =0x02024068 + ldr r5, [r0] + cmp r5, 0 + bne _0803AC64 + movs r0, 0 + bl battle_get_side_with_given_state + ldr r4, =0x02024064 + strb r0, [r4] + ldr r0, =0x02022ff0 + ldrb r1, [r0] + movs r0, 0 + bl dp01_build_cmdbuf_x2E_a + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x03005d04 + ldr r0, =sub_803AC84 + str r0, [r1] + ldr r0, =0x02024332 + strb r5, [r0] + strb r5, [r0, 0x1] +_0803AC64: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end bc_load_battlefield + + thumb_func_start sub_803AC84 +sub_803AC84: @ 803AC84 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x02024068 + ldr r1, [r0] + cmp r1, 0 + beq _0803AC98 + b _0803AF4E +_0803AC98: + ldr r2, =0x02024064 + strb r1, [r2] + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r1, r0 + bcc _0803ACA6 + b _0803AF48 +_0803ACA6: + movs r7, 0x58 + ldr r0, =0x02024084 + mov r8, r0 + mov r9, r2 + movs r1, 0x48 + add r1, r8 + mov r10, r1 +_0803ACB4: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0803ACFC + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803ACFC + ldrb r0, [r4] + muls r0, r7 + mov r2, r8 + adds r3, r0, r2 + movs r2, 0 + movs r1, 0 +_0803ACDA: + adds r0, r3, r2 + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x57 + bls _0803ACDA + b _0803ADCA + .pool +_0803ACFC: + mov r1, r9 + ldrb r0, [r1] + muls r0, r7 + mov r2, r8 + adds r3, r0, r2 + movs r2, 0 + ldr r6, =gBaseStats + ldr r5, =0x02023864 + ldr r4, =0x02024064 +_0803AD0E: + adds r0, r3, r2 + ldrb r1, [r4] + lsls r1, 9 + adds r1, 0x4 + adds r1, r2, r1 + adds r1, r5 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x57 + bls _0803AD0E + mov r1, r9 + ldrb r0, [r1] + adds r2, r0, 0 + muls r2, r7 + add r2, r8 + ldrh r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x6] + adds r2, 0x21 + strb r0, [r2] + mov r2, r9 + ldrb r0, [r2] + adds r2, r0, 0 + muls r2, r7 + add r2, r8 + ldrh r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x7] + adds r2, 0x22 + strb r0, [r2] + mov r1, r9 + ldrb r0, [r1] + adds r1, r0, 0 + muls r1, r7 + add r1, r8 + ldrh r0, [r1] + ldrb r1, [r1, 0x17] + lsrs r1, 7 + bl sub_806B694 + mov r2, r9 + ldrb r1, [r2] + muls r1, r7 + add r1, r8 + adds r1, 0x20 + strb r0, [r1] + ldrb r0, [r2] + bl battle_side_get_owner + ldr r1, =0x0202449c + lsls r0, 24 + lsrs r0, 23 + adds r0, 0xA8 + ldr r1, [r1] + adds r1, r0 + mov r2, r9 + ldrb r0, [r2] + muls r0, r7 + add r0, r8 + ldrh r0, [r0, 0x28] + strh r0, [r1] + movs r2, 0 + ldr r4, =0x02024064 + movs r5, 0x58 + ldr r1, =0x0202409c + adds r6, r4, 0 + movs r0, 0x18 + negs r0, r0 + adds r0, r1 + mov r12, r0 + movs r3, 0x6 +_0803ADAA: + ldrb r0, [r4] + muls r0, r5 + adds r0, r2, r0 + adds r0, r1 + strb r3, [r0] + adds r2, 0x1 + cmp r2, 0x7 + ble _0803ADAA + ldrb r0, [r6] + adds r1, r0, 0 + muls r1, r7 + mov r0, r12 + adds r0, 0x50 + adds r1, r0 + movs r0, 0 + str r0, [r1] +_0803ADCA: + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + cmp r0, 0 + bne _0803ADE4 + movs r0, 0 + bl dp01_build_cmdbuf_x07_7_7_7 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803ADE4: + ldr r5, =0x02022fec + ldr r0, [r5] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0803AE60 + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803AE0A + movs r0, 0 + bl dp01_build_cmdbuf_x07_7_7_7 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803AE0A: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803AEC0 + ldr r0, [r5] + ldr r1, =0x063f0902 + ands r0, r1 + cmp r0, 0 + bne _0803AEC0 + ldrb r0, [r4] + muls r0, r7 + add r0, r8 + ldrh r0, [r0] + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r4] + muls r1, r7 + add r1, r10 + ldr r2, [r1] + movs r1, 0x2 + bl SetPokedexFlag + b _0803AEC0 + .pool +_0803AE60: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803AEC0 + ldr r0, [r5] + ldr r1, =0x063f0902 + ands r0, r1 + cmp r0, 0 + bne _0803AE96 + ldrb r0, [r4] + muls r0, r7 + add r0, r8 + ldrh r0, [r0] + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r4] + muls r1, r7 + add r1, r10 + ldr r2, [r1] + movs r1, 0x2 + bl SetPokedexFlag +_0803AE96: + movs r0, 0 + bl dp01_build_cmdbuf_x04_4_4_4 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + ldr r1, =0x03005d10 + strh r0, [r1, 0x20] +_0803AEC0: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0803AEF6 + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _0803AEEA + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0803AEF6 +_0803AEEA: + movs r0, 0 + bl dp01_build_cmdbuf_x07_7_7_7 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803AEF6: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0803AF20 + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0803AF20 + movs r0, 0 + bl dp01_build_cmdbuf_x07_7_7_7 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803AF20: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0803AF32 + bl sub_81A56B4 +_0803AF32: + mov r1, r9 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcs _0803AF48 + b _0803ACB4 +_0803AF48: + ldr r1, =0x03005d04 + ldr r0, =bc_801333C + str r0, [r1] +_0803AF4E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803AC84 + + thumb_func_start bc_801333C +bc_801333C: @ 803AF80 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x30 + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _0803AF92 + b _0803B10C +_0803AF92: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0803AFA0 + b _0803B0AC +_0803AFA0: + movs r7, 0 + add r0, sp, 0x4 + mov r8, r0 + mov r6, r8 + mov r5, sp +_0803AFAA: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =0x02024744 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _0803AFD0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _0803AFE8 +_0803AFD0: + ldr r0, =0x0000ffff + strh r0, [r5] + movs r0, 0 + b _0803AFFA + .pool +_0803AFE8: + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + strh r0, [r5] + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr +_0803AFFA: + str r0, [r6] + adds r6, 0x8 + adds r5, 0x8 + adds r7, 0x1 + cmp r7, 0x5 + ble _0803AFAA + movs r0, 0x1 + bl battle_get_side_with_given_state + ldr r4, =0x02024064 + strb r0, [r4] + movs r0, 0 + mov r1, sp + movs r2, 0x80 + bl dp01_build_cmdbuf_x30_TODO + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + movs r7, 0 + mov r6, r8 + mov r5, sp +_0803B026: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _0803B04C + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _0803B060 +_0803B04C: + ldr r0, =0x0000ffff + strh r0, [r5] + movs r0, 0 + b _0803B072 + .pool +_0803B060: + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + strh r0, [r5] + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr +_0803B072: + str r0, [r6] + adds r6, 0x8 + adds r5, 0x8 + adds r7, 0x1 + cmp r7, 0x5 + ble _0803B026 + movs r0, 0 + bl battle_get_side_with_given_state + ldr r4, =0x02024064 + strb r0, [r4] + movs r0, 0 + mov r1, sp + movs r2, 0x80 + bl dp01_build_cmdbuf_x30_TODO + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x03005d04 + ldr r0, =bc_battle_begin_message + b _0803B10A + .pool +_0803B0AC: + movs r7, 0 + add r6, sp, 0x4 + mov r5, sp +_0803B0B2: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _0803B0D8 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _0803B0E8 +_0803B0D8: + ldr r0, =0x0000ffff + strh r0, [r5] + movs r0, 0 + b _0803B0FA + .pool +_0803B0E8: + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + strh r0, [r5] + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr +_0803B0FA: + str r0, [r6] + adds r6, 0x8 + adds r5, 0x8 + adds r7, 0x1 + cmp r7, 0x5 + ble _0803B0B2 + ldr r1, =0x03005d04 + ldr r0, =bc_8013568 +_0803B10A: + str r0, [r1] +_0803B10C: + add sp, 0x30 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bc_801333C + + thumb_func_start bc_battle_begin_message +bc_battle_begin_message: @ 803B120 + push {lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0803B142 + movs r0, 0x1 + bl battle_get_side_with_given_state + ldr r1, =0x02024064 + strb r0, [r1] + ldrb r1, [r1] + movs r0, 0 + bl b_std_message + ldr r1, =0x03005d04 + ldr r0, =sub_803B180 + str r0, [r1] +_0803B142: + pop {r0} + bx r0 + .pool + thumb_func_end bc_battle_begin_message + + thumb_func_start bc_8013568 +bc_8013568: @ 803B158 + push {lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0803B170 + ldr r1, =0x03005d04 + ldr r0, =sub_803B3CC + str r0, [r1] + movs r0, 0 + movs r1, 0 + bl b_std_message +_0803B170: + pop {r0} + bx r0 + .pool + thumb_func_end bc_8013568 + + thumb_func_start sub_803B180 +sub_803B180: @ 803B180 + push {lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0803B1D0 + ldr r0, =0x02022fec + ldr r2, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r2 + cmp r0, 0 + beq _0803B1B8 + movs r0, 0x80 + lsls r0, 18 + ands r0, r2 + cmp r0, 0 + beq _0803B1B8 + movs r1, 0x80 + lsls r1, 24 + ands r1, r2 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + b _0803B1BA + .pool +_0803B1B8: + movs r0, 0x1 +_0803B1BA: + bl battle_get_side_with_given_state + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1 + bl b_std_message + ldr r1, =0x03005d04 + ldr r0, =sub_803B25C + str r0, [r1] +_0803B1D0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B180 + + thumb_func_start sub_803B1DC +sub_803B1DC: @ 803B1DC + push {r4,r5,lr} + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + beq _0803B1FC + movs r0, 0x80 + lsls r0, 18 + ands r0, r1 + cmp r0, 0 + beq _0803B1FC + movs r5, 0x2 + cmp r1, 0 + bge _0803B1FE +_0803B1FC: + movs r5, 0x3 +_0803B1FE: + ldr r1, =0x02024064 + movs r0, 0 + strb r0, [r1] + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r0, 0 + beq _0803B23A + adds r4, r1, 0 +_0803B20E: + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + bne _0803B228 + movs r0, 0 + bl dp01_build_cmdbuf_x2F_2F_2F_2F + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803B228: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B20E +_0803B23A: + ldr r1, =0x03005d04 + ldr r0, =bc_801362C + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B1DC + + thumb_func_start sub_803B25C +sub_803B25C: @ 803B25C + push {r4-r6,lr} + ldr r0, =0x02022fec + ldr r2, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r2 + cmp r0, 0 + beq _0803B298 + movs r0, 0x80 + lsls r0, 18 + ands r0, r2 + cmp r0, 0 + beq _0803B298 + movs r1, 0x80 + lsls r1, 24 + ands r1, r2 + negs r0, r1 + orrs r0, r1 + lsrs r5, r0, 31 + b _0803B29A + .pool +_0803B288: + ldr r1, =0x03005d04 + ldr r0, =sub_803B1DC + b _0803B2F0 + .pool +_0803B298: + movs r5, 0x1 +_0803B29A: + ldr r0, =0x02024068 + ldr r2, [r0] + cmp r2, 0 + bne _0803B2F2 + ldr r0, =0x02024064 + strb r2, [r0] + ldr r1, =0x0202406c + adds r4, r0, 0 + ldrb r1, [r1] + cmp r2, r1 + bcs _0803B2EC + adds r6, r4, 0 +_0803B2B2: + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + bne _0803B2D8 + movs r0, 0 + bl dp01_build_cmdbuf_x2F_2F_2F_2F + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x00008040 + ands r0, r1 + cmp r0, 0 + bne _0803B288 +_0803B2D8: + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x02024064 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B2B2 +_0803B2EC: + ldr r1, =0x03005d04 + ldr r0, =bc_801362C +_0803B2F0: + str r0, [r1] +_0803B2F2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B25C + + thumb_func_start bc_801362C +bc_801362C: @ 803B314 + push {r4-r7,lr} + ldr r0, =0x02024068 + ldr r1, [r0] + cmp r1, 0 + bne _0803B384 + ldr r2, =0x02024064 + strb r1, [r2] + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r1, r0 + bcs _0803B37E + adds r4, r2, 0 + ldr r6, =0x02024084 + movs r5, 0x58 + adds r7, r6, 0 + adds r7, 0x48 +_0803B334: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803B36C + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x063f0902 + ands r0, r1 + cmp r0, 0 + bne _0803B36C + ldrb r0, [r4] + muls r0, r5 + adds r0, r6 + ldrh r0, [r0] + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r4] + muls r1, r5 + adds r1, r7 + ldr r2, [r1] + movs r1, 0x2 + bl SetPokedexFlag +_0803B36C: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B334 +_0803B37E: + ldr r1, =0x03005d04 + ldr r0, =sub_803B3CC + str r0, [r1] +_0803B384: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bc_801362C + + thumb_func_start sub_803B3AC +sub_803B3AC: @ 803B3AC + push {lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0803B3BC + ldr r1, =0x03005d04 + ldr r0, =sub_803B3CC + str r0, [r1] +_0803B3BC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B3AC + + thumb_func_start sub_803B3CC +sub_803B3CC: @ 803B3CC + push {lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0803B418 + ldr r1, =0x02022fec + ldr r2, [r1] + movs r0, 0x80 + lsls r0, 17 + ands r0, r2 + cmp r0, 0 + beq _0803B3F4 + movs r0, 0x80 + lsls r0, 18 + ands r0, r2 + cmp r0, 0 + beq _0803B3F4 + movs r3, 0x1 + cmp r2, 0 + bge _0803B3F6 +_0803B3F4: + movs r3, 0 +_0803B3F6: + ldr r0, [r1] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0803B412 + adds r0, r3, 0 + bl battle_get_side_with_given_state + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1 + bl b_std_message +_0803B412: + ldr r1, =0x03005d04 + ldr r0, =sub_803B4C8 + str r0, [r1] +_0803B418: + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B3CC + + thumb_func_start sub_803B42C +sub_803B42C: @ 803B42C + push {r4,r5,lr} + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + beq _0803B44C + movs r0, 0x80 + lsls r0, 18 + ands r0, r1 + cmp r0, 0 + beq _0803B44C + movs r5, 0x3 + cmp r1, 0 + bge _0803B44E +_0803B44C: + movs r5, 0x2 +_0803B44E: + ldr r1, =0x02024064 + movs r0, 0 + strb r0, [r1] + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r0, 0 + beq _0803B48A + adds r4, r1, 0 +_0803B45E: + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + bne _0803B478 + movs r0, 0 + bl dp01_build_cmdbuf_x2F_2F_2F_2F + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803B478: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B45E +_0803B48A: + ldr r2, =0x0202449c + ldr r0, [r2] + adds r0, 0x4C + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xD9 + strb r1, [r0] + ldr r0, [r2] + movs r2, 0xD1 + lsls r2, 1 + adds r0, r2 + strb r1, [r0] + ldr r1, =0x03005d04 + ldr r0, =sub_803B628 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B42C + + thumb_func_start sub_803B4C8 +sub_803B4C8: @ 803B4C8 + push {r4-r6,lr} + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + beq _0803B500 + movs r0, 0x80 + lsls r0, 18 + ands r0, r1 + cmp r0, 0 + beq _0803B500 + movs r6, 0x1 + cmp r1, 0 + bge _0803B502 + b _0803B500 + .pool +_0803B4F0: + ldr r1, =0x03005d04 + ldr r0, =sub_803B42C + b _0803B572 + .pool +_0803B500: + movs r6, 0 +_0803B502: + ldr r0, =0x02024068 + ldr r2, [r0] + cmp r2, 0 + bne _0803B574 + ldr r0, =0x02024064 + strb r2, [r0] + ldr r1, =0x0202406c + adds r4, r0, 0 + ldrb r1, [r1] + cmp r2, r1 + bcs _0803B554 + adds r5, r4, 0 +_0803B51A: + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, r6 + bne _0803B540 + movs r0, 0 + bl dp01_build_cmdbuf_x2F_2F_2F_2F + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0803B4F0 +_0803B540: + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x02024064 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B51A +_0803B554: + ldr r2, =0x0202449c + ldr r0, [r2] + adds r0, 0x4C + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xD9 + strb r1, [r0] + ldr r0, [r2] + movs r2, 0xD1 + lsls r2, 1 + adds r0, r2 + strb r1, [r0] + ldr r1, =0x03005d04 + ldr r0, =sub_803B628 +_0803B572: + str r0, [r1] +_0803B574: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B4C8 + + thumb_func_start sub_803B598 +sub_803B598: @ 803B598 + push {r4,r5,lr} + ldr r0, =0x02024068 + ldr r1, [r0] + cmp r1, 0 + bne _0803B606 + ldr r2, =0x02024064 + strb r1, [r2] + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r1, r0 + bcs _0803B5E6 + adds r4, r2, 0 + ldr r5, =0x0202406e +_0803B5B2: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803B5D4 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r5 + ldrb r1, [r0] + movs r0, 0 + movs r2, 0 + bl dp01_build_cmdbuf_x05_a_b_c + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803B5D4: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B5B2 +_0803B5E6: + ldr r2, =0x0202449c + ldr r0, [r2] + adds r0, 0x4C + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xD9 + strb r1, [r0] + ldr r0, [r2] + movs r2, 0xD1 + lsls r2, 1 + adds r0, r2 + strb r1, [r0] + ldr r1, =0x03005d04 + ldr r0, =sub_803B628 + str r0, [r1] +_0803B606: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B598 + + thumb_func_start sub_803B628 +sub_803B628: @ 803B628 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r0, 0 + mov r9, r0 + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _0803B642 + b _0803B8B2 +_0803B642: + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x4C + ldrb r0, [r0] + cmp r0, 0 + bne _0803B6C2 + movs r5, 0 + ldr r1, =0x0202406c + mov r10, r1 + ldrb r3, [r1] + cmp r5, r3 + bge _0803B668 + ldr r2, =0x0202407e +_0803B65C: + adds r0, r5, r2 + strb r5, [r0] + adds r5, 0x1 + ldrb r0, [r1] + cmp r5, r0 + blt _0803B65C +_0803B668: + movs r5, 0 + b _0803B6B8 + .pool +_0803B67C: + adds r4, r5, 0x1 + mov r8, r4 + ldrb r1, [r1] + cmp r8, r1 + bge _0803B6B6 + ldr r6, =0x0202407e + ldr r1, =0x0202406c + mov r10, r1 + lsls r7, r5, 24 +_0803B68E: + adds r0, r5, r6 + ldrb r0, [r0] + adds r1, r4, r6 + ldrb r1, [r1] + movs r2, 0x1 + bl b_first_side + lsls r0, 24 + cmp r0, 0 + beq _0803B6AC + lsls r1, r4, 24 + lsrs r1, 24 + lsrs r0, r7, 24 + bl sub_803CEDC +_0803B6AC: + adds r4, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _0803B68E +_0803B6B6: + mov r5, r8 +_0803B6B8: + mov r1, r10 + ldrb r0, [r1] + subs r0, 0x1 + cmp r5, r0 + blt _0803B67C +_0803B6C2: + ldr r5, =0x0202449c + ldr r0, [r5] + movs r4, 0xD1 + lsls r4, 1 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _0803B6FC + str r0, [sp] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0xFF + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _0803B6FC + ldr r0, [r5] + adds r0, r4 + movs r1, 0x1 + strb r1, [r0] + b _0803B8B2 + .pool +_0803B6FC: + ldr r2, =0x0202449c + ldr r0, [r2] + adds r0, 0x4C + ldr r1, =0x0202406c + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcs _0803B756 + ldr r5, =0x0202407e + adds r4, r2, 0 +_0803B710: + ldr r0, [r4] + adds r0, 0x4C + ldrb r0, [r0] + adds r0, r5 + ldrb r1, [r0] + movs r0, 0 + str r0, [sp] + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _0803B736 + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_0803B736: + ldr r1, [r4] + adds r1, 0x4C + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r3, r9 + cmp r3, 0 + beq _0803B748 + b _0803B8B2 +_0803B748: + ldr r0, [r4] + adds r0, 0x4C + ldr r1, =0x0202406c + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B710 +_0803B756: + movs r0, 0 + str r0, [sp] + movs r0, 0x9 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _0803B770 + b _0803B8B2 +_0803B770: + str r0, [sp] + movs r0, 0xB + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _0803B786 + b _0803B8B2 +_0803B786: + ldr r2, =0x0202449c + ldr r0, [r2] + adds r0, 0xD9 + ldr r1, =0x0202406c + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcs _0803B7DA + ldr r5, =0x0202407e + adds r4, r2, 0 +_0803B79A: + ldr r0, [r4] + adds r0, 0xD9 + ldrb r0, [r0] + adds r0, r5 + ldrb r1, [r0] + movs r0, 0 + movs r2, 0 + bl berry_effects_maybe + lsls r0, 24 + cmp r0, 0 + beq _0803B7BC + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_0803B7BC: + ldr r1, [r4] + adds r1, 0xD9 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r0, r9 + cmp r0, 0 + bne _0803B8B2 + ldr r0, [r4] + adds r0, 0xD9 + ldr r1, =0x0202406c + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcc _0803B79A +_0803B7DA: + movs r5, 0 + ldr r1, =0x0202449c + mov r8, r1 + movs r7, 0x6 + ldr r6, =0x0202421c + ldr r2, =0x02024274 + movs r4, 0xFF + movs r3, 0 +_0803B7EA: + mov r1, r8 + ldr r0, [r1] + adds r0, r5, r0 + adds r0, 0x5C + strb r7, [r0] + adds r1, r5, r6 + ldrb r0, [r1] + orrs r0, r4 + strb r0, [r1] + strh r3, [r2] + adds r2, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _0803B7EA + movs r0, 0 + bl sub_803D580 + bl sub_803D6A0 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x91 + ldr r1, =0x02024210 + ldrb r1, [r1] + strb r1, [r0] + ldr r0, =gUnknown_085CC23E + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =0x03005d04 + ldr r0, =sub_803BE74 + str r0, [r1] + bl sub_803F988 + ldr r1, =0x02024332 + movs r2, 0 + adds r0, r1, 0x7 +_0803B834: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _0803B834 + movs r5, 0 + ldr r3, =0x0202406c + ldr r2, =0x0202449c + ldr r6, =0x02024474 + ldr r7, =0x0202427c + ldrb r0, [r3] + cmp r5, r0 + bge _0803B866 + ldr r0, =0x02024084 + movs r4, 0x9 + negs r4, r4 + adds r1, r0, 0 + adds r1, 0x50 +_0803B856: + ldr r0, [r1] + ands r0, r4 + str r0, [r1] + adds r1, 0x58 + adds r5, 0x1 + ldrb r0, [r3] + cmp r5, r0 + blt _0803B856 +_0803B866: + ldr r0, [r2] + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x1] + ldr r0, [r2] + movs r3, 0xD0 + lsls r3, 1 + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + adds r3, 0x1 + adds r0, r3 + strb r1, [r0] + movs r1, 0 + strb r1, [r6, 0x14] + ldr r0, [r2] + adds r0, 0x4D + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x3] + strb r1, [r7] + bl GenerateRandomNumber + ldr r1, =0x02024330 + strh r0, [r1] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0803B8B2 + bl sub_80A369C + ldr r0, =gUnknown_082DB8BE + bl b_call_bc_move_exec +_0803B8B2: + 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_803B628 + + thumb_func_start bc_8013B1C +bc_8013B1C: @ 803B904 + push {r4-r6,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0803B994 + ldr r1, =0x03005d04 + ldr r0, =sub_803B9BC + str r0, [r1] + ldr r3, =0x0202406c + ldr r1, =0x02024332 + movs r2, 0 + adds r0, r1, 0x7 +_0803B91C: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _0803B91C + movs r4, 0 + ldrb r3, [r3] + cmp r4, r3 + bge _0803B96E + ldr r5, =0x02024084 + adds r6, r5, 0 + adds r6, 0x4C +_0803B932: + movs r0, 0x58 + adds r2, r4, 0 + muls r2, r0 + adds r1, r5, 0 + adds r1, 0x50 + adds r1, r2, r1 + ldr r3, [r1] + subs r0, 0x61 + ands r3, r0 + str r3, [r1] + adds r2, r6 + ldr r0, [r2] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + beq _0803B964 + movs r0, 0x80 + lsls r0, 5 + ands r3, r0 + cmp r3, 0 + beq _0803B964 + lsls r0, r4, 24 + lsrs r0, 24 + bl b_cancel_multi_turn_move_maybe +_0803B964: + adds r4, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _0803B932 +_0803B96E: + ldr r2, =0x0202449c + ldr r0, [r2] + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x1] + ldr r0, [r2] + movs r3, 0xD0 + lsls r3, 1 + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + adds r3, 0x1 + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x3] + ldr r0, =0x0202427c + strb r1, [r0] +_0803B994: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bc_8013B1C + + thumb_func_start sub_803B9BC +sub_803B9BC: @ 803B9BC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r0, 0x1 + bl sub_803D580 + ldr r0, =0x0202433a + ldrb r0, [r0] + cmp r0, 0 + bne _0803B9EA + bl sub_80401D0 + lsls r0, 24 + cmp r0, 0 + beq _0803B9DE + b _0803BB78 +_0803B9DE: + bl sub_8040924 + lsls r0, 24 + cmp r0, 0 + beq _0803B9EA + b _0803BB78 +_0803B9EA: + bl sub_8041728 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _0803B9F8 + b _0803BB78 +_0803B9F8: + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x4D + strb r1, [r0] + bl sub_8041364 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0803BA0E + b _0803BB78 +_0803BA0E: + movs r0, 0 + bl sub_803D580 + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xfffffdff + ands r0, r1 + ldr r1, =0xfff7ffff + ands r0, r1 + ldr r1, =0xffbfffff + ands r0, r1 + ldr r1, =0xffefffff + ands r0, r1 + str r0, [r2] + ldr r0, =0x02024474 + strb r4, [r0, 0x18] + strb r4, [r0, 0x19] + strb r4, [r0, 0x14] + ldr r0, =0x020241f0 + str r4, [r0] + ldr r0, =0x0202427c + strb r4, [r0] + ldr r1, =0x02024332 + movs r2, 0 + adds r0, r1, 0x4 +_0803BA40: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _0803BA40 + ldr r0, =0x0202433a + ldrb r0, [r0] + cmp r0, 0 + beq _0803BA98 + ldr r1, =0x02024083 + movs r0, 0xC + strb r0, [r1] + ldr r1, =0x03005d04 + ldr r0, =bc_bs_exec + str r0, [r1] + b _0803BB78 + .pool +_0803BA98: + ldr r1, =0x03005d10 + ldrb r0, [r1, 0x13] + ldr r2, =0x0202449c + mov r8, r2 + cmp r0, 0xFE + bhi _0803BAB2 + adds r0, 0x1 + strb r0, [r1, 0x13] + ldr r1, [r2] + adds r1, 0xDA + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0803BAB2: + movs r2, 0 + ldr r4, =0x0202406c + ldr r0, =0x02024210 + mov r12, r0 + ldr r1, =gUnknown_085CC23E + mov r9, r1 + ldrb r0, [r4] + cmp r2, r0 + bge _0803BAE0 + ldr r7, =0x0202421c + movs r6, 0xFF + movs r5, 0 + ldr r3, =0x02024274 +_0803BACC: + adds r1, r2, r7 + ldrb r0, [r1] + orrs r0, r6 + strb r0, [r1] + strh r5, [r3] + adds r3, 0x2 + adds r2, 0x1 + ldrb r1, [r4] + cmp r2, r1 + blt _0803BACC +_0803BAE0: + movs r2, 0 + ldr r3, =0x0202449c + movs r1, 0x6 +_0803BAE6: + ldr r0, [r3] + adds r0, r2, r0 + adds r0, 0x5C + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x3 + ble _0803BAE6 + mov r2, r8 + ldr r0, [r2] + adds r0, 0x91 + mov r2, r12 + ldrb r1, [r2] + strb r1, [r0] + mov r0, r9 + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =0x03005d04 + ldr r0, =sub_803BE74 + str r0, [r1] + bl GenerateRandomNumber + ldr r1, =0x02024330 + strh r0, [r1] + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 10 + ands r0, r1 + cmp r0, 0 + beq _0803BB5C + ldr r0, =gUnknown_082DB881 + bl b_call_bc_move_exec + b _0803BB78 + .pool +_0803BB5C: + movs r0, 0x80 + lsls r0, 11 + ands r1, r0 + cmp r1, 0 + beq _0803BB78 + mov r1, r8 + ldr r0, [r1] + adds r0, 0xDA + ldrb r0, [r0] + cmp r0, 0 + bne _0803BB78 + ldr r0, =gUnknown_082DB8BE + bl b_call_bc_move_exec +_0803BB78: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803B9BC + + thumb_func_start sub_803BB88 +sub_803BB88: @ 803BB88 + push {r4-r7,lr} + sub sp, 0x4 + ldr r1, =0x02024084 + ldr r0, =0x02024064 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _0803BBB8 + ldr r1, =0x02024404 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x7] + b _0803BBC2 + .pool +_0803BBB8: + ldrh r0, [r1, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r2, r0, 24 +_0803BBC2: + ldr r1, =0x0202420f + ldr r3, =0x02024064 + ldrb r0, [r3] + strb r0, [r1] + cmp r2, 0x25 + bne _0803BBD0 + b _0803BD4C +_0803BBD0: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0803BBDE + b _0803BD4C +_0803BBDE: + ldr r1, =0x02024084 + ldrb r2, [r3] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x32 + bne _0803BBF2 + b _0803BD4C +_0803BBF2: + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + bge _0803BC86 + movs r7, 0 +_0803BC08: + lsrs r4, r7, 24 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + beq _0803BC2C + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r5 + adds r0, r1 + adds r2, r0, 0 + adds r2, 0x20 + ldrb r0, [r2] + cmp r0, 0x17 + bne _0803BC2C + b _0803BD54 +_0803BC2C: + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + beq _0803BC76 + ldr r3, =0x02024084 + ldr r0, =0x02024064 + ldrb r0, [r0] + movs r2, 0x58 + muls r0, r2 + adds r1, r0, r3 + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1A + beq _0803BC76 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0803BC76 + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0803BC76 + adds r0, r5, 0 + muls r0, r2 + adds r0, r3 + adds r2, r0, 0 + adds r2, 0x20 + ldrb r0, [r2] + cmp r0, 0x47 + bne _0803BC76 + b _0803BD70 +_0803BC76: + movs r0, 0x80 + lsls r0, 17 + adds r7, r0 + adds r5, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + blt _0803BC08 +_0803BC86: + ldr r4, =0x02024064 + ldrb r1, [r4] + movs r0, 0 + str r0, [sp] + movs r0, 0xF + movs r2, 0x2A + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _0803BCF8 + ldr r6, =0x02024084 + ldrb r0, [r4] + movs r3, 0x58 + muls r0, r3 + adds r1, r0, r6 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x8 + beq _0803BCBE + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x8 + bne _0803BCF8 +_0803BCBE: + ldr r0, =0x02024474 + subs r1, r5, 0x1 + strb r1, [r0, 0x17] + ldr r2, =0x0202420a + adds r0, r1, 0 + muls r0, r3 + adds r0, r6 + adds r0, 0x20 + ldrb r0, [r0] + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x2 + b _0803BD90 + .pool +_0803BCF8: + ldr r1, =0x02024084 + ldr r0, =0x02024064 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x0400e000 + ands r0, r1 + cmp r0, 0 + bne _0803BD22 + ldr r1, =0x020242ac + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 3 + ands r0, r1 + cmp r0, 0 + beq _0803BD40 +_0803BD22: + ldr r1, =0x02024332 + movs r0, 0 + strb r0, [r1, 0x5] + movs r0, 0x1 + b _0803BD92 + .pool +_0803BD40: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0803BD8C +_0803BD4C: + movs r0, 0 + b _0803BD92 + .pool +_0803BD54: + ldr r0, =0x02024474 + strb r5, [r0, 0x17] + ldr r1, =0x0202420a + ldrb r0, [r2] + strb r0, [r1] + ldr r1, =0x02024332 + movs r0, 0x2 + b _0803BD90 + .pool +_0803BD70: + ldr r0, =0x02024474 + strb r5, [r0, 0x17] + ldr r1, =0x0202420a + ldrb r0, [r2] + strb r0, [r1] + ldr r1, =0x02024332 + movs r0, 0x2 + b _0803BD90 + .pool +_0803BD8C: + ldr r1, =0x02024332 + movs r0, 0x1 +_0803BD90: + strb r0, [r1, 0x5] +_0803BD92: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_803BB88 + + thumb_func_start sub_803BDA0 +sub_803BDA0: @ 803BDA0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + movs r3, 0 + ldr r0, =0x0202406e + mov r8, r0 + ldr r1, =0x0203cf00 + mov r12, r1 + ldr r7, =0x0202449c + lsls r0, r5, 1 + adds r4, r0, r5 + adds r6, r0, 0 +_0803BDBC: + mov r0, r12 + adds r2, r3, r0 + ldr r1, [r7] + adds r0, r4, r3 + adds r0, r1 + adds r0, 0x60 + ldrb r0, [r0] + strb r0, [r2] + adds r3, 0x1 + cmp r3, 0x2 + ble _0803BDBC + mov r1, r8 + adds r0, r6, r1 + ldrb r0, [r0] + bl pokemon_order_func + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r7, =0x0202449c + ldr r0, [r7] + adds r0, r5, r0 + adds r0, 0x5C + ldrb r0, [r0] + bl pokemon_order_func + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_81B8FB0 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0803BE4C + movs r3, 0 + adds r4, r7, 0 + adds r6, r5 + movs r0, 0x2 + adds r1, r5, 0 + eors r1, r0 + ldr r7, =0x0203cf00 + lsls r0, r1, 1 + adds r5, r0, r1 +_0803BE1A: + ldr r0, [r4] + adds r1, r6, r3 + adds r1, r0 + adds r1, 0x60 + adds r2, r3, r7 + ldrb r0, [r2] + strb r0, [r1] + ldr r1, [r4] + adds r0, r5, r3 + adds r0, r1 + adds r0, 0x60 + ldrb r1, [r2] + strb r1, [r0] + adds r3, 0x1 + cmp r3, 0x2 + ble _0803BE1A + b _0803BE66 + .pool +_0803BE4C: + movs r3, 0 + adds r2, r6, r5 + ldr r4, =0x0203cf00 +_0803BE52: + ldr r0, [r7] + adds r1, r2, r3 + adds r1, r0 + adds r1, 0x60 + adds r0, r3, r4 + ldrb r0, [r0] + strb r0, [r1] + adds r3, 0x1 + cmp r3, 0x2 + ble _0803BE52 +_0803BE66: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803BDA0 + + thumb_func_start sub_803BE74 +sub_803BE74: @ 803BE74 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + ldr r0, =0x02024332 + movs r1, 0 + strb r1, [r0, 0x4] + ldr r0, =0x02024064 + strb r1, [r0] + ldr r0, =0x0202406c + bl _0803CD12 + .pool +_0803BE9C: + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x02024332 + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x8 + bls _0803BEB8 + bl _0803CD04 +_0803BEB8: + lsls r0, 2 + ldr r1, =_0803BED0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0803BED0: + .4byte _0803BEF4 + .4byte _0803BF0C + .4byte _0803C02C + .4byte _0803C7D8 + .4byte _0803CAD0 + .4byte _0803CB84 + .4byte _0803CBC8 + .4byte _0803CBF4 + .4byte _0803CC38 +_0803BEF4: + bl sub_8185FD0 + ldr r1, =0x02024332 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + bl _0803CC20 + .pool +_0803BF0C: + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r4, =0x0202449c + ldr r0, [r4] + adds r1, r0 + adds r1, 0x5C + movs r0, 0x6 + strb r0, [r1] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0803BF68 + movs r1, 0x2 + movs r0, 0x2 + ands r0, r5 + cmp r0, 0 + beq _0803BF68 + eors r5, r1 + adds r0, r5, 0 + bl battle_get_side_with_given_state + ldr r1, [r4] + adds r1, 0x91 + ldrb r1, [r1] + ldr r2, =gUnknown_0832A328 + lsls r0, 24 + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0803BF68 + ldr r4, =0x02024332 + adds r0, r5, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x5 + beq _0803BF68 + bl _0803CD04 +_0803BF68: + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x91 + ldrb r3, [r0] + ldr r1, =gUnknown_0832A328 + ldr r4, =0x02024064 + ldrb r2, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ands r3, r0 + cmp r3, 0 + beq _0803BFD0 + ldr r0, =0x0202421c + adds r0, r2, r0 + movs r1, 0xD + strb r1, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0803BFBC + ldr r0, =0x02024332 + ldrb r1, [r4] + adds r1, r0 + movs r0, 0x5 + strb r0, [r1] + bl _0803CD04 + .pool +_0803BFBC: + ldr r0, =0x02024332 + ldrb r1, [r4] + adds r1, r0 + movs r0, 0x4 + strb r0, [r1] + bl _0803CD04 + .pool +_0803BFD0: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 5 + ands r0, r1 + cmp r0, 0 + bne _0803BFF0 + movs r0, 0x80 + lsls r0, 15 + ands r1, r0 + cmp r1, 0 + beq _0803C00C +_0803BFF0: + ldr r0, =0x0202421c + adds r0, r2, r0 + strb r3, [r0] + ldr r1, =0x02024332 + ldrb r0, [r4] + bl _0803CC72 + .pool +_0803C00C: + ldr r0, =0x0202421c + ldrb r1, [r0] + ldr r0, =0x02023864 + ldrb r2, [r0, 0x1] + ldrb r0, [r0, 0x2] + lsls r0, 8 + orrs r2, r0 + movs r0, 0 + bl dp01_build_cmdbuf_x12_a_bb + bl _0803CB68 + .pool +_0803C02C: + ldr r3, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldr r6, =0x02024064 + ldrb r5, [r6] + lsls r0, r5, 2 + adds r0, r1 + ldr r2, [r0] + lsls r1, r2, 4 + movs r0, 0xF0 + lsls r0, 24 + orrs r1, r0 + orrs r1, r2 + lsls r0, r2, 8 + orrs r1, r0 + lsls r2, 12 + orrs r1, r2 + ldr r0, [r3] + ands r0, r1 + cmp r0, 0 + beq _0803C058 + bl _0803CD04 +_0803C058: + ldr r4, =0x02023864 + lsls r0, r5, 9 + adds r4, 0x1 + adds r0, r4 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8184FBC + ldr r1, =0x0202421c + ldrb r0, [r6] + adds r1, r0, r1 + lsls r0, 9 + adds r0, r4 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r6] + lsls r0, 9 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0xC + bls _0803C084 + b _0803C6C4 +_0803C084: + lsls r0, 2 + ldr r1, =_0803C0A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0803C0A8: + .4byte _0803C0DC + .4byte _0803C230 + .4byte _0803C268 + .4byte _0803C6C4 + .4byte _0803C6C4 + .4byte _0803C440 + .4byte _0803C48C + .4byte _0803C6C4 + .4byte _0803C6C4 + .4byte _0803C6C4 + .4byte _0803C6C4 + .4byte _0803C6C4 + .4byte _0803C4B4 +_0803C0DC: + bl sub_80400C8 + lsls r0, 24 + cmp r0, 0 + beq _0803C134 + ldr r0, =0x02024332 + ldr r3, =0x02024064 + ldrb r1, [r3] + adds r1, r0 + movs r4, 0 + movs r0, 0x6 + strb r0, [r1] + ldrb r1, [r3] + ldr r2, =0x0202449c + ldr r0, [r2] + adds r1, r0 + adds r1, 0x54 + strb r4, [r1] + ldrb r1, [r3] + ldr r0, [r2] + adds r1, r0 + adds r1, 0x84 + movs r0, 0x4 + strb r0, [r1] + ldrb r1, [r3] + ldr r2, [r2] + adds r2, r1, r2 + ldr r0, =0x02023864 + lsls r1, 9 + adds r0, 0x3 + adds r1, r0 + ldrb r0, [r1] + strb r0, [r2, 0xC] + bl _0803CD70 + .pool +_0803C134: + ldr r3, =0x020242bc + ldr r5, =0x02024064 + ldrb r4, [r5] + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r3 + ldrh r2, [r0, 0x6] + cmp r2, 0 + beq _0803C188 + ldr r1, =0x02024274 + lsls r0, r4, 1 + adds r0, r1 + strh r2, [r0] + ldrb r2, [r5] + ldr r0, =0x0202449c + ldr r1, [r0] + adds r1, r2, r1 + adds r1, 0x80 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0xC] + strb r0, [r1] + ldr r1, =0x02024332 + ldrb r0, [r5] + adds r0, r1 + movs r1, 0x4 + strb r1, [r0] + bl _0803CD70 + .pool +_0803C188: + add r2, sp, 0x4 + ldr r3, =0x02024084 + movs r1, 0x58 + adds r0, r4, 0 + muls r0, r1 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r2, 0x10] + ldrb r0, [r5] + muls r0, r1 + adds r0, r3 + adds r0, 0x21 + ldrb r0, [r0] + strb r0, [r2, 0x12] + ldrb r0, [r5] + muls r0, r1 + adds r0, r3 + adds r0, 0x22 + ldrb r0, [r0] + strb r0, [r2, 0x13] + movs r4, 0 + mov r1, sp + adds r1, 0xC + str r1, [sp, 0x18] + add r2, sp, 0x10 + mov r10, r2 + mov r8, r3 + adds r7, r5, 0 + movs r6, 0x58 + movs r0, 0xC + add r0, r8 + mov r9, r0 + add r5, sp, 0x4 +_0803C1CA: + lsls r2, r4, 1 + ldrb r0, [r7] + muls r0, r6 + adds r0, r2, r0 + add r0, r9 + ldrh r0, [r0] + strh r0, [r5] + ldr r1, [sp, 0x18] + adds r3, r1, r4 + ldrb r0, [r7] + muls r0, r6 + adds r0, r4, r0 + mov r1, r8 + adds r1, 0x24 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r3] + ldrb r0, [r7] + adds r1, r0, 0 + muls r1, r6 + adds r2, r1 + add r2, r9 + ldrh r0, [r2] + add r1, r8 + adds r1, 0x3B + ldrb r1, [r1] + lsls r2, r4, 24 + lsrs r2, 24 + bl CalcPPWithPPUps + mov r2, r10 + adds r1, r2, r4 + strb r0, [r1] + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _0803C1CA + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x1 + ands r1, r0 + movs r0, 0 + movs r2, 0 + add r3, sp, 0x4 + bl sub_8033E30 + b _0803C42E + .pool +_0803C230: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x021f0902 + ands r0, r1 + cmp r0, 0 + bne _0803C23E + b _0803C48C +_0803C23E: + ldr r4, =0x02024064 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_8185008 + ldr r1, =0x02024220 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB879 + b _0803C784 + .pool +_0803C268: + ldr r5, =0x02024064 + ldrb r0, [r5] + ldr r3, =0x0202449c + ldr r1, [r3] + adds r1, r0, r1 + adds r1, 0x58 + ldr r2, =0x0202406e + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1] + ldr r7, =0x02024084 + ldrb r2, [r5] + movs r6, 0x58 + adds r0, r2, 0 + muls r0, r6 + adds r1, r7, 0 + adds r1, 0x50 + adds r0, r1 + ldr r1, [r0] + ldr r0, =0x0400e000 + ands r1, r0 + cmp r1, 0 + bne _0803C2B8 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + bne _0803C2B8 + ldr r0, =0x020242ac + lsls r1, r2, 2 + adds r1, r0 + ldr r1, [r1] + movs r0, 0x80 + lsls r0, 3 + ands r1, r0 + cmp r1, 0 + beq _0803C2EC +_0803C2B8: + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r1, r0, 1 + adds r1, r0 + adds r1, 0x60 + ldr r0, [r3] + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x2 + movs r2, 0x6 + b _0803C400 + .pool +_0803C2EC: + str r1, [sp] + movs r0, 0xC + adds r1, r2, 0 + movs r2, 0x17 + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0803C374 + ldrb r1, [r5] + str r4, [sp] + movs r0, 0xC + movs r2, 0x47 + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0803C33C + ldrb r0, [r5] + muls r0, r6 + adds r1, r0, r7 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0803C33C + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0803C33C + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1A + bne _0803C374 +_0803C33C: + ldr r5, =0x02024064 + ldrb r1, [r5] + movs r0, 0 + str r0, [sp] + movs r0, 0xF + movs r2, 0x2A + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0803C3B0 + ldr r2, =0x02024084 + ldrb r1, [r5] + movs r0, 0x58 + muls r0, r1 + adds r1, r0, r2 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x8 + beq _0803C374 + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x8 + bne _0803C3B0 +_0803C374: + subs r1, r4, 0x1 + lsls r1, 4 + movs r0, 0x4 + orrs r1, r0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =0x0202420a + ldrb r3, [r0] + ldr r4, =0x0202449c + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r2, r0, 1 + adds r2, r0 + adds r2, 0x60 + ldr r0, [r4] + adds r0, r2 + str r0, [sp] + movs r0, 0 + movs r2, 0x6 + bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f + b _0803C42E + .pool +_0803C3B0: + ldr r0, =0x02024064 + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0x2 + bne _0803C3D8 + ldr r0, =0x0202421c + ldrb r0, [r0] + cmp r0, 0x2 + bne _0803C3D8 + ldr r0, =0x0202449c + ldr r3, [r0] + adds r0, r3, 0 + adds r0, 0x5C + b _0803C3EE + .pool +_0803C3D8: + ldrb r0, [r4] + cmp r0, 0x3 + bne _0803C410 + ldr r0, =0x0202421c + ldrb r0, [r0, 0x1] + cmp r0, 0x2 + bne _0803C410 + ldr r0, =0x0202449c + ldr r3, [r0] + adds r0, r3, 0 + adds r0, 0x5D +_0803C3EE: + ldrb r2, [r0] + ldrb r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + adds r0, 0x60 + adds r3, r0 + str r3, [sp] + movs r0, 0 + movs r1, 0 +_0803C400: + movs r3, 0 + bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f + b _0803C42E + .pool +_0803C410: + ldr r2, =0x0202449c + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r1, r0, 1 + adds r1, r0 + adds r1, 0x60 + ldr r0, [r2] + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0 + movs r2, 0x6 + movs r3, 0 + bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f +_0803C42E: + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + b _0803C6C4 + .pool +_0803C440: + bl sub_806B8B0 + lsls r0, 24 + cmp r0, 0 + bne _0803C44C + b _0803C6C4 +_0803C44C: + ldr r1, =0x02024220 + ldr r3, =0x02024064 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r1 + ldr r1, =gUnknown_082DAB11 + str r1, [r0] + ldr r0, =0x02024332 + ldrb r1, [r3] + adds r1, r0 + movs r4, 0 + movs r0, 0x6 + strb r0, [r1] + ldrb r1, [r3] + ldr r2, =0x0202449c + ldr r0, [r2] + adds r1, r0 + adds r1, 0x54 + strb r4, [r1] + ldrb r1, [r3] + b _0803C7A0 + .pool +_0803C48C: + ldr r2, =0x0202449c + ldr r4, =0x02024064 + ldrb r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + adds r0, 0x60 + ldr r1, [r2] + adds r1, r0 + movs r0, 0 + bl sub_8033E6C + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _0803C6C4 + .pool +_0803C4B4: + ldr r4, =0x02024332 + ldr r5, =0x02024064 + ldrb r0, [r5] + adds r0, r4 + movs r1, 0x7 + strb r1, [r0] + ldrb r0, [r5] + bl battle_get_per_side_status + movs r6, 0x2 + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + movs r1, 0x1 + strb r1, [r0] + ldrb r0, [r5] + bl sub_8185008 + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + ldr r1, =0x02024084 + lsls r0, 24 + lsrs r0, 24 + movs r7, 0x58 + muls r0, r7 + adds r4, r1, 0 + adds r4, 0x50 + adds r0, r4 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + ands r0, r1 + cmp r0, 0 + bne _0803C532 + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + muls r0, r7 + adds r0, r4 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _0803C550 +_0803C532: + movs r0, 0 + bl dp01_build_cmdbuf_x32_32_32_32 + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + bl _0803CD70 + .pool +_0803C550: + ldr r4, =0x0202421c + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x2 + bne _0803C590 + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl sub_8185008 + b _0803C6AE + .pool +_0803C590: + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x3 + bne _0803C5B6 + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r6 + b _0803C668 +_0803C5B6: + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _0803C628 + ldr r4, =0x0202433c + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 20 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _0803C616 + ldr r4, =0x020242bc + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r1, 0x6] + cmp r0, 0 + beq _0803C628 +_0803C616: + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r6 + b _0803C668 + .pool +_0803C628: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0803C690 + ldr r4, =0x0202421c + ldr r6, =0x02024064 + ldrb r0, [r6] + bl battle_get_per_side_status + movs r5, 0x2 + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _0803C690 + ldr r1, =0x03005d80 + ldr r0, =0x0203bd30 + ldr r0, [r0] + str r0, [r1] + ldrb r0, [r6] + bl battle_get_per_side_status + eors r0, r5 +_0803C668: + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_8185008 + b _0803C6AE + .pool +_0803C690: + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_get_per_side_status + movs r1, 0x2 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + bl sub_8185008 +_0803C6AE: + movs r0, 0 + bl dp01_build_cmdbuf_x32_32_32_32 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + b _0803CD70 + .pool +_0803C6C4: + ldr r1, =0x02022fec + ldr r2, [r1] + movs r5, 0x8 + adds r0, r2, 0 + ands r0, r5 + adds r3, r1, 0 + cmp r0, 0 + beq _0803C720 + ldr r0, =0x043f0100 + ands r2, r0 + cmp r2, 0 + beq _0803C720 + ldr r0, =0x02023864 + ldr r4, =0x02024064 + ldrb r2, [r4] + lsls r1, r2, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x3 + bne _0803C720 + ldr r1, =0x02024220 + lsls r0, r2, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB9BA + str r1, [r0] + ldr r1, =0x02024332 + ldrb r0, [r4] + adds r0, r1 + movs r3, 0 + strb r5, [r0] + b _0803C792 + .pool +_0803C720: + ldr r0, [r3] + ldr r1, =0x0200000a + ands r0, r1 + cmp r0, 0x8 + bne _0803C760 + ldr r0, =0x02023864 + ldr r4, =0x02024064 + ldrb r1, [r4] + lsls r1, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x3 + bne _0803C760 + ldr r0, =gUnknown_082DAAFE + bl b_call_bc_move_exec + ldr r1, =0x02024332 + ldrb r0, [r4] + adds r0, r1 + b _0803CC20 + .pool +_0803C760: + bl sub_803BB88 + lsls r0, 24 + cmp r0, 0 + beq _0803C7C4 + ldr r0, =0x02023864 + ldr r4, =0x02024064 + ldrb r2, [r4] + lsls r1, r2, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x3 + bne _0803C7C4 + ldr r1, =0x02024220 + lsls r0, r2, 2 + adds r0, r1 + ldr r1, =gUnknown_082DAB0B +_0803C784: + str r1, [r0] + ldr r0, =0x02024332 + ldrb r1, [r4] + adds r1, r0 + movs r3, 0 + movs r0, 0x6 + strb r0, [r1] +_0803C792: + ldrb r1, [r4] + ldr r2, =0x0202449c + ldr r0, [r2] + adds r1, r0 + adds r1, 0x54 + strb r3, [r1] + ldrb r1, [r4] +_0803C7A0: + ldr r0, [r2] + adds r1, r0 + adds r1, 0x84 + movs r0, 0x1 + strb r0, [r1] + b _0803CD70 + .pool +_0803C7C4: + ldr r2, =0x02024332 + ldr r0, =0x02024064 + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .pool +_0803C7D8: + ldr r4, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldr r3, =0x02024064 + ldrb r5, [r3] + lsls r0, r5, 2 + adds r0, r1 + ldr r2, [r0] + lsls r0, r2, 4 + movs r1, 0xF0 + lsls r1, 24 + orrs r0, r1 + orrs r0, r2 + lsls r1, r2, 8 + orrs r0, r1 + lsls r2, 12 + orrs r0, r2 + ldr r1, [r4] + ands r1, r0 + adds r4, r3, 0 + cmp r1, 0 + beq _0803C804 + b _0803CD04 +_0803C804: + ldr r1, =0x0202421c + adds r0, r5, r1 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x9 + bls _0803C812 + b _0803CD04 +_0803C812: + lsls r0, 2 + ldr r1, =_0803C830 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0803C830: + .4byte _0803C858 + .4byte _0803C99C + .4byte _0803C9D4 + .4byte _0803CA0A + .4byte _0803CA2C + .4byte _0803CA40 + .4byte _0803CA54 + .4byte _0803CA84 + .4byte _0803CA98 + .4byte _0803CABC +_0803C858: + ldr r1, =0x02023864 + ldrb r3, [r4] + lsls r0, r3, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r1, [r0] + cmp r1, 0x3 + blt _0803C88A + cmp r1, 0x9 + ble _0803C878 + cmp r1, 0xF + beq _0803C87E + b _0803C88A + .pool +_0803C878: + adds r0, r3, r2 + strb r1, [r0] + b _0803CD70 +_0803C87E: + adds r1, r3, r2 + movs r0, 0x2 + strb r0, [r1] + bl sub_803CDF8 + b _0803CD70 +_0803C88A: + movs r0, 0x2 + bl sub_818603C + ldr r4, =0x02023864 + ldr r6, =0x02024064 + ldrb r3, [r6] + lsls r1, r3, 9 + adds r5, r4, 0x2 + adds r0, r1, r5 + ldrb r2, [r0] + adds r7, r4, 0x3 + adds r1, r7 + ldrb r0, [r1] + lsls r0, 8 + orrs r2, r0 + ldr r0, =0x0000ffff + cmp r2, r0 + bne _0803C8D0 + ldr r0, =0x02024332 + adds r0, r3, r0 + movs r1, 0x1 + strb r1, [r0] + ldrb r0, [r6] + bl sub_8185008 + b _0803CD04 + .pool +_0803C8D0: + bl sub_803FB4C + lsls r0, 24 + cmp r0, 0 + beq _0803C91C + ldrb r0, [r6] + movs r1, 0x1 + bl sub_8185008 + ldr r0, =0x02024332 + ldrb r1, [r6] + adds r1, r0 + movs r3, 0 + movs r0, 0x6 + strb r0, [r1] + ldrb r1, [r6] + ldr r2, =0x0202449c + ldr r0, [r2] + adds r1, r0 + adds r1, 0x54 + strb r3, [r1] + ldrb r0, [r6] + lsls r0, 9 + adds r1, r4, 0x1 + adds r0, r1 + strb r3, [r0] + ldrb r1, [r6] + ldr r0, [r2] + adds r1, r0 + adds r1, 0x84 + movs r0, 0x2 + strb r0, [r1] + b _0803CD70 + .pool +_0803C91C: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + bne _0803C942 + ldrb r0, [r6] + lsls r1, r0, 9 + adds r1, r5 + ldrb r1, [r1] + bl sub_8184FBC + ldrb r0, [r6] + lsls r1, r0, 9 + adds r1, r7 + ldrb r1, [r1] + bl sub_8184FBC +_0803C942: + ldrb r0, [r6] + ldr r4, =0x0202449c + ldr r1, [r4] + adds r1, r0, r1 + adds r1, 0x80 + lsls r0, 9 + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, =0x02024274 + ldrb r2, [r6] + lsls r5, r2, 1 + adds r5, r0 + ldr r3, =0x02024084 + ldr r4, [r4] + adds r0, r2, r4 + adds r0, 0x80 + ldrb r0, [r0] + lsls r0, 1 + movs r1, 0x58 + muls r1, r2 + adds r0, r1 + adds r3, 0xC + adds r0, r3 + ldrh r0, [r0] + strh r0, [r5] + ldrb r0, [r6] + adds r4, r0, r4 + lsls r0, 9 + adds r0, r7 + ldrb r0, [r0] + strb r0, [r4, 0xC] + ldr r0, =0x02024332 + ldrb r1, [r6] + b _0803CB72 + .pool +_0803C99C: + ldr r2, =0x02023864 + ldr r5, =0x02024064 + ldrb r4, [r5] + lsls r1, r4, 9 + adds r0, r2, 0x1 + adds r0, r1, r0 + ldrb r3, [r0] + adds r2, 0x2 + adds r1, r2 + ldrb r0, [r1] + lsls r0, 8 + orrs r3, r0 + cmp r3, 0 + bne _0803C9BA + b _0803CC1C +_0803C9BA: + ldr r0, =0x02024208 + strh r3, [r0] + ldr r0, =0x02024332 + ldrb r1, [r5] + b _0803CB72 + .pool +_0803C9D4: + ldr r0, =0x02023864 + ldr r4, =0x02024064 + ldrb r2, [r4] + lsls r1, r2, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x6 + bne _0803CA04 + ldr r0, =0x02024332 + adds r0, r2, r0 + movs r1, 0x1 + strb r1, [r0] + ldrb r0, [r4] + bl sub_8185008 + b _0803CD04 + .pool +_0803CA04: + bl sub_803CDF8 + b _0803CB6E +_0803CA0A: + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 8 + orrs r0, r1 + str r0, [r2] + ldr r2, =0x02024332 + ldr r0, =0x02024064 + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .pool +_0803CA2C: + ldr r2, =0x02024332 + ldr r0, =0x02024064 + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .pool +_0803CA40: + ldr r2, =0x02024332 + ldr r0, =0x02024064 + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .pool +_0803CA54: + ldr r3, =0x02023864 + ldr r0, =0x02024064 + ldrb r4, [r0] + lsls r1, r4, 9 + adds r0, r3, 0x1 + adds r0, r1, r0 + ldrb r2, [r0] + adds r3, 0x2 + adds r1, r3 + ldrb r0, [r1] + lsls r0, 8 + orrs r2, r0 + cmp r2, 0 + bne _0803CA72 + b _0803CC1C +_0803CA72: + ldr r1, =0x02024332 + adds r1, r4, r1 + b _0803CB74 + .pool +_0803CA84: + ldr r2, =0x02024332 + ldr r0, =0x02024064 + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .pool +_0803CA98: + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 8 + orrs r0, r1 + str r0, [r2] + ldr r2, =0x02024332 + ldr r0, =0x02024064 + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .pool +_0803CABC: + ldr r2, =0x02024332 + ldr r0, =0x02024064 + ldrb r1, [r0] + adds r1, r2 + b _0803CB74 + .pool +_0803CAD0: + ldr r3, =0x02024068 + ldr r6, =gUnknown_0832A328 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r6 + ldr r2, [r0] + lsls r1, r2, 4 + movs r0, 0xF0 + lsls r0, 24 + orrs r1, r0 + orrs r1, r2 + lsls r0, r2, 8 + orrs r1, r0 + lsls r2, 12 + orrs r1, r2 + ldr r0, [r3] + ands r0, r1 + cmp r0, 0 + beq _0803CAFA + b _0803CD04 +_0803CAFA: + bl sub_803CDB8 + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r4, r1, 31 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x41 + ands r0, r1 + cmp r0, 0x1 + bne _0803CB3C + movs r1, 0x2 + movs r0, 0x2 + ands r0, r5 + cmp r0, 0 + bne _0803CB3C + adds r0, r5, 0 + eors r0, r1 + bl battle_get_side_with_given_state + ldr r1, =0x0202449c + ldr r1, [r1] + adds r1, 0x91 + ldrb r1, [r1] + lsls r0, 24 + lsrs r0, 22 + adds r0, r6 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0803CB5C +_0803CB3C: + movs r0, 0 + movs r1, 0 + adds r2, r4, 0 + bl sub_8034464 + b _0803CB66 + .pool +_0803CB5C: + movs r0, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl sub_8034464 +_0803CB66: + ldr r4, =0x02024064 +_0803CB68: + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803CB6E: + ldr r0, =0x02024332 + ldrb r1, [r4] +_0803CB72: + adds r1, r0 +_0803CB74: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0803CD04 + .pool +_0803CB84: + ldr r3, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + lsls r1, r2, 4 + movs r0, 0xF0 + lsls r0, 24 + orrs r1, r0 + orrs r1, r2 + lsls r0, r2, 8 + orrs r1, r0 + lsls r2, 12 + orrs r1, r2 + ldr r0, [r3] + ands r0, r1 + cmp r0, 0 + beq _0803CBAE + b _0803CD04 +_0803CBAE: + ldr r1, =0x02024332 + ldrb r0, [r1, 0x4] + adds r0, 0x1 + strb r0, [r1, 0x4] + b _0803CD04 + .pool +_0803CBC8: + ldr r5, =0x02024064 + ldrb r2, [r5] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r1, r2, r0 + adds r0, r1, 0 + adds r0, 0x54 + ldrb r0, [r0] + cmp r0, 0 + beq _0803CCB4 + ldr r0, =0x02024332 + adds r0, r2, r0 + adds r1, 0x84 + ldrb r1, [r1] + strb r1, [r0] + b _0803CD04 + .pool +_0803CBF4: + ldr r3, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldr r0, =0x02024064 + ldrb r4, [r0] + lsls r0, r4, 2 + adds r0, r1 + ldr r2, [r0] + lsls r1, r2, 4 + movs r0, 0xF0 + lsls r0, 24 + orrs r1, r0 + orrs r1, r2 + lsls r0, r2, 8 + orrs r1, r0 + lsls r2, 12 + orrs r1, r2 + ldr r0, [r3] + ands r0, r1 + cmp r0, 0 + bne _0803CD04 +_0803CC1C: + ldr r0, =0x02024332 + adds r0, r4, r0 +_0803CC20: + movs r1, 0x1 + strb r1, [r0] + b _0803CD04 + .pool +_0803CC38: + ldr r5, =0x02024064 + ldrb r2, [r5] + ldr r4, =0x0202449c + ldr r0, [r4] + adds r0, r2, r0 + adds r0, 0x54 + ldrb r0, [r0] + cmp r0, 0 + beq _0803CCB4 + ldr r0, =0x02023864 + lsls r1, r2, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0xD + bne _0803CC94 + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 8 + orrs r0, r1 + str r0, [r2] + ldr r1, =0x0202421c + ldrb r0, [r5] + adds r0, r1 + movs r1, 0x3 + strb r1, [r0] + ldr r1, =0x02024332 + ldrb r0, [r5] +_0803CC72: + adds r0, r1 + movs r1, 0x4 + strb r1, [r0] + b _0803CD04 + .pool +_0803CC94: + adds r0, r2, 0 + movs r1, 0x1 + bl sub_8185008 + ldr r2, =0x02024332 + ldrb r0, [r5] + adds r2, r0, r2 + ldr r1, [r4] + adds r0, r1 + adds r0, 0x84 + ldrb r0, [r0] + strb r0, [r2] + b _0803CD04 + .pool +_0803CCB4: + ldr r0, =0x0202420b + strb r2, [r0] + ldr r7, =0x02024214 + ldr r6, =0x02024220 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r6 + ldr r4, [r0] + str r4, [r7] + ldr r3, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + lsls r1, r2, 4 + movs r0, 0xF0 + lsls r0, 24 + orrs r1, r0 + orrs r1, r2 + lsls r0, r2, 8 + orrs r1, r0 + lsls r2, 12 + orrs r1, r2 + ldr r0, [r3] + ands r0, r1 + cmp r0, 0 + bne _0803CCFA + ldr r0, =gUnknown_0831BD10 + ldrb r1, [r4] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 +_0803CCFA: + ldrb r0, [r5] + lsls r0, 2 + adds r0, r6 + ldr r1, [r7] + str r1, [r0] +_0803CD04: + ldr r0, =0x02024064 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r0, =0x0202406c + lsls r1, 24 + lsrs r1, 24 +_0803CD12: + adds r5, r0, 0 + ldrb r0, [r5] + cmp r1, r0 + bcs _0803CD1E + bl _0803BE9C +_0803CD1E: + ldr r0, =0x02024332 + ldrb r0, [r0, 0x4] + ldrb r1, [r5] + cmp r0, r1 + bne _0803CD70 + movs r0, 0x1 + bl sub_818603C + ldr r1, =0x03005d04 + ldr r0, =sub_803D2E8 + str r0, [r1] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _0803CD70 + movs r4, 0 + ldrb r5, [r5] + cmp r4, r5 + bge _0803CD70 +_0803CD4A: + ldr r0, =0x0202421c + adds r0, r4, r0 + ldrb r0, [r0] + cmp r0, 0x2 + bne _0803CD66 + lsls r0, r4, 24 + lsrs r0, 24 + ldr r1, =0x0202449c + ldr r1, [r1] + adds r1, r4, r1 + adds r1, 0x5C + ldrb r1, [r1] + bl sub_80571DC +_0803CD66: + adds r4, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _0803CD4A +_0803CD70: + 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_803BE74 + + thumb_func_start sub_803CDB8 +sub_803CDB8: @ 803CDB8 + push {r4,r5,lr} + movs r3, 0 + movs r1, 0 + ldr r0, =0x0202406c + ldrb r2, [r0] + adds r5, r0, 0 + cmp r3, r2 + bge _0803CDDA + ldr r4, =0x02024332 +_0803CDCA: + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0x5 + bne _0803CDD4 + adds r3, 0x1 +_0803CDD4: + adds r1, 0x1 + cmp r1, r2 + blt _0803CDCA +_0803CDDA: + adds r0, r3, 0x1 + ldrb r5, [r5] + cmp r0, r5 + beq _0803CDF0 + movs r0, 0 + b _0803CDF2 + .pool +_0803CDF0: + movs r0, 0x1 +_0803CDF2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_803CDB8 + + thumb_func_start sub_803CDF8 +sub_803CDF8: @ 803CDF8 + push {r4-r7,lr} + ldr r7, =0x02024064 + ldrb r0, [r7] + ldr r6, =0x0202449c + ldr r1, [r6] + adds r1, r0, r1 + adds r1, 0x5C + ldr r4, =0x02023864 + lsls r0, 9 + adds r2, r4, 0x1 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + lsls r1, r0, 9 + adds r1, r2 + ldrb r1, [r1] + bl sub_8184FBC + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x42 + ands r0, r1 + cmp r0, 0x42 + bne _0803CEC6 + ldrb r0, [r7] + ldr r2, [r6] + lsls r1, r0, 1 + adds r1, r0 + adds r1, r2 + adds r1, 0x60 + ldrb r2, [r1] + movs r0, 0xF + ands r0, r2 + strb r0, [r1] + ldrb r0, [r7] + ldr r2, [r6] + lsls r1, r0, 1 + adds r1, r0 + adds r1, r2 + adds r1, 0x60 + lsls r0, 9 + adds r5, r4, 0x2 + adds r0, r5 + ldrb r2, [r0] + movs r3, 0xF0 + adds r0, r3, 0 + ands r0, r2 + ldrb r2, [r1] + orrs r0, r2 + strb r0, [r1] + ldrb r1, [r7] + ldr r2, [r6] + lsls r0, r1, 1 + adds r0, r1 + adds r0, r2 + adds r0, 0x61 + lsls r1, 9 + adds r4, 0x3 + mov r12, r4 + add r1, r12 + ldrb r1, [r1] + strb r1, [r0] + ldrb r0, [r7] + movs r4, 0x2 + eors r0, r4 + ldr r2, [r6] + lsls r1, r0, 1 + adds r1, r0 + adds r1, r2 + adds r1, 0x60 + ldrb r2, [r1] + adds r0, r3, 0 + ands r0, r2 + strb r0, [r1] + ldrb r0, [r7] + eors r0, r4 + ldr r2, [r6] + lsls r1, r0, 1 + adds r1, r0 + adds r1, r2 + adds r1, 0x60 + ldrb r0, [r7] + lsls r0, 9 + adds r0, r5 + ldrb r0, [r0] + ands r3, r0 + lsrs r3, 4 + ldrb r0, [r1] + orrs r3, r0 + strb r3, [r1] + ldrb r0, [r7] + eors r4, r0 + ldr r0, [r6] + lsls r1, r4, 1 + adds r1, r4 + adds r1, r0 + adds r1, 0x62 + ldrb r0, [r7] + lsls r0, 9 + add r0, r12 + ldrb r0, [r0] + strb r0, [r1] +_0803CEC6: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803CDF8 + + thumb_func_start sub_803CEDC +sub_803CEDC: @ 803CEDC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x0202407a + adds r4, r0, r2 + ldrb r5, [r4] + adds r2, r1, r2 + ldrb r3, [r2] + strb r3, [r4] + strb r5, [r2] + ldr r2, =0x0202407e + adds r0, r2 + ldrb r5, [r0] + adds r1, r2 + ldrb r2, [r1] + strb r2, [r0] + strb r5, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803CEDC + + thumb_func_start b_first_side +b_first_side: @ 803CF10 + 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 r9, r0 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _0803CFD8 + ldr r1, [sp, 0x8] + str r1, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _0803CFD8 + ldr r1, =0x02024084 + movs r0, 0x58 + mov r2, r9 + muls r2, r0 + adds r0, r2, 0 + adds r0, r1 + adds r0, 0x20 + ldrb r3, [r0] + cmp r3, 0x21 + bne _0803CF7C + ldr r0, =0x020243cc + ldrh r1, [r0] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0803CF8C +_0803CF7C: + cmp r3, 0x22 + bne _0803CF98 + ldr r0, =0x020243cc + ldrh r1, [r0] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _0803CF98 +_0803CF8C: + movs r3, 0x2 + b _0803CF9A + .pool +_0803CF98: + movs r3, 0x1 +_0803CF9A: + movs r0, 0x58 + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + ldr r2, =0x02024084 + adds r0, r2 + adds r0, 0x20 + ldrb r2, [r0] + cmp r2, 0x21 + bne _0803CFBA + ldr r0, =0x020243cc + ldrh r1, [r0] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0803CFCA +_0803CFBA: + cmp r2, 0x22 + bne _0803CFDA + ldr r0, =0x020243cc + ldrh r1, [r0] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _0803CFDA +_0803CFCA: + movs r7, 0x2 + b _0803CFDC + .pool +_0803CFD8: + movs r3, 0x1 +_0803CFDA: + movs r7, 0x1 +_0803CFDC: + ldr r1, =0x02024084 + movs r0, 0x58 + mov r2, r9 + muls r2, r0 + adds r0, r2, 0 + adds r4, r0, r1 + ldrh r0, [r4, 0x6] + muls r3, r0 + ldr r2, =gUnknown_08329D2E + movs r1, 0x1B + ldrsb r1, [r4, r1] + lsls r1, 1 + adds r0, r1, r2 + ldrb r0, [r0] + muls r0, r3 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + bl __divsi3 + mov r8, r0 + ldrh r0, [r4, 0x2E] + cmp r0, 0xAF + bne _0803D02C + ldr r1, =0x02024404 + mov r3, r9 + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r6, [r0, 0x7] + ldrb r5, [r0, 0x1A] + b _0803D040 + .pool +_0803D02C: + ldrh r0, [r4, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r6, r0, 24 + ldrh r0, [r4, 0x2E] + bl itemid_get_quality + lsls r0, 24 + lsrs r5, r0, 24 +_0803D040: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x023f0102 + ands r0, r1 + cmp r0, 0 + bne _0803D074 + ldr r0, =0x00000869 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0803D074 + mov r0, r9 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803D074 + movs r0, 0x6E + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + movs r1, 0x64 + bl __udivsi3 + mov r8, r0 +_0803D074: + cmp r6, 0x18 + bne _0803D07E + mov r2, r8 + lsrs r2, 1 + mov r8, r2 +_0803D07E: + ldr r1, =0x02024084 + movs r0, 0x58 + mov r3, r9 + muls r3, r0 + adds r0, r3, 0 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0803D09C + mov r0, r8 + lsrs r0, 2 + mov r8, r0 +_0803D09C: + cmp r6, 0x1A + bne _0803D0B8 + ldr r0, =0x02024330 + ldrh r4, [r0] + lsls r0, r5, 16 + subs r0, r5 + movs r1, 0x64 + bl __divsi3 + cmp r4, r0 + bge _0803D0B8 + movs r1, 0x1 + negs r1, r1 + mov r8, r1 +_0803D0B8: + ldr r1, =0x02024084 + movs r0, 0x58 + mov r2, r10 + muls r2, r0 + adds r0, r2, 0 + adds r4, r0, r1 + ldrh r0, [r4, 0x6] + adds r3, r0, 0 + muls r3, r7 + ldr r2, =gUnknown_08329D2E + movs r1, 0x1B + ldrsb r1, [r4, r1] + lsls r1, 1 + adds r0, r1, r2 + ldrb r0, [r0] + muls r0, r3 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + bl __divsi3 + adds r7, r0, 0 + ldrh r0, [r4, 0x2E] + cmp r0, 0xAF + bne _0803D118 + ldr r1, =0x02024404 + mov r3, r10 + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r6, [r0, 0x7] + ldrb r5, [r0, 0x1A] + b _0803D12C + .pool +_0803D118: + ldrh r0, [r4, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r6, r0, 24 + ldrh r0, [r4, 0x2E] + bl itemid_get_quality + lsls r0, 24 + lsrs r5, r0, 24 +_0803D12C: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x023f0102 + ands r0, r1 + cmp r0, 0 + bne _0803D15C + ldr r0, =0x00000869 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0803D15C + mov r0, r10 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803D15C + movs r0, 0x6E + muls r0, r7 + movs r1, 0x64 + bl __udivsi3 + adds r7, r0, 0 +_0803D15C: + cmp r6, 0x18 + bne _0803D162 + lsrs r7, 1 +_0803D162: + ldr r2, =0x02024084 + movs r0, 0x58 + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + adds r1, r2, 0 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0803D17E + lsrs r7, 2 +_0803D17E: + cmp r6, 0x1A + bne _0803D198 + ldr r0, =0x02024330 + ldrh r4, [r0] + lsls r0, r5, 16 + subs r0, r5 + movs r1, 0x64 + bl __divsi3 + cmp r4, r0 + bge _0803D198 + movs r7, 0x1 + negs r7, r7 +_0803D198: + ldr r2, [sp, 0x4] + cmp r2, 0 + beq _0803D1B8 + movs r3, 0 + b _0803D254 + .pool +_0803D1B8: + ldr r0, =0x0202421c + mov r3, r9 + adds r1, r3, r0 + ldrb r1, [r1] + adds r2, r0, 0 + cmp r1, 0 + bne _0803D208 + ldr r0, =0x0202433c + lsls r1, r3, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 29 + cmp r0, 0 + bge _0803D1E0 + movs r3, 0xA5 + b _0803D20A + .pool +_0803D1E0: + ldr r0, =0x0202449c + ldr r0, [r0] + add r0, r9 + adds r0, 0x80 + ldrb r0, [r0] + lsls r0, 1 + movs r1, 0x58 + mov r3, r9 + muls r3, r1 + adds r1, r3, 0 + adds r0, r1 + ldr r1, =0x02024084 + adds r1, 0xC + adds r0, r1 + ldrh r3, [r0] + b _0803D20A + .pool +_0803D208: + movs r3, 0 +_0803D20A: + mov r1, r10 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _0803D254 + ldr r0, =0x0202433c + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 29 + cmp r0, 0 + bge _0803D22C + movs r2, 0xA5 + b _0803D256 + .pool +_0803D22C: + ldr r0, =0x0202449c + ldr r0, [r0] + add r0, r10 + adds r0, 0x80 + ldrb r0, [r0] + lsls r0, 1 + movs r1, 0x58 + mov r2, r10 + muls r2, r1 + adds r1, r2, 0 + adds r0, r1 + ldr r1, =0x02024084 + adds r1, 0xC + adds r0, r1 + ldrh r2, [r0] + b _0803D256 + .pool +_0803D254: + movs r2, 0 +_0803D256: + ldr r4, =gBattleMoves + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r4 + movs r1, 0x7 + ldrsb r1, [r0, r1] + lsls r3, r2, 1 + cmp r1, 0 + bne _0803D27A + adds r0, r3, r2 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x7] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + beq _0803D2B8 +_0803D27A: + adds r0, r3, r2 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x7] + lsls r0, 24 + asrs r0, 24 + cmp r1, r0 + bne _0803D2AE + cmp r8, r7 + bne _0803D2A4 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0803D2A4 + movs r3, 0x2 + b _0803D2D4 + .pool +_0803D2A4: + cmp r8, r7 + bcs _0803D2D6 + movs r0, 0x1 + str r0, [sp, 0x8] + b _0803D2D6 +_0803D2AE: + cmp r1, r0 + bge _0803D2D6 + movs r1, 0x1 + str r1, [sp, 0x8] + b _0803D2D6 +_0803D2B8: + cmp r8, r7 + bne _0803D2CE + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0803D2CE + movs r2, 0x2 + str r2, [sp, 0x8] + b _0803D2D6 +_0803D2CE: + cmp r8, r7 + bcs _0803D2D6 + movs r3, 0x1 +_0803D2D4: + str r3, [sp, 0x8] +_0803D2D6: + ldr r0, [sp, 0x8] + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end b_first_side + + thumb_func_start sub_803D2E8 +sub_803D2E8: @ 803D2E8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r3, 0 + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0803D354 + ldr r0, =0x02024064 + strb r3, [r0] + ldr r4, =0x0202406c + mov r8, r0 + ldrb r0, [r4] + cmp r3, r0 + bcc _0803D310 + b _0803D54A +_0803D310: + ldr r7, =0x0202407a + ldr r6, =0x0202421c + mov r2, r8 + ldr r5, =0x0202407e +_0803D318: + adds r1, r3, r7 + ldrb r0, [r2] + adds r0, r6 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r3, r5 + ldrb r0, [r2] + strb r0, [r1] + adds r3, 0x1 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r4] + cmp r0, r1 + bcc _0803D318 + b _0803D54A + .pool +_0803D354: + movs r2, 0x2 + ands r1, r2 + cmp r1, 0 + beq _0803D3A4 + ldr r0, =0x02024064 + strb r3, [r0] + ldr r1, =0x0202406c + mov r8, r0 + adds r2, r1, 0 + ldrb r2, [r2] + cmp r3, r2 + bcs _0803D3C0 + ldr r0, =0x0202421c + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0x3 + beq _0803D3BE +_0803D376: + mov r7, r8 + ldrb r0, [r7] + adds r0, 0x1 + strb r0, [r7] + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0202406c + ldrb r1, [r1] + cmp r0, r1 + bcs _0803D3C0 + ldrb r0, [r7] + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x3 + bne _0803D376 + b _0803D3BE + .pool +_0803D3A4: + ldr r1, =0x0202421c + ldrb r0, [r1] + ldr r4, =0x02024064 + mov r8, r4 + cmp r0, 0x3 + bne _0803D3B4 + strb r3, [r4] + movs r3, 0x5 +_0803D3B4: + ldrb r0, [r1, 0x2] + cmp r0, 0x3 + bne _0803D3C0 + mov r7, r8 + strb r2, [r7] +_0803D3BE: + movs r3, 0x5 +_0803D3C0: + cmp r3, 0x5 + bne _0803D448 + ldr r6, =0x0202407a + ldr r1, =0x0202421c + mov r2, r8 + ldrb r0, [r2] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r6] + ldr r2, =0x0202407e + mov r3, r8 + ldrb r0, [r3] + strb r0, [r2] + movs r3, 0x1 + movs r5, 0 + adds r4, r1, 0 + ldr r7, =0x03005d04 + mov r10, r7 + ldr r0, =bc_80154A0 + mov r12, r0 + ldr r1, =0x0202449c + mov r9, r1 + ldr r7, =0x0202406c + ldrb r7, [r7] + cmp r5, r7 + bge _0803D41A + adds r7, r6, 0 + adds r6, r4, 0 + adds r4, r2, 0 + ldr r2, =0x0202406c +_0803D3FC: + mov r0, r8 + ldrb r0, [r0] + cmp r5, r0 + beq _0803D412 + adds r1, r3, r7 + adds r0, r5, r6 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, r4 + strb r5, [r0] + adds r3, 0x1 +_0803D412: + adds r5, 0x1 + ldrb r1, [r2] + cmp r5, r1 + blt _0803D3FC +_0803D41A: + mov r2, r12 + mov r3, r10 + str r2, [r3] + mov r4, r9 + ldr r0, [r4] + b _0803D554 + .pool +_0803D448: + movs r0, 0 + mov r7, r8 + strb r0, [r7] + ldr r1, =0x0202406c + ldrb r0, [r1] + cmp r0, 0 + beq _0803D48E + ldr r6, =0x0202421c + mov r2, r8 + ldr r5, =0x0202407a + ldr r4, =0x0202407e +_0803D45E: + ldrb r0, [r2] + adds r0, r6 + ldrb r1, [r0] + subs r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0803D47C + adds r0, r3, r5 + strb r1, [r0] + adds r1, r3, r4 + mov r7, r8 + ldrb r0, [r7] + strb r0, [r1] + adds r3, 0x1 +_0803D47C: + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0202406c + ldrb r1, [r1] + cmp r0, r1 + bcc _0803D45E +_0803D48E: + movs r0, 0 + mov r2, r8 + strb r0, [r2] + ldr r4, =0x0202406c + ldrb r0, [r4] + cmp r0, 0 + beq _0803D4D2 + ldr r6, =0x0202421c + ldr r5, =0x0202407a + ldr r4, =0x0202407e +_0803D4A2: + ldrb r0, [r2] + adds r0, r6 + ldrb r1, [r0] + subs r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _0803D4C0 + adds r0, r3, r5 + strb r1, [r0] + adds r1, r3, r4 + mov r7, r8 + ldrb r0, [r7] + strb r0, [r1] + adds r3, 0x1 +_0803D4C0: + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0202406c + ldrb r1, [r1] + cmp r0, r1 + bcc _0803D4A2 +_0803D4D2: + movs r5, 0 + b _0803D540 + .pool +_0803D4E8: + adds r4, r5, 0x1 + adds r7, r4, 0 + ldrb r1, [r1] + cmp r7, r1 + bge _0803D53E + ldr r6, =0x0202407a + lsls r2, r5, 24 + mov r8, r2 +_0803D4F8: + ldr r0, =0x0202407e + adds r1, r5, r0 + ldrb r3, [r1] + adds r0, r4, r0 + ldrb r1, [r0] + adds r0, r5, r6 + ldrb r2, [r0] + cmp r2, 0x1 + beq _0803D534 + adds r0, r4, r6 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0803D534 + cmp r2, 0x2 + beq _0803D534 + cmp r0, 0x2 + beq _0803D534 + adds r0, r3, 0 + movs r2, 0 + bl b_first_side + lsls r0, 24 + cmp r0, 0 + beq _0803D534 + lsls r1, r4, 24 + lsrs r1, 24 + mov r3, r8 + lsrs r0, r3, 24 + bl sub_803CEDC +_0803D534: + adds r4, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _0803D4F8 +_0803D53E: + adds r5, r7, 0 +_0803D540: + ldr r1, =0x0202406c + ldrb r0, [r1] + subs r0, 0x1 + cmp r5, r0 + blt _0803D4E8 +_0803D54A: + ldr r1, =0x03005d04 + ldr r0, =bc_80154A0 + str r0, [r1] + ldr r0, =0x0202449c + ldr r0, [r0] +_0803D554: + adds r0, 0x48 + movs r1, 0 + strb 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_803D2E8 + + thumb_func_start sub_803D580 +sub_803D580: @ 803D580 + 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 + ldr r1, =0x02024064 + movs r0, 0 + strb r0, [r1] + ldr r0, =0x0202406c + ldrb r2, [r0] + adds r5, r1, 0 + cmp r2, 0 + beq _0803D678 + ldr r7, =0x0202433c + adds r6, r5, 0 + ldr r0, =0x020240d4 + mov r12, r0 + ldr r1, =0x020242bc + mov r8, r1 + mov r10, r8 +_0803D5AE: + mov r2, r9 + cmp r2, 0 + beq _0803D5EC + ldrb r1, [r6] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldrb r1, [r6] + lsls r1, 4 + adds r1, r7 + ldrb r2, [r1] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + b _0803D648 + .pool +_0803D5EC: + ldrb r0, [r6] + lsls r0, 4 + adds r2, r0, r7 + movs r1, 0 + mov r4, r10 + movs r3, 0 +_0803D5F8: + adds r0, r2, r1 + strb r3, [r0] + adds r1, 0x1 + cmp r1, 0xF + bls _0803D5F8 + ldrb r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r1, r0, r4 + ldrb r0, [r1, 0x16] + cmp r0, 0 + beq _0803D616 + subs r0, 0x1 + strb r0, [r1, 0x16] +_0803D616: + ldrb r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r1, r0, r4 + ldrb r0, [r1, 0x19] + cmp r0, 0 + beq _0803D648 + subs r0, 0x1 + strb r0, [r1, 0x19] + ldrb r2, [r5] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x19] + cmp r0, 0 + bne _0803D648 + movs r0, 0x58 + muls r2, r0 + add r2, r12 + ldr r0, [r2] + ldr r1, =0xffbfffff + ands r0, r1 + str r0, [r2] +_0803D648: + ldrb r2, [r5] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + add r0, r8 + ldrb r0, [r0, 0xA] + cmp r0, 0 + bne _0803D666 + movs r0, 0x58 + muls r2, r0 + add r2, r12 + ldr r0, [r2] + ldr r1, =0xfeffffff + ands r0, r1 + str r0, [r2] +_0803D666: + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0202406c + ldrb r1, [r1] + cmp r0, r1 + bcc _0803D5AE +_0803D678: + movs r0, 0 + ldr r2, =0x02024294 + strb r0, [r2, 0x8] + strb r0, [r2, 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_803D580 + + thumb_func_start sub_803D6A0 +sub_803D6A0: @ 803D6A0 + push {r4-r6,lr} + ldr r2, =0x02024064 + movs r0, 0 + strb r0, [r2] + ldr r0, =0x0202406c + ldrb r1, [r0] + adds r6, r0, 0 + cmp r1, 0 + beq _0803D6DE + adds r3, r2, 0 + movs r4, 0 + ldr r5, =0x0202437c +_0803D6B8: + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r5 + movs r1, 0 +_0803D6C4: + adds r0, r2, r1 + strb r4, [r0] + adds r1, 0x1 + cmp r1, 0x13 + bls _0803D6C4 + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r6] + cmp r0, r1 + bcc _0803D6B8 +_0803D6DE: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803D6A0 + + thumb_func_start bc_80154A0 +bc_80154A0: @ 803D6F0 + push {r4-r7,lr} + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + bne _0803D7AE + ldr r2, =0x0202449c + ldr r0, [r2] + adds r0, 0x48 + ldr r1, =0x0202406c + ldrb r0, [r0] + mov r12, r2 + adds r6, r1, 0 + ldrb r1, [r6] + cmp r0, r1 + bcs _0803D7AE + ldr r5, =0x02024064 + ldr r4, =0x0202420b + movs r7, 0x84 + lsls r7, 1 +_0803D71C: + ldr r1, [r2] + adds r1, 0x48 + ldrb r0, [r1] + strb r0, [r4] + strb r0, [r5] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, =0x02024274 + ldrb r3, [r5] + lsls r0, r3, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r7 + bne _0803D7A0 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r3 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0803D7A0 + ldr r2, =0x020242bc + ldrb r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x18] + lsls r0, 31 + cmp r0, 0 + bne _0803D7A0 + ldr r0, =0x0202433c + lsls r1, r3, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 29 + cmp r0, 0 + blt _0803D7A0 + ldr r0, =gUnknown_082DB1FF + bl b_call_bc_move_exec + b _0803D7E8 + .pool +_0803D7A0: + mov r2, r12 + ldr r0, [r2] + adds r0, 0x48 + ldrb r0, [r0] + ldrb r1, [r6] + cmp r0, r1 + bcc _0803D71C +_0803D7AE: + bl b_clear_atk_up_if_hit_flag_unless_enraged + ldr r1, =0x02024082 + movs r0, 0 + strb r0, [r1] + ldr r1, =0x02024083 + ldr r0, =0x0202407a + movs r3, 0 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, =0x02024400 + movs r2, 0 + strh r3, [r0] + ldr r0, =0x0202449c + ldr r0, [r0] + strb r2, [r0, 0x13] + ldr r1, =0x03005d04 + ldr r0, =bc_bs_exec + str r0, [r1] + ldr r0, =0x02024332 + strb r2, [r0, 0x3] + strb r2, [r0, 0x4] + ldr r0, =0x02024474 + strb r2, [r0, 0x16] + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x8] + adds r0, 0x20 + strb r2, [r0] +_0803D7E8: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end bc_80154A0 + + thumb_func_start bc_bs_exec +bc_bs_exec: @ 803D818 + push {r4-r6,lr} + ldr r6, =0x0202433a + ldrb r0, [r6] + ldr r2, =0x02024083 + cmp r0, 0 + beq _0803D828 + movs r0, 0xC + strb r0, [r2] +_0803D828: + ldr r5, =0x0202449c + ldr r0, [r5] + adds r0, 0x4B + ldr r4, =0x02024082 + ldrb r1, [r4] + strb r1, [r0] + ldr r1, =gUnknown_0831BC0C + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =0x0202406c + ldrb r1, [r4] + ldrb r0, [r0] + cmp r1, r0 + bcc _0803D894 + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xffefffff + ands r0, r1 + str r0, [r2] + ldr r3, =0x03005d04 + ldr r2, =gUnknown_0831BC44 + ldrb r1, [r6] + movs r0, 0x7F + ands r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + str r0, [r3] + b _0803D8AC + .pool +_0803D894: + ldr r0, [r5] + adds r0, 0x4B + ldrb r0, [r0] + cmp r0, r1 + beq _0803D8AC + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xfffffdff + ands r0, r1 + ldr r1, =0xfff7ffff + ands r0, r1 + str r0, [r2] +_0803D8AC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bc_bs_exec + + thumb_func_start sub_803D8C0 +sub_803D8C0: @ 803D8C0 + push {r4,lr} + ldr r1, =0x02024083 + movs r0, 0 + strb r0, [r1] + ldr r1, =0x02022fec + ldr r2, [r1] + ldr r0, =0x02000002 + ands r0, r2 + cmp r0, 0 + beq _0803D920 + ldr r1, =0x020375f0 + ldr r4, =0x0202433a + ldrb r0, [r4] + strh r0, [r1] + ldr r1, =0x02022f58 + ldrb r0, [r4] + strb r0, [r1] + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, =0x0202420b + strb r0, [r1] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAA35 + str r0, [r1] + ldrb r1, [r4] + movs r0, 0x7F + ands r0, r1 + strb r0, [r4] + b _0803DAA4 + .pool +_0803D920: + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _0803D95C + ldr r0, =0x043f0900 + ands r2, r0 + cmp r2, 0 + beq _0803D95C + bl sub_805EA60 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAA87 + str r0, [r1] + ldr r0, =0x02038bca + ldrh r1, [r0] + ldr r0, =0x000003fe + cmp r1, r0 + bne _0803D946 + b _0803DA8A +_0803D946: + b _0803DA94 + .pool +_0803D95C: + ldr r0, [r1] + movs r1, 0xA + ands r0, r1 + cmp r0, 0x8 + beq _0803D968 + b _0803DA9E +_0803D968: + bl sub_805EA60 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DA92D + str r0, [r1] + ldr r2, =gTrainers + ldr r0, =0x02038bca + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x1] + subs r0, 0x3 + cmp r0, 0x32 + bls _0803D98A + b _0803DA94 +_0803D98A: + lsls r0, 2 + ldr r1, =_0803D9A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0803D9A8: + .4byte _0803DA80 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA80 + .4byte _0803DA94 + .4byte _0803DA80 + .4byte _0803DA94 + .4byte _0803DA80 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA74 + .4byte _0803DA8A + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA74 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA80 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA94 + .4byte _0803DA80 +_0803DA74: + ldr r0, =0x00000163 + bl song_play_for_text + b _0803DAA4 + .pool +_0803DA80: + movs r0, 0xD4 + lsls r0, 1 + bl song_play_for_text + b _0803DAA4 +_0803DA8A: + movs r0, 0xB1 + lsls r0, 1 + bl song_play_for_text + b _0803DAA4 +_0803DA94: + movs r0, 0xCE + lsls r0, 1 + bl song_play_for_text + b _0803DAA4 +_0803DA9E: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DA96A + str r0, [r1] +_0803DAA4: + ldr r1, =0x03005d04 + ldr r0, =sub_803DCD8 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803D8C0 + + thumb_func_start sub_803DAC0 +sub_803DAC0: @ 803DAC0 + push {r4,lr} + ldr r1, =0x02024083 + movs r0, 0 + strb r0, [r1] + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r0, =0x02000002 + ands r0, r1 + cmp r0, 0 + beq _0803DB7C + ldr r0, =0x003f0100 + ands r1, r0 + cmp r1, 0 + beq _0803DB44 + ldr r3, =0x0202433a + ldrb r2, [r3] + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _0803DB2C + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB9C8 + str r0, [r1] + movs r0, 0x7F + ands r0, r2 + strb r0, [r3] + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1] + b _0803DB82 + .pool +_0803DB2C: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAA0B + str r0, [r1] + movs r0, 0x7F + ands r0, r2 + strb r0, [r3] + b _0803DB82 + .pool +_0803DB44: + ldr r1, =0x02022f58 + ldr r4, =0x0202433a + ldrb r0, [r4] + strb r0, [r1] + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, =0x0202420b + strb r0, [r1] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAA35 + str r0, [r1] + ldrb r1, [r4] + movs r0, 0x7F + ands r0, r1 + strb r0, [r4] + b _0803DB82 + .pool +_0803DB7C: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DA96D + str r0, [r1] +_0803DB82: + ldr r1, =0x03005d04 + ldr r0, =sub_803DCD8 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803DAC0 + + thumb_func_start sub_803DBA0 +sub_803DBA0: @ 803DBA0 + push {lr} + ldr r1, =0x02024083 + movs r0, 0 + strb r0, [r1] + ldr r1, =0x02022fec + ldr r2, [r1] + ldr r0, =0x003f0100 + ands r0, r2 + cmp r0, 0 + beq _0803DBFC + movs r0, 0x8 + ands r2, r0 + cmp r2, 0 + beq _0803DBFC + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB9C1 + str r0, [r1] + ldr r1, =0x0202433a + movs r0, 0x9 + strb r0, [r1] + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1] + b _0803DC6A + .pool +_0803DBFC: + ldr r0, [r1] + movs r1, 0x80 + lsls r1, 19 + ands r0, r1 + cmp r0, 0 + beq _0803DC24 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB9C1 + str r0, [r1] + ldr r1, =0x0202433a + movs r0, 0x9 + strb r0, [r1] + b _0803DC6A + .pool +_0803DC24: + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x1] + lsls r0, 27 + lsrs r0, 30 + cmp r0, 0x1 + beq _0803DC54 + cmp r0, 0x2 + beq _0803DC64 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAAF0 + b _0803DC68 + .pool +_0803DC54: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAADB + b _0803DC68 + .pool +_0803DC64: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAAE9 +_0803DC68: + str r0, [r1] +_0803DC6A: + ldr r1, =0x03005d04 + ldr r0, =sub_803DCD8 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_803DBA0 + + thumb_func_start bc_80158BC +bc_80158BC: @ 803DC84 + ldr r1, =0x02024083 + movs r0, 0 + strb r0, [r1] + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x7 + strb r0, [r1, 0x1] + ldr r2, =0x0202420b + ldrb r0, [r2] + strb r0, [r1, 0x2] + ldr r3, =0x0202406e + ldrb r0, [r2] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAAF7 + str r0, [r1] + ldr r1, =0x03005d04 + ldr r0, =sub_803DCD8 + str r0, [r1] + bx lr + .pool + thumb_func_end bc_80158BC + + thumb_func_start sub_803DCD8 +sub_803DCD8: @ 803DCD8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x02024083 + ldrb r0, [r0] + subs r0, 0xB + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _0803DCEE + b _0803DE10 +_0803DCEE: + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r0, =0x023f0b92 + ands r1, r0 + cmp r1, 0 + bne _0803DDB6 + ldr r2, =0x02024064 + strb r1, [r2] + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r1, r0 + bcs _0803DDB2 + adds r5, r2, 0 + ldr r0, =0x0202406e + mov r8, r0 + movs r7, 0x64 + ldr r6, =0x020244ec +_0803DD10: + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803DDA0 + ldr r4, =0x03005d10 + ldrh r0, [r4, 0x6] + cmp r0, 0 + bne _0803DD74 + ldrb r0, [r5] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + muls r0, r7 + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r4, 0x6] + ldrb r0, [r5] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + muls r0, r7 + adds r0, r6 + movs r1, 0x2 + adds r2, r4, 0 + adds r2, 0x8 + bl pokemon_getattr + b _0803DDA0 + .pool +_0803DD74: + ldrb r0, [r5] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + muls r0, r7 + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r4, 0x26] + ldrb r0, [r5] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + muls r0, r7 + adds r0, r6 + movs r1, 0x2 + adds r2, r4, 0 + adds r2, 0x14 + bl pokemon_getattr +_0803DDA0: + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803DD10 +_0803DDB2: + bl sub_80EC728 +_0803DDB6: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x023f0b9a + ands r0, r1 + cmp r0, 0 + bne _0803DDD2 + ldr r0, =0x03005d10 + ldrb r1, [r0, 0x5] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0803DDD2 + bl sub_80EE184 +_0803DDD2: + bl sub_8186444 + movs r0, 0x3 + bl sub_80A2390 + movs r0, 0x5 + bl sub_80A2F50 + ldr r1, =0x03005d04 + ldr r0, =sub_803DE40 + str r0, [r1] + ldr r1, =0x030061e8 + ldr r0, =sub_8038420 + str r0, [r1] + b _0803DE2A + .pool +_0803DE10: + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0803DE2A + ldr r1, =gUnknown_0831BD10 + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 +_0803DE2A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803DCD8 + + thumb_func_start sub_803DE40 +sub_803DE40: @ 803DE40 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0803DE86 + bl ResetAllObjectData + ldr r0, =0x03005d54 + ldrb r0, [r0] + cmp r0, 0 + beq _0803DE62 + ldr r0, =0x0202433a + ldrb r0, [r0] + cmp r0, 0x1 + beq _0803DE80 +_0803DE62: + ldr r1, =0x03005d04 + ldr r0, =c4_overworld + str r0, [r1] + b _0803DEA2 + .pool +_0803DE80: + ldr r1, =0x03005d04 + ldr r0, =bc_evolution_cutscene + str r0, [r1] +_0803DE86: + bl FreeAllWindowBuffers + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0803DEA2 + bl sub_805F094 + bl sub_8057028 + bl dp11_free +_0803DEA2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_803DE40 + + thumb_func_start bc_evolution_cutscene +bc_evolution_cutscene: @ 803DEB4 + push {r4-r6,lr} + ldr r0, =0x03005d54 + ldrb r1, [r0] + adds r3, r0, 0 + cmp r1, 0 + beq _0803DF2E +_0803DEC0: + movs r6, 0 +_0803DEC2: + ldrb r2, [r3] + ldr r0, =gUnknown_0832A328 + lsls r1, r6, 2 + adds r1, r0 + ldr r1, [r1] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0803DF20 + bics r2, r1 + strb r2, [r3] + movs r0, 0x64 + adds r1, r6, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0 + bl GetEvolutionTargetSpecies + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _0803DF20 + bl FreeAllWindowBuffers + ldr r0, =0x03005d04 + ldr r1, =sub_803DF48 + str r1, [r0] + lsls r3, r6, 24 + lsrs r3, 24 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl evolution_cutscene + b _0803DF34 + .pool +_0803DF20: + adds r6, 0x1 + ldr r3, =0x03005d54 + cmp r6, 0x5 + ble _0803DEC2 + ldrb r0, [r3] + cmp r0, 0 + bne _0803DEC0 +_0803DF2E: + ldr r1, =0x03005d04 + ldr r0, =c4_overworld + str r0, [r1] +_0803DF34: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bc_evolution_cutscene + + thumb_func_start sub_803DF48 +sub_803DF48: @ 803DF48 + push {lr} + ldr r0, =0x030022c0 + ldr r1, [r0, 0x4] + ldr r0, =sub_8038420 + cmp r1, r0 + bne _0803DF5A + ldr r1, =0x03005d04 + ldr r0, =bc_evolution_cutscene + str r0, [r1] +_0803DF5A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_803DF48 + + thumb_func_start c4_overworld +c4_overworld: @ 803DF70 + push {r4-r6,lr} + ldr r6, =0x02022fec + ldr r0, [r6] + movs r5, 0x2 + ands r0, r5 + cmp r0, 0 + bne _0803DF8C + ldr r4, =0x020244ec + adds r0, r4, 0 + bl sub_806DCB4 + adds r0, r4, 0 + bl sub_806DEC4 +_0803DF8C: + ldr r4, [r6] + adds r0, r4, 0 + ands r0, r5 + cmp r0, 0 + beq _0803DF9E + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0803DFEC +_0803DF9E: + ldr r1, =0x020375f0 + ldr r5, =0x0202433a + ldrb r0, [r5] + strh r0, [r1] + ldr r3, =0x030022c0 + ldr r0, =0x00000439 + adds r2, r3, r0 + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, =0x03005d00 + ldr r0, [r0] + str r0, [r3] + movs r0, 0x80 + lsls r0, 3 + ands r4, r0 + cmp r4, 0 + beq _0803DFDE + ldr r0, =0x02024744 + bl sub_8161F18 + ldrb r1, [r5] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0803DFDA + cmp r1, 0x7 + bne _0803DFDE +_0803DFDA: + bl sub_8161F4C +_0803DFDE: + movs r0, 0x5A + bl m4aSongNumStop + ldr r0, =0x030022c0 + ldr r0, [r0, 0x8] + bl SetMainCallback2 +_0803DFEC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end c4_overworld + + thumb_func_start bc_move_exec_returning +bc_move_exec_returning: @ 803E018 + push {lr} + ldr r0, =0x02024083 + ldrb r0, [r0] + subs r0, 0xB + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0803E060 + ldr r3, =0x020244a8 + ldr r0, [r3] + ldr r0, [r0, 0xC] + adds r1, r0, 0 + adds r1, 0x20 + ldrb r0, [r1] + cmp r0, 0 + beq _0803E03C + subs r0, 0x1 + strb r0, [r1] +_0803E03C: + ldr r2, =0x03005d04 + ldr r0, [r3] + ldr r1, [r0, 0xC] + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2] + b _0803E07A + .pool +_0803E060: + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0803E07A + ldr r1, =gUnknown_0831BD10 + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 +_0803E07A: + pop {r0} + bx r0 + .pool + thumb_func_end bc_move_exec_returning + + thumb_func_start sub_803E08C +sub_803E08C: @ 803E08C + push {lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0803E0A8 + ldr r1, =gUnknown_0831BD10 + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 +_0803E0A8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_803E08C + + thumb_func_start sub_803E0B8 +sub_803E0B8: @ 803E0B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r0, 0x4 + str r0, [sp] + ldr r6, =0x0202420b + ldr r1, =0x0202407e + ldr r0, =0x02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r6] + ldr r1, =0x0202449c + ldr r3, [r1] + adds r0, r3, 0 + adds r0, 0x91 + ldrb r2, [r0] + ldr r1, =gUnknown_0832A328 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ands r2, r0 + cmp r2, 0 + beq _0803E110 + ldr r1, =0x02024083 + movs r0, 0xC + b _0803E83C + .pool +_0803E110: + ldr r1, =0x02024211 + movs r0, 0x1 + strb r0, [r1] + ldr r1, =0x02024474 + movs r0, 0x1 + strb r0, [r1, 0xE] + ldr r5, =0x000001a3 + adds r0, r3, r5 + strb r2, [r0] + ldr r0, =0x0202427c + strb r2, [r0] + ldr r0, =0x02024212 + strb r2, [r0] + ldr r0, =0x02024332 + strb r2, [r0, 0x6] + ldr r2, =0x020241e8 + ldr r0, =0x020241e9 + mov r9, r0 + ldrb r0, [r6] + ldr r3, =0x0202449c + ldr r1, [r3] + adds r0, r1 + adds r0, 0x80 + ldrb r0, [r0] + mov r5, r9 + strb r0, [r5] + strb r0, [r2] + ldr r1, =0x0202433c + ldrb r4, [r6] + lsls r0, r4, 4 + adds r3, r0, r1 + ldrb r1, [r3] + lsls r0, r1, 29 + mov r8, r2 + cmp r0, 0 + bge _0803E1BC + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + ldr r2, =0x020241ea + ldr r1, =0x020241ec + movs r0, 0xA5 + strh r0, [r1] + strh r0, [r2] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 4 + orrs r0, r1 + str r0, [r2] + movs r0, 0xA5 + movs r1, 0 + bl sub_80458E0 + ldrb r1, [r6] + ldr r3, =0x0202449c + ldr r2, [r3] + b _0803E316 + .pool +_0803E1BC: + ldr r5, =0x02024084 + mov r10, r5 + movs r0, 0x58 + adds r5, r4, 0 + muls r5, r0 + mov r0, r10 + adds r0, 0x50 + adds r0, r5, r0 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 5 + ands r0, r1 + cmp r0, 0 + bne _0803E1E2 + movs r7, 0x80 + lsls r7, 15 + ands r7, r1 + cmp r7, 0 + beq _0803E204 +_0803E1E2: + ldr r3, =0x020241ea + ldr r2, =0x020241ec + ldr r1, =0x02024268 + lsls r0, r4, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + strh r0, [r3] + b _0803E33C + .pool +_0803E204: + ldr r1, =0x020242bc + mov r12, r1 + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + add r0, r12 + ldrh r3, [r0, 0x6] + adds r1, r3, 0 + cmp r1, 0 + beq _0803E2DC + ldrb r2, [r0, 0xC] + lsls r0, r2, 1 + adds r0, r5 + mov r4, r10 + adds r4, 0xC + adds r0, r4 + ldrh r0, [r0] + cmp r1, r0 + bne _0803E268 + ldr r2, =0x020241ea + ldr r0, =0x020241ec + strh r3, [r0] + strh r3, [r2] + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + ldrb r0, [r0, 0xC] + mov r3, r9 + strb r0, [r3] + mov r5, r8 + strb r0, [r5] + ldrh r0, [r2] + movs r1, 0 + bl sub_80458E0 + ldrb r1, [r6] + ldr r3, =0x0202449c + ldr r2, [r3] + b _0803E316 + .pool +_0803E268: + cmp r1, 0 + beq _0803E2DC + cmp r1, r0 + beq _0803E2DC + mov r5, r9 + strb r2, [r5] + mov r0, r8 + strb r2, [r0] + ldr r3, =0x020241ea + ldr r2, =0x020241ec + ldrb r0, [r0] + lsls r0, 1 + ldrb r1, [r6] + movs r5, 0x58 + muls r1, r5 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + strh r0, [r2] + strh r0, [r3] + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + movs r2, 0 + strh r7, [r0, 0x6] + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + strb r2, [r0, 0xC] + ldrb r0, [r6] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + add r1, r12 + ldrb r2, [r1, 0xE] + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0xE] + ldrh r0, [r3] + movs r1, 0 + bl sub_80458E0 + ldrb r1, [r6] + ldr r3, =0x0202449c + ldr r2, [r3] + b _0803E316 + .pool +_0803E2DC: + ldr r3, =0x02024084 + mov r5, r8 + ldrb r0, [r5] + lsls r0, 1 + ldr r4, =0x0202420b + ldrb r2, [r4] + movs r1, 0x58 + muls r1, r2 + adds r0, r1 + adds r3, 0xC + adds r0, r3 + ldr r1, =0x02024274 + lsls r2, 1 + adds r2, r1 + ldrh r3, [r0] + ldrh r2, [r2] + cmp r3, r2 + beq _0803E334 + ldr r1, =0x020241ea + ldr r0, =0x020241ec + strh r3, [r0] + strh r3, [r1] + ldrh r0, [r1] + movs r1, 0 + bl sub_80458E0 + ldrb r1, [r4] + ldr r2, =0x0202449c + ldr r2, [r2] +_0803E316: + adds r1, r2 + strb r0, [r1, 0xC] + b _0803E33C + .pool +_0803E334: + ldr r1, =0x020241ea + ldr r0, =0x020241ec + strh r3, [r0] + strh r3, [r1] +_0803E33C: + ldr r2, =0x02024084 + ldr r1, =0x0202420b + ldrb r3, [r1] + movs r0, 0x58 + muls r0, r3 + adds r0, r2 + ldrh r0, [r0, 0x28] + mov r8, r1 + cmp r0, 0 + beq _0803E384 + adds r0, r3, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803E37C + ldr r0, =0x03005d10 + ldr r1, =0x020241ea + ldrh r1, [r1] + strh r1, [r0, 0x22] + b _0803E384 + .pool +_0803E37C: + ldr r0, =0x03005d10 + ldr r1, =0x020241ea + ldrh r1, [r1] + strh r1, [r0, 0x24] +_0803E384: + mov r1, r8 + ldrb r0, [r1] + bl battle_side_get_owner + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x02024294 + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r5, r0, r1 + ldrb r0, [r5, 0x8] + cmp r0, 0 + beq _0803E400 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x6] + cmp r0, 0 + bne _0803E400 + mov r3, r8 + ldrb r0, [r3] + bl battle_side_get_owner + adds r4, r0, 0 + ldrb r0, [r5, 0x9] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _0803E400 + ldr r1, =0x02024084 + ldrb r2, [r5, 0x9] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _0803E400 + ldr r0, =0x0202420c + strb r2, [r0] + b _0803E76A + .pool +_0803E400: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + ldr r5, =0x0202420b + mov r8, r5 + cmp r0, 0 + bne _0803E412 + b _0803E6E0 +_0803E412: + ldr r1, =0x02024294 + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r5, [r0, 0x8] + cmp r5, 0 + beq _0803E424 + b _0803E630 +_0803E424: + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r2 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _0803E440 + ldrb r0, [r4, 0x6] + cmp r0, 0x10 + bne _0803E440 + b _0803E630 +_0803E440: + ldr r3, =0x02024084 + ldr r2, =0x0202420b + ldrb r6, [r2] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, r6, r0 + ldrb r1, [r0, 0xC] + movs r0, 0x58 + muls r0, r1 + adds r0, r3 + adds r0, 0x20 + ldrb r0, [r0] + mov r8, r2 + cmp r0, 0x1F + bne _0803E460 + b _0803E630 +_0803E460: + ldrb r0, [r4, 0x2] + cmp r0, 0xD + beq _0803E468 + b _0803E630 +_0803E468: + adds r0, r6, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x02024064 + strb r5, [r1] + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + bcs _0803E4E0 + adds r4, r1, 0 +_0803E480: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + beq _0803E4CE + ldr r0, =0x0202420b + ldrb r1, [r0] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r1, r0 + ldrb r0, [r1, 0xC] + ldrb r1, [r4] + cmp r0, r1 + beq _0803E4CE + ldr r1, =0x02024084 + ldrb r2, [r4] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1F + bne _0803E4CE + adds r0, r2, 0 + bl sub_8048728 + lsls r0, 24 + lsrs r0, 24 + ldr r3, [sp] + cmp r0, r3 + bcs _0803E4CE + ldrb r0, [r4] + bl sub_8048728 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] +_0803E4CE: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803E480 +_0803E4E0: + ldr r5, [sp] + cmp r5, 0x4 + beq _0803E4E8 + b _0803E5E2 +_0803E4E8: + ldr r2, =gBattleMoves + ldr r0, =0x020241ec + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x6] + ands r5, r0 + cmp r5, 0 + beq _0803E568 + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803E548 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0803E544 + movs r0, 0x1 + b _0803E55A + .pool +_0803E544: + movs r0, 0x3 + b _0803E55A +_0803E548: + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0803E558 + movs r0, 0 + b _0803E55A +_0803E558: + movs r0, 0x2 +_0803E55A: + bl battle_get_side_with_given_state + ldr r1, =0x0202420c + strb r0, [r1] + b _0803E578 + .pool +_0803E568: + ldr r2, =0x0202420c + ldr r0, =0x0202420b + ldrb r0, [r0] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + ldrb r0, [r0, 0xC] + strb r0, [r2] +_0803E578: + ldr r7, =0x02024210 + ldrb r0, [r7] + ldr r1, =gUnknown_0832A328 + mov r8, r1 + ldr r5, =0x0202420c + ldrb r1, [r5] + lsls r1, 2 + add r1, r8 + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + bne _0803E592 + b _0803E76A +_0803E592: + ldr r6, =0x0202420b + ldrb r0, [r6] + bl battle_side_get_owner + adds r4, r0, 0 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _0803E5C4 + ldrb r0, [r5] + b _0803E758 + .pool +_0803E5C4: + ldrb r0, [r6] + bl battle_get_per_side_status + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + strb r0, [r5] + ldrb r1, [r7] + ldrb r2, [r5] + lsls r0, r2, 2 + add r0, r8 + b _0803E74E +_0803E5E2: + ldr r4, =0x02024064 + ldr r0, =0x0202407e + ldr r3, [sp] + adds r0, r3, r0 + ldrb r0, [r0] + strb r0, [r4] + ldrb r0, [r4] + ldr r2, =0x02024084 + movs r1, 0x58 + muls r1, r0 + adds r1, r2 + adds r1, 0x20 + ldrb r1, [r1] + bl b_history__record_ability_usage_of_player + ldr r2, =0x0202437c + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0] + ldr r1, =0x0202420c + ldrb r0, [r4] + strb r0, [r1] + b _0803E76A + .pool +_0803E630: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r4, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0803E6E0 + ldr r2, =gBattleMoves + ldr r0, =0x020241ec + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x6] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0803E6E0 + mov r5, r8 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803E684 + bl GenerateRandomNumber + adds r1, r4, 0 + ands r1, r0 + cmp r1, 0 + beq _0803E680 + movs r0, 0x1 + b _0803E696 + .pool +_0803E680: + movs r0, 0x3 + b _0803E696 +_0803E684: + bl GenerateRandomNumber + adds r1, r4, 0 + ands r1, r0 + cmp r1, 0 + beq _0803E694 + movs r0, 0 + b _0803E696 +_0803E694: + movs r0, 0x2 +_0803E696: + bl battle_get_side_with_given_state + ldr r1, =0x0202420c + strb r0, [r1] + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldr r5, =0x0202420c + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0803E76A + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + adds r4, r0, 0 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _0803E76A + ldrb r0, [r5] + b _0803E758 + .pool +_0803E6E0: + ldr r5, =0x0202420c + mov r2, r8 + ldrb r0, [r2] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + ldrb r0, [r0, 0xC] + strb r0, [r5] + ldr r6, =0x02024210 + ldrb r1, [r6] + ldr r7, =gUnknown_0832A328 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r7 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0803E76A + ldrb r0, [r2] + bl battle_side_get_owner + adds r4, r0, 0 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _0803E730 + ldrb r0, [r5] + b _0803E758 + .pool +_0803E730: + mov r1, r8 + ldrb r0, [r1] + bl battle_get_per_side_status + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + strb r0, [r5] + ldrb r1, [r6] + ldrb r2, [r5] + lsls r0, r2, 2 + adds r0, r7 +_0803E74E: + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0803E76A + adds r0, r2, 0 +_0803E758: + bl battle_get_per_side_status + movs r1, 0x2 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + strb r0, [r5] +_0803E76A: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 10 + ands r1, r2 + adds r5, r0, 0 + cmp r1, 0 + beq _0803E808 + ldr r0, =0x0202433c + ldr r4, =0x0202420b + ldrb r2, [r4] + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1, 0x2] + lsls r0, 27 + cmp r0, 0 + bge _0803E808 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _0803E7B4 + ldr r1, =0x02024083 + movs r0, 0xC + b _0803E83C + .pool +_0803E7B4: + ldr r3, =0x02024230 + lsls r0, r2, 2 + adds r0, r3 + ldr r0, [r0] + cmp r0, 0 + beq _0803E7EC + ldr r1, =0x02024332 + movs r2, 0 + movs r0, 0x4 + strb r0, [r1, 0x5] + ldr r1, =0x02024214 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + str r0, [r1] + ldrb r0, [r4] + lsls r0, 2 + adds r0, r3 + str r2, [r0] + b _0803E824 + .pool +_0803E7EC: + ldr r1, =0x02024332 + movs r0, 0x4 + strb r0, [r1, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB6AD + str r0, [r1] + b _0803E824 + .pool +_0803E808: + ldr r4, =0x02024214 + ldr r3, =gUnknown_082D86A8 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + str r0, [r4] +_0803E824: + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0803E838 + ldr r0, =0x0202420b + ldrb r0, [r0] + bl sub_81A56E8 +_0803E838: + ldr r1, =0x02024083 + movs r0, 0xA +_0803E83C: + strb r0, [r1] + 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_803E0B8 + + thumb_func_start bs2_8016374 +bs2_8016374: @ 803E868 + push {r4,lr} + ldr r3, =0x0202420b + ldr r1, =0x0202407e + ldr r0, =0x02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r3] + ldr r0, =0x02022e14 + movs r2, 0 + strh r2, [r0] + ldr r0, =0x02022e16 + strh r2, [r0] + ldr r1, =0x020244ac + ldrb r0, [r3] + adds r0, r1 + strb r2, [r0] + ldr r1, =0x020244b0 + ldrb r0, [r3] + adds r0, r1 + strb r2, [r0] + ldr r2, =0x02022f58 + movs r0, 0xFD + strb r0, [r2] + movs r0, 0x7 + strb r0, [r2, 0x1] + ldrb r4, [r3] + strb r4, [r2, 0x2] + ldrb r0, [r3] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + adds r0, 0x58 + ldrb r0, [r0] + strb r0, [r2, 0x3] + movs r0, 0xFF + strb r0, [r2, 0x4] + ldr r0, =0x02024474 + strb r4, [r0, 0x17] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAB15 + str r0, [r1] + ldr r1, =0x02024083 + movs r0, 0xA + strb r0, [r1] + ldr r1, =0x03005d10 + ldrb r0, [r1, 0x2] + cmp r0, 0xFE + bhi _0803E8CE + adds r0, 0x1 + strb r0, [r1, 0x2] +_0803E8CE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bs2_8016374 + + thumb_func_start sub_803E90C +sub_803E90C: @ 803E90C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, =0x0202420b + ldr r2, =0x0202420c + ldr r1, =0x0202407e + ldr r0, =0x02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + strb r0, [r4] + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldrb r0, [r4] + bl sub_8045868 + ldr r5, =0x02024208 + ldr r2, =0x02023864 + ldrb r1, [r4] + lsls r1, 9 + adds r0, r2, 0x1 + adds r0, r1, r0 + ldrb r3, [r0] + adds r2, 0x2 + adds r1, r2 + ldrb r0, [r1] + lsls r0, 8 + orrs r3, r0 + strh r3, [r5] + cmp r3, 0xC + bhi _0803E998 + ldr r2, =0x02024214 + ldr r1, =gUnknown_082DBD08 + ldrh r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + ldr r0, =0x02024083 + mov r10, r0 + b _0803EBF6 + .pool +_0803E998: + adds r0, r3, 0 + subs r0, 0x50 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _0803E9C0 + ldr r0, =0x02024214 + ldr r1, =gUnknown_082DBD54 + ldr r1, [r1] + str r1, [r0] + ldr r1, =0x02024083 + mov r10, r1 + b _0803EBF6 + .pool +_0803E9C0: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803E9E8 + ldr r0, =0x02024214 + ldr r1, =gUnknown_082DBD3C + ldr r1, [r1] + str r1, [r0] + ldr r2, =0x02024083 + mov r10, r2 + b _0803EBF6 + .pool +_0803E9E8: + ldr r3, =0x02024474 + ldrb r0, [r4] + strb r0, [r3, 0x17] + lsls r0, 24 + lsrs r0, 25 + ldr r2, =0x0202449c + ldr r1, [r2] + adds r0, r1 + adds r0, 0xC4 + ldrb r0, [r0] + subs r0, 0x1 + mov r8, r4 + ldr r1, =0x02024214 + mov r9, r1 + ldr r6, =gUnknown_082DBD3C + mov r12, r3 + adds r7, r2, 0 + ldr r2, =0x02024083 + mov r10, r2 + cmp r0, 0x4 + bls _0803EA14 + b _0803EBDE +_0803EA14: + lsls r0, 2 + ldr r1, =_0803EA38 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0803EA38: + .4byte _0803EBDE + .4byte _0803EBDE + .4byte _0803EA4C + .4byte _0803EAE0 + .4byte _0803EBB0 +_0803EA4C: + ldr r5, =0x02024332 + movs r0, 0 + strb r0, [r5, 0x5] + ldr r2, =0x0202420b + ldrb r0, [r2] + lsrs r0, 1 + ldr r1, [r7] + adds r0, r1 + adds r0, 0xC6 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + mov r8, r2 + cmp r0, 0 + beq _0803EA98 + movs r0, 0x3E + ands r0, r1 + ldr r1, =0x02024214 + mov r9, r1 + ldr r6, =gUnknown_082DBD3C + ldr r2, =0x02024083 + mov r10, r2 + cmp r0, 0 + bne _0803EA7E + b _0803EBDE +_0803EA7E: + movs r0, 0x5 + strb r0, [r5, 0x5] + b _0803EBDE + .pool +_0803EA98: + ldr r0, =0x02024214 + mov r9, r0 + ldr r6, =gUnknown_082DBD3C + ldr r1, =0x02024083 + mov r10, r1 + mov r4, r8 + adds r3, r7, 0 + adds r2, r5, 0 +_0803EAA8: + ldrb r1, [r4] + lsrs r1, 1 + ldr r0, [r3] + adds r1, r0 + adds r1, 0xC6 + ldrb r0, [r1] + lsrs r0, 1 + strb r0, [r1] + ldrb r0, [r2, 0x5] + adds r0, 0x1 + strb r0, [r2, 0x5] + ldrb r0, [r4] + lsrs r0, 1 + ldr r1, [r3] + adds r0, r1 + adds r0, 0xC6 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0803EAA8 + b _0803EBDE + .pool +_0803EAE0: + ldr r3, =0x02024332 + movs r0, 0x4 + strb r0, [r3, 0x5] + ldr r2, =0x0202420b + ldrb r0, [r2] + lsrs r0, 1 + ldr r1, [r7] + adds r0, r1 + adds r6, r0, 0 + adds r6, 0xC6 + ldrb r1, [r6] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + mov r8, r2 + cmp r5, 0 + beq _0803EB28 + movs r0, 0x5 + strb r0, [r3, 0x5] + ldr r2, =0x02024214 + mov r9, r2 + ldr r6, =gUnknown_082DBD3C + ldr r0, =0x02024083 + mov r10, r0 + b _0803EBDE + .pool +_0803EB28: + ldr r3, =0x02022f58 + movs r4, 0xFD + strb r4, [r3] + movs r0, 0x5 + strb r0, [r3, 0x1] + movs r2, 0x1 + strb r2, [r3, 0x2] + movs r0, 0xFF + strb r0, [r3, 0x3] + ldr r1, =0x02022f68 + strb r4, [r1] + strb r5, [r1, 0x1] + movs r0, 0xD2 + strb r0, [r1, 0x2] + strb r5, [r1, 0x3] + subs r0, 0xD3 + strb r0, [r1, 0x4] + ldrb r0, [r6] + ands r2, r0 + ldr r1, =0x02024214 + mov r9, r1 + ldr r6, =gUnknown_082DBD3C + ldr r0, =0x02024083 + mov r10, r0 + cmp r2, 0 + bne _0803EB8C + mov r5, r8 + adds r4, r7, 0 + adds r2, r3, 0 +_0803EB62: + ldrb r1, [r5] + lsrs r1, 1 + ldr r0, [r4] + adds r1, r0 + adds r1, 0xC6 + ldrb r0, [r1] + lsrs r0, 1 + strb r0, [r1] + ldrb r0, [r2, 0x2] + adds r0, 0x1 + strb r0, [r2, 0x2] + ldrb r0, [r5] + lsrs r0, 1 + ldr r1, [r4] + adds r0, r1 + adds r0, 0xC6 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0803EB62 +_0803EB8C: + ldrb r0, [r3, 0x2] + adds r0, 0xE + movs r1, 0 + mov r2, r12 + strb r0, [r2, 0x10] + strb r1, [r2, 0x11] + b _0803EBDE + .pool +_0803EBB0: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0803EBCC + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1, 0x5] + b _0803EBD0 + .pool +_0803EBCC: + ldr r0, =0x02024332 + strb r1, [r0, 0x5] +_0803EBD0: + ldr r0, =0x0202420b + mov r8, r0 + ldr r1, =0x02024214 + mov r9, r1 + ldr r6, =gUnknown_082DBD3C + ldr r2, =0x02024083 + mov r10, r2 +_0803EBDE: + mov r1, r8 + ldrb r0, [r1] + lsrs r0, 1 + ldr r1, [r7] + adds r0, r1 + adds r0, 0xC4 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + mov r2, r9 + str r0, [r2] +_0803EBF6: + movs r0, 0xA + mov r1, r10 + strb r0, [r1] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803E90C + + thumb_func_start sub_803EC20 +sub_803EC20: @ 803EC20 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r5, r0, 24 + movs r7, 0 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r5 + adds r1, r0, r1 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _0803EC54 + ldr r1, =0x02024404 + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x7] + b _0803EC5E + .pool +_0803EC54: + ldrh r0, [r1, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r1, r0, 24 +_0803EC5E: + ldr r0, =0x0202420f + strb r5, [r0] + cmp r1, 0x25 + bne _0803EC9C + ldr r2, =0x02024208 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r5 + adds r0, r1 + ldrh r0, [r0, 0x2E] + strh r0, [r2] + ldr r0, =0x0202433c + lsls r2, r5, 4 + adds r2, r0 + ldrb r1, [r2, 0x1] + movs r0, 0x19 + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r2, 0x1] + b _0803ED70 + .pool +_0803EC9C: + ldr r0, =0x02024084 + mov r10, r0 + movs r2, 0x58 + mov r9, r2 + mov r0, r9 + muls r0, r5 + add r0, r10 + mov r8, r0 + adds r0, 0x20 + ldrb r6, [r0] + cmp r6, 0x32 + bne _0803ED5C + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _0803ED38 + ldr r4, =0x0202449c + ldr r1, [r4] + adds r1, 0x6C + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bl sub_81A9E28 + lsls r0, 24 + lsrs r1, r0, 24 + mov r2, r8 + ldrh r0, [r2, 0x6] + muls r0, r1 + movs r2, 0x1 + adds r1, r5, 0 + eors r1, r2 + mov r2, r9 + muls r2, r1 + adds r1, r2, 0 + add r1, r10 + ldrh r1, [r1, 0x6] + bl __divsi3 + ldr r1, [r4] + adds r1, 0x6C + ldrb r2, [r1] + lsls r1, r2, 4 + subs r1, r2 + lsls r1, 1 + adds r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + bl GenerateRandomNumber + movs r1, 0xFF + ands r1, r0 + cmp r4, r1 + bhi _0803ED0C + b _0803EE12 +_0803ED0C: + ldr r0, =0x0202420a + strb r6, [r0] + ldr r0, =0x0202433c + lsls r2, r5, 4 + adds r2, r0 + ldrb r1, [r2, 0x1] + movs r0, 0x19 + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2, 0x1] + b _0803ED70 + .pool +_0803ED38: + ldr r0, =0x0202420a + strb r6, [r0] + ldr r0, =0x0202433c + lsls r2, r5, 4 + adds r2, r0 + ldrb r1, [r2, 0x1] + movs r0, 0x19 + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2, 0x1] + b _0803ED70 + .pool +_0803ED5C: + ldr r1, =0x02022fec + ldr r2, [r1] + ldr r0, =0x043f0100 + ands r0, r2 + cmp r0, 0 + beq _0803ED80 + movs r0, 0x8 + ands r2, r0 + cmp r2, 0 + beq _0803ED80 +_0803ED70: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + b _0803EE12 + .pool +_0803ED80: + ldr r0, [r1] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0803EE06 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _0803EDBC + bl sub_81A9E28 + lsls r0, 24 + lsrs r1, r0, 24 + ldr r4, =0x02024084 + movs r3, 0x58 + adds r0, r5, 0 + muls r0, r3 + adds r0, r4 + ldrh r0, [r0, 0x6] + muls r0, r1 + movs r2, 0x1 + adds r1, r5, 0 + eors r1, r2 + muls r1, r3 + adds r1, r4 + b _0803EDDA + .pool +_0803EDBC: + ldr r3, =0x02024084 + movs r2, 0x58 + adds r0, r5, 0 + muls r0, r2 + adds r4, r0, r3 + movs r1, 0x1 + adds r0, r5, 0 + eors r0, r1 + muls r0, r2 + adds r1, r0, r3 + ldrh r0, [r4, 0x6] + ldrh r2, [r1, 0x6] + cmp r0, r2 + bcs _0803EE00 + lsls r0, 7 +_0803EDDA: + ldrh r1, [r1, 0x6] + bl __divsi3 + ldr r1, =0x0202449c + ldr r1, [r1] + adds r1, 0x6C + ldrb r2, [r1] + lsls r1, r2, 4 + subs r1, r2 + lsls r1, 1 + adds r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + bl GenerateRandomNumber + movs r1, 0xFF + ands r1, r0 + cmp r4, r1 + bls _0803EE06 +_0803EE00: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 +_0803EE06: + ldr r0, =0x0202449c + ldr r1, [r0] + adds r1, 0x6C + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0803EE12: + cmp r7, 0 + beq _0803EE24 + ldr r1, =0x02024082 + ldr r0, =0x0202406c + ldrb r0, [r0] + strb r0, [r1] + ldr r1, =0x0202433a + movs r0, 0x4 + strb r0, [r1] +_0803EE24: + 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_803EC20 + + thumb_func_start sub_803EE48 +sub_803EE48: @ 803EE48 + push {r4-r6,lr} + ldr r4, =0x0202420b + ldr r1, =0x0202407e + ldr r5, =0x02024082 + ldrb r0, [r5] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r4] + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x02000002 + ands r0, r1 + cmp r0, 0 + beq _0803EF0C + ldr r0, =0x0202406c + ldrb r1, [r0] + strb r1, [r5] + ldr r2, =0x02024064 + movs r0, 0 + strb r0, [r2] + lsls r1, 24 + cmp r1, 0 + beq _0803EEE0 + adds r4, r2, 0 + ldr r6, =0x0202421c + ldr r5, =0x0202433a +_0803EE7C: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803EEBC + ldrb r0, [r4] + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0x3 + bne _0803EECE + ldrb r0, [r5] + movs r1, 0x2 + b _0803EECA + .pool +_0803EEBC: + ldrb r0, [r4] + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0x3 + bne _0803EECE + ldrb r0, [r5] + movs r1, 0x1 +_0803EECA: + orrs r0, r1 + strb r0, [r5] +_0803EECE: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0803EE7C +_0803EEE0: + ldr r2, =0x0202433a + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r0, =0x00000ca9 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x8 + orrs r0, r2 + b _0803EF96 + .pool +_0803EF0C: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0803EF4C + ldrb r0, [r4] + bl sub_803EC20 + lsls r0, 24 + cmp r0, 0 + bne _0803EF98 + ldrb r0, [r4] + bl sub_8045868 + ldr r1, =0x02024332 + movs r0, 0x3 + strb r0, [r1, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAB02 + str r0, [r1] + ldr r1, =0x02024083 + movs r0, 0xA + b _0803EF96 + .pool +_0803EF4C: + ldr r1, =0x02024084 + ldrb r2, [r4] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x0400e000 + ands r0, r1 + cmp r0, 0 + beq _0803EF8C + ldr r1, =0x02024332 + movs r0, 0x4 + strb r0, [r1, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAB02 + str r0, [r1] + ldr r1, =0x02024083 + movs r0, 0xA + b _0803EF96 + .pool +_0803EF8C: + ldr r0, =0x0202406c + ldrb r0, [r0] + strb r0, [r5] + ldr r1, =0x0202433a + movs r0, 0x6 +_0803EF96: + strb r0, [r1] +_0803EF98: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803EE48 + + thumb_func_start sub_803EFA8 +sub_803EFA8: @ 803EFA8 + ldr r2, =0x0202420b + ldr r1, =0x0202407e + ldr r0, =0x02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DBD58 + ldr r0, [r0] + str r0, [r1] + ldr r1, =0x02024083 + movs r0, 0xA + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_803EFA8 + + thumb_func_start bs5_8016AC0 +bs5_8016AC0: @ 803EFF0 + ldr r2, =0x0202420b + ldr r1, =0x0202407e + ldr r0, =0x02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r1, =0x0203a04c + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + ldr r1, =0x02024208 + movs r0, 0x5 + strh r0, [r1] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DBD08 + ldr r0, [r0, 0x14] + str r0, [r1] + ldr r1, =0x02024083 + movs r0, 0xA + strb r0, [r1] + bx lr + .pool + thumb_func_end bs5_8016AC0 + + thumb_func_start sub_803F050 +sub_803F050: @ 803F050 + push {r4-r6,lr} + ldr r3, =0x0202420b + ldr r1, =0x0202407e + ldr r0, =0x02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r3] + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r6, =0x02024332 + ldr r2, =0x02023864 + ldrb r0, [r3] + lsls r0, 9 + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + subs r0, 0x1 + strb r0, [r6, 0x5] + ldr r1, =0x02024208 + ldrb r0, [r3] + lsls r0, 9 + adds r2, 0x2 + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1] + ldr r1, =0x03005d10 + ldrb r0, [r1, 0x1F] + cmp r0, 0xFE + bhi _0803F096 + adds r0, 0x1 + strb r0, [r1, 0x1F] +_0803F096: + ldr r2, =0x0202449c + ldr r0, [r2] + adds r1, r0, 0 + adds r1, 0x7A + ldrb r0, [r1] + cmp r0, 0x2 + bhi _0803F0A8 + adds r0, 0x1 + strb r0, [r1] +_0803F0A8: + ldr r0, [r2] + adds r3, r0, 0 + adds r3, 0x7B + ldrb r5, [r3] + adds r4, r5, 0 + cmp r4, 0x1 + bls _0803F100 + ldr r2, =gUnknown_0831BCE0 + adds r0, 0x7A + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + ldrb r6, [r6, 0x5] + adds r0, r6 + adds r0, r2 + ldrb r0, [r0] + cmp r4, r0 + bcs _0803F0FC + movs r0, 0x1 + b _0803F0FE + .pool +_0803F0FC: + subs r0, r5, r0 +_0803F0FE: + strb r0, [r3] +_0803F100: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DBD58 + ldr r0, [r0, 0x8] + str r0, [r1] + ldr r1, =0x02024083 + movs r0, 0xA + strb r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F050 + + thumb_func_start sub_803F120 +sub_803F120: @ 803F120 + push {r4,lr} + ldr r2, =0x0202420b + ldr r1, =0x0202407e + ldr r0, =0x02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r0, =0x02022e14 + movs r4, 0 + strh r4, [r0] + ldr r0, =0x02022e16 + strh r4, [r0] + ldr r3, =0x0202449c + ldr r0, [r3] + adds r2, r0, 0 + adds r2, 0x7C + ldr r1, =gUnknown_0831BCEF + adds r0, 0x79 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + ldrb r1, [r2] + adds r0, r1 + strb r0, [r2] + ldr r0, [r3] + adds r1, r0, 0 + adds r1, 0x7C + ldrb r0, [r1] + cmp r0, 0x14 + bls _0803F162 + movs r0, 0x14 + strb r0, [r1] +_0803F162: + ldr r0, [r3] + adds r2, r0, 0 + adds r2, 0x7B + ldr r1, =gUnknown_0831BCF3 + adds r0, 0x79 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + ldrb r1, [r2] + adds r0, r1 + strb r0, [r2] + ldr r0, [r3] + adds r1, r0, 0 + adds r1, 0x7B + ldrb r0, [r1] + cmp r0, 0x14 + bls _0803F188 + movs r0, 0x14 + strb r0, [r1] +_0803F188: + ldr r0, [r3] + adds r1, r0, 0 + adds r1, 0x79 + ldrb r0, [r1] + cmp r0, 0x2 + bhi _0803F1C4 + adds r0, 0x1 + strb r0, [r1] + ldr r0, =0x02024332 + strb r4, [r0, 0x5] + b _0803F1CA + .pool +_0803F1C4: + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] +_0803F1CA: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DBD58 + ldr r0, [r0, 0x4] + str r0, [r1] + ldr r1, =0x02024083 + movs r0, 0xA + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F120 + + thumb_func_start bs8_exit_by_flight +bs8_exit_by_flight: @ 803F1F0 + push {r4,lr} + ldr r2, =0x0202420b + ldr r1, =0x0202407e + ldr r4, =0x02024082 + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + movs r0, 0x11 + bl audio_play + ldr r0, =0x0202406c + ldrb r0, [r0] + strb r0, [r4] + ldr r1, =0x0202433a + movs r0, 0x4 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bs8_exit_by_flight + + thumb_func_start bs9_8016C9C +bs9_8016C9C: @ 803F22C + ldr r3, =0x0202420b + ldr r1, =0x0202407e + ldr r0, =0x02024082 + ldrb r0, [r0] + adds r0, r1 + ldrb r2, [r0] + strb r2, [r3] + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x7 + strb r0, [r1, 0x1] + strb r2, [r1, 0x2] + ldr r2, =0x0202406e + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DBD58 + ldr r0, [r0, 0xC] + str r0, [r1] + ldr r1, =0x02024083 + movs r0, 0xA + strb r0, [r1] + ldr r1, =0x0202407a + movs r0, 0xC + strb r0, [r1, 0x1] + bx lr + .pool + thumb_func_end bs9_8016C9C + + thumb_func_start bsB_exit_by_move +bsB_exit_by_move: @ 803F2A4 + push {lr} + bl sub_8041728 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0803F2C0 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x4D + strb r1, [r0] + ldr r1, =0x02024083 + movs r0, 0xC + strb r0, [r1] +_0803F2C0: + pop {r0} + bx r0 + .pool + thumb_func_end bsB_exit_by_move + + thumb_func_start bsD_proceed +bsD_proceed: @ 803F2CC + ldr r1, =0x02024082 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r3, =0x02024083 + ldr r2, =0x0202407a + ldrb r0, [r1] + adds r0, r2 + ldrb r0, [r0] + strb r0, [r3] + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xf1e892af + ands r0, r1 + str r0, [r2] + bx lr + .pool + thumb_func_end bsD_proceed + + thumb_func_start bsC_8016D70 +bsC_8016D70: @ 803F300 + push {r4-r6,lr} + ldr r1, =0x0202407e + ldr r2, =0x02024082 + ldrb r0, [r2] + adds r0, r1 + ldrb r0, [r0] + ldr r6, =0x0202449c + ldr r1, [r6] + adds r0, r1 + adds r0, 0x5C + movs r1, 0x6 + strb r1, [r0] + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + ldr r3, =0x02024083 + ldr r1, =0x0202407a + ldrb r0, [r2] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r3] + bl sub_803D6A0 + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xf1e892af + ands r0, r1 + str r0, [r2] + ldr r0, =0x020241ea + movs r1, 0 + strh r1, [r0] + ldr r0, =0x020241f0 + movs r4, 0 + str r4, [r0] + ldr r0, =0x0202427c + strb r1, [r0] + ldr r5, =0x02024474 + strb r1, [r5, 0x18] + strb r1, [r5, 0x19] + ldr r2, =0x02024250 + ldr r3, =0x0202420b + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + strh r4, [r0] + ldr r2, =0x02024258 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + strh r4, [r0] + ldr r0, [r6] + strb r1, [r0, 0x13] + ldr r0, =0x02024400 + strh r4, [r0] + strb r1, [r5, 0x14] + ldr r0, =0x02024332 + strb r1, [r0, 0x3] + strb r1, [r0, 0x4] + strb r1, [r5, 0x16] + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x8] + adds r0, 0x20 + strb r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bsC_8016D70 + + thumb_func_start get_battle_side_of_something +get_battle_side_of_something: @ 803F3CC + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0 + cmp r1, 0xE + bhi _0803F47A + lsls r0, r1, 2 + ldr r1, =_0803F3E8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0803F3E8: + .4byte _0803F424 + .4byte _0803F430 + .4byte _0803F43C + .4byte _0803F458 + .4byte _0803F464 + .4byte _0803F458 + .4byte _0803F464 + .4byte _0803F448 + .4byte _0803F464 + .4byte _0803F464 + .4byte _0803F44C + .4byte _0803F464 + .4byte _0803F468 + .4byte _0803F46C + .4byte _0803F470 +_0803F424: + ldr r0, =0x0202420c + ldrb r0, [r0] + b _0803F47A + .pool +_0803F430: + ldr r0, =0x0202420b + ldrb r0, [r0] + b _0803F47A + .pool +_0803F43C: + ldr r0, =0x0202420e + ldrb r0, [r0] + b _0803F47A + .pool +_0803F448: + movs r0, 0 + b _0803F47A +_0803F44C: + ldr r0, =0x02024474 + ldrb r0, [r0, 0x17] + b _0803F47A + .pool +_0803F458: + ldr r0, =0x0202420d + ldrb r0, [r0] + b _0803F47A + .pool +_0803F464: + movs r0, 0 + b _0803F472 +_0803F468: + movs r0, 0x1 + b _0803F472 +_0803F46C: + movs r0, 0x2 + b _0803F472 +_0803F470: + movs r0, 0x3 +_0803F472: + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 +_0803F47A: + pop {r1} + bx r1 + thumb_func_end get_battle_side_of_something + + thumb_func_start sub_803F480 +sub_803F480: @ 803F480 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 16 + lsrs r2, 16 + ldr r1, =0x02024084 + movs r4, 0x58 + muls r0, r4 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + mov r12, r1 + cmp r0, 0x2E + bne _0803F532 + movs r3, 0 + adds r0, r5, 0 + muls r0, r4 + adds r1, 0xC + adds r1, r0, r1 + b _0803F4BC + .pool +_0803F4B4: + adds r1, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + bgt _0803F4C2 +_0803F4BC: + ldrh r0, [r1] + cmp r0, r2 + bne _0803F4B4 +_0803F4C2: + cmp r3, 0x4 + beq _0803F532 + movs r7, 0x58 + adds r2, r5, 0 + muls r2, r7 + adds r0, r3, r2 + mov r6, r12 + adds r6, 0x24 + adds r1, r0, r6 + ldrb r0, [r1] + cmp r0, 0 + beq _0803F4DE + subs r0, 0x1 + strb r0, [r1] +_0803F4DE: + mov r0, r12 + adds r0, 0x50 + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _0803F532 + ldr r1, =0x020242bc + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gUnknown_0832A328 + lsls r0, r3, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0803F532 + ldr r4, =0x02024064 + strb r5, [r4] + adds r1, r3, 0 + adds r1, 0x9 + lsls r1, 24 + lsrs r1, 24 + ldrb r0, [r4] + muls r0, r7 + adds r0, r6 + adds r0, r3 + str r0, [sp] + movs r0, 0 + movs r2, 0 + movs r3, 0x1 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803F532: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F480 + + thumb_func_start sub_803F548 +sub_803F548: @ 803F548 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x4 + mov r8, r0 + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + bge _0803F5F0 + ldr r1, =0x02024084 + movs r0, 0x58 + adds r7, r5, 0 + muls r7, r0 + adds r1, 0xC + mov r10, r1 +_0803F57E: + lsls r0, r4, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + adds r6, r4, 0x1 + cmp r9, r0 + beq _0803F5E6 + ldr r0, =0x02024084 + movs r3, 0x58 + adds r1, r4, 0 + muls r1, r3 + adds r1, r0 + adds r1, 0x20 + ldrb r1, [r1] + adds r4, r0, 0 + cmp r1, 0x2E + bne _0803F5E6 + movs r2, 0 + adds r0, r5, 0 + muls r0, r3 + adds r1, r4, 0 + adds r1, 0xC + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x8F + lsls r1, 1 + cmp r0, r1 + beq _0803F5CE + adds r3, r1, 0 + mov r0, r10 + adds r1, r7, r0 +_0803F5C0: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x3 + bgt _0803F5CE + ldrh r0, [r1] + cmp r0, r3 + bne _0803F5C0 +_0803F5CE: + cmp r2, 0x4 + beq _0803F5E6 + mov r8, r2 + adds r1, r2, r7 + adds r0, r4, 0 + adds r0, 0x24 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _0803F5E6 + subs r0, 0x1 + strb r0, [r1] +_0803F5E6: + adds r4, r6, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _0803F57E +_0803F5F0: + mov r1, r8 + cmp r1, 0x4 + beq _0803F658 + ldr r6, =0x02024084 + movs r3, 0x58 + adds r0, r5, 0 + muls r0, r3 + adds r1, r6, 0 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _0803F658 + ldr r1, =0x020242bc + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gUnknown_0832A328 + mov r4, r8 + lsls r0, r4, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0803F658 + ldr r4, =0x02024064 + strb r5, [r4] + mov r1, r8 + adds r1, 0x9 + lsls r1, 24 + lsrs r1, 24 + ldrb r0, [r4] + muls r0, r3 + adds r2, r6, 0 + adds r2, 0x24 + adds r0, r2 + add r0, r8 + str r0, [sp] + movs r0, 0 + movs r2, 0 + movs r3, 0x1 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803F658: + 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_803F548 + + thumb_func_start sub_803F67C +sub_803F67C: @ 803F67C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r3, r0, 24 + movs r6, 0x4 + movs r1, 0 + ldr r0, =0x0202406c + mov r8, r0 + ldrb r0, [r0] + cmp r1, r0 + bge _0803F6FE + ldr r7, =0x02024084 + movs r2, 0x58 + mov r12, r2 + mov r5, r12 + muls r5, r3 + adds r0, r7, 0 + adds r0, 0xC + adds r2, r5, r0 + mov r10, r2 + mov r9, r5 +_0803F6AE: + mov r0, r12 + muls r0, r1 + adds r0, r7 + adds r0, 0x20 + ldrb r0, [r0] + adds r4, r1, 0x1 + cmp r0, 0x2E + bne _0803F6F4 + cmp r1, r3 + beq _0803F6F4 + movs r2, 0 + mov r1, r10 + ldrh r0, [r1] + cmp r0, 0xC3 + beq _0803F6DE + ldr r1, =0x02024090 + add r1, r9 +_0803F6D0: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x3 + bgt _0803F6DE + ldrh r0, [r1] + cmp r0, 0xC3 + bne _0803F6D0 +_0803F6DE: + cmp r2, 0x4 + beq _0803F6F4 + adds r6, r2, 0 + adds r0, r6, r5 + ldr r2, =0x020240a8 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _0803F6F4 + subs r0, 0x1 + strb r0, [r1] +_0803F6F4: + adds r1, r4, 0 + mov r0, r8 + ldrb r0, [r0] + cmp r1, r0 + blt _0803F6AE +_0803F6FE: + cmp r6, 0x4 + beq _0803F762 + ldr r7, =0x02024084 + movs r5, 0x58 + adds r0, r3, 0 + muls r0, r5 + adds r1, r7, 0 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _0803F762 + ldr r1, =0x020242bc + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gUnknown_0832A328 + lsls r0, r6, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0803F762 + ldr r4, =0x02024064 + strb r3, [r4] + adds r1, r6, 0 + adds r1, 0x9 + lsls r1, 24 + lsrs r1, 24 + ldrb r0, [r4] + muls r0, r5 + adds r2, r7, 0 + adds r2, 0x24 + adds r0, r2 + adds r0, r6 + str r0, [sp] + movs r0, 0 + movs r2, 0 + movs r3, 0x1 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0803F762: + 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_803F67C + + thumb_func_start sub_803F790 +sub_803F790: @ 803F790 + push {r4,r5,lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0803F7D0 + movs r2, 0 + ldr r4, =0x0202406c + ldrb r0, [r4] + cmp r2, r0 + bge _0803F7EE + ldr r3, =0x02024068 + ldr r5, =gUnknown_0832A328 +_0803F7AC: + ldm r5!, {r1} + lsls r1, 28 + ldr r0, [r3] + orrs r0, r1 + str r0, [r3] + adds r2, 0x1 + ldrb r0, [r4] + cmp r2, r0 + blt _0803F7AC + b _0803F7EE + .pool +_0803F7D0: + movs r2, 0 + ldr r4, =0x0202406c + ldrb r0, [r4] + cmp r2, r0 + bge _0803F7EE + ldr r3, =0x02024068 + ldr r5, =gUnknown_0832A328 +_0803F7DE: + ldr r0, [r3] + ldm r5!, {r1} + orrs r0, r1 + str r0, [r3] + adds r2, 0x1 + ldrb r0, [r4] + cmp r2, r0 + blt _0803F7DE +_0803F7EE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F790 + + thumb_func_start dp01_battle_side_mark_buffer_for_execution +dp01_battle_side_mark_buffer_for_execution: @ 803F800 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0803F834 + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + b _0803F844 + .pool +_0803F834: + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + orrs r1, r0 + str r1, [r2] +_0803F844: + pop {r0} + bx r0 + .pool + thumb_func_end dp01_battle_side_mark_buffer_for_execution + + thumb_func_start sub_803F850 +sub_803F850: @ 803F850 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + movs r4, 0 + ldr r5, =0x02024068 + ldr r1, =gUnknown_0832A328 + lsls r0, r7, 2 + adds r6, r0, r1 + b _0803F87A + .pool +_0803F86C: + lsls r0, r4, 2 + ldr r1, [r6] + lsls r1, r0 + ldr r0, [r5] + orrs r0, r1 + str r0, [r5] + adds r4, 0x1 +_0803F87A: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + blt _0803F86C + ldr r2, =0x02024068 + movs r1, 0x80 + lsls r1, 21 + lsls r1, r7 + ldr r0, [r2] + bics r0, r1 + str r0, [r2] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F850 + + thumb_func_start b_cancel_multi_turn_move_maybe +b_cancel_multi_turn_move_maybe: @ 803F8A0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02024084 + movs r2, 0x58 + adds r3, r0, 0 + muls r3, r2 + adds r1, 0x50 + adds r3, r1 + ldr r1, [r3] + ldr r2, =0xffffefff + ands r1, r2 + ldr r2, =0xfffff3ff + ands r1, r2 + movs r2, 0x71 + negs r2, r2 + ands r1, r2 + ldr r2, =0xfffffcff + ands r1, r2 + str r1, [r3] + ldr r1, =0x020242ac + lsls r2, r0, 2 + adds r2, r1 + ldr r1, [r2] + ldr r3, =0xfffbff3f + ands r1, r3 + str r1, [r2] + ldr r2, =0x020242bc + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x11] + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x11] + movs r0, 0 + strb r0, [r1, 0x10] + bx lr + .pool + thumb_func_end b_cancel_multi_turn_move_maybe + + thumb_func_start sub_803F90C +sub_803F90C: @ 803F90C + push {lr} + lsls r0, 24 + ldr r1, =0x0202433c + lsrs r0, 20 + adds r1, r0, r1 + ldrb r0, [r1] + lsrs r0, 7 + cmp r0, 0 + bne _0803F952 + ldrb r2, [r1, 0x1] + lsls r0, r2, 30 + cmp r0, 0 + blt _0803F952 + lsls r0, r2, 26 + cmp r0, 0 + blt _0803F952 + lsls r0, r2, 25 + cmp r0, 0 + blt _0803F952 + lsrs r0, r2, 7 + cmp r0, 0 + bne _0803F952 + ldrb r1, [r1, 0x2] + lsls r0, r1, 31 + cmp r0, 0 + bne _0803F952 + lsls r0, r1, 30 + cmp r0, 0 + blt _0803F952 + lsls r0, r1, 29 + cmp r0, 0 + blt _0803F952 + lsls r0, r2, 31 + cmp r0, 0 + beq _0803F95C +_0803F952: + movs r0, 0x1 + b _0803F95E + .pool +_0803F95C: + movs r0, 0 +_0803F95E: + pop {r1} + bx r1 + thumb_func_end sub_803F90C + + thumb_func_start b_std_message +b_std_message: @ 803F964 + push {r4,lr} + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + ldr r4, =0x02024064 + strb r1, [r4] + movs r0, 0 + adds r1, r2, 0 + bl dp01_build_cmdbuf_x10_TODO + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end b_std_message + + thumb_func_start sub_803F988 +sub_803F988: @ 803F988 + push {r4-r6,lr} + movs r3, 0 + ldr r0, =0x020243fe + strb r3, [r0] + strb r3, [r0, 0x1] + movs r1, 0 + ldr r0, =0x0202406c + ldrb r2, [r0] + adds r6, r0, 0 + cmp r1, r2 + bge _0803F9B6 + ldr r5, =gUnknown_0832A328 + adds r4, r2, 0 + ldr r2, =0x0202406e +_0803F9A4: + ldrh r0, [r2] + lsls r0, 2 + adds r0, r5 + ldr r0, [r0] + orrs r3, r0 + adds r2, 0x4 + adds r1, 0x2 + cmp r1, r4 + blt _0803F9A4 +_0803F9B6: + movs r1, 0x1 + adds r2, r6, 0 + ldrb r0, [r2] + cmp r1, r0 + bge _0803F9D6 + ldr r5, =0x020243fe + movs r4, 0x2 +_0803F9C4: + adds r0, r1, 0 + ands r0, r4 + asrs r0, 1 + adds r0, r5 + strb r3, [r0] + adds r1, 0x2 + ldrb r0, [r2] + cmp r1, r0 + blt _0803F9C4 +_0803F9D6: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F988 + + thumb_func_start sub_803F9EC +sub_803F9EC: @ 803F9EC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803FA50 + movs r0, 0x2 + ands r0, r5 + lsls r0, 24 + lsrs r0, 25 + mov r12, r0 + ldr r1, =0x020243fe + adds r0, r1 + strb r4, [r0] + adds r5, r4, 0 + ldr r0, =0x0202406c + ldrb r2, [r0] + mov r8, r1 + cmp r4, r2 + bge _0803FA4A + ldr r0, =0x02024210 + ldrb r7, [r0] + ldr r1, =gUnknown_0832A328 + adds r6, r2, 0 + ldr r3, =0x0202406e + adds r2, r1, 0 +_0803FA2E: + ldr r0, [r2] + ands r0, r7 + cmp r0, 0 + bne _0803FA40 + ldrh r0, [r3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + orrs r4, r0 +_0803FA40: + adds r3, 0x4 + adds r2, 0x8 + adds r5, 0x2 + cmp r5, r6 + blt _0803FA2E +_0803FA4A: + mov r0, r12 + add r0, r8 + strb r4, [r0] +_0803FA50: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803F9EC + + thumb_func_start sub_803FA70 +sub_803FA70: @ 803FA70 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0803FA8C + adds r0, r4, 0 + bl sub_803F9EC + b _0803FAC2 +_0803FA8C: + movs r3, 0x1 + ldr r5, =0x0202406c + ldrb r0, [r5] + cmp r3, r0 + bge _0803FAC2 + ldr r0, =0x020243fe + mov r12, r0 + movs r7, 0x2 + ldr r6, =gUnknown_0832A328 + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r4, r0, r1 +_0803FAA4: + adds r2, r3, 0 + ands r2, r7 + asrs r2, 1 + add r2, r12 + ldrh r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + adds r3, 0x1 + ldrb r0, [r5] + cmp r3, r0 + blt _0803FAA4 +_0803FAC2: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_803FA70 + + thumb_func_start b_movescr_stack_push +b_movescr_stack_push: @ 803FAD8 + push {r4,lr} + ldr r1, =0x020244a8 + ldr r1, [r1] + ldr r3, [r1, 0x8] + adds r4, r3, 0 + adds r4, 0x20 + ldrb r1, [r4] + adds r2, r1, 0x1 + strb r2, [r4] + lsls r1, 24 + lsrs r1, 22 + adds r3, r1 + str r0, [r3] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end b_movescr_stack_push + + thumb_func_start b_movescr_stack_push_cursor +b_movescr_stack_push_cursor: @ 803FAFC + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r2, [r0, 0x8] + adds r3, r2, 0 + adds r3, 0x20 + ldrb r0, [r3] + adds r1, r0, 0x1 + strb r1, [r3] + lsls r0, 24 + lsrs r0, 22 + adds r2, r0 + ldr r0, =0x02024214 + ldr r0, [r0] + str r0, [r2] + bx lr + .pool + thumb_func_end b_movescr_stack_push_cursor + + thumb_func_start b_movescr_stack_pop_cursor +b_movescr_stack_pop_cursor: @ 803FB24 + ldr r3, =0x02024214 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x8] + adds r2, r1, 0 + adds r2, 0x20 + ldrb r0, [r2] + subs r0, 0x1 + strb r0, [r2] + lsls r0, 24 + lsrs r0, 22 + adds r1, r0 + ldr r0, [r1] + str r0, [r3] + bx lr + .pool + thumb_func_end b_movescr_stack_pop_cursor + + thumb_func_start sub_803FB4C +sub_803FB4C: @ 803FB4C + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r6, 0 + ldr r2, =0x02024084 + ldr r1, =0x02023864 + ldr r3, =0x02024064 + ldrb r4, [r3] + lsls r0, r4, 9 + adds r1, 0x2 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 1 + movs r1, 0x58 + muls r1, r4 + adds r0, r1 + adds r2, 0xC + adds r0, r2 + ldrh r5, [r0] + ldr r1, =0x0202449c + lsls r0, r4, 1 + adds r0, 0xC8 + ldr r1, [r1] + adds r1, r0 + mov r8, r1 + ldr r1, =0x020242bc + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x4] + adds r7, r3, 0 + adds r3, r1, 0 + cmp r0, r5 + bne _0803FC06 + cmp r5, 0 + beq _0803FC06 + ldr r0, =0x02024474 + strb r4, [r0, 0x17] + ldr r0, =0x020241ea + strh r5, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0803FBF8 + ldr r1, =0x02024230 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, =gUnknown_082DAE2A + str r1, [r0] + ldr r0, =0x0202433c + ldrb r1, [r7] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1, 0x2] + movs r2, 0x10 + orrs r0, r2 + strb r0, [r1, 0x2] + b _0803FC06 + .pool +_0803FBF8: + ldr r0, =0x02024220 + ldrb r1, [r7] + lsls r1, 2 + adds r1, r0 + ldr r0, =gUnknown_082DAE1F + str r0, [r1] + movs r6, 0x1 +_0803FC06: + ldr r1, =0x02024248 + ldrb r2, [r7] + lsls r0, r2, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r5, r0 + bne _0803FC90 + cmp r5, 0xA5 + beq _0803FC90 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + bge _0803FC90 + adds r0, r2, 0 + bl b_cancel_multi_turn_move_maybe + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0803FC7C + ldr r1, =0x02024230 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB098 + str r1, [r0] + ldr r0, =0x0202433c + ldrb r1, [r7] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1, 0x2] + movs r2, 0x10 + orrs r0, r2 + strb r0, [r1, 0x2] + b _0803FC8E + .pool +_0803FC7C: + ldr r1, =0x02024220 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB089 + str r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0803FC8E: + ldr r3, =0x020242bc +_0803FC90: + ldrb r0, [r7] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r0, [r1, 0x13] + lsls r0, 28 + cmp r0, 0 + beq _0803FD1A + ldr r0, =gBattleMoves + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _0803FD1A + ldr r0, =0x020241ea + strh r5, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0803FD08 + ldr r1, =0x02024230 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB0AF + str r1, [r0] + ldr r0, =0x0202433c + ldrb r1, [r7] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1, 0x2] + movs r2, 0x10 + orrs r0, r2 + strb r0, [r1, 0x2] + b _0803FD1A + .pool +_0803FD08: + ldr r1, =0x02024220 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB0A0 + str r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0803FD1A: + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r1, r5, 0 + bl sub_8040130 + lsls r0, 24 + cmp r0, 0 + beq _0803FD8E + ldr r0, =0x020241ea + strh r5, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0803FD7C + ldr r1, =0x02024230 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB185 + str r1, [r0] + ldr r0, =0x0202433c + ldrb r1, [r4] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1, 0x2] + movs r2, 0x10 + orrs r0, r2 + strb r0, [r1, 0x2] + b _0803FD8E + .pool +_0803FD7C: + ldr r1, =0x02024220 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB181 + str r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0803FD8E: + ldr r1, =0x02024084 + ldr r0, =0x02024064 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _0803FDC4 + ldr r1, =0x02024404 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r4, [r0, 0x7] + b _0803FDCE + .pool +_0803FDC4: + ldrh r0, [r1, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r4, r0, 24 +_0803FDCE: + ldr r2, =0x0202420f + ldr r1, =0x02024064 + ldrb r0, [r1] + strb r0, [r2] + ldr r0, =0x02024084 + mov r12, r0 + adds r7, r1, 0 + cmp r4, 0x1D + bne _0803FE58 + mov r0, r8 + ldrh r1, [r0] + adds r2, r1, 0 + cmp r2, 0 + beq _0803FE58 + ldr r0, =0x0000ffff + cmp r2, r0 + beq _0803FE58 + cmp r2, r5 + beq _0803FE58 + ldr r0, =0x020241ea + strh r1, [r0] + ldr r2, =0x02024208 + ldrb r1, [r7] + movs r0, 0x58 + muls r0, r1 + add r0, r12 + ldrh r0, [r0, 0x2E] + strh r0, [r2] + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 10 + ands r1, r0 + ldrb r2, [r7] + cmp r1, 0 + beq _0803FE48 + ldr r0, =0x0202433c + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1, 0x2] + movs r2, 0x10 + orrs r0, r2 + strb r0, [r1, 0x2] + b _0803FE58 + .pool +_0803FE48: + ldr r1, =0x02024220 + lsls r0, r2, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB812 + str r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0803FE58: + ldr r0, =0x02023864 + ldrb r3, [r7] + lsls r1, r3, 9 + adds r0, 0x2 + adds r1, r0 + movs r0, 0x58 + muls r0, r3 + ldrb r1, [r1] + adds r0, r1 + mov r1, r12 + adds r1, 0x24 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0803FEB8 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0803FEA8 + ldr r0, =0x0202433c + lsls r1, r3, 4 + adds r1, r0 + ldrb r0, [r1, 0x2] + movs r2, 0x10 + orrs r0, r2 + strb r0, [r1, 0x2] + b _0803FEB8 + .pool +_0803FEA8: + ldr r1, =0x02024220 + lsls r0, r3, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB076 + str r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0803FEB8: + adds r0, r6, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_803FB4C + + thumb_func_start sub_803FECC +sub_803FECC: @ 803FECC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + lsls r2, 24 + lsrs r3, r2, 24 + ldr r1, =0x0202449c + lsls r0, r7, 1 + adds r0, 0xC8 + ldr r1, [r1] + adds r1, r0 + str r1, [sp, 0x4] + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r7 + adds r1, r0, r1 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _0803FF1C + ldr r2, =0x02024404 + lsls r1, r7, 3 + subs r0, r1, r7 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x7] + str r0, [sp] + b _0803FF2E + .pool +_0803FF1C: + ldrh r0, [r1, 0x2E] + str r3, [sp, 0x14] + bl itemid_get_x12 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r1, r7, 3 + ldr r3, [sp, 0x14] +_0803FF2E: + ldr r0, =0x0202420f + strb r7, [r0] + movs r0, 0 + mov r9, r0 + lsls r2, r7, 1 + str r2, [sp, 0xC] + ldr r5, =0x020242bc + mov r12, r5 + ldr r0, =0x02024084 + movs r2, 0x58 + adds r6, r7, 0 + muls r6, r2 + str r6, [sp, 0x8] + ldr r2, =0x02024090 + adds r5, r6, r2 + movs r6, 0 + str r6, [sp, 0x10] + mov r10, r0 + subs r0, r1, r7 + lsls r0, 2 + mov r8, r0 + ldr r6, =gUnknown_0832A328 +_0803FF5A: + ldrh r0, [r5] + cmp r0, 0 + bne _0803FF70 + movs r0, 0x1 + ands r0, r3 + cmp r0, 0 + beq _0803FF70 + ldr r0, [r6] + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_0803FF70: + ldr r0, [sp, 0x8] + add r0, r9 + mov r1, r10 + adds r1, 0x24 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0803FF90 + movs r0, 0x2 + ands r0, r3 + cmp r0, 0 + beq _0803FF90 + ldr r0, [r6] + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_0803FF90: + mov r1, r8 + add r1, r12 + ldrh r0, [r5] + ldrh r1, [r1, 0x4] + cmp r0, r1 + bne _0803FFAC + movs r0, 0x4 + ands r0, r3 + cmp r0, 0 + beq _0803FFAC + ldr r0, [r6] + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_0803FFAC: + movs r0, 0x58 + adds r2, r7, 0 + muls r2, r0 + ldr r1, [sp, 0x10] + adds r0, r1, r2 + ldr r1, =0x02024090 + adds r0, r1 + mov r12, r0 + ldr r1, =0x02024248 + ldr r0, [sp, 0xC] + adds r1, r0, r1 + str r1, [sp, 0x18] + mov r1, r12 + ldrh r1, [r1] + mov r12, r1 + ldr r0, [sp, 0x18] + ldrh r0, [r0] + cmp r12, r0 + bne _0803FFEE + movs r0, 0x8 + ands r0, r3 + cmp r0, 0 + beq _0803FFEE + mov r0, r10 + adds r0, 0x50 + adds r0, r2, r0 + ldr r0, [r0] + cmp r0, 0 + bge _0803FFEE + ldr r0, [r6] + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_0803FFEE: + ldr r0, =0x020242bc + add r0, r8 + ldrb r0, [r0, 0x13] + lsls r0, 28 + cmp r0, 0 + beq _0804001C + movs r0, 0x10 + ands r0, r3 + cmp r0, 0 + beq _0804001C + ldr r2, =gBattleMoves + ldrh r1, [r5] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _0804001C + ldr r0, [r6] + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_0804001C: + ldrh r1, [r5] + adds r0, r7, 0 + str r3, [sp, 0x14] + bl sub_8040130 + lsls r0, 24 + ldr r3, [sp, 0x14] + cmp r0, 0 + beq _0804003E + movs r0, 0x20 + ands r0, r3 + cmp r0, 0 + beq _0804003E + ldr r0, [r6] + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_0804003E: + ldr r1, =0x020242bc + mov r0, r8 + adds r2, r0, r1 + ldrb r0, [r2, 0xE] + lsls r0, 28 + mov r12, r1 + cmp r0, 0 + beq _0804005E + ldrh r0, [r2, 0x6] + ldrh r1, [r5] + cmp r0, r1 + beq _0804005E + ldr r0, [r6] + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_0804005E: + ldr r2, [sp] + cmp r2, 0x1D + bne _08040080 + ldr r0, [sp, 0x4] + ldrh r1, [r0] + cmp r1, 0 + beq _08040080 + ldr r0, =0x0000ffff + cmp r1, r0 + beq _08040080 + ldrh r2, [r5] + cmp r1, r2 + beq _08040080 + ldr r0, [r6] + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_08040080: + adds r6, 0x4 + adds r5, 0x2 + ldr r0, [sp, 0x10] + adds r0, 0x2 + str r0, [sp, 0x10] + movs r1, 0x1 + add r9, r1 + mov r2, r9 + cmp r2, 0x3 + bgt _08040096 + b _0803FF5A +_08040096: + adds r0, r4, 0 + 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_803FECC + + thumb_func_start sub_80400C8 +sub_80400C8: @ 80400C8 + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + movs r1, 0 + movs r2, 0xFF + bl sub_803FECC + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xF + bne _0804010C + ldr r0, =0x0202433c + ldrb r1, [r4] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldr r1, =0x02024220 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =gUnknown_082DB072 + str r1, [r0] + b _0804011E + .pool +_0804010C: + ldr r0, =0x0202433c + ldrb r1, [r4] + lsls r1, 4 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] +_0804011E: + movs r0, 0 + cmp r3, 0xF + bne _08040126 + movs r0, 0x1 +_08040126: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80400C8 + + thumb_func_start sub_8040130 +sub_8040130: @ 8040130 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r5, r1, 16 + movs r6, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r6, r0 + bge _080401B4 + ldr r7, =0x02024090 + mov r8, r7 +_0804015A: + lsls r0, r4, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + adds r3, r4, 0x1 + cmp r9, r0 + beq _080401AA + ldr r1, =0x020242ac + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 6 + ands r0, r1 + cmp r0, 0 + beq _080401AA + movs r2, 0 + movs r0, 0x58 + adds r1, r4, 0 + muls r1, r0 + adds r0, r1, r7 + ldrh r0, [r0] + cmp r5, r0 + beq _080401A0 + mov r4, r8 + adds r0, r1, r4 +_08040192: + adds r0, 0x2 + adds r2, 0x1 + cmp r2, 0x3 + bgt _080401AA + ldrh r1, [r0] + cmp r5, r1 + bne _08040192 +_080401A0: + cmp r2, 0x3 + bgt _080401AA + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_080401AA: + adds r4, r3, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _0804015A +_080401B4: + adds r0, r6, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8040130 + + thumb_func_start sub_80401D0 +sub_80401D0: @ 80401D0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r0, 0 + mov r9, r0 + ldr r1, =0x0202420b + mov r2, r9 + strb r2, [r1] + ldr r0, =0x0202406c + ldrb r4, [r0] + adds r6, r1, 0 + mov r10, r0 + ldr r7, =0x0202420c + ldr r3, =0x0202449c + mov r12, r3 + cmp r9, r4 + bcs _08040224 + ldr r2, =0x02024210 + ldrb r1, [r2] + ldr r5, =gUnknown_0832A328 + ldr r0, [r5] + ands r1, r0 + cmp r1, 0 + beq _08040224 + adds r3, r6, 0 +_08040206: + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + lsls r0, 24 + lsrs r0, 24 + cmp r0, r4 + bcs _08040224 + ldrb r0, [r2] + ldrb r1, [r6] + lsls r1, 2 + adds r1, r5 + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + bne _08040206 +_08040224: + movs r0, 0 + strb r0, [r7] + mov r0, r10 + ldrb r4, [r0] + cmp r4, 0 + beq _0804025E + ldr r2, =0x02024210 + ldrb r1, [r2] + ldr r5, =gUnknown_0832A328 + ldr r0, [r5] + ands r1, r0 + cmp r1, 0 + beq _0804025E + adds r3, r7, 0 +_08040240: + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + lsls r0, 24 + lsrs r0, 24 + cmp r0, r4 + bcs _0804025E + ldrb r0, [r2] + ldrb r1, [r7] + lsls r1, 2 + adds r1, r5 + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + bne _08040240 +_0804025E: + mov r1, r12 + ldr r0, [r1] + ldrb r0, [r0, 0x3] + cmp r0, 0xA + bls _0804026A + b _080408F6 +_0804026A: + lsls r0, 2 + ldr r1, =_08040290 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08040290: + .4byte _080402BC + .4byte _08040342 + .4byte _08040408 + .4byte _080404D4 + .4byte _080405B0 + .4byte _08040668 + .4byte _0804071C + .4byte _080407A0 + .4byte _08040810 + .4byte _08040868 + .4byte _080408EC +_080402BC: + movs r5, 0 + ldr r1, =0x0202406c + mov r10, r1 + ldrb r2, [r1] + cmp r5, r2 + bge _080402D6 + ldr r2, =0x0202407e +_080402CA: + adds r0, r5, r2 + strb r5, [r0] + adds r5, 0x1 + ldrb r3, [r1] + cmp r5, r3 + blt _080402CA +_080402D6: + movs r5, 0 + b _08040324 + .pool +_080402E4: + adds r4, r5, 0x1 + adds r6, r4, 0 + ldrb r1, [r1] + cmp r6, r1 + bge _08040322 + ldr r7, =0x0202407e + ldr r0, =0x0202406c + mov r10, r0 + lsls r1, r5, 24 + mov r8, r1 +_080402F8: + adds r0, r5, r7 + ldrb r0, [r0] + adds r1, r4, r7 + ldrb r1, [r1] + movs r2, 0 + bl b_first_side + lsls r0, 24 + cmp r0, 0 + beq _08040318 + lsls r1, r4, 24 + lsrs r1, 24 + mov r2, r8 + lsrs r0, r2, 24 + bl sub_803CEDC +_08040318: + adds r4, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _080402F8 +_08040322: + adds r5, r6, 0 +_08040324: + mov r1, r10 + ldrb r0, [r1] + subs r0, 0x1 + cmp r5, r0 + blt _080402E4 + ldr r2, =0x0202449c + ldr r1, [r2] + ldrb r0, [r1, 0x3] + adds r0, 0x1 + strb r0, [r1, 0x3] + ldr r0, [r2] + adds r0, 0xDB + movs r1, 0 + strb r1, [r0] + mov r12, r2 +_08040342: + mov r1, r12 + ldr r0, [r1] + adds r0, 0xDB + ldrb r0, [r0] + cmp r0, 0x1 + bls _08040350 + b _0804062C +_08040350: + ldr r3, =0x02024064 + mov r8, r3 + movs r7, 0 + ldr r6, =0x0202420b + ldr r5, =0x02022f58 +_0804035A: + ldr r0, [r1] + adds r0, 0xDB + ldrb r4, [r0] + ldr r2, =0x02024294 + lsls r1, r4, 1 + adds r0, r1, r4 + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2, 0x1] + strb r0, [r6] + mov r3, r8 + strb r0, [r3] + ldr r0, =0x0202428e + adds r3, r1, r0 + ldrh r1, [r3] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080403BC + ldrb r0, [r2] + subs r0, 0x1 + strb r0, [r2] + movs r4, 0xFF + lsls r0, 24 + cmp r0, 0 + bne _080403BC + ldrh r0, [r3] + ldr r2, =0x0000fffe + adds r1, r2, 0 + ands r0, r1 + strh r0, [r3] + ldr r0, =gUnknown_082DACFA + bl b_call_bc_move_exec + movs r0, 0xFD + strb r0, [r5] + movs r0, 0x2 + strb r0, [r5, 0x1] + movs r0, 0x73 + strb r0, [r5, 0x2] + strb r7, [r5, 0x3] + ldrb r0, [r5, 0x4] + orrs r0, r4 + strb r0, [r5, 0x4] + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080403BC: + ldr r2, =0x0202449c + ldr r1, [r2] + adds r1, 0xDB + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r12, r2 + mov r3, r9 + cmp r3, 0 + beq _080403D2 + b _080408FE +_080403D2: + mov r1, r12 + ldr r0, [r1] + adds r0, 0xDB + ldrb r0, [r0] + cmp r0, 0x1 + bls _0804035A + b _0804062C + .pool +_08040408: + mov r1, r12 + ldr r0, [r1] + adds r0, 0xDB + ldrb r0, [r0] + cmp r0, 0x1 + bls _08040416 + b _08040570 +_08040416: + movs r0, 0x2 + mov r10, r0 + movs r2, 0 + mov r8, r2 + ldr r7, =0x0202420b + ldr r5, =0x02022f58 +_08040422: + ldr r0, [r1] + adds r0, 0xDB + ldrb r4, [r0] + ldr r2, =0x02024294 + lsls r1, r4, 1 + adds r0, r1, r4 + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2, 0x3] + strb r0, [r7] + ldr r3, =0x02024064 + strb r0, [r3] + ldr r0, =0x0202428e + adds r3, r1, r0 + ldrh r1, [r3] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0804048A + ldrb r0, [r2, 0x2] + subs r0, 0x1 + strb r0, [r2, 0x2] + movs r6, 0xFF + lsls r0, 24 + cmp r0, 0 + bne _0804048A + ldrh r0, [r3] + ldr r2, =0x0000fffd + adds r1, r2, 0 + ands r0, r1 + strh r0, [r3] + ldr r0, =gUnknown_082DACFA + bl b_call_bc_move_exec + ldr r0, =0x02024332 + strb r4, [r0, 0x5] + movs r0, 0xFD + strb r0, [r5] + mov r3, r10 + strb r3, [r5, 0x1] + movs r0, 0x71 + strb r0, [r5, 0x2] + mov r0, r8 + strb r0, [r5, 0x3] + ldrb r0, [r5, 0x4] + orrs r0, r6 + strb r0, [r5, 0x4] + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_0804048A: + ldr r2, =0x0202449c + ldr r1, [r2] + adds r1, 0xDB + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r12, r2 + mov r1, r9 + cmp r1, 0 + beq _080404A0 + b _080408FE +_080404A0: + mov r1, r12 + ldr r0, [r1] + adds r0, 0xDB + ldrb r0, [r0] + cmp r0, 0x1 + bls _08040422 + b _08040570 + .pool +_080404D4: + mov r1, r12 + ldr r0, [r1] + adds r0, 0xDB + ldrb r0, [r0] + cmp r0, 0x1 + bhi _08040570 + ldr r0, =0x02024064 + mov r10, r0 + movs r2, 0 + mov r8, r2 + ldr r7, =0x0202420b + ldr r5, =0x02022f58 +_080404EC: + ldr r0, [r1] + adds r0, 0xDB + ldrb r4, [r0] + ldr r1, =0x02024294 + lsls r3, r4, 1 + adds r0, r3, r4 + lsls r0, 2 + adds r1, r0, r1 + ldrb r0, [r1, 0x5] + strb r0, [r7] + mov r2, r10 + strb r0, [r2] + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _0804054E + subs r0, 0x1 + strb r0, [r1, 0x4] + movs r6, 0xFF + lsls r0, 24 + cmp r0, 0 + bne _0804054E + ldr r2, =0x0202428e + adds r2, r3, r2 + ldrh r0, [r2] + ldr r3, =0x0000feff + adds r1, r3, 0 + ands r0, r1 + strh r0, [r2] + ldr r0, =gUnknown_082DACFA + bl b_call_bc_move_exec + ldr r0, =0x02024332 + strb r4, [r0, 0x5] + movs r0, 0xFD + strb r0, [r5] + movs r0, 0x2 + strb r0, [r5, 0x1] + movs r0, 0x36 + strb r0, [r5, 0x2] + mov r0, r8 + strb r0, [r5, 0x3] + ldrb r0, [r5, 0x4] + orrs r0, r6 + strb r0, [r5, 0x4] + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_0804054E: + ldr r2, =0x0202449c + ldr r1, [r2] + adds r1, 0xDB + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r12, r2 + mov r1, r9 + cmp r1, 0 + beq _08040564 + b _080408FE +_08040564: + mov r1, r12 + ldr r0, [r1] + adds r0, 0xDB + ldrb r0, [r0] + cmp r0, 0x1 + bls _080404EC +_08040570: + mov r2, r9 + cmp r2, 0 + beq _08040578 + b _080408FE +_08040578: + mov r3, r12 + ldr r0, [r3] + ldrb r1, [r0, 0x3] + adds r1, 0x1 + strb r1, [r0, 0x3] + ldr r0, [r3] + adds r0, 0xDB + strb r2, [r0] + b _080408F6 + .pool +_080405B0: + mov r1, r12 + ldr r0, [r1] + adds r0, 0xDB + ldrb r0, [r0] + cmp r0, 0x1 + bhi _0804062C + ldr r6, =0x02024064 + ldr r5, =0x0202420b +_080405C0: + ldr r0, [r1] + adds r0, 0xDB + ldrb r4, [r0] + ldr r2, =0x02024294 + lsls r1, r4, 1 + adds r0, r1, r4 + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2, 0x7] + strb r0, [r5] + strb r0, [r6] + ldr r0, =0x0202428e + adds r3, r1, r0 + ldrh r1, [r3] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0804060A + ldrb r0, [r2, 0x6] + subs r0, 0x1 + strb r0, [r2, 0x6] + lsls r0, 24 + cmp r0, 0 + bne _0804060A + ldrh r0, [r3] + ldr r2, =0x0000ffdf + adds r1, r2, 0 + ands r0, r1 + strh r0, [r3] + ldr r0, =gUnknown_082DAD0B + bl b_call_bc_move_exec + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_0804060A: + ldr r2, =0x0202449c + ldr r1, [r2] + adds r1, 0xDB + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r12, r2 + mov r3, r9 + cmp r3, 0 + beq _08040620 + b _080408FE +_08040620: + mov r1, r12 + ldr r0, [r1] + adds r0, 0xDB + ldrb r0, [r0] + cmp r0, 0x1 + bls _080405C0 +_0804062C: + mov r0, r9 + cmp r0, 0 + beq _08040634 + b _080408FE +_08040634: + mov r1, r12 + ldr r0, [r1] + ldrb r1, [r0, 0x3] + adds r1, 0x1 + strb r1, [r0, 0x3] + mov r2, r12 + ldr r0, [r2] + adds r0, 0xDB + mov r3, r9 + strb r3, [r0] + b _080408F6 + .pool +_08040668: + mov r2, r12 + ldr r0, [r2] + adds r0, 0xDB + ldr r1, =0x0202406c + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcs _080406E8 + ldr r4, =0x02024064 + ldr r5, =0x0202407e +_0804067C: + ldr r0, [r2] + adds r0, 0xDB + ldrb r0, [r0] + adds r0, r5 + ldrb r0, [r0] + strb r0, [r4] + ldr r0, =0x020243d0 + adds r0, 0x20 + ldrb r2, [r4] + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _080406C4 + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _080406C4 + ldr r1, =0x02024084 + ldrb r2, [r4] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _080406C4 + ldr r0, =0x0202420c + strb r2, [r0] + ldr r0, =gUnknown_082DB0B7 + bl b_call_bc_move_exec + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080406C4: + ldr r2, =0x0202449c + ldr r1, [r2] + adds r1, 0xDB + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r12, r2 + mov r3, r9 + cmp r3, 0 + beq _080406DA + b _080408FE +_080406DA: + ldr r0, [r2] + adds r0, 0xDB + ldr r1, =0x0202406c + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcc _0804067C +_080406E8: + mov r0, r9 + cmp r0, 0 + beq _080406F0 + b _080408FE +_080406F0: + mov r2, r12 + ldr r1, [r2] + ldrb r0, [r1, 0x3] + adds r0, 0x1 + strb r0, [r1, 0x3] + b _080408F6 + .pool +_0804071C: + ldr r3, =0x020243cc + ldrh r2, [r3] + movs r0, 0x7 + ands r0, r2 + cmp r0, 0 + bne _0804072A + b _080408C8 +_0804072A: + movs r0, 0x4 + ands r0, r2 + cmp r0, 0 + bne _08040776 + ldr r1, =0x020243d0 + adds r1, 0x28 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _08040768 + ldr r0, =0x0000fffe + ands r0, r2 + ldr r1, =0x0000fffd + ands r0, r1 + strh r0, [r3] + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1, 0x5] + b _08040794 + .pool +_08040768: + movs r0, 0x2 + ands r0, r2 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + bne _08040782 + b _08040790 +_08040776: + movs r0, 0x2 + ands r0, r2 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _08040790 +_08040782: + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _08040794 + .pool +_08040790: + ldr r0, =0x02024332 + strb r1, [r0, 0x5] +_08040794: + ldr r0, =gUnknown_082DAC2C + b _080408BA + .pool +_080407A0: + ldr r3, =0x020243cc + ldrh r2, [r3] + movs r0, 0x18 + ands r0, r2 + cmp r0, 0 + bne _080407AE + b _080408C8 +_080407AE: + movs r0, 0x10 + ands r0, r2 + cmp r0, 0 + bne _080407E8 + ldr r1, =0x020243d0 + adds r1, 0x28 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _080407E8 + ldr r0, =0x0000fff7 + ands r0, r2 + strh r0, [r3] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DACC9 + b _080407EC + .pool +_080407E8: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAC47 +_080407EC: + str r0, [r1] + adds r3, r1, 0 + ldr r1, =0x02024474 + movs r2, 0 + movs r0, 0xC + strb r0, [r1, 0x10] + ldr r0, =0x02024332 + strb r2, [r0, 0x5] + b _080408B8 + .pool +_08040810: + ldr r3, =0x020243cc + ldrh r2, [r3] + movs r0, 0x60 + ands r0, r2 + cmp r0, 0 + beq _080408C8 + movs r0, 0x40 + ands r0, r2 + cmp r0, 0 + bne _08040854 + ldr r1, =0x020243d0 + adds r1, 0x28 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _08040854 + ldr r0, =0x0000ffdf + ands r0, r2 + strh r0, [r3] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DACE0 + b _08040858 + .pool +_08040854: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DACD2 +_08040858: + str r0, [r1] + adds r3, r1, 0 + b _080408B8 + .pool +_08040868: + ldr r3, =0x020243cc + ldrh r2, [r3] + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _080408C8 + ldr r1, =0x020243d0 + adds r1, 0x28 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _080408A4 + ldr r0, =0x0000ff7f + ands r0, r2 + strh r0, [r3] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DACC9 + b _080408A8 + .pool +_080408A4: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAC47 +_080408A8: + str r0, [r1] + adds r3, r1, 0 + ldr r1, =0x02024474 + movs r0, 0xD + strb r0, [r1, 0x10] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] +_080408B8: + ldr r0, [r3] +_080408BA: + bl b_call_bc_move_exec + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080408C8: + ldr r2, =0x0202449c + ldr r1, [r2] + ldrb r0, [r1, 0x3] + adds r0, 0x1 + strb r0, [r1, 0x3] + mov r12, r2 + b _080408F6 + .pool +_080408EC: + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080408F6: + mov r3, r9 + cmp r3, 0 + bne _080408FE + b _0804025E +_080408FE: + ldr r0, =0x03005d04 + ldr r1, [r0] + ldr r0, =sub_803B9BC + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80401D0 + + thumb_func_start sub_8040924 +sub_8040924: @ 8040924 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r0, 0 + mov r9, r0 + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0x01000020 + orrs r0, r1 + str r0, [r2] + ldr r5, =0x0202449c + ldr r2, [r5] + ldr r0, =0x0202406c + ldrb r1, [r2, 0x1] + adds r7, r5, 0 + mov r8, r0 + ldrb r3, [r0] + cmp r1, r3 + bcc _08040954 + bl _08041338 +_08040954: + bl _0804132E + .pool +_08040968: + ldr r3, =0x02024064 + ldr r4, =0x0202420b + ldr r1, =0x0202407e + ldr r5, [r5] + ldrb r0, [r5, 0x1] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r4] + strb r0, [r3] + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + adds r6, r3, 0 + cmp r1, 0 + beq _080409B0 + ldrb r0, [r5, 0x1] + adds r0, 0x1 + strb r0, [r5, 0x1] + bl _0804131C + .pool +_080409B0: + ldrb r0, [r5] + cmp r0, 0x13 + bls _080409BA + bl _08041312 +_080409BA: + lsls r0, 2 + ldr r1, =_080409C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080409C8: + .4byte _08040A18 + .4byte _08040A78 + .4byte _08040A96 + .4byte _08040AC6 + .4byte _08040B44 + .4byte _08040B8C + .4byte _08040C0C + .4byte _08040C54 + .4byte _08040CB8 + .4byte _08040D00 + .4byte _08040E60 + .4byte _08040F7C + .4byte _08041024 + .4byte _080410E8 + .4byte _0804119C + .4byte _080411BC + .4byte _08041208 + .4byte _08041238 + .4byte _08040AAE + .4byte _08041304 +_08040A18: + ldr r1, =0x020242ac + ldrb r3, [r6] + lsls r0, r3, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 3 + ands r0, r1 + cmp r0, 0 + bne _08040A30 + bl _080412DE +_08040A30: + ldr r0, =0x02024084 + movs r1, 0x58 + muls r1, r3 + adds r0, r1, r0 + ldrh r2, [r0, 0x28] + ldrh r5, [r0, 0x2C] + cmp r2, r5 + bne _08040A44 + bl _080412DE +_08040A44: + cmp r2, 0 + bne _08040A4C + bl _080412DE +_08040A4C: + ldr r1, =0x020241f0 + ldrh r0, [r0, 0x2C] + lsrs r0, 4 + str r0, [r1] + cmp r0, 0 + bne _08040A5C + movs r0, 0x1 + str r0, [r1] +_08040A5C: + ldr r0, [r1] + negs r0, r0 + str r0, [r1] + ldr r0, =gUnknown_082DB0EE + bl _080412D0 + .pool +_08040A78: + ldrb r1, [r6] + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _08040A92 + bl _080412DE +_08040A92: + bl _080412D4 +_08040A96: + ldrb r1, [r6] + movs r0, 0x1 + movs r2, 0 + bl berry_effects_maybe + lsls r0, 24 + cmp r0, 0 + bne _08040AAA + bl _080412DE +_08040AAA: + bl _080412D4 +_08040AAE: + ldrb r1, [r6] + movs r0, 0x1 + movs r2, 0x1 + bl berry_effects_maybe + lsls r0, 24 + cmp r0, 0 + bne _08040AC2 + bl _080412DE +_08040AC2: + bl _080412D4 +_08040AC6: + ldr r0, =0x020242ac + ldrb r2, [r6] + lsls r1, r2, 2 + adds r1, r0 + ldr r1, [r1] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _08040ADC + bl _080412DE +_08040ADC: + ldr r3, =0x02024084 + movs r5, 0x3 + ands r5, r1 + movs r1, 0x58 + adds r0, r5, 0 + muls r0, r1 + adds r0, r3 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08040AF4 + bl _080412DE +_08040AF4: + adds r0, r2, 0 + muls r0, r1 + adds r0, r3 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08040B04 + bl _080412DE +_08040B04: + ldr r0, =0x0202420c + strb r5, [r0] + ldr r2, =0x020241f0 + ldrb r0, [r6] + muls r0, r1 + adds r0, r3 + ldrh r0, [r0, 0x2C] + lsrs r0, 3 + str r0, [r2] + cmp r0, 0 + bne _08040B1E + movs r0, 0x1 + str r0, [r2] +_08040B1E: + ldr r1, =0x02024474 + strb r5, [r1, 0x10] + ldrb r0, [r4] + strb r0, [r1, 0x11] + ldr r0, =gUnknown_082DAD15 + b _080412D0 + .pool +_08040B44: + ldr r2, =0x02024084 + ldrb r1, [r6] + movs r0, 0x58 + adds r3, r1, 0 + muls r3, r0 + adds r0, r2, 0 + adds r0, 0x4C + adds r0, r3, r0 + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + bne _08040B60 + b _080412DE +_08040B60: + adds r1, r3, r2 + ldrh r0, [r1, 0x28] + cmp r0, 0 + bne _08040B6A + b _080412DE +_08040B6A: + ldr r2, =0x020241f0 + ldrh r0, [r1, 0x2C] + lsrs r0, 3 + str r0, [r2] + cmp r0, 0 + bne _08040B7A + movs r0, 0x1 + str r0, [r2] +_08040B7A: + ldr r0, =gUnknown_082DB23D + b _080412D0 + .pool +_08040B8C: + ldr r4, =0x02024084 + ldrb r0, [r6] + movs r7, 0x58 + mov r8, r7 + mov r2, r8 + muls r2, r0 + adds r3, r4, 0 + adds r3, 0x4C + adds r0, r2, r3 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08040BAA + b _080412DE +_08040BAA: + adds r1, r2, r4 + ldrh r0, [r1, 0x28] + cmp r0, 0 + bne _08040BB4 + b _080412DE +_08040BB4: + ldr r5, =0x020241f0 + ldrh r0, [r1, 0x2C] + lsrs r0, 4 + str r0, [r5] + cmp r0, 0 + bne _08040BC4 + movs r0, 0x1 + str r0, [r5] +_08040BC4: + ldrb r0, [r6] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r2, r0, r3 + ldr r1, [r2] + movs r4, 0xF0 + lsls r4, 4 + adds r0, r1, 0 + ands r0, r4 + cmp r0, r4 + beq _08040BE4 + movs r7, 0x80 + lsls r7, 1 + adds r0, r1, r7 + str r0, [r2] +_08040BE4: + ldrb r0, [r6] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r3 + ldr r0, [r0] + ands r0, r4 + lsrs r0, 8 + ldr r1, [r5] + muls r0, r1 + str r0, [r5] + ldr r0, =gUnknown_082DB23D + b _080412D0 + .pool +_08040C0C: + ldr r2, =0x02024084 + ldrb r1, [r6] + movs r0, 0x58 + adds r3, r1, 0 + muls r3, r0 + adds r0, r2, 0 + adds r0, 0x4C + adds r0, r3, r0 + ldr r0, [r0] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08040C28 + b _080412DE +_08040C28: + adds r1, r3, r2 + ldrh r0, [r1, 0x28] + cmp r0, 0 + bne _08040C32 + b _080412DE +_08040C32: + ldr r2, =0x020241f0 + ldrh r0, [r1, 0x2C] + lsrs r0, 3 + str r0, [r2] + cmp r0, 0 + bne _08040C42 + movs r0, 0x1 + str r0, [r2] +_08040C42: + ldr r0, =gUnknown_082DB25F + b _080412D0 + .pool +_08040C54: + ldr r4, =0x02024084 + ldrb r1, [r6] + movs r0, 0x58 + muls r1, r0 + adds r0, r4, 0 + adds r0, 0x50 + adds r5, r1, r0 + ldr r2, [r5] + movs r0, 0x80 + lsls r0, 20 + ands r0, r2 + cmp r0, 0 + bne _08040C70 + b _080412DE +_08040C70: + adds r3, r1, r4 + ldrh r0, [r3, 0x28] + cmp r0, 0 + bne _08040C7A + b _080412DE +_08040C7A: + adds r0, r4, 0 + adds r0, 0x4C + adds r0, r1, r0 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08040CAC + ldr r1, =0x020241f0 + ldrh r0, [r3, 0x2C] + lsrs r0, 2 + str r0, [r1] + cmp r0, 0 + bne _08040C9A + movs r0, 0x1 + str r0, [r1] +_08040C9A: + ldr r0, =gUnknown_082DB33F + b _080412D0 + .pool +_08040CAC: + ldr r0, =0xf7ffffff + ands r2, r0 + str r2, [r5] + b _080412DE + .pool +_08040CB8: + ldr r2, =0x02024084 + ldrb r1, [r6] + movs r0, 0x58 + adds r3, r1, 0 + muls r3, r0 + adds r0, r2, 0 + adds r0, 0x50 + adds r0, r3, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 21 + ands r0, r1 + cmp r0, 0 + bne _08040CD6 + b _080412DE +_08040CD6: + adds r1, r3, r2 + ldrh r0, [r1, 0x28] + cmp r0, 0 + bne _08040CE0 + b _080412DE +_08040CE0: + ldr r2, =0x020241f0 + ldrh r0, [r1, 0x2C] + lsrs r0, 2 + str r0, [r2] + cmp r0, 0 + bne _08040CF0 + movs r0, 0x1 + str r0, [r2] +_08040CF0: + ldr r0, =gUnknown_082DB350 + b _080412D0 + .pool +_08040D00: + ldr r3, =0x02024084 + mov r8, r3 + ldrb r0, [r6] + movs r3, 0x58 + adds r1, r0, 0 + muls r1, r3 + movs r5, 0x50 + add r5, r8 + mov r10, r5 + adds r4, r1, r5 + ldr r2, [r4] + movs r5, 0xE0 + lsls r5, 8 + adds r0, r2, 0 + ands r0, r5 + cmp r0, 0 + bne _08040D24 + b _080412DE +_08040D24: + mov r7, r8 + adds r0, r1, r7 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08040D30 + b _080412DE +_08040D30: + ldr r1, =0xffffe000 + adds r0, r2, r1 + str r0, [r4] + ldrb r4, [r6] + adds r0, r4, 0 + muls r0, r3 + add r0, r10 + ldr r0, [r0] + ands r0, r5 + cmp r0, 0 + beq _08040DC0 + ldr r1, =0x02024474 + ldr r0, =0x0202449c + ldr r2, [r0] + lsls r0, r4, 1 + adds r0, r2 + ldrb r0, [r0, 0x4] + strb r0, [r1, 0x10] + ldrb r0, [r6] + lsls r0, 1 + adds r0, r2 + ldrb r0, [r0, 0x5] + strb r0, [r1, 0x11] + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + ldrb r0, [r6] + lsls r0, 1 + adds r0, r2 + ldrb r0, [r0, 0x4] + strb r0, [r1, 0x2] + ldrb r0, [r6] + lsls r0, 1 + adds r0, r2 + ldrb r0, [r0, 0x5] + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB30E + str r0, [r1] + ldr r2, =0x020241f0 + ldrb r0, [r6] + muls r0, r3 + add r0, r8 + ldrh r0, [r0, 0x2C] + lsrs r0, 4 + str r0, [r2] + cmp r0, 0 + bne _08040DEC + movs r0, 0x1 + str r0, [r2] + b _08040DEC + .pool +_08040DC0: + ldr r2, =0x02022f58 + movs r0, 0xFD + strb r0, [r2] + movs r0, 0x2 + strb r0, [r2, 0x1] + ldrb r1, [r6] + ldr r0, =0x0202449c + ldr r3, [r0] + lsls r1, 1 + adds r1, r3 + ldrb r0, [r1, 0x4] + strb r0, [r2, 0x2] + ldrb r0, [r6] + lsls r0, 1 + adds r0, r3 + ldrb r0, [r0, 0x5] + strb r0, [r2, 0x3] + movs r0, 0xFF + strb r0, [r2, 0x4] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB320 + str r0, [r1] +_08040DEC: + ldr r0, [r1] + b _080412D0 + .pool +_08040E00: + movs r0, 0x8 + negs r0, r0 + ands r3, r0 + str r3, [r2] + ldrb r0, [r6] + mov r2, r8 + muls r2, r0 + mov r0, r10 + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + ldr r0, =gUnknown_082DB234 + bl b_call_bc_move_exec + ldr r4, =0x02024064 + ldrb r0, [r6] + strb r0, [r4] + ldrb r0, [r4] + mov r3, r8 + muls r3, r0 + adds r0, r3, 0 + add r0, r9 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _08040EC8 + .pool +_08040E60: + ldr r2, =0x02024084 + ldrb r1, [r6] + movs r0, 0x58 + muls r0, r1 + adds r1, r2, 0 + adds r1, 0x50 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x70 + ands r1, r0 + adds r7, r2, 0 + cmp r1, 0 + beq _08040F6A + movs r0, 0 + strb r0, [r4] + mov r5, r8 + ldrb r0, [r5] + cmp r0, 0 + beq _08040EC8 + mov r10, r7 + adds r6, r4, 0 + movs r1, 0x58 + mov r8, r1 + movs r3, 0x4C + adds r3, r7 + mov r9, r3 + str r0, [sp, 0x4] + movs r5, 0x7 + mov r12, r5 +_08040E9A: + ldrb r4, [r6] + mov r1, r8 + muls r1, r4 + mov r0, r9 + adds r2, r1, r0 + ldr r3, [r2] + adds r0, r3, 0 + mov r5, r12 + ands r0, r5 + cmp r0, 0 + beq _08040EBA + adds r0, r1, r7 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x2B + bne _08040E00 +_08040EBA: + adds r0, r4, 0x1 + strb r0, [r6] + lsls r0, 24 + lsrs r0, 24 + ldr r1, [sp, 0x4] + cmp r0, r1 + bcc _08040E9A +_08040EC8: + ldr r2, =0x0202420b + ldr r1, =0x0202406c + ldrb r0, [r2] + ldrb r1, [r1] + cmp r0, r1 + beq _08040EE8 + movs r3, 0x2 + mov r9, r3 + b _08041318 + .pool +_08040EE8: + ldr r5, =0x02024064 + ldrb r0, [r5] + strb r0, [r2] + ldr r2, =0x02024084 + ldrb r0, [r5] + movs r7, 0x58 + adds r1, r0, 0 + muls r1, r7 + adds r6, r2, 0 + adds r6, 0x50 + adds r1, r6 + ldr r0, [r1] + subs r0, 0x10 + str r0, [r1] + ldrb r0, [r5] + bl sub_803F90C + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _08040F2C + ldrb r0, [r5] + bl b_cancel_multi_turn_move_maybe + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _08040F60 + .pool +_08040F2C: + ldrb r3, [r5] + adds r0, r3, 0 + muls r0, r7 + adds r2, r0, r6 + ldr r0, [r2] + movs r1, 0x70 + ands r0, r1 + cmp r0, 0 + beq _08040F54 + ldr r0, =0x02024332 + strb r4, [r0, 0x5] + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 5 + orrs r0, r1 + str r0, [r2] + b _08040F60 + .pool +_08040F54: + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + adds r0, r3, 0 + bl b_cancel_multi_turn_move_maybe +_08040F60: + ldr r0, =gUnknown_082DB2A6 + bl b_call_bc_move_exec + movs r5, 0x1 + mov r9, r5 +_08040F6A: + mov r7, r9 + cmp r7, 0x2 + bne _08040F72 + b _08041312 +_08040F72: + b _080412DE + .pool +_08040F7C: + ldr r1, =0x02024084 + ldrb r0, [r6] + movs r7, 0x58 + muls r0, r7 + adds r5, r1, 0 + adds r5, 0x50 + adds r2, r0, r5 + ldr r1, [r2] + movs r4, 0xC0 + lsls r4, 4 + adds r0, r1, 0 + ands r0, r4 + cmp r0, 0 + bne _08040F9A + b _080412DE +_08040F9A: + ldr r3, =0xfffffc00 + adds r0, r1, r3 + str r0, [r2] + ldrb r0, [r6] + bl sub_803F90C + lsls r0, 24 + cmp r0, 0 + beq _08040FBC + ldrb r0, [r6] + bl b_cancel_multi_turn_move_maybe + b _080412DE + .pool +_08040FBC: + ldrb r0, [r6] + muls r0, r7 + adds r2, r0, r5 + ldr r1, [r2] + adds r0, r1, 0 + ands r0, r4 + cmp r0, 0 + beq _08040FCE + b _080412DE +_08040FCE: + movs r0, 0x80 + lsls r0, 5 + ands r0, r1 + cmp r0, 0 + bne _08040FDA + b _080412DE +_08040FDA: + ldr r0, =0xffffefff + ands r1, r0 + str r1, [r2] + ldrb r0, [r6] + muls r0, r7 + adds r0, r5 + ldr r0, [r0] + movs r4, 0x7 + ands r0, r4 + cmp r0, 0 + beq _08040FF2 + b _080412DE +_08040FF2: + ldr r1, =0x02024332 + movs r0, 0x47 + strb r0, [r1, 0x3] + movs r0, 0x1 + movs r1, 0 + bl sub_8048760 + ldrb r0, [r6] + muls r0, r7 + adds r0, r5 + ldr r0, [r0] + ands r0, r4 + cmp r0, 0 + bne _08041010 + b _080412D4 +_08041010: + ldr r0, =gUnknown_082DB2AF + bl b_call_bc_move_exec + b _080412D4 + .pool +_08041024: + ldr r0, =0x020242bc + ldrb r3, [r6] + lsls r1, r3, 3 + subs r1, r3 + lsls r1, 2 + adds r5, r1, r0 + ldrb r1, [r5, 0xB] + lsls r1, 28 + adds r7, r0, 0 + cmp r1, 0 + bne _0804103C + b _080412DE +_0804103C: + movs r4, 0 + ldr r2, =0x02024084 + movs r0, 0x58 + adds r1, r3, 0 + muls r1, r0 + adds r2, 0xC + adds r1, r2 + ldrh r0, [r5, 0x4] + ldrh r1, [r1] + cmp r0, r1 + beq _0804107A + mov r12, r7 + mov r8, r2 + adds r5, r6, 0 + movs r3, 0x58 +_0804105A: + adds r4, 0x1 + cmp r4, 0x3 + bgt _0804107A + ldrb r2, [r5] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + add r1, r12 + lsls r0, r4, 1 + muls r2, r3 + adds r0, r2 + add r0, r8 + ldrh r1, [r1, 0x4] + ldrh r0, [r0] + cmp r1, r0 + bne _0804105A +_0804107A: + cmp r4, 0x4 + bne _080410AC + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r7 + movs r1, 0 + strh r1, [r0, 0x4] + ldrb r0, [r6] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0xB] + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0xB] + b _080412DE + .pool +_080410AC: + ldrb r0, [r6] + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 2 + adds r2, r7 + ldrb r3, [r2, 0xB] + lsls r1, r3, 28 + lsrs r1, 28 + subs r1, 0x1 + movs r0, 0xF + ands r1, r0 + movs r0, 0x10 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0xB] + adds r2, r1, 0 + cmp r2, 0 + beq _080410D4 + b _080412DE +_080410D4: + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x4] + ldr r0, =gUnknown_082DAE23 + b _080412D0 + .pool +_080410E8: + ldr r3, =0x020242bc + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r2, r0, r3 + ldrb r5, [r2, 0xE] + lsls r4, r5, 28 + cmp r4, 0 + bne _080410FE + b _080412DE +_080410FE: + ldr r7, =0x02024084 + mov r8, r7 + ldrb r0, [r2, 0xC] + lsls r0, 1 + movs r7, 0x58 + muls r1, r7 + adds r0, r1 + mov r1, r8 + adds r1, 0xC + adds r0, r1 + ldrh r0, [r0] + ldrh r1, [r2, 0x6] + cmp r0, r1 + beq _0804113C + movs r0, 0 + strh r0, [r2, 0x6] + ldrb r0, [r6] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r2, [r1, 0xE] + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0xE] + b _080412DE + .pool +_0804113C: + lsrs r1, r4, 28 + subs r1, 0x1 + movs r0, 0xF + ands r1, r0 + movs r4, 0x10 + negs r4, r4 + adds r0, r4, 0 + ands r0, r5 + orrs r0, r1 + strb r0, [r2, 0xE] + cmp r1, 0 + beq _08041172 + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r3 + muls r1, r7 + ldrb r0, [r0, 0xC] + adds r1, r0 + mov r0, r8 + adds r0, 0x24 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _08041172 + b _080412DE +_08041172: + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x6] + ldrb r0, [r6] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r2, [r1, 0xE] + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1, 0xE] + ldr r0, =gUnknown_082DAE37 + b _080412D0 + .pool +_0804119C: + ldr r0, =0x020242ac + ldrb r1, [r6] + lsls r1, 2 + adds r1, r0 + ldr r2, [r1] + movs r0, 0x18 + ands r0, r2 + cmp r0, 0 + beq _080411B4 + adds r0, r2, 0 + subs r0, 0x8 + str r0, [r1] +_080411B4: + ldr r1, [r7] + b _080412E2 + .pool +_080411BC: + ldr r2, =0x020242bc + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r3, r0, r2 + ldrb r2, [r3, 0x12] + lsls r1, r2, 28 + cmp r1, 0 + beq _080411F6 + lsrs r1, 28 + subs r1, 0x1 + movs r0, 0xF + ands r1, r0 + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x12] + cmp r1, 0 + bne _080411F6 + ldr r0, =0x020242ac + ldrb r2, [r6] + lsls r2, 2 + adds r2, r0 + ldr r0, [r2] + ldr r1, =0xfffffdff + ands r0, r1 + str r0, [r2] +_080411F6: + ldr r1, [r7] + b _080412E2 + .pool +_08041208: + ldr r2, =0x020242bc + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r3, r0, r2 + ldrb r2, [r3, 0x13] + lsls r1, r2, 28 + cmp r1, 0 + beq _0804122E + lsrs r1, 28 + subs r1, 0x1 + movs r0, 0xF + ands r1, r0 + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x13] +_0804122E: + ldr r1, [r7] + b _080412E2 + .pool +_08041238: + ldr r4, =0x020242ac + ldrb r0, [r6] + lsls r0, 2 + adds r2, r0, r4 + ldr r1, [r2] + movs r3, 0xC0 + lsls r3, 5 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + beq _080412DE + ldr r5, =0xfffff800 + adds r0, r1, r5 + str r0, [r2] + ldrb r2, [r6] + lsls r0, r2, 2 + adds r0, r4 + ldr r0, [r0] + ands r0, r3 + cmp r0, 0 + bne _080412DE + ldr r3, =0x02024084 + movs r5, 0x58 + adds r1, r2, 0 + muls r1, r5 + adds r4, r3, 0 + adds r4, 0x4C + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _080412DE + adds r0, r1, r3 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x48 + beq _080412DE + cmp r0, 0xF + beq _080412DE + adds r0, r2, 0 + bl sub_8050650 + lsls r0, 24 + cmp r0, 0 + bne _080412DE + ldrb r0, [r6] + bl b_cancel_multi_turn_move_maybe + bl GenerateRandomNumber + ldrb r1, [r6] + adds r2, r1, 0 + muls r2, r5 + adds r2, r4 + movs r1, 0x3 + ands r1, r0 + adds r1, 0x2 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r6] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x0202420e + ldrb r0, [r6] + strb r0, [r1] + ldr r0, =gUnknown_082DB378 +_080412D0: + bl b_call_bc_move_exec +_080412D4: + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080412DE: + ldr r0, =0x0202449c + ldr r1, [r0] +_080412E2: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08041312 + .pool +_08041304: + ldr r1, [r7] + movs r0, 0 + strb r0, [r1] + ldr r1, [r7] + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] +_08041312: + mov r7, r9 + cmp r7, 0 + beq _0804131C +_08041318: + mov r0, r9 + b _08041344 +_0804131C: + ldr r5, =0x0202449c + ldr r2, [r5] + ldr r0, =0x0202406c + ldrb r1, [r2, 0x1] + adds r7, r5, 0 + mov r8, r0 + ldrb r0, [r0] + cmp r1, r0 + bcs _08041338 +_0804132E: + ldrb r0, [r2] + cmp r0, 0x13 + bhi _08041338 + bl _08040968 +_08041338: + ldr r0, =0x02024280 + ldr r1, [r0] + ldr r2, =0xfeffffdf + ands r1, r2 + str r1, [r0] + movs r0, 0 +_08041344: + 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_8040924 + + thumb_func_start sub_8041364 +sub_8041364: @ 8041364 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0x01000020 + orrs r0, r1 + str r0, [r2] + ldr r1, =0x0202449c + ldr r3, [r1] + movs r4, 0xD0 + lsls r4, 1 + adds r0, r3, r4 + ldrb r0, [r0] + mov r10, r2 + adds r6, r1, 0 + cmp r0, 0x1 + bne _0804138E + b _08041548 +_0804138E: + cmp r0, 0x1 + bgt _080413A4 + cmp r0, 0 + beq _080413AC + b _08041708 + .pool +_080413A4: + cmp r0, 0x2 + bne _080413AA + b _0804169A +_080413AA: + b _08041708 +_080413AC: + ldr r2, =0x000001a1 + adds r0, r3, r2 + ldr r1, =0x0202406c + ldrb r0, [r0] + mov r8, r1 + ldrb r7, [r1] + cmp r0, r7 + bcc _080413BE + b _08041532 +_080413BE: + ldr r4, =0x02024064 + ldr r5, =0x02022f58 + ldr r7, =0x020243d0 + movs r0, 0x18 + adds r0, r7 + mov r12, r0 +_080413CA: + ldr r0, [r6] + adds r3, r0, r2 + ldrb r0, [r3] + strb r0, [r4] + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0804140C + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + b _08041520 + .pool +_0804140C: + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + ldr r1, =0x020243d0 + ldrb r0, [r4] + adds r2, r0, r1 + ldrb r0, [r2] + mov r9, r1 + cmp r0, 0 + bne _08041422 + b _08041520 +_08041422: + subs r0, 0x1 + strb r0, [r2] + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + bne _08041520 + ldr r1, =0x02024084 + ldrb r2, [r4] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08041520 + lsls r0, r2, 1 + add r0, r12 + ldrh r0, [r0] + cmp r0, 0xF8 + bne _0804145C + ldr r0, =0x02024332 + strb r3, [r0, 0x5] + b _08041462 + .pool +_0804145C: + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] +_08041462: + movs r0, 0xFD + strb r0, [r5] + movs r6, 0x2 + movs r0, 0x2 + strb r0, [r5, 0x1] + ldrb r0, [r4] + lsls r0, 1 + add r0, r12 + ldrh r0, [r0] + strb r0, [r5, 0x2] + ldrb r0, [r4] + lsls r0, 1 + add r0, r12 + ldrh r0, [r0] + lsrs r0, 8 + strb r0, [r5, 0x3] + movs r0, 0xFF + strb r0, [r5, 0x4] + ldr r5, =0x0202420c + ldrb r0, [r4] + strb r0, [r5] + ldr r1, =0x0202420b + adds r0, r7, 0x4 + ldrb r2, [r4] + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + ldr r2, =0x020241f0 + ldrb r0, [r4] + lsls r0, 2 + adds r1, r7, 0 + adds r1, 0x8 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + ldr r2, =0x0202437c + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x4 + adds r0, r2 + ldr r1, =0x0000ffff + str r1, [r0] + ldr r0, =gUnknown_082DAFE4 + bl b_call_bc_move_exec + ldrb r1, [r4] + adds r0, r1, r7 + ldrb r0, [r0] + cmp r0, 0 + beq _080414CC + b _08041664 +_080414CC: + eors r1, r6 + mov r3, r9 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _080414DA + b _08041664 +_080414DA: + ldrb r0, [r5] + bl battle_get_per_side_status + ldr r2, =0x0202428e + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + ands r0, r1 + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + ldr r4, =0x0000ffbf + adds r2, r4, 0 + ands r1, r2 + strh r1, [r0] + b _08041664 + .pool +_08041520: + ldr r0, [r6] + ldr r2, =0x000001a1 + adds r0, r2 + ldrb r0, [r0] + mov r1, r8 + ldrb r1, [r1] + cmp r0, r1 + bcs _08041532 + b _080413CA +_08041532: + ldr r0, [r6] + movs r2, 0xD0 + lsls r2, 1 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r6] + ldr r3, =0x000001a1 + adds r1, r0, r3 + movs r0, 0 + strb r0, [r1] +_08041548: + adds r3, r6, 0 + ldr r0, [r6] + ldr r2, =0x000001a1 + adds r0, r2 + ldr r1, =0x0202406c + ldrb r0, [r0] + mov r8, r1 + ldrb r4, [r1] + cmp r0, r4 + bcc _0804155E + b _08041684 +_0804155E: + ldr r5, =0x02024064 + ldr r4, =0x02022f58 + ldr r7, =0x020242bc + mov r12, r7 + ldr r0, =0x0202420b + mov r9, r0 +_0804156A: + ldr r1, =0x0202407e + ldr r0, [r3] + adds r3, r0, r2 + ldrb r0, [r3] + adds r0, r1 + ldrb r0, [r0] + mov r1, r9 + strb r0, [r1] + strb r0, [r5] + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _080415BC + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + b _08041670 + .pool +_080415BC: + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + ldr r7, =0x020242ac + ldrb r0, [r5] + lsls r0, 2 + adds r0, r7 + ldr r0, [r0] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08041670 + movs r0, 0xFD + strb r0, [r4] + movs r0, 0x1 + strb r0, [r4, 0x1] + strb r0, [r4, 0x2] + strb r0, [r4, 0x3] + ldrb r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + ldrb r0, [r0, 0xF] + lsls r0, 28 + lsrs r0, 28 + strb r0, [r4, 0x4] + movs r0, 0xFF + strb r0, [r4, 0x5] + ldrb r2, [r5] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + mov r3, r12 + adds r4, r0, r3 + ldrb r3, [r4, 0xF] + lsls r1, r3, 28 + cmp r1, 0 + bne _08041644 + lsls r2, 2 + adds r2, r7 + ldr r0, [r2] + movs r1, 0x21 + negs r1, r1 + ands r0, r1 + str r0, [r2] + ldr r3, =0x020241f0 + ldr r2, =0x02024084 + ldrb r1, [r5] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x28] + str r0, [r3] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAF05 + b _0804165C + .pool +_08041644: + lsrs r1, 28 + subs r1, 0x1 + movs r0, 0xF + ands r1, r0 + movs r7, 0x10 + negs r7, r7 + adds r0, r7, 0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4, 0xF] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAF20 +_0804165C: + str r0, [r1] + ldr r0, [r1] + bl b_call_bc_move_exec +_08041664: + movs r0, 0x1 + b _08041714 + .pool +_08041670: + adds r3, r6, 0 + ldr r0, [r6] + ldr r2, =0x000001a1 + adds r0, r2 + ldrb r0, [r0] + mov r1, r8 + ldrb r1, [r1] + cmp r0, r1 + bcs _08041684 + b _0804156A +_08041684: + ldr r0, [r6] + movs r2, 0xD0 + lsls r2, 1 + adds r0, r2 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r6] + ldr r3, =0x000001a1 + adds r1, r0, r3 + movs r0, 0 + strb r0, [r1] +_0804169A: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _08041708 + ldr r0, [r6] + adds r0, 0xDA + ldrb r0, [r0] + cmp r0, 0x2 + bne _08041708 + ldr r1, =0x02024084 + ldrh r0, [r1, 0x28] + cmp r0, 0 + beq _08041708 + adds r0, r1, 0 + adds r0, 0x80 + ldrh r0, [r0] + cmp r0, 0 + beq _08041708 + movs r4, 0 +_080416C6: + lsls r0, r4, 24 + lsrs r0, 24 + bl b_cancel_multi_turn_move_maybe + adds r4, 0x1 + cmp r4, 0x1 + ble _080416C6 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB8F3 + str r0, [r1] + bl b_call_bc_move_exec + ldr r0, =0x0202449c + ldr r1, [r0] + movs r4, 0xD0 + lsls r4, 1 + adds r1, r4 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08041664 + .pool +_08041708: + mov r7, r10 + ldr r0, [r7] + ldr r1, =0xfeffffdf + ands r0, r1 + str r0, [r7] + movs r0, 0 +_08041714: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8041364 + + thumb_func_start sub_8041728 +sub_8041728: @ 8041728 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08041770 + b _08041A0A + .pool +_08041744: + ldr r0, =gUnknown_082DA7C4 + bl b_call_bc_move_exec + ldr r0, [r5] + adds r0, 0x4D + movs r1, 0x2 + b _08041764 + .pool +_08041758: + ldr r0, =gUnknown_082DA7CD + bl b_call_bc_move_exec + ldr r0, [r5] + adds r0, 0x4D + movs r1, 0x5 +_08041764: + strb r1, [r0] +_08041766: + movs r0, 0x1 + b _08041A0C + .pool +_08041770: + ldr r0, =0x0202449c + mov r8, r0 +_08041774: + mov r1, r8 + ldr r0, [r1] + adds r0, 0x4D + ldrb r0, [r0] + cmp r0, 0x7 + bls _08041782 + b _080419FC +_08041782: + lsls r0, 2 + ldr r1, =_08041794 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08041794: + .4byte _080417B4 + .4byte _08041806 + .4byte _080418A0 + .4byte _080418E2 + .4byte _080418F6 + .4byte _08041960 + .4byte _08041994 + .4byte _080419FC +_080417B4: + mov r4, r8 + ldr r0, [r4] + adds r0, 0x4E + movs r1, 0 + strb r1, [r0] + ldr r1, [r4] + adds r1, 0x4D + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r5, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + bge _08041806 + ldr r6, =0x02024210 +_080417D4: + ldrb r0, [r6] + ldr r2, =gUnknown_0832A328 + lsls r1, r5, 2 + adds r1, r2 + ldr r4, [r1] + ands r0, r4 + cmp r0, 0 + beq _080417FC + lsls r0, r5, 24 + lsrs r0, 24 + movs r1, 0x6 + movs r2, 0x6 + bl sub_80423F4 + lsls r0, 24 + cmp r0, 0 + bne _080417FC + ldrb r0, [r6] + bics r0, r4 + strb r0, [r6] +_080417FC: + adds r5, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + blt _080417D4 +_08041806: + ldr r0, =0x0202449c + mov r8, r0 + ldr r1, =0x0202420d + mov r12, r1 + ldr r2, =0x0202420c + mov r5, r8 + ldr r7, =0x02024084 + ldr r6, =0x0202406e +_08041816: + ldr r3, [r5] + adds r1, r3, 0 + adds r1, 0x4E + ldrb r0, [r1] + strb r0, [r2] + mov r4, r12 + strb r0, [r4] + ldrb r4, [r1] + movs r0, 0x58 + muls r0, r4 + adds r0, r7 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _0804185E + adds r0, r3, 0 + adds r0, 0xDF + ldrb r1, [r0] + ldr r3, =gUnknown_0832A328 + lsls r0, r4, 1 + adds r0, r6 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0804185E + ldr r0, =0x02024210 + ldrb r1, [r0] + lsls r0, r4, 2 + adds r0, r3 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0804185E + b _08041744 +_0804185E: + ldr r0, [r5] + adds r0, 0x4E + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r0, =0x0202406c + lsls r1, 24 + lsrs r1, 24 + ldrb r0, [r0] + cmp r1, r0 + bne _08041816 + mov r1, r8 + ldr r0, [r1] + adds r0, 0x4D + movs r1, 0x3 + strb r1, [r0] + b _080419FC + .pool +_080418A0: + ldr r0, =0x0202420d + ldrb r0, [r0] + bl sub_803F9EC + ldr r2, =0x0202449c + ldr r1, [r2] + adds r1, 0x4E + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bne _080418D8 + ldr r0, [r2] + adds r0, 0x4D + movs r1, 0x3 + strb r1, [r0] + b _080419FA + .pool +_080418D8: + ldr r0, [r2] + adds r0, 0x4D + movs r1, 0x1 + strb r1, [r0] + b _080419FA +_080418E2: + mov r4, r8 + ldr r0, [r4] + adds r0, 0x4E + movs r1, 0 + strb r1, [r0] + ldr r1, [r4] + adds r1, 0x4D + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080418F6: + ldr r0, =0x0202420d + mov r12, r0 + ldr r7, =0x0202420c + ldr r5, =0x0202449c + ldr r2, =0x02024084 + ldr r6, =gUnknown_0832A328 +_08041902: + ldr r0, [r5] + adds r4, r0, 0 + adds r4, 0x4E + ldrb r0, [r4] + strb r0, [r7] + mov r1, r12 + strb r0, [r1] + ldrb r3, [r4] + movs r0, 0x58 + muls r0, r3 + adds r0, r2 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08041930 + ldr r0, =0x02024210 + ldrb r1, [r0] + lsls r0, r3, 2 + adds r0, r6 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08041930 + b _08041758 +_08041930: + adds r0, r3, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bne _08041902 + b _08041978 + .pool +_08041960: + mov r1, r8 + ldr r0, [r1] + adds r0, 0x4E + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r0, =0x0202406c + lsls r1, 24 + lsrs r1, 24 + ldrb r0, [r0] + cmp r1, r0 + bne _08041988 +_08041978: + mov r4, r8 + ldr r0, [r4] + adds r0, 0x4D + movs r1, 0x6 + strb r1, [r0] + b _080419FC + .pool +_08041988: + mov r1, r8 + ldr r0, [r1] + adds r0, 0x4D + movs r1, 0x4 + strb r1, [r0] + b _080419FC +_08041994: + movs r0, 0 + str r0, [sp] + movs r0, 0x9 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080419AE + b _08041766 +_080419AE: + str r0, [sp] + movs r0, 0xB + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _080419C4 + b _08041766 +_080419C4: + movs r0, 0x1 + movs r1, 0 + movs r2, 0x1 + bl berry_effects_maybe + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080419D8 + b _08041766 +_080419D8: + str r0, [sp] + movs r0, 0x6 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _080419EE + b _08041766 +_080419EE: + ldr r2, =0x0202449c + ldr r1, [r2] + adds r1, 0x4D + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080419FA: + mov r8, r2 +_080419FC: + mov r4, r8 + ldr r0, [r4] + adds r0, 0x4D + ldrb r0, [r0] + cmp r0, 0x7 + beq _08041A0A + b _08041774 +_08041A0A: + movs r0, 0 +_08041A0C: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8041728 + + thumb_func_start b_clear_atk_up_if_hit_flag_unless_enraged +b_clear_atk_up_if_hit_flag_unless_enraged: @ 8041A1C + push {r4-r6,lr} + movs r3, 0 + ldr r0, =0x0202406c + adds r5, r0, 0 + ldrb r0, [r5] + cmp r3, r0 + bge _08041A54 + ldr r4, =0x02024274 + movs r6, 0x80 + lsls r6, 16 + ldr r2, =0x020240d4 +_08041A32: + ldr r1, [r2] + adds r0, r1, 0 + ands r0, r6 + cmp r0, 0 + beq _08041A48 + ldrh r0, [r4] + cmp r0, 0x63 + beq _08041A48 + ldr r0, =0xff7fffff + ands r1, r0 + str r1, [r2] +_08041A48: + adds r4, 0x2 + adds r2, 0x58 + adds r3, 0x1 + ldrb r0, [r5] + cmp r3, r0 + blt _08041A32 +_08041A54: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end b_clear_atk_up_if_hit_flag_unless_enraged + + thumb_func_start sub_8041A6C +sub_8041A6C: @ 8041A6C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + movs r0, 0 + mov r9, r0 + ldr r1, =0x02024478 + mov r10, r1 + ldr r2, =0x0202449c + mov r8, r2 + b _08041A9A + .pool +_08041A90: + mov r3, r9 + cmp r3, 0 + beq _08041A9A + bl _08042388 +_08041A9A: + mov r4, r8 + ldr r0, [r4] + ldr r7, =0x000001a3 + adds r0, r7 + ldrb r0, [r0] + cmp r0, 0xE + bls _08041AAC + bl _08042376 +_08041AAC: + lsls r0, 2 + ldr r1, =_08041AC0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08041AC0: + .4byte _08041AFC + .4byte _08041B48 + .4byte _08041C90 + .4byte _08041D50 + .4byte _08041DC4 + .4byte _08041E40 + .4byte _08041EB8 + .4byte _08041F38 + .4byte _08041FC0 + .4byte _08042028 + .4byte _08042114 + .4byte _08042194 + .4byte _08042234 + .4byte _0804231C + .4byte _08042376 +_08041AFC: + ldr r1, =0x02024084 + ldr r3, =0x0202420b + ldrb r2, [r3] + movs r0, 0x58 + muls r2, r0 + adds r1, 0x50 + adds r2, r1 + ldr r0, [r2] + ldr r1, =0xfdffffff + ands r0, r1 + str r0, [r2] + ldr r0, =0x020242ac + ldrb r2, [r3] + lsls r2, 2 + adds r2, r0 + ldr r0, [r2] + ldr r1, =0xffffbfff + ands r0, r1 + str r0, [r2] + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x000001a3 + adds r1, r0, r2 + bl _08042370 + .pool +_08041B48: + ldr r7, =0x02024084 + ldr r4, =0x0202420b + ldrb r1, [r4] + movs r5, 0x58 + adds r0, r1, 0 + muls r0, r5 + adds r6, r7, 0 + adds r6, 0x4C + adds r0, r6 + ldr r0, [r0] + movs r3, 0x7 + mov r8, r3 + ands r0, r3 + cmp r0, 0 + bne _08041B68 + b _08041C6E +_08041B68: + adds r0, r1, 0 + bl sub_8050650 + lsls r0, 24 + cmp r0, 0 + beq _08041BC8 + ldrb r0, [r4] + adds r2, r0, 0 + muls r2, r5 + adds r2, r6 + ldr r0, [r2] + movs r1, 0x8 + negs r1, r1 + ands r0, r1 + str r0, [r2] + ldrb r0, [r4] + adds r2, r0, 0 + muls r2, r5 + adds r0, r7, 0 + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB220 + str r0, [r1] + movs r4, 0x2 + mov r9, r4 + b _08041C6E + .pool +_08041BC8: + ldrb r0, [r4] + adds r1, r0, 0 + muls r1, r5 + adds r0, r1, r7 + adds r0, 0x20 + ldrb r0, [r0] + movs r3, 0x1 + cmp r0, 0x30 + bne _08041BDC + movs r3, 0x2 +_08041BDC: + adds r2, r1, r6 + ldr r1, [r2] + adds r0, r1, 0 + mov r7, r8 + ands r0, r7 + cmp r0, r3 + bcs _08041BF4 + movs r0, 0x8 + negs r0, r0 + ands r1, r0 + str r1, [r2] + b _08041BF8 +_08041BF4: + subs r0, r1, r3 + str r0, [r2] +_08041BF8: + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r1, r0 + adds r0, r2, 0 + adds r0, 0x4C + adds r0, r1, r0 + ldr r4, [r0] + movs r0, 0x7 + ands r4, r0 + cmp r4, 0 + beq _08041C50 + ldr r0, =0x020241ea + ldrh r0, [r0] + cmp r0, 0xAD + beq _08041C6E + cmp r0, 0xD6 + beq _08041C6E + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB213 + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + movs r0, 0x2 + mov r9, r0 + b _08041C6E + .pool +_08041C50: + adds r2, 0x50 + adds r2, r1, r2 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] + bl b_movescr_stack_push_cursor + ldr r0, =0x02024332 + strb r4, [r0, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB220 + str r0, [r1] + movs r1, 0x2 + mov r9, r1 +_08041C6E: + ldr r1, =0x0202449c + ldr r0, [r1] + ldr r3, =0x000001a3 + adds r2, r0, r3 + b _0804216A + .pool +_08041C90: + ldr r1, =0x02024084 + ldr r7, =0x0202420b + ldrb r0, [r7] + movs r6, 0x58 + muls r0, r6 + adds r5, r1, 0 + adds r5, 0x4C + adds r0, r5 + ldr r0, [r0] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08041D30 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x5 + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _08041D08 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x7D + bne _08041CD6 + b _08042162 +_08041CD6: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB26A + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 2 + orrs r0, r1 + str r0, [r2] + b _08041D28 + .pool +_08041D08: + ldrb r0, [r7] + adds r2, r0, 0 + muls r2, r6 + adds r2, r5 + ldr r0, [r2] + movs r1, 0x21 + negs r1, r1 + ands r0, r1 + str r0, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB277 + str r0, [r1] + ldr r0, =0x02024332 + strb r4, [r0, 0x5] +_08041D28: + movs r7, 0x2 + mov r9, r7 + ldr r0, =0x0202449c + mov r8, r0 +_08041D30: + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x000001a3 + adds r1, r0, r2 + b _08042370 + .pool +_08041D50: + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x36 + beq _08041D66 + b _08042162 +_08041D66: + ldr r0, =0x020242bc + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x18] + lsls r0, 31 + cmp r0, 0 + bne _08041D7A + b _08042162 +_08041D7A: + adds r0, r2, 0 + bl b_cancel_multi_turn_move_maybe + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + ldr r1, =0x02024332 + movs r0, 0 + strb r0, [r1, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB6AD + str r0, [r1] + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + b _0804215E + .pool +_08041DC4: + ldr r1, =0x02024084 + ldr r3, =0x0202420b + ldrb r2, [r3] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x80 + lsls r0, 15 + ands r0, r1 + cmp r0, 0 + beq _08041E10 + ldr r0, =0xffbfffff + ands r1, r0 + str r1, [r2] + ldr r2, =0x020242bc + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strb r1, [r0, 0x19] + ldrb r0, [r3] + bl b_cancel_multi_turn_move_maybe + ldr r1, =0x02024214 + ldr r0, =gUnknown_082D9462 + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + movs r7, 0x1 + mov r9, r7 +_08041E10: + ldr r1, =0x0202449c + ldr r0, [r1] + ldr r3, =0x000001a3 + adds r2, r0, r3 + b _0804216A + .pool +_08041E40: + ldr r1, =0x02024084 + ldr r3, =0x0202420b + ldrb r2, [r3] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08041E8C + movs r0, 0x9 + negs r0, r0 + ands r1, r0 + str r1, [r2] + ldr r0, =0x0202433c + ldrb r2, [r3] + lsls r2, 4 + adds r2, r0 + ldrb r0, [r2, 0x2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x2] + ldrb r0, [r3] + bl b_cancel_multi_turn_move_maybe + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB29B + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + movs r4, 0x1 + mov r9, r4 +_08041E8C: + ldr r1, =0x0202449c + ldr r0, [r1] + ldr r7, =0x000001a3 + adds r2, r0, r7 + b _0804216A + .pool +_08041EB8: + ldr r0, =0x020242bc + ldr r3, =0x0202420b + ldrb r2, [r3] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldr r0, =0x020241ea + ldrh r1, [r1, 0x4] + ldrh r0, [r0] + cmp r1, r0 + bne _08041F04 + cmp r1, 0 + beq _08041F04 + ldr r0, =0x0202433c + lsls r2, 4 + adds r2, r0 + ldrb r0, [r2, 0x1] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x1] + ldr r1, =0x02024474 + ldrb r0, [r3] + strb r0, [r1, 0x17] + ldrb r0, [r3] + bl b_cancel_multi_turn_move_maybe + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAE14 + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + movs r0, 0x1 + mov r9, r0 +_08041F04: + ldr r1, =0x0202449c + ldr r0, [r1] + ldr r3, =0x000001a3 + adds r2, r0, r3 + b _0804216A + .pool +_08041F38: + ldr r0, =0x020242bc + ldr r4, =0x0202420b + ldrb r3, [r4] + lsls r1, r3, 3 + subs r1, r3 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x13] + lsls r0, 28 + cmp r0, 0 + beq _08041F8C + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _08041F8C + ldr r0, =0x0202433c + lsls r2, r3, 4 + adds r2, r0 + ldrb r0, [r2, 0x2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x2] + ldrb r0, [r4] + bl b_cancel_multi_turn_move_maybe + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB0A4 + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + movs r4, 0x1 + mov r9, r4 +_08041F8C: + ldr r1, =0x0202449c + ldr r0, [r1] + ldr r7, =0x000001a3 + adds r2, r0, r7 + b _0804216A + .pool +_08041FC0: + ldr r4, =0x0202420b + ldrb r0, [r4] + ldr r1, =0x020241ea + ldrh r1, [r1] + bl sub_8040130 + lsls r0, 24 + cmp r0, 0 + beq _08041FFE + ldr r0, =0x0202433c + ldrb r2, [r4] + lsls r2, 4 + adds r2, r0 + ldrb r0, [r2, 0x1] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2, 0x1] + ldrb r0, [r4] + bl b_cancel_multi_turn_move_maybe + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB176 + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + movs r0, 0x1 + mov r9, r0 +_08041FFE: + ldr r1, =0x0202449c + ldr r0, [r1] + ldr r3, =0x000001a3 + adds r2, r0, r3 + b _0804216A + .pool +_08042028: + ldr r7, =0x02024084 + ldr r5, =0x0202420b + ldrb r0, [r5] + movs r6, 0x58 + muls r0, r6 + adds r4, r7, 0 + adds r4, 0x50 + adds r2, r0, r4 + ldr r1, [r2] + movs r3, 0x7 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + beq _080420FA + subs r0, r1, 0x1 + str r0, [r2] + ldrb r0, [r5] + muls r0, r6 + adds r0, r4 + ldr r0, [r0] + ands r0, r3 + cmp r0, 0 + beq _080420E8 + bl GenerateRandomNumber + movs r1, 0x1 + movs r2, 0x1 + ands r2, r0 + cmp r2, 0 + beq _0804207C + ldr r1, =0x02024332 + movs r0, 0 + strb r0, [r1, 0x5] + bl b_movescr_stack_push_cursor + b _080420C6 + .pool +_0804207C: + ldr r0, =0x02024332 + movs r4, 0x1 + strb r1, [r0, 0x5] + ldr r1, =0x0202420c + ldrb r0, [r5] + strb r0, [r1] + ldrb r0, [r5] + adds r1, r0, 0 + muls r1, r6 + adds r1, r7 + movs r0, 0x28 + str r0, [sp] + str r2, [sp, 0x4] + ldrb r0, [r5] + str r0, [sp, 0x8] + ldrb r0, [r5] + str r0, [sp, 0xC] + adds r0, r1, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_806957C + ldr r1, =0x020241f0 + str r0, [r1] + ldr r0, =0x0202433c + ldrb r1, [r5] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1, 0x1] + orrs r0, r4 + strb r0, [r1, 0x1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] +_080420C6: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB2BD + b _080420F0 + .pool +_080420E8: + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB300 +_080420F0: + str r0, [r1] + movs r4, 0x1 + mov r9, r4 + ldr r7, =0x0202449c + mov r8, r7 +_080420FA: + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x000001a3 + adds r1, r0, r2 + b _08042370 + .pool +_08042114: + ldr r1, =0x02024084 + ldr r4, =0x0202420b + ldrb r2, [r4] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08042162 + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + cmp r1, 0 + bne _08042162 + ldr r0, =0x0202433c + ldrb r2, [r4] + lsls r2, 4 + adds r2, r0 + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB28B + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] +_0804215E: + movs r3, 0x1 + mov r9, r3 +_08042162: + ldr r1, =0x0202449c + ldr r0, [r1] + ldr r4, =0x000001a3 + adds r2, r0, r4 +_0804216A: + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + mov r8, r1 + b _08042376 + .pool +_08042194: + ldr r1, =0x02024084 + ldr r4, =0x0202420b + ldrb r2, [r4] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r1, [r0] + movs r0, 0xF0 + lsls r0, 12 + ands r1, r0 + cmp r1, 0 + beq _0804220E + lsrs r0, r1, 16 + bl sub_806F8A8 + ldr r1, =0x02024474 + strb r0, [r1, 0x17] + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _080421D8 + bl b_movescr_stack_push_cursor + b _08042200 + .pool +_080421D8: + ldr r0, =gUnknown_082DB334 + bl b_movescr_stack_push + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 + orrs r0, r1 + str r0, [r2] + ldr r0, =0x0202433c + ldrb r2, [r4] + lsls r2, 4 + adds r2, r0 + ldrb r0, [r2, 0x1] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2, 0x1] + ldrb r0, [r4] + bl b_cancel_multi_turn_move_maybe +_08042200: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB327 + str r0, [r1] + movs r7, 0x1 + mov r9, r7 + ldr r0, =0x0202449c + mov r8, r0 +_0804220E: + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x000001a3 + adds r1, r0, r2 + b _08042370 + .pool +_08042234: + ldr r1, =0x02024084 + ldr r6, =0x0202420b + ldrb r0, [r6] + movs r5, 0x58 + muls r0, r5 + adds r1, 0x50 + adds r3, r0, r1 + ldr r2, [r3] + movs r4, 0xC0 + lsls r4, 2 + adds r0, r2, 0 + ands r0, r4 + cmp r0, 0 + beq _08042306 + ldr r7, =0xffffff00 + adds r0, r2, r7 + str r0, [r3] + ldrb r2, [r6] + adds r0, r2, 0 + muls r0, r5 + adds r0, r1 + ldr r0, [r0] + ands r0, r4 + cmp r0, 0 + beq _08042280 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAD71 + b _08042300 + .pool +_08042280: + ldr r3, =0x020241f8 + lsls r0, r2, 2 + adds r0, r3 + ldr r0, [r0] + cmp r0, 0 + beq _080422FC + ldr r1, =0x020241ea + movs r0, 0x75 + strh r0, [r1] + ldrb r0, [r6] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + lsls r0, 1 + mov r1, r10 + str r0, [r1] + ldr r4, =0x0202420c + ldr r1, =0x02024288 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + strb r0, [r4] + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _080422CA + movs r0, 0x75 + movs r1, 0x1 + bl sub_80458E0 + strb r0, [r4] +_080422CA: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAD7C + str r0, [r1] + ldr r2, =0x0202449c + mov r8, r2 + b _08042302 + .pool +_080422FC: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DADC4 +_08042300: + str r0, [r1] +_08042302: + movs r3, 0x1 + mov r9, r3 +_08042306: + mov r4, r8 + ldr r0, [r4] + ldr r7, =0x000001a3 + adds r1, r0, r7 + b _08042370 + .pool +_0804231C: + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x4C + adds r4, r0, r1 + ldr r3, [r4] + movs r0, 0x20 + ands r0, r3 + cmp r0, 0 + beq _08042368 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x7D + bne _08042360 + movs r0, 0x21 + negs r0, r0 + ands r3, r0 + str r3, [r4] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB277 + str r0, [r1] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] +_08042360: + movs r0, 0x2 + mov r9, r0 + ldr r1, =0x0202449c + mov r8, r1 +_08042368: + mov r2, r8 + ldr r0, [r2] + ldr r3, =0x000001a3 + adds r1, r0, r3 +_08042370: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08042376: + mov r4, r8 + ldr r0, [r4] + ldr r7, =0x000001a3 + adds r0, r7 + ldrb r0, [r0] + cmp r0, 0xE + beq _08042388 + bl _08041A90 +_08042388: + mov r0, r9 + cmp r0, 0x2 + bne _080423B4 + ldr r4, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r4] + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + ldr r1, =0x020240d0 + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_080423B4: + mov r0, r9 + 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_8041A6C + + thumb_func_start sub_80423F4 +sub_80423F4: @ 80423F4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08042424 + movs r0, 0 + b _080426A0 + .pool +_08042424: + movs r0, 0x80 + lsls r0, 15 + ands r0, r1 + cmp r0, 0 + beq _0804249C + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x02024744 + mov r8, r1 + cmp r0, 0 + bne _08042442 + ldr r2, =0x020244ec + mov r8, r2 +_08042442: + movs r0, 0x2 + ands r0, r4 + lsls r0, 24 + lsrs r6, r0, 25 + lsls r0, r6, 1 + adds r4, r0, r6 + adds r0, r4, 0x3 + cmp r4, r0 + bge _0804248C + adds r7, r0, 0 +_08042456: + movs r0, 0x64 + muls r0, r4 + mov r1, r8 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08042486 + adds r0, r5, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _08042486 + adds r0, r5, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _0804248C +_08042486: + adds r4, 0x1 + cmp r4, r7 + blt _08042456 +_0804248C: + movs r1, 0 + lsls r0, r6, 1 + adds r0, r6 + b _08042556 + .pool +_0804249C: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804256C + movs r0, 0x80 + lsls r0, 16 + ands r1, r0 + cmp r1, 0 + beq _080424E4 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080424D0 + ldr r2, =0x020244ec + mov r8, r2 + adds r0, r4, 0 + bl sub_806D864 + lsls r0, 24 + lsrs r7, r0, 24 + b _08042502 + .pool +_080424D0: + ldr r0, =0x02024744 + mov r8, r0 + movs r1, 0x1 + eors r1, r4 + negs r0, r1 + orrs r0, r1 + lsrs r6, r0, 31 + b _0804250C + .pool +_080424E4: + adds r0, r4, 0 + bl sub_806D864 + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x02024744 + mov r8, r1 + cmp r0, 0 + bne _08042502 + ldr r2, =0x020244ec + mov r8, r2 +_08042502: + adds r0, r7, 0 + bl sub_806D82C + lsls r0, 24 + lsrs r6, r0, 24 +_0804250C: + lsls r0, r6, 1 + adds r4, r0, r6 + adds r1, r4, 0x3 + mov r9, r0 + cmp r4, r1 + bge _08042550 + adds r7, r1, 0 +_0804251A: + movs r0, 0x64 + muls r0, r4 + mov r1, r8 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _0804254A + adds r0, r5, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _0804254A + adds r0, r5, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _08042550 +_0804254A: + adds r4, 0x1 + cmp r4, r7 + blt _0804251A +_08042550: + movs r1, 0 + mov r2, r9 + adds r0, r2, r6 +_08042556: + adds r0, 0x3 + cmp r4, r0 + bne _0804255E + movs r1, 0x1 +_0804255E: + adds r0, r1, 0 + b _080426A0 + .pool +_0804256C: + movs r0, 0x80 + lsls r0, 8 + ands r1, r0 + cmp r1, 0 + beq _080425DA + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080425DA + ldr r0, =0x02024744 + mov r8, r0 + movs r6, 0x3 + cmp r4, 0x1 + bne _08042590 + movs r6, 0 +_08042590: + adds r4, r6, 0 + adds r6, r4, 0x3 + b _0804259E + .pool +_0804259C: + adds r4, 0x1 +_0804259E: + cmp r4, r6 + bge _080425D2 + movs r0, 0x64 + muls r0, r4 + mov r1, r8 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _0804259C + adds r0, r5, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _0804259C + adds r0, r5, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _0804259C +_080425D2: + movs r0, 0 + cmp r4, r6 + bne _080426A0 + b _0804269E +_080425DA: + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08042608 + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0x3 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, =0x02024744 + mov r8, r2 + b _08042620 + .pool +_08042608: + movs r0, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0x2 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x020244ec + mov r8, r0 +_08042620: + mov r1, r10 + cmp r1, 0x6 + bne _08042630 + ldr r1, =0x0202406e + lsls r0, r7, 1 + adds r0, r1 + ldrb r0, [r0] + mov r10, r0 +_08042630: + mov r2, r9 + cmp r2, 0x6 + bne _08042640 + ldr r1, =0x0202406e + lsls r0, r6, 1 + adds r0, r1 + ldrb r0, [r0] + mov r9, r0 +_08042640: + movs r4, 0 +_08042642: + movs r0, 0x64 + muls r0, r4 + mov r1, r8 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08042692 + adds r0, r5, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _08042692 + adds r0, r5, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _08042692 + cmp r4, r10 + beq _08042692 + cmp r4, r9 + beq _08042692 + ldr r0, =0x0202449c + ldr r1, [r0] + adds r0, r7, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r4, r0 + beq _08042692 + adds r0, r6, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r4, r0 + bne _08042698 +_08042692: + adds r4, 0x1 + cmp r4, 0x5 + ble _08042642 +_08042698: + movs r0, 0 + cmp r4, 0x6 + bne _080426A0 +_0804269E: + movs r0, 0x1 +_080426A0: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80423F4 + + thumb_func_start castform_switch +castform_switch: @ 80426BC + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r6 + adds r4, r0, r1 + ldrh r1, [r4] + ldr r0, =0x00000181 + cmp r1, r0 + bne _08042760 + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x3B + bne _08042760 + ldrh r0, [r4, 0x28] + cmp r0, 0 + beq _08042760 + str r5, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _0804270E + str r5, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _08042734 +_0804270E: + adds r2, r4, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0 + beq _08042734 + adds r1, r4, 0 + adds r1, 0x22 + ldrb r0, [r1] + cmp r0, 0 + beq _08042734 + strb r5, [r2] + strb r5, [r1] + movs r0, 0x1 + b _08042818 + .pool +_08042734: + movs r0, 0 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08042760 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _08042764 +_08042760: + movs r0, 0 + b _08042818 +_08042764: + ldr r1, =0x020243cc + ldrh r0, [r1] + movs r2, 0xE7 + ands r2, r0 + adds r4, r1, 0 + cmp r2, 0 + bne _08042792 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r6 + adds r1, r0, r1 + adds r3, r1, 0 + adds r3, 0x21 + ldrb r0, [r3] + cmp r0, 0 + beq _08042792 + adds r1, 0x22 + ldrb r0, [r1] + cmp r0, 0 + beq _08042792 + strb r2, [r3] + strb r2, [r1] + movs r5, 0x1 +_08042792: + ldrh r1, [r4] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _080427BE + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r6 + adds r1, r0, r1 + adds r2, r1, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0xA + beq _080427BE + adds r1, 0x22 + ldrb r0, [r1] + cmp r0, 0xA + beq _080427BE + movs r0, 0xA + strb r0, [r2] + strb r0, [r1] + movs r5, 0x2 +_080427BE: + ldrh r1, [r4] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _080427EA + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r6 + adds r1, r0, r1 + adds r2, r1, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0xB + beq _080427EA + adds r1, 0x22 + ldrb r0, [r1] + cmp r0, 0xB + beq _080427EA + movs r0, 0xB + strb r0, [r2] + strb r0, [r1] + movs r5, 0x3 +_080427EA: + ldrh r1, [r4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08042816 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r6 + adds r1, r0, r1 + adds r2, r1, 0 + adds r2, 0x21 + ldrb r0, [r2] + cmp r0, 0xF + beq _08042816 + adds r1, 0x22 + ldrb r0, [r1] + cmp r0, 0xF + beq _08042816 + movs r0, 0xF + strb r0, [r2] + strb r0, [r1] + movs r5, 0x4 +_08042816: + adds r0, r5, 0 +_08042818: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end castform_switch + + thumb_func_start ability_something +ability_something: @ 8042828 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + ldr r4, [sp, 0x48] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r6, r2, 24 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0 + mov r9, r0 + ldr r5, =0x0202420b + ldr r1, =0x0202406c + ldrb r0, [r5] + ldrb r1, [r1] + cmp r0, r1 + bcc _08042864 + mov r1, r10 + strb r1, [r5] +_08042864: + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08042894 + ldr r1, =0x0202406e + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + b _080428A4 + .pool +_08042894: + ldr r1, =0x0202406e + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 +_080428A4: + adds r7, r1, r0 + ldr r5, =0x0202420c + ldr r1, =0x0202406c + ldrb r0, [r5] + ldrb r1, [r1] + cmp r0, r1 + bcc _080428B6 + mov r2, r10 + strb r2, [r5] +_080428B6: + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080428E8 + ldr r1, =0x0202406e + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + b _080428F8 + .pool +_080428E8: + ldr r1, =0x0202406e + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 +_080428F8: + adds r5, r1, r0 + adds r0, r7, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x8] + adds r0, r7, 0 + movs r1, 0 + bl pokemon_getattr + str r0, [sp, 0x10] + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0xC] + adds r0, r5, 0 + movs r1, 0 + bl pokemon_getattr + str r0, [sp, 0x14] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804293A + bl _0804443A +_0804293A: + mov r3, r8 + cmp r3, 0 + beq _08042958 + ldr r0, =0x0202420a + strb r3, [r0] + adds r7, r0, 0 + b _0804296E + .pool +_08042958: + ldr r2, =0x0202420a + ldr r1, =0x02024084 + movs r0, 0x58 + mov r5, r10 + muls r5, r0 + adds r0, r5, 0 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + strb r0, [r2] + adds r7, r2, 0 +_0804296E: + cmp r4, 0 + beq _08042980 + adds r5, r4, 0 + b _08042984 + .pool +_08042980: + ldr r0, =0x020241ea + ldrh r5, [r0] +_08042984: + ldr r1, =0x0202449c + ldr r0, [r1] + ldrb r0, [r0, 0x13] + mov r8, r1 + cmp r0, 0 + beq _080429A0 + movs r3, 0x3F + ands r3, r0 + b _080429AC + .pool +_080429A0: + ldr r1, =gBattleMoves + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r3, [r0, 0x2] +_080429AC: + ldr r0, [sp, 0x4] + cmp r0, 0x13 + bls _080429B6 + bl _0804441E +_080429B6: + lsls r0, 2 + ldr r1, =_080429C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080429C8: + .4byte _08042A18 + .4byte _08042CDC + .4byte _08042EF8 + .4byte _08042F8C + .4byte _080431AC + .4byte _08043908 + .4byte _08043C6C + .4byte _08043CBC + .4byte _08043D40 + .4byte _08043DC4 + .4byte _08043FE4 + .4byte _08043E08 + .4byte _08044028 + .4byte _08044084 + .4byte _080440E0 + .4byte _080441DC + .4byte _08044220 + .4byte _0804427C + .4byte _080443EC + .4byte _08044196 +_08042A18: + ldr r2, =0x0202420b + ldr r0, =0x0202406c + ldrb r1, [r2] + adds r5, r0, 0 + ldrb r3, [r5] + cmp r1, r3 + bcc _08042A2A + mov r0, r10 + strb r0, [r2] +_08042A2A: + ldrb r0, [r7] + cmp r0, 0x2D + bne _08042A32 + b _08042BA8 +_08042A32: + cmp r0, 0x2D + bgt _08042A64 + cmp r0, 0xD + bne _08042A3C + b _08042CA4 +_08042A3C: + cmp r0, 0xD + bgt _08042A54 + cmp r0, 0x2 + bne _08042A46 + b _08042B78 +_08042A46: + bl _0804441E + .pool +_08042A54: + cmp r0, 0x16 + bne _08042A5A + b _08042C08 +_08042A5A: + cmp r0, 0x24 + bne _08042A60 + b _08042C68 +_08042A60: + bl _0804441E +_08042A64: + cmp r0, 0x46 + bne _08042A6A + b _08042BD8 +_08042A6A: + cmp r0, 0x46 + bgt _08042A78 + cmp r0, 0x3B + bne _08042A74 + b _08042C3C +_08042A74: + bl _0804441E +_08042A78: + cmp r0, 0x4D + bne _08042A7E + b _08042CA4 +_08042A7E: + cmp r0, 0xFF + beq _08042A86 + bl _0804441E +_08042A86: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _08042B4C + bl weather_get_current + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x3 + cmp r0, 0xA + bhi _08042B4C + lsls r0, 2 + ldr r1, =_08042AB4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08042AB4: + .4byte _08042AE0 + .4byte _08042B4C + .4byte _08042AE0 + .4byte _08042B4C + .4byte _08042B4C + .4byte _08042B04 + .4byte _08042B4C + .4byte _08042B4C + .4byte _08042B4C + .4byte _08042B28 + .4byte _08042AE0 +_08042AE0: + ldr r2, =0x020243cc + ldrh r1, [r2] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _08042B4C + movs r0, 0x5 + strh r0, [r2] + ldr r1, =0x02024474 + movs r0, 0xA + strb r0, [r1, 0x10] + mov r2, r10 + strb r2, [r1, 0x17] + b _08042B42 + .pool +_08042B04: + ldr r3, =0x020243cc + ldrh r1, [r3] + movs r2, 0x18 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08042B4C + strh r2, [r3] + ldr r1, =0x02024474 + movs r0, 0xC + strb r0, [r1, 0x10] + mov r3, r10 + strb r3, [r1, 0x17] + b _08042B42 + .pool +_08042B28: + ldr r3, =0x020243cc + ldrh r1, [r3] + movs r2, 0x60 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08042B4C + strh r2, [r3] + ldr r1, =0x02024474 + movs r0, 0xB + strb r0, [r1, 0x10] + mov r5, r10 + strb r5, [r1, 0x17] +_08042B42: + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_08042B4C: + mov r0, r9 + cmp r0, 0 + bne _08042B56 + bl _0804443A +_08042B56: + bl weather_get_current + ldr r1, =0x02024332 + strb r0, [r1, 0x5] + ldr r0, =gUnknown_082DACE7 + bl b_push_move_exec + bl _0804441E + .pool +_08042B78: + ldr r2, =0x020243cc + ldrh r1, [r2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08042B88 + bl _0804441E +_08042B88: + movs r0, 0x5 + strh r0, [r2] + ldr r0, =gUnknown_082DB430 + bl b_push_move_exec + ldr r0, =0x02024474 + mov r1, r10 + strb r1, [r0, 0x17] + bl _080443D0 + .pool +_08042BA8: + ldr r2, =0x020243cc + ldrh r1, [r2] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08042BB8 + bl _0804441E +_08042BB8: + movs r0, 0x18 + strh r0, [r2] + ldr r0, =gUnknown_082DB470 + bl b_push_move_exec + ldr r0, =0x02024474 + mov r2, r10 + strb r2, [r0, 0x17] + bl _080443D0 + .pool +_08042BD8: + ldr r2, =0x020243cc + ldrh r1, [r2] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08042BE8 + bl _0804441E +_08042BE8: + movs r0, 0x60 + strh r0, [r2] + ldr r0, =gUnknown_082DB52A + bl b_push_move_exec + ldr r0, =0x02024474 + mov r3, r10 + strb r3, [r0, 0x17] + bl _080443D0 + .pool +_08042C08: + ldr r0, =0x0202437c + mov r5, r10 + lsls r2, r5, 2 + adds r1, r2, r5 + lsls r1, 2 + adds r3, r1, r0 + ldrb r0, [r3] + lsls r0, 28 + cmp r0, 0 + bge _08042C20 + bl _0804441E +_08042C20: + ldr r1, =0x020242ac + adds r1, r2, r1 + ldr r0, [r1] + movs r2, 0x80 + lsls r2, 12 + orrs r0, r2 + str r0, [r1] + ldrb r0, [r3] + movs r1, 0x8 + b _08042C92 + .pool +_08042C3C: + mov r0, r10 + bl castform_switch + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + cmp r0, 0 + bne _08042C50 + bl _0804443A +_08042C50: + ldr r0, =gUnknown_082DB4A9 + bl b_push_move_exec + ldr r0, =0x02024474 + mov r1, r10 + strb r1, [r0, 0x17] + bl _080442E2 + .pool +_08042C68: + ldr r0, =0x0202437c + mov r3, r10 + lsls r2, r3, 2 + adds r1, r2, r3 + lsls r1, 2 + adds r3, r1, r0 + ldrb r0, [r3] + lsls r0, 27 + cmp r0, 0 + bge _08042C80 + bl _0804441E +_08042C80: + ldr r1, =0x020242ac + adds r1, r2, r1 + ldr r0, [r1] + movs r2, 0x80 + lsls r2, 13 + orrs r0, r2 + str r0, [r1] + ldrb r0, [r3] + movs r1, 0x10 +_08042C92: + orrs r0, r1 + strb r0, [r3] + bl _0804441E + .pool +_08042CA4: + movs r6, 0 + ldrb r5, [r5] + cmp r6, r5 + bcc _08042CB0 + bl _0804441E +_08042CB0: + adds r0, r6, 0 + bl castform_switch + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + cmp r0, 0 + beq _08042CC4 + bl _080442D8 +_08042CC4: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r6, r0 + bcc _08042CB0 + bl _0804441E + .pool +_08042CDC: + ldr r5, =0x02024084 + mov r8, r5 + movs r0, 0x58 + mov r6, r10 + muls r6, r0 + adds r4, r6, r5 + ldrh r0, [r4, 0x28] + cmp r0, 0 + bne _08042CF2 + bl _0804441E +_08042CF2: + ldr r0, =0x0202420b + mov r1, r10 + strb r1, [r0] + ldrb r5, [r7] + cmp r5, 0x2C + beq _08042D22 + cmp r5, 0x2C + bgt _08042D14 + cmp r5, 0x3 + bne _08042D08 + b _08042E84 +_08042D08: + bl _0804441E + .pool +_08042D14: + cmp r5, 0x36 + bne _08042D1A + b _08042ED0 +_08042D1A: + cmp r5, 0x3D + beq _08042DA0 + bl _0804441E +_08042D22: + movs r0, 0 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08042D3E + bl _0804441E +_08042D3E: + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _08042D56 + bl _0804441E +_08042D56: + ldr r0, =0x020243cc + ldrh r1, [r0] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _08042D66 + bl _0804441E +_08042D66: + ldrh r0, [r4, 0x2C] + ldrh r2, [r4, 0x28] + cmp r0, r2 + bhi _08042D72 + bl _0804441E +_08042D72: + strb r5, [r7] + ldr r0, =gUnknown_082DB45C + bl b_push_move_exec + ldr r1, =0x020241f0 + ldrh r0, [r4, 0x2C] + lsrs r0, 4 + str r0, [r1] + cmp r0, 0 + bne _08042D8A + movs r0, 0x1 + str r0, [r1] +_08042D8A: + ldr r0, [r1] + negs r0, r0 + str r0, [r1] + bl _080443D0 + .pool +_08042DA0: + mov r0, r8 + adds r0, 0x4C + adds r5, r6, r0 + ldrb r0, [r5] + cmp r0, 0 + bne _08042DB0 + bl _0804441E +_08042DB0: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _08042DCA + bl _0804441E +_08042DCA: + ldr r0, [r5] + movs r1, 0x88 + ands r0, r1 + cmp r0, 0 + beq _08042DDC + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC70 + bl CopyString +_08042DDC: + ldr r0, [r5] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08042DEE + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC78 + bl CopyString +_08042DEE: + ldr r0, [r5] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08042E00 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC80 + bl CopyString +_08042E00: + ldr r0, [r5] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08042E12 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC88 + bl CopyString +_08042E12: + ldr r0, [r5] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08042E24 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC90 + bl CopyString +_08042E24: + str r4, [r5] + mov r1, r8 + adds r1, 0x50 + adds r1, r6, r1 + ldr r0, [r1] + ldr r2, =0xf7ffffff + ands r0, r2 + str r0, [r1] + ldr r0, =0x02024474 + ldr r4, =0x02024064 + mov r3, r10 + strb r3, [r4] + strb r3, [r0, 0x17] + ldr r0, =gUnknown_082DB484 + bl b_push_move_exec + str r5, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + bl _080443D0 + .pool +_08042E84: + ldrb r2, [r4, 0x1B] + movs r0, 0x1B + ldrsb r0, [r4, r0] + cmp r0, 0xB + ble _08042E92 + bl _0804441E +_08042E92: + ldr r0, =0x020242bc + mov r5, r10 + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x16] + cmp r0, 0x2 + bne _08042EA8 + bl _0804441E +_08042EA8: + adds r0, r2, 0x1 + movs r1, 0 + strb r0, [r4, 0x1B] + ldr r4, =0x02024474 + movs r0, 0x11 + strb r0, [r4, 0x10] + strb r1, [r4, 0x11] + ldr r0, =gUnknown_082DB444 + bl b_push_move_exec + strb r5, [r4, 0x17] + bl _080443D0 + .pool +_08042ED0: + ldr r2, =0x020242bc + ldrb r0, [r0] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r3, [r1, 0x18] + lsls r0, r3, 31 + lsrs r0, 31 + movs r2, 0x1 + eors r2, r0 + movs r0, 0x2 + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x18] + bl _0804441E + .pool +_08042EF8: + ldrb r0, [r7] + cmp r0, 0x2B + beq _08042F02 + bl _0804441E +_08042F02: + movs r4, 0 + ldr r0, =gUnknown_0831BCF8 + ldrh r2, [r0] + ldr r3, =0x0000ffff + adds r1, r0, 0 + cmp r2, r3 + bne _08042F14 + bl _0804441E +_08042F14: + cmp r2, r5 + beq _08042F2C + adds r2, r1, 0 +_08042F1A: + adds r2, 0x2 + adds r4, 0x1 + ldrh r0, [r2] + cmp r0, r3 + bne _08042F28 + bl _0804441E +_08042F28: + cmp r0, r5 + bne _08042F1A +_08042F2C: + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _08042F3C + bl _0804441E +_08042F3C: + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + ands r0, r1 + cmp r0, 0 + beq _08042F62 + ldr r0, =0x02024280 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 4 + orrs r1, r2 + str r1, [r0] +_08042F62: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB61F + str r0, [r1] + movs r0, 0x1 + mov r9, r0 + bl _08044424 + .pool +_08042F8C: + cmp r5, 0 + bne _08042F94 + bl _0804441E +_08042F94: + ldrb r0, [r7] + cmp r0, 0xB + beq _08043004 + cmp r0, 0xB + bgt _08042FA4 + cmp r0, 0xA + beq _08042FAA + b _08043126 +_08042FA4: + cmp r0, 0x12 + beq _0804305C + b _08043126 +_08042FAA: + cmp r3, 0xD + beq _08042FB0 + b _08043126 +_08042FB0: + ldr r0, =gBattleMoves + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _08042FC2 + b _08043126 +_08042FC2: + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x2] + lsls r0, 28 + cmp r0, 0 + bge _08042FF0 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB56F + b _08042FF4 + .pool +_08042FF0: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB56E +_08042FF4: + str r0, [r1] + movs r1, 0x1 + b _08043124 + .pool +_08043004: + cmp r3, 0xB + beq _0804300A + b _08043126 +_0804300A: + ldr r0, =gBattleMoves + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _0804301C + b _08043126 +_0804301C: + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x2] + lsls r0, 28 + cmp r0, 0 + bge _08043048 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB56F + b _0804304C + .pool +_08043048: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB56E +_0804304C: + str r0, [r1] + movs r2, 0x1 + mov r9, r2 + b _08043126 + .pool +_0804305C: + cmp r3, 0xA + bne _08043126 + ldr r1, =0x02024084 + movs r0, 0x58 + mov r3, r10 + muls r3, r0 + adds r0, r3, 0 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + bne _08043126 + ldr r2, =0x020244a8 + ldr r0, [r2] + ldr r0, [r0, 0x4] + mov r5, r10 + lsls r1, r5, 2 + adds r0, r1 + ldr r3, [r0] + movs r4, 0x1 + ands r3, r4 + adds r5, r1, 0 + cmp r3, 0 + bne _080430EC + ldr r0, =0x02024332 + strb r3, [r0, 0x5] + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x2] + lsls r0, 28 + cmp r0, 0 + bge _080430C8 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB5A8 + b _080430CC + .pool +_080430C8: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB5A7 +_080430CC: + str r0, [r1] + ldr r0, [r2] + ldr r1, [r0, 0x4] + adds r1, r5 + ldr r0, [r1] + movs r2, 0x1 + orrs r0, r2 + str r0, [r1] + movs r0, 0x2 + mov r9, r0 + b _08043126 + .pool +_080430EC: + ldr r0, =0x02024332 + strb r4, [r0, 0x5] + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x2] + lsls r0, 28 + cmp r0, 0 + bge _0804311C + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB5A8 + b _08043120 + .pool +_0804311C: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB5A7 +_08043120: + str r0, [r1] + movs r1, 0x2 +_08043124: + mov r9, r1 +_08043126: + mov r2, r9 + cmp r2, 0x1 + beq _08043130 + bl _0804441E +_08043130: + ldr r1, =0x02024084 + movs r0, 0x58 + mov r3, r10 + muls r3, r0 + adds r0, r3, 0 + adds r1, r0, r1 + ldrh r0, [r1, 0x2C] + ldrh r5, [r1, 0x28] + cmp r0, r5 + bne _0804318C + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x2] + lsls r0, 28 + cmp r0, 0 + bge _08043178 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB592 + str r0, [r1] + bl _0804441E + .pool +_08043178: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB591 + str r0, [r1] + bl _0804441E + .pool +_0804318C: + ldr r2, =0x020241f0 + ldrh r0, [r1, 0x2C] + lsrs r0, 2 + str r0, [r2] + cmp r0, 0 + bne _0804319C + mov r0, r9 + str r0, [r2] +_0804319C: + ldr r0, [r2] + negs r0, r0 + str r0, [r2] + bl _0804441E + .pool +_080431AC: + ldrb r0, [r7] + subs r0, 0x9 + cmp r0, 0x2F + bls _080431B8 + bl _0804441E +_080431B8: + lsls r0, 2 + ldr r1, =_080431C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080431C8: + .4byte _080435E4 + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _08043288 + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _08043350 + .4byte _0804441E + .4byte _0804441E + .4byte _08043410 + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _08043508 + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _080436C0 + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804441E + .4byte _0804379C +_08043288: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _08043298 + bl _0804441E +_08043298: + cmp r5, 0xA5 + bne _080432A0 + bl _0804441E +_080432A0: + ldr r0, =gBattleMoves + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _080432B4 + bl _0804441E +_080432B4: + ldr r2, =0x0202437c + ldr r0, =0x0202420c + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r1, r0, 2 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _080432DC + adds r0, r2, 0 + adds r0, 0xC + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _080432DC + bl _0804441E +_080432DC: + ldr r1, =0x02024084 + movs r0, 0x58 + mov r2, r10 + muls r2, r0 + adds r0, r2, 0 + adds r1, r0, r1 + adds r4, r1, 0 + adds r4, 0x21 + ldrb r0, [r4] + cmp r0, r3 + bne _080432F6 + bl _0804441E +_080432F6: + adds r2, r1, 0 + adds r2, 0x22 + ldrb r0, [r2] + cmp r0, r3 + bne _08043304 + bl _0804441E +_08043304: + ldrh r0, [r1, 0x28] + cmp r0, 0 + bne _0804330E + bl _0804441E +_0804330E: + strb r3, [r4] + strb r3, [r2] + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x3 + strb r0, [r1, 0x1] + strb r3, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB64D + str r0, [r1] + bl _080443D0 + .pool +_08043350: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _08043360 + bl _0804441E +_08043360: + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r3, r0, r1 + ldrh r0, [r3, 0x28] + cmp r0, 0 + bne _08043376 + bl _0804441E +_08043376: + ldr r0, =0x0202433c + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 31 + cmp r0, 0 + beq _08043388 + bl _0804441E +_08043388: + ldr r2, =0x0202437c + ldr r0, =0x0202420c + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r1, r0, 2 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _080433B0 + adds r0, r2, 0 + adds r0, 0xC + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _080433B0 + bl _0804441E +_080433B0: + ldr r1, =gBattleMoves + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x8] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _080433CA + bl _0804441E +_080433CA: + ldr r1, =0x020241f0 + ldrh r0, [r3, 0x2C] + lsrs r0, 4 + str r0, [r1] + cmp r0, 0 + bne _080433D8 + str r2, [r1] +_080433D8: + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB654 + str r0, [r1] + bl _080443D0 + .pool +_08043410: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _08043420 + bl _0804441E +_08043420: + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08043436 + bl _0804441E +_08043436: + ldr r0, =0x0202433c + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 31 + cmp r0, 0 + beq _08043448 + bl _0804441E +_08043448: + ldr r2, =0x0202437c + ldr r0, =0x0202420c + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r1, r0, 2 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08043470 + adds r0, r2, 0 + adds r0, 0xC + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08043470 + bl _0804441E +_08043470: + ldr r1, =gBattleMoves + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x8] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08043488 + bl _0804441E +_08043488: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + beq _080434A0 + bl _0804441E +_080434A0: + ldr r5, =0x02024332 + movs r4, 0x3 +_080434A4: + bl GenerateRandomNumber + ands r0, r4 + strb r0, [r5, 0x3] + cmp r0, 0 + beq _080434A4 + ldr r1, =0x02024332 + ldrb r0, [r1, 0x3] + cmp r0, 0x3 + bne _080434BC + adds r0, 0x2 + strb r0, [r1, 0x3] +_080434BC: + ldrb r0, [r1, 0x3] + adds r0, 0x40 + strb r0, [r1, 0x3] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB67C + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 6 + orrs r0, r1 + str r0, [r2] + bl _080443D0 + .pool +_08043508: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _08043518 + bl _0804441E +_08043518: + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _0804352E + bl _0804441E +_0804352E: + ldr r0, =0x0202433c + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 31 + cmp r0, 0 + beq _08043540 + bl _0804441E +_08043540: + ldr r2, =0x0202437c + ldr r0, =0x0202420c + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r1, r0, 2 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08043568 + adds r0, r2, 0 + adds r0, 0xC + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08043568 + bl _0804441E +_08043568: + ldr r1, =gBattleMoves + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x8] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08043580 + bl _0804441E +_08043580: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + beq _08043598 + bl _0804441E +_08043598: + ldr r1, =0x02024332 + movs r0, 0x42 + strb r0, [r1, 0x3] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB67C + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 6 + orrs r0, r1 + str r0, [r2] + bl _080443D0 + .pool +_080435E4: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _080435F4 + bl _0804441E +_080435F4: + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _0804360A + bl _0804441E +_0804360A: + ldr r0, =0x0202433c + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 31 + cmp r0, 0 + beq _0804361C + bl _0804441E +_0804361C: + ldr r2, =0x0202437c + ldr r0, =0x0202420c + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r1, r0, 2 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08043644 + adds r0, r2, 0 + adds r0, 0xC + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08043644 + bl _0804441E +_08043644: + ldr r1, =gBattleMoves + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x8] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0804365C + bl _0804441E +_0804365C: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + beq _08043674 + bl _0804441E +_08043674: + ldr r1, =0x02024332 + movs r0, 0x45 + strb r0, [r1, 0x3] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB67C + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 6 + orrs r0, r1 + str r0, [r2] + bl _080443D0 + .pool +_080436C0: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _080436D0 + bl _0804441E +_080436D0: + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _080436E6 + bl _0804441E +_080436E6: + ldr r0, =0x0202433c + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 31 + cmp r0, 0 + beq _080436F8 + bl _0804441E +_080436F8: + ldr r1, =gBattleMoves + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x8] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08043710 + bl _0804441E +_08043710: + ldr r2, =0x0202437c + ldr r0, =0x0202420c + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r1, r0, 2 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08043738 + adds r0, r2, 0 + adds r0, 0xC + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08043738 + bl _0804441E +_08043738: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + beq _08043750 + bl _0804441E +_08043750: + ldr r1, =0x02024332 + movs r0, 0x43 + strb r0, [r1, 0x3] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB67C + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 6 + orrs r0, r1 + str r0, [r2] + bl _080443D0 + .pool +_0804379C: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _080437AC + bl _0804441E +_080437AC: + ldr r6, =0x02024084 + ldr r3, =0x0202420b + mov r8, r3 + ldrb r1, [r3] + movs r7, 0x58 + adds r0, r1, 0 + muls r0, r7 + adds r0, r6 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _080437C6 + bl _0804441E +_080437C6: + ldr r0, =0x0202433c + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1, 0x1] + lsls r0, 31 + cmp r0, 0 + beq _080437D8 + bl _0804441E +_080437D8: + ldr r1, =gBattleMoves + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x8] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080437F0 + bl _0804441E +_080437F0: + ldr r3, =0x0202437c + ldr r5, =0x0202420c + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r2, r0, 2 + adds r0, r3, 0 + adds r0, 0x8 + adds r0, r2, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08043818 + adds r0, r3, 0 + adds r0, 0xC + adds r0, r2, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08043818 + bl _0804441E +_08043818: + adds r0, r1, 0 + muls r0, r7 + adds r0, r6 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08043828 + bl _0804441E +_08043828: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + beq _08043840 + bl _0804441E +_08043840: + mov r1, r8 + ldrb r0, [r1] + muls r0, r7 + adds r0, r6 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0xC + bne _08043854 + bl _0804441E +_08043854: + ldr r0, [sp, 0x8] + ldr r1, [sp, 0x10] + bl pokemon_species_get_gender_info + adds r4, r0, 0 + ldr r0, [sp, 0xC] + ldr r1, [sp, 0x14] + bl pokemon_species_get_gender_info + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _08043872 + bl _0804441E +_08043872: + mov r2, r8 + ldrb r0, [r2] + muls r0, r7 + adds r4, r6, 0 + adds r4, 0x50 + adds r0, r4 + ldr r0, [r0] + movs r1, 0xF0 + lsls r1, 12 + ands r0, r1 + cmp r0, 0 + beq _0804388E + bl _0804441E +_0804388E: + ldr r0, [sp, 0x8] + ldr r1, [sp, 0x10] + bl pokemon_species_get_gender_info + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _080438A2 + bl _0804441E +_080438A2: + ldr r0, [sp, 0xC] + ldr r1, [sp, 0x14] + bl pokemon_species_get_gender_info + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _080438B6 + bl _0804441E +_080438B6: + mov r3, r8 + ldrb r0, [r3] + adds r2, r0, 0 + muls r2, r7 + adds r2, r4 + ldr r1, =gUnknown_0832A328 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + lsls r1, 16 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB66F + str r0, [r1] + bl _080443D0 + .pool +_08043908: + movs r5, 0 + mov r10, r5 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r10, r0 + bcc _08043918 + bl _0804441E +_08043918: + ldr r1, =0x02024084 + movs r0, 0x58 + mov r2, r10 + muls r2, r0 + adds r0, r2, 0 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + subs r0, 0x7 + adds r2, r1, 0 + cmp r0, 0x41 + bls _08043932 + b _08043B96 +_08043932: + lsls r0, 2 + ldr r1, =_08043948 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08043948: + .4byte _08043AAC + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B70 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043AD4 + .4byte _08043B96 + .4byte _08043A50 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043A7C + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B40 + .4byte _08043B10 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043B96 + .4byte _08043AD4 +_08043A50: + movs r0, 0x58 + mov r3, r10 + muls r3, r0 + adds r0, r3, 0 + adds r1, r2, 0 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x00000f88 + ands r0, r1 + cmp r0, 0 + bne _08043A6A + b _08043B96 +_08043A6A: + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC70 + b _08043B5C + .pool +_08043A7C: + movs r0, 0x58 + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + adds r1, r2, 0 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _08043A96 + b _08043B96 +_08043A96: + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC98 + bl CopyString + movs r2, 0x2 + mov r9, r2 + b _08043B9C + .pool +_08043AAC: + movs r0, 0x58 + mov r3, r10 + muls r3, r0 + adds r0, r3, 0 + adds r1, r2, 0 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08043B96 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC80 + b _08043B5C + .pool +_08043AD4: + movs r0, 0x58 + mov r3, r10 + muls r3, r0 + adds r0, r2, 0 + adds r0, 0x4C + adds r0, r3, r0 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08043B96 + adds r2, 0x50 + adds r2, r3, r2 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC78 + bl CopyString + movs r0, 0x1 + mov r9, r0 + b _08043B9C + .pool +_08043B10: + movs r0, 0x58 + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + adds r1, r2, 0 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08043B96 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC88 + bl CopyString + movs r2, 0x1 + mov r9, r2 + b _08043B9C + .pool +_08043B40: + movs r0, 0x58 + mov r3, r10 + muls r3, r0 + adds r0, r3, 0 + adds r1, r2, 0 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08043B96 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC90 +_08043B5C: + bl CopyString + movs r5, 0x1 + mov r9, r5 + b _08043B9C + .pool +_08043B70: + movs r0, 0x58 + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + adds r1, r2, 0 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0xF0 + lsls r1, 12 + ands r0, r1 + cmp r0, 0 + beq _08043B96 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BCA0 + bl CopyString + movs r2, 0x3 + mov r9, r2 +_08043B96: + mov r3, r9 + cmp r3, 0 + beq _08043C50 +_08043B9C: + mov r5, r9 + cmp r5, 0x2 + beq _08043BD0 + cmp r5, 0x2 + bgt _08043BB4 + cmp r5, 0x1 + beq _08043BBC + b _08043BFC + .pool +_08043BB4: + mov r0, r9 + cmp r0, 0x3 + beq _08043BE8 + b _08043BFC +_08043BBC: + ldr r1, =0x02024084 + movs r0, 0x58 + mov r2, r10 + muls r2, r0 + adds r1, 0x4C + adds r2, r1 + movs r0, 0 + b _08043BFA + .pool +_08043BD0: + ldr r1, =0x02024084 + movs r0, 0x58 + mov r2, r10 + muls r2, r0 + adds r1, 0x50 + adds r2, r1 + ldr r0, [r2] + movs r1, 0x8 + negs r1, r1 + b _08043BF8 + .pool +_08043BE8: + ldr r1, =0x02024084 + movs r0, 0x58 + mov r2, r10 + muls r2, r0 + adds r1, 0x50 + adds r2, r1 + ldr r0, [r2] + ldr r1, =0xfff0ffff +_08043BF8: + ands r0, r1 +_08043BFA: + str r0, [r2] +_08043BFC: + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB68C + str r0, [r1] + ldr r0, =0x02024474 + mov r1, r10 + strb r1, [r0, 0x17] + ldr r4, =0x02024064 + strb r1, [r4] + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + ldr r1, =0x020240d0 + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + bl _0804443A + .pool +_08043C50: + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r10, r0 + bcs _08043C64 + b _08043918 +_08043C64: + bl _0804441E + .pool +_08043C6C: + movs r2, 0 + mov r10, r2 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r10, r0 + bcc _08043C7A + b _0804441E +_08043C7A: + ldr r4, =0x02024084 +_08043C7C: + movs r0, 0x58 + mov r3, r10 + muls r3, r0 + adds r0, r3, 0 + adds r0, r4 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x3B + bne _08043CA0 + mov r0, r10 + bl castform_switch + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + cmp r0, 0 + beq _08043CA0 + b _080442FC +_08043CA0: + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r10, r0 + bcc _08043C7C + b _0804441E + .pool +_08043CBC: + ldrb r0, [r7] + cmp r0, 0x1C + beq _08043CC4 + b _0804441E +_08043CC4: + ldr r4, =0x02024280 + ldr r1, [r4] + movs r0, 0x80 + lsls r0, 7 + ands r0, r1 + cmp r0, 0 + bne _08043CD4 + b _0804441E +_08043CD4: + ldr r0, =0xffffbfff + ands r1, r0 + str r1, [r4] + mov r5, r8 + ldr r1, [r5] + adds r1, 0xB2 + ldrb r2, [r1] + movs r0, 0x3F + ands r0, r2 + strb r0, [r1] + ldr r0, [r5] + adds r1, r0, 0 + adds r1, 0xB2 + ldrb r0, [r1] + cmp r0, 0x6 + bne _08043CF8 + movs r0, 0x2 + strb r0, [r1] +_08043CF8: + ldr r1, =0x02024332 + mov r2, r8 + ldr r0, [r2] + adds r0, 0xB2 + ldrb r0, [r0] + adds r0, 0x40 + strb r0, [r1, 0x3] + ldr r1, =0x02024474 + ldr r0, =0x0202420c + ldrb r0, [r0] + strb r0, [r1, 0x17] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB67F + str r0, [r1] + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 6 + orrs r0, r1 + str r0, [r4] + b _080443D0 + .pool +_08043D40: + ldrb r0, [r7] + cmp r0, 0x1C + beq _08043D48 + b _0804441E +_08043D48: + ldr r4, =0x02024280 + ldr r1, [r4] + movs r0, 0x80 + lsls r0, 7 + ands r0, r1 + cmp r0, 0 + bne _08043D58 + b _0804441E +_08043D58: + ldr r0, =0xffffbfff + ands r1, r0 + str r1, [r4] + mov r3, r8 + ldr r1, [r3] + adds r1, 0xB2 + ldrb r2, [r1] + movs r0, 0x3F + ands r0, r2 + strb r0, [r1] + ldr r0, [r3] + adds r1, r0, 0 + adds r1, 0xB2 + ldrb r0, [r1] + cmp r0, 0x6 + bne _08043D7C + movs r0, 0x2 + strb r0, [r1] +_08043D7C: + ldr r1, =0x02024332 + mov r3, r8 + ldr r0, [r3] + adds r0, 0xB2 + ldrb r0, [r0] + strb r0, [r1, 0x3] + ldr r1, =0x02024474 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r1, 0x17] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB67F + str r0, [r1] + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 6 + orrs r0, r1 + str r0, [r4] + b _080443D0 + .pool +_08043DC4: + movs r4, 0 + ldr r0, =0x0202406c + ldrb r1, [r0] + cmp r4, r1 + blt _08043DD0 + b _0804441E +_08043DD0: + ldr r0, =0x02024084 + adds r5, r1, 0 + ldr r2, =0x020242ac + adds r3, r0, 0 + adds r3, 0x20 + movs r6, 0x80 + lsls r6, 12 +_08043DDE: + ldrb r1, [r3] + cmp r1, 0x16 + bne _08043DEE + ldr r0, [r2] + ands r0, r6 + cmp r0, 0 + beq _08043DEE + b _08044324 +_08043DEE: + adds r2, 0x4 + adds r3, 0x58 + adds r4, 0x1 + cmp r4, r5 + blt _08043DDE + b _0804441E + .pool +_08043E08: + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _08043E14 + b _0804441E +_08043E14: + ldr r5, =0x02024064 + mov r8, r5 + ldr r0, =0x02024084 + adds r0, 0x20 + str r0, [sp, 0x1C] + movs r1, 0 + str r1, [sp, 0x20] +_08043E22: + ldr r2, [sp, 0x1C] + ldrb r0, [r2] + cmp r0, 0x24 + beq _08043E2C + b _08043FBE +_08043E2C: + ldr r0, =0x020242ac + ldr r3, [sp, 0x20] + adds r0, r3, r0 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 13 + ands r1, r0 + str r3, [sp, 0x18] + cmp r1, 0 + bne _08043E42 + b _08043FBE +_08043E42: + lsls r0, r4, 24 + lsrs r0, 24 + bl battle_get_per_side_status + movs r1, 0x1 + adds r5, r0, 0 + eors r5, r1 + ands r5, r1 + adds r0, r5, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r5, 0x2 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r2, 0x1 + ands r0, r2 + cmp r0, 0 + bne _08043E74 + b _08043F84 +_08043E74: + movs r1, 0x58 + adds r0, r6, 0 + muls r0, r1 + ldr r3, =0x02024084 + adds r1, r0, r3 + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + beq _08043F40 + ldrh r0, [r1, 0x28] + cmp r0, 0 + beq _08043EFC + movs r1, 0x58 + adds r0, r7, 0 + muls r0, r1 + adds r1, r0, r3 + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + beq _08043EFC + ldrh r0, [r1, 0x28] + cmp r0, 0 + beq _08043EFC + str r2, [sp, 0x24] + bl GenerateRandomNumber + ldr r2, [sp, 0x24] + adds r1, r2, 0 + ands r1, r0 + lsls r1, 1 + orrs r5, r1 + adds r0, r5, 0 + bl battle_get_side_with_given_state + mov r2, r8 + strb r0, [r2] + ldrb r0, [r2] + movs r3, 0x58 + muls r0, r3 + ldr r5, =0x02024084 + adds r0, r5 + adds r0, 0x20 + ldrb r0, [r0] + ldr r1, [sp, 0x1C] + strb r0, [r1] + ldrb r0, [r2] + muls r0, r3 + adds r0, r5 + adds r0, 0x20 + ldrb r0, [r0] + ldr r2, =0x0202420a + strb r0, [r2] + b _08043FAC + .pool +_08043EFC: + ldr r3, =0x02024084 + movs r2, 0x58 + adds r0, r6, 0 + muls r0, r2 + adds r1, r0, r3 + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + beq _08043F40 + ldrh r0, [r1, 0x28] + cmp r0, 0 + beq _08043F40 + mov r5, r8 + strb r6, [r5] + adds r1, r4, 0 + muls r1, r2 + adds r1, r3 + ldrb r0, [r5] + muls r0, r2 + adds r0, r3 + adds r0, 0x20 + ldrb r0, [r0] + adds r1, 0x20 + strb r0, [r1] + ldrb r0, [r5] + muls r0, r2 + adds r0, r3 + adds r0, 0x20 + ldrb r0, [r0] + b _08043FA8 + .pool +_08043F40: + ldr r3, =0x02024084 + movs r2, 0x58 + adds r0, r7, 0 + muls r0, r2 + adds r1, r0, r3 + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + beq _08043FB6 + ldrh r0, [r1, 0x28] + cmp r0, 0 + beq _08043FB6 + mov r5, r8 + strb r7, [r5] + adds r1, r4, 0 + muls r1, r2 + adds r1, r3 + ldrb r0, [r5] + muls r0, r2 + adds r0, r3 + adds r0, 0x20 + ldrb r0, [r0] + adds r1, 0x20 + strb r0, [r1] + ldrb r0, [r5] + muls r0, r2 + adds r0, r3 + adds r0, 0x20 + ldrb r0, [r0] + b _08043FA8 + .pool +_08043F84: + mov r2, r8 + strb r6, [r2] + movs r3, 0x58 + adds r0, r6, 0 + muls r0, r3 + ldr r5, =0x02024084 + adds r0, r5 + adds r2, r0, 0 + adds r2, 0x20 + ldrb r1, [r2] + cmp r1, 0 + beq _08043FB6 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08043FB6 + ldr r0, [sp, 0x1C] + strb r1, [r0] + ldrb r0, [r2] +_08043FA8: + ldr r1, =0x0202420a + strb r0, [r1] +_08043FAC: + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_08043FB6: + mov r2, r9 + cmp r2, 0 + beq _08043FBE + b _08044340 +_08043FBE: + ldr r3, [sp, 0x1C] + adds r3, 0x58 + str r3, [sp, 0x1C] + ldr r5, [sp, 0x20] + adds r5, 0x4 + str r5, [sp, 0x20] + adds r4, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + bge _08043FD6 + b _08043E22 +_08043FD6: + b _0804441E + .pool +_08043FE4: + movs r4, 0 + ldr r0, =0x0202406c + ldrb r1, [r0] + cmp r4, r1 + blt _08043FF0 + b _0804441E +_08043FF0: + ldr r0, =0x02024084 + adds r5, r1, 0 + ldr r2, =0x020242ac + adds r3, r0, 0 + adds r3, 0x20 + movs r6, 0x80 + lsls r6, 12 +_08043FFE: + ldrb r1, [r3] + cmp r1, 0x16 + bne _0804400E + ldr r0, [r2] + ands r0, r6 + cmp r0, 0 + beq _0804400E + b _080443B4 +_0804400E: + adds r2, 0x4 + adds r3, 0x58 + adds r4, 0x1 + cmp r4, r5 + blt _08043FFE + b _0804441E + .pool +_08044028: + mov r0, r10 + bl battle_side_get_owner + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _0804403E + b _0804441E +_0804403E: + ldr r7, =0x02024084 +_08044040: + lsls r0, r4, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + adds r3, r4, 0x1 + cmp r0, r5 + beq _0804406A + movs r0, 0x58 + muls r0, r4 + adds r0, r7 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, r6 + bne _0804406A + ldr r0, =0x0202420a + strb r6, [r0] + lsls r0, r3, 24 + lsrs r0, 24 + mov r9, r0 +_0804406A: + adds r4, r3, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _08044040 + b _0804441E + .pool +_08044084: + mov r0, r10 + bl battle_side_get_owner + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _0804409A + b _0804441E +_0804409A: + ldr r7, =0x02024084 +_0804409C: + lsls r0, r4, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + adds r3, r4, 0x1 + cmp r0, r5 + bne _080440C6 + movs r0, 0x58 + muls r0, r4 + adds r0, r7 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, r6 + bne _080440C6 + ldr r0, =0x0202420a + strb r6, [r0] + lsls r0, r3, 24 + lsrs r0, 24 + mov r9, r0 +_080440C6: + adds r4, r3, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _0804409C + b _0804441E + .pool +_080440E0: + ldrb r0, [r7] + cmp r0, 0xFD + beq _08044104 + cmp r0, 0xFE + beq _0804413C + movs r4, 0 + ldr r0, =0x0202406c + adds r5, r0, 0 + ldrb r0, [r5] + cmp r4, r0 + blt _080440F8 + b _0804441E +_080440F8: + ldr r2, =0x02024084 + b _08044174 + .pool +_08044104: + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _08044110 + b _0804441E +_08044110: + ldr r5, =0x020242ac + movs r2, 0x80 + lsls r2, 9 + adds r1, r0, 0 +_08044118: + lsls r0, r4, 2 + adds r0, r5 + ldr r0, [r0] + ands r0, r2 + adds r3, r4, 0x1 + cmp r0, 0 + beq _0804412C + lsls r0, r3, 24 + lsrs r0, 24 + mov r9, r0 +_0804412C: + adds r4, r3, 0 + cmp r4, r1 + blt _08044118 + b _0804441E + .pool +_0804413C: + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _08044148 + b _0804441E +_08044148: + ldr r5, =0x020242ac + movs r2, 0x80 + lsls r2, 10 + adds r1, r0, 0 +_08044150: + lsls r0, r4, 2 + adds r0, r5 + ldr r0, [r0] + ands r0, r2 + adds r3, r4, 0x1 + cmp r0, 0 + beq _08044164 + lsls r0, r3, 24 + lsrs r0, 24 + mov r9, r0 +_08044164: + adds r4, r3, 0 + cmp r4, r1 + blt _08044150 + b _0804441E + .pool +_08044174: + movs r0, 0x58 + muls r0, r4 + adds r0, r2 + adds r0, 0x20 + ldrb r0, [r0] + adds r3, r4, 0x1 + cmp r0, r6 + bne _0804418C + strb r6, [r7] + lsls r0, r3, 24 + lsrs r0, 24 + mov r9, r0 +_0804418C: + adds r4, r3, 0 + ldrb r1, [r5] + cmp r4, r1 + blt _08044174 + b _0804441E +_08044196: + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _080441A2 + b _0804441E +_080441A2: + ldr r2, =0x02024084 + mov r8, r2 + adds r2, r0, 0 + movs r5, 0x58 +_080441AA: + adds r0, r4, 0 + muls r0, r5 + mov r3, r8 + adds r1, r0, r3 + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + adds r3, r4, 0x1 + cmp r0, r6 + bne _080441CC + ldrh r0, [r1, 0x28] + cmp r0, 0 + beq _080441CC + strb r6, [r7] + lsls r0, r3, 24 + lsrs r0, 24 + mov r9, r0 +_080441CC: + adds r4, r3, 0 + cmp r4, r2 + blt _080441AA + b _0804441E + .pool +_080441DC: + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _080441E8 + b _0804441E +_080441E8: + ldr r7, =0x02024084 + adds r1, r0, 0 + movs r5, 0x58 + ldr r2, =0x0202420a +_080441F0: + adds r0, r4, 0 + muls r0, r5 + adds r0, r7 + adds r0, 0x20 + ldrb r0, [r0] + adds r3, r4, 0x1 + cmp r0, r6 + bne _0804420C + cmp r4, r10 + beq _0804420C + strb r6, [r2] + lsls r0, r3, 24 + lsrs r0, 24 + mov r9, r0 +_0804420C: + adds r4, r3, 0 + cmp r4, r1 + blt _080441F0 + b _0804441E + .pool +_08044220: + mov r0, r10 + bl battle_side_get_owner + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _08044236 + b _0804441E +_08044236: + ldr r7, =0x02024084 +_08044238: + lsls r0, r4, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + beq _08044264 + movs r0, 0x58 + muls r0, r4 + adds r0, r7 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, r6 + bne _08044264 + ldr r0, =0x0202420a + strb r6, [r0] + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_08044264: + adds r4, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _08044238 + b _0804441E + .pool +_0804427C: + mov r0, r10 + bl battle_side_get_owner + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _08044292 + b _0804441E +_08044292: + ldr r7, =0x02024084 +_08044294: + lsls r0, r4, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + bne _080442C0 + movs r0, 0x58 + muls r0, r4 + adds r0, r7 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, r6 + bne _080442C0 + ldr r0, =0x0202420a + strb r6, [r0] + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080442C0: + adds r4, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _08044294 + b _0804441E + .pool +_080442D8: + ldr r0, =gUnknown_082DB4A9 + bl b_push_move_exec + ldr r0, =0x02024474 + strb r6, [r0, 0x17] +_080442E2: + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x7F + mov r1, r9 + subs r1, 0x1 + strb r1, [r0] + b _0804441E + .pool +_080442FC: + ldr r0, =gUnknown_082DB4A9 + bl b_push_move_exec + ldr r0, =0x02024474 + mov r5, r10 + strb r5, [r0, 0x17] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x7F + mov r1, r9 + subs r1, 0x1 + strb r1, [r0] + b _0804443A + .pool +_08044324: + strb r1, [r7] + ldr r0, [r2] + ldr r1, =0xfff7ffff + ands r0, r1 + str r0, [r2] + ldr r0, =gUnknown_082DB4B8 + bl b_push_move_exec + b _080443C8 + .pool +_08044340: + ldr r0, =gUnknown_082DB452 + bl b_push_move_exec + ldr r1, =0x020242ac + ldr r0, [sp, 0x18] + adds r1, r0, r1 + ldr r0, [r1] + ldr r2, =0xffefffff + ands r0, r2 + str r0, [r1] + ldr r0, =0x02024474 + strb r4, [r0, 0x17] + ldr r1, =0x02022f58 + movs r4, 0xFD + strb r4, [r1] + movs r0, 0x4 + strb r0, [r1, 0x1] + ldr r2, =0x02024064 + ldrb r0, [r2] + strb r0, [r1, 0x2] + ldr r3, =0x0202406e + ldrb r0, [r2] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x02022f68 + strb r4, [r1] + movs r0, 0x9 + strb r0, [r1, 0x1] + ldr r0, =0x0202420a + ldrb r0, [r0] + strb r0, [r1, 0x2] + movs r0, 0x1 + negs r0, r0 + strb r0, [r1, 0x3] + b _0804441E + .pool +_080443B4: + strb r1, [r7] + ldr r0, [r2] + ldr r1, =0xfff7ffff + ands r0, r1 + str r0, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB4C1 + str r0, [r1] +_080443C8: + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0xD8 + strb r4, [r0] +_080443D0: + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + b _0804441E + .pool +_080443EC: + movs r4, 0 + ldr r0, =0x0202406c + ldrb r1, [r0] + cmp r4, r1 + bge _0804441E + ldr r0, =0x02024084 + adds r2, r1, 0 + adds r1, r0, 0 + adds r1, 0x20 + ldr r3, =0x0202420a +_08044400: + ldrb r0, [r1] + cmp r0, r6 + bne _08044416 + cmp r4, r10 + beq _08044416 + strb r6, [r3] + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_08044416: + adds r1, 0x58 + adds r4, 0x1 + cmp r4, r2 + blt _08044400 +_0804441E: + mov r1, r9 + cmp r1, 0 + beq _0804443A +_08044424: + ldr r2, [sp, 0x4] + cmp r2, 0xB + bhi _0804443A + ldr r1, =0x0202420a + ldrb r0, [r1] + cmp r0, 0xFF + beq _0804443A + adds r1, r0, 0 + mov r0, r10 + bl b_history__record_ability_usage_of_player +_0804443A: + mov r0, r9 + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end ability_something + + thumb_func_start b_call_bc_move_exec +b_call_bc_move_exec: @ 8044458 + ldr r1, =0x02024214 + str r0, [r1] + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r2, [r0, 0xC] + adds r3, r2, 0 + adds r3, 0x20 + ldrb r0, [r3] + adds r1, r0, 0x1 + strb r1, [r3] + lsls r0, 24 + lsrs r0, 22 + adds r2, r0 + ldr r1, =0x03005d04 + ldr r0, [r1] + str r0, [r2] + ldr r0, =bc_move_exec_returning + str r0, [r1] + ldr r1, =0x02024083 + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end b_call_bc_move_exec + + thumb_func_start b_push_move_exec +b_push_move_exec: @ 8044498 + push {r4,lr} + adds r4, r0, 0 + bl b_movescr_stack_push_cursor + ldr r0, =0x02024214 + str r4, [r0] + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r2, [r0, 0xC] + adds r3, r2, 0 + adds r3, 0x20 + ldrb r0, [r3] + adds r1, r0, 0x1 + strb r1, [r3] + lsls r0, 24 + lsrs r0, 22 + adds r2, r0 + ldr r1, =0x03005d04 + ldr r0, [r1] + str r0, [r2] + ldr r0, =sub_803E08C + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end b_push_move_exec + + thumb_func_start berry_effects_maybe +berry_effects_maybe: @ 80444DC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + movs r0, 0 + mov r10, r0 + movs r1, 0 + str r1, [sp, 0xC] + add r0, sp, 0x4 + strb r1, [r0] + ldr r4, =0x02024208 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r7 + adds r0, r1 + ldrh r0, [r0, 0x2E] + strh r0, [r4] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _08044534 + ldr r1, =0x02024404 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrb r5, [r0, 0x7] + ldrb r0, [r0, 0x1A] + b _08044548 + .pool +_08044534: + ldrh r0, [r4] + bl itemid_get_x12 + lsls r0, 24 + lsrs r5, r0, 24 + ldrh r0, [r4] + bl itemid_get_quality + lsls r0, 24 + lsrs r0, 24 +_08044548: + mov r9, r0 + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x2E] + str r0, [sp, 0x14] + cmp r0, 0xAF + bne _0804457C + ldr r1, =0x02024404 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r3, [r0, 0x7] + mov r8, r3 + ldrb r0, [r0, 0x1A] + b _08044592 + .pool +_0804457C: + ldr r0, [sp, 0x14] + bl itemid_get_x12 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, [sp, 0x14] + bl itemid_get_quality + lsls r0, 24 + lsrs r0, 24 +_08044592: + str r0, [sp, 0x10] + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r4, [r0, 0x2E] + cmp r4, 0xAF + beq _080445B2 + adds r0, r4, 0 + bl itemid_get_x12 + adds r0, r4, 0 + bl itemid_get_quality +_080445B2: + ldr r0, [sp, 0x8] + cmp r0, 0x4 + bls _080445BC + bl _0804582A +_080445BC: + lsls r0, 2 + ldr r1, =_080445D4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080445D4: + .4byte _080445E8 + .4byte _08044688 + .4byte _0804582A + .4byte _08045280 + .4byte _080456D0 +_080445E8: + cmp r5, 0x17 + beq _08044618 + cmp r5, 0x20 + beq _080445F4 + bl _0804582A +_080445F4: + adds r0, r7, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08044604 + bl _0804582A +_08044604: + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x4A + movs r1, 0x2 + strb r1, [r0] + bl _0804582A + .pool +_08044618: + ldr r1, =0x02024084 + mov r8, r1 + movs r0, 0x58 + adds r1, r7, 0 + muls r1, r0 + mov r0, r8 + adds r0, 0x18 + adds r1, r0 + movs r2, 0x6 + movs r3, 0x7 + mov r10, r3 +_0804462E: + movs r0, 0 + ldrsb r0, [r1, r0] + cmp r0, 0x5 + bgt _0804463C + strb r2, [r1] + movs r5, 0x5 + str r5, [sp, 0xC] +_0804463C: + adds r1, 0x1 + movs r0, 0x1 + negs r0, r0 + add r10, r0 + mov r3, r10 + cmp r3, 0 + bge _0804462E + ldr r5, [sp, 0xC] + cmp r5, 0 + bne _08044654 + bl _0804582A +_08044654: + ldr r0, =0x02024474 + strb r7, [r0, 0x17] + ldr r0, =0x0202420f + strb r7, [r0] + ldr r1, =0x02024064 + ldr r0, =0x0202420b + strb r7, [r0] + strb r7, [r1] + ldr r0, =gUnknown_082DB7AE + bl b_call_bc_move_exec + bl _0804582A + .pool +_08044688: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r7 + adds r0, r1 + ldrh r0, [r0, 0x28] + mov r8, r1 + cmp r0, 0 + bne _0804469C + bl _0804582A +_0804469C: + subs r0, r5, 0x1 + cmp r0, 0x2A + bls _080446A6 + bl _080451D6 +_080446A6: + lsls r0, 2 + ldr r1, =_080446B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080446B8: + .4byte _08044764 + .4byte _08044F44 + .4byte _08045008 + .4byte _08044F74 + .4byte _08044FA8 + .4byte _08044FD8 + .4byte _080447B0 + .4byte _08045044 + .4byte _08045074 + .4byte _0804497C + .4byte _080449FC + .4byte _08044A78 + .4byte _08044B0C + .4byte _08044BA0 + .4byte _08044C34 + .4byte _08044C9C + .4byte _08044CF0 + .4byte _08044D44 + .4byte _08044DAC + .4byte _08044E10 + .4byte _08044E5C + .4byte _080451D6 + .4byte _080448B0 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451A0 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _080451D6 + .4byte _0804491C +_08044764: + movs r0, 0x58 + muls r0, r7 + mov r1, r8 + adds r2, r0, r1 + ldrh r0, [r2, 0x2C] + ldrh r1, [r2, 0x28] + lsrs r0, 1 + cmp r1, r0 + bls _0804477A + bl _080451D6 +_0804477A: + cmp r6, 0 + beq _08044782 + bl _080451D6 +_08044782: + ldr r4, =0x020241f0 + mov r3, r9 + str r3, [r4] + ldrh r3, [r2, 0x28] + mov r5, r9 + adds r0, r3, r5 + ldrh r1, [r2, 0x2C] + cmp r0, r1 + ble _08044798 + subs r0, r1, r3 + str r0, [r4] +_08044798: + ldr r0, [r4] + negs r0, r0 + str r0, [r4] + ldr r0, =gUnknown_082DB7C4 + bl b_call_bc_move_exec + b _08044B02 + .pool +_080447B0: + cmp r6, 0 + beq _080447B8 + bl _080451D6 +_080447B8: + adds r0, r7, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080447DC + ldr r1, =0x0202406e + lsls r0, r7, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + b _080447EA + .pool +_080447DC: + ldr r1, =0x0202406e + lsls r0, r7, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 +_080447EA: + adds r4, r1, r0 + movs r1, 0 + mov r10, r1 + add r5, sp, 0x4 +_080447F2: + mov r1, r10 + adds r1, 0xD + adds r0, r4, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + mov r1, r10 + adds r1, 0x11 + adds r0, r4, 0 + bl pokemon_getattr + strb r0, [r5] + adds r0, r4, 0 + movs r1, 0x15 + bl pokemon_getattr + lsls r0, 24 + lsrs r1, r0, 24 + cmp r6, 0 + beq _08044822 + ldrb r0, [r5] + cmp r0, 0 + beq _0804482C +_08044822: + movs r2, 0x1 + add r10, r2 + mov r3, r10 + cmp r3, 0x3 + ble _080447F2 +_0804482C: + mov r5, r10 + cmp r5, 0x4 + bne _08044836 + bl _080451D6 +_08044836: + lsls r2, r5, 24 + lsrs r2, 24 + adds r0, r6, 0 + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r2, r0, 24 + add r0, sp, 0x4 + ldrb r0, [r0] + mov r3, r9 + adds r1, r0, r3 + cmp r1, r2 + ble _08044860 + add r0, sp, 0x4 + strb r2, [r0] + b _08044864 + .pool +_08044860: + add r0, sp, 0x4 + strb r1, [r0] +_08044864: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + strb r6, [r1, 0x2] + lsrs r0, r6, 8 + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r0, =gUnknown_082DB7E1 + bl b_call_bc_move_exec + mov r1, r10 + adds r1, 0x9 + lsls r1, 24 + lsrs r1, 24 + add r5, sp, 0x4 + str r5, [sp] + movs r0, 0 + movs r2, 0 + movs r3, 0x1 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + movs r0, 0x3 + str r0, [sp, 0xC] + bl _080451DE + .pool +_080448B0: + ldr r0, =0x02024084 + movs r1, 0x58 + muls r1, r7 + adds r0, 0x18 + adds r1, r0 + movs r2, 0x6 + movs r3, 0x7 + mov r10, r3 +_080448C0: + movs r0, 0 + ldrsb r0, [r1, r0] + cmp r0, 0x5 + bgt _080448CE + strb r2, [r1] + movs r5, 0x5 + str r5, [sp, 0xC] +_080448CE: + adds r1, 0x1 + movs r0, 0x1 + negs r0, r0 + add r10, r0 + mov r3, r10 + cmp r3, 0 + bge _080448C0 + movs r5, 0x8 + mov r10, r5 + ldr r0, [sp, 0xC] + cmp r0, 0 + bne _080448EA + bl _0804582A +_080448EA: + ldr r0, =0x02024474 + strb r7, [r0, 0x17] + ldr r0, =0x0202420f + strb r7, [r0] + ldr r1, =0x02024064 + ldr r0, =0x0202420b + strb r7, [r0] + strb r7, [r1] + ldr r0, =gUnknown_082DB7AE + bl b_call_bc_move_exec + bl _080451D6 + .pool +_0804491C: + movs r0, 0x58 + muls r0, r7 + mov r2, r8 + adds r1, r0, r2 + ldrh r0, [r1, 0x28] + ldrh r3, [r1, 0x2C] + cmp r0, r3 + bcc _08044930 + bl _080451D6 +_08044930: + cmp r6, 0 + beq _08044938 + bl _080451D6 +_08044938: + ldr r3, =0x020241f0 + ldrh r0, [r1, 0x2C] + lsrs r0, 4 + str r0, [r3] + cmp r0, 0 + bne _08044948 + movs r0, 0x1 + str r0, [r3] +_08044948: + ldrh r2, [r1, 0x28] + ldr r0, [r3] + adds r0, r2, r0 + ldrh r1, [r1, 0x2C] + cmp r0, r1 + ble _08044958 + subs r0, r1, r2 + str r0, [r3] +_08044958: + ldr r0, [r3] + negs r0, r0 + str r0, [r3] + ldr r0, =gUnknown_082DB7F1 + bl b_call_bc_move_exec + movs r0, 0x4 + str r0, [sp, 0xC] + adds r0, r7, 0 + adds r1, r5, 0 + bl b_history__record_item_x12_of_player + bl _080451D6 + .pool +_0804497C: + movs r0, 0x58 + adds r1, r7, 0 + muls r1, r0 + str r1, [sp, 0x18] + adds r4, r1, 0 + add r4, r8 + ldrh r0, [r4, 0x2C] + ldrh r1, [r4, 0x28] + lsrs r0, 1 + cmp r1, r0 + bls _08044996 + bl _080451D6 +_08044996: + cmp r6, 0 + beq _0804499E + bl _080451D6 +_0804499E: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x8 + strb r0, [r1, 0x1] + strb r6, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r5, =0x020241f0 + ldrh r0, [r4, 0x2C] + mov r1, r9 + bl __divsi3 + str r0, [r5] + cmp r0, 0 + bne _080449C2 + movs r0, 0x1 + str r0, [r5] +_080449C2: + ldrh r2, [r4, 0x28] + ldr r0, [r5] + adds r0, r2, r0 + ldrh r1, [r4, 0x2C] + cmp r0, r1 + ble _080449D2 + subs r0, r1, r2 + str r0, [r5] +_080449D2: + ldr r0, [r5] + negs r0, r0 + str r0, [r5] + mov r0, r8 + adds r0, 0x48 + ldr r2, [sp, 0x18] + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0 + bl sub_806E880 + lsls r0, 24 + cmp r0, 0 + bge _080449F0 + b _08044B7C +_080449F0: + b _08044B90 + .pool +_080449FC: + movs r0, 0x58 + adds r5, r7, 0 + muls r5, r0 + str r5, [sp, 0x1C] + add r5, r8 + ldrh r0, [r5, 0x2C] + ldrh r1, [r5, 0x28] + lsrs r0, 1 + cmp r1, r0 + bls _08044A14 + bl _080451D6 +_08044A14: + cmp r6, 0 + beq _08044A1C + bl _080451D6 +_08044A1C: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x8 + strb r0, [r1, 0x1] + movs r6, 0x1 + strb r6, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r4, =0x020241f0 + ldrh r0, [r5, 0x2C] + mov r1, r9 + bl __divsi3 + str r0, [r4] + cmp r0, 0 + bne _08044A40 + str r6, [r4] +_08044A40: + ldrh r2, [r5, 0x28] + ldr r0, [r4] + adds r0, r2, r0 + ldrh r1, [r5, 0x2C] + cmp r0, r1 + ble _08044A50 + subs r0, r1, r2 + str r0, [r4] +_08044A50: + ldr r0, [r4] + negs r0, r0 + str r0, [r4] + mov r0, r8 + adds r0, 0x48 + ldr r1, [sp, 0x1C] + adds r0, r1, r0 + ldr r0, [r0] + movs r1, 0x1 + bl sub_806E880 + lsls r0, 24 + cmp r0, 0 + bge _08044A6E + b _08044C0E +_08044A6E: + b _08044C24 + .pool +_08044A78: + movs r0, 0x58 + adds r3, r7, 0 + muls r3, r0 + str r3, [sp, 0x20] + adds r5, r3, 0 + add r5, r8 + ldrh r0, [r5, 0x2C] + ldrh r1, [r5, 0x28] + lsrs r0, 1 + cmp r1, r0 + bls _08044A90 + b _080451D6 +_08044A90: + cmp r6, 0 + beq _08044A96 + b _080451D6 +_08044A96: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x8 + strb r0, [r1, 0x1] + movs r0, 0x2 + strb r0, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r4, =0x020241f0 + ldrh r0, [r5, 0x2C] + mov r1, r9 + bl __divsi3 + str r0, [r4] + cmp r0, 0 + bne _08044ABC + movs r0, 0x1 + str r0, [r4] +_08044ABC: + ldrh r2, [r5, 0x28] + ldr r0, [r4] + adds r0, r2, r0 + ldrh r1, [r5, 0x2C] + cmp r0, r1 + ble _08044ACC + subs r0, r1, r2 + str r0, [r4] +_08044ACC: + ldr r0, [r4] + negs r0, r0 + str r0, [r4] + mov r0, r8 + adds r0, 0x48 + ldr r5, [sp, 0x20] + adds r0, r5, r0 + ldr r0, [r0] + movs r1, 0x2 + bl sub_806E880 + lsls r0, 24 + cmp r0, 0 + bge _08044AFC + ldr r0, =gUnknown_082DB824 + bl b_call_bc_move_exec + b _08044B02 + .pool +_08044AFC: + ldr r0, =gUnknown_082DB7C4 + bl b_call_bc_move_exec +_08044B02: + movs r0, 0x4 + str r0, [sp, 0xC] + b _080451DE + .pool +_08044B0C: + movs r0, 0x58 + adds r1, r7, 0 + muls r1, r0 + str r1, [sp, 0x24] + adds r5, r1, 0 + add r5, r8 + ldrh r0, [r5, 0x2C] + ldrh r1, [r5, 0x28] + lsrs r0, 1 + cmp r1, r0 + bls _08044B24 + b _080451D6 +_08044B24: + cmp r6, 0 + beq _08044B2A + b _080451D6 +_08044B2A: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x8 + strb r0, [r1, 0x1] + movs r0, 0x3 + strb r0, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r4, =0x020241f0 + ldrh r0, [r5, 0x2C] + mov r1, r9 + bl __divsi3 + str r0, [r4] + cmp r0, 0 + bne _08044B50 + movs r0, 0x1 + str r0, [r4] +_08044B50: + ldrh r2, [r5, 0x28] + ldr r0, [r4] + adds r0, r2, r0 + ldrh r1, [r5, 0x2C] + cmp r0, r1 + ble _08044B60 + subs r0, r1, r2 + str r0, [r4] +_08044B60: + ldr r0, [r4] + negs r0, r0 + str r0, [r4] + mov r0, r8 + adds r0, 0x48 + ldr r2, [sp, 0x24] + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0x3 + bl sub_806E880 + lsls r0, 24 + cmp r0, 0 + bge _08044B90 +_08044B7C: + ldr r0, =gUnknown_082DB824 + bl b_call_bc_move_exec + b _08044B96 + .pool +_08044B90: + ldr r0, =gUnknown_082DB7C4 + bl b_call_bc_move_exec +_08044B96: + movs r3, 0x4 + str r3, [sp, 0xC] + b _080451DE + .pool +_08044BA0: + movs r0, 0x58 + adds r5, r7, 0 + muls r5, r0 + str r5, [sp, 0x28] + add r5, r8 + ldrh r0, [r5, 0x2C] + ldrh r1, [r5, 0x28] + lsrs r0, 1 + cmp r1, r0 + bls _08044BB6 + b _080451D6 +_08044BB6: + cmp r6, 0 + beq _08044BBC + b _080451D6 +_08044BBC: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x8 + strb r0, [r1, 0x1] + movs r0, 0x4 + strb r0, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r4, =0x020241f0 + ldrh r0, [r5, 0x2C] + mov r1, r9 + bl __divsi3 + str r0, [r4] + cmp r0, 0 + bne _08044BE2 + movs r0, 0x1 + str r0, [r4] +_08044BE2: + ldrh r2, [r5, 0x28] + ldr r0, [r4] + adds r0, r2, r0 + ldrh r1, [r5, 0x2C] + cmp r0, r1 + ble _08044BF2 + subs r0, r1, r2 + str r0, [r4] +_08044BF2: + ldr r0, [r4] + negs r0, r0 + str r0, [r4] + mov r0, r8 + adds r0, 0x48 + ldr r1, [sp, 0x28] + adds r0, r1, r0 + ldr r0, [r0] + movs r1, 0x4 + bl sub_806E880 + lsls r0, 24 + cmp r0, 0 + bge _08044C24 +_08044C0E: + ldr r0, =gUnknown_082DB824 + bl b_call_bc_move_exec + b _08044C2A + .pool +_08044C24: + ldr r0, =gUnknown_082DB7C4 + bl b_call_bc_move_exec +_08044C2A: + movs r2, 0x4 + str r2, [sp, 0xC] + b _080451DE + .pool +_08044C34: + movs r0, 0x58 + muls r0, r7 + mov r3, r8 + adds r5, r0, r3 + ldrh r4, [r5, 0x28] + ldrh r0, [r5, 0x2C] + mov r1, r9 + bl __divsi3 + cmp r4, r0 + ble _08044C4C + b _080451D6 +_08044C4C: + cmp r6, 0 + beq _08044C52 + b _080451D6 +_08044C52: + movs r0, 0x19 + ldrsb r0, [r5, r0] + cmp r0, 0xB + ble _08044C5C + b _080451D6 +_08044C5C: + ldr r1, =0x02022f58 + movs r2, 0xFD + strb r2, [r1] + movs r0, 0x5 + strb r0, [r1, 0x1] + movs r0, 0x1 + strb r0, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r1, =0x02022f68 + strb r2, [r1] + strb r6, [r1, 0x1] + movs r0, 0xD2 + strb r0, [r1, 0x2] + strb r6, [r1, 0x3] + subs r0, 0xD3 + strb r0, [r1, 0x4] + ldr r0, =0x0202420e + strb r7, [r0] + ldr r1, =0x02024474 + movs r0, 0x11 + strb r0, [r1, 0x1A] + movs r0, 0xF + b _08044DF0 + .pool +_08044C9C: + movs r0, 0x58 + muls r0, r7 + mov r1, r8 + adds r5, r0, r1 + ldrh r4, [r5, 0x28] + ldrh r0, [r5, 0x2C] + mov r1, r9 + bl __divsi3 + cmp r4, r0 + ble _08044CB4 + b _080451D6 +_08044CB4: + cmp r6, 0 + beq _08044CBA + b _080451D6 +_08044CBA: + movs r0, 0x1A + ldrsb r0, [r5, r0] + cmp r0, 0xB + ble _08044CC4 + b _080451D6 +_08044CC4: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x5 + strb r0, [r1, 0x1] + movs r0, 0x2 + strb r0, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r0, =0x0202420e + strb r7, [r0] + ldr r1, =0x02024474 + movs r0, 0x12 + strb r0, [r1, 0x1A] + movs r0, 0x10 + b _08044D8A + .pool +_08044CF0: + movs r0, 0x58 + muls r0, r7 + mov r3, r8 + adds r5, r0, r3 + ldrh r4, [r5, 0x28] + ldrh r0, [r5, 0x2C] + mov r1, r9 + bl __divsi3 + cmp r4, r0 + ble _08044D08 + b _080451D6 +_08044D08: + cmp r6, 0 + beq _08044D0E + b _080451D6 +_08044D0E: + movs r0, 0x1B + ldrsb r0, [r5, r0] + cmp r0, 0xB + ble _08044D18 + b _080451D6 +_08044D18: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x5 + strb r0, [r1, 0x1] + movs r0, 0x3 + strb r0, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r0, =0x0202420e + strb r7, [r0] + ldr r1, =0x02024474 + movs r0, 0x13 + strb r0, [r1, 0x1A] + movs r0, 0x11 + b _08044DF0 + .pool +_08044D44: + movs r0, 0x58 + muls r0, r7 + mov r1, r8 + adds r5, r0, r1 + ldrh r4, [r5, 0x28] + ldrh r0, [r5, 0x2C] + mov r1, r9 + bl __divsi3 + cmp r4, r0 + ble _08044D5C + b _080451D6 +_08044D5C: + cmp r6, 0 + beq _08044D62 + b _080451D6 +_08044D62: + movs r0, 0x1C + ldrsb r0, [r5, r0] + cmp r0, 0xB + ble _08044D6C + b _080451D6 +_08044D6C: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x5 + strb r0, [r1, 0x1] + movs r0, 0x4 + strb r0, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r0, =0x0202420e + strb r7, [r0] + ldr r1, =0x02024474 + movs r0, 0x14 + strb r0, [r1, 0x1A] + movs r0, 0x12 +_08044D8A: + strb r0, [r1, 0x10] + strb r6, [r1, 0x11] + ldr r0, =gUnknown_082DB84E + bl b_call_bc_move_exec + movs r2, 0x5 + str r2, [sp, 0xC] + b _080451DE + .pool +_08044DAC: + movs r0, 0x58 + muls r0, r7 + mov r3, r8 + adds r5, r0, r3 + ldrh r4, [r5, 0x28] + ldrh r0, [r5, 0x2C] + mov r1, r9 + bl __divsi3 + cmp r4, r0 + ble _08044DC4 + b _080451D6 +_08044DC4: + cmp r6, 0 + beq _08044DCA + b _080451D6 +_08044DCA: + movs r0, 0x1D + ldrsb r0, [r5, r0] + cmp r0, 0xB + ble _08044DD4 + b _080451D6 +_08044DD4: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x5 + strb r0, [r1, 0x1] + strb r0, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r0, =0x0202420e + strb r7, [r0] + ldr r1, =0x02024474 + movs r0, 0x15 + strb r0, [r1, 0x1A] + movs r0, 0x13 +_08044DF0: + strb r0, [r1, 0x10] + strb r6, [r1, 0x11] + ldr r0, =gUnknown_082DB84E + bl b_call_bc_move_exec + movs r5, 0x5 + str r5, [sp, 0xC] + b _080451DE + .pool +_08044E10: + movs r0, 0x58 + adds r5, r7, 0 + muls r5, r0 + mov r1, r8 + adds r0, r5, r1 + ldrh r4, [r0, 0x28] + ldrh r0, [r0, 0x2C] + mov r1, r9 + bl __divsi3 + cmp r4, r0 + ble _08044E2A + b _080451D6 +_08044E2A: + cmp r6, 0 + beq _08044E30 + b _080451D6 +_08044E30: + mov r0, r8 + adds r0, 0x50 + adds r1, r5, r0 + ldr r2, [r1] + movs r3, 0x80 + lsls r3, 13 + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + beq _08044E46 + b _080451D6 +_08044E46: + orrs r2, r3 + str r2, [r1] + ldr r0, =gUnknown_082DB869 + bl b_call_bc_move_exec + movs r2, 0x2 + str r2, [sp, 0xC] + b _080451DE + .pool +_08044E5C: + cmp r6, 0 + beq _08044E62 + b _080451D6 +_08044E62: + movs r0, 0x58 + adds r5, r7, 0 + muls r5, r0 + mov r3, r8 + adds r0, r5, r3 + ldrh r4, [r0, 0x28] + ldrh r0, [r0, 0x2C] + mov r1, r9 + bl __divsi3 + cmp r4, r0 + ble _08044E7C + b _080451D6 +_08044E7C: + movs r0, 0 + mov r10, r0 + adds r0, r5, 0x1 + mov r1, r8 + adds r1, 0x18 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0xB + ble _08044EAC + mov r0, r8 + adds r0, 0x19 + adds r1, r5, r0 +_08044E98: + adds r1, 0x1 + movs r2, 0x1 + add r10, r2 + mov r3, r10 + cmp r3, 0x4 + bgt _08044EAC + movs r0, 0 + ldrsb r0, [r1, r0] + cmp r0, 0xB + bgt _08044E98 +_08044EAC: + mov r5, r10 + cmp r5, 0x5 + bne _08044EB4 + b _080451D6 +_08044EB4: + movs r0, 0x58 + muls r0, r7 + adds r4, r0, 0x1 + ldr r5, =0x0202409c +_08044EBC: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x5 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + adds r0, r4 + adds r0, r5 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0xC + beq _08044EBC + ldr r1, =0x02022f58 + movs r2, 0 + movs r3, 0xFD + strb r3, [r1] + movs r0, 0x5 + strb r0, [r1, 0x1] + mov r0, r10 + adds r0, 0x1 + strb r0, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r0, =0x02022f68 + strb r3, [r0] + strb r2, [r0, 0x1] + movs r1, 0xD1 + strb r1, [r0, 0x2] + strb r2, [r0, 0x3] + strb r2, [r0, 0x4] + movs r1, 0xD2 + strb r1, [r0, 0x5] + strb r2, [r0, 0x6] + subs r1, 0xD3 + strb r1, [r0, 0x7] + ldr r0, =0x0202420e + strb r7, [r0] + ldr r1, =0x02024474 + mov r0, r10 + adds r0, 0x21 + strb r0, [r1, 0x1A] + adds r0, 0x6 + strb r0, [r1, 0x10] + strb r2, [r1, 0x11] + ldr r0, =gUnknown_082DB84E + bl b_call_bc_move_exec + movs r0, 0x5 + str r0, [sp, 0xC] + b _080451DE + .pool +_08044F44: + movs r0, 0x58 + adds r1, r7, 0 + muls r1, r0 + mov r0, r8 + adds r0, 0x4C + adds r1, r0 + ldr r2, [r1] + movs r0, 0x40 + ands r0, r2 + cmp r0, 0 + bne _08044F5C + b _080451D6 +_08044F5C: + movs r0, 0x41 + negs r0, r0 + ands r2, r0 + str r2, [r1] + ldr r0, =gUnknown_082DB706 + bl b_call_bc_move_exec + movs r1, 0x1 + str r1, [sp, 0xC] + b _080451DE + .pool +_08044F74: + movs r0, 0x58 + adds r1, r7, 0 + muls r1, r0 + mov r0, r8 + adds r0, 0x4C + adds r1, r0 + ldr r2, [r1] + movs r0, 0x88 + ands r0, r2 + cmp r0, 0 + bne _08044F8C + b _080451D6 +_08044F8C: + ldr r0, =0xfffff077 + ands r2, r0 + str r2, [r1] + ldr r0, =gUnknown_082DB71E + bl b_call_bc_move_exec + movs r2, 0x1 + str r2, [sp, 0xC] + b _080451DE + .pool +_08044FA8: + movs r0, 0x58 + adds r1, r7, 0 + muls r1, r0 + mov r0, r8 + adds r0, 0x4C + adds r1, r0 + ldr r2, [r1] + movs r0, 0x10 + ands r0, r2 + cmp r0, 0 + bne _08044FC0 + b _080451D6 +_08044FC0: + movs r0, 0x11 + negs r0, r0 + ands r2, r0 + str r2, [r1] + ldr r0, =gUnknown_082DB736 + bl b_call_bc_move_exec + movs r3, 0x1 + str r3, [sp, 0xC] + b _080451DE + .pool +_08044FD8: + movs r0, 0x58 + adds r1, r7, 0 + muls r1, r0 + mov r0, r8 + adds r0, 0x4C + adds r1, r0 + ldr r2, [r1] + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + bne _08044FF0 + b _080451D6 +_08044FF0: + movs r0, 0x21 + negs r0, r0 + ands r2, r0 + str r2, [r1] + ldr r0, =gUnknown_082DB74E + bl b_call_bc_move_exec + movs r5, 0x1 + str r5, [sp, 0xC] + b _080451DE + .pool +_08045008: + movs r0, 0x58 + adds r3, r7, 0 + muls r3, r0 + mov r0, r8 + adds r0, 0x4C + adds r2, r3, r0 + ldr r1, [r2] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _08045020 + b _080451D6 +_08045020: + movs r0, 0x8 + negs r0, r0 + ands r1, r0 + str r1, [r2] + mov r1, r8 + adds r1, 0x50 + adds r1, r3, r1 + ldr r0, [r1] + ldr r2, =0xf7ffffff + ands r0, r2 + str r0, [r1] + ldr r0, =gUnknown_082DB766 + b _0804518A + .pool +_08045044: + movs r0, 0x58 + adds r1, r7, 0 + muls r1, r0 + mov r0, r8 + adds r0, 0x50 + adds r1, r0 + ldr r2, [r1] + movs r0, 0x7 + ands r0, r2 + cmp r0, 0 + bne _0804505C + b _080451D6 +_0804505C: + movs r0, 0x8 + negs r0, r0 + ands r2, r0 + str r2, [r1] + ldr r0, =gUnknown_082DB77E + bl b_call_bc_move_exec + movs r1, 0x2 + str r1, [sp, 0xC] + b _080451DE + .pool +_08045074: + movs r0, 0x58 + adds r5, r7, 0 + muls r5, r0 + mov r0, r8 + adds r0, 0x4C + adds r4, r5, r0 + ldr r2, [r4] + ldrb r0, [r4] + cmp r0, 0 + bne _0804509A + mov r0, r8 + adds r0, 0x50 + adds r0, r5, r0 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0804509A + b _080451D6 +_0804509A: + movs r3, 0 + mov r10, r3 + movs r0, 0x88 + ands r2, r0 + cmp r2, 0 + beq _080450B2 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC70 + bl CopyString + movs r0, 0x1 + mov r10, r0 +_080450B2: + ldr r0, [r4] + movs r1, 0x7 + mov r9, r1 + ands r0, r1 + mov r6, r8 + adds r6, 0x50 + cmp r0, 0 + beq _080450D8 + adds r2, r5, r6 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC78 + bl CopyString + movs r2, 0x1 + add r10, r2 +_080450D8: + ldr r0, [r4] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080450EE + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC80 + bl CopyString + movs r3, 0x1 + add r10, r3 +_080450EE: + ldr r0, [r4] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08045104 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC88 + bl CopyString + movs r0, 0x1 + add r10, r0 +_08045104: + ldr r0, [r4] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0804511A + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC90 + bl CopyString + movs r1, 0x1 + add r10, r1 +_0804511A: + adds r0, r5, r6 + ldr r0, [r0] + mov r2, r9 + ands r0, r2 + cmp r0, 0 + beq _08045132 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC98 + bl CopyString + movs r3, 0x1 + add r10, r3 +_08045132: + mov r5, r10 + cmp r5, 0x1 + bgt _08045164 + ldr r1, =0x02024332 + movs r0, 0 + b _08045168 + .pool +_08045164: + ldr r1, =0x02024332 + movs r0, 0x1 +_08045168: + strb r0, [r1, 0x5] + ldr r2, =0x02024084 + movs r0, 0x58 + adds r3, r7, 0 + muls r3, r0 + adds r0, r2, 0 + adds r0, 0x4C + adds r0, r3, r0 + movs r1, 0 + str r1, [r0] + adds r2, 0x50 + adds r3, r2 + ldr r0, [r3] + subs r1, 0x8 + ands r0, r1 + str r0, [r3] + ldr r0, =gUnknown_082DB794 +_0804518A: + bl b_call_bc_move_exec + movs r0, 0x1 + str r0, [sp, 0xC] + b _080451DE + .pool +_080451A0: + movs r0, 0x58 + adds r1, r7, 0 + muls r1, r0 + mov r0, r8 + adds r0, 0x50 + adds r1, r0 + ldr r2, [r1] + movs r0, 0xF0 + lsls r0, 12 + ands r0, r2 + cmp r0, 0 + beq _080451D6 + ldr r0, =0xfff0ffff + ands r2, r0 + str r2, [r1] + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BCA0 + bl CopyString + ldr r0, =gUnknown_082DB794 + bl b_call_bc_move_exec + ldr r1, =0x02024332 + movs r0, 0 + strb r0, [r1, 0x5] + movs r1, 0x2 + str r1, [sp, 0xC] +_080451D6: + ldr r2, [sp, 0xC] + cmp r2, 0 + bne _080451DE + b _0804582A +_080451DE: + ldr r0, =0x02024474 + strb r7, [r0, 0x17] + ldr r0, =0x0202420f + strb r7, [r0] + ldr r4, =0x02024064 + ldr r0, =0x0202420b + strb r7, [r0] + strb r7, [r4] + ldr r3, [sp, 0xC] + cmp r3, 0x1 + beq _08045220 + cmp r3, 0x3 + beq _08045226 + b _0804582A + .pool +_08045220: + movs r0, 0x58 + muls r0, r7 + b _0804568C +_08045226: + ldr r4, =0x02024084 + movs r0, 0x58 + adds r3, r7, 0 + muls r3, r0 + adds r0, r4, 0 + adds r0, 0x50 + adds r0, r3, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + beq _08045242 + b _0804582A +_08045242: + ldr r1, =0x020242bc + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gUnknown_0832A328 + mov r5, r10 + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08045262 + b _0804582A +_08045262: + adds r1, r5, r3 + adds r0, r4, 0 + adds r0, 0x24 + adds r1, r0 + add r0, sp, 0x4 + ldrb r0, [r0] + strb r0, [r1] + b _0804582A + .pool +_08045280: + movs r7, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r7, r0 + bcc _0804528C + b _0804582A +_0804528C: + ldr r4, =0x02024208 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r7 + adds r0, r1 + ldrh r0, [r0, 0x2E] + strh r0, [r4] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _080452C0 + ldr r1, =0x02024404 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 2 + adds r0, r1 + ldrb r5, [r0, 0x7] + b _080452D0 + .pool +_080452C0: + ldrh r0, [r4] + bl itemid_get_x12 + lsls r0, 24 + lsrs r5, r0, 24 + ldrh r0, [r4] + bl itemid_get_quality +_080452D0: + subs r0, r5, 0x2 + cmp r0, 0x1A + bls _080452D8 + b _08045674 +_080452D8: + lsls r0, 2 + ldr r1, =_080452E8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080452E8: + .4byte _08045354 + .4byte _08045444 + .4byte _08045390 + .4byte _080453CC + .4byte _08045408 + .4byte _08045674 + .4byte _0804548C + .4byte _08045520 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045614 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _08045674 + .4byte _080454C8 +_08045354: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r7 + adds r1, 0x4C + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0804536A + b _08045674 +_0804536A: + movs r0, 0x41 + negs r0, r0 + ands r1, r0 + str r1, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB70C + str r0, [r1] + movs r0, 0x1 + str r0, [sp, 0xC] + b _0804567A + .pool +_08045390: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r7 + adds r1, 0x4C + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x88 + ands r0, r1 + cmp r0, 0 + bne _080453A6 + b _08045674 +_080453A6: + ldr r0, =0xfffff077 + ands r1, r0 + str r1, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB724 + str r0, [r1] + movs r1, 0x1 + str r1, [sp, 0xC] + b _0804567A + .pool +_080453CC: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r7 + adds r1, 0x4C + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _080453E2 + b _08045674 +_080453E2: + movs r0, 0x11 + negs r0, r0 + ands r1, r0 + str r1, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB73C + str r0, [r1] + movs r2, 0x1 + str r2, [sp, 0xC] + b _0804567A + .pool +_08045408: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r7 + adds r1, 0x4C + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0804541E + b _08045674 +_0804541E: + movs r0, 0x21 + negs r0, r0 + ands r1, r0 + str r1, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB754 + str r0, [r1] + movs r3, 0x1 + str r3, [sp, 0xC] + b _0804567A + .pool +_08045444: + ldr r2, =0x02024084 + movs r0, 0x58 + adds r4, r7, 0 + muls r4, r0 + adds r0, r2, 0 + adds r0, 0x4C + adds r3, r4, r0 + ldr r1, [r3] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0804545E + b _08045674 +_0804545E: + movs r0, 0x8 + negs r0, r0 + ands r1, r0 + str r1, [r3] + adds r2, 0x50 + adds r2, r4, r2 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB76C + b _080455DC + .pool +_0804548C: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r7 + adds r1, 0x50 + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _080454A2 + b _08045674 +_080454A2: + movs r0, 0x8 + negs r0, r0 + ands r1, r0 + str r1, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB784 + str r0, [r1] + movs r0, 0x2 + str r0, [sp, 0xC] + b _0804567A + .pool +_080454C8: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r7 + adds r1, 0x50 + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0xF0 + lsls r0, 12 + ands r0, r1 + cmp r0, 0 + bne _080454E0 + b _08045674 +_080454E0: + ldr r0, =0xfff0ffff + ands r1, r0 + str r1, [r2] + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BCA0 + bl CopyString + bl b_movescr_stack_push_cursor + ldr r1, =0x02024332 + movs r0, 0 + strb r0, [r1, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB79A + str r0, [r1] + movs r1, 0x2 + str r1, [sp, 0xC] + b _0804567A + .pool +_08045520: + ldr r4, =0x02024084 + movs r0, 0x58 + adds r5, r7, 0 + muls r5, r0 + adds r0, r4, 0 + adds r0, 0x4C + adds r6, r5, r0 + ldr r2, [r6] + ldrb r0, [r6] + cmp r0, 0 + bne _08045548 + adds r0, r4, 0 + adds r0, 0x50 + adds r0, r5, r0 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _08045548 + b _08045674 +_08045548: + movs r0, 0x88 + ands r2, r0 + cmp r2, 0 + beq _08045558 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC70 + bl CopyString +_08045558: + ldr r0, [r6] + movs r2, 0x7 + mov r8, r2 + ands r0, r2 + adds r4, 0x50 + cmp r0, 0 + beq _08045578 + adds r2, r5, r4 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC78 + bl CopyString +_08045578: + ldr r0, [r6] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804558A + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC80 + bl CopyString +_0804558A: + ldr r0, [r6] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0804559C + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC88 + bl CopyString +_0804559C: + ldr r0, [r6] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080455AE + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC90 + bl CopyString +_080455AE: + adds r5, r4 + ldr r0, [r5] + mov r3, r8 + ands r0, r3 + cmp r0, 0 + beq _080455C2 + ldr r0, =0x02022f58 + ldr r1, =gUnknown_0831BC98 + bl CopyString +_080455C2: + movs r4, 0 + str r4, [r6] + ldr r0, [r5] + movs r1, 0x8 + negs r1, r1 + ands r0, r1 + str r0, [r5] + bl b_movescr_stack_push_cursor + ldr r0, =0x02024332 + strb r4, [r0, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB79A +_080455DC: + str r0, [r1] + movs r5, 0x1 + str r5, [sp, 0xC] + b _0804567A + .pool +_08045614: + ldr r0, =0x02024084 + mov r8, r0 + movs r0, 0x58 + adds r1, r7, 0 + muls r1, r0 + mov r0, r8 + adds r0, 0x18 + adds r1, r0 + movs r2, 0x6 + movs r3, 0x7 + mov r10, r3 +_0804562A: + movs r0, 0 + ldrsb r0, [r1, r0] + cmp r0, 0x5 + bgt _08045638 + strb r2, [r1] + movs r5, 0x5 + str r5, [sp, 0xC] +_08045638: + adds r1, 0x1 + movs r0, 0x1 + negs r0, r0 + add r10, r0 + mov r3, r10 + cmp r3, 0 + bge _0804562A + ldr r5, [sp, 0xC] + cmp r5, 0 + beq _080456B8 + ldr r0, =0x02024474 + strb r7, [r0, 0x17] + ldr r0, =0x0202420f + strb r7, [r0] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB7B4 + str r0, [r1] + b _0804582A + .pool +_08045674: + ldr r0, [sp, 0xC] + cmp r0, 0 + beq _080456B8 +_0804567A: + ldr r0, =0x02024474 + strb r7, [r0, 0x17] + ldr r0, =0x0202420f + strb r7, [r0] + ldr r4, =0x02024064 + strb r7, [r4] + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 +_0804568C: + ldr r1, =0x020240d0 + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _0804582A + .pool +_080456B8: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r7, r0 + bcs _080456C8 + b _0804528C +_080456C8: + b _0804582A + .pool +_080456D0: + ldr r7, =0x020241f0 + ldr r0, [r7] + cmp r0, 0 + bne _080456DA + b _0804582A +_080456DA: + mov r1, r8 + cmp r1, 0x1E + beq _080456EC + cmp r1, 0x3E + beq _08045794 + b _0804582A + .pool +_080456EC: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _080456FA + b _0804582A +_080456FA: + ldr r2, =0x0202437c + ldr r4, =0x0202420c + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r1, r0, 2 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08045720 + adds r0, r2, 0 + adds r0, 0xC + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08045720 + b _0804582A +_08045720: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + ldr r2, [sp, 0x10] + cmp r0, r2 + bcs _0804582A + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x8] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0804582A + ldr r2, =0x02024084 + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _0804582A + ldr r1, =0x02024332 + movs r0, 0x8 + strb r0, [r1, 0x3] + bl b_movescr_stack_push_cursor + movs r0, 0 + movs r1, 0 + bl sub_8048760 + bl b_movescr_stack_pop_cursor + b _0804582A + .pool +_08045794: + ldr r0, =0x0202427c + ldrb r0, [r0] + movs r5, 0x29 + ands r5, r0 + cmp r5, 0 + bne _0804582A + ldr r1, =0x0202437c + ldr r4, =0x0202420c + ldrb r2, [r4] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 2 + adds r6, r1, 0x4 + adds r0, r6 + ldr r1, [r0] + cmp r1, 0 + beq _0804582A + ldr r0, =0x0000ffff + cmp r1, r0 + beq _0804582A + ldr r0, =0x0202420b + ldrb r3, [r0] + cmp r3, r2 + beq _0804582A + ldr r2, =0x02024084 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r1, [r0, 0x28] + ldrh r0, [r0, 0x2C] + cmp r1, r0 + beq _0804582A + cmp r1, 0 + beq _0804582A + ldr r0, =0x02024208 + mov r1, sp + ldrh r1, [r1, 0x14] + strh r1, [r0] + ldr r0, =0x0202420f + strb r3, [r0] + ldr r0, =0x02024474 + strb r3, [r0, 0x17] + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ldr r1, [sp, 0x10] + bl __divsi3 + negs r0, r0 + str r0, [r7] + ldrb r1, [r4] + cmp r0, 0 + bne _0804580C + movs r0, 0x1 + negs r0, r0 + str r0, [r7] +_0804580C: + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + str r5, [r0] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB7F7 + str r0, [r1] + ldr r0, [sp, 0xC] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0xC] +_0804582A: + ldr r0, [sp, 0xC] + 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 berry_effects_maybe + + thumb_func_start sub_8045868 +sub_8045868: @ 8045868 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x020242bc + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + movs r2, 0 + strb r2, [r1, 0x10] + ldr r1, =0x02024084 + movs r2, 0x58 + adds r3, r0, 0 + muls r3, r2 + adds r1, 0x50 + adds r3, r1 + ldr r1, [r3] + ldr r2, =0xfdffffff + ands r1, r2 + str r1, [r3] + ldr r1, =0x020242ac + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r2, =0xffffbfff + ands r1, r2 + str r1, [r0] + bx lr + .pool + thumb_func_end sub_8045868 + + thumb_func_start sub_80458B4 +sub_80458B4: @ 80458B4 + push {lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _080458D0 + ldr r1, =gUnknown_0831BD10 + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 +_080458D0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80458B4 + + thumb_func_start sub_80458E0 +sub_80458E0: @ 80458E0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 16 + lsrs r7, r0, 16 + lsls r1, 24 + lsrs r0, r1, 24 + movs r5, 0 + cmp r0, 0 + beq _080458FE + subs r0, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + b _0804590A +_080458FE: + ldr r1, =gBattleMoves + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 2 + adds r0, r1 + ldrb r6, [r0, 0x6] +_0804590A: + cmp r6, 0x40 + bls _08045910 + b _08045C20 +_08045910: + lsls r0, r6, 2 + ldr r1, =_08045924 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08045924: + .4byte _08045A28 + .4byte _08045B28 + .4byte _08045C1C + .4byte _08045C20 + .4byte _08045B40 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045B28 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C1C + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045B28 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045C20 + .4byte _08045B28 +_08045A28: + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x02024294 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r2, r0, r1 + ldrb r0, [r2, 0x8] + cmp r0, 0 + beq _08045A5A + ldr r1, =0x02024084 + ldrb r4, [r2, 0x9] + movs r0, 0x58 + muls r0, r4 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08045A5A + b _08045B70 +_08045A5A: + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r7, 1 + mov r8, r0 +_08045A6A: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x0202406c + ldrb r1, [r1] + bl __modsi3 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, =0x0202420b + ldrb r3, [r6] + cmp r5, r3 + beq _08045A6A + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + beq _08045A6A + ldr r0, =0x02024210 + ldrb r2, [r0] + ldr r1, =gUnknown_0832A328 + lsls r0, r5, 2 + adds r0, r1 + ldr r0, [r0] + ands r2, r0 + cmp r2, 0 + bne _08045A6A + ldr r0, =gBattleMoves + mov r3, r8 + adds r1, r3, r7 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x2] + cmp r0, 0xD + beq _08045AB8 + b _08045C20 +_08045AB8: + ldrb r1, [r6] + str r2, [sp] + movs r0, 0x10 + movs r2, 0x1F + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _08045ACE + b _08045C20 +_08045ACE: + ldr r2, =0x02024084 + movs r1, 0x58 + adds r0, r5, 0 + muls r0, r1 + adds r0, r2 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1F + bne _08045AE2 + b _08045C20 +_08045AE2: + movs r4, 0x2 + eors r5, r4 + adds r0, r5, 0 + muls r0, r1 + adds r0, r2 + adds r0, 0x20 + ldrb r1, [r0] + adds r0, r5, 0 + bl b_history__record_ability_usage_of_player + ldr r1, =0x0202437c + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + orrs r1, r4 + strb r1, [r0] + b _08045C20 + .pool +_08045B28: + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_get_per_side_status + adds r1, r0, 0 + movs r2, 0x1 + movs r0, 0x1 + ands r0, r1 + eors r0, r2 + b _08045BD2 + .pool +_08045B40: + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x02024294 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r2, r0, r1 + ldrb r0, [r2, 0x8] + cmp r0, 0 + beq _08045B80 + ldr r1, =0x02024084 + ldrb r4, [r2, 0x9] + movs r0, 0x58 + muls r0, r4 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08045B80 +_08045B70: + adds r5, r4, 0 + b _08045C20 + .pool +_08045B80: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r4, 0x1 + ands r0, r4 + cmp r0, 0 + beq _08045BFC + movs r0, 0x4 + ands r6, r0 + cmp r6, 0 + beq _08045BFC + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08045BC0 + bl GenerateRandomNumber + adds r1, r4, 0 + ands r1, r0 + cmp r1, 0 + beq _08045BBC + movs r0, 0x1 + b _08045BD2 + .pool +_08045BBC: + movs r0, 0x3 + b _08045BD2 +_08045BC0: + bl GenerateRandomNumber + adds r1, r4, 0 + ands r1, r0 + cmp r1, 0 + beq _08045BD0 + movs r0, 0 + b _08045BD2 +_08045BD0: + movs r0, 0x2 +_08045BD2: + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08045C20 + movs r0, 0x2 + eors r5, r0 + b _08045C20 + .pool +_08045BFC: + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_get_per_side_status + adds r1, r0, 0 + movs r2, 0x1 + movs r0, 0x1 + ands r0, r1 + eors r0, r2 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r5, r0, 24 + b _08045C20 + .pool +_08045C1C: + ldr r0, =0x0202420b + ldrb r5, [r0] +_08045C20: + ldr r0, =0x0202420b + ldrb r0, [r0] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + strb r5, [r0, 0xC] + adds r0, r5, 0 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80458E0 + + thumb_func_start sub_8045C44 +sub_8045C44: @ 8045C44 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08045C8A + ldr r0, =0x0202406e + lsls r4, 1 + adds r5, r4, r0 + ldrh r0, [r5] + movs r7, 0x64 + muls r0, r7 + ldr r6, =0x020244ec + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + movs r1, 0xCD + lsls r1, 1 + cmp r0, r1 + beq _08045C98 + ldrh r0, [r5] + muls r0, r7 + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + cmp r0, 0x97 + beq _08045C98 +_08045C8A: + movs r0, 0x1 + b _08045CAE + .pool +_08045C98: + ldr r0, =0x0202406e + adds r0, r4, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x50 + movs r2, 0 + bl pokemon_getattr +_08045CAE: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8045C44 + + thumb_func_start sub_8045CBC +sub_8045CBC: @ 8045CBC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + movs r6, 0 + ldr r5, =0x02022fec + ldr r0, [r5] + ldr r1, =0x02000002 + ands r0, r1 + cmp r0, 0 + bne _08045DAC + ldr r4, =0x0202420b + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08045DAC + ldrb r0, [r4] + bl sub_8045C44 + cmp r0, 0 + beq _08045D76 + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _08045D08 + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _08045DAC +_08045D08: + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r0, =0x003f0100 + ands r0, r1 + cmp r0, 0 + bne _08045DAC + movs r0, 0x80 + lsls r0, 17 + ands r1, r0 + cmp r1, 0 + bne _08045DAC + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r1, r0 + adds r0, r2, 0 + adds r0, 0x54 + adds r0, r1, r0 + ldr r0, [r0] + adds r2, 0x3C + adds r1, r2 + bl sub_806E8D4 + lsls r0, 24 + cmp r0, 0 + beq _08045DAC + ldr r0, =0x0000086e + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08045DAC + movs r6, 0xA + ldr r0, =0x00000868 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08045D5A + movs r6, 0x1E +_08045D5A: + ldr r0, =0x0000086a + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08045D68 + movs r6, 0x32 +_08045D68: + ldr r0, =0x0000086c + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08045D76 + movs r6, 0x46 +_08045D76: + ldr r5, =0x02024084 + ldr r0, =0x0202420b + mov r8, r0 + ldrb r0, [r0] + movs r7, 0x58 + muls r0, r7 + adds r0, r5 + adds r0, 0x2A + ldrb r0, [r0] + cmp r0, r6 + bls _08045DAC + bl GenerateRandomNumber + movs r1, 0xFF + ands r1, r0 + mov r2, r8 + ldrb r0, [r2] + adds r2, r0, 0 + muls r2, r7 + adds r0, r2, r5 + adds r0, 0x2A + ldrb r0, [r0] + adds r0, r6 + muls r0, r1 + asrs r4, r0, 8 + cmp r4, r6 + bge _08045DD4 +_08045DAC: + movs r0, 0 + b _08045FD0 + .pool +_08045DD4: + ldr r3, =0x020241ea + ldrh r0, [r3] + cmp r0, 0x63 + bne _08045DEA + adds r0, r5, 0 + adds r0, 0x50 + adds r0, r2, r0 + ldr r1, [r0] + ldr r2, =0xff7fffff + ands r1, r2 + str r1, [r0] +_08045DEA: + mov r1, r8 + ldrb r0, [r1] + muls r0, r7 + adds r1, r5, 0 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08045E20 + ldrh r0, [r3] + cmp r0, 0xAD + beq _08045E0A + cmp r0, 0xD6 + bne _08045E20 +_08045E0A: + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB695 + b _08045F7A + .pool +_08045E20: + bl GenerateRandomNumber + movs r5, 0xFF + adds r1, r5, 0 + ands r1, r0 + ldr r7, =0x02024084 + ldr r2, =0x0202420b + mov r9, r2 + ldrb r3, [r2] + movs r0, 0x58 + mov r8, r0 + mov r0, r8 + muls r0, r3 + adds r0, r7 + adds r0, 0x2A + ldrb r2, [r0] + adds r0, r2, r6 + muls r0, r1 + asrs r4, r0, 8 + cmp r4, r6 + bge _08045EE8 + ldr r6, =gUnknown_0832A328 + ldr r5, =0x020241e8 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0] + adds r0, r3, 0 + movs r2, 0xFF + bl sub_803FECC + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bne _08045E68 + b _08045F6A +_08045E68: + ldr r1, =0x020241e9 + mov r8, r1 + movs r7, 0x3 +_08045E6E: + bl GenerateRandomNumber + ands r0, r7 + mov r2, r8 + strb r0, [r2] + strb r0, [r5] + ldrb r0, [r5] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ands r0, r4 + cmp r0, 0 + bne _08045E6E + ldr r4, =0x020241ee + ldr r3, =0x02024084 + ldr r0, =0x020241e8 + ldrb r0, [r0] + lsls r0, 1 + ldr r1, =0x0202420b + ldrb r2, [r1] + movs r1, 0x58 + muls r1, r2 + adds r0, r1 + adds r3, 0xC + adds r0, r3 + ldrh r0, [r0] + strh r0, [r4] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB6A5 + str r0, [r1] + ldrh r0, [r4] + movs r1, 0 + bl sub_80458E0 + ldr r1, =0x0202420c + strb r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 14 + b _08045FCA + .pool +_08045EE8: + subs r0, r2, r6 + lsls r0, 24 + lsrs r6, r0, 24 + bl GenerateRandomNumber + adds r4, r5, 0 + ands r4, r0 + cmp r4, r6 + bge _08045F64 + mov r1, r9 + ldrb r0, [r1] + mov r1, r8 + muls r1, r0 + adds r0, r7, 0 + adds r0, 0x4C + adds r0, r1, r0 + ldr r0, [r0] + ands r0, r5 + cmp r0, 0 + bne _08045F64 + adds r0, r1, r7 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x48 + beq _08045F64 + cmp r0, 0xF + beq _08045F64 + movs r2, 0 + ldr r0, =0x0202406c + ldrb r3, [r0] + mov r8, r0 + cmp r2, r3 + bge _08045F4A + ldr r0, [r7, 0x50] + movs r1, 0x70 + ands r0, r1 + cmp r0, 0 + bne _08045F4A + adds r1, r7, 0 + adds r1, 0x50 + movs r5, 0x70 +_08045F3A: + adds r1, 0x58 + adds r2, 0x1 + cmp r2, r3 + bge _08045F4A + ldr r0, [r1] + ands r0, r5 + cmp r0, 0 + beq _08045F3A +_08045F4A: + mov r0, r8 + ldrb r0, [r0] + cmp r2, r0 + bne _08045F64 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB6D9 + b _08045F7A + .pool +_08045F64: + subs r4, r6 + cmp r4, r6 + blt _08045F8C +_08045F6A: + bl GenerateRandomNumber + ldr r2, =0x02024332 + movs r1, 0x3 + ands r1, r0 + strb r1, [r2, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB6AD +_08045F7A: + str r0, [r1] + movs r0, 0x1 + b _08045FD0 + .pool +_08045F8C: + ldr r4, =0x0202420b + ldrb r1, [r4] + movs r0, 0x58 + muls r1, r0 + ldr r0, =0x02024084 + adds r1, r0 + movs r0, 0x28 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + ldrb r0, [r4] + str r0, [sp, 0x8] + ldrb r0, [r4] + str r0, [sp, 0xC] + adds r0, r1, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_806957C + ldr r1, =0x020241f0 + str r0, [r1] + ldr r1, =0x0202420c + ldrb r0, [r4] + strb r0, [r1] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB6F0 + str r0, [r1] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 12 +_08045FCA: + orrs r0, r1 + str r0, [r2] + movs r0, 0x2 +_08045FD0: + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8045CBC + + thumb_func_start atk00_attackcanceler +atk00_attackcanceler: @ 8045FFC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + ldr r0, =0x0202433a + ldrb r0, [r0] + cmp r0, 0 + beq _08046020 + ldr r1, =0x02024083 + movs r0, 0xC + strb r0, [r1] + b _08046398 + .pool +_08046020: + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08046064 + ldr r2, =0x02024280 + ldr r1, [r2] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + bne _08046064 + movs r0, 0x80 + lsls r0, 12 + orrs r1, r0 + str r1, [r2] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082D8A4E + b _08046396 + .pool +_08046064: + bl sub_8041A6C + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _08046072 + b _08046398 +_08046072: + ldr r0, =0x0202420c + ldrb r1, [r0] + str r2, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _0804608A + b _08046398 +_0804608A: + ldr r4, =0x02024084 + ldr r0, =0x020241e8 + ldrb r1, [r0] + ldr r3, =0x0202420b + ldrb r2, [r3] + movs r0, 0x58 + muls r2, r0 + adds r1, r2 + adds r0, r4, 0 + adds r0, 0x24 + adds r1, r0 + ldrb r0, [r1] + ldr r5, =0x02024280 + cmp r0, 0 + bne _08046108 + ldr r0, =0x020241ea + ldrh r0, [r0] + cmp r0, 0xA5 + beq _08046108 + ldr r0, [r5] + ldr r1, =0x00800200 + ands r0, r1 + cmp r0, 0 + bne _08046108 + adds r0, r4, 0 + adds r0, 0x50 + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + ands r0, r1 + cmp r0, 0 + bne _08046108 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB07A + str r0, [r1] + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + b _08046398 + .pool +_08046108: + ldr r0, [r5] + ldr r1, =0xff7fffff + ands r0, r1 + str r0, [r5] + movs r6, 0x80 + lsls r6, 18 + ands r0, r6 + cmp r0, 0 + bne _08046160 + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + adds r1, r4, 0 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + ands r0, r1 + cmp r0, 0 + bne _08046160 + bl sub_8045CBC + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _08046160 + cmp r2, 0x2 + bne _08046150 + ldr r0, [r5] + orrs r0, r6 + str r0, [r5] + b _08046398 + .pool +_08046150: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + b _08046398 + .pool +_08046160: + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 18 + orrs r0, r1 + str r0, [r2] + ldr r2, =0x0202433c + ldr r1, =0x0202420c + ldrb r3, [r1] + lsls r0, r3, 4 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 27 + mov r8, r1 + mov r9, r2 + cmp r0, 0 + bge _080461E8 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x8] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080461E8 + ldr r0, =0x0202420b + ldrb r0, [r0] + ldr r2, =0x00000115 + adds r1, r3, 0 + bl sub_803F480 + mov r0, r8 + ldrb r1, [r0] + lsls r1, 4 + add r1, r9 + ldrb r2, [r1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB194 + b _08046396 + .pool +_080461E8: + movs r2, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r2, r0 + bge _0804622A + ldr r6, =0x0202433c + ldr r1, =gBattleMoves + mov r12, r1 + adds r5, r0, 0 + ldr r7, =0x0202407e +_080461FC: + adds r4, r2, r7 + ldrb r3, [r4] + lsls r0, r3, 4 + adds r0, r6 + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _08046224 + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + add r0, r12 + ldrb r1, [r0, 0x8] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08046224 + b _08046350 +_08046224: + adds r2, 0x1 + cmp r2, r5 + blt _080461FC +_0804622A: + ldr r0, =0x0202437c + mov r1, r8 + ldrb r2, [r1] + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r3, [r1] + lsls r0, r3, 30 + cmp r0, 0 + bge _08046288 + movs r0, 0x3 + negs r0, r0 + ands r0, r3 + strb r0, [r1] + ldr r4, =0x0202420a + movs r0, 0x1F + strb r0, [r4] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB53E + str r0, [r1] + mov r1, r8 + ldrb r0, [r1] + ldrb r1, [r4] + bl b_history__record_ability_usage_of_player + b _08046398 + .pool +_08046288: + lsls r0, r2, 4 + add r0, r9 + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + bne _08046296 + b _08046390 +_08046296: + ldr r1, =gBattleMoves + ldr r2, =0x020241ea + ldrh r3, [r2] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x8] + movs r0, 0x2 + ands r0, r1 + adds r4, r2, 0 + cmp r0, 0 + beq _08046390 + cmp r3, 0xAE + bne _080462D4 + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r1, r0, r2 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x7 + beq _080462D4 + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x7 + bne _08046390 +_080462D4: + ldrh r0, [r4] + bl sub_8052F48 + lsls r0, 24 + cmp r0, 0 + beq _080462FA + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + ands r0, r1 + cmp r0, 0 + beq _08046390 +_080462FA: + ldr r0, =0x0202420b + ldrb r0, [r0] + bl b_cancel_multi_turn_move_maybe + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024250 + ldr r3, =0x0202420c + ldrb r0, [r3] + lsls r0, 1 + adds r0, r1 + movs r2, 0 + strh r2, [r0] + ldr r1, =0x02024258 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r1 + strh r2, [r0] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x6] + b _08046390 + .pool +_08046350: + ldr r0, =0x0202420b + ldrb r0, [r0] + ldr r2, =0x00000121 + adds r1, r3, 0 + bl sub_803F480 + ldrb r1, [r4] + lsls r1, 4 + adds r1, r6 + ldrb r2, [r1] + movs r0, 0x21 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, =0x02024474 + ldrb r0, [r4] + strb r0, [r1, 0x17] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB1AC + b _08046396 + .pool +_08046390: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 +_08046396: + str r0, [r1] +_08046398: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk00_attackcanceler + + thumb_func_start mcmd_jump_if_move_not_executed +mcmd_jump_if_move_not_executed: @ 80463AC + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r6, r1, 16 + ldr r1, =0x02024214 + ldr r5, [r1] + adds r4, r5, r0 + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _0804640C + ldr r1, =0x02024250 + ldr r3, =0x0202420c + ldrb r0, [r3] + lsls r0, 1 + adds r0, r1 + movs r2, 0 + strh r2, [r0] + ldr r1, =0x02024258 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r1 + strh r2, [r0] + ldrb r4, [r5, 0x1] + ldrb r0, [r5, 0x2] + lsls r0, 8 + orrs r4, r0 + ldrb r0, [r5, 0x3] + lsls r0, 16 + orrs r4, r0 + ldrb r0, [r5, 0x4] + lsls r0, 24 + orrs r4, r0 + b _08046426 + .pool +_0804640C: + bl b_feature_update_destiny_bond + ldr r0, =0x0202420c + ldrb r1, [r0] + str r6, [sp] + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _0804642A +_08046426: + ldr r0, =0x02024214 + str r4, [r0] +_0804642A: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end mcmd_jump_if_move_not_executed + + thumb_func_start atk40_801DBA0 +atk40_801DBA0: @ 804643C + push {lr} + ldr r1, =0x0202433c + ldr r0, =0x0202420c + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + beq _0804649C + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x8] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0804649C + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x5 + movs r1, 0 + bl mcmd_jump_if_move_not_executed + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x6] + b _080464A4 + .pool +_0804649C: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_080464A4: + pop {r0} + bx r0 + .pool + thumb_func_end atk40_801DBA0 + + thumb_func_start sub_80464AC +sub_80464AC: @ 80464AC + push {r4,lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r4, 0 + ldr r1, =0x0202433c + ldr r0, =0x0202420c + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + beq _080464F8 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x8] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080464F8 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x7 + adds r1, r3, 0 + bl mcmd_jump_if_move_not_executed + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x6] + movs r4, 0x1 +_080464F8: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80464AC + + thumb_func_start sub_8046518 +sub_8046518: @ 8046518 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r2, =0x020242ac + ldr r3, =0x0202420c + ldrb r4, [r3] + lsls r0, r4, 2 + adds r0, r2 + ldr r1, [r0] + movs r0, 0x18 + ands r1, r0 + adds r6, r2, 0 + cmp r1, 0 + beq _0804654A + ldr r1, =0x020242bc + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r1 + ldr r1, =0x0202420b + ldrb r0, [r0, 0x15] + ldrb r1, [r1] + cmp r0, r1 + beq _08046634 +_0804654A: + ldr r0, =0x02024280 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 9 + ands r1, r2 + adds r2, r0, 0 + cmp r1, 0 + bne _08046590 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08046590 +_0804656A: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + b _08046634 + .pool +_08046590: + ldr r0, [r2] + ldr r1, =0xfffeffff + ands r0, r1 + str r0, [r2] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + bne _080465B2 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0804656A +_080465B2: + ldr r0, [r2] + ldr r1, =0xfffdffff + ands r0, r1 + str r0, [r2] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + bne _080465D2 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ands r0, r1 + cmp r0, 0 + bne _0804656A +_080465D2: + ldr r0, [r2] + ldr r1, =0xfffbffff + ands r0, r1 + str r0, [r2] + movs r0, 0 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + lsls r4, r5, 1 + cmp r0, 0 + bne _08046622 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _08046622 + ldr r0, =0x020243cc + ldrh r1, [r0] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08046622 + ldr r0, =gBattleMoves + adds r1, r4, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x98 + beq _08046634 +_08046622: + ldr r1, =gBattleMoves + adds r0, r4, r5 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x11 + beq _08046634 + cmp r0, 0x4E + bne _08046654 +_08046634: + movs r0, 0x7 + adds r1, r5, 0 + bl mcmd_jump_if_move_not_executed + movs r0, 0x1 + b _08046656 + .pool +_08046654: + movs r0, 0 +_08046656: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8046518 + + thumb_func_start atk01_accuracycheck +atk01_accuracycheck: @ 8046660 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r0, =0x02024214 + ldr r5, [r0] + ldrb r6, [r5, 0x5] + ldrb r1, [r5, 0x6] + lsls r1, 8 + orrs r6, r1 + adds r1, r6, 0x2 + lsls r1, 16 + lsrs r1, 16 + adds r7, r0, 0 + cmp r1, 0x1 + bhi _0804671C + ldr r2, =0x020242ac + ldr r3, =0x0202420c + ldrb r4, [r3] + lsls r0, r4, 2 + adds r0, r2 + ldr r1, [r0] + movs r0, 0x18 + ands r1, r0 + cmp r1, 0 + beq _080466D0 + ldr r0, =0x0000ffff + cmp r6, r0 + bne _080466D0 + ldr r1, =0x020242bc + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r1 + ldr r1, =0x0202420b + ldrb r0, [r0, 0x15] + ldrb r1, [r1] + cmp r0, r1 + bne _080466D0 + adds r0, r5, 0x7 + str r0, [r7] + b _080469D2 + .pool +_080466D0: + ldrb r0, [r3] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ldr r1, =0x000400c0 + ands r0, r1 + cmp r0, 0 + beq _08046700 + ldr r2, [r7] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r7] + b _080469D2 + .pool +_08046700: + movs r0, 0 + bl sub_80464AC + lsls r0, 24 + cmp r0, 0 + beq _0804670E + b _080469D2 +_0804670E: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x7 + str r0, [r1] + b _080469D2 + .pool +_0804671C: + cmp r6, 0 + bne _08046724 + ldr r0, =0x020241ea + ldrh r6, [r0] +_08046724: + ldr r0, =0x0202449c + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0 + beq _08046744 + movs r1, 0x3F + mov r10, r1 + mov r2, r10 + ands r2, r0 + mov r10, r2 + b _08046752 + .pool +_08046744: + ldr r1, =gBattleMoves + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x2] + mov r10, r0 +_08046752: + adds r0, r6, 0 + bl sub_80464AC + lsls r0, 24 + cmp r0, 0 + beq _08046760 + b _080469D2 +_08046760: + adds r0, r6, 0 + bl sub_8046518 + lsls r0, 24 + cmp r0, 0 + beq _0804676E + b _080469D2 +_0804676E: + ldr r3, =0x02024084 + ldr r0, =0x0202420c + ldrb r0, [r0] + movs r2, 0x58 + adds r4, r0, 0 + muls r4, r2 + adds r0, r3, 0 + adds r0, 0x50 + adds r0, r4, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 22 + ands r0, r1 + cmp r0, 0 + beq _080467A8 + ldr r0, =0x0202420b + ldrb r0, [r0] + muls r0, r2 + adds r0, r3 + ldrb r5, [r0, 0x1E] + b _080467BE + .pool +_080467A8: + ldr r0, =0x0202420b + ldrb r0, [r0] + muls r0, r2 + adds r0, r3 + ldrb r0, [r0, 0x1E] + adds r0, 0x6 + adds r1, r4, r3 + ldrb r1, [r1, 0x1F] + subs r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 +_080467BE: + lsls r0, r5, 24 + cmp r0, 0 + bge _080467C6 + movs r5, 0 +_080467C6: + lsls r0, r5, 24 + asrs r0, 24 + cmp r0, 0xC + ble _080467D0 + movs r5, 0xC +_080467D0: + ldr r1, =gBattleMoves + lsls r4, r6, 1 + adds r0, r4, r6 + lsls r0, 2 + adds r7, r0, r1 + ldrb r3, [r7, 0x3] + mov r8, r3 + movs r0, 0 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + str r4, [sp, 0x4] + cmp r0, 0 + bne _08046822 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _08046822 + ldr r0, =0x020243cc + ldrh r1, [r0] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _08046822 + ldrb r0, [r7] + cmp r0, 0x98 + bne _08046822 + movs r0, 0x32 + mov r8, r0 +_08046822: + ldr r1, =gUnknown_0831C0F4 + lsls r0, r5, 24 + asrs r0, 22 + adds r0, r1 + ldrb r1, [r0] + mov r4, r8 + muls r4, r1 + ldrb r1, [r0, 0x1] + adds r0, r4, 0 + bl __divsi3 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r7, =0x02024084 + ldr r0, =0x0202420b + ldrb r0, [r0] + movs r5, 0x58 + muls r0, r5 + adds r0, r7 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0xE + bne _08046860 + lsls r0, r4, 6 + adds r0, r4 + lsls r0, 1 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r4, r0, 16 +_08046860: + movs r0, 0 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _080468B8 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _080468B8 + ldr r0, =0x0202420c + ldrb r0, [r0] + muls r0, r5 + adds r0, r7 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x8 + bne _080468B8 + ldr r0, =0x020243cc + ldrh r1, [r0] + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + beq _080468B8 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 4 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r4, r0, 16 +_080468B8: + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x20 + ldrb r0, [r0] + mov r9, r2 + cmp r0, 0x37 + bne _080468E4 + mov r1, r10 + cmp r1, 0x8 + bhi _080468E4 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 4 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r4, r0, 16 +_080468E4: + ldr r2, =0x0202420c + mov r8, r2 + ldrb r2, [r2] + movs r7, 0x58 + adds r0, r2, 0 + muls r0, r7 + mov r3, r9 + adds r1, r0, r3 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _08046928 + ldr r1, =0x02024404 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r5, [r0, 0x7] + ldrb r2, [r0, 0x1A] + b _08046944 + .pool +_08046928: + ldrh r0, [r1, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r5, r0, 24 + mov r1, r8 + ldrb r0, [r1] + muls r0, r7 + add r0, r9 + ldrh r0, [r0, 0x2E] + bl itemid_get_quality + lsls r0, 24 + lsrs r2, r0, 24 +_08046944: + ldr r0, =0x0202420f + ldr r1, =0x0202420c + ldrb r1, [r1] + strb r1, [r0] + cmp r5, 0x16 + bne _08046960 + movs r0, 0x64 + subs r0, r2 + muls r0, r4 + movs r1, 0x64 + bl __divsi3 + lsls r0, 16 + lsrs r4, r0, 16 +_08046960: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r0, 0x1 + cmp r0, r4 + ble _080469CA + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080469C0 + ldr r1, =gBattleMoves + ldr r2, [sp, 0x4] + adds r0, r2, r6 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x6] + cmp r0, 0x8 + beq _080469A2 + cmp r0, 0x20 + bne _080469C0 +_080469A2: + ldr r1, =0x02024332 + movs r0, 0x2 + b _080469C4 + .pool +_080469C0: + ldr r1, =0x02024332 + movs r0, 0 +_080469C4: + strb r0, [r1, 0x6] + bl b_wonderguard_and_levitate +_080469CA: + movs r0, 0x7 + adds r1, r6, 0 + bl mcmd_jump_if_move_not_executed +_080469D2: + 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 atk01_accuracycheck + + thumb_func_start atk02_attackstring +atk02_attackstring: @ 80469E8 + push {r4,r5,lr} + ldr r0, =0x02024068 + ldr r5, [r0] + cmp r5, 0 + bne _08046A20 + ldr r4, =0x02024280 + ldr r0, [r4] + movs r1, 0xC0 + lsls r1, 3 + ands r0, r1 + cmp r0, 0 + bne _08046A14 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x4 + bl b_std_message + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 3 + orrs r0, r1 + str r0, [r4] +_08046A14: + ldr r0, =0x02024214 + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + ldr r0, =0x02024332 + strb r5, [r0, 0x7] +_08046A20: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk02_attackstring + + thumb_func_start atk03_ppreduce +atk03_ppreduce: @ 8046A3C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r6, 0x1 + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _08046A54 + b _08046BEE +_08046A54: + ldr r1, =0x0202437c + ldr r2, =0x0202420b + ldrb r3, [r2] + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 26 + lsrs r4, r0, 31 + mov r9, r2 + cmp r4, 0 + bne _08046AF6 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x6] + cmp r0, 0x20 + beq _08046AA6 + cmp r0, 0x20 + bgt _08046AA0 + cmp r0, 0x8 + beq _08046ABC + b _08046AD6 + .pool +_08046AA0: + cmp r0, 0x40 + beq _08046ABC + b _08046AD6 +_08046AA6: + str r4, [sp] + movs r0, 0x12 + adds r1, r3, 0 + movs r2, 0x2E + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0x1 + b _08046AF6 +_08046ABC: + mov r0, r9 + ldrb r1, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x10 + movs r2, 0x2E + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + adds r6, r0 + b _08046AF6 +_08046AD6: + ldr r1, =0x0202420c + mov r2, r9 + ldrb r0, [r2] + ldrb r7, [r1] + cmp r0, r7 + beq _08046AF6 + ldr r2, =0x02024084 + ldrb r1, [r1] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x2E + bne _08046AF6 + adds r6, 0x1 +_08046AF6: + ldr r0, =0x02024280 + ldr r4, [r0] + movs r0, 0xA0 + lsls r0, 4 + ands r4, r0 + cmp r4, 0 + bne _08046BDC + ldr r2, =0x02024084 + ldr r3, =0x020241e8 + ldr r1, =0x0202420b + ldrb r5, [r1] + movs r0, 0x58 + mov r8, r0 + mov r0, r8 + muls r0, r5 + ldrb r7, [r3] + adds r0, r7 + movs r7, 0x24 + adds r7, r2 + mov r12, r7 + add r0, r12 + ldrb r0, [r0] + mov r9, r1 + mov r10, r2 + adds r7, r3, 0 + cmp r0, 0 + beq _08046BDC + ldr r0, =0x0202433c + lsls r1, r5, 4 + adds r1, r0 + ldrb r0, [r1, 0x2] + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1, 0x2] + mov r1, r9 + ldrb r0, [r1] + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + ldrb r1, [r7] + adds r0, r1 + mov r1, r12 + adds r2, r0, r1 + ldrb r0, [r2] + cmp r0, r6 + ble _08046B70 + subs r0, r6 + strb r0, [r2] + b _08046B72 + .pool +_08046B70: + strb r4, [r2] +_08046B72: + mov r2, r9 + ldrb r3, [r2] + movs r4, 0x58 + adds r0, r3, 0 + muls r0, r4 + mov r1, r10 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _08046BDC + ldr r1, =0x020242bc + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gUnknown_0832A328 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08046BDC + ldr r0, =0x02024064 + strb r3, [r0] + ldrb r1, [r7] + adds r1, 0x9 + lsls r1, 24 + lsrs r1, 24 + mov r2, r9 + ldrb r0, [r2] + muls r0, r4 + mov r2, r10 + adds r2, 0x24 + adds r0, r2 + ldrb r7, [r7] + adds r0, r7 + str r0, [sp] + movs r0, 0 + movs r2, 0 + movs r3, 0x1 + bl dp01_build_cmdbuf_x02_a_b_varargs + mov r7, r9 + ldrb r0, [r7] + bl dp01_battle_side_mark_buffer_for_execution +_08046BDC: + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xfffff7ff + ands r0, r1 + str r0, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_08046BEE: + 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 atk03_ppreduce + + thumb_func_start atk04_critcalc +atk04_critcalc: @ 8046C18 + push {r4-r7,lr} + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x2E] + cmp r0, 0xAF + bne _08046C48 + ldr r1, =0x02024404 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r6, [r0, 0x7] + b _08046C50 + .pool +_08046C48: + bl itemid_get_x12 + lsls r0, 24 + lsrs r6, r0, 24 +_08046C50: + ldr r1, =0x0202420f + ldr r3, =0x0202420b + ldrb r0, [r3] + strb r0, [r1] + ldr r4, =0x02024084 + ldrb r1, [r3] + movs r0, 0x58 + adds r7, r1, 0 + muls r7, r0 + adds r0, r4, 0 + adds r0, 0x50 + adds r0, r7, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 13 + ands r0, r1 + negs r0, r0 + asrs r5, r0, 31 + movs r0, 0x2 + ands r5, r0 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + mov r12, r3 + cmp r1, 0x2B + bne _08046C90 + adds r5, 0x1 +_08046C90: + adds r0, r5, 0 + cmp r1, 0x4B + bne _08046C98 + adds r0, 0x1 +_08046C98: + cmp r1, 0xC8 + bne _08046C9E + adds r0, 0x1 +_08046C9E: + adds r2, r0, 0 + cmp r1, 0xD1 + bne _08046CA6 + adds r2, 0x1 +_08046CA6: + movs r1, 0 + cmp r6, 0x3F + bne _08046CB6 + adds r0, r7, r4 + ldrh r0, [r0] + cmp r0, 0x71 + bne _08046CB6 + movs r1, 0x1 +_08046CB6: + lsls r5, r1, 1 + movs r3, 0 + cmp r6, 0x42 + bne _08046CD0 + mov r0, r12 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0x53 + bne _08046CD0 + movs r3, 0x1 +_08046CD0: + lsls r1, r3, 1 + cmp r6, 0x29 + bne _08046CF0 + adds r0, r5, 0x1 + adds r0, r2, r0 + b _08046CF2 + .pool +_08046CF0: + adds r0, r2, r5 +_08046CF2: + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + adds r5, r0, 0 + cmp r5, 0x4 + bls _08046D00 + movs r5, 0x4 +_08046D00: + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r4 + adds r0, 0x20 + ldrb r4, [r0] + cmp r4, 0x4 + beq _08046D70 + cmp r4, 0x4B + beq _08046D70 + ldr r1, =0x020242ac + mov r2, r12 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + bne _08046D70 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x84 + lsls r1, 2 + ands r0, r1 + cmp r0, 0 + bne _08046D70 + bl GenerateRandomNumber + ldr r2, =gUnknown_0831C128 + lsls r1, r5, 1 + adds r1, r2 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r1] + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _08046D70 + ldr r1, =0x02024211 + movs r0, 0x2 + b _08046D74 + .pool +_08046D70: + ldr r1, =0x02024211 + movs r0, 0x1 +_08046D74: + strb r0, [r1] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk04_critcalc + + thumb_func_start atk05_cmd5 +atk05_cmd5: @ 8046D8C + push {r4-r7,lr} + sub sp, 0x10 + ldr r4, =0x0202428e + ldr r5, =0x0202420c + ldrb r0, [r5] + bl battle_get_per_side_status + movs r1, 0x1 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + ldrh r3, [r1] + ldr r6, =0x0202420b + ldrb r0, [r6] + movs r4, 0x58 + muls r0, r4 + ldr r2, =0x02024084 + adds r0, r2 + ldrb r1, [r5] + muls r1, r4 + adds r1, r2 + ldr r7, =0x020241ea + ldrh r2, [r7] + ldr r4, =0x02024400 + ldrh r4, [r4] + str r4, [sp] + ldr r4, =0x0202449c + ldr r4, [r4] + ldrb r4, [r4, 0x13] + str r4, [sp, 0x4] + ldrb r4, [r6] + str r4, [sp, 0x8] + ldrb r4, [r5] + str r4, [sp, 0xC] + bl sub_806957C + ldr r4, =0x020241f0 + ldr r1, =0x02024211 + ldrb r1, [r1] + muls r1, r0 + ldr r0, =0x02024474 + ldrb r0, [r0, 0xE] + adds r3, r1, 0 + muls r3, r0 + str r3, [r4] + ldr r1, =0x020242ac + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 2 + ands r0, r1 + cmp r0, 0 + beq _08046E10 + ldr r2, =gBattleMoves + ldrh r1, [r7] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x2] + cmp r0, 0xD + bne _08046E10 + lsls r0, r3, 1 + str r0, [r4] +_08046E10: + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 28 + cmp r0, 0 + bge _08046E32 + ldr r4, =0x020241f0 + ldr r1, [r4] + lsls r0, r1, 4 + subs r0, r1 + movs r1, 0xA + bl __divsi3 + str r0, [r4] +_08046E32: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk05_cmd5 + + thumb_func_start sub_8046E7C +sub_8046E7C: @ 8046E7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + adds r5, r1, 0 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r4, =0x0202428e + adds r0, r5, 0 + bl battle_get_per_side_status + movs r1, 0x1 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + ldrh r3, [r1] + movs r1, 0x58 + adds r0, r7, 0 + muls r0, r1 + ldr r2, =0x02024084 + adds r0, r2 + muls r1, r5 + adds r1, r2 + ldr r2, =0x020241ea + mov r8, r2 + ldrh r2, [r2] + ldr r6, =0x02024400 + ldrh r4, [r6] + str r4, [sp] + ldr r4, =0x0202449c + ldr r4, [r4] + ldrb r4, [r4, 0x13] + str r4, [sp, 0x4] + str r7, [sp, 0x8] + str r5, [sp, 0xC] + bl sub_806957C + ldr r4, =0x020241f0 + movs r1, 0 + strh r1, [r6] + ldr r1, =0x02024211 + ldrb r1, [r1] + muls r1, r0 + ldr r0, =0x02024474 + ldrb r0, [r0, 0xE] + adds r3, r1, 0 + muls r3, r0 + str r3, [r4] + ldr r1, =0x020242ac + lsls r0, r7, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 2 + ands r0, r1 + cmp r0, 0 + beq _08046F0A + ldr r2, =gBattleMoves + mov r0, r8 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x2] + cmp r0, 0xD + bne _08046F0A + lsls r0, r3, 1 + str r0, [r4] +_08046F0A: + ldr r0, =0x0202433c + lsls r1, r7, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 28 + cmp r0, 0 + bge _08046F28 + ldr r4, =0x020241f0 + ldr r1, [r4] + lsls r0, r1, 4 + subs r0, r1 + movs r1, 0xA + bl __divsi3 + str r0, [r4] +_08046F28: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8046E7C + + thumb_func_start battle_attack_damage_modulate_by_effectivity +battle_attack_damage_modulate_by_effectivity: @ 8046F60 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =0x020241f0 + ldr r0, [r5] + muls r0, r4 + movs r1, 0xA + bl __divsi3 + str r0, [r5] + cmp r0, 0 + bne _08046F80 + cmp r4, 0 + beq _08046F80 + movs r0, 0x1 + str r0, [r5] +_08046F80: + cmp r4, 0x5 + beq _08046FB0 + cmp r4, 0x5 + bgt _08046F94 + cmp r4, 0 + beq _08046F9A + b _08047032 + .pool +_08046F94: + cmp r4, 0x14 + beq _08046FF0 + b _08047032 +_08046F9A: + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x8 + orrs r0, r1 + movs r1, 0xFB + ands r0, r1 + movs r1, 0xFD + ands r0, r1 + b _08047030 + .pool +_08046FB0: + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _08047032 + ldr r2, =0x0202427c + ldrb r1, [r2] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _08047032 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08046FEC + movs r0, 0xFD + ands r0, r1 + b _08047030 + .pool +_08046FEC: + movs r0, 0x4 + b _0804702E +_08046FF0: + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _08047032 + ldr r2, =0x0202427c + ldrb r1, [r2] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _08047032 + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0804702C + movs r0, 0xFB + ands r0, r1 + b _08047030 + .pool +_0804702C: + movs r0, 0x2 +_0804702E: + orrs r0, r1 +_08047030: + strb r0, [r2] +_08047032: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end battle_attack_damage_modulate_by_effectivity + + thumb_func_start sub_8047038 +sub_8047038: @ 8047038 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + movs r3, 0 + ldr r1, =0x020241ea + ldrh r0, [r1] + cmp r0, 0xA5 + bne _0804704C + b _08047260 +_0804704C: + ldr r0, =0x0202449c + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0 + beq _08047068 + movs r1, 0x3F + mov r8, r1 + ands r1, r0 + mov r8, r1 + b _08047078 + .pool +_08047068: + ldr r2, =gBattleMoves + ldrh r1, [r1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x2] + mov r8, r0 +_08047078: + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r1, r0, r2 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + adds r5, r2, 0 + cmp r0, r8 + beq _0804709A + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, r8 + bne _080470B0 +_0804709A: + ldr r4, =0x020241f0 + ldr r1, [r4] + lsls r0, r1, 4 + subs r0, r1 + str r0, [r4] + movs r1, 0xA + str r3, [sp, 0x4] + bl __divsi3 + str r0, [r4] + ldr r3, [sp, 0x4] +_080470B0: + ldr r2, =0x0202420c + ldrb r1, [r2] + movs r0, 0x58 + muls r0, r1 + adds r0, r5 + adds r0, 0x20 + ldrb r0, [r0] + adds r4, r2, 0 + cmp r0, 0x1A + bne _08047128 + mov r1, r8 + cmp r1, 0x4 + bne _08047128 + ldr r3, =0x0202420a + strb r0, [r3] + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x9 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024250 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + movs r2, 0 + strh r2, [r0] + ldr r1, =0x02024258 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + strh r2, [r0] + ldr r0, =0x02024332 + mov r1, r8 + strb r1, [r0, 0x6] + ldrb r0, [r4] + ldrb r1, [r3] + bl b_history__record_ability_usage_of_player + b _080471C4 + .pool +_08047128: + ldr r1, =gUnknown_0831ACE8 + adds r0, r3, r1 + ldrb r0, [r0] + adds r2, r1, 0 + b _080471A4 + .pool +_08047138: + adds r3, 0x3 + b _080471A0 +_0804713C: + ldr r5, =gUnknown_0831ACE8 + adds r0, r3, r5 + ldrb r0, [r0] + cmp r0, r8 + bne _08047198 + adds r1, r3, 0x1 + adds r1, r5 + ldr r2, =0x02024084 + ldr r7, =0x0202420c + ldrb r0, [r7] + movs r6, 0x58 + muls r0, r6 + adds r0, r2 + adds r0, 0x21 + ldrb r4, [r1] + ldrb r0, [r0] + cmp r4, r0 + bne _08047172 + adds r0, r3, 0x2 + adds r0, r5 + ldrb r0, [r0] + str r2, [sp] + str r3, [sp, 0x4] + bl battle_attack_damage_modulate_by_effectivity + ldr r3, [sp, 0x4] + ldr r2, [sp] +_08047172: + ldrb r0, [r7] + muls r0, r6 + adds r0, r2 + adds r1, r0, 0 + adds r1, 0x22 + ldrb r1, [r1] + cmp r4, r1 + bne _08047198 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, r4 + beq _08047198 + adds r0, r3, 0x2 + adds r0, r5 + ldrb r0, [r0] + str r3, [sp, 0x4] + bl battle_attack_damage_modulate_by_effectivity + ldr r3, [sp, 0x4] +_08047198: + adds r3, 0x3 + ldr r5, =0x02024084 + ldr r4, =0x0202420c + ldr r2, =gUnknown_0831ACE8 +_080471A0: + adds r0, r3, r2 + ldrb r0, [r0] +_080471A4: + cmp r0, 0xFF + beq _080471C4 + cmp r0, 0xFE + bne _0804713C + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + adds r1, r5, 0 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 22 + ands r0, r1 + cmp r0, 0 + beq _08047138 +_080471C4: + ldr r2, =0x02024084 + ldr r5, =0x0202420c + ldrb r1, [r5] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x20 + ldrb r6, [r0] + cmp r6, 0x19 + bne _08047242 + ldr r0, =0x0202420b + ldrb r0, [r0] + ldr r7, =0x020241ea + ldrh r1, [r7] + bl move_weather_interaction + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08047242 + ldr r1, =0x0202427c + mov r8, r1 + ldrb r4, [r1] + ands r0, r4 + cmp r0, 0 + beq _08047200 + movs r0, 0x6 + ands r0, r4 + cmp r0, 0x6 + bne _08047242 +_08047200: + ldr r2, =gBattleMoves + ldrh r1, [r7] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _08047242 + ldr r3, =0x0202420a + strb r6, [r3] + movs r0, 0x1 + orrs r0, r4 + mov r1, r8 + strb r0, [r1] + ldr r1, =0x02024250 + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + movs r2, 0 + strh r2, [r0] + ldr r1, =0x02024258 + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + strh r2, [r0] + ldr r1, =0x02024332 + movs r0, 0x3 + strb r0, [r1, 0x6] + ldrb r0, [r5] + ldrb r1, [r3] + bl b_history__record_ability_usage_of_player +_08047242: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08047260 + ldr r2, =0x0202433c + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r1, 4 + adds r1, r2 + ldrb r0, [r1, 0x1] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r1, 0x1] +_08047260: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8047038 + + thumb_func_start b_wonderguard_and_levitate +b_wonderguard_and_levitate: @ 80472A8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r6, 0 + movs r5, 0 + ldr r0, =0x020241ea + ldrh r1, [r0] + mov r9, r0 + cmp r1, 0xA5 + bne _080472C0 + b _08047508 +_080472C0: + ldr r2, =gBattleMoves + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _080472D2 + b _08047508 +_080472D2: + ldr r0, =0x0202449c + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0 + beq _080472F4 + movs r1, 0x3F + mov r12, r1 + mov r2, r12 + ands r2, r0 + mov r12, r2 + b _080472F8 + .pool +_080472F4: + ldrb r1, [r1, 0x2] + mov r12, r1 +_080472F8: + ldr r2, =0x02024084 + ldr r3, =0x0202420c + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x20 + ldrb r1, [r0] + adds r7, r2, 0 + mov r8, r3 + cmp r1, 0x1A + bne _0804733C + mov r0, r12 + cmp r0, 0x4 + bne _0804733C + ldr r0, =0x0202420a + strb r1, [r0] + ldr r0, =0x02024332 + mov r1, r12 + strb r1, [r0, 0x6] + ldrb r0, [r3] + movs r1, 0x1A + bl b_history__record_ability_usage_of_player + b _08047508 + .pool +_0804733C: + ldr r1, =gUnknown_0831ACE8 + adds r0, r5, r1 + ldrb r0, [r0] + adds r4, r1, 0 + b _0804748E + .pool +_0804734C: + adds r0, r5, r4 + ldrb r0, [r0] + cmp r0, r12 + beq _08047356 + b _08047488 +_08047356: + adds r2, r5, 0x1 + adds r3, r2, r4 + mov r0, r8 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r7 + adds r0, 0x21 + ldrb r1, [r3] + adds r3, r2, 0 + ldrb r0, [r0] + cmp r1, r0 + bne _08047396 + adds r0, r5, 0x2 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _08047396 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x8 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r2, [r0] + lsls r2, 4 + adds r2, r1 + ldrb r0, [r2, 0x1] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0x1] +_08047396: + adds r2, r3, r4 + mov r0, r8 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r7 + adds r1, r0, 0 + adds r1, 0x22 + ldrb r2, [r2] + ldrb r1, [r1] + cmp r2, r1 + bne _080473DC + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, r2 + beq _080473DC + adds r0, r5, 0x2 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _080473DC + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x8 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r2, [r0] + lsls r2, 4 + adds r2, r1 + ldrb r0, [r2, 0x1] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0x1] +_080473DC: + adds r2, r3, r4 + mov r0, r8 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r7 + adds r0, 0x21 + ldrb r1, [r2] + ldrb r0, [r0] + cmp r1, r0 + bne _08047400 + adds r0, r5, 0x2 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x14 + bne _08047400 + movs r0, 0x1 + orrs r6, r0 +_08047400: + adds r2, r3, r4 + mov r0, r8 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r7 + adds r1, r0, 0 + adds r1, 0x22 + ldrb r2, [r2] + ldrb r1, [r1] + cmp r2, r1 + bne _0804742E + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, r2 + beq _0804742E + adds r0, r5, 0x2 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x14 + bne _0804742E + movs r0, 0x1 + orrs r6, r0 +_0804742E: + adds r2, r3, r4 + mov r0, r8 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r7 + adds r0, 0x21 + ldrb r1, [r2] + ldrb r0, [r0] + cmp r1, r0 + bne _08047456 + adds r0, r5, 0x2 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x5 + bne _08047456 + movs r0, 0x2 + orrs r6, r0 + lsls r0, r6, 24 + lsrs r6, r0, 24 +_08047456: + adds r2, r3, r4 + mov r0, r8 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r7 + adds r1, r0, 0 + adds r1, 0x22 + ldrb r2, [r2] + ldrb r1, [r1] + cmp r2, r1 + bne _08047488 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, r2 + beq _08047488 + adds r0, r5, 0x2 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x5 + bne _08047488 + movs r0, 0x2 + orrs r6, r0 + lsls r0, r6, 24 + lsrs r6, r0, 24 +_08047488: + adds r5, 0x3 + adds r0, r5, r4 + ldrb r0, [r0] +_0804748E: + cmp r0, 0xFF + beq _080474B2 + cmp r0, 0xFE + beq _08047498 + b _0804734C +_08047498: + mov r2, r8 + ldrb r1, [r2] + movs r0, 0x58 + muls r0, r1 + adds r1, r7, 0 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 22 + ands r0, r1 + cmp r0, 0 + beq _08047488 +_080474B2: + mov r0, r8 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r7 + adds r0, 0x20 + ldrb r4, [r0] + cmp r4, 0x19 + bne _08047508 + ldr r0, =0x0202420b + ldrb r0, [r0] + mov r2, r9 + ldrh r1, [r2] + bl move_weather_interaction + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08047508 + movs r0, 0x3 + ands r6, r0 + cmp r6, 0x1 + beq _08047508 + ldr r2, =gBattleMoves + mov r0, r9 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _08047508 + ldr r0, =0x0202420a + strb r4, [r0] + ldr r1, =0x02024332 + movs r0, 0x3 + strb r0, [r1, 0x6] + mov r1, r8 + ldrb r0, [r1] + movs r1, 0x19 + bl b_history__record_ability_usage_of_player +_08047508: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end b_wonderguard_and_levitate + + thumb_func_start b_attack_effectivity_adapt +b_attack_effectivity_adapt: @ 804752C + push {r4-r7,lr} + adds r6, r2, 0 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsrs r5, r1, 16 + ldr r7, =0x020241f0 + ldr r0, [r7] + muls r0, r4 + movs r1, 0xA + bl __divsi3 + str r0, [r7] + cmp r0, 0 + bne _08047552 + cmp r4, 0 + beq _08047552 + movs r0, 0x1 + str r0, [r7] +_08047552: + cmp r4, 0x5 + beq _0804757A + cmp r4, 0x5 + bgt _08047564 + cmp r4, 0 + beq _0804756A + b _080475DE + .pool +_08047564: + cmp r4, 0x14 + beq _080475AC + b _080475DE +_0804756A: + ldrb r0, [r6] + movs r1, 0x8 + orrs r0, r1 + movs r1, 0xFB + ands r0, r1 + movs r1, 0xFD + ands r0, r1 + b _080475DC +_0804757A: + ldr r0, =gBattleMoves + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + cmp r0, 0 + beq _080475DE + ldrb r1, [r6] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _080475DE + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080475A8 + movs r0, 0xFD + ands r0, r1 + b _080475DC + .pool +_080475A8: + movs r0, 0x4 + b _080475DA +_080475AC: + ldr r0, =gBattleMoves + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + cmp r0, 0 + beq _080475DE + ldrb r1, [r6] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _080475DE + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080475D8 + movs r0, 0xFB + ands r0, r1 + b _080475DC + .pool +_080475D8: + movs r0, 0x2 +_080475DA: + orrs r0, r1 +_080475DC: + strb r0, [r6] +_080475DE: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end b_attack_effectivity_adapt + + thumb_func_start move_effectiveness_something +move_effectiveness_something: @ 80475E4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x4] + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + movs r0, 0 + mov r8, r0 + mov r0, sp + mov r1, r8 + strb r1, [r0] + mov r2, r10 + cmp r2, 0xA5 + bne _08047616 + movs r0, 0 + b _0804779E +_08047616: + ldr r1, =gBattleMoves + mov r3, r10 + lsls r2, r3, 1 + adds r0, r2, r3 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x2] + str r0, [sp, 0x8] + ldr r1, =0x02024084 + movs r0, 0x58 + ldr r3, [sp, 0x4] + muls r0, r3 + adds r3, r0, r1 + adds r0, r3, 0 + adds r0, 0x21 + ldrb r0, [r0] + str r2, [sp, 0xC] + adds r5, r1, 0 + ldr r1, [sp, 0x8] + cmp r0, r1 + beq _0804764A + adds r0, r3, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, r1 + bne _0804765C +_0804764A: + ldr r4, =0x020241f0 + ldr r1, [r4] + lsls r0, r1, 4 + subs r0, r1 + str r0, [r4] + movs r1, 0xA + bl __divsi3 + str r0, [r4] +_0804765C: + movs r0, 0x58 + mov r2, r9 + muls r2, r0 + adds r0, r2, 0 + adds r0, r5 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1A + bne _08047690 + ldr r3, [sp, 0x8] + cmp r3, 0x4 + bne _08047690 + movs r1, 0x9 + mov r0, sp + ldrb r0, [r0] + orrs r0, r1 + mov r1, sp + strb r0, [r1] + b _08047740 + .pool +_08047690: + ldr r1, =gUnknown_0831ACE8 + mov r2, r8 + adds r0, r2, r1 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0xFF + beq _08047740 + cmp r0, 0xFE + bne _080476B6 + movs r0, 0x58 + mov r3, r9 + muls r3, r0 + adds r0, r3, 0 + b _0804772E + .pool +_080476B0: + movs r0, 0x3 + add r8, r0 + b _08047718 +_080476B6: + ldr r7, =gUnknown_0831ACE8 + mov r1, r8 + adds r0, r1, r7 + ldrb r0, [r0] + ldr r2, [sp, 0x8] + cmp r0, r2 + bne _08047710 + adds r1, 0x1 + adds r1, r7 + ldr r2, =0x02024084 + movs r0, 0x58 + mov r3, r9 + muls r3, r0 + adds r0, r3, 0 + adds r5, r0, r2 + adds r6, r5, 0 + adds r6, 0x21 + ldrb r4, [r1] + ldrb r0, [r6] + cmp r4, r0 + bne _080476F0 + mov r0, r8 + adds r0, 0x2 + adds r0, r7 + ldrb r0, [r0] + mov r1, r10 + mov r2, sp + bl b_attack_effectivity_adapt +_080476F0: + adds r0, r5, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r4, r0 + bne _08047710 + ldrb r0, [r6] + cmp r0, r4 + beq _08047710 + mov r0, r8 + adds r0, 0x2 + adds r0, r7 + ldrb r0, [r0] + mov r1, r10 + mov r2, sp + bl b_attack_effectivity_adapt +_08047710: + movs r1, 0x3 + add r8, r1 + ldr r5, =0x02024084 + ldr r2, =gUnknown_0831ACE8 +_08047718: + mov r3, r8 + adds r0, r3, r2 + ldrb r0, [r0] + cmp r0, 0xFF + beq _08047740 + cmp r0, 0xFE + bne _080476B6 + movs r0, 0x58 + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 +_0804772E: + adds r1, r5, 0 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 22 + ands r0, r1 + cmp r0, 0 + beq _080476B0 +_08047740: + movs r0, 0x58 + mov r2, r9 + muls r2, r0 + adds r0, r2, 0 + adds r0, r5 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x19 + bne _0804779A + mov r0, sp + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0804779A + ldr r0, [sp, 0x4] + mov r1, r10 + bl move_weather_interaction + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x2 + bne _0804779A + mov r0, sp + ldrb r3, [r0] + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + beq _08047782 + movs r0, 0x6 + ands r0, r3 + cmp r0, 0x6 + bne _0804779A +_08047782: + ldr r0, =gBattleMoves + ldr r1, [sp, 0xC] + add r1, r10 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + cmp r0, 0 + beq _0804779A + mov r0, sp + movs r1, 0x1 + orrs r1, r3 + strb r1, [r0] +_0804779A: + mov r0, sp + ldrb r0, [r0] +_0804779E: + 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 move_effectiveness_something + + thumb_func_start ai_rate_move +ai_rate_move: @ 80477BC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x4] + movs r7, 0 + mov r0, sp + strb r7, [r0] + ldr r2, =gBaseStats + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x6] + mov r9, r1 + ldrb r0, [r0, 0x7] + mov r8, r0 + cmp r6, 0xA5 + bne _080477FC + movs r0, 0 + b _080478A0 + .pool +_080477FC: + ldr r2, =gBattleMoves + lsls r1, r6, 1 + adds r0, r1, r6 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x2] + mov r10, r0 + str r1, [sp, 0x8] + ldr r3, [sp, 0x4] + cmp r3, 0x1A + bne _08047824 + cmp r0, 0x4 + bne _08047824 + movs r1, 0x9 + mov r0, sp + strb r1, [r0] + b _0804786A + .pool +_08047824: + ldr r0, =gUnknown_0831ACE8 + adds r1, r7, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _0804786A + adds r4, r1, 0 +_08047830: + ldrb r0, [r4] + cmp r0, 0xFE + beq _0804785C + cmp r0, r10 + bne _0804785C + ldrb r5, [r4, 0x1] + cmp r5, r9 + bne _0804784A + ldrb r0, [r4, 0x2] + adds r1, r6, 0 + mov r2, sp + bl b_attack_effectivity_adapt +_0804784A: + cmp r5, r8 + bne _0804785C + cmp r9, r8 + beq _0804785C + ldrb r0, [r4, 0x2] + adds r1, r6, 0 + mov r2, sp + bl b_attack_effectivity_adapt +_0804785C: + adds r4, 0x3 + adds r7, 0x3 + ldr r1, =gUnknown_0831ACE8 + adds r0, r7, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _08047830 +_0804786A: + ldr r3, [sp, 0x4] + cmp r3, 0x19 + bne _0804789C + mov r0, sp + ldrb r2, [r0] + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _08047884 + movs r0, 0x6 + ands r0, r2 + cmp r0, 0x6 + bne _0804789C +_08047884: + ldr r0, =gBattleMoves + ldr r3, [sp, 0x8] + adds r1, r3, r6 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + cmp r0, 0 + beq _0804789C + mov r0, sp + movs r1, 0x8 + orrs r1, r2 + strb r1, [r0] +_0804789C: + mov r0, sp + ldrb r0, [r0] +_080478A0: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end ai_rate_move + + thumb_func_start sub_80478B8 +sub_80478B8: @ 80478B8 + push {r4,lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF + ands r0, r1 + movs r1, 0x64 + subs r1, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r4, =0x020241f0 + ldr r0, [r4] + cmp r0, 0 + beq _080478EA + muls r0, r1 + str r0, [r4] + movs r1, 0x64 + bl __divsi3 + str r0, [r4] + cmp r0, 0 + bne _080478EA + movs r0, 0x1 + str r0, [r4] +_080478EA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80478B8 + + thumb_func_start atk07_cmd7 +atk07_cmd7: @ 80478F4 + push {r4-r7,lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF + ands r0, r1 + movs r1, 0x64 + subs r1, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r4, =0x020241f0 + ldr r0, [r4] + cmp r0, 0 + beq _08047926 + muls r0, r1 + str r0, [r4] + movs r1, 0x64 + bl __divsi3 + str r0, [r4] + cmp r0, 0 + bne _08047926 + movs r0, 0x1 + str r0, [r4] +_08047926: + ldr r7, =0x02024084 + ldr r6, =0x0202420c + ldrb r2, [r6] + movs r5, 0x58 + adds r0, r2, 0 + muls r0, r5 + adds r1, r0, r7 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _0804795C + ldr r1, =0x02024404 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r4, [r0, 0x7] + ldrb r6, [r0, 0x1A] + b _08047976 + .pool +_0804795C: + ldrh r0, [r1, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r0, [r6] + muls r0, r5 + adds r0, r7 + ldrh r0, [r0, 0x2E] + bl itemid_get_quality + lsls r0, 24 + lsrs r6, r0, 24 +_08047976: + ldr r1, =0x0202420f + ldr r5, =0x0202420c + ldrb r0, [r5] + strb r0, [r1] + cmp r4, 0x27 + bne _080479B4 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r6 + bcs _080479B4 + ldrb r0, [r5] + movs r1, 0x27 + bl b_history__record_item_x12_of_player + ldr r2, =0x0202437c + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] +_080479B4: + ldr r2, =0x02024084 + ldr r3, =0x0202420c + ldrb r4, [r3] + movs r0, 0x58 + muls r0, r4 + adds r1, r2, 0 + adds r1, 0x50 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r1, r0 + adds r5, r2, 0 + cmp r1, 0 + bne _08047A84 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x65 + beq _08047A06 + ldr r0, =0x0202433c + lsls r1, r4, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 30 + cmp r0, 0 + blt _08047A06 + ldr r0, =0x0202437c + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + lsrs r0, 7 + cmp r0, 0 + beq _08047A84 +_08047A06: + ldrb r0, [r3] + movs r4, 0x58 + muls r0, r4 + adds r0, r5 + ldrh r1, [r0, 0x28] + ldr r2, =0x020241f0 + ldr r0, [r2] + cmp r1, r0 + bgt _08047A84 + subs r0, r1, 0x1 + str r0, [r2] + ldr r1, =0x0202433c + ldrb r3, [r3] + lsls r0, r3, 4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bge _08047A5C + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + b _08047A84 + .pool +_08047A5C: + ldr r0, =0x0202437c + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + lsrs r0, 7 + cmp r0, 0 + beq _08047A84 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024208 + adds r0, r3, 0 + muls r0, r4 + adds r0, r5 + ldrh r0, [r0, 0x2E] + strh r0, [r1] +_08047A84: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk07_cmd7 + + thumb_func_start atk08_cmd8 +atk08_cmd8: @ 8047AA4 + push {r4-r7,lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF + ands r0, r1 + movs r1, 0x64 + subs r1, r0 + lsls r1, 16 + lsrs r1, 16 + ldr r4, =0x020241f0 + ldr r0, [r4] + cmp r0, 0 + beq _08047AD6 + muls r0, r1 + str r0, [r4] + movs r1, 0x64 + bl __divsi3 + str r0, [r4] + cmp r0, 0 + bne _08047AD6 + movs r0, 0x1 + str r0, [r4] +_08047AD6: + ldr r7, =0x02024084 + ldr r6, =0x0202420c + ldrb r2, [r6] + movs r5, 0x58 + adds r0, r2, 0 + muls r0, r5 + adds r1, r0, r7 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _08047B0C + ldr r1, =0x02024404 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r4, [r0, 0x7] + ldrb r6, [r0, 0x1A] + b _08047B26 + .pool +_08047B0C: + ldrh r0, [r1, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r0, [r6] + muls r0, r5 + adds r0, r7 + ldrh r0, [r0, 0x2E] + bl itemid_get_quality + lsls r0, 24 + lsrs r6, r0, 24 +_08047B26: + ldr r1, =0x0202420f + ldr r5, =0x0202420c + ldrb r0, [r5] + strb r0, [r1] + cmp r4, 0x27 + bne _08047B64 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r6 + bcs _08047B64 + ldrb r0, [r5] + movs r1, 0x27 + bl b_history__record_item_x12_of_player + ldr r2, =0x0202437c + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] +_08047B64: + ldr r4, =0x02024084 + ldr r6, =0x0202420c + ldrb r2, [r6] + movs r7, 0x58 + adds r3, r2, 0 + muls r3, r7 + adds r0, r4, 0 + adds r0, 0x50 + adds r0, r3, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _08047C10 + ldr r5, =0x0202433c + lsls r0, r2, 4 + adds r0, r5 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + blt _08047BA2 + ldr r0, =0x0202437c + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + lsrs r0, 7 + cmp r0, 0 + beq _08047C10 +_08047BA2: + adds r0, r3, r4 + ldrh r1, [r0, 0x28] + ldr r2, =0x020241f0 + ldr r0, [r2] + cmp r1, r0 + bgt _08047C10 + subs r0, r1, 0x1 + str r0, [r2] + ldrb r3, [r6] + lsls r0, r3, 4 + adds r0, r5 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bge _08047BE8 + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + b _08047C10 + .pool +_08047BE8: + ldr r0, =0x0202437c + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + lsrs r0, 7 + cmp r0, 0 + beq _08047C10 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024208 + adds r0, r3, 0 + muls r0, r7 + adds r0, r4 + ldrh r0, [r0, 0x2E] + strh r0, [r1] +_08047C10: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk08_cmd8 + + thumb_func_start atk09_attackanimation +atk09_attackanimation: @ 8047C30 + push {r4-r7,lr} + sub sp, 0x10 + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _08047C3E + b _08047DB6 +_08047C3E: + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + ldr r5, =0x020241ea + cmp r0, 0 + beq _08047C8C + ldrh r0, [r5] + cmp r0, 0x90 + beq _08047C8C + cmp r0, 0xA4 + beq _08047C8C + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DABB9 + str r0, [r4] + ldr r1, =0x02024474 + ldrb r0, [r1, 0x18] + adds r0, 0x1 + strb r0, [r1, 0x18] + ldrb r0, [r1, 0x19] + adds r0, 0x1 + strb r0, [r1, 0x19] + b _08047DB6 + .pool +_08047C8C: + ldr r2, =gBattleMoves + ldrh r1, [r5] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x6] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _08047CB2 + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _08047CB2 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08047CBA +_08047CB2: + ldr r0, =0x02024474 + ldrb r0, [r0, 0x19] + cmp r0, 0 + bne _08047D88 +_08047CBA: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _08047DA8 + ldr r1, =0x02024064 + ldr r3, =0x0202420b + ldrb r0, [r3] + strb r0, [r1] + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + adds r4, r1, 0 + muls r4, r0 + adds r0, r2, 0 + adds r0, 0x50 + adds r0, r4, r0 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r1, r0 + adds r7, r3, 0 + mov r12, r2 + cmp r1, 0 + beq _08047D18 + ldr r0, =0x02024212 + ldrb r6, [r0] + b _08047D42 + .pool +_08047D18: + ldr r3, =0x02024212 + ldrb r0, [r3] + cmp r0, 0x1 + bls _08047D40 + mov r1, r12 + adds r0, r4, r1 + ldrh r2, [r0, 0x28] + ldr r0, =0x020241f0 + ldr r1, [r0] + movs r6, 0x1 + adds r4, r0, 0 + cmp r2, r1 + ble _08047D44 + ldrb r6, [r3] + b _08047D44 + .pool +_08047D40: + ldrb r6, [r3] +_08047D42: + ldr r4, =0x020241f0 +_08047D44: + ldrh r1, [r5] + ldr r5, =0x02024474 + ldrb r2, [r5, 0x18] + ldr r0, =0x020244e0 + ldrh r3, [r0] + ldr r0, [r4] + str r0, [sp] + ldrb r4, [r7] + movs r0, 0x58 + muls r0, r4 + add r0, r12 + adds r0, 0x2B + ldrb r0, [r0] + str r0, [sp, 0x4] + ldrb r4, [r7] + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + ldr r4, =0x020242bc + adds r0, r4 + str r0, [sp, 0x8] + str r6, [sp, 0xC] + movs r0, 0 + bl dp01_build_cmdbuf_x0F_aa_b_cc_dddd_e_mlc_weather_00_x1Cbytes + ldrb r0, [r5, 0x18] + adds r0, 0x1 + strb r0, [r5, 0x18] + ldrb r0, [r5, 0x19] + adds r0, 0x1 + strb r0, [r5, 0x19] + ldrb r0, [r7] + bl dp01_battle_side_mark_buffer_for_execution +_08047D88: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + b _08047DB6 + .pool +_08047DA8: + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DABB9 + str r0, [r4] +_08047DB6: + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk09_attackanimation + + thumb_func_start sub_8047DC8 +sub_8047DC8: @ 8047DC8 + push {lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _08047DDA + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_08047DDA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8047DC8 + + thumb_func_start atk0B_graphicalhpupdate +atk0B_graphicalhpupdate: @ 8047DE8 + push {r4,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _08047EAA + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _08047EA2 + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r2, =0x02024064 + strb r0, [r2] + ldr r1, =0x02024084 + ldrb r2, [r2] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08047E68 + ldr r0, =0x020242bc + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + cmp r0, 0 + beq _08047E68 + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 1 + ands r0, r1 + cmp r0, 0 + bne _08047E68 + movs r0, 0x80 + adds r1, r2, 0 + bl b_std_message + b _08047EA2 + .pool +_08047E68: + ldr r0, =0x020241f0 + ldr r0, [r0] + ldr r1, =0x00002710 + cmp r0, r1 + bgt _08047E76 + lsls r0, 16 + lsrs r1, r0, 16 +_08047E76: + movs r0, 0 + bl dp01_build_cmdbuf_x18_0_aa_health_bar_update + ldr r4, =0x02024064 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08047EA2 + ldr r0, =0x020241f0 + ldr r0, [r0] + cmp r0, 0 + ble _08047EA2 + ldr r0, =0x03005d10 + ldrb r1, [r0, 0x5] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0, 0x5] +_08047EA2: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_08047EAA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk0B_graphicalhpupdate + + thumb_func_start atk0C_datahpupdate +atk0C_datahpupdate: @ 8047EC4 + push {r4-r7,lr} + sub sp, 0x4 + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _08047ED2 + b _080482A2 +_08047ED2: + ldr r0, =0x0202449c + ldr r0, [r0] + ldrb r1, [r0, 0x13] + cmp r1, 0 + beq _08047EF4 + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08047EF4 + movs r6, 0x3F + ands r6, r1 + b _08047F04 + .pool +_08047EF4: + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r6, [r0, 0x2] +_08047F04: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _08047F12 + b _08048274 +_08047F12: + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r7, =0x02024064 + strb r0, [r7] + ldr r1, =0x02024084 + ldrb r2, [r7] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08048028 + ldr r0, =0x020242bc + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r4, r1, r0 + ldrb r1, [r4, 0xA] + mov r12, r0 + cmp r1, 0 + beq _08048028 + ldr r0, =0x02024280 + ldr r3, [r0] + movs r0, 0x80 + lsls r0, 1 + ands r3, r0 + cmp r3, 0 + bne _08048028 + adds r5, r1, 0 + ldr r6, =0x020241f0 + ldr r4, [r6] + cmp r5, r4 + blt _08047FBC + ldr r0, =0x0202437c + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 2 + adds r0, 0x4 + adds r1, r0 + ldr r0, [r1] + cmp r0, 0 + bne _08047F76 + str r4, [r1] +_08047F76: + ldrb r0, [r7] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + add r1, r12 + ldr r2, [r6] + ldrb r0, [r1, 0xA] + subs r0, r2 + strb r0, [r1, 0xA] + ldr r1, =0x020241f4 + ldr r0, [r6] + str r0, [r1] + b _08047FEC + .pool +_08047FBC: + ldr r0, =0x0202437c + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 2 + adds r0, 0x4 + adds r1, r0 + ldr r0, [r1] + cmp r0, 0 + bne _08047FD0 + str r5, [r1] +_08047FD0: + ldr r2, =0x020241f4 + ldrb r1, [r7] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + ldrb r0, [r0, 0xA] + str r0, [r2] + ldrb r1, [r7] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + strb r3, [r0, 0xA] +_08047FEC: + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + ldrb r0, [r0, 0xA] + cmp r0, 0 + beq _08048000 + b _0804829A +_08048000: + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + bl b_movescr_stack_push_cursor + ldr r0, =gUnknown_082DB6FB + str r0, [r4] + b _080482A2 + .pool +_08048028: + ldr r0, =0x02024280 + ldr r2, [r0] + ldr r1, =0xfffffeff + ands r2, r1 + str r2, [r0] + ldr r1, =0x020241f0 + ldr r5, [r1] + mov r12, r0 + adds r7, r1, 0 + cmp r5, 0 + bge _0804807C + ldr r4, =0x02024084 + ldr r2, =0x02024064 + ldrb r0, [r2] + movs r3, 0x58 + adds r1, r0, 0 + muls r1, r3 + adds r1, r4 + ldrh r0, [r1, 0x28] + subs r0, r5 + strh r0, [r1, 0x28] + ldrb r0, [r2] + muls r0, r3 + adds r1, r0, r4 + ldrh r3, [r1, 0x2C] + ldrh r0, [r1, 0x28] + adds r5, r2, 0 + cmp r0, r3 + bhi _08048064 + b _0804823A +_08048064: + strh r3, [r1, 0x28] + b _0804823A + .pool +_0804807C: + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + beq _08048098 + movs r0, 0x21 + negs r0, r0 + ands r2, r0 + mov r0, r12 + str r2, [r0] + ldr r5, =0x02024064 + b _080480E0 + .pool +_08048098: + ldr r0, =0x020241f8 + ldr r2, =0x02024064 + ldrb r1, [r2] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + adds r0, r5 + str r0, [r1] + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + adds r5, r2, 0 + cmp r0, 0 + bne _080480D4 + ldr r1, =0x02024288 + ldrb r0, [r5] + adds r0, r1 + ldr r1, =0x0202420b + b _080480DC + .pool +_080480D4: + ldr r1, =0x02024288 + ldrb r0, [r5] + adds r0, r1 + ldr r1, =0x0202420c +_080480DC: + ldrb r1, [r1] + strb r1, [r0] +_080480E0: + ldr r4, =0x02024084 + ldrb r0, [r5] + movs r3, 0x58 + muls r0, r3 + adds r2, r0, r4 + ldrh r0, [r2, 0x28] + ldr r1, [r7] + cmp r0, r1 + ble _08048110 + subs r0, r1 + strh r0, [r2, 0x28] + ldr r0, =0x020241f4 + str r1, [r0] + adds r7, r0, 0 + b _08048120 + .pool +_08048110: + ldr r2, =0x020241f4 + str r0, [r2] + ldrb r0, [r5] + muls r0, r3 + adds r0, r4 + movs r1, 0 + strh r1, [r0, 0x28] + adds r7, r2, 0 +_08048120: + ldr r2, =0x0202437c + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r1, r2, 0x4 + adds r3, r0, r1 + ldr r0, [r3] + adds r4, r2, 0 + cmp r0, 0 + bne _08048148 + mov r1, r12 + ldr r0, [r1] + movs r1, 0x80 + lsls r1, 13 + ands r0, r1 + cmp r0, 0 + bne _08048148 + ldr r0, [r7] + str r0, [r3] +_08048148: + cmp r6, 0x8 + bhi _080481D0 + mov r1, r12 + ldr r0, [r1] + movs r1, 0x80 + lsls r1, 13 + ands r0, r1 + cmp r0, 0 + bne _080481CC + ldr r0, =0x020241ea + ldrh r0, [r0] + cmp r0, 0xDC + beq _080481CC + ldr r3, =0x0202433c + ldrb r0, [r5] + lsls r0, 4 + adds r1, r3, 0x4 + adds r0, r1 + ldr r2, [r7] + str r2, [r0] + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x8 + adds r0, r1 + str r2, [r0] + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _080481AC + ldrb r0, [r5] + lsls r0, 4 + adds r0, r3 + ldr r2, =0x0202420b + b _080481B4 + .pool +_080481AC: + ldrb r0, [r5] + lsls r0, 4 + adds r0, r3 + ldr r2, =0x0202420c +_080481B4: + ldrb r1, [r2] + strb r1, [r0, 0xC] + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r2] + strb r1, [r0, 0x10] + b _0804823A + .pool +_080481CC: + cmp r6, 0x8 + bls _0804823A +_080481D0: + mov r1, r12 + ldr r0, [r1] + movs r1, 0x80 + lsls r1, 13 + ands r0, r1 + cmp r0, 0 + bne _0804823A + ldr r3, =0x0202433c + ldrb r0, [r5] + lsls r0, 4 + adds r1, r3, 0 + adds r1, 0x8 + adds r0, r1 + ldr r2, [r7] + str r2, [r0] + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0xC + adds r0, r1 + str r2, [r0] + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _08048220 + ldrb r0, [r5] + lsls r0, 4 + adds r0, r3 + ldr r2, =0x0202420b + b _08048228 + .pool +_08048220: + ldrb r0, [r5] + lsls r0, 4 + adds r0, r3 + ldr r2, =0x0202420c +_08048228: + ldrb r1, [r2] + strb r1, [r0, 0xD] + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r2] + strb r1, [r0, 0x11] +_0804823A: + mov r1, r12 + ldr r0, [r1] + ldr r1, =0xffefffff + ands r0, r1 + mov r1, r12 + str r0, [r1] + ldrb r1, [r5] + movs r0, 0x58 + muls r0, r1 + ldr r1, =0x020240ac + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x2A + movs r2, 0 + movs r3, 0x2 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + b _0804829A + .pool +_08048274: + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r1, =0x02024064 + strb r0, [r1] + ldr r2, =0x0202437c + ldrb r1, [r1] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x4 + adds r1, r0, r2 + ldr r0, [r1] + cmp r0, 0 + bne _0804829A + ldr r0, =0x0000ffff + str r0, [r1] +_0804829A: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_080482A2: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk0C_datahpupdate + + thumb_func_start atk0D_critmessage +atk0D_critmessage: @ 80482BC + push {lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _080482F2 + ldr r0, =0x02024211 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080482EA + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _080482EA + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0xD9 + bl b_std_message + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x7] +_080482EA: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_080482F2: + pop {r0} + bx r0 + .pool + thumb_func_end atk0D_critmessage + + thumb_func_start atk0E_missmessage +atk0E_missmessage: @ 8048310 + push {r4,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _080483D0 + ldr r4, =0x02024064 + ldr r0, =0x0202420c + ldrb r0, [r0] + strb r0, [r4] + ldr r1, =0x0202427c + ldrb r2, [r1] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + bne _080483C8 + movs r0, 0xFE + ands r0, r2 + cmp r0, 0x10 + beq _08048382 + cmp r0, 0x10 + bgt _0804835E + cmp r0, 0x4 + beq _08048372 + cmp r0, 0x4 + bgt _08048358 + cmp r0, 0x2 + beq _0804836C + b _08048382 + .pool +_08048358: + cmp r0, 0x8 + beq _080483C8 + b _08048382 +_0804835E: + cmp r0, 0x40 + beq _08048382 + cmp r0, 0x40 + bgt _08048382 + cmp r0, 0x20 + beq _080483C8 + b _08048382 +_0804836C: + movs r0, 0 + movs r1, 0xE + b _08048376 +_08048372: + movs r0, 0 + movs r1, 0xC +_08048376: + bl dp01_build_cmdbuf_x2B_aa_0 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _080483C8 +_08048382: + ldrb r1, [r1] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08048392 + movs r0, 0 + movs r1, 0xE + b _0804839E +_08048392: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080483B0 + movs r0, 0 + movs r1, 0xC +_0804839E: + bl dp01_build_cmdbuf_x2B_aa_0 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + b _080483C8 + .pool +_080483B0: + movs r0, 0x28 + ands r0, r1 + cmp r0, 0 + bne _080483C8 + movs r0, 0 + movs r1, 0xD + bl dp01_build_cmdbuf_x2B_aa_0 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution +_080483C8: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_080483D0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk0E_missmessage + + thumb_func_start atk0F_resultmessage +atk0F_resultmessage: @ 80483E0 + push {r4-r7,lr} + movs r3, 0 + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _080483EE + b _08048580 +_080483EE: + ldr r1, =0x0202427c + ldrb r2, [r1] + movs r4, 0x1 + adds r0, r4, 0 + ands r0, r2 + adds r6, r1, 0 + ldr r7, =0x02024332 + cmp r0, 0 + beq _0804842C + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _0804840E + ldrb r0, [r7, 0x6] + cmp r0, 0x2 + bls _0804842C +_0804840E: + ldr r1, =gUnknown_085CC834 + ldrb r0, [r7, 0x6] + lsls r0, 1 + adds r0, r1 + ldrh r3, [r0] + strb r4, [r7, 0x7] + b _0804856A + .pool +_0804842C: + movs r0, 0x1 + strb r0, [r7, 0x7] + ldrb r5, [r6] + movs r0, 0xFE + ands r0, r5 + cmp r0, 0x10 + beq _08048470 + cmp r0, 0x10 + bgt _08048452 + cmp r0, 0x4 + beq _0804846C + cmp r0, 0x4 + bgt _0804844C + cmp r0, 0x2 + beq _08048468 + b _080484B8 +_0804844C: + cmp r0, 0x8 + beq _080484C4 + b _080484B8 +_08048452: + cmp r0, 0x40 + beq _08048474 + cmp r0, 0x40 + bgt _08048462 + cmp r0, 0x20 + bne _08048460 + b _08048564 +_08048460: + b _080484B8 +_08048462: + cmp r0, 0x80 + beq _08048478 + b _080484B8 +_08048468: + movs r3, 0xDE + b _0804856E +_0804846C: + movs r3, 0xDD + b _0804856E +_08048470: + movs r3, 0xDA + b _0804856E +_08048474: + movs r3, 0x99 + b _0804856E +_08048478: + ldr r4, =0x02024208 + ldr r2, =0x02024084 + ldr r3, =0x0202420c + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x2E] + strh r0, [r4] + ldr r1, =0x0202420f + ldrb r0, [r3] + strb r0, [r1] + movs r0, 0x3F + ands r0, r5 + strb r0, [r6] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB816 + b _0804857E + .pool +_080484B8: + adds r2, r6, 0 + ldrb r5, [r2] + movs r0, 0x8 + ands r0, r5 + cmp r0, 0 + beq _080484C8 +_080484C4: + movs r3, 0x1B + b _0804856E +_080484C8: + movs r0, 0x10 + ands r0, r5 + cmp r0, 0 + beq _080484F0 + movs r0, 0xEF + ands r0, r5 + movs r1, 0xFD + ands r0, r1 + movs r1, 0xFB + ands r0, r1 + strb r0, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB1CE + b _0804857E + .pool +_080484F0: + movs r0, 0x40 + ands r0, r5 + cmp r0, 0 + beq _08048510 + movs r0, 0x3F + ands r0, r5 + strb r0, [r2] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB1C7 + b _0804857E + .pool +_08048510: + movs r0, 0x80 + ands r0, r5 + cmp r0, 0 + beq _08048558 + ldr r4, =0x02024208 + ldr r2, =0x02024084 + ldr r3, =0x0202420c + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x2E] + strh r0, [r4] + ldr r1, =0x0202420f + ldrb r0, [r3] + strb r0, [r1] + movs r0, 0x3F + ands r0, r5 + strb r0, [r6] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB816 + b _0804857E + .pool +_08048558: + movs r0, 0x20 + ands r0, r5 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08048568 +_08048564: + movs r3, 0xE5 + b _0804856E +_08048568: + strb r0, [r7, 0x7] +_0804856A: + cmp r3, 0 + beq _08048578 +_0804856E: + adds r0, r3, 0 + ldr r1, =0x0202420b + ldrb r1, [r1] + bl b_std_message +_08048578: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 +_0804857E: + str r0, [r1] +_08048580: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk0F_resultmessage + + thumb_func_start atk10_printstring +atk10_printstring: @ 8048590 + push {r4,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _080485BA + ldr r4, =0x02024214 + ldr r1, [r4] + ldrb r0, [r1, 0x1] + ldrb r1, [r1, 0x2] + lsls r1, 8 + orrs r0, r1 + ldr r1, =0x0202420b + ldrb r1, [r1] + bl b_std_message + ldr r0, [r4] + adds r0, 0x3 + str r0, [r4] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x7] +_080485BA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk10_printstring + + thumb_func_start atk11_printstring2 +atk11_printstring2: @ 80485D0 + push {r4,r5,lr} + ldr r5, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r5] + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r1, [r0, 0x1] + ldrb r0, [r0, 0x2] + lsls r0, 8 + orrs r1, r0 + movs r0, 0 + bl dp01_build_cmdbuf_x11_TODO + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r4] + adds r0, 0x3 + str r0, [r4] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x7] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk11_printstring2 + + thumb_func_start atk12_waitmessage +atk12_waitmessage: @ 8048614 + push {r4-r6,lr} + ldr r0, =0x02024068 + ldr r4, [r0] + cmp r4, 0 + bne _08048662 + ldr r6, =0x02024332 + ldrb r0, [r6, 0x7] + cmp r0, 0 + bne _0804863C + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x3 + str r0, [r1] + b _08048662 + .pool +_0804863C: + ldr r5, =0x02024214 + ldr r2, [r5] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldr r3, =0x0202432c + ldrh r0, [r3] + adds r0, 0x1 + strh r0, [r3] + lsls r0, 16 + lsrs r0, 16 + cmp r0, r1 + bcc _08048662 + movs r1, 0 + strh r4, [r3] + adds r0, r2, 0x3 + str r0, [r5] + strb r1, [r6, 0x7] +_08048662: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atk12_waitmessage + + thumb_func_start atk13_printfromtable +atk13_printfromtable: @ 8048670 + push {r4,r5,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _080486AE + ldr r4, =0x02024214 + ldr r2, [r4] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + ldr r5, =0x02024332 + ldrb r0, [r5, 0x5] + lsls r0, 1 + adds r1, r0 + ldrh r0, [r1] + ldr r1, =0x0202420b + ldrb r1, [r1] + bl b_std_message + ldr r0, [r4] + adds r0, 0x5 + str r0, [r4] + movs r0, 0x1 + strb r0, [r5, 0x7] +_080486AE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk13_printfromtable + + thumb_func_start atk14_printfromtable2 +atk14_printfromtable2: @ 80486C4 + push {r4-r6,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0804870E + ldr r5, =0x02024214 + ldr r2, [r5] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + ldr r6, =0x02024332 + ldrb r0, [r6, 0x5] + lsls r0, 1 + adds r1, r0 + ldr r4, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r4] + ldrh r1, [r1] + movs r0, 0 + bl dp01_build_cmdbuf_x11_TODO + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r5] + adds r0, 0x5 + str r0, [r5] + movs r0, 0x1 + strb r0, [r6, 0x7] +_0804870E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atk14_printfromtable2 + + thumb_func_start sub_8048728 +sub_8048728: @ 8048728 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r0, =0x0202406c + ldrb r3, [r0] + cmp r1, r3 + bge _0804874E + ldr r4, =0x0202407e + ldrb r0, [r4] + cmp r0, r2 + beq _0804874E +_08048740: + adds r1, 0x1 + cmp r1, r3 + bge _0804874E + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, r2 + bne _08048740 +_0804874E: + lsls r0, r1, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8048728 + + thumb_func_start sub_8048760 +sub_8048760: @ 8048760 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + movs r0, 0 + mov r10, r0 + movs r7, 0 + movs r1, 0x1 + str r1, [sp, 0x4] + ldr r1, =0x02024332 + ldrb r3, [r1, 0x3] + movs r0, 0x40 + ands r0, r3 + cmp r0, 0 + beq _080487B8 + ldr r2, =0x0202420e + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r2] + movs r0, 0xBF + ands r0, r3 + adds r3, r1, 0 + strb r0, [r3, 0x3] + movs r7, 0x40 + ldr r1, =0x02024474 + ldr r0, =0x0202420c + b _080487C4 + .pool +_080487B8: + ldr r2, =0x0202420e + ldr r0, =0x0202420c + ldrb r0, [r0] + strb r0, [r2] + ldr r1, =0x02024474 + ldr r0, =0x0202420b +_080487C4: + ldrb r0, [r0] + strb r0, [r1, 0x17] + mov r9, r2 + ldr r2, =0x02024084 + mov r4, r9 + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x13 + bne _08048828 + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 6 + ands r0, r1 + cmp r0, 0 + bne _08048828 + cmp r5, 0 + bne _08048828 + ldr r1, =0x02024332 + ldrb r0, [r1, 0x3] + cmp r0, 0x9 + bhi _08048828 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r2, =0x02024332 + strb r5, [r2, 0x3] + bl _080499B8 + .pool +_08048828: + mov r3, r9 + ldrb r0, [r3] + bl battle_get_per_side_status + ldr r2, =0x0202428e + movs r1, 0x1 + ands r1, r0 + lsls r1, 1 + adds r1, r2 + ldrh r1, [r1] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08048880 + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 6 + ands r0, r1 + cmp r0, 0 + bne _08048880 + cmp r5, 0 + bne _08048880 + ldr r0, =0x02024332 + ldrb r1, [r0, 0x3] + cmp r1, 0x7 + bhi _08048880 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r4, =0x02024332 + strb r5, [r4, 0x3] + bl _080499B8 + .pool +_08048880: + ldr r3, =0x02024084 + ldr r2, =0x0202420e + ldrb r1, [r2] + movs r0, 0x58 + muls r0, r1 + adds r0, r3 + ldrh r4, [r0, 0x28] + mov r9, r2 + mov r8, r3 + cmp r4, 0 + bne _080488C4 + ldr r1, =0x02024332 + ldrb r0, [r1, 0x3] + cmp r0, 0xB + beq _080488C4 + cmp r0, 0x1F + beq _080488C4 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r2, =0x02024332 + strb r4, [r2, 0x3] + bl _080499B8 + .pool +_080488C4: + mov r3, r9 + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + mov r1, r8 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _080488FC + cmp r7, 0x40 + beq _080488FC + ldr r0, =0x02024214 + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + movs r0, 0 + ldr r4, =0x02024332 + strb r0, [r4, 0x3] + bl _080499B8 + .pool +_080488FC: + ldr r1, =0x02024332 + ldrb r0, [r1, 0x3] + cmp r0, 0x6 + bls _08048906 + b _08048F40 +_08048906: + ldr r1, =gUnknown_0831C134 + ldr r2, =0x02024332 + ldrb r0, [r2, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x10 + bne _08048918 + b _08048AFC +_08048918: + cmp r0, 0x10 + bhi _08048930 + cmp r0, 0x7 + beq _0804894A + cmp r0, 0x8 + beq _08048A00 + b _08048DF4 + .pool +_08048930: + cmp r0, 0x40 + bne _08048936 + b _08048C84 +_08048936: + cmp r0, 0x40 + bhi _08048942 + cmp r0, 0x20 + bne _08048940 + b _08048BEA +_08048940: + b _08048DF4 +_08048942: + cmp r0, 0x80 + bne _08048948 + b _08048D02 +_08048948: + b _08048DF4 +_0804894A: + mov r3, r9 + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + add r0, r8 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x2B + beq _080489AC + ldr r0, =0x02024064 + movs r1, 0 + strb r1, [r0] + ldr r1, =0x0202406c + ldrb r3, [r1] + adds r7, r0, 0 + mov r12, r1 + cmp r3, 0 + beq _080489B8 + mov r4, r8 + ldr r0, [r4, 0x50] + movs r1, 0x70 + ands r0, r1 + cmp r0, 0 + bne _080489B8 + adds r1, r7, 0 + mov r6, r8 + adds r6, 0x50 + movs r5, 0x58 + movs r4, 0x70 +_08048984: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, r3 + bcs _080489B8 + ldrb r0, [r7] + muls r0, r5 + adds r0, r6 + ldr r0, [r0] + ands r0, r4 + cmp r0, 0 + beq _08048984 + b _080489B8 + .pool +_080489AC: + ldr r0, =0x02024064 + ldr r2, =0x0202406c + ldrb r1, [r2] + strb r1, [r0] + adds r7, r0, 0 + mov r12, r2 +_080489B8: + mov r0, r9 + ldrb r2, [r0] + movs r0, 0x58 + adds r1, r2, 0 + muls r1, r0 + mov r0, r8 + adds r0, 0x4C + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + beq _080489D0 + b _08048DF4 +_080489D0: + ldrb r0, [r7] + mov r3, r12 + ldrb r3, [r3] + cmp r0, r3 + beq _080489DC + b _08048DF4 +_080489DC: + mov r4, r8 + adds r0, r1, r4 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x48 + bne _080489EA + b _08048DF4 +_080489EA: + cmp r0, 0xF + bne _080489F0 + b _08048DF4 +_080489F0: + adds r0, r2, 0 + bl b_cancel_multi_turn_move_maybe + b _08048DE4 + .pool +_08048A00: + mov r2, r9 + ldrb r1, [r2] + movs r0, 0x58 + muls r0, r1 + add r0, r8 + adds r0, 0x20 + ldrb r1, [r0] + cmp r1, 0x11 + bne _08048A70 + cmp r5, 0x1 + beq _08048A1A + cmp r6, 0x80 + bne _08048A70 +_08048A1A: + ldr r0, =0x0202420a + strb r1, [r0] + mov r3, r9 + ldrb r0, [r3] + movs r1, 0x11 + bl b_history__record_ability_usage_of_player + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB5E9 + str r0, [r4] + ldr r2, =0x02024280 + ldr r1, [r2] + movs r0, 0x80 + lsls r0, 6 + ands r0, r1 + cmp r0, 0 + bne _08048A46 + b _08048D20 +_08048A46: + movs r0, 0x1 + ldr r4, =0x02024332 + strb r0, [r4, 0x5] +_08048A4C: + ldr r0, =0xffffdfff + ands r1, r0 + str r1, [r2] + bl _080499B2 + .pool +_08048A70: + mov r2, r9 + ldrb r0, [r2] + movs r1, 0x58 + muls r0, r1 + add r0, r8 + adds r1, r0, 0 + adds r1, 0x21 + ldrb r1, [r1] + cmp r1, 0x3 + beq _08048A94 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x3 + beq _08048A94 + cmp r1, 0x8 + beq _08048A94 + cmp r0, 0x8 + bne _08048AAE +_08048A94: + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 6 + ands r0, r1 + cmp r0, 0 + beq _08048AAE + cmp r5, 0x1 + bne _08048AA8 + b _08048D66 +_08048AA8: + cmp r6, 0x80 + bne _08048AAE + b _08048D66 +_08048AAE: + mov r3, r9 + ldrb r1, [r3] + movs r0, 0x58 + muls r1, r0 + mov r4, r8 + adds r3, r1, r4 + adds r0, r3, 0 + adds r0, 0x21 + ldrb r4, [r0] + cmp r4, 0x3 + bne _08048AC6 + b _08048DF4 +_08048AC6: + adds r0, 0x1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _08048AD0 + b _08048DF4 +_08048AD0: + cmp r4, 0x8 + bne _08048AD6 + b _08048DF4 +_08048AD6: + cmp r0, 0x8 + bne _08048ADC + b _08048DF4 +_08048ADC: + mov r0, r8 + adds r0, 0x4C + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + beq _08048AEA + b _08048DF4 +_08048AEA: + adds r0, r3, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x11 + bne _08048AF6 + b _08048DF4 +_08048AF6: + b _08048DE4 + .pool +_08048AFC: + mov r2, r9 + ldrb r1, [r2] + movs r0, 0x58 + muls r0, r1 + add r0, r8 + adds r0, 0x20 + ldrb r1, [r0] + cmp r1, 0x29 + bne _08048B54 + cmp r5, 0x1 + beq _08048B16 + cmp r6, 0x80 + bne _08048B54 +_08048B16: + ldr r0, =0x0202420a + strb r1, [r0] + mov r3, r9 + ldrb r0, [r3] + movs r1, 0x29 + bl b_history__record_ability_usage_of_player + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB5D1 + str r0, [r4] + ldr r2, =0x02024280 + ldr r1, [r2] + movs r0, 0x80 + lsls r0, 6 + ands r0, r1 + cmp r0, 0 + beq _08048B42 + b _08048A46 +_08048B42: + b _08048D20 + .pool +_08048B54: + mov r2, r9 + ldrb r1, [r2] + movs r0, 0x58 + muls r0, r1 + mov r3, r8 + adds r1, r0, r3 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0xA + beq _08048B74 + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0xA + bne _08048BA4 +_08048B74: + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 6 + ands r0, r1 + cmp r0, 0 + beq _08048BA4 + cmp r5, 0x1 + beq _08048B8A + cmp r6, 0x80 + bne _08048BA4 +_08048B8A: + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB5D1 + b _08048D72 + .pool +_08048BA4: + mov r4, r9 + ldrb r0, [r4] + movs r1, 0x58 + adds r2, r0, 0 + muls r2, r1 + mov r0, r8 + adds r1, r2, r0 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0xA + bne _08048BBE + b _08048DF4 +_08048BBE: + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0xA + bne _08048BCA + b _08048DF4 +_08048BCA: + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x29 + bne _08048BD6 + b _08048DF4 +_08048BD6: + mov r0, r8 + adds r0, 0x4C + adds r0, r2, r0 + ldr r0, [r0] + cmp r0, 0 + beq _08048BE4 + b _08048DF4 +_08048BE4: + movs r1, 0x1 + mov r10, r1 + b _08048DF4 +_08048BEA: + movs r0, 0 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08048C26 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _08048C26 + ldr r0, =0x020243cc + ldrh r1, [r0] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _08048C26 + movs r2, 0 + str r2, [sp, 0x4] +_08048C26: + ldr r4, =0x02024084 + ldr r0, =0x0202420e + ldrb r3, [r0] + movs r0, 0x58 + adds r2, r3, 0 + muls r2, r0 + adds r1, r2, r4 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0xF + bne _08048C40 + b _08048DF4 +_08048C40: + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0xF + bne _08048C4C + b _08048DF4 +_08048C4C: + adds r0, r4, 0 + adds r0, 0x4C + adds r0, r2, r0 + ldr r0, [r0] + cmp r0, 0 + beq _08048C5A + b _08048DF4 +_08048C5A: + ldr r4, [sp, 0x4] + cmp r4, 0 + bne _08048C62 + b _08048DF4 +_08048C62: + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x28 + bne _08048C6E + b _08048DF4 +_08048C6E: + adds r0, r3, 0 + bl b_cancel_multi_turn_move_maybe + b _08048DE4 + .pool +_08048C84: + mov r2, r9 + ldrb r1, [r2] + movs r0, 0x58 + muls r1, r0 + mov r3, r8 + adds r0, r1, r3 + adds r0, 0x20 + ldrb r2, [r0] + cmp r2, 0x7 + bne _08048CF4 + cmp r5, 0x1 + beq _08048CA2 + cmp r6, 0x80 + beq _08048CA2 + b _08048DF4 +_08048CA2: + ldr r0, =0x0202420a + strb r2, [r0] + mov r4, r9 + ldrb r0, [r4] + movs r1, 0x7 + bl b_history__record_ability_usage_of_player + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB5DD + str r0, [r4] + ldr r2, =0x02024280 + ldr r1, [r2] + movs r0, 0x80 + lsls r0, 6 + ands r0, r1 + cmp r0, 0 + beq _08048CE8 + movs r0, 0x1 + ldr r3, =0x02024332 + strb r0, [r3, 0x5] + b _08048A4C + .pool +_08048CE8: + ldr r4, =0x02024332 + strb r0, [r4, 0x5] + bl _080499B2 + .pool +_08048CF4: + mov r0, r8 + adds r0, 0x4C + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08048DF4 + b _08048DE4 +_08048D02: + mov r2, r9 + ldrb r1, [r2] + movs r0, 0x58 + muls r0, r1 + add r0, r8 + adds r0, 0x20 + ldrb r1, [r0] + cmp r1, 0x11 + bne _08048D2C + cmp r5, 0x1 + bne _08048D1A + b _08048A1A +_08048D1A: + cmp r6, 0x80 + bne _08048D2C + b _08048A1A +_08048D20: + ldr r1, =0x02024332 + strb r0, [r1, 0x5] + bl _080499B2 + .pool +_08048D2C: + mov r2, r9 + ldrb r0, [r2] + movs r1, 0x58 + muls r0, r1 + add r0, r8 + adds r1, r0, 0 + adds r1, 0x21 + ldrb r1, [r1] + cmp r1, 0x3 + beq _08048D50 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x3 + beq _08048D50 + cmp r1, 0x8 + beq _08048D50 + cmp r0, 0x8 + bne _08048D94 +_08048D50: + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 6 + ands r0, r1 + cmp r0, 0 + beq _08048D94 + cmp r5, 0x1 + beq _08048D66 + cmp r6, 0x80 + bne _08048D94 +_08048D66: + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB5E9 +_08048D72: + str r0, [r4] + ldr r1, =0x02024332 + movs r2, 0 + movs r0, 0x2 + strb r0, [r1, 0x5] + strb r2, [r1, 0x3] + bl _080499B8 + .pool +_08048D94: + mov r3, r9 + ldrb r0, [r3] + movs r6, 0x58 + muls r0, r6 + mov r2, r8 + adds r2, 0x4C + adds r5, r0, r2 + ldr r4, [r5] + cmp r4, 0 + bne _08048DF4 + mov r3, r8 + adds r1, r0, r3 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r3, [r0] + cmp r3, 0x3 + beq _08048DEA + adds r0, 0x1 + ldrb r0, [r0] + cmp r0, 0x3 + beq _08048DEA + cmp r3, 0x8 + beq _08048DEA + cmp r0, 0x8 + beq _08048DEA + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x11 + beq _08048DF4 + mov r4, r9 + ldrb r0, [r4] + adds r1, r0, 0 + muls r1, r6 + adds r1, r2 + ldr r0, [r1] + movs r2, 0x9 + negs r2, r2 + ands r0, r2 + str r0, [r1] +_08048DE4: + movs r0, 0x1 + mov r10, r0 + b _08048DF4 +_08048DEA: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0] +_08048DF4: + mov r1, r10 + cmp r1, 0x1 + beq _08048DFC + b _08048F1C +_08048DFC: + ldr r0, =0x02024214 + ldr r0, [r0] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r1, =gUnknown_0831C134 + ldr r0, =0x02024332 + ldrb r0, [r0, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r3, [r0] + cmp r3, 0x7 + bne _08048E50 + bl GenerateRandomNumber + ldr r2, =0x02024084 + ldr r1, =0x0202420e + ldrb r3, [r1] + movs r1, 0x58 + muls r3, r1 + adds r2, 0x4C + adds r3, r2 + movs r1, 0x3 + ands r1, r0 + adds r1, 0x2 + ldr r0, [r3] + orrs r0, r1 + str r0, [r3] + b _08048E64 + .pool +_08048E50: + ldr r2, =0x02024084 + ldr r0, =0x0202420e + ldrb r1, [r0] + movs r0, 0x58 + muls r1, r0 + adds r2, 0x4C + adds r1, r2 + ldr r0, [r1] + orrs r0, r3 + str r0, [r1] +_08048E64: + ldr r2, =0x02024214 + ldr r1, =gUnknown_0831C224 + ldr r5, =0x02024332 + ldrb r0, [r5, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + ldr r4, =0x02024064 + ldr r1, =0x0202420e + ldrb r0, [r1] + strb r0, [r4] + ldrb r1, [r1] + movs r0, 0x58 + muls r0, r1 + ldr r1, =0x020240d0 + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r2, =0x02024280 + ldr r1, [r2] + movs r0, 0x80 + lsls r0, 6 + ands r0, r1 + cmp r0, 0 + beq _08048ED8 + movs r0, 0x1 + strb r0, [r5, 0x5] + ldr r0, =0xffffdfff + ands r1, r0 + str r1, [r2] + b _08048EDA + .pool +_08048ED8: + strb r0, [r5, 0x5] +_08048EDA: + ldr r0, =0x02024332 + ldrb r2, [r0, 0x3] + cmp r2, 0x2 + beq _08048EF2 + cmp r2, 0x6 + beq _08048EF2 + cmp r2, 0x5 + beq _08048EF2 + cmp r2, 0x3 + beq _08048EF2 + bl _080499B8 +_08048EF2: + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0xB2 + ldr r2, =0x02024332 + ldrb r1, [r2, 0x3] + strb r1, [r0] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 7 + orrs r0, r1 + str r0, [r2] + bl _080499B8 + .pool +_08048F1C: + mov r3, r10 + cmp r3, 0 + beq _08048F26 + bl _080499B8 +_08048F26: + ldr r0, =0x02024332 + strb r3, [r0, 0x3] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bl _080499B8 + .pool +_08048F40: + mov r4, r9 + ldrb r1, [r4] + movs r0, 0x58 + muls r1, r0 + mov r0, r8 + adds r0, 0x50 + adds r1, r0 + ldr r2, =gUnknown_0831C134 + ldr r0, =0x02024332 + ldrb r3, [r0, 0x3] + lsls r0, r3, 2 + adds r0, r2 + ldr r1, [r1] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08048F66 + bl _08049994 +_08048F66: + subs r0, r3, 0x7 + cmp r0, 0x34 + bls _08048F70 + bl _080499B2 +_08048F70: + lsls r0, 2 + ldr r1, =_08048F88 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08048F88: + .4byte _0804905C + .4byte _080490D0 + .4byte _08049244 + .4byte _0804915C + .4byte _080491D8 + .4byte _0804927C + .4byte _080492C4 + .4byte _08049390 + .4byte _080493D4 + .4byte _080493D4 + .4byte _080493D4 + .4byte _080493D4 + .4byte _080493D4 + .4byte _080493D4 + .4byte _080493D4 + .4byte _0804941C + .4byte _0804941C + .4byte _0804941C + .4byte _0804941C + .4byte _0804941C + .4byte _0804941C + .4byte _0804941C + .4byte _080494FC + .4byte _08049544 + .4byte _08049564 + .4byte _08049720 + .4byte _0804975C + .4byte _08049778 + .4byte _08049790 + .4byte _080497A8 + .4byte _08049808 + .4byte _08049820 + .4byte _08049468 + .4byte _08049468 + .4byte _08049468 + .4byte _08049468 + .4byte _08049468 + .4byte _08049468 + .4byte _08049468 + .4byte _080494B0 + .4byte _080494B0 + .4byte _080494B0 + .4byte _080494B0 + .4byte _080494B0 + .4byte _080494B0 + .4byte _080494B0 + .4byte _08049864 + .4byte _080498C0 + .4byte _080499B2 + .4byte _080499B2 + .4byte _080499B2 + .4byte _080499B2 + .4byte _080499A4 +_0804905C: + mov r1, r9 + ldrb r0, [r1] + movs r5, 0x58 + adds r1, r0, 0 + muls r1, r5 + mov r2, r8 + adds r0, r1, r2 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x14 + bne _08049076 + bl _08049994 +_08049076: + mov r4, r8 + adds r4, 0x50 + adds r0, r1, r4 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + beq _0804908A + bl _08049994 +_0804908A: + bl GenerateRandomNumber + mov r3, r9 + ldrb r1, [r3] + adds r2, r1, 0 + muls r2, r5 + adds r2, r4 + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + lsrs r1, 16 + adds r1, 0x2 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r1, =gUnknown_0831C224 + ldr r0, =0x02024332 + ldrb r0, [r0, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _080499B0 + .pool +_080490D0: + mov r4, r9 + ldrb r2, [r4] + movs r4, 0x58 + adds r0, r2, 0 + muls r0, r4 + add r0, r8 + adds r0, 0x20 + ldrb r1, [r0] + cmp r1, 0x27 + bne _08049114 + cmp r5, 0x1 + beq _080490F0 + cmp r6, 0x80 + beq _080490F0 + bl _08049994 +_080490F0: + ldr r0, =0x0202420a + strb r1, [r0] + mov r1, r9 + ldrb r0, [r1] + movs r1, 0x27 + bl b_history__record_ability_usage_of_player + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB603 + str r0, [r1] + bl _080499B2 + .pool +_08049114: + adds r0, r2, 0 + bl sub_8048728 + ldr r1, =0x02024082 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bhi _0804912A + bl _08049994 +_0804912A: + mov r2, r9 + ldrb r0, [r2] + adds r2, r0, 0 + muls r2, r4 + mov r0, r8 + adds r0, 0x50 + adds r2, r0 + ldr r1, =gUnknown_0831C134 + ldr r0, =0x02024332 + ldrb r0, [r0, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + orrs r1, r0 + str r1, [r2] + bl _08049994 + .pool +_0804915C: + mov r3, r9 + ldrb r0, [r3] + movs r5, 0x58 + muls r0, r5 + mov r4, r8 + adds r4, 0x50 + adds r2, r0, r4 + ldr r1, [r2] + movs r0, 0x70 + ands r0, r1 + cmp r0, 0 + beq _08049178 + bl _08049994 +_08049178: + movs r0, 0x80 + lsls r0, 5 + orrs r1, r0 + str r1, [r2] + ldr r1, =0x02024268 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r1 + ldr r1, =0x020241ea + ldrh r1, [r1] + strh r1, [r0] + bl GenerateRandomNumber + mov r2, r9 + ldrb r1, [r2] + adds r2, r1, 0 + muls r2, r5 + adds r2, r4 + movs r1, 0x3 + ands r1, r0 + adds r1, 0x2 + lsls r1, 4 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r1, =gUnknown_0831C224 + ldr r0, =0x02024332 + ldrb r0, [r0, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _080499B0 + .pool +_080491D8: + ldr r5, =0x0202420b + ldrb r0, [r5] + bl battle_get_per_side_status + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + bne _08049210 + ldr r4, =0x0202432e + ldrh r3, [r4] + ldr r2, =0x02024084 + ldrb r1, [r5] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x2A + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + adds r0, r3, r0 + strh r0, [r4] + lsls r0, 16 + lsrs r0, 16 + cmp r3, r0 + bls _08049210 + ldr r3, =0x0000ffff + adds r0, r3, 0 + strh r0, [r4] +_08049210: + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r1, =gUnknown_0831C224 + ldr r0, =0x02024332 + ldrb r0, [r0, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + b _080499B0 + .pool +_08049244: + mov r4, r9 + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + mov r1, r8 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _0804925A + b _08049994 +_0804925A: + bl GenerateRandomNumber + ldr r4, =0x02024332 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + adds r0, 0x3 + strb r0, [r4, 0x3] + movs r0, 0 + movs r1, 0 + bl sub_8048760 + b _080499B2 + .pool +_0804927C: + mov r0, r9 + ldrb r1, [r0] + movs r0, 0x58 + adds r2, r1, 0 + muls r2, r0 + mov r0, r8 + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 5 + orrs r0, r1 + str r0, [r2] + ldr r1, =0x02024268 + mov r2, r9 + ldrb r0, [r2] + lsls r0, 1 + adds r0, r1 + ldr r1, =0x020241ea + ldrh r1, [r1] + strh r1, [r0] + ldr r0, =0x0202433c + ldrb r1, [r2] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1, 0x1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1, 0x1] + b _08049994 + .pool +_080492C4: + mov r3, r9 + ldrb r0, [r3] + movs r6, 0x58 + muls r0, r6 + mov r4, r8 + adds r4, 0x50 + adds r0, r4 + ldr r5, [r0] + movs r0, 0xE0 + lsls r0, 8 + ands r5, r0 + cmp r5, 0 + beq _080492E0 + b _08049994 +_080492E0: + bl GenerateRandomNumber + mov r2, r9 + ldrb r1, [r2] + adds r2, r1, 0 + muls r2, r6 + adds r2, r4 + movs r1, 0x3 + ands r1, r0 + adds r1, 0x3 + lsls r1, 13 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + mov r3, r9 + ldrb r1, [r3] + ldr r2, =0x0202449c + ldr r0, [r2] + lsls r1, 1 + adds r1, r0 + ldr r6, =0x020241ea + ldrh r0, [r6] + strb r0, [r1, 0x4] + ldrb r1, [r3] + ldr r0, [r2] + lsls r1, 1 + adds r1, r0 + ldrh r0, [r6] + lsrs r0, 8 + strb r0, [r1, 0x5] + ldrb r1, [r3] + ldr r0, [r2] + adds r1, r0 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r1, 0x14] + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r1, =gUnknown_0831C224 + ldr r2, =0x02024332 + ldrb r0, [r2, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r4] + strb r5, [r2, 0x5] + ldr r3, =gUnknown_085CC982 + ldrh r0, [r3] + ldrh r4, [r6] + cmp r0, r4 + bne _0804934E + b _080499B2 +_0804934E: + adds r1, r2, 0 + adds r2, r6, 0 +_08049352: + ldrb r0, [r1, 0x5] + adds r0, 0x1 + strb r0, [r1, 0x5] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bls _08049362 + b _080499B2 +_08049362: + ldrb r0, [r1, 0x5] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + ldrh r4, [r2] + cmp r0, r4 + bne _08049352 + b _080499B2 + .pool +_08049390: + ldr r1, =0x020241f0 + ldr r0, =0x020241f4 + ldr r0, [r0] + cmp r0, 0 + bge _0804939C + adds r0, 0x3 +_0804939C: + asrs r0, 2 + str r0, [r1] + cmp r0, 0 + bne _080493A8 + movs r0, 0x1 + str r0, [r1] +_080493A8: + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r1, =gUnknown_0831C224 + ldr r0, =0x02024332 + ldrb r0, [r0, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + b _080499B0 + .pool +_080493D4: + ldr r4, =0x02024332 + ldrb r1, [r4, 0x3] + adds r1, 0xF2 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x10 + adds r2, r7, 0 + movs r3, 0 + bl sub_8050A1C + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _080493F2 + b _08049994 +_080493F2: + ldr r2, =0x02024474 + ldrb r1, [r4, 0x3] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2, 0x10] + strb r3, [r2, 0x11] + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082D8CD4 + b _080499B0 + .pool +_0804941C: + movs r0, 0x70 + negs r0, r0 + ldr r4, =0x02024332 + ldrb r1, [r4, 0x3] + adds r1, 0xEB + lsls r1, 24 + lsrs r1, 24 + adds r2, r7, 0 + movs r3, 0 + bl sub_8050A1C + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _0804943C + b _08049994 +_0804943C: + ldr r2, =0x02024474 + ldrb r1, [r4, 0x3] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2, 0x10] + strb r3, [r2, 0x11] + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082D8D65 + b _080499B0 + .pool +_08049468: + ldr r4, =0x02024332 + ldrb r1, [r4, 0x3] + adds r1, 0xDA + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x20 + adds r2, r7, 0 + movs r3, 0 + bl sub_8050A1C + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _08049486 + b _08049994 +_08049486: + ldr r2, =0x02024474 + ldrb r1, [r4, 0x3] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2, 0x10] + strb r3, [r2, 0x11] + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082D8CD4 + b _080499B0 + .pool +_080494B0: + movs r0, 0x60 + negs r0, r0 + ldr r4, =0x02024332 + ldrb r1, [r4, 0x3] + adds r1, 0xD3 + lsls r1, 24 + lsrs r1, 24 + adds r2, r7, 0 + movs r3, 0 + bl sub_8050A1C + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _080494D0 + b _08049994 +_080494D0: + ldr r2, =0x02024474 + ldrb r1, [r4, 0x3] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2, 0x10] + strb r3, [r2, 0x11] + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082D8D65 + b _080499B0 + .pool +_080494FC: + mov r0, r9 + ldrb r1, [r0] + movs r0, 0x58 + adds r2, r1, 0 + muls r2, r0 + mov r0, r8 + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 15 + orrs r0, r1 + str r0, [r2] + ldr r2, =0x020242bc + mov r3, r9 + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2 + strb r1, [r0, 0x19] + ldr r1, =0x02024268 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r1 + ldr r1, =0x020241ea + ldrh r1, [r1] + strh r1, [r0] + b _08049994 + .pool +_08049544: + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + adds r2, r1, 0 + muls r2, r0 + mov r0, r8 + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 16 +_0804955A: + orrs r0, r1 + str r0, [r2] + b _08049994 + .pool +_08049564: + ldr r5, =0x02022fec + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 19 + ands r0, r1 + cmp r0, 0 + beq _08049574 + b _08049994 +_08049574: + ldr r6, =0x0202420b + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080495A8 + ldr r0, [r5] + ldr r1, =0x0a3f0902 + ands r0, r1 + cmp r0, 0 + bne _080495D4 + b _08049994 + .pool +_080495A8: + ldr r0, [r5] + ldr r1, =0x0a3f0902 + ands r0, r1 + cmp r0, 0 + bne _080495D4 + ldr r0, =0x020243d0 + adds r0, 0x29 + adds r0, r4, r0 + ldrb r1, [r0] + ldr r3, =gUnknown_0832A328 + ldr r2, =0x0202406e + ldrb r0, [r6] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _080495D4 + b _08049994 +_080495D4: + ldr r2, =0x02024084 + ldr r1, =0x0202420c + ldrb r0, [r1] + movs r5, 0x58 + muls r0, r5 + adds r4, r0, r2 + ldrh r0, [r4, 0x2E] + adds r7, r1, 0 + mov r8, r2 + cmp r0, 0 + beq _0804963C + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x3C + bne _0804963C + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB682 + str r0, [r1] + ldr r1, =0x0202420a + ldrb r0, [r7] + muls r0, r5 + add r0, r8 + adds r0, 0x20 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + ldrb r1, [r1] + bl b_history__record_ability_usage_of_player + b _080499B2 + .pool +_0804963C: + ldr r4, =0x0202420b + mov r10, r4 + ldrb r2, [r4] + movs r0, 0x58 + mov r9, r0 + mov r0, r9 + muls r0, r2 + add r0, r8 + ldrh r4, [r0, 0x2E] + cmp r4, 0 + beq _08049654 + b _08049994 +_08049654: + ldrb r0, [r7] + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + add r0, r8 + ldrh r3, [r0, 0x2E] + adds r1, r3, 0 + cmp r1, 0xAF + bne _08049668 + b _08049994 +_08049668: + adds r0, r3, 0 + subs r0, 0x79 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xB + bhi _08049676 + b _08049994 +_08049676: + cmp r1, 0 + bne _0804967C + b _08049994 +_0804967C: + ldr r5, =0x0202449c + lsls r0, r2, 1 + adds r0, 0xD0 + ldr r1, [r5] + adds r1, r0 + ldr r2, =0x02024208 + strh r3, [r1] + strh r3, [r2] + ldrb r0, [r7] + mov r3, r9 + muls r3, r0 + adds r0, r3, 0 + add r0, r8 + movs r6, 0 + strh r4, [r0, 0x2E] + ldr r4, =0x02024064 + mov r1, r10 + ldrb r0, [r1] + strb r0, [r4] + str r2, [sp] + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + movs r3, 0x2 + bl dp01_build_cmdbuf_x02_a_b_varargs + mov r2, r10 + ldrb r0, [r2] + bl dp01_battle_side_mark_buffer_for_execution + ldrb r0, [r7] + strb r0, [r4] + ldrb r0, [r7] + mov r3, r9 + muls r3, r0 + adds r0, r3, 0 + mov r1, r8 + adds r1, 0x2E + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + movs r3, 0x2 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r7] + bl dp01_battle_side_mark_buffer_for_execution + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB422 + str r0, [r4] + ldrb r0, [r7] + ldr r1, [r5] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC8 + strb r6, [r0] + ldrb r0, [r7] + ldr r1, [r5] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC9 + strb r6, [r0] + b _080499B2 + .pool +_08049720: + ldr r3, =0x0202420c + ldrb r1, [r3] + movs r0, 0x58 + adds r2, r1, 0 + muls r2, r0 + mov r0, r8 + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 19 + orrs r0, r1 + str r0, [r2] + ldr r2, =0x020242bc + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0202420b + ldrb r1, [r1] + strb r1, [r0, 0x14] + b _08049994 + .pool +_0804975C: + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + adds r2, r1, 0 + muls r2, r0 + mov r0, r8 + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 20 + b _0804955A + .pool +_08049778: + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DAF27 + b _080499B0 + .pool +_08049790: + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DAFC3 + b _080499B0 + .pool +_080497A8: + ldr r6, =0x0202420c + ldrb r0, [r6] + movs r2, 0x58 + muls r0, r2 + mov r1, r8 + adds r1, 0x4C + adds r5, r0, r1 + ldr r4, [r5] + movs r0, 0x40 + ands r0, r4 + cmp r0, 0 + bne _080497C2 + b _08049994 +_080497C2: + movs r0, 0x41 + negs r0, r0 + ands r4, r0 + str r4, [r5] + ldr r4, =0x02024064 + ldrb r0, [r6] + strb r0, [r4] + ldrb r0, [r4] + muls r0, r2 + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB361 + b _080499B0 + .pool +_08049808: + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB117 + b _080499B0 + .pool +_08049820: + ldr r4, =0x020241f0 + ldr r0, =0x020241f4 + ldr r0, [r0] + movs r1, 0x3 + bl __divsi3 + str r0, [r4] + cmp r0, 0 + bne _08049836 + movs r0, 0x1 + str r0, [r4] +_08049836: + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r1, =gUnknown_0831C224 + ldr r0, =0x02024332 + ldrb r0, [r0, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + b _080499B0 + .pool +_08049864: + mov r4, r9 + ldrb r0, [r4] + movs r5, 0x58 + muls r0, r5 + mov r4, r8 + adds r4, 0x50 + adds r2, r0, r4 + ldr r1, [r2] + movs r0, 0xC0 + lsls r0, 4 + ands r0, r1 + cmp r0, 0 + beq _08049880 + b _08049994 +_08049880: + movs r0, 0x80 + lsls r0, 5 + orrs r1, r0 + str r1, [r2] + ldr r1, =0x02024268 + mov r2, r9 + ldrb r0, [r2] + lsls r0, 1 + adds r0, r1 + ldr r1, =0x020241ea + ldrh r1, [r1] + strh r1, [r0] + bl GenerateRandomNumber + mov r3, r9 + ldrb r1, [r3] + adds r2, r1, 0 + muls r2, r5 + adds r2, r4 + movs r1, 0x1 + ands r1, r0 + adds r1, 0x2 + lsls r1, 10 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + b _080499B2 + .pool +_080498C0: + mov r4, r9 + ldrb r3, [r4] + movs r5, 0x58 + adds r0, r3, 0 + muls r0, r5 + mov r2, r8 + adds r1, r0, r2 + adds r0, r1, 0 + adds r0, 0x20 + ldrb r2, [r0] + cmp r2, 0x3C + bne _08049900 + ldrh r0, [r1, 0x2E] + cmp r0, 0 + beq _08049994 + ldr r0, =0x0202420a + strb r2, [r0] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB63F + str r0, [r1] + ldrb r0, [r4] + movs r1, 0x3C + bl b_history__record_ability_usage_of_player + b _080499B2 + .pool +_08049900: + ldrh r0, [r1, 0x2E] + cmp r0, 0 + beq _08049994 + adds r0, r3, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x02024208 + mov r3, r9 + ldrb r0, [r3] + muls r0, r5 + add r0, r8 + ldrh r0, [r0, 0x2E] + strh r0, [r1] + ldrb r0, [r3] + muls r0, r5 + add r0, r8 + movs r5, 0 + movs r1, 0 + strh r1, [r0, 0x2E] + ldr r2, =0x020243d0 + adds r2, 0x29 + adds r2, r4, r2 + ldr r3, =gUnknown_0832A328 + ldr r1, =0x0202406e + mov r4, r9 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB168 + str r0, [r4] + mov r1, r9 + ldrb r0, [r1] + ldr r2, =0x0202449c + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC8 + strb r5, [r0] + mov r3, r9 + ldrb r0, [r3] + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC9 + strb r5, [r0] + b _080499B2 + .pool +_08049994: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + b _080499B2 + .pool +_080499A4: + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB1D5 +_080499B0: + str r0, [r4] +_080499B2: + ldr r1, =0x02024332 + movs r0, 0 + strb r0, [r1, 0x3] +_080499B8: + 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_8048760 + + thumb_func_start atk15_seteffectwithchancetarget +atk15_seteffectwithchancetarget: @ 80499D4 + push {r4,lr} + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x20 + bne _08049A10 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x5] + lsls r4, r0, 1 + b _08049A20 + .pool +_08049A10: + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r4, [r0, 0x5] +_08049A20: + ldr r3, =0x02024332 + ldrb r2, [r3, 0x3] + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _08049A50 + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _08049A50 + movs r0, 0x7F + ands r0, r2 + strb r0, [r3, 0x3] + b _08049A7E + .pool +_08049A50: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r4 + bcs _08049A9A + ldr r0, =0x02024332 + ldrb r0, [r0, 0x3] + cmp r0, 0 + beq _08049A9A + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _08049A9A + cmp r4, 0x63 + bls _08049A90 +_08049A7E: + movs r0, 0 + movs r1, 0x80 + bl sub_8048760 + b _08049AA2 + .pool +_08049A90: + movs r0, 0 + movs r1, 0 + bl sub_8048760 + b _08049AA2 +_08049A9A: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_08049AA2: + ldr r0, =0x02024332 + movs r1, 0 + strb r1, [r0, 0x3] + ldr r0, =0x02024474 + strb r1, [r0, 0x16] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk15_seteffectwithchancetarget + + thumb_func_start sub_8049AC0 +sub_8049AC0: @ 8049AC0 + push {lr} + movs r0, 0x1 + movs r1, 0 + bl sub_8048760 + pop {r0} + bx r0 + thumb_func_end sub_8049AC0 + + thumb_func_start sub_8049AD0 +sub_8049AD0: @ 8049AD0 + push {lr} + movs r0, 0 + movs r1, 0 + bl sub_8048760 + pop {r0} + bx r0 + thumb_func_end sub_8049AD0 + + thumb_func_start sub_8049AE0 +sub_8049AE0: @ 8049AE0 + push {lr} + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r2, =0x02024064 + strb r0, [r2] + ldr r3, =0x02024332 + ldrb r0, [r3, 0x3] + cmp r0, 0x6 + bhi _08049B14 + ldr r1, =0x02024084 + ldrb r2, [r2] + movs r0, 0x58 + muls r2, r0 + adds r1, 0x4C + b _08049B1E + .pool +_08049B14: + ldr r1, =0x02024084 + ldrb r2, [r2] + movs r0, 0x58 + muls r2, r0 + adds r1, 0x50 +_08049B1E: + adds r2, r1 + ldr r1, =gUnknown_0831C134 + ldrb r0, [r3, 0x3] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, [r2] + bics r0, r1 + str r0, [r2] + ldr r0, =0x02024332 + movs r2, 0 + strb r2, [r0, 0x3] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + ldr r0, =0x02024474 + strb r2, [r0, 0x16] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8049AE0 + + thumb_func_start atk19_faintpokemon +atk19_faintpokemon: @ 8049B5C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + ldr r0, =0x02024214 + ldr r2, [r0] + ldrb r1, [r2, 0x2] + adds r6, r0, 0 + cmp r1, 0 + beq _08049BE0 + ldrb r0, [r2, 0x1] + bl get_battle_side_of_something + ldr r5, =0x02024064 + strb r0, [r5] + ldr r2, =0x02024280 + ldr r1, =gUnknown_0832A328 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r2] + ands r0, r1 + cmp r0, 0 + bne _08049B94 + b _08049E2C +_08049B94: + ldr r1, [r6] + ldrb r4, [r1, 0x3] + ldrb r0, [r1, 0x4] + lsls r0, 8 + orrs r4, r0 + ldrb r0, [r1, 0x5] + lsls r0, 16 + orrs r4, r0 + ldrb r0, [r1, 0x6] + lsls r0, 24 + orrs r4, r0 + bl b_movescr_stack_pop_cursor + str r4, [r6] + ldrb r0, [r5] + bl battle_side_get_owner + ldr r1, =0x0202428e + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + ldrh r2, [r0] + ldr r1, =0x0000fdff + ands r1, r2 + strh r1, [r0] + b _08049E32 + .pool +_08049BE0: + ldrb r0, [r2, 0x1] + cmp r0, 0x1 + bne _08049C08 + ldr r1, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r1] + ldr r0, =0x0202420c + ldrb r0, [r0] + mov r9, r0 + ldr r4, =gUnknown_082DA7AA + b _08049C18 + .pool +_08049C08: + ldr r1, =0x02024064 + ldr r0, =0x0202420c + ldrb r0, [r0] + strb r0, [r1] + ldr r0, =0x0202420b + ldrb r0, [r0] + mov r9, r0 + ldr r4, =gUnknown_082DA7B7 +_08049C18: + mov r8, r1 + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + mov r7, r8 + ldrb r3, [r7] + lsls r0, r3, 2 + adds r0, r2 + ldr r2, [r0] + ands r1, r2 + cmp r1, 0 + beq _08049C32 + b _08049E2C +_08049C32: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r3 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08049C42 + b _08049E2C +_08049C42: + ldr r5, =0x02024280 + lsls r1, r2, 28 + ldr r0, [r5] + orrs r0, r1 + str r0, [r5] + ldr r0, [r6] + adds r0, 0x7 + bl b_movescr_stack_push + str r4, [r6] + ldrb r0, [r7] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08049CA4 + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 15 + orrs r0, r1 + str r0, [r5] + ldr r1, =0x03005d10 + ldrb r0, [r1] + cmp r0, 0xFE + bhi _08049C78 + adds r0, 0x1 + strb r0, [r1] +_08049C78: + ldrb r0, [r7] + bl sub_80570F4 + b _08049CCE + .pool +_08049CA4: + ldr r4, =0x03005d10 + ldrb r0, [r4, 0x1] + cmp r0, 0xFE + bhi _08049CB0 + adds r0, 0x1 + strb r0, [r4, 0x1] +_08049CB0: + ldr r1, =0x0202406e + mov r2, r8 + ldrb r0, [r2] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r4, 0x20] +_08049CCE: + ldr r2, =0x02024280 + ldr r1, [r2] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08049D0C + ldr r6, =0x02024084 + ldr r0, =0x0202420b + ldrb r0, [r0] + movs r5, 0x58 + muls r0, r5 + adds r0, r6 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08049D0C + movs r0, 0x41 + negs r0, r0 + ands r1, r0 + str r1, [r2] + ldr r4, =0x02024214 + ldr r0, [r4] + bl b_movescr_stack_push + ldr r1, =0x020241f0 + mov r0, r9 + muls r0, r5 + adds r0, r6 + ldrh r0, [r0, 0x28] + str r0, [r1] + ldr r0, =gUnknown_082DAE3E + str r0, [r4] +_08049D0C: + ldr r1, =0x020242ac + ldr r6, =0x0202420c + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 7 + ands r0, r1 + cmp r0, 0 + bne _08049D24 + b _08049E32 +_08049D24: + ldr r0, =0x02024280 + ldr r5, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r5, r0 + cmp r5, 0 + beq _08049D34 + b _08049E32 +_08049D34: + ldr r3, =0x0202420b + mov r8, r3 + ldrb r0, [r3] + bl battle_side_get_owner + adds r4, r0, 0 + ldrb r0, [r6] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _08049E32 + ldr r0, =0x02024084 + mov r9, r0 + mov r2, r8 + ldrb r1, [r2] + movs r7, 0x58 + adds r2, r1, 0 + muls r2, r7 + adds r0, r2, r0 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08049E32 + ldr r0, =0x020241ea + ldrh r0, [r0] + cmp r0, 0xA5 + beq _08049E32 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, r1, r0 + adds r0, 0x80 + ldrb r4, [r0] + adds r0, r4, r2 + mov r6, r9 + adds r6, 0x24 + adds r0, r6 + strb r5, [r0] + ldr r5, =0x02024214 + ldr r0, [r5] + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB18D + str r0, [r5] + ldr r5, =0x02024064 + mov r3, r8 + ldrb r0, [r3] + strb r0, [r5] + adds r1, r4, 0 + adds r1, 0x9 + lsls r1, 24 + lsrs r1, 24 + ldrb r0, [r5] + muls r0, r7 + adds r0, r6 + adds r0, r4 + str r0, [sp] + movs r0, 0 + movs r2, 0 + movs r3, 0x1 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + lsls r4, 1 + mov r2, r8 + ldrb r0, [r2] + muls r0, r7 + adds r0, r4, r0 + mov r2, r9 + adds r2, 0xC + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1, 0x2] + mov r3, r8 + ldrb r0, [r3] + muls r0, r7 + adds r4, r0 + adds r4, r2 + ldrh r0, [r4] + lsrs r0, 8 + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + b _08049E32 + .pool +_08049E2C: + ldr r0, [r6] + adds r0, 0x7 + str r0, [r6] +_08049E32: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end atk19_faintpokemon + + thumb_func_start sub_8049E40 +sub_8049E40: @ 8049E40 + push {r4,r5,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _08049E6A + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + movs r0, 0 + bl dp01_build_cmdbuf_x0A_A_A_A + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] +_08049E6A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8049E40 + + thumb_func_start sub_8049E7C +sub_8049E7C: @ 8049E7C + push {r4,r5,lr} + sub sp, 0x4 + ldr r0, =0x02024068 + ldr r5, [r0] + cmp r5, 0 + bne _08049EE8 + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _08049EB4 + ldr r2, =0x02024084 + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08049EDC +_08049EB4: + ldr r1, =0x02024084 + ldrb r0, [r4] + movs r2, 0x58 + muls r0, r2 + adds r1, 0x4C + adds r0, r1 + str r5, [r0] + ldrb r0, [r4] + muls r0, r2 + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_08049EDC: + bl sub_803A75C + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_08049EE8: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8049E7C + + thumb_func_start atk1C_jumpifstatus +atk1C_jumpifstatus: @ 8049F04 + push {r4,r5,lr} + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + lsls r0, 24 + lsrs r0, 24 + ldr r2, [r5] + ldrb r4, [r2, 0x2] + ldrb r1, [r2, 0x3] + lsls r1, 8 + adds r4, r1 + ldrb r1, [r2, 0x4] + lsls r1, 16 + adds r4, r1 + ldrb r1, [r2, 0x5] + lsls r1, 24 + adds r4, r1 + ldrb r3, [r2, 0x6] + ldrb r1, [r2, 0x7] + lsls r1, 8 + adds r3, r1 + ldrb r1, [r2, 0x8] + lsls r1, 16 + adds r3, r1 + ldrb r1, [r2, 0x9] + lsls r1, 24 + adds r3, r1 + ldr r2, =0x02024084 + movs r1, 0x58 + muls r1, r0 + adds r0, r2, 0 + adds r0, 0x4C + adds r0, r1, r0 + ldr r0, [r0] + ands r0, r4 + cmp r0, 0 + beq _08049F68 + adds r0, r1, r2 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08049F68 + str r3, [r5] + b _08049F70 + .pool +_08049F68: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0xA + str r0, [r1] +_08049F70: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk1C_jumpifstatus + + thumb_func_start atk1D_jumpifsecondarystatus +atk1D_jumpifsecondarystatus: @ 8049F7C + push {r4,r5,lr} + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + lsls r0, 24 + lsrs r0, 24 + ldr r2, [r5] + ldrb r4, [r2, 0x2] + ldrb r1, [r2, 0x3] + lsls r1, 8 + adds r4, r1 + ldrb r1, [r2, 0x4] + lsls r1, 16 + adds r4, r1 + ldrb r1, [r2, 0x5] + lsls r1, 24 + adds r4, r1 + ldrb r3, [r2, 0x6] + ldrb r1, [r2, 0x7] + lsls r1, 8 + adds r3, r1 + ldrb r1, [r2, 0x8] + lsls r1, 16 + adds r3, r1 + ldrb r1, [r2, 0x9] + lsls r1, 24 + adds r3, r1 + ldr r2, =0x02024084 + movs r1, 0x58 + muls r1, r0 + adds r0, r2, 0 + adds r0, 0x50 + adds r0, r1, r0 + ldr r0, [r0] + ands r0, r4 + cmp r0, 0 + beq _08049FE0 + adds r0, r1, r2 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08049FE0 + str r3, [r5] + b _08049FE8 + .pool +_08049FE0: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0xA + str r0, [r1] +_08049FE8: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk1D_jumpifsecondarystatus + + thumb_func_start atk1E_jumpifability +atk1E_jumpifability: @ 8049FF4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + ldr r6, =0x02024214 + ldr r2, [r6] + ldrb r5, [r2, 0x2] + mov r8, r5 + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 24 + adds r7, r1, r0 + ldrb r0, [r2, 0x1] + cmp r0, 0x8 + bne _0804A054 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0xD + adds r2, r5, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0804A0C8 + ldr r1, =0x0202420a + strb r5, [r1] + str r7, [r6] + subs r4, 0x1 + lsls r0, r4, 24 + lsrs r0, 24 + ldrb r1, [r1] + b _0804A0B0 + .pool +_0804A054: + cmp r0, 0x9 + bne _0804A08C + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0xC + adds r2, r5, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0804A0C8 + ldr r1, =0x0202420a + strb r5, [r1] + str r7, [r6] + subs r4, 0x1 + lsls r0, r4, 24 + lsrs r0, 24 + ldrb r1, [r1] + b _0804A0B0 + .pool +_0804A08C: + ldrb r0, [r2, 0x1] + bl get_battle_side_of_something + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r4 + adds r0, r1 + adds r0, 0x20 + ldrb r1, [r0] + cmp r1, r8 + bne _0804A0C8 + ldr r0, =0x0202420a + strb r1, [r0] + str r7, [r6] + ldrb r1, [r0] + adds r0, r4, 0 +_0804A0B0: + bl b_history__record_ability_usage_of_player + ldr r0, =0x02024474 + strb r4, [r0, 0x15] + b _0804A0CE + .pool +_0804A0C8: + ldr r0, [r6] + adds r0, 0x7 + str r0, [r6] +_0804A0CE: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end atk1E_jumpifability + + thumb_func_start sub_804A0DC +sub_804A0DC: @ 804A0DC + push {r4-r6,lr} + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r4, [r0, 0x1] + cmp r4, 0x1 + bne _0804A0FC + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_get_per_side_status + b _0804A106 + .pool +_0804A0FC: + ldr r0, =0x0202420c + ldrb r0, [r0] + bl battle_get_per_side_status + movs r4, 0x1 +_0804A106: + ands r4, r0 + ldr r6, =0x02024214 + ldr r3, [r6] + ldrb r2, [r3, 0x2] + ldrb r0, [r3, 0x3] + lsls r0, 8 + orrs r2, r0 + ldrb r1, [r3, 0x4] + ldrb r0, [r3, 0x5] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r3, 0x6] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r3, 0x7] + lsls r0, 24 + adds r5, r1, r0 + ldr r1, =0x0202428e + lsls r0, r4, 1 + adds r0, r1 + ldrh r0, [r0] + ands r2, r0 + cmp r2, 0 + beq _0804A148 + str r5, [r6] + b _0804A14E + .pool +_0804A148: + adds r0, r3, 0 + adds r0, 0x8 + str r0, [r6] +_0804A14E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_804A0DC + + thumb_func_start sub_804A154 +sub_804A154: @ 804A154 + push {r4,r5,lr} + movs r5, 0 + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02024084 + ldr r3, [r4] + movs r1, 0x58 + muls r0, r1 + ldrb r1, [r3, 0x3] + adds r0, r1 + adds r2, 0x18 + adds r0, r2 + ldrb r2, [r0] + ldrb r0, [r3, 0x2] + cmp r0, 0x5 + bhi _0804A212 + lsls r0, 2 + ldr r1, =_0804A194 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0804A194: + .4byte _0804A1AC + .4byte _0804A1BC + .4byte _0804A1CC + .4byte _0804A1DC + .4byte _0804A1EC + .4byte _0804A200 +_0804A1AC: + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r2, r0 + bne _0804A212 + b _0804A20C + .pool +_0804A1BC: + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r2, r0 + beq _0804A212 + b _0804A20C + .pool +_0804A1CC: + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r2, r0 + bls _0804A212 + b _0804A20C + .pool +_0804A1DC: + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r2, r0 + bcs _0804A212 + b _0804A20C + .pool +_0804A1EC: + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + ands r2, r0 + cmp r2, 0 + beq _0804A212 + b _0804A20C + .pool +_0804A200: + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + ands r2, r0 + cmp r2, 0 + bne _0804A212 +_0804A20C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_0804A212: + cmp r5, 0 + beq _0804A238 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x5] + ldrb r0, [r2, 0x6] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x8] + lsls r0, 24 + adds r1, r0 + str r1, [r3] + b _0804A240 + .pool +_0804A238: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x9 + str r0, [r1] +_0804A240: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804A154 + + thumb_func_start atk21_jumpifspecialstatusflag +atk21_jumpifspecialstatusflag: @ 804A24C + push {r4-r6,lr} + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r5, =0x02024064 + strb r0, [r5] + ldr r2, [r4] + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + adds r6, r1, r0 + ldrb r1, [r2, 0x7] + ldrb r0, [r2, 0x8] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x9] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0xA] + lsls r0, 24 + adds r3, r1, r0 + ldrb r0, [r2, 0x6] + cmp r0, 0 + beq _0804A2AC + ldr r0, =0x020242ac + ldrb r1, [r5] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + ands r0, r6 + cmp r0, 0 + bne _0804A2C4 + b _0804A2BC + .pool +_0804A2AC: + ldr r0, =0x020242ac + ldrb r1, [r5] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + ands r0, r6 + cmp r0, 0 + beq _0804A2C4 +_0804A2BC: + str r3, [r4] + b _0804A2CA + .pool +_0804A2C4: + adds r0, r2, 0 + adds r0, 0xB + str r0, [r4] +_0804A2CA: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end atk21_jumpifspecialstatusflag + + thumb_func_start sub_804A2D0 +sub_804A2D0: @ 804A2D0 + push {r4-r6,lr} + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + lsls r0, 24 + lsrs r0, 24 + ldr r3, [r4] + ldrb r5, [r3, 0x2] + ldrb r2, [r3, 0x3] + ldrb r1, [r3, 0x4] + lsls r1, 8 + adds r2, r1 + ldrb r1, [r3, 0x5] + lsls r1, 16 + adds r2, r1 + ldrb r1, [r3, 0x6] + lsls r1, 24 + adds r6, r2, r1 + ldr r2, =0x02024084 + movs r1, 0x58 + muls r0, r1 + adds r1, r0, r2 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, r5 + beq _0804A314 + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, r5 + bne _0804A320 +_0804A314: + str r6, [r4] + b _0804A324 + .pool +_0804A320: + adds r0, r3, 0x7 + str r0, [r4] +_0804A324: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_804A2D0 + + thumb_func_start sub_804A32C +sub_804A32C: @ 804A32C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r6, 0 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x50 + mov r9, r0 + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r1, =0x0202420d + strb r0, [r1] + ldr r2, =0x020243fe + movs r1, 0x2 + ands r1, r0 + lsls r1, 24 + lsrs r1, 25 + adds r1, r2 + ldrb r1, [r1] + mov r8, r1 + ldr r0, =0x02024474 + ldrb r0, [r0, 0x1C] + cmp r0, 0x6 + bls _0804A368 + bl _0804ACB2 +_0804A368: + lsls r0, 2 + ldr r1, =_0804A38C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0804A38C: + .4byte _0804A3A8 + .4byte _0804A414 + .4byte _0804A52E + .4byte _0804A850 + .4byte _0804A954 + .4byte _0804AC40 + .4byte _0804AC88 +_0804A3A8: + ldr r4, =0x0202420d + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0804A3BC + bl _0804AC7C +_0804A3BC: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x063f0982 + ands r0, r1 + cmp r0, 0 + beq _0804A3CC + bl _0804AC7C +_0804A3CC: + ldr r1, =0x02024474 + ldrb r0, [r1, 0x1C] + adds r0, 0x1 + strb r0, [r1, 0x1C] + ldr r0, =0x0202449c + ldr r2, [r0] + adds r2, 0xDF + ldr r3, =gUnknown_0832A328 + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + bl _0804ACB2 + .pool +_0804A414: + movs r5, 0 + movs r7, 0 +_0804A418: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _0804A486 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _0804A486 + ldr r0, =gUnknown_0832A328 + lsls r1, r7, 2 + adds r1, r0 + ldr r0, [r1] + mov r1, r8 + ands r0, r1 + cmp r0, 0 + beq _0804A44C + adds r5, 0x1 +_0804A44C: + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _0804A478 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00003226 + adds r0, r2 + ldrb r4, [r0] + b _0804A480 + .pool +_0804A478: + bl itemid_get_x12 + lsls r0, 24 + lsrs r4, r0, 24 +_0804A480: + cmp r4, 0x19 + bne _0804A486 + adds r6, 0x1 +_0804A486: + adds r7, 0x1 + cmp r7, 0x5 + ble _0804A418 + ldr r3, =gBaseStats + ldr r2, =0x02024084 + ldr r0, =0x0202420d + ldrb r1, [r0] + movs r0, 0x58 + muls r1, r0 + adds r1, r2 + ldrh r2, [r1] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r3 + ldrb r2, [r0, 0x9] + adds r1, 0x2A + ldrb r0, [r1] + muls r0, r2 + movs r1, 0x7 + bl __divsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r6, 0 + beq _0804A4FC + lsrs r4, r0, 17 + adds r0, r4, 0 + adds r1, r5, 0 + bl __divsi3 + mov r1, r9 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + bne _0804A4D2 + movs r0, 0x1 + strh r0, [r1] +_0804A4D2: + ldr r5, =0x02024402 + adds r0, r4, 0 + adds r1, r6, 0 + bl __divsi3 + strh r0, [r5] + lsls r0, 16 + cmp r0, 0 + bne _0804A516 + movs r0, 0x1 + strh r0, [r5] + b _0804A516 + .pool +_0804A4FC: + adds r0, r1, 0 + adds r1, r5, 0 + bl __divsi3 + mov r2, r9 + strh r0, [r2] + lsls r0, 16 + cmp r0, 0 + bne _0804A512 + movs r0, 0x1 + strh r0, [r2] +_0804A512: + ldr r0, =0x02024402 + strh r6, [r0] +_0804A516: + ldr r1, =0x02024474 + ldrb r0, [r1, 0x1C] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1, 0x1C] + ldr r1, =0x0202449c + ldr r0, [r1] + strb r2, [r0, 0x10] + ldr r0, [r1] + adds r0, 0x53 + mov r4, r8 + strb r4, [r0] +_0804A52E: + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _0804A538 + b _0804ACB2 +_0804A538: + ldr r0, =0x0202449c + ldr r0, [r0] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _0804A57C + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003226 + adds r0, r1 + ldrb r4, [r0] + b _0804A584 + .pool +_0804A57C: + bl itemid_get_x12 + lsls r0, 24 + lsrs r4, r0, 24 +_0804A584: + ldr r5, =0x0202449c + cmp r4, 0x19 + beq _0804A5AC + ldr r0, [r5] + adds r1, r0, 0 + adds r1, 0x53 + ldrb r0, [r1] + movs r2, 0x1 + ands r2, r0 + cmp r2, 0 + bne _0804A5AC + lsrs r0, 1 + strb r0, [r1] + ldr r1, =0x02024474 + b _0804A5D0 + .pool +_0804A5AC: + ldr r0, [r5] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x38 + bl pokemon_getattr + cmp r0, 0x64 + bne _0804A5E8 + ldr r1, [r5] + adds r1, 0x53 + ldrb r0, [r1] + lsrs r0, 1 + strb r0, [r1] + ldr r1, =0x02024474 + movs r2, 0 +_0804A5D0: + movs r0, 0x5 + strb r0, [r1, 0x1C] + ldr r0, =0x020241f0 + str r2, [r0] + b _0804ACB2 + .pool +_0804A5E8: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0804A616 + ldr r0, =0x02024084 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _0804A616 + ldr r0, [r5] + ldrb r0, [r0, 0x12] + cmp r0, 0 + bne _0804A616 + bl sub_805EA60 + ldr r0, =0x00000161 + bl song_play_for_text + ldr r1, [r5] + ldrb r0, [r1, 0x12] + adds r0, 0x1 + strb r0, [r1, 0x12] +_0804A616: + ldr r5, =0x0202449c + ldr r0, [r5] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _0804A630 + b _0804A824 +_0804A630: + ldr r0, [r5] + adds r0, 0x53 + ldrb r0, [r0] + movs r3, 0x1 + ands r3, r0 + cmp r3, 0 + beq _0804A664 + ldr r1, =0x020241f0 + mov r2, r9 + ldrh r0, [r2] + str r0, [r1] + mov r9, r1 + b _0804A66A + .pool +_0804A664: + ldr r0, =0x020241f0 + str r3, [r0] + mov r9, r0 +_0804A66A: + cmp r4, 0x19 + bne _0804A67A + ldr r0, =0x02024402 + ldrh r1, [r0] + mov r2, r9 + ldr r0, [r2] + adds r0, r1 + str r0, [r2] +_0804A67A: + cmp r4, 0x28 + bne _0804A68E + mov r4, r9 + ldr r1, [r4] + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + str r0, [r4] +_0804A68E: + ldr r5, =0x02022fec + ldr r0, [r5] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0804A6AA + ldr r4, =0x020241f0 + ldr r1, [r4] + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + str r0, [r4] +_0804A6AA: + ldr r4, =0x0202449c + ldr r0, [r4] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + bl sub_806E8A8 + lsls r0, 24 + cmp r0, 0 + beq _0804A714 + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _0804A6F8 + ldr r0, [r4] + ldrb r0, [r0, 0x10] + cmp r0, 0x2 + bls _0804A6F8 + ldr r7, =0x00000149 + ldr r0, =0x020241f0 + mov r9, r0 + b _0804A71A + .pool +_0804A6F8: + ldr r4, =0x020241f0 + ldr r1, [r4] + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + str r0, [r4] + movs r7, 0xA5 + lsls r7, 1 + mov r9, r4 + b _0804A71A + .pool +_0804A714: + ldr r7, =0x00000149 + ldr r1, =0x020241f0 + mov r9, r1 +_0804A71A: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0804A786 + ldr r0, =0x0202406e + ldr r1, =0x0202449c + ldr r4, [r1] + ldrh r0, [r0, 0x4] + adds r5, r1, 0 + ldr r3, =gUnknown_0832A328 + ldr r2, =0x02024210 + ldrb r1, [r4, 0x10] + cmp r0, r1 + bne _0804A76C + ldrb r1, [r2] + ldr r0, [r3, 0x8] + ands r1, r0 + cmp r1, 0 + bne _0804A76C + adds r1, r4, 0 + adds r1, 0x8F + movs r0, 0x2 + strb r0, [r1] + b _0804A78E + .pool +_0804A76C: + ldrb r2, [r2] + ldr r0, [r3] + ands r2, r0 + cmp r2, 0 + bne _0804A77E + ldr r0, [r5] + adds r0, 0x8F + strb r2, [r0] + b _0804A78E +_0804A77E: + ldr r0, [r5] + adds r0, 0x8F + movs r1, 0x2 + b _0804A78C +_0804A786: + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x8F +_0804A78C: + strb r1, [r0] +_0804A78E: + ldr r1, =0x02022f58 + movs r2, 0 + mov r12, r2 + movs r3, 0xFD + strb r3, [r1] + movs r5, 0x4 + strb r5, [r1, 0x1] + ldr r6, =0x0202449c + ldr r2, [r6] + movs r4, 0x8F + adds r4, r2 + mov r8, r4 + ldrb r0, [r4] + strb r0, [r1, 0x2] + ldrb r0, [r2, 0x10] + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x02022f68 + strb r3, [r1] + mov r0, r12 + strb r0, [r1, 0x1] + strb r7, [r1, 0x2] + movs r4, 0xFF + lsls r4, 8 + ands r7, r4 + asrs r0, r7, 8 + strb r0, [r1, 0x3] + movs r0, 0x1 + negs r0, r0 + strb r0, [r1, 0x4] + ldr r1, =0x02022f78 + strb r3, [r1] + movs r0, 0x1 + strb r0, [r1, 0x1] + strb r5, [r1, 0x2] + movs r0, 0x5 + strb r0, [r1, 0x3] + mov r0, r9 + ldr r2, [r0] + strb r2, [r1, 0x4] + adds r0, r2, 0 + ands r0, r4 + asrs r0, 8 + strb r0, [r1, 0x5] + movs r0, 0xFF + lsls r0, 16 + ands r0, r2 + asrs r0, 16 + strb r0, [r1, 0x6] + lsrs r2, 24 + strb r2, [r1, 0x7] + movs r0, 0x1 + negs r0, r0 + strb r0, [r1, 0x8] + mov r2, r8 + ldrb r1, [r2] + movs r0, 0xD + bl b_std_message + ldr r0, [r6] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r3, =0x02024084 + ldr r1, =0x0202420d + ldrb r2, [r1] + movs r1, 0x58 + muls r1, r2 + adds r1, r3 + ldrh r1, [r1] + bl sub_806DADC +_0804A824: + ldr r0, =0x0202449c + ldr r1, [r0] + adds r1, 0x53 + ldrb r0, [r1] + lsrs r0, 1 + strb r0, [r1] + b _0804A92A + .pool +_0804A850: + ldr r0, =0x02024068 + ldr r2, [r0] + cmp r2, 0 + beq _0804A85A + b _0804ACB2 +_0804A85A: + ldr r1, =0x02023864 + ldr r7, =0x0202449c + ldr r0, [r7] + adds r0, 0x8F + ldrb r0, [r0] + lsls r0, 9 + adds r0, r1 + strb r2, [r0] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _0804A92A + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r6 + adds r0, r5 + movs r1, 0x38 + bl pokemon_getattr + cmp r0, 0x64 + beq _0804A92A + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r6 + adds r0, r5 + movs r1, 0x3A + bl pokemon_getattr + ldr r4, =0x020244a8 + ldr r1, [r4] + ldr r1, [r1, 0x10] + strh r0, [r1] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r6 + adds r0, r5 + movs r1, 0x3B + bl pokemon_getattr + ldr r1, [r4] + ldr r1, [r1, 0x10] + strh r0, [r1, 0x2] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r6 + adds r0, r5 + movs r1, 0x3C + bl pokemon_getattr + ldr r1, [r4] + ldr r1, [r1, 0x10] + strh r0, [r1, 0x4] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r6 + adds r0, r5 + movs r1, 0x3D + bl pokemon_getattr + ldr r1, [r4] + ldr r1, [r1, 0x10] + strh r0, [r1, 0x6] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r6 + adds r0, r5 + movs r1, 0x3E + bl pokemon_getattr + ldr r1, [r4] + ldr r1, [r1, 0x10] + strh r0, [r1, 0x8] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r6 + adds r0, r5 + movs r1, 0x3F + bl pokemon_getattr + ldr r1, [r4] + ldr r1, [r1, 0x10] + strh r0, [r1, 0xA] + ldr r4, =0x02024064 + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0x8F + ldrb r0, [r0] + strb r0, [r4] + ldrb r1, [r1, 0x10] + ldr r0, =0x020241f0 + ldrh r2, [r0] + movs r0, 0 + bl dp01_build_cmdbuf_x19_a_bb + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0804A92A: + ldr r1, =0x02024474 + ldrb r0, [r1, 0x1C] + adds r0, 0x1 + strb r0, [r1, 0x1C] + b _0804ACB2 + .pool +_0804A954: + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _0804A95E + b _0804ACB2 +_0804A95E: + ldr r1, =0x02024064 + ldr r0, =0x0202449c + ldr r4, [r0] + adds r0, r4, 0 + adds r0, 0x8F + ldrb r0, [r0] + strb r0, [r1] + ldr r3, =0x02023864 + ldrb r2, [r1] + lsls r1, r2, 9 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0x21 + beq _0804A97C + b _0804AC28 +_0804A97C: + adds r0, r3, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + cmp r0, 0xB + beq _0804A988 + b _0804AC28 +_0804A988: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0804A9B2 + ldr r0, =0x0202406e + lsls r1, r2, 1 + adds r1, r0 + ldrh r0, [r1] + ldrb r4, [r4, 0x10] + cmp r0, r4 + bne _0804A9B2 + adds r1, r0, 0 + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + adds r1, r2, 0 + bl sub_805E990 +_0804A9B2: + ldr r1, =0x02022f58 + movs r3, 0xFD + strb r3, [r1] + movs r0, 0x4 + strb r0, [r1, 0x1] + ldr r6, =0x02024064 + ldrb r0, [r6] + strb r0, [r1, 0x2] + ldr r4, =0x0202449c + mov r9, r4 + ldr r2, [r4] + ldrb r0, [r2, 0x10] + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r4, =0x02022f68 + strb r3, [r4] + movs r0, 0x1 + strb r0, [r4, 0x1] + strb r0, [r4, 0x2] + movs r0, 0x3 + strb r0, [r4, 0x3] + ldrb r0, [r2, 0x10] + movs r1, 0x64 + mov r8, r1 + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + ldr r7, =0x020244ec + adds r0, r7 + movs r1, 0x38 + bl pokemon_getattr + strb r0, [r4, 0x4] + movs r0, 0x1 + negs r0, r0 + strb r0, [r4, 0x5] + bl b_movescr_stack_push_cursor + ldr r2, =0x03005d54 + ldr r1, =gUnknown_0832A328 + mov r4, r9 + ldr r5, [r4] + ldrb r0, [r5, 0x10] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DABBD + str r0, [r1] + ldr r4, =0x020241f0 + ldr r2, =0x02023864 + ldrb r1, [r6] + lsls r1, 9 + adds r0, r2, 0x2 + adds r0, r1, r0 + ldrb r3, [r0] + adds r2, 0x3 + adds r1, r2 + ldrb r0, [r1] + lsls r0, 8 + orrs r3, r0 + str r3, [r4] + ldrb r0, [r5, 0x10] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r7 + movs r1, 0 + bl happiness_algorithm + ldr r1, =0x0202406e + mov r2, r9 + ldr r0, [r2] + ldrb r2, [r0, 0x10] + ldrh r0, [r1] + cmp r0, r2 + bne _0804AB1E + ldr r4, =0x02024084 + ldrh r0, [r4, 0x28] + cmp r0, 0 + beq _0804AB1E + mov r0, r8 + muls r0, r2 + adds r0, r7 + movs r1, 0x38 + bl pokemon_getattr + adds r1, r4, 0 + adds r1, 0x2A + strb r0, [r1] + mov r1, r9 + ldr r0, [r1] + ldrb r0, [r0, 0x10] + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + adds r0, r7 + movs r1, 0x39 + bl pokemon_getattr + strh r0, [r4, 0x28] + mov r1, r9 + ldr r0, [r1] + ldrb r0, [r0, 0x10] + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + adds r0, r7 + movs r1, 0x3A + bl pokemon_getattr + strh r0, [r4, 0x2C] + mov r1, r9 + ldr r0, [r1] + ldrb r0, [r0, 0x10] + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + adds r0, r7 + movs r1, 0x3B + bl pokemon_getattr + strh r0, [r4, 0x2] + mov r1, r9 + ldr r0, [r1] + ldrb r0, [r0, 0x10] + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + adds r0, r7 + movs r1, 0x3C + bl pokemon_getattr + strh r0, [r4, 0x4] + mov r1, r9 + ldr r0, [r1] + ldrb r0, [r0, 0x10] + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + adds r0, r7 + movs r1, 0x3D + bl pokemon_getattr + strh r0, [r4, 0x6] + mov r1, r9 + ldr r0, [r1] + ldrb r0, [r0, 0x10] + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + adds r0, r7 + movs r1, 0x3D + bl pokemon_getattr + strh r0, [r4, 0x6] + mov r1, r9 + ldr r0, [r1] + ldrb r0, [r0, 0x10] + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + adds r0, r7 + movs r1, 0x3E + bl pokemon_getattr + strh r0, [r4, 0x8] + mov r1, r9 + ldr r0, [r1] + ldrb r0, [r0, 0x10] + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + adds r0, r7 + movs r1, 0x3F + bl pokemon_getattr + strh r0, [r4, 0xA] +_0804AB1E: + ldr r0, =0x0202406e + ldr r7, =0x0202449c + ldr r1, [r7] + ldrb r2, [r1, 0x10] + ldrh r0, [r0, 0x4] + cmp r0, r2 + beq _0804AB2E + b _0804AC2E +_0804AB2E: + ldr r6, =0x02024084 + movs r4, 0xD8 + adds r4, r6 + mov r8, r4 + ldrh r0, [r4] + cmp r0, 0 + beq _0804AC2E + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0804AC2E + movs r5, 0x64 + adds r0, r2, 0 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + movs r1, 0x38 + bl pokemon_getattr + adds r1, r6, 0 + adds r1, 0xDA + strb r0, [r1] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r5 + adds r0, r4 + movs r1, 0x39 + bl pokemon_getattr + mov r1, r8 + strh r0, [r1] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r5 + adds r0, r4 + movs r1, 0x3A + bl pokemon_getattr + adds r1, r6, 0 + adds r1, 0xDC + strh r0, [r1] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r5 + adds r0, r4 + movs r1, 0x3B + bl pokemon_getattr + adds r1, r6, 0 + adds r1, 0xB2 + strh r0, [r1] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r5 + adds r0, r4 + movs r1, 0x3C + bl pokemon_getattr + adds r1, r6, 0 + adds r1, 0xB4 + strh r0, [r1] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r5 + adds r0, r4 + movs r1, 0x3D + bl pokemon_getattr + movs r2, 0xB6 + adds r2, r6 + mov r8, r2 + strh r0, [r2] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r5 + adds r0, r4 + movs r1, 0x3D + bl pokemon_getattr + mov r1, r8 + strh r0, [r1] + ldr r0, [r7] + ldrb r0, [r0, 0x10] + muls r0, r5 + adds r0, r4 + movs r1, 0x3E + bl pokemon_getattr + adds r1, r6, 0 + adds r1, 0xB8 + strh r0, [r1] + b _0804AC2E + .pool +_0804AC28: + ldr r1, =0x020241f0 + movs r0, 0 + str r0, [r1] +_0804AC2E: + ldr r1, =0x02024474 + movs r0, 0x5 + strb r0, [r1, 0x1C] + b _0804ACB2 + .pool +_0804AC40: + ldr r0, =0x020241f0 + ldr r0, [r0] + cmp r0, 0 + beq _0804AC58 + ldr r1, =0x02024474 + movs r0, 0x3 + strb r0, [r1, 0x1C] + b _0804ACB2 + .pool +_0804AC58: + ldr r2, =0x0202449c + ldr r1, [r2] + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] + ldr r0, [r2] + ldrb r0, [r0, 0x10] + cmp r0, 0x5 + bhi _0804AC7C + ldr r1, =0x02024474 + movs r0, 0x2 + strb r0, [r1, 0x1C] + b _0804ACB2 + .pool +_0804AC7C: + ldr r1, =0x02024474 + movs r0, 0x6 + strb r0, [r1, 0x1C] + b _0804ACB2 + .pool +_0804AC88: + ldr r0, =0x02024068 + ldr r5, [r0] + cmp r5, 0 + bne _0804ACB2 + ldr r4, =0x02024084 + ldr r2, =0x0202420d + ldrb r0, [r2] + movs r1, 0x58 + muls r0, r1 + adds r0, r4 + movs r3, 0 + strh r5, [r0, 0x2E] + ldrb r0, [r2] + muls r0, r1 + adds r0, r4 + adds r0, 0x20 + strb r3, [r0] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_0804ACB2: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804A32C + + thumb_func_start sub_804ACD0 +sub_804ACD0: @ 804ACD0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r6, 0 + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _0804ACE2 + b _0804AF22 +_0804ACE2: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _0804AD48 + ldr r0, =0x02038bce + ldrh r1, [r0] + ldr r0, =0x00000c03 + cmp r1, r0 + bne _0804AD48 + movs r5, 0 +_0804ACFC: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _0804AD2C + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0804AD2C + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + adds r0, r6, r0 + lsls r0, 16 + lsrs r6, r0, 16 +_0804AD2C: + adds r5, 0x1 + cmp r5, 0x2 + ble _0804ACFC + b _0804ADA8 + .pool +_0804AD48: + movs r5, 0 +_0804AD4A: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _0804ADA2 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0804ADA2 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0804AD94 + ldr r0, =0x0202449c + ldr r0, [r0] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0804ADA2 +_0804AD94: + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + adds r0, r6, r0 + lsls r0, 16 + lsrs r6, r0, 16 +_0804ADA2: + adds r5, 0x1 + cmp r5, 0x5 + ble _0804AD4A +_0804ADA8: + cmp r6, 0 + bne _0804ADB6 + ldr r0, =0x0202433a + ldrb r1, [r0] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0] +_0804ADB6: + movs r6, 0 + movs r5, 0 +_0804ADBA: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x02024744 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _0804AE10 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0804AE10 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0804AE02 + ldr r0, =0x0202449c + ldr r0, [r0] + ldr r1, =0x000002a1 + adds r0, r1 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0804AE10 +_0804AE02: + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + adds r0, r6, r0 + lsls r0, 16 + lsrs r6, r0, 16 +_0804AE10: + adds r5, 0x1 + cmp r5, 0x5 + ble _0804ADBA + ldr r2, =0x0202433a + cmp r6, 0 + bne _0804AE24 + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] +_0804AE24: + ldrb r0, [r2] + cmp r0, 0 + bne _0804AF1A + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r2, =0x02000002 + ands r1, r2 + mov r8, r0 + cmp r1, 0 + beq _0804AF1A + movs r3, 0 + movs r5, 0 + ldr r0, =0x0202406c + ldrb r1, [r0] + mov r12, r0 + ldr r7, =0x02024214 + cmp r3, r1 + bge _0804AE70 + ldr r0, =0x02024280 + movs r6, 0x80 + lsls r6, 21 + ldr r4, [r0] + adds r2, r1, 0 + ldr r1, =0x0202437c +_0804AE54: + adds r0, r6, 0 + lsls r0, r5 + ands r0, r4 + cmp r0, 0 + beq _0804AE68 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + blt _0804AE68 + adds r3, 0x1 +_0804AE68: + adds r1, 0x28 + adds r5, 0x2 + cmp r5, r2 + blt _0804AE54 +_0804AE70: + movs r2, 0 + movs r5, 0x1 + mov r4, r12 + ldrb r1, [r4] + cmp r5, r1 + bge _0804AEAA + ldr r0, =0x02024280 + movs r4, 0x80 + lsls r4, 21 + mov r12, r4 + ldr r6, [r0] + ldr r0, =0x0202437c + adds r4, r1, 0 + adds r1, r0, 0 + adds r1, 0x14 +_0804AE8E: + mov r0, r12 + lsls r0, r5 + ands r0, r6 + cmp r0, 0 + beq _0804AEA2 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + blt _0804AEA2 + adds r2, 0x1 +_0804AEA2: + adds r1, 0x28 + adds r5, 0x2 + cmp r5, r4 + blt _0804AE8E +_0804AEAA: + mov r1, r8 + ldr r0, [r1] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804AEF0 + adds r0, r2, r3 + cmp r0, 0x1 + bgt _0804AEF8 + b _0804AF12 + .pool +_0804AEF0: + cmp r2, 0 + beq _0804AF12 + cmp r3, 0 + beq _0804AF12 +_0804AEF8: + ldr r2, [r7] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + adds r1, r0 + str r1, [r7] + b _0804AF22 +_0804AF12: + ldr r0, [r7] + adds r0, 0x5 + str r0, [r7] + b _0804AF22 +_0804AF1A: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0804AF22: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804ACD0 + + thumb_func_start sub_804AF30 +sub_804AF30: @ 804AF30 + ldr r1, =0x0202427c + movs r0, 0 + strb r0, [r1] + ldr r0, =0x02024474 + movs r2, 0 + movs r1, 0x1 + strb r1, [r0, 0xE] + ldr r0, =0x02024211 + strb r1, [r0] + ldr r0, =0x02024332 + strb r2, [r0, 0x3] + strb r2, [r0, 0x6] + ldr r2, =0x02024280 + ldr r0, [r2] + subs r1, 0x42 + ands r0, r1 + ldr r1, =0xffffbfff + ands r0, r1 + str r0, [r2] + bx lr + .pool + thumb_func_end sub_804AF30 + + thumb_func_start atk25_cmd25 +atk25_cmd25: @ 804AF70 + push {lr} + bl sub_804AF30 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atk25_cmd25 + + thumb_func_start atk26_80225F0_storebyteforjump +atk26_80225F0_storebyteforjump: @ 804AF88 + ldr r3, =0x02024212 + ldr r2, =0x02024214 + ldr r0, [r2] + ldrb r1, [r0, 0x1] + strb r1, [r3] + adds r0, 0x2 + str r0, [r2] + bx lr + .pool + thumb_func_end atk26_80225F0_storebyteforjump + + thumb_func_start atk27_cmd27 +atk27_cmd27: @ 804AFA0 + push {lr} + ldr r1, =0x02024212 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _0804AFC4 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _0804AFDE + .pool +_0804AFC4: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + adds r1, r0 + str r1, [r3] +_0804AFDE: + pop {r0} + bx r0 + .pool + thumb_func_end atk27_cmd27 + + thumb_func_start atk28_goto +atk28_goto: @ 804AFE8 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + adds r1, r0 + str r1, [r3] + bx lr + .pool + thumb_func_end atk28_goto + + thumb_func_start atk29_jumpifbyte +atk29_jumpifbyte: @ 804B008 + push {r4-r6,lr} + ldr r3, =0x02024214 + ldr r1, [r3] + ldrb r6, [r1, 0x1] + ldrb r2, [r1, 0x2] + ldrb r0, [r1, 0x3] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0x4] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0x5] + lsls r0, 24 + adds r5, r2, r0 + ldrb r4, [r1, 0x6] + ldrb r2, [r1, 0x7] + ldrb r0, [r1, 0x8] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0x9] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0xA] + lsls r0, 24 + adds r2, r0 + adds r1, 0xB + str r1, [r3] + cmp r6, 0x5 + bhi _0804B0A0 + lsls r0, r6, 2 + ldr r1, =_0804B054 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0804B054: + .4byte _0804B06C + .4byte _0804B074 + .4byte _0804B07C + .4byte _0804B084 + .4byte _0804B08C + .4byte _0804B096 +_0804B06C: + ldrb r0, [r5] + cmp r0, r4 + bne _0804B0A0 + b _0804B09E +_0804B074: + ldrb r0, [r5] + cmp r0, r4 + beq _0804B0A0 + b _0804B09E +_0804B07C: + ldrb r0, [r5] + cmp r0, r4 + bls _0804B0A0 + b _0804B09E +_0804B084: + ldrb r0, [r5] + cmp r0, r4 + bcs _0804B0A0 + b _0804B09E +_0804B08C: + ldrb r0, [r5] + ands r4, r0 + cmp r4, 0 + beq _0804B0A0 + b _0804B09E +_0804B096: + ldrb r0, [r5] + ands r4, r0 + cmp r4, 0 + bne _0804B0A0 +_0804B09E: + str r2, [r3] +_0804B0A0: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end atk29_jumpifbyte + + thumb_func_start sub_804B0A8 +sub_804B0A8: @ 804B0A8 + push {r4-r6,lr} + ldr r3, =0x02024214 + ldr r1, [r3] + ldrb r6, [r1, 0x1] + ldrb r2, [r1, 0x2] + ldrb r0, [r1, 0x3] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0x4] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0x5] + lsls r0, 24 + adds r5, r2, r0 + ldrb r4, [r1, 0x6] + ldrb r0, [r1, 0x7] + lsls r0, 8 + orrs r4, r0 + ldrb r2, [r1, 0x8] + ldrb r0, [r1, 0x9] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0xA] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0xB] + lsls r0, 24 + adds r2, r0 + adds r1, 0xC + str r1, [r3] + cmp r6, 0x5 + bhi _0804B148 + lsls r0, r6, 2 + ldr r1, =_0804B0FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0804B0FC: + .4byte _0804B114 + .4byte _0804B11C + .4byte _0804B124 + .4byte _0804B12C + .4byte _0804B134 + .4byte _0804B13E +_0804B114: + ldrh r0, [r5] + cmp r0, r4 + bne _0804B148 + b _0804B146 +_0804B11C: + ldrh r0, [r5] + cmp r0, r4 + beq _0804B148 + b _0804B146 +_0804B124: + ldrh r0, [r5] + cmp r0, r4 + bls _0804B148 + b _0804B146 +_0804B12C: + ldrh r0, [r5] + cmp r0, r4 + bcs _0804B148 + b _0804B146 +_0804B134: + ldrh r0, [r5] + ands r4, r0 + cmp r4, 0 + beq _0804B148 + b _0804B146 +_0804B13E: + ldrh r0, [r5] + ands r4, r0 + cmp r4, 0 + bne _0804B148 +_0804B146: + str r2, [r3] +_0804B148: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_804B0A8 + + thumb_func_start sub_804B150 +sub_804B150: @ 804B150 + push {r4-r6,lr} + ldr r3, =0x02024214 + ldr r1, [r3] + ldrb r6, [r1, 0x1] + ldrb r2, [r1, 0x2] + ldrb r0, [r1, 0x3] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0x4] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0x5] + lsls r0, 24 + adds r5, r2, r0 + ldrb r4, [r1, 0x6] + ldrb r0, [r1, 0x7] + lsls r0, 8 + orrs r4, r0 + ldrb r0, [r1, 0x8] + lsls r0, 16 + orrs r4, r0 + ldrb r0, [r1, 0x9] + lsls r0, 24 + orrs r4, r0 + ldrb r2, [r1, 0xA] + ldrb r0, [r1, 0xB] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0xC] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0xD] + lsls r0, 24 + adds r2, r0 + adds r1, 0xE + str r1, [r3] + cmp r6, 0x5 + bhi _0804B1FC + lsls r0, r6, 2 + ldr r1, =_0804B1B0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0804B1B0: + .4byte _0804B1C8 + .4byte _0804B1D0 + .4byte _0804B1D8 + .4byte _0804B1E0 + .4byte _0804B1E8 + .4byte _0804B1F2 +_0804B1C8: + ldr r0, [r5] + cmp r0, r4 + bne _0804B1FC + b _0804B1FA +_0804B1D0: + ldr r0, [r5] + cmp r0, r4 + beq _0804B1FC + b _0804B1FA +_0804B1D8: + ldr r0, [r5] + cmp r0, r4 + bls _0804B1FC + b _0804B1FA +_0804B1E0: + ldr r0, [r5] + cmp r0, r4 + bcs _0804B1FC + b _0804B1FA +_0804B1E8: + ldr r0, [r5] + ands r0, r4 + cmp r0, 0 + beq _0804B1FC + b _0804B1FA +_0804B1F2: + ldr r0, [r5] + ands r0, r4 + cmp r0, 0 + bne _0804B1FC +_0804B1FA: + str r2, [r3] +_0804B1FC: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_804B150 + + thumb_func_start sub_804B204 +sub_804B204: @ 804B204 + push {r4-r7,lr} + ldr r2, =0x02024214 + ldr r3, [r2] + ldrb r1, [r3, 0x1] + ldrb r0, [r3, 0x2] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r3, 0x3] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 24 + adds r5, r1, r0 + ldrb r1, [r3, 0x5] + ldrb r0, [r3, 0x6] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r3, 0x7] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r3, 0x8] + lsls r0, 24 + adds r4, r1, r0 + ldrb r6, [r3, 0x9] + ldrb r1, [r3, 0xA] + ldrb r0, [r3, 0xB] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r3, 0xC] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r3, 0xD] + lsls r0, 24 + adds r1, r0 + mov r12, r1 + movs r1, 0 + cmp r1, r6 + bcs _0804B27C + ldrb r0, [r5] + ldrb r7, [r4] + cmp r0, r7 + beq _0804B260 + adds r0, r3, 0 + b _0804B278 + .pool +_0804B260: + adds r5, 0x1 + adds r4, 0x1 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, r6 + bcs _0804B27C + ldrb r0, [r5] + ldrb r3, [r4] + cmp r0, r3 + beq _0804B260 + ldr r0, [r2] +_0804B278: + adds r0, 0xE + str r0, [r2] +_0804B27C: + cmp r1, r6 + bne _0804B284 + mov r7, r12 + str r7, [r2] +_0804B284: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804B204 + + thumb_func_start sub_804B28C +sub_804B28C: @ 804B28C + push {r4-r7,lr} + movs r7, 0 + ldr r3, =0x02024214 + ldr r1, [r3] + ldrb r2, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + adds r5, r2, r0 + ldrb r2, [r1, 0x5] + ldrb r0, [r1, 0x6] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0x7] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0x8] + lsls r0, 24 + adds r4, r2, r0 + ldrb r6, [r1, 0x9] + ldrb r2, [r1, 0xA] + ldrb r0, [r1, 0xB] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0xC] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0xD] + lsls r0, 24 + adds r2, r0 + mov r12, r2 + movs r1, 0 + cmp r7, r6 + bcs _0804B2F6 +_0804B2DA: + ldrb r0, [r5] + ldrb r2, [r4] + cmp r0, r2 + bne _0804B2E8 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 +_0804B2E8: + adds r5, 0x1 + adds r4, 0x1 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, r6 + bcc _0804B2DA +_0804B2F6: + cmp r7, r6 + beq _0804B304 + mov r0, r12 + b _0804B308 + .pool +_0804B304: + ldr r0, [r3] + adds r0, 0xE +_0804B308: + str r0, [r3] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804B28C + + thumb_func_start sub_804B310 +sub_804B310: @ 804B310 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + adds r1, r0 + ldrb r0, [r2, 0x5] + strb r0, [r1] + ldr r0, [r3] + adds r0, 0x6 + str r0, [r3] + bx lr + .pool + thumb_func_end sub_804B310 + + thumb_func_start sub_804B338 +sub_804B338: @ 804B338 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + adds r1, r0 + ldrb r0, [r2, 0x5] + ldrb r2, [r1] + adds r0, r2 + strb r0, [r1] + ldr r0, [r3] + adds r0, 0x6 + str r0, [r3] + bx lr + .pool + thumb_func_end sub_804B338 + + thumb_func_start sub_804B364 +sub_804B364: @ 804B364 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + adds r1, r0 + ldrb r0, [r1] + ldrb r2, [r2, 0x5] + subs r0, r2 + strb r0, [r1] + ldr r0, [r3] + adds r0, 0x6 + str r0, [r3] + bx lr + .pool + thumb_func_end sub_804B364 + + thumb_func_start atk31_copyarray +atk31_copyarray: @ 804B390 + push {r4-r6,lr} + ldr r3, =0x02024214 + ldr r1, [r3] + ldrb r2, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + adds r6, r2, r0 + ldrb r2, [r1, 0x5] + ldrb r0, [r1, 0x6] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0x7] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0x8] + lsls r0, 24 + adds r5, r2, r0 + ldrb r4, [r1, 0x9] + movs r2, 0 + cmp r2, r4 + bge _0804B3D4 +_0804B3C6: + adds r0, r6, r2 + adds r1, r5, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, r4 + blt _0804B3C6 +_0804B3D4: + ldr r0, [r3] + adds r0, 0xA + str r0, [r3] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atk31_copyarray + + thumb_func_start atk32_memcpy_with_offset +atk32_memcpy_with_offset: @ 804B3E4 + push {r4-r7,lr} + ldr r3, =0x02024214 + ldr r1, [r3] + ldrb r2, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + adds r7, r2, r0 + ldrb r2, [r1, 0x5] + ldrb r0, [r1, 0x6] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0x7] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0x8] + lsls r0, 24 + adds r6, r2, r0 + ldrb r2, [r1, 0x9] + ldrb r0, [r1, 0xA] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r1, 0xB] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r1, 0xC] + lsls r0, 24 + adds r5, r2, r0 + ldrb r4, [r1, 0xD] + movs r2, 0 + cmp r2, r4 + bge _0804B440 +_0804B42E: + adds r0, r7, r2 + ldrb r1, [r5] + adds r1, r2, r1 + adds r1, r6, r1 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, r4 + blt _0804B42E +_0804B440: + ldr r0, [r3] + adds r0, 0xE + str r0, [r3] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk32_memcpy_with_offset + + thumb_func_start atk33_orbyte +atk33_orbyte: @ 804B450 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + adds r1, r0 + ldrb r0, [r1] + ldrb r2, [r2, 0x5] + orrs r0, r2 + strb r0, [r1] + ldr r0, [r3] + adds r0, 0x6 + str r0, [r3] + bx lr + .pool + thumb_func_end atk33_orbyte + + thumb_func_start atk34_orhalfword +atk34_orhalfword: @ 804B47C + push {r4,lr} + ldr r4, =0x02024214 + ldr r3, [r4] + ldrb r2, [r3, 0x1] + ldrb r0, [r3, 0x2] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r3, 0x3] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r3, 0x4] + lsls r0, 24 + adds r2, r0 + ldrb r1, [r3, 0x5] + ldrb r0, [r3, 0x6] + lsls r0, 8 + orrs r1, r0 + ldrh r0, [r2] + orrs r1, r0 + strh r1, [r2] + ldr r0, [r4] + adds r0, 0x7 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk34_orhalfword + + thumb_func_start atk35_orword +atk35_orword: @ 804B4B4 + push {r4,lr} + ldr r4, =0x02024214 + ldr r2, [r4] + ldrb r3, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + adds r3, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + adds r3, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + adds r3, r0 + ldrb r1, [r2, 0x5] + ldrb r0, [r2, 0x6] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x8] + lsls r0, 24 + adds r1, r0 + ldr r0, [r3] + orrs r0, r1 + str r0, [r3] + ldr r0, [r4] + adds r0, 0x9 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk35_orword + + thumb_func_start atk36_bicbyte +atk36_bicbyte: @ 804B4F8 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + adds r1, r0 + ldrb r2, [r2, 0x5] + ldrb r0, [r1] + bics r0, r2 + strb r0, [r1] + ldr r0, [r3] + adds r0, 0x6 + str r0, [r3] + bx lr + .pool + thumb_func_end atk36_bicbyte + + thumb_func_start atk37_bichalfword +atk37_bichalfword: @ 804B524 + push {r4,lr} + ldr r4, =0x02024214 + ldr r3, [r4] + ldrb r1, [r3, 0x1] + ldrb r0, [r3, 0x2] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r3, 0x3] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r3, 0x4] + lsls r0, 24 + adds r1, r0 + ldrb r2, [r3, 0x5] + ldrb r0, [r3, 0x6] + lsls r0, 8 + orrs r2, r0 + ldrh r0, [r1] + bics r0, r2 + strh r0, [r1] + ldr r0, [r4] + adds r0, 0x7 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk37_bichalfword + + thumb_func_start atk38_bicword +atk38_bicword: @ 804B55C + push {r4,lr} + ldr r4, =0x02024214 + ldr r2, [r4] + ldrb r3, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + adds r3, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + adds r3, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + adds r3, r0 + ldrb r1, [r2, 0x5] + ldrb r0, [r2, 0x6] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x8] + lsls r0, 24 + adds r1, r0 + ldr r0, [r3] + bics r0, r1 + str r0, [r3] + ldr r0, [r4] + adds r0, 0x9 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk38_bicword + + thumb_func_start atk39_pause +atk39_pause: @ 804B5A0 + push {r4,r5,lr} + ldr r0, =0x02024068 + ldr r4, [r0] + cmp r4, 0 + bne _0804B5CC + ldr r5, =0x02024214 + ldr r2, [r5] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldr r3, =0x0202432c + ldrh r0, [r3] + adds r0, 0x1 + strh r0, [r3] + lsls r0, 16 + lsrs r0, 16 + cmp r0, r1 + bcc _0804B5CC + strh r4, [r3] + adds r0, r2, 0x3 + str r0, [r5] +_0804B5CC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk39_pause + + thumb_func_start sub_804B5E0 +sub_804B5E0: @ 804B5E0 + push {lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0804B5F2 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_0804B5F2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_804B5E0 + + thumb_func_start atk3B_8022C68 +atk3B_8022C68: @ 804B600 + push {lr} + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _0804B620 + ldr r0, =0x02024064 + ldr r1, =0x0202420c + b _0804B624 + .pool +_0804B620: + ldr r0, =0x02024064 + ldr r1, =0x0202420b +_0804B624: + ldrb r1, [r1] + strb r1, [r0] + ldr r0, =0x020241f0 + ldrh r1, [r0] + movs r0, 0 + bl dp01_build_cmdbuf_x18_0_aa_health_bar_update + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atk3B_8022C68 + + thumb_func_start atk3C_return +atk3C_return: @ 804B658 + push {lr} + bl b_movescr_stack_pop_cursor + pop {r0} + bx r0 + thumb_func_end atk3C_return + + thumb_func_start sub_804B664 +sub_804B664: @ 804B664 + push {lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0804B67C + ldr r0, =0x0202420b + ldrb r0, [r0] + bl sub_81A5718 +_0804B67C: + ldr r0, =0x0202427c + movs r1, 0 + strb r1, [r0] + ldr r0, =0x02024064 + strb r1, [r0] + ldr r1, =0x02024083 + movs r0, 0xB + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_804B664 + + thumb_func_start atk3E_end2 +atk3E_end2: @ 804B6A4 + ldr r1, =0x02024064 + movs r0, 0 + strb r0, [r1] + ldr r1, =0x02024083 + movs r0, 0xB + strb r0, [r1] + bx lr + .pool + thumb_func_end atk3E_end2 + + thumb_func_start atk3F_end3 +atk3F_end3: @ 804B6BC + push {lr} + bl b_movescr_stack_pop_cursor + ldr r3, =0x020244a8 + ldr r0, [r3] + ldr r0, [r0, 0xC] + adds r1, r0, 0 + adds r1, 0x20 + ldrb r0, [r1] + cmp r0, 0 + beq _0804B6D6 + subs r0, 0x1 + strb r0, [r1] +_0804B6D6: + ldr r2, =0x03005d04 + ldr r0, [r3] + ldr r1, [r0, 0xC] + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2] + pop {r0} + bx r0 + .pool + thumb_func_end atk3F_end3 + + thumb_func_start atk41_call +atk41_call: @ 804B6F8 + push {r4,lr} + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x5 + bl b_movescr_stack_push + ldr r2, [r4] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk41_call + + thumb_func_start atk42_jumpiftype2 +atk42_jumpiftype2: @ 804B728 + push {r4,lr} + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + lsls r0, 24 + lsrs r0, 24 + ldr r3, [r4] + ldr r2, =0x02024084 + movs r1, 0x58 + muls r0, r1 + adds r0, r2 + adds r1, r0, 0 + adds r1, 0x21 + ldrb r2, [r3, 0x2] + ldrb r1, [r1] + cmp r2, r1 + beq _0804B756 + adds r0, 0x22 + ldrb r0, [r0] + cmp r2, r0 + bne _0804B778 +_0804B756: + ldrb r1, [r3, 0x3] + ldrb r0, [r3, 0x4] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r3, 0x6] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _0804B77C + .pool +_0804B778: + adds r0, r3, 0x7 + str r0, [r4] +_0804B77C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end atk42_jumpiftype2 + + thumb_func_start sub_804B784 +sub_804B784: @ 804B784 + push {r4,lr} + sub sp, 0x4 + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r2, [r0, 0x1] + movs r0, 0 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _0804B7C0 + ldr r2, [r4] + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _0804B7C6 + .pool +_0804B7C0: + ldr r0, [r4] + adds r0, 0x6 + str r0, [r4] +_0804B7C6: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_804B784 + + thumb_func_start sub_804B7D0 +sub_804B7D0: @ 804B7D0 + ldr r0, =0x0202420b + ldrb r0, [r0] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + adds r0, 0x54 + movs r1, 0x1 + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_804B7D0 + + thumb_func_start atk46_cmd46 +atk46_cmd46: @ 804B7EC + push {r4-r6,lr} + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r6, =0x02024064 + strb r0, [r6] + ldr r2, [r5] + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x4] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x6] + lsls r0, 24 + adds r3, r1, r0 + ldrb r4, [r2, 0x2] + adds r0, r4, 0 + cmp r0, 0x1 + beq _0804B822 + cmp r0, 0x11 + beq _0804B822 + cmp r0, 0x2 + bne _0804B848 +_0804B822: + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r1, [r0, 0x2] + ldrh r2, [r3] + movs r0, 0 + bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r4] + adds r0, 0x7 + str r0, [r4] + b _0804B8AA + .pool +_0804B848: + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804B868 + adds r0, r2, 0x7 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DABB9 + b _0804B8A8 + .pool +_0804B868: + adds r0, r4, 0 + subs r0, 0xA + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _0804B894 + ldr r1, =0x020242ac + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x000400c0 + ands r0, r1 + cmp r0, 0 + beq _0804B894 + adds r0, r2, 0x7 + b _0804B8A8 + .pool +_0804B894: + ldrb r1, [r2, 0x2] + ldrh r2, [r3] + movs r0, 0 + bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim + ldrb r0, [r6] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r5] + adds r0, 0x7 +_0804B8A8: + str r0, [r5] +_0804B8AA: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end atk46_cmd46 + + thumb_func_start sub_804B8B0 +sub_804B8B0: @ 804B8B0 + push {r4-r7,lr} + ldr r6, =0x02024214 + ldr r0, [r6] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r7, =0x02024064 + strb r0, [r7] + ldr r2, [r6] + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + adds r3, r1, r0 + ldrb r1, [r2, 0x6] + ldrb r0, [r2, 0x7] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0x8] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r2, 0x9] + lsls r0, 24 + adds r4, r1, r0 + ldrb r5, [r3] + adds r0, r5, 0 + cmp r0, 0x1 + beq _0804B8FA + cmp r0, 0x11 + beq _0804B8FA + cmp r0, 0x2 + bne _0804B920 +_0804B8FA: + ldrb r1, [r3] + ldrh r2, [r4] + movs r0, 0 + bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0xA + str r0, [r1] + b _0804B976 + .pool +_0804B920: + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804B934 + adds r0, r2, 0 + b _0804B972 + .pool +_0804B934: + adds r0, r5, 0 + subs r0, 0xA + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _0804B960 + ldr r1, =0x020242ac + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x000400c0 + ands r0, r1 + cmp r0, 0 + beq _0804B960 + adds r0, r2, 0 + b _0804B972 + .pool +_0804B960: + ldrb r1, [r3] + ldrh r2, [r4] + movs r0, 0 + bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim + ldrb r0, [r7] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r6] +_0804B972: + adds r0, 0xA + str r0, [r6] +_0804B976: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804B8B0 + + thumb_func_start sub_804B97C +sub_804B97C: @ 804B97C + push {r4,lr} + movs r3, 0 + ldr r1, =0x02024474 + ldrb r0, [r1, 0x1A] + movs r2, 0xF0 + ands r2, r0 + adds r4, r1, 0 + cmp r2, 0x20 + beq _0804B9AA + cmp r2, 0x20 + bgt _0804B99C + cmp r2, 0x10 + beq _0804B9A6 + b _0804B9B4 + .pool +_0804B99C: + cmp r2, 0x90 + beq _0804B9AE + cmp r2, 0xA0 + beq _0804B9B2 + b _0804B9B4 +_0804B9A6: + movs r3, 0xF + b _0804B9B4 +_0804B9AA: + movs r3, 0x27 + b _0804B9B4 +_0804B9AE: + movs r3, 0x16 + b _0804B9B4 +_0804B9B2: + movs r3, 0x2E +_0804B9B4: + ldrb r1, [r4, 0x1A] + movs r0, 0xF + ands r0, r1 + adds r0, r3, r0 + subs r0, 0x1 + movs r1, 0 + strb r0, [r4, 0x10] + strb r1, [r4, 0x11] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804B97C + + thumb_func_start atk48_playstatchangeanimation +atk48_playstatchangeanimation: @ 804B9D8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r7, 0 + movs r0, 0 + mov r8, r0 + movs r3, 0 + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + str r3, [sp] + bl get_battle_side_of_something + ldr r2, =0x02024064 + strb r0, [r2] + ldr r0, [r5] + ldrb r4, [r0, 0x2] + ldrb r1, [r0, 0x3] + movs r0, 0x1 + ands r0, r1 + ldr r3, [sp] + cmp r0, 0 + beq _0804BAEC + movs r0, 0x2 + ands r0, r1 + movs r1, 0x15 + cmp r0, 0 + beq _0804BA18 + movs r1, 0x2D +_0804BA18: + cmp r4, 0 + beq _0804BAC0 + movs r0, 0x1 + mov r10, r0 + ldr r0, =0x0202409c + mov r9, r0 + lsls r5, r1, 16 +_0804BA26: + adds r0, r4, 0 + mov r1, r10 + ands r0, r1 + cmp r0, 0 + beq _0804BAB2 + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r1, [r0, 0x3] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0804BA58 + ldr r0, =0x02024064 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r7, r0 + b _0804BAA0 + .pool +_0804BA58: + ldr r6, =0x02024064 + ldrb r0, [r6] + str r3, [sp] + bl battle_get_per_side_status + mov r1, r10 + ands r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02024294 + adds r0, r1 + ldrb r0, [r0, 0x4] + ldr r3, [sp] + cmp r0, 0 + bne _0804BAB2 + ldr r0, =0x02024084 + ldrb r2, [r6] + movs r1, 0x58 + muls r2, r1 + adds r0, r2, r0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1D + beq _0804BAB2 + cmp r0, 0x49 + beq _0804BAB2 + cmp r0, 0x33 + bne _0804BA96 + cmp r7, 0x6 + beq _0804BAB2 +_0804BA96: + cmp r0, 0x34 + bne _0804BA9E + cmp r7, 0x1 + beq _0804BAB2 +_0804BA9E: + adds r0, r7, r2 +_0804BAA0: + add r0, r9 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + ble _0804BAB2 + lsrs r0, r5, 16 + mov r8, r0 + adds r3, 0x1 +_0804BAB2: + lsrs r4, 1 + movs r1, 0x80 + lsls r1, 9 + adds r5, r1 + adds r7, 0x1 + cmp r4, 0 + bne _0804BA26 +_0804BAC0: + ldr r0, =0x02024214 + mov r9, r0 + cmp r3, 0x1 + ble _0804BB4E + ldr r0, [r0] + ldrb r1, [r0, 0x3] + movs r0, 0x2 + ands r0, r1 + movs r1, 0x39 + mov r8, r1 + cmp r0, 0 + beq _0804BB4E + movs r0, 0x3A + b _0804BB4C + .pool +_0804BAEC: + movs r0, 0x2 + ands r0, r1 + movs r1, 0xE + cmp r0, 0 + beq _0804BAF8 + movs r1, 0x26 +_0804BAF8: + mov r9, r5 + cmp r4, 0 + beq _0804BB34 + ldr r6, =0x0202409c + adds r5, r2, 0 + lsls r2, r1, 16 +_0804BB04: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0804BB26 + ldrb r1, [r5] + movs r0, 0x58 + muls r0, r1 + adds r0, r7, r0 + adds r0, r6 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0xB + bgt _0804BB26 + lsrs r1, r2, 16 + mov r8, r1 + adds r3, 0x1 +_0804BB26: + lsrs r4, 1 + movs r0, 0x80 + lsls r0, 9 + adds r2, r0 + adds r7, 0x1 + cmp r4, 0 + bne _0804BB04 +_0804BB34: + cmp r3, 0x1 + ble _0804BB4E + mov r1, r9 + ldr r0, [r1] + ldrb r1, [r0, 0x3] + movs r0, 0x2 + ands r0, r1 + movs r1, 0x37 + mov r8, r1 + cmp r0, 0 + beq _0804BB4E + movs r0, 0x38 +_0804BB4C: + mov r8, r0 +_0804BB4E: + mov r1, r9 + ldr r2, [r1] + ldrb r1, [r2, 0x3] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0804BB6C + cmp r3, 0x1 + bgt _0804BB6C + adds r0, r2, 0x4 + mov r1, r9 + b _0804BBBA + .pool +_0804BB6C: + cmp r3, 0 + beq _0804BBB4 + ldr r4, =0x02024474 + ldrb r0, [r4, 0x1B] + cmp r0, 0 + bne _0804BBB4 + movs r0, 0 + movs r1, 0x1 + mov r2, r8 + str r3, [sp] + bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r1, [r0, 0x3] + movs r0, 0x4 + ands r0, r1 + ldr r3, [sp] + cmp r0, 0 + beq _0804BBA4 + cmp r3, 0x1 + ble _0804BBA4 + movs r0, 0x1 + strb r0, [r4, 0x1B] +_0804BBA4: + ldr r1, =0x02024214 + b _0804BBB6 + .pool +_0804BBB4: + mov r1, r9 +_0804BBB6: + ldr r0, [r1] + adds r0, 0x4 +_0804BBBA: + str r0, [r1] + 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 atk48_playstatchangeanimation + + thumb_func_start sub_804BBCC +sub_804BBCC: @ 804BBCC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + movs r0, 0 + mov r10, r0 + ldr r2, =0x020241ec + ldrh r1, [r2] + ldr r0, =0x0000ffff + movs r3, 0 + str r3, [sp, 0x18] + cmp r1, r0 + beq _0804BBEE + ldrh r2, [r2] + str r2, [sp, 0x18] +_0804BBEE: + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r4, [r0, 0x1] + str r4, [sp, 0x10] + ldrb r0, [r0, 0x2] + str r0, [sp, 0x14] + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _0804BC34 + ldr r1, =0x02024404 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x7] + b _0804BC3E + .pool +_0804BC34: + ldrh r0, [r1, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r0, 24 +_0804BC3E: + str r0, [sp, 0x8] + ldr r1, =0x0202449c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, 0xC8 + ldr r1, [r1] + adds r0, r1, r0 + str r0, [sp, 0xC] + ldrb r0, [r1, 0x13] + cmp r0, 0 + beq _0804BCF0 + movs r5, 0x3F + ands r5, r0 + str r5, [sp, 0x4] + b _0804BD02 + .pool +_0804BC68: + ldr r4, =0x02024064 + strb r2, [r4] + movs r0, 0 + movs r1, 0x1 + bl dp01_build_cmdbuf_x33_a_33_33 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _0804C15A + .pool +_0804BC80: + ldr r4, =0x02024064 + strb r2, [r4] + movs r0, 0 + movs r1, 0 + bl dp01_build_cmdbuf_x33_a_33_33 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldrb r1, [r6] + lsls r1, 2 + adds r1, r5 + ldr r0, [r1] + ldr r2, =0xfffbff3f + ands r0, r2 + str r0, [r1] + b _0804C15A + .pool +_0804BCAC: + strb r2, [r7] + ldr r0, [r5] + orrs r0, r6 + str r0, [r5] + ldr r0, =0x02024474 + strb r4, [r0, 0x14] + bl sub_804AF30 + ldr r2, =gUnknown_082D86A8 + mov r0, r8 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + add r0, r9 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + bl b_movescr_stack_push + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB87D + bl _0804C5B8 + .pool +_0804BCF0: + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x2] + str r0, [sp, 0x4] +_0804BD02: + ldr r1, =0x02024474 + mov r12, r1 + b _0804BD1E + .pool +_0804BD14: + mov r2, r10 + cmp r2, 0 + beq _0804BD1E + bl _0804C5A4 +_0804BD1E: + mov r3, r12 + ldrb r0, [r3, 0x14] + cmp r0, 0x11 + bls _0804BD2A + bl _0804C570 +_0804BD2A: + lsls r0, 2 + ldr r1, =_0804BD38 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0804BD38: + .4byte _0804BD80 + .4byte _0804BE5C + .4byte _0804BF18 + .4byte _0804BF3C + .4byte _0804BF54 + .4byte _0804BF7C + .4byte _0804BFA0 + .4byte _0804C048 + .4byte _0804C0BE + .4byte _0804C0F4 + .4byte _0804C194 + .4byte _0804C088 + .4byte _0804C0A8 + .4byte _0804C1D8 + .4byte _0804C21C + .4byte _0804C3FC + .4byte _0804C4E4 + .4byte _0804C570 +_0804BD80: + ldr r6, =0x02024084 + ldr r5, =0x0202420c + ldrb r3, [r5] + movs r7, 0x58 + adds r2, r3, 0 + muls r2, r7 + adds r0, r6, 0 + adds r0, 0x50 + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 16 + ands r0, r1 + cmp r0, 0 + bne _0804BDA0 + b _0804C184 +_0804BDA0: + adds r0, r2, r6 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _0804BDAA + b _0804C184 +_0804BDAA: + ldr r0, =0x0202420b + ldrb r1, [r0] + cmp r1, r3 + bne _0804BDB4 + b _0804C184 +_0804BDB4: + adds r0, r1, 0 + bl battle_side_get_owner + adds r4, r0, 0 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _0804BDCC + b _0804C184 +_0804BDCC: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _0804BDDA + b _0804C184 +_0804BDDA: + ldr r2, =0x0202437c + ldrb r3, [r5] + lsls r0, r3, 2 + adds r0, r3 + lsls r1, r0, 2 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _0804BDFE + adds r0, r2, 0 + adds r0, 0xC + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _0804BDFE + b _0804C184 +_0804BDFE: + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _0804BE14 + b _0804C184 +_0804BE14: + adds r0, r3, 0 + muls r0, r7 + adds r1, r0, r6 + ldrb r2, [r1, 0x19] + movs r0, 0x19 + ldrsb r0, [r1, r0] + cmp r0, 0xB + ble _0804BE26 + b _0804C184 +_0804BE26: + adds r0, r2, 0x1 + strb r0, [r1, 0x19] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAE0D + str r0, [r1] + b _0804C0B8 + .pool +_0804BE5C: + ldr r4, =0x02024084 + ldr r6, =0x0202420c + ldrb r2, [r6] + movs r5, 0x58 + mov r12, r5 + mov r1, r12 + muls r1, r2 + adds r7, r4, 0 + adds r7, 0x4C + adds r5, r1, r7 + ldr r3, [r5] + movs r0, 0x20 + ands r0, r3 + cmp r0, 0 + bne _0804BE7C + b _0804C184 +_0804BE7C: + adds r0, r1, r4 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _0804BE86 + b _0804C184 +_0804BE86: + ldr r0, =0x0202420b + ldrb r0, [r0] + cmp r0, r2 + bne _0804BE90 + b _0804C184 +_0804BE90: + ldr r0, =0x0202437c + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 2 + adds r0, 0xC + adds r1, r0 + ldr r0, [r1] + cmp r0, 0 + bne _0804BEA4 + b _0804C184 +_0804BEA4: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _0804BEB2 + b _0804C184 +_0804BEB2: + ldr r0, [sp, 0x4] + cmp r0, 0xA + beq _0804BEBA + b _0804C184 +_0804BEBA: + movs r0, 0x21 + negs r0, r0 + ands r3, r0 + str r3, [r5] + ldr r4, =0x02024064 + ldrb r0, [r6] + strb r0, [r4] + ldrb r0, [r6] + mov r1, r12 + muls r1, r0 + adds r0, r1, 0 + adds r0, r7 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB282 + str r0, [r1] + movs r2, 0x1 + mov r10, r2 + b _0804C184 + .pool +_0804BF18: + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x7 + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _0804BF32 + b _0804C184 +_0804BF32: + movs r3, 0x1 + mov r10, r3 + b _0804C184 + .pool +_0804BF3C: + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x4 + movs r2, 0 + movs r3, 0 + bl ability_something + b _0804C0B2 + .pool +_0804BF54: + movs r0, 0 + str r0, [sp] + movs r0, 0x5 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _0804BF6C + b _0804C184 +_0804BF6C: + movs r5, 0x1 + mov r10, r5 + ldr r0, =0x02024474 + mov r12, r0 + b _0804C570 + .pool +_0804BF7C: + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _0804BF96 + b _0804C184 +_0804BF96: + movs r1, 0x1 + mov r10, r1 + b _0804C184 + .pool +_0804BFA0: + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _0804BFE4 + ldr r2, [sp, 0x8] + cmp r2, 0x1D + bne _0804BFE4 + ldr r0, =0x020241ec + ldrh r2, [r0] + adds r3, r0, 0 + cmp r2, 0xA5 + beq _0804BFE4 + ldr r4, [sp, 0xC] + ldrh r1, [r4] + cmp r1, 0 + beq _0804BFCC + ldr r0, =0x0000ffff + cmp r1, r0 + bne _0804BFE4 +_0804BFCC: + cmp r2, 0xE2 + bne _0804BFDE + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0804BFDE + b _0804C4B6 +_0804BFDE: + ldrh r0, [r3] + ldr r1, [sp, 0xC] + strh r0, [r1] +_0804BFE4: + movs r4, 0 + ldr r2, =0x02024084 + ldr r3, =0x0202420b + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + adds r2, 0xC + adds r0, r2 + ldrh r0, [r0] + ldr r5, [sp, 0xC] + ldrh r1, [r5] + mov r9, r3 + cmp r0, r1 + beq _0804C01C + mov r6, r9 + movs r3, 0x58 + adds r5, r1, 0 +_0804C006: + adds r4, 0x1 + cmp r4, 0x3 + bgt _0804C01C + lsls r0, r4, 1 + ldrb r1, [r6] + muls r1, r3 + adds r0, r1 + adds r0, r2 + ldrh r0, [r0] + cmp r0, r5 + bne _0804C006 +_0804C01C: + cmp r4, 0x4 + bne _0804C026 + movs r0, 0 + ldr r1, [sp, 0xC] + strh r0, [r1] +_0804C026: + mov r2, r12 + ldrb r0, [r2, 0x14] + adds r0, 0x1 + strb r0, [r2, 0x14] + b _0804C570 + .pool +_0804C048: + movs r4, 0 + ldr r0, =0x0202406c + ldrb r3, [r0] + cmp r4, r3 + blt _0804C054 + b _0804C202 +_0804C054: + ldr r7, =0x0202449c + movs r6, 0 + movs r3, 0xD0 + adds r5, r0, 0 + ldr r2, =0x02024084 +_0804C05E: + ldr r0, [r7] + adds r0, r3 + ldrh r1, [r0] + cmp r1, 0 + beq _0804C06C + strh r1, [r2, 0x2E] + strh r6, [r0] +_0804C06C: + adds r3, 0x2 + adds r2, 0x58 + adds r4, 0x1 + ldrb r0, [r5] + cmp r4, r0 + blt _0804C05E + b _0804C202 + .pool +_0804C088: + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl berry_effects_maybe + lsls r0, 24 + cmp r0, 0 + beq _0804C184 + movs r2, 0x1 + mov r10, r2 + ldr r3, =0x02024474 + mov r12, r3 + b _0804C570 + .pool +_0804C0A8: + movs r0, 0x4 + movs r1, 0 + movs r2, 0 + bl berry_effects_maybe +_0804C0B2: + lsls r0, 24 + cmp r0, 0 + beq _0804C184 +_0804C0B8: + movs r4, 0x1 + mov r10, r4 + b _0804C184 +_0804C0BE: + ldr r1, =0x020242ac + ldr r0, =0x0202420b + ldrb r2, [r0] + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x000400c0 + ands r0, r1 + cmp r0, 0 + bne _0804C0D4 + b _0804C4B6 +_0804C0D4: + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804C0E2 + b _0804BC68 +_0804C0E2: + b _0804C4B6 + .pool +_0804C0F4: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _0804C120 + ldr r1, =0x020242ac + ldr r0, =0x0202420b + ldrb r2, [r0] + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x000400c0 + ands r0, r1 + cmp r0, 0 + beq _0804C120 + adds r0, r2, 0 + bl sub_803F90C + lsls r0, 24 + cmp r0, 0 + beq _0804C184 +_0804C120: + ldr r4, =0x02024064 + ldr r5, =0x0202420b + ldrb r0, [r5] + strb r0, [r4] + movs r0, 0 + movs r1, 0 + bl dp01_build_cmdbuf_x33_a_33_33 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, =0x020242ac + ldrb r2, [r5] + lsls r2, 2 + adds r2, r0 + ldr r0, [r2] + ldr r1, =0xfffbff3f + ands r0, r1 + str r0, [r2] + ldr r2, =0x0202437c + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_0804C15A: + ldr r1, =0x02024474 + ldrb r0, [r1, 0x14] + adds r0, 0x1 + strb r0, [r1, 0x14] + b _0804C5BA + .pool +_0804C184: + ldr r1, =0x02024474 + ldrb r0, [r1, 0x14] + adds r0, 0x1 + strb r0, [r1, 0x14] + mov r12, r1 + b _0804C570 + .pool +_0804C194: + ldr r0, =0x0202437c + ldr r6, =0x0202420c + ldrb r2, [r6] + lsls r3, r2, 2 + adds r1, r3, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 29 + cmp r0, 0 + blt _0804C202 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r2, r0 + bcs _0804C202 + ldr r5, =0x020242ac + adds r0, r3, r5 + ldr r0, [r0] + ldr r1, =0x000400c0 + ands r0, r1 + cmp r0, 0 + bne _0804C1C2 + b _0804BC80 +_0804C1C2: + b _0804C202 + .pool +_0804C1D8: + movs r4, 0 + ldr r0, =0x0202406c + ldrb r2, [r0] + cmp r4, r2 + bge _0804C202 + ldr r2, =0x020242bc + ldr r5, =0xfeffffff + adds r3, r0, 0 + ldr r1, =0x020240d4 +_0804C1EA: + ldrb r0, [r2, 0xA] + cmp r0, 0 + bne _0804C1F6 + ldr r0, [r1] + ands r0, r5 + str r0, [r1] +_0804C1F6: + adds r2, 0x1C + adds r1, 0x58 + adds r4, 0x1 + ldrb r0, [r3] + cmp r4, r0 + blt _0804C1EA +_0804C202: + mov r1, r12 + ldrb r0, [r1, 0x14] + adds r0, 0x1 + strb r0, [r1, 0x14] + b _0804C570 + .pool +_0804C21C: + ldr r1, =0x02024280 + ldr r3, [r1] + movs r0, 0x80 + lsls r0, 5 + ands r0, r3 + ldr r2, =0x0202420b + mov r9, r2 + adds r5, r1, 0 + cmp r0, 0 + beq _0804C246 + ldr r0, =0x02024064 + ldrb r2, [r2] + strb r2, [r0] + ldr r1, =0x0202420c + ldrb r0, [r1] + mov r4, r9 + strb r0, [r4] + strb r2, [r1] + ldr r0, =0xffffefff + ands r3, r0 + str r3, [r5] +_0804C246: + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 3 + ands r0, r1 + cmp r0, 0 + beq _0804C262 + ldr r0, =0x02024240 + mov r2, r9 + ldrb r1, [r2] + lsls r1, 1 + adds r1, r0 + ldr r0, =0x020241ec + ldrh r0, [r0] + strh r0, [r1] +_0804C262: + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + mov r3, r9 + ldrb r4, [r3] + lsls r0, r4, 2 + adds r0, r2 + ldr r3, [r0] + ands r1, r3 + adds r6, r2, 0 + cmp r1, 0 + beq _0804C27C + b _0804C3E8 +_0804C27C: + ldr r0, =0x0202449c + ldr r1, [r0] + adds r1, 0x91 + ldrb r1, [r1] + ands r1, r3 + adds r7, r0, 0 + cmp r1, 0 + beq _0804C28E + b _0804C3E8 +_0804C28E: + ldr r0, =gBattleMoves + ldr r2, [sp, 0x18] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r1, [r1] + mov r8, r0 + cmp r1, 0x7F + bne _0804C2A4 + b _0804C3E8 +_0804C2A4: + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _0804C308 + ldr r0, =0x02024248 + lsls r1, r4, 1 + adds r1, r0 + ldr r0, =0x020241ec + ldrh r0, [r0] + strh r0, [r1] + ldr r0, =0x02024260 + mov r3, r9 + ldrb r1, [r3] + lsls r1, 1 + adds r1, r0 + ldr r0, =0x020241ea + ldrh r0, [r0] + strh r0, [r1] + b _0804C322 + .pool +_0804C308: + ldr r1, =0x02024248 + lsls r0, r4, 1 + adds r0, r1 + ldr r1, =0x0000ffff + strh r1, [r0] + ldr r1, =0x02024260 + mov r4, r9 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + strh r1, [r0] +_0804C322: + ldr r2, =0x0202420c + ldrb r3, [r2] + lsls r0, r3, 2 + adds r0, r6 + ldr r0, [r0] + lsls r0, 28 + ldr r1, [r5] + ands r1, r0 + cmp r1, 0 + bne _0804C340 + ldr r0, =0x02024270 + adds r0, r3, r0 + mov r3, r9 + ldrb r1, [r3] + strb r1, [r0] +_0804C340: + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _0804C3DC + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _0804C3DC + ldr r0, =0x020241ec + ldrh r3, [r0] + ldr r0, =0x0000ffff + cmp r3, r0 + bne _0804C390 + ldr r1, =0x02024250 + ldrb r0, [r2] + lsls r0, 1 + adds r0, r1 + strh r3, [r0] + b _0804C3E8 + .pool +_0804C390: + ldr r0, =0x02024250 + ldrb r1, [r2] + lsls r1, 1 + adds r1, r0 + ldr r4, =0x020241ea + ldrh r0, [r4] + strh r0, [r1] + ldr r0, [r7] + ldrb r3, [r0, 0x13] + cmp r3, 0 + beq _0804C3C0 + ldr r0, =0x02024258 + ldrb r1, [r2] + lsls r1, 1 + adds r1, r0 + movs r0, 0x3F + ands r0, r3 + b _0804C3E6 + .pool +_0804C3C0: + ldr r0, =0x02024258 + ldrb r2, [r2] + lsls r2, 1 + adds r2, r0 + ldrh r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r0, [r0, 0x2] + strh r0, [r2] + b _0804C3E8 + .pool +_0804C3DC: + ldr r0, =0x02024250 + ldrb r1, [r2] + lsls r1, 1 + adds r1, r0 + ldr r0, =0x0000ffff +_0804C3E6: + strh r0, [r1] +_0804C3E8: + mov r4, r12 + ldrb r0, [r4, 0x14] + adds r0, 0x1 + strb r0, [r4, 0x14] + b _0804C570 + .pool +_0804C3FC: + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r7, =gUnknown_0832A328 + ldr r2, =0x0202420b + ldrb r3, [r2] + lsls r0, r3, 2 + adds r0, r7 + ldr r4, [r0] + ands r1, r4 + mov r9, r2 + cmp r1, 0 + bne _0804C4B6 + ldr r6, =0x0202449c + ldr r5, [r6] + adds r0, r5, 0 + adds r0, 0x91 + ldrb r0, [r0] + ands r0, r4 + cmp r0, 0 + bne _0804C4B6 + ldr r1, =gBattleMoves + ldr r2, [sp, 0x18] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x8] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0804C4B6 + ldr r0, =0x02024280 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 18 + ands r0, r1 + cmp r0, 0 + beq _0804C4B6 + ldr r4, =0x0202420c + ldrb r0, [r4] + cmp r3, r0 + beq _0804C4B6 + ldrb r2, [r4] + lsls r0, r2, 2 + adds r0, r7 + ldr r0, [r0] + lsls r0, 28 + ands r1, r0 + cmp r1, 0 + bne _0804C4B6 + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _0804C4B6 + lsls r1, r2, 1 + adds r1, r5 + adds r1, 0x98 + ldr r3, =0x020241ec + ldrh r0, [r3] + strb r0, [r1] + ldrb r1, [r4] + ldr r0, [r6] + lsls r1, 1 + adds r1, r0 + adds r1, 0x99 + ldrh r0, [r3] + lsrs r0, 8 + strb r0, [r1] + ldrb r0, [r4] + mov r2, r9 + ldrb r1, [r2] + ldr r2, [r6] + lsls r0, 3 + lsls r1, 1 + adds r0, r1 + adds r0, r2 + adds r0, 0xE0 + ldrh r1, [r3] + strb r1, [r0] + ldrb r1, [r4] + mov r4, r9 + ldrb r0, [r4] + ldr r2, [r6] + lsls r1, 3 + lsls r0, 1 + adds r1, r0 + adds r1, r2 + adds r1, 0xE1 + ldrh r0, [r3] + lsrs r0, 8 + strb r0, [r1] +_0804C4B6: + mov r5, r12 + ldrb r0, [r5, 0x14] + adds r0, 0x1 + strb r0, [r5, 0x14] + b _0804C570 + .pool +_0804C4E4: + ldr r5, =0x02024280 + ldr r2, [r5] + movs r0, 0x80 + lsls r0, 12 + ands r0, r2 + cmp r0, 0 + bne _0804C568 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0804C568 + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0x1] + lsls r0, 29 + cmp r0, 0 + blt _0804C568 + ldr r0, =gBattleMoves + mov r9, r0 + ldr r1, =0x020241ea + mov r8, r1 + ldrh r0, [r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + add r1, r9 + ldrb r0, [r1, 0x6] + cmp r0, 0x8 + bne _0804C568 + movs r6, 0x80 + lsls r6, 2 + adds r4, r6, 0 + ands r4, r2 + cmp r4, 0 + bne _0804C568 + ldr r7, =0x0202420c + ldrb r0, [r7] + bl battle_get_per_side_status + movs r1, 0x2 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _0804C55E + bl _0804BCAC +_0804C55E: + ldr r0, [r5] + orrs r0, r6 + str r0, [r5] + ldr r2, =0x02024474 + mov r12, r2 +_0804C568: + mov r3, r12 + ldrb r0, [r3, 0x14] + adds r0, 0x1 + strb r0, [r3, 0x14] +_0804C570: + ldr r4, [sp, 0x10] + cmp r4, 0x1 + bne _0804C582 + mov r5, r10 + cmp r5, 0 + bne _0804C582 + movs r0, 0x11 + mov r1, r12 + strb r0, [r1, 0x14] +_0804C582: + ldr r2, [sp, 0x10] + cmp r2, 0x2 + bne _0804C598 + ldr r4, [sp, 0x14] + mov r3, r12 + ldrb r3, [r3, 0x14] + cmp r4, r3 + bne _0804C598 + movs r0, 0x11 + mov r4, r12 + strb r0, [r4, 0x14] +_0804C598: + mov r5, r12 + ldrb r0, [r5, 0x14] + cmp r0, 0x11 + beq _0804C5A4 + bl _0804BD14 +_0804C5A4: + mov r1, r12 + ldrb r0, [r1, 0x14] + cmp r0, 0x11 + bne _0804C5BA + mov r2, r10 + cmp r2, 0 + bne _0804C5BA + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x3 +_0804C5B8: + str r0, [r1] +_0804C5BA: + 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_804BBCC + + thumb_func_start atk4A_damagecalc2 +atk4A_damagecalc2: @ 804C5F4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r4, 0 + movs r5, 0 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x2] + mov r8, r0 + ldr r2, =0x02024084 + ldr r3, =0x0202420c + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x20 + ldrb r0, [r0] + mov r12, r2 + adds r7, r3, 0 + cmp r0, 0x1A + bne _0804C688 + mov r1, r8 + cmp r1, 0x4 + bne _0804C688 + ldr r3, =0x0202420a + strb r0, [r3] + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x9 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024250 + ldrb r0, [r7] + lsls r0, 1 + adds r0, r1 + strh r4, [r0] + ldr r0, =0x02024332 + mov r2, r8 + strb r2, [r0, 0x6] + ldrb r0, [r7] + ldrb r1, [r3] + bl b_history__record_ability_usage_of_player + b _0804C76A + .pool +_0804C678: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0] + b _0804C76A + .pool +_0804C688: + ldr r1, =gUnknown_0831ACE8 + adds r0, r5, r1 + ldrb r0, [r0] + adds r6, r1, 0 + b _0804C74A + .pool +_0804C698: + adds r0, r5, r6 + ldrb r0, [r0] + cmp r0, r8 + bne _0804C744 + adds r2, r5, 0x1 + adds r3, r2, r6 + ldrb r1, [r7] + movs r0, 0x58 + muls r0, r1 + add r0, r12 + adds r0, 0x21 + ldrb r1, [r3] + adds r3, r2, 0 + ldrb r0, [r0] + cmp r1, r0 + bne _0804C6D6 + adds r0, r5, 0x2 + adds r0, r6 + ldrb r1, [r0] + cmp r1, 0 + beq _0804C678 + cmp r1, 0x5 + bne _0804C6CA + movs r0, 0x4 + orrs r4, r0 +_0804C6CA: + cmp r1, 0x14 + bne _0804C6D6 + movs r0, 0x2 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_0804C6D6: + adds r2, r3, r6 + ldrb r1, [r7] + movs r0, 0x58 + muls r0, r1 + add r0, r12 + adds r1, r0, 0 + adds r1, 0x22 + ldrb r2, [r2] + ldrb r1, [r1] + cmp r2, r1 + bne _0804C744 + adds r0, 0x21 + ldrb r1, [r0] + cmp r1, r2 + beq _0804C6FE + adds r0, r5, 0x2 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0 + beq _0804C678 +_0804C6FE: + cmp r1, r2 + beq _0804C714 + adds r0, r5, 0x2 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0x5 + bne _0804C714 + movs r0, 0x4 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_0804C714: + adds r2, r3, r6 + ldrb r1, [r7] + movs r0, 0x58 + muls r0, r1 + add r0, r12 + adds r1, r0, 0 + adds r1, 0x22 + ldrb r2, [r2] + ldrb r1, [r1] + cmp r2, r1 + bne _0804C744 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, r2 + beq _0804C744 + adds r0, r5, 0x2 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0x14 + bne _0804C744 + movs r0, 0x2 + orrs r4, r0 + lsls r0, r4, 24 + lsrs r4, r0, 24 +_0804C744: + adds r5, 0x3 + adds r0, r5, r6 + ldrb r0, [r0] +_0804C74A: + cmp r0, 0xFF + beq _0804C76A + cmp r0, 0xFE + bne _0804C698 + ldrb r1, [r7] + movs r0, 0x58 + muls r0, r1 + mov r1, r12 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 22 + ands r0, r1 + cmp r0, 0 + beq _0804C744 +_0804C76A: + ldr r2, =0x02024084 + ldr r0, =0x0202420c + mov r8, r0 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x20 + ldrb r6, [r0] + cmp r6, 0x19 + bne _0804C7E6 + movs r5, 0x29 + ands r5, r4 + cmp r5, 0 + bne _0804C7E6 + ldr r0, =0x0202420b + ldrb r0, [r0] + ldr r7, =0x020241ea + ldrh r1, [r7] + bl move_weather_interaction + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x2 + bne _0804C7E6 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0804C7AC + movs r0, 0x6 + ands r4, r0 + cmp r4, 0x6 + bne _0804C7E6 +_0804C7AC: + ldr r2, =gBattleMoves + ldrh r1, [r7] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _0804C7E6 + ldr r3, =0x0202420a + strb r6, [r3] + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024250 + mov r2, r8 + ldrb r0, [r2] + lsls r0, 1 + adds r0, r1 + strh r5, [r0] + ldr r1, =0x02024332 + movs r0, 0x3 + strb r0, [r1, 0x6] + ldrb r0, [r2] + ldrb r1, [r3] + bl b_history__record_ability_usage_of_player +_0804C7E6: + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0804C804 + ldr r2, =0x0202433c + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r1, 4 + adds r1, r2 + ldrb r0, [r1, 0x1] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r1, 0x1] +_0804C804: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk4A_damagecalc2 + + thumb_func_start atk4B_cmd4b +atk4B_cmd4b: @ 804C844 + push {r4,lr} + ldr r4, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r4] + ldr r2, =0x02024280 + ldr r1, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r2] + ands r0, r1 + cmp r0, 0 + bne _0804C872 + movs r0, 0 + movs r1, 0 + bl dp01_build_cmdbuf_x06_a + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0804C872: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk4B_cmd4b + + thumb_func_start atk4C_switch1 +atk4C_switch1: @ 804C894 + push {r4,r5,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0804C8E4 + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + ldr r3, =0x0202406e + ldrb r0, [r4] + lsls r2, r0, 1 + adds r2, r3 + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + adds r0, 0x5C + ldrb r0, [r0] + strh r0, [r2] + ldr r1, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0] + movs r0, 0 + movs r1, 0 + bl dp01_build_cmdbuf_x00_a_b_0 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] +_0804C8E4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk4C_switch1 + + thumb_func_start sub_804C904 +sub_804C904: @ 804C904 + push {r4-r7,lr} + sub sp, 0x58 + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _0804C912 + b _0804CAA4 +_0804C912: + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + ldr r6, =0x02024084 + ldrb r0, [r4] + movs r5, 0x58 + adds r1, r0, 0 + muls r1, r5 + adds r1, r6 + mov r0, sp + movs r2, 0x58 + bl memcpy + ldrb r0, [r4] + muls r0, r5 + adds r3, r0, r6 + movs r2, 0 + ldr r5, =0x02023864 +_0804C93E: + adds r0, r3, r2 + ldrb r1, [r4] + lsls r1, 9 + adds r1, 0x4 + adds r1, r2, r1 + adds r1, r5 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x57 + bls _0804C93E + ldr r4, =0x02024084 + ldr r6, =0x02024064 + ldrb r0, [r6] + movs r7, 0x58 + adds r2, r0, 0 + muls r2, r7 + adds r2, r4 + ldr r3, =gBaseStats + ldrh r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x6] + adds r2, 0x21 + strb r0, [r2] + ldrb r0, [r6] + adds r1, r0, 0 + muls r1, r7 + adds r1, r4 + ldrh r2, [r1] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x7] + adds r1, 0x22 + strb r0, [r1] + ldrb r0, [r6] + adds r1, r0, 0 + muls r1, r7 + adds r1, r4 + ldrh r0, [r1] + ldrb r1, [r1, 0x17] + lsrs r1, 7 + bl sub_806B694 + ldrb r1, [r6] + muls r1, r7 + adds r1, r4 + adds r1, 0x20 + strb r0, [r1] + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x020243d0 + adds r0, 0x29 + adds r0, r2, r0 + ldrb r1, [r0] + ldr r3, =gUnknown_0832A328 + ldr r2, =0x0202406e + ldrb r5, [r6] + lsls r0, r5, 1 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + ands r1, r0 + mov r12, r4 + cmp r1, 0 + beq _0804C9DE + adds r0, r5, 0 + muls r0, r7 + add r0, r12 + movs r1, 0 + strh r1, [r0, 0x2E] +_0804C9DE: + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x7F + bne _0804CA26 + movs r2, 0 + adds r4, r6, 0 + movs r6, 0x58 + mov r5, r12 + adds r5, 0x18 + add r3, sp, 0x18 +_0804C9FE: + ldrb r0, [r4] + adds r1, r0, 0 + muls r1, r6 + adds r1, r2, r1 + adds r1, r5 + adds r0, r3, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r2, 0x1 + cmp r2, 0x7 + ble _0804C9FE + ldr r0, =0x02024064 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + mov r1, r12 + adds r1, 0x50 + adds r0, r1 + ldr r1, [sp, 0x50] + str r1, [r0] +_0804CA26: + bl sub_803A284 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0804CA78 + ldr r4, =0x02024084 + ldr r0, =0x02024064 + ldrb r3, [r0] + movs r0, 0x58 + adds r2, r3, 0 + muls r2, r0 + adds r1, r2, r4 + ldrh r0, [r1, 0x2C] + lsrs r0, 1 + ldrh r1, [r1, 0x28] + cmp r0, r1 + bcc _0804CA78 + cmp r1, 0 + beq _0804CA78 + adds r0, r4, 0 + adds r0, 0x4C + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0804CA78 + ldr r0, =0x0202449c + ldr r2, [r0] + adds r2, 0x92 + ldr r1, =gUnknown_0832A328 + lsls r0, r3, 2 + adds r0, r1 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] +_0804CA78: + ldr r0, =0x02024474 + ldr r3, =0x02024064 + ldrb r2, [r3] + strb r2, [r0, 0x17] + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x7 + strb r0, [r1, 0x1] + strb r2, [r1, 0x2] + ldr r2, =0x0202406e + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_0804CAA4: + add sp, 0x58 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804C904 + + thumb_func_start atk4E_switch3 +atk4E_switch3: @ 804CAE8 + push {r4-r6,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0804CB86 + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r6, =0x02024064 + strb r0, [r6] + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0804CB3E + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x063f0902 + ands r0, r1 + cmp r0, 0 + bne _0804CB3E + ldr r4, =0x02024084 + ldrb r0, [r6] + movs r5, 0x58 + muls r0, r5 + adds r0, r4 + ldrh r0, [r0] + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r6] + muls r1, r5 + adds r4, 0x48 + adds r1, r4 + ldr r2, [r1] + movs r1, 0x2 + bl SetPokedexFlag +_0804CB3E: + ldr r2, =0x02024210 + ldr r1, =gUnknown_0832A328 + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldrb r0, [r2] + bics r0, r1 + strb r0, [r2] + ldr r1, =0x0202406e + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrb r1, [r0] + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r2, [r0, 0x2] + movs r0, 0 + bl dp01_build_cmdbuf_x05_a_b_c + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r4] + adds r0, 0x3 + str r0, [r4] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0804CB86 + bl sub_81A56B4 +_0804CB86: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atk4E_switch3 + + thumb_func_start atk4F_jumpifcannotswitch +atk4F_jumpifcannotswitch: @ 804CBB0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r1, [r0, 0x1] + movs r0, 0x7F + ands r0, r1 + bl get_battle_side_of_something + ldr r3, =0x02024064 + strb r0, [r3] + ldr r2, [r4] + ldrb r1, [r2, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0804CC28 + ldr r1, =0x02024084 + ldrb r3, [r3] + movs r0, 0x58 + muls r0, r3 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x0400e000 + ands r0, r1 + cmp r0, 0 + bne _0804CBFC + ldr r1, =0x020242ac + lsls r0, r3, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 3 + ands r0, r1 + cmp r0, 0 + beq _0804CC28 +_0804CBFC: + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _0804CF00 + .pool +_0804CC28: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 15 + ands r0, r1 + cmp r0, 0 + beq _0804CCC0 + ldr r5, =0x02024064 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020244ec + mov r8, r1 + cmp r0, 0x1 + bne _0804CC4E + ldr r0, =0x02024744 + mov r8, r0 +_0804CC4E: + movs r4, 0 + ldrb r1, [r5] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0804CC5C + movs r4, 0x3 +_0804CC5C: + adds r6, r4, 0x3 + cmp r4, r6 + bge _0804CCA4 + ldr r7, =0x0202406e +_0804CC64: + movs r0, 0x64 + muls r0, r4 + mov r1, r8 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _0804CC9E + adds r0, r5, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0804CC9E + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _0804CC9E + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + cmp r0, r4 + bne _0804CCA4 +_0804CC9E: + adds r4, 0x1 + cmp r4, r6 + blt _0804CC64 +_0804CCA4: + cmp r4, r6 + bne _0804CCAA + b _0804CED0 +_0804CCAA: + b _0804CEF8 + .pool +_0804CCC0: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804CD8C + movs r0, 0x80 + lsls r0, 16 + ands r1, r0 + cmp r1, 0 + beq _0804CD00 + ldr r5, =0x02024064 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0804CCEC + ldr r0, =0x020244ec + b _0804CD16 + .pool +_0804CCEC: + ldr r1, =0x02024744 + mov r8, r1 + ldrb r0, [r5] + movs r4, 0x3 + cmp r0, 0x1 + bne _0804CD32 + movs r4, 0 + b _0804CD32 + .pool +_0804CD00: + ldr r5, =0x02024064 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020244ec + mov r8, r1 + cmp r0, 0x1 + bne _0804CD18 + ldr r0, =0x02024744 +_0804CD16: + mov r8, r0 +_0804CD18: + movs r4, 0 + ldrb r0, [r5] + bl sub_806D864 + lsls r0, 24 + lsrs r0, 24 + bl sub_806D82C + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _0804CD32 + movs r4, 0x3 +_0804CD32: + adds r6, r4, 0x3 + cmp r4, r6 + bge _0804CCA4 + ldr r7, =0x0202406e +_0804CD3A: + movs r0, 0x64 + muls r0, r4 + mov r1, r8 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _0804CD74 + adds r0, r5, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0804CD74 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _0804CD74 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + cmp r0, r4 + bne _0804CCA4 +_0804CD74: + adds r4, 0x1 + cmp r4, r6 + blt _0804CD3A + b _0804CCA4 + .pool +_0804CD8C: + movs r0, 0x80 + lsls r0, 8 + ands r1, r0 + cmp r1, 0 + beq _0804CE10 + ldr r5, =0x02024064 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0804CE10 + ldr r0, =0x02024744 + mov r8, r0 + movs r4, 0 + ldrb r0, [r5] + cmp r0, 0x3 + bne _0804CDB4 + movs r4, 0x3 +_0804CDB4: + adds r6, r4, 0x3 + cmp r4, r6 + blt _0804CDBC + b _0804CCA4 +_0804CDBC: + ldr r7, =0x0202406e +_0804CDBE: + movs r0, 0x64 + muls r0, r4 + mov r1, r8 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _0804CDFA + adds r0, r5, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0804CDFA + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _0804CDFA + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + cmp r0, r4 + beq _0804CDFA + b _0804CCA4 +_0804CDFA: + adds r4, 0x1 + cmp r4, r6 + blt _0804CDBE + b _0804CCA4 + .pool +_0804CE10: + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bne _0804CE54 + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02022fec + ldr r0, [r0] + ands r0, r4 + cmp r0, 0 + beq _0804CE48 + movs r0, 0x3 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r6, r0, 24 + b _0804CE4A + .pool +_0804CE48: + adds r6, r7, 0 +_0804CE4A: + ldr r0, =0x02024744 + mov r8, r0 + b _0804CE82 + .pool +_0804CE54: + movs r0, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0804CE7C + movs r0, 0x2 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r6, r0, 24 + b _0804CE7E + .pool +_0804CE7C: + adds r6, r7, 0 +_0804CE7E: + ldr r1, =0x020244ec + mov r8, r1 +_0804CE82: + movs r4, 0 +_0804CE84: + movs r0, 0x64 + muls r0, r4 + mov r1, r8 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _0804CEC6 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _0804CEC6 + adds r0, r5, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0804CEC6 + ldr r1, =0x0202406e + lsls r0, r7, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + beq _0804CEC6 + lsls r0, r6, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + bne _0804CECC +_0804CEC6: + adds r4, 0x1 + cmp r4, 0x5 + ble _0804CE84 +_0804CECC: + cmp r4, 0x6 + bne _0804CEF8 +_0804CED0: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0804CF00 + .pool +_0804CEF8: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x6 + str r0, [r1] +_0804CF00: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk4F_jumpifcannotswitch + + thumb_func_start sub_804CF10 +sub_804CF10: @ 804CF10 + push {r4,r5,lr} + sub sp, 0x4 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r5, =0x02024064 + ldrb r0, [r5] + ldr r4, =0x0202449c + ldr r1, [r4] + adds r1, r0, r1 + adds r1, 0x58 + ldr r3, =0x0202406e + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strb r0, [r1] + ldrb r0, [r5] + ldr r1, [r4] + adds r0, r1 + adds r0, 0x5C + movs r1, 0x6 + strb r1, [r0] + ldr r1, [r4] + adds r1, 0x93 + ldr r3, =gUnknown_0832A328 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r3 + ldr r3, [r0] + ldrb r0, [r1] + bics r0, r3 + strb r0, [r1] + ldrb r0, [r5] + lsls r1, r0, 1 + adds r1, r0 + adds r1, 0x60 + ldr r0, [r4] + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804CF10 + + thumb_func_start atk50_openpartyscreen +atk50_openpartyscreen: @ 804CF88 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + movs r7, 0 + movs r0, 0 + mov r9, r0 + ldr r6, =0x02024214 + ldr r2, [r6] + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + mov r8, r1 + ldrb r1, [r2, 0x1] + adds r0, r1, 0 + mov r12, r6 + cmp r0, 0x5 + beq _0804CFBE + b _0804D464 +_0804CFBE: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x41 + ands r1, r0 + cmp r1, 0x1 + beq _0804D0B0 + ldr r1, =0x02024064 + strb r7, [r1] + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r7, r0 + bcc _0804CFD8 + b _0804D450 +_0804CFD8: + ldr r7, =0x02024280 + ldr r6, =gUnknown_0832A328 + adds r4, r1, 0 + ldr r2, =0x02024210 + mov r8, r2 +_0804CFE2: + ldrb r2, [r4] + lsls r0, r2, 2 + adds r0, r6 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r7] + ands r0, r1 + cmp r0, 0 + beq _0804D088 + adds r0, r2, 0 + movs r1, 0x6 + movs r2, 0x6 + bl sub_80423F4 + lsls r0, 24 + cmp r0, 0 + beq _0804D054 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + mov r2, r8 + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r7] + bics r0, r1 + str r0, [r7] + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_8034464 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _0804D098 + .pool +_0804D054: + ldr r5, =0x0202437c + ldrb r0, [r4] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + blt _0804D098 + movs r0, 0x6 + bl sub_804CF10 + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + b _0804D098 + .pool +_0804D088: + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_8034464 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0804D098: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0804CFE2 + b _0804D450 + .pool +_0804D0B0: + ands r0, r1 + cmp r0, 0 + bne _0804D0B8 + b _0804D450 +_0804D0B8: + ldr r0, =0x02024280 + mov r8, r0 + ldr r0, [r0] + lsrs r5, r0, 28 + ldr r6, =gUnknown_0832A328 + ldr r0, [r6] + ands r0, r5 + cmp r0, 0 + beq _0804D170 + ldr r4, =0x02024064 + strb r7, [r4] + movs r0, 0 + movs r1, 0x6 + movs r2, 0x6 + bl sub_80423F4 + lsls r0, 24 + cmp r0, 0 + beq _0804D120 + ldr r2, =0x02024210 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r1, [r0] + lsls r1, 28 + mov r2, r8 + ldr r0, [r2] + bics r0, r1 + str r0, [r2] + movs r0, 0 + bl dp01_build_cmdbuf_x2A_2A_2A_2A + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _0804D170 + .pool +_0804D120: + ldr r6, =0x0202437c + ldrb r0, [r4] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + blt _0804D15C + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x5E + ldrb r0, [r0] + bl sub_804CF10 + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + b _0804D170 + .pool +_0804D15C: + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_8034464 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + movs r0, 0x1 + mov r9, r0 +_0804D170: + ldr r6, =gUnknown_0832A328 + ldr r0, [r6, 0x8] + ands r0, r5 + cmp r0, 0 + beq _0804D22E + ldr r0, [r6] + ands r0, r5 + cmp r0, 0 + bne _0804D22E + ldr r4, =0x02024064 + movs r0, 0x2 + strb r0, [r4] + movs r0, 0x2 + movs r1, 0x6 + movs r2, 0x6 + bl sub_80423F4 + lsls r0, 24 + cmp r0, 0 + beq _0804D1D8 + ldr r2, =0x02024210 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r2, =0x02024280 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r2] + bics r0, r1 + str r0, [r2] + movs r0, 0 + bl dp01_build_cmdbuf_x2A_2A_2A_2A + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _0804D22E + .pool +_0804D1D8: + ldr r6, =0x0202437c + ldrb r0, [r4] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + blt _0804D214 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x5C + ldrb r0, [r0] + bl sub_804CF10 + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + b _0804D22E + .pool +_0804D214: + movs r0, 0x1 + mov r1, r9 + ands r0, r1 + cmp r0, 0 + bne _0804D22E + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_8034464 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0804D22E: + ldr r6, =gUnknown_0832A328 + ldr r0, [r6, 0x4] + ands r0, r5 + cmp r0, 0 + beq _0804D2E4 + ldr r4, =0x02024064 + movs r0, 0x1 + strb r0, [r4] + movs r0, 0x1 + movs r1, 0x6 + movs r2, 0x6 + bl sub_80423F4 + lsls r0, 24 + cmp r0, 0 + beq _0804D290 + ldr r2, =0x02024210 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r2, =0x02024280 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r2] + bics r0, r1 + str r0, [r2] + movs r0, 0 + bl dp01_build_cmdbuf_x2A_2A_2A_2A + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _0804D2E4 + .pool +_0804D290: + ldr r6, =0x0202437c + ldrb r0, [r4] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + blt _0804D2CC + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x5F + ldrb r0, [r0] + bl sub_804CF10 + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + b _0804D2E4 + .pool +_0804D2CC: + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_8034464 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + movs r0, 0x2 + mov r2, r9 + orrs r2, r0 + mov r9, r2 +_0804D2E4: + ldr r6, =gUnknown_0832A328 + ldr r0, [r6, 0xC] + ands r0, r5 + cmp r0, 0 + beq _0804D3A2 + ldr r0, [r6, 0x4] + ands r0, r5 + cmp r0, 0 + bne _0804D3A2 + ldr r4, =0x02024064 + movs r0, 0x3 + strb r0, [r4] + movs r0, 0x3 + movs r1, 0x6 + movs r2, 0x6 + bl sub_80423F4 + lsls r0, 24 + cmp r0, 0 + beq _0804D34C + ldr r2, =0x02024210 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r2, =0x02024280 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r2] + bics r0, r1 + str r0, [r2] + movs r0, 0 + bl dp01_build_cmdbuf_x2A_2A_2A_2A + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _0804D3A2 + .pool +_0804D34C: + ldr r6, =0x0202437c + ldrb r0, [r4] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + blt _0804D388 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x5D + ldrb r0, [r0] + bl sub_804CF10 + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + b _0804D3A2 + .pool +_0804D388: + movs r0, 0x2 + mov r1, r9 + ands r1, r0 + cmp r1, 0 + bne _0804D3A2 + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_8034464 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0804D3A2: + ldr r1, =0x0202437c + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + blt _0804D3FA + adds r0, r1, 0 + adds r0, 0x28 + ldrb r0, [r0] + lsls r0, 25 + cmp r0, 0 + blt _0804D3FA + cmp r5, 0 + beq _0804D3FA + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r0, =gUnknown_0832A328 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0804D3E4 + ldr r1, =0x02024064 + movs r0, 0x2 + strb r0, [r1] + b _0804D3E8 + .pool +_0804D3E4: + ldr r0, =0x02024064 + strb r1, [r0] +_0804D3E8: + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_8034464 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution +_0804D3FA: + ldr r1, =0x0202437c + ldrb r0, [r1, 0x14] + lsls r0, 25 + cmp r0, 0 + blt _0804D450 + adds r0, r1, 0 + adds r0, 0x3C + ldrb r0, [r0] + lsls r0, 25 + cmp r0, 0 + blt _0804D450 + cmp r5, 0 + beq _0804D450 + ldr r0, =0x02024210 + ldrb r0, [r0] + ldr r1, =gUnknown_0832A328 + ldr r1, [r1, 0x4] + ands r0, r1 + cmp r0, 0 + beq _0804D438 + ldr r1, =0x02024064 + movs r0, 0x3 + b _0804D43C + .pool +_0804D438: + ldr r1, =0x02024064 + movs r0, 0x1 +_0804D43C: + strb r0, [r1] + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_8034464 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution +_0804D450: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x6 + str r0, [r1] + b _0804D804 + .pool +_0804D464: + cmp r0, 0x6 + beq _0804D46A + b _0804D658 +_0804D46A: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804D478 + b _0804D5F4 +_0804D478: + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + bne _0804D482 + b _0804D5F4 +_0804D482: + ldr r7, =0x02024280 + ldr r0, [r7] + lsrs r5, r0, 28 + ldr r4, =gUnknown_0832A328 + ldr r0, [r4, 0x8] + ands r0, r5 + cmp r0, 0 + beq _0804D52A + ldr r0, [r4] + ands r0, r5 + cmp r0, 0 + beq _0804D52A + ldr r6, =0x02024064 + movs r0, 0x2 + strb r0, [r6] + ldr r0, =0x02023864 + ldrb r1, [r0, 0x1] + movs r0, 0x2 + movs r2, 0x6 + bl sub_80423F4 + lsls r0, 24 + cmp r0, 0 + beq _0804D4F8 + ldr r2, =0x02024210 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r6] + lsls r0, 2 + adds r0, r4 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r7] + bics r0, r1 + str r0, [r7] + movs r0, 0 + bl dp01_build_cmdbuf_x2A_2A_2A_2A + ldrb r0, [r6] + bl dp01_battle_side_mark_buffer_for_execution + b _0804D52A + .pool +_0804D4F8: + ldr r4, =0x0202437c + ldrb r0, [r6] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + blt _0804D52A + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x5C + ldrb r0, [r0] + bl sub_804CF10 + ldrb r1, [r6] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] +_0804D52A: + ldr r4, =gUnknown_0832A328 + ldr r0, [r4, 0xC] + ands r0, r5 + cmp r0, 0 + beq _0804D5DA + ldr r0, [r4, 0x4] + ands r5, r0 + cmp r5, 0 + beq _0804D5DA + ldr r5, =0x02024064 + movs r0, 0x3 + strb r0, [r5] + ldr r0, =0x02023864 + ldr r2, =0x00000201 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x3 + movs r2, 0x6 + bl sub_80423F4 + lsls r0, 24 + cmp r0, 0 + beq _0804D5A8 + ldr r2, =0x02024210 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r2, =0x02024280 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r4 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r2] + bics r0, r1 + str r0, [r2] + movs r0, 0 + bl dp01_build_cmdbuf_x2A_2A_2A_2A + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + b _0804D5DA + .pool +_0804D5A8: + ldr r4, =0x0202437c + ldrb r0, [r5] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r1] + lsls r0, 25 + cmp r0, 0 + blt _0804D5DA + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x5D + ldrb r0, [r0] + bl sub_804CF10 + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] +_0804D5DA: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x6 + str r0, [r1] + mov r12, r1 + b _0804D5F8 + .pool +_0804D5F4: + adds r0, r2, 0x6 + str r0, [r6] +_0804D5F8: + ldr r0, =0x02024280 + ldr r0, [r0] + lsrs r5, r0, 28 + ldr r1, =0x0202420d + movs r0, 0 + strb r0, [r1] + ldr r4, =gUnknown_0832A328 + ldr r2, [r4] + ands r2, r5 + ldr r6, =0x0202406c + cmp r2, 0 + bne _0804D634 + adds r7, r6, 0 + ldrb r0, [r6] + cmp r2, r0 + bcs _0804D634 + adds r3, r1, 0 +_0804D61A: + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + ldrb r2, [r3] + lsls r0, r2, 2 + adds r0, r4 + ldr r0, [r0] + ands r0, r5 + cmp r0, 0 + bne _0804D634 + ldrb r0, [r7] + cmp r2, r0 + bcc _0804D61A +_0804D634: + ldrb r0, [r1] + ldrb r6, [r6] + cmp r0, r6 + beq _0804D63E + b _0804D804 +_0804D63E: + mov r1, r8 + mov r2, r12 + str r1, [r2] + b _0804D804 + .pool +_0804D658: + movs r0, 0x80 + ands r0, r1 + movs r5, 0x1 + cmp r0, 0 + beq _0804D664 + movs r5, 0 +_0804D664: + movs r0, 0x7F + ands r0, r1 + bl get_battle_side_of_something + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x0202437c + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 25 + cmp r0, 0 + bge _0804D690 + ldr r0, [r6] + adds r0, 0x6 + str r0, [r6] + b _0804D804 + .pool +_0804D690: + adds r0, r7, 0 + movs r1, 0x6 + movs r2, 0x6 + bl sub_80423F4 + lsls r0, 24 + cmp r0, 0 + beq _0804D6E0 + ldr r2, =0x02024064 + strb r7, [r2] + ldr r3, =0x02024210 + ldr r4, =gUnknown_0832A328 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + ldrb r1, [r3] + orrs r0, r1 + strb r0, [r3] + ldr r3, =0x02024280 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r4 + ldr r1, [r0] + lsls r1, 28 + ldr r0, [r3] + bics r0, r1 + str r0, [r3] + mov r0, r8 + str r0, [r6] + b _0804D804 + .pool +_0804D6E0: + ldr r4, =0x02024064 + strb r7, [r4] + ldrb r0, [r4] + ldr r3, =0x0202449c + ldr r1, [r3] + adds r1, r0, r1 + adds r1, 0x58 + ldr r2, =0x0202406e + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1] + ldrb r0, [r4] + ldr r1, [r3] + adds r0, r1 + adds r0, 0x5C + movs r1, 0x6 + strb r1, [r0] + ldr r1, [r3] + adds r1, 0x93 + ldr r2, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r2 + ldr r2, [r0] + ldrb r0, [r1] + bics r0, r2 + strb r0, [r1] + ldrb r1, [r4] + movs r0, 0x2 + eors r0, r1 + ldr r3, [r3] + adds r0, r3 + adds r0, 0x5C + ldrb r2, [r0] + ldrb r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + adds r0, 0x60 + adds r3, r0 + str r3, [sp] + movs r0, 0 + adds r1, r5, 0 + movs r3, 0 + bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r6] + adds r0, 0x6 + str r0, [r6] + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + cmp r0, 0 + bne _0804D760 + ldr r1, =0x03005d10 + ldrb r0, [r1, 0x2] + cmp r0, 0xFE + bhi _0804D760 + adds r0, 0x1 + strb r0, [r1, 0x2] +_0804D760: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804D7C4 + ldr r1, =0x02024064 + movs r0, 0 + strb r0, [r1] + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r0, 0 + beq _0804D804 + adds r4, r1, 0 +_0804D77C: + ldrb r0, [r4] + cmp r0, r7 + beq _0804D792 + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_8034464 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0804D792: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _0804D77C + b _0804D804 + .pool +_0804D7C4: + adds r0, r7, 0 + bl battle_get_per_side_status + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + ldr r4, =0x02024064 + strb r0, [r4] + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r3, [r4] + lsls r0, r3, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0804D7F4 + movs r0, 0x2 + eors r3, r0 + strb r3, [r4] +_0804D7F4: + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_8034464 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0804D804: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk50_openpartyscreen + + thumb_func_start atk51_cmd51 +atk51_cmd51: @ 804D820 + push {r4-r7,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _0804D82C + b _0804DA8A +_0804D82C: + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r5, =0x02024064 + strb r0, [r5] + ldr r0, [r4] + ldrb r0, [r0, 0x2] + cmp r0, 0x1 + beq _0804D8CC + cmp r0, 0x1 + bgt _0804D858 + cmp r0, 0 + beq _0804D862 + b _0804DA82 + .pool +_0804D858: + cmp r0, 0x2 + beq _0804D8E8 + cmp r0, 0x3 + beq _0804D922 + b _0804DA82 +_0804D862: + movs r6, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r6, r0 + blt _0804D86E + b _0804DA82 +_0804D86E: + ldr r7, =0x02023864 +_0804D870: + ldrb r0, [r7] + cmp r0, 0x22 + bne _0804D8AA + ldr r5, =0x0202449c + ldr r0, [r5] + adds r0, r6, r0 + adds r0, 0x5C + ldrb r1, [r7, 0x1] + strb r1, [r0] + ldr r0, [r5] + adds r0, 0x93 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + lsls r0, r6, 2 + adds r0, r2 + ldr r4, [r0] + ands r1, r4 + cmp r1, 0 + bne _0804D8AA + lsls r0, r6, 24 + lsrs r0, 24 + ldrb r1, [r7, 0x1] + bl sub_8184FBC + ldr r1, [r5] + adds r1, 0x93 + ldrb r0, [r1] + orrs r4, r0 + strb r4, [r1] +_0804D8AA: + movs r0, 0x80 + lsls r0, 2 + adds r7, r0 + adds r6, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r6, r0 + blt _0804D870 + b _0804DA82 + .pool +_0804D8CC: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804D8DA + b _0804DA82 +_0804D8DA: + ldrb r0, [r5] + bl sub_803BDA0 + b _0804DA82 + .pool +_0804D8E8: + ldr r4, =0x0202449c + ldr r0, [r4] + adds r0, 0x93 + ldrb r1, [r0] + ldr r6, =gUnknown_0832A328 + ldrb r2, [r5] + lsls r0, r2, 2 + adds r0, r6 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0804D922 + ldr r0, =0x02023864 + lsls r1, r2, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r1, [r1] + adds r0, r2, 0 + bl sub_8184FBC + ldr r2, [r4] + adds r2, 0x93 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] +_0804D922: + ldr r1, =0x02024332 + ldr r6, =0x02023864 + ldr r7, =0x02024064 + ldrb r0, [r7] + lsls r0, 9 + adds r2, r6, 0x1 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + ldr r1, =0x0202449c + mov r12, r1 + ldr r1, [r1] + adds r1, r0, r1 + adds r1, 0x5C + lsls r0, 9 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x42 + ands r0, r1 + cmp r0, 0x42 + bne _0804DA14 + ldrb r0, [r7] + mov r3, r12 + ldr r2, [r3] + lsls r1, r0, 1 + adds r1, r0 + adds r1, r2 + adds r1, 0x60 + ldrb r2, [r1] + movs r0, 0xF + ands r0, r2 + strb r0, [r1] + ldrb r0, [r7] + ldr r2, [r3] + lsls r1, r0, 1 + adds r1, r0 + adds r1, r2 + adds r1, 0x60 + lsls r0, 9 + adds r5, r6, 0x2 + adds r0, r5 + ldrb r2, [r0] + movs r3, 0xF0 + adds r0, r3, 0 + ands r0, r2 + ldrb r2, [r1] + orrs r0, r2 + strb r0, [r1] + ldrb r1, [r7] + mov r0, r12 + ldr r2, [r0] + lsls r0, r1, 1 + adds r0, r1 + adds r0, r2 + adds r0, 0x61 + lsls r1, 9 + adds r6, 0x3 + adds r1, r6 + ldrb r1, [r1] + strb r1, [r0] + ldrb r0, [r7] + movs r4, 0x2 + eors r0, r4 + mov r1, r12 + ldr r2, [r1] + lsls r1, r0, 1 + adds r1, r0 + adds r1, r2 + adds r1, 0x60 + ldrb r2, [r1] + adds r0, r3, 0 + ands r0, r2 + strb r0, [r1] + ldrb r0, [r7] + eors r0, r4 + mov r1, r12 + ldr r2, [r1] + lsls r1, r0, 1 + adds r1, r0 + adds r1, r2 + adds r1, 0x60 + ldrb r0, [r7] + lsls r0, 9 + adds r0, r5 + ldrb r0, [r0] + ands r3, r0 + lsrs r3, 4 + ldrb r0, [r1] + orrs r3, r0 + strb r3, [r1] + ldrb r0, [r7] + eors r4, r0 + mov r2, r12 + ldr r0, [r2] + lsls r1, r4, 1 + adds r1, r4 + adds r1, r0 + adds r1, 0x62 + ldrb r0, [r7] + lsls r0, 9 + adds r0, r6 + ldrb r0, [r0] + strb r0, [r1] + b _0804DA36 + .pool +_0804DA14: + movs r0, 0x80 + lsls r0, 15 + ands r1, r0 + cmp r1, 0 + beq _0804DA30 + ldrb r0, [r7] + mov r3, r12 + ldr r1, [r3] + adds r1, r0, r1 + adds r1, 0x5C + ldrb r1, [r1] + bl sub_80571DC + b _0804DA36 +_0804DA30: + ldrb r0, [r7] + bl sub_803BDA0 +_0804DA36: + ldr r1, =0x02022f58 + movs r5, 0xFD + strb r5, [r1] + movs r0, 0x6 + strb r0, [r1, 0x1] + ldr r4, =0x02024084 + ldr r3, =0x0202420b + ldrb r0, [r3] + movs r2, 0x58 + muls r0, r2 + adds r0, r4 + ldrh r0, [r0] + strb r0, [r1, 0x2] + ldrb r0, [r3] + muls r0, r2 + adds r0, r4 + ldrh r0, [r0] + lsrs r0, 8 + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r2, =0x02022f68 + strb r5, [r2] + movs r0, 0x7 + strb r0, [r2, 0x1] + ldr r3, =0x02024064 + ldrb r0, [r3] + strb r0, [r2, 0x2] + ldr r1, =0x02023864 + ldrb r0, [r3] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2, 0x3] + movs r0, 0x1 + negs r0, r0 + strb r0, [r2, 0x4] +_0804DA82: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x3 + str r0, [r1] +_0804DA8A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk51_cmd51 + + thumb_func_start atk52_cmd52 +atk52_cmd52: @ 804DAAC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r0, =0x02024214 + mov r9, r0 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + ldrb r0, [r4] + bl sub_803FA70 + ldr r1, =0x02024280 + mov r8, r1 + ldr r1, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + lsls r1, 28 + mov r2, r8 + ldr r0, [r2] + bics r0, r1 + str r0, [r2] + ldr r2, =0x0202437c + ldrb r0, [r4] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1] + movs r0, 0x41 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldrb r0, [r4] + bl battle_side_get_owner + ldr r5, =0x0202428e + lsls r0, 24 + lsrs r0, 23 + adds r0, r5 + ldrh r1, [r0] + movs r7, 0x80 + lsls r7, 2 + mov r10, r7 + mov r0, r10 + ands r0, r1 + cmp r0, 0 + beq _0804DB1C + b _0804DC30 +_0804DB1C: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 23 + adds r0, r5 + ldrh r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0804DB34 + b _0804DC30 +_0804DB34: + ldr r7, =0x02024084 + ldrb r2, [r4] + movs r6, 0x58 + adds r0, r2, 0 + muls r0, r6 + adds r1, r0, r7 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0804DC30 + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0804DC30 + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1A + beq _0804DC30 + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 23 + adds r0, r5 + ldrh r2, [r0] + mov r1, r10 + orrs r1, r2 + strh r1, [r0] + ldrb r0, [r4] + adds r2, r0, 0 + muls r2, r6 + adds r0, r7, 0 + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + ldr r1, =0xfdffffff + ands r0, r1 + str r0, [r2] + mov r1, r8 + ldr r0, [r1] + movs r2, 0x41 + negs r2, r2 + ands r0, r2 + str r0, [r1] + ldrb r0, [r4] + bl battle_side_get_owner + ldr r2, =0x02024294 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0xA] + movs r1, 0x5 + subs r1, r0 + lsls r1, 25 + lsrs r1, 24 + ldr r5, =0x020241f0 + ldrb r0, [r4] + muls r0, r6 + adds r0, r7 + ldrh r0, [r0, 0x2C] + bl __divsi3 + str r0, [r5] + cmp r0, 0 + bne _0804DBC8 + movs r0, 0x1 + str r0, [r5] +_0804DBC8: + ldr r0, =0x02024474 + ldrb r1, [r4] + strb r1, [r0, 0x17] + bl b_movescr_stack_push_cursor + mov r7, r9 + ldr r0, [r7] + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _0804DC14 + ldr r0, =gUnknown_082DAE90 + str r0, [r7] + b _0804DD8E + .pool +_0804DC14: + cmp r0, 0x1 + bne _0804DC24 + ldr r0, =gUnknown_082DAE59 + mov r1, r9 + str r0, [r1] + b _0804DD8E + .pool +_0804DC24: + ldr r0, =gUnknown_082DAEC7 + mov r2, r9 + str r0, [r2] + b _0804DD8E + .pool +_0804DC30: + ldr r2, =0x02024084 + ldr r1, =0x02024064 + ldrb r3, [r1] + movs r0, 0x58 + muls r0, r3 + adds r0, r2 + adds r0, 0x20 + ldrb r0, [r0] + adds r5, r1, 0 + ldr r4, =0x020242bc + cmp r0, 0x36 + bne _0804DC5E + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r2, r0, r4 + ldrb r1, [r2, 0x18] + lsls r0, r1, 30 + cmp r0, 0 + blt _0804DC5E + movs r0, 0x1 + orrs r0, r1 + strb r0, [r2, 0x18] +_0804DC5E: + ldrb r0, [r5] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r1, 0x18] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x18] + ldrb r1, [r5] + movs r0, 0 + str r0, [sp] + movs r2, 0 + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _0804DC88 + b _0804DD8E +_0804DC88: + ldrb r1, [r5] + movs r0, 0 + movs r2, 0 + bl berry_effects_maybe + lsls r0, 24 + cmp r0, 0 + bne _0804DD8E + ldrb r0, [r5] + bl battle_side_get_owner + ldr r1, =0x0202428e + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + ldrh r2, [r0] + ldr r1, =0x0000fdff + ands r1, r2 + strh r1, [r0] + movs r4, 0 + ldr r0, =0x0202406c + ldrb r7, [r0] + cmp r4, r7 + bge _0804DCD8 + ldr r6, =0x0202407e + adds r1, r5, 0 + ldr r5, =0x0202407a + movs r3, 0xC + adds r2, r0, 0 +_0804DCC2: + adds r0, r4, r6 + ldrb r0, [r0] + ldrb r7, [r1] + cmp r0, r7 + bne _0804DCD0 + adds r0, r4, r5 + strb r3, [r0] +_0804DCD0: + adds r4, 0x1 + ldrb r0, [r2] + cmp r4, r0 + blt _0804DCC2 +_0804DCD8: + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + bge _0804DD0C + ldr r6, =0x0202449c + ldr r5, =0x02024084 +_0804DCE6: + lsls r0, r4, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 23 + adds r0, 0xA8 + ldr r1, [r6] + adds r1, r0 + movs r0, 0x58 + muls r0, r4 + adds r0, r5 + ldrh r0, [r0, 0x28] + strh r0, [r1] + adds r4, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _0804DCE6 +_0804DD0C: + ldr r0, =0x02024214 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r5, r0, 0 + cmp r1, 0x5 + bne _0804DD88 + ldr r0, =0x02024280 + ldr r0, [r0] + lsrs r4, r0, 28 + ldr r1, =0x0202420d + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r2, =gUnknown_0832A328 + b _0804DD6E + .pool +_0804DD60: + ldr r0, =0x0202406c + ldrb r3, [r1] + ldrb r0, [r0] + cmp r3, r0 + bcs _0804DD88 + adds r0, r3, 0x1 + strb r0, [r1] +_0804DD6E: + ldrb r0, [r1] + lsls r0, 2 + adds r0, r2 + ldr r3, [r0] + adds r0, r4, 0 + ands r0, r3 + cmp r0, 0 + beq _0804DD60 + ldr r0, =0x02024210 + ldrb r0, [r0] + ands r0, r3 + cmp r0, 0 + bne _0804DD60 +_0804DD88: + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] +_0804DD8E: + 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 atk52_cmd52 + + thumb_func_start sub_804DDA8 +sub_804DDA8: @ 804DDA8 + push {r4,r5,lr} + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl battle_get_side_with_given_state + ldr r4, =0x02024064 + strb r0, [r4] + movs r0, 0 + bl dp01_build_cmdbuf_x08_8_8_8 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804DDA8 + + thumb_func_start atk54_802511C +atk54_802511C: @ 804DDD8 + push {r4,r5,lr} + ldr r5, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r5] + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r1, [r0, 0x1] + ldrb r0, [r0, 0x2] + lsls r0, 8 + orrs r1, r0 + movs r0, 0 + bl dp01_build_cmdbuf_x2B_aa_0 + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r4] + adds r0, 0x3 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk54_802511C + + thumb_func_start sub_804DE14 +sub_804DE14: @ 804DE14 + push {r4,r5,lr} + ldr r5, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r5] + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r1, [r0, 0x1] + ldrb r0, [r0, 0x2] + lsls r0, 8 + orrs r1, r0 + movs r0, 0 + movs r2, 0 + bl sub_8034300 + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r4] + adds r0, 0x3 + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804DE14 + + thumb_func_start atk56_8025194 +atk56_8025194: @ 804DE50 + push {r4,r5,lr} + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + movs r0, 0 + bl dp01_build_cmdbuf_x2D_2D_2D_2D + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk56_8025194 + + thumb_func_start atk57_80251C4_flee +atk57_80251C4_flee: @ 804DE80 + push {r4,lr} + movs r0, 0 + bl battle_get_side_with_given_state + ldr r4, =0x02024064 + strb r0, [r4] + ldr r0, =0x0202433a + ldrb r1, [r0] + movs r0, 0 + bl dp01_build_cmdbuf_x37_a + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk57_80251C4_flee + + thumb_func_start atk58_cmd58 +atk58_cmd58: @ 804DEB8 + push {r4,r5,lr} + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + movs r0, 0 + movs r1, 0x1 + bl dp01_build_cmdbuf_x06_a + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk58_cmd58 + + thumb_func_start atk59_8025230 +atk59_8025230: @ 804DEEC + push {r4-r7,lr} + ldr r0, =0x02024214 + ldr r2, [r0] + ldrb r6, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r6, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r6, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r6, r0 + ldrb r4, [r2, 0x5] + ldrb r0, [r2, 0x6] + lsls r0, 8 + orrs r4, r0 + ldrb r0, [r2, 0x7] + lsls r0, 16 + orrs r4, r0 + ldrb r0, [r2, 0x8] + lsls r0, 24 + orrs r4, r0 + ldr r0, =0x0202449c + ldr r0, [r0] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldrb r1, [r2, 0x9] + bl sub_8069318 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =0x0000fffe + cmp r5, r0 + bne _0804DF56 + adds r7, r5, 0 +_0804DF3A: + ldr r0, =0x0202449c + ldr r0, [r0] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0 + bl sub_8069318 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r7 + beq _0804DF3A +_0804DF56: + cmp r5, 0 + bne _0804DF70 + ldr r0, =0x02024214 + str r4, [r0] + b _0804E018 + .pool +_0804DF70: + ldr r0, =0x0000ffff + cmp r5, r0 + bne _0804DF88 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0xA + str r0, [r1] + b _0804E018 + .pool +_0804DF88: + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, =0x02024064 + strb r0, [r1] + ldr r2, =0x0202406e + ldrb r3, [r1] + lsls r0, r3, 1 + adds r0, r2 + ldr r1, =0x0202449c + ldr r1, [r1] + ldrh r0, [r0] + ldrb r1, [r1, 0x10] + cmp r0, r1 + bne _0804DFC8 + ldr r4, =0x02024084 + movs r0, 0x58 + adds r2, r3, 0 + muls r2, r0 + adds r0, r4, 0 + adds r0, 0x50 + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _0804DFC8 + adds r0, r2, r4 + adds r1, r5, 0 + bl sub_80691B0 +_0804DFC8: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0804E014 + movs r0, 0x2 + bl battle_get_side_with_given_state + ldr r1, =0x02024064 + strb r0, [r1] + ldr r2, =0x0202406e + ldrb r3, [r1] + lsls r0, r3, 1 + adds r0, r2 + ldr r1, =0x0202449c + ldr r1, [r1] + ldrh r0, [r0] + ldrb r1, [r1, 0x10] + cmp r0, r1 + bne _0804E014 + ldr r4, =0x02024084 + movs r0, 0x58 + adds r2, r3, 0 + muls r2, r0 + adds r0, r4, 0 + adds r0, 0x50 + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _0804E014 + adds r0, r2, r4 + adds r1, r5, 0 + bl sub_80691B0 +_0804E014: + ldr r0, =0x02024214 + str r6, [r0] +_0804E018: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk59_8025230 + + thumb_func_start sub_804E038 +sub_804E038: @ 804E038 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + ldr r0, =0x02024064 + movs r1, 0 + strb r1, [r0] + ldr r0, =0x02024474 + ldrb r1, [r0, 0x1F] + adds r2, r0, 0 + cmp r1, 0x6 + bls _0804E052 + b _0804E3B8 +_0804E052: + lsls r0, r1, 2 + ldr r1, =_0804E068 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0804E068: + .4byte _0804E084 + .4byte _0804E0BC + .4byte _0804E162 + .4byte _0804E1B8 + .4byte _0804E1E4 + .4byte _0804E38C + .4byte _0804E3AC +_0804E084: + movs r4, 0 + str r4, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r0, =gUnknown_085CCABB + movs r1, 0xC + bl battle_show_message_maybe + ldr r1, =0x02024474 + ldrb r0, [r1, 0x1F] + adds r0, 0x1 + strb r0, [r1, 0x1F] + ldr r0, =0x02024332 + strb r4, [r0, 0x1] + movs r0, 0 + bl sub_8056B74 + b _0804E3B8 + .pool +_0804E0BC: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804E0E4 + ldr r4, =0x02024332 + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _0804E0E4 + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0 + strb r0, [r4, 0x1] + bl sub_8056B74 +_0804E0E4: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804E10C + ldr r4, =0x02024332 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _0804E10C + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0x1 + strb r0, [r4, 0x1] + bl sub_8056B74 +_0804E10C: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _0804E150 + movs r0, 0x5 + bl audio_play + ldr r0, =0x02024332 + ldrb r4, [r0, 0x1] + cmp r4, 0 + bne _0804E20A + str r5, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _0804E192 + .pool +_0804E150: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0804E15A + b _0804E3B8 +_0804E15A: + movs r0, 0x5 + bl audio_play + b _0804E20A +_0804E162: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804E170 + b _0804E3B8 +_0804E170: + bl FreeAllWindowBuffers + ldr r0, =0x020244ec + ldr r1, =0x0202449c + ldr r1, [r1] + ldrb r1, [r1, 0x10] + ldr r2, =0x020244e9 + ldrb r2, [r2] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldr r3, =sub_80A92F8 + ldr r4, =0x020244e2 + ldrh r4, [r4] + str r4, [sp] + bl sub_81BFA38 +_0804E192: + ldr r1, =0x02024474 + ldrb r0, [r1, 0x1F] + adds r0, 0x1 + strb r0, [r1, 0x1F] + b _0804E3B8 + .pool +_0804E1B8: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804E1C6 + b _0804E3B8 +_0804E1C6: + ldr r0, =0x030022c0 + ldr r1, [r0, 0x4] + ldr r0, =sub_8038420 + cmp r1, r0 + beq _0804E1D2 + b _0804E3B8 +_0804E1D2: + ldrb r0, [r2, 0x1F] + adds r0, 0x1 + b _0804E3B6 + .pool +_0804E1E4: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804E1F2 + b _0804E3B8 +_0804E1F2: + ldr r0, =0x030022c0 + ldr r1, [r0, 0x4] + ldr r0, =sub_8038420 + cmp r1, r0 + beq _0804E1FE + b _0804E3B8 +_0804E1FE: + bl sub_81C1B94 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bne _0804E224 +_0804E20A: + ldr r1, =0x02024474 + movs r0, 0x5 + strb r0, [r1, 0x1F] + b _0804E3B8 + .pool +_0804E224: + ldr r6, =0x0202449c + ldr r0, [r6] + ldrb r0, [r0, 0x10] + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r7, =0x020244ec + adds r0, r7 + adds r1, r5, 0 + adds r1, 0xD + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl sub_806E804 + cmp r0, 0 + beq _0804E274 + ldr r0, =0x0000013f + ldr r1, =0x02024064 + ldrb r1, [r1] + bl b_std_message + ldr r1, =0x02024474 + movs r0, 0x6 + strb r0, [r1, 0x1F] + b _0804E3B8 + .pool +_0804E274: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + ldr r1, =0x02022f68 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + strb r4, [r1, 0x2] + lsrs r0, r4, 8 + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r0, [r6] + ldrb r0, [r0, 0x10] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r7 + adds r1, r5, 0 + bl sub_806B9A8 + ldr r0, [r6] + ldrb r0, [r0, 0x10] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r7 + ldr r7, =0x020244e2 + ldrh r1, [r7] + adds r2, r5, 0 + bl sub_80691F4 + ldr r0, =0x0202406e + ldr r1, [r6] + ldrh r0, [r0] + ldrb r1, [r1, 0x10] + cmp r0, r1 + bne _0804E30A + ldr r4, =0x02024084 + ldr r0, [r4, 0x50] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _0804E30A + ldr r0, =0x020242bc + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gUnknown_0832A328 + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0804E30A + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_806B9E4 + ldrh r1, [r7] + adds r0, r4, 0 + adds r2, r5, 0 + bl sub_8069234 +_0804E30A: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0804E3B8 + ldr r2, =0x0202406e + ldr r0, =0x0202449c + ldr r1, [r0] + ldrh r0, [r2, 0x4] + ldrb r1, [r1, 0x10] + cmp r0, r1 + bne _0804E3B8 + ldr r4, =0x02024084 + movs r1, 0x80 + lsls r1, 1 + adds r0, r4, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _0804E3B8 + ldr r0, =0x020242bc + adds r0, 0x50 + ldrb r1, [r0] + lsrs r1, 4 + ldr r2, =gUnknown_0832A328 + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0804E3B8 + adds r4, 0xB0 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_806B9E4 + ldr r0, =0x020244e2 + ldrh r1, [r0] + adds r0, r4, 0 + adds r2, r5, 0 + bl sub_8069234 + b _0804E3B8 + .pool +_0804E38C: + movs r0, 0x1 + str r0, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _0804E3B8 + .pool +_0804E3AC: + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0804E3B8 + movs r0, 0x2 +_0804E3B6: + strb r0, [r2, 0x1F] +_0804E3B8: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804E038 + + thumb_func_start atk5B_80256E0 +atk5B_80256E0: @ 804E3C8 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, =0x02024474 + ldrb r4, [r5, 0x1F] + cmp r4, 0 + beq _0804E3E0 + cmp r4, 0x1 + beq _0804E410 + b _0804E4FA + .pool +_0804E3E0: + str r4, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r0, =gUnknown_085CCABB + movs r1, 0xC + bl battle_show_message_maybe + ldrb r0, [r5, 0x1F] + adds r0, 0x1 + strb r0, [r5, 0x1F] + ldr r0, =0x02024332 + strb r4, [r0, 0x1] + movs r0, 0 + bl sub_8056B74 + b _0804E4FA + .pool +_0804E410: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804E438 + ldr r4, =0x02024332 + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _0804E438 + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0 + strb r0, [r4, 0x1] + bl sub_8056B74 +_0804E438: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804E460 + ldr r4, =0x02024332 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _0804E460 + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0x1 + strb r0, [r4, 0x1] + bl sub_8056B74 +_0804E460: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r4, 0x1 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0804E4C4 + movs r0, 0x5 + bl audio_play + ldr r0, =0x02024332 + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _0804E4A4 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0804E4AC + .pool +_0804E4A4: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0804E4AC: + movs r0, 0x1 + str r0, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + b _0804E4FA + .pool +_0804E4C4: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0804E4FA + movs r0, 0x5 + bl audio_play + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + str r4, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C +_0804E4FA: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk5B_80256E0 + + thumb_func_start atk5C_cmd5c +atk5C_cmd5c: @ 804E508 + push {r4,lr} + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r2, =0x02024064 + strb r0, [r2] + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _0804E58C + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 1 + ands r0, r1 + cmp r0, 0 + beq _0804E55A + ldr r1, =0x02024084 + ldrb r2, [r2] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _0804E55A + ldr r0, =0x020242bc + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + cmp r0, 0 + bne _0804E58C +_0804E55A: + movs r0, 0 + bl dp01_build_cmdbuf_x29_29_29_29 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + b _0804E592 + .pool +_0804E58C: + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] +_0804E592: + pop {r4} + pop {r0} + bx r0 + thumb_func_end atk5C_cmd5c + + thumb_func_start sub_804E598 +sub_804E598: @ 804E598 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r6, r0, 16 + movs r7, 0 + movs r5, 0 + movs r0, 0x80 + lsls r0, 3 + cmp r6, r0 + bne _0804E5D8 + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0] + adds r0, 0x94 + ldrb r2, [r0] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x4A + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + muls r0, r2 + b _0804E6CA + .pool +_0804E5D8: + ldr r0, =gTrainers + lsls r2, r6, 2 + adds r1, r2, r6 + lsls r1, 3 + adds r4, r1, r0 + ldrb r3, [r4] + mov r12, r0 + cmp r3, 0x1 + beq _0804E62E + cmp r3, 0x1 + bgt _0804E5F8 + cmp r3, 0 + beq _0804E602 + b _0804E644 + .pool +_0804E5F8: + cmp r3, 0x2 + beq _0804E618 + cmp r3, 0x3 + beq _0804E62E + b _0804E644 +_0804E602: + mov r0, r12 + adds r0, 0x24 + adds r0, r1, r0 + ldr r1, [r0] + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + lsls r0, 3 + adds r0, r1 + subs r0, 0x8 + b _0804E642 +_0804E618: + mov r0, r12 + adds r0, 0x24 + adds r0, r1, r0 + ldr r1, [r0] + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + lsls r0, 3 + adds r0, r1 + subs r0, 0x8 + b _0804E642 +_0804E62E: + mov r0, r12 + adds r0, 0x24 + adds r0, r1, r0 + ldr r1, [r0] + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + subs r0, 0x10 +_0804E642: + ldrb r5, [r0, 0x2] +_0804E644: + ldr r1, =gUnknown_0831AEB8 + lsls r0, r7, 2 + adds r4, r0, r1 + ldrb r3, [r4] + ldr r0, =0x0202449c + mov r8, r0 + mov r9, r1 + ldr r1, =0x02022fec + mov r10, r1 + cmp r3, 0xFF + beq _0804E67A + adds r0, r2, r6 + lsls r0, 3 + add r0, r12 + ldrb r1, [r0, 0x1] + cmp r3, r1 + beq _0804E67A + adds r2, r0, 0 + adds r0, r4, 0 +_0804E66A: + adds r0, 0x4 + adds r7, 0x1 + ldrb r1, [r0] + cmp r1, 0xFF + beq _0804E67A + ldrb r3, [r2, 0x1] + cmp r1, r3 + bne _0804E66A +_0804E67A: + mov r0, r10 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + bne _0804E6B4 + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0804E6B4 + mov r3, r8 + ldr r0, [r3] + adds r0, 0x4A + ldrb r0, [r0] + lsls r0, 2 + adds r1, r5, 0 + muls r1, r0 + lsls r0, r7, 2 + add r0, r9 + ldrb r0, [r0, 0x1] + lsls r0, 1 + b _0804E6C8 + .pool +_0804E6B4: + mov r1, r8 + ldr r0, [r1] + adds r0, 0x4A + ldrb r0, [r0] + lsls r0, 2 + adds r1, r5, 0 + muls r1, r0 + lsls r0, r7, 2 + add r0, r9 + ldrb r0, [r0, 0x1] +_0804E6C8: + muls r0, r1 +_0804E6CA: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_804E598 + + thumb_func_start sub_804E6D8 +sub_804E6D8: @ 804E6D8 + push {r4,lr} + ldr r0, =0x02038bca + ldrh r0, [r0] + bl sub_804E598 + adds r4, r0, 0 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0804E6FC + ldr r0, =0x02038bcc + ldrh r0, [r0] + bl sub_804E598 + adds r4, r0 +_0804E6FC: + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + adds r1, r4, 0 + bl add_money + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x1 + strb r0, [r1, 0x1] + movs r0, 0x4 + strb r0, [r1, 0x2] + movs r0, 0x5 + strb r0, [r1, 0x3] + strb r4, [r1, 0x4] + movs r0, 0xFF + lsls r0, 8 + ands r0, r4 + lsrs r0, 8 + strb r0, [r1, 0x5] + movs r0, 0xFF + lsls r0, 16 + ands r0, r4 + lsrs r0, 16 + strb r0, [r1, 0x6] + lsrs r0, r4, 24 + strb r0, [r1, 0x7] + movs r0, 0xFF + strb r0, [r1, 0x8] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804E6D8 + + thumb_func_start atk5E_8025A70 +atk5E_8025A70: @ 804E764 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r6, =0x02024064 + strb r0, [r6] + ldr r5, =0x02024332 + ldrb r0, [r5] + mov r8, r4 + cmp r0, 0 + beq _0804E794 + cmp r0, 0x1 + beq _0804E7AC + b _0804E800 + .pool +_0804E794: + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl dp01_build_cmdbuf_x00_a_b_0 + ldrb r0, [r6] + bl dp01_battle_side_mark_buffer_for_execution + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + b _0804E800 +_0804E7AC: + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0804E800 + ldrb r0, [r6] + lsls r0, 9 + ldr r1, =0x02023868 + adds r0, r1 + mov r12, r0 + movs r2, 0 + adds r4, r6, 0 + movs r5, 0x58 + ldr r6, =0x020240a8 + adds r7, r6, 0 + subs r7, 0x18 + mov r3, r12 + adds r3, 0xC +_0804E7CE: + lsls r1, r2, 1 + ldrb r0, [r4] + muls r0, r5 + adds r1, r0 + adds r1, r7 + ldrh r0, [r3] + strh r0, [r1] + ldrb r0, [r4] + adds r1, r0, 0 + muls r1, r5 + adds r1, r2, r1 + adds r1, r6 + mov r0, r12 + adds r0, 0x24 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r3, 0x2 + adds r2, 0x1 + cmp r2, 0x3 + ble _0804E7CE + mov r1, r8 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_0804E800: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk5E_8025A70 + + thumb_func_start atk5F_8025B24 +atk5F_8025B24: @ 804E818 + push {lr} + ldr r0, =0x02024064 + ldr r2, =0x0202420b + ldrb r3, [r2] + strb r3, [r0] + ldr r1, =0x0202420c + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + ldr r2, =0x02024280 + ldr r1, [r2] + movs r3, 0x80 + lsls r3, 5 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + beq _0804E854 + ldr r0, =0xffffefff + ands r1, r0 + b _0804E856 + .pool +_0804E854: + orrs r1, r3 +_0804E856: + str r1, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atk5F_8025B24 + + thumb_func_start atk60_cmd60 +atk60_cmd60: @ 804E868 + push {lr} + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0804E882 + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl sav12_xor_increment +_0804E882: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atk60_cmd60 + + thumb_func_start atk61_8025BA4 +atk61_8025BA4: @ 804E898 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x30 + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0804E94C + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r1, =0x02024064 + strb r0, [r1] + ldrb r0, [r1] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x02024744 + mov r8, r1 + cmp r0, 0 + bne _0804E8CA + ldr r0, =0x020244ec + mov r8, r0 +_0804E8CA: + movs r7, 0 + add r6, sp, 0x4 + mov r5, sp +_0804E8D0: + movs r0, 0x64 + muls r0, r7 + mov r1, r8 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _0804E8F4 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _0804E914 +_0804E8F4: + ldr r0, =0x0000ffff + strh r0, [r5] + movs r0, 0 + b _0804E926 + .pool +_0804E914: + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + strh r0, [r5] + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr +_0804E926: + str r0, [r6] + adds r6, 0x8 + adds r5, 0x8 + adds r7, 0x1 + cmp r7, 0x5 + ble _0804E8D0 + movs r0, 0 + mov r1, sp + movs r2, 0x1 + bl dp01_build_cmdbuf_x30_TODO + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_0804E94C: + add sp, 0x30 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk61_8025BA4 + + thumb_func_start atk62_08025C6C +atk62_08025C6C: @ 804E960 + push {r4,r5,lr} + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + movs r0, 0 + bl dp01_build_cmdbuf_x31_31_31_31 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk62_08025C6C + + thumb_func_start atk63_jumptoattack +atk63_jumptoattack: @ 804E990 + push {r4,lr} + ldr r0, =0x02024214 + ldr r1, [r0] + ldrb r1, [r1, 0x1] + adds r4, r0, 0 + cmp r1, 0 + beq _0804E9B4 + ldr r0, =0x020241ea + ldr r1, =0x020241ee + ldrh r1, [r1] + strh r1, [r0] + b _0804E9C2 + .pool +_0804E9B4: + ldr r2, =0x020241ec + ldr r1, =0x020241ea + ldr r0, =0x020241ee + ldrh r0, [r0] + strh r0, [r1] + strh r0, [r2] + adds r0, r1, 0 +_0804E9C2: + ldr r3, =gUnknown_082D86A8 + ldr r2, =gBattleMoves + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk63_jumptoattack + + thumb_func_start atk64_statusanimation +atk64_statusanimation: @ 804E9F4 + push {r4,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0804EA5C + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + ldr r1, =0x020242ac + ldrb r2, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x000400c0 + ands r0, r1 + cmp r0, 0 + bne _0804EA54 + ldr r0, =0x020242bc + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + cmp r0, 0 + bne _0804EA54 + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0804EA54 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r2 + adds r1, 0x4C + adds r0, r1 + ldr r2, [r0] + movs r0, 0 + movs r1, 0 + bl dp01_build_cmdbuf_x1B_aaaa_b + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_0804EA54: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_0804EA5C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk64_statusanimation + + thumb_func_start atk65_8025D90 +atk65_8025D90: @ 804EA84 + push {r4,r5,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0804EB04 + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r5, =0x02024064 + strb r0, [r5] + ldr r1, [r4] + ldrb r3, [r1, 0x2] + ldrb r0, [r1, 0x3] + lsls r0, 8 + orrs r3, r0 + ldrb r0, [r1, 0x4] + lsls r0, 16 + orrs r3, r0 + ldrb r0, [r1, 0x5] + lsls r0, 24 + orrs r3, r0 + ldr r1, =0x020242ac + ldrb r2, [r5] + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x000400c0 + ands r0, r1 + cmp r0, 0 + bne _0804EAFC + ldr r0, =0x020242bc + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + cmp r0, 0 + bne _0804EAFC + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0804EAFC + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r2, [r0] + ands r2, r3 + movs r0, 0 + movs r1, 0x1 + bl dp01_build_cmdbuf_x1B_aaaa_b + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution +_0804EAFC: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x6 + str r0, [r1] +_0804EB04: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk65_8025D90 + + thumb_func_start atk66_8025E38 +atk66_8025E38: @ 804EB2C + push {r4,r5,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _0804EB9E + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r5, =0x02024064 + strb r0, [r5] + ldr r4, [r4] + ldrb r2, [r4, 0x3] + ldrb r0, [r4, 0x4] + lsls r0, 8 + orrs r2, r0 + ldrb r0, [r4, 0x5] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r4, 0x6] + lsls r0, 24 + orrs r2, r0 + ldr r1, =0x020242ac + ldrb r3, [r5] + lsls r0, r3, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x000400c0 + ands r0, r1 + cmp r0, 0 + bne _0804EB96 + ldr r0, =0x020242bc + lsls r1, r3, 3 + subs r1, r3 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + cmp r0, 0 + bne _0804EB96 + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0804EB96 + ldrb r1, [r4, 0x2] + movs r0, 0 + bl dp01_build_cmdbuf_x1B_aaaa_b + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution +_0804EB96: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x7 + str r0, [r1] +_0804EB9E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk66_8025E38 + + thumb_func_start atk67_8025ECC +atk67_8025ECC: @ 804EBC0 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, =0x02024332 + ldrb r4, [r5] + cmp r4, 0 + beq _0804EBD8 + cmp r4, 0x1 + beq _0804EC04 + b _0804EC96 + .pool +_0804EBD8: + str r4, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r0, =gUnknown_085CCABB + movs r1, 0xC + bl battle_show_message_maybe + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + strb r4, [r5, 0x1] + movs r0, 0 + bl sub_8056B74 + b _0804EC96 + .pool +_0804EC04: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0804EC2A + ldrb r0, [r5, 0x1] + cmp r0, 0 + beq _0804EC2A + movs r0, 0x5 + bl audio_play + ldrb r0, [r5, 0x1] + bl sub_8056BAC + movs r0, 0 + strb r0, [r5, 0x1] + bl sub_8056B74 +_0804EC2A: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0804EC52 + ldr r4, =0x02024332 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _0804EC52 + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0x1 + strb r0, [r4, 0x1] + bl sub_8056B74 +_0804EC52: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0804EC70 + ldr r0, =0x02024332 + movs r4, 0x1 + strb r4, [r0, 0x1] + b _0804EC7A + .pool +_0804EC70: + movs r4, 0x1 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0804EC96 +_0804EC7A: + movs r0, 0x5 + bl audio_play + str r4, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_0804EC96: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk67_8025ECC + + thumb_func_start sub_804ECA4 +sub_804ECA4: @ 804ECA4 + push {r4,r5,lr} + movs r1, 0 + ldr r2, =0x0202406c + ldr r5, =0x02024214 + ldrb r0, [r2] + cmp r1, r0 + bge _0804ECC2 + ldr r4, =0x0202407a + movs r3, 0xC +_0804ECB6: + adds r0, r1, r4 + strb r3, [r0] + adds r1, 0x1 + ldrb r0, [r2] + cmp r1, r0 + blt _0804ECB6 +_0804ECC2: + ldr r0, [r5] + adds r0, 0x1 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804ECA4 + + thumb_func_start atk69_8025FE0 +atk69_8025FE0: @ 804ECDC + push {r4-r7,lr} + ldr r7, =0x02024084 + ldr r6, =0x0202420c + ldrb r2, [r6] + movs r5, 0x58 + adds r0, r2, 0 + muls r0, r5 + adds r1, r0, r7 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _0804ED10 + ldr r1, =0x02024404 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r4, [r0, 0x7] + ldrb r6, [r0, 0x1A] + b _0804ED2A + .pool +_0804ED10: + ldrh r0, [r1, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r0, [r6] + muls r0, r5 + adds r0, r7 + ldrh r0, [r0, 0x2E] + bl itemid_get_quality + lsls r0, 24 + lsrs r6, r0, 24 +_0804ED2A: + ldr r1, =0x0202420f + ldr r5, =0x0202420c + ldrb r0, [r5] + strb r0, [r1] + cmp r4, 0x27 + bne _0804ED68 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r6 + bcs _0804ED68 + ldrb r0, [r5] + movs r1, 0x27 + bl b_history__record_item_x12_of_player + ldr r2, =0x0202437c + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] +_0804ED68: + ldr r2, =0x02024084 + ldr r3, =0x0202420c + ldrb r4, [r3] + movs r0, 0x58 + muls r0, r4 + adds r1, r2, 0 + adds r1, 0x50 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 17 + ands r1, r0 + adds r5, r2, 0 + cmp r1, 0 + bne _0804EE38 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x65 + beq _0804EDBA + ldr r0, =0x0202433c + lsls r1, r4, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 30 + cmp r0, 0 + blt _0804EDBA + ldr r0, =0x0202437c + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + lsrs r0, 7 + cmp r0, 0 + beq _0804EE38 +_0804EDBA: + ldrb r0, [r3] + movs r4, 0x58 + muls r0, r4 + adds r0, r5 + ldrh r1, [r0, 0x28] + ldr r2, =0x020241f0 + ldr r0, [r2] + cmp r1, r0 + bgt _0804EE38 + subs r0, r1, 0x1 + str r0, [r2] + ldr r1, =0x0202433c + ldrb r3, [r3] + lsls r0, r3, 4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + cmp r0, 0 + bge _0804EE10 + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + b _0804EE38 + .pool +_0804EE10: + ldr r0, =0x0202437c + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + lsrs r0, 7 + cmp r0, 0 + beq _0804EE38 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024208 + adds r0, r3, 0 + muls r0, r4 + adds r0, r5 + ldrh r0, [r0, 0x2E] + strh r0, [r1] +_0804EE38: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk69_8025FE0 + + thumb_func_start atk6A_stash_item_for_side +atk6A_stash_item_for_side: @ 804EE58 + push {r4-r6,lr} + sub sp, 0x4 + ldr r6, =0x02024214 + ldr r0, [r6] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r5, =0x02024064 + strb r0, [r5] + ldr r1, =0x0202449c + ldrb r4, [r5] + lsls r0, r4, 1 + adds r0, 0xB8 + ldr r1, [r1] + adds r1, r0 + ldr r2, =0x02024084 + movs r3, 0x58 + adds r0, r4, 0 + muls r0, r3 + adds r0, r2 + ldrh r0, [r0, 0x2E] + strh r0, [r1] + ldrb r0, [r5] + muls r0, r3 + adds r0, r2 + movs r1, 0 + strh r1, [r0, 0x2E] + ldrb r0, [r5] + muls r0, r3 + adds r2, 0x2E + adds r0, r2 + str r0, [sp] + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + movs r3, 0x2 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r6] + adds r0, 0x2 + str r0, [r6] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atk6A_stash_item_for_side + + thumb_func_start atk6B_end_battle_80261CC +atk6B_end_battle_80261CC: @ 804EEC8 + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x7 + strb r0, [r1, 0x1] + ldr r2, =0x0202420b + ldrb r0, [r2] + strb r0, [r1, 0x2] + ldr r3, =0x0202406e + ldrb r0, [r2] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end atk6B_end_battle_80261CC + + thumb_func_start atk6C_8026208 +atk6C_8026208: @ 804EF04 + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x02024474 + ldrb r1, [r0, 0x1E] + adds r4, r0, 0 + cmp r1, 0 + bne _0804EF28 + bl sub_804F498 + cmp r0, 0 + beq _0804EF24 + movs r0, 0x3 + b _0804EF26 + .pool +_0804EF24: + movs r0, 0x1 +_0804EF26: + strb r0, [r4, 0x1E] +_0804EF28: + ldrb r0, [r4, 0x1E] + subs r0, 0x1 + cmp r0, 0x9 + bls _0804EF32 + b _0804F0F2 +_0804EF32: + lsls r0, 2 + ldr r1, =_0804EF40 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0804EF40: + .4byte _0804EF68 + .4byte _0804EF94 + .4byte _0804EFAC + .4byte _0804F000 + .4byte _0804F014 + .4byte _0804F02C + .4byte _0804F014 + .4byte _0804F04C + .4byte _0804F07C + .4byte _0804F0C0 +_0804EF68: + ldr r1, =0x02022e1e + movs r0, 0x60 + strh r0, [r1] + movs r0, 0x2 + movs r1, 0x7 + movs r2, 0 + bl SetBgAttribute + movs r0, 0x2 + bl ShowBg + bl sub_804F17C + ldr r1, =0x02024474 + movs r0, 0x2 + strb r0, [r1, 0x1E] + b _0804F0F2 + .pool +_0804EF94: + bl sub_804F1CC + lsls r0, 24 + cmp r0, 0 + beq _0804EFA0 + b _0804F0F2 +_0804EFA0: + ldr r1, =0x02024474 + movs r0, 0x3 + strb r0, [r1, 0x1E] + b _0804F0F2 + .pool +_0804EFAC: + ldr r1, =0x02022e18 + movs r0, 0 + strh r0, [r1] + ldr r1, =0x02022e1a + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + movs r0, 0 + movs r1, 0x7 + movs r2, 0x1 + bl SetBgAttribute + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0 + bl SetBgAttribute + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x80 + str r0, [sp] + movs r0, 0x12 + movs r1, 0x7 + movs r2, 0x1D + movs r3, 0x13 + bl sub_8056A3C + ldr r1, =0x02024474 + movs r0, 0x4 + strb r0, [r1, 0x1E] + b _0804F0F2 + .pool +_0804F000: + bl sub_804F100 + movs r0, 0xD + bl PutWindowTilemap + movs r0, 0xD + movs r1, 0x3 + bl CopyWindowToVram + b _0804F06A +_0804F014: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0804F0F2 + ldr r0, =0x02022e1a + strh r1, [r0] + b _0804F06A + .pool +_0804F02C: + ldr r0, =0x030022c0 + ldrh r0, [r0, 0x2E] + cmp r0, 0 + beq _0804F0F2 + movs r0, 0x5 + bl audio_play + bl sub_804F144 + movs r0, 0xD + movs r1, 0x2 + bl CopyWindowToVram + b _0804F06A + .pool +_0804F04C: + ldr r0, =0x030022c0 + ldrh r0, [r0, 0x2E] + cmp r0, 0 + beq _0804F0F2 + movs r0, 0x5 + bl audio_play + movs r0, 0x81 + str r0, [sp] + movs r0, 0x12 + movs r1, 0x7 + movs r2, 0x1D + movs r3, 0x13 + bl sub_8056A3C +_0804F06A: + ldr r1, =0x02024474 + ldrb r0, [r1, 0x1E] + adds r0, 0x1 + strb r0, [r1, 0x1E] + b _0804F0F2 + .pool +_0804F07C: + bl sub_804F344 + lsls r0, 24 + cmp r0, 0 + bne _0804F0F2 + movs r0, 0xE + bl ClearWindowTilemap + movs r0, 0xE + movs r1, 0x1 + bl CopyWindowToVram + movs r0, 0xD + bl ClearWindowTilemap + movs r0, 0xD + movs r1, 0x1 + bl CopyWindowToVram + movs r0, 0x2 + movs r1, 0x7 + movs r2, 0x2 + bl SetBgAttribute + movs r0, 0x2 + bl ShowBg + ldr r1, =0x02024474 + movs r0, 0xA + strb r0, [r1, 0x1E] + b _0804F0F2 + .pool +_0804F0C0: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _0804F0F2 + movs r0, 0 + movs r1, 0x7 + movs r2, 0 + bl SetBgAttribute + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x1 + bl SetBgAttribute + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_0804F0F2: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk6C_8026208 + + thumb_func_start sub_804F100 +sub_804F100: @ 804F100 + push {lr} + sub sp, 0x14 + ldr r0, =0x0202449c + ldr r0, [r0] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + add r1, sp, 0x8 + bl sub_81D388C + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r1, [r0, 0x10] + movs r0, 0xD + str r0, [sp] + movs r0, 0xF + str r0, [sp, 0x4] + movs r0, 0xD + add r2, sp, 0x8 + movs r3, 0xE + bl sub_81D3640 + add sp, 0x14 + pop {r0} + bx r0 + .pool + thumb_func_end sub_804F100 + + thumb_func_start sub_804F144 +sub_804F144: @ 804F144 + push {lr} + sub sp, 0x10 + ldr r0, =0x0202449c + ldr r0, [r0] + ldrb r1, [r0, 0x10] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + add r1, sp, 0x4 + bl sub_81D388C + movs r0, 0xF + str r0, [sp] + movs r0, 0xD + add r1, sp, 0x4 + movs r2, 0xE + movs r3, 0xD + bl sub_81D3784 + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end sub_804F144 + + thumb_func_start sub_804F17C +sub_804F17C: @ 804F17C + push {lr} + ldr r1, =0x02022e1e + movs r0, 0 + strh r0, [r1] + ldr r1, =0x02022e1c + movs r2, 0xD0 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, =gUnknown_0831C2C8 + movs r1, 0x60 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =gUnknown_0831C2E8 + movs r0, 0xE + movs r2, 0 + movs r3, 0 + bl CopyToWindowPixelBuffer + movs r0, 0xE + bl PutWindowTilemap + movs r0, 0xE + movs r1, 0x3 + bl CopyWindowToVram + bl sub_804F384 + pop {r0} + bx r0 + .pool + thumb_func_end sub_804F17C + + thumb_func_start sub_804F1CC +sub_804F1CC: @ 804F1CC + push {r4,r5,lr} + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _0804F1DC + movs r0, 0x1 + b _0804F216 +_0804F1DC: + ldr r4, =0x02022e1c + ldrh r1, [r4] + movs r5, 0x80 + lsls r5, 2 + cmp r1, r5 + bne _0804F1F0 + movs r0, 0 + b _0804F216 + .pool +_0804F1F0: + movs r0, 0xD0 + lsls r0, 1 + cmp r1, r0 + bne _0804F1FC + bl sub_804F220 +_0804F1FC: + ldrh r0, [r4] + adds r0, 0x8 + strh r0, [r4] + lsls r0, 16 + ldr r1, =0x01ff0000 + cmp r0, r1 + bls _0804F20C + strh r5, [r4] +_0804F20C: + ldrh r1, [r4] + eors r1, r5 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 +_0804F216: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_804F1CC + + thumb_func_start sub_804F220 +sub_804F220: @ 804F220 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + ldr r6, =0x0202449c + ldr r0, [r6] + ldrb r0, [r0, 0x10] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + movs r1, 0x38 + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, [r6] + ldrb r0, [r0, 0x10] + muls r0, r5 + adds r0, r4 + bl pokemon_get_gender + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, [r6] + ldrb r0, [r0, 0x10] + muls r0, r5 + adds r0, r4 + ldr r5, =0x02021fc4 + adds r1, r5, 0 + bl GetMonNickname + str r5, [sp] + mov r2, sp + movs r1, 0 + movs r0, 0xE + strb r0, [r2, 0x4] + mov r0, sp + strb r1, [r0, 0x5] + movs r4, 0x20 + strb r4, [r0, 0x6] + strb r1, [r0, 0x7] + strb r4, [r0, 0x8] + strb r1, [r0, 0x9] + strb r1, [r0, 0xA] + strb r1, [r0, 0xB] + mov r3, sp + ldrb r2, [r3, 0xC] + subs r1, 0x10 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3, 0xC] + mov r2, sp + movs r0, 0x10 + strb r0, [r2, 0xC] + ldrb r0, [r2, 0xD] + ands r1, r0 + strb r1, [r2, 0xD] + mov r0, sp + strb r4, [r0, 0xD] + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + movs r0, 0xF9 + strb r0, [r5] + adds r5, 0x1 + movs r0, 0x5 + strb r0, [r5] + adds r5, 0x1 + adds r4, r5, 0 + adds r0, r4, 0 + mov r1, r8 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r5, r0, 0 + subs r4, r5, r4 + movs r2, 0x4 + subs r2, r4 + lsls r2, 16 + lsrs r2, 16 + movs r1, 0x77 + bl RepeatChar + adds r5, r0, 0 + cmp r7, 0xFF + beq _0804F320 + cmp r7, 0 + bne _0804F300 + movs r1, 0 + movs r2, 0xC + bl WriteColorChangeControlCode + adds r5, r0, 0 + movs r1, 0x1 + movs r2, 0xD + bl WriteColorChangeControlCode + adds r5, r0, 0 + movs r0, 0xB5 + b _0804F318 + .pool +_0804F300: + adds r0, r5, 0 + movs r1, 0 + movs r2, 0xE + bl WriteColorChangeControlCode + adds r5, r0, 0 + movs r1, 0x1 + movs r2, 0xF + bl WriteColorChangeControlCode + adds r5, r0, 0 + movs r0, 0xB6 +_0804F318: + strb r0, [r5] + adds r5, 0x1 + movs r0, 0xFF + strb r0, [r5] +_0804F320: + mov r0, sp + movs r1, 0xA + strb r1, [r0, 0x7] + strb r1, [r0, 0x9] + movs r1, 0xFF + movs r2, 0 + bl AddTextPrinter + movs r0, 0xE + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804F220 + + thumb_func_start sub_804F344 +sub_804F344: @ 804F344 + push {lr} + ldr r0, =0x02022e1c + ldrh r1, [r0] + movs r3, 0xD0 + lsls r3, 1 + adds r2, r0, 0 + cmp r1, r3 + bne _0804F35C + movs r0, 0 + b _0804F380 + .pool +_0804F35C: + ldrh r0, [r2] + adds r1, r0, 0 + subs r1, 0x10 + ldr r0, =0x0000019f + cmp r1, r0 + bgt _0804F370 + strh r3, [r2] + b _0804F372 + .pool +_0804F370: + strh r1, [r2] +_0804F372: + ldrh r1, [r2] + movs r0, 0xD0 + lsls r0, 1 + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 +_0804F380: + pop {r1} + bx r1 + thumb_func_end sub_804F344 + + thumb_func_start sub_804F384 +sub_804F384: @ 804F384 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x10 + ldr r0, =0x0202449c + mov r8, r0 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + movs r1, 0xB + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r1, r8 + ldr r0, [r1] + ldrb r0, [r0, 0x10] + muls r0, r6 + adds r0, r5 + movs r1, 0 + bl pokemon_getattr + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_80D2EDC + str r0, [sp] + ldr r5, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r5 + movs r1, 0x80 + lsls r1, 2 + orrs r0, r1 + ldr r1, =0x0000ffff + ands r0, r1 + ldr r1, =0xd75a0000 + orrs r0, r1 + str r0, [sp, 0x4] + adds r0, r4, 0 + bl sub_80D30B0 + str r0, [sp, 0x8] + add r4, sp, 0x8 + ldr r0, [r4, 0x4] + ands r0, r5 + ldr r1, =0x0000d75a + orrs r0, r1 + str r0, [r4, 0x4] + mov r0, sp + bl LoadObjectPic + adds r0, r4, 0 + bl LoadTaggedObjectPalette + ldr r0, =gUnknown_0831C3C0 + movs r1, 0x80 + lsls r1, 1 + movs r2, 0xA + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x2E] + ldr r0, =0x02022e1c + ldrh r0, [r0] + strh r0, [r1, 0x30] + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804F384 + + thumb_func_start sub_804F450 +sub_804F450: @ 804F450 + push {r4,lr} + adds r2, r0, 0 + ldr r0, =0x02022e1c + ldrh r1, [r2, 0x30] + ldrh r0, [r0] + subs r1, r0 + strh r1, [r2, 0x24] + lsls r1, 16 + cmp r1, 0 + beq _0804F470 + movs r0, 0x1 + strh r0, [r2, 0x2E] + b _0804F48C + .pool +_0804F470: + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0804F48C + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles + ldr r4, =0x0000d75a + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag +_0804F48C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804F450 + + thumb_func_start sub_804F498 +sub_804F498: @ 804F498 + push {lr} + ldr r3, =0x0202406e + ldr r0, =0x0202449c + ldr r0, [r0] + ldrh r1, [r3] + ldrb r2, [r0, 0x10] + cmp r1, r2 + beq _0804F4BA + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0804F4CC + ldrh r0, [r3, 0x4] + cmp r0, r2 + bne _0804F4CC +_0804F4BA: + movs r0, 0x1 + b _0804F4CE + .pool +_0804F4CC: + movs r0, 0 +_0804F4CE: + pop {r1} + bx r1 + thumb_func_end sub_804F498 + + thumb_func_start sub_804F4D4 +sub_804F4D4: @ 804F4D4 + push {lr} + bl sub_803F988 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_804F4D4 + + thumb_func_start atk6E_state0_side_becomes_attacker +atk6E_state0_side_becomes_attacker: @ 804F4EC + push {lr} + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, =0x0202420b + strb r0, [r1] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atk6E_state0_side_becomes_attacker + + thumb_func_start atk6F_8026810 +atk6F_8026810: @ 804F50C + push {r4,r5,lr} + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + movs r0, 0 + movs r1, 0 + bl dp01_build_cmdbuf_x33_a_33_33 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk6F_8026810 + + thumb_func_start atk70_record_ability_usage_of_side +atk70_record_ability_usage_of_side: @ 804F540 + push {r4,lr} + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r1, =0x02024064 + strb r0, [r1] + ldrb r0, [r1] + ldr r1, =0x0202420a + ldrb r1, [r1] + bl b_history__record_ability_usage_of_player + ldr r0, [r4] + adds r0, 0x1 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk70_record_ability_usage_of_side + + thumb_func_start sub_804F574 +sub_804F574: @ 804F574 + ldr r2, =0x02022f68 + movs r0, 0xFD + strb r0, [r2] + movs r0, 0x2 + strb r0, [r2, 0x1] + ldr r0, =0x020244e2 + ldrh r1, [r0] + strb r1, [r2, 0x2] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + lsrs r0, 8 + strb r0, [r2, 0x3] + movs r0, 0xFF + strb r0, [r2, 0x4] + bx lr + .pool + thumb_func_end sub_804F574 + + thumb_func_start atk71_80268A0 +atk71_80268A0: @ 804F59C + push {lr} + bl sub_804F574 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atk71_80268A0 + + thumb_func_start atk72_flee +atk72_flee: @ 804F5B4 + push {lr} + ldr r0, =0x0202420d + ldrb r0, [r0] + bl sub_803EC20 + lsls r0, 24 + cmp r0, 0 + beq _0804F5E8 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0804F5F0 + .pool +_0804F5E8: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0804F5F0: + pop {r0} + bx r0 + .pool + thumb_func_end atk72_flee + + thumb_func_start atk73_cmd73 +atk73_cmd73: @ 804F5F8 + push {r4-r6,lr} + ldr r0, =0x02022fec + ldr r4, [r0] + movs r6, 0x1 + ands r4, r6 + cmp r4, 0 + bne _0804F68E + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r1, =0x02024064 + strb r0, [r1] + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02024084 + movs r1, 0x58 + muls r1, r0 + adds r1, r2 + ldrh r5, [r1, 0x28] + movs r0, 0x64 + muls r0, r5 + ldrh r1, [r1, 0x2C] + bl __divsi3 + cmp r0, 0 + bne _0804F636 + movs r0, 0x1 +_0804F636: + cmp r0, 0x45 + bgt _0804F63E + cmp r5, 0 + bne _0804F65C +_0804F63E: + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0xB1 + strb r4, [r0] + b _0804F68E + .pool +_0804F65C: + cmp r0, 0x27 + ble _0804F670 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0xB1 + strb r6, [r0] + b _0804F68E + .pool +_0804F670: + cmp r0, 0x9 + ble _0804F684 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0xB1 + movs r1, 0x2 + b _0804F68C + .pool +_0804F684: + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0xB1 + movs r1, 0x3 +_0804F68C: + strb r1, [r0] +_0804F68E: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atk73_cmd73 + + thumb_func_start atk74_hp_tresholds_2 +atk74_hp_tresholds_2: @ 804F6A4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x02022fec + ldr r7, [r0] + movs r0, 0x1 + mov r8, r0 + ands r7, r0 + cmp r7, 0 + bne _0804F73E + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + adds r4, r0, 0 + ldr r0, =0x02024064 + strb r4, [r0] + movs r0, 0x1 + eors r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x0202449c + ldr r6, [r1] + lsrs r0, 23 + adds r0, r6 + adds r0, 0xA8 + ldrb r5, [r0] + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r4 + adds r0, r1 + ldrh r4, [r0, 0x28] + subs r1, r5, r4 + movs r0, 0x64 + muls r0, r1 + adds r1, r5, 0 + bl __divsi3 + adds r1, r0, 0 + cmp r4, r5 + bcc _0804F71C + adds r0, r6, 0 + adds r0, 0xB1 + strb r7, [r0] + b _0804F73E + .pool +_0804F71C: + cmp r0, 0x1D + bgt _0804F72A + adds r0, r6, 0 + adds r0, 0xB1 + mov r1, r8 + strb r1, [r0] + b _0804F73E +_0804F72A: + cmp r1, 0x45 + bgt _0804F736 + adds r1, r6, 0 + adds r1, 0xB1 + movs r0, 0x2 + b _0804F73C +_0804F736: + adds r1, r6, 0 + adds r1, 0xB1 + movs r0, 0x3 +_0804F73C: + strb r0, [r1] +_0804F73E: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk74_hp_tresholds_2 + + thumb_func_start atk75_8026A58 +atk75_8026A58: @ 804F754 + push {lr} + sub sp, 0x4 + ldr r2, =0x020244b8 + ldr r1, =0x0202420b + ldrb r0, [r1] + strb r0, [r2] + ldr r2, =0x0202406e + ldrb r0, [r1] + lsls r0, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r1, =0x02024744 + adds r0, r1 + ldr r1, =0x02024208 + ldrh r1, [r1] + lsls r2, 24 + lsrs r2, 24 + movs r3, 0x1 + str r3, [sp] + movs r3, 0 + bl ExecuteTableBasedItemEffect + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end atk75_8026A58 + + thumb_func_start sub_804F7AC +sub_804F7AC: @ 804F7AC + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r1, =0x02024064 + strb r0, [r1] + ldr r0, [r4] + ldrb r0, [r0, 0x2] + cmp r0, 0x1A + bls _0804F7CA + b _0804FD70 +_0804F7CA: + lsls r0, 2 + ldr r1, =_0804F7E0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0804F7E0: + .4byte _0804F84C + .4byte _0804F85C + .4byte _0804F8BC + .4byte _0804F8CC + .4byte _0804F8E4 + .4byte _0804F920 + .4byte _0804F958 + .4byte _0804F9E0 + .4byte _0804FA20 + .4byte _0804FACC + .4byte _0804FAE8 + .4byte _0804FB3C + .4byte _0804FB94 + .4byte _0804FC18 + .4byte _0804FC2C + .4byte _0804FC32 + .4byte _0804FC38 + .4byte _0804FC60 + .4byte _0804FC6A + .4byte _0804FC78 + .4byte _0804FC8C + .4byte _0804FCC4 + .4byte _0804FCD8 + .4byte _0804FCF0 + .4byte _0804FD1C + .4byte _0804FD30 + .4byte _0804FD5C +_0804F84C: + ldr r0, =0x02024064 + ldrb r0, [r0] + bl b_cancel_multi_turn_move_maybe + b _0804FD70 + .pool +_0804F85C: + ldr r1, =0x0202420b + ldr r4, =0x0202420c + ldrb r0, [r4] + strb r0, [r1] + ldrb r0, [r1] + bl battle_side_get_owner + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02024294 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r2, r1, r2 + ldrb r0, [r2, 0x8] + cmp r0, 0 + beq _0804F8A8 + ldr r1, =0x02024084 + ldrb r2, [r2, 0x9] + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _0804F8A8 + strb r2, [r4] + b _0804FD70 + .pool +_0804F8A8: + ldr r0, =0x0202420c + ldr r1, =0x02024064 + ldrb r1, [r1] + strb r1, [r0] + b _0804FD70 + .pool +_0804F8BC: + bl sub_803BB88 + ldr r1, =0x02024332 + strb r0, [r1] + b _0804FD70 + .pool +_0804F8CC: + ldr r0, =0x020241ea + ldrh r0, [r0] + movs r1, 0 + bl sub_80458E0 + ldr r1, =0x0202420c + strb r0, [r1] + b _0804FD70 + .pool +_0804F8E4: + ldr r2, =0x02024280 + ldr r1, =gUnknown_0832A328 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + lsls r0, 28 + ldr r2, [r2] + ands r2, r0 + cmp r2, 0 + beq _0804F914 + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1] + b _0804FD70 + .pool +_0804F914: + ldr r0, =0x02024332 + strb r2, [r0] + b _0804FD70 + .pool +_0804F920: + ldr r4, =0x0202437c + ldr r3, =0x02024064 + ldrb r0, [r3] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldrb r0, [r3] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + b _0804FD70 + .pool +_0804F958: + ldr r4, =0x0202406e + ldr r1, =0x0202449c + ldr r0, [r1] + ldrh r3, [r4] + ldrb r2, [r0, 0x10] + adds r6, r1, 0 + cmp r3, r2 + beq _0804F974 + ldrh r0, [r4, 0x4] + cmp r0, r2 + beq _0804F970 + b _0804FD70 +_0804F970: + cmp r3, r0 + bne _0804F988 +_0804F974: + ldr r1, =0x02024064 + movs r0, 0 + b _0804F98C + .pool +_0804F988: + ldr r1, =0x02024064 + movs r0, 0x2 +_0804F98C: + strb r0, [r1] + adds r5, r1, 0 + ldrb r2, [r5] + lsls r0, r2, 1 + adds r0, 0xC8 + ldr r1, [r6] + adds r4, r1, r0 + movs r3, 0 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r2 + adds r1, 0xC + adds r0, r1 + ldrh r0, [r0] + ldrh r2, [r4] + cmp r0, r2 + beq _0804F9CC + adds r6, r5, 0 + movs r5, 0x58 + adds r2, r1, 0 +_0804F9B4: + adds r3, 0x1 + cmp r3, 0x3 + bgt _0804F9CC + lsls r1, r3, 1 + ldrb r0, [r6] + muls r0, r5 + adds r1, r0 + adds r1, r2 + ldrh r0, [r1] + ldrh r1, [r4] + cmp r0, r1 + bne _0804F9B4 +_0804F9CC: + cmp r3, 0x4 + beq _0804F9D2 + b _0804FD70 +_0804F9D2: + movs r0, 0 + strh r0, [r4] + b _0804FD70 + .pool +_0804F9E0: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0xB + ands r0, r1 + cmp r0, 0x8 + beq _0804F9EE + b _0804FD70 +_0804F9EE: + ldr r1, =0x02024084 + ldrh r0, [r1, 0x28] + cmp r0, 0 + bne _0804F9F8 + b _0804FD70 +_0804F9F8: + adds r0, r1, 0 + adds r0, 0x80 + ldrh r0, [r0] + cmp r0, 0 + bne _0804FA04 + b _0804FD70 +_0804FA04: + ldr r0, =0x02024280 + ldr r1, [r0] + ldr r2, =0xffbfffff + ands r1, r2 + str r1, [r0] + b _0804FD70 + .pool +_0804FA20: + ldr r2, =0x02024332 + mov r8, r2 + movs r0, 0 + strb r0, [r2] + ldr r1, =0x02024474 + ldr r6, =0x02024064 + ldrb r0, [r2, 0x1] + strb r0, [r6] + strb r0, [r1, 0x17] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r7, r0, 0 + adds r7, 0x92 + ldrb r3, [r7] + ldr r1, =gUnknown_0832A328 + ldrb r2, [r6] + lsls r0, r2, 2 + adds r0, r1 + ldr r5, [r0] + adds r0, r3, 0 + ands r0, r5 + cmp r0, 0 + beq _0804FA50 + b _0804FD70 +_0804FA50: + ldr r4, =0x02024084 + movs r0, 0x58 + mov r12, r0 + mov r1, r12 + muls r1, r2 + adds r2, r1, 0 + adds r1, r2, r4 + ldrh r0, [r1, 0x2C] + lsrs r0, 1 + ldrh r1, [r1, 0x28] + cmp r0, r1 + bcs _0804FA6A + b _0804FD70 +_0804FA6A: + cmp r1, 0 + bne _0804FA70 + b _0804FD70 +_0804FA70: + adds r0, r4, 0 + adds r0, 0x4C + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + beq _0804FA82 + b _0804FD70 +_0804FA82: + orrs r3, r5 + strb r3, [r7] + movs r0, 0x1 + mov r2, r8 + strb r0, [r2] + ldrb r0, [r6] + mov r1, r12 + muls r1, r0 + adds r0, r1, 0 + adds r1, r4, 0 + adds r1, 0x48 + adds r0, r1 + ldr r0, [r0] + bl GetNatureFromPersonality + ldr r1, =gUnknown_0831C4F8 + lsls r0, 24 + lsrs r0, 24 + adds r0, r1 + ldrb r0, [r0] + mov r2, r8 + strb r0, [r2, 0x5] + b _0804FD70 + .pool +_0804FACC: + ldr r4, =0x02024332 + adds r0, r4, 0 + bl sub_81A5258 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + bne _0804FADE + b _0804FD78 +_0804FADE: + strb r3, [r4, 0x1] + b _0804FD70 + .pool +_0804FAE8: + ldr r0, =0x02024084 + adds r0, 0x80 + movs r1, 0 + strh r1, [r0] + ldr r2, =0x02024280 + ldr r3, =gUnknown_0832A328 + ldr r1, [r3, 0x4] + lsls r1, 28 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + ldr r0, =0x0202449c + ldr r2, [r0] + ldr r0, =0x000002a1 + adds r2, r0 + ldr r0, =0x0202406e + ldrh r0, [r0, 0x2] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x020242bc + adds r1, 0x34 + ldrb r0, [r1] + movs r2, 0x2 + b _0804FBF4 + .pool +_0804FB3C: + ldr r1, =0x02024084 + movs r0, 0 + strh r0, [r1, 0x28] + ldr r2, =0x02024280 + ldr r3, =gUnknown_0832A328 + ldr r1, [r3] + lsls r1, 28 + ldr r0, [r2] + orrs r0, r1 + movs r1, 0x80 + lsls r1, 15 + orrs r0, r1 + str r0, [r2] + ldr r0, =0x0202449c + ldr r2, [r0] + movs r1, 0xA8 + lsls r1, 2 + adds r2, r1 + ldr r0, =0x0202406e + ldrh r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r2, =0x020242bc + ldrb r0, [r2, 0x18] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0x18] + b _0804FD70 + .pool +_0804FB94: + ldr r0, =0x02024084 + movs r1, 0 + strh r1, [r0, 0x28] + adds r0, 0x80 + strh r1, [r0] + ldr r2, =0x02024280 + ldr r3, =gUnknown_0832A328 + ldr r0, [r3] + lsls r0, 28 + ldr r1, [r2] + orrs r1, r0 + ldr r0, [r3, 0x4] + lsls r0, 28 + orrs r1, r0 + movs r0, 0x80 + lsls r0, 15 + orrs r1, r0 + str r1, [r2] + ldr r5, =0x0202449c + ldr r2, [r5] + movs r0, 0xA8 + lsls r0, 2 + adds r2, r0 + ldr r4, =0x0202406e + ldrh r0, [r4] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r2, [r5] + ldr r1, =0x000002a1 + adds r2, r1 + ldrh r0, [r4, 0x2] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x020242bc + ldrb r0, [r1, 0x18] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r1, 0x18] + adds r1, 0x34 + ldrb r0, [r1] +_0804FBF4: + orrs r0, r2 + strb r0, [r1] + b _0804FD70 + .pool +_0804FC18: + movs r0, 0 + bl sub_8033E10 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + b _0804FD70 + .pool +_0804FC2C: + bl sub_81A5BF8 + b _0804FD70 +_0804FC32: + bl sub_81A5D44 + b _0804FD70 +_0804FC38: + ldr r1, =gUnknown_085CD1C8 + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl get_battle_strings_ + ldr r0, =0x02022e2c + movs r1, 0x16 + bl battle_show_message_maybe + b _0804FD70 + .pool +_0804FC60: + movs r0, 0x16 + bl IsTextPrinterActive + lsls r0, 16 + b _0804FD24 +_0804FC6A: + bl sub_80A3678 + lsls r0, 24 + cmp r0, 0 + bne _0804FC76 + b _0804FD78 +_0804FC76: + b _0804FD70 +_0804FC78: + ldr r4, =0x02024064 + movs r0, 0x1 + strb r0, [r4] + ldr r0, =0x02024084 + adds r0, 0x58 + b _0804FCA2 + .pool +_0804FC8C: + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r0, 0x3 + bls _0804FD70 + ldr r4, =0x02024064 + movs r0, 0x3 + strb r0, [r4] + ldr r0, =0x02024084 + movs r2, 0x84 + lsls r2, 1 + adds r0, r2 +_0804FCA2: + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _0804FD70 + movs r0, 0 + movs r1, 0 + bl dp01_build_cmdbuf_x06_a + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _0804FD70 + .pool +_0804FCC4: + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x55 + bl MPlayVolumeControl + b _0804FD70 + .pool +_0804FCD8: + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + b _0804FD70 + .pool +_0804FCF0: + ldr r0, =0x0202449c + ldr r2, [r0] + ldr r0, =0x000002a2 + adds r2, r0 + ldr r1, =gUnknown_0832A328 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + b _0804FD70 + .pool +_0804FD1C: + ldr r0, =0x02024064 + ldrb r0, [r0] + bl sub_805725C +_0804FD24: + cmp r0, 0 + bne _0804FD78 + b _0804FD70 + .pool +_0804FD30: + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0804FD50 + ldr r1, =0x0202433a + movs r0, 0x5 + strb r0, [r1] + b _0804FD70 + .pool +_0804FD50: + ldr r1, =0x0202433a + movs r0, 0xA + strb r0, [r1] + b _0804FD70 + .pool +_0804FD5C: + movs r1, 0xCE + lsls r1, 1 + movs r0, 0 + movs r2, 0x1 + bl sub_8034300 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution +_0804FD70: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x3 + str r0, [r1] +_0804FD78: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_804F7AC + + thumb_func_start atk77_setprotect +atk77_setprotect: @ 804FD8C + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r6, 0x1 + ldr r2, =0x02024260 + ldr r1, =0x0202420b + ldrb r3, [r1] + lsls r0, r3, 1 + adds r0, r2 + ldrh r0, [r0] + mov r8, r1 + ldr r7, =0x020242bc + cmp r0, 0xB6 + beq _0804FDBC + cmp r0, 0xC5 + beq _0804FDBC + cmp r0, 0xCB + beq _0804FDBC + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r7 + movs r1, 0 + strb r1, [r0, 0x8] +_0804FDBC: + ldr r0, =0x02024082 + ldrb r1, [r0] + ldr r0, =0x0202406c + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _0804FDCC + movs r6, 0 +_0804FDCC: + ldr r2, =gUnknown_0831C3D8 + mov r5, r8 + ldrb r1, [r5] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r7 + ldrb r4, [r0, 0x8] + lsls r4, 1 + adds r4, r2 + bl GenerateRandomNumber + ldrh r1, [r4] + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + bcc _0804FE80 + cmp r6, 0 + beq _0804FE80 + ldr r4, =gBattleMoves + ldr r3, =0x020241ea + ldrh r0, [r3] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r1] + cmp r0, 0x6F + bne _0804FE1C + ldr r0, =0x0202433c + ldrb r1, [r5] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x1 + orrs r0, r2 + strb r0, [r1] + ldr r1, =0x02024332 + movs r0, 0 + strb r0, [r1, 0x5] +_0804FE1C: + ldrh r0, [r3] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r1] + cmp r0, 0x74 + bne _0804FE42 + ldr r0, =0x0202433c + ldrb r1, [r5] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r1] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] +_0804FE42: + mov r1, r8 + ldrb r0, [r1] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r0, [r1, 0x8] + adds r0, 0x1 + strb r0, [r1, 0x8] + b _0804FEA2 + .pool +_0804FE80: + ldr r2, =0x020242bc + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strb r1, [r0, 0x8] + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1, 0x5] + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] +_0804FEA2: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk77_setprotect + + thumb_func_start atk78_faintifabilitynotdamp +atk78_faintifabilitynotdamp: @ 804FEC8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x02024068 + ldr r2, [r0] + cmp r2, 0 + bne _0804FFCC + ldr r1, =0x0202420c + strb r2, [r1] + ldr r0, =0x0202406c + ldrb r3, [r0] + adds r5, r1, 0 + mov r8, r0 + ldr r6, =0x02024084 + cmp r2, r3 + bcs _0804FF14 + adds r0, r6, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x6 + beq _0804FF14 + adds r2, r3, 0 + adds r4, r6, 0 + movs r3, 0x58 +_0804FEF8: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, r2 + bcs _0804FF14 + ldrb r0, [r5] + muls r0, r3 + adds r0, r4 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x6 + bne _0804FEF8 +_0804FF14: + ldrb r0, [r5] + mov r1, r8 + ldrb r1, [r1] + cmp r0, r1 + bne _0804FFB0 + ldr r4, =0x02024064 + ldr r7, =0x0202420b + ldrb r0, [r7] + strb r0, [r4] + ldr r2, =0x020241f0 + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + adds r0, r6 + ldrh r0, [r0, 0x28] + str r0, [r2] + ldr r1, =0x00007fff + movs r0, 0 + bl dp01_build_cmdbuf_x18_0_aa_health_bar_update + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + movs r0, 0 + strb r0, [r5] + mov r2, r8 + ldrb r0, [r2] + cmp r0, 0 + beq _0804FFCC + adds r3, r5, 0 + ldrb r5, [r7] + ldr r7, =gUnknown_0832A328 + adds r4, r0, 0 + ldr r6, =0x02024210 +_0804FF60: + ldrb r2, [r3] + cmp r2, r5 + beq _0804FF76 + ldrb r0, [r6] + ldrb r1, [r3] + lsls r1, 2 + adds r1, r7 + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + beq _0804FFCC +_0804FF76: + adds r0, r2, 0x1 + strb r0, [r3] + lsls r0, 24 + lsrs r0, 24 + cmp r0, r4 + bcc _0804FF60 + b _0804FFCC + .pool +_0804FFB0: + ldr r1, =0x0202420a + movs r0, 0x6 + strb r0, [r1] + ldrb r0, [r5] + movs r1, 0x58 + muls r1, r0 + adds r1, r6 + adds r1, 0x20 + ldrb r1, [r1] + bl b_history__record_ability_usage_of_player + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB560 + str r0, [r1] +_0804FFCC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk78_faintifabilitynotdamp + + thumb_func_start atk79_setuserhptozero +atk79_setuserhptozero: @ 804FFE4 + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x02024068 + ldr r3, [r0] + cmp r3, 0 + bne _08050028 + ldr r4, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r4] + ldr r1, =0x02024084 + ldrb r0, [r4] + movs r2, 0x58 + muls r0, r2 + adds r0, r1 + strh r3, [r0, 0x28] + ldrb r0, [r4] + muls r0, r2 + adds r1, 0x28 + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x2A + movs r2, 0 + movs r3, 0x2 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_08050028: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk79_setuserhptozero + + thumb_func_start sub_8050044 +sub_8050044: @ 8050044 + push {r4-r7,lr} + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r4, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r4, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r4, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r4, r0 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + adds r7, r3, 0 + cmp r0, 0 + beq _080500DC + ldr r0, =0x0202420c + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r2, =0x0202420b + lsls r1, 24 + lsrs r1, 24 + adds r3, r0, 0 + ldr r6, =0x02024210 + ldr r5, =gUnknown_0832A328 + ldr r0, =0x0202406c + mov r12, r0 + ldrb r0, [r2] + cmp r1, r0 + bne _0805009A +_0805008A: + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r2] + cmp r0, r1 + beq _0805008A +_0805009A: + ldrb r0, [r6] + ldrb r1, [r3] + lsls r1, 2 + adds r1, r5 + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + bne _0805008A + ldrb r0, [r3] + mov r2, r12 + ldrb r2, [r2] + cmp r0, r2 + bcc _080500D8 + ldr r0, [r7] + adds r0, 0x5 + str r0, [r7] + b _080500E0 + .pool +_080500D8: + str r4, [r7] + b _080500E0 +_080500DC: + adds r0, r2, 0x5 + str r0, [r3] +_080500E0: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8050044 + + thumb_func_start sub_80500E8 +sub_80500E8: @ 80500E8 + push {r4-r6,lr} + ldr r4, =0x02024214 + ldr r1, [r4] + ldrb r2, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + orrs r2, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + orrs r2, r0 + ldrb r0, [r1, 0x5] + ldr r3, =0x0202420c + cmp r0, 0x1 + bne _08050110 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r3] +_08050110: + ldr r1, =0x020241f0 + ldr r6, =0x02024084 + ldrb r0, [r3] + movs r5, 0x58 + muls r0, r5 + adds r0, r6 + ldrh r0, [r0, 0x2C] + lsrs r0, 1 + str r0, [r1] + cmp r0, 0 + bne _0805012A + movs r0, 0x1 + str r0, [r1] +_0805012A: + ldr r0, [r1] + negs r0, r0 + str r0, [r1] + ldrb r0, [r3] + muls r0, r5 + adds r0, r6 + ldrh r1, [r0, 0x28] + ldrh r0, [r0, 0x2C] + cmp r1, r0 + bne _08050158 + str r2, [r4] + b _0805015E + .pool +_08050158: + ldr r0, [r4] + adds r0, 0x6 + str r0, [r4] +_0805015E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80500E8 + + thumb_func_start sub_8050164 +sub_8050164: @ 8050164 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r2, =0x0202406c + ldr r0, =0x0202420b + mov r10, r0 + movs r1, 0 + add r0, sp, 0x4 +_0805017A: + strh r1, [r0] + subs r0, 0x2 + cmp r0, sp + bge _0805017A + movs r1, 0 + mov r8, r1 + movs r5, 0 + ldrb r1, [r2] + cmp r5, r1 + bge _080501D0 + ldr r0, =0x0202420b + ldrb r6, [r0] + ldr r2, =0x0000ffff + mov r9, r2 + lsls r4, r6, 3 + mov r2, sp + ldr r0, =0x0202449c + mov r12, r0 + adds r7, r1, 0 +_080501A0: + cmp r5, r6 + beq _080501C8 + mov r1, r12 + ldr r0, [r1] + adds r0, r4, r0 + adds r1, r0, 0 + adds r1, 0xE0 + ldrb r3, [r1] + adds r0, 0xE1 + ldrb r0, [r0] + lsls r0, 8 + orrs r3, r0 + cmp r3, 0 + beq _080501C8 + cmp r3, r9 + beq _080501C8 + strh r3, [r2] + adds r2, 0x2 + movs r0, 0x1 + add r8, r0 +_080501C8: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, r7 + blt _080501A0 +_080501D0: + mov r1, r10 + ldrb r0, [r1] + ldr r2, =0x0202449c + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r1, r0, 0 + adds r1, 0x98 + ldrb r3, [r1] + adds r0, 0x99 + ldrb r0, [r0] + lsls r0, 8 + orrs r3, r0 + cmp r3, 0 + beq _08050220 + ldr r0, =0x0000ffff + cmp r3, r0 + beq _08050220 + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xfffffbff + ands r0, r1 + str r0, [r2] + ldr r4, =0x020241ea + strh r3, [r4] + b _0805024A + .pool +_08050220: + mov r0, r8 + cmp r0, 0 + beq _08050290 + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xfffffbff + ands r0, r1 + str r0, [r2] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + mov r1, r8 + bl __modsi3 + adds r5, r0, 0 + ldr r4, =0x020241ea + lsls r0, r5, 1 + add r0, sp + ldrh r0, [r0] + strh r0, [r4] +_0805024A: + ldrh r0, [r4] + movs r1, 0 + bl sub_80458E0 + ldr r1, =0x0202420c + strb r0, [r1] + ldr r5, =0x02024214 + ldr r3, =gUnknown_082D86A8 + ldr r2, =gBattleMoves + ldrh r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + str r0, [r5] + b _080502AE + .pool +_08050290: + ldr r2, =0x0202437c + mov r0, r10 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_080502AE: + 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_8050164 + + thumb_func_start sub_80502C8 +sub_80502C8: @ 80502C8 + push {lr} + ldr r2, =0x020243cc + ldrh r0, [r2] + movs r1, 0x7 + ands r1, r0 + cmp r1, 0 + beq _080502F4 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1, 0x5] + b _08050304 + .pool +_080502F4: + movs r0, 0x1 + strh r0, [r2] + ldr r0, =0x02024332 + strb r1, [r0, 0x5] + ldr r0, =0x020243d0 + adds r0, 0x28 + movs r1, 0x5 + strb r1, [r0] +_08050304: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80502C8 + + thumb_func_start atk7E_setreflect +atk7E_setreflect: @ 805031C + push {r4-r6,lr} + ldr r6, =0x0202420b + ldrb r0, [r6] + bl battle_get_per_side_status + ldr r4, =0x0202428e + movs r5, 0x1 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + ldrh r1, [r1] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _0805035C + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0 + b _080503D0 + .pool +_0805035C: + ldrb r0, [r6] + bl battle_get_per_side_status + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + ldrh r0, [r1] + movs r2, 0x1 + orrs r0, r2 + strh r0, [r1] + ldrb r0, [r6] + bl battle_get_per_side_status + ldr r4, =0x02024294 + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x5 + strb r1, [r0] + ldrb r0, [r6] + bl battle_get_per_side_status + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r6] + strb r1, [r0, 0x1] + ldr r0, =0x02022fec + ldr r0, [r0] + ands r0, r5 + cmp r0, 0 + beq _080503CC + movs r0, 0x1 + bl sub_8069DEC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x2 + bne _080503CC + ldr r0, =0x02024332 + strb r1, [r0, 0x5] + b _080503D2 + .pool +_080503CC: + ldr r1, =0x02024332 + movs r0, 0x1 +_080503D0: + strb r0, [r1, 0x5] +_080503D2: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atk7E_setreflect + + thumb_func_start sub_80503E8 +sub_80503E8: @ 80503E8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r7, =0x0202427c + ldrb r5, [r7] + movs r0, 0x29 + ands r0, r5 + cmp r0, 0 + bne _0805041A + ldr r0, =0x020242ac + mov r9, r0 + ldr r1, =0x0202420c + mov r8, r1 + ldrb r4, [r1] + lsls r0, r4, 2 + mov r2, r9 + adds r6, r0, r2 + ldr r2, [r6] + movs r0, 0x4 + mov r12, r0 + adds r3, r2, 0 + ands r3, r0 + cmp r3, 0 + beq _08050438 +_0805041A: + movs r0, 0x1 + orrs r0, r5 + strb r0, [r7] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _08050488 + .pool +_08050438: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r4 + adds r1, r0, r1 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0xC + beq _08050454 + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0xC + bne _0805046C +_08050454: + movs r0, 0x1 + orrs r0, r5 + strb r0, [r7] + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1, 0x5] + b _08050488 + .pool +_0805046C: + ldr r0, =0x0202420b + ldrb r0, [r0] + orrs r2, r0 + str r2, [r6] + mov r2, r8 + ldrb r1, [r2] + lsls r1, 2 + add r1, r9 + ldr r0, [r1] + mov r2, r12 + orrs r0, r2 + str r0, [r1] + ldr r0, =0x02024332 + strb r3, [r0, 0x5] +_08050488: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80503E8 + + thumb_func_start atk80_manipulatedamage +atk80_manipulatedamage: @ 80504A8 + push {r4,lr} + ldr r1, =0x02024214 + ldr r0, [r1] + ldrb r2, [r0, 0x1] + adds r4, r1, 0 + cmp r2, 0x1 + beq _080504D8 + cmp r2, 0x1 + bgt _080504C4 + cmp r2, 0 + beq _080504CA + b _08050518 + .pool +_080504C4: + cmp r2, 0x2 + beq _08050510 + b _08050518 +_080504CA: + ldr r1, =0x020241f0 + ldr r0, [r1] + negs r0, r0 + b _08050516 + .pool +_080504D8: + ldr r3, =0x020241f0 + ldr r0, [r3] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + str r0, [r3] + cmp r0, 0 + bne _080504EA + str r2, [r3] +_080504EA: + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x2C] + lsrs r1, r0, 1 + ldr r0, [r3] + cmp r1, r0 + bge _08050518 + str r1, [r3] + b _08050518 + .pool +_08050510: + ldr r1, =0x020241f0 + ldr r0, [r1] + lsls r0, 1 +_08050516: + str r0, [r1] +_08050518: + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk80_manipulatedamage + + thumb_func_start atk81_setrest +atk81_setrest: @ 8050528 + push {r4-r7,lr} + sub sp, 0x4 + ldr r0, =0x02024214 + mov r12, r0 + ldr r1, [r0] + ldrb r6, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + orrs r6, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + orrs r6, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + orrs r6, r0 + ldr r5, =0x02024064 + ldr r2, =0x0202420c + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r2] + strb r0, [r5] + ldr r4, =0x020241f0 + ldr r1, =0x02024084 + ldrb r0, [r2] + movs r3, 0x58 + muls r0, r3 + adds r0, r1 + ldrh r0, [r0, 0x2C] + negs r0, r0 + str r0, [r4] + ldrb r0, [r2] + adds r4, r0, 0 + muls r4, r3 + adds r0, r4, r1 + ldrh r3, [r0, 0x28] + adds r7, r5, 0 + adds r5, r2, 0 + adds r2, r1, 0 + ldrh r0, [r0, 0x2C] + cmp r3, r0 + bne _08050598 + mov r0, r12 + str r6, [r0] + b _080505E8 + .pool +_08050598: + adds r0, r2, 0 + adds r0, 0x4C + adds r0, r4, r0 + ldr r1, [r0] + movs r0, 0xF8 + ands r1, r0 + cmp r1, 0 + beq _080505B4 + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _080505B8 + .pool +_080505B4: + ldr r0, =0x02024332 + strb r1, [r0, 0x5] +_080505B8: + ldrb r0, [r5] + movs r3, 0x58 + muls r0, r3 + adds r2, 0x4C + adds r0, r2 + movs r1, 0x3 + str r1, [r0] + ldrb r0, [r7] + muls r0, r3 + adds r0, r2 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r7] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_080505E8: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk81_setrest + + thumb_func_start atk82_jumpifnotfirstturn +atk82_jumpifnotfirstturn: @ 80505F8 + push {r4,r5,lr} + ldr r5, =0x02024214 + ldr r4, [r5] + ldrb r3, [r4, 0x1] + ldrb r0, [r4, 0x2] + lsls r0, 8 + orrs r3, r0 + ldrb r0, [r4, 0x3] + lsls r0, 16 + orrs r3, r0 + ldrb r0, [r4, 0x4] + lsls r0, 24 + orrs r3, r0 + ldr r2, =0x020242bc + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x16] + cmp r0, 0 + beq _08050638 + adds r0, r4, 0x5 + str r0, [r5] + b _0805063A + .pool +_08050638: + str r3, [r5] +_0805063A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end atk82_jumpifnotfirstturn + + thumb_func_start sub_8050640 +sub_8050640: @ 8050640 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8050640 + + thumb_func_start sub_8050650 +sub_8050650: @ 8050650 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r3, r0, 24 + movs r2, 0 + ldr r0, =0x0202406c + ldrb r1, [r0] + mov r8, r0 + cmp r2, r1 + bge _080506C4 + ldr r0, =0x02024084 + mov r12, r0 + movs r0, 0x58 + muls r0, r3 + add r0, r12 + adds r5, r0, 0 + adds r5, 0x20 + adds r4, r1, 0 + movs r3, 0 + ldr r6, =0x02024474 + ldr r7, =0x02024332 +_0805067C: + mov r0, r12 + adds r0, 0x50 + adds r0, r3, r0 + ldr r0, [r0] + movs r1, 0x70 + ands r0, r1 + cmp r0, 0 + beq _080506BC + ldrb r0, [r5] + cmp r0, 0x2B + beq _080506BC + movs r3, 0 + strb r2, [r6, 0x17] + ldr r1, =0x0202420c + ldrb r0, [r1] + cmp r0, 0xFF + beq _080506DC + cmp r0, r2 + beq _080506D0 + movs r0, 0x1 + strb r0, [r7, 0x5] + b _080506C4 + .pool +_080506BC: + adds r3, 0x58 + adds r2, 0x1 + cmp r2, r4 + blt _0805067C +_080506C4: + mov r1, r8 + ldrb r1, [r1] + cmp r2, r1 + beq _080506E0 + movs r0, 0x1 + b _080506E2 +_080506D0: + ldr r0, =0x02024332 + strb r3, [r0, 0x5] + b _080506C4 + .pool +_080506DC: + strb r2, [r1] + b _080506C4 +_080506E0: + movs r0, 0 +_080506E2: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8050650 + + thumb_func_start sub_80506EC +sub_80506EC: @ 80506EC + push {r4-r6,lr} + ldr r5, =0x02024214 + ldr r1, [r5] + ldrb r4, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + orrs r4, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + orrs r4, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + orrs r4, r0 + ldr r6, =0x0202420c + ldrb r0, [r6] + bl sub_8050650 + lsls r0, 24 + cmp r0, 0 + beq _08050720 + str r4, [r5] + b _08050762 + .pool +_08050720: + ldr r1, =0x02024084 + ldrb r3, [r6] + movs r0, 0x58 + muls r0, r3 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + adds r1, r0, 0 + cmp r1, 0xF + beq _08050738 + cmp r1, 0x48 + bne _0805075C +_08050738: + ldr r2, =0x0202420a + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1, 0x5] + str r4, [r5] + ldrb r1, [r2] + adds r0, r3, 0 + bl b_history__record_ability_usage_of_player + b _08050762 + .pool +_0805075C: + ldr r0, [r5] + adds r0, 0x5 + str r0, [r5] +_08050762: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80506EC + + thumb_func_start sub_8050768 +sub_8050768: @ 8050768 + push {r4,r5,lr} + ldr r5, =0x020242bc + ldr r4, =0x0202420b + ldrb r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r1, r0, r5 + ldrb r0, [r1, 0x9] + cmp r0, 0x3 + bne _080507A0 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _080507CA + .pool +_080507A0: + adds r0, 0x1 + movs r3, 0 + strb r0, [r1, 0x9] + ldr r2, =0x02022f58 + movs r0, 0xFD + strb r0, [r2] + movs r0, 0x1 + strb r0, [r2, 0x1] + strb r0, [r2, 0x2] + strb r0, [r2, 0x3] + ldrb r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0, 0x9] + strb r0, [r2, 0x4] + movs r0, 0xFF + strb r0, [r2, 0x5] + ldr r0, =0x02024332 + strb r3, [r0, 0x5] +_080507CA: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8050768 + + thumb_func_start atk86_stockpiletobasedamage +atk86_stockpiletobasedamage: @ 80507E4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + ldr r3, =0x02024214 + ldr r1, [r3] + ldrb r2, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + orrs r2, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + orrs r2, r0 + ldr r7, =0x020242bc + ldr r6, =0x0202420b + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r7 + ldrb r0, [r0, 0x9] + cmp r0, 0 + bne _08050828 + str r2, [r3] + b _080508CA + .pool +_08050828: + ldr r0, =0x02024332 + ldrb r0, [r0, 0x6] + cmp r0, 0x1 + beq _080508B0 + ldr r0, =0x020241f0 + mov r8, r0 + ldr r4, =0x0202428e + ldr r5, =0x0202420c + ldrb r0, [r5] + bl battle_get_per_side_status + movs r1, 0x1 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + ldrh r3, [r1] + ldrb r0, [r6] + movs r4, 0x58 + muls r0, r4 + ldr r2, =0x02024084 + adds r0, r2 + ldrb r1, [r5] + muls r1, r4 + adds r1, r2 + ldr r2, =0x020241ea + ldrh r2, [r2] + movs r4, 0 + str r4, [sp] + str r4, [sp, 0x4] + ldrb r4, [r6] + str r4, [sp, 0x8] + ldrb r4, [r5] + str r4, [sp, 0xC] + bl sub_806957C + ldrb r2, [r6] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r7 + ldrb r1, [r1, 0x9] + adds r3, r0, 0 + muls r3, r1 + mov r1, r8 + str r3, [r1] + ldr r2, =0x02024474 + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r7 + ldrb r0, [r0, 0x9] + strb r0, [r2, 0x18] + ldr r1, =0x0202433c + ldrb r0, [r6] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 28 + cmp r0, 0 + bge _080508B0 + lsls r0, r3, 4 + subs r0, r3 + movs r1, 0xA + bl __divsi3 + mov r1, r8 + str r0, [r1] +_080508B0: + ldr r2, =0x020242bc + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strb r1, [r0, 0x9] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_080508CA: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk86_stockpiletobasedamage + + thumb_func_start atk87_stockpiletohprecovery +atk87_stockpiletohprecovery: @ 8050904 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r7, =0x02024214 + ldr r1, [r7] + ldrb r2, [r1, 0x1] + ldrb r0, [r1, 0x2] + lsls r0, 8 + orrs r2, r0 + ldrb r0, [r1, 0x3] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r1, 0x4] + lsls r0, 24 + orrs r2, r0 + ldr r0, =0x020242bc + mov r8, r0 + ldr r6, =0x0202420b + ldrb r3, [r6] + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + mov r1, r8 + adds r4, r0, r1 + ldrb r1, [r4, 0x9] + cmp r1, 0 + bne _08050954 + str r2, [r7] + ldr r0, =0x02024332 + strb r1, [r0, 0x5] + b _080509D0 + .pool +_08050954: + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r3 + adds r1, r0, r1 + ldrh r0, [r1, 0x2C] + ldrh r3, [r1, 0x28] + cmp r0, r3 + bne _08050984 + movs r0, 0 + strb r0, [r4, 0x9] + str r2, [r7] + ldr r1, =0x0202420c + ldrb r0, [r6] + strb r0, [r1] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _080509D0 + .pool +_08050984: + ldr r5, =0x020241f0 + ldrh r0, [r1, 0x2C] + ldrb r1, [r4, 0x9] + movs r2, 0x3 + subs r2, r1 + movs r4, 0x1 + adds r1, r4, 0 + lsls r1, r2 + bl __divsi3 + str r0, [r5] + cmp r0, 0 + bne _080509A0 + str r4, [r5] +_080509A0: + ldr r0, [r5] + negs r0, r0 + str r0, [r5] + ldr r3, =0x02024474 + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r0, [r0, 0x9] + movs r2, 0 + strb r0, [r3, 0x18] + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r8 + strb r2, [r0, 0x9] + ldr r0, [r7] + adds r0, 0x5 + str r0, [r7] + ldr r1, =0x0202420c + ldrb r0, [r6] + strb r0, [r1] +_080509D0: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk87_stockpiletohprecovery + + thumb_func_start atk88_negativedamage +atk88_negativedamage: @ 80509E8 + push {lr} + ldr r2, =0x020241f0 + ldr r0, =0x020241f4 + ldr r0, [r0] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + negs r0, r0 + str r0, [r2] + cmp r0, 0 + bne _08050A04 + movs r0, 0x1 + negs r0, r0 + str r0, [r2] +_08050A04: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atk88_negativedamage + + thumb_func_start sub_8050A1C +sub_8050A1C: @ 8050A1C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r8, r3 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + movs r0, 0 + mov r9, r0 + mov r10, r0 + movs r0, 0x40 + ands r0, r5 + cmp r0, 0 + beq _08050A50 + ldr r0, =0x02024064 + ldr r1, =0x0202420b + b _08050A54 + .pool +_08050A50: + ldr r0, =0x02024064 + ldr r1, =0x0202420c +_08050A54: + ldrb r1, [r1] + strb r1, [r0] + movs r0, 0xBF + ands r5, r0 + movs r0, 0x80 + ands r0, r5 + cmp r0, 0 + beq _08050A6E + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_08050A6E: + movs r0, 0x7F + ands r5, r0 + movs r0, 0x20 + ands r0, r5 + cmp r0, 0 + beq _08050A84 + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 +_08050A84: + movs r0, 0xDF + ands r5, r0 + ldr r1, =0x02022f58 + movs r4, 0 + movs r2, 0xFD + strb r2, [r1] + movs r0, 0x5 + strb r0, [r1, 0x1] + strb r7, [r1, 0x2] + movs r3, 0x1 + negs r3, r3 + mov r12, r3 + movs r0, 0xFF + strb r0, [r1, 0x3] + lsls r0, r6, 24 + cmp r0, 0 + blt _08050AA8 + b _08050D8C +_08050AA8: + ldr r4, =0x02024294 + ldr r1, =0x02024064 + ldrb r0, [r1] + bl battle_get_per_side_status + movs r1, 0x1 + ands r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _08050B48 + mov r2, r9 + cmp r2, 0 + bne _08050B48 + ldr r0, =0x020241ea + ldrh r0, [r0] + cmp r0, 0xAE + beq _08050B78 + cmp r5, 0x1 + bne _08050B68 + ldr r4, =0x0202437c + ldr r3, =0x02024064 + ldrb r0, [r3] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + beq _08050B10 + ldr r0, =0x02024214 + mov r4, r8 + str r4, [r0] + b _08050B68 + .pool +_08050B10: + mov r0, r8 + bl b_movescr_stack_push + ldr r1, =0x02024474 + ldr r6, =0x02024064 + ldrb r0, [r6] + strb r0, [r1, 0x17] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAE03 + str r0, [r1] + ldrb r1, [r6] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + b _08050B68 + .pool +_08050B48: + ldr r0, =0x020241ea + ldrh r0, [r0] + cmp r0, 0xAE + beq _08050B78 + mov r0, r10 + cmp r0, 0x1 + beq _08050B78 + movs r0, 0 + bl sub_80464AC + lsls r0, 24 + cmp r0, 0 + beq _08050B78 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082D9F1C + str r0, [r1] +_08050B68: + movs r0, 0x1 + b _08050E80 + .pool +_08050B78: + ldr r2, =0x02024084 + ldr r1, =0x02024064 + ldrb r3, [r1] + movs r4, 0x58 + adds r0, r3, 0 + muls r0, r4 + adds r0, r2 + adds r0, 0x20 + ldrb r0, [r0] + mov r10, r2 + cmp r0, 0x1D + beq _08050B94 + cmp r0, 0x49 + bne _08050C2C +_08050B94: + mov r0, r9 + cmp r0, 0 + bne _08050C2C + ldr r0, =0x020241ea + ldrh r0, [r0] + cmp r0, 0xAE + beq _08050C2C + cmp r5, 0x1 + bne _08050B68 + ldr r4, =0x0202437c + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + beq _08050BD4 + ldr r0, =0x02024214 + mov r1, r8 + str r1, [r0] + b _08050B68 + .pool +_08050BD4: + mov r0, r8 + bl b_movescr_stack_push + ldr r1, =0x02024474 + ldr r2, =0x02024064 + ldrb r0, [r2] + strb r0, [r1, 0x17] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB5C7 + str r0, [r1] + ldr r1, =0x0202420a + ldrb r0, [r2] + movs r3, 0x58 + muls r0, r3 + add r0, r10 + adds r0, 0x20 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r2] + ldrb r1, [r1] + bl b_history__record_ability_usage_of_player + ldr r6, =0x02024064 + ldrb r1, [r6] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + b _08050B68 + .pool +_08050C2C: + ldr r1, =0x02024064 + ldrb r0, [r1] + movs r4, 0x58 + muls r0, r4 + add r0, r10 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x33 + bne _08050C8C + mov r2, r9 + cmp r2, 0 + bne _08050C8C + cmp r7, 0x6 + bne _08050C8C + cmp r5, 0x1 + bne _08050B68 + mov r0, r8 + bl b_movescr_stack_push + ldr r1, =0x02024474 + ldr r3, =0x02024064 + ldrb r0, [r3] + strb r0, [r1, 0x17] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB62F + str r0, [r1] + ldr r1, =0x0202420a + ldrb r0, [r3] + muls r0, r4 + add r0, r10 + adds r0, 0x20 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r3] + ldrb r1, [r1] + bl b_history__record_ability_usage_of_player + b _08050B68 + .pool +_08050C8C: + ldr r4, =0x02024064 + ldrb r0, [r4] + movs r4, 0x58 + muls r0, r4 + add r0, r10 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x34 + bne _08050CF0 + mov r0, r9 + cmp r0, 0 + bne _08050CF0 + cmp r7, 0x1 + bne _08050CF0 + cmp r5, 0x1 + beq _08050CAE + b _08050B68 +_08050CAE: + mov r0, r8 + bl b_movescr_stack_push + ldr r1, =0x02024474 + ldr r2, =0x02024064 + ldrb r0, [r2] + strb r0, [r1, 0x17] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB62F + str r0, [r1] + ldr r1, =0x0202420a + ldrb r0, [r2] + muls r0, r4 + add r0, r10 + adds r0, 0x20 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r2] + ldrb r1, [r1] + bl b_history__record_ability_usage_of_player + b _08050B68 + .pool +_08050CF0: + ldr r3, =0x02024064 + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + add r0, r10 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x13 + bne _08050D08 + cmp r5, 0 + bne _08050D08 + b _08050B68 +_08050D08: + lsls r0, r6, 24 + asrs r0, 28 + movs r1, 0x7 + ands r0, r1 + negs r0, r0 + lsls r0, 24 + ldr r3, =0x02022f68 + movs r4, 0 + movs r1, 0xFD + strb r1, [r3] + movs r2, 0x1 + lsrs r6, r0, 24 + asrs r0, 24 + subs r1, 0xFF + cmp r0, r1 + bne _08050D32 + strb r4, [r3, 0x1] + movs r0, 0xD3 + strb r0, [r3, 0x2] + strb r4, [r3, 0x3] + movs r2, 0x4 +_08050D32: + adds r0, r2, r3 + strb r4, [r0] + adds r2, 0x1 + adds r1, r2, r3 + movs r0, 0xD4 + strb r0, [r1] + adds r2, 0x1 + adds r0, r2, r3 + strb r4, [r0] + adds r2, 0x1 + adds r1, r2, r3 + movs r0, 0xFF + strb r0, [r1] + ldr r4, =0x02024064 + ldrb r2, [r4] + movs r0, 0x58 + muls r0, r2 + adds r0, r7, r0 + mov r1, r10 + adds r1, 0x18 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + beq _08050DE2 + movs r1, 0 + ldr r0, =0x0202420c + ldrb r0, [r0] + ldr r3, =0x02024332 + mov r8, r3 + cmp r0, r2 + bne _08050D76 + movs r1, 0x1 +_08050D76: + mov r4, r8 + strb r1, [r4, 0x5] + b _08050E10 + .pool +_08050D8C: + asrs r6, r0, 28 + movs r0, 0x7 + ands r6, r0 + ldr r3, =0x02022f68 + strb r2, [r3] + movs r2, 0x1 + cmp r6, 0x2 + bne _08050DA6 + strb r4, [r3, 0x1] + movs r0, 0xD1 + strb r0, [r3, 0x2] + strb r4, [r3, 0x3] + movs r2, 0x4 +_08050DA6: + adds r0, r2, r3 + strb r4, [r0] + adds r2, 0x1 + adds r1, r2, r3 + movs r0, 0xD2 + strb r0, [r1] + adds r2, 0x1 + adds r0, r2, r3 + strb r4, [r0] + adds r2, 0x1 + adds r1, r2, r3 + ldrb r0, [r1] + mov r2, r12 + orrs r0, r2 + strb r0, [r1] + ldr r2, =0x02024084 + ldr r4, =0x02024064 + ldrb r3, [r4] + movs r0, 0x58 + muls r0, r3 + adds r0, r7, r0 + adds r1, r2, 0 + adds r1, 0x18 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + mov r10, r2 + cmp r0, 0xC + bne _08050DFC +_08050DE2: + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1, 0x5] + mov r8, r1 + b _08050E10 + .pool +_08050DFC: + movs r1, 0 + ldr r0, =0x0202420c + ldrb r0, [r0] + ldr r2, =0x02024332 + mov r8, r2 + cmp r0, r3 + bne _08050E0C + movs r1, 0x1 +_08050E0C: + mov r3, r8 + strb r1, [r3, 0x5] +_08050E10: + ldr r2, =0x02024064 + ldrb r0, [r2] + movs r4, 0x58 + adds r1, r0, 0 + muls r1, r4 + adds r1, r7, r1 + mov r3, r10 + adds r3, 0x18 + adds r1, r3 + lsls r0, r6, 24 + asrs r0, 24 + ldrb r6, [r1] + adds r0, r6 + strb r0, [r1] + ldrb r0, [r2] + muls r0, r4 + adds r0, r7, r0 + adds r1, r0, r3 + movs r0, 0 + ldrsb r0, [r1, r0] + cmp r0, 0 + bge _08050E40 + movs r0, 0 + strb r0, [r1] +_08050E40: + ldr r1, =0x02024064 + ldrb r0, [r1] + muls r0, r4 + adds r0, r7, r0 + adds r1, r0, r3 + movs r0, 0 + ldrsb r0, [r1, r0] + cmp r0, 0xC + ble _08050E56 + movs r0, 0xC + strb r0, [r1] +_08050E56: + mov r2, r8 + ldrb r0, [r2, 0x5] + cmp r0, 0x2 + bne _08050E7E + movs r3, 0x1 + ands r3, r5 + cmp r3, 0 + beq _08050E70 + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] +_08050E70: + mov r4, r8 + ldrb r0, [r4, 0x5] + cmp r0, 0x2 + bne _08050E7E + cmp r3, 0 + bne _08050E7E + b _08050B68 +_08050E7E: + movs r0, 0 +_08050E80: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8050A1C + + thumb_func_start atk89_statbuffchange +atk89_statbuffchange: @ 8050EA0 + push {r4,r5,lr} + ldr r5, =0x02024214 + ldr r2, [r5] + ldrb r3, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r3, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r3, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r3, r0 + ldr r0, =0x02024474 + ldrb r4, [r0, 0x1A] + movs r0, 0xF0 + ands r0, r4 + lsls r0, 24 + asrs r0, 24 + movs r1, 0xF + ands r1, r4 + ldrb r2, [r2, 0x1] + bl sub_8050A1C + lsls r0, 24 + cmp r0, 0 + bne _08050EDC + ldr r0, [r5] + adds r0, 0x6 + str r0, [r5] +_08050EDC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk89_statbuffchange + + thumb_func_start atk8A_normalisebuffs +atk8A_normalisebuffs: @ 8050EEC + push {r4-r7,lr} + movs r2, 0 + ldr r0, =0x0202406c + ldrb r1, [r0] + ldr r0, =0x02024214 + mov r12, r0 + cmp r2, r1 + bge _08050F24 + ldr r0, =0x02024084 + movs r4, 0x6 + adds r5, r1, 0 + movs r7, 0x58 + adds r6, r0, 0 + adds r6, 0x18 +_08050F08: + adds r3, r2, 0x1 + movs r1, 0x7 + adds r0, r2, 0 + muls r0, r7 + adds r0, r6 + adds r0, 0x7 +_08050F14: + strb r4, [r0] + subs r0, 0x1 + subs r1, 0x1 + cmp r1, 0 + bge _08050F14 + adds r2, r3, 0 + cmp r2, r5 + blt _08050F08 +_08050F24: + mov r1, r12 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk8A_normalisebuffs + + thumb_func_start atk8B_setbide +atk8B_setbide: @ 8050F40 + push {r4,r5,lr} + ldr r4, =0x02024084 + ldr r3, =0x0202420b + ldrb r0, [r3] + movs r5, 0x58 + adds r2, r0, 0 + muls r2, r5 + adds r4, 0x50 + adds r2, r4 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 5 + orrs r0, r1 + str r0, [r2] + ldr r1, =0x02024268 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r1 + ldr r1, =0x020241ea + ldrh r1, [r1] + movs r2, 0 + strh r1, [r0] + ldr r1, =0x020241f8 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r1 + str r2, [r0] + ldrb r0, [r3] + adds r1, r0, 0 + muls r1, r5 + adds r1, r4 + ldr r0, [r1] + movs r2, 0x80 + lsls r2, 2 + orrs r0, r2 + str r0, [r1] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk8B_setbide + + thumb_func_start atk8C_confuseifrepeatingattackends +atk8C_confuseifrepeatingattackends: @ 8050FB0 + push {lr} + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0xC0 + lsls r1, 4 + ands r0, r1 + cmp r0, 0 + bne _08050FD2 + ldr r1, =0x02024332 + movs r0, 0x75 + strb r0, [r1, 0x3] +_08050FD2: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atk8C_confuseifrepeatingattackends + + thumb_func_start atk8D_setloopcounter +atk8D_setloopcounter: @ 8050FF0 + push {r4,r5,lr} + ldr r0, =0x02024214 + ldr r0, [r0] + ldrb r1, [r0, 0x1] + cmp r1, 0 + beq _0805100C + ldr r0, =0x02024212 + strb r1, [r0] + b _08051026 + .pool +_0805100C: + ldr r4, =0x02024212 + bl GenerateRandomNumber + movs r5, 0x3 + ands r0, r5 + strb r0, [r4] + cmp r0, 0x1 + bls _08051022 + bl GenerateRandomNumber + ands r0, r5 +_08051022: + adds r0, 0x2 + strb r0, [r4] +_08051026: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atk8D_setloopcounter + + thumb_func_start atk8E_cmd8e +atk8E_cmd8e: @ 805103C + ldr r1, =0x02024474 + movs r2, 0 + movs r0, 0xFD + strb r0, [r1, 0x8] + movs r0, 0x1 + strb r0, [r1, 0x9] + strb r0, [r1, 0xA] + strb r0, [r1, 0xB] + strb r2, [r1, 0xC] + movs r0, 0xFF + strb r0, [r1, 0xD] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end atk8E_cmd8e + + thumb_func_start sub_8051064 +sub_8051064: @ 8051064 + push {r4-r7,lr} + ldr r6, =0x02024084 + ldr r7, =0x0202420b + ldrb r0, [r7] + movs r5, 0x58 + adds r1, r0, 0 + muls r1, r5 + adds r1, r6 + adds r1, 0x2A + ldr r4, =0x0202420c + ldrb r3, [r4] + adds r0, r3, 0 + muls r0, r5 + adds r0, r6 + adds r0, 0x2A + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + bcc _080510AC + ldr r0, =0x0202449c + ldr r1, [r0] + adds r1, r3, r1 + adds r1, 0x58 + ldr r2, =0x0202406e + lsls r0, r3, 1 + b _08051108 + .pool +_080510AC: + bl GenerateRandomNumber + movs r3, 0xFF + ands r3, r0 + ldrb r0, [r7] + muls r0, r5 + adds r0, r6 + adds r0, 0x2A + ldrb r2, [r0] + ldrb r4, [r4] + adds r0, r4, 0 + muls r0, r5 + adds r0, r6 + adds r0, 0x2A + ldrb r1, [r0] + adds r2, r1 + adds r0, r3, 0 + muls r0, r2 + asrs r0, 8 + adds r0, 0x1 + lsrs r1, 2 + cmp r0, r1 + bhi _080510FC + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + movs r0, 0 + b _08051116 + .pool +_080510FC: + ldr r0, =0x0202449c + ldr r1, [r0] + adds r1, r4, r1 + adds r1, 0x58 + ldr r2, =0x0202406e + lsls r0, r4, 1 +_08051108: + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DADD8 + str r0, [r1] + movs r0, 0x1 +_08051116: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8051064 + + thumb_func_start sub_805112C +sub_805112C: @ 805112C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + movs r0, 0 + str r0, [sp, 0x4] + ldr r5, =0x02022fec + ldr r0, [r5] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0805114A + b _08051410 +_0805114A: + ldr r4, =0x0202420c + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x02024744 + str r1, [sp] + cmp r0, 0 + bne _08051160 + ldr r0, =0x020244ec + str r0, [sp] +_08051160: + ldr r2, [r5] + movs r1, 0x81 + lsls r1, 1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, r1 + beq _08051182 + ldr r1, =0x02000100 + adds r0, r2, 0 + ands r0, r1 + cmp r0, r1 + beq _08051182 + movs r0, 0x80 + lsls r0, 15 + ands r0, r2 + cmp r0, 0 + beq _080511C8 +_08051182: + ldr r2, =0x0202420c + ldrb r1, [r2] + movs r0, 0x2 + ands r0, r1 + adds r1, r2, 0 + cmp r0, 0 + beq _080511AC + movs r0, 0x3 + mov r9, r0 + movs r0, 0x6 + b _080511B2 + .pool +_080511AC: + movs r0, 0 + mov r9, r0 + movs r0, 0x3 +_080511B2: + mov r8, r0 + movs r0, 0x3 + mov r10, r0 + movs r0, 0x1 + str r0, [sp, 0x8] + ldr r2, =0x0202406e + ldrb r1, [r1] + b _0805128E + .pool +_080511C8: + movs r0, 0x42 + ands r0, r2 + cmp r0, 0x42 + beq _080511DA + ldr r1, =0x02000040 + adds r0, r2, 0 + ands r0, r1 + cmp r0, r1 + bne _0805121C +_080511DA: + ldrb r0, [r4] + bl sub_806D864 + lsls r0, 24 + lsrs r0, 24 + bl sub_806D82C + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _080511FC + movs r1, 0x3 + mov r9, r1 + movs r0, 0x6 + b _08051202 + .pool +_080511FC: + movs r1, 0 + mov r9, r1 + movs r0, 0x3 +_08051202: + mov r8, r0 + movs r1, 0x3 + mov r10, r1 + movs r0, 0x1 + str r0, [sp, 0x8] + ldr r2, =0x0202406e + ldr r0, =0x0202420c + ldrb r1, [r0] + b _0805128E + .pool +_0805121C: + movs r0, 0x80 + lsls r0, 8 + ands r0, r2 + cmp r0, 0 + beq _08051274 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08051240 + movs r1, 0 + mov r9, r1 + movs r0, 0x6 + mov r8, r0 + mov r10, r0 + movs r1, 0x2 + b _08051260 +_08051240: + ldrb r1, [r4] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08051252 + movs r0, 0x3 + mov r9, r0 + movs r1, 0x6 + b _08051258 +_08051252: + movs r0, 0 + mov r9, r0 + movs r1, 0x3 +_08051258: + mov r8, r1 + movs r0, 0x3 + mov r10, r0 + movs r1, 0x1 +_08051260: + str r1, [sp, 0x8] + ldr r2, =0x0202406e + ldr r0, =0x0202420c + ldrb r1, [r0] + b _0805128E + .pool +_08051274: + movs r0, 0x1 + ands r2, r0 + cmp r2, 0 + beq _080512A4 + movs r0, 0 + mov r9, r0 + movs r1, 0x6 + mov r8, r1 + mov r10, r1 + movs r0, 0x2 + str r0, [sp, 0x8] + ldr r2, =0x0202406e + ldrb r1, [r4] +_0805128E: + lsls r0, r1, 1 + adds r0, r2 + ldrh r7, [r0] + movs r0, 0x2 + eors r1, r0 + lsls r1, 1 + adds r1, r2 + ldrh r5, [r1] + b _080512BE + .pool +_080512A4: + movs r1, 0 + mov r9, r1 + movs r0, 0x6 + mov r8, r0 + mov r10, r0 + movs r1, 0x1 + str r1, [sp, 0x8] + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r5, [r0] + adds r7, r5, 0 +_080512BE: + mov r6, r9 + cmp r6, r8 + bge _080512FC +_080512C4: + movs r0, 0x64 + muls r0, r6 + ldr r1, [sp] + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _080512F6 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _080512F6 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _080512F6 + ldr r0, [sp, 0x4] + adds r0, 0x1 + str r0, [sp, 0x4] +_080512F6: + adds r6, 0x1 + cmp r6, r8 + blt _080512C4 +_080512FC: + ldr r1, [sp, 0x4] + ldr r0, [sp, 0x8] + cmp r1, r0 + bgt _08051328 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08051414 + .pool +_08051328: + bl sub_8051064 + lsls r0, 24 + cmp r0, 0 + beq _08051378 +_08051332: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + mov r1, r10 + bl __modsi3 + adds r6, r0, 0 + add r6, r9 + cmp r6, r7 + beq _08051332 + cmp r6, r5 + beq _08051332 + movs r0, 0x64 + muls r0, r6 + ldr r1, [sp] + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _08051332 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0x1 + beq _08051332 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08051332 +_08051378: + ldr r4, =0x0202420c + ldrb r0, [r4] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + adds r0, 0x5C + strb r6, [r0] + bl sub_81B1250 + lsls r0, 24 + cmp r0, 0 + bne _08051396 + ldrb r0, [r4] + bl sub_803BDA0 +_08051396: + ldr r0, =0x02022fec + ldr r2, [r0] + movs r1, 0x81 + lsls r1, 1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, r1 + beq _080513C0 + movs r0, 0x42 + ands r0, r2 + cmp r0, 0x42 + beq _080513C0 + ldr r1, =0x02000100 + adds r0, r2, 0 + ands r0, r1 + cmp r0, r1 + beq _080513C0 + ldr r0, =0x02000040 + ands r2, r0 + cmp r2, r0 + bne _080513DE +_080513C0: + ldr r5, =0x0202420c + ldrb r0, [r5] + lsls r4, r6, 24 + lsrs r4, 24 + adds r1, r4, 0 + movs r2, 0 + bl sub_81B8E80 + ldrb r1, [r5] + movs r0, 0x2 + eors r0, r1 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_81B8E80 +_080513DE: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _08051414 + ldr r0, =0x0202420c + ldrb r0, [r0] + lsls r1, r6, 24 + lsrs r1, 24 + bl sub_80571DC + b _08051414 + .pool +_08051410: + bl sub_8051064 +_08051414: + 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_805112C + + thumb_func_start sub_8051424 +sub_8051424: @ 8051424 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r6, 0 + ldr r2, =0x02024084 + ldr r3, =0x0202420b + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + adds r1, r2, 0 + adds r1, 0xC + adds r0, r1 + ldrh r0, [r0] + mov r8, r2 + cmp r0, 0 + beq _08051466 + movs r5, 0x58 + adds r2, r1, 0 +_0805144C: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bhi _08051466 + lsls r1, r6, 1 + ldrb r0, [r3] + muls r0, r5 + adds r1, r0 + adds r1, r2 + ldrh r0, [r1] + cmp r0, 0 + bne _0805144C +_08051466: + movs r3, 0 + cmp r3, r6 + bcs _080514E8 + ldr r0, =gBattleMoves + mov r10, r0 + ldr r5, =0x02024084 + mov r12, r5 + ldr r7, =0x0202420b + ldrb r0, [r7] + movs r4, 0x58 + adds r5, r0, 0 + muls r5, r4 + movs r0, 0xC + add r0, r12 + mov r9, r0 +_08051484: + lsls r0, r3, 1 + adds r0, r5 + add r0, r9 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldrb r2, [r0, 0x2] + cmp r2, 0x9 + bne _080514C6 + mov r0, r8 + adds r1, r5, r0 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x7 + beq _080514B2 + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x7 + bne _080514C4 +_080514B2: + movs r2, 0x7 + b _080514C6 + .pool +_080514C4: + movs r2, 0 +_080514C6: + ldrb r0, [r7] + muls r0, r4 + add r0, r12 + adds r1, r0, 0 + adds r1, 0x21 + ldrb r1, [r1] + cmp r2, r1 + beq _080514DE + adds r0, 0x22 + ldrb r0, [r0] + cmp r2, r0 + bne _080514E8 +_080514DE: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r6 + bcc _08051484 +_080514E8: + cmp r3, r6 + bne _0805150C + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _080515B0 + .pool +_0805150C: + movs r7, 0x3 + ldr r5, =gBattleMoves + mov r9, r5 +_08051512: + bl GenerateRandomNumber + adds r3, r0, 0 + ands r3, r7 + cmp r3, r6 + bcs _08051512 + ldr r4, =0x02024084 + lsls r1, r3, 1 + ldr r3, =0x0202420b + ldrb r2, [r3] + movs r0, 0x58 + adds r5, r2, 0 + muls r5, r0 + adds r1, r5 + adds r0, r4, 0 + adds r0, 0xC + adds r1, r0 + ldrh r1, [r1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + add r0, r9 + ldrb r2, [r0, 0x2] + mov r8, r4 + adds r4, r3, 0 + cmp r2, 0x9 + bne _08051572 + mov r0, r8 + adds r2, r5, r0 + adds r0, r2, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x7 + beq _08051560 + adds r0, r2, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x7 + bne _08051570 +_08051560: + movs r2, 0x7 + b _08051572 + .pool +_08051570: + movs r2, 0 +_08051572: + ldrb r0, [r4] + movs r3, 0x58 + muls r0, r3 + add r0, r8 + adds r1, r0, 0 + adds r1, 0x21 + ldrb r5, [r1] + cmp r2, r5 + beq _08051512 + adds r0, 0x22 + ldrb r0, [r0] + cmp r2, r0 + beq _08051512 + strb r2, [r1] + ldrb r0, [r4] + muls r0, r3 + add r0, r8 + adds r0, 0x22 + strb r2, [r0] + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x3 + strb r0, [r1, 0x1] + strb r2, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_080515B0: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8051424 + + thumb_func_start atk91_givemoney +atk91_givemoney: @ 80515C8 + push {r4,lr} + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x02000002 + ands r0, r1 + cmp r0, 0 + bne _08051650 + ldr r1, =0x0202432e + ldrh r0, [r1] + cmp r0, 0 + beq _08051650 + adds r1, r0, 0 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x4A + ldrb r0, [r0] + adds r4, r1, 0 + muls r4, r0 + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + adds r1, r4, 0 + bl add_money + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x1 + strb r0, [r1, 0x1] + movs r0, 0x2 + strb r0, [r1, 0x2] + movs r0, 0x5 + strb r0, [r1, 0x3] + strb r4, [r1, 0x4] + movs r0, 0xFF + lsls r0, 8 + ands r4, r0 + lsrs r4, 8 + strb r4, [r1, 0x5] + movs r0, 0xFF + strb r0, [r1, 0x6] + ldr r4, =0x02024214 + ldr r0, [r4] + adds r0, 0x1 + bl b_movescr_stack_push + ldr r0, =gUnknown_082DB307 + str r0, [r4] + b _08051658 + .pool +_08051650: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_08051658: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atk91_givemoney + + thumb_func_start atk92_setlightscreen +atk92_setlightscreen: @ 8051664 + push {r4-r6,lr} + ldr r5, =0x0202420b + ldrb r0, [r5] + bl battle_get_per_side_status + ldr r4, =0x0202428e + movs r6, 0x1 + adds r1, r6, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + ldrh r1, [r1] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080516A4 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0 + b _08051718 + .pool +_080516A4: + ldrb r0, [r5] + bl battle_get_per_side_status + adds r1, r6, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + ldrh r0, [r1] + movs r2, 0x2 + orrs r0, r2 + strh r0, [r1] + ldrb r0, [r5] + bl battle_get_per_side_status + ldr r4, =0x02024294 + adds r1, r6, 0 + ands r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x5 + strb r1, [r0, 0x2] + ldrb r0, [r5] + bl battle_get_per_side_status + adds r1, r6, 0 + ands r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r5] + strb r1, [r0, 0x3] + ldr r0, =0x02022fec + ldr r0, [r0] + ands r0, r6 + cmp r0, 0 + beq _08051714 + movs r0, 0x1 + bl sub_8069DEC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08051714 + ldr r1, =0x02024332 + movs r0, 0x4 + b _08051718 + .pool +_08051714: + ldr r1, =0x02024332 + movs r0, 0x3 +_08051718: + strb r0, [r1, 0x5] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atk92_setlightscreen + + thumb_func_start atk93_ko_move +atk93_ko_move: @ 8051730 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r7, =0x02024084 + ldr r6, =0x0202420c + ldrb r2, [r6] + movs r5, 0x58 + adds r0, r2, 0 + muls r0, r5 + adds r1, r0, r7 + ldrh r0, [r1, 0x2E] + cmp r0, 0xAF + bne _08051768 + ldr r1, =0x02024404 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r4, [r0, 0x7] + ldrb r6, [r0, 0x1A] + b _08051782 + .pool +_08051768: + ldrh r0, [r1, 0x2E] + bl itemid_get_x12 + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r0, [r6] + muls r0, r5 + adds r0, r7 + ldrh r0, [r0, 0x2E] + bl itemid_get_quality + lsls r0, 24 + lsrs r6, r0, 24 +_08051782: + ldr r1, =0x0202420f + ldr r5, =0x0202420c + ldrb r0, [r5] + strb r0, [r1] + cmp r4, 0x27 + bne _080517C0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r6 + bcs _080517C0 + ldrb r0, [r5] + movs r1, 0x27 + bl b_history__record_item_x12_of_player + ldr r2, =0x0202437c + ldrb r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] +_080517C0: + ldr r1, =0x02024084 + ldr r2, =0x0202420c + ldrb r3, [r2] + movs r6, 0x58 + adds r0, r3, 0 + muls r0, r6 + adds r5, r0, r1 + adds r0, r5, 0 + adds r0, 0x20 + ldrb r4, [r0] + mov r8, r1 + mov r9, r2 + cmp r4, 0x5 + bne _0805181C + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r0, =0x0202420a + strb r4, [r0] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB552 + str r0, [r1] + mov r1, r9 + ldrb r0, [r1] + movs r1, 0x5 + bl b_history__record_ability_usage_of_player + b _08051A70 + .pool +_0805181C: + ldr r1, =0x020242ac + lsls r0, r3, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x18 + ands r0, r1 + cmp r0, 0 + bne _080518A0 + ldr r1, =gBattleMoves + ldr r0, =0x020241ea + ldrh r0, [r0] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + ldr r7, =0x0202420b + ldrb r0, [r7] + muls r0, r6 + add r0, r8 + adds r0, 0x2A + ldrb r0, [r0] + adds r1, r5, 0 + adds r1, 0x2A + ldrb r1, [r1] + subs r0, r1 + ldrb r2, [r2, 0x3] + adds r0, r2 + lsls r0, 16 + lsrs r4, r0, 16 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r0, 0x1 + cmp r0, r4 + blt _08051870 + b _08051A08 +_08051870: + ldrb r0, [r7] + adds r1, r0, 0 + muls r1, r6 + add r1, r8 + adds r1, 0x2A + mov r2, r9 + ldrb r0, [r2] + muls r0, r6 + add r0, r8 + adds r0, 0x2A + ldrb r1, [r1] + movs r4, 0x1 + ldrb r0, [r0] + cmp r1, r0 + bcs _08051936 + b _08051A08 + .pool +_080518A0: + ldr r1, =0x020242bc + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldr r1, =0x0202420b + ldrb r0, [r0, 0x15] + adds r7, r1, 0 + ldrb r3, [r7] + cmp r0, r3 + bne _080518CA + ldrb r0, [r7] + muls r0, r6 + add r0, r8 + adds r0, 0x2A + adds r1, r5, 0 + adds r1, 0x2A + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bcs _08051942 +_080518CA: + ldr r1, =gBattleMoves + ldr r0, =0x020241ea + ldrh r0, [r0] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + ldr r6, =0x02024084 + ldrb r0, [r7] + movs r5, 0x58 + muls r0, r5 + adds r0, r6 + adds r0, 0x2A + ldrb r1, [r0] + ldr r0, =0x0202420c + mov r8, r0 + ldrb r0, [r0] + muls r0, r5 + adds r0, r6 + adds r0, 0x2A + ldrb r0, [r0] + subs r1, r0 + ldrb r2, [r2, 0x3] + adds r1, r2 + lsls r1, 16 + lsrs r4, r1, 16 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r0, 0x1 + cmp r0, r4 + bge _08051934 + ldrb r0, [r7] + adds r1, r0, 0 + muls r1, r5 + adds r1, r6 + adds r1, 0x2A + mov r2, r8 + ldrb r0, [r2] + muls r0, r5 + adds r0, r6 + adds r0, 0x2A + ldrb r1, [r1] + movs r4, 0x1 + ldrb r0, [r0] + cmp r1, r0 + bcs _08051936 +_08051934: + movs r4, 0 +_08051936: + ldr r3, =0x02024084 + mov r8, r3 + ldr r0, =0x0202420c + mov r9, r0 + cmp r4, 0 + beq _08051A08 +_08051942: + ldr r0, =0x0202433c + mov r1, r9 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 30 + cmp r0, 0 + bge _08051990 + ldr r1, =0x020241f0 + movs r0, 0x58 + muls r0, r2 + add r0, r8 + ldrh r0, [r0, 0x28] + subs r0, 0x1 + str r0, [r1] + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x40 + b _080519EE + .pool +_08051990: + ldr r0, =0x0202437c + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1] + lsrs r0, 7 + cmp r0, 0 + beq _080519DC + ldr r1, =0x020241f0 + movs r3, 0x58 + adds r0, r2, 0 + muls r0, r3 + add r0, r8 + ldrh r0, [r0, 0x28] + subs r0, 0x1 + str r0, [r1] + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024208 + mov r2, r9 + ldrb r0, [r2] + muls r0, r3 + add r0, r8 + ldrh r0, [r0, 0x2E] + strh r0, [r1] + b _080519F2 + .pool +_080519DC: + ldr r1, =0x020241f0 + movs r0, 0x58 + muls r0, r2 + add r0, r8 + ldrh r0, [r0, 0x28] + str r0, [r1] + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x10 +_080519EE: + orrs r0, r1 + strb r0, [r2] +_080519F2: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08051A70 + .pool +_08051A08: + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r3, =0x02024084 + ldr r0, =0x0202420b + ldrb r0, [r0] + movs r2, 0x58 + adds r1, r0, 0 + muls r1, r2 + adds r1, r3 + adds r1, 0x2A + ldr r0, =0x0202420c + ldrb r0, [r0] + muls r0, r2 + adds r0, r3 + adds r0, 0x2A + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + bcc _08051A50 + ldr r1, =0x02024332 + movs r0, 0 + b _08051A54 + .pool +_08051A50: + ldr r1, =0x02024332 + movs r0, 0x1 +_08051A54: + strb r0, [r1, 0x5] + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08051A70: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk93_ko_move + + thumb_func_start atk94_gethalfcurrentenemyhp +atk94_gethalfcurrentenemyhp: @ 8051A84 + push {lr} + ldr r3, =0x020241f0 + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x28] + lsrs r0, 1 + str r0, [r3] + cmp r0, 0 + bne _08051AA2 + movs r0, 0x1 + str r0, [r3] +_08051AA2: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atk94_gethalfcurrentenemyhp + + thumb_func_start sub_8051AC0 +sub_8051AC0: @ 8051AC0 + push {lr} + ldr r2, =0x020243cc + ldrh r1, [r2] + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + beq _08051AEC + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1, 0x5] + b _08051AFE + .pool +_08051AEC: + movs r0, 0x8 + strh r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x3 + strb r0, [r1, 0x5] + ldr r0, =0x020243d0 + adds r0, 0x28 + movs r1, 0x5 + strb r1, [r0] +_08051AFE: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8051AC0 + + thumb_func_start sub_8051B18 +sub_8051B18: @ 8051B18 + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08051B36 + b _08051C48 +_08051B36: + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _08051B4C + b _08051C48 +_08051B4C: + ldr r2, =0x020243cc + ldrh r1, [r2] + movs r0, 0x18 + ands r0, r1 + adds r4, r2, 0 + ldr r5, =0x0202420b + cmp r0, 0 + beq _08051BDA + ldr r0, =0x02024084 + ldrb r2, [r5] + movs r1, 0x58 + muls r1, r2 + adds r3, r1, r0 + adds r0, r3, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x5 + beq _08051BD4 + cmp r0, 0x8 + beq _08051BD4 + cmp r0, 0x4 + beq _08051BD4 + adds r0, r3, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x5 + beq _08051BD4 + cmp r0, 0x8 + beq _08051BD4 + cmp r0, 0x4 + beq _08051BD4 + adds r0, r3, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x8 + beq _08051BD4 + ldr r0, =0x020242ac + lsls r1, r2, 2 + adds r1, r0 + ldr r1, [r1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08051BD4 + movs r0, 0x80 + lsls r0, 11 + ands r1, r0 + cmp r1, 0 + bne _08051BD4 + ldr r1, =0x020241f0 + ldrh r0, [r3, 0x2C] + lsrs r0, 4 + str r0, [r1] + cmp r0, 0 + bne _08051BDA + movs r0, 0x1 + b _08051BD8 + .pool +_08051BD4: + ldr r1, =0x020241f0 + movs r0, 0 +_08051BD8: + str r0, [r1] +_08051BDA: + ldrh r1, [r4] + movs r4, 0x80 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _08051C50 + ldr r1, =0x02024084 + ldrb r3, [r5] + movs r0, 0x58 + muls r0, r3 + adds r2, r0, r1 + adds r0, r2, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0xF + beq _08051C3C + adds r0, r2, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0xF + beq _08051C3C + ldr r0, =0x020242ac + lsls r1, r3, 2 + adds r1, r0 + ldr r1, [r1] + adds r0, r1, 0 + ands r0, r4 + cmp r0, 0 + bne _08051C3C + movs r0, 0x80 + lsls r0, 11 + ands r1, r0 + cmp r1, 0 + bne _08051C3C + ldr r1, =0x020241f0 + ldrh r0, [r2, 0x2C] + lsrs r0, 4 + str r0, [r1] + cmp r0, 0 + bne _08051C50 + movs r0, 0x1 + str r0, [r1] + b _08051C50 + .pool +_08051C3C: + ldr r1, =0x020241f0 + movs r0, 0 + str r0, [r1] + b _08051C50 + .pool +_08051C48: + ldr r1, =0x020241f0 + movs r0, 0 + str r0, [r1] + ldr r5, =0x0202420b +_08051C50: + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08051C6A + ldr r1, =0x020241f0 + movs r0, 0 + str r0, [r1] +_08051C6A: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8051B18 + + thumb_func_start atk97_tryinfatuatetarget +atk97_tryinfatuatetarget: @ 8051C90 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, =0x0202420b + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08051CC8 + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + b _08051CD8 + .pool +_08051CC8: + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 +_08051CD8: + adds r5, r1, r0 + ldr r4, =0x0202420c + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08051D0C + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + b _08051D1C + .pool +_08051D0C: + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 +_08051D1C: + adds r4, r1, r0 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + adds r0, r5, 0 + movs r1, 0 + bl pokemon_getattr + mov r9, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + adds r7, r0, 0 + ldr r5, =0x0202420c + ldrb r0, [r5] + movs r6, 0x58 + muls r0, r6 + ldr r1, =0x02024084 + adds r0, r1 + adds r0, 0x20 + ldrb r2, [r0] + cmp r2, 0xC + bne _08051D94 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB5F5 + str r0, [r1] + ldr r0, =0x0202420a + strb r2, [r0] + ldrb r0, [r5] + movs r1, 0xC + bl b_history__record_ability_usage_of_player + b _08051E2C + .pool +_08051D94: + mov r0, r10 + mov r1, r9 + bl pokemon_species_get_gender_info + adds r4, r0, 0 + mov r0, r8 + adds r1, r7, 0 + bl pokemon_species_get_gender_info + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _08051DE4 + ldrb r0, [r5] + muls r0, r6 + ldr r4, =0x02024084 + adds r4, 0x50 + adds r0, r4 + ldr r0, [r0] + movs r1, 0xF0 + lsls r1, 12 + ands r0, r1 + cmp r0, 0 + bne _08051DE4 + mov r0, r10 + mov r1, r9 + bl pokemon_species_get_gender_info + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _08051DE4 + mov r0, r8 + adds r1, r7, 0 + bl pokemon_species_get_gender_info + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _08051E08 +_08051DE4: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08051E2C + .pool +_08051E08: + ldrb r0, [r5] + adds r2, r0, 0 + muls r2, r6 + adds r2, r4 + ldr r1, =gUnknown_0832A328 + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + lsls r1, 16 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08051E2C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk97_tryinfatuatetarget + + thumb_func_start sub_8051E48 +sub_8051E48: @ 8051E48 + push {r4-r7,lr} + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + bne _08051F34 + ldr r5, =0x02024214 + ldr r1, [r5] + ldrb r0, [r1, 0x1] + cmp r0, 0x4 + beq _08051EA0 + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + ldr r3, =0x02024084 + ldrb r1, [r4] + movs r0, 0x58 + adds r2, r1, 0 + muls r2, r0 + adds r0, r3, 0 + adds r0, 0x4C + adds r0, r2, r0 + ldr r1, [r0] + adds r3, 0x50 + adds r2, r3 + ldr r2, [r2] + movs r0, 0 + bl dp01_build_cmdbuf_x1A_aaaa_bbbb + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] + b _08051F34 + .pool +_08051EA0: + ldr r4, =0x02024064 + ldr r5, =0x0202420b + ldrb r0, [r5] + strb r0, [r4] + ldr r6, =0x02024210 + ldrb r1, [r6] + ldr r7, =gUnknown_0832A328 + ldrb r2, [r4] + lsls r0, r2, 2 + adds r0, r7 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08051EDC + ldr r3, =0x02024084 + movs r0, 0x58 + muls r2, r0 + adds r0, r3, 0 + adds r0, 0x4C + adds r0, r2, r0 + ldr r1, [r0] + adds r3, 0x50 + adds r2, r3 + ldr r2, [r2] + movs r0, 0 + bl dp01_build_cmdbuf_x1A_aaaa_bbbb + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_08051EDC: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08051F2C + ldrb r0, [r5] + bl battle_get_per_side_status + movs r1, 0x2 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + strb r0, [r4] + ldrb r1, [r6] + ldrb r2, [r4] + lsls r0, r2, 2 + adds r0, r7 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08051F2C + ldr r3, =0x02024084 + movs r0, 0x58 + muls r2, r0 + adds r0, r3, 0 + adds r0, 0x4C + adds r0, r2, r0 + ldr r1, [r0] + adds r3, 0x50 + adds r2, r3 + ldr r2, [r2] + movs r0, 0 + bl dp01_build_cmdbuf_x1A_aaaa_bbbb + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_08051F2C: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x2 + str r0, [r1] +_08051F34: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8051E48 + + thumb_func_start atk99_setmisteffect +atk99_setmisteffect: @ 8051F58 + push {r4-r6,lr} + ldr r6, =0x02024294 + ldr r4, =0x0202420b + ldrb r0, [r4] + bl battle_get_per_side_status + movs r5, 0x1 + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _08051F98 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2] + ldr r0, =0x02024332 + strb r5, [r0, 0x5] + b _08051FE6 + .pool +_08051F98: + ldrb r0, [r4] + bl battle_get_per_side_status + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x5 + strb r1, [r0, 0x4] + ldrb r0, [r4] + bl battle_get_per_side_status + adds r1, r5, 0 + ands r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r4] + strb r1, [r0, 0x5] + ldrb r0, [r4] + bl battle_get_per_side_status + ldr r2, =0x0202428e + adds r1, r5, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + movs r3, 0 + orrs r0, r2 + strh r0, [r1] + ldr r0, =0x02024332 + strb r3, [r0, 0x5] +_08051FE6: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atk99_setmisteffect + + thumb_func_start atk9A_setincreasedcriticalchance +atk9A_setincreasedcriticalchance: @ 8052000 + push {lr} + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r1, [r0] + movs r3, 0x80 + lsls r3, 13 + adds r2, r1, 0 + ands r2, r3 + cmp r2, 0 + beq _08052040 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _08052048 + .pool +_08052040: + orrs r1, r3 + str r1, [r0] + ldr r0, =0x02024332 + strb r2, [r0, 0x5] +_08052048: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atk9A_setincreasedcriticalchance + + thumb_func_start atk9B_transformdataexecution +atk9B_transformdataexecution: @ 805205C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r1, =0x020241ec + ldr r2, =0x0000ffff + adds r0, r2, 0 + strh r0, [r1] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r7, =0x02024084 + ldr r0, =0x0202420c + mov r12, r0 + ldrb r1, [r0] + movs r6, 0x58 + adds r0, r1, 0 + muls r0, r6 + adds r5, r7, 0 + adds r5, 0x50 + adds r0, r5 + ldr r0, [r0] + movs r4, 0x80 + lsls r4, 14 + ands r0, r4 + cmp r0, 0 + bne _080520A2 + ldr r0, =0x020242ac + lsls r1, 2 + adds r1, r0 + ldr r2, [r1] + ldr r0, =0x000400c0 + ands r2, r0 + cmp r2, 0 + beq _080520D8 +_080520A2: + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x1 + b _080521EC + .pool +_080520D8: + ldr r3, =0x0202420b + ldrb r0, [r3] + adds r1, r0, 0 + muls r1, r6 + adds r1, r5 + ldr r0, [r1] + orrs r0, r4 + str r0, [r1] + ldr r4, =0x020242bc + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r4 + strh r2, [r0, 0x4] + ldrb r0, [r3] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r1, 0xB] + movs r0, 0x10 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0xB] + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r4 + mov r2, r12 + ldrb r1, [r2] + muls r1, r6 + adds r2, r7, 0 + adds r2, 0x48 + adds r1, r2 + ldr r1, [r1] + str r1, [r0] + ldrb r0, [r3] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r1, 0x18] + movs r0, 0xF + ands r0, r2 + strb r0, [r1, 0x18] + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x6 + strb r0, [r1, 0x1] + mov r2, r12 + ldrb r0, [r2] + muls r0, r6 + adds r0, r7 + ldrh r0, [r0] + strb r0, [r1, 0x2] + ldrb r0, [r2] + muls r0, r6 + adds r0, r7 + ldrh r0, [r0] + lsrs r0, 8 + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldrb r0, [r3] + muls r0, r6 + adds r5, r0, r7 + ldrb r0, [r2] + muls r0, r6 + adds r2, r0, r7 + movs r4, 0 + adds r6, r3, 0 + ldr r0, =0x02024064 + mov r8, r0 +_08052170: + adds r0, r5, r4 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x23 + bls _08052170 + movs r4, 0 + ldr r7, =gBattleMoves + ldr r3, =0x02024090 + adds r5, r3, 0 + adds r5, 0x18 +_08052188: + lsls r1, r4, 1 + ldrb r2, [r6] + movs r0, 0x58 + muls r2, r0 + adds r1, r2 + adds r1, r3 + ldrh r1, [r1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldrb r1, [r0, 0x4] + cmp r1, 0x4 + bhi _080521C4 + adds r0, r4, r2 + adds r0, r5 + b _080521CA + .pool +_080521C4: + adds r0, r4, r2 + adds r0, r5 + movs r1, 0x5 +_080521CA: + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x3 + ble _08052188 + ldrb r0, [r6] + mov r1, r8 + strb r0, [r1] + movs r0, 0 + movs r1, 0x2 + bl dp01_build_cmdbuf_x38_a + mov r2, r8 + ldrb r0, [r2] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024332 + movs r0, 0 +_080521EC: + strb r0, [r1, 0x5] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atk9B_transformdataexecution + + thumb_func_start sub_80521FC +sub_80521FC: @ 80521FC + push {r4-r7,lr} + ldr r7, =0x02024084 + ldr r6, =0x0202420b + ldrb r0, [r6] + movs r5, 0x58 + muls r0, r5 + adds r3, r0, r7 + ldrh r0, [r3, 0x2C] + lsrs r1, r0, 2 + adds r2, r1, 0 + cmp r1, 0 + bne _08052216 + movs r2, 0x1 +_08052216: + ldrh r0, [r3, 0x28] + cmp r0, r2 + bhi _0805223C + ldr r1, =0x020241f0 + movs r0, 0 + str r0, [r1] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _08052290 + .pool +_0805223C: + ldr r4, =0x020241f0 + str r1, [r4] + cmp r1, 0 + bne _08052248 + movs r0, 0x1 + str r0, [r4] +_08052248: + ldrb r0, [r6] + adds r2, r0, 0 + muls r2, r5 + adds r3, r7, 0 + adds r3, 0x50 + adds r2, r3 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 17 + orrs r0, r1 + str r0, [r2] + ldrb r0, [r6] + adds r1, r0, 0 + muls r1, r5 + adds r1, r3 + ldr r0, [r1] + ldr r2, =0xffff1fff + ands r0, r2 + str r0, [r1] + ldr r2, =0x020242bc + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, [r4] + movs r2, 0 + strb r1, [r0, 0xA] + ldr r0, =0x02024332 + strb r2, [r0, 0x5] + ldr r2, =0x02024280 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 1 + orrs r0, r1 + str r0, [r2] +_08052290: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80521FC + + thumb_func_start sub_80522B8 +sub_80522B8: @ 80522B8 + push {r4,r5,lr} + lsls r0, 16 + lsrs r2, r0, 16 + movs r3, 0 + ldr r0, =gUnknown_0831C3E0 + ldrh r1, [r0] + ldr r4, =0x0000fffe + adds r5, r0, 0 + cmp r1, r4 + beq _080522E0 + cmp r1, r2 + beq _080522E0 + adds r1, r5, 0 +_080522D2: + adds r1, 0x2 + adds r3, 0x1 + ldrh r0, [r1] + cmp r0, r4 + beq _080522E0 + cmp r0, r2 + bne _080522D2 +_080522E0: + lsls r0, r3, 1 + adds r0, r5 + ldrh r1, [r0] + ldr r0, =0x0000fffe + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80522B8 + + thumb_func_start atk9D_copyattack +atk9D_copyattack: @ 8052300 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x020241ec + ldr r1, =0x0000ffff + adds r7, r1, 0 + strh r7, [r0] + ldr r5, =0x02024248 + ldr r6, =0x0202420c + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + bl sub_80522B8 + lsls r0, 24 + cmp r0, 0 + bne _0805235A + ldr r3, =0x02024084 + ldr r2, =0x0202420b + ldrb r1, [r2] + movs r0, 0x58 + adds r4, r1, 0 + muls r4, r0 + adds r0, r3, 0 + adds r0, 0x50 + adds r0, r4, r0 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 14 + ands r1, r0 + mov r12, r3 + mov r9, r2 + cmp r1, 0 + bne _0805235A + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + cmp r1, 0 + beq _0805235A + cmp r1, r7 + bne _08052394 +_0805235A: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _080524CC + .pool +_08052394: + movs r2, 0 + mov r3, r12 + adds r3, 0xC + adds r0, r4, r3 + ldrh r0, [r0] + ldr r4, =0x02024214 + mov r10, r4 + cmp r0, r1 + beq _080523CE + mov r8, r3 + adds r7, r5, 0 + adds r5, r6, 0 + mov r4, r9 + movs r3, 0x58 +_080523B0: + adds r2, 0x1 + cmp r2, 0x3 + bgt _080523CE + lsls r1, r2, 1 + ldrb r0, [r4] + muls r0, r3 + adds r1, r0 + add r1, r8 + ldrb r0, [r5] + lsls r0, 1 + adds r0, r7 + ldrh r1, [r1] + ldrh r0, [r0] + cmp r1, r0 + bne _080523B0 +_080523CE: + cmp r2, 0x4 + bne _080524B0 + ldr r5, =0x020241e8 + ldrb r1, [r5] + lsls r1, 1 + mov r2, r9 + ldrb r0, [r2] + movs r6, 0x58 + muls r0, r6 + adds r1, r0 + mov r0, r12 + adds r0, 0xC + adds r1, r0 + ldr r2, =0x02024248 + ldr r3, =0x0202420c + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + ldr r4, =gBattleMoves + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r4, [r0, 0x4] + cmp r4, 0x4 + bhi _08052438 + mov r1, r9 + ldrb r0, [r1] + muls r0, r6 + ldrb r1, [r5] + adds r0, r1 + mov r1, r12 + adds r1, 0x24 + adds r0, r1 + strb r4, [r0] + b _0805244C + .pool +_08052438: + mov r4, r9 + ldrb r0, [r4] + muls r0, r6 + ldrb r1, [r5] + adds r0, r1 + mov r1, r12 + adds r1, 0x24 + adds r0, r1 + movs r1, 0x5 + strb r1, [r0] +_0805244C: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1, 0x2] + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + lsrs r0, 8 + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x020242bc + mov r2, r9 + ldrb r0, [r2] + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 2 + adds r2, r1 + ldrb r4, [r2, 0x18] + lsrs r3, r4, 4 + ldr r1, =gUnknown_0832A328 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + orrs r1, r3 + lsls r1, 4 + movs r0, 0xF + ands r0, r4 + orrs r0, r1 + strb r0, [r2, 0x18] + mov r4, r10 + ldr r0, [r4] + adds r0, 0x5 + str r0, [r4] + b _080524CC + .pool +_080524B0: + mov r0, r10 + ldr r2, [r0] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + mov r2, r10 + str r1, [r2] +_080524CC: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end atk9D_copyattack + + thumb_func_start sub_80524DC +sub_80524DC: @ 80524DC + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r7, =0x020241ea + movs r6, 0xB1 + lsls r6, 1 + ldr r5, =gUnknown_0831C3E0 + ldr r0, =0x02024214 + mov r8, r0 +_080524EE: + bl GenerateRandomNumber + ldr r2, =0x000001ff + adds r1, r2, 0 + ands r0, r1 + adds r0, 0x1 + strh r0, [r7] + cmp r0, r6 + bhi _080524EE + movs r0, 0x3 +_08052502: + subs r0, 0x1 + cmp r0, 0 + bge _08052502 + ldr r4, =0x020241ea + ldrh r2, [r4] + ldr r3, =0x0000ffff + subs r0, r5, 0x2 +_08052510: + adds r0, 0x2 + ldrh r1, [r0] + cmp r1, r2 + beq _0805251C + cmp r1, r3 + bne _08052510 +_0805251C: + ldr r0, =0x0000ffff + cmp r1, r0 + bne _080524EE + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xfffffbff + ands r0, r1 + str r0, [r2] + ldr r3, =gUnknown_082D86A8 + ldr r2, =gBattleMoves + ldrh r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + mov r1, r8 + str r0, [r1] + ldrh r0, [r4] + movs r1, 0 + bl sub_80458E0 + ldr r1, =0x0202420c + strb r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80524DC + + thumb_func_start atk9F_nightshadedamageeffect +atk9F_nightshadedamageeffect: @ 8052584 + ldr r3, =0x020241f0 + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x2A + ldrb r0, [r0] + str r0, [r3] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end atk9F_nightshadedamageeffect + + thumb_func_start atkA0_psywavedamageeffect +atkA0_psywavedamageeffect: @ 80525B4 + push {r4,lr} + movs r4, 0xF +_080525B8: + bl GenerateRandomNumber + adds r3, r4, 0 + ands r3, r0 + cmp r3, 0xA + bgt _080525B8 + lsls r0, r3, 2 + adds r0, r3 + lsls r3, r0, 1 + ldr r4, =0x020241f0 + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x2A + ldrb r1, [r0] + adds r0, r3, 0 + adds r0, 0x32 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + str r0, [r4] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkA0_psywavedamageeffect + + thumb_func_start atkA1_counterdamagecalculator +atkA1_counterdamagecalculator: @ 8052608 + push {r4-r6,lr} + ldr r4, =0x0202420b + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, =0x0202433c + ldrb r0, [r4] + lsls r0, 4 + adds r0, r5 + ldrb r0, [r0, 0xC] + bl battle_side_get_owner + lsls r0, 24 + lsrs r2, r0, 24 + ldrb r0, [r4] + lsls r1, r0, 4 + adds r0, r5, 0x4 + adds r0, r1, r0 + ldr r3, [r0] + cmp r3, 0 + beq _080526BC + cmp r6, r2 + beq _080526BC + ldr r6, =0x02024084 + adds r0, r1, r5 + ldrb r0, [r0, 0xC] + movs r4, 0x58 + muls r0, r4 + adds r0, r6 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _080526BC + ldr r1, =0x020241f0 + lsls r0, r3, 1 + str r0, [r1] + ldr r1, =0x02024294 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r1 + ldrb r0, [r1, 0x8] + cmp r0, 0 + beq _08052690 + ldrb r1, [r1, 0x9] + adds r0, r1, 0 + muls r0, r4 + adds r0, r6 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08052690 + ldr r0, =0x0202420c + strb r1, [r0] + b _080526A0 + .pool +_08052690: + ldr r2, =0x0202420c + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0xC] + strb r0, [r2] +_080526A0: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _080526EC + .pool +_080526BC: + ldr r2, =0x0202437c + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0] + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_080526EC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atkA1_counterdamagecalculator + + thumb_func_start atkA2_mirrorcoatdamagecalculator +atkA2_mirrorcoatdamagecalculator: @ 8052700 + push {r4-r6,lr} + ldr r4, =0x0202420b + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, =0x0202433c + ldrb r0, [r4] + lsls r0, 4 + adds r0, r5 + ldrb r0, [r0, 0xD] + bl battle_side_get_owner + lsls r0, 24 + lsrs r2, r0, 24 + ldrb r0, [r4] + lsls r1, r0, 4 + adds r0, r5, 0 + adds r0, 0x8 + adds r0, r1, r0 + ldr r3, [r0] + cmp r3, 0 + beq _080527B4 + cmp r6, r2 + beq _080527B4 + ldr r6, =0x02024084 + adds r0, r1, r5 + ldrb r0, [r0, 0xD] + movs r4, 0x58 + muls r0, r4 + adds r0, r6 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _080527B4 + ldr r1, =0x020241f0 + lsls r0, r3, 1 + str r0, [r1] + ldr r1, =0x02024294 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r1 + ldrb r0, [r1, 0x8] + cmp r0, 0 + beq _08052788 + ldrb r1, [r1, 0x9] + adds r0, r1, 0 + muls r0, r4 + adds r0, r6 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08052788 + ldr r0, =0x0202420c + strb r1, [r0] + b _08052798 + .pool +_08052788: + ldr r2, =0x0202420c + ldr r1, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0, 0xD] + strb r0, [r2] +_08052798: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _080527E4 + .pool +_080527B4: + ldr r2, =0x0202437c + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0] + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_080527E4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atkA2_mirrorcoatdamagecalculator + + thumb_func_start atkA3_disablelastusedattack +atkA3_disablelastusedattack: @ 80527F8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r4, 0 + ldr r2, =0x02024084 + ldr r3, =0x0202420c + ldrb r1, [r3] + movs r0, 0x58 + muls r0, r1 + adds r7, r2, 0 + adds r7, 0xC + adds r0, r7 + ldr r5, =0x02024248 + lsls r1, 1 + adds r1, r5 + ldrh r0, [r0] + mov r9, r2 + adds r6, r3, 0 + ldr r2, =0x020242bc + mov r8, r2 + ldrh r1, [r1] + cmp r0, r1 + beq _0805284C + mov r12, r6 + movs r3, 0x58 +_0805282C: + adds r4, 0x1 + cmp r4, 0x3 + bgt _0805284C + lsls r2, r4, 1 + mov r0, r12 + ldrb r1, [r0] + adds r0, r1, 0 + muls r0, r3 + adds r2, r0 + adds r2, r7 + lsls r1, 1 + adds r1, r5 + ldrh r0, [r2] + ldrh r1, [r1] + cmp r0, r1 + bne _0805282C +_0805284C: + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r8 + ldrh r0, [r0, 0x4] + cmp r0, 0 + bne _08052910 + cmp r4, 0x4 + beq _08052910 + movs r5, 0x58 + adds r0, r1, 0 + muls r0, r5 + adds r0, r4, r0 + mov r1, r9 + adds r1, 0x24 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08052910 + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + lsls r2, r4, 1 + ldrb r0, [r6] + muls r0, r5 + adds r0, r2, r0 + mov r3, r9 + adds r3, 0xC + adds r0, r3 + ldrh r0, [r0] + strb r0, [r1, 0x2] + ldrb r0, [r6] + muls r0, r5 + adds r0, r2, r0 + adds r0, r3 + ldrh r0, [r0] + lsrs r0, 8 + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r8 + muls r1, r5 + adds r2, r1 + adds r2, r3 + ldrh r1, [r2] + strh r1, [r0, 0x4] + bl GenerateRandomNumber + ldrb r2, [r6] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + add r1, r8 + movs r2, 0x3 + ands r2, r0 + adds r2, 0x2 + ldrb r3, [r1, 0xB] + movs r0, 0x10 + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0xB] + ldrb r0, [r6] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + add r1, r8 + ldrb r3, [r1, 0xB] + lsls r2, r3, 28 + lsrs r2, 24 + movs r0, 0xF + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0xB] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _0805292A + .pool +_08052910: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_0805292A: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkA3_disablelastusedattack + + thumb_func_start atkA4_setencore +atkA4_setencore: @ 805293C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r5, 0 + ldr r3, =0x02024084 + ldr r4, =0x0202420c + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + adds r6, r3, 0 + adds r6, 0xC + adds r0, r6 + ldr r2, =0x02024248 + lsls r1, 1 + adds r1, r2 + ldrh r0, [r0] + mov r10, r3 + mov r8, r2 + ldr r2, =0x020242bc + mov r9, r2 + ldrh r1, [r1] + cmp r0, r1 + beq _08052996 + mov r12, r4 + adds r7, r6, 0 + mov r6, r8 + movs r3, 0x58 +_08052976: + adds r5, 0x1 + cmp r5, 0x3 + bgt _08052996 + lsls r2, r5, 1 + mov r0, r12 + ldrb r1, [r0] + adds r0, r1, 0 + muls r0, r3 + adds r2, r0 + adds r2, r7 + lsls r1, 1 + adds r1, r6 + ldrh r0, [r2] + ldrh r1, [r1] + cmp r0, r1 + bne _08052976 +_08052996: + ldrb r0, [r4] + lsls r0, 1 + add r0, r8 + ldrh r2, [r0] + cmp r2, 0xA5 + beq _080529AA + cmp r2, 0xE3 + beq _080529AA + cmp r2, 0x77 + bne _080529AC +_080529AA: + movs r5, 0x4 +_080529AC: + ldrb r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + mov r2, r9 + adds r3, r0, r2 + ldrh r0, [r3, 0x6] + cmp r0, 0 + bne _08052A44 + cmp r5, 0x4 + beq _08052A44 + movs r0, 0x58 + adds r2, r1, 0 + muls r2, r0 + adds r0, r5, r2 + mov r1, r10 + adds r1, 0x24 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08052A44 + lsls r0, r5, 1 + adds r0, r2 + subs r1, 0x18 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r3, 0x6] + ldrb r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r9 + strb r5, [r0, 0xC] + bl GenerateRandomNumber + ldrb r2, [r4] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + add r1, r9 + movs r2, 0x3 + ands r2, r0 + adds r2, 0x3 + ldrb r3, [r1, 0xE] + movs r0, 0x10 + negs r0, r0 + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0xE] + ldrb r0, [r4] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + add r1, r9 + ldrb r3, [r1, 0xE] + lsls r2, r3, 28 + lsrs r2, 24 + movs r0, 0xF + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0xE] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08052A5E + .pool +_08052A44: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08052A5E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkA4_setencore + + thumb_func_start sub_8052A70 +sub_8052A70: @ 8052A70 + push {r4-r7,lr} + ldr r6, =0x02024084 + ldr r0, =0x0202420c + mov r12, r0 + ldrb r0, [r0] + movs r7, 0x58 + adds r2, r0, 0 + muls r2, r7 + adds r0, r6, 0 + adds r0, 0x50 + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _08052B10 + ldr r5, =0x0202420b + ldrb r0, [r5] + muls r0, r7 + adds r0, r6 + ldrh r3, [r0, 0x28] + adds r0, r2, r6 + ldrh r1, [r0, 0x28] + adds r3, r1 + asrs r3, 1 + ldr r4, =0x020241f0 + subs r1, r3 + str r1, [r4] + ldr r2, =0x02024474 + strb r1, [r2] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + asrs r0, 8 + strb r0, [r2, 0x1] + movs r0, 0xFF + lsls r0, 16 + ands r0, r1 + asrs r0, 16 + strb r0, [r2, 0x2] + lsrs r1, 24 + strb r1, [r2, 0x3] + ldrb r0, [r5] + muls r0, r7 + adds r0, r6 + ldrh r0, [r0, 0x28] + subs r0, r3 + str r0, [r4] + ldr r2, =0x0202437c + mov r0, r12 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x4 + adds r0, r2 + ldr r1, =0x0000ffff + str r1, [r0] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08052B2A + .pool +_08052B10: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08052B2A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8052A70 + + thumb_func_start atkA6_settypetorandomresistance +atkA6_settypetorandomresistance: @ 8052B34 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r1, =0x02024250 + ldr r4, =0x0202420b + ldrb r0, [r4] + lsls r0, 1 + adds r2, r0, r1 + ldrh r1, [r2] + cmp r1, 0 + beq _08052B7E + ldr r0, =0x0000ffff + cmp r1, r0 + beq _08052B7E + ldrh r0, [r2] + bl sub_8052F48 + lsls r0, 24 + cmp r0, 0 + beq _08052C1C + ldr r1, =0x02024084 + ldr r2, =0x02024270 + ldrb r0, [r4] + adds r0, r2 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + ands r0, r1 + cmp r0, 0 + beq _08052C1C +_08052B7E: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08052D08 + .pool +_08052BB4: + mov r0, r12 + strb r5, [r0] + mov r1, r10 + ldrb r0, [r1] + muls r0, r2 + adds r0, r7 + adds r0, 0x22 + strb r5, [r0] + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x3 + strb r0, [r1, 0x1] + strb r5, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r1, =0x02024214 + b _08052C0A + .pool +_08052BE0: + mov r0, r8 + adds r0, 0x1 + adds r0, r3 + ldrb r2, [r0] + strb r2, [r4] + mov r4, r10 + ldrb r0, [r4] + muls r0, r6 + ldr r7, =0x02024084 + adds r0, r7 + adds r0, 0x22 + strb r2, [r0] + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x3 + strb r0, [r1, 0x1] + strb r2, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + mov r1, r12 +_08052C0A: + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08052D08 + .pool +_08052C1C: + movs r4, 0 + mov r8, r4 + movs r7, 0x7F + mov r9, r7 +_08052C24: + bl GenerateRandomNumber + mov r4, r9 + ands r4, r0 + cmp r4, 0x70 + bhi _08052C24 + lsls r0, r4, 1 + adds r4, r0, r4 + ldr r6, =gUnknown_0831ACE8 + adds r3, r4, r6 + ldr r1, =0x02024258 + ldr r2, =0x0202420b + ldrb r5, [r2] + lsls r0, r5, 1 + adds r0, r1 + ldrb r1, [r3] + mov r10, r2 + ldrh r0, [r0] + cmp r1, r0 + bne _08052C80 + adds r0, r4, 0x2 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0x5 + bhi _08052C80 + ldr r7, =0x02024084 + movs r2, 0x58 + adds r0, r5, 0 + muls r0, r2 + adds r3, r0, r7 + movs r0, 0x21 + adds r0, r3 + mov r12, r0 + adds r0, r4, 0x1 + adds r0, r6 + ldrb r5, [r0] + mov r1, r12 + ldrb r0, [r1] + adds r1, r5, 0 + cmp r0, r1 + beq _08052C80 + adds r0, r3, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, r1 + bne _08052BB4 +_08052C80: + movs r7, 0x1 + add r8, r7 + ldr r0, =0x000003e7 + cmp r8, r0 + ble _08052C24 + movs r0, 0 + mov r8, r0 + ldr r1, =0x02024214 + mov r12, r1 + ldr r3, =gUnknown_0831ACE8 + adds r0, r4, 0x1 + adds r0, r3 + mov r9, r0 + adds r5, r3, 0 +_08052C9C: + ldrb r1, [r5] + cmp r1, 0xFF + bgt _08052CA6 + cmp r1, 0xFE + bge _08052CE0 +_08052CA6: + mov r4, r10 + ldrb r2, [r4] + lsls r0, r2, 1 + ldr r7, =0x02024258 + adds r0, r7 + ldrh r0, [r0] + cmp r1, r0 + bne _08052CE0 + ldrb r0, [r5, 0x2] + cmp r0, 0x5 + bhi _08052CE0 + movs r6, 0x58 + adds r0, r2, 0 + muls r0, r6 + ldr r1, =0x02024084 + adds r2, r0, r1 + adds r4, r2, 0 + adds r4, 0x21 + ldrb r0, [r4] + mov r7, r9 + ldrb r1, [r7] + cmp r0, r1 + beq _08052CE0 + adds r0, r2, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, r1 + beq _08052CE0 + b _08052BE0 +_08052CE0: + adds r5, 0x3 + movs r0, 0x3 + add r8, r0 + ldr r0, =0x0000014f + cmp r8, r0 + bls _08052C9C + mov r1, r12 + ldr r2, [r1] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + mov r4, r12 + str r1, [r4] +_08052D08: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkA6_settypetorandomresistance + + thumb_func_start atkA7_setalwayshitflag +atkA7_setalwayshitflag: @ 8052D34 + push {r4,lr} + ldr r4, =0x020242ac + ldr r3, =0x0202420c + ldrb r1, [r3] + lsls r1, 2 + adds r1, r4 + ldr r0, [r1] + movs r2, 0x19 + negs r2, r2 + ands r0, r2 + str r0, [r1] + ldrb r1, [r3] + lsls r1, 2 + adds r1, r4 + ldr r0, [r1] + movs r2, 0x10 + orrs r0, r2 + str r0, [r1] + ldr r2, =0x020242bc + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0202420b + ldrb r1, [r1] + strb r1, [r0, 0x15] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkA7_setalwayshitflag + + thumb_func_start atkA8_copymovepermanently +atkA8_copymovepermanently: @ 8052D8C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + ldr r0, =0x020241ec + ldr r1, =0x0000ffff + adds r5, r1, 0 + strh r5, [r0] + ldr r3, =0x02024084 + ldr r2, =0x0202420b + ldrb r1, [r2] + movs r0, 0x58 + adds r4, r1, 0 + muls r4, r0 + adds r0, r3, 0 + adds r0, 0x50 + adds r0, r4, r0 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 14 + ands r1, r0 + mov r12, r3 + mov r10, r2 + cmp r1, 0 + beq _08052DC4 + b _08052F18 +_08052DC4: + ldr r0, =0x02024240 + ldr r2, =0x0202420c + ldrb r1, [r2] + lsls r1, 1 + adds r1, r0 + ldrh r1, [r1] + mov r9, r0 + mov r8, r2 + cmp r1, 0xA5 + bne _08052DDA + b _08052F18 +_08052DDA: + cmp r1, 0 + bne _08052DE0 + b _08052F18 +_08052DE0: + cmp r1, r5 + bne _08052DE6 + b _08052F18 +_08052DE6: + cmp r1, 0xA6 + bne _08052DEC + b _08052F18 +_08052DEC: + movs r7, 0 + mov r5, r9 + mov r0, r12 + adds r0, 0xC + adds r1, r4, r0 + mov r3, r8 +_08052DF8: + ldrh r2, [r1] + cmp r2, 0xA6 + beq _08052E0A + ldrb r0, [r3] + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + cmp r2, r0 + beq _08052E12 +_08052E0A: + adds r1, 0x2 + adds r7, 0x1 + cmp r7, 0x3 + ble _08052DF8 +_08052E12: + cmp r7, 0x4 + beq _08052E18 + b _08052F18 +_08052E18: + ldr r4, =0x020241e8 + ldrb r1, [r4] + lsls r1, 1 + mov r2, r10 + ldrb r0, [r2] + movs r3, 0x58 + muls r0, r3 + adds r1, r0 + mov r6, r12 + adds r6, 0xC + adds r1, r6 + mov r2, r8 + ldrb r0, [r2] + lsls r0, 1 + add r0, r9 + ldrh r0, [r0] + strh r0, [r1] + mov r1, r10 + ldrb r0, [r1] + adds r2, r0, 0 + muls r2, r3 + ldrb r4, [r4] + adds r2, r4 + mov r5, r12 + adds r5, 0x24 + adds r2, r5 + ldr r4, =gBattleMoves + mov r1, r8 + ldrb r0, [r1] + lsls r0, 1 + add r0, r9 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x4] + strb r0, [r2] + ldr r1, =0x02024064 + mov r2, r10 + ldrb r0, [r2] + strb r0, [r1] + movs r7, 0 + ldrb r0, [r2] + muls r0, r3 + adds r4, r0, r5 + adds r3, r0, 0 + add r2, sp, 0x4 + add r5, sp, 0xC +_08052E7A: + adds r0, r3, r6 + ldrh r0, [r0] + strh r0, [r2] + adds r1, r5, r7 + ldrb r0, [r4] + strb r0, [r1] + adds r4, 0x1 + adds r3, 0x2 + adds r2, 0x2 + adds r7, 0x1 + cmp r7, 0x3 + ble _08052E7A + add r2, sp, 0x4 + mov r0, r10 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + add r0, r12 + adds r0, 0x3B + ldrb r0, [r0] + strb r0, [r2, 0xC] + str r2, [sp] + movs r0, 0 + movs r1, 0x3 + movs r2, 0 + movs r3, 0x10 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + ldr r3, =0x02024240 + ldr r2, =0x0202420c + ldrb r0, [r2] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + strb r0, [r1, 0x2] + ldrb r0, [r2] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + lsrs r0, 8 + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08052F32 + .pool +_08052F18: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08052F32: + 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 atkA8_copymovepermanently + + thumb_func_start sub_8052F48 +sub_8052F48: @ 8052F48 + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r2, =gBattleMoves + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1] + cmp r0, 0x91 + beq _08052F72 + cmp r0, 0x27 + beq _08052F72 + cmp r0, 0x4B + beq _08052F72 + cmp r0, 0x97 + beq _08052F72 + cmp r0, 0x9B + beq _08052F72 + cmp r0, 0x1A + bne _08052F7C +_08052F72: + movs r0, 0x1 + b _08052F7E + .pool +_08052F7C: + movs r0, 0 +_08052F7E: + pop {r1} + bx r1 + thumb_func_end sub_8052F48 + + thumb_func_start sub_8052F84 +sub_8052F84: @ 8052F84 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _08052FA2 + cmp r1, 0xD6 + beq _08052FA2 + movs r0, 0x89 + lsls r0, 1 + cmp r1, r0 + beq _08052FA2 + cmp r1, 0x77 + beq _08052FA2 + cmp r1, 0x76 + bne _08052FA6 +_08052FA2: + movs r0, 0x1 + b _08052FA8 +_08052FA6: + movs r0, 0 +_08052FA8: + pop {r1} + bx r1 + thumb_func_end sub_8052F84 + + thumb_func_start move_weather_interaction +move_weather_interaction: @ 8052FAC + push {lr} + lsls r1, 16 + lsrs r2, r1, 16 + ldr r1, =gBattleMoves + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0] + adds r3, r1, 0 + cmp r0, 0x97 + bne _08052FD0 + ldr r0, =0x020243cc + ldrh r1, [r0] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + bne _08053010 +_08052FD0: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0x91 + beq _08052FF2 + cmp r0, 0x27 + beq _08052FF2 + cmp r0, 0x4B + beq _08052FF2 + cmp r0, 0x97 + beq _08052FF2 + cmp r0, 0x9B + beq _08052FF2 + cmp r0, 0x1A + bne _08053010 +_08052FF2: + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 20 + ands r0, r1 + cmp r0, 0 + beq _08053010 + movs r0, 0x1 + b _08053012 + .pool +_08053010: + movs r0, 0x2 +_08053012: + pop {r1} + bx r1 + thumb_func_end move_weather_interaction + + thumb_func_start sub_8053018 +sub_8053018: @ 8053018 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r6, 0 + movs r5, 0 + ldr r0, =0x0202420b + mov r9, r0 + movs r1, 0x58 + mov r8, r1 + ldr r7, =0x02024090 + movs r0, 0x84 + lsls r0, 1 + mov r10, r0 +_08053036: + lsls r4, r5, 1 + mov r1, r9 + ldrb r0, [r1] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r4, r0 + adds r0, r7 + ldrh r0, [r0] + bl sub_8052F84 + lsls r0, 24 + cmp r0, 0 + bne _08053076 + mov r1, r9 + ldrb r0, [r1] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r4, r0 + adds r0, r7 + ldrh r1, [r0] + cmp r1, r10 + beq _08053076 + cmp r1, 0xFD + beq _08053076 + adds r0, r1, 0 + bl sub_8052F48 + lsls r0, 24 + cmp r0, 0 + beq _08053084 +_08053076: + ldr r1, =gUnknown_0832A328 + lsls r0, r5, 2 + adds r0, r1 + ldr r0, [r0] + orrs r6, r0 + lsls r0, r6, 24 + lsrs r6, r0, 24 +_08053084: + adds r5, 0x1 + cmp r5, 0x3 + ble _08053036 + ldr r0, =0x0202420b + ldrb r0, [r0] + adds r1, r6, 0 + movs r2, 0xFD + bl sub_803FECC + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0xF + bne _080530B8 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _0805311C + .pool +_080530B8: + movs r7, 0x3 + ldr r4, =gUnknown_0832A328 +_080530BC: + bl GenerateRandomNumber + adds r5, r7, 0 + ands r5, r0 + lsls r0, r5, 2 + adds r0, r4 + ldr r0, [r0] + ands r0, r6 + cmp r0, 0 + bne _080530BC + ldr r4, =0x020241ee + ldr r2, =0x02024084 + lsls r1, r5, 1 + ldr r0, =0x0202420b + ldrb r3, [r0] + movs r0, 0x58 + muls r0, r3 + adds r1, r0 + adds r2, 0xC + adds r1, r2 + ldrh r0, [r1] + strh r0, [r4] + ldr r0, =0x020241e8 + strb r5, [r0] + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xfffffbff + ands r0, r1 + str r0, [r2] + ldrh r0, [r4] + movs r1, 0 + bl sub_80458E0 + ldr r1, =0x0202420c + strb r0, [r1] + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_0805311C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8053018 + + thumb_func_start atkAA_destinybondeffect +atkAA_destinybondeffect: @ 8053150 + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r2, r0 + adds r1, 0x50 + adds r2, r1 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 18 + orrs r0, r1 + str r0, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end atkAA_destinybondeffect + + thumb_func_start b_feature_update_destiny_bond +b_feature_update_destiny_bond: @ 8053180 + push {r4,r5,lr} + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x0202420c + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, =0x02024084 + ldrb r2, [r4] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _080531CA + cmp r5, r3 + beq _080531CA + ldr r2, =0x02024280 + ldr r1, [r2] + movs r0, 0x80 + lsls r0, 17 + ands r0, r1 + cmp r0, 0 + bne _080531CA + movs r0, 0x40 + orrs r1, r0 + str r1, [r2] +_080531CA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end b_feature_update_destiny_bond + + thumb_func_start atkAB_802A458 +atkAB_802A458: @ 80531E0 + push {lr} + bl b_feature_update_destiny_bond + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atkAB_802A458 + + thumb_func_start atkAC_remaininghptopower +atkAC_remaininghptopower: @ 80531F8 + push {lr} + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r1, r0 + adds r1, r2 + movs r2, 0x28 + ldrsh r0, [r1, r2] + movs r2, 0x2C + ldrsh r1, [r1, r2] + movs r2, 0x30 + bl sub_8075034 + lsls r0, 24 + lsrs r1, r0, 24 + movs r3, 0 + ldr r0, =gUnknown_0831C408 + ldrb r2, [r0] + cmp r1, r2 + ble _08053232 + adds r2, r0, 0 +_08053224: + adds r3, 0x2 + cmp r3, 0xB + bgt _08053232 + adds r0, r3, r2 + ldrb r0, [r0] + cmp r1, r0 + bgt _08053224 +_08053232: + ldr r2, =0x02024400 + ldr r1, =gUnknown_0831C408 + adds r0, r3, 0x1 + adds r0, r1 + ldrb r0, [r0] + strh r0, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atkAC_remaininghptopower + + thumb_func_start atkAD_reducepprandom +atkAD_reducepprandom: @ 8053260 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r4, =0x02024248 + ldr r1, =0x0202420c + ldrb r3, [r1] + lsls r0, r3, 1 + adds r0, r4 + ldrh r2, [r0] + mov r8, r1 + cmp r2, 0 + bne _08053280 + b _08053408 +_08053280: + ldr r0, =0x0000ffff + cmp r2, r0 + bne _08053288 + b _08053408 +_08053288: + movs r7, 0 + ldr r0, =0x02024084 + movs r1, 0x58 + muls r1, r3 + adds r3, r0, 0 + adds r3, 0xC + adds r1, r3 + ldrh r1, [r1] + cmp r2, r1 + beq _080532C0 + adds r6, r4, 0 + mov r5, r8 + adds r4, r3, 0 + movs r3, 0x58 +_080532A4: + adds r7, 0x1 + cmp r7, 0x3 + bgt _080532C0 + ldrb r0, [r5] + lsls r2, r0, 1 + adds r2, r6 + lsls r1, r7, 1 + muls r0, r3 + adds r1, r0 + adds r1, r4 + ldrh r0, [r2] + ldrh r1, [r1] + cmp r0, r1 + bne _080532A4 +_080532C0: + cmp r7, 0x4 + bne _080532C6 + b _08053408 +_080532C6: + mov r4, r8 + ldrb r0, [r4] + movs r1, 0x58 + mov r9, r1 + mov r3, r9 + muls r3, r0 + adds r0, r3, 0 + adds r0, r7, r0 + ldr r1, =0x02024084 + adds r1, 0x24 + mov r10, r1 + add r0, r10 + ldrb r0, [r0] + cmp r0, 0x1 + bhi _080532E6 + b _08053408 +_080532E6: + bl GenerateRandomNumber + movs r1, 0x3 + ands r1, r0 + adds r6, r1, 0x2 + ldrb r0, [r4] + mov r3, r9 + muls r3, r0 + adds r0, r3, 0 + adds r0, r7, r0 + add r0, r10 + ldrb r0, [r0] + cmp r0, r6 + bge _08053304 + adds r6, r0, 0 +_08053304: + ldr r1, =0x02022f58 + movs r5, 0xFD + strb r5, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + ldr r2, =0x02024248 + mov r3, r8 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1, 0x2] + ldrb r0, [r3] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + lsrs r0, 8 + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r4, =0x02022f68 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalString + strb r5, [r4] + movs r0, 0x1 + strb r0, [r4, 0x1] + strb r0, [r4, 0x2] + strb r0, [r4, 0x3] + strb r6, [r4, 0x4] + subs r0, 0x2 + strb r0, [r4, 0x5] + mov r1, r8 + ldrb r0, [r1] + mov r1, r9 + muls r1, r0 + adds r1, r7, r1 + add r1, r10 + ldrb r0, [r1] + subs r0, r6 + strb r0, [r1] + ldr r4, =0x02024064 + mov r3, r8 + ldrb r0, [r3] + strb r0, [r4] + ldr r1, =0x020242bc + ldrb r3, [r4] + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gUnknown_0832A328 + lsls r0, r7, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _080533B8 + mov r2, r9 + muls r2, r3 + ldr r0, =0x02024084 + adds r0, 0x50 + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _080533B8 + adds r1, r7, 0 + adds r1, 0x9 + lsls r1, 24 + lsrs r1, 24 + mov r3, r10 + adds r0, r2, r3 + adds r0, r7 + str r0, [sp] + movs r0, 0 + movs r2, 0 + movs r3, 0x1 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_080533B8: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + ldr r1, =0x02024084 + ldr r0, =0x0202420c + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r0, r7, r0 + adds r1, 0x24 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08053422 + adds r0, r2, 0 + bl b_cancel_multi_turn_move_maybe + b _08053422 + .pool +_08053408: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08053422: + 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 atkAD_reducepprandom + + thumb_func_start atkAE_clearstatusifnotsoundproofed +atkAE_clearstatusifnotsoundproofed: @ 8053438 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r4, 0 + str r4, [sp, 0x4] + mov r8, r4 + ldr r0, =0x020241ea + ldrh r0, [r0] + cmp r0, 0xD7 + beq _08053454 + b _0805363E +_08053454: + ldr r6, =0x02024332 + mov r0, r8 + strb r0, [r6, 0x5] + ldr r5, =0x0202420b + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x02024744 + mov r10, r1 + cmp r0, 0 + bne _08053470 + ldr r2, =0x020244ec + mov r10, r2 +_08053470: + ldr r4, =0x02024084 + ldrb r3, [r5] + movs r7, 0x58 + adds r2, r3, 0 + muls r2, r7 + adds r0, r2, r4 + adds r1, r0, 0 + adds r1, 0x20 + ldrb r0, [r1] + cmp r0, 0x2B + beq _080534C4 + adds r0, r4, 0 + adds r0, 0x4C + adds r0, r2, r0 + mov r1, r8 + str r1, [r0] + ldrb r0, [r5] + adds r2, r0, 0 + muls r2, r7 + adds r0, r4, 0 + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] + b _080534D4 + .pool +_080534C4: + ldrb r1, [r1] + adds r0, r3, 0 + bl b_history__record_ability_usage_of_player + ldrb r0, [r6, 0x5] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r6, 0x5] +_080534D4: + ldr r7, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_get_per_side_status + movs r2, 0x2 + mov r9, r2 + mov r1, r9 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + ldr r1, =0x02024474 + strb r0, [r1, 0x17] + strb r0, [r7] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805357A + ldr r0, =0x02024210 + ldrb r2, [r0] + ldr r1, =gUnknown_0832A328 + ldrb r3, [r7] + lsls r0, r3, 2 + adds r0, r1 + ldr r0, [r0] + ands r2, r0 + cmp r2, 0 + bne _0805357A + ldr r5, =0x02024084 + movs r6, 0x58 + adds r4, r3, 0 + muls r4, r6 + adds r0, r4, r5 + adds r1, r0, 0 + adds r1, 0x20 + ldrb r0, [r1] + cmp r0, 0x2B + beq _08053568 + adds r0, r5, 0 + adds r0, 0x4C + adds r0, r4, r0 + str r2, [r0] + ldrb r0, [r7] + adds r2, r0, 0 + muls r2, r6 + adds r0, r5, 0 + adds r0, 0x50 + adds r2, r0 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] + b _0805357A + .pool +_08053568: + ldrb r1, [r1] + adds r0, r3, 0 + bl b_history__record_ability_usage_of_player + ldr r1, =0x02024332 + ldrb r0, [r1, 0x5] + mov r2, r9 + orrs r0, r2 + strb r0, [r1, 0x5] +_0805357A: + movs r6, 0 + ldr r7, =0x02024084 +_0805357E: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + add r4, r10 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0x2E + bl pokemon_getattr + lsls r0, 24 + lsrs r4, r0, 24 + cmp r5, 0 + beq _08053636 + movs r0, 0xCE + lsls r0, 1 + cmp r5, r0 + beq _08053636 + ldr r2, =0x0202406e + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r2 + ldrh r0, [r0] + cmp r0, r6 + bne _080535D0 + movs r0, 0x58 + muls r0, r1 + b _08053600 + .pool +_080535D0: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08053618 + ldr r0, =0x02024064 + ldrb r3, [r0] + lsls r0, r3, 1 + adds r0, r2 + ldrh r0, [r0] + cmp r0, r6 + bne _08053618 + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + lsls r0, r3, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08053618 + movs r0, 0x58 + muls r0, r3 +_08053600: + adds r0, r7 + adds r0, 0x20 + ldrb r0, [r0] + b _08053624 + .pool +_08053618: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_806B694 + lsls r0, 24 + lsrs r0, 24 +_08053624: + cmp r0, 0x2B + beq _08053636 + movs r0, 0x1 + lsls r0, r6 + mov r1, r8 + orrs r1, r0 + lsls r0, r1, 24 + lsrs r0, 24 + mov r8, r0 +_08053636: + adds r6, 0x1 + cmp r6, 0x5 + ble _0805357E + b _080536BC +_0805363E: + ldr r1, =0x02024332 + movs r0, 0x4 + strb r0, [r1, 0x5] + movs r2, 0x3F + mov r8, r2 + ldr r3, =0x02024084 + ldr r2, =0x0202420b + ldrb r0, [r2] + movs r5, 0x58 + muls r0, r5 + movs r1, 0x4C + adds r1, r3 + mov r9, r1 + add r0, r9 + str r4, [r0] + ldrb r0, [r2] + adds r1, r0, 0 + muls r1, r5 + adds r7, r3, 0 + adds r7, 0x50 + adds r1, r7 + ldr r0, [r1] + ldr r6, =0xf7ffffff + ands r0, r6 + str r0, [r1] + ldrb r0, [r2] + bl battle_get_per_side_status + movs r1, 0x2 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + ldr r4, =0x02024064 + strb r0, [r4] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080536BC + ldr r0, =0x02024210 + ldrb r2, [r0] + ldr r1, =gUnknown_0832A328 + ldrb r3, [r4] + lsls r0, r3, 2 + adds r0, r1 + ldr r0, [r0] + ands r2, r0 + cmp r2, 0 + bne _080536BC + adds r0, r3, 0 + muls r0, r5 + add r0, r9 + str r2, [r0] + ldrb r0, [r4] + adds r1, r0, 0 + muls r1, r5 + adds r1, r7 + ldr r0, [r1] + ands r0, r6 + str r0, [r1] +_080536BC: + mov r2, r8 + cmp r2, 0 + beq _080536DE + ldr r4, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r4] + add r0, sp, 0x4 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_080536DE: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + 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 atkAE_clearstatusifnotsoundproofed + + thumb_func_start atkAF_cursetarget +atkAF_cursetarget: @ 805371C + push {r4,r5,lr} + ldr r5, =0x02024084 + ldr r0, =0x0202420c + ldrb r0, [r0] + movs r4, 0x58 + adds r1, r0, 0 + muls r1, r4 + adds r0, r5, 0 + adds r0, 0x50 + adds r1, r0 + ldr r2, [r1] + movs r3, 0x80 + lsls r3, 21 + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + beq _08053768 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0805378C + .pool +_08053768: + orrs r2, r3 + str r2, [r1] + ldr r1, =0x020241f0 + ldr r0, =0x0202420b + ldrb r0, [r0] + muls r0, r4 + adds r0, r5 + ldrh r0, [r0, 0x2C] + lsrs r0, 1 + str r0, [r1] + cmp r0, 0 + bne _08053784 + movs r0, 0x1 + str r0, [r1] +_08053784: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0805378C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atkAF_cursetarget + + thumb_func_start atkB0_setspikes +atkB0_setspikes: @ 80537A0 + push {r4,lr} + ldr r4, =0x0202420b + ldrb r0, [r4] + bl battle_side_get_owner + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02024294 + lsls r2, r0, 1 + adds r0, r2, r0 + lsls r0, 2 + adds r3, r0, r1 + ldrb r0, [r3, 0xA] + cmp r0, 0x3 + bne _08053804 + ldr r2, =0x0202437c + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0] + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0805381E + .pool +_08053804: + ldr r1, =0x0202428e + adds r1, r2, r1 + ldrh r2, [r1] + movs r0, 0x10 + orrs r0, r2 + strh r0, [r1] + ldrb r0, [r3, 0xA] + adds r0, 0x1 + strb r0, [r3, 0xA] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0805381E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkB0_setspikes + + thumb_func_start atkB1_setforesight +atkB1_setforesight: @ 805382C + ldr r1, =0x02024084 + ldr r0, =0x0202420c + ldrb r2, [r0] + movs r0, 0x58 + muls r2, r0 + adds r1, 0x50 + adds r2, r1 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 22 + orrs r0, r1 + str r0, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end atkB1_setforesight + + thumb_func_start atkB2_setperishsong +atkB2_setperishsong: @ 805385C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r6, 0 + movs r3, 0 + ldr r0, =0x0202406c + adds r7, r0, 0 + ldr r0, =0x0202420b + mov r8, r0 + ldrb r1, [r7] + cmp r6, r1 + bge _080538C8 + movs r5, 0x20 + ldr r0, =0x02024084 + mov r12, r0 + ldr r0, =0x020242bc + adds r4, r0, 0 + adds r4, 0xF + ldr r2, =0x020242ac +_08053884: + ldr r1, [r2] + adds r0, r1, 0 + ands r0, r5 + cmp r0, 0 + bne _0805389C + movs r0, 0x58 + muls r0, r3 + add r0, r12 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x2B + bne _080538B4 +_0805389C: + adds r6, 0x1 + b _080538BC + .pool +_080538B4: + orrs r1, r5 + str r1, [r2] + movs r0, 0x33 + strb r0, [r4] +_080538BC: + adds r4, 0x1C + adds r2, 0x4 + adds r3, 0x1 + ldrb r0, [r7] + cmp r3, r0 + blt _08053884 +_080538C8: + mov r1, r8 + ldrb r0, [r1] + bl sub_803F67C + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r6, r0 + bne _080538FC + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08053904 + .pool +_080538FC: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08053904: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkB2_setperishsong + + thumb_func_start atkB3_rolloutdamagecalculation +atkB3_rolloutdamagecalculation: @ 8053914 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _08053948 + ldr r0, =0x0202420b + ldrb r0, [r0] + bl b_cancel_multi_turn_move_maybe + ldr r1, =0x02024214 + ldr r0, =gUnknown_082D8A60 + str r0, [r1] + b _08053A60 + .pool +_08053948: + ldr r2, =0x02024084 + ldr r1, =0x0202420b + ldrb r3, [r1] + movs r5, 0x58 + adds r0, r3, 0 + muls r0, r5 + adds r4, r2, 0 + adds r4, 0x50 + adds r0, r4 + ldr r0, [r0] + movs r7, 0x80 + lsls r7, 5 + ands r0, r7 + adds r6, r1, 0 + mov r9, r2 + ldr r1, =0x020242bc + mov r12, r1 + ldr r2, =0x020241ea + mov r8, r2 + cmp r0, 0 + bne _080539BA + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 2 + add r0, r12 + ldrb r2, [r0, 0x11] + movs r1, 0x10 + negs r1, r1 + ands r1, r2 + movs r2, 0x5 + orrs r1, r2 + strb r1, [r0, 0x11] + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + add r0, r12 + ldrb r2, [r0, 0x11] + movs r1, 0xF + ands r1, r2 + movs r2, 0x50 + orrs r1, r2 + strb r1, [r0, 0x11] + ldrb r0, [r6] + adds r1, r0, 0 + muls r1, r5 + adds r1, r4 + ldr r0, [r1] + orrs r0, r7 + str r0, [r1] + ldr r1, =0x02024268 + ldrb r0, [r6] + lsls r0, 1 + adds r0, r1 + mov r2, r8 + ldrh r1, [r2] + strh r1, [r0] +_080539BA: + ldrb r0, [r6] + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 2 + add r2, r12 + ldrb r3, [r2, 0x11] + lsls r1, r3, 28 + lsrs r1, 28 + subs r1, 0x1 + movs r0, 0xF + ands r1, r0 + movs r0, 0x10 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x11] + cmp r1, 0 + bne _080539EE + ldrb r0, [r6] + adds r1, r0, 0 + muls r1, r5 + adds r1, r4 + ldr r0, [r1] + ldr r2, =0xffffefff + ands r0, r2 + str r0, [r1] +_080539EE: + ldr r3, =0x02024400 + ldr r2, =gBattleMoves + mov r0, r8 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + strh r0, [r3] + movs r2, 0x1 + ldrb r1, [r6] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + mov r1, r12 + adds r4, r0, r1 + ldrb r0, [r4, 0x11] + lsls r0, 28 + lsrs r0, 28 + movs r1, 0x5 + subs r1, r0 + ldr r7, =0x02024214 + adds r5, r3, 0 + cmp r2, r1 + bge _08053A3C + adds r1, r5, 0 + adds r3, r4, 0 + movs r4, 0x5 +_08053A28: + ldrh r0, [r1] + lsls r0, 1 + strh r0, [r1] + adds r2, 0x1 + ldrb r0, [r3, 0x11] + lsls r0, 28 + lsrs r0, 28 + subs r0, r4, r0 + cmp r2, r0 + blt _08053A28 +_08053A3C: + ldrb r1, [r6] + movs r0, 0x58 + muls r0, r1 + mov r1, r9 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 23 + ands r0, r1 + cmp r0, 0 + beq _08053A5A + ldrh r0, [r5] + lsls r0, 1 + strh r0, [r5] +_08053A5A: + ldr r0, [r7] + adds r0, 0x1 + str r0, [r7] +_08053A60: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkB3_rolloutdamagecalculation + + thumb_func_start atkB4_jumpifconfusedandattackmaxed +atkB4_jumpifconfusedandattackmaxed: @ 8053A90 + push {r4,r5,lr} + ldr r5, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + adds r3, r1, 0 + muls r3, r0 + adds r0, r5, 0 + adds r0, 0x50 + adds r0, r3, r0 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + ldr r4, =0x02024214 + cmp r0, 0 + beq _08053AEC + ldr r2, [r4] + ldrb r0, [r2, 0x1] + adds r0, r3 + adds r1, r5, 0 + adds r1, 0x18 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0xC + bne _08053AEC + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08053AF2 + .pool +_08053AEC: + ldr r0, [r4] + adds r0, 0x6 + str r0, [r4] +_08053AF2: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end atkB4_jumpifconfusedandattackmaxed + + thumb_func_start sub_8053AF8 +sub_8053AF8: @ 8053AF8 + push {r4,r5,lr} + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _08053B34 + ldr r2, =0x020242bc + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strb r1, [r0, 0x10] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082D8A60 + str r0, [r1] + b _08053B8C + .pool +_08053B34: + ldr r5, =0x020242bc + ldr r4, =0x0202420b + ldrb r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r1, r0, r5 + ldrb r0, [r1, 0x10] + cmp r0, 0x5 + beq _08053B4C + adds r0, 0x1 + strb r0, [r1, 0x10] +_08053B4C: + ldr r3, =0x02024400 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + strh r0, [r3] + movs r2, 0x1 + ldrb r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r4, =0x02024214 + ldrb r1, [r0, 0x10] + cmp r2, r1 + bge _08053B86 + adds r1, r3, 0 + adds r3, r0, 0 +_08053B78: + ldrh r0, [r1] + lsls r0, 1 + strh r0, [r1] + adds r2, 0x1 + ldrb r0, [r3, 0x10] + cmp r2, r0 + blt _08053B78 +_08053B86: + ldr r0, [r4] + adds r0, 0x1 + str r0, [r4] +_08053B8C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8053AF8 + + thumb_func_start atkB6_happinesstodamagecalculation +atkB6_happinesstodamagecalculation: @ 8053BAC + push {r4,lr} + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x79 + bne _08053BEC + ldr r4, =0x02024400 + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x2B + ldrb r1, [r0] + b _08053C02 + .pool +_08053BEC: + ldr r4, =0x02024400 + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x2B + ldrb r0, [r0] + movs r1, 0xFF + subs r1, r0 +_08053C02: + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + movs r1, 0x19 + bl __divsi3 + strh r0, [r4] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkB6_happinesstodamagecalculation + + thumb_func_start atkB7_presentdamagecalculation +atkB7_presentdamagecalculation: @ 8053C30 + push {r4,lr} + bl GenerateRandomNumber + movs r4, 0xFF + ands r4, r0 + cmp r4, 0x65 + bgt _08053C4C + ldr r1, =0x02024400 + movs r0, 0x28 + strh r0, [r1] + b _08053C8E + .pool +_08053C4C: + cmp r4, 0xB1 + bgt _08053C5C + ldr r1, =0x02024400 + movs r0, 0x50 + strh r0, [r1] + b _08053C8E + .pool +_08053C5C: + cmp r4, 0xCB + bgt _08053C6C + ldr r1, =0x02024400 + movs r0, 0x78 + strh r0, [r1] + b _08053C8E + .pool +_08053C6C: + ldr r3, =0x020241f0 + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x2C] + lsrs r0, 2 + str r0, [r3] + cmp r0, 0 + bne _08053C88 + movs r0, 0x1 + str r0, [r3] +_08053C88: + ldr r0, [r3] + negs r0, r0 + str r0, [r3] +_08053C8E: + cmp r4, 0xCB + bgt _08053CAC + ldr r1, =0x02024214 + ldr r0, =gUnknown_082D8A30 + b _08053CE6 + .pool +_08053CAC: + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r1, [r0, 0x2C] + ldrh r0, [r0, 0x28] + cmp r1, r0 + bne _08053CD8 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082D9EFB + b _08053CE6 + .pool +_08053CD8: + ldr r2, =0x0202427c + ldrb r1, [r2] + movs r0, 0xF7 + ands r0, r1 + strb r0, [r2] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082D9EE1 +_08053CE6: + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkB7_presentdamagecalculation + + thumb_func_start atkB8_setsafeguard +atkB8_setsafeguard: @ 8053CFC + push {r4-r7,lr} + ldr r7, =0x0202420b + ldrb r0, [r7] + bl battle_get_per_side_status + ldr r4, =0x0202428e + movs r6, 0x1 + adds r1, r6, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + ldrh r1, [r1] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08053D40 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0 + strb r0, [r1, 0x5] + b _08053D88 + .pool +_08053D40: + ldrb r0, [r7] + bl battle_get_per_side_status + adds r1, r6, 0 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + ldrh r0, [r1] + movs r2, 0x20 + orrs r0, r2 + strh r0, [r1] + ldrb r0, [r7] + bl battle_get_per_side_status + ldr r5, =0x02024294 + adds r1, r6, 0 + ands r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r4, 0x5 + strb r4, [r0, 0x6] + ldrb r0, [r7] + bl battle_get_per_side_status + adds r1, r6, 0 + ands r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r7] + strb r1, [r0, 0x7] + ldr r0, =0x02024332 + strb r4, [r0, 0x5] +_08053D88: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkB8_setsafeguard + + thumb_func_start atkB9_magnitudedamagecalculation +atkB9_magnitudedamagecalculation: @ 8053DA4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x4 + bgt _08053DD0 + ldr r1, =0x02024400 + movs r0, 0xA + strh r0, [r1] + movs r3, 0x4 + b _08053E3C + .pool +_08053DD0: + cmp r3, 0xE + bgt _08053DE4 + ldr r1, =0x02024400 + movs r0, 0x1E + strh r0, [r1] + movs r3, 0x5 + b _08053E3C + .pool +_08053DE4: + cmp r3, 0x22 + bgt _08053DF8 + ldr r1, =0x02024400 + movs r0, 0x32 + strh r0, [r1] + movs r3, 0x6 + b _08053E3C + .pool +_08053DF8: + cmp r3, 0x40 + bgt _08053E0C + ldr r1, =0x02024400 + movs r0, 0x46 + strh r0, [r1] + movs r3, 0x7 + b _08053E3C + .pool +_08053E0C: + cmp r3, 0x54 + bgt _08053E20 + ldr r1, =0x02024400 + movs r0, 0x5A + strh r0, [r1] + movs r3, 0x8 + b _08053E3C + .pool +_08053E20: + cmp r3, 0x5E + bgt _08053E34 + ldr r1, =0x02024400 + movs r0, 0x6E + strh r0, [r1] + movs r3, 0x9 + b _08053E3C + .pool +_08053E34: + ldr r1, =0x02024400 + movs r0, 0x96 + strh r0, [r1] + movs r3, 0xA +_08053E3C: + ldr r1, =0x02022f58 + movs r2, 0 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x1 + strb r0, [r1, 0x1] + strb r0, [r1, 0x2] + movs r0, 0x2 + strb r0, [r1, 0x3] + strb r3, [r1, 0x4] + movs r0, 0xFF + strb r0, [r1, 0x5] + ldr r1, =0x0202420c + strb r2, [r1] + ldr r0, =0x0202406c + ldrb r3, [r0] + adds r6, r1, 0 + ldr r0, =0x02024214 + mov r8, r0 + cmp r2, r3 + bcs _08053E94 + adds r4, r6, 0 + ldr r0, =0x0202420b + ldrb r5, [r0] + ldr r1, =gUnknown_0832A328 + mov r12, r1 + ldr r7, =0x02024210 +_08053E72: + ldrb r2, [r4] + cmp r2, r5 + beq _08053E88 + ldrb r0, [r7] + ldrb r1, [r6] + lsls r1, 2 + add r1, r12 + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + beq _08053E94 +_08053E88: + adds r0, r2, 0x1 + strb r0, [r4] + lsls r0, 24 + lsrs r0, 24 + cmp r0, r3 + bcc _08053E72 +_08053E94: + mov r1, r8 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkB9_magnitudedamagecalculation + + thumb_func_start atkBA_802B140 +atkBA_802B140: @ 8053EC8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x02024212 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08053EF8 + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08053EF4 + movs r0, 0x1 + b _08053F12 + .pool +_08053EF4: + movs r0, 0 + b _08053F12 +_08053EF8: + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08053F10 + movs r0, 0x3 + b _08053F12 + .pool +_08053F10: + movs r0, 0x2 +_08053F12: + bl battle_get_side_with_given_state + ldr r1, =0x0202420c + strb r0, [r1] + ldr r0, =0x0202421c + ldr r1, =0x0202420c + ldrb r3, [r1] + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _08053F2A + b _08054030 +_08053F2A: + ldr r5, =0x0202420b + ldr r0, =0x0202449c + ldr r1, [r0] + adds r1, r3, r1 + ldrb r2, [r5] + ldrb r1, [r1, 0xC] + cmp r2, r1 + bne _08054030 + ldr r4, =0x02024084 + movs r2, 0x58 + adds r0, r3, 0 + muls r0, r2 + adds r1, r4, 0 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x27 + ands r0, r1 + cmp r0, 0 + bne _08054030 + ldrb r0, [r5] + muls r0, r2 + adds r0, r4 + ldrh r0, [r0, 0x28] + cmp r0, 0 + beq _08054030 + ldr r0, =0x020242bc + lsls r1, r3, 3 + subs r1, r3 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x18] + lsls r0, 31 + cmp r0, 0 + bne _08054030 + ldr r0, =0x02024274 + lsls r1, r3, 1 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0xE4 + bne _08054030 + movs r1, 0 + ldr r0, =0x0202406c + ldr r2, =0x020241ea + mov r8, r2 + ldr r7, =0x020241e8 + mov r10, r7 + ldr r2, =0x020241e9 + mov r9, r2 + ldr r7, =0x02024280 + mov r12, r7 + ldrb r2, [r0] + cmp r1, r2 + bge _08053FB6 + ldr r6, =0x0202407e + ldr r5, =0x0202420c + ldr r4, =0x0202407a + movs r3, 0xB + adds r2, r0, 0 +_08053FA0: + adds r0, r1, r6 + ldrb r0, [r0] + ldrb r7, [r5] + cmp r0, r7 + bne _08053FAE + adds r0, r1, r4 + strb r3, [r0] +_08053FAE: + adds r1, 0x1 + ldrb r0, [r2] + cmp r1, r0 + blt _08053FA0 +_08053FB6: + movs r0, 0xE4 + mov r1, r8 + strh r0, [r1] + ldr r2, =0x0202420c + ldrb r0, [r2] + ldr r7, =0x0202449c + ldr r1, [r7] + adds r0, r1 + adds r0, 0x80 + ldrb r0, [r0] + mov r1, r9 + strb r0, [r1] + mov r2, r10 + strb r0, [r2] + ldr r7, =0x02024214 + ldr r0, [r7] + adds r0, 0x5 + str r0, [r7] + movs r0, 0x1 + ldr r1, =0x02024474 + strb r0, [r1, 0x18] + mov r2, r12 + ldr r0, [r2] + ldr r1, =0xfffffbff + ands r0, r1 + str r0, [r2] + b _0805404A + .pool +_08054030: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_0805404A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkBA_802B140 + + thumb_func_start sub_805405C +sub_805405C: @ 805405C + push {lr} + ldr r2, =0x020243cc + ldrh r1, [r2] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _08054088 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1, 0x5] + b _0805409A + .pool +_08054088: + movs r0, 0x20 + strh r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x4 + strb r0, [r1, 0x5] + ldr r0, =0x020243d0 + adds r0, 0x28 + movs r1, 0x5 + strb r1, [r0] +_0805409A: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_805405C + + thumb_func_start atkBC_maxattackhalvehp +atkBC_maxattackhalvehp: @ 80540B4 + push {r4,r5,lr} + ldr r5, =0x02024084 + ldr r4, =0x0202420b + ldrb r0, [r4] + movs r3, 0x58 + muls r0, r3 + adds r2, r0, r5 + ldrh r0, [r2, 0x2C] + lsrs r1, r0, 1 + cmp r1, 0 + bne _080540CC + movs r1, 0x1 +_080540CC: + movs r0, 0x19 + ldrsb r0, [r2, r0] + cmp r0, 0xB + bgt _08054110 + ldrh r0, [r2, 0x28] + cmp r0, r1 + bls _08054110 + movs r0, 0xC + strb r0, [r2, 0x19] + ldr r1, =0x020241f0 + ldrb r0, [r4] + muls r0, r3 + adds r0, r5 + ldrh r0, [r0, 0x2C] + lsrs r0, 1 + str r0, [r1] + cmp r0, 0 + bne _080540F4 + movs r0, 0x1 + str r0, [r1] +_080540F4: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _0805412A + .pool +_08054110: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_0805412A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atkBC_maxattackhalvehp + + thumb_func_start atkBD_copyfoestats +atkBD_copyfoestats: @ 8054134 + push {r4-r7,lr} + movs r2, 0 + ldr r7, =0x02024214 + ldr r6, =0x0202420b + movs r4, 0x58 + ldr r3, =0x0202409c + ldr r5, =0x0202420c +_08054142: + ldrb r0, [r6] + adds r1, r0, 0 + muls r1, r4 + adds r1, r2, r1 + adds r1, r3 + ldrb r0, [r5] + muls r0, r4 + adds r0, r2, r0 + adds r0, r3 + ldrb r0, [r0] + strb r0, [r1] + adds r2, 0x1 + cmp r2, 0x7 + ble _08054142 + ldr r0, [r7] + adds r0, 0x5 + str r0, [r7] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkBD_copyfoestats + + thumb_func_start atkBE_breakfree +atkBE_breakfree: @ 805417C + push {r4-r6,lr} + ldr r1, =0x02024084 + ldr r5, =0x0202420b + ldrb r2, [r5] + movs r6, 0x58 + adds r0, r2, 0 + muls r0, r6 + adds r4, r1, 0 + adds r4, 0x50 + adds r0, r4 + ldr r0, [r0] + movs r1, 0xE0 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _08054210 + ldr r1, =0x02024474 + ldr r3, =0x0202420c + ldrb r0, [r3] + strb r0, [r1, 0x17] + ldrb r0, [r5] + adds r1, r0, 0 + muls r1, r6 + adds r1, r4 + ldr r0, [r1] + ldr r2, =0xffff1fff + ands r0, r2 + str r0, [r1] + ldrb r0, [r5] + ldr r1, =0x0202449c + ldr r2, [r1] + adds r0, r2 + ldrb r0, [r0, 0x14] + strb r0, [r3] + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + ldrb r0, [r5] + lsls r0, 1 + adds r0, r2 + ldrb r0, [r0, 0x4] + strb r0, [r1, 0x2] + ldrb r0, [r5] + lsls r0, 1 + adds r0, r2 + ldrb r0, [r0, 0x5] + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAFC5 + b _080542BA + .pool +_08054210: + ldr r4, =0x020242ac + lsls r0, r2, 2 + adds r3, r0, r4 + ldr r1, [r3] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08054250 + movs r0, 0x5 + negs r0, r0 + ands r1, r0 + str r1, [r3] + ldrb r1, [r5] + lsls r1, 2 + adds r1, r4 + ldr r0, [r1] + movs r2, 0x4 + negs r2, r2 + ands r0, r2 + str r0, [r1] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAFD6 + b _080542BA + .pool +_08054250: + adds r0, r2, 0 + bl battle_side_get_owner + ldr r4, =0x0202428e + lsls r0, 24 + lsrs r0, 23 + adds r0, r4 + ldrh r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080542B4 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 23 + adds r0, r4 + ldrh r2, [r0] + ldr r1, =0x0000ffef + ands r1, r2 + movs r4, 0 + strh r1, [r0] + ldrb r0, [r5] + bl battle_side_get_owner + ldr r2, =0x02024294 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + strb r4, [r1, 0xA] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DAFDD + b _080542BA + .pool +_080542B4: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 +_080542BA: + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atkBE_breakfree + + thumb_func_start atkBF_setcurled +atkBF_setcurled: @ 80542C8 + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r2, r0 + adds r1, 0x50 + adds r2, r1 + ldr r0, [r2] + movs r1, 0x80 + lsls r1, 23 + orrs r0, r1 + str r0, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end atkBF_setcurled + + thumb_func_start atkC0_recoverbasedonsunlight +atkC0_recoverbasedonsunlight: @ 80542F8 + push {r4-r7,lr} + sub sp, 0x4 + ldr r1, =0x0202420c + ldr r5, =0x0202420b + ldrb r0, [r5] + strb r0, [r1] + ldr r7, =0x02024084 + ldrb r0, [r5] + movs r6, 0x58 + muls r0, r6 + adds r0, r7 + ldrh r1, [r0, 0x28] + ldrh r0, [r0, 0x2C] + cmp r1, r0 + beq _080543D8 + ldr r4, =0x020243cc + ldrh r0, [r4] + cmp r0, 0 + beq _0805434A + movs r0, 0 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0805434A + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _08054378 +_0805434A: + ldr r3, =0x020241f0 + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x2C] + lsrs r0, 1 + str r0, [r3] + adds r1, r3, 0 + b _080543B2 + .pool +_08054378: + ldrh r1, [r4] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _080543A4 + ldr r4, =0x020241f0 + ldrb r0, [r5] + muls r0, r6 + adds r0, r7 + ldrh r1, [r0, 0x2C] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + movs r1, 0x1E + bl __divsi3 + str r0, [r4] + adds r1, r4, 0 + b _080543B2 + .pool +_080543A4: + ldr r1, =0x020241f0 + ldrb r0, [r5] + muls r0, r6 + adds r0, r7 + ldrh r0, [r0, 0x2C] + lsrs r0, 2 + str r0, [r1] +_080543B2: + adds r2, r1, 0 + ldr r0, [r2] + cmp r0, 0 + bne _080543BE + movs r0, 0x1 + str r0, [r2] +_080543BE: + ldr r0, [r1] + negs r0, r0 + str r0, [r1] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _080543F2 + .pool +_080543D8: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_080543F2: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkC0_recoverbasedonsunlight + + thumb_func_start sub_8054400 +sub_8054400: @ 8054400 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + adds r4, r1, 0 + muls r4, r0 + adds r4, r2 + ldrb r0, [r4, 0x14] + mov r10, r0 + mov r7, r10 + lsls r7, 27 + adds r0, r7, 0 + lsrs r0, 27 + mov r10, r0 + movs r1, 0x2 + mov r2, r10 + ands r2, r1 + asrs r2, 1 + ldrh r7, [r4, 0x14] + mov r9, r7 + mov r0, r9 + lsls r0, 22 + mov r9, r0 + lsrs r3, r0, 27 + adds r0, r1, 0 + ands r0, r3 + orrs r2, r0 + ldrb r7, [r4, 0x15] + mov r8, r7 + mov r0, r8 + lsls r0, 25 + mov r8, r0 + lsrs r3, r0, 27 + adds r0, r1, 0 + ands r0, r3 + lsls r0, 1 + orrs r2, r0 + ldr r6, [r4, 0x14] + lsls r6, 12 + lsrs r3, r6, 27 + adds r0, r1, 0 + ands r0, r3 + lsls r0, 2 + orrs r2, r0 + ldrh r5, [r4, 0x16] + lsls r5, 23 + lsrs r3, r5, 27 + adds r0, r1, 0 + ands r0, r3 + lsls r0, 3 + orrs r2, r0 + ldrb r3, [r4, 0x17] + lsls r3, 26 + lsrs r0, r3, 27 + ands r1, r0 + lsls r1, 4 + orrs r2, r1 + movs r1, 0x1 + adds r4, r1, 0 + mov r7, r10 + ands r4, r7 + mov r0, r9 + lsrs r0, 27 + mov r9, r0 + adds r0, r1, 0 + mov r7, r9 + ands r0, r7 + lsls r0, 1 + orrs r4, r0 + mov r0, r8 + lsrs r0, 27 + mov r8, r0 + adds r0, r1, 0 + mov r7, r8 + ands r0, r7 + lsls r0, 2 + orrs r4, r0 + lsrs r6, 27 + adds r0, r1, 0 + ands r0, r6 + lsls r0, 3 + orrs r4, r0 + lsrs r5, 27 + adds r0, r1, 0 + ands r0, r5 + lsls r0, 4 + orrs r4, r0 + lsrs r3, 27 + ands r1, r3 + lsls r1, 5 + orrs r4, r1 + ldr r5, =0x02024400 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + movs r1, 0x3F + bl __divsi3 + adds r0, 0x1E + strh r0, [r5] + ldr r6, =0x0202449c + ldr r5, [r6] + lsls r0, r4, 4 + subs r0, r4 + movs r1, 0x3F + bl __divsi3 + adds r0, 0x1 + strb r0, [r5, 0x13] + ldr r1, [r6] + ldrb r0, [r1, 0x13] + cmp r0, 0x8 + bls _080544F0 + adds r0, 0x1 + strb r0, [r1, 0x13] +_080544F0: + ldr r2, [r6] + ldrb r0, [r2, 0x13] + movs r1, 0xC0 + orrs r0, r1 + strb r0, [r2, 0x13] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8054400 + + thumb_func_start atkC2_selectnexttarget +atkC2_selectnexttarget: @ 8054524 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x0202420c + movs r1, 0 + strb r1, [r0] + ldr r1, =0x0202406c + ldrb r1, [r1] + adds r6, r0, 0 + ldr r0, =0x02024214 + mov r8, r0 + cmp r1, 0 + beq _0805456E + adds r3, r6, 0 + ldr r0, =0x0202420b + ldrb r5, [r0] + ldr r0, =gUnknown_0832A328 + mov r12, r0 + adds r4, r1, 0 + ldr r7, =0x02024210 +_0805454C: + ldrb r2, [r3] + cmp r2, r5 + beq _08054562 + ldrb r0, [r7] + ldrb r1, [r6] + lsls r1, 2 + add r1, r12 + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + beq _0805456E +_08054562: + adds r0, r2, 0x1 + strb r0, [r3] + lsls r0, 24 + lsrs r0, 24 + cmp r0, r4 + bcc _0805454C +_0805456E: + mov r1, r8 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkC2_selectnexttarget + + thumb_func_start atkC3_setfutureattack +atkC3_setfutureattack: @ 8054598 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + ldr r0, =0x020243d0 + mov r8, r0 + ldr r6, =0x0202420c + ldrb r1, [r6] + adds r0, r1, r0 + ldrb r7, [r0] + cmp r7, 0 + beq _080545DC + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _080546CC + .pool +_080545DC: + adds r0, r1, 0 + bl battle_get_per_side_status + ldr r4, =0x0202428e + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + mov r10, r1 + ands r0, r1 + lsls r0, 1 + adds r0, r4 + ldrh r2, [r0] + movs r1, 0x40 + movs r5, 0 + mov r3, sp + strh r5, [r3, 0x10] + orrs r1, r2 + strh r1, [r0] + ldrb r0, [r6] + lsls r0, 1 + mov r1, r8 + adds r1, 0x18 + adds r0, r1 + ldr r1, =0x020241ea + mov r9, r1 + ldrh r1, [r1] + strh r1, [r0] + mov r0, r8 + adds r0, 0x4 + ldrb r2, [r6] + adds r0, r2 + ldr r5, =0x0202420b + ldrb r1, [r5] + strb r1, [r0] + ldrb r0, [r6] + add r0, r8 + movs r1, 0x3 + strb r1, [r0] + ldrb r0, [r6] + bl battle_get_per_side_status + mov r1, r10 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + ldrh r3, [r1] + ldrb r0, [r5] + movs r4, 0x58 + muls r0, r4 + ldr r2, =0x02024084 + adds r0, r2 + ldrb r1, [r6] + muls r1, r4 + adds r1, r2 + mov r4, r9 + ldrh r2, [r4] + str r7, [sp] + str r7, [sp, 0x4] + ldrb r4, [r5] + str r4, [sp, 0x8] + ldrb r4, [r6] + str r4, [sp, 0xC] + bl sub_806957C + ldrb r1, [r6] + lsls r1, 2 + mov r2, r8 + adds r2, 0x8 + adds r1, r2 + str r0, [r1] + ldr r1, =0x0202433c + ldrb r0, [r5] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 28 + cmp r0, 0 + bge _0805468C + ldrb r4, [r6] + lsls r4, 2 + adds r4, r2 + ldr r1, [r4] + lsls r0, r1, 4 + subs r0, r1 + movs r1, 0xA + bl __divsi3 + str r0, [r4] +_0805468C: + mov r5, r9 + ldrh r1, [r5] + ldr r0, =0x00000161 + cmp r1, r0 + bne _080546BC + ldr r0, =0x02024332 + mov r1, r10 + strb r1, [r0, 0x5] + b _080546C4 + .pool +_080546BC: + ldr r0, =0x02024332 + mov r2, sp + ldrb r2, [r2, 0x10] + strb r2, [r0, 0x5] +_080546C4: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_080546CC: + 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 atkC3_setfutureattack + + thumb_func_start atkC4_802B910 +atkC4_802B910: @ 80546E4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + ldr r7, =0x02024744 + cmp r0, 0 + bne _080546FE + ldr r7, =0x020244ec +_080546FE: + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08054740 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + b _080548DC + .pool +_08054740: + ldr r6, =0x02024332 + ldrb r0, [r6] + mov r8, r0 + cmp r0, 0x5 + bls _0805474C + b _080548A8 +_0805474C: + adds r4, r6, 0 + movs r5, 0x64 +_08054750: + ldrb r0, [r4] + muls r0, r5 + adds r0, r7, r0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08054794 + ldrb r0, [r6] + muls r0, r5 + adds r0, r7, r0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _08054794 + ldrb r0, [r4] + muls r0, r5 + adds r0, r7, r0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _08054794 + ldrb r0, [r4] + muls r0, r5 + adds r0, r7, r0 + movs r1, 0x37 + bl pokemon_getattr + cmp r0, 0 + beq _080547A4 +_08054794: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + adds r6, r4, 0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bls _08054750 +_080547A4: + ldr r1, =0x02024332 + mov r9, r1 + ldrb r2, [r1] + cmp r2, 0x5 + bhi _080548A8 + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x4 + strb r0, [r1, 0x1] + ldr r6, =0x0202420b + ldrb r0, [r6] + strb r0, [r1, 0x2] + strb r2, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x9 + str r0, [r1] + ldr r2, =0x020241f0 + mov r8, r2 + ldr r5, =gBaseStats + mov r1, r9 + ldrb r0, [r1] + movs r4, 0x64 + muls r0, r4 + adds r0, r7, r0 + movs r1, 0xB + bl pokemon_getattr + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r3, [r1, 0x1] + mov r2, r8 + str r3, [r2] + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + muls r0, r3 + mov r1, r8 + str r0, [r1] + mov r2, r9 + ldrb r0, [r2] + muls r0, r4 + adds r0, r7, r0 + movs r1, 0x38 + bl pokemon_getattr + lsls r0, 1 + movs r1, 0x5 + bl __udivsi3 + adds r0, 0x2 + mov r2, r8 + ldr r1, [r2] + muls r0, r1 + str r0, [r2] + ldr r3, =0x02024084 + ldr r1, =0x0202420c + ldrb r2, [r1] + movs r1, 0x58 + muls r1, r2 + adds r1, r3 + ldrh r2, [r1] + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r5 + ldrb r1, [r1, 0x2] + bl __divsi3 + mov r1, r8 + str r0, [r1] + movs r1, 0x32 + bl __divsi3 + adds r2, r0, 0x2 + mov r0, r8 + str r2, [r0] + ldr r1, =0x0202433c + ldrb r0, [r6] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 28 + cmp r0, 0 + bge _08054870 + lsls r0, r2, 4 + subs r0, r2 + movs r1, 0xA + bl __divsi3 + mov r1, r8 + str r0, [r1] +_08054870: + mov r2, r9 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + b _080548E2 + .pool +_080548A8: + mov r0, r8 + cmp r0, 0 + beq _080548C8 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + b _080548DC + .pool +_080548C8: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x5] + ldrb r0, [r2, 0x6] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x7] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x8] +_080548DC: + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_080548E2: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkC4_802B910 + + thumb_func_start atkC5_hidepreattack +atkC5_hidepreattack: @ 80548F4 + push {lr} + ldr r0, =0x020241ea + ldrh r1, [r0] + cmp r1, 0x5B + beq _08054934 + cmp r1, 0x5B + bgt _0805490C + cmp r1, 0x13 + beq _08054918 + b _08054960 + .pool +_0805490C: + ldr r0, =0x00000123 + cmp r1, r0 + beq _0805494C + adds r0, 0x31 + cmp r1, r0 + bne _08054960 +_08054918: + ldr r2, =0x020242ac + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r1, 2 + adds r1, r2 + ldr r0, [r1] + movs r2, 0x40 + b _0805495C + .pool +_08054934: + ldr r2, =0x020242ac + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r1, 2 + adds r1, r2 + ldr r0, [r1] + movs r2, 0x80 + b _0805495C + .pool +_0805494C: + ldr r2, =0x020242ac + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r1, 2 + adds r1, r2 + ldr r0, [r1] + movs r2, 0x80 + lsls r2, 11 +_0805495C: + orrs r0, r2 + str r0, [r1] +_08054960: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atkC5_hidepreattack + + thumb_func_start atkC6_unhidepostattack +atkC6_unhidepostattack: @ 8054978 + push {lr} + ldr r0, =0x020241ea + ldrh r1, [r0] + cmp r1, 0x5B + beq _080549BC + cmp r1, 0x5B + bgt _08054990 + cmp r1, 0x13 + beq _0805499C + b _080549EA + .pool +_08054990: + ldr r0, =0x00000123 + cmp r1, r0 + beq _080549D8 + adds r0, 0x31 + cmp r1, r0 + bne _080549EA +_0805499C: + ldr r2, =0x020242ac + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r1, 2 + adds r1, r2 + ldr r0, [r1] + movs r2, 0x41 + negs r2, r2 + b _080549E6 + .pool +_080549BC: + ldr r2, =0x020242ac + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r1, 2 + adds r1, r2 + ldr r0, [r1] + movs r2, 0x81 + negs r2, r2 + b _080549E6 + .pool +_080549D8: + ldr r2, =0x020242ac + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r1, 2 + adds r1, r2 + ldr r0, [r1] + ldr r2, =0xfffbffff +_080549E6: + ands r0, r2 + str r0, [r1] +_080549EA: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atkC6_unhidepostattack + + thumb_func_start atkC7_setminimize +atkC7_setminimize: @ 8054A08 + push {lr} + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _08054A2C + ldr r2, =0x020242ac + ldr r0, =0x0202420b + ldrb r1, [r0] + lsls r1, 2 + adds r1, r2 + ldr r0, [r1] + movs r2, 0x80 + lsls r2, 1 + orrs r0, r2 + str r0, [r1] +_08054A2C: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atkC7_setminimize + + thumb_func_start sub_8054A48 +sub_8054A48: @ 8054A48 + push {lr} + ldr r3, =0x020243cc + ldrh r1, [r3] + movs r2, 0x80 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _08054A78 + ldr r2, =0x0202427c + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1, 0x5] + b _08054A86 + .pool +_08054A78: + strh r2, [r3] + ldr r0, =0x02024332 + movs r1, 0x5 + strb r1, [r0, 0x5] + ldr r0, =0x020243d0 + adds r0, 0x28 + strb r1, [r0] +_08054A86: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8054A48 + + thumb_func_start atkC9_jumpifattackandspecialattackcannotfall +atkC9_jumpifattackandspecialattackcannotfall: @ 8054AA0 + push {r4,lr} + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r1, r0, r2 + movs r0, 0x19 + ldrsb r0, [r1, r0] + adds r3, r2, 0 + cmp r0, 0 + bne _08054AF4 + movs r0, 0x1C + ldrsb r0, [r1, r0] + cmp r0, 0 + bne _08054AF4 + ldr r0, =0x02024332 + ldrb r0, [r0, 0x6] + cmp r0, 0x1 + beq _08054AF4 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08054B20 + .pool +_08054AF4: + ldr r4, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r4] + ldr r2, =0x020241f0 + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + adds r0, r3 + ldrh r0, [r0, 0x28] + str r0, [r2] + ldr r1, =0x00007fff + movs r0, 0 + bl dp01_build_cmdbuf_x18_0_aa_health_bar_update + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08054B20: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkC9_jumpifattackandspecialattackcannotfall + + thumb_func_start atkCA_setforcedtarget +atkCA_setforcedtarget: @ 8054B3C + push {r4,r5,lr} + ldr r4, =0x0202420b + ldrb r0, [r4] + bl battle_side_get_owner + ldr r5, =0x02024294 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + movs r0, 0x1 + strb r0, [r1, 0x8] + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r4] + strb r0, [r1, 0x9] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atkCA_setforcedtarget + + thumb_func_start atkCB_setcharge +atkCB_setcharge: @ 8054B88 + push {r4,lr} + ldr r0, =0x020242ac + ldr r3, =0x0202420b + ldrb r1, [r3] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + movs r2, 0x80 + lsls r2, 2 + orrs r0, r2 + str r0, [r1] + ldr r4, =0x020242bc + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r2, [r0, 0x12] + movs r1, 0x10 + negs r1, r1 + ands r1, r2 + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0, 0x12] + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r2, [r0, 0x12] + movs r1, 0xF + ands r1, r2 + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x12] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkCB_setcharge + + thumb_func_start atkCC_callterrainattack +atkCC_callterrainattack: @ 8054BEC + push {r4,lr} + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xfffffbff + ands r0, r1 + str r0, [r2] + ldr r4, =0x020241ea + ldr r1, =gUnknown_0831C414 + ldr r0, =0x02022ff0 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r4] + ldrh r0, [r4] + movs r1, 0 + bl sub_80458E0 + ldr r1, =0x0202420c + strb r0, [r1] + ldr r3, =gUnknown_082D86A8 + ldr r2, =gBattleMoves + ldrh r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + bl b_movescr_stack_push + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkCC_callterrainattack + + thumb_func_start atkCD_cureifburnedparalysedorpoisoned +atkCD_cureifburnedparalysedorpoisoned: @ 8054C60 + push {r4-r6,lr} + sub sp, 0x4 + ldr r1, =0x02024084 + ldr r3, =0x0202420b + ldrb r0, [r3] + movs r6, 0x58 + muls r0, r6 + adds r5, r1, 0 + adds r5, 0x4C + adds r2, r0, r5 + ldr r0, [r2] + movs r1, 0xD8 + ands r0, r1 + cmp r0, 0 + beq _08054CBC + movs r0, 0 + str r0, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + ldr r4, =0x02024064 + ldrb r0, [r3] + strb r0, [r4] + ldrb r0, [r4] + muls r0, r6 + adds r0, r5 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + b _08054CD6 + .pool +_08054CBC: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08054CD6: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atkCD_cureifburnedparalysedorpoisoned + + thumb_func_start atkCE_settorment +atkCE_settorment: @ 8054CE4 + push {lr} + ldr r1, =0x02024084 + ldr r0, =0x0202420c + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 24 + cmp r1, 0 + bge _08054D28 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08054D34 + .pool +_08054D28: + orrs r1, r2 + str r1, [r0] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08054D34: + pop {r0} + bx r0 + .pool + thumb_func_end atkCE_settorment + + thumb_func_start atkCF_jumpifnodamage +atkCF_jumpifnodamage: @ 8054D3C + push {lr} + ldr r2, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r1, r0, 4 + adds r0, r2, 0x4 + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + bne _08054D5C + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r1, r0 + ldr r0, [r0] + cmp r0, 0 + beq _08054D74 +_08054D5C: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08054D8E + .pool +_08054D74: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08054D8E: + pop {r0} + bx r0 + .pool + thumb_func_end atkCF_jumpifnodamage + + thumb_func_start atkD0_settaunt +atkD0_settaunt: @ 8054D98 + push {r4,lr} + ldr r4, =0x020242bc + ldr r3, =0x0202420c + ldrb r0, [r3] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r2, r1, r4 + ldrb r1, [r2, 0x13] + lsls r0, r1, 28 + cmp r0, 0 + bne _08054DE8 + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2, 0x13] + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r2, [r0, 0x13] + movs r1, 0xF + ands r1, r2 + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x13] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08054E02 + .pool +_08054DE8: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08054E02: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkD0_settaunt + + thumb_func_start atkD1_sethelpinghand +atkD1_sethelpinghand: @ 8054E0C + push {r4,lr} + ldr r4, =0x0202420b + ldrb r0, [r4] + bl battle_get_per_side_status + movs r1, 0x2 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + ldr r3, =0x0202420c + strb r0, [r3] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08054E90 + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r3, [r3] + lsls r0, r3, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08054E90 + ldr r1, =0x0202433c + ldrb r0, [r4] + lsls r0, 4 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 28 + cmp r0, 0 + blt _08054E90 + lsls r0, r3, 4 + adds r2, r0, r1 + ldrb r1, [r2] + lsls r0, r1, 28 + cmp r0, 0 + blt _08054E90 + movs r0, 0x8 + orrs r0, r1 + strb r0, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08054EAA + .pool +_08054E90: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08054EAA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkD1_sethelpinghand + + thumb_func_start sub_8054EB4 +sub_8054EB4: @ 8054EB4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r4, =0x02022fec + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 19 + ands r0, r1 + cmp r0, 0 + bne _08054F9A + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08054EE8 + ldr r0, [r4] + ldr r1, =0x0a3f0902 + ands r0, r1 + cmp r0, 0 + beq _08054F9A +_08054EE8: + ldr r6, =0x0202420b + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + lsrs r4, r0, 24 + ldr r7, =0x0202420c + ldrb r0, [r7] + bl battle_side_get_owner + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x0a3f0902 + ands r0, r1 + cmp r0, 0 + bne _08054F46 + ldr r0, =0x020243d0 + adds r2, r0, 0 + adds r2, 0x29 + adds r0, r4, r2 + ldrb r1, [r0] + ldr r4, =gUnknown_0832A328 + ldr r3, =0x0202406e + ldrb r0, [r6] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08054F9A + adds r0, r5, r2 + ldrb r1, [r0] + ldrb r0, [r7] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08054F9A +_08054F46: + ldr r0, =0x02024084 + mov r8, r0 + ldr r1, =0x0202420b + ldrb r4, [r1] + movs r5, 0x58 + adds r0, r4, 0 + muls r0, r5 + add r0, r8 + mov r9, r0 + ldrh r3, [r0, 0x2E] + adds r1, r3, 0 + cmp r1, 0 + bne _08054F6E + ldr r0, =0x0202420c + ldrb r0, [r0] + muls r0, r5 + add r0, r8 + ldrh r0, [r0, 0x2E] + cmp r0, 0 + beq _08054F9A +_08054F6E: + cmp r1, 0xAF + beq _08054F9A + ldr r7, =0x0202420c + ldrb r0, [r7] + muls r0, r5 + mov r2, r8 + adds r1, r0, r2 + ldrh r2, [r1, 0x2E] + cmp r2, 0xAF + beq _08054F9A + adds r0, r3, 0 + subs r0, 0x79 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xB + bls _08054F9A + adds r0, r2, 0 + subs r0, 0x79 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xB + bhi _08054FDC +_08054F9A: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08055132 + .pool +_08054FDC: + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x3C + bne _08055010 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB63F + str r0, [r1] + ldr r1, =0x0202420a + ldrb r0, [r7] + muls r0, r5 + add r0, r8 + adds r0, 0x20 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + ldrb r1, [r1] + bl b_history__record_ability_usage_of_player + b _08055132 + .pool +_08055010: + ldr r3, =0x0202449c + mov r10, r3 + lsls r0, r4, 1 + adds r0, 0xD0 + ldr r1, [r3] + adds r6, r1, r0 + mov r0, r9 + ldrh r0, [r0, 0x2E] + mov r9, r0 + strh r2, [r6] + ldr r1, =0x0202420b + ldrb r0, [r1] + muls r0, r5 + add r0, r8 + movs r1, 0 + strh r1, [r0, 0x2E] + ldrb r0, [r7] + muls r0, r5 + add r0, r8 + mov r2, r9 + strh r2, [r0, 0x2E] + ldr r4, =0x02024064 + ldr r3, =0x0202420b + ldrb r0, [r3] + strb r0, [r4] + str r6, [sp] + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + movs r3, 0x2 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldr r1, =0x0202420b + ldrb r0, [r1] + bl dp01_battle_side_mark_buffer_for_execution + ldrb r0, [r7] + strb r0, [r4] + ldrb r0, [r7] + muls r0, r5 + mov r1, r8 + adds r1, 0x2E + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + movs r3, 0x2 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r7] + bl dp01_battle_side_mark_buffer_for_execution + ldrb r0, [r7] + mov r2, r10 + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC8 + movs r3, 0 + strb r3, [r0] + ldrb r0, [r7] + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC9 + strb r3, [r0] + ldr r1, =0x0202420b + ldrb r0, [r1] + ldr r1, [r2] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC8 + strb r3, [r0] + ldr r2, =0x0202420b + ldrb r0, [r2] + mov r3, r10 + ldr r1, [r3] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC9 + movs r1, 0 + strb r1, [r0] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + ldr r1, =0x02022f58 + movs r3, 0xFD + strb r3, [r1] + movs r2, 0xA + strb r2, [r1, 0x1] + ldrh r0, [r6] + strb r0, [r1, 0x2] + ldrh r0, [r6] + lsrs r0, 8 + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x02022f68 + strb r3, [r1] + strb r2, [r1, 0x1] + mov r2, r9 + strb r2, [r1, 0x2] + mov r3, r9 + lsrs r0, r3, 8 + strb r0, [r1, 0x3] + movs r0, 0x1 + negs r0, r0 + strb r0, [r1, 0x4] + cmp r3, 0 + beq _08055118 + ldrh r0, [r6] + cmp r0, 0 + beq _0805512C + ldr r1, =0x02024332 + movs r0, 0x2 + b _08055130 + .pool +_08055118: + ldrh r0, [r6] + cmp r0, 0 + beq _0805512C + ldr r0, =0x02024332 + movs r1, 0 + strb r1, [r0, 0x5] + b _08055132 + .pool +_0805512C: + ldr r1, =0x02024332 + movs r0, 0x1 +_08055130: + strb r0, [r1, 0x5] +_08055132: + 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_8054EB4 + + thumb_func_start sub_8055148 +sub_8055148: @ 8055148 + push {r4,lr} + ldr r3, =0x02024084 + ldr r4, =0x0202420c + ldrb r0, [r4] + movs r2, 0x58 + muls r0, r2 + adds r0, r3 + adds r0, 0x20 + ldrb r1, [r0] + adds r0, r1, 0 + cmp r0, 0 + beq _0805519C + cmp r0, 0x19 + beq _0805519C + ldr r0, =0x0202420b + ldrb r0, [r0] + muls r0, r2 + adds r0, r3 + adds r0, 0x20 + strb r1, [r0] + ldr r1, =0x0202420a + ldrb r0, [r4] + muls r0, r2 + adds r0, r3 + adds r0, 0x20 + ldrb r0, [r0] + strb r0, [r1] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _080551B6 + .pool +_0805519C: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_080551B6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8055148 + + thumb_func_start atkD4_802C408 +atkD4_802C408: @ 80551C0 + push {r4-r7,lr} + ldr r7, =0x02024214 + ldr r2, [r7] + ldrb r3, [r2, 0x1] + cmp r3, 0 + beq _080551D8 + cmp r3, 0x1 + beq _08055210 + b _0805528C + .pool +_080551D8: + ldr r1, =0x020243d0 + ldr r4, =0x0202420b + adds r0, r1, 0 + adds r0, 0x20 + ldrb r5, [r4] + adds r3, r0, r5 + ldrb r0, [r3] + cmp r0, 0 + bne _0805525C + movs r0, 0x2 + strb r0, [r3] + ldrb r0, [r4] + adds r1, 0x24 + adds r1, r0, r1 + ldr r2, =0x0202406e + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strb r0, [r1] + ldr r0, [r7] + adds r0, 0x6 + b _0805528A + .pool +_08055210: + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x4 + strb r0, [r1, 0x1] + ldr r4, =0x0202420c + ldrb r0, [r4] + strb r0, [r1, 0x2] + ldr r0, =0x020243d0 + adds r0, 0x24 + ldrb r5, [r4] + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + ldr r1, =0x020241f0 + ldr r6, =0x02024084 + ldrb r0, [r4] + movs r5, 0x58 + muls r0, r5 + adds r0, r6 + ldrh r0, [r0, 0x2C] + lsrs r0, 1 + str r0, [r1] + cmp r0, 0 + bne _08055248 + str r3, [r1] +_08055248: + ldr r0, [r1] + negs r0, r0 + str r0, [r1] + ldrb r0, [r4] + muls r0, r5 + adds r0, r6 + ldrh r1, [r0, 0x28] + ldrh r0, [r0, 0x2C] + cmp r1, r0 + bne _08055288 +_0805525C: + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r7] + b _0805528C + .pool +_08055288: + adds r0, r2, 0x6 +_0805528A: + str r0, [r7] +_0805528C: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end atkD4_802C408 + + thumb_func_start sub_8055294 +sub_8055294: @ 8055294 + push {lr} + ldr r1, =0x020242ac + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 2 + adds r2, r0, r1 + ldr r1, [r2] + movs r3, 0x80 + lsls r3, 3 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + beq _080552D8 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _080552E4 + .pool +_080552D8: + orrs r1, r3 + str r1, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_080552E4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8055294 + + thumb_func_start atkD6_doubledamagedealtifdamaged +atkD6_doubledamagedealtifdamaged: @ 80552EC + push {lr} + ldr r3, =0x0202433c + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r2, r0, 4 + adds r0, r3, 0x4 + adds r0, r2, r0 + ldr r0, [r0] + cmp r0, 0 + beq _0805530C + adds r0, r2, r3 + ldr r1, =0x0202420c + ldrb r0, [r0, 0xC] + ldrb r1, [r1] + cmp r0, r1 + beq _08055324 +_0805530C: + adds r0, r3, 0 + adds r0, 0x8 + adds r0, r2, r0 + ldr r0, [r0] + cmp r0, 0 + beq _0805532A + adds r0, r2, r3 + ldr r1, =0x0202420c + ldrb r0, [r0, 0xD] + ldrb r1, [r1] + cmp r0, r1 + bne _0805532A +_08055324: + ldr r1, =0x02024474 + movs r0, 0x2 + strb r0, [r1, 0xE] +_0805532A: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end atkD6_doubledamagedealtifdamaged + + thumb_func_start sub_805534C +sub_805534C: @ 805534C + push {r4,lr} + ldr r1, =0x020242ac + ldr r0, =0x0202420c + ldrb r3, [r0] + lsls r0, r3, 2 + adds r4, r0, r1 + ldr r2, [r4] + movs r0, 0xC0 + lsls r0, 5 + ands r0, r2 + cmp r0, 0 + bne _08055374 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r3 + adds r1, 0x4C + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080553A0 +_08055374: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _080553B0 + .pool +_080553A0: + movs r0, 0x80 + lsls r0, 5 + orrs r2, r0 + str r2, [r4] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_080553B0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805534C + + thumb_func_start atkD8_setdamagetohealthdifference +atkD8_setdamagetohealthdifference: @ 80553BC + push {lr} + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r0, [r0] + movs r1, 0x58 + muls r0, r1 + adds r3, r0, r2 + ldr r0, =0x0202420b + ldrb r0, [r0] + muls r0, r1 + adds r1, r0, r2 + ldrh r0, [r3, 0x28] + ldrh r2, [r1, 0x28] + cmp r0, r2 + bhi _08055408 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0805541A + .pool +_08055408: + ldr r2, =0x020241f0 + ldrh r0, [r3, 0x28] + ldrh r1, [r1, 0x28] + subs r0, r1 + str r0, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0805541A: + pop {r0} + bx r0 + .pool + thumb_func_end atkD8_setdamagetohealthdifference + + thumb_func_start atkD9_scaledamagebyhealthratio +atkD9_scaledamagebyhealthratio: @ 8055428 + push {r4,lr} + ldr r4, =0x02024400 + ldrh r0, [r4] + cmp r0, 0 + bne _08055464 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r3, [r0, 0x1] + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r1, r0 + adds r1, r2 + ldrh r0, [r1, 0x28] + muls r0, r3 + ldrh r1, [r1, 0x2C] + bl __divsi3 + strh r0, [r4] + lsls r0, 16 + cmp r0, 0 + bne _08055464 + movs r0, 0x1 + strh r0, [r4] +_08055464: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkD9_scaledamagebyhealthratio + + thumb_func_start atkDA_abilityswap +atkDA_abilityswap: @ 805548C + push {r4-r6,lr} + ldr r5, =0x02024084 + ldr r0, =0x0202420b + ldrb r0, [r0] + movs r4, 0x58 + muls r0, r4 + adds r0, r5 + adds r2, r0, 0 + adds r2, 0x20 + ldrb r1, [r2] + cmp r1, 0 + bne _080554B4 + ldr r0, =0x0202420c + ldrb r0, [r0] + muls r0, r4 + adds r0, r5 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + beq _080554D4 +_080554B4: + cmp r1, 0x19 + beq _080554D4 + ldr r6, =0x0202420c + ldrb r0, [r6] + muls r0, r4 + adds r0, r5 + adds r0, 0x20 + ldrb r3, [r0] + cmp r3, 0x19 + beq _080554D4 + ldr r0, =0x0202427c + ldrb r1, [r0] + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + beq _08055504 +_080554D4: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0805551A + .pool +_08055504: + ldrb r1, [r2] + strb r3, [r2] + ldrb r0, [r6] + muls r0, r4 + adds r0, r5 + adds r0, 0x20 + strb r1, [r0] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0805551A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atkDA_abilityswap + + thumb_func_start atkDB_imprisoneffect +atkDB_imprisoneffect: @ 8055524 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r1, =0x020242ac + ldr r4, =0x0202420b + ldrb r2, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 6 + ands r0, r1 + cmp r0, 0 + beq _08055574 + b _080555F6 + .pool +_0805554C: + ldr r0, =0x020242ac + mov r2, r9 + ldrb r1, [r2] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + movs r2, 0x80 + lsls r2, 6 + orrs r0, r2 + str r0, [r1] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _080555EE + .pool +_08055574: + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrb r0, [r4] + bl sub_803F548 + movs r6, 0 + b _080555E6 +_0805558A: + adds r0, r6, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r8, r0 + beq _080555E0 + movs r4, 0 + ldr r7, =0x0202420b + mov r9, r7 + ldr r0, =0x02024084 + mov r12, r0 + mov r1, r9 + ldrb r0, [r1] + mov r2, r12 + adds r2, 0xC + movs r1, 0x58 + muls r0, r1 + adds r3, r0, r2 + adds r5, r6, 0 + muls r5, r1 +_080555B4: + movs r2, 0 + ldrh r1, [r3] + mov r0, r12 + adds r0, 0xC + adds r0, r5, r0 +_080555BE: + ldrh r7, [r0] + cmp r1, r7 + bne _080555C8 + cmp r1, 0 + bne _080555D0 +_080555C8: + adds r0, 0x2 + adds r2, 0x1 + cmp r2, 0x3 + ble _080555BE +_080555D0: + cmp r2, 0x4 + bne _080555DC + adds r3, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _080555B4 +_080555DC: + cmp r4, 0x4 + bne _0805554C +_080555E0: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_080555E6: + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r6, r0 + bcc _0805558A +_080555EE: + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r6, r0 + bne _08055610 +_080555F6: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08055610: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkDB_imprisoneffect + + thumb_func_start atkDC_setgrudge +atkDC_setgrudge: @ 805562C + push {lr} + ldr r1, =0x020242ac + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 2 + adds r2, r0, r1 + ldr r1, [r2] + movs r3, 0x80 + lsls r3, 7 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + beq _08055670 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0805567C + .pool +_08055670: + orrs r1, r3 + str r1, [r2] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0805567C: + pop {r0} + bx r0 + .pool + thumb_func_end atkDC_setgrudge + + thumb_func_start atkDD_weightdamagecalculation +atkDD_weightdamagecalculation: @ 8055684 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r5, 0 + ldr r2, =gUnknown_0831C428 + ldrh r0, [r2] + ldr r1, =0x0000ffff + cmp r0, r1 + beq _080556FC + adds r6, r2, 0 + ldr r0, =0x02024084 + mov r8, r0 + adds r7, r1, 0 + adds r4, r6, 0 +_080556A0: + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + add r0, r8 + ldrh r0, [r0] + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl sub_80C0630 + ldrh r1, [r4] + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + bhi _080556CE + adds r4, 0x4 + adds r5, 0x2 + ldrh r0, [r4] + cmp r0, r7 + bne _080556A0 +_080556CE: + lsls r0, r5, 1 + adds r0, r6 + ldrh r1, [r0] + ldr r0, =0x0000ffff + cmp r1, r0 + beq _080556FC + ldr r0, =0x02024400 + adds r1, r5, 0x1 + lsls r1, 1 + adds r1, r6 + ldrh r1, [r1] + strh r1, [r0] + b _08055702 + .pool +_080556FC: + ldr r1, =0x02024400 + movs r0, 0x78 + strh r0, [r1] +_08055702: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkDD_weightdamagecalculation + + thumb_func_start atkDE_asistattackselect +atkDE_asistattackselect: @ 805571C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + movs r0, 0 + mov r10, r0 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x18 + str r0, [sp, 0x4] + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_get_per_side_status + movs r1, 0x1 + ands r1, r0 + ldr r0, =0x020244ec + str r0, [sp] + cmp r1, 0 + beq _0805574C + ldr r1, =0x02024744 + str r1, [sp] +_0805574C: + movs r2, 0 +_0805574E: + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + adds r1, r2, 0x1 + str r1, [sp, 0x8] + ldrh r0, [r0] + cmp r2, r0 + beq _080557F4 + movs r0, 0x64 + adds r6, r2, 0 + muls r6, r0 + ldr r0, [sp] + adds r4, r0, r6 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _080557F4 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _080557F4 + movs r5, 0 + ldr r1, =0x0000ffff + mov r8, r1 + mov r9, r6 + mov r1, r10 + lsls r0, r1, 1 + ldr r1, [sp, 0x4] + adds r6, r0, r1 +_08055798: + movs r7, 0 + adds r1, r5, 0 + adds r1, 0xD + ldr r0, [sp] + add r0, r9 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl sub_8052F84 + lsls r0, 24 + adds r1, r5, 0x1 + cmp r0, 0 + bne _080557EE + ldr r0, =gUnknown_0831C3E0 + ldrh r2, [r0] + adds r3, r0, 0 + cmp r2, r8 + beq _080557E2 + cmp r4, r2 + beq _080557D8 + ldr r5, =0x0000ffff + adds r2, r3, 0 +_080557CA: + adds r2, 0x2 + adds r7, 0x1 + ldrh r0, [r2] + cmp r0, r5 + beq _080557E2 + cmp r4, r0 + bne _080557CA +_080557D8: + lsls r0, r7, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r8 + bne _080557EE +_080557E2: + cmp r4, 0 + beq _080557EE + strh r4, [r6] + adds r6, 0x2 + movs r0, 0x1 + add r10, r0 +_080557EE: + adds r5, r1, 0 + cmp r5, 0x3 + ble _08055798 +_080557F4: + ldr r2, [sp, 0x8] + cmp r2, 0x5 + ble _0805574E + mov r1, r10 + cmp r1, 0 + beq _0805586C + ldr r2, =0x02024280 + ldr r0, [r2] + ldr r1, =0xfffffbff + ands r0, r1 + str r0, [r2] + ldr r4, =0x020241ee + bl GenerateRandomNumber + movs r1, 0xFF + ands r1, r0 + mov r0, r10 + muls r0, r1 + asrs r0, 8 + lsls r0, 1 + ldr r1, [sp, 0x4] + adds r0, r1 + ldrh r0, [r0] + strh r0, [r4] + ldrh r0, [r4] + movs r1, 0 + bl sub_80458E0 + ldr r1, =0x0202420c + strb r0, [r1] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08055886 + .pool +_0805586C: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08055886: + 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 atkDE_asistattackselect + + thumb_func_start atkDF_setmagiccoat +atkDF_setmagiccoat: @ 805589C + push {lr} + ldr r1, =0x0202420c + ldr r3, =0x0202420b + ldrb r0, [r3] + strb r0, [r1] + ldr r2, =0x0202437c + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0] + ldr r0, =0x02024082 + ldrb r1, [r0] + ldr r0, =0x0202406c + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _080558FC + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08055914 + .pool +_080558FC: + ldr r0, =0x0202433c + ldrb r1, [r3] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x10 + orrs r0, r2 + strb r0, [r1] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08055914: + pop {r0} + bx r0 + .pool + thumb_func_end atkDF_setmagiccoat + + thumb_func_start atkE0_setstealstatchange +atkE0_setstealstatchange: @ 8055920 + push {lr} + ldr r2, =0x0202437c + ldr r3, =0x0202420b + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0] + ldr r0, =0x02024082 + ldrb r1, [r0] + ldr r0, =0x0202406c + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _08055978 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _0805598E + .pool +_08055978: + ldr r0, =0x0202433c + ldrb r1, [r3] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1] + orrs r0, r2 + strb r0, [r1] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_0805598E: + pop {r0} + bx r0 + .pool + thumb_func_end atkE0_setstealstatchange + + thumb_func_start atkE1_802CBE4 +atkE1_802CBE4: @ 805599C + push {r4-r6,lr} + ldr r4, =0x02024474 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0xD8 + ldrb r0, [r0] + strb r0, [r4, 0x17] + ldrb r0, [r4, 0x17] + bl battle_side_get_owner + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, =0x02022f58 + movs r0, 0xFD + strb r0, [r2] + movs r0, 0x9 + strb r0, [r2, 0x1] + ldr r3, =0x02024084 + ldrb r1, [r4, 0x17] + movs r0, 0x58 + muls r0, r1 + adds r0, r3 + adds r0, 0x20 + ldrb r0, [r0] + strb r0, [r2, 0x2] + movs r0, 0xFF + strb r0, [r2, 0x3] + ldr r2, =0x0202420c + ldr r1, =0x0202406c + ldrb r0, [r2] + ldrb r1, [r1] + cmp r0, r1 + bcs _08055A22 + adds r4, r2, 0 + ldr r6, =gUnknown_0832A328 +_080559E2: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + beq _08055A04 + ldr r0, =0x02024210 + ldrb r1, [r0] + ldrb r0, [r4] + lsls r0, 2 + adds r0, r6 + ldr r0, [r0] + ands r1, r0 + ldr r2, =0x0202406c + cmp r1, 0 + beq _08055A18 +_08055A04: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + adds r2, r1, 0 + ldrb r1, [r2] + cmp r0, r1 + bcc _080559E2 +_08055A18: + ldr r0, =0x0202420c + ldrb r0, [r0] + ldrb r2, [r2] + cmp r0, r2 + bcc _08055A64 +_08055A22: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _08055A6C + .pool +_08055A64: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_08055A6C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atkE1_802CBE4 + + thumb_func_start atkE2_cmde2 +atkE2_cmde2: @ 8055A78 + push {r4-r6,lr} + sub sp, 0x4 + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r4, =0x02024064 + strb r0, [r4] + ldr r3, =0x02024084 + ldrb r0, [r4] + movs r6, 0x58 + adds r1, r0, 0 + muls r1, r6 + adds r0, r1, r3 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1E + bne _08055AD2 + adds r3, 0x4C + adds r1, r3 + movs r0, 0 + str r0, [r1] + ldr r2, =gUnknown_0832A328 + ldrb r1, [r4] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, r1, r0 + adds r0, 0x58 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldrb r2, [r0] + adds r0, r1, 0 + muls r0, r6 + adds r0, r3 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_08055AD2: + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atkE2_cmde2 + + thumb_func_start atkE3_jumpiffainted +atkE3_jumpiffainted: @ 8055AF4 + push {r4,lr} + ldr r4, =0x02024214 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl get_battle_side_of_something + ldr r1, =0x02024064 + strb r0, [r1] + ldr r2, =0x02024084 + ldrb r1, [r1] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0, 0x28] + cmp r0, 0 + bne _08055B3C + ldr r2, [r4] + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x3] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x5] + lsls r0, 24 + orrs r1, r0 + str r1, [r4] + b _08055B42 + .pool +_08055B3C: + ldr r0, [r4] + adds r0, 0x6 + str r0, [r4] +_08055B42: + pop {r4} + pop {r0} + bx r0 + thumb_func_end atkE3_jumpiffainted + + thumb_func_start sub_8055B48 +sub_8055B48: @ 8055B48 + push {lr} + ldr r0, =0x02022ff0 + ldrb r0, [r0] + cmp r0, 0x7 + bhi _08055BE4 + lsls r0, 2 + ldr r1, =_08055B64 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08055B64: + .4byte _08055B84 + .4byte _08055B90 + .4byte _08055B9C + .4byte _08055BA8 + .4byte _08055BB4 + .4byte _08055BC0 + .4byte _08055BCC + .4byte _08055BD8 +_08055B84: + ldr r1, =0x02024332 + movs r0, 0x2 + b _08055BE8 + .pool +_08055B90: + ldr r1, =0x02024332 + movs r0, 0x1 + b _08055BE8 + .pool +_08055B9C: + ldr r1, =0x02024332 + movs r0, 0x1B + b _08055BE8 + .pool +_08055BA8: + ldr r1, =0x02024332 + movs r0, 0x17 + b _08055BE8 + .pool +_08055BB4: + ldr r1, =0x02024332 + movs r0, 0x16 + b _08055BE8 + .pool +_08055BC0: + ldr r1, =0x02024332 + movs r0, 0x18 + b _08055BE8 + .pool +_08055BCC: + ldr r1, =0x02024332 + movs r0, 0x7 + b _08055BE8 + .pool +_08055BD8: + ldr r1, =0x02024332 + movs r0, 0x8 + b _08055BE8 + .pool +_08055BE4: + ldr r1, =0x02024332 + movs r0, 0x5 +_08055BE8: + strb r0, [r1, 0x3] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8055B48 + + thumb_func_start atkE5_pickupitemcalculation +atkE5_pickupitemcalculation: @ 8055C00 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + bl InBattlePike + lsls r0, 24 + cmp r0, 0 + beq _08055C18 + b _08055DD8 +_08055C18: + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _08055CC4 + movs r6, 0 + mov r7, sp + ldr r0, =gBaseStats + mov r8, r0 +_08055C2A: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + strh r0, [r7] + adds r0, r4, 0 + movs r1, 0x2E + bl pokemon_getattr + cmp r0, 0 + beq _08055C6C + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + add r0, r8 + ldrb r0, [r0, 0x17] + b _08055C76 + .pool +_08055C6C: + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + add r0, r8 + ldrb r0, [r0, 0x16] +_08055C76: + cmp r0, 0x35 + bne _08055CB6 + cmp r5, 0 + beq _08055CB6 + movs r0, 0xCE + lsls r0, 1 + cmp r5, r0 + beq _08055CB6 + ldrh r0, [r7] + cmp r0, 0 + bne _08055CB6 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _08055CB6 + bl CalculateBattlePyramidPickupItemId + strh r0, [r7] + movs r0, 0x64 + muls r0, r6 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr +_08055CB6: + adds r6, 0x1 + cmp r6, 0x5 + ble _08055C2A + b _08055DD8 + .pool +_08055CC4: + movs r6, 0 + movs r1, 0x64 + mov r8, r1 + ldr r7, =0x020244ec + mov r10, sp +_08055CCE: + mov r4, r8 + muls r4, r6 + adds r4, r7 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + mov r1, r10 + strh r0, [r1] + adds r0, r4, 0 + movs r1, 0x2E + bl pokemon_getattr + cmp r0, 0 + beq _08055D30 + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + ldr r1, =gBaseStats + adds r0, r1 + ldrb r0, [r0, 0x17] + b _08055D3C + .pool +_08055D10: + mov r0, r8 + muls r0, r6 + adds r0, r7 + adds r2, r1, 0 + adds r2, 0x63 + subs r2, r4 + lsls r2, 1 + ldr r1, =gRarePickupItems + adds r2, r1 + movs r1, 0xC + bl pokemon_setattr + b _08055DD0 + .pool +_08055D30: + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + ldr r1, =gBaseStats + adds r0, r1 + ldrb r0, [r0, 0x16] +_08055D3C: + adds r1, r6, 0x1 + mov r9, r1 + cmp r0, 0x35 + bne _08055DD0 + cmp r5, 0 + beq _08055DD0 + movs r0, 0xCE + lsls r0, 1 + cmp r5, r0 + beq _08055DD0 + mov r1, r10 + ldrh r0, [r1] + cmp r0, 0 + bne _08055DD0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _08055DD0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 + mov r0, r8 + muls r0, r6 + adds r0, r7 + movs r1, 0x38 + bl pokemon_getattr + subs r0, 0x1 + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x9 + bls _08055D9C + movs r1, 0x9 +_08055D9C: + movs r2, 0 + b _08055DAE + .pool +_08055DA4: + adds r0, r4, 0 + subs r0, 0x62 + cmp r0, 0x1 + bls _08055D10 + adds r2, 0x1 +_08055DAE: + cmp r2, 0x8 + bgt _08055DD0 + ldr r0, =gPickupProbabilities + adds r0, r2, r0 + ldrb r0, [r0] + cmp r0, r4 + ble _08055DA4 + mov r0, r8 + muls r0, r6 + adds r0, r7 + adds r2, r1, r2 + lsls r2, 1 + ldr r1, =gPickupItems + adds r2, r1 + movs r1, 0xC + bl pokemon_setattr +_08055DD0: + mov r6, r9 + cmp r6, 0x5 + bgt _08055DD8 + b _08055CCE +_08055DD8: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + 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 atkE5_pickupitemcalculation + + thumb_func_start atkE6_castform_transform +atkE6_castform_transform: @ 8055DFC + push {r4,lr} + ldr r4, =0x02024064 + ldr r0, =0x02024474 + ldrb r0, [r0, 0x17] + strb r0, [r4] + ldr r1, =0x02024084 + ldrb r2, [r4] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + ldr r3, =0x0202449c + cmp r0, 0 + beq _08055E2C + ldr r0, [r3] + adds r0, 0x7F + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] +_08055E2C: + ldr r0, [r3] + adds r0, 0x7F + ldrb r2, [r0] + movs r0, 0 + movs r1, 0 + bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkE6_castform_transform + + thumb_func_start atkE7_castform_switch +atkE7_castform_switch: @ 8055E64 + push {r4,lr} + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r0, =0x02024474 + ldrb r0, [r0, 0x17] + bl castform_switch + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _08055E8E + ldr r0, =gUnknown_082DB4A9 + bl b_push_move_exec + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x7F + subs r1, r4, 0x1 + strb r1, [r0] +_08055E8E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkE7_castform_switch + + thumb_func_start atkE8_settypebasedhalvers +atkE8_settypebasedhalvers: @ 8055EA4 + push {r4,lr} + movs r4, 0 + ldr r2, =gBattleMoves + ldr r0, =0x020241ea + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0xC9 + bne _08055EF4 + ldr r1, =0x020242ac + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 2 + adds r2, r0, r1 + ldr r1, [r2] + movs r3, 0x80 + lsls r3, 9 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + bne _08055F18 + orrs r1, r3 + str r1, [r2] + ldr r0, =0x02024332 + strb r4, [r0, 0x5] + b _08055F1C + .pool +_08055EF4: + ldr r1, =0x020242ac + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 2 + adds r2, r0, r1 + ldr r1, [r2] + movs r3, 0x80 + lsls r3, 10 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + bne _08055F18 + orrs r1, r3 + str r1, [r2] + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + movs r4, 0x1 +_08055F18: + cmp r4, 0 + beq _08055F38 +_08055F1C: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08055F52 + .pool +_08055F38: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08055F52: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkE8_settypebasedhalvers + + thumb_func_start atkE9_seteffectbyweather +atkE9_seteffectbyweather: @ 8055F5C + push {lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0xD + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08055FFC + str r0, [sp] + movs r0, 0x13 + movs r1, 0 + movs r2, 0x4D + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + bne _08055FFC + ldr r2, =0x020243cc + ldrb r0, [r2] + cmp r0, 0 + beq _08055F9A + ldr r1, =0x02024474 + movs r0, 0x2 + strb r0, [r1, 0xE] +_08055F9A: + ldrh r1, [r2] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08055FB8 + ldr r0, =0x0202449c + ldr r1, [r0] + movs r0, 0x8B + b _08055FFA + .pool +_08055FB8: + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + beq _08055FCC + ldr r0, =0x0202449c + ldr r1, [r0] + movs r0, 0x85 + b _08055FFA + .pool +_08055FCC: + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _08055FE0 + ldr r0, =0x0202449c + ldr r1, [r0] + movs r0, 0x8A + b _08055FFA + .pool +_08055FE0: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08055FF4 + ldr r0, =0x0202449c + ldr r1, [r0] + movs r0, 0x8F + b _08055FFA + .pool +_08055FF4: + ldr r0, =0x0202449c + ldr r1, [r0] + movs r0, 0x80 +_08055FFA: + strb r0, [r1, 0x13] +_08055FFC: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end atkE9_seteffectbyweather + + thumb_func_start atkEA_recycleitem +atkEA_recycleitem: @ 8056014 + push {r4-r7,lr} + sub sp, 0x4 + ldr r7, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r7] + ldr r1, =0x0202449c + ldrb r2, [r7] + lsls r0, r2, 1 + adds r0, 0xB8 + ldr r1, [r1] + adds r6, r1, r0 + ldrh r5, [r6] + cmp r5, 0 + beq _08056094 + ldr r4, =0x02024084 + movs r3, 0x58 + adds r0, r2, 0 + muls r0, r3 + adds r0, r4 + ldrh r0, [r0, 0x2E] + cmp r0, 0 + bne _08056094 + ldr r1, =0x02024208 + strh r5, [r1] + strh r0, [r6] + ldrb r0, [r7] + muls r0, r3 + adds r0, r4 + ldrh r1, [r1] + strh r1, [r0, 0x2E] + ldrb r0, [r7] + muls r0, r3 + adds r1, r4, 0 + adds r1, 0x2E + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x2 + movs r2, 0 + movs r3, 0x2 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r7] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _080560AE + .pool +_08056094: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_080560AE: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkEA_recycleitem + + thumb_func_start atkEB_settypetoterrain +atkEB_settypetoterrain: @ 80560BC + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x02024084 + mov r8, r0 + ldr r7, =0x0202420b + ldrb r0, [r7] + movs r6, 0x58 + muls r0, r6 + mov r1, r8 + adds r3, r0, r1 + movs r0, 0x21 + adds r0, r3 + mov r12, r0 + ldr r5, =gUnknown_0831C483 + ldr r4, =0x02022ff0 + ldrb r0, [r4] + adds r0, r5 + ldrb r2, [r0] + mov r1, r12 + ldrb r0, [r1] + adds r1, r2, 0 + cmp r0, r1 + beq _08056144 + adds r0, r3, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, r1 + beq _08056144 + mov r0, r12 + strb r2, [r0] + ldrb r0, [r7] + adds r1, r0, 0 + muls r1, r6 + add r1, r8 + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + adds r1, 0x22 + strb r0, [r1] + ldr r1, =0x02022f58 + movs r0, 0xFD + strb r0, [r1] + movs r0, 0x3 + strb r0, [r1, 0x1] + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1, 0x2] + movs r0, 0xFF + strb r0, [r1, 0x3] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _0805615E + .pool +_08056144: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_0805615E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkEB_settypetoterrain + + thumb_func_start atkEC_802D2A0 +atkEC_802D2A0: @ 805616C + push {r4-r6,lr} + ldr r5, =0x0202420b + ldrb r0, [r5] + bl battle_get_per_side_status + movs r1, 0x2 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + ldr r4, =0x02024064 + strb r0, [r4] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r6, 0x1 + ands r0, r6 + cmp r0, 0 + beq _0805620C + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r3, [r4] + lsls r0, r3, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0805620C + ldr r0, =0x0202421c + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + bne _0805620C + ldr r1, =0x02024274 + lsls r0, r3, 1 + adds r0, r1 + ldrh r2, [r0] + cmp r2, 0xE4 + bne _0805620C + ldr r0, =0x0202407a + adds r0, r3, r0 + movs r1, 0xB + strb r1, [r0] + ldr r0, =0x020241ea + strh r2, [r0] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + ldr r0, =0x02024474 + strb r6, [r0, 0x18] + ldrb r1, [r5] + adds r0, 0x20 + strb r1, [r0] + ldrb r0, [r4] + strb r0, [r5] + b _08056226 + .pool +_0805620C: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08056226: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end atkEC_802D2A0 + + thumb_func_start atkED_802D364 +atkED_802D364: @ 8056230 + push {r4,lr} + ldr r1, =0x0202420e + ldr r3, =0x0202420b + ldrb r0, [r3] + strb r0, [r1] + ldr r2, =0x0202420c + lsls r0, 24 + lsrs r0, 24 + adds r4, r1, 0 + ldrb r1, [r2] + cmp r0, r1 + bne _08056264 + ldr r1, =0x02024474 + ldrb r0, [r1, 0x17] + strb r0, [r2] + strb r0, [r3] + b _0805626A + .pool +_08056264: + ldr r1, =0x02024474 + ldrb r0, [r1, 0x17] + strb r0, [r2] +_0805626A: + ldrb r0, [r4] + strb r0, [r1, 0x17] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkED_802D364 + + thumb_func_start atkEE_removereflectlightscreen +atkEE_removereflectlightscreen: @ 8056284 + push {r4,lr} + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02024294 + lsls r3, r0, 1 + adds r0, r3, r0 + lsls r0, 2 + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0 + bne _080562AC + ldrb r1, [r4, 0x2] + cmp r1, 0 + beq _080562E4 +_080562AC: + ldr r2, =0x0202428e + adds r2, r3, r2 + ldrh r1, [r2] + ldr r0, =0x0000fffe + ands r0, r1 + movs r3, 0 + ldr r1, =0x0000fffd + ands r0, r1 + strh r0, [r2] + strb r3, [r4] + strb r3, [r4, 0x2] + ldr r1, =0x02024474 + movs r0, 0x1 + strb r0, [r1, 0x18] + strb r0, [r1, 0x19] + b _080562EA + .pool +_080562E4: + ldr r0, =0x02024474 + strb r1, [r0, 0x18] + strb r1, [r0, 0x19] +_080562EA: + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end atkEE_removereflectlightscreen + + thumb_func_start sub_8056300 +sub_8056300: @ 8056300 + push {r4-r6,lr} + movs r4, 0 + ldr r0, =0x02024068 + ldr r0, [r0] + cmp r0, 0 + beq _0805630E + b _08056696 +_0805630E: + ldr r5, =0x02024064 + ldr r0, =0x0202420b + ldrb r0, [r0] + strb r0, [r5] + ldr r6, =0x0202420c + movs r1, 0x1 + eors r0, r1 + strb r0, [r6] + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0805635C + movs r0, 0 + movs r1, 0x5 + bl dp01_build_cmdbuf_x0D_a + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DBE02 + b _08056694 + .pool +_0805635C: + movs r0, 0x80 + lsls r0, 2 + ands r1, r0 + cmp r1, 0 + beq _08056384 + movs r0, 0 + movs r1, 0x4 + bl dp01_build_cmdbuf_x0D_a + ldrb r0, [r5] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DBDCA + b _08056694 + .pool +_08056384: + ldr r0, =0x02024208 + ldrh r0, [r0] + cmp r0, 0x5 + bne _080563B0 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x7C + ldrb r0, [r0] + lsls r1, r0, 2 + adds r1, r0 + lsls r0, r1, 8 + subs r0, r1 + movs r1, 0x64 + bl __divsi3 + lsls r0, 24 + lsrs r5, r0, 24 + b _080563C8 + .pool +_080563B0: + ldr r3, =gBaseStats + ldr r2, =0x02024084 + ldrb r1, [r6] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r5, [r0, 0x8] +_080563C8: + ldr r2, =0x02024208 + ldrh r0, [r2] + cmp r0, 0x5 + bhi _080563D2 + b _080564C8 +_080563D2: + subs r0, 0x6 + cmp r0, 0x6 + bls _080563DA + b _080564D2 +_080563DA: + lsls r0, 2 + ldr r1, =_080563F4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080563F4: + .4byte _08056410 + .4byte _08056440 + .4byte _08056452 + .4byte _08056480 + .4byte _080564B0 + .4byte _08056472 + .4byte _08056472 +_08056410: + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r1, r0, 0 + adds r1, 0x21 + ldrb r1, [r1] + cmp r1, 0xB + beq _080564A4 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0xB + beq _080564A4 + cmp r1, 0x6 + beq _080564A4 + cmp r0, 0x6 + beq _080564A4 + b _08056472 + .pool +_08056440: + bl sav1_map_get_light_level + lsls r0, 24 + lsrs r0, 24 + movs r4, 0xA + cmp r0, 0x5 + bne _080564D2 + movs r4, 0x23 + b _080564D2 +_08056452: + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x2A + ldrb r1, [r0] + cmp r1, 0x27 + bhi _08056472 + movs r0, 0x28 + subs r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x9 + bhi _080564D2 +_08056472: + movs r4, 0xA + b _080564D2 + .pool +_08056480: + ldr r2, =0x02024084 + ldr r0, =0x0202420c + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r0, [r0] + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + movs r4, 0xA + cmp r0, 0 + beq _080564D2 +_080564A4: + movs r4, 0x1E + b _080564D2 + .pool +_080564B0: + ldr r0, =0x03005d10 + ldrb r0, [r0, 0x13] + adds r0, 0xA + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x28 + bls _080564D2 + movs r4, 0x28 + b _080564D2 + .pool +_080564C8: + ldr r1, =gUnknown_0831C48D + ldrh r0, [r2] + subs r0, 0x2 + adds r0, r1 + ldrb r4, [r0] +_080564D2: + adds r0, r5, 0 + muls r0, r4 + movs r1, 0xA + bl __divsi3 + ldr r5, =0x02024084 + ldr r1, =0x0202420c + ldrb r2, [r1] + movs r1, 0x58 + adds r4, r2, 0 + muls r4, r1 + adds r3, r4, r5 + ldrh r2, [r3, 0x2C] + lsls r1, r2, 1 + adds r1, r2 + ldrh r2, [r3, 0x28] + lsls r2, 1 + subs r2, r1, r2 + muls r0, r2 + bl __divsi3 + adds r6, r0, 0 + adds r5, 0x4C + adds r4, r5 + ldr r4, [r4] + movs r0, 0x27 + ands r0, r4 + cmp r0, 0 + beq _0805650E + lsls r6, 1 +_0805650E: + movs r0, 0xD8 + ands r4, r0 + cmp r4, 0 + beq _08056522 + lsls r0, r6, 4 + subs r0, r6 + movs r1, 0xA + bl __udivsi3 + adds r6, r0, 0 +_08056522: + ldr r1, =0x02024208 + ldrh r0, [r1] + cmp r0, 0x5 + beq _08056564 + cmp r0, 0x1 + bne _08056550 + ldr r0, =0x03005d10 + ldrb r1, [r0, 0x5] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0, 0x5] + b _08056564 + .pool +_08056550: + ldr r0, =0x03005d10 + ldrh r1, [r1] + adds r0, r1 + adds r1, r0, 0 + adds r1, 0x34 + ldrb r0, [r1] + cmp r0, 0xFE + bhi _08056564 + adds r0, 0x1 + strb r0, [r1] +_08056564: + cmp r6, 0xFE + bls _080565C8 + movs r0, 0 + movs r1, 0x4 + bl dp01_build_cmdbuf_x0D_a + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DBD84 + str r0, [r1] + ldr r1, =0x0202406e + ldr r0, =0x0202420c + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + ldr r2, =0x02024208 + movs r1, 0x26 + bl pokemon_setattr + bl calc_player_party_count + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + beq _08056656 + b _08056680 + .pool +_080565C8: + movs r0, 0xFF + lsls r0, 16 + adds r1, r6, 0 + bl __udivsi3 + bl Sqrt + lsls r0, 16 + lsrs r0, 16 + bl Sqrt + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =0x000ffff0 + adds r1, r6, 0 + bl __udivsi3 + adds r6, r0, 0 + movs r4, 0 + b _080565FA + .pool +_080565F4: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_080565FA: + cmp r4, 0x3 + bhi _0805660A + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + cmp r0, r6 + bcc _080565F4 +_0805660A: + ldr r5, =0x02024208 + ldrh r0, [r5] + cmp r0, 0x1 + bne _08056614 + movs r4, 0x4 +_08056614: + movs r0, 0 + adds r1, r4, 0 + bl dp01_build_cmdbuf_x0D_a + ldr r0, =0x02024064 + ldrb r0, [r0] + bl dp01_battle_side_mark_buffer_for_execution + cmp r4, 0x4 + bne _0805668C + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DBD84 + str r0, [r1] + ldr r1, =0x0202406e + ldr r0, =0x0202420c + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x26 + adds r2, r5, 0 + bl pokemon_setattr + bl calc_player_party_count + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + bne _08056680 +_08056656: + ldr r1, =0x02024332 + movs r0, 0 + strb r0, [r1, 0x5] + b _08056696 + .pool +_08056680: + ldr r1, =0x02024332 + movs r0, 0x1 + strb r0, [r1, 0x5] + b _08056696 + .pool +_0805668C: + ldr r0, =0x02024332 + strb r4, [r0, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DBDD4 +_08056694: + str r0, [r1] +_08056696: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8056300 + + thumb_func_start atkF0_catch_pokemon +atkF0_catch_pokemon: @ 80566A8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x0202406e + mov r9, r0 + ldr r5, =0x0202420b + ldrb r0, [r5] + movs r6, 0x1 + eors r0, r6 + lsls r0, 1 + add r0, r9 + ldrh r0, [r0] + movs r7, 0x64 + muls r0, r7 + ldr r1, =0x02024744 + mov r8, r1 + add r0, r8 + bl pokemon_catch + lsls r0, 24 + cmp r0, 0 + beq _08056792 + bl sub_813B21C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08056734 + ldr r0, =0x02024332 + strb r1, [r0, 0x5] + ldr r4, =0x02021cc4 + ldr r0, =0x00004036 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + bl sav3_get_box_name + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + ldrb r0, [r5] + eors r0, r6 + lsls r0, 1 + add r0, r9 + ldrh r0, [r0] + muls r0, r7 + add r0, r8 + ldr r2, =0x02021dc4 + movs r1, 0x2 + bl pokemon_getattr + b _0805677E + .pool +_08056734: + ldr r4, =0x02021cc4 + ldr r0, =0x00004036 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + bl sav3_get_box_name + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + ldrb r0, [r5] + eors r0, r6 + lsls r0, 1 + add r0, r9 + ldrh r0, [r0] + muls r0, r7 + add r0, r8 + ldr r2, =0x02021dc4 + movs r1, 0x2 + bl pokemon_getattr + ldr r4, =0x02021ec4 + bl get_unknown_box_id + lsls r0, 24 + lsrs r0, 24 + bl sav3_get_box_name + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + ldr r1, =0x02024332 + movs r0, 0x2 + strb r0, [r1, 0x5] +_0805677E: + ldr r0, =0x000008ab + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08056792 + ldr r1, =0x02024332 + ldrb r0, [r1, 0x5] + adds r0, 0x1 + strb r0, [r1, 0x5] +_08056792: + ldr r0, =0x0202406e + mov r10, r0 + ldr r1, =0x0202420b + mov r9, r1 + ldrb r0, [r1] + movs r4, 0x1 + eors r0, r4 + lsls r0, 1 + add r0, r10 + ldrh r0, [r0] + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r6, =0x02024744 + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + ldr r5, =0x03005d10 + strh r0, [r5, 0x28] + mov r1, r9 + ldrb r0, [r1] + eors r0, r4 + lsls r0, 1 + add r0, r10 + ldrh r0, [r0] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r6 + adds r2, r5, 0 + adds r2, 0x2A + movs r1, 0x2 + bl pokemon_getattr + mov r1, r9 + ldrb r0, [r1] + eors r4, r0 + lsls r4, 1 + add r4, r10 + ldrh r0, [r4] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r6 + movs r1, 0x26 + movs r2, 0 + bl pokemon_getattr + movs r1, 0xF + ands r0, r1 + lsls r0, 2 + ldrb r2, [r5, 0x5] + movs r1, 0x3D + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0x5] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end atkF0_catch_pokemon + + thumb_func_start atkF1_802D95C +atkF1_802D95C: @ 8056850 + push {r4,r5,lr} + ldr r4, =0x02024744 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + adds r0, r5, 0 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080568A8 + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _080568C2 + .pool +_080568A8: + adds r0, r5, 0 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + adds r2, r4, 0 + bl SetPokedexFlag + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] +_080568C2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end atkF1_802D95C + + thumb_func_start sub_80568CC +sub_80568CC: @ 80568CC + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x02024744 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x02024332 + ldrb r0, [r0] + cmp r0, 0x5 + bls _080568E8 + b _08056A2C +_080568E8: + lsls r0, 2 + ldr r1, =_08056900 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08056900: + .4byte _08056918 + .4byte _0805692A + .4byte _08056978 + .4byte _080569C8 + .4byte _080569E0 + .4byte _08056A18 +_08056918: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _08056A06 +_0805692A: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08056938 + b _08056A2C +_08056938: + bl FreeAllWindowBuffers + adds r0, r4, 0 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + ldr r3, =0x02024084 + ldr r1, =0x0202420c + ldrb r2, [r1] + movs r1, 0x58 + muls r2, r1 + adds r1, r3, 0 + adds r1, 0x54 + adds r1, r2, r1 + ldr r1, [r1] + adds r3, 0x48 + adds r2, r3 + ldr r2, [r2] + bl sub_80BFDF4 + ldr r1, =0x02024332 + strb r0, [r1, 0x1] + b _08056A08 + .pool +_08056978: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08056A2C + ldr r0, =0x030022c0 + ldr r1, [r0, 0x4] + ldr r0, =sub_8038420 + cmp r1, r0 + bne _08056A2C + ldr r2, =0x03005e00 + ldr r4, =0x02024332 + ldrb r1, [r4, 0x1] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08056A2C + ldr r0, =vblank_cb_08078BB4 + bl SetVBlankCallback + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _08056A2C + .pool +_080569C8: + bl c2_berry_program_update_menu + bl sub_8035AA4 + ldr r1, =0x02022e20 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + b _08056A06 + .pool +_080569E0: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08056A2C + ldr r0, =0x0000ffff + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r0, 0 + bl ShowBg + movs r0, 0x3 + bl ShowBg +_08056A06: + ldr r1, =0x02024332 +_08056A08: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08056A2C + .pool +_08056A18: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08056A2C + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_08056A2C: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80568CC + + thumb_func_start sub_8056A3C +sub_8056A3C: @ 8056A3C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + ldr r4, [sp, 0x40] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x10] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x1C] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x14] + lsls r4, 24 + lsrs r4, 24 + mov r10, r4 + movs r1, 0 + add r0, sp, 0xC + strh r1, [r0] + ldr r6, [sp, 0x10] + cmp r6, r3 + ble _08056A76 + b _08056B62 +_08056A76: + mov r4, r8 + adds r0, r6, 0x1 + str r0, [sp, 0x18] + ldr r2, [sp, 0x1C] + cmp r4, r2 + bgt _08056B58 + add r5, sp, 0xC + lsls r7, r6, 24 + mov r9, r7 +_08056A88: + ldr r0, [sp, 0x10] + cmp r6, r0 + bne _08056AB4 + cmp r4, r8 + bne _08056A9C + ldr r0, =0x00001022 + b _08056AFE + .pool +_08056A9C: + ldr r2, [sp, 0x1C] + cmp r4, r2 + bne _08056AAC + ldr r0, =0x00001024 + b _08056AFE + .pool +_08056AAC: + ldr r0, =0x00001023 + b _08056AFE + .pool +_08056AB4: + ldr r7, [sp, 0x14] + cmp r6, r7 + bne _08056AE0 + cmp r4, r8 + bne _08056AC8 + ldr r0, =0x00001028 + b _08056AFE + .pool +_08056AC8: + ldr r0, [sp, 0x1C] + cmp r4, r0 + bne _08056AD8 + ldr r0, =0x0000102a + b _08056AFE + .pool +_08056AD8: + ldr r0, =0x00001029 + b _08056AFE + .pool +_08056AE0: + cmp r4, r8 + bne _08056AEC + ldr r0, =0x00001025 + b _08056AFE + .pool +_08056AEC: + ldr r2, [sp, 0x1C] + cmp r4, r2 + bne _08056AFC + ldr r0, =0x00001027 + b _08056AFE + .pool +_08056AFC: + ldr r0, =0x00001026 +_08056AFE: + strh r0, [r5] + movs r1, 0x1 + mov r0, r10 + ands r0, r1 + cmp r0, 0 + beq _08056B0E + movs r0, 0 + strh r0, [r5] +_08056B0E: + movs r0, 0x80 + mov r7, r10 + ands r0, r7 + cmp r0, 0 + beq _08056B38 + lsls r2, r4, 24 + lsrs r2, 24 + str r1, [sp] + str r1, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + add r1, sp, 0xC + mov r7, r9 + lsrs r3, r7, 24 + bl CopyToBgTilemapBufferRect_ChangePalette + b _08056B50 + .pool +_08056B38: + lsls r2, r4, 24 + lsrs r2, 24 + str r1, [sp] + str r1, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + add r1, sp, 0xC + mov r7, r9 + lsrs r3, r7, 24 + bl CopyToBgTilemapBufferRect_ChangePalette +_08056B50: + adds r4, 0x1 + ldr r0, [sp, 0x1C] + cmp r4, r0 + ble _08056A88 +_08056B58: + ldr r6, [sp, 0x18] + ldr r2, [sp, 0x14] + cmp r6, r2 + bgt _08056B62 + b _08056A76 +_08056B62: + 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_8056A3C + + thumb_func_start sub_8056B74 +sub_8056B74: @ 8056B74 + push {lr} + sub sp, 0x10 + adds r3, r0, 0 + add r0, sp, 0xC + movs r2, 0x1 + strh r2, [r0] + movs r1, 0x2 + strh r1, [r0, 0x2] + lsls r3, 25 + movs r0, 0x90 + lsls r0, 20 + adds r3, r0 + lsrs r3, 24 + str r2, [sp] + str r1, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + add r1, sp, 0xC + movs r2, 0x19 + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0x10 + pop {r0} + bx r0 + thumb_func_end sub_8056B74 + + thumb_func_start sub_8056BAC +sub_8056BAC: @ 8056BAC + push {lr} + sub sp, 0x10 + adds r3, r0, 0 + add r0, sp, 0xC + ldr r1, =0x00001016 + strh r1, [r0] + strh r1, [r0, 0x2] + lsls r3, 25 + movs r0, 0x90 + lsls r0, 20 + adds r3, r0 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + add r1, sp, 0xC + movs r2, 0x19 + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8056BAC + + thumb_func_start atkF3_receive_new_pokemon_maybe +atkF3_receive_new_pokemon_maybe: @ 8056BEC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r0, =0x02024332 + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0x4 + bls _08056C04 + b _08056E62 +_08056C04: + lsls r0, r1, 2 + ldr r1, =_08056C18 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08056C18: + .4byte _08056C2C + .4byte _08056C60 + .4byte _08056CFC + .4byte _08056DD4 + .4byte _08056E2C +_08056C2C: + movs r4, 0 + str r4, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r0, =gUnknown_085CCABB + movs r1, 0xC + bl battle_show_message_maybe + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + strb r4, [r1, 0x1] + movs r0, 0 + bl sub_8056B74 + b _08056E62 + .pool +_08056C60: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08056C86 + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _08056C86 + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0 + strb r0, [r4, 0x1] + bl sub_8056B74 +_08056C86: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08056CAE + ldr r4, =0x02024332 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _08056CAE + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0x1] + bl sub_8056BAC + movs r0, 0x1 + strb r0, [r4, 0x1] + bl sub_8056B74 +_08056CAE: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08056CE0 + movs r0, 0x5 + bl audio_play + ldr r1, =0x02024332 + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _08056CF2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0x3 + bl sub_80A2390 + b _08056E62 + .pool +_08056CE0: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08056CEA + b _08056E62 +_08056CEA: + movs r0, 0x5 + bl audio_play + ldr r1, =0x02024332 +_08056CF2: + movs r0, 0x4 + strb r0, [r1] + b _08056E62 + .pool +_08056CFC: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08056D0A + b _08056E62 +_08056D0A: + ldr r7, =0x0202406e + ldr r0, =0x0202420b + mov r10, r0 + ldrb r0, [r0] + movs r4, 0x1 + eors r0, r4 + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + movs r1, 0x64 + mov r9, r1 + mov r2, r9 + muls r2, r0 + adds r0, r2, 0 + ldr r1, =0x02024744 + mov r8, r1 + add r0, r8 + ldr r1, =0x0202449c + ldr r2, [r1] + adds r2, 0x6D + movs r1, 0x2 + bl pokemon_getattr + bl FreeAllWindowBuffers + mov r2, r10 + ldrb r0, [r2] + eors r0, r4 + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + add r0, r8 + movs r1, 0xB + bl pokemon_getattr + adds r6, r0, 0 + lsls r6, 16 + lsrs r6, 16 + mov r2, r10 + ldrb r0, [r2] + eors r0, r4 + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + add r0, r8 + bl pokemon_get_gender + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + mov r2, r10 + ldrb r0, [r2] + eors r4, r0 + lsls r4, 1 + adds r4, r7 + ldrh r0, [r4] + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + add r0, r8 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + ldr r2, =0x0202449c + ldr r1, [r2] + adds r1, 0x6D + str r0, [sp] + ldr r0, =sub_8038420 + str r0, [sp, 0x4] + movs r0, 0x2 + adds r2, r6, 0 + adds r3, r5, 0 + bl do_choose_name_or_words_screen + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08056E62 + .pool +_08056DD4: + ldr r0, =0x030022c0 + ldr r1, [r0, 0x4] + ldr r0, =sub_8038420 + cmp r1, r0 + bne _08056E62 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08056E62 + ldr r2, =0x0202406e + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x1 + eors r0, r1 + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + ldr r1, =0x0202449c + ldr r2, [r1] + adds r2, 0x6D + movs r1, 0x2 + bl pokemon_setattr + b _08056E48 + .pool +_08056E2C: + bl calc_player_party_count + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + bne _08056E48 + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x5 + str r0, [r1] + b _08056E62 + .pool +_08056E48: + ldr r3, =0x02024214 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r2, 0x2] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0x3] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0x4] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] +_08056E62: + 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 atkF3_receive_new_pokemon_maybe + + thumb_func_start sub_8056E78 +sub_8056E78: @ 8056E78 + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r1, r0 + adds r1, r2 + ldr r0, =0x020241f0 + ldr r2, [r0] + ldrh r0, [r1, 0x28] + subs r0, r2 + strh r0, [r1, 0x28] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8056E78 + + thumb_func_start atkF5_reset_attacker_bd_x4C +atkF5_reset_attacker_bd_x4C: @ 8056EA8 + ldr r1, =0x02024084 + ldr r0, =0x0202420b + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x4C + adds r0, r1 + movs r1, 0 + str r1, [r0] + ldr r1, =0x02024214 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bx lr + .pool + thumb_func_end atkF5_reset_attacker_bd_x4C + + thumb_func_start sub_8056ED0 +sub_8056ED0: @ 8056ED0 + ldr r1, =0x02024083 + movs r0, 0xC + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_8056ED0 + + thumb_func_start sub_8056EDC +sub_8056EDC: @ 8056EDC + ldr r1, =0x02024083 + movs r0, 0xC + strb r0, [r1] + ldr r1, =0x02024082 + ldr r0, =0x0202406c + ldrb r0, [r0] + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_8056EDC + + thumb_func_start sub_8056EF8 +sub_8056EF8: @ 8056EF8 + push {r4,r5,lr} + ldr r5, =0x02024214 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl battle_get_side_with_given_state + ldr r4, =0x02024064 + strb r0, [r4] + movs r0, 0 + bl dp01_build_cmdbuf_x09_9_9_9 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + ldr r0, [r5] + adds r0, 0x2 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8056EF8 + + thumb_func_start sub_8056F28 +sub_8056F28: @ 8056F28 + push {r4-r6,lr} + ldr r5, =0x020244a8 + ldr r6, =0x02022fec + ldr r0, [r6] + movs r1, 0x80 + lsls r1, 19 + ands r0, r1 + cmp r0, 0 + beq _08056F3E + bl sub_81D55D0 +_08056F3E: + ldr r4, =0x0202449c + movs r0, 0xA9 + lsls r0, 2 + bl AllocZeroed + str r0, [r4] + movs r0, 0x20 + bl AllocZeroed + str r0, [r5] + movs r0, 0xA0 + bl AllocZeroed + ldr r1, [r5] + str r0, [r1] + movs r0, 0x10 + bl AllocZeroed + ldr r1, [r5] + str r0, [r1, 0x4] + movs r0, 0x24 + bl AllocZeroed + ldr r1, [r5] + str r0, [r1, 0x8] + movs r0, 0x24 + bl AllocZeroed + ldr r1, [r5] + str r0, [r1, 0xC] + movs r0, 0xC + bl AllocZeroed + ldr r1, [r5] + str r0, [r1, 0x10] + movs r0, 0x1C + bl AllocZeroed + ldr r1, [r5] + str r0, [r1, 0x14] + movs r0, 0x54 + bl AllocZeroed + ldr r1, [r5] + str r0, [r1, 0x18] + movs r0, 0x24 + bl AllocZeroed + ldr r1, [r5] + str r0, [r1, 0x1C] + ldr r4, =0x020244a0 + movs r5, 0x80 + lsls r5, 5 + adds r0, r5, 0 + bl AllocZeroed + str r0, [r4] + ldr r4, =0x020244a4 + adds r0, r5, 0 + bl AllocZeroed + str r0, [r4] + ldr r4, =0x0202305c + movs r0, 0x80 + lsls r0, 6 + bl AllocZeroed + str r0, [r4] + ldr r4, =0x02023060 + adds r0, r5, 0 + bl AllocZeroed + str r0, [r4] + ldr r0, [r6] + movs r1, 0x80 + lsls r1, 20 + ands r0, r1 + cmp r0, 0 + beq _08056FFA + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r2, =0x03005d8c + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 5 + ldr r0, =0x00001a9c + adds r1, r0 + ldr r0, [r2] + adds r0, r1 + bl create_enemy_party +_08056FFA: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8056F28 + + thumb_func_start sub_8057028 +sub_8057028: @ 8057028 + push {r4-r6,lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 19 + ands r0, r1 + cmp r0, 0 + beq _0805703C + bl sub_81D5694 +_0805703C: + ldr r6, =0x020244a8 + ldr r0, [r6] + cmp r0, 0 + beq _080570D0 + ldr r4, =0x0202449c + ldr r0, [r4] + bl Free + movs r5, 0 + str r5, [r4] + ldr r0, [r6] + ldr r0, [r0] + bl Free + ldr r0, [r6] + str r5, [r0] + ldr r0, [r0, 0x4] + bl Free + ldr r0, [r6] + str r5, [r0, 0x4] + ldr r0, [r0, 0x8] + bl Free + ldr r0, [r6] + str r5, [r0, 0x8] + ldr r0, [r0, 0xC] + bl Free + ldr r0, [r6] + str r5, [r0, 0xC] + ldr r0, [r0, 0x10] + bl Free + ldr r0, [r6] + str r5, [r0, 0x10] + ldr r0, [r0, 0x14] + bl Free + ldr r0, [r6] + str r5, [r0, 0x14] + ldr r0, [r0, 0x18] + bl Free + ldr r0, [r6] + str r5, [r0, 0x18] + ldr r0, [r0, 0x1C] + bl Free + ldr r0, [r6] + str r5, [r0, 0x1C] + bl Free + str r5, [r6] + ldr r4, =0x020244a0 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x020244a4 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0202305c + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x02023060 + ldr r0, [r4] + bl Free + str r5, [r4] +_080570D0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8057028 + + thumb_func_start sub_80570F4 +sub_80570F4: @ 80570F4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08057140 + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x3 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =0x02024084 + movs r0, 0x58 + adds r1, r3, 0 + muls r1, r0 + adds r1, r2 + adds r1, 0x2A + muls r0, r4 + adds r0, r2 + adds r0, 0x2A + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + bls _0805714A + adds r4, r3, 0 + b _0805714A + .pool +_08057140: + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r4, r0, 24 +_0805714A: + ldr r2, =0x02024084 + movs r1, 0x58 + adds r0, r4, 0 + muls r0, r1 + adds r0, r2 + adds r3, r0, 0 + adds r3, 0x2A + adds r0, r5, 0 + muls r0, r1 + adds r0, r2 + adds r1, r0, 0 + adds r1, 0x2A + ldrb r0, [r3] + ldrb r2, [r1] + cmp r0, r2 + bls _080571B8 + ldrb r1, [r1] + subs r0, r1 + cmp r0, 0x1D + ble _08057198 + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x8 + bl happiness_algorithm + b _080571CE + .pool +_08057198: + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x6 + bl happiness_algorithm + b _080571CE + .pool +_080571B8: + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x6 + bl happiness_algorithm +_080571CE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80570F4 + + thumb_func_start sub_80571DC +sub_80571DC: @ 80571DC + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08057248 + movs r2, 0 + ldr r6, =0x0202406e + lsls r3, r4, 1 + ldr r5, =0x0203cf00 + ldr r4, =0x0202449c +_080571FE: + adds r0, r2, r5 + ldr r1, [r4] + adds r1, r2, r1 + adds r1, 0x60 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x2 + ble _080571FE + adds r0, r3, r6 + ldrb r0, [r0] + bl pokemon_order_func + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r7, 0 + bl pokemon_order_func + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_81B8FB0 + movs r2, 0 + ldr r4, =0x0202449c + ldr r3, =0x0203cf00 +_08057236: + ldr r0, [r4] + adds r0, r2, r0 + adds r0, 0x60 + adds r1, r2, r3 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x2 + ble _08057236 +_08057248: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80571DC + + thumb_func_start sub_805725C +sub_805725C: @ 805725C + 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 + movs r0, 0 + mov r8, r0 + ldr r1, =0x02024332 + mov r10, r1 + b _08057284 + .pool +_0805727C: + mov r2, r8 + cmp r2, 0 + beq _08057284 + b _08057406 +_08057284: + mov r1, r10 + ldrb r0, [r1] + cmp r0, 0x1 + bne _0805728E + b _08057390 +_0805728E: + cmp r0, 0x1 + ble _08057294 + b _080573FC +_08057294: + cmp r0, 0 + beq _0805729A + b _080573FC +_0805729A: + ldr r6, =0x02024084 + movs r0, 0x58 + mov r5, r9 + muls r5, r0 + adds r0, r6, 0 + adds r0, 0x4C + adds r4, r5, r0 + ldr r0, [r4] + movs r7, 0x7 + ands r0, r7 + cmp r0, 0 + beq _08057372 + mov r0, r9 + bl sub_8050650 + lsls r0, 24 + cmp r0, 0 + beq _080572FC + ldr r0, [r4] + movs r1, 0x8 + negs r1, r1 + ands r0, r1 + str r0, [r4] + adds r2, r6, 0 + adds r2, 0x50 + adds r2, r5, r2 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] + bl b_movescr_stack_push_cursor + movs r0, 0x1 + mov r2, r10 + strb r0, [r2, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB220 + str r0, [r1] + movs r0, 0x2 + mov r8, r0 + b _08057372 + .pool +_080572FC: + adds r0, r5, r6 + adds r0, 0x20 + ldrb r0, [r0] + movs r2, 0x1 + cmp r0, 0x30 + bne _0805730A + movs r2, 0x2 +_0805730A: + ldr r1, [r4] + adds r0, r1, 0 + ands r0, r7 + cmp r0, r2 + bcs _0805731E + movs r0, 0x8 + negs r0, r0 + ands r1, r0 + str r1, [r4] + b _08057322 +_0805731E: + subs r0, r1, r2 + str r0, [r4] +_08057322: + ldr r2, =0x02024084 + movs r0, 0x58 + mov r1, r9 + muls r1, r0 + adds r0, r2, 0 + adds r0, 0x4C + adds r0, r1, r0 + ldr r4, [r0] + movs r0, 0x7 + ands r4, r0 + cmp r4, 0 + beq _08057354 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB213 + str r0, [r1] + movs r1, 0x2 + mov r8, r1 + b _08057372 + .pool +_08057354: + adds r2, 0x50 + adds r2, r1, r2 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] + bl b_movescr_stack_push_cursor + ldr r0, =0x02024332 + strb r4, [r0, 0x5] + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB220 + str r0, [r1] + movs r2, 0x2 + mov r8, r2 +_08057372: + ldr r1, =0x02024332 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r10, r1 + b _080573FC + .pool +_08057390: + ldr r1, =0x02024084 + movs r0, 0x58 + mov r2, r9 + muls r2, r0 + adds r0, r2, 0 + adds r1, 0x4C + adds r4, r0, r1 + ldr r0, [r4] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080573F4 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x5 + bl __umodsi3 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + beq _080573D4 + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB26A + str r0, [r1] + b _080573EC + .pool +_080573D4: + ldr r0, [r4] + movs r1, 0x21 + negs r1, r1 + ands r0, r1 + str r0, [r4] + bl b_movescr_stack_push_cursor + ldr r1, =0x02024214 + ldr r0, =gUnknown_082DB277 + str r0, [r1] + mov r0, r10 + strb r5, [r0, 0x5] +_080573EC: + movs r1, 0x2 + mov r8, r1 + ldr r2, =0x02024332 + mov r10, r2 +_080573F4: + mov r1, r10 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080573FC: + mov r2, r10 + ldrb r0, [r2] + cmp r0, 0x2 + beq _08057406 + b _0805727C +_08057406: + mov r0, r8 + cmp r0, 0x2 + bne _08057430 + ldr r4, =0x02024064 + mov r1, r9 + strb r1, [r4] + ldrb r1, [r4] + movs r0, 0x58 + muls r0, r1 + ldr r1, =0x020240d0 + adds r0, r1 + str r0, [sp] + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + movs r3, 0x4 + bl dp01_build_cmdbuf_x02_a_b_varargs + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution +_08057430: + mov r0, r8 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_805725C + + thumb_func_start nullsub_21 +nullsub_21: @ 8057458 + bx lr + thumb_func_end nullsub_21 + + thumb_func_start sub_805745C +sub_805745C: @ 805745C + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_exec_buffer_A_ch0_tbl1 + str r1, [r0] + ldr r0, =0x020244b9 + movs r1, 0 + strb r1, [r0] + ldr r0, =0x020244cc + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_805745C + + thumb_func_start dp01_tbl1_exec_completed +dp01_tbl1_exec_completed: @ 805748C + push {r4,lr} + sub sp, 0x4 + ldr r1, =0x03005d60 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_exec_buffer_A_ch0_tbl1 + str r1, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080574E0 + bl link_get_multiplayer_id + mov r1, sp + strb r0, [r1] + movs r0, 0x2 + movs r1, 0x4 + mov r2, sp + bl dp01_prepare_buffer_wireless_probably + ldr r1, =0x02023064 + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _080574F2 + .pool +_080574E0: + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, [r2] + bics r0, r1 + str r0, [r2] +_080574F2: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_tbl1_exec_completed + + thumb_func_start bx_exec_buffer_A_ch0_tbl1 +bx_exec_buffer_A_ch0_tbl1: @ 8057504 + push {lr} + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldr r0, =0x02024064 + ldrb r3, [r0] + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08057550 + ldr r0, =0x02023064 + lsls r1, r3, 9 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x38 + bhi _0805754C + ldr r0, =gUnknown_0831C514 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + b _08057550 + .pool +_0805754C: + bl dp01_tbl1_exec_completed +_08057550: + pop {r0} + bx r0 + thumb_func_end bx_exec_buffer_A_ch0_tbl1 + + thumb_func_start bx_0802E404 +bx_0802E404: @ 8057554 + push {lr} + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x24 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08057576 + bl dp01_tbl1_exec_completed +_08057576: + pop {r0} + bx r0 + .pool + thumb_func_end bx_0802E404 + + thumb_func_start sub_8057588 +sub_8057588: @ 8057588 + push {r4-r7,lr} + ldr r3, =0x02023064 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r2, r0, 9 + adds r1, r3, 0x2 + adds r1, r2, r1 + ldrb r5, [r1] + adds r3, 0x3 + adds r2, r3 + ldrb r1, [r2] + lsls r1, 8 + orrs r5, r1 + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x1 + bl dp11b_obj_instanciate + ldrb r0, [r4] + movs r1, 0 + movs r2, 0x7 + movs r3, 0x1 + bl dp11b_obj_instanciate + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x30] + movs r0, 0xF0 + ands r0, r1 + cmp r0, 0 + beq _080575EC + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x2 + bne _080575EC + ldr r1, =0x020244cc + ldrb r0, [r1] + adds r0, 0x1 + b _080575F0 + .pool +_080575EC: + ldr r1, =0x020244cc + movs r0, 0 +_080575F0: + strb r0, [r1] + ldr r0, =0x030022c0 + ldrh r2, [r0, 0x2E] + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r2 + cmp r0, 0 + beq _08057658 + movs r0, 0x5 + bl audio_play + ldr r1, =0x020244ac + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08057640 + cmp r0, 0x1 + bgt _08057630 + cmp r0, 0 + beq _0805763A + b _080577C2 + .pool +_08057630: + cmp r0, 0x2 + beq _08057646 + cmp r0, 0x3 + beq _0805764C + b _080577C2 +_0805763A: + movs r0, 0x1 + movs r1, 0 + b _080577BC +_08057640: + movs r0, 0x1 + movs r1, 0x1 + b _080577BC +_08057646: + movs r0, 0x1 + movs r1, 0x2 + b _080577BC +_0805764C: + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + b _080577C2 +_08057658: + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + beq _08057698 + ldr r5, =0x020244ac + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _08057674 + b _080577E8 +_08057674: + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl sub_8059CF8 + ldrb r1, [r4] + adds r1, r5 + ldrb r0, [r1] + movs r2, 0x1 + b _08057732 + .pool +_08057698: + movs r0, 0x10 + ands r0, r2 + cmp r0, 0 + beq _080576D8 + ldr r5, =0x020244ac + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _080576B4 + b _080577E8 +_080576B4: + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl sub_8059CF8 + ldrb r1, [r4] + adds r1, r5 + ldrb r0, [r1] + movs r2, 0x1 + b _08057732 + .pool +_080576D8: + movs r7, 0x40 + adds r0, r7, 0 + ands r0, r2 + cmp r0, 0 + beq _08057700 + ldr r5, =0x020244ac + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080577E8 + b _0805771A + .pool +_08057700: + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _0805774C + ldr r5, =0x020244ac + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080577E8 +_0805771A: + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl sub_8059CF8 + ldrb r1, [r4] + adds r1, r5 + ldrb r0, [r1] + movs r2, 0x2 +_08057732: + eors r0, r2 + strb r0, [r1] + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl sub_8059CB4 + b _080577E8 + .pool +_0805774C: + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + bne _0805775A + ldrb r0, [r1] + cmp r0, 0x3B + bls _080577DC +_0805775A: + ldr r4, =0x02022fec + ldr r0, [r4] + ands r0, r3 + cmp r0, 0 + beq _080577E8 + ldr r6, =0x02024064 + ldrb r0, [r6] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _080577E8 + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, =0x02024210 + ldrb r1, [r1] + ldr r2, =gUnknown_0832A328 + lsls r0, 24 + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _080577E8 + ldr r0, [r4] + ands r0, r7 + cmp r0, 0 + bne _080577E8 + ldr r0, =0x02023064 + ldrb r1, [r6] + lsls r1, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x1 + bne _080577B2 + cmp r5, 0xC + bhi _080577E8 + adds r0, r5, 0 + movs r1, 0x1 + bl bag_add_item +_080577B2: + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + movs r1, 0xC +_080577BC: + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb +_080577C2: + bl dp01_tbl1_exec_completed + b _080577E8 + .pool +_080577DC: + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _080577E8 + bl sub_8073314 +_080577E8: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8057588 + + thumb_func_start sub_80577F0 +sub_80577F0: @ 80577F0 + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + movs r1, 0x1 + bl dp11b_obj_free + ldrb r0, [r4] + movs r1, 0 + bl dp11b_obj_free + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8057824 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80577F0 + + thumb_func_start sub_8057824 +sub_8057824: @ 8057824 + push {r4,r5,lr} + sub sp, 0x4 + ldr r1, =gUnknown_0831C5F8 + mov r0, sp + movs r2, 0x4 + bl memcpy + ldr r0, =0x03005d74 + ldrb r0, [r0] + movs r1, 0x1 + movs r2, 0xF + movs r3, 0x1 + bl dp11b_obj_instanciate + movs r4, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r0, 0 + beq _08057866 +_0805784A: + ldr r0, =0x03005d74 + ldrb r0, [r0] + cmp r4, r0 + beq _0805785C + lsls r0, r4, 24 + lsrs r0, 24 + movs r1, 0x1 + bl dp11b_obj_free +_0805785C: + adds r4, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + blt _0805784A +_08057866: + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2C] + movs r0, 0xF0 + ands r0, r1 + cmp r0, 0 + beq _0805789C + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x2 + bne _0805789C + ldr r1, =0x020244cc + ldrb r0, [r1] + adds r0, 0x1 + b _080578A0 + .pool +_0805789C: + ldr r1, =0x020244cc + movs r0, 0 +_080578A0: + strb r0, [r1] + ldrh r2, [r2, 0x2E] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _08057910 + movs r0, 0x5 + bl audio_play + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r4, =0x03005d74 + 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, =sub_8039B2C + str r1, [r0] + ldr r1, =0x020244b0 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r2, [r0] + ldrb r0, [r4] + lsls r0, 8 + orrs r2, r0 + movs r0, 0x1 + movs r1, 0xA + bl dp01_build_cmdbuf_x21_a_bb + ldrb r0, [r4] + movs r1, 0x1 + bl dp11b_obj_free + bl dp01_tbl1_exec_completed + b _08057BC8 + .pool +_08057910: + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + bne _0805791E + ldrb r0, [r1] + cmp r0, 0x3B + bls _0805798C +_0805791E: + movs r0, 0x5 + bl audio_play + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r5, =0x03005d74 + 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_8039B2C + str r1, [r0] + ldr r1, =0x03005d60 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8057BFC + str r1, [r0] + ldrb r0, [r4] + movs r1, 0x1 + movs r2, 0x7 + movs r3, 0x1 + bl dp11b_obj_instanciate + ldrb r0, [r4] + movs r1, 0 + movs r2, 0x7 + movs r3, 0x1 + bl dp11b_obj_instanciate + ldrb r0, [r5] + movs r1, 0x1 + bl dp11b_obj_free + b _08057BC8 + .pool +_0805798C: + movs r0, 0x60 + ands r0, r2 + cmp r0, 0 + bne _08057996 + b _08057AB0 +_08057996: + movs r0, 0x5 + bl audio_play + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r3, =0x03005d74 + ldrb r0, [r3] + 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_8039B2C + str r1, [r0] + adds r5, r3, 0 +_080579B8: + ldrb r0, [r5] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r1, r0, 24 + movs r4, 0 + mov r0, sp + b _080579E2 + .pool +_080579D8: + adds r4, 0x1 + cmp r4, 0x3 + bgt _080579E8 + mov r2, sp + adds r0, r2, r4 +_080579E2: + ldrb r0, [r0] + cmp r1, r0 + bne _080579D8 +_080579E8: + subs r4, 0x1 + cmp r4, 0 + bge _080579F0 + movs r4, 0x4 +_080579F0: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + bl battle_get_side_with_given_state + strb r0, [r5] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + beq _080579E8 + movs r4, 0 + ldrb r0, [r5] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08057A6E + cmp r0, 0x1 + bgt _08057A28 + cmp r0, 0 + beq _08057A32 + b _08057A70 + .pool +_08057A28: + cmp r0, 0x2 + beq _08057A32 + cmp r0, 0x3 + beq _08057A6E + b _08057A70 +_08057A32: + ldr r2, =0x02024064 + ldrb r0, [r2] + ldrb r1, [r5] + cmp r0, r1 + bne _08057A6E + ldr r1, =0x0202406e + ldrb r2, [r2] + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x020244b0 + adds r2, r1 + ldrb r1, [r2] + adds r1, 0xD + bl pokemon_getattr + ldr r2, =gBattleMoves + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x6] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08057A70 +_08057A6E: + adds r4, 0x1 +_08057A70: + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + ldr r0, =0x03005d74 + cmp r1, 0 + beq _08057A88 + movs r4, 0 +_08057A88: + cmp r4, 0 + beq _080579B8 + b _08057BB0 + .pool +_08057AB0: + movs r0, 0x90 + ands r0, r2 + cmp r0, 0 + bne _08057ABA + b _08057BC8 +_08057ABA: + movs r0, 0x5 + bl audio_play + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r3, =0x03005d74 + ldrb r0, [r3] + 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_8039B2C + str r1, [r0] + adds r5, r3, 0 +_08057ADC: + ldrb r0, [r5] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r1, r0, 24 + movs r4, 0 + mov r0, sp + b _08057B06 + .pool +_08057AFC: + adds r4, 0x1 + cmp r4, 0x3 + bgt _08057B0C + mov r2, sp + adds r0, r2, r4 +_08057B06: + ldrb r0, [r0] + cmp r1, r0 + bne _08057AFC +_08057B0C: + adds r4, 0x1 + cmp r4, 0x3 + ble _08057B14 + movs r4, 0 +_08057B14: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] + bl battle_get_side_with_given_state + strb r0, [r5] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + beq _08057B0C + movs r4, 0 + ldrb r0, [r5] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08057B92 + cmp r0, 0x1 + bgt _08057B4C + cmp r0, 0 + beq _08057B56 + b _08057B94 + .pool +_08057B4C: + cmp r0, 0x2 + beq _08057B56 + cmp r0, 0x3 + beq _08057B92 + b _08057B94 +_08057B56: + ldr r2, =0x02024064 + ldrb r0, [r2] + ldrb r1, [r5] + cmp r0, r1 + bne _08057B92 + ldr r1, =0x0202406e + ldrb r2, [r2] + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x020244b0 + adds r2, r1 + ldrb r1, [r2] + adds r1, 0xD + bl pokemon_getattr + ldr r2, =gBattleMoves + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x6] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08057B94 +_08057B92: + adds r4, 0x1 +_08057B94: + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + ldr r0, =0x03005d74 + cmp r1, 0 + beq _08057BAC + movs r4, 0 +_08057BAC: + cmp r4, 0 + beq _08057ADC +_08057BB0: + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + 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, =sub_8039AD8 + str r1, [r0] +_08057BC8: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8057824 + + thumb_func_start sub_8057BFC +sub_8057BFC: @ 8057BFC + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r0, 0 + mov r8, r0 + ldr r3, =0x02024064 + ldrb r0, [r3] + lsls r0, 9 + ldr r1, =0x02023068 + adds r6, r0, r1 + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2C] + movs r0, 0xF0 + ands r0, r1 + adds r7, r3, 0 + cmp r0, 0 + beq _08057C44 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x2 + bne _08057C44 + ldr r1, =0x020244cc + ldrb r0, [r1] + adds r0, 0x1 + b _08057C48 + .pool +_08057C44: + ldr r1, =0x020244cc + movs r0, 0 +_08057C48: + strb r0, [r1] + ldrh r2, [r2, 0x2E] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r2 + cmp r0, 0 + bne _08057C58 + b _08057E04 +_08057C58: + movs r0, 0x5 + bl audio_play + ldr r1, =0x020244b0 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 1 + adds r1, r6, r0 + ldrh r0, [r1] + cmp r0, 0xAE + bne _08057C98 + ldrb r0, [r6, 0x12] + movs r4, 0 + cmp r0, 0x7 + beq _08057CA6 + ldrb r1, [r6, 0x13] + movs r0, 0x7 + eors r1, r0 + negs r0, r1 + orrs r0, r1 + asrs r4, r0, 31 + movs r0, 0x10 + ands r4, r0 + b _08057CA6 + .pool +_08057C98: + ldr r2, =gBattleMoves + ldrh r1, [r1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r4, [r0, 0x6] +_08057CA6: + movs r0, 0x10 + ands r0, r4 + cmp r0, 0 + beq _08057CC4 + ldr r0, =0x03005d74 + ldr r1, =0x02024064 + ldrb r1, [r1] + strb r1, [r0] + b _08057CDE + .pool +_08057CC4: + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_get_per_side_status + adds r1, r0, 0 + movs r2, 0x1 + movs r0, 0x1 + ands r0, r1 + eors r0, r2 + bl battle_get_side_with_given_state + ldr r1, =0x03005d74 + strb r0, [r1] +_08057CDE: + ldr r5, =0x02023064 + ldr r0, =0x02024064 + ldrb r3, [r0] + lsls r2, r3, 9 + adds r1, r5, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r7, r0, 0 + cmp r1, 0 + bne _08057D18 + movs r0, 0x2 + ands r0, r4 + cmp r0, 0 + beq _08057D5A + adds r0, r5, 0x2 + adds r0, r2, r0 + ldrb r0, [r0] + cmp r0, 0 + bne _08057D5A + movs r0, 0x1 + add r8, r0 + b _08057D5A + .pool +_08057D18: + movs r0, 0x7D + ands r0, r4 + cmp r0, 0 + bne _08057D24 + movs r0, 0x1 + add r8, r0 +_08057D24: + ldr r0, =0x020244b0 + adds r0, r3, r0 + adds r1, r6, 0 + adds r1, 0x8 + ldrb r0, [r0] + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _08057D62 + movs r0, 0x12 + ands r0, r4 + cmp r0, 0 + bne _08057D5A + movs r0, 0 + bl sub_8069DEC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08057D5A + ldrb r0, [r7] + bl sub_8069F34 + ldr r1, =0x03005d74 + strb r0, [r1] + movs r0, 0 + mov r8, r0 +_08057D5A: + ldr r7, =0x02024064 + mov r0, r8 + cmp r0, 0 + bne _08057D80 +_08057D62: + ldr r1, =0x020244b0 + ldrb r0, [r7] + adds r0, r1 + ldrb r2, [r0] + ldr r0, =0x03005d74 + ldrb r0, [r0] + lsls r0, 8 + orrs r2, r0 + b _08057E1C + .pool +_08057D80: + ldr r1, =0x03005d60 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8057824 + str r1, [r0] + movs r0, 0x12 + ands r4, r0 + cmp r4, 0 + beq _08057DA8 + ldr r1, =0x03005d74 + ldrb r0, [r7] + b _08057DD8 + .pool +_08057DA8: + movs r0, 0x1 + bl battle_get_side_with_given_state + ldr r1, =0x02024210 + ldrb r1, [r1] + ldr r2, =gUnknown_0832A328 + lsls r0, 24 + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08057DD0 + movs r0, 0x3 + b _08057DD2 + .pool +_08057DD0: + movs r0, 0x1 +_08057DD2: + bl battle_get_side_with_given_state + ldr r1, =0x03005d74 +_08057DD8: + strb r0, [r1] + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x03005d74 + 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, =sub_8039AD8 + b _08057F9C + .pool +_08057E04: + movs r6, 0x2 + adds r0, r6, 0 + ands r0, r2 + cmp r0, 0 + bne _08057E14 + ldrb r0, [r1] + cmp r0, 0x3B + bls _08057E30 +_08057E14: + movs r0, 0x5 + bl audio_play + ldr r2, =0x0000ffff +_08057E1C: + movs r0, 0x1 + movs r1, 0xA + bl dp01_build_cmdbuf_x21_a_bb + bl dp01_tbl1_exec_completed + b _08057F9E + .pool +_08057E30: + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + beq _08057E60 + ldr r4, =0x020244b0 + ldrb r0, [r7] + adds r2, r0, r4 + ldrb r1, [r2] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _08057E4A + b _08057F9E +_08057E4A: + ldrb r0, [r2] + bl battle_menu_cursor_related + ldrb r1, [r7] + adds r1, r4 + ldrb r0, [r1] + movs r2, 0x1 + eors r0, r2 + b _08057F08 + .pool +_08057E60: + movs r0, 0x10 + ands r0, r2 + cmp r0, 0 + beq _08057EA4 + ldr r4, =0x020244b0 + ldrb r0, [r7] + adds r3, r0, r4 + ldrb r2, [r3] + movs r6, 0x1 + adds r0, r5, 0 + ands r0, r2 + cmp r0, 0 + beq _08057E7C + b _08057F9E +_08057E7C: + ldr r1, =0x03005d78 + adds r0, r6, 0 + eors r0, r2 + ldrb r1, [r1] + cmp r0, r1 + bcc _08057E8A + b _08057F9E +_08057E8A: + ldrb r0, [r3] + bl battle_menu_cursor_related + ldrb r1, [r7] + adds r1, r4 + ldrb r0, [r1] + eors r0, r6 + b _08057F08 + .pool +_08057EA4: + movs r0, 0x40 + ands r0, r2 + cmp r0, 0 + beq _08057ED4 + ldr r4, =0x020244b0 + ldrb r0, [r7] + adds r2, r0, r4 + ldrb r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08057F9E + ldrb r0, [r2] + bl battle_menu_cursor_related + ldrb r1, [r7] + adds r1, r4 + ldrb r0, [r1] + movs r2, 0x2 + eors r0, r2 + b _08057F08 + .pool +_08057ED4: + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _08057F30 + ldr r4, =0x020244b0 + ldrb r0, [r7] + adds r3, r0, r4 + ldrb r2, [r3] + movs r5, 0x2 + adds r0, r6, 0 + ands r0, r2 + cmp r0, 0 + bne _08057F9E + ldr r1, =0x03005d78 + adds r0, r5, 0 + eors r0, r2 + ldrb r1, [r1] + cmp r0, r1 + bcs _08057F9E + ldrb r0, [r3] + bl battle_menu_cursor_related + ldrb r1, [r7] + adds r1, r4 + ldrb r0, [r1] + eors r0, r5 +_08057F08: + strb r0, [r1] + movs r0, 0x5 + bl audio_play + ldrb r0, [r7] + adds r0, r4 + ldrb r0, [r0] + movs r1, 0 + bl battle_menu_cursor_related_2 + bl sub_8059B3C + bl sub_8059BB0 + b _08057F9E + .pool +_08057F30: + movs r0, 0x4 + ands r0, r2 + cmp r0, 0 + beq _08057F9E + ldr r0, =0x03005d78 + ldrb r0, [r0] + cmp r0, 0x1 + bls _08057F9E + ldr r0, =0x02022fec + ldr r5, [r0] + ands r5, r6 + cmp r5, 0 + bne _08057F9E + ldr r4, =0x020244b0 + ldrb r0, [r7] + adds r0, r4 + ldrb r0, [r0] + movs r1, 0x1D + bl battle_menu_cursor_related_2 + ldrb r0, [r7] + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _08057F78 + ldr r0, =0x03005d74 + strb r5, [r0] + b _08057F80 + .pool +_08057F78: + ldr r1, =0x03005d74 + adds r0, 0x1 + strb r0, [r1] + adds r0, r1, 0 +_08057F80: + ldrb r0, [r0] + movs r1, 0x1B + bl battle_menu_cursor_related_2 + ldr r0, =gUnknown_085CCACA + movs r1, 0xB + bl battle_show_message_maybe + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8058138 +_08057F9C: + str r1, [r0] +_08057F9E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8057BFC + + thumb_func_start sub_8057FBC +sub_8057FBC: @ 8057FBC + push {r4-r7,lr} + movs r7, 0 + ldr r4, =0x030022c0 + ldrh r1, [r4, 0x2E] + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08057FD6 + movs r0, 0x5 + bl audio_play + movs r7, 0x1 +_08057FD6: + ldrh r1, [r4, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08057FF8 + movs r0, 0x5 + bl audio_play + ldr r1, =0x02022e14 + movs r0, 0 + strh r0, [r1] + ldr r1, =0x02022e16 + movs r2, 0xA0 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + movs r7, 0xFF +_08057FF8: + ldrh r1, [r4, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08058038 + ldr r5, =0x020244b0 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r2, r0, r5 + ldrb r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08058038 + ldrb r0, [r2] + bl battle_menu_cursor_related + ldrb r1, [r4] + adds r1, r5 + ldrb r0, [r1] + movs r2, 0x1 + eors r0, r2 + strb r0, [r1] + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl battle_menu_cursor_related_2 +_08058038: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08058086 + ldr r5, =0x020244b0 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r3, r0, r5 + ldrb r2, [r3] + movs r6, 0x1 + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + bne _08058086 + ldr r1, =0x03005d78 + adds r0, r6, 0 + eors r0, r2 + ldrb r1, [r1] + cmp r0, r1 + bcs _08058086 + ldrb r0, [r3] + bl battle_menu_cursor_related + ldrb r1, [r4] + adds r1, r5 + ldrb r0, [r1] + eors r0, r6 + strb r0, [r1] + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl battle_menu_cursor_related_2 +_08058086: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080580C8 + ldr r5, =0x020244b0 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r2, r0, r5 + ldrb r1, [r2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080580C8 + ldrb r0, [r2] + bl battle_menu_cursor_related + ldrb r1, [r4] + adds r1, r5 + ldrb r0, [r1] + movs r2, 0x2 + eors r0, r2 + strb r0, [r1] + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl battle_menu_cursor_related_2 +_080580C8: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08058116 + ldr r5, =0x020244b0 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r3, r0, r5 + ldrb r2, [r3] + movs r6, 0x2 + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + bne _08058116 + ldr r1, =0x03005d78 + adds r0, r6, 0 + eors r0, r2 + ldrb r1, [r1] + cmp r0, r1 + bcs _08058116 + ldrb r0, [r3] + bl battle_menu_cursor_related + ldrb r1, [r4] + adds r1, r5 + ldrb r0, [r1] + eors r0, r6 + strb r0, [r1] + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl battle_menu_cursor_related_2 +_08058116: + adds r0, r7, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8057FBC + + thumb_func_start sub_8058138 +sub_8058138: @ 8058138 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x5 + ands r0, r1 + cmp r0, 0 + bne _08058152 + b _08058500 +_08058152: + movs r0, 0x5 + bl audio_play + ldr r0, =0x020244b0 + mov r10, r0 + ldr r1, =0x02024064 + mov r8, r1 + ldrb r1, [r1] + adds r2, r1, r0 + ldr r5, =0x03005d74 + ldrb r0, [r2] + ldrb r3, [r5] + cmp r0, r3 + bne _08058170 + b _080584A8 +_08058170: + lsls r1, 9 + ldr r0, =0x02023068 + adds r1, r0 + mov r9, r1 + ldrb r1, [r2] + lsls r1, 1 + add r1, r9 + ldrh r6, [r1] + ldrb r0, [r5] + lsls r0, 1 + add r0, r9 + ldrh r0, [r0] + strh r0, [r1] + ldrb r0, [r5] + lsls r0, 1 + add r0, r9 + strh r6, [r0] + mov r1, r8 + ldrb r0, [r1] + add r0, r10 + ldrb r1, [r0] + mov r7, r9 + adds r7, 0x8 + adds r1, r7, r1 + ldrb r6, [r1] + ldrb r0, [r5] + adds r0, r7, r0 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r5] + adds r0, r7, r0 + strb r6, [r0] + mov r2, r8 + ldrb r0, [r2] + add r0, r10 + ldrb r1, [r0] + mov r2, r9 + adds r2, 0xC + adds r1, r2, r1 + ldrb r6, [r1] + ldrb r0, [r5] + adds r0, r2, r0 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r5] + adds r2, r0 + strb r6, [r2] + mov r3, r8 + ldrb r1, [r3] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r2, =0x020242bc + adds r6, r0, r2 + ldrb r4, [r6, 0x18] + lsls r3, r4, 24 + lsrs r2, r3, 28 + ldr r0, =gUnknown_0832A328 + mov r12, r0 + add r1, r10 + ldrb r0, [r1] + lsls r0, 2 + add r0, r12 + ldr r0, [r0] + ands r2, r0 + cmp r2, 0 + beq _0805822A + lsrs r1, r3, 28 + bics r1, r0 + lsls r1, 4 + movs r2, 0xF + adds r0, r2, 0 + ands r0, r4 + orrs r0, r1 + strb r0, [r6, 0x18] + mov r1, r8 + ldrb r0, [r1] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r3, =0x020242bc + adds r1, r3 + ldrb r4, [r1, 0x18] + lsrs r3, r4, 4 + ldrb r0, [r5] + lsls r0, 2 + add r0, r12 + ldr r0, [r0] + orrs r0, r3 + lsls r0, 4 + ands r2, r4 + orrs r2, r0 + strb r2, [r1, 0x18] +_0805822A: + bl sub_8059AAC + movs r6, 0 + mov r12, r7 + mov r5, sp + adds r5, 0x18 + str r5, [sp, 0x1C] + ldr r2, =0x02024084 + mov r0, r8 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r4, r0, 0 + adds r4, 0x3B + mov r7, r8 + mov r10, r2 + movs r5, 0x3 +_0805824E: + mov r1, sp + adds r3, r1, r6 + ldrb r1, [r4] + lsls r2, r6, 1 + adds r0, r5, 0 + lsls r0, r2 + ands r1, r0 + asrs r1, r2 + strb r1, [r3] + adds r6, 0x1 + cmp r6, 0x3 + ble _0805824E + ldr r1, =0x020244b0 + ldrb r0, [r7] + adds r0, r1 + ldrb r0, [r0] + add r0, sp + ldrb r0, [r0] + ldr r2, [sp, 0x1C] + strb r0, [r2] + ldrb r0, [r7] + adds r0, r1 + ldrb r0, [r0] + mov r3, sp + adds r2, r3, r0 + ldr r1, =0x03005d74 + ldrb r0, [r1] + add r0, sp + ldrb r0, [r0] + movs r3, 0 + strb r0, [r2] + ldrb r0, [r1] + mov r5, sp + adds r1, r5, r0 + ldr r2, [sp, 0x1C] + ldrb r0, [r2] + strb r0, [r1] + strb r3, [r2] + movs r6, 0 + ldr r2, [sp, 0x1C] +_0805829E: + mov r3, sp + adds r0, r3, r6 + ldrb r1, [r0] + lsls r0, r6, 1 + lsls r1, r0 + ldrb r0, [r2] + orrs r0, r1 + strb r0, [r2] + adds r6, 0x1 + cmp r6, 0x3 + ble _0805829E + ldrb r1, [r7] + movs r0, 0x58 + muls r0, r1 + add r0, r10 + adds r0, 0x3B + ldr r5, [sp, 0x1C] + ldrb r1, [r5] + strb r1, [r0] + movs r6, 0 + adds r4, r7, 0 + movs r3, 0x58 + movs r0, 0x24 + add r0, r10 + mov r8, r0 + mov r2, r9 + mov r7, r10 + adds r7, 0xC + mov r5, r12 +_080582D8: + lsls r1, r6, 1 + ldrb r0, [r4] + muls r0, r3 + adds r1, r0 + adds r1, r7 + ldrh r0, [r2] + strh r0, [r1] + ldrb r0, [r4] + adds r1, r0, 0 + muls r1, r3 + adds r1, r6, r1 + add r1, r8 + adds r0, r5, r6 + ldrb r0, [r0] + strb r0, [r1] + adds r2, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _080582D8 + ldr r2, =0x02024064 + ldrb r1, [r2] + movs r0, 0x58 + muls r0, r1 + mov r1, r10 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + beq _0805831A + b _080584A8 +_0805831A: + movs r6, 0 + mov r1, sp + adds r1, 0x4 + str r1, [sp, 0x20] + add r3, sp, 0xC + mov r10, r3 + ldr r5, =0x0202406e + mov r9, r5 + mov r8, r2 + movs r7, 0x64 + ldr r5, =0x020244ec + adds r4, r1, 0 +_08058332: + mov r1, r8 + ldrb r0, [r1] + lsls r0, 1 + add r0, r9 + ldrh r0, [r0] + muls r0, r7 + adds r0, r5 + adds r1, r6, 0 + adds r1, 0xD + bl pokemon_getattr + strh r0, [r4] + mov r2, r8 + ldrb r0, [r2] + lsls r0, 1 + add r0, r9 + ldrh r0, [r0] + muls r0, r7 + adds r0, r5 + adds r1, r6, 0 + adds r1, 0x11 + bl pokemon_getattr + mov r3, r10 + adds r1, r3, r6 + strb r0, [r1] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _08058332 + ldr r1, =0x0202406e + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + ldr r5, [sp, 0x1C] + strb r0, [r5] + movs r6, 0 + movs r5, 0x3 + ldr r4, [sp, 0x1C] +_08058392: + mov r0, sp + adds r3, r0, r6 + lsls r2, r6, 1 + adds r1, r5, 0 + lsls r1, r2 + ldrb r0, [r4] + ands r0, r1 + asrs r0, r2 + strb r0, [r3] + adds r6, 0x1 + cmp r6, 0x3 + ble _08058392 + ldr r4, =0x020244b0 + ldr r3, =0x02024064 + ldrb r0, [r3] + adds r0, r4 + ldrb r1, [r0] + lsls r1, 1 + ldr r2, [sp, 0x20] + adds r1, r2, r1 + ldrh r6, [r1] + ldr r2, =0x03005d74 + ldrb r0, [r2] + lsls r0, 1 + ldr r5, [sp, 0x20] + adds r0, r5, r0 + ldrh r0, [r0] + movs r5, 0 + strh r0, [r1] + ldrb r0, [r2] + lsls r0, 1 + ldr r1, [sp, 0x20] + adds r0, r1, r0 + strh r6, [r0] + ldrb r0, [r3] + adds r0, r4 + ldrb r1, [r0] + add r1, r10 + ldrb r6, [r1] + ldrb r0, [r2] + add r0, r10 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r2] + add r0, r10 + strb r6, [r0] + ldrb r0, [r3] + adds r0, r4 + ldrb r0, [r0] + add r0, sp + ldrb r0, [r0] + ldr r1, [sp, 0x1C] + strb r0, [r1] + ldrb r0, [r3] + adds r0, r4 + ldrb r0, [r0] + mov r3, sp + adds r1, r3, r0 + ldrb r0, [r2] + add r0, sp + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r2] + adds r1, r3, r0 + ldr r2, [sp, 0x1C] + ldrb r0, [r2] + strb r0, [r1] + strb r5, [r2] + movs r6, 0 + ldr r2, [sp, 0x1C] +_0805841E: + mov r3, sp + adds r0, r3, r6 + ldrb r1, [r0] + lsls r0, r6, 1 + lsls r1, r0 + ldrb r0, [r2] + orrs r0, r1 + strb r0, [r2] + adds r6, 0x1 + cmp r6, 0x3 + ble _0805841E + movs r6, 0 + ldr r5, =0x0202406e + mov r10, r5 + ldr r0, =0x02024064 + mov r9, r0 + movs r1, 0x64 + mov r8, r1 + ldr r7, =0x020244ec + ldr r5, [sp, 0x20] + adds r5, 0x8 + ldr r4, [sp, 0x20] +_0805844A: + mov r2, r9 + ldrb r0, [r2] + lsls r0, 1 + add r0, r10 + ldrh r0, [r0] + mov r3, r8 + muls r3, r0 + adds r0, r3, 0 + adds r0, r7 + adds r1, r6, 0 + adds r1, 0xD + adds r2, r4, 0 + bl pokemon_setattr + mov r1, r9 + ldrb r0, [r1] + lsls r0, 1 + add r0, r10 + ldrh r0, [r0] + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + adds r0, r7 + adds r1, r6, 0 + adds r1, 0x11 + adds r2, r5, 0 + bl pokemon_setattr + adds r5, 0x1 + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _0805844A + ldr r1, =0x0202406e + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x15 + ldr r2, [sp, 0x1C] + bl pokemon_setattr +_080584A8: + ldr r1, =0x03005d60 + ldr r2, =0x02024064 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8057BFC + str r1, [r0] + ldr r3, =0x020244b0 + ldrb r0, [r2] + adds r0, r3 + ldr r1, =0x03005d74 + ldrb r1, [r1] + strb r1, [r0] + ldrb r0, [r2] + adds r0, r3 + ldrb r0, [r0] + movs r1, 0 + bl battle_menu_cursor_related_2 + b _08058532 + .pool +_08058500: + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + beq _08058554 + movs r0, 0x5 + bl audio_play + ldr r0, =0x03005d74 + ldrb r0, [r0] + bl battle_menu_cursor_related + ldr r1, =0x020244b0 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl battle_menu_cursor_related_2 + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8057BFC + str r1, [r0] +_08058532: + bl sub_8059B18 + bl sub_8059B3C + bl sub_8059BB0 + b _080586E8 + .pool +_08058554: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080585A4 + ldr r3, =0x03005d74 + ldrb r2, [r3] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + bne _0805856A + b _080586E8 +_0805856A: + ldr r0, =0x020244b0 + ldr r1, =0x02024064 + ldrb r1, [r1] + adds r1, r0 + ldrb r5, [r1] + cmp r2, r5 + bne _08058590 +_08058578: + ldrb r0, [r1] + movs r1, 0x1D + bl battle_menu_cursor_related_2 + b _08058596 + .pool +_08058590: + ldrb r0, [r3] + bl battle_menu_cursor_related +_08058596: + ldr r4, =0x03005d74 + ldrb r0, [r4] + movs r1, 0x1 + b _0805862C + .pool +_080585A4: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080585E8 + ldr r3, =0x03005d74 + ldrb r2, [r3] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _080585BA + b _080586E8 +_080585BA: + ldr r1, =0x03005d78 + movs r0, 0x1 + eors r0, r2 + ldrb r1, [r1] + cmp r0, r1 + bcc _080585C8 + b _080586E8 +_080585C8: + ldr r0, =0x020244b0 + ldr r1, =0x02024064 + ldrb r1, [r1] + adds r1, r0 + ldrb r0, [r1] + cmp r2, r0 + beq _08058578 + b _08058590 + .pool +_080585E8: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0805865C + ldr r3, =0x03005d74 + ldrb r2, [r3] + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _080586E8 + ldr r0, =0x020244b0 + ldr r1, =0x02024064 + ldrb r1, [r1] + adds r1, r0 + ldrb r5, [r1] + cmp r2, r5 + bne _08058620 + ldrb r0, [r1] + movs r1, 0x1D + bl battle_menu_cursor_related_2 + b _08058626 + .pool +_08058620: + ldrb r0, [r3] + bl battle_menu_cursor_related +_08058626: + ldr r4, =0x03005d74 + ldrb r0, [r4] + movs r1, 0x2 +_0805862C: + eors r0, r1 + strb r0, [r4] + movs r0, 0x5 + bl audio_play + ldr r1, =0x020244b0 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r4] + ldrb r0, [r0] + cmp r1, r0 + beq _080586CA + ldrb r0, [r4] + movs r1, 0x1B + bl battle_menu_cursor_related_2 + b _080586E8 + .pool +_0805865C: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080586E8 + ldr r3, =0x03005d74 + ldrb r2, [r3] + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + bne _080586E8 + ldr r1, =0x03005d78 + movs r0, 0x2 + eors r0, r2 + ldrb r1, [r1] + cmp r0, r1 + bcs _080586E8 + ldr r0, =0x020244b0 + ldr r1, =0x02024064 + ldrb r1, [r1] + adds r1, r0 + ldrb r0, [r1] + cmp r2, r0 + bne _080586A4 + ldrb r0, [r1] + movs r1, 0x1D + bl battle_menu_cursor_related_2 + b _080586AA + .pool +_080586A4: + ldrb r0, [r3] + bl battle_menu_cursor_related +_080586AA: + ldr r4, =0x03005d74 + ldrb r0, [r4] + movs r1, 0x2 + eors r0, r1 + strb r0, [r4] + movs r0, 0x5 + bl audio_play + ldr r1, =0x020244b0 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r4] + ldrb r0, [r0] + cmp r1, r0 + bne _080586E0 +_080586CA: + adds r0, r1, 0 + movs r1, 0 + bl battle_menu_cursor_related_2 + b _080586E8 + .pool +_080586E0: + ldrb r0, [r4] + movs r1, 0x1B + bl battle_menu_cursor_related_2 +_080586E8: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8058138 + + thumb_func_start sub_80586F8 +sub_80586F8: @ 80586F8 + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _0805875C + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08058798 + movs r0, 0x5A + bl m4aSongNumStop + ldr r3, =0x030022c0 + ldr r0, =0x00000439 + adds r2, r3, r0 + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, =0x03005d00 + ldr r0, [r0] + str r0, [r3] + ldr r0, =sub_8038D64 + bl SetMainCallback2 + ldr r0, =0x0202433a + ldrb r0, [r0] + cmp r0, 0x1 + bne _08058738 + bl sub_817E3F4 +_08058738: + bl FreeAllWindowBuffers + b _08058798 + .pool +_0805875C: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08058798 + movs r0, 0x5A + bl m4aSongNumStop + ldr r3, =0x030022c0 + ldr r0, =0x00000439 + adds r2, r3, r0 + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, =0x03005d00 + ldr r0, [r0] + str r0, [r3] + ldr r0, =sub_8038D64 + bl SetMainCallback2 + ldr r0, =0x0202433a + ldrb r0, [r0] + cmp r0, 0x1 + bne _08058794 + bl sub_817E3F4 +_08058794: + bl FreeAllWindowBuffers +_08058798: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80586F8 + + thumb_func_start sub_80587B0 +sub_80587B0: @ 80587B0 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08058832 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08058810 + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08058832 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _080587F0 + bl sub_800AC34 + b _080587F4 + .pool +_080587F0: + bl sub_800ADF8 +_080587F4: + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80586F8 + str r1, [r0] + b _08058832 + .pool +_08058810: + movs r0, 0x5A + bl m4aSongNumStop + ldr r2, =0x030022c0 + ldr r0, =0x00000439 + adds r3, r2, r0 + ldrb r1, [r3] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + ldr r0, =0x03005d00 + ldr r0, [r0] + str r0, [r2] + ldr r0, [r2, 0x8] + bl SetMainCallback2 +_08058832: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80587B0 + + thumb_func_start sub_8058844 +sub_8058844: @ 8058844 + push {lr} + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + 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, =DummyObjectCallback + cmp r1, r0 + bne _08058868 + bl dp01_tbl1_exec_completed +_08058868: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8058844 + + thumb_func_start sub_805887C +sub_805887C: @ 805887C + push {lr} + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + 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, =DummyObjectCallback + cmp r1, r0 + bne _080588A0 + bl dp01_tbl1_exec_completed +_080588A0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_805887C + + thumb_func_start bx_802F7A0 +bx_802F7A0: @ 80588B4 + push {r4-r6,lr} + ldr r6, =0x02020630 + ldr r5, =0x020241e4 + ldr r4, =0x02024064 + 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, =DummyObjectCallback + cmp r1, r0 + bne _08058908 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + 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 obj_free_rotscale_entry + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl RemoveObjectAndFreeTiles + bl dp01_tbl1_exec_completed +_08058908: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bx_802F7A0 + + thumb_func_start sub_8058924 +sub_8058924: @ 8058924 + push {r4,lr} + ldr r4, =0x020244d0 + ldr r1, [r4] + ldr r3, =0x02024064 + 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 _0805895C + 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 dp01_tbl1_exec_completed +_0805895C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8058924 + + thumb_func_start sub_805896C +sub_805896C: @ 805896C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r7, 0 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08058998 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _080589D0 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080589D0 +_08058998: + ldr r2, =0x02020630 + ldr r1, =0x03005d70 + ldr r3, =0x02024064 + ldrb r0, [r3] + 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, =DummyObjectCallback + mov r10, r3 + cmp r1, r0 + bne _08058A0A + b _08058A0E + .pool +_080589D0: + ldr r3, =0x02020630 + ldr r6, =0x03005d70 + ldr r2, =0x02024064 + ldrb r4, [r2] + adds r0, r4, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r5, r3, 0 + adds r5, 0x1C + adds r0, r5 + ldr r3, [r0] + ldr r0, =DummyObjectCallback + mov r10, r2 + cmp r3, r0 + bne _08058A0A + movs r0, 0x2 + eors r4, r0 + adds r0, r4, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r0, [r0] + cmp r0, r3 + bne _08058A0A + movs r7, 0x1 +_08058A0A: + cmp r7, 0 + beq _08058B08 +_08058A0E: + ldr r0, =0x020244d0 + mov r9, r0 + ldr r0, [r0] + mov r6, r10 + ldrb r2, [r6] + ldr r3, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r4, r0, r3 + ldrb r1, [r4, 0x1] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08058B08 + 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, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08058B08 + ldrb r1, [r4] + movs r3, 0x7F + adds r0, r3, 0 + ands r0, r1 + strb r0, [r4] + mov r2, r9 + ldr r0, [r2] + 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, r9 + ldr r2, [r0] + ldrb r0, [r6] + 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, [r6] + 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 FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + ldr r7, =0x0202406e + ldrb r1, [r6] + lsls r0, r1, 1 + adds r0, r7 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + bl sub_805E990 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08058AE4 + ldrb r0, [r6] + mov r1, r8 + eors r1, r0 + lsls r0, r1, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r5 + adds r0, r4 + bl sub_805E990 +_08058AE4: + mov r2, r9 + ldr r0, [r2] + mov r2, r10 + 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, =0x03005d60 + mov r2, r10 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8058924 + str r1, [r0] +_08058B08: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805896C + + thumb_func_start sub_8058B40 +sub_8058B40: @ 8058B40 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r0, 0 + mov r9, r0 + mov r8, r0 + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r7, =0x02024064 + 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 _08058B80 + ldr r0, =0x0202406e + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_08058B80: + 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 _08058BB2 + ldr r0, =0x0202406e + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_08058BB2: + 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 _08058C82 + 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 _08058C82 + ldrb r1, [r4, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08058C68 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08058C38 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08058C38 + ldr r4, =0x03005d70 + ldrb r0, [r7] + adds r1, r6, 0 + eors r1, r0 + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + 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 +_08058C38: + ldr r5, =0x03005d70 + ldr r4, =0x02024064 + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + 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 +_08058C68: + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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] +_08058C82: + ldr r5, =0x020244d0 + ldr r0, [r5] + ldr r4, =0x02024064 + 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 _08058D32 + 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 _08058D32 + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + bne _08058D32 + ldr r0, [r5] + ldrb r1, [r4] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _08058D14 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x42 + ands r0, r1 + cmp r0, 0x42 + bne _08058D08 + ldr r0, =0x03007420 + bl m4aMPlayContinue + b _08058D14 + .pool +_08058D08: + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl +_08058D14: + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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 +_08058D32: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08058D52 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08058DAC + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08058DAC +_08058D52: + ldr r2, =0x02020630 + ldr r0, =0x03005d7c + ldr r1, =0x02024064 + 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, =DummyObjectCallback + cmp r3, r0 + bne _08058E0A + ldr r0, =0x020241e4 + 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 _08058E0A + b _08058E06 + .pool +_08058DAC: + ldr r2, =0x02020630 + ldr r7, =0x03005d7c + ldr r0, =0x02024064 + 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, =DummyObjectCallback + cmp r4, r0 + bne _08058E0A + ldr r6, =0x020241e4 + 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 _08058E0A + 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 _08058E0A + 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 _08058E0A +_08058E06: + movs r0, 0x1 + mov r8, r0 +_08058E0A: + mov r0, r9 + cmp r0, 0 + beq _08058EAA + mov r0, r8 + cmp r0, 0 + beq _08058EAA + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08058E48 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08058E48 + ldr r2, =0x03005d7c + ldr r0, =0x02024064 + ldrb r1, [r0] + movs r0, 0x2 + eors r0, r1 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles +_08058E48: + ldr r1, =0x03005d7c + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + ldr r3, =0x020244d0 + 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, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805896C + str r1, [r0] +_08058EAA: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8058B40 + + thumb_func_start sub_8058EDC +sub_8058EDC: @ 8058EDC + push {r4-r6,lr} + ldr r2, =0x02020630 + ldr r0, =0x03005d70 + ldr r6, =0x02024064 + ldrb r3, [r6] + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r4, [r0] + ldr r0, =DummyObjectCallback + cmp r4, r0 + bne _08058F94 + ldr r5, =0x020244d0 + ldr r0, [r5] + ldr r1, [r0, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08058F94 + ldr r0, =0x020241e4 + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + cmp r0, r4 + bne _08058F94 + adds r0, r3, 0 + bl sub_805E408 + ldr r0, [r5] + ldrb r2, [r6] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x7F + ands r0, r2 + strb r0, [r1] + ldr r0, [r5] + 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 r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + ldr r4, =0x000027f9 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + ldr r0, [r5] + 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 _08058F88 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x6 + bl move_anim_start_t4 +_08058F88: + ldr r0, =0x03005d60 + ldrb r1, [r6] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_8058FC0 + str r0, [r1] +_08058F94: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8058EDC + + thumb_func_start sub_8058FC0 +sub_8058FC0: @ 8058FC0 + push {r4,lr} + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r4, =0x02024064 + 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 _0805900E + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + bne _0805900E + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + ldr r2, =0x0202406e + ldrb r1, [r4] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + adds r0, r2 + bl sub_805E990 + bl dp01_tbl1_exec_completed +_0805900E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8058FC0 + + thumb_func_start sub_805902C +sub_805902C: @ 805902C + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r0, [r6] + ldr r5, =0x02024064 + 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 _0805905E + ldr r0, =0x0202406e + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_0805905E: + ldr r4, =0x02020630 + ldr r0, =0x03005d7c + 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, =DummyObjectCallback + cmp r1, r0 + bne _080590D2 + 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 _080590D2 + adds r0, r3, r4 + bl RemoveObjectAndFreeTiles + ldr r4, =0x03005d70 + ldrb r1, [r5] + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + 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 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8058EDC + str r1, [r0] +_080590D2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805902C + + thumb_func_start c3_0802FDF4 +c3_0802FDF4: @ 8059100 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + bne _08059122 + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + adds r0, r4, 0 + bl DestroyTask +_08059122: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end c3_0802FDF4 + + thumb_func_start bx_t1_healthbar_update +bx_t1_healthbar_update: @ 8059130 + push {r4-r6,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + ldr r6, =0x03005d70 + 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 _08059178 + ldrb r0, [r5] + adds r0, r6 + ldrb r0, [r0] + movs r2, 0 + bl heathbar_draw_hp + b _08059192 + .pool +_08059178: + ldr r2, =0x0202406e + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + adds r0, r2 + bl sub_805E990 + bl dp01_tbl1_exec_completed +_08059192: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end bx_t1_healthbar_update + + thumb_func_start sub_80591A0 +sub_80591A0: @ 80591A0 + push {lr} + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _080591B2 + bl dp01_tbl1_exec_completed +_080591B2: + pop {r0} + bx r0 + thumb_func_end sub_80591A0 + + thumb_func_start sub_80591B8 +sub_80591B8: @ 80591B8 + 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 + mov r9, r0 + ldr r1, =0x03005e00 + lsls r0, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + mov r8, r0 + ldrb r0, [r0, 0x8] + mov r10, r0 + mov r1, r8 + ldrb r7, [r1, 0xC] + str r7, [sp, 0x8] + ldrh r2, [r1, 0xA] + str r2, [sp, 0xC] + bl battle_type_is_double + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080591FE + ldr r1, =0x0202406e + lsls r0, r7, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r10, r0 + bne _080591FE + b _08059314 +_080591FE: + movs r0, 0x64 + mov r1, r10 + muls r1, r0 + ldr r0, =0x020244ec + adds r6, r1, r0 + adds r0, r6, 0 + movs r1, 0xB + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r6, 0 + movs r1, 0x38 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + movs r1, 0x19 + bl pokemon_getattr + str r0, [sp, 0x4] + ldr r3, =gExperienceTables + adds r4, 0x1 + lsls r4, 2 + ldr r2, =gBaseStats + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x13] + movs r1, 0xCA + lsls r1, 1 + muls r1, r2 + adds r4, r1 + adds r4, r3 + ldr r2, [r4] + str r2, [sp] + ldr r3, [sp, 0xC] + lsls r1, r3, 16 + asrs r1, 16 + adds r0, r1 + cmp r0, r2 + bcc _080592EC + adds r0, r6, 0 + movs r1, 0x19 + mov r2, sp + bl pokemon_setattr + adds r0, r6, 0 + bl pokemon_calc_effective_stats + ldr r2, [sp] + add r0, sp, 0x4 + ldrh r0, [r0] + subs r2, r0 + ldr r0, [sp, 0xC] + subs r2, r0, r2 + ldr r4, =0x02024064 + ldrb r5, [r4] + strb r7, [r4] + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x1 + movs r1, 0xB + bl dp01_build_cmdbuf_x21_a_bb + strb r5, [r4] + bl battle_type_is_double + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080592D4 + ldr r2, =0x0202406e + lsls r0, r7, 1 + adds r0, r2 + mov r1, r10 + ldrh r0, [r0] + cmp r1, r0 + beq _080592B2 + movs r0, 0x2 + eors r7, r0 + lsls r0, r7, 1 + adds r0, r2 + ldrh r0, [r0] + cmp r1, r0 + bne _080592D4 +_080592B2: + ldr r0, =sub_8059544 + b _08059316 + .pool +_080592D4: + ldr r0, =0x03005e00 + mov r2, r9 + lsls r1, r2, 2 + add r1, r9 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_805965C + b _08059318 + .pool +_080592EC: + str r0, [sp, 0x4] + add r2, sp, 0x4 + adds r0, r6, 0 + movs r1, 0x19 + bl pokemon_setattr + ldr r1, =0x03005d60 + ldr r3, [sp, 0x8] + lsls r0, r3, 2 + adds r0, r1 + ldr r1, =sub_80591A0 + str r1, [r0] + mov r0, r9 + bl DestroyTask + b _0805931A + .pool +_08059314: + ldr r0, =sub_8059330 +_08059316: + mov r1, r8 +_08059318: + str r0, [r1] +_0805931A: + 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_80591B8 + + thumb_func_start sub_8059330 +sub_8059330: @ 8059330 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r2, r0, 2 + mov r8, r2 + add r8, r0 + mov r0, r8 + lsls r0, 3 + mov r8, r0 + add r8, r1 + mov r2, r8 + ldrb r1, [r2, 0x8] + movs r0, 0xA + ldrsh r2, [r2, r0] + mov r9, r2 + mov r2, r8 + ldrb r2, [r2, 0xC] + mov r10, r2 + movs r0, 0x64 + adds r6, r1, 0 + muls r6, r0 + ldr r0, =0x020244ec + adds r6, r0 + adds r0, r6, 0 + movs r1, 0x38 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + movs r1, 0xB + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r6, 0 + movs r1, 0x19 + bl pokemon_getattr + adds r3, r0, 0 + ldr r6, =gExperienceTables + lsls r1, r4, 2 + ldr r2, =gBaseStats + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r2 + ldrb r2, [r0, 0x13] + movs r0, 0xCA + lsls r0, 1 + muls r0, r2 + adds r1, r0 + adds r1, r6 + ldr r1, [r1] + subs r3, r1 + adds r4, 0x1 + lsls r4, 2 + adds r4, r0 + adds r4, r6 + ldr r2, [r4] + subs r2, r1 + ldr r0, =0x03005d70 + add r0, r10 + ldrb r1, [r0] + mov r0, r9 + negs r0, r0 + str r0, [sp] + mov r0, r10 + bl sub_807294C + movs r0, 0x21 + bl audio_play + ldr r0, =sub_8059400 + mov r1, r8 + str r0, [r1] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059330 + + thumb_func_start sub_8059400 +sub_8059400: @ 8059400 + 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 + ldr r1, =0x03005e00 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r6, r0, r1 + ldrh r1, [r6, 0x1C] + movs r2, 0x1C + ldrsh r0, [r6, r2] + cmp r0, 0xC + bgt _08059430 + adds r0, r1, 0x1 + strh r0, [r6, 0x1C] + b _0805952C + .pool +_08059430: + ldrb r0, [r6, 0x8] + mov r9, r0 + ldrh r2, [r6, 0xA] + mov r10, r2 + ldrb r7, [r6, 0xC] + ldr r5, =0x03005d70 + adds r5, r7, r5 + ldrb r1, [r5] + adds r0, r7, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_8074AA0 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r5] + bl sub_80729D0 + lsls r4, 16 + asrs r4, 16 + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + bne _0805952C + movs r0, 0x21 + bl m4aSongNumStop + movs r0, 0x64 + mov r1, r9 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x38 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x19 + bl pokemon_getattr + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + ldr r3, =gExperienceTables + adds r4, 0x1 + lsls r4, 2 + ldr r2, =gBaseStats + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x13] + movs r0, 0xCA + lsls r0, 1 + muls r0, r1 + adds r4, r0 + adds r4, r3 + ldr r1, [r4] + str r1, [sp] + mov r2, r10 + lsls r0, r2, 16 + asrs r4, r0, 16 + ldr r0, [sp, 0x4] + adds r0, r4 + cmp r0, r1 + blt _08059510 + adds r0, r5, 0 + movs r1, 0x19 + mov r2, sp + bl pokemon_setattr + adds r0, r5, 0 + bl pokemon_calc_effective_stats + ldr r2, [sp] + add r0, sp, 0x4 + ldrh r0, [r0] + subs r2, r0 + subs r2, r4, r2 + ldr r4, =0x02024064 + ldrb r5, [r4] + strb r7, [r4] + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x1 + movs r1, 0xB + bl dp01_build_cmdbuf_x21_a_bb + strb r5, [r4] + ldr r0, =sub_8059544 + str r0, [r6] + b _0805952C + .pool +_08059510: + str r0, [sp, 0x4] + add r2, sp, 0x4 + adds r0, r5, 0 + movs r1, 0x19 + bl pokemon_setattr + ldr r1, =0x03005d60 + lsls r0, r7, 2 + adds r0, r1 + ldr r1, =sub_80591A0 + str r1, [r0] + mov r0, r8 + bl DestroyTask +_0805952C: + 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_8059400 + + thumb_func_start sub_8059544 +sub_8059544: @ 8059544 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrb r4, [r0, 0xC] + ldrb r6, [r0, 0x8] + bl battle_type_is_double + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08059578 + ldr r1, =0x0202406e + movs r0, 0x2 + adds r2, r4, 0 + eors r2, r0 + lsls r0, r2, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r6, r0 + bne _08059578 + adds r4, r2, 0 +_08059578: + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0 + bl move_anim_start_t4 + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80595A4 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059544 + + thumb_func_start sub_80595A4 +sub_80595A4: @ 80595A4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r2, r0, r1 + ldrb r5, [r2, 0xC] + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08059646 + ldrb r4, [r2, 0x8] + movs r0, 0x64 + adds r1, r4, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0x38 + bl pokemon_getattr + bl battle_type_is_double + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08059624 + ldr r1, =0x0202406e + movs r0, 0x2 + adds r2, r5, 0 + eors r2, r0 + lsls r0, r2, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + bne _08059624 + ldr r0, =0x03005d70 + adds r0, r2, r0 + ldrb r0, [r0] + adds r1, r7, 0 + movs r2, 0 + bl healthbar_draw_field_maybe + b _08059638 + .pool +_08059624: + ldr r0, =0x03005d70 + adds r0, r5, r0 + ldrb r0, [r0] + movs r1, 0x64 + muls r1, r4 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe +_08059638: + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_805965C + str r0, [r1] +_08059646: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80595A4 + + thumb_func_start sub_805965C +sub_805965C: @ 805965C + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =0x03005e00 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + ldrb r1, [r4, 0x8] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x38 + bl pokemon_getattr + ldrb r0, [r4, 0xC] + ldr r1, =0x03005d60 + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80591A0 + str r1, [r0] + adds r0, r5, 0 + bl DestroyTask + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805965C + + thumb_func_start sub_80596A8 +sub_80596A8: @ 80596A8 + push {r4-r6,lr} + ldr r6, =0x02020630 + ldr r5, =0x020241e4 + ldr r4, =0x02024064 + 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 _08059724 + ldr r1, =0x0202406e + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + 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 rotscale_free_entry + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl RemoveObjectAndFreeTiles + ldr r1, =0x03005d70 + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl1_exec_completed +_08059724: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80596A8 + + thumb_func_start sub_8059744 +sub_8059744: @ 8059744 + push {r4-r6,lr} + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r6, =0x02024064 + 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 _08059798 + ldr r5, =0x020241e4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r1, =0x03005d70 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl1_exec_completed +_08059798: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059744 + + thumb_func_start sub_80597B4 +sub_80597B4: @ 80597B4 + push {lr} + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _080597C6 + bl dp01_tbl1_exec_completed +_080597C6: + pop {r0} + bx r0 + thumb_func_end sub_80597B4 + + thumb_func_start sub_80597CC +sub_80597CC: @ 80597CC + push {r4,lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0805980A + ldr r1, =0x03005d60 + ldr r2, =0x02024064 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8059828 + str r1, [r0] + ldr r3, =0x03005e00 + ldr r1, =0x03005d7c + ldrb r0, [r2] + adds r0, r1 + ldrb r0, [r0] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r3 + ldrb r4, [r1, 0x8] + bl DestroyTask + bl FreeAllWindowBuffers + adds r0, r4, 0 + bl sub_81B89AC +_0805980A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80597CC + + thumb_func_start sub_8059828 +sub_8059828: @ 8059828 + push {lr} + ldr r0, =0x030022c0 + ldr r1, [r0, 0x4] + ldr r0, =sub_8038420 + cmp r1, r0 + bne _08059898 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08059898 + ldr r0, =0x0203cee8 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08059870 + ldr r0, =0x0203cee9 + ldrb r1, [r0] + ldr r2, =0x0203cf00 + movs r0, 0x1 + bl dp01_build_cmdbuf_x22_a_three_bytes + b _0805987A + .pool +_08059870: + movs r0, 0x1 + movs r1, 0x6 + movs r2, 0 + bl dp01_build_cmdbuf_x22_a_three_bytes +_0805987A: + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + bne _08059894 + bl b_link_standby_message +_08059894: + bl dp01_tbl1_exec_completed +_08059898: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059828 + + thumb_func_start sub_80598A4 +sub_80598A4: @ 80598A4 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080598CC + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80598E0 + str r1, [r0] + bl nullsub_35 + bl FreeAllWindowBuffers + bl sub_81AABB0 +_080598CC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80598A4 + + thumb_func_start sub_80598E0 +sub_80598E0: @ 80598E0 + push {lr} + ldr r0, =0x030022c0 + ldr r1, [r0, 0x4] + ldr r0, =sub_8038420 + cmp r1, r0 + bne _08059906 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08059906 + ldr r0, =0x0203ce7c + ldrh r1, [r0] + movs r0, 0x1 + bl dp01_build_cmdbuf_x23_aa_0 + bl dp01_tbl1_exec_completed +_08059906: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80598E0 + + thumb_func_start bx_wait_t1 +bx_wait_t1: @ 805991C + push {lr} + ldr r0, =0x020244b9 + ldrb r0, [r0] + cmp r0, 0 + beq _08059942 + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08059946 +_08059942: + bl dp01_tbl1_exec_completed +_08059946: + pop {r0} + bx r0 + .pool + thumb_func_end bx_wait_t1 + + thumb_func_start bx_blink_t1 +bx_blink_t1: @ 8059958 + push {r4,lr} + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + ldr r2, =0x02020630 + 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 _080599A4 + 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, =0x020244b9 + strb r3, [r0] + bl dp01_tbl1_exec_completed + b _080599CE + .pool +_080599A4: + ldrh r0, [r4, 0x30] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080599C8 + 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] +_080599C8: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] +_080599CE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end bx_blink_t1 + + thumb_func_start sub_80599D4 +sub_80599D4: @ 80599D4 + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08059A02 + ldr r4, =0x03005d74 + ldrb r0, [r4] + cmp r0, 0 + beq _08059A02 + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + bl sub_8056BAC + movs r0, 0 + strb r0, [r4] + movs r0, 0 + bl sub_8056B74 +_08059A02: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08059A2C + ldr r4, =0x03005d74 + ldrb r0, [r4] + cmp r0, 0 + bne _08059A2C + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + bl sub_8056BAC + movs r0, 0x1 + strb r0, [r4] + movs r0, 0x1 + bl sub_8056B74 +_08059A2C: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _08059A7A + str r2, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + movs r0, 0x5 + bl audio_play + ldr r0, =0x03005d74 + ldrb r0, [r0] + cmp r0, 0 + beq _08059A6C + movs r0, 0x1 + movs r1, 0xE + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + b _08059A76 + .pool +_08059A6C: + movs r0, 0x1 + movs r1, 0xD + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb +_08059A76: + bl dp01_tbl1_exec_completed +_08059A7A: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08059AA0 + movs r0, 0x1 + str r0, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + movs r0, 0x5 + bl audio_play + bl dp01_tbl1_exec_completed +_08059AA0: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80599D4 + + thumb_func_start sub_8059AAC +sub_8059AAC: @ 8059AAC + push {r4-r7,lr} + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r1, 9 + ldr r3, =0x02023068 + ldr r2, =0x03005d78 + movs r0, 0 + strb r0, [r2] + movs r5, 0 + ldr r7, =0x02022e2c + adds r4, r1, r3 + adds r6, r2, 0 +_08059AC4: + lsls r0, r5, 24 + lsrs r0, 24 + bl battle_menu_cursor_related + ldrh r1, [r4] + movs r0, 0xD + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + adds r0, r7, 0 + bl CopyString + adds r1, r5, 0x3 + lsls r1, 24 + lsrs r1, 24 + adds r0, r7, 0 + bl battle_show_message_maybe + ldrh r0, [r4] + cmp r0, 0 + beq _08059AF4 + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] +_08059AF4: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _08059AC4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059AAC + + thumb_func_start sub_8059B18 +sub_8059B18: @ 8059B18 + push {r4,lr} + ldr r4, =0x02022e2c + ldr r1, =gUnknown_085CCA6F + adds r0, r4, 0 + bl CopyString + adds r0, r4, 0 + movs r1, 0x7 + bl battle_show_message_maybe + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059B18 + + thumb_func_start sub_8059B3C +sub_8059B3C: @ 8059B3C + push {r4-r7,lr} + ldr r5, =0x02023064 + ldr r7, =0x02024064 + ldrb r0, [r7] + lsls r0, 9 + adds r1, r5, 0x2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08059B98 + bl sub_814FBAC + ldrb r1, [r7] + lsls r4, r1, 9 + adds r0, r5, 0x4 + adds r4, r0 + ldr r6, =0x02022e2c + ldr r5, =0x020244b0 + adds r1, r5 + adds r0, r4, 0 + adds r0, 0x8 + ldrb r1, [r1] + adds r0, r1 + ldrb r1, [r0] + adds r0, r6, 0 + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + movs r1, 0xBA + strb r1, [r0] + adds r0, 0x1 + ldrb r1, [r7] + adds r1, r5 + adds r4, 0xC + ldrb r1, [r1] + adds r4, r1 + ldrb r1, [r4] + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + adds r0, r6, 0 + movs r1, 0x9 + bl battle_show_message_maybe +_08059B98: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059B3C + + thumb_func_start sub_8059BB0 +sub_8059BB0: @ 8059BB0 + push {r4-r6,lr} + ldr r5, =0x02024064 + ldrb r4, [r5] + lsls r4, 9 + ldr r0, =0x02023068 + adds r4, r0 + ldr r6, =0x02022e2c + ldr r1, =gUnknown_085CCA73 + adds r0, r6, 0 + bl CopyString + movs r1, 0xFC + strb r1, [r0] + adds r0, 0x1 + movs r1, 0x6 + strb r1, [r0] + adds r0, 0x1 + movs r1, 0x1 + strb r1, [r0] + adds r0, 0x1 + ldr r3, =gBattleMoves + ldr r2, =0x020244b0 + ldrb r1, [r5] + adds r1, r2 + ldrb r1, [r1] + lsls r1, 1 + adds r4, r1 + ldrh r2, [r4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r3 + ldrb r2, [r1, 0x2] + lsls r1, r2, 3 + subs r1, r2 + ldr r2, =gTypeNames + adds r1, r2 + bl CopyString + adds r0, r6, 0 + movs r1, 0xA + bl battle_show_message_maybe + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059BB0 + + thumb_func_start battle_menu_cursor_related_2 +battle_menu_cursor_related_2: @ 8059C28 + push {lr} + sub sp, 0x10 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + lsls r1, 24 + lsrs r1, 24 + add r2, sp, 0xC + adds r0, r1, 0x1 + strh r0, [r2] + adds r0, r2, 0 + adds r1, 0x2 + strh r1, [r0, 0x2] + movs r1, 0x1 + adds r0, r3, 0 + ands r0, r1 + lsls r2, r0, 3 + adds r2, r0 + adds r2, 0x1 + movs r0, 0x2 + ands r3, r0 + adds r3, 0x37 + str r1, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + add r1, sp, 0xC + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0x10 + pop {r0} + bx r0 + thumb_func_end battle_menu_cursor_related_2 + + thumb_func_start battle_menu_cursor_related +battle_menu_cursor_related: @ 8059C70 + push {lr} + sub sp, 0x10 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + add r0, sp, 0xC + ldr r1, =0x00001016 + strh r1, [r0] + strh r1, [r0, 0x2] + movs r1, 0x1 + adds r0, r3, 0 + ands r0, r1 + lsls r2, r0, 3 + adds r2, r0 + adds r2, 0x1 + movs r0, 0x2 + ands r3, r0 + adds r3, 0x37 + str r1, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + add r1, sp, 0xC + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end battle_menu_cursor_related + + thumb_func_start sub_8059CB4 +sub_8059CB4: @ 8059CB4 + push {r4,lr} + sub sp, 0x10 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + add r0, sp, 0xC + movs r4, 0x1 + strh r4, [r0] + movs r1, 0x2 + strh r1, [r0, 0x2] + adds r0, r3, 0 + ands r0, r4 + lsls r2, r0, 3 + subs r2, r0 + adds r2, 0x10 + lsls r2, 24 + lsrs r2, 24 + ands r3, r1 + adds r3, 0x23 + str r4, [sp] + str r1, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + add r1, sp, 0xC + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8059CB4 + + thumb_func_start sub_8059CF8 +sub_8059CF8: @ 8059CF8 + push {lr} + sub sp, 0x10 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + add r0, sp, 0xC + ldr r1, =0x00001016 + strh r1, [r0] + strh r1, [r0, 0x2] + movs r1, 0x1 + adds r0, r3, 0 + ands r0, r1 + lsls r2, r0, 3 + subs r2, r0 + adds r2, 0x10 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x2 + ands r3, r0 + adds r3, 0x23 + str r1, [sp] + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + add r1, sp, 0xC + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059CF8 + + thumb_func_start sub_8059D40 +sub_8059D40: @ 8059D40 + push {lr} + ldr r0, =sub_80A92F8 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059D40 + + thumb_func_start sub_8059D50 +sub_8059D50: @ 8059D50 + push {lr} + ldr r0, =sub_80A92F8 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059D50 + + thumb_func_start sub_8059D60 +sub_8059D60: @ 8059D60 + push {lr} + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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 _08059D82 + bl dp01_tbl1_exec_completed +_08059D82: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8059D60 + + thumb_func_start bx_8030B2C +bx_8030B2C: @ 8059D90 + push {lr} + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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 _08059DB2 + bl dp01_tbl1_exec_completed +_08059DB2: + pop {r0} + bx r0 + .pool + thumb_func_end bx_8030B2C + + thumb_func_start b_link_standby_message +b_link_standby_message: @ 8059DC0 + push {lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08059DE0 + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r0, =gUnknown_085CCA29 + movs r1, 0 + bl battle_show_message_maybe +_08059DE0: + pop {r0} + bx r0 + .pool + thumb_func_end b_link_standby_message + + thumb_func_start dp01t_00_1_getattr +dp01t_00_1_getattr: @ 8059DF4 + push {r4-r6,lr} + sub sp, 0x100 + movs r6, 0 + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _08059E2C + ldr r0, =0x0202406e + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + mov r1, sp + bl dp01_getattr_by_ch1_for_player_pokemon_ + adds r6, r0, 0 + b _08059E4E + .pool +_08059E2C: + ldrb r4, [r1] + movs r5, 0 +_08059E30: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _08059E46 + lsls r0, r5, 24 + lsrs r0, 24 + mov r2, sp + adds r1, r2, r6 + bl dp01_getattr_by_ch1_for_player_pokemon_ + adds r6, r0 +_08059E46: + lsrs r4, 1 + adds r5, 0x1 + cmp r5, 0x5 + ble _08059E30 +_08059E4E: + lsls r1, r6, 16 + lsrs r1, 16 + movs r0, 0x1 + mov r2, sp + bl dp01_build_cmdbuf_x1D_1D_numargs_varargs + bl dp01_tbl1_exec_completed + add sp, 0x100 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end dp01t_00_1_getattr + + thumb_func_start dp01_getattr_by_ch1_for_player_pokemon_ +dp01_getattr_by_ch1_for_player_pokemon_: @ 8059E68 + 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, =0x02023064 + ldr r3, =0x02024064 + ldrb r0, [r3] + lsls r0, 9 + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3B + bls _08059E92 + bl _0805A5FE +_08059E92: + lsls r0, 2 + ldr r1, =_08059EA8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08059EA8: + .4byte _08059F98 + .4byte _0805A1BC + .4byte _0805A1CC + .4byte _0805A1DC + .4byte _0805A244 + .4byte _0805A244 + .4byte _0805A244 + .4byte _0805A244 + .4byte _0805A260 + .4byte _0805A29C + .4byte _0805A29C + .4byte _0805A29C + .4byte _0805A29C + .4byte _0805A5FE + .4byte _0805A5FE + .4byte _0805A5FE + .4byte _0805A5FE + .4byte _0805A2B8 + .4byte _0805A2C8 + .4byte _0805A2F8 + .4byte _0805A308 + .4byte _0805A318 + .4byte _0805A328 + .4byte _0805A338 + .4byte _0805A348 + .4byte _0805A358 + .4byte _0805A368 + .4byte _0805A378 + .4byte _0805A388 + .4byte _0805A398 + .4byte _0805A3A8 + .4byte _0805A3B8 + .4byte _0805A408 + .4byte _0805A418 + .4byte _0805A428 + .4byte _0805A438 + .4byte _0805A448 + .4byte _0805A458 + .4byte _0805A468 + .4byte _0805A478 + .4byte _0805A488 + .4byte _0805A4BC + .4byte _0805A4CC + .4byte _0805A4DC + .4byte _0805A4EC + .4byte _0805A4FC + .4byte _0805A50C + .4byte _0805A51C + .4byte _0805A52C + .4byte _0805A54C + .4byte _0805A55C + .4byte _0805A56C + .4byte _0805A57C + .4byte _0805A58C + .4byte _0805A59C + .4byte _0805A5AC + .4byte _0805A5BC + .4byte _0805A5CC + .4byte _0805A5DC + .4byte _0805A5EC +_08059F98: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + mov r1, sp + strh r0, [r1] + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + 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 +_08059FE4: + adds r1, r6, 0 + adds r1, 0xD + mov r0, r8 + bl pokemon_getattr + strh r0, [r4] + adds r1, r6, 0 + adds r1, 0x11 + mov r0, r8 + bl pokemon_getattr + mov r2, r9 + adds r1, r2, r6 + strb r0, [r1] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _08059FE4 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r10 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + ldr r2, [sp, 0x80] + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x19 + bl pokemon_getattr + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + str r0, [sp, 0x48] + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + str r0, [sp, 0x4C] + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + ldr r1, [sp, 0x7C] + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x28] + adds r0, r4, 0 + movs r1, 0x3A + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2C] + adds r0, r4, 0 + movs r1, 0x3B + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2] + adds r0, r4, 0 + movs r1, 0x3C + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x4] + adds r0, r4, 0 + movs r1, 0x3D + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x6] + adds r0, r4, 0 + movs r1, 0x3E + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x8] + adds r0, r4, 0 + movs r1, 0x3F + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0xA] + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + str r0, [sp, 0x54] + adds r0, r4, 0 + movs r1, 0x2 + ldr r2, [sp, 0x8C] + bl pokemon_getattr + ldr r0, [sp, 0x84] + ldr r1, [sp, 0x8C] + bl CopyString_Limit10 + adds r0, r4, 0 + movs r1, 0x7 + ldr r2, [sp, 0x88] + bl pokemon_getattr + mov r2, sp + movs r6, 0 +_0805A19C: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0x57 + bls _0805A19C + b _0805A5FE + .pool +_0805A1BC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + b _0805A536 + .pool +_0805A1CC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xC + b _0805A536 + .pool +_0805A1DC: + 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, =0x020244ec + adds r4, r1, r0 + mov r8, r9 +_0805A1F2: + adds r1, r6, 0 + adds r1, 0xD + adds r0, r4, 0 + bl pokemon_getattr + mov r1, r8 + strh r0, [r1] + adds r1, r6, 0 + adds r1, 0x11 + adds r0, r4, 0 + bl pokemon_getattr + mov r2, r10 + adds r1, r2, r6 + strb r0, [r1] + movs r0, 0x2 + add r8, r0 + adds r6, 0x1 + cmp r6, 0x3 + ble _0805A1F2 + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r9 + strb r0, [r1, 0xC] + mov r2, r9 + movs r6, 0 +_0805A230: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0xF + bls _0805A230 + b _0805A5FE + .pool +_0805A244: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x9 + b _0805A536 + .pool +_0805A260: + movs r6, 0 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r2, =0x020244ec + mov r8, r2 +_0805A26C: + adds r1, r6, 0 + adds r1, 0x11 + mov r2, r8 + adds r0, r4, r2 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + cmp r6, 0x3 + ble _0805A26C + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + b _0805A5FE + .pool +_0805A29C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x8 + b _0805A5F6 + .pool +_0805A2B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1 + b _0805A2D2 + .pool +_0805A2C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x19 +_0805A2D2: + bl pokemon_getattr + 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 _0805A5FE + .pool +_0805A2F8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1A + b _0805A5F6 + .pool +_0805A308: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1B + b _0805A5F6 + .pool +_0805A318: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1C + b _0805A5F6 + .pool +_0805A328: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1D + b _0805A5F6 + .pool +_0805A338: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1E + b _0805A5F6 + .pool +_0805A348: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1F + b _0805A5F6 + .pool +_0805A358: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x20 + b _0805A5F6 + .pool +_0805A368: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x22 + b _0805A5F6 + .pool +_0805A378: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x23 + b _0805A5F6 + .pool +_0805A388: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x24 + b _0805A5F6 + .pool +_0805A398: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x25 + b _0805A5F6 + .pool +_0805A3A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x26 + b _0805A5F6 + .pool +_0805A3B8: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_getattr + strb r0, [r7] + adds r0, r4, 0 + movs r1, 0x28 + bl pokemon_getattr + strb r0, [r7, 0x1] + adds r0, r4, 0 + movs r1, 0x29 + bl pokemon_getattr + strb r0, [r7, 0x2] + adds r0, r4, 0 + movs r1, 0x2A + bl pokemon_getattr + strb r0, [r7, 0x3] + adds r0, r4, 0 + movs r1, 0x2B + bl pokemon_getattr + strb r0, [r7, 0x4] + adds r0, r4, 0 + movs r1, 0x2C + bl pokemon_getattr + strb r0, [r7, 0x5] + movs r6, 0x6 + b _0805A5FE + .pool +_0805A408: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x27 + b _0805A5F6 + .pool +_0805A418: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x28 + b _0805A5F6 + .pool +_0805A428: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x29 + b _0805A5F6 + .pool +_0805A438: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2A + b _0805A5F6 + .pool +_0805A448: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2B + b _0805A5F6 + .pool +_0805A458: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2C + b _0805A5F6 + .pool +_0805A468: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0 + b _0805A492 + .pool +_0805A478: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x9 + b _0805A536 + .pool +_0805A488: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x37 +_0805A492: + bl pokemon_getattr + 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 _0805A5FE + .pool +_0805A4BC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x38 + b _0805A5F6 + .pool +_0805A4CC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x39 + b _0805A536 + .pool +_0805A4DC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3A + b _0805A536 + .pool +_0805A4EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3B + b _0805A536 + .pool +_0805A4FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3C + b _0805A536 + .pool +_0805A50C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3D + b _0805A536 + .pool +_0805A51C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3E + b _0805A536 + .pool +_0805A52C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3F +_0805A536: + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + strb r0, [r7] + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r6, 0x2 + b _0805A5FE + .pool +_0805A54C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x16 + b _0805A5F6 + .pool +_0805A55C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x17 + b _0805A5F6 + .pool +_0805A56C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x18 + b _0805A5F6 + .pool +_0805A57C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x21 + b _0805A5F6 + .pool +_0805A58C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2F + b _0805A5F6 + .pool +_0805A59C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x30 + b _0805A5F6 + .pool +_0805A5AC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x32 + b _0805A5F6 + .pool +_0805A5BC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x33 + b _0805A5F6 + .pool +_0805A5CC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x34 + b _0805A5F6 + .pool +_0805A5DC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x35 + b _0805A5F6 + .pool +_0805A5EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x36 +_0805A5F6: + bl pokemon_getattr + strb r0, [r7] + movs r6, 0x1 +_0805A5FE: + 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 dp01_getattr_by_ch1_for_player_pokemon_ + + thumb_func_start sub_805A614 +sub_805A614: @ 805A614 + push {r4-r7,lr} + sub sp, 0x58 + ldr r2, =0x0202406e + ldr r5, =0x02024064 + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + adds r4, r2, 0 + muls r4, r0 + ldr r3, =0x02023064 + lsls r1, 9 + adds r0, r3, 0x1 + adds r0, r1, r0 + ldrb r2, [r0] + ldr r0, =0x020244ec + adds r0, r2, r0 + adds r6, r4, r0 + mov r0, sp + adds r4, r0, r2 + movs r2, 0 + adds r0, r3, 0x2 + adds r1, r0 + adds r7, r5, 0 + mov r12, r3 + ldrb r1, [r1] + cmp r2, r1 + bcs _0805A66A + adds r3, r0, 0 +_0805A650: + adds r1, r4, r2 + adds r0, r6, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + ldrb r0, [r5] + lsls r0, 9 + adds r0, r3 + ldrb r0, [r0] + cmp r2, r0 + bcc _0805A650 +_0805A66A: + ldrb r0, [r7] + lsls r0, 9 + mov r1, r12 + adds r1, 0x2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + adds r2, r4, 0 + bl dp01_build_cmdbuf_x1D_1D_numargs_varargs + bl dp01_tbl1_exec_completed + add sp, 0x58 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805A614 + + thumb_func_start dp01t_02_1_setattr +dp01t_02_1_setattr: @ 805A69C + push {r4,r5,lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _0805A6CC + ldr r0, =0x0202406e + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + bl dp01_setattr_by_ch1_for_player_pokemon + b _0805A6EA + .pool +_0805A6CC: + ldrb r4, [r1] + movs r5, 0 +_0805A6D0: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0805A6DE + adds r0, r5, 0 + bl dp01_setattr_by_ch1_for_player_pokemon +_0805A6DE: + lsrs r4, 1 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _0805A6D0 +_0805A6EA: + bl dp01_tbl1_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end dp01t_02_1_setattr + + thumb_func_start dp01_setattr_by_ch1_for_player_pokemon +dp01_setattr_by_ch1_for_player_pokemon: @ 805A6F4 + 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, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + ldr r2, =0x02023067 + 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 _0805A720 + bl _0805B0BA +_0805A720: + lsls r0, 2 + ldr r1, =_0805A738 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0805A738: + .4byte _0805A828 + .4byte _0805A9C0 + .4byte _0805A9E0 + .4byte _0805AA00 + .4byte _0805AA58 + .4byte _0805AA58 + .4byte _0805AA58 + .4byte _0805AA58 + .4byte _0805AA80 + .4byte _0805AAE4 + .4byte _0805AAE4 + .4byte _0805AAE4 + .4byte _0805AAE4 + .4byte _0805B0BA + .4byte _0805B0BA + .4byte _0805B0BA + .4byte _0805B0BA + .4byte _0805AB14 + .4byte _0805AB34 + .4byte _0805AB54 + .4byte _0805AB74 + .4byte _0805AB94 + .4byte _0805ABB4 + .4byte _0805ABD4 + .4byte _0805ABF4 + .4byte _0805AC14 + .4byte _0805AC34 + .4byte _0805AC54 + .4byte _0805AC74 + .4byte _0805AC94 + .4byte _0805ACB4 + .4byte _0805ACD4 + .4byte _0805AD44 + .4byte _0805AD64 + .4byte _0805AD84 + .4byte _0805ADA4 + .4byte _0805ADC4 + .4byte _0805ADE4 + .4byte _0805AE04 + .4byte _0805AE24 + .4byte _0805AE44 + .4byte _0805AE64 + .4byte _0805AE84 + .4byte _0805AEA4 + .4byte _0805AEC4 + .4byte _0805AEE4 + .4byte _0805AF04 + .4byte _0805AF24 + .4byte _0805AF44 + .4byte _0805AF64 + .4byte _0805AF84 + .4byte _0805AFA4 + .4byte _0805AFC4 + .4byte _0805AFE4 + .4byte _0805B004 + .4byte _0805B024 + .4byte _0805B044 + .4byte _0805B064 + .4byte _0805B084 + .4byte _0805B0A4 +_0805A828: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + adds r2, r6, 0 + bl pokemon_setattr + adds r2, r6, 0 + adds r2, 0x2E + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + 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 +_0805A88E: + mov r1, r8 + adds r1, 0xD + mov r0, r9 + adds r2, r4, 0 + bl pokemon_setattr + mov r1, r8 + adds r1, 0x11 + mov r0, r9 + adds r2, r7, 0 + bl pokemon_setattr + adds r7, 0x1 + adds r4, 0x2 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x3 + ble _0805A88E + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + mov r2, r10 + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x20 + ldr r2, [sp, 0x20] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x19 + ldr r2, [sp, 0x28] + bl pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + adds r0, r4, 0 + movs r1, 0 + ldr r2, [sp, 0x2C] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x37 + ldr r2, [sp, 0x30] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x38 + ldr r2, [sp, 0x1C] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x39 + ldr r2, [sp, 0x18] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3A + ldr r2, [sp, 0x24] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3B + ldr r2, [sp, 0x4] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3C + ldr r2, [sp, 0x8] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3D + ldr r2, [sp, 0xC] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3E + ldr r2, [sp, 0x10] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3F + ldr r2, [sp, 0x14] + bl pokemon_setattr + b _0805B0BA + .pool +_0805A9C0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xB + bl pokemon_setattr + b _0805B0BA + .pool +_0805A9E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xC + bl pokemon_setattr + b _0805B0BA + .pool +_0805AA00: + 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, =0x020244ec + adds r7, r1, r0 + adds r6, r3, 0 + adds r6, 0x8 + adds r4, r3, 0 +_0805AA1A: + mov r1, r8 + adds r1, 0xD + adds r0, r7, 0 + adds r2, r4, 0 + bl pokemon_setattr + mov r1, r8 + adds r1, 0x11 + adds r0, r7, 0 + adds r2, r6, 0 + bl pokemon_setattr + adds r6, 0x1 + adds r4, 0x2 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x3 + ble _0805AA1A + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x15 + mov r2, r9 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AA58: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r3, =0x02023064 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x9 + b _0805AAFC + .pool +_0805AA80: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + ldr r5, =0x02024064 + ldrb r2, [r5] + lsls r2, 9 + adds r2, r7 + adds r0, r4, 0 + movs r1, 0x11 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x12 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x2 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x13 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x3 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x14 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x4 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x15 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AAE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r3, =0x02023064 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x8 +_0805AAFC: + adds r3, 0x3 + adds r2, r3 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AB14: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AB34: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x19 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AB54: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1A + bl pokemon_setattr + b _0805B0BA + .pool +_0805AB74: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1B + bl pokemon_setattr + b _0805B0BA + .pool +_0805AB94: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1C + bl pokemon_setattr + b _0805B0BA + .pool +_0805ABB4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1D + bl pokemon_setattr + b _0805B0BA + .pool +_0805ABD4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1E + bl pokemon_setattr + b _0805B0BA + .pool +_0805ABF4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1F + bl pokemon_setattr + b _0805B0BA + .pool +_0805AC14: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x20 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AC34: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x22 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AC54: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x23 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AC74: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x24 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AC94: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x25 + bl pokemon_setattr + b _0805B0BA + .pool +_0805ACB4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x26 + bl pokemon_setattr + b _0805B0BA + .pool +_0805ACD4: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + ldr r5, =0x02024064 + ldrb r2, [r5] + lsls r2, 9 + adds r2, r7 + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x28 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x2 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x29 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x3 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2A + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x4 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2B + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x5 + adds r2, r0 + adds r0, r4, 0 + b _0805ADF4 + .pool +_0805AD44: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x27 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AD64: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x28 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AD84: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x29 + bl pokemon_setattr + b _0805B0BA + .pool +_0805ADA4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2A + bl pokemon_setattr + b _0805B0BA + .pool +_0805ADC4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2B + bl pokemon_setattr + b _0805B0BA + .pool +_0805ADE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 +_0805ADF4: + movs r1, 0x2C + bl pokemon_setattr + b _0805B0BA + .pool +_0805AE04: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AE24: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x9 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AE44: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x37 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AE64: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x38 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AE84: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x39 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AEA4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3A + bl pokemon_setattr + b _0805B0BA + .pool +_0805AEC4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3B + bl pokemon_setattr + b _0805B0BA + .pool +_0805AEE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3C + bl pokemon_setattr + b _0805B0BA + .pool +_0805AF04: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3D + bl pokemon_setattr + b _0805B0BA + .pool +_0805AF24: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3E + bl pokemon_setattr + b _0805B0BA + .pool +_0805AF44: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3F + bl pokemon_setattr + b _0805B0BA + .pool +_0805AF64: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x16 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AF84: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x17 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AFA4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x18 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AFC4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x21 + bl pokemon_setattr + b _0805B0BA + .pool +_0805AFE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2F + bl pokemon_setattr + b _0805B0BA + .pool +_0805B004: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x30 + bl pokemon_setattr + b _0805B0BA + .pool +_0805B024: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x32 + bl pokemon_setattr + b _0805B0BA + .pool +_0805B044: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x33 + bl pokemon_setattr + b _0805B0BA + .pool +_0805B064: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x34 + bl pokemon_setattr + b _0805B0BA + .pool +_0805B084: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x35 + bl pokemon_setattr + b _0805B0BA + .pool +_0805B0A4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x36 + bl pokemon_setattr +_0805B0BA: + ldr r2, =0x0202406e + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + 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 dp01_setattr_by_ch1_for_player_pokemon + + thumb_func_start sub_805B0F0 +sub_805B0F0: @ 805B0F0 + push {r4-r7,lr} + ldr r1, =0x0202406e + ldr r7, =0x02024064 + 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, =0x02023064 + lsls r2, 9 + adds r0, r4, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + ldr r1, =0x020244ec + adds r0, r1 + adds r5, r3, r0 + movs r3, 0 + adds r0, r4, 0x2 + adds r2, r0 + ldrb r2, [r2] + cmp r3, r2 + bcs _0805B148 + adds r6, r4, 0 + adds r2, r7, 0 + adds r4, r0, 0 +_0805B126: + 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 _0805B126 +_0805B148: + bl dp01_tbl1_exec_completed + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805B0F0 + + thumb_func_start sub_805B164 +sub_805B164: @ 805B164 + push {r4,lr} + ldr r2, =0x0202406e + ldr r4, =0x02024064 + ldrb r1, [r4] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + adds r0, r2 + bl sub_805DD7C + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + ldrb r3, [r4] + adds r0, r3, r0 + ldrb r0, [r0] + 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] + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_0802E404 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805B164 + + thumb_func_start sub_805B1CC +sub_805B1CC: @ 805B1CC + push {r4-r6,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + ldr r4, =0x02023064 + lsls r1, r0, 9 + adds r6, r4, 0x2 + adds r1, r6 + ldrb r1, [r1] + bl sub_805EF84 + ldr r2, =0x0202406e + ldrb r0, [r5] + lsls r1, r0, 1 + adds r1, r2 + lsls r0, 9 + adds r4, 0x1 + adds r0, r4 + ldrb r0, [r0] + movs r4, 0 + strh r0, [r1] + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + adds r0, r2 + bl sub_805DD7C + ldr r1, =0x020244ac + ldrb r0, [r5] + adds r0, r1 + strb r4, [r0] + ldr r1, =0x020244b0 + ldrb r0, [r5] + adds r0, r1 + strb r4, [r0] + ldrb r0, [r5] + lsls r1, r0, 9 + adds r1, r6 + ldrb r1, [r1] + bl sub_805B258 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805902C + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805B1CC + + thumb_func_start sub_805B258 +sub_805B258: @ 805B258 + 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, =0x0202406e + lsls r2, r6, 1 + adds r2, r0 + ldr r0, =0x02023064 + 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, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, =sub_805D714 + bl object_new_hidden_with_callback + ldr r1, =0x03005d7c + mov r9, r1 + add r9, r6 + mov r1, r9 + strb r0, [r1] + adds r0, r6, 0 + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl sub_806A068 + ldr r0, =0x0202499c + 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 AddObjectToFront + ldr r4, =0x020241e4 + adds r4, r6, r4 + strb r0, [r4] + ldr r5, =0x02020630 + 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, =0x020244e4 + adds r6, r1 + ldrb r1, [r6] + bl StartObjectImageAnim + 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, =DummyObjectCallback + 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_805B258 + + thumb_func_start sub_805B3D4 +sub_805B3D4: @ 805B3D4 + push {r4-r6,lr} + ldr r1, =0x02023064 + ldr r6, =0x02024064 + ldrb r2, [r6] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r3, [r0] + cmp r3, 0 + bne _0805B41C + ldr r0, =0x020244d0 + 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, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805B464 + str r1, [r0] + b _0805B452 + .pool +_0805B41C: + ldr r5, =0x020241e4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r1, =0x03005d70 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl1_exec_completed +_0805B452: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805B3D4 + + thumb_func_start sub_805B464 +sub_805B464: @ 805B464 + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r4, [r6] + ldr r5, =0x02024064 + 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 _0805B48C + cmp r0, 0x1 + beq _0805B4BA + b _0805B4E2 + .pool +_0805B48C: + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0805B4A6 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_0805B4A6: + 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 _0805B4E2 +_0805B4BA: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0805B4E2 + 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, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8059744 + str r1, [r0] +_0805B4E2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805B464 + + thumb_func_start sub_805B4F0 +sub_805B4F0: @ 805B4F0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0805B5B4 + bl link_get_multiplayer_id + ldr r5, =0x020229e8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + movs r4, 0xFF + ldrb r0, [r1] + cmp r0, 0x4 + beq _0805B538 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrh r1, [r1] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x5 + bne _0805B558 +_0805B538: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x13] + adds r4, r0, 0x2 + b _0805B5BA + .pool +_0805B558: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrh r1, [r1] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x2 + beq _0805B58A + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrh r0, [r1] + ands r4, r0 + cmp r4, 0x1 + bne _0805B5A0 +_0805B58A: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x13] + adds r4, r0, 0x4 + b _0805B5BA +_0805B5A0: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r4, [r1, 0x13] + b _0805B5BA +_0805B5B4: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r4, [r0, 0x8] +_0805B5BA: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r2, 0x40 + ands r1, r2 + adds r5, r0, 0 + cmp r1, 0 + beq _0805B63C + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_get_per_side_status + movs r1, 0x2 + ands r1, r0 + movs r0, 0x20 + mov r9, r0 + cmp r1, 0 + beq _0805B5E0 + movs r1, 0x5A + mov r9, r1 +_0805B5E0: + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _0805B618 + ldr r0, =0x02038bce + ldrh r1, [r0] + ldr r0, =0x00000c03 + cmp r1, r0 + beq _0805B618 + movs r0, 0x5A + mov r9, r0 + ldr r1, =gUnknown_083054E0 + b _0805B642 + .pool +_0805B618: + ldr r1, =gUnknown_08305D2C + 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 r5, =0x02022fec + b _0805B656 + .pool +_0805B63C: + movs r0, 0x50 + mov r9, r0 + ldr r1, =gUnknown_08305D2C +_0805B642: + 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 +_0805B656: + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + bne _0805B664 + b _0805B794 +_0805B664: + ldr r0, =0x02038bce + ldrh r1, [r0] + ldr r0, =0x00000c03 + cmp r1, r0 + bne _0805B670 + b _0805B794 +_0805B670: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + bl sub_806F000 + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + ldr r6, =0x02024064 + ldrb r1, [r6] + adds r0, r5, 0 + bl sub_805DF38 + ldrb r0, [r6] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_806A1C0 + ldr r0, =0x0202499c + 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 AddObjectToFront + ldr r4, =0x020241e4 + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r0, =gTrainerFrontPicPaletteTable + lsls r5, 3 + adds r5, r0 + ldrh r0, [r5, 0x4] + bl IndexOfObjectPaletteTag + ldr r5, =0x02020630 + 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 _0805B82A + .pool +_0805B794: + ldr r5, =0x02024064 + ldrb r1, [r5] + adds r0, r4, 0 + bl sub_805DF84 + ldrb r0, [r5] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl template_build_for_pokemon_or_trainer + ldr r6, =0x0202499c + 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 AddObjectToFront + ldr r6, =0x020241e4 + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, =0x02020630 + 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] +_0805B82A: + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8058844 + str r1, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805B4F0 + + thumb_func_start dp01t_08_1_8032428 +dp01t_08_1_8032428: @ 805B864 + push {r4-r6,lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0805B920 + bl link_get_multiplayer_id + ldr r5, =0x020229e8 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + movs r4, 0xFF + ldrb r0, [r1] + cmp r0, 0x4 + beq _0805B8A6 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrh r1, [r1] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x5 + bne _0805B8C4 +_0805B8A6: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x13] + adds r4, r0, 0x2 + b _0805B926 + .pool +_0805B8C4: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrh r1, [r1] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x2 + beq _0805B8F6 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrh r0, [r1] + ands r4, r0 + cmp r4, 0x1 + bne _0805B90C +_0805B8F6: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x13] + adds r4, r0, 0x4 + b _0805B926 +_0805B90C: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r4, [r1, 0x13] + b _0805B926 +_0805B920: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r4, [r0, 0x8] +_0805B926: + ldr r5, =0x02024064 + ldrb r1, [r5] + adds r0, r4, 0 + bl sub_805DF84 + ldrb r0, [r5] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl template_build_for_pokemon_or_trainer + ldr r0, =0x0202499c + ldr r1, =gUnknown_08305D2C + lsls r4, 2 + adds r4, r1 + ldrb r1, [r4] + movs r2, 0x8 + subs r2, r1 + lsls r2, 18 + movs r1, 0xA0 + lsls r1, 15 + adds r2, r1 + asrs r2, 16 + movs r1, 0x50 + movs r3, 0x1E + bl AddObjectToFront + ldr r6, =0x020241e4 + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, =0x02020630 + 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 + ldr r1, =0x0000ffa0 + 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] + 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, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805887C + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_08_1_8032428 + + thumb_func_start sub_805B9F8 +sub_805B9F8: @ 805B9F8 + push {r4-r6,lr} + ldr r5, =0x020241e4 + ldr r6, =0x02024064 + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + 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 r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =DummyObjectCallback + 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 StartObjectImageAnim + ldr r1, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_802F7A0 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805B9F8 + + thumb_func_start sub_805BAB8 +sub_805BAB8: @ 805BAB8 + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r4, [r6] + ldr r5, =0x02024064 + 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 _0805BB0C + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0805BAEC + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_0805BAEC: + 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 _0805BB82 + .pool +_0805BB0C: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0805BB82 + strb r4, [r3, 0x4] + ldr r2, =0x0202406e + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + adds r0, r2 + bl sub_805E990 + movs r1, 0x40 + negs r1, r1 + movs r0, 0x10 + bl audio_play_and_stuff + ldr r2, =0x02020630 + ldr r3, =0x020241e4 + 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, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80596A8 + str r1, [r0] +_0805BB82: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805BAB8 + + thumb_func_start sub_805BBA4 +sub_805BBA4: @ 805BBA4 + push {lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r1, 0x2 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + bl dp01_tbl1_exec_completed + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_805BBA4 + + thumb_func_start sub_805BBC4 +sub_805BBC4: @ 805BBC4 + push {r4,r5,lr} + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0x8] + movs r0, 0x4 + strb r0, [r1, 0x8] + ldr r1, =0x020244b9 + movs r0, 0x1 + strb r0, [r1] + ldr r5, =0x02024064 + ldrb r4, [r5] + movs r0, 0x1 + bl battle_get_side_with_given_state + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r4, 0 + movs r3, 0x3 + bl move_anim_start_t4 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_wait_t1 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805BBC4 + + thumb_func_start sub_805BC18 +sub_805BC18: @ 805BC18 + push {r4,r5,lr} + ldr r1, =0x02023064 + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r1, [r0] + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + strb r1, [r0, 0x8] + ldr r1, =0x020244b9 + movs r0, 0x1 + strb r0, [r1] + ldrb r4, [r5] + movs r0, 0x1 + bl battle_get_side_with_given_state + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r4, 0 + movs r3, 0x3 + bl move_anim_start_t4 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_wait_t1 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805BC18 + + thumb_func_start sub_805BC78 +sub_805BC78: @ 805BC78 + push {lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0805BC96 +_0805BC8C: + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0805BC8C +_0805BC96: + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_805BC78 + + thumb_func_start dp01t_0F_1_move_anim +dp01t_0F_1_move_anim: @ 805BCA8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r5, =0x02024064 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + beq _0805BCBE + b _0805BDE4 +_0805BCBE: + ldr r0, =0x02023064 + mov r12, r0 + ldrb r1, [r5] + lsls r1, 9 + adds r0, 0x1 + adds r0, r1, r0 + ldrb r6, [r0] + mov r0, r12 + adds r0, 0x2 + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 8 + orrs r6, r0 + ldr r0, =0x02038432 + mov r8, r0 + mov r0, r12 + adds r0, 0x3 + adds r1, r0 + ldrb r0, [r1] + mov r1, r8 + strb r0, [r1] + ldr r3, =0x02038408 + ldrb r1, [r5] + lsls r1, 9 + mov r0, r12 + adds r0, 0x4 + adds r0, r1, r0 + ldrb r2, [r0] + mov r0, r12 + adds r0, 0x5 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 8 + orrs r2, r0 + strh r2, [r3] + ldr r3, =0x02038404 + ldrb r1, [r5] + lsls r1, 9 + mov r0, r12 + adds r0, 0x6 + adds r0, r1, r0 + ldrb r2, [r0] + mov r0, r12 + adds r0, 0x7 + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 8 + orrs r2, r0 + mov r0, r12 + adds r0, 0x8 + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 16 + orrs r2, r0 + mov r0, r12 + adds r0, 0x9 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 24 + orrs r2, r0 + str r2, [r3] + ldr r2, =0x0203841a + ldrb r0, [r5] + lsls r0, 9 + mov r1, r12 + adds r1, 0xA + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r4, =0x0203841c + ldrb r1, [r5] + lsls r1, 9 + mov r0, r12 + adds r0, 0xC + adds r0, r1, r0 + ldrb r2, [r0] + mov r0, r12 + adds r0, 0xD + adds r1, r0 + ldrb r0, [r1] + lsls r0, 8 + orrs r2, r0 + strh r2, [r4] + ldr r7, =0x02038400 + ldrb r1, [r5] + lsls r1, 9 + mov r0, r12 + adds r0, 0x10 + adds r1, r0 + str r1, [r7] + ldr r2, =0x020244bc + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldr r1, [r1] + str r1, [r0] + mov r0, r8 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_805DB8C + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _0805BDBC + bl dp01_tbl1_exec_completed + b _0805BDE4 + .pool +_0805BDBC: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r3, [r0, 0x4] + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_move_anim_1 + str r1, [r0] + ldrh r1, [r4] + ldr r2, [r7] + adds r0, r6, 0 + bl sub_817E0FC +_0805BDE4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_0F_1_move_anim + + thumb_func_start bx_move_anim_1 +bx_move_anim_1: @ 805BDFC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r2, =0x02023064 + ldr r6, =0x02024064 + 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, =0x020244d0 + 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 _0805BE94 + cmp r2, 0x1 + bgt _0805BE54 + cmp r2, 0 + beq _0805BE5E + b _0805BF70 + .pool +_0805BE54: + cmp r2, 0x2 + beq _0805BEBE + cmp r2, 0x3 + beq _0805BF34 + b _0805BF70 +_0805BE5E: + ldr r1, [r5] + lsls r0, r3, 2 + adds r1, r0, r1 + ldrb r2, [r1] + movs r0, 0xC + ands r0, r2 + cmp r0, 0x4 + bne _0805BE80 + 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 +_0805BE80: + 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 _0805BF70 +_0805BE94: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0805BF70 + 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 _0805BF70 +_0805BEBE: + ldr r0, =0x020383f8 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =0x020383fd + ldrb r0, [r0] + cmp r0, 0 + bne _0805BF70 + 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 _0805BF0C + mov r0, r8 + cmp r0, 0x1 + bhi _0805BF0C + 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] +_0805BF0C: + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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 _0805BF70 + .pool +_0805BF34: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0805BF70 + 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 dp01_tbl1_exec_completed +_0805BF70: + 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_1 + + thumb_func_start sub_805BF80 +sub_805BF80: @ 805BF80 + push {r4,r5,lr} + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r5, =0x02024064 + ldrb r4, [r5] + lsls r4, 9 + ldr r0, =0x02023066 + adds r4, r0 + ldrh r0, [r4] + bl battle_pick_message + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80597B4 + str r1, [r0] + ldrh r0, [r4] + bl sub_817C95C + ldrb r0, [r5] + ldrh r1, [r4] + bl sub_81A57E4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805BF80 + + thumb_func_start dp01t_11_1_message_for_player_only +dp01t_11_1_message_for_player_only: @ 805BFE0 + push {lr} + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0805BFFC + bl sub_805BF80 + b _0805C000 + .pool +_0805BFFC: + bl dp01_tbl1_exec_completed +_0805C000: + pop {r0} + bx r0 + thumb_func_end dp01t_11_1_message_for_player_only + + thumb_func_start sub_805C004 +sub_805C004: @ 805C004 + push {lr} + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0805C02A + ldr r0, =0x02022e14 + strh r1, [r0] + ldr r1, =0x02022e16 + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8057588 + str r1, [r0] +_0805C02A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C004 + + thumb_func_start dp01t_12_6_battle_menu +dp01t_12_6_battle_menu: @ 805C044 + push {r4,lr} + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805C004 + str r1, [r0] + bl sub_817F2A8 + ldr r0, =gUnknown_085CCA3A + movs r1, 0x2 + bl battle_show_message_maybe + movs r4, 0 +_0805C062: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8059CF8 + adds r4, 0x1 + cmp r4, 0x3 + ble _0805C062 + ldr r1, =0x020244ac + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_8059CB4 + ldr r0, =gUnknown_085CC9F3 + bl get_battle_strings_ + ldr r0, =0x02022e2c + movs r1, 0x1 + bl battle_show_message_maybe + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_12_6_battle_menu + + thumb_func_start sub_805C0B0 +sub_805C0B0: @ 805C0B0 + push {r4,lr} + sub sp, 0x4 + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0805C108 + str r0, [sp] + movs r0, 0x18 + movs r1, 0x8 + movs r2, 0x1D + movs r3, 0xD + bl sub_8056A3C + ldr r0, =gUnknown_085CCABB + movs r1, 0xC + bl battle_show_message_maybe + ldr r1, =0x03005d74 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x1 + bl sub_8056B74 + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80599D4 + str r1, [r0] + b _0805C10C + .pool +_0805C108: + bl dp01_tbl1_exec_completed +_0805C10C: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_805C0B0 + + thumb_func_start sub_805C114 +sub_805C114: @ 805C114 + push {lr} + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0805C13E + ldr r0, =0x02022e14 + strh r1, [r0] + ldr r1, =0x02022e16 + movs r2, 0xA0 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8057BFC + str r1, [r0] +_0805C13E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C114 + + thumb_func_start sub_805C158 +sub_805C158: @ 805C158 + push {lr} + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r1, r0 + movs r0, 0xA6 + lsls r0, 2 + adds r1, r0 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _0805C194 + ldr r1, =0x0203bd30 + ldr r0, =0x03005d80 + ldr r0, [r0] + str r0, [r1] + 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 + bl dp01_tbl1_exec_completed +_0805C194: + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C158 + + thumb_func_start dp01t_14_5_move_menu_pokedude +dp01t_14_5_move_menu_pokedude: @ 805C1A8 + push {lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0805C1EC + ldr r2, =0x02024064 + ldrb r0, [r2] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + movs r1, 0xA6 + lsls r1, 2 + adds r0, r1 + movs r1, 0x8 + strb r1, [r0] + ldr r1, =0x03005d60 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805C158 + b _0805C1FC + .pool +_0805C1EC: + bl sub_805C210 + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805C114 +_0805C1FC: + str r1, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_14_5_move_menu_pokedude + + thumb_func_start sub_805C210 +sub_805C210: @ 805C210 + push {lr} + bl sub_8059AAC + ldr r1, =0x03005d74 + movs r0, 0xFF + strb r0, [r1] + ldr r1, =0x020244b0 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl battle_menu_cursor_related_2 + bl sub_8059B18 + bl sub_8059B3C + bl sub_8059BB0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C210 + + thumb_func_start sub_805C248 +sub_805C248: @ 805C248 + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x03005d60 + ldr r2, =0x02024064 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80598A4 + str r1, [r0] + ldr r1, =0x020244b8 + ldrb r0, [r2] + strb r0, [r1] + movs r3, 0 + ldr r5, =0x0203cf00 + ldr r4, =0x02023064 +_0805C276: + adds r0, r3, r5 + ldrb r1, [r2] + lsls r1, 9 + adds r1, 0x1 + adds r1, r3, r1 + adds r1, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r3, 0x1 + cmp r3, 0x2 + ble _0805C276 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C248 + + thumb_func_start sub_805C2AC +sub_805C2AC: @ 805C2AC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + movs r3, 0 + ldr r0, =0x0203cf00 + mov r12, r0 + ldr r1, =0x02023064 + mov r8, r1 + ldr r2, =0x02024064 + ldr r7, =0x02022fec + mov r6, r12 + mov r5, r8 + adds r4, r2, 0 +_0805C2C8: + adds r0, r3, r6 + ldrb r1, [r4] + lsls r1, 9 + adds r1, 0x4 + adds r1, r3, r1 + adds r1, r5 + ldrb r1, [r1] + strb r1, [r0] + adds r3, 0x1 + cmp r3, 0x2 + ble _0805C2C8 + ldr r0, [r7] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _0805C330 + ldrb r3, [r2] + lsls r0, r3, 9 + mov r1, r8 + adds r1, 0x1 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x2 + beq _0805C330 + ldr r1, =0x0202406e + lsls r0, r3, 1 + adds r0, r1 + ldrb r1, [r0] + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1 + mov r2, r12 + bl dp01_build_cmdbuf_x22_a_three_bytes + bl dp01_tbl1_exec_completed + b _0805C3BC + .pool +_0805C330: + ldr r0, =TaskDummy + movs r1, 0xFF + bl CreateTask + ldr r3, =0x03005d7c + ldr r4, =0x02024064 + ldrb r1, [r4] + adds r1, r3 + movs r2, 0 + mov r8, r2 + strb r0, [r1] + ldr r5, =0x03005e00 + ldrb r2, [r4] + adds r3, r2, r3 + ldrb r0, [r3] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + ldr r5, =0x02023064 + lsls r2, 9 + adds r6, r5, 0x1 + adds r2, r6 + ldrb r2, [r2] + movs r0, 0xF + ands r0, r2 + strh r0, [r1, 0x8] + ldr r3, =0x0202449c + ldr r1, [r3] + adds r1, 0x49 + ldrb r0, [r4] + lsls r0, 9 + adds r0, r6 + ldrb r0, [r0] + lsrs r0, 4 + strb r0, [r1] + ldr r2, [r3] + adds r2, 0x8B + ldrb r0, [r4] + lsls r0, 9 + adds r1, r5, 0x2 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r1, [r3] + adds r1, 0xB0 + ldrb r0, [r4] + lsls r0, 9 + adds r5, 0x3 + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + movs r0, 0x1 + negs r0, r0 + mov r1, r8 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80597CC + str r1, [r0] + ldr r1, =0x020244b8 + ldrb r0, [r4] + strb r0, [r1] +_0805C3BC: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C2AC + + thumb_func_start sub_805C3EC +sub_805C3EC: @ 805C3EC + push {lr} + sub sp, 0x4 + bl sub_805EA60 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r1, 0x2 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + bl dp01_tbl1_exec_completed + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_805C3EC + + thumb_func_start sub_805C410 +sub_805C410: @ 805C410 + 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, =0x02023064 + ldr r0, =0x02024064 + mov r9, r0 + ldrb r1, [r0] + lsls r1, 9 + adds r0, r3, 0x2 + adds r0, r1, r0 + ldrb r2, [r0] + adds r3, 0x3 + adds r1, r3 + ldrb r0, [r1] + lsls r0, 8 + orrs r2, r0 + lsls r2, 16 + asrs r7, r2, 16 + cmp r7, 0 + ble _0805C44A + ldr r1, =0x0203cd70 + ldr r0, [r1] + adds r0, r7 + str r0, [r1] +_0805C44A: + ldr r0, =0x00007fff + cmp r7, r0 + beq _0805C4B4 + ldr r6, =0x0202406e + mov r1, r9 + ldrb r0, [r1] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + movs r1, 0x3A + bl pokemon_getattr + mov r8, r0 + mov r2, r9 + ldrb r0, [r2] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + adds r0, r4 + movs r1, 0x39 + bl pokemon_getattr + adds r3, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, =0x03005d70 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + mov r2, r8 + bl sub_807294C + b _0805C4F2 + .pool +_0805C4B4: + ldr r1, =0x0202406e + mov r2, r9 + ldrb r0, [r2] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3A + bl pokemon_getattr + adds r2, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r4, =0x03005d70 + adds r1, r0, r4 + ldrb r1, [r1] + str r7, [sp] + movs r3, 0 + bl sub_807294C + mov r2, r9 + ldrb r0, [r2] + adds r0, r4 + ldrb r0, [r0] + movs r1, 0 + movs r2, 0 + bl heathbar_draw_hp +_0805C4F2: + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_t1_healthbar_update + 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_805C410 + + thumb_func_start sub_805C528 +sub_805C528: @ 805C528 + push {r4-r7,lr} + ldr r5, =0x02023064 + ldr r6, =0x02024064 + ldrb r0, [r6] + lsls r0, 9 + adds r1, r5, 0x1 + adds r0, r1 + ldrb r7, [r0] + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + cmp r0, 0x63 + bls _0805C560 + bl dp01_tbl1_exec_completed + b _0805C5AC + .pool +_0805C560: + movs r0, 0x1 + bl load_gfxc_health_bar + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + ldrb r1, [r6] + lsls r1, 9 + adds r0, r5, 0x2 + adds r0, r1, r0 + ldrb r4, [r0] + adds r0, r5, 0x3 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 8 + orrs r4, r0 + ldr r0, =sub_80591B8 + movs r1, 0xA + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r7, [r1, 0x8] + strh r4, [r1, 0xA] + ldrb r0, [r6] + strh r0, [r1, 0xC] + ldr r1, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =nullsub_21 + str r1, [r0] +_0805C5AC: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C528 + + thumb_func_start sub_805C5C4 +sub_805C5C4: @ 805C5C4 + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0805C618 + ldr r0, =0x03005d70 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0x9 + bl healthbar_draw_field_maybe + ldrb r2, [r4] + ldr r0, =0x020244d0 + 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, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8059D60 + str r1, [r0] +_0805C618: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C5C4 + + thumb_func_start sub_805C63C +sub_805C63C: @ 805C63C + push {r4,r5,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0805C68C + ldr r4, =0x02023064 + 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, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8059D60 + str r1, [r0] +_0805C68C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C63C + + thumb_func_start sub_805C6A4 +sub_805C6A4: @ 805C6A4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + ldr r0, =0x0202406e + mov r8, r0 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + movs r1, 0x37 + bl pokemon_getattr + ldr r2, =0x02023064 + ldrb r1, [r4] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + eors r0, r1 + mov r1, sp + strb r0, [r1] + ldrb r0, [r4] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0x37 + mov r2, sp + bl pokemon_setattr + bl dp01_tbl1_exec_completed + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C6A4 + + thumb_func_start sub_805C710 +sub_805C710: @ 805C710 + push {lr} + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_805C710 + + thumb_func_start sub_805C71C +sub_805C71C: @ 805C71C + push {r4,r5,lr} + ldr r3, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r2, 9 + adds r0, r3, 0x1 + adds r0, r2, r0 + ldrb r5, [r0] + adds r0, r3, 0x2 + adds r0, r2, r0 + ldrb r0, [r0] + lsls r0, 8 + orrs r5, r0 + adds r0, r3, 0x3 + adds r0, r2, r0 + ldrb r0, [r0] + lsls r0, 16 + orrs r5, r0 + adds r0, r3, 0x4 + adds r0, r2, r0 + ldrb r4, [r0] + lsls r4, 24 + adds r0, r3, 0x5 + adds r0, r2, r0 + ldrb r1, [r0] + adds r0, r3, 0x6 + adds r0, r2, r0 + ldrb r0, [r0] + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + adds r3, 0x7 + adds r2, r3 + orrs r5, r4 + lsrs r4, r1, 16 + movs r0, 0x80 + lsls r0, 5 + cmp r4, r0 + bhi _0805C78C + ldr r0, =0x040000d4 + str r2, [r0] + str r5, [r0, 0x4] + lsrs r1, 17 + movs r2, 0x80 + lsls r2, 24 + orrs r1, r2 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + b _0805C7B8 + .pool +_0805C78C: + ldr r3, =0x040000d4 + str r2, [r3] + str r5, [r3, 0x4] + ldr r0, =0x80000800 + str r0, [r3, 0x8] + ldr r0, [r3, 0x8] + movs r0, 0x80 + lsls r0, 5 + adds r2, r0 + adds r5, r0 + ldr r1, =0xfffff000 + adds r4, r1 + cmp r4, r0 + bhi _0805C78C + str r2, [r3] + str r5, [r3, 0x4] + lsrs r0, r4, 1 + movs r1, 0x80 + lsls r1, 24 + orrs r0, r1 + str r0, [r3, 0x8] + ldr r0, [r3, 0x8] +_0805C7B8: + bl dp01_tbl1_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C71C + + thumb_func_start sub_805C7D0 +sub_805C7D0: @ 805C7D0 + push {lr} + ldr r2, =0x02023064 + ldr r0, =0x02024064 + ldrb r1, [r0] + 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 + bl song_play_for_text + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C7D0 + + thumb_func_start sub_805C800 +sub_805C800: @ 805C800 + push {lr} + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_805C800 + + thumb_func_start sub_805C80C +sub_805C80C: @ 805C80C + push {lr} + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_805C80C + + thumb_func_start sub_805C820 +sub_805C820: @ 805C820 + push {lr} + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl dp01_build_cmdbuf_x22_a_three_bytes + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_805C820 + + thumb_func_start sub_805C834 +sub_805C834: @ 805C834 + push {lr} + movs r0, 0x1 + movs r1, 0 + bl dp01_build_cmdbuf_x23_aa_0 + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_805C834 + + thumb_func_start sub_805C848 +sub_805C848: @ 805C848 + push {lr} + movs r0, 0x1 + movs r1, 0 + bl dp01_build_cmdbuf_x24_aa_0 + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_805C848 + + thumb_func_start sub_805C85C +sub_805C85C: @ 805C85C + push {lr} + ldr r2, =0x02022d0c + ldrb r1, [r2] + movs r0, 0x80 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C85C + + thumb_func_start sub_805C878 +sub_805C878: @ 805C878 + push {lr} + ldr r3, =0x02022d0c + ldr r1, =0x02023064 + ldr r0, =0x02024064 + 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 dp01_tbl1_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C878 + + thumb_func_start sub_805C8B0 +sub_805C8B0: @ 805C8B0 + push {lr} + ldr r2, =0x02022d0c + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C8B0 + + thumb_func_start sub_805C8C8 +sub_805C8C8: @ 805C8C8 + push {lr} + ldr r3, =0x02022d0c + 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 dp01_tbl1_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C8C8 + + thumb_func_start dp01t_29_1_blink +dp01t_29_1_blink: @ 805C8F0 + push {r4,lr} + ldr r3, =0x02020630 + ldr r2, =0x020241e4 + ldr r4, =0x02024064 + 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 _0805C924 + bl dp01_tbl1_exec_completed + b _0805C94E + .pool +_0805C924: + ldr r1, =0x020244b9 + 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, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_blink_t1 + str r1, [r0] +_0805C94E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_29_1_blink + + thumb_func_start sub_805C960 +sub_805C960: @ 805C960 + push {lr} + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_805C960 + + thumb_func_start sub_805C96C +sub_805C96C: @ 805C96C + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + movs r3, 0x3F + cmp r0, 0 + bne _0805C980 + movs r3, 0xC0 +_0805C980: + ldr r2, =0x02023064 + 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 audio_play_and_stuff + bl dp01_tbl1_exec_completed + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805C96C + + thumb_func_start sub_805C9B0 +sub_805C9B0: @ 805C9B0 + push {r4,r5,lr} + ldr r4, =0x02023064 + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r3, r0, 9 + adds r0, r4, 0x3 + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _0805C9EC + 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 song_play_for_text + b _0805CA00 + .pool +_0805C9EC: + 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 fanfare_play +_0805CA00: + bl dp01_tbl1_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_805C9B0 + + thumb_func_start sub_805CA0C +sub_805CA0C: @ 805CA0C + push {lr} + ldr r1, =0x0202406e + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x19 + negs r1, r1 + movs r2, 0x5 + bl sub_80A32E4 + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_805CA0C + + thumb_func_start dp01t_2E_1_battle_intro +dp01t_2E_1_battle_intro: @ 805CA4C + push {lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, =0x020243fc + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_2E_1_battle_intro + + thumb_func_start dp01t_2F_1_pokemon_enter +dp01t_2F_1_pokemon_enter: @ 805CA80 + push {r4-r7,lr} + ldr r6, =0x020241e4 + ldr r7, =0x02024064 + ldrb r0, [r7] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =0x02020630 + adds r0, r5 + bl oamt_add_pos2_onto_pos1 + ldrb r0, [r7] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x32 + strh r1, [r0, 0x2E] + ldrb r0, [r7] + 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, [r7] + 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, [r7] + 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 r2, [r7] + adds r0, r2, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x38] + ldrb r0, [r7] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =sub_805CC00 + bl oamt_set_x3A_32 + ldrb r0, [r7] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x1 + bl StartObjectImageAnim + ldr r0, =0x0000d6f8 + bl AllocObjectPalette + adds r4, r0, 0 + lsls r4, 24 + ldr r1, =gTrainerBackPicPaletteTable + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 3 + adds r0, r1 + ldr r0, [r0] + lsrs r4, 20 + movs r2, 0x80 + lsls r2, 1 + adds r1, r4, r2 + movs r2, 0x20 + bl decompress_palette + ldrb r0, [r7] + adds r0, r6 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r4 + strb r0, [r1, 0x5] + ldr r0, =task05_08033660 + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + ldrb r0, [r7] + strh r0, [r1, 0x8] + ldr r3, =0x020244d0 + ldr r0, [r3] + ldrb r2, [r7] + 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 _0805CBA2 + ldr r0, =0x020244b4 + 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] +_0805CBA2: + ldr r0, [r3] + ldr r2, [r0, 0x8] + ldrb r0, [r2, 0x9] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] + ldr r1, =0x03005d60 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, =nullsub_21 + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_2F_1_pokemon_enter + + thumb_func_start sub_805CC00 +sub_805CC00: @ 805CC00 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r4, [r5, 0x38] + lsls r4, 24 + lsrs r4, 24 + bl obj_free_rotscale_entry + ldrb r0, [r5, 0x5] + lsrs r0, 4 + bl GetObjectPaletteTagBySlot + lsls r0, 16 + lsrs r0, 16 + bl FreeObjectPaletteByTag + adds r0, r5, 0 + bl RemoveObjectAndFreeTiles + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + adds r1, r4, 0 + bl sub_805DD7C + ldr r0, =0x020241e4 + adds r4, r0 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0 + bl StartObjectImageAnim + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805CC00 + + thumb_func_start task05_08033660 +task05_08033660: @ 805CC68 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =0x03005e00 + 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, 0x1E + bgt _0805CC94 + adds r0, r2, 0x1 + strh r0, [r1, 0xA] + b _0805CD50 + .pool +_0805CC94: + ldr r7, =0x02024064 + 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 _0805CCB4 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0805CCE4 +_0805CCB4: + ldr r0, =0x02023064 + ldrb r1, [r7] + lsls r2, r1, 9 + adds r0, 0x1 + adds r2, r0 + ldr r0, =0x0202406e + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + strb r0, [r2] + ldrb r0, [r7] + movs r1, 0 + bl sub_805B258 + b _0805CD38 + .pool +_0805CCE4: + ldr r4, =0x02023064 + ldrb r0, [r7] + lsls r1, r0, 9 + adds r4, 0x1 + adds r1, r4 + ldr r5, =0x0202406e + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + movs r1, 0 + bl sub_805B258 + 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, =0x020244ec + adds r0, r2 + bl sub_805DD7C + ldrb r0, [r7] + movs r1, 0 + bl sub_805B258 + ldrb r0, [r7] + eors r0, r6 + strb r0, [r7] +_0805CD38: + ldr r1, =0x03005d60 + ldr r2, =0x02024064 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8058B40 + str r1, [r0] + mov r3, r9 + strb r3, [r2] + mov r0, r8 + bl DestroyTask +_0805CD50: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end task05_08033660 + + thumb_func_start sub_805CD74 +sub_805CD74: @ 805CD74 + push {r4-r6,lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0805CDA4 + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0805CDA4 + bl dp01_tbl1_exec_completed + b _0805CE18 + .pool +_0805CDA4: + ldr r6, =0x020244d0 + ldr r0, [r6] + ldr r5, =0x02024064 + 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, =0x02023068 + 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, =0x020244b4 + 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 _0805CE0C + 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] +_0805CE0C: + ldr r0, =0x03005d60 + ldrb r1, [r5] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_805CE38 + str r0, [r1] +_0805CE18: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805CD74 + + thumb_func_start sub_805CE38 +sub_805CE38: @ 805CE38 + push {r4,lr} + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r3, =0x02024064 + 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 _0805CE70 + 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 dp01_tbl1_exec_completed +_0805CE70: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805CE38 + + thumb_func_start sub_805CE80 +sub_805CE80: @ 805CE80 + push {lr} + ldr r0, =0x020244d0 + ldr r1, [r0] + ldr r0, =0x02024064 + 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 _0805CEB2 + ldr r2, =0x03005e00 + ldr r0, =0x020244b4 + 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] +_0805CEB2: + bl dp01_tbl1_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_805CE80 + + thumb_func_start sub_805CED0 +sub_805CED0: @ 805CED0 + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + movs r1, 0x1 + bl dp11b_obj_free + ldrb r0, [r4] + movs r1, 0 + bl dp11b_obj_free + bl dp01_tbl1_exec_completed + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805CED0 + + thumb_func_start dp01t_33_1_enemy_move +dp01t_33_1_enemy_move: @ 805CEF4 + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _0805CF3A + ldr r3, =0x02020630 + ldr r0, =0x020241e4 + 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, =0x02023064 + 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 +_0805CF3A: + bl dp01_tbl1_exec_completed + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_33_1_enemy_move + + thumb_func_start sub_805CF54 +sub_805CF54: @ 805CF54 + push {r4-r6,lr} + sub sp, 0x4 + ldr r5, =0x02024064 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0805CFB6 + ldr r4, =0x02023064 + ldrb r2, [r5] + lsls r1, r2, 9 + adds r0, r4, 0x1 + adds r0, r1, r0 + ldrb r6, [r0] + adds r0, r4, 0x2 + adds r0, r1, r0 + ldrb r3, [r0] + adds r4, 0x3 + adds r1, r4 + ldrb r0, [r1] + lsls r0, 8 + orrs r3, r0 + str r3, [sp] + adds r0, r2, 0 + adds r1, r2, 0 + adds r3, r6, 0 + bl move_anim_start_t3 + lsls r0, 24 + cmp r0, 0 + beq _0805CFA4 + bl dp01_tbl1_exec_completed + b _0805CFB0 + .pool +_0805CFA4: + ldr r0, =0x03005d60 + ldrb r1, [r5] + lsls r1, 2 + adds r1, r0 + ldr r0, =bx_8030B2C + str r0, [r1] +_0805CFB0: + adds r0, r6, 0 + bl sub_817E32C +_0805CFB6: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805CF54 + + thumb_func_start dp01t_35_1_link_standby_message_and_free_vram +dp01t_35_1_link_standby_message_and_free_vram: @ 805CFC8 + push {r4,r5,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r0, 9 + ldr r4, =0x02023066 + adds r0, r4 + bl sub_81851A8 + ldrb r0, [r5] + lsls r0, 9 + subs r4, 0x1 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0805D002 + cmp r0, 0x1 + bgt _0805CFF8 + cmp r0, 0 + beq _0805CFFE + b _0805D020 + .pool +_0805CFF8: + cmp r0, 0x2 + beq _0805D01C + b _0805D020 +_0805CFFE: + bl b_link_standby_message +_0805D002: + ldr r4, =0x02024064 + ldrb r0, [r4] + movs r1, 0x1 + bl dp11b_obj_free + ldrb r0, [r4] + movs r1, 0 + bl dp11b_obj_free + b _0805D020 + .pool +_0805D01C: + bl b_link_standby_message +_0805D020: + bl dp01_tbl1_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end dp01t_35_1_link_standby_message_and_free_vram + + thumb_func_start sub_805D02C +sub_805D02C: @ 805D02C + push {r4,lr} + ldr r1, =0x02023064 + ldr r4, =0x02024064 + ldrb r3, [r4] + lsls r0, r3, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r2, [r0] + cmp r2, 0x1 + beq _0805D074 + cmp r2, 0x1 + bgt _0805D054 + cmp r2, 0 + beq _0805D05A + b _0805D084 + .pool +_0805D054: + cmp r2, 0x2 + beq _0805D07C + b _0805D084 +_0805D05A: + ldr r0, =0x020244ac + adds r0, r3, r0 + strb r2, [r0] + ldr r1, =0x020244b0 + ldrb r0, [r4] + adds r0, r1 + strb r2, [r0] + b _0805D084 + .pool +_0805D074: + ldr r0, =0x020244ac + b _0805D07E + .pool +_0805D07C: + ldr r0, =0x020244b0 +_0805D07E: + adds r0, r3, r0 + movs r1, 0 + strb r1, [r0] +_0805D084: + bl dp01_tbl1_exec_completed + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805D02C + + thumb_func_start sub_805D094 +sub_805D094: @ 805D094 + push {r4,r5,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r0, 9 + ldr r4, =0x02023068 + adds r0, r4 + bl sub_81851A8 + ldr r2, =0x0202433a + ldrb r0, [r5] + lsls r0, 9 + subs r1, r4, 0x3 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r0, =0x03005d90 + ldr r3, [r0] + ldrb r0, [r5] + lsls r0, 9 + subs r4, 0x2 + adds r0, r4 + ldrb r0, [r0] + ldr r1, =0x00000ca9 + adds r3, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 3 + ldrb r2, [r3] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x5 + bl sub_80A2F50 + movs r0, 0x3 + bl sub_80A2390 + bl dp01_tbl1_exec_completed + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80587B0 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805D094 + + thumb_func_start nullsub_22 +nullsub_22: @ 805D114 + bx lr + thumb_func_end nullsub_22 + + thumb_func_start dp11_init +dp11_init: @ 805D118 + push {r4,lr} + ldr r4, =0x020244d0 + movs r0, 0x10 + bl AllocZeroed + str r0, [r4] + movs r0, 0x10 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1] + movs r0, 0x30 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x4] + movs r0, 0x10 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0x8] + movs r0, 0x50 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1, 0xC] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp11_init + + thumb_func_start dp11_free +dp11_free: @ 805D158 + push {r4,r5,lr} + ldr r5, =0x020244d0 + ldr r0, [r5] + cmp r0, 0 + beq _0805D192 + ldr r0, [r0, 0xC] + bl Free + ldr r0, [r5] + movs r4, 0 + str r4, [r0, 0xC] + ldr r0, [r0, 0x8] + bl Free + ldr r0, [r5] + str r4, [r0, 0x8] + ldr r0, [r0, 0x4] + bl Free + ldr r0, [r5] + str r4, [r0, 0x4] + ldr r0, [r0] + bl Free + ldr r0, [r5] + str r4, [r0] + bl Free + str r4, [r5] +_0805D192: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end dp11_free + + thumb_func_start sub_805D19C +sub_805D19C: @ 805D19C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r0, 0x1 + negs r0, r0 + mov r9, r0 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r2, r0, 9 + ldr r1, =0x02023068 + adds r2, r1 + mov r10, r2 + movs r1, 0 + movs r2, 0xFF + bl sub_803FECC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0x92 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + negs r0, r1 + orrs r0, r1 + asrs r4, r0, 31 + movs r0, 0x2 + ands r4, r0 + adds r6, r4, 0 + adds r5, r4, 0x2 + b _0805D20E + .pool +_0805D20C: + adds r4, 0x1 +_0805D20E: + cmp r4, r5 + bge _0805D234 + ldr r0, =0x02024064 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + ldr r1, =0x020240cc + adds r0, r1 + ldr r0, [r0] + bl GetNatureFromPersonality + lsls r0, 24 + lsrs r0, 22 + adds r0, r4, r0 + ldr r2, =gUnknown_0831C494 + adds r0, r2 + ldrb r0, [r0] + cmp r0, r7 + ble _0805D20C +_0805D234: + subs r7, r4, r6 + cmp r4, r5 + bne _0805D23C + movs r7, 0x2 +_0805D23C: + movs r6, 0 + movs r4, 0 + mov r1, r10 + ldrh r0, [r1] + cmp r0, 0 + beq _0805D27C + mov r5, r10 +_0805D24A: + ldrh r0, [r5] + bl sub_805D4A8 + lsls r0, 24 + lsrs r0, 24 + cmp r7, r0 + bne _0805D26E + mov r0, r10 + adds r0, 0x8 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _0805D26E + ldr r0, =gUnknown_0832A328 + lsls r1, r4, 2 + adds r1, r0 + ldr r0, [r1] + orrs r6, r0 +_0805D26E: + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + bgt _0805D27C + ldrh r0, [r5] + cmp r0, 0 + bne _0805D24A +_0805D27C: + cmp r6, 0 + beq _0805D2AC + ldr r3, =0x0202449c + ldr r1, [r3] + adds r1, 0x92 + ldrb r2, [r1] + movs r0, 0xF + ands r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, 0x92 + lsls r0, r6, 4 + ldrb r2, [r1] + orrs r0, r2 + strb r0, [r1] + lsls r0, r6, 24 + lsrs r0, 24 + bl sub_8130950 + bl sub_8130BA4 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_0805D2AC: + movs r0, 0x1 + negs r0, r0 + cmp r9, r0 + beq _0805D2B6 + b _0805D40C +_0805D2B6: + mov r2, r8 + cmp r2, 0xF + bne _0805D2BE + b _0805D3EA +_0805D2BE: + movs r5, 0 + movs r6, 0 + ldr r7, =gUnknown_0832A328 + mov r4, r10 +_0805D2C6: + ldrh r0, [r4] + bl sub_805D4A8 + lsls r0, 24 + cmp r0, 0 + bne _0805D2DE + ldr r0, [r7] + mov r1, r8 + ands r0, r1 + cmp r0, 0 + bne _0805D2DE + adds r5, 0x1 +_0805D2DE: + ldrh r0, [r4] + bl sub_805D4A8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0805D2F8 + ldr r0, [r7] + mov r2, r8 + ands r0, r2 + cmp r0, 0 + bne _0805D2F8 + adds r5, 0x10 +_0805D2F8: + ldrh r0, [r4] + bl sub_805D4A8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0805D316 + ldr r0, [r7] + mov r1, r8 + ands r0, r1 + cmp r0, 0 + bne _0805D316 + movs r2, 0x80 + lsls r2, 1 + adds r5, r2 +_0805D316: + adds r7, 0x4 + adds r4, 0x2 + ldr r0, =gUnknown_0832A328 + adds r0, 0xC + cmp r7, r0 + ble _0805D2C6 + movs r1, 0xF + ands r1, r5 + cmp r1, 0x1 + ble _0805D32C + adds r6, 0x1 +_0805D32C: + movs r0, 0xF0 + ands r0, r5 + cmp r0, 0x1F + ble _0805D336 + adds r6, 0x1 +_0805D336: + ldr r2, =0x000001ff + cmp r0, r2 + ble _0805D33E + adds r6, 0x1 +_0805D33E: + cmp r6, 0x1 + bgt _0805D346 + cmp r6, 0 + bne _0805D388 +_0805D346: + ldr r5, =gUnknown_0832A328 +_0805D348: + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + lsrs r4, r1, 16 + lsls r0, r4, 2 + adds r0, r5 + ldr r0, [r0] + mov r1, r8 + ands r0, r1 + cmp r0, 0 + bne _0805D366 + mov r9, r4 +_0805D366: + movs r0, 0x1 + negs r0, r0 + cmp r9, r0 + beq _0805D348 + b _0805D3D4 + .pool +_0805D388: + cmp r1, 0x1 + ble _0805D38E + movs r6, 0 +_0805D38E: + cmp r0, 0x1F + ble _0805D394 + movs r6, 0x1 +_0805D394: + cmp r0, r2 + ble _0805D39A + movs r6, 0x2 +_0805D39A: + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + lsrs r4, r1, 16 + ldr r1, =gUnknown_0832A328 + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + mov r2, r8 + ands r0, r2 + cmp r0, 0 + bne _0805D3CC + lsls r0, r4, 1 + add r0, r10 + ldrh r0, [r0] + bl sub_805D4A8 + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + bne _0805D3CC + mov r9, r4 +_0805D3CC: + movs r0, 0x1 + negs r0, r0 + cmp r9, r0 + beq _0805D39A +_0805D3D4: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bls _0805D40C +_0805D3EA: + ldr r2, =0x0202433c + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r1, 4 + adds r1, r2 + ldrb r0, [r1, 0x2] + movs r2, 0x10 + orrs r0, r2 + strb r0, [r1, 0x2] + movs r0, 0 + b _0805D496 + .pool +_0805D40C: + mov r1, r9 + lsls r0, r1, 1 + mov r2, r10 + adds r1, r2, r0 + ldrh r0, [r1] + cmp r0, 0xAE + bne _0805D434 + ldrb r0, [r2, 0x12] + movs r5, 0 + cmp r0, 0x7 + beq _0805D442 + ldrb r1, [r2, 0x13] + movs r0, 0x7 + eors r1, r0 + negs r0, r1 + orrs r0, r1 + asrs r5, r0, 31 + movs r0, 0x10 + ands r5, r0 + b _0805D442 +_0805D434: + ldr r2, =gBattleMoves + ldrh r1, [r1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r5, [r0, 0x6] +_0805D442: + movs r0, 0x10 + ands r0, r5 + cmp r0, 0 + beq _0805D45C + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 8 + b _0805D48A + .pool +_0805D45C: + cmp r5, 0 + bne _0805D470 + bl sub_805D5F4 + lsls r0, 16 + lsrs r0, 16 + mov r2, r9 + orrs r2, r0 + mov r9, r2 + b _0805D490 +_0805D470: + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_get_per_side_status + adds r1, r0, 0 + movs r2, 0x1 + movs r0, 0x1 + ands r0, r1 + eors r0, r2 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 16 +_0805D48A: + mov r1, r9 + orrs r1, r0 + mov r9, r1 +_0805D490: + mov r2, r9 + lsls r0, r2, 16 + lsrs r0, 16 +_0805D496: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_805D19C + + thumb_func_start sub_805D4A8 +sub_805D4A8: @ 805D4A8 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, =gBattleMoves + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x6] + adds r3, r1, 0 + cmp r0, 0x40 + bls _0805D4C2 + b _0805D5EE +_0805D4C2: + lsls r0, 2 + ldr r1, =_0805D4D4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0805D4D4: + .4byte _0805D5D8 + .4byte _0805D5E6 + .4byte _0805D5D8 + .4byte _0805D5EE + .4byte _0805D5D8 + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5D8 + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EA + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5D8 + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5EE + .4byte _0805D5E6 +_0805D5D8: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _0805D5EE +_0805D5E6: + movs r0, 0x2 + b _0805D5F0 +_0805D5EA: + movs r0, 0x1 + b _0805D5F0 +_0805D5EE: + movs r0, 0 +_0805D5F0: + pop {r1} + bx r1 + thumb_func_end sub_805D4A8 + + thumb_func_start sub_805D5F4 +sub_805D5F4: @ 805D5F4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805D6FA + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0805D630 + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0x3 + b _0805D63E + .pool +_0805D630: + movs r0, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0x2 +_0805D63E: + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x02024084 + movs r2, 0x58 + mov r0, r8 + muls r0, r2 + adds r5, r0, r1 + adds r0, r7, 0 + muls r0, r2 + adds r6, r0, r1 + ldrh r0, [r5, 0x28] + ldrh r3, [r6, 0x28] + cmp r0, r3 + bne _0805D680 + bl GenerateRandomNumber + adds r3, r0, 0 + ldr r0, =0x02024064 + ldrb r1, [r0] + movs r2, 0x1 + movs r0, 0x1 + ands r0, r1 + eors r0, r2 + movs r1, 0x2 + ands r1, r3 + adds r0, r1 + b _0805D702 + .pool +_0805D680: + ldr r4, =gUnknown_0831C604 + ldr r0, =0x02024064 + mov r9, r0 + ldrb r0, [r0] + muls r0, r2 + adds r1, 0x48 + adds r0, r1 + ldr r0, [r0] + bl GetNatureFromPersonality + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r4, [r0] + cmp r4, 0x1 + beq _0805D6CC + cmp r4, 0x1 + bgt _0805D6B4 + cmp r4, 0 + beq _0805D6BA + b _0805D6FA + .pool +_0805D6B4: + cmp r4, 0x2 + beq _0805D6DE + b _0805D6FA +_0805D6BA: + ldrh r0, [r5, 0x28] + ldrh r6, [r6, 0x28] + cmp r0, r6 + bls _0805D6C8 + mov r1, r8 + lsls r0, r1, 8 + b _0805D704 +_0805D6C8: + lsls r0, r7, 8 + b _0805D704 +_0805D6CC: + ldrh r0, [r5, 0x28] + ldrh r6, [r6, 0x28] + cmp r0, r6 + bcs _0805D6DA + mov r3, r8 + lsls r0, r3, 8 + b _0805D704 +_0805D6DA: + lsls r0, r7, 8 + b _0805D704 +_0805D6DE: + bl GenerateRandomNumber + adds r3, r0, 0 + mov r0, r9 + ldrb r1, [r0] + movs r2, 0x1 + movs r0, 0x1 + ands r0, r1 + eors r0, r2 + ands r4, r3 + adds r0, r4 + lsls r0, 24 + lsrs r0, 16 + b _0805D704 +_0805D6FA: + ldr r0, =0x02024064 + ldrb r1, [r0] + movs r0, 0x1 + eors r0, r1 +_0805D702: + lsls r0, 8 +_0805D704: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_805D5F4 + + thumb_func_start sub_805D714 +sub_805D714: @ 805D714 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x30] + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + adds r0, r1, 0 + adds r0, 0x3F + ldrb r3, [r0] + lsls r0, r3, 26 + cmp r0, 0 + bge _0805D766 + adds r0, r1, 0 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + blt _0805D766 + adds r2, r1, 0 + adds r2, 0x2C + ldrb r1, [r2] + lsls r0, r1, 25 + cmp r0, 0 + bge _0805D75C + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + b _0805D766 + .pool +_0805D75C: + lsls r0, r3, 27 + cmp r0, 0 + bge _0805D766 + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] +_0805D766: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805D714 + + thumb_func_start sub_805D770 +sub_805D770: @ 805D770 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + adds r3, r4, 0 + adds r3, 0x2C + ldrb r0, [r3] + movs r2, 0x40 + orrs r0, r2 + strb r0, [r3] + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] + cmp r1, 0 + bne _0805D798 + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + b _0805D7A0 + .pool +_0805D798: + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim +_0805D7A0: + adds r0, r4, 0 + bl AnimateObject + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_805D770 + + thumb_func_start sub_805D7AC +sub_805D7AC: @ 805D7AC + push {lr} + adds r2, r0, 0 + ldr r0, =0x020243fc + ldrh r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0805D7E4 + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x24] + adds r0, r1 + strh r0, [r2, 0x24] + lsls r0, 16 + cmp r0, 0 + bne _0805D7E4 + movs r1, 0x26 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0805D7E0 + ldr r0, =sub_805D7EC + b _0805D7E2 + .pool +_0805D7E0: + ldr r0, =DummyObjectCallback +_0805D7E2: + str r0, [r2, 0x1C] +_0805D7E4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_805D7AC + + thumb_func_start sub_805D7EC +sub_805D7EC: @ 805D7EC + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x26] + subs r0, 0x2 + strh r0, [r1, 0x26] + lsls r0, 16 + cmp r0, 0 + bne _0805D800 + ldr r0, =DummyObjectCallback + str r0, [r1, 0x1C] +_0805D800: + pop {r0} + bx r0 + .pool + thumb_func_end sub_805D7EC + + thumb_func_start move_anim_start_t2_for_situation +move_anim_start_t2_for_situation: @ 805D808 + push {r4-r6,lr} + adds r4, r1, 0 + lsls r0, 24 + ldr r6, =0x020244d0 + ldr r1, [r6] + ldr r5, =0x02024064 + ldrb r2, [r5] + ldr r3, [r1, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r3 + ldrb r2, [r1] + movs r3, 0x10 + orrs r2, r3 + strb r2, [r1] + cmp r0, 0 + bne _0805D888 + cmp r4, 0x20 + bne _0805D844 + ldrb r0, [r5] + movs r1, 0x6 + bl move_anim_start_t2 + b _0805D902 + .pool +_0805D844: + cmp r4, 0x8 + beq _0805D850 + movs r0, 0x80 + ands r0, r4 + cmp r0, 0 + beq _0805D85A +_0805D850: + ldrb r0, [r5] + movs r1, 0 + bl move_anim_start_t2 + b _0805D902 +_0805D85A: + cmp r4, 0x10 + bne _0805D868 + ldrb r0, [r5] + movs r1, 0x2 + bl move_anim_start_t2 + b _0805D902 +_0805D868: + movs r0, 0x7 + ands r0, r4 + cmp r0, 0 + beq _0805D87A + ldrb r0, [r5] + movs r1, 0x4 + bl move_anim_start_t2 + b _0805D902 +_0805D87A: + cmp r4, 0x40 + bne _0805D8EA + ldrb r0, [r5] + movs r1, 0x5 + bl move_anim_start_t2 + b _0805D902 +_0805D888: + movs r0, 0xF0 + lsls r0, 12 + ands r0, r4 + cmp r0, 0 + beq _0805D89C + ldrb r0, [r5] + movs r1, 0x3 + bl move_anim_start_t2 + b _0805D902 +_0805D89C: + movs r0, 0x7 + ands r0, r4 + cmp r0, 0 + beq _0805D8AE + ldrb r0, [r5] + movs r1, 0x1 + bl move_anim_start_t2 + b _0805D902 +_0805D8AE: + movs r0, 0x80 + lsls r0, 21 + ands r0, r4 + cmp r0, 0 + beq _0805D8C2 + ldrb r0, [r5] + movs r1, 0x7 + bl move_anim_start_t2 + b _0805D902 +_0805D8C2: + movs r0, 0x80 + lsls r0, 20 + ands r0, r4 + cmp r0, 0 + beq _0805D8D6 + ldrb r0, [r5] + movs r1, 0x8 + bl move_anim_start_t2 + b _0805D902 +_0805D8D6: + movs r0, 0xE0 + lsls r0, 8 + ands r0, r4 + cmp r0, 0 + beq _0805D8EA + ldrb r0, [r5] + movs r1, 0x9 + bl move_anim_start_t2 + b _0805D902 +_0805D8EA: + ldr r0, [r6] + ldrb r2, [r5] + 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] +_0805D902: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end move_anim_start_t2_for_situation + + thumb_func_start move_anim_start_t3 +move_anim_start_t3: @ 805D908 + 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 r6, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp] + lsls r3, 24 + lsrs r5, r3, 24 + lsls r4, 16 + lsrs r7, r4, 16 + cmp r5, 0 + bne _0805D950 + movs r0, 0x80 + ands r0, r7 + cmp r0, 0 + beq _0805D950 + ldr r0, =0x020244e4 + adds r0, r6, r0 + movs r2, 0x7F + adds r1, r7, 0 + ands r1, r2 + strb r1, [r0] + movs r0, 0x1 + b _0805DA1E + .pool +_0805D950: + ldr r0, =0x020244d0 + mov r9, r0 + ldr r0, [r0] + ldr r0, [r0] + lsls r4, r6, 2 + adds r0, r4, r0 + ldrb r1, [r0] + movs r2, 0x4 + mov r8, r2 + mov r0, r8 + ands r0, r1 + cmp r0, 0 + beq _0805D9CC + adds r0, r5, 0 + bl sub_805DAA0 + lsls r0, 24 + cmp r0, 0 + bne _0805D980 + movs r0, 0x1 + b _0805DA1E + .pool +_0805D980: + mov r1, r9 + ldr r0, [r1] + ldr r0, [r0] + adds r0, r4, r0 + ldrb r1, [r0] + mov r0, r8 + ands r0, r1 + cmp r0, 0 + beq _0805D9CC + cmp r5, 0x2 + bne _0805D9CC + ldr r1, =0x02020630 + ldr r0, =0x020241e4 + adds r0, r6, r0 + ldrb r2, [r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r0, [r0] + lsls r0, 29 + cmp r0, 0 + bge _0805D9CC + adds r0, r6, 0 + movs r1, 0x1 + bl refresh_graphics_maybe + adds r0, r6, 0 + bl sub_805E974 + movs r0, 0x1 + b _0805DA1E + .pool +_0805D9CC: + ldr r0, =0x02038436 + mov r2, r10 + strb r2, [r0] + ldr r0, =0x02038437 + mov r1, sp + ldrb r1, [r1] + strb r1, [r0] + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r0, [r0, 0x8] + strh r7, [r0] + ldr r0, =gUnknown_082C9320 + adds r1, r5, 0 + movs r2, 0 + bl move_something + ldr r0, =task0A_0803415C + movs r1, 0xA + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r6, [r1, 0x8] + ldr r0, [r4] + movs r2, 0x8 + ldrsh r1, [r1, r2] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0] + movs r0, 0 +_0805DA1E: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end move_anim_start_t3 + + thumb_func_start task0A_0803415C +task0A_0803415C: @ 805DA48 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x020383f8 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =0x020383fd + ldrb r0, [r0] + cmp r0, 0 + bne _0805DA8A + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + ldr r2, [r2, 0x4] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1] + movs r0, 0x21 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + adds r0, r4, 0 + bl DestroyTask +_0805DA8A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task0A_0803415C + + thumb_func_start sub_805DAA0 +sub_805DAA0: @ 805DAA0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD + bgt _0805DAB4 + cmp r0, 0xA + bge _0805DAB8 + cmp r0, 0x2 + beq _0805DAB8 + b _0805DABC +_0805DAB4: + cmp r0, 0x11 + bne _0805DABC +_0805DAB8: + movs r0, 0x1 + b _0805DABE +_0805DABC: + movs r0, 0 +_0805DABE: + pop {r1} + bx r1 + thumb_func_end sub_805DAA0 + + thumb_func_start move_anim_start_t4 +move_anim_start_t4: @ 805DAC4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =0x02038436 + strb r1, [r0] + ldr r0, =0x02038437 + strb r2, [r0] + ldr r0, =gUnknown_082C937C + adds r1, r3, 0 + movs r2, 0 + bl move_something + ldr r0, =task0A_08034248 + movs r1, 0xA + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + ldr r0, =0x020244d0 + ldr r0, [r0] + movs r2, 0x8 + ldrsh r1, [r1, r2] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end move_anim_start_t4 + + thumb_func_start task0A_08034248 +task0A_08034248: @ 805DB34 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x020383f8 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =0x020383fd + ldrb r0, [r0] + cmp r0, 0 + bne _0805DB76 + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + ldr r2, [r2, 0x4] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1] + movs r0, 0x41 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + adds r0, r4, 0 + bl DestroyTask +_0805DB76: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task0A_08034248 + + thumb_func_start sub_805DB8C +sub_805DB8C: @ 805DB8C + movs r0, 0 + bx lr + thumb_func_end sub_805DB8C + + thumb_func_start mplay_80342A4 +mplay_80342A4: @ 805DB90 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r5, 0 + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _0805DBD8 + ldr r2, =0x020244d0 + ldr r0, [r2] + ldr r1, [r0, 0x4] + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x8] + adds r1, 0x1 + strb r1, [r0, 0x8] + ldr r2, [r2] + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x8] + cmp r0, 0x1D + bls _0805DBDC + ldr r0, =0x030075f0 + bl MPlayStop_rev01 + ldr r0, =0x03007630 + bl MPlayStop_rev01 +_0805DBD8: + cmp r5, 0 + beq _0805DBF0 +_0805DBDC: + movs r0, 0x1 + b _0805DC02 + .pool +_0805DBF0: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + strb r5, [r0, 0x8] + movs r0, 0 +_0805DC02: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end mplay_80342A4 + + thumb_func_start sub_805DC0C +sub_805DC0C: @ 805DC0C + 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, 24 + lsrs r1, 24 + mov r8, r1 + movs r1, 0 + bl pokemon_getattr + str r0, [sp] + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + mov r2, r8 + lsls r1, r2, 2 + adds r2, r1, r0 + ldrh r0, [r2, 0x2] + cmp r0, 0 + bne _0805DC50 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + ldr r6, [sp] + b _0805DC58 + .pool +_0805DC50: + ldrh r5, [r2, 0x2] + ldr r0, =0x020244bc + adds r0, r1, r0 + ldr r6, [r0] +_0805DC58: + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr + mov r10, r0 + mov r0, r8 + bl battle_get_per_side_status + lsls r0, 24 + lsls r2, r5, 3 + ldr r1, =gMonFrontPicTable + adds r2, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + lsrs r0, 22 + adds r1, 0x4 + adds r1, r0 + ldr r1, [r1] + adds r0, r2, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack + mov r3, r8 + lsls r2, r3, 4 + movs r0, 0x80 + lsls r0, 1 + adds r7, r2, r0 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + lsls r1, r3, 2 + adds r0, r1, r0 + ldrh r0, [r0, 0x2] + str r1, [sp, 0x4] + mov r9, r2 + cmp r0, 0 + bne _0805DCBC + adds r0, r4, 0 + bl pokemon_get_pal + b _0805DCC6 + .pool +_0805DCBC: + adds r0, r5, 0 + mov r1, r10 + ldr r2, [sp] + bl species_and_otid_get_pal +_0805DCC6: + adds r6, r0, 0 + ldr r4, =0x0201c000 + adds r0, r6, 0 + adds r1, r4, 0 + bl LZDecompressWram + adds r0, r4, 0 + adds r1, r7, 0 + movs r2, 0x20 + bl gpu_pal_apply + mov r1, r9 + adds r1, 0x80 + adds r0, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =0x00000181 + cmp r5, r0 + bne _0805DD1A + movs r7, 0x80 + lsls r7, 1 + add r7, r9 + ldr r5, =0x0202449c + ldr r1, [r5] + movs r4, 0x80 + lsls r4, 1 + adds r1, r4 + adds r0, r6, 0 + bl LZDecompressWram + ldr r0, =0x020244e4 + add r0, r8 + ldrb r1, [r0] + lsls r1, 5 + adds r1, r4 + ldr r0, [r5] + adds r0, r1 + adds r1, r7, 0 + movs r2, 0x20 + bl gpu_pal_apply +_0805DD1A: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + ldr r1, [sp, 0x4] + adds r0, r1, r0 + ldrh r0, [r0, 0x2] + cmp r0, 0 + beq _0805DD46 + ldr r3, =0x00007fff + adds r0, r7, 0 + movs r1, 0x10 + movs r2, 0x6 + bl pal_fade_1 + lsls r1, r7, 1 + ldr r0, =0x02037b14 + adds r0, r1, r0 + ldr r2, =0x02037714 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet +_0805DD46: + 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_805DC0C + + thumb_func_start sub_805DD7C +sub_805DD7C: @ 805DD7C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + movs r1, 0 + bl pokemon_getattr + str r0, [sp] + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + mov r2, r8 + lsls r1, r2, 2 + adds r2, r1, r0 + ldrh r0, [r2, 0x2] + cmp r0, 0 + bne _0805DDC0 + adds r0, r6, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + ldr r4, [sp] + b _0805DDC8 + .pool +_0805DDC0: + ldrh r5, [r2, 0x2] + ldr r0, =0x020244bc + adds r0, r1, r0 + ldr r4, [r0] +_0805DDC8: + adds r0, r6, 0 + movs r1, 0x1 + bl pokemon_getattr + str r0, [sp, 0x4] + mov r0, r8 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0x1 + mov r1, r8 + bl sub_80688F8 + lsls r0, 24 + lsrs r0, 24 + mov r1, r8 + lsls r1, 2 + mov r10, r1 + cmp r0, 0x1 + beq _0805DE00 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + add r0, r10 + ldrh r0, [r0, 0x2] + cmp r0, 0 + beq _0805DE2C +_0805DE00: + lsls r0, r5, 3 + ldr r1, =gMonBackPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + lsls r2, r7, 2 + adds r1, 0x4 + adds r1, r2 + ldr r1, [r1] + adds r2, r5, 0 + adds r3, r4, 0 + bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack + b _0805DE46 + .pool +_0805DE2C: + lsls r0, r5, 3 + ldr r1, =gMonBackPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + lsls r2, r7, 2 + adds r1, 0x4 + adds r1, r2 + ldr r1, [r1] + adds r2, r5, 0 + adds r3, r4, 0 + bl DecompressMonPic_DetectFrontOrBack +_0805DE46: + mov r2, r8 + lsls r1, r2, 4 + movs r0, 0x80 + lsls r0, 1 + adds r7, r1, r0 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + add r0, r10 + ldrh r0, [r0, 0x2] + mov r9, r1 + cmp r0, 0 + bne _0805DE74 + adds r0, r6, 0 + bl pokemon_get_pal + b _0805DE7E + .pool +_0805DE74: + adds r0, r5, 0 + ldr r1, [sp, 0x4] + ldr r2, [sp] + bl species_and_otid_get_pal +_0805DE7E: + adds r6, r0, 0 + ldr r4, =0x0201c000 + adds r0, r6, 0 + adds r1, r4, 0 + bl LZDecompressWram + adds r0, r4, 0 + adds r1, r7, 0 + movs r2, 0x20 + bl gpu_pal_apply + mov r1, r9 + adds r1, 0x80 + adds r0, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =0x00000181 + cmp r5, r0 + bne _0805DED2 + movs r7, 0x80 + lsls r7, 1 + add r7, r9 + ldr r5, =0x0202449c + ldr r1, [r5] + movs r4, 0x80 + lsls r4, 1 + adds r1, r4 + adds r0, r6, 0 + bl LZDecompressWram + ldr r0, =0x020244e4 + add r0, r8 + ldrb r1, [r0] + lsls r1, 5 + adds r1, r4 + ldr r0, [r5] + adds r0, r1 + adds r1, r7, 0 + movs r2, 0x20 + bl gpu_pal_apply +_0805DED2: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + add r0, r10 + ldrh r0, [r0, 0x2] + cmp r0, 0 + beq _0805DEFC + ldr r3, =0x00007fff + adds r0, r7, 0 + movs r1, 0x10 + movs r2, 0x6 + bl pal_fade_1 + lsls r1, r7, 1 + ldr r0, =0x02037b14 + adds r0, r1, r0 + ldr r2, =0x02037714 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet +_0805DEFC: + 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_805DD7C + + thumb_func_start nullsub_23 +nullsub_23: @ 805DF30 + bx lr + thumb_func_end nullsub_23 + + thumb_func_start nullsub_24 +nullsub_24: @ 805DF34 + bx lr + thumb_func_end nullsub_24 + + thumb_func_start sub_805DF38 +sub_805DF38: @ 805DF38 + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_per_side_status + lsls r0, 24 + lsls r4, 3 + ldr r2, =gTrainerFrontPicTable + adds r2, r4, r2 + ldr r1, =0x020244d4 + ldr r1, [r1] + lsrs r0, 22 + adds r1, 0x4 + adds r1, r0 + ldr r1, [r1] + adds r0, r2, 0 + movs r2, 0 + bl DecompressPicFromTable_2 + ldr r0, =gTrainerFrontPicPaletteTable + adds r4, r0 + adds r0, r4, 0 + bl LoadCompressedObjectPalette + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805DF38 + + thumb_func_start sub_805DF84 +sub_805DF84: @ 805DF84 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsls r5, 3 + ldr r2, =gTrainerBackPicTable + adds r2, r5, r2 + ldr r1, =0x020244d4 + ldr r1, [r1] + lsrs r0, 22 + adds r1, 0x4 + adds r1, r0 + ldr r1, [r1] + adds r0, r2, 0 + movs r2, 0 + bl DecompressPicFromTable_2 + ldr r0, =gTrainerBackPicPaletteTable + adds r5, r0 + ldr r0, [r5] + lsls r4, 20 + movs r1, 0x80 + lsls r1, 17 + adds r4, r1 + lsrs r4, 16 + adds r1, r4, 0 + movs r2, 0x20 + bl decompress_palette + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805DF84 + + thumb_func_start nullsub_25 +nullsub_25: @ 805DFE0 + bx lr + thumb_func_end nullsub_25 + + thumb_func_start sub_805DFE4 +sub_805DFE4: @ 805DFE4 + push {lr} + lsls r0, 16 + ldr r1, =gTrainerFrontPicPaletteTable + lsrs r0, 13 + adds r0, r1 + ldrh r0, [r0, 0x4] + bl FreeObjectPaletteByTag + pop {r0} + bx r0 + .pool + thumb_func_end sub_805DFE4 + + thumb_func_start sub_805DFFC +sub_805DFFC: @ 805DFFC + push {r4-r7,lr} + ldr r4, =gUnknown_0832C128 + adds r0, r4, 0 + bl LoadTaggedObjectPalette + adds r4, 0x8 + adds r0, r4, 0 + bl LoadTaggedObjectPalette + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _0805E034 + ldr r0, =gUnknown_0832C0D0 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0832C0D8 + bl LoadCompressedObjectPic + movs r5, 0x2 + b _0805E056 + .pool +_0805E034: + ldr r4, =gUnknown_0832C0E0 + adds r0, r4, 0 + bl LoadCompressedObjectPic + adds r4, 0x8 + adds r0, r4, 0 + bl LoadCompressedObjectPic + ldr r4, =gUnknown_0832C0F0 + adds r0, r4, 0 + bl LoadCompressedObjectPic + adds r4, 0x8 + adds r0, r4, 0 + bl LoadCompressedObjectPic + movs r5, 0x4 +_0805E056: + movs r4, 0 + cmp r4, r5 + bcs _0805E076 + ldr r7, =0x02024076 + ldr r6, =gUnknown_0832C108 +_0805E060: + adds r0, r4, r7 + ldrb r0, [r0] + lsls r0, 3 + adds r0, r6 + bl LoadCompressedObjectPic + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _0805E060 +_0805E076: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805DFFC + + thumb_func_start sub_805E08C +sub_805E08C: @ 805E08C + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + movs r6, 0 + cmp r4, 0 + bne _0805E09C + b _0805E1AE +_0805E09C: + cmp r4, 0x1 + bne _0805E0B8 + ldr r4, =gUnknown_0832C128 + adds r0, r4, 0 + bl LoadTaggedObjectPalette + adds r4, 0x8 + adds r0, r4, 0 + bl LoadTaggedObjectPalette + b _0805E1AE + .pool +_0805E0B8: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _0805E120 + cmp r4, 0x2 + bne _0805E0F0 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0805E0E4 + ldr r0, =gUnknown_0832C100 + bl LoadCompressedObjectPic + b _0805E1AE + .pool +_0805E0E4: + ldr r0, =gUnknown_0832C0D0 + bl LoadCompressedObjectPic + b _0805E1AE + .pool +_0805E0F0: + cmp r4, 0x3 + bne _0805E100 + ldr r0, =gUnknown_0832C0D8 + bl LoadCompressedObjectPic + b _0805E1AE + .pool +_0805E100: + cmp r4, 0x4 + bne _0805E110 + ldr r0, =0x02024076 + ldrb r0, [r0] + b _0805E198 + .pool +_0805E110: + cmp r4, 0x5 + bne _0805E1AC + ldr r0, =0x02024076 + ldrb r0, [r0, 0x1] + b _0805E198 + .pool +_0805E120: + cmp r4, 0x2 + bne _0805E130 + ldr r0, =gUnknown_0832C0E0 + bl LoadCompressedObjectPic + b _0805E1AE + .pool +_0805E130: + cmp r4, 0x3 + bne _0805E140 + ldr r0, =gUnknown_0832C0E8 + bl LoadCompressedObjectPic + b _0805E1AE + .pool +_0805E140: + cmp r4, 0x4 + bne _0805E150 + ldr r0, =gUnknown_0832C0F0 + bl LoadCompressedObjectPic + b _0805E1AE + .pool +_0805E150: + cmp r4, 0x5 + bne _0805E160 + ldr r0, =gUnknown_0832C0F8 + bl LoadCompressedObjectPic + b _0805E1AE + .pool +_0805E160: + cmp r4, 0x6 + bne _0805E170 + ldr r0, =0x02024076 + ldrb r0, [r0] + b _0805E198 + .pool +_0805E170: + cmp r4, 0x7 + bne _0805E180 + ldr r0, =0x02024076 + ldrb r0, [r0, 0x1] + b _0805E198 + .pool +_0805E180: + cmp r4, 0x8 + bne _0805E190 + ldr r0, =0x02024076 + ldrb r0, [r0, 0x2] + b _0805E198 + .pool +_0805E190: + cmp r5, 0x9 + bne _0805E1AC + ldr r0, =0x02024076 + ldrb r0, [r0, 0x3] +_0805E198: + lsls r0, 3 + ldr r1, =gUnknown_0832C108 + adds r0, r1 + bl LoadCompressedObjectPic + b _0805E1AE + .pool +_0805E1AC: + movs r6, 0x1 +_0805E1AE: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_805E08C + + thumb_func_start load_gfxc_health_bar +load_gfxc_health_bar: @ 805E1B8 + push {lr} + ldr r0, =gUnknown_08C093F0 + ldr r1, =0x020244d4 + ldr r1, [r1] + movs r2, 0xBA + lsls r2, 1 + adds r1, r2 + ldr r1, [r1] + bl LZDecompressWram + pop {r0} + bx r0 + .pool + thumb_func_end load_gfxc_health_bar + + thumb_func_start battle_load_something +battle_load_something: @ 805E1D8 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r6, 0 + ldrb r0, [r5] + cmp r0, 0x6 + bls _0805E1E8 + b _0805E346 +_0805E1E8: + lsls r0, 2 + ldr r1, =_0805E1F8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0805E1F8: + .4byte _0805E214 + .4byte _0805E21A + .4byte _0805E324 + .4byte _0805E230 + .4byte _0805E260 + .4byte _0805E29C + .4byte _0805E33C +_0805E214: + bl sub_805E378 + b _0805E324 +_0805E21A: + ldrb r0, [r4] + bl sub_805E08C + lsls r0, 24 + cmp r0, 0 + beq _0805E228 + b _0805E320 +_0805E228: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _0805E346 +_0805E230: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0805E24C + ldrb r0, [r4] + cmp r0, 0 + bne _0805E24C + bl battle_make_oam_safari_battle + b _0805E252 + .pool +_0805E24C: + ldrb r0, [r4] + bl battle_make_oam_normal_battle +_0805E252: + ldr r2, =0x03005d70 + ldrb r1, [r4] + adds r1, r2 + strb r0, [r1] + b _0805E30E + .pool +_0805E260: + ldrb r0, [r4] + bl sub_8072B18 + ldr r0, =0x02024076 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + cmp r0, 0x1 + bhi _0805E288 + ldr r0, =0x03005d70 + adds r0, r1, r0 + ldrb r0, [r0] + movs r1, 0 + bl nullsub_30 + b _0805E30E + .pool +_0805E288: + ldr r0, =0x03005d70 + adds r0, r1, r0 + ldrb r0, [r0] + movs r1, 0x1 + bl nullsub_30 + b _0805E30E + .pool +_0805E29C: + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0805E2E4 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0805E302 + ldr r0, =0x03005d70 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + b _0805E302 + .pool +_0805E2E4: + ldr r0, =0x03005d70 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe +_0805E302: + ldr r1, =0x03005d70 + ldrb r0, [r4] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 +_0805E30E: + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + ldr r1, =0x0202406c + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bne _0805E346 +_0805E320: + movs r0, 0 + strb r0, [r4] +_0805E324: + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + b _0805E346 + .pool +_0805E33C: + bl sub_805EC84 + bl sub_81B8C68 + movs r6, 0x1 +_0805E346: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end battle_load_something + + thumb_func_start sub_805E350 +sub_805E350: @ 805E350 + push {r4,lr} + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r0, [r0, 0x4] + movs r1, 0 + movs r2, 0x30 + bl memset + ldr r0, [r4] + ldr r0, [r0, 0x8] + movs r1, 0 + movs r2, 0x10 + bl memset + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805E350 + + thumb_func_start sub_805E378 +sub_805E378: @ 805E378 + push {lr} + bl sub_805E350 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + movs r1, 0 + movs r2, 0x10 + bl memset + pop {r0} + bx r0 + .pool + thumb_func_end sub_805E378 + + thumb_func_start sub_805E394 +sub_805E394: @ 805E394 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r4, 0 + ldr r5, =0x0202406c + ldrb r0, [r5] + cmp r4, r0 + bge _0805E3EA + ldr r0, =0x02020630 + mov r9, r0 + movs r0, 0x1 + mov r12, r0 + movs r0, 0x2 + negs r0, r0 + mov r8, r0 + ldr r7, =0x020244d0 + ldr r6, =0x020241e4 +_0805E3B8: + ldr r0, [r7] + ldr r0, [r0] + lsls r3, r4, 2 + adds r3, r0 + adds r0, r4, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r1, [r0] + lsls r1, 29 + lsrs r1, 31 + mov r0, r12 + ands r1, r0 + ldrb r2, [r3] + mov r0, r8 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + adds r4, 0x1 + ldrb r0, [r5] + cmp r4, r0 + blt _0805E3B8 +_0805E3EA: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805E394 + + thumb_func_start sub_805E408 +sub_805E408: @ 805E408 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x020244d0 + ldr r1, [r1] + ldr r1, [r1] + lsls r3, r0, 2 + adds r3, r1 + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + lsls r1, 29 + lsrs r1, 31 + ldrb r2, [r3] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + bx lr + .pool + thumb_func_end sub_805E408 + + thumb_func_start sub_805E448 +sub_805E448: @ 805E448 + 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 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + lsls r2, 24 + cmp r2, 0 + beq _0805E51C + ldr r0, =0x020241e4 + adds r5, r7, r0 + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + mov r8, r1 + add r0, r8 + ldr r4, =0x020244d0 + ldr r1, [r4] + ldr r1, [r1, 0x8] + ldrb r1, [r1] + bl StartObjectImageAnim + lsls r0, r7, 20 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r6, r0, 16 + ldr r2, =0x0202449c + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrh r1, [r0] + lsls r1, 5 + movs r3, 0x80 + lsls r3, 1 + adds r1, r3 + ldr r0, [r2] + adds r0, r1 + adds r1, r6, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =0x020244e4 + adds r1, r7, r1 + ldr r0, [r4] + ldr r0, [r0, 0x8] + ldrh r0, [r0] + strb r0, [r1] + ldr r0, [r4] + ldr r1, [r0] + lsls r0, r7, 2 + adds r0, r1 + ldrh r0, [r0, 0x2] + cmp r0, 0 + beq _0805E4DE + ldr r3, =0x00007fff + adds r0, r6, 0 + movs r1, 0x10 + movs r2, 0x6 + bl pal_fade_1 + lsls r1, r6, 1 + ldr r0, =0x02037b14 + adds r0, r1, r0 + ldr r2, =0x02037714 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet +_0805E4DE: + adds r0, r7, 0 + bl sub_80A6138 + ldrb r2, [r5] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x22] + b _0805E77A + .pool +_0805E51C: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0805E558 + movs r0, 0 + mov r10, r0 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r2, [r0, 0x18] + ldrh r1, [r2, 0x2] + mov r8, r1 + ldr r3, [r2, 0x8] + mov r9, r3 + ldr r4, [r2, 0xC] + lsls r0, r1, 3 + ldr r1, =gMonBackPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + ldr r1, [r1, 0x4] + ldr r3, [r2, 0x10] + b _0805E5FA + .pool +_0805E558: + adds r0, r7, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r0, [sp] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0805E58C + ldr r1, =0x0202406e + ldr r2, [sp] + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + b _0805E59C + .pool +_0805E58C: + ldr r1, =0x0202406e + ldr r3, [sp] + lsls r0, r3, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec +_0805E59C: + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r0, r7, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0805E618 + ldr r0, =0x0202406e + lsls r4, r7, 1 + adds r4, r0 + ldrh r0, [r4] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + movs r1, 0 + bl pokemon_getattr + mov r9, r0 + ldrh r0, [r4] + muls r0, r6 + adds r0, r5 + movs r1, 0x1 + bl pokemon_getattr + adds r4, r0, 0 + mov r1, r8 + lsls r0, r1, 3 + ldr r1, =gMonBackPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + mov r3, r10 + lsls r2, r3, 2 + adds r1, 0x4 + adds r1, r2 + ldr r1, [r1] + ldr r3, =0x020244bc + lsls r2, r7, 2 + adds r2, r3 + ldr r3, [r2] +_0805E5FA: + mov r2, r8 + bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack + b _0805E662 + .pool +_0805E618: + ldr r0, =0x0202406e + lsls r4, r7, 1 + adds r4, r0 + ldrh r0, [r4] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x02024744 + adds r0, r5 + movs r1, 0 + bl pokemon_getattr + mov r9, r0 + ldrh r0, [r4] + muls r0, r6 + adds r0, r5 + movs r1, 0x1 + bl pokemon_getattr + adds r4, r0, 0 + mov r1, r8 + lsls r0, r1, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + mov r3, r10 + lsls r2, r3, 2 + adds r1, 0x4 + adds r1, r2 + ldr r1, [r1] + ldr r3, =0x020244bc + lsls r2, r7, 2 + adds r2, r3 + ldr r3, [r2] + mov r2, r8 + bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack +_0805E662: + ldr r0, =0x020244d4 + ldr r0, [r0] + mov r2, r10 + lsls r1, r2, 2 + adds r0, 0x4 + adds r0, r1 + ldr r2, [r0] + ldr r0, =0x020241e4 + adds r0, r7 + mov r10, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r3, =0x02020630 + adds r0, r3 + ldrh r0, [r0, 0x4] + lsls r0, 22 + lsrs r0, 17 + ldr r1, =0x06010000 + adds r0, r1 + ldr r1, =0x040000d4 + str r2, [r1] + str r0, [r1, 0x4] + ldr r0, =0x84000200 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + lsls r0, r7, 20 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r6, r0, 16 + mov r0, r8 + adds r1, r4, 0 + mov r2, r9 + bl species_and_otid_get_pal + mov r9, r0 + ldr r4, =0x0201c000 + adds r1, r4, 0 + bl LZDecompressWram + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =0x00000181 + cmp r8, r0 + bne _0805E70A + mov r2, r10 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r1, 0x8 + adds r0, r1 + ldr r1, =gUnknown_08309AAC + mov r3, r8 + lsls r2, r3, 2 + adds r1, r2 + ldr r1, [r1] + str r1, [r0] + ldr r5, =0x0202449c + ldr r1, [r5] + movs r4, 0x80 + lsls r4, 1 + adds r1, r4 + mov r0, r9 + bl LZDecompressWram + ldr r0, =0x020244e4 + ldr r1, [sp] + adds r0, r1, r0 + ldrb r1, [r0] + lsls r1, 5 + adds r1, r4 + ldr r0, [r5] + adds r0, r1 + adds r1, r6, 0 + movs r2, 0x20 + bl gpu_pal_apply +_0805E70A: + ldr r3, =0x00007fff + adds r0, r6, 0 + movs r1, 0x10 + movs r2, 0x6 + bl pal_fade_1 + lsls r1, r6, 1 + ldr r0, =0x02037b14 + adds r0, r1, r0 + ldr r2, =0x02037714 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0805E74A + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r7, 2 + adds r0, r1 + mov r2, r8 + strh r2, [r0, 0x2] + ldr r0, =0x020244e4 + adds r1, r7, r0 + ldr r3, [sp] + adds r0, r3, r0 + ldrb r0, [r0] + strb r0, [r1] +_0805E74A: + adds r0, r7, 0 + bl sub_80A6138 + mov r1, r10 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + ldr r2, =0x02020630 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x22] + mov r3, r10 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x020244e4 + adds r1, r7, r1 + ldrb r1, [r1] + bl StartObjectImageAnim +_0805E77A: + 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_805E448 + + thumb_func_start sub_805E7DC +sub_805E7DC: @ 805E7DC + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + lsls r1, 24 + cmp r1, 0 + bne _0805E898 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0805E7F8 + movs r4, 0 + b _0805E802 +_0805E7F8: + adds r0, r4, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r4, r0, 24 +_0805E802: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0805E814 + ldr r0, =gUnknown_08C2D120 + b _0805E822 + .pool +_0805E814: + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0805E83C + ldr r0, =gUnknown_08C2CEE0 +_0805E822: + ldr r1, =0x020244d4 + ldr r1, [r1] + lsls r4, 2 + adds r1, 0x4 + adds r1, r4 + ldr r1, [r1] + bl LZDecompressVram + b _0805E84E + .pool +_0805E83C: + ldr r0, =gUnknown_08C2D120 + ldr r1, =0x020244d4 + ldr r1, [r1] + lsls r4, 2 + adds r1, 0x4 + adds r1, r4 + ldr r1, [r1] + bl LZDecompressVram +_0805E84E: + movs r3, 0x1 + lsls r6, r5, 4 + ldr r7, =gUnknown_08C2CEBC + ldr r0, =0x020244d4 + ldr r0, [r0] + adds r0, 0x4 + adds r4, r0, r4 + ldr r2, =0x040000d4 + ldr r5, =0x84000200 +_0805E860: + ldr r0, [r4] + lsls r1, r3, 11 + adds r1, r0, r1 + str r0, [r2] + str r1, [r2, 0x4] + str r5, [r2, 0x8] + ldr r0, [r2, 0x8] + adds r3, 0x1 + cmp r3, 0x3 + ble _0805E860 + movs r0, 0x80 + lsls r0, 1 + adds r1, r6, r0 + adds r0, r7, 0 + movs r2, 0x20 + bl decompress_palette + b _0805E8E6 + .pool +_0805E898: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0805E8E6 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0805E8D0 + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + adds r1, r4, 0 + bl sub_805DC0C + b _0805E8E6 + .pool +_0805E8D0: + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + adds r1, r5, 0 + bl sub_805DD7C +_0805E8E6: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805E7DC + + thumb_func_start refresh_graphics_maybe +refresh_graphics_maybe: @ 805E8F4 + push {r4-r6,lr} + adds r5, r1, 0 + adds r4, r2, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_805E7DC + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =0x02020630 + adds r4, r0, r1 + ldr r0, =0x020244e4 + adds r0, r6, r0 + ldrb r1, [r0] + adds r0, r4, 0 + bl StartObjectImageAnim + cmp r5, 0 + bne _0805E938 + adds r0, r6, 0 + bl sub_80A614C + b _0805E93E + .pool +_0805E938: + adds r0, r6, 0 + bl sub_80A6138 +_0805E93E: + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end refresh_graphics_maybe + + thumb_func_start sub_805E94C +sub_805E94C: @ 805E94C + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 16 + lsrs r1, 16 + cmp r1, 0xA4 + bne _0805E96C + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] +_0805E96C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_805E94C + + thumb_func_start sub_805E974 +sub_805E974: @ 805E974 + lsls r0, 24 + ldr r1, =0x020244d0 + ldr r1, [r1] + ldr r1, [r1] + lsrs r0, 22 + adds r0, r1 + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_805E974 + + thumb_func_start sub_805E990 +sub_805E990: @ 805E990 + push {r4-r7,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + adds r7, r6, 0 + movs r1, 0x39 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x3A + bl pokemon_getattr + adds r1, r0, 0 + lsls r4, 16 + asrs r4, 16 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_8075060 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0805EA08 + ldr r7, =0x020244d0 + ldr r0, [r7] + ldr r2, [r0] + lsls r4, r6, 2 + adds r0, r4, r2 + ldrb r1, [r0] + movs r5, 0x2 + movs r3, 0x2 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _0805EA5A + adds r0, r6, 0 + eors r0, r5 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _0805E9F6 + movs r0, 0x5A + bl audio_play +_0805E9F6: + ldr r0, [r7] + ldr r1, [r0] + adds r1, r4, r1 + ldrb r0, [r1] + orrs r0, r5 + strb r0, [r1] + b _0805EA5A + .pool +_0805EA08: + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r0, [r0] + lsls r1, r6, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _0805EA34 + movs r0, 0x5A + bl m4aSongNumStop + b _0805EA5A + .pool +_0805EA34: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0805EA5A + ldr r1, [r4] + movs r0, 0x2 + eors r7, r0 + ldr r1, [r1] + lsls r0, r7, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0805EA5A + movs r0, 0x5A + bl m4aSongNumStop +_0805EA5A: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_805E990 + + thumb_func_start sub_805EA60 +sub_805EA60: @ 805EA60 + push {r4-r6,lr} + movs r0, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =0x020244d0 + ldr r0, [r5] + ldr r0, [r0] + lsls r1, r4, 2 + adds r1, r0 + ldrb r2, [r1] + movs r6, 0x3 + negs r6, r6 + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0805EAA2 + ldr r2, [r5] + movs r0, 0x2 + adds r1, r4, 0 + eors r1, r0 + ldr r0, [r2] + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1] +_0805EAA2: + movs r0, 0x5A + bl m4aSongNumStop + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805EA60 + + thumb_func_start sub_805EAB4 +sub_805EAB4: @ 805EAB4 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x39 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x3A + bl pokemon_getattr + adds r1, r0, 0 + lsls r4, 16 + asrs r4, 16 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_8075060 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_805EAB4 + + thumb_func_start sub_805EAE8 +sub_805EAE8: @ 805EAE8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0805EB7E + movs r0, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0x2 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r5, =0x0202406e + mov r1, r8 + lsls r0, r1, 1 + adds r0, r5 + ldrb r0, [r0] + bl pokemon_order_func + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r1, r9 + lsls r0, r1, 1 + adds r0, r5 + ldrb r0, [r0] + bl pokemon_order_func + lsls r0, 24 + lsrs r5, r0, 24 + movs r7, 0x64 + adds r0, r4, 0 + muls r0, r7 + ldr r6, =0x020244ec + adds r4, r0, r6 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _0805EB5A + adds r0, r4, 0 + mov r1, r8 + bl sub_805E990 +_0805EB5A: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0805EB7E + adds r0, r5, 0 + muls r0, r7 + adds r4, r0, r6 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _0805EB7E + adds r0, r4, 0 + mov r1, r9 + bl sub_805E990 +_0805EB7E: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805EAE8 + + thumb_func_start sub_805EB9C +sub_805EB9C: @ 805EB9C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + bge _0805EC6C + movs r0, 0x3 + mov r10, r8 + mov r1, r10 + ands r1, r0 + mov r10, r1 + movs r6, 0 + movs r2, 0x3F + negs r2, r2 + mov r9, r2 +_0805EBC8: + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _0805EC60 + ldr r4, =0x02020630 + ldr r0, =0x020241e4 + adds r3, r5, r0 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x1] + movs r7, 0x4 + negs r7, r7 + adds r2, r7, 0 + ands r1, r2 + mov r2, r10 + orrs r1, r2 + strb r1, [r0, 0x1] + mov r7, r8 + cmp r7, 0 + bne _0805EC3C + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r2, [r0, 0x4] + adds r2, r6, r2 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + strb r0, [r2, 0x6] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x3] + mov r2, r9 + ands r1, r2 + strb r1, [r0, 0x3] + b _0805EC60 + .pool +_0805EC3C: + ldrb r0, [r3] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + adds r0, r6, r0 + ldrb r1, [r0, 0x6] + movs r0, 0x1F + ands r1, r0 + lsls r1, 1 + ldrb r0, [r2, 0x3] + mov r3, r9 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x3] +_0805EC60: + adds r6, 0xC + adds r5, 0x1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r5, r0 + blt _0805EBC8 +_0805EC6C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805EB9C + + thumb_func_start sub_805EC84 +sub_805EC84: @ 805EC84 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =gUnknown_0831C6A0 + bl LoadCompressedObjectPic + movs r0, 0x1 + bl battle_get_side_with_given_state + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0831C6B0 + mov r8, r0 + adds r0, r5, 0 + movs r1, 0 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A5C6C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 8 + movs r0, 0xE8 + lsls r0, 13 + adds r2, r0 + asrs r2, 16 + mov r0, r8 + adds r1, r4, 0 + movs r3, 0xC8 + bl AddObjectToFront + ldr r6, =0x020244d0 + ldr r1, [r6] + ldr r2, [r1, 0x4] + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 2 + adds r2, r1, r2 + strb r0, [r2, 0x7] + ldr r7, =0x02020630 + ldr r0, [r6] + ldr r0, [r0, 0x4] + adds r1, r0 + ldrb r1, [r1, 0x7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r5, [r0, 0x2E] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0805ED56 + movs r0, 0x3 + bl battle_get_side_with_given_state + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r5, 0 + movs r1, 0 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A5C6C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 8 + movs r0, 0xE8 + lsls r0, 13 + adds r2, r0 + asrs r2, 16 + mov r0, r8 + adds r1, r4, 0 + movs r3, 0xC8 + bl AddObjectToFront + ldr r1, [r6] + ldr r2, [r1, 0x4] + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 2 + adds r2, r1, r2 + strb r0, [r2, 0x7] + ldr r0, [r6] + ldr r0, [r0, 0x4] + adds r1, r0 + ldrb r1, [r1, 0x7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r5, [r0, 0x2E] +_0805ED56: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805EC84 + + thumb_func_start sub_805ED70 +@ int sub_805ED70(obj *a1) +sub_805ED70: @ 805ED70 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + movs r0, 0 + mov r8, r0 + ldrh r0, [r5, 0x2E] + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x020241e4 + adds r0, r4, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r7, r0, r1 + adds r6, r7, 0 + adds r6, 0x3E + ldrb r1, [r6] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805EDAC + adds r0, r4, 0 + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + bne _0805EDC0 +_0805EDAC: + ldr r0, =sub_805EE48 + str r0, [r5, 0x1C] + b _0805EE36 + .pool +_0805EDC0: + ldr r0, =0x020383fd + ldrb r0, [r0] + cmp r0, 0 + bne _0805EDD2 + ldrb r1, [r6] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0805EDE4 +_0805EDD2: + movs r0, 0x1 + mov r8, r0 + ldr r2, =0x020244d0 + lsls r4, 2 + b _0805EE06 + .pool +_0805EDE4: + ldr r2, =0x020244d0 + ldr r0, [r2] + ldr r0, [r0] + lsls r1, r4, 2 + adds r3, r1, r0 + ldrh r0, [r3, 0x2] + adds r4, r1, 0 + cmp r0, 0 + beq _0805EE06 + ldr r0, =gUnknown_08305DCC + ldrh r1, [r3, 0x2] + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + bne _0805EE06 + movs r0, 0x1 + mov r8, r0 +_0805EE06: + ldr r0, [r2] + ldr r0, [r0] + adds r0, r4, r0 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0805EE1A + movs r0, 0x1 + mov r8, r0 +_0805EE1A: + ldrh r0, [r7, 0x20] + strh r0, [r5, 0x20] + ldrh r0, [r7, 0x24] + strh r0, [r5, 0x24] + adds r2, r5, 0 + adds r2, 0x3E + mov r0, r8 + lsls r3, r0, 2 + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + orrs r0, r3 + strb r0, [r2] +_0805EE36: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805ED70 + + thumb_func_start sub_805EE48 +sub_805EE48: @ 805EE48 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + bx lr + thumb_func_end sub_805EE48 + + thumb_func_start sub_805EE54 +sub_805EE54: @ 805EE54 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + lsls r1, 16 + lsrs r5, r1, 16 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0805EED0 + ldr r0, =0x020244d0 + ldr r3, [r0] + ldr r1, [r3] + lsls r0, r4, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + beq _0805EE7E + adds r5, r0, 0 +_0805EE7E: + ldr r0, =gUnknown_08305DCC + adds r0, r5, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _0805EEB4 + ldr r2, =0x02020630 + ldr r1, [r3, 0x4] + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_805ED70 + b _0805EECE + .pool +_0805EEB4: + ldr r2, =0x02020630 + ldr r1, [r3, 0x4] + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_805EE48 +_0805EECE: + str r1, [r0] +_0805EED0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805EE54 + + thumb_func_start sub_805EEE0 +sub_805EEE0: @ 805EEE0 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + ldr r1, =0x020244d0 + ldr r1, [r1] + ldr r3, [r1, 0x4] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r1, [r1, 0x7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_805EE48 + str r1, [r0] + bx lr + .pool + thumb_func_end sub_805EEE0 + + thumb_func_start sub_805EF14 +sub_805EF14: @ 805EF14 + push {r4-r6,lr} + ldr r3, =0x06000240 + movs r0, 0 + movs r6, 0xF0 + lsls r6, 8 +_0805EF1E: + adds r5, r0, 0x1 + movs r4, 0xF +_0805EF22: + ldrh r1, [r3] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _0805EF32 + adds r0, r6, 0 + orrs r0, r1 + strh r0, [r3] +_0805EF32: + ldrh r1, [r3] + movs r2, 0xF0 + lsls r2, 4 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _0805EF46 + adds r0, r2, 0 + orrs r0, r1 + strh r0, [r3] +_0805EF46: + ldrh r1, [r3] + movs r2, 0xF0 + movs r0, 0xF0 + ands r0, r1 + cmp r0, 0 + bne _0805EF58 + adds r0, r1, 0 + orrs r0, r2 + strh r0, [r3] +_0805EF58: + ldrh r1, [r3] + movs r2, 0xF + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + bne _0805EF6A + adds r0, r1, 0 + orrs r0, r2 + strh r0, [r3] +_0805EF6A: + adds r3, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _0805EF22 + adds r0, r5, 0 + cmp r0, 0x8 + ble _0805EF1E + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805EF14 + + thumb_func_start sub_805EF84 +sub_805EF84: @ 805EF84 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r2, [r0] + lsls r0, r4, 2 + adds r0, r2 + movs r3, 0 + movs r2, 0 + strh r2, [r0, 0x2] + ldr r0, =0x020244e4 + adds r0, r4, r0 + strb r3, [r0] + cmp r1, 0 + bne _0805EFAC + adds r0, r4, 0 + bl sub_805E974 +_0805EFAC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805EF84 + + thumb_func_start init_uns_table_pokemon_copy +init_uns_table_pokemon_copy: @ 805EFBC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r6, 0 + ldr r4, =0x020244d4 + str r6, [r4] + movs r0, 0xC0 + lsls r0, 1 + bl AllocZeroed + str r0, [r4] + movs r0, 0x80 + lsls r0, 8 + bl AllocZeroed + ldr r1, [r4] + str r0, [r1] +_0805EFE2: + ldr r0, =0x020244d4 + ldr r1, [r0] + lsls r4, r6, 2 + adds r2, r1, 0x4 + adds r2, r4 + lsls r3, r6, 13 + ldr r0, [r1] + adds r0, r3 + str r0, [r2] + lsls r3, r6, 1 + adds r0, r3, r6 + lsls r0, 3 + adds r1, r0, r1 + ldr r2, =gUnknown_08329D98 + adds r1, 0x14 + adds r0, r2 + ldm r0!, {r2,r5,r7} + stm r1!, {r2,r5,r7} + ldm r0!, {r2,r5,r7} + stm r1!, {r2,r5,r7} + movs r5, 0 + mov r9, r3 + lsls r0, r6, 5 + mov r8, r0 + adds r1, r6, 0x1 + mov r10, r1 + mov r12, r8 + adds r7, r4, 0 +_0805F01A: + ldr r2, =0x020244d4 + ldr r1, [r2] + lsls r4, r5, 3 + add r4, r12 + adds r3, r1, 0 + adds r3, 0x74 + adds r3, r4 + adds r0, r1, 0x4 + adds r0, r7 + lsls r2, r5, 11 + ldr r0, [r0] + adds r0, r2 + str r0, [r3] + adds r1, r4 + adds r1, 0x78 + movs r0, 0x80 + lsls r0, 4 + strh r0, [r1] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _0805F01A + ldr r1, =0x020244d4 + ldr r2, [r1] + mov r5, r9 + adds r0, r5, r6 + lsls r0, 3 + adds r1, r2, 0 + adds r1, 0x20 + adds r1, r0 + mov r0, r8 + adds r0, 0x74 + adds r2, r0 + str r2, [r1] + mov r7, r10 + lsls r0, r7, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _0805EFE2 + movs r0, 0x80 + lsls r0, 5 + bl AllocZeroed + ldr r1, =0x020244d4 + ldr r1, [r1] + movs r2, 0xBA + lsls r2, 1 + adds r1, r2 + str r0, [r1] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end init_uns_table_pokemon_copy + + thumb_func_start sub_805F094 +sub_805F094: @ 805F094 + push {r4-r6,lr} + ldr r6, =0x020244d4 + ldr r0, [r6] + cmp r0, 0 + beq _0805F106 + movs r1, 0xBE + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _0805F0BA + bl Free + ldr r0, [r6] + movs r1, 0xBE + lsls r1, 1 + adds r0, r1 + movs r1, 0 + str r1, [r0] +_0805F0BA: + ldr r0, [r6] + movs r1, 0xBC + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _0805F0D8 + bl Free + ldr r0, [r6] + movs r1, 0xBC + lsls r1, 1 + adds r0, r1 + movs r1, 0 + str r1, [r0] +_0805F0D8: + ldr r0, [r6] + movs r5, 0xBA + lsls r5, 1 + adds r0, r5 + ldr r0, [r0] + bl Free + ldr r0, [r6] + adds r5, r0, r5 + movs r4, 0 + str r4, [r5] + ldr r0, [r0] + bl Free + ldr r0, [r6] + str r4, [r0] + str r4, [r0, 0x4] + str r4, [r0, 0x8] + str r4, [r0, 0xC] + str r4, [r0, 0x10] + bl Free + str r4, [r6] +_0805F106: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805F094 + + thumb_func_start sub_805F110 +sub_805F110: @ 805F110 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x37 + bl pokemon_getattr + ldr r1, =0x00000fff + ands r1, r0 + cmp r1, 0 + bne _0805F158 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x3A + bl pokemon_getattr + adds r1, r0, 0 + lsls r4, 16 + asrs r4, 16 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_8075060 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + ble _0805F158 + movs r0, 0x1 + b _0805F15A + .pool +_0805F158: + movs r0, 0 +_0805F15A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_805F110 + + thumb_func_start nullsub_26 +nullsub_26: @ 805F160 + bx lr + thumb_func_end nullsub_26 + + thumb_func_start sub_805F164 +sub_805F164: @ 805F164 + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_exec_buffer_A_ch0_tbl7 + str r1, [r0] + bx lr + .pool + thumb_func_end sub_805F164 + + thumb_func_start bx_exec_buffer_A_ch0_tbl7 +bx_exec_buffer_A_ch0_tbl7: @ 805F180 + push {lr} + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldr r0, =0x02024064 + ldrb r3, [r0] + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0805F1CC + ldr r0, =0x02023064 + lsls r1, r3, 9 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x38 + bhi _0805F1C8 + ldr r0, =gUnknown_0831C6C8 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + b _0805F1CC + .pool +_0805F1C8: + bl dp01_tbl7_exec_completed +_0805F1CC: + pop {r0} + bx r0 + thumb_func_end bx_exec_buffer_A_ch0_tbl7 + + thumb_func_start sub_805F1D0 +sub_805F1D0: @ 805F1D0 + push {lr} + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + 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, =DummyObjectCallback + cmp r1, r0 + bne _0805F1F4 + bl dp01_tbl7_exec_completed +_0805F1F4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_805F1D0 + + thumb_func_start sub_805F208 +sub_805F208: @ 805F208 + push {lr} + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + 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, =DummyObjectCallback + cmp r1, r0 + bne _0805F22C + bl dp01_tbl7_exec_completed +_0805F22C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_805F208 + + thumb_func_start sub_805F240 +sub_805F240: @ 805F240 + push {r4-r6,lr} + ldr r5, =0x02020630 + ldr r6, =0x020241e4 + ldr r4, =0x02024064 + 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, =DummyObjectCallback + cmp r1, r0 + bne _0805F292 + 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 obj_free_rotscale_entry + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + bl dp01_tbl7_exec_completed +_0805F292: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805F240 + + thumb_func_start sub_805F2A8 +sub_805F2A8: @ 805F2A8 + push {r4,lr} + ldr r4, =0x020244d0 + ldr r1, [r4] + ldr r3, =0x02024064 + 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 _0805F2E0 + 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 dp01_tbl7_exec_completed +_0805F2E0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805F2A8 + + thumb_func_start sub_805F2F0 +sub_805F2F0: @ 805F2F0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r0, 0 + mov r10, r0 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0805F32C + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0805F31E + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0805F32C +_0805F31E: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0805F368 +_0805F32C: + ldr r2, =0x02020630 + ldr r1, =0x03005d70 + ldr r3, =0x02024064 + ldrb r0, [r3] + 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, =DummyObjectCallback + cmp r1, r0 + bne _0805F34E + movs r1, 0x1 + mov r10, r1 +_0805F34E: + movs r6, 0 + b _0805F3A2 + .pool +_0805F368: + ldr r3, =0x02020630 + ldr r6, =0x03005d70 + ldr r2, =0x02024064 + ldrb r4, [r2] + adds r0, r4, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, 0x1C + adds r0, r3 + ldr r5, [r0] + ldr r0, =DummyObjectCallback + cmp r5, r0 + bne _0805F3A0 + movs r0, 0x2 + eors r4, r0 + adds r0, r4, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + cmp r0, r5 + bne _0805F3A0 + movs r0, 0x1 + mov r10, r0 +_0805F3A0: + movs r6, 0x1 +_0805F3A2: + ldr r3, =0x020244d8 + ldr r1, =0x020244d0 + mov r8, r1 + ldr r2, [r1] + ldr r7, =0x02024064 + ldrb r1, [r7] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r5, [r2, 0x4] + adds r0, r5, r0 + str r0, [r3] + ldr r2, =0x020244dc + ldrb r0, [r7] + movs r1, 0x2 + mov r9, r1 + mov r1, r9 + eors r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r5, r0 + str r0, [r2] + mov r0, r10 + cmp r0, 0 + bne _0805F3D8 + b _0805F53C +_0805F3D8: + cmp r6, 0x1 + bne _0805F494 + ldrb r2, [r7] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r4, r0, r5 + ldrb r1, [r4, 0x1] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _0805F3F2 + b _0805F53C +_0805F3F2: + mov r0, r9 + eors r0, r2 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x1] + ands r6, r0 + cmp r6, 0 + bne _0805F408 + b _0805F53C +_0805F408: + ldrb r1, [r4] + movs r3, 0x7F + adds r0, r3, 0 + ands r0, r1 + strb r0, [r4] + mov r1, r8 + ldr r0, [r1] + 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 r4, 0x2 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1, 0x1] + mov r0, r8 + ldr r2, [r0] + ldrb r0, [r7] + mov r1, r9 + 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, r8 + ldr r2, [r1] + ldrb r0, [r7] + mov r1, r9 + 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 FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + b _0805F51A + .pool +_0805F494: + ldrb r2, [r7] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r0, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805F53C + adds r0, r2, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0805F4E4 + mov r0, r8 + ldr r2, [r0] + ldrb r0, [r7] + mov r1, r9 + eors r1, r0 + ldr r2, [r2, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + bne _0805F53C + ldr r4, =0x000027f9 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag +_0805F4E4: + mov r1, r8 + ldr r0, [r1] + ldr r1, =0x02024064 + ldrb r2, [r1] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x7F + ands r0, r2 + strb r0, [r1] + mov r1, r8 + ldr r0, [r1] + ldr r1, =0x02024064 + ldrb r2, [r1] + 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] +_0805F51A: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r3, =0x02024064 + 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, =0x03005d60 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805F2A8 + str r1, [r0] +_0805F53C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805F2F0 + + thumb_func_start sub_805F560 +sub_805F560: @ 805F560 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + mov r10, r0 + ldr r5, =0x020244d0 + ldr r0, [r5] + ldr r4, =0x02024064 + ldrb r2, [r4] + ldr r1, [r0, 0x4] + lsls r3, r2, 1 + adds r0, r3, r2 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0] + movs r6, 0xC4 + lsls r6, 1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _0805F5A6 + ldr r0, =0x0202406e + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_0805F5A6: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x00008040 + ands r0, r1 + cmp r0, 0 + bne _0805F5EE + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0805F5EE + 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 + ldrh r1, [r0] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _0805F5EE + ldr r0, =0x0202406e + adds r0, r2, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + adds r1, r0 + adds r0, r3, 0 + bl sub_8172EF0 +_0805F5EE: + ldr r2, =0x020244d0 + ldr r0, [r2] + ldr r1, =0x02024064 + mov r8, r1 + ldrb r4, [r1] + ldr r5, [r0, 0x4] + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r3, r0, r5 + ldrb r1, [r3] + movs r6, 0x8 + adds r0, r6, 0 + ands r0, r1 + mov r9, r2 + cmp r0, 0 + bne _0805F6D0 + movs r7, 0x2 + adds r1, r7, 0 + eors r1, r4 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r1, [r0] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _0805F6D0 + ldrb r1, [r3, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0805F6B4 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0805F684 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0805F684 + ldr r4, =0x03005d70 + mov r1, r8 + ldrb r0, [r1] + adds r1, r7, 0 + eors r1, r0 + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + mov r1, r8 + ldrb r0, [r1] + eors r0, r7 + bl sub_8076918 + mov r1, r8 + ldrb r0, [r1] + eors r0, r7 + adds r0, r4 + ldrb r0, [r0] + bl sub_80729D0 +_0805F684: + ldr r5, =0x03005d70 + ldr r4, =0x02024064 + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + 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 +_0805F6B4: + ldr r3, =0x020244d0 + ldr r2, [r3] + ldr r0, =0x02024064 + 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] + mov r9, r3 +_0805F6D0: + mov r1, r9 + ldr r0, [r1] + ldr r4, =0x02024064 + 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 _0805F792 + 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 _0805F792 + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + bne _0805F792 + mov r1, r9 + ldr r0, [r1] + ldrb r4, [r4] + ldr r1, [r0, 0x4] + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x1] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0805F774 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x42 + ands r0, r1 + cmp r0, 0x42 + bne _0805F768 + adds r0, r4, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0805F774 + ldr r0, =0x03007420 + bl m4aMPlayContinue + b _0805F774 + .pool +_0805F768: + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl +_0805F774: + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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 + str r0, [sp] +_0805F792: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0805F7B2 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0805F810 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0805F810 +_0805F7B2: + ldr r2, =0x02020630 + ldr r0, =0x03005d7c + ldr r1, =0x02024064 + 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, =DummyObjectCallback + cmp r3, r0 + bne _0805F86E + ldr r0, =0x020241e4 + 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 _0805F86E + movs r1, 0x1 + mov r10, r1 + b _0805F86E + .pool +_0805F810: + ldr r2, =0x02020630 + ldr r7, =0x03005d7c + ldr r0, =0x02024064 + 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, =DummyObjectCallback + cmp r4, r0 + bne _0805F86E + ldr r6, =0x020241e4 + 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 _0805F86E + 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 _0805F86E + 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 _0805F86E + movs r0, 0x1 + mov r10, r0 +_0805F86E: + ldr r1, [sp] + cmp r1, 0 + beq _0805F958 + mov r0, r10 + cmp r0, 0 + beq _0805F958 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0805F8D2 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0805F8D2 + ldr r1, =0x03005d7c + ldr r5, =0x02024064 + 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, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + ldrb r0, [r5] + eors r4, r0 + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_805EE54 +_0805F8D2: + ldr r1, =0x03005d7c + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + ldrb r5, [r4] + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl sub_805EE54 + ldr r3, =0x020244d0 + 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, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805F2F0 + str r1, [r0] +_0805F958: + 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_805F560 + + thumb_func_start sub_805F994 +sub_805F994: @ 805F994 + push {r4,r5,lr} + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + ldr r1, =0x02024064 + ldrb r3, [r1] + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x24 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0805F9E0 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r2, r3, 1 + adds r0, r2, r3 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + bne _0805F9E0 + ldr r0, =0x0202406e + adds r0, r2, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + adds r1, r0 + adds r0, r3, 0 + bl sub_8172EF0 +_0805F9E0: + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + ldr r5, =0x02024064 + ldrb r3, [r5] + 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, =DummyObjectCallback + cmp r1, r0 + bne _0805FA48 + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r1, [r0, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r2, r0, r1 + ldrb r1, [r2, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805FA48 + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + 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 FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + bl dp01_tbl7_exec_completed +_0805FA48: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805F994 + + thumb_func_start sub_805FA70 +sub_805FA70: @ 805FA70 + push {r4-r6,lr} + ldr r6, =0x02024064 + ldrb r0, [r6] + ldr r5, =0x03005d70 + 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 _0805FAB8 + ldrb r0, [r6] + adds r0, r5 + ldrb r0, [r0] + movs r2, 0 + bl heathbar_draw_hp + b _0805FABC + .pool +_0805FAB8: + bl dp01_tbl7_exec_completed +_0805FABC: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_805FA70 + + thumb_func_start sub_805FAC4 +sub_805FAC4: @ 805FAC4 + push {lr} + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + ldr r1, =0x02024064 + 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 _0805FAF2 + ldr r0, =0x03005d70 + adds r0, r3, r0 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl7_exec_completed +_0805FAF2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_805FAC4 + + thumb_func_start sub_805FB08 +sub_805FB08: @ 805FB08 + push {r4-r6,lr} + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r6, =0x02024064 + 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 _0805FB62 + ldr r5, =0x020241e4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldrb r0, [r6] + bl sub_805EEE0 + ldr r1, =0x03005d70 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl7_exec_completed +_0805FB62: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805FB08 + + thumb_func_start bx_t7_button_a +bx_t7_button_a: @ 805FB7C + push {lr} + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _0805FB8E + bl dp01_tbl7_exec_completed +_0805FB8E: + pop {r0} + bx r0 + thumb_func_end bx_t7_button_a + + thumb_func_start bx_blink_t7 +bx_blink_t7: @ 805FB94 + push {r4,lr} + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + ldr r2, =0x02020630 + 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 _0805FBE0 + 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, =0x020244b9 + strb r3, [r0] + bl dp01_tbl7_exec_completed + b _0805FC0A + .pool +_0805FBE0: + ldrh r0, [r4, 0x30] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0805FC04 + 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] +_0805FC04: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] +_0805FC0A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end bx_blink_t7 + + thumb_func_start sub_805FC10 +sub_805FC10: @ 805FC10 + push {r4,lr} + ldr r2, =0x02020630 + ldr r0, =0x03005d70 + ldr r4, =0x02024064 + 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, =DummyObjectCallback + cmp r1, r0 + bne _0805FC5C + ldr r0, =0x020244d0 + 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 _0805FC50 + adds r0, r3, 0 + adds r1, r3, 0 + adds r2, r3, 0 + movs r3, 0x6 + bl move_anim_start_t4 +_0805FC50: + ldr r0, =0x03005d60 + ldrb r1, [r4] + lsls r1, 2 + adds r1, r0 + ldr r0, =bx_803AEDC + str r0, [r1] +_0805FC5C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805FC10 + + thumb_func_start bx_803AEDC +bx_803AEDC: @ 805FC80 + push {r4,lr} + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r4, =0x02024064 + 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 _0805FCDA + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + bne _0805FCDA + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + 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, =DummyObjectCallback + cmp r1, r0 + beq _0805FCCA + ldr r0, =nullsub_18 + cmp r1, r0 + bne _0805FCDA +_0805FCCA: + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + bl dp01_tbl7_exec_completed +_0805FCDA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bx_803AEDC + + thumb_func_start sub_805FD00 +sub_805FD00: @ 805FD00 + push {r4-r7,lr} + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r5, =0x02024064 + 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 _0805FDBC + ldr r7, =0x02020630 + ldr r6, =0x020241e4 + 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, =DummyObjectCallback + cmp r1, r0 + bne _0805FDBC + 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 FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + 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 StartObjectImageAnim + ldr r4, =0x03005d70 + ldrb r1, [r5] + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + 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, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805FC10 + str r1, [r0] +_0805FDBC: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805FD00 + + thumb_func_start sub_805FDF0 +sub_805FDF0: @ 805FDF0 + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r0, [r6] + ldr r5, =0x02024064 + 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 _0805FE22 + ldr r0, =0x0202406e + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_0805FE22: + ldr r4, =0x02020630 + ldr r0, =0x03005d7c + 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, =DummyObjectCallback + cmp r1, r0 + bne _0805FE8C + 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 _0805FE8C + adds r0, r3, r4 + bl RemoveObjectAndFreeTiles + ldrb r4, [r5] + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_805EE54 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805FD00 + str r1, [r0] +_0805FE8C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_805FDF0 + + thumb_func_start sub_805FEB8 +sub_805FEB8: @ 805FEB8 + push {lr} + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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 _0805FEDA + bl dp01_tbl7_exec_completed +_0805FEDA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_805FEB8 + + thumb_func_start bx_803B0F4 +bx_803B0F4: @ 805FEE8 + push {lr} + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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 _0805FF0A + bl dp01_tbl7_exec_completed +_0805FF0A: + pop {r0} + bx r0 + .pool + thumb_func_end bx_803B0F4 + + thumb_func_start dp01_tbl7_exec_completed +dp01_tbl7_exec_completed: @ 805FF18 + push {r4,lr} + sub sp, 0x4 + ldr r1, =0x03005d60 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_exec_buffer_A_ch0_tbl7 + str r1, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0805FF6C + bl link_get_multiplayer_id + mov r1, sp + strb r0, [r1] + movs r0, 0x2 + movs r1, 0x4 + mov r2, sp + bl dp01_prepare_buffer_wireless_probably + ldr r1, =0x02023064 + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _0805FF7E + .pool +_0805FF6C: + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, [r2] + bics r0, r1 + str r0, [r2] +_0805FF7E: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_tbl7_exec_completed + + thumb_func_start dp01t_00_7_getattr +dp01t_00_7_getattr: @ 805FF90 + push {r4-r6,lr} + sub sp, 0x100 + movs r6, 0 + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _0805FFC8 + ldr r0, =0x0202406e + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + mov r1, sp + bl sub_8060004 + adds r6, r0, 0 + b _0805FFEA + .pool +_0805FFC8: + ldrb r4, [r1] + movs r5, 0 +_0805FFCC: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0805FFE2 + lsls r0, r5, 24 + lsrs r0, 24 + mov r2, sp + adds r1, r2, r6 + bl sub_8060004 + adds r6, r0 +_0805FFE2: + lsrs r4, 1 + adds r5, 0x1 + cmp r5, 0x5 + ble _0805FFCC +_0805FFEA: + lsls r1, r6, 16 + lsrs r1, 16 + movs r0, 0x1 + mov r2, sp + bl dp01_build_cmdbuf_x1D_1D_numargs_varargs + bl dp01_tbl7_exec_completed + add sp, 0x100 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end dp01t_00_7_getattr + + thumb_func_start sub_8060004 +sub_8060004: @ 8060004 + 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, =0x02023064 + ldr r3, =0x02024064 + ldrb r0, [r3] + lsls r0, 9 + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3B + bls _0806002E + bl _0806079A +_0806002E: + lsls r0, 2 + ldr r1, =_08060044 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08060044: + .4byte _08060134 + .4byte _08060358 + .4byte _08060368 + .4byte _08060378 + .4byte _080603E0 + .4byte _080603E0 + .4byte _080603E0 + .4byte _080603E0 + .4byte _080603FC + .4byte _08060438 + .4byte _08060438 + .4byte _08060438 + .4byte _08060438 + .4byte _0806079A + .4byte _0806079A + .4byte _0806079A + .4byte _0806079A + .4byte _08060454 + .4byte _08060464 + .4byte _08060494 + .4byte _080604A4 + .4byte _080604B4 + .4byte _080604C4 + .4byte _080604D4 + .4byte _080604E4 + .4byte _080604F4 + .4byte _08060504 + .4byte _08060514 + .4byte _08060524 + .4byte _08060534 + .4byte _08060544 + .4byte _08060554 + .4byte _080605A4 + .4byte _080605B4 + .4byte _080605C4 + .4byte _080605D4 + .4byte _080605E4 + .4byte _080605F4 + .4byte _08060604 + .4byte _08060614 + .4byte _08060624 + .4byte _08060658 + .4byte _08060668 + .4byte _08060678 + .4byte _08060688 + .4byte _08060698 + .4byte _080606A8 + .4byte _080606B8 + .4byte _080606C8 + .4byte _080606E8 + .4byte _080606F8 + .4byte _08060708 + .4byte _08060718 + .4byte _08060728 + .4byte _08060738 + .4byte _08060748 + .4byte _08060758 + .4byte _08060768 + .4byte _08060778 + .4byte _08060788 +_08060134: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + mov r1, sp + strh r0, [r1] + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + 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 +_08060180: + adds r1, r6, 0 + adds r1, 0xD + mov r0, r8 + bl pokemon_getattr + strh r0, [r4] + adds r1, r6, 0 + adds r1, 0x11 + mov r0, r8 + bl pokemon_getattr + mov r2, r9 + adds r1, r2, r6 + strb r0, [r1] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _08060180 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r10 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + ldr r2, [sp, 0x80] + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x19 + bl pokemon_getattr + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + str r0, [sp, 0x48] + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + str r0, [sp, 0x4C] + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + ldr r1, [sp, 0x7C] + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x28] + adds r0, r4, 0 + movs r1, 0x3A + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2C] + adds r0, r4, 0 + movs r1, 0x3B + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2] + adds r0, r4, 0 + movs r1, 0x3C + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x4] + adds r0, r4, 0 + movs r1, 0x3D + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x6] + adds r0, r4, 0 + movs r1, 0x3E + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x8] + adds r0, r4, 0 + movs r1, 0x3F + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0xA] + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + str r0, [sp, 0x54] + adds r0, r4, 0 + movs r1, 0x2 + ldr r2, [sp, 0x8C] + bl pokemon_getattr + ldr r0, [sp, 0x84] + ldr r1, [sp, 0x8C] + bl CopyString_Limit10 + adds r0, r4, 0 + movs r1, 0x7 + ldr r2, [sp, 0x88] + bl pokemon_getattr + mov r2, sp + movs r6, 0 +_08060338: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0x57 + bls _08060338 + b _0806079A + .pool +_08060358: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + b _080606D2 + .pool +_08060368: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xC + b _080606D2 + .pool +_08060378: + 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, =0x02024744 + adds r4, r1, r0 + mov r8, r9 +_0806038E: + adds r1, r6, 0 + adds r1, 0xD + adds r0, r4, 0 + bl pokemon_getattr + mov r1, r8 + strh r0, [r1] + adds r1, r6, 0 + adds r1, 0x11 + adds r0, r4, 0 + bl pokemon_getattr + mov r2, r10 + adds r1, r2, r6 + strb r0, [r1] + movs r0, 0x2 + add r8, r0 + adds r6, 0x1 + cmp r6, 0x3 + ble _0806038E + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r9 + strb r0, [r1, 0xC] + mov r2, r9 + movs r6, 0 +_080603CC: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0xF + bls _080603CC + b _0806079A + .pool +_080603E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x9 + b _080606D2 + .pool +_080603FC: + movs r6, 0 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r2, =0x02024744 + mov r8, r2 +_08060408: + adds r1, r6, 0 + adds r1, 0x11 + mov r2, r8 + adds r0, r4, r2 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + cmp r6, 0x3 + ble _08060408 + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + b _0806079A + .pool +_08060438: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x8 + b _08060792 + .pool +_08060454: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1 + b _0806046E + .pool +_08060464: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x19 +_0806046E: + bl pokemon_getattr + 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 _0806079A + .pool +_08060494: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1A + b _08060792 + .pool +_080604A4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1B + b _08060792 + .pool +_080604B4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1C + b _08060792 + .pool +_080604C4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1D + b _08060792 + .pool +_080604D4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1E + b _08060792 + .pool +_080604E4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1F + b _08060792 + .pool +_080604F4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x20 + b _08060792 + .pool +_08060504: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x22 + b _08060792 + .pool +_08060514: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x23 + b _08060792 + .pool +_08060524: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x24 + b _08060792 + .pool +_08060534: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x25 + b _08060792 + .pool +_08060544: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x26 + b _08060792 + .pool +_08060554: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_getattr + strb r0, [r7] + adds r0, r4, 0 + movs r1, 0x28 + bl pokemon_getattr + strb r0, [r7, 0x1] + adds r0, r4, 0 + movs r1, 0x29 + bl pokemon_getattr + strb r0, [r7, 0x2] + adds r0, r4, 0 + movs r1, 0x2A + bl pokemon_getattr + strb r0, [r7, 0x3] + adds r0, r4, 0 + movs r1, 0x2B + bl pokemon_getattr + strb r0, [r7, 0x4] + adds r0, r4, 0 + movs r1, 0x2C + bl pokemon_getattr + strb r0, [r7, 0x5] + movs r6, 0x6 + b _0806079A + .pool +_080605A4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x27 + b _08060792 + .pool +_080605B4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x28 + b _08060792 + .pool +_080605C4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x29 + b _08060792 + .pool +_080605D4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2A + b _08060792 + .pool +_080605E4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2B + b _08060792 + .pool +_080605F4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2C + b _08060792 + .pool +_08060604: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0 + b _0806062E + .pool +_08060614: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x9 + b _080606D2 + .pool +_08060624: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x37 +_0806062E: + bl pokemon_getattr + 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 _0806079A + .pool +_08060658: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x38 + b _08060792 + .pool +_08060668: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x39 + b _080606D2 + .pool +_08060678: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3A + b _080606D2 + .pool +_08060688: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3B + b _080606D2 + .pool +_08060698: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3C + b _080606D2 + .pool +_080606A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3D + b _080606D2 + .pool +_080606B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3E + b _080606D2 + .pool +_080606C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3F +_080606D2: + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + strb r0, [r7] + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r6, 0x2 + b _0806079A + .pool +_080606E8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x16 + b _08060792 + .pool +_080606F8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x17 + b _08060792 + .pool +_08060708: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x18 + b _08060792 + .pool +_08060718: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x21 + b _08060792 + .pool +_08060728: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2F + b _08060792 + .pool +_08060738: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x30 + b _08060792 + .pool +_08060748: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x32 + b _08060792 + .pool +_08060758: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x33 + b _08060792 + .pool +_08060768: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x34 + b _08060792 + .pool +_08060778: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x35 + b _08060792 + .pool +_08060788: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x36 +_08060792: + bl pokemon_getattr + strb r0, [r7] + movs r6, 0x1 +_0806079A: + 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_8060004 + + thumb_func_start dp01t_01_2_read_pokmon_data_slice +dp01t_01_2_read_pokmon_data_slice: @ 80607B0 + push {r4-r7,lr} + sub sp, 0x58 + ldr r2, =0x0202406e + ldr r5, =0x02024064 + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + adds r4, r2, 0 + muls r4, r0 + ldr r3, =0x02023064 + lsls r1, 9 + adds r0, r3, 0x1 + adds r0, r1, r0 + ldrb r2, [r0] + ldr r0, =0x02024744 + adds r0, r2, r0 + adds r6, r4, r0 + mov r0, sp + adds r4, r0, r2 + movs r2, 0 + adds r0, r3, 0x2 + adds r1, r0 + adds r7, r5, 0 + mov r12, r3 + ldrb r1, [r1] + cmp r2, r1 + bcs _08060806 + adds r3, r0, 0 +_080607EC: + adds r1, r4, r2 + adds r0, r6, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + ldrb r0, [r5] + lsls r0, 9 + adds r0, r3 + ldrb r0, [r0] + cmp r2, r0 + bcc _080607EC +_08060806: + ldrb r0, [r7] + lsls r0, 9 + mov r1, r12 + adds r1, 0x2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + adds r2, r4, 0 + bl dp01_build_cmdbuf_x1D_1D_numargs_varargs + bl dp01_tbl7_exec_completed + add sp, 0x58 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_01_2_read_pokmon_data_slice + + thumb_func_start dp01t_02_7_setattr +dp01t_02_7_setattr: @ 8060838 + push {r4,r5,lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _08060868 + ldr r0, =0x0202406e + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + bl sub_8060890 + b _08060886 + .pool +_08060868: + ldrb r4, [r1] + movs r5, 0 +_0806086C: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0806087A + adds r0, r5, 0 + bl sub_8060890 +_0806087A: + lsrs r4, 1 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _0806086C +_08060886: + bl dp01_tbl7_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end dp01t_02_7_setattr + + thumb_func_start sub_8060890 +sub_8060890: @ 8060890 + 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, =0x02024064 + ldrb r0, [r3] + lsls r0, 9 + ldr r2, =0x02023067 + 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 _080608BE + bl _0806119C +_080608BE: + lsls r0, 2 + ldr r1, =_080608D4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080608D4: + .4byte _080609C4 + .4byte _08060B5C + .4byte _08060B78 + .4byte _08060B94 + .4byte _08060BE8 + .4byte _08060BE8 + .4byte _08060BE8 + .4byte _08060BE8 + .4byte _08060C08 + .4byte _08060C70 + .4byte _08060C70 + .4byte _08060C70 + .4byte _08060C70 + .4byte _0806119C + .4byte _0806119C + .4byte _0806119C + .4byte _0806119C + .4byte _08060C98 + .4byte _08060CB4 + .4byte _08060CD0 + .4byte _08060CEC + .4byte _08060D08 + .4byte _08060D24 + .4byte _08060D40 + .4byte _08060D5C + .4byte _08060D78 + .4byte _08060D94 + .4byte _08060DB0 + .4byte _08060DCC + .4byte _08060DE8 + .4byte _08060E04 + .4byte _08060E20 + .4byte _08060E94 + .4byte _08060EB0 + .4byte _08060ECC + .4byte _08060EE8 + .4byte _08060F04 + .4byte _08060F20 + .4byte _08060F3C + .4byte _08060F58 + .4byte _08060F74 + .4byte _08060F90 + .4byte _08060FAC + .4byte _08060FC8 + .4byte _08060FE4 + .4byte _08061000 + .4byte _0806101C + .4byte _08061038 + .4byte _08061054 + .4byte _08061070 + .4byte _0806108C + .4byte _080610A8 + .4byte _080610C4 + .4byte _080610E0 + .4byte _080610FC + .4byte _08061118 + .4byte _08061134 + .4byte _08061150 + .4byte _0806116C + .4byte _08061188 +_080609C4: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + adds r2, r7, 0 + bl pokemon_setattr + adds r2, r7, 0 + adds r2, 0x2E + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + 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 +_08060A2A: + mov r1, r8 + adds r1, 0xD + mov r0, r9 + adds r2, r4, 0 + bl pokemon_setattr + mov r1, r8 + adds r1, 0x11 + mov r0, r9 + adds r2, r6, 0 + bl pokemon_setattr + adds r6, 0x1 + adds r4, 0x2 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x3 + ble _08060A2A + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + mov r2, r10 + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x20 + ldr r2, [sp, 0x20] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x19 + ldr r2, [sp, 0x28] + bl pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + adds r0, r4, 0 + movs r1, 0 + ldr r2, [sp, 0x2C] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x37 + ldr r2, [sp, 0x30] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x38 + ldr r2, [sp, 0x1C] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x39 + ldr r2, [sp, 0x18] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3A + ldr r2, [sp, 0x24] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3B + ldr r2, [sp, 0x4] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3C + ldr r2, [sp, 0x8] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3D + ldr r2, [sp, 0xC] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3E + ldr r2, [sp, 0x10] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3F + ldr r2, [sp, 0x14] + bl pokemon_setattr + b _0806119C + .pool +_08060B5C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0xB + bl pokemon_setattr + b _0806119C + .pool +_08060B78: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0xC + bl pokemon_setattr + b _0806119C + .pool +_08060B94: + 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, =0x02024744 + adds r7, r1, r0 + adds r6, r4, 0 + adds r6, 0x8 +_08060BAC: + mov r1, r8 + adds r1, 0xD + adds r0, r7, 0 + adds r2, r4, 0 + bl pokemon_setattr + mov r1, r8 + adds r1, 0x11 + adds r0, r7, 0 + adds r2, r6, 0 + bl pokemon_setattr + adds r6, 0x1 + adds r4, 0x2 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x3 + ble _08060BAC + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x15 + mov r2, r9 + bl pokemon_setattr + b _0806119C + .pool +_08060BE8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldr r3, =0x02023064 + ldrb r2, [r6] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x9 + b _08060C86 + .pool +_08060C08: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + adds r0, r4, 0 + movs r1, 0x11 + str r3, [sp, 0x34] + bl pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + b _0806119C + .pool +_08060C70: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldr r3, =0x02023064 + ldrb r2, [r6] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x8 +_08060C86: + adds r3, 0x3 + adds r2, r3 + bl pokemon_setattr + b _0806119C + .pool +_08060C98: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1 + bl pokemon_setattr + b _0806119C + .pool +_08060CB4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x19 + bl pokemon_setattr + b _0806119C + .pool +_08060CD0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1A + bl pokemon_setattr + b _0806119C + .pool +_08060CEC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1B + bl pokemon_setattr + b _0806119C + .pool +_08060D08: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1C + bl pokemon_setattr + b _0806119C + .pool +_08060D24: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1D + bl pokemon_setattr + b _0806119C + .pool +_08060D40: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1E + bl pokemon_setattr + b _0806119C + .pool +_08060D5C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1F + bl pokemon_setattr + b _0806119C + .pool +_08060D78: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x20 + bl pokemon_setattr + b _0806119C + .pool +_08060D94: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x22 + bl pokemon_setattr + b _0806119C + .pool +_08060DB0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x23 + bl pokemon_setattr + b _0806119C + .pool +_08060DCC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x24 + bl pokemon_setattr + b _0806119C + .pool +_08060DE8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x25 + bl pokemon_setattr + b _0806119C + .pool +_08060E04: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x26 + bl pokemon_setattr + b _0806119C + .pool +_08060E20: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + adds r0, r4, 0 + movs r1, 0x27 + str r3, [sp, 0x34] + bl pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x5 + adds r2, r0 + adds r0, r4, 0 + b _08060F2E + .pool +_08060E94: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x27 + bl pokemon_setattr + b _0806119C + .pool +_08060EB0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x28 + bl pokemon_setattr + b _0806119C + .pool +_08060ECC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x29 + bl pokemon_setattr + b _0806119C + .pool +_08060EE8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2A + bl pokemon_setattr + b _0806119C + .pool +_08060F04: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2B + bl pokemon_setattr + b _0806119C + .pool +_08060F20: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 +_08060F2E: + movs r1, 0x2C + bl pokemon_setattr + b _0806119C + .pool +_08060F3C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0 + bl pokemon_setattr + b _0806119C + .pool +_08060F58: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x9 + bl pokemon_setattr + b _0806119C + .pool +_08060F74: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x37 + bl pokemon_setattr + b _0806119C + .pool +_08060F90: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x38 + bl pokemon_setattr + b _0806119C + .pool +_08060FAC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x39 + bl pokemon_setattr + b _0806119C + .pool +_08060FC8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3A + bl pokemon_setattr + b _0806119C + .pool +_08060FE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3B + bl pokemon_setattr + b _0806119C + .pool +_08061000: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3C + bl pokemon_setattr + b _0806119C + .pool +_0806101C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3D + bl pokemon_setattr + b _0806119C + .pool +_08061038: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3E + bl pokemon_setattr + b _0806119C + .pool +_08061054: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3F + bl pokemon_setattr + b _0806119C + .pool +_08061070: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x16 + bl pokemon_setattr + b _0806119C + .pool +_0806108C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x17 + bl pokemon_setattr + b _0806119C + .pool +_080610A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x18 + bl pokemon_setattr + b _0806119C + .pool +_080610C4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x21 + bl pokemon_setattr + b _0806119C + .pool +_080610E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2F + bl pokemon_setattr + b _0806119C + .pool +_080610FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x30 + bl pokemon_setattr + b _0806119C + .pool +_08061118: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x32 + bl pokemon_setattr + b _0806119C + .pool +_08061134: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x33 + bl pokemon_setattr + b _0806119C + .pool +_08061150: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x34 + bl pokemon_setattr + b _0806119C + .pool +_0806116C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x35 + bl pokemon_setattr + b _0806119C + .pool +_08061188: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x36 + bl pokemon_setattr +_0806119C: + 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 sub_8060890 + + thumb_func_start sub_80611B0 +sub_80611B0: @ 80611B0 + push {r4-r7,lr} + ldr r1, =0x0202406e + ldr r7, =0x02024064 + 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, =0x02023064 + lsls r2, 9 + adds r0, r4, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + ldr r1, =0x02024744 + adds r0, r1 + adds r5, r3, r0 + movs r3, 0 + adds r0, r4, 0x2 + adds r2, r0 + ldrb r2, [r2] + cmp r3, r2 + bcs _08061208 + adds r6, r4, 0 + adds r2, r7, 0 + adds r4, r0, 0 +_080611E6: + 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 _080611E6 +_08061208: + bl dp01_tbl7_exec_completed + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80611B0 + + thumb_func_start sub_8061224 +sub_8061224: @ 8061224 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r6, =0x02024064 + ldrb r0, [r6] + lsls r0, 1 + ldr r1, =0x0202406e + adds r0, r1 + ldrh r0, [r0] + movs r7, 0x64 + muls r0, r7 + ldr r2, =0x02024744 + mov r10, r2 + add r0, r10 + movs r1, 0xB + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldrb r1, [r6] + lsls r0, r1, 1 + ldr r2, =0x0202406e + adds r0, r2 + ldrh r0, [r0] + muls r0, r7 + add r0, r10 + bl sub_805DC0C + ldrb r0, [r6] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl sub_806A068 + ldr r0, =0x0202499c + mov r9, 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, r9 + adds r1, r5, 0 + adds r2, r4, 0 + bl AddObjectToFront + ldr r4, =0x020241e4 + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r5, =0x02020630 + 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 r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r1, r8 + strh r1, [r0, 0x32] + 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, =0x020244e4 + adds r2, r1 + ldrb r1, [r2] + bl StartObjectImageAnim + ldrb r4, [r6] + lsls r0, r4, 1 + ldr r2, =0x0202406e + adds r0, r2 + ldrh r0, [r0] + muls r0, r7 + add r0, r10 + movs r1, 0xB + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_805EE54 + ldr r1, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805F994 + 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_8061224 + + thumb_func_start sub_806137C +sub_806137C: @ 806137C + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + adds r0, 0x5C + movs r1, 0x6 + strb r1, [r0] + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r2, r0, 1 + adds r2, r1 + ldr r3, =0x02023064 + 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_80613DC + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805FDF0 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806137C + + thumb_func_start sub_80613DC +sub_80613DC: @ 80613DC + 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, =0x0202406e + lsls r4, r6, 1 + adds r4, r0 + ldr r0, =0x02023064 + 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, =0x02024744 + adds r0, r5 + movs r1, 0xB + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, =sub_805D714 + bl object_new_hidden_with_callback + ldr r1, =0x03005d7c + 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 battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl sub_806A068 + ldr r0, =0x0202499c + 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 AddObjectToFront + ldr r4, =0x020241e4 + adds r4, r6, r4 + strb r0, [r4] + ldr r5, =0x02020630 + 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] + 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 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, =0x020244e4 + adds r6, r1 + ldrb r1, [r6] + bl StartObjectImageAnim + 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, =DummyObjectCallback + 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_80613DC + + thumb_func_start sub_806156C +sub_806156C: @ 806156C + push {r4-r6,lr} + ldr r1, =0x02023064 + ldr r6, =0x02024064 + ldrb r2, [r6] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r3, [r0] + cmp r3, 0 + bne _080615B4 + ldr r0, =0x020244d0 + 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, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8061604 + str r1, [r0] + b _080615F0 + .pool +_080615B4: + ldr r5, =0x020241e4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldrb r0, [r6] + bl sub_805EEE0 + ldr r1, =0x03005d70 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl7_exec_completed +_080615F0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806156C + + thumb_func_start sub_8061604 +sub_8061604: @ 8061604 + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r4, [r6] + ldr r5, =0x02024064 + 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 _0806162C + cmp r0, 0x1 + beq _0806165A + b _08061682 + .pool +_0806162C: + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08061646 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_08061646: + 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 _08061682 +_0806165A: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08061682 + 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, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805FB08 + str r1, [r0] +_08061682: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8061604 + + thumb_func_start sub_8061690 +sub_8061690: @ 8061690 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =0x02022fec + ldr r2, [r0] + movs r0, 0x80 + lsls r0, 20 + ands r0, r2 + cmp r0, 0 + beq _080616B0 + bl sub_806B830 + b _0806175A + .pool +_080616B0: + ldr r3, =0x02038bca + ldrh r1, [r3] + ldr r0, =0x000003fe + cmp r1, r0 + bne _080616C8 + bl sub_81A4CB0 + b _0806175A + .pool +_080616C8: + movs r0, 0x80 + lsls r0, 19 + ands r0, r2 + cmp r0, 0 + beq _08061708 + movs r0, 0x80 + lsls r0, 8 + ands r2, r0 + cmp r2, 0 + beq _08061700 + ldr r0, =0x02024064 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080616F0 + ldrh r0, [r3] + bl sub_81D5588 + b _0806175A + .pool +_080616F0: + ldr r0, =0x02038bcc + ldrh r0, [r0] + bl sub_81D5588 + b _0806175A + .pool +_08061700: + ldrh r0, [r3] + bl sub_81D5588 + b _0806175A +_08061708: + ldr r0, =0x003f0100 + ands r0, r2 + cmp r0, 0 + beq _0806174C + ldr r0, =0x00808000 + ands r2, r0 + cmp r2, 0 + beq _08061744 + ldr r0, =0x02024064 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08061734 + ldrh r0, [r3] + bl sub_8162AA0 + b _0806175A + .pool +_08061734: + ldr r0, =0x02038bcc + ldrh r0, [r0] + bl sub_8162AA0 + b _0806175A + .pool +_08061744: + ldrh r0, [r3] + bl sub_8162AA0 + b _0806175A +_0806174C: + movs r0, 0x80 + lsls r0, 4 + ands r0, r2 + cmp r0, 0 + beq _08061760 + bl sub_8165244 +_0806175A: + lsls r0, 24 + lsrs r4, r0, 24 + b _08061796 +_08061760: + movs r0, 0x80 + lsls r0, 8 + ands r2, r0 + cmp r2, 0 + beq _08061788 + ldr r0, =0x02024064 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08061788 + ldr r2, =gTrainers + ldr r0, =0x02038bcc + ldrh r1, [r0] + b _0806178C + .pool +_08061788: + ldr r2, =gTrainers + ldrh r1, [r3] +_0806178C: + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r4, [r0, 0x3] +_08061796: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x00008040 + ands r0, r1 + cmp r0, 0 + beq _080617C8 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_get_per_side_status + movs r1, 0x2 + ands r1, r0 + movs r7, 0xC8 + cmp r1, 0 + beq _080617CA + movs r7, 0x98 + b _080617CA + .pool +_080617C8: + movs r7, 0xB0 +_080617CA: + mov r8, r4 + ldr r5, =0x02024064 + ldrb r1, [r5] + mov r0, r8 + bl sub_805DF38 + ldrb r0, [r5] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl template_build_for_pokemon_or_trainer + ldr r6, =0x0202499c + 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 AddObjectToFront + ldr r6, =0x020241e4 + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, =0x02020630 + 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 IndexOfObjectPaletteTag + 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, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805F1D0 + str r1, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8061690 + + thumb_func_start sub_80618D8 +sub_80618D8: @ 80618D8 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =0x02022fec + ldr r2, [r0] + movs r0, 0x80 + lsls r0, 20 + ands r0, r2 + cmp r0, 0 + beq _080618F8 + bl sub_806B830 + b _080619A2 + .pool +_080618F8: + ldr r3, =0x02038bca + ldrh r1, [r3] + ldr r0, =0x000003fe + cmp r1, r0 + bne _08061910 + bl sub_81A4CB0 + b _080619A2 + .pool +_08061910: + movs r0, 0x80 + lsls r0, 19 + ands r0, r2 + cmp r0, 0 + beq _08061950 + movs r0, 0x80 + lsls r0, 8 + ands r2, r0 + cmp r2, 0 + beq _08061948 + ldr r0, =0x02024064 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08061938 + ldrh r0, [r3] + bl sub_81D5588 + b _080619A2 + .pool +_08061938: + ldr r0, =0x02038bcc + ldrh r0, [r0] + bl sub_81D5588 + b _080619A2 + .pool +_08061948: + ldrh r0, [r3] + bl sub_81D5588 + b _080619A2 +_08061950: + ldr r0, =0x003f0100 + ands r0, r2 + cmp r0, 0 + beq _08061994 + ldr r0, =0x00808000 + ands r2, r0 + cmp r2, 0 + beq _0806198C + ldr r0, =0x02024064 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0806197C + ldrh r0, [r3] + bl sub_8162AA0 + b _080619A2 + .pool +_0806197C: + ldr r0, =0x02038bcc + ldrh r0, [r0] + bl sub_8162AA0 + b _080619A2 + .pool +_0806198C: + ldrh r0, [r3] + bl sub_8162AA0 + b _080619A2 +_08061994: + movs r0, 0x80 + lsls r0, 4 + ands r0, r2 + cmp r0, 0 + beq _080619A8 + bl sub_8165244 +_080619A2: + lsls r0, 24 + lsrs r0, 24 + b _080619DE +_080619A8: + movs r0, 0x80 + lsls r0, 8 + ands r2, r0 + cmp r2, 0 + beq _080619D0 + ldr r0, =0x02024064 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080619D0 + ldr r2, =gTrainers + ldr r0, =0x02038bcc + ldrh r1, [r0] + b _080619D4 + .pool +_080619D0: + ldr r2, =gTrainers + ldrh r1, [r3] +_080619D4: + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x3] +_080619DE: + mov r8, r0 + ldr r6, =0x02024064 + ldrb r1, [r6] + bl sub_805DF38 + ldrb r0, [r6] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl template_build_for_pokemon_or_trainer + ldr r0, =0x0202499c + ldr r2, =gUnknown_083054E0 + mov r3, r8 + lsls r1, r3, 2 + adds r1, r2 + ldrb r1, [r1] + movs r2, 0x8 + subs r2, r1 + lsls r2, 18 + movs r1, 0xA0 + lsls r1, 14 + adds r2, r1 + asrs r2, 16 + movs r1, 0xB0 + movs r3, 0x1E + bl AddObjectToFront + ldr r5, =0x020241e4 + ldrb r1, [r6] + adds r1, r5 + strb r0, [r1] + ldr r4, =0x02020630 + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x60 + strh r1, [r0, 0x24] + 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, 0x20] + adds r1, 0x20 + strh r1, [r0, 0x20] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000fffe + strh r1, [r0, 0x2E] + ldr r1, =gTrainerFrontPicPaletteTable + mov r2, r8 + lsls r0, r2, 3 + adds r0, r1 + ldrh r0, [r0, 0x4] + bl IndexOfObjectPaletteTag + ldrb r1, [r6] + adds r1, r5 + 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, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + mov r3, r8 + strh r3, [r0, 0x6] + ldrb r0, [r6] + adds r0, r5 + 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, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805F208 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80618D8 + + thumb_func_start sub_8061AF0 +sub_8061AF0: @ 8061AF0 + push {r4-r6,lr} + ldr r6, =0x020241e4 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =0x02020630 + 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, =DummyObjectCallback + bl oamt_set_x3A_32 + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805F240 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8061AF0 + + thumb_func_start sub_8061B9C +sub_8061B9C: @ 8061B9C + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r4, [r6] + ldr r5, =0x02024064 + 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 _08061BF0 + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08061BD0 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_08061BD0: + 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 _08061C2C + .pool +_08061BF0: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08061C2C + strb r0, [r3, 0x4] + movs r0, 0x10 + movs r1, 0x3F + bl audio_play_and_stuff + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + 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, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805FAC4 + str r1, [r0] +_08061C2C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8061B9C + + thumb_func_start sub_8061C48 +sub_8061C48: @ 8061C48 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8061C48 + + thumb_func_start sub_8061C54 +sub_8061C54: @ 8061C54 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8061C54 + + thumb_func_start sub_8061C60 +sub_8061C60: @ 8061C60 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8061C60 + + thumb_func_start sub_8061C6C +sub_8061C6C: @ 8061C6C + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8061C6C + + thumb_func_start sub_8061C78 +sub_8061C78: @ 8061C78 + push {r4-r6,lr} + ldr r6, =0x02024064 + ldrb r0, [r6] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + beq _08061C8A + b _08061D9E +_08061C8A: + ldr r0, =0x02023064 + 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, =0x02038432 + mov r1, r12 + adds r1, 0x3 + adds r2, r1 + ldrb r1, [r2] + strb r1, [r5] + ldr r4, =0x02038408 + 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, =0x02038404 + 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, =0x0203841a + ldrb r1, [r6] + lsls r1, 9 + mov r2, r12 + adds r2, 0xA + adds r1, r2 + ldrb r1, [r1] + strb r1, [r3] + ldr r4, =0x0203841c + 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, =0x02038400 + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0x10 + adds r2, r1 + str r2, [r3] + ldr r3, =0x020244bc + 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 _08061D80 + bl dp01_tbl7_exec_completed + b _08061D9E + .pool +_08061D80: + ldr r0, =0x020244d0 + 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, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_move_anim_7 + str r1, [r0] +_08061D9E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8061C78 + + thumb_func_start bx_move_anim_7 +bx_move_anim_7: @ 8061DB0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r2, =0x02023064 + ldr r6, =0x02024064 + 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, =0x020244d0 + 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 _08061E48 + cmp r2, 0x1 + bgt _08061E08 + cmp r2, 0 + beq _08061E12 + b _08061F24 + .pool +_08061E08: + cmp r2, 0x2 + beq _08061E72 + cmp r2, 0x3 + beq _08061EE8 + b _08061F24 +_08061E12: + ldr r1, [r5] + lsls r0, r3, 2 + adds r1, r0, r1 + ldrb r2, [r1] + movs r0, 0xC + ands r0, r2 + cmp r0, 0x4 + bne _08061E34 + 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 +_08061E34: + 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 _08061F24 +_08061E48: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08061F24 + 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 _08061F24 +_08061E72: + ldr r0, =0x020383f8 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =0x020383fd + ldrb r0, [r0] + cmp r0, 0 + bne _08061F24 + 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 _08061EC0 + mov r0, r8 + cmp r0, 0x1 + bhi _08061EC0 + 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] +_08061EC0: + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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 _08061F24 + .pool +_08061EE8: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _08061F24 + 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 dp01_tbl7_exec_completed +_08061F24: + 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_7 + + thumb_func_start sub_8061F34 +sub_8061F34: @ 8061F34 + push {r4,r5,lr} + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r5, =0x02024064 + ldrb r4, [r5] + lsls r4, 9 + ldr r0, =0x02023066 + adds r4, r0 + ldrh r0, [r4] + bl battle_pick_message + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_t7_button_a + str r1, [r0] + ldrb r0, [r5] + ldrh r1, [r4] + bl sub_81A57E4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8061F34 + + thumb_func_start sub_8061F90 +sub_8061F90: @ 8061F90 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8061F90 + + thumb_func_start sub_8061F9C +sub_8061F9C: @ 8061F9C + push {lr} + bl sub_8063880 + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8061F9C + + thumb_func_start sub_8061FAC +sub_8061FAC: @ 8061FAC + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8061FAC + + thumb_func_start sub_8061FB8 +sub_8061FB8: @ 8061FB8 + push {r4-r6,lr} + ldr r0, =0x02022fec + ldr r2, [r0] + movs r0, 0x80 + lsls r0, 10 + ands r0, r2 + cmp r0, 0 + beq _08061FE4 + bl sub_805D19C + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x1 + movs r1, 0xA +_08061FD6: + bl dp01_build_cmdbuf_x21_a_bb +_08061FDA: + bl dp01_tbl7_exec_completed + b _08062156 + .pool +_08061FE4: + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + ldr r1, =0x02023068 + adds r5, r0, r1 + movs r0, 0x93 + lsls r0, 3 + ands r2, r0 + cmp r2, 0 + beq _080620C4 + movs r0, 0xF + bl sub_8130950 + bl sub_8130BA4 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + beq _08062022 + cmp r4, 0x5 + bgt _0806201C + cmp r4, 0x4 + beq _08062028 + b _08062040 + .pool +_0806201C: + cmp r4, 0x6 + beq _08062030 + b _08062040 +_08062022: + movs r0, 0x1 + movs r1, 0x4 + b _0806202C +_08062028: + movs r0, 0x1 + movs r1, 0x3 +_0806202C: + movs r2, 0 + b _08061FD6 +_08062030: + ldr r0, =0x0202420c + ldrb r2, [r0] + movs r0, 0x1 + movs r1, 0xF + b _08061FD6 + .pool +_08062040: + ldr r3, =gBattleMoves + lsls r0, r4, 1 + adds r2, r5, r0 + ldrh r1, [r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0, 0x6] + movs r0, 0x12 + ands r0, r1 + cmp r0, 0 + beq _08062062 + ldr r0, =0x0202420c + ldr r1, =0x02024064 + ldrb r1, [r1] + strb r1, [r0] +_08062062: + ldrh r1, [r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0, 0x6] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0806209C + movs r0, 0 + bl battle_get_side_with_given_state + ldr r5, =0x0202420c + strb r0, [r5] + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _0806209C + movs r0, 0x2 + bl battle_get_side_with_given_state + strb r0, [r5] +_0806209C: + ldr r0, =0x0202420c + ldrb r0, [r0] + lsls r0, 8 + orrs r4, r0 + movs r0, 0x1 + movs r1, 0xA + adds r2, r4, 0 + bl dp01_build_cmdbuf_x21_a_bb + b _08061FDA + .pool +_080620C4: + movs r6, 0x3 +_080620C6: + bl GenerateRandomNumber + adds r4, r0, 0 + ands r4, r6 + lsls r0, r4, 1 + adds r0, r5, r0 + ldrh r2, [r0] + cmp r2, 0 + beq _080620C6 + ldr r1, =gBattleMoves + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x6] + movs r0, 0x12 + ands r0, r1 + cmp r0, 0 + beq _08062108 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 8 + orrs r4, r0 + movs r0, 0x1 + movs r1, 0xA + adds r2, r4, 0 + bl dp01_build_cmdbuf_x21_a_bb + b _08062152 + .pool +_08062108: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0806213C + bl GenerateRandomNumber + movs r1, 0x2 + ands r1, r0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r1, 0 + bl battle_get_side_with_given_state + 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 + b _08062152 + .pool +_0806213C: + movs r0, 0 + bl battle_get_side_with_given_state + 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 +_08062152: + bl dp01_tbl7_exec_completed +_08062156: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8061FB8 + + thumb_func_start sub_806215C +sub_806215C: @ 806215C + push {lr} + ldr r0, =0x02024064 + ldrb r0, [r0] + lsrs r0, 1 + ldr r1, =0x0202449c + ldr r1, [r1] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC0 + ldrb r1, [r0] + movs r0, 0x1 + bl dp01_build_cmdbuf_x23_aa_0 + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_806215C + + thumb_func_start sub_8062188 +sub_8062188: @ 8062188 + push {r4-r7,lr} + ldr r0, =0x02024064 + ldrb r0, [r0] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + movs r2, 0xA5 + lsls r2, 2 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x6 + bne _08062254 + bl sub_8063A90 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bne _0806225A + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080621D4 + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r5, r0, 24 + adds r7, r5, 0 + b _080621E8 + .pool +_080621D4: + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0x3 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r5, r0, 24 +_080621E8: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x00808000 + ands r0, r1 + cmp r0, 0 + beq _08062214 + ldr r0, =0x02024064 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08062210 + movs r0, 0 + movs r6, 0x3 + b _08062218 + .pool +_08062210: + movs r0, 0x3 + b _08062216 +_08062214: + movs r0, 0 +_08062216: + movs r6, 0x6 +_08062218: + adds r4, r0, 0 + b _0806221E +_0806221C: + adds r4, 0x1 +_0806221E: + cmp r4, r6 + bge _0806225A + movs r0, 0x64 + muls r0, r4 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _0806221C + ldr r1, =0x0202406e + lsls r0, r7, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + beq _0806221C + lsls r0, r5, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + beq _0806221C + b _0806225A + .pool +_08062254: + ldrb r4, [r1] + movs r0, 0x6 + strb r0, [r1] +_0806225A: + ldr r0, =0x02024064 + ldrb r0, [r0] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + adds r0, 0x5C + strb r4, [r0] + lsls r1, r4, 24 + lsrs r1, 24 + movs r0, 0x1 + movs r2, 0 + bl dp01_build_cmdbuf_x22_a_three_bytes + bl dp01_tbl7_exec_completed + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8062188 + + thumb_func_start sub_8062288 +sub_8062288: @ 8062288 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8062288 + + thumb_func_start sub_8062294 +sub_8062294: @ 8062294 + 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, =0x02023064 + ldr r0, =0x02024064 + mov r9, r0 + ldrb r4, [r0] + lsls r2, r4, 9 + adds r0, r3, 0x3 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r1, 8 + adds r3, 0x2 + adds r2, r3 + ldrb r0, [r2] + orrs r0, r1 + lsls r0, 16 + asrs r7, r0, 16 + ldr r0, =0x00007fff + cmp r7, r0 + beq _08062324 + ldr r6, =0x0202406e + lsls r0, r4, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x02024744 + adds r0, r4 + movs r1, 0x3A + bl pokemon_getattr + 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 pokemon_getattr + adds r3, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, =0x03005d70 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + mov r2, r8 + bl sub_807294C + b _0806234E + .pool +_08062324: + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3A + bl pokemon_getattr + adds r2, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, =0x03005d70 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + movs r3, 0 + bl sub_807294C +_0806234E: + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805FA70 + 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_8062294 + + thumb_func_start sub_8062384 +sub_8062384: @ 8062384 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8062384 + + thumb_func_start sub_8062390 +sub_8062390: @ 8062390 + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _080623E4 + ldr r0, =0x03005d70 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + adds r1, r2 + movs r2, 0x9 + bl healthbar_draw_field_maybe + ldrb r2, [r4] + ldr r0, =0x020244d0 + 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, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805FEB8 + str r1, [r0] +_080623E4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8062390 + + thumb_func_start sub_8062408 +sub_8062408: @ 8062408 + push {r4,r5,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _08062458 + ldr r4, =0x02023064 + 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, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805FEB8 + str r1, [r0] +_08062458: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8062408 + + thumb_func_start sub_8062470 +sub_8062470: @ 8062470 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8062470 + + thumb_func_start sub_806247C +sub_806247C: @ 806247C + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_806247C + + thumb_func_start sub_8062488 +sub_8062488: @ 8062488 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8062488 + + thumb_func_start sub_8062494 +sub_8062494: @ 8062494 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8062494 + + thumb_func_start sub_80624A0 +sub_80624A0: @ 80624A0 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_80624A0 + + thumb_func_start sub_80624AC +sub_80624AC: @ 80624AC + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_80624AC + + thumb_func_start sub_80624B8 +sub_80624B8: @ 80624B8 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_80624B8 + + thumb_func_start sub_80624C4 +sub_80624C4: @ 80624C4 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_80624C4 + + thumb_func_start sub_80624D0 +sub_80624D0: @ 80624D0 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_80624D0 + + thumb_func_start sub_80624DC +sub_80624DC: @ 80624DC + push {lr} + ldr r2, =0x02022d0c + ldrb r1, [r2] + movs r0, 0x80 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_80624DC + + thumb_func_start sub_80624F8 +sub_80624F8: @ 80624F8 + push {lr} + ldr r3, =0x02022d0c + ldr r1, =0x02023064 + ldr r0, =0x02024064 + 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 dp01_tbl7_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_80624F8 + + thumb_func_start sub_8062530 +sub_8062530: @ 8062530 + push {lr} + ldr r2, =0x02022d0c + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_8062530 + + thumb_func_start sub_8062548 +sub_8062548: @ 8062548 + push {lr} + ldr r3, =0x02022d0c + 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 dp01_tbl7_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_8062548 + + thumb_func_start dp01t_29_7_blink +dp01t_29_7_blink: @ 8062570 + push {r4,lr} + ldr r3, =0x02020630 + ldr r2, =0x020241e4 + ldr r4, =0x02024064 + 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 _080625A4 + bl dp01_tbl7_exec_completed + b _080625CE + .pool +_080625A4: + ldr r1, =0x020244b9 + 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, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_blink_t7 + str r1, [r0] +_080625CE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_29_7_blink + + thumb_func_start sub_80625E0 +sub_80625E0: @ 80625E0 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_80625E0 + + thumb_func_start sub_80625EC +sub_80625EC: @ 80625EC + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + movs r3, 0x3F + cmp r0, 0 + bne _08062600 + movs r3, 0xC0 +_08062600: + ldr r2, =0x02023064 + 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 audio_play_and_stuff + bl dp01_tbl7_exec_completed + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80625EC + + thumb_func_start sub_8062630 +sub_8062630: @ 8062630 + push {r4,r5,lr} + ldr r4, =0x02023064 + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r3, r0, 9 + adds r0, r4, 0x3 + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _0806266C + 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 song_play_for_text + b _08062680 + .pool +_0806266C: + 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 fanfare_play +_08062680: + bl dp01_tbl7_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8062630 + + thumb_func_start sub_806268C +sub_806268C: @ 806268C + push {lr} + ldr r1, =0x0202406e + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x19 + movs r2, 0x5 + bl sub_80A32E4 + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_806268C + + thumb_func_start dp01t_2E_7_battle_intro +dp01t_2E_7_battle_intro: @ 80626C8 + push {lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, =0x020243fc + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_2E_7_battle_intro + + thumb_func_start sub_80626FC +sub_80626FC: @ 80626FC + push {r4-r6,lr} + ldr r5, =0x020241e4 + ldr r6, =0x02024064 + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + 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_806280C + bl oamt_set_x3A_32 + ldr r0, =sub_8062828 + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + ldrb r0, [r6] + strh r0, [r1, 0x8] + ldr r3, =0x020244d0 + 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 _080627BE + ldr r0, =0x020244b4 + 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] +_080627BE: + ldr r0, [r3] + ldr r2, [r0, 0x8] + ldrb r0, [r2, 0x9] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] + ldr r1, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =nullsub_26 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80626FC + + thumb_func_start sub_806280C +sub_806280C: @ 806280C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x6] + bl sub_805DFE4 + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_806280C + + thumb_func_start sub_8062828 +sub_8062828: @ 8062828 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r7, =0x02024064 + ldrb r0, [r7] + mov r9, r0 + ldr r1, =0x03005e00 + 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 _0806286C + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0806286C + movs r0, 0x80 + lsls r0, 8 + ands r1, r0 + cmp r1, 0 + beq _080628A0 +_0806286C: + ldr r0, =0x02023064 + ldrb r1, [r7] + lsls r2, r1, 9 + adds r0, 0x1 + adds r2, r0 + ldr r0, =0x0202406e + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + strb r0, [r2] + ldrb r0, [r7] + movs r1, 0 + bl sub_80613DC + b _080628E0 + .pool +_080628A0: + ldr r4, =0x02023064 + ldrb r0, [r7] + lsls r1, r0, 9 + adds r4, 0x1 + adds r1, r4 + ldr r6, =0x0202406e + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + movs r1, 0 + bl sub_80613DC + 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_80613DC + ldrb r0, [r7] + eors r0, r5 + strb r0, [r7] +_080628E0: + ldr r1, =0x03005d60 + ldr r2, =0x02024064 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_805F560 + 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 sub_8062828 + + thumb_func_start dp01t_30_7_0803D67C +dp01t_30_7_0803D67C: @ 8062918 + push {r4-r7,lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08062948 + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08062948 + bl dp01_tbl7_exec_completed + b _08062A12 + .pool +_08062948: + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r3, =0x02024064 + 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, =0x02023064 + ldrb r2, [r3] + lsls r0, r2, 9 + adds r1, 0x2 + adds r0, r1 + ldrb r0, [r0] + adds r7, r3, 0 + cmp r0, 0 + beq _080629B4 + 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 _080629AC + 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 _08062A12 + .pool +_080629AC: + movs r0, 0x1F + negs r0, r0 + ands r0, r2 + strb r0, [r3, 0x1] +_080629B4: + adds r5, r7, 0 + ldrb r0, [r5] + lsls r3, r0, 9 + ldr r4, =0x02023068 + 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, =0x020244b4 + ldrb r1, [r5] + adds r1, r2 + movs r3, 0 + strb r0, [r1] + ldr r6, =0x020244d0 + 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 _08062A06 + 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] +_08062A06: + ldr r0, =0x03005d60 + ldrb r1, [r7] + lsls r1, 2 + adds r1, r0 + ldr r0, =bx_0803D790_t7 + str r0, [r1] +_08062A12: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_30_7_0803D67C + + thumb_func_start bx_0803D790_t7 +bx_0803D790_t7: @ 8062A2C + push {r4,lr} + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r3, =0x02024064 + 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 _08062A64 + 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 dp01_tbl7_exec_completed +_08062A64: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end bx_0803D790_t7 + + thumb_func_start sub_8062A74 +sub_8062A74: @ 8062A74 + push {lr} + ldr r0, =0x020244d0 + ldr r1, [r0] + ldr r0, =0x02024064 + 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 _08062AA6 + ldr r2, =0x03005e00 + ldr r0, =0x020244b4 + 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] +_08062AA6: + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_8062A74 + + thumb_func_start sub_8062AC4 +sub_8062AC4: @ 8062AC4 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8062AC4 + + thumb_func_start sub_8062AD0 +sub_8062AD0: @ 8062AD0 + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _08062B16 + ldr r3, =0x02020630 + ldr r0, =0x020241e4 + 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, =0x02023064 + 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 +_08062B16: + bl dp01_tbl7_exec_completed + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8062AD0 + + thumb_func_start dp01t_34_7_move_anim_start_t3 +dp01t_34_7_move_anim_start_t3: @ 8062B30 + push {r4-r6,lr} + sub sp, 0x4 + ldr r6, =0x02024064 + ldrb r0, [r6] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _08062B88 + ldr r5, =0x02023064 + 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 _08062B7C + bl dp01_tbl7_exec_completed + b _08062B88 + .pool +_08062B7C: + ldr r0, =0x03005d60 + ldrb r1, [r6] + lsls r1, 2 + adds r1, r0 + ldr r0, =bx_803B0F4 + str r0, [r1] +_08062B88: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_34_7_move_anim_start_t3 + + thumb_func_start sub_8062B98 +sub_8062B98: @ 8062B98 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8062B98 + + thumb_func_start sub_8062BA4 +sub_8062BA4: @ 8062BA4 + push {lr} + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8062BA4 + + thumb_func_start sub_8062BB0 +sub_8062BB0: @ 8062BB0 + push {lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x6 + ands r0, r1 + cmp r0, 0x2 + bne _08062BDA + ldr r2, =0x030022c0 + ldr r0, =0x00000439 + adds r3, r2, r0 + ldrb r1, [r3] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + ldr r0, =0x03005d00 + ldr r0, [r0] + str r0, [r2] + ldr r0, [r2, 0x8] + bl SetMainCallback2 +_08062BDA: + bl dp01_tbl7_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_8062BB0 + + thumb_func_start nullsub_91 +nullsub_91: @ 8062BF4 + bx lr + thumb_func_end nullsub_91 + + thumb_func_start ai_switch_perish_song +ai_switch_perish_song: @ 8062BF8 + push {lr} + ldr r1, =0x020242ac + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08062C50 + ldr r0, =0x020242bc + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xF] + lsls r0, 28 + cmp r0, 0 + bne _08062C50 + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, r2, r0 + movs r1, 0xA5 + lsls r1, 2 + adds r0, r1 + movs r1, 0x6 + strb r1, [r0] + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + movs r0, 0x1 + b _08062C52 + .pool +_08062C50: + movs r0, 0 +_08062C52: + pop {r1} + bx r1 + thumb_func_end ai_switch_perish_song + + thumb_func_start sub_8062C58 +sub_8062C58: @ 8062C58 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08062C72 + b _08062E2C +_08062C72: + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_get_per_side_status + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r4, =0x02024084 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x58 + muls r0, r1 + adds r0, r4 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x19 + beq _08062C9E + b _08062E2C +_08062C9E: + mov r0, r10 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r2, r0, 24 + movs r6, 0 + mov r8, r4 + movs r7, 0x58 + adds r0, r2, 0 + muls r0, r7 + adds r4, r0, r4 + movs r0, 0x20 + adds r0, r4 + mov r9, r0 +_08062CBA: + lsls r1, r6, 1 + ldr r5, =0x02024064 + ldrb r0, [r5] + muls r0, r7 + adds r1, r0 + mov r0, r8 + adds r0, 0xC + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _08062CE8 + ldrh r1, [r4] + mov r3, r9 + ldrb r2, [r3] + bl ai_rate_move + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0x2 + ands r1, r0 + cmp r1, 0 + beq _08062CE8 + b _08062E2C +_08062CE8: + adds r6, 0x1 + cmp r6, 0x3 + ble _08062CBA + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x00808000 + ands r0, r1 + cmp r0, 0 + beq _08062D50 + ldrb r1, [r5] + movs r0, 0x2 + ands r0, r1 + adds r1, r5, 0 + cmp r0, 0 + bne _08062D20 + movs r4, 0 + movs r0, 0x3 + str r0, [sp] + b _08062D58 + .pool +_08062D20: + movs r4, 0x3 + movs r3, 0x6 + str r3, [sp] + b _08062D58 +_08062D28: + ldr r0, =0x02024064 + ldrb r0, [r0] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + movs r1, 0xA5 + lsls r1, 2 + adds r0, r1 + strb r6, [r0] + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + movs r0, 0x1 + b _08062E2E + .pool +_08062D50: + movs r4, 0 + movs r3, 0x6 + str r3, [sp] + adds r1, r5, 0 +_08062D58: + ldrb r0, [r1] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x02024744 + mov r9, r1 + cmp r0, 0 + bne _08062D6C + ldr r3, =0x020244ec + mov r9, r3 +_08062D6C: + adds r6, r4, 0 + ldr r0, [sp] + cmp r6, r0 + bge _08062E2C +_08062D74: + movs r0, 0x64 + adds r5, r6, 0 + muls r5, r0 + mov r1, r9 + adds r4, r1, r5 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08062E24 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _08062E24 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _08062E24 + ldr r1, =0x0202406e + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r6, r0 + beq _08062E24 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + adds r0, r4, 0 + movs r1, 0x2E + bl pokemon_getattr + mov r0, r10 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r2, r0, 24 + movs r4, 0 + mov r8, r5 + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r2 + adds r5, r0, r1 + adds r7, r5, 0 + adds r7, 0x20 +_08062DE0: + adds r1, r4, 0 + adds r1, 0xD + mov r0, r9 + add r0, r8 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _08062E1E + ldrh r1, [r5] + ldrb r2, [r7] + bl ai_rate_move + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0x2 + ands r1, r0 + cmp r1, 0 + beq _08062E1E + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _08062D28 +_08062E1E: + adds r4, 0x1 + cmp r4, 0x3 + ble _08062DE0 +_08062E24: + adds r6, 0x1 + ldr r3, [sp] + cmp r6, r3 + blt _08062D74 +_08062E2C: + movs r0, 0 +_08062E2E: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8062C58 + + thumb_func_start sub_8062E54 +sub_8062E54: @ 8062E54 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r0, 0x1 + bl ai_has_super_effective_move_on_field + lsls r0, 24 + cmp r0, 0 + beq _08062E82 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + beq _08062E82 + b _080630AC +_08062E82: + ldr r1, =0x02024250 + ldr r5, =0x02024064 + ldrb r3, [r5] + lsls r0, r3, 1 + adds r4, r0, r1 + ldrh r1, [r4] + cmp r1, 0 + bne _08062E94 + b _080630AC +_08062E94: + ldr r0, =0x0000ffff + cmp r1, r0 + bne _08062E9C + b _080630AC +_08062E9C: + ldr r2, =gBattleMoves + ldrh r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _08062EB0 + b _080630AC +_08062EB0: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08062F1A + mov r8, r3 + mov r0, r8 + bl battle_get_per_side_status + movs r4, 0x2 + eors r0, r4 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + ldr r1, =0x02024210 + ldrb r1, [r1] + ldr r2, =gUnknown_0832A328 + lsls r0, 24 + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08062F04 + ldrb r7, [r5] + b _08062F1E + .pool +_08062F04: + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r4 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r7, r0, 24 + b _08062F1E +_08062F1A: + adds r7, r3, 0 + mov r8, r7 +_08062F1E: + ldr r3, =gBattleMoves + ldr r1, =0x02024250 + ldr r2, =0x02024064 + ldrb r0, [r2] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x2] + cmp r0, 0xA + bne _08062F4C + movs r0, 0x12 + b _08062F5E + .pool +_08062F4C: + cmp r0, 0xB + bne _08062F56 + movs r1, 0xB + str r1, [sp] + b _08062F60 +_08062F56: + cmp r0, 0xD + beq _08062F5C + b _080630AC +_08062F5C: + movs r0, 0xA +_08062F5E: + str r0, [sp] +_08062F60: + ldr r1, =0x02024084 + ldrb r3, [r2] + movs r0, 0x58 + muls r0, r3 + adds r0, r1 + adds r0, 0x20 + ldrb r0, [r0] + ldr r1, [sp] + cmp r0, r1 + bne _08062F76 + b _080630AC +_08062F76: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x00808000 + ands r0, r1 + cmp r0, 0 + beq _08062FCC + movs r0, 0x2 + ands r3, r0 + cmp r3, 0 + bne _08062F9C + movs r4, 0 + movs r0, 0x3 + b _08062FD0 + .pool +_08062F9C: + movs r4, 0x3 + movs r1, 0x6 + mov r10, r1 + b _08062FD2 +_08062FA4: + ldr r0, =0x02024064 + ldrb r0, [r0] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + movs r2, 0xA5 + lsls r2, 2 + adds r0, r2 + strb r5, [r0] + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + movs r0, 0x1 + b _080630AE + .pool +_08062FCC: + movs r4, 0 + movs r0, 0x6 +_08062FD0: + mov r10, r0 +_08062FD2: + ldrb r0, [r2] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x02024744 + str r1, [sp, 0x4] + cmp r0, 0 + bne _08062FE6 + ldr r2, =0x020244ec + str r2, [sp, 0x4] +_08062FE6: + adds r5, r4, 0 + cmp r5, r10 + bge _080630AC + ldr r0, =gBaseStats + mov r9, r0 +_08062FF0: + movs r0, 0x64 + muls r0, r5 + ldr r1, [sp, 0x4] + adds r6, r1, r0 + adds r0, r6, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _080630A6 + adds r0, r6, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _080630A6 + adds r0, r6, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _080630A6 + ldr r1, =0x0202406e + mov r2, r8 + lsls r0, r2, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r5, r0 + beq _080630A6 + lsls r0, r7, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r5, r0 + beq _080630A6 + ldr r0, =0x0202449c + ldr r1, [r0] + adds r0, r2, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r5, r0 + beq _080630A6 + adds r0, r7, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r5, r0 + beq _080630A6 + adds r0, r6, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r6, 0 + movs r1, 0x2E + bl pokemon_getattr + cmp r0, 0 + beq _08063088 + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + add r0, r9 + ldrb r0, [r0, 0x17] + b _08063092 + .pool +_08063088: + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + add r0, r9 + ldrb r0, [r0, 0x16] +_08063092: + ldr r1, [sp] + cmp r1, r0 + bne _080630A6 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _080630A6 + b _08062FA4 +_080630A6: + adds r5, 0x1 + cmp r5, r10 + blt _08062FF0 +_080630AC: + movs r0, 0 +_080630AE: + 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_8062E54 + + thumb_func_start ai_switchout_natural_cure +ai_switchout_natural_cure: @ 80630C0 + push {r4,r5,lr} + ldr r3, =0x02024084 + ldr r5, =0x02024064 + ldrb r4, [r5] + movs r0, 0x58 + adds r2, r4, 0 + muls r2, r0 + adds r0, r3, 0 + adds r0, 0x4C + adds r0, r2, r0 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08063188 + adds r1, r2, r3 + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0x1E + bne _08063188 + ldrh r0, [r1, 0x2C] + ldrh r1, [r1, 0x28] + lsrs r0, 1 + cmp r1, r0 + bcc _08063188 + ldr r1, =0x02024250 + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + cmp r1, 0 + beq _08063106 + ldr r0, =0x0000ffff + cmp r1, r0 + bne _08063128 +_08063106: + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _08063128 + ldrb r0, [r5] + b _08063190 + .pool +_08063128: + ldr r2, =gBattleMoves + ldr r1, =0x02024250 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _08063160 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _08063160 + ldrb r0, [r4] + b _08063190 + .pool +_08063160: + movs r0, 0x8 + movs r1, 0x1 + bl ai_switchout_something + lsls r0, 24 + cmp r0, 0 + bne _080631AA + movs r0, 0x4 + movs r1, 0x1 + bl ai_switchout_something + lsls r0, 24 + cmp r0, 0 + bne _080631AA + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + bne _0806318C +_08063188: + movs r0, 0 + b _080631AC +_0806318C: + ldr r0, =0x02024064 + ldrb r0, [r0] +_08063190: + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + movs r1, 0xA5 + lsls r1, 2 + adds r0, r1 + movs r1, 0x6 + strb r1, [r0] + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb +_080631AA: + movs r0, 0x1 +_080631AC: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end ai_switchout_natural_cure + + thumb_func_start ai_has_super_effective_move_on_field +ai_has_super_effective_move_on_field: @ 80631BC + 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 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_get_per_side_status + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + lsls r0, r3, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08063256 + movs r4, 0 + ldr r6, =0x02024084 + movs r7, 0x58 + adds r0, r3, 0 + muls r0, r7 + adds r5, r0, r6 + movs r0, 0x20 + adds r0, r5 + mov r8, r0 +_0806320A: + lsls r1, r4, 1 + ldr r0, =0x02024064 + ldrb r0, [r0] + muls r0, r7 + adds r1, r0 + adds r0, r6, 0 + adds r0, 0xC + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _08063250 + ldrh r1, [r5] + mov r3, r8 + ldrb r2, [r3] + bl ai_rate_move + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0x2 + ands r1, r0 + cmp r1, 0 + beq _08063250 + mov r0, r9 + cmp r0, 0 + bne _08063278 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _08063278 +_08063250: + adds r4, 0x1 + cmp r4, 0x3 + ble _0806320A +_08063256: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0806327C + b _080632FA + .pool +_08063278: + movs r0, 0x1 + b _080632FC +_0806327C: + movs r1, 0x2 + mov r0, r10 + eors r0, r1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + lsls r0, r3, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _080632FA + movs r4, 0 + ldr r6, =0x02024084 + movs r7, 0x58 + adds r0, r3, 0 + muls r0, r7 + adds r5, r0, r6 + movs r3, 0x20 + adds r3, r5 + mov r8, r3 +_080632AE: + lsls r1, r4, 1 + ldr r0, =0x02024064 + ldrb r0, [r0] + muls r0, r7 + adds r1, r0 + adds r0, r6, 0 + adds r0, 0xC + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _080632F4 + ldrh r1, [r5] + mov r3, r8 + ldrb r2, [r3] + bl ai_rate_move + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0x2 + ands r1, r0 + cmp r1, 0 + beq _080632F4 + mov r0, r9 + cmp r0, 0 + bne _08063278 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _08063278 +_080632F4: + adds r4, 0x1 + cmp r4, 0x3 + ble _080632AE +_080632FA: + movs r0, 0 +_080632FC: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end ai_has_super_effective_move_on_field + + thumb_func_start ai_is_too_invested_in_stat_buffs +ai_is_too_invested_in_stat_buffs: @ 806331C + push {r4,lr} + movs r4, 0 + ldr r1, =0x02024084 + ldr r0, =0x02024064 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x18 + adds r2, r0, r1 + movs r3, 0x7 +_08063330: + ldrb r1, [r2] + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r0, 0x6 + ble _08063346 + subs r1, 0x6 + lsls r0, r4, 24 + asrs r0, 24 + adds r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 +_08063346: + adds r2, 0x1 + subs r3, 0x1 + cmp r3, 0 + bge _08063330 + movs r0, 0 + cmp r4, 0x3 + bls _08063356 + movs r0, 0x1 +_08063356: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end ai_is_too_invested_in_stat_buffs + + thumb_func_start ai_switchout_something +ai_switchout_something: @ 8063364 + 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 r1, 24 + str r1, [sp, 0x4] + ldr r2, =0x02024250 + ldr r1, =0x02024064 + ldrb r3, [r1] + lsls r0, r3, 1 + adds r4, r0, r2 + ldrh r2, [r4] + adds r5, r1, 0 + cmp r2, 0 + bne _08063390 + b _080635EE +_08063390: + ldr r0, =0x0000ffff + cmp r2, r0 + bne _08063398 + b _080635EE +_08063398: + ldr r0, =0x02024270 + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080633A4 + b _080635EE +_080633A4: + ldr r2, =gBattleMoves + ldrh r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _080633B8 + b _080635EE +_080633B8: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0806342C + mov r9, r3 + mov r0, r9 + bl battle_get_per_side_status + movs r4, 0x2 + eors r0, r4 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + ldr r1, =0x02024210 + ldrb r1, [r1] + ldr r2, =gUnknown_0832A328 + lsls r0, 24 + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08063414 + ldrb r5, [r5] + mov r10, r5 + b _08063430 + .pool +_08063414: + ldrb r0, [r5] + bl battle_get_per_side_status + eors r0, r4 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + b _08063430 +_0806342C: + mov r9, r3 + mov r10, r9 +_08063430: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x00808000 + ands r0, r1 + cmp r0, 0 + beq _08063490 + ldr r2, =0x02024064 + ldrb r1, [r2] + movs r0, 0x2 + ands r0, r1 + adds r5, r2, 0 + cmp r0, 0 + bne _08063460 + movs r4, 0 + movs r0, 0x3 + str r0, [sp, 0x8] + b _08063498 + .pool +_08063460: + movs r4, 0x3 + movs r1, 0x6 + str r1, [sp, 0x8] + b _08063498 +_08063468: + ldr r0, =0x02024064 + ldrb r0, [r0] + ldr r1, =0x0202449c + ldr r1, [r1] + adds r0, r1 + movs r2, 0xA5 + lsls r2, 2 + adds r0, r2 + strb r6, [r0] + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + movs r0, 0x1 + b _080635F0 + .pool +_08063490: + movs r4, 0 + movs r0, 0x6 + str r0, [sp, 0x8] + ldr r5, =0x02024064 +_08063498: + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x02024744 + str r1, [sp, 0xC] + cmp r0, 0 + bne _080634AC + ldr r2, =0x020244ec + str r2, [sp, 0xC] +_080634AC: + adds r6, r4, 0 + b _080635E6 + .pool +_080634BC: + movs r0, 0x64 + muls r0, r6 + ldr r1, [sp, 0xC] + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _080634D2 + b _080635E4 +_080634D2: + adds r0, r5, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + bne _080634E0 + b _080635E4 +_080634E0: + adds r0, r5, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _080635E4 + ldr r1, =0x0202406e + mov r2, r9 + lsls r0, r2, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r6, r0 + beq _080635E4 + mov r2, r10 + lsls r0, r2, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r6, r0 + beq _080635E4 + ldr r0, =0x0202449c + ldr r1, [r0] + mov r2, r9 + adds r0, r2, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r6, r0 + beq _080635E4 + mov r2, r10 + adds r0, r2, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r6, r0 + beq _080635E4 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r5, 0 + movs r1, 0x2E + bl pokemon_getattr + cmp r0, 0 + beq _08063558 + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + ldr r1, =gBaseStats + adds r0, r1 + ldrb r2, [r0, 0x17] + b _08063564 + .pool +_08063558: + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + ldr r2, =gBaseStats + adds r0, r2 + ldrb r2, [r0, 0x16] +_08063564: + ldr r1, =0x02024250 + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + adds r1, r4, 0 + bl ai_rate_move + ldr r1, [sp] + ands r1, r0 + cmp r1, 0 + beq _080635E4 + ldr r1, =0x02024270 + ldrb r0, [r5] + adds r0, r1 + ldrb r0, [r0] + mov r9, r0 + movs r4, 0 + movs r0, 0x64 + adds r1, r6, 0 + muls r1, r0 + mov r8, r1 + ldr r1, =0x02024084 + movs r0, 0x58 + mov r2, r9 + muls r2, r0 + adds r0, r2, 0 + adds r5, r0, r1 + adds r7, r5, 0 + adds r7, 0x20 +_080635A2: + adds r1, r4, 0 + adds r1, 0xD + ldr r0, [sp, 0xC] + add r0, r8 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _080635DE + ldrh r1, [r5] + ldrb r2, [r7] + bl ai_rate_move + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0x2 + ands r1, r0 + cmp r1, 0 + beq _080635DE + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ldr r1, [sp, 0x4] + bl __modsi3 + cmp r0, 0 + bne _080635DE + b _08063468 +_080635DE: + adds r4, 0x1 + cmp r4, 0x3 + ble _080635A2 +_080635E4: + adds r6, 0x1 +_080635E6: + ldr r0, [sp, 0x8] + cmp r6, r0 + bge _080635EE + b _080634BC +_080635EE: + movs r0, 0 +_080635F0: + 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 ai_switchout_something + + thumb_func_start sub_8063614 +sub_8063614: @ 8063614 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r6, =0x02024084 + ldr r4, =0x02024064 + ldrb r2, [r4] + movs r5, 0x58 + adds r0, r2, 0 + muls r0, r5 + adds r1, r6, 0 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x0400e000 + ands r0, r1 + cmp r0, 0 + beq _0806363E + b _0806386C +_0806363E: + ldr r0, =0x020242ac + lsls r1, r2, 2 + adds r1, r0 + ldr r1, [r1] + movs r0, 0x80 + lsls r0, 3 + ands r1, r0 + cmp r1, 0 + beq _08063652 + b _0806386C +_08063652: + str r1, [sp] + movs r0, 0xC + adds r1, r2, 0 + movs r2, 0x17 + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _0806366A + b _0806386C +_0806366A: + ldrb r1, [r4] + str r0, [sp] + movs r0, 0xC + movs r2, 0x47 + movs r3, 0 + bl ability_something + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08063682 + b _0806386C +_08063682: + str r0, [sp] + movs r0, 0xE + movs r1, 0 + movs r2, 0x2A + movs r3, 0 + bl ability_something + lsls r0, 24 + cmp r0, 0 + beq _080636B4 + ldrb r0, [r4] + muls r0, r5 + adds r1, r0, r6 + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0x8 + bne _080636A8 + b _0806386C +_080636A8: + adds r0, r1, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0x8 + bne _080636B4 + b _0806386C +_080636B4: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 11 + ands r0, r1 + cmp r0, 0 + beq _080636C4 + b _0806386C +_080636C4: + movs r0, 0 + mov r10, r0 + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0806372E + ldrb r7, [r4] + adds r0, r7, 0 + bl battle_get_per_side_status + movs r5, 0x2 + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + ldr r1, =0x02024210 + ldrb r1, [r1] + ldr r2, =gUnknown_0832A328 + lsls r0, 24 + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08063718 + ldrb r6, [r4] + b _08063732 + .pool +_08063718: + ldrb r0, [r4] + bl battle_get_per_side_status + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r6, r0, 24 + b _08063732 +_0806372E: + ldrb r6, [r4] + adds r7, r6, 0 +_08063732: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x00808000 + ands r0, r1 + cmp r0, 0 + beq _08063768 + ldr r2, =0x02024064 + ldrb r1, [r2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08063760 + movs r4, 0 + movs r1, 0x3 + mov r8, r1 + b _08063770 + .pool +_08063760: + movs r4, 0x3 + movs r0, 0x6 + mov r8, r0 + b _08063770 +_08063768: + movs r4, 0 + movs r1, 0x6 + mov r8, r1 + ldr r2, =0x02024064 +_08063770: + ldrb r0, [r2] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x02024744 + mov r9, r1 + cmp r0, 0 + bne _08063784 + ldr r0, =0x020244ec + mov r9, r0 +_08063784: + adds r5, r4, 0 + cmp r5, r8 + bge _080637F2 +_0806378A: + movs r0, 0x64 + muls r0, r5 + mov r1, r9 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _080637EC + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _080637EC + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _080637EC + ldr r1, =0x0202406e + lsls r0, r7, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r5, r0 + beq _080637EC + lsls r0, r6, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r5, r0 + beq _080637EC + ldr r0, =0x0202449c + ldr r1, [r0] + adds r0, r7, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r5, r0 + beq _080637EC + adds r0, r6, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r5, r0 + beq _080637EC + movs r0, 0x1 + add r10, r0 +_080637EC: + adds r5, 0x1 + cmp r5, r8 + blt _0806378A +_080637F2: + mov r1, r10 + cmp r1, 0 + beq _0806386C + bl ai_switch_perish_song + lsls r0, 24 + cmp r0, 0 + bne _08063852 + bl sub_8062C58 + lsls r0, 24 + cmp r0, 0 + bne _08063852 + bl sub_8062E54 + lsls r0, 24 + cmp r0, 0 + bne _08063852 + bl ai_switchout_natural_cure + lsls r0, 24 + cmp r0, 0 + bne _08063852 + movs r0, 0 + bl ai_has_super_effective_move_on_field + lsls r0, 24 + cmp r0, 0 + bne _0806386C + bl ai_is_too_invested_in_stat_buffs + lsls r0, 24 + cmp r0, 0 + bne _0806386C + movs r0, 0x8 + movs r1, 0x2 + bl ai_switchout_something + lsls r0, 24 + cmp r0, 0 + bne _08063852 + movs r0, 0x4 + movs r1, 0x3 + bl ai_switchout_something + lsls r0, 24 + cmp r0, 0 + beq _0806386C +_08063852: + movs r0, 0x1 + b _0806386E + .pool +_0806386C: + movs r0, 0 +_0806386E: + 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_8063614 + + thumb_func_start sub_8063880 +sub_8063880: @ 8063880 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r6, r0, 24 + adds r5, r6, 0 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + ldr r1, =0x02024744 + mov r8, r1 + cmp r0, 0 + bne _080638A8 + ldr r2, =0x020244ec + mov r8, r2 +_080638A8: + ldr r7, =0x02022fec + ldr r0, [r7] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + bne _080638B6 + b _080639E6 +_080638B6: + bl sub_8063614 + lsls r0, 24 + cmp r0, 0 + bne _080638C2 + b _080639DC +_080638C2: + ldrb r0, [r4] + ldr r2, =0x0202449c + ldr r1, [r2] + adds r0, r1 + movs r1, 0xA5 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x6 + bne _080639B8 + bl sub_8063A90 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bne _080639A6 + ldr r0, [r7] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08063910 + adds r0, r6, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + b _08063928 + .pool +_08063910: + adds r0, r5, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0x2 + eors r5, r0 + adds r0, r5, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r5, r0, 24 +_08063928: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x00808000 + ands r0, r1 + cmp r0, 0 + beq _08063958 + ldr r0, =0x02024064 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08063954 + movs r0, 0 + movs r7, 0x3 + b _0806395C + .pool +_08063954: + movs r0, 0x3 + b _0806395A +_08063958: + movs r0, 0 +_0806395A: + movs r7, 0x6 +_0806395C: + adds r4, r0, 0 + cmp r4, r7 + bge _080639A6 +_08063962: + movs r0, 0x64 + muls r0, r4 + add r0, r8 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _080639A0 + ldr r1, =0x0202406e + lsls r0, r6, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + beq _080639A0 + lsls r0, r5, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + beq _080639A0 + ldr r0, =0x0202449c + ldr r1, [r0] + adds r0, r6, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r4, r0 + beq _080639A0 + adds r0, r5, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r4, r0 + bne _080639A6 +_080639A0: + adds r4, 0x1 + cmp r4, r7 + blt _08063962 +_080639A6: + ldr r0, =0x02024064 + ldrb r0, [r0] + ldr r2, =0x0202449c + ldr r1, [r2] + adds r0, r1 + movs r1, 0xA5 + lsls r1, 2 + adds r0, r1 + strb r4, [r0] +_080639B8: + ldr r0, =0x02024064 + ldrb r1, [r0] + ldr r0, [r2] + adds r0, r1, r0 + adds r1, r0, 0 + adds r1, 0x5C + movs r2, 0xA5 + lsls r2, 2 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + b _080639F8 + .pool +_080639DC: + bl sub_8063EE0 + lsls r0, 24 + cmp r0, 0 + bne _080639F8 +_080639E6: + ldr r0, =0x02024064 + ldrb r0, [r0] + movs r2, 0x1 + eors r2, r0 + lsls r2, 8 + movs r0, 0x1 + movs r1, 0 + bl dp01_build_cmdbuf_x21_a_bb +_080639F8: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8063880 + + thumb_func_start sub_8063A08 +sub_8063A08: @ 8063A08 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r6, r3, 0 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + movs r7, 0 + ldr r0, =gUnknown_0831ACE8 + mov r10, r0 + ldrb r0, [r0] + cmp r0, 0xFF + beq _08063A7A + mov r5, r10 +_08063A36: + ldrb r0, [r5] + cmp r0, 0xFE + beq _08063A6C + ldr r1, [sp] + cmp r0, r1 + bne _08063A6C + ldrb r4, [r5, 0x1] + cmp r4, r9 + bne _08063A56 + ldrb r1, [r6] + ldrb r0, [r5, 0x2] + muls r0, r1 + movs r1, 0xA + bl __divsi3 + strb r0, [r6] +_08063A56: + cmp r4, r8 + bne _08063A6C + cmp r9, r8 + beq _08063A6C + ldrb r1, [r6] + ldrb r0, [r5, 0x2] + muls r0, r1 + movs r1, 0xA + bl __divsi3 + strb r0, [r6] +_08063A6C: + adds r5, 0x3 + adds r7, 0x3 + mov r1, r10 + adds r0, r7, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _08063A36 +_08063A7A: + 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_8063A08 + + thumb_func_start sub_8063A90 +sub_8063A90: @ 8063A90 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + ldr r4, =0x02024064 + ldrb r2, [r4] + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, r2, r0 + adds r1, r0, 0 + adds r1, 0x5C + ldrb r0, [r1] + cmp r0, 0x6 + beq _08063AB2 + b _08063E50 +_08063AB2: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 11 + ands r0, r1 + cmp r0, 0 + beq _08063AE0 + ldr r1, =0x0202406e + lsls r0, r2, 1 + adds r0, r1 + ldrb r0, [r0] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + b _08063E50 + .pool +_08063AE0: + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + beq _08063B6C + str r2, [sp, 0x10] + adds r0, r2, 0 + bl battle_get_per_side_status + movs r5, 0x2 + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + ldr r1, =0x02024210 + ldrb r1, [r1] + ldr r2, =gUnknown_0832A328 + lsls r0, 24 + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08063B20 + ldrb r4, [r4] + str r4, [sp, 0x14] + b _08063B36 + .pool +_08063B20: + ldrb r0, [r4] + bl battle_get_per_side_status + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] +_08063B36: + bl GenerateRandomNumber + movs r3, 0x2 + ands r0, r3 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + ldr r0, =0x02024210 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + ldr r4, [sp, 0x4] + lsls r0, r4, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08063B8A + eors r4, r3 + lsls r0, r4, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + b _08063B8A + .pool +_08063B6C: + adds r0, r2, 0 + bl battle_get_per_side_status + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + ldrb r4, [r4] + str r4, [sp, 0x14] + str r4, [sp, 0x10] +_08063B8A: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x00808000 + ands r0, r1 + cmp r0, 0 + beq _08063BC2 + ldr r2, =0x02024064 + ldrb r1, [r2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08063BB8 + movs r0, 0 + str r0, [sp, 0x18] + movs r1, 0x3 + str r1, [sp, 0x1C] + b _08063BCC + .pool +_08063BB8: + movs r4, 0x3 + str r4, [sp, 0x18] + movs r0, 0x6 + str r0, [sp, 0x1C] + b _08063BCC +_08063BC2: + movs r1, 0 + str r1, [sp, 0x18] + movs r2, 0x6 + str r2, [sp, 0x1C] + ldr r2, =0x02024064 +_08063BCC: + ldrb r0, [r2] + bl battle_side_get_owner + lsls r0, 24 + ldr r4, =0x02024744 + str r4, [sp, 0x20] + cmp r0, 0 + bne _08063BE0 + ldr r0, =0x020244ec + str r0, [sp, 0x20] +_08063BE0: + movs r1, 0 + mov r9, r1 +_08063BE4: + movs r2, 0 + str r2, [sp, 0x8] + movs r4, 0x6 + str r4, [sp, 0xC] + ldr r7, [sp, 0x18] + ldr r0, [sp, 0x1C] + cmp r7, r0 + blt _08063BF6 + b _08063CF2 +_08063BF6: + lsls r0, r7, 2 + ldr r1, =gUnknown_0832A328 + adds r0, r1 + mov r8, r0 + mov r10, sp +_08063C00: + movs r0, 0x64 + muls r0, r7 + ldr r2, [sp, 0x20] + adds r4, r2, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + beq _08063CD8 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08063CD8 + mov r4, r8 + ldr r0, [r4] + mov r1, r9 + ands r0, r1 + cmp r0, 0 + bne _08063CD8 + ldr r1, =0x0202406e + ldr r2, [sp, 0x10] + lsls r0, r2, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r7 + beq _08063CD8 + ldr r4, [sp, 0x14] + lsls r0, r4, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r7 + beq _08063CD8 + ldr r0, =0x0202449c + ldr r1, [r0] + adds r0, r2, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r7, r0 + beq _08063CD8 + adds r0, r4, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r7, r0 + beq _08063CD8 + ldr r1, =gBaseStats + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r5, [r0, 0x6] + ldrb r6, [r0, 0x7] + movs r0, 0xA + mov r1, r10 + strb r0, [r1] + movs r0, 0x58 + ldr r2, [sp, 0x4] + adds r4, r2, 0 + muls r4, r0 + ldr r0, =0x02024084 + adds r4, r0 + adds r0, r4, 0 + adds r0, 0x21 + ldrb r0, [r0] + adds r1, r5, 0 + adds r2, r6, 0 + mov r3, sp + bl sub_8063A08 + adds r4, 0x22 + ldrb r0, [r4] + adds r1, r5, 0 + adds r2, r6, 0 + mov r3, sp + bl sub_8063A08 + ldr r2, [sp, 0x8] + mov r1, r10 + ldrb r1, [r1] + cmp r2, r1 + bcs _08063CE6 + mov r2, r10 + ldrb r2, [r2] + str r2, [sp, 0x8] + lsls r0, r7, 24 + lsrs r0, 24 + str r0, [sp, 0xC] + b _08063CE6 + .pool +_08063CD8: + mov r4, r8 + ldr r0, [r4] + mov r1, r9 + orrs r1, r0 + lsls r0, r1, 24 + lsrs r0, 24 + mov r9, r0 +_08063CE6: + movs r2, 0x4 + add r8, r2 + adds r7, 0x1 + ldr r4, [sp, 0x1C] + cmp r7, r4 + blt _08063C00 +_08063CF2: + ldr r0, [sp, 0xC] + cmp r0, 0x6 + beq _08063D54 + movs r7, 0 + movs r0, 0x64 + ldr r1, [sp, 0xC] + adds r5, r1, 0 + muls r5, r0 +_08063D02: + adds r1, r7, 0 + adds r1, 0xD + ldr r2, [sp, 0x20] + adds r0, r2, r5 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _08063D2A + ldr r0, =0x02024064 + ldrb r1, [r0] + adds r0, r4, 0 + ldr r2, [sp, 0x4] + bl move_effectiveness_something + movs r1, 0x2 + ands r1, r0 + cmp r1, 0 + bne _08063D30 +_08063D2A: + adds r7, 0x1 + cmp r7, 0x3 + ble _08063D02 +_08063D30: + cmp r7, 0x4 + beq _08063D36 + b _08063E4E +_08063D36: + ldr r4, [sp, 0xC] + lsls r0, r4, 2 + ldr r1, =gUnknown_0832A328 + adds r0, r1 + ldr r0, [r0] + mov r2, r9 + orrs r2, r0 + lsls r0, r2, 24 + lsrs r0, 24 + mov r9, r0 + b _08063D58 + .pool +_08063D54: + movs r4, 0x3F + mov r9, r4 +_08063D58: + mov r0, r9 + cmp r0, 0x3F + beq _08063D60 + b _08063BE4 +_08063D60: + ldr r0, =0x02024400 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x0202449c + ldr r0, [r0] + strb r1, [r0, 0x13] + ldr r0, =0x02024474 + movs r2, 0x1 + strb r2, [r0, 0xE] + ldr r0, =0x0202427c + strb r1, [r0] + ldr r0, =0x02024211 + strb r2, [r0] + movs r1, 0 + str r1, [sp, 0x8] + movs r2, 0x6 + str r2, [sp, 0xC] + ldr r7, [sp, 0x18] + ldr r4, [sp, 0x1C] + cmp r7, r4 + bge _08063E4E +_08063D8A: + movs r0, 0x64 + adds r6, r7, 0 + muls r6, r0 + ldr r0, [sp, 0x20] + adds r4, r0, r6 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + adds r1, r7, 0x1 + mov r10, r1 + cmp r0, 0 + beq _08063E46 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08063E46 + ldr r1, =0x0202406e + ldr r2, [sp, 0x10] + lsls r0, r2, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r7 + beq _08063E46 + ldr r4, [sp, 0x14] + lsls r0, r4, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r7 + beq _08063E46 + ldr r0, =0x0202449c + ldr r1, [r0] + adds r0, r2, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r7, r0 + beq _08063E46 + adds r0, r4, r1 + adds r0, 0x5C + ldrb r0, [r0] + cmp r7, r0 + beq _08063E46 + movs r5, 0 + mov r9, r6 + ldr r0, =0x020241f0 + mov r8, r0 + ldr r6, =0x02024064 +_08063DEE: + adds r1, r5, 0 + adds r1, 0xD + ldr r0, [sp, 0x20] + add r0, r9 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0 + mov r1, r8 + str r0, [r1] + cmp r4, 0 + beq _08063E2A + ldr r0, =gBattleMoves + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + cmp r0, 0x1 + beq _08063E2A + ldrb r0, [r6] + ldr r1, [sp, 0x4] + bl sub_8046E7C + ldrb r1, [r6] + adds r0, r4, 0 + ldr r2, [sp, 0x4] + bl move_effectiveness_something +_08063E2A: + mov r2, r8 + ldr r0, [r2] + ldr r4, [sp, 0x8] + cmp r4, r0 + bge _08063E40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + lsls r0, r7, 24 + lsrs r0, 24 + str r0, [sp, 0xC] +_08063E40: + adds r5, 0x1 + cmp r5, 0x3 + ble _08063DEE +_08063E46: + mov r7, r10 + ldr r0, [sp, 0x1C] + cmp r7, r0 + blt _08063D8A +_08063E4E: + ldr r0, [sp, 0xC] +_08063E50: + 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_8063A90 + + thumb_func_start ai_identify_item_effect +ai_identify_item_effect: @ 8063E84 + push {r4,lr} + adds r2, r1, 0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bne _08063E94 + movs r0, 0x1 + b _08063EDA +_08063E94: + ldrb r1, [r2, 0x4] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08063EA2 + movs r0, 0x2 + b _08063EDA +_08063EA2: + ldrb r4, [r2, 0x3] + movs r3, 0x3F + adds r0, r3, 0 + ands r0, r4 + cmp r0, 0 + beq _08063EB2 + movs r0, 0x3 + b _08063EDA +_08063EB2: + ldrb r1, [r2] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _08063EC8 + ldrb r0, [r2, 0x1] + cmp r0, 0 + bne _08063EC8 + ldrb r0, [r2, 0x2] + cmp r0, 0 + beq _08063ECC +_08063EC8: + movs r0, 0x4 + b _08063EDA +_08063ECC: + movs r0, 0x80 + ands r0, r4 + cmp r0, 0 + bne _08063ED8 + movs r0, 0x6 + b _08063EDA +_08063ED8: + movs r0, 0x5 +_08063EDA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end ai_identify_item_effect + + thumb_func_start sub_8063EE0 +sub_8063EE0: @ 8063EE0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r0, 0 + mov r10, r0 + movs r7, 0 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _08063F12 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08063F12 + b _0806437C +_08063F12: + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + ldr r5, =0x02024744 + cmp r0, 0 + bne _08063F24 + ldr r5, =0x020244ec +_08063F24: + movs r1, 0 + mov r8, r1 +_08063F28: + movs r0, 0x64 + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + adds r4, r5, r0 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _08063F64 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + cmp r0, 0 + beq _08063F64 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _08063F64 + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 +_08063F64: + movs r0, 0x1 + add r8, r0 + mov r1, r8 + cmp r1, 0x5 + ble _08063F28 + movs r2, 0 + mov r8, r2 +_08063F72: + ldr r1, =0x020244a8 + mov r0, r8 + cmp r0, 0 + beq _08063F8E + ldr r0, [r1] + ldr r0, [r0, 0x18] + adds r0, 0x50 + ldrb r0, [r0] + mov r2, r8 + subs r0, r2 + adds r0, 0x1 + cmp r10, r0 + ble _08063F8E + b _08064370 +_08063F8E: + ldr r0, [r1] + ldr r0, [r0, 0x18] + mov r2, r8 + lsls r1, r2, 1 + adds r0, 0x48 + adds r0, r1 + ldrh r0, [r0] + mov r9, r0 + str r1, [sp] + cmp r0, 0 + bne _08063FA6 + b _08064370 +_08063FA6: + ldr r1, =gItemEffectInfoPointers + subs r0, 0xD + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + cmp r1, 0 + bne _08063FB6 + b _08064370 +_08063FB6: + mov r0, r9 + cmp r0, 0xAF + bne _08063FE8 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003214 + adds r5, r0, r1 + b _08063FEA + .pool +_08063FE8: + adds r5, r1, 0 +_08063FEA: + mov r2, r9 + lsls r0, r2, 24 + lsrs r0, 24 + adds r1, r5, 0 + bl ai_identify_item_effect + ldr r4, =0x02024064 + ldrb r1, [r4] + lsrs r1, 1 + ldr r3, =0x0202449c + ldr r2, [r3] + adds r1, r2 + adds r1, 0xC4 + strb r0, [r1] + ldrb r0, [r4] + lsrs r0, 1 + ldr r1, [r3] + adds r0, r1 + adds r0, 0xC4 + ldrb r0, [r0] + subs r0, 0x1 + cmp r0, 0x5 + bls _0806401A + b _08064324 +_0806401A: + lsls r0, 2 + ldr r1, =_08064030 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08064030: + .4byte _08064048 + .4byte _08064074 + .4byte _080640BC + .4byte _08064214 + .4byte _080642F4 + .4byte _0806437C +_08064048: + ldr r2, =0x02024084 + ldr r0, =0x02024064 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + ldrh r1, [r0, 0x2C] + ldrh r0, [r0, 0x28] + lsrs r1, 2 + cmp r0, r1 + bcc _08064060 + b _08064324 +_08064060: + cmp r0, 0 + bne _08064066 + b _08064324 +_08064066: + movs r7, 0x1 + b _08064328 + .pool +_08064074: + mov r0, r9 + movs r1, 0x4 + movs r2, 0x4 + bl sub_806CDDC + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _08064088 + b _08064324 +_08064088: + ldr r2, =0x02024084 + ldr r0, =0x02024064 + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r1, r0, r2 + ldrh r2, [r1, 0x28] + cmp r2, 0 + bne _0806409C + b _08064324 +_0806409C: + ldrh r3, [r1, 0x2C] + lsrs r0, r3, 2 + cmp r2, r0 + bcc _08064066 + adds r0, r2, 0 + subs r0, r3, r0 + adds r1, r5, r4 + ldrb r1, [r1] + cmp r0, r1 + bgt _080640B2 + b _08064324 +_080640B2: + b _08064066 + .pool +_080640BC: + ldr r3, =0x02024064 + ldrb r0, [r3] + lsrs r0, 1 + ldr r2, =0x0202449c + ldr r1, [r2] + adds r0, r1 + adds r0, 0xC6 + movs r1, 0 + strb r1, [r0] + ldrb r1, [r5, 0x3] + movs r6, 0x20 + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08064100 + ldr r1, =0x02024084 + ldrb r4, [r3] + movs r0, 0x58 + muls r0, r4 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08064100 + lsrs r1, r4, 1 + ldr r0, [r2] + adds r1, r0 + adds r1, 0xC6 + ldrb r0, [r1] + orrs r0, r6 + strb r0, [r1] + movs r7, 0x1 +_08064100: + ldrb r1, [r5, 0x3] + movs r6, 0x10 + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0806413A + ldr r1, =0x02024084 + ldrb r4, [r3] + movs r0, 0x58 + muls r0, r4 + adds r1, 0x4C + adds r0, r1 + ldr r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0806412A + movs r0, 0x80 + ands r1, r0 + cmp r1, 0 + beq _0806413A +_0806412A: + lsrs r1, r4, 1 + ldr r0, [r2] + adds r1, r0 + adds r1, 0xC6 + ldrb r0, [r1] + orrs r0, r6 + strb r0, [r1] + movs r7, 0x1 +_0806413A: + ldrb r1, [r5, 0x3] + movs r6, 0x8 + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0806416C + ldr r1, =0x02024084 + ldrb r4, [r3] + movs r0, 0x58 + muls r0, r4 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0806416C + lsrs r1, r4, 1 + ldr r0, [r2] + adds r1, r0 + adds r1, 0xC6 + ldrb r0, [r1] + orrs r0, r6 + strb r0, [r1] + movs r7, 0x1 +_0806416C: + ldrb r1, [r5, 0x3] + movs r6, 0x4 + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0806419E + ldr r1, =0x02024084 + ldrb r4, [r3] + movs r0, 0x58 + muls r0, r4 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0806419E + lsrs r1, r4, 1 + ldr r0, [r2] + adds r1, r0 + adds r1, 0xC6 + ldrb r0, [r1] + orrs r0, r6 + strb r0, [r1] + movs r7, 0x1 +_0806419E: + ldrb r1, [r5, 0x3] + movs r6, 0x2 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080641D0 + ldr r1, =0x02024084 + ldrb r4, [r3] + movs r0, 0x58 + muls r0, r4 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080641D0 + lsrs r1, r4, 1 + ldr r0, [r2] + adds r1, r0 + adds r1, 0xC6 + ldrb r0, [r1] + orrs r0, r6 + strb r0, [r1] + movs r7, 0x1 +_080641D0: + ldrb r1, [r5, 0x3] + movs r4, 0x1 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080641DE + b _08064324 +_080641DE: + ldr r1, =0x02024084 + ldrb r3, [r3] + movs r0, 0x58 + muls r0, r3 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _080641F6 + b _08064324 +_080641F6: + lsrs r1, r3, 1 + ldr r0, [r2] + adds r1, r0 + adds r1, 0xC6 + ldrb r0, [r1] + orrs r0, r4 + strb r0, [r1] + b _08064066 + .pool +_08064214: + ldr r4, =0x02024064 + ldrb r0, [r4] + lsrs r0, 1 + ldr r3, =0x0202449c + ldr r1, [r3] + adds r0, r1 + adds r0, 0xC6 + movs r1, 0 + strb r1, [r0] + ldr r1, =0x020242bc + ldrb r2, [r4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x16] + cmp r0, 0 + beq _08064324 + ldrb r1, [r5] + movs r6, 0xF + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08064254 + lsrs r2, 1 + ldr r0, [r3] + adds r2, r0 + adds r2, 0xC6 + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] +_08064254: + ldrb r1, [r5, 0x1] + movs r7, 0xF0 + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08064272 + ldrb r0, [r4] + lsrs r0, 1 + ldr r1, [r3] + adds r0, r1 + adds r0, 0xC6 + ldrb r1, [r0] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0] +_08064272: + ldrb r1, [r5, 0x1] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0806428E + ldrb r0, [r4] + lsrs r0, 1 + ldr r1, [r3] + adds r0, r1 + adds r0, 0xC6 + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_0806428E: + ldrb r1, [r5, 0x2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _080642AA + ldrb r0, [r4] + lsrs r0, 1 + ldr r1, [r3] + adds r0, r1 + adds r0, 0xC6 + ldrb r1, [r0] + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0] +_080642AA: + ldrb r1, [r5, 0x2] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _080642C6 + ldrb r0, [r4] + lsrs r0, 1 + ldr r1, [r3] + adds r0, r1 + adds r0, 0xC6 + ldrb r1, [r0] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0] +_080642C6: + ldrb r1, [r5] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0 + bne _080642D2 + b _08064066 +_080642D2: + ldrb r0, [r4] + lsrs r0, 1 + ldr r1, [r3] + adds r0, r1 + adds r0, 0xC6 + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] + b _08064066 + .pool +_080642F4: + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =0x020242bc + ldrb r1, [r4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x16] + cmp r0, 0 + beq _08064324 + ldr r0, =0x02024294 + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x4] + cmp r0, 0 + bne _08064324 + b _08064066 +_08064324: + cmp r7, 0 + beq _08064370 +_08064328: + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + ldr r0, =0x02024064 + ldrb r0, [r0] + lsrs r0, 1 + ldr r1, =0x0202449c + ldr r1, [r1] + lsls r0, 1 + adds r0, r1 + adds r0, 0xC0 + mov r1, r9 + strb r1, [r0] + ldr r0, =0x020244a8 + ldr r0, [r0] + ldr r0, [r0, 0x18] + adds r0, 0x48 + ldr r2, [sp] + adds r0, r2 + movs r1, 0 + strh r1, [r0] + adds r0, r7, 0 + b _0806437E + .pool +_08064370: + movs r0, 0x1 + add r8, r0 + mov r1, r8 + cmp r1, 0x3 + bgt _0806437C + b _08063F72 +_0806437C: + movs r0, 0 +_0806437E: + 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_8063EE0 + + thumb_func_start nullsub_28 +nullsub_28: @ 8064390 + bx lr + thumb_func_end nullsub_28 + + thumb_func_start sub_8064394 +sub_8064394: @ 8064394 + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80643B0 + str r1, [r0] + bx lr + .pool + thumb_func_end sub_8064394 + + thumb_func_start sub_80643B0 +sub_80643B0: @ 80643B0 + push {lr} + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldr r0, =0x02024064 + ldrb r3, [r0] + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _080643FC + ldr r0, =0x02023064 + lsls r1, r3, 9 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x38 + bhi _080643F8 + ldr r0, =gUnknown_0831C7B4 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + b _080643FC + .pool +_080643F8: + bl sub_8065068 +_080643FC: + pop {r0} + bx r0 + thumb_func_end sub_80643B0 + + thumb_func_start sub_8064400 +sub_8064400: @ 8064400 + push {lr} + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + 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, =DummyObjectCallback + cmp r1, r0 + bne _08064424 + bl sub_8065068 +_08064424: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064400 + + thumb_func_start sub_8064438 +sub_8064438: @ 8064438 + push {lr} + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + 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, =DummyObjectCallback + cmp r1, r0 + bne _0806445C + bl sub_8065068 +_0806445C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064438 + + thumb_func_start sub_8064470 +sub_8064470: @ 8064470 + push {r4-r6,lr} + ldr r5, =0x02020630 + ldr r6, =0x020241e4 + ldr r4, =0x02024064 + 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, =DummyObjectCallback + cmp r1, r0 + bne _080644C2 + 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 obj_free_rotscale_entry + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + bl sub_8065068 +_080644C2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064470 + + thumb_func_start sub_80644D8 +sub_80644D8: @ 80644D8 + push {r4,lr} + ldr r4, =0x020244d0 + ldr r1, [r4] + ldr r3, =0x02024064 + 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 _08064510 + 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_8065068 +_08064510: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80644D8 + + thumb_func_start sub_8064520 +sub_8064520: @ 8064520 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r0, 0 + mov r8, r0 + movs r4, 0 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0806454C + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08064584 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08064584 +_0806454C: + ldr r2, =0x02020630 + ldr r1, =0x03005d70 + ldr r3, =0x02024064 + ldrb r0, [r3] + 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, =DummyObjectCallback + adds r7, r3, 0 + cmp r1, r0 + bne _080645C2 + b _080645CA + .pool +_08064584: + ldr r3, =0x02020630 + ldr r6, =0x03005d70 + ldr r2, =0x02024064 + ldrb r4, [r2] + adds r0, r4, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r5, r3, 0 + adds r5, 0x1C + adds r0, r5 + ldr r3, [r0] + ldr r0, =DummyObjectCallback + adds r7, r2, 0 + cmp r3, r0 + bne _080645C0 + movs r0, 0x2 + eors r4, r0 + adds r0, r4, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r0, [r0] + cmp r0, r3 + bne _080645C0 + movs r1, 0x1 + mov r8, r1 +_080645C0: + movs r4, 0x1 +_080645C2: + mov r0, r8 + cmp r0, 0 + bne _080645CA + b _08064714 +_080645CA: + cmp r4, 0 + bne _080645DE + ldrb r1, [r7] + movs r0, 0x2 + eors r0, r1 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + bne _0806469C +_080645DE: + ldr r1, =0x020244d0 + mov r12, r1 + ldr r0, [r1] + ldr r7, =0x02024064 + ldrb r2, [r7] + ldr r3, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r4, r0, r3 + ldrb r1, [r4, 0x1] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _08064600 + b _08064714 +_08064600: + movs r6, 0x2 + adds r1, r6, 0 + eors r1, r2 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0, 0x1] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08064714 + ldrb r1, [r4] + movs r3, 0x7F + adds r0, r3, 0 + ands r0, r1 + strb r0, [r4] + mov r1, r12 + ldr r0, [r1] + 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 r4, 0x2 + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1, 0x1] + mov r0, r12 + ldr r2, [r0] + ldrb r0, [r7] + adds r1, r6, 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, [r7] + adds r1, r6, 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 FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + b _080646F2 + .pool +_0806469C: + ldr r3, =0x020244d0 + ldr r0, [r3] + 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 _08064714 + 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] + ldrb r0, [r7] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _080646F2 + ldr r4, =0x000027f9 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag +_080646F2: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r3, =0x02024064 + 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, =0x03005d60 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80644D8 + str r1, [r0] +_08064714: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064520 + + thumb_func_start sub_8064734 +sub_8064734: @ 8064734 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r0, 0 + mov r10, r0 + ldr r5, =0x020244d0 + ldr r0, [r5] + ldr r4, =0x02024064 + ldrb r2, [r4] + ldr r1, [r0, 0x4] + lsls r3, r2, 1 + adds r0, r3, r2 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0] + movs r6, 0xC4 + lsls r6, 1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _08064776 + ldr r0, =0x0202406e + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_08064776: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _080647B4 + 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 + ldrh r1, [r0] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _080647B4 + ldr r0, =0x0202406e + adds r0, r2, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + adds r1, r0 + adds r0, r3, 0 + bl sub_8172EF0 +_080647B4: + ldr r3, =0x020244d0 + ldr r0, [r3] + ldr r2, =0x02024064 + 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 r8, r3 + mov r9, r2 + cmp r0, 0 + bne _08064898 + 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 _08064898 + ldrb r1, [r6, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0806487A + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0806484A + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0806484A + ldr r4, =0x03005d70 + mov r1, r9 + ldrb r0, [r1] + adds r1, r7, 0 + eors r1, r0 + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + 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 +_0806484A: + ldr r5, =0x03005d70 + ldr r4, =0x02024064 + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + 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 +_0806487A: + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r3, =0x02024064 + 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 r8, r4 + mov r9, r3 +_08064898: + 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 _0806495A + 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 _0806495A + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + bne _0806495A + 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 _0806493C + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x42 + ands r0, r1 + cmp r0, 0x42 + bne _08064930 + adds r0, r2, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0806493C + ldr r0, =0x03007420 + bl m4aMPlayContinue + b _0806493C + .pool +_08064930: + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl +_0806493C: + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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 +_0806495A: + mov r1, r10 + cmp r1, 0 + bne _08064962 + b _08064AC0 +_08064962: + ldr r2, =0x02020630 + ldr r0, =0x03005d7c + ldr r5, =0x02024064 + ldrb r3, [r5] + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r4, [r0] + ldr r0, =DummyObjectCallback + cmp r4, r0 + beq _08064982 + b _08064AC0 +_08064982: + ldr r0, =0x020241e4 + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + cmp r0, r4 + beq _08064998 + b _08064AC0 +_08064998: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080649E2 + adds r0, r3, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _080649E2 + ldr r3, =0x020244d0 + ldr r0, [r3] + ldrb r2, [r5] + ldr r0, [r0, 0x4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x9] + adds r0, 0x1 + strb r0, [r1, 0x9] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08064AC0 + ldr r0, [r3] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strb r1, [r0, 0x9] +_080649E2: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08064A3A + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08064A3A + ldr r1, =0x03005d7c + ldr r5, =0x02024064 + 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, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + ldrb r0, [r5] + eors r4, r0 + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_805EE54 +_08064A3A: + ldr r1, =0x03005d7c + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + ldrb r5, [r4] + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl sub_805EE54 + ldr r3, =0x020244d0 + 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, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064520 + str r1, [r0] +_08064AC0: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064734 + + thumb_func_start sub_8064B04 +sub_8064B04: @ 8064B04 + push {r4-r7,lr} + ldr r4, =0x02020630 + ldr r0, =0x020241e4 + ldr r7, =0x02024064 + 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, =DummyObjectCallback + cmp r1, r0 + bne _08064BB6 + adds r0, r2, r4 + movs r1, 0x24 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08064BB6 + ldr r6, =0x020244d0 + 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 _08064B7C + ldr r0, =0x0202406e + adds r0, r4, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + adds r1, r0 + adds r0, r3, 0 + bl sub_8172EF0 + b _08064BB6 + .pool +_08064B7C: + ldrb r1, [r2, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08064BB6 + 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 FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + bl sub_8065068 +_08064BB6: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064B04 + + thumb_func_start sub_8064BC0 +sub_8064BC0: @ 8064BC0 + push {r4-r6,lr} + ldr r6, =0x02024064 + ldrb r0, [r6] + ldr r5, =0x03005d70 + 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 _08064C08 + ldrb r0, [r6] + adds r0, r5 + ldrb r0, [r0] + movs r2, 0 + bl heathbar_draw_hp + b _08064C0C + .pool +_08064C08: + bl sub_8065068 +_08064C0C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8064BC0 + + thumb_func_start sub_8064C14 +sub_8064C14: @ 8064C14 + push {lr} + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + ldr r1, =0x02024064 + 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 _08064C42 + ldr r0, =0x03005d70 + adds r0, r3, r0 + ldrb r0, [r0] + bl sub_8072984 + bl sub_8065068 +_08064C42: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064C14 + + thumb_func_start sub_8064C58 +sub_8064C58: @ 8064C58 + push {r4-r6,lr} + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r6, =0x02024064 + 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 _08064CB2 + ldr r5, =0x020241e4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldrb r0, [r6] + bl sub_805EEE0 + ldr r1, =0x03005d70 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl sub_8065068 +_08064CB2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064C58 + + thumb_func_start sub_8064CCC +sub_8064CCC: @ 8064CCC + push {lr} + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _08064CDE + bl sub_8065068 +_08064CDE: + pop {r0} + bx r0 + thumb_func_end sub_8064CCC + + thumb_func_start sub_8064CE4 +sub_8064CE4: @ 8064CE4 + push {r4,lr} + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + ldr r2, =0x02020630 + 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 _08064D30 + 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, =0x020244b9 + strb r3, [r0] + bl sub_8065068 + b _08064D5A + .pool +_08064D30: + ldrh r0, [r4, 0x30] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08064D54 + 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] +_08064D54: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] +_08064D5A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8064CE4 + + thumb_func_start sub_8064D60 +sub_8064D60: @ 8064D60 + push {r4,lr} + ldr r2, =0x02020630 + ldr r0, =0x03005d70 + ldr r4, =0x02024064 + 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, =DummyObjectCallback + cmp r1, r0 + bne _08064DAC + ldr r0, =0x020244d0 + 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 _08064DA0 + adds r0, r3, 0 + adds r1, r3, 0 + adds r2, r3, 0 + movs r3, 0x6 + bl move_anim_start_t4 +_08064DA0: + ldr r0, =0x03005d60 + ldrb r1, [r4] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_8064DD0 + str r0, [r1] +_08064DAC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064D60 + + thumb_func_start sub_8064DD0 +sub_8064DD0: @ 8064DD0 + push {r4,lr} + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r4, =0x02024064 + 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 _08064E2A + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + bne _08064E2A + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + 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, =DummyObjectCallback + cmp r1, r0 + beq _08064E1A + ldr r0, =nullsub_18 + cmp r1, r0 + bne _08064E2A +_08064E1A: + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + bl sub_8065068 +_08064E2A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064DD0 + + thumb_func_start sub_8064E50 +sub_8064E50: @ 8064E50 + push {r4-r7,lr} + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r5, =0x02024064 + 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 _08064F0C + ldr r7, =0x02020630 + ldr r6, =0x020241e4 + 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, =DummyObjectCallback + cmp r1, r0 + bne _08064F0C + 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 FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + 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 StartObjectImageAnim + ldr r4, =0x03005d70 + ldrb r1, [r5] + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + 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, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064D60 + str r1, [r0] +_08064F0C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064E50 + + thumb_func_start sub_8064F40 +sub_8064F40: @ 8064F40 + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r0, [r6] + ldr r5, =0x02024064 + 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 _08064F72 + ldr r0, =0x0202406e + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_08064F72: + ldr r4, =0x02020630 + ldr r0, =0x03005d7c + 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, =DummyObjectCallback + cmp r1, r0 + bne _08064FDC + 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 _08064FDC + adds r0, r3, r4 + bl RemoveObjectAndFreeTiles + ldrb r4, [r5] + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_805EE54 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064E50 + str r1, [r0] +_08064FDC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8064F40 + + thumb_func_start sub_8065008 +sub_8065008: @ 8065008 + push {lr} + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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 _0806502A + bl sub_8065068 +_0806502A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8065008 + + thumb_func_start sub_8065038 +sub_8065038: @ 8065038 + push {lr} + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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 _0806505A + bl sub_8065068 +_0806505A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8065038 + + thumb_func_start sub_8065068 +sub_8065068: @ 8065068 + push {r4,lr} + sub sp, 0x4 + ldr r1, =0x03005d60 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80643B0 + str r1, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080650BC + bl link_get_multiplayer_id + mov r1, sp + strb r0, [r1] + movs r0, 0x2 + movs r1, 0x4 + mov r2, sp + bl dp01_prepare_buffer_wireless_probably + ldr r1, =0x02023064 + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _080650CE + .pool +_080650BC: + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, [r2] + bics r0, r1 + str r0, [r2] +_080650CE: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8065068 + + thumb_func_start dp01t_00_2_getattr +dp01t_00_2_getattr: @ 80650E0 + push {r4-r6,lr} + sub sp, 0x100 + movs r6, 0 + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _08065118 + ldr r0, =0x0202406e + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + mov r1, sp + bl dp01_getattr_by_ch1_for_opponent_pokemon + adds r6, r0, 0 + b _0806513A + .pool +_08065118: + ldrb r4, [r1] + movs r5, 0 +_0806511C: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _08065132 + lsls r0, r5, 24 + lsrs r0, 24 + mov r2, sp + adds r1, r2, r6 + bl dp01_getattr_by_ch1_for_opponent_pokemon + adds r6, r0 +_08065132: + lsrs r4, 1 + adds r5, 0x1 + cmp r5, 0x5 + ble _0806511C +_0806513A: + lsls r1, r6, 16 + lsrs r1, 16 + movs r0, 0x1 + mov r2, sp + bl dp01_build_cmdbuf_x1D_1D_numargs_varargs + bl sub_8065068 + add sp, 0x100 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end dp01t_00_2_getattr + + thumb_func_start dp01_getattr_by_ch1_for_opponent_pokemon +dp01_getattr_by_ch1_for_opponent_pokemon: @ 8065154 + 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, =0x02023064 + ldr r3, =0x02024064 + ldrb r0, [r3] + lsls r0, 9 + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3B + bls _0806517E + bl _080658EA +_0806517E: + lsls r0, 2 + ldr r1, =_08065194 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08065194: + .4byte _08065284 + .4byte _080654A8 + .4byte _080654B8 + .4byte _080654C8 + .4byte _08065530 + .4byte _08065530 + .4byte _08065530 + .4byte _08065530 + .4byte _0806554C + .4byte _08065588 + .4byte _08065588 + .4byte _08065588 + .4byte _08065588 + .4byte _080658EA + .4byte _080658EA + .4byte _080658EA + .4byte _080658EA + .4byte _080655A4 + .4byte _080655B4 + .4byte _080655E4 + .4byte _080655F4 + .4byte _08065604 + .4byte _08065614 + .4byte _08065624 + .4byte _08065634 + .4byte _08065644 + .4byte _08065654 + .4byte _08065664 + .4byte _08065674 + .4byte _08065684 + .4byte _08065694 + .4byte _080656A4 + .4byte _080656F4 + .4byte _08065704 + .4byte _08065714 + .4byte _08065724 + .4byte _08065734 + .4byte _08065744 + .4byte _08065754 + .4byte _08065764 + .4byte _08065774 + .4byte _080657A8 + .4byte _080657B8 + .4byte _080657C8 + .4byte _080657D8 + .4byte _080657E8 + .4byte _080657F8 + .4byte _08065808 + .4byte _08065818 + .4byte _08065838 + .4byte _08065848 + .4byte _08065858 + .4byte _08065868 + .4byte _08065878 + .4byte _08065888 + .4byte _08065898 + .4byte _080658A8 + .4byte _080658B8 + .4byte _080658C8 + .4byte _080658D8 +_08065284: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + mov r1, sp + strh r0, [r1] + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + 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 +_080652D0: + adds r1, r6, 0 + adds r1, 0xD + mov r0, r8 + bl pokemon_getattr + strh r0, [r4] + adds r1, r6, 0 + adds r1, 0x11 + mov r0, r8 + bl pokemon_getattr + mov r2, r9 + adds r1, r2, r6 + strb r0, [r1] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _080652D0 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r10 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + ldr r2, [sp, 0x80] + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x19 + bl pokemon_getattr + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + str r0, [sp, 0x48] + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + str r0, [sp, 0x4C] + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + ldr r1, [sp, 0x7C] + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x28] + adds r0, r4, 0 + movs r1, 0x3A + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2C] + adds r0, r4, 0 + movs r1, 0x3B + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2] + adds r0, r4, 0 + movs r1, 0x3C + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x4] + adds r0, r4, 0 + movs r1, 0x3D + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x6] + adds r0, r4, 0 + movs r1, 0x3E + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x8] + adds r0, r4, 0 + movs r1, 0x3F + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0xA] + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + str r0, [sp, 0x54] + adds r0, r4, 0 + movs r1, 0x2 + ldr r2, [sp, 0x8C] + bl pokemon_getattr + ldr r0, [sp, 0x84] + ldr r1, [sp, 0x8C] + bl CopyString_Limit10 + adds r0, r4, 0 + movs r1, 0x7 + ldr r2, [sp, 0x88] + bl pokemon_getattr + mov r2, sp + movs r6, 0 +_08065488: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0x57 + bls _08065488 + b _080658EA + .pool +_080654A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + b _08065822 + .pool +_080654B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xC + b _08065822 + .pool +_080654C8: + 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, =0x02024744 + adds r4, r1, r0 + mov r8, r9 +_080654DE: + adds r1, r6, 0 + adds r1, 0xD + adds r0, r4, 0 + bl pokemon_getattr + mov r1, r8 + strh r0, [r1] + adds r1, r6, 0 + adds r1, 0x11 + adds r0, r4, 0 + bl pokemon_getattr + mov r2, r10 + adds r1, r2, r6 + strb r0, [r1] + movs r0, 0x2 + add r8, r0 + adds r6, 0x1 + cmp r6, 0x3 + ble _080654DE + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r9 + strb r0, [r1, 0xC] + mov r2, r9 + movs r6, 0 +_0806551C: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0xF + bls _0806551C + b _080658EA + .pool +_08065530: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x9 + b _08065822 + .pool +_0806554C: + movs r6, 0 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r2, =0x02024744 + mov r8, r2 +_08065558: + adds r1, r6, 0 + adds r1, 0x11 + mov r2, r8 + adds r0, r4, r2 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + cmp r6, 0x3 + ble _08065558 + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + b _080658EA + .pool +_08065588: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x8 + b _080658E2 + .pool +_080655A4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1 + b _080655BE + .pool +_080655B4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x19 +_080655BE: + bl pokemon_getattr + 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 _080658EA + .pool +_080655E4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1A + b _080658E2 + .pool +_080655F4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1B + b _080658E2 + .pool +_08065604: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1C + b _080658E2 + .pool +_08065614: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1D + b _080658E2 + .pool +_08065624: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1E + b _080658E2 + .pool +_08065634: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1F + b _080658E2 + .pool +_08065644: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x20 + b _080658E2 + .pool +_08065654: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x22 + b _080658E2 + .pool +_08065664: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x23 + b _080658E2 + .pool +_08065674: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x24 + b _080658E2 + .pool +_08065684: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x25 + b _080658E2 + .pool +_08065694: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x26 + b _080658E2 + .pool +_080656A4: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_getattr + strb r0, [r7] + adds r0, r4, 0 + movs r1, 0x28 + bl pokemon_getattr + strb r0, [r7, 0x1] + adds r0, r4, 0 + movs r1, 0x29 + bl pokemon_getattr + strb r0, [r7, 0x2] + adds r0, r4, 0 + movs r1, 0x2A + bl pokemon_getattr + strb r0, [r7, 0x3] + adds r0, r4, 0 + movs r1, 0x2B + bl pokemon_getattr + strb r0, [r7, 0x4] + adds r0, r4, 0 + movs r1, 0x2C + bl pokemon_getattr + strb r0, [r7, 0x5] + movs r6, 0x6 + b _080658EA + .pool +_080656F4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x27 + b _080658E2 + .pool +_08065704: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x28 + b _080658E2 + .pool +_08065714: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x29 + b _080658E2 + .pool +_08065724: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2A + b _080658E2 + .pool +_08065734: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2B + b _080658E2 + .pool +_08065744: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2C + b _080658E2 + .pool +_08065754: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0 + b _0806577E + .pool +_08065764: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x9 + b _08065822 + .pool +_08065774: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x37 +_0806577E: + bl pokemon_getattr + 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 _080658EA + .pool +_080657A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x38 + b _080658E2 + .pool +_080657B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x39 + b _08065822 + .pool +_080657C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3A + b _08065822 + .pool +_080657D8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3B + b _08065822 + .pool +_080657E8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3C + b _08065822 + .pool +_080657F8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3D + b _08065822 + .pool +_08065808: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3E + b _08065822 + .pool +_08065818: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3F +_08065822: + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + strb r0, [r7] + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r6, 0x2 + b _080658EA + .pool +_08065838: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x16 + b _080658E2 + .pool +_08065848: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x17 + b _080658E2 + .pool +_08065858: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x18 + b _080658E2 + .pool +_08065868: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x21 + b _080658E2 + .pool +_08065878: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2F + b _080658E2 + .pool +_08065888: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x30 + b _080658E2 + .pool +_08065898: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x32 + b _080658E2 + .pool +_080658A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x33 + b _080658E2 + .pool +_080658B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x34 + b _080658E2 + .pool +_080658C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x35 + b _080658E2 + .pool +_080658D8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x36 +_080658E2: + bl pokemon_getattr + strb r0, [r7] + movs r6, 0x1 +_080658EA: + 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 dp01_getattr_by_ch1_for_opponent_pokemon + + thumb_func_start sub_8065900 +sub_8065900: @ 8065900 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8065900 + + thumb_func_start sub_806590C +sub_806590C: @ 806590C + push {r4,r5,lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _0806593C + ldr r0, =0x0202406e + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + bl sub_8065964 + b _0806595A + .pool +_0806593C: + ldrb r4, [r1] + movs r5, 0 +_08065940: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0806594E + adds r0, r5, 0 + bl sub_8065964 +_0806594E: + lsrs r4, 1 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _08065940 +_0806595A: + bl sub_8065068 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_806590C + + thumb_func_start sub_8065964 +sub_8065964: @ 8065964 + 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, =0x02024064 + ldrb r0, [r3] + lsls r0, 9 + ldr r2, =0x02023067 + 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 _08065992 + bl _08066270 +_08065992: + lsls r0, 2 + ldr r1, =_080659A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080659A8: + .4byte _08065A98 + .4byte _08065C30 + .4byte _08065C4C + .4byte _08065C68 + .4byte _08065CBC + .4byte _08065CBC + .4byte _08065CBC + .4byte _08065CBC + .4byte _08065CDC + .4byte _08065D44 + .4byte _08065D44 + .4byte _08065D44 + .4byte _08065D44 + .4byte _08066270 + .4byte _08066270 + .4byte _08066270 + .4byte _08066270 + .4byte _08065D6C + .4byte _08065D88 + .4byte _08065DA4 + .4byte _08065DC0 + .4byte _08065DDC + .4byte _08065DF8 + .4byte _08065E14 + .4byte _08065E30 + .4byte _08065E4C + .4byte _08065E68 + .4byte _08065E84 + .4byte _08065EA0 + .4byte _08065EBC + .4byte _08065ED8 + .4byte _08065EF4 + .4byte _08065F68 + .4byte _08065F84 + .4byte _08065FA0 + .4byte _08065FBC + .4byte _08065FD8 + .4byte _08065FF4 + .4byte _08066010 + .4byte _0806602C + .4byte _08066048 + .4byte _08066064 + .4byte _08066080 + .4byte _0806609C + .4byte _080660B8 + .4byte _080660D4 + .4byte _080660F0 + .4byte _0806610C + .4byte _08066128 + .4byte _08066144 + .4byte _08066160 + .4byte _0806617C + .4byte _08066198 + .4byte _080661B4 + .4byte _080661D0 + .4byte _080661EC + .4byte _08066208 + .4byte _08066224 + .4byte _08066240 + .4byte _0806625C +_08065A98: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + adds r2, r7, 0 + bl pokemon_setattr + adds r2, r7, 0 + adds r2, 0x2E + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + 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 +_08065AFE: + mov r1, r8 + adds r1, 0xD + mov r0, r9 + adds r2, r4, 0 + bl pokemon_setattr + mov r1, r8 + adds r1, 0x11 + mov r0, r9 + adds r2, r6, 0 + bl pokemon_setattr + adds r6, 0x1 + adds r4, 0x2 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x3 + ble _08065AFE + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + mov r2, r10 + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x20 + ldr r2, [sp, 0x20] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x19 + ldr r2, [sp, 0x28] + bl pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + adds r0, r4, 0 + movs r1, 0 + ldr r2, [sp, 0x2C] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x37 + ldr r2, [sp, 0x30] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x38 + ldr r2, [sp, 0x1C] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x39 + ldr r2, [sp, 0x18] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3A + ldr r2, [sp, 0x24] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3B + ldr r2, [sp, 0x4] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3C + ldr r2, [sp, 0x8] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3D + ldr r2, [sp, 0xC] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3E + ldr r2, [sp, 0x10] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3F + ldr r2, [sp, 0x14] + bl pokemon_setattr + b _08066270 + .pool +_08065C30: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0xB + bl pokemon_setattr + b _08066270 + .pool +_08065C4C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0xC + bl pokemon_setattr + b _08066270 + .pool +_08065C68: + 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, =0x02024744 + adds r7, r1, r0 + adds r6, r4, 0 + adds r6, 0x8 +_08065C80: + mov r1, r8 + adds r1, 0xD + adds r0, r7, 0 + adds r2, r4, 0 + bl pokemon_setattr + mov r1, r8 + adds r1, 0x11 + adds r0, r7, 0 + adds r2, r6, 0 + bl pokemon_setattr + adds r6, 0x1 + adds r4, 0x2 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x3 + ble _08065C80 + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x15 + mov r2, r9 + bl pokemon_setattr + b _08066270 + .pool +_08065CBC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldr r3, =0x02023064 + ldrb r2, [r6] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x9 + b _08065D5A + .pool +_08065CDC: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + adds r0, r4, 0 + movs r1, 0x11 + str r3, [sp, 0x34] + bl pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + b _08066270 + .pool +_08065D44: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldr r3, =0x02023064 + ldrb r2, [r6] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x8 +_08065D5A: + adds r3, 0x3 + adds r2, r3 + bl pokemon_setattr + b _08066270 + .pool +_08065D6C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1 + bl pokemon_setattr + b _08066270 + .pool +_08065D88: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x19 + bl pokemon_setattr + b _08066270 + .pool +_08065DA4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1A + bl pokemon_setattr + b _08066270 + .pool +_08065DC0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1B + bl pokemon_setattr + b _08066270 + .pool +_08065DDC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1C + bl pokemon_setattr + b _08066270 + .pool +_08065DF8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1D + bl pokemon_setattr + b _08066270 + .pool +_08065E14: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1E + bl pokemon_setattr + b _08066270 + .pool +_08065E30: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1F + bl pokemon_setattr + b _08066270 + .pool +_08065E4C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x20 + bl pokemon_setattr + b _08066270 + .pool +_08065E68: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x22 + bl pokemon_setattr + b _08066270 + .pool +_08065E84: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x23 + bl pokemon_setattr + b _08066270 + .pool +_08065EA0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x24 + bl pokemon_setattr + b _08066270 + .pool +_08065EBC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x25 + bl pokemon_setattr + b _08066270 + .pool +_08065ED8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x26 + bl pokemon_setattr + b _08066270 + .pool +_08065EF4: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + adds r0, r4, 0 + movs r1, 0x27 + str r3, [sp, 0x34] + bl pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + ldrb r2, [r6] + lsls r2, 9 + ldr r3, [sp, 0x34] + adds r0, r3, 0x5 + adds r2, r0 + adds r0, r4, 0 + b _08066002 + .pool +_08065F68: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x27 + bl pokemon_setattr + b _08066270 + .pool +_08065F84: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x28 + bl pokemon_setattr + b _08066270 + .pool +_08065FA0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x29 + bl pokemon_setattr + b _08066270 + .pool +_08065FBC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2A + bl pokemon_setattr + b _08066270 + .pool +_08065FD8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2B + bl pokemon_setattr + b _08066270 + .pool +_08065FF4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 +_08066002: + movs r1, 0x2C + bl pokemon_setattr + b _08066270 + .pool +_08066010: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0 + bl pokemon_setattr + b _08066270 + .pool +_0806602C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x9 + bl pokemon_setattr + b _08066270 + .pool +_08066048: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x37 + bl pokemon_setattr + b _08066270 + .pool +_08066064: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x38 + bl pokemon_setattr + b _08066270 + .pool +_08066080: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x39 + bl pokemon_setattr + b _08066270 + .pool +_0806609C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3A + bl pokemon_setattr + b _08066270 + .pool +_080660B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3B + bl pokemon_setattr + b _08066270 + .pool +_080660D4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3C + bl pokemon_setattr + b _08066270 + .pool +_080660F0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3D + bl pokemon_setattr + b _08066270 + .pool +_0806610C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3E + bl pokemon_setattr + b _08066270 + .pool +_08066128: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3F + bl pokemon_setattr + b _08066270 + .pool +_08066144: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x16 + bl pokemon_setattr + b _08066270 + .pool +_08066160: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x17 + bl pokemon_setattr + b _08066270 + .pool +_0806617C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x18 + bl pokemon_setattr + b _08066270 + .pool +_08066198: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x21 + bl pokemon_setattr + b _08066270 + .pool +_080661B4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2F + bl pokemon_setattr + b _08066270 + .pool +_080661D0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x30 + bl pokemon_setattr + b _08066270 + .pool +_080661EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x32 + bl pokemon_setattr + b _08066270 + .pool +_08066208: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x33 + bl pokemon_setattr + b _08066270 + .pool +_08066224: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x34 + bl pokemon_setattr + b _08066270 + .pool +_08066240: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x35 + bl pokemon_setattr + b _08066270 + .pool +_0806625C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x36 + bl pokemon_setattr +_08066270: + 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 sub_8065964 + + thumb_func_start sub_8066284 +sub_8066284: @ 8066284 + push {r4-r7,lr} + ldr r1, =0x0202406e + ldr r7, =0x02024064 + 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, =0x02023064 + lsls r2, 9 + adds r0, r4, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + ldr r1, =0x02024744 + adds r0, r1 + adds r5, r3, r0 + movs r3, 0 + adds r0, r4, 0x2 + adds r2, r0 + ldrb r2, [r2] + cmp r3, r2 + bcs _080662DC + adds r6, r4, 0 + adds r2, r7, 0 + adds r4, r0, 0 +_080662BA: + 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 _080662BA +_080662DC: + bl sub_8065068 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8066284 + + thumb_func_start sub_80662F8 +sub_80662F8: @ 80662F8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r7, =0x0202406e + ldr r6, =0x02024064 + 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, =0x02024744 + mov r9, r1 + add r0, r9 + movs r1, 0xB + bl pokemon_getattr + 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 battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_806A068 + ldr r0, =0x0202499c + 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 AddObjectToFront + ldr r4, =0x020241e4 + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r5, =0x02020630 + 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, =0x020244e4 + adds r2, r1 + ldrb r1, [r2] + bl StartObjectImageAnim + 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 pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_805EE54 + ldr r1, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064B04 + 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_80662F8 + + thumb_func_start sub_8066448 +sub_8066448: @ 8066448 + push {r4,lr} + ldr r1, =0x0202406e + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r2, r0, 1 + adds r2, r1 + ldr r3, =0x02023064 + 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_8066494 + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064F40 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8066448 + + thumb_func_start sub_8066494 +sub_8066494: @ 8066494 + 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, =0x0202406e + lsls r4, r6, 1 + adds r4, r0 + ldr r0, =0x02023064 + 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, =0x02024744 + adds r0, r5 + movs r1, 0xB + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, =sub_805D714 + bl object_new_hidden_with_callback + ldr r1, =0x03005d7c + 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 battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl sub_806A068 + ldr r0, =0x0202499c + 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 AddObjectToFront + ldr r4, =0x020241e4 + adds r4, r6, r4 + strb r0, [r4] + ldr r5, =0x02020630 + 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, =0x020244e4 + adds r6, r1 + ldrb r1, [r6] + bl StartObjectImageAnim + 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, =DummyObjectCallback + 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_8066494 + + thumb_func_start sub_8066624 +sub_8066624: @ 8066624 + push {r4-r6,lr} + ldr r1, =0x02023064 + ldr r6, =0x02024064 + ldrb r2, [r6] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r3, [r0] + cmp r3, 0 + bne _0806666C + ldr r0, =0x020244d0 + 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, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80666BC + str r1, [r0] + b _080666A8 + .pool +_0806666C: + ldr r5, =0x020241e4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldrb r0, [r6] + bl sub_805EEE0 + ldr r1, =0x03005d70 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl sub_8065068 +_080666A8: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8066624 + + thumb_func_start sub_80666BC +sub_80666BC: @ 80666BC + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r4, [r6] + ldr r5, =0x02024064 + 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 _080666E4 + cmp r0, 0x1 + beq _08066712 + b _0806673A + .pool +_080666E4: + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080666FE + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_080666FE: + 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 _0806673A +_08066712: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0806673A + 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, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064C58 + str r1, [r0] +_0806673A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80666BC + + thumb_func_start sub_8066748 +sub_8066748: @ 8066748 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r4, =0x02022fec + ldr r0, [r4] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08066840 + ldr r5, =0x02024064 + ldrb r0, [r5] + bl battle_get_per_side_status + movs r1, 0x2 + ands r1, r0 + movs r7, 0xC8 + cmp r1, 0 + beq _08066770 + movs r7, 0x98 +_08066770: + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 1 + ands r0, r1 + cmp r0, 0 + beq _080667A8 + ldrb r0, [r5] + cmp r0, 0x1 + bne _08066794 + ldr r0, =0x02038bca + b _08066796 + .pool +_08066794: + ldr r0, =0x02038bcc +_08066796: + ldrh r0, [r0] + bl sub_8162AA0 + lsls r0, 24 + lsrs r0, 24 + b _0806694C + .pool +_080667A8: + ldrb r0, [r5] + bl sub_806D864 + ldr r6, =0x020229e8 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + movs r4, 0xFF + ldrb r0, [r1] + cmp r0, 0x4 + beq _080667D8 + ldrb r0, [r5] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r1, [r1] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x5 + bne _080667F4 +_080667D8: + ldrb r0, [r5] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1, 0x13] + cmp r0, 0 + bne _080668AA + b _080668BC + .pool +_080667F4: + ldrb r0, [r5] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r1, [r1] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x2 + beq _08066822 + ldrb r0, [r5] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r0, [r1] + ands r4, r0 + cmp r4, 0x1 + bne _08066838 +_08066822: + ldrb r0, [r5] + bl sub_806D864 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1, 0x13] + cmp r0, 0 + bne _08066916 + b _08066924 +_08066838: + ldrb r0, [r5] + bl sub_806D864 + b _0806693A +_08066840: + movs r7, 0xB0 + ldr r0, =0x02038bca + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 4 + cmp r1, r0 + bne _08066858 + bl sub_8068B48 + b _08066948 + .pool +_08066858: + bl link_get_multiplayer_id + ldr r6, =0x020229e8 + movs r5, 0x1 + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + movs r4, 0xFF + ldrb r0, [r1] + cmp r0, 0x4 + beq _08066892 + bl link_get_multiplayer_id + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r1, [r1] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x5 + bne _080668C8 +_08066892: + bl link_get_multiplayer_id + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1, 0x13] + cmp r0, 0 + beq _080668BC +_080668AA: + ldr r0, =gTrainerPicIndices + adds r0, 0x4F + ldrb r0, [r0] + b _0806694C + .pool +_080668BC: + ldr r0, =gTrainerPicIndices + adds r0, 0x4E + ldrb r0, [r0] + b _0806694C + .pool +_080668C8: + bl link_get_multiplayer_id + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r1, [r1] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x2 + beq _080668FE + bl link_get_multiplayer_id + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r0, [r1] + ands r4, r0 + cmp r4, 0x1 + bne _08066930 +_080668FE: + bl link_get_multiplayer_id + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1, 0x13] + cmp r0, 0 + beq _08066924 +_08066916: + ldr r0, =gTrainerPicIndices + adds r0, 0x51 + ldrb r0, [r0] + b _0806694C + .pool +_08066924: + ldr r0, =gTrainerPicIndices + adds r0, 0x50 + ldrb r0, [r0] + b _0806694C + .pool +_08066930: + bl link_get_multiplayer_id + eors r0, r5 + lsls r0, 24 + lsrs r0, 24 +_0806693A: + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r1, 0x13] + bl sub_806F000 +_08066948: + lsls r0, 16 + lsrs r0, 16 +_0806694C: + mov r8, r0 + ldr r5, =0x02024064 + ldrb r1, [r5] + bl sub_805DF38 + ldrb r0, [r5] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl template_build_for_pokemon_or_trainer + ldr r6, =0x0202499c + 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 AddObjectToFront + ldr r6, =0x020241e4 + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, =0x02020630 + 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 IndexOfObjectPaletteTag + 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, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064400 + str r1, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8066748 + + thumb_func_start sub_8066A58 +sub_8066A58: @ 8066A58 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =0x02024064 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08066A74 + ldr r0, =0x02038bca + b _08066A76 + .pool +_08066A74: + ldr r0, =0x02038bcc +_08066A76: + ldrh r0, [r0] + bl sub_8162AA0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r6, =0x02024064 + ldrb r1, [r6] + bl sub_805DF38 + ldrb r0, [r6] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl template_build_for_pokemon_or_trainer + ldr r0, =0x0202499c + ldr r2, =gUnknown_083054E0 + mov r3, r8 + lsls r1, r3, 2 + adds r1, r2 + ldrb r1, [r1] + movs r2, 0x8 + subs r2, r1 + lsls r2, 18 + movs r1, 0xA0 + lsls r1, 14 + adds r2, r1 + asrs r2, 16 + movs r1, 0xB0 + movs r3, 0x1E + bl AddObjectToFront + ldr r5, =0x020241e4 + ldrb r1, [r6] + adds r1, r5 + strb r0, [r1] + ldr r4, =0x02020630 + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x60 + strh r1, [r0, 0x24] + 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, 0x20] + adds r1, 0x20 + strh r1, [r0, 0x20] + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000fffe + strh r1, [r0, 0x2E] + ldr r1, =gTrainerFrontPicPaletteTable + mov r2, r8 + lsls r0, r2, 3 + adds r0, r1 + ldrh r0, [r0, 0x4] + bl IndexOfObjectPaletteTag + ldrb r1, [r6] + adds r1, r5 + 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, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + mov r3, r8 + strh r3, [r0, 0x6] + ldrb r0, [r6] + adds r0, r5 + 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, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064438 + str r1, [r0] + bl sub_8065068 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8066A58 + + thumb_func_start sub_8066B94 +sub_8066B94: @ 8066B94 + push {r4-r6,lr} + ldr r6, =0x020241e4 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =0x02020630 + 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, =DummyObjectCallback + bl oamt_set_x3A_32 + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064470 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8066B94 + + thumb_func_start sub_8066C40 +sub_8066C40: @ 8066C40 + push {r4-r6,lr} + ldr r6, =0x020244d0 + ldr r4, [r6] + ldr r5, =0x02024064 + 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 _08066C94 + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08066C74 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_08066C74: + 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 _08066CD0 + .pool +_08066C94: + ldrb r1, [r3] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08066CD0 + strb r0, [r3, 0x4] + movs r0, 0x10 + movs r1, 0x3F + bl audio_play_and_stuff + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + 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, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064C14 + str r1, [r0] +_08066CD0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8066C40 + + thumb_func_start sub_8066CEC +sub_8066CEC: @ 8066CEC + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8066CEC + + thumb_func_start sub_8066CF8 +sub_8066CF8: @ 8066CF8 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8066CF8 + + thumb_func_start sub_8066D04 +sub_8066D04: @ 8066D04 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8066D04 + + thumb_func_start sub_8066D10 +sub_8066D10: @ 8066D10 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8066D10 + + thumb_func_start sub_8066D1C +sub_8066D1C: @ 8066D1C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r5, =0x02024064 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + beq _08066D32 + b _08066E58 +_08066D32: + ldr r0, =0x02023064 + mov r12, r0 + ldrb r1, [r5] + lsls r1, 9 + adds r0, 0x1 + adds r0, r1, r0 + ldrb r6, [r0] + mov r0, r12 + adds r0, 0x2 + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 8 + orrs r6, r0 + ldr r0, =0x02038432 + mov r8, r0 + mov r0, r12 + adds r0, 0x3 + adds r1, r0 + ldrb r0, [r1] + mov r1, r8 + strb r0, [r1] + ldr r3, =0x02038408 + ldrb r1, [r5] + lsls r1, 9 + mov r0, r12 + adds r0, 0x4 + adds r0, r1, r0 + ldrb r2, [r0] + mov r0, r12 + adds r0, 0x5 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 8 + orrs r2, r0 + strh r2, [r3] + ldr r3, =0x02038404 + ldrb r1, [r5] + lsls r1, 9 + mov r0, r12 + adds r0, 0x6 + adds r0, r1, r0 + ldrb r2, [r0] + mov r0, r12 + adds r0, 0x7 + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 8 + orrs r2, r0 + mov r0, r12 + adds r0, 0x8 + adds r0, r1, r0 + ldrb r0, [r0] + lsls r0, 16 + orrs r2, r0 + mov r0, r12 + adds r0, 0x9 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 24 + orrs r2, r0 + str r2, [r3] + ldr r2, =0x0203841a + ldrb r0, [r5] + lsls r0, 9 + mov r1, r12 + adds r1, 0xA + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r4, =0x0203841c + ldrb r1, [r5] + lsls r1, 9 + mov r0, r12 + adds r0, 0xC + adds r0, r1, r0 + ldrb r2, [r0] + mov r0, r12 + adds r0, 0xD + adds r1, r0 + ldrb r0, [r1] + lsls r0, 8 + orrs r2, r0 + strh r2, [r4] + ldr r7, =0x02038400 + ldrb r1, [r5] + lsls r1, 9 + mov r0, r12 + adds r0, 0x10 + adds r1, r0 + str r1, [r7] + ldr r2, =0x020244bc + ldrb r0, [r5] + lsls r0, 2 + adds r0, r2 + ldr r1, [r1] + str r1, [r0] + mov r0, r8 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_805DB8C + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _08066E30 + bl sub_8065068 + b _08066E58 + .pool +_08066E30: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldrb r1, [r5] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r3, [r0, 0x4] + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8066E70 + str r1, [r0] + ldrh r1, [r4] + ldr r2, [r7] + adds r0, r6, 0 + bl sub_817E0FC +_08066E58: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8066D1C + + thumb_func_start sub_8066E70 +sub_8066E70: @ 8066E70 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r2, =0x02023064 + ldr r6, =0x02024064 + 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, =0x020244d0 + 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 _08066F08 + cmp r2, 0x1 + bgt _08066EC8 + cmp r2, 0 + beq _08066ED2 + b _08066FE4 + .pool +_08066EC8: + cmp r2, 0x2 + beq _08066F32 + cmp r2, 0x3 + beq _08066FA8 + b _08066FE4 +_08066ED2: + ldr r1, [r5] + lsls r0, r3, 2 + adds r1, r0, r1 + ldrb r2, [r1] + movs r0, 0xC + ands r0, r2 + cmp r0, 0x4 + bne _08066EF4 + 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 +_08066EF4: + 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 _08066FE4 +_08066F08: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08066FE4 + 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 _08066FE4 +_08066F32: + ldr r0, =0x020383f8 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =0x020383fd + ldrb r0, [r0] + cmp r0, 0 + bne _08066FE4 + 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 _08066F80 + mov r0, r8 + cmp r0, 0x1 + bhi _08066F80 + 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] +_08066F80: + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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 _08066FE4 + .pool +_08066FA8: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _08066FE4 + 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_8065068 +_08066FE4: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8066E70 + + thumb_func_start sub_8066FF4 +sub_8066FF4: @ 8066FF4 + push {r4,r5,lr} + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r5, =0x02024064 + ldrb r4, [r5] + lsls r4, 9 + ldr r0, =0x02023066 + adds r4, r0 + ldrh r0, [r4] + bl battle_pick_message + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064CCC + str r1, [r0] + ldrh r0, [r4] + bl sub_817C95C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8066FF4 + + thumb_func_start sub_806704C +sub_806704C: @ 806704C + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_806704C + + thumb_func_start sub_8067058 +sub_8067058: @ 8067058 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8067058 + + thumb_func_start sub_8067064 +sub_8067064: @ 8067064 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8067064 + + thumb_func_start sub_8067070 +sub_8067070: @ 8067070 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8067070 + + thumb_func_start sub_806707C +sub_806707C: @ 806707C + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_806707C + + thumb_func_start sub_8067088 +sub_8067088: @ 8067088 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8067088 + + thumb_func_start sub_8067094 +sub_8067094: @ 8067094 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8067094 + + thumb_func_start sub_80670A0 +sub_80670A0: @ 80670A0 + 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, =0x02023064 + ldr r0, =0x02024064 + 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 _08067130 + ldr r6, =0x0202406e + lsls r0, r4, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x02024744 + adds r0, r4 + movs r1, 0x3A + bl pokemon_getattr + 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 pokemon_getattr + adds r3, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, =0x03005d70 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + mov r2, r8 + bl sub_807294C + b _0806715A + .pool +_08067130: + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3A + bl pokemon_getattr + adds r2, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, =0x03005d70 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + movs r3, 0 + bl sub_807294C +_0806715A: + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064BC0 + 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_80670A0 + + thumb_func_start sub_8067190 +sub_8067190: @ 8067190 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8067190 + + thumb_func_start sub_806719C +sub_806719C: @ 806719C + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _080671F0 + ldr r0, =0x03005d70 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + adds r1, r2 + movs r2, 0x9 + bl healthbar_draw_field_maybe + ldrb r2, [r4] + ldr r0, =0x020244d0 + 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, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8065008 + str r1, [r0] +_080671F0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806719C + + thumb_func_start sub_8067214 +sub_8067214: @ 8067214 + push {r4,r5,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _08067264 + ldr r4, =0x02023064 + 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, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8065008 + str r1, [r0] +_08067264: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8067214 + + thumb_func_start sub_806727C +sub_806727C: @ 806727C + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_806727C + + thumb_func_start sub_8067288 +sub_8067288: @ 8067288 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8067288 + + thumb_func_start sub_8067294 +sub_8067294: @ 8067294 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_8067294 + + thumb_func_start sub_80672A0 +sub_80672A0: @ 80672A0 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_80672A0 + + thumb_func_start sub_80672AC +sub_80672AC: @ 80672AC + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_80672AC + + thumb_func_start sub_80672B8 +sub_80672B8: @ 80672B8 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_80672B8 + + thumb_func_start sub_80672C4 +sub_80672C4: @ 80672C4 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_80672C4 + + thumb_func_start sub_80672D0 +sub_80672D0: @ 80672D0 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_80672D0 + + thumb_func_start sub_80672DC +sub_80672DC: @ 80672DC + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_80672DC + + thumb_func_start sub_80672E8 +sub_80672E8: @ 80672E8 + push {lr} + ldr r2, =0x02022d0c + ldrb r1, [r2] + movs r0, 0x80 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + bl sub_8065068 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80672E8 + + thumb_func_start sub_8067304 +sub_8067304: @ 8067304 + push {lr} + ldr r3, =0x02022d0c + ldr r1, =0x02023064 + ldr r0, =0x02024064 + 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_8065068 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8067304 + + thumb_func_start sub_806733C +sub_806733C: @ 806733C + push {lr} + ldr r2, =0x02022d0c + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + bl sub_8065068 + pop {r0} + bx r0 + .pool + thumb_func_end sub_806733C + + thumb_func_start sub_8067354 +sub_8067354: @ 8067354 + push {lr} + ldr r3, =0x02022d0c + 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_8065068 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8067354 + + thumb_func_start sub_806737C +sub_806737C: @ 806737C + push {r4,lr} + ldr r3, =0x02020630 + ldr r2, =0x020241e4 + ldr r4, =0x02024064 + 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 _080673B0 + bl sub_8065068 + b _080673DA + .pool +_080673B0: + ldr r1, =0x020244b9 + 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, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064CE4 + str r1, [r0] +_080673DA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806737C + + thumb_func_start sub_80673EC +sub_80673EC: @ 80673EC + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_80673EC + + thumb_func_start sub_80673F8 +sub_80673F8: @ 80673F8 + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + movs r3, 0x3F + cmp r0, 0 + bne _0806740C + movs r3, 0xC0 +_0806740C: + ldr r2, =0x02023064 + 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 audio_play_and_stuff + bl sub_8065068 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80673F8 + + thumb_func_start sub_806743C +sub_806743C: @ 806743C + push {r4,r5,lr} + ldr r4, =0x02023064 + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r3, r0, 9 + adds r0, r4, 0x3 + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _08067478 + 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 song_play_for_text + b _0806748C + .pool +_08067478: + 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 fanfare_play +_0806748C: + bl sub_8065068 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_806743C + + thumb_func_start sub_8067498 +sub_8067498: @ 8067498 + push {lr} + ldr r1, =0x0202406e + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x19 + movs r2, 0x5 + bl sub_80A32E4 + bl sub_8065068 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8067498 + + thumb_func_start sub_80674D4 +sub_80674D4: @ 80674D4 + push {lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, =0x020243fc + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + bl sub_8065068 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80674D4 + + thumb_func_start sub_8067508 +sub_8067508: @ 8067508 + push {r4-r6,lr} + ldr r5, =0x020241e4 + ldr r6, =0x02024064 + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + 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_80676FC + bl oamt_set_x3A_32 + ldr r0, =c3_08038DC4 + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + ldrb r0, [r6] + strh r0, [r1, 0x8] + ldr r3, =0x020244d0 + 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 _080675CA + ldr r0, =0x020244b4 + 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] +_080675CA: + ldr r0, [r3] + ldr r2, [r0, 0x8] + ldrb r0, [r2, 0x9] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] + ldr r1, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =nullsub_28 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8067508 + + thumb_func_start c3_08038DC4 +c3_08038DC4: @ 8067618 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r7, =0x02024064 + ldrb r0, [r7] + mov r9, r0 + ldr r1, =0x03005e00 + 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 _08067652 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08067684 +_08067652: + ldr r0, =0x02023064 + ldrb r1, [r7] + lsls r2, r1, 9 + adds r0, 0x1 + adds r2, r0 + ldr r0, =0x0202406e + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + strb r0, [r2] + ldrb r0, [r7] + movs r1, 0 + bl sub_8066494 + b _080676C4 + .pool +_08067684: + ldr r4, =0x02023064 + ldrb r0, [r7] + lsls r1, r0, 9 + adds r4, 0x1 + adds r1, r4 + ldr r6, =0x0202406e + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + strb r0, [r1] + ldrb r0, [r7] + movs r1, 0 + bl sub_8066494 + 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_8066494 + ldrb r0, [r7] + eors r0, r5 + strb r0, [r7] +_080676C4: + ldr r1, =0x03005d60 + ldr r2, =0x02024064 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8064734 + 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_08038DC4 + + thumb_func_start sub_80676FC +sub_80676FC: @ 80676FC + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x6] + bl sub_805DFE4 + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80676FC + + thumb_func_start sub_8067718 +sub_8067718: @ 8067718 + push {r4-r7,lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08067748 + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08067748 + bl sub_8065068 + b _08067812 + .pool +_08067748: + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r3, =0x02024064 + 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, =0x02023064 + ldrb r2, [r3] + lsls r0, r2, 9 + adds r1, 0x2 + adds r0, r1 + ldrb r0, [r0] + adds r7, r3, 0 + cmp r0, 0 + beq _080677B4 + 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 _080677AC + 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 _08067812 + .pool +_080677AC: + movs r0, 0x1F + negs r0, r0 + ands r0, r2 + strb r0, [r3, 0x1] +_080677B4: + adds r5, r7, 0 + ldrb r0, [r5] + lsls r3, r0, 9 + ldr r4, =0x02023068 + 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, =0x020244b4 + ldrb r1, [r5] + adds r1, r2 + movs r3, 0 + strb r0, [r1] + ldr r6, =0x020244d0 + 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 _08067806 + 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] +_08067806: + ldr r0, =0x03005d60 + ldrb r1, [r7] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_806782C + str r0, [r1] +_08067812: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8067718 + + thumb_func_start sub_806782C +sub_806782C: @ 806782C + push {r4,lr} + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r3, =0x02024064 + 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 _08067864 + 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_8065068 +_08067864: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806782C + + thumb_func_start sub_8067874 +sub_8067874: @ 8067874 + push {lr} + ldr r0, =0x020244d0 + ldr r1, [r0] + ldr r0, =0x02024064 + 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 _080678A6 + ldr r2, =0x03005e00 + ldr r0, =0x020244b4 + 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] +_080678A6: + bl sub_8065068 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8067874 + + thumb_func_start sub_80678C4 +sub_80678C4: @ 80678C4 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_80678C4 + + thumb_func_start sub_80678D0 +sub_80678D0: @ 80678D0 + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _08067916 + ldr r3, =0x02020630 + ldr r0, =0x020241e4 + 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, =0x02023064 + 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 +_08067916: + bl sub_8065068 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80678D0 + + thumb_func_start sub_8067930 +sub_8067930: @ 8067930 + push {r4-r6,lr} + sub sp, 0x4 + ldr r5, =0x02024064 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _08067992 + ldr r4, =0x02023064 + ldrb r2, [r5] + lsls r1, r2, 9 + adds r0, r4, 0x1 + adds r0, r1, r0 + ldrb r6, [r0] + adds r0, r4, 0x2 + adds r0, r1, r0 + ldrb r3, [r0] + adds r4, 0x3 + adds r1, r4 + ldrb r0, [r1] + lsls r0, 8 + orrs r3, r0 + str r3, [sp] + adds r0, r2, 0 + adds r1, r2, 0 + adds r3, r6, 0 + bl move_anim_start_t3 + lsls r0, 24 + cmp r0, 0 + beq _08067980 + bl sub_8065068 + b _0806798C + .pool +_08067980: + ldr r0, =0x03005d60 + ldrb r1, [r5] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_8065038 + str r0, [r1] +_0806798C: + adds r0, r6, 0 + bl sub_817E32C +_08067992: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8067930 + + thumb_func_start sub_80679A4 +sub_80679A4: @ 80679A4 + push {lr} + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + ldr r1, =0x02023066 + adds r0, r1 + bl sub_81851A8 + bl sub_8065068 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80679A4 + + thumb_func_start sub_80679C4 +sub_80679C4: @ 80679C4 + push {lr} + bl sub_8065068 + pop {r0} + bx r0 + thumb_func_end sub_80679C4 + + thumb_func_start sub_80679D0 +sub_80679D0: @ 80679D0 + push {r4,r5,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r0, 9 + ldr r4, =0x02023068 + adds r0, r4 + bl sub_81851A8 + ldrb r0, [r5] + lsls r0, 9 + subs r4, 0x3 + adds r0, r4 + ldrb r2, [r0] + cmp r2, 0x3 + bne _08067A00 + ldr r0, =0x0202433a + strb r2, [r0] + b _08067A08 + .pool +_08067A00: + ldr r0, =0x0202433a + movs r1, 0x3 + eors r1, r2 + strb r1, [r0] +_08067A08: + ldr r0, =0x03005d90 + ldr r3, [r0] + ldr r1, =0x02023064 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 9 + adds r1, 0x2 + adds r0, r1 + ldrb r0, [r0] + ldr r1, =0x00000ca9 + adds r3, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 3 + ldrb r2, [r3] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0x5 + bl sub_80A2F50 + movs r0, 0x3 + bl sub_80A2390 + bl sub_8065068 + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_80587B0 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80679D0 + + thumb_func_start nullsub_92 +nullsub_92: @ 8067A70 + bx lr + thumb_func_end nullsub_92 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_806BD04.s b/asm/rom_806BD04.s new file mode 100644 index 000000000..b46a381c3 --- /dev/null +++ b/asm/rom_806BD04.s @@ -0,0 +1,7082 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start ExecuteTableBasedItemEffect_ +@ bool8 ExecuteTableBasedItemEffect_(struct pokemon *mon, u16 itemId, u8 a3, u8 monMoveIndex) +ExecuteTableBasedItemEffect_: @ 806BD04 + push {r4,lr} + sub sp, 0x4 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + movs r4, 0 + str r4, [sp] + bl ExecuteTableBasedItemEffect + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end ExecuteTableBasedItemEffect_ + + thumb_func_start ExecuteTableBasedItemEffect +@ bool8 ExecuteTableBasedItemEffect(struct pokemon *mon, u16 itemId, u8 a3, u8 monMoveIndex, u8 a5) +ExecuteTableBasedItemEffect: @ 806BD28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x44 + mov r8, r0 + ldr r0, [sp, 0x64] + lsls r1, 16 + lsrs r1, 16 + 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 r0, 24 + lsrs r0, 24 + str r0, [sp, 0x18] + movs r0, 0x1 + str r0, [sp, 0x20] + movs r1, 0x6 + str r1, [sp, 0x28] + movs r2, 0 + str r2, [sp, 0x30] + movs r3, 0x4 + str r3, [sp, 0x38] + movs r5, 0 + str r5, [sp, 0x3C] + mov r0, r8 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _0806BDBC + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806BDA8 + ldr r2, =0x02024404 + ldr r0, =0x020244b8 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x7] + b _0806BDC4 + .pool +_0806BDA8: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00003226 + adds r0, r2 + ldrb r0, [r0] + b _0806BDC4 + .pool +_0806BDBC: + bl itemid_get_x12 + lsls r0, 24 + lsrs r0, 24 +_0806BDC4: + str r0, [sp, 0x34] + ldr r1, =0x0202420f + ldr r0, =0x020244b8 + ldrb r2, [r0] + strb r2, [r1] + ldr r0, =0x030022c0 + ldr r3, =0x00000439 + adds r0, r3 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _0806BE64 + ldr r0, =0x02024064 + strb r2, [r0] + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r1, 31 + str r1, [sp, 0x1C] + ldr r0, =0x0202406c + ldr r4, [sp, 0xC] + subs r4, 0xD + ldrb r0, [r0] + cmp r1, r0 + bge _0806BE70 + ldr r2, =0x0202406e + lsls r0, r1, 1 + adds r0, r2 + ldrh r3, [r0] + ldr r5, [sp, 0x10] + lsls r0, r5, 16 + lsrs r1, r0, 16 + adds r5, r0, 0 + cmp r3, r1 + bne _0806BE3C + ldr r0, [sp, 0x1C] + str r0, [sp, 0x38] + b _0806BE70 + .pool +_0806BE3C: + ldr r1, [sp, 0x1C] + adds r1, 0x2 + str r1, [sp, 0x1C] + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r1, r0 + bge _0806BE70 + lsls r0, r1, 1 + adds r0, r2 + ldrh r1, [r0] + lsrs r0, r5, 16 + cmp r1, r0 + bne _0806BE3C + ldr r2, [sp, 0x1C] + lsls r0, r2, 24 + lsrs r0, 24 + str r0, [sp, 0x38] + b _0806BE70 + .pool +_0806BE64: + ldr r0, =0x02024064 + strb r1, [r0] + movs r3, 0x4 + str r3, [sp, 0x38] + ldr r4, [sp, 0xC] + subs r4, 0xD +_0806BE70: + lsls r0, r4, 16 + lsrs r0, 16 + cmp r0, 0xA5 + bhi _0806BEF0 + ldr r1, =gItemEffectInfoPointers + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + bne _0806BE94 + ldr r5, [sp, 0xC] + cmp r5, 0xAF + beq _0806BE9A + b _0806BEF0 + .pool +_0806BE94: + ldr r1, [sp, 0xC] + cmp r1, 0xAF + bne _0806BEF6 +_0806BE9A: + ldr r0, =0x030022c0 + ldr r2, =0x00000439 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806BECC + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r1, =0x0202440c + adds r0, r1 + b _0806BEF6 + .pool +_0806BECC: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r3, =0x00003214 + adds r3, r0, r3 + str r3, [sp, 0x24] + b _0806BEF8 + .pool +_0806BEE0: + mov r0, r8 + movs r2, 0 + ldr r3, [sp, 0x10] + bl sub_813DA40 + movs r0, 0 + bl _0806CD5C +_0806BEF0: + movs r0, 0x1 + bl _0806CD5C +_0806BEF6: + str r0, [sp, 0x24] +_0806BEF8: + movs r5, 0 + str r5, [sp, 0x1C] +_0806BEFC: + ldr r0, [sp, 0x1C] + cmp r0, 0x5 + bls _0806BF06 + bl _0806CD4C +_0806BF06: + lsls r0, 2 + ldr r1, =_0806BF14 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806BF14: + .4byte _0806BF2C + .4byte _0806BFFC + .4byte _0806C08C + .4byte _0806C120 + .4byte _0806C300 + .4byte _0806C9BE +_0806BF2C: + ldr r1, [sp, 0x24] + ldr r3, [sp, 0x1C] + adds r2, r1, r3 + ldrb r1, [r2] + movs r0, 0x80 + ands r0, r1 + adds r6, r2, 0 + cmp r0, 0 + beq _0806BF76 + ldr r0, =0x030022c0 + ldr r5, =0x00000439 + adds r0, r5 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806BF76 + ldr r0, [sp, 0x38] + cmp r0, 0x4 + beq _0806BF76 + ldr r1, =0x02024084 + movs r0, 0x58 + ldr r2, [sp, 0x38] + muls r0, r2 + adds r1, 0x50 + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0xF0 + lsls r0, 12 + ands r0, r1 + cmp r0, 0 + beq _0806BF76 + ldr r0, =0xfff0ffff + ands r1, r0 + str r1, [r2] + movs r3, 0 + str r3, [sp, 0x20] +_0806BF76: + ldrb r1, [r6] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0 + beq _0806BFA4 + ldr r1, =0x02024084 + ldr r0, =0x02024064 + ldrb r2, [r0] + movs r0, 0x58 + muls r0, r2 + adds r1, 0x50 + adds r2, r0, r1 + ldr r1, [r2] + movs r3, 0x80 + lsls r3, 13 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + bne _0806BFA4 + orrs r1, r3 + str r1, [r2] + movs r5, 0 + str r5, [sp, 0x20] +_0806BFA4: + ldrb r0, [r6] + movs r3, 0xF + ands r3, r0 + cmp r3, 0 + bne _0806BFB2 + bl _0806CD4C +_0806BFB2: + ldr r6, =0x02024084 + ldr r5, =0x02024064 + ldrb r0, [r5] + movs r4, 0x58 + muls r0, r4 + adds r1, r0, r6 + ldrb r2, [r1, 0x19] + movs r0, 0x19 + ldrsb r0, [r1, r0] + cmp r0, 0xB + ble _0806BFCC + bl _0806CD4C +_0806BFCC: + adds r0, r2, r3 + strb r0, [r1, 0x19] + ldrb r0, [r5] + muls r0, r4 + adds r1, r0, r6 + movs r0, 0x19 + ldrsb r0, [r1, r0] + cmp r0, 0xC + bgt _0806BFE0 + b _0806C110 +_0806BFE0: + movs r0, 0xC + strb r0, [r1, 0x19] + b _0806C110 + .pool +_0806BFFC: + ldr r1, [sp, 0x24] + ldr r3, [sp, 0x1C] + adds r2, r1, r3 + ldrb r1, [r2] + movs r0, 0xF0 + ands r0, r1 + lsls r3, r0, 24 + adds r6, r2, 0 + cmp r3, 0 + beq _0806C042 + ldr r7, =0x02024084 + ldr r5, =0x02024064 + ldrb r0, [r5] + movs r4, 0x58 + muls r0, r4 + adds r1, r0, r7 + ldrb r2, [r1, 0x1A] + movs r0, 0x1A + ldrsb r0, [r1, r0] + cmp r0, 0xB + bgt _0806C042 + lsrs r0, r3, 28 + adds r0, r2, r0 + strb r0, [r1, 0x1A] + ldrb r0, [r5] + muls r0, r4 + adds r1, r0, r7 + movs r0, 0x1A + ldrsb r0, [r1, r0] + cmp r0, 0xC + ble _0806C03E + movs r0, 0xC + strb r0, [r1, 0x1A] +_0806C03E: + movs r5, 0 + str r5, [sp, 0x20] +_0806C042: + ldrb r0, [r6] + movs r3, 0xF + ands r3, r0 + cmp r3, 0 + bne _0806C050 + bl _0806CD4C +_0806C050: + ldr r6, =0x02024084 + ldr r5, =0x02024064 + ldrb r0, [r5] + movs r4, 0x58 + muls r0, r4 + adds r1, r0, r6 + ldrb r2, [r1, 0x1B] + movs r0, 0x1B + ldrsb r0, [r1, r0] + cmp r0, 0xB + ble _0806C06A + bl _0806CD4C +_0806C06A: + adds r0, r2, r3 + strb r0, [r1, 0x1B] + ldrb r0, [r5] + muls r0, r4 + adds r1, r0, r6 + movs r0, 0x1B + ldrsb r0, [r1, r0] + cmp r0, 0xC + ble _0806C110 + movs r0, 0xC + strb r0, [r1, 0x1B] + b _0806C110 + .pool +_0806C08C: + ldr r1, [sp, 0x24] + ldr r3, [sp, 0x1C] + adds r2, r1, r3 + ldrb r1, [r2] + movs r0, 0xF0 + ands r0, r1 + lsls r3, r0, 24 + adds r6, r2, 0 + cmp r3, 0 + beq _0806C0D2 + ldr r7, =0x02024084 + ldr r5, =0x02024064 + ldrb r0, [r5] + movs r4, 0x58 + muls r0, r4 + adds r1, r0, r7 + ldrb r2, [r1, 0x1E] + movs r0, 0x1E + ldrsb r0, [r1, r0] + cmp r0, 0xB + bgt _0806C0D2 + lsrs r0, r3, 28 + adds r0, r2, r0 + strb r0, [r1, 0x1E] + ldrb r0, [r5] + muls r0, r4 + adds r1, r0, r7 + movs r0, 0x1E + ldrsb r0, [r1, r0] + cmp r0, 0xC + ble _0806C0CE + movs r0, 0xC + strb r0, [r1, 0x1E] +_0806C0CE: + movs r5, 0 + str r5, [sp, 0x20] +_0806C0D2: + ldrb r0, [r6] + movs r3, 0xF + ands r3, r0 + cmp r3, 0 + bne _0806C0E0 + bl _0806CD4C +_0806C0E0: + ldr r6, =0x02024084 + ldr r5, =0x02024064 + ldrb r0, [r5] + movs r4, 0x58 + muls r0, r4 + adds r1, r0, r6 + ldrb r2, [r1, 0x1C] + movs r0, 0x1C + ldrsb r0, [r1, r0] + cmp r0, 0xB + ble _0806C0FA + bl _0806CD4C +_0806C0FA: + adds r0, r2, r3 + strb r0, [r1, 0x1C] + ldrb r0, [r5] + muls r0, r4 + adds r1, r0, r6 + movs r0, 0x1C + ldrsb r0, [r1, r0] + cmp r0, 0xC + ble _0806C110 + movs r0, 0xC + strb r0, [r1, 0x1C] +_0806C110: + movs r0, 0 + str r0, [sp, 0x20] + bl _0806CD4C + .pool +_0806C120: + ldr r1, [sp, 0x24] + ldr r3, [sp, 0x1C] + adds r2, r1, r3 + ldrb r1, [r2] + movs r0, 0x80 + ands r0, r1 + adds r6, r2, 0 + cmp r0, 0 + beq _0806C168 + ldr r5, =0x02024294 + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r0, [r1, 0x4] + cmp r0, 0 + bne _0806C168 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + movs r0, 0x5 + strb r0, [r1, 0x4] + movs r5, 0 + str r5, [sp, 0x20] +_0806C168: + ldrb r1, [r6] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0806C1CA + mov r0, r8 + movs r1, 0x38 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0x64 + beq _0806C1CA + ldr r5, =gExperienceTables + mov r0, r8 + movs r1, 0x38 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + mov r0, r8 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r4, 0x1 + lsls r4, 2 + ldr r2, =gBaseStats + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x13] + movs r0, 0xCA + lsls r0, 1 + muls r0, r1 + adds r4, r0 + adds r4, r5 + ldr r0, [r4] + str r0, [sp] + mov r0, r8 + movs r1, 0x19 + mov r2, sp + bl pokemon_setattr + mov r0, r8 + bl pokemon_calc_effective_stats + movs r0, 0 + str r0, [sp, 0x20] +_0806C1CA: + ldrb r1, [r6] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0806C206 + mov r0, r8 + ldr r1, [sp, 0x10] + movs r2, 0x7 + ldr r3, [sp, 0x38] + bl HealStatusConditions + lsls r0, 24 + cmp r0, 0 + bne _0806C206 + ldr r1, [sp, 0x38] + cmp r1, 0x4 + beq _0806C202 + ldr r1, =0x02024084 + movs r0, 0x58 + ldr r3, [sp, 0x38] + adds r2, r3, 0 + muls r2, r0 + adds r1, 0x50 + adds r2, r1 + ldr r0, [r2] + ldr r1, =0xf7ffffff + ands r0, r1 + str r0, [r2] +_0806C202: + movs r5, 0 + str r5, [sp, 0x20] +_0806C206: + ldrb r1, [r6] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0806C226 + ldr r2, =0x00000f88 + mov r0, r8 + ldr r1, [sp, 0x10] + ldr r3, [sp, 0x38] + bl HealStatusConditions + lsls r0, 24 + cmp r0, 0 + bne _0806C226 + movs r0, 0 + str r0, [sp, 0x20] +_0806C226: + ldrb r1, [r6] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0806C246 + mov r0, r8 + ldr r1, [sp, 0x10] + movs r2, 0x10 + ldr r3, [sp, 0x38] + bl HealStatusConditions + lsls r0, 24 + cmp r0, 0 + bne _0806C246 + movs r1, 0 + str r1, [sp, 0x20] +_0806C246: + ldrb r1, [r6] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0806C266 + mov r0, r8 + ldr r1, [sp, 0x10] + movs r2, 0x20 + ldr r3, [sp, 0x38] + bl HealStatusConditions + lsls r0, 24 + cmp r0, 0 + bne _0806C266 + movs r2, 0 + str r2, [sp, 0x20] +_0806C266: + ldrb r1, [r6] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806C286 + mov r0, r8 + ldr r1, [sp, 0x10] + movs r2, 0x40 + ldr r3, [sp, 0x38] + bl HealStatusConditions + lsls r0, 24 + cmp r0, 0 + bne _0806C286 + movs r3, 0 + str r3, [sp, 0x20] +_0806C286: + ldrb r1, [r6] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0806C294 + bl _0806CD4C +_0806C294: + ldr r0, =0x030022c0 + ldr r5, =0x00000439 + adds r0, r5 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0806C2A8 + bl _0806CD4C +_0806C2A8: + ldr r0, [sp, 0x38] + cmp r0, 0x4 + bne _0806C2B2 + bl _0806CD4C +_0806C2B2: + ldr r1, =0x02024084 + movs r0, 0x58 + ldr r2, [sp, 0x38] + muls r0, r2 + adds r1, 0x50 + adds r2, r0, r1 + ldr r1, [r2] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0806C2CC + bl _0806CD4C +_0806C2CC: + movs r0, 0x8 + negs r0, r0 + ands r1, r0 + str r1, [r2] + movs r3, 0 + str r3, [sp, 0x20] + bl _0806CD4C + .pool +_0806C300: + ldr r5, [sp, 0x24] + ldr r1, [sp, 0x1C] + adds r0, r5, r1 + ldrb r0, [r0] + mov r10, r0 + movs r0, 0x20 + mov r2, r10 + ands r0, r2 + cmp r0, 0 + beq _0806C3D8 + movs r0, 0xDF + ands r2, r0 + mov r10, r2 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + ldr r1, =gUnknown_08329D22 + ldr r3, [sp, 0x14] + adds r1, r3, r1 + ldrb r1, [r1] + ands r0, r1 + lsls r1, r3, 1 + lsrs r0, r1 + str r0, [sp] + adds r5, r3, 0 + adds r5, 0xD + mov r0, r8 + adds r1, r5, 0 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + ldr r2, [sp, 0x14] + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x2C] + ldr r0, [sp] + cmp r0, 0x2 + bhi _0806C3D8 + ldr r0, [sp, 0x2C] + cmp r0, 0x4 + bls _0806C3D8 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + ldr r1, =gUnknown_08329D2A + ldr r2, [sp, 0x14] + adds r1, r2, r1 + ldrb r1, [r1] + adds r0, r1 + str r0, [sp] + mov r0, r8 + movs r1, 0x15 + mov r2, sp + bl pokemon_setattr + mov r0, r8 + adds r1, r5, 0 + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + ldr r1, [sp] + lsls r1, 24 + lsrs r1, 24 + ldr r2, [sp, 0x14] + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r0, 24 + ldr r3, [sp, 0x2C] + subs r0, r3 + str r0, [sp] + ldr r4, [sp, 0x14] + adds r4, 0x11 + mov r0, r8 + adds r1, r4, 0 + movs r2, 0 + bl pokemon_getattr + ldr r1, [sp] + adds r0, r1 + str r0, [sp] + mov r0, r8 + adds r1, r4, 0 + mov r2, sp + bl pokemon_setattr + movs r5, 0 + str r5, [sp, 0x20] +_0806C3D8: + movs r0, 0 + str r0, [sp, 0x2C] + mov r1, r10 + cmp r1, 0 + bne _0806C3E6 + bl _0806CD4C +_0806C3E6: + movs r0, 0x1 + mov r2, r10 + ands r0, r2 + cmp r0, 0 + bne _0806C3F2 + b _0806C9AA +_0806C3F2: + ldr r3, [sp, 0x2C] + cmp r3, 0x7 + bls _0806C3FA + b _0806C9AA +_0806C3FA: + lsls r0, r3, 2 + ldr r1, =_0806C410 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806C410: + .4byte _0806C430 + .4byte _0806C430 + .4byte _0806C4DC + .4byte _0806C700 + .4byte _0806C9AA + .4byte _0806C9AA + .4byte _0806C9AA + .4byte _0806C994 +_0806C430: + mov r0, r8 + bl sub_806DC8C + lsls r0, 16 + lsrs r6, r0, 16 + ldr r5, [sp, 0x24] + ldr r1, [sp, 0x28] + adds r0, r5, r1 + ldrb r5, [r0] + ldr r0, =gUnknown_08329EC2 + ldr r2, [sp, 0x2C] + adds r0, r2, r0 + ldrb r1, [r0] + mov r0, r8 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + str r1, [sp, 0x4] + lsls r0, r5, 24 + asrs r2, r0, 24 + cmp r2, 0 + ble _0806C498 + ldr r0, =0x000001fd + cmp r6, r0 + bls _0806C466 + b _0806BEF0 +_0806C466: + adds r3, r1, 0 + cmp r3, 0x63 + ble _0806C46E + b _0806C9AA +_0806C46E: + adds r1, r3, r2 + cmp r1, 0x64 + ble _0806C484 + adds r0, r2, 0 + adds r0, 0x64 + subs r5, r0, r1 + b _0806C486 + .pool +_0806C484: + adds r5, r2, 0 +_0806C486: + adds r1, r6, r5 + movs r0, 0xFF + lsls r0, 1 + cmp r1, r0 + bls _0806C494 + adds r0, r5, r0 + subs r5, r0, r1 +_0806C494: + adds r0, r3, r5 + b _0806C4B2 +_0806C498: + cmp r1, 0 + bne _0806C4A8 + movs r3, 0x1 + str r3, [sp, 0x3C] + ldr r0, [sp, 0x28] + adds r0, 0x1 + lsls r0, 24 + b _0806C83E +_0806C4A8: + adds r0, r1, r2 + str r0, [sp, 0x4] + cmp r0, 0 + bge _0806C4B4 + movs r0, 0 +_0806C4B2: + str r0, [sp, 0x4] +_0806C4B4: + ldr r0, =gUnknown_08329EC2 + ldr r5, [sp, 0x2C] + adds r0, r5, r0 + ldrb r1, [r0] + add r2, sp, 0x4 + mov r0, r8 + bl pokemon_setattr + mov r0, r8 + bl pokemon_calc_effective_stats + ldr r0, [sp, 0x28] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x28] + b _0806C978 + .pool +_0806C4DC: + movs r0, 0x10 + mov r1, r10 + ands r0, r1 + cmp r0, 0 + beq _0806C59C + mov r0, r8 + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _0806C4FC + ldr r0, [sp, 0x28] + adds r0, 0x1 + lsls r0, 24 + b _0806C83E +_0806C4FC: + ldr r0, =0x030022c0 + ldr r2, =0x00000439 + adds r0, r2 + ldrb r1, [r0] + movs r4, 0x2 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806C5B2 + ldr r3, [sp, 0x38] + cmp r3, 0x4 + beq _0806C55C + ldr r2, =0x02024210 + ldr r1, =gUnknown_0832A328 + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r0] + ldrb r0, [r2] + bics r0, r1 + strb r0, [r2] + ldr r1, =0x0202406e + lsls r0, r3, 1 + adds r0, r1 + ldrb r0, [r0] + bl pokemon_order_func + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, [sp, 0x38] + bl battle_data_fill + ldr r0, =0x02024064 + ldrb r0, [r0] + b _0806C574 + .pool +_0806C55C: + ldr r3, =0x02024210 + ldr r1, =gUnknown_0832A328 + ldr r2, =0x02024064 + ldrb r0, [r2] + eors r0, r4 + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldrb r0, [r3] + bics r0, r1 + strb r0, [r3] + ldrb r0, [r2] +_0806C574: + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0806C5B2 + ldr r1, =0x03005d10 + ldrb r0, [r1, 0x4] + cmp r0, 0xFE + bhi _0806C5B2 + adds r0, 0x1 + strb r0, [r1, 0x4] + b _0806C5B2 + .pool +_0806C59C: + mov r0, r8 + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0806C5B2 + ldr r0, [sp, 0x28] + adds r0, 0x1 + lsls r0, 24 + b _0806C83E +_0806C5B2: + ldr r1, [sp, 0x28] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x28] + ldr r5, [sp, 0x24] + adds r1, r5, r1 + ldrb r1, [r1] + str r1, [sp] + adds r0, r1, 0 + cmp r0, 0xFE + beq _0806C5F4 + cmp r0, 0xFE + bhi _0806C5D4 + cmp r0, 0xFD + beq _0806C60A + b _0806C612 +_0806C5D4: + cmp r1, 0xFF + bne _0806C612 + mov r0, r8 + movs r1, 0x3A + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + mov r0, r8 + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + subs r4, r0 + str r4, [sp] + b _0806C612 +_0806C5F4: + mov r0, r8 + movs r1, 0x3A + movs r2, 0 + bl pokemon_getattr + lsrs r0, 1 + str r0, [sp] + cmp r0, 0 + bne _0806C612 + movs r0, 0x1 + b _0806C610 +_0806C60A: + ldr r0, =0x02024474 + adds r0, 0x23 + ldrb r0, [r0] +_0806C610: + str r0, [sp] +_0806C612: + mov r0, r8 + movs r1, 0x3A + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + mov r0, r8 + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + cmp r4, r0 + beq _0806C6F0 + ldr r0, [sp, 0x18] + cmp r0, 0 + bne _0806C6E4 + mov r0, r8 + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + ldr r1, [sp] + adds r0, r1 + str r0, [sp] + mov r0, r8 + movs r1, 0x3A + movs r2, 0 + bl pokemon_getattr + ldr r1, [sp] + cmp r1, r0 + bls _0806C65E + mov r0, r8 + movs r1, 0x3A + movs r2, 0 + bl pokemon_getattr + str r0, [sp] +_0806C65E: + mov r0, r8 + movs r1, 0x39 + mov r2, sp + bl pokemon_setattr + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806C6EC + ldr r2, [sp, 0x38] + cmp r2, 0x4 + beq _0806C6EC + ldr r1, =0x02024084 + movs r0, 0x58 + muls r0, r2 + adds r0, r1 + ldr r1, [sp] + strh r1, [r0, 0x28] + movs r0, 0x10 + mov r3, r10 + ands r0, r3 + cmp r0, 0 + bne _0806C6EC + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0806C6EC + ldr r1, =0x03005d10 + ldrb r0, [r1, 0x3] + cmp r0, 0xFE + bhi _0806C6AE + adds r0, 0x1 + strb r0, [r1, 0x3] +_0806C6AE: + ldrb r5, [r4] + add r0, sp, 0x38 + ldrb r0, [r0] + strb r0, [r4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl dp01_build_cmdbuf_x00_a_b_0 + ldrb r0, [r4] + bl dp01_battle_side_mark_buffer_for_execution + strb r5, [r4] + b _0806C6EC + .pool +_0806C6E4: + ldr r1, =0x020241f0 + ldr r0, [sp] + negs r0, r0 + str r0, [r1] +_0806C6EC: + movs r1, 0 + str r1, [sp, 0x20] +_0806C6F0: + movs r0, 0xEF + mov r2, r10 + ands r2, r0 + mov r10, r2 + b _0806C9AA + .pool +_0806C700: + movs r7, 0x2 + mov r0, r10 + ands r0, r7 + cmp r0, 0 + beq _0806C70C + b _0806C858 +_0806C70C: + movs r5, 0 + ldr r3, [sp, 0x28] + adds r3, 0x1 + str r3, [sp, 0x40] +_0806C714: + movs r0, 0x11 + adds r0, r5 + mov r9, r0 + mov r0, r8 + mov r1, r9 + movs r2, 0 + bl pokemon_getattr + str r0, [sp] + adds r7, r5, 0 + adds r7, 0xD + mov r0, r8 + adds r1, r7, 0 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r5, 24 + lsrs r6, r0, 24 + adds r0, r4, 0 + adds r2, r6, 0 + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r0, 24 + ldr r1, [sp] + cmp r1, r0 + beq _0806C832 + ldr r2, [sp, 0x24] + ldr r3, [sp, 0x28] + adds r0, r2, r3 + ldrb r0, [r0] + adds r0, r1, r0 + str r0, [sp] + mov r0, r8 + adds r1, r7, 0 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + adds r2, r6, 0 + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r0, 24 + ldr r1, [sp] + cmp r1, r0 + bls _0806C7CC + mov r0, r8 + adds r1, r7, 0 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + adds r2, r6, 0 + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] +_0806C7CC: + mov r0, r8 + mov r1, r9 + mov r2, sp + bl pokemon_setattr + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806C82E + ldr r2, [sp, 0x38] + cmp r2, 0x4 + beq _0806C82E + ldr r4, =0x02024084 + movs r0, 0x58 + adds r3, r2, 0 + muls r3, r0 + adds r0, r4, 0 + adds r0, 0x50 + adds r0, r3, r0 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 14 + ands r1, r0 + cmp r1, 0 + bne _0806C82E + ldr r1, =0x020242bc + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gUnknown_0832A328 + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0806C82E + adds r0, r5, r3 + adds r1, r4, 0 + adds r1, 0x24 + adds r0, r1 + ldr r1, [sp] + strb r1, [r0] +_0806C82E: + movs r3, 0 + str r3, [sp, 0x20] +_0806C832: + adds r5, 0x1 + cmp r5, 0x3 + bgt _0806C83A + b _0806C714 +_0806C83A: + ldr r5, [sp, 0x40] + lsls r0, r5, 24 +_0806C83E: + lsrs r0, 24 + str r0, [sp, 0x28] + b _0806C9AA + .pool +_0806C858: + ldr r6, [sp, 0x14] + adds r6, 0x11 + mov r0, r8 + adds r1, r6, 0 + movs r2, 0 + bl pokemon_getattr + str r0, [sp] + ldr r5, [sp, 0x14] + adds r5, 0xD + mov r0, r8 + adds r1, r5, 0 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + ldr r2, [sp, 0x14] + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp] + cmp r2, r0 + bne _0806C8A0 + b _0806C9AA +_0806C8A0: + ldr r1, [sp, 0x28] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x28] + ldr r0, [sp, 0x24] + adds r1, r0, r1 + ldrb r0, [r1] + adds r0, r2, r0 + str r0, [sp] + mov r0, r8 + adds r1, r5, 0 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + ldr r2, [sp, 0x14] + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r0, 24 + ldr r1, [sp] + cmp r1, r0 + bls _0806C914 + mov r0, r8 + adds r1, r5, 0 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + ldr r2, [sp, 0x14] + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] +_0806C914: + mov r0, r8 + adds r1, r6, 0 + mov r2, sp + bl pokemon_setattr + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _0806C978 + ldr r2, [sp, 0x38] + cmp r2, 0x4 + beq _0806C978 + ldr r4, =0x02024084 + movs r0, 0x58 + adds r3, r2, 0 + muls r3, r0 + adds r0, r4, 0 + adds r0, 0x50 + adds r0, r3, r0 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + bne _0806C978 + ldr r1, =0x020242bc + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gUnknown_0832A328 + ldr r5, [sp, 0x14] + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _0806C978 + adds r0, r5, r3 + adds r1, r4, 0 + adds r1, 0x24 + adds r0, r1 + ldr r1, [sp] + strb r1, [r0] +_0806C978: + movs r0, 0 + str r0, [sp, 0x20] + b _0806C9AA + .pool +_0806C994: + mov r0, r8 + movs r1, 0x2 + ldr r2, [sp, 0xC] + bl GetEvolutionTargetSpecies + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _0806C9AA + bl _0806BEE0 +_0806C9AA: + ldr r1, [sp, 0x2C] + adds r1, 0x1 + str r1, [sp, 0x2C] + mov r2, r10 + lsrs r2, 1 + mov r10, r2 + cmp r2, 0 + beq _0806C9BC + b _0806C3E6 +_0806C9BC: + b _0806CD4C +_0806C9BE: + ldr r3, [sp, 0x24] + ldr r5, [sp, 0x1C] + adds r0, r3, r5 + ldrb r0, [r0] + mov r10, r0 + movs r0, 0 + str r0, [sp, 0x2C] + mov r1, r10 + cmp r1, 0 + bne _0806C9D4 + b _0806CD4C +_0806C9D4: + movs r0, 0x1 + mov r2, r10 + ands r0, r2 + cmp r0, 0 + bne _0806C9E0 + b _0806CD3A +_0806C9E0: + ldr r3, [sp, 0x2C] + cmp r3, 0x7 + bls _0806C9E8 + b _0806CD3A +_0806C9E8: + lsls r0, r3, 2 + ldr r1, =_0806C9F8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806C9F8: + .4byte _0806CA18 + .4byte _0806CA18 + .4byte _0806CA18 + .4byte _0806CA18 + .4byte _0806CAB8 + .4byte _0806CB94 + .4byte _0806CC00 + .4byte _0806CC68 +_0806CA18: + mov r0, r8 + bl sub_806DC8C + lsls r0, 16 + lsrs r6, r0, 16 + ldr r5, [sp, 0x24] + ldr r1, [sp, 0x28] + adds r0, r5, r1 + ldrb r5, [r0] + ldr r0, =gUnknown_08329EC2 + ldr r4, [sp, 0x2C] + adds r4, 0x2 + adds r0, r4, r0 + ldrb r1, [r0] + mov r0, r8 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + str r1, [sp, 0x4] + lsls r0, r5, 24 + asrs r2, r0, 24 + cmp r2, 0 + ble _0806CA84 + ldr r0, =0x000001fd + cmp r6, r0 + bls _0806CA52 + bl _0806BEF0 +_0806CA52: + adds r3, r1, 0 + cmp r3, 0x63 + ble _0806CA5A + b _0806CD3A +_0806CA5A: + adds r1, r3, r2 + cmp r1, 0x64 + ble _0806CA70 + adds r0, r2, 0 + adds r0, 0x64 + subs r5, r0, r1 + b _0806CA72 + .pool +_0806CA70: + adds r5, r2, 0 +_0806CA72: + adds r1, r6, r5 + movs r0, 0xFF + lsls r0, 1 + cmp r1, r0 + bls _0806CA80 + adds r0, r5, r0 + subs r5, r0, r1 +_0806CA80: + adds r0, r3, r5 + b _0806CA98 +_0806CA84: + cmp r1, 0 + bne _0806CA8E + movs r2, 0x1 + str r2, [sp, 0x3C] + b _0806CD30 +_0806CA8E: + adds r0, r1, r2 + str r0, [sp, 0x4] + cmp r0, 0 + bge _0806CA9A + movs r0, 0 +_0806CA98: + str r0, [sp, 0x4] +_0806CA9A: + ldr r0, =gUnknown_08329EC2 + adds r0, r4, r0 + ldrb r1, [r0] + add r2, sp, 0x4 + mov r0, r8 + bl pokemon_setattr + mov r0, r8 + bl pokemon_calc_effective_stats + movs r3, 0 + str r3, [sp, 0x20] + b _0806CD30 + .pool +_0806CAB8: + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + ldr r1, =gUnknown_08329D22 + ldr r5, [sp, 0x14] + adds r1, r5, r1 + ldrb r1, [r1] + ands r0, r1 + lsls r1, r5, 1 + lsrs r0, r1 + str r0, [sp] + adds r6, r5, 0 + adds r6, 0xD + mov r0, r8 + adds r1, r6, 0 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + ldr r2, [sp, 0x14] + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [sp] + cmp r0, 0x2 + bls _0806CB0A + b _0806CD3A +_0806CB0A: + cmp r5, 0x4 + bhi _0806CB10 + b _0806CD3A +_0806CB10: + mov r0, r8 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + str r0, [sp] + ldr r1, =gUnknown_08329D26 + ldr r2, [sp, 0x14] + adds r1, r2, r1 + ldrb r2, [r1] + ands r2, r0 + str r2, [sp] + ldr r0, =gUnknown_08329D2A + ldr r3, [sp, 0x14] + adds r0, r3, r0 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + adds r2, r0 + str r2, [sp] + mov r0, r8 + movs r1, 0x15 + mov r2, sp + bl pokemon_setattr + mov r0, r8 + adds r1, r6, 0 + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + ldr r1, [sp] + lsls r1, 24 + lsrs r1, 24 + ldr r2, [sp, 0x14] + bl CalcPPWithPPUps + lsls r0, 24 + lsrs r0, 24 + subs r0, r5 + str r0, [sp] + ldr r4, [sp, 0x14] + adds r4, 0x11 + mov r0, r8 + adds r1, r4, 0 + movs r2, 0 + bl pokemon_getattr + ldr r1, [sp] + adds r0, r1 + str r0, [sp] + mov r0, r8 + adds r1, r4, 0 + mov r2, sp + bl pokemon_setattr + movs r5, 0 + str r5, [sp, 0x20] + b _0806CD3A + .pool +_0806CB94: + mov r0, r8 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0x63 + bls _0806CBA4 + b _0806CD30 +_0806CBA4: + ldr r0, [sp, 0x20] + cmp r0, 0 + beq _0806CBB2 + ldr r1, [sp, 0x3C] + cmp r1, 0 + bne _0806CBB2 + b _0806CD30 +_0806CBB2: + bl sub_806F104 + lsls r0, 24 + cmp r0, 0 + beq _0806CBBE + b _0806CD30 +_0806CBBE: + ldr r2, [sp, 0x30] + cmp r2, 0 + beq _0806CBC6 + b _0806CD30 +_0806CBC6: + ldr r3, [sp, 0x24] + ldr r5, [sp, 0x28] + adds r0, r3, r5 + ldrb r0, [r0] + str r0, [sp, 0x30] + mov r0, r8 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + adds r5, r0, 0 + str r5, [sp, 0x8] + ldr r0, [sp, 0x30] + lsls r4, r0, 24 + asrs r1, r4, 24 + cmp r1, 0 + ble _0806CCCC + ldr r2, [sp, 0x34] + cmp r2, 0x1B + bne _0806CCCC + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + adds r0, r5, r0 + str r0, [sp, 0x8] + adds r2, r4, 0 + b _0806CCD8 +_0806CC00: + mov r0, r8 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0x63 + bhi _0806CC10 + b _0806CD30 +_0806CC10: + mov r0, r8 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0xC7 + bls _0806CC20 + b _0806CD30 +_0806CC20: + ldr r0, [sp, 0x20] + cmp r0, 0 + beq _0806CC2E + ldr r1, [sp, 0x3C] + cmp r1, 0 + bne _0806CC2E + b _0806CD30 +_0806CC2E: + bl sub_806F104 + lsls r0, 24 + cmp r0, 0 + bne _0806CD30 + ldr r2, [sp, 0x30] + cmp r2, 0 + bne _0806CD30 + ldr r3, [sp, 0x24] + ldr r5, [sp, 0x28] + adds r0, r3, r5 + ldrb r0, [r0] + str r0, [sp, 0x30] + mov r0, r8 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + str r4, [sp, 0x8] + ldr r0, [sp, 0x30] + lsls r5, r0, 24 + asrs r1, r5, 24 + cmp r1, 0 + ble _0806CCCC + ldr r2, [sp, 0x34] + cmp r2, 0x1B + beq _0806CCBA + b _0806CCCC +_0806CC68: + mov r0, r8 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0xC7 + bls _0806CD30 + ldr r0, [sp, 0x20] + cmp r0, 0 + beq _0806CC82 + ldr r1, [sp, 0x3C] + cmp r1, 0 + beq _0806CD30 +_0806CC82: + bl sub_806F104 + lsls r0, 24 + cmp r0, 0 + bne _0806CD30 + ldr r2, [sp, 0x30] + cmp r2, 0 + bne _0806CD30 + ldr r3, [sp, 0x24] + ldr r5, [sp, 0x28] + adds r0, r3, r5 + ldrb r0, [r0] + str r0, [sp, 0x30] + mov r0, r8 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + str r4, [sp, 0x8] + ldr r0, [sp, 0x30] + lsls r5, r0, 24 + asrs r1, r5, 24 + cmp r1, 0 + ble _0806CCCC + ldr r2, [sp, 0x34] + cmp r2, 0x1B + bne _0806CCCC +_0806CCBA: + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + adds r0, r4, r0 + str r0, [sp, 0x8] + adds r2, r5, 0 + b _0806CCD8 +_0806CCCC: + ldr r3, [sp, 0x30] + lsls r2, r3, 24 + asrs r1, r2, 24 + ldr r0, [sp, 0x8] + adds r0, r1 + str r0, [sp, 0x8] +_0806CCD8: + cmp r2, 0 + ble _0806CD0E + mov r0, r8 + movs r1, 0x26 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0xB + bne _0806CCF0 + ldr r0, [sp, 0x8] + adds r0, 0x1 + str r0, [sp, 0x8] +_0806CCF0: + mov r0, r8 + movs r1, 0x23 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + bl sav1_map_get_name + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _0806CD0E + ldr r0, [sp, 0x8] + adds r0, 0x1 + str r0, [sp, 0x8] +_0806CD0E: + ldr r0, [sp, 0x8] + cmp r0, 0 + bge _0806CD18 + movs r0, 0 + str r0, [sp, 0x8] +_0806CD18: + ldr r0, [sp, 0x8] + cmp r0, 0xFF + ble _0806CD22 + movs r0, 0xFF + str r0, [sp, 0x8] +_0806CD22: + add r2, sp, 0x8 + mov r0, r8 + movs r1, 0x20 + bl pokemon_setattr + movs r5, 0 + str r5, [sp, 0x20] +_0806CD30: + ldr r0, [sp, 0x28] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x28] +_0806CD3A: + ldr r0, [sp, 0x2C] + adds r0, 0x1 + str r0, [sp, 0x2C] + mov r1, r10 + lsrs r1, 1 + mov r10, r1 + cmp r1, 0 + beq _0806CD4C + b _0806C9D4 +_0806CD4C: + ldr r2, [sp, 0x1C] + adds r2, 0x1 + str r2, [sp, 0x1C] + cmp r2, 0x5 + bgt _0806CD5A + bl _0806BEFC +_0806CD5A: + ldr r0, [sp, 0x20] +_0806CD5C: + add sp, 0x44 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end ExecuteTableBasedItemEffect + + thumb_func_start HealStatusConditions +@ bool8 HealStatusConditions(struct pokemon *a1, int a2, u32 healMask, u8 a4) +HealStatusConditions: @ 806CD6C + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r4, r2, 0 + lsls r3, 24 + lsrs r6, r3, 24 + movs r1, 0x37 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + str r1, [sp] + ands r0, r4 + cmp r0, 0 + beq _0806CDD0 + mvns r4, r4 + ands r1, r4 + str r1, [sp] + adds r0, r5, 0 + movs r1, 0x37 + mov r2, sp + bl pokemon_setattr + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806CDBE + cmp r6, 0x4 + beq _0806CDBE + ldr r0, =0x02024084 + movs r1, 0x58 + muls r1, r6 + adds r0, 0x4C + adds r1, r0 + ldr r0, [r1] + ands r0, r4 + str r0, [r1] +_0806CDBE: + movs r0, 0 + b _0806CDD2 + .pool +_0806CDD0: + movs r0, 0x1 +_0806CDD2: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end HealStatusConditions + + thumb_func_start sub_806CDDC +sub_806CDDC: @ 806CDDC + push {r4-r7,lr} + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + movs r7, 0x6 + ldr r1, =gItemEffectInfoPointers + adds r0, r3, 0 + subs r0, 0xD + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + bne _0806CE08 + cmp r3, 0xAF + beq _0806CE0C +_0806CE00: + movs r0, 0 + b _0806CF1C + .pool +_0806CE08: + cmp r3, 0xAF + bne _0806CE1A +_0806CE0C: + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r1, =0x0202440c + adds r0, r1 +_0806CE1A: + mov r12, r0 + movs r2, 0 +_0806CE1E: + cmp r2, 0x4 + beq _0806CE3E + cmp r2, 0x4 + ble _0806CE34 + cmp r2, 0x5 + beq _0806CEC8 + b _0806CF12 + .pool +_0806CE34: + cmp r2, 0 + blt _0806CF12 + cmp r2, r4 + bne _0806CF12 + b _0806CE00 +_0806CE3E: + mov r0, r12 + ldrb r3, [r0, 0x4] + movs r0, 0x20 + ands r0, r3 + cmp r0, 0 + beq _0806CE4E + movs r0, 0xDF + ands r3, r0 +_0806CE4E: + movs r6, 0 + cmp r3, 0 + beq _0806CF12 +_0806CE54: + movs r0, 0x1 + ands r0, r3 + cmp r0, 0 + beq _0806CEB4 + cmp r6, 0x7 + bhi _0806CEB4 + lsls r0, r6, 2 + ldr r1, =_0806CE70 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806CE70: + .4byte _0806CE9C + .4byte _0806CE9C + .4byte _0806CE90 + .4byte _0806CE9C + .4byte _0806CEB4 + .4byte _0806CEB4 + .4byte _0806CEB4 + .4byte _0806CEB0 +_0806CE90: + movs r0, 0x10 + ands r0, r3 + cmp r0, 0 + beq _0806CE9C + movs r0, 0xEF + ands r3, r0 +_0806CE9C: + cmp r2, r4 + bne _0806CEA8 + adds r0, r3, 0 + ands r0, r5 + cmp r0, 0 + bne _0806CF1A +_0806CEA8: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + b _0806CEB4 +_0806CEB0: + cmp r2, r4 + beq _0806CE00 +_0806CEB4: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + lsrs r3, 1 + cmp r2, r4 + bne _0806CEC2 + lsrs r5, 1 +_0806CEC2: + cmp r3, 0 + bne _0806CE54 + b _0806CF12 +_0806CEC8: + mov r0, r12 + ldrb r3, [r0, 0x5] + movs r6, 0 +_0806CECE: + cmp r3, 0 + beq _0806CF12 + movs r0, 0x1 + ands r0, r3 + cmp r0, 0 + beq _0806CF02 + cmp r6, 0 + blt _0806CF02 + cmp r6, 0x6 + ble _0806CEE8 + cmp r6, 0x7 + beq _0806CEFC + b _0806CF02 +_0806CEE8: + cmp r2, r4 + bne _0806CEF4 + adds r0, r3, 0 + ands r0, r5 + cmp r0, 0 + bne _0806CF1A +_0806CEF4: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + b _0806CF02 +_0806CEFC: + cmp r2, r4 + bne _0806CF02 + b _0806CE00 +_0806CF02: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + lsrs r3, 1 + cmp r2, r4 + bne _0806CECE + lsrs r5, 1 + b _0806CECE +_0806CF12: + adds r2, 0x1 + cmp r2, 0x5 + bgt _0806CF1A + b _0806CE1E +_0806CF1A: + adds r0, r7, 0 +_0806CF1C: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_806CDDC + + thumb_func_start sub_806CF24 +sub_806CF24: @ 806CF24 + push {lr} + ldr r2, =0x0202420c + ldr r1, =0x020244b8 + ldrb r1, [r1] + strb r1, [r2] + ldr r3, =0x02022f58 + ldr r2, =gUnknown_085CBE00 + ldr r1, =gUnknown_08329EC8 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r2 + ldr r1, [r0] + adds r0, r3, 0 + bl CopyString + ldr r0, =0x02022f68 + ldr r1, =gUnknown_085CB38A + bl CopyString + ldr r0, =gUnknown_085CB3AA + bl get_battle_strings_ + pop {r0} + bx r0 + .pool + thumb_func_end sub_806CF24 + + thumb_func_start sub_806CF78 +sub_806CF78: @ 806CF78 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _0806CFCC + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806CFB8 + ldr r2, =0x020244b8 + ldrb r1, [r2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r1, =0x0202440c + adds r7, r0, r1 + b _0806CFD8 + .pool +_0806CFB8: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003214 + adds r7, r0, r1 + b _0806CFD6 + .pool +_0806CFCC: + ldr r1, =gItemEffectInfoPointers + subs r0, 0xD + lsls r0, 2 + adds r0, r1 + ldr r7, [r0] +_0806CFD6: + ldr r2, =0x020244b8 +_0806CFD8: + ldr r1, =0x0202420f + ldrb r0, [r2] + strb r0, [r1] + movs r5, 0 + ldr r0, =0x0202420b + mov r8, r0 + movs r6, 0 +_0806CFE6: + adds r4, r7, r5 + ldrb r1, [r4] + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + beq _0806CFF8 + adds r0, r6, 0 + bl sub_806CF24 +_0806CFF8: + ldrb r1, [r4] + movs r0, 0xF0 + ands r0, r1 + cmp r0, 0 + beq _0806D02E + cmp r5, 0 + beq _0806D020 + adds r0, r6, 0x1 + bl sub_806CF24 + b _0806D02E + .pool +_0806D020: + ldr r0, =0x020244b8 + ldrb r0, [r0] + mov r1, r8 + strb r0, [r1] + ldr r0, =gUnknown_085CA459 + bl get_battle_strings_ +_0806D02E: + adds r6, 0x2 + adds r5, 0x1 + cmp r5, 0x2 + ble _0806CFE6 + ldrb r1, [r7, 0x3] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0806D04E + ldr r1, =0x0202420b + ldr r0, =0x020244b8 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, =gUnknown_085CA424 + bl get_battle_strings_ +_0806D04E: + ldr r0, =0x02022e2c + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806CF78 + + thumb_func_start GetNature +@ u8 GetNature(pokemon *mon) +GetNature: @ 806D070 + push {lr} + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + movs r1, 0x19 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end GetNature + + thumb_func_start GetNatureFromPersonality +@ u8 GetNatureFromPersonality(u32 personality) +GetNatureFromPersonality: @ 806D088 + push {lr} + movs r1, 0x19 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end GetNatureFromPersonality + + thumb_func_start GetEvolutionTargetSpecies +GetEvolutionTargetSpecies: @ 806D098 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + mov r8, r0 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 16 + lsrs r2, 16 + mov r9, r2 + movs r0, 0 + mov r10, r0 + mov r0, r8 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + mov r0, r8 + movs r1, 0xC + movs r2, 0 + bl pokemon_getattr + mov r1, sp + strh r0, [r1] + mov r0, r8 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + mov r0, r8 + movs r1, 0x17 + movs r2, 0 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0xC] + lsrs r4, 16 + str r4, [sp, 0x10] + mov r0, sp + ldrh r0, [r0] + cmp r0, 0xAF + bne _0806D10C + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003226 + adds r0, r1 + ldrb r0, [r0] + b _0806D114 + .pool +_0806D10C: + bl itemid_get_x12 + lsls r0, 24 + lsrs r0, 24 +_0806D114: + cmp r0, 0x26 + bne _0806D120 + cmp r5, 0x3 + beq _0806D120 + movs r0, 0 + b _0806D3B0 +_0806D120: + cmp r5, 0x1 + bne _0806D126 + b _0806D340 +_0806D126: + cmp r5, 0x1 + bgt _0806D130 + cmp r5, 0 + beq _0806D144 + b _0806D3AE +_0806D130: + cmp r5, 0x3 + ble _0806D136 + b _0806D3AE +_0806D136: + movs r2, 0 + str r2, [sp, 0x4] + ldr r3, =gEvolutionTable + lsls r6, r7, 2 + b _0806D38E + .pool +_0806D144: + mov r0, r8 + movs r1, 0x38 + movs r2, 0 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + mov r0, r8 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0x4] + lsls r6, r7, 2 +_0806D16A: + ldr r1, =gEvolutionTable + ldr r0, [sp, 0x4] + lsls r2, r0, 3 + adds r0, r6, r7 + lsls r0, 3 + adds r0, r2, r0 + adds r0, r1 + ldrh r0, [r0] + subs r0, 0x1 + adds r3, r1, 0 + adds r4, r2, 0 + cmp r0, 0xE + bls _0806D186 + b _0806D332 +_0806D186: + lsls r0, 2 + ldr r1, =_0806D198 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806D198: + .4byte _0806D1D4 + .4byte _0806D1E6 + .4byte _0806D208 + .4byte _0806D238 + .4byte _0806D332 + .4byte _0806D332 + .4byte _0806D332 + .4byte _0806D248 + .4byte _0806D272 + .4byte _0806D29C + .4byte _0806D2CA + .4byte _0806D2EA + .4byte _0806D30E + .4byte _0806D332 + .4byte _0806D31E +_0806D1D4: + ldr r1, [sp, 0x8] + cmp r1, 0xDB + bhi _0806D1DC + b _0806D332 +_0806D1DC: + adds r0, r6, r7 + lsls r0, 3 + adds r0, r4, r0 + adds r0, r3 + b _0806D228 +_0806D1E6: + bl GameFreakRTC_CalcLocalDateTime + ldr r0, =0x03005cf8 + ldrb r0, [r0, 0x2] + subs r0, 0xC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xB + bls _0806D1FA + b _0806D332 +_0806D1FA: + ldr r2, [sp, 0x8] + cmp r2, 0xDB + bhi _0806D202 + b _0806D332 +_0806D202: + b _0806D21E + .pool +_0806D208: + bl GameFreakRTC_CalcLocalDateTime + ldr r0, =0x03005cf8 + ldrb r0, [r0, 0x2] + cmp r0, 0xB + bls _0806D216 + b _0806D332 +_0806D216: + ldr r0, [sp, 0x8] + cmp r0, 0xDB + bhi _0806D21E + b _0806D332 +_0806D21E: + ldr r1, =gEvolutionTable + adds r0, r6, r7 + lsls r0, 3 + adds r0, r4, r0 + adds r0, r1 +_0806D228: + ldrh r0, [r0, 0x4] + mov r10, r0 + b _0806D332 + .pool +_0806D238: + adds r0, r6, r7 + lsls r0, 3 + adds r0, r4, r0 + adds r1, r0, r3 + ldrh r0, [r1, 0x2] + cmp r0, r9 + bhi _0806D332 + b _0806D32E +_0806D248: + adds r0, r6, r7 + lsls r0, 3 + adds r0, r4, r0 + adds r5, r0, r3 + ldrh r0, [r5, 0x2] + cmp r0, r9 + bhi _0806D332 + mov r0, r8 + movs r1, 0x3B + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + mov r0, r8 + movs r1, 0x3C + movs r2, 0 + bl pokemon_getattr + cmp r4, r0 + bls _0806D332 + b _0806D2C4 +_0806D272: + adds r0, r6, r7 + lsls r0, 3 + adds r0, r4, r0 + adds r5, r0, r3 + ldrh r0, [r5, 0x2] + cmp r0, r9 + bhi _0806D332 + mov r0, r8 + movs r1, 0x3B + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + mov r0, r8 + movs r1, 0x3C + movs r2, 0 + bl pokemon_getattr + cmp r4, r0 + bne _0806D332 + b _0806D2C4 +_0806D29C: + adds r0, r6, r7 + lsls r0, 3 + adds r0, r4, r0 + adds r5, r0, r3 + ldrh r0, [r5, 0x2] + cmp r0, r9 + bhi _0806D332 + mov r0, r8 + movs r1, 0x3B + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + mov r0, r8 + movs r1, 0x3C + movs r2, 0 + bl pokemon_getattr + cmp r4, r0 + bcs _0806D332 +_0806D2C4: + ldrh r5, [r5, 0x4] + mov r10, r5 + b _0806D332 +_0806D2CA: + adds r0, r6, r7 + lsls r0, 3 + adds r0, r4, r0 + adds r4, r0, r3 + ldrh r0, [r4, 0x2] + cmp r0, r9 + bhi _0806D332 + ldr r0, [sp, 0x10] + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4 + bhi _0806D332 + b _0806D308 +_0806D2EA: + adds r0, r6, r7 + lsls r0, 3 + adds r0, r4, r0 + adds r4, r0, r3 + ldrh r0, [r4, 0x2] + cmp r0, r9 + bhi _0806D332 + ldr r0, [sp, 0x10] + movs r1, 0xA + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4 + bls _0806D332 +_0806D308: + ldrh r4, [r4, 0x4] + mov r10, r4 + b _0806D332 +_0806D30E: + adds r0, r6, r7 + lsls r0, 3 + adds r0, r4, r0 + adds r1, r0, r3 + ldrh r0, [r1, 0x2] + cmp r0, r9 + bhi _0806D332 + b _0806D32E +_0806D31E: + adds r0, r6, r7 + lsls r0, 3 + adds r0, r4, r0 + adds r1, r0, r3 + ldrh r0, [r1, 0x2] + ldr r2, [sp, 0xC] + cmp r0, r2 + bhi _0806D332 +_0806D32E: + ldrh r1, [r1, 0x4] + mov r10, r1 +_0806D332: + ldr r0, [sp, 0x4] + adds r0, 0x1 + str r0, [sp, 0x4] + cmp r0, 0x4 + bgt _0806D33E + b _0806D16A +_0806D33E: + b _0806D3AE +_0806D340: + lsls r6, r7, 2 + ldr r1, =gEvolutionTable + adds r0, r6, r7 + lsls r0, 3 + adds r4, r0, r1 + mov r5, sp + movs r1, 0x4 + str r1, [sp, 0x4] +_0806D350: + ldrh r0, [r4] + cmp r0, 0x5 + beq _0806D370 + cmp r0, 0x6 + bne _0806D374 + ldrh r0, [r4, 0x2] + ldrh r1, [r5] + cmp r0, r1 + bne _0806D374 + movs r0, 0 + strh r0, [r5] + mov r0, r8 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr +_0806D370: + ldrh r2, [r4, 0x4] + mov r10, r2 +_0806D374: + adds r4, 0x8 + ldr r0, [sp, 0x4] + subs r0, 0x1 + str r0, [sp, 0x4] + cmp r0, 0 + bge _0806D350 + b _0806D3AE + .pool +_0806D388: + ldrh r1, [r1, 0x4] + mov r10, r1 + b _0806D3AE +_0806D38E: + adds r0, r6, r7 + ldr r1, [sp, 0x4] + adds r0, r1 + lsls r0, 3 + adds r1, r0, r3 + ldrh r0, [r1] + cmp r0, 0x7 + bne _0806D3A4 + ldrh r0, [r1, 0x2] + cmp r0, r9 + beq _0806D388 +_0806D3A4: + ldr r2, [sp, 0x4] + adds r2, 0x1 + str r2, [sp, 0x4] + cmp r2, 0x4 + ble _0806D38E +_0806D3AE: + mov r0, r10 +_0806D3B0: + 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 GetEvolutionTargetSpecies + + thumb_func_start HoennPokedexNumToSpecies +HoennPokedexNumToSpecies: @ 806D3C0 + push {r4,lr} + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _0806D404 + movs r1, 0 + ldr r3, =gSpeciesToHoennPokedexNum + ldrh r0, [r3] + cmp r0, r2 + beq _0806D3EC + movs r4, 0xCD + lsls r4, 1 +_0806D3D8: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r4 + bhi _0806D3EC + lsls r0, r1, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r2 + bne _0806D3D8 +_0806D3EC: + ldr r0, =0x0000019b + cmp r1, r0 + beq _0806D404 + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r0, 16 + b _0806D406 + .pool +_0806D404: + movs r0, 0 +_0806D406: + pop {r4} + pop {r1} + bx r1 + thumb_func_end HoennPokedexNumToSpecies + + thumb_func_start NationalPokedexNumToSpecies +NationalPokedexNumToSpecies: @ 806D40C + push {r4,lr} + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _0806D450 + movs r1, 0 + ldr r3, =gSpeciesToNationalPokedexNum + ldrh r0, [r3] + cmp r0, r2 + beq _0806D438 + movs r4, 0xCD + lsls r4, 1 +_0806D424: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r4 + bhi _0806D438 + lsls r0, r1, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r2 + bne _0806D424 +_0806D438: + ldr r0, =0x0000019b + cmp r1, r0 + beq _0806D450 + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r0, 16 + b _0806D452 + .pool +_0806D450: + movs r0, 0 +_0806D452: + pop {r4} + pop {r1} + bx r1 + thumb_func_end NationalPokedexNumToSpecies + + thumb_func_start NationalToHoennOrder +NationalToHoennOrder: @ 806D458 + push {r4,lr} + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _0806D49C + movs r1, 0 + ldr r3, =gHoennToNationalOrder + ldrh r0, [r3] + cmp r0, r2 + beq _0806D484 + movs r4, 0xCD + lsls r4, 1 +_0806D470: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r4 + bhi _0806D484 + lsls r0, r1, 1 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r2 + bne _0806D470 +_0806D484: + ldr r0, =0x0000019b + cmp r1, r0 + beq _0806D49C + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r0, 16 + b _0806D49E + .pool +_0806D49C: + movs r0, 0 +_0806D49E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end NationalToHoennOrder + + thumb_func_start SpeciesToNationalPokedexNum +SpeciesToNationalPokedexNum: @ 806D4A4 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _0806D4C0 + ldr r0, =gSpeciesToNationalPokedexNum + subs r1, 0x1 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + b _0806D4C2 + .pool +_0806D4C0: + movs r0, 0 +_0806D4C2: + pop {r1} + bx r1 + thumb_func_end SpeciesToNationalPokedexNum + + thumb_func_start SpeciesToHoennPokedexNum +SpeciesToHoennPokedexNum: @ 806D4C8 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _0806D4E4 + ldr r0, =gSpeciesToHoennPokedexNum + subs r1, 0x1 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + b _0806D4E6 + .pool +_0806D4E4: + movs r0, 0 +_0806D4E6: + pop {r1} + bx r1 + thumb_func_end SpeciesToHoennPokedexNum + + thumb_func_start HoennToNationalOrder +HoennToNationalOrder: @ 806D4EC + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _0806D508 + ldr r0, =gHoennToNationalOrder + subs r1, 0x1 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + b _0806D50A + .pool +_0806D508: + movs r0, 0 +_0806D50A: + pop {r1} + bx r1 + thumb_func_end HoennToNationalOrder + + thumb_func_start speciesid_conv +speciesid_conv: @ 806D510 + push {lr} + lsls r0, 16 + lsrs r0, 16 + adds r1, r0, 0 + cmp r0, 0xFA + bls _0806D53E + ldr r0, =0x00000113 + cmp r1, r0 + bls _0806D53C + ldr r0, =gSpeciesIdToCryId + ldr r2, =0xfffffeec + adds r1, r2 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + b _0806D53E + .pool +_0806D53C: + movs r0, 0xC8 +_0806D53E: + pop {r1} + bx r1 + thumb_func_end speciesid_conv + + thumb_func_start sub_806D544 +sub_806D544: @ 806D544 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r6, r1, 0 + mov r10, r2 + lsls r0, 16 + movs r1, 0x9A + lsls r1, 17 + cmp r0, r1 + bne _0806D652 + ldr r0, =0x020244d4 + ldr r1, [r0] + ldr r0, [r1, 0x4] + cmp r10, r0 + beq _0806D652 + ldr r0, [r1, 0xC] + cmp r10, r0 + beq _0806D652 + movs r5, 0 +_0806D570: + lsls r3, r5, 3 + adds r3, r5 + lsls r3, 2 + ldr r0, =gSpindaSpotGraphics + adds r4, r3, r0 + ldrb r1, [r4] + adds r1, 0xF8 + movs r2, 0xF + adds r0, r6, 0 + ands r0, r2 + adds r1, r0 + lsls r1, 24 + lsrs r1, 24 + mov r12, r1 + ldrb r1, [r4, 0x1] + adds r1, 0xF8 + movs r0, 0xF0 + ands r0, r6 + lsrs r0, 4 + adds r1, r0 + lsls r1, 24 + lsrs r1, 24 + movs r2, 0 + lsrs r6, 8 + str r6, [sp, 0x4] + adds r5, 0x1 + str r5, [sp] + mov r9, r3 +_0806D5A8: + lsls r0, r2, 1 + add r0, r9 + ldr r3, =gSpindaSpotGraphics + 0x2 + adds r0, r3 + ldrh r3, [r0] + mov r4, r12 + adds r0, r4, 0 + adds r0, 0x10 + adds r7, r1, 0x1 + adds r2, 0x1 + mov r8, r2 + cmp r4, r0 + bge _0806D640 + lsrs r0, r1, 3 + lsls r6, r0, 8 + movs r0, 0x7 + ands r1, r0 + lsls r5, r1, 2 +_0806D5CC: + adds r0, r4, 0 + cmp r4, 0 + bge _0806D5D4 + adds r0, r4, 0x7 +_0806D5D4: + asrs r0, 3 + lsls r2, r0, 5 + add r2, r10 + lsls r0, 3 + subs r0, r4, r0 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r2, r0 + adds r2, r6 + adds r2, r5 + movs r1, 0x1 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _0806D634 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0806D620 + ldrb r1, [r2] + movs r0, 0xF0 + ands r0, r1 + subs r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x20 + bhi _0806D634 + adds r0, r1, 0 + adds r0, 0x40 + b _0806D632 + .pool +_0806D620: + ldrb r1, [r2] + movs r0, 0xF + ands r0, r1 + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bhi _0806D634 + adds r0, r1, 0x4 +_0806D632: + strb r0, [r2] +_0806D634: + asrs r3, 1 + adds r4, 0x1 + mov r0, r12 + adds r0, 0x10 + cmp r4, r0 + blt _0806D5CC +_0806D640: + lsls r0, r7, 24 + lsrs r1, r0, 24 + mov r2, r8 + cmp r2, 0xF + ble _0806D5A8 + ldr r6, [sp, 0x4] + ldr r5, [sp] + cmp r5, 0x3 + ble _0806D570 +_0806D652: + 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 sub_806D544 + + thumb_func_start DrawSpindaSpots +@ void DrawSpindaSpots(u16 species, u32 personality, u8 *pixels, u8 isFrontPic) +DrawSpindaSpots: @ 806D664 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r5, r1, 0 + str r2, [sp] + lsls r0, 16 + lsls r3, 24 + lsrs r3, 24 + movs r1, 0x9A + lsls r1, 17 + cmp r0, r1 + bne _0806D766 + cmp r3, 0 + beq _0806D766 + movs r6, 0 +_0806D688: + lsls r3, r6, 3 + adds r3, r6 + lsls r3, 2 + ldr r0, =gSpindaSpotGraphics + adds r4, r3, r0 + ldrb r1, [r4] + adds r1, 0xF8 + movs r2, 0xF + adds r0, r5, 0 + ands r0, r2 + adds r1, r0 + lsls r1, 24 + lsrs r1, 24 + mov r12, r1 + ldrb r1, [r4, 0x1] + adds r1, 0xF8 + movs r0, 0xF0 + ands r0, r5 + lsrs r0, 4 + adds r1, r0 + lsls r1, 24 + lsrs r1, 24 + movs r2, 0 + lsrs r5, 8 + str r5, [sp, 0x4] + adds r6, 0x1 + mov r10, r6 + mov r9, r3 +_0806D6C0: + lsls r0, r2, 1 + add r0, r9 + ldr r3, =gSpindaSpotGraphics + 0x2 + adds r0, r3 + ldrh r3, [r0] + mov r4, r12 + adds r0, r4, 0 + adds r0, 0x10 + adds r7, r1, 0x1 + adds r2, 0x1 + mov r8, r2 + cmp r4, r0 + bge _0806D754 + lsrs r0, r1, 3 + lsls r6, r0, 8 + movs r0, 0x7 + ands r1, r0 + lsls r5, r1, 2 +_0806D6E4: + adds r0, r4, 0 + cmp r4, 0 + bge _0806D6EC + adds r0, r4, 0x7 +_0806D6EC: + asrs r0, 3 + lsls r2, r0, 5 + ldr r1, [sp] + adds r2, r1, r2 + lsls r0, 3 + subs r0, r4, r0 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r2, r0 + adds r2, r6 + adds r2, r5 + movs r1, 0x1 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _0806D748 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0806D734 + ldrb r1, [r2] + movs r0, 0xF0 + ands r0, r1 + subs r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x20 + bhi _0806D748 + adds r0, r1, 0 + adds r0, 0x40 + b _0806D746 + .pool +_0806D734: + ldrb r1, [r2] + movs r0, 0xF + ands r0, r1 + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bhi _0806D748 + adds r0, r1, 0x4 +_0806D746: + strb r0, [r2] +_0806D748: + asrs r3, 1 + adds r4, 0x1 + mov r0, r12 + adds r0, 0x10 + cmp r4, r0 + blt _0806D6E4 +_0806D754: + lsls r0, r7, 24 + lsrs r1, r0, 24 + mov r2, r8 + cmp r2, 0xF + ble _0806D6C0 + ldr r5, [sp, 0x4] + mov r6, r10 + cmp r6, 0x3 + ble _0806D688 +_0806D766: + 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 DrawSpindaSpots + + thumb_func_start sub_806D778 +sub_806D778: @ 806D778 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r5, r0, 0 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + ldr r0, =0x02021cc4 + mov r9, r0 + adds r0, r5, 0 + movs r1, 0x2 + mov r2, r9 + bl pokemon_getattr + mov r4, sp + adds r0, r5, 0 + movs r1, 0x3 + mov r2, sp + bl pokemon_getattr + strb r0, [r4] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0806D7D4 + movs r6, 0xB + adds r0, r7, 0 + muls r0, r6 + ldr r4, =gSpeciesNames + adds r0, r4 + mov r1, r9 + bl CompareString + cmp r0, 0 + bne _0806D7D4 + mov r2, r8 + muls r2, r6 + adds r2, r4 + adds r0, r5, 0 + movs r1, 0x2 + bl pokemon_setattr +_0806D7D4: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806D778 + + thumb_func_start sub_806D7EC +sub_806D7EC: @ 806D7EC + push {r4,r5,lr} + movs r5, 0 + ldr r4, =0x020229e8 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r1, 0x18] + cmp r0, 0x2 + bgt _0806D818 + cmp r0, 0x1 + bge _0806D820 + cmp r0, 0 + beq _0806D81C + b _0806D822 + .pool +_0806D818: + cmp r0, 0x3 + bne _0806D822 +_0806D81C: + movs r5, 0 + b _0806D822 +_0806D820: + movs r5, 0x1 +_0806D822: + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_806D7EC + + thumb_func_start sub_806D82C +sub_806D82C: @ 806D82C + push {lr} + lsls r0, 24 + lsrs r0, 24 + movs r3, 0 + ldr r2, =0x020229e8 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x18] + cmp r0, 0x2 + bgt _0806D854 + cmp r0, 0x1 + bge _0806D85C + cmp r0, 0 + beq _0806D858 + b _0806D85E + .pool +_0806D854: + cmp r0, 0x3 + bne _0806D85E +_0806D858: + movs r3, 0 + b _0806D85E +_0806D85C: + movs r3, 0x1 +_0806D85E: + adds r0, r3, 0 + pop {r1} + bx r1 + thumb_func_end sub_806D82C + + thumb_func_start sub_806D864 +sub_806D864: @ 806D864 + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r1, =0x020229e8 + b _0806D87C + .pool +_0806D874: + adds r1, 0x1C + adds r2, 0x1 + cmp r2, 0x3 + bgt _0806D882 +_0806D87C: + ldrh r0, [r1, 0x18] + cmp r0, r3 + bne _0806D874 +_0806D882: + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_806D864 + + thumb_func_start GetTrainerEncounterMusicId +@ u8 GetTrainerEncounterMusicId(u16 trainerOpponentId) +GetTrainerEncounterMusicId: @ 806D888 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _0806D8A2 + adds r0, r4, 0 + bl sub_81A9F3C + b _0806D8CA +_0806D8A2: + bl sub_81D5C18 + lsls r0, 24 + cmp r0, 0 + bne _0806D8C4 + ldr r1, =gTrainers + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x2] + movs r0, 0x7F + ands r0, r1 + b _0806D8CE + .pool +_0806D8C4: + adds r0, r5, 0 + bl sub_81D63C8 +_0806D8CA: + lsls r0, 24 + lsrs r0, 24 +_0806D8CE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end GetTrainerEncounterMusicId + + thumb_func_start nature_stat_mod +nature_stat_mod: @ 806D8D4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + lsrs r3, r1, 16 + lsls r2, 24 + lsrs r5, r2, 24 + movs r0, 0xFF + lsls r0, 24 + adds r2, r0 + lsrs r2, 24 + cmp r2, 0x4 + bls _0806D8F2 + adds r0, r3, 0 + b _0806D92E +_0806D8F2: + ldr r0, =gNatureStatTable + lsls r1, r4, 2 + adds r1, r4 + subs r1, 0x1 + adds r1, r5, r1 + adds r1, r0 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0806D918 + cmp r1, 0x1 + bne _0806D92C + movs r0, 0x6E + b _0806D91A + .pool +_0806D918: + movs r0, 0x5A +_0806D91A: + muls r0, r3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + b _0806D92E +_0806D92C: + adds r0, r3, 0 +_0806D92E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end nature_stat_mod + + thumb_func_start happiness_algorithm +happiness_algorithm: @ 806D934 + push {r4-r7,lr} + sub sp, 0x4 + adds r7, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + bl sub_806F104 + lsls r0, 24 + cmp r0, 0 + beq _0806D94A + b _0806DAC2 +_0806D94A: + adds r0, r7, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r7, 0 + movs r1, 0xC + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _0806D9A0 + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806D98C + ldr r0, =0x02024404 + ldrb r4, [r0, 0x7] + b _0806D9A8 + .pool +_0806D98C: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003226 + adds r0, r1 + ldrb r4, [r0] + b _0806D9A8 + .pool +_0806D9A0: + bl itemid_get_x12 + lsls r0, 24 + lsrs r4, r0, 24 +_0806D9A8: + cmp r6, 0 + bne _0806D9AE + b _0806DAC2 +_0806D9AE: + movs r0, 0xCE + lsls r0, 1 + cmp r6, r0 + bne _0806D9B8 + b _0806DAC2 +_0806D9B8: + movs r6, 0 + adds r0, r7, 0 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r1, sp + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x63 + ble _0806D9D6 + movs r6, 0x1 +_0806D9D6: + cmp r0, 0xC7 + ble _0806D9E0 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0806D9E0: + cmp r5, 0x5 + bne _0806D9F0 + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + bne _0806DAC2 +_0806D9F0: + cmp r5, 0x3 + bne _0806DA20 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0806DAC2 + ldr r2, =gTrainers + ldr r0, =0x02038bca + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r1, [r0, 0x1] + adds r0, r1, 0 + subs r0, 0x1F + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _0806DA20 + cmp r1, 0x26 + bne _0806DAC2 +_0806DA20: + ldr r1, =gUnknown_08329ECE + lsls r0, r5, 1 + adds r0, r5 + adds r0, r6, r0 + adds r0, r1 + ldrb r2, [r0] + movs r1, 0 + ldrsb r1, [r0, r1] + cmp r1, 0 + ble _0806DA46 + cmp r4, 0x1B + bne _0806DA46 + movs r0, 0x96 + muls r0, r1 + movs r1, 0x64 + bl __divsi3 + lsls r0, 24 + lsrs r2, r0, 24 +_0806DA46: + lsls r2, 24 + asrs r2, 24 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + adds r0, r2 + mov r1, sp + strh r0, [r1] + cmp r2, 0 + ble _0806DA98 + adds r0, r7, 0 + movs r1, 0x26 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0xB + bne _0806DA74 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + adds r0, 0x1 + mov r1, sp + strh r0, [r1] +_0806DA74: + adds r0, r7, 0 + movs r1, 0x23 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + bl sav1_map_get_name + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _0806DA98 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + adds r0, 0x1 + mov r1, sp + strh r0, [r1] +_0806DA98: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _0806DAA8 + movs r1, 0 + mov r0, sp + strh r1, [r0] +_0806DAA8: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0xFF + ble _0806DAB8 + movs r1, 0xFF + mov r0, sp + strh r1, [r0] +_0806DAB8: + adds r0, r7, 0 + movs r1, 0x20 + mov r2, sp + bl pokemon_setattr +_0806DAC2: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end happiness_algorithm + + thumb_func_start sub_806DADC +sub_806DADC: @ 806DADC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + mov r8, r0 + lsls r1, 16 + lsrs r5, r1, 16 + movs r4, 0 + movs r7, 0 + movs r6, 0 +_0806DAF0: + adds r1, r6, 0 + adds r1, 0x1A + mov r0, r8 + movs r2, 0 + bl pokemon_getattr + mov r2, sp + adds r1, r2, r6 + strb r0, [r1] + ldrb r0, [r1] + adds r0, r7, r0 + lsls r0, 16 + lsrs r7, r0, 16 + adds r6, 0x1 + cmp r6, 0x5 + ble _0806DAF0 + movs r6, 0 + b _0806DC72 +_0806DB14: + mov r0, r8 + movs r1, 0 + bl sub_806DDE4 + lsls r0, 24 + movs r2, 0x1 + cmp r0, 0 + beq _0806DB26 + movs r2, 0x2 +_0806DB26: + cmp r6, 0x5 + bhi _0806DBC8 + lsls r0, r6, 2 + ldr r1, =_0806DB38 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806DB38: + .4byte _0806DB50 + .4byte _0806DB64 + .4byte _0806DB78 + .4byte _0806DB8C + .4byte _0806DBA0 + .4byte _0806DBB4 +_0806DB50: + ldr r0, =gBaseStats + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + lsls r0, 30 + b _0806DBC2 + .pool +_0806DB64: + ldr r0, =gBaseStats + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + b _0806DBC0 + .pool +_0806DB78: + ldr r0, =gBaseStats + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + lsls r0, 26 + b _0806DBC2 + .pool +_0806DB8C: + ldr r0, =gBaseStats + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xA] + lsrs r0, 6 + b _0806DBC4 + .pool +_0806DBA0: + ldr r0, =gBaseStats + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xB] + lsls r0, 30 + b _0806DBC2 + .pool +_0806DBB4: + ldr r0, =gBaseStats + lsls r1, r5, 3 + subs r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0xB] +_0806DBC0: + lsls r0, 28 +_0806DBC2: + lsrs r0, 30 +_0806DBC4: + adds r4, r0, 0 + muls r4, r2 +_0806DBC8: + mov r0, r8 + movs r1, 0xC + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAF + bne _0806DC14 + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806DC00 + ldr r0, =0x02024404 + ldrb r0, [r0, 0x7] + b _0806DC1C + .pool +_0806DC00: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00003226 + adds r0, r2 + ldrb r0, [r0] + b _0806DC1C + .pool +_0806DC14: + bl itemid_get_x12 + lsls r0, 24 + lsrs r0, 24 +_0806DC1C: + cmp r0, 0x18 + bne _0806DC24 + lsls r0, r4, 17 + lsrs r4, r0, 16 +_0806DC24: + lsls r0, r4, 16 + asrs r2, r0, 16 + adds r1, r7, r2 + movs r0, 0xFF + lsls r0, 1 + cmp r1, r0 + ble _0806DC3C + adds r0, r2, r0 + adds r1, r7, r4 + subs r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 +_0806DC3C: + mov r0, sp + adds r2, r0, r6 + ldrb r3, [r2] + lsls r0, r4, 16 + asrs r1, r0, 16 + adds r0, r3, r1 + cmp r0, 0xFF + ble _0806DC58 + adds r0, r1, 0 + adds r0, 0xFF + adds r1, r3, r4 + subs r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 +_0806DC58: + adds r0, r3, r4 + strb r0, [r2] + adds r0, r7, r4 + lsls r0, 16 + lsrs r7, r0, 16 + adds r1, r6, 0 + adds r1, 0x1A + mov r0, r8 + bl pokemon_setattr + adds r6, 0x1 + cmp r6, 0x5 + bgt _0806DC7A +_0806DC72: + ldr r0, =0x000001fd + cmp r7, r0 + bhi _0806DC7A + b _0806DB14 +_0806DC7A: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806DADC + + thumb_func_start sub_806DC8C +sub_806DC8C: @ 806DC8C + push {r4-r6,lr} + adds r6, r0, 0 + movs r5, 0 + movs r4, 0 +_0806DC94: + adds r1, r4, 0 + adds r1, 0x1A + adds r0, r6, 0 + movs r2, 0 + bl pokemon_getattr + adds r0, r5, r0 + lsls r0, 16 + lsrs r5, r0, 16 + adds r4, 0x1 + cmp r4, 0x5 + ble _0806DC94 + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_806DC8C + + thumb_func_start sub_806DCB4 +sub_806DCB4: @ 806DCB4 + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r5, r0, 16 + movs r0, 0x80 + lsls r0, 7 + cmp r5, r0 + beq _0806DCDA + movs r0, 0x80 + lsls r0, 8 + cmp r5, r0 + beq _0806DCDA + movs r0, 0xC0 + lsls r0, 8 + cmp r5, r0 + bne _0806DD70 +_0806DCDA: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 16 + lsrs r5, r0, 16 + movs r0, 0x64 + muls r0, r5 + adds r4, r6, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _0806DCDA + adds r0, r4, 0 + movs r1, 0x2D + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0806DCDA + ldr r1, =gUnknown_0832A328 + lsls r0, r5, 2 + adds r0, r1 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_806DDE4 + lsls r0, 24 + cmp r0, 0 + bne _0806DD70 + movs r4, 0x7 +_0806DD24: + bl GenerateRandomNumber + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + strb r0, [r1] + adds r2, r0, 0 + adds r1, r2, 0 + ands r1, r4 + cmp r1, 0 + beq _0806DD24 + movs r0, 0xF0 + ands r0, r2 + cmp r0, 0 + beq _0806DD46 + mov r0, sp + strb r1, [r0] +_0806DD46: + mov r0, sp + ldrb r0, [r0] + lsls r1, r0, 4 + orrs r0, r1 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + strb r0, [r1] + movs r1, 0xF3 + ands r1, r0 + mov r0, sp + strb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + movs r0, 0x64 + muls r0, r5 + adds r0, r6, r0 + movs r1, 0x22 + mov r2, sp + bl pokemon_setattr +_0806DD70: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806DCB4 + + thumb_func_start sub_806DD7C +sub_806DD7C: @ 806DD7C + push {r4-r7,lr} + sub sp, 0x4 + adds r7, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + movs r3, 0 + movs r6, 0x1 + movs r5, 0 + cmp r4, 0 + beq _0806DDC4 +_0806DD90: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0806DDB8 + movs r0, 0x64 + muls r0, r3 + adds r0, r7, r0 + movs r1, 0x22 + movs r2, 0 + str r3, [sp] + bl pokemon_getattr + movs r1, 0xF + ands r1, r0 + ldr r3, [sp] + cmp r1, 0 + beq _0806DDB8 + orrs r5, r6 + lsls r0, r5, 24 + lsrs r5, r0, 24 +_0806DDB8: + adds r3, 0x1 + lsls r6, 1 + lsrs r4, 1 + cmp r4, 0 + bne _0806DD90 + b _0806DDD8 +_0806DDC4: + adds r0, r7, 0 + movs r1, 0x22 + movs r2, 0 + bl pokemon_getattr + movs r1, 0xF + ands r1, r0 + cmp r1, 0 + beq _0806DDD8 + movs r5, 0x1 +_0806DDD8: + adds r0, r5, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_806DD7C + + thumb_func_start sub_806DDE4 +sub_806DDE4: @ 806DDE4 + push {r4-r7,lr} + sub sp, 0x4 + adds r7, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + movs r3, 0 + movs r6, 0x1 + movs r5, 0 + cmp r4, 0 + beq _0806DE28 +_0806DDF8: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0806DE1C + movs r0, 0x64 + muls r0, r3 + adds r0, r7, r0 + movs r1, 0x22 + movs r2, 0 + str r3, [sp] + bl pokemon_getattr + ldr r3, [sp] + cmp r0, 0 + beq _0806DE1C + orrs r5, r6 + lsls r0, r5, 24 + lsrs r5, r0, 24 +_0806DE1C: + adds r3, 0x1 + lsls r6, 1 + lsrs r4, 1 + cmp r4, 0 + bne _0806DDF8 + b _0806DE38 +_0806DE28: + adds r0, r7, 0 + movs r1, 0x22 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _0806DE38 + movs r5, 0x1 +_0806DE38: + adds r0, r5, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_806DDE4 + + thumb_func_start sub_806DE44 +sub_806DE44: @ 806DE44 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r7, r0, 16 + movs r6, 0 + mov r5, sp +_0806DE50: + movs r0, 0x64 + adds r1, r6, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _0806DEB2 + adds r0, r4, 0 + movs r1, 0x22 + movs r2, 0 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + strb r0, [r5] + movs r1, 0xF + adds r2, r0, 0 + ands r1, r2 + cmp r1, 0 + beq _0806DEB2 + cmp r1, r7 + bcc _0806DE8A + cmp r7, 0x4 + bls _0806DE94 +_0806DE8A: + movs r0, 0xF0 + ands r0, r2 + b _0806DE96 + .pool +_0806DE94: + subs r0, r2, r7 +_0806DE96: + strb r0, [r5] + ldrb r0, [r5] + cmp r0, 0 + bne _0806DEA2 + movs r0, 0x10 + strb r0, [r5] +_0806DEA2: + movs r0, 0x64 + muls r0, r6 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x22 + mov r2, sp + bl pokemon_setattr +_0806DEB2: + adds r6, 0x1 + cmp r6, 0x5 + ble _0806DE50 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806DE44 + + thumb_func_start sub_806DEC4 +sub_806DEC4: @ 806DEC4 + push {r4-r7,lr} + sub sp, 0x4 + adds r7, r0, 0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _0806DF6A + movs r5, 0 +_0806DEE0: + movs r0, 0x64 + adds r6, r5, 0 + muls r6, r0 + adds r4, r7, r6 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _0806DF64 + adds r0, r4, 0 + movs r1, 0x22 + movs r2, 0 + bl pokemon_getattr + lsls r0, 24 + lsrs r1, r0, 24 + mov r0, sp + strb r1, [r0] + cmp r1, 0 + beq _0806DF64 + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + beq _0806DF64 + cmp r5, 0 + beq _0806DF3A + adds r0, r6, 0 + subs r0, 0x64 + adds r4, r7, r0 + adds r0, r4, 0 + movs r1, 0x22 + movs r2, 0 + bl pokemon_getattr + movs r1, 0xF0 + ands r1, r0 + cmp r1, 0 + bne _0806DF3A + adds r0, r4, 0 + movs r1, 0x22 + mov r2, sp + bl pokemon_setattr +_0806DF3A: + cmp r5, 0x5 + beq _0806DF64 + movs r0, 0x64 + muls r0, r5 + adds r0, 0x64 + adds r4, r7, r0 + adds r0, r4, 0 + movs r1, 0x22 + movs r2, 0 + bl pokemon_getattr + movs r1, 0xF0 + ands r1, r0 + cmp r1, 0 + bne _0806DF64 + adds r0, r4, 0 + movs r1, 0x22 + mov r2, sp + bl pokemon_setattr + adds r5, 0x1 +_0806DF64: + adds r5, 0x1 + cmp r5, 0x5 + ble _0806DEE0 +_0806DF6A: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_806DEC4 + + thumb_func_start sub_806DF74 +sub_806DF74: @ 806DF74 + push {r4-r6,lr} + sub sp, 0x8 + adds r5, r0, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x38 + movs r2, 0 + bl pokemon_getattr + adds r0, 0x1 + mov r1, sp + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x19 + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x4] + ldr r6, =gExperienceTables + ldr r2, =gBaseStats + lsls r1, r4, 3 + subs r1, r4 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x13] + movs r1, 0xCA + lsls r1, 1 + adds r4, r2, 0 + muls r4, r1 + movs r2, 0xC8 + lsls r2, 1 + adds r1, r6, r2 + adds r1, r4, r1 + ldr r1, [r1] + cmp r0, r1 + bls _0806DFD4 + str r1, [sp, 0x4] + add r2, sp, 0x4 + adds r0, r5, 0 + movs r1, 0x19 + bl pokemon_setattr +_0806DFD4: + mov r0, sp + ldrb r0, [r0] + cmp r0, 0x64 + bhi _0806DFEA + lsls r0, 2 + adds r0, r4 + adds r0, r6 + ldr r1, [sp, 0x4] + ldr r0, [r0] + cmp r1, r0 + bcs _0806DFF8 +_0806DFEA: + movs r0, 0 + b _0806E004 + .pool +_0806DFF8: + adds r0, r5, 0 + movs r1, 0x38 + mov r2, sp + bl pokemon_setattr + movs r0, 0x1 +_0806E004: + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_806DF74 + + thumb_func_start sub_806E00C +sub_806E00C: @ 806E00C + push {r4,r5,lr} + lsls r1, 24 + lsrs r4, r1, 24 + adds r5, r4, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + adds r3, r1, 0 + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + bne _0806E02E + movs r0, 0 + b _0806E05A +_0806E02E: + cmp r4, 0x1F + bls _0806E04C + adds r0, r4, 0 + subs r0, 0x20 + movs r2, 0x1 + lsls r2, r0 + ldr r0, =gTMHMLearnsets + lsls r1, 3 + adds r0, 0x4 + adds r1, r0 + ldr r0, [r1] + ands r0, r2 + b _0806E05A + .pool +_0806E04C: + movs r1, 0x1 + lsls r1, r5 + ldr r2, =gTMHMLearnsets + lsls r0, r3, 3 + adds r0, r2 + ldr r0, [r0] + ands r0, r1 +_0806E05A: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806E00C + + thumb_func_start sub_806E064 +sub_806E064: @ 806E064 + push {r4,lr} + lsls r0, 16 + lsrs r3, r0, 16 + adds r4, r3, 0 + lsls r1, 24 + lsrs r1, 24 + adds r2, r1, 0 + movs r0, 0xCE + lsls r0, 1 + cmp r3, r0 + bne _0806E07E + movs r0, 0 + b _0806E0AA +_0806E07E: + cmp r1, 0x1F + bls _0806E09C + adds r0, r1, 0 + subs r0, 0x20 + movs r2, 0x1 + lsls r2, r0 + ldr r0, =gTMHMLearnsets + lsls r1, r3, 3 + adds r0, 0x4 + adds r1, r0 + ldr r0, [r1] + ands r0, r2 + b _0806E0AA + .pool +_0806E09C: + movs r1, 0x1 + lsls r1, r2 + ldr r2, =gTMHMLearnsets + lsls r0, r4, 3 + adds r0, r2 + ldr r0, [r0] + ands r0, r1 +_0806E0AA: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806E064 + + thumb_func_start sub_806E0B4 +sub_806E0B4: @ 806E0B4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + adds r6, r0, 0 + str r1, [sp, 0x8] + movs r0, 0 + mov r10, r0 + adds r0, r6, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r6, 0 + movs r1, 0x38 + movs r2, 0 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0xC] + movs r5, 0 + mov r4, sp +_0806E0EA: + adds r1, r5, 0 + adds r1, 0xD + adds r0, r6, 0 + movs r2, 0 + bl pokemon_getattr + strh r0, [r4] + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _0806E0EA + movs r5, 0 + ldr r6, =gLevelUpLearnsetPointers + lsls r1, r7, 2 + adds r2, r1, r6 + ldr r3, [r2] + ldrh r0, [r3] + ldr r4, =0x0000ffff + str r1, [sp, 0x14] + cmp r0, r4 + beq _0806E1E4 + mov r9, r2 + str r3, [sp, 0x10] +_0806E118: + lsls r2, r5, 1 + ldr r1, [sp, 0x10] + adds r0, r2, r1 + ldrh r3, [r0] + movs r0, 0xFE + lsls r0, 8 + ands r0, r3 + ldr r4, [sp, 0xC] + lsls r1, r4, 9 + adds r7, r2, 0 + adds r5, 0x1 + mov r12, r5 + cmp r0, r1 + bgt _0806E1CE + movs r4, 0 + mov r0, sp + ldrh r1, [r0] + ldr r0, =0x000001ff + ands r0, r3 + cmp r1, r0 + beq _0806E168 + ldr r0, [sp, 0x14] + ldr r1, =gLevelUpLearnsetPointers + adds r6, r0, r1 + ldr r2, =0x000001ff + mov r8, r2 + mov r3, sp + adds r5, r7, 0 +_0806E150: + adds r3, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + bgt _0806E168 + ldr r0, [r6] + adds r0, r5, r0 + ldrh r1, [r0] + ldrh r2, [r3] + mov r0, r8 + ands r0, r1 + cmp r2, r0 + bne _0806E150 +_0806E168: + cmp r4, 0x4 + bne _0806E1CE + movs r4, 0 + cmp r4, r10 + bge _0806E1AC + mov r1, r9 + ldr r0, [r1] + adds r0, r7, r0 + ldrh r1, [r0] + ldr r0, [sp, 0x8] + ldrh r2, [r0] + ldr r0, =0x000001ff + ands r0, r1 + cmp r2, r0 + beq _0806E1AC + ldr r1, [sp, 0x14] + ldr r2, =gLevelUpLearnsetPointers + adds r6, r1, r2 + ldr r0, =0x000001ff + mov r8, r0 + ldr r3, [sp, 0x8] + adds r5, r7, 0 +_0806E194: + adds r3, 0x2 + adds r4, 0x1 + cmp r4, r10 + bge _0806E1AC + ldr r0, [r6] + adds r0, r5, r0 + ldrh r1, [r0] + ldrh r2, [r3] + mov r0, r8 + ands r0, r1 + cmp r2, r0 + bne _0806E194 +_0806E1AC: + cmp r4, r10 + bne _0806E1CE + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r2, r4, 1 + ldr r1, [sp, 0x8] + adds r2, r1 + mov r4, r9 + ldr r0, [r4] + adds r0, r7, r0 + ldrh r1, [r0] + ldr r0, =0x000001ff + ands r0, r1 + strh r0, [r2] +_0806E1CE: + mov r5, r12 + cmp r5, 0x13 + bgt _0806E1E4 + mov r1, r9 + ldr r0, [r1] + lsls r1, r5, 1 + adds r1, r0 + ldrh r0, [r1] + ldr r2, =0x0000ffff + cmp r0, r2 + bne _0806E118 +_0806E1E4: + mov r0, r10 + 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_806E0B4 + + thumb_func_start sub_806E204 +sub_806E204: @ 806E204 + push {r4-r7,lr} + adds r6, r1, 0 + lsls r0, 16 + movs r5, 0 + movs r4, 0 + ldr r1, =gLevelUpLearnsetPointers + lsrs r0, 14 + adds r0, r1 + ldr r2, [r0] + ldrh r0, [r2] + ldr r1, =0x0000ffff + cmp r0, r1 + beq _0806E248 + ldr r0, =0x000001ff + mov r12, r0 + adds r7, r1, 0 + adds r3, r2, 0 +_0806E226: + adds r1, r5, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 1 + adds r1, r6 + ldrh r2, [r3] + mov r0, r12 + ands r0, r2 + strh r0, [r1] + adds r3, 0x2 + adds r4, 0x1 + cmp r4, 0x13 + bgt _0806E248 + ldrh r0, [r3] + cmp r0, r7 + bne _0806E226 +_0806E248: + adds r0, r5, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806E204 + + thumb_func_start sub_806E25C +sub_806E25C: @ 806E25C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x3C + adds r6, r0, 0 + movs r0, 0 + mov r10, r0 + adds r0, r6, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r6, 0 + movs r1, 0x38 + movs r2, 0 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x30] + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + bne _0806E298 + movs r0, 0 + b _0806E3A2 +_0806E298: + movs r5, 0 + lsls r4, 2 + str r4, [sp, 0x38] + mov r4, sp +_0806E2A0: + adds r1, r5, 0 + adds r1, 0xD + adds r0, r6, 0 + movs r2, 0 + bl pokemon_getattr + strh r0, [r4] + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _0806E2A0 + movs r5, 0 + ldr r3, =gLevelUpLearnsetPointers + ldr r2, [sp, 0x38] + adds r1, r2, r3 + ldr r0, [r1] + ldrh r0, [r0] + ldr r2, =0x0000ffff + cmp r0, r2 + beq _0806E3A0 + mov r9, r1 + mov r4, sp + adds r4, 0x8 + str r4, [sp, 0x34] +_0806E2D0: + mov r1, r9 + ldr r0, [r1] + lsls r2, r5, 1 + adds r0, r2, r0 + ldrh r3, [r0] + movs r0, 0xFE + lsls r0, 8 + ands r0, r3 + ldr r4, [sp, 0x30] + lsls r1, r4, 9 + adds r7, r2, 0 + adds r5, 0x1 + mov r12, r5 + cmp r0, r1 + bgt _0806E38A + movs r4, 0 + mov r0, sp + ldrh r1, [r0] + ldr r0, =0x000001ff + ands r0, r3 + cmp r1, r0 + beq _0806E322 + ldr r0, [sp, 0x38] + ldr r1, =gLevelUpLearnsetPointers + adds r6, r0, r1 + ldr r2, =0x000001ff + mov r8, r2 + mov r3, sp + adds r5, r7, 0 +_0806E30A: + adds r3, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + bgt _0806E322 + ldr r0, [r6] + adds r0, r5, r0 + ldrh r1, [r0] + ldrh r2, [r3] + mov r0, r8 + ands r0, r1 + cmp r2, r0 + bne _0806E30A +_0806E322: + cmp r4, 0x4 + bne _0806E38A + movs r4, 0 + cmp r4, r10 + bge _0806E368 + mov r1, r9 + ldr r0, [r1] + adds r0, r7, r0 + ldrh r1, [r0] + ldr r0, [sp, 0x34] + ldrh r2, [r0] + ldr r0, =0x000001ff + ands r0, r1 + add r1, sp, 0x8 + cmp r2, r0 + beq _0806E368 + ldr r2, [sp, 0x38] + ldr r0, =gLevelUpLearnsetPointers + adds r6, r2, r0 + ldr r2, =0x000001ff + mov r8, r2 + adds r3, r1, 0 + adds r5, r7, 0 +_0806E350: + adds r3, 0x2 + adds r4, 0x1 + cmp r4, r10 + bge _0806E368 + ldr r0, [r6] + adds r0, r5, r0 + ldrh r1, [r0] + ldrh r2, [r3] + mov r0, r8 + ands r0, r1 + cmp r2, r0 + bne _0806E350 +_0806E368: + cmp r4, r10 + bne _0806E38A + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r2, r4, 1 + ldr r4, [sp, 0x34] + adds r2, r4, r2 + mov r1, r9 + ldr r0, [r1] + adds r0, r7, r0 + ldrh r1, [r0] + ldr r0, =0x000001ff + ands r0, r1 + strh r0, [r2] +_0806E38A: + mov r5, r12 + cmp r5, 0x13 + bgt _0806E3A0 + mov r2, r9 + ldr r0, [r2] + lsls r1, r5, 1 + adds r1, r0 + ldrh r0, [r1] + ldr r4, =0x0000ffff + cmp r0, r4 + bne _0806E2D0 +_0806E3A0: + mov r0, r10 +_0806E3A2: + add sp, 0x3C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806E25C + + thumb_func_start sub_806E3C0 +sub_806E3C0: @ 806E3C0 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + bl sub_809D42C + cmp r0, 0 + beq _0806E3DA + adds r0, r4, 0 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + b _0806E3F2 +_0806E3DA: + adds r0, r4, 0 + bl SpeciesToHoennPokedexNum + adds r4, r0, 0 + cmp r4, 0xCA + bls _0806E3F0 + ldr r0, =0x0000ffff + b _0806E3F2 + .pool +_0806E3F0: + adds r0, r4, 0 +_0806E3F2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_806E3C0 + + thumb_func_start sub_806E3F8 +sub_806E3F8: @ 806E3F8 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl SpeciesToHoennPokedexNum + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xCA + bhi _0806E40E + movs r0, 0x1 + b _0806E410 +_0806E40E: + movs r0, 0 +_0806E410: + pop {r1} + bx r1 + thumb_func_end sub_806E3F8 + + thumb_func_start sub_806E414 +sub_806E414: @ 806E414 + push {lr} + ldr r1, =0x020244e4 + movs r2, 0 + adds r0, r1, 0x3 +_0806E41C: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _0806E41C + pop {r0} + bx r0 + .pool + thumb_func_end sub_806E414 + + thumb_func_start song_id_for_battle +song_id_for_battle: @ 806E42C + push {lr} + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 5 + ands r0, r1 + cmp r0, 0 + beq _0806E448 + movs r0, 0xF0 + lsls r0, 1 + b _0806E646 + .pool +_0806E448: + movs r0, 0x80 + lsls r0, 7 + ands r0, r1 + cmp r0, 0 + beq _0806E45C + ldr r0, =0x000001df + b _0806E646 + .pool +_0806E45C: + ldr r0, =0x02000002 + ands r0, r1 + cmp r0, 0 + beq _0806E466 + b _0806E63C +_0806E466: + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0806E470 + b _0806E642 +_0806E470: + ldr r0, =0x003f0100 + ands r0, r1 + cmp r0, 0 + beq _0806E494 + ldr r0, =0x02038bca + ldrh r0, [r0] + bl sub_8162BD8 + lsls r0, 24 + lsrs r0, 24 + b _0806E4B2 + .pool +_0806E494: + movs r0, 0x80 + lsls r0, 19 + ands r1, r0 + cmp r1, 0 + beq _0806E4A2 + movs r0, 0xA + b _0806E4B2 +_0806E4A2: + ldr r2, =gTrainers + ldr r0, =0x02038bca + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x1] +_0806E4B2: + subs r0, 0x3 + cmp r0, 0x3D + bls _0806E4BA + b _0806E63C +_0806E4BA: + lsls r0, 2 + ldr r1, =_0806E4D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0806E4D0: + .4byte _0806E5D0 + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E5D0 + .4byte _0806E63C + .4byte _0806E5D0 + .4byte _0806E63C + .4byte _0806E5C8 + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E62C + .4byte _0806E5D8 + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E5E0 + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E5D0 + .4byte _0806E5E6 + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E5C8 + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E63C + .4byte _0806E632 + .4byte _0806E632 + .4byte _0806E632 + .4byte _0806E632 + .4byte _0806E632 + .4byte _0806E632 + .4byte _0806E632 +_0806E5C8: + ldr r0, =0x000001e3 + b _0806E646 + .pool +_0806E5D0: + ldr r0, =0x000001db + b _0806E646 + .pool +_0806E5D8: + ldr r0, =0x000001dd + b _0806E646 + .pool +_0806E5E0: + movs r0, 0xEF + lsls r0, 1 + b _0806E646 +_0806E5E6: + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x003f0100 + ands r0, r1 + cmp r0, 0 + beq _0806E604 +_0806E5F2: + ldr r0, =0x000001e1 + b _0806E646 + .pool +_0806E604: + ldr r0, =0x02038bca + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, =gTrainers + 0x4 @ name offset + adds r0, r1 + ldr r1, =gUnknown_085CCB98 + bl CompareString + cmp r0, 0 + beq _0806E63C + b _0806E5F2 + .pool +_0806E62C: + movs r0, 0xF1 + lsls r0, 1 + b _0806E646 +_0806E632: + ldr r0, =0x000001d7 + b _0806E646 + .pool +_0806E63C: + movs r0, 0xEE + lsls r0, 1 + b _0806E646 +_0806E642: + movs r0, 0xED + lsls r0, 1 +_0806E646: + pop {r1} + bx r1 + thumb_func_end song_id_for_battle + + thumb_func_start sub_806E64C +sub_806E64C: @ 806E64C + push {lr} + bl map_music_set_to_zero + bl m4aMPlayAllStop + bl song_id_for_battle + lsls r0, 16 + lsrs r0, 16 + bl song_play_for_text + pop {r0} + bx r0 + thumb_func_end sub_806E64C + + thumb_func_start current_map_music_set__default_for_battle +current_map_music_set__default_for_battle: @ 806E668 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + bl map_music_set_to_zero + bl m4aMPlayAllStop + cmp r4, 0 + beq _0806E682 + adds r0, r4, 0 + bl current_map_music_set + b _0806E68E +_0806E682: + bl song_id_for_battle + lsls r0, 16 + lsrs r0, 16 + bl current_map_music_set +_0806E68E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end current_map_music_set__default_for_battle + + thumb_func_start sub_806E694 +sub_806E694: @ 806E694 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl map_music_set_to_zero + bl m4aMPlayAllStop + ldr r0, =sub_806E6CC + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806E694 + + thumb_func_start sub_806E6CC +sub_806E6CC: @ 806E6CC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _0806E6F0 + ldrh r0, [r1, 0x8] + bl current_map_music_set + b _0806E6FC + .pool +_0806E6F0: + bl song_id_for_battle + lsls r0, 16 + lsrs r0, 16 + bl current_map_music_set +_0806E6FC: + adds r0, r4, 0 + bl DestroyTask + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_806E6CC + + thumb_func_start pokemon_get_pal +pokemon_get_pal: @ 806E708 + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + adds r6, r0, 0 + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + adds r2, r0, 0 + adds r0, r4, 0 + adds r1, r6, 0 + bl species_and_otid_get_pal + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end pokemon_get_pal + + thumb_func_start species_and_otid_get_pal +species_and_otid_get_pal: @ 806E740 + push {r4,r5,lr} + adds r3, r2, 0 + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + bls _0806E75C + ldr r0, =gMonPaletteTable + ldr r0, [r0] + b _0806E788 + .pool +_0806E75C: + lsrs r0, r1, 16 + ldr r2, =0x0000ffff + ands r1, r2 + eors r0, r1 + lsrs r1, r3, 16 + eors r0, r1 + ands r3, r2 + eors r0, r3 + cmp r0, 0x7 + bls _0806E780 + ldr r0, =gMonPaletteTable + lsls r1, r4, 3 + b _0806E784 + .pool +_0806E780: + ldr r0, =gMonShinyPaletteTable + lsls r1, r5, 3 +_0806E784: + adds r1, r0 + ldr r0, [r1] +_0806E788: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end species_and_otid_get_pal + + thumb_func_start sub_806E794 +sub_806E794: @ 806E794 + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + adds r6, r0, 0 + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + adds r2, r0, 0 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_806E7CC + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_806E794 + + thumb_func_start sub_806E7CC +sub_806E7CC: @ 806E7CC + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsrs r0, r1, 16 + ldr r3, =0x0000ffff + ands r1, r3 + eors r0, r1 + lsrs r1, r2, 16 + eors r0, r1 + ands r2, r3 + eors r0, r2 + cmp r0, 0x7 + bls _0806E7F4 + lsls r0, r4, 3 + ldr r1, =gMonPaletteTable + b _0806E7F8 + .pool +_0806E7F4: + lsls r0, r4, 3 + ldr r1, =gMonShinyPaletteTable +_0806E7F8: + adds r0, r1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806E7CC + + thumb_func_start sub_806E804 +sub_806E804: @ 806E804 + push {r4,lr} + lsls r0, 16 + lsrs r3, r0, 16 + ldr r2, =gUnknown_08329EEA + ldrh r0, [r2] + ldr r1, =0x0000ffff + cmp r0, r1 + beq _0806E836 + adds r4, r1, 0 + adds r1, r2, 0 +_0806E818: + ldrh r0, [r2] + adds r1, 0x2 + adds r2, 0x2 + cmp r0, r3 + bne _0806E830 + movs r0, 0x1 + b _0806E838 + .pool +_0806E830: + ldrh r0, [r1] + cmp r0, r4 + bne _0806E818 +_0806E836: + movs r0, 0 +_0806E838: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_806E804 + + thumb_func_start sub_806E840 +sub_806E840: @ 806E840 + lsls r0, 16 + lsrs r0, 16 + ldr r2, =gBaseStats + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x19] + lsrs r0, 7 + bx lr + .pool + thumb_func_end sub_806E840 + + thumb_func_start sub_806E858 +sub_806E858: @ 806E858 + push {r4,lr} + lsls r4, r1, 24 + lsrs r4, 24 + bl GetNature + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_085B25A0 + lsls r1, r0, 2 + adds r1, r0 + adds r1, r4 + adds r1, r2 + movs r0, 0 + ldrsb r0, [r1, r0] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806E858 + + thumb_func_start sub_806E880 +sub_806E880: @ 806E880 + push {r4,lr} + lsls r4, r1, 24 + lsrs r4, 24 + bl GetNatureFromPersonality + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_085B25A0 + lsls r1, r0, 2 + adds r1, r0 + adds r1, r4 + adds r1, r2 + movs r0, 0 + ldrsb r0, [r1, r0] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806E880 + + thumb_func_start sub_806E8A8 +sub_806E8A8: @ 806E8A8 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + movs r1, 0x7 + mov r2, sp + bl pokemon_getattr + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + mov r1, sp + bl sub_806E8D4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_806E8A8 + + thumb_func_start sub_806E8D4 +sub_806E8D4: @ 806E8D4 + push {r4,r5,lr} + adds r5, r1, 0 + ldr r1, =0x03005d90 + ldr r3, [r1] + ldrb r2, [r3, 0xA] + ldrb r1, [r3, 0xB] + lsls r1, 8 + orrs r2, r1 + ldrb r1, [r3, 0xC] + lsls r1, 16 + orrs r2, r1 + ldrb r1, [r3, 0xD] + lsls r1, 24 + orrs r2, r1 + cmp r0, r2 + bne _0806E91C + movs r4, 0 + ldrb r0, [r5] + cmp r0, 0xFF + beq _0806E912 + adds r2, r5, 0 +_0806E8FE: + adds r1, r3, r4 + ldrb r0, [r2] + ldrb r1, [r1] + cmp r0, r1 + bne _0806E91C + adds r2, 0x1 + adds r4, 0x1 + ldrb r0, [r2] + cmp r0, 0xFF + bne _0806E8FE +_0806E912: + movs r0, 0 + b _0806E91E + .pool +_0806E91C: + movs r0, 0x1 +_0806E91E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_806E8D4 + + thumb_func_start sub_806E924 +sub_806E924: @ 806E924 + push {lr} + bl pokemon_restore_pp + pop {r0} + bx r0 + thumb_func_end sub_806E924 + + thumb_func_start pokemon_restore_pp +pokemon_restore_pp: @ 806E930 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r6, 0 +_0806E938: + adds r4, r6, 0 + adds r4, 0xD + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _0806E984 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + bl pokemon_getattr_encrypted + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr_encrypted + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r2, r6, 24 + lsrs r2, 24 + adds r0, r4, 0 + bl CalcPPWithPPUps + mov r1, sp + strb r0, [r1] + adds r1, r6, 0 + adds r1, 0x11 + adds r0, r5, 0 + mov r2, sp + bl pokemon_setattr_encrypted +_0806E984: + adds r6, 0x1 + cmp r6, 0x3 + ble _0806E938 + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end pokemon_restore_pp + + thumb_func_start sub_806E994 +sub_806E994: @ 806E994 + push {r4,r5,lr} + ldr r2, =0x0202420a + ldr r5, =0x0202449c + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0xB0 + ldrb r0, [r0] + strb r0, [r2] + ldr r4, =0x02022f58 + movs r0, 0xFD + strb r0, [r4] + movs r0, 0x4 + strb r0, [r4, 0x1] + adds r1, 0x49 + ldrb r0, [r1] + strb r0, [r4, 0x2] + movs r0, 0xFF + strb r0, [r4, 0x4] + ldrb r0, [r1] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0806E9E8 + ldr r1, =0x0202406e + ldr r0, [r5] + adds r0, 0x49 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrb r0, [r0] + bl pokemon_order_func + b _0806E9F6 + .pool +_0806E9E8: + ldr r1, =0x0202406e + ldr r0, [r5] + adds r0, 0x49 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] +_0806E9F6: + strb r0, [r4, 0x3] + ldr r4, =0x02022f68 + movs r0, 0xFD + strb r0, [r4] + movs r0, 0x4 + strb r0, [r4, 0x1] + ldr r1, =0x020244b8 + ldrb r0, [r1] + strb r0, [r4, 0x2] + ldr r2, =0x0202406e + ldrb r0, [r1] + lsls r0, 1 + adds r0, r2 + ldrb r0, [r0] + bl pokemon_order_func + strb r0, [r4, 0x3] + movs r0, 0xFF + strb r0, [r4, 0x4] + ldr r0, =gUnknown_085CB2A1 + ldr r1, =0x02021fc4 + bl get_battle_strings + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806E994 + + thumb_func_start sub_806EA40 +sub_806EA40: @ 806EA40 + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r1, 0 + ldr r2, =gUnknown_08329EFC +_0806EA4A: + ldrh r0, [r2] + cmp r0, r3 + bne _0806EA58 + adds r0, r1, 0 + b _0806EA62 + .pool +_0806EA58: + adds r2, 0x4 + adds r1, 0x1 + cmp r1, 0x8 + ble _0806EA4A + movs r0, 0 +_0806EA62: + pop {r1} + bx r1 + thumb_func_end sub_806EA40 + + thumb_func_start sub_806EA68 +sub_806EA68: @ 806EA68 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x00302008 + ands r0, r1 + cmp r0, 0 + beq _0806EA7C + b _0806EB90 +_0806EA7C: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =0x02024744 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x2D + mov r8, r0 + movs r7, 0x5F + ldr r5, =0x020244ec + adds r0, r5, 0 + movs r1, 0x6 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0806EAC6 + adds r0, r5, 0 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE + bne _0806EAC6 + movs r2, 0x14 + mov r8, r2 + movs r7, 0x50 +_0806EAC6: + ldr r0, =0x02037318 + ldrh r1, [r0, 0x12] + movs r0, 0xD2 + lsls r0, 1 + cmp r1, r0 + bne _0806EB2C + adds r0, r4, 0 + bl sub_806EA40 + adds r2, r0, 0 + cmp r2, 0 + beq _0806EB04 + cmp r6, r7 + bcc _0806EB90 + ldr r0, =0x02024744 + lsls r2, 2 + ldr r1, =gUnknown_08329EFE + b _0806EB6C + .pool +_0806EB04: + cmp r6, r8 + bcc _0806EB90 + cmp r6, r7 + bcs _0806EB18 + ldr r0, =0x02024744 + lsls r2, r4, 3 + b _0806EB66 + .pool +_0806EB18: + ldr r0, =0x02024744 + lsls r2, r4, 3 + subs r2, r4 + lsls r2, 2 + ldr r1, =gBaseStats + 0xe @ item 2 offset + b _0806EB6C + .pool +_0806EB2C: + ldr r0, =gBaseStats + mov r12, r0 + lsls r0, r4, 3 + subs r1, r0, r4 + lsls r5, r1, 2 + mov r2, r12 + adds r1, r5, r2 + ldrh r3, [r1, 0xC] + adds r2, r0, 0 + ldrh r1, [r1, 0xE] + cmp r3, r1 + bne _0806EB5C + cmp r3, 0 + beq _0806EB5C + ldr r0, =0x02024744 + mov r2, r12 + adds r2, 0xC + adds r2, r5, r2 + b _0806EB6E + .pool +_0806EB5C: + cmp r6, r8 + bcc _0806EB90 + cmp r6, r7 + bcs _0806EB80 + ldr r0, =0x02024744 +_0806EB66: + subs r2, r4 + lsls r2, 2 + ldr r1, =gBaseStats + 0xc @ item 1 offset +_0806EB6C: + adds r2, r1 +_0806EB6E: + movs r1, 0xC + bl pokemon_setattr + b _0806EB90 + .pool +_0806EB80: + ldr r0, =0x02024744 + subs r2, r4 + lsls r2, 2 + ldr r1, =gBaseStats + 0xe @ item 2 offset + adds r2, r1 + movs r1, 0xC + bl pokemon_setattr +_0806EB90: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806EA68 + + thumb_func_start sub_806EBA4 +sub_806EBA4: @ 806EBA4 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + adds r5, r0, 0 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + adds r0, r5, 0 + bl sub_806EBD0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_806EBA4 + + thumb_func_start sub_806EBD0 +sub_806EBD0: @ 806EBD0 + push {r4,lr} + movs r4, 0 + lsrs r2, r0, 16 + ldr r3, =0x0000ffff + ands r0, r3 + eors r2, r0 + lsrs r0, r1, 16 + eors r2, r0 + ands r1, r3 + eors r2, r1 + cmp r2, 0x7 + bhi _0806EBEA + movs r4, 0x1 +_0806EBEA: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806EBD0 + + thumb_func_start sub_806EBF8 +sub_806EBF8: @ 806EBF8 + push {r4,lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 15 + ands r0, r1 + cmp r0, 0 + beq _0806EC3C + ldr r2, =0x02038bce + ldrh r1, [r2] + ldr r0, =0x00000c03 + cmp r1, r0 + bne _0806EC28 + ldr r0, =gTrainers + TRAINER_STEVEN * 0x28 + 0x4 @ Steven's name + b _0806EC64 + .pool +_0806EC28: + ldr r4, =0x02021cc4 + ldrh r1, [r2] + adds r0, r4, 0 + bl sub_8162E20 + adds r0, r4, 0 + b _0806EC64 + .pool +_0806EC3C: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x020229e8 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x18] + movs r0, 0x2 + eors r0, r1 + bl sub_806D864 + adds r1, r0, 0 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r4, 0x8 + adds r0, r4 +_0806EC64: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806EBF8 + + thumb_func_start sub_806EC70 +sub_806EC70: @ 806EC70 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + ldrh r0, [r2, 0xE] + subs r0, 0x1 + strh r0, [r2, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _0806ECA0 + ldrh r0, [r2, 0x8] + ldrh r1, [r2, 0xA] + lsls r1, 16 + orrs r0, r1 + ldrb r1, [r2, 0xC] + bl sub_817F544 + adds r0, r4, 0 + bl DestroyTask +_0806ECA0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806EC70 + + thumb_func_start sub_806ECAC +sub_806ECAC: @ 806ECAC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + ldrh r0, [r2, 0xE] + subs r0, 0x1 + strh r0, [r2, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _0806ECE2 + ldrh r0, [r2, 0x8] + ldrh r1, [r2, 0xA] + lsls r1, 16 + orrs r0, r1 + ldrb r1, [r2, 0xC] + bl sub_817F578 + movs r0, 0xFF + bl sub_81C488C + adds r0, r4, 0 + bl DestroyTask +_0806ECE2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806ECAC + + thumb_func_start sub_806ECEC +sub_806ECEC: @ 806ECEC + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0806ED30 + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x02000002 + ands r0, r1 + cmp r0, 0 + bne _0806ED30 + movs r0, 0x80 + orrs r3, r0 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_806ED40 + b _0806ED38 + .pool +_0806ED30: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_806ED40 +_0806ED38: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_806ECEC + + thumb_func_start sub_806ED40 +sub_806ED40: @ 806ED40 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x7F + ands r0, r3 + cmp r0, 0 + beq _0806ED60 + cmp r0, 0x1 + beq _0806ED64 + movs r1, 0 + b _0806ED66 +_0806ED60: + movs r1, 0xE7 + b _0806ED66 +_0806ED64: + movs r1, 0x19 +_0806ED66: + movs r0, 0x80 + ands r0, r3 + cmp r0, 0 + beq _0806ED84 + cmp r2, 0 + bne _0806ED7C + lsls r1, 24 + asrs r1, 24 + adds r0, r4, 0 + bl cry_related +_0806ED7C: + ldr r0, =DummyObjectCallback + b _0806EDFA + .pool +_0806ED84: + cmp r2, 0 + bne _0806EDA6 + lsls r1, 24 + asrs r1, 24 + adds r0, r4, 0 + bl cry_related + adds r0, r4, 0 + bl sub_806F0D4 + lsls r0, 24 + cmp r0, 0 + beq _0806EDA6 + adds r0, r5, 0 + movs r1, 0x1 + bl StartObjectImageAnim +_0806EDA6: + ldr r0, =gUnknown_08329B87 + subs r4, 0x1 + adds r6, r4, r0 + ldrb r0, [r6] + cmp r0, 0 + beq _0806EDEC + ldr r0, =sub_806EC70 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r5, [r1, 0x8] + lsrs r0, r5, 16 + strh r0, [r1, 0xA] + ldr r0, =gUnknown_083299EC + adds r0, r4, r0 + ldrb r0, [r0] + strh r0, [r1, 0xC] + ldrb r0, [r6] + strh r0, [r1, 0xE] + b _0806EDF8 + .pool +_0806EDEC: + ldr r0, =gUnknown_083299EC + adds r0, r4, r0 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_817F544 +_0806EDF8: + ldr r0, =nullsub_18 +_0806EDFA: + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806ED40 + + thumb_func_start sub_806EE0C +sub_806EE0C: @ 806EE0C + push {r4-r6,lr} + adds r5, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 24 + cmp r2, 0 + bne _0806EE2E + adds r0, r4, 0 + bl sub_806F0D4 + lsls r0, 24 + cmp r0, 0 + beq _0806EE2E + adds r0, r5, 0 + movs r1, 0x1 + bl StartObjectImageAnim +_0806EE2E: + ldr r0, =gUnknown_08329B87 + subs r4, 0x1 + adds r6, r4, r0 + ldrb r0, [r6] + cmp r0, 0 + beq _0806EE80 + ldr r0, =sub_806ECAC + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r1 + strh r5, [r2, 0x8] + lsrs r1, r5, 16 + strh r1, [r2, 0xA] + ldr r1, =gUnknown_083299EC + adds r1, r4, r1 + ldrb r1, [r1] + strh r1, [r2, 0xC] + ldrb r1, [r6] + strh r1, [r2, 0xE] + bl sub_81C488C + adds r0, r5, 0 + bl sub_817F60C + b _0806EE8C + .pool +_0806EE80: + ldr r0, =gUnknown_083299EC + adds r0, r4, r0 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_817F578 +_0806EE8C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806EE0C + + thumb_func_start sub_806EE98 +sub_806EE98: @ 806EE98 + push {lr} + ldr r0, =sub_806ECAC + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _0806EEAC + bl DestroyTask +_0806EEAC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_806EE98 + + thumb_func_start sub_806EEB4 +sub_806EEB4: @ 806EEB4 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r2, r1, 16 + ldr r0, =0x02024280 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0806EEE8 + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x02000002 + ands r0, r1 + cmp r0, 0 + bne _0806EEE8 + ldr r0, =DummyObjectCallback + b _0806EEFC + .pool +_0806EEE8: + adds r0, r2, 0 + bl sub_817F474 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_817F594 + ldr r0, =nullsub_18 +_0806EEFC: + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806EEB4 + + thumb_func_start sub_806EF08 +sub_806EF08: @ 806EF08 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r5, 0 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x020229e8 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x18] + cmp r0, 0x1 + beq _0806EF4C + cmp r0, 0x1 + bgt _0806EF38 + cmp r0, 0 + beq _0806EF42 + b _0806EF56 + .pool +_0806EF38: + cmp r0, 0x2 + beq _0806EF42 + cmp r0, 0x3 + beq _0806EF4C + b _0806EF56 +_0806EF42: + movs r5, 0x3 + cmp r4, 0 + beq _0806EF56 + movs r5, 0x1 + b _0806EF56 +_0806EF4C: + negs r0, r4 + orrs r0, r4 + asrs r5, r0, 31 + movs r0, 0x2 + ands r5, r0 +_0806EF56: + movs r2, 0 + ldr r4, =0x020229e8 + ldrh r0, [r4, 0x18] + adds r1, r5, 0 + cmp r0, r1 + beq _0806EF74 + adds r3, r1, 0 + adds r1, r4, 0 +_0806EF66: + adds r1, 0x1C + adds r2, 0x1 + cmp r2, 0x3 + bgt _0806EF74 + ldrh r0, [r1, 0x18] + cmp r0, r3 + bne _0806EF66 +_0806EF74: + lsls r0, r2, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806EF08 + + thumb_func_start sub_806EF84 +sub_806EF84: @ 806EF84 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r4, 0 + ldr r2, =0x020229e8 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x18] + cmp r0, 0x1 + beq _0806EFC4 + cmp r0, 0x1 + bgt _0806EFB0 + cmp r0, 0 + beq _0806EFBA + b _0806EFCE + .pool +_0806EFB0: + cmp r0, 0x2 + beq _0806EFBA + cmp r0, 0x3 + beq _0806EFC4 + b _0806EFCE +_0806EFBA: + movs r4, 0x3 + cmp r3, 0 + beq _0806EFCE + movs r4, 0x1 + b _0806EFCE +_0806EFC4: + negs r0, r3 + orrs r0, r3 + asrs r4, r0, 31 + movs r0, 0x2 + ands r4, r0 +_0806EFCE: + movs r3, 0 + ldrh r0, [r2, 0x18] + adds r1, r4, 0 + cmp r0, r1 + beq _0806EFE6 +_0806EFD8: + adds r2, 0x1C + adds r3, 0x1 + cmp r3, 0x3 + bgt _0806EFE6 + ldrh r0, [r2, 0x18] + cmp r0, r1 + bne _0806EFD8 +_0806EFE6: + lsls r0, r3, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_806EF84 + + thumb_func_start TrainerClassToTrainerPic +@ u8 TrainerClassToTrainerPic(u16 trainerClassId) +TrainerClassToTrainerPic: @ 806EFF0 + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gTrainerPicIndices + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end TrainerClassToTrainerPic + + thumb_func_start sub_806F000 +sub_806F000: @ 806F000 + push {lr} + lsls r0, 24 + cmp r0, 0 + bne _0806F00C + movs r0, 0x3C + b _0806F00E +_0806F00C: + movs r0, 0x3F +_0806F00E: + bl TrainerClassToTrainerPic + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_806F000 + + thumb_func_start SetPokedexFlag +@ void SetPokedexFlag(u16 nationalPokedexNum, u8 op, u32 personality) +SetPokedexFlag: @ 806F01C + push {r4-r7,lr} + adds r7, r2, 0 + lsls r0, 16 + lsrs r4, r0, 16 + adds r6, r4, 0 + lsls r1, 24 + lsrs r5, r1, 24 + movs r0, 0x2 + eors r0, r5 + negs r1, r0 + orrs r1, r0 + lsrs r1, 31 + adds r0, r4, 0 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + bne _0806F072 + adds r0, r4, 0 + adds r1, r5, 0 + bl pokedex_flag_operation + adds r0, r4, 0 + bl NationalPokedexNumToSpecies + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xC9 + bne _0806F05C + ldr r0, =0x03005d90 + ldr r0, [r0] + str r7, [r0, 0x1C] +_0806F05C: + adds r0, r6, 0 + bl NationalPokedexNumToSpecies + lsls r0, 16 + movs r1, 0x9A + lsls r1, 17 + cmp r0, r1 + bne _0806F072 + ldr r0, =0x03005d90 + ldr r0, [r0] + str r7, [r0, 0x20] +_0806F072: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end SetPokedexFlag + + thumb_func_start sub_806F07C +sub_806F07C: @ 806F07C + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =0x00000356 + cmp r2, r0 + bls _0806F08A + movs r2, 0 +_0806F08A: + ldr r1, =gTrainers + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x1] + movs r0, 0xD + muls r0, r1 + ldr r1, =gTrainerClassNames + adds r0, r1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_806F07C + + thumb_func_start sub_806F0B0 +sub_806F0B0: @ 806F0B0 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =0x00000356 + cmp r1, r0 + bls _0806F0BE + movs r1, 0 +_0806F0BE: + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, =gTrainers + 0x4 @ name offset + adds r0, r1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_806F0B0 + + thumb_func_start sub_806F0D4 +sub_806F0D4: @ 806F0D4 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0 + ldr r0, =0x00000181 + cmp r2, r0 + beq _0806F0F8 + adds r0, 0x19 + cmp r2, r0 + beq _0806F0F8 + subs r0, 0x66 + cmp r2, r0 + beq _0806F0F8 + movs r1, 0xC9 + eors r1, r2 + negs r0, r1 + orrs r0, r1 + lsrs r1, r0, 31 +_0806F0F8: + adds r0, r1, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_806F0D4 + + thumb_func_start sub_806F104 +sub_806F104: @ 806F104 + push {lr} + ldr r2, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806F122 + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x003f0100 + ands r0, r1 + cmp r0, 0 + bne _0806F144 +_0806F122: + ldr r1, =0x00000439 + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0806F158 + bl InBattlePike + lsls r0, 24 + cmp r0, 0 + bne _0806F144 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _0806F158 +_0806F144: + movs r0, 0x1 + b _0806F15A + .pool +_0806F158: + movs r0, 0 +_0806F15A: + pop {r1} + bx r1 + thumb_func_end sub_806F104 + + thumb_func_start sub_806F160 +sub_806F160: @ 806F160 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r6, r0, 0 + ldrb r0, [r6] + lsls r0, 28 + movs r4, 0 + cmp r0, 0 + beq _0806F1EA +_0806F176: + ldr r0, [r6, 0xC] + lsls r2, r4, 1 + adds r1, r2, r4 + lsls r1, 3 + adds r0, r1, r0 + ldr r3, =gUnknown_08329D98 + adds r1, r3 + ldm r1!, {r3,r5,r7} + stm r0!, {r3,r5,r7} + ldm r1!, {r3,r5,r7} + stm r0!, {r3,r5,r7} + movs r5, 0 + ldrb r3, [r6, 0x1] + ldr r7, [r6, 0xC] + mov r9, r7 + mov r8, r2 + ldr r0, [r6, 0x10] + mov r12, r0 + adds r1, r4, 0x1 + mov r10, r1 + cmp r5, r3 + bcs _0806F1C8 + mov r7, r12 + ldr r1, [r6, 0x8] + lsls r0, r4, 2 + adds r0, r1 + ldr r2, [r0] +_0806F1AC: + adds r0, r4, 0 + muls r0, r3 + adds r0, r5 + lsls r0, 3 + adds r0, r7 + lsls r1, r5, 11 + adds r1, r2, r1 + str r1, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldrb r3, [r6, 0x1] + cmp r5, r3 + bcc _0806F1AC +_0806F1C8: + mov r3, r8 + adds r1, r3, r4 + lsls r1, 3 + add r1, r9 + ldrb r0, [r6, 0x1] + muls r0, r4 + lsls r0, 3 + add r0, r12 + str r0, [r1, 0xC] + mov r5, r10 + lsls r0, r5, 16 + lsrs r4, r0, 16 + ldrb r0, [r6] + lsls r0, 28 + lsrs r0, 28 + cmp r4, r0 + blt _0806F176 +_0806F1EA: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806F160 + + thumb_func_start sub_806F1FC +sub_806F1FC: @ 806F1FC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r4, r0, 0 + ldrb r0, [r4] + lsls r0, 28 + movs r3, 0 + cmp r0, 0 + beq _0806F296 + ldr r0, =gUnknown_08329F28 + mov r10, r0 +_0806F216: + ldr r0, [r4, 0xC] + lsls r2, r3, 1 + adds r1, r2, r3 + lsls r1, 3 + adds r1, r0 + mov r0, r10 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + movs r5, 0 + ldr r0, [r4, 0xC] + mov r8, r0 + mov r12, r2 + ldr r7, [r4, 0x10] + adds r1, r3, 0x1 + mov r9, r1 + ldrb r6, [r4, 0x1] + cmp r5, r6 + bcs _0806F26A + adds r6, r7, 0 + ldr r1, [r4, 0x8] + lsls r0, r3, 2 + adds r0, r1 + ldr r2, [r0] +_0806F248: + ldrb r0, [r4] + lsls r0, 28 + lsrs r0, 28 + adds r1, r3, 0 + muls r1, r0 + adds r1, r5 + lsls r1, 3 + adds r1, r6 + lsls r0, r5, 11 + adds r0, r2, r0 + str r0, [r1] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldrb r0, [r4, 0x1] + cmp r5, r0 + bcc _0806F248 +_0806F26A: + mov r5, r12 + adds r1, r5, r3 + lsls r1, 3 + add r1, r8 + ldrb r0, [r4] + lsls r0, 28 + lsrs r0, 28 + muls r0, r3 + lsls r0, 3 + adds r0, r7, r0 + str r0, [r1, 0xC] + ldr r6, =gUnknown_082FF70C + str r6, [r1, 0x8] + strh r3, [r1, 0x2] + mov r7, r9 + lsls r0, r7, 16 + lsrs r3, r0, 16 + ldrb r0, [r4] + lsls r0, 28 + lsrs r0, 28 + cmp r3, r0 + blt _0806F216 +_0806F296: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_806F1FC + + thumb_func_start sub_806F2AC +sub_806F2AC: @ 806F2AC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + movs r7, 0 + movs r0, 0x1 + ands r6, r0 + movs r0, 0x14 + bl AllocZeroed + adds r4, r0, 0 + cmp r4, 0 + bne _0806F2D0 + movs r0, 0 + b _0806F46E +_0806F2D0: + cmp r5, 0 + beq _0806F2E6 + cmp r5, 0x2 + bne _0806F2E6 + movs r0, 0x77 + strb r0, [r4] + movs r0, 0x4 + strb r0, [r4, 0x1] + movs r0, 0x21 + strb r0, [r4, 0x3] + b _0806F30E +_0806F2E6: + ldrb r1, [r4] + movs r2, 0x10 + negs r2, r2 + adds r0, r2, 0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + movs r3, 0xF + ands r0, r3 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x4 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x3] + ands r2, r0 + movs r0, 0x1 + orrs r2, r0 + ands r2, r3 + strb r2, [r4, 0x3] +_0806F30E: + ldrb r1, [r4, 0x3] + lsls r1, 28 + lsrs r1, 28 + ldrb r0, [r4] + lsls r0, 28 + lsrs r0, 15 + muls r0, r1 + bl AllocZeroed + str r0, [r4, 0x4] + ldrb r0, [r4] + lsls r0, 28 + lsrs r0, 23 + bl AllocZeroed + adds r1, r0, 0 + str r1, [r4, 0x8] + ldr r2, [r4, 0x4] + cmp r2, 0 + beq _0806F33A + cmp r1, 0 + bne _0806F344 +_0806F33A: + movs r0, 0x1 + orrs r7, r0 + lsls r6, 2 + mov r8, r6 + b _0806F378 +_0806F344: + ldrb r0, [r4] + lsls r0, 28 + movs r3, 0 + lsls r6, 2 + mov r8, r6 + cmp r0, 0 + beq _0806F378 + adds r6, r1, 0 + adds r5, r2, 0 +_0806F356: + lsls r2, r3, 2 + adds r2, r6 + ldrb r0, [r4, 0x3] + lsls r0, 28 + lsrs r0, 28 + lsls r1, r3, 13 + muls r0, r1 + adds r0, r5, r0 + str r0, [r2] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldrb r0, [r4] + lsls r0, 28 + lsrs r0, 28 + cmp r3, r0 + blt _0806F356 +_0806F378: + ldrb r1, [r4] + lsls r1, 28 + lsrs r1, 28 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + bl AllocZeroed + str r0, [r4, 0xC] + ldrb r1, [r4] + lsls r1, 28 + lsrs r1, 28 + ldrb r0, [r4, 0x1] + lsls r0, 3 + muls r0, r1 + bl AllocZeroed + adds r1, r0, 0 + str r1, [r4, 0x10] + ldr r0, [r4, 0xC] + cmp r0, 0 + beq _0806F3A8 + cmp r1, 0 + bne _0806F3B2 +_0806F3A8: + movs r0, 0x2 + orrs r7, r0 + lsls r0, r7, 24 + lsrs r7, r0, 24 + b _0806F400 +_0806F3B2: + movs r3, 0 + ldrb r0, [r4, 0x1] + ldrb r1, [r4] + lsls r1, 28 + lsrs r1, 28 + muls r0, r1 + cmp r3, r0 + bge _0806F3E2 + movs r2, 0x80 + lsls r2, 4 +_0806F3C6: + ldr r1, [r4, 0x10] + lsls r0, r3, 3 + adds r0, r1 + strh r2, [r0, 0x4] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldrb r1, [r4, 0x1] + ldrb r0, [r4] + lsls r0, 28 + lsrs r0, 28 + muls r0, r1 + cmp r3, r0 + blt _0806F3C6 +_0806F3E2: + ldrb r0, [r4, 0x3] + lsrs r0, 4 + cmp r0, 0 + blt _0806F3FA + cmp r0, 0x1 + ble _0806F3FA + cmp r0, 0x2 + bne _0806F3FA + adds r0, r4, 0 + bl sub_806F1FC + b _0806F400 +_0806F3FA: + adds r0, r4, 0 + bl sub_806F160 +_0806F400: + movs r0, 0x2 + ands r0, r7 + cmp r0, 0 + beq _0806F424 + ldr r0, [r4, 0x10] + cmp r0, 0 + beq _0806F416 + bl Free + movs r0, 0 + str r0, [r4, 0x10] +_0806F416: + ldr r0, [r4, 0xC] + cmp r0, 0 + beq _0806F424 + bl Free + movs r0, 0 + str r0, [r4, 0xC] +_0806F424: + movs r0, 0x1 + ands r0, r7 + cmp r0, 0 + beq _0806F448 + ldr r0, [r4, 0x8] + cmp r0, 0 + beq _0806F43A + bl Free + movs r0, 0 + str r0, [r4, 0x8] +_0806F43A: + ldr r0, [r4, 0x4] + cmp r0, 0 + beq _0806F448 + bl Free + movs r0, 0 + str r0, [r4, 0x4] +_0806F448: + cmp r7, 0 + beq _0806F45E + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x14 + bl memset + adds r0, r4, 0 + bl Free + b _0806F468 +_0806F45E: + movs r0, 0xA3 + strb r0, [r4, 0x2] + ldr r0, =0x020249b4 + add r0, r8 + str r4, [r0] +_0806F468: + ldr r0, =0x020249b4 + add r0, r8 + ldr r0, [r0] +_0806F46E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806F2AC + + thumb_func_start sub_806F47C +sub_806F47C: @ 806F47C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + ands r0, r1 + ldr r1, =0x020249b4 + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + cmp r4, 0 + beq _0806F4F0 + ldrb r0, [r4, 0x2] + cmp r0, 0xA3 + beq _0806F4A8 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x14 + bl memset + b _0806F4F0 + .pool +_0806F4A8: + ldr r0, [r4, 0x10] + cmp r0, 0 + beq _0806F4B6 + bl Free + movs r0, 0 + str r0, [r4, 0x10] +_0806F4B6: + ldr r0, [r4, 0xC] + cmp r0, 0 + beq _0806F4C4 + bl Free + movs r0, 0 + str r0, [r4, 0xC] +_0806F4C4: + ldr r0, [r4, 0x8] + cmp r0, 0 + beq _0806F4D2 + bl Free + movs r0, 0 + str r0, [r4, 0x8] +_0806F4D2: + ldr r0, [r4, 0x4] + cmp r0, 0 + beq _0806F4E0 + bl Free + movs r0, 0 + str r0, [r4, 0x4] +_0806F4E0: + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x14 + bl memset + adds r0, r4, 0 + bl Free +_0806F4F0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_806F47C + + thumb_func_start sub_806F4F8 +sub_806F4F8: @ 806F4F8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + ldr r2, =0x020249b4 + movs r1, 0x1 + ands r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, [r0] + ldrb r0, [r1, 0x2] + cmp r0, 0xA3 + beq _0806F51C + movs r0, 0 + b _0806F530 + .pool +_0806F51C: + ldrb r0, [r1] + lsls r0, 28 + lsrs r0, 28 + cmp r3, r0 + blt _0806F528 + movs r3, 0 +_0806F528: + ldr r0, [r1, 0x8] + lsls r1, r3, 2 + adds r1, r0 + ldr r0, [r1] +_0806F530: + pop {r1} + bx r1 + thumb_func_end sub_806F4F8 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_806F640.s b/asm/rom_806F640.s new file mode 100644 index 000000000..41f34d92c --- /dev/null +++ b/asm/rom_806F640.s @@ -0,0 +1,466 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start object_new_hidden_with_callback +object_new_hidden_with_callback: @ 806F640 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r0, =gUnknown_0832A3A8 + movs r1, 0xF8 + movs r2, 0xA8 + movs r3, 0xE + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r5, =0x02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r3, r2, r5 + adds r3, 0x3E + ldrb r1, [r3] + movs r4, 0x4 + orrs r1, r4 + strb r1, [r3] + adds r5, 0x1C + adds r2, r5 + str r6, [r2] + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end object_new_hidden_with_callback + + thumb_func_start sub_806F67C +sub_806F67C: @ 806F67C + strh r1, [r0] + lsrs r1, 16 + strh r1, [r0, 0x2] + bx lr + thumb_func_end sub_806F67C + + thumb_func_start sub_806F684 +sub_806F684: @ 806F684 + ldrh r2, [r0] + movs r3, 0x2 + ldrsh r0, [r0, r3] + lsls r0, 16 + orrs r2, r0 + str r2, [r1] + bx lr + thumb_func_end sub_806F684 + + thumb_func_start sub_806F694 +sub_806F694: @ 806F694 + 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 + str r1, [r0] + str r2, [r0, 0x4] + strh r3, [r0, 0x8] + strh r4, [r0, 0xA] + strh r5, [r0, 0xC] + strh r6, [r0, 0xE] + mov r1, r8 + strh r1, [r0, 0x10] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_806F694 + + thumb_func_start sub_806F6C0 +sub_806F6C0: @ 806F6C0 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x24 + mov r8, r0 + ldr r0, [sp, 0x38] + ldr r4, [sp, 0x3C] + ldr r5, [sp, 0x40] + ldr r6, [sp, 0x44] + lsls r6, 16 + lsrs r6, 16 + lsls r3, 16 + asrs r3, 16 + lsls r0, 16 + asrs r0, 16 + str r0, [sp] + lsls r4, 16 + asrs r4, 16 + str r4, [sp, 0x4] + lsls r5, 16 + asrs r5, 16 + str r5, [sp, 0x8] + str r6, [sp, 0xC] + add r0, sp, 0x10 + bl sub_806F694 + add r0, sp, 0x10 + mov r1, r8 + movs r2, 0x1 + bl BgAffineSet + add sp, 0x24 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_806F6C0 + + thumb_func_start rfu_MBOOT_CHILD_inheritanceLinkStatus +rfu_MBOOT_CHILD_inheritanceLinkStatus: @ 806F70C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x38 + str r2, [sp, 0x20] + adds r4, r3, 0 + ldr r7, [sp, 0x58] + lsls r0, 24 + lsls r1, 24 + ldr r2, =gUnknown_0832A3C0 + lsrs r1, 23 + lsrs r0, 21 + adds r1, r0 + adds r0, r2, 0x1 + adds r0, r1, r0 + ldrb r0, [r0] + str r0, [sp, 0x24] + adds r1, r2 + ldrb r1, [r1] + str r1, [sp, 0x28] + movs r0, 0 + b _0806F88C + .pool +_0806F740: + movs r5, 0 + adds r0, 0x1 + str r0, [sp, 0x30] + b _0806F874 +_0806F748: + ldrh r0, [r4] + ldr r2, =0x000003ff + adds r1, r2, 0 + ands r1, r0 + lsls r1, 5 + mov r8, r1 + movs r2, 0xC0 + lsls r2, 4 + adds r1, r2, 0 + ands r1, r0 + mov r2, sp + strh r0, [r2, 0x34] + cmp r1, 0 + bne _0806F788 + ldr r0, [sp, 0x20] + add r0, r8 + adds r1, r7, 0 + ldr r2, =0x04000008 + bl CpuSet + adds r4, 0x2 + str r4, [sp, 0x2C] + adds r7, 0x20 + mov r10, r7 + adds r5, 0x1 + mov r9, r5 + b _0806F86A + .pool +_0806F788: + movs r0, 0x80 + lsls r0, 4 + cmp r1, r0 + bne _0806F7CC + movs r1, 0 + adds r4, 0x2 + str r4, [sp, 0x2C] + movs r2, 0x20 + adds r2, r7 + mov r10, r2 + adds r5, 0x1 + mov r9, r5 +_0806F7A0: + lsls r4, r1, 24 + asrs r4, 24 + movs r0, 0x7 + subs r0, r4 + lsls r0, 2 + add r0, r8 + ldr r1, [sp, 0x20] + adds r0, r1, r0 + lsls r1, r4, 2 + adds r1, r7, r1 + ldr r2, =0x04000001 + bl CpuSet + adds r4, 0x1 + lsls r4, 24 + lsrs r1, r4, 24 + asrs r4, 24 + cmp r4, 0x7 + ble _0806F7A0 + b _0806F86A + .pool +_0806F7CC: + movs r1, 0 + adds r4, 0x2 + str r4, [sp, 0x2C] + movs r2, 0x20 + adds r2, r7 + mov r10, r2 + adds r5, 0x1 + mov r9, r5 + movs r0, 0xF + mov r12, r0 +_0806F7E0: + movs r2, 0 + lsls r4, r1, 24 + lsls r0, r4, 2 + lsrs r0, 24 + adds r6, r0, 0x3 + mov r1, r8 + adds r5, r1, r0 +_0806F7EE: + lsls r1, r2, 24 + asrs r1, 24 + subs r0, r6, r1 + mov r2, sp + adds r3, r2, r0 + adds r0, r5, r1 + ldr r2, [sp, 0x20] + adds r0, r2, r0 + ldrb r2, [r0] + mov r0, r12 + ands r0, r2 + lsls r0, 4 + lsrs r2, 4 + orrs r0, r2 + strb r0, [r3] + adds r1, 0x1 + lsls r1, 24 + lsrs r2, r1, 24 + asrs r1, 24 + cmp r1, 0x3 + ble _0806F7EE + movs r1, 0x80 + lsls r1, 17 + adds r0, r4, r1 + lsrs r1, r0, 24 + asrs r0, 24 + cmp r0, 0x7 + ble _0806F7E0 + mov r2, sp + ldrh r0, [r2, 0x34] + movs r2, 0x80 + lsls r2, 4 + ands r0, r2 + cmp r0, 0 + beq _0806F860 + movs r1, 0 +_0806F836: + lsls r4, r1, 24 + asrs r4, 24 + movs r0, 0x7 + subs r0, r4 + lsls r0, 2 + add r0, sp + lsls r1, r4, 2 + adds r1, r7, r1 + ldr r2, =0x04000001 + bl CpuSet + adds r4, 0x1 + lsls r4, 24 + lsrs r1, r4, 24 + asrs r4, 24 + cmp r4, 0x7 + ble _0806F836 + b _0806F86A + .pool +_0806F860: + mov r0, sp + adds r1, r7, 0 + ldr r2, =0x04000008 + bl CpuSet +_0806F86A: + ldr r4, [sp, 0x2C] + mov r7, r10 + mov r1, r9 + lsls r0, r1, 24 + lsrs r5, r0, 24 +_0806F874: + ldr r2, [sp, 0x28] + cmp r5, r2 + bcs _0806F87C + b _0806F748 +_0806F87C: + movs r0, 0x20 + ldr r1, [sp, 0x28] + subs r0, r1 + lsls r0, 1 + adds r4, r0 + ldr r2, [sp, 0x30] + lsls r0, r2, 24 + lsrs r0, 24 +_0806F88C: + ldr r1, [sp, 0x24] + cmp r0, r1 + bcs _0806F894 + b _0806F740 +_0806F894: + 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 rfu_MBOOT_CHILD_inheritanceLinkStatus + + thumb_func_start sub_806F8A8 +sub_806F8A8: @ 806F8A8 + push {lr} + adds r2, r0, 0 + movs r1, 0 + movs r3, 0x1 +_0806F8B0: + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + beq _0806F8BC + adds r0, r1, 0 + b _0806F8CA +_0806F8BC: + lsrs r2, 1 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1F + bls _0806F8B0 + movs r0, 0 +_0806F8CA: + pop {r1} + bx r1 + thumb_func_end sub_806F8A8 + + thumb_func_start sub_806F8D0 +sub_806F8D0: @ 806F8D0 + push {r4-r7,lr} + adds r7, r0, 0 + adds r4, r1, 0 + ldr r2, =0x00001121 + movs r3, 0 + cmp r3, r4 + bge _0806F91C + movs r6, 0x1 + ldr r0, =0x00008408 + adds r5, r0, 0 +_0806F8E4: + adds r0, r7, r3 + ldrb r0, [r0] + eors r2, r0 + movs r1, 0 + adds r3, 0x1 +_0806F8EE: + adds r0, r2, 0 + ands r0, r6 + cmp r0, 0 + beq _0806F908 + lsrs r0, r2, 1 + eors r0, r5 + lsls r0, 16 + lsrs r2, r0, 16 + b _0806F90A + .pool +_0806F908: + lsrs r2, 1 +_0806F90A: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x7 + bls _0806F8EE + lsls r0, r3, 16 + lsrs r3, r0, 16 + cmp r3, r4 + blt _0806F8E4 +_0806F91C: + mvns r0, r2 + lsls r0, 16 + lsrs r0, 16 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_806F8D0 + + thumb_func_start sub_806F928 +sub_806F928: @ 806F928 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldr r2, =0x00001121 + movs r3, 0 + cmp r3, r4 + bcs _0806F956 + ldr r6, =gUnknown_0832A3D8 +_0806F938: + lsrs r1, r2, 8 + adds r0, r5, r3 + ldrb r0, [r0] + eors r2, r0 + lsls r0, r2, 24 + lsrs r0, 23 + adds r0, r6 + ldrh r0, [r0] + adds r2, r0, 0 + eors r2, r1 + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r4 + bcc _0806F938 +_0806F956: + mvns r0, r2 + lsls r0, 16 + lsrs r0, 16 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_806F928 + + thumb_func_start sub_806F96C +sub_806F96C: @ 806F96C + push {r4,lr} + adds r4, r0, 0 + movs r3, 0 + movs r2, 0 + cmp r3, r1 + bcs _0806F984 +_0806F978: + adds r0, r4, r2 + ldrb r0, [r0] + adds r3, r0 + adds r2, 0x1 + cmp r2, r1 + bcc _0806F978 +_0806F984: + adds r0, r3, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_806F96C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_8072304.s b/asm/rom_8072304.s new file mode 100644 index 000000000..d1e7c6212 --- /dev/null +++ b/asm/rom_8072304.s @@ -0,0 +1,8793 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8072304 +sub_8072304: @ 8072304 + movs r0, 0x9 + bx lr + thumb_func_end sub_8072304 + + thumb_func_start sub_8072308 +sub_8072308: @ 8072308 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r7, r1, 0 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + movs r3, 0 + movs r2, 0 +_08072324: + lsls r0, r3, 24 + asrs r0, 24 + mov r3, sp + adds r1, r3, r0 + strb r2, [r1] + adds r0, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + asrs r0, 24 + cmp r0, 0x3 + ble _08072324 + movs r3, 0x3 + movs r0, 0x1 + negs r0, r0 + mov r9, r0 + mov r8, sp +_08072344: + lsls r0, r5, 16 + asrs r6, r0, 16 + cmp r6, 0 + ble _08072372 + lsls r4, r3, 24 + asrs r4, 24 + mov r1, sp + adds r5, r1, r4 + adds r0, r6, 0 + movs r1, 0xA + bl __modsi3 + strb r0, [r5] + adds r0, r6, 0 + movs r1, 0xA + bl __divsi3 + lsls r0, 16 + lsrs r5, r0, 16 + subs r4, 0x1 + lsls r4, 24 + lsrs r3, r4, 24 + b _08072344 +_08072372: + lsls r1, r3, 24 + asrs r0, r1, 24 + cmp r0, r9 + ble _08072396 + movs r4, 0xFF + movs r3, 0x1 + negs r3, r3 +_08072380: + asrs r2, r1, 24 + mov r5, sp + adds r1, r5, r2 + ldrb r0, [r1] + orrs r0, r4 + strb r0, [r1] + subs r2, 0x1 + lsls r1, r2, 24 + asrs r0, r1, 24 + cmp r0, r3 + bgt _08072380 +_08072396: + mov r1, r8 + ldrb r0, [r1, 0x3] + cmp r0, 0xFF + bne _080723A2 + movs r0, 0 + strb r0, [r1, 0x3] +_080723A2: + mov r2, r10 + cmp r2, 0 + bne _08072432 + movs r3, 0 + movs r1, 0 + movs r6, 0xFC + lsls r6, 8 + movs r5, 0x1E + mov r12, r5 +_080723B4: + lsls r1, 24 + asrs r2, r1, 24 + mov r0, sp + adds r5, r0, r2 + ldrb r0, [r5] + mov r8, r1 + cmp r0, 0xFF + bne _080723EA + lsls r1, r2, 1 + adds r1, r7 + ldrh r2, [r1] + adds r0, r6, 0 + ands r0, r2 + mov r2, r12 + orrs r0, r2 + strh r0, [r1] + lsls r3, 24 + asrs r1, r3, 23 + adds r1, r7 + adds r1, 0x40 + ldrh r2, [r1] + adds r0, r6, 0 + ands r0, r2 + mov r5, r12 + orrs r0, r5 + strh r0, [r1] + b _0807241A +_080723EA: + lsls r2, 1 + adds r2, r7 + ldrh r0, [r2] + adds r1, r6, 0 + ands r1, r0 + ldrb r0, [r5] + adds r0, 0x14 + orrs r1, r0 + strh r1, [r2] + lsls r4, r3, 24 + asrs r3, r4, 24 + lsls r2, r3, 1 + adds r2, r7 + adds r2, 0x40 + ldrh r0, [r2] + adds r1, r6, 0 + ands r1, r0 + mov r5, sp + adds r0, r5, r3 + ldrb r0, [r0] + adds r0, 0x34 + orrs r1, r0 + strh r1, [r2] + adds r3, r4, 0 +_0807241A: + movs r0, 0x80 + lsls r0, 17 + add r0, r8 + lsrs r1, r0, 24 + movs r2, 0x80 + lsls r2, 17 + adds r0, r3, r2 + lsrs r3, r0, 24 + asrs r0, 24 + cmp r0, 0x3 + ble _080723B4 + b _08072496 +_08072432: + movs r3, 0 + movs r4, 0xFC + lsls r4, 8 + movs r6, 0x1E +_0807243A: + lsls r1, r3, 24 + asrs r2, r1, 24 + mov r3, sp + adds r5, r3, r2 + ldrb r0, [r5] + adds r3, r1, 0 + cmp r0, 0xFF + bne _08072466 + lsls r1, r2, 1 + adds r1, r7 + ldrh r2, [r1] + adds r0, r4, 0 + ands r0, r2 + orrs r0, r6 + strh r0, [r1] + adds r1, 0x40 + ldrh r2, [r1] + adds r0, r4, 0 + ands r0, r2 + orrs r0, r6 + strh r0, [r1] + b _08072488 +_08072466: + lsls r2, 1 + adds r2, r7 + ldrh r0, [r2] + adds r1, r4, 0 + ands r1, r0 + ldrb r0, [r5] + adds r0, 0x14 + orrs r1, r0 + strh r1, [r2] + adds r2, 0x40 + ldrh r0, [r2] + adds r1, r4, 0 + ands r1, r0 + ldrb r0, [r5] + adds r0, 0x34 + orrs r1, r0 + strh r1, [r2] +_08072488: + movs r5, 0x80 + lsls r5, 17 + adds r0, r3, r5 + lsrs r3, r0, 24 + asrs r0, 24 + cmp r0, 0x3 + ble _0807243A +_08072496: + 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_8072308 + + thumb_func_start sub_80724A8 +sub_80724A8: @ 80724A8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r0, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + movs r1, 0x1E + strh r1, [r5, 0x8] + lsls r0, 16 + asrs r0, 16 + adds r1, r5, 0 + movs r2, 0 + bl sub_8072308 + lsls r4, 16 + asrs r4, 16 + adds r5, 0xA + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_8072308 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80724A8 + + thumb_func_start battle_make_oam_normal_battle +battle_make_oam_normal_battle: @ 80724DC + 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 r10, r0 + movs r0, 0 + str r0, [sp] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _080725F0 + mov r0, r10 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08072574 + ldr r4, =gUnknown_0832C140 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl AddObjectToBack + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =0x02020630 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r1, 0x1] + movs r3, 0x3F + adds r0, r3, 0 + ands r0, r2 + strb r0, [r1, 0x1] + lsls r2, r7, 4 + adds r2, r7 + lsls r2, 2 + adds r2, r4 + ldrb r0, [r2, 0x1] + ands r3, r0 + strb r3, [r2, 0x1] + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x40 + ldr r4, =0x000003ff + adds r0, r4, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] + b _080725BA + .pool +_08072574: + ldr r4, =gUnknown_0832C170 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl AddObjectToBack + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02020630 + lsls r2, r7, 4 + adds r2, r7 + lsls r2, 2 + adds r2, r0 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x20 + ldr r5, =0x000003ff + adds r0, r5, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] + movs r0, 0x2 + str r0, [sp] +_080725BA: + ldr r2, =0x02020630 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r2 + strh r7, [r0, 0x6] + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r1, r0, r2 + strh r6, [r1, 0x38] + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_8072924 + str r1, [r0] + b _08072718 + .pool +_080725F0: + mov r0, r10 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08072694 + mov r0, r10 + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 25 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + ldr r4, =gUnknown_0832C140 + adds r0, r4 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + mov r0, r10 + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 25 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl AddObjectToBack + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =0x02020630 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r4 + strh r7, [r0, 0x6] + lsls r2, r7, 4 + adds r2, r7 + lsls r2, 2 + adds r3, r2, r4 + strh r6, [r3, 0x38] + ldrh r1, [r3, 0x4] + mov r8, r1 + mov r5, r8 + lsls r1, r5, 22 + lsrs r1, 22 + adds r1, 0x20 + ldr r5, =0x000003ff + adds r0, r5, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + mov r5, r8 + ands r0, r5 + orrs r0, r1 + strh r0, [r3, 0x4] + adds r4, 0x1C + adds r2, r4 + ldr r0, =sub_8072924 + str r0, [r2] + movs r0, 0x1 + b _08072716 + .pool +_08072694: + mov r0, r10 + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 25 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + ldr r4, =gUnknown_0832C170 + adds r0, r4 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + mov r0, r10 + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 25 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl AddObjectToBack + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =0x02020630 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r4 + strh r7, [r0, 0x6] + lsls r2, r7, 4 + adds r2, r7 + lsls r2, 2 + adds r3, r2, r4 + strh r6, [r3, 0x38] + ldrh r1, [r3, 0x4] + mov r8, r1 + mov r5, r8 + lsls r1, r5, 22 + lsrs r1, 22 + adds r1, 0x20 + ldr r5, =0x000003ff + adds r0, r5, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + mov r5, r8 + ands r0, r5 + orrs r0, r1 + strh r0, [r3, 0x4] + adds r4, 0x1C + adds r2, r4 + ldr r0, =sub_8072924 + str r0, [r2] + movs r0, 0x2 +_08072716: + str r0, [sp] +_08072718: + ldr r0, =0x02024076 + add r0, r10 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + ldr r1, =gUnknown_0832C1C0 + adds r0, r1 + movs r1, 0x8C + movs r2, 0x3C + movs r3, 0 + bl AddObjectToBack + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + ldr r1, =0x02020630 + mov r8, r1 + add r4, r8 + mov r0, r10 + bl battle_side_get_owner + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 21 + ldr r0, =gUnknown_0832C28C + adds r1, r0 + adds r0, r4, 0 + bl SetSpriteOamTables_NoPriorityFromTable + adds r2, r4, 0 + adds r2, 0x42 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldrb r1, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r2, 0x4 + mov r9, r2 + mov r1, r9 + orrs r0, r1 + strb r0, [r4, 0x5] + movs r0, 0x1 + bl sub_80728A4 + ldrh r1, [r4, 0x4] + lsls r1, 22 + lsrs r1, 17 + ldr r2, =0x06010000 + adds r1, r2 + ldr r2, =0x04000010 + bl CpuSet + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + add r0, r8 + strh r5, [r0, 0x38] + mov r2, r10 + strh r2, [r0, 0x3A] + adds r0, 0x3E + ldrb r1, [r0] + mov r5, r9 + orrs r1, r5 + strb r1, [r0] + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + add r0, r8 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r5 + strb r1, [r0] + strh r6, [r4, 0x38] + mov r0, sp + ldrh r0, [r0] + strh r0, [r4, 0x3A] + adds r4, 0x3E + ldrb r0, [r4] + orrs r0, r5 + strb r0, [r4] + adds r0, r6, 0 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end battle_make_oam_normal_battle + + thumb_func_start battle_make_oam_safari_battle +battle_make_oam_safari_battle: @ 8072804 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r4, =gUnknown_0832C1A0 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl AddObjectToFront + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xA0 + movs r3, 0x1 + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02020630 + mov r9, r1 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + add r4, r9 + ldrb r3, [r4, 0x1] + movs r2, 0x3F + adds r1, r2, 0 + ands r1, r3 + strb r1, [r4, 0x1] + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + mov r7, r9 + adds r5, r3, r7 + ldrb r1, [r5, 0x1] + ands r2, r1 + strb r2, [r5, 0x1] + ldrh r1, [r5, 0x4] + mov r8, r1 + mov r7, r8 + lsls r2, r7, 22 + lsrs r2, 22 + adds r2, 0x40 + ldr r7, =0x000003ff + adds r1, r7, 0 + ands r2, r1 + ldr r1, =0xfffffc00 + mov r7, r8 + ands r1, r7 + orrs r1, r2 + strh r1, [r5, 0x4] + strh r0, [r4, 0x6] + strh r6, [r5, 0x38] + movs r0, 0x1C + add r9, r0 + add r3, r9 + ldr r0, =sub_8072924 + str r0, [r3] + adds r0, r6, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end battle_make_oam_safari_battle + + thumb_func_start sub_80728A4 +sub_80728A4: @ 80728A4 + lsls r0, 24 + lsrs r0, 19 + ldr r1, =gUnknown_08C11BDC + adds r0, r1 + bx lr + .pool + thumb_func_end sub_80728A4 + + thumb_func_start sub_80728B4 +sub_80728B4: @ 80728B4 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x38] + lsls r0, 24 + lsrs r5, r0, 24 + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080728E4 + cmp r0, 0x1 + bgt _080728F8 + cmp r0, 0 + bne _080728F8 + ldr r2, =0x02020630 + lsls r3, r5, 4 + adds r1, r3, r5 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x20] + adds r0, 0x10 + b _08072906 + .pool +_080728E4: + ldr r2, =0x02020630 + lsls r3, r5, 4 + adds r1, r3, r5 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x20] + adds r0, 0x10 + b _08072906 + .pool +_080728F8: + ldr r2, =0x02020630 + lsls r3, r5, 4 + adds r1, r3, r5 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x20] + adds r0, 0x8 +_08072906: + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x22] + strh r0, [r4, 0x22] + adds r0, r3, r5 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x24] + strh r1, [r4, 0x24] + ldrh r0, [r0, 0x26] + strh r0, [r4, 0x26] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80728B4 + + thumb_func_start sub_8072924 +sub_8072924: @ 8072924 + ldrh r1, [r0, 0x38] + lsls r1, 24 + lsrs r1, 24 + ldr r3, =0x02020630 + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r2, 0x20] + adds r1, 0x40 + strh r1, [r0, 0x20] + ldrh r1, [r2, 0x22] + strh r1, [r0, 0x22] + ldrh r1, [r2, 0x24] + strh r1, [r0, 0x24] + ldrh r1, [r2, 0x26] + strh r1, [r0, 0x26] + bx lr + .pool + thumb_func_end sub_8072924 + + thumb_func_start sub_807294C +sub_807294C: @ 807294C + push {r4-r7,lr} + ldr r7, [sp, 0x14] + lsls r0, 24 + lsrs r0, 24 + ldr r6, =0x020244d0 + ldr r4, [r6] + ldr r5, [r4, 0xC] + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 2 + adds r5, r4, r5 + strb r1, [r5] + ldr r0, [r6] + ldr r0, [r0, 0xC] + adds r4, r0 + str r2, [r4, 0x4] + str r3, [r4, 0x8] + str r7, [r4, 0xC] + ldr r0, =0xffff8000 + str r0, [r4, 0x10] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807294C + + thumb_func_start sub_8072984 +sub_8072984: @ 8072984 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + adds r1, r2, 0 + adds r1, 0x3E + ldrb r0, [r1] + movs r3, 0x4 + orrs r0, r3 + strb r0, [r1] + movs r0, 0x38 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + ldrh r1, [r2, 0x6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8072984 + + thumb_func_start sub_80729D0 +sub_80729D0: @ 80729D0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =0x02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r5 + adds r4, r2, 0 + adds r4, 0x3E + ldrb r1, [r4] + movs r3, 0x5 + negs r3, r3 + adds r0, r3, 0 + ands r0, r1 + strb r0, [r4] + movs r0, 0x38 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r4, [r0] + adds r1, r3, 0 + ands r1, r4 + strb r1, [r0] + ldrh r1, [r2, 0x6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + ands r3, r1 + strb r3, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80729D0 + + thumb_func_start sub_8072A24 +sub_8072A24: @ 8072A24 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x02020630 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r3, r4 + strh r1, [r3, 0x20] + strh r2, [r3, 0x22] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8072A24 + + thumb_func_start sub_8072A44 +sub_8072A44: @ 8072A44 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =0x02020630 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r4, r5 + ldrh r1, [r4, 0x6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + movs r0, 0x38 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8072A44 + + thumb_func_start nullsub_30 +nullsub_30: @ 8072A84 + bx lr + thumb_func_end nullsub_30 + + thumb_func_start sub_8072A88 +sub_8072A88: @ 8072A88 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + movs r6, 0 + ldr r1, =0x0202406c + mov r8, r1 + ldrb r2, [r1] + cmp r6, r2 + bge _08072B00 + ldr r1, =0x02020630 + mov r12, r1 + movs r1, 0x3 + ands r0, r1 + lsls r5, r0, 2 + movs r7, 0xD + negs r7, r7 + ldr r2, =0x03005d70 + mov r9, r2 +_08072AB2: + mov r1, r9 + adds r0, r6, r1 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r12 + ldrb r4, [r1, 0x6] + ldrh r3, [r1, 0x38] + lsls r3, 24 + lsrs r3, 24 + ldrb r2, [r1, 0x5] + adds r0, r7, 0 + ands r0, r2 + orrs r0, r5 + strb r0, [r1, 0x5] + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + add r1, r12 + ldrb r2, [r1, 0x5] + adds r0, r7, 0 + ands r0, r2 + orrs r0, r5 + strb r0, [r1, 0x5] + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + add r1, r12 + ldrb r2, [r1, 0x5] + adds r0, r7, 0 + ands r0, r2 + orrs r0, r5 + strb r0, [r1, 0x5] + adds r6, 0x1 + mov r2, r8 + ldrb r2, [r2] + cmp r6, r2 + blt _08072AB2 +_08072B00: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8072A88 + + thumb_func_start sub_8072B18 +sub_8072B18: @ 8072B18 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + movs r4, 0 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _08072B44 + adds r0, r6, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08072B3E + movs r5, 0x2C + movs r4, 0x1E + b _08072B7C +_08072B3E: + movs r5, 0x9E + movs r4, 0x58 + b _08072B7C +_08072B44: + adds r0, r6, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08072B72 + cmp r0, 0x1 + bgt _08072B5C + cmp r0, 0 + beq _08072B66 + b _08072B7C +_08072B5C: + cmp r0, 0x2 + beq _08072B6C + cmp r0, 0x3 + beq _08072B78 + b _08072B7C +_08072B66: + movs r5, 0x9F + movs r4, 0x4C + b _08072B7C +_08072B6C: + movs r5, 0xAB + movs r4, 0x65 + b _08072B7C +_08072B72: + movs r5, 0x2C + movs r4, 0x13 + b _08072B7C +_08072B78: + movs r5, 0x20 + movs r4, 0x2C +_08072B7C: + ldr r0, =0x03005d70 + adds r0, r6, r0 + ldrb r0, [r0] + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_8072A24 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8072B18 + + thumb_func_start healthbar_draw_level +healthbar_draw_level: @ 8072B94 + push {r4,r5,lr} + sub sp, 0x18 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r1, 24 + add r2, sp, 0x4 + movs r0, 0xF9 + strb r0, [r2] + movs r0, 0x5 + strb r0, [r2, 0x1] + mov r0, sp + adds r0, 0x6 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r1, r0, 0 + subs r1, 0x2 + add r0, sp, 0x4 + subs r1, r0 + movs r0, 0x3 + subs r0, r1 + lsls r1, r0, 2 + adds r1, r0 + add r0, sp, 0x14 + str r0, [sp] + add r0, sp, 0x4 + movs r2, 0x3 + movs r3, 0x2 + bl write_to_rbox + adds r5, r0, 0 + ldr r0, =0x02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x4] + lsls r0, 22 + lsrs r4, r0, 17 + ldrh r0, [r1, 0x3A] + lsls r0, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08072C18 + bl battle_type_is_double + lsls r0, 24 + ldr r2, =0x06010420 + adds r1, r4, r2 + cmp r0, 0 + bne _08072C1C + ldr r0, =0x06010820 + adds r1, r4, r0 + b _08072C1C + .pool +_08072C18: + ldr r2, =0x06010400 + adds r1, r4, r2 +_08072C1C: + adds r0, r1, 0 + adds r1, r5, 0 + movs r2, 0x3 + bl sub_8075198 + ldr r0, [sp, 0x14] + bl sub_807512C + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end healthbar_draw_level + + thumb_func_start heathbar_draw_hp +heathbar_draw_hp: @ 8072C38 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldr r1, =0x02020630 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r4, r0, r1 + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08072D10 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _08072D10 + ldrh r0, [r4, 0x4] + lsls r0, 22 + lsrs r5, r0, 17 + mov r0, r8 + cmp r0, 0 + beq _08072CB8 + mov r2, r9 + lsls r1, r2, 16 + asrs r1, 16 + add r0, sp, 0x4 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + add r0, sp, 0x24 + str r0, [sp] + add r0, sp, 0x4 + movs r1, 0 + movs r2, 0x5 + movs r3, 0x2 + bl write_to_rbox + adds r4, r0, 0 + ldr r1, =0x06010b40 + adds r0, r5, r1 + adds r1, r4, 0 + b _08072CF8 + .pool +_08072CB8: + mov r2, r9 + lsls r1, r2, 16 + asrs r1, 16 + add r0, sp, 0x4 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + add r1, sp, 0x4 + movs r0, 0xBA + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + add r0, sp, 0x24 + str r0, [sp] + adds r0, r1, 0 + movs r1, 0x4 + movs r2, 0x5 + movs r3, 0x2 + bl write_to_rbox + adds r4, r0, 0 + ldr r1, =0x060103e0 + adds r0, r5, r1 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8075170 + ldr r2, =0x06010b00 + adds r0, r5, r2 + adds r1, r4, 0 + adds r1, 0x20 +_08072CF8: + movs r2, 0x2 + bl sub_8075170 + ldr r0, [sp, 0x24] + bl sub_807512C + b _08072DEA + .pool +_08072D10: + ldr r1, =gUnknown_0832C3C4 + add r0, sp, 0x4 + movs r2, 0x14 + bl memcpy + ldr r1, =0x02020630 + lsls r4, r7, 4 + adds r0, r4, r7 + lsls r0, 2 + adds r6, r0, r1 + ldrh r0, [r6, 0x3A] + lsls r0, 24 + lsrs r5, r0, 24 + bl battle_type_is_double + lsls r0, 24 + lsrs r0, 24 + mov r10, r4 + cmp r0, 0x1 + beq _08072D46 + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08072D60 +_08072D46: + mov r0, r9 + lsls r1, r0, 16 + asrs r1, 16 + adds r0, r7, 0 + mov r2, r8 + bl sub_8072E0C + b _08072DEA + .pool +_08072D60: + ldrh r0, [r6, 0x3A] + lsls r0, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08072D7C + movs r6, 0x59 + mov r1, r8 + cmp r1, 0 + bne _08072D86 + movs r6, 0x1D + b _08072D86 +_08072D7C: + movs r6, 0x30 + mov r2, r8 + cmp r2, 0 + bne _08072D86 + movs r6, 0x14 +_08072D86: + mov r0, sp + adds r0, 0xA + mov r2, r9 + lsls r1, r2, 16 + asrs r1, 16 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r0, =0x020244d4 + ldr r0, [r0] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x9 + add r2, sp, 0x4 + bl RenderTextFont9 + movs r4, 0 + ldr r1, =0x02020630 + mov r2, r10 + adds r0, r2, r7 + lsls r0, 2 + adds r5, r0, r1 +_08072DB8: + ldr r0, =0x020244d4 + ldr r0, [r0] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + lsls r1, r4, 6 + adds r1, 0x20 + ldr r0, [r0] + adds r0, r1 + ldrh r1, [r5, 0x4] + lsls r1, 22 + lsrs r1, 22 + adds r1, r6 + adds r1, r4 + lsls r1, 5 + ldr r2, =0x06010000 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _08072DB8 +_08072DEA: + 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 heathbar_draw_hp + + thumb_func_start sub_8072E0C +sub_8072E0C: @ 8072E0C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, 16 + lsrs r4, r1, 16 + mov r10, r4 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldr r5, =0x02020630 + lsls r0, 4 + add r0, r9 + lsls r0, 2 + adds r7, r0, r5 + ldrh r0, [r7, 0x3A] + lsls r0, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08072F28 + ldr r0, =0x020244d0 + ldr r1, [r0] + movs r2, 0x3A + ldrsh r0, [r7, r2] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08072E5E + b _080730B8 +_08072E5E: + movs r3, 0x38 + ldrsh r1, [r7, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r0, [r0, 0x4] + lsls r0, 22 + lsrs r5, r0, 17 + ldr r0, =0x06010000 + adds r6, r5, r0 + mov r0, r8 + cmp r0, 0 + beq _08072EDC + lsls r1, r4, 16 + asrs r1, 16 + add r0, sp, 0x4 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + add r0, sp, 0x28 + str r0, [sp] + add r0, sp, 0x4 + movs r1, 0 + movs r2, 0x5 + movs r3, 0 + bl write_to_rbox + adds r4, r0, 0 + ldr r1, =0x060100c0 + adds r0, r5, r1 + adds r1, r4, 0 + movs r2, 0x2 + bl sub_8075170 + ldr r0, [sp, 0x28] + bl sub_807512C + movs r0, 0x74 + bl sub_80728A4 + ldrh r1, [r7, 0x4] + lsls r1, 22 + lsrs r1, 17 + ldr r2, =0x06010680 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + b _080730B8 + .pool +_08072EDC: + lsls r1, r4, 16 + asrs r1, 16 + add r0, sp, 0x4 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + add r1, sp, 0x4 + movs r0, 0xBA + strb r0, [r1, 0x3] + movs r0, 0xFF + strb r0, [r1, 0x4] + add r0, sp, 0x28 + str r0, [sp] + adds r0, r1, 0 + movs r1, 0x4 + movs r2, 0x5 + movs r3, 0 + bl write_to_rbox + adds r4, r0, 0 + adds r0, r6, 0 + movs r1, 0 + movs r2, 0x3 + bl sub_807513C + ldr r3, =0x06010060 + adds r0, r5, r3 + adds r1, r4, 0 + movs r2, 0x3 + bl sub_8075170 + ldr r0, [sp, 0x28] + bl sub_807512C + b _080730B8 + .pool +_08072F28: + ldr r1, =gUnknown_0832C3D8 + add r0, sp, 0x4 + movs r2, 0x14 + bl memcpy + ldrh r0, [r7, 0x3A] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x2C] + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0] + ldr r2, [sp, 0x2C] + lsls r0, r2, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08072F52 + b _080730B8 +_08072F52: + movs r6, 0x4 + mov r3, r8 + negs r0, r3 + orrs r0, r3 + asrs r0, 31 + ands r6, r0 + ldrh r0, [r7, 0x38] + lsls r0, 24 + lsrs r7, r0, 24 + mov r0, sp + adds r0, 0xA + mov r2, r10 + lsls r1, r2, 16 + asrs r1, 16 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + mov r3, r8 + cmp r3, 0 + bne _08072F82 + ldr r1, =gUnknown_085E8D3E + bl CopyString +_08072F82: + ldr r0, =0x020244d4 + ldr r0, [r0] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x9 + add r2, sp, 0x4 + bl RenderTextFont9 + adds r4, r6, 0 + adds r0, r4, 0x3 + cmp r4, r0 + bge _08073024 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r5, r0, r5 +_08072FA6: + cmp r4, 0x2 + bhi _08072FF0 + ldr r0, =0x020244d4 + ldr r0, [r0] + movs r2, 0xBA + lsls r2, 1 + adds r0, r2 + subs r1, r4, r6 + lsls r1, 6 + adds r1, 0x20 + ldr r0, [r0] + adds r0, r1 + ldrh r1, [r5, 0x4] + lsls r1, 22 + lsrs r1, 22 + adds r4, 0x1 + adds r1, r4 + lsls r1, 5 + ldr r3, =0x06010000 + adds r1, r3 + ldr r2, =0x04000008 + bl CpuSet + b _0807301A + .pool +_08072FF0: + ldr r0, =0x020244d4 + ldr r0, [r0] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + subs r1, r4, r6 + lsls r1, 6 + adds r1, 0x20 + ldr r0, [r0] + adds r0, r1 + ldrh r1, [r5, 0x4] + lsls r1, 22 + lsrs r1, 22 + adds r1, r4, r1 + lsls r1, 5 + ldr r2, =0x06010020 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + adds r4, 0x1 +_0807301A: + lsls r0, r4, 24 + lsrs r4, r0, 24 + adds r0, r6, 0x3 + cmp r4, r0 + blt _08072FA6 +_08073024: + mov r3, r8 + cmp r3, 0 + bne _08073084 + ldr r0, =0x020244d4 + ldr r0, [r0] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + adds r0, 0xE0 + ldr r1, =0x02020630 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + adds r4, r1 + ldrh r1, [r4, 0x4] + lsls r1, 22 + lsrs r1, 17 + adds r1, 0x80 + ldr r5, =0x06010000 + adds r1, r5 + ldr r2, =0x04000008 + bl CpuSet + mov r2, r8 + str r2, [sp, 0x24] + add r0, sp, 0x24 + ldrh r1, [r4, 0x4] + lsls r1, 22 + lsrs r1, 17 + adds r1, r5 + ldr r2, =0x05000008 + bl CpuSet + b _080730B8 + .pool +_08073084: + ldr r0, [sp, 0x2C] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080730B8 + movs r0, 0x74 + bl sub_80728A4 + ldr r2, =0x02020630 + mov r3, r9 + lsls r1, r3, 4 + add r1, r9 + lsls r1, 2 + adds r1, r2 + ldrh r1, [r1, 0x4] + lsls r1, 22 + lsrs r1, 17 + movs r2, 0xD0 + lsls r2, 3 + adds r1, r2 + ldr r2, =0x06010000 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet +_080730B8: + 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_8072E0C + + thumb_func_start sub_80730D4 +sub_80730D4: @ 80730D4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + ldr r1, =gUnknown_0832C3C4 + mov r0, sp + movs r2, 0x14 + bl memcpy + ldr r1, =0x02020630 + ldr r2, [sp, 0x14] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x3A] + lsls r0, 24 + lsrs r0, 24 + bl battle_get_per_side_status + ldr r1, =0x020244d4 + ldr r2, [r1] + movs r3, 0xBA + lsls r3, 1 + adds r2, r3 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 7 + movs r0, 0xA4 + lsls r0, 3 + adds r1, r0 + ldr r0, [r2] + adds r6, r0, r1 + movs r1, 0x5 + mov r8, r1 + adds r0, r4, 0 + bl GetNature + lsls r0, 24 + mov r4, sp + adds r4, 0x6 + ldr r1, =gNatureNamePointers + lsrs r0, 22 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl CopyString + adds r0, r6, 0 + movs r1, 0x9 + mov r2, sp + bl RenderTextFont9 + movs r7, 0x6 + movs r5, 0 + mov r2, sp + adds r2, 0x9 + str r2, [sp, 0x1C] +_08073158: + mov r3, sp + adds r0, r3, r7 + ldrb r1, [r0] + adds r0, r1, 0 + subs r0, 0x37 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bls _08073176 + adds r0, r1, 0 + adds r0, 0x79 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bhi _0807318C +_08073176: + movs r0, 0x2C + b _080731AA + .pool +_0807318C: + adds r0, r1, 0 + subs r0, 0x4B + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bls _080731A4 + adds r0, r1, 0 + adds r0, 0x65 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _080731A8 +_080731A4: + movs r0, 0x2D + b _080731AA +_080731A8: + movs r0, 0x2B +_080731AA: + bl sub_80728A4 + lsls r1, r5, 6 + adds r1, r6, r1 + ldr r2, =0x04000008 + bl CpuSet + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r7, 0x1 + cmp r5, r8 + bcc _08073158 + movs r7, 0x1 + ldr r0, [sp, 0x14] + lsls r0, 4 + str r0, [sp, 0x18] + movs r1, 0x1 + add r1, r8 + mov r9, r1 + cmp r7, r9 + bge _08073236 + ldr r1, =0x02020630 + ldr r2, =0x04000008 + mov r10, r2 + ldr r3, [sp, 0x14] + adds r0, r3 + lsls r0, 2 + adds r0, r1 + mov r8, r0 +_080731E6: + mov r1, r8 + ldrh r0, [r1, 0x4] + lsls r0, 22 + lsrs r0, 22 + adds r5, r7, 0 + cmp r7, 0 + bge _080731F6 + adds r5, r7, 0x7 +_080731F6: + asrs r5, 3 + lsls r4, r5, 3 + subs r4, r7, r4 + adds r0, r4 + lsls r5, 6 + adds r0, r5 + lsls r0, 5 + ldr r2, =0x06010000 + adds r1, r0, r2 + adds r0, r6, 0 + mov r2, r10 + bl CpuSet + adds r6, 0x20 + mov r3, r8 + ldrh r0, [r3, 0x4] + lsls r0, 22 + lsrs r0, 22 + adds r4, 0x8 + adds r0, r4 + adds r0, r5 + lsls r0, 5 + ldr r2, =0x06010000 + adds r1, r0, r2 + adds r0, r6, 0 + mov r2, r10 + bl CpuSet + adds r6, 0x20 + adds r7, 0x1 + cmp r7, r9 + blt _080731E6 +_08073236: + ldr r6, =0x02020630 + ldr r3, [sp, 0x18] + ldr r1, [sp, 0x14] + adds r0, r3, r1 + lsls r0, 2 + adds r0, r6 + ldrh r4, [r0, 0x38] + lsls r4, 24 + lsrs r4, 24 + ldr r5, =0x0202449c + ldr r0, [r5] + adds r0, 0x7C + ldrb r1, [r0] + mov r0, sp + adds r0, 0x6 + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r0, [r5] + adds r0, 0x7B + ldrb r1, [r0] + ldr r0, [sp, 0x1C] + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + mov r1, sp + movs r0, 0 + strb r0, [r1, 0x5] + movs r0, 0xBA + strb r0, [r1, 0x8] + ldr r5, =0x020244d4 + ldr r0, [r5] + movs r2, 0xBA + lsls r2, 1 + adds r0, r2 + ldr r0, [r0] + movs r1, 0x9 + mov r2, sp + bl RenderTextFont9 + movs r7, 0 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r6, r0, r6 + movs r4, 0x20 +_08073296: + cmp r7, 0x1 + bgt _080732D4 + ldr r0, [r5] + movs r3, 0xBA + lsls r3, 1 + adds r0, r3 + ldr r0, [r0] + adds r0, r4 + ldrh r1, [r6, 0x4] + lsls r1, 22 + lsrs r1, 22 + adds r2, r7, 0x2 + adds r1, r2 + lsls r1, 5 + ldr r2, =0x06010000 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + b _080732F4 + .pool +_080732D4: + ldr r0, [r5] + movs r3, 0xBA + lsls r3, 1 + adds r0, r3 + ldr r0, [r0] + adds r0, r4 + ldrh r1, [r6, 0x4] + lsls r1, 22 + lsrs r1, 22 + adds r1, r7, r1 + lsls r1, 5 + ldr r2, =0x060100c0 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet +_080732F4: + adds r4, 0x40 + adds r7, 0x1 + cmp r7, 0x4 + ble _08073296 + 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_80730D4 + + thumb_func_start sub_8073314 +sub_8073314: @ 8073314 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r0, 0 + mov r9, r0 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r9, r0 + blt _0807332E + b _080735BA +_0807332E: + ldr r1, =0x02020630 + mov r10, r1 + ldr r2, =0x0202406e + mov r8, r2 +_08073336: + ldr r0, =0x03005d70 + mov r1, r9 + adds r6, r1, r0 + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + mov r1, r10 + adds r1, 0x1C + adds r0, r1 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + beq _08073354 + b _080735A8 +_08073354: + mov r2, r9 + lsls r0, r2, 24 + lsrs r7, r0, 24 + adds r0, r7, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0807336A + b _080735A8 +_0807336A: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _08073382 + adds r0, r7, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08073382 + b _080735A8 +_08073382: + ldr r5, =0x020244d0 + ldr r0, [r5] + ldr r3, [r0] + mov r0, r9 + lsls r4, r0, 2 + adds r3, r4, r3 + ldr r0, [r3] + lsls r0, 27 + lsrs r0, 31 + movs r2, 0x1 + eors r2, r0 + lsls r2, 4 + mov r12, r2 + ldrb r0, [r3] + movs r2, 0x11 + negs r2, r2 + adds r1, r2, 0 + ands r0, r1 + mov r1, r12 + orrs r0, r1 + strb r0, [r3] + ldr r0, [r5] + ldr r0, [r0] + adds r4, r0 + ldr r0, [r4] + lsls r0, 27 + lsrs r4, r0, 31 + adds r0, r7, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080734B0 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _080733D0 + b _080735A8 +_080733D0: + ldr r0, =0x02022fec + ldr r2, [r0] + movs r0, 0x80 + ands r2, r0 + cmp r2, 0 + beq _080733DE + b _080735A8 +_080733DE: + cmp r4, 0x1 + bne _08073468 + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldrh r0, [r0, 0x38] + lsls r0, 24 + lsrs r1, r0, 24 + str r2, [sp] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldrh r1, [r0, 0x4] + lsls r1, 22 + lsrs r1, 17 + ldr r2, =0x06010000 + adds r1, r2 + mov r0, sp + ldr r2, =0x05000040 + bl CpuSet + ldrb r4, [r6] + mov r1, r8 + ldrh r0, [r1] + movs r2, 0x64 + muls r0, r2 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x39 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + movs r2, 0 + bl sub_8072E0C + ldrb r4, [r6] + mov r2, r8 + ldrh r0, [r2] + movs r1, 0x64 + muls r0, r1 + ldr r2, =0x020244ec + b _08073536 + .pool +_08073468: + ldrb r0, [r6] + bl draw_status_ailment_maybe + ldrb r0, [r6] + mov r2, r8 + ldrh r1, [r2] + movs r2, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0x5 + bl healthbar_draw_field_maybe + movs r0, 0x75 + bl sub_80728A4 + ldrb r2, [r6] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r10 + ldrh r1, [r1, 0x4] + lsls r1, 22 + lsrs r1, 17 + ldr r2, =0x06010680 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + b _08073592 + .pool +_080734B0: + cmp r4, 0x1 + bne _0807355C + ldr r0, =0x02022fec + ldr r2, [r0] + movs r0, 0x80 + ands r2, r0 + cmp r2, 0 + beq _080734DC + ldrb r0, [r6] + mov r2, r8 + ldrh r1, [r2] + movs r2, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + adds r1, r2 + bl sub_80730D4 + b _08073592 + .pool +_080734DC: + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldrh r0, [r0, 0x38] + lsls r0, 24 + lsrs r1, r0, 24 + str r2, [sp] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldrh r1, [r0, 0x4] + lsls r1, 22 + lsrs r1, 17 + ldr r0, =0x06010000 + adds r1, r0 + mov r0, sp + ldr r2, =0x05000040 + bl CpuSet + ldrb r4, [r6] + mov r1, r8 + ldrh r0, [r1] + movs r2, 0x64 + muls r0, r2 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x39 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + movs r2, 0 + bl sub_8072E0C + ldrb r4, [r6] + mov r2, r8 + ldrh r0, [r2] + movs r1, 0x64 + muls r0, r1 + ldr r2, =0x02024744 +_08073536: + adds r0, r2 + movs r1, 0x3A + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_8072E0C + b _08073592 + .pool +_0807355C: + ldrb r0, [r6] + bl draw_status_ailment_maybe + ldrb r0, [r6] + mov r2, r8 + ldrh r1, [r2] + movs r5, 0x64 + muls r1, r5 + ldr r4, =0x02024744 + adds r1, r4 + movs r2, 0x5 + bl healthbar_draw_field_maybe + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08073592 + ldrb r0, [r6] + mov r2, r8 + ldrh r1, [r2] + muls r1, r5 + adds r1, r4 + movs r2, 0x4 + bl healthbar_draw_field_maybe +_08073592: + ldr r0, =0x03005d70 + add r0, r9 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldrh r1, [r0, 0x3C] + movs r2, 0x1 + eors r1, r2 + strh r1, [r0, 0x3C] +_080735A8: + movs r0, 0x2 + add r8, r0 + movs r1, 0x1 + add r9, r1 + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r9, r0 + bge _080735BA + b _08073336 +_080735BA: + 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_8073314 + + thumb_func_start sub_80735DC +sub_80735DC: @ 80735DC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + str r1, [sp, 0xC] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x8] + lsls r2, 24 + lsrs r2, 24 + adds r4, r2, 0 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x10] + cmp r4, 0 + beq _0807360C + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _0807365C +_0807360C: + ldr r0, [sp, 0x8] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08073630 + movs r0, 0 + mov r9, r0 + movs r5, 0x88 + movs r4, 0x60 + movs r1, 0x64 + mov r10, r1 + ldr r2, =0x0000fffb + mov r8, r2 + b _0807366C + .pool +_08073630: + movs r3, 0x1 + mov r9, r3 + cmp r4, 0 + beq _08073642 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _08073648 +_08073642: + movs r5, 0x68 + movs r4, 0x28 + b _0807364C +_08073648: + movs r5, 0x68 + movs r4, 0x10 +_0807364C: + ldr r6, =0x0000ff9c + mov r10, r6 + movs r0, 0x5 + mov r8, r0 + b _0807366C + .pool +_0807365C: + movs r1, 0x1 + mov r9, r1 + movs r5, 0x68 + movs r4, 0x28 + ldr r2, =0x0000ff9c + mov r10, r2 + movs r3, 0x5 + mov r8, r3 +_0807366C: + ldr r0, =gUnknown_0832C334 + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_0832C34C + bl LoadObjectPic + ldr r0, =gUnknown_0832C33C + bl LoadTaggedObjectPalette + ldr r0, =gUnknown_0832C344 + bl LoadTaggedObjectPalette + mov r0, r9 + lsls r6, r0, 1 + adds r0, r6, r0 + lsls r0, 3 + ldr r1, =gUnknown_0832C364 + adds r0, r1 + lsls r5, 16 + asrs r1, r5, 16 + lsls r4, 16 + asrs r2, r4, 16 + movs r3, 0xA + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + lsls r0, 4 + ldr r1, [sp, 0x14] + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r7, r0, r1 + ldr r1, =gUnknown_0832C2C4 + adds r0, r7, 0 + bl SetSpriteOamTables_NoPriorityFromTable + mov r2, r10 + strh r2, [r7, 0x24] + mov r3, r8 + strh r3, [r7, 0x2E] + str r5, [sp, 0x1C] + str r4, [sp, 0x20] + mov r5, r9 + cmp r5, 0 + beq _08073700 + ldrh r0, [r7, 0x20] + subs r0, 0x60 + strh r0, [r7, 0x20] + ldrb r1, [r7, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r7, 0x3] + b _08073706 + .pool +_08073700: + ldrh r0, [r7, 0x20] + adds r0, 0x60 + strh r0, [r7, 0x20] +_08073706: + movs r0, 0 + mov r8, r0 + ldr r1, =0x02020630 + mov r10, r1 + mov r7, sp + mov r2, r9 + adds r0, r6, r2 + lsls r0, 3 + str r0, [sp, 0x18] + movs r6, 0xA + movs r5, 0 +_0807371C: + ldr r0, =gUnknown_0832C394 + ldr r3, [sp, 0x20] + ldr r1, =0xfffc0000 + adds r2, r3, r1 + ldr r3, [sp, 0x18] + adds r0, r3, r0 + ldr r3, [sp, 0x1C] + asrs r1, r3, 16 + asrs r2, 16 + movs r3, 0x9 + bl AddObjectToBack + strb r0, [r7] + ldr r0, [sp, 0x10] + cmp r0, 0 + bne _0807374C + ldrb r0, [r7] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r2, =0x0202064c + adds r1, r2 + ldr r0, =sub_80741C8 + str r0, [r1] +_0807374C: + ldr r4, =0x02020630 + mov r3, r9 + cmp r3, 0 + bne _0807376E + ldrb r1, [r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + strh r3, [r0, 0x24] + ldrb r1, [r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r10 + mov r1, r9 + strh r1, [r0, 0x26] +_0807376E: + ldrb r1, [r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0 + mov r2, sp + ldrh r2, [r2, 0x14] + strh r2, [r0, 0x2E] + mov r3, r9 + cmp r3, 0 + bne _080737C8 + ldrb r0, [r7] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r1, 0x20] + adds r0, 0x18 + adds r0, r5 + strh r0, [r1, 0x20] + ldrb r1, [r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r6, [r0, 0x30] + ldrb r1, [r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x78 + b _0807380A + .pool +_080737C8: + ldrb r0, [r7] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + ldrh r3, [r2, 0x20] + subs r3, 0x18 + movs r1, 0x5 + mov r0, r8 + subs r1, r0 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + subs r3, r0 + strh r3, [r2, 0x20] + ldrb r0, [r7] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + movs r1, 0x6 + mov r3, r8 + subs r1, r3 + lsls r0, r1, 3 + subs r0, r1 + adds r0, 0xA + strh r0, [r2, 0x30] + ldrb r1, [r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000ff88 +_0807380A: + strh r1, [r0, 0x24] + ldrb r1, [r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + mov r1, r9 + strh r1, [r0, 0x32] + adds r7, 0x1 + adds r6, 0x7 + adds r5, 0xA + movs r2, 0x1 + add r8, r2 + mov r3, r8 + cmp r3, 0x5 + bgt _0807382C + b _0807371C +_0807382C: + ldr r0, [sp, 0x8] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0807383A + b _080739E8 +_0807383A: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r2, 0x40 + ands r1, r2 + cmp r1, 0 + beq _080738F4 + ldr r5, =0x0000ffff + mov r10, r5 + ldr r6, =0x02020630 + ldr r0, =0x000003ff + adds r7, r0, 0 + ldr r1, =0xfffffc00 + mov r9, r1 + mov r4, sp + ldr r5, [sp, 0xC] + movs r2, 0x5 + mov r8, r2 +_0807385C: + ldrh r0, [r5] + cmp r0, r10 + bne _080738A8 + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r6 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x1 + ands r1, r7 + mov r0, r9 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x1 + strh r1, [r0, 0x3C] + b _080738E2 + .pool +_080738A8: + cmp r0, 0 + bne _080738C0 + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r6 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x3 + b _080738D8 +_080738C0: + ldr r0, [r5, 0x4] + cmp r0, 0 + beq _080738E2 + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r6 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x2 +_080738D8: + ands r1, r7 + mov r0, r9 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] +_080738E2: + adds r4, 0x1 + adds r5, 0x8 + movs r3, 0x1 + negs r3, r3 + add r8, r3 + mov r0, r8 + cmp r0, 0 + bge _0807385C + b _08073B9A +_080738F4: + movs r1, 0x5 + mov r10, r1 + movs r7, 0 + ldr r2, =0x02020630 + mov r8, r2 + ldr r3, =0x000003ff + mov r9, r3 + ldr r5, =0xfffffc00 + mov r12, r5 + ldr r6, [sp, 0xC] + mov r5, sp +_0807390A: + ldrh r0, [r6] + ldr r1, =0x0000ffff + cmp r0, r1 + bne _08073958 + mov r4, sp + add r4, r10 + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r8 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x1 + mov r0, r9 + ands r1, r0 + mov r0, r12 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + movs r1, 0x1 + strh r1, [r0, 0x3C] + subs r1, 0x2 + add r10, r1 + b _080739DE + .pool +_08073958: + cmp r0, 0 + bne _08073970 + ldrb r0, [r5] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r8 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x3 + b _080739D0 +_08073970: + ldr r1, =0x02022fec + ldr r0, [r1] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _080739B8 + ldr r0, =0x0202449c + ldr r0, [r0] + movs r2, 0xA8 + lsls r2, 2 + adds r0, r2 + ldrb r1, [r0] + ldr r2, =gUnknown_0832A328 + lsls r0, r7, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _080739B8 + ldrb r0, [r5] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r8 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x3 + b _080739D0 + .pool +_080739B8: + ldr r0, [r6, 0x4] + cmp r0, 0 + beq _080739DC + ldrb r0, [r5] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r8 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x2 +_080739D0: + mov r0, r9 + ands r1, r0 + mov r0, r12 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] +_080739DC: + adds r5, 0x1 +_080739DE: + adds r6, 0x8 + adds r7, 0x1 + cmp r7, 0x5 + ble _0807390A + b _08073B9A +_080739E8: + ldr r0, =0x02022fec + ldr r1, [r0] + ldr r2, =0x00008040 + ands r1, r2 + cmp r1, 0 + beq _08073AA4 + ldr r1, =0x0000ffff + mov r10, r1 + ldr r6, =0x02020630 + ldr r2, =0x000003ff + adds r7, r2, 0 + ldr r3, =0xfffffc00 + mov r9, r3 + ldr r5, [sp, 0xC] + mov r4, sp + adds r4, 0x5 + movs r0, 0x5 + mov r8, r0 +_08073A0C: + ldrh r0, [r5] + cmp r0, r10 + bne _08073A58 + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r6 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x1 + ands r1, r7 + mov r0, r9 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x1 + strh r1, [r0, 0x3C] + b _08073A92 + .pool +_08073A58: + cmp r0, 0 + bne _08073A70 + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r6 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x3 + b _08073A88 +_08073A70: + ldr r0, [r5, 0x4] + cmp r0, 0 + beq _08073A92 + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r6 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x2 +_08073A88: + ands r1, r7 + mov r0, r9 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] +_08073A92: + subs r4, 0x1 + adds r5, 0x8 + movs r1, 0x1 + negs r1, r1 + add r8, r1 + mov r2, r8 + cmp r2, 0 + bge _08073A0C + b _08073B9A +_08073AA4: + movs r3, 0 + mov r8, r3 + movs r7, 0 + ldr r5, =0x02020630 + mov r9, r5 + ldr r6, =0x000003ff + mov r12, r6 + ldr r0, =0xfffffc00 + mov r10, r0 + ldr r6, [sp, 0xC] + mov r5, sp + adds r5, 0x5 +_08073ABC: + ldrh r0, [r6] + ldr r1, =0x0000ffff + cmp r0, r1 + bne _08073B08 + mov r4, sp + add r4, r8 + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r9 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x1 + mov r0, r12 + ands r1, r0 + mov r0, r10 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + movs r1, 0x1 + strh r1, [r0, 0x3C] + add r8, r1 + b _08073B92 + .pool +_08073B08: + cmp r0, 0 + bne _08073B20 + ldrb r0, [r5] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r9 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x3 + b _08073B84 +_08073B20: + ldr r1, =0x02022fec + ldr r0, [r1] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _08073B6C + ldr r2, =0x0202449c + ldr r0, [r2] + ldr r3, =0x000002a1 + adds r0, r3 + ldrb r1, [r0] + lsls r0, r7, 2 + ldr r2, =gUnknown_0832A328 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08073B6C + ldrb r0, [r5] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r9 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x3 + b _08073B84 + .pool +_08073B6C: + ldr r0, [r6, 0x4] + cmp r0, 0 + beq _08073B90 + ldrb r0, [r5] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r9 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x2 +_08073B84: + mov r0, r12 + ands r1, r0 + mov r0, r10 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] +_08073B90: + subs r5, 0x1 +_08073B92: + adds r6, 0x8 + adds r7, 0x1 + cmp r7, 0x5 + ble _08073ABC +_08073B9A: + ldr r0, =TaskDummy + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, =0x03005e00 + lsls r3, r4, 2 + adds r1, r3, r4 + lsls r1, 3 + adds r0, r1, r2 + mov r5, sp + ldrh r5, [r5, 0x8] + strh r5, [r0, 0x8] + mov r6, sp + ldrh r6, [r6, 0x14] + strh r6, [r0, 0xA] + movs r0, 0 + mov r8, r0 + adds r0, r2, 0 + adds r0, 0xE + adds r1, r0 +_08073BC6: + mov r0, sp + add r0, r8 + ldrb r0, [r0] + strh r0, [r1] + adds r1, 0x2 + movs r5, 0x1 + add r8, r5 + mov r6, r8 + cmp r6, 0x5 + ble _08073BC6 + adds r0, r3, r4 + lsls r0, 3 + adds r0, r2 + mov r1, sp + ldrh r1, [r1, 0x10] + strh r1, [r0, 0x1C] + ldr r2, [sp, 0x10] + cmp r2, 0 + beq _08073C0A + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r3, [r0, 0x8] + ldrb r2, [r3, 0x9] + lsls r1, r2, 27 + lsrs r1, 29 + adds r1, 0x1 + movs r0, 0x7 + ands r1, r0 + lsls r1, 2 + movs r0, 0x1D + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x9] +_08073C0A: + movs r0, 0x72 + movs r1, 0 + bl audio_play_and_stuff + adds r0, r4, 0 + 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_80735DC + + thumb_func_start sub_8073C30 +sub_8073C30: @ 8073C30 + 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 + mov r8, r0 + ldr r2, =0x03005e00 + lsls r3, r0, 2 + adds r1, r3, r0 + lsls r1, 3 + adds r0, r1, r2 + ldrb r7, [r0, 0x1C] + ldrb r4, [r0, 0xA] + mov r10, r4 + ldrb r0, [r0, 0x8] + str r0, [sp, 0x8] + movs r5, 0 + str r3, [sp, 0xC] + adds r2, 0xE + adds r2, r1, r2 +_08073C5E: + mov r0, sp + adds r1, r0, r5 + ldrh r0, [r2] + strb r0, [r1] + adds r2, 0x2 + adds r5, 0x1 + cmp r5, 0x5 + ble _08073C5E + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0x10 + bl SetGpuReg + ldr r1, =0x03005e00 + ldr r0, [sp, 0xC] + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x10 + strh r1, [r0, 0x26] + movs r5, 0 + mov r1, r10 + lsls r1, 4 + str r1, [sp, 0x10] + ldr r3, =0x02020630 + movs r6, 0xD + negs r6, r6 + mov r12, r3 + movs r4, 0x4 +_08073CA0: + mov r2, sp + adds r0, r2, r5 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r2, [r1, 0x1] + adds r0, r6, 0 + ands r0, r2 + orrs r0, r4 + strb r0, [r1, 0x1] + adds r5, 0x1 + cmp r5, 0x5 + ble _08073CA0 + ldr r2, [sp, 0x10] + add r2, r10 + lsls r2, 2 + add r2, r12 + ldrb r1, [r2, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x1] + cmp r7, 0 + bne _08073CDA + b _08073DE0 +_08073CDA: + movs r5, 0 + mov r6, r12 + mov r9, r5 + adds r3, r6, 0 + adds r3, 0x1C + mov r4, sp + movs r7, 0 +_08073CE8: + ldr r0, [sp, 0x8] + str r3, [sp, 0x14] + bl battle_side_get_owner + lsls r0, 24 + lsrs r2, r0, 24 + ldr r3, [sp, 0x14] + cmp r2, 0 + beq _08073D4C + movs r0, 0x5 + subs r0, r5 + mov r1, sp + adds r2, r1, r0 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r7, [r0, 0x30] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r1, r9 + strh r1, [r0, 0x34] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r1, r9 + strh r1, [r0, 0x36] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldr r1, =sub_8074158 + str r1, [r0] + ldr r2, =0x02020630 + mov r12, r2 + b _08073D82 + .pool +_08073D4C: + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r7, [r0, 0x30] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x34] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r2, [r0, 0x36] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldr r1, =sub_8074158 + str r1, [r0] + ldr r0, =0x02020630 + mov r12, r0 +_08073D82: + adds r4, 0x1 + adds r7, 0x7 + adds r5, 0x1 + cmp r5, 0x5 + ble _08073CE8 + ldr r3, [sp, 0x10] + add r3, r10 + lsls r3, 2 + mov r1, r12 + adds r0, r3, r1 + movs r2, 0x2E + ldrsh r1, [r0, r2] + lsrs r2, r1, 31 + adds r1, r2 + asrs r1, 1 + movs r2, 0 + strh r1, [r0, 0x2E] + strh r2, [r0, 0x30] + mov r1, r12 + adds r1, 0x1C + adds r3, r1 + ldr r1, =sub_8074090 + str r1, [r3] + ldr r1, =gUnknown_0832C2CC + bl SetSpriteOamTables_NoPriorityFromTable + ldr r1, =0x03005e00 + ldr r0, [sp, 0xC] + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldr r1, =task_battle_throw_own_ball + str r1, [r0] + b _08073DEE + .pool +_08073DE0: + ldr r0, =0x03005e00 + ldr r1, [sp, 0xC] + add r1, r8 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8073F98 + str r0, [r1] +_08073DEE: + 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_8073C30 + + thumb_func_start task_battle_throw_own_ball +task_battle_throw_own_ball: @ 8073E08 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x1E] + adds r1, r0, 0x1 + strh r1, [r4, 0x1E] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08073E48 + ldrh r0, [r4, 0x26] + subs r1, r0, 0x1 + strh r1, [r4, 0x26] + lsls r0, r1, 16 + cmp r0, 0 + blt _08073E54 + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg +_08073E48: + movs r1, 0x26 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08073E54 + ldr r0, =sub_8073E64 + str r0, [r4] +_08073E54: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task_battle_throw_own_ball + + thumb_func_start sub_8073E64 +sub_8073E64: @ 8073E64 + push {r4-r7,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r7, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r3, r0, 3 + adds r4, r3, r7 + ldrb r2, [r4, 0x8] + ldrh r0, [r4, 0x26] + subs r0, 0x1 + strh r0, [r4, 0x26] + lsls r0, 16 + asrs r1, r0, 16 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _08073F54 + ldrb r5, [r4, 0xA] + movs r4, 0 + ldr r6, =0x020244d0 + adds r0, r7, 0 + adds r0, 0xE + adds r2, r3, r0 +_08073E96: + mov r0, sp + adds r1, r0, r4 + ldrh r0, [r2] + strb r0, [r1] + adds r2, 0x2 + adds r4, 0x1 + cmp r4, 0x5 + ble _08073E96 + ldr r0, [r6] + ldr r3, [r0, 0x8] + ldrb r2, [r3, 0x9] + lsls r1, r2, 27 + lsrs r1, 29 + subs r1, 0x1 + movs r0, 0x7 + ands r1, r0 + lsls r1, 2 + movs r0, 0x1D + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x9] + ldr r0, [r6] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x9] + movs r0, 0x1C + ands r0, r1 + cmp r0, 0 + bne _08073EFC + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl RemoveObjectAndFreeResources + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeResources + b _08073F32 + .pool +_08073EFC: + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + ldr r5, =0x02020630 + adds r4, r5 + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl obj_free_rotscale_entry + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles +_08073F32: + movs r4, 0x1 + ldr r5, =0x02020630 +_08073F36: + mov r1, sp + adds r0, r1, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + adds r4, 0x1 + cmp r4, 0x5 + ble _08073F36 + b _08073F8A + .pool +_08073F54: + movs r0, 0x3 + negs r0, r0 + cmp r1, r0 + bne _08073F8A + ldr r0, =0x020244d0 + 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, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r5, 0 + bl DestroyTask +_08073F8A: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8073E64 + + thumb_func_start sub_8073F98 +sub_8073F98: @ 8073F98 + push {r4-r7,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + ldr r7, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r6, r0, 3 + adds r3, r6, r7 + ldrb r5, [r3, 0x8] + ldrh r0, [r3, 0x26] + subs r1, r0, 0x1 + strh r1, [r3, 0x26] + lsls r0, r1, 16 + asrs r2, r0, 16 + cmp r2, 0 + blt _08073FD4 + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + b _0807406A + .pool +_08073FD4: + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + bne _08074034 + ldrb r3, [r3, 0xA] + movs r5, 0 + adds r0, r7, 0 + adds r0, 0xE + adds r2, r6, r0 +_08073FE6: + mov r0, sp + adds r1, r0, r5 + ldrh r0, [r2] + strb r0, [r1] + adds r2, 0x2 + adds r5, 0x1 + cmp r5, 0x5 + ble _08073FE6 + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl RemoveObjectAndFreeResources + mov r0, sp + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeResources + movs r5, 0x1 +_08074016: + mov r1, sp + adds r0, r1, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + adds r5, 0x1 + cmp r5, 0x5 + ble _08074016 + b _0807406A + .pool +_08074034: + movs r0, 0x3 + negs r0, r0 + cmp r2, r0 + bne _0807406A + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r4, 0 + bl DestroyTask +_0807406A: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8073F98 + + thumb_func_start sub_8074078 +sub_8074078: @ 8074078 + push {lr} + adds r1, r0, 0 + ldrh r2, [r1, 0x24] + movs r3, 0x24 + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _0807408C + ldrh r0, [r1, 0x2E] + adds r0, r2, r0 + strh r0, [r1, 0x24] +_0807408C: + pop {r0} + bx r0 + thumb_func_end sub_8074078 + + thumb_func_start sub_8074090 +sub_8074090: @ 8074090 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x30] + adds r1, r0, 0 + adds r1, 0x20 + strh r1, [r2, 0x30] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + ble _080740AE + lsls r0, r1, 16 + asrs r0, 20 + ldrh r1, [r2, 0x24] + adds r0, r1 + b _080740B6 +_080740AE: + lsls r1, 16 + asrs r1, 20 + ldrh r0, [r2, 0x24] + subs r0, r1 +_080740B6: + strh r0, [r2, 0x24] + ldrh r1, [r2, 0x30] + movs r0, 0xF + ands r0, r1 + strh r0, [r2, 0x30] + pop {r0} + bx r0 + thumb_func_end sub_8074090 + + thumb_func_start sub_80740C4 +sub_80740C4: @ 80740C4 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _080740D8 + subs r0, r1, 0x1 + strh r0, [r4, 0x30] + b _0807414E +_080740D8: + ldrh r0, [r4, 0x32] + lsls r0, 24 + lsrs r3, r0, 24 + ldrh r2, [r4, 0x34] + adds r0, r2, 0 + adds r0, 0x38 + lsls r1, r0, 16 + lsrs r2, r1, 16 + ldr r0, =0x0000fff0 + ands r2, r0 + strh r2, [r4, 0x34] + cmp r3, 0 + beq _0807410C + lsrs r0, r1, 20 + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + lsls r0, 16 + cmp r0, 0 + ble _0807411C + movs r0, 0 + strh r0, [r4, 0x24] + b _0807411C + .pool +_0807410C: + lsrs r1, 20 + ldrh r0, [r4, 0x24] + subs r0, r1 + strh r0, [r4, 0x24] + lsls r0, 16 + cmp r0, 0 + bge _0807411C + strh r3, [r4, 0x24] +_0807411C: + movs r2, 0x24 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0807414E + movs r1, 0x3F + cmp r3, 0 + beq _0807412C + movs r1, 0xC0 +_0807412C: + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08074140 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x74 + bl sub_80A383C + b _0807414A +_08074140: + lsls r1, 24 + asrs r1, 24 + movs r0, 0x73 + bl sub_80A3808 +_0807414A: + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] +_0807414E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80740C4 + + thumb_func_start sub_8074158 +sub_8074158: @ 8074158 + push {r4,lr} + adds r3, r0, 0 + ldrh r1, [r3, 0x30] + movs r2, 0x30 + ldrsh r0, [r3, r2] + cmp r0, 0 + ble _0807416C + subs r0, r1, 0x1 + strh r0, [r3, 0x30] + b _080741BC +_0807416C: + ldrh r0, [r3, 0x32] + lsls r0, 24 + ldrh r2, [r3, 0x34] + adds r1, r2, 0 + adds r1, 0x38 + lsls r4, r1, 16 + lsrs r2, r4, 16 + ldr r1, =0x0000fff0 + ands r2, r1 + strh r2, [r3, 0x34] + cmp r0, 0 + beq _08074190 + lsrs r0, r4, 20 + ldrh r1, [r3, 0x24] + adds r0, r1 + b _08074196 + .pool +_08074190: + lsrs r1, r4, 20 + ldrh r0, [r3, 0x24] + subs r0, r1 +_08074196: + strh r0, [r3, 0x24] + movs r2, 0x24 + ldrsh r0, [r3, r2] + movs r2, 0x20 + ldrsh r1, [r3, r2] + adds r0, r1 + adds r0, 0x8 + movs r1, 0x80 + lsls r1, 1 + cmp r0, r1 + bls _080741BC + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =DummyObjectCallback + str r0, [r3, 0x1C] +_080741BC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8074158 + + thumb_func_start sub_80741C8 +sub_80741C8: @ 80741C8 + ldrh r2, [r0, 0x2E] + lsls r2, 24 + lsrs r2, 24 + ldr r3, =0x02020630 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r3 + ldrh r2, [r1, 0x24] + strh r2, [r0, 0x24] + ldrh r1, [r1, 0x26] + strh r1, [r0, 0x26] + bx lr + .pool + thumb_func_end sub_80741C8 + + thumb_func_start sub_80741E8 +sub_80741E8: @ 80741E8 + push {r4-r7,lr} + sub sp, 0x14 + adds r4, r1, 0 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r5, =0x02022e2c + ldr r1, =gUnknown_085ED228 + adds r0, r5, 0 + bl CopyString + adds r0, r4, 0 + movs r1, 0x2 + add r2, sp, 0x4 + bl pokemon_getattr + add r0, sp, 0x4 + bl GetStringEnd_Limit7 + adds r0, r5, 0 + add r1, sp, 0x4 + bl AppendString + adds r5, r0, 0 + adds r0, r4, 0 + bl pokemon_get_gender + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + adds r1, r0, 0 + cmp r0, 0x1D + beq _08074236 + cmp r0, 0x20 + bne _0807424A +_08074236: + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + add r0, sp, 0x4 + bl CompareString + cmp r0, 0 + bne _0807424A + movs r6, 0x64 +_0807424A: + cmp r6, 0 + beq _08074268 + cmp r6, 0xFE + beq _08074270 + ldr r1, =gUnknown_085ED238 + b _08074272 + .pool +_08074268: + ldr r1, =gUnknown_085ED22E + b _08074272 + .pool +_08074270: + ldr r1, =gUnknown_085ED233 +_08074272: + adds r0, r5, 0 + bl CopyString + ldr r0, =0x02022e2c + add r1, sp, 0x10 + str r1, [sp] + movs r1, 0 + movs r2, 0x3 + movs r3, 0x2 + bl write_to_rbox + adds r6, r0, 0 + ldr r0, =0x02020630 + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x4] + lsls r0, 22 + lsrs r4, r0, 17 + ldrh r0, [r1, 0x3A] + lsls r0, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080742F0 + ldr r1, =0x06010040 + adds r0, r4, r1 + adds r1, r6, 0 + movs r2, 0x6 + bl sub_8075198 + bl battle_type_is_double + lsls r0, 24 + ldr r1, =0x06010400 + adds r5, r4, r1 + cmp r0, 0 + bne _080742C8 + ldr r0, =0x06010800 + adds r5, r4, r0 +_080742C8: + adds r1, r6, 0 + adds r1, 0xC0 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_8075198 + b _080742FC + .pool +_080742F0: + ldr r1, =0x06010020 + adds r0, r4, r1 + adds r1, r6, 0 + movs r2, 0x7 + bl sub_8075198 +_080742FC: + ldr r0, [sp, 0x10] + bl sub_807512C + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80741E8 + + thumb_func_start sub_8074310 +sub_8074310: @ 8074310 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + bne _080743E6 + movs r0, 0x8 + ands r1, r0 + cmp r1, 0 + bne _080743E6 + ldr r6, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r5, r0, r6 + ldrh r0, [r5, 0x3A] + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080743E6 + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _080743E6 + ldrh r0, [r5, 0x38] + lsls r0, 24 + lsrs r4, r0, 24 + cmp r7, 0 + beq _080743C4 + movs r0, 0x46 + bl sub_80728A4 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r6 + ldrh r1, [r1, 0x4] + lsls r1, 22 + lsrs r1, 17 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2 + ldr r2, =0x06010000 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + b _080743E6 + .pool +_080743C4: + str r7, [sp] + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r6 + ldrh r1, [r0, 0x4] + lsls r1, 22 + lsrs r1, 17 + movs r0, 0x80 + lsls r0, 1 + adds r1, r0 + ldr r0, =0x06010000 + adds r1, r0 + ldr r2, =0x05000008 + mov r0, sp + bl CpuSet +_080743E6: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8074310 + + thumb_func_start draw_status_ailment_maybe +draw_status_ailment_maybe: @ 80743F8 + 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 + ldr r0, =0x02020630 + mov r2, r9 + lsls r1, r2, 4 + add r1, r9 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x3A] + lsls r0, 24 + lsrs r7, r0, 24 + ldrh r0, [r1, 0x38] + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + adds r0, r7, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08074468 + ldr r1, =0x0202406e + lsls r0, r7, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x37 + bl pokemon_getattr + adds r4, r0, 0 + bl battle_type_is_double + lsls r0, 24 + movs r3, 0x12 + mov r8, r3 + cmp r0, 0 + bne _08074484 + movs r0, 0x1A + mov r8, r0 + b _08074484 + .pool +_08074468: + ldr r1, =0x0202406e + lsls r0, r7, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x37 + bl pokemon_getattr + adds r4, r0, 0 + movs r1, 0x11 + mov r8, r1 +_08074484: + movs r0, 0x7 + ands r0, r4 + cmp r0, 0 + beq _080744AC + movs r0, 0x1B + adds r1, r7, 0 + bl sub_80746A8 + lsls r0, 24 + lsrs r0, 24 + bl sub_80728A4 + adds r6, r0, 0 + movs r0, 0x2 + b _080745B8 + .pool +_080744AC: + movs r0, 0x88 + ands r0, r4 + cmp r0, 0 + beq _080744CA + movs r0, 0x15 + adds r1, r7, 0 + bl sub_80746A8 + lsls r0, 24 + lsrs r0, 24 + bl sub_80728A4 + adds r6, r0, 0 + movs r0, 0 + b _080745B8 +_080744CA: + movs r0, 0x10 + ands r0, r4 + cmp r0, 0 + beq _080744E8 + movs r0, 0x21 + adds r1, r7, 0 + bl sub_80746A8 + lsls r0, 24 + lsrs r0, 24 + bl sub_80728A4 + adds r6, r0, 0 + movs r0, 0x4 + b _080745B8 +_080744E8: + movs r0, 0x20 + ands r0, r4 + cmp r0, 0 + beq _08074506 + movs r0, 0x1E + adds r1, r7, 0 + bl sub_80746A8 + lsls r0, 24 + lsrs r0, 24 + bl sub_80728A4 + adds r6, r0, 0 + movs r0, 0x3 + b _080745B8 +_08074506: + movs r0, 0x40 + ands r0, r4 + cmp r0, 0 + beq _08074524 + movs r0, 0x18 + adds r1, r7, 0 + bl sub_80746A8 + lsls r0, 24 + lsrs r0, 24 + bl sub_80728A4 + adds r6, r0, 0 + movs r0, 0x1 + b _080745B8 +_08074524: + movs r0, 0x27 + bl sub_80728A4 + adds r6, r0, 0 + movs r4, 0 + mov r2, r9 + lsls r0, r2, 4 + mov r3, r8 + lsls r3, 16 + mov r8, r3 + lsls r7, 2 + ldr r1, =0x02020630 + add r0, r9 + lsls r0, 2 + adds r5, r0, r1 +_08074542: + ldrh r1, [r5, 0x4] + lsls r1, 22 + lsrs r1, 22 + mov r2, r8 + asrs r0, r2, 16 + adds r1, r0 + adds r1, r4 + lsls r1, 5 + ldr r3, =0x06010000 + adds r1, r3 + adds r0, r6, 0 + ldr r2, =0x04000008 + bl CpuSet + adds r4, 0x1 + cmp r4, 0x2 + ble _08074542 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + adds r0, r7, r0 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08074598 + movs r0, 0x1 + bl sub_80728A4 + ldr r2, =0x02020630 + mov r3, r10 + lsls r1, r3, 4 + add r1, r10 + lsls r1, 2 + adds r1, r2 + ldrh r1, [r1, 0x4] + lsls r1, 22 + lsrs r1, 17 + ldr r2, =0x06010000 + adds r1, r2 + ldr r2, =0x04000010 + bl CpuSet +_08074598: + mov r0, r9 + movs r1, 0x1 + bl sub_8074310 + b _0807467A + .pool +_080745B8: + mov r1, r9 + lsls r5, r1, 4 + add r5, r9 + lsls r5, 2 + ldr r2, =0x02020630 + adds r5, r2 + ldrb r4, [r5, 0x5] + lsrs r4, 4 + lsls r4, 4 + adds r4, 0xC + adds r4, r7 + ldr r1, =gUnknown_0832C3EC + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + movs r3, 0x80 + lsls r3, 1 + adds r1, r4, r3 + movs r2, 0x2 + bl rboxid_80040B8 + lsls r4, 1 + ldr r0, =0x02037914 + adds r0, r4, r0 + ldr r1, =0x05000200 + adds r4, r1 + adds r1, r4, 0 + movs r2, 0x1 + bl CpuSet + ldrh r1, [r5, 0x4] + lsls r1, 22 + lsrs r1, 22 + add r1, r8 + lsls r1, 5 + ldr r2, =0x06010000 + mov r8, r2 + add r1, r8 + ldr r2, =0x04000018 + adds r0, r6, 0 + bl CpuSet + bl battle_type_is_double + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08074626 + adds r0, r7, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08074672 +_08074626: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r7, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08074672 + movs r0, 0 + bl sub_80728A4 + mov r3, r10 + lsls r4, r3, 4 + add r4, r10 + lsls r4, 2 + ldr r1, =0x02020630 + adds r4, r1 + ldrh r1, [r4, 0x4] + lsls r1, 22 + lsrs r1, 17 + add r1, r8 + ldr r5, =0x04000008 + adds r2, r5, 0 + bl CpuSet + movs r0, 0x41 + bl sub_80728A4 + ldrh r1, [r4, 0x4] + lsls r1, 22 + lsrs r1, 17 + adds r1, 0x20 + add r1, r8 + adds r2, r5, 0 + bl CpuSet +_08074672: + mov r0, r9 + movs r1, 0 + bl sub_8074310 +_0807467A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end draw_status_ailment_maybe + + thumb_func_start sub_80746A8 +sub_80746A8: @ 80746A8 + push {lr} + lsls r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + lsrs r2, r0, 24 + adds r0, r2, 0 + subs r0, 0x15 + cmp r0, 0xC + bhi _08074768 + lsls r0, 2 + ldr r1, =_080746C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080746C8: + .4byte _080746FC + .4byte _08074768 + .4byte _08074768 + .4byte _08074712 + .4byte _08074768 + .4byte _08074768 + .4byte _08074728 + .4byte _08074768 + .4byte _08074768 + .4byte _0807473E + .4byte _08074768 + .4byte _08074768 + .4byte _08074754 +_080746FC: + movs r2, 0x15 + cmp r3, 0 + beq _08074768 + movs r2, 0x47 + cmp r3, 0x1 + beq _08074768 + movs r2, 0x65 + cmp r3, 0x2 + bne _08074768 + movs r2, 0x56 + b _08074768 +_08074712: + movs r2, 0x18 + cmp r3, 0 + beq _08074768 + movs r2, 0x4A + cmp r3, 0x1 + beq _08074768 + movs r2, 0x68 + cmp r3, 0x2 + bne _08074768 + movs r2, 0x59 + b _08074768 +_08074728: + movs r2, 0x1B + cmp r3, 0 + beq _08074768 + movs r2, 0x4D + cmp r3, 0x1 + beq _08074768 + movs r2, 0x6B + cmp r3, 0x2 + bne _08074768 + movs r2, 0x5C + b _08074768 +_0807473E: + movs r2, 0x1E + cmp r3, 0 + beq _08074768 + movs r2, 0x50 + cmp r3, 0x1 + beq _08074768 + movs r2, 0x6E + cmp r3, 0x2 + bne _08074768 + movs r2, 0x5F + b _08074768 +_08074754: + movs r2, 0x21 + cmp r3, 0 + beq _08074768 + movs r2, 0x53 + cmp r3, 0x1 + beq _08074768 + movs r2, 0x71 + cmp r3, 0x2 + bne _08074768 + movs r2, 0x62 +_08074768: + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_80746A8 + + thumb_func_start sub_8074770 +sub_8074770: @ 8074770 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_085CCB2C + add r1, sp, 0x4 + str r1, [sp] + movs r1, 0 + movs r2, 0x3 + movs r3, 0x2 + bl write_to_rbox + adds r5, r0, 0 + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrh r4, [r0, 0x4] + lsls r4, 22 + lsrs r4, 17 + ldr r1, =0x06010040 + adds r0, r4, r1 + adds r1, r5, 0 + movs r2, 0x6 + bl sub_8075198 + ldr r0, =0x06010800 + adds r4, r0 + adds r5, 0xC0 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + bl sub_8075198 + ldr r0, [sp, 0x4] + bl sub_807512C + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8074770 + + thumb_func_start sub_80747D8 +sub_80747D8: @ 80747D8 + push {r4,r5,lr} + sub sp, 0x18 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =gUnknown_085CCB3C + add r0, sp, 0x4 + bl CopyString + ldr r1, =0x0203a04c + ldrb r1, [r1] + movs r2, 0 + movs r3, 0x2 + bl ConvertIntToDecimalString + movs r0, 0 + add r1, sp, 0x4 + movs r2, 0x2F + bl GetStringRightAlignXOffset + adds r1, r0, 0 + add r0, sp, 0x14 + str r0, [sp] + add r0, sp, 0x4 + movs r2, 0x3 + movs r3, 0x2 + bl write_to_rbox + adds r5, r0, 0 + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrh r4, [r0, 0x4] + lsls r4, 22 + lsrs r4, 17 + ldr r1, =0x060102c0 + adds r0, r4, r1 + adds r1, r5, 0 + movs r2, 0x2 + bl sub_80751E4 + ldr r0, =0x06010a00 + adds r4, r0 + adds r5, 0x40 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x4 + bl sub_80751E4 + ldr r0, [sp, 0x14] + bl sub_807512C + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80747D8 + + thumb_func_start healthbar_draw_field_maybe +healthbar_draw_field_maybe: @ 8074860 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r1 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r2, 24 + lsrs r7, r2, 24 + ldr r1, =0x02020630 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x3A] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + cmp r7, 0 + bne _0807489C + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + bne _0807489C + mov r0, r9 + bl battle_side_get_owner +_0807489C: + ldr r1, =0x02020630 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x3A] + lsls r0, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080748B8 + b _08074A18 +_080748B8: + cmp r7, 0x3 + beq _080748C0 + cmp r7, 0 + bne _080748D4 +_080748C0: + mov r0, r8 + movs r1, 0x38 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl healthbar_draw_level +_080748D4: + cmp r7, 0x1 + bhi _080748EE + mov r0, r8 + movs r1, 0x39 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r6, 0 + movs r2, 0 + bl heathbar_draw_hp +_080748EE: + cmp r7, 0x2 + beq _080748F6 + cmp r7, 0 + bne _0807490C +_080748F6: + mov r0, r8 + movs r1, 0x3A + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r6, 0 + movs r2, 0x1 + bl heathbar_draw_hp +_0807490C: + cmp r7, 0x5 + beq _08074914 + cmp r7, 0 + bne _08074948 +_08074914: + movs r0, 0 + bl load_gfxc_health_bar + mov r0, r8 + movs r1, 0x3A + bl pokemon_getattr + adds r4, r0, 0 + mov r0, r8 + movs r1, 0x39 + bl pokemon_getattr + adds r3, r0, 0 + movs r0, 0 + str r0, [sp] + mov r0, r9 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_807294C + mov r0, r9 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0 + bl sub_8074AA0 +_08074948: + bl battle_type_is_double + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + cmp r0, 0 + bne _080749CE + cmp r7, 0x6 + beq _0807495E + cmp r7, 0 + bne _080749CE +_0807495E: + movs r0, 0x3 + bl load_gfxc_health_bar + mov r0, r8 + movs r1, 0xB + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + mov r0, r8 + movs r1, 0x38 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r0, r8 + movs r1, 0x19 + bl pokemon_getattr + adds r3, r0, 0 + ldr r0, =gExperienceTables + mov r12, r0 + lsls r1, r4, 2 + ldr r2, =gBaseStats + lsls r0, r5, 3 + subs r0, r5 + lsls r0, 2 + adds r0, r2 + ldrb r2, [r0, 0x13] + movs r0, 0xCA + lsls r0, 1 + muls r0, r2 + adds r1, r0 + add r1, r12 + ldr r1, [r1] + subs r3, r1 + adds r4, 0x1 + lsls r4, 2 + adds r4, r0 + add r4, r12 + ldr r2, [r4] + subs r2, r1 + mov r0, r10 + str r0, [sp] + mov r0, r9 + adds r1, r6, 0 + bl sub_807294C + mov r0, r9 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_8074AA0 +_080749CE: + cmp r7, 0x4 + beq _080749D6 + cmp r7, 0 + bne _080749DE +_080749D6: + adds r0, r6, 0 + mov r1, r8 + bl sub_80741E8 +_080749DE: + cmp r7, 0x9 + beq _080749E6 + cmp r7, 0 + bne _080749EC +_080749E6: + adds r0, r6, 0 + bl draw_status_ailment_maybe +_080749EC: + cmp r7, 0xA + bne _080749F6 + adds r0, r6, 0 + bl sub_8074770 +_080749F6: + adds r0, r7, 0 + subs r0, 0xA + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08074A8E + adds r0, r6, 0 + bl sub_80747D8 + b _08074A8E + .pool +_08074A18: + cmp r7, 0x3 + beq _08074A20 + cmp r7, 0 + bne _08074A34 +_08074A20: + mov r0, r8 + movs r1, 0x38 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl healthbar_draw_level +_08074A34: + cmp r7, 0x5 + beq _08074A3C + cmp r7, 0 + bne _08074A70 +_08074A3C: + movs r0, 0 + bl load_gfxc_health_bar + mov r0, r8 + movs r1, 0x3A + bl pokemon_getattr + adds r4, r0, 0 + mov r0, r8 + movs r1, 0x39 + bl pokemon_getattr + adds r3, r0, 0 + movs r0, 0 + str r0, [sp] + mov r0, r9 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_807294C + mov r0, r9 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0 + bl sub_8074AA0 +_08074A70: + cmp r7, 0x4 + beq _08074A78 + cmp r7, 0 + bne _08074A80 +_08074A78: + adds r0, r6, 0 + mov r1, r8 + bl sub_80741E8 +_08074A80: + cmp r7, 0x9 + beq _08074A88 + cmp r7, 0 + bne _08074A8E +_08074A88: + adds r0, r6, 0 + bl draw_status_ailment_maybe +_08074A8E: + 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 healthbar_draw_field_maybe + + thumb_func_start sub_8074AA0 +sub_8074AA0: @ 8074AA0 + 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 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + cmp r2, 0 + bne _08074AEC + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0xC] + mov r1, r8 + lsls r5, r1, 2 + adds r3, r5, r1 + lsls r3, 2 + adds r3, r0 + ldr r0, [r3, 0x4] + ldr r1, [r3, 0x8] + ldr r2, [r3, 0xC] + adds r3, 0x10 + movs r4, 0x6 + str r4, [sp] + movs r4, 0x1 + str r4, [sp, 0x4] + bl sub_8074DB8 + adds r4, r0, 0 + adds r7, r5, 0 + b _08074B48 + .pool +_08074AEC: + ldr r2, =0x020244d0 + mov r10, r2 + ldr r0, [r2] + ldr r2, [r0, 0xC] + mov r0, r8 + lsls r4, r0, 2 + adds r0, r4, r0 + lsls r6, r0, 2 + adds r2, r6, r2 + ldr r0, [r2, 0x8] + ldr r1, [r2, 0xC] + ldr r2, [r2, 0x4] + movs r3, 0x8 + bl sub_8074FE8 + lsls r0, 24 + lsrs r5, r0, 24 + adds r7, r4, 0 + cmp r5, 0 + bne _08074B16 + movs r5, 0x1 +_08074B16: + mov r1, r10 + ldr r0, [r1] + ldr r0, [r0, 0xC] + adds r4, r6, r0 + ldr r6, [r4, 0xC] + adds r0, r6, 0 + adds r1, r5, 0 + bl __divsi3 + cmp r0, 0 + bge _08074B2E + negs r0, r0 +_08074B2E: + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, [r4, 0x4] + ldr r1, [r4, 0x8] + adds r3, r4, 0 + adds r3, 0x10 + movs r2, 0x8 + str r2, [sp] + str r5, [sp, 0x4] + adds r2, r6, 0 + bl sub_8074DB8 + adds r4, r0, 0 +_08074B48: + mov r2, r9 + cmp r2, 0x1 + beq _08074B64 + cmp r2, 0 + bne _08074B6C + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0] + adds r0, r7, r0 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08074B6C +_08074B64: + mov r0, r8 + mov r1, r9 + bl sub_8074B9C +_08074B6C: + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + bne _08074B86 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0xC] + mov r2, r8 + adds r0, r7, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0 + str r1, [r0, 0x10] +_08074B86: + adds r0, r4, 0 + 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_8074AA0 + + thumb_func_start sub_8074B9C +sub_8074B9C: @ 8074B9C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0 + beq _08074BB8 + cmp r1, 0x1 + beq _08074CA0 + b _08074D9E +_08074BB8: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0xC] + lsls r5, r6, 2 + adds r3, r5, r6 + lsls r3, 2 + adds r3, r0 + ldr r0, [r3, 0x4] + ldr r1, [r3, 0x8] + ldr r2, [r3, 0xC] + adds r3, 0x10 + add r4, sp, 0x8 + str r4, [sp] + movs r4, 0x6 + str r4, [sp, 0x4] + bl sub_8074E8C + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + mov r9, r1 + adds r7, r5, 0 + cmp r0, 0x18 + bhi _08074BF4 + movs r2, 0x38 + mov r9, r2 + cmp r0, 0x9 + bls _08074BF4 + movs r4, 0x2F + mov r9, r4 +_08074BF4: + movs r5, 0 + ldr r0, =0x02020630 + mov r8, r0 +_08074BFA: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0xC] + adds r0, r7, r6 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrh r0, [r0, 0x38] + lsls r0, 24 + lsrs r4, r0, 24 + cmp r5, 0x1 + bhi _08074C5C + mov r0, r9 + bl sub_80728A4 + mov r1, sp + adds r1, r5 + adds r1, 0x8 + ldrb r1, [r1] + lsls r1, 5 + adds r0, r1 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + add r1, r8 + ldrh r1, [r1, 0x4] + lsls r1, 22 + lsrs r1, 22 + adds r2, r5, 0x2 + adds r1, r2 + lsls r1, 5 + ldr r2, =0x06010000 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + b _08074C8A + .pool +_08074C5C: + mov r0, r9 + bl sub_80728A4 + mov r1, sp + adds r1, r5 + adds r1, 0x8 + ldrb r1, [r1] + lsls r1, 5 + adds r0, r1 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + add r1, r8 + ldrh r1, [r1, 0x4] + lsls r1, 22 + lsrs r1, 22 + adds r1, r5, r1 + lsls r1, 5 + ldr r4, =0x06010040 + adds r1, r4 + ldr r2, =0x04000008 + bl CpuSet +_08074C8A: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _08074BFA + b _08074D9E + .pool +_08074CA0: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0xC] + lsls r5, r6, 2 + adds r3, r5, r6 + lsls r3, 2 + adds r3, r0 + ldr r0, [r3, 0x4] + ldr r1, [r3, 0x8] + ldr r2, [r3, 0xC] + adds r3, 0x10 + add r4, sp, 0x8 + str r4, [sp] + movs r4, 0x8 + str r4, [sp, 0x4] + bl sub_8074E8C + ldr r1, =0x0202406e + lsls r0, r6, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x38 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + adds r7, r5, 0 + cmp r0, 0x64 + bne _08074CF8 + movs r5, 0 + movs r1, 0 +_08074CE6: + mov r0, sp + adds r0, r5 + adds r0, 0x8 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x7 + bls _08074CE6 +_08074CF8: + movs r5, 0 + ldr r0, =0x02020630 + mov r8, r0 + adds r0, r7, r6 + lsls r4, r0, 2 +_08074D02: + cmp r5, 0x3 + bhi _08074D5C + movs r0, 0xC + bl sub_80728A4 + mov r1, sp + adds r1, r5 + adds r1, 0x8 + ldrb r1, [r1] + lsls r1, 5 + adds r0, r1 + ldr r1, =0x020244d0 + ldr r1, [r1] + ldr r1, [r1, 0xC] + adds r1, r4, r1 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + ldrh r1, [r1, 0x4] + lsls r1, 22 + lsrs r1, 22 + adds r2, r5, 0 + adds r2, 0x24 + adds r1, r2 + lsls r1, 5 + ldr r2, =0x06010000 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + b _08074D94 + .pool +_08074D5C: + movs r0, 0xC + bl sub_80728A4 + mov r1, sp + adds r1, r5 + adds r1, 0x8 + ldrb r1, [r1] + lsls r1, 5 + adds r0, r1 + ldr r1, =0x020244d0 + ldr r1, [r1] + ldr r1, [r1, 0xC] + adds r1, r4, r1 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + ldrh r1, [r1, 0x4] + lsls r1, 22 + lsrs r1, 22 + adds r1, r5, r1 + lsls r1, 5 + ldr r2, =0x06010b80 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet +_08074D94: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x7 + bls _08074D02 +_08074D9E: + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8074B9C + + thumb_func_start sub_8074DB8 +sub_8074DB8: @ 8074DB8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + adds r4, r1, 0 + mov r8, r2 + adds r5, r3, 0 + ldr r1, [sp, 0x18] + ldr r0, [sp, 0x1C] + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, 27 + lsrs r2, r1, 24 + ldr r1, [r5] + ldr r0, =0xffff8000 + cmp r1, r0 + bne _08074DEA + cmp r7, r2 + bge _08074DE8 + lsls r0, r4, 8 + str r0, [r5] + b _08074DEA + .pool +_08074DE8: + str r4, [r5] +_08074DEA: + mov r0, r8 + subs r4, r0 + cmp r4, 0 + bge _08074DF6 + movs r4, 0 + b _08074DFC +_08074DF6: + cmp r4, r7 + ble _08074DFC + adds r4, r7, 0 +_08074DFC: + cmp r7, r2 + bge _08074E18 + ldr r0, [r5] + asrs r1, r0, 8 + adds r6, r0, 0 + cmp r4, r1 + bne _08074E24 + movs r0, 0xFF + ands r0, r6 + cmp r0, 0 + bne _08074E24 + movs r0, 0x1 + negs r0, r0 + b _08074E80 +_08074E18: + ldr r6, [r5] + cmp r4, r6 + bne _08074E24 + movs r0, 0x1 + negs r0, r0 + b _08074E80 +_08074E24: + cmp r7, r2 + bge _08074E5E + lsls r0, r7, 8 + adds r1, r2, 0 + bl __divsi3 + mov r1, r8 + cmp r1, 0 + bge _08074E42 + adds r0, r6, r0 + str r0, [r5] + asrs r2, r0, 8 + cmp r2, r4 + blt _08074E7E + b _08074E56 +_08074E42: + subs r0, r6, r0 + str r0, [r5] + asrs r2, r0, 8 + movs r1, 0xFF + ands r0, r1 + cmp r0, 0 + ble _08074E52 + adds r2, 0x1 +_08074E52: + cmp r2, r4 + bgt _08074E7E +_08074E56: + lsls r0, r4, 8 + str r0, [r5] + adds r2, r4, 0 + b _08074E7E +_08074E5E: + mov r0, r8 + cmp r0, 0 + bge _08074E70 + ldr r0, [r5] + adds r0, r3 + str r0, [r5] + cmp r0, r4 + ble _08074E7C + b _08074E7A +_08074E70: + ldr r0, [r5] + subs r0, r3 + str r0, [r5] + cmp r0, r4 + bge _08074E7C +_08074E7A: + str r4, [r5] +_08074E7C: + ldr r2, [r5] +_08074E7E: + adds r0, r2, 0 +_08074E80: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8074DB8 + + thumb_func_start sub_8074E8C +sub_8074E8C: @ 8074E8C + push {r4-r7,lr} + adds r4, r0, 0 + mov r12, r3 + ldr r7, [sp, 0x14] + ldr r0, [sp, 0x18] + lsls r0, 24 + lsrs r6, r0, 24 + subs r5, r1, r2 + cmp r5, 0 + bge _08074EA4 + movs r5, 0 + b _08074EAA +_08074EA4: + cmp r5, r4 + ble _08074EAA + adds r5, r4, 0 +_08074EAA: + lsls r0, r6, 27 + lsrs r3, r0, 24 + movs r1, 0 + cmp r1, r6 + bcs _08074EC4 + movs r2, 0 +_08074EB6: + adds r0, r7, r1 + strb r2, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, r6 + bcc _08074EB6 +_08074EC4: + cmp r4, r3 + bge _08074ED8 + mov r1, r12 + ldr r0, [r1] + muls r0, r3 + adds r1, r4, 0 + bl __divsi3 + asrs r0, 8 + b _08074EE4 +_08074ED8: + mov r1, r12 + ldr r0, [r1] + muls r0, r3 + adds r1, r4, 0 + bl __divsi3 +_08074EE4: + lsls r0, 24 + lsrs r2, r0, 24 + adds r3, r2, 0 + cmp r3, 0 + bne _08074EFA + cmp r5, 0 + ble _08074EFA + movs r0, 0x1 + strb r0, [r7] + movs r3, 0x1 + b _08074F1E +_08074EFA: + movs r1, 0 + movs r4, 0x8 +_08074EFE: + cmp r1, r6 + bcs _08074F1E + cmp r2, 0x7 + bls _08074F1A + adds r0, r7, r1 + strb r4, [r0] + adds r0, r2, 0 + subs r0, 0x8 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + b _08074EFE +_08074F1A: + adds r0, r7, r1 + strb r2, [r0] +_08074F1E: + adds r0, r3, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8074E8C + + thumb_func_start sub_8074F28 +sub_8074F28: @ 8074F28 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r5, r0, 0 + adds r6, r1, 0 + adds r4, r2, 0 + mov r8, r3 + ldr r0, [r5] + ldr r1, [r5, 0x4] + ldr r2, [r5, 0x8] + movs r3, 0x6 + str r3, [sp] + movs r3, 0x1 + str r3, [sp, 0x4] + adds r3, r6, 0 + bl sub_8074DB8 + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r5, 0 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_8074F88 + ldr r0, [r5] + cmp r0, 0x2F + bgt _08074F68 + ldr r0, [r6] + lsls r0, 8 + lsrs r1, r0, 16 + b _08074F6A +_08074F68: + ldrh r1, [r6] +_08074F6A: + movs r2, 0 + ldrsh r0, [r5, r2] + lsls r1, 16 + asrs r1, 16 + mov r2, r8 + bl sub_8072304 + lsls r0, r7, 16 + asrs r0, 16 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8074F28 + + thumb_func_start sub_8074F88 +sub_8074F88: @ 8074F88 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x1C + adds r5, r0, 0 + adds r3, r1, 0 + mov r8, r2 + ldr r0, [r5] + ldr r1, [r5, 0x4] + ldr r2, [r5, 0x8] + add r4, sp, 0x8 + str r4, [sp] + movs r4, 0x6 + str r4, [sp, 0x4] + bl sub_8074E8C + movs r3, 0 + add r7, sp, 0x10 + mov r12, r7 + ldrb r0, [r5, 0xC] + lsls r6, r0, 27 + ldr r4, [r5, 0x10] +_08074FB4: + lsls r2, r3, 1 + add r2, r12 + lsrs r1, r6, 15 + mov r0, sp + adds r0, r3 + adds r0, 0x8 + ldrb r0, [r0] + adds r0, r4, r0 + orrs r1, r0 + strh r1, [r2] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x5 + bls _08074FB4 + adds r0, r7, 0 + mov r1, r8 + movs r2, 0x6 + bl CpuSet + add sp, 0x1C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8074F88 + + thumb_func_start sub_8074FE8 +sub_8074FE8: @ 8074FE8 + push {r4-r7,lr} + adds r6, r2, 0 + lsls r3, 27 + lsrs r7, r3, 24 + subs r5, r0, r1 + cmp r5, 0 + bge _08074FFA + movs r5, 0 + b _08075000 +_08074FFA: + cmp r5, r6 + ble _08075000 + adds r5, r6, 0 +_08075000: + muls r0, r7 + adds r1, r6, 0 + bl __divsi3 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + muls r0, r7 + adds r1, r6, 0 + bl __divsi3 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + subs r0, r4, r0 + cmp r0, 0 + bge _08075028 + negs r0, r0 +_08075028: + lsls r0, 24 + lsrs r0, 24 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8074FE8 + + thumb_func_start sub_8075034 +sub_8075034: @ 8075034 + push {r4,lr} + lsls r2, 24 + lsrs r2, 24 + lsls r0, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + muls r0, r2 + lsls r1, 16 + asrs r1, 16 + bl __divsi3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08075058 + cmp r4, 0 + ble _08075058 + movs r0, 0x1 +_08075058: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8075034 + + thumb_func_start sub_8075060 +sub_8075060: @ 8075060 + push {lr} + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + bne _08075072 + movs r0, 0x4 + b _0807508E +_08075072: + movs r2, 0x30 + bl sub_8075034 + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0x3 + cmp r1, 0x18 + bhi _0807508E + movs r0, 0x2 + cmp r1, 0x9 + bhi _0807508E + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 +_0807508E: + pop {r1} + bx r1 + thumb_func_end sub_8075060 + + thumb_func_start write_to_rbox +write_to_rbox: @ 8075094 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + mov r10, r0 + mov r8, r1 + mov r9, r2 + adds r5, r3, 0 + ldr r7, [sp, 0x40] + ldr r0, =gUnknown_0832C3F8 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x18] + str r1, [sp, 0x1C] + add r0, sp, 0x18 + bl AddWindow + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r6, r4, 24 + lsrs r6, 24 + lsls r1, r5, 4 + orrs r1, r5 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl FillWindowPixelBuffer + add r0, sp, 0x14 + movs r2, 0 + strb r5, [r0] + adds r1, r0, 0 + movs r0, 0x1 + strb r0, [r1, 0x1] + movs r0, 0x3 + strb r0, [r1, 0x2] + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + str r2, [sp] + str r2, [sp, 0x4] + str r1, [sp, 0x8] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0xC] + mov r0, r10 + str r0, [sp, 0x10] + adds r0, r6, 0 + movs r1, 0 + mov r2, r8 + mov r3, r9 + bl AddTextPrinterParametrized2 + str r4, [r7] + adds r0, r6, 0 + movs r1, 0x7 + bl GetWindowAttribute + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end write_to_rbox + + thumb_func_start sub_807512C +sub_807512C: @ 807512C + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl RemoveWindow + pop {r0} + bx r0 + thumb_func_end sub_807512C + + thumb_func_start sub_807513C +sub_807513C: @ 807513C + push {lr} + sub sp, 0x4 + adds r3, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r1, r0, 8 + adds r0, r1 + lsls r1, r0, 16 + adds r0, r1 + str r0, [sp] + lsls r2, 3 + ldr r0, =0x001fffff + ands r2, r0 + movs r0, 0xA0 + lsls r0, 19 + orrs r2, r0 + mov r0, sp + adds r1, r3, 0 + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_807513C + + thumb_func_start sub_8075170 +sub_8075170: @ 8075170 + push {lr} + adds r3, r0, 0 + adds r0, r1, 0 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + lsls r2, 3 + ldr r1, =0x001fffff + ands r2, r1 + movs r1, 0x80 + lsls r1, 19 + orrs r2, r1 + adds r1, r3, 0 + bl CpuSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_8075170 + + thumb_func_start sub_8075198 +sub_8075198: @ 8075198 + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + adds r4, r2, 0 + movs r1, 0x80 + lsls r1, 1 + adds r0, r5, r1 + adds r1, r6, r1 + lsls r2, r4, 3 + ldr r3, =0x001fffff + ands r2, r3 + movs r3, 0x80 + lsls r3, 19 + orrs r2, r3 + bl CpuSet + cmp r4, 0 + ble _080751D4 +_080751BC: + adds r0, r5, 0 + adds r0, 0x14 + adds r1, r6, 0 + adds r1, 0x14 + ldr r2, =0x04000003 + bl CpuSet + adds r6, 0x20 + adds r5, 0x20 + subs r4, 0x1 + cmp r4, 0 + bne _080751BC +_080751D4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8075198 + + thumb_func_start sub_80751E4 +sub_80751E4: @ 80751E4 + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + lsls r4, r2, 3 + ldr r0, =0x001fffff + ands r4, r0 + movs r0, 0x80 + lsls r0, 19 + orrs r4, r0 + adds r0, r5, 0 + adds r1, r6, 0 + adds r2, r4, 0 + bl CpuSet + movs r0, 0x80 + lsls r0, 1 + adds r5, r0 + adds r6, r0 + adds r0, r5, 0 + adds r1, r6, 0 + adds r2, r4, 0 + bl CpuSet + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80751E4 + + thumb_func_start sub_807521C +sub_807521C: @ 807521C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 24 + lsrs r4, r2, 24 + ldr r5, =gUnknown_0831C620 + ldrh r0, [r5, 0x6] + bl GetObjectTileRangeStartByTag + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + bne _0807524E + adds r0, r5, 0 + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_0831C628 + bl LoadCompressedObjectPaletteUsingHeap +_0807524E: + ldr r0, =sub_8075370 + bl object_new_hidden_with_callback + mov r8, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r5, r0, 4 + add r5, r8 + lsls r5, 2 + ldr r0, =0x02020630 + adds r5, r0 + strh r4, [r5, 0x30] + ldr r0, =gUnknown_0831C688 + mov r9, r0 + lsls r6, 16 + asrs r0, r6, 16 + mov r10, r0 + ldr r0, =0xfff00000 + adds r6, r0 + asrs r6, 16 + lsls r4, r7, 16 + asrs r7, r4, 16 + adds r4, r0 + asrs r4, 16 + mov r0, r9 + adds r1, r6, 0 + adds r2, r4, 0 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + mov r0, r8 + strh r0, [r1, 0x2E] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + adds r0, r1, 0 + bl AnimateObject + mov r0, r9 + mov r1, r10 + adds r2, r4, 0 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + mov r0, r8 + strh r0, [r4, 0x2E] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnim + adds r0, r4, 0 + bl AnimateObject + mov r0, r9 + adds r1, r6, 0 + adds r2, r7, 0 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + mov r0, r8 + strh r0, [r4, 0x2E] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectImageAnim + adds r0, r4, 0 + bl AnimateObject + mov r0, r9 + mov r1, r10 + adds r2, r7, 0 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + mov r0, r8 + strh r0, [r4, 0x2E] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + adds r0, r4, 0 + movs r1, 0x3 + bl StartObjectImageAnim + adds r0, r4, 0 + bl AnimateObject + mov r0, r8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_807521C + + thumb_func_start sub_8075370 +sub_8075370: @ 8075370 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080753A8 + ldr r0, =gUnknown_0831C620 + ldrh r0, [r0, 0x6] + bl FreeObjectTilesByTag + ldr r0, =gUnknown_0831C628 + ldrh r0, [r0, 0x4] + bl FreeObjectPaletteByTag + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080753A4 + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + b _080753A8 + .pool +_080753A4: + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] +_080753A8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8075370 + + thumb_func_start sub_80753B4 +sub_80753B4: @ 80753B4 + push {lr} + adds r3, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080753DE + ldr r2, =0x02020630 + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x2E] + subs r1, 0x1 + strh r1, [r0, 0x2E] + adds r0, r3, 0 + bl RemoveObjectAndFreeTiles +_080753DE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80753B4 + + thumb_func_start sub_80753E8 +sub_80753E8: @ 80753E8 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =0x020244b9 + movs r0, 0x1 + strb r0, [r1] + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r6, =0x02024064 + ldrb r1, [r6] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0] + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0] + ldr r0, =sub_8075450 + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0xA] + strh r5, [r1, 0xC] + ldrb r0, [r6] + strh r0, [r1, 0xE] + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80753E8 + + thumb_func_start sub_8075450 +sub_8075450: @ 8075450 + 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 r10, r0 + movs r0, 0 + str r0, [sp] + ldr r1, =0x03005e00 + mov r2, r10 + lsls r0, r2, 2 + add r0, r10 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0x8] + movs r3, 0x8 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _08075488 + adds r0, r2, 0x1 + strh r0, [r1, 0x8] + b _08075602 + .pool +_08075488: + ldrh r0, [r1, 0xC] + mov r8, r0 + ldrb r5, [r1, 0xE] + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080754B4 + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + b _080754C2 + .pool +_080754B4: + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec +_080754C2: + adds r0, r1 + movs r1, 0x26 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + bl ball_number_to_ball_processing_index + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_8076A78 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + ldr r1, =gUnknown_0832C588 + adds r0, r1 + movs r1, 0x20 + movs r2, 0x50 + movs r3, 0x1D + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, =0x02020630 + mov r9, r2 + lsls r0, r7, 4 + adds r0, r7 + lsls r6, r0, 2 + adds r4, r6, r2 + movs r0, 0x80 + strh r0, [r4, 0x2E] + movs r3, 0 + strh r3, [r4, 0x30] + mov r0, r8 + strh r0, [r4, 0x3C] + mov r2, r8 + cmp r2, 0xFE + beq _08075548 + cmp r2, 0xFF + bne _08075584 + ldr r0, =0x0202420c + strb r5, [r0] + movs r0, 0x18 + strh r0, [r4, 0x20] + movs r0, 0x44 + strh r0, [r4, 0x22] + mov r0, r9 + adds r0, 0x1C + adds r0, r6, r0 + ldr r1, =sub_80761B4 + str r1, [r0] + b _08075592 + .pool +_08075548: + adds r0, r5, 0 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x18 + strh r0, [r4, 0x22] + ldr r0, =0x0202420c + strb r5, [r0] + movs r3, 0 + strh r3, [r4, 0x2E] + mov r0, r9 + adds r0, 0x1C + adds r0, r6, r0 + ldr r1, =sub_8076398 + str r1, [r0] + b _08075592 + .pool +_08075584: + movs r0, 0x1 + bl battle_get_side_with_given_state + ldr r1, =0x0202420c + strb r0, [r1] + movs r0, 0x1 + str r0, [sp] +_08075592: + ldr r0, =0x02020630 + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + adds r4, r1, r0 + ldr r5, =0x0202420c + ldrb r0, [r5] + strh r0, [r4, 0x3A] + ldr r2, [sp] + cmp r2, 0 + bne _080755B8 + mov r0, r10 + bl DestroyTask + b _08075602 + .pool +_080755B8: + movs r0, 0x22 + strh r0, [r4, 0x2E] + ldrb r0, [r5] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x10 + strh r0, [r4, 0x36] + ldr r0, =0x0000ffd8 + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl sub_80A68D4 + mov r3, r10 + strh r3, [r4, 0x6] + ldr r1, =0x03005e00 + mov r2, r10 + lsls r0, r2, 2 + add r0, r10 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r5] + strh r1, [r0, 0x10] + ldr r1, =TaskDummy + str r1, [r0] + movs r0, 0x3D + bl audio_play +_08075602: + 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_8075450 + + thumb_func_start objc_0804ABD4 +objc_0804ABD4: @ 8075620 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r7, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _080756C0 + ldrb r6, [r7, 0x6] + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldrb r5, [r0, 0x10] + ldrb r0, [r0, 0xC] + mov r8, r0 + adds r0, r7, 0 + movs r1, 0x1 + bl StartObjectImageAnim + adds r2, r7, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r7, 0x24] + ldrh r1, [r7, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r7, 0x20] + ldrh r0, [r7, 0x26] + ldrh r2, [r7, 0x22] + adds r0, r2 + strh r0, [r7, 0x22] + strh r1, [r7, 0x24] + strh r1, [r7, 0x26] + strh r1, [r7, 0x38] + adds r0, r5, 0 + bl sub_8076B14 + lsls r0, 16 + lsrs r0, 16 + bl ball_number_to_ball_processing_index + adds r4, r0, 0 + ldrh r0, [r7, 0x20] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r7, 0x22] + subs r1, 0x5 + lsls r1, 24 + lsrs r1, 24 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp] + movs r2, 0x1 + movs r3, 0x1C + bl sub_8171D98 + movs r0, 0 + adds r1, r5, 0 + movs r2, 0xE + adds r3, r4, 0 + bl sub_81729E8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x2E] + strh r5, [r7, 0x3A] + mov r0, r8 + strh r0, [r7, 0x3C] + adds r0, r6, 0 + bl DestroyTask + ldr r0, =sub_80756D4 + str r0, [r7, 0x1C] +_080756C0: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end objc_0804ABD4 + + thumb_func_start sub_80756D4 +sub_80756D4: @ 80756D4 + ldr r1, =sub_80756E0 + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end sub_80756D4 + + thumb_func_start sub_80756E0 +sub_80756E0: @ 80756E0 + push {r4-r7,lr} + adds r6, r0, 0 + ldrh r0, [r6, 0x38] + adds r0, 0x1 + movs r7, 0 + strh r0, [r6, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _0807573A + strh r7, [r6, 0x38] + ldr r0, =sub_807574C + str r0, [r6, 0x1C] + ldr r5, =0x020241e4 + movs r1, 0x3A + ldrsh r0, [r6, r1] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + movs r1, 0x2 + bl StartObjectRotScalAnim + movs r1, 0x3A + ldrsh r0, [r6, r1] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl AnimateObject + movs r1, 0x3A + ldrsh r0, [r6, r1] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r7, [r0, 0x30] +_0807573A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80756E0 + + thumb_func_start sub_807574C +sub_807574C: @ 807574C + push {r4-r6,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + bne _08075764 + movs r0, 0x3C + bl audio_play +_08075764: + ldr r6, =0x02020630 + ldr r5, =0x020241e4 + movs r1, 0x3A + ldrsh r0, [r4, r1] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r6 + adds r0, r1, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _080757BC + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectImageAnim + movs r2, 0x3A + ldrsh r0, [r4, r2] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + movs r0, 0 + strh r0, [r4, 0x38] + ldr r0, =sub_80757E4 + str r0, [r4, 0x1C] + b _080757DC + .pool +_080757BC: + ldrh r0, [r1, 0x30] + adds r0, 0x60 + strh r0, [r1, 0x30] + movs r1, 0x3A + ldrsh r0, [r4, r1] + adds r0, r5 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + movs r2, 0x30 + ldrsh r0, [r1, r2] + negs r0, r0 + asrs r0, 8 + strh r0, [r1, 0x26] +_080757DC: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_807574C + + thumb_func_start sub_80757E4 +sub_80757E4: @ 80757E4 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0807582C + ldrh r0, [r4, 0x38] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _0807582C + strh r1, [r4, 0x34] + movs r0, 0x20 + strh r0, [r4, 0x36] + strh r1, [r4, 0x38] + movs r0, 0 + movs r1, 0x20 + bl cosine + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + movs r0, 0x36 + ldrsh r1, [r4, r0] + movs r0, 0 + bl cosine + negs r0, r0 + strh r0, [r4, 0x26] + ldr r0, =sub_8075838 + str r0, [r4, 0x1C] +_0807582C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80757E4 + + thumb_func_start sub_8075838 +sub_8075838: @ 8075838 + push {r4,r5,lr} + adds r4, r0, 0 + movs r5, 0 + ldrh r0, [r4, 0x34] + movs r1, 0xFF + ands r1, r0 + cmp r1, 0 + beq _0807584E + cmp r1, 0x1 + beq _080758C2 + b _080758EE +_0807584E: + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl cosine + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r1, [r4, 0x38] + adds r1, 0x4 + ldrh r2, [r4, 0x34] + lsls r0, r2, 16 + asrs r0, 24 + adds r1, r0 + strh r1, [r4, 0x38] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x3F + ble _080758EE + ldrh r0, [r4, 0x36] + subs r0, 0xA + strh r0, [r4, 0x36] + ldr r1, =0x00000101 + adds r0, r2, r1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 24 + cmp r0, 0x4 + bne _0807588A + movs r5, 0x1 +_0807588A: + cmp r0, 0x2 + beq _080758AA + cmp r0, 0x2 + bgt _0807589C + cmp r0, 0x1 + beq _080758A2 + b _080758BA + .pool +_0807589C: + cmp r0, 0x3 + beq _080758B2 + b _080758BA +_080758A2: + movs r0, 0x38 + bl audio_play + b _080758EE +_080758AA: + movs r0, 0x39 + bl audio_play + b _080758EE +_080758B2: + movs r0, 0x3A + bl audio_play + b _080758EE +_080758BA: + movs r0, 0x3B + bl audio_play + b _080758EE +_080758C2: + movs r2, 0x38 + ldrsh r0, [r4, r2] + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl cosine + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r1, [r4, 0x38] + subs r1, 0x4 + ldrh r2, [r4, 0x34] + lsls r0, r2, 16 + asrs r0, 24 + subs r1, r0 + strh r1, [r4, 0x38] + lsls r1, 16 + cmp r1, 0 + bgt _080758EE + strh r5, [r4, 0x38] + ldr r0, =0xffffff00 + ands r0, r2 + strh r0, [r4, 0x34] +_080758EE: + cmp r5, 0 + beq _08075926 + movs r5, 0 + strh r5, [r4, 0x34] + movs r0, 0x40 + movs r1, 0x20 + bl cosine + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + strh r5, [r4, 0x26] + movs r2, 0x3C + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0807591C + ldr r0, =sub_8075D14 + str r0, [r4, 0x1C] + b _08075926 + .pool +_0807591C: + ldr r0, =sub_8075930 + str r0, [r4, 0x1C] + movs r0, 0x1 + strh r0, [r4, 0x36] + strh r5, [r4, 0x38] +_08075926: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8075838 + + thumb_func_start sub_8075930 +sub_8075930: @ 8075930 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _08075964 + movs r0, 0 + strh r0, [r4, 0x34] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + ldr r0, =sub_8075970 + str r0, [r4, 0x1C] + movs r0, 0x17 + bl audio_play +_08075964: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8075930 + + thumb_func_start sub_8075970 +sub_8075970: @ 8075970 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x34] + movs r1, 0xFF + ands r1, r0 + cmp r1, 0x4 + bhi _08075A70 + lsls r0, r1, 2 + ldr r1, =_0807598C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807598C: + .4byte _080759A0 + .4byte _080759D2 + .4byte _080759A0 + .4byte _08075A26 + .4byte _08075A70 +_080759A0: + ldrh r0, [r4, 0x36] + ldrh r2, [r4, 0x24] + adds r1, r0, r2 + strh r1, [r4, 0x24] + ldrh r1, [r4, 0x38] + adds r0, r1 + strh r0, [r4, 0x38] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x38] + adds r0, 0x3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bls _08075AB6 + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + movs r0, 0 + strh r0, [r4, 0x38] + b _08075AB6 +_080759D2: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _08075A18 + movs r0, 0 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x36] + negs r0, r0 + strh r0, [r4, 0x36] + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + movs r2, 0x36 + ldrsh r0, [r4, r2] + cmp r0, 0 + bge _08075A0E + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80082B8 + b _08075AB6 +_08075A0E: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80082B8 + b _08075AB6 +_08075A18: + adds r0, r4, 0 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] + b _08075AB6 +_08075A26: + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + ldrh r2, [r4, 0x34] + adds r0, r2 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 24 + movs r2, 0x3C + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _08075A48 + ldr r0, =sub_8075D14 + str r0, [r4, 0x1C] + b _08075AB6 + .pool +_08075A48: + cmp r1, 0x4 + bne _08075A5C + cmp r0, 0x3 + bne _08075A5C + ldr r0, =sub_8075FB4 + str r0, [r4, 0x1C] + b _08075A62 + .pool +_08075A5C: + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] +_08075A62: + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + b _08075AB6 +_08075A70: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _08075AB6 + movs r0, 0 + strh r0, [r4, 0x38] + ldrh r1, [r4, 0x34] + ldr r0, =0xffffff00 + ands r0, r1 + strh r0, [r4, 0x34] + adds r0, r4, 0 + movs r1, 0x3 + bl StartObjectRotScalAnim + movs r1, 0x36 + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _08075AA8 + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectRotScalAnim + b _08075AB0 + .pool +_08075AA8: + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim +_08075AB0: + movs r0, 0x17 + bl audio_play +_08075AB6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8075970 + + thumb_func_start c3_0804B070 +c3_0804B070: @ 8075ABC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r2 + ldrb r1, [r0, 0xC] + mov r12, r1 + ldrb r5, [r0, 0xA] + ldrh r6, [r0, 0x8] + ldrb r3, [r0, 0xE] + mov r8, r3 + ldrb r7, [r0, 0x10] + movs r3, 0x12 + ldrsh r1, [r0, r3] + lsls r3, r1, 16 + ldrh r1, [r0, 0x14] + orrs r3, r1 + movs r1, 0x26 + ldrsh r0, [r0, r1] + cmp r0, 0x20 + bhi _08075B88 + lsls r0, 2 + ldr r1, =_08075B04 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08075B04: + .4byte _08075B88 + .4byte _08075BB4 + .4byte _08075BDA + .4byte _08075C54 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075BF8 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075B88 + .4byte _08075C66 + .4byte _08075C7E + .4byte _08075CA8 +_08075B88: + ldr r0, =0x02020630 + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + adds r1, r0 + adds r1, 0x3F + ldrb r0, [r1] + lsls r0, 26 + cmp r0, 0 + blt _08075B9E + b _08075D04 +_08075B9E: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r2 + mov r1, r12 + adds r1, 0x1 + strh r1, [r0, 0x26] + b _08075D04 + .pool +_08075BB4: + adds r0, r3, 0 + bl sub_805F110 + cmp r0, 0x1 + bne _08075BCC + lsls r1, r5, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0 + bl sub_80A32E4 + b _08075C2E +_08075BCC: + lsls r1, r5, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0xB + bl sub_80A32E4 + b _08075C2E +_08075BDA: + bl sub_80A369C + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x3 + strh r1, [r0, 0x1C] + movs r1, 0x14 + strh r1, [r0, 0x26] + b _08075D04 + .pool +_08075BF8: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r2 + ldrh r2, [r1, 0x1C] + movs r7, 0x1C + ldrsh r0, [r1, r7] + cmp r0, 0 + bne _08075CBA + adds r0, r3, 0 + bl sub_805F110 + cmp r0, 0x1 + bne _08075C22 + lsls r1, r5, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0x1 + bl sub_80A3344 + b _08075C2E +_08075C22: + lsls r1, r5, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0xC + bl sub_80A3344 +_08075C2E: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + mov r2, r8 + lsls r1, r2, 1 + add r1, r8 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x41 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + adds r0, r4, 0 + bl DestroyTask + b _08075D04 + .pool +_08075C54: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r2 + movs r1, 0x6 + strh r1, [r0, 0x1C] + movs r1, 0x1E + strh r1, [r0, 0x26] + b _08075D04 +_08075C66: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r2 + ldrh r2, [r1, 0x1C] + movs r3, 0x1C + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _08075CBA + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] +_08075C7E: + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + bne _08075D04 + bl sub_80A369C + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x3 + strh r0, [r1, 0x1C] + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _08075D04 + .pool +_08075CA8: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r2 + ldrh r2, [r1, 0x1C] + movs r7, 0x1C + ldrsh r0, [r1, r7] + cmp r0, 0 + beq _08075CC0 +_08075CBA: + subs r0, r2, 0x1 + strh r0, [r1, 0x1C] + b _08075D04 +_08075CC0: + adds r0, r3, 0 + bl sub_805F110 + cmp r0, 0x1 + bne _08075CD8 + lsls r1, r5, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0 + bl sub_80A3344 + b _08075CE4 +_08075CD8: + lsls r1, r5, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0xB + bl sub_80A3344 +_08075CE4: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + mov r2, r8 + lsls r1, r2, 1 + add r1, r8 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x1] + movs r0, 0x41 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + adds r0, r4, 0 + bl DestroyTask +_08075D04: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end c3_0804B070 + + thumb_func_start sub_8075D14 +sub_8075D14: @ 8075D14 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r6, r0, 0 + ldrh r0, [r6, 0x3A] + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r6, 0 + movs r1, 0x1 + bl StartObjectImageAnim + adds r0, r5, 0 + bl sub_8076B14 + lsls r0, 16 + lsrs r0, 16 + bl ball_number_to_ball_processing_index + adds r4, r0, 0 + ldrh r0, [r6, 0x20] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x22] + subs r1, 0x5 + lsls r1, 24 + lsrs r1, 24 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp] + movs r2, 0x1 + movs r3, 0x1C + bl sub_8171D98 + ldrh r1, [r6, 0x3A] + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1 + movs r2, 0xE + adds r3, r4, 0 + bl sub_81729E8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x2E] + ldr r0, =sub_8075FD4 + str r0, [r6, 0x1C] + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08075D88 + b _08075EF4 +_08075D88: + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08075DC0 + ldr r0, =0x0202406e + lsls r2, r5, 1 + adds r0, r2, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + adds r7, r1, r0 + movs r4, 0x19 + mov r10, r4 + b _08075DD4 + .pool +_08075DC0: + ldr r0, =0x0202406e + lsls r2, r5, 1 + adds r0, r2, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r7, r1, r0 + movs r0, 0xE7 + mov r10, r0 +_08075DD4: + mov r8, r2 + adds r0, r7, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + movs r0, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + beq _08075E00 + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bne _08075E56 +_08075E00: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08075E56 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x9] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08075E56 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x42 + ands r0, r1 + cmp r0, 0x42 + bne _08075E4C + bl sub_80A38E4 + lsls r0, 24 + cmp r0, 0 + beq _08075E56 + ldr r0, =0x03007420 + bl MPlayStop_rev01 + b _08075E56 + .pool +_08075E4C: + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + bl MPlayVolumeControl +_08075E56: + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08075E70 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x9] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08075E80 +_08075E70: + movs r4, 0 + b _08075EA2 + .pool +_08075E80: + movs r0, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + beq _08075E9C + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bne _08075EA0 +_08075E9C: + movs r4, 0x1 + b _08075EA2 +_08075EA0: + movs r4, 0x2 +_08075EA2: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + mov r2, r8 + adds r1, r2, r5 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + movs r2, 0x40 + orrs r0, r2 + strb r0, [r1, 0x1] + ldr r0, =c3_0804B070 + movs r1, 0x3 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r3, 0 + mov r0, r9 + strh r0, [r1, 0x8] + mov r2, r10 + lsls r0, r2, 24 + asrs r0, 24 + strh r0, [r1, 0xA] + strh r4, [r1, 0xC] + strh r5, [r1, 0xE] + ldr r2, =0x020241e4 + movs r4, 0x3A + ldrsh r0, [r6, r4] + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1, 0x10] + lsrs r0, r7, 16 + strh r0, [r1, 0x12] + strh r7, [r1, 0x14] + strh r3, [r1, 0x26] +_08075EF4: + ldr r4, =0x020241e4 + movs r1, 0x3A + ldrsh r0, [r6, r1] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =0x02020630 + adds r0, r5 + movs r1, 0x1 + bl StartObjectRotScalAnim + ldrh r0, [r6, 0x3A] + lsls r0, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08075F50 + movs r2, 0x3A + ldrsh r0, [r6, r2] + 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_8039B58 + b _08075F66 + .pool +_08075F50: + movs r1, 0x3A + ldrsh r0, [r6, r1] + 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_8039E44 +_08075F66: + str r1, [r0] + ldr r5, =0x020241e4 + movs r2, 0x3A + ldrsh r0, [r6, r2] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl AnimateObject + movs r1, 0x3A + ldrsh r0, [r6, r1] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x80 + lsls r1, 5 + strh r1, [r0, 0x30] + 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_8075D14 + + thumb_func_start sub_8075FB4 +sub_8075FB4: @ 8075FB4 + adds r3, r0, 0 + adds r3, 0x2C + ldrb r1, [r3] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r3] + ldr r1, =sub_80760F8 + str r1, [r0, 0x1C] + movs r1, 0 + strh r1, [r0, 0x34] + strh r1, [r0, 0x36] + strh r1, [r0, 0x38] + bx lr + .pool + thumb_func_end sub_8075FB4 + + thumb_func_start sub_8075FD4 +sub_8075FD4: @ 8075FD4 + push {r4-r7,lr} + adds r5, r0, 0 + movs r7, 0 + ldrh r0, [r5, 0x3A] + lsls r0, 24 + lsrs r6, r0, 24 + ldr r4, =0x02020630 + ldr r0, =0x020241e4 + adds r3, r6, r0 + ldrb r1, [r3] + 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] + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08076016 + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_08076016: + ldrb r0, [r3] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + adds r0, r1, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _08076040 + adds r0, r1, 0 + movs r1, 0 + bl StartObjectRotScalAnim + movs r7, 0x1 + b _0807605C + .pool +_08076040: + ldr r2, =0xfffffee0 + adds r0, r2, 0 + ldrh r2, [r1, 0x30] + adds r0, r2 + strh r0, [r1, 0x30] + ldrb r0, [r3] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 24 + strh r0, [r1, 0x26] +_0807605C: + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080760DE + cmp r7, 0 + beq _080760DE + ldr r2, =0x02020630 + ldr r0, =0x020241e4 + adds r0, r6, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r2, 0 + movs r1, 0 + strh r1, [r0, 0x26] + ldr r0, =0x020244b9 + strb r2, [r0] + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r0, [r0, 0x4] + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + adds r0, r5, 0 + bl obj_free_rotscale_entry + adds r0, r5, 0 + bl RemoveObjectAndFreeTiles + movs r3, 0 + ldr r0, [r4] + ldr r2, [r0, 0x4] + movs r5, 0x8 + movs r4, 0x3 +_080760B6: + ldrb r1, [r2] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _080760C2 + adds r3, 0x1 +_080760C2: + adds r2, 0xC + subs r4, 0x1 + cmp r4, 0 + bge _080760B6 + cmp r3, 0x4 + bne _080760DE + movs r4, 0 +_080760D0: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8076AE8 + adds r4, 0x1 + cmp r4, 0xB + ble _080760D0 +_080760DE: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8075FD4 + + thumb_func_start sub_80760F8 +sub_80760F8: @ 80760F8 + push {r4-r7,lr} + adds r6, r0, 0 + ldrh r0, [r6, 0x3A] + lsls r0, 24 + lsrs r7, r0, 24 + ldrh r0, [r6, 0x36] + adds r0, 0x1 + strh r0, [r6, 0x36] + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0x28 + beq _08076196 + cmp r1, 0x5F + bne _08076130 + ldr r0, =0x020244b9 + movs r1, 0 + strb r1, [r0] + bl m4aMPlayAllStop + ldr r0, =0x00000173 + bl audio_play + b _08076196 + .pool +_08076130: + ldr r0, =0x0000013b + cmp r1, r0 + bne _08076196 + ldr r5, =0x02020630 + ldr r4, =0x020241e4 + movs r1, 0x3A + ldrsh r0, [r6, r1] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + movs r1, 0x3A + ldrsh r0, [r6, r1] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + adds r0, r6, 0 + bl RemoveObjectAndFreeResources + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08076196 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + lsls r1, r7, 1 + adds r1, r7 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x9 + negs r0, r0 + ands r0, r2 + strb r0, [r1] +_08076196: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80760F8 + + thumb_func_start sub_80761B4 +sub_80761B4: @ 80761B4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x19 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x18 + strh r0, [r4, 0x36] + ldr r0, =0x0000ffe2 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x3A] + strh r0, [r4, 0x6] + adds r0, r4, 0 + bl sub_80A68D4 + ldr r0, =sub_8076204 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80761B4 + + thumb_func_start sub_8076204 +sub_8076204: @ 8076204 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + ldrh r0, [r5, 0x3C] + movs r1, 0xFF + mov r8, r1 + lsrs r0, 8 + subs r0, 0x23 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2C + bhi _080762F8 + ldrh r1, [r5, 0x6] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + bne _08076266 + ldrh r0, [r5, 0x30] + movs r1, 0x1 + adds r6, r1, 0 + ands r6, r0 + ldrh r0, [r5, 0x32] + adds r7, r1, 0 + ands r7, r0 + movs r2, 0x30 + ldrsh r0, [r5, r2] + movs r1, 0x3 + bl __divsi3 + movs r1, 0x2 + negs r1, r1 + adds r4, r1, 0 + ands r0, r4 + orrs r6, r0 + strh r6, [r5, 0x30] + movs r2, 0x32 + ldrsh r0, [r5, r2] + movs r1, 0x3 + bl __divsi3 + ands r0, r4 + orrs r7, r0 + strh r7, [r5, 0x32] + adds r0, r5, 0 + movs r1, 0x4 + bl StartObjectRotScalAnim +_08076266: + ldrh r4, [r5, 0x2E] + adds r0, r5, 0 + bl sub_80A6F3C + movs r1, 0x3A + ldrsh r0, [r5, r1] + movs r1, 0x3 + bl __divsi3 + adds r1, r0, 0 + ldrh r0, [r5, 0x3C] + adds r0, r1 + strh r0, [r5, 0x3C] + lsls r0, 16 + asrs r0, 24 + mov r2, r8 + ands r0, r2 + movs r2, 0x38 + ldrsh r1, [r5, r2] + bl sine + ldrh r1, [r5, 0x26] + adds r0, r1 + strh r0, [r5, 0x26] + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + ldrh r1, [r5, 0x6] + adds r0, r1 + strh r0, [r5, 0x6] + lsls r0, 16 + lsrs r0, 24 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + beq _080762B6 + strh r4, [r5, 0x2E] + b _080762BE +_080762B6: + lsls r0, r4, 16 + asrs r0, 16 + subs r0, 0x1 + strh r0, [r5, 0x2E] +_080762BE: + ldrh r0, [r5, 0x3C] + lsrs r0, 8 + cmp r0, 0x4F + ble _08076364 + ldrh r0, [r5, 0x30] + movs r1, 0x1 + adds r6, r1, 0 + ands r6, r0 + ldrh r0, [r5, 0x32] + adds r7, r1, 0 + ands r7, r0 + movs r2, 0x30 + ldrsh r1, [r5, r2] + lsls r0, r1, 1 + adds r0, r1 + movs r1, 0x2 + negs r1, r1 + adds r2, r1, 0 + ands r0, r2 + orrs r0, r6 + strh r0, [r5, 0x30] + movs r0, 0x32 + ldrsh r1, [r5, r0] + lsls r0, r1, 1 + adds r0, r1 + ands r0, r2 + orrs r0, r7 + strh r0, [r5, 0x32] + b _08076364 +_080762F8: + adds r0, r5, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _08076364 + ldrh r0, [r5, 0x24] + ldrh r1, [r5, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r5, 0x20] + ldrh r0, [r5, 0x26] + ldrh r2, [r5, 0x22] + adds r0, r2 + strh r0, [r5, 0x22] + strh r1, [r5, 0x26] + strh r1, [r5, 0x24] + ldrb r0, [r5, 0x6] + strh r0, [r5, 0x3A] + strh r1, [r5, 0x2E] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _08076358 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x9] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08076358 + movs r0, 0x3A + ldrsh r4, [r5, r0] + movs r0, 0x2 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _08076358 + ldr r0, =sub_8076374 + b _0807635A + .pool +_08076358: + ldr r0, =sub_8075D14 +_0807635A: + str r0, [r5, 0x1C] + adds r0, r5, 0 + movs r1, 0 + bl StartObjectRotScalAnim +_08076364: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8076204 + + thumb_func_start sub_8076374 +sub_8076374: @ 8076374 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + adds r1, r0, 0x1 + strh r1, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x18 + ble _0807638E + movs r0, 0 + strh r0, [r2, 0x2E] + ldr r0, =sub_8075D14 + str r0, [r2, 0x1C] +_0807638E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8076374 + + thumb_func_start sub_8076398 +sub_8076398: @ 8076398 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + ble _080763EC + movs r0, 0 + strh r0, [r5, 0x2E] + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _080763E8 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x9] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080763E8 + movs r0, 0x3A + ldrsh r4, [r5, r0] + movs r0, 0x3 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _080763E8 + ldr r0, =sub_8076374 + b _080763EA + .pool +_080763E8: + ldr r0, =sub_8075D14 +_080763EA: + str r0, [r5, 0x1C] +_080763EC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8076398 + + thumb_func_start sub_80763F8 +sub_80763F8: @ 80763F8 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + movs r4, 0 + str r4, [sp] + bl sub_8171D98 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80763F8 + + thumb_func_start sub_8076420 +sub_8076420: @ 8076420 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r3, 0 + bl sub_81729E8 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8076420 + + thumb_func_start sub_8076438 +sub_8076438: @ 8076438 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r5, r0, 0 + mov r9, r2 + mov r10, r3 + ldr r6, [sp, 0x28] + ldr r4, [sp, 0x2C] + ldr r0, [sp, 0x30] + ldr r2, [sp, 0x38] + lsls r5, 24 + lsrs r5, 24 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r3, 24 + lsrs r3, 24 + mov r10, r3 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + lsls r0, r2, 16 + lsrs r7, r0, 16 + ldr r0, =gUnknown_0832C400 + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_0832C460 + bl LoadCompressedObjectPaletteUsingHeap + ldr r0, =gUnknown_0832C588 + mov r1, r9 + mov r2, r10 + adds r3, r4, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02020630 + mov r8, r1 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r2, r4, r1 + strh r5, [r2, 0x2E] + lsls r1, r5, 4 + adds r1, r5 + lsls r1, 2 + add r1, r8 + ldrh r0, [r1, 0x20] + strh r0, [r2, 0x38] + ldrh r0, [r1, 0x22] + strh r0, [r2, 0x3A] + mov r3, r9 + strh r3, [r1, 0x20] + mov r0, r10 + strh r0, [r1, 0x22] + strh r7, [r1, 0x3C] + mov r3, sp + ldrh r3, [r3, 0x4] + strh r3, [r2, 0x30] + mov r0, sp + ldrh r0, [r0] + strh r0, [r2, 0x32] + mov r3, sp + ldrh r3, [r3, 0x34] + strh r3, [r2, 0x34] + ldr r3, [sp, 0x34] + lsrs r0, r3, 16 + strh r0, [r2, 0x36] + movs r0, 0x3 + ands r6, r0 + lsls r6, 2 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + orrs r0, r6 + strb r0, [r2, 0x5] + movs r0, 0x1C + add r8, r0 + add r4, r8 + ldr r0, =sub_8076524 + str r0, [r4] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + 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_8076438 + + thumb_func_start sub_8076524 +sub_8076524: @ 8076524 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + ldrh r1, [r6, 0x30] + movs r2, 0x30 + ldrsh r0, [r6, r2] + cmp r0, 0 + bne _080765D0 + ldrh r0, [r6, 0x2E] + lsls r0, 24 + lsrs r7, r0, 24 + ldrh r0, [r6, 0x32] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrh r4, [r6, 0x34] + ldrh r0, [r6, 0x36] + lsls r0, 16 + orrs r4, r0 + adds r0, r6, 0 + adds r0, 0x43 + ldrb r0, [r0] + cmp r0, 0 + beq _0807655E + subs r0, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + b _08076560 +_0807655E: + movs r5, 0 +_08076560: + adds r0, r6, 0 + movs r1, 0x1 + bl StartObjectImageAnim + ldrh r0, [r6, 0x20] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x22] + subs r1, 0x5 + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r6, 0x5] + lsls r2, 28 + lsrs r2, 30 + adds r3, r5, 0 + bl sub_80763F8 + movs r0, 0x1 + mov r1, r8 + adds r2, r4, 0 + bl sub_8076420 + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r6, 0x30] + ldr r0, =sub_80765E0 + str r0, [r6, 0x1C] + ldr r0, =0x02020630 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + adds r4, r0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + adds r0, r4, 0 + bl AnimateObject + movs r0, 0x80 + lsls r0, 5 + strh r0, [r4, 0x30] + strh r5, [r6, 0x3C] + b _080765D4 + .pool +_080765D0: + subs r0, r1, 0x1 + strh r0, [r6, 0x30] +_080765D4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8076524 + + thumb_func_start sub_80765E0 +sub_80765E0: @ 80765E0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r4, r0, 0 + movs r0, 0 + mov r12, r0 + movs r7, 0 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08076610 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_08076610: + ldr r1, =0x02020630 + lsls r2, r6, 4 + adds r0, r2, r6 + lsls r0, 2 + adds r5, r0, r1 + adds r0, r5, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + mov r8, r2 + cmp r0, 0 + bge _08076634 + adds r0, r5, 0 + movs r1, 0 + bl StartObjectRotScalAnim + movs r1, 0x1 + mov r12, r1 +_08076634: + movs r2, 0x38 + ldrsh r0, [r4, r2] + movs r3, 0x20 + ldrsh r1, [r4, r3] + subs r0, r1 + movs r1, 0x3C + ldrsh r2, [r4, r1] + muls r0, r2 + cmp r0, 0 + bge _0807664A + adds r0, 0x7F +_0807664A: + asrs r0, 7 + ldrh r3, [r4, 0x20] + adds r0, r3 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + movs r1, 0x3A + ldrsh r0, [r4, r1] + movs r3, 0x22 + ldrsh r1, [r4, r3] + subs r0, r1 + muls r0, r2 + cmp r0, 0 + bge _08076668 + adds r0, 0x7F +_08076668: + asrs r0, 7 + ldrh r1, [r4, 0x22] + adds r0, r1 + mov r2, r9 + strh r2, [r5, 0x20] + strh r0, [r5, 0x22] + ldrh r2, [r4, 0x3C] + movs r3, 0x3C + ldrsh r0, [r4, r3] + cmp r0, 0x7F + bgt _080766AC + ldr r1, =gUnknown_08329F40 + lsls r0, r2, 24 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _08076690 + adds r0, 0x7 +_08076690: + asrs r0, 3 + negs r0, r0 + lsls r0, 16 + lsrs r0, 16 + adds r1, r2, 0x4 + strh r1, [r4, 0x3C] + strh r0, [r5, 0x24] + strh r0, [r5, 0x26] + b _080766BA + .pool +_080766AC: + ldrh r0, [r4, 0x38] + strh r0, [r5, 0x20] + ldrh r0, [r4, 0x3A] + strh r0, [r5, 0x22] + strh r7, [r5, 0x24] + strh r7, [r5, 0x26] + movs r7, 0x1 +_080766BA: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0807670E + mov r2, r12 + cmp r2, 0 + beq _0807670E + cmp r7, 0 + beq _0807670E + ldr r1, =0x02020630 + mov r3, r8 + adds r0, r3, r6 + lsls r0, 2 + adds r2, r0, r1 + movs r0, 0x3C + ldrsh r1, [r2, r0] + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + bne _080766FC + ldrh r1, [r2, 0x3C] + adds r0, r2, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_806ED40 + b _08076708 + .pool +_080766FC: + ldrh r1, [r2, 0x3C] + adds r0, r2, 0 + movs r2, 0 + movs r3, 0 + bl sub_806ED40 +_08076708: + adds r0, r4, 0 + bl RemoveObjectAndFreeResources +_0807670E: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80765E0 + + thumb_func_start sub_807671C +sub_807671C: @ 807671C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r0 + adds r6, r2, 0 + mov r8, r3 + ldr r5, [sp, 0x20] + ldr r4, [sp, 0x24] + ldr r0, [sp, 0x28] + mov r9, r0 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r6, 24 + lsrs r6, 24 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r5, 24 + lsrs r5, 24 + lsls r4, 24 + lsrs r4, 24 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r0, =gUnknown_0832C400 + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_0832C460 + bl LoadCompressedObjectPaletteUsingHeap + ldr r0, =gUnknown_0832C588 + adds r1, r6, 0 + mov r2, r8 + adds r3, r4, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r6, =0x02020630 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r2, r3, r6 + mov r1, r10 + strh r1, [r2, 0x2E] + mov r4, r9 + strh r4, [r2, 0x30] + strh r7, [r2, 0x32] + mov r1, sp + ldrh r1, [r1, 0x2C] + strh r1, [r2, 0x34] + ldr r4, [sp, 0x2C] + lsrs r1, r4, 16 + strh r1, [r2, 0x36] + movs r1, 0x3 + ands r5, r1 + lsls r5, 2 + ldrb r4, [r2, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r4 + orrs r1, r5 + strb r1, [r2, 0x5] + adds r6, 0x1C + adds r3, r6 + ldr r1, =sub_80767D4 + str r1, [r3] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_807671C + + thumb_func_start sub_80767D4 +sub_80767D4: @ 80767D4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0807686C + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r7, r0, 24 + ldrh r0, [r4, 0x32] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrh r5, [r4, 0x34] + ldrh r0, [r4, 0x36] + lsls r0, 16 + orrs r5, r0 + adds r0, r4, 0 + adds r0, 0x43 + ldrb r0, [r0] + cmp r0, 0 + beq _0807680E + subs r0, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + b _08076810 +_0807680E: + movs r6, 0 +_08076810: + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnim + ldrh r0, [r4, 0x20] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x22] + subs r1, 0x5 + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r4, 0x5] + lsls r2, 28 + lsrs r2, 30 + adds r3, r6, 0 + bl sub_80763F8 + movs r0, 0x1 + mov r1, r8 + adds r2, r5, 0 + bl sub_8076420 + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r4, 0x30] + ldr r0, =sub_807687C + str r0, [r4, 0x1C] + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectRotScalAnim + adds r0, r4, 0 + bl AnimateObject + strh r5, [r4, 0x30] + b _08076870 + .pool +_0807686C: + subs r0, r1, 0x1 + strh r0, [r4, 0x30] +_08076870: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80767D4 + + thumb_func_start sub_807687C +sub_807687C: @ 807687C + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x38] + adds r0, 0x1 + strh r0, [r5, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + bne _08076894 + movs r0, 0x3C + bl audio_play +_08076894: + ldrh r1, [r5, 0x2E] + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r2 + adds r0, r4, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _080768D8 + adds r0, r5, 0 + movs r1, 0x2 + bl StartObjectImageAnim + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + movs r0, 0 + strh r0, [r5, 0x38] + ldr r0, =sub_80768F0 + str r0, [r5, 0x1C] + b _080768E8 + .pool +_080768D8: + ldrh r0, [r4, 0x30] + adds r0, 0x60 + strh r0, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + negs r0, r0 + asrs r0, 8 + strh r0, [r4, 0x26] +_080768E8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_807687C + + thumb_func_start sub_80768F0 +sub_80768F0: @ 80768F0 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08076904 + ldr r0, =DummyObjectCallback + str r0, [r2, 0x1C] +_08076904: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80768F0 + + thumb_func_start obj_delete_and_free_associated_resources_ +obj_delete_and_free_associated_resources_: @ 807690C + push {lr} + bl RemoveObjectAndFreeResources + pop {r0} + bx r0 + thumb_func_end obj_delete_and_free_associated_resources_ + + thumb_func_start sub_8076918 +sub_8076918: @ 8076918 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r0, =0x03005d70 + adds r0, r5, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r6, =0x02020630 + adds r4, r0, r6 + movs r1, 0 + movs r0, 0x5 + strh r0, [r4, 0x2E] + strh r1, [r4, 0x30] + movs r0, 0x73 + strh r0, [r4, 0x24] + strh r1, [r4, 0x26] + ldr r0, =sub_80769CC + str r0, [r4, 0x1C] + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08076966 + ldrh r0, [r4, 0x2E] + negs r0, r0 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x30] + negs r0, r0 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x24] + negs r0, r0 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x26] + negs r0, r0 + strh r0, [r4, 0x26] +_08076966: + movs r0, 0x38 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r6, 0 + adds r1, 0x1C + adds r1, r0, r1 + adds r0, r6 + ldr r1, [r1] + bl _call_via_r1 + adds r0, r5, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08076990 + ldr r0, =sub_80769A8 + str r0, [r4, 0x1C] +_08076990: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8076918 + + thumb_func_start sub_80769A8 +sub_80769A8: @ 80769A8 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x30] + adds r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + bne _080769C2 + movs r0, 0 + strh r0, [r1, 0x30] + ldr r0, =sub_80769CC + str r0, [r1, 0x1C] +_080769C2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80769A8 + + thumb_func_start sub_80769CC +sub_80769CC: @ 80769CC + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x24] + ldrh r1, [r2, 0x2E] + subs r0, r1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x26] + ldrh r1, [r2, 0x30] + subs r0, r1 + strh r0, [r2, 0x26] + ldr r0, [r2, 0x24] + cmp r0, 0 + bne _080769EA + ldr r0, =DummyObjectCallback + str r0, [r2, 0x1C] +_080769EA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80769CC + + thumb_func_start sub_80769F4 +sub_80769F4: @ 80769F4 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =oamc_804BEB4 + adds r0, r5, 0 + bl object_new_hidden_with_callback + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r3, r1, r2 + movs r0, 0x1 + strh r0, [r3, 0x2E] + ldr r0, =0x03005d70 + adds r4, r0 + ldrb r0, [r4] + strh r0, [r3, 0x30] + adds r2, 0x1C + adds r1, r2 + str r5, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80769F4 + + thumb_func_start oamc_804BEB4 +oamc_804BEB4: @ 8076A38 + push {lr} + adds r3, r0, 0 + ldrh r1, [r3, 0x30] + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + ldrh r0, [r3, 0x2E] + movs r2, 0 + strh r0, [r1, 0x26] + ldrh r0, [r3, 0x2E] + negs r0, r0 + strh r0, [r3, 0x2E] + ldrh r0, [r3, 0x32] + adds r0, 0x1 + strh r0, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x15 + bne _08076A70 + strh r2, [r1, 0x24] + strh r2, [r1, 0x26] + adds r0, r3, 0 + bl RemoveObjectAndFreeTiles +_08076A70: + pop {r0} + bx r0 + .pool + thumb_func_end oamc_804BEB4 + + thumb_func_start sub_8076A78 +sub_8076A78: @ 8076A78 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_0832C400 + lsls r6, r4, 3 + adds r5, r6, r0 + ldrh r0, [r5, 0x6] + bl GetObjectTileRangeStartByTag + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + bne _08076AA0 + adds r0, r5, 0 + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_0832C460 + adds r0, r6, r0 + bl LoadCompressedObjectPaletteUsingHeap +_08076AA0: + cmp r4, 0x6 + beq _08076ACC + cmp r4, 0x6 + blt _08076AB0 + cmp r4, 0xB + bgt _08076AB0 + cmp r4, 0xA + bge _08076ACC +_08076AB0: + ldr r1, =gUnknown_0832C400 + lsls r0, r4, 3 + adds r0, r1 + ldrh r0, [r0, 0x6] + bl GetObjectTileRangeStartByTag + adds r1, r0, 0 + lsls r1, 16 + ldr r0, =gUnknown_08C02300 + lsrs r1, 11 + ldr r2, =0x06010100 + adds r1, r2 + bl LZDecompressVram +_08076ACC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8076A78 + + thumb_func_start sub_8076AE8 +sub_8076AE8: @ 8076AE8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + ldr r0, =gUnknown_0832C400 + lsrs r4, 21 + adds r0, r4, r0 + ldrh r0, [r0, 0x6] + bl FreeObjectTilesByTag + ldr r0, =gUnknown_0832C460 + adds r4, r0 + ldrh r0, [r4, 0x4] + bl FreeObjectPaletteByTag + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8076AE8 + + thumb_func_start sub_8076B14 +sub_8076B14: @ 8076B14 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08076B40 + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + b _08076B4E + .pool +_08076B40: + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec +_08076B4E: + adds r0, r1 + movs r1, 0x26 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8076B14 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_809BEDC.s b/asm/rom_809BEDC.s new file mode 100644 index 000000000..b96485a78 --- /dev/null +++ b/asm/rom_809BEDC.s @@ -0,0 +1,2854 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_809BEDC +sub_809BEDC: @ 809BEDC + push {r4,r5,lr} + movs r1, 0x2 + negs r1, r1 + movs r3, 0x3 + negs r3, r3 + movs r4, 0x5 + negs r4, r4 + movs r5, 0x9 + negs r5, r5 + movs r2, 0 + strb r2, [r0] + ldrb r2, [r0, 0x1] + ands r1, r2 + ands r1, r3 + ands r1, r4 + ands r1, r5 + strb r1, [r0, 0x1] + movs r1, 0 + strb r1, [r0, 0x2] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_809BEDC + + thumb_func_start process_overworld_input +@ void process_overworld_input(overworld_input_data *input_data, char buttons_new, char buttons_held) +process_overworld_input: @ 809BF08 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r4, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + ldr r0, =0x02037590 + ldrb r6, [r0, 0x3] + ldrb r0, [r0, 0x2] + mov r9, r0 + bl cur_mapdata_block_role_at_player_pos + lsls r0, 24 + lsrs r0, 24 + bl sub_808904C + lsls r0, 24 + lsrs r7, r0, 24 + cmp r6, 0x2 + bne _0809BF3C + cmp r7, 0 + beq _0809BF40 +_0809BF3C: + cmp r6, 0 + bne _0809BFA2 +_0809BF40: + bl sub_811A138 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + beq _0809BF8C + movs r0, 0x8 + ands r0, r5 + cmp r0, 0 + beq _0809BF5C + ldrb r0, [r4] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] +_0809BF5C: + movs r0, 0x4 + ands r0, r5 + cmp r0, 0 + beq _0809BF6C + ldrb r0, [r4] + movs r1, 0x8 + orrs r0, r1 + strb r0, [r4] +_0809BF6C: + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + beq _0809BF7C + ldrb r0, [r4] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4] +_0809BF7C: + movs r0, 0x2 + ands r0, r5 + cmp r0, 0 + beq _0809BF8C + ldrb r0, [r4] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r4] +_0809BF8C: + movs r0, 0xF0 + mov r1, r8 + ands r0, r1 + cmp r0, 0 + beq _0809BFA2 + ldrb r0, [r4] + movs r1, 0x10 + orrs r0, r1 + movs r1, 0x20 + orrs r0, r1 + strb r0, [r4] +_0809BFA2: + cmp r7, 0 + bne _0809BFC8 + cmp r6, 0x2 + bne _0809BFB8 + mov r0, r9 + cmp r0, 0x2 + bne _0809BFB8 + ldrb r0, [r4] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r4] +_0809BFB8: + cmp r7, 0 + bne _0809BFC8 + cmp r6, 0x2 + bne _0809BFC8 + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] +_0809BFC8: + movs r0, 0x40 + mov r1, r8 + ands r0, r1 + cmp r0, 0 + beq _0809BFDC + movs r0, 0x2 + b _0809C004 + .pool +_0809BFDC: + movs r0, 0x80 + mov r1, r8 + ands r0, r1 + cmp r0, 0 + beq _0809BFEA + movs r0, 0x1 + b _0809C004 +_0809BFEA: + movs r0, 0x20 + mov r1, r8 + ands r0, r1 + cmp r0, 0 + beq _0809BFF8 + movs r0, 0x3 + b _0809C004 +_0809BFF8: + movs r0, 0x10 + mov r1, r8 + ands r0, r1 + cmp r0, 0 + beq _0809C006 + movs r0, 0x4 +_0809C004: + strb r0, [r4, 0x2] +_0809C006: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end process_overworld_input + + thumb_func_start sub_809C014 +@ int sub_809C014(overworld_input_data *input_data) +sub_809C014: @ 809C014 + push {r4-r6,lr} + sub sp, 0x8 + adds r5, r0, 0 + ldr r0, =0x020375f2 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x03005df0 + strb r1, [r0] + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r6, r0, 24 + mov r4, sp + mov r0, sp + bl player_get_pos_to_and_height + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 16 + lsrs r4, r0, 16 + bl CheckForTrainersWantingBattle + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C14E + bl mapheader_run_first_tag2_script_list_match + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C14E + ldrb r1, [r5] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809C070 + bl sub_809C89C + cmp r0, 0x1 + beq _0809C14E +_0809C070: + ldrb r1, [r5] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0809C096 + movs r0, 0x5 + bl sav12_xor_increment + bl increment_var_x4026_on_birth_island_modulo_100 + mov r0, sp + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_809C8DC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C14E +_0809C096: + ldrb r1, [r5] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809C0AE + adds r0, r4, 0 + bl is_it_battle_time_3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C14E +_0809C0AE: + ldrb r1, [r5] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0809C0D0 + ldrb r0, [r5, 0x2] + cmp r0, r6 + bne _0809C0D0 + mov r0, sp + adds r1, r4, 0 + adds r2, r6, 0 + bl mapheader_run_first_tag2_script_list_match_conditionally + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C14E +_0809C0D0: + mov r4, sp + mov r0, sp + bl player_get_next_pos_and_height + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 16 + lsrs r4, r0, 16 + ldrb r1, [r5] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0809C106 + mov r0, sp + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_809C1FC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C14E +_0809C106: + ldrb r1, [r5] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0809C128 + ldrb r0, [r5, 0x2] + cmp r0, r6 + bne _0809C128 + mov r0, sp + adds r1, r4, 0 + adds r2, r6, 0 + bl map_warp_consider_2_to_inside + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C14E +_0809C128: + ldrb r1, [r5] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0809C13A + bl sub_809C868 + cmp r0, 0x1 + beq _0809C14E +_0809C13A: + ldrb r1, [r5] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0809C15C + movs r0, 0x6 + bl audio_play + bl sub_809FA9C +_0809C14E: + movs r0, 0x1 + b _0809C172 + .pool +_0809C15C: + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0809C170 + bl UseRegisteredKeyItemOnField + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C14E +_0809C170: + movs r0, 0 +_0809C172: + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_809C014 + + thumb_func_start player_get_pos_to_and_height +player_get_pos_to_and_height: @ 809C17C + push {r4,lr} + adds r4, r0, 0 + adds r1, r4, 0x2 + bl PlayerGetDestCoords + bl PlayerGetZCoord + strb r0, [r4, 0x4] + pop {r4} + pop {r0} + bx r0 + thumb_func_end player_get_pos_to_and_height + + thumb_func_start player_get_next_pos_and_height +player_get_next_pos_and_height: @ 809C194 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r1, r5, 0x2 + bl GetXYCoordsOneStepInFrontOfPlayer + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetZCoordAt + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _0809C1C6 + bl PlayerGetZCoord +_0809C1C6: + strb r0, [r5, 0x4] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end player_get_next_pos_and_height + + thumb_func_start cur_mapdata_block_role_at_player_pos +cur_mapdata_block_role_at_player_pos: @ 809C1D0 + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 16 + lsrs r0, 16 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end cur_mapdata_block_role_at_player_pos + + thumb_func_start sub_809C1FC +sub_809C1FC: @ 809C1FC + push {r4,lr} + lsls r2, 24 + lsrs r2, 24 + lsls r1, 24 + lsrs r1, 24 + bl TryGetScriptOnPressingA + adds r4, r0, 0 + cmp r4, 0 + bne _0809C214 + movs r0, 0 + b _0809C24C +_0809C214: + ldr r0, =gUnknown_081F860D + cmp r4, r0 + beq _0809C244 + ldr r0, =gUnknown_081F9553 + cmp r4, r0 + beq _0809C244 + ldr r0, =gUnknown_0823B4BB + cmp r4, r0 + beq _0809C244 + ldr r0, =gUnknown_0823B589 + cmp r4, r0 + beq _0809C244 + ldr r0, =gUnknown_082766A2 + cmp r4, r0 + beq _0809C244 + ldr r0, =gUnknown_082766A6 + cmp r4, r0 + beq _0809C244 + ldr r0, =gUnknown_08271D92 + cmp r4, r0 + beq _0809C244 + movs r0, 0x5 + bl audio_play +_0809C244: + adds r0, r4, 0 + bl script_env_1_execute_new_script + movs r0, 0x1 +_0809C24C: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809C1FC + + thumb_func_start TryGetScriptOnPressingA +TryGetScriptOnPressingA: @ 809C270 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + mov r8, r5 + lsls r2, 24 + lsrs r4, r2, 24 + adds r7, r4, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl TryGetMapObjectScript + cmp r0, 0 + bne _0809C2BC + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl TryGetInvisibleMapObjectScript + cmp r0, 0 + bne _0809C2BC + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl TryGetMetatileBehaviorScript + cmp r0, 0 + bne _0809C2BC + adds r0, r6, 0 + mov r1, r8 + adds r2, r7, 0 + bl TryGetFieldMoveScript + cmp r0, 0 + bne _0809C2BC + movs r0, 0 +_0809C2BC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end TryGetScriptOnPressingA + + thumb_func_start sub_809C2C8 +sub_809C2C8: @ 809C2C8 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r2, 24 + lsrs r6, r2, 24 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsCounter + lsls r0, 24 + cmp r0, 0 + bne _0809C2F0 + ldrh r0, [r4] + ldrh r1, [r4, 0x2] + b _0809C30E +_0809C2F0: + ldr r1, =gUnknown_08339D64 + lsls r2, r6, 3 + adds r0, r2, r1 + ldr r3, [r0] + ldrh r0, [r4] + adds r0, r3 + lsls r0, 16 + lsrs r0, 16 + adds r1, 0x4 + adds r2, r1 + ldr r2, [r2] + ldrh r1, [r4, 0x2] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 +_0809C30E: + ldrb r2, [r4, 0x4] + bl GetFieldObjectIdByXYZ + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x10 + beq _0809C32E + ldr r1, =0x02037350 + lsls r2, r3, 3 + adds r0, r2, r3 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x8] + adds r5, r1, 0 + cmp r0, 0xFF + bne _0809C33C +_0809C32E: + movs r0, 0 + b _0809C36E + .pool +_0809C33C: + movs r4, 0 + ldr r1, =0x02032308 +_0809C340: + ldrb r0, [r1] + cmp r0, 0x1 + bne _0809C34C + ldrb r0, [r1, 0x2] + cmp r0, r3 + beq _0809C32E +_0809C34C: + adds r1, 0x4 + adds r4, 0x1 + cmp r4, 0x3 + ble _0809C340 + ldr r0, =0x03005df0 + strb r3, [r0] + ldr r1, =0x020375f2 + adds r0, r2, r3 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0, 0x8] + strh r0, [r1] + ldr r0, =0x020375f4 + strh r6, [r0] + adds r0, r3, 0 + bl GetFieldObjectScriptPointerByFieldObjectId +_0809C36E: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809C2C8 + + thumb_func_start TryGetMapObjectScript +TryGetMapObjectScript: @ 809C384 + push {r4-r7,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r7, r2, 24 + ldrh r0, [r5] + ldrh r1, [r5, 0x2] + ldrb r2, [r5, 0x4] + bl GetFieldObjectIdByXYZ + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x10 + beq _0809C3B4 + ldr r1, =0x02037350 + lsls r2, r4, 3 + adds r0, r2, r4 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x8] + adds r3, r1, 0 + cmp r0, 0xFF + bne _0809C40C +_0809C3B4: + adds r0, r6, 0 + bl MetatileBehavior_IsCounter + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C400 + ldr r1, =gUnknown_08339D64 + lsls r2, r7, 3 + adds r0, r2, r1 + ldr r3, [r0] + ldrh r0, [r5] + adds r0, r3 + lsls r0, 16 + lsrs r0, 16 + adds r1, 0x4 + adds r2, r1 + ldr r2, [r2] + ldrh r1, [r5, 0x2] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + ldrb r2, [r5, 0x4] + bl GetFieldObjectIdByXYZ + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x10 + beq _0809C400 + ldr r1, =0x02037350 + lsls r2, r4, 3 + adds r0, r2, r4 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x8] + adds r3, r1, 0 + cmp r0, 0xFF + bne _0809C40C +_0809C400: + movs r0, 0 + b _0809C44E + .pool +_0809C40C: + ldr r0, =0x03005df0 + strb r4, [r0] + ldr r1, =0x020375f2 + adds r0, r2, r4 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x8] + strh r0, [r1] + ldr r0, =0x020375f4 + strh r7, [r0] + bl InTrainerHill + cmp r0, 0x1 + bne _0809C43C + bl sub_81D62AC + b _0809C442 + .pool +_0809C43C: + adds r0, r4, 0 + bl GetFieldObjectScriptPointerByFieldObjectId +_0809C442: + adds r1, r0, 0 + ldr r0, =0x020375f2 + ldrb r0, [r0] + bl sub_8099188 + adds r1, r0, 0 +_0809C44E: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end TryGetMapObjectScript + + thumb_func_start TryGetInvisibleMapObjectScript +@ signed int TryGetInvisibleMapObjectScript(int a1, int a2, u8 playerFacingDirection) +TryGetInvisibleMapObjectScript: @ 809C458 + push {r4,r5,lr} + lsls r2, 24 + lsrs r5, r2, 24 + ldr r4, =0x02037318 + ldrh r1, [r0] + subs r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + ldrh r2, [r0, 0x2] + subs r2, 0x7 + lsls r2, 16 + lsrs r2, 16 + ldrb r3, [r0, 0x4] + adds r0, r4, 0 + bl FindInvisibleMapObjectByPosition + cmp r0, 0 + beq _0809C4CC + ldr r2, [r0, 0x8] + cmp r2, 0 + bne _0809C490 + ldr r0, =gUnknown_082C8436 + b _0809C532 + .pool +_0809C490: + ldrb r0, [r0, 0x5] + cmp r0, 0x8 + bhi _0809C530 + lsls r0, 2 + ldr r1, =_0809C4A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0809C4A4: + .4byte _0809C530 + .4byte _0809C4C8 + .4byte _0809C4D0 + .4byte _0809C4D6 + .4byte _0809C4DC + .4byte _0809C4E2 + .4byte _0809C4E2 + .4byte _0809C4E2 + .4byte _0809C510 +_0809C4C8: + cmp r5, 0x2 + beq _0809C530 +_0809C4CC: + movs r0, 0 + b _0809C532 +_0809C4D0: + cmp r5, 0x1 + beq _0809C530 + b _0809C4CC +_0809C4D6: + cmp r5, 0x4 + beq _0809C530 + b _0809C4CC +_0809C4DC: + cmp r5, 0x3 + beq _0809C530 + b _0809C4CC +_0809C4E2: + ldr r1, =0x020375e0 + lsrs r0, r2, 16 + movs r3, 0xFA + lsls r3, 1 + adds r0, r3 + strh r0, [r1] + ldr r0, =0x020375e2 + strh r2, [r0] + ldrh r0, [r1] + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C4CC + ldr r0, =gUnknown_08271CB7 + b _0809C532 + .pool +_0809C510: + cmp r5, 0x2 + bne _0809C4CC + ldr r0, =0x020375e0 + strh r2, [r0] + bl sub_80E9680 + lsls r0, 24 + cmp r0, 0 + beq _0809C4CC + ldr r0, =gUnknown_082759F1 + b _0809C532 + .pool +_0809C530: + adds r0, r2, 0 +_0809C532: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end TryGetInvisibleMapObjectScript + + thumb_func_start TryGetMetatileBehaviorScript +TryGetMetatileBehaviorScript: @ 809C538 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r4, r2, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl MetatileBehavior_IsPlayerFacingTVScreen + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C55C + ldr r0, =gUnknown_0827EE0B + b _0809C7E4 + .pool +_0809C55C: + adds r0, r5, 0 + bl MetatileBehavior_IsPC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C574 + ldr r0, =gUnknown_08271D92 + b _0809C7E4 + .pool +_0809C574: + adds r0, r5, 0 + bl is_tile_x8B + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C58C + ldr r0, =gUnknown_081E615D + b _0809C7E4 + .pool +_0809C58C: + adds r0, r5, 0 + bl is_tile_xEA + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C5A4 + ldr r0, =gUnknown_082393F9 + b _0809C7E4 + .pool +_0809C5A4: + adds r0, r5, 0 + bl is_tile_x84 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C5B4 + b _0809C6E4 +_0809C5B4: + adds r0, r5, 0 + bl is_tile_x87 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C5CC + ldr r0, =gUnknown_082A4BAC + b _0809C7E4 + .pool +_0809C5CC: + adds r0, r5, 0 + bl is_tile_x8C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C5E4 + ldr r0, =gUnknown_0826A22A + b _0809C7E4 + .pool +_0809C5E4: + adds r0, r5, 0 + bl is_tile_x85 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C5FC + ldr r0, =gUnknown_0827208F + b _0809C7E4 + .pool +_0809C5FC: + adds r0, r5, 0 + bl sub_8089A1C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C614 + ldr r0, =gUnknown_08292DE5 + b _0809C7E4 + .pool +_0809C614: + adds r0, r5, 0 + bl sub_8089A30 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C62C + ldr r0, =gUnknown_082725CE + b _0809C7E4 + .pool +_0809C62C: + adds r0, r5, 0 + bl sub_8089A44 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C644 + ldr r0, =gUnknown_082725D7 + b _0809C7E4 + .pool +_0809C644: + adds r0, r5, 0 + bl sub_8089A58 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C65C + ldr r0, =gUnknown_082725E0 + b _0809C7E4 + .pool +_0809C65C: + adds r0, r5, 0 + bl sub_8089A6C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C674 + ldr r0, =gUnknown_082725E9 + b _0809C7E4 + .pool +_0809C674: + adds r0, r5, 0 + bl sub_8089A80 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C68C + ldr r0, =gUnknown_082725F2 + b _0809C7E4 + .pool +_0809C68C: + adds r0, r5, 0 + bl sub_8089A94 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C6A4 + ldr r0, =gUnknown_082725FB + b _0809C7E4 + .pool +_0809C6A4: + adds r0, r5, 0 + bl sub_8089AA8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C6BC + ldr r0, =gUnknown_08272604 + b _0809C7E4 + .pool +_0809C6BC: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8089AD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C6D4 + ldr r0, =gUnknown_08277B8A + b _0809C7E4 + .pool +_0809C6D4: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8089AEC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C6EC +_0809C6E4: + ldr r0, =gUnknown_08277365 + b _0809C7E4 + .pool +_0809C6EC: + adds r0, r5, 0 + bl MetatileBehavior_IsQuestionnaire + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C704 + ldr r0, =gUnknown_0827381B + b _0809C7E4 + .pool +_0809C704: + adds r0, r5, 0 + bl MetatileBehavior_IsTrainerHillTimer + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C71C + ldr r0, =gUnknown_082C8393 + b _0809C7E4 + .pool +_0809C71C: + movs r4, 0x4 + ldrsb r4, [r6, r4] + movs r1, 0 + ldrsh r0, [r6, r1] + movs r2, 0x2 + ldrsh r1, [r6, r2] + bl MapGridGetZCoordAt + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _0809C7D0 + adds r0, r5, 0 + bl sub_8089288 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C74C + ldr r0, =gUnknown_0823B4BB + b _0809C7E4 + .pool +_0809C74C: + adds r0, r5, 0 + bl sub_808929C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C764 + ldr r0, =gUnknown_0823B589 + b _0809C7E4 + .pool +_0809C764: + adds r0, r5, 0 + bl sub_80893DC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C77C + ldr r0, =gUnknown_0823B684 + b _0809C7E4 + .pool +_0809C77C: + adds r0, r5, 0 + bl sub_80893F0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C794 + ldr r0, =gUnknown_0823B68C + b _0809C7E4 + .pool +_0809C794: + adds r0, r5, 0 + bl sub_80892EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C7A8 + bl sub_80EB56C + b _0809C7E2 +_0809C7A8: + adds r0, r5, 0 + bl sub_8089364 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C7BC + bl sub_80EB9E0 + b _0809C7E2 +_0809C7BC: + adds r0, r5, 0 + bl sub_8089350 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C7E2 + bl sub_80EBB28 + b _0809C7E2 +_0809C7D0: + adds r0, r5, 0 + bl sub_8089300 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C7E2 + bl sub_80EB498 +_0809C7E2: + movs r0, 0 +_0809C7E4: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end TryGetMetatileBehaviorScript + + thumb_func_start TryGetFieldMoveScript +TryGetFieldMoveScript: @ 809C7EC + push {r4,lr} + lsls r1, 24 + lsrs r4, r1, 24 + ldr r0, =0x0000086b + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C824 + bl PartyHasMonWithSurf + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C824 + bl IsPlayerFacingSurfableFishableWater + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C824 + ldr r0, =gUnknown_08271EA0 + b _0809C862 + .pool +_0809C824: + adds r0, r4, 0 + bl MetatileBehavior_IsWaterfall + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C860 + ldr r0, =0x0000086e + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C858 + bl IsPlayerSurfingNorth + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C858 + ldr r0, =gUnknown_08290A49 + b _0809C862 + .pool +_0809C858: + ldr r0, =gUnknown_08290A83 + b _0809C862 + .pool +_0809C860: + movs r0, 0 +_0809C862: + pop {r4} + pop {r1} + bx r1 + thumb_func_end TryGetFieldMoveScript + + thumb_func_start sub_809C868 +sub_809C868: @ 809C868 + push {lr} + ldr r0, =0x0000086d + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0809C894 + bl sub_809D1E8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0809C894 + ldr r0, =gUnknown_08290B0F + bl script_env_1_execute_new_script + movs r0, 0x1 + b _0809C896 + .pool +_0809C894: + movs r0, 0 +_0809C896: + pop {r1} + bx r1 + thumb_func_end sub_809C868 + + thumb_func_start sub_809C89C +sub_809C89C: @ 809C89C + push {lr} + ldr r0, =0x0000086d + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0809C8D4 + ldr r0, =0x02037318 + ldrb r0, [r0, 0x17] + cmp r0, 0x5 + bne _0809C8D4 + bl sub_809D1E8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C8D4 + ldr r0, =gUnknown_08290B5A + bl script_env_1_execute_new_script + movs r0, 0x1 + b _0809C8D6 + .pool +_0809C8D4: + movs r0, 0 +_0809C8D6: + pop {r1} + bx r1 + thumb_func_end sub_809C89C + + thumb_func_start sub_809C8DC +sub_809C8DC: @ 809C8DC + push {r4-r6,lr} + adds r5, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + adds r6, r4, 0 + bl mapheader_trigger_activate_at__run_now + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C92E + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_809CC9C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C92E + adds r0, r4, 0 + bl sub_809C96C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C92E + adds r0, r6, 0 + bl per_step_scripts + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C92E + bl sub_80B5870 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809C92E + movs r0, 0 + b _0809C930 +_0809C92E: + movs r0, 0x1 +_0809C930: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_809C8DC + + thumb_func_start mapheader_trigger_activate_at__run_now +mapheader_trigger_activate_at__run_now: @ 809C938 + push {r4,lr} + ldr r4, =0x02037318 + ldrh r1, [r0] + subs r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + ldrh r2, [r0, 0x2] + subs r2, 0x7 + lsls r2, 16 + lsrs r2, 16 + ldrb r3, [r0, 0x4] + adds r0, r4, 0 + bl mapheader_trigger_activate_at + cmp r0, 0 + beq _0809C964 + bl script_env_1_execute_new_script + movs r0, 0x1 + b _0809C966 + .pool +_0809C964: + movs r0, 0 +_0809C966: + pop {r4} + pop {r1} + bx r1 + thumb_func_end mapheader_trigger_activate_at__run_now + + thumb_func_start sub_809C96C +sub_809C96C: @ 809C96C + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8089918 + lsls r0, 24 + cmp r0, 0 + beq _0809C988 + ldr r0, =gUnknown_082A8337 + b _0809C996 + .pool +_0809C988: + adds r0, r4, 0 + bl sub_8089ABC + lsls r0, 24 + cmp r0, 0 + beq _0809C9A4 + ldr r0, =gUnknown_08252BE8 +_0809C996: + bl script_env_1_execute_new_script + movs r0, 0x1 + b _0809C9EA + .pool +_0809C9A4: + adds r0, r4, 0 + bl sub_80893C8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C9B8 + bl sub_80FA9D0 + b _0809C9E8 +_0809C9B8: + adds r0, r4, 0 + bl sub_80893B4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809C9E8 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileIdAt + lsls r0, 16 + asrs r0, 16 + bl sub_80FA970 +_0809C9E8: + movs r0, 0 +_0809C9EA: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809C96C + + thumb_func_start per_step_scripts +per_step_scripts: @ 809C9F4 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + bl InUnionRoom + cmp r0, 0x1 + bne _0809CA04 + b _0809CB24 +_0809CA04: + bl sub_80B215C + bl happiness_algorithm_step + bl sub_81D4998 + ldr r0, =0x02037590 + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0809CAF8 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_808904C + lsls r0, 24 + cmp r0, 0 + bne _0809CAF8 + bl overworld_poison_step + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CA48 + ldr r0, =gUnknown_082736BC + bl script_env_1_execute_new_script + b _0809CB28 + .pool +_0809CA48: + bl sub_8070BD0 + lsls r0, 24 + cmp r0, 0 + beq _0809CA64 + movs r0, 0xD + bl sav12_xor_increment + ldr r0, =gUnknown_08291FC0 + bl script_env_1_execute_new_script + b _0809CB28 + .pool +_0809CA64: + bl sub_813B3B0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CA7C + ldr r0, =gUnknown_08273D1F + bl script_env_1_execute_new_script + b _0809CB28 + .pool +_0809CA7C: + bl sub_8179A04 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CA94 + ldr r0, =gUnknown_08238EAF + bl script_env_1_execute_new_script + b _0809CB28 + .pool +_0809CA94: + bl is_tile_that_overrides_player_control + cmp r0, 0x1 + bne _0809CAA8 + ldr r0, =gUnknown_081DF7BA + bl script_env_1_execute_new_script + b _0809CB28 + .pool +_0809CAA8: + bl sub_8138120 + cmp r0, 0x1 + bne _0809CABC + ldr r0, =gUnknown_081F49EC + bl script_env_1_execute_new_script + b _0809CB28 + .pool +_0809CABC: + bl sub_8138168 + cmp r0, 0x1 + bne _0809CAD0 + ldr r0, =gUnknown_081FA4D6 + bl script_env_1_execute_new_script + b _0809CB28 + .pool +_0809CAD0: + bl sub_81381B0 + cmp r0, 0x1 + bne _0809CAE4 + ldr r0, =gUnknown_0821307B + bl script_env_1_execute_new_script + b _0809CB28 + .pool +_0809CAE4: + bl sub_81381F8 + cmp r0, 0x1 + bne _0809CAF8 + ldr r0, =gUnknown_08224175 + bl script_env_1_execute_new_script + b _0809CB28 + .pool +_0809CAF8: + bl safari_step + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CB28 + movs r0, 0x1 + bl sub_8137FC0 + cmp r0, 0x1 + bne _0809CB1C + ldr r0, =gUnknown_0823C050 + bl script_env_1_execute_new_script + b _0809CB28 + .pool +_0809CB1C: + bl sub_8196034 + cmp r0, 0 + bne _0809CB28 +_0809CB24: + movs r0, 0 + b _0809CB2A +_0809CB28: + movs r0, 0x1 +_0809CB2A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end per_step_scripts + + thumb_func_start sub_809CB30 +sub_809CB30: @ 809CB30 + push {lr} + ldr r0, =0x0000402a + movs r1, 0 + bl VarSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_809CB30 + + thumb_func_start happiness_algorithm_step +happiness_algorithm_step: @ 809CB44 + push {r4,r5,lr} + ldr r0, =0x0000402a + bl GetVarPointer + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + ldrh r1, [r0] + movs r2, 0x7F + ands r1, r2 + strh r1, [r0] + cmp r1, 0 + bne _0809CB72 + ldr r5, =0x020244ec + movs r4, 0x5 +_0809CB62: + adds r0, r5, 0 + movs r1, 0x5 + bl happiness_algorithm + adds r5, 0x64 + subs r4, 0x1 + cmp r4, 0 + bge _0809CB62 +_0809CB72: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end happiness_algorithm_step + + thumb_func_start overworld_poison_timer_set +overworld_poison_timer_set: @ 809CB80 + push {lr} + ldr r0, =0x0000402b + movs r1, 0 + bl VarSet + pop {r0} + bx r0 + .pool + thumb_func_end overworld_poison_timer_set + + thumb_func_start overworld_poison_step +overworld_poison_step: @ 809CB94 + push {lr} + ldr r0, =0x02037318 + ldrb r0, [r0, 0x17] + cmp r0, 0x9 + beq _0809CBD4 + ldr r0, =0x0000402b + bl GetVarPointer + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + ldrh r1, [r0] + movs r2, 0x3 + ands r1, r2 + strh r1, [r0] + cmp r1, 0 + bne _0809CBD4 + bl overworld_poison + cmp r0, 0x1 + beq _0809CBD4 + cmp r0, 0x1 + ble _0809CBD4 + cmp r0, 0x2 + bne _0809CBD4 + movs r0, 0x1 + b _0809CBD6 + .pool +_0809CBD4: + movs r0, 0 +_0809CBD6: + pop {r1} + bx r1 + thumb_func_end overworld_poison_step + + thumb_func_start prev_quest_postbuffer_cursor_backup_reset +prev_quest_postbuffer_cursor_backup_reset: @ 809CBDC + ldr r1, =0x020375d4 + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end prev_quest_postbuffer_cursor_backup_reset + + thumb_func_start is_it_battle_time_3 +is_it_battle_time_3: @ 809CBE8 + push {r4-r7,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r7, r4, 0 + ldr r6, =0x020375d4 + ldrb r0, [r6] + cmp r0, 0x3 + bhi _0809CC0C + adds r0, 0x1 + strb r0, [r6] + ldr r0, =0x020375d6 + strh r4, [r0] + movs r0, 0 + b _0809CC30 + .pool +_0809CC0C: + ldr r5, =0x020375d6 + ldrh r1, [r5] + adds r0, r4, 0 + bl is_it_battle_time_2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CC28 + strh r4, [r5] + movs r0, 0 + b _0809CC30 + .pool +_0809CC28: + movs r0, 0 + strb r0, [r6] + strh r7, [r5] + movs r0, 0x1 +_0809CC30: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end is_it_battle_time_3 + + thumb_func_start mapheader_run_first_tag2_script_list_match_conditionally +mapheader_run_first_tag2_script_list_match_conditionally: @ 809CC38 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =0x02037318 + mov r8, r0 + adds r1, r7, 0 + bl map_warp_check_packed + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl is_non_stair_warp_tile + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CC90 + lsls r0, r6, 24 + asrs r4, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + beq _0809CC90 + bl walkrun_find_lowest_active_bit_in_bitfield + mov r0, r8 + adds r1, r4, 0 + adds r2, r7, 0 + bl sub_809CEB0 + bl sub_80AF734 + movs r0, 0x1 + b _0809CC92 + .pool +_0809CC90: + movs r0, 0 +_0809CC92: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end mapheader_run_first_tag2_script_list_match_conditionally + + thumb_func_start sub_809CC9C +sub_809CC9C: @ 809CC9C + push {r4-r7,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + ldr r7, =0x02037318 + adds r0, r7, 0 + adds r1, r6, 0 + bl map_warp_check_packed + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + beq _0809CD8A + adds r0, r5, 0 + bl is_warp_tile + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CD8A + bl walkrun_find_lowest_active_bit_in_bitfield + adds r0, r7, 0 + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_809CEB0 + lsls r0, r5, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl MetatileBehavior_IsEscalator + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CCF8 + adds r0, r4, 0 + bl sub_80AF80C + movs r0, 0x1 + b _0809CD8C + .pool +_0809CCF8: + adds r0, r4, 0 + bl sub_8089870 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CD0E + bl sub_80AF828 + movs r0, 0x1 + b _0809CD8C +_0809CD0E: + adds r0, r4, 0 + bl is_role_x68 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CD24 + bl sub_80AF838 + movs r0, 0x1 + b _0809CD8C +_0809CD24: + adds r0, r4, 0 + bl MetatileBehavior_IsAquaHideoutWarp + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CD3A + bl sub_80AF848 + movs r0, 0x1 + b _0809CD8C +_0809CD3A: + adds r0, r4, 0 + bl sub_80898AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CD50 + bl sub_80B0268 + movs r0, 0x1 + b _0809CD8C +_0809CD50: + adds r0, r4, 0 + bl sub_8089904 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CD6C + ldr r0, =gUnknown_082A8350 + bl script_env_1_execute_new_script + movs r0, 0x1 + b _0809CD8C + .pool +_0809CD6C: + adds r0, r4, 0 + bl sub_80898C0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CD82 + bl sub_80AF87C + movs r0, 0x1 + b _0809CD8C +_0809CD82: + bl sub_80AF734 + movs r0, 0x1 + b _0809CD8C +_0809CD8A: + movs r0, 0 +_0809CD8C: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_809CC9C + + thumb_func_start is_warp_tile +is_warp_tile: @ 809CD94 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl is_tile_x69_2_warp_door + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CE2A + adds r0, r4, 0 + bl MetatileBehavior_IsLadder + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CE2A + adds r0, r4, 0 + bl MetatileBehavior_IsEscalator + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CE2A + adds r0, r4, 0 + bl sub_8088F58 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CE2A + adds r0, r4, 0 + bl sub_8089870 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CE2A + adds r0, r4, 0 + bl is_role_x68 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CE2A + adds r0, r4, 0 + bl MetatileBehavior_IsAquaHideoutWarp + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CE2A + adds r0, r4, 0 + bl sub_8089904 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CE2A + adds r0, r4, 0 + bl sub_80898C0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CE2A + adds r0, r4, 0 + bl sub_80898AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809CE2A + movs r0, 0 + b _0809CE2C +_0809CE2A: + movs r0, 0x1 +_0809CE2C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end is_warp_tile + + thumb_func_start is_non_stair_warp_tile +is_non_stair_warp_tile: @ 809CE34 + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 24 + lsrs r1, 24 + adds r2, r1, 0 + cmp r1, 0x2 + beq _0809CE58 + cmp r1, 0x2 + bgt _0809CE4E + cmp r1, 0x1 + beq _0809CE62 + b _0809CE84 +_0809CE4E: + cmp r2, 0x3 + beq _0809CE6C + cmp r2, 0x4 + beq _0809CE76 + b _0809CE84 +_0809CE58: + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsNorthArrowWarp + b _0809CE7E +_0809CE62: + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsSouthArrowWarp + b _0809CE7E +_0809CE6C: + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsWestArrowWarp + b _0809CE7E +_0809CE76: + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsEastArrowWarp +_0809CE7E: + lsls r0, 24 + lsrs r0, 24 + b _0809CE86 +_0809CE84: + movs r0, 0 +_0809CE86: + pop {r1} + bx r1 + thumb_func_end is_non_stair_warp_tile + + thumb_func_start map_warp_check_packed +map_warp_check_packed: @ 809CE8C + push {lr} + adds r3, r1, 0 + ldrh r1, [r3] + subs r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + ldrh r2, [r3, 0x2] + subs r2, 0x7 + lsls r2, 16 + lsrs r2, 16 + ldrb r3, [r3, 0x4] + bl map_warp_check + lsls r0, 24 + asrs r0, 24 + pop {r1} + bx r1 + thumb_func_end map_warp_check_packed + + thumb_func_start sub_809CEB0 +sub_809CEB0: @ 809CEB0 + push {r4-r7,lr} + adds r7, r2, 0 + lsls r1, 24 + lsrs r4, r1, 24 + bl GetCurrentTrainerHillMapId + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + cmp r5, 0 + beq _0809CF00 + bl sub_81D6490 + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + bne _0809CEF0 + lsls r0, r4, 24 + adds r4, r0, 0 + cmp r4, 0 + bne _0809CEE8 + ldr r0, =0x02037318 + ldr r0, [r0, 0x4] + ldr r5, [r0, 0x8] + b _0809CF0E + .pool +_0809CEE8: + bl sub_81D6120 + adds r5, r0, 0 + b _0809CF0E +_0809CEF0: + cmp r6, 0x5 + bne _0809CF00 + lsls r4, 24 + lsrs r0, r4, 24 + bl sub_81D6134 + adds r5, r0, 0 + b _0809CF0E +_0809CF00: + ldr r0, =0x02037318 + ldr r0, [r0, 0x4] + lsls r2, r4, 24 + asrs r1, r2, 21 + ldr r0, [r0, 0x8] + adds r5, r0, r1 + adds r4, r2, 0 +_0809CF0E: + ldrb r0, [r5, 0x6] + cmp r0, 0x7F + bne _0809CF20 + ldrb r0, [r5, 0x5] + bl copy_saved_warp2_bank_and_enter_x_to_warp1 + b _0809CF6E + .pool +_0809CF20: + movs r0, 0x7 + ldrsb r0, [r5, r0] + movs r1, 0x6 + ldrsb r1, [r5, r1] + movs r2, 0x5 + ldrsb r2, [r5, r2] + bl warp1_set_2 + movs r1, 0 + ldrsh r0, [r7, r1] + movs r2, 0x2 + ldrsh r1, [r7, r2] + bl sub_8084D5C + ldrb r0, [r5, 0x7] + ldrb r1, [r5, 0x6] + bl get_mapheader_by_bank_and_number + ldr r1, [r0, 0x4] + ldrb r0, [r5, 0x5] + ldr r1, [r1, 0x8] + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0, 0x6] + cmp r0, 0x7F + bne _0809CF6E + asrs r3, r4, 24 + lsls r0, r3, 3 + adds r0, r1 + ldrb r0, [r0, 0x5] + ldr r1, =0x03005d8c + ldr r2, [r1] + movs r1, 0x4 + ldrsb r1, [r2, r1] + ldrb r2, [r2, 0x5] + lsls r2, 24 + asrs r2, 24 + bl saved_warp2_set +_0809CF6E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809CEB0 + + thumb_func_start map_warp_consider_2_to_inside +map_warp_consider_2_to_inside: @ 809CF78 + push {r4-r7,lr} + adds r5, r0, 0 + lsls r1, 16 + lsrs r0, r1, 16 + adds r7, r0, 0 + lsls r2, 24 + lsrs r2, 24 + cmp r2, 0x2 + bne _0809CFFC + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8089210 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CFB0 + ldr r0, =0x02037318 + ldr r1, [r0, 0x4] + adds r0, r5, 0 + bl sub_80E9668 + movs r0, 0x1 + b _0809CFFE + .pool +_0809CFB0: + adds r0, r4, 0 + bl is_tile_x69_2_warp_door + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CFFC + ldr r6, =0x02037318 + adds r0, r6, 0 + adds r1, r5, 0 + bl map_warp_check_packed + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + beq _0809CFFC + adds r0, r7, 0 + bl is_warp_tile + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809CFFC + bl walkrun_find_lowest_active_bit_in_bitfield + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_809CEB0 + bl sub_80AF7D0 + movs r0, 0x1 + b _0809CFFE + .pool +_0809CFFC: + movs r0, 0 +_0809CFFE: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end map_warp_consider_2_to_inside + + thumb_func_start map_warp_check +map_warp_check: @ 809D004 + push {r4-r6,lr} + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 16 + lsrs r5, r2, 16 + lsls r3, 24 + lsrs r4, r3, 24 + ldr r0, [r0, 0x4] + ldr r1, [r0, 0x8] + ldrb r3, [r0, 0x1] + movs r2, 0 + cmp r2, r3 + bge _0809D042 +_0809D01E: + ldrh r0, [r1] + cmp r0, r6 + bne _0809D03A + ldrh r0, [r1, 0x2] + cmp r0, r5 + bne _0809D03A + ldrb r0, [r1, 0x4] + cmp r0, r4 + beq _0809D034 + cmp r0, 0 + bne _0809D03A +_0809D034: + lsls r0, r2, 24 + asrs r0, 24 + b _0809D046 +_0809D03A: + adds r2, 0x1 + adds r1, 0x8 + cmp r2, r3 + blt _0809D01E +_0809D042: + movs r0, 0x1 + negs r0, r0 +_0809D046: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end map_warp_check + + thumb_func_start trigger_activate +trigger_activate: @ 809D04C + push {r4,lr} + adds r4, r0, 0 + cmp r4, 0 + beq _0809D082 + ldr r1, [r4, 0xC] + cmp r1, 0 + bne _0809D062 + ldrb r0, [r4, 0x6] + bl trigger_activate_weather + b _0809D082 +_0809D062: + ldrh r0, [r4, 0x6] + cmp r0, 0 + beq _0809D07C + ldrh r0, [r4, 0x6] + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r4, 0x8] + cmp r0, r1 + bne _0809D082 + ldr r0, [r4, 0xC] + b _0809D084 +_0809D07C: + adds r0, r1, 0 + bl script_env_2_execute_new_script +_0809D082: + movs r0, 0 +_0809D084: + pop {r4} + pop {r1} + bx r1 + thumb_func_end trigger_activate + + thumb_func_start mapheader_trigger_activate_at +mapheader_trigger_activate_at: @ 809D08C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + lsls r2, 16 + lsrs r2, 16 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + ldr r0, [r0, 0x4] + ldr r1, [r0, 0xC] + ldrb r7, [r0, 0x2] + movs r6, 0 + cmp r6, r7 + bge _0809D0E2 + adds r5, r1, 0 + adds r4, r5, 0 +_0809D0B8: + ldrh r0, [r4] + cmp r0, r10 + bne _0809D0D8 + ldrh r0, [r4, 0x2] + cmp r0, r9 + bne _0809D0D8 + ldrb r0, [r4, 0x4] + cmp r0, r8 + beq _0809D0CE + cmp r0, 0 + bne _0809D0D8 +_0809D0CE: + adds r0, r5, 0 + bl trigger_activate + cmp r0, 0 + bne _0809D0E4 +_0809D0D8: + adds r4, 0x10 + adds r5, 0x10 + adds r6, 0x1 + cmp r6, r7 + blt _0809D0B8 +_0809D0E2: + movs r0, 0 +_0809D0E4: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end mapheader_trigger_activate_at + + thumb_func_start sub_809D0F4 +sub_809D0F4: @ 809D0F4 + push {r4,lr} + ldr r4, =0x02037318 + ldrh r1, [r0] + subs r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + ldrh r2, [r0, 0x2] + subs r2, 0x7 + lsls r2, 16 + lsrs r2, 16 + ldrb r3, [r0, 0x4] + adds r0, r4, 0 + bl mapheader_trigger_activate_at + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809D0F4 + + thumb_func_start FindInvisibleMapObjectByPosition +@ int FindInvisibleMapObjectByPosition(struct mapheader *mapHeader, u16 x, u16 y, u8 elevation) +FindInvisibleMapObjectByPosition: @ 809D11C + push {r4-r7,lr} + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 16 + lsrs r6, r2, 16 + lsls r3, 24 + lsrs r5, r3, 24 + ldr r0, [r0, 0x4] + ldr r4, [r0, 0x10] + ldrb r3, [r0, 0x3] + movs r2, 0 + cmp r2, r3 + bcs _0809D162 +_0809D136: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r4 + ldrh r0, [r1] + cmp r0, r7 + bne _0809D158 + ldrh r0, [r1, 0x2] + cmp r0, r6 + bne _0809D158 + ldrb r0, [r1, 0x4] + cmp r0, r5 + beq _0809D154 + cmp r0, 0 + bne _0809D158 +_0809D154: + adds r0, r1, 0 + b _0809D164 +_0809D158: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r3 + bcc _0809D136 +_0809D162: + movs r0, 0 +_0809D164: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end FindInvisibleMapObjectByPosition + + thumb_func_start dive_warp +dive_warp: @ 809D16C + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + ldr r0, =0x02037318 + ldrb r0, [r0, 0x17] + cmp r0, 0x5 + bne _0809D1A4 + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_80895D0 + lsls r0, 24 + cmp r0, 0 + bne _0809D1A4 + ldrh r0, [r4] + subs r0, 0x7 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r4, 0x2] + subs r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + bl sub_8085058 + b _0809D1C8 + .pool +_0809D1A4: + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_80895B0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809D1E0 + ldrh r0, [r4] + subs r0, 0x7 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r4, 0x2] + subs r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + bl sub_8085078 +_0809D1C8: + lsls r0, 24 + cmp r0, 0 + beq _0809D1E0 + bl walkrun_find_lowest_active_bit_in_bitfield + bl sp13E_warp_to_last_warp + movs r0, 0xE9 + bl audio_play + movs r0, 0x1 + b _0809D1E2 +_0809D1E0: + movs r0, 0 +_0809D1E2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end dive_warp + + thumb_func_start sub_809D1E8 +sub_809D1E8: @ 809D1E8 + push {r4,r5,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02037318 + ldrb r0, [r0, 0x17] + cmp r0, 0x5 + bne _0809D244 + adds r0, r5, 0 + bl sub_80895D0 + lsls r0, 24 + cmp r0, 0 + bne _0809D244 + mov r0, sp + ldrh r0, [r0] + subs r0, 0x7 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r4] + subs r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + bl sub_8085058 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809D274 + movs r0, 0x1 + b _0809D276 + .pool +_0809D244: + adds r0, r5, 0 + bl sub_80895B0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809D274 + mov r0, sp + ldrh r0, [r0] + subs r0, 0x7 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r4] + subs r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + bl sub_8085078 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809D274 + movs r0, 0x2 + b _0809D276 +_0809D274: + movs r0, 0 +_0809D276: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809D1E8 + + thumb_func_start GetFieldObjectScriptPointerForComparison +@ u8 *GetFieldObjectScriptPointerForComparison() +GetFieldObjectScriptPointerForComparison: @ 809D280 + push {r4,r5,lr} + sub sp, 0x8 + bl player_get_direction_upper_nybble + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r5, sp + mov r0, sp + bl player_get_next_pos_and_height + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0x2 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + adds r2, r4, 0 + bl TryGetMapObjectScript + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end GetFieldObjectScriptPointerForComparison + + thumb_func_start sub_809D2BC +sub_809D2BC: @ 809D2BC + push {r4,lr} + sub sp, 0x8 + bl player_get_direction_upper_nybble + mov r4, sp + mov r0, sp + bl player_get_pos_to_and_height + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + ldr r4, =0x02037318 + adds r0, r4, 0 + mov r1, sp + bl map_warp_check_packed + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + adds r0, r4, 0 + mov r2, sp + bl sub_809CEB0 + movs r0, 0 + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809D2BC + + thumb_func_start sub_809D300 +sub_809D300: @ 809D300 + push {r4,lr} + ldr r4, =0x03005d8c + ldr r0, [r4] + ldr r1, =0x00001270 + adds r0, r1 + movs r2, 0x96 + lsls r2, 1 + movs r1, 0 + bl memset + ldr r0, [r4] + ldr r1, =0x0000139c + adds r0, r1 + movs r2, 0x80 + lsls r2, 2 + movs r1, 0 + bl memset + ldr r0, =0x020375fc + movs r1, 0 + movs r2, 0x10 + bl memset + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D300 + + thumb_func_start sub_809D344 +sub_809D344: @ 809D344 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00001270 + adds r2, r0, r1 + movs r1, 0 + str r1, [r2] + ldr r1, =0x0000139c + adds r0, r1 + movs r1, 0 + movs r2, 0x20 + bl memset + ldr r0, =0x000008ad + bl FlagReset + ldr r0, =0x000008ae + bl FlagReset + ldr r0, =0x00000889 + bl FlagReset + ldr r0, =0x000008c1 + bl FlagReset + movs r0, 0x88 + lsls r0, 4 + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D344 + + thumb_func_start sub_809D3A0 +sub_809D3A0: @ 809D3A0 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00001394 + adds r0, r1 + movs r1, 0 + movs r2, 0x8 + bl memset + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D3A0 + + thumb_func_start sub_809D3C0 +sub_809D3C0: @ 809D3C0 + push {lr} + ldr r0, =0x00004046 + bl GetVarPointer + ldr r1, =0x03005d90 + ldr r2, [r1] + movs r1, 0 + strb r1, [r2, 0x1A] + strh r1, [r0] + ldr r0, =0x00000896 + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D3C0 + + thumb_func_start sub_809D3E8 +sub_809D3E8: @ 809D3E8 + push {r4,r5,lr} + ldr r0, =0x00004046 + bl GetVarPointer + ldr r4, =0x03005d90 + ldr r2, [r4] + movs r5, 0 + movs r1, 0xDA + strb r1, [r2, 0x1A] + ldr r2, =0x00000302 + adds r1, r2, 0 + strh r1, [r0] + ldr r0, =0x00000896 + bl FlagSet + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x19] + ldr r0, [r4] + strb r5, [r0, 0x18] + bl sub_80BB358 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D3E8 + + thumb_func_start sub_809D42C +sub_809D42C: @ 809D42C + push {lr} + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x1A] + cmp r0, 0xDA + bne _0809D468 + ldr r0, =0x00004046 + bl VarGet + lsls r0, 16 + ldr r1, =0x03020000 + cmp r0, r1 + bne _0809D468 + ldr r0, =0x00000896 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0809D468 + movs r0, 0x1 + b _0809D46A + .pool +_0809D468: + movs r0, 0 +_0809D46A: + pop {r1} + bx r1 + thumb_func_end sub_809D42C + + thumb_func_start sub_809D470 +sub_809D470: @ 809D470 + push {lr} + ldr r0, =0x000008ac + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D470 + + thumb_func_start sub_809D480 +sub_809D480: @ 809D480 + push {lr} + ldr r0, =0x000008ac + bl FlagSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D480 + + thumb_func_start sub_809D490 +sub_809D490: @ 809D490 + push {lr} + ldr r0, =0x000008ac + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809D490 + + thumb_func_start sub_809D4A4 +sub_809D4A4: @ 809D4A4 + push {lr} + ldr r0, =0x000008db + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D4A4 + + thumb_func_start sub_809D4B4 +sub_809D4B4: @ 809D4B4 + push {lr} + ldr r0, =0x000008db + bl FlagSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D4B4 + + thumb_func_start sub_809D4C4 +sub_809D4C4: @ 809D4C4 + push {lr} + ldr r0, =0x000008db + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809D4C4 + + thumb_func_start sub_809D4D8 +sub_809D4D8: @ 809D4D8 + push {lr} + movs r0, 0xF2 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001e5 + bl FlagReset + movs r0, 0xF3 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001e7 + bl FlagReset + movs r0, 0xF4 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001e9 + bl FlagReset + movs r0, 0xF5 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001eb + bl FlagReset + movs r0, 0xF6 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001ed + bl FlagReset + movs r0, 0xF7 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001ef + bl FlagReset + movs r0, 0xF8 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001f1 + bl FlagReset + movs r0, 0xF9 + lsls r0, 1 + bl FlagReset + ldr r0, =0x000001f3 + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D4D8 + + thumb_func_start sub_809D570 +sub_809D570: @ 809D570 + push {lr} + ldr r0, =0x000040dd + movs r1, 0 + bl VarSet + ldr r0, =0x000040de + movs r1, 0 + bl VarSet + ldr r0, =0x000040df + movs r1, 0 + bl VarSet + ldr r0, =0x000040e0 + movs r1, 0 + bl VarSet + ldr r0, =0x000040e1 + movs r1, 0 + bl VarSet + ldr r0, =0x000040e2 + movs r1, 0 + bl VarSet + ldr r0, =0x000040e3 + movs r1, 0 + bl VarSet + ldr r0, =0x000040e4 + movs r1, 0 + bl VarSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D570 + + thumb_func_start sub_809D5D8 +sub_809D5D8: @ 809D5D8 + push {lr} + ldr r0, =0x0000402c + movs r1, 0 + bl VarSet + ldr r0, =0x000008c2 + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D5D8 + + thumb_func_start sub_809D5F4 +sub_809D5F4: @ 809D5F4 + push {lr} + ldr r0, =0x0000402c + movs r1, 0x92 + lsls r1, 4 + bl VarSet + ldr r0, =0x000008c2 + bl FlagSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D5F4 + + thumb_func_start sub_809D614 +sub_809D614: @ 809D614 + push {lr} + ldr r0, =0x000008c2 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0809D640 + ldr r0, =0x0000402c + bl VarGet + lsls r0, 16 + movs r1, 0x92 + lsls r1, 20 + cmp r0, r1 + bne _0809D640 + movs r0, 0x1 + b _0809D642 + .pool +_0809D640: + movs r0, 0 +_0809D642: + pop {r1} + bx r1 + thumb_func_end sub_809D614 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_809D7BC.s b/asm/rom_809D7BC.s new file mode 100644 index 000000000..732dca1f5 --- /dev/null +++ b/asm/rom_809D7BC.s @@ -0,0 +1,2236 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_809D7BC +sub_809D7BC: @ 809D7BC + push {lr} + movs r0, 0x1 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D7BC + + thumb_func_start sub_809D7C8 +sub_809D7C8: @ 809D7C8 + push {lr} + movs r0, 0x2 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D7C8 + + thumb_func_start sub_809D7D4 +sub_809D7D4: @ 809D7D4 + push {lr} + movs r0, 0x3 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D7D4 + + thumb_func_start sub_809D7E0 +sub_809D7E0: @ 809D7E0 + push {lr} + movs r0, 0x4 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D7E0 + + thumb_func_start sub_809D7EC +sub_809D7EC: @ 809D7EC + push {lr} + movs r0, 0x5 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D7EC + + thumb_func_start sub_809D7F8 +sub_809D7F8: @ 809D7F8 + push {lr} + movs r0, 0x6 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D7F8 + + thumb_func_start sub_809D804 +sub_809D804: @ 809D804 + push {lr} + movs r0, 0x9 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D804 + + thumb_func_start sub_809D810 +sub_809D810: @ 809D810 + push {lr} + movs r0, 0x7 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D810 + + thumb_func_start sub_809D81C +sub_809D81C: @ 809D81C + push {lr} + movs r0, 0x8 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D81C + + thumb_func_start sub_809D828 +sub_809D828: @ 809D828 + push {lr} + movs r0, 0xB + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D828 + + thumb_func_start sub_809D834 +sub_809D834: @ 809D834 + push {lr} + movs r0, 0xC + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D834 + + thumb_func_start sub_809D840 +sub_809D840: @ 809D840 + push {lr} + movs r0, 0x14 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D840 + + thumb_func_start sub_809D84C +sub_809D84C: @ 809D84C + push {lr} + movs r0, 0x15 + bl sub_80AEDF0 + pop {r0} + bx r0 + thumb_func_end sub_809D84C + + thumb_func_start trigger_activate_weather +trigger_activate_weather: @ 809D858 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r2, 0 + ldr r3, =gUnknown_085102E0 +_0809D862: + lsls r1, r2, 3 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r4 + bne _0809D87C + adds r0, r3, 0x4 + adds r0, r1, r0 + ldr r0, [r0] + bl _call_via_r0 + b _0809D886 + .pool +_0809D87C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xC + bls _0809D862 +_0809D886: + pop {r4} + pop {r0} + bx r0 + thumb_func_end trigger_activate_weather + + thumb_func_start task_per_step_callback_manager +task_per_step_callback_manager: @ 809D88C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x8 + ldrsh r1, [r1, r2] + ldr r2, =gUnknown_08510348 + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end task_per_step_callback_manager + + thumb_func_start sub_809D8B8 +sub_809D8B8: @ 809D8B8 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0809D8CA + cmp r0, 0x1 + beq _0809D8E8 + b _0809D8FC +_0809D8CA: + ldr r0, =0x030022c0 + ldr r0, [r0, 0x20] + movs r1, 0x80 + lsls r1, 5 + ands r0, r1 + cmp r0, 0 + beq _0809D8FC + bl sub_809E7B0 + ldrh r0, [r4] + adds r0, 0x1 + b _0809D8FA + .pool +_0809D8E8: + ldr r0, =0x030022c0 + ldr r0, [r0, 0x20] + movs r1, 0x80 + lsls r1, 5 + ands r0, r1 + cmp r0, 0 + bne _0809D8FC + ldrh r0, [r4] + subs r0, 0x1 +_0809D8FA: + strh r0, [r4] +_0809D8FC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D8B8 + + thumb_func_start sub_809D908 +sub_809D908: @ 809D908 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r4, r1, r0 + bl script_env_2_is_enabled + lsls r0, 24 + cmp r0, 0 + bne _0809D930 + adds r0, r4, 0 + bl sub_809D8B8 + adds r0, r4, 0x2 + adds r1, r4, 0x4 + bl wild_encounter_related +_0809D930: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809D908 + + thumb_func_start overworld_ensure_per_step_coros_running +overworld_ensure_per_step_coros_running: @ 809D93C + push {r4,r5,lr} + ldr r5, =task_per_step_callback_manager + adds r0, r5, 0 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0809D966 + adds r0, r5, 0 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] +_0809D966: + ldr r4, =sub_809E638 + adds r0, r4, 0 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + bne _0809D97C + adds r0, r4, 0 + movs r1, 0x50 + bl CreateTask +_0809D97C: + ldr r4, =sub_809D908 + adds r0, r4, 0 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + bne _0809D992 + adds r0, r4, 0 + movs r1, 0x50 + bl CreateTask +_0809D992: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end overworld_ensure_per_step_coros_running + + thumb_func_start activate_per_step_callback +activate_per_step_callback: @ 809D9A8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =task_per_step_callback_manager + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xFF + beq _0809D9EA + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r1, r0, r1 + movs r2, 0 + adds r0, r1, 0 + adds r0, 0x1E +_0809D9CC: + strh r2, [r0] + subs r0, 0x2 + cmp r0, r1 + bge _0809D9CC + cmp r4, 0x7 + bls _0809D9E8 + movs r0, 0 + strh r0, [r1] + b _0809D9EA + .pool +_0809D9E8: + strh r4, [r1] +_0809D9EA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end activate_per_step_callback + + thumb_func_start wild_encounter_reset_coro_args +wild_encounter_reset_coro_args: @ 809D9F0 + push {lr} + ldr r0, =task_per_step_callback_manager + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, =sub_809D908 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xFF + beq _0809DA1A + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x2] + strh r1, [r0, 0x4] +_0809DA1A: + pop {r0} + bx r0 + .pool + thumb_func_end wild_encounter_reset_coro_args + + thumb_func_start nullsub_34 +nullsub_34: @ 809DA2C + bx lr + thumb_func_end nullsub_34 + + thumb_func_start sub_809DA30 +sub_809DA30: @ 809DA30 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + adds r0, r4, 0 + bl sub_8089764 + lsls r0, 24 + cmp r0, 0 + beq _0809DA48 + adds r0, r5, 0 + b _0809DA80 +_0809DA48: + adds r0, r4, 0 + bl sub_8089778 + lsls r0, 24 + cmp r0, 0 + beq _0809DA5A + adds r0, r5, 0 + adds r0, 0x8 + b _0809DA80 +_0809DA5A: + adds r0, r4, 0 + bl sub_808978C + lsls r0, 24 + cmp r0, 0 + beq _0809DA6C + adds r0, r5, 0 + adds r0, 0x10 + b _0809DA80 +_0809DA6C: + adds r0, r4, 0 + bl sub_80897A0 + lsls r0, 24 + cmp r0, 0 + bne _0809DA7C + movs r0, 0 + b _0809DA80 +_0809DA7C: + adds r0, r5, 0 + adds r0, 0x18 +_0809DA80: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809DA30 + + thumb_func_start sub_809DA88 +sub_809DA88: @ 809DA88 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + mov r8, r3 + lsls r1, 16 + asrs r6, r1, 16 + lsls r2, 16 + asrs r7, r2, 16 + adds r0, r6, 0 + adds r1, r7, 0 + bl MapGridGetMetatileBehaviorAt + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl sub_809DA30 + adds r4, r0, 0 + adds r5, r4, 0 + cmp r4, 0 + beq _0809DB06 + movs r0, 0 + ldrsb r0, [r4, r0] + adds r0, r6, r0 + movs r1, 0x1 + ldrsb r1, [r4, r1] + adds r1, r7, r1 + ldrh r2, [r4, 0x2] + bl MapGridSetMetatileIdAt + mov r0, r8 + cmp r0, 0 + beq _0809DADE + movs r0, 0 + ldrsb r0, [r4, r0] + adds r0, r6, r0 + movs r1, 0x1 + ldrsb r1, [r4, r1] + adds r1, r7, r1 + bl CurrentMapDrawMetatileAt +_0809DADE: + movs r0, 0x4 + ldrsb r0, [r5, r0] + adds r0, r6, r0 + movs r1, 0x5 + ldrsb r1, [r5, r1] + adds r1, r7, r1 + ldrh r2, [r5, 0x6] + bl MapGridSetMetatileIdAt + mov r0, r8 + cmp r0, 0 + beq _0809DB06 + movs r0, 0x4 + ldrsb r0, [r5, r0] + adds r0, r6, r0 + movs r1, 0x5 + ldrsb r1, [r5, r1] + adds r1, r7, r1 + bl CurrentMapDrawMetatileAt +_0809DB06: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_809DA88 + + thumb_func_start sub_809DB10 +sub_809DB10: @ 809DB10 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r3, r2, 0 + ldr r0, =gUnknown_08510368 + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_809DA88 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809DB10 + + thumb_func_start sub_809DB34 +sub_809DB34: @ 809DB34 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r3, r2, 0 + ldr r0, =gUnknown_08510388 + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_809DA88 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809DB34 + + thumb_func_start sub_809DB58 +sub_809DB58: @ 809DB58 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r3, r2, 0 + ldr r0, =gUnknown_085103A8 + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_809DA88 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809DB58 + + thumb_func_start sub_809DB7C +sub_809DB7C: @ 809DB7C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + mov r10, r8 + lsls r1, 16 + lsrs r7, r1, 16 + mov r9, r7 + lsls r2, 16 + asrs r6, r2, 16 + lsls r3, 16 + asrs r5, r3, 16 + adds r0, r6, 0 + adds r1, r5, 0 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8089764 + lsls r0, 24 + cmp r0, 0 + beq _0809DBC0 + lsls r0, r7, 16 + asrs r0, 16 + cmp r0, r5 + ble _0809DC06 +_0809DBBC: + movs r0, 0 + b _0809DC08 +_0809DBC0: + adds r0, r4, 0 + bl sub_8089778 + lsls r0, 24 + cmp r0, 0 + beq _0809DBD8 + mov r1, r9 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, r5 + bge _0809DC06 + b _0809DBBC +_0809DBD8: + adds r0, r4, 0 + bl sub_808978C + lsls r0, 24 + cmp r0, 0 + beq _0809DBF0 + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, r6 + ble _0809DC06 + b _0809DBBC +_0809DBF0: + adds r0, r4, 0 + bl sub_80897A0 + lsls r0, 24 + cmp r0, 0 + beq _0809DC06 + mov r1, r10 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, r6 + blt _0809DBBC +_0809DC06: + movs r0, 0x1 +_0809DC08: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_809DB7C + + thumb_func_start sub_809DC18 +sub_809DC18: @ 809DC18 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + mov r10, r8 + lsls r3, 16 + lsrs r7, r3, 16 + mov r9, r7 + lsls r0, 16 + asrs r6, r0, 16 + lsls r1, 16 + asrs r5, r1, 16 + adds r0, r6, 0 + adds r1, r5, 0 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8089764 + lsls r0, 24 + cmp r0, 0 + beq _0809DC5C + lsls r0, r7, 16 + asrs r0, 16 + cmp r5, r0 + bge _0809DCA2 +_0809DC58: + movs r0, 0 + b _0809DCA4 +_0809DC5C: + adds r0, r4, 0 + bl sub_8089778 + lsls r0, 24 + cmp r0, 0 + beq _0809DC74 + mov r1, r9 + lsls r0, r1, 16 + asrs r0, 16 + cmp r5, r0 + ble _0809DCA2 + b _0809DC58 +_0809DC74: + adds r0, r4, 0 + bl sub_808978C + lsls r0, 24 + cmp r0, 0 + beq _0809DC8C + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + cmp r6, r0 + bge _0809DCA2 + b _0809DC58 +_0809DC8C: + adds r0, r4, 0 + bl sub_80897A0 + lsls r0, 24 + cmp r0, 0 + beq _0809DCA2 + mov r1, r10 + lsls r0, r1, 16 + asrs r0, 16 + cmp r6, r0 + bgt _0809DC58 +_0809DCA2: + movs r0, 0x1 +_0809DCA4: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_809DC18 + + thumb_func_start sub_809DCB4 +sub_809DCB4: @ 809DCB4 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r4, r1, r0 + mov r5, sp + adds r5, 0x2 + mov r0, sp + adds r1, r5, 0 + bl PlayerGetDestCoords + movs r1, 0x2 + ldrsh r0, [r4, r1] + adds r6, r5, 0 + cmp r0, 0x1 + beq _0809DD0E + cmp r0, 0x1 + bgt _0809DCEC + cmp r0, 0 + beq _0809DCF2 + b _0809DE1E + .pool +_0809DCEC: + cmp r0, 0x2 + beq _0809DDDC + b _0809DE1E +_0809DCF2: + mov r0, sp + ldrh r0, [r0] + strh r0, [r4, 0x4] + ldrh r0, [r5] + strh r0, [r4, 0x6] + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + movs r3, 0 + ldrsh r1, [r5, r3] + movs r2, 0x1 + bl sub_809DB34 + b _0809DE1A +_0809DD0E: + mov r0, sp + movs r7, 0 + ldrsh r1, [r0, r7] + movs r2, 0x4 + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _0809DD28 + movs r3, 0 + ldrsh r1, [r5, r3] + movs r7, 0x6 + ldrsh r0, [r4, r7] + cmp r1, r0 + beq _0809DE1E +_0809DD28: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r5, 0x6 + ldrsh r3, [r4, r5] + bl sub_809DB7C + cmp r0, 0 + beq _0809DD70 + movs r7, 0x4 + ldrsh r0, [r4, r7] + movs r2, 0x6 + ldrsh r1, [r4, r2] + movs r2, 0x1 + bl sub_809DB10 + movs r3, 0x4 + ldrsh r0, [r4, r3] + movs r5, 0x6 + ldrsh r1, [r4, r5] + movs r2, 0 + bl sub_809DB58 + ldrh r0, [r4, 0x4] + strh r0, [r4, 0x8] + ldrh r0, [r4, 0x6] + strh r0, [r4, 0xA] + movs r0, 0x2 + strh r0, [r4, 0x2] + movs r0, 0x8 + strh r0, [r4, 0xC] + b _0809DD7A +_0809DD70: + movs r7, 0x1 + negs r7, r7 + adds r0, r7, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0xA] +_0809DD7A: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + adds r5, r6, 0 + movs r2, 0 + ldrsh r1, [r5, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r7, 0x6 + ldrsh r3, [r4, r7] + bl sub_809DC18 + cmp r0, 0 + beq _0809DDAE + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + movs r2, 0x1 + bl sub_809DB10 + movs r0, 0x2 + strh r0, [r4, 0x2] + movs r0, 0x8 + strh r0, [r4, 0xC] +_0809DDAE: + mov r0, sp + ldrh r0, [r0] + strh r0, [r4, 0x4] + ldrh r0, [r6] + strh r0, [r4, 0x6] + mov r0, sp + movs r3, 0 + ldrsh r0, [r0, r3] + movs r5, 0 + ldrsh r1, [r6, r5] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsPacifidlogLog + lsls r0, 24 + cmp r0, 0 + beq _0809DE1E + movs r0, 0x46 + bl audio_play + b _0809DE1E +_0809DDDC: + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _0809DE1E + mov r0, sp + movs r7, 0 + ldrsh r0, [r0, r7] + movs r2, 0 + ldrsh r1, [r5, r2] + movs r2, 0x1 + bl sub_809DB34 + movs r3, 0x8 + ldrsh r0, [r4, r3] + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _0809DE1A + movs r5, 0xA + ldrsh r0, [r4, r5] + cmp r0, r1 + beq _0809DE1A + movs r7, 0x8 + ldrsh r0, [r4, r7] + movs r2, 0xA + ldrsh r1, [r4, r2] + movs r2, 0x1 + bl sub_809DB58 +_0809DE1A: + movs r0, 0x1 + strh r0, [r4, 0x2] +_0809DE1E: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_809DCB4 + + thumb_func_start sub_809DE28 +sub_809DE28: @ 809DE28 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 16 + lsrs r5, r1, 16 + bl PlayerGetZCoord + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0809DE82 + lsls r0, r4, 16 + asrs r4, r0, 16 + lsls r0, r5, 16 + asrs r5, r0, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridGetMetatileIdAt + adds r1, r0, 0 + ldr r0, =0x0000024e + cmp r1, r0 + beq _0809DE68 + adds r0, 0x8 + cmp r1, r0 + beq _0809DE78 + b _0809DE82 + .pool +_0809DE68: + ldr r2, =0x0000024f + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridSetMetatileIdAt + b _0809DE82 + .pool +_0809DE78: + ldr r2, =0x00000257 + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridSetMetatileIdAt +_0809DE82: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809DE28 + + thumb_func_start sub_809DE8C +sub_809DE8C: @ 809DE8C + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 16 + lsrs r5, r1, 16 + bl PlayerGetZCoord + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0809DEE6 + lsls r0, r4, 16 + asrs r4, r0, 16 + lsls r0, r5, 16 + asrs r5, r0, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridGetMetatileIdAt + adds r1, r0, 0 + ldr r0, =0x0000024f + cmp r1, r0 + beq _0809DECC + adds r0, 0x8 + cmp r1, r0 + beq _0809DEDC + b _0809DEE6 + .pool +_0809DECC: + ldr r2, =0x0000024e + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridSetMetatileIdAt + b _0809DEE6 + .pool +_0809DEDC: + ldr r2, =0x00000256 + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridSetMetatileIdAt +_0809DEE6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809DE8C + + thumb_func_start sub_809DEF0 +sub_809DEF0: @ 809DEF0 + 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 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r6, r1, r0 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + movs r0, 0x2 + ldrsh r5, [r6, r0] + mov r9, r4 + cmp r5, 0x1 + beq _0809DF84 + cmp r5, 0x1 + bgt _0809DF30 + cmp r5, 0 + beq _0809DF38 + b _0809E0F6 + .pool +_0809DF30: + cmp r5, 0x2 + bne _0809DF36 + b _0809E064 +_0809DF36: + b _0809E0F6 +_0809DF38: + mov r0, sp + ldrh r0, [r0] + strh r0, [r6, 0x4] + mov r1, r9 + ldrh r0, [r1] + strh r0, [r6, 0x6] + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + movs r3, 0 + ldrsh r1, [r1, r3] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsFortreeBridge + lsls r0, 24 + cmp r0, 0 + bne _0809DF62 + b _0809E0F2 +_0809DF62: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + mov r2, r9 + movs r3, 0 + ldrsh r1, [r2, r3] + bl sub_809DE28 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + mov r2, r9 + movs r3, 0 + ldrsh r1, [r2, r3] + bl CurrentMapDrawMetatileAt + b _0809E0F2 +_0809DF84: + ldrh r0, [r6, 0x6] + mov r8, r0 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + ldrh r2, [r6, 0x4] + mov r10, r2 + movs r3, 0x4 + ldrsh r7, [r6, r3] + cmp r0, r7 + bne _0809DFAC + mov r0, r9 + movs r2, 0 + ldrsh r1, [r0, r2] + mov r3, r8 + lsls r0, r3, 16 + asrs r0, 16 + cmp r1, r0 + bne _0809DFAC + b _0809E0F6 +_0809DFAC: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + mov r2, r9 + movs r3, 0 + ldrsh r1, [r2, r3] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsFortreeBridge + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + mov r0, r8 + lsls r4, r0, 16 + asrs r1, r4, 16 + adds r0, r7, 0 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsFortreeBridge + lsls r0, 24 + lsrs r7, r0, 24 + bl PlayerGetZCoord + movs r1, 0 + ands r5, r0 + lsls r0, r5, 24 + adds r5, r4, 0 + cmp r0, 0 + bne _0809DFF4 + movs r1, 0x1 +_0809DFF4: + cmp r1, 0 + beq _0809E008 + ldr r1, [sp, 0x4] + cmp r1, 0x1 + beq _0809E002 + cmp r7, 0x1 + bne _0809E008 +_0809E002: + movs r0, 0x47 + bl audio_play +_0809E008: + cmp r7, 0 + beq _0809E044 + mov r2, r10 + lsls r4, r2, 16 + asrs r4, 16 + asrs r5, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_809DE8C + adds r0, r4, 0 + adds r1, r5, 0 + bl CurrentMapDrawMetatileAt + mov r0, sp + movs r3, 0 + ldrsh r0, [r0, r3] + mov r2, r9 + movs r3, 0 + ldrsh r1, [r2, r3] + bl sub_809DE28 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + mov r2, r9 + movs r3, 0 + ldrsh r1, [r2, r3] + bl CurrentMapDrawMetatileAt +_0809E044: + mov r0, r10 + strh r0, [r6, 0x8] + mov r1, r8 + strh r1, [r6, 0xA] + mov r0, sp + ldrh r0, [r0] + strh r0, [r6, 0x4] + mov r2, r9 + ldrh r0, [r2] + strh r0, [r6, 0x6] + cmp r7, 0 + beq _0809E0F6 + movs r0, 0x10 + strh r0, [r6, 0xC] + movs r0, 0x2 + strh r0, [r6, 0x2] +_0809E064: + ldrh r0, [r6, 0xC] + subs r0, 0x1 + strh r0, [r6, 0xC] + ldrh r3, [r6, 0x8] + mov r10, r3 + ldrh r0, [r6, 0xA] + mov r8, r0 + movs r1, 0xC + ldrsh r0, [r6, r1] + movs r1, 0x7 + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + bhi _0809E0EA + lsls r0, 2 + ldr r1, =_0809E094 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0809E094: + .4byte _0809E0B4 + .4byte _0809E0EA + .4byte _0809E0EA + .4byte _0809E0EA + .4byte _0809E0C6 + .4byte _0809E0EA + .4byte _0809E0EA + .4byte _0809E0EA +_0809E0B4: + mov r2, r10 + lsls r0, r2, 16 + asrs r0, 16 + mov r3, r8 + lsls r1, r3, 16 + asrs r1, 16 + bl CurrentMapDrawMetatileAt + b _0809E0EA +_0809E0C6: + mov r0, r10 + lsls r5, r0, 16 + asrs r5, 16 + mov r1, r8 + lsls r4, r1, 16 + asrs r4, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_809DE28 + adds r0, r5, 0 + adds r1, r4, 0 + bl CurrentMapDrawMetatileAt + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_809DE8C +_0809E0EA: + movs r2, 0xC + ldrsh r0, [r6, r2] + cmp r0, 0 + bne _0809E0F6 +_0809E0F2: + movs r0, 0x1 + strh r0, [r6, 0x2] +_0809E0F6: + 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 sub_809DEF0 + + thumb_func_start sub_809E108 +sub_809E108: @ 809E108 + push {lr} + lsls r1, 16 + lsrs r1, 16 + lsls r0, 16 + ldr r2, =0xfffd0000 + adds r0, r2 + lsrs r0, 16 + cmp r0, 0xA + bhi _0809E144 + lsls r0, r1, 16 + asrs r1, r0, 16 + ldr r2, =0xfffa0000 + adds r0, r2 + lsrs r0, 16 + cmp r0, 0xD + bhi _0809E144 + ldr r0, =gUnknown_085103C8 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _0809E144 + movs r0, 0x1 + b _0809E146 + .pool +_0809E144: + movs r0, 0 +_0809E146: + pop {r1} + bx r1 + thumb_func_end sub_809E108 + + thumb_func_start sub_809E14C +sub_809E14C: @ 809E14C + push {r4,r5,lr} + lsls r0, 16 + asrs r5, r0, 16 + lsls r1, 16 + asrs r4, r1, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_809E108 + cmp r0, 0 + beq _0809E17A + ldr r1, =gUnknown_085103C8 + lsls r0, r4, 1 + adds r0, r1 + ldrh r0, [r0] + bl GetVarPointer + subs r2, r5, 0x3 + movs r1, 0x1 + lsls r1, r2 + ldrh r2, [r0] + orrs r1, r2 + strh r1, [r0] +_0809E17A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E14C + + thumb_func_start sub_809E184 +sub_809E184: @ 809E184 + push {r4,r5,lr} + lsls r0, 16 + asrs r5, r0, 16 + lsls r1, 16 + asrs r4, r1, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_809E108 + cmp r0, 0 + beq _0809E1B6 + ldr r1, =gUnknown_085103C8 + lsls r0, r4, 1 + adds r0, r1 + ldrh r0, [r0] + bl VarGet + lsls r0, 16 + subs r2, r5, 0x3 + movs r1, 0x80 + lsls r1, 9 + lsls r1, r2 + ands r1, r0 + cmp r1, 0 + bne _0809E1C0 +_0809E1B6: + movs r0, 0 + b _0809E1C2 + .pool +_0809E1C0: + movs r0, 0x1 +_0809E1C2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809E184 + + thumb_func_start sub_809E1C8 +sub_809E1C8: @ 809E1C8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =0x02037318 + ldr r0, [r0] + ldr r1, [r0] + mov r9, r1 + ldr r7, [r0, 0x4] + movs r5, 0 + cmp r5, r9 + bge _0809E210 +_0809E1E0: + movs r4, 0 + adds r0, r5, 0x1 + mov r8, r0 + cmp r4, r7 + bge _0809E20A + lsls r6, r5, 16 +_0809E1EC: + lsls r1, r4, 16 + asrs r1, 16 + asrs r0, r6, 16 + bl sub_809E184 + cmp r0, 0x1 + bne _0809E204 + adds r1, r4, 0x7 + adds r0, r5, 0x7 + ldr r2, =0x0000020e + bl MapGridSetMetatileIdAt +_0809E204: + adds r4, 0x1 + cmp r4, r7 + blt _0809E1EC +_0809E20A: + mov r5, r8 + cmp r5, r9 + blt _0809E1E0 +_0809E210: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E1C8 + + thumb_func_start sub_809E224 +sub_809E224: @ 809E224 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r5, r1, r0 + movs r1, 0x2 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _0809E270 + cmp r0, 0x1 + bgt _0809E24C + cmp r0, 0 + beq _0809E258 + b _0809E3A6 + .pool +_0809E24C: + cmp r0, 0x2 + beq _0809E306 + cmp r0, 0x3 + bne _0809E256 + b _0809E360 +_0809E256: + b _0809E3A6 +_0809E258: + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + mov r0, sp + ldrh r0, [r0] + strh r0, [r5, 0x4] + ldrh r0, [r4] + strh r0, [r5, 0x6] + b _0809E3A2 +_0809E270: + mov r7, sp + adds r7, 0x2 + mov r0, sp + adds r1, r7, 0 + bl PlayerGetDestCoords + mov r0, sp + ldrh r2, [r0] + movs r3, 0 + ldrsh r1, [r0, r3] + movs r3, 0x4 + ldrsh r0, [r5, r3] + cmp r1, r0 + bne _0809E29A + movs r0, 0 + ldrsh r1, [r7, r0] + movs r3, 0x6 + ldrsh r0, [r5, r3] + cmp r1, r0 + bne _0809E29A + b _0809E3A6 +_0809E29A: + strh r2, [r5, 0x4] + ldrh r0, [r7] + strh r0, [r5, 0x6] + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r7, r2] + bl MapGridGetMetatileBehaviorAt + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =0x00004022 + bl GetVarPointer + adds r6, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_8089604 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809E2E0 + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] + movs r0, 0x4 + strh r0, [r5, 0xC] + movs r0, 0x2 + b _0809E2F8 + .pool +_0809E2E0: + adds r0, r4, 0 + bl sub_8089618 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809E3A6 + movs r0, 0 + strh r0, [r6] + movs r0, 0x4 + strh r0, [r5, 0xC] + movs r0, 0x3 +_0809E2F8: + strh r0, [r5, 0x2] + mov r0, sp + ldrh r0, [r0] + strh r0, [r5, 0x8] + ldrh r0, [r7] + strh r0, [r5, 0xA] + b _0809E3A6 +_0809E306: + ldrh r1, [r5, 0xC] + movs r3, 0xC + ldrsh r0, [r5, r3] + cmp r0, 0 + bne _0809E36A + mov r1, sp + ldrh r0, [r5, 0x8] + strh r0, [r1] + mov r4, sp + adds r4, 0x2 + ldrh r0, [r5, 0xA] + strh r0, [r4] + movs r0, 0x2A + bl audio_play + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + ldr r2, =0x0000020e + bl MapGridSetMetatileIdAt + mov r0, sp + movs r3, 0 + ldrsh r0, [r0, r3] + movs r2, 0 + ldrsh r1, [r4, r2] + bl CurrentMapDrawMetatileAt + mov r0, sp + ldrh r0, [r0] + subs r0, 0x7 + lsls r0, 16 + asrs r0, 16 + ldrh r1, [r4] + subs r1, 0x7 + lsls r1, 16 + asrs r1, 16 + bl sub_809E14C + b _0809E3A2 + .pool +_0809E360: + ldrh r1, [r5, 0xC] + movs r3, 0xC + ldrsh r0, [r5, r3] + cmp r0, 0 + beq _0809E370 +_0809E36A: + subs r0, r1, 0x1 + strh r0, [r5, 0xC] + b _0809E3A6 +_0809E370: + mov r1, sp + ldrh r0, [r5, 0x8] + strh r0, [r1] + mov r4, sp + adds r4, 0x2 + ldrh r0, [r5, 0xA] + strh r0, [r4] + movs r0, 0x29 + bl audio_play + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + ldr r2, =0x00000206 + bl MapGridSetMetatileIdAt + mov r0, sp + movs r3, 0 + ldrsh r0, [r0, r3] + movs r2, 0 + ldrsh r1, [r4, r2] + bl CurrentMapDrawMetatileAt +_0809E3A2: + movs r0, 0x1 + strh r0, [r5, 0x2] +_0809E3A6: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E224 + + thumb_func_start sub_809E3B4 +sub_809E3B4: @ 809E3B4 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r5, r1, r0 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + mov r0, sp + ldrh r2, [r0] + movs r3, 0 + ldrsh r1, [r0, r3] + movs r3, 0x2 + ldrsh r0, [r5, r3] + cmp r1, r0 + bne _0809E3EE + movs r0, 0 + ldrsh r1, [r4, r0] + movs r3, 0x4 + ldrsh r0, [r5, r3] + cmp r1, r0 + beq _0809E47A +_0809E3EE: + strh r2, [r5, 0x2] + ldrh r0, [r4] + strh r0, [r5, 0x4] + 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_IsAsh + lsls r0, 24 + cmp r0, 0 + beq _0809E47A + mov r0, sp + movs r3, 0 + ldrsh r0, [r0, r3] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileIdAt + ldr r1, =0x0000020a + cmp r0, r1 + bne _0809E444 + mov r0, sp + movs r3, 0 + ldrsh r0, [r0, r3] + movs r2, 0 + ldrsh r1, [r4, r2] + ldr r2, =0x00000212 + movs r3, 0x4 + bl ash + b _0809E456 + .pool +_0809E444: + mov r0, sp + movs r3, 0 + ldrsh r0, [r0, r3] + movs r2, 0 + ldrsh r1, [r4, r2] + ldr r2, =0x00000206 + movs r3, 0x4 + bl ash +_0809E456: + movs r0, 0x87 + lsls r0, 1 + movs r1, 0x1 + bl sub_80D6724 + lsls r0, 24 + cmp r0, 0 + beq _0809E47A + ldr r0, =0x00004048 + bl GetVarPointer + adds r2, r0, 0 + ldrh r1, [r2] + ldr r0, =0x0000270e + cmp r1, r0 + bhi _0809E47A + adds r0, r1, 0x1 + strh r0, [r2] +_0809E47A: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E3B4 + + thumb_func_start sub_809E490 +sub_809E490: @ 809E490 + push {r4,r5,lr} + lsls r0, 16 + asrs r5, r0, 16 + lsls r1, 16 + asrs r4, r1, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + ldr r1, =0x0000022f + ldr r2, =0x00000237 + cmp r0, r1 + bne _0809E4AC + subs r2, 0x31 +_0809E4AC: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt + adds r0, r5, 0 + adds r1, r4, 0 + bl CurrentMapDrawMetatileAt + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E490 + + thumb_func_start sub_809E4CC +sub_809E4CC: @ 809E4CC + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r5, r1, r0 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 16 + lsrs r6, r0, 16 + ldrh r1, [r5, 0x8] + movs r3, 0x8 + ldrsh r0, [r5, r3] + adds r7, r4, 0 + cmp r0, 0 + beq _0809E51E + subs r0, r1, 0x1 + strh r0, [r5, 0x8] + lsls r0, 16 + cmp r0, 0 + bne _0809E51E + movs r1, 0xA + ldrsh r0, [r5, r1] + movs r2, 0xC + ldrsh r1, [r5, r2] + bl sub_809E490 +_0809E51E: + ldrh r1, [r5, 0xE] + movs r3, 0xE + ldrsh r0, [r5, r3] + cmp r0, 0 + beq _0809E53E + subs r0, r1, 0x1 + strh r0, [r5, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _0809E53E + movs r1, 0x10 + ldrsh r0, [r5, r1] + movs r2, 0x12 + ldrsh r1, [r5, r2] + bl sub_809E490 +_0809E53E: + lsls r0, r6, 24 + lsrs r6, r0, 24 + adds r0, r6, 0 + bl sub_8089918 + lsls r0, 24 + cmp r0, 0 + beq _0809E556 + ldr r0, =0x00004022 + movs r1, 0 + bl VarSet +_0809E556: + mov r0, sp + ldrh r2, [r0] + movs r3, 0 + ldrsh r1, [r0, r3] + movs r3, 0x4 + ldrsh r0, [r5, r3] + cmp r1, r0 + bne _0809E572 + movs r0, 0 + ldrsh r1, [r7, r0] + movs r3, 0x6 + ldrsh r0, [r5, r3] + cmp r1, r0 + beq _0809E5D2 +_0809E572: + strh r2, [r5, 0x4] + adds r4, r7, 0 + ldrh r0, [r4] + strh r0, [r5, 0x6] + adds r0, r6, 0 + bl sub_808992C + lsls r0, 24 + cmp r0, 0 + beq _0809E5D2 + bl sub_811A138 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + beq _0809E59A + ldr r0, =0x00004022 + movs r1, 0 + bl VarSet +_0809E59A: + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0809E5BC + movs r0, 0x3 + strh r0, [r5, 0x8] + mov r0, sp + ldrh r0, [r0] + strh r0, [r5, 0xA] + ldrh r0, [r4] + strh r0, [r5, 0xC] + b _0809E5D2 + .pool +_0809E5BC: + movs r2, 0xE + ldrsh r0, [r5, r2] + cmp r0, 0 + bne _0809E5D2 + movs r0, 0x3 + strh r0, [r5, 0xE] + mov r0, sp + ldrh r0, [r0] + strh r0, [r5, 0x10] + ldrh r0, [r7] + strh r0, [r5, 0x12] +_0809E5D2: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_809E4CC + + thumb_func_start sub_809E5DC +sub_809E5DC: @ 809E5DC + push {r4,r5,lr} + adds r3, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + lsls r2, 16 + lsrs r4, r2, 16 + ldrh r0, [r3] + subs r0, 0x1 + strh r0, [r3] + lsls r0, 16 + cmp r0, 0 + bne _0809E5F8 + movs r2, 0xE8 + b _0809E60C +_0809E5F8: + ldr r1, =gUnknown_085103FC + movs r2, 0 + ldrsh r0, [r3, r2] + cmp r0, 0 + bge _0809E604 + adds r0, 0x7 +_0809E604: + asrs r0, 3 + lsls r0, 1 + adds r0, r1 + ldrh r2, [r0] +_0809E60C: + lsls r5, 16 + asrs r5, 16 + lsls r4, 16 + asrs r4, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt + adds r0, r5, 0 + adds r1, r4, 0 + bl CurrentMapDrawMetatileAt + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0xE8 + bl MapGridSetMetatileIdAt + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E5DC + + thumb_func_start sub_809E638 +sub_809E638: @ 809E638 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r4, r1, r0 + mov r5, sp + adds r5, 0x2 + mov r0, sp + adds r1, r5, 0 + bl PlayerGetDestCoords + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x4 + ldrsb r1, [r0, r1] + lsls r1, 8 + ldrb r0, [r0, 0x5] + lsls r0, 24 + asrs r0, 24 + orrs r0, r1 + lsls r0, 16 + lsrs r7, r0, 16 + movs r0, 0x2 + ldrsh r1, [r4, r0] + mov r8, r5 + cmp r1, 0 + beq _0809E688 + cmp r1, 0x1 + beq _0809E6B4 + b _0809E708 + .pool +_0809E688: + strh r7, [r4] + mov r0, sp + ldrh r0, [r0] + strh r0, [r4, 0x4] + ldrh r0, [r5] + strh r0, [r4, 0x6] + movs r0, 0x1 + strh r0, [r4, 0x2] + strh r1, [r4, 0x8] + strh r1, [r4, 0xE] + strh r1, [r4, 0x14] + strh r1, [r4, 0x1A] + b _0809E708 +_0809E6A2: + movs r0, 0x20 + strh r0, [r1] + mov r0, sp + ldrh r0, [r0] + strh r0, [r1, 0x2] + mov r2, r8 + ldrh r0, [r2] + strh r0, [r1, 0x4] + b _0809E708 +_0809E6B4: + mov r0, sp + movs r3, 0x4 + ldrsh r1, [r4, r3] + ldrh r2, [r0] + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r1, r0 + bne _0809E6D0 + movs r0, 0x6 + ldrsh r1, [r4, r0] + movs r3, 0 + ldrsh r0, [r5, r3] + cmp r1, r0 + beq _0809E708 +_0809E6D0: + strh r2, [r4, 0x4] + ldrh r0, [r5] + strh r0, [r4, 0x6] + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsMuddySlope + lsls r0, 24 + cmp r0, 0 + beq _0809E708 + movs r6, 0x4 + adds r1, r4, 0 + adds r1, 0x8 +_0809E6F8: + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _0809E6A2 + adds r1, 0x6 + adds r6, 0x3 + cmp r6, 0xD + ble _0809E6F8 +_0809E708: + ldr r2, =0x02037334 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0809E728 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r7, r0 + beq _0809E728 + strh r7, [r4] + ldrh r0, [r2, 0x4] + ldrh r1, [r2, 0x8] + b _0809E72C + .pool +_0809E728: + movs r0, 0 + movs r1, 0 +_0809E72C: + lsls r0, 16 + asrs r0, 16 + mov r8, r0 + lsls r0, r1, 16 + asrs r7, r0, 16 + adds r5, r4, 0 + adds r5, 0x8 + adds r4, r5, 0 + movs r6, 0x9 +_0809E73E: + movs r2, 0 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0809E762 + ldrh r0, [r4, 0x2] + mov r3, r8 + subs r0, r3 + strh r0, [r4, 0x2] + ldrh r0, [r4, 0x4] + subs r0, r7 + strh r0, [r4, 0x4] + movs r0, 0x2 + ldrsh r1, [r4, r0] + movs r3, 0x4 + ldrsh r2, [r4, r3] + adds r0, r5, 0 + bl sub_809E5DC +_0809E762: + adds r4, 0x6 + adds r5, 0x6 + subs r6, 0x3 + cmp r6, 0 + bge _0809E73E + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_809E638 + + thumb_func_start sub_809E778 +sub_809E778: @ 809E778 + push {lr} + ldr r0, =0x00000895 + bl FlagSet + bl GameFreakRTC_CalcLocalDateTime + ldr r0, =0x03005d90 + ldr r2, [r0] + adds r2, 0xA0 + ldr r3, =0x03005cf8 + ldr r0, [r3] + ldr r1, [r3, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + ldr r0, =0x00004040 + ldrh r1, [r3] + bl VarSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E778 + + thumb_func_start sub_809E7B0 +sub_809E7B0: @ 809E7B0 + push {r4,lr} + ldr r0, =0x00000895 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0809E7DA + bl sub_813B9C0 + lsls r0, 24 + cmp r0, 0 + bne _0809E7DA + bl GameFreakRTC_CalcLocalDateTime + ldr r4, =0x03005cf8 + adds r0, r4, 0 + bl sub_809E7E8 + adds r0, r4, 0 + bl sub_809E858 +_0809E7DA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E7B0 + + thumb_func_start sub_809E7E8 +sub_809E7E8: @ 809E7E8 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r0, =0x00004040 + bl GetVarPointer + adds r6, r0, 0 + ldrh r0, [r6] + movs r2, 0 + ldrsh r1, [r5, r2] + cmp r0, r1 + beq _0809E84E + cmp r0, r1 + bgt _0809E84E + ldrh r4, [r5] + subs r4, r0 + lsls r4, 16 + lsrs r4, 16 + bl sub_809D3A0 + adds r0, r4, 0 + bl sub_8122580 + adds r0, r4, 0 + bl sub_80ED888 + adds r0, r4, 0 + bl sub_80AEFBC + adds r0, r4, 0 + bl sub_806DE44 + adds r0, r4, 0 + bl sub_8137904 + adds r0, r4, 0 + bl sub_8137A20 + adds r0, r4, 0 + bl sub_8139EF4 + adds r0, r4, 0 + bl sub_813A7F4 + adds r0, r4, 0 + bl sub_813945C + adds r0, r4, 0 + bl sub_8177584 + ldrh r0, [r5] + strh r0, [r6] +_0809E84E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E7E8 + + thumb_func_start sub_809E858 +sub_809E858: @ 809E858 + push {r4-r6,lr} + sub sp, 0x8 + adds r5, r0, 0 + mov r4, sp + ldr r6, =0x03005d90 + ldr r1, [r6] + adds r1, 0xA0 + mov r0, sp + adds r2, r5, 0 + bl GameFreakRTC_GetDelta + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 5 + movs r2, 0x2 + ldrsb r2, [r4, r2] + lsls r0, r2, 4 + subs r0, r2 + lsls r0, 2 + adds r1, r0 + movs r0, 0x3 + ldrsb r0, [r4, r0] + adds r0, r1, r0 + cmp r0, 0 + beq _0809E8A8 + cmp r0, 0 + blt _0809E8A8 + bl BerryTreeTimeUpdate + ldr r2, [r6] + adds r2, 0xA0 + ldr r0, [r5] + ldr r1, [r5, 0x4] + str r0, [r2] + str r1, [r2, 0x4] +_0809E8A8: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E858 + + thumb_func_start sub_809E8B4 +sub_809E8B4: @ 809E8B4 + push {lr} + bl sub_809E778 + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_809E8B4 + + thumb_func_start Special_StartWallClock +Special_StartWallClock: @ 809E8C8 + push {lr} + ldr r0, =Cb2_StartWallClock + bl SetMainCallback2 + ldr r1, =0x030022c0 + ldr r0, =sub_809E8B4 + str r0, [r1, 0x8] + pop {r0} + bx r0 + .pool + thumb_func_end Special_StartWallClock + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_80A18F4.s b/asm/rom_80A3934.s similarity index 72% rename from asm/rom_80A18F4.s rename to asm/rom_80A3934.s index 34a7fb872..6f202cc8c 100644 --- a/asm/rom_80A18F4.s +++ b/asm/rom_80A3934.s @@ -5,4132 +5,6 @@ .text - thumb_func_start decompress_palette -@ void decompress_palette(void *src, u16 offset, u16 size) -decompress_palette: @ 80A18F4 - push {r4-r6,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - ldr r6, =0x02037fe8 - adds r1, r6, 0 - bl LZDecompressWram - lsls r4, 1 - ldr r1, =0x02037714 - adds r1, r4, r1 - lsrs r5, 17 - adds r0, r6, 0 - adds r2, r5, 0 - bl CpuSet - ldr r0, =0x02037b14 - adds r4, r0 - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl CpuSet - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end decompress_palette - - thumb_func_start gpu_pal_apply -@ void gpu_pal_apply(void *src, int dest_offset, int mode) -gpu_pal_apply: @ 80A1938 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsls r5, 16 - lsrs r4, 15 - ldr r1, =0x02037714 - adds r1, r4, r1 - lsrs r5, 17 - adds r2, r5, 0 - bl CpuSet - ldr r0, =0x02037b14 - adds r4, r0 - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl CpuSet - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end gpu_pal_apply - - thumb_func_start rboxid_80040B8 -rboxid_80040B8: @ 80A1970 - push {r4-r6,lr} - sub sp, 0x4 - adds r6, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - lsls r6, 16 - lsrs r6, 16 - lsls r4, 16 - lsls r5, 16 - mov r0, sp - strh r6, [r0] - lsrs r4, 15 - ldr r1, =0x02037714 - adds r1, r4, r1 - lsrs r5, 17 - movs r0, 0x80 - lsls r0, 17 - orrs r5, r0 - mov r0, sp - adds r2, r5, 0 - bl CpuSet - mov r0, sp - adds r0, 0x2 - strh r6, [r0] - ldr r1, =0x02037b14 - adds r4, r1 - adds r1, r4, 0 - adds r2, r5, 0 - bl CpuSet - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end rboxid_80040B8 - - thumb_func_start copy_pal_bg_faded_to_pal_ram -@ void copy_pal_bg_faded_to_pal_ram() -copy_pal_bg_faded_to_pal_ram: @ 80A19C0 - push {r4,r5,lr} - ldr r4, =0x02037fd4 - ldrb r1, [r4, 0x8] - movs r5, 0x80 - adds r0, r5, 0 - ands r0, r1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - bne _080A1A02 - ldr r1, =0x02037b14 - movs r2, 0xA0 - lsls r2, 19 - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x80000200 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - ldr r0, =0x02037fe4 - str r3, [r0] - ldrb r1, [r4, 0x9] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - bne _080A1A02 - ldrb r1, [r4, 0x7] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _080A1A02 - bl sub_80A2968 -_080A1A02: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end copy_pal_bg_faded_to_pal_ram - - thumb_func_start fade_and_return_progress_probably -@ int fade_and_return_progress_probably() -fade_and_return_progress_probably: @ 80A1A1C - push {lr} - ldr r0, =0x02037fe4 - ldr r0, [r0] - cmp r0, 0 - beq _080A1A30 - movs r0, 0xFF - b _080A1A68 - .pool -_080A1A30: - ldr r0, =0x02037fd4 - ldrb r0, [r0, 0x9] - movs r1, 0x3 - ands r1, r0 - cmp r1, 0 - bne _080A1A48 - bl pal_fade__0 - b _080A1A56 - .pool -_080A1A48: - cmp r1, 0x1 - bne _080A1A52 - bl pal_fade__1 - b _080A1A56 -_080A1A52: - bl pal_fade__2 -_080A1A56: - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =0x02037fe4 - ldr r0, =0x02037fd4 - ldr r0, [r0] - movs r1, 0 - orrs r0, r1 - str r0, [r2] - adds r0, r3, 0 -_080A1A68: - pop {r1} - bx r1 - .pool - thumb_func_end fade_and_return_progress_probably - - thumb_func_start sub_80A1A74 -sub_80A1A74: @ 80A1A74 - push {r4,lr} - movs r4, 0 -_080A1A78: - adds r0, r4, 0 - bl palslot_dead_struct_update - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _080A1A78 - bl pal_fade_control_reset_maybe - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A1A74 - - thumb_func_start sub_80A1A94 -sub_80A1A94: @ 80A1A94 - push {r4-r7,lr} - movs r0, 0xA0 - lsls r0, 19 - mov r12, r0 - movs r4, 0 - ldr r7, =0x02037714 - ldr r6, =0x02037b14 - ldr r5, =0x000001ff -_080A1AA4: - lsls r1, r4, 1 - adds r3, r1, r7 - mov r0, r12 - adds r2, r1, r0 - ldrh r0, [r2] - strh r0, [r3] - adds r1, r6 - ldrh r0, [r2] - strh r0, [r1] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r5 - bls _080A1AA4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A1A94 - - thumb_func_start pal_fade_maybe -pal_fade_maybe: @ 80A1AD4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - ldr r0, [sp, 0x18] - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r12, r2 - lsls r3, 24 - lsrs r7, r3, 24 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r5, =0x02037fd4 - ldrb r1, [r5, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080A1B08 - movs r0, 0 - b _080A1C00 - .pool -_080A1B08: - ldrb r0, [r5, 0xA] - movs r3, 0x79 - negs r3, r3 - adds r2, r3, 0 - ands r2, r0 - movs r0, 0x10 - orrs r2, r0 - strb r2, [r5, 0xA] - lsls r0, r6, 24 - asrs r1, r0, 24 - cmp r1, 0 - bge _080A1B36 - lsls r0, r2, 25 - lsrs r0, 28 - negs r1, r1 - adds r0, r1 - movs r1, 0xF - ands r0, r1 - lsls r0, 3 - ands r2, r3 - orrs r2, r0 - strb r2, [r5, 0xA] - movs r6, 0 -_080A1B36: - str r4, [r5] - movs r4, 0x3F - adds r1, r6, 0 - ands r1, r4 - ldrb r2, [r5, 0x4] - movs r3, 0x40 - negs r3, r3 - adds r0, r3, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x4] - ands r6, r4 - ldrb r0, [r5, 0x8] - ands r3, r0 - orrs r3, r6 - strb r3, [r5, 0x8] - movs r0, 0x1F - mov r1, r12 - ands r1, r0 - lsls r1, 6 - ldrh r2, [r5, 0x4] - ldr r0, =0xfffff83f - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x4] - lsls r2, r7, 3 - ldrb r1, [r5, 0x5] - movs r0, 0x7 - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0x5] - ldr r1, =0x00007fff - mov r0, r8 - ands r1, r0 - ldrh r2, [r5, 0x6] - ldr r0, =0xffff8000 - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x6] - ldrb r0, [r5, 0x7] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r5, 0x7] - ldrb r1, [r5, 0x9] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - strb r0, [r5, 0x9] - cmp r12, r7 - bcs _080A1BB0 - movs r0, 0x41 - negs r0, r0 - ands r3, r0 - b _080A1BB4 - .pool -_080A1BB0: - movs r0, 0x40 - orrs r3, r0 -_080A1BB4: - strb r3, [r5, 0x8] - bl fade_and_return_progress_probably - ldr r4, =0x02037fd4 - ldrb r1, [r4, 0x8] - lsrs r5, r1, 7 - movs r0, 0x7F - ands r0, r1 - strb r0, [r4, 0x8] - ldr r0, =0x02037b14 - movs r1, 0xA0 - lsls r1, 19 - ldr r2, =0x04000100 - bl CpuSet - ldr r1, =0x02037fe4 - movs r0, 0 - str r0, [r1] - ldrb r1, [r4, 0x9] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - bne _080A1BF0 - ldrb r1, [r4, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080A1BF0 - bl sub_80A2968 -_080A1BF0: - ldr r2, =0x02037fd4 - lsls r3, r5, 7 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - orrs r0, r3 - strb r0, [r2, 0x8] - movs r0, 0x1 -_080A1C00: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end pal_fade_maybe - - thumb_func_start sub_80A1C1C -sub_80A1C1C: @ 80A1C1C - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x8 - mov r8, r0 - adds r4, r1, 0 - adds r6, r2, 0 - ldr r5, [sp, 0x1C] - lsls r4, 24 - lsrs r4, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r5, 16 - lsrs r5, 16 - str r3, [sp, 0x4] - bl sub_80A1A94 - lsls r4, 24 - asrs r4, 24 - str r5, [sp] - mov r0, r8 - adds r1, r4, 0 - adds r2, r6, 0 - ldr r3, [sp, 0x4] - bl pal_fade_maybe - lsls r0, 24 - lsrs r0, 24 - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80A1C1C - - thumb_func_start sub_80A1C64 -sub_80A1C64: @ 80A1C64 - push {r4-r7,lr} - adds r6, r1, 0 - lsls r0, 24 - lsrs r7, r0, 24 - movs r5, 0 -_080A1C6E: - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - ldr r1, =0x02037f14 - adds r4, r0, r1 - ldrb r0, [r4, 0x4] - lsls r0, 31 - cmp r0, 0 - beq _080A1CCC - ldr r2, [r4] - ldrb r0, [r2, 0x8] - lsls r0, 31 - lsrs r0, 31 - cmp r0, r7 - bne _080A1CCC - ldrh r1, [r4, 0x6] - lsls r1, 20 - lsrs r1, 25 - ldrb r0, [r2, 0xB] - lsls r0, 27 - lsrs r0, 27 - cmp r1, r0 - bne _080A1CAA - adds r0, r4, 0 - bl sub_80A1F00 - ldrb r0, [r4, 0x4] - lsls r0, 31 - cmp r0, 0 - beq _080A1CCC -_080A1CAA: - ldrb r0, [r4, 0x8] - cmp r0, 0 - bne _080A1CC0 - adds r0, r4, 0 - adds r1, r6, 0 - bl sub_80A1CDC - b _080A1CC4 - .pool -_080A1CC0: - subs r0, 0x1 - strb r0, [r4, 0x8] -_080A1CC4: - adds r0, r4, 0 - adds r1, r6, 0 - bl sub_80A1E40 -_080A1CCC: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0xF - bls _080A1C6E - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80A1C64 - - thumb_func_start sub_80A1CDC -sub_80A1CDC: @ 80A1CDC - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - mov r8, r1 - movs r6, 0 - ldrh r1, [r4, 0x6] - lsls r1, 20 - lsrs r1, 25 - ldr r3, [r4] - ldrb r0, [r3, 0x9] - lsls r2, r0, 25 - lsrs r0, r2, 27 - adds r5, r1, 0 - muls r5, r0 - ldrb r1, [r3, 0x8] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080A1D78 - lsrs r0, r2, 27 - cmp r6, r0 - bcs _080A1DC4 - ldr r0, =0x02037714 - mov r12, r0 - ldr r7, =0x02037b14 -_080A1D10: - ldr r0, [r4, 0x4] - lsls r0, 11 - lsrs r0, 22 - lsls r0, 1 - add r0, r12 - ldr r1, [r3, 0x4] - lsls r2, r5, 1 - adds r1, r2, r1 - ldrh r1, [r1] - strh r1, [r0] - ldr r0, [r4, 0x4] - lsls r0, 11 - lsrs r0, 22 - lsls r0, 1 - adds r0, r7 - ldr r1, [r4] - ldr r1, [r1, 0x4] - adds r2, r1 - ldrh r1, [r2] - strh r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, [r4, 0x4] - lsls r1, r2, 11 - lsrs r1, 22 - adds r1, 0x1 - ldr r0, =0x000003ff - ands r1, r0 - lsls r1, 11 - ldr r0, =0xffe007ff - ands r0, r2 - orrs r0, r1 - str r0, [r4, 0x4] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r3, [r4] - ldrb r0, [r3, 0x9] - lsls r0, 25 - lsrs r0, 27 - cmp r6, r0 - bcc _080A1D10 - b _080A1DC4 - .pool -_080A1D78: - lsrs r0, r2, 27 - cmp r6, r0 - bcs _080A1DC4 - ldr r3, =0x02037b14 -_080A1D80: - ldr r1, [r4, 0x4] - lsls r1, 11 - lsrs r1, 22 - lsls r1, 1 - adds r1, r3 - ldr r0, [r4] - ldr r2, [r0, 0x4] - lsls r0, r5, 1 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, [r4, 0x4] - lsls r1, r2, 11 - lsrs r1, 22 - adds r1, 0x1 - ldr r0, =0x000003ff - ands r1, r0 - lsls r1, 11 - ldr r0, =0xffe007ff - ands r0, r2 - orrs r0, r1 - str r0, [r4, 0x4] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, [r4] - ldrb r0, [r0, 0x9] - lsls r0, 25 - lsrs r0, 27 - cmp r6, r0 - bcc _080A1D80 -_080A1DC4: - ldrh r0, [r4, 0x4] - lsls r0, 21 - lsrs r0, 23 - lsls r0, 11 - ldr r1, [r4, 0x4] - ldr r2, =0xffe007ff - ands r1, r2 - orrs r1, r0 - str r1, [r4, 0x4] - ldr r3, [r4] - ldrb r0, [r3, 0xA] - strb r0, [r4, 0x8] - ldrh r2, [r4, 0x6] - lsls r0, r2, 20 - lsrs r0, 25 - adds r0, 0x1 - movs r1, 0x7F - ands r0, r1 - lsls r0, 5 - ldr r5, =0xfffff01f - adds r1, r5, 0 - ands r1, r2 - orrs r1, r0 - strh r1, [r4, 0x6] - lsls r1, 20 - lsrs r1, 25 - ldrb r0, [r3, 0xB] - lsls r0, 27 - lsrs r0, 27 - cmp r1, r0 - blt _080A1E14 - ldrb r0, [r4, 0x9] - cmp r0, 0 - beq _080A1E0C - subs r0, 0x1 - strb r0, [r4, 0x9] -_080A1E0C: - ldrh r1, [r4, 0x6] - adds r0, r5, 0 - ands r0, r1 - strh r0, [r4, 0x6] -_080A1E14: - ldrh r0, [r4, 0x4] - lsls r0, 21 - lsrs r0, 27 - movs r1, 0x1 - lsls r1, r0 - mov r2, r8 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A1CDC - - thumb_func_start sub_80A1E40 -sub_80A1E40: @ 80A1E40 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r3, =0x02037fd4 - ldrb r1, [r3, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080A1EF4 - ldrh r0, [r4, 0x4] - lsls r0, 21 - lsrs r6, r0, 23 - asrs r1, r6, 4 - movs r5, 0x1 - adds r0, r5, 0 - lsls r0, r1 - ldr r1, [r3] - ands r0, r1 - cmp r0, 0 - beq _080A1EF4 - ldr r2, [r4] - ldrb r1, [r2, 0x8] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _080A1E9C - ldrb r1, [r3, 0x4] - lsls r1, 26 - ldrb r0, [r3, 0x8] - lsls r0, 26 - cmp r1, r0 - beq _080A1EF4 - adds r0, r6, 0 - ldrb r1, [r2, 0x9] - lsls r1, 25 - lsrs r1, 27 - ldrh r2, [r3, 0x4] - lsls r2, 21 - lsrs r2, 27 - ldrh r3, [r3, 0x6] - lsls r3, 17 - lsrs r3, 17 - bl pal_fade_1 - b _080A1EF4 - .pool -_080A1E9C: - ldrb r1, [r3, 0x4] - movs r0, 0x3F - ands r0, r1 - cmp r0, 0 - bne _080A1EF4 - ldrb r0, [r4, 0x8] - ldrb r1, [r2, 0xA] - cmp r0, r1 - beq _080A1EF4 - ldrh r0, [r4, 0x6] - lsls r0, 20 - lsrs r0, 25 - ldrb r1, [r2, 0x9] - lsls r1, 25 - lsrs r2, r1, 27 - adds r5, r0, 0 - muls r5, r2 - movs r3, 0 - adds r1, r2, 0 - cmp r3, r1 - bcs _080A1EF4 - ldr r6, =0x02037b14 -_080A1EC8: - ldrh r1, [r4, 0x4] - lsls r1, 21 - lsrs r1, 23 - adds r1, r3 - lsls r1, 1 - adds r1, r6 - ldr r2, [r4] - adds r0, r5, r3 - ldr r2, [r2, 0x4] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, [r4] - ldrb r0, [r0, 0x9] - lsls r0, 25 - lsrs r0, 27 - cmp r3, r0 - bcc _080A1EC8 -_080A1EF4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A1E40 - - thumb_func_start sub_80A1F00 -sub_80A1F00: @ 80A1F00 - push {lr} - adds r3, r0, 0 - ldrb r0, [r3, 0x9] - cmp r0, 0 - bne _080A1F50 - ldr r2, [r3] - ldrb r0, [r2, 0xB] - lsrs r0, 5 - cmp r0, 0 - bne _080A1F40 - ldrh r1, [r3, 0x6] - ldr r0, =0xfffff01f - ands r0, r1 - strh r0, [r3, 0x6] - ldrb r0, [r2, 0xA] - strb r0, [r3, 0x8] - ldrb r0, [r2, 0xC] - strb r0, [r3, 0x9] - ldrh r0, [r3, 0x4] - lsls r0, 21 - lsrs r0, 23 - lsls r0, 11 - ldr r1, [r3, 0x4] - ldr r2, =0xffe007ff - ands r1, r2 - orrs r1, r0 - str r1, [r3, 0x4] - b _080A1F54 - .pool -_080A1F40: - cmp r0, 0 - blt _080A1F54 - cmp r0, 0x2 - bgt _080A1F54 - ldrh r0, [r2] - bl sub_80A1F58 - b _080A1F54 -_080A1F50: - subs r0, 0x1 - strb r0, [r3, 0x9] -_080A1F54: - pop {r0} - bx r0 - thumb_func_end sub_80A1F00 - - thumb_func_start sub_80A1F58 -sub_80A1F58: @ 80A1F58 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl sub_80A20A4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - beq _080A1F6E - bl palslot_dead_struct_update -_080A1F6E: - pop {r0} - bx r0 - thumb_func_end sub_80A1F58 - - thumb_func_start palslot_dead_struct_update -palslot_dead_struct_update: @ 80A1F74 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02037f14 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldr r0, =gUnknown_0852488C - str r0, [r1] - ldrb r2, [r1, 0x4] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x4] - ldrh r2, [r1, 0x4] - ldr r0, =0xfffff803 - ands r0, r2 - strh r0, [r1, 0x4] - ldr r0, [r1, 0x4] - ldr r2, =0xffe007ff - ands r0, r2 - str r0, [r1, 0x4] - ldrh r2, [r1, 0x6] - ldr r0, =0xfffff01f - ands r0, r2 - strh r0, [r1, 0x6] - ldrb r2, [r1, 0x4] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x4] - movs r0, 0 - strb r0, [r1, 0x8] - strb r0, [r1, 0x9] - bx lr - .pool - thumb_func_end palslot_dead_struct_update - - thumb_func_start pal_fade_control_reset_maybe -pal_fade_control_reset_maybe: @ 80A1FD0 - ldr r2, =0x02037fd4 - movs r0, 0 - str r0, [r2] - subs r0, 0x40 - ldrb r1, [r2, 0x4] - ands r0, r1 - strb r0, [r2, 0x4] - ldrh r1, [r2, 0x4] - ldr r0, =0xfffff83f - ands r0, r1 - strh r0, [r2, 0x4] - ldrb r1, [r2, 0x5] - movs r0, 0x7 - ands r0, r1 - strb r0, [r2, 0x5] - ldrh r1, [r2, 0x6] - ldr r0, =0xffff8000 - ands r0, r1 - strh r0, [r2, 0x6] - ldrb r1, [r2, 0x7] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x7] - movs r0, 0 - strb r0, [r2, 0x8] - ldrb r1, [r2, 0x9] - movs r3, 0x5 - negs r3, r3 - adds r0, r3, 0 - ands r0, r1 - movs r1, 0x9 - negs r1, r1 - ands r0, r1 - strb r0, [r2, 0x9] - ldrb r1, [r2, 0xA] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0xA] - ldr r0, [r2, 0x8] - ldr r1, =0xfffe0fff - ands r0, r1 - str r0, [r2, 0x8] - ldrb r0, [r2, 0xA] - ands r3, r0 - movs r0, 0x79 - negs r0, r0 - ands r3, r0 - movs r0, 0x10 - orrs r3, r0 - strb r3, [r2, 0xA] - bx lr - .pool - thumb_func_end pal_fade_control_reset_maybe - - thumb_func_start sub_80A2048 -sub_80A2048: @ 80A2048 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl sub_80A20A4 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x10 - beq _080A206C - ldr r1, =0x02037f14 - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x4] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0, 0x4] -_080A206C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2048 - - thumb_func_start sub_80A2074 -sub_80A2074: @ 80A2074 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl sub_80A20A4 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x10 - beq _080A209A - ldr r0, =0x02037f14 - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x4] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x4] -_080A209A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2074 - - thumb_func_start sub_80A20A4 -sub_80A20A4: @ 80A20A4 - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - movs r1, 0 - ldr r3, =0x02037f14 -_080A20AE: - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldr r0, [r0] - ldrh r0, [r0] - cmp r0, r2 - bne _080A20C8 - adds r0, r1, 0 - b _080A20D4 - .pool -_080A20C8: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bls _080A20AE - movs r0, 0x10 -_080A20D4: - pop {r1} - bx r1 - thumb_func_end sub_80A20A4 - - thumb_func_start pal_fade__0 -pal_fade__0: @ 80A20D8 - push {r4-r7,lr} - ldr r4, =0x02037fd4 - ldrb r1, [r4, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080A20F0 - movs r0, 0 - b _080A220C - .pool -_080A20F0: - bl sub_80A29BC - lsls r0, 24 - cmp r0, 0 - beq _080A20FE - ldrb r0, [r4, 0x7] - b _080A220A -_080A20FE: - ldrb r1, [r4, 0xA] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _080A2132 - ldrb r2, [r4, 0x4] - lsls r1, r2, 26 - ldrb r0, [r4, 0x8] - lsls r0, 26 - cmp r1, r0 - bcs _080A212A - lsrs r0, r1, 26 - adds r0, 0x1 - movs r1, 0x3F - ands r0, r1 - movs r1, 0x40 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0x4] - movs r0, 0x2 - b _080A220C -_080A212A: - movs r0, 0x40 - negs r0, r0 - ands r0, r2 - strb r0, [r4, 0x4] -_080A2132: - movs r5, 0 - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0xA] - movs r0, 0x4 - ands r0, r1 - adds r7, r2, 0 - cmp r0, 0 - bne _080A214C - ldrh r4, [r7] - b _080A2152 - .pool -_080A214C: - ldrh r4, [r7, 0x2] - movs r5, 0x80 - lsls r5, 1 -_080A2152: - cmp r4, 0 - beq _080A2184 - ldr r7, =0x02037fd4 - adds r6, r7, 0 -_080A215A: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _080A2176 - ldrh r2, [r6, 0x4] - lsls r2, 21 - lsrs r2, 27 - ldrh r3, [r6, 0x6] - lsls r3, 17 - lsrs r3, 17 - adds r0, r5, 0 - movs r1, 0x10 - bl pal_fade_1 -_080A2176: - lsrs r4, 1 - adds r0, r5, 0 - adds r0, 0x10 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r4, 0 - bne _080A215A -_080A2184: - ldrb r2, [r7, 0xA] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r4, 0x5 - negs r4, r4 - ands r4, r2 - orrs r4, r1 - strb r4, [r7, 0xA] - movs r0, 0x4 - ands r0, r4 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - bne _080A2208 - ldrh r6, [r7, 0x4] - lsls r2, r6, 21 - ldrb r0, [r7, 0x5] - lsls r5, r0, 24 - lsrs r1, r2, 27 - lsrs r0, r5, 27 - cmp r1, r0 - bne _080A21C4 - str r3, [r7] - movs r0, 0x2 - orrs r4, r0 - strb r4, [r7, 0xA] - b _080A2208 - .pool -_080A21C4: - ldrb r1, [r7, 0x8] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _080A21E0 - lsrs r3, r2, 27 - lsls r0, r4, 25 - lsrs r0, 28 - adds r3, r0, r3 - lsrs r0, r5, 27 - cmp r3, r0 - ble _080A21F6 - adds r3, r0, 0 - b _080A21F6 -_080A21E0: - lsrs r3, r2, 27 - lsls r0, r4, 25 - lsrs r0, 28 - subs r0, r3, r0 - lsls r0, 24 - lsrs r3, r0, 24 - asrs r0, 24 - lsrs r1, r5, 27 - cmp r0, r1 - bge _080A21F6 - adds r3, r1, 0 -_080A21F6: - lsls r0, r3, 24 - asrs r0, 24 - movs r1, 0x1F - ands r0, r1 - lsls r0, 6 - ldr r1, =0xfffff83f - ands r1, r6 - orrs r1, r0 - strh r1, [r7, 0x4] -_080A2208: - ldrb r0, [r7, 0x7] -_080A220A: - lsrs r0, 7 -_080A220C: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end pal_fade__0 - - thumb_func_start sub_80A2218 -sub_80A2218: @ 80A2218 - push {r4-r7,lr} - adds r1, r0, 0 - movs r3, 0 - cmp r1, 0 - beq _080A2256 - ldr r7, =0x02037b14 -_080A2224: - movs r0, 0x1 - ands r0, r1 - lsrs r4, r1, 1 - adds r5, r3, 0 - adds r5, 0x10 - cmp r0, 0 - beq _080A224C - movs r2, 0 - adds r6, r7, 0 -_080A2236: - adds r0, r3, r2 - lsls r0, 1 - adds r0, r6 - ldrh r1, [r0] - mvns r1, r1 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bls _080A2236 -_080A224C: - adds r1, r4, 0 - lsls r0, r5, 16 - lsrs r3, r0, 16 - cmp r1, 0 - bne _080A2224 -_080A2256: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2218 - - thumb_func_start sub_80A2260 -sub_80A2260: @ 80A2260 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x4] - movs r0, 0 - mov r9, r0 - cmp r4, 0 - beq _080A231C - lsls r1, 24 - str r1, [sp, 0x8] -_080A228A: - movs r0, 0x1 - ands r0, r4 - lsrs r4, 1 - str r4, [sp, 0xC] - movs r1, 0x10 - add r1, r9 - mov r10, r1 - cmp r0, 0 - beq _080A230E - movs r4, 0 - ldr r2, =0x02037b14 - mov r8, r2 - ldr r1, [sp] - lsls r0, r1, 24 - ldr r2, [sp, 0x4] - lsls r1, r2, 24 - ldr r2, [sp, 0x8] - asrs r2, 24 - mov r12, r2 - movs r5, 0x1F - asrs r7, r0, 24 - asrs r6, r1, 24 -_080A22B6: - mov r0, r9 - adds r2, r0, r4 - lsls r2, 1 - add r2, r8 - ldr r1, [r2] - lsls r1, 27 - lsrs r1, 27 - add r1, r12 - ands r1, r5 - ldrb r3, [r2] - movs r0, 0x20 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r1, [r2] - lsls r1, 22 - lsrs r1, 27 - adds r1, r7 - movs r0, 0x1F - ands r1, r0 - lsls r1, 5 - ldrh r3, [r2] - ldr r0, =0xfffffc1f - ands r0, r3 - orrs r0, r1 - strh r0, [r2] - ldr r1, [r2] - lsls r1, 17 - lsrs r1, 27 - adds r1, r6 - ands r1, r5 - lsls r1, 2 - ldrb r3, [r2, 0x1] - movs r0, 0x7D - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _080A22B6 -_080A230E: - ldr r4, [sp, 0xC] - mov r1, r10 - lsls r0, r1, 16 - lsrs r0, 16 - mov r9, r0 - cmp r4, 0 - bne _080A228A -_080A231C: - 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_80A2260 - - thumb_func_start sub_80A2334 -sub_80A2334: @ 80A2334 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r1, r0, 0 - movs r3, 0 - cmp r1, 0 - beq _080A237E - ldr r0, =0x02037b14 - mov r8, r0 - ldr r0, =0x02037714 - mov r12, r0 -_080A234A: - movs r0, 0x1 - ands r0, r1 - lsrs r4, r1, 1 - adds r5, r3, 0 - adds r5, 0x10 - cmp r0, 0 - beq _080A2374 - movs r2, 0 - mov r7, r8 - mov r6, r12 -_080A235E: - adds r0, r3, r2 - lsls r0, 1 - adds r1, r0, r7 - adds r0, r6 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bls _080A235E -_080A2374: - adds r1, r4, 0 - lsls r0, r5, 16 - lsrs r3, r0, 16 - cmp r1, 0 - bne _080A234A -_080A237E: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2334 - - thumb_func_start sub_80A2390 -sub_80A2390: @ 80A2390 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x02037fd4 - ldrb r2, [r3, 0xA] - movs r1, 0x79 - negs r1, r1 - ands r1, r2 - movs r2, 0x10 - orrs r1, r2 - strb r1, [r3, 0xA] - bl sub_80A23B4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2390 - - thumb_func_start sub_80A23B4 -sub_80A23B4: @ 80A23B4 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - ldr r2, =0x02037fd4 - ldrh r0, [r2, 0x4] - movs r3, 0xF8 - lsls r3, 3 - adds r1, r3, 0 - orrs r0, r1 - strh r0, [r2, 0x4] - movs r1, 0x3F - ands r1, r4 - ldrb r3, [r2, 0x8] - movs r0, 0x40 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x8] - ldrb r0, [r2, 0x7] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x7] - ldrb r1, [r2, 0x9] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x9] - cmp r4, 0x2 - bne _080A2406 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, =0x02037b14 - ldr r2, =0x01000200 - mov r0, sp - bl CpuSet -_080A2406: - cmp r4, 0 - bne _080A241C - mov r0, sp - adds r0, 0x2 - ldr r2, =0x00007fff - adds r1, r2, 0 - strh r1, [r0] - ldr r1, =0x02037b14 - ldr r2, =0x01000200 - bl CpuSet -_080A241C: - bl fade_and_return_progress_probably - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A23B4 - - thumb_func_start pal_fade__1 -pal_fade__1: @ 80A2438 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r4, =0x02037fd4 - ldrb r1, [r4, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080A2458 - movs r0, 0 - b _080A2792 - .pool -_080A2458: - bl sub_80A29BC - lsls r0, 24 - cmp r0, 0 - beq _080A2466 - ldrb r0, [r4, 0x7] - b _080A2790 -_080A2466: - ldrb r1, [r4, 0xA] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080A247C - movs r2, 0x80 - lsls r2, 1 - movs r0, 0x80 - lsls r0, 2 - mov r10, r0 - b _080A2484 -_080A247C: - movs r2, 0 - movs r1, 0x80 - lsls r1, 1 - mov r10, r1 -_080A2484: - ldr r1, =0x02037fd4 - ldrb r0, [r1, 0x8] - lsls r0, 26 - lsrs r0, 26 - cmp r0, 0x1 - beq _080A2544 - cmp r0, 0x1 - bgt _080A24A0 - cmp r0, 0 - beq _080A24AE - b _080A2694 - .pool -_080A24A0: - cmp r0, 0x2 - bne _080A24A6 - b _080A25A8 -_080A24A6: - cmp r0, 0x3 - bne _080A24AC - b _080A2630 -_080A24AC: - b _080A2694 -_080A24AE: - adds r7, r2, 0 - cmp r7, r10 - bcc _080A24B6 - b _080A2694 -_080A24B6: - lsls r2, r7, 1 - ldr r0, =0x02037714 - adds r0, r2, r0 - ldr r1, [r0] - lsls r3, r1, 27 - lsls r0, r1, 22 - lsrs r0, 27 - mov r12, r0 - lsls r1, 17 - lsrs r1, 27 - mov r8, r1 - ldr r0, =0x02037b14 - adds r2, r0 - mov r9, r2 - ldr r1, [r2] - lsls r2, r1, 27 - lsrs r2, 3 - movs r4, 0xFE - lsls r4, 24 - adds r2, r4 - lsls r0, r1, 22 - lsrs r0, 27 - subs r0, 0x2 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 17 - lsrs r1, 27 - subs r1, 0x2 - lsls r1, 24 - lsrs r4, r1, 24 - lsrs r6, r2, 24 - asrs r2, 24 - lsrs r3, 3 - asrs r0, r3, 24 - cmp r2, r0 - bge _080A2500 - lsrs r6, r3, 24 -_080A2500: - lsls r0, r5, 24 - asrs r0, 24 - mov r2, r12 - lsls r1, r2, 24 - cmp r0, r12 - bge _080A250E - lsrs r5, r1, 24 -_080A250E: - lsls r0, r4, 24 - asrs r0, 24 - mov r3, r8 - lsls r1, r3, 24 - cmp r0, r8 - bge _080A251C - lsrs r4, r1, 24 -_080A251C: - lsls r1, r6, 24 - asrs r1, 24 - lsls r0, r5, 24 - asrs r0, 19 - orrs r1, r0 - lsls r0, r4, 24 - asrs r0, 14 - orrs r1, r0 - mov r4, r9 - strh r1, [r4] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, r10 - bcc _080A24B6 - b _080A2694 - .pool -_080A2544: - adds r7, r2, 0 - cmp r7, r10 - bcc _080A254C - b _080A2694 -_080A254C: - lsls r1, r7, 1 - ldr r0, =0x02037b14 - adds r2, r1, r0 - ldr r1, [r2] - lsls r0, r1, 27 - lsrs r0, 3 - movs r3, 0x80 - lsls r3, 18 - adds r0, r3 - lsrs r6, r0, 24 - lsls r0, r1, 22 - lsrs r0, 27 - adds r5, r0, 0x2 - lsls r1, 17 - lsrs r1, 27 - adds r4, r1, 0x2 - cmp r6, 0x1F - ble _080A2572 - movs r6, 0x1F -_080A2572: - lsls r0, r5, 24 - asrs r0, 24 - cmp r0, 0x1F - ble _080A257C - movs r5, 0x1F -_080A257C: - lsls r0, r4, 24 - asrs r0, 24 - cmp r0, 0x1F - ble _080A2586 - movs r4, 0x1F -_080A2586: - lsls r1, r6, 24 - asrs r1, 24 - lsls r0, r5, 24 - asrs r0, 19 - orrs r1, r0 - lsls r0, r4, 24 - asrs r0, 14 - orrs r1, r0 - strh r1, [r2] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, r10 - bcc _080A254C - b _080A2694 - .pool -_080A25A8: - adds r7, r2, 0 - cmp r7, r10 - bcs _080A2694 -_080A25AE: - lsls r2, r7, 1 - ldr r0, =0x02037714 - adds r0, r2, r0 - ldr r1, [r0] - lsls r3, r1, 27 - lsls r0, r1, 22 - lsrs r0, 27 - mov r12, r0 - lsls r1, 17 - lsrs r1, 27 - mov r8, r1 - ldr r0, =0x02037b14 - adds r2, r0 - ldr r1, [r2] - lsls r0, r1, 27 - lsrs r0, 3 - movs r4, 0x80 - lsls r4, 18 - adds r0, r4 - lsrs r6, r0, 24 - lsls r0, r1, 22 - lsrs r0, 27 - adds r5, r0, 0x2 - lsls r1, 17 - lsrs r1, 27 - adds r4, r1, 0x2 - lsrs r3, 3 - asrs r0, r3, 24 - cmp r6, r0 - ble _080A25EC - lsrs r6, r3, 24 -_080A25EC: - lsls r0, r5, 24 - asrs r0, 24 - mov r3, r12 - lsls r1, r3, 24 - cmp r0, r12 - ble _080A25FA - lsrs r5, r1, 24 -_080A25FA: - lsls r0, r4, 24 - asrs r0, 24 - mov r3, r8 - lsls r1, r3, 24 - cmp r0, r8 - ble _080A2608 - lsrs r4, r1, 24 -_080A2608: - lsls r1, r6, 24 - asrs r1, 24 - lsls r0, r5, 24 - asrs r0, 19 - orrs r1, r0 - lsls r0, r4, 24 - asrs r0, 14 - orrs r1, r0 - strh r1, [r2] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, r10 - bcc _080A25AE - b _080A2694 - .pool -_080A2630: - adds r7, r2, 0 - cmp r7, r10 - bcs _080A2694 - ldr r4, =0x02037b14 - mov r8, r4 -_080A263A: - lsls r0, r7, 1 - mov r1, r8 - adds r3, r0, r1 - ldr r1, [r3] - lsls r2, r1, 27 - lsrs r2, 3 - movs r4, 0xFE - lsls r4, 24 - adds r2, r4 - lsls r0, r1, 22 - lsrs r0, 27 - subs r0, 0x2 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 17 - lsrs r1, 27 - subs r1, 0x2 - lsls r1, 24 - lsrs r4, r1, 24 - lsrs r6, r2, 24 - cmp r2, 0 - bge _080A2668 - movs r6, 0 -_080A2668: - lsls r0, r5, 24 - cmp r0, 0 - bge _080A2670 - movs r5, 0 -_080A2670: - lsls r0, r4, 24 - cmp r0, 0 - bge _080A2678 - movs r4, 0 -_080A2678: - lsls r1, r6, 24 - asrs r1, 24 - lsls r0, r5, 24 - asrs r0, 19 - orrs r1, r0 - lsls r0, r4, 24 - asrs r0, 14 - orrs r1, r0 - strh r1, [r3] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, r10 - bcc _080A263A -_080A2694: - ldr r0, =0x02037fd4 - ldrb r2, [r0, 0xA] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r3, 0x5 - negs r3, r3 - ands r3, r2 - orrs r3, r1 - ldr r1, =0x02037fd4 - strb r3, [r1, 0xA] - movs r0, 0x4 - ands r0, r3 - cmp r0, 0 - beq _080A26C4 - ldrb r0, [r1, 0x7] - b _080A2790 - .pool -_080A26C4: - ldr r2, =0x02037fd4 - ldrh r4, [r2, 0x4] - lsls r5, r4, 21 - lsrs r0, r5, 27 - lsls r2, r3, 25 - lsrs r1, r2, 28 - subs r0, r1 - cmp r0, 0 - bge _080A26E8 - ldr r0, =0xfffff83f - ands r0, r4 - ldr r3, =0x02037fd4 - strh r0, [r3, 0x4] - b _080A26FE - .pool -_080A26E8: - lsrs r1, r5, 27 - lsrs r0, r2, 28 - subs r1, r0 - movs r0, 0x1F - ands r1, r0 - lsls r1, 6 - ldr r0, =0xfffff83f - ands r0, r4 - orrs r0, r1 - ldr r4, =0x02037fd4 - strh r0, [r4, 0x4] -_080A26FE: - ldr r1, =0x02037fd4 - ldrh r0, [r1, 0x4] - movs r1, 0xF8 - lsls r1, 3 - ands r1, r0 - cmp r1, 0 - bne _080A278C - ldr r2, =0x02037fd4 - ldrb r0, [r2, 0x8] - lsls r0, 26 - lsrs r0, 26 - cmp r0, 0x1 - beq _080A2750 - cmp r0, 0x1 - bgt _080A272C - cmp r0, 0 - beq _080A2736 - b _080A2778 - .pool -_080A272C: - cmp r0, 0x2 - beq _080A2736 - cmp r0, 0x3 - beq _080A276C - b _080A2778 -_080A2736: - ldr r0, =0x02037714 - ldr r1, =0x02037b14 - ldr r2, =0x04000100 - bl CpuSet - b _080A2778 - .pool -_080A2750: - movs r0, 0x1 - negs r0, r0 - str r0, [sp] - ldr r1, =0x02037b14 - ldr r2, =0x05000100 - mov r0, sp - bl CpuSet - b _080A2778 - .pool -_080A276C: - str r1, [sp, 0x4] - add r0, sp, 0x4 - ldr r1, =0x02037b14 - ldr r2, =0x05000100 - bl CpuSet -_080A2778: - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x9] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x9] - ldrb r0, [r2, 0xA] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2, 0xA] -_080A278C: - ldr r3, =0x02037fd4 - ldrb r0, [r3, 0x7] -_080A2790: - lsrs r0, 7 -_080A2792: - 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 pal_fade__1 - - thumb_func_start sub_80A27B0 -sub_80A27B0: @ 80A27B0 - push {r4-r7,lr} - ldr r5, [sp, 0x14] - 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 r5, 24 - lsrs r5, 24 - ldr r7, =0x02037fd4 - str r0, [r7] - movs r0, 0x3F - ands r1, r0 - ldrb r4, [r7, 0x4] - movs r6, 0x40 - negs r6, r6 - adds r0, r6, 0 - ands r0, r4 - orrs r0, r1 - strb r0, [r7, 0x4] - ldrb r0, [r7, 0x8] - ands r6, r0 - orrs r6, r1 - strb r6, [r7, 0x8] - movs r0, 0x1F - adds r1, r2, 0 - ands r1, r0 - lsls r1, 6 - ldrh r4, [r7, 0x4] - ldr r0, =0xfffff83f - ands r0, r4 - orrs r0, r1 - strh r0, [r7, 0x4] - lsls r4, r3, 3 - ldrb r1, [r7, 0x5] - movs r0, 0x7 - ands r0, r1 - orrs r0, r4 - strb r0, [r7, 0x5] - ldrb r0, [r7, 0x7] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r7, 0x7] - ldrb r1, [r7, 0x9] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - movs r1, 0x1 - ands r5, r1 - lsls r5, 2 - subs r1, 0x6 - ands r0, r1 - orrs r0, r5 - subs r1, 0x4 - ands r0, r1 - strb r0, [r7, 0x9] - cmp r2, r3 - bcs _080A2840 - movs r0, 0x41 - negs r0, r0 - ands r6, r0 - b _080A2844 - .pool -_080A2840: - movs r0, 0x40 - orrs r6, r0 -_080A2844: - strb r6, [r7, 0x8] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80A27B0 - - thumb_func_start pal_fade__2 -pal_fade__2: @ 80A284C - push {r4-r7,lr} - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x7] - movs r0, 0x80 - ands r0, r1 - adds r4, r2, 0 - cmp r0, 0 - bne _080A2864 - movs r0, 0 - b _080A295C - .pool -_080A2864: - ldrb r2, [r4, 0x4] - lsls r1, r2, 26 - ldrb r3, [r4, 0x8] - lsls r0, r3, 26 - cmp r1, r0 - bcs _080A2886 - lsrs r0, r1, 26 - adds r0, 0x1 - movs r1, 0x3F - ands r0, r1 - movs r1, 0x40 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0x4] - movs r0, 0x2 - b _080A295C -_080A2886: - movs r0, 0x40 - negs r0, r0 - ands r0, r2 - strb r0, [r4, 0x4] - movs r0, 0x40 - ands r0, r3 - cmp r0, 0 - bne _080A28E4 - ldrh r1, [r4, 0x4] - lsls r0, r1, 21 - lsrs r0, 27 - adds r0, 0x1 - movs r7, 0x1F - ands r0, r7 - lsls r0, 6 - ldr r6, =0xfffff83f - adds r3, r6, 0 - ands r3, r1 - orrs r3, r0 - strh r3, [r4, 0x4] - lsls r5, r3, 21 - ldrb r0, [r4, 0x5] - lsrs r1, r5, 27 - lsrs r0, 3 - cmp r1, r0 - bls _080A2930 - ldrb r2, [r4, 0x9] - lsls r1, r2, 28 - lsrs r1, 31 - adds r1, 0x1 - movs r0, 0x1 - ands r1, r0 - lsls r1, 3 - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x9] - lsrs r0, r5, 27 - subs r0, 0x1 - ands r0, r7 - lsls r0, 6 - ands r3, r6 - b _080A292C - .pool -_080A28E4: - ldrh r2, [r4, 0x4] - lsls r1, r2, 21 - lsrs r0, r1, 27 - subs r0, 0x1 - movs r6, 0x1F - ands r0, r6 - lsls r0, 6 - ldr r5, =0xfffff83f - adds r3, r5, 0 - ands r3, r2 - orrs r3, r0 - strh r3, [r4, 0x4] - lsrs r1, 27 - subs r1, 0x1 - ldrb r0, [r4, 0x5] - lsrs r0, 3 - cmp r1, r0 - bge _080A2930 - ldrb r2, [r4, 0x9] - lsls r1, r2, 28 - lsrs r1, 31 - adds r1, 0x1 - movs r0, 0x1 - ands r1, r0 - lsls r1, 3 - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x9] - lsls r0, r3, 21 - lsrs r0, 27 - adds r0, 0x1 - ands r0, r6 - lsls r0, 6 - ands r3, r5 -_080A292C: - orrs r3, r0 - strh r3, [r4, 0x4] -_080A2930: - ldrb r1, [r4, 0x9] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _080A2958 - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080A294E - movs r0, 0 - str r0, [r4] - ldrh r1, [r4, 0x4] - ldr r0, =0xfffff83f - ands r0, r1 - strh r0, [r4, 0x4] -_080A294E: - ldrb r1, [r4, 0x9] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x9] -_080A2958: - ldrb r0, [r4, 0x7] - lsrs r0, 7 -_080A295C: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end pal_fade__2 - - thumb_func_start sub_80A2968 -sub_80A2968: @ 80A2968 - push {r4,lr} - ldr r4, =0x02037fd4 - ldrh r1, [r4] - movs r0, 0x50 - bl SetGpuReg - ldrh r1, [r4, 0x4] - lsls r1, 21 - lsrs r1, 27 - movs r0, 0x54 - bl SetGpuReg - ldrb r1, [r4, 0x9] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _080A29AC - movs r0, 0x9 - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - negs r1, r1 - ands r0, r1 - strb r0, [r4, 0x9] - movs r0, 0 - str r0, [r4] - ldrh r1, [r4, 0x4] - ldr r0, =0xfffff83f - ands r0, r1 - strh r0, [r4, 0x4] - ldrb r1, [r4, 0x7] - movs r0, 0x7F - ands r0, r1 - strb r0, [r4, 0x7] -_080A29AC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2968 - - thumb_func_start sub_80A29BC -sub_80A29BC: @ 80A29BC - push {r4,lr} - ldr r3, =0x02037fd4 - ldrb r4, [r3, 0xA] - movs r0, 0x2 - ands r0, r4 - cmp r0, 0 - beq _080A2A18 - ldr r2, [r3, 0x8] - movs r0, 0xF8 - lsls r0, 9 - ands r0, r2 - movs r1, 0x80 - lsls r1, 7 - cmp r0, r1 - bne _080A29FC - ldrb r1, [r3, 0x7] - movs r0, 0x7F - ands r0, r1 - strb r0, [r3, 0x7] - movs r0, 0x3 - negs r0, r0 - ands r0, r4 - strb r0, [r3, 0xA] - ldr r0, [r3, 0x8] - ldr r1, =0xfffe0fff - ands r0, r1 - str r0, [r3, 0x8] - b _080A2A10 - .pool -_080A29FC: - lsls r0, r2, 15 - lsrs r0, 27 - adds r0, 0x1 - movs r1, 0x1F - ands r0, r1 - lsls r0, 12 - ldr r1, =0xfffe0fff - ands r1, r2 - orrs r1, r0 - str r1, [r3, 0x8] -_080A2A10: - movs r0, 0x1 - b _080A2A1A - .pool -_080A2A18: - movs r0, 0 -_080A2A1A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80A29BC - - thumb_func_start sub_80A2A20 -sub_80A2A20: @ 80A2A20 - push {r4-r7,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 16 - lsrs r6, r2, 16 - movs r5, 0 - cmp r4, 0 - beq _080A2A54 -_080A2A32: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _080A2A46 - adds r0, r5, 0 - movs r1, 0x10 - adds r2, r7, 0 - adds r3, r6, 0 - bl pal_fade_1 -_080A2A46: - lsrs r4, 1 - adds r0, r5, 0 - adds r0, 0x10 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r4, 0 - bne _080A2A32 -_080A2A54: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80A2A20 - - thumb_func_start sub_80A2A5C -sub_80A2A5C: @ 80A2A5C - push {r4,r5,lr} - lsls r1, 24 - lsrs r1, 24 - lsls r2, 16 - lsrs r2, 16 - ldr r4, =0x02037714 - ldr r5, =0x02037b14 - ldr r3, =0x040000d4 - str r4, [r3] - str r5, [r3, 0x4] - ldr r4, =0x84000100 - str r4, [r3, 0x8] - ldr r3, [r3, 0x8] - bl sub_80A2A20 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2A5C - - thumb_func_start TintPalette_GrayScale -TintPalette_GrayScale: @ 80A2A90 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0 - beq _080A2AD8 - movs r6, 0x1F - adds r5, r1, 0 -_080A2AA0: - ldrh r1, [r4] - movs r2, 0x1F - ands r2, r1 - lsls r1, 16 - lsrs r3, r1, 21 - ands r3, r6 - lsrs r1, 26 - ands r1, r6 - movs r0, 0x4C - muls r2, r0 - movs r0, 0x97 - muls r0, r3 - adds r2, r0 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r1 - adds r2, r0 - asrs r2, 8 - lsls r0, r2, 10 - lsls r1, r2, 5 - orrs r0, r1 - orrs r0, r2 - strh r0, [r4] - adds r4, 0x2 - subs r5, 0x1 - cmp r5, 0 - bne _080A2AA0 -_080A2AD8: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end TintPalette_GrayScale - - thumb_func_start sub_80A2AE0 -sub_80A2AE0: @ 80A2AE0 - push {r4-r7,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0 - beq _080A2B34 - movs r6, 0x1F - ldr r7, =gUnknown_0852489C - adds r5, r1, 0 -_080A2AF2: - ldrh r1, [r4] - movs r2, 0x1F - ands r2, r1 - lsls r1, 16 - lsrs r3, r1, 21 - ands r3, r6 - lsrs r1, 26 - ands r1, r6 - movs r0, 0x4C - muls r2, r0 - movs r0, 0x97 - muls r0, r3 - adds r2, r0 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r1 - adds r2, r0 - asrs r2, 8 - cmp r2, 0x1F - bls _080A2B1E - movs r2, 0x1F -_080A2B1E: - adds r0, r2, r7 - ldrb r2, [r0] - lsls r0, r2, 10 - lsls r1, r2, 5 - orrs r0, r1 - orrs r0, r2 - strh r0, [r4] - adds r4, 0x2 - subs r5, 0x1 - cmp r5, 0 - bne _080A2AF2 -_080A2B34: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2AE0 - - thumb_func_start TintPalette_SepiaTone -TintPalette_SepiaTone: @ 80A2B40 - push {r4-r7,lr} - adds r5, r0, 0 - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0 - beq _080A2BA2 - movs r7, 0x1F - adds r6, r1, 0 -_080A2B50: - ldrh r0, [r5] - movs r1, 0x1F - ands r1, r0 - lsls r0, 16 - lsrs r2, r0, 21 - ands r2, r7 - lsrs r3, r0, 26 - ands r3, r7 - movs r0, 0x4C - muls r1, r0 - movs r0, 0x97 - muls r0, r2 - adds r1, r0 - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r3 - adds r1, r0 - asrs r1, 8 - ldr r0, =0x00000133 - muls r0, r1 - lsls r0, 16 - lsrs r2, r0, 24 - lsls r0, r1, 24 - lsrs r4, r0, 24 - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 20 - lsrs r3, r0, 24 - cmp r2, 0x1F - ble _080A2B90 - movs r2, 0x1F -_080A2B90: - lsls r0, r3, 10 - lsls r1, r4, 5 - orrs r0, r1 - orrs r0, r2 - strh r0, [r5] - adds r5, 0x2 - subs r6, 0x1 - cmp r6, 0 - bne _080A2B50 -_080A2BA2: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end TintPalette_SepiaTone - - thumb_func_start sub_80A2BAC -sub_80A2BAC: @ 80A2BAC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r5, r0, 0 - ldr r0, [sp, 0x1C] - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - mov r9, r2 - lsls r3, 16 - lsrs r3, 16 - mov r8, r3 - lsls r0, 16 - lsrs r0, 16 - mov r12, r0 - cmp r1, 0 - beq _080A2C38 - movs r7, 0x1F - adds r6, r1, 0 -_080A2BD6: - ldrh r0, [r5] - movs r1, 0x1F - ands r1, r0 - lsls r0, 16 - lsrs r2, r0, 21 - ands r2, r7 - lsrs r3, r0, 26 - ands r3, r7 - movs r0, 0x4C - muls r1, r0 - movs r0, 0x97 - muls r0, r2 - adds r1, r0 - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r3 - adds r1, r0 - asrs r1, 8 - mov r0, r9 - muls r0, r1 - lsls r0, 16 - lsrs r4, r0, 24 - mov r0, r8 - muls r0, r1 - lsls r0, 16 - lsrs r2, r0, 24 - mov r0, r12 - muls r0, r1 - lsls r0, 16 - lsrs r3, r0, 24 - cmp r4, 0x1F - ble _080A2C1A - movs r4, 0x1F -_080A2C1A: - cmp r2, 0x1F - ble _080A2C20 - movs r2, 0x1F -_080A2C20: - cmp r3, 0x1F - ble _080A2C26 - movs r3, 0x1F -_080A2C26: - lsls r0, r3, 10 - lsls r1, r2, 5 - orrs r0, r1 - orrs r0, r4 - strh r0, [r5] - adds r5, 0x2 - subs r6, 0x1 - cmp r6, 0 - bne _080A2BD6 -_080A2C38: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80A2BAC - - thumb_func_start sub_80A2C44 -sub_80A2C44: @ 80A2C44 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r10, r0 - adds r4, r1, 0 - ldr r0, [sp, 0x20] - ldr r1, [sp, 0x24] - ldr r5, [sp, 0x28] - lsls r4, 24 - lsrs r4, 24 - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r6, r3, 24 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - lsls r1, 24 - lsrs r1, 24 - lsls r5, 24 - lsrs r5, 24 - mov r8, r5 - ldr r0, =sub_80A2D54 - bl CreateTask - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r1, r0, r1 - strh r7, [r1, 0x8] - strh r6, [r1, 0xA] - lsls r4, 24 - asrs r4, 24 - cmp r4, 0 - blt _080A2CA4 - strh r4, [r1, 0xE] - movs r0, 0x1 - b _080A2CAC - .pool -_080A2CA4: - movs r0, 0 - strh r0, [r1, 0xE] - negs r0, r4 - adds r0, 0x1 -_080A2CAC: - strh r0, [r1, 0xC] - lsls r4, r5, 2 - cmp r6, r7 - bcs _080A2CC4 - ldr r0, =0x03005e00 - adds r1, r4, r5 - lsls r1, 3 - adds r1, r0 - movs r2, 0xC - ldrsh r0, [r1, r2] - negs r0, r0 - strh r0, [r1, 0xC] -_080A2CC4: - adds r0, r5, 0 - movs r1, 0x5 - mov r2, r10 - bl SetWordTaskArg - ldr r0, =0x03005e00 - adds r1, r4, r5 - lsls r1, 3 - adds r1, r0 - mov r0, r9 - strh r0, [r1, 0x16] - mov r2, r8 - strh r2, [r1, 0x18] - ldr r1, [r1] - adds r0, r5, 0 - bl _call_via_r1 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2C44 - - thumb_func_start sub_80A2CF8 -sub_80A2CF8: @ 80A2CF8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r3, r0, 24 - movs r2, 0 - ldr r4, =sub_80A2D54 - ldr r1, =0x03005e00 -_080A2D04: - ldrb r0, [r1, 0x4] - cmp r0, 0x1 - bne _080A2D24 - ldr r0, [r1] - cmp r0, r4 - bne _080A2D24 - movs r5, 0x18 - ldrsh r0, [r1, r5] - cmp r0, r3 - bne _080A2D24 - movs r0, 0x1 - b _080A2D2E - .pool -_080A2D24: - adds r1, 0x28 - adds r2, 0x1 - cmp r2, 0xF - ble _080A2D04 - movs r0, 0 -_080A2D2E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80A2CF8 - - thumb_func_start sub_80A2D34 -sub_80A2D34: @ 80A2D34 - push {lr} - b _080A2D3C -_080A2D38: - bl DestroyTask -_080A2D3C: - ldr r0, =sub_80A2D54 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _080A2D38 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2D34 - - thumb_func_start sub_80A2D54 -sub_80A2D54: @ 80A2D54 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - adds r0, r5, 0 - movs r1, 0x5 - bl GetWordTaskArg - adds r3, r0, 0 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x6 - ldrsh r1, [r4, r2] - cmp r0, r1 - ble _080A2DCC - movs r0, 0 - strh r0, [r4, 0x8] - ldrb r1, [r4] - ldrh r2, [r4, 0xE] - adds r0, r3, 0 - bl sub_80A2A20 - ldrh r1, [r4] - movs r6, 0 - ldrsh r0, [r4, r6] - ldrh r3, [r4, 0x2] - movs r6, 0x2 - ldrsh r2, [r4, r6] - cmp r0, r2 - bne _080A2DAC - adds r0, r5, 0 - bl DestroyTask - b _080A2DCC - .pool -_080A2DAC: - ldrh r0, [r4, 0x4] - adds r1, r0 - strh r1, [r4] - lsls r0, 16 - cmp r0, 0 - blt _080A2DC2 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, r2 - blt _080A2DCC - b _080A2DCA -_080A2DC2: - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, r2 - bgt _080A2DCC -_080A2DCA: - strh r3, [r4] -_080A2DCC: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80A2D54 - - thumb_func_start sound_sources_off -sound_sources_off: @ 80A2DD4 - push {lr} - ldr r1, =0x03005df8 - movs r0, 0 - strb r0, [r1] - bl map_music_set_to_zero - pop {r0} - bx r0 - .pool - thumb_func_end sound_sources_off - - thumb_func_start sound_something -sound_something: @ 80A2DE8 - push {r4,r5,lr} - ldr r0, =0x03000f4c - ldrb r1, [r0] - adds r2, r0, 0 - cmp r1, 0x7 - bhi _080A2ECA - lsls r0, r1, 2 - ldr r1, =_080A2E08 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080A2E08: - .4byte _080A2ECA - .4byte _080A2E28 - .4byte _080A2ECA - .4byte _080A2ECA - .4byte _080A2ECA - .4byte _080A2E3C - .4byte _080A2E5C - .4byte _080A2E98 -_080A2E28: - movs r0, 0x2 - strb r0, [r2] - ldr r0, =0x03000f48 - ldrh r0, [r0] - bl song_play_for_text - b _080A2ECA - .pool -_080A2E3C: - bl sub_80A3258 - lsls r0, 24 - cmp r0, 0 - beq _080A2ECA - ldr r0, =0x03000f4a - movs r1, 0 - strh r1, [r0] - ldr r0, =0x03000f4c - strb r1, [r0] - b _080A2ECA - .pool -_080A2E5C: - bl sub_80A3258 - lsls r0, 24 - cmp r0, 0 - beq _080A2ECA - bl task_is_not_running_overworld_fanfare - lsls r0, 24 - cmp r0, 0 - beq _080A2ECA - ldr r2, =0x03000f48 - ldr r1, =0x03000f4a - ldrh r0, [r1] - strh r0, [r2] - movs r0, 0 - strh r0, [r1] - ldr r1, =0x03000f4c - movs r0, 0x2 - strb r0, [r1] - ldrh r0, [r2] - bl song_play_for_text - b _080A2ECA - .pool -_080A2E98: - bl sub_80A3258 - lsls r0, 24 - cmp r0, 0 - beq _080A2ECA - bl task_is_not_running_overworld_fanfare - lsls r0, 24 - cmp r0, 0 - beq _080A2ECA - ldr r4, =0x03000f4a - ldrh r0, [r4] - ldr r5, =0x03000f4d - ldrb r1, [r5] - bl sub_80A3194 - ldr r1, =0x03000f48 - ldrh r0, [r4] - strh r0, [r1] - movs r2, 0 - strh r2, [r4] - ldr r1, =0x03000f4c - movs r0, 0x2 - strb r0, [r1] - strb r2, [r5] -_080A2ECA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sound_something - - thumb_func_start map_music_set_to_zero -map_music_set_to_zero: @ 80A2EE0 - ldr r0, =0x03000f48 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x03000f4a - strh r1, [r0] - ldr r0, =0x03000f4c - strb r1, [r0] - ldr r0, =0x03000f4d - strb r1, [r0] - bx lr - .pool - thumb_func_end map_music_set_to_zero - - thumb_func_start current_map_music_get -current_map_music_get: @ 80A2F04 - ldr r0, =0x03000f48 - ldrh r0, [r0] - bx lr - .pool - thumb_func_end current_map_music_get - - thumb_func_start current_map_music_set -current_map_music_set: @ 80A2F10 - ldr r1, =0x03000f48 - strh r0, [r1] - ldr r1, =0x03000f4a - movs r0, 0 - strh r0, [r1] - ldr r1, =0x03000f4c - movs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end current_map_music_set - - thumb_func_start sub_80A2F30 -sub_80A2F30: @ 80A2F30 - ldr r0, =0x03000f48 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x03000f4a - strh r1, [r0] - ldr r1, =0x03000f4c - movs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_80A2F30 - - thumb_func_start sub_80A2F50 -sub_80A2F50: @ 80A2F50 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A303C - lsls r0, 24 - cmp r0, 0 - beq _080A2F66 - adds r0, r4, 0 - bl play_sound_effect -_080A2F66: - ldr r0, =0x03000f48 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x03000f4a - strh r1, [r0] - ldr r1, =0x03000f4c - movs r0, 0x5 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2F50 - - thumb_func_start sub_80A2F88 -sub_80A2F88: @ 80A2F88 - push {r4,lr} - adds r4, r0, 0 - adds r0, r1, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r0, 24 - lsrs r0, 24 - bl sub_80A2F50 - ldr r1, =0x03000f48 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x03000f4a - strh r4, [r0] - ldr r1, =0x03000f4c - movs r0, 0x6 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2F88 - - thumb_func_start sub_80A2FBC -sub_80A2FBC: @ 80A2FBC - push {r4,r5,lr} - adds r4, r0, 0 - adds r0, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r0, 24 - lsrs r0, 24 - lsls r5, 24 - lsrs r5, 24 - bl sub_80A2F50 - ldr r1, =0x03000f48 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x03000f4a - strh r4, [r0] - ldr r1, =0x03000f4c - movs r0, 0x7 - strb r0, [r1] - ldr r0, =0x03000f4d - strb r5, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A2FBC - - thumb_func_start sub_80A3000 -sub_80A3000: @ 80A3000 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_80A3194 - ldr r0, =0x03000f48 - strh r4, [r0] - ldr r0, =0x03000f4a - movs r2, 0 - strh r2, [r0] - ldr r1, =0x03000f4c - movs r0, 0x2 - strb r0, [r1] - ldr r0, =0x03000f4d - strb r2, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3000 - - thumb_func_start sub_80A303C -sub_80A303C: @ 80A303C - push {lr} - ldr r0, =0x03000f4c - ldrb r0, [r0] - cmp r0, 0x6 - beq _080A3058 - cmp r0, 0x5 - beq _080A3058 - cmp r0, 0x7 - beq _080A3058 - movs r0, 0x1 - b _080A305A - .pool -_080A3058: - movs r0, 0 -_080A305A: - pop {r1} - bx r1 - thumb_func_end sub_80A303C - - thumb_func_start pause_music_for_sound_maybe -@ void pause_music_for_sound_maybe(u8 a1) -pause_music_for_sound_maybe: @ 80A3060 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x03007420 - bl MPlayStop_rev01 - ldr r0, =gUnknown_085248BC - lsls r4, 2 - adds r4, r0 - ldrh r0, [r4] - ldr r2, =0x03000f4e - ldrh r1, [r4, 0x2] - strh r1, [r2] - bl m4aSongNumStart - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pause_music_for_sound_maybe - - thumb_func_start ducking_tick -ducking_tick: @ 80A3094 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - ldr r2, =0x03000f4e - ldrh r0, [r2] - cmp r0, 0 - beq _080A30B0 - subs r0, 0x1 - strh r0, [r2] - movs r0, 0 - b _080A30C8 - .pool -_080A30B0: - cmp r1, 0 - bne _080A30C0 - ldr r0, =0x03007420 - bl m4aMPlayContinue - b _080A30C6 - .pool -_080A30C0: - movs r0, 0 - bl m4aSongNumStart -_080A30C6: - movs r0, 0x1 -_080A30C8: - pop {r1} - bx r1 - thumb_func_end ducking_tick - - thumb_func_start sub_80A30CC -sub_80A30CC: @ 80A30CC - push {lr} - lsls r0, 24 - ldr r1, =gUnknown_085248BC - lsrs r0, 22 - adds r0, r1 - ldrh r0, [r0] - bl m4aSongNumStop - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A30CC - - thumb_func_start fanfare_play -@ void fanfare_play(u16 a1) -fanfare_play: @ 80A30E4 - push {lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r1, 0 - ldr r2, =gUnknown_085248BC -_080A30EE: - ldrh r0, [r2] - cmp r0, r3 - bne _080A3108 - lsls r0, r1, 24 - lsrs r0, 24 - bl pause_music_for_sound_maybe - bl task_add_50_overworld_fanfare_if_not_running - b _080A311A - .pool -_080A3108: - adds r2, 0x4 - adds r1, 0x1 - cmp r1, 0x11 - bls _080A30EE - movs r0, 0 - bl pause_music_for_sound_maybe - bl task_add_50_overworld_fanfare_if_not_running -_080A311A: - pop {r0} - bx r0 - thumb_func_end fanfare_play - - thumb_func_start task_is_not_running_overworld_fanfare -task_is_not_running_overworld_fanfare: @ 80A3120 - push {lr} - ldr r0, =task50_overworld_fanfare - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080A3138 - movs r0, 0x1 - b _080A313A - .pool -_080A3138: - movs r0, 0 -_080A313A: - pop {r1} - bx r1 - thumb_func_end task_is_not_running_overworld_fanfare - - thumb_func_start task50_overworld_fanfare -task50_overworld_fanfare: @ 80A3140 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03000f4e - ldrh r0, [r1] - cmp r0, 0 - beq _080A3158 - subs r0, 0x1 - strh r0, [r1] - b _080A3164 - .pool -_080A3158: - ldr r0, =0x03007420 - bl m4aMPlayContinue - adds r0, r4, 0 - bl DestroyTask -_080A3164: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task50_overworld_fanfare - - thumb_func_start task_add_50_overworld_fanfare_if_not_running -@ void task_add_50_overworld_fanfare_if_not_running() -task_add_50_overworld_fanfare_if_not_running: @ 80A3170 - push {r4,lr} - ldr r4, =task50_overworld_fanfare - adds r0, r4, 0 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080A318A - adds r0, r4, 0 - movs r1, 0x50 - bl CreateTask -_080A318A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_add_50_overworld_fanfare_if_not_running - - thumb_func_start sub_80A3194 -sub_80A3194: @ 80A3194 - push {r4-r7,lr} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 24 - lsrs r7, r1, 24 - ldr r0, =0x03005df8 - ldrb r0, [r0] - cmp r0, 0 - beq _080A31A8 - movs r5, 0 -_080A31A8: - ldr r6, =0x0000ffff - cmp r5, r6 - bne _080A31B0 - movs r5, 0 -_080A31B0: - adds r0, r5, 0 - bl m4aSongNumStart - ldr r4, =0x03007420 - adds r0, r4, 0 - bl m4aMPlayImmInit - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0 - bl MPlayVolumeControl - adds r0, r5, 0 - bl m4aSongNumStop - adds r0, r4, 0 - adds r1, r7, 0 - bl sub_82E0328 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3194 - - thumb_func_start sub_80A31E8 -sub_80A31E8: @ 80A31E8 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0x03007420 - bl sub_82E0308 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A31E8 - - thumb_func_start sub_80A3200 -sub_80A3200: @ 80A3200 - push {lr} - ldr r0, =0x03007420 - ldr r1, [r0, 0x4] - cmp r1, 0 - blt _080A3220 - ldr r0, =0x0000ffff - ands r1, r0 - cmp r1, 0 - beq _080A3220 - movs r0, 0 - b _080A3222 - .pool -_080A3220: - movs r0, 0x1 -_080A3222: - pop {r1} - bx r1 - thumb_func_end sub_80A3200 - - thumb_func_start sub_80A3228 -sub_80A3228: @ 80A3228 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0x03007420 - bl sub_82E0328 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3228 - - thumb_func_start play_sound_effect -@ void play_sound_effect(u8 a1) -play_sound_effect: @ 80A3240 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0x03007420 - bl m4aMPlayFadeOut - pop {r0} - bx r0 - .pool - thumb_func_end play_sound_effect - - thumb_func_start sub_80A3258 -sub_80A3258: @ 80A3258 - push {lr} - ldr r0, =0x03007420 - ldrh r0, [r0, 0x4] - cmp r0, 0 - beq _080A326C - movs r0, 0 - b _080A326E - .pool -_080A326C: - movs r0, 0x1 -_080A326E: - pop {r1} - bx r1 - thumb_func_end sub_80A3258 - - thumb_func_start cry_related -cry_related: @ 80A3274 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r4, r1, 0 - lsls r5, 16 - lsrs r5, 16 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x55 - bl MPlayVolumeControl - lsls r4, 24 - asrs r4, 24 - movs r0, 0 - str r0, [sp] - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x78 - movs r3, 0xA - bl sub_80A344C - ldr r1, =0x020383ec - movs r0, 0x2 - strb r0, [r1] - bl sub_80A3754 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end cry_related - - thumb_func_start sub_80A32C0 -sub_80A32C0: @ 80A32C0 - push {r4,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r0, 16 - lsls r3, 24 - lsrs r3, 24 - lsls r1, 24 - asrs r1, 24 - lsls r2, 24 - asrs r2, 24 - movs r4, 0 - str r4, [sp] - bl sub_80A344C - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A32C0 - - thumb_func_start sub_80A32E4 -sub_80A32E4: @ 80A32E4 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r4, r2, 24 - cmp r4, 0x1 - bne _080A330A - lsls r1, r5, 24 - asrs r1, 24 - str r4, [sp] - adds r0, r6, 0 - movs r2, 0x78 - movs r3, 0xA - bl sub_80A344C - b _080A332E -_080A330A: - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x55 - bl MPlayVolumeControl - lsls r1, r5, 24 - asrs r1, 24 - str r4, [sp] - adds r0, r6, 0 - movs r2, 0x78 - movs r3, 0xA - bl sub_80A344C - ldr r1, =0x020383ec - movs r0, 0x2 - strb r0, [r1] - bl sub_80A3754 -_080A332E: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A32E4 - - thumb_func_start sub_80A3344 -sub_80A3344: @ 80A3344 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r0, 16 - adds r6, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r5, r1, 0 - lsls r2, 24 - lsrs r2, 24 - adds r4, r2, 0 - cmp r2, 0x1 - bne _080A336E - lsls r1, 24 - asrs r1, 24 - str r2, [sp] - movs r2, 0x78 - movs r3, 0xA - bl sub_80A344C - b _080A3394 -_080A336E: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _080A3384 - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x55 - bl MPlayVolumeControl -_080A3384: - lsls r1, r5, 24 - asrs r1, 24 - str r4, [sp] - adds r0, r6, 0 - movs r2, 0x78 - movs r3, 0xA - bl sub_80A344C -_080A3394: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3344 - - thumb_func_start play_cry_maybe -play_cry_maybe: @ 80A33A8 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r4, r2, 24 - cmp r4, 0x1 - bne _080A33CE - lsls r1, r5, 24 - asrs r1, 24 - str r4, [sp] - adds r0, r6, 0 - movs r2, 0x78 - movs r3, 0xA - bl sub_80A344C - b _080A33EE -_080A33CE: - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x55 - bl MPlayVolumeControl - lsls r1, r5, 24 - asrs r1, 24 - str r4, [sp] - adds r0, r6, 0 - movs r2, 0x78 - movs r3, 0xA - bl sub_80A344C - ldr r1, =0x020383ec - movs r0, 0x2 - strb r0, [r1] -_080A33EE: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end play_cry_maybe - - thumb_func_start sub_80A3404 -sub_80A3404: @ 80A3404 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r4, r1, 0 - lsls r5, 16 - lsrs r5, 16 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x55 - bl MPlayVolumeControl - str r4, [sp] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0x78 - movs r3, 0xA - bl sub_80A344C - ldr r1, =0x020383ec - movs r0, 0x2 - strb r0, [r1] - bl sub_80A3754 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3404 - - thumb_func_start sub_80A344C -sub_80A344C: @ 80A344C - 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, 16 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp] - lsls r4, 24 - lsrs r1, r4, 24 - ldr r3, =0xffff0000 - adds r0, r3 - lsrs r7, r0, 16 - movs r6, 0x8C - movs r0, 0 - mov r9, r0 - movs r5, 0 - movs r4, 0xF0 - lsls r4, 6 - mov r8, r5 - cmp r1, 0xC - bhi _080A3562 - lsls r0, r1, 2 - ldr r1, =_080A349C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080A349C: - .4byte _080A3562 - .4byte _080A34D0 - .4byte _080A34D6 - .4byte _080A34E4 - .4byte _080A34F8 - .4byte _080A3510 - .4byte _080A351C - .4byte _080A352C - .4byte _080A3536 - .4byte _080A3540 - .4byte _080A3550 - .4byte _080A3560 - .4byte _080A355C -_080A34D0: - movs r6, 0x14 - movs r5, 0xE1 - b _080A3562 -_080A34D6: - movs r5, 0xE1 - ldr r4, =0x00003cf0 - movs r1, 0x14 - b _080A3504 - .pool -_080A34E4: - movs r6, 0x32 - movs r5, 0xC8 - ldr r4, =0x00003db8 - movs r3, 0x14 - mov r8, r3 - movs r2, 0x5A - b _080A3562 - .pool -_080A34F8: - movs r6, 0x19 - movs r0, 0x1 - mov r9, r0 - movs r5, 0x64 - ldr r4, =0x00003cf0 - movs r1, 0xC0 -_080A3504: - mov r8, r1 - movs r2, 0x5A - b _080A3562 - .pool -_080A3510: - movs r5, 0xC8 - ldr r4, =0x00003868 - b _080A3562 - .pool -_080A351C: - movs r5, 0xDC - ldr r4, =0x00003cc3 - movs r3, 0xC0 - mov r8, r3 - movs r2, 0x46 - b _080A3562 - .pool -_080A352C: - movs r6, 0xA - movs r5, 0x64 - movs r4, 0xE8 - lsls r4, 6 - b _080A3562 -_080A3536: - movs r6, 0x3C - movs r5, 0xE1 - movs r4, 0xF4 - lsls r4, 6 - b _080A3562 -_080A3540: - movs r6, 0xF - movs r0, 0x1 - mov r9, r0 - movs r5, 0x7D - ldr r4, =0x00003b60 - b _080A3562 - .pool -_080A3550: - movs r6, 0x64 - movs r5, 0xE1 - ldr r4, =0x00003b60 - b _080A3562 - .pool -_080A355C: - movs r6, 0x14 - movs r5, 0xE1 -_080A3560: - ldr r4, =0x00003a98 -_080A3562: - adds r0, r2, 0 - bl sub_82E1744 - mov r1, r10 - lsls r0, r1, 24 - asrs r0, 24 - bl sub_82E1758 - adds r0, r4, 0 - bl sub_82E1770 - adds r0, r6, 0 - bl sub_82E17A8 - movs r0, 0 - bl sub_82E17C0 - adds r0, r5, 0 - bl sub_82E17B4 - mov r3, r8 - lsls r0, r3, 24 - asrs r0, 24 - bl sub_82E17E4 - ldr r0, [sp] - bl sub_82E1850 - adds r0, r7, 0 - bl speciesid_conv - adds r7, r0, 0 - movs r1, 0x7F - ands r1, r7 - lsrs r0, r7, 7 - lsls r0, 24 - lsrs r0, 24 - adds r2, r0, 0 - cmp r0, 0x1 - beq _080A35F0 - cmp r0, 0x1 - bgt _080A35C0 - cmp r0, 0 - beq _080A35CA - b _080A365E - .pool -_080A35C0: - cmp r2, 0x2 - beq _080A3614 - cmp r2, 0x3 - beq _080A3638 - b _080A365E -_080A35CA: - mov r0, r9 - cmp r0, 0 - beq _080A35E0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_0869EF24 - b _080A3654 - .pool -_080A35E0: - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_0869DCF4 - b _080A3654 - .pool -_080A35F0: - mov r3, r9 - cmp r3, 0 - beq _080A3604 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_0869F524 - b _080A3654 - .pool -_080A3604: - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_0869E2F4 - b _080A3654 - .pool -_080A3614: - mov r0, r9 - cmp r0, 0 - beq _080A3628 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_0869FB24 - b _080A3654 - .pool -_080A3628: - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_0869E8F4 - b _080A3654 - .pool -_080A3638: - mov r3, r9 - cmp r3, 0 - beq _080A364C - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_086A0124 - b _080A3654 - .pool -_080A364C: - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_0869EEF4 -_080A3654: - adds r0, r1 - bl sub_82E1674 - ldr r1, =0x020383e8 - str r0, [r1] -_080A365E: - 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_80A344C - - thumb_func_start sub_80A3678 -sub_80A3678: @ 80A3678 - push {lr} - ldr r0, =sub_80A370C - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080A3694 - bl sub_8000964 - movs r0, 0x1 - b _080A3696 - .pool -_080A3694: - movs r0, 0 -_080A3696: - pop {r1} - bx r1 - thumb_func_end sub_80A3678 - - thumb_func_start sub_80A369C -sub_80A369C: @ 80A369C - push {lr} - ldr r0, =0x020383e8 - ldr r0, [r0] - bl MPlayStop_rev01 - bl sub_8000964 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A369C - - thumb_func_start sub_80A36B4 -sub_80A36B4: @ 80A36B4 - push {lr} - ldr r0, =0x020383e8 - ldr r0, [r0] - bl MPlayStop_rev01 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A36B4 - - thumb_func_start sub_80A36C8 -sub_80A36C8: @ 80A36C8 - push {lr} - ldr r0, =0x020383e8 - ldr r0, [r0] - bl sub_82E17CC - cmp r0, 0 - bne _080A36E4 - bl sub_8000964 - movs r0, 0 - b _080A36E6 - .pool -_080A36E4: - movs r0, 0x1 -_080A36E6: - pop {r1} - bx r1 - thumb_func_end sub_80A36C8 - - thumb_func_start sub_80A36EC -sub_80A36EC: @ 80A36EC - push {lr} - ldr r0, =0x020383e8 - ldr r0, [r0] - bl sub_82E17CC - cmp r0, 0 - bne _080A3704 - movs r0, 0 - b _080A3706 - .pool -_080A3704: - movs r0, 0x1 -_080A3706: - pop {r1} - bx r1 - thumb_func_end sub_80A36EC - - thumb_func_start sub_80A370C -sub_80A370C: @ 80A370C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x020383ec - ldrb r0, [r1] - cmp r0, 0 - beq _080A3724 - subs r0, 0x1 - strb r0, [r1] - b _080A3742 - .pool -_080A3724: - ldr r0, =0x020383e8 - ldr r0, [r0] - bl sub_82E17CC - cmp r0, 0 - bne _080A3742 - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl - adds r0, r4, 0 - bl DestroyTask -_080A3742: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A370C - - thumb_func_start sub_80A3754 -sub_80A3754: @ 80A3754 - push {r4,lr} - ldr r4, =sub_80A370C - adds r0, r4, 0 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080A376E - adds r0, r4, 0 - movs r1, 0x50 - bl CreateTask -_080A376E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3754 - - thumb_func_start song_play_for_text -song_play_for_text: @ 80A3778 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x03005df8 - ldrb r0, [r0] - cmp r0, 0 - beq _080A3788 - movs r1, 0 -_080A3788: - ldr r0, =0x0000ffff - cmp r1, r0 - bne _080A3790 - movs r1, 0 -_080A3790: - adds r0, r1, 0 - bl m4aSongNumStart - pop {r0} - bx r0 - .pool - thumb_func_end song_play_for_text - - thumb_func_start audio_play -audio_play: @ 80A37A4 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl m4aSongNumStart - pop {r0} - bx r0 - thumb_func_end audio_play - - thumb_func_start audio_play_and_stuff -audio_play_and_stuff: @ 80A37B4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r4, r1, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 24 - lsrs r4, 24 - bl m4aSongNumStart - ldr r6, =0x030075f0 - adds r0, r6, 0 - bl m4aMPlayImmInit - ldr r0, =0x03007630 - mov r8, r0 - bl m4aMPlayImmInit - ldr r5, =0x0000ffff - lsls r4, 24 - asrs r4, 24 - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl MPlayPanpotControl - mov r0, r8 - adds r1, r5, 0 - adds r2, r4, 0 - bl MPlayPanpotControl - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end audio_play_and_stuff - - thumb_func_start sub_80A3808 -sub_80A3808: @ 80A3808 - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 24 - lsrs r4, 24 - bl m4aSongNumStart - ldr r5, =0x030075f0 - adds r0, r5, 0 - bl m4aMPlayImmInit - ldr r1, =0x0000ffff - lsls r4, 24 - asrs r4, 24 - adds r0, r5, 0 - adds r2, r4, 0 - bl MPlayPanpotControl - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3808 - - thumb_func_start sub_80A383C -sub_80A383C: @ 80A383C - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 24 - lsrs r4, 24 - bl m4aSongNumStart - ldr r5, =0x03007630 - adds r0, r5, 0 - bl m4aMPlayImmInit - ldr r1, =0x0000ffff - lsls r4, 24 - asrs r4, 24 - adds r0, r5, 0 - adds r2, r4, 0 - bl MPlayPanpotControl - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A383C - - thumb_func_start sub_80A3870 -sub_80A3870: @ 80A3870 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, =0x030075f0 - ldr r5, =0x0000ffff - lsls r4, 24 - asrs r4, 24 - adds r1, r5, 0 - adds r2, r4, 0 - bl MPlayPanpotControl - ldr r0, =0x03007630 - adds r1, r5, 0 - adds r2, r4, 0 - bl MPlayPanpotControl - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3870 - - thumb_func_start mplay_has_finished_maybe -mplay_has_finished_maybe: @ 80A38A0 - push {lr} - ldr r0, =0x030075f0 - ldr r1, [r0, 0x4] - movs r2, 0x80 - lsls r2, 24 - adds r3, r0, 0 - cmp r1, 0 - bge _080A38BA - ldr r0, =0x03007630 - ldr r0, [r0, 0x4] - ands r0, r2 - cmp r0, 0 - bne _080A38CC -_080A38BA: - ldr r1, =0x0000ffff - ldrh r0, [r3, 0x4] - cmp r0, 0 - bne _080A38DC - ldr r0, =0x03007630 - ldr r0, [r0, 0x4] - ands r0, r1 - cmp r0, 0 - bne _080A38DC -_080A38CC: - movs r0, 0 - b _080A38DE - .pool -_080A38DC: - movs r0, 0x1 -_080A38DE: - pop {r1} - bx r1 - thumb_func_end mplay_has_finished_maybe - - thumb_func_start sub_80A38E4 -sub_80A38E4: @ 80A38E4 - push {lr} - ldr r0, =0x03007420 - ldr r1, [r0, 0x4] - cmp r1, 0 - blt _080A3904 - ldr r0, =0x0000ffff - ands r1, r0 - cmp r1, 0 - beq _080A3904 - movs r0, 0x1 - b _080A3906 - .pool -_080A3904: - movs r0, 0 -_080A3906: - pop {r1} - bx r1 - thumb_func_end sub_80A38E4 - - thumb_func_start sub_80A390C -sub_80A390C: @ 80A390C - push {lr} - ldr r0, =0x03007800 - ldr r1, [r0, 0x4] - cmp r1, 0 - blt _080A392C - ldr r0, =0x0000ffff - ands r1, r0 - cmp r1, 0 - beq _080A392C - movs r0, 0x1 - b _080A392E - .pool -_080A392C: - movs r0, 0 -_080A392E: - pop {r1} - bx r1 - thumb_func_end sub_80A390C - thumb_func_start sub_80A3934 sub_80A3934: @ 80A3934 push {r4-r7,lr} diff --git a/asm/rom_80A92F4.s b/asm/rom_80A92F4.s deleted file mode 100644 index f6bcd6bfd..000000000 --- a/asm/rom_80A92F4.s +++ /dev/null @@ -1,524207 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start nullsub_35 -nullsub_35: @ 80A92F4 - bx lr - thumb_func_end nullsub_35 - - thumb_func_start sub_80A92F8 -sub_80A92F8: @ 80A92F8 - push {lr} - ldr r2, =0x02037fd4 - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - ldr r0, =0x02024474 - adds r2, r0, 0 - adds r2, 0x21 - movs r1, 0 - strb r1, [r2] - adds r0, 0x22 - strb r1, [r0] - ldr r0, =c2_80777E8 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A92F8 - - thumb_func_start c2_80777E8 -c2_80777E8: @ 80A933C - push {r4-r7,lr} - sub sp, 0x8 - ldr r0, =0x02024474 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x13 - bls _080A934C - b _080A95A4 -_080A934C: - lsls r0, 2 - ldr r1, =_080A9360 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080A9360: - .4byte _080A93B0 - .4byte _080A942C - .4byte _080A9444 - .4byte _080A944A - .4byte _080A9450 - .4byte _080A9460 - .4byte _080A9466 - .4byte _080A948E - .4byte _080A9492 - .4byte _080A9496 - .4byte _080A949A - .4byte _080A94B8 - .4byte _080A94C0 - .4byte _080A94C8 - .4byte _080A94D0 - .4byte _080A94D8 - .4byte _080A94E0 - .4byte _080A94E8 - .4byte _080A94F0 - .4byte _080A94F8 -_080A93B0: - bl dp12_8087EA4 - bl trs_config - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - bl SetBgAttribute - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0 - bl SetBgAttribute - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - bl sub_80A1A74 - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r0, =0x02022e18 - strh r1, [r0] - ldr r0, =0x02022e1a - strh r1, [r0] - ldr r0, =0x02022e1c - strh r1, [r0] - ldr r0, =0x02022e1e - strh r1, [r0] - ldr r0, =0x02022e20 - strh r1, [r0] - ldr r0, =0x02022e22 - strh r1, [r0] - b _080A95D2 - .pool -_080A942C: - movs r0, 0 - str r0, [sp, 0x4] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x01006000 - add r0, sp, 0x4 - bl CpuFastSet - b _080A95D2 - .pool -_080A9444: - bl sub_8035AA4 - b _080A95D2 -_080A944A: - bl ResetAllObjectData - b _080A95D2 -_080A9450: - bl ResetObjectPaletteAllocator - ldr r1, =0x0300301c - movs r0, 0x4 - strb r0, [r1] - b _080A95D2 - .pool -_080A9460: - bl sub_805E350 - b _080A95D2 -_080A9466: - ldr r5, =0x02024474 - adds r4, r5, 0 - adds r4, 0x22 - ldrb r0, [r4] - bl sub_805E08C - lsls r0, 24 - cmp r0, 0 - beq _080A9484 - movs r0, 0 - strb r0, [r4] - b _080A95D2 - .pool -_080A9484: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - adds r1, r5, 0 - b _080A94AA -_080A948E: - movs r0, 0 - b _080A949C -_080A9492: - movs r0, 0x1 - b _080A949C -_080A9496: - movs r0, 0x2 - b _080A949C -_080A949A: - movs r0, 0x3 -_080A949C: - bl sub_80A9614 - lsls r0, 24 - cmp r0, 0 - beq _080A94A8 - b _080A95D2 -_080A94A8: - ldr r1, =0x02024474 -_080A94AA: - adds r1, 0x21 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - b _080A95D2 - .pool -_080A94B8: - movs r0, 0 - bl sub_80A9708 - b _080A95D2 -_080A94C0: - movs r0, 0x1 - bl sub_80A9708 - b _080A95D2 -_080A94C8: - movs r0, 0x2 - bl sub_80A9708 - b _080A95D2 -_080A94D0: - movs r0, 0x3 - bl sub_80A9708 - b _080A95D2 -_080A94D8: - movs r0, 0 - bl sub_80A9ADC - b _080A95D2 -_080A94E0: - movs r0, 0x1 - bl sub_80A9ADC - b _080A95D2 -_080A94E8: - movs r0, 0x2 - bl sub_80A9ADC - b _080A95D2 -_080A94F0: - movs r0, 0x3 - bl sub_80A9ADC - b _080A95D2 -_080A94F8: - bl sub_805EC84 - movs r0, 0x1 - bl battle_get_side_with_given_state - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r7, =0x0202406e - lsls r0, r4, 1 - adds r0, r7 - ldrh r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x02024744 - adds r0, r5 - movs r1, 0xB - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_805EE54 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _080A955C - movs r0, 0x3 - bl battle_get_side_with_given_state - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 1 - adds r0, r7 - ldrh r0, [r0] - muls r0, r6 - adds r0, r5 - movs r1, 0xB - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_805EE54 -_080A955C: - ldr r1, =0x020244ac - ldr r0, =0x020244b8 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - movs r1, 0 - bl sub_8059CB4 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _080A95D2 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _080A95D2 - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 - b _080A95D2 - .pool -_080A95A4: - ldr r0, =vblank_cb_08078BB4 - bl SetVBlankCallback - bl sub_80A95F4 - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl sub_80A27B0 - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] - ldr r0, =sub_8038420 - bl SetMainCallback2 - bl sub_805EF14 -_080A95D2: - ldr r1, =0x02024474 - adds r1, 0x21 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end c2_80777E8 - - thumb_func_start sub_80A95F4 -sub_80A95F4: @ 80A95F4 - ldr r3, =0x0400000a - ldrb r2, [r3] - movs r1, 0xD - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3] - ldr r2, =0x0400000c - ldrb r0, [r2] - ands r1, r0 - strb r1, [r2] - bx lr - .pool - thumb_func_end sub_80A95F4 - - thumb_func_start sub_80A9614 -sub_80A9614: @ 80A9614 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - bcs _080A96FC - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080A9676 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r4, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _080A966C - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - adds r1, r4, 0 - bl sub_805DC0C - b _080A96F4 - .pool -_080A966C: - adds r0, r4, 0 - movs r1, 0 - bl sub_805E7DC - b _080A96F4 -_080A9676: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r2, 0x80 - ands r1, r2 - cmp r1, 0 - beq _080A9698 - cmp r4, 0 - bne _080A9698 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - b _080A96AA - .pool -_080A9698: - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 2 - ands r0, r1 - cmp r0, 0 - beq _080A96B2 - cmp r4, 0 - bne _080A96B2 - movs r0, 0x6 -_080A96AA: - movs r1, 0 - bl sub_805DF84 - b _080A96F4 -_080A96B2: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r4, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _080A96EC - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - adds r1, r4, 0 - bl sub_805DD7C - b _080A96F4 - .pool -_080A96EC: - adds r0, r4, 0 - movs r1, 0 - bl sub_805E7DC -_080A96F4: - ldr r0, =0x02024474 - adds r0, 0x22 - movs r1, 0 - strb r1, [r0] -_080A96FC: - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A9614 - - thumb_func_start sub_80A9708 -sub_80A9708: @ 80A9708 - 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, =0x0202406c - ldrb r0, [r0] - cmp r7, r0 - bcc _080A9722 - b _080A9AA0 -_080A9722: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - lsls r2, r7, 2 - adds r0, r2, r0 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - str r2, [sp] - cmp r0, 0 - beq _080A9748 - adds r0, r7, 0 - bl sub_80A614C - b _080A974E - .pool -_080A9748: - adds r0, r7, 0 - bl sub_80A6138 -_080A974E: - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - adds r0, r7, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080A9762 - b _080A986C -_080A9762: - ldr r1, =0x0202406e - lsls r0, r7, 1 - adds r6, r0, r1 - ldrh r0, [r6] - movs r1, 0x64 - mov r10, r1 - mov r2, r10 - muls r2, r0 - adds r0, r2, 0 - ldr r1, =0x02024744 - mov r9, r1 - add r0, r9 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - bne _080A9786 - b _080A9AA0 -_080A9786: - ldrh r0, [r6] - mov r2, r10 - muls r2, r0 - adds r0, r2, 0 - add r0, r9 - movs r1, 0xB - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r7, 0 - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_806A068 - ldr r5, =0x0202499c - adds r0, r7, 0 - movs r1, 0x2 - bl sub_80A5C6C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r7, 0 - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r5, 0 - adds r1, r4, 0 - mov r2, r8 - bl AddObjectToFront - ldr r1, =0x020241e4 - adds r4, r7, r1 - strb r0, [r4] - ldr r5, =0x02020630 - ldrb r0, [r4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - lsls r3, r7, 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 r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =DummyObjectCallback - str r1, [r0] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r7, [r0, 0x2E] - ldrh r0, [r6] - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - add r0, r9 - movs r1, 0xB - bl pokemon_getattr - ldrb r2, [r4] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r5 - strh r0, [r1, 0x32] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x020244e4 - adds r1, r7, r1 - ldrb r1, [r1] - bl StartObjectImageAnim - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - ldr r2, [sp] - adds r0, r2, r0 - b _080A9A50 - .pool -_080A986C: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r2, 0x80 - ands r1, r2 - cmp r1, 0 - beq _080A98D0 - cmp r7, 0 - bne _080A98D0 - ldr r5, =0x03005d90 - ldr r0, [r5] - ldrb r4, [r0, 0x8] - movs r0, 0 - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl template_build_for_pokemon_or_trainer - ldr r6, =0x0202499c - ldr r1, =gUnknown_08305D2C - ldr r0, [r5] - ldrb r0, [r0, 0x8] - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0] - movs r4, 0x8 - subs r4, r0 - lsls r4, 18 - movs r0, 0xA0 - lsls r0, 15 - adds r4, r0 - asrs r4, 16 - movs r0, 0 - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r6, 0 - b _080A9914 - .pool -_080A98D0: - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 2 - ands r0, r1 - cmp r0, 0 - beq _080A9968 - cmp r7, 0 - bne _080A9968 - movs r0, 0 - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x6 - bl template_build_for_pokemon_or_trainer - ldr r5, =0x0202499c - ldr r0, =gUnknown_08305D2C - ldrb r0, [r0, 0x18] - movs r4, 0x8 - subs r4, r0 - lsls r4, 18 - movs r1, 0xA0 - lsls r1, 15 - adds r4, r1 - asrs r4, 16 - movs r0, 0 - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r5, 0 -_080A9914: - movs r1, 0x50 - adds r2, r4, 0 - bl AddObjectToFront - ldr r3, =0x020241e4 - strb r0, [r3] - ldr r4, =0x02020630 - ldrb r0, [r3] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - strb r0, [r1, 0x5] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =DummyObjectCallback - str r1, [r0] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r7, [r0, 0x2E] - b _080A9A70 - .pool -_080A9968: - ldr r1, =0x0202406e - lsls r0, r7, 1 - adds r6, r0, r1 - ldrh r0, [r6] - movs r2, 0x64 - mov r10, r2 - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - ldr r2, =0x020244ec - mov r9, r2 - add r0, r9 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - bne _080A998C - b _080A9AA0 -_080A998C: - ldrh r0, [r6] - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - add r0, r9 - movs r1, 0xB - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r7, 0 - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_806A068 - ldr r5, =0x0202499c - adds r0, r7, 0 - movs r1, 0x2 - bl sub_80A5C6C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r7, 0 - bl sub_80A82E4 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r5, 0 - adds r1, r4, 0 - mov r2, r8 - bl AddObjectToFront - ldr r1, =0x020241e4 - adds r4, r7, r1 - strb r0, [r4] - ldr r5, =0x02020630 - ldrb r0, [r4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - lsls r3, r7, 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 r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =DummyObjectCallback - str r1, [r0] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r7, [r0, 0x2E] - ldrh r0, [r6] - mov r2, r10 - muls r2, r0 - adds r0, r2, 0 - add r0, r9 - movs r1, 0xB - bl pokemon_getattr - ldrb r2, [r4] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r5 - strh r0, [r1, 0x32] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x020244e4 - adds r1, r7, r1 - ldrb r1, [r1] - bl StartObjectImageAnim - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - ldr r1, [sp] - adds r0, r1, r0 -_080A9A50: - ldrh r1, [r0, 0x2] - ldr r0, =0x00000181 - cmp r1, r0 - bne _080A9A70 - ldrb r0, [r4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r0, r5, 0 - adds r0, 0x8 - adds r1, r0 - ldr r0, =gUnknown_08309AAC - ldr r2, =0x00000604 - adds r0, r2 - ldr r0, [r0] - str r0, [r1] -_080A9A70: - ldr r1, =0x02020630 - ldr r0, =0x020241e4 - adds r0, r7, r0 - ldrb r0, [r0] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r1 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0] - ldr r1, [sp] - adds r0, r1, r0 - ldr r1, [r0] - lsls r1, 31 - adds r2, 0x3E - lsrs r1, 31 - lsls r1, 2 - ldrb r3, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] -_080A9AA0: - 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_80A9708 - - thumb_func_start sub_80A9ADC -sub_80A9ADC: @ 80A9ADC - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r5, r0 - bcc _080A9AEC - b _080A9C5E -_080A9AEC: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r2, 0x80 - ands r1, r2 - cmp r1, 0 - beq _080A9B0C - cmp r5, 0 - bne _080A9B0C - bl battle_make_oam_safari_battle - b _080A9B24 - .pool -_080A9B0C: - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 2 - ands r0, r1 - cmp r0, 0 - beq _080A9B1E - cmp r5, 0 - bne _080A9B1E - b _080A9C5E -_080A9B1E: - adds r0, r5, 0 - bl battle_make_oam_normal_battle -_080A9B24: - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x03005d70 - adds r4, r5, r0 - strb r6, [r4] - adds r0, r5, 0 - bl sub_8072B18 - adds r0, r6, 0 - bl sub_80729D0 - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080A9B6C - ldrb r0, [r4] - ldr r1, =0x0202406e - lsls r4, r5, 1 - adds r1, r4, r1 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe - b _080A9BB8 - .pool -_080A9B6C: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080A9BA0 - ldrb r0, [r4] - ldr r1, =0x0202406e - lsls r4, r5, 1 - adds r1, r4, r1 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0xA - bl healthbar_draw_field_maybe - b _080A9BB8 - .pool -_080A9BA0: - ldrb r0, [r4] - ldr r1, =0x0202406e - lsls r4, r5, 1 - adds r1, r4, r1 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe -_080A9BB8: - adds r0, r5, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - beq _080A9BD4 - adds r0, r5, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _080A9BF0 -_080A9BD4: - ldr r0, =0x03005d70 - adds r0, r5, r0 - ldrb r0, [r0] - movs r1, 0x1 - bl nullsub_30 - b _080A9BFC - .pool -_080A9BF0: - ldr r0, =0x03005d70 - adds r0, r5, r0 - ldrb r0, [r0] - movs r1, 0 - bl nullsub_30 -_080A9BFC: - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080A9C34 - ldr r0, =0x0202406e - adds r0, r4, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - bne _080A9C5E - adds r0, r6, 0 - bl sub_8072984 - b _080A9C5E - .pool -_080A9C34: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080A9C5E - ldr r0, =0x0202406e - adds r0, r4, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - bne _080A9C5E - adds r0, r6, 0 - bl sub_8072984 -_080A9C5E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A9ADC - - thumb_func_start sub_80A9C70 -sub_80A9C70: @ 80A9C70 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =0x020241e4 - adds r0, r4, r0 - ldrb r6, [r0] - ldr r0, =sub_80A9DB4 - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =gUnknown_08524F84 - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_0852588C - bl LoadCompressedObjectPaletteUsingHeap - ldr r1, =0x03005e00 - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r1, r0, r1 - strh r4, [r1, 0x8] - cmp r5, 0 - beq _080A9D30 - movs r0, 0x1F - strh r0, [r1, 0xA] - movs r5, 0 - lsls r0, r6, 4 - ldr r7, =0x02020630 - adds r0, r6 - lsls r0, 2 - adds r6, r0, r7 -_080A9CC4: - movs r0, 0x20 - ldrsh r1, [r6, r0] - ldrh r2, [r6, 0x22] - adds r2, 0x20 - lsls r2, 16 - asrs r2, 16 - ldr r0, =gUnknown_0853EF60 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r3, r0, r7 - lsls r0, r5, 1 - adds r0, r5 - lsls r1, r0, 4 - adds r0, r1 - strh r0, [r3, 0x2E] - movs r0, 0xFF - lsls r0, 8 - strh r0, [r3, 0x30] - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - cmp r5, 0x4 - bls _080A9D08 - movs r0, 0x15 - strh r0, [r3, 0x3A] -_080A9D08: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x9 - bls _080A9CC4 - b _080A9D90 - .pool -_080A9D30: - movs r0, 0xF8 - lsls r0, 7 - strh r0, [r1, 0xA] - movs r5, 0 - lsls r0, r6, 4 - ldr r7, =0x02020630 - adds r0, r6 - lsls r0, 2 - adds r6, r0, r7 -_080A9D42: - movs r2, 0x20 - ldrsh r1, [r6, r2] - ldrh r2, [r6, 0x22] - subs r2, 0x20 - lsls r2, 16 - asrs r2, 16 - ldr r0, =gUnknown_0853EF60 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r3, r0, r7 - lsls r0, r5, 1 - adds r0, r5 - lsls r1, r0, 4 - adds r0, r1 - strh r0, [r3, 0x2E] - movs r0, 0x80 - lsls r0, 1 - strh r0, [r3, 0x30] - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - cmp r5, 0x4 - bls _080A9D86 - movs r0, 0x15 - strh r0, [r3, 0x3A] -_080A9D86: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x9 - bls _080A9D42 -_080A9D90: - ldr r0, =0x02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x3C] - mov r0, r8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A9C70 - - thumb_func_start sub_80A9DB4 -sub_80A9DB4: @ 80A9DB4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r1, [r4, 0xC] - movs r2, 0xC - ldrsh r0, [r4, r2] - cmp r0, 0x2 - bne _080A9E3A - movs r0, 0 - strh r0, [r4, 0xC] - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r0, 20 - movs r2, 0x80 - lsls r2, 17 - adds r0, r2 - lsrs r0, 16 - ldrb r2, [r4, 0x10] - ldrh r3, [r4, 0xA] - movs r1, 0x10 - bl pal_fade_1 - ldrh r2, [r4, 0x12] - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080A9E10 - ldrh r0, [r4, 0x10] - adds r0, 0x1 - strh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _080A9E3E - movs r0, 0x1 - eors r0, r2 - strh r0, [r4, 0x12] - b _080A9E3E - .pool -_080A9E10: - ldrh r1, [r4, 0x10] - subs r0, r1, 0x1 - strh r0, [r4, 0x10] - lsls r0, 16 - cmp r0, 0 - bge _080A9E3E - strh r1, [r4, 0x10] - movs r0, 0x1 - eors r0, r2 - strh r0, [r4, 0x12] - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _080A9E3E - adds r0, r5, 0 - bl DestroyTask - b _080A9E3E -_080A9E3A: - adds r0, r1, 0x1 - strh r0, [r4, 0xC] -_080A9E3E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80A9DB4 - - thumb_func_start sub_80A9E44 -sub_80A9E44: @ 80A9E44 - push {lr} - adds r2, r0, 0 - ldrh r1, [r2, 0x3A] - movs r3, 0x3A - ldrsh r0, [r2, r3] - cmp r0, 0 - bne _080A9E70 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x5 - negs r1, r1 - ands r1, r0 - strb r1, [r3] - ldr r1, =sub_80A9E78 - str r1, [r2, 0x1C] - adds r0, r2, 0 - bl _call_via_r1 - b _080A9E74 - .pool -_080A9E70: - subs r0, r1, 0x1 - strh r0, [r2, 0x3A] -_080A9E74: - pop {r0} - bx r0 - thumb_func_end sub_80A9E44 - - thumb_func_start sub_80A9E78 -sub_80A9E78: @ 80A9E78 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r1, 0x20 - bl cosine - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r1, 0x8 - bl sine - strh r0, [r4, 0x26] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x7F - bgt _080A9EA4 - adds r1, r4, 0 - adds r1, 0x43 - movs r0, 0x1D - b _080A9EAA -_080A9EA4: - adds r1, r4, 0 - adds r1, 0x43 - movs r0, 0x1F -_080A9EAA: - strb r0, [r1] - ldrh r0, [r4, 0x2E] - adds r0, 0x8 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x38] - adds r0, r1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x34 - bne _080A9EEC - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080A9EE6 - adds r0, r4, 0 - bl RemoveObjectAndFreeResources - b _080A9EEC -_080A9EE6: - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_080A9EEC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A9E78 - - thumb_func_start sub_80A9EF4 -sub_80A9EF4: @ 80A9EF4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 8 - ldr r1, =0xffe00000 - adds r0, r1 - lsrs r5, r0, 16 - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 8 - ldr r1, =0xffdc0000 - adds r0, r1 - lsrs r4, r0, 16 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A9F32 - lsls r0, r5, 16 - ldr r1, =0xfffa0000 - adds r0, r1 - lsrs r5, r0, 16 -_080A9F32: - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - ldr r0, =gUnknown_0853EF48 - lsls r1, r5, 16 - asrs r1, 16 - lsls r2, r4, 16 - asrs r2, 16 - movs r3, 0x4 - bl AddObjectToFront - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0000271a - bl GetObjectTileRangeStartByTag - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - bne _080A9F7C - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_080A9F7C: - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - ldr r1, =gUnknown_0853EF40 - bl SetSpriteOamTables_NoPriorityFromTable - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - strh r4, [r0, 0x26] - ldr r1, =sub_80A9FD0 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A9EF4 - - thumb_func_start sub_80A9FD0 -sub_80A9FD0: @ 80A9FD0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrh r0, [r1, 0xA] - adds r0, 0x1 - adds r2, r0, 0 - strh r0, [r1, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bne _080AA004 - ldr r0, =sub_80AA020 - str r0, [r1] - movs r0, 0 - strh r0, [r1, 0xA] - b _080AA01A - .pool -_080AA004: - lsls r0, r2, 24 - lsrs r0, 24 - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg -_080AA01A: - pop {r0} - bx r0 - thumb_func_end sub_80A9FD0 - - thumb_func_start sub_80AA020 -sub_80AA020: @ 80AA020 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x0000271a - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r5, r0, r1 - ldrh r0, [r5, 0xA] - adds r1, r0, 0x1 - strh r1, [r5, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xD - ble _080AA0B0 - ldrh r0, [r5, 0xC] - adds r0, 0x1 - movs r6, 0 - strh r0, [r5, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bne _080AA0B0 - ldr r3, =0x02037b14 - lsls r2, 4 - mov r12, r2 - ldr r1, =0x0000010d - add r1, r12 - lsls r1, 1 - adds r1, r3 - ldrh r4, [r1] - movs r2, 0x87 - lsls r2, 1 - add r2, r12 - lsls r2, 1 - adds r2, r3 - ldrh r0, [r2] - strh r0, [r1] - ldr r0, =0x0000010f - add r0, r12 - lsls r0, 1 - adds r0, r3 - ldrh r1, [r0] - strh r1, [r2] - strh r4, [r0] - strh r6, [r5, 0xC] - ldrh r0, [r5, 0xE] - adds r0, 0x1 - strh r0, [r5, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bne _080AA0B0 - strh r6, [r5, 0xE] - strh r6, [r5, 0xA] - ldrh r0, [r5, 0x10] - adds r0, 0x1 - strh r0, [r5, 0x10] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _080AA0B0 - movs r0, 0x9 - strh r0, [r5, 0xA] - ldr r0, =sub_80AA0D0 - str r0, [r5] -_080AA0B0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AA020 - - thumb_func_start sub_80AA0D0 -sub_80AA0D0: @ 80AA0D0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r2, r1, r2 - ldrh r0, [r2, 0xA] - subs r0, 0x1 - adds r3, r0, 0 - strh r0, [r2, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _080AA108 - ldr r0, =sub_80AA124 - str r0, [r2] - movs r0, 0 - strh r0, [r2, 0xA] - b _080AA11E - .pool -_080AA108: - lsls r0, r3, 24 - lsrs r0, 24 - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg -_080AA11E: - pop {r0} - bx r0 - thumb_func_end sub_80AA0D0 - - thumb_func_start sub_80AA124 -sub_80AA124: @ 80AA124 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r1 - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x25 - bne _080AA16C - ldrh r0, [r1, 0x26] - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - adds r0, r4, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - b _080AA186 - .pool -_080AA16C: - cmp r0, 0x27 - bne _080AA186 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl move_anim_task_del -_080AA186: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80AA124 - - thumb_func_start sub_80AA18C -sub_80AA18C: @ 80AA18C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r3, 0 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrh r0, [r0] - subs r0, 0xF - cmp r0, 0x2B - bls _080AA1A4 - b _080AA328 -_080AA1A4: - lsls r0, 2 - ldr r1, =_080AA1B8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080AA1B8: - .4byte _080AA268 - .4byte _080AA26E - .4byte _080AA274 - .4byte _080AA27A - .4byte _080AA280 - .4byte _080AA286 - .4byte _080AA28C - .4byte _080AA292 - .4byte _080AA298 - .4byte _080AA29E - .4byte _080AA2A4 - .4byte _080AA2AA - .4byte _080AA2B0 - .4byte _080AA2B6 - .4byte _080AA328 - .4byte _080AA328 - .4byte _080AA328 - .4byte _080AA328 - .4byte _080AA328 - .4byte _080AA328 - .4byte _080AA328 - .4byte _080AA328 - .4byte _080AA328 - .4byte _080AA328 - .4byte _080AA2BC - .4byte _080AA2C0 - .4byte _080AA2C4 - .4byte _080AA2C8 - .4byte _080AA2CC - .4byte _080AA2D0 - .4byte _080AA2D4 - .4byte _080AA2D8 - .4byte _080AA2E0 - .4byte _080AA2E8 - .4byte _080AA2F0 - .4byte _080AA2F8 - .4byte _080AA300 - .4byte _080AA308 - .4byte _080AA328 - .4byte _080AA328 - .4byte _080AA310 - .4byte _080AA314 - .4byte _080AA318 - .4byte _080AA320 -_080AA268: - movs r5, 0 - movs r2, 0 - b _080AA330 -_080AA26E: - movs r5, 0 - movs r2, 0x1 - b _080AA330 -_080AA274: - movs r5, 0 - movs r2, 0x3 - b _080AA330 -_080AA27A: - movs r5, 0 - movs r2, 0x5 - b _080AA330 -_080AA280: - movs r5, 0 - movs r2, 0x6 - b _080AA330 -_080AA286: - movs r5, 0 - movs r2, 0x2 - b _080AA330 -_080AA28C: - movs r5, 0 - movs r2, 0x4 - b _080AA330 -_080AA292: - movs r5, 0x1 - movs r2, 0 - b _080AA330 -_080AA298: - movs r5, 0x1 - movs r2, 0x1 - b _080AA330 -_080AA29E: - movs r5, 0x1 - movs r2, 0x3 - b _080AA330 -_080AA2A4: - movs r5, 0x1 - movs r2, 0x5 - b _080AA330 -_080AA2AA: - movs r5, 0x1 - movs r2, 0x6 - b _080AA330 -_080AA2B0: - movs r5, 0x1 - movs r2, 0x2 - b _080AA330 -_080AA2B6: - movs r5, 0x1 - movs r2, 0x4 - b _080AA330 -_080AA2BC: - movs r5, 0 - b _080AA2DA -_080AA2C0: - movs r5, 0 - b _080AA2E2 -_080AA2C4: - movs r5, 0 - b _080AA2EA -_080AA2C8: - movs r5, 0 - b _080AA2F2 -_080AA2CC: - movs r5, 0 - b _080AA2FA -_080AA2D0: - movs r5, 0 - b _080AA302 -_080AA2D4: - movs r5, 0 - b _080AA30A -_080AA2D8: - movs r5, 0x1 -_080AA2DA: - movs r2, 0 - movs r3, 0x1 - b _080AA330 -_080AA2E0: - movs r5, 0x1 -_080AA2E2: - movs r2, 0x1 - movs r3, 0x1 - b _080AA330 -_080AA2E8: - movs r5, 0x1 -_080AA2EA: - movs r2, 0x3 - movs r3, 0x1 - b _080AA330 -_080AA2F0: - movs r5, 0x1 -_080AA2F2: - movs r2, 0x5 - movs r3, 0x1 - b _080AA330 -_080AA2F8: - movs r5, 0x1 -_080AA2FA: - movs r2, 0x6 - movs r3, 0x1 - b _080AA330 -_080AA300: - movs r5, 0x1 -_080AA302: - movs r2, 0x2 - movs r3, 0x1 - b _080AA330 -_080AA308: - movs r5, 0x1 -_080AA30A: - movs r2, 0x4 - movs r3, 0x1 - b _080AA330 -_080AA310: - movs r5, 0 - b _080AA31A -_080AA314: - movs r5, 0 - b _080AA322 -_080AA318: - movs r5, 0x1 -_080AA31A: - movs r2, 0xFF - movs r3, 0 - b _080AA330 -_080AA320: - movs r5, 0x1 -_080AA322: - movs r2, 0xFF - movs r3, 0x1 - b _080AA330 -_080AA328: - adds r0, r4, 0 - bl move_anim_task_del - b _080AA352 -_080AA330: - ldr r0, =0x0203841e - movs r1, 0 - strh r5, [r0] - strh r2, [r0, 0x2] - strh r1, [r0, 0x4] - strh r1, [r0, 0x6] - strh r3, [r0, 0x8] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8116EB4 - str r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 -_080AA352: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AA18C - - thumb_func_start move_anim_start_t2 -move_anim_start_t2: @ 80AA364 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0x02038436 - strb r4, [r0] - ldr r0, =0x02038437 - strb r4, [r0] - ldr r0, =gUnknown_082C92FC - movs r2, 0 - bl move_something - ldr r0, =task0A_80788BC - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end move_anim_start_t2 - - thumb_func_start task0A_80788BC -task0A_80788BC: @ 80AA3B4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x020383f8 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =0x020383fd - ldrb r0, [r0] - cmp r0, 0 - bne _080AA3F6 - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - ldrsh r0, [r0, r1] - ldr r2, [r2, 0x4] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - adds r0, r4, 0 - bl DestroyTask -_080AA3F6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task0A_80788BC - - thumb_func_start sub_80AA40C -sub_80AA40C: @ 80AA40C - push {lr} - adds r3, r0, 0 - ldr r2, =0x03005e00 - movs r0, 0x30 - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0xA - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _080AA43C - ldrb r0, [r3, 0x1] - movs r1, 0xD - negs r1, r1 - ands r1, r0 - strb r1, [r3, 0x1] - movs r0, 0x42 - strh r0, [r3, 0x22] - b _080AA46A - .pool -_080AA43C: - ldrh r1, [r3, 0x22] - movs r2, 0x22 - ldrsh r0, [r3, r2] - cmp r0, 0x42 - beq _080AA44A - adds r0, r1, 0x1 - strh r0, [r3, 0x22] -_080AA44A: - ldrh r1, [r3, 0x2E] - movs r2, 0x2E - ldrsh r0, [r3, r2] - cmp r0, 0 - beq _080AA458 - subs r0, r1, 0x1 - strh r0, [r3, 0x2E] -_080AA458: - ldr r0, =gUnknown_0853FF70 - movs r2, 0x2E - ldrsh r1, [r3, r2] - lsls r1, 1 - adds r1, r0 - ldrh r1, [r1] - movs r0, 0x52 - bl SetGpuReg -_080AA46A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AA40C - - thumb_func_start sub_80AA474 -sub_80AA474: @ 80AA474 - push {lr} - adds r3, r0, 0 - ldr r2, =0x03005e00 - movs r0, 0x30 - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0xA - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _080AA4A0 - ldrb r0, [r3, 0x1] - movs r1, 0xD - negs r1, r1 - ands r1, r0 - strb r1, [r3, 0x1] - movs r0, 0x42 - b _080AA4AC - .pool -_080AA4A0: - ldrh r1, [r3, 0x22] - movs r2, 0x22 - ldrsh r0, [r3, r2] - cmp r0, 0x42 - beq _080AA4AE - adds r0, r1, 0x1 -_080AA4AC: - strh r0, [r3, 0x22] -_080AA4AE: - pop {r0} - bx r0 - thumb_func_end sub_80AA474 - - thumb_func_start sub_80AA4B4 -sub_80AA4B4: @ 80AA4B4 - push {lr} - adds r2, r0, 0 - movs r1, 0x2E - ldrsh r0, [r2, r1] - cmp r0, 0x1 - bne _080AA4DC - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - bne _080AA4DC - adds r0, r2, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - b _080AA4E8 -_080AA4DC: - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_080AA4E8: - pop {r0} - bx r0 - thumb_func_end sub_80AA4B4 - - thumb_func_start sub_80AA4EC -sub_80AA4EC: @ 80AA4EC - push {r4-r7,lr} - lsls r0, 16 - ldr r2, =0xffc00000 - adds r0, r2 - lsrs r0, 16 - movs r6, 0 - lsls r7, r1, 16 -_080AA4FA: - lsls r5, r0, 16 - asrs r5, 16 - ldr r0, =gUnknown_085400D8 - adds r1, r5, 0 - asrs r2, r7, 16 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - adds r0, r4, 0 - adds r1, r6, 0 - bl StartObjectImageAnim - movs r0, 0x1 - strh r0, [r4, 0x2E] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r5, 0x20 - lsls r5, 16 - lsrs r0, r5, 16 - cmp r6, 0x4 - bls _080AA4FA - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AA4EC - - thumb_func_start sub_80AA548 -sub_80AA548: @ 80AA548 - push {r4-r6,lr} - lsls r0, 16 - ldr r2, =0xffc00000 - adds r0, r2 - lsrs r0, 16 - movs r5, 0 - lsls r6, r1, 16 -_080AA556: - lsls r4, r0, 16 - asrs r4, 16 - ldr r0, =gUnknown_085400D8 - adds r1, r4, 0 - asrs r2, r6, 16 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x02020630 - adds r2, r0 - adds r1, r5, 0x5 - lsls r1, 24 - lsrs r1, 24 - adds r0, r2, 0 - bl StartObjectImageAnim - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r4, 0x20 - lsls r4, 16 - lsrs r0, r4, 16 - cmp r5, 0x4 - bls _080AA556 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AA548 - - thumb_func_start title_screen_logo_shine_obj_callback_type1 -@ void title_screen_logo_shine_obj_callback_type1(struct obj *obj) -title_screen_logo_shine_obj_callback_type1: @ 80AA5A4 - push {r4,lr} - adds r3, r0, 0 - ldrh r2, [r3, 0x20] - movs r0, 0x20 - ldrsh r1, [r3, r0] - ldr r0, =0x0000010f - cmp r1, r0 - bgt _080AA63C - movs r4, 0x2E - ldrsh r0, [r3, r4] - adds r4, r2, 0 - cmp r0, 0 - beq _080AA630 - cmp r1, 0x77 - bgt _080AA5E0 - ldrh r1, [r3, 0x30] - movs r2, 0x30 - ldrsh r0, [r3, r2] - cmp r0, 0x1E - bgt _080AA5F8 - adds r1, 0x1 - strh r1, [r3, 0x30] - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x1E - bgt _080AA5F8 - adds r0, r1, 0x1 - b _080AA5F6 - .pool -_080AA5E0: - ldrh r1, [r3, 0x30] - movs r4, 0x30 - ldrsh r0, [r3, r4] - cmp r0, 0 - beq _080AA5F8 - subs r0, r1, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - cmp r0, 0 - beq _080AA5F8 - subs r0, r1, 0x2 -_080AA5F6: - strh r0, [r3, 0x30] -_080AA5F8: - ldrh r1, [r3, 0x30] - movs r0, 0x1F - ands r0, r1 - lsls r2, r0, 10 - lsls r1, r0, 5 - adds r2, r1 - orrs r2, r0 - movs r1, 0x20 - ldrsh r0, [r3, r1] - ldrh r4, [r3, 0x20] - cmp r0, 0x84 - beq _080AA61C - cmp r0, 0x88 - beq _080AA61C - cmp r0, 0x8C - beq _080AA61C - cmp r0, 0x90 - bne _080AA62C -_080AA61C: - ldr r1, =0x02037b14 - ldr r0, =0x000033f8 - strh r0, [r1] - b _080AA630 - .pool -_080AA62C: - ldr r0, =0x02037b14 - strh r2, [r0] -_080AA630: - adds r0, r4, 0x4 - strh r0, [r3, 0x20] - b _080AA648 - .pool -_080AA63C: - ldr r1, =0x02037b14 - movs r0, 0 - strh r0, [r1] - adds r0, r3, 0 - bl RemoveObjectAndFreeTiles -_080AA648: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end title_screen_logo_shine_obj_callback_type1 - - thumb_func_start title_screen_logo_shine_obj_callback_type2 -@ void title_screen_logo_shine_obj_callback_type2(struct obj *obj) -title_screen_logo_shine_obj_callback_type2: @ 80AA654 - push {lr} - adds r2, r0, 0 - ldrh r3, [r2, 0x20] - movs r0, 0x20 - ldrsh r1, [r2, r0] - ldr r0, =0x0000010f - cmp r1, r0 - bgt _080AA670 - adds r0, r3, 0 - adds r0, 0x8 - strh r0, [r2, 0x20] - b _080AA676 - .pool -_080AA670: - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles -_080AA676: - pop {r0} - bx r0 - thumb_func_end title_screen_logo_shine_obj_callback_type2 - - thumb_func_start title_screen_add_logo_shine_obj -@ void title_screen_add_logo_shine_obj(int a1) -title_screen_add_logo_shine_obj: @ 80AA67C - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - beq _080AA6D0 - cmp r5, 0x1 - bgt _080AA698 - cmp r5, 0 - beq _080AA69C - b _080AA766 -_080AA698: - cmp r5, 0x2 - bne _080AA766 -_080AA69C: - ldr r0, =gUnknown_08540124 - movs r1, 0 - movs r2, 0x44 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x1] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0, 0x1] - strh r5, [r0, 0x2E] - b _080AA766 - .pool -_080AA6D0: - ldr r0, =gUnknown_08540124 - mov r9, r0 - movs r1, 0 - movs r2, 0x44 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r2, r0, 24 - ldr r6, =0x02020630 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r6 - ldrb r2, [r1, 0x1] - movs r4, 0xD - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - movs r2, 0x8 - mov r8, r2 - mov r2, r8 - orrs r0, r2 - strb r0, [r1, 0x1] - strh r5, [r1, 0x2E] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - mov r0, r9 - movs r1, 0 - movs r2, 0x44 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r5, r6, 0 - adds r5, 0x1C - adds r0, r1, r5 - ldr r2, =title_screen_logo_shine_obj_callback_type2 - mov r10, r2 - str r2, [r0] - adds r1, r6 - ldrb r2, [r1, 0x1] - adds r0, r4, 0 - ands r0, r2 - mov r2, r8 - orrs r0, r2 - strb r0, [r1, 0x1] - movs r1, 0x50 - negs r1, r1 - mov r0, r9 - movs r2, 0x44 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r5, r0, r5 - mov r1, r10 - str r1, [r5] - adds r0, r6 - ldrb r1, [r0, 0x1] - ands r4, r1 - mov r2, r8 - orrs r4, r2 - strb r4, [r0, 0x1] -_080AA766: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end title_screen_add_logo_shine_obj - - thumb_func_start title_screen_vblank_callback -@ void title_screen_vblank_callback() -title_screen_vblank_callback: @ 80AA780 - push {lr} - bl sub_80BA0A8 - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - ldr r0, =0x02022e1a - ldrh r1, [r0] - movs r0, 0x16 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end title_screen_vblank_callback - - thumb_func_start c2_title_screen_1 -@ void c2_title_screen_1() -c2_title_screen_1: @ 80AA7A4 - push {r4,lr} - sub sp, 0x14 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x5 - bhi _080AA7E0 - lsls r0, 2 - ldr r1, =_080AA7C8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080AA7C8: - .4byte _080AA7E0 - .4byte _080AA8C4 - .4byte _080AA998 - .4byte _080AA9E0 - .4byte _080AAA14 - .4byte _080AAAF0 -_080AA7E0: - movs r0, 0 - bl SetVBlankCallback - 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 r1, 0xA0 - lsls r1, 19 - ldr r2, =0x00007fff - adds r0, r2, 0 - strh r0, [r1] - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0xC - movs r1, 0 - bl SetGpuReg - movs r0, 0xA - movs r1, 0 - bl SetGpuReg - movs r0, 0x8 - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - add r1, sp, 0xC - movs r0, 0 - strh r0, [r1] - ldr r1, =0x040000d4 - add r0, sp, 0xC - str r0, [r1] - movs r0, 0xC0 - lsls r0, 19 - str r0, [r1, 0x4] - ldr r0, =0x8100c000 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r2, 0 - str r2, [sp, 0x10] - add r0, sp, 0x10 - str r0, [r1] - movs r0, 0xE0 - lsls r0, 19 - str r0, [r1, 0x4] - ldr r0, =0x85000100 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - add r0, sp, 0xC - strh r2, [r0] - str r0, [r1] - ldr r0, =0x05000002 - str r0, [r1, 0x4] - ldr r0, =0x810001ff - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - bl sub_80A1A74 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - b _080AAB1E - .pool -_080AA8C4: - ldr r0, =gTitleScreenPokemonLogoTiles - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gUnknown_08DE0644 - ldr r1, =0x06004800 - bl LZ77UnCompVram - ldr r0, =gTitleScreenBgPalettes - movs r2, 0xF0 - lsls r2, 1 - movs r1, 0 - bl gpu_pal_apply - ldr r0, =gTitleScreenRayquazaTiles - ldr r1, =0x06008000 - bl LZ77UnCompVram - ldr r0, =gUnknown_0853F83C - ldr r1, =0x0600d000 - bl LZ77UnCompVram - ldr r0, =gTitleScreenCloudsTiles - ldr r1, =0x0600c000 - bl LZ77UnCompVram - ldr r0, =gUnknown_08DDE458 - ldr r1, =0x0600d800 - bl LZ77UnCompVram - bl remove_some_task - bl ResetTasks - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - ldr r1, =0x0300301c - movs r0, 0x9 - strb r0, [r1] - ldr r0, =gUnknown_08540048 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085400F0 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0854013C - bl LoadCompressedObjectPic - ldr r0, =gUnknown_08DDE438 - movs r1, 0x80 - lsls r1, 1 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_08540100 - bl LoadTaggedObjectPalette - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0x2 - strb r1, [r0] - b _080AAB1E - .pool -_080AA998: - ldr r0, =task_title_screen_1 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0 - movs r0, 0x80 - lsls r0, 1 - strh r0, [r1, 0x8] - strh r2, [r1, 0xA] - ldr r0, =0x0000fff0 - strh r0, [r1, 0xC] - subs r0, 0x10 - strh r0, [r1, 0xE] - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0x3 - strb r1, [r0] - b _080AAB1E - .pool -_080AA9E0: - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =title_screen_vblank_callback - bl SetVBlankCallback - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0x4 - strb r1, [r0] - b _080AAB1E - .pool -_080AAA14: - movs r2, 0x80 - lsls r2, 1 - movs r0, 0x78 - movs r1, 0x50 - movs r3, 0 - bl sub_816F2A8 - movs r1, 0xE3 - lsls r1, 8 - movs r0, 0x28 - bl SetGpuReg - ldr r4, =0x0000ffff - movs r0, 0x2A - adds r1, r4, 0 - bl SetGpuReg - movs r1, 0xE0 - lsls r1, 8 - movs r0, 0x2C - bl SetGpuReg - movs r0, 0x2E - adds r1, r4, 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 - ldr r1, =0x00001f1f - movs r0, 0x48 - bl SetGpuReg - ldr r1, =0x00003f1f - movs r0, 0x4A - bl SetGpuReg - movs r0, 0x50 - movs r1, 0x84 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0xC - bl SetGpuReg - ldr r1, =0x00001a0b - movs r0, 0x8 - bl SetGpuReg - ldr r1, =0x00001b0e - movs r0, 0xA - bl SetGpuReg - ldr r1, =0x00004981 - movs r0, 0xC - bl SetGpuReg - movs r0, 0x1 - bl EnableInterrupts - ldr r1, =0x0000b441 - movs r0, 0 - bl SetGpuReg - ldr r0, =0x0000019d - bl m4aSongNumStart - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0x5 - strb r1, [r0] - b _080AAB1E - .pool -_080AAAF0: - bl fade_and_return_progress_probably - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _080AAB1E - movs r0, 0 - bl title_screen_add_logo_shine_obj - str r4, [sp] - movs r0, 0x4 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0xA0 - movs r2, 0x4 - movs r3, 0x4 - bl sub_80BA384 - ldr r0, =c2_title_screen_2 - bl SetMainCallback2 -_080AAB1E: - add sp, 0x14 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end c2_title_screen_1 - - thumb_func_start c2_title_screen_2 -@ void c2_title_screen_2() -c2_title_screen_2: @ 80AAB2C - push {lr} - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end c2_title_screen_2 - - thumb_func_start task_title_screen_1 -@ void task_title_screen_1(int task_id) -task_title_screen_1: @ 80AAB44 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0xF - ands r0, r1 - ldr r6, =0x03005e00 - cmp r0, 0 - bne _080AAB6A - lsls r0, r5, 2 - adds r1, r0, r5 - lsls r1, 3 - adds r1, r6 - movs r2, 0xA - ldrsh r1, [r1, r2] - adds r4, r0, 0 - cmp r1, 0 - beq _080AAB7C -_080AAB6A: - lsls r3, r5, 2 - adds r0, r3, r5 - lsls r0, 3 - adds r0, r6 - movs r2, 0 - movs r1, 0x1 - strh r1, [r0, 0xA] - strh r2, [r0, 0x8] - adds r4, r3, 0 -_080AAB7C: - adds r0, r4, r5 - lsls r0, 3 - adds r6, r0, r6 - movs r1, 0x8 - ldrsh r0, [r6, r1] - cmp r0, 0 - beq _080AABC0 - ldrh r0, [r6, 0x8] - cmp r0, 0xB0 - bne _080AABA0 - movs r0, 0x1 - bl title_screen_add_logo_shine_obj - b _080AABAA - .pool -_080AABA0: - cmp r0, 0x40 - bne _080AABAA - movs r0, 0x2 - bl title_screen_add_logo_shine_obj -_080AABAA: - ldr r0, =0x03005e00 - adds r1, r4, r5 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - subs r0, 0x1 - strh r0, [r1, 0x8] - b _080AAC32 - .pool -_080AABC0: - ldr r1, =0x00001441 - movs r0, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - ldr r1, =0x00003f50 - movs r0, 0x50 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0x10 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - ldr r0, =gUnknown_08540018 - movs r1, 0x62 - movs r2, 0x2 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - movs r0, 0x40 - strh r0, [r1, 0x2E] - strh r5, [r1, 0x30] - ldr r0, =gUnknown_08540030 - movs r1, 0xA2 - movs r2, 0x2 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - strh r5, [r1, 0x30] - movs r0, 0x90 - strh r0, [r6, 0x8] - ldr r0, =task_title_screen_2 - str r0, [r6] -_080AAC32: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task_title_screen_1 - - thumb_func_start task_title_screen_2 -@ void task_title_screen_2(int task_id) -task_title_screen_2: @ 80AAC50 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0xF - ands r0, r1 - ldr r2, =0x03005e00 - cmp r0, 0 - bne _080AAC76 - lsls r0, r4, 2 - adds r1, r0, r4 - lsls r1, 3 - adds r1, r2 - movs r3, 0xA - ldrsh r1, [r1, r3] - adds r6, r0, 0 - cmp r1, 0 - beq _080AAC88 -_080AAC76: - lsls r3, r4, 2 - adds r0, r3, r4 - lsls r0, 3 - adds r0, r2 - movs r2, 0 - movs r1, 0x1 - strh r1, [r0, 0xA] - strh r2, [r0, 0x8] - adds r6, r3, 0 -_080AAC88: - ldr r1, =0x03005e00 - adds r0, r6, r4 - lsls r0, 3 - adds r5, r0, r1 - ldrh r0, [r5, 0x8] - movs r1, 0x8 - ldrsh r7, [r5, r1] - cmp r7, 0 - beq _080AACA8 - subs r0, 0x1 - strh r0, [r5, 0x8] - b _080AACE2 - .pool -_080AACA8: - movs r0, 0x1 - strh r0, [r5, 0xA] - ldr r1, =0x00002142 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x00000f06 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - ldr r1, =0x00001741 - movs r0, 0 - bl SetGpuReg - movs r0, 0x80 - movs r1, 0x6C - bl sub_80AA4EC - movs r0, 0x80 - movs r1, 0x94 - bl sub_80AA548 - strh r7, [r5, 0x10] - ldr r0, =task_title_screen_3 - str r0, [r5] -_080AACE2: - ldr r2, =0x03005e00 - adds r0, r6, r4 - lsls r0, 3 - adds r3, r0, r2 - ldrh r1, [r3, 0x8] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _080AAD02 - ldrh r1, [r3, 0xC] - movs r5, 0xC - ldrsh r0, [r3, r5] - cmp r0, 0 - beq _080AAD02 - adds r0, r1, 0x1 - strh r0, [r3, 0xC] -_080AAD02: - adds r0, r6, r4 - lsls r0, 3 - adds r3, r0, r2 - ldrh r1, [r3, 0x8] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080AAD20 - ldrh r1, [r3, 0xE] - movs r5, 0xE - ldrsh r0, [r3, r5] - cmp r0, 0 - beq _080AAD20 - adds r0, r1, 0x1 - strh r0, [r3, 0xE] -_080AAD20: - adds r4, r6, r4 - lsls r4, 3 - adds r4, r2 - movs r0, 0xE - ldrsh r1, [r4, r0] - lsls r5, r1, 8 - lsls r1, 24 - lsrs r1, 16 - movs r0, 0x2C - bl SetGpuReg - lsrs r5, 16 - movs r0, 0x2E - adds r1, r5, 0 - bl SetGpuReg - movs r0, 0xF - strh r0, [r4, 0x12] - movs r0, 0x6 - strh r0, [r4, 0x14] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end task_title_screen_2 - - thumb_func_start task_title_screen_3 -@ void task_title_screen_3(int task_id) -task_title_screen_3: @ 80AAD64 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080AAD84 - movs r0, 0x8 - ands r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _080AADB0 -_080AAD84: - movs r0, 0x4 - bl play_sound_effect - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =Cb2_GoToMainMenu - bl SetMainCallback2 - b _080AAE98 - .pool -_080AADB0: - ldrh r1, [r2, 0x2C] - movs r0, 0x46 - ands r0, r1 - cmp r0, 0x46 - bne _080AADC8 - ldr r0, =c2_clear_save_data_screen_1 - bl SetMainCallback2 - b _080AAE98 - .pool -_080AADC8: - movs r0, 0x26 - ands r0, r1 - cmp r0, 0x26 - bne _080AADFC - bl sub_809D614 - cmp r0, 0x1 - bne _080AADFC - movs r0, 0x4 - bl play_sound_effect - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =c2_reset_rtc_screen_1 - bl SetMainCallback2 - b _080AAE98 - .pool -_080AADFC: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2C] - movs r0, 0x6 - ands r0, r1 - cmp r0, 0x6 - bne _080AAE30 - movs r0, 0x4 - bl play_sound_effect - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =c2_berry_program_update_screen_1 - bl SetMainCallback2 - b _080AAE98 - .pool -_080AAE30: - movs r0, 0x2C - movs r1, 0 - bl SetGpuReg - movs r0, 0x2E - movs r1, 0 - bl SetGpuReg - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r3, r0, r1 - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080AAE72 - ldrh r0, [r3, 0x10] - adds r0, 0x1 - strh r0, [r3, 0x10] - ldr r2, =0x02022e1a - movs r1, 0x10 - ldrsh r0, [r3, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r2] - ldr r1, =0x02022e18 - movs r0, 0 - strh r0, [r1] -_080AAE72: - ldrb r0, [r3, 0x8] - bl title_screen_update_rayquaza_ring_palette - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - ldrh r0, [r0, 0x4] - cmp r0, 0 - bne _080AAE98 - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =c2_show_copyright_and_intro_again_1 - bl SetMainCallback2 -_080AAE98: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task_title_screen_3 - - thumb_func_start Cb2_GoToMainMenu -Cb2_GoToMainMenu: @ 80AAEB8 - push {lr} - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _080AAECA - ldr r0, =CB2_InitMainMenu - bl SetMainCallback2 -_080AAECA: - pop {r0} - bx r0 - .pool - thumb_func_end Cb2_GoToMainMenu - - thumb_func_start c2_show_copyright_and_intro_again_1 -c2_show_copyright_and_intro_again_1: @ 80AAED4 - push {lr} - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _080AAEE6 - ldr r0, =c2_show_copyright_and_intro_again_2 - bl SetMainCallback2 -_080AAEE6: - pop {r0} - bx r0 - .pool - thumb_func_end c2_show_copyright_and_intro_again_1 - - thumb_func_start c2_clear_save_data_screen_1 -c2_clear_save_data_screen_1: @ 80AAEF0 - push {lr} - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _080AAF02 - ldr r0, =c2_clear_save_data_screen_2 - bl SetMainCallback2 -_080AAF02: - pop {r0} - bx r0 - .pool - thumb_func_end c2_clear_save_data_screen_1 - - thumb_func_start c2_reset_rtc_screen_1 -c2_reset_rtc_screen_1: @ 80AAF0C - push {lr} - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _080AAF1E - ldr r0, =sub_809EF88 - bl SetMainCallback2 -_080AAF1E: - pop {r0} - bx r0 - .pool - thumb_func_end c2_reset_rtc_screen_1 - - thumb_func_start c2_berry_program_update_screen_1 -c2_berry_program_update_screen_1: @ 80AAF28 - push {lr} - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _080AAF3E - bl m4aMPlayAllStop - ldr r0, =sub_81BF384 - bl SetMainCallback2 -_080AAF3E: - pop {r0} - bx r0 - .pool - thumb_func_end c2_berry_program_update_screen_1 - - thumb_func_start title_screen_update_rayquaza_ring_palette -@ void title_screen_update_rayquaza_ring_palette(u8 a1) -title_screen_update_rayquaza_ring_palette: @ 80AAF48 - push {lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _080AAF9C - adds r0, r1, 0 - movs r1, 0x80 - bl cosine - lsls r0, 16 - asrs r0, 16 - adds r2, r0, 0 - adds r2, 0x80 - lsls r0, r2, 5 - subs r0, r2 - cmp r0, 0 - bge _080AAF72 - adds r0, 0xFF -_080AAF72: - asrs r0, 8 - movs r3, 0x1F - subs r1, r3, r0 - movs r0, 0x16 - muls r0, r2 - cmp r0, 0 - bge _080AAF82 - adds r0, 0xFF -_080AAF82: - asrs r0, 8 - subs r0, r3, r0 - lsls r0, 5 - orrs r1, r0 - movs r0, 0xC0 - lsls r0, 6 - orrs r1, r0 - mov r0, sp - strh r1, [r0] - movs r1, 0xEF - movs r2, 0x2 - bl gpu_pal_apply -_080AAF9C: - add sp, 0x4 - pop {r0} - bx r0 - thumb_func_end title_screen_update_rayquaza_ring_palette - - thumb_func_start sub_80AAFA4 -@ void sub_80AAFA4() -sub_80AAFA4: @ 80AAFA4 - push {r4-r6,lr} - ldr r0, =sub_80AB1B0 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _080AB060 - movs r0, 0x90 - lsls r0, 5 - bl AllocObjectPalette - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0854C270 - lsls r1, r5, 5 - ldr r2, =0x02037914 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - bl sub_80AB294 - ldr r4, =0x02038454 - ldr r1, =0x000006d5 - adds r0, r4, r1 - strb r5, [r0] - ldr r0, =0x00001201 - bl AllocObjectPalette - ldr r2, =0x000006d4 - adds r1, r4, r2 - strb r0, [r1] - ldr r1, =0x000006da - adds r0, r4, r1 - strb r6, [r0] - adds r2, 0x4 - adds r0, r4, r2 - strb r6, [r0] - adds r1, 0x4 - adds r0, r4, r1 - strb r6, [r0] - adds r2, 0xC - adds r0, r4, r2 - strb r6, [r0] - adds r1, 0x22 - adds r0, r4, r1 - strb r6, [r0] - adds r2, 0x17 - adds r0, r4, r2 - strb r6, [r0] - adds r1, 0x24 - adds r0, r4, r1 - strb r6, [r0] - adds r2, 0x1B - adds r0, r4, r2 - strb r6, [r0] - subs r1, 0xD - adds r0, r4, r1 - strb r6, [r0] - adds r2, 0x18 - adds r0, r4, r2 - strb r6, [r0] - subs r1, 0x1D - adds r0, r4, r1 - strb r6, [r0] - movs r0, 0x10 - movs r1, 0 - bl sub_80AC124 - movs r2, 0xDA - lsls r2, 3 - adds r0, r4, r2 - strb r6, [r0] - ldr r0, =0x000006c6 - adds r1, r4, r0 - movs r0, 0x3 - strb r0, [r1] - movs r1, 0xD9 - lsls r1, 3 - adds r0, r4, r1 - strb r6, [r0] - adds r2, 0x3 - adds r1, r4, r2 - movs r0, 0x1 - strb r0, [r1] - ldr r0, =sub_80AB160 - movs r1, 0x50 - bl CreateTask - ldr r1, =0x000006c9 - adds r4, r1 - strb r0, [r4] -_080AB060: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AAFA4 - - thumb_func_start weather_set -weather_set: @ 80AB098 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - beq _080AB0AE - cmp r4, 0x5 - beq _080AB0AE - cmp r4, 0xD - beq _080AB0AE - bl play_some_sound -_080AB0AE: - ldr r1, =0x02038454 - ldr r2, =0x000006d1 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, r4 - beq _080AB0D2 - movs r3, 0xDA - lsls r3, 3 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r4 - bne _080AB0D2 - ldr r0, =gUnknown_0854C150 - lsls r1, r4, 4 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 -_080AB0D2: - ldr r1, =0x02038454 - ldr r2, =0x000006d3 - adds r0, r1, r2 - movs r2, 0 - strb r2, [r0] - ldr r3, =0x000006d1 - adds r0, r1, r3 - strb r4, [r0] - ldr r0, =0x000006ce - adds r1, r0 - strh r2, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end weather_set - - thumb_func_start sub_80AB104 -sub_80AB104: @ 80AB104 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl play_some_sound - ldr r0, =0x02038454 - movs r2, 0xDA - lsls r2, 3 - adds r1, r0, r2 - strb r4, [r1] - ldr r1, =0x000006d1 - adds r0, r1 - strb r4, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AB104 - - thumb_func_start sub_80AB130 -sub_80AB130: @ 80AB130 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl play_some_sound - ldr r1, =0x02038454 - movs r2, 0xDA - lsls r2, 3 - adds r0, r1, r2 - strb r4, [r0] - adds r2, 0x1 - adds r0, r1, r2 - strb r4, [r0] - movs r0, 0xD9 - lsls r0, 3 - adds r1, r0 - movs r0, 0x1 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AB130 - - thumb_func_start sub_80AB160 -sub_80AB160: @ 80AB160 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r2, =0x02038454 - movs r1, 0xD9 - lsls r1, 3 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080AB198 - ldr r1, =gUnknown_0854C150 - movs r3, 0xDA - lsls r3, 3 - adds r0, r2, r3 - ldrb r0, [r0] - lsls r0, 4 - adds r1, 0x8 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80AB1B0 - str r1, [r0] -_080AB198: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AB160 - - thumb_func_start sub_80AB1B0 -sub_80AB1B0: @ 80AB1B0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r5, =0x02038454 - movs r0, 0xDA - lsls r0, 3 - adds r6, r5, r0 - ldr r1, =0x000006d1 - adds r7, r5, r1 - ldrb r0, [r6] - ldrb r2, [r7] - cmp r0, r2 - beq _080AB22C - ldr r0, =gUnknown_0854C150 - mov r9, r0 - ldrb r0, [r6] - lsls r0, 4 - mov r1, r9 - adds r1, 0xC - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _080AB23C - ldr r1, =0x000006c6 - adds r1, r5 - mov r8, r1 - ldrb r0, [r1] - cmp r0, 0x2 - beq _080AB23C - ldrb r0, [r7] - lsls r0, 4 - add r0, r9 - ldr r0, [r0] - bl _call_via_r0 - ldr r2, =0x000006c3 - adds r0, r5, r2 - strb r4, [r0] - mov r0, r8 - strb r4, [r0] - ldrb r0, [r7] - strb r0, [r6] - adds r2, 0x10 - adds r1, r5, r2 - movs r0, 0x1 - strb r0, [r1] - b _080AB23C - .pool -_080AB22C: - ldr r0, =gUnknown_0854C150 - ldrb r1, [r6] - lsls r1, 4 - adds r0, 0x4 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 -_080AB23C: - ldr r1, =gUnknown_0854C240 - ldr r0, =0x02038454 - ldr r2, =0x000006c6 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AB1B0 - - thumb_func_start sub_80AB26C -sub_80AB26C: @ 80AB26C - ldr r0, =0x02038454 - ldr r2, =0x000006c1 - adds r1, r0, r2 - movs r2, 0 - strb r2, [r1] - ldr r1, =0x000006c2 - adds r0, r1 - strb r2, [r0] - bx lr - .pool - thumb_func_end sub_80AB26C - - thumb_func_start nullsub_36 -nullsub_36: @ 80AB28C - bx lr - thumb_func_end nullsub_36 - - thumb_func_start sub_80AB290 -sub_80AB290: @ 80AB290 - movs r0, 0 - bx lr - thumb_func_end sub_80AB290 - - thumb_func_start sub_80AB294 -sub_80AB294: @ 80AB294 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r1, =0x03000f50 - ldr r0, =gUnknown_0854C250 - str r0, [r1] - movs r0, 0 - mov r12, r0 - ldr r1, =0x020388b4 - mov r10, r1 -_080AB2AC: - mov r7, r10 - mov r0, r12 - cmp r0, 0 - bne _080AB2B8 - ldr r1, =0xfffffda0 - adds r7, r1 -_080AB2B8: - movs r5, 0 - movs r0, 0x1 - add r0, r12 - mov r9, r0 -_080AB2C0: - lsls r1, r5, 8 - lsls r0, r5, 24 - lsrs r2, r0, 16 - mov r0, r12 - cmp r0, 0 - bne _080AB2E4 - adds r0, r1, 0 - lsls r0, 12 - lsrs r4, r0, 16 - b _080AB2E6 - .pool -_080AB2E4: - movs r4, 0 -_080AB2E6: - movs r3, 0 - adds r1, r5, 0x1 - mov r8, r1 -_080AB2EC: - subs r1, r2, r4 - lsls r1, 16 - lsrs r2, r1, 16 - lsls r0, r3, 5 - adds r0, r7 - adds r0, r5 - lsrs r1, 24 - strb r1, [r0] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x2 - bls _080AB2EC - adds r6, r2, 0 - movs r0, 0xF8 - lsls r0, 5 - subs r0, r2 - cmp r0, 0 - bge _080AB314 - adds r0, 0xF -_080AB314: - lsls r0, 12 - lsrs r4, r0, 16 - cmp r5, 0xB - bhi _080AB35E - cmp r3, 0x12 - bhi _080AB384 -_080AB320: - adds r0, r2, r4 - lsls r0, 16 - lsrs r2, r0, 16 - subs r0, r2, r6 - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0 - ble _080AB33C - lsrs r0, 31 - adds r0, r1, r0 - asrs r0, 1 - subs r0, r2, r0 - lsls r0, 16 - lsrs r2, r0, 16 -_080AB33C: - lsls r0, r3, 5 - adds r0, r7 - adds r1, r0, r5 - lsrs r0, r2, 8 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1F - bls _080AB352 - movs r0, 0x1F - strb r0, [r1] -_080AB352: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x12 - bls _080AB320 - b _080AB384 -_080AB35E: - cmp r3, 0x12 - bhi _080AB384 - movs r6, 0x1F -_080AB364: - adds r1, r2, r4 - lsls r1, 16 - lsrs r2, r1, 16 - lsls r0, r3, 5 - adds r0, r7 - adds r0, r5 - lsrs r1, 24 - strb r1, [r0] - cmp r1, 0x1F - bls _080AB37A - strb r6, [r0] -_080AB37A: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x12 - bls _080AB364 -_080AB384: - mov r1, r8 - lsls r0, r1, 16 - lsrs r5, r0, 16 - cmp r5, 0x1F - bls _080AB2C0 - mov r1, r9 - lsls r0, r1, 16 - lsrs r0, 16 - mov r12, r0 - cmp r0, 0x1 - bls _080AB2AC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80AB294 - - thumb_func_start sub_80AB3A8 -sub_80AB3A8: @ 80AB3A8 - push {r4-r7,lr} - ldr r0, =0x02038454 - ldr r1, =0x000006c6 - adds r2, r0, r1 - ldrb r1, [r2] - adds r3, r0, 0 - cmp r1, 0x2 - beq _080AB42C - movs r7, 0xD8 - lsls r7, 3 - adds r4, r3, r7 - ldr r1, =0x000006c1 - adds r0, r3, r1 - ldrb r7, [r4] - mov r12, r7 - movs r6, 0 - ldrsb r6, [r4, r6] - movs r5, 0 - ldrsb r5, [r0, r5] - cmp r6, r5 - bne _080AB3E4 - movs r0, 0x3 - strb r0, [r2] - b _080AB42C - .pool -_080AB3E4: - ldr r0, =0x000006c3 - adds r2, r3, r0 - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - ldr r7, =0x000006c2 - adds r1, r3, r7 - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bcc _080AB42C - movs r0, 0 - strb r0, [r2] - mov r0, r12 - cmp r6, r5 - bge _080AB414 - adds r0, 0x1 - b _080AB418 - .pool -_080AB414: - mov r0, r12 - subs r0, 0x1 -_080AB418: - strb r0, [r4] - movs r1, 0xD8 - lsls r1, 3 - adds r0, r3, r1 - movs r2, 0 - ldrsb r2, [r0, r2] - movs r0, 0 - movs r1, 0x20 - bl pal_fade_2 -_080AB42C: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80AB3A8 - - thumb_func_start sub_80AB434 -sub_80AB434: @ 80AB434 - push {lr} - ldr r2, =0x02038454 - ldr r0, =0x000006cb - adds r1, r2, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _080AB452 - ldr r3, =0x000006ca - adds r1, r2, r3 - movs r0, 0 - strb r0, [r1] -_080AB452: - movs r1, 0xDA - lsls r1, 3 - adds r0, r2, r1 - ldrb r0, [r0] - subs r0, 0x3 - cmp r0, 0xA - bhi _080AB51C - lsls r0, 2 - ldr r1, =_080AB47C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080AB47C: - .4byte _080AB4A8 - .4byte _080AB4A8 - .4byte _080AB4A8 - .4byte _080AB4F4 - .4byte _080AB51C - .4byte _080AB51C - .4byte _080AB51C - .4byte _080AB51C - .4byte _080AB4A8 - .4byte _080AB4D0 - .4byte _080AB4A8 -_080AB4A8: - bl sub_80AB54C - lsls r0, 24 - cmp r0, 0 - bne _080AB53C - ldr r0, =0x02038454 - movs r2, 0xD8 - lsls r2, 3 - adds r1, r0, r2 - movs r2, 0x3 - strb r2, [r1] - ldr r3, =0x000006c6 - adds r0, r3 - strb r2, [r0] - b _080AB53C - .pool -_080AB4D0: - bl sub_80AB5AC - lsls r0, 24 - cmp r0, 0 - bne _080AB53C - ldr r1, =0x02038454 - movs r0, 0xD8 - lsls r0, 3 - adds r2, r1, r0 - movs r0, 0xFA - strb r0, [r2] - ldr r2, =0x000006c6 - adds r1, r2 - b _080AB538 - .pool -_080AB4F4: - bl sub_80AB604 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - bne _080AB53C - ldr r0, =0x02038454 - movs r3, 0xD8 - lsls r3, 3 - adds r1, r0, r3 - strb r2, [r1] - ldr r1, =0x000006c6 - adds r0, r1 - movs r1, 0x3 - strb r1, [r0] - b _080AB53C - .pool -_080AB51C: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080AB53C - ldr r3, =0x000006c1 - adds r0, r2, r3 - ldrb r1, [r0] - subs r3, 0x1 - adds r0, r2, r3 - strb r1, [r0] - ldr r0, =0x000006c6 - adds r1, r2, r0 -_080AB538: - movs r0, 0x3 - strb r0, [r1] -_080AB53C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AB434 - - thumb_func_start sub_80AB54C -sub_80AB54C: @ 80AB54C - push {r4,lr} - sub sp, 0x4 - ldr r2, =0x02038454 - ldr r0, =0x000006c7 - adds r4, r2, r0 - ldrb r0, [r4] - cmp r0, 0x10 - beq _080AB5A2 - adds r1, r0, 0x1 - strb r1, [r4] - lsls r0, r1, 24 - lsrs r0, 24 - cmp r0, 0xF - bhi _080AB594 - movs r3, 0x10 - subs r3, r1 - lsls r3, 24 - lsrs r3, 24 - ldr r1, =0x000006c4 - adds r0, r2, r1 - ldrh r0, [r0] - str r0, [sp] - movs r0, 0 - movs r1, 0x20 - movs r2, 0x3 - bl sub_80AB848 - movs r0, 0x1 - b _080AB5A4 - .pool -_080AB594: - movs r0, 0 - movs r1, 0x20 - movs r2, 0x3 - bl pal_fade_2 - movs r0, 0x10 - strb r0, [r4] -_080AB5A2: - movs r0, 0 -_080AB5A4: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80AB54C - - thumb_func_start sub_80AB5AC -sub_80AB5AC: @ 80AB5AC - push {r4,lr} - ldr r2, =0x02038454 - ldr r0, =0x000006c7 - adds r4, r2, r0 - ldrb r0, [r4] - cmp r0, 0x10 - beq _080AB5FC - adds r3, r0, 0x1 - strb r3, [r4] - lsls r0, r3, 24 - lsrs r0, 24 - cmp r0, 0xF - bhi _080AB5EC - movs r0, 0x6 - negs r0, r0 - movs r1, 0x10 - subs r1, r3 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =0x000006c4 - adds r2, r3 - ldrh r2, [r2] - bl sub_80AB990 - movs r0, 0x1 - b _080AB5FE - .pool -_080AB5EC: - movs r2, 0x6 - negs r2, r2 - movs r0, 0 - movs r1, 0x20 - bl pal_fade_2 - movs r0, 0x10 - strb r0, [r4] -_080AB5FC: - movs r0, 0 -_080AB5FE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80AB5AC - - thumb_func_start sub_80AB604 -sub_80AB604: @ 80AB604 - push {lr} - ldr r2, =0x02038454 - ldr r1, =0x000006c7 - adds r0, r2, r1 - ldrb r1, [r0] - cmp r1, 0x10 - beq _080AB638 - adds r1, 0x1 - strb r1, [r0] - movs r0, 0x10 - subs r0, r1 - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x000006c4 - adds r1, r2, r3 - ldrh r1, [r1] - bl sub_80ABAB0 - movs r0, 0x1 - b _080AB63A - .pool -_080AB638: - movs r0, 0 -_080AB63A: - pop {r1} - bx r1 - thumb_func_end sub_80AB604 - - thumb_func_start nullsub_94 -nullsub_94: @ 80AB640 - bx lr - thumb_func_end nullsub_94 - - thumb_func_start pal_fade_2 -pal_fade_2: @ 80AB644 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r3, r0, 24 - adds r4, r3, 0 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - lsls r2, 24 - asrs r0, r2, 24 - cmp r0, 0 - ble _080AB754 - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r6, r3, 4 - adds r0, r1, r3 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - cmp r4, r9 - bcc _080AB67C - b _080AB82E -_080AB67C: - ldr r1, [sp] - lsls r0, r1, 24 - asrs r0, 19 - str r0, [sp, 0x4] -_080AB684: - ldr r0, =0x03000f50 - ldr r0, [r0] - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _080AB6C0 - lsls r1, r6, 1 - ldr r0, =0x02037714 - adds r0, r1, r0 - ldr r2, =0x02037b14 - adds r1, r2 - movs r2, 0x8 - bl CpuFastSet - adds r0, r6, 0 - adds r0, 0x10 - lsls r0, 16 - lsrs r6, r0, 16 - mov r2, r9 - lsls r2, 16 - mov r8, r2 - adds r4, 0x1 - mov r12, r4 - b _080AB73E - .pool -_080AB6C0: - cmp r0, 0x2 - beq _080AB6D4 - adds r1, r4, 0 - subs r1, 0x10 - ldr r2, =0x02038454 - ldr r3, =0x000006d5 - adds r0, r2, r3 - ldrb r0, [r0] - cmp r1, r0 - bne _080AB6E4 -_080AB6D4: - ldr r0, =0x020388b4 - b _080AB6EA - .pool -_080AB6E4: - movs r3, 0x80 - lsls r3, 2 - adds r0, r2, r3 -_080AB6EA: - ldr r1, [sp, 0x4] - adds r5, r1, r0 - movs r7, 0 - mov r2, r9 - lsls r2, 16 - mov r8, r2 - adds r4, 0x1 - mov r12, r4 - ldr r3, =0x02037b14 - mov r10, r3 -_080AB6FE: - adds r2, r6, 0 - lsls r0, r2, 1 - ldr r1, =0x02037714 - adds r0, r1 - ldr r1, [r0] - lsls r0, r1, 27 - lsrs r0, 27 - adds r0, r5, r0 - ldrb r4, [r0] - lsls r0, r1, 22 - lsrs r0, 27 - adds r0, r5, r0 - ldrb r3, [r0] - lsls r1, 17 - lsrs r1, 27 - adds r1, r5, r1 - ldrb r1, [r1] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r2, 1 - add r2, r10 - lsls r1, 10 - lsls r3, 5 - orrs r1, r3 - orrs r1, r4 - strh r1, [r2] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, 0xF - bls _080AB6FE -_080AB73E: - mov r2, r12 - lsls r0, r2, 16 - lsrs r4, r0, 16 - cmp r0, r8 - bcc _080AB684 - b _080AB82E - .pool -_080AB754: - cmp r0, 0 - bge _080AB81C - mvns r0, r0 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r6, r3, 4 - adds r0, r1, r3 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - adds r4, r3, 0 - cmp r4, r9 - bcs _080AB82E -_080AB770: - ldr r0, =0x03000f50 - ldr r0, [r0] - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _080AB7AC - lsls r1, r6, 1 - ldr r0, =0x02037714 - adds r0, r1, r0 - ldr r2, =0x02037b14 - adds r1, r2 - movs r2, 0x8 - bl CpuFastSet - adds r0, r6, 0 - adds r0, 0x10 - lsls r0, 16 - lsrs r6, r0, 16 - mov r3, r9 - lsls r3, 16 - mov r8, r3 - adds r4, 0x1 - mov r12, r4 - b _080AB804 - .pool -_080AB7AC: - movs r7, 0 - mov r0, r9 - lsls r0, 16 - mov r8, r0 - adds r4, 0x1 - mov r12, r4 - ldr r1, =gUnknown_0854014C - mov r10, r1 - ldr r2, [sp] - lsls r0, r2, 24 - asrs r5, r0, 11 -_080AB7C2: - lsls r0, r6, 1 - ldr r3, =0x02037b14 - adds r4, r0, r3 - ldr r1, =0x02037714 - adds r0, r1 - ldrh r3, [r0] - lsls r3, 16 - lsrs r0, r3, 17 - movs r1, 0xF - ands r0, r1 - lsrs r1, r3, 18 - movs r2, 0xF0 - ands r1, r2 - orrs r0, r1 - lsrs r3, 19 - movs r2, 0xF0 - lsls r2, 4 - adds r1, r2, 0 - ands r3, r1 - orrs r0, r3 - lsls r0, 1 - adds r0, r5 - add r0, r10 - ldrh r0, [r0] - strh r0, [r4] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, 0xF - bls _080AB7C2 -_080AB804: - mov r3, r12 - lsls r0, r3, 16 - lsrs r4, r0, 16 - cmp r0, r8 - bcc _080AB770 - b _080AB82E - .pool -_080AB81C: - lsls r1, r4, 5 - ldr r0, =0x02037714 - adds r0, r1, r0 - ldr r2, =0x02037b14 - adds r1, r2 - mov r3, r9 - lsls r2, r3, 3 - bl CpuFastSet -_080AB82E: - 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 pal_fade_2 - - thumb_func_start sub_80AB848 -sub_80AB848: @ 80AB848 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - ldr r4, [sp, 0x34] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - mov r1, sp - strh r4, [r1] - ldr r1, [sp] - lsls r3, r1, 27 - lsrs r3, 27 - str r3, [sp, 0x4] - lsls r3, r1, 22 - lsrs r3, 27 - str r3, [sp, 0x8] - lsls r1, 17 - lsrs r1, 27 - str r1, [sp, 0xC] - lsls r6, r0, 4 - mov r3, r10 - adds r1, r3, r0 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - movs r1, 0xFF - lsls r1, 24 - adds r2, r1 - lsrs r2, 24 - adds r4, r0, 0 - cmp r4, r10 - bcs _080AB974 - lsls r0, r2, 24 - asrs r0, 19 - str r0, [sp, 0x10] -_080AB8A0: - ldr r0, =0x03000f50 - ldr r0, [r0] - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _080AB8D4 - mov r0, sp - ldrh r3, [r0] - adds r0, r6, 0 - movs r1, 0x10 - mov r2, r8 - bl pal_fade_1 - adds r0, r6, 0 - adds r0, 0x10 - lsls r0, 16 - lsrs r6, r0, 16 - mov r3, r10 - lsls r3, 16 - mov r9, r3 - adds r4, 0x1 - mov r12, r4 - b _080AB96A - .pool -_080AB8D4: - cmp r0, 0x1 - bne _080AB8E4 - ldr r0, =0x02038654 - ldr r1, [sp, 0x10] - adds r5, r1, r0 - b _080AB8EA - .pool -_080AB8E4: - ldr r0, =0x020388b4 - ldr r3, [sp, 0x10] - adds r5, r3, r0 -_080AB8EA: - movs r7, 0 - mov r0, r10 - lsls r0, 16 - mov r9, r0 - adds r4, 0x1 - mov r12, r4 -_080AB8F6: - adds r4, r6, 0 - lsls r0, r4, 1 - ldr r1, =0x02037714 - adds r0, r1 - ldr r1, [r0] - lsls r0, r1, 27 - lsrs r0, 27 - adds r0, r5, r0 - ldrb r3, [r0] - lsls r0, r1, 22 - lsrs r0, 27 - adds r0, r5, r0 - ldrb r2, [r0] - lsls r1, 17 - lsrs r1, 27 - adds r1, r5, r1 - ldrb r1, [r1] - ldr r6, [sp, 0x4] - subs r0, r6, r3 - mov r6, r8 - muls r6, r0 - adds r0, r6, 0 - asrs r0, 4 - adds r3, r0 - lsls r3, 24 - lsrs r3, 24 - ldr r6, [sp, 0x8] - subs r0, r6, r2 - mov r6, r8 - muls r6, r0 - adds r0, r6, 0 - asrs r0, 4 - adds r2, r0 - lsls r2, 24 - ldr r6, [sp, 0xC] - subs r0, r6, r1 - mov r6, r8 - muls r6, r0 - adds r0, r6, 0 - asrs r0, 4 - adds r1, r0 - lsls r1, 24 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r4, 1 - ldr r0, =0x02037b14 - adds r4, r0 - lsrs r1, 14 - lsrs r2, 19 - orrs r1, r2 - orrs r1, r3 - strh r1, [r4] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, 0xF - bls _080AB8F6 -_080AB96A: - mov r1, r12 - lsls r0, r1, 16 - lsrs r4, r0, 16 - cmp r0, r9 - bcc _080AB8A0 -_080AB974: - 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_80AB848 - - thumb_func_start sub_80AB990 -sub_80AB990: @ 80AB990 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - lsls r1, 24 - lsrs r6, r1, 24 - mov r1, sp - strh r2, [r1] - lsls r0, 24 - movs r1, 0xFF - lsls r1, 24 - eors r0, r1 - lsrs r0, 24 - str r0, [sp, 0x4] - ldr r0, [sp] - lsls r1, r0, 27 - lsrs r1, 27 - str r1, [sp, 0x8] - lsls r1, r0, 22 - lsrs r1, 27 - str r1, [sp, 0xC] - lsls r0, 17 - lsrs r0, 27 - mov r10, r0 - movs r5, 0 - movs r4, 0 -_080AB9C8: - ldr r0, =0x03000f50 - ldr r0, [r0] - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _080AB9F4 - mov r0, sp - ldrh r3, [r0] - adds r0, r5, 0 - movs r1, 0x10 - adds r2, r6, 0 - bl pal_fade_1 - adds r0, r5, 0 - adds r0, 0x10 - lsls r0, 16 - lsrs r5, r0, 16 - adds r4, 0x1 - mov r8, r4 - b _080ABA8A - .pool -_080AB9F4: - movs r0, 0 - mov r12, r0 - ldr r1, [sp, 0x4] - lsls r0, r1, 24 - adds r4, 0x1 - mov r8, r4 - movs r7, 0x1E - asrs r0, 11 - mov r9, r0 -_080ABA06: - adds r4, r5, 0 - lsls r0, r4, 1 - ldr r5, =0x02037714 - adds r0, r5 - ldr r0, [r0] - lsls r2, r0, 27 - lsrs r2, 27 - lsls r1, r0, 22 - lsrs r1, 27 - lsls r0, 17 - lsrs r0, 27 - ands r0, r7 - lsls r0, 7 - ands r1, r7 - lsls r1, 3 - orrs r0, r1 - ands r2, r7 - lsls r0, 1 - orrs r0, r2 - add r0, r9 - ldr r1, =gUnknown_0854014C - adds r0, r1 - ldr r1, [r0] - lsls r3, r1, 27 - lsrs r3, 27 - lsls r2, r1, 22 - lsrs r2, 27 - lsls r1, 17 - lsrs r1, 27 - ldr r5, [sp, 0x8] - subs r0, r5, r3 - muls r0, r6 - asrs r0, 4 - adds r3, r0 - lsls r3, 24 - lsrs r3, 24 - ldr r5, [sp, 0xC] - subs r0, r5, r2 - muls r0, r6 - asrs r0, 4 - adds r2, r0 - lsls r2, 24 - mov r5, r10 - subs r0, r5, r1 - muls r0, r6 - asrs r0, 4 - adds r1, r0 - lsls r1, 24 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r4, 1 - ldr r0, =0x02037b14 - adds r4, r0 - lsrs r1, 14 - lsrs r2, 19 - orrs r1, r2 - orrs r1, r3 - strh r1, [r4] - mov r0, r12 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r12, r0 - cmp r0, 0xF - bls _080ABA06 -_080ABA8A: - mov r1, r8 - lsls r0, r1, 16 - lsrs r4, r0, 16 - cmp r4, 0x1F - bls _080AB9C8 - 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_80AB990 - - thumb_func_start sub_80ABAB0 -sub_80ABAB0: @ 80ABAB0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - adds r3, r1, 0 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r3, 16 - lsrs r3, 16 - mov r0, sp - strh r3, [r0] - movs r1, 0x80 - lsls r1, 1 - movs r0, 0 - adds r2, r7, 0 - bl pal_fade_1 - ldr r0, [sp] - lsls r1, r0, 27 - lsrs r1, 27 - str r1, [sp, 0x4] - lsls r1, r0, 22 - lsrs r1, 27 - str r1, [sp, 0x8] - lsls r0, 17 - lsrs r0, 27 - mov r10, r0 - movs r4, 0x10 -_080ABAEC: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_80ABC00 - lsls r0, 24 - cmp r0, 0 - beq _080ABB9C - adds r0, r4, 0x1 - lsls r1, r0, 20 - lsrs r1, 16 - mov r12, r1 - lsls r1, r4, 20 - lsrs r6, r1, 16 - mov r9, r0 - cmp r6, r12 - bcs _080ABBB0 - movs r0, 0x1C - mov r8, r0 -_080ABB10: - lsls r5, r6, 1 - ldr r0, =0x02037714 - adds r0, r5, r0 - ldr r2, [r0] - lsls r4, r2, 27 - lsrs r4, 27 - lsls r3, r2, 22 - lsrs r3, 27 - lsls r2, 17 - lsrs r2, 27 - mov r0, r8 - subs r1, r0, r4 - lsls r0, r1, 1 - adds r0, r1 - asrs r0, 2 - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - movs r1, 0x1F - subs r1, r3 - lsls r0, r1, 1 - adds r0, r1 - asrs r0, 2 - adds r3, r0 - lsls r3, 24 - lsrs r3, 24 - mov r0, r8 - subs r1, r0, r2 - lsls r0, r1, 1 - adds r0, r1 - asrs r0, 2 - adds r2, r0 - lsls r2, 24 - lsrs r2, 24 - ldr r1, [sp, 0x4] - subs r0, r1, r4 - muls r0, r7 - asrs r0, 4 - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, [sp, 0x8] - subs r0, r1, r3 - muls r0, r7 - asrs r0, 4 - adds r3, r0 - lsls r3, 24 - mov r1, r10 - subs r0, r1, r2 - muls r0, r7 - asrs r0, 4 - adds r2, r0 - lsls r2, 24 - ldr r0, =0x02037b14 - adds r5, r0 - lsrs r2, 14 - lsrs r3, 19 - orrs r2, r3 - orrs r2, r4 - strh r2, [r5] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, r12 - bcc _080ABB10 - b _080ABBB0 - .pool -_080ABB9C: - lsls r0, r4, 20 - lsrs r0, 16 - mov r1, sp - ldrh r3, [r1] - movs r1, 0x10 - adds r2, r7, 0 - bl pal_fade_1 - adds r4, 0x1 - mov r9, r4 -_080ABBB0: - mov r1, r9 - lsls r0, r1, 16 - lsrs r4, r0, 16 - cmp r4, 0x1F - bls _080ABAEC - 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_80ABAB0 - - thumb_func_start sub_80ABBCC -sub_80ABBCC: @ 80ABBCC - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r3, =0x02038454 - ldr r0, =0x000006fa - adds r1, r3, r0 - ldrb r0, [r1] - cmp r0, 0x5 - bhi _080ABBEE - ldr r4, =0x000006f4 - adds r0, r3, r4 - ldrb r3, [r1] - adds r0, r3 - strb r2, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080ABBEE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ABBCC - - thumb_func_start sub_80ABC00 -sub_80ABC00: @ 80ABC00 - push {r4,r5,lr} - lsls r0, 24 - lsrs r3, r0, 24 - movs r1, 0 - ldr r2, =0x02038454 - ldr r4, =0x000006fa - adds r0, r2, r4 - ldrb r0, [r0] - cmp r1, r0 - bcs _080ABC3E - ldr r5, =0x000006f4 - adds r4, r2, r5 - adds r2, r0, 0 -_080ABC1A: - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, r3 - bne _080ABC34 - movs r0, 0x1 - b _080ABC40 - .pool -_080ABC34: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r2 - bcc _080ABC1A -_080ABC3E: - movs r0, 0 -_080ABC40: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80ABC00 - - thumb_func_start sub_80ABC48 -sub_80ABC48: @ 80ABC48 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =0x02038454 - ldr r1, =0x000006c6 - adds r0, r5, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _080ABC6E - lsls r2, r4, 24 - asrs r2, 24 - movs r0, 0 - movs r1, 0x20 - bl pal_fade_2 - movs r1, 0xD8 - lsls r1, 3 - adds r0, r5, r1 - strb r4, [r0] -_080ABC6E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ABC48 - - thumb_func_start sub_80ABC7C -sub_80ABC7C: @ 80ABC7C - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r3, =0x02038454 - ldr r0, =0x000006c6 - adds r2, r3, r0 - ldrb r0, [r2] - cmp r0, 0x3 - bne _080ABCBC - movs r1, 0 - strb r1, [r2] - movs r2, 0xD8 - lsls r2, 3 - adds r0, r3, r2 - strb r4, [r0] - adds r2, 0x1 - adds r0, r3, r2 - strb r5, [r0] - adds r2, 0x2 - adds r0, r3, r2 - strb r1, [r0] - ldr r1, =0x000006c2 - adds r0, r3, r1 - strb r6, [r0] - lsls r0, r4, 24 - asrs r0, 24 - bl sub_80ABC48 -_080ABCBC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ABC7C - - thumb_func_start fade_screen -fade_screen: @ 80ABCD0 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - adds r2, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - cmp r0, 0x1 - beq _080ABD08 - cmp r0, 0x1 - bgt _080ABCEC - cmp r0, 0 - beq _080ABCF6 - b _080ABDE4 -_080ABCEC: - cmp r2, 0x2 - beq _080ABCFC - cmp r2, 0x3 - beq _080ABD0C - b _080ABDE4 -_080ABCF6: - movs r4, 0 - movs r1, 0 - b _080ABD10 -_080ABCFC: - ldr r4, =0x0000ffff - movs r1, 0 - b _080ABD10 - .pool -_080ABD08: - movs r4, 0 - b _080ABD0E -_080ABD0C: - ldr r4, =0x0000ffff -_080ABD0E: - movs r1, 0x1 -_080ABD10: - ldr r0, =0x02038454 - movs r2, 0xDA - lsls r2, 3 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x3 - blt _080ABD38 - cmp r0, 0x6 - ble _080ABD2A - cmp r0, 0xD - bgt _080ABD38 - cmp r0, 0xB - blt _080ABD38 -_080ABD2A: - movs r2, 0x1 - b _080ABD3A - .pool -_080ABD38: - movs r2, 0 -_080ABD3A: - cmp r1, 0 - beq _080ABD7C - cmp r2, 0 - beq _080ABD4E - ldr r0, =0x02037b14 - ldr r1, =0x02037714 - movs r2, 0x80 - lsls r2, 1 - bl CpuFastSet -_080ABD4E: - movs r0, 0x1 - negs r0, r0 - lsls r1, r5, 24 - asrs r1, 24 - str r4, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x02038454 - ldr r3, =0x000006c6 - adds r0, r3 - movs r1, 0x2 - strb r1, [r0] - b _080ABDE4 - .pool -_080ABD7C: - ldr r1, =0x02038454 - ldr r3, =0x000006c4 - adds r0, r1, r3 - strh r4, [r0] - cmp r2, 0 - beq _080ABDA0 - ldr r0, =0x000006c7 - adds r1, r0 - movs r0, 0 - strb r0, [r1] - b _080ABDB2 - .pool -_080ABDA0: - movs r0, 0x1 - negs r0, r0 - lsls r1, r5, 24 - asrs r1, 24 - str r4, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe -_080ABDB2: - ldr r4, =0x02038454 - ldr r1, =0x000006c6 - adds r0, r4, r1 - movs r1, 0 - movs r5, 0x1 - strb r5, [r0] - ldr r2, =0x000006ca - adds r0, r4, r2 - strb r5, [r0] - ldr r3, =0x000006cb - adds r0, r4, r3 - strb r1, [r0] - movs r1, 0xE6 - lsls r1, 3 - adds r0, r4, r1 - ldrb r0, [r0] - adds r2, 0x68 - adds r1, r4, r2 - ldrb r1, [r1] - bl sub_80AC124 - movs r3, 0xD9 - lsls r3, 3 - adds r4, r3 - strb r5, [r4] -_080ABDE4: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end fade_screen - - thumb_func_start sub_80ABDFC -sub_80ABDFC: @ 80ABDFC - ldr r0, =0x02038454 - ldr r1, =0x000006c6 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - eors r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - bx lr - .pool - thumb_func_end sub_80ABDFC - - thumb_func_start sub_80ABE18 -@ void sub_80ABE18(u8 a1) -sub_80ABE18: @ 80ABE18 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 8 - movs r1, 0x80 - lsls r1, 13 - adds r0, r1 - lsrs r4, r0, 16 - ldr r5, =0x02038454 - ldr r2, =0x000006c6 - adds r0, r5, r2 - ldrb r0, [r0] - adds r1, r5, 0 - cmp r0, 0x1 - beq _080ABE60 - cmp r0, 0x2 - beq _080ABEAC - adds r2, 0xA - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x6 - beq _080ABEE4 - lsls r0, r4, 24 - lsrs r0, 24 - subs r2, 0x10 - adds r1, r2 - movs r2, 0 - ldrsb r2, [r1, r2] - movs r1, 0x1 - bl pal_fade_2 - b _080ABEF4 - .pool -_080ABE60: - ldr r2, =0x000006ca - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080ABEF4 - adds r2, 0x6 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x6 - bne _080ABE7C - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_80ABBCC -_080ABE7C: - lsls r0, r4, 20 - lsrs r4, r0, 16 - movs r2, 0 - ldr r6, =0x02037b14 - ldr r0, =0x000006c4 - adds r3, r5, r0 -_080ABE88: - adds r0, r4, r2 - lsls r0, 1 - adds r0, r6 - ldrh r1, [r3] - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0xF - bls _080ABE88 - b _080ABEF4 - .pool -_080ABEAC: - lsls r0, r4, 20 - lsrs r4, r0, 16 - lsls r1, r4, 1 - ldr r0, =0x02037b14 - adds r0, r1, r0 - ldr r2, =0x02037714 - adds r1, r2 - movs r2, 0x8 - bl CpuFastSet - ldr r0, =0x02037fd4 - ldrh r2, [r0, 0x4] - lsls r2, 21 - lsrs r2, 27 - ldrh r3, [r0, 0x6] - lsls r3, 17 - lsrs r3, 17 - adds r0, r4, 0 - movs r1, 0x10 - bl pal_fade_1 - b _080ABEF4 - .pool -_080ABEE4: - lsls r0, r4, 20 - lsrs r4, r0, 16 - ldr r3, =0x000073fc - adds r0, r4, 0 - movs r1, 0x10 - movs r2, 0xC - bl pal_fade_1 -_080ABEF4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ABE18 - - thumb_func_start sub_80ABF00 -sub_80ABF00: @ 80ABF00 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02038454 - movs r2, 0xD8 - lsls r2, 3 - adds r1, r2 - movs r2, 0 - ldrsb r2, [r1, r2] - movs r1, 0x1 - bl pal_fade_2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ABF00 - - thumb_func_start sub_80ABF20 -sub_80ABF20: @ 80ABF20 - push {lr} - ldr r1, =0x02038454 - ldr r2, =0x000006c6 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080ABF3C - movs r0, 0 - b _080ABF42 - .pool -_080ABF3C: - ldr r2, =0x000006ca - adds r0, r1, r2 - ldrb r0, [r0] -_080ABF42: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80ABF20 - - thumb_func_start sub_80ABF4C -sub_80ABF4C: @ 80ABF4C - push {r4,lr} - ldr r4, =0x02038454 - ldr r1, =0x000006d4 - adds r4, r1 - ldrb r1, [r4] - lsls r1, 20 - movs r2, 0x80 - lsls r2, 17 - adds r1, r2 - lsrs r1, 16 - movs r2, 0x20 - bl gpu_pal_apply - ldrb r0, [r4] - bl sub_80ABE18 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ABF4C - - thumb_func_start sub_80ABF7C -sub_80ABF7C: @ 80ABF7C - movs r2, 0x20 - strb r2, [r0] - strb r2, [r1] - bx lr - thumb_func_end sub_80ABF7C - - thumb_func_start sub_80ABF84 -sub_80ABF84: @ 80ABF84 - ldr r0, =0x02038454 - ldr r2, =0x0000074d - adds r1, r0, r2 - movs r2, 0x1 - strb r2, [r1] - ldr r1, =0x0000074e - adds r0, r1 - strb r2, [r0] - bx lr - .pool - thumb_func_end sub_80ABF84 - - thumb_func_start sub_80ABFA4 -sub_80ABFA4: @ 80ABFA4 - push {r4,lr} - ldr r1, =0x02038454 - ldr r0, =0x0000074d - adds r4, r1, r0 - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0x1F - bgt _080ABFD8 - ldr r0, =0x0000074e - adds r1, r0 - adds r0, r4, 0 - bl sub_80ABF7C - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0x1F - bgt _080ABFD8 - movs r0, 0x1 - b _080ABFDA - .pool -_080ABFD8: - movs r0, 0 -_080ABFDA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80ABFA4 - - thumb_func_start sub_80ABFE0 -sub_80ABFE0: @ 80ABFE0 - push {lr} - lsls r0, 24 - asrs r0, 24 - mvns r0, r0 - bl sub_80ABC48 - pop {r0} - bx r0 - thumb_func_end sub_80ABFE0 - - thumb_func_start sub_80ABFF0 -sub_80ABFF0: @ 80ABFF0 - ldr r1, =0x02038454 - ldr r2, =0x0000073c - adds r0, r1, r2 - movs r2, 0 - strh r2, [r0] - movs r3, 0xE8 - lsls r3, 3 - adds r0, r1, r3 - strh r2, [r0] - adds r3, 0x2 - adds r0, r1, r3 - strh r2, [r0] - ldr r0, =0x0000073e - adds r1, r0 - strh r2, [r1] - bx lr - .pool - thumb_func_end sub_80ABFF0 - - thumb_func_start sub_80AC01C -sub_80AC01C: @ 80AC01C - push {r4-r7,lr} - ldr r5, =0x02038454 - ldr r0, =0x00000742 - adds r7, r5, r0 - movs r2, 0 - ldrsh r1, [r7, r2] - cmp r1, 0x1 - beq _080AC090 - cmp r1, 0x1 - bgt _080AC040 - cmp r1, 0 - beq _080AC046 - b _080AC118 - .pool -_080AC040: - cmp r1, 0x2 - beq _080AC0E4 - b _080AC118 -_080AC046: - movs r3, 0xE8 - lsls r3, 3 - adds r6, r5, r3 - ldrh r0, [r6] - adds r0, 0x1 - strh r0, [r6] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - ble _080AC118 - strh r1, [r6] - ldr r0, =0x0000073c - adds r4, r5, r0 - ldrh r0, [r4] - adds r1, r0, 0x1 - strh r1, [r4] - lsls r0, 24 - asrs r0, 24 - bl sub_80ABFE0 - ldrh r1, [r4] - movs r2, 0 - ldrsh r0, [r4, r2] - cmp r0, 0x5 - ble _080AC118 - ldr r3, =0x0000073e - adds r0, r5, r3 - strh r1, [r0] - movs r0, 0x1 - strh r0, [r7] - movs r0, 0x3C - strh r0, [r6] - b _080AC118 - .pool -_080AC090: - movs r0, 0xE8 - lsls r0, 3 - adds r2, r5, r0 - ldrh r0, [r2] - adds r0, 0x3 - movs r1, 0x7F - ands r0, r1 - strh r0, [r2] - ldr r1, =gUnknown_08329F40 - movs r3, 0 - ldrsh r0, [r2, r3] - lsls r0, 1 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - subs r0, 0x1 - asrs r0, 6 - adds r0, 0x2 - ldr r2, =0x0000073c - adds r6, r5, r2 - adds r2, r0, 0 - strh r0, [r6] - ldr r3, =0x0000073e - adds r4, r5, r3 - movs r3, 0 - ldrsh r1, [r4, r3] - cmp r0, r1 - beq _080AC0D0 - lsls r0, r2, 24 - asrs r0, 24 - bl sub_80ABFE0 -_080AC0D0: - ldrh r0, [r6] - strh r0, [r4] - b _080AC118 - .pool -_080AC0E4: - movs r0, 0xE8 - lsls r0, 3 - adds r1, r5, r0 - ldrh r0, [r1] - adds r0, 0x1 - movs r6, 0 - strh r0, [r1] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - ble _080AC118 - strh r6, [r1] - ldr r1, =0x0000073c - adds r4, r5, r1 - ldrh r0, [r4] - subs r0, 0x1 - strh r0, [r4] - lsls r0, 24 - asrs r0, 24 - bl sub_80ABFE0 - movs r2, 0 - ldrsh r0, [r4, r2] - cmp r0, 0x3 - bne _080AC118 - strh r6, [r7] -_080AC118: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AC01C - - thumb_func_start sub_80AC124 -sub_80AC124: @ 80AC124 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =0x02038454 - movs r4, 0xE6 - lsls r4, 3 - adds r2, r3, r4 - strh r0, [r2] - adds r4, 0x2 - adds r2, r3, r4 - strh r1, [r2] - adds r4, 0x2 - adds r2, r3, r4 - strh r0, [r2] - ldr r2, =0x00000736 - adds r3, r2 - strh r1, [r3] - lsls r1, 8 - orrs r1, r0 - movs r0, 0x52 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AC124 - - thumb_func_start sub_80AC164 -sub_80AC164: @ 80AC164 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =0x02038454 - ldr r5, =0x00000734 - adds r4, r3, r5 - movs r5, 0 - strh r0, [r4] - ldr r4, =0x00000736 - adds r0, r3, r4 - strh r1, [r0] - ldr r1, =0x0000073a - adds r0, r3, r1 - strb r2, [r0] - adds r4, 0x3 - adds r0, r3, r4 - strb r5, [r0] - movs r0, 0xE7 - lsls r0, 3 - adds r3, r0 - strb r5, [r3] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AC164 - - thumb_func_start sub_80AC1A8 -sub_80AC1A8: @ 80AC1A8 - push {r4-r6,lr} - ldr r0, =0x02038454 - movs r1, 0xE6 - lsls r1, 3 - adds r3, r0, r1 - ldr r2, [r3] - ldr r6, =0x00000734 - adds r4, r0, r6 - ldr r1, [r4] - adds r5, r0, 0 - cmp r2, r1 - beq _080AC26C - ldr r0, =0x00000739 - adds r2, r5, r0 - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - ldr r6, =0x0000073a - adds r1, r5, r6 - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bls _080AC238 - movs r0, 0 - strb r0, [r2] - movs r0, 0xE7 - lsls r0, 3 - adds r1, r5, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080AC210 - ldrh r1, [r3] - adds r2, r1, 0 - ldrh r0, [r4] - cmp r2, r0 - bcs _080AC230 - adds r0, r1, 0x1 - b _080AC236 - .pool -_080AC210: - ldr r1, =0x00000732 - adds r3, r5, r1 - ldr r2, =0x00000736 - adds r0, r5, r2 - ldrh r1, [r3] - adds r2, r1, 0 - ldrh r0, [r0] - cmp r2, r0 - bcs _080AC230 - adds r0, r1, 0x1 - b _080AC236 - .pool -_080AC230: - cmp r2, r0 - bls _080AC238 - subs r0, r1, 0x1 -_080AC236: - strh r0, [r3] -_080AC238: - ldr r6, =0x00000732 - adds r0, r5, r6 - ldrh r1, [r0] - lsls r1, 8 - movs r0, 0xE6 - lsls r0, 3 - adds r4, r5, r0 - ldrh r0, [r4] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldr r1, [r4] - ldr r2, =0x00000734 - adds r0, r5, r2 - ldr r0, [r0] - cmp r1, r0 - beq _080AC26C - movs r0, 0 - b _080AC26E - .pool -_080AC26C: - movs r0, 0x1 -_080AC26E: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80AC1A8 - - thumb_func_start sub_80AC274 -sub_80AC274: @ 80AC274 - push {lr} - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x1 - cmp r0, 0x9 - bhi _080AC306 - lsls r0, 2 - ldr r1, =_080AC290 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080AC290: - .4byte _080AC2B8 - .4byte _080AC2C0 - .4byte _080AC2C8 - .4byte _080AC2D0 - .4byte _080AC2D8 - .4byte _080AC2E0 - .4byte _080AC2E8 - .4byte _080AC2F0 - .4byte _080AC2F8 - .4byte _080AC300 -_080AC2B8: - movs r0, 0x1 - bl sub_80AEDF0 - b _080AC306 -_080AC2C0: - movs r0, 0x2 - bl sub_80AEDF0 - b _080AC306 -_080AC2C8: - movs r0, 0x3 - bl sub_80AEDF0 - b _080AC306 -_080AC2D0: - movs r0, 0x4 - bl sub_80AEDF0 - b _080AC306 -_080AC2D8: - movs r0, 0x5 - bl sub_80AEDF0 - b _080AC306 -_080AC2E0: - movs r0, 0x6 - bl sub_80AEDF0 - b _080AC306 -_080AC2E8: - movs r0, 0x9 - bl sub_80AEDF0 - b _080AC306 -_080AC2F0: - movs r0, 0x7 - bl sub_80AEDF0 - b _080AC306 -_080AC2F8: - movs r0, 0x8 - bl sub_80AEDF0 - b _080AC306 -_080AC300: - movs r0, 0xB - bl sub_80AEDF0 -_080AC306: - pop {r0} - bx r0 - thumb_func_end sub_80AC274 - - thumb_func_start weather_get_current -weather_get_current: @ 80AC30C - ldr r0, =0x02038454 - movs r1, 0xDA - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end weather_get_current - - thumb_func_start sub_80AC31C -sub_80AC31C: @ 80AC31C - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - ldr r1, =0x02038454 - ldr r3, =0x000006c6 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, 0x2 - beq _080AC36E - cmp r2, 0x53 - beq _080AC354 - cmp r2, 0x53 - bgt _080AC344 - cmp r2, 0x51 - beq _080AC360 - b _080AC36E - .pool -_080AC344: - cmp r2, 0x55 - bne _080AC36E - ldr r0, =0x000006dd - adds r1, r0 - movs r0, 0 - b _080AC366 - .pool -_080AC354: - ldr r3, =0x000006dd - adds r1, r3 - movs r0, 0x1 - b _080AC366 - .pool -_080AC360: - ldr r0, =0x000006dd - adds r1, r0 - movs r0, 0x2 -_080AC366: - strb r0, [r1] - adds r0, r2, 0 - bl audio_play -_080AC36E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AC31C - - thumb_func_start play_some_sound -play_some_sound: @ 80AC378 - push {lr} - bl sub_80A390C - lsls r0, 24 - cmp r0, 0 - beq _080AC3B6 - ldr r0, =0x02038454 - ldr r1, =0x000006dd - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080AC3A8 - cmp r0, 0x1 - bgt _080AC3B0 - cmp r0, 0 - bne _080AC3B0 - movs r0, 0x56 - bl audio_play - b _080AC3B6 - .pool -_080AC3A8: - movs r0, 0x54 - bl audio_play - b _080AC3B6 -_080AC3B0: - movs r0, 0x52 - bl audio_play -_080AC3B6: - pop {r0} - bx r0 - thumb_func_end play_some_sound - - thumb_func_start sub_80AC3BC -sub_80AC3BC: @ 80AC3BC - ldr r0, =0x02038454 - ldr r1, =0x000006d3 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80AC3BC - - thumb_func_start sub_80AC3D0 -sub_80AC3D0: @ 80AC3D0 - ldr r0, =0x02038454 - ldr r1, =0x000006c6 - adds r0, r1 - movs r1, 0x2 - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_80AC3D0 - - thumb_func_start sub_80AC3E4 -sub_80AC3E4: @ 80AC3E4 - ldr r0, =0x02038454 - ldr r1, =0x000006c6 - adds r0, r1 - movs r1, 0x3 - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_80AC3E4 - - thumb_func_start sub_80AC3F8 -sub_80AC3F8: @ 80AC3F8 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0854C250 - ldr r5, =0x02038ba4 - adds r1, r5, 0 - movs r2, 0x10 - bl CpuSet - adds r4, r5 - movs r0, 0 - strb r0, [r4] - ldr r0, =0x03000f50 - str r5, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AC3F8 - - thumb_func_start sub_80AC428 -sub_80AC428: @ 80AC428 - ldr r1, =0x03000f50 - ldr r0, =gUnknown_0854C250 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_80AC428 - - thumb_func_start sub_80AC438 -sub_80AC438: @ 80AC438 - push {lr} - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r2, =0x000006c1 - adds r1, r0, r2 - movs r2, 0 - strb r2, [r1] - ldr r1, =0x000006c2 - adds r3, r0, r1 - movs r1, 0x14 - strb r1, [r3] - ldr r3, =0x000006d2 - adds r1, r0, r3 - strb r2, [r1] - subs r3, 0x6 - adds r1, r0, r3 - strh r2, [r1] - ldr r1, =0x000006de - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080AC46C - movs r0, 0 - movs r1, 0x10 - bl sub_80AC124 -_080AC46C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AC438 - - thumb_func_start sub_80AC484 -sub_80AC484: @ 80AC484 - push {r4,lr} - bl sub_80AC438 - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x000006d2 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080AC4A4 - adds r4, r1, r2 -_080AC49A: - bl sub_80AC4B4 - ldrb r0, [r4] - cmp r0, 0 - beq _080AC49A -_080AC4A4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AC484 - - thumb_func_start sub_80AC4B4 -sub_80AC4B4: @ 80AC4B4 - push {r4,r5,lr} - ldr r0, =gUnknown_0854C14C - ldr r5, [r0] - ldr r0, =0x000006cc - adds r4, r5, r0 - ldrh r0, [r4] - cmp r0, 0x1 - beq _080AC4E4 - cmp r0, 0x1 - bgt _080AC4D8 - cmp r0, 0 - beq _080AC4DE - b _080AC508 - .pool -_080AC4D8: - cmp r0, 0x2 - beq _080AC4F0 - b _080AC508 -_080AC4DE: - bl sub_80AC594 - b _080AC502 -_080AC4E4: - movs r0, 0xC - movs r1, 0x8 - movs r2, 0x1 - bl sub_80AC164 - b _080AC502 -_080AC4F0: - bl sub_80AC1A8 - lsls r0, 24 - cmp r0, 0 - beq _080AC508 - ldr r0, =0x000006d2 - adds r1, r5, r0 - movs r0, 0x1 - strb r0, [r1] -_080AC502: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_080AC508: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AC4B4 - - thumb_func_start sub_80AC514 -sub_80AC514: @ 80AC514 - push {r4,lr} - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r1, =0x000006ce - adds r4, r0, r1 - ldrh r0, [r4] - cmp r0, 0 - beq _080AC534 - cmp r0, 0x1 - beq _080AC540 - movs r0, 0 - b _080AC556 - .pool -_080AC534: - movs r0, 0 - movs r1, 0x10 - movs r2, 0x1 - bl sub_80AC164 - b _080AC54E -_080AC540: - bl sub_80AC1A8 - lsls r0, 24 - cmp r0, 0 - beq _080AC554 - bl sub_80AC660 -_080AC54E: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_080AC554: - movs r0, 0x1 -_080AC556: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80AC514 - - thumb_func_start sub_80AC55C -sub_80AC55C: @ 80AC55C - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r0, =0x000006c1 - adds r2, r1, r0 - movs r0, 0 - strb r0, [r2] - ldr r0, =0x000006c2 - adds r1, r0 - movs r0, 0x14 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_80AC55C - - thumb_func_start sub_80AC580 -sub_80AC580: @ 80AC580 - push {lr} - bl sub_80AC55C - pop {r0} - bx r0 - thumb_func_end sub_80AC580 - - thumb_func_start nullsub_95 -nullsub_95: @ 80AC58C - bx lr - thumb_func_end nullsub_95 - - thumb_func_start sub_80AC590 -sub_80AC590: @ 80AC590 - movs r0, 0 - bx lr - thumb_func_end sub_80AC590 - - thumb_func_start sub_80AC594 -sub_80AC594: @ 80AC594 - push {r4,r5,lr} - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r1, =0x000006de - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080AC650 - ldr r0, =gUnknown_0854FB5C - bl LoadObjectPic - ldr r0, =gUnknown_0854C290 - bl sub_80ABF4C - movs r5, 0 -_080AC5B2: - ldr r0, =gUnknown_0854FB78 - movs r1, 0 - movs r2, 0 - movs r3, 0xFF - bl AddObjectToFront - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - beq _080AC628 - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - lsls r2, r5, 2 - movs r0, 0xFA - lsls r0, 1 - adds r1, r0 - adds r1, r2 - lsls r4, r3, 4 - adds r4, r3 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - str r4, [r1] - ldr r0, =gUnknown_0854FB50 - adds r2, r0 - ldrh r0, [r2] - adds r0, 0x7 - lsls r0, 16 - asrs r0, 16 - ldrh r1, [r2, 0x2] - adds r1, 0x7 - lsls r1, 16 - asrs r1, 16 - adds r2, r4, 0 - adds r2, 0x20 - adds r3, r4, 0 - adds r3, 0x22 - bl sub_8093038 - adds r4, 0x3E - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - b _080AC63A - .pool -_080AC628: - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - lsls r0, r5, 2 - movs r2, 0xFA - lsls r2, 1 - adds r1, r2 - adds r1, r0 - movs r0, 0 - str r0, [r1] -_080AC63A: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x2 - bls _080AC5B2 - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r1, =0x000006de - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] -_080AC650: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AC594 - - thumb_func_start sub_80AC660 -sub_80AC660: @ 80AC660 - push {r4,r5,lr} - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x000006de - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080AC6A4 - movs r4, 0 - movs r0, 0xFA - lsls r0, 1 - adds r5, r1, r0 -_080AC678: - lsls r0, r4, 2 - adds r0, r5, r0 - ldr r0, [r0] - cmp r0, 0 - beq _080AC686 - bl RemoveObjectAndFreeTiles -_080AC686: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x2 - bls _080AC678 - movs r0, 0x90 - lsls r0, 5 - bl FreeObjectTilesByTag - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r1, =0x000006de - adds r0, r1 - movs r1, 0 - strb r1, [r0] -_080AC6A4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AC660 - - thumb_func_start sub_80AC6B4 -sub_80AC6B4: @ 80AC6B4 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - movs r1, 0x1 - ands r0, r1 - strh r0, [r2, 0x2E] - cmp r0, 0 - beq _080AC6CC - ldrh r0, [r2, 0x20] - subs r0, 0x1 - strh r0, [r2, 0x20] -_080AC6CC: - pop {r0} - bx r0 - thumb_func_end sub_80AC6B4 - - thumb_func_start sub_80AC6D0 -sub_80AC6D0: @ 80AC6D0 - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r0, =0x000006cc - adds r3, r1, r0 - movs r2, 0 - movs r0, 0 - strh r0, [r3] - ldr r3, =0x000006d2 - adds r0, r1, r3 - strb r2, [r0] - subs r3, 0x11 - adds r0, r1, r3 - strb r2, [r0] - ldr r0, =0x000006c2 - adds r1, r0 - strb r2, [r1] - bx lr - .pool - thumb_func_end sub_80AC6D0 - - thumb_func_start sub_80AC704 -sub_80AC704: @ 80AC704 - push {r4,lr} - bl sub_80AC6D0 - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x000006d2 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080AC724 - adds r4, r1, r2 -_080AC71A: - bl sub_80AC734 - ldrb r0, [r4] - cmp r0, 0 - beq _080AC71A -_080AC724: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AC704 - - thumb_func_start sub_80AC734 -sub_80AC734: @ 80AC734 - push {lr} - ldr r1, =gUnknown_0854C14C - ldr r0, [r1] - ldr r2, =0x000006cc - adds r0, r2 - ldrh r0, [r0] - adds r2, r1, 0 - cmp r0, 0x4 - bhi _080AC810 - lsls r0, 2 - ldr r1, =_080AC75C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080AC75C: - .4byte _080AC770 - .4byte _080AC78C - .4byte _080AC7A4 - .4byte _080AC7C0 - .4byte _080AC7D8 -_080AC770: - ldr r1, [r2] - ldr r2, =0x000006c6 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080AC814 - ldr r0, =0x000006cc - adds r1, r0 - b _080AC7F8 - .pool -_080AC78C: - bl sub_80ABF84 - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x000006cc - adds r1, r2 - b _080AC7F8 - .pool -_080AC7A4: - bl sub_80ABFA4 - lsls r0, 24 - cmp r0, 0 - bne _080AC814 - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r0, =0x000006cc - adds r1, r0 - b _080AC7F8 - .pool -_080AC7C0: - bl sub_80ABFF0 - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x000006cc - adds r1, r2 - b _080AC7F8 - .pool -_080AC7D8: - bl sub_80AC01C - ldr r0, =gUnknown_0854C14C - ldr r2, [r0] - ldr r1, =0x0000073c - adds r0, r2, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x6 - bne _080AC814 - ldr r0, =0x000006d2 - adds r1, r2, r0 - movs r0, 0x1 - strb r0, [r1] - ldr r0, =0x000006cc - adds r1, r2, r0 -_080AC7F8: - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _080AC814 - .pool -_080AC810: - bl sub_80AC01C -_080AC814: - pop {r0} - bx r0 - thumb_func_end sub_80AC734 - - thumb_func_start sub_80AC818 -sub_80AC818: @ 80AC818 - movs r0, 0 - bx lr - thumb_func_end sub_80AC818 - - thumb_func_start sub_80AC81C -sub_80AC81C: @ 80AC81C - push {lr} - ldr r0, =task50_0807B6D4 - movs r1, 0x50 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AC81C - - thumb_func_start task50_0807B6D4 -task50_0807B6D4: @ 80AC830 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bhi _080AC922 - lsls r0, 2 - ldr r1, =_080AC85C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080AC85C: - .4byte _080AC870 - .4byte _080AC89A - .4byte _080AC8C8 - .4byte _080AC8F8 - .4byte _080AC918 -_080AC870: - movs r0, 0 - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - ldr r0, =0x04000048 - ldrh r0, [r0] - strh r0, [r4, 0xE] - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0x9E - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080AC89A: - ldrh r0, [r4, 0xA] - adds r0, 0x3 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - ble _080AC8AC - movs r0, 0x10 - strh r0, [r4, 0xA] -_080AC8AC: - ldrh r1, [r4, 0xA] - movs r0, 0x54 - bl SetGpuReg - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0xF - ble _080AC922 - b _080AC910 - .pool -_080AC8C8: - ldrh r0, [r4, 0xC] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - ble _080AC922 - strh r1, [r4, 0xC] - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - cmp r0, 0 - bgt _080AC8EE - strh r1, [r4, 0xA] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080AC8EE: - ldrh r1, [r4, 0xA] - movs r0, 0x54 - bl SetGpuReg - b _080AC922 -_080AC8F8: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - ldrh r1, [r4, 0xE] - movs r0, 0x48 - bl SetGpuReg -_080AC910: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080AC922 -_080AC918: - bl script_env_2_enable_and_set_ctx_running - adds r0, r5, 0 - bl DestroyTask -_080AC922: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end task50_0807B6D4 - - thumb_func_start sub_80AC928 -sub_80AC928: @ 80AC928 - push {r4,lr} - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x000006cc - adds r0, r1, r2 - movs r3, 0 - movs r2, 0 - strh r2, [r0] - ldr r4, =0x000006d2 - adds r0, r1, r4 - strb r3, [r0] - adds r4, 0x4 - adds r0, r1, r4 - strh r2, [r0] - ldr r0, =0x000006db - adds r2, r1, r0 - movs r0, 0x8 - strb r0, [r2] - ldr r2, =0x000006dc - adds r0, r1, r2 - strb r3, [r0] - adds r4, 0x3 - adds r2, r1, r4 - movs r0, 0xA - strb r0, [r2] - ldr r0, =0x000006c1 - adds r2, r1, r0 - movs r0, 0x3 - strb r0, [r2] - ldr r2, =0x000006c2 - adds r1, r2 - movs r0, 0x14 - strb r0, [r1] - movs r0, 0x55 - bl sub_80AC31C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AC928 - - thumb_func_start sub_80AC994 -sub_80AC994: @ 80AC994 - push {r4,lr} - bl sub_80AC928 - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x000006d2 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080AC9B4 - adds r4, r1, r2 -_080AC9AA: - bl sub_80AC9C4 - ldrb r0, [r4] - cmp r0, 0 - beq _080AC9AA -_080AC9B4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AC994 - - thumb_func_start sub_80AC9C4 -sub_80AC9C4: @ 80AC9C4 - push {r4,r5,lr} - ldr r0, =gUnknown_0854C14C - ldr r5, [r0] - ldr r0, =0x000006cc - adds r4, r5, r0 - ldrh r0, [r4] - cmp r0, 0x1 - beq _080AC9F4 - cmp r0, 0x1 - bgt _080AC9E8 - cmp r0, 0 - beq _080AC9EE - b _080ACA18 - .pool -_080AC9E8: - cmp r0, 0x2 - beq _080ACA00 - b _080ACA18 -_080AC9EE: - bl sub_80ACD68 - b _080ACA12 -_080AC9F4: - bl sub_80ACD78 - lsls r0, 24 - cmp r0, 0 - bne _080ACA18 - b _080ACA12 -_080ACA00: - bl sub_80ACEAC - lsls r0, 24 - cmp r0, 0 - bne _080ACA18 - ldr r0, =0x000006d2 - adds r1, r5, r0 - movs r0, 0x1 - strb r0, [r1] -_080ACA12: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_080ACA18: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AC9C4 - - thumb_func_start sub_80ACA24 -sub_80ACA24: @ 80ACA24 - push {r4,r5,lr} - ldr r0, =gUnknown_0854C14C - ldr r2, [r0] - ldr r1, =0x000006ce - adds r3, r2, r1 - ldrh r1, [r3] - adds r4, r0, 0 - cmp r1, 0 - beq _080ACA48 - cmp r1, 0x1 - beq _080ACA7C - movs r0, 0 - b _080ACAAA - .pool -_080ACA48: - ldr r5, =0x000006d1 - adds r0, r2, r5 - ldrb r0, [r0] - cmp r0, 0x3 - beq _080ACA5A - cmp r0, 0x5 - beq _080ACA5A - cmp r0, 0xD - bne _080ACA70 -_080ACA5A: - ldr r0, [r4] - ldr r1, =0x000006ce - adds r0, r1 - movs r1, 0xFF - strh r1, [r0] - movs r0, 0 - b _080ACAAA - .pool -_080ACA70: - ldr r4, =0x000006d9 - adds r0, r2, r4 - strb r1, [r0] - ldrh r0, [r3] - adds r0, 0x1 - strh r0, [r3] -_080ACA7C: - bl sub_80ACEAC - lsls r0, 24 - cmp r0, 0 - bne _080ACAA8 - bl sub_80ACF38 - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r5, =0x000006ce - adds r1, r5 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - movs r0, 0 - b _080ACAAA - .pool -_080ACAA8: - movs r0, 0x1 -_080ACAAA: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80ACA24 - - thumb_func_start sub_80ACAB0 -sub_80ACAB0: @ 80ACAB0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r0, 0 - movs r1, 0x30 - ldrsh r0, [r7, r1] - cmp r0, 0 - bne _080ACAC4 - ldr r0, =0x00000169 - strh r0, [r7, 0x30] -_080ACAC4: - movs r2, 0x30 - ldrsh r1, [r7, r2] - ldr r0, =0x41c64e6d - muls r0, r1 - ldr r3, =0x00003039 - adds r0, r3 - lsls r0, 1 - lsrs r0, 17 - movs r1, 0x96 - lsls r1, 2 - bl __umodsi3 - movs r1, 0 - mov r8, r1 - strh r0, [r7, 0x30] - ldr r1, =gUnknown_0854FC4C - ldr r0, =gUnknown_0854C14C - ldr r5, [r0] - ldr r2, =0x000006dc - adds r5, r2 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldrh r6, [r0] - movs r3, 0x30 - ldrsh r0, [r7, r3] - movs r1, 0x1E - bl __modsi3 - adds r4, r0, 0 - lsls r4, 16 - asrs r4, 16 - lsls r0, r4, 3 - strh r0, [r7, 0x32] - movs r1, 0x30 - ldrsh r0, [r7, r1] - movs r1, 0x1E - bl __divsi3 - lsls r0, 16 - lsls r4, 7 - strh r4, [r7, 0x32] - asrs r0, 9 - strh r0, [r7, 0x34] - ldr r2, =gUnknown_0854FC44 - ldrb r1, [r5] - lsls r1, 2 - adds r1, r2 - movs r3, 0 - ldrsh r1, [r1, r3] - muls r1, r6 - subs r4, r1 - strh r4, [r7, 0x32] - ldrb r1, [r5] - lsls r1, 2 - adds r2, 0x2 - adds r1, r2 - movs r2, 0 - ldrsh r1, [r1, r2] - muls r1, r6 - subs r0, r1 - strh r0, [r7, 0x34] - adds r0, r7, 0 - movs r1, 0 - bl StartObjectImageAnim - mov r3, r8 - strh r3, [r7, 0x36] - adds r2, r7, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - strh r6, [r7, 0x2E] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ACAB0 - - thumb_func_start sub_80ACB84 -sub_80ACB84: @ 80ACB84 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x36 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _080ACC60 - ldr r3, =gUnknown_0854FC44 - ldr r4, =gUnknown_0854C14C - ldr r2, [r4] - ldr r0, =0x000006dc - adds r2, r0 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0] - ldrh r0, [r5, 0x32] - adds r1, r0 - strh r1, [r5, 0x32] - ldrb r0, [r2] - lsls r0, 2 - adds r3, 0x2 - adds r0, r3 - ldrh r0, [r0] - ldrh r2, [r5, 0x34] - adds r0, r2 - strh r0, [r5, 0x34] - lsls r1, 16 - asrs r1, 20 - strh r1, [r5, 0x20] - lsls r0, 16 - asrs r2, r0, 20 - strh r2, [r5, 0x22] - movs r3, 0x38 - ldrsh r0, [r5, r3] - adds r3, r4, 0 - cmp r0, 0 - beq _080ACC04 - adds r0, r1, 0 - adds r0, 0x8 - lsls r0, 16 - movs r1, 0x80 - lsls r1, 17 - cmp r0, r1 - bhi _080ACC04 - adds r1, r2, 0 - movs r0, 0x10 - negs r0, r0 - cmp r1, r0 - blt _080ACC04 - cmp r1, 0xB0 - bgt _080ACC04 - adds r0, r5, 0 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - b _080ACC0E - .pool -_080ACC04: - adds r0, r5, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 -_080ACC0E: - strb r1, [r0] - adds r4, r0, 0 - ldrh r0, [r5, 0x2E] - subs r0, 0x1 - strh r0, [r5, 0x2E] - lsls r0, 16 - cmp r0, 0 - bne _080ACC80 - ldr r0, [r3] - ldr r1, =0x000006dc - adds r0, r1 - ldrb r1, [r0] - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl StartObjectImageAnim - movs r0, 0x1 - strh r0, [r5, 0x36] - ldr r1, =0x02021bbc - ldrh r0, [r5, 0x20] - ldrh r1, [r1] - subs r0, r1 - strh r0, [r5, 0x20] - ldr r1, =0x02021bbe - ldrh r0, [r5, 0x22] - ldrh r1, [r1] - subs r0, r1 - strh r0, [r5, 0x22] - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - b _080ACC80 - .pool -_080ACC60: - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080ACC80 - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - adds r0, r5, 0 - bl sub_80ACAB0 -_080ACC80: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80ACB84 - - thumb_func_start sub_80ACC88 -sub_80ACC88: @ 80ACC88 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x2E] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _080ACCA8 - adds r0, r4, 0 - bl sub_80ACAB0 - ldr r0, =sub_80ACB84 - str r0, [r4, 0x1C] - b _080ACCAC - .pool -_080ACCA8: - subs r0, r1, 0x1 - strh r0, [r4, 0x2E] -_080ACCAC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80ACC88 - - thumb_func_start sub_80ACCB4 -sub_80ACCB4: @ 80ACCB4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r0, 0 - lsls r5, r1, 16 - lsrs r5, 16 - ldr r2, =gUnknown_0854FC4C - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r1, =0x000006dc - adds r0, r1 - ldrb r0, [r0] - lsls r0, 2 - adds r1, r0, r2 - ldrh r1, [r1] - mov r8, r1 - adds r2, 0x2 - adds r0, r2 - ldrh r4, [r0] - add r4, r8 - adds r0, r5, 0 - adds r1, r4, 0 - bl __divsi3 - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl __modsi3 - lsls r0, 16 - lsrs r4, r0, 16 - subs r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =0x0000ffff - cmp r6, r0 - beq _080ACD12 - adds r5, r0, 0 -_080ACD02: - adds r0, r7, 0 - bl sub_80ACAB0 - subs r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, r5 - bne _080ACD02 -_080ACD12: - cmp r4, r8 - bcs _080ACD48 - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x0000ffff - cmp r4, r0 - beq _080ACD34 - adds r5, r0, 0 -_080ACD24: - adds r0, r7, 0 - bl sub_80ACB84 - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r5 - bne _080ACD24 -_080ACD34: - movs r0, 0 - b _080ACD5C - .pool -_080ACD48: - mov r1, r8 - subs r0, r4, r1 - strh r0, [r7, 0x2E] - adds r2, r7, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x1 -_080ACD5C: - strh r0, [r7, 0x3A] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80ACCB4 - - thumb_func_start sub_80ACD68 -sub_80ACD68: @ 80ACD68 - push {lr} - ldr r0, =gUnknown_0854FC54 - bl LoadObjectPic - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ACD68 - - thumb_func_start sub_80ACD78 -sub_80ACD78: @ 80ACD78 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =gUnknown_0854C14C - ldr r4, [r0] - ldr r0, =0x000006da - adds r2, r4, r0 - ldrb r0, [r2] - cmp r0, 0x18 - bne _080ACD92 - b _080ACE98 -_080ACD92: - ldrb r7, [r2] - ldr r0, =gUnknown_0854FC2C - ldr r2, =gUnknown_0854FB90 - lsls r6, r7, 2 - adds r2, r6, r2 - movs r3, 0 - ldrsh r1, [r2, r3] - movs r3, 0x2 - ldrsh r2, [r2, r3] - movs r3, 0x4E - bl AddObjectToBack - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x40 - beq _080ACE40 - ldr r3, =0x02020630 - lsls r4, r5, 4 - adds r1, r4, r5 - lsls r1, 2 - adds r1, r3 - movs r0, 0 - strh r0, [r1, 0x38] - lsls r2, r7, 3 - adds r0, r2, r7 - lsls r0, 4 - adds r0, r7 - strh r0, [r1, 0x30] - lsls r0, 16 - asrs r0, 16 - ldr r1, =0x00000257 - mov r10, r6 - mov r9, r3 - mov r12, r4 - mov r8, r2 - cmp r0, r1 - ble _080ACDF6 - adds r2, r1, 0 -_080ACDDE: - adds r0, r4, r5 - lsls r0, 2 - ldr r6, =0x02020630 - adds r0, r6 - ldr r3, =0xfffffda8 - ldrh r6, [r0, 0x30] - adds r1, r3, r6 - strh r1, [r0, 0x30] - lsls r1, 16 - asrs r1, 16 - cmp r1, r2 - bgt _080ACDDE -_080ACDF6: - mov r0, r12 - adds r4, r0, r5 - lsls r4, 2 - add r4, r9 - adds r0, r4, 0 - bl sub_80ACAB0 - mov r3, r8 - adds r1, r3, r7 - adds r0, r4, 0 - bl sub_80ACCB4 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - add r0, r10 - str r4, [r0] - b _080ACE46 - .pool -_080ACE40: - adds r1, r4, r6 - movs r0, 0 - str r0, [r1] -_080ACE46: - ldr r0, =gUnknown_0854C14C - ldr r2, [r0] - ldr r6, =0x000006da - adds r1, r2, r6 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x18 - bne _080ACE9C - movs r3, 0 - adds r1, r2, 0 - ldr r5, =sub_80ACB84 - ldr r4, =sub_80ACC88 -_080ACE64: - lsls r0, r3, 2 - adds r0, r1, r0 - ldr r2, [r0] - cmp r2, 0 - beq _080ACE8E - movs r6, 0x3A - ldrsh r0, [r2, r6] - cmp r0, 0 - bne _080ACE8C - str r5, [r2, 0x1C] - b _080ACE8E - .pool -_080ACE8C: - str r4, [r2, 0x1C] -_080ACE8E: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x17 - bls _080ACE64 -_080ACE98: - movs r0, 0 - b _080ACE9E -_080ACE9C: - movs r0, 0x1 -_080ACE9E: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80ACD78 - - thumb_func_start sub_80ACEAC -sub_80ACEAC: @ 80ACEAC - push {r4-r7,lr} - ldr r0, =gUnknown_0854C14C - ldr r3, [r0] - movs r0, 0xDB - lsls r0, 3 - adds r4, r3, r0 - ldr r1, =0x000006d9 - adds r5, r3, r1 - ldrb r0, [r4] - ldrb r7, [r5] - cmp r0, r7 - bne _080ACED0 - movs r0, 0 - b _080ACF32 - .pool -_080ACED0: - ldr r0, =0x000006d6 - adds r2, r3, r0 - ldrh r0, [r2] - adds r0, 0x1 - movs r6, 0 - strh r0, [r2] - ldr r7, =0x000006db - adds r1, r3, r7 - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1] - cmp r0, r1 - bls _080ACF30 - strh r6, [r2] - ldrb r0, [r4] - adds r1, r0, 0 - ldrb r5, [r5] - cmp r1, r5 - bcs _080ACF10 - adds r0, 0x1 - strb r0, [r4] - lsls r0, r1, 2 - adds r0, r3, r0 - ldr r1, [r0] - movs r0, 0x1 - strh r0, [r1, 0x38] - b _080ACF30 - .pool -_080ACF10: - subs r0, 0x1 - strb r0, [r4] - ldrb r0, [r4] - lsls r0, 2 - adds r0, r3, r0 - ldr r0, [r0] - strh r6, [r0, 0x38] - ldrb r0, [r4] - lsls r0, 2 - adds r0, r3, r0 - ldr r1, [r0] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] -_080ACF30: - movs r0, 0x1 -_080ACF32: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80ACEAC - - thumb_func_start sub_80ACF38 -sub_80ACF38: @ 80ACF38 - push {r4-r7,lr} - movs r4, 0 - ldr r0, =gUnknown_0854C14C - ldr r2, [r0] - ldr r3, =0x000006da - adds r1, r2, r3 - adds r7, r0, 0 - ldrb r1, [r1] - cmp r4, r1 - bcs _080ACF6A - adds r5, r2, 0 - adds r6, r5, r3 -_080ACF50: - lsls r0, r4, 2 - adds r0, r5, r0 - ldr r0, [r0] - cmp r0, 0 - beq _080ACF5E - bl RemoveObjectAndFreeTiles -_080ACF5E: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - ldrb r0, [r6] - cmp r4, r0 - bcc _080ACF50 -_080ACF6A: - ldr r0, [r7] - ldr r1, =0x000006da - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, =0x00001206 - bl FreeObjectTilesByTag - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ACF38 - - thumb_func_start sub_80ACF8C -sub_80ACF8C: @ 80ACF8C - push {r4,lr} - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x000006cc - adds r0, r1, r2 - movs r2, 0 - movs r3, 0 - strh r3, [r0] - ldr r4, =0x000006d2 - adds r0, r1, r4 - strb r2, [r0] - ldr r0, =0x000006c1 - adds r2, r1, r0 - movs r0, 0x3 - strb r0, [r2] - subs r4, 0x10 - adds r2, r1, r4 - movs r0, 0x14 - strb r0, [r2] - ldr r0, =0x000006e5 - adds r2, r1, r0 - movs r0, 0x10 - strb r0, [r2] - movs r2, 0xDC - lsls r2, 3 - adds r1, r2 - strh r3, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ACF8C - - thumb_func_start sub_80ACFDC -sub_80ACFDC: @ 80ACFDC - push {r4-r7,lr} - mov r7, r8 - push {r7} - bl sub_80ACF8C - ldr r2, =gUnknown_0854C14C - ldr r1, [r2] - ldr r3, =0x000006d2 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _080AD032 - mov r8, r2 - adds r7, r1, r3 -_080ACFF8: - bl snowflakes_progress2 - movs r4, 0 - mov r1, r8 - ldr r0, [r1] - ldr r3, =0x000006e4 - adds r0, r3 - ldrb r0, [r0] - cmp r4, r0 - bcs _080AD02C - ldr r0, =gUnknown_0854C14C - ldr r5, [r0] - adds r6, r5, r3 -_080AD012: - lsls r1, r4, 2 - adds r0, r5, 0 - adds r0, 0x60 - adds r0, r1 - ldr r0, [r0] - bl sub_80AD30C - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - ldrb r0, [r6] - cmp r4, r0 - bcc _080AD012 -_080AD02C: - ldrb r0, [r7] - cmp r0, 0 - beq _080ACFF8 -_080AD032: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ACFDC - - thumb_func_start snowflakes_progress2 -snowflakes_progress2: @ 80AD048 - push {r4,r5,lr} - ldr r0, =gUnknown_0854C14C - ldr r5, [r0] - ldr r0, =0x000006cc - adds r4, r5, r0 - ldrh r0, [r4] - cmp r0, 0 - bne _080AD070 - bl snowflakes_progress - lsls r0, 24 - cmp r0, 0 - bne _080AD070 - ldr r0, =0x000006d2 - adds r1, r5, r0 - movs r0, 0x1 - strb r0, [r1] - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_080AD070: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end snowflakes_progress2 - - thumb_func_start sub_80AD084 -sub_80AD084: @ 80AD084 - push {r4,lr} - ldr r0, =gUnknown_0854C14C - ldr r2, [r0] - ldr r0, =0x000006ce - adds r3, r2, r0 - ldrh r1, [r3] - cmp r1, 0 - beq _080AD0A4 - cmp r1, 0x1 - beq _080AD0B6 - movs r0, 0 - b _080AD0E2 - .pool -_080AD0A4: - ldr r4, =0x000006e5 - adds r0, r2, r4 - strb r1, [r0] - subs r4, 0x5 - adds r0, r2, r4 - strh r1, [r0] - ldrh r0, [r3] - adds r0, 0x1 - strh r0, [r3] -_080AD0B6: - bl snowflakes_progress - lsls r0, 24 - cmp r0, 0 - bne _080AD0E0 - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r0, =0x000006ce - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - movs r0, 0 - b _080AD0E2 - .pool -_080AD0E0: - movs r0, 0x1 -_080AD0E2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80AD084 - - thumb_func_start snowflakes_progress -snowflakes_progress: @ 80AD0E8 - push {r4,lr} - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r0, =0x000006e4 - adds r3, r1, r0 - ldr r4, =0x000006e5 - adds r2, r1, r4 - ldrb r0, [r3] - ldrb r4, [r2] - cmp r0, r4 - bne _080AD110 - movs r0, 0 - b _080AD152 - .pool -_080AD110: - movs r0, 0xDC - lsls r0, 3 - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x24 - bls _080AD13A - movs r0, 0 - strh r0, [r1] - ldrb r0, [r3] - ldrb r2, [r2] - cmp r0, r2 - bcs _080AD136 - bl snowflake_add - b _080AD13A -_080AD136: - bl snowflake_remove -_080AD13A: - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r2, =0x000006e4 - adds r1, r0, r2 - ldr r4, =0x000006e5 - adds r0, r4 - ldrb r1, [r1] - ldrb r0, [r0] - eors r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 -_080AD152: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end snowflakes_progress - - thumb_func_start snowflake_add -snowflake_add: @ 80AD164 - push {r4-r6,lr} - ldr r0, =gUnknown_0854FC8C - movs r1, 0 - movs r2, 0 - movs r3, 0x4E - bl AddObjectToBack - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _080AD1C8 - ldr r0, =0x02020630 - lsls r4, r1, 4 - adds r4, r1 - lsls r4, 2 - adds r4, r0 - ldr r0, =gUnknown_0854C14C - ldr r5, [r0] - ldr r0, =0x000006e4 - adds r6, r5, r0 - ldrb r0, [r6] - strh r0, [r4, 0x36] - adds r0, r4, 0 - bl sub_80AD204 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] - ldrb r0, [r6] - adds r1, r0, 0x1 - strb r1, [r6] - lsls r0, 24 - lsrs r0, 22 - adds r5, 0x60 - adds r5, r0 - str r4, [r5] - movs r0, 0x1 - b _080AD1CA - .pool -_080AD1C8: - movs r0, 0 -_080AD1CA: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end snowflake_add - - thumb_func_start snowflake_remove -snowflake_remove: @ 80AD1D0 - push {lr} - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r0, =0x000006e4 - adds r2, r1, r0 - ldrb r0, [r2] - cmp r0, 0 - bne _080AD1EC - movs r0, 0 - b _080AD200 - .pool -_080AD1EC: - subs r0, 0x1 - strb r0, [r2] - lsls r0, 24 - lsrs r0, 22 - adds r1, 0x60 - adds r1, r0 - ldr r0, [r1] - bl RemoveObjectAndFreeTiles - movs r0, 0x1 -_080AD200: - pop {r1} - bx r1 - thumb_func_end snowflake_remove - - thumb_func_start sub_80AD204 -sub_80AD204: @ 80AD204 - push {r4-r7,lr} - adds r5, r0, 0 - bl GenerateRandomNumber - movs r1, 0x36 - ldrsh r2, [r5, r1] - lsls r1, r2, 2 - adds r1, r2 - movs r2, 0x7 - ands r1, r2 - lsls r4, r1, 4 - subs r4, r1 - lsls r4, 1 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1E - bl __umodsi3 - adds r4, r0 - lsls r4, 16 - lsrs r4, 16 - ldr r1, =0x02021bbe - adds r0, r5, 0 - adds r0, 0x29 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrh r1, [r1] - adds r0, r1 - movs r2, 0x3 - negs r2, r2 - adds r1, r2, 0 - subs r1, r0 - movs r7, 0 - strh r1, [r5, 0x22] - ldr r1, =0x02021bbc - adds r0, r5, 0 - adds r0, 0x28 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrh r1, [r1] - adds r0, r1 - subs r4, r0 - strh r4, [r5, 0x20] - movs r1, 0x22 - ldrsh r0, [r5, r1] - lsls r0, 7 - strh r0, [r5, 0x2E] - strh r7, [r5, 0x24] - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r6, r0, 0 - movs r4, 0x3 - ands r4, r6 - lsls r0, r4, 2 - adds r0, r4 - adds r0, 0x40 - strh r0, [r5, 0x30] - strh r0, [r5, 0x3C] - movs r1, 0x1 - bics r1, r6 - adds r0, r5, 0 - bl StartObjectImageAnim - strh r7, [r5, 0x34] - movs r0, 0x1 - cmp r4, 0 - bne _080AD294 - movs r0, 0x2 -_080AD294: - strh r0, [r5, 0x32] - movs r0, 0x1F - ands r0, r6 - adds r0, 0xD2 - strh r0, [r5, 0x3A] - strh r7, [r5, 0x38] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AD204 - - thumb_func_start sub_80AD2B0 -sub_80AD2B0: @ 80AD2B0 - push {r4,lr} - adds r3, r0, 0 - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r1, =0x000006e2 - adds r4, r0, r1 - ldrh r0, [r4] - cmp r0, 0x12 - bls _080AD2F6 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r0, =sub_80AD30C - str r0, [r3, 0x1C] - ldr r1, =0x02021bbe - adds r0, r3, 0 - adds r0, 0x29 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrh r1, [r1] - adds r0, r1 - movs r1, 0xFA - subs r1, r0 - movs r2, 0 - strh r1, [r3, 0x22] - movs r1, 0x22 - ldrsh r0, [r3, r1] - lsls r0, 7 - strh r0, [r3, 0x2E] - strh r2, [r4] -_080AD2F6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AD2B0 - - thumb_func_start sub_80AD30C -sub_80AD30C: @ 80AD30C - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x2E] - adds r0, r1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 23 - strh r0, [r4, 0x22] - ldrh r0, [r4, 0x32] - ldrh r2, [r4, 0x34] - adds r0, r2 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x34] - ldr r1, =gUnknown_08329F40 - movs r3, 0x34 - ldrsh r0, [r4, r3] - lsls r0, 1 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _080AD33E - adds r0, 0x3F -_080AD33E: - asrs r0, 6 - strh r0, [r4, 0x24] - adds r0, r4, 0 - adds r0, 0x28 - movs r5, 0 - ldrsb r5, [r0, r5] - ldrh r0, [r4, 0x20] - adds r0, r5 - ldr r1, =0x02021bbc - ldrh r1, [r1] - adds r3, r1, r0 - ldr r2, =0x000001ff - adds r0, r2, 0 - ands r3, r0 - adds r2, r3, 0 - movs r0, 0x80 - lsls r0, 1 - ands r0, r2 - cmp r0, 0 - beq _080AD370 - ldr r3, =0xffffff00 - adds r0, r3, 0 - orrs r2, r0 - lsls r0, r2, 16 - lsrs r3, r0, 16 -_080AD370: - lsls r0, r3, 16 - asrs r0, 16 - movs r2, 0x3 - negs r2, r2 - cmp r0, r2 - bge _080AD394 - adds r1, r5 - movs r0, 0xF2 - subs r0, r1 - b _080AD39C - .pool -_080AD394: - cmp r0, 0xF2 - ble _080AD39E - adds r0, r1, r5 - subs r0, r2, r0 -_080AD39C: - strh r0, [r4, 0x20] -_080AD39E: - adds r0, r4, 0 - adds r0, 0x29 - movs r3, 0 - ldrsb r3, [r0, r3] - ldrh r0, [r4, 0x22] - adds r0, r3 - ldr r1, =0x02021bbe - ldrh r1, [r1] - adds r2, r1, r0 - movs r0, 0xFF - ands r2, r0 - adds r0, r2, 0 - subs r0, 0xA4 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x6 - bhi _080AD3E0 - adds r1, r3 - movs r0, 0xFA - subs r0, r1 - movs r1, 0 - strh r0, [r4, 0x22] - movs r2, 0x22 - ldrsh r0, [r4, r2] - lsls r0, 7 - strh r0, [r4, 0x2E] - strh r1, [r4, 0x38] - movs r0, 0xDC - strh r0, [r4, 0x3A] - b _080AD40C - .pool -_080AD3E0: - adds r0, r2, 0 - subs r0, 0xF3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x6 - bhi _080AD40C - movs r1, 0 - movs r0, 0xA3 - strh r0, [r4, 0x22] - lsls r0, 7 - strh r0, [r4, 0x2E] - strh r1, [r4, 0x38] - movs r0, 0xDC - strh r0, [r4, 0x3A] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_80AD2B0 - str r0, [r4, 0x1C] -_080AD40C: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x3A - ldrsh r1, [r4, r3] - cmp r0, r1 - bne _080AD438 - adds r0, r4, 0 - bl sub_80AD204 - movs r0, 0xFA - strh r0, [r4, 0x22] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_80AD2B0 - str r0, [r4, 0x1C] -_080AD438: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AD30C - - thumb_func_start sub_80AD444 -sub_80AD444: @ 80AD444 - push {r4,r5,lr} - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x000006cc - adds r0, r1, r2 - movs r3, 0 - movs r2, 0 - strh r2, [r0] - ldr r5, =0x000006d2 - adds r4, r1, r5 - strb r3, [r4] - adds r5, 0x4 - adds r0, r1, r5 - strh r2, [r0] - ldr r0, =0x000006db - adds r2, r1, r0 - movs r0, 0x4 - strb r0, [r2] - ldr r2, =0x000006dc - adds r0, r1, r2 - strb r3, [r0] - adds r5, 0x3 - adds r2, r1, r5 - movs r0, 0x10 - strb r0, [r2] - ldr r0, =0x000006c1 - adds r2, r1, r0 - movs r0, 0x3 - strb r0, [r2] - subs r5, 0x17 - adds r2, r1, r5 - movs r0, 0x14 - strb r0, [r2] - strb r3, [r4] - ldr r0, =0x000006ed - adds r1, r0 - strb r3, [r1] - movs r0, 0x51 - bl sub_80AC31C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AD444 - - thumb_func_start sub_80AD4B8 -sub_80AD4B8: @ 80AD4B8 - push {r4,lr} - bl sub_80AD444 - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x000006d2 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080AD4D8 - adds r4, r1, r2 -_080AD4CE: - bl sub_80AD584 - ldrb r0, [r4] - cmp r0, 0 - beq _080AD4CE -_080AD4D8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AD4B8 - - thumb_func_start sub_80AD4E8 -sub_80AD4E8: @ 80AD4E8 - push {r4,r5,lr} - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x000006cc - adds r0, r1, r2 - movs r4, 0 - movs r2, 0 - strh r2, [r0] - ldr r5, =0x000006d2 - adds r3, r1, r5 - strb r4, [r3] - adds r5, 0x4 - adds r0, r1, r5 - strh r2, [r0] - ldr r0, =0x000006db - adds r2, r1, r0 - movs r0, 0x4 - strb r0, [r2] - adds r5, 0x6 - adds r2, r1, r5 - movs r0, 0x1 - strb r0, [r2] - ldr r0, =0x000006d9 - adds r2, r1, r0 - movs r0, 0x18 - strb r0, [r2] - subs r5, 0x1B - adds r2, r1, r5 - movs r0, 0x3 - strb r0, [r2] - ldr r0, =0x000006c2 - adds r1, r0 - movs r0, 0x14 - strb r0, [r1] - strb r4, [r3] - movs r0, 0x53 - bl sub_80AC31C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AD4E8 - - thumb_func_start sub_80AD554 -sub_80AD554: @ 80AD554 - push {r4,lr} - bl sub_80AD4E8 - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x000006d2 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080AD574 - adds r4, r1, r2 -_080AD56A: - bl sub_80AD584 - ldrb r0, [r4] - cmp r0, 0 - beq _080AD56A -_080AD574: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AD554 - - thumb_func_start sub_80AD584 -sub_80AD584: @ 80AD584 - push {r4,r5,lr} - bl sub_80AD9F8 - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r1, =0x000006cc - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0xE - bls _080AD59A - b _080AD8FA -_080AD59A: - lsls r0, 2 - ldr r1, =_080AD5B0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080AD5B0: - .4byte _080AD5EC - .4byte _080AD608 - .4byte _080AD62C - .4byte _080AD65C - .4byte _080AD680 - .4byte _080AD6B0 - .4byte _080AD6E0 - .4byte _080AD70C - .4byte _080AD72A - .4byte _080AD788 - .4byte _080AD80C - .4byte _080AD834 - .4byte _080AD864 - .4byte _080AD8A8 - .4byte _080AD8DC -_080AD5EC: - bl sub_80ACD68 - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x000006cc - adds r1, r2 - ldrh r0, [r1] - adds r0, 0x1 - b _080AD8F8 - .pool -_080AD608: - bl sub_80ACD78 - lsls r0, 24 - cmp r0, 0 - beq _080AD614 - b _080AD8FA -_080AD614: - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r3, =0x000006cc - adds r1, r3 - ldrh r0, [r1] - adds r0, 0x1 - b _080AD8F8 - .pool -_080AD62C: - bl sub_80ACEAC - lsls r0, 24 - cmp r0, 0 - beq _080AD638 - b _080AD8FA -_080AD638: - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r0, =0x000006d2 - adds r2, r1, r0 - movs r0, 0x1 - strb r0, [r2] - ldr r2, =0x000006cc - adds r1, r2 - ldrh r0, [r1] - adds r0, 0x1 - b _080AD8F8 - .pool -_080AD65C: - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r3, =0x000006c6 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _080AD66C - b _080AD8FA -_080AD66C: - ldr r0, =0x000006cc - adds r1, r0 - movs r0, 0x6 - b _080AD8F8 - .pool -_080AD680: - ldr r0, =gUnknown_0854C14C - ldr r4, [r0] - ldr r2, =0x000006ea - adds r1, r4, r2 - movs r0, 0x1 - strb r0, [r1] - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r5, 0xB4 - lsls r5, 1 - adds r1, r5, 0 - bl __umodsi3 - adds r0, r5 - ldr r3, =0x000006e6 - adds r1, r4, r3 - strh r0, [r1] - ldr r0, =0x000006cc - adds r4, r0 - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_080AD6B0: - ldr r0, =gUnknown_0854C14C - ldr r2, [r0] - ldr r3, =0x000006e6 - adds r1, r2, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - lsls r0, 16 - cmp r0, 0 - beq _080AD6C6 - b _080AD8FA -_080AD6C6: - ldr r0, =0x000006cc - adds r1, r2, r0 - ldrh r0, [r1] - adds r0, 0x1 - b _080AD8F8 - .pool -_080AD6E0: - ldr r0, =gUnknown_0854C14C - ldr r4, [r0] - ldr r1, =0x000006ea - adds r0, r4, r1 - movs r5, 0x1 - strb r5, [r0] - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - ands r0, r5 - ldr r2, =0x000006eb - adds r1, r4, r2 - strb r0, [r1] - b _080AD768 - .pool -_080AD70C: - bl GenerateRandomNumber - ldr r1, =gUnknown_0854C14C - ldr r2, [r1] - movs r1, 0x1 - ands r1, r0 - adds r1, 0x1 - ldr r3, =0x000006ec - adds r0, r2, r3 - strb r1, [r0] - ldr r0, =0x000006cc - adds r2, r0 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] -_080AD72A: - movs r0, 0x13 - bl sub_80ABC48 - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x000006eb - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080AD74E - ldr r3, =0x000006ec - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080AD74E - movs r0, 0x14 - bl sub_80AD9BC -_080AD74E: - bl GenerateRandomNumber - ldr r1, =gUnknown_0854C14C - ldr r4, [r1] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - adds r0, 0x6 - ldr r2, =0x000006e6 - adds r1, r4, r2 - strh r0, [r1] -_080AD768: - ldr r3, =0x000006cc - adds r4, r3 - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _080AD8FA - .pool -_080AD788: - ldr r0, =gUnknown_0854C14C - ldr r4, [r0] - ldr r0, =0x000006e6 - adds r5, r4, r0 - ldrh r0, [r5] - subs r0, 0x1 - strh r0, [r5] - lsls r0, 16 - cmp r0, 0 - beq _080AD79E - b _080AD8FA -_080AD79E: - movs r0, 0x3 - bl sub_80ABC48 - ldr r2, =0x000006ea - adds r1, r4, r2 - movs r0, 0x1 - strb r0, [r1] - ldr r3, =0x000006ec - adds r1, r4, r3 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - beq _080AD7E8 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF - ands r0, r1 - adds r0, 0x3C - strh r0, [r5] - ldr r0, =0x000006cc - adds r1, r4, r0 - movs r0, 0xA - b _080AD8F8 - .pool -_080AD7E8: - ldr r1, =0x000006eb - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080AD800 - ldr r2, =0x000006cc - adds r1, r4, r2 - b _080AD8F6 - .pool -_080AD800: - ldr r3, =0x000006cc - adds r1, r4, r3 - movs r0, 0xB - b _080AD8F8 - .pool -_080AD80C: - ldr r0, =gUnknown_0854C14C - ldr r2, [r0] - ldr r0, =0x000006e6 - adds r1, r2, r0 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - lsls r0, 16 - cmp r0, 0 - bne _080AD8FA - ldr r3, =0x000006cc - adds r1, r2, r3 - movs r0, 0x8 - b _080AD8F8 - .pool -_080AD834: - bl GenerateRandomNumber - ldr r1, =gUnknown_0854C14C - ldr r2, [r1] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF - ands r0, r1 - adds r0, 0x3C - ldr r3, =0x000006e6 - adds r1, r2, r3 - strh r0, [r1] - ldr r0, =0x000006cc - adds r2, r0 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - b _080AD8FA - .pool -_080AD864: - ldr r0, =gUnknown_0854C14C - ldr r5, [r0] - ldr r1, =0x000006e6 - adds r4, r5, r1 - ldrh r0, [r4] - subs r0, 0x1 - strh r0, [r4] - lsls r0, 16 - cmp r0, 0 - bne _080AD8FA - movs r0, 0x64 - bl sub_80AD9BC - movs r0, 0x13 - bl sub_80ABC48 - bl GenerateRandomNumber - movs r1, 0xF - ands r1, r0 - adds r1, 0x1E - strh r1, [r4] - ldr r2, =0x000006cc - adds r1, r5, r2 - ldrh r0, [r1] - adds r0, 0x1 - b _080AD8F8 - .pool -_080AD8A8: - ldr r0, =gUnknown_0854C14C - ldr r4, [r0] - ldr r3, =0x000006e6 - adds r1, r4, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - lsls r0, 16 - cmp r0, 0 - bne _080AD8FA - movs r0, 0x13 - movs r1, 0x3 - movs r2, 0x5 - bl sub_80ABC7C - ldr r0, =0x000006cc - adds r1, r4, r0 - ldrh r0, [r1] - adds r0, 0x1 - b _080AD8F8 - .pool -_080AD8DC: - ldr r0, =gUnknown_0854C14C - ldr r2, [r0] - ldr r1, =0x000006c6 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _080AD8FA - ldr r3, =0x000006ea - adds r1, r2, r3 - movs r0, 0x1 - strb r0, [r1] - ldr r0, =0x000006cc - adds r1, r2, r0 -_080AD8F6: - movs r0, 0x4 -_080AD8F8: - strh r0, [r1] -_080AD8FA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AD584 - - thumb_func_start sub_80AD910 -sub_80AD910: @ 80AD910 - push {r4-r6,lr} - ldr r0, =gUnknown_0854C14C - ldr r6, [r0] - ldr r0, =0x000006ce - adds r5, r6, r0 - ldrh r1, [r5] - cmp r1, 0x1 - beq _080AD946 - cmp r1, 0x1 - bgt _080AD934 - cmp r1, 0 - beq _080AD93A - b _080AD9AC - .pool -_080AD934: - cmp r1, 0x2 - beq _080AD990 - b _080AD9AC -_080AD93A: - ldr r2, =0x000006ea - adds r0, r6, r2 - strb r1, [r0] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] -_080AD946: - bl sub_80AD584 - ldr r0, =gUnknown_0854C14C - ldr r2, [r0] - ldr r1, =0x000006ea - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080AD9B4 - subs r1, 0x19 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x3 - beq _080AD9AC - cmp r0, 0x5 - beq _080AD9AC - cmp r0, 0xD - beq _080AD9AC - ldr r0, =0x000006d9 - adds r1, r2, r0 - movs r0, 0 - strb r0, [r1] - ldr r0, =0x000006ce - adds r1, r2, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _080AD9B4 - .pool -_080AD990: - bl sub_80ACEAC - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _080AD9B4 - bl sub_80ACF38 - ldr r1, =0x000006ed - adds r0, r6, r1 - strb r4, [r0] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] -_080AD9AC: - movs r0, 0 - b _080AD9B6 - .pool -_080AD9B4: - movs r0, 0x1 -_080AD9B6: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80AD910 - - thumb_func_start sub_80AD9BC -sub_80AD9BC: @ 80AD9BC - push {r4-r6,lr} - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =gUnknown_0854C14C - ldr r4, [r0] - ldr r0, =0x000006ed - adds r5, r4, r0 - ldrb r0, [r5] - cmp r0, 0 - bne _080AD9EA - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __umodsi3 - movs r2, 0xDD - lsls r2, 3 - adds r1, r4, r2 - strh r0, [r1] - movs r0, 0x1 - strb r0, [r5] -_080AD9EA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AD9BC - - thumb_func_start sub_80AD9F8 -sub_80AD9F8: @ 80AD9F8 - push {r4,lr} - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x000006ed - adds r0, r1, r2 - ldrb r4, [r0] - cmp r4, 0x1 - bne _080ADA58 - movs r0, 0xDD - lsls r0, 3 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - bne _080ADA54 - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - bne _080ADA58 - bl GenerateRandomNumber - ands r4, r0 - cmp r4, 0 - beq _080ADA38 - movs r0, 0x57 - bl audio_play - b _080ADA3E - .pool -_080ADA38: - movs r0, 0x58 - bl audio_play -_080ADA3E: - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r1, =0x000006ed - adds r0, r1 - movs r1, 0 - strb r1, [r0] - b _080ADA58 - .pool -_080ADA54: - subs r0, 0x1 - strh r0, [r1] -_080ADA58: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80AD9F8 - - thumb_func_start sub_80ADA60 -sub_80ADA60: @ 80ADA60 - push {lr} - ldr r0, =gUnknown_0854C14C - ldr r3, [r0] - ldr r0, =0x000006cc - adds r1, r3, r0 - movs r2, 0 - movs r0, 0 - strh r0, [r1] - ldr r1, =0x000006d2 - adds r0, r3, r1 - strb r2, [r0] - subs r1, 0x11 - adds r0, r3, r1 - strb r2, [r0] - ldr r2, =0x000006c2 - adds r1, r3, r2 - movs r0, 0x14 - strb r0, [r1] - ldr r1, =0x000006fb - adds r0, r3, r1 - ldrb r1, [r0] - cmp r1, 0 - bne _080ADAA8 - adds r2, 0x2E - adds r0, r3, r2 - strh r1, [r0] - adds r2, 0x2 - adds r0, r3, r2 - strh r1, [r0] - subs r2, 0x4 - adds r0, r3, r2 - strh r1, [r0] - movs r0, 0 - movs r1, 0x10 - bl sub_80AC124 -_080ADAA8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ADA60 - - thumb_func_start sub_80ADAC0 -sub_80ADAC0: @ 80ADAC0 - push {r4,lr} - bl sub_80ADA60 - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x000006d2 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080ADAE0 - adds r4, r1, r2 -_080ADAD6: - bl sub_80ADAF0 - ldrb r0, [r4] - cmp r0, 0 - beq _080ADAD6 -_080ADAE0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ADAC0 - - thumb_func_start sub_80ADAF0 -sub_80ADAF0: @ 80ADAF0 - push {r4-r6,lr} - ldr r0, =gUnknown_0854C14C - ldr r6, [r0] - ldr r0, =0x02021bbc - ldr r1, =0x000006f2 - adds r2, r6, r1 - ldrh r0, [r0] - ldrh r1, [r2] - subs r0, r1 - movs r1, 0xFF - ands r0, r1 - ldr r3, =0x000006ee - adds r1, r6, r3 - strh r0, [r1] - movs r0, 0xDE - lsls r0, 3 - adds r1, r6, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x3 - bls _080ADB2A - movs r0, 0 - strh r0, [r1] - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] -_080ADB2A: - ldr r1, =0x000006cc - adds r5, r6, r1 - ldrh r4, [r5] - cmp r4, 0 - beq _080ADB50 - cmp r4, 0x1 - beq _080ADB90 - b _080ADBA6 - .pool -_080ADB50: - bl sub_80ADCAC - movs r3, 0xDA - lsls r3, 3 - adds r0, r6, r3 - ldrb r0, [r0] - cmp r0, 0x6 - bne _080ADB6C - movs r0, 0xC - movs r1, 0x8 - movs r2, 0x3 - bl sub_80AC164 - b _080ADB76 -_080ADB6C: - movs r0, 0x4 - movs r1, 0x10 - movs r2, 0 - bl sub_80AC164 -_080ADB76: - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r0, =0x000006cc - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _080ADBA6 - .pool -_080ADB90: - bl sub_80AC1A8 - lsls r0, 24 - cmp r0, 0 - beq _080ADBA6 - ldr r1, =0x000006d2 - adds r0, r6, r1 - strb r4, [r0] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] -_080ADBA6: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ADAF0 - - thumb_func_start sub_80ADBB0 -sub_80ADBB0: @ 80ADBB0 - push {r4,lr} - ldr r0, =gUnknown_0854C14C - ldr r2, [r0] - ldr r0, =0x02021bbc - ldr r1, =0x000006f2 - adds r3, r2, r1 - ldrh r0, [r0] - ldrh r1, [r3] - subs r0, r1 - movs r1, 0xFF - ands r0, r1 - ldr r4, =0x000006ee - adds r1, r2, r4 - strh r0, [r1] - movs r0, 0xDE - lsls r0, 3 - adds r1, r2, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x3 - bls _080ADBEA - movs r0, 0 - strh r0, [r1] - ldrh r0, [r3] - adds r0, 0x1 - strh r0, [r3] -_080ADBEA: - ldr r1, =0x000006ce - adds r4, r2, r1 - ldrh r0, [r4] - cmp r0, 0x1 - beq _080ADC26 - cmp r0, 0x1 - bgt _080ADC14 - cmp r0, 0 - beq _080ADC1A - b _080ADC3E - .pool -_080ADC14: - cmp r0, 0x2 - beq _080ADC32 - b _080ADC3E -_080ADC1A: - movs r0, 0 - movs r1, 0x10 - movs r2, 0x3 - bl sub_80AC164 - b _080ADC36 -_080ADC26: - bl sub_80AC1A8 - lsls r0, 24 - cmp r0, 0 - beq _080ADC42 - b _080ADC36 -_080ADC32: - bl sub_80ADD68 -_080ADC36: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _080ADC42 -_080ADC3E: - movs r0, 0 - b _080ADC44 -_080ADC42: - movs r0, 0x1 -_080ADC44: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80ADBB0 - - thumb_func_start sub_80ADC4C -sub_80ADC4C: @ 80ADC4C - push {r4,lr} - adds r3, r0, 0 - ldr r0, =0x02021bbe - ldrb r0, [r0] - strh r0, [r3, 0x26] - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r1, =0x000006ee - adds r2, r0, r1 - ldrh r1, [r2] - adds r1, 0x20 - movs r4, 0x2E - ldrsh r0, [r3, r4] - lsls r0, 6 - adds r1, r0 - strh r1, [r3, 0x20] - lsls r1, 16 - ldr r0, =0x010f0000 - cmp r1, r0 - ble _080ADC90 - movs r0, 0xF0 - lsls r0, 1 - adds r1, r0, 0 - ldrh r2, [r2] - adds r1, r2 - movs r4, 0x2E - ldrsh r2, [r3, r4] - movs r0, 0x4 - subs r0, r2 - lsls r0, 6 - subs r1, r0 - ldr r0, =0x000001ff - ands r1, r0 - strh r1, [r3, 0x20] -_080ADC90: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ADC4C - - thumb_func_start sub_80ADCAC -sub_80ADCAC: @ 80ADCAC - push {r4,r5,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r1, =0x000006fb - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080ADD56 - ldr r0, =gUnknown_0854FD30 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp] - str r1, [sp, 0x4] - mov r0, sp - bl LoadObjectPic - movs r5, 0 -_080ADCD0: - ldr r0, =gUnknown_0854FD18 - movs r1, 0 - movs r2, 0 - movs r3, 0xFF - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _080ADD34 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - adds r0, r5, 0 - movs r1, 0x5 - bl __umodsi3 - strh r0, [r4, 0x2E] - lsls r0, 16 - lsrs r0, 10 - adds r0, 0x20 - strh r0, [r4, 0x20] - adds r0, r5, 0 - movs r1, 0x5 - bl __udivsi3 - lsls r0, 16 - lsrs r0, 10 - adds r0, 0x20 - strh r0, [r4, 0x22] - ldr r2, =gUnknown_0854C14C - ldr r0, [r2] - lsls r1, r5, 2 - adds r0, 0xA0 - adds r0, r1 - str r4, [r0] - b _080ADD42 - .pool -_080ADD34: - ldr r2, =gUnknown_0854C14C - ldr r1, [r2] - lsls r0, r5, 2 - adds r1, 0xA0 - adds r1, r0 - movs r0, 0 - str r0, [r1] -_080ADD42: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x13 - bls _080ADCD0 - ldr r0, [r2] - ldr r1, =0x000006fb - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] -_080ADD56: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ADCAC - - thumb_func_start sub_80ADD68 -sub_80ADD68: @ 80ADD68 - push {r4,r5,lr} - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x000006fb - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080ADDA8 - movs r4, 0 - adds r5, r1, 0 - adds r5, 0xA0 -_080ADD7E: - lsls r0, r4, 2 - adds r0, r5, r0 - ldr r0, [r0] - cmp r0, 0 - beq _080ADD8C - bl RemoveObjectAndFreeTiles -_080ADD8C: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x13 - bls _080ADD7E - ldr r0, =0x00001201 - bl FreeObjectTilesByTag - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r1, =0x000006fb - adds r0, r1 - movs r1, 0 - strb r1, [r0] -_080ADDA8: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ADD68 - - thumb_func_start sub_80ADDBC -sub_80ADDBC: @ 80ADDBC - push {lr} - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r0, =0x000006cc - adds r2, r1, r0 - movs r3, 0 - movs r0, 0 - strh r0, [r2] - ldr r2, =0x000006d2 - adds r0, r1, r2 - strb r3, [r0] - subs r2, 0x11 - adds r0, r1, r2 - strb r3, [r0] - ldr r3, =0x000006c2 - adds r0, r1, r3 - movs r2, 0x14 - strb r2, [r0] - adds r3, 0x3C - adds r0, r1, r3 - strh r2, [r0] - movs r0, 0xE0 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - bne _080ADE04 - movs r0, 0 - movs r1, 0x10 - bl sub_80AC124 - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x52 - bl SetGpuReg -_080ADE04: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ADDBC - - thumb_func_start sub_80ADE18 -sub_80ADE18: @ 80ADE18 - push {r4,lr} - bl sub_80ADDBC - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x000006d2 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080ADE38 - adds r4, r1, r2 -_080ADE2E: - bl sub_80ADE48 - ldrb r0, [r4] - cmp r0, 0 - beq _080ADE2E -_080ADE38: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ADE18 - - thumb_func_start sub_80ADE48 -sub_80ADE48: @ 80ADE48 - push {r4,r5,lr} - ldr r2, =gUnknown_0854C14C - ldr r1, [r2] - ldr r0, =0x02021bbc - ldrh r0, [r0] - ldr r3, =0x000001ff - ands r3, r0 - ldr r0, =0x000006fc - adds r1, r0 - strh r3, [r1] - cmp r3, 0xEF - bls _080ADE74 - adds r4, r1, 0 - adds r1, r3, 0 -_080ADE64: - adds r3, r1, 0 - subs r3, 0xF0 - adds r1, r3, 0 - lsls r0, r3, 16 - lsrs r0, 16 - cmp r0, 0xEF - bhi _080ADE64 - strh r3, [r4] -_080ADE74: - ldr r5, [r2] - ldr r1, =0x000006cc - adds r4, r5, r1 - ldrh r0, [r4] - cmp r0, 0x1 - beq _080ADEAC - cmp r0, 0x1 - bgt _080ADEA0 - cmp r0, 0 - beq _080ADEA6 - b _080ADEE8 - .pool -_080ADEA0: - cmp r0, 0x2 - beq _080ADEC8 - b _080ADEE8 -_080ADEA6: - bl sub_80ADF5C - b _080ADEDA -_080ADEAC: - movs r1, 0xE0 - lsls r1, 3 - adds r0, r5, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080ADEBC - bl sub_80ADF6C -_080ADEBC: - movs r0, 0x10 - movs r1, 0 - movs r2, 0x1 - bl sub_80AC164 - b _080ADEDA -_080ADEC8: - bl sub_80AC1A8 - lsls r0, 24 - cmp r0, 0 - beq _080ADEEC - ldr r0, =0x000006d2 - adds r1, r5, r0 - movs r0, 0x1 - strb r0, [r1] -_080ADEDA: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _080ADEEC - .pool -_080ADEE8: - bl sub_80AC1A8 -_080ADEEC: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80ADE48 - - thumb_func_start sub_80ADEF4 -sub_80ADEF4: @ 80ADEF4 - push {r4,lr} - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r1, =0x000006ce - adds r4, r0, r1 - ldrh r0, [r4] - cmp r0, 0x1 - beq _080ADF2A - cmp r0, 0x1 - bgt _080ADF18 - cmp r0, 0 - beq _080ADF1E - b _080ADF4E - .pool -_080ADF18: - cmp r0, 0x2 - beq _080ADF40 - b _080ADF4E -_080ADF1E: - movs r0, 0 - movs r1, 0x10 - movs r2, 0x1 - bl sub_80AC164 - b _080ADF38 -_080ADF2A: - bl sub_80AC1A8 - lsls r0, 24 - cmp r0, 0 - beq _080ADF52 - bl sub_80AE014 -_080ADF38: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _080ADF52 -_080ADF40: - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_080ADF4E: - movs r0, 0 - b _080ADF54 -_080ADF52: - movs r0, 0x1 -_080ADF54: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80ADEF4 - - thumb_func_start sub_80ADF5C -sub_80ADF5C: @ 80ADF5C - push {lr} - ldr r0, =gUnknown_0854FD38 - bl LoadObjectPic - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ADF5C - - thumb_func_start sub_80ADF6C -sub_80ADF6C: @ 80ADF6C - push {r4,r5,lr} - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - movs r1, 0xE0 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080AE008 - movs r5, 0 -_080ADF80: - ldr r0, =gUnknown_0854FD58 - movs r1, 0 - movs r2, 0 - movs r3, 0x4E - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _080ADFE4 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - movs r0, 0 - strh r0, [r4, 0x30] - adds r0, r5, 0 - movs r1, 0x5 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - adds r0, r5, 0 - movs r1, 0x5 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x34] - movs r1, 0x34 - ldrsh r0, [r4, r1] - lsls r0, 6 - adds r0, 0x20 - strh r0, [r4, 0x2E] - ldr r2, =gUnknown_0854C14C - ldr r0, [r2] - lsls r1, r5, 2 - adds r0, 0xF0 - adds r0, r1 - str r4, [r0] - b _080ADFF2 - .pool -_080ADFE4: - ldr r2, =gUnknown_0854C14C - ldr r1, [r2] - lsls r0, r5, 2 - adds r1, 0xF0 - adds r1, r0 - movs r0, 0 - str r0, [r1] -_080ADFF2: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x13 - bls _080ADF80 - ldr r0, [r2] - movs r1, 0xE0 - lsls r1, 3 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] -_080AE008: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ADF6C - - thumb_func_start sub_80AE014 -sub_80AE014: @ 80AE014 - push {r4,r5,lr} - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - movs r2, 0xE0 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080AE058 - movs r4, 0 - adds r5, r1, 0 - adds r5, 0xF0 -_080AE02C: - lsls r0, r4, 2 - adds r0, r5, r0 - ldr r0, [r0] - cmp r0, 0 - beq _080AE03A - bl RemoveObjectAndFreeTiles -_080AE03A: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x13 - bls _080AE02C - ldr r0, =0x00001202 - bl FreeObjectTilesByTag - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - movs r1, 0xE0 - lsls r1, 3 - adds r0, r1 - movs r1, 0 - strb r1, [r0] -_080AE058: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AE014 - - thumb_func_start sub_80AE068 -sub_80AE068: @ 80AE068 - push {r4,lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x30] - adds r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - ble _080AE084 - movs r0, 0 - strh r0, [r3, 0x30] - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] -_080AE084: - ldr r1, =0x02021bbe - ldrh r0, [r3, 0x2E] - ldrh r1, [r1] - adds r0, r1 - strh r0, [r3, 0x22] - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r1, =0x000006fc - adds r2, r0, r1 - ldrh r1, [r2] - adds r1, 0x20 - movs r4, 0x32 - ldrsh r0, [r3, r4] - lsls r0, 6 - adds r1, r0 - strh r1, [r3, 0x20] - lsls r1, 16 - ldr r0, =0x010f0000 - cmp r1, r0 - ble _080AE0C8 - movs r0, 0xF0 - lsls r0, 1 - adds r1, r0, 0 - ldrh r2, [r2] - adds r1, r2 - movs r4, 0x32 - ldrsh r2, [r3, r4] - movs r0, 0x4 - subs r0, r2 - lsls r0, 6 - subs r1, r0 - ldr r0, =0x000001ff - ands r1, r0 - strh r1, [r3, 0x20] -_080AE0C8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AE068 - - thumb_func_start sub_80AE0E4 -sub_80AE0E4: @ 80AE0E4 - push {r4,lr} - ldr r0, =gUnknown_0854C14C - ldr r3, [r0] - ldr r1, =0x000006cc - adds r0, r3, r1 - movs r1, 0 - movs r2, 0 - strh r2, [r0] - ldr r4, =0x000006d2 - adds r0, r3, r4 - strb r1, [r0] - subs r4, 0x11 - adds r0, r3, r4 - strb r1, [r0] - ldr r0, =0x000006c2 - adds r1, r3, r0 - movs r0, 0x14 - strb r0, [r1] - movs r1, 0xDE - lsls r1, 3 - adds r0, r3, r1 - strh r2, [r0] - adds r4, 0x31 - adds r1, r3, r4 - movs r0, 0x1 - strh r0, [r1] - ldr r1, =0x00000724 - adds r0, r3, r1 - ldrb r2, [r0] - cmp r2, 0 - bne _080AE14E - adds r4, 0x2A - adds r0, r3, r4 - strh r2, [r0] - subs r1, 0x6 - adds r0, r3, r1 - strh r2, [r0] - adds r4, 0x4 - adds r0, r3, r4 - strh r2, [r0] - adds r1, 0x4 - adds r0, r3, r1 - strh r2, [r0] - subs r4, 0x8 - adds r0, r3, r4 - strh r2, [r0] - subs r1, 0x8 - adds r0, r3, r1 - strh r2, [r0] - movs r0, 0 - movs r1, 0x10 - bl sub_80AC124 -_080AE14E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AE0E4 - - thumb_func_start sub_80AE168 -sub_80AE168: @ 80AE168 - push {r4,lr} - bl sub_80AE0E4 - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x000006d2 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080AE188 - adds r4, r1, r2 -_080AE17E: - bl sub_80AE198 - ldrb r0, [r4] - cmp r0, 0 - beq _080AE17E -_080AE188: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AE168 - - thumb_func_start sub_80AE198 -sub_80AE198: @ 80AE198 - push {r4,r5,lr} - bl sub_80AE25C - ldr r0, =gUnknown_0854C14C - ldr r5, [r0] - ldr r0, =0x000006cc - adds r4, r5, r0 - ldrh r0, [r4] - cmp r0, 0x1 - beq _080AE1CC - cmp r0, 0x1 - bgt _080AE1C0 - cmp r0, 0 - beq _080AE1C6 - b _080AE1F0 - .pool -_080AE1C0: - cmp r0, 0x2 - beq _080AE1D8 - b _080AE1F0 -_080AE1C6: - bl sub_80AE2F0 - b _080AE1EA -_080AE1CC: - movs r0, 0xC - movs r1, 0x8 - movs r2, 0x8 - bl sub_80AC164 - b _080AE1EA -_080AE1D8: - bl sub_80AC1A8 - lsls r0, 24 - cmp r0, 0 - beq _080AE1F0 - ldr r0, =0x000006d2 - adds r1, r5, r0 - movs r0, 0x1 - strb r0, [r1] -_080AE1EA: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_080AE1F0: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AE198 - - thumb_func_start sub_80AE1FC -sub_80AE1FC: @ 80AE1FC - push {r4,lr} - bl sub_80AE25C - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r1, =0x000006ce - adds r4, r0, r1 - ldrh r0, [r4] - cmp r0, 0x1 - beq _080AE236 - cmp r0, 0x1 - bgt _080AE224 - cmp r0, 0 - beq _080AE22A - b _080AE24E - .pool -_080AE224: - cmp r0, 0x2 - beq _080AE242 - b _080AE24E -_080AE22A: - movs r0, 0 - movs r1, 0x10 - movs r2, 0x1 - bl sub_80AC164 - b _080AE246 -_080AE236: - bl sub_80AC1A8 - lsls r0, 24 - cmp r0, 0 - beq _080AE252 - b _080AE246 -_080AE242: - bl sub_80AE3A8 -_080AE246: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _080AE252 -_080AE24E: - movs r0, 0 - b _080AE254 -_080AE252: - movs r0, 0x1 -_080AE254: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80AE1FC - - thumb_func_start sub_80AE25C -sub_80AE25C: @ 80AE25C - push {r4,r5,lr} - ldr r0, =gUnknown_0854C14C - ldr r3, [r0] - ldr r0, =0x0000071c - adds r2, r3, r0 - ldrh r0, [r2] - adds r0, 0x1 - movs r5, 0 - strh r0, [r2] - ldr r1, =0x0000ffff - adds r4, r1, 0 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bls _080AE288 - movs r0, 0xE4 - lsls r0, 3 - adds r1, r3, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - strh r5, [r2] -_080AE288: - ldr r1, =0x0000071e - adds r2, r3, r1 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - ands r0, r4 - cmp r0, 0x4 - bls _080AE2A4 - ldr r0, =0x00000722 - adds r1, r3, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - strh r5, [r2] -_080AE2A4: - ldr r0, =0x02021bbc - movs r2, 0xE4 - lsls r2, 3 - adds r1, r3, r2 - ldrh r0, [r0] - ldrh r1, [r1] - subs r0, r1 - movs r1, 0xFF - ands r0, r1 - subs r2, 0x8 - adds r1, r3, r2 - strh r0, [r1] - ldr r1, =0x02021bbe - adds r2, 0xA - adds r0, r3, r2 - ldrh r0, [r0] - ldrh r1, [r1] - adds r0, r1 - subs r2, 0x8 - adds r1, r3, r2 - strh r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AE25C - - thumb_func_start sub_80AE2F0 -sub_80AE2F0: @ 80AE2F0 - push {r4-r6,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r1, =0x00000724 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080AE396 - ldr r0, =gUnknown_0854FD70 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp] - str r1, [sp, 0x4] - mov r0, sp - bl LoadObjectPic - movs r6, 0 -_080AE314: - adds r0, r6, 0 - movs r1, 0x5 - bl __udivsi3 - adds r5, r0, 0 - lsls r2, r5, 22 - asrs r2, 16 - ldr r0, =gUnknown_0854FD8C - movs r1, 0 - movs r3, 0xFF - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _080AE370 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - adds r0, r6, 0 - movs r1, 0x5 - bl __umodsi3 - strh r0, [r4, 0x2E] - strh r5, [r4, 0x30] - ldr r2, =gUnknown_0854C14C - ldr r0, [r2] - lsls r1, r6, 2 - movs r3, 0xA0 - lsls r3, 1 - adds r0, r3 - adds r0, r1 - str r4, [r0] - b _080AE382 - .pool -_080AE370: - ldr r2, =gUnknown_0854C14C - ldr r1, [r2] - lsls r0, r6, 2 - movs r3, 0xA0 - lsls r3, 1 - adds r1, r3 - adds r1, r0 - movs r0, 0 - str r0, [r1] -_080AE382: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x13 - bls _080AE314 - ldr r0, [r2] - ldr r1, =0x00000724 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] -_080AE396: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AE2F0 - - thumb_func_start sub_80AE3A8 -sub_80AE3A8: @ 80AE3A8 - push {r4,r5,lr} - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x00000724 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080AE3EA - movs r4, 0 - movs r0, 0xA0 - lsls r0, 1 - adds r5, r1, r0 -_080AE3C0: - lsls r0, r4, 2 - adds r0, r5, r0 - ldr r0, [r0] - cmp r0, 0 - beq _080AE3CE - bl RemoveObjectAndFreeTiles -_080AE3CE: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x13 - bls _080AE3C0 - ldr r0, =0x00001203 - bl FreeObjectTilesByTag - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r1, =0x00000724 - adds r0, r1 - movs r1, 0 - strb r1, [r0] -_080AE3EA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AE3A8 - - thumb_func_start sub_80AE3FC -sub_80AE3FC: @ 80AE3FC - push {r4,lr} - adds r3, r0, 0 - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x0000071a - adds r0, r1, r2 - ldrh r0, [r0] - strh r0, [r3, 0x26] - movs r4, 0xE3 - lsls r4, 3 - adds r2, r1, r4 - ldrh r1, [r2] - adds r1, 0x20 - movs r4, 0x2E - ldrsh r0, [r3, r4] - lsls r0, 6 - adds r1, r0 - strh r1, [r3, 0x20] - lsls r1, 16 - ldr r0, =0x010f0000 - cmp r1, r0 - ble _080AE444 - movs r0, 0xF0 - lsls r0, 1 - adds r1, r0, 0 - ldrh r2, [r2] - adds r1, r2 - movs r4, 0x2E - ldrsh r2, [r3, r4] - movs r0, 0x4 - subs r0, r2 - lsls r0, 6 - subs r1, r0 - ldr r0, =0x000001ff - ands r1, r0 - strh r1, [r3, 0x20] -_080AE444: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AE3FC - - thumb_func_start sub_80AE45C -sub_80AE45C: @ 80AE45C - push {r4,lr} - ldr r0, =gUnknown_0854C14C - ldr r3, [r0] - ldr r0, =0x000006cc - adds r1, r3, r0 - movs r2, 0 - movs r0, 0 - strh r0, [r1] - ldr r1, =0x000006d2 - adds r0, r3, r1 - strb r2, [r0] - ldr r4, =0x000006c1 - adds r0, r3, r4 - strb r2, [r0] - ldr r0, =0x000006c2 - adds r1, r3, r0 - movs r0, 0x14 - strb r0, [r1] - ldr r1, =0x00000716 - adds r0, r3, r1 - ldrb r2, [r0] - cmp r2, 0 - bne _080AE4B8 - adds r4, 0x43 - adds r1, r3, r4 - adds r4, 0x4 - adds r0, r3, r4 - str r2, [r0] - str r2, [r1] - ldr r0, =0x00000712 - adds r1, r3, r0 - movs r0, 0x8 - strh r0, [r1] - adds r4, 0xC - adds r0, r3, r4 - strh r2, [r0] - ldrh r2, [r1] - cmp r2, 0x5F - bls _080AE4B0 - movs r0, 0x80 - subs r0, r2 - strh r0, [r1] -_080AE4B0: - movs r0, 0 - movs r1, 0x10 - bl sub_80AC124 -_080AE4B8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AE45C - - thumb_func_start sub_80AE4DC -sub_80AE4DC: @ 80AE4DC - push {r4,lr} - bl sub_80AE45C - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x000006d2 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080AE4FC - adds r4, r1, r2 -_080AE4F2: - bl sub_80AE50C - ldrb r0, [r4] - cmp r0, 0 - beq _080AE4F2 -_080AE4FC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AE4DC - - thumb_func_start sub_80AE50C -sub_80AE50C: @ 80AE50C - push {r4,r5,lr} - bl sub_80AE624 - bl sub_80AE5EC - ldr r0, =gUnknown_0854C14C - ldr r5, [r0] - ldr r0, =0x00000712 - adds r1, r5, r0 - ldrh r0, [r1] - cmp r0, 0x5F - bls _080AE528 - movs r0, 0x20 - strh r0, [r1] -_080AE528: - ldr r0, =0x000006cc - adds r4, r5, r0 - ldrh r0, [r4] - cmp r0, 0x1 - beq _080AE558 - cmp r0, 0x1 - bgt _080AE548 - cmp r0, 0 - beq _080AE54E - b _080AE57C - .pool -_080AE548: - cmp r0, 0x2 - beq _080AE564 - b _080AE57C -_080AE54E: - bl sub_80AE738 - bl sub_80AE7F8 - b _080AE576 -_080AE558: - movs r0, 0x10 - movs r1, 0 - movs r2, 0 - bl sub_80AC164 - b _080AE576 -_080AE564: - bl sub_80AC1A8 - lsls r0, 24 - cmp r0, 0 - beq _080AE57C - ldr r0, =0x000006d2 - adds r1, r5, r0 - movs r0, 0x1 - strb r0, [r1] -_080AE576: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_080AE57C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AE50C - - thumb_func_start sub_80AE588 -sub_80AE588: @ 80AE588 - push {r4,lr} - bl sub_80AE624 - bl sub_80AE5EC - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r1, =0x000006ce - adds r4, r0, r1 - ldrh r0, [r4] - cmp r0, 0x1 - beq _080AE5C6 - cmp r0, 0x1 - bgt _080AE5B4 - cmp r0, 0 - beq _080AE5BA - b _080AE5DE - .pool -_080AE5B4: - cmp r0, 0x2 - beq _080AE5D2 - b _080AE5DE -_080AE5BA: - movs r0, 0 - movs r1, 0x10 - movs r2, 0 - bl sub_80AC164 - b _080AE5D6 -_080AE5C6: - bl sub_80AC1A8 - lsls r0, 24 - cmp r0, 0 - beq _080AE5E2 - b _080AE5D6 -_080AE5D2: - bl sub_80AE6A4 -_080AE5D6: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _080AE5E2 -_080AE5DE: - movs r0, 0 - b _080AE5E4 -_080AE5E2: - movs r0, 0x1 -_080AE5E4: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80AE588 - - thumb_func_start sub_80AE5EC -sub_80AE5EC: @ 80AE5EC - push {lr} - ldr r0, =gUnknown_0854C14C - ldr r2, [r0] - ldr r0, =0x00000714 - adds r3, r2, r0 - ldrh r0, [r3] - adds r1, r0, 0x1 - strh r1, [r3] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x4 - bls _080AE612 - ldr r1, =0x00000712 - adds r0, r2, r1 - ldrh r1, [r0] - adds r1, 0x1 - movs r2, 0 - strh r1, [r0] - strh r2, [r3] -_080AE612: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AE5EC - - thumb_func_start sub_80AE624 -sub_80AE624: @ 80AE624 - push {r4-r6,lr} - ldr r0, =gUnknown_0854C14C - ldr r2, [r0] - ldr r0, =0x00000704 - adds r4, r2, r0 - ldr r6, =gUnknown_08329F40 - ldr r1, =0x00000712 - adds r5, r2, r1 - ldrh r0, [r5] - lsls r0, 1 - adds r0, r6 - movs r3, 0 - ldrsh r1, [r0, r3] - lsls r1, 2 - ldr r0, [r4] - subs r0, r1 - str r0, [r4] - movs r0, 0xE1 - lsls r0, 3 - adds r3, r2, r0 - ldrh r0, [r5] - lsls r0, 1 - adds r0, r6 - movs r5, 0 - ldrsh r1, [r0, r5] - ldr r0, [r3] - subs r0, r1 - str r0, [r3] - ldr r1, =0x02021bbc - ldr r0, [r4] - lsrs r0, 8 - ldrh r1, [r1] - adds r0, r1 - movs r1, 0xFF - ands r0, r1 - ldr r4, =0x0000070e - adds r1, r2, r4 - strh r0, [r1] - ldr r1, =0x02021bbe - ldr r0, [r3] - lsrs r0, 8 - ldrh r1, [r1] - adds r0, r1 - movs r5, 0xE2 - lsls r5, 3 - adds r2, r5 - strh r0, [r2] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AE624 - - thumb_func_start sub_80AE6A4 -sub_80AE6A4: @ 80AE6A4 - push {r4,r5,lr} - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x00000716 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080AE6E6 - movs r4, 0 - movs r0, 0xC8 - lsls r0, 1 - adds r5, r1, r0 -_080AE6BC: - lsls r0, r4, 2 - adds r0, r5, r0 - ldr r0, [r0] - cmp r0, 0 - beq _080AE6CA - bl RemoveObjectAndFreeTiles -_080AE6CA: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x13 - bls _080AE6BC - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r1, =0x00000716 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, =0x00001204 - bl FreeObjectTilesByTag -_080AE6E6: - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x00000717 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080AE720 - movs r4, 0 - movs r0, 0xF0 - lsls r0, 1 - adds r5, r1, r0 -_080AE6FC: - lsls r0, r4, 2 - adds r0, r5, r0 - ldr r0, [r0] - cmp r0, 0 - beq _080AE70A - bl RemoveObjectAndFreeTiles -_080AE70A: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x4 - bls _080AE6FC - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r1, =0x00000717 - adds r0, r1 - movs r1, 0 - strb r1, [r0] -_080AE720: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AE6A4 - - thumb_func_start sub_80AE738 -sub_80AE738: @ 80AE738 - push {r4-r7,lr} - sub sp, 0x4 - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r1, =0x00000716 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080AE7E6 - ldr r0, =gUnknown_0854FDDC - bl LoadObjectPic - ldr r0, =gUnknown_0854C2B0 - bl sub_80ABF4C - movs r7, 0 -_080AE758: - adds r0, r7, 0 - movs r1, 0x5 - bl __udivsi3 - adds r6, r0, 0 - lsls r2, r6, 22 - asrs r2, 16 - ldr r0, =gUnknown_0854FDC4 - movs r1, 0 - movs r3, 0x1 - bl AddObjectToBack - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _080AE7C0 - ldr r2, =gUnknown_0854C14C - ldr r5, [r2] - lsls r0, r7, 2 - movs r3, 0xC8 - lsls r3, 1 - adds r5, r3 - adds r5, r0 - lsls r4, r1, 4 - adds r4, r1 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - str r4, [r5] - adds r0, r7, 0 - movs r1, 0x5 - str r2, [sp] - bl __umodsi3 - strh r0, [r4, 0x2E] - ldr r0, [r5] - strh r6, [r0, 0x30] - ldr r2, [sp] - b _080AE7D2 - .pool -_080AE7C0: - ldr r2, =gUnknown_0854C14C - ldr r1, [r2] - lsls r0, r7, 2 - movs r3, 0xC8 - lsls r3, 1 - adds r1, r3 - adds r1, r0 - movs r0, 0 - str r0, [r1] -_080AE7D2: - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, 0x13 - bls _080AE758 - ldr r0, [r2] - ldr r1, =0x00000716 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] -_080AE7E6: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AE738 - - thumb_func_start sub_80AE7F8 -sub_80AE7F8: @ 80AE7F8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r4, =gUnknown_0854C14C - ldr r0, [r4] - ldr r1, =0x00000717 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080AE8E4 - movs r7, 0 - mov r9, r4 - movs r2, 0 - mov r10, r2 -_080AE818: - lsls r0, r7, 1 - mov r8, r0 - adds r6, r0, r7 - lsls r5, r6, 4 - adds r1, r5, 0 - adds r1, 0x18 - lsls r1, 16 - asrs r1, 16 - ldr r0, =gUnknown_0854FDC4 - movs r2, 0xD0 - movs r3, 0x1 - bl AddObjectToBack - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _080AE8BC - mov r2, r9 - ldr r4, [r2] - lsls r0, r7, 2 - movs r2, 0xF0 - lsls r2, 1 - adds r4, r2 - adds r4, r0 - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - ldr r0, =0x02020630 - adds r2, r0 - str r2, [r4] - ldrb r1, [r2, 0x3] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x3] - ldr r1, [r4] - adds r0, r6, r5 - strh r0, [r1, 0x30] - ldr r1, [r4] - movs r0, 0x8 - strh r0, [r1, 0x2E] - ldr r0, [r4] - mov r1, r10 - strh r1, [r0, 0x32] - ldr r1, [r4] - ldr r0, =0x00006730 - strh r0, [r1, 0x36] - ldr r1, [r4] - ldr r0, =gUnknown_0854FDE4 - add r0, r8 - ldrh r0, [r0] - strh r0, [r1, 0x34] - ldr r0, [r4] - movs r1, 0x1 - bl StartObjectImageAnim - ldr r0, [r4] - movs r1, 0 - movs r2, 0x2 - movs r3, 0 - bl CalcVecFromObjectCenterToObjectUpperLeft - ldr r1, [r4] - ldr r0, =sub_80AE958 - str r0, [r1, 0x1C] - b _080AE8CE - .pool -_080AE8BC: - mov r2, r9 - ldr r0, [r2] - lsls r1, r7, 2 - movs r2, 0xF0 - lsls r2, 1 - adds r0, r2 - adds r0, r1 - mov r1, r10 - str r1, [r0] -_080AE8CE: - mov r2, r9 - ldr r0, [r2] - ldr r1, =0x00000717 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, 0x4 - bls _080AE818 -_080AE8E4: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AE7F8 - - thumb_func_start sub_80AE8F8 -sub_80AE8F8: @ 80AE8F8 - push {r4,lr} - adds r3, r0, 0 - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - movs r2, 0xE2 - lsls r2, 3 - adds r0, r1, r2 - ldrh r0, [r0] - strh r0, [r3, 0x26] - ldr r4, =0x0000070e - adds r2, r1, r4 - ldrh r1, [r2] - adds r1, 0x20 - movs r4, 0x2E - ldrsh r0, [r3, r4] - lsls r0, 6 - adds r1, r0 - strh r1, [r3, 0x20] - lsls r1, 16 - ldr r0, =0x010f0000 - cmp r1, r0 - ble _080AE940 - movs r0, 0xF0 - lsls r0, 1 - adds r1, r0, 0 - ldrh r2, [r2] - adds r1, r2 - movs r4, 0x2E - ldrsh r2, [r3, r4] - movs r0, 0x4 - subs r0, r2 - lsls r0, 6 - subs r1, r0 - ldr r0, =0x000001ff - ands r1, r0 - strh r1, [r3, 0x20] -_080AE940: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AE8F8 - - thumb_func_start sub_80AE958 -sub_80AE958: @ 80AE958 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x34] - subs r0, 0x1 - strh r0, [r2, 0x34] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _080AE972 - ldr r0, =sub_80AE97C - str r0, [r2, 0x1C] -_080AE972: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AE958 - - thumb_func_start sub_80AE97C -sub_80AE97C: @ 80AE97C - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0x22] - subs r0, 0x1 - strh r0, [r5, 0x22] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x30 - negs r1, r1 - cmp r0, r1 - bge _080AE99A - movs r0, 0xD0 - strh r0, [r5, 0x22] - movs r0, 0x4 - strh r0, [r5, 0x2E] -_080AE99A: - movs r0, 0x2E - ldrsh r4, [r5, r0] - ldr r3, =gUnknown_08329F40 - movs r2, 0x30 - ldrsh r1, [r5, r2] - lsls r0, r1, 1 - adds r0, r3 - movs r2, 0 - ldrsh r0, [r0, r2] - adds r2, r4, 0 - muls r2, r0 - adds r1, 0x40 - lsls r1, 1 - adds r1, r3 - movs r3, 0 - ldrsh r0, [r1, r3] - muls r0, r4 - lsrs r2, 8 - strh r2, [r5, 0x24] - lsrs r0, 8 - strh r0, [r5, 0x26] - ldrh r0, [r5, 0x30] - adds r0, 0xA - movs r1, 0xFF - ands r0, r1 - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x32] - adds r0, 0x1 - strh r0, [r5, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _080AE9E6 - movs r0, 0 - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] -_080AE9E6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AE97C - - thumb_func_start sub_80AE9F0 -sub_80AE9F0: @ 80AE9F0 - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r0, =0x000006cc - adds r2, r1, r0 - movs r0, 0 - strh r0, [r2] - ldr r0, =0x000006c1 - adds r2, r1, r0 - movs r0, 0x3 - strb r0, [r2] - ldr r0, =0x000006c2 - adds r1, r0 - movs r0, 0x14 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_80AE9F0 - - thumb_func_start sub_80AEA20 -sub_80AEA20: @ 80AEA20 - push {lr} - bl sub_80AE9F0 - pop {r0} - bx r0 - thumb_func_end sub_80AEA20 - - thumb_func_start nullsub_96 -nullsub_96: @ 80AEA2C - bx lr - thumb_func_end nullsub_96 - - thumb_func_start sub_80AEA30 -sub_80AEA30: @ 80AEA30 - movs r0, 0 - bx lr - thumb_func_end sub_80AEA30 - - thumb_func_start sub_80AEA34 -sub_80AEA34: @ 80AEA34 - push {r4,r5,lr} - bl sub_80ADA60 - ldr r0, =gUnknown_0854C14C - ldr r4, [r0] - ldr r1, =0x0000072e - adds r0, r4, r1 - ldrb r5, [r0] - cmp r5, 0 - bne _080AEA6C - ldr r0, =gUnknown_0854FDF8 - bl LoadObjectPic - movs r2, 0xE5 - lsls r2, 3 - adds r0, r4, r2 - strh r5, [r0] - ldr r0, =gUnknown_0854FDF0 - ldrb r1, [r0] - subs r2, 0x2 - adds r0, r4, r2 - strh r1, [r0] - ldr r1, =0x0000072a - adds r0, r4, r1 - strh r5, [r0] - adds r2, 0x6 - adds r0, r4, r2 - strh r5, [r0] -_080AEA6C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AEA34 - - thumb_func_start sub_80AEA88 -sub_80AEA88: @ 80AEA88 - push {r4,lr} - bl sub_80AEA34 - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r2, =0x000006d2 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080AEAA8 - adds r4, r1, r2 -_080AEA9E: - bl sub_80AEAB8 - ldrb r0, [r4] - cmp r0, 0 - beq _080AEA9E -_080AEAA8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AEA88 - - thumb_func_start sub_80AEAB8 -sub_80AEAB8: @ 80AEAB8 - push {r4-r7,lr} - bl sub_80ADAF0 - ldr r0, =gUnknown_0854C14C - ldr r5, [r0] - ldr r0, =0x00000726 - adds r4, r5, r0 - ldrh r0, [r4] - adds r0, 0x1 - movs r6, 0 - strh r0, [r4] - ldr r1, =0x0000ffff - adds r7, r1, 0 - ldr r2, =gUnknown_0854FDF0 - movs r1, 0xE5 - lsls r1, 3 - adds r3, r5, r1 - ldrh r1, [r3] - adds r1, r2 - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1] - cmp r0, r1 - bls _080AEB10 - strh r6, [r4] - ldrh r0, [r3] - adds r0, 0x1 - strh r0, [r3] - ands r0, r7 - cmp r0, 0x7 - bls _080AEAF8 - strh r6, [r3] -_080AEAF8: - ldr r0, =0x0000072a - adds r4, r5, r0 - ldrh r0, [r4] - bl sub_80AEB48 - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - ands r0, r7 - cmp r0, 0xC - bls _080AEB10 - strh r6, [r4] -_080AEB10: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AEAB8 - - thumb_func_start sub_80AEB2C -sub_80AEB2C: @ 80AEB2C - push {lr} - bl sub_80ADBB0 - lsls r0, 24 - cmp r0, 0 - beq _080AEB3C - movs r0, 0x1 - b _080AEB42 -_080AEB3C: - bl sub_80AEBD0 - movs r0, 0 -_080AEB42: - pop {r1} - bx r1 - thumb_func_end sub_80AEB2C - - thumb_func_start sub_80AEB48 -sub_80AEB48: @ 80AEB48 - push {r4,lr} - lsls r0, 16 - ldr r1, =gUnknown_0854FE00 - lsrs r0, 14 - adds r3, r0, r1 - adds r1, 0x2 - adds r0, r1 - ldr r1, =0x02021bbe - ldrh r2, [r0] - ldrh r0, [r1] - subs r2, r0 - ldr r0, =gUnknown_0854FE44 - movs r4, 0 - ldrsh r1, [r3, r4] - lsls r2, 16 - asrs r2, 16 - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - beq _080AEBB0 - ldr r0, =0x02020630 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1, 0x5] - adds r3, r1, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r3] - movs r0, 0 - strh r0, [r1, 0x2E] - strh r0, [r1, 0x30] - strh r0, [r1, 0x32] - ldr r0, =gUnknown_0854C14C - ldr r1, [r0] - ldr r0, =0x0000072c - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_080AEBB0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AEB48 - - thumb_func_start sub_80AEBD0 -sub_80AEBD0: @ 80AEBD0 - push {r4,r5,lr} - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r1, =0x0000072c - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _080AEC1A - movs r4, 0 - ldr r5, =0x02020630 -_080AEBE4: - lsls r0, r4, 4 - adds r0, r4 - lsls r2, r0, 2 - adds r0, r5, 0 - adds r0, 0x14 - adds r0, r2, r0 - ldr r1, [r0] - ldr r0, =gUnknown_0854FE44 - cmp r1, r0 - bne _080AEBFE - adds r0, r2, r5 - bl RemoveObjectAndFreeTiles -_080AEBFE: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x3F - bls _080AEBE4 - ldr r0, =0x00001205 - bl FreeObjectTilesByTag - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - ldr r1, =0x0000072c - adds r0, r1 - movs r1, 0 - strh r1, [r0] -_080AEC1A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AEBD0 - - thumb_func_start unc_0807DAB4 -unc_0807DAB4: @ 80AEC34 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x2E] - movs r2, 0 - adds r0, 0x2 - strh r0, [r1, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _080AEC74 - strh r2, [r1, 0x2E] - movs r3, 0x30 - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _080AEC66 - ldrh r0, [r1, 0x24] - adds r0, 0x1 - strh r0, [r1, 0x24] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _080AEC74 - movs r0, 0x1 - strh r0, [r1, 0x30] - b _080AEC74 -_080AEC66: - ldrh r0, [r1, 0x24] - subs r0, 0x1 - strh r0, [r1, 0x24] - lsls r0, 16 - cmp r0, 0 - bgt _080AEC74 - strh r2, [r1, 0x30] -_080AEC74: - ldrh r0, [r1, 0x22] - subs r0, 0x3 - strh r0, [r1, 0x22] - ldrh r0, [r1, 0x32] - adds r0, 0x1 - strh r0, [r1, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x77 - ble _080AEC8E - adds r0, r1, 0 - bl RemoveObjectAndFreeTiles -_080AEC8E: - pop {r0} - bx r0 - thumb_func_end unc_0807DAB4 - - thumb_func_start sub_80AEC94 -sub_80AEC94: @ 80AEC94 - ldr r2, =0x02038bc4 - strb r0, [r2] - ldr r0, =0x02038bc6 - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_80AEC94 - - thumb_func_start sub_80AECA8 -sub_80AECA8: @ 80AECA8 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r4, r1, r0 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080AECCC - cmp r0, 0x1 - beq _080AECF8 - b _080AED1C - .pool -_080AECCC: - ldrh r0, [r4, 0x1E] - subs r1, r0, 0x1 - strh r1, [r4, 0x1E] - lsls r0, 16 - cmp r0, 0 - bgt _080AED1C - ldrb r0, [r4, 0x2] - bl weather_set - ldr r1, =0x02038bc4 - ldrh r0, [r4, 0x2] - strb r0, [r1] - movs r1, 0x96 - lsls r1, 2 - adds r0, r1, 0 - strh r0, [r4, 0x1E] - ldrh r0, [r4] - adds r0, 0x1 - b _080AED1A - .pool -_080AECF8: - ldrh r0, [r4, 0x1E] - subs r1, r0, 0x1 - strh r1, [r4, 0x1E] - lsls r0, 16 - cmp r0, 0 - bgt _080AED1C - ldrb r0, [r4, 0x4] - bl weather_set - ldr r1, =0x02038bc4 - ldrh r0, [r4, 0x4] - strb r0, [r1] - movs r1, 0x96 - lsls r1, 2 - adds r0, r1, 0 - strh r0, [r4, 0x1E] - movs r0, 0 -_080AED1A: - strh r0, [r4] -_080AED1C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AECA8 - - thumb_func_start bag_add_task0_by_acit -bag_add_task0_by_acit: @ 80AED28 - push {lr} - ldr r0, =sub_80AECA8 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r1, r0 - movs r2, 0x96 - lsls r2, 2 - adds r0, r2, 0 - strh r0, [r1, 0x1E] - ldr r3, =0x02038bc4 - ldrb r2, [r3] - cmp r2, 0xD - bne _080AED60 - movs r0, 0xC - b _080AED66 - .pool -_080AED60: - cmp r2, 0xC - bne _080AED6C - movs r0, 0xD -_080AED66: - strh r0, [r1, 0x2] - strh r2, [r1, 0x4] - b _080AED78 -_080AED6C: - movs r0, 0xD - strb r0, [r3] - movs r0, 0xC - strh r0, [r1, 0x2] - movs r0, 0xD - strh r0, [r1, 0x4] -_080AED78: - pop {r0} - bx r0 - thumb_func_end bag_add_task0_by_acit - - thumb_func_start sub_80AED7C -sub_80AED7C: @ 80AED7C - push {r4,r5,lr} - ldr r4, =0x03005d8c - ldr r1, [r4] - adds r1, 0x2E - ldrb r5, [r1] - lsls r0, 24 - lsrs r0, 24 - bl sub_80AEEE8 - ldr r1, [r4] - adds r1, 0x2E - strb r0, [r1] - ldr r0, [r4] - adds r0, 0x2E - ldrb r0, [r0] - adds r1, r5, 0 - bl sub_80AEFDC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AED7C - - thumb_func_start sav1_get_weather_probably -sav1_get_weather_probably: @ 80AEDAC - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r0, 0x2E - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sav1_get_weather_probably - - thumb_func_start sub_80AEDBC -sub_80AEDBC: @ 80AEDBC - push {r4,r5,lr} - ldr r4, =0x03005d8c - ldr r0, [r4] - adds r0, 0x2E - ldrb r5, [r0] - ldr r0, =0x02037318 - ldrb r0, [r0, 0x16] - bl sub_80AEEE8 - ldr r1, [r4] - adds r1, 0x2E - strb r0, [r1] - ldr r0, [r4] - adds r0, 0x2E - ldrb r0, [r0] - adds r1, r5, 0 - bl sub_80AEFDC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AEDBC - - thumb_func_start sub_80AEDF0 -sub_80AEDF0: @ 80AEDF0 - push {lr} - bl sub_80AED7C - bl sav1_get_weather_probably - lsls r0, 24 - lsrs r0, 24 - bl weather_set - pop {r0} - bx r0 - thumb_func_end sub_80AEDF0 - - thumb_func_start sub_80AEE08 -sub_80AEE08: @ 80AEE08 - push {lr} - bl sub_80AED7C - bl sav1_get_weather_probably - lsls r0, 24 - lsrs r0, 24 - bl sub_80AB104 - pop {r0} - bx r0 - thumb_func_end sub_80AEE08 - - thumb_func_start sub_80AEE20 -sub_80AEE20: @ 80AEE20 - push {r4,r5,lr} - bl sav1_get_weather_probably - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bne _080AEE4C - ldr r0, =sub_80AECA8 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _080AEE3E - bl bag_add_task0_by_acit -_080AEE3E: - ldr r0, =0x02038bc4 - ldrb r4, [r0] - b _080AEE6E - .pool -_080AEE4C: - ldr r5, =sub_80AECA8 - adds r0, r5, 0 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - beq _080AEE68 - adds r0, r5, 0 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080AEE68: - ldr r1, =0x02038bc4 - movs r0, 0xD - strb r0, [r1] -_080AEE6E: - adds r0, r4, 0 - bl weather_set - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AEE20 - - thumb_func_start sub_80AEE84 -sub_80AEE84: @ 80AEE84 - push {r4,r5,lr} - bl sav1_get_weather_probably - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bne _080AEEB0 - ldr r0, =sub_80AECA8 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _080AEEA2 - bl bag_add_task0_by_acit -_080AEEA2: - ldr r0, =0x02038bc4 - ldrb r4, [r0] - b _080AEED2 - .pool -_080AEEB0: - ldr r5, =sub_80AECA8 - adds r0, r5, 0 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - beq _080AEECC - adds r0, r5, 0 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080AEECC: - ldr r1, =0x02038bc4 - movs r0, 0xD - strb r0, [r1] -_080AEED2: - adds r0, r4, 0 - bl sub_80AB104 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AEE84 - - thumb_func_start sub_80AEEE8 -sub_80AEEE8: @ 80AEEE8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x15 - bhi _080AEFB4 - lsls r0, 2 - ldr r1, =_080AEF00 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080AEF00: - .4byte _080AEFB4 - .4byte _080AEF58 - .4byte _080AEF5C - .4byte _080AEF60 - .4byte _080AEF64 - .4byte _080AEF68 - .4byte _080AEF6C - .4byte _080AEF70 - .4byte _080AEF74 - .4byte _080AEF78 - .4byte _080AEF7C - .4byte _080AEF80 - .4byte _080AEF84 - .4byte _080AEF88 - .4byte _080AEF8C - .4byte _080AEF90 - .4byte _080AEFB4 - .4byte _080AEFB4 - .4byte _080AEFB4 - .4byte _080AEFB4 - .4byte _080AEF94 - .4byte _080AEF9C -_080AEF58: - movs r0, 0x1 - b _080AEFB6 -_080AEF5C: - movs r0, 0x2 - b _080AEFB6 -_080AEF60: - movs r0, 0x3 - b _080AEFB6 -_080AEF64: - movs r0, 0x4 - b _080AEFB6 -_080AEF68: - movs r0, 0x5 - b _080AEFB6 -_080AEF6C: - movs r0, 0x6 - b _080AEFB6 -_080AEF70: - movs r0, 0x7 - b _080AEFB6 -_080AEF74: - movs r0, 0x8 - b _080AEFB6 -_080AEF78: - movs r0, 0x9 - b _080AEFB6 -_080AEF7C: - movs r0, 0xA - b _080AEFB6 -_080AEF80: - movs r0, 0xB - b _080AEFB6 -_080AEF84: - movs r0, 0xC - b _080AEFB6 -_080AEF88: - movs r0, 0xD - b _080AEFB6 -_080AEF8C: - movs r0, 0xE - b _080AEFB6 -_080AEF90: - movs r0, 0xF - b _080AEFB6 -_080AEF94: - ldr r1, =gUnknown_0854FE5C - b _080AEF9E - .pool -_080AEF9C: - ldr r1, =gUnknown_0854FE60 -_080AEF9E: - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r0, 0x2F - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - b _080AEFB6 - .pool -_080AEFB4: - movs r0, 0 -_080AEFB6: - pop {r1} - bx r1 - thumb_func_end sub_80AEEE8 - - thumb_func_start sub_80AEFBC -sub_80AEFBC: @ 80AEFBC - lsls r0, 16 - ldr r1, =0x03005d8c - ldr r2, [r1] - adds r2, 0x2F - lsrs r0, 16 - ldrb r1, [r2] - adds r0, r1 - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - lsrs r1, 16 - strb r1, [r2] - bx lr - .pool - thumb_func_end sub_80AEFBC - - thumb_func_start sub_80AEFDC -sub_80AEFDC: @ 80AEFDC - push {lr} - lsls r0, 24 - lsls r1, 24 - lsrs r2, r0, 24 - cmp r0, r1 - beq _080AEFF6 - cmp r2, 0x3 - beq _080AEFF0 - cmp r2, 0x5 - bne _080AEFF6 -_080AEFF0: - movs r0, 0x28 - bl sav12_xor_increment -_080AEFF6: - pop {r0} - bx r0 - thumb_func_end sub_80AEFDC - - thumb_func_start palette_bg_faded_fill_white -palette_bg_faded_fill_white: @ 80AEFFC - push {lr} - sub sp, 0x4 - ldr r0, =0x7fff7fff - str r0, [sp] - ldr r1, =0x02037b14 - ldr r2, =0x01000100 - mov r0, sp - bl CpuFastSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end palette_bg_faded_fill_white - - thumb_func_start palette_bg_faded_fill_black -palette_bg_faded_fill_black: @ 80AF020 - push {lr} - sub sp, 0x4 - movs r0, 0 - str r0, [sp] - ldr r1, =0x02037b14 - ldr r2, =0x01000100 - mov r0, sp - bl CpuFastSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end palette_bg_faded_fill_black - - thumb_func_start pal_fill_for_maplights -pal_fill_for_maplights: @ 80AF040 - push {r4,lr} - bl get_map_light_from_warp0 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sav1_map_get_light_level - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl fade_type_for_given_maplight_pair - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _080AF06A - cmp r0, 0x1 - beq _080AF078 - b _080AF084 -_080AF06A: - bl palette_bg_faded_fill_black - movs r0, 0 - movs r1, 0 - bl fade_screen - b _080AF084 -_080AF078: - bl palette_bg_faded_fill_white - movs r0, 0x2 - movs r1, 0 - bl fade_screen -_080AF084: - pop {r4} - pop {r0} - bx r0 - thumb_func_end pal_fill_for_maplights - - thumb_func_start sub_80AF08C -sub_80AF08C: @ 80AF08C - push {lr} - bl palette_bg_faded_fill_white - movs r0, 0x2 - movs r1, 0x8 - bl fade_screen - pop {r0} - bx r0 - thumb_func_end sub_80AF08C - - thumb_func_start pal_fill_black -pal_fill_black: @ 80AF0A0 - push {lr} - bl palette_bg_faded_fill_black - movs r0, 0 - movs r1, 0 - bl fade_screen - pop {r0} - bx r0 - thumb_func_end pal_fill_black - - thumb_func_start sub_80AF0B4 -sub_80AF0B4: @ 80AF0B4 - push {r4,lr} - bl sav1_map_get_light_level - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl warp1_get_mapheader - ldrb r1, [r0, 0x17] - adds r0, r4, 0 - bl sub_8137360 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _080AF0DA - cmp r0, 0x1 - beq _080AF0E4 - b _080AF0EC -_080AF0DA: - movs r0, 0x1 - movs r1, 0 - bl fade_screen - b _080AF0EC -_080AF0E4: - movs r0, 0x3 - movs r1, 0 - bl fade_screen -_080AF0EC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80AF0B4 - - thumb_func_start sub_80AF0F4 -sub_80AF0F4: @ 80AF0F4 - push {lr} - lsls r0, 24 - movs r1, 0 - cmp r0, 0 - bne _080AF100 - movs r1, 0x1 -_080AF100: - adds r0, r1, 0 - bl sub_808C0A8 - pop {r0} - bx r0 - thumb_func_end sub_80AF0F4 - - thumb_func_start task0A_nop_for_a_while -task0A_nop_for_a_while: @ 80AF10C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80AF71C - cmp r0, 0x1 - bne _080AF120 - adds r0, r4, 0 - bl DestroyTask -_080AF120: - pop {r4} - pop {r0} - bx r0 - thumb_func_end task0A_nop_for_a_while - - thumb_func_start sub_80AF128 -sub_80AF128: @ 80AF128 - push {lr} - bl script_env_2_enable - bl sub_8085784 - bl pal_fill_black - ldr r0, =task0A_nop_for_a_while - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF128 - - thumb_func_start task0A_asap_script_env_2_enable_and_set_ctx_running -task0A_asap_script_env_2_enable_and_set_ctx_running: @ 80AF148 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80AF71C - cmp r0, 0x1 - bne _080AF160 - adds r0, r4, 0 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running -_080AF160: - pop {r4} - pop {r0} - bx r0 - thumb_func_end task0A_asap_script_env_2_enable_and_set_ctx_running - - thumb_func_start sub_80AF168 -sub_80AF168: @ 80AF168 - push {lr} - bl script_env_2_enable - bl sub_8085784 - bl pal_fill_black - ldr r0, =task0A_asap_script_env_2_enable_and_set_ctx_running - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF168 - - thumb_func_start sub_80AF188 -sub_80AF188: @ 80AF188 - push {lr} - bl script_env_2_enable - bl pal_fill_black - ldr r0, =task0A_asap_script_env_2_enable_and_set_ctx_running - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF188 - - thumb_func_start task_mpl_807DD60 -task_mpl_807DD60: @ 80AF1A4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r2, =0x03005e00 - adds r4, r0, r2 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080AF1DE - cmp r0, 0x1 - bgt _080AF1CC - cmp r0, 0 - beq _080AF1D2 - b _080AF20E - .pool -_080AF1CC: - cmp r0, 0x2 - beq _080AF1FC - b _080AF20E -_080AF1D2: - bl sub_80B3050 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xA] - b _080AF1F4 -_080AF1DE: - movs r1, 0xA - ldrsh r0, [r4, r1] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrb r0, [r1, 0x4] - cmp r0, 0x1 - beq _080AF20E - bl pal_fill_for_maplights -_080AF1F4: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080AF20E -_080AF1FC: - bl sub_80AF71C - cmp r0, 0x1 - bne _080AF20E - bl script_env_2_disable - adds r0, r5, 0 - bl DestroyTask -_080AF20E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end task_mpl_807DD60 - - thumb_func_start sub_80AF214 -sub_80AF214: @ 80AF214 - push {lr} - bl script_env_2_enable - bl sub_8085784 - bl palette_bg_faded_fill_black - ldr r0, =task_mpl_807DD60 - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF214 - - thumb_func_start sub_80AF234 -sub_80AF234: @ 80AF234 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080AF268 - cmp r0, 0x1 - bgt _080AF25C - cmp r0, 0 - beq _080AF262 - b _080AF2AE - .pool -_080AF25C: - cmp r0, 0x2 - beq _080AF298 - b _080AF2AE -_080AF262: - bl sub_800ADF8 - b _080AF290 -_080AF268: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _080AF28C - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - movs r1, 0xE1 - lsls r1, 19 - cmp r0, r1 - ble _080AF2AE - movs r0, 0xC0 - lsls r0, 7 - bl sub_8011170 - b _080AF2AE -_080AF28C: - bl pal_fill_for_maplights -_080AF290: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080AF2AE -_080AF298: - bl sub_80AF71C - cmp r0, 0x1 - bne _080AF2AE - bl sub_8009F18 - bl script_env_2_disable - adds r0, r5, 0 - bl DestroyTask -_080AF2AE: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80AF234 - - thumb_func_start sub_80AF2B4 -sub_80AF2B4: @ 80AF2B4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080AF2E8 - cmp r0, 0x1 - bgt _080AF2DC - cmp r0, 0 - beq _080AF2E2 - b _080AF30C - .pool -_080AF2DC: - cmp r0, 0x2 - beq _080AF2FA - b _080AF30C -_080AF2E2: - bl sub_800ADF8 - b _080AF2F2 -_080AF2E8: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080AF30C -_080AF2F2: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080AF30C -_080AF2FA: - bl sub_8009F18 - bl sub_8086C2C - bl script_env_2_disable - adds r0, r5, 0 - bl DestroyTask -_080AF30C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80AF2B4 - - thumb_func_start sub_80AF314 -sub_80AF314: @ 80AF314 - push {lr} - bl script_env_2_enable - bl sub_8085784 - bl palette_bg_faded_fill_black - ldr r0, =sub_80AF234 - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF314 - - thumb_func_start sub_80AF334 -sub_80AF334: @ 80AF334 - push {r4,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_8088EFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080AF36C - ldr r1, =sub_80AF438 - b _080AF37E - .pool -_080AF36C: - adds r0, r4, 0 - bl sub_8088F58 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =task_map_chg_seq_0807E2CC - cmp r0, 0x1 - bne _080AF37E - ldr r1, =task_map_chg_seq_0807E20C -_080AF37E: - adds r0, r1, 0 - movs r1, 0xA - bl CreateTask - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF334 - - thumb_func_start mapldr_default -mapldr_default: @ 80AF398 - push {lr} - bl sub_8085784 - bl pal_fill_for_maplights - bl sub_80AF334 - bl script_env_2_enable - pop {r0} - bx r0 - thumb_func_end mapldr_default - - thumb_func_start sub_80AF3B0 -sub_80AF3B0: @ 80AF3B0 - push {lr} - bl sub_8085784 - bl sub_80AF08C - bl sub_80AF334 - bl script_env_2_enable - pop {r0} - bx r0 - thumb_func_end sub_80AF3B0 - - thumb_func_start sub_80AF3C8 -sub_80AF3C8: @ 80AF3C8 - push {lr} - bl sub_81D6534 - cmp r0, 0 - bne _080AF3D6 - bl sub_8085784 -_080AF3D6: - bl pal_fill_black - bl sub_80AF334 - bl script_env_2_enable - pop {r0} - bx r0 - thumb_func_end sub_80AF3C8 - - thumb_func_start sub_80AF3E8 -sub_80AF3E8: @ 80AF3E8 - push {lr} - bl sub_8085784 - bl pal_fill_for_maplights - movs r0, 0x2E - bl audio_play - ldr r0, =task0A_mpl_807E31C - movs r1, 0xA - bl CreateTask - bl script_env_2_enable - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF3E8 - - thumb_func_start sub_80AF40C -sub_80AF40C: @ 80AF40C - push {lr} - bl sub_8085784 - bl pal_fill_for_maplights - movs r0, 0x2E - bl audio_play - ldr r0, =task_map_chg_seq_0807E2CC - movs r1, 0xA - bl CreateTask - bl script_env_2_enable - movs r0, 0xE - bl sub_8085540 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF40C - - thumb_func_start sub_80AF438 -sub_80AF438: @ 80AF438 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r5, r0, r1 - adds r6, r5, 0 - adds r6, 0xC - adds r7, r5, 0 - adds r7, 0xE - movs r2, 0x8 - ldrsh r0, [r5, r2] - adds r2, r1, 0 - cmp r0, 0x4 - bhi _080AF54A - lsls r0, 2 - ldr r1, =_080AF46C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080AF46C: - .4byte _080AF480 - .4byte _080AF4A4 - .4byte _080AF4DC - .4byte _080AF520 - .4byte _080AF540 -_080AF480: - movs r0, 0 - bl sub_80AF0F4 - bl player_bitmagic - adds r0, r6, 0 - adds r1, r7, 0 - bl PlayerGetDestCoords - movs r1, 0 - ldrsh r0, [r6, r1] - movs r2, 0 - ldrsh r1, [r7, r2] - bl sub_808A854 - movs r0, 0x1 - strh r0, [r5, 0x8] - b _080AF54A -_080AF4A4: - bl sub_80AF71C - cmp r0, 0 - beq _080AF54A - movs r0, 0x1 - bl sub_80AF0F4 - 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, =0x02037350 - adds r0, r1 - movs r1, 0x8 - bl FieldObjectSetSpecialAnim - movs r0, 0x2 - strh r0, [r5, 0x8] - b _080AF54A - .pool -_080AF4DC: - bl walkrun_is_standing_still - lsls r0, 24 - cmp r0, 0 - beq _080AF54A - movs r1, 0 - ldrsh r0, [r6, r1] - movs r2, 0 - ldrsh r1, [r7, r2] - bl sub_808A8AC - lsls r0, 24 - asrs r0, 24 - strh r0, [r5, 0xA] - 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, =0x02037350 - adds r0, r1 - bl FieldObjectClearAnimIfSpecialAnimFinished - movs r0, 0x3 - strh r0, [r5, 0x8] - b _080AF54A - .pool -_080AF520: - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0 - blt _080AF536 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrb r0, [r1, 0x4] - cmp r0, 0x1 - beq _080AF54A -_080AF536: - bl sub_809757C - movs r0, 0x4 - strh r0, [r5, 0x8] - b _080AF54A -_080AF540: - bl script_env_2_disable - adds r0, r4, 0 - bl DestroyTask -_080AF54A: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80AF438 - - thumb_func_start task_map_chg_seq_0807E20C -task_map_chg_seq_0807E20C: @ 80AF550 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r5, r0, r1 - adds r6, r5, 0 - adds r6, 0xC - adds r7, r5, 0 - adds r7, 0xE - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _080AF5A2 - cmp r0, 0x1 - bgt _080AF580 - cmp r0, 0 - beq _080AF58A - b _080AF60A - .pool -_080AF580: - cmp r0, 0x2 - beq _080AF5EC - cmp r0, 0x3 - beq _080AF600 - b _080AF60A -_080AF58A: - movs r0, 0 - bl sub_80AF0F4 - bl player_bitmagic - adds r0, r6, 0 - adds r1, r7, 0 - bl PlayerGetDestCoords - movs r0, 0x1 - strh r0, [r5, 0x8] - b _080AF60A -_080AF5A2: - bl sub_80AF71C - cmp r0, 0 - beq _080AF60A - movs r0, 0x1 - bl sub_80AF0F4 - movs r0, 0xFF - movs r1, 0 - movs r2, 0 - bl GetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - bl GetGoSpeed0AnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - movs r0, 0x2 - strh r0, [r5, 0x8] - b _080AF60A - .pool -_080AF5EC: - bl walkrun_is_standing_still - lsls r0, 24 - cmp r0, 0 - beq _080AF60A - bl sub_809757C - movs r0, 0x3 - strh r0, [r5, 0x8] - b _080AF60A -_080AF600: - bl script_env_2_disable - adds r0, r4, 0 - bl DestroyTask -_080AF60A: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end task_map_chg_seq_0807E20C - - thumb_func_start task_map_chg_seq_0807E2CC -task_map_chg_seq_0807E2CC: @ 80AF610 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080AF634 - cmp r0, 0x1 - beq _080AF644 - b _080AF65A - .pool -_080AF634: - bl player_bitmagic - bl script_env_2_enable - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080AF65A -_080AF644: - bl sub_80AF71C - cmp r0, 0 - beq _080AF65A - bl sub_809757C - bl script_env_2_disable - adds r0, r5, 0 - bl DestroyTask -_080AF65A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end task_map_chg_seq_0807E2CC - - thumb_func_start sub_80AF660 -sub_80AF660: @ 80AF660 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80AF71C - cmp r0, 0x1 - bne _080AF67C - adds r0, r4, 0 - bl DestroyTask - ldr r0, =sub_809FA34 - movs r1, 0x50 - bl CreateTask -_080AF67C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF660 - - thumb_func_start sub_80AF688 -sub_80AF688: @ 80AF688 - push {lr} - bl pal_fill_black - ldr r0, =sub_80AF660 - movs r1, 0x50 - bl CreateTask - bl script_env_2_enable - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF688 - - thumb_func_start sub_80AF6A4 -sub_80AF6A4: @ 80AF6A4 - push {lr} - bl sub_809FA18 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_80AF6A4 - - thumb_func_start task_mpl_807E3C8 -task_mpl_807E3C8: @ 80AF6B0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80AF71C - cmp r0, 0x1 - bne _080AF6CC - bl script_env_2_disable - adds r0, r4, 0 - bl DestroyTask - bl sub_80984F4 -_080AF6CC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end task_mpl_807E3C8 - - thumb_func_start sub_80AF6D4 -sub_80AF6D4: @ 80AF6D4 - push {lr} - bl script_env_2_enable - bl pal_fill_black - ldr r0, =task_mpl_807E3C8 - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF6D4 - - thumb_func_start sub_80AF6F0 -sub_80AF6F0: @ 80AF6F0 - push {lr} - bl script_env_2_enable - bl sub_8085784 - bl pal_fill_black - ldr r0, =task_mpl_807E3C8 - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF6F0 - - thumb_func_start sub_80AF710 -sub_80AF710: @ 80AF710 - ldr r0, =0x02037fd4 - ldrb r0, [r0, 0x7] - lsrs r0, 7 - bx lr - .pool - thumb_func_end sub_80AF710 - - thumb_func_start sub_80AF71C -sub_80AF71C: @ 80AF71C - push {lr} - bl sub_80ABDFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080AF72E - movs r0, 0 - b _080AF730 -_080AF72E: - movs r0, 0x1 -_080AF730: - pop {r1} - bx r1 - thumb_func_end sub_80AF71C - - thumb_func_start sub_80AF734 -sub_80AF734: @ 80AF734 - push {lr} - bl script_env_2_enable - bl music_something - bl sub_80AF0B4 - bl play_some_sound - movs r0, 0x9 - bl audio_play - ldr r0, =0x03005dac - ldr r1, =mapldr_default - str r1, [r0] - ldr r0, =sub_80AFA0C - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF734 - - thumb_func_start sp13E_warp_to_last_warp -sp13E_warp_to_last_warp: @ 80AF76C - push {lr} - bl script_env_2_enable - bl music_something - bl sub_80AF0B4 - bl play_some_sound - ldr r0, =0x03005dac - ldr r1, =mapldr_default - str r1, [r0] - ldr r0, =sub_80AFA0C - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sp13E_warp_to_last_warp - - thumb_func_start sub_80AF79C -sub_80AF79C: @ 80AF79C - push {lr} - bl script_env_2_enable - bl music_something - movs r0, 0x3 - movs r1, 0x8 - bl fade_screen - bl play_some_sound - ldr r0, =0x03005dac - ldr r1, =sub_80AF3B0 - str r1, [r0] - ldr r0, =sub_80AFA0C - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF79C - - thumb_func_start sub_80AF7D0 -sub_80AF7D0: @ 80AF7D0 - push {lr} - bl script_env_2_enable - ldr r0, =0x03005dac - ldr r1, =mapldr_default - str r1, [r0] - ldr r0, =sub_80AFA88 - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF7D0 - - thumb_func_start sp13F_fall_to_last_warp -sp13F_fall_to_last_warp: @ 80AF7F4 - push {lr} - bl sp13E_warp_to_last_warp - ldr r1, =0x03005dac - ldr r0, =sub_80B6B68 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sp13F_fall_to_last_warp - - thumb_func_start sub_80AF80C -sub_80AF80C: @ 80AF80C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl script_env_2_enable - adds r0, r4, 0 - movs r1, 0xA - bl sub_80B6E4C - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80AF80C - - thumb_func_start sub_80AF828 -sub_80AF828: @ 80AF828 - push {lr} - bl script_env_2_enable - movs r0, 0xA - bl sub_80B75D8 - pop {r0} - bx r0 - thumb_func_end sub_80AF828 - - thumb_func_start sub_80AF838 -sub_80AF838: @ 80AF838 - push {lr} - bl script_env_2_enable - movs r0, 0xA - bl sub_80B7A74 - pop {r0} - bx r0 - thumb_func_end sub_80AF838 - - thumb_func_start sub_80AF848 -sub_80AF848: @ 80AF848 - push {lr} - bl script_env_2_enable - bl music_something - bl sub_80AF0B4 - movs r0, 0x2D - bl audio_play - ldr r0, =sub_80AFA0C - movs r1, 0xA - bl CreateTask - ldr r1, =0x03005dac - ldr r0, =sub_80AF3E8 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF848 - - thumb_func_start sub_80AF87C -sub_80AF87C: @ 80AF87C - push {lr} - movs r0, 0x1 - bl sub_8085540 - bl script_env_2_enable - bl save_serialize_npcs - bl music_something - bl sub_80AF0B4 - movs r0, 0x2D - bl audio_play - ldr r0, =sub_80AFA0C - movs r1, 0xA - bl CreateTask - ldr r1, =0x03005dac - ldr r0, =sub_80AF40C - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF87C - - thumb_func_start sub_80AF8B8 -sub_80AF8B8: @ 80AF8B8 - push {lr} - bl script_env_2_enable - bl sub_80AF0B4 - ldr r0, =sub_80AFA0C - movs r1, 0xA - bl CreateTask - ldr r1, =0x03005dac - ldr r0, =sub_80FB768 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF8B8 - - thumb_func_start sub_80AF8E0 -sub_80AF8E0: @ 80AF8E0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080AF914 - cmp r0, 0x1 - bgt _080AF908 - cmp r0, 0 - beq _080AF90E - b _080AF93E - .pool -_080AF908: - cmp r0, 0x2 - beq _080AF92E - b _080AF93E -_080AF90E: - bl script_env_2_enable - b _080AF926 -_080AF914: - bl sub_80AF710 - cmp r0, 0 - bne _080AF93E - bl sub_80859A0 - lsls r0, 24 - cmp r0, 0 - beq _080AF93E -_080AF926: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080AF93E -_080AF92E: - bl warp_in - ldr r0, =sub_8086074 - bl SetMainCallback2 - adds r0, r5, 0 - bl DestroyTask -_080AF93E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF8E0 - - thumb_func_start sub_80AF948 -sub_80AF948: @ 80AF948 - push {lr} - bl script_env_2_enable - bl music_something - bl sub_80AF0B4 - movs r0, 0x9 - bl audio_play - ldr r0, =sub_80AF8E0 - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF948 - - thumb_func_start sub_80AF96C -sub_80AF96C: @ 80AF96C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080AF9B2 - cmp r0, 0x1 - bgt _080AF994 - cmp r0, 0 - beq _080AF99A - b _080AF9E8 - .pool -_080AF994: - cmp r0, 0x2 - beq _080AF9D0 - b _080AF9E8 -_080AF99A: - bl sub_8009FAC - movs r0, 0x1 - movs r1, 0 - bl fade_screen - bl music_something - movs r0, 0x9 - bl audio_play - b _080AF9C8 -_080AF9B2: - bl sub_80AF710 - cmp r0, 0 - bne _080AF9E8 - bl sub_80859A0 - lsls r0, 24 - cmp r0, 0 - beq _080AF9E8 - bl sub_800AC34 -_080AF9C8: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _080AF9E8 -_080AF9D0: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _080AF9E8 - bl warp_in - ldr r0, =c2_load_new_map - bl SetMainCallback2 - adds r0, r5, 0 - bl DestroyTask -_080AF9E8: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF96C - - thumb_func_start sub_80AF9F8 -sub_80AF9F8: @ 80AF9F8 - push {lr} - ldr r0, =sub_80AF96C - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AF9F8 - - thumb_func_start sub_80AFA0C -sub_80AFA0C: @ 80AFA0C - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r5, [r4, r0] - cmp r5, 0x1 - beq _080AFA44 - cmp r5, 0x1 - bgt _080AFA34 - cmp r5, 0 - beq _080AFA3A - b _080AFA7C - .pool -_080AFA34: - cmp r5, 0x2 - beq _080AFA6C - b _080AFA7C -_080AFA3A: - bl player_bitmagic - bl script_env_2_enable - b _080AFA64 -_080AFA44: - bl sub_80AF710 - cmp r0, 0 - bne _080AFA7C - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080AFA5A - bl sub_81BE72C - strh r5, [r4, 0xA] -_080AFA5A: - bl sub_80859A0 - lsls r0, 24 - cmp r0, 0 - beq _080AFA7C -_080AFA64: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080AFA7C -_080AFA6C: - bl warp_in - ldr r0, =c2_load_new_map - bl SetMainCallback2 - adds r0, r6, 0 - bl DestroyTask -_080AFA7C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AFA0C - - thumb_func_start sub_80AFA88 -sub_80AFA88: @ 80AFA88 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r5, r1, r0 - adds r4, r5, 0 - adds r4, 0xC - adds r6, r5, 0 - adds r6, 0xE - movs r2, 0x8 - ldrsh r1, [r5, r2] - adds r2, r0, 0 - cmp r1, 0x4 - bls _080AFAAC - b _080AFBE8 -_080AFAAC: - lsls r0, r1, 2 - ldr r1, =_080AFAC0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080AFAC0: - .4byte _080AFAD4 - .4byte _080AFB10 - .4byte _080AFB6C - .4byte _080AFBB8 - .4byte _080AFBD4 -_080AFAD4: - bl player_bitmagic - adds r0, r4, 0 - adds r1, r6, 0 - bl PlayerGetDestCoords - movs r1, 0 - ldrsh r0, [r4, r1] - movs r2, 0 - ldrsh r1, [r6, r2] - subs r1, 0x1 - bl cur_mapdata_get_door_sound_at - lsls r0, 16 - lsrs r0, 16 - bl audio_play - movs r1, 0 - ldrsh r0, [r4, r1] - movs r2, 0 - ldrsh r1, [r6, r2] - subs r1, 0x1 - bl task_overworld_door_add_if_role_69_for_opening_door_at - lsls r0, 24 - asrs r0, 24 - strh r0, [r5, 0xA] - movs r0, 0x1 - strh r0, [r5, 0x8] - b _080AFBE8 -_080AFB10: - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0 - blt _080AFB26 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrb r0, [r1, 0x4] - cmp r0, 0x1 - beq _080AFBE8 -_080AFB26: - 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 r4, =0x02037350 - adds r0, r4 - bl FieldObjectClearAnimIfSpecialAnimActive - 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 - adds r0, r4 - movs r1, 0x9 - bl FieldObjectSetSpecialAnim - movs r0, 0x2 - strh r0, [r5, 0x8] - b _080AFBE8 - .pool -_080AFB6C: - bl walkrun_is_standing_still - lsls r0, 24 - cmp r0, 0 - beq _080AFBE8 - movs r2, 0 - ldrsh r0, [r4, r2] - movs r2, 0 - ldrsh r1, [r6, r2] - subs r1, 0x1 - bl sub_808A8AC - lsls r0, 24 - asrs r0, 24 - strh r0, [r5, 0xA] - 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, =0x02037350 - adds r0, r1 - bl FieldObjectClearAnimIfSpecialAnimFinished - movs r0, 0 - bl sub_80AF0F4 - movs r0, 0x3 - strh r0, [r5, 0x8] - b _080AFBE8 - .pool -_080AFBB8: - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0 - blt _080AFBCE - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrb r0, [r1, 0x4] - cmp r0, 0x1 - beq _080AFBE8 -_080AFBCE: - movs r0, 0x4 - strh r0, [r5, 0x8] - b _080AFBE8 -_080AFBD4: - bl music_something - bl sub_80AF0B4 - bl play_some_sound - movs r0, 0 - strh r0, [r5, 0x8] - ldr r0, =sub_80AFA0C - str r0, [r5] -_080AFBE8: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AFA88 - - thumb_func_start task0A_fade_n_map_maybe -task0A_fade_n_map_maybe: @ 80AFBF4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080AFC2C - cmp r0, 0x1 - bgt _080AFC1C - cmp r0, 0 - beq _080AFC22 - b _080AFC56 - .pool -_080AFC1C: - cmp r0, 0x2 - beq _080AFC46 - b _080AFC56 -_080AFC22: - bl player_bitmagic - bl script_env_2_enable - b _080AFC3E -_080AFC2C: - bl sub_80AF710 - cmp r0, 0 - bne _080AFC56 - bl sub_80859A0 - lsls r0, 24 - cmp r0, 0 - beq _080AFC56 -_080AFC3E: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080AFC56 -_080AFC46: - bl warp_in - ldr r0, =sub_8086024 - bl SetMainCallback2 - adds r0, r5, 0 - bl DestroyTask -_080AFC56: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task0A_fade_n_map_maybe - - thumb_func_start sub_80AFC60 -sub_80AFC60: @ 80AFC60 - push {lr} - bl script_env_2_enable - bl music_something - bl sub_80AF0B4 - bl play_some_sound - movs r0, 0x9 - bl audio_play - ldr r0, =0x03005dac - ldr r1, =sub_80AF3C8 - str r1, [r0] - ldr r0, =task0A_fade_n_map_maybe - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AFC60 - - thumb_func_start sub_80AFC98 -sub_80AFC98: @ 80AFC98 - push {lr} - cmp r1, 0xA0 - bhi _080AFCC0 - cmp r2, 0 - bge _080AFCA4 - movs r2, 0 -_080AFCA4: - cmp r2, 0xFF - ble _080AFCAA - movs r2, 0xFF -_080AFCAA: - cmp r3, 0 - bge _080AFCB0 - movs r3, 0 -_080AFCB0: - cmp r3, 0xFF - ble _080AFCB6 - movs r3, 0xFF -_080AFCB6: - lsls r1, 1 - adds r1, r0 - lsls r0, r2, 8 - orrs r0, r3 - strh r0, [r1] -_080AFCC0: - pop {r0} - bx r0 - thumb_func_end sub_80AFC98 - - thumb_func_start sub_80AFCC4 -sub_80AFCC4: @ 80AFCC4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - str r0, [sp] - mov r10, r1 - mov r9, r2 - adds r6, r3, 0 - mov r8, r6 - movs r7, 0 - cmp r6, 0 - blt _080AFD40 -_080AFCE0: - mov r0, r9 - subs r1, r0, r7 - mov r0, r10 - subs r4, r0, r6 - adds r5, r0, r6 - ldr r0, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_80AFC98 - mov r0, r9 - adds r1, r0, r7 - ldr r0, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_80AFC98 - mov r0, r9 - subs r1, r0, r6 - mov r0, r10 - subs r4, r0, r7 - adds r5, r0, r7 - ldr r0, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_80AFC98 - mov r0, r9 - adds r1, r0, r6 - ldr r0, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_80AFC98 - mov r1, r8 - adds r1, 0x1 - lsls r0, r7, 1 - subs r1, r0 - mov r8, r1 - adds r7, 0x1 - cmp r1, 0 - bge _080AFD3C - subs r1, r6, 0x1 - lsls r0, r1, 1 - add r8, r0 - adds r6, r1, 0 -_080AFD3C: - cmp r6, r7 - bge _080AFCE0 -_080AFD40: - 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_80AFCC4 - - thumb_func_start sub_80AFD50 -sub_80AFD50: @ 80AFD50 - push {lr} - cmp r1, 0xA0 - bhi _080AFD78 - cmp r2, 0 - bge _080AFD5C - movs r2, 0 -_080AFD5C: - cmp r2, 0xF0 - ble _080AFD62 - movs r2, 0xF0 -_080AFD62: - cmp r3, 0 - bge _080AFD68 - movs r3, 0 -_080AFD68: - cmp r3, 0xF0 - ble _080AFD6E - movs r3, 0xF0 -_080AFD6E: - lsls r1, 1 - adds r1, r0 - lsls r0, r2, 8 - orrs r0, r3 - strh r0, [r1] -_080AFD78: - pop {r0} - bx r0 - thumb_func_end sub_80AFD50 - - thumb_func_start sub_80AFD7C -sub_80AFD7C: @ 80AFD7C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - str r0, [sp] - mov r10, r1 - mov r9, r2 - adds r6, r3, 0 - mov r8, r6 - movs r7, 0 - cmp r6, 0 - blt _080AFDF8 -_080AFD98: - mov r0, r9 - subs r1, r0, r7 - mov r0, r10 - subs r4, r0, r6 - adds r5, r0, r6 - ldr r0, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_80AFD50 - mov r0, r9 - adds r1, r0, r7 - ldr r0, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_80AFD50 - mov r0, r9 - subs r1, r0, r6 - mov r0, r10 - subs r4, r0, r7 - adds r5, r0, r7 - ldr r0, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_80AFD50 - mov r0, r9 - adds r1, r0, r6 - ldr r0, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_80AFD50 - mov r1, r8 - adds r1, 0x1 - lsls r0, r7, 1 - subs r1, r0 - mov r8, r1 - adds r7, 0x1 - cmp r1, 0 - bge _080AFDF4 - subs r1, r6, 0x1 - lsls r0, r1, 1 - add r8, r0 - adds r6, r1, 0 -_080AFDF4: - cmp r6, r7 - bge _080AFD98 -_080AFDF8: - 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_80AFD7C - - thumb_func_start sub_80AFE08 -sub_80AFE08: @ 80AFE08 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080AFE64 - cmp r0, 0x1 - bgt _080AFE30 - cmp r0, 0 - beq _080AFE36 - b _080AFEC6 - .pool -_080AFE30: - cmp r0, 0x2 - beq _080AFEBC - b _080AFEC6 -_080AFE36: - ldr r0, =0x02039b28 - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - ldr r1, =0x02038c28 - adds r0, r1 - movs r2, 0x2 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - movs r5, 0x6 - ldrsh r3, [r4, r5] - bl sub_80AFCC4 - movs r0, 0x1 - strh r0, [r4] - b _080AFEC6 - .pool -_080AFE64: - ldr r0, =0x02039b28 - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - ldr r1, =0x02038c28 - adds r0, r1 - movs r6, 0x2 - ldrsh r1, [r4, r6] - movs r3, 0x4 - ldrsh r2, [r4, r3] - movs r6, 0x6 - ldrsh r3, [r4, r6] - bl sub_80AFCC4 - movs r0, 0 - strh r0, [r4] - ldrh r0, [r4, 0xA] - ldrh r1, [r4, 0x6] - adds r0, r1 - strh r0, [r4, 0x6] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x8 - ldrsh r1, [r4, r2] - cmp r0, r1 - ble _080AFEC6 - movs r3, 0xC - ldrsh r0, [r4, r3] - cmp r0, 0x1 - bne _080AFEB4 - bl remove_some_task - movs r0, 0x2 - strh r0, [r4] - b _080AFEC6 - .pool -_080AFEB4: - adds r0, r5, 0 - bl DestroyTask - b _080AFEC6 -_080AFEBC: - bl dp12_8087EA4 - adds r0, r5, 0 - bl DestroyTask -_080AFEC6: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80AFE08 - - thumb_func_start sub_80AFECC -sub_80AFECC: @ 80AFECC - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080AFF28 - cmp r0, 0x1 - bgt _080AFEF4 - cmp r0, 0 - beq _080AFEFA - b _080AFF8A - .pool -_080AFEF4: - cmp r0, 0x2 - beq _080AFF80 - b _080AFF8A -_080AFEFA: - ldr r0, =0x02039b28 - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - ldr r1, =0x02038c28 - adds r0, r1 - movs r2, 0x2 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - movs r5, 0x6 - ldrsh r3, [r4, r5] - bl sub_80AFD7C - movs r0, 0x1 - strh r0, [r4] - b _080AFF8A - .pool -_080AFF28: - ldr r0, =0x02039b28 - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - ldr r1, =0x02038c28 - adds r0, r1 - movs r6, 0x2 - ldrsh r1, [r4, r6] - movs r3, 0x4 - ldrsh r2, [r4, r3] - movs r6, 0x6 - ldrsh r3, [r4, r6] - bl sub_80AFD7C - movs r0, 0 - strh r0, [r4] - ldrh r0, [r4, 0xA] - ldrh r1, [r4, 0x6] - adds r0, r1 - strh r0, [r4, 0x6] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x8 - ldrsh r1, [r4, r2] - cmp r0, r1 - ble _080AFF8A - movs r3, 0xC - ldrsh r0, [r4, r3] - cmp r0, 0x1 - bne _080AFF78 - bl remove_some_task - movs r0, 0x2 - strh r0, [r4] - b _080AFF8A - .pool -_080AFF78: - adds r0, r5, 0 - bl DestroyTask - b _080AFF8A -_080AFF80: - bl dp12_8087EA4 - adds r0, r5, 0 - bl DestroyTask -_080AFF8A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80AFECC - - thumb_func_start sub_80AFF90 -sub_80AFF90: @ 80AFF90 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =sub_80AFE08 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _080AFFAC - bl script_env_2_enable_and_set_ctx_running - adds r0, r4, 0 - bl DestroyTask -_080AFFAC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AFF90 - - thumb_func_start sub_80AFFB8 -sub_80AFFB8: @ 80AFFB8 - push {r4,lr} - ldr r4, =sub_80AFF90 - adds r0, r4, 0 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _080AFFD0 - adds r0, r4, 0 - movs r1, 0x50 - bl CreateTask -_080AFFD0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80AFFB8 - - thumb_func_start sub_80AFFDC -sub_80AFFDC: @ 80AFFDC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r8, r0 - mov r9, r1 - adds r5, r2, 0 - adds r4, r3, 0 - ldr r6, [sp, 0x1C] - ldr r0, [sp, 0x20] - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =sub_80AFE08 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r1, r0, r1 - strh r5, [r1, 0x6] - strh r4, [r1, 0x8] - mov r0, r8 - strh r0, [r1, 0x2] - mov r0, r9 - strh r0, [r1, 0x4] - strh r6, [r1, 0xC] - cmp r5, r4 - bge _080B0028 - strh r7, [r1, 0xA] - b _080B002C - .pool -_080B0028: - negs r0, r7 - strh r0, [r1, 0xA] -_080B002C: - adds r0, r2, 0 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80AFFDC - - thumb_func_start sub_80B003C -sub_80B003C: @ 80B003C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r8, r0 - mov r9, r1 - adds r5, r2, 0 - adds r4, r3, 0 - ldr r6, [sp, 0x1C] - ldr r0, [sp, 0x20] - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =sub_80AFECC - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r1, r0, r1 - strh r5, [r1, 0x6] - strh r4, [r1, 0x8] - mov r0, r8 - strh r0, [r1, 0x2] - mov r0, r9 - strh r0, [r1, 0x4] - strh r6, [r1, 0xC] - cmp r5, r4 - bge _080B0088 - strh r7, [r1, 0xA] - b _080B008C - .pool -_080B0088: - negs r0, r7 - strh r0, [r1, 0xA] -_080B008C: - adds r0, r2, 0 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80B003C - - thumb_func_start sub_80B009C -sub_80B009C: @ 80B009C - push {r4,r5,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - bl sav1_get_flash_used_on_map - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - cmp r4, 0 - bne _080B00B6 - movs r5, 0x1 -_080B00B6: - ldr r1, =gUnknown_0854FE64 - lsls r0, 1 - adds r0, r1 - ldrh r2, [r0] - lsls r0, r4, 1 - adds r0, r1 - ldrh r3, [r0] - str r5, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x78 - movs r1, 0x50 - bl sub_80AFFDC - bl sub_80AFFB8 - bl script_env_2_enable - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B009C - - thumb_func_start sub_80B00E8 -sub_80B00E8: @ 80B00E8 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _080B0116 - ldr r4, =0x02038c28 - ldr r1, =gUnknown_0854FE64 - lsls r0, 1 - adds r0, r1 - ldrh r3, [r0] - adds r0, r4, 0 - movs r1, 0x78 - movs r2, 0x50 - bl sub_80AFCC4 - movs r0, 0xF0 - lsls r0, 3 - adds r1, r4, r0 - movs r2, 0xF0 - lsls r2, 1 - adds r0, r4, 0 - bl CpuFastSet -_080B0116: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B00E8 - - thumb_func_start door_upload_tiles -door_upload_tiles: @ 80B0124 - push {r4,lr} - ldr r4, =0x02038c28 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000e68 - adds r0, r1 - ldrb r3, [r0] - adds r0, r4, 0 - movs r1, 0x78 - movs r2, 0x50 - bl sub_80AFCC4 - movs r0, 0xF0 - lsls r0, 3 - adds r1, r4, r0 - movs r2, 0xF0 - lsls r2, 1 - adds r0, r4, 0 - bl CpuFastSet - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end door_upload_tiles - - thumb_func_start task0A_mpl_807E31C -task0A_mpl_807E31C: @ 80B0160 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080B0184 - cmp r0, 0x1 - beq _080B0198 - b _080B01B6 - .pool -_080B0184: - bl player_bitmagic - bl script_env_2_enable - bl sub_808D194 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080B01B6 -_080B0198: - bl sub_80AF71C - cmp r0, 0 - beq _080B01B6 - bl sub_808D1B4 - cmp r0, 0x1 - beq _080B01B6 - bl sub_809757C - bl script_env_2_disable - adds r0, r5, 0 - bl DestroyTask -_080B01B6: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end task0A_mpl_807E31C - - thumb_func_start sub_80B01BC -sub_80B01BC: @ 80B01BC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080B0202 - cmp r0, 0x1 - bgt _080B01E4 - cmp r0, 0 - beq _080B01EE - b _080B023A - .pool -_080B01E4: - cmp r0, 0x2 - beq _080B0210 - cmp r0, 0x3 - beq _080B022A - b _080B023A -_080B01EE: - bl player_bitmagic - bl script_env_2_enable - movs r0, 0x2D - bl audio_play - bl sub_808D1C8 - b _080B0222 -_080B0202: - bl sub_808D1E8 - cmp r0, 0 - bne _080B023A - bl sub_80AF0B4 - b _080B0222 -_080B0210: - bl sub_80AF710 - cmp r0, 0 - bne _080B023A - bl sub_80859A0 - lsls r0, 24 - cmp r0, 0 - beq _080B023A -_080B0222: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080B023A -_080B022A: - bl warp_in - ldr r0, =c2_load_new_map - bl SetMainCallback2 - adds r0, r5, 0 - bl DestroyTask -_080B023A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B01BC - - thumb_func_start sub_80B0244 -sub_80B0244: @ 80B0244 - push {lr} - bl script_env_2_enable - ldr r0, =sub_80AFA0C - movs r1, 0xA - bl CreateTask - ldr r1, =0x03005dac - ldr r0, =sub_80AF3E8 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B0244 - - thumb_func_start sub_80B0268 -sub_80B0268: @ 80B0268 - push {lr} - bl script_env_2_enable - ldr r0, =0x03005dac - ldr r1, =mapldr_default - str r1, [r0] - ldr r0, =sub_80B01BC - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B0268 - - thumb_func_start sub_80B028C -sub_80B028C: @ 80B028C - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - cmp r0, 0 - bne _080B029A - movs r1, 0x1F - b _080B02A0 -_080B029A: - movs r0, 0xF8 - lsls r0, 7 - adds r1, r0, 0 -_080B02A0: - mov r0, sp - strh r1, [r0] - movs r5, 0 - movs r4, 0xF0 - lsls r4, 16 -_080B02AA: - lsrs r1, r4, 16 - mov r0, sp - movs r2, 0x2 - bl gpu_pal_apply - movs r0, 0x80 - lsls r0, 9 - adds r4, r0 - adds r5, 0x1 - cmp r5, 0xF - ble _080B02AA - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80B028C - - thumb_func_start sub_80B02C8 -sub_80B02C8: @ 80B02C8 - push {r4,r5,lr} - lsls r0, 16 - ldr r2, =0x04000052 - ldrh r1, [r2] - lsls r1, 24 - lsrs r5, r1, 24 - ldrh r1, [r2] - lsrs r4, r1, 8 - cmp r0, 0 - beq _080B02EC - cmp r5, 0 - beq _080B02F6 - subs r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - b _080B02F6 - .pool -_080B02EC: - cmp r4, 0xF - bhi _080B02F6 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_080B02F6: - lsls r1, r4, 8 - orrs r1, r5 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - cmp r5, 0 - bne _080B0310 - cmp r4, 0x10 - bne _080B0310 - movs r0, 0x1 - b _080B0312 -_080B0310: - movs r0, 0 -_080B0312: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80B02C8 - - thumb_func_start sub_80B0318 -sub_80B0318: @ 80B0318 - push {r4,r5,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0x7 - bls _080B0334 - b _080B052C -_080B0334: - lsls r0, 2 - ldr r1, =_080B0348 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080B0348: - .4byte _080B0368 - .4byte _080B0424 - .4byte _080B0450 - .4byte _080B046C - .4byte _080B0482 - .4byte _080B04F2 - .4byte _080B04AC - .4byte _080B04BA -_080B0368: - movs r0, 0x80 - lsls r0, 19 - ldrh r0, [r0] - strh r0, [r5, 0xC] - ldr r0, =0x04000050 - ldrh r0, [r0] - strh r0, [r5, 0xE] - ldr r0, =0x04000052 - ldrh r0, [r0] - strh r0, [r5, 0x10] - ldr r0, =0x04000048 - ldrh r0, [r0] - strh r0, [r5, 0x12] - ldr r0, =0x0400004a - ldrh r0, [r0] - strh r0, [r5, 0x14] - movs r1, 0x80 - lsls r1, 7 - movs r0, 0 - bl ClearGpuRegBits - ldr r0, =gUnknown_82EC7CC - ldrh r1, [r0] - movs r0, 0x50 - bl SetGpuRegBits - ldr r1, =0x0000070c - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x1E - bl SetGpuReg - movs r0, 0x14 - str r0, [sp] - movs r0, 0xF - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x1E - bl sub_8199C30 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r4, =0x02038c28 - movs r2, 0x4 - ldrsh r1, [r5, r2] - movs r0, 0x6 - ldrsh r2, [r5, r0] - adds r0, r4, 0 - movs r3, 0x1 - bl sub_80AFD7C - movs r2, 0xF0 - lsls r2, 3 - adds r1, r4, r2 - movs r2, 0xF0 - lsls r2, 1 - adds r0, r4, 0 - bl CpuFastSet - ldr r2, =gUnknown_0854FE7C - ldr r0, [r2] - ldr r1, [r2, 0x4] - ldr r2, [r2, 0x8] - bl sub_80BA038 - movs r0, 0x1 - strh r0, [r5] - b _080B052C - .pool -_080B0424: - movs r0, 0 - movs r1, 0x11 - movs r2, 0 - movs r3, 0x1 - bl sub_8199DF0 - ldrb r0, [r5, 0x2] - bl sub_80B028C - movs r1, 0x4 - ldrsh r0, [r5, r1] - movs r2, 0x6 - ldrsh r1, [r5, r2] - movs r2, 0x1 - str r2, [sp] - movs r4, 0x2 - str r4, [sp, 0x4] - movs r3, 0xA0 - bl sub_80B003C - strh r4, [r5] - b _080B052C -_080B0450: - ldr r0, =sub_80AFECC - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _080B052C - bl script_env_2_enable_and_set_ctx_running - movs r0, 0x3 - strh r0, [r5] - b _080B052C - .pool -_080B046C: - bl InstallCameraPanAheadCallback - movs r0, 0 - bl SetCameraPanningCallback - movs r0, 0 - strh r0, [r5, 0xA] - movs r0, 0x4 - strh r0, [r5, 0x8] - strh r0, [r5] - b _080B052C -_080B0482: - ldrh r0, [r5, 0x8] - subs r0, 0x1 - strh r0, [r5, 0x8] - lsls r0, 16 - cmp r0, 0 - bne _080B052C - movs r0, 0x4 - strh r0, [r5, 0x8] - ldrh r0, [r5, 0xA] - movs r1, 0x1 - eors r0, r1 - strh r0, [r5, 0xA] - movs r1, 0x4 - negs r1, r1 - cmp r0, 0 - beq _080B04A4 - movs r1, 0x4 -_080B04A4: - movs r0, 0 - bl SetCameraPanning - b _080B052C -_080B04AC: - bl InstallCameraPanAheadCallback - movs r0, 0x8 - strh r0, [r5, 0x8] - movs r0, 0x7 - strh r0, [r5] - b _080B052C -_080B04BA: - ldrh r0, [r5, 0x8] - subs r0, 0x1 - strh r0, [r5, 0x8] - lsls r0, 16 - cmp r0, 0 - bne _080B052C - movs r0, 0x8 - strh r0, [r5, 0x8] - ldrh r0, [r5, 0xA] - movs r1, 0x1 - eors r0, r1 - strh r0, [r5, 0xA] - ldrh r0, [r5, 0xA] - bl sub_80B02C8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B052C - movs r0, 0x5 - strh r0, [r5] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_8199DF0 - b _080B052C -_080B04F2: - movs r0, 0x40 - movs r1, 0xFF - bl SetGpuReg - ldrh r1, [r5, 0xC] - movs r0, 0 - bl SetGpuReg - ldrh r1, [r5, 0xE] - movs r0, 0x50 - bl SetGpuReg - ldrh r1, [r5, 0x10] - movs r0, 0x52 - bl SetGpuReg - ldrh r1, [r5, 0x12] - movs r0, 0x48 - bl SetGpuReg - ldrh r1, [r5, 0x14] - movs r0, 0x4A - bl SetGpuReg - bl script_env_2_enable_and_set_ctx_running - adds r0, r4, 0 - bl DestroyTask -_080B052C: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80B0318 - - thumb_func_start sub_80B0534 -sub_80B0534: @ 80B0534 - push {lr} - ldr r0, =sub_80B0318 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r1, r0 - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0 - bne _080B0568 - strh r0, [r1, 0x2] - movs r0, 0x68 - b _080B0580 - .pool -_080B0568: - cmp r0, 0x1 - bne _080B0572 - strh r0, [r1, 0x2] - movs r0, 0x88 - b _080B0580 -_080B0572: - cmp r0, 0x2 - bne _080B057A - movs r0, 0 - b _080B057C -_080B057A: - movs r0, 0x1 -_080B057C: - strh r0, [r1, 0x2] - movs r0, 0x78 -_080B0580: - strh r0, [r1, 0x4] - movs r0, 0x50 - strh r0, [r1, 0x6] - pop {r0} - bx r0 - thumb_func_end sub_80B0534 - - thumb_func_start sub_80B058C -sub_80B058C: @ 80B058C - push {lr} - ldr r0, =sub_80B0318 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0x6 - strh r0, [r1, 0x8] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B058C - - thumb_func_start sub_80B05B4 -sub_80B05B4: @ 80B05B4 - push {lr} - bl sub_80859B0 - ldr r0, =task50_0807F0C8 - movs r1, 0x50 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B05B4 - - thumb_func_start task50_0807F0C8 -task50_0807F0C8: @ 80B05CC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80859A0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B05E8 - adds r0, r4, 0 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running -_080B05E8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end task50_0807F0C8 - - thumb_func_start task01_battle_start -task01_battle_start: @ 80B05F0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080B0614 - cmp r0, 0x1 - beq _080B062E - b _080B0652 - .pool -_080B0614: - bl c3_80A0DD8_is_running - cmp r0, 0 - bne _080B0652 - ldrb r0, [r4, 0x2] - bl sub_8145EF4 - bl sub_81BE72C - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _080B0652 -_080B062E: - bl sub_8145F20 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B0652 - bl overworld_free_bg_tilemaps - ldr r0, =sub_8036760 - bl SetMainCallback2 - bl prev_quest_postbuffer_cursor_backup_reset - bl overworld_poison_timer_set - adds r0, r5, 0 - bl DestroyTask -_080B0652: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task01_battle_start - - thumb_func_start task_add_01_battle_start -task_add_01_battle_start: @ 80B065C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 16 - lsrs r5, 16 - ldr r0, =task01_battle_start - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0xA] - adds r0, r5, 0 - bl current_map_music_set__default_for_battle - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task_add_01_battle_start - - thumb_func_start sub_80B0698 -sub_80B0698: @ 80B0698 - push {lr} - bl GetSafariZoneFlag - cmp r0, 0 - beq _080B06A8 - bl sub_80B077C - b _080B06AC -_080B06A8: - bl sub_80B06BC -_080B06AC: - pop {r0} - bx r0 - thumb_func_end sub_80B0698 - - thumb_func_start sub_80B06B0 -sub_80B06B0: @ 80B06B0 - push {lr} - bl sub_80B07B4 - pop {r0} - bx r0 - thumb_func_end sub_80B06B0 - - thumb_func_start sub_80B06BC -sub_80B06BC: @ 80B06BC - push {r4,lr} - bl script_env_2_enable - bl player_bitmagic - bl sub_808BCF4 - ldr r1, =0x030022c0 - ldr r0, =sub_80B0AF8 - str r0, [r1, 0x8] - ldr r4, =0x02022fec - movs r0, 0 - str r0, [r4] - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _080B06F2 - ldr r0, =0x0000400e - movs r1, 0 - bl VarSet - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 14 - orrs r0, r1 - str r0, [r4] -_080B06F2: - bl sub_80B0EC8 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl task_add_01_battle_start - movs r0, 0x7 - bl sav12_xor_increment - movs r0, 0x8 - bl sav12_xor_increment - bl sub_80EECC8 - bl sub_80B1218 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B06BC - - thumb_func_start sub_80B072C -sub_80B072C: @ 80B072C - push {lr} - bl script_env_2_enable - bl player_bitmagic - bl sub_808BCF4 - ldr r1, =0x030022c0 - ldr r0, =sub_80B0AF8 - str r0, [r1, 0x8] - ldr r1, =0x02022fec - movs r0, 0x80 - lsls r0, 3 - str r0, [r1] - bl sub_80B0EC8 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl task_add_01_battle_start - movs r0, 0x7 - bl sav12_xor_increment - movs r0, 0x8 - bl sav12_xor_increment - bl sub_80EECC8 - bl sub_80B1218 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B072C - - thumb_func_start sub_80B077C -sub_80B077C: @ 80B077C - push {lr} - bl script_env_2_enable - bl player_bitmagic - bl sub_808BCF4 - ldr r1, =0x030022c0 - ldr r0, =sub_80FC190 - str r0, [r1, 0x8] - ldr r1, =0x02022fec - movs r0, 0x80 - str r0, [r1] - bl sub_80B0EC8 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl task_add_01_battle_start - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B077C - - thumb_func_start sub_80B07B4 -sub_80B07B4: @ 80B07B4 - push {lr} - bl script_env_2_enable - bl player_bitmagic - bl sub_808BCF4 - ldr r1, =0x030022c0 - ldr r0, =sub_80B0AF8 - str r0, [r1, 0x8] - ldr r1, =0x02022fec - movs r0, 0x80 - lsls r0, 13 - str r0, [r1] - bl sub_80B0EC8 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl task_add_01_battle_start - movs r0, 0x7 - bl sav12_xor_increment - movs r0, 0x8 - bl sav12_xor_increment - bl sub_80EECC8 - bl sub_80B1218 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B07B4 - - thumb_func_start task_add_01_battle_start_with_music_and_stats -task_add_01_battle_start_with_music_and_stats: @ 80B0804 - push {lr} - bl reads_trainer_data_byte1_byte0x18 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl task_add_01_battle_start - movs r0, 0x7 - bl sav12_xor_increment - movs r0, 0x9 - bl sav12_xor_increment - bl sub_80B1234 - pop {r0} - bx r0 - thumb_func_end task_add_01_battle_start_with_music_and_stats - - thumb_func_start sub_80B0828 -sub_80B0828: @ 80B0828 - push {lr} - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _080B0846 - movs r0, 0xA - bl sub_80B100C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl task_add_01_battle_start - b _080B0856 -_080B0846: - movs r0, 0xB - bl sub_80B100C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl task_add_01_battle_start -_080B0856: - movs r0, 0x7 - bl sav12_xor_increment - movs r0, 0x9 - bl sav12_xor_increment - bl sub_80B1234 - pop {r0} - bx r0 - thumb_func_end sub_80B0828 - - thumb_func_start sub_80B086C -sub_80B086C: @ 80B086C - push {lr} - ldr r0, =0x02024744 - movs r1, 0xC4 - lsls r1, 1 - movs r2, 0x5 - bl sub_8067FF8 - bl script_env_2_enable - ldr r1, =0x030022c0 - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - str r0, [r1, 0x8] - ldr r1, =0x02022fec - movs r0, 0x80 - lsls r0, 2 - str r0, [r1] - movs r0, 0x8 - movs r1, 0 - bl task_add_01_battle_start - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B086C - - thumb_func_start sub_80B08A8 -sub_80B08A8: @ 80B08A8 - push {lr} - bl script_env_2_enable - ldr r1, =0x030022c0 - ldr r0, =sub_80B0B6C - str r0, [r1, 0x8] - ldr r1, =0x02022fec - movs r0, 0 - str r0, [r1] - bl sub_80B0EC8 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl task_add_01_battle_start - movs r0, 0x7 - bl sav12_xor_increment - movs r0, 0x8 - bl sav12_xor_increment - bl sub_80EECC8 - bl sub_80B1218 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B08A8 - - thumb_func_start sub_80B08EC -sub_80B08EC: @ 80B08EC - push {lr} - bl script_env_2_enable - ldr r1, =0x030022c0 - ldr r0, =sub_80B0B6C - str r0, [r1, 0x8] - ldr r1, =0x02022fec - movs r0, 0x80 - lsls r0, 6 - str r0, [r1] - bl sub_80B0EC8 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl task_add_01_battle_start - movs r0, 0x7 - bl sav12_xor_increment - movs r0, 0x8 - bl sav12_xor_increment - bl sub_80EECC8 - bl sub_80B1218 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B08EC - - thumb_func_start sub_80B0934 -sub_80B0934: @ 80B0934 - push {r4,lr} - bl script_env_2_enable - ldr r1, =0x030022c0 - ldr r0, =sub_80B0B6C - str r0, [r1, 0x8] - ldr r4, =0x02022fec - movs r0, 0x80 - lsls r0, 6 - str r0, [r4] - ldr r0, =0x02024744 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - movs r0, 0xCA - lsls r0, 1 - cmp r1, r0 - beq _080B09B8 - cmp r1, r0 - bhi _080B0988 - cmp r1, 0x97 - beq _080B09F4 - cmp r1, 0x97 - bcc _080B099A - cmp r1, 0xFA - bhi _080B099A - cmp r1, 0xF9 - bcc _080B099A - ldr r1, =0x00000229 - b _080B09E6 - .pool -_080B0988: - movs r0, 0xCB - lsls r0, 1 - cmp r1, r0 - beq _080B09CE - cmp r1, r0 - bcc _080B099A - adds r0, 0x4 - cmp r1, r0 - beq _080B09E4 -_080B099A: - ldr r2, =0x02022fec - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 21 - orrs r0, r1 - str r0, [r2] - movs r1, 0xF0 - lsls r1, 1 - movs r0, 0x17 - bl task_add_01_battle_start - b _080B09FE - .pool -_080B09B8: - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 22 - orrs r0, r1 - str r0, [r4] - movs r1, 0xF0 - lsls r1, 1 - movs r0, 0x16 - bl task_add_01_battle_start - b _080B09FE -_080B09CE: - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 23 - orrs r0, r1 - str r0, [r4] - movs r1, 0xEB - lsls r1, 1 - movs r0, 0x18 - bl task_add_01_battle_start - b _080B09FE -_080B09E4: - ldr r1, =0x00000227 -_080B09E6: - movs r0, 0 - bl task_add_01_battle_start - b _080B09FE - .pool -_080B09F4: - movs r1, 0xEC - lsls r1, 1 - movs r0, 0xA - bl task_add_01_battle_start -_080B09FE: - movs r0, 0x7 - bl sav12_xor_increment - movs r0, 0x8 - bl sav12_xor_increment - bl sub_80EECC8 - bl sub_80B1218 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80B0934 - - thumb_func_start sub_80B0A18 -sub_80B0A18: @ 80B0A18 - push {lr} - bl script_env_2_enable - ldr r1, =0x030022c0 - ldr r0, =sub_80B0B6C - str r0, [r1, 0x8] - ldr r1, =0x02022fec - movs r0, 0xC0 - lsls r0, 6 - str r0, [r1] - ldr r0, =gUnknown_82E9530 - ldrb r0, [r0] - cmp r0, 0x2 - bne _080B0A50 - movs r1, 0xF0 - lsls r1, 1 - movs r0, 0xB - bl task_add_01_battle_start - b _080B0A5A - .pool -_080B0A50: - movs r1, 0xF0 - lsls r1, 1 - movs r0, 0x6 - bl task_add_01_battle_start -_080B0A5A: - movs r0, 0x7 - bl sav12_xor_increment - movs r0, 0x8 - bl sav12_xor_increment - bl sub_80EECC8 - bl sub_80B1218 - pop {r0} - bx r0 - thumb_func_end sub_80B0A18 - - thumb_func_start sub_80B0A74 -sub_80B0A74: @ 80B0A74 - push {lr} - bl script_env_2_enable - ldr r1, =0x030022c0 - ldr r0, =sub_80B0B6C - str r0, [r1, 0x8] - ldr r1, =0x02022fec - movs r0, 0xC0 - lsls r0, 7 - str r0, [r1] - ldr r0, =0x02024744 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r1, r0, 16 - adds r2, r1, 0 - movs r0, 0xC9 - lsls r0, 1 - cmp r1, r0 - beq _080B0ACC - cmp r1, r0 - bgt _080B0ABC - subs r0, 0x1 - cmp r1, r0 - beq _080B0AC8 - b _080B0AD4 - .pool -_080B0ABC: - ldr r0, =0x00000193 - cmp r2, r0 - beq _080B0AD0 - b _080B0AD4 - .pool -_080B0AC8: - movs r0, 0x15 - b _080B0AD6 -_080B0ACC: - movs r0, 0x13 - b _080B0AD6 -_080B0AD0: - movs r0, 0x14 - b _080B0AD6 -_080B0AD4: - movs r0, 0xA -_080B0AD6: - ldr r1, =0x000001df - bl task_add_01_battle_start - movs r0, 0x7 - bl sav12_xor_increment - movs r0, 0x8 - bl sav12_xor_increment - bl sub_80EECC8 - bl sub_80B1218 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B0A74 - - thumb_func_start sub_80B0AF8 -sub_80B0AF8: @ 80B0AF8 - push {lr} - sub sp, 0x4 - mov r1, sp - movs r0, 0 - strh r0, [r1] - movs r1, 0xA0 - lsls r1, 19 - ldr r2, =0x01000100 - mov r0, sp - bl CpuSet - movs r0, 0 - movs r1, 0x80 - bl ResetSpriteRange - ldr r0, =0x0202433a - ldrb r0, [r0] - bl battle_exit_is_player_defeat - cmp r0, 0x1 - bne _080B0B4C - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _080B0B4C - bl InBattlePike - lsls r0, 24 - cmp r0, 0 - bne _080B0B4C - ldr r0, =c2_whiteout - bl SetMainCallback2 - b _080B0B58 - .pool -_080B0B4C: - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - ldr r1, =0x03005dac - ldr r0, =sub_80AF6F0 - str r0, [r1] -_080B0B58: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B0AF8 - - thumb_func_start sub_80B0B6C -sub_80B0B6C: @ 80B0B6C - push {lr} - sub sp, 0x4 - mov r1, sp - movs r0, 0 - strh r0, [r1] - movs r1, 0xA0 - lsls r1, 19 - ldr r2, =0x01000100 - mov r0, sp - bl CpuSet - movs r0, 0 - movs r1, 0x80 - bl ResetSpriteRange - ldr r0, =0x0202433a - ldrb r0, [r0] - bl battle_exit_is_player_defeat - cmp r0, 0x1 - bne _080B0BC0 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _080B0BB4 - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - b _080B0BC6 - .pool -_080B0BB4: - ldr r0, =c2_whiteout - bl SetMainCallback2 - b _080B0BC6 - .pool -_080B0BC0: - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 -_080B0BC6: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B0B6C - - thumb_func_start sub_80B0BD0 -sub_80B0BD0: @ 80B0BD0 - push {r4,r5,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 16 - lsrs r5, r0, 16 - lsls r0, r5, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl MetatileBehavior_IsTallGrass - lsls r0, 24 - cmp r0, 0 - beq _080B0C06 - movs r0, 0 - b _080B0D1A -_080B0C06: - adds r0, r4, 0 - bl MetatileBehavior_IsLongGrass - lsls r0, 24 - cmp r0, 0 - beq _080B0C16 - movs r0, 0x1 - b _080B0D1A -_080B0C16: - adds r0, r4, 0 - bl MetatileBehavior_IsSandOrDeepSand - lsls r0, 24 - cmp r0, 0 - bne _080B0D18 - ldr r0, =0x02037318 - ldrb r0, [r0, 0x17] - subs r0, 0x1 - cmp r0, 0x8 - bhi _080B0C9C - lsls r0, 2 - ldr r1, =_080B0C40 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080B0C40: - .4byte _080B0C9C - .4byte _080B0C9C - .4byte _080B0C9C - .4byte _080B0C64 - .4byte _080B0C88 - .4byte _080B0C8C - .4byte _080B0C9C - .4byte _080B0C74 - .4byte _080B0C74 -_080B0C64: - lsls r0, r5, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_8089588 - lsls r0, 24 - cmp r0, 0 - beq _080B0C78 -_080B0C74: - movs r0, 0x8 - b _080B0D1A -_080B0C78: - adds r0, r4, 0 - bl MetatileBehavior_IsSurfableWaterOrUnderwater - lsls r0, 24 - cmp r0, 0 - bne _080B0CE0 - movs r0, 0x7 - b _080B0D1A -_080B0C88: - movs r0, 0x3 - b _080B0D1A -_080B0C8C: - lsls r0, r5, 24 - lsrs r0, 24 - bl MetatileBehavior_IsSurfableWaterOrUnderwater - lsls r0, 24 - cmp r0, 0 - bne _080B0CF2 - b _080B0D10 -_080B0C9C: - lsls r0, r5, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_808962C - lsls r0, 24 - cmp r0, 0 - bne _080B0CF2 - adds r0, r4, 0 - bl MetatileBehavior_IsSurfableWaterOrUnderwater - lsls r0, 24 - cmp r0, 0 - bne _080B0CE0 - adds r0, r4, 0 - bl sub_808959C - lsls r0, 24 - cmp r0, 0 - beq _080B0CC8 - movs r0, 0x6 - b _080B0D1A -_080B0CC8: - movs r0, 0x8 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _080B0CF6 - adds r0, r4, 0 - bl sub_80894D4 - lsls r0, 24 - cmp r0, 0 - beq _080B0CE4 -_080B0CE0: - movs r0, 0x5 - b _080B0D1A -_080B0CE4: - adds r0, r4, 0 - bl sub_80894AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B0CF6 -_080B0CF2: - movs r0, 0x4 - b _080B0D1A -_080B0CF6: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - movs r0, 0xE0 - lsls r0, 5 - cmp r1, r0 - beq _080B0D18 - bl sav1_get_weather_probably - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x8 - beq _080B0D18 -_080B0D10: - movs r0, 0x9 - b _080B0D1A - .pool -_080B0D18: - movs r0, 0x2 -_080B0D1A: - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80B0BD0 - - thumb_func_start sub_80B0D24 -sub_80B0D24: @ 80B0D24 - push {r4,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 16 - lsrs r4, r0, 16 - bl sav1_get_flash_used_on_map - lsls r0, 24 - cmp r0, 0 - beq _080B0D54 - movs r0, 0x2 - b _080B0D7E -_080B0D54: - lsls r0, r4, 24 - lsrs r0, 24 - bl MetatileBehavior_IsSurfableWaterOrUnderwater - lsls r0, 24 - cmp r0, 0 - bne _080B0D7C - ldr r0, =0x02037318 - ldrb r0, [r0, 0x17] - cmp r0, 0x4 - beq _080B0D78 - cmp r0, 0x5 - beq _080B0D7C - movs r0, 0 - b _080B0D7E - .pool -_080B0D78: - movs r0, 0x1 - b _080B0D7E -_080B0D7C: - movs r0, 0x3 -_080B0D7E: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B0D24 - - thumb_func_start sub_80B0D88 -sub_80B0D88: @ 80B0D88 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r7, 0 - movs r6, 0 -_080B0D92: - movs r0, 0x64 - adds r1, r6, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - adds r1, r0, 0 - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - beq _080B0DD6 - cmp r1, 0 - beq _080B0DD6 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _080B0DD6 - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - adds r0, r7, r0 - lsls r0, 24 - lsrs r7, r0, 24 - subs r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - beq _080B0DDC -_080B0DD6: - adds r6, 0x1 - cmp r6, 0x5 - ble _080B0D92 -_080B0DDC: - adds r0, r7, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B0D88 - - thumb_func_start reads_trainer_data_byte0 -reads_trainer_data_byte0: @ 80B0DE8 - push {r4,r5,lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 24 - lsrs r4, r1, 24 - ldr r5, =gTrainers - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r2, r1, r5 - adds r0, r2, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, r4 - bcs _080B0E08 - adds r4, r0, 0 -_080B0E08: - movs r3, 0 - ldrb r0, [r2] - cmp r0, 0x1 - beq _080B0E50 - cmp r0, 0x1 - bgt _080B0E20 - cmp r0, 0 - beq _080B0E2A - b _080B0EC0 - .pool -_080B0E20: - cmp r0, 0x2 - beq _080B0E76 - cmp r0, 0x3 - beq _080B0E9C - b _080B0EC0 -_080B0E2A: - adds r0, r5, 0 - adds r0, 0x24 - adds r0, r1, r0 - ldr r1, [r0] - movs r2, 0 - cmp r3, r4 - bcs _080B0EC0 -_080B0E38: - lsls r0, r2, 3 - adds r0, r1 - ldrb r0, [r0, 0x2] - adds r0, r3, r0 - lsls r0, 24 - lsrs r3, r0, 24 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r4 - bcc _080B0E38 - b _080B0EC0 -_080B0E50: - adds r0, r5, 0 - adds r0, 0x24 - adds r0, r1, r0 - ldr r1, [r0] - movs r2, 0 - cmp r3, r4 - bcs _080B0EC0 -_080B0E5E: - lsls r0, r2, 4 - adds r0, r1 - ldrb r0, [r0, 0x2] - adds r0, r3, r0 - lsls r0, 24 - lsrs r3, r0, 24 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r4 - bcc _080B0E5E - b _080B0EC0 -_080B0E76: - adds r0, r5, 0 - adds r0, 0x24 - adds r0, r1, r0 - ldr r1, [r0] - movs r2, 0 - cmp r3, r4 - bcs _080B0EC0 -_080B0E84: - lsls r0, r2, 3 - adds r0, r1 - ldrb r0, [r0, 0x2] - adds r0, r3, r0 - lsls r0, 24 - lsrs r3, r0, 24 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r4 - bcc _080B0E84 - b _080B0EC0 -_080B0E9C: - adds r0, r5, 0 - adds r0, 0x24 - adds r0, r1, r0 - ldr r1, [r0] - movs r2, 0 - cmp r3, r4 - bcs _080B0EC0 -_080B0EAA: - lsls r0, r2, 4 - adds r0, r1 - ldrb r0, [r0, 0x2] - adds r0, r3, r0 - lsls r0, 24 - lsrs r3, r0, 24 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r4 - bcc _080B0EAA -_080B0EC0: - adds r0, r3, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end reads_trainer_data_byte0 - - thumb_func_start sub_80B0EC8 -sub_80B0EC8: @ 80B0EC8 - push {r4-r6,lr} - bl sub_80B0D24 - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - ldr r0, =0x02024744 - movs r1, 0x38 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - bl sub_80B0D88 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bcs _080B0F10 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _080B0F04 - movs r0, 0 - b _080B0F2E - .pool -_080B0F04: - ldr r0, =gUnknown_0854FE88 - lsls r1, r5, 1 - b _080B0F20 - .pool -_080B0F10: - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _080B0F2C - ldr r0, =gUnknown_0854FE88 - lsls r1, r6, 1 - adds r0, 0x1 -_080B0F20: - adds r1, r0 - ldrb r0, [r1] - b _080B0F2E - .pool -_080B0F2C: - movs r0, 0xA -_080B0F2E: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80B0EC8 - - thumb_func_start reads_trainer_data_byte1_byte0x18 -reads_trainer_data_byte1_byte0x18: @ 80B0F34 - push {r4-r6,lr} - ldr r4, =0x02038bca - ldrh r1, [r4] - movs r0, 0x80 - lsls r0, 3 - cmp r1, r0 - beq _080B0F98 - ldr r1, =gTrainers - ldrh r2, [r4] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x1] - cmp r1, 0x1F - bne _080B0F94 - adds r1, r2, 0 - ldr r0, =0x00000105 - cmp r1, r0 - bne _080B0F6C - movs r0, 0xC - b _080B1000 - .pool -_080B0F6C: - movs r0, 0x83 - lsls r0, 1 - cmp r1, r0 - bne _080B0F78 - movs r0, 0xD - b _080B1000 -_080B0F78: - ldr r0, =0x00000107 - cmp r1, r0 - bne _080B0F88 - movs r0, 0xE - b _080B1000 - .pool -_080B0F88: - movs r0, 0x84 - lsls r0, 1 - cmp r1, r0 - bne _080B0F98 - movs r0, 0xF - b _080B1000 -_080B0F94: - cmp r1, 0x26 - bne _080B0F9C -_080B0F98: - movs r0, 0x10 - b _080B1000 -_080B0F9C: - cmp r1, 0x9 - beq _080B0FA8 - cmp r1, 0x35 - beq _080B0FA8 - cmp r1, 0x31 - bne _080B0FAC -_080B0FA8: - movs r0, 0x12 - b _080B1000 -_080B0FAC: - cmp r1, 0x3 - beq _080B0FB8 - cmp r1, 0xD - beq _080B0FB8 - cmp r1, 0xB - bne _080B0FBC -_080B0FB8: - movs r0, 0x11 - b _080B1000 -_080B0FBC: - ldrb r0, [r0, 0x18] - movs r5, 0x1 - cmp r0, 0x1 - bne _080B0FC6 - movs r5, 0x2 -_080B0FC6: - bl sub_80B0D24 - lsls r0, 24 - lsrs r6, r0, 24 - ldrh r0, [r4] - adds r1, r5, 0 - bl reads_trainer_data_byte0 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - bl sub_80B0D88 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bcc _080B0FF8 - ldr r0, =gUnknown_0854FE90 - lsls r1, r6, 1 - adds r0, 0x1 - b _080B0FFC - .pool -_080B0FF8: - ldr r0, =gUnknown_0854FE90 - lsls r1, r6, 1 -_080B0FFC: - adds r1, r0 - ldrb r0, [r1] -_080B1000: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end reads_trainer_data_byte1_byte0x18 - - thumb_func_start sub_80B100C -sub_80B100C: @ 80B100C - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x02024744 - movs r1, 0x38 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - bl sub_80B0D88 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bcs _080B1090 - cmp r5, 0xA - beq _080B1048 - cmp r5, 0xA - bgt _080B1040 - cmp r5, 0x3 - beq _080B105C - b _080B106C - .pool -_080B1040: - cmp r5, 0xD - bgt _080B106C - movs r0, 0x4 - b _080B1120 -_080B1048: - ldr r4, =gUnknown_0854FEA4 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - b _080B1114 - .pool -_080B105C: - ldr r4, =gUnknown_0854FEA7 - bl GenerateRandomNumber - ands r5, r0 - lsls r0, r5, 16 - b _080B111A - .pool -_080B106C: - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x3 - beq _080B10EC - ldr r4, =gUnknown_0854FE98 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - b _080B1112 - .pool -_080B1090: - cmp r5, 0xA - beq _080B10A6 - cmp r5, 0xA - bgt _080B109E - cmp r5, 0x3 - beq _080B10B8 - b _080B10C8 -_080B109E: - cmp r5, 0xD - bgt _080B10C8 - movs r0, 0x3 - b _080B1120 -_080B10A6: - ldr r4, =gUnknown_0854FEA4 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - b _080B1114 - .pool -_080B10B8: - ldr r4, =gUnknown_0854FEA7 - bl GenerateRandomNumber - ands r5, r0 - lsls r0, r5, 16 - b _080B111A - .pool -_080B10C8: - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x3 - beq _080B10EC - ldr r4, =gUnknown_0854FE98 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - b _080B1112 - .pool -_080B10EC: - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r2, =0x00000cb2 - adds r0, r1, r2 - ldrh r0, [r0] - lsls r2, r0, 2 - ldr r3, =0x00000cb4 - adds r1, r3 - adds r2, r1, r2 - lsls r0, 1 - adds r0, 0x1 - lsls r0, 1 - adds r1, r0 - ldrh r0, [r1] - ldrh r2, [r2] - adds r0, r2 - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gUnknown_0854FE98 -_080B1112: - movs r1, 0xC -_080B1114: - bl __umodsi3 - lsls r0, 16 -_080B111A: - lsrs r0, 16 - adds r0, r4 - ldrb r0, [r0] -_080B1120: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B100C - - thumb_func_start sub_80B1138 -sub_80B1138: @ 80B1138 - push {lr} - ldr r0, =set_256color_bg_bg0 - bl SetMainCallback2 - ldr r1, =0x030022c0 - ldr r0, =sub_80B1158 - str r0, [r1, 0x8] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B1138 - - thumb_func_start sub_80B1158 -sub_80B1158: @ 80B1158 - push {lr} - sub sp, 0x8 - ldr r0, =0x00004023 - bl GetVarPointer - ldr r2, =0x020375f0 - ldrh r1, [r2] - strh r1, [r0] - ldrh r0, [r2] - bl sub_8133EDC - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - movs r1, 0x5 - movs r2, 0 - movs r3, 0 - bl sub_80F9244 - bl ResetTasks - bl sub_806E64C - ldr r0, =sub_80B11A8 - bl SetMainCallback2 - movs r0, 0 - bl sub_8145F10 - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B1158 - - thumb_func_start sub_80B11A8 -sub_80B11A8: @ 80B11A8 - push {lr} - bl fade_and_return_progress_probably - bl RunTasks - bl sub_8145F20 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B11F0 - ldr r1, =0x02022fec - movs r0, 0x10 - str r0, [r1] - ldr r1, =0x030022c0 - ldr r0, =sub_80B1204 - str r0, [r1, 0x8] - bl FreeAllWindowBuffers - ldr r0, =sub_8036760 - bl SetMainCallback2 - bl prev_quest_postbuffer_cursor_backup_reset - bl overworld_poison_timer_set - movs r0, 0x7 - bl sav12_xor_increment - movs r0, 0x8 - bl sav12_xor_increment - bl sub_80EECC8 - bl sub_80B1218 -_080B11F0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B11A8 - - thumb_func_start sub_80B1204 -sub_80B1204: @ 80B1204 - push {lr} - bl sav1_reset_battle_music_maybe - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B1204 - - thumb_func_start sub_80B1218 -sub_80B1218: @ 80B1218 - push {lr} - movs r0, 0x8 - bl sub_80847F8 - movs r1, 0x3C - bl __umodsi3 - cmp r0, 0 - bne _080B122E - bl sub_81DA57C -_080B122E: - pop {r0} - bx r0 - thumb_func_end sub_80B1218 - - thumb_func_start sub_80B1234 -sub_80B1234: @ 80B1234 - push {lr} - movs r0, 0x9 - bl sub_80847F8 - movs r1, 0x14 - bl __umodsi3 - cmp r0, 0 - bne _080B124A - bl sub_81DA57C -_080B124A: - pop {r0} - bx r0 - thumb_func_end sub_80B1234 - - thumb_func_start TrainerBattleLoadArg32 -@ u32 TrainerBattleLoadArg32(u8 *arg) -TrainerBattleLoadArg32: @ 80B1250 - adds r2, r0, 0 - ldrb r0, [r2] - ldrb r1, [r2, 0x1] - lsls r1, 8 - orrs r0, r1 - ldrb r1, [r2, 0x2] - lsls r1, 16 - orrs r0, r1 - ldrb r1, [r2, 0x3] - lsls r1, 24 - orrs r0, r1 - bx lr - thumb_func_end TrainerBattleLoadArg32 - - thumb_func_start TrainerBattleLoadArg16 -@ u16 TrainerBattleLoadArg16(u8 *arg) -TrainerBattleLoadArg16: @ 80B1268 - adds r1, r0, 0 - ldrb r0, [r1] - ldrb r1, [r1, 0x1] - lsls r1, 8 - orrs r0, r1 - bx lr - thumb_func_end TrainerBattleLoadArg16 - - thumb_func_start TrainerBattleLoadArg8 -@ u8 TrainerBattleLoadArg8(u8 *arg) -TrainerBattleLoadArg8: @ 80B1274 - ldrb r0, [r0] - bx lr - thumb_func_end TrainerBattleLoadArg8 - - thumb_func_start trainerflag_opponent -trainerflag_opponent: @ 80B1278 - ldr r1, =0x02038bca - movs r2, 0xA0 - lsls r2, 3 - adds r0, r2, 0 - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - bx lr - .pool - thumb_func_end trainerflag_opponent - - thumb_func_start sub_80B1290 -sub_80B1290: @ 80B1290 - ldr r1, =0x02038bcc - movs r2, 0xA0 - lsls r2, 3 - adds r0, r2, 0 - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - bx lr - .pool - thumb_func_end sub_80B1290 - - thumb_func_start battle_exit_is_player_defeat -battle_exit_is_player_defeat: @ 80B12A8 - push {lr} - subs r0, 0x1 - cmp r0, 0x6 - bhi _080B12E0 - lsls r0, 2 - ldr r1, =_080B12C0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080B12C0: - .4byte _080B12E0 - .4byte _080B12DC - .4byte _080B12DC - .4byte _080B12E0 - .4byte _080B12E0 - .4byte _080B12E0 - .4byte _080B12E0 -_080B12DC: - movs r0, 0x1 - b _080B12E2 -_080B12E0: - movs r0, 0 -_080B12E2: - pop {r1} - bx r1 - thumb_func_end battle_exit_is_player_defeat - - thumb_func_start ResetTrainerOpponentIds -ResetTrainerOpponentIds: @ 80B12E8 - ldr r0, =0x02038bca - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02038bcc - strh r1, [r0] - bx lr - .pool - thumb_func_end ResetTrainerOpponentIds - - thumb_func_start InitTrainerBattleVariables -@ void InitTrainerBattleVariables() -InitTrainerBattleVariables: @ 80B12FC - push {lr} - ldr r0, =0x02038bc8 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02038bfc - ldrb r1, [r0] - cmp r1, 0 - bne _080B132C - ldr r0, =0x02038bd4 - str r1, [r0] - ldr r0, =0x02038bdc - str r1, [r0] - ldr r0, =0x02038bf0 - b _080B1338 - .pool -_080B132C: - ldr r0, =0x02038bd8 - movs r1, 0 - str r1, [r0] - ldr r0, =0x02038be0 - str r1, [r0] - ldr r0, =0x02038bf4 -_080B1338: - str r1, [r0] - ldr r1, =0x02038bd0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x02038be4 - movs r1, 0 - str r1, [r0] - ldr r0, =0x02038be8 - str r1, [r0] - ldr r0, =0x02038bec - str r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end InitTrainerBattleVariables - - thumb_func_start TrainerBattleLoadArgs -@ void TrainerBattleLoadArgs(struct TrainerBattleArgSpec *argSpecs, u8 *args) -TrainerBattleLoadArgs: @ 80B1370 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 -_080B1376: - ldrb r0, [r4, 0x4] - cmp r0, 0x6 - bhi _080B13E8 - lsls r0, 2 - ldr r1, =_080B138C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080B138C: - .4byte _080B13A8 - .4byte _080B13B6 - .4byte _080B13C4 - .4byte _080B13D2 - .4byte _080B13DA - .4byte _080B13E2 - .4byte _080B13EC -_080B13A8: - adds r0, r5, 0 - bl TrainerBattleLoadArg8 - ldr r1, [r4] - strb r0, [r1] - adds r5, 0x1 - b _080B13E8 -_080B13B6: - adds r0, r5, 0 - bl TrainerBattleLoadArg16 - ldr r1, [r4] - strh r0, [r1] - adds r5, 0x2 - b _080B13E8 -_080B13C4: - adds r0, r5, 0 - bl TrainerBattleLoadArg32 - ldr r1, [r4] - str r0, [r1] - adds r5, 0x4 - b _080B13E8 -_080B13D2: - ldr r1, [r4] - movs r0, 0 - strb r0, [r1] - b _080B13E8 -_080B13DA: - ldr r1, [r4] - movs r0, 0 - strh r0, [r1] - b _080B13E8 -_080B13E2: - ldr r1, [r4] - movs r0, 0 - str r0, [r1] -_080B13E8: - adds r4, 0x8 - b _080B1376 -_080B13EC: - ldr r0, [r4] - str r5, [r0] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end TrainerBattleLoadArgs - - thumb_func_start battle_80801F0 -battle_80801F0: @ 80B13F8 - push {lr} - ldr r0, =0x02038bd0 - ldrh r1, [r0] - cmp r1, 0 - beq _080B141A - ldr r0, =0x020375f2 - strh r1, [r0] - lsls r0, r1, 24 - lsrs r0, 24 - ldr r1, =0x03005d8c - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl GetFieldObjectIdByLocalIdAndMap - ldr r1, =0x03005df0 - strb r0, [r1] -_080B141A: - pop {r0} - bx r0 - .pool - thumb_func_end battle_80801F0 - - thumb_func_start TrainerBattleConfigure -@ u8 *TrainerBattleConfigure(u8 *args) -TrainerBattleConfigure: @ 80B1430 - push {r4,r5,lr} - adds r5, r0, 0 - bl InitTrainerBattleVariables - ldr r4, =0x02038bc8 - adds r0, r5, 0 - bl TrainerBattleLoadArg8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - ldrh r0, [r4] - subs r0, 0x1 - cmp r0, 0xB - bls _080B1450 - b _080B15F4 -_080B1450: - lsls r0, 2 - ldr r1, =_080B1464 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080B1464: - .4byte _080B14CC - .4byte _080B14B0 - .4byte _080B1494 - .4byte _080B14A8 - .4byte _080B1514 - .4byte _080B14D4 - .4byte _080B14EC - .4byte _080B14D4 - .4byte _080B153C - .4byte _080B1590 - .4byte _080B1598 - .4byte _080B15A8 -_080B1494: - ldr r0, =gUnknown_0854FF84 - adds r1, r5, 0 - bl TrainerBattleLoadArgs - ldr r0, =gUnknown_082713C2 - b _080B161E - .pool -_080B14A8: - ldr r0, =gUnknown_0854FF3C - b _080B14D6 - .pool -_080B14B0: - ldr r0, =0x02038bfc - ldrb r0, [r0] - cmp r0, 0 - bne _080B14C4 - ldr r0, =gUnknown_0854FEF4 - b _080B15FE - .pool -_080B14C4: - ldr r0, =gUnknown_0855005C - b _080B1616 - .pool -_080B14CC: - ldr r0, =gUnknown_0854FEF4 - b _080B15FE - .pool -_080B14D4: - ldr r0, =gUnknown_0854FFCC -_080B14D6: - adds r1, r5, 0 - bl TrainerBattleLoadArgs - bl battle_80801F0 - ldr r0, =gUnknown_0827138A - b _080B161E - .pool -_080B14EC: - ldr r0, =gUnknown_0854FF3C - adds r1, r5, 0 - bl TrainerBattleLoadArgs - bl battle_80801F0 - ldr r4, =0x02038bca - ldrh r0, [r4] - bl sub_80B2234 - strh r0, [r4] - ldr r0, =gUnknown_082713F8 - b _080B161E - .pool -_080B1514: - ldr r0, =gUnknown_0854FEAC - adds r1, r5, 0 - bl TrainerBattleLoadArgs - bl battle_80801F0 - ldr r4, =0x02038bca - ldrh r0, [r4] - bl sub_80B2234 - strh r0, [r4] - ldr r0, =gUnknown_082713D1 - b _080B161E - .pool -_080B153C: - ldr r0, =0x02038bfc - ldrb r0, [r0] - cmp r0, 0 - bne _080B156C - ldr r0, =gUnknown_0854FEAC - adds r1, r5, 0 - bl TrainerBattleLoadArgs - bl battle_80801F0 - ldr r0, =0x020375f2 - ldrb r0, [r0] - bl sub_81A9AA8 - ldr r1, =0x02038bca - b _080B157E - .pool -_080B156C: - ldr r0, =gUnknown_08550014 - adds r1, r5, 0 - bl TrainerBattleLoadArgs - ldr r0, =0x020375f2 - ldrb r0, [r0] - bl sub_81A9AA8 -_080B157C: - ldr r1, =0x02038bcc -_080B157E: - strh r0, [r1] - b _080B161C - .pool -_080B1590: - ldr r0, =gUnknown_0854FEAC - b _080B159A - .pool -_080B1598: - ldr r0, =gUnknown_08550014 -_080B159A: - adds r1, r5, 0 - bl TrainerBattleLoadArgs - movs r0, 0 - b _080B161E - .pool -_080B15A8: - ldr r0, =0x02038bfc - ldrb r0, [r0] - cmp r0, 0 - bne _080B15D8 - ldr r0, =gUnknown_0854FEAC - adds r1, r5, 0 - bl TrainerBattleLoadArgs - bl battle_80801F0 - ldr r0, =0x020375f2 - ldrb r0, [r0] - bl battle_init - ldr r1, =0x02038bca - b _080B157E - .pool -_080B15D8: - ldr r0, =gUnknown_08550014 - adds r1, r5, 0 - bl TrainerBattleLoadArgs - ldr r0, =0x020375f2 - ldrb r0, [r0] - bl battle_init - b _080B157C - .pool -_080B15F4: - ldr r0, =0x02038bfc - ldrb r0, [r0] - cmp r0, 0 - bne _080B1614 - ldr r0, =gUnknown_0854FEAC -_080B15FE: - adds r1, r5, 0 - bl TrainerBattleLoadArgs - bl battle_80801F0 - b _080B161C - .pool -_080B1614: - ldr r0, =gUnknown_08550014 -_080B1616: - adds r1, r5, 0 - bl TrainerBattleLoadArgs -_080B161C: - ldr r0, =gUnknown_08271362 -_080B161E: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end TrainerBattleConfigure - - thumb_func_start SingleTrainerWantsBattle -@ void SingleTrainerWantsBattle(u8 trainerFieldObjectId, u8 *trainerScript) -SingleTrainerWantsBattle: @ 80B162C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005df0 - strb r0, [r2] - ldr r4, =0x020375f2 - ldr r3, =0x02037350 - lsls r2, r0, 3 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - ldrb r0, [r2, 0x8] - strh r0, [r4] - adds r1, 0x1 - adds r0, r1, 0 - bl TrainerBattleConfigure - ldr r0, =gUnknown_08271354 - bl script_env_1_execute_new_script - bl script_env_2_enable - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end SingleTrainerWantsBattle - - thumb_func_start TwoTrainersWantBattle -@ void TwoTrainersWantBattle(u8 trainerFieldObjectId, u8 *trainerScript) -TwoTrainersWantBattle: @ 80B1670 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005df0 - strb r0, [r2] - ldr r4, =0x020375f2 - ldr r3, =0x02037350 - lsls r2, r0, 3 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - ldrb r0, [r2, 0x8] - strh r0, [r4] - adds r1, 0x1 - adds r0, r1, 0 - bl TrainerBattleConfigure - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end TwoTrainersWantBattle - - thumb_func_start TwoTrainersWantBattleExecuteScript -@ void TwoTrainersWantBattleExecuteScript() -TwoTrainersWantBattleExecuteScript: @ 80B16A4 - push {lr} - ldr r0, =gUnknown_08271354 - bl script_env_1_execute_new_script - bl script_env_2_enable - pop {r0} - bx r0 - .pool - thumb_func_end TwoTrainersWantBattleExecuteScript - - thumb_func_start GetTrainerFlagFromScriptPointer -@ u8 GetTrainerFlagFromScriptPointer(u8 *scriptPointer) -GetTrainerFlagFromScriptPointer: @ 80B16B8 - push {lr} - adds r0, 0x2 - bl TrainerBattleLoadArg16 - lsls r0, 16 - movs r1, 0xA0 - lsls r1, 19 - adds r0, r1 - lsrs r0, 16 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end GetTrainerFlagFromScriptPointer - - thumb_func_start sub_80B16D8 -sub_80B16D8: @ 80B16D8 - push {r4,lr} - ldr r0, =0x03005df0 - ldrb r0, [r0] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl npc_running_behaviour_by_direction - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl npc_set_running_behaviour_etc - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B16D8 - - thumb_func_start sub_80B170C -sub_80B170C: @ 80B170C - ldr r0, =0x02038bc8 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80B170C - - thumb_func_start check_trainer_flag -@ pokescrcmd -check_trainer_flag: @ 80B1718 - push {lr} - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _080B1734 - ldr r0, =0x03005df0 - ldrb r0, [r0] - bl GetBattlePyramidTrainerFlag - b _080B1752 - .pool -_080B1734: - bl InTrainerHill - cmp r0, 0 - bne _080B174A - bl trainerflag_opponent - lsls r0, 16 - lsrs r0, 16 - bl FlagGet - b _080B1752 -_080B174A: - ldr r0, =0x03005df0 - ldrb r0, [r0] - bl GetTrainerHillTrainerFlag -_080B1752: - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end check_trainer_flag - - thumb_func_start rom_npc_set_flag_for_script_id -rom_npc_set_flag_for_script_id: @ 80B1760 - push {lr} - ldr r0, =0x02038bcc - ldrh r0, [r0] - cmp r0, 0 - beq _080B1776 - bl sub_80B1290 - lsls r0, 16 - lsrs r0, 16 - bl FlagSet -_080B1776: - bl trainerflag_opponent - lsls r0, 16 - lsrs r0, 16 - bl FlagSet - pop {r0} - bx r0 - .pool - thumb_func_end rom_npc_set_flag_for_script_id - - thumb_func_start sub_80B178C -sub_80B178C: @ 80B178C - push {lr} - bl trainerflag_opponent - lsls r0, 16 - lsrs r0, 16 - bl FlagSet - pop {r0} - bx r0 - thumb_func_end sub_80B178C - - thumb_func_start trainer_flag_check -trainer_flag_check: @ 80B17A0 - push {lr} - lsls r0, 16 - movs r1, 0xA0 - lsls r1, 19 - adds r0, r1 - lsrs r0, 16 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end trainer_flag_check - - thumb_func_start trainer_flag_set -trainer_flag_set: @ 80B17B8 - push {lr} - lsls r0, 16 - movs r1, 0xA0 - lsls r1, 19 - adds r0, r1 - lsrs r0, 16 - bl FlagSet - pop {r0} - bx r0 - thumb_func_end trainer_flag_set - - thumb_func_start trainer_flag_clear -trainer_flag_clear: @ 80B17CC - push {lr} - lsls r0, 16 - movs r1, 0xA0 - lsls r1, 19 - adds r0, r1 - lsrs r0, 16 - bl FlagReset - pop {r0} - bx r0 - thumb_func_end trainer_flag_clear - - thumb_func_start sub_80B17E0 -sub_80B17E0: @ 80B17E0 - push {r4,lr} - ldr r0, =0x030060a8 - ldrb r0, [r0] - cmp r0, 0x2 - bne _080B17FC - ldr r1, =0x02022fec - ldr r0, =0x00008009 - b _080B1800 - .pool -_080B17FC: - ldr r1, =0x02022fec - movs r0, 0x8 -_080B1800: - str r0, [r1] - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _080B1884 - ldr r0, =0x0000400e - movs r1, 0 - bl VarSet - ldr r2, =0x02022fec - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 14 - orrs r0, r1 - str r0, [r2] - ldr r0, =0x030060a8 - ldrb r0, [r0] - cmp r0, 0x2 - bne _080B1864 - movs r0, 0x1 - bl sub_816306C - ldr r4, =0x020247a8 - adds r0, r4, 0 - bl zero_pokemon_struct - adds r0, r4, 0 - adds r0, 0x64 - bl zero_pokemon_struct - movs r1, 0x96 - lsls r1, 1 - adds r0, r4, r1 - bl zero_pokemon_struct - movs r1, 0xC8 - lsls r1, 1 - adds r0, r4, r1 - bl zero_pokemon_struct - b _080B187A - .pool -_080B1864: - movs r0, 0x1 - bl sub_8163048 - ldr r4, =0x020247a8 - adds r0, r4, 0 - bl zero_pokemon_struct - adds r4, 0x64 - adds r0, r4, 0 - bl zero_pokemon_struct -_080B187A: - bl sub_81A9B04 - b _080B18B8 - .pool -_080B1884: - bl sub_81D5C18 - lsls r0, 24 - cmp r0, 0 - beq _080B18B8 - ldr r2, =0x02022fec - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 19 - orrs r0, r1 - str r0, [r2] - ldr r0, =0x030060a8 - ldrb r0, [r0] - cmp r0, 0x2 - bne _080B18B0 - bl sub_81D639C - b _080B18B4 - .pool -_080B18B0: - bl sub_81D6384 -_080B18B4: - bl sub_81D61E8 -_080B18B8: - ldr r1, =0x02038bf9 - ldr r2, =0x030060a8 - ldrb r0, [r2] - strb r0, [r1] - movs r1, 0 - strb r1, [r2] - ldr r0, =0x02038bf8 - strb r1, [r0] - ldr r1, =0x03006080 - movs r0, 0 - strh r0, [r1] - ldr r1, =0x030022c0 - ldr r0, =sub_80B1918 - str r0, [r1, 0x8] - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _080B18E8 - bl sub_81D5C18 - lsls r0, 24 - cmp r0, 0 - beq _080B1908 -_080B18E8: - bl sub_80B0828 - b _080B190C - .pool -_080B1908: - bl task_add_01_battle_start_with_music_and_stats -_080B190C: - bl script_env_2_set_ctx_paused - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80B17E0 - - thumb_func_start sub_80B1918 -sub_80B1918: @ 80B1918 - push {lr} - ldr r0, =0x02038bca - ldrh r1, [r0] - movs r0, 0x80 - lsls r0, 3 - cmp r1, r0 - beq _080B1946 - ldr r0, =0x0202433a - ldrb r0, [r0] - bl battle_exit_is_player_defeat - cmp r0, 0x1 - bne _080B1968 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _080B1946 - bl sub_81D5C18 - lsls r0, 24 - cmp r0, 0 - beq _080B195C -_080B1946: - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - b _080B198A - .pool -_080B195C: - ldr r0, =c2_whiteout - bl SetMainCallback2 - b _080B198A - .pool -_080B1968: - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _080B198A - bl sub_81D5C18 - lsls r0, 24 - cmp r0, 0 - bne _080B198A - bl sub_80B20BC - bl rom_npc_set_flag_for_script_id -_080B198A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B1918 - - thumb_func_start sub_80B1994 -sub_80B1994: @ 80B1994 - push {lr} - ldr r0, =0x02038bca - ldrh r1, [r0] - movs r0, 0x80 - lsls r0, 3 - cmp r1, r0 - bne _080B19B4 - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - b _080B19E2 - .pool -_080B19B4: - ldr r0, =0x0202433a - ldrb r0, [r0] - bl battle_exit_is_player_defeat - cmp r0, 0x1 - bne _080B19D0 - ldr r0, =c2_whiteout - bl SetMainCallback2 - b _080B19E2 - .pool -_080B19D0: - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - bl sub_80B20BC - bl rom_npc_set_flag_for_script_id - bl sub_80B22BC -_080B19E2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B1994 - - thumb_func_start sub_80B19EC -sub_80B19EC: @ 80B19EC - push {lr} - ldr r1, =0x02022fec - movs r0, 0x8 - str r0, [r1] - ldr r1, =0x030022c0 - ldr r0, =sub_80B1994 - str r0, [r1, 0x8] - bl task_add_01_battle_start_with_music_and_stats - bl script_env_2_set_ctx_paused - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B19EC - - thumb_func_start sub_80B1A14 -sub_80B1A14: @ 80B1A14 - push {lr} - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _080B1A7C - ldr r0, =0x030060a8 - ldrb r0, [r0] - cmp r0, 0x1 - bhi _080B1A44 - ldr r0, =0x020375f2 - ldrb r0, [r0] - bl sub_81A9AA8 - lsls r0, 16 - lsrs r0, 16 - bl sub_81A9EDC - b _080B1AD8 - .pool -_080B1A44: - ldr r3, =0x02037350 - ldr r2, =0x03006090 - ldr r0, =0x02038bfc - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x8] - bl sub_81A9AA8 - lsls r0, 16 - lsrs r0, 16 - bl sub_81A9EDC - b _080B1AD8 - .pool -_080B1A7C: - bl sub_81D5C18 - lsls r0, 24 - cmp r0, 0 - beq _080B1AEC - ldr r0, =0x030060a8 - ldrb r0, [r0] - cmp r0, 0x1 - bhi _080B1AAC - ldr r0, =0x020375f2 - ldrb r0, [r0] - bl battle_init - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x2 - bl sub_81D572C - b _080B1AD8 - .pool -_080B1AAC: - ldr r3, =0x02037350 - ldr r2, =0x03006090 - ldr r0, =0x02038bfc - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x8] - bl battle_init - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x2 - bl sub_81D572C -_080B1AD8: - bl sub_80982B8 - b _080B1AF4 - .pool -_080B1AEC: - bl sub_80B1C7C - bl box_related_two__2 -_080B1AF4: - pop {r0} - bx r0 - thumb_func_end sub_80B1A14 - - thumb_func_start sub_80B1AF8 -sub_80B1AF8: @ 80B1AF8 - push {lr} - ldr r0, =0x02038bec - ldr r0, [r0] - cmp r0, 0 - bne _080B1B04 - ldr r0, =gUnknown_082C8436 -_080B1B04: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B1AF8 - - thumb_func_start sub_80B1B10 -sub_80B1B10: @ 80B1B10 - push {lr} - ldr r1, =0x02038bf8 - ldrb r2, [r1] - cmp r2, 0 - beq _080B1B3C - movs r0, 0 - strb r0, [r1] - ldr r0, =0x02038bf4 - ldr r2, [r0] - cmp r2, 0 - beq _080B1B54 - ldr r1, =0x03006080 - movs r0, 0x1 - strh r0, [r1] - adds r0, r2, 0 - b _080B1B56 - .pool -_080B1B3C: - ldr r0, =0x02038bf0 - ldr r1, [r0] - cmp r1, 0 - beq _080B1B54 - ldr r0, =0x03006080 - strh r2, [r0] - adds r0, r1, 0 - b _080B1B56 - .pool -_080B1B54: - ldr r0, =gUnknown_082742E6 -_080B1B56: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B1B10 - - thumb_func_start special_trainer_unable_to_battle -special_trainer_unable_to_battle: @ 80B1B60 - push {lr} - bl sub_80B1D18 - bl box_related_two__2 - pop {r0} - bx r0 - thumb_func_end special_trainer_unable_to_battle - - thumb_func_start SetUpTrainerEncounterMusic -@ void SetUpTrainerEncounterMusic() -SetUpTrainerEncounterMusic: @ 80B1B70 - push {lr} - ldr r0, =0x02038bfc - ldrb r0, [r0] - cmp r0, 0 - bne _080B1B88 - ldr r0, =0x02038bca - b _080B1B8A - .pool -_080B1B88: - ldr r0, =0x02038bcc -_080B1B8A: - ldrh r1, [r0] - ldr r0, =0x02038bc8 - ldrh r0, [r0] - cmp r0, 0x1 - beq _080B1C62 - cmp r0, 0x8 - beq _080B1C62 - adds r0, r1, 0 - bl GetTrainerEncounterMusicId - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD - bhi _080B1C5C - lsls r0, 2 - ldr r1, =_080B1BBC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080B1BBC: - .4byte _080B1BF4 - .4byte _080B1BFA - .4byte _080B1C04 - .4byte _080B1C5C - .4byte _080B1C0C - .4byte _080B1C12 - .4byte _080B1C1C - .4byte _080B1C24 - .4byte _080B1C2C - .4byte _080B1C34 - .4byte _080B1C3C - .4byte _080B1C42 - .4byte _080B1C4C - .4byte _080B1C54 -_080B1BF4: - movs r0, 0xBE - lsls r0, 1 - b _080B1C5E -_080B1BFA: - ldr r0, =0x00000197 - b _080B1C5E - .pool -_080B1C04: - ldr r0, =0x0000017b - b _080B1C5E - .pool -_080B1C0C: - movs r0, 0xD0 - lsls r0, 1 - b _080B1C5E -_080B1C12: - ldr r0, =0x000001a1 - b _080B1C5E - .pool -_080B1C1C: - ldr r0, =0x000001a3 - b _080B1C5E - .pool -_080B1C24: - ldr r0, =0x000001b9 - b _080B1C5E - .pool -_080B1C2C: - ldr r0, =0x00000181 - b _080B1C5E - .pool -_080B1C34: - ldr r0, =0x000001c1 - b _080B1C5E - .pool -_080B1C3C: - movs r0, 0xE1 - lsls r0, 1 - b _080B1C5E -_080B1C42: - ldr r0, =0x000001c3 - b _080B1C5E - .pool -_080B1C4C: - ldr r0, =0x000001c5 - b _080B1C5E - .pool -_080B1C54: - ldr r0, =0x0000018d - b _080B1C5E - .pool -_080B1C5C: - ldr r0, =0x000001a7 -_080B1C5E: - bl current_map_music_set -_080B1C62: - pop {r0} - bx r0 - .pool - thumb_func_end SetUpTrainerEncounterMusic - - thumb_func_start ReturnEmptyStringIfNull -@ u8 *ReturnEmptyStringIfNull(u8 *str) -ReturnEmptyStringIfNull: @ 80B1C6C - push {lr} - cmp r0, 0 - bne _080B1C74 - ldr r0, =gUnknown_085E8D03 -_080B1C74: - pop {r1} - bx r1 - .pool - thumb_func_end ReturnEmptyStringIfNull - - thumb_func_start sub_80B1C7C -sub_80B1C7C: @ 80B1C7C - push {lr} - ldr r0, =0x02038bfc - ldrb r0, [r0] - cmp r0, 0 - beq _080B1C94 - ldr r0, =0x02038bd8 - b _080B1C96 - .pool -_080B1C94: - ldr r0, =0x02038bd4 -_080B1C96: - ldr r0, [r0] - bl ReturnEmptyStringIfNull - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B1C7C - - thumb_func_start sub_80B1CA4 -sub_80B1CA4: @ 80B1CA4 - push {r4,lr} - ldr r0, =0x02038bca - ldrh r1, [r0] - movs r0, 0x80 - lsls r0, 3 - cmp r1, r0 - bne _080B1CBC - bl sub_80EA250 - b _080B1CC0 - .pool -_080B1CBC: - ldr r0, =0x02038bdc - ldr r0, [r0] -_080B1CC0: - ldr r4, =0x02021fc4 - bl ReturnEmptyStringIfNull - adds r1, r0, 0 - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B1CA4 - - thumb_func_start sub_80B1CE0 -sub_80B1CE0: @ 80B1CE0 - push {r4,lr} - ldr r4, =0x02021fc4 - ldr r0, =0x02038be0 - ldr r0, [r0] - bl ReturnEmptyStringIfNull - adds r1, r0, 0 - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B1CE0 - - thumb_func_start sub_80B1D04 -sub_80B1D04: @ 80B1D04 - push {lr} - ldr r0, =0x02038be4 - ldr r0, [r0] - bl ReturnEmptyStringIfNull - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B1D04 - - thumb_func_start sub_80B1D18 -sub_80B1D18: @ 80B1D18 - push {lr} - ldr r0, =0x02038be8 - ldr r0, [r0] - bl ReturnEmptyStringIfNull - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B1D18 - - thumb_func_start sub_80B1D2C -sub_80B1D2C: @ 80B1D2C - push {lr} - lsls r1, 16 - lsrs r1, 16 - movs r3, 0 - adds r2, r0, 0 -_080B1D36: - ldrh r0, [r2] - cmp r0, r1 - bne _080B1D40 - adds r0, r3, 0 - b _080B1D4C -_080B1D40: - adds r2, 0x10 - adds r3, 0x1 - cmp r3, 0x4D - ble _080B1D36 - movs r0, 0x1 - negs r0, r0 -_080B1D4C: - pop {r1} - bx r1 - thumb_func_end sub_80B1D2C - - thumb_func_start sub_80B1D50 -sub_80B1D50: @ 80B1D50 - push {r4,r5,lr} - lsls r1, 16 - lsrs r5, r1, 16 - movs r4, 0 - adds r2, r0, 0 -_080B1D5A: - movs r1, 0 - ldrh r0, [r2] - cmp r0, 0 - beq _080B1D80 - movs r3, 0 -_080B1D64: - adds r0, r2, r3 - ldrh r0, [r0] - cmp r0, r5 - bne _080B1D70 - adds r0, r4, 0 - b _080B1D8C -_080B1D70: - adds r3, 0x2 - adds r1, 0x1 - cmp r1, 0x4 - bgt _080B1D80 - adds r0, r2, r3 - ldrh r0, [r0] - cmp r0, 0 - bne _080B1D64 -_080B1D80: - adds r2, 0x10 - adds r4, 0x1 - cmp r4, 0x4D - ble _080B1D5A - movs r0, 0x1 - negs r0, r0 -_080B1D8C: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80B1D50 - - thumb_func_start sub_80B1D94 -sub_80B1D94: @ 80B1D94 - push {lr} - cmp r0, 0x48 - ble _080B1D9E - movs r0, 0x1 - b _080B1DB8 -_080B1D9E: - cmp r0, 0x40 - bne _080B1DB6 - movs r0, 0x7E - bl FlagGet - movs r1, 0 - lsls r0, 24 - cmp r0, 0 - bne _080B1DB2 - movs r1, 0x1 -_080B1DB2: - adds r0, r1, 0 - b _080B1DB8 -_080B1DB6: - movs r0, 0 -_080B1DB8: - pop {r1} - bx r1 - thumb_func_end sub_80B1D94 - - thumb_func_start sub_80B1DBC -sub_80B1DBC: @ 80B1DBC - push {r4-r6,lr} - adds r6, r1, 0 - movs r5, 0x1 - lsls r1, r6, 4 - adds r1, r0 - adds r4, r1, 0x2 - b _080B1DCE -_080B1DCA: - adds r4, 0x2 - adds r5, 0x1 -_080B1DCE: - cmp r5, 0x4 - bgt _080B1DE2 - ldrh r0, [r4] - cmp r0, 0 - beq _080B1DE2 - bl trainer_flag_check - lsls r0, 24 - cmp r0, 0 - bne _080B1DCA -_080B1DE2: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000009ca - adds r0, r1 - adds r0, r6 - strb r5, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B1DBC - - thumb_func_start sub_80B1DFC -sub_80B1DFC: @ 80B1DFC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r6, r0, 0 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - lsls r2, 16 - lsrs r2, 16 - mov r8, r2 - movs r7, 0 - movs r5, 0 - adds r4, r6, 0 - adds r4, 0xA -_080B1E1A: - ldrh r0, [r4] - cmp r0, r9 - bne _080B1E74 - ldrh r0, [r4, 0x2] - cmp r0, r8 - bne _080B1E74 - adds r0, r5, 0 - bl sub_80B1D94 - cmp r0, 0 - bne _080B1E74 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000009ca - adds r0, r1 - adds r0, r5 - ldrb r0, [r0] - cmp r0, 0 - bne _080B1E72 - movs r1, 0xAE - lsls r1, 1 - adds r0, r5, r1 - lsls r0, 16 - lsrs r0, 16 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080B1E74 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1E - bhi _080B1E74 - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_80B1DBC -_080B1E72: - movs r7, 0x1 -_080B1E74: - adds r4, 0x10 - adds r5, 0x1 - cmp r5, 0x40 - ble _080B1E1A - adds r0, r7, 0 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B1DFC - - thumb_func_start sub_80B1E94 -sub_80B1E94: @ 80B1E94 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =gUnknown_085500A4 - lsls r0, r4, 4 - adds r0, r5 - ldrh r0, [r0] - bl trainer_flag_check - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B1EB4 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_80B1DBC -_080B1EB4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B1E94 - - thumb_func_start sub_80B1EC0 -sub_80B1EC0: @ 80B1EC0 - push {r4-r6,lr} - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 16 - lsrs r2, 16 - movs r1, 0 - adds r3, r0, 0 - adds r3, 0xA - ldr r5, =0x03005d8c -_080B1ED2: - ldrh r0, [r3] - cmp r0, r4 - bne _080B1EF8 - ldrh r0, [r3, 0x2] - cmp r0, r2 - bne _080B1EF8 - ldr r0, [r5] - ldr r6, =0x000009ca - adds r0, r6 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080B1EF8 - movs r0, 0x1 - b _080B1F02 - .pool -_080B1EF8: - adds r3, 0x10 - adds r1, 0x1 - cmp r1, 0x4D - ble _080B1ED2 - movs r0, 0 -_080B1F02: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80B1EC0 - - thumb_func_start sub_80B1F08 -sub_80B1F08: @ 80B1F08 - push {r4,lr} - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 16 - lsrs r2, 16 - movs r1, 0 - adds r3, r0, 0 - adds r3, 0xA -_080B1F18: - ldrh r0, [r3] - cmp r0, r4 - bne _080B1F28 - ldrh r0, [r3, 0x2] - cmp r0, r2 - bne _080B1F28 - movs r0, 0x1 - b _080B1F32 -_080B1F28: - adds r3, 0x10 - adds r1, 0x1 - cmp r1, 0x4D - ble _080B1F18 - movs r0, 0 -_080B1F32: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B1F08 - - thumb_func_start sub_80B1F38 -sub_80B1F38: @ 80B1F38 - push {lr} - lsls r1, 16 - lsrs r1, 16 - bl sub_80B1D2C - adds r1, r0, 0 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _080B1F6C - cmp r1, 0x63 - bgt _080B1F6C - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x000009ca - adds r0, r2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080B1F6C - movs r0, 0x1 - b _080B1F6E - .pool -_080B1F6C: - movs r0, 0 -_080B1F6E: - pop {r1} - bx r1 - thumb_func_end sub_80B1F38 - - thumb_func_start sub_80B1F74 -sub_80B1F74: @ 80B1F74 - push {lr} - lsls r1, 16 - lsrs r1, 16 - bl sub_80B1D50 - adds r1, r0, 0 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _080B1FA8 - cmp r1, 0x63 - bgt _080B1FA8 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x000009ca - adds r0, r2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080B1FA8 - movs r0, 0x1 - b _080B1FAA - .pool -_080B1FA8: - movs r0, 0 -_080B1FAA: - pop {r1} - bx r1 - thumb_func_end sub_80B1F74 - - thumb_func_start sub_80B1FB0 -sub_80B1FB0: @ 80B1FB0 - push {r4-r7,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r1, 16 - bl sub_80B1D2C - adds r1, r0, 0 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _080B1FD8 - movs r0, 0 - b _080B1FFE -_080B1FCA: - subs r0, r6, 0x1 - lsls r0, 1 - adds r0, r7, r0 - ldrh r0, [r0] - b _080B1FFE -_080B1FD4: - ldrh r0, [r5] - b _080B1FFE -_080B1FD8: - lsls r0, r1, 4 - adds r7, r4, r0 - movs r6, 0x1 - adds r5, r7, 0x2 - adds r4, r5, 0 -_080B1FE2: - ldrh r0, [r4] - cmp r0, 0 - beq _080B1FCA - bl trainer_flag_check - lsls r0, 24 - cmp r0, 0 - beq _080B1FD4 - adds r4, 0x2 - adds r5, 0x2 - adds r6, 0x1 - cmp r6, 0x4 - ble _080B1FE2 - ldrh r0, [r7, 0x8] -_080B1FFE: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80B1FB0 - - thumb_func_start sub_80B2004 -sub_80B2004: @ 80B2004 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r1, 16 - bl sub_80B1D2C - adds r1, r0, 0 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _080B2032 - movs r0, 0 - b _080B2054 -_080B201E: - subs r0, r5, 0x1 - lsls r0, 1 - adds r0, r6, r0 - ldrh r0, [r0] - b _080B2054 -_080B2028: - subs r0, r5, 0x1 - lsls r0, 1 - adds r0, r6, r0 - ldrh r0, [r0] - b _080B2054 -_080B2032: - lsls r0, r1, 4 - adds r6, r4, r0 - movs r5, 0x1 - adds r4, r6, 0x2 -_080B203A: - ldrh r0, [r4] - cmp r0, 0 - beq _080B201E - bl trainer_flag_check - lsls r0, 24 - cmp r0, 0 - beq _080B2028 - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x4 - ble _080B203A - ldrh r0, [r6, 0x8] -_080B2054: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80B2004 - - thumb_func_start sub_80B205C -sub_80B205C: @ 80B205C - push {lr} - lsls r1, 16 - lsrs r1, 16 - bl sub_80B1D50 - adds r1, r0, 0 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _080B207E - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x000009ca - adds r0, r2 - adds r0, r1 - movs r1, 0 - strb r1, [r0] -_080B207E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B205C - - thumb_func_start sub_80B208C -sub_80B208C: @ 80B208C - push {r4,lr} - adds r3, r0, 0 - movs r1, 0 - movs r4, 0xAE - lsls r4, 1 - ldr r2, =gUnknown_085500A4 -_080B2098: - ldrh r0, [r2] - cmp r0, r3 - bne _080B20A8 - adds r0, r1, r4 - b _080B20B2 - .pool -_080B20A8: - adds r2, 0x10 - adds r1, 0x1 - cmp r1, 0x4D - ble _080B2098 - ldr r0, =0x0000ffff -_080B20B2: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B208C - - thumb_func_start sub_80B20BC -sub_80B20BC: @ 80B20BC - push {lr} - ldr r0, =0x0000012f - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080B20E2 - ldr r0, =0x02038bca - ldrh r0, [r0] - bl sub_80B208C - adds r1, r0, 0 - ldr r0, =0x0000ffff - cmp r1, r0 - beq _080B20E2 - lsls r0, r1, 16 - lsrs r0, 16 - bl FlagSet -_080B20E2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B20BC - - thumb_func_start sub_80B20F4 -sub_80B20F4: @ 80B20F4 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r1, 16 - bl sub_80B1D2C - adds r1, r0, 0 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _080B211E - lsls r0, r1, 4 - adds r0, r4 - ldrh r0, [r0, 0x2] - bl trainer_flag_check - lsls r0, 24 - cmp r0, 0 - beq _080B211E - movs r0, 0x1 - b _080B2120 -_080B211E: - movs r0, 0 -_080B2120: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B20F4 - - thumb_func_start sub_80B2128 -sub_80B2128: @ 80B2128 - push {r4-r6,lr} - movs r6, 0 - movs r5, 0 - ldr r4, =gUnknown_08550584 -_080B2130: - ldrh r0, [r4] - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B214C - adds r6, 0x1 - cmp r6, 0x4 - ble _080B214C - movs r0, 0x1 - b _080B2156 - .pool -_080B214C: - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x7 - bls _080B2130 - movs r0, 0 -_080B2156: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80B2128 - - thumb_func_start sub_80B215C -sub_80B215C: @ 80B215C - push {lr} - bl sub_80B2128 - cmp r0, 0 - beq _080B2184 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x000009c8 - adds r1, r0, r2 - ldrh r0, [r1] - cmp r0, 0xFE - bls _080B2180 - movs r0, 0xFF - b _080B2182 - .pool -_080B2180: - adds r0, 0x1 -_080B2182: - strh r0, [r1] -_080B2184: - pop {r0} - bx r0 - thumb_func_end sub_80B215C - - thumb_func_start sub_80B2188 -sub_80B2188: @ 80B2188 - push {lr} - bl sub_80B2128 - cmp r0, 0 - beq _080B21AC - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000009c8 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0xFE - bls _080B21AC - movs r0, 0x1 - b _080B21AE - .pool -_080B21AC: - movs r0, 0 -_080B21AE: - pop {r1} - bx r1 - thumb_func_end sub_80B2188 - - thumb_func_start sub_80B21B4 -sub_80B21B4: @ 80B21B4 - push {r4,r5,lr} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 16 - lsrs r4, r1, 16 - bl sub_80B2188 - cmp r0, 0 - beq _080B21E0 - ldr r0, =gUnknown_085500A4 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_80B1DFC - cmp r0, 0x1 - bne _080B21E0 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000009c8 - adds r0, r1 - movs r1, 0 - strh r1, [r0] -_080B21E0: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B21B4 - - thumb_func_start sub_80B21F4 -sub_80B21F4: @ 80B21F4 - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - lsls r3, 16 - lsrs r3, 16 - lsls r2, 16 - lsrs r2, 16 - ldr r0, =gUnknown_085500A4 - adds r1, r3, 0 - bl sub_80B1EC0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B21F4 - - thumb_func_start sub_80B2214 -sub_80B2214: @ 80B2214 - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - lsls r3, 16 - lsrs r3, 16 - lsls r2, 16 - lsrs r2, 16 - ldr r0, =gUnknown_085500A4 - adds r1, r3, 0 - bl sub_80B1F08 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B2214 - - thumb_func_start sub_80B2234 -sub_80B2234: @ 80B2234 - push {lr} - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =gUnknown_085500A4 - bl sub_80B1FB0 - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B2234 - - thumb_func_start sub_80B2250 -sub_80B2250: @ 80B2250 - push {lr} - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =gUnknown_085500A4 - bl sub_80B2004 - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B2250 - - thumb_func_start sub_80B226C -sub_80B226C: @ 80B226C - push {r4,r5,lr} - ldr r5, =gUnknown_085500A4 - ldr r4, =0x02038bca - ldrh r1, [r4] - adds r0, r5, 0 - bl sub_80B1F38 - lsls r0, 24 - cmp r0, 0 - bne _080B2298 - ldrh r1, [r4] - adds r0, r5, 0 - bl sub_80B20F4 - lsls r0, 24 - lsrs r0, 24 - b _080B229A - .pool -_080B2298: - movs r0, 0x1 -_080B229A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80B226C - - thumb_func_start sub_80B22A0 -sub_80B22A0: @ 80B22A0 - push {lr} - ldr r0, =gUnknown_085500A4 - ldr r1, =0x02038bca - ldrh r1, [r1] - bl sub_80B1F74 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B22A0 - - thumb_func_start sub_80B22BC -sub_80B22BC: @ 80B22BC - push {lr} - ldr r0, =gUnknown_085500A4 - ldr r1, =0x02038bca - ldrh r1, [r1] - bl sub_80B205C - bl rom_npc_set_flag_for_script_id - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B22BC - - thumb_func_start CheckIfMultipleTrainersWantBattle -CheckIfMultipleTrainersWantBattle: @ 80B22D8 - push {lr} - ldr r1, =0x02038bf9 - ldrb r0, [r1] - cmp r0, 0x1 - bls _080B2300 - movs r0, 0 - strb r0, [r1] - ldr r1, =0x02038bf8 - movs r0, 0x1 - strb r0, [r1] - ldr r1, =0x020375f0 - movs r0, 0x1 - b _080B230A - .pool -_080B2300: - ldr r1, =0x02038bf8 - movs r0, 0 - strb r0, [r1] - ldr r1, =0x020375f0 - movs r0, 0 -_080B230A: - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end CheckIfMultipleTrainersWantBattle - - thumb_func_start sub_80B2318 -sub_80B2318: @ 80B2318 - push {r4-r7,lr} - lsls r0, 16 - ldr r7, =gUnknown_085500A4 - lsrs r4, r0, 12 - adds r6, r4, r7 - ldrh r0, [r6] - bl trainer_flag_check - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080B2338 - movs r0, 0 - b _080B2364 - .pool -_080B2338: - movs r5, 0x1 - adds r0, r4, 0x2 - adds r0, r7 - ldrh r0, [r0] - cmp r0, 0 - beq _080B2360 - adds r4, r6, 0x2 -_080B2346: - ldrh r0, [r4] - bl trainer_flag_check - lsls r0, 24 - cmp r0, 0 - beq _080B2360 - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x4 - bgt _080B2360 - ldrh r0, [r4] - cmp r0, 0 - bne _080B2346 -_080B2360: - lsls r0, r5, 16 - lsrs r0, 16 -_080B2364: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80B2318 - - thumb_func_start sub_80B236C -sub_80B236C: @ 80B236C - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - ldr r4, =sub_80B2634 - adds r0, r4, 0 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _080B23A0 - adds r0, r4, 0 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r6, [r1, 0xA] - strh r5, [r1, 0xC] -_080B23A0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B236C - - thumb_func_start sub_80B23B0 -sub_80B23B0: @ 80B23B0 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =0x02021cc4 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalString - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0 - bl SetStandardWindowBorderStyle - ldr r5, =0x02021fc4 - ldr r1, =gUnknown_085EE667 - adds r0, r5, 0 - bl ExpandStringRefs - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x58 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - adds r2, r5, 0 - bl Print - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B23B0 - - thumb_func_start sub_80B241C -sub_80B241C: @ 80B241C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0 - bl sub_819746C - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80B241C - - thumb_func_start sub_80B243C -sub_80B243C: @ 80B243C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r4, r1, r0 - movs r1, 0x6 - ldrsh r0, [r4, r1] - cmp r5, r0 - beq _080B2472 - cmp r5, 0x1 - bhi _080B2468 - ldrh r0, [r4, 0xA] - bl sub_80B241C - b _080B2470 - .pool -_080B2468: - ldrh r0, [r4, 0xA] - adds r1, r5, 0 - bl sub_80B23B0 -_080B2470: - strh r5, [r4, 0x6] -_080B2472: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80B243C - - thumb_func_start sub_80B2478 -sub_80B2478: @ 80B2478 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - bl sub_800A0C8 - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x1 - cmp r0, 0x6 - bhi _080B24F0 - lsls r0, 2 - ldr r1, =_080B24A0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080B24A0: - .4byte _080B24BC - .4byte _080B24F0 - .4byte _080B24C0 - .4byte _080B24C4 - .4byte _080B24C8 - .4byte _080B24CC - .4byte _080B24EC -_080B24BC: - movs r0, 0x1 - b _080B24F2 -_080B24C0: - movs r0, 0x3 - b _080B24F2 -_080B24C4: - movs r0, 0x7 - b _080B24F2 -_080B24C8: - movs r0, 0x9 - b _080B24F2 -_080B24CC: - ldr r4, =0x02021cc4 - bl sub_800ABAC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalString - movs r0, 0x4 - b _080B24F2 - .pool -_080B24EC: - movs r0, 0xA - b _080B24F2 -_080B24F0: - movs r0, 0 -_080B24F2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B2478 - - thumb_func_start sub_80B24F8 -sub_80B24F8: @ 80B24F8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_800B33C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080B250E - movs r0, 0 - b _080B251E -_080B250E: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80B2D2C - str r0, [r1] - movs r0, 0x1 -_080B251E: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B24F8 - - thumb_func_start sub_80B252C -sub_80B252C: @ 80B252C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080B2570 - bl sub_800B320 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _080B2570 - ldr r0, =0x020229c6 - strh r1, [r0] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80B2CEC - str r1, [r0] - movs r0, 0x1 - b _080B2572 - .pool -_080B2570: - movs r0, 0 -_080B2572: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B252C - - thumb_func_start sub_80B2578 -sub_80B2578: @ 80B2578 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_800B320 - lsls r0, 24 - cmp r0, 0 - beq _080B258E - movs r0, 0x1 - bl sub_800B330 -_080B258E: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _080B25A4 - movs r0, 0 - b _080B25BA - .pool -_080B25A4: - ldr r1, =0x020229c6 - movs r0, 0 - strh r0, [r1] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80B2CEC - str r1, [r0] - movs r0, 0x1 -_080B25BA: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B2578 - - thumb_func_start sub_80B25CC -sub_80B25CC: @ 80B25CC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_800B2E8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080B25E2 - movs r0, 0 - b _080B25F2 -_080B25E2: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80B2D2C - str r0, [r1] - movs r0, 0x1 -_080B25F2: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B25CC - - thumb_func_start sub_80B2600 -sub_80B2600: @ 80B2600 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bne _080B262A - movs r0, 0x2 - bl sub_800A4D8 - adds r0, r4, 0 - bl DestroyTask -_080B262A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B2600 - - thumb_func_start sub_80B2634 -sub_80B2634: @ 80B2634 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r4, r1, r0 - movs r3, 0 - ldrsh r2, [r4, r3] - cmp r2, 0 - bne _080B266C - bl sub_800A0AC - bl sub_800AB98 - bl sub_800A2BC - ldr r0, =gUnknown_08550594 - bl AddWindow - strh r0, [r4, 0xA] - b _080B2678 - .pool -_080B266C: - cmp r2, 0x9 - ble _080B2678 - subs r0, 0x8 - adds r0, r1, r0 - ldr r1, =sub_80B2688 - str r1, [r0] -_080B2678: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B2634 - - thumb_func_start sub_80B2688 -sub_80B2688: @ 80B2688 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_800ABAC - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - bl sub_80B252C - cmp r0, 0x1 - beq _080B26FC - adds r0, r4, 0 - bl sub_80B2578 - cmp r0, 0x1 - beq _080B26FC - cmp r5, 0x1 - bls _080B26FC - movs r0, 0x1 - bl sub_800B330 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0 - strh r0, [r4, 0xE] - bl sub_800ABBC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B26EC - movs r0, 0x15 - bl audio_play - ldr r0, =gUnknown_082780B3 - bl box_related_two__3 - ldr r0, =sub_80B270C - b _080B26FA - .pool -_080B26EC: - movs r0, 0x16 - bl audio_play - ldr r0, =gUnknown_08278131 - bl box_related_two__3 - ldr r0, =sub_80B2918 -_080B26FA: - str r0, [r4] -_080B26FC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B2688 - - thumb_func_start sub_80B270C -sub_80B270C: @ 80B270C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_80B252C - cmp r0, 0x1 - beq _080B274C - adds r0, r4, 0 - bl sub_80B25CC - cmp r0, 0x1 - beq _080B274C - adds r0, r4, 0 - bl sub_80B24F8 - cmp r0, 0x1 - beq _080B274C - bl textbox_any_visible - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - bne _080B274C - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - strh r2, [r1, 0xE] - ldr r0, =sub_80B275C - str r0, [r1] -_080B274C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B270C - - thumb_func_start sub_80B275C -sub_80B275C: @ 80B275C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - mov r8, r0 - ldr r0, =0x03005e08 - mov r9, r0 - mov r7, r8 - add r7, r9 - bl sub_800ABAC - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - bl sub_80B252C - cmp r0, 0x1 - beq _080B27E4 - adds r0, r4, 0 - bl sub_80B25CC - cmp r0, 0x1 - beq _080B27E4 - adds r0, r4, 0 - bl sub_80B24F8 - cmp r0, 0x1 - beq _080B27E4 - adds r6, r5, 0 - adds r0, r4, 0 - adds r1, r6, 0 - bl sub_80B243C - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080B27E4 - movs r1, 0x2 - ldrsh r0, [r7, r1] - cmp r5, r0 - blt _080B27E4 - adds r0, r6, 0 - bl sub_800AA04 - ldrh r0, [r7, 0xA] - bl sub_80B241C - ldr r0, =0x02021cc4 - adds r1, r5, 0 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalString - ldr r0, =gUnknown_082780F2 - bl box_related_two__3 - mov r0, r9 - subs r0, 0x8 - add r0, r8 - ldr r1, =sub_80B2804 - str r1, [r0] -_080B27E4: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B275C - - thumb_func_start sub_80B2804 -sub_80B2804: @ 80B2804 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - adds r0, r5, 0 - bl sub_80B252C - cmp r0, 0x1 - beq _080B2898 - adds r0, r5, 0 - bl sub_80B25CC - cmp r0, 0x1 - beq _080B2898 - adds r0, r5, 0 - bl sub_80B24F8 - cmp r0, 0x1 - beq _080B2898 - bl textbox_any_visible - lsls r0, 24 - cmp r0, 0 - bne _080B2898 - bl sub_800AA48 - adds r4, r0, 0 - bl sub_800ABAC - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _080B2852 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2C] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080B2878 -_080B2852: - ldr r0, =gUnknown_082780B3 - bl box_related_two__3 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80B270C - str r1, [r0] - b _080B2898 - .pool -_080B2878: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080B2898 - movs r0, 0x5 - bl audio_play - bl sub_800A620 - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80B28A8 - str r0, [r1] -_080B2898: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B2804 - - thumb_func_start sub_80B28A8 -sub_80B28A8: @ 80B28A8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r5, r0, r1 - ldrb r7, [r5, 0xA] - ldrb r6, [r5, 0xC] - adds r0, r4, 0 - bl sub_80B24F8 - cmp r0, 0x1 - beq _080B290A - adds r0, r4, 0 - bl sub_80B2D6C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080B290A - bl sub_800ABAC - adds r4, r0, 0 - bl sub_800AA48 - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _080B28F4 - ldr r0, =sub_80B2D2C - b _080B2908 - .pool -_080B28F4: - ldr r4, =0x020375f0 - adds r0, r7, 0 - adds r1, r6, 0 - bl sub_80B2478 - strh r0, [r4] - lsls r0, 16 - cmp r0, 0 - beq _080B290A - ldr r0, =sub_80B2A08 -_080B2908: - str r0, [r5] -_080B290A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B28A8 - - thumb_func_start sub_80B2918 -sub_80B2918: @ 80B2918 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r7, r0, r1 - ldrb r6, [r7, 0xA] - ldrb r5, [r7, 0xC] - adds r0, r4, 0 - bl sub_80B252C - cmp r0, 0x1 - beq _080B29E6 - adds r0, r4, 0 - bl sub_80B24F8 - cmp r0, 0x1 - beq _080B29E6 - ldr r4, =0x020375f0 - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_80B2478 - adds r1, r0, 0 - strh r1, [r4] - lsls r0, r1, 16 - lsrs r2, r0, 16 - cmp r2, 0 - beq _080B29E6 - subs r0, r1, 0x3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _080B297C - bl sub_800AC34 - bl textbox_close - ldr r0, =sub_80B2CB0 - b _080B29E4 - .pool -_080B297C: - cmp r2, 0x7 - beq _080B2984 - cmp r2, 0x9 - bne _080B2994 -_080B2984: - bl sub_80097E8 - bl textbox_close - ldr r0, =sub_80B2CB0 - b _080B29E4 - .pool -_080B2994: - bl sub_800ABAC - ldr r4, =0x03005db8 - strb r0, [r4] - bl link_get_multiplayer_id - ldr r1, =0x03005db4 - strb r0, [r1] - ldrb r0, [r4] - bl sub_800AA04 - ldr r4, =0x020228c4 - adds r0, r4, 0 - bl sub_80C30A4 - ldr r0, =0x0203cef8 - mov r8, r0 - ldrb r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x02024488 - adds r0, r5 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - adds r1, r4, 0 - adds r1, 0x54 - strh r0, [r1] - mov r1, r8 - ldrb r0, [r1, 0x1] - muls r0, r6 - adds r0, r5 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - adds r4, 0x56 - strh r0, [r4] - ldr r0, =sub_80B2C30 -_080B29E4: - str r0, [r7] -_080B29E6: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B2918 - - thumb_func_start sub_80B2A08 -sub_80B2A08: @ 80B2A08 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r7, 0 - bl sub_80B24F8 - cmp r0, 0x1 - beq _080B2ACE - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0x4 - bne _080B2A38 - bl sub_800A064 - cmp r0, 0 - bne _080B2A4A - bl sub_800AC34 - b _080B2A4E - .pool -_080B2A38: - cmp r0, 0x3 - bne _080B2A42 - bl sub_800AC34 - b _080B2A4E -_080B2A42: - cmp r0, 0x7 - beq _080B2A4A - cmp r0, 0x9 - bne _080B2A6C -_080B2A4A: - bl sub_80097E8 -_080B2A4E: - bl textbox_close - ldr r0, =0x03005e00 - lsls r1, r7, 2 - adds r1, r7 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80B2CB0 - str r0, [r1] - b _080B2ACE - .pool -_080B2A6C: - bl sub_800ABAC - ldr r4, =0x03005db8 - strb r0, [r4] - bl link_get_multiplayer_id - ldr r1, =0x03005db4 - strb r0, [r1] - ldrb r0, [r4] - bl sub_800AA04 - ldr r4, =0x020228c4 - adds r0, r4, 0 - bl sub_80C30A4 - ldr r0, =0x0203cef8 - mov r8, r0 - ldrb r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x02024488 - adds r0, r5 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - adds r1, r4, 0 - adds r1, 0x54 - strh r0, [r1] - mov r1, r8 - ldrb r0, [r1, 0x1] - muls r0, r6 - adds r0, r5 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - adds r4, 0x56 - strh r0, [r4] - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80B2C30 - str r1, [r0] - movs r0, 0x2 - bl sub_800A4D8 -_080B2ACE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B2A08 - - thumb_func_start sub_80B2AF4 -sub_80B2AF4: @ 80B2AF4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - str r0, [sp] - str r1, [sp, 0x4] - movs r2, 0 - movs r7, 0 - ldr r1, =0x02021cc4 - movs r0, 0xFF - strb r0, [r1] - ldr r1, =0x02021dc4 - movs r0, 0x1 - negs r0, r0 - strb r0, [r1] - movs r1, 0 - movs r0, 0xB - mov r10, r0 - ldr r0, =gSpeciesNames - mov r9, r0 -_080B2B20: - lsls r0, r1, 1 - adds r1, 0x1 - mov r8, r1 - ldr r1, [sp] - adds r4, r0, r1 - ldr r5, [sp, 0x4] - movs r6, 0x1 -_080B2B2E: - ldrh r0, [r4] - ldrh r1, [r5] - cmp r0, r1 - bne _080B2B5E - cmp r7, 0 - bne _080B2B48 - mov r1, r10 - muls r1, r0 - add r1, r9 - ldr r0, =0x02021cc4 - bl CopyString - movs r2, 0x1 -_080B2B48: - cmp r7, 0x1 - bne _080B2B5C - ldrh r0, [r4] - mov r1, r10 - muls r1, r0 - add r1, r9 - ldr r0, =0x02021dc4 - bl CopyString - movs r2, 0x1 -_080B2B5C: - adds r7, 0x1 -_080B2B5E: - adds r5, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _080B2B2E - mov r1, r8 - cmp r1, 0x1 - ble _080B2B20 - ldr r0, =0x020375e2 - strh r7, [r0] - adds r0, r2, 0 - 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_80B2AF4 - - thumb_func_start task_map_chg_seq_0807EC34 -task_map_chg_seq_0807EC34: @ 80B2B94 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - ldr r1, =0x02039b58 - ldrh r0, [r5] - cmp r0, 0x1 - bne _080B2C10 - ldr r0, =0x020229c6 - ldrh r2, [r0] - ldr r0, =0x00002266 - cmp r2, r0 - beq _080B2BB2 - adds r0, 0x11 - cmp r2, r0 - bne _080B2BEC -_080B2BB2: - adds r0, r1, 0 - adds r0, 0x54 - adds r1, 0xB8 - bl sub_80B2AF4 - cmp r0, 0 - beq _080B2BEC - movs r0, 0xB - strh r0, [r5] - bl sub_800AC34 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80B2CB0 - str r1, [r0] - b _080B2C22 - .pool -_080B2BEC: - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x12] - bl sub_80B241C - bl script_env_2_enable_and_set_ctx_running - lsls r0, r4, 24 - lsrs r0, 24 - bl DestroyTask - b _080B2C22 - .pool -_080B2C10: - bl sub_800AC34 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80B2CB0 - str r0, [r1] -_080B2C22: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task_map_chg_seq_0807EC34 - - thumb_func_start sub_80B2C30 -sub_80B2C30: @ 80B2C30 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - bl sub_80B24F8 - cmp r0, 0x1 - beq _080B2C9C - bl sub_800A550 - adds r4, r0, 0 - bl sub_800A9A8 - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _080B2C9C - movs r4, 0 - ldr r6, =0x020229e8 - b _080B2C7E - .pool -_080B2C5C: - movs r0, 0x64 - muls r0, r4 - ldr r1, =0x02039b58 - adds r0, r1 - lsls r1, r4, 8 - ldr r2, =0x020223c4 - adds r1, r2 - lsls r2, r4, 3 - subs r2, r4 - lsls r2, 2 - adds r2, r6 - ldrb r2, [r2] - bl sub_80C3120 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_080B2C7E: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bcc _080B2C5C - movs r0, 0 - bl sub_800B330 - bl sub_800A5B4 - ldr r0, =0x020375f0 - adds r1, r5, 0 - bl task_map_chg_seq_0807EC34 -_080B2C9C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B2C30 - - thumb_func_start sub_80B2CB0 -sub_80B2CB0: @ 80B2CB0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _080B2CDE - ldr r0, =0x03005e00 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - ldrh r0, [r4, 0x12] - bl sub_80B241C - bl script_env_2_enable_and_set_ctx_running - ldrb r0, [r4, 0x12] - bl RemoveWindow - adds r0, r5, 0 - bl DestroyTask -_080B2CDE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B2CB0 - - thumb_func_start sub_80B2CEC -sub_80B2CEC: @ 80B2CEC - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =0x020375f0 - movs r0, 0x5 - strh r0, [r1] - ldr r0, =0x03005e00 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - ldrh r0, [r4, 0x12] - bl sub_80B241C - bl sub_8098374 - ldrb r0, [r4, 0x12] - bl RemoveWindow - bl script_env_2_enable_and_set_ctx_running - adds r0, r5, 0 - bl DestroyTask - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B2CEC - - thumb_func_start sub_80B2D2C -sub_80B2D2C: @ 80B2D2C - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =0x020375f0 - movs r0, 0x6 - strh r0, [r1] - ldr r0, =0x03005e00 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - ldrh r0, [r4, 0x12] - bl sub_80B241C - ldrb r0, [r4, 0x12] - bl RemoveWindow - bl textbox_close - bl script_env_2_enable_and_set_ctx_running - adds r0, r5, 0 - bl DestroyTask - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B2D2C - - thumb_func_start sub_80B2D6C -sub_80B2D6C: @ 80B2D6C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r2, r1, r2 - ldrh r0, [r2, 0x10] - adds r0, 0x1 - strh r0, [r2, 0x10] - lsls r0, 16 - movs r1, 0x96 - lsls r1, 18 - cmp r0, r1 - bgt _080B2D94 - movs r0, 0 - b _080B2D9A - .pool -_080B2D94: - ldr r0, =sub_80B2D2C - str r0, [r2] - movs r0, 0x1 -_080B2D9A: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B2D6C - - thumb_func_start sub_80B2DA4 -sub_80B2DA4: @ 80B2DA4 - push {r4,lr} - movs r3, 0x2 - movs r2, 0x2 - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0x2 - beq _080B2DDC - cmp r0, 0x2 - bgt _080B2DC0 - cmp r0, 0x1 - beq _080B2DCA - b _080B2E34 - .pool -_080B2DC0: - cmp r0, 0x5 - beq _080B2DEC - cmp r0, 0x9 - beq _080B2E00 - b _080B2E34 -_080B2DCA: - movs r3, 0x2 - ldr r1, =0x020229c6 - ldr r4, =0x00002233 - b _080B2E30 - .pool -_080B2DDC: - movs r3, 0x2 - ldr r1, =0x020229c6 - ldr r4, =0x00002244 - b _080B2E30 - .pool -_080B2DEC: - movs r3, 0x4 - movs r2, 0x4 - ldr r1, =0x020229c6 - ldr r4, =0x00002255 - b _080B2E30 - .pool -_080B2E00: - movs r3, 0x2 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _080B2E2C - ldr r1, =0x020229c6 - ldr r4, =0x00002266 - b _080B2E30 - .pool -_080B2E2C: - ldr r1, =0x020229c6 - ldr r4, =0x00002277 -_080B2E30: - adds r0, r4, 0 - strh r0, [r1] -_080B2E34: - adds r0, r3, 0 - adds r1, r2, 0 - bl sub_80B236C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B2DA4 - - thumb_func_start sub_80B2E4C -sub_80B2E4C: @ 80B2E4C - push {lr} - ldr r1, =0x020229c6 - ldr r2, =0x00001133 - adds r0, r2, 0 - strh r0, [r1] - ldr r1, =0x02022fec - movs r0, 0 - str r0, [r1] - movs r0, 0x2 - movs r1, 0x2 - bl sub_80B236C - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B2E4C - - thumb_func_start sub_80B2E74 -sub_80B2E74: @ 80B2E74 - push {lr} - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r1, =0x020229c6 - ldr r2, =0x00003311 - adds r0, r2, 0 - strh r0, [r1] - ldr r1, =0x02022fec - movs r0, 0 - str r0, [r1] - movs r0, 0x2 - movs r1, 0x4 - bl sub_80B236C - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B2E74 - - thumb_func_start sub_80B2EA8 -sub_80B2EA8: @ 80B2EA8 - push {r4,lr} - ldr r4, =sub_80B2EE4 - adds r0, r4, 0 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - bne _080B2ED4 - adds r0, r4, 0 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x8] -_080B2ED4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B2EA8 - - thumb_func_start sub_80B2EE4 -sub_80B2EE4: @ 80B2EE4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _080B2F0C - cmp r0, 0x1 - beq _080B2FB4 - b _080B2FC6 - .pool -_080B2F0C: - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0x1 - bne _080B2FA8 - movs r7, 0 - movs r0, 0 - mov r8, r0 - mov r9, r0 - bl sub_8009FCC - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - cmp r7, r5 - bge _080B2F74 - ldr r0, =0x020229e8 - ldrb r2, [r0] - ldrh r3, [r0, 0x1A] - subs r1, r2, 0x1 - mov r12, r0 - cmp r1, 0x1 - bhi _080B2F4A - b _080B2F6E - .pool -_080B2F44: - movs r1, 0x1 - mov r8, r1 - b _080B2F56 -_080B2F4A: - cmp r2, 0x3 - bne _080B2F56 - cmp r3, 0x1 - bne _080B2F56 - movs r0, 0x1 - mov r9, r0 -_080B2F56: - adds r4, 0x1 - cmp r4, r5 - bge _080B2F74 - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - add r0, r12 - ldrb r2, [r0] - ldrh r3, [r0, 0x1A] - subs r0, r2, 0x1 - cmp r0, 0x1 - bhi _080B2F4A -_080B2F6E: - cmp r3, 0x1 - bne _080B2F44 - movs r7, 0x1 -_080B2F74: - mov r1, r8 - cmp r1, 0 - beq _080B2F82 - mov r0, r9 - cmp r0, 0 - beq _080B2F82 - movs r7, 0x1 -_080B2F82: - cmp r7, 0 - beq _080B2FA8 - ldr r1, =0x020375f0 - movs r0, 0xC - strh r0, [r1] - bl sub_800AD10 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1 - strh r1, [r0, 0x8] - b _080B2FC6 - .pool -_080B2FA8: - bl script_env_2_enable_and_set_ctx_running - adds r0, r6, 0 - bl DestroyTask - b _080B2FC6 -_080B2FB4: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _080B2FC6 - bl script_env_2_enable_and_set_ctx_running - adds r0, r6, 0 - bl DestroyTask -_080B2FC6: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B2EE4 - - thumb_func_start sub_80B2FD8 -sub_80B2FD8: @ 80B2FD8 - push {lr} - ldr r1, =0x020229c6 - ldr r2, =0x00004411 - adds r0, r2, 0 - strh r0, [r1] - ldr r1, =0x02022fec - movs r0, 0 - str r0, [r1] - movs r0, 0x2 - movs r1, 0x4 - bl sub_80B236C - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B2FD8 - - thumb_func_start sub_80B3000 -sub_80B3000: @ 80B3000 - push {lr} - ldr r1, =0x020229c6 - ldr r2, =0x00006601 - adds r0, r2, 0 - strh r0, [r1] - ldr r1, =0x02022fec - movs r0, 0 - str r0, [r1] - movs r0, 0x4 - movs r1, 0x4 - bl sub_80B236C - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B3000 - - thumb_func_start sub_80B3028 -sub_80B3028: @ 80B3028 - push {lr} - ldr r1, =0x020229c6 - ldr r2, =0x00006602 - adds r0, r2, 0 - strh r0, [r1] - ldr r1, =0x02022fec - movs r0, 0 - str r0, [r1] - movs r0, 0x2 - movs r1, 0x4 - bl sub_80B236C - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B3028 - - thumb_func_start sub_80B3050 -sub_80B3050: @ 80B3050 - push {lr} - ldr r0, =sub_80B3144 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - beq _080B3068 - movs r0, 0xFF - b _080B3134 - .pool -_080B3068: - ldr r0, =0x020375e0 - ldrh r0, [r0] - subs r0, 0x1 - cmp r0, 0x8 - bhi _080B3128 - lsls r0, 2 - ldr r1, =_080B3084 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080B3084: - .4byte _080B30A8 - .4byte _080B30B8 - .4byte _080B3110 - .4byte _080B3120 - .4byte _080B30C8 - .4byte _080B3128 - .4byte _080B3128 - .4byte _080B3128 - .4byte _080B30D8 -_080B30A8: - ldr r1, =0x020229c6 - ldr r2, =0x00002233 - b _080B3124 - .pool -_080B30B8: - ldr r1, =0x020229c6 - ldr r2, =0x00002244 - b _080B3124 - .pool -_080B30C8: - ldr r1, =0x020229c6 - ldr r2, =0x00002255 - b _080B3124 - .pool -_080B30D8: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _080B3100 - ldr r1, =0x020229c6 - ldr r2, =0x00002266 - b _080B3124 - .pool -_080B3100: - ldr r1, =0x020229c6 - ldr r2, =0x00002277 - b _080B3124 - .pool -_080B3110: - ldr r1, =0x020229c6 - ldr r2, =0x00001111 - b _080B3124 - .pool -_080B3120: - ldr r1, =0x020229c6 - ldr r2, =0x00003322 -_080B3124: - adds r0, r2, 0 - strh r0, [r1] -_080B3128: - ldr r0, =sub_80B3144 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 -_080B3134: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B3050 - - thumb_func_start sub_80B3144 -sub_80B3144: @ 80B3144 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r4, r1, r0 - movs r3, 0 - ldrsh r2, [r4, r3] - cmp r2, 0 - bne _080B3178 - bl sub_8009734 - bl sub_800A2BC - ldr r0, =task00_08081A90 - movs r1, 0x50 - bl CreateTask - b _080B3184 - .pool -_080B3178: - cmp r2, 0x9 - ble _080B3184 - subs r0, 0x8 - adds r0, r1, r0 - ldr r1, =sub_80B3194 - str r1, [r0] -_080B3184: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B3144 - - thumb_func_start sub_80B3194 -sub_80B3194: @ 80B3194 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl sub_800ABAC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _080B31DA - bl sub_800ABBC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B31CC - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80B31E8 - b _080B31D8 - .pool -_080B31CC: - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80B3220 -_080B31D8: - str r0, [r1] -_080B31DA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B3194 - - thumb_func_start sub_80B31E8 -sub_80B31E8: @ 80B31E8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_800AA48 - adds r4, r0, 0 - bl sub_800ABAC - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _080B3212 - bl sub_800A620 - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80B3220 - str r0, [r1] -_080B3212: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B31E8 - - thumb_func_start sub_80B3220 -sub_80B3220: @ 80B3220 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080B3248 - bl sub_800A23C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B3248 - bl sub_800AB18 - bl sub_8009F18 - adds r0, r4, 0 - bl DestroyTask -_080B3248: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B3220 - - thumb_func_start sub_80B3254 -sub_80B3254: @ 80B3254 - push {lr} - bl sub_809FF80 - pop {r0} - bx r0 - thumb_func_end sub_80B3254 - - thumb_func_start sub_80B3260 -sub_80B3260: @ 80B3260 - push {lr} - cmp r0, 0x2 - beq _080B3284 - cmp r0, 0x2 - bgt _080B3270 - cmp r0, 0x1 - beq _080B327A - b _080B32A6 -_080B3270: - cmp r0, 0x5 - beq _080B3290 - cmp r0, 0x9 - beq _080B32A0 - b _080B32A6 -_080B327A: - ldr r1, =0x02022fec - movs r0, 0xA - b _080B32A4 - .pool -_080B3284: - ldr r1, =0x02022fec - movs r0, 0xB - b _080B32A4 - .pool -_080B3290: - bl sub_80F94E8 - ldr r1, =0x02022fec - movs r0, 0x4B - b _080B32A4 - .pool -_080B32A0: - ldr r1, =0x02022fec - ldr r0, =0x0000014b -_080B32A4: - str r0, [r1] -_080B32A6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B3260 - - thumb_func_start sub_80B32B4 -sub_80B32B4: @ 80B32B4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x5 - bhi _080B33A0 - lsls r0, 2 - ldr r1, =_080B32E0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080B32E0: - .4byte _080B32F8 - .4byte _080B3318 - .4byte _080B3328 - .4byte _080B3338 - .4byte _080B333E - .4byte _080B3354 -_080B32F8: - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r1, =0x020229c6 - ldr r2, =0x00002211 - adds r0, r2, 0 - strh r0, [r1] - bl sub_8009FAC - b _080B3346 - .pool -_080B3318: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - b _080B3342 - .pool -_080B3328: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _080B33A0 - b _080B3346 -_080B3338: - bl sub_800AC34 - b _080B3346 -_080B333E: - ldr r0, =0x03003124 - ldrb r0, [r0] -_080B3342: - cmp r0, 0 - bne _080B33A0 -_080B3346: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080B33A0 - .pool -_080B3354: - ldr r0, =0x020229e8 - ldr r0, [r0, 0x4] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080B3370 - ldr r0, =0x000001dd - bl current_map_music_set__default_for_battle - b _080B3378 - .pool -_080B3370: - movs r0, 0xEE - lsls r0, 1 - bl current_map_music_set__default_for_battle -_080B3378: - ldr r0, =0x020375e0 - ldrh r0, [r0] - bl sub_80B3260 - bl overworld_free_bg_tilemaps - ldr r1, =0x02038bca - movs r2, 0x80 - lsls r2, 4 - adds r0, r2, 0 - strh r0, [r1] - ldr r0, =sub_8036760 - bl SetMainCallback2 - ldr r1, =0x030022c0 - ldr r0, =sub_80B360C - str r0, [r1, 0x8] - adds r0, r5, 0 - bl DestroyTask -_080B33A0: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B32B4 - - thumb_func_start sub_80B33BC -sub_80B33BC: @ 80B33BC - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r6, r0, r1 - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0x7 - bls _080B33D6 - b _080B3532 -_080B33D6: - lsls r0, 2 - ldr r1, =_080B33E8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080B33E8: - .4byte _080B3408 - .4byte _080B342C - .4byte _080B3444 - .4byte _080B3458 - .4byte _080B34B0 - .4byte _080B34C4 - .4byte _080B34CE - .4byte _080B34DE -_080B3408: - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r0, =0x020229c6 - ldr r2, =0x00002211 - adds r1, r2, 0 - strh r1, [r0] - bl sub_8009FAC - movs r0, 0x1 - strh r0, [r6] - b _080B3532 - .pool -_080B342C: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080B343A - b _080B3532 -_080B343A: - movs r0, 0x2 - strh r0, [r6] - b _080B3532 - .pool -_080B3444: - ldr r1, =0x020229cc - movs r0, 0 - movs r2, 0x1C - bl link_0800A448 - movs r0, 0x3 - strh r0, [r6] - b _080B3532 - .pool -_080B3458: - bl sub_800A550 - adds r4, r0, 0 - bl sub_800A9D8 - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _080B3532 - movs r4, 0 - ldr r5, =0x020229e8 - b _080B349A - .pool -_080B3474: - lsls r1, r4, 8 - ldr r2, =0x020223c4 - adds r0, r5, 0 - adds r1, r2 - ldm r1!, {r2,r3,r7} - stm r0!, {r2,r3,r7} - ldm r1!, {r2,r3,r7} - stm r0!, {r2,r3,r7} - ldr r1, [r1] - str r1, [r0] - adds r0, r5, 0 - bl sub_800B524 - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_800A5EC - adds r5, 0x1C - adds r4, 0x1 -_080B349A: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - blt _080B3474 - movs r0, 0x4 - strh r0, [r6] - b _080B3532 - .pool -_080B34B0: - ldrh r0, [r6, 0x2] - adds r0, 0x1 - strh r0, [r6, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _080B3532 - movs r0, 0x5 - strh r0, [r6] - b _080B3532 -_080B34C4: - bl sub_800ADF8 - movs r0, 0x6 - strh r0, [r6] - b _080B3532 -_080B34CE: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080B3532 - movs r0, 0x7 - strh r0, [r6] - b _080B3532 -_080B34DE: - ldr r0, =0x020229e8 - ldr r0, [r0, 0x4] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080B34FC - ldr r0, =0x000001dd - bl current_map_music_set__default_for_battle - b _080B3504 - .pool -_080B34FC: - movs r0, 0xEE - lsls r0, 1 - bl current_map_music_set__default_for_battle -_080B3504: - ldr r1, =0x020229e8 - ldr r0, =0x00002211 - str r0, [r1, 0x14] - ldr r0, =0x020375e0 - ldrh r0, [r0] - bl sub_80B3260 - bl overworld_free_bg_tilemaps - ldr r1, =0x02038bca - movs r3, 0x80 - lsls r3, 4 - adds r0, r3, 0 - strh r0, [r1] - ldr r0, =sub_8036760 - bl SetMainCallback2 - ldr r1, =0x030022c0 - ldr r0, =sub_80B360C - str r0, [r1, 0x8] - adds r0, r4, 0 - bl DestroyTask -_080B3532: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B33BC - - thumb_func_start sub_80B3554 -sub_80B3554: @ 80B3554 - push {r4,lr} - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080B35E0 - cmp r0, 0x1 - bgt _080B3574 - cmp r0, 0 - beq _080B357A - b _080B35FE - .pool -_080B3574: - cmp r0, 0x2 - beq _080B35F8 - b _080B35FE -_080B357A: - bl sub_8009FCC - lsls r0, 24 - lsrs r3, r0, 24 - movs r4, 0 - movs r2, 0 - cmp r4, r3 - bge _080B35AC - ldr r1, =0x020229e8 - ldrb r0, [r1] - subs r0, 0x4 - cmp r0, 0x1 - bls _080B35B0 -_080B3594: - adds r2, 0x1 - cmp r2, r3 - bge _080B35AC - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0] - subs r0, 0x4 - cmp r0, 0x1 - bhi _080B3594 - movs r4, 0x1 -_080B35AC: - cmp r4, 0 - beq _080B35C8 -_080B35B0: - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0x2 - strb r1, [r0] - b _080B35FE - .pool -_080B35C8: - bl sub_800AC34 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - b _080B35FE - .pool -_080B35E0: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _080B35FE - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - b _080B35FE - .pool -_080B35F8: - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 -_080B35FE: - bl RunTasks - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B3554 - - thumb_func_start sub_80B360C -sub_80B360C: @ 80B360C - push {r4,r5,lr} - ldr r2, =0x02022fec - ldr r0, [r2] - movs r1, 0x21 - negs r1, r1 - ands r0, r1 - str r0, [r2] - bl call_map_music_set_to_zero - bl copy_player_party_from_sav1 - bl copy_bags_and_unk_data_to_save_blocks - bl sub_813BF10 - ldr r0, =0x020375e0 - ldrh r0, [r0] - subs r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _080B36B2 - ldr r0, =0x03005db4 - ldrb r0, [r0] - movs r5, 0x1 - eors r0, r5 - bl sub_813C2A0 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _080B36B2 - ldr r0, =0x0202433a - ldrb r0, [r0] - cmp r0, 0x1 - beq _080B3670 - cmp r0, 0x2 - beq _080B3694 - b _080B36B2 - .pool -_080B3670: - ldr r4, =0x020229e8 - bl link_get_multiplayer_id - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r4, 0x4 - adds r1, r4 - ldr r1, [r1] - movs r0, 0 - bl sub_801B990 - b _080B36B2 - .pool -_080B3694: - ldr r4, =0x020229e8 - bl link_get_multiplayer_id - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r4, 0x4 - adds r1, r4 - ldr r1, [r1] - movs r0, 0x1 - bl sub_801B990 -_080B36B2: - bl InUnionRoom - cmp r0, 0x1 - bne _080B36CC - ldr r1, =0x030022c0 - ldr r0, =sub_80B3554 - b _080B36D0 - .pool -_080B36CC: - ldr r1, =0x030022c0 - ldr r0, =c2_8056854 -_080B36D0: - str r0, [r1, 0x8] - ldr r0, =sub_80A0514 - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B360C - - thumb_func_start sub_80B36EC -sub_80B36EC: @ 80B36EC - push {lr} - ldr r0, =0x020375e0 - ldrh r1, [r0] - subs r0, r1, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bls _080B3706 - adds r0, r1, 0 - cmp r0, 0x5 - beq _080B3706 - cmp r0, 0x9 - bne _080B370E -_080B3706: - bl copy_player_party_from_sav1 - bl copy_bags_and_unk_data_to_save_blocks -_080B370E: - movs r0, 0x7F - bl copy_saved_warp2_bank_and_enter_x_to_warp1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B36EC - - thumb_func_start sub_80B371C -sub_80B371C: @ 80B371C - push {lr} - bl sub_80872B0 - pop {r0} - bx r0 - thumb_func_end sub_80B371C - - thumb_func_start sub_80B3728 -sub_80B3728: @ 80B3728 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _080B376C - cmp r0, 0x1 - bgt _080B3750 - cmp r0, 0 - beq _080B375A - b _080B37CC - .pool -_080B3750: - cmp r0, 0x2 - beq _080B378C - cmp r0, 0x3 - beq _080B37B8 - b _080B37CC -_080B375A: - ldr r0, =gUnknown_08278091 - bl box_related_two__2 - movs r0, 0x1 - strh r0, [r5, 0x8] - b _080B37CC - .pool -_080B376C: - bl sub_809833C - lsls r0, 24 - cmp r0, 0 - beq _080B37CC - bl sub_8087288 - ldr r0, =0x020375e2 - ldrb r0, [r0] - bl sub_8009628 - movs r0, 0x2 - strh r0, [r5, 0x8] - b _080B37CC - .pool -_080B378C: - bl sub_8087214 - cmp r0, 0x1 - beq _080B379E - cmp r0, 0x1 - bcc _080B37CC - cmp r0, 0x2 - beq _080B37B2 - b _080B37CC -_080B379E: - bl textbox_close - movs r0, 0 - strh r0, [r5, 0x8] - bl sub_80872C4 - adds r0, r4, 0 - bl SwitchTaskToFollowupFunc - b _080B37CC -_080B37B2: - movs r0, 0x3 - strh r0, [r5, 0x8] - b _080B37CC -_080B37B8: - bl sub_808729C - movs r0, 0x1 - bl sub_8197AE8 - adds r0, r4, 0 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running -_080B37CC: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80B3728 - - thumb_func_start sub_80B37D4 -sub_80B37D4: @ 80B37D4 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =sub_80B3728 - adds r0, r4, 0 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - adds r2, r5, 0 - bl SetTaskFuncWithFollowupFunc - bl script_env_2_set_ctx_paused - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B37D4 - - thumb_func_start sub_80B37FC -sub_80B37FC: @ 80B37FC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080B3840 - cmp r0, 0x1 - bgt _080B3824 - cmp r0, 0 - beq _080B382E - b _080B3884 - .pool -_080B3824: - cmp r0, 0x2 - beq _080B3854 - cmp r0, 0x3 - beq _080B3870 - b _080B3884 -_080B382E: - bl script_env_2_enable - movs r0, 0x1 - movs r1, 0 - bl fade_screen - bl sub_8009FAC - b _080B3864 -_080B3840: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080B3884 - b _080B3864 - .pool -_080B3854: - ldr r1, =0x02032298 - movs r0, 0 - strb r0, [r1] - strb r0, [r1, 0x1] - bl m4aMPlayAllStop - bl sub_800AC34 -_080B3864: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080B3884 - .pool -_080B3870: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _080B3884 - ldr r0, =sub_80773AC - bl SetMainCallback2 - adds r0, r5, 0 - bl DestroyTask -_080B3884: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B37FC - - thumb_func_start sub_80B3894 -sub_80B3894: @ 80B3894 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080B38D8 - cmp r0, 0x1 - bgt _080B38BC - cmp r0, 0 - beq _080B38C6 - b _080B391C - .pool -_080B38BC: - cmp r0, 0x2 - beq _080B38EC - cmp r0, 0x3 - beq _080B3908 - b _080B391C -_080B38C6: - bl script_env_2_enable - movs r0, 0x1 - movs r1, 0 - bl fade_screen - bl Rfu_set_zero - b _080B38FC -_080B38D8: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080B391C - b _080B38FC - .pool -_080B38EC: - ldr r1, =0x02032298 - movs r0, 0 - strb r0, [r1] - strb r0, [r1, 0x1] - bl m4aMPlayAllStop - bl sub_800ADF8 -_080B38FC: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _080B391C - .pool -_080B3908: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080B391C - bl sub_8013F78 - adds r0, r5, 0 - bl DestroyTask -_080B391C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80B3894 - - thumb_func_start sub_80B3924 -sub_80B3924: @ 80B3924 - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _080B3940 - ldr r0, =sub_80B3894 - bl sub_80B37D4 - b _080B3946 - .pool -_080B3940: - ldr r0, =sub_80B37FC - bl sub_80B37D4 -_080B3946: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B3924 - - thumb_func_start sub_80B3950 -sub_80B3950: @ 80B3950 - push {lr} - ldr r0, =sub_80B37FC - movs r1, 0x50 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B3950 - - thumb_func_start nullsub_37 -nullsub_37: @ 80B3964 - bx lr - thumb_func_end nullsub_37 - - thumb_func_start sub_80B3968 -sub_80B3968: @ 80B3968 - push {lr} - ldr r1, =0x020229c6 - ldr r2, =0x00002211 - adds r0, r2, 0 - strh r0, [r1] - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _080B3994 - ldr r0, =sub_80B33BC - bl sub_80B37D4 - b _080B399A - .pool -_080B3994: - ldr r0, =sub_80B32B4 - bl sub_80B37D4 -_080B399A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B3968 - - thumb_func_start sub_80B39A4 -sub_80B39A4: @ 80B39A4 - push {lr} - ldr r0, =sub_80B3728 - movs r1, 0x50 - bl CreateTask - bl script_env_2_set_ctx_paused - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B39A4 - - thumb_func_start sp02A_crash_sound -sp02A_crash_sound: @ 80B39BC - push {lr} - ldr r0, =0x020375e4 - ldrb r0, [r0] - ldr r1, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl sub_80C4E74 - pop {r0} - bx r0 - .pool - thumb_func_end sp02A_crash_sound - - thumb_func_start sub_80B39D4 -sub_80B39D4: @ 80B39D4 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x020375e4 - strh r4, [r0] - ldr r0, =0x02021cc4 - lsls r1, r4, 3 - subs r1, r4 - lsls r1, 2 - ldr r2, =0x020229f0 - adds r1, r2 - bl CopyString - adds r0, r4, 0 - bl sub_80C4904 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _080B3A28 - ldr r0, =0x02021dc4 - ldr r2, =gUnknown_0855059C - subs r1, 0x1 - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl CopyString - movs r0, 0x1 - b _080B3A2A - .pool -_080B3A28: - movs r0, 0 -_080B3A2A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B39D4 - - thumb_func_start task00_08081A90 -task00_08081A90: @ 80B3A30 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r0, r1 - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - lsls r1, 16 - movs r0, 0x96 - lsls r0, 17 - cmp r1, r0 - ble _080B3A62 - bl sub_80097E8 - ldr r0, =c2_800ACD4 - bl SetMainCallback2 - adds r0, r4, 0 - bl DestroyTask -_080B3A62: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _080B3AA6 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _080B3AA0 - bl sub_800AA60 - lsls r0, 24 - cmp r0, 0 - bne _080B3A86 - bl sub_80097E8 - ldr r0, =c2_800ACD4 - bl SetMainCallback2 -_080B3A86: - adds r0, r4, 0 - bl DestroyTask - b _080B3AA6 - .pool -_080B3AA0: - adds r0, r5, 0 - bl DestroyTask -_080B3AA6: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end task00_08081A90 - - thumb_func_start sub_80B3AAC -sub_80B3AAC: @ 80B3AAC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _080B3AC4 - bl script_env_2_enable_and_set_ctx_running - adds r0, r4, 0 - bl DestroyTask -_080B3AC4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B3AAC - - thumb_func_start sub_80B3AD0 -sub_80B3AD0: @ 80B3AD0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_800AC34 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80B3AAC - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B3AD0 - - thumb_func_start sub_80B3AF8 -sub_80B3AF8: @ 80B3AF8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _080B3B54 - cmp r0, 0x1 - bgt _080B3B20 - cmp r0, 0 - beq _080B3B2A - b _080B3BB8 - .pool -_080B3B20: - cmp r0, 0x2 - beq _080B3B68 - cmp r0, 0x3 - beq _080B3B9E - b _080B3BB8 -_080B3B2A: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _080B3B40 - adds r0, r4, 0 - bl DestroyTask - b _080B3BB8 - .pool -_080B3B40: - bl sub_8009734 - ldr r0, =task00_08081A90 - movs r1, 0x1 - bl CreateTask - b _080B3B96 - .pool -_080B3B54: - ldrh r0, [r5, 0x2] - adds r0, 0x1 - strh r0, [r5, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB - ble _080B3BB8 - movs r0, 0 - strh r0, [r5, 0x2] - b _080B3B96 -_080B3B68: - bl sub_800ABAC - adds r4, r0, 0 - bl sub_800AA48 - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bcc _080B3BB8 - bl sub_800ABBC - lsls r0, 24 - cmp r0, 0 - beq _080B3B96 - ldrh r0, [r5, 0x2] - adds r0, 0x1 - strh r0, [r5, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1E - ble _080B3BB8 - bl sub_800A620 -_080B3B96: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - b _080B3BB8 -_080B3B9E: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080B3BB8 - bl sub_800A23C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B3BB8 - adds r0, r4, 0 - bl DestroyTask -_080B3BB8: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B3AF8 - - thumb_func_start sub_80B3BC4 -sub_80B3BC4: @ 80B3BC4 - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _080B3BD6 - ldr r1, =0x020229c6 - ldr r2, =0x00002288 - adds r0, r2, 0 - strh r0, [r1] -_080B3BD6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B3BC4 - - thumb_func_start CheckForTrainersWantingBattle -@ bool8 CheckForTrainersWantingBattle() -CheckForTrainersWantingBattle: @ 80B3BE8 - push {r4-r7,lr} - ldr r0, =0x030060a8 - movs r1, 0 - strb r1, [r0] - ldr r0, =0x02038bfc - strb r1, [r0] - movs r4, 0 - ldr r6, =0x02037350 -_080B3BF8: - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - adds r1, r0, r6 - ldrb r0, [r1] - lsls r0, 31 - cmp r0, 0 - beq _080B3C38 - ldrb r0, [r1, 0x7] - cmp r0, 0x1 - beq _080B3C12 - cmp r0, 0x3 - bne _080B3C38 -_080B3C12: - adds r0, r4, 0 - bl CheckIfTrainerWantsBattle - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _080B3C42 - cmp r0, 0 - beq _080B3C38 - ldr r0, =0x030060a8 - ldrb r1, [r0] - adds r5, r0, 0 - cmp r1, 0x1 - bhi _080B3C88 - bl CheckPlayerPartySize - lsls r0, 24 - cmp r0, 0 - bne _080B3C42 -_080B3C38: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _080B3BF8 -_080B3C42: - ldr r0, =0x030060a8 - ldrb r4, [r0] - adds r5, r0, 0 - cmp r4, 0x1 - bne _080B3C88 - bl ResetTrainerOpponentIds - ldr r2, =0x03006090 - ldrb r0, [r5] - subs r0, 0x1 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, 0x4 - adds r1, r2 - ldr r1, [r1] - bl SingleTrainerWantsBattle - ldr r0, =0x030060ac - strb r4, [r0] - movs r0, 0x1 - b _080B3CF4 - .pool -_080B3C88: - ldrb r0, [r5] - cmp r0, 0x2 - bne _080B3CEC - bl ResetTrainerOpponentIds - movs r4, 0 - ldrb r5, [r5] - cmp r4, r5 - bcs _080B3CC6 - ldr r6, =0x03006090 - adds r7, r6, 0x4 - ldr r5, =0x02038bfc -_080B3CA0: - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 2 - adds r0, r1, r6 - ldrb r0, [r0] - adds r1, r7 - ldr r1, [r1] - bl TwoTrainersWantBattle - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - ldr r0, =0x030060a8 - ldrb r0, [r0] - cmp r4, r0 - bcc _080B3CA0 -_080B3CC6: - bl TwoTrainersWantBattleExecuteScript - ldr r1, =0x02038bfc - movs r0, 0 - strb r0, [r1] - ldr r1, =0x030060ac - movs r0, 0x1 - strb r0, [r1] - movs r0, 0x1 - b _080B3CF4 - .pool -_080B3CEC: - ldr r1, =0x030060ac - movs r0, 0 - strb r0, [r1] - movs r0, 0 -_080B3CF4: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end CheckForTrainersWantingBattle - - thumb_func_start CheckIfTrainerWantsBattle -@ u8 CheckIfTrainerWantsBattle(u8 trainerFieldObjectId) -CheckIfTrainerWantsBattle: @ 80B3D00 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x1 - mov r9, r0 - bl InTrainerHill - cmp r0, 0x1 - bne _080B3D1E - bl sub_81D62AC - b _080B3D24 -_080B3D1E: - adds r0, r5, 0 - bl GetFieldObjectScriptPointerByFieldObjectId -_080B3D24: - adds r7, r0, 0 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _080B3D3E - adds r0, r5, 0 - bl GetBattlePyramidTrainerFlag -_080B3D36: - lsls r0, 24 -_080B3D38: - cmp r0, 0 - beq _080B3D56 - b _080B3DE0 -_080B3D3E: - bl InTrainerHill - cmp r0, 0x1 - bne _080B3D4E - adds r0, r5, 0 - bl GetTrainerHillTrainerFlag - b _080B3D36 -_080B3D4E: - adds r0, r7, 0 - bl GetTrainerFlagFromScriptPointer - b _080B3D38 -_080B3D56: - lsls r4, r5, 3 - adds r0, r4, r5 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - bl CheckIfTrainerCanApproachPlayer - lsls r0, 24 - lsrs r6, r0, 24 - mov r8, r4 - cmp r6, 0 - beq _080B3DE0 - ldrb r0, [r7, 0x1] - cmp r0, 0x4 - beq _080B3D7C - cmp r0, 0x7 - beq _080B3D7C - cmp r0, 0x6 - bne _080B3D8A -_080B3D7C: - bl CheckPlayerPartySize - lsls r0, 24 - cmp r0, 0 - bne _080B3DE0 - movs r1, 0x2 - mov r9, r1 -_080B3D8A: - ldr r2, =0x03006090 - ldr r4, =0x030060a8 - ldrb r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r5, [r0] - ldrb r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r1, r2, 0x4 - adds r0, r1 - str r7, [r0] - ldrb r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r6, [r0, 0x1] - mov r1, r8 - adds r0, r1, r5 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - subs r1, r6, 0x1 - lsls r1, 24 - lsrs r1, 24 - bl TrainerApproachPlayer - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - mov r0, r9 - b _080B3DE2 - .pool -_080B3DE0: - movs r0, 0 -_080B3DE2: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end CheckIfTrainerWantsBattle - - thumb_func_start CheckIfTrainerCanApproachPlayer -@ u8 CheckIfTrainerCanApproachPlayer(struct npc_state *trainerFieldObject) -CheckIfTrainerCanApproachPlayer: @ 80B3DF0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r7, r0, 0 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - ldrb r0, [r7, 0x7] - mov r8, r4 - cmp r0, 0x1 - bne _080B3E50 - ldr r1, =gUnknown_0855072C - ldrb r0, [r7, 0x18] - lsls r0, 28 - lsrs r0, 26 - subs r0, 0x4 - adds r0, r1 - ldrb r1, [r7, 0x1D] - mov r2, sp - movs r3, 0 - ldrsh r2, [r2, r3] - movs r5, 0 - ldrsh r3, [r4, r5] - ldr r4, [r0] - adds r0, r7, 0 - bl _call_via_r4 - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r2, [r7, 0x18] - lsls r2, 28 - lsrs r2, 28 - adds r0, r7, 0 - adds r1, r6, 0 - bl CheckPathBetweenTrainerAndPlayer - lsls r0, 24 - lsrs r0, 24 - b _080B3E90 - .pool -_080B3E4C: - adds r0, r6, 0 - b _080B3E90 -_080B3E50: - movs r5, 0 -_080B3E52: - ldr r0, =gUnknown_0855072C - lsls r4, r5, 2 - adds r4, r0 - ldrb r1, [r7, 0x1D] - mov r0, sp - movs r6, 0 - ldrsh r2, [r0, r6] - mov r0, r8 - movs r6, 0 - ldrsh r3, [r0, r6] - ldr r4, [r4] - adds r0, r7, 0 - bl _call_via_r4 - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r4, 0 - bl CheckPathBetweenTrainerAndPlayer - lsls r0, 24 - cmp r0, 0 - bne _080B3E4C - adds r5, r4, 0 - cmp r5, 0x3 - bls _080B3E52 - movs r0, 0 -_080B3E90: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end CheckIfTrainerCanApproachPlayer - - thumb_func_start IsTrainerInRangeSouth -@ u8 IsTrainerInRangeSouth(struct npc_state *trainerFieldObject, u16 sightRange, u16 playerX, u16 playerY) -IsTrainerInRangeSouth: @ 80B3EA0 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r6, r1, 16 - lsls r3, 16 - lsrs r5, r3, 16 - movs r1, 0x10 - ldrsh r0, [r4, r1] - lsls r2, 16 - asrs r2, 16 - cmp r0, r2 - bne _080B3EDA - lsls r0, r5, 16 - asrs r2, r0, 16 - ldrh r3, [r4, 0x12] - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r2, r0 - ble _080B3EDA - adds r1, r0, 0 - lsls r0, r6, 16 - asrs r0, 16 - adds r1, r0 - cmp r2, r1 - bgt _080B3EDA - subs r0, r5, r3 - lsls r0, 24 - lsrs r0, 24 - b _080B3EDC -_080B3EDA: - movs r0, 0 -_080B3EDC: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end IsTrainerInRangeSouth - - thumb_func_start IsTrainerInRangeNorth -@ u8 IsTrainerInRangeNorth(struct npc_state *trainerFieldObject, u16 sightRange, u16 playerX, u16 playerY) -IsTrainerInRangeNorth: @ 80B3EE4 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r6, r1, 16 - lsls r3, 16 - lsrs r5, r3, 16 - movs r1, 0x10 - ldrsh r0, [r4, r1] - lsls r2, 16 - asrs r2, 16 - cmp r0, r2 - bne _080B3F1E - lsls r0, r5, 16 - asrs r2, r0, 16 - ldrh r3, [r4, 0x12] - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r2, r0 - bge _080B3F1E - adds r1, r0, 0 - lsls r0, r6, 16 - asrs r0, 16 - subs r1, r0 - cmp r2, r1 - blt _080B3F1E - subs r0, r3, r5 - lsls r0, 24 - lsrs r0, 24 - b _080B3F20 -_080B3F1E: - movs r0, 0 -_080B3F20: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end IsTrainerInRangeNorth - - thumb_func_start IsTrainerInRangeWest -@ u8 IsTrainerInRangeWest(struct npc_state *trainerFieldObject, u16 sightRange, u16 playerX, u16 playerY) -IsTrainerInRangeWest: @ 80B3F28 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r6, r1, 16 - lsls r2, 16 - lsrs r5, r2, 16 - movs r1, 0x12 - ldrsh r0, [r4, r1] - lsls r3, 16 - asrs r3, 16 - cmp r0, r3 - bne _080B3F62 - lsls r0, r5, 16 - asrs r3, r0, 16 - ldrh r2, [r4, 0x10] - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r3, r0 - bge _080B3F62 - adds r1, r0, 0 - lsls r0, r6, 16 - asrs r0, 16 - subs r1, r0 - cmp r3, r1 - blt _080B3F62 - subs r0, r2, r5 - lsls r0, 24 - lsrs r0, 24 - b _080B3F64 -_080B3F62: - movs r0, 0 -_080B3F64: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end IsTrainerInRangeWest - - thumb_func_start IsTrainerInRangeEast -@ u8 IsTrainerInRangeEast(struct npc_state *trainerFieldObject, u16 sightRange, u16 playerX, u16 playerY) -IsTrainerInRangeEast: @ 80B3F6C - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r6, r1, 16 - lsls r2, 16 - lsrs r5, r2, 16 - movs r1, 0x12 - ldrsh r0, [r4, r1] - lsls r3, 16 - asrs r3, 16 - cmp r0, r3 - bne _080B3FA6 - lsls r0, r5, 16 - asrs r3, r0, 16 - ldrh r2, [r4, 0x10] - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r3, r0 - ble _080B3FA6 - adds r1, r0, 0 - lsls r0, r6, 16 - asrs r0, 16 - adds r1, r0 - cmp r3, r1 - bgt _080B3FA6 - subs r0, r5, r2 - lsls r0, 24 - lsrs r0, 24 - b _080B3FA8 -_080B3FA6: - movs r0, 0 -_080B3FA8: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end IsTrainerInRangeEast - - thumb_func_start CheckPathBetweenTrainerAndPlayer -@ u8 CheckPathBetweenTrainerAndPlayer(struct npc_state *fieldObject, u8 a2, u8 direction) -CheckPathBetweenTrainerAndPlayer: @ 80B3FB0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - adds r6, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - lsls r2, 24 - lsrs r7, r2, 24 - cmp r1, 0 - beq _080B4056 - ldrh r1, [r6, 0x10] - mov r0, sp - strh r1, [r0] - ldrh r0, [r6, 0x12] - mov r4, sp - adds r4, 0x2 - strh r0, [r4] - adds r0, r7, 0 - mov r1, sp - adds r2, r4, 0 - bl MoveCoords - movs r5, 0 - mov r8, r4 - mov r4, r9 - subs r4, 0x1 - cmp r5, r4 - bge _080B4028 -_080B3FEE: - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - mov r3, r8 - movs r0, 0 - ldrsh r2, [r3, r0] - adds r0, r6, 0 - adds r3, r7, 0 - bl sub_8092C8C - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _080B4014 - movs r0, 0x2 - negs r0, r0 - ands r1, r0 - cmp r1, 0 - bne _080B4056 -_080B4014: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r7, 0 - mov r1, sp - mov r2, r8 - bl MoveCoords - cmp r5, r4 - blt _080B3FEE -_080B4028: - ldrb r4, [r6, 0x19] - lsls r5, r4, 28 - lsrs r5, 28 - lsrs r4, 4 - movs r0, 0 - strb r0, [r6, 0x19] - mov r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - mov r3, r8 - movs r0, 0 - ldrsh r2, [r3, r0] - adds r0, r6, 0 - adds r3, r7, 0 - bl npc_block_way - lsls r0, 24 - lsrs r1, r0, 24 - lsls r4, 4 - orrs r5, r4 - strb r5, [r6, 0x19] - cmp r1, 0x4 - beq _080B405A -_080B4056: - movs r0, 0 - b _080B405C -_080B405A: - mov r0, r9 -_080B405C: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end CheckPathBetweenTrainerAndPlayer - - thumb_func_start TrainerApproachPlayer -@ void TrainerApproachPlayer(struct npc_state *trainerFieldObject, u8 distance) -TrainerApproachPlayer: @ 80B406C - push {r4,r5,lr} - lsls r5, r1, 24 - lsrs r5, 24 - ldr r0, =c3_8081EDC - movs r1, 0x50 - bl CreateTask - ldr r4, =0x03006090 - ldr r3, =0x030060a8 - ldrb r2, [r3] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - strb r0, [r1, 0x8] - ldrb r1, [r3] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x8] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r1, r0 - strh r5, [r1, 0xE] - ldrb r2, [r3] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0] - strh r0, [r1, 0x16] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end TrainerApproachPlayer - - thumb_func_start sub_80B40C8 -sub_80B40C8: @ 80B40C8 - push {r4,r5,lr} - adds r2, r0, 0 - ldr r0, =0x02038bfc - ldrb r0, [r0] - cmp r0, 0 - bne _080B40E4 - ldr r0, =0x03006090 - ldrb r5, [r0, 0x8] - b _080B40E8 - .pool -_080B40E4: - ldr r0, =0x03006090 - ldrb r5, [r0, 0x14] -_080B40E8: - ldr r4, =c3_8081EDC - adds r0, r5, 0 - adds r1, r4, 0 - bl SetTaskFuncWithFollowupFunc - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1 - strh r1, [r0, 0x8] - adds r0, r5, 0 - bl _call_via_r4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B40C8 - - thumb_func_start c3_8081EDC -c3_8081EDC: @ 80B4118 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r0, 0x16 - ldrsh r1, [r4, r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r5, r0, r1 - ldrb r0, [r5] - lsls r0, 31 - cmp r0, 0 - bne _080B4150 - adds r0, r6, 0 - bl SwitchTaskToFollowupFunc - b _080B416C - .pool -_080B4150: - ldr r7, =gUnknown_0855073C -_080B4152: - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r7 - ldr r3, [r0] - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl _call_via_r3 - lsls r0, 24 - cmp r0, 0 - bne _080B4152 -_080B416C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end c3_8081EDC - - thumb_func_start sub_80B4178 -sub_80B4178: @ 80B4178 - movs r0, 0 - bx lr - thumb_func_end sub_80B4178 - - thumb_func_start sub_80B417C -sub_80B417C: @ 80B417C - push {r4,r5,lr} - adds r5, r1, 0 - adds r4, r2, 0 - ldr r1, =0x02038c08 - adds r2, r1, 0x4 - adds r3, r1, 0 - adds r3, 0x8 - adds r0, r4, 0 - bl FieldObjectGetLocalIdAndMap - movs r0, 0 - bl FieldEffectStart - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B417C - - thumb_func_start sub_80B41C0 -sub_80B41C0: @ 80B41C0 - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - movs r0, 0 - bl FieldEffectActiveListContains - lsls r0, 24 - cmp r0, 0 - beq _080B41D6 - movs r0, 0 - b _080B41F8 -_080B41D6: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - ldrb r0, [r5, 0x6] - subs r0, 0x39 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _080B41EC - movs r0, 0x6 - strh r0, [r4, 0x8] -_080B41EC: - ldrb r0, [r5, 0x6] - cmp r0, 0x3F - bne _080B41F6 - movs r0, 0x8 - strh r0, [r4, 0x8] -_080B41F6: - movs r0, 0x1 -_080B41F8: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80B41C0 - - thumb_func_start sub_80B4200 -sub_80B4200: @ 80B4200 - push {r4,r5,lr} - adds r5, r1, 0 - adds r4, r2, 0 - adds r0, r4, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _080B421E - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B4252 -_080B421E: - movs r1, 0xE - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _080B4244 - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetGoSpeed0AnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - ldrh r0, [r5, 0xE] - subs r0, 0x1 - strh r0, [r5, 0xE] - b _080B4252 -_080B4244: - adds r0, r4, 0 - movs r1, 0x3E - bl FieldObjectSetSpecialAnim - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] -_080B4252: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80B4200 - - thumb_func_start sub_80B425C -sub_80B425C: @ 80B425C - push {r4-r6,lr} - adds r6, r1, 0 - adds r5, r2, 0 - adds r0, r5, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _080B427A - adds r0, r5, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B4308 -_080B427A: - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl npc_running_behaviour_by_direction - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl npc_set_running_behaviour_etc - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl npc_running_behaviour_by_direction - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl sub_808F23C - adds r0, r5, 0 - bl sub_808F208 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - adds r0, r4, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _080B42D2 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B4308 -_080B42D2: - bl sub_808BCE8 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetOppositeDirection - lsls r0, 24 - lsrs r0, 24 - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] -_080B4308: - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B425C - - thumb_func_start sub_80B4318 -sub_80B4318: @ 80B4318 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - adds r0, r4, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _080B4344 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B434A -_080B4344: - adds r0, r5, 0 - bl SwitchTaskToFollowupFunc -_080B434A: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B4318 - - thumb_func_start sub_80B435C -sub_80B435C: @ 80B435C - push {r4,r5,lr} - adds r5, r1, 0 - adds r4, r2, 0 - adds r0, r4, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _080B437A - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B4388 -_080B437A: - adds r0, r4, 0 - movs r1, 0x59 - bl FieldObjectSetSpecialAnim - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] -_080B4388: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80B435C - - thumb_func_start sub_80B4390 -sub_80B4390: @ 80B4390 - push {r4,lr} - adds r4, r1, 0 - adds r0, r2, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B43A4 - movs r0, 0x3 - strh r0, [r4, 0x8] -_080B43A4: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B4390 - - thumb_func_start sub_80B43AC -sub_80B43AC: @ 80B43AC - push {r4,r5,lr} - adds r5, r1, 0 - adds r4, r2, 0 - adds r0, r4, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _080B43CA - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B43D8 -_080B43CA: - adds r0, r4, 0 - movs r1, 0x3E - bl FieldObjectSetSpecialAnim - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] -_080B43D8: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80B43AC - - thumb_func_start sub_80B43E0 -sub_80B43E0: @ 80B43E0 - push {r4,r5,lr} - adds r5, r1, 0 - adds r4, r2, 0 - adds r0, r4, 0 - bl FieldObjectCheckIfSpecialAnimFinishedOrInactive - lsls r0, 24 - cmp r0, 0 - beq _080B4426 - ldr r2, =0x02038c08 - movs r1, 0x10 - ldrsh r0, [r4, r1] - str r0, [r2] - movs r1, 0x12 - ldrsh r0, [r4, r1] - str r0, [r2, 0x4] - ldr r3, =0x02020630 - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x43 - ldrb r0, [r0] - subs r0, 0x1 - str r0, [r2, 0x8] - movs r0, 0x2 - str r0, [r2, 0xC] - movs r0, 0x31 - bl FieldEffectStart - strh r0, [r5, 0x10] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] -_080B4426: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B43E0 - - thumb_func_start sub_80B4438 -sub_80B4438: @ 80B4438 - push {r4,r5,lr} - adds r5, r1, 0 - adds r4, r2, 0 - ldr r2, =0x02020630 - movs r1, 0x10 - ldrsh r0, [r5, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x2B - ldrb r0, [r1] - cmp r0, 0x2 - bne _080B44A0 - ldrb r1, [r4, 0x3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x3] - ldrb r0, [r4] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4] - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0, 0x5] - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl sub_80934BC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] -_080B44A0: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B4438 - - thumb_func_start sub_80B44AC -sub_80B44AC: @ 80B44AC - push {r4,lr} - adds r4, r1, 0 - movs r0, 0x31 - bl FieldEffectActiveListContains - lsls r0, 24 - cmp r0, 0 - bne _080B44C0 - movs r0, 0x3 - strh r0, [r4, 0x8] -_080B44C0: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B44AC - - thumb_func_start sub_80B44C8 -sub_80B44C8: @ 80B44C8 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - adds r0, r4, 0 - adds r0, 0xA - mov r1, sp - bl sub_806F684 - movs r1, 0x16 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B44FA - ldr r0, [sp] - bl FieldObjectClearAnim - ldrh r0, [r4, 0x16] - adds r0, 0x1 - strh r0, [r4, 0x16] -_080B44FA: - ldr r1, =gUnknown_0855076C - movs r2, 0x8 - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r0, r1 - ldr r2, [sp] - ldr r3, [r0] - adds r0, r5, 0 - adds r1, r4, 0 - bl _call_via_r3 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x3 - bne _080B4564 - movs r0, 0x31 - bl FieldEffectActiveListContains - lsls r0, 24 - cmp r0, 0 - bne _080B4564 - ldr r4, [sp] - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl npc_running_behaviour_by_direction - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl npc_set_running_behaviour_etc - ldr r4, [sp] - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl npc_running_behaviour_by_direction - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_808F23C - adds r0, r5, 0 - bl DestroyTask - b _080B456E - .pool -_080B4564: - ldr r2, [sp] - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] -_080B456E: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80B44C8 - - thumb_func_start sub_80B4578 -sub_80B4578: @ 80B4578 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =sub_80B44C8 - movs r1, 0 - bl CreateTask - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r0, r1 - adds r0, 0x2 - adds r1, r4, 0 - bl sub_806F67C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B4578 - - thumb_func_start sub_80B45AC -sub_80B45AC: @ 80B45AC - push {lr} - ldr r0, =sub_80B45BC - bl sub_80B40C8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B45AC - - thumb_func_start sub_80B45BC -sub_80B45BC: @ 80B45BC - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running - pop {r0} - bx r0 - thumb_func_end sub_80B45BC - - thumb_func_start sub_80B45D0 -sub_80B45D0: @ 80B45D0 - push {lr} - ldr r0, =0x030060a8 - ldrb r0, [r0] - cmp r0, 0x2 - bne _080B4610 - ldr r1, =0x02038bfc - ldrb r0, [r1] - cmp r0, 0 - bne _080B460C - adds r0, 0x1 - strb r0, [r1] - ldr r1, =0x020375f0 - movs r0, 0x1 - strh r0, [r1] - bl sub_809757C - ldr r0, =0x03006090 - ldrb r0, [r0, 0xC] - bl sub_80974D0 - b _080B4616 - .pool -_080B460C: - movs r0, 0 - strb r0, [r1] -_080B4610: - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] -_080B4616: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B45D0 - - thumb_func_start oei_exclamation_mark -oei_exclamation_mark: @ 80B4620 - push {lr} - ldr r0, =gUnknown_085507B4 - movs r1, 0 - movs r2, 0 - movs r3, 0x53 - bl AddObjectToBack - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _080B4648 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0 - movs r2, 0 - bl sub_80B46D8 -_080B4648: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end oei_exclamation_mark - - thumb_func_start sub_80B4658 -sub_80B4658: @ 80B4658 - push {lr} - ldr r0, =gUnknown_085507B4 - movs r1, 0 - movs r2, 0 - movs r3, 0x52 - bl AddObjectToBack - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _080B4680 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0x21 - movs r2, 0x1 - bl sub_80B46D8 -_080B4680: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B4658 - - thumb_func_start sub_80B4690 -sub_80B4690: @ 80B4690 - push {r4,lr} - ldr r0, =gUnknown_085507CC - movs r1, 0 - movs r2, 0 - movs r3, 0x52 - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _080B46C6 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x2E - movs r2, 0 - bl sub_80B46D8 - ldrb r1, [r4, 0x5] - movs r0, 0xF - ands r0, r1 - movs r1, 0x20 - orrs r0, r1 - strb r0, [r4, 0x5] -_080B46C6: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B4690 - - thumb_func_start sub_80B46D8 -@ void sub_80B46D8(struct obj *object, s16 a2, u8 a3) -sub_80B46D8: @ 80B46D8 - push {r4,lr} - lsls r2, 24 - lsrs r2, 24 - ldrb r4, [r0, 0x5] - movs r3, 0xD - negs r3, r3 - ands r3, r4 - movs r4, 0x4 - orrs r3, r4 - strb r3, [r0, 0x5] - movs r3, 0x3E - adds r3, r0 - mov r12, r3 - ldrb r3, [r3] - movs r4, 0x2 - orrs r3, r4 - mov r4, r12 - strb r3, [r4] - ldr r4, =0x02038c08 - ldr r3, [r4] - strh r3, [r0, 0x2E] - ldr r3, [r4, 0x4] - strh r3, [r0, 0x30] - ldr r3, [r4, 0x8] - strh r3, [r0, 0x32] - ldr r3, =0x0000fffb - strh r3, [r0, 0x34] - strh r1, [r0, 0x3C] - adds r1, r2, 0 - bl StartObjectImageAnim - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B46D8 - - thumb_func_start objc_exclamation_mark_probably -objc_exclamation_mark_probably: @ 80B4724 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x30] - lsls r1, 24 - lsrs r1, 24 - ldrh r2, [r4, 0x32] - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _080B4756 - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080B4764 -_080B4756: - ldrh r1, [r4, 0x3C] - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldEffectStop - b _080B47B2 -_080B4764: - ldr r2, =0x02037350 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - ldrh r3, [r4, 0x34] - ldrh r0, [r4, 0x36] - adds r2, r3, r0 - strh r2, [r4, 0x36] - ldrh r0, [r1, 0x20] - strh r0, [r4, 0x20] - ldrh r0, [r1, 0x22] - subs r0, 0x10 - strh r0, [r4, 0x22] - ldrh r0, [r1, 0x24] - strh r0, [r4, 0x24] - ldrh r0, [r1, 0x26] - adds r0, r2 - strh r0, [r4, 0x26] - lsls r2, 16 - asrs r2, 16 - cmp r2, 0 - beq _080B47B0 - adds r0, r3, 0x1 - strh r0, [r4, 0x34] - b _080B47B2 - .pool -_080B47B0: - strh r2, [r4, 0x34] -_080B47B2: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end objc_exclamation_mark_probably - - thumb_func_start sub_80B47BC -sub_80B47BC: @ 80B47BC - push {lr} - ldr r0, =0x02038bfc - ldrb r0, [r0] - cmp r0, 0 - beq _080B47D4 - ldr r0, =0x03006090 - ldrb r0, [r0, 0xC] - b _080B47D8 - .pool -_080B47D4: - ldr r0, =0x03006090 - ldrb r0, [r0] -_080B47D8: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B47BC - - thumb_func_start sub_80B47E0 -sub_80B47E0: @ 80B47E0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _080B47EE - movs r0, 0 - b _080B4800 -_080B47EE: - cmp r0, 0 - beq _080B47FC - ldr r0, =0x03006090 - ldrb r0, [r0, 0xC] - b _080B4800 - .pool -_080B47FC: - ldr r0, =0x03006090 - ldrb r0, [r0] -_080B4800: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B47E0 - - thumb_func_start sub_80B4808 -sub_80B4808: @ 80B4808 - push {lr} - ldr r0, =0x030060ac - ldrb r0, [r0] - cmp r0, 0x1 - bne _080B4870 - ldr r2, =0x03006090 - ldr r0, =0x03006080 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldrb r0, [r0, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetOppositeDirection - lsls r0, 24 - lsrs r0, 24 - bl GetFaceDirectionAnimId - ldr r3, =0x03006084 - strb r0, [r3] - movs r0, 0xFE - strb r0, [r3, 0x1] - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrb r1, [r0, 0x5] - ldrb r2, [r0, 0x4] - movs r0, 0xFF - bl exec_movement - b _080B489E - .pool -_080B4870: - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldrb r0, [r0, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetFaceDirectionAnimId - ldr r3, =0x03006084 - strb r0, [r3] - movs r0, 0xFE - strb r0, [r3, 0x1] - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrb r1, [r0, 0x5] - ldrb r2, [r0, 0x4] - movs r0, 0xFF - bl exec_movement -_080B489E: - movs r0, 0xFF - bl sub_809BE48 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B4808 - - thumb_func_start sub_80B48B8 -sub_80B48B8: @ 80B48B8 - ldr r1, =0x02038c00 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_80B48B8 - - thumb_func_start sub_80B48C4 -sub_80B48C4: @ 80B48C4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp] - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0x4] - lsls r2, 24 - lsrs r2, 24 - ldr r3, =gUnknown_08553A7C - lsls r1, r2, 1 - adds r1, r2 - lsls r2, r1, 1 - adds r2, r3 - adds r0, r1, 0x1 - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - mov r9, r0 - adds r1, 0x2 - lsls r1, 1 - adds r1, r3 - ldrh r6, [r1] - ldrh r5, [r2] - cmp r5, r9 - bhi _080B496E - ldr r0, =0x02037318 - mov r10, r0 -_080B4906: - movs r4, 0 - mov r1, r10 - ldr r0, [r1] - ldr r0, [r0] - cmp r4, r0 - bge _080B4964 - ldr r1, [sp] - lsls r0, r1, 16 - asrs r0, 16 - mov r8, r0 - ldr r1, [sp, 0x4] - lsls r0, r1, 16 - asrs r7, r0, 16 -_080B4920: - adds r0, r4, 0x7 - adds r1, r5, 0x7 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl sub_8089660 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B4954 - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r8, r4 - bne _080B4954 - cmp r7, r5 - bne _080B4954 - adds r0, r6, 0 - b _080B4974 - .pool -_080B4954: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - mov r1, r10 - ldr r0, [r1] - ldr r0, [r0] - cmp r4, r0 - blt _080B4920 -_080B4964: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, r9 - bls _080B4906 -_080B496E: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r0, 16 -_080B4974: - 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_80B48C4 - - thumb_func_start sub_80B4984 -sub_80B4984: @ 80B4984 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - movs r7, 0 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - movs r0, 0x88 - lsls r0, 6 - cmp r1, r0 - bne _080B4A7A - add r5, sp, 0xC - mov r4, sp - adds r4, 0xE - adds r0, r5, 0 - adds r1, r4, 0 - bl GetXYCoordsOneStepInFrontOfPlayer - ldrh r0, [r5] - subs r0, 0x7 - strh r0, [r5] - ldrh r0, [r4] - subs r0, 0x7 - strh r0, [r4] - movs r0, 0 - ldrsh r1, [r4, r0] - ldr r0, =gUnknown_08553A7C - mov r9, r5 - mov r8, r4 - ldrh r2, [r0, 0x6] - cmp r1, r2 - blt _080B49D0 - ldrh r3, [r0, 0x8] - cmp r1, r3 - bgt _080B49D0 - movs r7, 0x1 -_080B49D0: - mov r2, r8 - movs r3, 0 - ldrsh r1, [r2, r3] - ldrh r2, [r0, 0xC] - cmp r1, r2 - blt _080B49E4 - ldrh r0, [r0, 0xE] - cmp r1, r0 - bgt _080B49E4 - movs r7, 0x2 -_080B49E4: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x31 - bls _080B4A08 - b _080B4A7A - .pool -_080B4A04: - movs r0, 0x1 - b _080B4A7C -_080B4A08: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r3, =0x00002e6a - adds r0, r3 - ldrh r0, [r0] - bl sub_80B4AB8 - movs r5, 0 - ldr r6, =0x000001bf -_080B4A1A: - bl sub_80B4A98 - lsls r1, r5, 1 - mov r2, sp - adds r4, r2, r1 - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __umodsi3 - strh r0, [r4] - lsls r0, 16 - cmp r0, 0 - bne _080B4A38 - strh r6, [r4] -_080B4A38: - ldrh r0, [r4] - subs r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bls _080B4A4A - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080B4A4A: - cmp r5, 0x6 - bne _080B4A1A - mov r3, r9 - movs r1, 0 - ldrsh r0, [r3, r1] - mov r2, r8 - movs r3, 0 - ldrsh r1, [r2, r3] - adds r2, r7, 0 - bl sub_80B48C4 - lsls r0, 16 - lsrs r1, r0, 16 - movs r5, 0 -_080B4A66: - lsls r0, r5, 1 - add r0, sp - ldrh r0, [r0] - cmp r1, r0 - beq _080B4A04 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _080B4A66 -_080B4A7A: - movs r0, 0 -_080B4A7C: - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B4984 - - thumb_func_start sub_80B4A98 -sub_80B4A98: @ 80B4A98 - ldr r2, =0x02038c04 - ldr r1, [r2] - ldr r0, =0x41c64e6d - muls r0, r1 - ldr r1, =0x00003039 - adds r0, r1 - str r0, [r2] - lsrs r0, 16 - bx lr - .pool - thumb_func_end sub_80B4A98 - - thumb_func_start sub_80B4AB8 -sub_80B4AB8: @ 80B4AB8 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x02038c04 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_80B4AB8 - - thumb_func_start wild_pokemon_rand_grass -wild_pokemon_rand_grass: @ 80B4AC8 - push {lr} - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x13 - bhi _080B4AE4 - movs r0, 0 - b _080B4B7E -_080B4AE4: - adds r0, r1, 0 - subs r0, 0x14 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - bhi _080B4AF4 - movs r0, 0x1 - b _080B4B7E -_080B4AF4: - adds r0, r1, 0 - subs r0, 0x28 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x9 - bhi _080B4B04 - movs r0, 0x2 - b _080B4B7E -_080B4B04: - adds r0, r1, 0 - subs r0, 0x32 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x9 - bhi _080B4B14 - movs r0, 0x3 - b _080B4B7E -_080B4B14: - adds r0, r1, 0 - subs r0, 0x3C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x9 - bhi _080B4B24 - movs r0, 0x4 - b _080B4B7E -_080B4B24: - adds r0, r1, 0 - subs r0, 0x46 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x9 - bhi _080B4B34 - movs r0, 0x5 - b _080B4B7E -_080B4B34: - adds r0, r1, 0 - subs r0, 0x50 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bhi _080B4B44 - movs r0, 0x6 - b _080B4B7E -_080B4B44: - adds r0, r1, 0 - subs r0, 0x55 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bhi _080B4B54 - movs r0, 0x7 - b _080B4B7E -_080B4B54: - adds r0, r1, 0 - subs r0, 0x5A - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bhi _080B4B64 - movs r0, 0x8 - b _080B4B7E -_080B4B64: - adds r0, r1, 0 - subs r0, 0x5E - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bhi _080B4B74 - movs r0, 0x9 - b _080B4B7E -_080B4B74: - cmp r1, 0x62 - beq _080B4B7C - movs r0, 0xB - b _080B4B7E -_080B4B7C: - movs r0, 0xA -_080B4B7E: - pop {r1} - bx r1 - thumb_func_end wild_pokemon_rand_grass - - thumb_func_start wild_pokemon_rand_water -wild_pokemon_rand_water: @ 80B4B84 - push {lr} - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 24 - lsrs r1, r0, 24 - adds r2, r1, 0 - cmp r1, 0x3B - bhi _080B4BA2 - movs r0, 0 - b _080B4BD4 -_080B4BA2: - adds r0, r1, 0 - subs r0, 0x3C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1D - bhi _080B4BB2 - movs r0, 0x1 - b _080B4BD4 -_080B4BB2: - adds r0, r1, 0 - subs r0, 0x5A - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bhi _080B4BC2 - movs r0, 0x2 - b _080B4BD4 -_080B4BC2: - adds r0, r2, 0 - subs r0, 0x5F - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _080B4BD2 - movs r0, 0x4 - b _080B4BD4 -_080B4BD2: - movs r0, 0x3 -_080B4BD4: - pop {r1} - bx r1 - thumb_func_end wild_pokemon_rand_water - - thumb_func_start sub_80B4BD8 -sub_80B4BD8: @ 80B4BD8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - movs r5, 0 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r4, 0x1 - beq _080B4C12 - cmp r4, 0x1 - bgt _080B4C02 - cmp r4, 0 - beq _080B4C08 - b _080B4C6C -_080B4C02: - cmp r6, 0x2 - beq _080B4C36 - b _080B4C6C -_080B4C08: - movs r5, 0x1 - cmp r1, 0x45 - bhi _080B4C6C - movs r5, 0 - b _080B4C6C -_080B4C12: - cmp r1, 0x3B - bhi _080B4C18 - movs r5, 0x2 -_080B4C18: - adds r0, r1, 0 - subs r0, 0x3C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - bhi _080B4C26 - movs r5, 0x3 -_080B4C26: - adds r0, r1, 0 - subs r0, 0x50 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - bhi _080B4C6C - movs r5, 0x4 - b _080B4C6C -_080B4C36: - cmp r1, 0x27 - bhi _080B4C3C - movs r5, 0x5 -_080B4C3C: - adds r0, r1, 0 - subs r0, 0x28 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x27 - bhi _080B4C4A - movs r5, 0x6 -_080B4C4A: - adds r0, r1, 0 - subs r0, 0x50 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xE - bhi _080B4C58 - movs r5, 0x7 -_080B4C58: - adds r0, r1, 0 - subs r0, 0x5F - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bhi _080B4C66 - movs r5, 0x8 -_080B4C66: - cmp r1, 0x63 - bne _080B4C6C - movs r5, 0x9 -_080B4C6C: - adds r0, r5, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80B4BD8 - - thumb_func_start sub_80B4C74 -sub_80B4C74: @ 80B4C74 - push {r4-r7,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0x1] - ldrb r1, [r4] - cmp r0, r1 - bcc _080B4C86 - ldrb r7, [r4] - adds r6, r0, 0 - b _080B4C8A -_080B4C86: - ldrb r7, [r4, 0x1] - ldrb r6, [r4] -_080B4C8A: - subs r4, r6, r7 - adds r4, 0x1 - lsls r4, 24 - lsrs r4, 24 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __modsi3 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =0x020244ec - adds r0, r5, 0 - movs r1, 0x6 - bl pokemon_getattr - cmp r0, 0 - bne _080B4CEA - adds r0, r5, 0 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x37 - beq _080B4CC8 - cmp r0, 0x48 - beq _080B4CC8 - cmp r0, 0x2E - bne _080B4CEA -_080B4CC8: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080B4CE0 - adds r0, r6, 0 - b _080B4CF0 - .pool -_080B4CE0: - cmp r4, 0 - beq _080B4CEA - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_080B4CEA: - adds r0, r7, r4 - lsls r0, 24 - lsrs r0, 24 -_080B4CF0: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80B4C74 - - thumb_func_start get_wild_data_index_for_map -get_wild_data_index_for_map: @ 80B4CF8 - push {r4-r6,lr} - movs r4, 0 - ldr r0, =gWildMonHeaders - ldrb r1, [r0] - adds r5, r0, 0 - cmp r1, 0xFF - beq _080B4D6C - ldr r6, =0x00006a18 -_080B4D08: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 2 - adds r3, r0, r5 - ldrb r1, [r3] - ldr r0, =0x03005d8c - ldr r2, [r0] - movs r0, 0x4 - ldrsb r0, [r2, r0] - cmp r1, r0 - bne _080B4D58 - ldrb r1, [r3, 0x1] - movs r0, 0x5 - ldrsb r0, [r2, r0] - cmp r1, r0 - bne _080B4D58 - ldrh r0, [r2, 0x4] - cmp r0, r6 - bne _080B4D44 - ldr r0, =0x0000403e - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x8 - bls _080B4D3E - movs r0, 0 -_080B4D3E: - adds r0, r4, r0 - lsls r0, 16 - lsrs r4, r0, 16 -_080B4D44: - adds r0, r4, 0 - b _080B4D6E - .pool -_080B4D58: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0] - cmp r0, 0xFF - bne _080B4D08 -_080B4D6C: - ldr r0, =0x0000ffff -_080B4D6E: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end get_wild_data_index_for_map - - thumb_func_start sub_80B4D78 -sub_80B4D78: @ 80B4D78 - push {r4-r7,lr} - sub sp, 0x1C - bl GetSafariZoneFlag - cmp r0, 0x1 - bne _080B4E0E - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x4F - bhi _080B4E0E - bl sub_80FC3B8 - adds r7, r0, 0 - cmp r7, 0 - beq _080B4E0E - movs r5, 0 -_080B4DA6: - mov r1, sp - adds r0, r1, r5 - strb r5, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x18 - bls _080B4DA6 - movs r5, 0 -_080B4DB8: - adds r1, r5, 0x1 - lsls r0, r1, 24 - lsrs r4, r0, 24 - adds r6, r1, 0 - cmp r4, 0x18 - bhi _080B4DE8 - add r5, sp -_080B4DC6: - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _080B4DDE - ldrb r2, [r5] - mov r0, sp - adds r1, r0, r4 - ldrb r0, [r1] - strb r0, [r5] - strb r2, [r1] -_080B4DDE: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x18 - bls _080B4DC6 -_080B4DE8: - lsls r0, r6, 24 - lsrs r5, r0, 24 - cmp r5, 0x17 - bls _080B4DB8 - movs r5, 0 -_080B4DF2: - mov r1, sp - adds r4, r1, r5 - ldrb r0, [r4] - adds r1, r7, 0 - bl sub_8136FE4 - lsls r0, 16 - cmp r0, 0 - bgt _080B4E48 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x18 - bls _080B4DF2 -_080B4E0E: - ldr r4, =0x020244ec - adds r0, r4, 0 - movs r1, 0x6 - bl pokemon_getattr - cmp r0, 0 - bne _080B4E4C - adds r0, r4, 0 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1C - bne _080B4E4C - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080B4E4C - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - b _080B4E54 - .pool -_080B4E48: - ldrb r0, [r4] - b _080B4E5E -_080B4E4C: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 -_080B4E54: - movs r1, 0x19 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 -_080B4E5E: - add sp, 0x1C - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80B4D78 - - thumb_func_start sub_80B4E68 -sub_80B4E68: @ 80B4E68 - push {r4-r7,lr} - sub sp, 0xC - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 24 - lsrs r7, r1, 24 - bl zero_enemy_party_data - movs r2, 0x1 - ldr r1, =gBaseStats - lsls r0, r6, 3 - subs r0, r6 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x10] - cmp r0, 0 - beq _080B4E96 - cmp r0, 0 - blt _080B4E98 - cmp r0, 0xFF - bgt _080B4E98 - cmp r0, 0xFE - blt _080B4E98 -_080B4E96: - movs r2, 0 -_080B4E98: - cmp r2, 0 - beq _080B4F28 - ldr r5, =0x020244ec - adds r0, r5, 0 - movs r1, 0x6 - bl pokemon_getattr - cmp r0, 0 - bne _080B4F28 - adds r0, r5, 0 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x38 - bne _080B4F28 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _080B4F28 - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0 - bl pokemon_getattr - adds r1, r0, 0 - adds r0, r4, 0 - bl pokemon_species_get_gender_info - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xFE - bne _080B4F00 - movs r4, 0 - b _080B4F02 - .pool -_080B4F00: - movs r4, 0xFE -_080B4F02: - bl sub_80B4D78 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02024744 - str r4, [sp] - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r1, 0 - adds r1, r6, 0 - adds r2, r7, 0 - movs r3, 0x20 - bl sub_8067EF8 - b _080B4F40 - .pool -_080B4F28: - bl sub_80B4D78 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02024744 - str r0, [sp] - adds r0, r1, 0 - adds r1, r6, 0 - adds r2, r7, 0 - movs r3, 0x20 - bl pokemon_make_with_nature -_080B4F40: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B4E68 - - thumb_func_start sub_80B4F4C -sub_80B4F4C: @ 80B4F4C - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - lsls r1, 24 - lsrs r3, r1, 24 - adds r4, r3, 0 - lsls r2, 24 - lsrs r6, r2, 24 - movs r1, 0 - mov r0, sp - strb r1, [r0] - cmp r3, 0x1 - beq _080B4FA0 - cmp r3, 0x1 - bgt _080B4F70 - cmp r3, 0 - beq _080B4F76 - b _080B4FBA -_080B4F70: - cmp r4, 0x2 - beq _080B4FB2 - b _080B4FBA -_080B4F76: - ldr r0, [r5, 0x4] - movs r1, 0x8 - movs r2, 0x2A - mov r3, sp - bl TryGetAbilityInfluencedWildMonIndex - lsls r0, 24 - cmp r0, 0 - bne _080B4FBA - ldr r0, [r5, 0x4] - movs r1, 0xD - movs r2, 0x9 - mov r3, sp - bl TryGetAbilityInfluencedWildMonIndex - lsls r0, 24 - cmp r0, 0 - bne _080B4FBA - bl wild_pokemon_rand_grass - b _080B4FB6 -_080B4FA0: - ldr r0, [r5, 0x4] - movs r1, 0xD - movs r2, 0x9 - mov r3, sp - bl TryGetAbilityInfluencedWildMonIndex - lsls r0, 24 - cmp r0, 0 - bne _080B4FBA -_080B4FB2: - bl wild_pokemon_rand_water -_080B4FB6: - mov r1, sp - strb r0, [r1] -_080B4FBA: - mov r0, sp - ldrb r1, [r0] - lsls r1, 2 - ldr r0, [r5, 0x4] - adds r0, r1 - bl sub_80B4C74 - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x1 - ands r0, r6 - cmp r0, 0 - beq _080B4FE0 - adds r0, r4, 0 - bl sub_80B58CC - lsls r0, 24 - cmp r0, 0 - beq _080B5000 -_080B4FE0: - ldr r0, =0x02037318 - ldrh r1, [r0, 0x12] - movs r0, 0xB3 - lsls r0, 1 - cmp r1, r0 - beq _080B5008 - movs r0, 0x2 - ands r0, r6 - cmp r0, 0 - beq _080B5008 - adds r0, r4, 0 - bl DoKeenEyeIntimidateWildEncounterTest - lsls r0, 24 - cmp r0, 0 - bne _080B5008 -_080B5000: - movs r0, 0 - b _080B501C - .pool -_080B5008: - mov r0, sp - ldrb r0, [r0] - ldr r1, [r5, 0x4] - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x2] - adds r1, r4, 0 - bl sub_80B4E68 - movs r0, 0x1 -_080B501C: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80B4F4C - - thumb_func_start sub_80B5024 -sub_80B5024: @ 80B5024 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r0, r1, 24 - lsrs r0, 24 - bl sub_80B4BD8 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 22 - ldr r0, [r5, 0x4] - adds r0, r4 - bl sub_80B4C74 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, [r5, 0x4] - adds r0, r4, r0 - ldrh r0, [r0, 0x2] - bl sub_80B4E68 - ldr r0, [r5, 0x4] - adds r4, r0 - ldrh r0, [r4, 0x2] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80B5024 - - thumb_func_start SetUpMassOutbreakEncounter -SetUpMassOutbreakEncounter: @ 80B505C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080B508C - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002b94 - adds r0, r1 - ldrb r0, [r0] - bl sub_80B58CC - lsls r0, 24 - cmp r0, 0 - bne _080B508C - movs r0, 0 - b _080B50C6 - .pool -_080B508C: - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r2, =0x00002b90 - adds r0, r1, r2 - ldrh r0, [r0] - adds r2, 0x4 - adds r1, r2 - ldrb r1, [r1] - bl sub_80B4E68 - movs r4, 0 -_080B50A2: - ldr r0, =0x03005d8c - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00002b98 - adds r0, r2 - adds r0, r1 - ldrh r1, [r0] - lsls r2, r4, 24 - lsrs r2, 24 - ldr r0, =0x02024744 - bl sub_80691F4 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x3 - bls _080B50A2 - movs r0, 0x1 -_080B50C6: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end SetUpMassOutbreakEncounter - - thumb_func_start DoMassOutbreakEncounterTest -DoMassOutbreakEncounterTest: @ 80B50DC - push {r4,lr} - ldr r4, =0x03005d8c - ldr r2, [r4] - ldr r1, =0x00002b90 - adds r0, r2, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _080B513C - movs r1, 0x5 - ldrsb r1, [r2, r1] - ldr r3, =0x00002b92 - adds r0, r2, r3 - ldrb r0, [r0] - cmp r1, r0 - bne _080B513C - movs r1, 0x4 - ldrsb r1, [r2, r1] - adds r3, 0x1 - adds r0, r2, r3 - ldrb r0, [r0] - cmp r1, r0 - bne _080B513C - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - ldr r1, [r4] - ldr r2, =0x00002ba1 - adds r1, r2 - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1] - cmp r0, r1 - bcs _080B513C - movs r0, 0x1 - b _080B513E - .pool -_080B513C: - movs r0, 0 -_080B513E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end DoMassOutbreakEncounterTest - - thumb_func_start DoWildEncounterRateDiceRoll -DoWildEncounterRateDiceRoll: @ 80B5144 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xB4 - lsls r1, 4 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, r4 - bcc _080B5168 - movs r0, 0 - b _080B516A -_080B5168: - movs r0, 0x1 -_080B516A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end DoWildEncounterRateDiceRoll - - thumb_func_start DoWildEncounterRateTest -DoWildEncounterRateTest: @ 80B5170 - push {r4,lr} - sub sp, 0x4 - str r0, [sp] - lsls r1, 24 - lsrs r4, r1, 24 - lsls r0, 4 - str r0, [sp] - movs r0, 0x6 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _080B519A - ldr r1, [sp] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 4 - movs r1, 0x64 - bl __udivsi3 - str r0, [sp] -_080B519A: - mov r0, sp - bl affects_encounter_rate_based_on_flags - mov r0, sp - bl ApplyCleanseTagWildEncounterRateReduction - cmp r4, 0 - bne _080B5216 - ldr r4, =0x020244ec - adds r0, r4, 0 - movs r1, 0x6 - bl pokemon_getattr - cmp r0, 0 - bne _080B5216 - adds r0, r4, 0 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B51E8 - ldr r0, =0x02037318 - ldrh r1, [r0, 0x12] - ldr r0, =0x00000169 - cmp r1, r0 - bne _080B5210 - ldr r1, [sp] - lsls r0, r1, 1 - adds r0, r1 - lsrs r0, 2 - b _080B5214 - .pool -_080B51E8: - cmp r0, 0x23 - bne _080B51F2 - ldr r0, [sp] - lsls r0, 1 - b _080B5214 -_080B51F2: - cmp r0, 0x49 - beq _080B5210 - cmp r0, 0x47 - bne _080B5200 - ldr r0, [sp] - lsls r0, 1 - b _080B5214 -_080B5200: - cmp r0, 0x8 - bne _080B5216 - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r0, 0x2E - ldrb r0, [r0] - cmp r0, 0x8 - bne _080B5216 -_080B5210: - ldr r0, [sp] - lsrs r0, 1 -_080B5214: - str r0, [sp] -_080B5216: - ldr r0, [sp] - movs r1, 0xB4 - lsls r1, 4 - cmp r0, r1 - bls _080B5222 - str r1, [sp] -_080B5222: - ldr r0, [sp] - lsls r0, 16 - lsrs r0, 16 - bl DoWildEncounterRateDiceRoll - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end DoWildEncounterRateTest - - thumb_func_start DoGlobalWildEncounterDiceRoll -DoGlobalWildEncounterDiceRoll: @ 80B523C - push {lr} - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x3B - bhi _080B5258 - movs r0, 0x1 - b _080B525A -_080B5258: - movs r0, 0 -_080B525A: - pop {r1} - bx r1 - thumb_func_end DoGlobalWildEncounterDiceRoll - - thumb_func_start sub_80B5260 -sub_80B5260: @ 80B5260 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - movs r0, 0xE0 - lsls r0, 3 - cmp r1, r0 - bne _080B5280 - movs r0, 0x53 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - b _080B5282 - .pool -_080B5280: - movs r0, 0 -_080B5282: - pop {r1} - bx r1 - thumb_func_end sub_80B5260 - - thumb_func_start is_it_battle_time_2 -is_it_battle_time_2: @ 80B5288 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 16 - lsrs r6, r0, 16 - mov r9, r6 - lsls r1, 16 - lsrs r7, r1, 16 - mov r8, r7 - ldr r0, =0x02038c00 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080B52A6 - b _080B54FE -_080B52A6: - bl get_wild_data_index_for_map - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x0000ffff - cmp r5, r0 - bne _080B539C - ldr r0, =0x02037318 - ldrh r1, [r0, 0x12] - movs r0, 0xB3 - lsls r0, 1 - cmp r1, r0 - bne _080B5330 - bl sub_81A7D00 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r7, r6 - beq _080B52D8 - bl DoGlobalWildEncounterDiceRoll - lsls r0, 24 - cmp r0, 0 - bne _080B52D8 - b _080B54FE -_080B52D8: - ldr r1, =gUnknown_08553A14 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 2 - adds r1, 0x4 - adds r4, r0, r1 - ldr r0, [r4] - ldrb r0, [r0] - movs r1, 0 - bl DoWildEncounterRateTest - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080B52F8 - b _080B54FE -_080B52F8: - ldr r0, [r4] - movs r1, 0 - movs r2, 0x2 - bl sub_80B4F4C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080B530C - b _080B54FE -_080B530C: - movs r0, 0x1 - bl sub_81A7B90 - cmp r0, 0 - bne _080B5318 - b _080B54FE -_080B5318: - bl sub_80B06B0 - movs r0, 0x1 - b _080B5500 - .pool -_080B5330: - ldr r0, =0x00000169 - cmp r1, r0 - beq _080B5338 - b _080B54FE -_080B5338: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r5, [r0] - cmp r7, r6 - beq _080B5352 - bl DoGlobalWildEncounterDiceRoll - lsls r0, 24 - cmp r0, 0 - bne _080B5352 - b _080B54FE -_080B5352: - ldr r1, =gUnknown_08553894 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 2 - adds r1, 0x4 - adds r4, r0, r1 - ldr r0, [r4] - ldrb r0, [r0] - movs r1, 0 - bl DoWildEncounterRateTest - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080B5372 - b _080B54FE -_080B5372: - ldr r0, [r4] - movs r1, 0 - movs r2, 0x2 - bl sub_80B4F4C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080B5386 - b _080B54FE -_080B5386: - bl sub_81A9C04 - b _080B54F6 - .pool -_080B539C: - lsls r0, r6, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_808952C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B543C - ldr r1, =gWildMonHeaders - lsls r2, r5, 2 - adds r0, r2, r5 - lsls r0, 2 - adds r1, 0x4 - adds r0, r1 - ldr r0, [r0] - adds r4, r2, 0 - cmp r0, 0 - bne _080B53C4 - b _080B54FE -_080B53C4: - cmp r7, r6 - beq _080B53D4 - bl DoGlobalWildEncounterDiceRoll - lsls r0, 24 - cmp r0, 0 - bne _080B53D4 - b _080B54FE -_080B53D4: - ldr r1, =gWildMonHeaders - adds r0, r4, r5 - lsls r0, 2 - adds r1, 0x4 - adds r0, r1 - ldr r0, [r0] - ldrb r0, [r0] - movs r1, 0 - bl DoWildEncounterRateTest - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080B53F2 - b _080B54FE -_080B53F2: - bl sub_8161EDC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080B54BA - bl DoMassOutbreakEncounterTest - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B5418 - movs r0, 0x3 - bl SetUpMassOutbreakEncounter - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080B54F6 -_080B5418: - ldr r1, =gWildMonHeaders - adds r0, r4, r5 - lsls r0, 2 - adds r1, 0x4 - adds r0, r1 - ldr r0, [r0] - movs r1, 0 - movs r2, 0x3 - bl sub_80B4F4C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080B54F6 - b _080B54FE - .pool -_080B543C: - adds r0, r4, 0 - bl sub_8089558 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080B5464 - movs r0, 0x8 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _080B54FE - adds r0, r4, 0 - bl sub_80894AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B54FE -_080B5464: - bl sub_80B5260 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080B54FE - ldr r1, =gWildMonHeaders - lsls r2, r5, 2 - adds r0, r2, r5 - lsls r0, 2 - adds r1, 0x8 - adds r0, r1 - ldr r0, [r0] - adds r4, r2, 0 - cmp r0, 0 - beq _080B54FE - cmp r8, r9 - beq _080B5492 - bl DoGlobalWildEncounterDiceRoll - lsls r0, 24 - cmp r0, 0 - beq _080B54FE -_080B5492: - ldr r1, =gWildMonHeaders - adds r0, r4, r5 - lsls r0, 2 - adds r1, 0x8 - adds r4, r0, r1 - ldr r0, [r4] - ldrb r0, [r0] - movs r1, 0 - bl DoWildEncounterRateTest - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B54FE - bl sub_8161EDC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B54E4 -_080B54BA: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000031dc - adds r0, r1 - ldrb r0, [r0, 0xC] - bl sub_80B58CC - lsls r0, 24 - cmp r0, 0 - beq _080B54FE - bl sub_80B072C - movs r0, 0x1 - b _080B5500 - .pool -_080B54E4: - ldr r0, [r4] - movs r1, 0x1 - movs r2, 0x3 - bl sub_80B4F4C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B54FE -_080B54F6: - bl sub_80B0698 - movs r0, 0x1 - b _080B5500 -_080B54FE: - movs r0, 0 -_080B5500: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end is_it_battle_time_2 - - thumb_func_start rock_smash_wild_pokemon_encounter -rock_smash_wild_pokemon_encounter: @ 80B550C - push {r4,lr} - bl get_wild_data_index_for_map - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =0x0000ffff - cmp r2, r0 - beq _080B5568 - ldr r1, =gWildMonHeaders - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 2 - adds r1, 0xC - adds r0, r1 - ldr r4, [r0] - cmp r4, 0 - beq _080B5554 - ldrb r0, [r4] - movs r1, 0x1 - bl DoWildEncounterRateTest - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B5568 - adds r0, r4, 0 - movs r1, 0x2 - movs r2, 0x3 - bl sub_80B4F4C - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bne _080B5568 - bl sub_80B0698 -_080B5554: - ldr r0, =0x020375f0 - strh r4, [r0] - b _080B556E - .pool -_080B5568: - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] -_080B556E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end rock_smash_wild_pokemon_encounter - - thumb_func_start sub_80B5578 -sub_80B5578: @ 80B5578 - push {r4,r5,lr} - sub sp, 0x4 - mov r5, sp - adds r5, 0x2 - mov r0, sp - adds r1, r5, 0 - bl PlayerGetDestCoords - bl get_wild_data_index_for_map - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x0000ffff - cmp r4, r0 - bne _080B562C - ldr r0, =0x02037318 - ldrh r1, [r0, 0x12] - movs r0, 0xB3 - lsls r0, 1 - cmp r1, r0 - bne _080B55E4 - bl sub_81A7D00 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_08553A14 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 2 - adds r1, 0x4 - adds r0, r1 - ldr r0, [r0] - movs r1, 0 - movs r2, 0 - bl sub_80B4F4C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080B55CA - b _080B56F2 -_080B55CA: - movs r0, 0 - bl sub_81A7B90 - bl sub_80B06B0 - movs r0, 0x1 - b _080B56F4 - .pool -_080B55E4: - ldr r0, =0x00000169 - cmp r1, r0 - beq _080B55EC - b _080B56F2 -_080B55EC: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r4, [r0] - ldr r1, =gUnknown_08553894 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 2 - adds r1, 0x4 - adds r0, r1 - ldr r0, [r0] - movs r1, 0 - movs r2, 0 - bl sub_80B4F4C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B56F2 - bl sub_81A9C04 - b _080B56EA - .pool -_080B562C: - mov r0, sp - movs r2, 0 - ldrsh r0, [r0, r2] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl sub_808952C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B568C - ldr r1, =gWildMonHeaders - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 2 - adds r1, 0x4 - adds r0, r1 - ldr r4, [r0] - cmp r4, 0 - beq _080B56F2 - bl sub_8161EDC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080B56D4 - bl DoMassOutbreakEncounterTest - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B5680 - movs r0, 0 - bl SetUpMassOutbreakEncounter - b _080B56EA - .pool -_080B5680: - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl sub_80B4F4C - b _080B56EA -_080B568C: - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl sub_8089558 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B56F2 - bl sub_80B5260 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080B56F2 - ldr r1, =gWildMonHeaders - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 2 - adds r1, 0x8 - adds r0, r1 - ldr r4, [r0] - cmp r4, 0 - beq _080B56F2 - bl sub_8161EDC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B56E0 -_080B56D4: - bl sub_80B072C - movs r0, 0x1 - b _080B56F4 - .pool -_080B56E0: - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl sub_80B4F4C -_080B56EA: - bl sub_80B0698 - movs r0, 0x1 - b _080B56F4 -_080B56F2: - movs r0, 0 -_080B56F4: - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80B5578 - - thumb_func_start GetFishingWildMonListHeader -GetFishingWildMonListHeader: @ 80B56FC - push {lr} - bl get_wild_data_index_for_map - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =0x0000ffff - cmp r2, r0 - beq _080B572C - ldr r0, =gWildMonHeaders - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 2 - adds r0, 0x10 - adds r1, r0 - ldr r0, [r1] - cmp r0, 0 - beq _080B572C - movs r0, 0x1 - b _080B572E - .pool -_080B572C: - movs r0, 0 -_080B572E: - pop {r1} - bx r1 - thumb_func_end GetFishingWildMonListHeader - - thumb_func_start sub_80B5734 -sub_80B5734: @ 80B5734 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_80B4984 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B5764 - ldr r4, =gUnknown_08553A78 - adds r0, r4, 0 - bl sub_80B4C74 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldrh r4, [r4, 0x2] - adds r0, r4, 0 - bl sub_80B4E68 - b _080B5784 - .pool -_080B5764: - ldr r4, =gWildMonHeaders - bl get_wild_data_index_for_map - lsls r0, 16 - lsrs r0, 16 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r4, 0x10 - adds r1, r4 - ldr r0, [r1] - adds r1, r5, 0 - bl sub_80B5024 - lsls r0, 16 - lsrs r4, r0, 16 -_080B5784: - movs r0, 0xC - bl sav12_xor_increment - adds r0, r4, 0 - bl sub_80EDA3C - bl sub_80B0698 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B5734 - - thumb_func_start wild_pokemon_rand_for_map -wild_pokemon_rand_for_map: @ 80B57A0 - push {r4-r6,lr} - adds r6, r0, 0 - movs r0, 0 - strb r0, [r6] - bl get_wild_data_index_for_map - lsls r0, 16 - lsrs r3, r0, 16 - ldr r0, =0x0000ffff - cmp r3, r0 - beq _080B57D2 - ldr r2, =gWildMonHeaders - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 2 - adds r0, r2, 0x4 - adds r0, r1, r0 - ldr r5, [r0] - adds r2, 0x8 - adds r1, r2 - ldr r4, [r1] - cmp r5, 0 - bne _080B57E0 - cmp r4, 0 - bne _080B57E6 -_080B57D2: - movs r0, 0 - b _080B5826 - .pool -_080B57E0: - cmp r4, 0 - bne _080B57F4 - b _080B5818 -_080B57E6: - movs r0, 0x1 - strb r0, [r6] - bl wild_pokemon_rand_water - lsls r0, 24 - ldr r1, [r4, 0x4] - b _080B5820 -_080B57F4: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x4F - bls _080B5818 - movs r0, 0x1 - strb r0, [r6] - bl wild_pokemon_rand_water - lsls r0, 24 - ldr r1, [r4, 0x4] - b _080B5820 -_080B5818: - bl wild_pokemon_rand_grass - lsls r0, 24 - ldr r1, [r5, 0x4] -_080B5820: - lsrs r0, 22 - adds r0, r1 - ldrh r0, [r0, 0x2] -_080B5826: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end wild_pokemon_rand_for_map - - thumb_func_start sub_80B582C -sub_80B582C: @ 80B582C - push {r4,lr} - bl get_wild_data_index_for_map - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =0x0000ffff - cmp r2, r0 - beq _080B5868 - ldr r1, =gWildMonHeaders - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 2 - adds r1, 0x8 - adds r0, r1 - ldr r4, [r0] - cmp r4, 0 - beq _080B5868 - bl wild_pokemon_rand_water - lsls r0, 24 - ldr r1, [r4, 0x4] - lsrs r0, 22 - adds r0, r1 - ldrh r0, [r0, 0x2] - b _080B586A - .pool -_080B5868: - movs r0, 0 -_080B586A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B582C - - thumb_func_start sub_80B5870 -sub_80B5870: @ 80B5870 - push {r4,r5,lr} - bl InBattlePike - lsls r0, 24 - cmp r0, 0 - bne _080B58C4 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _080B58C4 - bl InUnionRoom - cmp r0, 0x1 - beq _080B58C4 - ldr r5, =0x00004021 - adds r0, r5, 0 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - beq _080B58C4 - subs r4, r0, 0x1 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl VarSet - cmp r4, 0 - bne _080B58C4 - ldr r0, =gUnknown_082A4B2A - bl script_env_1_execute_new_script - movs r0, 0x1 - b _080B58C6 - .pool -_080B58C4: - movs r0, 0 -_080B58C6: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80B5870 - - thumb_func_start sub_80B58CC -sub_80B58CC: @ 80B58CC - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x00004021 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080B5912 - movs r5, 0 -_080B58E0: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _080B5920 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _080B5920 - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - bcc _080B592A -_080B5912: - movs r0, 0x1 - b _080B592C - .pool -_080B5920: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _080B58E0 -_080B592A: - movs r0, 0 -_080B592C: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80B58CC - - thumb_func_start DoKeenEyeIntimidateWildEncounterTest -@ _BOOL1 DoKeenEyeIntimidateWildEncounterTest(u8 wildMonLevel) -DoKeenEyeIntimidateWildEncounterTest: @ 80B5934 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x020244ec - adds r0, r4, 0 - movs r1, 0x6 - bl pokemon_getattr - cmp r0, 0 - bne _080B5988 - adds r0, r4, 0 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x33 - beq _080B595A - cmp r0, 0x16 - bne _080B5988 -_080B595A: - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bls _080B5988 - subs r0, 0x5 - cmp r5, r0 - bgt _080B5988 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080B5988 - movs r0, 0 - b _080B598A - .pool -_080B5988: - movs r0, 0x1 -_080B598A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end DoKeenEyeIntimidateWildEncounterTest - - thumb_func_start TryGetRandomWildMonIndexByType -@ _BOOL1 TryGetRandomWildMonIndexByType(WildMonEntry *mons, u8 type, u8 numMons, u8 *monIndex) -TryGetRandomWildMonIndexByType: @ 80B5990 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r7, sp - mov r12, r0 - mov r8, r3 - lsls r1, 24 - lsrs r1, 24 - str r1, [r7] - lsls r2, 24 - lsrs r2, 24 - mov r9, sp - adds r0, r2, 0x3 - lsrs r0, 2 - lsls r0, 2 - mov r1, sp - subs r1, r0 - mov sp, r1 - mov r5, sp - movs r3, 0 - cmp r3, r2 - bcs _080B59D2 - movs r1, 0 -_080B59C4: - adds r0, r5, r3 - strb r1, [r0] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r2 - bcc _080B59C4 -_080B59D2: - movs r4, 0 - movs r3, 0 - cmp r4, r2 - bcs _080B5A12 - ldr r6, =gBaseStats - mov r10, r6 -_080B59DE: - lsls r0, r3, 2 - add r0, r12 - ldrh r1, [r0, 0x2] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - mov r6, r10 - adds r1, r0, r6 - ldrb r0, [r1, 0x6] - ldr r6, [r7] - cmp r0, r6 - beq _080B59FC - ldrb r0, [r1, 0x7] - cmp r0, r6 - bne _080B5A08 -_080B59FC: - adds r1, r4, 0 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - adds r1, r5, r1 - strb r3, [r1] -_080B5A08: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r2 - bcc _080B59DE -_080B5A12: - cmp r4, 0 - beq _080B5A1A - cmp r4, r2 - bne _080B5A24 -_080B5A1A: - movs r0, 0 - b _080B5A3C - .pool -_080B5A24: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __modsi3 - adds r0, r5, r0 - ldrb r0, [r0] - mov r1, r8 - strb r0, [r1] - movs r0, 0x1 -_080B5A3C: - mov sp, r9 - 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 TryGetRandomWildMonIndexByType - - thumb_func_start TryGetAbilityInfluencedWildMonIndex -@ _BOOL1 TryGetAbilityInfluencedWildMonIndex(WildMonEntry *mons, u8 type, u8 abilityId, u8 *monIndex) -TryGetAbilityInfluencedWildMonIndex: @ 80B5A50 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r0, 0 - mov r8, r3 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r5, r2, 24 - ldr r4, =0x020244ec - adds r0, r4, 0 - movs r1, 0x6 - bl pokemon_getattr - cmp r0, 0 - bne _080B5AA4 - adds r0, r4, 0 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - cmp r0, r5 - bne _080B5AA4 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080B5AA4 - adds r0, r7, 0 - adds r1, r6, 0 - movs r2, 0xC - mov r3, r8 - bl TryGetRandomWildMonIndexByType - lsls r0, 24 - lsrs r0, 24 - b _080B5AA6 - .pool -_080B5AA4: - movs r0, 0 -_080B5AA6: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end TryGetAbilityInfluencedWildMonIndex - - thumb_func_start affects_encounter_rate_based_on_flags -@ void affects_encounter_rate_based_on_flags(u32 *val) -affects_encounter_rate_based_on_flags: @ 80B5AB0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x000008ad - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B5AD0 - ldr r0, [r4] - lsrs r1, r0, 1 - adds r0, r1 - b _080B5AE2 - .pool -_080B5AD0: - ldr r0, =0x000008ae - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B5AE4 - ldr r0, [r4] - lsrs r0, 1 -_080B5AE2: - str r0, [r4] -_080B5AE4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end affects_encounter_rate_based_on_flags - - thumb_func_start ApplyCleanseTagWildEncounterRateReduction -ApplyCleanseTagWildEncounterRateReduction: @ 80B5AF0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x020244ec - movs r1, 0xC - bl pokemon_getattr - cmp r0, 0xBE - bne _080B5B0C - ldr r0, [r4] - lsls r0, 1 - movs r1, 0x3 - bl __udivsi3 - str r0, [r4] -_080B5B0C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ApplyCleanseTagWildEncounterRateReduction - - thumb_func_start FieldEffectStart -@ u8 FieldEffectStart(u8 id) -FieldEffectStart: @ 80B5B18 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl FieldEffectActiveListAdd - ldr r0, =gFieldEffectScriptPointers - lsls r4, 2 - adds r4, r0 - ldr r0, [r4] - str r0, [sp] - add r4, sp, 0x4 - ldr r5, =gUnknown_0855C1F0 -_080B5B36: - ldr r0, [sp] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r5 - ldr r2, [r0] - mov r0, sp - adds r1, r4, 0 - bl _call_via_r2 - lsls r0, 24 - cmp r0, 0 - bne _080B5B36 - ldr r0, [sp, 0x4] - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end FieldEffectStart - - thumb_func_start FieldEffectCmd_loadtiles -@ bool8 FieldEffectCmd_loadtiles(u8 **script, u8 *returnValue) -FieldEffectCmd_loadtiles: @ 80B5B60 - push {lr} - ldr r1, [r0] - adds r1, 0x1 - str r1, [r0] - bl FieldEffectScript_LoadTiles - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end FieldEffectCmd_loadtiles - - thumb_func_start FieldEffectCmd_loadfadedpal -@ bool8 FieldEffectCmd_loadfadedpal(u8 **script, u8 *returnValue) -FieldEffectCmd_loadfadedpal: @ 80B5B74 - push {lr} - ldr r1, [r0] - adds r1, 0x1 - str r1, [r0] - bl FieldEffectScript_LoadFadedPalette - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end FieldEffectCmd_loadfadedpal - - thumb_func_start FieldEffectCmd_loadpal -@ bool8 FieldEffectCmd_loadpal(u8 **script, u8 *returnValue) -FieldEffectCmd_loadpal: @ 80B5B88 - push {lr} - ldr r1, [r0] - adds r1, 0x1 - str r1, [r0] - bl FieldEffectScript_LoadPalette - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end FieldEffectCmd_loadpal - - thumb_func_start FieldEffectCmd_callnative -@ bool8 FieldEffectCmd_callnative(u8 **script, u8 *returnValue) -FieldEffectCmd_callnative: @ 80B5B9C - push {lr} - ldr r2, [r0] - adds r2, 0x1 - str r2, [r0] - bl FieldEffectScript_CallNative - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end FieldEffectCmd_callnative - - thumb_func_start FieldEffectCmd_end -@ bool8 FieldEffectCmd_end(u8 **script, u8 *returnValue) -FieldEffectCmd_end: @ 80B5BB0 - movs r0, 0 - bx lr - thumb_func_end FieldEffectCmd_end - - thumb_func_start FieldEffectCmd_loadgfx_callnative -@ bool8 FieldEffectCmd_loadgfx_callnative(u8 **script, u8 *returnValue) -FieldEffectCmd_loadgfx_callnative: @ 80B5BB4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, [r4] - adds r0, 0x1 - str r0, [r4] - adds r0, r4, 0 - bl FieldEffectScript_LoadTiles - adds r0, r4, 0 - bl FieldEffectScript_LoadFadedPalette - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldEffectScript_CallNative - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end FieldEffectCmd_loadgfx_callnative - - thumb_func_start FieldEffectCmd_loadtiles_callnative -@ bool8 FieldEffectCmd_loadtiles_callnative(u8 **script, u8 *returnValue) -FieldEffectCmd_loadtiles_callnative: @ 80B5BDC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, [r4] - adds r0, 0x1 - str r0, [r4] - adds r0, r4, 0 - bl FieldEffectScript_LoadTiles - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldEffectScript_CallNative - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end FieldEffectCmd_loadtiles_callnative - - thumb_func_start FieldEffectCmd_loadfadedpal_callnative -@ bool8 FieldEffectCmd_loadfadedpal_callnative(u8 **script, u8 *returnValue) -FieldEffectCmd_loadfadedpal_callnative: @ 80B5C00 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, [r4] - adds r0, 0x1 - str r0, [r4] - adds r0, r4, 0 - bl FieldEffectScript_LoadFadedPalette - adds r0, r4, 0 - adds r1, r5, 0 - bl FieldEffectScript_CallNative - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end FieldEffectCmd_loadfadedpal_callnative - - thumb_func_start FieldEffectScript_ReadWord -@ u32 FieldEffectScript_ReadWord(u8 **script) -FieldEffectScript_ReadWord: @ 80B5C24 - ldr r2, [r0] - ldrb r0, [r2] - ldrb r1, [r2, 0x1] - lsls r1, 8 - adds r0, r1 - ldrb r1, [r2, 0x2] - lsls r1, 16 - adds r0, r1 - ldrb r1, [r2, 0x3] - lsls r1, 24 - adds r0, r1 - bx lr - thumb_func_end FieldEffectScript_ReadWord - - thumb_func_start FieldEffectScript_LoadTiles -@ void FieldEffectScript_LoadTiles(u8 **script) -FieldEffectScript_LoadTiles: @ 80B5C3C - push {r4,r5,lr} - adds r4, r0, 0 - bl FieldEffectScript_ReadWord - adds r5, r0, 0 - ldrh r0, [r5, 0x6] - bl GetObjectTileRangeStartByTag - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - bne _080B5C5A - adds r0, r5, 0 - bl LoadObjectPic -_080B5C5A: - ldr r0, [r4] - adds r0, 0x4 - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end FieldEffectScript_LoadTiles - - thumb_func_start FieldEffectScript_LoadFadedPalette -@ void FieldEffectScript_LoadFadedPalette(u8 **script) -FieldEffectScript_LoadFadedPalette: @ 80B5C6C - push {r4,r5,lr} - adds r5, r0, 0 - bl FieldEffectScript_ReadWord - adds r4, r0, 0 - bl LoadTaggedObjectPalette - ldrh r0, [r4, 0x4] - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - bl sub_80ABE18 - ldr r0, [r5] - adds r0, 0x4 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end FieldEffectScript_LoadFadedPalette - - thumb_func_start FieldEffectScript_LoadPalette -@ void FieldEffectScript_LoadPalette(u8 **script) -FieldEffectScript_LoadPalette: @ 80B5C94 - push {r4,lr} - adds r4, r0, 0 - bl FieldEffectScript_ReadWord - bl LoadTaggedObjectPalette - ldr r0, [r4] - adds r0, 0x4 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - thumb_func_end FieldEffectScript_LoadPalette - - thumb_func_start FieldEffectScript_CallNative -@ void FieldEffectScript_CallNative(u8 **script, u8 *returnValue) -FieldEffectScript_CallNative: @ 80B5CAC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl FieldEffectScript_ReadWord - bl _call_via_r0 - str r0, [r5] - ldr r0, [r4] - adds r0, 0x4 - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end FieldEffectScript_CallNative - - thumb_func_start FieldEffectFreeGraphicsResources -@ void FieldEffectFreeGraphicsResources(struct obj *object) -FieldEffectFreeGraphicsResources: @ 80B5CC8 - push {r4,r5,lr} - adds r1, r0, 0 - adds r1, 0x40 - ldrh r5, [r1] - ldrb r4, [r0, 0x5] - lsrs r4, 4 - bl RemoveObjectAndFreeTiles - adds r0, r5, 0 - bl FieldEffectFreeTilesIfUnused - adds r0, r4, 0 - bl FieldEffectFreePaletteIfUnused - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end FieldEffectFreeGraphicsResources - - thumb_func_start FieldEffectStop -@ void FieldEffectStop(struct obj *object, u8 id) -FieldEffectStop: @ 80B5CEC - push {r4,lr} - lsls r4, r1, 24 - lsrs r4, 24 - bl FieldEffectFreeGraphicsResources - adds r0, r4, 0 - bl FieldEffectActiveListRemove - pop {r4} - pop {r0} - bx r0 - thumb_func_end FieldEffectStop - - thumb_func_start FieldEffectFreeTilesIfUnused -@ void FieldEffectFreeTilesIfUnused(u16 tileRangeStart) -FieldEffectFreeTilesIfUnused: @ 80B5D04 - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl GetTagByObjectTileRangeStart - lsls r0, 16 - lsrs r3, r0, 16 - ldr r0, =0x0000ffff - cmp r3, r0 - beq _080B5D58 - movs r2, 0 - ldr r5, =0x02020630 -_080B5D1E: - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r5 - adds r0, r1, 0 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - beq _080B5D48 - adds r0, r1, 0 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 25 - cmp r0, 0 - bge _080B5D48 - adds r0, r1, 0 - adds r0, 0x40 - ldrh r0, [r0] - cmp r4, r0 - beq _080B5D58 -_080B5D48: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3F - bls _080B5D1E - adds r0, r3, 0 - bl FreeObjectTilesByTag -_080B5D58: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end FieldEffectFreeTilesIfUnused - - thumb_func_start FieldEffectFreePaletteIfUnused -@ void FieldEffectFreePaletteIfUnused(u8 paletteSlot) -FieldEffectFreePaletteIfUnused: @ 80B5D68 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl GetObjectPaletteTagBySlot - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x0000ffff - cmp r5, r0 - beq _080B5DB0 - movs r2, 0 - ldr r6, =0x02020630 - adds r3, r4, 0 -_080B5D84: - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r6 - adds r0, r1, 0 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - beq _080B5DA0 - ldrb r0, [r1, 0x5] - lsrs r0, 4 - cmp r0, r3 - beq _080B5DB0 -_080B5DA0: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3F - bls _080B5D84 - adds r0, r5, 0 - bl FreeObjectPaletteByTag -_080B5DB0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end FieldEffectFreePaletteIfUnused - - thumb_func_start FieldEffectActiveListClear -@ void FieldEffectActiveListClear() -FieldEffectActiveListClear: @ 80B5DC0 - push {r4,lr} - movs r2, 0 - ldr r4, =0x03000f58 - movs r3, 0xFF -_080B5DC8: - adds r0, r2, r4 - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x1F - bls _080B5DC8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end FieldEffectActiveListClear - - thumb_func_start FieldEffectActiveListAdd -@ void FieldEffectActiveListAdd(u8 id) -FieldEffectActiveListAdd: @ 80B5DE4 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - movs r2, 0 - ldr r4, =0x03000f58 -_080B5DEE: - adds r1, r2, r4 - ldrb r0, [r1] - cmp r0, 0xFF - bne _080B5E00 - strb r3, [r1] - b _080B5E0A - .pool -_080B5E00: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x1F - bls _080B5DEE -_080B5E0A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end FieldEffectActiveListAdd - - thumb_func_start FieldEffectActiveListRemove -@ void FieldEffectActiveListRemove(u8 id) -FieldEffectActiveListRemove: @ 80B5E10 - push {r4,r5,lr} - lsls r0, 24 - lsrs r3, r0, 24 - movs r2, 0 - ldr r4, =0x03000f58 - movs r5, 0xFF -_080B5E1C: - adds r1, r2, r4 - ldrb r0, [r1] - cmp r0, r3 - bne _080B5E30 - orrs r0, r5 - strb r0, [r1] - b _080B5E3A - .pool -_080B5E30: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x1F - bls _080B5E1C -_080B5E3A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end FieldEffectActiveListRemove - - thumb_func_start FieldEffectActiveListContains -@ void FieldEffectActiveListContains(u8 id) -FieldEffectActiveListContains: @ 80B5E40 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0 - ldr r3, =0x03000f58 -_080B5E4A: - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _080B5E5C - movs r0, 0x1 - b _080B5E68 - .pool -_080B5E5C: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1F - bls _080B5E4A - movs r0, 0 -_080B5E68: - pop {r1} - bx r1 - thumb_func_end FieldEffectActiveListContains - - thumb_func_start sub_80B5E6C -sub_80B5E6C: @ 80B5E6C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - mov r9, r3 - ldr r7, [sp, 0x34] - lsls r4, 24 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 16 - lsrs r6, 16 - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsrs r4, 21 - ldr r3, =gTrainerFrontPicPaletteTable - mov r8, r3 - add r8, r4 - mov r0, r8 - adds r1, r7, 0 - bl LoadCompressedObjectPaletteOverrideBuffer - ldr r0, =gTrainerFrontPicTable - adds r4, r0 - adds r0, r4, 0 - adds r1, r7, 0 - bl LoadCompressedObjectPicOverrideBuffer - mov r1, sp - ldrh r0, [r4, 0x6] - movs r2, 0 - strh r0, [r1] - mov r3, r8 - ldrh r0, [r3, 0x4] - strh r0, [r1, 0x2] - ldr r0, =gNewGameBirchOamAttributes - str r0, [sp, 0x4] - ldr r0, =gDummyObjectImageAnimTable - str r0, [sp, 0x8] - str r2, [sp, 0xC] - ldr r0, =gDummyObjectRotScalAnimTable - str r0, [sp, 0x10] - ldr r0, =DummyObjectCallback - str r0, [sp, 0x14] - lsls r5, 16 - asrs r5, 16 - lsls r6, 16 - asrs r6, 16 - mov r0, sp - adds r1, r5, 0 - adds r2, r6, 0 - mov r3, r9 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B5E6C - - thumb_func_start sub_80B5F0C -sub_80B5F0C: @ 80B5F0C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r1, r2, 0 - lsls r4, 24 - lsls r5, 16 - lsrs r5, 16 - ldr r0, =gTrainerFrontPicTable - lsrs r4, 21 - adds r0, r4, r0 - ldr r0, [r0] - bl LZDecompressVram - ldr r0, =gTrainerFrontPicPaletteTable - adds r4, r0 - ldr r0, [r4] - adds r1, r5, 0 - movs r2, 0x20 - bl decompress_palette - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B5F0C - - thumb_func_start AddNewGameBirchObject -AddNewGameBirchObject: @ 80B5F44 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =gNewGameBirchObjectPaletteInfo - bl LoadTaggedObjectPalette - ldr r0, =gNewGameBirchObjectTemplate - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - adds r1, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end AddNewGameBirchObject - - thumb_func_start sub_80B5F84 -sub_80B5F84: @ 80B5F84 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 16 - lsrs r0, 16 - movs r3, 0x80 - lsls r3, 8 - lsls r1, 16 - asrs r1, 16 - str r1, [sp] - lsls r2, 16 - asrs r2, 16 - str r2, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - ldr r1, =gMonPaletteTable - lsls r4, r0, 3 - adds r4, r1 - ldrh r1, [r4, 0x4] - str r1, [sp, 0xC] - movs r1, 0 - adds r2, r3, 0 - movs r3, 0x1 - bl sub_818D7D8 - lsls r0, 16 - lsrs r5, r0, 16 - ldrh r0, [r4, 0x4] - bl IndexOfObjectPaletteTag - adds r0, 0x10 - lsls r0, 24 - lsrs r0, 24 - bl sub_80AC3F8 - ldr r0, =0x0000ffff - cmp r5, r0 - beq _080B5FDC - lsls r0, r5, 24 - lsrs r0, 24 - b _080B5FDE - .pool -_080B5FDC: - movs r0, 0x40 -_080B5FDE: - add sp, 0x10 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80B5F84 - - thumb_func_start sub_80B5FE8 -sub_80B5FE8: @ 80B5FE8 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0x10 - adds r6, r0, 0 - mov r9, r1 - mov r10, r2 - adds r4, r3, 0 - ldr r5, [sp, 0x2C] - lsls r6, 16 - lsrs r6, 16 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - adds r0, r6, 0 - bl sub_806E7CC - mov r8, r0 - lsls r4, 16 - asrs r4, 16 - str r4, [sp] - lsls r5, 16 - asrs r5, 16 - str r5, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - mov r1, r8 - ldrh r0, [r1, 0x4] - str r0, [sp, 0xC] - adds r0, r6, 0 - mov r1, r9 - mov r2, r10 - movs r3, 0x1 - bl sub_818D7D8 - lsls r0, 16 - lsrs r4, r0, 16 - mov r1, r8 - ldrh r0, [r1, 0x4] - bl IndexOfObjectPaletteTag - adds r0, 0x10 - lsls r0, 24 - lsrs r0, 24 - bl sub_80AC3F8 - ldr r0, =0x0000ffff - cmp r4, r0 - beq _080B605C - lsls r0, r4, 24 - lsrs r0, 24 - b _080B605E - .pool -_080B605C: - movs r0, 0x40 -_080B605E: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80B5FE8 - - thumb_func_start sub_80B6070 -sub_80B6070: @ 80B6070 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - bl sub_80AC428 - ldrb r0, [r4, 0x1] - lsls r0, 30 - cmp r0, 0 - beq _080B608E - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry -_080B608E: - adds r0, r5, 0 - bl sub_818D820 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80B6070 - - thumb_func_start sub_80B609C -sub_80B609C: @ 80B609C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 16 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - ldr r4, =0x02037714 - lsrs r0, 15 - adds r4, r0, r4 - ldrh r4, [r4] - movs r5, 0x1F - mov r9, r5 - mov r8, r4 - mov r6, r8 - ands r6, r5 - mov r8, r6 - movs r6, 0xF8 - lsls r6, 2 - ands r6, r4 - lsrs r6, 5 - movs r5, 0xF8 - lsls r5, 7 - ands r4, r5 - lsrs r4, 10 - mov r7, r9 - mov r5, r8 - subs r7, r5 - mov r12, r7 - mov r7, r12 - muls r7, r1 - adds r1, r7, 0 - asrs r1, 4 - add r8, r1 - mov r5, r9 - subs r1, r5, r6 - muls r1, r2 - asrs r1, 4 - adds r6, r1 - subs r5, r4 - mov r9, r5 - mov r1, r9 - muls r1, r3 - asrs r1, 4 - adds r4, r1 - mov r7, r8 - lsls r7, 16 - lsls r6, 21 - orrs r6, r7 - lsls r4, 26 - orrs r4, r6 - lsrs r4, 16 - ldr r1, =0x02037b14 - adds r0, r1 - strh r4, [r0] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B609C - - thumb_func_start sub_80B6128 -sub_80B6128: @ 80B6128 - push {r4-r6,lr} - mov r6, r8 - push {r6} - lsls r0, 16 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - ldr r4, =0x02037714 - lsrs r0, 15 - adds r4, r0, r4 - ldrh r4, [r4] - movs r5, 0x1F - mov r8, r5 - mov r6, r8 - ands r6, r4 - mov r8, r6 - movs r5, 0xF8 - lsls r5, 2 - ands r5, r4 - lsrs r5, 5 - movs r6, 0xF8 - lsls r6, 7 - ands r4, r6 - lsrs r4, 10 - mov r6, r8 - muls r6, r1 - adds r1, r6, 0 - asrs r1, 4 - mov r6, r8 - subs r6, r1 - adds r1, r5, 0 - muls r1, r2 - asrs r1, 4 - subs r5, r1 - adds r1, r4, 0 - muls r1, r3 - asrs r1, 4 - subs r4, r1 - lsls r6, 16 - lsls r5, 21 - orrs r5, r6 - lsls r4, 26 - orrs r4, r5 - lsrs r4, 16 - ldr r1, =0x02037b14 - adds r0, r1 - strh r4, [r0] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6128 - - thumb_func_start sub_80B61A0 -sub_80B61A0: @ 80B61A0 - push {r4,lr} - bl calc_player_party_count - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =sub_80B61E4 - movs r1, 0xFF - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r1, r0 - strh r4, [r1, 0xA] - movs r0, 0x5D - strh r0, [r1, 0xC] - movs r0, 0x24 - strh r0, [r1, 0xE] - movs r0, 0x7C - strh r0, [r1, 0x10] - movs r0, 0x18 - strh r0, [r1, 0x12] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B61A0 - - thumb_func_start sub_80B61E4 -sub_80B61E4: @ 80B61E4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r1, r0 - ldr r2, =gUnknown_0855C364 - movs r3, 0x8 - ldrsh r0, [r1, r3] - lsls r0, 2 - adds r0, r2 - ldr r2, [r0] - adds r0, r1, 0 - bl _call_via_r2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B61E4 - - thumb_func_start sub_80B6214 -sub_80B6214: @ 80B6214 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r1, 0xA - ldrsh r0, [r4, r1] - movs r2, 0xC - ldrsh r1, [r4, r2] - movs r3, 0xE - ldrsh r2, [r4, r3] - movs r3, 0x1 - bl sub_80B646C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x14] - movs r1, 0x10 - ldrsh r0, [r4, r1] - movs r2, 0x12 - ldrsh r1, [r4, r2] - bl sub_80B6850 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x16] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80B6214 - - thumb_func_start sub_80B6250 -sub_80B6250: @ 80B6250 - push {r4,lr} - adds r2, r0, 0 - ldr r3, =0x02020630 - movs r1, 0x14 - ldrsh r0, [r2, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - movs r4, 0x2E - ldrsh r0, [r1, r4] - cmp r0, 0x1 - ble _080B6282 - movs r0, 0x16 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x2E] - adds r1, 0x1 - strh r1, [r0, 0x2E] - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] -_080B6282: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6250 - - thumb_func_start sub_80B628C -sub_80B628C: @ 80B628C - push {lr} - adds r3, r0, 0 - ldr r2, =0x02020630 - movs r0, 0x14 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2E - ldrsh r0, [r0, r1] - cmp r0, 0x4 - ble _080B62AC - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] -_080B62AC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B628C - - thumb_func_start sub_80B62B4 -sub_80B62B4: @ 80B62B4 - push {lr} - ldr r2, =0x02020630 - movs r3, 0x14 - ldrsh r1, [r0, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0x6 - ble _080B62E6 - adds r0, r1, 0 - bl RemoveObjectAndFreeTiles - movs r0, 0x19 - bl FieldEffectActiveListRemove - ldr r0, =sub_80B61E4 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B62E6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B62B4 - - thumb_func_start sub_80B62F4 -sub_80B62F4: @ 80B62F4 - push {r4,lr} - bl calc_player_party_count - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =sub_80B6330 - movs r1, 0xFF - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r1, r0 - strh r4, [r1, 0xA] - movs r0, 0x75 - strh r0, [r1, 0xC] - movs r0, 0x34 - strh r0, [r1, 0xE] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B62F4 - - thumb_func_start sub_80B6330 -sub_80B6330: @ 80B6330 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r1, r0 - ldr r2, =gUnknown_0855C374 - movs r3, 0x8 - ldrsh r0, [r1, r3] - lsls r0, 2 - adds r0, r2 - ldr r2, [r0] - adds r0, r1, 0 - bl _call_via_r2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6330 - - thumb_func_start sub_80B6360 -sub_80B6360: @ 80B6360 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r1, 0xA - ldrsh r0, [r4, r1] - movs r2, 0xC - ldrsh r1, [r4, r2] - movs r3, 0xE - ldrsh r2, [r4, r3] - movs r3, 0 - bl sub_80B646C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x14] - ldr r0, =sub_80B6330 - bl FindTaskIdByFunc - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0x78 - movs r2, 0x18 - movs r3, 0 - bl sub_80B68EC - adds r0, r4, 0 - movs r1, 0x28 - movs r2, 0x8 - movs r3, 0x1 - bl sub_80B68EC - adds r0, r4, 0 - movs r1, 0x48 - movs r2, 0x8 - movs r3, 0x1 - bl sub_80B68EC - adds r0, r4, 0 - movs r1, 0xA8 - movs r2, 0x8 - movs r3, 0x1 - bl sub_80B68EC - adds r0, r4, 0 - movs r1, 0xC8 - movs r2, 0x8 - movs r3, 0x1 - bl sub_80B68EC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6360 - - thumb_func_start sub_80B63D4 -sub_80B63D4: @ 80B63D4 - push {lr} - adds r3, r0, 0 - ldr r2, =0x02020630 - movs r0, 0x14 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2E - ldrsh r0, [r0, r1] - cmp r0, 0x1 - ble _080B63FA - ldrh r0, [r3, 0x26] - adds r0, 0x1 - strh r0, [r3, 0x26] - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] -_080B63FA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B63D4 - - thumb_func_start sub_80B6404 -sub_80B6404: @ 80B6404 - push {lr} - adds r3, r0, 0 - ldr r2, =0x02020630 - movs r0, 0x14 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2E - ldrsh r0, [r0, r1] - cmp r0, 0x4 - ble _080B6424 - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] -_080B6424: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6404 - - thumb_func_start sub_80B642C -sub_80B642C: @ 80B642C - push {lr} - ldr r2, =0x02020630 - movs r3, 0x14 - ldrsh r1, [r0, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0x6 - ble _080B645E - adds r0, r1, 0 - bl RemoveObjectAndFreeTiles - movs r0, 0x3E - bl FieldEffectActiveListRemove - ldr r0, =sub_80B6330 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B645E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B642C - - thumb_func_start sub_80B646C -sub_80B646C: @ 80B646C - push {r4-r6,lr} - mov r6, r8 - push {r6} - mov r8, r0 - adds r4, r1, 0 - adds r5, r2, 0 - adds r6, r3, 0 - 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 - ldr r0, =sub_80B64C0 - bl obj_add_empty_with_callback - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r2, =0x02020630 - adds r1, r2 - strh r4, [r1, 0x24] - strh r5, [r1, 0x26] - strh r6, [r1, 0x38] - mov r2, r8 - strh r2, [r1, 0x3A] - strh r0, [r1, 0x3C] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B646C - - thumb_func_start sub_80B64C0 -sub_80B64C0: @ 80B64C0 - push {lr} - ldr r2, =gUnknown_0855C384 - movs r3, 0x2E - ldrsh r1, [r0, r3] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B64C0 - - thumb_func_start sub_80B64DC -sub_80B64DC: @ 80B64DC - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x30] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _080B64F4 - subs r0, r1, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - cmp r0, 0 - bne _080B6550 -_080B64F4: - movs r0, 0x19 - strh r0, [r4, 0x30] - ldr r0, =gUnknown_0855C304 - ldr r1, =gUnknown_0855C3A4 - movs r2, 0x32 - ldrsh r3, [r4, r2] - lsls r3, 2 - adds r3, r1 - ldrh r1, [r4, 0x24] - ldrh r2, [r3] - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - ldrh r2, [r4, 0x26] - ldrh r3, [r3, 0x2] - adds r2, r3 - lsls r2, 16 - asrs r2, 16 - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - 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 - movs r2, 0x8 - orrs r0, r2 - strb r0, [r1, 0x5] - ldrh r0, [r4, 0x3C] - strh r0, [r1, 0x2E] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x3A] - subs r0, 0x1 - strh r0, [r4, 0x3A] - movs r0, 0x17 - bl audio_play -_080B6550: - movs r1, 0x3A - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B6562 - movs r0, 0x20 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_080B6562: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B64DC - - thumb_func_start sub_80B6574 -sub_80B6574: @ 80B6574 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x30] - subs r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - asrs r2, r0, 16 - cmp r2, 0 - bne _080B65A4 - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - movs r0, 0x8 - strh r0, [r1, 0x30] - strh r2, [r1, 0x32] - strh r2, [r1, 0x34] - movs r2, 0x38 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _080B65A4 - movs r0, 0xB8 - lsls r0, 1 - bl fanfare_play -_080B65A4: - pop {r0} - bx r0 - thumb_func_end sub_80B6574 - - thumb_func_start sub_80B65A8 -sub_80B65A8: @ 80B65A8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r7, r0, 0 - ldrh r0, [r7, 0x30] - subs r0, 0x1 - strh r0, [r7, 0x30] - lsls r0, 16 - cmp r0, 0 - bne _080B65D8 - movs r0, 0x8 - strh r0, [r7, 0x30] - ldrh r0, [r7, 0x32] - adds r0, 0x1 - movs r1, 0x3 - ands r0, r1 - strh r0, [r7, 0x32] - cmp r0, 0 - bne _080B65D8 - ldrh r0, [r7, 0x34] - adds r0, 0x1 - strh r0, [r7, 0x34] -_080B65D8: - ldrh r4, [r7, 0x32] - adds r4, 0x3 - movs r0, 0x3 - mov r8, r0 - mov r1, r8 - ands r4, r1 - ldr r3, =0x00001007 - mov r10, r3 - mov r0, r10 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 4 - movs r1, 0x84 - lsls r1, 17 - adds r0, r1 - lsrs r0, 16 - ldr r6, =gUnknown_0855C3BC - adds r1, r4, r6 - ldrb r1, [r1] - ldr r5, =gUnknown_0855C3C0 - adds r2, r4, r5 - ldrb r2, [r2] - ldr r3, =gUnknown_0855C3C4 - mov r9, r3 - add r4, r9 - ldrb r3, [r4] - bl sub_80B609C - ldrh r4, [r7, 0x32] - adds r4, 0x2 - mov r0, r8 - ands r4, r0 - mov r0, r10 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 4 - movs r1, 0x83 - lsls r1, 17 - adds r0, r1 - lsrs r0, 16 - adds r1, r4, r6 - ldrb r1, [r1] - adds r2, r4, r5 - ldrb r2, [r2] - add r4, r9 - ldrb r3, [r4] - bl sub_80B609C - ldrh r4, [r7, 0x32] - adds r4, 0x1 - mov r3, r8 - ands r4, r3 - mov r0, r10 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 4 - movs r1, 0x81 - lsls r1, 17 - adds r0, r1 - lsrs r0, 16 - adds r1, r4, r6 - ldrb r1, [r1] - adds r2, r4, r5 - ldrb r2, [r2] - add r4, r9 - ldrb r3, [r4] - bl sub_80B609C - ldrh r4, [r7, 0x32] - lsls r4, 24 - lsrs r4, 24 - mov r0, r10 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 4 - ldr r3, =0x01050000 - adds r0, r3 - lsrs r0, 16 - adds r6, r4, r6 - ldrb r6, [r6] - adds r5, r4, r5 - ldrb r5, [r5] - add r4, r9 - ldrb r4, [r4] - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_80B609C - mov r0, r10 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 4 - ldr r1, =0x01030000 - adds r0, r1 - lsrs r0, 16 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_80B609C - movs r3, 0x34 - ldrsh r0, [r7, r3] - cmp r0, 0x2 - ble _080B66C2 - ldrh r0, [r7, 0x2E] - adds r0, 0x1 - movs r1, 0 - strh r0, [r7, 0x2E] - movs r0, 0x8 - strh r0, [r7, 0x30] - strh r1, [r7, 0x32] -_080B66C2: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B65A8 - - thumb_func_start sub_80B66E8 -sub_80B66E8: @ 80B66E8 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r2, r0, 0 - ldrh r0, [r2, 0x30] - subs r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - cmp r0, 0 - bne _080B6718 - movs r0, 0x8 - strh r0, [r2, 0x30] - ldrh r0, [r2, 0x32] - adds r0, 0x1 - movs r1, 0x3 - ands r0, r1 - strh r0, [r2, 0x32] - cmp r0, 0x3 - bne _080B6718 - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - movs r0, 0x1E - strh r0, [r2, 0x30] -_080B6718: - ldrh r4, [r2, 0x32] - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x00001007 - mov r8, r0 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 4 - movs r1, 0x84 - lsls r1, 17 - adds r0, r1 - lsrs r0, 16 - ldr r1, =gUnknown_0855C3BC - adds r1, r4, r1 - ldrb r6, [r1] - ldr r1, =gUnknown_0855C3C0 - adds r1, r4, r1 - ldrb r5, [r1] - ldr r1, =gUnknown_0855C3C4 - adds r4, r1 - ldrb r4, [r4] - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_80B609C - mov r0, r8 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 4 - movs r1, 0x83 - lsls r1, 17 - adds r0, r1 - lsrs r0, 16 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_80B609C - mov r0, r8 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 4 - movs r1, 0x81 - lsls r1, 17 - adds r0, r1 - lsrs r0, 16 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_80B609C - mov r0, r8 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 4 - ldr r1, =0x01050000 - adds r0, r1 - lsrs r0, 16 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_80B609C - mov r0, r8 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 4 - ldr r1, =0x01030000 - adds r0, r1 - lsrs r0, 16 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_80B609C - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B66E8 - - thumb_func_start sub_80B67DC -sub_80B67DC: @ 80B67DC - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x30] - subs r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - cmp r0, 0 - bne _080B67F2 - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] -_080B67F2: - pop {r0} - bx r0 - thumb_func_end sub_80B67DC - - thumb_func_start sub_80B67F8 -sub_80B67F8: @ 80B67F8 - ldrh r1, [r0, 0x2E] - adds r1, 0x1 - strh r1, [r0, 0x2E] - bx lr - thumb_func_end sub_80B67F8 - - thumb_func_start sub_80B6800 -sub_80B6800: @ 80B6800 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x38 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080B6816 - bl task_is_not_running_overworld_fanfare - lsls r0, 24 - cmp r0, 0 - beq _080B681C -_080B6816: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_080B681C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80B6800 - - thumb_func_start nullsub_97 -nullsub_97: @ 80B6824 - bx lr - thumb_func_end nullsub_97 - - thumb_func_start sub_80B6828 -sub_80B6828: @ 80B6828 - push {lr} - adds r3, r0, 0 - ldr r2, =0x02020630 - movs r0, 0x2E - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2E - ldrsh r0, [r0, r1] - cmp r0, 0x4 - ble _080B6848 - adds r0, r3, 0 - bl FieldEffectFreeGraphicsResources -_080B6848: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6828 - - thumb_func_start sub_80B6850 -sub_80B6850: @ 80B6850 - push {r4,lr} - adds r3, r0, 0 - adds r2, r1, 0 - ldr r0, =gUnknown_0855C31C - lsls r3, 16 - asrs r3, 16 - lsls r2, 16 - asrs r2, 16 - adds r1, r3, 0 - movs r3, 0 - bl AddObjectToBack - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0, 0x5] - adds r3, r0, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r3] - ldr r1, =gUnknown_0855C2AC - bl SetSpriteOamTables_NoPriorityFromTable - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B6850 - - thumb_func_start sub_80B68AC -sub_80B68AC: @ 80B68AC - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080B68D0 - movs r0, 0 - strh r0, [r4, 0x2E] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - subs r0, 0x5 - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnim -_080B68D0: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080B68E4 - adds r0, r4, 0 - bl FieldEffectFreeGraphicsResources -_080B68E4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80B68AC - - thumb_func_start sub_80B68EC -sub_80B68EC: @ 80B68EC - push {r4,r5,lr} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - lsls r3, 24 - cmp r3, 0 - bne _080B6934 - ldr r0, =gUnknown_0855C334 - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - ldr r1, =gUnknown_0855C2C4 - bl SetSpriteOamTables_NoPriorityFromTable - b _080B6948 - .pool -_080B6934: - ldr r0, =gUnknown_0855C34C - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r4, r0, 24 -_080B6948: - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - adds r3, r0, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r3] - strh r5, [r0, 0x2E] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B68EC - - thumb_func_start sub_80B6970 -sub_80B6970: @ 80B6970 - push {lr} - adds r3, r0, 0 - ldr r2, =0x03005e00 - movs r0, 0x2E - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x26 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _080B69C6 - ldrh r1, [r3, 0x30] - movs r2, 0x30 - ldrsh r0, [r3, r2] - cmp r0, 0 - beq _080B699E - subs r0, r1, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - cmp r0, 0 - bne _080B69C0 -_080B699E: - movs r0, 0x10 - strh r0, [r3, 0x30] - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - 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 - mov r1, r12 - strb r0, [r1] -_080B69C0: - ldrh r0, [r3, 0x32] - adds r0, 0x1 - strh r0, [r3, 0x32] -_080B69C6: - movs r2, 0x32 - ldrsh r0, [r3, r2] - cmp r0, 0x7F - ble _080B69D4 - adds r0, r3, 0 - bl FieldEffectFreeGraphicsResources -_080B69D4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6970 - - thumb_func_start sub_80B69DC -sub_80B69DC: @ 80B69DC - push {lr} - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - ldr r1, =0x03005dac - ldr r0, =mapldr_080842E8 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B69DC - - thumb_func_start mapldr_080842E8 -mapldr_080842E8: @ 80B69FC - push {lr} - bl pal_fill_black - ldr r0, =task00_8084310 - movs r1, 0 - bl CreateTask - bl script_env_2_enable - bl player_bitmagic - ldr r1, =0x03005dac - movs r0, 0 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end mapldr_080842E8 - - thumb_func_start task00_8084310 -task00_8084310: @ 80B6A24 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r6, [r4, r0] - cmp r6, 0 - bne _080B6A64 - bl sub_80ABDFC - lsls r0, 24 - cmp r0, 0 - beq _080B6A8A - bl brm_get_pokemon_selection - ldr r1, =0x02038c08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - cmp r0, 0x5 - ble _080B6A58 - str r6, [r1] -_080B6A58: - movs r0, 0x1F - bl FieldEffectStart - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B6A64: - movs r0, 0x1F - bl FieldEffectActiveListContains - lsls r0, 24 - cmp r0, 0 - bne _080B6A8A - bl flag_var_implications_of_teleport_ - bl warp_in - ldr r0, =c2_load_new_map - bl SetMainCallback2 - ldr r1, =0x03005dac - ldr r0, =mapldr_08084390 - str r0, [r1] - adds r0, r5, 0 - bl DestroyTask -_080B6A8A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task00_8084310 - - thumb_func_start mapldr_08084390 -mapldr_08084390: @ 80B6AA4 - push {r4,lr} - bl sub_8085784 - bl pal_fill_black - ldr r0, =c3_080843F8 - movs r1, 0 - bl CreateTask - ldr r4, =0x02037350 - ldr r3, =0x02037590 - ldrb r1, [r3, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x1] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0, 0x1] - ldrb r1, [r3] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _080B6AE6 - ldrb r1, [r3, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x3 - bl FieldObjectTurn -_080B6AE6: - bl script_env_2_enable - bl player_bitmagic - ldr r1, =0x03005dac - movs r0, 0 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end mapldr_08084390 - - thumb_func_start c3_080843F8 -c3_080843F8: @ 80B6B0C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B6B3E - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080B6B58 - movs r0, 0x20 - bl FieldEffectStart - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B6B3E: - movs r0, 0x20 - bl FieldEffectActiveListContains - lsls r0, 24 - cmp r0, 0 - bne _080B6B58 - bl script_env_2_disable - bl sub_809757C - adds r0, r5, 0 - bl DestroyTask -_080B6B58: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end c3_080843F8 - - thumb_func_start sub_80B6B68 -sub_80B6B68: @ 80B6B68 - push {lr} - bl sub_8085784 - bl pal_fill_for_maplights - bl script_env_2_enable - bl player_bitmagic - ldr r0, =sub_80B6B94 - movs r1, 0 - bl CreateTask - ldr r1, =0x03005dac - movs r0, 0 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6B68 - - thumb_func_start sub_80B6B94 -sub_80B6B94: @ 80B6B94 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r4, r1, r0 - ldr r5, =gUnknown_0855C3C8 -_080B6BA6: - 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 _080B6BA6 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6B94 - - thumb_func_start sub_80B6BCC -sub_80B6BCC: @ 80B6BCC - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - mov r9, r0 - ldr r6, =0x02037590 - ldrb r0, [r6, 0x5] - lsls r5, r0, 3 - adds r5, r0 - lsls r5, 2 - ldr r0, =0x02037350 - mov r8, r0 - add r5, r8 - ldrb r0, [r6, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - bl CameraObjectReset2 - ldrb r1, [r6, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldrb r1, [r0, 0x1] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0, 0x1] - movs r0, 0x1 - strb r0, [r6, 0x6] - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl FieldObjectSetSpecialAnim - adds r3, r4, 0 - adds r3, 0x42 - ldrb r0, [r3] - lsrs r0, 6 - mov r1, r9 - strh r0, [r1, 0x10] - ldrb r0, [r5, 0x3] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r5, 0x3] - ldrb r1, [r4, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - orrs r0, r2 - strb r0, [r4, 0x5] - ldrb r1, [r3] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x80 - orrs r0, r1 - strb r0, [r3] - mov r1, r9 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - movs r0, 0x1 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B6BCC - - thumb_func_start sub_80B6C74 -sub_80B6C74: @ 80B6C74 - push {r4,lr} - adds r4, r0, 0 - bl sub_80ABDFC - lsls r0, 24 - cmp r0, 0 - beq _080B6C88 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B6C88: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B6C74 - - thumb_func_start sub_80B6C90 -sub_80B6C90: @ 80B6C90 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =0x02037590 - ldrb r0, [r6, 0x4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x02020630 - adds r2, r0 - adds r0, r2, 0 - adds r0, 0x29 - movs r4, 0 - ldrsb r4, [r0, r4] - lsls r0, r4, 17 - negs r0, r0 - ldrh r1, [r2, 0x22] - ldr r3, =0x02021bbe - adds r1, r4 - ldrh r3, [r3] - adds r1, r3 - asrs r0, 16 - adds r0, r1 - negs r0, r0 - movs r1, 0 - strh r0, [r2, 0x26] - movs r0, 0x1 - strh r0, [r5, 0xA] - strh r1, [r5, 0xC] - ldr r2, =0x02037350 - ldrb r0, [r6, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - movs r0, 0x2B - bl audio_play - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B6C90 - - thumb_func_start sub_80B6D04 -sub_80B6D04: @ 80B6D04 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r2, =0x02037590 - ldrb r1, [r2, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r6, r0, r1 - ldrb r1, [r2, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r5, r0, r1 - ldrh r0, [r4, 0xA] - ldrh r1, [r5, 0x26] - adds r0, r1 - strh r0, [r5, 0x26] - ldrh r2, [r4, 0xA] - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x7 - bgt _080B6D46 - ldrh r1, [r4, 0xC] - adds r0, r2, r1 - strh r0, [r4, 0xC] - movs r1, 0xF - ands r0, r1 - cmp r0, 0 - beq _080B6D46 - lsls r0, r2, 1 - strh r0, [r4, 0xA] -_080B6D46: - ldrh r2, [r4, 0xE] - movs r1, 0xE - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B6D84 - movs r0, 0x26 - ldrsh r1, [r5, r0] - movs r0, 0x10 - negs r0, r0 - cmp r1, r0 - blt _080B6D84 - adds r0, r2, 0x1 - strh r0, [r4, 0xE] - ldrb r1, [r6, 0x3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r6, 0x3] - ldrb r1, [r4, 0x10] - adds r3, r5, 0 - adds r3, 0x42 - lsls r1, 6 - ldrb r2, [r3] - movs r0, 0x3F - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - ldrb r0, [r6] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r6] -_080B6D84: - movs r1, 0x26 - ldrsh r0, [r5, r1] - cmp r0, 0 - blt _080B6DA8 - movs r0, 0xD6 - bl audio_play - ldrb r0, [r6] - movs r1, 0x8 - orrs r0, r1 - movs r1, 0x20 - orrs r0, r1 - strb r0, [r6] - movs r0, 0 - strh r0, [r5, 0x26] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B6DA8: - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B6D04 - - thumb_func_start sub_80B6DBC -sub_80B6DBC: @ 80B6DBC - push {lr} - ldrh r1, [r0, 0x8] - adds r1, 0x1 - movs r2, 0 - strh r1, [r0, 0x8] - movs r1, 0x4 - strh r1, [r0, 0xA] - strh r2, [r0, 0xC] - movs r0, 0 - bl SetCameraPanningCallback - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_80B6DBC - - thumb_func_start sub_80B6DD8 -sub_80B6DD8: @ 80B6DD8 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0xA - ldrsh r1, [r4, r0] - movs r0, 0 - bl SetCameraPanning - ldrh r0, [r4, 0xA] - negs r2, r0 - strh r2, [r4, 0xA] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _080B6E00 - lsls r0, r2, 16 - asrs r0, 17 - strh r0, [r4, 0xA] -_080B6E00: - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B6E0E - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B6E0E: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B6DD8 - - thumb_func_start sub_80B6E18 -sub_80B6E18: @ 80B6E18 - push {lr} - ldr r1, =0x02037590 - movs r0, 0 - strb r0, [r1, 0x6] - bl script_env_2_disable - bl CameraObjectReset1 - bl sub_809757C - bl InstallCameraPanAheadCallback - ldr r0, =sub_80B6B94 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B6E18 - - thumb_func_start sub_80B6E4C -sub_80B6E4C: @ 80B6E4C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =sub_80B6E88 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0 - strh r0, [r1, 0xA] - cmp r4, 0x6A - bne _080B6E78 - movs r0, 0x1 - strh r0, [r1, 0xA] -_080B6E78: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6E4C - - thumb_func_start sub_80B6E88 -sub_80B6E88: @ 80B6E88 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r4, r1, r0 - ldr r5, =gUnknown_0855C3E4 -_080B6E9A: - 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 _080B6E9A - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6E88 - - thumb_func_start sub_80B6EC0 -sub_80B6EC0: @ 80B6EC0 - push {r4,lr} - adds r4, r0, 0 - bl player_bitmagic - bl CameraObjectReset2 - ldrb r0, [r4, 0xA] - bl sub_80E1558 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B6EC0 - - thumb_func_start sub_80B6EE0 -sub_80B6EE0: @ 80B6EE0 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - adds r0, r4, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _080B6F0A - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B6F3E -_080B6F0A: - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - ldrh r0, [r5, 0x8] - adds r0, 0x1 - movs r1, 0 - strh r0, [r5, 0x8] - strh r1, [r5, 0xC] - strh r1, [r5, 0xE] - ldrb r0, [r5, 0xA] - cmp r0, 0 - bne _080B6F38 - movs r0, 0x4 - strh r0, [r5, 0x8] -_080B6F38: - movs r0, 0x50 - bl audio_play -_080B6F3E: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B6EE0 - - thumb_func_start sub_80B6F50 -sub_80B6F50: @ 80B6F50 - push {r4,lr} - adds r4, r0, 0 - bl sub_80B6FB8 - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0x3 - ble _080B6F6A - bl sub_80B7050 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B6F6A: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B6F50 - - thumb_func_start sub_80B6F74 -sub_80B6F74: @ 80B6F74 - push {lr} - bl sub_80B6FB8 - bl sub_80B7060 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_80B6F74 - - thumb_func_start sub_80B6F84 -sub_80B6F84: @ 80B6F84 - push {r4,lr} - adds r4, r0, 0 - bl sub_80B7004 - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0x3 - ble _080B6F9E - bl sub_80B7050 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B6F9E: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B6F84 - - thumb_func_start sub_80B6FA8 -sub_80B6FA8: @ 80B6FA8 - push {lr} - bl sub_80B7004 - bl sub_80B7060 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_80B6FA8 - - thumb_func_start sub_80B6FB8 -sub_80B6FB8: @ 80B6FB8 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - movs r0, 0xC - ldrsh r1, [r5, r0] - movs r0, 0x84 - bl cosine - strh r0, [r4, 0x24] - movs r0, 0xC - ldrsh r1, [r5, r0] - movs r0, 0x94 - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r5, 0xE] - adds r0, 0x1 - strh r0, [r5, 0xE] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080B6FF6 - ldrh r0, [r5, 0xC] - adds r0, 0x1 - strh r0, [r5, 0xC] -_080B6FF6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B6FB8 - - thumb_func_start sub_80B7004 -sub_80B7004: @ 80B7004 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - movs r0, 0xC - ldrsh r1, [r5, r0] - movs r0, 0x7C - bl cosine - strh r0, [r4, 0x24] - movs r0, 0xC - ldrsh r1, [r5, r0] - movs r0, 0x76 - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r5, 0xE] - adds r0, 0x1 - strh r0, [r5, 0xE] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080B7042 - ldrh r0, [r5, 0xC] - adds r0, 0x1 - strh r0, [r5, 0xC] -_080B7042: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B7004 - - thumb_func_start sub_80B7050 -sub_80B7050: @ 80B7050 - push {lr} - bl music_something - bl sub_80AF0B4 - pop {r0} - bx r0 - thumb_func_end sub_80B7050 - - thumb_func_start sub_80B7060 -sub_80B7060: @ 80B7060 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080B709C - bl sub_80859A0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B709C - bl sub_80E1570 - bl warp_in - ldr r1, =0x03005dac - ldr r0, =sub_80B70B4 - str r0, [r1] - ldr r0, =c2_load_new_map - bl SetMainCallback2 - ldr r0, =sub_80B6E88 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B709C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B7060 - - thumb_func_start sub_80B70B4 -sub_80B70B4: @ 80B70B4 - push {lr} - bl sub_8085784 - bl pal_fill_for_maplights - bl script_env_2_enable - ldr r0, =sub_80B70DC - movs r1, 0 - bl CreateTask - ldr r1, =0x03005dac - movs r0, 0 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B70B4 - - thumb_func_start sub_80B70DC -sub_80B70DC: @ 80B70DC - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r4, r1, r0 - ldr r5, =gUnknown_0855C3FC -_080B70EE: - 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 _080B70EE - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B70DC - - thumb_func_start sub_80B7114 -sub_80B7114: @ 80B7114 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - bl CameraObjectReset2 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - movs r0, 0x4 - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r1, r0, 24 - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0x10 - strh r0, [r5, 0xA] - cmp r1, 0x6B - bne _080B717C - movs r1, 0x1 - movs r0, 0x3 - strh r0, [r5, 0x8] - b _080B717E - .pool -_080B717C: - movs r1, 0 -_080B717E: - adds r0, r1, 0 - bl sub_80E1558 - movs r0, 0x1 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80B7114 - - thumb_func_start sub_80B7190 -sub_80B7190: @ 80B7190 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - movs r0, 0xA - ldrsh r1, [r5, r0] - movs r0, 0x84 - bl cosine - strh r0, [r4, 0x24] - movs r0, 0xA - ldrsh r1, [r5, r0] - movs r0, 0x94 - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B7190 - - thumb_func_start sub_80B71D0 -sub_80B71D0: @ 80B71D0 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r5, r0, r1 - movs r0, 0xA - ldrsh r1, [r4, r0] - movs r0, 0x84 - bl cosine - strh r0, [r5, 0x24] - movs r0, 0xA - ldrsh r1, [r4, r0] - movs r0, 0x94 - bl sine - strh r0, [r5, 0x26] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080B720E - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] -_080B720E: - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B721E - strh r0, [r5, 0x24] - strh r0, [r5, 0x26] - movs r0, 0x5 - strh r0, [r4, 0x8] -_080B721E: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B71D0 - - thumb_func_start sub_80B7230 -sub_80B7230: @ 80B7230 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - movs r0, 0xA - ldrsh r1, [r5, r0] - movs r0, 0x7C - bl cosine - strh r0, [r4, 0x24] - movs r0, 0xA - ldrsh r1, [r5, r0] - movs r0, 0x76 - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B7230 - - thumb_func_start sub_80B7270 -sub_80B7270: @ 80B7270 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r5, r0, r1 - movs r0, 0xA - ldrsh r1, [r4, r0] - movs r0, 0x7C - bl cosine - strh r0, [r5, 0x24] - movs r0, 0xA - ldrsh r1, [r4, r0] - movs r0, 0x76 - bl sine - strh r0, [r5, 0x26] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080B72AE - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] -_080B72AE: - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B72C0 - strh r0, [r5, 0x24] - strh r0, [r5, 0x26] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B72C0: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B7270 - - thumb_func_start sub_80B72D0 -sub_80B72D0: @ 80B72D0 - push {r4,lr} - adds r4, r0, 0 - bl sub_80E1584 - lsls r0, 24 - cmp r0, 0 - bne _080B72EC - bl sub_80E1570 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x1 - b _080B72EE -_080B72EC: - movs r0, 0 -_080B72EE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B72D0 - - thumb_func_start sub_80B72F4 -sub_80B72F4: @ 80B72F4 - push {r4,lr} - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B7338 - bl CameraObjectReset1 - bl script_env_2_disable - movs r0, 0x4 - bl GetGoSpeed0AnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - ldr r0, =sub_80B70DC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B7338: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B72F4 - - thumb_func_start oei_waterfall -oei_waterfall: @ 80B734C - push {r4,lr} - ldr r4, =sub_80B7384 - adds r0, r4, 0 - movs r1, 0xFF - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =0x02038c08 - ldr r2, [r2] - strh r2, [r1, 0xA] - bl _call_via_r4 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end oei_waterfall - - thumb_func_start sub_80B7384 -sub_80B7384: @ 80B7384 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_0855C418 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_080B7396: - movs r0, 0x8 - ldrsh r2, [r4, r0] - lsls r2, 2 - adds r2, r5 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02037350 - adds r1, r0 - ldr r2, [r2] - adds r0, r4, 0 - bl _call_via_r2 - lsls r0, 24 - cmp r0, 0 - bne _080B7396 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B7384 - - thumb_func_start sub_80B73D0 -sub_80B73D0: @ 80B73D0 - push {r4,lr} - adds r4, r0, 0 - bl script_env_2_enable - ldr r1, =0x02037590 - movs r0, 0x1 - strb r0, [r1, 0x6] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B73D0 - - thumb_func_start waterfall_1_do_anim_probably -waterfall_1_do_anim_probably: @ 80B73F0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl script_env_2_enable - adds r0, r5, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - bne _080B7420 - adds r0, r5, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - ldr r1, =0x02038c08 - movs r2, 0xA - ldrsh r0, [r4, r2] - str r0, [r1] - movs r0, 0x3B - bl FieldEffectStart - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B7420: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end waterfall_1_do_anim_probably - - thumb_func_start waterfall_2_wait_anim_finish_probably -waterfall_2_wait_anim_finish_probably: @ 80B742C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x6 - bl FieldEffectActiveListContains - lsls r0, 24 - cmp r0, 0 - bne _080B7446 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x1 - b _080B7448 -_080B7446: - movs r0, 0 -_080B7448: - pop {r4} - pop {r1} - bx r1 - thumb_func_end waterfall_2_wait_anim_finish_probably - - thumb_func_start sub_80B7450 -sub_80B7450: @ 80B7450 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r0, 0x2 - bl GetSimpleGoAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80B7450 - - thumb_func_start sub_80B7478 -sub_80B7478: @ 80B7478 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - bne _080B748E - movs r0, 0 - b _080B74CA -_080B748E: - ldrb r0, [r4, 0x1E] - bl MetatileBehavior_IsWaterfall - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _080B74C4 - bl script_env_2_disable - ldr r0, =0x02037590 - strb r4, [r0, 0x6] - ldr r0, =sub_80B7384 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0x2B - bl FieldEffectActiveListRemove - movs r0, 0 - b _080B74CA - .pool -_080B74C4: - movs r0, 0x3 - strh r0, [r5, 0x8] - movs r0, 0x1 -_080B74CA: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80B7478 - - thumb_func_start sub_80B74D0 -sub_80B74D0: @ 80B74D0 - push {r4,lr} - ldr r4, =sub_80B750C - adds r0, r4, 0 - movs r1, 0xFF - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r3, =0x02038c08 - ldr r2, [r3] - strh r2, [r1, 0x26] - ldr r2, [r3, 0x4] - strh r2, [r1, 0x24] - bl _call_via_r4 - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B74D0 - - thumb_func_start sub_80B750C -sub_80B750C: @ 80B750C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_0855C42C - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_080B751E: - 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 _080B751E - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B750C - - thumb_func_start dive_1_lock -dive_1_lock: @ 80B7544 - ldr r2, =0x02037590 - movs r1, 0x1 - strb r1, [r2, 0x6] - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - movs r0, 0 - bx lr - .pool - thumb_func_end dive_1_lock - - thumb_func_start dive_2_unknown -dive_2_unknown: @ 80B7558 - push {r4,lr} - adds r4, r0, 0 - bl script_env_2_enable - ldr r1, =0x02038c08 - movs r2, 0x26 - ldrsh r0, [r4, r2] - str r0, [r1] - movs r0, 0x3B - bl FieldEffectStart - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end dive_2_unknown - - thumb_func_start dive_3_unknown -dive_3_unknown: @ 80B7580 - push {lr} - sub sp, 0x8 - mov r1, sp - adds r1, 0x2 - mov r0, sp - bl PlayerGetDestCoords - movs r0, 0x6 - bl FieldEffectActiveListContains - lsls r0, 24 - cmp r0, 0 - bne _080B75C4 - ldr r2, =0x02037350 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1E] - mov r0, sp - bl dive_warp - ldr r0, =sub_80B750C - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0x2C - bl FieldEffectActiveListRemove -_080B75C4: - movs r0, 0 - add sp, 0x8 - pop {r1} - bx r1 - .pool - thumb_func_end dive_3_unknown - - thumb_func_start sub_80B75D8 -sub_80B75D8: @ 80B75D8 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =sub_80B75F0 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B75D8 - - thumb_func_start sub_80B75F0 -sub_80B75F0: @ 80B75F0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r6, =gUnknown_0855C438 - ldr r2, =0x03005e00 - ldr r5, =0x02037590 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_080B7604: - movs r0, 0x8 - ldrsh r3, [r4, r0] - lsls r3, 2 - adds r3, r6 - ldrb r0, [r5, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02037350 - adds r1, r0 - ldrb r0, [r5, 0x4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x02020630 - adds r2, r0 - ldr r3, [r3] - adds r0, r4, 0 - bl _call_via_r3 - lsls r0, 24 - cmp r0, 0 - bne _080B7604 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B75F0 - - thumb_func_start sub_80B764C -sub_80B764C: @ 80B764C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - bl player_bitmagic - bl CameraObjectReset2 - movs r0, 0 - bl SetCameraPanningCallback - ldr r0, =0x02037590 - movs r2, 0x1 - strb r2, [r0, 0x6] - ldrb r0, [r5, 0x3] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r5, 0x3] - strh r2, [r4, 0xA] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B764C - - thumb_func_start sub_80B7684 -sub_80B7684: @ 80B7684 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0xA - ldrsh r1, [r4, r0] - movs r0, 0 - bl SetCameraPanning - ldrh r0, [r4, 0xA] - negs r0, r0 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _080B76B0 - movs r0, 0 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B76B0: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B7684 - - thumb_func_start sub_80B76B8 -sub_80B76B8: @ 80B76B8 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0 - strh r0, [r2, 0x26] - movs r0, 0x1 - strh r0, [r4, 0xE] - ldr r3, =0x02038c08 - movs r5, 0x10 - ldrsh r0, [r1, r5] - str r0, [r3] - movs r5, 0x12 - ldrsh r0, [r1, r5] - str r0, [r3, 0x4] - adds r0, r2, 0 - adds r0, 0x43 - ldrb r0, [r0] - subs r0, 0x1 - str r0, [r3, 0x8] - ldrb r0, [r2, 0x5] - lsls r0, 28 - lsrs r0, 30 - str r0, [r3, 0xC] - movs r0, 0x32 - bl FieldEffectStart - movs r0, 0xB2 - bl audio_play - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B76B8 - - thumb_func_start sub_80B7704 -sub_80B7704: @ 80B7704 - push {r4-r7,lr} - adds r4, r0, 0 - adds r6, r1, 0 - adds r5, r2, 0 - movs r0, 0xA - ldrsh r1, [r4, r0] - movs r0, 0 - bl SetCameraPanning - ldrh r0, [r4, 0xA] - negs r2, r0 - strh r2, [r4, 0xA] - ldrh r0, [r4, 0xC] - adds r1, r0, 0x1 - strh r1, [r4, 0xC] - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x11 - bgt _080B773E - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - bne _080B7750 - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, 0x3 - bgt _080B7750 - lsls r0, r2, 1 - b _080B774E -_080B773E: - movs r0, 0x4 - ands r1, r0 - cmp r1, 0 - bne _080B7750 - lsls r0, r2, 16 - cmp r0, 0 - ble _080B7750 - asrs r0, 17 -_080B774E: - strh r0, [r4, 0xA] -_080B7750: - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0x6 - ble _080B779C - adds r0, r5, 0 - adds r0, 0x29 - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r2, r1, 17 - negs r2, r2 - movs r7, 0x26 - ldrsh r3, [r5, r7] - movs r7, 0x22 - ldrsh r0, [r5, r7] - adds r0, r1 - ldr r1, =0x02021bbe - movs r7, 0 - ldrsh r1, [r1, r7] - adds r0, r1 - asrs r2, 16 - adds r0, r2 - cmn r3, r0 - ble _080B7798 - ldrh r0, [r5, 0x26] - ldrh r1, [r4, 0xE] - subs r0, r1 - strh r0, [r5, 0x26] - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x7 - bgt _080B779C - adds r0, r1, 0x1 - strh r0, [r4, 0xE] - b _080B779C - .pool -_080B7798: - movs r0, 0x1 - strh r0, [r4, 0x10] -_080B779C: - ldrh r2, [r4, 0x12] - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B77DA - movs r7, 0x26 - ldrsh r1, [r5, r7] - movs r0, 0x10 - negs r0, r0 - cmp r1, r0 - bge _080B77DA - adds r0, r2, 0x1 - strh r0, [r4, 0x12] - ldrb r0, [r6, 0x3] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r6, 0x3] - ldrb r1, [r5, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0x5] - adds r2, r5, 0 - adds r2, 0x42 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] -_080B77DA: - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B77F0 - movs r7, 0x10 - ldrsh r0, [r4, r7] - cmp r0, 0 - beq _080B77F0 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B77F0: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80B7704 - - thumb_func_start sub_80B77F8 -sub_80B77F8: @ 80B77F8 - push {r4,lr} - adds r4, r0, 0 - bl music_something - bl sub_80AF0B4 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B77F8 - - thumb_func_start sub_80B7814 -sub_80B7814: @ 80B7814 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080B784C - bl sub_80859A0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B784C - bl warp_in - ldr r1, =0x03005dac - ldr r0, =mapldr_080851BC - str r0, [r1] - ldr r0, =c2_load_new_map - bl SetMainCallback2 - ldr r0, =sub_80B75F0 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B784C: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B7814 - - thumb_func_start mapldr_080851BC -mapldr_080851BC: @ 80B7868 - push {lr} - bl sub_8085784 - bl pal_fill_for_maplights - bl script_env_2_enable - ldr r0, =0x03005dac - movs r1, 0 - str r1, [r0] - ldr r0, =sub_80B7890 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end mapldr_080851BC - - thumb_func_start sub_80B7890 -sub_80B7890: @ 80B7890 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r6, =gUnknown_0855C450 - ldr r2, =0x03005e00 - ldr r5, =0x02037590 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_080B78A4: - movs r0, 0x8 - ldrsh r3, [r4, r0] - lsls r3, 2 - adds r3, r6 - ldrb r0, [r5, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02037350 - adds r1, r0 - ldrb r0, [r5, 0x4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x02020630 - adds r2, r0 - ldr r3, [r3] - adds r0, r4, 0 - bl _call_via_r3 - lsls r0, 24 - cmp r0, 0 - bne _080B78A4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B7890 - - thumb_func_start sub_80B78EC -sub_80B78EC: @ 80B78EC - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - bl CameraObjectReset2 - bl player_bitmagic - ldr r1, =0x02037590 - movs r0, 0x1 - strb r0, [r1, 0x6] - ldrb r0, [r4, 0x1] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B78EC - - thumb_func_start sub_80B791C -sub_80B791C: @ 80B791C - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - bl sub_80ABDFC - lsls r0, 24 - cmp r0, 0 - beq _080B795C - ldr r1, =0x02038c08 - movs r2, 0x10 - ldrsh r0, [r5, r2] - str r0, [r1] - movs r2, 0x12 - ldrsh r0, [r5, r2] - str r0, [r1, 0x4] - adds r0, r6, 0 - adds r0, 0x43 - ldrb r0, [r0] - subs r0, 0x1 - str r0, [r1, 0x8] - ldrb r0, [r6, 0x5] - lsls r0, 28 - lsrs r0, 30 - str r0, [r1, 0xC] - movs r0, 0x31 - bl FieldEffectStart - strh r0, [r4, 0xA] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B795C: - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B791C - - thumb_func_start sub_80B7968 -sub_80B7968: @ 80B7968 - push {r4,lr} - adds r2, r0, 0 - adds r4, r1, 0 - movs r0, 0xA - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - adds r0, 0x2B - ldrb r0, [r0] - cmp r0, 0x1 - bls _080B79B0 - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - ldrb r1, [r4, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x1] - bl CameraObjectReset1 - movs r0, 0xAF - bl audio_play - movs r0, 0x4 - bl sub_8093514 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim -_080B79B0: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B7968 - - thumb_func_start sub_80B79BC -sub_80B79BC: @ 80B79BC - push {lr} - adds r0, r1, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B79E6 - ldr r1, =0x02037590 - movs r0, 0 - strb r0, [r1, 0x6] - bl script_env_2_disable - bl sub_809757C - ldr r0, =sub_80B7890 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B79E6: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B79BC - - thumb_func_start sub_80B79F4 -sub_80B79F4: @ 80B79F4 - push {r4,lr} - ldr r4, =0x02038c08 - adds r1, r4, 0x4 - adds r0, r4, 0 - movs r2, 0x8 - movs r3, 0x8 - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - adds r0, 0x84 - ldr r0, [r0] - movs r2, 0 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - ldrb r3, [r4, 0x8] - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r1 - movs r1, 0x3 - ldrb r3, [r4, 0xC] - ands r3, r1 - lsls r3, 2 - ldrb r4, [r2, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r4 - orrs r1, r3 - strb r1, [r2, 0x5] - adds r2, 0x3E - ldrb r1, [r2] - movs r3, 0x2 - orrs r1, r3 - strb r1, [r2] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B79F4 - - thumb_func_start sub_80B7A58 -sub_80B7A58: @ 80B7A58 - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080B7A70 - adds r0, r2, 0 - movs r1, 0x32 - bl FieldEffectStop -_080B7A70: - pop {r0} - bx r0 - thumb_func_end sub_80B7A58 - - thumb_func_start sub_80B7A74 -sub_80B7A74: @ 80B7A74 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =sub_80B7A8C - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B7A74 - - thumb_func_start sub_80B7A8C -sub_80B7A8C: @ 80B7A8C - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r6, =gUnknown_0855C460 - ldr r2, =0x03005e00 - ldr r5, =0x02037590 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_080B7AA0: - movs r0, 0x8 - ldrsh r3, [r4, r0] - lsls r3, 2 - adds r3, r6 - ldrb r0, [r5, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02037350 - adds r1, r0 - ldrb r0, [r5, 0x4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x02020630 - adds r2, r0 - ldr r3, [r3] - adds r0, r4, 0 - bl _call_via_r3 - lsls r0, 24 - cmp r0, 0 - bne _080B7AA0 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B7A8C - - thumb_func_start sub_80B7AE8 -sub_80B7AE8: @ 80B7AE8 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - bl player_bitmagic - bl CameraObjectReset2 - ldr r1, =0x02037590 - movs r0, 0x1 - strb r0, [r1, 0x6] - ldrb r0, [r4, 0x3] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4, 0x3] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B7AE8 - - thumb_func_start sub_80B7B18 -sub_80B7B18: @ 80B7B18 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r6, r2, 0 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B7B8C - ldrh r1, [r5, 0xA] - movs r2, 0xA - ldrsh r0, [r5, r2] - cmp r0, 0x3 - ble _080B7B6C - ldr r1, =0x02038c08 - movs r2, 0x10 - ldrsh r0, [r4, r2] - str r0, [r1] - movs r2, 0x12 - ldrsh r0, [r4, r2] - str r0, [r1, 0x4] - adds r0, r6, 0 - adds r0, 0x43 - ldrb r0, [r0] - subs r0, 0x1 - str r0, [r1, 0x8] - ldrb r0, [r6, 0x5] - lsls r0, 28 - lsrs r0, 30 - str r0, [r1, 0xC] - movs r0, 0x31 - bl FieldEffectStart - strh r0, [r5, 0xA] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - b _080B7B8C - .pool -_080B7B6C: - adds r0, r1, 0x1 - strh r0, [r5, 0xA] - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl GetStepInPlaceDelay4AnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - movs r0, 0x27 - bl audio_play -_080B7B8C: - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80B7B18 - - thumb_func_start sub_80B7B94 -sub_80B7B94: @ 80B7B94 - push {r4,lr} - adds r3, r0, 0 - adds r4, r1, 0 - ldr r2, =0x02020630 - movs r0, 0xA - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x2B - ldrb r0, [r0] - cmp r0, 0x2 - bne _080B7BBE - ldrb r0, [r4, 0x1] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] -_080B7BBE: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B7B94 - - thumb_func_start sub_80B7BCC -sub_80B7BCC: @ 80B7BCC - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x31 - bl FieldEffectActiveListContains - lsls r0, 24 - cmp r0, 0 - bne _080B7BEA - bl music_something - bl sub_80AF0B4 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B7BEA: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B7BCC - - thumb_func_start sub_80B7BF4 -sub_80B7BF4: @ 80B7BF4 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080B7C2C - bl sub_80859A0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B7C2C - bl warp_in - ldr r1, =0x03005dac - ldr r0, =sub_80B6B68 - str r0, [r1] - ldr r0, =c2_load_new_map - bl SetMainCallback2 - ldr r0, =sub_80B7A8C - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B7C2C: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B7BF4 - - thumb_func_start sub_80B7C48 -sub_80B7C48: @ 80B7C48 - push {r4,lr} - ldr r4, =0x02038c08 - adds r1, r4, 0x4 - adds r0, r4, 0 - movs r2, 0x8 - movs r3, 0x8 - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - adds r0, 0x80 - ldr r0, [r0] - movs r2, 0 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - ldrb r3, [r4, 0x8] - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r1 - movs r1, 0x3 - ldrb r3, [r4, 0xC] - ands r3, r1 - lsls r3, 2 - ldrb r4, [r2, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r4 - orrs r1, r3 - strb r1, [r2, 0x5] - adds r2, 0x3E - ldrb r1, [r2] - movs r3, 0x2 - orrs r1, r3 - strb r1, [r2] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B7C48 - - thumb_func_start sub_80B7CAC -sub_80B7CAC: @ 80B7CAC - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080B7CC4 - adds r0, r2, 0 - movs r1, 0x31 - bl FieldEffectStop -_080B7CC4: - pop {r0} - bx r0 - thumb_func_end sub_80B7CAC - - thumb_func_start sub_80B7CC8 -sub_80B7CC8: @ 80B7CC8 - push {lr} - bl script_env_2_enable - bl player_bitmagic - ldr r0, =sub_80B7CE4 - movs r1, 0x50 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B7CC8 - - thumb_func_start sub_80B7CE4 -sub_80B7CE4: @ 80B7CE4 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_0855C474 - ldr r2, =0x03005e00 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B7CE4 - - thumb_func_start sub_80B7D14 -sub_80B7D14: @ 80B7D14 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x40 - strh r0, [r4, 0x24] - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80B7D14 - - thumb_func_start sub_80B7D34 -sub_80B7D34: @ 80B7D34 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r1, =gUnknown_0855C47C - mov r0, sp - movs r2, 0x5 - bl memcpy - ldrh r1, [r4, 0x24] - movs r2, 0x24 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _080B7D60 - subs r0, r1, 0x1 - strh r0, [r4, 0x24] - lsls r0, 16 - cmp r0, 0 - bne _080B7D60 - bl music_something - bl sub_80AF0B4 -_080B7D60: - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r5, r0, r1 - adds r0, r5, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _080B7D86 - adds r0, r5, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B7E40 -_080B7D86: - movs r1, 0x24 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B7DF8 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080B7DF8 - bl sub_80859A0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B7DF8 - ldrh r1, [r4, 0x26] - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl FieldObjectSetDirection - bl sub_8084E14 - bl warp_in - ldr r1, =0x03005dac - ldr r0, =mapldr_080859D4 - str r0, [r1] - ldr r0, =c2_load_new_map - bl SetMainCallback2 - ldr r0, =sub_80B7CE4 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - b _080B7E40 - .pool -_080B7DF8: - ldrh r1, [r4, 0xA] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _080B7E0C - subs r0, r1, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - cmp r0, 0 - bne _080B7E40 -_080B7E0C: - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - add r0, sp - ldrb r0, [r0] - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl FieldObjectSetSpecialAnim - ldrh r1, [r4, 0xC] - movs r2, 0xC - ldrsh r0, [r4, r2] - cmp r0, 0xB - bgt _080B7E34 - adds r0, r1, 0x1 - strh r0, [r4, 0xC] -_080B7E34: - ldrh r1, [r4, 0xC] - lsls r1, 16 - asrs r1, 18 - movs r0, 0x8 - asrs r0, r1 - strh r0, [r4, 0xA] -_080B7E40: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80B7D34 - - thumb_func_start mapldr_080859D4 -mapldr_080859D4: @ 80B7E48 - push {lr} - bl sub_8085784 - bl pal_fill_for_maplights - bl script_env_2_enable - bl player_bitmagic - ldr r1, =0x03005dac - movs r0, 0 - str r0, [r1] - ldr r2, =0x02037350 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0, 0x1] - ldr r0, =sub_80B7E94 - movs r1, 0 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end mapldr_080859D4 - - thumb_func_start sub_80B7E94 -sub_80B7E94: @ 80B7E94 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_0855C484 - ldr r2, =0x03005e00 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B7E94 - - thumb_func_start sub_80B7EC4 -sub_80B7EC4: @ 80B7EC4 - push {r4,lr} - adds r4, r0, 0 - bl sub_80ABDFC - lsls r0, 24 - cmp r0, 0 - beq _080B7EE2 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] -_080B7EE2: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80B7EC4 - - thumb_func_start sub_80B7EE8 -sub_80B7EE8: @ 80B7EE8 - push {r4-r6,lr} - sub sp, 0x8 - adds r5, r0, 0 - ldr r1, =gUnknown_0855C47C - mov r0, sp - movs r2, 0x5 - bl memcpy - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r6, r0, r1 - ldrh r1, [r5, 0xA] - movs r2, 0xA - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _080B7F1A - subs r0, r1, 0x1 - strh r0, [r5, 0xA] - lsls r0, 16 - cmp r0, 0 - bne _080B7FAC -_080B7F1A: - adds r0, r6, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _080B7F32 - adds r0, r6, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B7FC0 -_080B7F32: - movs r1, 0xC - ldrsh r0, [r5, r1] - cmp r0, 0x1F - ble _080B7F7C - movs r2, 0x26 - ldrsh r4, [r5, r2] - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _080B7F7C - ldrb r1, [r6, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r1 - strb r0, [r6, 0x1] - bl script_env_2_disable - bl sub_809757C - ldr r0, =sub_80B7E94 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - b _080B7FC0 - .pool -_080B7F7C: - ldrb r0, [r6, 0x18] - lsls r0, 28 - lsrs r0, 28 - add r0, sp - ldrb r0, [r0] - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl FieldObjectSetSpecialAnim - ldrh r1, [r5, 0xC] - movs r2, 0xC - ldrsh r0, [r5, r2] - cmp r0, 0x1F - bgt _080B7FA4 - adds r0, r1, 0x1 - strh r0, [r5, 0xC] -_080B7FA4: - ldrh r0, [r5, 0xC] - lsls r0, 16 - asrs r0, 18 - strh r0, [r5, 0xA] -_080B7FAC: - ldrb r2, [r6, 0x1] - lsls r1, r2, 26 - lsrs r1, 31 - movs r0, 0x1 - eors r1, r0 - lsls r1, 5 - subs r0, 0x22 - ands r0, r2 - orrs r0, r1 - strb r0, [r6, 0x1] -_080B7FC0: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80B7EE8 - - thumb_func_start sub_80B7FC8 -sub_80B7FC8: @ 80B7FC8 - push {lr} - ldr r0, =sub_80B7FDC - movs r1, 0 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B7FC8 - - thumb_func_start sub_80B7FDC -sub_80B7FDC: @ 80B7FDC - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_0855C48C - ldr r2, =0x03005e00 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B7FDC - - thumb_func_start sub_80B800C -sub_80B800C: @ 80B800C - push {r4,lr} - adds r4, r0, 0 - bl script_env_2_enable - bl player_bitmagic - bl CameraObjectReset2 - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80B800C - - thumb_func_start sub_80B8034 -sub_80B8034: @ 80B8034 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r1, =gUnknown_0855C47C - mov r0, sp - movs r2, 0x5 - bl memcpy - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r5, r0, r1 - ldrh r1, [r4, 0xA] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _080B8066 - subs r0, r1, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - cmp r0, 0 - bne _080B8080 -_080B8066: - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - add r0, sp - ldrb r1, [r0] - adds r0, r5, 0 - bl FieldObjectTurn - movs r0, 0x8 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] -_080B8080: - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0x7 - ble _080B80AE - movs r2, 0x26 - ldrsh r1, [r4, r2] - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - cmp r1, r0 - bne _080B80AE - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x4 - strh r0, [r4, 0xA] - movs r0, 0x8 - strh r0, [r4, 0xC] - movs r0, 0x1 - strh r0, [r4, 0xE] - movs r0, 0x2D - bl audio_play -_080B80AE: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8034 - - thumb_func_start sub_80B80C4 -sub_80B80C4: @ 80B80C4 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r1, =gUnknown_0855C47C - mov r0, sp - movs r2, 0x5 - bl memcpy - ldr r2, =0x02037590 - ldrb r1, [r2, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r3, r0, r1 - ldrb r1, [r2, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r5, r0, r1 - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - cmp r0, 0 - bgt _080B810E - movs r0, 0x4 - strh r0, [r4, 0xA] - ldrb r0, [r3, 0x18] - lsls r0, 28 - lsrs r0, 28 - add r0, sp - ldrb r1, [r0] - adds r0, r3, 0 - bl FieldObjectTurn -_080B810E: - ldrh r0, [r5, 0x22] - ldrh r1, [r4, 0xE] - subs r0, r1 - strh r0, [r5, 0x22] - ldrh r1, [r4, 0xE] - ldrh r2, [r4, 0x10] - adds r0, r1, r2 - strh r0, [r4, 0x10] - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - bgt _080B813A - movs r0, 0x4 - strh r0, [r4, 0xC] - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x7 - bgt _080B813A - lsls r0, r1, 1 - strh r0, [r4, 0xE] -_080B813A: - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r0, 0x8 - ble _080B8168 - ldrb r1, [r5, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r5, 0x5] - adds r2, r5, 0 - adds r2, 0x42 - ldrb r1, [r2] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0 - beq _080B8168 - movs r0, 0x3F - ands r0, r1 - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] -_080B8168: - movs r2, 0x10 - ldrsh r0, [r4, r2] - cmp r0, 0xA7 - ble _080B817E - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - bl music_something - bl sub_80AF0B4 -_080B817E: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B80C4 - - thumb_func_start sub_80B8198 -sub_80B8198: @ 80B8198 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080B81E6 - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B81B8 - bl sub_81BE72C - movs r0, 0x1 - strh r0, [r4, 0x12] -_080B81B8: - bl sub_80859A0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B81E6 - bl copy_saved_warp3_bank_and_enter_x_to_warp1 - bl warp_in - ldr r0, =c2_load_new_map - bl SetMainCallback2 - ldr r1, =0x03005dac - ldr r0, =mapldr_08085D88 - str r0, [r1] - ldr r0, =sub_80B7FDC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B81E6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8198 - - thumb_func_start mapldr_08085D88 -mapldr_08085D88: @ 80B8200 - push {lr} - bl sub_8085784 - bl pal_fill_for_maplights - bl script_env_2_enable - bl player_bitmagic - ldr r1, =0x03005dac - movs r0, 0 - str r0, [r1] - ldr r2, =0x02037350 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0, 0x1] - bl CameraObjectReset2 - ldr r0, =sub_80B8250 - movs r1, 0 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end mapldr_08085D88 - - thumb_func_start sub_80B8250 -sub_80B8250: @ 80B8250 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_0855C49C - ldr r2, =0x03005e00 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8250 - - thumb_func_start sub_80B8280 -sub_80B8280: @ 80B8280 - push {r4-r6,lr} - adds r6, r0, 0 - bl sub_80ABDFC - lsls r0, 24 - cmp r0, 0 - beq _080B82F6 - ldr r5, =0x02037590 - ldrb r0, [r5, 0x4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x02020630 - adds r2, r0 - adds r0, r2, 0 - adds r0, 0x29 - movs r4, 0 - ldrsb r4, [r0, r4] - lsls r0, r4, 17 - negs r0, r0 - ldrh r1, [r2, 0x22] - ldr r3, =0x02021bbe - adds r1, r4 - ldrh r3, [r3] - adds r1, r3 - asrs r0, 16 - adds r0, r1 - negs r0, r0 - strh r0, [r2, 0x26] - ldr r3, =0x02037350 - ldrb r0, [r5, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r3, [r1, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r3 - strb r0, [r1, 0x1] - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - movs r0, 0x8 - strh r0, [r6, 0xA] - movs r0, 0x1 - strh r0, [r6, 0xC] - adds r2, 0x42 - ldrb r0, [r2] - lsrs r0, 6 - strh r0, [r6, 0x24] - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x26] - movs r0, 0x2D - bl audio_play -_080B82F6: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8280 - - thumb_func_start sub_80B830C -sub_80B830C: @ 80B830C - push {r4-r7,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r1, =gUnknown_0855C47C - mov r0, sp - movs r2, 0x5 - bl memcpy - ldr r2, =0x02037590 - ldrb r1, [r2, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r6, r0, r1 - ldrb r1, [r2, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r5, r0, r1 - ldrh r0, [r4, 0xA] - ldrh r1, [r5, 0x26] - adds r0, r1 - strh r0, [r5, 0x26] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x8 - negs r1, r1 - cmp r0, r1 - blt _080B8384 - ldrh r1, [r4, 0x22] - movs r2, 0x22 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _080B83AA - adds r0, r1, 0x1 - strh r0, [r4, 0x22] - ldrb r0, [r6] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r6] - ldrh r1, [r4, 0x24] - adds r3, r5, 0 - adds r3, 0x42 - lsls r1, 6 - ldrb r2, [r3] - movs r0, 0x3F - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - b _080B83AA - .pool -_080B8384: - ldrb r1, [r5, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r5, 0x5] - adds r2, r5, 0 - adds r2, 0x42 - ldrb r1, [r2] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0 - beq _080B83AA - movs r0, 0x3F - ands r0, r1 - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] -_080B83AA: - ldrh r2, [r5, 0x26] - movs r3, 0x26 - ldrsh r1, [r5, r3] - movs r0, 0x30 - negs r0, r0 - cmp r1, r0 - blt _080B83CE - ldrh r1, [r4, 0xA] - movs r3, 0xA - ldrsh r0, [r4, r3] - cmp r0, 0x1 - ble _080B83CE - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - bne _080B83CE - subs r0, r1, 0x1 - strh r0, [r4, 0xA] -_080B83CE: - ldrh r0, [r4, 0xC] - subs r0, 0x1 - movs r7, 0 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _080B83F0 - movs r0, 0x4 - strh r0, [r4, 0xC] - ldrb r0, [r6, 0x18] - lsls r0, 28 - lsrs r0, 28 - add r0, sp - ldrb r1, [r0] - adds r0, r6, 0 - bl FieldObjectTurn -_080B83F0: - movs r1, 0x26 - ldrsh r0, [r5, r1] - cmp r0, 0 - blt _080B8406 - strh r7, [r5, 0x26] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x1 - strh r0, [r4, 0xA] - strh r7, [r4, 0xC] -_080B8406: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80B830C - - thumb_func_start sub_80B8410 -sub_80B8410: @ 80B8410 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r1, =gUnknown_0855C47C - mov r0, sp - movs r2, 0x5 - bl memcpy - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r5, r0, r1 - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - cmp r0, 0 - bne _080B8484 - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - add r0, sp - ldrb r1, [r0] - adds r0, r5, 0 - bl FieldObjectTurn - movs r0, 0x8 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _080B8484 - movs r0, 0x24 - ldrsh r1, [r4, r0] - ldrb r0, [r5, 0x18] - lsls r0, 28 - lsrs r0, 28 - cmp r1, r0 - bne _080B8484 - bl script_env_2_disable - bl CameraObjectReset1 - bl sub_809757C - ldr r0, =sub_80B8250 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B8484: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8410 - - thumb_func_start sub_80B849C -sub_80B849C: @ 80B849C - push {r4,lr} - bl sav1_map_get_light_level - lsls r0, 24 - lsrs r0, 24 - bl is_light_level_1_2_3_5_or_6 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080B84BC - ldr r0, =sub_80B8554 - b _080B84BE - .pool -_080B84BC: - ldr r0, =sub_80B88B4 -_080B84BE: - movs r1, 0xFF - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - ldr r2, =0x02038c08 - ldr r0, [r2] - ldr r1, [r2, 0x4] - ldr r2, [r2, 0x8] - bl sub_80B8C60 - ldr r2, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r2 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x26] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B849C - - thumb_func_start sub_80B84F8 -sub_80B84F8: @ 80B84F8 - push {r4-r6,lr} - ldr r5, =0x02038c08 - ldr r0, [r5] - movs r6, 0x80 - lsls r6, 24 - ands r6, r0 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - adds r4, r0, 0 - muls r4, r1 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - str r0, [r5] - adds r0, r4, 0 - movs r1, 0x1 - bl pokemon_getattr - str r0, [r5, 0x4] - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - str r0, [r5, 0x8] - ldr r0, [r5] - orrs r0, r6 - str r0, [r5] - movs r0, 0x6 - bl FieldEffectStart - movs r0, 0x3B - bl FieldEffectActiveListRemove - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B84F8 - - thumb_func_start sub_80B8554 -sub_80B8554: @ 80B8554 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_0855C4A8 - ldr r2, =0x03005e00 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8554 - - thumb_func_start sub_80B8584 -sub_80B8584: @ 80B8584 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x04000048 - ldrh r0, [r0] - strh r0, [r4, 0x1E] - ldr r0, =0x0400004a - ldrh r0, [r0] - strh r0, [r4, 0x20] - adds r0, r4, 0 - adds r0, 0x22 - ldr r1, =0x030022c0 - ldr r1, [r1, 0xC] - bl sub_806F67C - ldr r1, =0x0000f0f1 - strh r1, [r4, 0xA] - ldr r0, =0x00005051 - strh r0, [r4, 0xC] - movs r0, 0x3F - strh r0, [r4, 0xE] - movs r0, 0x3E - strh r0, [r4, 0x10] - movs r0, 0x40 - bl SetGpuReg - ldrh r1, [r4, 0xC] - movs r0, 0x44 - bl SetGpuReg - ldrh r1, [r4, 0xE] - movs r0, 0x48 - bl SetGpuReg - ldrh r1, [r4, 0x10] - movs r0, 0x4A - bl SetGpuReg - ldr r0, =sub_80B880C - bl SetVBlankCallback - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8584 - - thumb_func_start sub_80B85F8 -sub_80B85F8: @ 80B85F8 - push {r4-r6,lr} - sub sp, 0x4 - adds r6, r0, 0 - ldr r0, =0x04000008 - ldrh r1, [r0] - lsrs r1, 2 - lsls r1, 30 - lsrs r1, 16 - ldrh r4, [r0] - lsrs r4, 8 - lsls r4, 27 - lsrs r4, 16 - ldr r0, =gUnknown_0855AE50 - movs r5, 0xC0 - lsls r5, 19 - adds r1, r5 - movs r2, 0x80 - lsls r2, 1 - bl CpuSet - movs r0, 0 - str r0, [sp] - adds r5, r4, r5 - ldr r2, =0x05000200 - mov r0, sp - adds r1, r5, 0 - bl CpuSet - ldr r0, =gUnknown_0855B050 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - adds r0, r4, 0 - bl sub_80B8874 - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B85F8 - - thumb_func_start sub_80B8660 -sub_80B8660: @ 80B8660 - push {r4-r7,lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x12] - subs r0, 0x10 - strh r0, [r3, 0x12] - ldrh r6, [r3, 0xA] - ldrh r2, [r3, 0xC] - movs r7, 0xFF - lsrs r1, r6, 8 - subs r1, 0x10 - lsls r1, 16 - lsrs r0, r2, 8 - subs r0, 0x2 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r7, 0 - ands r0, r2 - adds r5, r0, 0x2 - lsrs r2, r1, 16 - cmp r1, 0 - bge _080B868C - movs r2, 0 -_080B868C: - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, 0x27 - bgt _080B8696 - movs r4, 0x28 -_080B8696: - cmp r5, 0x78 - ble _080B869C - movs r5, 0x78 -_080B869C: - lsls r2, 16 - asrs r2, 16 - lsls r1, r2, 8 - adds r0, r7, 0 - ands r0, r6 - orrs r1, r0 - strh r1, [r3, 0xA] - lsls r0, r4, 16 - asrs r4, r0, 16 - lsls r0, r4, 8 - adds r1, r5, 0 - orrs r0, r1 - strh r0, [r3, 0xC] - cmp r2, 0 - bne _080B86DC - cmp r4, 0x28 - bne _080B86DC - cmp r1, 0x78 - bne _080B86DC - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_80B8CC0 - str r1, [r0] - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] -_080B86DC: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8660 - - thumb_func_start sub_80B86EC -sub_80B86EC: @ 80B86EC - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x12] - subs r0, 0x10 - strh r0, [r3, 0x12] - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3C - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _080B8712 - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] -_080B8712: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B86EC - - thumb_func_start sub_80B871C -sub_80B871C: @ 80B871C - push {r4,lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x12] - subs r0, 0x10 - strh r0, [r3, 0x12] - ldrh r2, [r3, 0xC] - lsls r1, r2, 16 - movs r0, 0xFF - asrs r1, 24 - adds r1, 0x6 - lsls r1, 16 - ands r0, r2 - subs r0, 0x6 - lsls r0, 16 - lsrs r2, r0, 16 - lsrs r4, r1, 16 - asrs r1, 16 - cmp r1, 0x50 - ble _080B8744 - movs r4, 0x50 -_080B8744: - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, 0x50 - bgt _080B874E - movs r2, 0x51 -_080B874E: - lsls r0, r4, 16 - asrs r0, 16 - lsls r1, r0, 8 - lsls r2, 16 - asrs r2, 16 - orrs r1, r2 - strh r1, [r3, 0xC] - cmp r0, 0x50 - bne _080B876A - cmp r2, 0x51 - bne _080B876A - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] -_080B876A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80B871C - - thumb_func_start sub_80B8770 -sub_80B8770: @ 80B8770 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldr r0, =0x04000008 - ldrh r1, [r0] - lsrs r1, 8 - lsls r1, 27 - lsrs r1, 16 - movs r0, 0 - str r0, [sp] - movs r0, 0xC0 - lsls r0, 19 - adds r1, r0 - ldr r2, =0x05000200 - mov r0, sp - bl CpuSet - movs r0, 0xF1 - strh r0, [r4, 0xA] - movs r0, 0xA1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x1E] - strh r0, [r4, 0xE] - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x10] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8770 - - thumb_func_start overworld_bg_setup_2 -overworld_bg_setup_2: @ 80B87B8 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r0, 0x22 - mov r1, sp - bl sub_806F684 - ldr r0, [sp] - bl SetVBlankCallback - bl sub_8197200 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - ldrh r1, [r4, 0x26] - lsls r1, 24 - lsrs r1, 24 - bl sub_80B6070 - movs r0, 0x6 - bl FieldEffectActiveListRemove - ldr r0, =sub_80B8554 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end overworld_bg_setup_2 - - thumb_func_start sub_80B880C -sub_80B880C: @ 80B880C - push {r4,lr} - sub sp, 0x4 - ldr r0, =sub_80B8554 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - adds r0, r4, 0 - adds r0, 0x22 - mov r1, sp - bl sub_806F684 - ldr r0, [sp] - bl _call_via_r0 - ldrh r1, [r4, 0xA] - movs r0, 0x40 - bl SetGpuReg - ldrh r1, [r4, 0xC] - movs r0, 0x44 - bl SetGpuReg - ldrh r1, [r4, 0xE] - movs r0, 0x48 - bl SetGpuReg - ldrh r1, [r4, 0x10] - movs r0, 0x4A - bl SetGpuReg - ldrh r1, [r4, 0x12] - movs r0, 0x10 - bl SetGpuReg - ldrh r1, [r4, 0x14] - movs r0, 0x12 - bl SetGpuReg - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B880C - - thumb_func_start sub_80B8874 -sub_80B8874: @ 80B8874 - push {r4,r5,lr} - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x06000140 - adds r2, r0, r1 - movs r1, 0 - ldr r5, =gUnknown_0855B070 - movs r0, 0xF0 - lsls r0, 8 - adds r4, r0, 0 - ldr r3, =0x0000013f -_080B888A: - lsls r0, r1, 1 - adds r0, r5 - ldrh r0, [r0] - orrs r0, r4 - strh r0, [r2] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - adds r2, 0x2 - cmp r1, r3 - bls _080B888A - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8874 - - thumb_func_start sub_80B88B4 -sub_80B88B4: @ 80B88B4 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_0855C4C4 - ldr r2, =0x03005e00 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B88B4 - - thumb_func_start sub_80B88E4 -sub_80B88E4: @ 80B88E4 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0xA] - movs r0, 0x10 - bl SetGpuReg - ldrh r1, [r4, 0xC] - movs r0, 0x12 - bl SetGpuReg - adds r0, r4, 0 - adds r0, 0x22 - ldr r1, =0x030022c0 - ldr r1, [r1, 0xC] - bl sub_806F67C - ldr r0, =sub_80B8AE0 - bl SetVBlankCallback - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B88E4 - - thumb_func_start sub_80B8920 -sub_80B8920: @ 80B8920 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - adds r6, r0, 0 - ldr r0, =0x04000008 - ldrh r1, [r0] - lsrs r1, 2 - lsls r1, 30 - lsrs r1, 16 - ldrh r4, [r0] - lsrs r4, 8 - lsls r4, 27 - lsrs r4, 16 - movs r0, 0 - mov r8, r0 - strh r4, [r6, 0x20] - ldr r0, =gUnknown_0855B2F0 - movs r5, 0xC0 - lsls r5, 19 - adds r1, r5 - movs r2, 0x40 - bl CpuSet - mov r0, r8 - str r0, [sp] - adds r4, r5 - ldr r2, =0x05000200 - mov r0, sp - adds r1, r4, 0 - bl CpuSet - ldr r0, =gUnknown_0855B370 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8920 - - thumb_func_start sub_80B898C -sub_80B898C: @ 80B898C - push {r4,lr} - adds r4, r0, 0 - bl sub_80B8B38 - lsls r0, 24 - cmp r0, 0 - beq _080B89C4 - movs r0, 0x42 - movs r1, 0xF0 - bl SetGpuReg - ldr r1, =0x00002878 - movs r0, 0x46 - bl SetGpuReg - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_80B8CC0 - str r1, [r0] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B89C4: - adds r0, r4, 0 - bl sub_80B8B28 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B898C - - thumb_func_start sub_80B89DC -sub_80B89DC: @ 80B89DC - push {r4,lr} - adds r4, r0, 0 - bl sub_80B8B28 - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3C - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _080B8A00 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B8A00: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B89DC - - thumb_func_start sub_80B8A0C -sub_80B8A0C: @ 80B8A0C - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_80B8B28 - ldrh r1, [r4, 0xA] - movs r0, 0x7 - ands r0, r1 - movs r1, 0 - strh r0, [r4, 0xE] - strh r1, [r4, 0x10] - ldr r5, =0x0000ffff - movs r0, 0x42 - adds r1, r5, 0 - bl SetGpuReg - movs r0, 0x46 - adds r1, r5, 0 - bl SetGpuReg - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8A0C - - thumb_func_start sub_80B8A44 -sub_80B8A44: @ 80B8A44 - push {r4,lr} - adds r4, r0, 0 - bl sub_80B8B28 - adds r0, r4, 0 - bl sub_80B8BF0 - lsls r0, 24 - cmp r0, 0 - beq _080B8A5E - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B8A5E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80B8A44 - - thumb_func_start sub_80B8A64 -sub_80B8A64: @ 80B8A64 - push {r4,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r0, =0x04000008 - ldrh r1, [r0] - lsrs r1, 8 - lsls r1, 27 - lsrs r1, 16 - movs r0, 0 - str r0, [sp] - movs r0, 0xC0 - lsls r0, 19 - adds r1, r0 - ldr r2, =0x05000200 - mov r0, sp - bl CpuSet - adds r0, r4, 0 - adds r0, 0x22 - add r1, sp, 0x4 - bl sub_806F684 - ldr r0, [sp, 0x4] - bl SetVBlankCallback - bl sub_8197200 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - ldrh r1, [r4, 0x26] - lsls r1, 24 - lsrs r1, 24 - bl sub_80B6070 - movs r0, 0x6 - bl FieldEffectActiveListRemove - ldr r0, =sub_80B88B4 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8A64 - - thumb_func_start sub_80B8AE0 -sub_80B8AE0: @ 80B8AE0 - push {r4,lr} - sub sp, 0x4 - ldr r0, =sub_80B88B4 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - adds r0, r4, 0 - adds r0, 0x22 - mov r1, sp - bl sub_806F684 - ldr r0, [sp] - bl _call_via_r0 - ldrh r1, [r4, 0xA] - movs r0, 0x10 - bl SetGpuReg - ldrh r1, [r4, 0xC] - movs r0, 0x12 - bl SetGpuReg - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8AE0 - - thumb_func_start sub_80B8B28 -sub_80B8B28: @ 80B8B28 - ldrh r1, [r0, 0xA] - subs r1, 0x10 - strh r1, [r0, 0xA] - ldrh r1, [r0, 0xE] - adds r1, 0x10 - strh r1, [r0, 0xE] - bx lr - thumb_func_end sub_80B8B28 - - thumb_func_start sub_80B8B38 -sub_80B8B38: @ 80B8B38 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r5, r0, 0 - ldrh r2, [r5, 0x10] - movs r1, 0x10 - ldrsh r0, [r5, r1] - cmp r0, 0x1F - ble _080B8B54 - movs r0, 0x1 - b _080B8BD8 -_080B8B54: - ldrh r0, [r5, 0xE] - lsls r0, 16 - asrs r3, r0, 19 - movs r1, 0x1F - ands r3, r1 - movs r4, 0x10 - ldrsh r0, [r5, r4] - cmp r3, r0 - blt _080B8BD6 - movs r0, 0x20 - subs r3, r0, r3 - ands r3, r1 - subs r0, r2 - mov r12, r0 - mov r7, r12 - ands r7, r1 - mov r12, r7 - ldrh r0, [r5, 0x20] - ldr r1, =0x06000140 - adds r1, r0 - mov r8, r1 - movs r4, 0 - ldr r7, =gUnknown_0855B390 - mov r10, r7 - movs r0, 0xF0 - lsls r0, 8 - mov r9, r0 - adds r1, r3, 0x1 - movs r0, 0x1F - ands r1, r0 - str r1, [sp] - mov r6, r12 - adds r6, 0x1 - ands r6, r0 -_080B8B98: - lsls r1, r4, 5 - adds r2, r1, r3 - lsls r2, 1 - add r2, r8 - mov r7, r12 - adds r0, r7, r1 - lsls r0, 1 - add r0, r10 - ldrh r0, [r0] - mov r7, r9 - orrs r0, r7 - strh r0, [r2] - ldr r0, [sp] - adds r2, r1, r0 - lsls r2, 1 - add r2, r8 - adds r1, r6, r1 - lsls r1, 1 - add r1, r10 - ldrh r0, [r1] - mov r1, r9 - orrs r0, r1 - strh r0, [r2] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x9 - bls _080B8B98 - ldrh r0, [r5, 0x10] - adds r0, 0x2 - strh r0, [r5, 0x10] -_080B8BD6: - movs r0, 0 -_080B8BD8: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B8B38 - - thumb_func_start sub_80B8BF0 -sub_80B8BF0: @ 80B8BF0 - push {r4-r7,lr} - adds r5, r0, 0 - movs r1, 0x10 - ldrsh r0, [r5, r1] - cmp r0, 0x1F - ble _080B8C00 - movs r0, 0x1 - b _080B8C54 -_080B8C00: - ldrh r0, [r5, 0xE] - lsls r0, 16 - asrs r0, 19 - lsls r0, 16 - lsrs r2, r0, 16 - movs r1, 0x10 - ldrsh r0, [r5, r1] - cmp r2, r0 - blt _080B8C52 - ldrh r0, [r5, 0xA] - lsls r0, 16 - asrs r2, r0, 19 - movs r0, 0x1F - ands r2, r0 - ldrh r0, [r5, 0x20] - ldr r1, =0x06000140 - adds r6, r0, r1 - movs r3, 0 - movs r0, 0xF0 - lsls r0, 8 - adds r7, r0, 0 - adds r4, r2, 0x1 - movs r0, 0x1F - ands r4, r0 -_080B8C30: - lsls r0, r3, 5 - adds r1, r0, r2 - lsls r1, 1 - adds r1, r6 - strh r7, [r1] - adds r0, r4 - lsls r0, 1 - adds r0, r6 - strh r7, [r0] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x9 - bls _080B8C30 - ldrh r0, [r5, 0x10] - adds r0, 0x2 - strh r0, [r5, 0x10] -_080B8C52: - movs r0, 0 -_080B8C54: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B8BF0 - - thumb_func_start sub_80B8C60 -sub_80B8C60: @ 80B8C60 - push {r4-r6,lr} - sub sp, 0x8 - adds r6, r0, 0 - movs r5, 0x80 - lsls r5, 24 - ands r5, r6 - lsrs r5, 16 - lsls r5, 16 - lsrs r5, 16 - ldr r0, =0x7fffffff - ands r6, r0 - lsls r0, r6, 16 - lsrs r0, 16 - movs r3, 0xA0 - lsls r3, 1 - movs r4, 0x50 - str r4, [sp] - movs r4, 0 - str r4, [sp, 0x4] - bl sub_80B5FE8 - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r1, =0x02020630 - adds r2, r1 - ldr r1, =DummyObjectCallback - str r1, [r2, 0x1C] - ldrb r3, [r2, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r3 - strb r1, [r2, 0x5] - strh r6, [r2, 0x2E] - strh r5, [r2, 0x3A] - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B8C60 - - thumb_func_start sub_80B8CC0 -sub_80B8CC0: @ 80B8CC0 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x20] - subs r0, 0x14 - strh r0, [r1, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x78 - bgt _080B8D00 - movs r0, 0x78 - strh r0, [r1, 0x20] - movs r0, 0x1E - strh r0, [r1, 0x30] - ldr r0, =sub_80B8D04 - str r0, [r1, 0x1C] - movs r2, 0x3A - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _080B8CF8 - ldrh r0, [r1, 0x2E] - movs r1, 0 - movs r2, 0x7D - movs r3, 0xA - bl sub_80A32C0 - b _080B8D00 - .pool -_080B8CF8: - ldrh r0, [r1, 0x2E] - movs r1, 0 - bl cry_related -_080B8D00: - pop {r0} - bx r0 - thumb_func_end sub_80B8CC0 - - thumb_func_start sub_80B8D04 -sub_80B8D04: @ 80B8D04 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x30] - subs r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - cmp r0, 0 - bne _080B8D18 - ldr r0, =sub_80B8D20 - str r0, [r1, 0x1C] -_080B8D18: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8D04 - - thumb_func_start sub_80B8D20 -sub_80B8D20: @ 80B8D20 - push {lr} - adds r2, r0, 0 - ldrh r3, [r2, 0x20] - movs r0, 0x20 - ldrsh r1, [r2, r0] - movs r0, 0x40 - negs r0, r0 - cmp r1, r0 - bge _080B8D38 - movs r0, 0x1 - strh r0, [r2, 0x3C] - b _080B8D3E -_080B8D38: - adds r0, r3, 0 - subs r0, 0x14 - strh r0, [r2, 0x20] -_080B8D3E: - pop {r0} - bx r0 - thumb_func_end sub_80B8D20 - - thumb_func_start sub_80B8D44 -sub_80B8D44: @ 80B8D44 - push {lr} - ldr r0, =sub_80B8D84 - movs r1, 0xFF - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =0x02038c08 - ldr r0, [r0] - strh r0, [r1, 0x26] - bl sav1_reset_battle_music_maybe - ldr r0, =0x0000016d - bl sub_80858C4 - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B8D44 - - thumb_func_start sub_80B8D84 -sub_80B8D84: @ 80B8D84 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_0855C4E0 - ldr r2, =0x03005e00 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8D84 - - thumb_func_start sub_80B8DB4 -sub_80B8DB4: @ 80B8DB4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r4, r0, 0 - bl script_env_2_enable - bl player_bitmagic - ldr r5, =0x02037590 - movs r0, 0x1 - strb r0, [r5, 0x6] - movs r0, 0x8 - bl SetPlayerAvatarStateMask - adds r6, r4, 0 - adds r6, 0xA - movs r0, 0xC - adds r0, r4 - mov r8, r0 - adds r0, r6, 0 - mov r1, r8 - bl PlayerGetDestCoords - ldr r2, =0x02037350 - ldrb r1, [r5, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x18] - lsrs r0, 4 - adds r1, r6, 0 - mov r2, r8 - bl MoveCoords - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8DB4 - - thumb_func_start sub_80B8E14 -sub_80B8E14: @ 80B8E14 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - adds r0, r4, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _080B8E3E - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B8E50 -_080B8E3E: - bl sub_808C114 - adds r0, r4, 0 - movs r1, 0x39 - bl FieldObjectSetSpecialAnim - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] -_080B8E50: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8E14 - - thumb_func_start sub_80B8E60 -sub_80B8E60: @ 80B8E60 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - bl FieldObjectCheckIfSpecialAnimFinishedOrInactive - lsls r0, 24 - cmp r0, 0 - beq _080B8E96 - ldr r2, =0x02038c08 - movs r1, 0x26 - ldrsh r0, [r4, r1] - movs r1, 0x80 - lsls r1, 24 - orrs r0, r1 - str r0, [r2] - movs r0, 0x3B - bl FieldEffectStart - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B8E96: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8E60 - - thumb_func_start sub_80B8EA8 -sub_80B8EA8: @ 80B8EA8 - push {r4-r6,lr} - adds r6, r0, 0 - movs r0, 0x6 - bl FieldEffectActiveListContains - lsls r0, 24 - cmp r0, 0 - bne _080B8F12 - ldr r5, =0x02037590 - ldrb r0, [r5, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - movs r0, 0x3 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl sub_8093540 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - ldr r1, =0x02038c08 - movs r2, 0xA - ldrsh r0, [r6, r2] - str r0, [r1] - movs r2, 0xC - ldrsh r0, [r6, r2] - str r0, [r1, 0x4] - ldrb r0, [r5, 0x5] - str r0, [r1, 0x8] - movs r0, 0x8 - bl FieldEffectStart - strb r0, [r4, 0x1A] - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] -_080B8F12: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8EA8 - - thumb_func_start sub_80B8F24 -sub_80B8F24: @ 80B8F24 - push {r4,r5,lr} - ldr r5, =0x02037590 - ldrb r1, [r5, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B8F84 - movs r0, 0 - strb r0, [r5, 0x6] - ldrb r1, [r5] - movs r0, 0xDF - ands r0, r1 - strb r0, [r5] - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl GetFaceDirectionAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - ldrb r0, [r4, 0x1A] - movs r1, 0x1 - bl sub_81555AC - bl sub_809757C - bl script_env_2_disable - movs r0, 0x9 - bl FieldEffectActiveListRemove - ldr r0, =sub_80B8D84 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B8F84: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B8F24 - - thumb_func_start sub_80B8F98 -sub_80B8F98: @ 80B8F98 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =gFieldEffectObjectTemplatePointers - adds r0, 0x90 - ldr r0, [r0] - movs r2, 0x18 - negs r2, r2 - movs r1, 0x78 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, r0, 4 - add r1, r8 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - movs r2, 0x4 - orrs r0, r2 - movs r2, 0xF - ands r0, r2 - movs r2, 0x40 - orrs r0, r2 - strb r0, [r1, 0x5] - movs r2, 0 - strh r2, [r1, 0x2E] - strh r2, [r1, 0x30] - strh r2, [r1, 0x32] - ldr r0, =0x0000ffff - strh r0, [r1, 0x34] - ldrh r0, [r1, 0x22] - strh r0, [r1, 0x36] - strh r2, [r1, 0x38] - ldr r1, =0x00003e41 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x00000e0e - movs r0, 0x52 - bl SetGpuReg - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - ldr r0, =gUnknown_0855B610 - movs r1, 0xC0 - movs r2, 0x20 - bl gpu_pal_apply - movs r0, 0x12 - movs r1, 0x78 - bl SetGpuReg - movs r4, 0x3 - ldr r7, =0x0600f800 - ldr r0, =0x0000bff4 - adds r6, r0, 0 -_080B901A: - movs r2, 0xC - lsls r0, r4, 1 - lsls r5, r4, 5 - adds r0, r4 - lsls r3, r0, 1 -_080B9024: - adds r0, r5, r2 - lsls r0, 1 - adds r0, r7 - adds r1, r2, r6 - adds r1, r3, r1 - adds r1, 0x1 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x11 - bls _080B9024 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xE - bls _080B901A - movs r0, 0 - ldr r5, =gUnknown_0855B630 -_080B904A: - movs r4, 0 - adds r7, r0, 0x1 - lsls r6, r0, 5 -_080B9050: - lsls r1, r4, 2 - adds r1, r6, r1 - ldr r0, =0x06008020 - adds r3, r1, r0 - adds r0, r1, 0x1 - adds r0, r5 - ldrb r2, [r0] - lsls r2, 8 - adds r0, r1, r5 - ldrb r0, [r0] - adds r0, r2 - strh r0, [r3] - ldr r0, =0x06008022 - adds r3, r1, r0 - adds r0, r1, 0x3 - adds r0, r5 - ldrb r2, [r0] - lsls r2, 8 - adds r1, 0x2 - adds r1, r5 - ldrb r0, [r1] - adds r0, r2 - strh r0, [r3] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _080B9050 - lsls r0, r7, 24 - lsrs r0, 24 - cmp r0, 0x59 - bls _080B904A - mov r0, r8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B8F98 - - thumb_func_start sub_80B90CC -sub_80B90CC: @ 80B90CC - push {r4,lr} - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x68] - movs r1, 0x78 - movs r2, 0 - movs r3, 0x1 - bl AddObjectToFront - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r2, r4, 4 - adds r2, r4 - lsls r2, 2 - ldr r0, =0x02020630 - adds r2, r0 - ldrb r1, [r2, 0x5] - movs r0, 0xF - ands r0, r1 - movs r1, 0xD - negs r1, r1 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0x5] - ldr r0, =sub_80B9128 - str r0, [r2, 0x1C] - ldr r0, =0x02038c08 - ldr r0, [r0] - strh r0, [r2, 0x30] - movs r0, 0x9E - bl audio_play - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B90CC - - thumb_func_start sub_80B9128 -sub_80B9128: @ 80B9128 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r1, 0x8C - bl cosine - movs r5, 0 - strh r0, [r4, 0x24] - movs r2, 0x32 - ldrsh r0, [r4, r2] - movs r1, 0x48 - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x4 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x32] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080B918A - movs r2, 0x30 - ldrsh r0, [r4, r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - adds r3, r1, 0 - adds r3, 0x3E - ldrb r2, [r3] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r3] - ldrh r0, [r4, 0x24] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r1, 0x20] - ldrh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r0, r2 - subs r0, 0x8 - strh r0, [r1, 0x22] - strh r5, [r1, 0x24] - strh r5, [r1, 0x26] -_080B918A: - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x7F - ble _080B919A - adds r0, r4, 0 - movs r1, 0x1E - bl FieldEffectStop -_080B919A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9128 - - thumb_func_start sub_80B91A4 -sub_80B91A4: @ 80B91A4 - push {lr} - ldr r0, =sub_80B91D4 - movs r1, 0xFE - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =0x02038c08 - ldr r0, [r0] - strh r0, [r1, 0xA] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B91A4 - - thumb_func_start sub_80B91D4 -sub_80B91D4: @ 80B91D4 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_0855C4F4 - ldr r2, =0x03005e00 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B91D4 - - thumb_func_start sub_80B9204 -sub_80B9204: @ 80B9204 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =0x02037590 - ldrb r1, [r6, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - adds r0, r4, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _080B922E - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B924C -_080B922E: - ldrb r0, [r6] - strh r0, [r5, 0x26] - movs r0, 0x1 - strb r0, [r6, 0x6] - bl SetPlayerAvatarStateMask - bl sub_808C114 - adds r0, r4, 0 - movs r1, 0x39 - bl FieldObjectSetSpecialAnim - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] -_080B924C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9204 - - thumb_func_start sub_80B925C -sub_80B925C: @ 80B925C - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B928C - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - ldr r1, =0x02038c08 - movs r2, 0xA - ldrsh r0, [r4, r2] - str r0, [r1] - movs r0, 0x3B - bl FieldEffectStart -_080B928C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B925C - - thumb_func_start sub_80B92A0 -sub_80B92A0: @ 80B92A0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x6 - bl FieldEffectActiveListContains - lsls r0, 24 - cmp r0, 0 - bne _080B92E8 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r5, r0, r1 - ldrh r1, [r4, 0x26] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _080B92D8 - ldrb r0, [r5, 0x1A] - movs r1, 0x2 - bl sub_81555AC - ldrb r0, [r5, 0x1A] - movs r1, 0 - bl sub_81555D8 -_080B92D8: - bl sub_80B94C4 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B92E8: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B92A0 - - thumb_func_start sub_80B92F8 -sub_80B92F8: @ 80B92F8 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0xA] - bl sub_80B9508 - lsls r0, 24 - cmp r0, 0 - beq _080B932C - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x10 - strh r0, [r4, 0xC] - movs r0, 0x1 - bl SetPlayerAvatarTransitionFlags - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - movs r1, 0x2 - bl FieldObjectSetSpecialAnim -_080B932C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B92F8 - - thumb_func_start sub_80B933C -sub_80B933C: @ 80B933C - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r2, r0, r1 - ldrh r1, [r4, 0xC] - movs r3, 0xC - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _080B9362 - subs r0, r1, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _080B9380 -_080B9362: - adds r0, r2, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B9380 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x9E - bl audio_play - ldrb r0, [r4, 0xA] - bl sub_80B9524 -_080B9380: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B933C - - thumb_func_start sub_80B9390 -sub_80B9390: @ 80B9390 - push {r4-r6,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0xC] - adds r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _080B9406 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - movs r0, 0x3 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r6, =0x02020630 - adds r0, r6 - movs r1, 0x16 - bl StartObjectImageAnim - ldrb r0, [r4, 0x1] - movs r1, 0x10 - orrs r0, r1 - strb r0, [r4, 0x1] - adds r0, r4, 0 - movs r1, 0x48 - bl FieldObjectSetSpecialAnim - ldrh r1, [r5, 0x26] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _080B93FC - ldrb r1, [r4, 0x1A] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl RemoveObjectAndFreeTiles -_080B93FC: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0 - strh r0, [r5, 0xC] -_080B9406: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9390 - - thumb_func_start sub_80B9418 -sub_80B9418: @ 80B9418 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0xC] - adds r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - ble _080B9464 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimActive - ldrb r1, [r4, 0x1] - movs r0, 0x11 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x1] - ldrb r1, [r4, 0x2] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x2] - ldrb r0, [r5, 0xA] - ldrb r1, [r4, 0x4] - bl sub_80B9560 - bl CameraObjectReset2 - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] -_080B9464: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9418 - - thumb_func_start sub_80B9474 -sub_80B9474: @ 80B9474 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0xA] - bl sub_80B9508 - lsls r0, 24 - cmp r0, 0 - beq _080B948E - bl sub_80AF0B4 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B948E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80B9474 - - thumb_func_start sub_80B9494 -sub_80B9494: @ 80B9494 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080B94B6 - movs r0, 0x1F - bl FieldEffectActiveListRemove - ldr r0, =sub_80B91D4 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B94B6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9494 - - thumb_func_start sub_80B94C4 -sub_80B94C4: @ 80B94C4 - push {lr} - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x68] - movs r1, 0xFF - movs r2, 0xB4 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r1, =0x02020630 - adds r2, r1 - ldrb r3, [r2, 0x5] - movs r1, 0xF - ands r1, r3 - movs r3, 0xD - negs r3, r3 - ands r1, r3 - movs r3, 0x4 - orrs r1, r3 - strb r1, [r2, 0x5] - ldr r1, =sub_80B957C - str r1, [r2, 0x1C] - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B94C4 - - thumb_func_start sub_80B9508 -sub_80B9508: @ 80B9508 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x3C] - lsls r0, 24 - lsrs r0, 24 - bx lr - .pool - thumb_func_end sub_80B9508 - - thumb_func_start sub_80B9524 -sub_80B9524: @ 80B9524 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - ldr r0, =sub_80B963C - str r0, [r4, 0x1C] - movs r1, 0 - movs r0, 0x78 - strh r0, [r4, 0x20] - strh r1, [r4, 0x22] - strh r1, [r4, 0x24] - strh r1, [r4, 0x26] - adds r0, r4, 0 - adds r0, 0x2E - movs r2, 0x10 - bl memset - movs r0, 0x40 - strh r0, [r4, 0x3A] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9524 - - thumb_func_start sub_80B9560 -sub_80B9560: @ 80B9560 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =0x02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - strh r1, [r2, 0x3A] - bx lr - .pool - thumb_func_end sub_80B9560 - - thumb_func_start sub_80B957C -sub_80B957C: @ 80B957C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B9628 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B95C0 - ldrb r0, [r4, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r4, 0x1] - ldr r0, =gUnknown_0855C548 - str r0, [r4, 0x10] - adds r0, r4, 0 - bl obj_alloc_rotscale_entry - adds r0, r4, 0 - movs r1, 0 - bl StartObjectRotScalAnim - movs r0, 0x76 - strh r0, [r4, 0x20] - ldr r0, =0x0000ffd0 - strh r0, [r4, 0x22] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0x40 - strh r0, [r4, 0x30] - adds r0, 0xC0 - strh r0, [r4, 0x32] -_080B95C0: - ldrh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r4, 0x30] - adds r0, r1 - strh r0, [r4, 0x30] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x78 - bl cosine - strh r0, [r4, 0x24] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x78 - bl sine - strh r0, [r4, 0x26] - ldrh r2, [r4, 0x32] - movs r0, 0x32 - ldrsh r1, [r4, r0] - ldr r0, =0x000007ff - cmp r1, r0 - bgt _080B95F6 - adds r0, r2, 0 - adds r0, 0x60 - strh r0, [r4, 0x32] -_080B95F6: - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0x81 - ble _080B9628 - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - ldrb r1, [r4, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x1] - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - ldrb r1, [r4, 0x1] - lsrs r1, 6 - ldrb r2, [r4, 0x3] - lsrs r2, 6 - adds r0, r4, 0 - movs r3, 0 - bl CalcVecFromObjectCenterToObjectUpperLeft -_080B9628: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B957C - - thumb_func_start sub_80B963C -sub_80B963C: @ 80B963C - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r1, 0x8C - bl cosine - movs r5, 0 - strh r0, [r4, 0x24] - movs r2, 0x32 - ldrsh r0, [r4, r2] - movs r1, 0x48 - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x4 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x32] - movs r1, 0x3A - ldrsh r0, [r4, r1] - cmp r0, 0x40 - beq _080B969A - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - adds r3, r1, 0 - adds r3, 0x3E - ldrb r2, [r3] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r3] - ldrh r0, [r4, 0x24] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r1, 0x20] - ldrh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r0, r2 - subs r0, 0x8 - strh r0, [r1, 0x22] - strh r5, [r1, 0x24] - strh r5, [r1, 0x26] -_080B969A: - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x7F - ble _080B96A6 - movs r0, 0x1 - strh r0, [r4, 0x3C] -_080B96A6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B963C - - thumb_func_start sub_80B96B0 -sub_80B96B0: @ 80B96B0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B9784 - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _080B96FA - ldrb r0, [r4, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r4, 0x1] - ldr r0, =gUnknown_0855C548 - str r0, [r4, 0x10] - adds r0, r4, 0 - bl obj_alloc_rotscale_entry - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - movs r0, 0x5E - strh r0, [r4, 0x20] - ldr r0, =0x0000ffe0 - strh r0, [r4, 0x22] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0xF0 - strh r0, [r4, 0x30] - movs r0, 0x80 - lsls r0, 4 - strh r0, [r4, 0x32] - movs r0, 0x80 - strh r0, [r4, 0x36] -_080B96FA: - ldrh r1, [r4, 0x32] - lsls r1, 16 - asrs r1, 24 - ldrh r2, [r4, 0x30] - adds r2, r1 - ldrh r0, [r4, 0x34] - adds r0, r1 - strh r0, [r4, 0x34] - movs r0, 0xFF - ands r2, r0 - strh r2, [r4, 0x30] - movs r3, 0x30 - ldrsh r0, [r4, r3] - movs r1, 0x20 - bl cosine - strh r0, [r4, 0x24] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x78 - bl sine - strh r0, [r4, 0x26] - ldrh r1, [r4, 0x32] - movs r2, 0x32 - ldrsh r0, [r4, r2] - movs r2, 0x80 - lsls r2, 1 - cmp r0, r2 - ble _080B973C - ldrh r0, [r4, 0x36] - subs r0, r1, r0 - strh r0, [r4, 0x32] -_080B973C: - ldrh r1, [r4, 0x36] - movs r3, 0x36 - ldrsh r0, [r4, r3] - cmp r0, 0xFF - bgt _080B974C - adds r0, r1, 0 - adds r0, 0x18 - strh r0, [r4, 0x36] -_080B974C: - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0xFF - bgt _080B9756 - strh r2, [r4, 0x32] -_080B9756: - movs r2, 0x34 - ldrsh r0, [r4, r2] - cmp r0, 0x3B - ble _080B9784 - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - ldrb r1, [r4, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x1] - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_080B9784: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B96B0 - - thumb_func_start sub_80B9794 -sub_80B9794: @ 80B9794 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_80B9524 - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_80B96B0 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9794 - - thumb_func_start sub_80B97C0 -sub_80B97C0: @ 80B97C0 - push {lr} - ldr r0, =sub_80B97D4 - movs r1, 0xFE - bl CreateTask - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B97C0 - - thumb_func_start sub_80B97D4 -sub_80B97D4: @ 80B97D4 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_0855C550 - ldr r2, =0x03005e00 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B97D4 - - thumb_func_start sub_80B9804 -sub_80B9804: @ 80B9804 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =0x02037590 - ldrb r1, [r6, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - adds r0, r4, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _080B982E - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B98A6 -_080B982E: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0x11 - strh r0, [r5, 0xC] - ldrb r0, [r6] - strh r0, [r5, 0x26] - movs r0, 0x1 - strb r0, [r6, 0x6] - bl SetPlayerAvatarStateMask - ldrh r1, [r5, 0x26] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _080B9856 - ldrb r0, [r4, 0x1A] - movs r1, 0 - bl sub_81555AC -_080B9856: - movs r0, 0x3 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - bl CameraObjectReset2 - adds r0, r4, 0 - movs r1, 0x3 - bl FieldObjectTurn - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0x16 - bl StartObjectImageAnim - ldrb r1, [r4, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x1] - bl sub_80B94C4 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0xA] - bl sub_80B9524 - ldrb r0, [r5, 0xA] - ldrb r1, [r4, 0x4] - bl sub_80B9560 -_080B98A6: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9804 - - thumb_func_start sub_80B98B8 -sub_80B98B8: @ 80B98B8 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r1, [r5, 0xC] - movs r2, 0xC - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _080B98D0 - subs r0, r1, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _080B9910 -_080B98D0: - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldrb r0, [r0, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - ldrb r0, [r5, 0xA] - movs r1, 0x40 - bl sub_80B9560 - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - movs r1, 0 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - strh r1, [r4, 0x24] - strh r1, [r4, 0x26] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - strh r1, [r5, 0xC] -_080B9910: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B98B8 - - thumb_func_start sub_80B9924 -sub_80B9924: @ 80B9924 - push {r4,lr} - sub sp, 0x24 - adds r4, r0, 0 - ldr r1, =gUnknown_0855C56C - mov r0, sp - movs r2, 0x24 - bl memcpy - ldr r0, =0x02037590 - ldrb r0, [r0, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - movs r2, 0xC - ldrsh r0, [r4, r2] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - strh r0, [r1, 0x26] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x11 - ble _080B9962 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080B9962: - add sp, 0x24 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9924 - - thumb_func_start sub_80B9978 -sub_80B9978: @ 80B9978 - push {r4-r6,lr} - adds r6, r0, 0 - ldrb r0, [r6, 0xA] - bl sub_80B9508 - lsls r0, 24 - cmp r0, 0 - beq _080B99DC - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - lsls r5, r0, 3 - adds r5, r0 - lsls r5, 2 - ldr r0, =0x02037350 - adds r5, r0 - ldrb r0, [r5, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - ldrb r1, [r5, 0x1] - movs r0, 0x11 - negs r0, r0 - ands r0, r1 - strb r0, [r5, 0x1] - movs r0, 0x10 - ldrsh r1, [r5, r0] - movs r0, 0x12 - ldrsh r2, [r5, r0] - adds r0, r5, 0 - bl sub_808EB08 - movs r0, 0 - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - adds r4, 0x3E - ldrb r0, [r4] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - bl sub_808C114 - adds r0, r5, 0 - movs r1, 0x39 - bl FieldObjectSetSpecialAnim - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] -_080B99DC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9978 - - thumb_func_start sub_80B99F0 -sub_80B99F0: @ 80B99F0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080B9A18 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - ldrb r0, [r4, 0xA] - bl sub_80B9794 -_080B9A18: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B99F0 - - thumb_func_start sub_80B9A28 -sub_80B9A28: @ 80B9A28 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0xA] - bl sub_80B9508 - lsls r0, 24 - cmp r0, 0 - beq _080B9A54 - movs r0, 0xA - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x10 - strh r0, [r4, 0xA] -_080B9A54: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9A28 - - thumb_func_start sub_80B9A60 -sub_80B9A60: @ 80B9A60 - push {r4-r7,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0xA] - subs r0, 0x1 - strh r0, [r5, 0xA] - lsls r0, 16 - cmp r0, 0 - bne _080B9ACA - ldr r6, =0x02037590 - ldrb r1, [r6, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - movs r7, 0 - ldrh r1, [r5, 0x26] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _080B9A94 - movs r7, 0x3 - ldrb r0, [r4, 0x1A] - movs r1, 0x1 - bl sub_81555AC -_080B9A94: - adds r0, r7, 0 - bl GetPlayerAvatarGraphicsIdByStateId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - adds r0, r4, 0 - movs r1, 0x1 - bl FieldObjectTurn - ldrh r0, [r5, 0x26] - strb r0, [r6] - movs r0, 0 - strb r0, [r6, 0x6] - movs r0, 0x20 - bl FieldEffectActiveListRemove - ldr r0, =sub_80B97D4 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_080B9ACA: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9A60 - - thumb_func_start sub_80B9ADC -sub_80B9ADC: @ 80B9ADC - push {r4,lr} - sub sp, 0x4 - ldr r4, =0x02038c08 - ldrb r0, [r4] - ldrb r1, [r4, 0x4] - ldrb r2, [r4, 0x8] - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _080B9B2C - ldr r0, =sub_80B9BE8 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - mov r0, sp - ldrb r0, [r0] - strh r0, [r1, 0xC] - ldr r0, [r4] - strh r0, [r1, 0x14] - ldr r0, [r4, 0x4] - strh r0, [r1, 0x16] - ldr r0, [r4, 0x8] - strh r0, [r1, 0x18] - b _080B9B32 - .pool -_080B9B2C: - movs r0, 0x41 - bl FieldEffectActiveListRemove -_080B9B32: - movs r0, 0 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80B9ADC - - thumb_func_start sub_80B9B3C -sub_80B9B3C: @ 80B9B3C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - movs r1, 0xE - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080B9B78 - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _080B9B7C - movs r0, 0 - strh r0, [r4, 0xC] - ldrh r1, [r4, 0xA] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _080B9B7C - subs r0, r1, 0x1 - b _080B9B7A - .pool -_080B9B78: - movs r0, 0x4 -_080B9B7A: - strh r0, [r4, 0xA] -_080B9B7C: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _080B9BB6 - movs r0, 0 - strh r0, [r4] - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080B9BAC - ldrh r1, [r4, 0xA] - negs r1, r1 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl SetCameraPanning - b _080B9BB6 -_080B9BAC: - movs r0, 0xA - ldrsh r1, [r4, r0] - movs r0, 0 - bl SetCameraPanning -_080B9BB6: - bl UpdateCameraPanning - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B9BC8 - adds r0, r5, 0 - bl DestroyTask -_080B9BC8: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80B9B3C - - thumb_func_start sub_80B9BD0 -sub_80B9BD0: @ 80B9BD0 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0x1 - strh r0, [r1, 0x16] - bx lr - .pool - thumb_func_end sub_80B9BD0 - - thumb_func_start sub_80B9BE8 -sub_80B9BE8: @ 80B9BE8 - 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, =0x03005e08 - adds r4, r0 - bl InstallCameraPanAheadCallback - movs r0, 0 - bl SetCameraPanningCallback - ldr r1, =gUnknown_0855C590 - movs r2, 0x2 - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r0, r1 - ldr r2, [r0] - adds r0, r4, 0 - adds r1, r5, 0 - bl _call_via_r2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9BE8 - - thumb_func_start sub_80B9C28 -sub_80B9C28: @ 80B9C28 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =sub_80B9B3C - movs r1, 0x5A - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x58 - bl audio_play - strh r4, [r5, 0xA] - ldrh r0, [r5, 0x2] - adds r0, 0x1 - strh r0, [r5, 0x2] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9C28 - - thumb_func_start sub_80B9C54 -sub_80B9C54: @ 80B9C54 - push {r4-r7,lr} - sub sp, 0x4 - adds r7, r0, 0 - ldrh r0, [r7, 0x6] - adds r0, 0x1 - strh r0, [r7, 0x6] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x78 - ble _080B9CC2 - ldr r2, =0x02037350 - movs r1, 0x4 - ldrsh r0, [r7, r1] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - ldrb r0, [r1, 0x1] - movs r2, 0x20 - orrs r0, r2 - strb r0, [r1, 0x1] - ldr r6, =0x0000ffff - ldr r5, =0x00007fff - adds r0, r6, 0 - movs r1, 0x10 - adds r2, r5, 0 - bl sub_80A2A20 - str r5, [sp] - adds r0, r6, 0 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - adds r0, r4, 0 - bl sub_80B9D24 - movs r0, 0x57 - bl audio_play - ldrb r0, [r7, 0xA] - bl sub_80B9BD0 - movs r0, 0 - strh r0, [r7, 0x6] - ldrh r0, [r7, 0x2] - adds r0, 0x1 - strh r0, [r7, 0x2] -_080B9CC2: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9C54 - - thumb_func_start sub_80B9CDC -sub_80B9CDC: @ 80B9CDC - push {r4,r5,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080B9D16 - ldr r0, =sub_80B9B3C - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _080B9D16 - bl InstallCameraPanAheadCallback - ldrb r0, [r4, 0xC] - ldrb r1, [r4, 0xE] - ldrb r2, [r4, 0x10] - bl RemoveFieldObjectByLocalIdAndMap - movs r0, 0x41 - bl FieldEffectActiveListRemove - adds r0, r5, 0 - bl DestroyTask -_080B9D16: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9CDC - - thumb_func_start sub_80B9D24 -sub_80B9D24: @ 80B9D24 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - ldr r0, =0x03005dec - movs r1, 0 - ldrsh r2, [r0, r1] - movs r3, 0x20 - ldrsh r0, [r6, r3] - adds r2, r0 - movs r1, 0x24 - ldrsh r0, [r6, r1] - adds r2, r0 - ldr r0, =0x03005de8 - movs r3, 0 - ldrsh r0, [r0, r3] - movs r3, 0x22 - ldrsh r1, [r6, r3] - adds r0, r1 - movs r3, 0x26 - ldrsh r1, [r6, r3] - adds r0, r1 - subs r0, 0x4 - movs r5, 0 - lsls r2, 16 - mov r8, r2 - lsls r7, r0, 16 -_080B9D5A: - ldr r0, =gUnknown_0855C5EC - mov r2, r8 - asrs r1, r2, 16 - asrs r2, r7, 16 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _080B9D96 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - lsls r1, r5, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - strh r5, [r4, 0x2E] - ldrb r1, [r6, 0x5] - lsrs r1, 4 - lsls r1, 4 - ldrb r2, [r4, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x5] -_080B9D96: - adds r5, 0x1 - cmp r5, 0x3 - ble _080B9D5A - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9D24 - - thumb_func_start sub_80B9DB8 -sub_80B9DB8: @ 80B9DB8 - push {lr} - adds r1, r0, 0 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0x1 - beq _080B9DE4 - cmp r0, 0x1 - bgt _080B9DCE - cmp r0, 0 - beq _080B9DD8 - b _080B9E02 -_080B9DCE: - cmp r0, 0x2 - beq _080B9DF0 - cmp r0, 0x3 - beq _080B9DF6 - b _080B9E02 -_080B9DD8: - ldrh r0, [r1, 0x20] - subs r0, 0x10 - strh r0, [r1, 0x20] - ldrh r0, [r1, 0x22] - subs r0, 0xC - b _080B9E00 -_080B9DE4: - ldrh r0, [r1, 0x20] - adds r0, 0x10 - strh r0, [r1, 0x20] - ldrh r0, [r1, 0x22] - subs r0, 0xC - b _080B9E00 -_080B9DF0: - ldrh r0, [r1, 0x20] - subs r0, 0x10 - b _080B9DFA -_080B9DF6: - ldrh r0, [r1, 0x20] - adds r0, 0x10 -_080B9DFA: - strh r0, [r1, 0x20] - ldrh r0, [r1, 0x22] - adds r0, 0xC -_080B9E00: - strh r0, [r1, 0x22] -_080B9E02: - ldrh r0, [r1, 0x20] - adds r0, 0x4 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xF8 - bhi _080B9E1E - movs r0, 0x22 - ldrsh r2, [r1, r0] - movs r0, 0x4 - negs r0, r0 - cmp r2, r0 - blt _080B9E1E - cmp r2, 0xA4 - ble _080B9E24 -_080B9E1E: - adds r0, r1, 0 - bl RemoveObjectAndFreeTiles -_080B9E24: - pop {r0} - bx r0 - thumb_func_end sub_80B9DB8 - - thumb_func_start sub_80B9E28 -sub_80B9E28: @ 80B9E28 - push {r4-r7,lr} - sub sp, 0x4 - ldr r7, =0x02038c08 - ldrb r0, [r7] - ldrb r1, [r7, 0x4] - ldrb r2, [r7, 0x8] - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _080B9EBE - mov r0, sp - ldrb r0, [r0] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - movs r0, 0x10 - ldrsh r5, [r4, r0] - subs r5, 0x7 - movs r0, 0x12 - ldrsh r6, [r4, r0] - subs r6, 0x7 - ldr r1, [r7, 0xC] - subs r5, r1, r5 - lsls r5, 4 - ldr r2, [r7, 0x10] - subs r6, r2, r6 - lsls r6, 4 - adds r1, 0x7 - lsls r1, 16 - asrs r1, 16 - adds r2, 0x7 - lsls r2, 16 - asrs r2, 16 - adds r0, r4, 0 - bl npc_coords_shift - ldr r0, =sub_80B9EDC - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - adds r2, r1 - ldrb r0, [r4, 0x4] - strh r0, [r2, 0xA] - ldr r3, =0x02020630 - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0, 0x20] - adds r0, r5 - strh r0, [r2, 0xC] - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0, 0x22] - adds r0, r6 - strh r0, [r2, 0xE] - ldr r0, [r7, 0x14] - strh r0, [r2, 0x18] - mov r0, sp - ldrb r0, [r0] - strh r0, [r2, 0x1A] -_080B9EBE: - movs r0, 0 - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80B9E28 - - thumb_func_start sub_80B9EDC -sub_80B9EDC: @ 80B9EDC - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - movs r0, 0x2 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r6, r0, r1 - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _080B9F10 - cmp r0, 0x1 - beq _080B9F4E - b _080B9FAC - .pool -_080B9F10: - ldrh r0, [r6, 0x20] - lsls r0, 4 - strh r0, [r5, 0x8] - ldrh r0, [r6, 0x22] - lsls r0, 4 - strh r0, [r5, 0xA] - movs r2, 0x4 - ldrsh r0, [r5, r2] - lsls r0, 4 - movs r2, 0x8 - ldrsh r1, [r5, r2] - subs r0, r1 - movs r2, 0x10 - ldrsh r1, [r5, r2] - bl __divsi3 - strh r0, [r5, 0xC] - movs r1, 0x6 - ldrsh r0, [r5, r1] - lsls r0, 4 - movs r2, 0xA - ldrsh r1, [r5, r2] - subs r0, r1 - movs r2, 0x10 - ldrsh r1, [r5, r2] - bl __divsi3 - strh r0, [r5, 0xE] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] -_080B9F4E: - ldrh r1, [r5, 0x10] - movs r2, 0x10 - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _080B9F7C - subs r0, r1, 0x1 - strh r0, [r5, 0x10] - ldrh r1, [r5, 0xC] - ldrh r0, [r5, 0x8] - adds r1, r0 - strh r1, [r5, 0x8] - ldrh r0, [r5, 0xE] - ldrh r2, [r5, 0xA] - adds r0, r2 - strh r0, [r5, 0xA] - lsls r1, 16 - asrs r1, 20 - strh r1, [r6, 0x20] - ldrh r0, [r5, 0xA] - lsls r0, 16 - asrs r0, 20 - strh r0, [r6, 0x22] - b _080B9FAC -_080B9F7C: - movs r1, 0x12 - ldrsh r0, [r5, r1] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - ldrh r0, [r5, 0x4] - strh r0, [r6, 0x20] - ldrh r0, [r5, 0x6] - strh r0, [r6, 0x22] - adds r0, r4, 0 - bl npc_coords_shift_still - ldrb r0, [r4] - movs r1, 0x8 - orrs r0, r1 - strb r0, [r4] - movs r0, 0x42 - bl FieldEffectActiveListRemove - adds r0, r7, 0 - bl DestroyTask -_080B9FAC: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80B9EDC - - thumb_func_start remove_some_task -remove_some_task: @ 80B9FB8 - push {r4,lr} - ldr r4, =0x02039b28 - movs r0, 0 - strb r0, [r4, 0x15] - ldr r1, =0x040000b0 - ldrh r2, [r1, 0xA] - ldr r0, =0x0000c5ff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r2, [r1, 0xA] - ldr r0, =0x00007fff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r0, [r1, 0xA] - ldrb r0, [r4, 0x18] - cmp r0, 0xFF - beq _080B9FE2 - bl DestroyTask - movs r0, 0xFF - strb r0, [r4, 0x18] -_080B9FE2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end remove_some_task - - thumb_func_start dp12_8087EA4 -dp12_8087EA4: @ 80B9FF8 - push {r4,lr} - sub sp, 0x4 - mov r0, sp - movs r4, 0 - strh r4, [r0] - ldr r1, =0x02038c28 - ldr r2, =0x01000780 - bl CpuSet - ldr r0, =0x02039b28 - movs r1, 0 - str r1, [r0] - str r1, [r0, 0x4] - str r1, [r0, 0x8] - str r1, [r0, 0xC] - strb r4, [r0, 0x14] - strb r4, [r0, 0x15] - strb r4, [r0, 0x16] - strb r4, [r0, 0x17] - movs r1, 0xFF - strb r1, [r0, 0x18] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp12_8087EA4 - - thumb_func_start sub_80BA038 -sub_80BA038: @ 80BA038 - push {lr} - sub sp, 0xC - str r0, [sp] - str r1, [sp, 0x4] - str r2, [sp, 0x8] - ldr r0, =0xa2600001 - cmp r1, r0 - bne _080BA06C - ldr r0, =0x02039b28 - ldr r1, =0x02038c2a - str r1, [r0] - movs r2, 0xF0 - lsls r2, 3 - adds r1, r2 - str r1, [r0, 0x4] - ldr r1, =sub_80BA134 - b _080BA07C - .pool -_080BA06C: - ldr r0, =0x02039b28 - ldr r1, =0x02038c2c - str r1, [r0] - movs r2, 0xF0 - lsls r2, 3 - adds r1, r2 - str r1, [r0, 0x4] - ldr r1, =sub_80BA154 -_080BA07C: - str r1, [r0, 0x10] - adds r1, r0, 0 - ldr r0, [sp, 0x4] - str r0, [r1, 0xC] - ldr r0, [sp] - str r0, [r1, 0x8] - mov r0, sp - ldrb r0, [r0, 0x8] - strb r0, [r1, 0x15] - mov r0, sp - ldrb r0, [r0, 0x9] - strb r0, [r1, 0x16] - strb r0, [r1, 0x17] - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BA038 - - thumb_func_start sub_80BA0A8 -sub_80BA0A8: @ 80BA0A8 - push {r4,lr} - ldr r4, =0x02039b28 - ldrb r0, [r4, 0x15] - cmp r0, 0 - beq _080BA122 - cmp r0, 0x3 - bne _080BA0EC - movs r0, 0 - strb r0, [r4, 0x15] - ldr r1, =0x040000b0 - ldrh r2, [r1, 0xA] - ldr r0, =0x0000c5ff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r2, [r1, 0xA] - ldr r0, =0x00007fff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r0, [r1, 0xA] - ldr r1, =0x02039b44 - movs r0, 0x1 - strb r0, [r1] - b _080BA122 - .pool -_080BA0EC: - ldr r1, =0x040000b0 - ldrh r2, [r1, 0xA] - ldr r0, =0x0000c5ff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r2, [r1, 0xA] - ldr r0, =0x00007fff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r0, [r1, 0xA] - ldrb r0, [r4, 0x14] - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - str r0, [r1] - ldr r0, [r4, 0x8] - str r0, [r1, 0x4] - ldr r0, [r4, 0xC] - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - ldr r0, [r4, 0x10] - bl _call_via_r0 - ldrb r0, [r4, 0x14] - movs r1, 0x1 - eors r0, r1 - strb r0, [r4, 0x14] -_080BA122: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BA0A8 - - thumb_func_start sub_80BA134 -sub_80BA134: @ 80BA134 - ldr r0, =0x02039b28 - ldr r2, [r0, 0x8] - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - ldr r1, =0x02038c28 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] - bx lr - .pool - thumb_func_end sub_80BA134 - - thumb_func_start sub_80BA154 -sub_80BA154: @ 80BA154 - ldr r0, =0x02039b28 - ldr r2, [r0, 0x8] - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - ldr r1, =0x02038c28 - adds r0, r1 - ldr r0, [r0] - str r0, [r2] - bx lr - .pool - thumb_func_end sub_80BA154 - - thumb_func_start task00_for_dp12 -task00_for_dp12: @ 80BA174 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r12, r0 - movs r6, 0 - ldr r0, =0x02039b44 - ldrb r0, [r0] - cmp r0, 0 - beq _080BA1A4 - mov r0, r12 - bl DestroyTask - ldr r1, =0x02039b28 - movs r0, 0xFF - strb r0, [r1, 0x18] - b _080BA324 - .pool -_080BA1A4: - ldr r1, =0x03005e00 - mov r0, r12 - lsls r2, r0, 2 - adds r0, r2, r0 - lsls r0, 3 - adds r3, r0, r1 - movs r4, 0x16 - ldrsh r0, [r3, r4] - mov r10, r1 - mov r9, r2 - cmp r0, 0 - beq _080BA250 - movs r1, 0x14 - ldrsh r0, [r3, r1] - cmp r0, 0xE - bhi _080BA250 - lsls r0, 2 - ldr r1, =_080BA1D8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080BA1D8: - .4byte _080BA214 - .4byte _080BA250 - .4byte _080BA21C - .4byte _080BA250 - .4byte _080BA224 - .4byte _080BA250 - .4byte _080BA22C - .4byte _080BA250 - .4byte _080BA234 - .4byte _080BA250 - .4byte _080BA23C - .4byte _080BA250 - .4byte _080BA244 - .4byte _080BA250 - .4byte _080BA24C -_080BA214: - ldr r0, =0x02022e14 - b _080BA24E - .pool -_080BA21C: - ldr r0, =0x02022e16 - b _080BA24E - .pool -_080BA224: - ldr r0, =0x02022e18 - b _080BA24E - .pool -_080BA22C: - ldr r0, =0x02022e1a - b _080BA24E - .pool -_080BA234: - ldr r0, =0x02022e1c - b _080BA24E - .pool -_080BA23C: - ldr r0, =0x02022e1e - b _080BA24E - .pool -_080BA244: - ldr r0, =0x02022e20 - b _080BA24E - .pool -_080BA24C: - ldr r0, =0x02022e22 -_080BA24E: - ldrh r6, [r0] -_080BA250: - mov r0, r9 - add r0, r12 - lsls r0, 3 - mov r2, r10 - adds r1, r0, r2 - ldrh r2, [r1, 0x10] - movs r3, 0x10 - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _080BA2BC - subs r0, r2, 0x1 - strh r0, [r1, 0x10] - movs r4, 0xE - ldrsh r0, [r1, r4] - movs r3, 0xA0 - lsls r3, 1 - adds r2, r0, r3 - movs r4, 0x8 - ldrsh r3, [r1, r4] - movs r4, 0xA - ldrsh r0, [r1, r4] - cmp r3, r0 - bge _080BA324 - ldr r5, =0x02038c28 - ldr r0, =0x02039b28 - mov r8, r0 - adds r7, r1, 0 - lsls r0, r2, 1 - adds r4, r0, r5 -_080BA28A: - lsls r2, r3, 1 - mov r0, r8 - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r2, r0 - adds r2, r5 - ldrh r0, [r4] - adds r0, r6 - strh r0, [r2] - adds r4, 0x2 - adds r3, 0x1 - movs r1, 0xA - ldrsh r0, [r7, r1] - cmp r3, r0 - blt _080BA28A - b _080BA324 - .pool -_080BA2BC: - ldrh r0, [r1, 0x12] - strh r0, [r1, 0x10] - movs r2, 0xE - ldrsh r0, [r1, r2] - movs r3, 0xA0 - lsls r3, 1 - adds r2, r0, r3 - movs r4, 0x8 - ldrsh r3, [r1, r4] - movs r4, 0xA - ldrsh r0, [r1, r4] - cmp r3, r0 - bge _080BA304 - ldr r5, =0x02038c28 - adds r7, r1, 0 - lsls r0, r2, 1 - adds r4, r0, r5 - ldr r0, =0x02039b28 - mov r8, r0 -_080BA2E2: - lsls r2, r3, 1 - mov r0, r8 - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r2, r0 - adds r2, r5 - ldrh r0, [r4] - adds r0, r6 - strh r0, [r2] - adds r4, 0x2 - adds r3, 0x1 - movs r1, 0xA - ldrsh r0, [r7, r1] - cmp r3, r0 - blt _080BA2E2 -_080BA304: - mov r0, r9 - add r0, r12 - lsls r0, 3 - mov r3, r10 - adds r2, r0, r3 - ldrh r0, [r2, 0xE] - adds r0, 0x1 - strh r0, [r2, 0xE] - lsls r0, 16 - asrs r0, 16 - movs r4, 0xC - ldrsh r1, [r2, r4] - cmp r0, r1 - bne _080BA324 - movs r0, 0 - strh r0, [r2, 0xE] -_080BA324: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end task00_for_dp12 - - thumb_func_start sub_80BA33C -sub_80BA33C: @ 80BA33C - push {r4-r7,lr} - adds r6, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r4, r2, 24 - movs r1, 0 - movs r2, 0 - ldr r0, =gUnknown_08329F40 - mov r12, r0 -_080BA350: - lsls r0, r1, 1 - adds r3, r0, r6 - lsls r0, r2, 1 - add r0, r12 - movs r7, 0 - ldrsh r0, [r0, r7] - muls r0, r4 - cmp r0, 0 - bge _080BA364 - adds r0, 0xFF -_080BA364: - asrs r0, 8 - strh r0, [r3] - adds r0, r2, r5 - lsls r0, 24 - lsrs r2, r0, 24 - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0xFF - bls _080BA350 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BA33C - - thumb_func_start sub_80BA384 -sub_80BA384: @ 80BA384 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - adds r5, r0, 0 - str r1, [sp, 0x10] - ldr r0, [sp, 0x40] - mov r8, r0 - ldr r1, [sp, 0x44] - mov r9, r1 - ldr r0, [sp, 0x48] - mov r10, r0 - lsls r5, 24 - lsrs r5, 24 - ldr r1, [sp, 0x10] - lsls r1, 24 - str r1, [sp, 0x14] - lsrs r0, r1, 24 - str r0, [sp, 0xC] - lsls r1, r2, 24 - lsrs r1, 24 - str r1, [sp, 0x18] - lsls r2, r3, 24 - lsrs r2, 24 - str r2, [sp, 0x1C] - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - mov r3, r9 - lsls r3, 24 - lsrs r3, 24 - mov r9, r3 - mov r0, r10 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - bl dp12_8087EA4 - ldr r0, =0x04000010 - add r0, r9 - str r0, [sp] - ldr r0, =0xa2600001 - str r0, [sp, 0x4] - mov r1, sp - movs r0, 0x1 - strb r0, [r1, 0x8] - mov r0, sp - movs r1, 0 - strb r1, [r0, 0x9] - ldr r0, [sp] - ldr r1, [sp, 0x4] - ldr r2, [sp, 0x8] - bl sub_80BA038 - ldr r0, =task00_for_dp12 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x03005e00 - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r0 - strh r5, [r4, 0x8] - mov r3, sp - ldrh r3, [r3, 0xC] - strh r3, [r4, 0xA] - movs r0, 0x80 - lsls r0, 1 - ldr r1, [sp, 0x18] - bl __divsi3 - strh r0, [r4, 0xC] - movs r0, 0 - strh r0, [r4, 0xE] - mov r1, r8 - strh r1, [r4, 0x10] - strh r1, [r4, 0x12] - mov r3, r9 - strh r3, [r4, 0x14] - mov r0, r10 - strh r0, [r4, 0x16] - ldr r0, =0x02039b28 - strb r7, [r0, 0x18] - ldr r0, =0x02039b44 - movs r1, 0 - strb r1, [r0] - ldr r4, =0x02038ea8 - ldr r3, [sp, 0xC] - subs r6, r3, r5 - lsls r3, r6, 24 - lsrs r3, 24 - adds r0, r4, 0 - ldr r1, [sp, 0x18] - ldr r2, [sp, 0x1C] - bl sub_80BA33C - ldr r0, [sp, 0xC] - cmp r5, r0 - bge _080BA47E - ldr r1, =0xfffffd80 - adds r2, r4, r1 - lsls r1, r5, 1 - movs r3, 0xF0 - lsls r3, 3 - adds r0, r1, r3 - adds r3, r0, r2 - adds r1, r2 - adds r2, r4, 0 - adds r5, r6, 0 -_080BA46A: - ldrh r0, [r2] - strh r0, [r1] - ldrh r0, [r2] - strh r0, [r3] - adds r2, 0x2 - adds r3, 0x2 - adds r1, 0x2 - subs r5, 0x1 - cmp r5, 0 - bne _080BA46A -_080BA47E: - adds r0, r7, 0 - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80BA384 - - thumb_func_start sub_80BA4B0 -sub_80BA4B0: @ 80BA4B0 - push {lr} - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_80BA4B0 - - thumb_func_start sub_80BA4C8 -sub_80BA4C8: @ 80BA4C8 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_80BA4C8 - - thumb_func_start CB2_OptionsMenu -CB2_OptionsMenu: @ 80BA4DC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0xB - bhi _080BA538 - lsls r0, 2 - ldr r1, =_080BA508 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080BA508: - .4byte _080BA538 - .4byte _080BA54C - .4byte _080BA69C - .4byte _080BA6BC - .4byte _080BA6E0 - .4byte _080BA718 - .4byte _080BA728 - .4byte _080BA740 - .4byte _080BA748 - .4byte _080BA760 - .4byte _080BA774 - .4byte _080BA80C -_080BA538: - movs r0, 0 - bl SetVBlankCallback - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _080BA7F4 - .pool -_080BA54C: - movs r3, 0xC0 - lsls r3, 19 - movs r4, 0xC0 - lsls r4, 9 - add r1, sp, 0x8 - mov r8, r1 - add r2, sp, 0x4 - movs r6, 0 - ldr r1, =0x040000d4 - movs r5, 0x80 - lsls r5, 5 - ldr r7, =0x81000800 - movs r0, 0x81 - lsls r0, 24 - mov r12, r0 -_080BA56A: - strh r6, [r2] - add r0, sp, 0x4 - str r0, [r1] - str r3, [r1, 0x4] - str r7, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r3, r5 - subs r4, r5 - cmp r4, r5 - bhi _080BA56A - strh r6, [r2] - add r2, sp, 0x4 - str r2, [r1] - str r3, [r1, 0x4] - lsrs r0, r4, 1 - mov r2, r12 - orrs r0, r2 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r0, 0xE0 - lsls r0, 19 - movs r3, 0x80 - lsls r3, 3 - movs r4, 0 - str r4, [sp, 0x8] - ldr r2, =0x040000d4 - mov r1, r8 - str r1, [r2] - str r0, [r2, 0x4] - lsrs r0, r3, 2 - movs r1, 0x85 - lsls r1, 24 - orrs r0, r1 - str r0, [r2, 0x8] - ldr r0, [r2, 0x8] - movs r1, 0xA0 - lsls r1, 19 - add r0, sp, 0x4 - strh r4, [r0] - str r0, [r2] - str r1, [r2, 0x4] - lsrs r3, 1 - movs r0, 0x81 - lsls r0, 24 - orrs r3, r0 - str r3, [r2, 0x8] - ldr r0, [r2, 0x8] - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0855C698 - movs r0, 0 - movs r2, 0x2 - bl InitBgsFromTemplates - 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 - ldr r0, =gUnknown_0855C680 - bl InitWindows - bl DeactivateAllTextPrinters - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x1 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x23 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0xC1 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0x4 - bl SetGpuReg - movs r1, 0xC1 - lsls r1, 6 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - b _080BA7EC - .pool -_080BA69C: - bl sub_80A1A74 - bl remove_some_task - bl ResetTasks - bl ResetAllObjectData - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _080BA7F4 - .pool -_080BA6BC: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x14] - lsrs r0, 3 - bl sub_8098758 - ldr r1, [r0] - movs r2, 0x90 - lsls r2, 1 - movs r3, 0xD1 - lsls r3, 1 - movs r0, 0x1 - bl LoadBgTiles - b _080BA7EC - .pool -_080BA6E0: - ldr r0, =gUnknown_0855C6A0 - movs r1, 0 - movs r2, 0x2 - bl gpu_pal_apply - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x14] - lsrs r0, 3 - bl sub_8098758 - ldr r0, [r0, 0x4] - movs r1, 0x70 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _080BA7F4 - .pool -_080BA718: - ldr r0, =gUnknown_0855C604 - movs r1, 0x10 - movs r2, 0x20 - bl gpu_pal_apply - b _080BA7EC - .pool -_080BA728: - movs r0, 0 - bl PutWindowTilemap - bl sub_80BB0D0 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _080BA7F4 - .pool -_080BA740: - movs r0, 0x87 - lsls r0, 3 - adds r1, r2, r0 - b _080BA7F4 -_080BA748: - movs r0, 0x1 - bl PutWindowTilemap - bl sub_80BB104 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080BA760: - bl sub_80BB154 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _080BA7F4 - .pool -_080BA774: - ldr r0, =sub_80BA83C - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - movs r0, 0 - strh r0, [r4, 0x8] - ldr r0, =0x03005d90 - ldr r2, [r0] - ldrb r0, [r2, 0x14] - lsls r0, 29 - lsrs r0, 29 - strh r0, [r4, 0xA] - ldrb r1, [r2, 0x15] - lsls r1, 29 - lsrs r1, 31 - strh r1, [r4, 0xC] - ldrb r1, [r2, 0x15] - lsls r1, 30 - lsrs r1, 31 - strh r1, [r4, 0xE] - ldrb r1, [r2, 0x15] - lsls r1, 31 - lsrs r1, 31 - strh r1, [r4, 0x10] - ldrb r1, [r2, 0x13] - strh r1, [r4, 0x12] - ldrb r1, [r2, 0x14] - lsrs r1, 3 - strh r1, [r4, 0x14] - bl sub_80BAC38 - ldrb r0, [r4, 0xC] - bl sub_80BAD08 - ldrb r0, [r4, 0xE] - bl sub_80BAD84 - ldrb r0, [r4, 0x10] - bl sub_80BAE08 - ldrb r0, [r4, 0x12] - bl sub_80BB028 - ldrb r0, [r4, 0x14] - bl sub_80BAF0C - ldrb r0, [r4, 0x8] - bl sub_80BAB38 - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram -_080BA7EC: - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_080BA7F4: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080BA828 - .pool -_080BA80C: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =sub_80BA4C8 - bl SetVBlankCallback - ldr r0, =sub_80BA4B0 - bl SetMainCallback2 -_080BA828: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end CB2_OptionsMenu - - thumb_func_start sub_80BA83C -sub_80BA83C: @ 80BA83C - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080BA85C - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80BA86C - str r0, [r1] -_080BA85C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BA83C - - thumb_func_start sub_80BA86C -sub_80BA86C: @ 80BA86C - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080BA89C - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0x6 - beq _080BA892 - b _080BAA5A -_080BA892: - b _080BA8AE - .pool -_080BA89C: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080BA8BC - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 -_080BA8AE: - ldr r0, =sub_80BAA64 - str r0, [r1] - b _080BAA5A - .pool -_080BA8BC: - movs r0, 0x40 - ands r0, r1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0 - beq _080BA8EC - ldr r1, =0x03005e00 - lsls r2, r4, 2 - adds r0, r2, r4 - lsls r0, 3 - adds r3, r0, r1 - ldrh r5, [r3, 0x8] - movs r6, 0x8 - ldrsh r0, [r3, r6] - adds r7, r1, 0 - cmp r0, 0 - ble _080BA8E8 - subs r0, r5, 0x1 - b _080BA90C - .pool -_080BA8E8: - movs r0, 0x6 - b _080BA90C -_080BA8EC: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080BA924 - ldr r1, =0x03005e00 - lsls r2, r4, 2 - adds r0, r2, r4 - lsls r0, 3 - adds r3, r0, r1 - ldrh r5, [r3, 0x8] - movs r7, 0x8 - ldrsh r0, [r3, r7] - adds r7, r1, 0 - cmp r0, 0x5 - bgt _080BA914 - adds r0, r5, 0x1 -_080BA90C: - strh r0, [r3, 0x8] - b _080BA916 - .pool -_080BA914: - strh r6, [r3, 0x8] -_080BA916: - adds r0, r2, r4 - lsls r0, 3 - adds r0, r7 - ldrb r0, [r0, 0x8] - bl sub_80BAB38 - b _080BAA5A -_080BA924: - ldr r0, =0x03005e00 - lsls r2, r4, 2 - adds r1, r2, r4 - lsls r1, 3 - adds r1, r0 - movs r3, 0x8 - ldrsh r1, [r1, r3] - adds r7, r0, 0 - cmp r1, 0x5 - bls _080BA93A - b _080BAA5A -_080BA93A: - lsls r0, r1, 2 - ldr r1, =_080BA94C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080BA94C: - .4byte _080BA964 - .4byte _080BA98A - .4byte _080BA9B0 - .4byte _080BA9D6 - .4byte _080BA9FC - .4byte _080BAA22 -_080BA964: - adds r4, r2, r4 - lsls r4, 3 - adds r4, r7 - ldrb r5, [r4, 0xA] - adds r0, r5, 0 - bl sub_80BABDC - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - strh r0, [r4, 0xA] - movs r6, 0xA - ldrsh r0, [r4, r6] - cmp r5, r0 - beq _080BAA46 - adds r0, r1, 0 - bl sub_80BAC38 - b _080BAA46 -_080BA98A: - adds r4, r2, r4 - lsls r4, 3 - adds r4, r7 - ldrb r5, [r4, 0xC] - adds r0, r5, 0 - bl sub_80BACE0 - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - strh r0, [r4, 0xC] - movs r7, 0xC - ldrsh r0, [r4, r7] - cmp r5, r0 - beq _080BAA46 - adds r0, r1, 0 - bl sub_80BAD08 - b _080BAA46 -_080BA9B0: - adds r4, r2, r4 - lsls r4, 3 - adds r4, r7 - ldrb r5, [r4, 0xE] - adds r0, r5, 0 - bl sub_80BAD5C - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - strh r0, [r4, 0xE] - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r5, r0 - beq _080BAA46 - adds r0, r1, 0 - bl sub_80BAD84 - b _080BAA46 -_080BA9D6: - adds r4, r2, r4 - lsls r4, 3 - adds r4, r7 - ldrb r5, [r4, 0x10] - adds r0, r5, 0 - bl sub_80BADD8 - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - strh r0, [r4, 0x10] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r5, r0 - beq _080BAA46 - adds r0, r1, 0 - bl sub_80BAE08 - b _080BAA46 -_080BA9FC: - adds r4, r2, r4 - lsls r4, 3 - adds r4, r7 - ldrb r5, [r4, 0x12] - adds r0, r5, 0 - bl sub_80BAFCC - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - strh r0, [r4, 0x12] - movs r6, 0x12 - ldrsh r0, [r4, r6] - cmp r5, r0 - beq _080BAA46 - adds r0, r1, 0 - bl sub_80BB028 - b _080BAA46 -_080BAA22: - adds r4, r2, r4 - lsls r4, 3 - adds r4, r7 - ldrb r5, [r4, 0x14] - adds r0, r5, 0 - bl sub_80BAE5C - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - strh r0, [r4, 0x14] - movs r7, 0x14 - ldrsh r0, [r4, r7] - cmp r5, r0 - beq _080BAA46 - adds r0, r1, 0 - bl sub_80BAF0C -_080BAA46: - ldr r1, =0x02039b48 - ldrb r0, [r1] - cmp r0, 0 - beq _080BAA5A - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram -_080BAA5A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BA86C - - thumb_func_start sub_80BAA64 -sub_80BAA64: @ 80BAA64 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r6, =0x03005d90 - ldr r3, [r6] - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - movs r0, 0x7 - ldrb r1, [r4, 0xA] - ands r1, r0 - ldrb r2, [r3, 0x14] - movs r0, 0x8 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x14] - ldr r3, [r6] - movs r5, 0x1 - ldrb r1, [r4, 0xC] - ands r1, r5 - lsls r1, 2 - ldrb r2, [r3, 0x15] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x15] - ldr r3, [r6] - ldrb r1, [r4, 0xE] - ands r1, r5 - lsls r1, 1 - ldrb r2, [r3, 0x15] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x15] - ldr r3, [r6] - ldrb r1, [r4, 0x10] - ands r1, r5 - ldrb r2, [r3, 0x15] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x15] - ldr r1, [r6] - ldrh r0, [r4, 0x12] - movs r5, 0 - strb r0, [r1, 0x13] - ldr r3, [r6] - ldrb r1, [r4, 0x14] - lsls r1, 3 - ldrb r2, [r3, 0x14] - movs r0, 0x7 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x14] - movs r0, 0x1 - negs r0, r0 - str r5, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =sub_80BAB08 - str r0, [r4] - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BAA64 - - thumb_func_start sub_80BAB08 -sub_80BAB08: @ 80BAB08 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080BAB2C - adds r0, r2, 0 - bl DestroyTask - bl FreeAllWindowBuffers - ldr r0, =0x030022c0 - ldr r0, [r0, 0x8] - bl SetMainCallback2 -_080BAB2C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BAB08 - - thumb_func_start sub_80BAB38 -sub_80BAB38: @ 80BAB38 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r1, 0x87 - lsls r1, 5 - movs r0, 0x40 - bl SetGpuReg - lsls r4, 4 - adds r1, r4, 0 - adds r1, 0x28 - lsls r1, 8 - adds r4, 0x38 - orrs r1, r4 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80BAB38 - - thumb_func_start sub_80BAB68 -sub_80BAB68: @ 80BAB68 - push {r4-r6,lr} - sub sp, 0x1C - adds r4, r0, 0 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r5, r2, 24 - lsls r3, 24 - lsrs r3, 24 - movs r2, 0 - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - beq _080BABA0 -_080BAB84: - mov r0, sp - adds r0, r2 - adds r0, 0xC - strb r1, [r0] - adds r4, 0x1 - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - beq _080BABA0 - cmp r2, 0xE - bls _080BAB84 -_080BABA0: - cmp r3, 0 - beq _080BABAE - add r1, sp, 0xC - movs r0, 0x4 - strb r0, [r1, 0x2] - movs r0, 0x5 - strb r0, [r1, 0x5] -_080BABAE: - mov r1, sp - adds r1, r2 - adds r1, 0xC - movs r0, 0xFF - strb r0, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - add r2, sp, 0xC - adds r3, r6, 0 - bl Print - add sp, 0x1C - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80BAB68 - - thumb_func_start sub_80BABDC -sub_80BABDC: @ 80BABDC - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080BAC08 - cmp r3, 0x1 - bhi _080BAC00 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - b _080BAC02 - .pool -_080BAC00: - movs r3, 0 -_080BAC02: - ldr r1, =0x02039b48 - movs r0, 0x1 - strb r0, [r1] -_080BAC08: - ldrh r1, [r2, 0x2E] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080BAC2C - cmp r3, 0 - beq _080BAC24 - subs r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - b _080BAC26 - .pool -_080BAC24: - movs r3, 0x2 -_080BAC26: - ldr r1, =0x02039b48 - movs r0, 0x1 - strb r0, [r1] -_080BAC2C: - adds r0, r3, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80BABDC - - thumb_func_start sub_80BAC38 -sub_80BAC38: @ 80BAC38 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - movs r2, 0 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - adds r1, r0 - movs r0, 0x1 - strb r0, [r1] - ldr r4, =gUnknown_085EE5D4 - mov r0, sp - ldrb r3, [r0] - adds r0, r4, 0 - movs r1, 0x68 - bl sub_80BAB68 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0 - bl GetStringWidth - adds r4, r0, 0 - ldr r0, =gUnknown_085EE5DF - mov r8, r0 - movs r0, 0x1 - mov r1, r8 - movs r2, 0 - bl GetStringWidth - adds r5, r0, 0 - ldr r6, =gUnknown_085EE5E9 - movs r0, 0x1 - adds r1, r6, 0 - movs r2, 0 - bl GetStringWidth - subs r5, 0x5E - subs r4, r5 - subs r4, r0 - lsrs r0, r4, 31 - adds r4, r0 - asrs r4, 1 - adds r4, 0x68 - lsls r4, 24 - lsrs r4, 24 - mov r0, sp - ldrb r3, [r0, 0x1] - mov r0, r8 - adds r1, r4, 0 - movs r2, 0 - bl sub_80BAB68 - movs r0, 0x1 - adds r1, r6, 0 - movs r2, 0xC6 - bl GetStringRightAlignXOffset - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, sp - ldrb r3, [r0, 0x2] - adds r0, r6, 0 - movs r2, 0 - bl sub_80BAB68 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BAC38 - - thumb_func_start sub_80BACE0 -sub_80BACE0: @ 80BACE0 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x30 - ands r0, r1 - cmp r0, 0 - beq _080BACFA - movs r1, 0x1 - eors r2, r1 - ldr r0, =0x02039b48 - strb r1, [r0] -_080BACFA: - adds r0, r2, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80BACE0 - - thumb_func_start sub_80BAD08 -sub_80BAD08: @ 80BAD08 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - movs r2, 0 - strb r2, [r1] - strb r2, [r1, 0x1] - adds r1, r0 - movs r0, 0x1 - strb r0, [r1] - ldr r0, =gUnknown_085EE5F4 - mov r1, sp - ldrb r3, [r1] - movs r1, 0x68 - movs r2, 0x10 - bl sub_80BAB68 - ldr r4, =gUnknown_085EE5FD - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xC6 - bl GetStringRightAlignXOffset - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, sp - ldrb r3, [r0, 0x1] - adds r0, r4, 0 - movs r2, 0x10 - bl sub_80BAB68 - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BAD08 - - thumb_func_start sub_80BAD5C -sub_80BAD5C: @ 80BAD5C - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x30 - ands r0, r1 - cmp r0, 0 - beq _080BAD76 - movs r1, 0x1 - eors r2, r1 - ldr r0, =0x02039b48 - strb r1, [r0] -_080BAD76: - adds r0, r2, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80BAD5C - - thumb_func_start sub_80BAD84 -sub_80BAD84: @ 80BAD84 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - movs r2, 0 - strb r2, [r1] - strb r2, [r1, 0x1] - adds r1, r0 - movs r0, 0x1 - strb r0, [r1] - ldr r0, =gUnknown_085EE607 - mov r1, sp - ldrb r3, [r1] - movs r1, 0x68 - movs r2, 0x20 - bl sub_80BAB68 - ldr r4, =gUnknown_085EE613 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xC6 - bl GetStringRightAlignXOffset - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, sp - ldrb r3, [r0, 0x1] - adds r0, r4, 0 - movs r2, 0x20 - bl sub_80BAB68 - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BAD84 - - thumb_func_start sub_80BADD8 -sub_80BADD8: @ 80BADD8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x30 - ands r0, r1 - cmp r0, 0 - beq _080BADF8 - movs r4, 0x1 - eors r5, r4 - adds r0, r5, 0 - bl sub_82E1810 - ldr r0, =0x02039b48 - strb r4, [r0] -_080BADF8: - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80BADD8 - - thumb_func_start sub_80BAE08 -sub_80BAE08: @ 80BAE08 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - movs r2, 0 - strb r2, [r1] - strb r2, [r1, 0x1] - adds r1, r0 - movs r0, 0x1 - strb r0, [r1] - ldr r0, =gUnknown_085EE61D - mov r1, sp - ldrb r3, [r1] - movs r1, 0x68 - movs r2, 0x30 - bl sub_80BAB68 - ldr r4, =gUnknown_085EE628 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xC6 - bl GetStringRightAlignXOffset - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, sp - ldrb r3, [r0, 0x1] - adds r0, r4, 0 - movs r2, 0x30 - bl sub_80BAB68 - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BAE08 - - thumb_func_start sub_80BAE5C -sub_80BAE5C: @ 80BAE5C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080BAEAE - cmp r4, 0x12 - bhi _080BAE80 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - b _080BAE82 - .pool -_080BAE80: - movs r4, 0 -_080BAE82: - adds r0, r4, 0 - bl sub_8098758 - ldr r1, [r0] - movs r2, 0x90 - lsls r2, 1 - movs r3, 0xD1 - lsls r3, 1 - movs r0, 0x1 - bl LoadBgTiles - adds r0, r4, 0 - bl sub_8098758 - ldr r0, [r0, 0x4] - movs r1, 0x70 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =0x02039b48 - movs r0, 0x1 - strb r0, [r1] -_080BAEAE: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080BAEFE - cmp r4, 0 - beq _080BAED0 - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - b _080BAED2 - .pool -_080BAED0: - movs r4, 0x13 -_080BAED2: - adds r0, r4, 0 - bl sub_8098758 - ldr r1, [r0] - movs r2, 0x90 - lsls r2, 1 - movs r3, 0xD1 - lsls r3, 1 - movs r0, 0x1 - bl LoadBgTiles - adds r0, r4, 0 - bl sub_8098758 - ldr r0, [r0, 0x4] - movs r1, 0x70 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =0x02039b48 - movs r0, 0x1 - strb r0, [r1] -_080BAEFE: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80BAE5C - - thumb_func_start sub_80BAF0C -sub_80BAF0C: @ 80BAF0C - push {r4-r7,lr} - sub sp, 0x10 - lsls r0, 24 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r6, r0, 24 - movs r5, 0 - ldr r1, =gUnknown_085EE640 - ldrb r0, [r1] - ldr r7, =gUnknown_085EE635 - cmp r0, 0xFF - beq _080BAF44 - adds r2, r1, 0 -_080BAF28: - mov r0, sp - adds r1, r0, r5 - adds r0, r5, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r5, r2 - ldrb r0, [r0] - cmp r0, 0xFF - beq _080BAF44 - cmp r5, 0x5 - bls _080BAF28 -_080BAF44: - adds r0, r6, 0 - movs r1, 0xA - bl __udivsi3 - adds r2, r0, 0 - lsls r0, r2, 24 - cmp r0, 0 - beq _080BAF80 - mov r0, sp - adds r1, r0, r5 - adds r0, r2, 0 - adds r0, 0xA1 - strb r0, [r1] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - mov r1, sp - adds r4, r1, r5 - adds r0, r6, 0 - movs r1, 0xA - bl __umodsi3 - adds r0, 0xA1 - strb r0, [r4] - b _080BAF9E - .pool -_080BAF80: - mov r0, sp - adds r4, r0, r5 - adds r0, r6, 0 - movs r1, 0xA - bl __umodsi3 - adds r0, 0xA1 - strb r0, [r4] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - mov r0, sp - adds r1, r0, r5 - movs r0, 0x77 - strb r0, [r1] -_080BAF9E: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - mov r0, sp - adds r1, r0, r5 - movs r0, 0xFF - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x68 - movs r2, 0x50 - movs r3, 0 - bl sub_80BAB68 - mov r0, sp - movs r1, 0x80 - movs r2, 0x50 - movs r3, 0x1 - bl sub_80BAB68 - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80BAF0C - - thumb_func_start sub_80BAFCC -sub_80BAFCC: @ 80BAFCC - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080BAFF8 - cmp r3, 0x1 - bhi _080BAFF0 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - b _080BAFF2 - .pool -_080BAFF0: - movs r3, 0 -_080BAFF2: - ldr r1, =0x02039b48 - movs r0, 0x1 - strb r0, [r1] -_080BAFF8: - ldrh r1, [r2, 0x2E] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080BB01C - cmp r3, 0 - beq _080BB014 - subs r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - b _080BB016 - .pool -_080BB014: - movs r3, 0x2 -_080BB016: - ldr r1, =0x02039b48 - movs r0, 0x1 - strb r0, [r1] -_080BB01C: - adds r0, r3, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80BAFCC - - thumb_func_start sub_80BB028 -sub_80BB028: @ 80BB028 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - movs r2, 0 - strb r2, [r1] - strb r2, [r1, 0x1] - strb r2, [r1, 0x2] - adds r1, r0 - movs r0, 0x1 - strb r0, [r1] - ldr r4, =gUnknown_085EE647 - mov r0, sp - ldrb r3, [r0] - adds r0, r4, 0 - movs r1, 0x68 - movs r2, 0x40 - bl sub_80BAB68 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0 - bl GetStringWidth - adds r4, r0, 0 - ldr r0, =gUnknown_085EE654 - mov r8, r0 - movs r0, 0x1 - mov r1, r8 - movs r2, 0 - bl GetStringWidth - adds r5, r0, 0 - ldr r6, =gUnknown_085EE65D - movs r0, 0x1 - adds r1, r6, 0 - movs r2, 0 - bl GetStringWidth - subs r5, 0x5E - subs r4, r5 - subs r4, r0 - lsrs r0, r4, 31 - adds r4, r0 - asrs r4, 1 - adds r4, 0x68 - lsls r4, 24 - lsrs r4, 24 - mov r0, sp - ldrb r3, [r0, 0x1] - mov r0, r8 - adds r1, r4, 0 - movs r2, 0x40 - bl sub_80BAB68 - movs r0, 0x1 - adds r1, r6, 0 - movs r2, 0xC6 - bl GetStringRightAlignXOffset - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, sp - ldrb r3, [r0, 0x2] - adds r0, r6, 0 - movs r2, 0x40 - bl sub_80BAB68 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BB028 - - thumb_func_start sub_80BB0D0 -sub_80BB0D0: @ 80BB0D0 - push {lr} - sub sp, 0xC - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_085EE589 - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BB0D0 - - thumb_func_start sub_80BB104 -sub_80BB104: @ 80BB104 - push {r4,r5,lr} - sub sp, 0xC - movs r0, 0x1 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r4, 0 - ldr r5, =gUnknown_0855C664 -_080BB114: - lsls r0, r4, 2 - adds r0, r5 - 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] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x8 - bl Print - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bls _080BB114 - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BB104 - - thumb_func_start sub_80BB154 -sub_80BB154: @ 80BB154 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - movs r5, 0x7 - str r5, [sp, 0x8] - movs r0, 0x1 - movs r1, 0xD1 - lsls r1, 1 - movs r2, 0x1 - movs r3, 0 - bl FillBgTilemapBufferRect - movs r0, 0x1B - mov r8, r0 - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x1 - ldr r1, =0x000001a3 - movs r2, 0x2 - movs r3, 0 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x1 - movs r1, 0xD2 - lsls r1, 1 - movs r2, 0x1C - movs r3, 0 - bl FillBgTilemapBufferRect - str r4, [sp] - movs r6, 0x2 - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x1 - ldr r1, =0x000001a5 - movs r2, 0x1 - movs r3, 0x1 - bl FillBgTilemapBufferRect - str r4, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x1 - ldr r1, =0x000001a7 - movs r2, 0x1C - movs r3, 0x1 - bl FillBgTilemapBufferRect - movs r7, 0xD4 - lsls r7, 1 - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x1 - movs r3, 0x3 - bl FillBgTilemapBufferRect - ldr r0, =0x000001a9 - mov r10, r0 - mov r0, r8 - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x1 - mov r1, r10 - movs r2, 0x2 - movs r3, 0x3 - bl FillBgTilemapBufferRect - movs r0, 0xD5 - lsls r0, 1 - mov r9, r0 - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x1 - mov r1, r9 - movs r2, 0x1C - movs r3, 0x3 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x1 - movs r1, 0xD1 - lsls r1, 1 - movs r2, 0x1 - movs r3, 0x4 - bl FillBgTilemapBufferRect - movs r0, 0x1A - mov r8, r0 - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x1 - ldr r1, =0x000001a3 - movs r2, 0x2 - movs r3, 0x4 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x1 - movs r1, 0xD2 - lsls r1, 1 - movs r2, 0x1C - movs r3, 0x4 - bl FillBgTilemapBufferRect - str r4, [sp] - movs r6, 0x12 - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x1 - ldr r1, =0x000001a5 - movs r2, 0x1 - movs r3, 0x5 - bl FillBgTilemapBufferRect - str r4, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x1 - ldr r1, =0x000001a7 - movs r2, 0x1C - movs r3, 0x5 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x1 - movs r3, 0x13 - bl FillBgTilemapBufferRect - mov r0, r8 - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x1 - mov r1, r10 - movs r2, 0x2 - movs r3, 0x13 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x1 - mov r1, r9 - movs r2, 0x1C - movs r3, 0x13 - bl FillBgTilemapBufferRect - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - 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_80BB154 - - thumb_func_start sub_80BB2D0 -sub_80BB2D0: @ 80BB2D0 - push {r4-r6,lr} - ldr r0, =0x02039b50 - movs r2, 0 - strh r2, [r0] - ldr r1, =0x02039b52 - movs r0, 0x40 - strb r0, [r1] - ldr r0, =0x030060b0 - strb r2, [r0] - ldr r4, =0x03005d90 - ldr r0, [r4] - movs r1, 0 - strb r2, [r0, 0x19] - ldr r0, [r4] - strb r2, [r0, 0x18] - ldr r0, [r4] - strb r2, [r0, 0x1A] - ldr r0, [r4] - strb r2, [r0, 0x1B] - ldr r0, [r4] - str r1, [r0, 0x1C] - str r1, [r0, 0x20] - str r1, [r0, 0x24] - bl sub_809D3C0 - movs r1, 0 - movs r2, 0 - ldr r3, =0x03005d8c - ldr r6, =0x00000988 - ldr r5, =0x00003b24 -_080BB30C: - ldr r0, [r4] - adds r0, 0x28 - adds r0, r1 - strb r2, [r0] - ldr r0, [r4] - adds r0, 0x5C - adds r0, r1 - strb r2, [r0] - ldr r0, [r3] - adds r0, r6 - adds r0, r1 - strb r2, [r0] - ldr r0, [r3] - adds r0, r5 - adds r0, r1 - strb r2, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x33 - bls _080BB30C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BB2D0 - - thumb_func_start sub_80BB358 -sub_80BB358: @ 80BB358 - ldr r1, =0x02039b50 - movs r0, 0 - strh r0, [r1] - ldr r1, =0x02039b52 - movs r0, 0x40 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_80BB358 - - thumb_func_start sub_80BB370 -sub_80BB370: @ 80BB370 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_80BB370 - - thumb_func_start sub_80BB384 -sub_80BB384: @ 80BB384 - push {r4-r7,lr} - adds r4, r0, 0 - movs r3, 0 - ldr r0, =0x0000ffff - adds r7, r0, 0 - movs r1, 0x2 - negs r1, r1 - mov r12, r1 - movs r6, 0x3 - negs r6, r6 - ldr r5, =0x00000181 -_080BB39A: - lsls r1, r3, 2 - adds r1, r4, r1 - ldrh r0, [r1] - orrs r0, r7 - strh r0, [r1] - ldrb r2, [r1, 0x2] - mov r0, r12 - ands r0, r2 - ands r0, r6 - strb r0, [r1, 0x2] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r5 - bls _080BB39A - movs r2, 0xC1 - lsls r2, 3 - adds r0, r4, r2 - movs r2, 0 - strh r2, [r0] - ldr r0, =0x0000060a - adds r3, r4, r0 - ldrb r1, [r3] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - movs r1, 0x3 - negs r1, r1 - ands r0, r1 - strb r0, [r3] - ldr r1, =0x0000060c - adds r0, r4, r1 - strh r2, [r0] - ldr r3, =0x0000060e - adds r0, r4, r3 - strh r2, [r0] - adds r1, 0x4 - adds r0, r4, r1 - strh r2, [r0] - adds r3, 0x4 - adds r0, r4, r3 - strh r2, [r0] - adds r1, 0x4 - adds r0, r4, r1 - strh r2, [r0] - adds r3, 0x4 - adds r0, r4, r3 - strh r2, [r0] - adds r1, 0x4 - adds r0, r4, r1 - strh r2, [r0] - adds r3, 0x4 - adds r0, r4, r3 - strh r2, [r0] - adds r1, 0x4 - adds r0, r4, r1 - strh r2, [r0] - movs r3, 0 - ldr r0, =0x0000061e - adds r2, r4, r0 - ldr r1, =0x0000ffff - adds r5, r1, 0 -_080BB416: - lsls r0, r3, 1 - adds r0, r2, r0 - ldrh r1, [r0] - orrs r1, r5 - strh r1, [r0] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x3 - bls _080BB416 - movs r2, 0xC5 - lsls r2, 3 - adds r0, r4, r2 - movs r2, 0 - movs r1, 0 - strh r1, [r0] - ldr r3, =0x0000062a - adds r0, r4, r3 - strh r1, [r0] - adds r3, 0x2 - adds r0, r4, r3 - strb r2, [r0] - adds r3, 0x1 - adds r0, r4, r3 - strb r2, [r0] - adds r3, 0x1 - adds r0, r4, r3 - strb r2, [r0] - adds r3, 0x1 - adds r0, r4, r3 - strb r2, [r0] - movs r2, 0xC6 - lsls r2, 3 - adds r0, r4, r2 - strh r1, [r0] - adds r3, 0x3 - adds r0, r4, r3 - strh r1, [r0] - adds r2, 0x4 - adds r0, r4, r2 - strh r1, [r0] - adds r3, 0x4 - adds r0, r4, r3 - strh r1, [r0] - adds r2, 0x4 - adds r0, r4, r2 - strh r1, [r0] - movs r3, 0 - ldr r0, =0x0000063a - adds r1, r4, r0 - movs r2, 0 -_080BB47C: - lsls r0, r3, 1 - adds r0, r1, r0 - strh r2, [r0] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x3 - bls _080BB47C - ldr r1, =0x0000064a - adds r0, r4, r1 - movs r1, 0 - strb r1, [r0] - ldr r2, =0x0000064b - adds r0, r4, r2 - strb r1, [r0] - ldr r0, =0x0000064c - adds r3, r4, r0 - ldrb r2, [r3] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r3] - ldr r2, =0x0000064d - adds r0, r4, r2 - strb r1, [r0] - ldr r3, =0x0000064e - adds r0, r4, r3 - strb r1, [r0] - adds r2, 0x2 - adds r0, r4, r2 - strb r1, [r0] - adds r3, 0x2 - adds r0, r4, r3 - strh r1, [r0] - adds r2, 0x3 - adds r0, r4, r2 - strh r1, [r0] - movs r3, 0 - ldr r0, =0x00000654 - adds r1, r4, r0 - movs r2, 0 -_080BB4CE: - adds r0, r1, r3 - strb r2, [r0] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x7 - bls _080BB4CE - movs r3, 0 - ldr r2, =0x0000065c - adds r1, r4, r2 - movs r2, 0 -_080BB4E4: - adds r0, r1, r3 - strb r2, [r0] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x7 - bls _080BB4E4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BB384 - - thumb_func_start sub_80BB534 -sub_80BB534: @ 80BB534 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0x1 - beq _080BB5FC - cmp r0, 0x1 - ble _080BB558 - cmp r0, 0x2 - beq _080BB628 - cmp r0, 0x3 - bne _080BB558 - b _080BB71C -_080BB558: - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - bl sub_80C09B0 - movs r3, 0xC0 - lsls r3, 19 - movs r4, 0xC0 - lsls r4, 9 - add r2, sp, 0x4 - mov r8, r2 - mov r2, sp - movs r6, 0 - ldr r1, =0x040000d4 - movs r5, 0x80 - lsls r5, 5 - ldr r7, =0x81000800 - movs r0, 0x81 - lsls r0, 24 - mov r12, r0 -_080BB582: - strh r6, [r2] - mov r0, sp - str r0, [r1] - str r3, [r1, 0x4] - str r7, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r3, r5 - subs r4, r5 - cmp r4, r5 - bhi _080BB582 - strh r6, [r2] - mov r2, sp - str r2, [r1] - str r3, [r1, 0x4] - lsrs r0, r4, 1 - mov r3, r12 - orrs r0, r3 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r0, 0xE0 - lsls r0, 19 - movs r3, 0x80 - lsls r3, 3 - movs r4, 0 - str r4, [sp, 0x4] - ldr r2, =0x040000d4 - mov r1, r8 - str r1, [r2] - str r0, [r2, 0x4] - lsrs r0, r3, 2 - movs r1, 0x85 - lsls r1, 24 - orrs r0, r1 - str r0, [r2, 0x8] - ldr r0, [r2, 0x8] - movs r1, 0xA0 - lsls r1, 19 - mov r0, sp - strh r4, [r0] - str r0, [r2] - str r1, [r2, 0x4] - lsrs r3, 1 - movs r0, 0x81 - lsls r0, 24 - orrs r3, r0 - str r3, [r2, 0x8] - ldr r0, [r2, 0x8] - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0] - b _080BB74C - .pool -_080BB5FC: - bl remove_some_task - bl ResetTasks - bl ResetAllObjectData - bl sub_80A1A74 - bl ResetObjectPaletteAllocator - ldr r1, =0x0300301c - movs r0, 0x8 - strb r0, [r1] - bl dp13_810BB8C - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _080BB74C - .pool -_080BB628: - ldr r4, =0x02039b4c - ldr r0, =0x00000664 - bl AllocZeroed - str r0, [r4] - bl sub_80BB384 - ldr r0, =sub_80BB78C - movs r1, 0 - bl CreateTask - ldr r1, [r4] - ldr r5, =0x03005d90 - ldr r0, [r5] - ldrb r0, [r0, 0x19] - ldr r3, =0x00000612 - adds r1, r3 - strh r0, [r1] - bl sub_809D42C - adds r1, r0, 0 - cmp r1, 0 - bne _080BB65E - ldr r0, [r4] - ldr r2, =0x00000612 - adds r0, r2 - strh r1, [r0] -_080BB65E: - ldr r1, [r4] - ldr r0, [r5] - ldrb r2, [r0, 0x18] - ldr r3, =0x00000616 - adds r0, r1, r3 - strh r2, [r0] - ldr r0, =0x02039b50 - ldrh r2, [r0] - subs r3, 0x8 - adds r0, r1, r3 - strh r2, [r0] - ldr r0, =0x02039b52 - ldrb r0, [r0] - ldr r2, =0x0000062c - adds r1, r2 - strb r0, [r1] - ldr r0, [r4] - adds r3, 0x3F - adds r0, r3 - movs r1, 0 - strb r1, [r0] - bl sub_809D42C - cmp r0, 0 - bne _080BB6D0 - movs r0, 0 - bl sub_80C0844 - ldr r1, [r4] - ldr r2, =0x0000061a - adds r1, r2 - strh r0, [r1] - movs r0, 0x1 - bl sub_80C0844 - b _080BB6E4 - .pool -_080BB6D0: - movs r0, 0 - bl pokedex_count - ldr r1, [r4] - ldr r2, =0x0000061a - adds r1, r2 - strh r0, [r1] - movs r0, 0x1 - bl pokedex_count -_080BB6E4: - ldr r1, [r4] - ldr r3, =0x0000061c - adds r1, r3 - strh r0, [r1] - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000062d - adds r0, r1 - movs r1, 0x8 - strb r1, [r0] - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080BB74C - .pool -_080BB71C: - movs r0, 0x1 - bl EnableInterrupts - ldr r0, =sub_80BB370 - bl SetVBlankCallback - ldr r0, =sub_80BB774 - bl SetMainCallback2 - ldr r0, =0x02039b4c - ldr r1, [r0] - ldr r3, =0x00000612 - adds r0, r1, r3 - ldrb r0, [r0] - ldr r2, =0x00000616 - adds r1, r2 - ldrb r1, [r1] - bl sub_80BC8D4 - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - bl MPlayVolumeControl -_080BB74C: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BB534 - - thumb_func_start sub_80BB774 -sub_80BB774: @ 80BB774 - push {lr} - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_80BB774 - - thumb_func_start sub_80BB78C -sub_80BB78C: @ 80BB78C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02039b4c - ldr r1, [r0] - ldr r0, =0x0000064c - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - movs r0, 0 - bl sub_80BC514 - lsls r0, 24 - cmp r0, 0 - beq _080BB7BE - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80BB7D4 - str r0, [r1] -_080BB7BE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BB78C - - thumb_func_start sub_80BB7D4 -sub_80BB7D4: @ 80BB7D4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r7, =0x02039b4c - ldr r0, [r7] - ldr r4, =0x00000652 - adds r0, r4 - ldrh r1, [r0] - movs r0, 0x12 - bl SetGpuReg - ldr r3, [r7] - adds r1, r3, r4 - ldrh r0, [r1] - movs r4, 0 - ldrsh r2, [r1, r4] - mov r8, r2 - cmp r2, 0 - beq _080BB810 - subs r0, 0x8 - strh r0, [r1] - b _080BBA06 - .pool -_080BB810: - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - mov r9, r0 - ands r0, r1 - cmp r0, 0 - beq _080BB8A4 - ldr r1, =0x0000060e - adds r0, r3, r1 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r3, r0 - ldrb r0, [r0, 0x2] - lsls r0, 31 - cmp r0, 0 - beq _080BB8A4 - bl sub_80BD8D0 - ldr r4, =0x02020630 - ldr r0, [r7] - ldr r5, =0x00000626 - adds r0, r5 - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x5] - lsrs r1, 4 - adds r1, 0x10 - mov r0, r9 - lsls r0, r1 - mvns r0, r0 - mov r2, r8 - str r2, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, [r7] - adds r0, r5 - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, 0x1C - adds r0, r4 - ldr r1, =sub_80BE470 - str r1, [r0] - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80BBBF4 - str r1, [r0] - movs r0, 0x15 - b _080BB976 - .pool -_080BB8A4: - ldrh r2, [r2, 0x2E] - movs r0, 0x8 - ands r0, r2 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _080BB8FC - ldr r3, =0x02039b4c - ldr r1, [r3] - ldr r4, =0x00000652 - adds r0, r1, r4 - movs r2, 0 - strh r2, [r0] - ldr r0, =0x0000064f - adds r1, r0 - movs r0, 0x1 - strb r0, [r1] - ldr r0, [r3] - movs r1, 0xCA - lsls r1, 3 - adds r0, r1 - strh r2, [r0] - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80BBA78 - str r1, [r0] - movs r0, 0x5 - bl audio_play - b _080BBA06 - .pool -_080BB8FC: - movs r0, 0x4 - ands r0, r2 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _080BB9A0 - movs r0, 0x5 - bl audio_play - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - bl sub_80C1258 - ldr r1, =0x03005e00 - lsls r3, r6, 2 - adds r3, r6 - lsls r3, 3 - adds r3, r1 - lsls r0, 24 - lsrs r0, 24 - movs r2, 0 - strh r0, [r3, 0x8] - ldr r1, =0x02039b4c - ldr r0, [r1] - ldr r4, =0x0000064e - adds r0, r4 - strb r2, [r0] - ldr r0, [r1] - ldr r2, =0x0000062c - adds r1, r0, r2 - ldrb r2, [r1] - subs r4, 0x24 - adds r1, r0, r4 - strh r2, [r1] - ldr r2, =0x0000060e - adds r1, r0, r2 - ldrh r2, [r1] - subs r4, 0x1A - adds r1, r0, r4 - strh r2, [r1] - ldr r2, =0x00000612 - adds r1, r0, r2 - ldrh r2, [r1] - adds r4, 0x4 - adds r1, r0, r4 - strh r2, [r1] - ldr r2, =0x00000616 - adds r1, r0, r2 - ldrh r1, [r1] - adds r4, 0x4 - adds r0, r4 - strh r1, [r0] - ldr r0, =sub_80BBD1C - str r0, [r3] - movs r0, 0x2 -_080BB976: - bl audio_play - bl sub_80BC890 - b _080BBA06 - .pool -_080BB9A0: - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - beq _080BB9D8 - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80BBDE8 - str r1, [r0] - movs r0, 0x3 - bl audio_play - b _080BBA06 - .pool -_080BB9D8: - ldr r5, =0x02039b4c - ldr r0, [r5] - ldr r4, =0x0000060e - adds r0, r4 - ldrh r0, [r0] - movs r1, 0xE - bl sub_80BD69C - ldr r1, [r5] - adds r4, r1, r4 - strh r0, [r4] - ldr r0, =0x0000062e - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _080BBA06 - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80BBA28 - str r0, [r1] -_080BBA06: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BB7D4 - - thumb_func_start sub_80BBA28 -sub_80BBA28: @ 80BBA28 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02039b4c - ldr r2, [r0] - ldr r1, =0x0000062f - adds r0, r2, r1 - ldrb r0, [r0] - ldr r3, =0x00000634 - adds r1, r2, r3 - ldrb r1, [r1] - adds r3, 0x2 - adds r2, r3 - ldrb r2, [r2] - bl sub_80BD404 - lsls r0, 24 - cmp r0, 0 - beq _080BBA5C - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80BB7D4 - str r0, [r1] -_080BBA5C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BBA28 - - thumb_func_start sub_80BBA78 -sub_80BBA78: @ 80BBA78 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r6, =0x02039b4c - ldr r0, [r6] - ldr r4, =0x00000652 - adds r0, r4 - ldrh r1, [r0] - movs r0, 0x12 - bl SetGpuReg - ldr r3, [r6] - adds r1, r3, r4 - ldrh r2, [r1] - movs r4, 0 - ldrsh r0, [r1, r4] - cmp r0, 0x50 - beq _080BBAB0 - adds r0, r2, 0 - adds r0, 0x8 - strh r0, [r1] - b _080BBBE8 - .pool -_080BBAB0: - ldr r5, =0x030022c0 - ldrh r1, [r5, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080BBB58 - movs r2, 0xCA - lsls r2, 3 - adds r0, r3, r2 - ldrh r0, [r0] - cmp r0, 0x1 - beq _080BBADC - cmp r0, 0x1 - ble _080BBB20 - cmp r0, 0x2 - beq _080BBAF4 - cmp r0, 0x3 - beq _080BBB34 - b _080BBB20 - .pool -_080BBADC: - ldr r4, =0x0000060e - adds r1, r3, r4 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0000062c - adds r1, r3, r0 - movs r0, 0x40 - b _080BBB0C - .pool -_080BBAF4: - ldr r1, =0x0000060c - adds r2, r3, r1 - ldrh r0, [r2] - subs r0, 0x1 - ldr r4, =0x0000060e - adds r1, r3, r4 - strh r0, [r1] - ldrh r0, [r2] - lsls r0, 4 - adds r0, 0x30 - ldr r2, =0x0000062c - adds r1, r3, r2 -_080BBB0C: - strb r0, [r1] - bl sub_80BDA40 - ldr r0, [r6] - adds r0, r4 - ldrh r0, [r0] - movs r1, 0xE - bl sub_80BD2B4 - ldrh r1, [r5, 0x2E] -_080BBB20: - movs r0, 0x8 - orrs r0, r1 - strh r0, [r5, 0x2E] - b _080BBB58 - .pool -_080BBB34: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80BBDE8 - str r1, [r0] - movs r0, 0x3 - bl audio_play -_080BBB58: - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2E] - movs r0, 0xA - ands r0, r1 - cmp r0, 0 - beq _080BBB98 - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r3, =0x0000064f - adds r0, r3 - movs r1, 0 - strb r1, [r0] - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80BB7D4 - str r1, [r0] - b _080BBBB6 - .pool -_080BBB98: - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080BBBC4 - ldr r0, =0x02039b4c - ldr r0, [r0] - movs r4, 0xCA - lsls r4, 3 - adds r1, r0, r4 - ldrh r0, [r1] - cmp r0, 0 - beq _080BBBC4 - subs r0, 0x1 - strh r0, [r1] -_080BBBB6: - movs r0, 0x5 - bl audio_play - b _080BBBE8 - .pool -_080BBBC4: - ldrh r1, [r2, 0x30] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080BBBE8 - ldr r0, =0x02039b4c - ldr r0, [r0] - movs r2, 0xCA - lsls r2, 3 - adds r1, r0, r2 - ldrh r0, [r1] - cmp r0, 0x2 - bhi _080BBBE8 - adds r0, 0x1 - strh r0, [r1] - movs r0, 0x5 - bl audio_play -_080BBBE8: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BBA78 - - thumb_func_start sub_80BBBF4 -sub_80BBBF4: @ 80BBBF4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r2, =0x02020630 - ldr r5, =0x02039b4c - ldr r3, [r5] - ldr r6, =0x00000626 - adds r0, r3, r6 - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - movs r2, 0x20 - ldrsh r0, [r1, r2] - cmp r0, 0x30 - bne _080BBC52 - movs r2, 0x22 - ldrsh r0, [r1, r2] - cmp r0, 0x38 - bne _080BBC52 - ldr r1, =0x0000064a - adds r0, r3, r1 - ldrb r1, [r0] - ldr r2, =0x0000064b - adds r0, r3, r2 - strb r1, [r0] - ldr r1, [r5] - subs r2, 0x3D - adds r0, r1, r2 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1, r0 - adds r1, r6 - ldrb r1, [r1] - bl sub_80BE91C - ldr r2, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r2 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x8] - ldr r0, =sub_80BBC74 - str r0, [r1] -_080BBC52: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BBBF4 - - thumb_func_start sub_80BBC74 -sub_80BBC74: @ 80BBC74 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x4] - cmp r0, 0 - beq _080BBCE0 - ldr r5, =0x02039b4c - ldr r0, [r5] - ldr r1, =0x0000064a - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080BBCFC - ldrb r0, [r4, 0x8] - bl sub_80BE9C4 - lsls r0, 24 - cmp r0, 0 - bne _080BBCFC - bl sub_80BD930 - lsls r0, 24 - cmp r0, 0 - beq _080BBCFC - ldr r0, [r5] - ldr r2, =0x0000060e - adds r1, r0, r2 - ldrh r1, [r1] - lsls r1, 2 - adds r0, r1 - ldrb r1, [r4, 0x8] - bl sub_80BE9F8 - b _080BBCFC - .pool -_080BBCE0: - ldr r2, =0x02039b50 - ldr r0, =0x02039b4c - ldr r1, [r0] - ldr r3, =0x0000060e - adds r0, r1, r3 - ldrh r0, [r0] - strh r0, [r2] - ldr r2, =0x02039b52 - ldr r0, =0x0000062c - adds r1, r0 - ldrb r0, [r1] - strb r0, [r2] - ldr r0, =sub_80BB78C - str r0, [r4] -_080BBCFC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BBC74 - - thumb_func_start sub_80BBD1C -sub_80BBD1C: @ 80BBD1C - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r6, r1, r2 - movs r0, 0x8 - ldrsh r1, [r6, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r4, [r0, 0x4] - cmp r4, 0 - bne _080BBDCA - bl sub_80BDA40 - ldr r5, =0x02039b4c - ldr r2, [r5] - ldr r1, =0x0000064e - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080BBD7C - ldr r3, =0x0000060e - adds r0, r2, r3 - strh r4, [r0] - ldr r0, =0x0000062c - adds r1, r2, r0 - movs r0, 0x40 - strb r0, [r1] - ldr r0, =sub_80BBE70 - b _080BBDC8 - .pool -_080BBD7C: - ldr r1, =0x0000062a - adds r0, r2, r1 - ldrh r1, [r0] - ldr r3, =0x0000062c - adds r0, r2, r3 - strb r1, [r0] - ldr r1, [r5] - movs r2, 0xC2 - lsls r2, 3 - adds r0, r1, r2 - ldrh r2, [r0] - subs r3, 0x1E - adds r0, r1, r3 - strh r2, [r0] - ldr r2, =0x00000614 - adds r0, r1, r2 - ldrh r0, [r0] - adds r3, 0x4 - adds r1, r3 - strh r0, [r1] - bl sub_809D42C - adds r1, r0, 0 - cmp r1, 0 - bne _080BBDB6 - ldr r0, [r5] - ldr r2, =0x00000612 - adds r0, r2 - strh r1, [r0] -_080BBDB6: - ldr r0, [r5] - movs r3, 0xC3 - lsls r3, 3 - adds r1, r0, r3 - ldrh r1, [r1] - ldr r2, =0x00000616 - adds r0, r2 - strh r1, [r0] - ldr r0, =sub_80BB78C -_080BBDC8: - str r0, [r6] -_080BBDCA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BBD1C - - thumb_func_start sub_80BBDE8 -sub_80BBDE8: @ 80BBDE8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080BBE4A - ldr r4, =0x03005d90 - ldr r0, [r4] - ldr r5, =0x02039b4c - ldr r1, [r5] - ldr r2, =0x00000612 - adds r1, r2 - ldrh r1, [r1] - strb r1, [r0, 0x19] - bl sub_809D42C - adds r1, r0, 0 - cmp r1, 0 - bne _080BBE18 - ldr r0, [r4] - strb r1, [r0, 0x19] -_080BBE18: - ldr r1, [r4] - ldr r0, [r5] - ldr r2, =0x00000616 - adds r0, r2 - ldrh r0, [r0] - strb r0, [r1, 0x18] - bl sub_80BDA40 - bl sub_80BC890 - adds r0, r6, 0 - bl DestroyTask - ldr r0, =sub_8086194 - bl SetMainCallback2 - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl - ldr r0, [r5] - bl Free -_080BBE4A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BBDE8 - - thumb_func_start sub_80BBE70 -sub_80BBE70: @ 80BBE70 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02039b4c - ldr r1, [r0] - ldr r0, =0x0000064c - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x1 - orrs r0, r2 - strb r0, [r1] - movs r0, 0x3 - bl sub_80BC514 - lsls r0, 24 - cmp r0, 0 - beq _080BBEA0 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80BBEB8 - str r0, [r1] -_080BBEA0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BBE70 - - thumb_func_start sub_80BBEB8 -sub_80BBEB8: @ 80BBEB8 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r5, =0x02039b4c - ldr r0, [r5] - ldr r4, =0x00000652 - adds r0, r4 - ldrh r1, [r0] - movs r0, 0x12 - bl SetGpuReg - ldr r3, [r5] - adds r1, r3, r4 - ldrh r0, [r1] - movs r2, 0 - ldrsh r4, [r1, r2] - cmp r4, 0 - beq _080BBEEC - subs r0, 0x8 - strh r0, [r1] - b _080BC08A - .pool -_080BBEEC: - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2E] - movs r7, 0x1 - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _080BBF70 - ldr r1, =0x0000060e - adds r0, r3, r1 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r3, r0 - ldrb r0, [r0, 0x2] - lsls r0, 31 - cmp r0, 0 - beq _080BBF70 - bl sub_80BD8D0 - ldr r3, =0x02020630 - ldr r0, [r5] - ldr r2, =0x00000626 - adds r0, r2 - ldrh r0, [r0] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r0, r2, r3 - ldrb r1, [r0, 0x5] - lsrs r1, 4 - adds r1, 0x10 - adds r0, r7, 0 - lsls r0, r1 - adds r3, 0x1C - adds r2, r3 - ldr r1, =sub_80BE470 - str r1, [r2] - mvns r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80BC2D4 - str r1, [r0] - movs r0, 0x15 - b _080BC00A - .pool -_080BBF70: - ldrh r2, [r2, 0x2E] - movs r0, 0x8 - ands r0, r2 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _080BBFC8 - ldr r3, =0x02039b4c - ldr r1, [r3] - ldr r2, =0x00000652 - adds r0, r1, r2 - movs r2, 0 - strh r2, [r0] - ldr r0, =0x0000064f - adds r1, r0 - movs r0, 0x1 - strb r0, [r1] - ldr r0, [r3] - movs r1, 0xCA - lsls r1, 3 - adds r0, r1 - strh r2, [r0] - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80BC0F8 - str r1, [r0] - movs r0, 0x5 - bl audio_play - b _080BC08A - .pool -_080BBFC8: - movs r0, 0x4 - ands r0, r2 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0 - beq _080BC024 - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - bl sub_80C1258 - ldr r2, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r2 - lsls r0, 24 - lsrs r0, 24 - movs r2, 0 - strh r0, [r1, 0x8] - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r3, =0x0000064e - adds r0, r3 - strb r2, [r0] - ldr r0, =sub_80BBD1C - str r0, [r1] - movs r0, 0x2 -_080BC00A: - bl audio_play - bl sub_80BC890 - b _080BC08A - .pool -_080BC024: - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - beq _080BC05C - movs r0, 0x1 - negs r0, r0 - str r3, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80BC3DC - str r1, [r0] - movs r0, 0x3 - bl audio_play - b _080BC08A - .pool -_080BC05C: - ldr r5, =0x02039b4c - ldr r0, [r5] - ldr r4, =0x0000060e - adds r0, r4 - ldrh r0, [r0] - movs r1, 0xE - bl sub_80BD69C - ldr r1, [r5] - adds r4, r1, r4 - strh r0, [r4] - ldr r0, =0x0000062e - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _080BC08A - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80BC0A8 - str r0, [r1] -_080BC08A: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BBEB8 - - thumb_func_start sub_80BC0A8 -sub_80BC0A8: @ 80BC0A8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02039b4c - ldr r2, [r0] - ldr r1, =0x0000062f - adds r0, r2, r1 - ldrb r0, [r0] - ldr r3, =0x00000634 - adds r1, r2, r3 - ldrb r1, [r1] - adds r3, 0x2 - adds r2, r3 - ldrb r2, [r2] - bl sub_80BD404 - lsls r0, 24 - cmp r0, 0 - beq _080BC0DC - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80BBEB8 - str r0, [r1] -_080BC0DC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BC0A8 - - thumb_func_start sub_80BC0F8 -sub_80BC0F8: @ 80BC0F8 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r5, =0x02039b4c - ldr r0, [r5] - ldr r4, =0x00000652 - adds r0, r4 - ldrh r1, [r0] - movs r0, 0x12 - bl SetGpuReg - ldr r5, [r5] - adds r1, r5, r4 - ldrh r2, [r1] - movs r3, 0 - ldrsh r0, [r1, r3] - cmp r0, 0x60 - beq _080BC130 - adds r0, r2, 0 - adds r0, 0x8 - strh r0, [r1] - b _080BC2C8 - .pool -_080BC130: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080BC13E - b _080BC238 -_080BC13E: - movs r1, 0xCA - lsls r1, 3 - adds r0, r5, r1 - ldrh r0, [r0] - cmp r0, 0x4 - bhi _080BC1C2 - lsls r0, 2 - ldr r1, =_080BC15C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080BC15C: - .4byte _080BC1C2 - .4byte _080BC170 - .4byte _080BC194 - .4byte _080BC1E4 - .4byte _080BC214 -_080BC170: - ldr r5, =0x02039b4c - ldr r1, [r5] - ldr r4, =0x0000060e - adds r2, r1, r4 - movs r0, 0 - strh r0, [r2] - ldr r2, =0x0000062c - adds r1, r2 - movs r0, 0x40 - strb r0, [r1] - b _080BC1B2 - .pool -_080BC194: - ldr r5, =0x02039b4c - ldr r2, [r5] - ldr r0, =0x0000060c - adds r3, r2, r0 - ldrh r0, [r3] - subs r0, 0x1 - ldr r4, =0x0000060e - adds r1, r2, r4 - strh r0, [r1] - ldrh r0, [r3] - lsls r0, 4 - adds r0, 0x30 - ldr r1, =0x0000062c - adds r2, r1 - strb r0, [r2] -_080BC1B2: - bl sub_80BDA40 - ldr r0, [r5] - adds r0, r4 - ldrh r0, [r0] - movs r1, 0xE - bl sub_80BD2B4 -_080BC1C2: - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2E] - movs r0, 0x8 - orrs r0, r1 - strh r0, [r2, 0x2E] - b _080BC238 - .pool -_080BC1E4: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80BC3DC - str r1, [r0] - movs r0, 0x34 - bl audio_play - b _080BC238 - .pool -_080BC214: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80BC47C - str r1, [r0] - movs r0, 0x3 - bl audio_play -_080BC238: - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2E] - movs r0, 0xA - ands r0, r1 - cmp r0, 0 - beq _080BC278 - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r2, =0x0000064f - adds r0, r2 - movs r1, 0 - strb r1, [r0] - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80BBEB8 - str r1, [r0] - b _080BC296 - .pool -_080BC278: - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080BC2A4 - ldr r0, =0x02039b4c - ldr r0, [r0] - movs r3, 0xCA - lsls r3, 3 - adds r1, r0, r3 - ldrh r0, [r1] - cmp r0, 0 - beq _080BC2A4 - subs r0, 0x1 - strh r0, [r1] -_080BC296: - movs r0, 0x5 - bl audio_play - b _080BC2C8 - .pool -_080BC2A4: - ldrh r1, [r2, 0x30] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080BC2C8 - ldr r0, =0x02039b4c - ldr r0, [r0] - movs r2, 0xCA - lsls r2, 3 - adds r1, r0, r2 - ldrh r0, [r1] - cmp r0, 0x3 - bhi _080BC2C8 - adds r0, 0x1 - strh r0, [r1] - movs r0, 0x5 - bl audio_play -_080BC2C8: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BC0F8 - - thumb_func_start sub_80BC2D4 -sub_80BC2D4: @ 80BC2D4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, =0x02020630 - ldr r5, =0x02039b4c - ldr r3, [r5] - ldr r4, =0x00000626 - adds r0, r3, r4 - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - movs r2, 0x20 - ldrsh r0, [r1, r2] - cmp r0, 0x30 - bne _080BC33A - movs r2, 0x22 - ldrsh r0, [r1, r2] - cmp r0, 0x38 - bne _080BC33A - ldr r1, =0x0000064a - adds r0, r3, r1 - ldrb r1, [r0] - ldr r2, =0x0000064b - adds r0, r3, r2 - strb r1, [r0] - ldr r1, [r5] - subs r2, 0x3D - adds r0, r1, r2 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1, r0 - adds r1, r4 - ldrb r1, [r1] - bl sub_80BE91C - ldr r2, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r2 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x8] - ldr r0, [r5] - adds r0, r4 - ldr r2, =0x0000ffff - strh r2, [r0] - ldr r0, =sub_80BC360 - str r0, [r1] -_080BC33A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BC2D4 - - thumb_func_start sub_80BC360 -sub_80BC360: @ 80BC360 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x4] - cmp r0, 0 - beq _080BC3CC - ldr r5, =0x02039b4c - ldr r0, [r5] - ldr r1, =0x0000064a - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080BC3D0 - ldrb r0, [r4, 0x8] - bl sub_80BE9C4 - lsls r0, 24 - cmp r0, 0 - bne _080BC3D0 - bl sub_80BD930 - lsls r0, 24 - cmp r0, 0 - beq _080BC3D0 - ldr r0, [r5] - ldr r2, =0x0000060e - adds r1, r0, r2 - ldrh r1, [r1] - lsls r1, 2 - adds r0, r1 - ldrb r1, [r4, 0x8] - bl sub_80BE9F8 - b _080BC3D0 - .pool -_080BC3CC: - ldr r0, =sub_80BBE70 - str r0, [r4] -_080BC3D0: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BC360 - - thumb_func_start sub_80BC3DC -sub_80BC3DC: @ 80BC3DC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080BC450 - ldr r4, =0x02039b4c - ldr r0, [r4] - ldr r2, =0x0000062a - adds r1, r0, r2 - ldrh r1, [r1] - ldr r3, =0x0000062c - adds r0, r3 - strb r1, [r0] - ldr r1, [r4] - subs r2, 0x1A - adds r0, r1, r2 - ldrh r2, [r0] - subs r3, 0x1E - adds r0, r1, r3 - strh r2, [r0] - ldr r2, =0x00000614 - adds r0, r1, r2 - ldrh r0, [r0] - adds r3, 0x4 - adds r1, r3 - strh r0, [r1] - bl sub_809D42C - adds r1, r0, 0 - cmp r1, 0 - bne _080BC42A - ldr r0, [r4] - ldr r2, =0x00000612 - adds r0, r2 - strh r1, [r0] -_080BC42A: - ldr r0, [r4] - movs r3, 0xC3 - lsls r3, 3 - adds r1, r0, r3 - ldrh r1, [r1] - ldr r2, =0x00000616 - adds r0, r2 - strh r1, [r0] - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80BB78C - str r1, [r0] - bl sub_80BDA40 - bl sub_80BC890 -_080BC450: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BC3DC - - thumb_func_start sub_80BC47C -sub_80BC47C: @ 80BC47C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080BC4E8 - ldr r4, =0x02039b4c - ldr r0, [r4] - ldr r2, =0x0000062a - adds r1, r0, r2 - ldrh r1, [r1] - ldr r3, =0x0000062c - adds r0, r3 - strb r1, [r0] - ldr r1, [r4] - subs r2, 0x1A - adds r0, r1, r2 - ldrh r2, [r0] - subs r3, 0x1E - adds r0, r1, r3 - strh r2, [r0] - ldr r2, =0x00000614 - adds r0, r1, r2 - ldrh r0, [r0] - adds r3, 0x4 - adds r1, r3 - strh r0, [r1] - bl sub_809D42C - adds r1, r0, 0 - cmp r1, 0 - bne _080BC4CA - ldr r0, [r4] - ldr r2, =0x00000612 - adds r0, r2 - strh r1, [r0] -_080BC4CA: - ldr r0, [r4] - movs r3, 0xC3 - lsls r3, 3 - adds r1, r0, r3 - ldrh r1, [r1] - ldr r2, =0x00000616 - adds r0, r2 - strh r1, [r0] - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80BBDE8 - str r1, [r0] -_080BC4E8: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BC47C - - thumb_func_start sub_80BC514 -sub_80BC514: @ 80BC514 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r3, r1, 0 - cmp r0, 0x6 - bhi _080BC55C - lsls r0, 2 - ldr r1, =_080BC540 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080BC540: - .4byte _080BC55C - .4byte _080BC6CC - .4byte _080BC6FC - .4byte _080BC704 - .4byte _080BC768 - .4byte _080BC790 - .4byte _080BC818 -_080BC55C: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - beq _080BC56E - b _080BC838 -_080BC56E: - movs r0, 0 - bl SetVBlankCallback - ldr r4, =0x02039b4c - ldr r0, [r4] - ldr r1, =0x0000064a - adds r0, r1 - strb r5, [r0] - movs r0, 0 - bl sub_80C09B0 - ldr r0, [r4] - ldr r2, =0x0000062d - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x1A - bl SetGpuReg - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0855D298 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - movs r4, 0x80 - lsls r4, 4 - adds r0, r4, 0 - bl AllocZeroed - adds r1, r0, 0 - movs r0, 0x3 - bl SetBgTilemapBuffer - adds r0, r4, 0 - bl AllocZeroed - adds r1, r0, 0 - movs r0, 0x2 - bl SetBgTilemapBuffer - adds r0, r4, 0 - bl AllocZeroed - adds r1, r0, 0 - movs r0, 0x1 - bl SetBgTilemapBuffer - adds r0, r4, 0 - bl AllocZeroed - adds r1, r0, 0 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r1, =gUnknown_08DC1934 - movs r2, 0x80 - lsls r2, 6 - str r6, [sp] - movs r0, 0x3 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_08DC2C5C - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r1, =gUnknown_08DC2DAC - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - cmp r5, 0 - bne _080BC640 - ldr r1, =gUnknown_08DC2A08 - movs r3, 0xA0 - lsls r3, 2 - movs r0, 0 - movs r2, 0 - bl CopyToBgTilemapBuffer - b _080BC64E - .pool -_080BC640: - ldr r1, =gUnknown_08DC2B1C - movs r3, 0xA0 - lsls r3, 2 - movs r0, 0 - movs r2, 0 - bl CopyToBgTilemapBuffer -_080BC64E: - bl sub_80A1A74 - cmp r5, 0 - bne _080BC674 - ldr r3, =0x02039b4c - ldr r1, [r3] - ldr r0, =0x0000064c - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - b _080BC682 - .pool -_080BC674: - ldr r3, =0x02039b4c - ldr r1, [r3] - ldr r2, =0x0000064c - adds r1, r2 - ldrb r0, [r1] - movs r2, 0x1 - orrs r0, r2 -_080BC682: - strb r0, [r1] - ldr r0, [r3] - ldr r1, =0x0000064c - adds r0, r1 - ldrb r0, [r0] - lsls r0, 31 - lsrs r0, 31 - bl sub_80BC844 - ldr r0, =gUnknown_0855D2A8 - bl InitWindows - bl DeactivateAllTextPrinters - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0] - b _080BC838 - .pool -_080BC6CC: - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - ldr r1, =0x0300301c - movs r0, 0x8 - strb r0, [r1] - ldr r0, =gUnknown_0855D26C - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0855D27C - bl LoadTaggedObjectPalettes - adds r0, r5, 0 - bl sub_80BDB7C - b _080BC7F8 - .pool -_080BC6FC: - movs r2, 0x87 - lsls r2, 3 - adds r1, r3, r2 - b _080BC800 -_080BC704: - cmp r5, 0 - bne _080BC71C - ldr r0, =0x02039b4c - ldr r1, [r0] - ldr r2, =0x00000612 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, 0x4 - adds r1, r2 - ldrb r1, [r1] - bl sub_80BC8D4 -_080BC71C: - ldr r4, =0x02039b4c - ldr r0, [r4] - ldr r1, =0x0000060e - adds r0, r1 - ldrh r0, [r0] - movs r1, 0xE - bl sub_80BD2B4 - ldr r0, [r4] - ldr r2, =0x0000064f - adds r0, r2 - movs r1, 0 - strb r1, [r0] - ldr r0, [r4] - adds r2, 0x3 - adds r0, r2 - strh r1, [r0] - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - b _080BC7F8 - .pool -_080BC768: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =sub_80BB370 - bl SetVBlankCallback - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _080BC800 - .pool -_080BC790: - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - ldr r1, =0x00001d3f - movs r0, 0x4A - 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, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - ldr r1, =0x00009040 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg -_080BC7F8: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 -_080BC800: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080BC838 - .pool -_080BC818: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - bne _080BC838 - movs r1, 0x87 - lsls r1, 3 - adds r0, r3, r1 - strb r2, [r0] - movs r0, 0x1 - b _080BC83A - .pool -_080BC838: - movs r0, 0 -_080BC83A: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80BC514 - - thumb_func_start sub_80BC844 -sub_80BC844: @ 80BC844 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080BC858 - ldr r0, =gUnknown_08DC17B6 - b _080BC862 - .pool -_080BC858: - bl sub_809D42C - cmp r0, 0 - bne _080BC870 - ldr r0, =gUnknown_08DC16F6 -_080BC862: - movs r1, 0x1 - movs r2, 0xBE - bl gpu_pal_apply - b _080BC87A - .pool -_080BC870: - ldr r0, =gUnknown_08DC1876 - movs r1, 0x1 - movs r2, 0xBE - bl gpu_pal_apply -_080BC87A: - bl sub_8098C64 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BC844 - - thumb_func_start sub_80BC890 -sub_80BC890: @ 80BC890 - push {lr} - bl FreeAllWindowBuffers - movs r0, 0 - bl GetBgTilemapBuffer - cmp r0, 0 - beq _080BC8A4 - bl Free -_080BC8A4: - movs r0, 0x1 - bl GetBgTilemapBuffer - cmp r0, 0 - beq _080BC8B2 - bl Free -_080BC8B2: - movs r0, 0x2 - bl GetBgTilemapBuffer - cmp r0, 0 - beq _080BC8C0 - bl Free -_080BC8C0: - movs r0, 0x3 - bl GetBgTilemapBuffer - cmp r0, 0 - beq _080BC8CE - bl Free -_080BC8CE: - pop {r0} - bx r0 - thumb_func_end sub_80BC890 - - thumb_func_start sub_80BC8D4 -sub_80BC8D4: @ 80BC8D4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000060c - adds r0, r1 - movs r5, 0 - strh r5, [r0] - cmp r4, 0 - beq _080BC8FC - cmp r4, 0x1 - beq _080BC910 -_080BC8FC: - mov r1, sp - movs r0, 0xCA - strh r0, [r1] - movs r0, 0x1 - strh r0, [r1, 0x2] - b _080BC92C - .pool -_080BC910: - bl sub_809D42C - cmp r0, 0 - beq _080BC924 - mov r0, sp - movs r1, 0xC1 - lsls r1, 1 - strh r1, [r0] - strh r5, [r0, 0x2] - b _080BC92C -_080BC924: - mov r0, sp - movs r1, 0xCA - strh r1, [r0] - strh r4, [r0, 0x2] -_080BC92C: - cmp r6, 0x5 - bls _080BC932 - b _080BCDB4 -_080BC932: - lsls r0, r6, 2 - ldr r1, =_080BC940 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080BC940: - .4byte _080BC958 - .4byte _080BCACC - .4byte _080BCB78 - .4byte _080BCC08 - .4byte _080BCCA0 - .4byte _080BCD30 -_080BC958: - mov r0, sp - ldrh r0, [r0, 0x2] - cmp r0, 0 - beq _080BCA00 - movs r4, 0 - mov r0, sp - ldrh r0, [r0] - cmp r4, r0 - blt _080BC96C - b _080BCDB4 -_080BC96C: - mov r5, sp - ldr r2, =0x02039b4c - mov r8, r2 - movs r3, 0x1 - mov r9, r3 -_080BC976: - lsls r4, 16 - asrs r4, 16 - adds r7, r4, 0x1 - mov r10, r7 - lsls r0, r7, 16 - lsrs r6, r0, 16 - adds r0, r6, 0 - bl HoennToNationalOrder - strh r0, [r5, 0x4] - mov r2, r8 - ldr r1, [r2] - lsls r4, 2 - adds r1, r4 - strh r0, [r1] - ldrh r0, [r5, 0x4] - movs r1, 0 - bl pokedex_flag_operation - mov r3, r8 - ldr r2, [r3] - adds r2, r4 - mov r3, r9 - ands r3, r0 - ldrb r0, [r2, 0x2] - movs r7, 0x2 - negs r7, r7 - adds r1, r7, 0 - ands r0, r1 - orrs r0, r3 - strb r0, [r2, 0x2] - ldrh r0, [r5, 0x4] - movs r1, 0x1 - bl pokedex_flag_operation - mov r1, r8 - ldr r3, [r1] - adds r3, r4 - mov r2, r9 - ands r2, r0 - lsls r2, 1 - ldrb r0, [r3, 0x2] - subs r7, 0x1 - adds r1, r7, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0x2] - mov r0, r8 - ldr r1, [r0] - adds r4, r1, r4 - ldrb r0, [r4, 0x2] - lsls r0, 31 - cmp r0, 0 - beq _080BC9EA - ldr r2, =0x0000060c - adds r0, r1, r2 - mov r3, r10 - strh r3, [r0] -_080BC9EA: - adds r4, r6, 0 - lsls r0, r4, 16 - asrs r0, 16 - ldrh r7, [r5] - cmp r0, r7 - blt _080BC976 - b _080BCDB4 - .pool -_080BCA00: - movs r4, 0 - movs r5, 0 - mov r10, r5 - mov r0, sp - ldrh r0, [r0] - cmp r4, r0 - blt _080BCA10 - b _080BCDB4 -_080BCA10: - mov r6, sp - ldr r0, =0x02039b4c - mov r8, r0 - movs r1, 0x1 - mov r9, r1 -_080BCA1A: - lsls r4, 16 - asrs r0, r4, 16 - adds r0, 0x1 - strh r0, [r6, 0x4] - ldrh r0, [r6, 0x4] - movs r1, 0 - bl pokedex_flag_operation - lsls r0, 24 - adds r7, r4, 0 - cmp r0, 0 - beq _080BCA36 - movs r2, 0x1 - mov r10, r2 -_080BCA36: - mov r3, r10 - cmp r3, 0 - beq _080BCAB2 - mov r4, r8 - ldr r1, [r4] - lsls r0, r5, 16 - asrs r5, r0, 16 - lsls r4, r5, 2 - adds r1, r4 - ldrh r0, [r6, 0x4] - strh r0, [r1] - ldrh r0, [r6, 0x4] - movs r1, 0 - bl pokedex_flag_operation - mov r1, r8 - ldr r2, [r1] - adds r2, r4 - mov r3, r9 - ands r3, r0 - mov r12, r3 - ldrb r0, [r2, 0x2] - movs r3, 0x2 - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 - mov r1, r12 - orrs r0, r1 - strb r0, [r2, 0x2] - ldrh r0, [r6, 0x4] - movs r1, 0x1 - bl pokedex_flag_operation - mov r2, r8 - ldr r3, [r2] - adds r3, r4 - mov r2, r9 - ands r2, r0 - lsls r2, 1 - mov r12, r2 - ldrb r0, [r3, 0x2] - movs r2, 0x3 - negs r2, r2 - adds r1, r2, 0 - ands r0, r1 - mov r1, r12 - orrs r0, r1 - strb r0, [r3, 0x2] - mov r3, r8 - ldr r2, [r3] - adds r4, r2, r4 - ldrb r0, [r4, 0x2] - lsls r0, 31 - cmp r0, 0 - beq _080BCAAC - adds r1, r5, 0x1 - ldr r4, =0x0000060c - adds r0, r2, r4 - strh r1, [r0] -_080BCAAC: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_080BCAB2: - movs r1, 0x80 - lsls r1, 9 - adds r0, r7, r1 - lsrs r4, r0, 16 - asrs r0, 16 - ldrh r2, [r6] - cmp r0, r2 - blt _080BCA1A - b _080BCDB4 - .pool -_080BCACC: - movs r4, 0 - mov r5, sp - ldr r3, =0x02039b4c - mov r8, r3 - ldr r6, =0x0000060c - movs r7, 0x1 - mov r9, r7 -_080BCADA: - ldr r1, =gUnknown_0855C6A4 - lsls r4, 16 - asrs r0, r4, 15 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r5, 0x4] - ldrh r0, [r5, 0x4] - bl NationalToHoennOrder - lsls r0, 16 - lsrs r0, 16 - adds r7, r4, 0 - ldrh r1, [r5] - cmp r0, r1 - bhi _080BCB58 - ldrh r0, [r5, 0x4] - movs r1, 0 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _080BCB58 - mov r3, r8 - ldr r2, [r3] - adds r3, r2, r6 - ldrh r0, [r3] - lsls r0, 2 - adds r0, r2, r0 - ldrh r1, [r5, 0x4] - strh r1, [r0] - ldrh r0, [r3] - lsls r0, 2 - adds r2, r0 - ldrb r0, [r2, 0x2] - mov r4, r9 - orrs r0, r4 - strb r0, [r2, 0x2] - ldrh r0, [r5, 0x4] - movs r1, 0x1 - bl pokedex_flag_operation - mov r1, r8 - ldr r3, [r1] - adds r1, r3, r6 - ldrh r1, [r1] - lsls r1, 2 - adds r3, r1 - mov r2, r9 - ands r2, r0 - lsls r2, 1 - ldrb r0, [r3, 0x2] - movs r4, 0x3 - negs r4, r4 - adds r1, r4, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0x2] - mov r0, r8 - ldr r1, [r0] - adds r1, r6 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_080BCB58: - movs r2, 0x80 - lsls r2, 9 - adds r1, r7, r2 - lsrs r4, r1, 16 - movs r0, 0xCD - lsls r0, 17 - cmp r1, r0 - ble _080BCADA - b _080BCDB4 - .pool -_080BCB78: - ldr r4, =0x00000181 - lsls r0, r4, 16 - mov r5, sp - ldr r7, =0x02039b4c - ldr r6, =0x0000060c -_080BCB82: - ldr r1, =gUnknown_0855C9DA - asrs r0, 15 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r5, 0x4] - ldrh r0, [r5, 0x4] - bl NationalToHoennOrder - lsls r0, 16 - lsrs r0, 16 - ldrh r3, [r5] - cmp r0, r3 - bhi _080BCBE2 - ldrh r0, [r5, 0x4] - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _080BCBE2 - ldr r2, [r7] - adds r3, r2, r6 - ldrh r0, [r3] - lsls r0, 2 - adds r0, r2, r0 - ldrh r1, [r5, 0x4] - strh r1, [r0] - ldrh r0, [r3] - lsls r0, 2 - adds r2, r0 - ldrb r0, [r2, 0x2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x2] - ldr r2, [r7] - adds r0, r2, r6 - ldrh r0, [r0] - lsls r0, 2 - adds r2, r0 - ldrb r0, [r2, 0x2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2, 0x2] - ldr r1, [r7] - adds r1, r6 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_080BCBE2: - lsls r0, r4, 16 - ldr r4, =0xffff0000 - adds r0, r4 - lsrs r4, r0, 16 - lsls r0, r4, 16 - cmp r0, 0 - bge _080BCB82 - b _080BCDB4 - .pool -_080BCC08: - movs r4, 0 - mov r5, sp - ldr r7, =0x02039b4c - mov r8, r7 - ldr r6, =0x0000060c - ldr r0, =0x00000181 - mov r9, r0 -_080BCC16: - ldr r1, =gUnknown_0855C9DA - lsls r4, 16 - asrs r0, r4, 15 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r5, 0x4] - ldrh r0, [r5, 0x4] - bl NationalToHoennOrder - lsls r0, 16 - lsrs r0, 16 - adds r7, r4, 0 - ldrh r1, [r5] - cmp r0, r1 - bhi _080BCC7E - ldrh r0, [r5, 0x4] - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _080BCC7E - mov r3, r8 - ldr r2, [r3] - adds r3, r2, r6 - ldrh r0, [r3] - lsls r0, 2 - adds r0, r2, r0 - ldrh r1, [r5, 0x4] - strh r1, [r0] - ldrh r0, [r3] - lsls r0, 2 - adds r2, r0 - ldrb r0, [r2, 0x2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x2] - mov r4, r8 - ldr r2, [r4] - adds r0, r2, r6 - ldrh r0, [r0] - lsls r0, 2 - adds r2, r0 - ldrb r0, [r2, 0x2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2, 0x2] - ldr r1, [r4] - adds r1, r6 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_080BCC7E: - movs r1, 0x80 - lsls r1, 9 - adds r0, r7, r1 - lsrs r4, r0, 16 - asrs r0, 16 - cmp r0, r9 - ble _080BCC16 - b _080BCDB4 - .pool -_080BCCA0: - ldr r4, =0x00000181 - lsls r0, r4, 16 - mov r5, sp - ldr r7, =0x02039b4c - ldr r6, =0x0000060c -_080BCCAA: - ldr r1, =gUnknown_0855CCDE - asrs r0, 15 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r5, 0x4] - ldrh r0, [r5, 0x4] - bl NationalToHoennOrder - lsls r0, 16 - lsrs r0, 16 - ldrh r2, [r5] - cmp r0, r2 - bhi _080BCD0A - ldrh r0, [r5, 0x4] - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _080BCD0A - ldr r2, [r7] - adds r3, r2, r6 - ldrh r0, [r3] - lsls r0, 2 - adds r0, r2, r0 - ldrh r1, [r5, 0x4] - strh r1, [r0] - ldrh r0, [r3] - lsls r0, 2 - adds r2, r0 - ldrb r0, [r2, 0x2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x2] - ldr r2, [r7] - adds r0, r2, r6 - ldrh r0, [r0] - lsls r0, 2 - adds r2, r0 - ldrb r0, [r2, 0x2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2, 0x2] - ldr r1, [r7] - adds r1, r6 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_080BCD0A: - lsls r0, r4, 16 - ldr r3, =0xffff0000 - adds r0, r3 - lsrs r4, r0, 16 - lsls r0, r4, 16 - cmp r0, 0 - bge _080BCCAA - b _080BCDB4 - .pool -_080BCD30: - movs r4, 0 - mov r5, sp - ldr r7, =0x02039b4c - mov r8, r7 - ldr r6, =0x0000060c - ldr r0, =0x00000181 - mov r9, r0 -_080BCD3E: - ldr r1, =gUnknown_0855CCDE - lsls r4, 16 - asrs r0, r4, 15 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r5, 0x4] - ldrh r0, [r5, 0x4] - bl NationalToHoennOrder - lsls r0, 16 - lsrs r0, 16 - adds r7, r4, 0 - ldrh r1, [r5] - cmp r0, r1 - bhi _080BCDA6 - ldrh r0, [r5, 0x4] - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _080BCDA6 - mov r3, r8 - ldr r2, [r3] - adds r3, r2, r6 - ldrh r0, [r3] - lsls r0, 2 - adds r0, r2, r0 - ldrh r1, [r5, 0x4] - strh r1, [r0] - ldrh r0, [r3] - lsls r0, 2 - adds r2, r0 - ldrb r0, [r2, 0x2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x2] - mov r4, r8 - ldr r2, [r4] - adds r0, r2, r6 - ldrh r0, [r0] - lsls r0, 2 - adds r2, r0 - ldrb r0, [r2, 0x2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2, 0x2] - ldr r1, [r4] - adds r1, r6 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_080BCDA6: - movs r1, 0x80 - lsls r1, 9 - adds r0, r7, r1 - lsrs r4, r0, 16 - asrs r0, 16 - cmp r0, r9 - ble _080BCD3E -_080BCDB4: - ldr r1, =0x02039b4c - ldr r0, [r1] - ldr r2, =0x0000060c - adds r0, r2 - ldrh r4, [r0] - lsls r3, r4, 16 - asrs r0, r3, 16 - ldr r2, =0x00000181 - cmp r0, r2 - bgt _080BCE08 - adds r5, r1, 0 - movs r4, 0x2 - negs r4, r4 - mov r9, r4 - movs r7, 0x3 - negs r7, r7 - mov r8, r7 - adds r7, r2, 0 - ldr r0, =0x0000ffff - adds r6, r0, 0 -_080BCDDC: - ldr r1, [r5] - asrs r3, 16 - lsls r4, r3, 2 - adds r1, r4 - ldrh r0, [r1] - orrs r0, r6 - strh r0, [r1] - ldrb r2, [r1, 0x2] - mov r0, r9 - ands r0, r2 - strb r0, [r1, 0x2] - ldr r1, [r5] - adds r1, r4 - ldrb r2, [r1, 0x2] - mov r0, r8 - ands r0, r2 - strb r0, [r1, 0x2] - adds r3, 0x1 - lsls r3, 16 - asrs r0, r3, 16 - cmp r0, r7 - ble _080BCDDC -_080BCE08: - 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_80BC8D4 - - thumb_func_start sub_80BCE2C -sub_80BCE2C: @ 80BCE2C - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x18 - mov r8, r3 - ldr r3, [sp, 0x2C] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r3, 24 - add r4, sp, 0x14 - movs r6, 0 - strb r6, [r4] - adds r5, r4, 0 - movs r4, 0xF - strb r4, [r5, 0x1] - movs r4, 0x3 - strb r4, [r5, 0x2] - mov r4, r8 - lsls r4, 27 - lsrs r4, 24 - mov r8, r4 - lsrs r3, 21 - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - str r6, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r4, 0x1 - negs r4, r4 - str r4, [sp, 0xC] - str r2, [sp, 0x10] - mov r2, r8 - bl AddTextPrinterParametrized2 - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80BCE2C - - thumb_func_start sub_80BCE84 -sub_80BCE84: @ 80BCE84 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r7, r2, 16 - cmp r0, 0x1 - beq _080BCF7C - cmp r0, 0x1 - ble _080BCEA8 - cmp r0, 0x2 - bne _080BCEA8 - b _080BD074 -_080BCEA8: - subs r0, r1, 0x5 - lsls r0, 16 - lsrs r1, r0, 16 - movs r0, 0 - mov r9, r0 -_080BCEB2: - lsls r0, r1, 16 - lsrs r5, r0, 16 - mov r10, r0 - ldr r1, =0x00000181 - cmp r5, r1 - bhi _080BCED2 - ldr r2, =0x02039b4c - mov r8, r2 - ldr r0, [r2] - mov r3, r10 - asrs r6, r3, 14 - adds r0, r6 - ldrh r0, [r0] - ldr r1, =0x0000ffff - cmp r0, r1 - bne _080BCEF0 -_080BCED2: - mov r2, r9 - lsls r1, r2, 25 - lsrs r1, 24 - movs r0, 0x11 - adds r2, r7, 0 - bl sub_80BD28C - b _080BCF64 - .pool -_080BCEF0: - mov r3, r9 - lsls r0, r3, 25 - lsrs r4, r0, 24 - movs r0, 0x11 - adds r1, r4, 0 - adds r2, r7, 0 - bl sub_80BD28C - mov r1, r8 - ldr r0, [r1] - adds r0, r6 - ldrb r0, [r0, 0x2] - lsls r0, 31 - cmp r0, 0 - beq _080BCF42 - adds r0, r5, 0 - movs r1, 0x12 - adds r2, r4, 0 - adds r3, r7, 0 - bl sub_80BD154 - mov r2, r8 - ldr r0, [r2] - adds r0, r6 - ldrb r0, [r0, 0x2] - lsls r0, 30 - lsrs r0, 31 - movs r1, 0x11 - adds r2, r4, 0 - adds r3, r7, 0 - bl sub_80BD1F4 - mov r3, r8 - ldr r0, [r3] - adds r0, r6 - ldrh r0, [r0] - movs r1, 0x16 - adds r2, r4, 0 - bl sub_80BD23C - b _080BCF64 -_080BCF42: - adds r0, r5, 0 - movs r1, 0x12 - adds r2, r4, 0 - adds r3, r7, 0 - bl sub_80BD154 - movs r0, 0 - movs r1, 0x11 - adds r2, r4, 0 - adds r3, r7, 0 - bl sub_80BD1F4 - movs r0, 0 - movs r1, 0x16 - adds r2, r4, 0 - bl sub_80BD23C -_080BCF64: - movs r0, 0x80 - lsls r0, 9 - add r0, r10 - lsrs r1, r0, 16 - mov r0, r9 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - cmp r0, 0xA - bls _080BCEB2 - b _080BD13E -_080BCF7C: - subs r0, r1, 0x5 - lsls r1, r0, 16 - lsrs r5, r1, 16 - ldr r0, =0x00000181 - ldr r2, =0x02039b4c - cmp r5, r0 - bhi _080BCF9A - adds r6, r2, 0 - ldr r3, [r6] - asrs r4, r1, 14 - adds r0, r3, r4 - ldrh r1, [r0] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _080BCFB8 -_080BCF9A: - ldr r0, [r2] - movs r1, 0xC6 - lsls r1, 3 - adds r0, r1 - movs r2, 0 - ldrsh r1, [r0, r2] - lsls r1, 25 - b _080BD0B2 - .pool -_080BCFB8: - movs r1, 0xC6 - lsls r1, 3 - adds r0, r3, r1 - movs r2, 0 - ldrsh r1, [r0, r2] - lsls r1, 25 - lsrs r1, 24 - movs r0, 0x11 - adds r2, r7, 0 - bl sub_80BD28C - ldr r1, [r6] - adds r0, r1, r4 - ldrb r0, [r0, 0x2] - lsls r0, 31 - cmp r0, 0 - beq _080BD028 - movs r3, 0xC6 - lsls r3, 3 - adds r0, r1, r3 - movs r1, 0 - ldrsh r2, [r0, r1] - lsls r2, 25 - lsrs r2, 24 - adds r0, r5, 0 - movs r1, 0x12 - adds r3, r7, 0 - bl sub_80BD154 - ldr r1, [r6] - adds r0, r1, r4 - ldrb r0, [r0, 0x2] - lsls r0, 30 - lsrs r0, 31 - movs r2, 0xC6 - lsls r2, 3 - adds r1, r2 - movs r3, 0 - ldrsh r2, [r1, r3] - lsls r2, 25 - lsrs r2, 24 - movs r1, 0x11 - adds r3, r7, 0 - bl sub_80BD1F4 - ldr r1, [r6] - adds r0, r1, r4 - ldrh r0, [r0] - movs r2, 0xC6 - lsls r2, 3 - adds r1, r2 - movs r3, 0 - ldrsh r2, [r1, r3] - lsls r2, 25 - lsrs r2, 24 - b _080BD06C -_080BD028: - movs r2, 0xC6 - lsls r2, 3 - adds r0, r1, r2 - movs r3, 0 - ldrsh r2, [r0, r3] - lsls r2, 25 - lsrs r2, 24 - adds r0, r5, 0 - movs r1, 0x12 - adds r3, r7, 0 - bl sub_80BD154 - ldr r0, [r6] - movs r1, 0xC6 - lsls r1, 3 - adds r0, r1 - movs r3, 0 - ldrsh r2, [r0, r3] - lsls r2, 25 - lsrs r2, 24 - movs r0, 0 - movs r1, 0x11 - adds r3, r7, 0 - bl sub_80BD1F4 - ldr r0, [r6] - movs r1, 0xC6 - lsls r1, 3 - adds r0, r1 - movs r3, 0 - ldrsh r2, [r0, r3] - lsls r2, 25 - lsrs r2, 24 - movs r0, 0 -_080BD06C: - movs r1, 0x16 - bl sub_80BD23C - b _080BD13E -_080BD074: - adds r0, r1, 0x5 - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x02039b4c - mov r8, r0 - ldr r3, [r0] - movs r2, 0xC6 - lsls r2, 3 - adds r0, r3, r2 - ldrh r0, [r0] - adds r0, 0xA - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0xF - bls _080BD09A - adds r0, r2, 0 - subs r0, 0x10 - lsls r0, 16 - lsrs r2, r0, 16 -_080BD09A: - lsls r1, 16 - lsrs r5, r1, 16 - ldr r0, =0x00000181 - cmp r5, r0 - bhi _080BD0B0 - asrs r6, r1, 14 - adds r0, r3, r6 - ldrh r1, [r0] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _080BD0CC -_080BD0B0: - lsls r1, r2, 25 -_080BD0B2: - lsrs r1, 24 - movs r0, 0x11 - adds r2, r7, 0 - bl sub_80BD28C - b _080BD13E - .pool -_080BD0CC: - lsls r0, r2, 25 - lsrs r4, r0, 24 - movs r0, 0x11 - adds r1, r4, 0 - adds r2, r7, 0 - bl sub_80BD28C - mov r3, r8 - ldr r0, [r3] - adds r0, r6 - ldrb r0, [r0, 0x2] - lsls r0, 31 - cmp r0, 0 - beq _080BD11C - adds r0, r5, 0 - movs r1, 0x12 - adds r2, r4, 0 - adds r3, r7, 0 - bl sub_80BD154 - mov r1, r8 - ldr r0, [r1] - adds r0, r6 - ldrb r0, [r0, 0x2] - lsls r0, 30 - lsrs r0, 31 - movs r1, 0x11 - adds r2, r4, 0 - adds r3, r7, 0 - bl sub_80BD1F4 - mov r2, r8 - ldr r0, [r2] - adds r0, r6 - ldrh r0, [r0] - movs r1, 0x16 - adds r2, r4, 0 - bl sub_80BD23C - b _080BD13E -_080BD11C: - adds r0, r5, 0 - movs r1, 0x12 - adds r2, r4, 0 - adds r3, r7, 0 - bl sub_80BD154 - movs r0, 0 - movs r1, 0x11 - adds r2, r4, 0 - adds r3, r7, 0 - bl sub_80BD1F4 - movs r0, 0 - movs r1, 0x16 - adds r2, r4, 0 - bl sub_80BD23C -_080BD13E: - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80BCE84 - - thumb_func_start sub_80BD154 -sub_80BD154: @ 80BD154 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r2, 24 - lsrs r7, r2, 24 - ldr r1, =gUnknown_0855D2B8 - add r0, sp, 0x4 - movs r2, 0x6 - bl memcpy - ldr r0, =0x02039b4c - ldr r0, [r0] - lsls r4, 2 - adds r4, r0, r4 - ldrh r6, [r4] - ldr r1, =0x00000612 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - bne _080BD194 - adds r0, r6, 0 - bl NationalToHoennOrder - lsls r0, 16 - lsrs r6, r0, 16 -_080BD194: - add r4, sp, 0x4 - adds r0, r6, 0 - movs r1, 0x64 - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r4, 0x2] - add r5, sp, 0x4 - adds r0, r6, 0 - movs r1, 0x64 - bl __umodsi3 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r4, 0 - movs r1, 0xA - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r5, 0x3] - add r5, sp, 0x4 - adds r0, r4, 0 - movs r1, 0xA - bl __umodsi3 - adds r0, 0xA1 - strb r0, [r5, 0x4] - str r7, [sp] - movs r0, 0 - movs r1, 0x7 - add r2, sp, 0x4 - mov r3, r8 - bl sub_80BCE2C - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BD154 - - thumb_func_start sub_80BD1F4 -sub_80BD1F4: @ 80BD1F4 - push {r4,lr} - sub sp, 0x8 - lsls r0, 16 - lsls r1, 24 - lsrs r3, r1, 24 - lsls r2, 24 - lsrs r4, r2, 24 - cmp r0, 0 - beq _080BD220 - ldr r1, =gUnknown_0855D2BE - lsls r2, r3, 3 - lsls r3, r4, 3 - movs r0, 0x8 - str r0, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - movs r0, 0 - bl BlitBitmapToWindow - b _080BD234 - .pool -_080BD220: - lsls r2, r3, 3 - lsls r3, r4, 3 - movs r0, 0x8 - str r0, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - bl FillWindowPixelRect -_080BD234: - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80BD1F4 - - thumb_func_start sub_80BD23C -sub_80BD23C: @ 80BD23C - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r0, 16 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r5, r2, 24 - bl NationalPokedexNumToSpecies - adds r1, r0, 0 - cmp r1, 0 - beq _080BD264 - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r4, r1, r0 - b _080BD266 - .pool -_080BD264: - ldr r4, =gUnknown_0855D2FE -_080BD266: - str r5, [sp] - movs r0, 0 - movs r1, 0x7 - adds r2, r4, 0 - adds r3, r6, 0 - bl sub_80BCE2C - adds r0, r4, 0 - bl GetStringLength - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80BD23C - - thumb_func_start sub_80BD28C -sub_80BD28C: @ 80BD28C - push {lr} - sub sp, 0x8 - adds r2, r0, 0 - adds r3, r1, 0 - lsls r2, 24 - lsls r3, 24 - lsrs r2, 21 - lsrs r3, 21 - movs r0, 0x60 - str r0, [sp] - movs r0, 0x10 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - bl FillWindowPixelRect - add sp, 0x8 - pop {r0} - bx r0 - thumb_func_end sub_80BD28C - - thumb_func_start sub_80BD2B4 -sub_80BD2B4: @ 80BD2B4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - ldr r2, =0x02037fd4 - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - movs r2, 0 - ldr r7, =0x02039b4c - adds r5, r7, 0 - ldr r4, =0x0000061e - ldr r0, =0x0000ffff - adds r3, r0, 0 -_080BD2DA: - 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, 0x3 - bls _080BD2DA - ldr r0, [r7] - ldr r1, =0x00000626 - adds r0, r1 - ldr r1, =0x0000ffff - strh r1, [r0] - subs r0, r6, 0x1 - lsls r0, 16 - lsrs r0, 16 - bl sub_80BDA8C - lsls r0, 16 - lsrs r0, 16 - ldr r4, =0x0000ffff - cmp r0, r4 - beq _080BD334 - movs r1, 0x60 - movs r2, 0x50 - bl sub_80BDACC - lsls r0, 24 - lsrs r1, r0, 24 - ldr r3, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x1C - adds r1, r0, r1 - ldr r2, =sub_80BE4E0 - str r2, [r1] - adds r0, r3 - ldr r1, =0x0000ffe0 - strh r1, [r0, 0x38] -_080BD334: - adds r0, r6, 0 - bl sub_80BDA8C - lsls r0, 16 - lsrs r0, 16 - cmp r0, r4 - beq _080BD366 - movs r1, 0x60 - movs r2, 0x50 - bl sub_80BDACC - lsls r0, 24 - lsrs r1, r0, 24 - ldr r3, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x1C - adds r1, r0, r1 - ldr r2, =sub_80BE4E0 - str r2, [r1] - adds r0, r3 - movs r1, 0 - strh r1, [r0, 0x38] -_080BD366: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r0, 16 - bl sub_80BDA8C - lsls r0, 16 - lsrs r0, 16 - cmp r0, r4 - beq _080BD39C - movs r1, 0x60 - movs r2, 0x50 - bl sub_80BDACC - lsls r0, 24 - lsrs r1, r0, 24 - ldr r3, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x1C - adds r1, r0, r1 - ldr r2, =sub_80BE4E0 - str r2, [r1] - adds r0, r3 - movs r1, 0x20 - strh r1, [r0, 0x38] -_080BD39C: - movs r0, 0 - adds r1, r6, 0 - mov r2, r8 - bl sub_80BCE84 - ldr r0, [r7] - ldr r2, =0x0000062d - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x1A - bl SetGpuReg - ldr r0, [r7] - movs r2, 0xC6 - lsls r2, 3 - adds r1, r0, r2 - movs r2, 0 - strh r2, [r1] - ldr r1, =0x00000632 - adds r0, r1 - strh r2, [r0] - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BD2B4 - - thumb_func_start sub_80BD404 -sub_80BD404: @ 80BD404 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r0, =0x02039b4c - ldr r1, [r0] - ldr r3, =0x0000062e - adds r2, r1, r3 - ldrb r3, [r2] - adds r7, r0, 0 - cmp r3, 0 - bne _080BD428 - b _080BD578 -_080BD428: - subs r0, r3, 0x1 - strb r0, [r2] - cmp r4, 0x1 - beq _080BD440 - cmp r4, 0x2 - beq _080BD4DC - b _080BD558 - .pool -_080BD440: - movs r3, 0 - ldr r4, =0x0000ffff - mov r12, r4 - ldr r0, =0x02020630 - mov r8, r0 - adds r2, r7, 0 -_080BD44C: - ldr r0, [r2] - lsls r1, r3, 1 - ldr r4, =0x0000061e - adds r0, r4 - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, r12 - beq _080BD46A - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r8 - ldrh r0, [r1, 0x38] - adds r0, r5 - strh r0, [r1, 0x38] -_080BD46A: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x3 - bls _080BD44C - ldr r4, [r7] - ldr r1, =0x0000062e - adds r0, r4, r1 - ldrb r0, [r0] - subs r0, r6, r0 - lsls r0, 4 - adds r1, r6, 0 - bl __divsi3 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r3, =0x0000062d - adds r0, r4, r3 - ldr r1, =0x00000632 - adds r4, r1 - movs r3, 0 - ldrsh r1, [r4, r3] - lsls r1, 4 - ldrb r0, [r0] - adds r1, r0 - subs r1, r2 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x1A - bl SetGpuReg - ldr r0, [r7] - ldr r4, =0x0000062c - adds r2, r0, r4 - movs r1, 0xC5 - lsls r1, 3 - adds r0, r1 - ldrb r1, [r0] - ldrb r0, [r2] - subs r0, r1 - strb r0, [r2] - b _080BD558 - .pool -_080BD4DC: - movs r3, 0 - ldr r2, =0x0000ffff - mov r12, r2 - ldr r4, =0x02020630 - mov r8, r4 - adds r2, r7, 0 -_080BD4E8: - ldr r0, [r2] - lsls r1, r3, 1 - ldr r4, =0x0000061e - adds r0, r4 - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, r12 - beq _080BD506 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r8 - ldrh r0, [r1, 0x38] - subs r0, r5 - strh r0, [r1, 0x38] -_080BD506: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x3 - bls _080BD4E8 - ldr r4, [r7] - ldr r1, =0x0000062e - adds r0, r4, r1 - ldrb r0, [r0] - subs r0, r6, r0 - lsls r0, 4 - adds r1, r6, 0 - bl __divsi3 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r3, =0x0000062d - adds r0, r4, r3 - ldr r1, =0x00000632 - adds r4, r1 - movs r3, 0 - ldrsh r1, [r4, r3] - lsls r1, 4 - ldrb r0, [r0] - adds r1, r0 - adds r1, r2 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x1A - bl SetGpuReg - ldr r0, [r7] - ldr r4, =0x0000062c - adds r1, r0, r4 - movs r2, 0xC5 - lsls r2, 3 - adds r0, r2 - ldrb r0, [r0] - ldrb r3, [r1] - adds r0, r3 - strb r0, [r1] -_080BD558: - movs r0, 0 - b _080BD598 - .pool -_080BD578: - ldr r4, =0x0000062d - adds r2, r1, r4 - movs r3, 0xC6 - lsls r3, 3 - adds r0, r1, r3 - movs r4, 0 - ldrsh r1, [r0, r4] - lsls r1, 4 - ldrb r2, [r2] - adds r1, r2 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x1A - bl SetGpuReg - movs r0, 0x1 -_080BD598: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80BD404 - - thumb_func_start sub_80BD5A8 -sub_80BD5A8: @ 80BD5A8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 16 - lsrs r3, r1, 16 - ldr r4, =0x02039b4c - ldr r0, [r4] - movs r5, 0xC6 - lsls r5, 3 - adds r1, r0, r5 - ldrh r1, [r1] - ldr r6, =0x00000632 - adds r0, r6 - strh r1, [r0] - cmp r2, 0x1 - beq _080BD5D8 - cmp r2, 0x2 - beq _080BD638 - b _080BD694 - .pool -_080BD5D8: - subs r0, r3, 0x1 - lsls r0, 16 - lsrs r0, 16 - bl sub_80BDA8C - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x0000ffff - cmp r1, r0 - beq _080BD612 - adds r0, r1, 0 - movs r1, 0x60 - movs r2, 0x50 - bl sub_80BDACC - lsls r0, 24 - lsrs r1, r0, 24 - ldr r3, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x1C - adds r1, r0, r1 - ldr r2, =sub_80BE4E0 - str r2, [r1] - adds r0, r3 - ldr r1, =0x0000ffc0 - strh r1, [r0, 0x38] -_080BD612: - ldr r0, [r4] - adds r1, r0, r5 - ldrh r2, [r1] - movs r3, 0 - ldrsh r0, [r1, r3] - cmp r0, 0 - ble _080BD634 - subs r0, r2, 0x1 - b _080BD692 - .pool -_080BD634: - movs r0, 0xF - b _080BD692 -_080BD638: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r0, 16 - bl sub_80BDA8C - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x0000ffff - cmp r1, r0 - beq _080BD672 - adds r0, r1, 0 - movs r1, 0x60 - movs r2, 0x50 - bl sub_80BDACC - lsls r0, 24 - lsrs r1, r0, 24 - ldr r3, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x1C - adds r1, r0, r1 - ldr r2, =sub_80BE4E0 - str r2, [r1] - adds r0, r3 - movs r1, 0x40 - strh r1, [r0, 0x38] -_080BD672: - ldr r0, [r4] - adds r1, r0, r5 - ldrh r2, [r1] - movs r6, 0 - ldrsh r0, [r1, r6] - cmp r0, 0xE - bgt _080BD690 - adds r0, r2, 0x1 - b _080BD692 - .pool -_080BD690: - movs r0, 0 -_080BD692: - strh r0, [r1] -_080BD694: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80BD5A8 - - thumb_func_start sub_80BD69C -sub_80BD69C: @ 80BD69C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r7, r0, 16 - lsls r1, 16 - lsrs r4, r1, 16 - movs r0, 0 - mov r10, r0 - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2C] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080BD6FC - cmp r7, 0 - beq _080BD6FC - movs r1, 0x1 - mov r10, r1 - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r2, =0x0000060c - adds r0, r2 - ldrh r3, [r0] - subs r3, 0x1 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0 - bl sub_80C0E0C - adds r7, r0, 0 - movs r0, 0x1 - adds r1, r7, 0 - bl sub_80BD5A8 - movs r0, 0x1 - b _080BD734 - .pool -_080BD6FC: - ldrh r1, [r2, 0x2C] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080BD74C - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r3, =0x0000060c - adds r0, r3 - ldrh r0, [r0] - subs r0, 0x1 - cmp r7, r0 - bge _080BD74C - movs r1, 0x2 - mov r10, r1 - lsls r3, r0, 16 - lsrs r3, 16 - movs r0, 0 - adds r1, r7, 0 - movs r2, 0 - bl sub_80C0E0C - adds r7, r0, 0 - movs r0, 0x2 - adds r1, r7, 0 - bl sub_80BD5A8 - movs r0, 0x2 -_080BD734: - adds r1, r7, 0 - adds r2, r4, 0 - bl sub_80BCE84 - movs r0, 0x6C - bl audio_play - b _080BD81A - .pool -_080BD74C: - ldrh r1, [r2, 0x2E] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080BD7B4 - cmp r7, 0 - beq _080BD7B4 - adds r6, r7, 0 - movs r4, 0 -_080BD75E: - ldr r5, =0x02039b4c - ldr r0, [r5] - ldr r2, =0x0000060c - adds r0, r2 - ldrh r3, [r0] - subs r3, 0x1 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0 - bl sub_80C0E0C - adds r7, r0, 0 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bls _080BD75E - ldr r1, [r5] - ldr r3, =0x0000062c - adds r1, r3 - subs r0, r7, r6 - lsls r0, 4 - ldrb r2, [r1] - adds r0, r2 - strb r0, [r1] - bl sub_80BDA40 - adds r0, r7, 0 - movs r1, 0xE - bl sub_80BD2B4 - movs r0, 0x6D - bl audio_play - b _080BD81A - .pool -_080BD7B4: - ldrh r1, [r2, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080BD81A - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r3, =0x0000060c - adds r0, r3 - ldrh r0, [r0] - subs r0, 0x1 - cmp r7, r0 - bge _080BD81A - adds r6, r7, 0 - movs r4, 0 -_080BD7D2: - ldr r5, =0x02039b4c - ldr r0, [r5] - ldr r1, =0x0000060c - adds r0, r1 - ldrh r3, [r0] - subs r3, 0x1 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0 - adds r1, r7, 0 - movs r2, 0 - bl sub_80C0E0C - adds r7, r0, 0 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bls _080BD7D2 - ldr r1, [r5] - ldr r2, =0x0000062c - adds r1, r2 - subs r0, r7, r6 - lsls r0, 4 - ldrb r3, [r1] - adds r0, r3 - strb r0, [r1] - bl sub_80BDA40 - adds r0, r7, 0 - movs r1, 0xE - bl sub_80BD2B4 - movs r0, 0x6D - bl audio_play -_080BD81A: - mov r0, r10 - cmp r0, 0 - bne _080BD83C - ldr r0, =0x02039b4c - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 3 - adds r0, r1 - mov r2, r10 - strh r2, [r0] - b _080BD8A2 - .pool -_080BD83C: - ldr r1, =gUnknown_0855D28C - ldr r6, =0x02039b4c - ldr r2, [r6] - movs r3, 0xC7 - lsls r3, 3 - mov r9, r3 - adds r0, r2, r3 - ldrh r0, [r0] - lsrs r0, 2 - adds r1, r0, r1 - ldrb r5, [r1] - ldr r1, =gUnknown_0855D291 - adds r0, r1 - ldrb r3, [r0] - ldr r0, =0x0000062e - adds r2, r0 - strb r3, [r2] - ldr r1, [r6] - ldr r2, =0x00000636 - mov r8, r2 - adds r0, r1, r2 - strh r3, [r0] - ldr r4, =0x00000634 - adds r0, r1, r4 - strh r5, [r0] - ldr r3, =0x0000062f - adds r1, r3 - mov r0, r10 - strb r0, [r1] - ldr r2, [r6] - lsrs r5, 1 - movs r1, 0xC5 - lsls r1, 3 - adds r0, r2, r1 - strh r5, [r0] - adds r3, r2, r3 - ldrb r0, [r3] - adds r4, r2, r4 - ldrb r1, [r4] - add r2, r8 - ldrb r2, [r2] - bl sub_80BD404 - ldr r0, [r6] - mov r2, r9 - adds r1, r0, r2 - ldrh r0, [r1] - cmp r0, 0xB - bhi _080BD8A2 - adds r0, 0x1 - strh r0, [r1] -_080BD8A2: - 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_80BD69C - - thumb_func_start sub_80BD8D0 -sub_80BD8D0: @ 80BD8D0 - push {r4-r7,lr} - movs r4, 0 - ldr r0, =0x02039b4c - mov r12, r0 - ldr r6, =0x02020630 - ldr r5, =0x0000ffff -_080BD8DC: - mov r1, r12 - ldr r3, [r1] - lsls r1, r4, 1 - ldr r2, =0x0000061e - adds r0, r3, r2 - adds r0, r1 - ldrh r2, [r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r6 - movs r7, 0x24 - ldrsh r0, [r1, r7] - cmp r0, 0 - bne _080BD90C - movs r7, 0x26 - ldrsh r0, [r1, r7] - cmp r0, 0 - bne _080BD90C - cmp r2, r5 - beq _080BD90C - ldr r1, =0x00000626 - adds r0, r3, r1 - strh r2, [r0] -_080BD90C: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x3 - bls _080BD8DC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BD8D0 - - thumb_func_start sub_80BD930 -sub_80BD930: @ 80BD930 - push {r4-r6,lr} - ldr r3, =0x02039b4c - ldr r0, [r3] - ldr r1, =0x0000060e - adds r0, r1 - ldrh r4, [r0] - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080BD9B8 - cmp r4, 0 - beq _080BD9B8 - adds r2, r4, 0 - adds r5, r3, 0 -_080BD950: - ldr r0, [r5] - ldr r1, =0x0000060c - adds r0, r1 - ldrh r3, [r0] - subs r3, 0x1 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x1 - adds r1, r2, 0 - movs r2, 0 - bl sub_80C0E0C - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, [r5] - lsls r1, r2, 2 - adds r0, r1 - ldrb r0, [r0, 0x2] - lsls r0, 31 - cmp r0, 0 - bne _080BD9A0 - cmp r2, 0 - bne _080BD950 -_080BD97E: - ldr r0, =0x02039b4c - ldr r1, [r0] - ldr r0, =0x0000060e - adds r2, r1, r0 - ldrh r0, [r2] - cmp r0, r4 - bne _080BD9A4 - b _080BDA38 - .pool -_080BD9A0: - adds r4, r2, 0 - b _080BD97E -_080BD9A4: - strh r4, [r2] - ldr r0, =0x0000062c - adds r1, r0 - ldrb r0, [r1] - subs r0, 0x10 - b _080BDA20 - .pool -_080BD9B4: - adds r4, r2, 0 - b _080BDA08 -_080BD9B8: - ldrh r1, [r2, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080BDA38 - ldr r0, [r3] - ldr r1, =0x0000060c - adds r0, r1 - ldrh r0, [r0] - subs r0, 0x1 - cmp r4, r0 - bge _080BDA38 - adds r2, r4, 0 - adds r6, r3, 0 - adds r5, r1, 0 -_080BD9D6: - ldr r0, [r6] - adds r0, r5 - ldrh r3, [r0] - subs r3, 0x1 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0 - adds r1, r2, 0 - movs r2, 0 - bl sub_80C0E0C - lsls r0, 16 - lsrs r2, r0, 16 - ldr r1, [r6] - lsls r0, r2, 2 - adds r0, r1, r0 - ldrb r0, [r0, 0x2] - lsls r0, 31 - cmp r0, 0 - bne _080BD9B4 - adds r0, r1, r5 - ldrh r0, [r0] - subs r0, 0x1 - cmp r2, r0 - blt _080BD9D6 -_080BDA08: - ldr r0, =0x02039b4c - ldr r1, [r0] - ldr r0, =0x0000060e - adds r2, r1, r0 - ldrh r0, [r2] - cmp r0, r4 - beq _080BDA38 - strh r4, [r2] - ldr r0, =0x0000062c - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x10 -_080BDA20: - strb r0, [r1] - movs r0, 0x1 - b _080BDA3A - .pool -_080BDA38: - movs r0, 0 -_080BDA3A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80BD930 - - thumb_func_start sub_80BDA40 -sub_80BDA40: @ 80BDA40 - push {r4-r7,lr} - movs r5, 0 - ldr r6, =0x02039b4c - ldr r7, =0x0000ffff -_080BDA48: - ldr r0, [r6] - lsls r4, r5, 1 - ldr r1, =0x0000061e - adds r0, r1 - adds r1, r0, r4 - ldrh r0, [r1] - cmp r0, r7 - beq _080BDA6C - bl sub_818D820 - ldr r1, [r6] - ldr r0, =0x0000061e - adds r1, r0 - adds r1, r4 - ldrh r2, [r1] - adds r0, r7, 0 - orrs r0, r2 - strh r0, [r1] -_080BDA6C: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x3 - bls _080BDA48 - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80BDA40 - - thumb_func_start sub_80BDA8C -sub_80BDA8C: @ 80BDA8C - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =0x00000181 - cmp r2, r0 - bhi _080BDAA8 - ldr r0, =0x02039b4c - ldr r1, [r0] - lsls r0, r2, 2 - adds r2, r1, r0 - ldrh r1, [r2] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _080BDAB8 -_080BDAA8: - ldr r0, =0x0000ffff - b _080BDAC6 - .pool -_080BDAB8: - ldrb r0, [r2, 0x2] - lsls r0, 31 - cmp r0, 0 - bne _080BDAC4 - movs r0, 0 - b _080BDAC6 -_080BDAC4: - ldrh r0, [r2] -_080BDAC6: - pop {r1} - bx r1 - thumb_func_end sub_80BDA8C - - thumb_func_start sub_80BDACC -sub_80BDACC: @ 80BDACC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r2, 16 - lsrs r2, 16 - movs r6, 0 - ldr r0, =0x02039b4c - mov r9, r0 - ldr r3, =0x0000ffff - lsls r1, 16 -_080BDAE8: - mov r4, r9 - ldr r0, [r4] - lsls r7, r6, 1 - ldr r4, =0x0000061e - adds r0, r4 - adds r0, r7 - ldrh r0, [r0] - cmp r0, r3 - bne _080BDB60 - lsls r2, 16 - mov r0, r8 - asrs r1, 16 - asrs r2, 16 - adds r3, r6, 0 - bl sub_80C0E9C - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =0x02020630 - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - adds r4, r0 - ldrb r1, [r4, 0x1] - movs r2, 0x4 - negs r2, r2 - adds r0, r2, 0 - ands r1, r0 - movs r0, 0x1 - orrs r1, r0 - strb r1, [r4, 0x1] - ldrb r0, [r4, 0x5] - movs r1, 0xC - orrs r0, r1 - strb r0, [r4, 0x5] - movs r0, 0 - strh r0, [r4, 0x2E] - strh r6, [r4, 0x30] - mov r0, r8 - bl NationalPokedexNumToSpecies - strh r0, [r4, 0x32] - mov r4, r9 - ldr r0, [r4] - ldr r1, =0x0000061e - adds r0, r1 - adds r0, r7 - strh r5, [r0] - adds r0, r5, 0 - b _080BDB6C - .pool -_080BDB60: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x3 - bls _080BDAE8 - ldr r0, =0x0000ffff -_080BDB6C: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80BDACC - - thumb_func_start sub_80BDB7C -sub_80BDB7C: @ 80BDB7C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r8, r0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r4, =gUnknown_0855D1AC - adds r0, r4, 0 - movs r1, 0xB8 - movs r2, 0x4 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x02020630 - mov r10, r1 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - add r0, r10 - movs r1, 0 - strh r1, [r0, 0x30] - adds r0, r4, 0 - movs r1, 0xB8 - movs r2, 0x9C - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - add r0, r10 - movs r1, 0x1 - strh r1, [r0, 0x30] - adds r0, 0x3F - ldrb r1, [r0] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0] - ldr r0, =gUnknown_0855D194 - movs r1, 0xE6 - movs r2, 0x14 - movs r3, 0 - bl AddObjectToFront - ldr r5, =gUnknown_0855D1C4 - adds r0, r5, 0 - movs r1, 0x10 - movs r2, 0x78 - movs r3, 0 - bl AddObjectToFront - adds r0, r5, 0 - movs r1, 0x30 - movs r2, 0x78 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - add r0, r10 - movs r1, 0x3 - bl StartObjectImageAnim - adds r0, r5, 0 - movs r1, 0x10 - movs r2, 0x90 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - add r4, r10 - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectImageAnim - movs r0, 0x80 - mov r9, r0 - mov r1, r9 - strh r1, [r4, 0x32] - adds r0, r5, 0 - movs r1, 0x30 - movs r2, 0x90 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - add r0, r10 - movs r1, 0x1 - bl StartObjectImageAnim - ldr r6, =gUnknown_0855D1DC - adds r0, r6, 0 - movs r1, 0 - movs r2, 0x50 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, r7, 4 - adds r1, r7 - lsls r1, 2 - add r1, r10 - ldrb r2, [r1, 0x1] - movs r4, 0x4 - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - movs r5, 0x1 - orrs r0, r5 - strb r0, [r1, 0x1] - ldrb r2, [r1, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r2 - movs r2, 0x3C - orrs r0, r2 - strb r0, [r1, 0x3] - movs r0, 0x1E - strh r0, [r1, 0x2E] - movs r0, 0 - strh r0, [r1, 0x30] - adds r0, r6, 0 - movs r1, 0 - movs r2, 0x50 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, r7, 4 - adds r1, r7 - lsls r1, 2 - add r1, r10 - ldrb r0, [r1, 0x1] - ands r4, r0 - orrs r4, r5 - strb r4, [r1, 0x1] - ldrb r0, [r1, 0x3] - movs r2, 0x3E - orrs r0, r2 - strb r0, [r1, 0x3] - movs r0, 0x1F - strh r0, [r1, 0x2E] - mov r0, r9 - strh r0, [r1, 0x30] - mov r1, r8 - cmp r1, 0 - beq _080BDCCC - b _080BE414 -_080BDCCC: - bl sub_809D42C - cmp r0, 0 - beq _080BDCD6 - b _080BDF4C -_080BDCD6: - ldr r4, =gUnknown_0855D1F4 - adds r0, r4, 0 - movs r1, 0x20 - movs r2, 0x28 - movs r3, 0x1 - bl AddObjectToFront - adds r0, r4, 0 - movs r1, 0x20 - movs r2, 0x48 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - add r0, r10 - movs r1, 0x1 - bl StartObjectImageAnim - movs r0, 0 - mov r8, r0 - ldr r0, =gUnknown_0855D224 - movs r1, 0x18 - movs r2, 0x30 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000061a - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x64 - bl __udivsi3 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - mov r1, r10 - adds r4, r0, r1 - lsls r1, r5, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - cmp r5, 0 - beq _080BDD6C - movs r0, 0x1 - mov r8, r0 - b _080BDD78 - .pool -_080BDD6C: - adds r0, r4, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_080BDD78: - ldr r0, =gUnknown_0855D224 - movs r1, 0x20 - movs r2, 0x30 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000061a - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __udivsi3 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - bne _080BDDB0 - mov r0, r8 - cmp r0, 0 - beq _080BDDD4 -_080BDDB0: - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - lsls r1, r5, 24 - lsrs r1, 24 - bl StartObjectImageAnim - b _080BDDE8 - .pool -_080BDDD4: - ldr r1, =0x02020630 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_080BDDE8: - ldr r6, =gUnknown_0855D224 - adds r0, r6, 0 - movs r1, 0x28 - movs r2, 0x30 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - ldr r5, =0x02039b4c - ldr r0, [r5] - ldr r1, =0x0000061a - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - adds r1, r0, 0 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - lsls r1, 24 - lsrs r1, 24 - bl StartObjectImageAnim - movs r0, 0 - mov r8, r0 - adds r0, r6, 0 - movs r1, 0x18 - movs r2, 0x50 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, [r5] - ldr r1, =0x0000061c - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x64 - bl __udivsi3 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r4, r0, r4 - lsls r1, r5, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - cmp r5, 0 - beq _080BDE80 - movs r0, 0x1 - mov r8, r0 - b _080BDE8C - .pool -_080BDE80: - adds r0, r4, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_080BDE8C: - ldr r0, =gUnknown_0855D224 - movs r1, 0x20 - movs r2, 0x50 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000061c - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __udivsi3 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - bne _080BDEC4 - mov r0, r8 - cmp r0, 0 - beq _080BDEE8 -_080BDEC4: - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - lsls r1, r5, 24 - lsrs r1, 24 - bl StartObjectImageAnim - b _080BDEFC - .pool -_080BDEE8: - ldr r1, =0x02020630 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_080BDEFC: - ldr r0, =gUnknown_0855D224 - movs r1, 0x28 - movs r2, 0x50 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000061c - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - adds r1, r0, 0 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - ldr r2, =0x02020630 - adds r0, r2 - lsls r1, 24 - lsrs r1, 24 - bl StartObjectImageAnim - b _080BE3E2 - .pool -_080BDF4C: - ldr r4, =gUnknown_0855D1F4 - adds r0, r4, 0 - movs r1, 0x20 - movs r2, 0x28 - movs r3, 0x1 - bl AddObjectToFront - adds r0, r4, 0 - movs r1, 0x20 - movs r2, 0x4C - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - add r0, r10 - movs r1, 0x1 - bl StartObjectImageAnim - ldr r4, =gUnknown_0855D20C - adds r0, r4, 0 - movs r1, 0x11 - movs r2, 0x2D - movs r3, 0x1 - bl AddObjectToFront - adds r0, r4, 0 - movs r1, 0x11 - movs r2, 0x37 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - add r0, r10 - movs r1, 0x1 - bl StartObjectImageAnim - adds r0, r4, 0 - movs r1, 0x11 - movs r2, 0x51 - movs r3, 0x1 - bl AddObjectToFront - adds r0, r4, 0 - movs r1, 0x11 - movs r2, 0x5B - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - add r0, r10 - movs r1, 0x1 - bl StartObjectImageAnim - movs r0, 0 - bl sub_80C0844 - lsls r0, 16 - lsrs r6, r0, 16 - movs r0, 0 - mov r8, r0 - ldr r0, =gUnknown_0855D23C - movs r1, 0x28 - movs r2, 0x2D - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r6, 0 - movs r1, 0x64 - bl __udivsi3 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - mov r1, r10 - adds r4, r0, r1 - lsls r1, r5, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - cmp r5, 0 - beq _080BE024 - movs r0, 0x1 - mov r8, r0 - b _080BE030 - .pool -_080BE024: - adds r0, r4, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_080BE030: - ldr r0, =gUnknown_0855D23C - movs r1, 0x30 - movs r2, 0x2D - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r6, 0 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __udivsi3 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - bne _080BE060 - mov r1, r8 - cmp r1, 0 - beq _080BE07C -_080BE060: - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - lsls r1, r5, 24 - lsrs r1, 24 - bl StartObjectImageAnim - b _080BE090 - .pool -_080BE07C: - ldr r1, =0x02020630 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_080BE090: - ldr r5, =gUnknown_0855D23C - adds r0, r5, 0 - movs r1, 0x38 - movs r2, 0x2D - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r6, 0 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - adds r1, r0, 0 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - lsls r1, 24 - lsrs r1, 24 - bl StartObjectImageAnim - movs r0, 0 - mov r8, r0 - adds r0, r5, 0 - movs r1, 0x28 - movs r2, 0x37 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000061a - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x64 - bl __udivsi3 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r4, r0, r4 - lsls r1, r5, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - cmp r5, 0 - beq _080BE11C - movs r0, 0x1 - mov r8, r0 - b _080BE128 - .pool -_080BE11C: - adds r0, r4, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_080BE128: - ldr r0, =gUnknown_0855D23C - movs r1, 0x30 - movs r2, 0x37 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000061a - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __udivsi3 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - bne _080BE160 - mov r0, r8 - cmp r0, 0 - beq _080BE184 -_080BE160: - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - lsls r1, r5, 24 - lsrs r1, 24 - bl StartObjectImageAnim - b _080BE198 - .pool -_080BE184: - ldr r1, =0x02020630 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_080BE198: - ldr r5, =gUnknown_0855D23C - adds r0, r5, 0 - movs r1, 0x38 - movs r2, 0x37 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000061a - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - adds r1, r0, 0 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - lsls r1, 24 - lsrs r1, 24 - bl StartObjectImageAnim - movs r0, 0x1 - bl sub_80C0844 - lsls r0, 16 - lsrs r6, r0, 16 - movs r0, 0 - mov r8, r0 - adds r0, r5, 0 - movs r1, 0x28 - movs r2, 0x51 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r6, 0 - movs r1, 0x64 - bl __udivsi3 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r4, r0, r4 - lsls r1, r5, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - cmp r5, 0 - beq _080BE230 - movs r1, 0x1 - mov r8, r1 - b _080BE23C - .pool -_080BE230: - adds r0, r4, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_080BE23C: - ldr r0, =gUnknown_0855D23C - movs r1, 0x30 - movs r2, 0x51 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r6, 0 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __udivsi3 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - bne _080BE26C - mov r0, r8 - cmp r0, 0 - beq _080BE288 -_080BE26C: - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - lsls r1, r5, 24 - lsrs r1, 24 - bl StartObjectImageAnim - b _080BE29C - .pool -_080BE288: - ldr r1, =0x02020630 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_080BE29C: - ldr r5, =gUnknown_0855D23C - adds r0, r5, 0 - movs r1, 0x38 - movs r2, 0x51 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r6, 0 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - adds r1, r0, 0 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - lsls r1, 24 - lsrs r1, 24 - bl StartObjectImageAnim - movs r1, 0 - mov r8, r1 - adds r0, r5, 0 - movs r1, 0x28 - movs r2, 0x5B - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000061c - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x64 - bl __udivsi3 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r4, r0, r4 - lsls r1, r5, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - cmp r5, 0 - beq _080BE328 - movs r0, 0x1 - mov r8, r0 - b _080BE334 - .pool -_080BE328: - adds r0, r4, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_080BE334: - ldr r0, =gUnknown_0855D23C - movs r1, 0x30 - movs r2, 0x5B - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000061c - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __udivsi3 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - bne _080BE36C - mov r0, r8 - cmp r0, 0 - beq _080BE390 -_080BE36C: - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - lsls r1, r5, 24 - lsrs r1, 24 - bl StartObjectImageAnim - b _080BE3A4 - .pool -_080BE390: - ldr r1, =0x02020630 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_080BE3A4: - ldr r0, =gUnknown_0855D23C - movs r1, 0x38 - movs r2, 0x5B - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000061c - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - adds r1, r0, 0 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - ldr r2, =0x02020630 - adds r0, r2 - lsls r1, 24 - lsrs r1, 24 - bl StartObjectImageAnim -_080BE3E2: - ldr r0, =gUnknown_0855D254 - movs r1, 0x88 - movs r2, 0x60 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x02020630 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r0, r1 - b _080BE42C - .pool -_080BE414: - ldr r0, =gUnknown_0855D254 - movs r1, 0x88 - movs r2, 0x50 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - add r0, r10 -_080BE42C: - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb 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_80BDB7C - - thumb_func_start nullsub_38 -nullsub_38: @ 80BE448 - bx lr - thumb_func_end nullsub_38 - - thumb_func_start sub_80BE44C -sub_80BE44C: @ 80BE44C - push {lr} - adds r1, r0, 0 - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r2, =0x0000064a - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080BE464 - adds r0, r1, 0 - bl RemoveObjectAndFreeTiles -_080BE464: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BE44C - - thumb_func_start sub_80BE470 -sub_80BE470: @ 80BE470 - push {lr} - adds r2, r0, 0 - ldrb r1, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x5] - ldrb r1, [r2, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x1] - movs r0, 0 - strh r0, [r2, 0x24] - strh r0, [r2, 0x26] - ldr r1, [r2, 0x20] - ldr r0, =0x00380030 - cmp r1, r0 - beq _080BE4D4 - ldrh r1, [r2, 0x20] - movs r3, 0x20 - ldrsh r0, [r2, r3] - cmp r0, 0x30 - ble _080BE4A4 - subs r0, r1, 0x1 - strh r0, [r2, 0x20] -_080BE4A4: - ldrh r1, [r2, 0x20] - movs r3, 0x20 - ldrsh r0, [r2, r3] - cmp r0, 0x2F - bgt _080BE4B2 - adds r0, r1, 0x1 - strh r0, [r2, 0x20] -_080BE4B2: - ldrh r1, [r2, 0x22] - movs r3, 0x22 - ldrsh r0, [r2, r3] - cmp r0, 0x38 - ble _080BE4C0 - subs r0, r1, 0x1 - strh r0, [r2, 0x22] -_080BE4C0: - ldrh r1, [r2, 0x22] - movs r3, 0x22 - ldrsh r0, [r2, r3] - cmp r0, 0x37 - bgt _080BE4D8 - adds r0, r1, 0x1 - strh r0, [r2, 0x22] - b _080BE4D8 - .pool -_080BE4D4: - ldr r0, =nullsub_38 - str r0, [r2, 0x1C] -_080BE4D8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BE470 - - thumb_func_start sub_80BE4E0 -sub_80BE4E0: @ 80BE4E0 - push {r4-r7,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - lsls r0, 24 - lsrs r6, r0, 24 - ldr r7, =0x02039b4c - ldr r1, [r7] - ldr r2, =0x0000064a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080BE520 - cmp r0, 0x3 - beq _080BE520 - lsls r5, r6, 1 - ldr r4, =0x0000061e - adds r0, r1, r4 - adds r0, r5 - ldrh r0, [r0] - bl sub_818D820 - ldr r0, [r7] - adds r0, r4 - adds r0, r5 - b _080BE5EC - .pool -_080BE520: - ldr r2, =gUnknown_08329F40 - ldrh r0, [r4, 0x38] - lsls r0, 24 - lsrs r0, 23 - adds r0, r2 - movs r3, 0 - ldrsh r1, [r0, r3] - movs r0, 0x4C - muls r0, r1 - cmp r0, 0 - bge _080BE538 - adds r0, 0xFF -_080BE538: - asrs r0, 8 - strh r0, [r4, 0x26] - movs r1, 0x38 - ldrsh r0, [r4, r1] - adds r0, 0x40 - lsls r0, 1 - adds r0, r2 - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0x80 - lsls r0, 9 - bl __divsi3 - adds r2, r0, 0 - ldr r0, =0x0000ffff - cmp r2, r0 - bls _080BE55C - adds r2, r0, 0 -_080BE55C: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x80 - lsls r1, 1 - lsls r2, 16 - lsrs r2, 16 - str r2, [sp] - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - adds r1, r6, 0x1 - movs r0, 0x1F - ands r1, r0 - lsls r1, 1 - ldrb r2, [r4, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x3] - ldrh r0, [r4, 0x38] - adds r0, 0x3F - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x7E - bhi _080BE5B4 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x5 - negs r1, r1 - ands r1, r0 - strb r1, [r2] - movs r0, 0x1 - strh r0, [r4, 0x2E] - b _080BE5C0 - .pool -_080BE5B4: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_080BE5C0: - ldrh r0, [r4, 0x38] - adds r0, 0x3F - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x7E - bls _080BE5F0 - movs r3, 0x2E - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _080BE5F0 - ldr r5, =0x02039b4c - ldr r0, [r5] - lsls r6, 1 - ldr r4, =0x0000061e - adds r0, r4 - adds r0, r6 - ldrh r0, [r0] - bl sub_818D820 - ldr r0, [r5] - adds r0, r4 - adds r0, r6 -_080BE5EC: - ldr r1, =0x0000ffff - strh r1, [r0] -_080BE5F0: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BE4E0 - - thumb_func_start sub_80BE604 -sub_80BE604: @ 80BE604 - push {r4,lr} - adds r4, r0, 0 - ldr r1, =0x02039b4c - ldr r0, [r1] - ldr r2, =0x0000064a - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080BE62C - cmp r0, 0x3 - beq _080BE62C - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - b _080BE648 - .pool -_080BE62C: - ldr r2, [r1] - ldr r1, =0x0000060e - adds r0, r2, r1 - ldrh r1, [r0] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 3 - ldr r1, =0x0000060c - adds r2, r1 - ldrh r1, [r2] - subs r1, 0x1 - bl __divsi3 - strh r0, [r4, 0x26] -_080BE648: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BE604 - - thumb_func_start sub_80BE658 -sub_80BE658: @ 80BE658 - push {r4,r5,lr} - adds r3, r0, 0 - ldr r1, =0x02039b4c - ldr r0, [r1] - ldr r2, =0x0000064a - adds r0, r2 - ldrb r0, [r0] - adds r5, r1, 0 - cmp r0, 0 - beq _080BE680 - cmp r0, 0x3 - beq _080BE680 - adds r0, r3, 0 - bl RemoveObjectAndFreeTiles - b _080BE750 - .pool -_080BE680: - movs r1, 0x30 - ldrsh r0, [r3, r1] - cmp r0, 0 - beq _080BE6C2 - ldr r0, [r5] - ldr r2, =0x0000060e - adds r1, r0, r2 - ldrh r1, [r1] - subs r2, 0x2 - adds r0, r2 - ldrh r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bne _080BE6AC - adds r0, r3, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - b _080BE6B8 - .pool -_080BE6AC: - adds r0, r3, 0 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 -_080BE6B8: - strb r1, [r0] - adds r2, r0, 0 - ldrh r1, [r3, 0x32] - lsls r0, r1, 24 - b _080BE6F8 -_080BE6C2: - ldr r0, [r5] - ldr r1, =0x0000060e - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - bne _080BE6E0 - adds r0, r3, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - b _080BE6EC - .pool -_080BE6E0: - adds r0, r3, 0 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 -_080BE6EC: - strb r1, [r0] - adds r2, r0, 0 - ldrh r1, [r3, 0x32] - adds r0, r1, 0 - subs r0, 0x80 - lsls r0, 24 -_080BE6F8: - lsrs r0, 24 - adds r4, r1, 0 - ldr r1, =gUnknown_08329F40 - lsls r0, 1 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _080BE70C - adds r0, 0x3F -_080BE70C: - asrs r0, 6 - strh r0, [r3, 0x26] - adds r0, r4, 0 - adds r0, 0x8 - strh r0, [r3, 0x32] - ldr r1, [r5] - ldr r3, =0x0000064f - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _080BE748 - adds r3, 0x3 - adds r0, r1, r3 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _080BE748 - ldrb r1, [r2] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _080BE748 - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - b _080BE74E - .pool -_080BE748: - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 -_080BE74E: - strb r0, [r2] -_080BE750: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80BE658 - - thumb_func_start sub_80BE758 -sub_80BE758: @ 80BE758 - push {lr} - adds r1, r0, 0 - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r2, =0x0000064a - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080BE774 - cmp r0, 0x3 - beq _080BE774 - adds r0, r1, 0 - bl RemoveObjectAndFreeTiles -_080BE774: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BE758 - - thumb_func_start sub_80BE780 -sub_80BE780: @ 80BE780 - push {r4-r7,lr} - sub sp, 0x4 - adds r6, r0, 0 - ldr r1, =0x02039b4c - ldr r0, [r1] - ldr r2, =0x0000064a - adds r0, r2 - ldrb r0, [r0] - adds r7, r1, 0 - cmp r0, 0 - beq _080BE7AC - cmp r0, 0x3 - beq _080BE7AC - adds r0, r6, 0 - bl RemoveObjectAndFreeTiles - b _080BE824 - .pool -_080BE7AC: - ldr r0, [r7] - ldr r5, =0x0000062c - adds r0, r5 - ldrb r1, [r0] - ldrh r0, [r6, 0x30] - adds r1, r0 - lsls r1, 24 - lsrs r1, 24 - ldr r4, =gUnknown_08329F40 - lsls r0, r1, 1 - adds r0, r4 - ldrh r3, [r0] - adds r1, 0x40 - lsls r1, 1 - adds r1, r4 - ldrh r0, [r6, 0x2E] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r1] - lsls r3, 16 - lsrs r2, r3, 16 - negs r3, r3 - lsrs r3, 16 - str r1, [sp] - bl SetSpriteTransformationMatrix - ldr r1, [r7] - adds r1, r5 - ldrh r0, [r6, 0x30] - adds r0, 0x40 - ldrb r1, [r1] - adds r0, r1 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r4 - ldrh r3, [r1] - adds r0, 0x40 - lsls r0, 1 - adds r0, r4 - movs r2, 0 - ldrsh r1, [r0, r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - cmp r0, 0 - bge _080BE80C - adds r0, 0xFF -_080BE80C: - asrs r0, 8 - strh r0, [r6, 0x24] - lsls r1, r3, 16 - asrs r1, 16 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - cmp r0, 0 - bge _080BE820 - adds r0, 0xFF -_080BE820: - asrs r0, 8 - strh r0, [r6, 0x26] -_080BE824: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BE780 - - thumb_func_start sub_80BE834 -sub_80BE834: @ 80BE834 - push {r4,lr} - adds r3, r0, 0 - ldr r1, =0x02039b4c - ldr r0, [r1] - ldr r2, =0x0000064a - adds r0, r2 - ldrb r2, [r0] - cmp r2, 0 - beq _080BE85C - cmp r2, 0x3 - beq _080BE85C - adds r0, r3, 0 - bl RemoveObjectAndFreeTiles - b _080BE8D4 - .pool -_080BE85C: - ldr r4, [r1] - ldr r1, =0x0000064a - adds r0, r4, r1 - ldrb r0, [r0] - movs r1, 0x60 - cmp r0, 0 - bne _080BE86C - movs r1, 0x50 -_080BE86C: - ldr r2, =0x0000064f - adds r0, r4, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080BE8C8 - adds r2, 0x3 - adds r0, r4, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, r1 - bne _080BE8C8 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - movs r1, 0xCA - lsls r1, 3 - adds r0, r4, r1 - ldrh r0, [r0] - lsls r0, 4 - strh r0, [r3, 0x26] - ldr r1, =gUnknown_08329F40 - ldrh r2, [r3, 0x32] - lsls r0, r2, 24 - lsrs r0, 23 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _080BE8B0 - adds r0, 0x3F -_080BE8B0: - asrs r0, 6 - strh r0, [r3, 0x24] - adds r0, r2, 0 - adds r0, 0x8 - strh r0, [r3, 0x32] - b _080BE8D4 - .pool -_080BE8C8: - adds r0, r3, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_080BE8D4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80BE834 - - thumb_func_start sub_80BE8DC -sub_80BE8DC: @ 80BE8DC - push {r4,r5,lr} - sub sp, 0x18 - adds r5, r1, 0 - adds r3, r2, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r3, 24 - lsrs r3, 24 - add r1, sp, 0x14 - movs r4, 0 - strb r4, [r1] - adds r2, r1, 0 - movs r1, 0xF - strb r1, [r2, 0x1] - movs r1, 0x3 - strb r1, [r2, 0x2] - str r4, [sp] - str r4, [sp, 0x4] - str r2, [sp, 0x8] - subs r1, 0x4 - str r1, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0 - movs r1, 0x1 - adds r2, r5, 0 - bl AddTextPrinterParametrized2 - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80BE8DC - - thumb_func_start sub_80BE91C -sub_80BE91C: @ 80BE91C - push {r4,r5,lr} - lsls r4, r1, 24 - lsrs r4, 24 - ldr r1, =0x02039b54 - str r0, [r1] - ldr r0, =sub_80BEA24 - movs r1, 0 - bl CreateTask - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - strh r2, [r0, 0x8] - movs r1, 0x1 - strh r1, [r0, 0xA] - strh r2, [r0, 0xC] - strh r2, [r0, 0xE] - strh r4, [r0, 0x10] - movs r1, 0xFF - strh r1, [r0, 0x12] - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0856E630 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - movs r4, 0x80 - lsls r4, 4 - adds r0, r4, 0 - bl AllocZeroed - adds r1, r0, 0 - movs r0, 0x3 - bl SetBgTilemapBuffer - adds r0, r4, 0 - bl AllocZeroed - adds r1, r0, 0 - movs r0, 0x2 - bl SetBgTilemapBuffer - adds r0, r4, 0 - bl AllocZeroed - adds r1, r0, 0 - movs r0, 0x1 - bl SetBgTilemapBuffer - adds r0, r4, 0 - bl AllocZeroed - adds r1, r0, 0 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r0, =gUnknown_0856E640 - bl InitWindows - bl DeactivateAllTextPrinters - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80BE91C - - thumb_func_start sub_80BE9C4 -sub_80BE9C4: @ 80BE9C4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _080BE9F0 - ldr r1, [r1] - ldr r0, =sub_80BEDF4 - cmp r1, r0 - bne _080BE9F0 - movs r0, 0 - b _080BE9F2 - .pool -_080BE9F0: - movs r0, 0x1 -_080BE9F2: - pop {r1} - bx r1 - thumb_func_end sub_80BE9C4 - - thumb_func_start sub_80BE9F8 -sub_80BE9F8: @ 80BE9F8 - adds r2, r0, 0 - lsls r0, r1, 24 - lsrs r0, 24 - ldr r1, =0x02039b54 - str r2, [r1] - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r3, 0 - movs r2, 0x1 - strh r2, [r1, 0x8] - strh r3, [r1, 0xA] - strh r3, [r1, 0xC] - strh r3, [r1, 0xE] - bx lr - .pool - thumb_func_end sub_80BE9F8 - - thumb_func_start sub_80BEA24 -sub_80BEA24: @ 80BEA24 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r5, r1, 0 - cmp r0, 0xA - bhi _080BEA7C - lsls r0, 2 - ldr r1, =_080BEA50 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080BEA50: - .4byte _080BEA7C - .4byte _080BEAF0 - .4byte _080BEB50 - .4byte _080BEB90 - .4byte _080BEB98 - .4byte _080BEC08 - .4byte _080BEC60 - .4byte _080BECBC - .4byte _080BED04 - .4byte _080BED5E - .4byte _080BED7C -_080BEA7C: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080BEA8A - b _080BEDA0 -_080BEA8A: - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r3, =0x0000064a - adds r0, r3 - movs r6, 0x1 - strb r6, [r0] - ldr r1, =0x030060b4 - ldr r0, [r5, 0xC] - str r0, [r1] - movs r0, 0 - bl SetVBlankCallback - movs r2, 0 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r1 - movs r3, 0xA - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _080BEABA - movs r2, 0x80 - lsls r2, 5 -_080BEABA: - movs r3, 0xC - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _080BEACA - movs r1, 0x80 - lsls r1, 2 - adds r0, r1, 0 - orrs r2, r0 -_080BEACA: - adds r0, r2, 0 - bl sub_80C09B0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r5, r2 - strb r6, [r0] - b _080BEDA0 - .pool -_080BEAF0: - ldr r1, =gUnknown_08DC1934 - movs r2, 0x80 - lsls r2, 6 - movs r0, 0 - str r0, [sp] - movs r0, 0x3 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_08DC3080 - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - bl PutWindowTilemap - movs r0, 0x1 - bl PutWindowTilemap - ldr r0, =0x02039b54 - ldr r0, [r0] - ldrh r1, [r0] - movs r0, 0x1 - bl sub_80C0D30 - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _080BED70 - .pool -_080BEB50: - movs r0, 0xD - bl sub_80BFCDC - ldr r4, =0x02039b4c - ldr r0, [r4] - ldr r1, =0x0000064d - adds r0, r1 - ldrb r0, [r0] - movs r1, 0xD - bl sub_80BFD0C - ldr r0, [r4] - ldr r2, =0x0000064c - adds r0, r2 - ldrb r0, [r0] - lsls r0, 31 - lsrs r0, 31 - bl sub_80BC844 - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _080BED70 - .pool -_080BEB90: - movs r0, 0x87 - lsls r0, 3 - adds r1, r5, r0 - b _080BED70 -_080BEB98: - ldr r4, =0x02039b54 - ldr r3, [r4] - ldrh r0, [r3] - ldr r1, =0x02039b4c - ldr r1, [r1] - ldr r2, =0x00000612 - adds r1, r2 - ldrh r2, [r1] - negs r1, r2 - orrs r1, r2 - lsrs r1, 31 - ldr r2, [r3] - lsls r2, 14 - lsrs r2, 31 - movs r3, 0 - bl sub_80C020C - ldr r0, [r4] - ldrb r1, [r0, 0x2] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _080BEBD0 - ldr r0, =0x02037716 - movs r1, 0x31 - movs r2, 0x1E - bl gpu_pal_apply -_080BEBD0: - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _080BED70 - .pool -_080BEC08: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r4, r1, r0 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080BEC44 - ldr r0, =0x02039b54 - ldr r0, [r0] - ldrh r0, [r0] - movs r1, 0x30 - movs r2, 0x38 - movs r3, 0 - bl sub_80C0E9C - strh r0, [r4, 0x10] - ldr r2, =0x02020630 - movs r3, 0x10 - ldrsh r0, [r4, r3] - 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] -_080BEC44: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _080BED70 - .pool -_080BEC60: - movs r3, 0 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r2, 0xC - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _080BEC76 - movs r3, 0x14 -_080BEC76: - movs r2, 0xA - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _080BEC98 - ldr r2, =0x02020630 - movs r0, 0x10 - ldrsh r1, [r1, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x5] - lsrs r1, 4 - adds r1, 0x10 - movs r0, 0x1 - lsls r0, r1 - orrs r3, r0 -_080BEC98: - mvns r0, r3 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =0x030060b4 - ldr r0, [r0] - bl SetVBlankCallback - b _080BED68 - .pool -_080BECBC: - 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 r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl HideBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _080BED70 - .pool -_080BED04: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080BEDA0 - movs r0, 0x87 - lsls r0, 3 - adds r2, r5, r0 - ldrb r0, [r2] - adds r3, r0, 0x1 - strb r3, [r2] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0xE - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _080BED58 - bl sub_80A369C - ldr r0, =0x02039b54 - ldr r0, [r0] - ldrh r0, [r0] - bl NationalPokedexNumToSpecies - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - movs r2, 0x7D - movs r3, 0xA - bl sub_80A32C0 - b _080BEDA0 - .pool -_080BED58: - adds r0, r3, 0x1 - strb r0, [r2] - b _080BEDA0 -_080BED5E: - bl sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - bne _080BEDA0 -_080BED68: - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_080BED70: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080BEDA0 - .pool -_080BED7C: - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - movs r1, 0 - strh r1, [r0, 0x8] - strh r1, [r0, 0xA] - movs r1, 0x1 - strh r1, [r0, 0xC] - strh r1, [r0, 0xE] - ldr r1, =sub_80BEDF4 - str r1, [r0] - movs r3, 0x87 - lsls r3, 3 - adds r0, r5, r3 - strb r2, [r0] -_080BEDA0: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BEA24 - - thumb_func_start sub_80BEDB0 -sub_80BEDB0: @ 80BEDB0 - push {lr} - bl FreeAllWindowBuffers - movs r0, 0 - bl GetBgTilemapBuffer - cmp r0, 0 - beq _080BEDC4 - bl Free -_080BEDC4: - movs r0, 0x1 - bl GetBgTilemapBuffer - cmp r0, 0 - beq _080BEDD2 - bl Free -_080BEDD2: - movs r0, 0x2 - bl GetBgTilemapBuffer - cmp r0, 0 - beq _080BEDE0 - bl Free -_080BEDE0: - movs r0, 0x3 - bl GetBgTilemapBuffer - cmp r0, 0 - beq _080BEDEE - bl Free -_080BEDEE: - pop {r0} - bx r0 - thumb_func_end sub_80BEDB0 - - thumb_func_start sub_80BEDF4 -sub_80BEDF4: @ 80BEDF4 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - movs r0, 0x8 - ldrsh r5, [r4, r0] - cmp r5, 0 - beq _080BEE34 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =sub_80BF038 - str r0, [r4] - movs r0, 0x6C - bl audio_play - b _080BEFBA - .pool -_080BEE34: - ldr r1, =0x030022c0 - ldrh r2, [r1, 0x2E] - movs r0, 0x2 - ands r0, r2 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0 - beq _080BEE50 - movs r0, 0x1 - negs r0, r0 - str r5, [sp] - b _080BEF0E - .pool -_080BEE50: - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - beq _080BEF28 - ldr r5, =0x02039b4c - ldr r0, [r5] - ldr r1, =0x0000064d - adds r0, r1 - ldrb r1, [r0] - cmp r1, 0x1 - beq _080BEEA0 - cmp r1, 0x1 - bgt _080BEE78 - cmp r1, 0 - beq _080BEE82 - b _080BEFBA - .pool -_080BEE78: - cmp r1, 0x2 - beq _080BEEC0 - cmp r1, 0x3 - beq _080BEF08 - b _080BEFBA -_080BEE82: - movs r0, 0x15 - negs r0, r0 - str r3, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, [r5] - ldr r3, =0x0000064e - adds r0, r3 - movs r1, 0x1 - b _080BEEF0 - .pool -_080BEEA0: - movs r0, 0x15 - negs r0, r0 - str r3, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, [r5] - ldr r1, =0x0000064e - adds r0, r1 - movs r1, 0x2 - b _080BEEF0 - .pool -_080BEEC0: - ldr r0, =0x02039b54 - ldr r0, [r0] - ldrb r0, [r0, 0x2] - ands r1, r0 - cmp r1, 0 - bne _080BEED8 - movs r0, 0x20 - bl audio_play - b _080BEFBA - .pool -_080BEED8: - movs r0, 0x15 - negs r0, r0 - str r3, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, [r5] - ldr r3, =0x0000064e - adds r0, r3 - movs r1, 0x3 -_080BEEF0: - strb r1, [r0] - ldr r0, =sub_80BEFD0 - str r0, [r4] - movs r0, 0x15 - bl audio_play - b _080BEFBA - .pool -_080BEF08: - movs r0, 0x1 - negs r0, r0 - str r3, [sp] -_080BEF0E: - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =sub_80BF070 - str r0, [r4] - movs r0, 0x3 - bl audio_play - b _080BEFBA - .pool -_080BEF28: - movs r0, 0x20 - ands r0, r2 - cmp r0, 0 - bne _080BEF44 - movs r0, 0x80 - lsls r0, 2 - ands r0, r2 - cmp r0, 0 - beq _080BEF78 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0x1 - bne _080BEF78 -_080BEF44: - ldr r3, =0x02039b4c - ldr r0, [r3] - ldr r4, =0x0000064d - adds r2, r0, r4 - ldrb r0, [r2] - cmp r0, 0 - beq _080BEF78 - subs r0, 0x1 - strb r0, [r2] - ldr r0, [r3] - adds r0, r4 - ldrb r0, [r0] - movs r1, 0xD - bl sub_80BFD0C - movs r0, 0x6D - bl audio_play - b _080BEFBA - .pool -_080BEF78: - ldrh r1, [r1, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _080BEF96 - movs r0, 0x80 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - beq _080BEFBA - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0x1 - bne _080BEFBA -_080BEF96: - ldr r2, =0x02039b4c - ldr r0, [r2] - ldr r3, =0x0000064d - adds r1, r0, r3 - ldrb r0, [r1] - cmp r0, 0x2 - bhi _080BEFBA - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r2] - adds r0, r3 - ldrb r0, [r0] - movs r1, 0xD - bl sub_80BFD0C - movs r0, 0x6D - bl audio_play -_080BEFBA: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BEDF4 - - thumb_func_start sub_80BEFD0 -sub_80BEFD0: @ 80BEFD0 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080BF02C - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x10] - bl sub_818D820 - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000064e - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x2 - beq _080BF020 - cmp r0, 0x2 - ble _080BF008 - cmp r0, 0x3 - beq _080BF028 -_080BF008: - ldr r0, =sub_80BF0AC - b _080BF02A - .pool -_080BF020: - ldr r0, =sub_80BF250 - b _080BF02A - .pool -_080BF028: - ldr r0, =sub_80BF82C -_080BF02A: - str r0, [r4] -_080BF02C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BEFD0 - - thumb_func_start sub_80BF038 -sub_80BF038: @ 80BF038 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080BF05E - ldr r0, =0x03005e00 - lsls r4, r2, 2 - adds r4, r2 - lsls r4, 3 - adds r4, r0 - ldrh r0, [r4, 0x10] - bl sub_818D820 - ldr r0, =sub_80BEA24 - str r0, [r4] -_080BF05E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BF038 - - thumb_func_start sub_80BF070 -sub_80BF070: @ 80BF070 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080BF09C - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x10] - bl sub_818D820 - bl sub_80BEDB0 - adds r0, r4, 0 - bl DestroyTask -_080BF09C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BF070 - - thumb_func_start sub_80BF0AC -sub_80BF0AC: @ 80BF0AC - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r7, r2, r0 - ldrb r0, [r7] - cmp r0, 0x1 - beq _080BF120 - cmp r0, 0x1 - ble _080BF0C8 - cmp r0, 0x2 - beq _080BF15C -_080BF0C8: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _080BF196 - ldr r4, =0x02039b4c - ldr r0, [r4] - ldr r1, =0x0000064a - adds r0, r1 - movs r1, 0x5 - strb r1, [r0] - ldr r1, =0x030060b4 - ldr r0, [r2, 0xC] - str r0, [r1] - movs r0, 0 - bl SetVBlankCallback - movs r0, 0x80 - lsls r0, 2 - bl sub_80C09B0 - ldr r0, [r4] - ldr r1, =0x0000064d - adds r0, r1 - strb r5, [r0] - movs r0, 0x1 - strb r0, [r7] - b _080BF196 - .pool -_080BF120: - movs r0, 0xD - bl sub_80BFCF4 - movs r0, 0 - movs r1, 0xD - bl sub_80BFD7C - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000064c - adds r0, r1 - ldrb r0, [r0] - lsls r0, 31 - lsrs r0, 31 - bl sub_80BC844 - movs r1, 0xD0 - lsls r1, 4 - movs r0, 0xA - bl SetGpuReg - ldrb r0, [r7] - adds r0, 0x1 - strb r0, [r7] - b _080BF196 - .pool -_080BF15C: - ldr r0, =0x02039b54 - ldr r0, [r0] - ldrh r0, [r0] - bl NationalPokedexNumToSpecies - lsls r0, 16 - lsrs r0, 16 - ldr r5, =0x02039b4c - ldr r1, [r5] - ldr r4, =0x0000064e - adds r1, r4 - bl sub_813D3D8 - ldr r0, =0x030060b4 - ldr r0, [r0] - bl SetVBlankCallback - ldr r0, [r5] - adds r0, r4 - movs r1, 0 - strb r1, [r0] - strb r1, [r7] - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80BF1B4 - str r1, [r0] -_080BF196: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BF0AC - - thumb_func_start sub_80BF1B4 -sub_80BF1B4: @ 80BF1B4 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000064e - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080BF1D6 - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80BF1EC - str r0, [r1] -_080BF1D6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BF1B4 - - thumb_func_start sub_80BF1EC -sub_80BF1EC: @ 80BF1EC - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080BF242 - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000064e - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080BF210 - cmp r0, 0x2 - beq _080BF234 -_080BF210: - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80BEA24 - b _080BF240 - .pool -_080BF234: - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80BF250 -_080BF240: - str r0, [r1] -_080BF242: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BF1EC - - thumb_func_start sub_80BF250 -sub_80BF250: @ 80BF250 - push {r4,r5,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0xA - bhi _080BF2A8 - lsls r0, 2 - ldr r1, =_080BF27C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080BF27C: - .4byte _080BF2A8 - .4byte _080BF310 - .4byte _080BF360 - .4byte _080BF38C - .4byte _080BF3A0 - .4byte _080BF3D0 - .4byte _080BF41C - .4byte _080BF498 - .4byte _080BF514 - .4byte _080BF540 - .4byte _080BF590 -_080BF2A8: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080BF2B6 - b _080BF5B2 -_080BF2B6: - ldr r0, =0x03007420 - bl MPlayStop_rev01 - ldr r5, =0x02039b4c - ldr r0, [r5] - ldr r3, =0x0000064a - adds r0, r3 - movs r1, 0x6 - strb r1, [r0] - ldr r1, =0x030060b4 - ldr r4, =0x030022c0 - ldr r0, [r4, 0xC] - str r0, [r1] - movs r0, 0 - bl SetVBlankCallback - movs r0, 0x80 - lsls r0, 2 - bl sub_80C09B0 - ldr r0, [r5] - ldr r1, =0x0000064d - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - movs r2, 0x87 - lsls r2, 3 - adds r4, r2 - strb r1, [r4] - b _080BF5B2 - .pool -_080BF310: - ldr r1, =gUnknown_08DC1934 - movs r2, 0x80 - lsls r2, 6 - movs r0, 0 - str r0, [sp] - movs r0, 0x3 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_08DC3198 - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - bl PutWindowTilemap - movs r0, 0x3 - bl PutWindowTilemap - movs r0, 0x2 - bl PutWindowTilemap - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _080BF582 - .pool -_080BF360: - movs r0, 0xD - bl sub_80BFCF4 - movs r0, 0x1 - movs r1, 0xD - bl sub_80BFD7C - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r4, =0x0000064c - adds r0, r4 - ldrb r0, [r0] - lsls r0, 31 - lsrs r0, 31 - bl sub_80BC844 - b _080BF57A - .pool -_080BF38C: - bl sub_80A1A74 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _080BF582 - .pool -_080BF3A0: - ldr r0, =gUnknown_085E871B - movs r1, 0x52 - movs r2, 0x21 - bl sub_80BE8DC - ldr r0, =0x02039b54 - ldr r0, [r0] - ldrh r1, [r0] - movs r0, 0 - movs r2, 0x52 - movs r3, 0x31 - bl sub_80C0B44 - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _080BF582 - .pool -_080BF3D0: - ldr r0, =0x02039b54 - ldr r0, [r0] - ldrh r0, [r0] - movs r1, 0x30 - movs r2, 0x38 - movs r3, 0 - bl sub_80C0E9C - ldr r2, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r2 - movs r3, 0 - strh r0, [r1, 0x10] - ldr r2, =0x02020630 - movs r4, 0x10 - ldrsh r0, [r1, r4] - 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] - ldr r0, =0x030061ec - strb r3, [r0] - b _080BF57A - .pool -_080BF41C: - ldr r1, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r1 - ldr r1, =0x00004020 - orrs r0, r1 - ldr r1, =0xff00ffff - ands r0, r1 - movs r1, 0xF8 - lsls r1, 13 - orrs r0, r1 - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 20 - orrs r0, r1 - str r0, [sp, 0x4] - ldr r1, =0xffff00ff - ldr r0, [sp, 0x8] - ands r0, r1 - movs r1, 0xF0 - lsls r1, 5 - orrs r0, r1 - ldr r1, =0xffffff00 - ands r0, r1 - movs r1, 0xC - orrs r0, r1 - str r0, [sp, 0x8] - add r0, sp, 0x4 - movs r1, 0x2 - bl sub_8145354 - lsls r0, 24 - cmp r0, 0 - bne _080BF462 - b _080BF5B2 -_080BF462: - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - ldrb r0, [r1] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1] - ldr r0, =0x030061ec - strb r2, [r0] - b _080BF5B2 - .pool -_080BF498: - ldr r1, =0x00ffffff - ldr r0, [sp, 0xC] - ands r0, r1 - movs r1, 0x90 - lsls r1, 20 - orrs r0, r1 - str r0, [sp, 0xC] - ldr r2, =0xffffff00 - add r0, sp, 0xC - ldr r1, [r0, 0x4] - ands r1, r2 - movs r2, 0x12 - orrs r1, r2 - ldr r2, =0xffff00ff - ands r1, r2 - movs r2, 0xC0 - lsls r2, 2 - orrs r1, r2 - str r1, [r0, 0x4] - movs r1, 0x3 - bl sub_8145850 - lsls r0, 24 - cmp r0, 0 - beq _080BF4D8 - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080BF4D8: - movs r0, 0x3 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - b _080BF5B2 - .pool -_080BF514: - movs r0, 0x15 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =0x030060b4 - ldr r0, [r0] - bl SetVBlankCallback - ldr r1, =0x030022c0 - movs r4, 0x87 - lsls r4, 3 - adds r1, r4 - b _080BF582 - .pool -_080BF540: - 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 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, 0x3 - bl ShowBg -_080BF57A: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 -_080BF582: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080BF5B2 - .pool -_080BF590: - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000064e - adds r0, r1 - movs r1, 0 - strb r1, [r0] - movs r3, 0x87 - lsls r3, 3 - adds r0, r2, r3 - strb r1, [r0] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80BF5CC - str r1, [r0] -_080BF5B2: - add sp, 0x14 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BF250 - - thumb_func_start sub_80BF5CC -sub_80BF5CC: @ 80BF5CC - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x2 - bl sub_814545C - bl sub_80A36EC - lsls r0, 24 - cmp r0, 0 - beq _080BF5EC - movs r0, 0x1 - bl sub_80BF7FC - b _080BF5F2 -_080BF5EC: - movs r0, 0 - bl sub_80BF7FC -_080BF5F2: - ldr r1, =0x030022c0 - ldrh r2, [r1, 0x2E] - movs r0, 0x1 - ands r0, r2 - adds r5, r1, 0 - cmp r0, 0 - beq _080BF624 - movs r0, 0x1 - bl sub_80BF7FC - ldr r0, =0x02039b54 - ldr r0, [r0] - ldrh r0, [r0] - bl NationalPokedexNumToSpecies - lsls r0, 16 - lsrs r0, 16 - bl sub_8145534 - b _080BF772 - .pool -_080BF624: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _080BF636 - b _080BF772 -_080BF636: - movs r0, 0x2 - ands r0, r2 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0 - beq _080BF694 - movs r0, 0x15 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x03007420 - bl m4aMPlayContinue - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000064e - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80BF790 - str r1, [r0] - movs r0, 0x3 - bl audio_play - b _080BF772 - .pool -_080BF694: - movs r0, 0x20 - ands r0, r2 - cmp r0, 0 - bne _080BF6B0 - movs r0, 0x80 - lsls r0, 2 - ands r0, r2 - cmp r0, 0 - beq _080BF700 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0x1 - bne _080BF700 -_080BF6B0: - movs r0, 0x15 - negs r0, r0 - str r3, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x03007420 - bl m4aMPlayContinue - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000064e - adds r0, r1 - movs r1, 0x2 - strb r1, [r0] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80BF790 - str r1, [r0] - movs r0, 0x6D - bl audio_play - b _080BF772 - .pool -_080BF700: - ldrh r1, [r5, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _080BF71E - movs r0, 0x80 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - beq _080BF772 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0x1 - bne _080BF772 -_080BF71E: - ldr r0, =0x02039b54 - ldr r0, [r0] - ldrb r1, [r0, 0x2] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _080BF73C - movs r0, 0x20 - bl audio_play - b _080BF772 - .pool -_080BF73C: - movs r0, 0x15 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x03007420 - bl m4aMPlayContinue - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000064e - adds r0, r1 - movs r1, 0x3 - strb r1, [r0] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80BF790 - str r1, [r0] - movs r0, 0x6D - bl audio_play -_080BF772: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BF5CC - - thumb_func_start sub_80BF790 -sub_80BF790: @ 80BF790 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080BF7F0 - bl sub_8145914 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x10] - bl sub_818D820 - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000064e - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x2 - beq _080BF7E4 - cmp r0, 0x2 - ble _080BF7CC - cmp r0, 0x3 - beq _080BF7EC -_080BF7CC: - ldr r0, =sub_80BEA24 - b _080BF7EE - .pool -_080BF7E4: - ldr r0, =sub_80BF0AC - b _080BF7EE - .pool -_080BF7EC: - ldr r0, =sub_80BF82C -_080BF7EE: - str r0, [r4] -_080BF7F0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BF790 - - thumb_func_start sub_80BF7FC -sub_80BF7FC: @ 80BF7FC - push {lr} - sub sp, 0x4 - lsls r0, 24 - cmp r0, 0 - beq _080BF810 - ldr r1, =0x00000392 - b _080BF812 - .pool -_080BF810: - ldr r1, =0x000002af -_080BF812: - mov r0, sp - strh r1, [r0] - mov r0, sp - movs r1, 0x5D - movs r2, 0x2 - bl gpu_pal_apply - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BF7FC - - thumb_func_start sub_80BF82C -sub_80BF82C: @ 80BF82C - push {r4-r7,lr} - sub sp, 0x44 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r5, r1, 0 - cmp r0, 0x9 - bhi _080BF880 - lsls r0, 2 - ldr r1, =_080BF858 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080BF858: - .4byte _080BF880 - .4byte _080BF8D8 - .4byte _080BF910 - .4byte _080BF93C - .4byte _080BF97C - .4byte _080BF982 - .4byte _080BFA34 - .4byte _080BFAE8 - .4byte _080BFB14 - .4byte _080BFB64 -_080BF880: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080BF88E - b _080BFB94 -_080BF88E: - ldr r4, =0x02039b4c - ldr r0, [r4] - ldr r1, =0x0000064a - adds r0, r1 - movs r1, 0x7 - strb r1, [r0] - ldr r1, =0x030060b4 - ldr r0, [r5, 0xC] - str r0, [r1] - movs r0, 0 - bl SetVBlankCallback - movs r0, 0x80 - lsls r0, 2 - bl sub_80C09B0 - ldr r0, [r4] - ldr r2, =0x0000064d - adds r0, r2 - movs r1, 0x2 - strb r1, [r0] - movs r0, 0x87 - lsls r0, 3 - adds r1, r5, r0 - movs r0, 0x1 - strb r0, [r1] - b _080BFB94 - .pool -_080BF8D8: - ldr r1, =gUnknown_08DC1934 - movs r2, 0x80 - lsls r2, 6 - movs r0, 0 - str r0, [sp] - movs r0, 0x3 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_08DC2E6C - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - bl PutWindowTilemap - b _080BFB4E - .pool -_080BF910: - movs r0, 0xD - bl sub_80BFCF4 - movs r0, 0x2 - movs r1, 0xD - bl sub_80BFD7C - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000064c - adds r0, r1 - ldrb r0, [r0] - lsls r0, 31 - lsrs r0, 31 - bl sub_80BC844 - b _080BFB4E - .pool -_080BF93C: - ldr r1, =gUnknown_085E8723 - add r0, sp, 0x4 - bl CopyString - ldr r0, =0x03005d90 - ldr r1, [r0] - add r0, sp, 0x4 - bl AppendString - movs r0, 0x1 - add r1, sp, 0x4 - movs r2, 0xF0 - bl GetStringCenterAlignXOffset - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - add r0, sp, 0x4 - movs r2, 0x79 - bl sub_80BE8DC - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _080BFB56 - .pool -_080BF97C: - bl sub_80A1A74 - b _080BFB4E -_080BF982: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - bl sub_806F000 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x98 - movs r2, 0x38 - movs r3, 0 - bl sub_80C0EF8 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x02020630 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - adds r4, r0 - ldrb r1, [r4, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r1, [r4, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4, 0x3] - ldrb r1, [r4, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x5] - ldr r2, =gPokedexEntries - ldr r0, =0x02039b54 - ldr r1, [r0] - ldrh r0, [r1] - lsls r0, 5 - adds r0, r2 - ldrh r0, [r0, 0x1C] - strh r0, [r4, 0x26] - ldrh r0, [r1] - lsls r0, 5 - adds r0, r2 - ldrh r1, [r0, 0x1A] - str r1, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - ldr r0, =gUnknown_0856E610 - ldrb r1, [r4, 0x5] - lsrs r1, 4 - adds r1, 0x10 - lsls r1, 4 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - strh r6, [r0, 0x12] - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _080BFB56 - .pool -_080BFA34: - ldr r5, =0x02039b54 - ldr r0, [r5] - ldrh r0, [r0] - movs r1, 0x58 - movs r2, 0x38 - movs r3, 0x1 - bl sub_80C0E9C - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x02020630 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - adds r4, r0 - ldrb r1, [r4, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r1, [r4, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4, 0x3] - ldrb r1, [r4, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x5] - ldr r2, =gPokedexEntries - ldr r1, [r5] - ldrh r0, [r1] - lsls r0, 5 - adds r0, r2 - ldrh r0, [r0, 0x18] - strh r0, [r4, 0x26] - ldrh r0, [r1] - lsls r0, 5 - adds r0, r2 - ldrh r1, [r0, 0x16] - str r1, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - ldr r0, =gUnknown_0856E610 - ldrb r1, [r4, 0x5] - lsrs r1, 4 - adds r1, 0x10 - lsls r1, 4 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - strh r6, [r0, 0x10] - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - b _080BFB4E - .pool -_080BFAE8: - movs r0, 0x15 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =0x030060b4 - ldr r0, [r0] - bl SetVBlankCallback - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _080BFB56 - .pool -_080BFB14: - 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 r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl HideBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg -_080BFB4E: - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_080BFB56: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080BFB94 - .pool -_080BFB64: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - bne _080BFB94 - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000064e - adds r0, r1 - strb r2, [r0] - movs r1, 0x87 - lsls r1, 3 - adds r0, r5, r1 - strb r2, [r0] - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80BFBB0 - str r1, [r0] -_080BFB94: - add sp, 0x44 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BF82C - - thumb_func_start sub_80BFBB0 -sub_80BFBB0: @ 80BFBB0 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0 - beq _080BFC10 - movs r0, 0x15 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000064e - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80BFC78 - str r1, [r0] - movs r0, 0x3 - bl audio_play - b _080BFC5C - .pool -_080BFC10: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _080BFC2C - movs r0, 0x80 - lsls r0, 2 - ands r0, r1 - cmp r0, 0 - beq _080BFC5C - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0x1 - bne _080BFC5C -_080BFC2C: - movs r0, 0x15 - negs r0, r0 - str r2, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000064e - adds r0, r1 - movs r1, 0x2 - strb r1, [r0] - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80BFC78 - str r1, [r0] - movs r0, 0x6D - bl audio_play -_080BFC5C: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BFBB0 - - thumb_func_start sub_80BFC78 -sub_80BFC78: @ 80BFC78 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080BFCD0 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x10] - bl sub_818D820 - ldrh r0, [r4, 0x12] - bl sub_818D8F0 - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000064e - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080BFCB2 - cmp r0, 0x2 - beq _080BFCCC -_080BFCB2: - ldr r0, =sub_80BEA24 - b _080BFCCE - .pool -_080BFCCC: - ldr r0, =sub_80BF250 -_080BFCCE: - str r0, [r4] -_080BFCD0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BFC78 - - thumb_func_start sub_80BFCDC -sub_80BFCDC: @ 80BFCDC - push {lr} - ldr r1, =gUnknown_08DC2F5C - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BFCDC - - thumb_func_start sub_80BFCF4 -sub_80BFCF4: @ 80BFCF4 - push {lr} - ldr r1, =gUnknown_08DC2FEC - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BFCF4 - - thumb_func_start sub_80BFD0C -sub_80BFD0C: @ 80BFD0C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r0, 0x1 - bl GetBgTilemapBuffer - adds r7, r0, 0 - movs r1, 0 -_080BFD22: - lsls r0, r1, 3 - subs r0, r1 - adds r0, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - movs r3, 0x80 - lsls r3, 7 - cmp r1, r8 - bne _080BFD38 - movs r3, 0x80 - lsls r3, 6 -_080BFD38: - movs r2, 0 - adds r6, r1, 0x1 - ldr r4, =0x00000fff -_080BFD3E: - adds r1, r5, r2 - lsls r1, 1 - adds r1, r7 - ldrh r0, [r1] - ands r0, r4 - orrs r0, r3 - strh r0, [r1] - adds r1, 0x40 - ldrh r0, [r1] - ands r0, r4 - orrs r0, r3 - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x6 - bls _080BFD3E - lsls r0, r6, 24 - lsrs r1, r0, 24 - cmp r1, 0x3 - bls _080BFD22 - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BFD0C - - thumb_func_start sub_80BFD7C -sub_80BFD7C: @ 80BFD7C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r0, 0x1 - bl GetBgTilemapBuffer - adds r7, r0, 0 - movs r1, 0 -_080BFD92: - lsls r0, r1, 3 - subs r0, r1 - adds r0, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r1, r8 - beq _080BFDA4 - cmp r1, 0x3 - bne _080BFDAA -_080BFDA4: - movs r3, 0x80 - lsls r3, 6 - b _080BFDAE -_080BFDAA: - movs r3, 0x80 - lsls r3, 7 -_080BFDAE: - movs r2, 0 - adds r5, r1, 0x1 - ldr r4, =0x00000fff -_080BFDB4: - adds r1, r6, r2 - lsls r1, 1 - adds r1, r7 - ldrh r0, [r1] - ands r0, r4 - orrs r0, r3 - strh r0, [r1] - adds r1, 0x40 - ldrh r0, [r1] - ands r0, r4 - orrs r0, r3 - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x6 - bls _080BFDB4 - lsls r0, r5, 24 - lsrs r1, r0, 24 - cmp r1, 0x3 - bls _080BFD92 - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BFD7C - - thumb_func_start sub_80BFDF4 -sub_80BFDF4: @ 80BFDF4 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =sub_80BFE38 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0 - strh r2, [r1, 0x8] - strh r4, [r1, 0xA] - strh r5, [r1, 0x20] - lsrs r5, 16 - strh r5, [r1, 0x22] - strh r6, [r1, 0x24] - lsrs r6, 16 - strh r6, [r1, 0x26] - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80BFDF4 - - thumb_func_start sub_80BFE38 -sub_80BFE38: @ 80BFE38 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldrh r4, [r0, 0xA] - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r2, r1, 0 - cmp r0, 0x6 - bhi _080BFE84 - lsls r0, 2 - ldr r1, =_080BFE68 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080BFE68: - .4byte _080BFE84 - .4byte _080BFF0C - .4byte _080BFF78 - .4byte _080BFF82 - .4byte _080BFFA8 - .4byte _080C0000 - .4byte _080C0044 -_080BFE84: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080BFE92 - b _080C0074 -_080BFE92: - ldr r1, =0x030060b4 - ldr r0, =0x030022c0 - ldr r0, [r0, 0xC] - str r0, [r1] - movs r0, 0 - bl SetVBlankCallback - movs r0, 0x80 - lsls r0, 1 - bl sub_80C09B0 - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0856E668 - movs r0, 0 - movs r2, 0x2 - bl InitBgsFromTemplates - movs r4, 0x80 - lsls r4, 4 - adds r0, r4, 0 - bl AllocZeroed - adds r1, r0, 0 - movs r0, 0x3 - bl SetBgTilemapBuffer - adds r0, r4, 0 - bl AllocZeroed - adds r1, r0, 0 - movs r0, 0x2 - bl SetBgTilemapBuffer - ldr r0, =gUnknown_0856E670 - bl InitWindows - bl DeactivateAllTextPrinters - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1 - strh r1, [r0, 0x8] - b _080C0074 - .pool -_080BFF0C: - ldr r1, =gUnknown_08DC1934 - movs r2, 0x80 - lsls r2, 6 - movs r0, 0 - str r0, [sp] - movs r0, 0x3 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_08DC3080 - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - bl PutWindowTilemap - movs r0, 0x1 - bl PutWindowTilemap - ldr r0, =0x03005e00 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - ldrh r1, [r4, 0xA] - movs r0, 0x1 - bl sub_80C0D30 - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram - bl sub_80A1A74 - movs r0, 0 - bl sub_80BC844 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080C0074 - .pool -_080BFF78: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r2 - b _080C0038 -_080BFF82: - bl sub_809D42C - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x1 - bl sub_80C020C - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - b _080C002E -_080BFFA8: - adds r0, r4, 0 - movs r1, 0x30 - movs r2, 0x38 - movs r3, 0 - bl sub_80C0E9C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =0x030060b4 - ldr r0, [r0] - bl SetVBlankCallback - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - strh r4, [r0, 0xE] - b _080C0038 - .pool -_080C0000: - 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 r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg -_080C002E: - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 -_080C0038: - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - b _080C0074 - .pool -_080C0044: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _080C0074 - adds r0, r4, 0 - bl NationalPokedexNumToSpecies - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - bl cry_related - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - strh r6, [r0, 0xC] - ldr r1, =sub_80C0088 - str r1, [r0] -_080C0074: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80BFE38 - - thumb_func_start sub_80C0088 -sub_80C0088: @ 80C0088 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _080C00E8 - ldr r0, =0x0000ffff - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r3, =0x02020630 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0xE - ldrsh r2, [r1, r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r3, 0x1C - adds r0, r3 - ldr r2, =sub_80C01CC - str r2, [r0] - ldr r0, =blockset_load_palette_to_gpu - str r0, [r1] - b _080C011E - .pool -_080C00E8: - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0xC] - adds r1, 0x1 - strh r1, [r0, 0xC] - movs r0, 0x10 - ands r1, r0 - cmp r1, 0 - beq _080C0114 - ldr r0, =gUnknown_08DC16F6 - movs r1, 0x31 - movs r2, 0xE - bl gpu_pal_apply - b _080C011E - .pool -_080C0114: - ldr r0, =gUnknown_08DC1756 - movs r1, 0x31 - movs r2, 0xE - bl gpu_pal_apply -_080C011E: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C0088 - - thumb_func_start blockset_load_palette_to_gpu -blockset_load_palette_to_gpu: @ 80C012C - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080C01BA - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - bl FreeAllWindowBuffers - movs r0, 0x2 - bl GetBgTilemapBuffer - cmp r0, 0 - beq _080C015A - bl Free -_080C015A: - movs r0, 0x3 - bl GetBgTilemapBuffer - cmp r0, 0 - beq _080C0168 - bl Free -_080C0168: - ldr r0, =0x03005e00 - lsls r4, r6, 2 - adds r4, r6 - lsls r4, 3 - adds r4, r0 - ldrh r0, [r4, 0xA] - bl NationalPokedexNumToSpecies - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r4, 0x22] - lsls r1, 16 - ldrh r2, [r4, 0x20] - orrs r1, r2 - ldrh r2, [r4, 0x26] - lsls r2, 16 - ldrh r3, [r4, 0x24] - orrs r2, r3 - ldr r5, =0x02020630 - movs r3, 0xE - ldrsh r4, [r4, r3] - lsls r3, r4, 4 - adds r3, r4 - lsls r3, 2 - adds r3, r5 - ldrb r4, [r3, 0x5] - lsrs r4, 4 - bl species_and_otid_get_pal - lsls r4, 4 - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - orrs r4, r1 - adds r1, r4, 0 - movs r2, 0x20 - bl decompress_palette - adds r0, r6, 0 - bl DestroyTask -_080C01BA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end blockset_load_palette_to_gpu - - thumb_func_start sub_80C01CC -sub_80C01CC: @ 80C01CC - push {lr} - adds r1, r0, 0 - ldrh r2, [r1, 0x20] - movs r3, 0x20 - ldrsh r0, [r1, r3] - cmp r0, 0x77 - bgt _080C01DE - adds r0, r2, 0x2 - strh r0, [r1, 0x20] -_080C01DE: - ldrh r2, [r1, 0x20] - movs r3, 0x20 - ldrsh r0, [r1, r3] - cmp r0, 0x78 - ble _080C01EC - subs r0, r2, 0x2 - strh r0, [r1, 0x20] -_080C01EC: - ldrh r2, [r1, 0x22] - movs r3, 0x22 - ldrsh r0, [r1, r3] - cmp r0, 0x4F - bgt _080C01FA - adds r0, r2, 0x1 - strh r0, [r1, 0x22] -_080C01FA: - ldrh r2, [r1, 0x22] - movs r3, 0x22 - ldrsh r0, [r1, r3] - cmp r0, 0x50 - ble _080C0208 - subs r0, r2, 0x1 - strh r0, [r1, 0x22] -_080C0208: - pop {r0} - bx r0 - thumb_func_end sub_80C01CC - - thumb_func_start sub_80C020C -sub_80C020C: @ 80C020C - push {r4-r7,lr} - sub sp, 0x30 - adds r6, r0, 0 - adds r5, r1, 0 - adds r7, r2, 0 - cmp r3, 0 - beq _080C0234 - ldr r4, =gUnknown_085E8735 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xF0 - bl GetStringCenterAlignXOffset - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - movs r2, 0 - bl sub_80BE8DC -_080C0234: - cmp r5, 0 - bne _080C024C - lsls r4, r6, 16 - lsrs r0, r4, 16 - bl NationalToHoennOrder - lsls r0, 16 - lsrs r5, r0, 16 - b _080C0250 - .pool -_080C024C: - adds r5, r6, 0 - lsls r4, r6, 16 -_080C0250: - ldr r1, =gUnknown_085E8D4F - mov r0, sp - bl CopyString - adds r1, r5, 0 - movs r2, 0x2 - movs r3, 0x3 - bl ConvertIntToDecimalString - mov r0, sp - movs r1, 0x60 - movs r2, 0x19 - bl sub_80BE8DC - lsrs r0, r4, 16 - bl NationalPokedexNumToSpecies - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _080C028C - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r0, r1, r0 - b _080C028E - .pool -_080C028C: - ldr r0, =gUnknown_0856E688 -_080C028E: - movs r1, 0x84 - movs r2, 0x19 - bl sub_80BE8DC - cmp r7, 0 - beq _080C02AC - add r4, sp, 0x10 - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_81DB468 - adds r0, r4, 0 - b _080C02AE - .pool -_080C02AC: - ldr r0, =gUnknown_085E86B8 -_080C02AE: - movs r1, 0x64 - movs r2, 0x29 - bl sub_80BE8DC - ldr r0, =gUnknown_085E8755 - movs r1, 0x60 - movs r2, 0x39 - bl sub_80BE8DC - ldr r0, =gUnknown_085E8758 - movs r1, 0x60 - movs r2, 0x49 - bl sub_80BE8DC - cmp r7, 0 - beq _080C02FC - ldr r0, =gPokedexEntries - lsls r4, r6, 5 - adds r4, r0 - ldrh r0, [r4, 0xC] - movs r1, 0x81 - movs r2, 0x39 - bl sub_80C0354 - ldrh r0, [r4, 0xE] - movs r1, 0x81 - movs r2, 0x49 - bl sub_80C0460 - b _080C0310 - .pool -_080C02FC: - ldr r0, =gUnknown_085E86C6 - movs r1, 0x81 - movs r2, 0x39 - bl sub_80BE8DC - ldr r0, =gUnknown_085E86D0 - movs r1, 0x81 - movs r2, 0x49 - bl sub_80BE8DC -_080C0310: - cmp r7, 0 - beq _080C032C - ldr r0, =gPokedexEntries - lsls r1, r6, 5 - adds r0, 0x10 - adds r1, r0 - ldr r4, [r1] - b _080C032E - .pool -_080C032C: - ldr r4, =gUnknown_0855D30C -_080C032E: - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xF0 - bl GetStringCenterAlignXOffset - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - movs r2, 0x5F - bl sub_80BE8DC - add sp, 0x30 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C020C - - thumb_func_start sub_80C0354 -sub_80C0354: @ 80C0354 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - lsls r0, 16 - lsrs r0, 16 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - ldr r1, =0x00002710 - muls r0, r1 - movs r1, 0xFE - bl __divsi3 - adds r7, r0, 0 - movs r1, 0xA - bl __umodsi3 - cmp r0, 0x4 - bls _080C0386 - adds r7, 0xA -_080C0386: - adds r0, r7, 0 - movs r1, 0x78 - bl __udivsi3 - adds r6, r0, 0 - lsls r0, r6, 4 - subs r0, r6 - lsls r0, 3 - subs r0, r7, r0 - movs r1, 0xA - bl __udivsi3 - adds r7, r0, 0 - mov r1, sp - movs r0, 0xFC - strb r0, [r1] - adds r1, 0x1 - movs r0, 0x13 - strb r0, [r1] - adds r0, r6, 0 - movs r1, 0xA - bl __udivsi3 - adds r2, r0, 0 - cmp r2, 0 - bne _080C03D4 - mov r1, sp - adds r1, 0x2 - movs r0, 0x12 - strb r0, [r1] - movs r5, 0x4 - adds r1, 0x1 - adds r0, r6, 0 - adds r0, 0xA1 - strb r0, [r1] - b _080C03F4 - .pool -_080C03D4: - mov r1, sp - adds r1, 0x2 - movs r0, 0xC - strb r0, [r1] - adds r1, 0x1 - adds r0, r2, 0 - adds r0, 0xA1 - strb r0, [r1] - movs r5, 0x5 - add r4, sp, 0x4 - adds r0, r6, 0 - movs r1, 0xA - bl __umodsi3 - adds r0, 0xA1 - strb r0, [r4] -_080C03F4: - adds r1, r5, 0 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r2, r5, 0 - add r1, sp - movs r0, 0xB4 - strb r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - mov r0, sp - adds r4, r0, r2 - adds r0, r7, 0 - movs r1, 0xA - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r4] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - mov r1, sp - adds r4, r1, r6 - adds r0, r7, 0 - movs r1, 0xA - bl __umodsi3 - adds r0, 0xA1 - strb r0, [r4] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - adds r2, r1, r5 - movs r1, 0xB2 - strb r1, [r2] - mov r2, sp - adds r1, r2, r0 - movs r0, 0xFF - strb r0, [r1] - mov r0, sp - mov r1, r9 - mov r2, r8 - bl sub_80BE8DC - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80C0354 - - thumb_func_start sub_80C0460 -sub_80C0460: @ 80C0460 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - lsls r0, 16 - lsrs r0, 16 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x10] - ldr r5, =0x000186a0 - muls r0, r5 - ldr r1, =0x000011b8 - bl __divsi3 - adds r7, r0, 0 - movs r1, 0xA - bl __umodsi3 - cmp r0, 0x4 - bls _080C0494 - adds r7, 0xA -_080C0494: - movs r0, 0 - mov r8, r0 - mov r4, sp - adds r0, r7, 0 - adds r1, r5, 0 - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r4] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xA1 - bne _080C04C0 - movs r6, 0x1 - mov r1, sp - movs r0, 0x77 - strb r0, [r1] - b _080C04C6 - .pool -_080C04C0: - movs r1, 0x1 - mov r8, r1 - movs r6, 0x1 -_080C04C6: - ldr r1, =0x000186a0 - adds r0, r7, 0 - bl __umodsi3 - adds r7, r0, 0 - mov r4, sp - adds r4, 0x1 - ldr r1, =0x00002710 - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r4] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xA1 - bne _080C0504 - mov r2, r8 - cmp r2, 0 - bne _080C0504 - adds r1, r6, 0 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - add r1, sp - movs r0, 0x77 - strb r0, [r1] - b _080C050E - .pool -_080C0504: - movs r3, 0x1 - mov r8, r3 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_080C050E: - ldr r1, =0x00002710 - adds r0, r7, 0 - bl __umodsi3 - adds r7, r0, 0 - mov r0, sp - adds r4, r0, r6 - movs r1, 0xFA - lsls r1, 2 - adds r0, r7, 0 - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r4] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xA1 - bne _080C054C - mov r1, r8 - cmp r1, 0 - bne _080C054C - adds r1, r6, 0 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - add r1, sp - movs r0, 0x77 - strb r0, [r1] - b _080C0552 - .pool -_080C054C: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_080C0552: - movs r1, 0xFA - lsls r1, 2 - adds r0, r7, 0 - bl __umodsi3 - adds r7, r0, 0 - adds r1, r6, 0 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r5, r6, 0 - mov r2, sp - adds r4, r2, r1 - adds r0, r7, 0 - movs r1, 0x64 - bl __udivsi3 - adds r0, 0xA1 - movs r3, 0 - mov r9, r3 - strb r0, [r4] - adds r0, r7, 0 - movs r1, 0x64 - bl __umodsi3 - adds r7, r0, 0 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r1, r6, 0 - mov r2, sp - adds r0, r2, r5 - movs r3, 0xAD - mov r8, r3 - mov r2, r8 - strb r2, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r5, r6, 0 - mov r3, sp - adds r4, r3, r1 - adds r0, r7, 0 - movs r1, 0xA - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r4] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r1, r6, 0 - mov r2, sp - adds r0, r2, r5 - mov r3, r9 - strb r3, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r2, r6, 0 - add r1, sp - movs r0, 0xE0 - strb r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r3, r6, 0 - mov r0, sp - adds r1, r0, r2 - movs r0, 0xD6 - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r2, r6, 0 - mov r0, sp - adds r1, r0, r3 - movs r0, 0xE7 - strb r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r3, sp - adds r1, r3, r2 - mov r2, r8 - strb r2, [r1] - adds r1, r3, r0 - movs r0, 0xFF - strb r0, [r1] - mov r0, sp - mov r1, r10 - ldr r2, [sp, 0x10] - bl sub_80BE8DC - 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_80C0460 - - thumb_func_start sub_80C0620 -sub_80C0620: @ 80C0620 - lsls r0, 16 - lsrs r0, 11 - ldr r1, =gPokedexEntries - adds r0, r1 - bx lr - .pool - thumb_func_end sub_80C0620 - - thumb_func_start sub_80C0630 -sub_80C0630: @ 80C0630 - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0 - beq _080C0646 - cmp r1, 0x1 - beq _080C0654 - movs r0, 0x1 - b _080C065C -_080C0646: - ldr r0, =gPokedexEntries - lsls r1, r2, 5 - adds r1, r0 - ldrh r0, [r1, 0xC] - b _080C065C - .pool -_080C0654: - ldr r0, =gPokedexEntries - lsls r1, r2, 5 - adds r1, r0 - ldrh r0, [r1, 0xE] -_080C065C: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C0630 - - thumb_func_start pokedex_flag_operation -@ u8 pokedex_flag_operation(u16 nationalPokedexNum, u8 op) -pokedex_flag_operation: @ 80C0664 - push {r4-r7,lr} - lsls r0, 16 - lsls r1, 24 - lsrs r2, r1, 24 - adds r3, r2, 0 - ldr r1, =0xffff0000 - adds r0, r1 - lsrs r1, r0, 16 - lsrs r0, 19 - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x7 - ands r1, r0 - movs r0, 0x80 - lsls r0, 17 - lsls r0, r1 - lsrs r5, r0, 24 - movs r6, 0 - cmp r2, 0x1 - beq _080C06FC - cmp r2, 0x1 - bgt _080C069C - cmp r2, 0 - beq _080C06AA - b _080C07E8 - .pool -_080C069C: - cmp r3, 0x2 - bne _080C06A2 - b _080C079C -_080C06A2: - cmp r3, 0x3 - bne _080C06A8 - b _080C07D8 -_080C06A8: - b _080C07E8 -_080C06AA: - ldr r1, =0x03005d90 - ldr r0, [r1] - adds r0, 0x5C - adds r0, r4 - ldrb r2, [r0] - ands r2, r5 - adds r7, r1, 0 - cmp r2, 0 - bne _080C06BE - b _080C07E8 -_080C06BE: - ldr r0, =0x03005d8c - ldr r3, [r0] - ldr r6, =0x00000988 - adds r1, r3, r6 - adds r1, r4 - ldrb r1, [r1] - ands r1, r5 - adds r6, r0, 0 - cmp r2, r1 - bne _080C06E0 - ldr r1, =0x00003b24 - adds r0, r3, r1 - adds r0, r4 - ldrb r0, [r0] - ands r0, r5 - cmp r2, r0 - beq _080C073E -_080C06E0: - ldr r1, [r7] - adds r1, 0x5C - adds r1, r4 - mvns r3, r5 - b _080C076A - .pool -_080C06FC: - ldr r1, =0x03005d90 - ldr r3, [r1] - adds r0, r3, 0 - adds r0, 0x28 - adds r0, r4 - ldrb r2, [r0] - ands r2, r5 - adds r7, r1, 0 - cmp r2, 0 - beq _080C07E8 - adds r0, r3, 0 - adds r0, 0x5C - adds r0, r4 - ldrb r0, [r0] - ands r0, r5 - ldr r6, =0x03005d8c - cmp r2, r0 - bne _080C0754 - ldr r1, [r6] - ldr r3, =0x00000988 - adds r0, r1, r3 - adds r0, r4 - ldrb r0, [r0] - ands r0, r5 - cmp r2, r0 - bne _080C0754 - ldr r3, =0x00003b24 - adds r0, r1, r3 - adds r0, r4 - ldrb r0, [r0] - ands r0, r5 - cmp r2, r0 - bne _080C0754 -_080C073E: - movs r6, 0x1 - b _080C07E8 - .pool -_080C0754: - ldr r1, [r7] - adds r1, 0x28 - adds r1, r4 - mvns r3, r5 - ldrb r2, [r1] - adds r0, r3, 0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r7] - adds r1, 0x5C - adds r1, r4 -_080C076A: - ldrb r2, [r1] - adds r0, r3, 0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r6] - ldr r0, =0x00000988 - adds r1, r0 - adds r1, r4 - ldrb r2, [r1] - adds r0, r3, 0 - ands r0, r2 - strb r0, [r1] - ldr r0, [r6] - ldr r1, =0x00003b24 - adds r0, r1 - adds r0, r4 - ldrb r1, [r0] - ands r3, r1 - strb r3, [r0] - movs r6, 0 - b _080C07E8 - .pool -_080C079C: - ldr r0, =0x03005d90 - ldr r1, [r0] - adds r1, 0x5C - adds r1, r4 - ldrb r2, [r1] - adds r0, r5, 0 - orrs r0, r2 - strb r0, [r1] - ldr r3, =0x03005d8c - ldr r1, [r3] - ldr r0, =0x00000988 - adds r1, r0 - adds r1, r4 - ldrb r2, [r1] - adds r0, r5, 0 - orrs r0, r2 - strb r0, [r1] - ldr r1, [r3] - ldr r3, =0x00003b24 - adds r1, r3 - b _080C07DE - .pool -_080C07D8: - ldr r0, =0x03005d90 - ldr r1, [r0] - adds r1, 0x28 -_080C07DE: - adds r1, r4 - ldrb r2, [r1] - adds r0, r5, 0 - orrs r0, r2 - strb r0, [r1] -_080C07E8: - adds r0, r6, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end pokedex_flag_operation - - thumb_func_start pokedex_count -pokedex_count: @ 80C07F4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - movs r0, 0 - ldr r7, =0x00000181 -_080C0800: - cmp r6, 0 - beq _080C0810 - cmp r6, 0x1 - beq _080C081A - adds r4, r0, 0x1 - b _080C0832 - .pool -_080C0810: - adds r4, r0, 0x1 - lsls r0, r4, 16 - lsrs r0, 16 - movs r1, 0 - b _080C0822 -_080C081A: - adds r4, r0, 0x1 - lsls r0, r4, 16 - lsrs r0, 16 - movs r1, 0x1 -_080C0822: - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _080C0832 - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_080C0832: - lsls r0, r4, 16 - lsrs r0, 16 - cmp r0, r7 - bls _080C0800 - adds r0, r5, 0 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end pokedex_count - - thumb_func_start sub_80C0844 -sub_80C0844: @ 80C0844 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - movs r0, 0 -_080C084E: - cmp r6, 0 - beq _080C085A - cmp r6, 0x1 - beq _080C086C - adds r4, r0, 0x1 - b _080C088C -_080C085A: - adds r4, r0, 0x1 - lsls r0, r4, 16 - lsrs r0, 16 - bl HoennToNationalOrder - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - b _080C087C -_080C086C: - adds r4, r0, 0x1 - lsls r0, r4, 16 - lsrs r0, 16 - bl HoennToNationalOrder - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 -_080C087C: - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _080C088C - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_080C088C: - lsls r0, r4, 16 - lsrs r0, 16 - cmp r0, 0xC9 - bls _080C084E - adds r0, r5, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80C0844 - - thumb_func_start sub_80C089C -sub_80C089C: @ 80C089C - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - movs r0, 0 -_080C08A6: - cmp r6, 0 - beq _080C08B2 - cmp r6, 0x1 - beq _080C08BC - adds r4, r0, 0x1 - b _080C08D4 -_080C08B2: - adds r4, r0, 0x1 - lsls r0, r4, 16 - lsrs r0, 16 - movs r1, 0 - b _080C08C4 -_080C08BC: - adds r4, r0, 0x1 - lsls r0, r4, 16 - lsrs r0, 16 - movs r1, 0x1 -_080C08C4: - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _080C08D4 - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_080C08D4: - lsls r0, r4, 16 - lsrs r0, 16 - cmp r0, 0x96 - bls _080C08A6 - adds r0, r5, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80C089C - - thumb_func_start sub_80C08E4 -sub_80C08E4: @ 80C08E4 - push {r4,lr} - movs r0, 0 -_080C08E8: - adds r0, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl HoennToNationalOrder - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - bne _080C0908 - movs r0, 0 - b _080C0910 -_080C0908: - adds r0, r4, 0 - cmp r0, 0xC7 - bls _080C08E8 - movs r0, 0x1 -_080C0910: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80C08E4 - - thumb_func_start sub_80C0918 -sub_80C0918: @ 80C0918 - push {r4,lr} - movs r0, 0 -_080C091C: - adds r0, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - bne _080C0934 - movs r0, 0 - b _080C093C -_080C0934: - adds r0, r4, 0 - cmp r0, 0x95 - bls _080C091C - movs r0, 0x1 -_080C093C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80C0918 - - thumb_func_start sub_80C0944 -sub_80C0944: @ 80C0944 - push {r4,r5,lr} - movs r0, 0 -_080C0948: - adds r0, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _080C0996 - adds r0, r4, 0 - cmp r0, 0x95 - bls _080C0948 - movs r0, 0x97 -_080C0964: - adds r0, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _080C0996 - adds r0, r4, 0 - cmp r0, 0xF7 - bls _080C0964 - movs r0, 0xFB - ldr r5, =0x0000017f -_080C0982: - adds r0, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - bne _080C09A0 -_080C0996: - movs r0, 0 - b _080C09A8 - .pool -_080C09A0: - adds r0, r4, 0 - cmp r0, r5 - bls _080C0982 - movs r0, 0x1 -_080C09A8: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80C0944 - - thumb_func_start sub_80C09B0 -sub_80C09B0: @ 80C09B0 - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - movs r1, 0x80 - lsls r1, 1 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - bne _080C09E2 - movs r0, 0 - bl ClearGpuRegBits - movs r0, 0x8 - movs r1, 0 - bl SetGpuReg - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg -_080C09E2: - movs r1, 0x80 - lsls r1, 2 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - bne _080C0A0C - movs r0, 0 - bl ClearGpuRegBits - movs r0, 0xA - movs r1, 0 - bl SetGpuReg - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg -_080C0A0C: - movs r1, 0x80 - lsls r1, 3 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - bne _080C0A36 - movs r0, 0 - bl ClearGpuRegBits - movs r0, 0xC - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg -_080C0A36: - movs r1, 0x80 - lsls r1, 4 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - bne _080C0A60 - movs r0, 0 - bl ClearGpuRegBits - movs r0, 0xE - movs r1, 0 - bl SetGpuReg - movs r0, 0x1C - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg -_080C0A60: - movs r1, 0x80 - lsls r1, 5 - ands r5, r1 - cmp r5, 0 - bne _080C0A7E - movs r0, 0 - bl ClearGpuRegBits - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - ldr r1, =0x0300301c - movs r0, 0x8 - strb r0, [r1] -_080C0A7E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C09B0 - - thumb_func_start sub_80C0A88 -sub_80C0A88: @ 80C0A88 - push {r4-r6,lr} - sub sp, 0x18 - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - add r4, sp, 0x14 - movs r6, 0 - strb r6, [r4] - adds r5, r4, 0 - movs r4, 0xF - strb r4, [r5, 0x1] - movs r4, 0x3 - strb r4, [r5, 0x2] - str r6, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - subs r4, 0x4 - str r4, [sp, 0xC] - str r1, [sp, 0x10] - movs r1, 0x1 - bl AddTextPrinterParametrized2 - add sp, 0x18 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80C0A88 - - thumb_func_start sub_80C0AC4 -sub_80C0AC4: @ 80C0AC4 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r6, r0, 0 - adds r4, r1, 0 - mov r8, r2 - mov r9, r3 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - mov r5, sp - adds r0, r4, 0 - movs r1, 0x64 - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r5] - mov r5, sp - adds r0, r4, 0 - movs r1, 0x64 - bl __umodsi3 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r4, 0 - movs r1, 0xA - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r5, 0x1] - mov r5, sp - adds r0, r4, 0 - movs r1, 0xA - bl __umodsi3 - adds r0, 0xA1 - strb r0, [r5, 0x2] - mov r1, sp - movs r0, 0xFF - strb r0, [r1, 0x3] - adds r0, r6, 0 - mov r2, r8 - mov r3, r9 - bl sub_80C0A88 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80C0AC4 - - thumb_func_start sub_80C0B44 -sub_80C0B44: @ 80C0B44 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 16 - lsrs r5, r1, 16 - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r6, r3, 24 - movs r4, 0 - movs r2, 0xFF -_080C0B62: - mov r1, sp - adds r0, r1, r4 - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xA - bls _080C0B62 - adds r0, r5, 0 - bl NationalPokedexNumToSpecies - adds r5, r0, 0 - cmp r5, 0 - beq _080C0BC0 - movs r4, 0 - ldr r2, =gSpeciesNames - movs r0, 0xB - adds r1, r5, 0 - muls r1, r0 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0xFF - beq _080C0BD4 - adds r3, r2, 0 - adds r2, r1, 0 -_080C0B98: - mov r0, sp - adds r1, r0, r4 - adds r0, r4, r2 - adds r0, r3 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, r2 - adds r0, r3 - ldrb r0, [r0] - cmp r0, 0xFF - beq _080C0BD4 - cmp r4, 0x9 - bls _080C0B98 - b _080C0BD4 - .pool -_080C0BC0: - movs r4, 0 - movs r1, 0xAE -_080C0BC4: - mov r2, sp - adds r0, r2, r4 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _080C0BC4 -_080C0BD4: - mov r0, r8 - mov r1, sp - adds r2, r7, 0 - adds r3, r6, 0 - bl sub_80C0A88 - adds r0, r4, 0 - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80C0B44 - - thumb_func_start sub_80C0BF0 -sub_80C0BF0: @ 80C0BF0 - push {r4-r7,lr} - sub sp, 0xC - adds r4, r1, 0 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r2, 24 - lsrs r2, 24 - mov r12, r2 - lsls r3, 24 - lsrs r5, r3, 24 - movs r2, 0 - movs r1, 0 -_080C0C08: - mov r3, sp - adds r0, r3, r2 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xA - bls _080C0C08 - movs r3, 0 - ldrb r0, [r4] - cmp r0, 0 - beq _080C0C32 -_080C0C20: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - adds r0, r4, r3 - ldrb r0, [r0] - cmp r0, 0 - beq _080C0C32 - cmp r3, 0xA - bls _080C0C20 -_080C0C32: - movs r2, 0 - cmp r2, r3 - bcs _080C0C52 -_080C0C38: - adds r0, r2, 0 - adds r0, 0xB - subs r0, r3 - mov r7, sp - adds r1, r7, r0 - adds r0, r4, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r3 - bcc _080C0C38 -_080C0C52: - mov r1, sp - movs r0, 0xFF - strb r0, [r1, 0xB] - adds r0, r6, 0 - mov r2, r12 - adds r3, r5, 0 - bl sub_80C0A88 - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80C0BF0 - - thumb_func_start sub_80C0C6C -sub_80C0C6C: @ 80C0C6C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r6, r3, 24 - movs r5, 0 - movs r1, 0xFA - lsls r1, 2 - adds r0, r4, 0 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _080C0CA2 - mov r1, sp - movs r0, 0x77 - strb r0, [r1] - b _080C0CAA -_080C0CA2: - mov r1, sp - adds r0, 0xA1 - strb r0, [r1] - movs r5, 0x1 -_080C0CAA: - movs r1, 0xFA - lsls r1, 2 - adds r0, r4, 0 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _080C0CD0 - cmp r5, 0 - bne _080C0CD0 - mov r1, sp - movs r0, 0x77 - b _080C0CD4 -_080C0CD0: - mov r1, sp - adds r0, 0xA1 -_080C0CD4: - strb r0, [r1, 0x1] - mov r5, sp - movs r1, 0xFA - lsls r1, 2 - adds r0, r4, 0 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r4, 0 - movs r1, 0xA - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r5, 0x2] - mov r1, sp - movs r0, 0xAD - strb r0, [r1, 0x3] - mov r5, sp - adds r0, r4, 0 - movs r1, 0xA - bl __umodsi3 - adds r0, 0xA1 - strb r0, [r5, 0x4] - mov r1, sp - movs r0, 0xFF - strb r0, [r1, 0x5] - mov r0, r8 - adds r2, r7, 0 - adds r3, r6, 0 - bl sub_80C0A88 - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80C0C6C - - thumb_func_start sub_80C0D30 -sub_80C0D30: @ 80C0D30 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x80 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 16 - lsrs r1, 16 - ldr r4, =gMonFootprintTable - adds r0, r1, 0 - bl NationalPokedexNumToSpecies - lsls r0, 16 - lsrs r0, 14 - adds r0, r4 - ldr r0, [r0] - mov r12, r0 - movs r5, 0 - movs r1, 0 - movs r7, 0x2 -_080C0D5A: - mov r2, r12 - adds r0, r2, r1 - ldrb r3, [r0] - movs r4, 0 - adds r6, r1, 0x1 -_080C0D64: - lsls r2, r4, 1 - adds r1, r3, 0 - asrs r1, r2 - movs r0, 0x1 - ands r1, r0 - negs r0, r1 - orrs r0, r1 - asrs r1, r0, 31 - ands r1, r7 - adds r0, r7, 0 - lsls r0, r2 - ands r0, r3 - cmp r0, 0 - beq _080C0D84 - movs r0, 0x20 - orrs r1, r0 -_080C0D84: - mov r2, sp - adds r0, r2, r5 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x3 - bls _080C0D64 - lsls r0, r6, 16 - lsrs r1, r0, 16 - cmp r1, 0x1F - bls _080C0D5A - mov r0, r8 - mov r1, sp - movs r2, 0x80 - movs r3, 0 - bl CopyToWindowPixelBuffer - add sp, 0x80 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C0D30 - - thumb_func_start sub_80C0DC0 -sub_80C0DC0: @ 80C0DC0 - push {r4,lr} - lsls r0, 16 - lsls r1, 16 - lsrs r1, 16 - lsrs r0, 5 - ldr r2, =0x06000232 - adds r3, r0, r2 - movs r4, 0xF0 - lsls r4, 8 - adds r2, r1, r4 - strh r2, [r3] - ldr r2, =0x06000234 - adds r3, r0, r2 - adds r4, 0x1 - adds r2, r1, r4 - strh r2, [r3] - ldr r2, =0x06000272 - adds r3, r0, r2 - adds r4, 0x1 - adds r2, r1, r4 - strh r2, [r3] - ldr r2, =0x06000274 - adds r0, r2 - adds r4, 0x1 - adds r1, r4 - strh r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C0DC0 - - thumb_func_start sub_80C0E0C -sub_80C0E0C: @ 80C0E0C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - lsls r1, 16 - lsrs r0, r1, 16 - lsls r2, 16 - lsrs r2, 16 - lsls r3, 16 - lsrs r3, 16 - cmp r4, 0x1 - beq _080C0E38 - cmp r4, 0x1 - bgt _080C0E2E - cmp r4, 0 - beq _080C0E40 - b _080C0E60 -_080C0E2E: - cmp r5, 0x2 - beq _080C0E52 - cmp r5, 0x3 - beq _080C0E46 - b _080C0E60 -_080C0E38: - cmp r0, r2 - bls _080C0E60 - subs r0, 0x1 - b _080C0E58 -_080C0E40: - cmp r0, r3 - bcs _080C0E60 - b _080C0E56 -_080C0E46: - cmp r0, r2 - bls _080C0E4E - subs r0, 0x1 - b _080C0E58 -_080C0E4E: - adds r0, r3, 0 - b _080C0E60 -_080C0E52: - cmp r0, r3 - bcs _080C0E5E -_080C0E56: - adds r0, 0x1 -_080C0E58: - lsls r0, 16 - lsrs r0, 16 - b _080C0E60 -_080C0E5E: - adds r0, r2, 0 -_080C0E60: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80C0E0C - - thumb_func_start sub_80C0E68 -sub_80C0E68: @ 80C0E68 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0xC9 - beq _080C0E88 - movs r0, 0x9A - lsls r0, 1 - cmp r1, r0 - bne _080C0E94 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r0, [r0, 0x20] - b _080C0E96 - .pool -_080C0E88: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r0, [r0, 0x1C] - b _080C0E96 - .pool -_080C0E94: - movs r0, 0 -_080C0E96: - pop {r1} - bx r1 - thumb_func_end sub_80C0E68 - - thumb_func_start sub_80C0E9C -sub_80C0E9C: @ 80C0E9C - push {r4-r6,lr} - sub sp, 0x14 - adds r4, r1, 0 - adds r5, r2, 0 - adds r6, r3, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 16 - lsrs r6, 16 - bl NationalPokedexNumToSpecies - adds r1, r0, 0 - adds r0, r1, 0 - str r1, [sp, 0x10] - bl sub_80C0E68 - adds r2, r0, 0 - lsls r4, 16 - asrs r4, 16 - str r4, [sp] - lsls r5, 16 - asrs r5, 16 - str r5, [sp, 0x4] - lsls r6, 24 - lsrs r6, 24 - str r6, [sp, 0x8] - ldr r0, =0x0000ffff - str r0, [sp, 0xC] - ldr r1, [sp, 0x10] - adds r0, r1, 0 - movs r1, 0x8 - movs r3, 0x1 - bl sub_818D7D8 - lsls r0, 16 - lsrs r0, 16 - add sp, 0x14 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C0E9C - - thumb_func_start sub_80C0EF8 -sub_80C0EF8: @ 80C0EF8 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r1, 0 - adds r5, r2, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp] - ldr r1, =0x0000ffff - str r1, [sp, 0x4] - movs r1, 0x1 - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_818D8AC - lsls r0, 16 - lsrs r0, 16 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C0EF8 - - thumb_func_start sub_80C0F30 -sub_80C0F30: @ 80C0F30 - 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 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x4] - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x8] - lsls r5, 24 - lsrs r5, 24 - mov r10, r5 - bl sub_80BC8D4 - movs r5, 0 - movs r6, 0 - ldr r4, =0x00000181 - ldr r3, =0x02039b4c -_080C0F6A: - ldr r2, [r3] - lsls r0, r5, 2 - adds r1, r2, r0 - ldrb r0, [r1, 0x2] - lsls r0, 31 - cmp r0, 0 - beq _080C0F86 - lsls r0, r6, 2 - adds r0, r2, r0 - ldr r1, [r1] - str r1, [r0] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 -_080C0F86: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, r4 - bls _080C0F6A - ldr r1, =0x02039b4c - ldr r0, [r1] - ldr r2, =0x0000060c - adds r0, r2 - adds r1, r6, 0 - strh r6, [r0] - cmp r7, 0xFF - beq _080C103C - movs r5, 0 - lsls r0, r1, 16 - movs r6, 0 - cmp r0, 0 - beq _080C1032 - lsls r7, 2 - ldr r0, =gUnknown_0856ED08 - adds r0, 0x3 - adds r0, r7, r0 - str r0, [sp, 0xC] - ldr r0, =gUnknown_0856ED08 - adds r0, r7 - mov r9, r0 -_080C0FBA: - ldr r1, =0x02039b4c - ldr r0, [r1] - lsls r4, r5, 2 - adds r0, r4 - ldrh r0, [r0] - bl NationalPokedexNumToSpecies - lsls r0, 16 - lsrs r2, r0, 16 - ldr r1, =gSpeciesNames - movs r0, 0xB - muls r0, r2 - adds r0, r1 - ldrb r2, [r0] - adds r3, r2, 0 - mov r0, r9 - ldrb r0, [r0] - cmp r2, r0 - bcc _080C0FF2 - mov r1, r9 - ldrb r0, [r1] - ldr r1, =gUnknown_0856ED08 - adds r1, 0x1 - adds r1, r7, r1 - ldrb r1, [r1] - adds r0, r1 - cmp r2, r0 - blt _080C100A -_080C0FF2: - ldr r0, =gUnknown_0856ED08 - adds r0, 0x2 - adds r0, r7, r0 - ldrb r2, [r0] - cmp r3, r2 - bcc _080C101E - ldrb r1, [r0] - ldr r2, [sp, 0xC] - ldrb r0, [r2] - adds r1, r0 - cmp r3, r1 - bge _080C101E -_080C100A: - ldr r2, =0x02039b4c - ldr r0, [r2] - lsls r1, r6, 2 - adds r1, r0, r1 - adds r0, r4 - ldr r0, [r0] - str r0, [r1] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 -_080C101E: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r1, =0x02039b4c - ldr r0, [r1] - ldr r2, =0x0000060c - adds r0, r2 - ldrh r0, [r0] - cmp r5, r0 - bcc _080C0FBA -_080C1032: - ldr r1, =0x02039b4c - ldr r0, [r1] - ldr r2, =0x0000060c - adds r0, r2 - strh r6, [r0] -_080C103C: - ldr r0, [sp, 0x4] - cmp r0, 0xFF - beq _080C10AC - movs r5, 0 - movs r6, 0 - ldr r1, =0x02039b4c - ldr r0, [r1] - ldr r2, =0x0000060c - adds r0, r2 - ldrh r0, [r0] - cmp r6, r0 - bcs _080C10A2 - adds r7, r1, 0 - ldr r0, =gBaseStats - mov r8, r0 -_080C105A: - ldr r0, [r7] - lsls r4, r5, 2 - adds r0, r4 - ldrh r0, [r0] - bl NationalPokedexNumToSpecies - lsls r0, 16 - lsrs r2, r0, 16 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - add r0, r8 - ldrb r0, [r0, 0x19] - lsls r0, 25 - lsrs r0, 25 - ldr r1, [sp, 0x4] - cmp r1, r0 - bne _080C1090 - ldr r0, [r7] - lsls r1, r6, 2 - adds r1, r0, r1 - adds r0, r4 - ldr r0, [r0] - str r0, [r1] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 -_080C1090: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, [r7] - ldr r2, =0x0000060c - adds r0, r2 - ldrh r0, [r0] - cmp r5, r0 - bcc _080C105A -_080C10A2: - ldr r1, =0x02039b4c - ldr r0, [r1] - ldr r2, =0x0000060c - adds r0, r2 - strh r6, [r0] -_080C10AC: - ldr r0, [sp, 0x8] - cmp r0, 0xFF - bne _080C10C2 - mov r1, r10 - cmp r1, 0xFF - bne _080C10BA - b _080C11DE -_080C10BA: - mov r2, r10 - str r2, [sp, 0x8] - movs r0, 0xFF - mov r10, r0 -_080C10C2: - mov r1, r10 - cmp r1, 0xFF - bne _080C1158 - movs r5, 0 - movs r6, 0 - ldr r2, =0x02039b4c - ldr r0, [r2] - ldr r1, =0x0000060c - adds r0, r1 - ldrh r0, [r0] - cmp r6, r0 - bcs _080C11D4 - adds r3, r2, 0 - mov r7, sp - mov r8, r2 -_080C10E0: - ldr r0, [r3] - lsls r4, r5, 2 - adds r1, r0, r4 - ldrb r0, [r1, 0x2] - lsls r0, 30 - cmp r0, 0 - bge _080C112A - ldrh r0, [r1] - str r3, [sp, 0x10] - bl NationalPokedexNumToSpecies - lsls r0, 16 - lsrs r2, r0, 16 - ldr r1, =gBaseStats - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x6] - strb r1, [r7] - ldrb r0, [r0, 0x7] - strb r0, [r7, 0x1] - ldr r3, [sp, 0x10] - ldr r2, [sp, 0x8] - cmp r1, r2 - beq _080C1118 - cmp r0, r2 - bne _080C112A -_080C1118: - ldr r0, [r3] - lsls r1, r6, 2 - adds r1, r0, r1 - adds r0, r4 - ldr r0, [r0] - str r0, [r1] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 -_080C112A: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x0000060c - adds r0, r2 - ldrh r0, [r0] - cmp r5, r0 - bcc _080C10E0 - b _080C11D4 - .pool -_080C1158: - movs r5, 0 - movs r6, 0 - ldr r1, =0x02039b4c - ldr r0, [r1] - ldr r2, =0x0000060c - adds r0, r2 - ldrh r0, [r0] - cmp r6, r0 - bcs _080C11D4 - mov r7, sp -_080C116C: - ldr r0, [r1] - lsls r1, r5, 2 - adds r2, r0, r1 - ldrb r0, [r2, 0x2] - lsls r0, 30 - adds r4, r1, 0 - cmp r0, 0 - bge _080C11C0 - ldrh r0, [r2] - bl NationalPokedexNumToSpecies - lsls r0, 16 - lsrs r2, r0, 16 - ldr r1, =gBaseStats - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x6] - strb r1, [r7] - ldrb r0, [r0, 0x7] - strb r0, [r7, 0x1] - ldr r2, [sp, 0x8] - cmp r1, r2 - bne _080C11A2 - cmp r0, r10 - beq _080C11AC -_080C11A2: - cmp r1, r10 - bne _080C11C0 - ldr r1, [sp, 0x8] - cmp r0, r1 - bne _080C11C0 -_080C11AC: - ldr r2, =0x02039b4c - ldr r0, [r2] - lsls r1, r6, 2 - adds r1, r0, r1 - adds r0, r4 - ldr r0, [r0] - str r0, [r1] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 -_080C11C0: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r1, =0x02039b4c - ldr r0, [r1] - ldr r2, =0x0000060c - adds r0, r2 - ldrh r0, [r0] - cmp r5, r0 - bcc _080C116C -_080C11D4: - ldr r1, =0x02039b4c - ldr r0, [r1] - ldr r2, =0x0000060c - adds r0, r2 - strh r6, [r0] -_080C11DE: - ldr r1, =0x02039b4c - ldr r0, [r1] - ldr r2, =0x0000060c - adds r1, r0, r2 - ldrh r0, [r1] - cmp r0, 0 - beq _080C1232 - adds r5, r0, 0 - ldr r0, =0x00000181 - cmp r5, r0 - bhi _080C1232 - ldr r4, =0x02039b4c - movs r1, 0x2 - negs r1, r1 - mov r10, r1 - movs r2, 0x3 - negs r2, r2 - mov r9, r2 - mov r8, r0 - ldr r0, =0x0000ffff - adds r7, r0, 0 -_080C1208: - ldr r1, [r4] - lsls r3, r5, 2 - adds r1, r3 - ldrh r0, [r1] - orrs r0, r7 - strh r0, [r1] - ldrb r2, [r1, 0x2] - mov r0, r10 - ands r0, r2 - strb r0, [r1, 0x2] - ldr r1, [r4] - adds r1, r3 - ldrb r2, [r1, 0x2] - mov r0, r9 - ands r0, r2 - strb r0, [r1, 0x2] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, r8 - bls _080C1208 -_080C1232: - adds r0, r6, 0 - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C0F30 - - thumb_func_start sub_80C1258 -sub_80C1258: @ 80C1258 - push {lr} - ldr r0, =sub_80C12E0 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C1258 - - thumb_func_start sub_80C1270 -sub_80C1270: @ 80C1270 - push {r4,r5,lr} - sub sp, 0x18 - adds r5, r1, 0 - adds r3, r2, 0 - add r1, sp, 0x14 - movs r4, 0 - strb r4, [r1] - adds r2, r1, 0 - movs r1, 0xF - strb r1, [r2, 0x1] - movs r1, 0x2 - strb r1, [r2, 0x2] - lsls r5, 24 - lsrs r5, 24 - lsls r3, 24 - lsrs r3, 24 - str r4, [sp] - str r4, [sp, 0x4] - str r2, [sp, 0x8] - subs r1, 0x3 - str r1, [sp, 0xC] - str r0, [sp, 0x10] - movs r0, 0 - movs r1, 0x1 - adds r2, r5, 0 - bl AddTextPrinterParametrized2 - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80C1270 - - thumb_func_start sub_80C12B0 -sub_80C12B0: @ 80C12B0 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r2, 16 - lsrs r2, 16 - str r2, [sp] - lsls r3, 16 - lsrs r3, 16 - str r3, [sp, 0x4] - movs r0, 0 - movs r1, 0 - adds r2, r4, 0 - adds r3, r5, 0 - bl FillWindowPixelRect - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80C12B0 - - thumb_func_start sub_80C12E0 -sub_80C12E0: @ 80C12E0 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r3, r1, 0 - cmp r0, 0x4 - bhi _080C1320 - lsls r0, 2 - ldr r1, =_080C130C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C130C: - .4byte _080C1320 - .4byte _080C1414 - .4byte _080C1480 - .4byte _080C14A0 - .4byte _080C14F0 -_080C1320: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - beq _080C1332 - b _080C1516 -_080C1332: - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000064a - adds r0, r1 - movs r1, 0x2 - strb r1, [r0] - movs r0, 0 - bl sub_80C09B0 - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0856EFF8 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - movs r4, 0x80 - lsls r4, 4 - adds r0, r4, 0 - bl AllocZeroed - adds r1, r0, 0 - movs r0, 0x3 - bl SetBgTilemapBuffer - adds r0, r4, 0 - bl AllocZeroed - adds r1, r0, 0 - movs r0, 0x2 - bl SetBgTilemapBuffer - adds r0, r4, 0 - bl AllocZeroed - adds r1, r0, 0 - movs r0, 0x1 - bl SetBgTilemapBuffer - adds r0, r4, 0 - bl AllocZeroed - adds r1, r0, 0 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r0, =gUnknown_0856F008 - bl InitWindows - bl DeactivateAllTextPrinters - movs r0, 0 - bl PutWindowTilemap - ldr r1, =gUnknown_08DC3304 - movs r2, 0x80 - lsls r2, 6 - str r5, [sp] - movs r0, 0x3 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - bl sub_809D42C - cmp r0, 0 - bne _080C13E4 - ldr r1, =gUnknown_08DC3A0C - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - b _080C13F0 - .pool -_080C13E4: - ldr r1, =gUnknown_08DC3870 - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer -_080C13F0: - ldr r0, =gUnknown_08DC3286 - movs r1, 0x1 - movs r2, 0x7E - bl gpu_pal_apply - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0] - b _080C1516 - .pool -_080C1414: - ldr r0, =gUnknown_0855D26C - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0855D27C - bl LoadTaggedObjectPalettes - adds r0, r4, 0 - bl sub_80C2594 - movs r1, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r2, r0, 3 - ldr r5, =0x03005e08 - movs r3, 0 -_080C1432: - lsls r0, r1, 1 - adds r0, r2 - adds r0, r5 - strh r3, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0xF - bls _080C1432 - adds r0, r4, 0 - bl sub_80C23B8 - movs r0, 0 - bl sub_80C2040 - adds r0, r4, 0 - bl sub_80C20F8 - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - b _080C14DA - .pool -_080C1480: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _080C14E2 - .pool -_080C14A0: - 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 r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl HideBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg -_080C14DA: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 -_080C14E2: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C1516 - .pool -_080C14F0: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - bne _080C1516 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80C1570 - str r1, [r0] - movs r1, 0x87 - lsls r1, 3 - adds r0, r3, r1 - strb r2, [r0] -_080C1516: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C12E0 - - thumb_func_start sub_80C152C -sub_80C152C: @ 80C152C - push {lr} - bl FreeAllWindowBuffers - movs r0, 0 - bl GetBgTilemapBuffer - cmp r0, 0 - beq _080C1540 - bl Free -_080C1540: - movs r0, 0x1 - bl GetBgTilemapBuffer - cmp r0, 0 - beq _080C154E - bl Free -_080C154E: - movs r0, 0x2 - bl GetBgTilemapBuffer - cmp r0, 0 - beq _080C155C - bl Free -_080C155C: - movs r0, 0x3 - bl GetBgTilemapBuffer - cmp r0, 0 - beq _080C156A - bl Free -_080C156A: - pop {r0} - bx r0 - thumb_func_end sub_80C152C - - thumb_func_start sub_80C1570 -sub_80C1570: @ 80C1570 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x03005e00 - lsls r5, r4, 2 - adds r5, r4 - lsls r5, 3 - adds r5, r0 - ldrb r0, [r5, 0x8] - bl sub_80C2040 - adds r0, r4, 0 - bl sub_80C20F8 - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - ldr r0, =sub_80C15B0 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C1570 - - thumb_func_start sub_80C15B0 -sub_80C15B0: @ 80C15B0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080C15E4 - movs r0, 0x3 - bl audio_play - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80C1D38 - str r0, [r1] - b _080C16BC - .pool -_080C15E4: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080C1640 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r5, r0, r1 - movs r0, 0x8 - ldrsh r4, [r5, r0] - cmp r4, 0x1 - beq _080C161C - cmp r4, 0x1 - bgt _080C160C - cmp r4, 0 - beq _080C1612 - b _080C16BC - .pool -_080C160C: - cmp r4, 0x2 - beq _080C1630 - b _080C16BC -_080C1612: - movs r0, 0x15 - bl audio_play - strh r4, [r5, 0xA] - b _080C1626 -_080C161C: - movs r0, 0x15 - bl audio_play - movs r0, 0x4 - strh r0, [r5, 0xA] -_080C1626: - ldr r0, =sub_80C16CC - str r0, [r5] - b _080C16BC - .pool -_080C1630: - movs r0, 0x3 - bl audio_play - ldr r0, =sub_80C1D38 - str r0, [r5] - b _080C16BC - .pool -_080C1640: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080C167C - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r4, r1, r0 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - ble _080C167C - movs r0, 0x6D - bl audio_play - ldrh r0, [r4, 0x8] - subs r0, 0x1 - strh r0, [r4, 0x8] - lsls r0, 24 - lsrs r0, 24 - bl sub_80C2040 - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram -_080C167C: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080C16BC - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r4, r1, r0 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bgt _080C16BC - movs r0, 0x6D - bl audio_play - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - lsls r0, 24 - lsrs r0, 24 - bl sub_80C2040 - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram -_080C16BC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C15B0 - - thumb_func_start sub_80C16CC -sub_80C16CC: @ 80C16CC - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x03005e00 - lsls r5, r4, 2 - adds r5, r4 - lsls r5, 3 - adds r5, r0 - ldrb r0, [r5, 0x8] - ldrb r1, [r5, 0xA] - bl sub_80C2064 - adds r0, r4, 0 - bl sub_80C20F8 - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - ldr r0, =sub_80C170C - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C16CC - - thumb_func_start sub_80C170C -sub_80C170C: @ 80C170C - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _080C1740 - bl sub_809D42C - ldr r6, =gUnknown_0856EDB8 - cmp r0, 0 - bne _080C174C - ldr r6, =gUnknown_0856EDF0 - b _080C174C - .pool -_080C1740: - bl sub_809D42C - ldr r6, =gUnknown_0856ED9C - cmp r0, 0 - bne _080C174C - ldr r6, =gUnknown_0856EDD4 -_080C174C: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0 - beq _080C178C - movs r0, 0x17 - bl audio_play - adds r0, r5, 0 - bl sub_80C23B8 - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80C1570 - str r0, [r1] - b _080C1994 - .pool -_080C178C: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080C1870 - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r6, r1, r0 - movs r2, 0xA - ldrsh r0, [r6, r2] - cmp r0, 0x6 - bne _080C1860 - movs r1, 0x8 - ldrsh r0, [r6, r1] - cmp r0, 0 - beq _080C183C - ldr r1, =0x02039b52 - movs r0, 0x40 - strb r0, [r1] - ldr r7, =0x02039b4c - ldr r1, [r7] - ldr r0, =0x0000062a - adds r2, r1, r0 - movs r0, 0x40 - strh r0, [r2] - ldr r0, =0x02039b50 - strh r3, [r0] - movs r2, 0xC2 - lsls r2, 3 - adds r1, r2 - strh r3, [r1] - adds r0, r5, 0 - movs r1, 0x5 - bl sub_80C2318 - ldr r4, =0x03005d90 - ldr r1, [r4] - strb r0, [r1, 0x19] - bl sub_809D42C - cmp r0, 0 - bne _080C17E8 - ldr r1, [r4] - movs r0, 0 - strb r0, [r1, 0x19] -_080C17E8: - ldr r0, [r7] - ldr r1, [r4] - ldrb r1, [r1, 0x19] - ldr r2, =0x00000614 - adds r0, r2 - strh r1, [r0] - adds r0, r5, 0 - movs r1, 0x4 - bl sub_80C2318 - ldr r1, [r4] - strb r0, [r1, 0x18] - ldr r0, [r7] - ldr r1, [r4] - ldrb r1, [r1, 0x18] - movs r2, 0xC3 - lsls r2, 3 - adds r0, r2 - strh r1, [r0] - movs r0, 0x3 - bl audio_play - ldr r0, =sub_80C1D38 - str r0, [r6] - b _080C1994 - .pool -_080C183C: - ldr r0, =gUnknown_085E875B - bl sub_80C2618 - ldr r0, =sub_80C19A4 - str r0, [r6] - movs r0, 0x70 - bl audio_play - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - b _080C1994 - .pool -_080C1860: - movs r0, 0x15 - bl audio_play - ldr r0, =sub_80C1B64 - str r0, [r6] - b _080C1994 - .pool -_080C1870: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080C18B6 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0xA - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0xFF - beq _080C18B6 - movs r0, 0x5 - bl audio_play - movs r2, 0xA - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r0, r6 - ldrb r1, [r0] - strh r1, [r4, 0xA] - ldrb r0, [r4, 0x8] - bl sub_80C2064 - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram -_080C18B6: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080C1900 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0xA - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x1] - cmp r0, 0xFF - beq _080C1900 - movs r0, 0x5 - bl audio_play - movs r2, 0xA - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r0, r6 - ldrb r1, [r0, 0x1] - strh r1, [r4, 0xA] - ldrb r0, [r4, 0x8] - bl sub_80C2064 - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram -_080C1900: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080C194A - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0xA - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x2] - cmp r0, 0xFF - beq _080C194A - movs r0, 0x5 - bl audio_play - movs r2, 0xA - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r0, r6 - ldrb r1, [r0, 0x2] - strh r1, [r4, 0xA] - ldrb r0, [r4, 0x8] - bl sub_80C2064 - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram -_080C194A: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080C1994 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0xA - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x3] - cmp r0, 0xFF - beq _080C1994 - movs r0, 0x5 - bl audio_play - movs r2, 0xA - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r0, r6 - ldrb r1, [r0, 0x3] - strh r1, [r4, 0xA] - ldrb r0, [r4, 0x8] - bl sub_80C2064 - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram -_080C1994: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C170C - - thumb_func_start sub_80C19A4 -sub_80C19A4: @ 80C19A4 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0x8 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r5, 0 - movs r1, 0x5 - bl sub_80C2318 - mov r10, r0 - mov r0, r10 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - adds r0, r5, 0 - movs r1, 0x4 - bl sub_80C2318 - mov r9, r0 - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - adds r0, r5, 0 - movs r1, 0 - bl sub_80C2318 - mov r8, r0 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80C2318 - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - adds r0, r5, 0 - movs r1, 0x2 - bl sub_80C2318 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x3 - bl sub_80C2318 - lsls r0, 24 - lsrs r0, 24 - str r4, [sp] - str r0, [sp, 0x4] - mov r0, r10 - mov r1, r9 - mov r2, r8 - adds r3, r6, 0 - bl sub_80C0F30 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80C1A4C - str r1, [r0] - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C19A4 - - thumb_func_start sub_80C1A4C -sub_80C1A4C: @ 80C1A4C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - bne _080C1AA6 - ldr r0, =0x02039b4c - ldr r0, [r0] - ldr r1, =0x0000060c - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _080C1A84 - movs r0, 0x1F - bl audio_play - ldr r0, =gUnknown_085E8773 - bl sub_80C2618 - b _080C1A90 - .pool -_080C1A84: - movs r0, 0x20 - bl audio_play - ldr r0, =gUnknown_085E8785 - bl sub_80C2618 -_080C1A90: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80C1AB8 - str r0, [r1] - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram -_080C1AA6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C1A4C - - thumb_func_start sub_80C1AB8 -sub_80C1AB8: @ 80C1AB8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r2, r4, 0 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080C1B54 - ldr r5, =0x02039b4c - ldr r1, [r5] - ldr r3, =0x0000060c - adds r0, r1, r3 - ldrh r0, [r0] - cmp r0, 0 - beq _080C1B40 - ldr r0, =0x0000064e - adds r1, r0 - movs r0, 0x1 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x5 - bl sub_80C2318 - ldr r1, [r5] - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x00000612 - adds r1, r2 - strh r0, [r1] - adds r0, r4, 0 - movs r1, 0x4 - bl sub_80C2318 - ldr r1, [r5] - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x00000616 - adds r1, r3 - strh r0, [r1] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80C1D38 - str r1, [r0] - movs r0, 0x3 - bl audio_play - b _080C1B54 - .pool -_080C1B40: - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80C16CC - str r0, [r1] - movs r0, 0x17 - bl audio_play -_080C1B54: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C1AB8 - - thumb_func_start sub_80C1B64 -sub_80C1B64: @ 80C1B64 - push {r4-r6,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0 - bl sub_80C21D4 - ldr r2, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r6, r1, r2 - ldrb r0, [r6, 0xA] - adds r2, 0x8 - adds r1, r2 - ldr r2, =gUnknown_0856EFC8 - lsls r0, 3 - adds r0, r2 - ldrb r4, [r0, 0x4] - lsls r4, 1 - adds r4, r1, r4 - ldrb r0, [r0, 0x5] - lsls r0, 1 - adds r1, r0 - ldrh r0, [r4] - strh r0, [r6, 0x24] - ldrh r0, [r1] - strh r0, [r6, 0x26] - adds r0, r5, 0 - bl sub_80C2294 - ldrh r0, [r4] - bl sub_80C2650 - ldr r0, =sub_80C1BCC - str r0, [r6] - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C1B64 - - thumb_func_start sub_80C1BCC -sub_80C1BCC: @ 80C1BCC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r3, =0x03005e00 - lsls r2, r7, 2 - adds r2, r7 - lsls r2, 3 - adds r5, r2, r3 - ldrb r1, [r5, 0xA] - ldr r0, =gUnknown_0856EFC8 - lsls r1, 3 - adds r1, r0 - ldr r0, [r1] - mov r8, r0 - adds r3, 0x8 - adds r2, r3 - ldrb r0, [r1, 0x4] - lsls r0, 1 - adds r4, r2, r0 - ldrb r0, [r1, 0x5] - lsls r0, 1 - adds r6, r2, r0 - ldrh r0, [r1, 0x6] - subs r0, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =0x030022c0 - mov r12, r0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080C1C30 - movs r0, 0x15 - bl audio_play - bl sub_80C267C - movs r0, 0x1 - bl sub_80C21D4 - b _080C1C50 - .pool -_080C1C30: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080C1C68 - movs r0, 0x17 - bl audio_play - bl sub_80C267C - movs r0, 0x1 - bl sub_80C21D4 - ldrh r0, [r5, 0x24] - strh r0, [r4] - ldrh r0, [r5, 0x26] - strh r0, [r6] -_080C1C50: - ldr r0, =sub_80C16CC - str r0, [r5] - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - b _080C1D2E - .pool -_080C1C68: - movs r3, 0 - mov r0, r12 - ldrh r1, [r0, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080C1CCA - ldrh r0, [r4] - cmp r0, 0 - beq _080C1C8E - bl sub_80C2638 - ldrh r0, [r4] - subs r0, 0x1 - strh r0, [r4] - ldrh r0, [r4] - bl sub_80C2650 - b _080C1CAA -_080C1C8E: - ldrh r0, [r6] - cmp r0, 0 - beq _080C1CA6 - subs r0, 0x1 - strh r0, [r6] - adds r0, r7, 0 - bl sub_80C2294 - ldrh r0, [r4] - bl sub_80C2650 - movs r3, 0x1 -_080C1CA6: - cmp r3, 0 - beq _080C1D2E -_080C1CAA: - movs r0, 0x5 - bl audio_play - ldrh r0, [r4] - ldrh r1, [r6] - adds r0, r1 - lsls r0, 3 - add r0, r8 - ldr r0, [r0] - bl sub_80C2618 - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - b _080C1D2E -_080C1CCA: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080C1D2E - ldrh r0, [r4] - cmp r0, 0x4 - bhi _080C1CEE - cmp r0, r2 - bcs _080C1CEE - bl sub_80C2638 - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - ldrh r0, [r4] - bl sub_80C2650 - b _080C1D10 -_080C1CEE: - cmp r2, 0x5 - bls _080C1D0C - ldrh r1, [r6] - subs r0, r2, 0x5 - cmp r1, r0 - bge _080C1D0C - adds r0, r1, 0x1 - strh r0, [r6] - adds r0, r7, 0 - bl sub_80C2294 - movs r0, 0x5 - bl sub_80C2650 - movs r3, 0x1 -_080C1D0C: - cmp r3, 0 - beq _080C1D2E -_080C1D10: - movs r0, 0x5 - bl audio_play - ldrh r0, [r4] - ldrh r1, [r6] - adds r0, r1 - lsls r0, 3 - add r0, r8 - ldr r0, [r0] - bl sub_80C2618 - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram -_080C1D2E: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80C1BCC - - thumb_func_start sub_80C1D38 -sub_80C1D38: @ 80C1D38 - 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 pal_fade_maybe - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80C1D70 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C1D38 - - thumb_func_start sub_80C1D70 -sub_80C1D70: @ 80C1D70 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080C1D8C - bl sub_80C152C - adds r0, r4, 0 - bl DestroyTask -_080C1D8C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C1D70 - - thumb_func_start sub_80C1D98 -sub_80C1D98: @ 80C1D98 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r3, 0 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r2, 24 - lsrs r5, r2, 24 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x3 - bl GetBgTilemapBuffer - adds r2, r0, 0 - movs r3, 0 - cmp r3, r4 - bcs _080C1DEC - lsls r0, r5, 6 - adds r7, r0, r2 - ldr r5, =0x00000fff - lsls r2, r6, 12 -_080C1DC8: - mov r0, r8 - adds r1, r0, r3 - lsls r1, 1 - adds r1, r7 - ldrh r0, [r1] - ands r0, r5 - orrs r0, r2 - strh r0, [r1] - adds r1, 0x40 - ldrh r0, [r1] - ands r0, r5 - orrs r0, r2 - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r4 - bcc _080C1DC8 -_080C1DEC: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C1D98 - - thumb_func_start sub_80C1DFC -sub_80C1DFC: @ 80C1DFC - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x1 - ands r5, r0 - ands r2, r0 - lsls r2, 1 - orrs r5, r2 - cmp r4, 0xA - bhi _080C1EE8 - lsls r0, r4, 2 - ldr r1, =_080C1E28 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C1E28: - .4byte _080C1E54 - .4byte _080C1E54 - .4byte _080C1E54 - .4byte _080C1E64 - .4byte _080C1E64 - .4byte _080C1E7C - .4byte _080C1E7C - .4byte _080C1E64 - .4byte _080C1E64 - .4byte _080C1EA4 - .4byte _080C1E94 -_080C1E54: - ldr r1, =gUnknown_0856ED30 - lsls r0, r4, 3 - adds r0, r1 - ldrb r1, [r0, 0x4] - ldrb r2, [r0, 0x5] - b _080C1EC2 - .pool -_080C1E64: - ldr r2, =gUnknown_0856ED48 - subs r1, r4, 0x3 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x4] - ldrb r2, [r0, 0x5] - ldrb r3, [r0, 0x6] - adds r0, r5, 0 - bl sub_80C1D98 -_080C1E7C: - ldr r2, =gUnknown_0856ED48 - subs r1, r4, 0x3 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x7] - ldrb r2, [r0, 0x8] - ldrb r3, [r0, 0x9] - b _080C1EC4 - .pool -_080C1E94: - ldr r0, =gUnknown_0856ED48 - ldrb r1, [r0, 0x1C] - ldrb r2, [r0, 0x1D] - ldrb r3, [r0, 0x1E] - b _080C1EC4 - .pool -_080C1EA4: - bl sub_809D42C - cmp r0, 0 - bne _080C1ED0 - ldr r2, =gUnknown_0856ED48 - subs r1, r4, 0x3 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x4] - ldrb r2, [r0, 0x5] - subs r2, 0x2 - lsls r2, 24 - lsrs r2, 24 -_080C1EC2: - ldrb r3, [r0, 0x6] -_080C1EC4: - adds r0, r5, 0 - bl sub_80C1D98 - b _080C1EE8 - .pool -_080C1ED0: - ldr r2, =gUnknown_0856ED48 - subs r1, r4, 0x3 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x4] - ldrb r2, [r0, 0x5] - ldrb r3, [r0, 0x6] - adds r0, r5, 0 - bl sub_80C1D98 -_080C1EE8: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C1DFC - - thumb_func_start sub_80C1EF4 -sub_80C1EF4: @ 80C1EF4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x1 - beq _080C1F5E - cmp r0, 0x1 - bgt _080C1F0A - cmp r0, 0 - beq _080C1F10 - b _080C203C -_080C1F0A: - cmp r1, 0x2 - beq _080C1FCE - b _080C203C -_080C1F10: - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl sub_80C1DFC - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - bl sub_80C1DFC - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0 - bl sub_80C1DFC - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0 - bl sub_80C1DFC - movs r0, 0x4 - movs r1, 0x1 - movs r2, 0 - bl sub_80C1DFC - movs r0, 0xA - movs r1, 0x1 - movs r2, 0 - bl sub_80C1DFC - movs r0, 0x5 - movs r1, 0x1 - movs r2, 0 - bl sub_80C1DFC - movs r0, 0x6 - movs r1, 0x1 - movs r2, 0 - b _080C1FAA -_080C1F5E: - movs r0, 0 - movs r1, 0x1 - movs r2, 0 - bl sub_80C1DFC - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl sub_80C1DFC - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0 - bl sub_80C1DFC - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x1 - bl sub_80C1DFC - movs r0, 0x4 - movs r1, 0x1 - movs r2, 0x1 - bl sub_80C1DFC - movs r0, 0xA - movs r1, 0x1 - movs r2, 0x1 - bl sub_80C1DFC - movs r0, 0x5 - movs r1, 0x1 - movs r2, 0x1 - bl sub_80C1DFC - movs r0, 0x6 - movs r1, 0x1 - movs r2, 0x1 -_080C1FAA: - bl sub_80C1DFC - movs r0, 0x7 - movs r1, 0x1 - movs r2, 0 - bl sub_80C1DFC - movs r0, 0x8 - movs r1, 0x1 - movs r2, 0 - bl sub_80C1DFC - movs r0, 0x9 - movs r1, 0x1 - movs r2, 0 - bl sub_80C1DFC - b _080C203C -_080C1FCE: - movs r0, 0 - movs r1, 0x1 - movs r2, 0 - bl sub_80C1DFC - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - bl sub_80C1DFC - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl sub_80C1DFC - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x1 - bl sub_80C1DFC - movs r0, 0x4 - movs r1, 0x1 - movs r2, 0x1 - bl sub_80C1DFC - movs r0, 0xA - movs r1, 0x1 - movs r2, 0x1 - bl sub_80C1DFC - movs r0, 0x5 - movs r1, 0x1 - movs r2, 0x1 - bl sub_80C1DFC - movs r0, 0x6 - movs r1, 0x1 - movs r2, 0x1 - bl sub_80C1DFC - movs r0, 0x7 - movs r1, 0x1 - movs r2, 0x1 - bl sub_80C1DFC - movs r0, 0x8 - movs r1, 0x1 - movs r2, 0x1 - bl sub_80C1DFC - movs r0, 0x9 - movs r1, 0x1 - movs r2, 0x1 - bl sub_80C1DFC -_080C203C: - pop {r0} - bx r0 - thumb_func_end sub_80C1EF4 - - thumb_func_start sub_80C2040 -sub_80C2040: @ 80C2040 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_80C1EF4 - ldr r0, =gUnknown_0856ED30 - lsls r4, 3 - adds r4, r0 - ldr r0, [r4] - bl sub_80C2618 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C2040 - - thumb_func_start sub_80C2064 -sub_80C2064: @ 80C2064 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - bl sub_80C1EF4 - cmp r4, 0x6 - bhi _080C20DE - lsls r0, r4, 2 - ldr r1, =_080C2084 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C2084: - .4byte _080C20A0 - .4byte _080C20A4 - .4byte _080C20A8 - .4byte _080C20B6 - .4byte _080C20C4 - .4byte _080C20C8 - .4byte _080C20D4 -_080C20A0: - movs r0, 0x3 - b _080C20CA -_080C20A4: - movs r0, 0x4 - b _080C20CA -_080C20A8: - movs r0, 0xA - movs r1, 0 - movs r2, 0 - bl sub_80C1DFC - movs r0, 0x5 - b _080C20CA -_080C20B6: - movs r0, 0xA - movs r1, 0 - movs r2, 0 - bl sub_80C1DFC - movs r0, 0x6 - b _080C20CA -_080C20C4: - movs r0, 0x7 - b _080C20CA -_080C20C8: - movs r0, 0x8 -_080C20CA: - movs r1, 0 - movs r2, 0 - bl sub_80C1DFC - b _080C20DE -_080C20D4: - movs r0, 0x9 - movs r1, 0 - movs r2, 0 - bl sub_80C1DFC -_080C20DE: - ldr r0, =gUnknown_0856ED48 - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - bl sub_80C2618 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C2064 - - thumb_func_start sub_80C20F8 -sub_80C20F8: @ 80C20F8 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x28 - movs r1, 0x10 - movs r2, 0x60 - movs r3, 0x50 - bl sub_80C12B0 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r5, r0, r1 - ldrh r0, [r5, 0x16] - ldrh r1, [r5, 0x14] - adds r0, r1 - lsls r0, 16 - ldr r1, =gUnknown_0856EE5C - lsrs r0, 13 - adds r1, 0x4 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x2D - movs r2, 0x11 - bl sub_80C1270 - ldrh r0, [r5, 0x1A] - ldrh r1, [r5, 0x18] - adds r0, r1 - lsls r0, 16 - ldr r1, =gUnknown_0856EEB4 - lsrs r0, 13 - adds r1, 0x4 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x2D - movs r2, 0x21 - bl sub_80C1270 - ldrh r0, [r5, 0x1E] - ldrh r1, [r5, 0x1C] - adds r0, r1 - lsls r0, 16 - ldr r4, =gUnknown_0856EF14 - lsrs r0, 13 - adds r4, 0x4 - adds r0, r4 - ldr r0, [r0] - movs r1, 0x2D - movs r2, 0x31 - bl sub_80C1270 - ldrh r0, [r5, 0x22] - ldrh r1, [r5, 0x20] - adds r0, r1 - lsls r0, 16 - lsrs r0, 13 - adds r0, r4 - ldr r0, [r0] - movs r1, 0x5D - movs r2, 0x31 - bl sub_80C1270 - ldrh r0, [r5, 0x12] - ldrh r1, [r5, 0x10] - adds r0, r1 - lsls r0, 16 - ldr r1, =gUnknown_0856EE24 - lsrs r0, 13 - adds r1, 0x4 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x2D - movs r2, 0x41 - bl sub_80C1270 - bl sub_809D42C - cmp r0, 0 - beq _080C21B6 - ldrh r0, [r5, 0xE] - ldrh r5, [r5, 0xC] - adds r0, r5 - lsls r0, 16 - ldr r1, =gUnknown_0856EE0C - lsrs r0, 13 - adds r1, 0x4 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x2D - movs r2, 0x51 - bl sub_80C1270 -_080C21B6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C20F8 - - thumb_func_start sub_80C21D4 -sub_80C21D4: @ 80C21D4 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x3 - bl GetBgTilemapBuffer - adds r5, r0, 0 - cmp r4, 0 - bne _080C2268 - ldr r1, =0x00000c0b - adds r0, r1, 0 - strh r0, [r5, 0x22] - movs r1, 0x12 - ldr r0, =0x0000080d - adds r2, r0, 0 -_080C21F4: - lsls r0, r1, 1 - adds r0, r5 - strh r2, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x1E - bls _080C21F4 - movs r2, 0x1 - ldr r1, =0x0000040a - adds r6, r1, 0 - movs r4, 0x2 -_080C220C: - lsls r0, r2, 6 - adds r0, r5 - strh r6, [r0, 0x22] - movs r1, 0x12 - adds r3, r2, 0x1 - adds r2, r0, 0 -_080C2218: - lsls r0, r1, 1 - adds r0, r2 - strh r4, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x1E - bls _080C2218 - lsls r0, r3, 16 - lsrs r2, r0, 16 - cmp r2, 0xC - bls _080C220C - ldr r2, =0x00000362 - adds r1, r5, r2 - adds r2, 0xA9 - adds r0, r2, 0 - strh r0, [r1] - movs r1, 0x12 - movs r3, 0xD0 - lsls r3, 2 - movs r2, 0xD -_080C2242: - lsls r0, r1, 1 - adds r0, r5 - adds r0, r3 - strh r2, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x1E - bls _080C2242 - b _080C228C - .pool -_080C2268: - movs r2, 0 - movs r4, 0x4F -_080C226C: - movs r1, 0x11 - lsls r0, r2, 6 - adds r3, r2, 0x1 - adds r2, r0, r5 -_080C2274: - lsls r0, r1, 1 - adds r0, r2 - strh r4, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x1D - bls _080C2274 - lsls r0, r3, 16 - lsrs r2, r0, 16 - cmp r2, 0xD - bls _080C226C -_080C228C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80C21D4 - - thumb_func_start sub_80C2294 -sub_80C2294: @ 80C2294 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - ldr r4, =gUnknown_0856EFC8 - ldr r3, =0x03005e00 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - adds r0, r2, r3 - movs r5, 0xA - ldrsh r1, [r0, r5] - lsls r1, 3 - adds r1, r4 - ldr r6, [r1] - adds r3, 0x8 - adds r2, r3 - ldrb r0, [r1, 0x4] - lsls r0, 1 - adds r0, r2 - mov r8, r0 - ldrb r0, [r1, 0x5] - lsls r0, 1 - adds r7, r2, r0 - bl sub_80C267C - movs r5, 0 - ldrh r4, [r7] - b _080C22F2 - .pool -_080C22D8: - adds r0, r1, r6 - ldr r1, [r0, 0x4] - adds r0, r5, 0 - bl sub_80C2668 - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r5, 0x5 - bhi _080C22FC -_080C22F2: - lsls r1, r4, 3 - adds r0, r1, r6 - ldr r0, [r0, 0x4] - cmp r0, 0 - bne _080C22D8 -_080C22FC: - mov r1, r8 - ldrh r0, [r1] - ldrh r1, [r7] - adds r0, r1 - lsls r0, 3 - adds r0, r6 - ldr r0, [r0] - bl sub_80C2618 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80C2294 - - thumb_func_start sub_80C2318 -sub_80C2318: @ 80C2318 - 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, =0x03005e08 - adds r1, r0 - ldr r2, =gUnknown_0856EFC8 - lsls r0, r3, 3 - adds r0, r2 - ldrb r2, [r0, 0x4] - lsls r2, 1 - adds r2, r1, r2 - ldrb r0, [r0, 0x5] - lsls r0, 1 - adds r1, r0 - ldrh r0, [r1] - ldrh r2, [r2] - adds r0, r2 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r3, 0x5 - bhi _080C237C - lsls r0, r3, 2 - ldr r1, =_080C2364 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C2364: - .4byte _080C2390 - .4byte _080C239A - .4byte _080C23AA - .4byte _080C23AA - .4byte _080C2388 - .4byte _080C2380 -_080C237C: - movs r0, 0 - b _080C23B0 -_080C2380: - ldr r0, =gUnknown_0856EFAC - b _080C23AC - .pool -_080C2388: - ldr r0, =gUnknown_0856EFAE - b _080C23AC - .pool -_080C2390: - cmp r2, 0 - beq _080C239E - lsls r0, r2, 24 - lsrs r0, 24 - b _080C23B0 -_080C239A: - cmp r2, 0 - bne _080C23A2 -_080C239E: - movs r0, 0xFF - b _080C23B0 -_080C23A2: - subs r0, r2, 0x1 - lsls r0, 24 - lsrs r0, 24 - b _080C23B0 -_080C23AA: - ldr r0, =gUnknown_0856EFB4 -_080C23AC: - adds r0, r2, r0 - ldrb r0, [r0] -_080C23B0: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C2318 - - thumb_func_start sub_80C23B8 -sub_80C23B8: @ 80C23B8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x02039b4c - ldr r0, [r1] - ldr r2, =0x00000614 - adds r0, r2 - ldrh r0, [r0] - adds r5, r1, 0 - cmp r0, 0 - beq _080C23D2 - cmp r0, 0x1 - beq _080C23E0 -_080C23D2: - movs r3, 0 - b _080C23E2 - .pool -_080C23E0: - movs r3, 0x1 -_080C23E2: - ldr r1, =0x03005e00 - lsls r2, r4, 2 - adds r0, r2, r4 - lsls r0, 3 - adds r0, r1 - strh r3, [r0, 0xC] - ldr r0, [r5] - movs r3, 0xC3 - lsls r3, 3 - adds r0, r3 - ldrh r0, [r0] - adds r5, r1, 0 - cmp r0, 0x5 - bhi _080C2428 - lsls r0, 2 - ldr r1, =_080C2410 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C2410: - .4byte _080C2428 - .4byte _080C242C - .4byte _080C2430 - .4byte _080C2434 - .4byte _080C2438 - .4byte _080C243C -_080C2428: - movs r3, 0 - b _080C243E -_080C242C: - movs r3, 0x1 - b _080C243E -_080C2430: - movs r3, 0x2 - b _080C243E -_080C2434: - movs r3, 0x3 - b _080C243E -_080C2438: - movs r3, 0x4 - b _080C243E -_080C243C: - movs r3, 0x5 -_080C243E: - adds r0, r2, r4 - lsls r0, 3 - adds r0, r5 - strh r3, [r0, 0x10] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80C23B8 - - thumb_func_start sub_80C244C -sub_80C244C: @ 80C244C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r0, r1, r3 - ldrb r2, [r0, 0xA] - adds r3, 0x8 - adds r1, r3 - ldr r0, =gUnknown_0856EFC8 - lsls r2, 3 - adds r2, r0 - ldrb r0, [r2, 0x5] - lsls r0, 1 - adds r1, r0 - ldrh r0, [r2, 0x6] - subs r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x5 - bls _080C248C - ldrh r0, [r1] - cmp r0, 0 - beq _080C248C - movs r0, 0 - b _080C248E - .pool -_080C248C: - movs r0, 0x1 -_080C248E: - pop {r1} - bx r1 - thumb_func_end sub_80C244C - - thumb_func_start sub_80C2494 -sub_80C2494: @ 80C2494 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r0, r1, r3 - ldrb r2, [r0, 0xA] - adds r3, 0x8 - adds r1, r3 - ldr r0, =gUnknown_0856EFC8 - lsls r2, 3 - adds r2, r0 - ldrb r0, [r2, 0x5] - lsls r0, 1 - adds r1, r0 - ldrh r0, [r2, 0x6] - subs r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x5 - bls _080C24D8 - ldrh r1, [r1] - subs r0, 0x5 - cmp r1, r0 - bge _080C24D8 - movs r0, 0 - b _080C24DA - .pool -_080C24D8: - movs r0, 0x1 -_080C24DA: - pop {r1} - bx r1 - thumb_func_end sub_80C2494 - - thumb_func_start sub_80C24E0 -sub_80C24E0: @ 80C24E0 - push {r4,lr} - adds r4, r0, 0 - ldr r2, =0x03005e00 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldr r1, [r0] - ldr r0, =sub_80C1BCC - cmp r1, r0 - bne _080C2580 - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080C2528 - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r0, 24 - bl sub_80C2494 - lsls r0, 24 - cmp r0, 0 - beq _080C2544 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - b _080C2550 - .pool -_080C2528: - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r0, 24 - bl sub_80C244C - lsls r0, 24 - cmp r0, 0 - beq _080C2544 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - b _080C2550 -_080C2544: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 -_080C2550: - strb r0, [r2] - ldrh r2, [r4, 0x32] - movs r1, 0x30 - ldrsh r0, [r4, r1] - lsls r0, 7 - adds r0, r2, r0 - lsls r0, 24 - ldr r1, =gUnknown_08329F40 - lsrs r0, 23 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _080C256E - adds r0, 0x7F -_080C256E: - asrs r0, 7 - strh r0, [r4, 0x26] - adds r0, r2, 0 - adds r0, 0x8 - strh r0, [r4, 0x32] - b _080C258C - .pool -_080C2580: - adds r0, r4, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_080C258C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80C24E0 - - thumb_func_start sub_80C2594 -sub_80C2594: @ 80C2594 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r6, =gUnknown_0855D1AC - adds r0, r6, 0 - movs r1, 0xB8 - movs r2, 0x4 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r0, r1, r4 - movs r2, 0 - strh r5, [r0, 0x2E] - strh r2, [r0, 0x30] - movs r0, 0x1C - adds r0, r4 - mov r9, r0 - add r1, r9 - ldr r0, =sub_80C24E0 - mov r8, r0 - str r0, [r1] - adds r0, r6, 0 - movs r1, 0xB8 - movs r2, 0x6C - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r4, r1, r4 - strh r5, [r4, 0x2E] - movs r0, 0x1 - strh r0, [r4, 0x30] - adds r4, 0x3F - ldrb r0, [r4] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r4] - add r1, r9 - mov r0, r8 - str r0, [r1] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C2594 - - thumb_func_start sub_80C2618 -sub_80C2618: @ 80C2618 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x8 - movs r1, 0x78 - movs r2, 0xE0 - movs r3, 0x20 - bl sub_80C12B0 - adds r0, r4, 0 - movs r1, 0x8 - movs r2, 0x79 - bl sub_80C1270 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80C2618 - - thumb_func_start sub_80C2638 -sub_80C2638: @ 80C2638 - push {lr} - adds r1, r0, 0 - lsls r1, 4 - adds r1, 0x8 - movs r0, 0x90 - movs r2, 0x8 - movs r3, 0x10 - bl sub_80C12B0 - pop {r0} - bx r0 - thumb_func_end sub_80C2638 - - thumb_func_start sub_80C2650 -sub_80C2650: @ 80C2650 - push {lr} - adds r2, r0, 0 - ldr r0, =gUnknown_085E8B3A - lsls r2, 4 - adds r2, 0x9 - movs r1, 0x90 - bl sub_80C1270 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C2650 - - thumb_func_start sub_80C2668 -sub_80C2668: @ 80C2668 - push {lr} - adds r2, r0, 0 - adds r0, r1, 0 - lsls r2, 4 - adds r2, 0x9 - movs r1, 0x98 - bl sub_80C1270 - pop {r0} - bx r0 - thumb_func_end sub_80C2668 - - thumb_func_start sub_80C267C -sub_80C267C: @ 80C267C - push {lr} - movs r0, 0x90 - movs r1, 0x8 - movs r2, 0x60 - movs r3, 0x60 - bl sub_80C12B0 - pop {r0} - bx r0 - thumb_func_end sub_80C267C - - thumb_func_start sub_80C2690 -sub_80C2690: @ 80C2690 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - bl sub_80C48C8 - ldr r0, =0x02039ce8 - ldr r0, [r0] - ldrb r0, [r0, 0x9] - cmp r0, 0 - beq _080C26C0 - ldr r1, =0x040000d4 - ldr r0, =0x02038c28 - str r0, [r1] - movs r2, 0xF0 - lsls r2, 3 - adds r0, r2 - str r0, [r1, 0x4] - ldr r0, =0x800000a0 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] -_080C26C0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C2690 - - thumb_func_start sub_80C26D4 -sub_80C26D4: @ 80C26D4 - push {r4,lr} - ldr r4, =0x04000208 - ldrh r3, [r4] - movs r0, 0 - strh r0, [r4] - ldr r1, =0x02038c28 - ldr r0, =0x04000006 - ldrh r2, [r0] - movs r0, 0xFF - ands r0, r2 - lsls r0, 1 - movs r2, 0xF0 - lsls r2, 3 - adds r1, r2 - adds r0, r1 - ldrh r1, [r0] - ldr r0, =0x04000012 - strh r1, [r0] - strh r3, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C26D4 - - thumb_func_start sub_80C2710 -sub_80C2710: @ 80C2710 - push {lr} - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_80C2710 - - thumb_func_start sub_80C2728 -sub_80C2728: @ 80C2728 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =0x02039ce8 - ldr r0, [r5] - movs r1, 0xA6 - lsls r1, 3 - adds r0, r1 - ldr r0, [r0] - bl SetMainCallback2 - bl FreeAllWindowBuffers - ldr r0, [r5] - bl Free - movs r0, 0 - str r0, [r5] - adds r0, r4, 0 - bl DestroyTask - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C2728 - - thumb_func_start sub_80C2760 -sub_80C2760: @ 80C2760 - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x02039ce8 - ldr r0, [r1] - ldrb r0, [r0] - adds r4, r1, 0 - cmp r0, 0x10 - bls _080C2776 - b _080C2ACA -_080C2776: - lsls r0, 2 - ldr r1, =_080C2788 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C2788: - .4byte _080C27CC - .4byte _080C27E2 - .4byte _080C27F0 - .4byte _080C27F8 - .4byte _080C280C - .4byte _080C2820 - .4byte _080C2830 - .4byte _080C2836 - .4byte _080C289C - .4byte _080C28C8 - .4byte _080C28E4 - .4byte _080C299C - .4byte _080C2970 - .4byte _080C2AAA - .4byte _080C2A98 - .4byte _080C2A2C - .4byte _080C2A68 -_080C27CC: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _080C27D8 - b _080C2ACA -_080C27D8: - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - b _080C28D4 -_080C27E2: - bl sub_80C3438 - lsls r0, 24 - cmp r0, 0 - bne _080C27EE - b _080C2ACA -_080C27EE: - b _080C28D4 -_080C27F0: - movs r0, 0x1 - bl sub_80C438C - b _080C28D4 -_080C27F8: - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - bl sub_80C4FF0 - movs r0, 0x2 - bl sub_80C438C - b _080C28D4 -_080C280C: - ldr r0, [r4] - ldr r1, =0x00000ef8 - adds r0, r1 - bl sub_80C4550 - ldr r1, [r4] - b _080C28D8 - .pool -_080C2820: - ldr r0, [r4] - movs r2, 0xB3 - lsls r2, 3 - adds r0, r2 - bl sub_80C45C0 - ldr r1, [r4] - b _080C28D8 -_080C2830: - bl sub_80C4630 - b _080C28D4 -_080C2836: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0x1 - bne _080C2852 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080C2852 - bl sub_800E0E8 - movs r0, 0xE6 - movs r1, 0x96 - bl sub_800DFB4 -_080C2852: - movs r6, 0x1 - negs r6, r6 - ldr r4, =0x02039ce8 - ldr r0, [r4] - ldr r5, =0x0000052c - adds r0, r5 - ldrh r2, [r0] - adds r0, r6, 0 - movs r1, 0x10 - bl sub_80A2A20 - ldr r0, [r4] - adds r0, r5 - ldrh r0, [r0] - str r0, [sp] - adds r0, r6, 0 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =sub_80C2690 - bl SetVBlankCallback - ldr r1, [r4] - b _080C28D8 - .pool -_080C289C: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - beq _080C28A8 - b _080C2ACA -_080C28A8: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _080C28B4 - b _080C2ACA -_080C28B4: - movs r0, 0xFB - bl audio_play - ldr r0, =0x02039ce8 - ldr r1, [r0] - movs r0, 0xA - strb r0, [r1] - b _080C2ACA - .pool -_080C28C8: - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - beq _080C28D4 - b _080C2ACA -_080C28D4: - ldr r0, =0x02039ce8 - ldr r1, [r0] -_080C28D8: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C2ACA - .pool -_080C28E4: - ldr r0, =0x03003124 - ldrb r5, [r0] - cmp r5, 0 - bne _080C290A - ldr r0, [r4] - ldr r1, =0x00000529 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080C290A - bl sub_80C3880 - movs r0, 0x1 - bl sub_80C438C - ldr r0, [r4] - ldr r2, =0x00000529 - adds r0, r2 - strb r5, [r0] -_080C290A: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080C293C - bl sub_80C4918 - movs r0, 0xF9 - bl audio_play - ldr r0, =0x02039ce8 - ldr r1, [r0] - movs r0, 0xC - strb r0, [r1] - b _080C2ACA - .pool -_080C293C: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _080C2946 - b _080C2ACA -_080C2946: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _080C2960 - ldr r4, =0x02039ce8 - ldr r0, [r4] - ldrb r0, [r0, 0x5] - cmp r0, 0 - beq _080C2960 - bl InUnionRoom - cmp r0, 0x1 - beq _080C2A14 -_080C2960: - movs r0, 0x1 - negs r0, r0 - ldr r4, =0x02039ce8 - b _080C2A74 - .pool -_080C2970: - bl sub_80C4940 - lsls r0, 24 - cmp r0, 0 - bne _080C297C - b _080C2ACA -_080C297C: - bl sub_8087598 - cmp r0, 0x1 - bne _080C2986 - b _080C2ACA -_080C2986: - movs r0, 0xFB - bl audio_play - ldr r0, =0x02039ce8 - ldr r1, [r0] - movs r0, 0xB - strb r0, [r1] - b _080C2ACA - .pool -_080C299C: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080C29F4 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _080C29DC - ldr r0, [r4] - ldrb r0, [r0, 0x5] - cmp r0, 0 - beq _080C29C0 - bl InUnionRoom - cmp r0, 0x1 - beq _080C2A14 -_080C29C0: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _080C29DC - movs r0, 0x1 - negs r0, r0 - ldr r4, =0x02039ce8 - b _080C2A74 - .pool -_080C29DC: - bl sub_80C4918 - ldr r0, =0x02039ce8 - ldr r1, [r0] - movs r0, 0xD - strb r0, [r1] - movs r0, 0xF9 - bl audio_play - b _080C2ACA - .pool -_080C29F4: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080C2ACA - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _080C2A20 - ldr r0, [r4] - ldrb r0, [r0, 0x5] - cmp r0, 0 - beq _080C2A20 - bl InUnionRoom - cmp r0, 0x1 - bne _080C2A20 -_080C2A14: - ldr r1, [r4] - movs r0, 0xF - strb r0, [r1] - b _080C2ACA - .pool -_080C2A20: - movs r0, 0x1 - negs r0, r0 - ldr r4, =0x02039ce8 - b _080C2A74 - .pool -_080C2A2C: - bl sub_800AC34 - movs r0, 0 - movs r1, 0x1 - bl sub_81973C4 - ldr r2, =gUnknown_085ED042 - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =0x02039ce8 - ldr r1, [r0] - movs r0, 0x10 - strb r0, [r1] - b _080C2ACA - .pool -_080C2A68: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _080C2ACA - movs r0, 0x1 - negs r0, r0 -_080C2A74: - ldr r1, [r4] - ldr r2, =0x0000052c - adds r1, r2 - ldrh r1, [r1] - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, [r4] - movs r0, 0xE - strb r0, [r1] - b _080C2ACA - .pool -_080C2A98: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _080C2ACA - adds r0, r5, 0 - bl sub_80C2728 - b _080C2ACA -_080C2AAA: - bl sub_80C4940 - lsls r0, 24 - cmp r0, 0 - beq _080C2ACA - bl sub_8087598 - cmp r0, 0x1 - beq _080C2ACA - ldr r0, =0x02039ce8 - ldr r1, [r0] - movs r0, 0xA - strb r0, [r1] - movs r0, 0xFB - bl audio_play -_080C2ACA: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C2760 - - thumb_func_start sub_80C2AD8 -sub_80C2AD8: @ 80C2AD8 - push {lr} - ldr r0, =0x02039ce8 - ldr r1, [r0] - ldrb r0, [r1, 0x2] - cmp r0, 0x5 - bls _080C2AE6 - b _080C2C64 -_080C2AE6: - lsls r0, 2 - ldr r1, =_080C2AF8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C2AF8: - .4byte _080C2B10 - .4byte _080C2B44 - .4byte _080C2B78 - .4byte _080C2BD0 - .4byte _080C2C04 - .4byte _080C2C38 -_080C2B10: - ldr r0, =0x02039ce8 - ldr r1, [r0] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C2B34 - ldr r0, =gUnknown_08DD1F78 - ldr r2, =0x00000ef8 - b _080C2C4A - .pool -_080C2B34: - ldr r0, =gUnknown_08DD2AE0 - ldr r2, =0x00000ef8 - b _080C2C4A - .pool -_080C2B44: - ldr r0, =0x02039ce8 - ldr r1, [r0] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C2B68 - ldr r0, =gUnknown_08DD21B0 - ldr r2, =0x00000a48 - b _080C2C4A - .pool -_080C2B68: - ldr r0, =gUnknown_08DD2D30 - ldr r2, =0x00000a48 - b _080C2C4A - .pool -_080C2B78: - ldr r0, =0x02039ce8 - ldr r1, [r0] - ldrb r0, [r1, 0x5] - cmp r0, 0 - bne _080C2BAC - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C2BA0 - ldr r0, =gUnknown_08DD2010 - adds r2, 0x6E - b _080C2C4A - .pool -_080C2BA0: - ldr r0, =gUnknown_08DD2B78 - movs r2, 0xB3 - lsls r2, 3 - b _080C2C4A - .pool -_080C2BAC: - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C2BC4 - ldr r0, =gUnknown_08DD228C - adds r2, 0x6E - b _080C2C4A - .pool -_080C2BC4: - ldr r0, =gUnknown_08DD2E5C - movs r2, 0xB3 - lsls r2, 3 - b _080C2C4A - .pool -_080C2BD0: - ldr r0, =0x02039ce8 - ldr r1, [r0] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C2BF4 - ldr r0, =gUnknown_0856F5CC - ldr r2, =0x000013a8 - b _080C2C4A - .pool -_080C2BF4: - ldr r0, =gUnknown_0856F814 - ldr r2, =0x000013a8 - b _080C2C4A - .pool -_080C2C04: - ldr r0, =0x02039ce8 - ldr r1, [r0] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C2C28 - ldr r0, =gUnknown_08DD1AB8 - ldr r2, =0x000019a8 - b _080C2C4A - .pool -_080C2C28: - ldr r0, =gUnknown_08DD246C - ldr r2, =0x000019a8 - b _080C2C4A - .pool -_080C2C38: - ldr r0, =0x02039ce8 - ldr r1, [r0] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080C2C6C - ldr r0, =gUnknown_0856F018 - ldr r2, =0x000017a8 -_080C2C4A: - adds r1, r2 - bl LZ77UnCompWram - b _080C2C6C - .pool -_080C2C64: - movs r0, 0 - strb r0, [r1, 0x2] - movs r0, 0x1 - b _080C2C78 -_080C2C6C: - ldr r0, =0x02039ce8 - ldr r1, [r0] - ldrb r0, [r1, 0x2] - adds r0, 0x1 - strb r0, [r1, 0x2] - movs r0, 0 -_080C2C78: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C2AD8 - - thumb_func_start sub_80C2C80 -sub_80C2C80: @ 80C2C80 - push {lr} - sub sp, 0x8 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r3, r1, 0 - cmp r0, 0xA - bls _080C2C96 - b _080C2DD8 -_080C2C96: - lsls r0, 2 - ldr r1, =_080C2CA8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C2CA8: - .4byte _080C2CD4 - .4byte _080C2CEC - .4byte _080C2D14 - .4byte _080C2D50 - .4byte _080C2D6A - .4byte _080C2D74 - .4byte _080C2D88 - .4byte _080C2D8E - .4byte _080C2DA0 - .4byte _080C2DA6 - .4byte _080C2DB8 -_080C2CD4: - bl sub_80C334C - bl sub_80C3414 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _080C2DCC - .pool -_080C2CEC: - movs r1, 0xE0 - lsls r1, 19 - movs r0, 0 - str r0, [sp] - ldr r0, =0x040000d4 - mov r2, sp - str r2, [r0] - str r1, [r0, 0x4] - ldr r1, =0x85000100 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - movs r0, 0x87 - lsls r0, 3 - adds r1, r3, r0 - b _080C2DCC - .pool -_080C2D14: - ldr r0, =0x02039ce8 - ldr r0, [r0] - ldr r1, =0x0000052c - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - bne _080C2D36 - movs r2, 0xA0 - lsls r2, 19 - add r1, sp, 0x4 - strh r0, [r1] - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x81000200 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] -_080C2D36: - movs r2, 0x87 - lsls r2, 3 - adds r1, r3, r2 - b _080C2DCC - .pool -_080C2D50: - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - bl sub_80A1A74 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080C2D6A: - bl sub_80C3388 - b _080C2DC4 - .pool -_080C2D74: - bl sub_80C41D8 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _080C2DCC - .pool -_080C2D88: - bl sub_80C2AD8 - b _080C2DBC -_080C2D8E: - bl sub_80C4330 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _080C2DCC - .pool -_080C2DA0: - bl sub_80C3278 - b _080C2DC4 -_080C2DA6: - bl sub_80C3548 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _080C2DCC - .pool -_080C2DB8: - bl sub_80C43A8 -_080C2DBC: - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080C2DDC -_080C2DC4: - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_080C2DCC: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C2DDC - .pool -_080C2DD8: - bl sub_80C3404 -_080C2DDC: - add sp, 0x8 - pop {r0} - bx r0 - thumb_func_end sub_80C2C80 - - thumb_func_start sav12_xor_get_clamped_above -sav12_xor_get_clamped_above: @ 80C2DE4 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - bl sub_80847F8 - cmp r0, r4 - bls _080C2DF6 - adds r0, r4, 0 -_080C2DF6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sav12_xor_get_clamped_above - - thumb_func_start sub_80C2DFC -sub_80C2DFC: @ 80C2DFC - push {r4,r5,lr} - movs r5, 0 -_080C2E00: - lsls r4, r5, 1 - ldr r1, =0x000008c4 - adds r0, r4, r1 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080C2E1E - ldr r1, =0x000008c5 - adds r0, r4, r1 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _080C2E2C -_080C2E1E: - movs r0, 0 - b _080C2E38 - .pool -_080C2E2C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x6 - bls _080C2E00 - movs r0, 0x1 -_080C2E38: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80C2DFC - - thumb_func_start sub_80C2E40 -sub_80C2E40: @ 80C2E40 - push {r4,lr} - movs r0, 0xA - bl sub_80847F8 - negs r1, r0 - orrs r1, r0 - lsrs r4, r1, 31 - bl sub_80C08E4 - lsls r0, 16 - cmp r0, 0 - beq _080C2E5A - adds r4, 0x1 -_080C2E5A: - bl sub_80F8940 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bls _080C2E6C - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_080C2E6C: - bl sub_80C2DFC - lsls r0, 24 - cmp r0, 0 - beq _080C2E7C - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_080C2E7C: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80C2E40 - - thumb_func_start sub_80C2E84 -sub_80C2E84: @ 80C2E84 - push {lr} - adds r1, r0, 0 - movs r2, 0 - ldrh r0, [r1, 0x6] - cmp r0, 0 - bne _080C2E96 - ldr r0, [r1, 0x8] - cmp r0, 0 - beq _080C2E98 -_080C2E96: - movs r2, 0x1 -_080C2E98: - ldrb r0, [r1, 0x3] - cmp r0, 0 - beq _080C2EA4 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_080C2EA4: - ldrh r0, [r1, 0x1A] - cmp r0, 0x31 - bls _080C2EB0 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_080C2EB0: - ldrb r0, [r1, 0x4] - cmp r0, 0 - beq _080C2EBC - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_080C2EBC: - adds r0, r2, 0 - pop {r1} - bx r1 - thumb_func_end sub_80C2E84 - - thumb_func_start sub_80C2EC4 -sub_80C2EC4: @ 80C2EC4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - ldr r6, =0x03005d90 - ldr r1, [r6] - ldrb r0, [r1, 0x8] - strb r0, [r5] - ldrh r0, [r1, 0xE] - strh r0, [r5, 0x10] - ldrb r0, [r1, 0x10] - strh r0, [r5, 0x12] - movs r0, 0x1 - bl sub_80847F8 - adds r4, r0, 0 - movs r0, 0xA - bl sub_80847F8 - cmp r0, 0 - bne _080C2EF6 - movs r4, 0 -_080C2EF6: - lsrs r0, r4, 16 - strh r0, [r5, 0x6] - lsrs r1, r4, 8 - movs r2, 0xFF - ands r1, r2 - strh r1, [r5, 0x8] - ands r4, r2 - strh r4, [r5, 0xA] - ldr r1, =0x000003e7 - cmp r0, r1 - bls _080C2F14 - strh r1, [r5, 0x6] - movs r0, 0x3B - strh r0, [r5, 0x8] - strh r0, [r5, 0xA] -_080C2F14: - ldr r0, =0x00000861 - bl FlagGet - strb r0, [r5, 0x2] - bl sub_80C08E4 - strb r0, [r5, 0x3] - bl sub_80C376C - strh r0, [r5, 0xC] - ldr r0, [r6] - ldrb r1, [r0, 0xB] - lsls r1, 8 - ldrb r0, [r0, 0xA] - orrs r0, r1 - strh r0, [r5, 0xE] - ldr r4, =0x0000270f - movs r0, 0x17 - adds r1, r4, 0 - bl sav12_xor_get_clamped_above - strh r0, [r5, 0x14] - movs r0, 0x18 - adds r1, r4, 0 - bl sav12_xor_get_clamped_above - strh r0, [r5, 0x16] - ldr r1, =0x0000ffff - movs r0, 0x15 - bl sav12_xor_get_clamped_above - strh r0, [r5, 0x20] - ldr r4, =0x03005d8c - ldr r0, [r4] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - bl DecryptMoney - str r0, [r5, 0x24] - movs r2, 0 - adds r7, r5, 0 - adds r7, 0x30 - adds r6, r5, 0 - adds r6, 0x28 - ldr r0, [r4] - ldr r1, =0x00002bb0 - adds r3, r0, r1 -_080C2F74: - lsls r0, r2, 1 - adds r1, r6, r0 - adds r0, r3, r0 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _080C2F74 - ldr r0, =0x03005d90 - ldr r1, [r0] - adds r0, r7, 0 - bl CopyString - mov r0, r8 - cmp r0, 0x1 - beq _080C3004 - cmp r0, 0x1 - bgt _080C2FC0 - cmp r0, 0 - beq _080C2FCC - b _080C3014 - .pool -_080C2FC0: - mov r1, r8 - cmp r1, 0x2 - bne _080C3014 - movs r0, 0 - strh r0, [r5, 0x18] - strh r0, [r5, 0x1A] -_080C2FCC: - ldr r1, =0x000003e7 - movs r0, 0x23 - bl sav12_xor_get_clamped_above - strh r0, [r5, 0x1C] - ldr r1, =0x0000ffff - movs r0, 0x22 - bl sav12_xor_get_clamped_above - strh r0, [r5, 0x1E] - bl sub_80F8940 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bls _080C2FF0 - movs r0, 0x1 - strb r0, [r5, 0x4] -_080C2FF0: - adds r0, r5, 0 - bl sub_80C2E84 - strb r0, [r5, 0x1] - b _080C3014 - .pool -_080C3004: - movs r1, 0 - movs r0, 0 - strh r0, [r5, 0x18] - strh r0, [r5, 0x1A] - strh r0, [r5, 0x1C] - strh r0, [r5, 0x1E] - strb r1, [r5, 0x4] - strb r1, [r5, 0x1] -_080C3014: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80C2EC4 - - thumb_func_start sub_80C3020 -sub_80C3020: @ 80C3020 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - movs r2, 0x64 - bl memset - adds r1, r4, 0 - adds r1, 0x38 - movs r0, 0x3 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2 - bl sub_80C2EC4 - bl sub_80C2DFC - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - adds r1, 0x60 - strh r0, [r1] - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r2, =0x00000eba - adds r0, r2 - ldrh r0, [r0] - adds r2, r4, 0 - adds r2, 0x62 - strh r0, [r2] - ldrh r0, [r1] - cmp r0, 0 - beq _080C3066 - ldrb r0, [r4, 0x1] - adds r0, 0x1 - strb r0, [r4, 0x1] -_080C3066: - ldrb r0, [r4] - cmp r0, 0x1 - bne _080C3084 - ldr r2, =gUnknown_08329D54 - ldrh r0, [r4, 0xE] - movs r1, 0x7 - ands r0, r1 - adds r0, 0x8 - b _080C308C - .pool -_080C3084: - ldr r2, =gUnknown_08329D54 - ldrh r0, [r4, 0xE] - movs r1, 0x7 - ands r0, r1 -_080C308C: - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - adds r0, r4, 0 - adds r0, 0x4F - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3020 - - thumb_func_start sub_80C30A4 -sub_80C30A4: @ 80C30A4 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - movs r2, 0x60 - bl memset - adds r1, r4, 0 - adds r1, 0x38 - movs r0, 0x3 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2 - bl sub_80C2EC4 - bl sub_80C2DFC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x3A] - ldr r1, =0x03005d90 - ldr r1, [r1] - ldr r2, =0x00000eba - adds r1, r2 - ldrh r1, [r1] - strh r1, [r4, 0x3C] - cmp r0, 0 - beq _080C30E0 - ldrb r0, [r4, 0x1] - adds r0, 0x1 - strb r0, [r4, 0x1] -_080C30E0: - ldrb r0, [r4] - cmp r0, 0x1 - bne _080C3100 - ldr r2, =gUnknown_08329D54 - ldrh r0, [r4, 0xE] - movs r1, 0x7 - ands r0, r1 - adds r0, 0x8 - b _080C3108 - .pool -_080C3100: - ldr r2, =gUnknown_08329D54 - ldrh r0, [r4, 0xE] - movs r1, 0x7 - ands r0, r1 -_080C3108: - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - adds r0, r4, 0 - adds r0, 0x4F - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C30A4 - - thumb_func_start sub_80C3120 -sub_80C3120: @ 80C3120 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - lsls r4, r2, 24 - lsrs r4, 24 - movs r1, 0 - movs r2, 0x64 - bl memset - adds r0, r5, 0 - adds r0, 0x38 - strb r4, [r0] - adds r0, r4, 0 - bl sub_80C4FCC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080C3162 - cmp r0, 0x1 - bgt _080C3150 - cmp r0, 0 - beq _080C3156 - b _080C318A -_080C3150: - cmp r0, 0x2 - beq _080C316E - b _080C318A -_080C3156: - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x60 - bl memcpy - b _080C318A -_080C3162: - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x38 - bl memcpy - b _080C318A -_080C316E: - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x60 - bl memcpy - movs r0, 0 - str r0, [r5, 0x3C] - ldrh r1, [r6, 0x3A] - adds r0, r5, 0 - adds r0, 0x60 - strh r1, [r0] - ldrh r1, [r6, 0x3C] - adds r0, 0x2 - strh r1, [r0] -_080C318A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80C3120 - - thumb_func_start sub_80C3190 -sub_80C3190: @ 80C3190 - push {r4,r5,lr} - ldr r4, =0x02039ce8 - ldr r0, [r4] - movs r1, 0 - strb r1, [r0, 0xA] - ldr r0, [r4] - strb r1, [r0, 0xB] - ldr r0, [r4] - strb r1, [r0, 0xC] - ldr r0, [r4] - strb r1, [r0, 0xD] - ldr r0, [r4] - strb r1, [r0, 0xE] - ldr r0, [r4] - strb r1, [r0, 0xF] - ldr r0, [r4] - strb r1, [r0, 0x10] - ldr r0, [r4] - adds r0, 0x11 - movs r2, 0x8 - bl memset - ldr r1, [r4] - ldr r2, =0x00000536 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C31CE - ldrb r0, [r1, 0xA] - adds r0, 0x1 - strb r0, [r1, 0xA] -_080C31CE: - ldr r1, [r4] - ldr r3, =0x0000053a - adds r0, r1, r3 - ldrh r0, [r0] - cmp r0, 0 - bne _080C31E4 - ldr r2, =0x0000053c - adds r0, r1, r2 - ldr r0, [r0] - cmp r0, 0 - beq _080C31EA -_080C31E4: - ldrb r0, [r1, 0xB] - adds r0, 0x1 - strb r0, [r1, 0xB] -_080C31EA: - ldr r2, =0x02039ce8 - ldr r1, [r2] - movs r3, 0xA9 - lsls r3, 3 - adds r0, r1, r3 - ldr r0, [r0] - cmp r0, 0 - beq _080C3200 - ldrb r0, [r1, 0xC] - adds r0, 0x1 - strb r0, [r1, 0xC] -_080C3200: - ldr r1, [r2] - ldr r3, =0x00000554 - adds r0, r1, r3 - ldrh r0, [r0] - cmp r0, 0 - beq _080C3212 - ldrb r0, [r1, 0x10] - adds r0, 0x1 - strb r0, [r1, 0x10] -_080C3212: - ldr r1, [r2] - ldr r2, =0x0000054c - adds r0, r1, r2 - ldr r0, [r0] - cmp r0, 0 - beq _080C3224 - ldrb r0, [r1, 0xD] - adds r0, 0x1 - strb r0, [r1, 0xD] -_080C3224: - movs r5, 0 - ldr r4, =0x00000867 -_080C3228: - lsls r0, r4, 16 - lsrs r0, 16 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080C3244 - ldr r0, =0x02039ce8 - ldr r1, [r0] - adds r1, 0x11 - adds r1, r5 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080C3244: - adds r4, 0x1 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x0000086e - cmp r4, r0 - bls _080C3228 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3190 - - thumb_func_start sub_80C3278 -sub_80C3278: @ 80C3278 - push {lr} - movs r1, 0xC1 - lsls r1, 6 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r0, 0x50 - movs r1, 0xC1 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x1E - bl SetGpuReg - movs r0, 0x44 - movs r1, 0xA0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0xF0 - bl SetGpuReg - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _080C32E0 - movs r0, 0xC7 - bl EnableInterrupts - b _080C32E6 - .pool -_080C32E0: - movs r0, 0x3 - bl EnableInterrupts -_080C32E6: - pop {r0} - bx r0 - thumb_func_end sub_80C3278 - - thumb_func_start sub_80C32EC -sub_80C32EC: @ 80C32EC - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - adds r0, 0x28 - movs r1, 0xA - bl __divsi3 - lsls r0, 24 - lsrs r2, r0, 24 - asrs r0, 24 - cmp r0, 0x4 - bgt _080C3306 - movs r2, 0 -_080C3306: - ldr r4, =0x02039ce8 - ldr r0, [r4] - movs r1, 0xA5 - lsls r1, 3 - adds r0, r1 - strb r2, [r0] - ldr r0, [r4] - adds r0, r1 - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x54 - bl SetGpuReg - ldr r0, [r4] - ldr r1, =0x00007ca8 - adds r0, r1 - ldrh r2, [r0] - lsls r1, r2, 8 - movs r0, 0xA0 - subs r0, r2 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C32EC - - thumb_func_start sub_80C334C -sub_80C334C: @ 80C334C - push {lr} - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0x8 - movs r1, 0 - bl SetGpuReg - movs r0, 0xA - movs r1, 0 - bl SetGpuReg - movs r0, 0xC - movs r1, 0 - bl SetGpuReg - movs r0, 0xE - movs r1, 0 - bl SetGpuReg - pop {r0} - bx r0 - thumb_func_end sub_80C334C - - thumb_func_start sub_80C3388 -sub_80C3388: @ 80C3388 - push {lr} - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0856FAB4 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - 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 - ldr r0, =gUnknown_0856FAC4 - bl InitWindows - bl DeactivateAllTextPrinters - bl sub_81973A4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3388 - - thumb_func_start sub_80C3404 -sub_80C3404: @ 80C3404 - push {lr} - ldr r0, =sub_80C2710 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3404 - - thumb_func_start sub_80C3414 -sub_80C3414: @ 80C3414 - push {lr} - bl ResetTasks - bl remove_some_task - ldr r0, =sub_80C2760 - movs r1, 0 - bl CreateTask - bl sub_80C4EE4 - bl sub_80C3190 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3414 - - thumb_func_start sub_80C3438 -sub_80C3438: @ 80C3438 - push {lr} - ldr r0, =0x02039ce8 - ldr r1, [r0] - ldrb r0, [r1, 0x1] - cmp r0, 0x5 - bhi _080C3494 - lsls r0, 2 - ldr r1, =_080C3458 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C3458: - .4byte _080C3470 - .4byte _080C3476 - .4byte _080C347C - .4byte _080C3482 - .4byte _080C3488 - .4byte _080C348E -_080C3470: - bl sub_80C3574 - b _080C349C -_080C3476: - bl sub_80C3608 - b _080C349C -_080C347C: - bl sub_80C3684 - b _080C349C -_080C3482: - bl sub_80C378C - b _080C349C -_080C3488: - bl sub_80C3880 - b _080C349C -_080C348E: - bl sub_80C3A18 - b _080C349C -_080C3494: - movs r0, 0 - strb r0, [r1, 0x1] - movs r0, 0x1 - b _080C34A8 -_080C349C: - ldr r0, =0x02039ce8 - ldr r1, [r0] - ldrb r0, [r1, 0x1] - adds r0, 0x1 - strb r0, [r1, 0x1] - movs r0, 0 -_080C34A8: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C3438 - - thumb_func_start sub_80C34B0 -sub_80C34B0: @ 80C34B0 - push {lr} - ldr r0, =0x02039ce8 - ldr r1, [r0] - ldrb r0, [r1, 0x1] - cmp r0, 0x7 - bhi _080C352C - lsls r0, 2 - ldr r1, =_080C34D0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C34D0: - .4byte _080C34F0 - .4byte _080C34F6 - .4byte _080C34FC - .4byte _080C3502 - .4byte _080C3508 - .4byte _080C3512 - .4byte _080C351C - .4byte _080C3526 -_080C34F0: - bl sub_80C3B50 - b _080C3534 -_080C34F6: - bl sub_80C3CCC - b _080C3534 -_080C34FC: - bl sub_80C3D60 - b _080C3534 -_080C3502: - bl sub_80C3DF0 - b _080C3534 -_080C3508: - bl sub_80C3E58 - bl sub_80C3F64 - b _080C3534 -_080C3512: - bl sub_80C3ED4 - bl sub_80C3FE0 - b _080C3534 -_080C351C: - bl sub_80C4140 - bl sub_80C40CC - b _080C3534 -_080C3526: - bl sub_80C42A4 - b _080C3534 -_080C352C: - movs r0, 0 - strb r0, [r1, 0x1] - movs r0, 0x1 - b _080C3540 -_080C3534: - ldr r0, =0x02039ce8 - ldr r1, [r0] - ldrb r0, [r1, 0x1] - adds r0, 0x1 - strb r0, [r1, 0x1] - movs r0, 0 -_080C3540: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C34B0 - - thumb_func_start sub_80C3548 -sub_80C3548: @ 80C3548 - push {lr} - bl sub_80C3AF0 - bl sub_80C3BC4 - bl sub_80C3CF4 - bl sub_80C3DC0 - bl sub_80C3E20 - bl sub_80C3E98 - bl sub_80C3F14 - bl sub_80C3FA4 - bl sub_80C4020 - pop {r0} - bx r0 - thumb_func_end sub_80C3548 - - thumb_func_start sub_80C3574 -sub_80C3574: @ 80C3574 - push {r4,r5,lr} - sub sp, 0x2C - ldr r1, =gUnknown_085ECF71 - add r0, sp, 0xC - bl CopyString - adds r5, r0, 0 - ldr r4, =0x02039ce8 - ldr r1, [r4] - ldr r0, =0x00000564 - adds r1, r0 - adds r0, r5, 0 - bl CopyString - ldr r0, [r4] - ldr r1, =0x00007caa - adds r0, r1 - ldrb r1, [r0] - adds r0, r5, 0 - bl StopMusicWhileStringIsPrinted - ldr r0, [r4] - ldr r1, =0x0000052a - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C35E0 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x14 - movs r3, 0x1C - bl box_print - b _080C35FA - .pool -_080C35E0: - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - add r1, sp, 0xC - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0x21 - bl box_print -_080C35FA: - add sp, 0x2C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3574 - - thumb_func_start sub_80C3608 -sub_80C3608: @ 80C3608 - push {r4,lr} - sub sp, 0x2C - ldr r1, =gUnknown_085ECF78 - add r0, sp, 0xC - bl CopyString - ldr r4, =0x02039ce8 - ldr r1, [r4] - ldr r2, =0x00000542 - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x2 - movs r3, 0x5 - bl ConvertIntToDecimalString - ldr r0, [r4] - ldr r1, =0x0000052a - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3650 - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0x50 - bl GetStringCenterAlignXOffset - adds r0, 0x84 - b _080C365C - .pool -_080C3650: - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0x60 - bl GetStringCenterAlignXOffset - adds r0, 0x78 -_080C365C: - movs r3, 0x9 - lsls r2, r0, 24 - lsrs r2, 24 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - bl box_print - add sp, 0x2C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3608 - - thumb_func_start sub_80C3684 -sub_80C3684: @ 80C3684 - push {r4,r5,lr} - sub sp, 0xC - ldr r0, =0x02039ce8 - ldr r0, [r0] - ldr r1, =0x0000052b - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C36C4 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =gUnknown_085ECF7E - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x14 - movs r3, 0x38 - bl box_print - b _080C36DE - .pool -_080C36C4: - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =gUnknown_085ECF7E - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0x39 - bl box_print -_080C36DE: - ldr r0, =0x02021cc4 - ldr r4, =0x02039ce8 - ldr r1, [r4] - movs r2, 0xAB - lsls r2, 3 - adds r1, r2 - ldr r1, [r1] - movs r2, 0 - movs r3, 0x6 - bl ConvertIntToDecimalString - ldr r5, =0x02021fc4 - ldr r1, =gUnknown_085E969C - adds r0, r5, 0 - bl ExpandStringRefs - ldr r0, [r4] - ldr r1, =0x0000052b - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3734 - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x90 - bl GetStringRightAlignXOffset - movs r3, 0x38 - b _080C3740 - .pool -_080C3734: - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x80 - bl GetStringRightAlignXOffset - movs r3, 0x39 -_080C3740: - lsls r2, r0, 24 - lsrs r2, 24 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =0x02021fc4 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - bl box_print - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3684 - - thumb_func_start sub_80C376C -sub_80C376C: @ 80C376C - push {lr} - bl sub_809D42C - cmp r0, 0 - bne _080C377E - movs r0, 0x1 - bl sub_80C0844 - b _080C3784 -_080C377E: - movs r0, 0x1 - bl pokedex_count -_080C3784: - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_80C376C - - thumb_func_start sub_80C378C -sub_80C378C: @ 80C378C - push {r4,r5,lr} - sub sp, 0xC - ldr r0, =0x00000861 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080C386E - ldr r0, =0x02039ce8 - ldr r0, [r0] - ldr r1, =0x0000052b - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C37DC - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =gUnknown_085ECF86 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x14 - movs r3, 0x48 - bl box_print - b _080C37F6 - .pool -_080C37DC: - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =gUnknown_085ECF86 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0x49 - bl box_print -_080C37F6: - ldr r5, =0x02021fc4 - ldr r4, =0x02039ce8 - ldr r0, [r4] - movs r1, 0xA8 - lsls r1, 3 - adds r0, r1 - ldrh r1, [r0] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r1, =gUnknown_085ECF8E - bl CopyString - ldr r0, [r4] - ldr r1, =0x0000052b - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3848 - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x90 - bl GetStringRightAlignXOffset - movs r3, 0x48 - b _080C3854 - .pool -_080C3848: - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x80 - bl GetStringRightAlignXOffset - movs r3, 0x49 -_080C3854: - lsls r2, r0, 24 - lsrs r2, 24 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =0x02021fc4 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - bl box_print -_080C386E: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C378C - - thumb_func_start sub_80C3880 -sub_80C3880: @ 80C3880 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - ldr r0, =0x02039ce8 - ldr r0, [r0] - ldr r1, =0x0000052b - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C38C8 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =gUnknown_085ECF99 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x14 - movs r3, 0x58 - bl box_print - b _080C38E2 - .pool -_080C38C8: - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =gUnknown_085ECF99 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0x59 - bl box_print -_080C38E2: - ldr r0, =0x02039ce8 - ldr r1, [r0] - ldrb r0, [r1, 0x5] - cmp r0, 0 - beq _080C390C - ldr r2, =0x00000544 - adds r0, r1, r2 - ldrh r5, [r0] - adds r2, 0x2 - adds r0, r1, r2 - ldrh r6, [r0] - b _080C3914 - .pool -_080C390C: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrh r5, [r0, 0xE] - ldrb r6, [r0, 0x10] -_080C3914: - ldr r0, =0x000003e7 - cmp r5, r0 - bls _080C391C - adds r5, r0, 0 -_080C391C: - cmp r6, 0x3B - bls _080C3922 - movs r6, 0x3B -_080C3922: - ldr r1, =gUnknown_085ECF8F - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - mov r10, r0 - ldr r0, =0x02039ce8 - ldr r0, [r0] - ldr r1, =0x0000052b - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3958 - movs r7, 0x90 - movs r4, 0x58 - b _080C395C - .pool -_080C3958: - movs r7, 0x80 - movs r4, 0x59 -_080C395C: - mov r0, r10 - adds r0, 0x1E - subs r7, r0 - lsls r2, r7, 16 - lsrs r2, 16 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp] - movs r0, 0xF - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - adds r3, r4, 0 - bl FillWindowPixelRect - ldr r2, =0x02021fc4 - mov r9, r2 - mov r0, r9 - adds r1, r5, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - lsls r2, r7, 24 - lsrs r2, 24 - ldr r0, =gUnknown_0856FB0C - mov r8, r0 - str r0, [sp] - movs r5, 0x1 - negs r5, r5 - str r5, [sp, 0x4] - mov r1, r9 - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - adds r3, r4, 0 - bl box_print - adds r7, 0x12 - lsls r2, r7, 24 - lsrs r2, 24 - ldr r1, =gUnknown_0856FB40 - ldr r0, =0x02039ce8 - ldr r0, [r0] - ldrb r0, [r0, 0x7] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [sp] - str r5, [sp, 0x4] - ldr r0, =gUnknown_085ECF8F - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - adds r3, r4, 0 - bl box_print - add r7, r10 - mov r0, r9 - adds r1, r6, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - lsls r2, r7, 24 - lsrs r2, 24 - mov r0, r8 - str r0, [sp] - str r5, [sp, 0x4] - mov r1, r9 - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - adds r3, r4, 0 - bl box_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_80C3880 - - thumb_func_start sub_80C3A18 -sub_80C3A18: @ 80C3A18 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - ldr r7, =0x02039ce8 - ldr r1, [r7] - ldrb r0, [r1, 0x5] - cmp r0, 0 - beq _080C3ACE - ldr r0, =gUnknown_0856FB48 - mov r8, r0 - ldr r4, =0x0000052b - adds r0, r1, r4 - ldrb r0, [r0] - add r0, r8 - ldrb r3, [r0] - ldr r6, =gUnknown_0856FB0C - str r6, [sp] - movs r5, 0x1 - negs r5, r5 - str r5, [sp, 0x4] - adds r0, r1, 0 - adds r0, 0x19 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x8 - bl box_print - ldr r1, [r7] - adds r1, 0x19 - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - adds r2, r0, 0 - adds r2, 0xE - lsls r2, 24 - lsrs r2, 24 - ldr r1, [r7] - adds r0, r1, r4 - ldrb r0, [r0] - add r0, r8 - ldrb r3, [r0] - str r6, [sp] - str r5, [sp, 0x4] - adds r1, 0x26 - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - bl box_print - ldr r0, =gUnknown_0856FB4A - mov r8, r0 - ldr r1, [r7] - adds r0, r1, r4 - ldrb r0, [r0] - add r0, r8 - ldrb r3, [r0] - str r6, [sp] - str r5, [sp, 0x4] - adds r1, 0x33 - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x8 - bl box_print - ldr r1, [r7] - adds r1, 0x33 - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - adds r2, r0, 0 - adds r2, 0xE - lsls r2, 24 - lsrs r2, 24 - ldr r1, [r7] - adds r4, r1, r4 - ldrb r0, [r4] - add r0, r8 - ldrb r3, [r0] - str r6, [sp] - str r5, [sp, 0x4] - adds r1, 0x40 - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - bl box_print -_080C3ACE: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3A18 - - thumb_func_start sub_80C3AF0 -sub_80C3AF0: @ 80C3AF0 - push {r4,lr} - ldr r4, =0x02039ce8 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x4D - ldr r2, =0x00000564 - adds r1, r2 - bl CopyString - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x4D - ldr r2, =0x00007caa - adds r1, r2 - ldrb r1, [r1] - bl StopMusicWhileStringIsPrinted - ldr r1, [r4] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C3B30 - ldr r0, =0x02021cc4 - adds r1, 0x4D - bl CopyString - ldr r0, [r4] - adds r0, 0x4D - ldr r1, =gUnknown_085ECFA6 - bl ExpandStringRefs -_080C3B30: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3AF0 - - thumb_func_start sub_80C3B50 -sub_80C3B50: @ 80C3B50 - push {r4,lr} - sub sp, 0xC - ldr r4, =0x02039ce8 - ldr r1, [r4] - ldr r2, =0x0000052b - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3B8C - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - adds r0, r1, 0 - adds r0, 0x4D - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x88 - movs r3, 0x9 - bl box_print - b _080C3BB6 - .pool -_080C3B8C: - adds r1, 0x4D - movs r0, 0x1 - movs r2, 0xD8 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, [r4] - adds r0, 0x4D - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x9 - bl box_print -_080C3BB6: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3B50 - - thumb_func_start sub_80C3BC4 -sub_80C3BC4: @ 80C3BC4 - push {r4,lr} - ldr r4, =0x02039ce8 - ldr r1, [r4] - ldrb r0, [r1, 0xB] - cmp r0, 0 - beq _080C3C0E - ldr r0, =0x02021cc4 - ldr r2, =0x0000053a - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r0, =0x02021dc4 - ldr r1, [r4] - ldr r2, =0x0000053c - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, =0x02021ec4 - ldr r1, [r4] - ldr r2, =0x0000053e - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, [r4] - adds r0, 0x93 - ldr r1, =gUnknown_0856FB4C - bl ExpandStringRefs -_080C3C0E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3BC4 - - thumb_func_start sub_80C3C34 -sub_80C3C34: @ 80C3C34 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0xC - adds r4, r0, 0 - mov r9, r2 - mov r10, r3 - ldr r2, =gUnknown_0856FB55 - ldr r6, =0x02039ce8 - ldr r0, [r6] - ldr r5, =0x0000052b - adds r0, r5 - ldrb r0, [r0] - adds r0, r2 - ldrb r2, [r0] - lsls r4, 28 - movs r0, 0x84 - lsls r0, 22 - adds r4, r0 - lsrs r4, 24 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - mov r8, r0 - str r0, [sp, 0x4] - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - adds r3, r4, 0 - bl box_print - ldr r1, =gUnknown_0856FB57 - ldr r0, [r6] - adds r0, r5 - ldrb r0, [r0] - adds r0, r1 - ldrb r2, [r0] - movs r0, 0x1 - mov r1, r9 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - mov r0, r10 - str r0, [sp] - mov r0, r8 - str r0, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - adds r3, r4, 0 - bl box_print - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3C34 - - thumb_func_start sub_80C3CCC -sub_80C3CCC: @ 80C3CCC - push {lr} - ldr r0, =0x02039ce8 - ldr r2, [r0] - ldrb r0, [r2, 0xB] - cmp r0, 0 - beq _080C3CE4 - ldr r1, =gUnknown_085ECFB8 - adds r2, 0x93 - ldr r3, =gUnknown_0856FB0F - movs r0, 0 - bl sub_80C3C34 -_080C3CE4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3CCC - - thumb_func_start sub_80C3CF4 -sub_80C3CF4: @ 80C3CF4 - push {r4,lr} - ldr r4, =0x02039ce8 - ldr r1, [r4] - ldrb r0, [r1, 0xC] - cmp r0, 0 - beq _080C3D40 - adds r0, r1, 0 - adds r0, 0xD9 - ldr r2, =gUnknown_0856FB5C - ldr r3, =0x0000052a - adds r1, r3 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl CopyString - ldr r1, [r4] - ldr r2, =0x00000165 - adds r0, r1, r2 - movs r3, 0xA9 - lsls r3, 3 - adds r1, r3 - ldrh r1, [r1] - movs r2, 0 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r1, [r4] - ldr r2, =0x000001ab - adds r0, r1, r2 - ldr r3, =0x0000054a - adds r1, r3 - ldrh r1, [r1] - movs r2, 0 - movs r3, 0x4 - bl ConvertIntToDecimalString -_080C3D40: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3CF4 - - thumb_func_start sub_80C3D60 -sub_80C3D60: @ 80C3D60 - push {r4,r5,lr} - ldr r5, =0x02039ce8 - ldr r1, [r5] - ldrb r0, [r1, 0xC] - cmp r0, 0 - beq _080C3D9A - ldr r0, =0x02021cc4 - ldr r2, =0x00000165 - adds r1, r2 - bl CopyString - ldr r0, =0x02021dc4 - ldr r1, [r5] - ldr r2, =0x000001ab - adds r1, r2 - bl CopyString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085ECFED - adds r0, r4, 0 - bl ExpandStringRefs - ldr r1, [r5] - adds r1, 0xD9 - ldr r3, =gUnknown_0856FB0C - movs r0, 0x1 - adds r2, r4, 0 - bl sub_80C3C34 -_080C3D9A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3D60 - - thumb_func_start sub_80C3DC0 -sub_80C3DC0: @ 80C3DC0 - push {lr} - ldr r0, =0x02039ce8 - ldr r1, [r0] - ldrb r0, [r1, 0x10] - cmp r0, 0 - beq _080C3DDE - ldr r2, =0x00000237 - adds r0, r1, r2 - ldr r2, =0x00000554 - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x5 - bl ConvertIntToDecimalString -_080C3DDE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3DC0 - - thumb_func_start sub_80C3DF0 -sub_80C3DF0: @ 80C3DF0 - push {lr} - ldr r0, =0x02039ce8 - ldr r2, [r0] - ldrb r0, [r2, 0x10] - cmp r0, 0 - beq _080C3E0A - ldr r1, =gUnknown_085ED010 - ldr r0, =0x00000237 - adds r2, r0 - ldr r3, =gUnknown_0856FB0F - movs r0, 0x2 - bl sub_80C3C34 -_080C3E0A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3DF0 - - thumb_func_start sub_80C3E20 -sub_80C3E20: @ 80C3E20 - push {lr} - ldr r0, =0x02039ce8 - ldr r2, [r0] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3E48 - movs r3, 0xAE - lsls r3, 3 - adds r0, r2, r3 - ldr r1, [r0] - cmp r1, 0 - beq _080C3E48 - ldr r3, =0x000002c3 - adds r0, r2, r3 - movs r2, 0x1 - movs r3, 0x5 - bl ConvertIntToDecimalString -_080C3E48: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3E20 - - thumb_func_start sub_80C3E58 -sub_80C3E58: @ 80C3E58 - push {lr} - ldr r0, =0x02039ce8 - ldr r2, [r0] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3E80 - adds r1, 0x46 - adds r0, r2, r1 - ldr r0, [r0] - cmp r0, 0 - beq _080C3E80 - ldr r1, =gUnknown_085ED036 - ldr r0, =0x000002c3 - adds r2, r0 - ldr r3, =gUnknown_0856FB0F - movs r0, 0x4 - bl sub_80C3C34 -_080C3E80: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3E58 - - thumb_func_start sub_80C3E98 -sub_80C3E98: @ 80C3E98 - push {lr} - ldr r0, =0x02039ce8 - ldr r2, [r0] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3EBE - ldr r3, =0x00000574 - adds r0, r2, r3 - ldr r1, [r0] - cmp r1, 0 - beq _080C3EBE - ldr r3, =0x0000034f - adds r0, r2, r3 - movs r2, 0x1 - movs r3, 0x5 - bl ConvertIntToDecimalString -_080C3EBE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3E98 - - thumb_func_start sub_80C3ED4 -sub_80C3ED4: @ 80C3ED4 - push {lr} - ldr r0, =0x02039ce8 - ldr r2, [r0] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3EFC - adds r1, 0x4A - adds r0, r2, r1 - ldr r0, [r0] - cmp r0, 0 - beq _080C3EFC - ldr r1, =gUnknown_085ED01F - ldr r0, =0x0000034f - adds r2, r0 - ldr r3, =gUnknown_0856FB0F - movs r0, 0x3 - bl sub_80C3C34 -_080C3EFC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3ED4 - - thumb_func_start sub_80C3F14 -sub_80C3F14: @ 80C3F14 - push {r4,lr} - ldr r4, =0x02039ce8 - ldr r1, [r4] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C3F46 - ldr r0, =0x00000552 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _080C3F46 - ldr r0, =0x02021cc4 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x5 - bl ConvertIntToDecimalString - ldr r0, [r4] - ldr r1, =0x00000395 - adds r0, r1 - ldr r1, =gUnknown_085ED096 - bl ExpandStringRefs -_080C3F46: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3F14 - - thumb_func_start sub_80C3F64 -sub_80C3F64: @ 80C3F64 - push {lr} - ldr r0, =0x02039ce8 - ldr r2, [r0] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080C3F8C - adds r1, 0x28 - adds r0, r2, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _080C3F8C - ldr r1, =gUnknown_085ED085 - ldr r0, =0x00000395 - adds r2, r0 - ldr r3, =gUnknown_0856FB0F - movs r0, 0x3 - bl sub_80C3C34 -_080C3F8C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3F64 - - thumb_func_start sub_80C3FA4 -sub_80C3FA4: @ 80C3FA4 - push {lr} - ldr r0, =0x02039ce8 - ldr r1, [r0] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C3FCE - movs r3, 0xAA - lsls r3, 3 - adds r2, r1, r3 - ldrh r0, [r2] - cmp r0, 0 - beq _080C3FCE - ldr r3, =0x000003db - adds r0, r1, r3 - ldrh r1, [r2] - movs r2, 0x1 - movs r3, 0x5 - bl ConvertIntToDecimalString -_080C3FCE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3FA4 - - thumb_func_start sub_80C3FE0 -sub_80C3FE0: @ 80C3FE0 - push {lr} - ldr r0, =0x02039ce8 - ldr r2, [r0] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080C4008 - adds r1, 0x26 - adds r0, r2, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _080C4008 - ldr r1, =gUnknown_085ED09F - ldr r0, =0x000003db - adds r2, r0 - ldr r3, =gUnknown_0856FB0F - movs r0, 0x4 - bl sub_80C3C34 -_080C4008: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3FE0 - - thumb_func_start sub_80C4020 -sub_80C4020: @ 80C4020 - push {r4,lr} - ldr r4, =0x02039ce8 - ldr r1, [r4] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080C4044 - cmp r0, 0x1 - ble _080C40B6 - cmp r0, 0x2 - beq _080C4094 - b _080C40B6 - .pool -_080C4044: - ldrb r0, [r1, 0xD] - cmp r0, 0 - beq _080C40B6 - ldr r0, =0x02021cc4 - ldr r2, =0x0000054c - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r0, =0x02021dc4 - ldr r1, [r4] - ldr r2, =0x0000054e - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r0, [r4] - ldr r1, =0x00000421 - adds r0, r1 - ldr r1, =gUnknown_085ED0E0 - bl ExpandStringRefs - b _080C40B6 - .pool -_080C4094: - ldr r2, =0x00000596 - adds r1, r2 - ldrh r0, [r1] - cmp r0, 0 - beq _080C40B6 - ldr r0, =0x02021cc4 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x5 - bl ConvertIntToDecimalString - ldr r0, [r4] - ldr r1, =0x00000421 - adds r0, r1 - ldr r1, =gUnknown_085ED0C8 - bl ExpandStringRefs -_080C40B6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4020 - - thumb_func_start sub_80C40CC -sub_80C40CC: @ 80C40CC - push {lr} - ldr r0, =0x02039ce8 - ldr r2, [r0] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080C40F0 - cmp r0, 0x1 - ble _080C412C - cmp r0, 0x2 - beq _080C4114 - b _080C412C - .pool -_080C40F0: - ldrb r0, [r2, 0xD] - cmp r0, 0 - beq _080C412C - ldr r1, =gUnknown_085ED0D3 - ldr r0, =0x00000421 - adds r2, r0 - ldr r3, =gUnknown_0856FB0C - movs r0, 0x5 - bl sub_80C3C34 - b _080C412C - .pool -_080C4114: - ldr r1, =0x00000596 - adds r0, r2, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _080C412C - ldr r1, =gUnknown_085ED0B6 - ldr r0, =0x00000421 - adds r2, r0 - ldr r3, =gUnknown_0856FB0F - movs r0, 0x5 - bl sub_80C3C34 -_080C412C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C40CC - - thumb_func_start sub_80C4140 -sub_80C4140: @ 80C4140 - push {r4,r5,lr} - sub sp, 0x20 - ldr r1, =gUnknown_0856FB68 - add r0, sp, 0x10 - movs r2, 0x6 - bl memcpy - add r4, sp, 0x18 - ldr r1, =gUnknown_0856FB6E - adds r0, r4, 0 - movs r2, 0x6 - bl memcpy - ldr r0, =0x02039ce8 - ldr r0, [r0] - ldr r1, =0x0000052a - adds r0, r1 - ldrb r0, [r0] - adds r5, r4, 0 - cmp r0, 0 - bne _080C41C0 - movs r4, 0 -_080C416C: - ldr r0, =0x02039ce8 - ldr r0, [r0] - lsls r1, r4, 1 - movs r2, 0xB1 - lsls r2, 3 - adds r0, r2 - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, 0 - beq _080C41B6 - bl sub_80D30A0 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r4, 20 - movs r2, 0xE0 - lsls r2, 16 - adds r1, r2 - lsrs r1, 16 - adds r2, r5, r4 - ldrb r2, [r2] - adds r2, 0x3 - lsls r2, 24 - lsrs r2, 24 - movs r3, 0x4 - str r3, [sp] - str r3, [sp, 0x4] - add r0, sp - adds r0, 0x10 - ldrb r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x1 - str r0, [sp, 0xC] - movs r0, 0x3 - movs r3, 0xF - bl WriteSequenceToBgTilemapBuffer -_080C41B6: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _080C416C -_080C41C0: - add sp, 0x20 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4140 - - thumb_func_start sub_80C41D8 -sub_80C41D8: @ 80C41D8 - push {r4,r5,lr} - sub sp, 0x4 - ldr r0, =gMonIconPalettes - ldr r4, =0x02039ce8 - ldr r1, [r4] - movs r5, 0x8D - lsls r5, 3 - adds r1, r5 - movs r2, 0x60 - bl CpuSet - ldr r4, [r4] - ldr r1, =0x00000582 - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080C4214 - cmp r0, 0x1 - ble _080C424A - cmp r0, 0x2 - beq _080C422A - cmp r0, 0x3 - beq _080C4242 - b _080C424A - .pool -_080C4214: - movs r2, 0x8D - lsls r2, 3 - adds r0, r4, r2 - movs r1, 0 - str r1, [sp] - movs r1, 0x60 - movs r2, 0 - movs r3, 0 - bl sub_80A2BAC - b _080C424A -_080C422A: - adds r0, r4, r5 - movs r2, 0xFA - lsls r2, 1 - movs r3, 0xA5 - lsls r3, 1 - movs r1, 0x9B - lsls r1, 1 - str r1, [sp] - movs r1, 0x60 - bl sub_80A2BAC - b _080C424A -_080C4242: - adds r0, r4, r5 - movs r1, 0x60 - bl TintPalette_SepiaTone -_080C424A: - ldr r0, =0x02039ce8 - ldr r0, [r0] - movs r1, 0x8D - lsls r1, 3 - adds r0, r1 - movs r1, 0x50 - movs r2, 0xC0 - bl gpu_pal_apply - movs r4, 0 -_080C425E: - ldr r0, =0x02039ce8 - ldr r0, [r0] - lsls r1, r4, 1 - movs r2, 0xB1 - lsls r2, 3 - adds r0, r2 - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, 0 - beq _080C428E - movs r1, 0 - bl GetMonIconTiles - adds r1, r0, 0 - lsls r3, r4, 20 - movs r0, 0x80 - lsls r0, 14 - adds r3, r0 - lsrs r3, 16 - movs r0, 0x3 - movs r2, 0x80 - lsls r2, 2 - bl LoadBgTiles -_080C428E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _080C425E - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C41D8 - - thumb_func_start sub_80C42A4 -sub_80C42A4: @ 80C42A4 - push {r4,lr} - sub sp, 0x14 - ldr r1, =gUnknown_0856FB74 - add r0, sp, 0x10 - movs r2, 0x4 - bl memcpy - ldr r0, =0x02039ce8 - ldr r1, [r0] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080C4316 - adds r2, 0x56 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080C4316 - movs r4, 0 -_080C42CC: - ldr r0, =0x02039ce8 - ldr r0, [r0] - ldr r1, =0x00000584 - adds r0, r1 - adds r0, r4 - ldrb r3, [r0] - cmp r3, 0 - beq _080C430C - lsls r1, r4, 18 - movs r2, 0xA0 - lsls r2, 17 - adds r1, r2 - lsrs r1, 16 - lsls r2, r4, 1 - adds r2, r4 - adds r2, 0x2 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x2 - str r0, [sp] - str r0, [sp, 0x4] - subs r0, r3, 0x1 - add r0, sp - adds r0, 0x10 - ldrb r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x1 - str r0, [sp, 0xC] - movs r0, 0x3 - movs r3, 0x2 - bl WriteSequenceToBgTilemapBuffer -_080C430C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _080C42CC -_080C4316: - add sp, 0x14 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C42A4 - - thumb_func_start sub_80C4330 -sub_80C4330: @ 80C4330 - push {lr} - ldr r0, =gUnknown_0856F54C - movs r1, 0xB0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_0856F56C - movs r1, 0xC0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_0856F58C - movs r1, 0xD0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_0856F5AC - movs r1, 0xE0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =0x02039ce8 - ldr r1, [r0] - ldr r0, =0x000017a8 - adds r1, r0 - movs r2, 0x80 - lsls r2, 3 - movs r0, 0x3 - movs r3, 0x80 - bl LoadBgTiles - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4330 - - thumb_func_start sub_80C438C -sub_80C438C: @ 80C438C - push {r4,lr} - 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 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80C438C - - thumb_func_start sub_80C43A8 -sub_80C43A8: @ 80C43A8 - push {r4,lr} - sub sp, 0x8 - ldr r0, =0x02039ce8 - ldr r0, [r0] - ldrb r0, [r0, 0x3] - cmp r0, 0x4 - bls _080C43B8 - b _080C4532 -_080C43B8: - lsls r0, 2 - ldr r1, =_080C43CC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C43CC: - .4byte _080C43E0 - .4byte _080C43F8 - .4byte _080C4418 - .4byte _080C44D8 - .4byte _080C4500 -_080C43E0: - ldr r0, =0x02039ce8 - ldr r1, [r0] - ldr r0, =0x000013a8 - adds r1, r0 - movs r2, 0x80 - lsls r2, 3 - movs r0, 0x3 - b _080C4406 - .pool -_080C43F8: - ldr r0, =0x02039ce8 - ldr r1, [r0] - ldr r3, =0x000019a8 - adds r1, r3 - movs r2, 0xC0 - lsls r2, 5 - movs r0, 0 -_080C4406: - movs r3, 0 - bl LoadBgTiles - b _080C4536 - .pool -_080C4418: - ldr r4, =0x02039ce8 - ldr r2, [r4] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080C447C - ldr r1, =gUnknown_0856FAE4 - ldr r3, =0x00000535 - adds r0, r2, r3 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0 - movs r2, 0x60 - bl gpu_pal_apply - ldr r0, =gUnknown_0856F4EC - movs r1, 0x30 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, [r4] - ldr r1, =0x00000534 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080C44B2 - ldr r0, =gUnknown_0856F4AC - movs r1, 0x10 - movs r2, 0x20 - bl gpu_pal_apply - b _080C44B2 - .pool -_080C447C: - ldr r1, =gUnknown_0856FAF8 - ldr r3, =0x00000535 - adds r0, r2, r3 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0 - movs r2, 0x60 - bl gpu_pal_apply - ldr r0, =gUnknown_0856F50C - movs r1, 0x30 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, [r4] - ldr r1, =0x00000534 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080C44B2 - ldr r0, =gUnknown_0856F4CC - movs r1, 0x10 - movs r2, 0x20 - bl gpu_pal_apply -_080C44B2: - ldr r0, =gUnknown_0856F52C - movs r1, 0x40 - movs r2, 0x20 - bl gpu_pal_apply - b _080C4536 - .pool -_080C44D8: - ldr r4, =0x02039ce8 - ldr r1, [r4] - ldr r3, =0x00003ca8 - adds r1, r3 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00005ca8 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - b _080C4536 - .pool -_080C4500: - movs r4, 0x20 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 -_080C4532: - movs r0, 0x1 - b _080C4542 -_080C4536: - ldr r0, =0x02039ce8 - ldr r1, [r0] - ldrb r0, [r1, 0x3] - adds r0, 0x1 - strb r0, [r1, 0x3] - movs r0, 0 -_080C4542: - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C43A8 - - thumb_func_start sub_80C4550 -sub_80C4550: @ 80C4550 - push {r4-r7,lr} - adds r7, r0, 0 - ldr r0, =0x02039ce8 - ldr r0, [r0] - ldr r1, =0x00005ca8 - adds r6, r0, r1 - movs r1, 0 -_080C455E: - movs r2, 0 - lsls r5, r1, 16 - asrs r1, r5, 16 - lsls r3, r1, 5 - lsls r0, r1, 4 - subs r0, r1 - lsls r4, r0, 1 -_080C456C: - lsls r0, r2, 16 - asrs r1, r0, 16 - adds r2, r0, 0 - cmp r1, 0x1D - bgt _080C4590 - adds r0, r3, r1 - lsls r0, 1 - adds r0, r6 - adds r1, r4, r1 - lsls r1, 1 - adds r1, r7 - ldrh r1, [r1] - b _080C4598 - .pool -_080C4590: - adds r0, r3, r1 - lsls r0, 1 - adds r0, r6 - ldrh r1, [r7] -_080C4598: - strh r1, [r0] - movs r1, 0x80 - lsls r1, 9 - adds r0, r2, r1 - lsrs r2, r0, 16 - asrs r0, 16 - cmp r0, 0x1F - ble _080C456C - adds r0, r5, r1 - lsrs r1, r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _080C455E - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80C4550 - - thumb_func_start sub_80C45C0 -sub_80C45C0: @ 80C45C0 - push {r4-r7,lr} - adds r7, r0, 0 - ldr r0, =0x02039ce8 - ldr r0, [r0] - ldr r1, =0x00003ca8 - adds r6, r0, r1 - movs r1, 0 -_080C45CE: - movs r2, 0 - lsls r5, r1, 16 - asrs r1, r5, 16 - lsls r3, r1, 5 - lsls r0, r1, 4 - subs r0, r1 - lsls r4, r0, 1 -_080C45DC: - lsls r0, r2, 16 - asrs r1, r0, 16 - adds r2, r0, 0 - cmp r1, 0x1D - bgt _080C4600 - adds r0, r3, r1 - lsls r0, 1 - adds r0, r6 - adds r1, r4, r1 - lsls r1, 1 - adds r1, r7 - ldrh r1, [r1] - b _080C4608 - .pool -_080C4600: - adds r0, r3, r1 - lsls r0, 1 - adds r0, r6 - ldrh r1, [r7] -_080C4608: - strh r1, [r0] - movs r1, 0x80 - lsls r1, 9 - adds r0, r2, r1 - lsrs r2, r0, 16 - asrs r0, 16 - cmp r0, 0x1F - ble _080C45DC - adds r0, r5, r1 - lsrs r1, r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _080C45CE - movs r0, 0 - bl CopyBgTilemapBufferToVram - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80C45C0 - - thumb_func_start sub_80C4630 -sub_80C4630: @ 80C4630 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - movs r0, 0xC0 - mov r8, r0 - movs r2, 0x3 - mov r10, r2 - ldr r2, =gUnknown_0856FB78 - ldr r4, =0x02039ce8 - ldr r1, [r4] - ldr r3, =0x0000052b - adds r0, r1, r3 - ldrb r0, [r0] - adds r0, r2 - ldrb r3, [r0] - ldr r0, =0x00000535 - adds r1, r0 - ldrb r0, [r1] - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x4 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8F - movs r2, 0xF - bl FillBgTilemapBufferRect - ldr r0, [r4] - ldrb r0, [r0, 0x5] - cmp r0, 0 - bne _080C4724 - movs r2, 0x4 - mov r9, r2 - movs r2, 0 - movs r6, 0x1 -_080C467E: - ldr r0, =0x02039ce8 - ldr r1, [r0] - lsls r0, r2, 16 - asrs r7, r0, 16 - adds r1, 0x11 - adds r1, r7 - ldrb r0, [r1] - cmp r0, 0 - beq _080C4700 - mov r3, r9 - lsls r5, r3, 24 - lsrs r5, 24 - str r6, [sp] - str r6, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - movs r0, 0x3 - mov r1, r8 - adds r2, r5, 0 - movs r3, 0xF - bl FillBgTilemapBufferRect - mov r1, r8 - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - mov r4, r9 - adds r4, 0x1 - lsls r4, 24 - lsrs r4, 24 - str r6, [sp] - str r6, [sp, 0x4] - mov r2, r10 - str r2, [sp, 0x8] - movs r0, 0x3 - adds r2, r4, 0 - movs r3, 0xF - bl FillBgTilemapBufferRect - mov r1, r8 - adds r1, 0x10 - lsls r1, 16 - lsrs r1, 16 - str r6, [sp] - str r6, [sp, 0x4] - mov r3, r10 - str r3, [sp, 0x8] - movs r0, 0x3 - adds r2, r5, 0 - movs r3, 0x10 - bl FillBgTilemapBufferRect - mov r1, r8 - adds r1, 0x11 - lsls r1, 16 - lsrs r1, 16 - str r6, [sp] - str r6, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - movs r0, 0x3 - adds r2, r4, 0 - movs r3, 0x10 - bl FillBgTilemapBufferRect -_080C4700: - adds r0, r7, 0x1 - lsls r0, 16 - mov r1, r8 - adds r1, 0x2 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - mov r2, r9 - lsls r1, r2, 16 - movs r3, 0xC0 - lsls r3, 10 - adds r1, r3 - lsrs r1, 16 - mov r9, r1 - lsrs r2, r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _080C467E -_080C4724: - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - 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_80C4630 - - thumb_func_start sub_80C474C -sub_80C474C: @ 80C474C - push {r4-r6,lr} - sub sp, 0xC - ldr r6, =0x02039ce8 - ldr r1, [r6] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080C4800 - ldrb r0, [r1, 0x10] - cmp r0, 0 - beq _080C478A - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8D - movs r2, 0x1B - movs r3, 0x9 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x9D - movs r2, 0x1B - movs r3, 0xA - bl FillBgTilemapBufferRect -_080C478A: - ldr r0, [r6] - movs r1, 0xAE - lsls r1, 3 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - beq _080C47BE - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8D - movs r2, 0x15 - movs r3, 0xD - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x9D - movs r2, 0x15 - movs r3, 0xE - bl FillBgTilemapBufferRect -_080C47BE: - ldr r0, [r6] - ldr r2, =0x00000574 - adds r0, r2 - ldr r0, [r0] - cmp r0, 0 - beq _080C48B8 - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8D - movs r2, 0x1B - movs r3, 0xB - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x9D - movs r2, 0x1B - movs r3, 0xC - bl FillBgTilemapBufferRect - b _080C48B8 - .pool -_080C4800: - ldrb r0, [r1, 0x10] - cmp r0, 0 - beq _080C482E - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - movs r5, 0 - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8D - movs r2, 0x1B - movs r3, 0x9 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x9D - movs r2, 0x1B - movs r3, 0xA - bl FillBgTilemapBufferRect -_080C482E: - ldr r0, [r6] - movs r1, 0xAA - lsls r1, 3 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _080C4864 - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - movs r5, 0 - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8D - movs r2, 0x1B - movs r3, 0xD - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x9D - movs r2, 0x1B - movs r3, 0xE - bl FillBgTilemapBufferRect -_080C4864: - ldr r0, [r6] - ldrb r0, [r0, 0xD] - cmp r0, 0 - beq _080C48B8 - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - movs r5, 0 - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8D - movs r2, 0x11 - movs r3, 0xF - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x9D - movs r2, 0x11 - movs r3, 0x10 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8C - movs r2, 0x1B - movs r3, 0xF - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x9C - movs r2, 0x1B - movs r3, 0x10 - bl FillBgTilemapBufferRect -_080C48B8: - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80C474C - - thumb_func_start sub_80C48C8 -sub_80C48C8: @ 80C48C8 - push {lr} - ldr r3, =0x02039ce8 - ldr r1, [r3] - ldrb r0, [r1, 0x6] - adds r0, 0x1 - strb r0, [r1, 0x6] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3C - bls _080C48F6 - ldr r1, [r3] - movs r0, 0 - strb r0, [r1, 0x6] - ldr r2, [r3] - ldrb r0, [r2, 0x7] - movs r1, 0x1 - eors r0, r1 - strb r0, [r2, 0x7] - ldr r0, [r3] - ldr r1, =0x00000529 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] -_080C48F6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C48C8 - - thumb_func_start sub_80C4904 -sub_80C4904: @ 80C4904 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02039b58 - movs r1, 0x64 - muls r0, r1 - adds r0, r2 - ldrb r0, [r0, 0x1] - bx lr - .pool - thumb_func_end sub_80C4904 - - thumb_func_start sub_80C4918 -sub_80C4918: @ 80C4918 - push {r4,lr} - ldr r4, =sub_80C4960 - adds r0, r4, 0 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r4 - ldr r0, =sub_80C26D4 - bl SetHBlankCallback - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4918 - - thumb_func_start sub_80C4940 -sub_80C4940: @ 80C4940 - push {lr} - ldr r0, =sub_80C4960 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _080C4958 - movs r0, 0 - b _080C495A - .pool -_080C4958: - movs r0, 0x1 -_080C495A: - pop {r1} - bx r1 - thumb_func_end sub_80C4940 - - thumb_func_start sub_80C4960 -sub_80C4960: @ 80C4960 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_0856FB28 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_080C4972: - 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 _080C4972 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4960 - - thumb_func_start sub_80C4998 -sub_80C4998: @ 80C4998 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x1 - bl HideBg - movs r0, 0x3 - bl HideBg - bl remove_some_task - bl dp12_8087EA4 - movs r1, 0 - ldr r0, =0x02038c28 - movs r2, 0 - movs r3, 0xF0 - lsls r3, 3 - adds r0, r3 -_080C49BC: - strh r2, [r0] - adds r0, 0x2 - adds r1, 0x1 - cmp r1, 0x9F - bls _080C49BC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C4998 - - thumb_func_start sub_80C49D8 -sub_80C49D8: @ 80C49D8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r0 - ldr r0, =0x02039ce8 - ldr r1, [r0] - movs r0, 0 - strb r0, [r1, 0x9] - mov r0, r8 - ldrh r1, [r0, 0xA] - movs r2, 0xA - ldrsh r0, [r0, r2] - cmp r0, 0x4C - ble _080C4A08 - movs r0, 0x4D - mov r3, r8 - strh r0, [r3, 0xA] - b _080C4A0E - .pool -_080C4A08: - adds r0, r1, 0x7 - mov r4, r8 - strh r0, [r4, 0xA] -_080C4A0E: - ldr r0, =0x02039ce8 - ldr r0, [r0] - mov r2, r8 - ldrh r1, [r2, 0xA] - ldr r3, =0x00007ca8 - adds r0, r3 - strh r1, [r0] - ldrh r0, [r2, 0xA] - bl sub_80C32EC - mov r4, r8 - movs r0, 0xA - ldrsh r7, [r4, r0] - movs r0, 0xA0 - subs r0, r7 - mov r9, r0 - subs r4, r0, r7 - negs r0, r7 - lsls r6, r0, 16 - movs r0, 0xA0 - lsls r0, 16 - adds r1, r4, 0 - bl __udivsi3 - adds r5, r0, 0 - ldr r1, =0xffff0000 - adds r5, r1 - adds r0, r5, 0 - muls r0, r4 - adds r0, r6, r0 - str r0, [sp] - adds r0, r5, 0 - adds r1, r4, 0 - bl __udivsi3 - mov r10, r0 - lsls r5, 1 - movs r2, 0 - cmp r2, r7 - bcs _080C4A78 - ldr r3, =0x02038c28 -_080C4A60: - lsls r0, r2, 16 - asrs r0, 16 - lsls r1, r0, 1 - adds r1, r3 - negs r2, r0 - strh r2, [r1] - adds r0, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - asrs r0, 16 - cmp r0, r7 - bcc _080C4A60 -_080C4A78: - lsls r1, r2, 16 - mov r3, r9 - lsls r0, r3, 16 - asrs r3, r0, 16 - ldr r4, =0x02039ce8 - mov r9, r4 - ldr r4, [sp] - lsrs r7, r4, 16 - cmp r1, r0 - bge _080C4AB0 - ldr r0, =0x02038c28 - mov r12, r0 - adds r4, r3, 0 -_080C4A92: - lsrs r3, r6, 16 - adds r6, r5 - mov r2, r10 - subs r5, r2 - asrs r0, r1, 16 - lsls r1, r0, 1 - add r1, r12 - strh r3, [r1] - adds r0, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - lsls r1, r2, 16 - asrs r0, r1, 16 - cmp r0, r4 - blt _080C4A92 -_080C4AB0: - adds r3, r7, 0 - lsls r1, r2, 16 - asrs r0, r1, 16 - cmp r0, 0x9F - bgt _080C4ACE - ldr r2, =0x02038c28 -_080C4ABC: - asrs r0, r1, 16 - lsls r1, r0, 1 - adds r1, r2 - strh r3, [r1] - adds r0, 0x1 - lsls r1, r0, 16 - asrs r0, r1, 16 - cmp r0, 0x9F - ble _080C4ABC -_080C4ACE: - mov r3, r9 - ldr r0, [r3] - movs r1, 0x1 - strb r1, [r0, 0x9] - mov r4, r8 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x4C - ble _080C4AE6 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080C4AE6: - movs r0, 0 - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C49D8 - - thumb_func_start sub_80C4B08 -sub_80C4B08: @ 80C4B08 - push {r4,r5,lr} - sub sp, 0x8 - adds r5, r0, 0 - ldr r4, =0x02039ce8 - ldr r1, [r4] - movs r0, 0 - strb r0, [r1, 0x9] - bl sub_8087598 - adds r2, r4, 0 - cmp r0, 0x1 - beq _080C4C08 -_080C4B20: - ldr r3, [r2] - ldrb r0, [r3, 0x4] - cmp r0, 0x4 - bhi _080C4BE4 - lsls r0, 2 - ldr r1, =_080C4B3C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C4B3C: - .4byte _080C4B50 - .4byte _080C4B6C - .4byte _080C4B8C - .4byte _080C4BB0 - .4byte _080C4BCE -_080C4B50: - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - b _080C4BF6 -_080C4B6C: - ldr r0, [r2] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _080C4B80 - bl sub_80C34B0 - lsls r0, 24 - cmp r0, 0 - bne _080C4BF6 - b _080C4C08 -_080C4B80: - bl sub_80C3438 - lsls r0, 24 - cmp r0, 0 - bne _080C4BF6 - b _080C4C08 -_080C4B8C: - ldr r0, =0x02039ce8 - ldr r1, [r0] - ldrb r0, [r1, 0x8] - cmp r0, 0 - bne _080C4BA8 - ldr r2, =0x00000a48 - adds r0, r1, r2 - bl sub_80C45C0 - b _080C4BF6 - .pool -_080C4BA8: - movs r0, 0x1 - bl sub_80C438C - b _080C4BF6 -_080C4BB0: - ldr r0, =0x02039ce8 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _080C4BC4 - bl sub_80C474C - b _080C4BF6 - .pool -_080C4BC4: - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - b _080C4BF6 -_080C4BCE: - ldr r0, =0x02039ce8 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - beq _080C4BF6 - bl sub_80C4FF0 - b _080C4BF6 - .pool -_080C4BE4: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - movs r1, 0 - strh r0, [r5, 0x8] - movs r0, 0x1 - strb r0, [r3, 0x9] - ldr r0, [r2] - strb r1, [r0, 0x4] - b _080C4C08 -_080C4BF6: - ldr r2, =0x02039ce8 - ldr r1, [r2] - ldrb r0, [r1, 0x4] - adds r0, 0x1 - strb r0, [r1, 0x4] - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _080C4B20 -_080C4C08: - movs r0, 0 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C4B08 - - thumb_func_start sub_80C4C1C -sub_80C4C1C: @ 80C4C1C - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x02039ce8 - ldr r1, [r4] - movs r0, 0 - strb r0, [r1, 0x9] - ldr r0, [r4] - ldrb r0, [r0, 0x8] - cmp r0, 0 - beq _080C4C50 - movs r0, 0x2 - bl sub_80C438C - ldr r0, [r4] - ldr r1, =0x00000ef8 - adds r0, r1 - bl sub_80C4550 - ldr r0, [r4] - movs r1, 0xB3 - lsls r1, 3 - adds r0, r1 - bl sub_80C45C0 - bl sub_80C4630 -_080C4C50: - movs r0, 0x1 - bl sub_80C438C - ldr r2, [r4] - ldrb r0, [r2, 0x8] - movs r1, 0x1 - eors r0, r1 - strb r0, [r2, 0x8] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - ldr r1, [r4] - movs r0, 0x1 - strb r0, [r1, 0x9] - movs r0, 0xFA - bl audio_play - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C4C1C - - thumb_func_start sub_80C4C84 -sub_80C4C84: @ 80C4C84 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r0 - ldr r0, =0x02039ce8 - ldr r0, [r0] - movs r2, 0 - strb r2, [r0, 0x9] - mov r0, r8 - ldrh r1, [r0, 0xA] - movs r3, 0xA - ldrsh r0, [r0, r3] - cmp r0, 0x5 - bgt _080C4CB0 - mov r4, r8 - strh r2, [r4, 0xA] - b _080C4CB6 - .pool -_080C4CB0: - subs r0, r1, 0x5 - mov r1, r8 - strh r0, [r1, 0xA] -_080C4CB6: - ldr r0, =0x02039ce8 - ldr r0, [r0] - mov r2, r8 - ldrh r1, [r2, 0xA] - ldr r3, =0x00007ca8 - adds r0, r3 - strh r1, [r0] - ldrh r0, [r2, 0xA] - bl sub_80C32EC - mov r4, r8 - movs r0, 0xA - ldrsh r7, [r4, r0] - movs r0, 0xA0 - subs r0, r7 - mov r9, r0 - subs r4, r0, r7 - negs r0, r7 - lsls r6, r0, 16 - movs r0, 0xA0 - lsls r0, 16 - adds r1, r4, 0 - bl __udivsi3 - adds r5, r0, 0 - ldr r1, =0xffff0000 - adds r5, r1 - adds r0, r5, 0 - muls r0, r4 - adds r0, r6, r0 - str r0, [sp] - adds r0, r5, 0 - adds r1, r4, 0 - bl __udivsi3 - mov r10, r0 - lsrs r5, 1 - movs r2, 0 - cmp r2, r7 - bcs _080C4D20 - ldr r3, =0x02038c28 -_080C4D08: - lsls r0, r2, 16 - asrs r0, 16 - lsls r1, r0, 1 - adds r1, r3 - negs r2, r0 - strh r2, [r1] - adds r0, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - asrs r0, 16 - cmp r0, r7 - bcc _080C4D08 -_080C4D20: - lsls r1, r2, 16 - mov r3, r9 - lsls r0, r3, 16 - asrs r3, r0, 16 - ldr r4, =0x02039ce8 - mov r9, r4 - ldr r4, [sp] - lsrs r7, r4, 16 - cmp r1, r0 - bge _080C4D56 - ldr r0, =0x02038c28 - mov r12, r0 - adds r4, r3, 0 -_080C4D3A: - lsrs r3, r6, 16 - adds r6, r5 - add r5, r10 - asrs r0, r1, 16 - lsls r1, r0, 1 - add r1, r12 - strh r3, [r1] - adds r0, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - lsls r1, r2, 16 - asrs r0, r1, 16 - cmp r0, r4 - blt _080C4D3A -_080C4D56: - adds r3, r7, 0 - lsls r1, r2, 16 - asrs r0, r1, 16 - cmp r0, 0x9F - bgt _080C4D74 - ldr r2, =0x02038c28 -_080C4D62: - asrs r0, r1, 16 - lsls r1, r0, 1 - adds r1, r2 - strh r3, [r1] - adds r0, 0x1 - lsls r1, r0, 16 - asrs r0, r1, 16 - cmp r0, 0x9F - ble _080C4D62 -_080C4D74: - mov r1, r9 - ldr r0, [r1] - movs r1, 0x1 - strb r1, [r0, 0x9] - mov r2, r8 - movs r3, 0xA - ldrsh r0, [r2, r3] - cmp r0, 0 - bgt _080C4D8C - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] -_080C4D8C: - movs r0, 0 - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C4C84 - - thumb_func_start sub_80C4DB0 -sub_80C4DB0: @ 80C4DB0 - push {lr} - movs r0, 0x1 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r0, 0 - bl SetHBlankCallback - ldr r0, =sub_80C4960 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C4DB0 - - thumb_func_start sub_80C4DDC -sub_80C4DDC: @ 80C4DDC - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x02039ce8 - ldr r0, =0x00007cac - bl AllocZeroed - adds r1, r0, 0 - str r1, [r4] - movs r2, 0xA6 - lsls r2, 3 - adds r0, r1, r2 - str r5, [r0] - ldr r0, =sub_80C5868 - cmp r5, r0 - bne _080C4E18 - ldr r0, =0x0000052c - adds r1, r0 - ldr r0, =0x00007fff - b _080C4E1E - .pool -_080C4E18: - ldr r2, =0x0000052c - adds r1, r2 - movs r0, 0 -_080C4E1E: - strh r0, [r1] - bl InUnionRoom - adds r3, r0, 0 - cmp r3, 0x1 - bne _080C4E3C - ldr r1, =0x02039ce8 - ldr r0, [r1] - strb r3, [r0, 0x5] - adds r2, r1, 0 - b _080C4E44 - .pool -_080C4E3C: - ldr r2, =0x02039ce8 - ldr r1, [r2] - movs r0, 0 - strb r0, [r1, 0x5] -_080C4E44: - ldr r0, [r2] - ldr r1, =0x00007caa - adds r0, r1 - movs r1, 0x2 - strb r1, [r0] - ldr r0, [r2] - ldr r2, =0x00000534 - adds r0, r2 - bl sub_80C3020 - ldr r0, =sub_80C2C80 - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4DDC - - thumb_func_start sub_80C4E74 -sub_80C4E74: @ 80C4E74 - push {r4-r6,lr} - adds r4, r0, 0 - adds r6, r1, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =0x02039ce8 - ldr r0, =0x00007cac - bl AllocZeroed - str r0, [r5] - movs r2, 0xA6 - lsls r2, 3 - adds r1, r0, r2 - str r6, [r1] - movs r1, 0x1 - strb r1, [r0, 0x5] - ldr r0, [r5] - ldr r1, =0x00000534 - adds r0, r1 - ldr r2, =0x02039b58 - movs r1, 0x64 - muls r1, r4 - adds r1, r2 - movs r2, 0x64 - bl memcpy - ldr r1, [r5] - ldr r2, =0x020229e8 - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x1A] - ldr r2, =0x00007caa - adds r1, r2 - strb r0, [r1] - ldr r0, =sub_80C2C80 - bl SetMainCallback2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4E74 - - thumb_func_start sub_80C4EE4 -sub_80C4EE4: @ 80C4EE4 - push {r4,r5,lr} - ldr r4, =0x02039ce8 - ldr r0, [r4] - movs r1, 0 - strb r1, [r0] - ldr r2, [r4] - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x12] - strb r0, [r2, 0x6] - ldr r0, [r4] - strb r1, [r0, 0x7] - ldr r0, [r4] - strb r1, [r0, 0x8] - ldr r0, [r4] - movs r2, 0xA5 - lsls r2, 3 - adds r0, r2 - strb r1, [r0] - bl sub_80C4F50 - ldr r1, [r4] - ldr r3, =0x0000052a - adds r1, r3 - strb r0, [r1] - movs r5, 0 -_080C4F18: - movs r0, 0xD - muls r0, r5 - adds r0, 0x19 - ldr r1, [r4] - adds r0, r1, r0 - lsls r2, r5, 1 - ldr r3, =0x0000055c - adds r1, r3 - adds r1, r2 - ldrh r1, [r1] - bl CopyEasyChatWord - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _080C4F18 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4EE4 - - thumb_func_start sub_80C4F50 -sub_80C4F50: @ 80C4F50 - push {lr} - ldr r0, =0x02039ce8 - ldr r1, [r0] - cmp r1, 0 - bne _080C4F7C - ldr r0, =gUnknown_82E9530 - ldrb r1, [r0] - subs r0, r1, 0x4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _080C4F74 - movs r0, 0 - b _080C4FC2 - .pool -_080C4F74: - cmp r1, 0x3 - beq _080C4FC0 - movs r0, 0x1 - b _080C4FC2 -_080C4F7C: - ldr r2, =0x0000056c - adds r0, r1, r2 - ldrb r2, [r0] - subs r0, r2, 0x4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _080C4FA0 - ldr r0, =0x0000052b - adds r1, r0 - movs r0, 0 - strb r0, [r1] - b _080C4FC2 - .pool -_080C4FA0: - lsls r0, r2, 24 - lsrs r0, 24 - cmp r0, 0x3 - beq _080C4FB8 - ldr r2, =0x0000052b - adds r1, r2 - movs r0, 0x1 - strb r0, [r1] - b _080C4FC2 - .pool -_080C4FB8: - ldr r0, =0x0000052b - adds r1, r0 - movs r0, 0x1 - strb r0, [r1] -_080C4FC0: - movs r0, 0x2 -_080C4FC2: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C4F50 - - thumb_func_start sub_80C4FCC -sub_80C4FCC: @ 80C4FCC - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xFC - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0x1 - bhi _080C4FE2 - movs r0, 0 - b _080C4FEC -_080C4FE2: - cmp r1, 0x3 - beq _080C4FEA - movs r0, 0x1 - b _080C4FEC -_080C4FEA: - movs r0, 0x2 -_080C4FEC: - pop {r1} - bx r1 - thumb_func_end sub_80C4FCC - - thumb_func_start sub_80C4FF0 -sub_80C4FF0: @ 80C4FF0 - push {r4-r6,lr} - sub sp, 0x8 - bl InUnionRoom - cmp r0, 0x1 - bne _080C5060 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080C5060 - ldr r5, =0x02039ce8 - ldr r0, [r5] - ldr r1, =0x00000583 - adds r0, r1 - ldrb r0, [r0] - bl TrainerClassToTrainerPic - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gUnknown_0856FB18 - ldr r1, [r5] - ldr r3, =0x00000534 - adds r2, r1, r3 - ldrb r3, [r2] - lsls r3, 1 - ldr r2, =0x0000052b - adds r1, r2 - ldrb r1, [r1] - lsls r1, 2 - adds r3, r1 - adds r1, r3, r4 - ldrb r2, [r1] - adds r4, 0x1 - adds r3, r4 - ldrb r3, [r3] - movs r1, 0x8 - str r1, [sp] - movs r1, 0x2 - str r1, [sp, 0x4] - movs r1, 0x1 - bl sub_818D938 - b _080C50AE - .pool -_080C5060: - ldr r2, =gUnknown_0856FB20 - ldr r6, =0x02039ce8 - ldr r0, [r6] - ldr r5, =0x00000534 - adds r1, r0, r5 - ldr r3, =0x0000052a - adds r0, r3 - ldrb r0, [r0] - lsls r0, 1 - ldrb r1, [r1] - adds r0, r1 - adds r0, r2 - ldrb r0, [r0] - bl TrainerClassToTrainerPic - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gUnknown_0856FB18 - ldr r1, [r6] - adds r5, r1, r5 - ldrb r3, [r5] - lsls r3, 1 - ldr r2, =0x0000052b - adds r1, r2 - ldrb r1, [r1] - lsls r1, 2 - adds r3, r1 - adds r1, r3, r4 - ldrb r2, [r1] - adds r4, 0x1 - adds r3, r4 - ldrb r3, [r3] - movs r1, 0x8 - str r1, [sp] - movs r1, 0x2 - str r1, [sp, 0x4] - movs r1, 0x1 - bl sub_818D938 -_080C50AE: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4FF0 - - thumb_func_start sub_80C50D0 -sub_80C50D0: @ 80C50D0 - push {lr} - sub sp, 0x8 - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0xE - movs r1, 0 - bl SetGpuReg - movs r0, 0xC - movs r1, 0 - bl SetGpuReg - movs r0, 0xA - movs r1, 0 - bl SetGpuReg - movs r0, 0x8 - movs r1, 0 - bl SetGpuReg - 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, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - 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 - mov r1, sp - movs r0, 0 - strh r0, [r1] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x0100c000 - mov r0, sp - bl CpuSet - movs r0, 0 - str r0, [sp, 0x4] - add r0, sp, 0x4 - movs r1, 0xE0 - lsls r1, 19 - ldr r2, =0x05000100 - bl CpuSet - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C50D0 - - thumb_func_start sub_80C51C4 -sub_80C51C4: @ 80C51C4 - push {lr} - bl sub_80C51F0 - ldr r0, =sub_80C544C - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C51C4 - - thumb_func_start sub_80C51D8 -sub_80C51D8: @ 80C51D8 - push {lr} - ldr r0, =0x02039cec - ldr r0, [r0] - ldr r0, [r0] - bl SetMainCallback2 - bl sub_80C52E4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C51D8 - - thumb_func_start sub_80C51F0 -sub_80C51F0: @ 80C51F0 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r5, =0x02039cec - ldr r0, [r5] - cmp r0, 0 - beq _080C5204 - movs r0, 0x1 - b _080C52C8 - .pool -_080C5204: - movs r0, 0x18 - bl AllocZeroed - str r0, [r5] - cmp r0, 0 - bne _080C5214 - movs r0, 0x2 - b _080C52C8 -_080C5214: - str r4, [r0] - bl sav1_map_get_name - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3A - beq _080C5232 - cmp r4, 0xCA - beq _080C5232 - ldr r0, [r5] - movs r1, 0xB0 - strh r1, [r0, 0x8] - movs r1, 0x68 - strh r1, [r0, 0xA] - b _080C5240 -_080C5232: - ldr r2, =0x02039cec - ldr r1, [r2] - movs r0, 0xB0 - strh r0, [r1, 0x8] - movs r0, 0x30 - strh r0, [r1, 0xA] - adds r5, r2, 0 -_080C5240: - ldr r1, [r5] - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r2, =0x00000eb8 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1, 0x6] - bl sub_8185290 - ldr r3, [r5] - movs r1, 0x1 - ands r0, r1 - ldrb r2, [r3, 0xE] - movs r1, 0x2 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xE] - ldr r2, [r5] - ldrb r1, [r2, 0xE] - movs r0, 0xF - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0xE] - bl sub_80C2E40 - ldr r3, [r5] - lsls r0, 4 - ldrb r2, [r3, 0xE] - movs r1, 0xF - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xE] - movs r4, 0 - adds r6, r5, 0 -_080C5286: - lsls r5, r4, 1 - ldr r1, =0x000008c4 - adds r0, r5, r1 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080C52A2 - ldr r1, [r6] - adds r1, 0xF - adds r1, r4 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080C52A2: - ldr r2, =0x000008c5 - adds r0, r5, r2 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080C52BC - ldr r1, [r6] - adds r1, 0xF - adds r1, r4 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080C52BC: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bls _080C5286 - movs r0, 0 -_080C52C8: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C51F0 - - thumb_func_start sub_80C52E4 -sub_80C52E4: @ 80C52E4 - push {r4,lr} - ldr r4, =0x02039cec - ldr r0, [r4] - cmp r0, 0 - beq _080C5308 - movs r1, 0 - movs r2, 0x18 - bl memset - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - b _080C530A - .pool -_080C5308: - movs r0, 0x1 -_080C530A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80C52E4 - - thumb_func_start sub_80C5310 -sub_80C5310: @ 80C5310 - push {r4,lr} - ldr r4, =0x02039cf0 - ldr r0, [r4] - cmp r0, 0 - beq _080C5324 - movs r0, 0x1 - b _080C533A - .pool -_080C5324: - ldr r0, =0x00002434 - bl AllocZeroed - str r0, [r4] - cmp r0, 0 - beq _080C5338 - movs r0, 0 - b _080C533A - .pool -_080C5338: - movs r0, 0x2 -_080C533A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80C5310 - - thumb_func_start sub_80C5340 -sub_80C5340: @ 80C5340 - push {r4,lr} - bl FreeAllWindowBuffers - ldr r4, =0x02039cf0 - ldr r0, [r4] - cmp r0, 0 - bne _080C5358 - movs r0, 0x1 - b _080C53A0 - .pool -_080C5358: - ldr r0, [r0, 0x28] - cmp r0, 0 - beq _080C5368 - bl Free - ldr r1, [r4] - movs r0, 0 - str r0, [r1, 0x28] -_080C5368: - ldr r0, [r4] - ldr r0, [r0, 0x24] - cmp r0, 0 - beq _080C537A - bl Free - ldr r1, [r4] - movs r0, 0 - str r0, [r1, 0x24] -_080C537A: - ldr r0, [r4] - ldr r0, [r0, 0x20] - cmp r0, 0 - beq _080C538C - bl Free - ldr r1, [r4] - movs r0, 0 - str r0, [r1, 0x20] -_080C538C: - ldr r0, [r4] - ldr r2, =0x00002434 - movs r1, 0 - bl memset - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] -_080C53A0: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C5340 - - thumb_func_start pokemon_details -pokemon_details: @ 80C53AC - push {r4-r7,lr} - sub sp, 0x10 - ldr r0, =0x02039cf0 - ldr r6, [r0] - adds r0, r6, 0 - adds r0, 0x2C - ldrb r0, [r0] - cmp r0, 0 - beq _080C5416 - ldr r3, =gUnknown_085713E0 - ldr r0, =0x02039cec - ldr r0, [r0] - ldrb r4, [r0, 0xE] - lsls r4, 28 - lsrs r0, r4, 29 - subs r0, 0x1 - lsls r0, 2 - adds r0, r3 - movs r2, 0 - ldrsh r1, [r0, r2] - lsls r1, 8 - lsrs r0, r4, 29 - subs r0, 0x1 - lsls r0, 2 - adds r5, r3, 0x2 - adds r0, r5 - movs r7, 0 - ldrsh r2, [r0, r7] - lsls r2, 8 - lsrs r0, r4, 29 - subs r0, 0x1 - lsls r0, 2 - adds r0, r3 - movs r7, 0 - ldrsh r3, [r0, r7] - lsrs r4, 29 - subs r4, 0x1 - lsls r4, 2 - adds r4, r5 - movs r5, 0 - ldrsh r0, [r4, r5] - str r0, [sp] - movs r7, 0x2E - ldrsh r0, [r6, r7] - str r0, [sp, 0x4] - movs r4, 0x30 - ldrsh r0, [r6, r4] - str r0, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - movs r0, 0x2 - bl SetBgAffine -_080C5416: - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end pokemon_details - - thumb_func_start sub_80C5438 -sub_80C5438: @ 80C5438 - push {lr} - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - pop {r0} - bx r0 - thumb_func_end sub_80C5438 - - thumb_func_start sub_80C544C -sub_80C544C: @ 80C544C - push {lr} - bl sub_80C5484 - cmp r0, 0 - beq _080C5464 - ldr r0, =sub_80C5A48 - movs r1, 0 - bl CreateTask - ldr r0, =sub_80C5438 - bl SetMainCallback2 -_080C5464: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C544C - - thumb_func_start sub_80C5470 -sub_80C5470: @ 80C5470 - push {lr} - bl sub_80C570C - cmp r0, 0 - beq _080C547E - bl sub_80C51D8 -_080C547E: - pop {r0} - bx r0 - thumb_func_end sub_80C5470 - - thumb_func_start sub_80C5484 -sub_80C5484: @ 80C5484 - push {r4,r5,lr} - sub sp, 0xC - movs r0, 0 - str r0, [sp, 0x8] - ldr r0, =0x02039cec - ldr r0, [r0] - ldrh r0, [r0, 0x4] - cmp r0, 0xA - bls _080C5498 - b _080C56F4 -_080C5498: - lsls r0, 2 - ldr r1, =_080C54AC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C54AC: - .4byte _080C54D8 - .4byte _080C54EE - .4byte _080C54F4 - .4byte _080C550A - .4byte _080C5510 - .4byte _080C5560 - .4byte _080C5570 - .4byte _080C55D0 - .4byte _080C5624 - .4byte _080C5684 - .4byte _080C56D0 -_080C54D8: - movs r0, 0 - bl SetVBlankCallback - bl remove_some_task - bl SetVBlankHBlankCallbacksToNull - movs r0, 0x2 - bl DisableInterrupts - b _080C56F4 -_080C54EE: - bl sub_80C50D0 - b _080C56F4 -_080C54F4: - bl ResetTasks - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - bl sub_80A1A74 - bl reset_temp_tile_data_buffers - b _080C56F4 -_080C550A: - bl sub_80C5310 - b _080C56F4 -_080C5510: - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085713E8 - movs r0, 0x1 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r4, =0x02039cf0 - ldr r1, [r4] - adds r1, 0x32 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001032 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00002032 - adds r1, r0 - movs r0, 0x3 - bl SetBgTilemapBuffer - movs r0, 0x2 - movs r1, 0x6 - movs r2, 0x1 - bl SetBgAttribute - b _080C56F4 - .pool -_080C5560: - ldr r0, =gUnknown_08571400 - bl InitWindows - bl DeactivateAllTextPrinters - b _080C56F4 - .pool -_080C5570: - ldr r0, =gUnknown_085712F8 - add r1, sp, 0x8 - bl malloc_and_decompress - ldr r4, =0x02039cf0 - ldr r1, [r4] - str r0, [r1, 0x20] - ldr r0, =gUnknown_08571060 - add r1, sp, 0x8 - bl malloc_and_decompress - ldr r1, [r4] - str r0, [r1, 0x24] - ldr r0, =gUnknown_085712C0 - add r1, sp, 0x8 - bl malloc_and_decompress - ldr r1, [r4] - str r0, [r1, 0x28] - ldr r1, =gUnknown_08DE08C8 - movs r4, 0 - str r4, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_08DE2084 - str r4, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _080C56F4 - .pool -_080C55D0: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - beq _080C55DC - b _080C56FE -_080C55DC: - movs r5, 0x1E - str r5, [sp] - movs r4, 0x14 - str r4, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r5, [sp] - str r4, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r5, [sp] - str r4, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - b _080C56F4 -_080C5624: - ldr r4, =gUnknown_08DE07C8 - movs r2, 0xD0 - lsls r2, 1 - adds r0, r4, 0 - movs r1, 0 - bl gpu_pal_apply - ldr r5, =0x02039cec - ldr r0, [r5] - ldrb r0, [r0, 0xE] - lsrs r0, 4 - lsls r0, 5 - adds r4, 0x20 - adds r0, r4 - movs r1, 0x10 - movs r2, 0x20 - bl gpu_pal_apply - movs r0, 0 - bl stdpal_get - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - bl sub_80C629C - ldr r1, [r5] - ldrb r0, [r1, 0xC] - ldrb r1, [r1, 0xD] - bl sub_80C6104 - ldr r5, [r5] - ldrb r0, [r5, 0xE] - movs r1, 0xE - ands r1, r0 - cmp r1, 0x2 - beq _080C5674 - cmp r1, 0x4 - bne _080C56F4 -_080C5674: - movs r0, 0 - strh r0, [r5, 0x4] - movs r0, 0x1 - b _080C5700 - .pool -_080C5684: - 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 - bl sub_80C62DC - ldr r0, =pokemon_details - bl SetVBlankCallback - movs r4, 0x1 - negs r4, r4 - adds r0, r4, 0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - b _080C56F4 - .pool -_080C56D0: - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _080C56FE - ldr r0, =0x02039cec - ldr r0, [r0] - strh r1, [r0, 0x4] - movs r0, 0x1 - b _080C5700 - .pool -_080C56F4: - ldr r0, =0x02039cec - ldr r1, [r0] - ldrh r0, [r1, 0x4] - adds r0, 0x1 - strh r0, [r1, 0x4] -_080C56FE: - movs r0, 0 -_080C5700: - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C5484 - - thumb_func_start sub_80C570C -sub_80C570C: @ 80C570C - push {lr} - sub sp, 0x4 - ldr r1, =0x02039cec - ldr r0, [r1] - ldrh r0, [r0, 0x4] - adds r2, r1, 0 - cmp r0, 0x5 - bhi _080C57E4 - lsls r0, 2 - ldr r1, =_080C5730 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C5730: - .4byte _080C5748 - .4byte _080C5770 - .4byte _080C577C - .4byte _080C57A6 - .4byte _080C57AC - .4byte _080C57BE -_080C5748: - ldr r0, [r2] - ldrb r0, [r0, 0xE] - movs r1, 0xE - ands r1, r0 - cmp r1, 0x2 - beq _080C576A - cmp r1, 0x4 - beq _080C576A - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _080C57E4 -_080C576A: - ldr r1, [r2] - movs r0, 0x2 - b _080C57EC -_080C5770: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - beq _080C57E4 - b _080C57EE -_080C577C: - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl HideBg - movs r0, 0x1 - bl HideBg - movs r0, 0x2 - bl HideBg - movs r0, 0 - bl SetVBlankCallback - bl remove_some_task - bl SetVBlankHBlankCallbacksToNull - b _080C57E4 -_080C57A6: - bl sub_80C63FC - b _080C57E4 -_080C57AC: - bl sub_80C50D0 - bl ResetTasks - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - b _080C57E4 -_080C57BE: - movs r0, 0 - bl UnsetBgTilemapBuffer - movs r0, 0x1 - bl UnsetBgTilemapBuffer - movs r0, 0x2 - bl UnsetBgTilemapBuffer - bl sub_80C5340 - ldr r0, =0x02039cec - ldr r1, [r0] - movs r0, 0 - strh r0, [r1, 0x4] - movs r0, 0x1 - b _080C57F0 - .pool -_080C57E4: - ldr r0, =0x02039cec - ldr r1, [r0] - ldrh r0, [r1, 0x4] - adds r0, 0x1 -_080C57EC: - strh r0, [r1, 0x4] -_080C57EE: - movs r0, 0 -_080C57F0: - add sp, 0x4 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C570C - - thumb_func_start sub_80C57FC -sub_80C57FC: @ 80C57FC - push {r4-r7,lr} - lsls r0, 16 - lsrs r6, r0, 16 - movs r4, 0 - ldr r7, =gUnknown_08571454 - lsls r1, 16 - asrs r5, r1, 16 -_080C580A: - lsls r0, r4, 3 - adds r3, r0, r7 - movs r1, 0 - ldrsh r0, [r3, r1] - cmp r0, r5 - bgt _080C5854 - movs r1, 0x2 - ldrsh r0, [r3, r1] - cmp r0, r5 - blt _080C5854 - movs r0, 0x4 - ldrsh r1, [r3, r0] - lsls r0, r6, 16 - asrs r2, r0, 16 - cmp r1, r2 - bgt _080C5854 - movs r1, 0x6 - ldrsh r0, [r3, r1] - cmp r0, r2 - blt _080C5854 - cmp r4, 0x5 - bls _080C5842 - ldr r0, =0x02039cec - ldr r0, [r0] - adds r0, r4 - ldrb r0, [r0, 0x9] - cmp r0, 0 - beq _080C585E -_080C5842: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r0, 24 - b _080C5860 - .pool -_080C5854: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xC - bls _080C580A -_080C585E: - movs r0, 0 -_080C5860: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80C57FC - - thumb_func_start sub_80C5868 -sub_80C5868: @ 80C5868 - push {lr} - bl sub_80C5484 - cmp r0, 0 - beq _080C58C6 - ldr r1, =0x02039cec - ldr r0, [r1] - ldrb r0, [r0, 0xE] - lsls r0, 28 - lsrs r0, 29 - cmp r0, 0x1 - blt _080C58AC - cmp r0, 0x2 - bgt _080C58AC - ldr r0, =sub_80C5BD8 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0x1 - strh r0, [r1, 0x8] - b _080C58C0 - .pool -_080C58AC: - ldr r2, [r1] - ldrb r1, [r2, 0xE] - movs r0, 0xF - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0xE] - ldr r0, =sub_80C5A48 - movs r1, 0 - bl CreateTask -_080C58C0: - ldr r0, =sub_80C5438 - bl SetMainCallback2 -_080C58C6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C5868 - - thumb_func_start sub_80C58D4 -sub_80C58D4: @ 80C58D4 - push {r4,lr} - ldr r4, =0x02039cf8 - ldr r0, [r4] - bl sub_80C51F0 - ldr r0, =0x02039cec - ldr r1, [r0] - ldrh r0, [r4, 0x4] - strh r0, [r1, 0x8] - ldrh r0, [r4, 0x6] - strh r0, [r1, 0xA] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x8 - bl memset - bl InBattlePyramid - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080C5914 - cmp r0, 0x2 - beq _080C591C - bl sub_8085784 - b _080C5924 - .pool -_080C5914: - ldr r0, =0x000001cd - b _080C5920 - .pool -_080C591C: - movs r0, 0xE7 - lsls r0, 1 -_080C5920: - bl song_play_for_text -_080C5924: - ldr r0, =sub_80C5868 - bl SetMainCallback2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C58D4 - - thumb_func_start sub_80C5934 -sub_80C5934: @ 80C5934 - push {lr} - bl sub_80C570C - cmp r0, 0 - beq _080C599A - ldr r0, =0x02039cec - ldr r2, [r0] - ldrb r0, [r2, 0xE] - lsls r0, 28 - lsrs r0, 29 - cmp r0, 0x2 - beq _080C5994 - cmp r0, 0x2 - bgt _080C595C - cmp r0, 0x1 - beq _080C5962 - b _080C599A - .pool -_080C595C: - cmp r0, 0x3 - beq _080C5970 - b _080C599A -_080C5962: - ldr r0, =sub_80C5868 - bl sub_80C6454 - b _080C599A - .pool -_080C5970: - ldr r1, =0x02039cf8 - ldr r0, [r2] - str r0, [r1] - ldrh r0, [r2, 0x8] - strh r0, [r1, 0x4] - ldrh r0, [r2, 0xA] - strh r0, [r1, 0x6] - bl sub_80C52E4 - ldr r0, =sub_80C58D4 - bl sub_8185E24 - b _080C599A - .pool -_080C5994: - ldr r0, =sub_80C5868 - bl sub_80C4DDC -_080C599A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C5934 - - thumb_func_start sub_80C59A4 -sub_80C59A4: @ 80C59A4 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - adds r4, r3, 0 - lsls r1, 24 - lsrs r1, 24 - adds r2, r1, 0 - cmp r1, 0x1 - blt _080C59CC - cmp r1, 0x2 - ble _080C59F4 - cmp r1, 0x3 - bne _080C59CC - ldr r0, =0x02039cec - ldr r2, [r0] - ldrb r1, [r2, 0xE] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080C59D4 -_080C59CC: - movs r0, 0 - b _080C5A30 - .pool -_080C59D4: - movs r0, 0xF - negs r0, r0 - ands r0, r1 - movs r1, 0x6 - orrs r0, r1 - strb r0, [r2, 0xE] - adds r0, r3, 0 - bl DestroyTask - ldr r0, =sub_80C5934 - bl SetMainCallback2 - b _080C5A1A - .pool -_080C59F4: - ldr r0, =0x02039cec - ldr r3, [r0] - movs r0, 0x7 - ands r2, r0 - lsls r2, 1 - ldrb r1, [r3, 0xE] - subs r0, 0x16 - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0xE] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80C5BD8 - str r1, [r0] - movs r1, 0 - strh r1, [r0, 0x8] -_080C5A1A: - ldr r0, =0x02039cec - ldr r2, [r0] - ldr r0, =0x02039cf0 - ldr r1, [r0] - ldr r0, [r1] - ldrh r0, [r0, 0x20] - strh r0, [r2, 0x8] - ldr r0, [r1] - ldrh r0, [r0, 0x22] - strh r0, [r2, 0xA] - movs r0, 0x1 -_080C5A30: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C59A4 - - thumb_func_start sub_80C5A48 -sub_80C5A48: @ 80C5A48 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2C] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080C5A80 - ldr r0, =0x02039cf0 - ldr r4, [r0] - ldr r1, [r4] - ldrh r3, [r1, 0x22] - movs r7, 0x22 - ldrsh r0, [r1, r7] - cmp r0, 0x8 - ble _080C5A80 - subs r0, r3, 0x2 - strh r0, [r1, 0x22] - ldr r1, [r4] - movs r3, 0x22 - ldrsh r0, [r1, r3] - cmp r0, 0x7 - bgt _080C5A7E - movs r0, 0x2 - strh r0, [r1, 0x22] -_080C5A7E: - movs r5, 0x1 -_080C5A80: - ldrh r1, [r2, 0x2C] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080C5AAE - ldr r0, =0x02039cf0 - ldr r4, [r0] - ldr r1, [r4] - ldrh r3, [r1, 0x22] - movs r7, 0x22 - ldrsh r0, [r1, r7] - cmp r0, 0x87 - bgt _080C5AAE - adds r0, r3, 0x2 - strh r0, [r1, 0x22] - ldr r1, [r4] - movs r3, 0x22 - ldrsh r0, [r1, r3] - cmp r0, 0x88 - ble _080C5AAC - movs r0, 0x88 - strh r0, [r1, 0x22] -_080C5AAC: - movs r5, 0x1 -_080C5AAE: - ldrh r1, [r2, 0x2C] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080C5ADC - ldr r0, =0x02039cf0 - ldr r4, [r0] - ldr r1, [r4] - ldrh r3, [r1, 0x20] - movs r7, 0x20 - ldrsh r0, [r1, r7] - cmp r0, 0x5 - ble _080C5ADC - subs r0, r3, 0x2 - strh r0, [r1, 0x20] - ldr r1, [r4] - movs r3, 0x20 - ldrsh r0, [r1, r3] - cmp r0, 0x4 - bgt _080C5ADA - movs r0, 0x5 - strh r0, [r1, 0x20] -_080C5ADA: - movs r5, 0x1 -_080C5ADC: - ldrh r1, [r2, 0x2C] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080C5B0A - ldr r0, =0x02039cf0 - ldr r4, [r0] - ldr r1, [r4] - ldrh r3, [r1, 0x20] - movs r7, 0x20 - ldrsh r0, [r1, r7] - cmp r0, 0xE7 - bgt _080C5B0A - adds r0, r3, 0x2 - strh r0, [r1, 0x20] - ldr r1, [r4] - movs r3, 0x20 - ldrsh r0, [r1, r3] - cmp r0, 0xE8 - ble _080C5B08 - movs r0, 0xE8 - strh r0, [r1, 0x20] -_080C5B08: - movs r5, 0x1 -_080C5B0A: - cmp r5, 0 - bne _080C5B88 - ldr r4, =0x02039cec - ldr r0, [r4] - ldrb r3, [r0, 0xC] - cmp r3, 0 - beq _080C5B5E - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080C5B5E - cmp r3, 0x3 - bhi _080C5B48 - movs r0, 0x5 - bl audio_play - ldr r0, [r4] - ldrb r1, [r0, 0xC] - adds r0, r6, 0 - bl sub_80C59A4 - cmp r0, 0 - bne _080C5BCA - b _080C5B5E - .pool -_080C5B48: - cmp r3, 0x4 - bne _080C5B5E - movs r0, 0x3 - bl audio_play - ldr r0, =sub_80C5470 - bl SetMainCallback2 - adds r0, r6, 0 - bl DestroyTask -_080C5B5E: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080C5BCA - movs r0, 0x3 - bl audio_play - ldr r0, =sub_80C5470 - bl SetMainCallback2 - adds r0, r6, 0 - bl DestroyTask - b _080C5BCA - .pool -_080C5B88: - ldr r0, =0x02039cf0 - ldr r0, [r0] - ldr r1, [r0] - ldrh r0, [r1, 0x20] - subs r0, 0x5 - lsls r0, 16 - asrs r0, 16 - ldrh r1, [r1, 0x22] - adds r1, 0x5 - lsls r1, 16 - asrs r1, 16 - bl sub_80C57FC - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x02039cec - ldr r0, [r4] - ldrb r0, [r0, 0xC] - cmp r0, r5 - beq _080C5BCA - adds r0, r5, 0 - bl sub_80C5ED0 - ldr r1, [r4] - ldrb r0, [r1, 0xC] - strb r0, [r1, 0xD] - ldr r0, [r4] - strb r5, [r0, 0xC] - ldr r1, [r4] - ldrb r0, [r1, 0xC] - ldrb r1, [r1, 0xD] - bl sub_80C6104 -_080C5BCA: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C5A48 - - thumb_func_start sub_80C5BD8 -sub_80C5BD8: @ 80C5BD8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r5, r0, 3 - ldr r0, =0x03005e08 - mov r8, r0 - adds r6, r5, r0 - ldr r7, =0x02039cec - ldr r0, [r7] - ldrh r0, [r0, 0x4] - cmp r0, 0x1 - beq _080C5CD4 - cmp r0, 0x1 - bgt _080C5C0C - cmp r0, 0 - beq _080C5C14 - b _080C5D9C - .pool -_080C5C0C: - cmp r0, 0x2 - bne _080C5C12 - b _080C5D2A -_080C5C12: - b _080C5D9C -_080C5C14: - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _080C5C4C - movs r0, 0x1 - movs r1, 0 - bl sub_80C5F58 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1, 0 - strh r0, [r6, 0x2] - strh r0, [r6, 0x4] - movs r0, 0x15 - strh r0, [r6, 0x6] - strh r0, [r6, 0x8] - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _080C5CA4 - .pool -_080C5C4C: - movs r1, 0xFE - lsls r1, 1 - adds r0, r1, 0 - strh r0, [r6, 0x2] - strh r0, [r6, 0x4] - movs r1, 0x15 - negs r1, r1 - adds r0, r1, 0 - strh r0, [r6, 0x6] - strh r0, [r6, 0x8] - 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 - bl sub_80C62DC - ldr r0, =pokemon_details - bl SetVBlankCallback - movs r5, 0x1 - negs r5, r5 - ldr r4, =0x00007fff - adds r0, r5, 0 - movs r1, 0x10 - adds r2, r4, 0 - bl sub_80A2A20 - str r4, [sp] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe -_080C5CA4: - ldr r4, =0x02039cf0 - ldr r0, [r4] - adds r0, 0x2C - movs r1, 0x1 - strb r1, [r0] - movs r1, 0x2 - ldrsh r0, [r6, r1] - bl sub_8151624 - ldr r1, [r4] - strh r0, [r1, 0x2E] - movs r1, 0x4 - ldrsh r0, [r6, r1] - bl sub_8151624 - ldr r1, [r4] - strh r0, [r1, 0x30] - b _080C5D9C - .pool -_080C5CD4: - bl fade_and_return_progress_probably - ldrh r0, [r6, 0x6] - ldrh r1, [r6, 0x2] - adds r0, r1 - strh r0, [r6, 0x2] - ldrh r0, [r6, 0x8] - ldrh r1, [r6, 0x4] - adds r0, r1 - strh r0, [r6, 0x4] - movs r1, 0x2 - ldrsh r0, [r6, r1] - bl sub_8151624 - ldr r4, =0x02039cf0 - ldr r1, [r4] - strh r0, [r1, 0x2E] - movs r1, 0x4 - ldrsh r0, [r6, r1] - bl sub_8151624 - ldr r1, [r4] - strh r0, [r1, 0x30] - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _080C5D1C - movs r0, 0x2 - ldrsh r1, [r6, r0] - movs r0, 0xFE - lsls r0, 1 - cmp r1, r0 - ble _080C5DA6 - b _080C5D9C - .pool -_080C5D1C: - movs r0, 0x2 - ldrsh r1, [r6, r0] - movs r0, 0x80 - lsls r0, 1 - cmp r1, r0 - bne _080C5DA6 - b _080C5D9C -_080C5D2A: - ldr r0, =0x02039cf0 - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x2C - ldrb r0, [r1] - cmp r0, 0 - beq _080C5D3C - movs r0, 0 - strb r0, [r1] -_080C5D3C: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _080C5DA6 - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _080C5D64 - adds r0, r4, 0 - bl DestroyTask - ldr r0, =sub_80C5934 - bl SetMainCallback2 - b _080C5D82 - .pool -_080C5D64: - movs r0, 0 - movs r1, 0 - bl sub_80C5F58 - ldr r2, [r7] - ldrb r1, [r2, 0xE] - movs r0, 0xF - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0xE] - mov r0, r8 - subs r0, 0x8 - adds r0, r5, r0 - ldr r1, =sub_80C5A48 - str r1, [r0] -_080C5D82: - movs r0, 0x2 - movs r1, 0x6 - movs r2, 0 - bl SetBgAttribute - ldr r0, =0x02039cec - ldr r1, [r0] - movs r0, 0 - b _080C5DA4 - .pool -_080C5D9C: - ldr r0, =0x02039cec - ldr r1, [r0] - ldrh r0, [r1, 0x4] - adds r0, 0x1 -_080C5DA4: - strh r0, [r1, 0x4] -_080C5DA6: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C5BD8 - - thumb_func_start sub_80C5DB8 -sub_80C5DB8: @ 80C5DB8 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0xC - movs r4, 0 -_080C5DC2: - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _080C5DC2 - ldr r4, =gUnknown_085ED8FF - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x60 - bl GetStringCenterAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - ldr r6, =gUnknown_08571448 - str r6, [sp] - movs r0, 0 - mov r8, r0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x5 - bl box_print - ldr r4, =gUnknown_085ED90E - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x60 - bl GetStringCenterAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - str r6, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x5 - bl box_print - str r6, [sp] - mov r0, r8 - str r0, [sp, 0x4] - ldr r0, =gUnknown_085ED91C - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x8 - movs r2, 0x5 - movs r3, 0x4 - bl box_print - ldr r4, =0x02021fc4 - ldr r5, =0x02039cec - ldr r0, [r5] - ldrh r1, [r0, 0x6] - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x5 - bl ConvertIntToDecimalString - movs r0, 0x8 - adds r1, r4, 0 - movs r2, 0x5B - bl GetStringRightAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - str r6, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x8 - movs r3, 0x10 - bl box_print - ldr r1, [r5] - ldrh r0, [r1, 0x8] - subs r0, 0x5 - lsls r0, 16 - asrs r0, 16 - ldrh r1, [r1, 0xA] - adds r1, 0x5 - lsls r1, 16 - asrs r1, 16 - bl sub_80C57FC - ldr r1, [r5] - strb r0, [r1, 0xC] - ldr r0, [r5] - mov r1, r8 - strb r1, [r0, 0xD] - ldr r0, [r5] - ldrb r0, [r0, 0xC] - bl sub_80C5ED0 - movs r4, 0 -_080C5E92: - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _080C5E92 - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C5DB8 - - thumb_func_start sub_80C5ED0 -sub_80C5ED0: @ 80C5ED0 - push {r4,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x3 - movs r1, 0 - bl FillWindowPixelBuffer - cmp r4, 0x3 - bne _080C5F18 - ldr r0, =0x02039cec - ldr r0, [r0] - ldrb r0, [r0, 0xE] - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - bne _080C5F18 - ldr r0, =gUnknown_0857144B - str r0, [sp] - str r1, [sp, 0x4] - ldr r0, =gUnknown_08571614 - ldr r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x2 - movs r3, 0 - bl box_print - b _080C5F3A - .pool -_080C5F18: - cmp r4, 0 - beq _080C5F3A - ldr r0, =gUnknown_0857144B - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - ldr r1, =gUnknown_08571614 - lsls r0, r4, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x2 - movs r3, 0 - bl box_print -_080C5F3A: - movs r0, 0x3 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C5ED0 - - thumb_func_start sub_80C5F58 -sub_80C5F58: @ 80C5F58 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - ldr r0, =0x02039cec - ldr r0, [r0] - ldrb r0, [r0, 0xE] - lsls r0, 28 - lsrs r0, 29 - cmp r0, 0x1 - beq _080C5F80 - cmp r0, 0x2 - beq _080C5FC2 - b _080C60EE - .pool -_080C5F80: - cmp r2, 0 - beq _080C5FA8 - ldr r0, =0x02039cf0 - ldr r0, [r0] - ldr r1, [r0, 0x20] - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x10 - str r0, [sp, 0x8] - movs r0, 0x2 - movs r2, 0x10 - movs r3, 0x3 - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C6004 - .pool -_080C5FA8: - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x10 - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0 - movs r2, 0x10 - movs r3, 0x3 - bl FillBgTilemapBufferRect - b _080C6004 -_080C5FC2: - cmp r2, 0 - beq _080C5FEC - ldr r0, =0x02039cf0 - ldr r0, [r0] - ldr r1, [r0, 0x20] - adds r1, 0x54 - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x10 - str r0, [sp, 0x8] - movs r0, 0x2 - movs r2, 0x10 - movs r3, 0xA - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C6004 - .pool -_080C5FEC: - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x10 - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0 - movs r2, 0x10 - movs r3, 0xA - bl FillBgTilemapBufferRect -_080C6004: - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - cmp r7, 0 - beq _080C6084 - movs r4, 0xFE - lsls r4, 1 - adds r0, r4, 0 - bl sub_8151624 - adds r6, r0, 0 - lsls r6, 16 - asrs r6, 16 - adds r0, r4, 0 - bl sub_8151624 - lsls r0, 16 - asrs r0, 16 - ldr r5, =gUnknown_085713E0 - ldr r1, =0x02039cec - ldr r1, [r1] - ldrb r4, [r1, 0xE] - lsls r4, 28 - lsrs r1, r4, 29 - subs r1, 0x1 - lsls r1, 2 - adds r1, r5 - movs r2, 0 - ldrsh r1, [r1, r2] - lsls r1, 8 - lsrs r2, r4, 29 - subs r2, 0x1 - lsls r2, 2 - adds r3, r5, 0x2 - mov r8, r3 - add r2, r8 - movs r3, 0 - ldrsh r2, [r2, r3] - lsls r2, 8 - lsrs r3, r4, 29 - subs r3, 0x1 - lsls r3, 2 - adds r3, r5 - movs r5, 0 - ldrsh r3, [r3, r5] - lsrs r4, 29 - subs r4, 0x1 - lsls r4, 2 - add r4, r8 - movs r5, 0 - ldrsh r4, [r4, r5] - str r4, [sp] - str r6, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - movs r0, 0x2 - bl SetBgAffine - b _080C60EE - .pool -_080C6084: - movs r4, 0x80 - lsls r4, 1 - adds r0, r4, 0 - bl sub_8151624 - adds r6, r0, 0 - lsls r6, 16 - asrs r6, 16 - adds r0, r4, 0 - bl sub_8151624 - lsls r0, 16 - asrs r0, 16 - ldr r5, =gUnknown_085713E0 - ldr r1, =0x02039cec - ldr r1, [r1] - ldrb r4, [r1, 0xE] - lsls r4, 28 - lsrs r1, r4, 29 - subs r1, 0x1 - lsls r1, 2 - adds r1, r5 - movs r2, 0 - ldrsh r1, [r1, r2] - lsls r1, 8 - lsrs r2, r4, 29 - subs r2, 0x1 - lsls r2, 2 - adds r3, r5, 0x2 - mov r8, r3 - add r2, r8 - movs r3, 0 - ldrsh r2, [r2, r3] - lsls r2, 8 - lsrs r3, r4, 29 - subs r3, 0x1 - lsls r3, 2 - adds r3, r5 - movs r5, 0 - ldrsh r3, [r3, r5] - lsrs r4, 29 - subs r4, 0x1 - lsls r4, 2 - add r4, r8 - movs r5, 0 - ldrsh r4, [r4, r5] - str r4, [sp] - str r6, [sp, 0x4] - str r0, [sp, 0x8] - str r7, [sp, 0xC] - movs r0, 0x2 - bl SetBgAffine -_080C60EE: - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C5F58 - - thumb_func_start sub_80C6104 -sub_80C6104: @ 80C6104 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - cmp r5, 0x2 - beq _080C614C - cmp r5, 0x2 - bgt _080C611E - cmp r5, 0x1 - beq _080C6128 - b _080C61C4 -_080C611E: - cmp r5, 0x3 - beq _080C6170 - cmp r5, 0x4 - beq _080C61A4 - b _080C61C4 -_080C6128: - ldr r0, =0x02039cf0 - ldr r0, [r0] - ldr r1, [r0, 0x24] - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x10 - movs r3, 0x3 - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C61CE - .pool -_080C614C: - ldr r0, =0x02039cf0 - ldr r0, [r0] - ldr r1, [r0, 0x24] - movs r0, 0xA8 - lsls r0, 1 - adds r1, r0 - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x10 - b _080C6192 - .pool -_080C6170: - ldr r0, =0x02039cec - ldr r0, [r0] - ldrb r1, [r0, 0xE] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080C61C4 - ldr r0, =0x02039cf0 - ldr r0, [r0] - ldr r1, [r0, 0x28] - movs r0, 0xC - str r0, [sp] - str r5, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x2 -_080C6192: - movs r3, 0xA - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C61CE - .pool -_080C61A4: - ldr r1, =gUnknown_08DE3350 - movs r0, 0x9 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x15 - movs r3, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C61CE - .pool -_080C61C4: - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bhi _080C6294 -_080C61CE: - cmp r4, 0x2 - beq _080C620C - cmp r4, 0x2 - bgt _080C61DC - cmp r4, 0x1 - beq _080C61E6 - b _080C6284 -_080C61DC: - cmp r4, 0x3 - beq _080C6230 - cmp r4, 0x4 - beq _080C6264 - b _080C6284 -_080C61E6: - ldr r0, =0x02039cf0 - ldr r0, [r0] - ldr r1, [r0, 0x24] - adds r1, 0xA8 - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x10 - movs r3, 0x3 - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C628E - .pool -_080C620C: - ldr r0, =0x02039cf0 - ldr r0, [r0] - ldr r1, [r0, 0x24] - movs r0, 0xFC - lsls r0, 1 - adds r1, r0 - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x10 - b _080C6254 - .pool -_080C6230: - ldr r0, =0x02039cec - ldr r0, [r0] - ldrb r1, [r0, 0xE] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080C6294 - ldr r0, =0x02039cf0 - ldr r0, [r0] - ldr r1, [r0, 0x28] - adds r1, 0x48 - movs r0, 0xC - str r0, [sp] - str r4, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x2 -_080C6254: - movs r3, 0xA - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C628E - .pool -_080C6264: - ldr r1, =gUnknown_08DE3374 - movs r0, 0x9 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x15 - movs r3, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C628E - .pool -_080C6284: - subs r0, r5, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bhi _080C6294 -_080C628E: - movs r0, 0x1 - bl CopyBgTilemapBufferToVram -_080C6294: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80C6104 - - thumb_func_start sub_80C629C -sub_80C629C: @ 80C629C - push {r4,lr} - ldr r1, =gUnknown_08DE3060 - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r4, =0x02039cec - ldr r1, [r4] - ldrb r0, [r1, 0xC] - ldrb r1, [r1, 0xD] - bl sub_80C6104 - ldr r0, [r4] - ldrb r1, [r0, 0xE] - lsls r1, 28 - lsrs r1, 29 - movs r0, 0x1 - bl sub_80C5F58 - bl sub_80C5DB8 - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C629C - - thumb_func_start sub_80C62DC -sub_80C62DC: @ 80C62DC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - movs r5, 0 - bl ResetObjectPaletteAllocator - bl rotscale_reset_all - ldr r0, =gUnknown_085714E4 - bl LoadTaggedObjectPalettes - ldr r4, =gUnknown_085714BC - adds r0, r4, 0 - bl LoadCompressedObjectPic - adds r4, 0x10 - adds r0, r4, 0 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085715B4 - ldr r1, =0x02039cec - ldr r2, [r1] - movs r3, 0x8 - ldrsh r1, [r2, r3] - movs r6, 0xA - ldrsh r2, [r2, r6] - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x02039cf0 - ldr r2, [r3] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - str r1, [r2] - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] - mov r8, sp - mov r9, r3 -_080C633C: - ldr r0, =0x02039cec - ldr r0, [r0] - adds r0, 0xF - adds r2, r0, r5 - ldrb r0, [r2] - adds r4, r5, 0x1 - cmp r0, 0 - beq _080C63C2 - mov r1, sp - ldr r0, =gUnknown_085715E4 - ldm r0!, {r3,r6,r7} - stm r1!, {r3,r6,r7} - ldm r0!, {r3,r6,r7} - stm r1!, {r3,r6,r7} - mov r7, r8 - ldrh r0, [r7, 0x2] - ldr r1, =0x0000ffff - adds r0, r1 - ldrb r2, [r2] - adds r0, r2 - strh r0, [r7, 0x2] - ldr r1, =gUnknown_08571454 - adds r0, r5, 0x6 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x4] - adds r1, 0x8 - lsls r1, 16 - asrs r1, 16 - ldrh r2, [r0] - adds r2, 0x6 - lsls r2, 16 - asrs r2, 16 - lsls r3, r4, 24 - lsrs r3, 24 - mov r0, sp - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - mov r3, r9 - ldr r2, [r3] - lsls r3, r5, 2 - adds r2, 0x4 - adds r2, r3 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - str r1, [r2] - ldrb r2, [r1, 0x5] - movs r6, 0xD - negs r6, r6 - adds r0, r6, 0 - ands r2, r0 - movs r0, 0x8 - orrs r2, r0 - strb r2, [r1, 0x5] - mov r7, r9 - ldr r0, [r7] - adds r0, 0x4 - adds r0, r3 - ldr r0, [r0] - adds r1, r5, 0 - bl StartObjectImageAnim -_080C63C2: - lsls r0, r4, 24 - lsrs r5, r0, 24 - cmp r5, 0x6 - bls _080C633C - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C62DC - - thumb_func_start sub_80C63FC -sub_80C63FC: @ 80C63FC - push {r4-r6,lr} - movs r5, 0 - ldr r4, =0x02039cf0 - ldr r0, [r4] - ldr r0, [r0] - bl RemoveObjectAndFreeTiles - ldr r0, [r4] - str r5, [r0] - adds r6, r4, 0 -_080C6410: - ldr r0, [r6] - lsls r4, r5, 2 - adds r0, 0x4 - adds r0, r4 - ldr r0, [r0] - cmp r0, 0 - beq _080C642C - bl RemoveObjectAndFreeTiles - ldr r0, [r6] - adds r0, 0x4 - adds r0, r4 - movs r1, 0 - str r1, [r0] -_080C642C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x6 - bls _080C6410 - bl ResetObjectPaletteAllocator - movs r0, 0x2 - bl FreeObjectTilesByTag - movs r0, 0 - bl FreeObjectTilesByTag - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C63FC - - thumb_func_start nullsub_39 -nullsub_39: @ 80C6450 - bx lr - thumb_func_end nullsub_39 - - thumb_func_start sub_80C6454 -sub_80C6454: @ 80C6454 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x02039cf4 - ldr r0, [r5] - cmp r0, 0 - beq _080C6466 - adds r0, r4, 0 - bl SetMainCallback2 -_080C6466: - ldr r0, =0x00003014 - bl AllocZeroed - str r0, [r5] - str r4, [r0] - bl ResetTasks - ldr r0, =sub_80C67BC - movs r1, 0 - bl CreateTask - ldr r0, =sub_80C5438 - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C6454 - - thumb_func_start sub_80C6498 -sub_80C6498: @ 80C6498 - push {r4,lr} - bl ResetTasks - ldr r4, =0x02039cf4 - ldr r0, [r4] - ldr r0, [r0] - bl SetMainCallback2 - ldr r0, [r4] - ldr r2, =0x00003014 - movs r1, 0 - bl memset - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C6498 - - thumb_func_start sub_80C64CC -sub_80C64CC: @ 80C64CC - push {r4,r5,lr} - sub sp, 0x8 - ldr r0, =0x02039cec - ldr r0, [r0] - ldrh r0, [r0, 0x4] - cmp r0, 0x7 - bls _080C64DC - b _080C6694 -_080C64DC: - lsls r0, 2 - ldr r1, =_080C64F0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C64F0: - .4byte _080C6510 - .4byte _080C6520 - .4byte _080C6526 - .4byte _080C6538 - .4byte _080C65C0 - .4byte _080C65E8 - .4byte _080C6628 - .4byte _080C6678 -_080C6510: - movs r0, 0 - bl SetVBlankCallback - bl remove_some_task - bl SetVBlankHBlankCallbacksToNull - b _080C6694 -_080C6520: - bl sub_80C50D0 - b _080C6694 -_080C6526: - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - bl sub_80A1A74 - bl reset_temp_tile_data_buffers - b _080C6694 -_080C6538: - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085713F4 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r4, =0x02039cf4 - ldr r1, [r4] - adds r1, 0x12 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001012 - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00002012 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - movs r5, 0x1E - str r5, [sp] - movs r4, 0x14 - str r4, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r5, [sp] - str r4, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r5, [sp] - str r4, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - b _080C6618 - .pool -_080C65C0: - ldr r0, =gUnknown_08571428 - bl InitWindows - bl DeactivateAllTextPrinters - bl sub_80C6B94 - ldr r1, =gUnknown_0856FBBC - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _080C6694 - .pool -_080C65E8: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _080C669E - ldr r0, =gUnknown_08DE07C8 - movs r2, 0xD0 - lsls r2, 1 - movs r1, 0 - bl gpu_pal_apply - movs r0, 0 - bl stdpal_get - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =gUnknown_08570E00 - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer -_080C6618: - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - b _080C6694 - .pool -_080C6628: - 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 - bl sub_80C6974 - ldr r0, =pokemon_details - bl SetVBlankCallback - movs r5, 0x1 - negs r5, r5 - ldr r4, =0x00007fff - adds r0, r5, 0 - movs r1, 0x10 - adds r2, r4, 0 - bl sub_80A2A20 - str r4, [sp] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - b _080C6694 - .pool -_080C6678: - bl fade_and_return_progress_probably - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _080C669E - ldr r0, =0x02039cec - ldr r0, [r0] - strh r1, [r0, 0x4] - movs r0, 0x1 - b _080C66A0 - .pool -_080C6694: - ldr r0, =0x02039cec - ldr r1, [r0] - ldrh r0, [r1, 0x4] - adds r0, 0x1 - strh r0, [r1, 0x4] -_080C669E: - movs r0, 0 -_080C66A0: - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C64CC - - thumb_func_start sub_80C66AC -sub_80C66AC: @ 80C66AC - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x02039cec - ldr r0, [r0] - ldrh r0, [r0, 0x4] - cmp r0, 0x5 - bhi _080C67A4 - lsls r0, 2 - ldr r1, =_080C66CC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C66CC: - .4byte _080C66E4 - .4byte _080C66FC - .4byte _080C6722 - .4byte _080C6732 - .4byte _080C6774 - .4byte _080C6782 -_080C66E4: - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _080C67A4 - .pool -_080C66FC: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _080C67AE - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl HideBg - movs r0, 0x1 - bl HideBg - movs r0, 0x2 - bl HideBg - b _080C67A4 -_080C6722: - movs r0, 0 - bl SetVBlankCallback - bl remove_some_task - bl SetVBlankHBlankCallbacksToNull - b _080C67A4 -_080C6732: - ldr r4, =0x02039cf4 - ldr r0, [r4] - ldr r0, [r0, 0x4] - cmp r0, 0 - beq _080C6746 - bl RemoveObjectAndFreeTiles - movs r0, 0 - bl FreeObjectTilesByTag -_080C6746: - ldr r0, [r4] - ldr r0, [r0, 0xC] - cmp r0, 0 - beq _080C6758 - bl RemoveObjectAndFreeTiles - movs r0, 0x1 - bl FreeObjectTilesByTag -_080C6758: - ldr r0, [r4] - ldr r0, [r0, 0x8] - cmp r0, 0 - beq _080C676A - bl RemoveObjectAndFreeTiles - movs r0, 0x4 - bl FreeObjectTilesByTag -_080C676A: - bl FreeAllWindowBuffers - b _080C67A4 - .pool -_080C6774: - bl sub_80C50D0 - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - b _080C67A4 -_080C6782: - movs r0, 0 - bl UnsetBgTilemapBuffer - movs r0, 0x1 - bl UnsetBgTilemapBuffer - movs r0, 0x2 - bl UnsetBgTilemapBuffer - ldr r0, =0x02039cec - ldr r1, [r0] - movs r0, 0 - strh r0, [r1, 0x4] - movs r0, 0x1 - b _080C67B0 - .pool -_080C67A4: - ldr r0, =0x02039cec - ldr r1, [r0] - ldrh r0, [r1, 0x4] - adds r0, 0x1 - strh r0, [r1, 0x4] -_080C67AE: - movs r0, 0 -_080C67B0: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C66AC - - thumb_func_start sub_80C67BC -sub_80C67BC: @ 80C67BC - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x5 - bls _080C67D6 - b _080C68DA -_080C67D6: - lsls r0, 2 - ldr r1, =_080C67E8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C67E8: - .4byte _080C6800 - .4byte _080C6806 - .4byte _080C686C - .4byte _080C6894 - .4byte _080C68C4 - .4byte _080C68CE -_080C6800: - bl sub_80C64CC - b _080C68C8 -_080C6806: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r2, 0x2 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _080C6824 - movs r0, 0x3 - bl audio_play - movs r0, 0x4 - b _080C68DE - .pool -_080C6824: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080C6848 - ldr r0, =0x02039cf4 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0x5 - bls _080C6844 - movs r0, 0 - bl sub_80C6C70 - b _080C68E0 - .pool -_080C6844: - strh r2, [r4] - b _080C68E0 -_080C6848: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080C68E0 - ldr r0, =0x02039cf4 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0 - bne _080C6868 - movs r0, 0x1 - bl sub_80C6C70 - b _080C68E0 - .pool -_080C6868: - movs r0, 0x3 - b _080C68DE -_080C686C: - movs r1, 0x2 - ldrsh r0, [r4, r1] - cmp r0, 0x3 - ble _080C6882 - movs r0, 0 - bl sub_80C6C70 - movs r0, 0 - strh r0, [r4, 0x2] - movs r0, 0x1 - b _080C68DE -_080C6882: - ldr r0, =0x02039cf4 - ldr r0, [r0] - ldr r1, [r0, 0x4] - ldrh r0, [r1, 0x22] - adds r0, 0x4 - b _080C68B4 - .pool -_080C6894: - movs r1, 0x2 - ldrsh r0, [r4, r1] - cmp r0, 0x3 - ble _080C68AA - movs r0, 0x1 - bl sub_80C6C70 - movs r0, 0 - strh r0, [r4, 0x2] - movs r0, 0x1 - b _080C68DE -_080C68AA: - ldr r0, =0x02039cf4 - ldr r0, [r0] - ldr r1, [r0, 0x4] - ldrh r0, [r1, 0x22] - subs r0, 0x4 -_080C68B4: - strh r0, [r1, 0x22] - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - b _080C68E0 - .pool -_080C68C4: - bl sub_80C66AC -_080C68C8: - cmp r0, 0 - bne _080C68DA - b _080C68E0 -_080C68CE: - adds r0, r2, 0 - bl DestroyTask - bl sub_80C6498 - b _080C68E0 -_080C68DA: - ldrh r0, [r4] - adds r0, 0x1 -_080C68DE: - strh r0, [r4] -_080C68E0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80C67BC - - thumb_func_start sub_80C68E8 -sub_80C68E8: @ 80C68E8 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - ldr r2, =0xfffb0000 - adds r0, r2 - lsrs r0, 16 - cmp r0, 0x3 - bls _080C6904 - adds r0, r1, 0 - subs r0, 0xF - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bhi _080C690C -_080C6904: - movs r0, 0x1 - b _080C696E - .pool -_080C690C: - adds r0, r1, 0 - subs r0, 0x12 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x3 - bhi _080C691C - movs r0, 0x2 - b _080C696E -_080C691C: - adds r0, r1, 0 - subs r0, 0x16 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bhi _080C692C - movs r0, 0x3 - b _080C696E -_080C692C: - adds r0, r1, 0 - subs r0, 0x1C - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bhi _080C693C - movs r0, 0x4 - b _080C696E -_080C693C: - adds r0, r1, 0 - subs r0, 0x1F - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bhi _080C694C - movs r0, 0x5 - b _080C696E -_080C694C: - adds r0, r1, 0 - subs r0, 0x22 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x5 - bhi _080C695C - movs r0, 0x6 - b _080C696E -_080C695C: - adds r0, r1, 0 - subs r0, 0x19 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bls _080C696C - movs r0, 0 - b _080C696E -_080C696C: - movs r0, 0x7 -_080C696E: - pop {r1} - bx r1 - thumb_func_end sub_80C68E8 - - thumb_func_start sub_80C6974 -sub_80C6974: @ 80C6974 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - movs r7, 0 - bl ResetObjectPaletteAllocator - ldr r0, =gUnknown_085714E4 - bl LoadTaggedObjectPalettes - ldr r6, =gUnknown_085714BC - adds r0, r6, 0 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085715B4 - mov r8, r0 - ldr r4, =0x02039cf4 - ldr r0, [r4] - ldrb r2, [r0, 0x10] - lsls r2, 4 - adds r2, 0x8 - mov r0, r8 - movs r1, 0x9B - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, [r4] - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - ldr r2, =0x02020630 - mov r9, r2 - add r1, r9 - str r1, [r0, 0x4] - ldrb r2, [r1, 0x5] - movs r5, 0xD - negs r5, r5 - adds r0, r5, 0 - ands r0, r2 - strb r0, [r1, 0x5] - ldr r0, [r4] - ldr r1, [r0, 0x4] - adds r1, 0x3F - ldrb r0, [r1] - movs r2, 0x1 - orrs r0, r2 - strb r0, [r1] - ldr r0, [r4] - ldr r0, [r0, 0x4] - movs r1, 0x1 - bl StartObjectImageAnim - adds r6, 0x8 - adds r0, r6, 0 - bl LoadCompressedObjectPic - movs r3, 0x18 - add r8, r3 - ldr r6, =gUnknown_08571650 - ldr r0, [r4] - ldrb r0, [r0, 0x10] - lsls r0, 4 - adds r0, r6 - movs r2, 0x8 - ldrsh r1, [r0, r2] - movs r3, 0xA - ldrsh r2, [r0, r3] - mov r0, r8 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, [r4] - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - add r0, r9 - str r0, [r1, 0xC] - ldrb r1, [r0, 0x5] - ands r5, r1 - strb r5, [r0, 0x5] - ldr r1, [r4] - ldr r0, [r1, 0xC] - ldrb r1, [r1, 0x10] - lsls r1, 4 - adds r1, r6 - ldrb r1, [r1, 0xC] - bl StartObjectImageAnim - bl sav1_map_get_name - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3A - beq _080C6A40 - cmp r5, 0xCA - beq _080C6A40 - b _080C6B7A -_080C6A40: - ldr r4, =0x03005d8c - ldr r2, [r4] - movs r0, 0x5 - ldrsb r0, [r2, r0] - cmp r0, 0x4 - beq _080C6A52 - cmp r0, 0xE - bne _080C6A98 - movs r7, 0x37 -_080C6A52: - lsls r0, r7, 16 - asrs r0, 16 - ldrh r6, [r2] - adds r0, r6 - ldrh r4, [r2, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _080C6A66 - adds r0, 0x7 -_080C6A66: - lsls r0, 13 - lsrs r7, r0, 16 - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, 0 - bge _080C6A74 - adds r0, 0x7 -_080C6A74: - lsls r0, 13 - lsrs r4, r0, 16 - movs r5, 0 - b _080C6AF2 - .pool -_080C6A98: - lsls r0, 16 - lsrs r0, 16 - bl sub_80C68E8 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - beq _080C6AB4 - subs r0, r5, 0x1 - lsls r0, 4 - adds r0, r6 - ldrh r7, [r0, 0x8] - ldrh r4, [r0, 0xA] - b _080C6AF2 -_080C6AB4: - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x25 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0xE - bne _080C6ACE - ldrh r0, [r1, 0x28] - adds r0, 0x37 - lsls r0, 16 - lsrs r7, r0, 16 - b _080C6AD0 -_080C6ACE: - ldrh r7, [r1, 0x28] -_080C6AD0: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r4, [r0, 0x2A] - lsls r0, r7, 16 - asrs r0, 16 - cmp r0, 0 - bge _080C6AE0 - adds r0, 0x7 -_080C6AE0: - lsls r0, 13 - lsrs r7, r0, 16 - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, 0 - bge _080C6AEE - adds r0, 0x7 -_080C6AEE: - lsls r0, 13 - lsrs r4, r0, 16 -_080C6AF2: - ldr r0, =gUnknown_085714D4 - bl LoadCompressedObjectPic - mov r1, sp - ldr r0, =gUnknown_085715FC - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - mov r1, sp - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - adds r0, 0x4 - strh r0, [r1, 0x2] - cmp r5, 0 - beq _080C6B2C - lsls r1, r7, 16 - asrs r1, 16 - lsls r2, r4, 16 - b _080C6B3E - .pool -_080C6B2C: - lsls r1, r7, 19 - lsls r2, r4, 19 - movs r0, 0xA0 - lsls r0, 13 - adds r1, r0 - asrs r1, 16 - movs r3, 0x90 - lsls r3, 14 - adds r2, r3 -_080C6B3E: - asrs r2, 16 - mov r0, sp - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r3, r0, 24 - ldr r4, =0x02039cf4 - ldr r2, [r4] - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - str r1, [r2, 0x8] - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - beq _080C6B7A - ldr r0, [r4] - ldr r0, [r0, 0x8] - movs r1, 0x1 - bl StartObjectImageAnim -_080C6B7A: - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C6974 - - thumb_func_start sub_80C6B94 -sub_80C6B94: @ 80C6B94 - push {r4-r6,lr} - sub sp, 0xC - movs r4, 0 -_080C6B9A: - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _080C6B9A - movs r4, 0 - movs r6, 0 - ldr r5, =gUnknown_08571650 -_080C6BB8: - ldr r0, =0x02039cf4 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r4, r0 - bne _080C6BF0 - lsls r1, r4, 4 - adds r3, r1, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gUnknown_0857144E - str r0, [sp] - str r6, [sp, 0x4] - adds r1, r5 - ldr r0, [r1] - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x4 - bl box_print - b _080C6C0E - .pool -_080C6BF0: - lsls r1, r4, 4 - adds r3, r1, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gUnknown_0857144B - str r0, [sp] - str r6, [sp, 0x4] - adds r1, r5 - ldr r0, [r1] - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x4 - bl box_print -_080C6C0E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bls _080C6BB8 - ldr r0, =gUnknown_08571448 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - ldr r1, =gUnknown_08571650 - ldr r0, =0x02039cf4 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - lsls r0, 4 - adds r1, 0x4 - adds r0, r1 - ldr r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0x4 - movs r3, 0 - bl box_print - movs r4, 0 -_080C6C40: - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _080C6C40 - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C6B94 - - thumb_func_start sub_80C6C70 -sub_80C6C70: @ 80C6C70 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0xC - lsls r0, 24 - cmp r0, 0 - beq _080C6C8C - ldr r0, =0x02039cf4 - ldr r4, [r0] - ldrb r5, [r4, 0x10] - adds r0, r5, 0x6 - b _080C6C94 - .pool -_080C6C8C: - ldr r0, =0x02039cf4 - ldr r4, [r0] - ldrb r5, [r4, 0x10] - adds r0, r5, 0x1 -_080C6C94: - movs r1, 0x7 - bl __modsi3 - strb r0, [r4, 0x10] - lsls r0, r5, 4 - adds r3, r0, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldr r6, =gUnknown_0857144B - str r6, [sp] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x4] - ldr r4, =gUnknown_08571650 - adds r0, r4 - ldr r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x4 - bl box_print - ldr r5, =0x02039cf4 - ldr r1, [r5] - ldrb r3, [r1, 0x10] - lsls r3, 4 - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - adds r0, r6, 0x3 - str r0, [sp] - mov r0, r8 - str r0, [sp, 0x4] - ldrb r0, [r1, 0x10] - lsls r0, 4 - adds r0, r4 - ldr r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x4 - bl box_print - ldr r1, [r5] - ldr r2, [r1, 0x4] - ldrb r0, [r1, 0x10] - lsls r0, 4 - adds r0, 0x8 - strh r0, [r2, 0x22] - ldr r0, [r1, 0xC] - ldrb r1, [r1, 0x10] - lsls r1, 4 - adds r1, r4 - ldrb r1, [r1, 0xC] - bl StartObjectImageAnim - ldr r1, [r5] - ldr r2, [r1, 0xC] - ldrb r0, [r1, 0x10] - lsls r0, 4 - adds r0, r4 - ldrh r0, [r0, 0x8] - strh r0, [r2, 0x20] - ldr r2, [r1, 0xC] - ldrb r0, [r1, 0x10] - lsls r0, 4 - adds r0, r4 - ldrh r0, [r0, 0xA] - strh r0, [r2, 0x22] - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - subs r6, 0x3 - str r6, [sp] - mov r1, r8 - str r1, [sp, 0x4] - ldr r0, [r5] - ldrb r0, [r0, 0x10] - lsls r0, 4 - adds r4, 0x4 - adds r0, r4 - ldr r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0x4 - movs r3, 0 - bl box_print - movs r4, 0 -_080C6D4A: - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _080C6D4A - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x6C - bl audio_play - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C6C70 - - thumb_func_start sub_80C6D80 -sub_80C6D80: @ 80C6D80 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - str r0, [sp, 0x24] - adds r7, r1, 0 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x28] - lsls r3, 24 - lsrs r3, 24 - mov r9, r3 - movs r0, 0 - movs r1, 0 - str r0, [sp, 0x1C] - str r1, [sp, 0x20] - ldr r1, =0x00ffffff - ldr r0, [sp, 0x1C] - ands r0, r1 - movs r1, 0xC0 - lsls r1, 21 - orrs r0, r1 - str r0, [sp, 0x1C] - ldr r1, =0xffffff00 - add r5, sp, 0x1C - ldr r0, [r5, 0x4] - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - str r0, [r5, 0x4] - adds r0, r5, 0 - bl AddWindow - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - lsls r4, r0, 24 - lsrs r4, 24 - mov r0, r9 - lsls r1, r0, 4 - orrs r1, r0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0 - movs r1, 0x7 - bl GetWindowAttribute - adds r6, r0, 0 - ldrb r0, [r5, 0x3] - lsls r0, 5 - adds r0, r6 - mov r8, r0 - ldr r1, [sp, 0x28] - cmp r1, 0 - bne _080C6E04 - add r0, sp, 0x14 - b _080C6E08 - .pool -_080C6E04: - add r0, sp, 0x14 - mov r1, r9 -_080C6E08: - strb r1, [r0] - add r1, sp, 0x14 - movs r2, 0 - movs r0, 0xF - strb r0, [r1, 0x1] - movs r0, 0xE - strb r0, [r1, 0x2] - mov r0, r10 - lsls r4, r0, 24 - lsrs r0, r4, 24 - str r2, [sp] - str r2, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - negs r1, r1 - str r1, [sp, 0xC] - ldr r1, [sp, 0x24] - str r1, [sp, 0x10] - movs r1, 0x1 - movs r3, 0x1 - bl AddTextPrinterParametrized2 - ldr r0, [sp, 0x4C] - mov r10, r4 - cmp r0, 0x6 - bls _080C6E3E - movs r0, 0x6 -_080C6E3E: - ldr r4, [sp, 0x4C] - subs r4, 0x6 - cmp r0, 0 - ble _080C6E70 - adds r5, r0, 0 -_080C6E48: - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0x40 - bl CpuSet - adds r1, r7, 0 - adds r1, 0x80 - mov r0, r8 - movs r2, 0x40 - bl CpuSet - adds r6, 0x80 - movs r2, 0x80 - add r8, r2 - movs r0, 0x80 - lsls r0, 1 - adds r7, r0 - subs r5, 0x1 - cmp r5, 0 - bne _080C6E48 -_080C6E70: - cmp r4, 0 - ble _080C6E90 - add r0, sp, 0x18 - mov r2, r9 - lsls r1, r2, 4 - orrs r1, r2 - strh r1, [r0] - lsls r2, r4, 7 - ldr r1, =0x001fffff - ands r2, r1 - movs r1, 0x80 - lsls r1, 17 - orrs r2, r1 - adds r1, r7, 0 - bl CpuSet -_080C6E90: - mov r1, r10 - lsrs r0, r1, 24 - bl RemoveWindow - 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_80C6D80 - - thumb_func_start sub_80C6EAC -sub_80C6EAC: @ 80C6EAC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - str r0, [sp, 0x20] - str r1, [sp, 0x24] - adds r6, r3, 0 - ldr r0, [sp, 0x4C] - mov r9, r0 - ldr r1, [sp, 0x50] - mov r10, r1 - lsls r2, 16 - lsrs r2, 16 - str r2, [sp, 0x28] - lsls r6, 24 - lsrs r6, 24 - mov r2, r9 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - mov r0, r10 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - movs r0, 0 - movs r1, 0 - str r0, [sp, 0x18] - str r1, [sp, 0x1C] - ldr r0, [sp, 0x20] - bl GetStringLength_Multibyte - lsls r0, 24 - ldr r2, =0x00ffffff - ldr r1, [sp, 0x18] - ands r1, r2 - orrs r1, r0 - str r1, [sp, 0x18] - ldr r1, =0xffffff00 - add r2, sp, 0x18 - mov r8, r2 - ldr r0, [r2, 0x4] - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - str r0, [r2, 0x4] - ldr r5, [sp, 0x18] - lsrs r5, 24 - lsls r5, 5 - mov r0, r8 - bl AddWindow - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, r6, 4 - orrs r1, r6 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0 - movs r1, 0x7 - bl GetWindowAttribute - adds r7, r0, 0 - mov r0, r8 - ldrb r0, [r0, 0x3] - lsls r0, 5 - mov r8, r0 - add r8, r7 - add r0, sp, 0x14 - movs r1, 0 - strb r6, [r0] - mov r2, r9 - strb r2, [r0, 0x1] - mov r2, r10 - strb r2, [r0, 0x2] - str r1, [sp] - str r1, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0xC] - ldr r0, [sp, 0x20] - str r0, [sp, 0x10] - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - movs r3, 0x2 - bl AddTextPrinterParametrized2 - lsrs r5, 1 - adds r0, r7, 0 - ldr r1, [sp, 0x24] - adds r2, r5, 0 - bl CpuSet - ldr r2, [sp, 0x24] - ldr r0, [sp, 0x28] - adds r1, r2, r0 - mov r0, r8 - adds r2, r5, 0 - bl CpuSet - adds r0, r4, 0 - bl RemoveWindow - 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_80C6EAC - - thumb_func_start sub_80C6FA0 -sub_80C6FA0: @ 80C6FA0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 - movs r5, 0 -_080C6FAA: - lsls r1, r4, 24 - lsrs r1, 24 - adds r0, r6, 0 - movs r2, 0xB - bl get_pokemon_data_from_any_box - cmp r0, 0 - beq _080C6FC0 - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_080C6FC0: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x1D - bls _080C6FAA - lsls r0, r5, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80C6FA0 - - thumb_func_start sub_80C6FD4 -sub_80C6FD4: @ 80C6FD4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 -_080C6FDC: - lsls r1, r4, 24 - lsrs r1, 24 - adds r0, r5, 0 - movs r2, 0xB - bl get_pokemon_data_from_any_box - cmp r0, 0 - bne _080C6FF2 - lsls r0, r4, 16 - asrs r0, 16 - b _080C7000 -_080C6FF2: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x1D - bls _080C6FDC - movs r0, 0x1 - negs r0, r0 -_080C7000: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80C6FD4 - - thumb_func_start sub_80C7008 -sub_80C7008: @ 80C7008 - push {r4-r6,lr} - movs r5, 0 - movs r6, 0 -_080C700E: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _080C7036 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _080C7036 - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 -_080C7036: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x5 - bls _080C700E - lsls r0, r6, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C7008 - - thumb_func_start sub_80C7050 -sub_80C7050: @ 80C7050 - push {r4-r7,lr} - lsls r0, 24 - movs r5, 0 - movs r6, 0 - lsrs r7, r0, 24 -_080C705A: - cmp r5, r7 - beq _080C7092 - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _080C7092 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _080C7092 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _080C7092 - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 -_080C7092: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x5 - bls _080C705A - lsls r0, r6, 24 - lsrs r0, 24 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C7050 - - thumb_func_start sub_80C70AC -sub_80C70AC: @ 80C70AC - push {lr} - ldr r0, =0x020375e0 - ldrb r0, [r0] - bl sub_80C7050 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C70AC - - thumb_func_start sub_80C70C4 -sub_80C70C4: @ 80C70C4 - push {r4,r5,lr} - movs r4, 0 - movs r5, 0 -_080C70CA: - movs r0, 0x64 - muls r0, r4 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _080C70E2 - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_080C70E2: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x5 - bls _080C70CA - lsls r0, r5, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C70C4 - - thumb_func_start sub_80C70FC -sub_80C70FC: @ 80C70FC - push {r4,r5,lr} - adds r5, r0, 0 - lsls r4, r2, 16 - lsrs r4, 16 - bl CopyString - adds r1, r0, 0 - adds r5, r4 - cmp r1, r5 - bcs _080C711A - movs r0, 0 -_080C7112: - strb r0, [r1] - adds r1, 0x1 - cmp r1, r5 - bcc _080C7112 -_080C711A: - movs r0, 0xFF - strb r0, [r1] - adds r0, r1, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80C70FC - - thumb_func_start sub_80C7128 -sub_80C7128: @ 80C7128 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r6, r0, 0 - adds r7, r3, 0 - ldr r5, [sp, 0x1C] - ldr r4, [sp, 0x20] - ldr r0, [sp, 0x24] - mov r9, r0 - ldr r0, [sp, 0x28] - ldr r3, [sp, 0x2C] - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r3, 16 - lsrs r3, 16 - mov r0, r9 - lsls r0, 17 - mov r9, r0 - lsrs r2, 11 - adds r2, r1 - lsls r2, 1 - adds r6, r2 - adds r0, r4, 0 - muls r0, r3 - adds r0, r5 - lsls r0, 1 - adds r7, r0 - movs r4, 0 - cmp r4, r8 - bcs _080C7198 - mov r0, r9 - lsrs r0, 1 - mov r9, r0 - lsls r5, r3, 1 -_080C717E: - adds r0, r7, 0 - adds r1, r6, 0 - mov r3, r9 - lsrs r2, r3, 16 - bl CpuSet - adds r6, 0x40 - adds r7, r5 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r8 - bcc _080C717E -_080C7198: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80C7128 - - thumb_func_start sub_80C71A4 -sub_80C71A4: @ 80C71A4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r4, r0, 0 - ldr r0, [sp, 0x28] - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - lsrs r2, 11 - adds r2, r1 - lsls r2, 1 - adds r4, r2 - lsls r3, 17 - lsrs r0, r3, 16 - str r0, [sp, 0x4] - movs r0, 0 - cmp r0, r10 - bcs _080C724E - movs r6, 0x80 - lsls r6, 5 - mov r5, sp - ldr r7, =0x040000d4 - lsrs r3, 17 - mov r9, r3 - mov r1, r9 - movs r2, 0x81 - lsls r2, 24 - orrs r1, r2 - mov r9, r1 -_080C71EA: - adds r3, r4, 0 - ldr r2, [sp, 0x4] - movs r1, 0x40 - adds r1, r4 - mov r8, r1 - adds r0, 0x1 - mov r12, r0 - cmp r2, r6 - bhi _080C7214 - movs r0, 0 - strh r0, [r5] - mov r2, sp - str r2, [r7] - str r4, [r7, 0x4] - mov r0, r9 - str r0, [r7, 0x8] - ldr r0, [r7, 0x8] - b _080C7242 - .pool -_080C7214: - movs r4, 0 - strh r4, [r5] - ldr r1, =0x040000d4 - mov r0, sp - str r0, [r1] - str r3, [r1, 0x4] - ldr r0, =0x81000800 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r3, r6 - subs r2, r6 - cmp r2, r6 - bhi _080C7214 - strh r4, [r5] - mov r0, sp - str r0, [r1] - str r3, [r1, 0x4] - lsrs r0, r2, 1 - movs r2, 0x81 - lsls r2, 24 - orrs r0, r2 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] -_080C7242: - mov r4, r8 - mov r1, r12 - lsls r0, r1, 16 - lsrs r0, 16 - cmp r0, r10 - bcc _080C71EA -_080C724E: - 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_80C71A4 - - thumb_func_start c3_0808C39C -c3_0808C39C: @ 80C7268 - push {r4-r7,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x4 - bls _080C7284 - b _080C756A -_080C7284: - lsls r0, 2 - ldr r1, =_080C7298 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C7298: - .4byte _080C72AC - .4byte _080C730C - .4byte _080C7320 - .4byte _080C746A - .4byte _080C7544 -_080C72AC: - ldrb r0, [r5, 0xA] - adds r1, r5, 0 - adds r1, 0x26 - bl sub_80C75FC - bl sub_81973A4 - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r1, =gUnknown_085716C0 - movs r2, 0xA - ldrsh r0, [r5, r2] - lsls r0, 3 - adds r1, 0x4 - adds r0, r1 - ldr r2, [r0] - 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, 0 - movs r1, 0x1 - movs r3, 0xFF - bl AddTextPrinterParametrized - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldrh r0, [r5, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - bl CopyWindowToVram - b _080C7318 - .pool -_080C730C: - bl sub_80ABDFC - lsls r0, 24 - cmp r0, 0 - bne _080C7318 - b _080C756A -_080C7318: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - b _080C756A -_080C7320: - bl ProcessMenuInput - lsls r0, 24 - asrs r0, 24 - strh r0, [r5, 0xC] - movs r3, 0xC - ldrsh r1, [r5, r3] - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _080C73D0 - cmp r1, r0 - bgt _080C7342 - subs r0, 0x1 - cmp r1, r0 - beq _080C7348 - b _080C73F6 -_080C7342: - cmp r1, 0x4 - beq _080C73D0 - b _080C73F6 -_080C7348: - ldrh r3, [r5, 0xA] - strh r3, [r5, 0xE] - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080C7366 - subs r0, r3, 0x1 - strh r0, [r5, 0xE] - lsls r0, 16 - cmp r0, 0 - bge _080C7366 - movs r0, 0x4 - strh r0, [r5, 0xE] -_080C7366: - ldrh r1, [r2, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080C7382 - ldrh r0, [r5, 0xE] - adds r0, 0x1 - strh r0, [r5, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _080C7382 - movs r0, 0 - strh r0, [r5, 0xE] -_080C7382: - lsls r0, r3, 16 - asrs r0, 16 - ldrh r2, [r5, 0xE] - movs r3, 0xE - ldrsh r1, [r5, r3] - cmp r0, r1 - bne _080C7392 - b _080C756A -_080C7392: - movs r4, 0 - strh r2, [r5, 0xA] - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r1, =gUnknown_085716C0 - movs r2, 0xA - ldrsh r0, [r5, r2] - lsls r0, 3 - adds r1, 0x4 - adds r0, r1 - ldr r2, [r0] - str r4, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParametrized - b _080C756A - .pool -_080C73D0: - ldrh r0, [r5, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_819746C - bl script_env_2_disable - bl script_env_2_enable_and_set_ctx_running - ldrh r0, [r5, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl RemoveWindow - adds r0, r4, 0 - bl DestroyTask - b _080C756A -_080C73F6: - movs r3, 0xC - ldrsh r4, [r5, r3] - cmp r4, 0 - bne _080C7428 - bl sub_80C70C4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6 - bne _080C7428 - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_085EBCAD - str r4, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r4, 0x3 - str r4, [sp, 0xC] - b _080C7532 - .pool -_080C7428: - movs r1, 0xC - ldrsh r0, [r5, r1] - cmp r0, 0x1 - bne _080C745C - bl sub_80C70C4 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bne _080C745C - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_085EBC89 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r4, 0x3 - str r4, [sp, 0xC] - b _080C7532 - .pool -_080C745C: - movs r0, 0x1 - movs r1, 0 - bl fade_screen - movs r0, 0x4 - strh r0, [r5, 0x8] - b _080C756A -_080C746A: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r7, 0x3 - adds r4, r7, 0 - ands r4, r1 - cmp r4, 0 - beq _080C749C - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r1, =gUnknown_085716C0 - movs r2, 0xA - ldrsh r0, [r5, r2] - lsls r0, 3 - adds r1, 0x4 - adds r0, r1 - ldr r2, [r0] - movs r0, 0 - str r0, [sp] - b _080C7528 - .pool -_080C749C: - movs r0, 0x40 - ands r0, r1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0 - beq _080C74E8 - ldrh r0, [r5, 0xA] - subs r0, 0x1 - strh r0, [r5, 0xA] - lsls r0, 16 - cmp r0, 0 - bge _080C74B8 - movs r0, 0x4 - strh r0, [r5, 0xA] -_080C74B8: - movs r0, 0x1 - negs r0, r0 - bl MoveMenuCursor - bl GetMenuCursorPos - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0xA] - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r1, =gUnknown_085716C0 - movs r3, 0xA - ldrsh r0, [r5, r3] - lsls r0, 3 - adds r1, 0x4 - adds r0, r1 - ldr r2, [r0] - str r4, [sp] - b _080C7528 - .pool -_080C74E8: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080C756A - ldrh r0, [r5, 0xA] - adds r0, 0x1 - strh r0, [r5, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _080C7500 - strh r6, [r5, 0xA] -_080C7500: - movs r0, 0x1 - bl MoveMenuCursor - bl GetMenuCursorPos - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0xA] - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r1, =gUnknown_085716C0 - movs r2, 0xA - ldrsh r0, [r5, r2] - lsls r0, 3 - adds r1, 0x4 - adds r0, r1 - ldr r2, [r0] - str r6, [sp] -_080C7528: - movs r4, 0x2 - str r4, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - str r7, [sp, 0xC] -_080C7532: - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParametrized - strh r4, [r5, 0x8] - b _080C756A - .pool -_080C7544: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080C756A - bl overworld_free_bg_tilemaps - ldrb r0, [r5, 0xC] - bl sub_80C7D74 - ldrh r0, [r5, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl RemoveWindow - adds r0, r4, 0 - bl DestroyTask -_080C756A: - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end c3_0808C39C - - thumb_func_start sub_80C7578 -sub_80C7578: @ 80C7578 - push {lr} - ldr r0, =c3_0808C39C - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0 - strh r0, [r1, 0x8] - strh r0, [r1, 0xA] - bl script_env_2_enable - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C7578 - - thumb_func_start mapldr_0808C6D8 -mapldr_0808C6D8: @ 80C75A8 - push {r4,r5,lr} - ldr r0, =0x030022c0 - ldr r5, [r0, 0xC] - movs r0, 0 - bl SetVBlankCallback - ldr r4, =c3_0808C39C - adds r0, r4, 0 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0 - strh r2, [r1, 0x8] - ldr r2, =0x02039d00 - ldrb r2, [r2] - strh r2, [r1, 0xA] - bl _call_via_r4 - adds r0, r5, 0 - bl SetVBlankCallback - bl pal_fill_black - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end mapldr_0808C6D8 - - thumb_func_start sub_80C75FC -sub_80C75FC: @ 80C75FC - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x8 - adds r6, r0, 0 - mov r9, r1 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =gUnknown_085716E8 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp] - str r1, [sp, 0x4] - ldr r0, =gUnknown_085716C0 - mov r8, r0 - movs r1, 0x5 - bl GetMaxWidthInMenuTable - lsls r0, 24 - ldr r2, =0x00ffffff - ldr r1, [sp] - ands r1, r2 - orrs r1, r0 - str r1, [sp] - mov r0, sp - bl AddWindow - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - lsls r4, r5, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0 - bl sub_81973FC - adds r0, r4, 0 - movs r1, 0x5 - mov r2, r8 - bl PrintMenuTable - adds r0, r4, 0 - movs r1, 0x5 - adds r2, r6, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - mov r0, r9 - strh r5, [r0] - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C75FC - - thumb_func_start sub_80C7678 -sub_80C7678: @ 80C7678 - push {lr} - bl sub_80CAEA0 - ldr r1, =0x02039d00 - strb r0, [r1] - ldr r1, =0x03005dac - ldr r0, =mapldr_0808C6D8 - str r0, [r1] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C7678 - - thumb_func_start sub_80C76A4 -sub_80C76A4: @ 80C76A4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r0 - lsls r1, 24 - lsrs r0, r1, 24 - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r3, 24 - adds r4, r3, 0 - ldr r2, =0x0000ffff - cmp r3, 0x1 - bhi _080C76C6 - movs r2, 0x1 - cmp r3, 0x1 - beq _080C76CA -_080C76C6: - cmp r4, 0x3 - bne _080C7714 -_080C76CA: - lsls r0, 24 - asrs r0, 24 - lsls r2, 16 - asrs r1, r2, 16 - adds r1, r0 - lsls r0, r1, 16 - asrs r1, r0, 16 - adds r6, r2, 0 - cmp r1, 0 - blt _080C7760 - cmp r1, r7 - bgt _080C7760 -_080C76E2: - asrs r4, r0, 16 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 4 - add r0, r8 - movs r1, 0xB - bl pokemon_getattr_encrypted - cmp r0, 0 - bne _080C770C - asrs r0, r6, 16 - adds r0, r4, r0 - lsls r0, 16 - asrs r2, r0, 16 - cmp r2, 0 - blt _080C7760 - cmp r2, r7 - ble _080C76E2 - b _080C7760 - .pool -_080C770C: - adds r0, r4, 0 - b _080C7764 -_080C7710: - adds r0, r5, 0 - b _080C7764 -_080C7714: - lsls r0, 24 - asrs r0, 24 - lsls r2, 16 - asrs r1, r2, 16 - adds r1, r0 - lsls r0, r1, 16 - asrs r1, r0, 16 - adds r6, r2, 0 - cmp r1, 0 - blt _080C7760 - cmp r1, r7 - bgt _080C7760 -_080C772C: - asrs r5, r0, 16 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 4 - mov r1, r8 - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _080C7750 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _080C7710 -_080C7750: - asrs r0, r6, 16 - adds r0, r5, r0 - lsls r0, 16 - asrs r2, r0, 16 - cmp r2, 0 - blt _080C7760 - cmp r2, r7 - ble _080C772C -_080C7760: - movs r0, 0x1 - negs r0, r0 -_080C7764: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80C76A4 - - thumb_func_start sub_80C7770 -sub_80C7770: @ 80C7770 - push {r4-r6,lr} - movs r0, 0 - bl sub_80D1D18 - movs r5, 0 -_080C777A: - movs r4, 0 - lsls r6, r5, 24 -_080C777E: - lsls r1, r4, 24 - lsrs r1, 24 - lsrs r0, r6, 24 - bl sub_80D2018 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x1D - bls _080C777E - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0xD - bls _080C777A - movs r5, 0 -_080C779E: - lsls r0, r5, 24 - lsrs r0, 24 - bl sav3_get_box_name - ldr r1, =gUnknown_085EBCC1 - bl CopyString - adds r4, r5, 0x1 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x2 - bl ConvertIntToDecimalString - lsls r4, 16 - lsrs r5, r4, 16 - cmp r5, 0xD - bls _080C779E - movs r5, 0 -_080C77C2: - lsls r0, r5, 24 - lsrs r0, 24 - movs r1, 0x3 - ands r1, r5 - bl sub_80D2120 - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0xD - bls _080C77C2 - bl sub_80D242C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C7770 - - thumb_func_start sub_80C77E8 -sub_80C77E8: @ 80C77E8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x20 - adds r5, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r6, r1, 0 - lsls r2, 16 - lsrs r2, 16 - adds r7, r2, 0 - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - ldr r0, =gUnknown_0857173C - str r0, [sp, 0x18] - ldr r1, =0xffff0000 - add r4, sp, 0x18 - ldr r0, [r4, 0x4] - ands r0, r1 - orrs r0, r7 - str r0, [r4, 0x4] - mov r1, sp - ldr r0, =gUnknown_0857175C - str r0, [sp] - movs r0, 0x80 - lsls r0, 4 - strh r0, [r1, 0x4] - strh r6, [r1, 0x6] - ldr r0, =gUnknown_08571F5C - str r0, [sp, 0x8] - movs r0, 0xC0 - lsls r0, 1 - strh r0, [r1, 0xC] - adds r0, r6, 0x1 - strh r0, [r1, 0xE] - add r0, sp, 0x10 - movs r1, 0 - movs r2, 0x8 - bl memset - ldr r0, [sp, 0x38] - cmp r0, 0 - beq _080C7846 - adds r0, r4, 0 - bl LoadTaggedObjectPalette -_080C7846: - mov r0, sp - bl LoadObjectPics - ldr r0, =0x02039d04 - str r5, [r0] - movs r1, 0x90 - lsls r1, 2 - adds r0, r5, r1 - strh r6, [r0] - adds r1, 0x2 - adds r0, r5, r1 - strh r7, [r0] - adds r1, 0x4 - adds r0, r5, r1 - mov r1, r8 - strb r1, [r0] - movs r1, 0x8F - lsls r1, 2 - adds r0, r5, r1 - ldr r1, [sp, 0x38] - str r1, [r0] - add sp, 0x20 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C77E8 - - thumb_func_start sub_80C7890 -sub_80C7890: @ 80C7890 - push {r4,r5,lr} - ldr r5, =0x02039d04 - ldr r1, [r5] - movs r2, 0x8F - lsls r2, 2 - adds r0, r1, r2 - ldr r0, [r0] - cmp r0, 0 - beq _080C78AC - adds r2, 0x6 - adds r0, r1, r2 - ldrh r0, [r0] - bl FreeObjectPaletteByTag -_080C78AC: - ldr r0, [r5] - movs r4, 0x90 - lsls r4, 2 - adds r0, r4 - ldrh r0, [r0] - bl FreeObjectTilesByTag - ldr r0, [r5] - adds r0, r4 - ldrh r0, [r0] - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - bl FreeObjectTilesByTag - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C7890 - - thumb_func_start sub_80C78D4 -sub_80C78D4: @ 80C78D4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_80C7958 - pop {r0} - bx r0 - thumb_func_end sub_80C78D4 - - thumb_func_start sub_80C78E4 -sub_80C78E4: @ 80C78E4 - push {lr} - bl sub_80C7B14 - pop {r0} - bx r0 - thumb_func_end sub_80C78E4 - - thumb_func_start sub_80C78F0 -sub_80C78F0: @ 80C78F0 - push {lr} - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080C790C - movs r0, 0x5 - bl audio_play - movs r0, 0xC9 - b _080C7954 - .pool -_080C790C: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080C792C - movs r0, 0x5 - bl audio_play - ldr r0, =0x02039d04 - ldr r0, [r0] - movs r1, 0x91 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - b _080C7954 - .pool -_080C792C: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080C7940 - movs r0, 0x5 - bl audio_play - bl sub_80C7BB4 - b _080C7952 -_080C7940: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080C7952 - movs r0, 0x5 - bl audio_play - bl sub_80C7B80 -_080C7952: - movs r0, 0xC8 -_080C7954: - pop {r1} - bx r1 - thumb_func_end sub_80C78F0 - - thumb_func_start sub_80C7958 -sub_80C7958: @ 80C7958 - push {r4-r6,lr} - sub sp, 0x3C - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0 - movs r1, 0 - str r0, [sp, 0x34] - str r1, [sp, 0x38] - movs r1, 0xC0 - lsls r1, 24 - ldr r0, [sp, 0x34] - orrs r0, r1 - str r0, [sp, 0x34] - ldr r1, =0xffff0fff - add r4, sp, 0x34 - ldr r0, [r4, 0x4] - ands r0, r1 - movs r1, 0x80 - lsls r1, 5 - orrs r0, r1 - str r0, [r4, 0x4] - add r1, sp, 0x1C - movs r2, 0 - strh r2, [r1] - mov r0, sp - adds r0, 0x1E - strh r2, [r0] - str r4, [sp, 0x20] - ldr r0, =gDummyObjectImageAnimTable - str r0, [sp, 0x24] - str r2, [sp, 0x28] - ldr r0, =gDummyObjectRotScalAnimTable - str r0, [sp, 0x2C] - ldr r0, =DummyObjectCallback - str r0, [sp, 0x30] - add r0, sp, 0x4 - movs r2, 0x18 - bl memcpy - ldr r6, =0x02039d04 - ldr r0, [r6] - movs r1, 0x91 - lsls r1, 2 - adds r0, r1 - strb r5, [r0] - add r2, sp, 0x4 - ldr r1, [r6] - movs r5, 0x90 - lsls r5, 2 - adds r0, r1, r5 - ldrh r0, [r0] - strh r0, [r2] - ldr r3, =0x00000242 - adds r1, r3 - ldrh r0, [r1] - strh r0, [r2, 0x2] - adds r0, r2, 0 - movs r1, 0xA0 - movs r2, 0x60 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - ldr r3, [r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - str r0, [r3] - ldrb r2, [r4, 0x1] - movs r1, 0x3F - adds r0, r1, 0 - ands r0, r2 - movs r2, 0x80 - orrs r0, r2 - strb r0, [r4, 0x1] - ldrb r0, [r4, 0x3] - ands r1, r0 - movs r0, 0x40 - orrs r1, r0 - strb r1, [r4, 0x3] - add r1, sp, 0x4 - adds r3, r5 - ldrh r0, [r3] - adds r0, 0x1 - strh r0, [r1] - ldr r0, =gUnknown_08571710 - str r0, [sp, 0xC] - movs r4, 0 -_080C7A10: - ldr r0, [r6] - ldr r1, =0x00000246 - adds r0, r1 - ldrb r3, [r0] - add r0, sp, 0x4 - movs r1, 0x7C - movs r2, 0x50 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - ldr r2, [r6] - lsls r3, r4, 2 - adds r2, 0x4 - adds r2, r3 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r1, r0, r1 - str r1, [r2] - movs r5, 0 - movs r0, 0x2 - ands r0, r4 - cmp r0, 0 - beq _080C7A4A - movs r0, 0xC4 - strh r0, [r1, 0x20] - movs r5, 0x2 -_080C7A4A: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _080C7A6E - ldr r1, [r6] - adds r1, 0x4 - adds r1, r3 - ldr r2, [r1] - movs r0, 0x70 - strh r0, [r2, 0x22] - ldr r2, [r1] - ldrb r1, [r2, 0x3] - movs r0, 0x3F - ands r0, r1 - strb r0, [r2, 0x3] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_080C7A6E: - ldr r0, [r6] - adds r0, 0x4 - adds r0, r3 - ldr r0, [r0] - lsls r1, r5, 24 - lsrs r1, 24 - bl StartObjectImageAnim - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x3 - bls _080C7A10 - movs r4, 0 - ldr r5, =0x02039d04 -_080C7A8C: - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 19 - movs r3, 0xF8 - lsls r3, 15 - adds r0, r3 - lsrs r0, 16 - lsls r2, r4, 24 - lsrs r2, 24 - ldr r1, [r5] - ldr r3, =0x00000246 - adds r1, r3 - ldrb r1, [r1] - str r1, [sp] - movs r1, 0x58 - movs r3, 0 - bl sub_80CD2E8 - adds r2, r0, 0 - ldr r0, [r5] - lsls r1, r4, 2 - adds r0, 0x20 - adds r0, r1 - str r2, [r0] - cmp r2, 0 - beq _080C7AD4 - movs r1, 0x1 - cmp r4, 0 - bne _080C7ACC - movs r3, 0x1 - negs r3, r3 - adds r1, r3, 0 -_080C7ACC: - strh r1, [r2, 0x2E] - ldr r1, [r0] - ldr r0, =sub_80C7CF4 - str r0, [r1, 0x1C] -_080C7AD4: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x1 - bls _080C7A8C - bl sub_80C7BE4 - add sp, 0x3C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C7958 - - thumb_func_start sub_80C7B14 -sub_80C7B14: @ 80C7B14 - push {r4-r6,lr} - ldr r4, =0x02039d04 - ldr r0, [r4] - ldr r0, [r0] - cmp r0, 0 - beq _080C7B2A - bl RemoveObjectAndFreeTiles - ldr r1, [r4] - movs r0, 0 - str r0, [r1] -_080C7B2A: - movs r5, 0 - adds r6, r4, 0 -_080C7B2E: - ldr r0, [r6] - lsls r4, r5, 2 - adds r0, 0x4 - adds r0, r4 - ldr r0, [r0] - cmp r0, 0 - beq _080C7B4A - bl RemoveObjectAndFreeTiles - ldr r0, [r6] - adds r0, 0x4 - adds r0, r4 - movs r1, 0 - str r1, [r0] -_080C7B4A: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x3 - bls _080C7B2E - movs r5, 0 -_080C7B56: - ldr r0, =0x02039d04 - ldr r0, [r0] - lsls r1, r5, 2 - adds r0, 0x20 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - beq _080C7B6A - bl RemoveObjectAndFreeTiles -_080C7B6A: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x1 - bls _080C7B56 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C7B14 - - thumb_func_start sub_80C7B80 -sub_80C7B80: @ 80C7B80 - push {lr} - ldr r2, =0x02039d04 - ldr r1, [r2] - movs r0, 0x91 - lsls r0, 2 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD - bls _080C7BA6 - ldr r0, [r2] - movs r1, 0x91 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strb r1, [r0] -_080C7BA6: - bl sub_80C7BE4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C7B80 - - thumb_func_start sub_80C7BB4 -sub_80C7BB4: @ 80C7BB4 - push {lr} - ldr r0, =0x02039d04 - ldr r2, [r0] - movs r1, 0x91 - lsls r1, 2 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080C7BD0 - subs r1, r0, 0x1 - b _080C7BD2 - .pool -_080C7BD0: - movs r1, 0xD -_080C7BD2: - movs r3, 0x91 - lsls r3, 2 - adds r0, r2, r3 - strb r1, [r0] - bl sub_80C7BE4 - pop {r0} - bx r0 - thumb_func_end sub_80C7BB4 - - thumb_func_start sub_80C7BE4 -sub_80C7BE4: @ 80C7BE4 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0x24 - ldr r0, =0x02039d04 - mov r9, r0 - ldr r0, [r0] - movs r4, 0x91 - lsls r4, 2 - adds r0, r4 - ldrb r0, [r0] - bl sav3_get_box_name - mov r10, r0 - mov r1, r9 - ldr r0, [r1] - adds r0, r4 - ldrb r0, [r0] - bl sub_80C6FA0 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - add r4, sp, 0x1C - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x8 - bl memset - movs r0, 0x8 - strb r0, [r4, 0x3] - movs r0, 0x4 - strb r0, [r4, 0x4] - adds r0, r4, 0 - bl AddWindow - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0x44 - bl FillWindowPixelBuffer - movs r0, 0x1 - mov r1, r10 - movs r2, 0x40 - bl GetStringCenterAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - ldr r0, =gUnknown_08571734 - mov r8, r0 - str r0, [sp] - movs r6, 0x1 - negs r6, r6 - str r6, [sp, 0x4] - mov r1, r10 - str r1, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - add r0, sp, 0xC - adds r1, r5, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r1, =gUnknown_08571737 - add r0, sp, 0xC - bl AppendString - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0x40 - bl GetStringCenterAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - mov r0, r8 - str r0, [sp] - str r6, [sp, 0x4] - add r1, sp, 0xC - str r1, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - movs r3, 0x11 - bl box_print - adds r0, r4, 0 - movs r1, 0x7 - bl GetWindowAttribute - adds r5, r0, 0 - mov r1, r9 - ldr r0, [r1] - movs r1, 0x90 - lsls r1, 2 - adds r0, r1 - ldrh r0, [r0] - bl GetObjectTileRangeStartByTag - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 11 - ldr r0, =0x06010100 - adds r1, r0 - ldr r2, =0x04000100 - adds r0, r5, 0 - bl CpuSet - adds r0, r4, 0 - bl RemoveWindow - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C7BE4 - - thumb_func_start sub_80C7CF4 -sub_80C7CF4: @ 80C7CF4 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x30] - adds r0, 0x1 - movs r2, 0 - strh r0, [r1, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _080C7D24 - strh r2, [r1, 0x30] - ldrh r0, [r1, 0x2E] - ldrh r3, [r1, 0x24] - adds r0, r3 - strh r0, [r1, 0x24] - ldrh r0, [r1, 0x32] - adds r0, 0x1 - strh r0, [r1, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - ble _080C7D24 - strh r2, [r1, 0x32] - strh r2, [r1, 0x24] -_080C7D24: - pop {r0} - bx r0 - thumb_func_end sub_80C7CF4 - - thumb_func_start sub_80C7D28 -sub_80C7D28: @ 80C7D28 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl sub_80D2AA4 - bl copy_pal_bg_faded_to_pal_ram - ldr r0, =0x02039d08 - ldr r0, [r0] - movs r1, 0xB3 - lsls r1, 2 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x18 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C7D28 - - thumb_func_start c2_Box -c2_Box: @ 80C7D54 - push {lr} - bl RunTasks - bl do_scheduled_bg_tilemap_copies_to_vram - bl sub_80CA028 - bl sub_80CAA14 - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - pop {r0} - bx r0 - thumb_func_end c2_Box - - thumb_func_start sub_80C7D74 -sub_80C7D74: @ 80C7D74 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl ResetTasks - ldr r0, =0x02039d0d - strb r5, [r0] - ldr r4, =0x02039d08 - ldr r0, =0x000062c4 - bl Alloc - str r0, [r4] - cmp r0, 0 - bne _080C7DA8 - ldr r0, =sub_80C7678 - bl SetMainCallback2 - b _080C7DD4 - .pool -_080C7DA8: - movs r2, 0 - strb r5, [r0, 0x1] - ldr r0, [r4] - strb r2, [r0, 0x3] - ldr r0, =0x02039d12 - movs r1, 0 - strh r2, [r0] - ldr r0, [r4] - strb r1, [r0] - ldr r0, =task_box_related_3 - movs r1, 0x3 - bl CreateTask - ldr r1, [r4] - strb r0, [r1, 0x4] - bl get_preferred_box - ldr r1, =0x02039d10 - strb r0, [r1] - ldr r0, =c2_Box - bl SetMainCallback2 -_080C7DD4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C7D74 - - thumb_func_start c2_808CE60 -c2_808CE60: @ 80C7DEC - push {r4,lr} - bl ResetTasks - ldr r4, =0x02039d08 - ldr r0, =0x000062c4 - bl Alloc - adds r1, r0, 0 - str r1, [r4] - cmp r1, 0 - bne _080C7E18 - ldr r0, =sub_80C7678 - bl SetMainCallback2 - b _080C7E3C - .pool -_080C7E18: - ldr r0, =0x02039d0d - ldrb r0, [r0] - movs r2, 0 - strb r0, [r1, 0x1] - ldr r1, [r4] - movs r0, 0x1 - strb r0, [r1, 0x3] - ldr r0, [r4] - strb r2, [r0] - ldr r0, =task_box_related_3 - movs r1, 0x3 - bl CreateTask - ldr r1, [r4] - strb r0, [r1, 0x4] - ldr r0, =c2_Box - bl SetMainCallback2 -_080C7E3C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end c2_808CE60 - - thumb_func_start sub_80C7E50 -sub_80C7E50: @ 80C7E50 - push {lr} - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0x1C - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - pop {r0} - bx r0 - thumb_func_end sub_80C7E50 - - thumb_func_start sub_80C7E98 -sub_80C7E98: @ 80C7E98 - push {r4,lr} - sub sp, 0x4 - bl sub_80A1A74 - bl ResetAllObjectData - bl FreeAllObjectTiles - bl ResetObjectPaletteAllocator - bl ClearDma3Requests - ldr r1, =0x02021b3a - movs r2, 0xA0 - lsls r2, 2 - adds r0, r2, 0 - strh r0, [r1] - ldr r4, =0x02039d08 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x8 - adds r1, 0x10 - movs r2, 0x8 - bl sub_80D2A90 - ldr r1, =0x030022b0 - movs r0, 0x14 - strh r0, [r1] - bl clear_scheduled_bg_copies_to_vram - movs r0, 0x3 - bl sub_80D259C - ldr r2, =gUnknown_0857239C - movs r0, 0x4 - str r0, [sp] - movs r0, 0 - movs r1, 0x1 - movs r3, 0x8 - bl sub_80D2644 - movs r0, 0 - movs r1, 0x1 - movs r2, 0 - bl sub_80D2770 - ldr r0, [r4] - ldr r1, =0x000002c7 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C7E98 - - thumb_func_start sub_80C7F1C -sub_80C7F1C: @ 80C7F1C - push {lr} - bl sub_80CDC0C - ldr r2, =0x02039d0c - movs r1, 0 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bne _080C7F32 - movs r1, 0x1 -_080C7F32: - strb r1, [r2] - ldr r1, =0x02039d0e - movs r0, 0 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C7F1C - - thumb_func_start sub_80C7F4C -sub_80C7F4C: @ 80C7F4C - push {lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x3 - bne _080C7F6A - movs r1, 0xFC - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x00000b07 - movs r0, 0x52 - bl SetGpuReg -_080C7F6A: - movs r1, 0xFA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C7F4C - - thumb_func_start add_to_c3_somehow -add_to_c3_somehow: @ 80C7F80 - push {r4,lr} - ldr r4, =0x03005e00 - ldr r1, =0x02039d08 - ldr r3, [r1] - ldrb r2, [r3, 0x4] - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r4 - str r0, [r1] - movs r0, 0 - strb r0, [r3] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end add_to_c3_somehow - - thumb_func_start task_box_related_3 -task_box_related_3: @ 80C7FA8 - push {lr} - sub sp, 0x4 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0xA - bls _080C7FB8 - b _080C81A2 -_080C7FB8: - lsls r0, 2 - ldr r1, =_080C7FCC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C7FCC: - .4byte _080C7FF8 - .4byte _080C8050 - .4byte _080C805E - .4byte _080C808C - .4byte _080C80A8 - .4byte _080C80C6 - .4byte _080C80E6 - .4byte _080C80EC - .4byte _080C80F2 - .4byte _080C8100 - .4byte _080C814A -_080C7FF8: - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - movs r1, 0 - bl SetGpuReg - bl sub_80C7E98 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0, 0x3] - cmp r0, 0 - beq _080C8046 - ldr r0, =0x02039d0f - ldrb r0, [r0] - cmp r0, 0x1 - beq _080C8036 - cmp r0, 0x1 - bgt _080C8030 - cmp r0, 0 - beq _080C803C - b _080C8046 - .pool -_080C8030: - cmp r0, 0x2 - beq _080C8042 - b _080C8046 -_080C8036: - bl sub_80CE790 - b _080C8046 -_080C803C: - bl sub_80CE8E4 - b _080C8046 -_080C8042: - bl sub_80C9F6C -_080C8046: - bl sub_80CA044 - bl sub_80CA0C8 - b _080C8198 -_080C8050: - bl sub_80CA0A4 - lsls r0, 24 - cmp r0, 0 - beq _080C805C - b _080C8198 -_080C805C: - b _080C80D0 -_080C805E: - movs r0, 0 - bl PutWindowTilemap - movs r0, 0x1 - bl ClearWindowTilemap - movs r0, 0 - str r0, [sp] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05000080 - mov r0, sp - bl CpuSet - movs r0, 0x1 - movs r1, 0xB - movs r2, 0xE0 - bl sub_809882C - b _080C8198 - .pool -_080C808C: - bl sub_80C7E50 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0, 0x3] - cmp r0, 0 - beq _080C809C - b _080C8198 -_080C809C: - bl sub_80C7F1C - b _080C8198 - .pool -_080C80A8: - bl sub_80CAF04 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0, 0x3] - cmp r0, 0 - bne _080C80C0 - bl sub_80CD36C - b _080C8198 - .pool -_080C80C0: - bl sub_80CD3EC - b _080C8198 -_080C80C6: - bl sub_80D0164 - lsls r0, 24 - cmp r0, 0 - bne _080C80DC -_080C80D0: - ldr r0, =sub_80C9E50 - bl add_to_c3_somehow - b _080C81A2 - .pool -_080C80DC: - bl sub_80C9FEC - bl sub_80CAC1C - b _080C8198 -_080C80E6: - bl sub_80CA0D8 - b _080C8198 -_080C80EC: - bl sub_80CA704 - b _080C8198 -_080C80F2: - bl get_preferred_box - lsls r0, 24 - lsrs r0, 24 - bl sub_80CC32C - b _080C8198 -_080C8100: - bl sub_80CC35C - lsls r0, 24 - cmp r0, 0 - bne _080C81A2 - ldr r0, =0x02039d08 - ldr r2, [r0] - ldrb r0, [r2, 0x1] - cmp r0, 0x3 - beq _080C8140 - ldr r1, =0x00000da4 - adds r0, r2, r1 - movs r1, 0xD - strh r1, [r0] - ldr r1, =0x00000da6 - adds r2, r1 - ldr r1, =0x0000dace - strh r1, [r2] - bl sub_811F90C - bl sub_811FA90 - b _080C8198 - .pool -_080C8140: - bl sub_80D0C60 - bl sub_80CAEAC - b _080C8198 -_080C814A: - bl sub_80C7F4C - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0, 0x3] - cmp r0, 0 - bne _080C8174 - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - ldr r0, =sub_80C81AC - bl add_to_c3_somehow - b _080C8186 - .pool -_080C8174: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - ldr r0, =box_related_2 - bl add_to_c3_somehow -_080C8186: - ldr r0, =sub_80C7D28 - bl SetVBlankCallback - b _080C81A2 - .pool -_080C8198: - ldr r0, =0x02039d08 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080C81A2: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end task_box_related_3 - - thumb_func_start sub_80C81AC -sub_80C81AC: @ 80C81AC - push {r4,lr} - ldr r4, =0x02039d08 - ldr r0, [r4] - ldrb r0, [r0] - cmp r0, 0 - beq _080C81C4 - cmp r0, 0x1 - beq _080C81DE - b _080C81EE - .pool -_080C81C4: - movs r0, 0x2 - bl audio_play - movs r0, 0x14 - movs r1, 0 - movs r2, 0x1 - bl sub_80F9BCC - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C81EE -_080C81DE: - bl sub_80F9C1C - lsls r0, 24 - cmp r0, 0 - bne _080C81EE - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow -_080C81EE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C81AC - - thumb_func_start box_related_2 -box_related_2: @ 80C81F8 - push {r4,lr} - sub sp, 0x4 - ldr r4, =0x02039d08 - ldr r0, [r4] - ldrb r0, [r0] - cmp r0, 0x1 - beq _080C8230 - cmp r0, 0x1 - bgt _080C8214 - cmp r0, 0 - beq _080C821E - b _080C82A0 - .pool -_080C8214: - cmp r0, 0x2 - beq _080C8268 - cmp r0, 0x3 - beq _080C8290 - b _080C82A0 -_080C821E: - movs r1, 0x1 - negs r1, r1 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - b _080C8282 -_080C8230: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _080C82A0 - ldr r0, =0x02039d0f - ldrb r0, [r0] - cmp r0, 0x2 - bne _080C825C - ldr r0, =0x0203ce7c - ldrh r0, [r0] - cmp r0, 0 - beq _080C825C - movs r0, 0x1C - bl sub_80CAC58 - b _080C8282 - .pool -_080C825C: - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow - b _080C82A0 - .pool -_080C8268: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _080C82A0 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _080C82A0 - bl sub_80CADC4 -_080C8282: - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C82A0 - .pool -_080C8290: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _080C82A0 - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow -_080C82A0: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end box_related_2 - - thumb_func_start task_pokemon_box_related -task_pokemon_box_related: @ 80C82AC - push {r4,r5,lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0xB - bls _080C82BA - b _080C879E -_080C82BA: - lsls r0, 2 - ldr r1, =_080C82CC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C82CC: - .4byte _080C82FC - .4byte _080C861C - .4byte _080C865C - .4byte _080C86B4 - .4byte _080C86D8 - .4byte _080C86E2 - .4byte _080C86FC - .4byte _080C871C - .4byte _080C8722 - .4byte _080C8738 - .4byte _080C8764 - .4byte _080C878C -_080C82FC: - bl sub_80CF9EC - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x1 - cmp r0, 0x19 - bls _080C830C - b _080C879E -_080C830C: - lsls r0, 2 - ldr r1, =_080C831C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C831C: - .4byte _080C8384 - .4byte _080C879E - .4byte _080C879E - .4byte _080C8414 - .4byte _080C8398 - .4byte _080C83CC - .4byte _080C842C - .4byte _080C8440 - .4byte _080C844C - .4byte _080C8484 - .4byte _080C84C8 - .4byte _080C854C - .4byte _080C850C - .4byte _080C851E - .4byte _080C8560 - .4byte _080C8574 - .4byte _080C8588 - .4byte _080C859C - .4byte _080C8420 - .4byte _080C85B0 - .4byte _080C85D0 - .4byte _080C85BA - .4byte _080C85DA - .4byte _080C8614 - .4byte _080C85DE - .4byte _080C85F8 -_080C8384: - movs r0, 0x5 - bl audio_play - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x1 - strb r0, [r1] - b _080C879E - .pool -_080C8398: - ldr r4, =0x02039d08 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - subs r0, 0x2 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _080C83BC - movs r0, 0x10 - bl sub_80CAC58 - ldr r1, [r4] - movs r0, 0x3 - strb r0, [r1] - b _080C879E - .pool -_080C83BC: - bl sub_80CDC0C - ldr r0, =sub_80C87A8 - bl add_to_c3_somehow - b _080C879E - .pool -_080C83CC: - ldr r4, =0x02039d08 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - cmp r0, 0x2 - bne _080C8400 - bl sub_80CEAD0 - lsls r0, 24 - cmp r0, 0 - beq _080C8406 - ldr r0, [r4] - ldr r1, =0x00000ce6 - adds r0, r1 - ldrh r0, [r0] - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _080C83F4 - b _080C84E6 -_080C83F4: - b _080C8406 - .pool -_080C8400: - cmp r0, 0x3 - beq _080C8406 - b _080C879E -_080C8406: - ldr r0, =sub_80C87E8 - bl add_to_c3_somehow - b _080C879E - .pool -_080C8414: - ldr r0, =sub_80C9BE8 - bl add_to_c3_somehow - b _080C879E - .pool -_080C8420: - ldr r0, =sub_80C9D1C - bl add_to_c3_somehow - b _080C879E - .pool -_080C842C: - movs r0, 0x5 - bl audio_play - ldr r0, =box_related - bl add_to_c3_somehow - b _080C879E - .pool -_080C8440: - ldr r0, =sub_80C8864 - bl add_to_c3_somehow - b _080C879E - .pool -_080C844C: - movs r0, 0x5 - bl audio_play - bl get_preferred_box - ldr r4, =0x02039d08 - ldr r1, [r4] - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x1 - ldr r2, =0x000002ca - adds r1, r2 - strh r0, [r1] - cmp r0, 0xD - ble _080C846E - movs r0, 0 - strh r0, [r1] -_080C846E: - ldr r1, [r4] - ldrb r0, [r1, 0x1] - cmp r0, 0x3 - beq _080C84BC - adds r0, r1, r2 - b _080C8776 - .pool -_080C8484: - movs r0, 0x5 - bl audio_play - bl get_preferred_box - ldr r4, =0x02039d08 - ldr r1, [r4] - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x1 - ldr r2, =0x000002ca - adds r1, r2 - strh r0, [r1] - cmp r0, 0 - bge _080C84A6 - movs r0, 0xD - strh r0, [r1] -_080C84A6: - ldr r1, [r4] - ldrb r0, [r1, 0x1] - cmp r0, 0x3 - beq _080C84BC - adds r0, r1, r2 - b _080C8776 - .pool -_080C84BC: - bl sub_80CFEA8 - ldr r1, [r4] - movs r0, 0xA - strb r0, [r1] - b _080C879E -_080C84C8: - bl sub_80CEA30 - lsls r0, 24 - cmp r0, 0 - bne _080C8528 - ldr r4, =0x02039d08 - ldr r0, [r4] - ldr r1, =0x00000ce6 - adds r0, r1 - ldrh r0, [r0] - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _080C84F8 -_080C84E6: - ldr r1, [r4] - movs r0, 0x5 - strb r0, [r1] - b _080C879E - .pool -_080C84F8: - movs r0, 0x5 - bl audio_play - ldr r0, =sub_80C8D78 - bl add_to_c3_somehow - b _080C879E - .pool -_080C850C: - bl sub_80CEA30 - lsls r0, 24 - cmp r0, 0 - bne _080C8528 - movs r0, 0x5 - bl audio_play - b _080C872C -_080C851E: - bl sub_80CEA6C - lsls r0, 24 - cmp r0, 0 - bne _080C8538 -_080C8528: - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x4 - strb r0, [r1] - b _080C879E - .pool -_080C8538: - movs r0, 0x5 - bl audio_play - ldr r0, =c3_0808DC50 - bl add_to_c3_somehow - b _080C879E - .pool -_080C854C: - movs r0, 0x5 - bl audio_play - ldr r0, =sub_80C8C90 - bl add_to_c3_somehow - b _080C879E - .pool -_080C8560: - movs r0, 0x5 - bl audio_play - ldr r0, =sub_80C8BEC - bl add_to_c3_somehow - b _080C879E - .pool -_080C8574: - movs r0, 0x5 - bl audio_play - ldr r0, =sub_80C9128 - bl add_to_c3_somehow - b _080C879E - .pool -_080C8588: - movs r0, 0x5 - bl audio_play - ldr r0, =sub_80C91DC - bl add_to_c3_somehow - b _080C879E - .pool -_080C859C: - movs r0, 0x5 - bl audio_play - ldr r0, =sub_80C93B0 - bl add_to_c3_somehow - b _080C879E - .pool -_080C85B0: - movs r0, 0x5 - bl audio_play - movs r0, 0 - b _080C8600 -_080C85BA: - movs r0, 0x1 - bl sub_80D01D0 - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x8 - strb r0, [r1] - b _080C879E - .pool -_080C85D0: - movs r0, 0x5 - bl audio_play - movs r0, 0x2 - b _080C85E6 -_080C85DA: - movs r0, 0x3 - b _080C8600 -_080C85DE: - movs r0, 0x5 - bl audio_play - movs r0, 0x4 -_080C85E6: - bl sub_80D01D0 - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x9 - strb r0, [r1] - b _080C879E - .pool -_080C85F8: - movs r0, 0x5 - bl audio_play - movs r0, 0x5 -_080C8600: - bl sub_80D01D0 - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x7 - strb r0, [r1] - b _080C879E - .pool -_080C8614: - movs r0, 0x20 - bl audio_play - b _080C879E -_080C861C: - bl sub_80CD554 - lsls r0, 24 - cmp r0, 0 - beq _080C8628 - b _080C879E -_080C8628: - bl sub_80CEAF8 - lsls r0, 24 - cmp r0, 0 - beq _080C8638 - bl sub_80CA9C0 - b _080C863C -_080C8638: - bl sub_80CA9EC -_080C863C: - ldr r4, =0x02039d08 - ldr r0, [r4] - ldr r1, =0x00000cea - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080C864E - bl BoxSetMosaic -_080C864E: - ldr r1, [r4] - b _080C86C8 - .pool -_080C865C: - bl sub_80CC54C - lsls r0, 24 - cmp r0, 0 - beq _080C8668 - b _080C879E -_080C8668: - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x000002ca - adds r0, r1 - ldrb r0, [r0] - bl sub_80D1D18 - ldr r0, =0x02039d0c - ldrb r0, [r0] - cmp r0, 0 - bne _080C8690 - bl sub_80CEAD0 - lsls r0, 24 - cmp r0, 0 - bne _080C8690 - bl sub_80CE00C - bl BoxSetMosaic -_080C8690: - ldr r4, =0x02039d08 - ldr r1, [r4] - ldrb r0, [r1, 0x1] - cmp r0, 0x3 - bne _080C86C8 - bl sub_80CFECC - ldr r1, [r4] - movs r0, 0xB - strb r0, [r1] - b _080C879E - .pool -_080C86B4: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0xF3 - ands r0, r1 - cmp r0, 0 - beq _080C879E - bl sub_80CADC4 - ldr r0, =0x02039d08 - ldr r1, [r0] -_080C86C8: - movs r0, 0 - strb r0, [r1] - b _080C879E - .pool -_080C86D8: - movs r0, 0x20 - bl audio_play - movs r0, 0xD - b _080C86EA -_080C86E2: - movs r0, 0x20 - bl audio_play - movs r0, 0x16 -_080C86EA: - bl sub_80CAC58 - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x6 - strb r0, [r1] - b _080C879E - .pool -_080C86FC: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0xF3 - ands r0, r1 - cmp r0, 0 - beq _080C879E - bl sub_80CADC4 - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow - b _080C879E - .pool -_080C871C: - bl sub_80D01E4 - b _080C8790 -_080C8722: - bl sub_80D01E4 - lsls r0, 24 - cmp r0, 0 - bne _080C879E -_080C872C: - ldr r0, =sub_80C8B90 - bl add_to_c3_somehow - b _080C879E - .pool -_080C8738: - bl sub_80D01E4 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _080C879E - ldr r5, =0x02039d08 - ldr r0, [r5] - ldr r1, =0x00000cea - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080C8756 - bl BoxSetMosaic -_080C8756: - ldr r0, [r5] - strb r4, [r0] - b _080C879E - .pool -_080C8764: - bl sub_80D1218 - lsls r0, 24 - cmp r0, 0 - bne _080C879E - ldr r4, =0x02039d08 - ldr r0, [r4] - ldr r1, =0x000002ca - adds r0, r1 -_080C8776: - ldrb r0, [r0] - bl sub_80CC464 - ldr r1, [r4] - movs r0, 0x2 - strb r0, [r1] - b _080C879E - .pool -_080C878C: - bl sub_80D1218 -_080C8790: - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _080C879E - ldr r0, =0x02039d08 - ldr r0, [r0] - strb r1, [r0] -_080C879E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task_pokemon_box_related - - thumb_func_start sub_80C87A8 -sub_80C87A8: @ 80C87A8 - push {r4,lr} - ldr r4, =0x02039d08 - ldr r0, [r4] - ldrb r0, [r0] - cmp r0, 0 - beq _080C87C0 - cmp r0, 0x1 - beq _080C87CE - b _080C87DE - .pool -_080C87C0: - bl sub_80CAB4C - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C87DE -_080C87CE: - bl sub_80CAB70 - lsls r0, 24 - cmp r0, 0 - bne _080C87DE - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow -_080C87DE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C87A8 - - thumb_func_start sub_80C87E8 -sub_80C87E8: @ 80C87E8 - push {r4,lr} - ldr r4, =0x02039d08 - ldr r0, [r4] - ldrb r0, [r0] - cmp r0, 0x1 - beq _080C8816 - cmp r0, 0x1 - bgt _080C8804 - cmp r0, 0 - beq _080C880A - b _080C8856 - .pool -_080C8804: - cmp r0, 0x2 - beq _080C8836 - b _080C8856 -_080C880A: - movs r0, 0x5 - bl audio_play - bl sub_80CA888 - b _080C882C -_080C8816: - bl sub_80CA8C8 - lsls r0, 24 - cmp r0, 0 - bne _080C8856 - bl sub_80CDC2C - lsls r0, 24 - lsrs r0, 24 - bl sub_80CDBF8 -_080C882C: - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C8856 -_080C8836: - bl sub_80CD554 - lsls r0, 24 - cmp r0, 0 - bne _080C8856 - ldr r0, [r4] - ldr r1, =0x00000cea - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080C8850 - bl BoxSetMosaic -_080C8850: - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow -_080C8856: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C87E8 - - thumb_func_start sub_80C8864 -sub_80C8864: @ 80C8864 - push {r4,lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0x6 - bls _080C8872 - b _080C8B82 -_080C8872: - lsls r0, 2 - ldr r1, =_080C8884 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C8884: - .4byte _080C88A0 - .4byte _080C8904 - .4byte _080C8920 - .4byte _080C8B3C - .4byte _080C8B50 - .4byte _080C8B46 - .4byte _080C8B6C -_080C88A0: - bl sub_80CA2B8 - lsls r0, 24 - cmp r0, 0 - beq _080C88AC - b _080C8B82 -_080C88AC: - movs r0, 0x5 - bl audio_play - ldr r4, =0x02039d08 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - cmp r0, 0x3 - beq _080C88C8 - movs r0, 0x4 - bl sub_80CAC58 - b _080C88F2 - .pool -_080C88C8: - bl sub_80D127C - lsls r0, 24 - cmp r0, 0 - bne _080C88DE - ldr r0, [r4] - ldr r1, =0x00000ce6 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _080C88EC -_080C88DE: - movs r0, 0x17 - bl sub_80CAC58 - b _080C88F2 - .pool -_080C88EC: - movs r0, 0x18 - bl sub_80CAC58 -_080C88F2: - bl sub_80CFFD0 - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x1 - strb r0, [r1] - b _080C8B82 - .pool -_080C8904: - bl sub_80D00A8 - lsls r0, 24 - cmp r0, 0 - beq _080C8910 - b _080C8B82 -_080C8910: - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x2 - strb r0, [r1] - b _080C8B82 - .pool -_080C8920: - bl sub_80D00AC - adds r0, 0x1 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x12 - bls _080C8930 - b _080C8B82 -_080C8930: - lsls r0, 2 - ldr r1, =_080C8940 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C8940: - .4byte _080C898C - .4byte _080C898C - .4byte _080C8A0C - .4byte _080C89F4 - .4byte _080C899C - .4byte _080C89D4 - .4byte _080C89BC - .4byte _080C8AAC - .4byte _080C8A48 - .4byte _080C8AC0 - .4byte _080C8B82 - .4byte _080C8B82 - .4byte _080C8B82 - .4byte _080C8AD4 - .4byte _080C8AE8 - .4byte _080C8B1C - .4byte _080C8B08 - .4byte _080C8AFC - .4byte _080C8B30 -_080C898C: - bl sub_80CADC4 - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow - b _080C8B82 - .pool -_080C899C: - bl sub_80CEA30 - lsls r0, 24 - cmp r0, 0 - bne _080C8A52 - movs r0, 0x5 - bl audio_play - bl sub_80CADC4 - ldr r0, =sub_80C8B90 - bl add_to_c3_somehow - b _080C8B82 - .pool -_080C89BC: - movs r0, 0x5 - bl audio_play - bl sub_80CADC4 - ldr r0, =sub_80C8BEC - bl add_to_c3_somehow - b _080C8B82 - .pool -_080C89D4: - bl sub_80CEA6C - lsls r0, 24 - cmp r0, 0 - beq _080C8A52 - movs r0, 0x5 - bl audio_play - bl sub_80CADC4 - ldr r0, =c3_0808DC50 - bl add_to_c3_somehow - b _080C8B82 - .pool -_080C89F4: - movs r0, 0x5 - bl audio_play - bl sub_80CADC4 - ldr r0, =sub_80C8C90 - bl add_to_c3_somehow - b _080C8B82 - .pool -_080C8A0C: - bl sub_80CEA30 - lsls r0, 24 - cmp r0, 0 - bne _080C8A52 - ldr r4, =0x02039d08 - ldr r0, [r4] - ldr r2, =0x00000ce6 - adds r0, r2 - ldrh r0, [r0] - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - bne _080C8A8C - movs r0, 0x5 - bl audio_play - bl sub_80CADC4 - ldr r0, =sub_80C8D78 - bl add_to_c3_somehow - b _080C8B82 - .pool -_080C8A48: - bl sub_80CEA30 - lsls r0, 24 - cmp r0, 0 - beq _080C8A60 -_080C8A52: - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x3 - strb r0, [r1] - b _080C8B82 - .pool -_080C8A60: - ldr r4, =0x02039d08 - ldr r1, [r4] - ldr r2, =0x00000ced - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C8A7C - movs r0, 0x5 - strb r0, [r1] - b _080C8B82 - .pool -_080C8A7C: - ldr r2, =0x00000ce6 - adds r0, r1, r2 - ldrh r0, [r0] - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _080C8A98 -_080C8A8C: - ldr r1, [r4] - movs r0, 0x4 - strb r0, [r1] - b _080C8B82 - .pool -_080C8A98: - movs r0, 0x5 - bl audio_play - ldr r0, =sub_80C8EB4 - bl add_to_c3_somehow - b _080C8B82 - .pool -_080C8AAC: - movs r0, 0x5 - bl audio_play - ldr r0, =sub_80C9B28 - bl add_to_c3_somehow - b _080C8B82 - .pool -_080C8AC0: - movs r0, 0x5 - bl audio_play - ldr r0, =sub_80C90A4 - bl add_to_c3_somehow - b _080C8B82 - .pool -_080C8AD4: - movs r0, 0x5 - bl audio_play - ldr r0, =sub_80C9128 - bl add_to_c3_somehow - b _080C8B82 - .pool -_080C8AE8: - movs r0, 0x5 - bl audio_play - ldr r0, =sub_80C91DC - bl add_to_c3_somehow - b _080C8B82 - .pool -_080C8AFC: - ldr r0, =sub_80C9298 - bl add_to_c3_somehow - b _080C8B82 - .pool -_080C8B08: - movs r0, 0x5 - bl audio_play - ldr r0, =sub_80C93B0 - bl add_to_c3_somehow - b _080C8B82 - .pool -_080C8B1C: - movs r0, 0x5 - bl audio_play - ldr r0, =sub_80C9B88 - bl add_to_c3_somehow - b _080C8B82 - .pool -_080C8B30: - ldr r0, =sub_80C9498 - bl add_to_c3_somehow - b _080C8B82 - .pool -_080C8B3C: - movs r0, 0x20 - bl audio_play - movs r0, 0xD - b _080C8B58 -_080C8B46: - movs r0, 0x20 - bl audio_play - movs r0, 0x11 - b _080C8B58 -_080C8B50: - movs r0, 0x20 - bl audio_play - movs r0, 0x16 -_080C8B58: - bl sub_80CAC58 - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x6 - strb r0, [r1] - b _080C8B82 - .pool -_080C8B6C: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0xF3 - ands r0, r1 - cmp r0, 0 - beq _080C8B82 - bl sub_80CADC4 - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow -_080C8B82: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C8864 - - thumb_func_start sub_80C8B90 -sub_80C8B90: @ 80C8B90 - push {r4,lr} - ldr r4, =0x02039d08 - ldr r0, [r4] - ldrb r0, [r0] - cmp r0, 0 - beq _080C8BA8 - cmp r0, 0x1 - beq _080C8BB8 - b _080C8BE2 - .pool -_080C8BA8: - movs r0, 0 - bl sub_80CDC38 - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C8BE2 -_080C8BB8: - bl sub_80CDCAC - lsls r0, 24 - cmp r0, 0 - bne _080C8BE2 - ldr r0, =0x02039d0c - ldrb r0, [r0] - cmp r0, 0 - beq _080C8BDC - ldr r0, =sub_80C9670 - bl add_to_c3_somehow - b _080C8BE2 - .pool -_080C8BDC: - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow -_080C8BE2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C8B90 - - thumb_func_start sub_80C8BEC -sub_80C8BEC: @ 80C8BEC - push {r4,lr} - ldr r4, =0x02039d08 - ldr r0, [r4] - ldrb r0, [r0] - cmp r0, 0 - beq _080C8C04 - cmp r0, 0x1 - beq _080C8C14 - b _080C8C3E - .pool -_080C8C04: - movs r0, 0x1 - bl sub_80CDC38 - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C8C3E -_080C8C14: - bl sub_80CDCAC - lsls r0, 24 - cmp r0, 0 - bne _080C8C3E - ldr r0, =0x02039d0c - ldrb r0, [r0] - cmp r0, 0 - beq _080C8C38 - ldr r0, =sub_80C9670 - bl add_to_c3_somehow - b _080C8C3E - .pool -_080C8C38: - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow -_080C8C3E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C8BEC - - thumb_func_start c3_0808DC50 -c3_0808DC50: @ 80C8C48 - push {r4,lr} - ldr r4, =0x02039d08 - ldr r0, [r4] - ldrb r0, [r0] - cmp r0, 0 - beq _080C8C60 - cmp r0, 0x1 - beq _080C8C70 - b _080C8C84 - .pool -_080C8C60: - movs r0, 0x2 - bl sub_80CDC38 - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C8C84 -_080C8C70: - bl sub_80CDCAC - lsls r0, 24 - cmp r0, 0 - bne _080C8C84 - bl BoxSetMosaic - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow -_080C8C84: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end c3_0808DC50 - - thumb_func_start sub_80C8C90 -sub_80C8C90: @ 80C8C90 - push {lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0x5 - bhi _080C8D6E - lsls r0, 2 - ldr r1, =_080C8CB0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C8CB0: - .4byte _080C8CC8 - .4byte _080C8D00 - .4byte _080C8D20 - .4byte _080C8D36 - .4byte _080C8D48 - .4byte _080C8D68 -_080C8CC8: - bl calc_player_party_count - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6 - bne _080C8CE8 - movs r0, 0xE - bl sub_80CAC58 - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x1 - strb r0, [r1] - b _080C8D6E - .pool -_080C8CE8: - bl sub_80CDC18 - movs r0, 0 - bl sub_80CDC38 - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x2 - strb r0, [r1] - b _080C8D6E - .pool -_080C8D00: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0xF3 - ands r0, r1 - cmp r0, 0 - beq _080C8D6E - bl sub_80CADC4 - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow - b _080C8D6E - .pool -_080C8D20: - bl sub_80CDCAC - lsls r0, 24 - cmp r0, 0 - bne _080C8D6E - movs r0, 0x1 - bl sub_80CC0D4 - bl sub_80CAB4C - b _080C8D56 -_080C8D36: - bl sub_80CAB70 - lsls r0, 24 - cmp r0, 0 - bne _080C8D6E - movs r0, 0x1 - bl sub_80CDC38 - b _080C8D56 -_080C8D48: - bl sub_80CDCAC - lsls r0, 24 - cmp r0, 0 - bne _080C8D6E - bl sub_80CAB20 -_080C8D56: - ldr r0, =0x02039d08 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C8D6E - .pool -_080C8D68: - ldr r0, =sub_80C87E8 - bl add_to_c3_somehow -_080C8D6E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C8C90 - - thumb_func_start sub_80C8D78 -sub_80C8D78: @ 80C8D78 - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0x4 - bls _080C8D88 - b _080C8EA2 -_080C8D88: - lsls r0, 2 - ldr r1, =_080C8D9C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C8D9C: - .4byte _080C8DB0 - .4byte _080C8DEC - .4byte _080C8E4C - .4byte _080C8E64 - .4byte _080C8E88 -_080C8DB0: - movs r0, 0x6 - bl sub_80CAC58 - ldr r4, =0x02039d08 - ldr r0, [r4] - ldr r1, =0x00001e5c - adds r0, r1 - ldr r2, =0x0000dac7 - movs r1, 0 - str r1, [sp] - movs r1, 0xA - movs r3, 0x3 - bl sub_80C77E8 - ldr r0, =0x02039d0e - ldrb r0, [r0] - bl sub_80C78D4 - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - b _080C8EA0 - .pool -_080C8DEC: - bl sub_80C78F0 - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - cmp r0, 0xC8 - beq _080C8EA2 - cmp r0, 0xC9 - bne _080C8E0C - bl sub_80CADC4 - bl sub_80C78E4 - bl sub_80C7890 - b _080C8E7A -_080C8E0C: - adds r0, r4, 0 - bl sub_80CE19C - lsls r0, 24 - cmp r0, 0 - beq _080C8E38 - ldr r0, =0x02039d0e - strb r4, [r0] - bl sub_80CADC4 - bl sub_80C78E4 - bl sub_80C7890 - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x2 - b _080C8EA0 - .pool -_080C8E38: - movs r0, 0x8 - bl sub_80CAC58 - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x4 - b _080C8EA0 - .pool -_080C8E4C: - bl party_compaction - bl sub_80CB950 - ldr r0, =0x02039d08 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - b _080C8EA0 - .pool -_080C8E64: - bl sub_80CB9BC - lsls r0, 24 - cmp r0, 0 - bne _080C8EA2 - bl sub_80CE22C - bl BoxSetMosaic - bl sub_80CAB20 -_080C8E7A: - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow - b _080C8EA2 - .pool -_080C8E88: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0xF3 - ands r0, r1 - cmp r0, 0 - beq _080C8EA2 - movs r0, 0x6 - bl sub_80CAC58 - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x1 -_080C8EA0: - strb r0, [r1] -_080C8EA2: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C8D78 - - thumb_func_start sub_80C8EB4 -sub_80C8EB4: @ 80C8EB4 - push {lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0xD - bls _080C8EC2 - b _080C9096 -_080C8EC2: - lsls r0, 2 - ldr r1, =_080C8ED4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C8ED4: - .4byte _080C8F0C - .4byte _080C8F22 - .4byte _080C8F5A - .4byte _080C8F80 - .4byte _080C8F8C - .4byte _080C8FA4 - .4byte _080C8FE0 - .4byte _080C8FF8 - .4byte _080C9004 - .4byte _080C9008 - .4byte _080C901C - .4byte _080C9038 - .4byte _080C904A - .4byte _080C9080 -_080C8F0C: - movs r0, 0x9 - bl sub_80CAC58 - movs r0, 0x1 - bl sub_80CAD9C - ldr r0, =0x02039d08 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080C8F22: - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _080C8F4C - cmp r1, 0 - bgt _080C8F40 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _080C8F46 - b _080C9096 - .pool -_080C8F40: - cmp r1, 0x1 - beq _080C8F46 - b _080C9096 -_080C8F46: - bl sub_80CADC4 - b _080C8FF8 -_080C8F4C: - bl sub_80CADC4 - bl sub_80CE3A0 - bl sub_80CE250 - b _080C905C -_080C8F5A: - bl sub_80CE580 - bl sub_80CE2A8 - lsls r0, 24 - cmp r0, 0 - beq _080C8F6A - b _080C9096 -_080C8F6A: - b _080C8F72 -_080C8F6C: - cmp r0, 0 - bne _080C8F72 - b _080C9070 -_080C8F72: - bl sub_80CE580 - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x1 - bne _080C8F6C - b _080C905C -_080C8F80: - bl sub_80CE2D8 - bl sub_80CA230 - movs r0, 0xA - b _080C9058 -_080C8F8C: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0xF3 - ands r0, r1 - cmp r0, 0 - bne _080C8F9A - b _080C9096 -_080C8F9A: - movs r0, 0xB - b _080C9058 - .pool -_080C8FA4: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0xF3 - ands r0, r1 - cmp r0, 0 - beq _080C9096 - bl sub_80CADC4 - ldr r0, =0x02039d0c - ldrb r0, [r0] - cmp r0, 0 - beq _080C8FD0 - bl party_compaction - bl sub_80CB950 - b _080C905C - .pool -_080C8FD0: - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x7 - strb r0, [r1] - b _080C9096 - .pool -_080C8FE0: - bl sub_80CB9BC - lsls r0, 24 - cmp r0, 0 - bne _080C9096 - bl sub_80CE00C - bl BoxSetMosaic - bl sub_80CAB20 - b _080C905C -_080C8FF8: - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow - b _080C9096 - .pool -_080C9004: - movs r0, 0xA - b _080C9058 -_080C9008: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0xF3 - ands r0, r1 - cmp r0, 0 - beq _080C9096 - movs r0, 0x15 - b _080C9058 - .pool -_080C901C: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0xF3 - ands r0, r1 - cmp r0, 0 - beq _080C9096 - bl sub_80CADC4 - bl sub_80CC064 - b _080C905C - .pool -_080C9038: - bl sub_80CC0A0 - lsls r0, 24 - cmp r0, 0 - bne _080C9096 - bl sub_80CE324 - movs r0, 0x13 - b _080C9058 -_080C904A: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0xF3 - ands r0, r1 - cmp r0, 0 - beq _080C9096 - movs r0, 0x14 -_080C9058: - bl sub_80CAC58 -_080C905C: - ldr r0, =0x02039d08 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C9096 - .pool -_080C9070: - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x8 - strb r0, [r1] - b _080C9096 - .pool -_080C9080: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0xF3 - ands r0, r1 - cmp r0, 0 - beq _080C9096 - bl sub_80CADC4 - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow -_080C9096: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C8EB4 - - thumb_func_start sub_80C90A4 -sub_80C90A4: @ 80C90A4 - push {r4,lr} - ldr r4, =0x02039d08 - ldr r0, [r4] - ldrb r0, [r0] - cmp r0, 0 - beq _080C90BC - cmp r0, 0x1 - beq _080C90F0 - b _080C9118 - .pool -_080C90BC: - movs r0, 0xC - bl sub_80CAC58 - ldr r0, [r4] - ldr r2, =0x00000ceb - adds r1, r0, r2 - ldrb r1, [r1] - ldr r3, =0x00000da8 - adds r0, r3 - strb r1, [r0] - ldr r0, [r4] - adds r0, r2 - ldrb r0, [r0] - movs r1, 0xB0 - movs r2, 0x10 - bl sub_811FAA4 - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C9118 - .pool -_080C90F0: - bl sub_811FBA4 - lsls r0, 24 - cmp r0, 0 - bne _080C9118 - bl sub_811FAF8 - bl sub_80CADC4 - ldr r0, [r4] - ldr r1, =0x00000da8 - adds r0, r1 - ldrb r0, [r0] - bl sub_80CE9A8 - bl sub_80CA230 - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow -_080C9118: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C90A4 - - thumb_func_start sub_80C9128 -sub_80C9128: @ 80C9128 - push {r4,r5,lr} - ldr r5, =0x02039d08 - ldr r0, [r5] - ldrb r1, [r0] - cmp r1, 0x1 - beq _080C9174 - cmp r1, 0x1 - bgt _080C9144 - cmp r1, 0 - beq _080C914E - b _080C91D2 - .pool -_080C9144: - cmp r1, 0x2 - beq _080C919C - cmp r1, 0x3 - beq _080C91C2 - b _080C91D2 -_080C914E: - ldr r1, =0x00000ce6 - adds r0, r1 - ldrh r0, [r0] - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - bne _080C9168 - bl sub_80CADC4 - b _080C91B8 - .pool -_080C9168: - ldr r0, =sub_80C96B8 - bl add_to_c3_somehow - b _080C91D2 - .pool -_080C9174: - movs r0, 0x2 - bl sub_80CFE54 - ldr r0, =0x02039d0c - ldrb r0, [r0] - negs r4, r0 - orrs r4, r0 - lsrs r4, 31 - bl sub_80CFE08 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_80D0E90 - b _080C91B8 - .pool -_080C919C: - bl sub_80D1218 - lsls r0, 24 - cmp r0, 0 - bne _080C91D2 - movs r0, 0x3 - bl sub_80CFE54 - bl sub_80CADC4 - bl sub_80CE00C - bl sub_80CA4FC -_080C91B8: - ldr r1, [r5] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C91D2 -_080C91C2: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _080C91D2 - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow -_080C91D2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C9128 - - thumb_func_start sub_80C91DC -sub_80C91DC: @ 80C91DC - push {r4,lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0x4 - bhi _080C928C - lsls r0, 2 - ldr r1, =_080C91FC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C91FC: - .4byte _080C9264 - .4byte _080C9210 - .4byte _080C9238 - .4byte _080C9258 - .4byte _080C927C -_080C9210: - movs r0, 0x2 - bl sub_80CFE54 - ldr r0, =0x02039d0c - ldrb r0, [r0] - negs r4, r0 - orrs r4, r0 - lsrs r4, 31 - bl sub_80CFE08 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_80D1080 - b _080C9268 - .pool -_080C9238: - bl sub_80D1218 - lsls r0, 24 - cmp r0, 0 - bne _080C928C - movs r0, 0 - bl sub_80CFE54 - bl sub_80CE00C - bl sub_80CA4FC - movs r0, 0x1C - bl sub_80CAC58 - b _080C9268 -_080C9258: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0xF3 - ands r0, r1 - cmp r0, 0 - beq _080C928C -_080C9264: - bl sub_80CADC4 -_080C9268: - ldr r0, =0x02039d08 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C928C - .pool -_080C927C: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _080C928C - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow -_080C928C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C91DC - - thumb_func_start sub_80C9298 -sub_80C9298: @ 80C9298 - push {r4,r5,lr} - ldr r1, =0x02039d08 - ldr r0, [r1] - ldrb r0, [r0] - adds r5, r1, 0 - cmp r0, 0x4 - bls _080C92A8 - b _080C93A2 -_080C92A8: - lsls r0, 2 - ldr r1, =_080C92BC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C92BC: - .4byte _080C92D0 - .4byte _080C9328 - .4byte _080C9348 - .4byte _080C938C - .4byte _080C9374 -_080C92D0: - ldr r0, [r5] - ldr r1, =0x00000ce6 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl bag_add_item - lsls r0, 24 - cmp r0, 0 - bne _080C92FC - movs r0, 0x20 - bl audio_play - movs r0, 0x1A - bl sub_80CAC58 - ldr r1, [r5] - movs r0, 0x3 - strb r0, [r1] - b _080C93A2 - .pool -_080C92FC: - movs r0, 0x5 - bl audio_play - ldr r0, =0x02039d0c - ldrb r0, [r0] - negs r4, r0 - orrs r4, r0 - lsrs r4, 31 - bl sub_80CFE08 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_80D1114 - ldr r1, [r5] - movs r0, 0x1 - strb r0, [r1] - b _080C93A2 - .pool -_080C9328: - bl sub_80D1218 - lsls r0, 24 - cmp r0, 0 - bne _080C93A2 - movs r0, 0x19 - bl sub_80CAC58 - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x2 - strb r0, [r1] - b _080C93A2 - .pool -_080C9348: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0xF3 - ands r0, r1 - cmp r0, 0 - beq _080C93A2 - bl sub_80CADC4 - bl sub_80CE00C - bl sub_80CA4FC - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x4 - strb r0, [r1] - b _080C93A2 - .pool -_080C9374: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _080C93A2 - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow - b _080C93A2 - .pool -_080C938C: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0xF3 - ands r0, r1 - cmp r0, 0 - beq _080C93A2 - bl sub_80CADC4 - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow -_080C93A2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C9298 - - thumb_func_start sub_80C93B0 -sub_80C93B0: @ 80C93B0 - push {r4,lr} - ldr r1, =0x02039d08 - ldr r0, [r1] - ldrb r0, [r0] - adds r4, r1, 0 - cmp r0, 0x4 - bhi _080C948C - lsls r0, 2 - ldr r1, =_080C93D0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C93D0: - .4byte _080C93E4 - .4byte _080C9410 - .4byte _080C9438 - .4byte _080C9458 - .4byte _080C947C -_080C93E4: - ldr r0, [r4] - ldr r1, =0x00000ce6 - adds r0, r1 - ldrh r0, [r0] - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - bne _080C9404 - bl sub_80CADC4 - ldr r1, [r4] - b _080C946C - .pool -_080C9404: - ldr r0, =sub_80C96B8 - bl add_to_c3_somehow - b _080C948C - .pool -_080C9410: - movs r0, 0x2 - bl sub_80CFE54 - ldr r0, =0x02039d0c - ldrb r0, [r0] - negs r4, r0 - orrs r4, r0 - lsrs r4, 31 - bl sub_80CFE08 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_80D0FAC - b _080C9468 - .pool -_080C9438: - bl sub_80D1218 - lsls r0, 24 - cmp r0, 0 - bne _080C948C - movs r0, 0x3 - bl sub_80CFE54 - bl sub_80CE00C - bl sub_80CA4FC - movs r0, 0x1D - bl sub_80CAC58 - b _080C9468 -_080C9458: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0xF3 - ands r0, r1 - cmp r0, 0 - beq _080C948C - bl sub_80CADC4 -_080C9468: - ldr r0, =0x02039d08 - ldr r1, [r0] -_080C946C: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C948C - .pool -_080C947C: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _080C948C - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow -_080C948C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C93B0 - - thumb_func_start sub_80C9498 -sub_80C9498: @ 80C9498 - push {lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0x6 - bhi _080C9544 - lsls r0, 2 - ldr r1, =_080C94B8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C94B8: - .4byte _080C94D4 - .4byte _080C94DA - .4byte _080C94F4 - .4byte _080C94FA - .4byte _080C9500 - .4byte _080C9518 - .4byte _080C9534 -_080C94D4: - bl sub_80CADC4 - b _080C9522 -_080C94DA: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _080C9544 - movs r0, 0x6 - bl audio_play - bl sub_80D17B4 - bl sub_80D1818 - b _080C9522 -_080C94F4: - bl sub_80D184C - b _080C951C -_080C94FA: - bl IsDma3ManagerBusyWithBgCopy - b _080C951C -_080C9500: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0xF3 - ands r0, r1 - cmp r0, 0 - beq _080C9544 - movs r0, 0x6 - bl audio_play - b _080C9522 - .pool -_080C9518: - bl sub_80D18E4 -_080C951C: - lsls r0, 24 - cmp r0, 0 - bne _080C9544 -_080C9522: - ldr r0, =0x02039d08 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C9544 - .pool -_080C9534: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _080C9544 - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow -_080C9544: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C9498 - - thumb_func_start sub_80C954C -sub_80C954C: @ 80C954C - push {r4,lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0x5 - bls _080C955A - b _080C9664 -_080C955A: - lsls r0, 2 - ldr r1, =_080C956C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C956C: - .4byte _080C9584 - .4byte _080C95A4 - .4byte _080C9602 - .4byte _080C9624 - .4byte _080C9638 - .4byte _080C9654 -_080C9584: - movs r0, 0x5 - bl audio_play - movs r0, 0x1B - bl sub_80CAC58 - movs r0, 0 - bl sub_80CAD9C - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x1 - strb r0, [r1] - b _080C9664 - .pool -_080C95A4: - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _080C95C8 - cmp r1, 0 - bgt _080C95BE - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _080C95C2 - b _080C9664 -_080C95BE: - cmp r1, 0x1 - bne _080C9664 -_080C95C2: - bl sub_80CADC4 - b _080C9648 -_080C95C8: - ldr r4, =0x02039d08 - ldr r0, [r4] - ldr r1, =0x00002234 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl bag_add_item - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080C95F4 - bl sub_80CADC4 - ldr r1, [r4] - movs r0, 0x3 - strb r0, [r1] - b _080C9664 - .pool -_080C95F4: - movs r0, 0x1A - bl sub_80CAC58 - ldr r1, [r4] - movs r0, 0x2 - strb r0, [r1] - b _080C9664 -_080C9602: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0xF3 - ands r0, r1 - cmp r0, 0 - beq _080C9664 - bl sub_80CADC4 - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x5 - strb r0, [r1] - b _080C9664 - .pool -_080C9624: - bl sub_80D1194 - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x4 - strb r0, [r1] - b _080C9664 - .pool -_080C9638: - bl sub_80D1218 - lsls r0, 24 - cmp r0, 0 - bne _080C9664 - movs r0, 0 - bl sub_80CFE54 -_080C9648: - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow - b _080C9664 - .pool -_080C9654: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _080C9664 - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow -_080C9664: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C954C - - thumb_func_start sub_80C9670 -sub_80C9670: @ 80C9670 - push {r4,lr} - ldr r4, =0x02039d08 - ldr r0, [r4] - ldrb r0, [r0] - cmp r0, 0 - beq _080C9688 - cmp r0, 0x1 - beq _080C969A - b _080C96AE - .pool -_080C9688: - bl party_compaction - bl sub_80CB950 - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C96AE -_080C969A: - bl sub_80CB9BC - lsls r0, 24 - cmp r0, 0 - bne _080C96AE - bl sub_80CAB20 - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow -_080C96AE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C9670 - - thumb_func_start sub_80C96B8 -sub_80C96B8: @ 80C96B8 - push {r4,lr} - ldr r4, =0x02039d08 - ldr r0, [r4] - ldrb r0, [r0] - cmp r0, 0x1 - beq _080C96E6 - cmp r0, 0x1 - bgt _080C96D4 - cmp r0, 0 - beq _080C96DE - b _080C9720 - .pool -_080C96D4: - cmp r0, 0x2 - beq _080C96F2 - cmp r0, 0x3 - beq _080C9710 - b _080C9720 -_080C96DE: - movs r0, 0x1E - bl sub_80CAC58 - b _080C9702 -_080C96E6: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _080C9720 - b _080C9702 -_080C96F2: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0xF3 - ands r0, r1 - cmp r0, 0 - beq _080C9720 - bl sub_80CADC4 -_080C9702: - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C9720 - .pool -_080C9710: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _080C9720 - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow -_080C9720: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C96B8 - - thumb_func_start box_related -box_related: @ 80C972C - push {r4,lr} - ldr r4, =0x02039d08 - ldr r0, [r4] - ldrb r0, [r0] - cmp r0, 0x1 - beq _080C9762 - cmp r0, 0x1 - bgt _080C9748 - cmp r0, 0 - beq _080C974E - b _080C9818 - .pool -_080C9748: - cmp r0, 0x2 - beq _080C9774 - b _080C9818 -_080C974E: - movs r0, 0x1 - bl sub_80CAC58 - bl sub_80CFFD0 - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C9818 -_080C9762: - bl sub_80D00A8 - lsls r0, 24 - cmp r0, 0 - bne _080C9818 - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080C9774: - bl sub_80D00AC - adds r0, 0x1 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - bhi _080C9818 - lsls r0, 2 - ldr r1, =_080C9790 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C9790: - .4byte _080C97C4 - .4byte _080C97C4 - .4byte _080C9818 - .4byte _080C9818 - .4byte _080C9818 - .4byte _080C9818 - .4byte _080C9818 - .4byte _080C9818 - .4byte _080C9818 - .4byte _080C9818 - .4byte _080C9808 - .4byte _080C97F0 - .4byte _080C97DC -_080C97C4: - movs r0, 0x1 - bl sub_80CD1A8 - bl sub_80CADC4 - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow - b _080C9818 - .pool -_080C97DC: - movs r0, 0x5 - bl audio_play - ldr r0, =sub_80C9AC8 - bl add_to_c3_somehow - b _080C9818 - .pool -_080C97F0: - movs r0, 0x5 - bl audio_play - bl sub_80CADC4 - ldr r0, =sub_80C9824 - bl add_to_c3_somehow - b _080C9818 - .pool -_080C9808: - movs r0, 0x5 - bl audio_play - bl sub_80CADC4 - ldr r0, =sub_80C99D8 - bl add_to_c3_somehow -_080C9818: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end box_related - - thumb_func_start sub_80C9824 -sub_80C9824: @ 80C9824 - push {r4,r5,lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0x6 - bls _080C9832 - b _080C99CC -_080C9832: - lsls r0, 2 - ldr r1, =_080C9844 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C9844: - .4byte _080C9860 - .4byte _080C9878 - .4byte _080C9894 - .4byte _080C990C - .4byte _080C993C - .4byte _080C9990 - .4byte _080C99AC -_080C9860: - bl sub_80CADD8 - movs r0, 0x2 - bl sub_80CAC58 - ldr r0, =0x02039d08 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - b _080C99CA - .pool -_080C9878: - bl sub_80D00A8 - lsls r0, 24 - cmp r0, 0 - beq _080C9884 - b _080C99CC -_080C9884: - ldr r0, =0x02039d08 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - b _080C99CA - .pool -_080C9894: - bl sub_80D00AC - ldr r4, =0x02039d08 - ldr r1, [r4] - ldr r5, =0x0000078e - adds r1, r5 - strh r0, [r1] - movs r0, 0 - ldrsh r1, [r1, r0] - cmp r1, 0x15 - bgt _080C98C0 - cmp r1, 0x12 - bge _080C98D2 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _080C98C6 - b _080C99CC - .pool -_080C98C0: - cmp r1, 0x16 - beq _080C98EC - b _080C99CC -_080C98C6: - movs r0, 0x1 - bl sub_80CD1A8 - bl sub_80CADC4 - b _080C99A0 -_080C98D2: - movs r0, 0x5 - bl audio_play - bl sub_80D013C - ldr r1, [r4] - adds r2, r1, r5 - ldrh r0, [r2] - subs r0, 0x12 - strh r0, [r2] - ldrb r0, [r1] - adds r0, 0x1 - b _080C99CA -_080C98EC: - movs r0, 0x5 - bl audio_play - ldr r0, [r4] - movs r1, 0xF2 - lsls r1, 3 - adds r0, r1 - movs r1, 0x10 - strh r1, [r0] - bl sub_80D013C - bl sub_80CADC4 - ldr r1, [r4] - movs r0, 0x6 - b _080C99CA -_080C990C: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _080C99CC - ldr r4, =0x02039d08 - ldr r0, [r4] - ldr r1, =0x0000078e - adds r0, r1 - ldrb r0, [r0] - bl sub_80CAE0C - movs r0, 0x3 - bl sub_80CAC58 - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - b _080C99CA - .pool -_080C993C: - bl sub_80D00AC - ldr r4, =0x02039d08 - ldr r1, [r4] - movs r5, 0xF2 - lsls r5, 3 - adds r1, r5 - strh r0, [r1] - movs r0, 0 - ldrsh r1, [r1, r0] - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - beq _080C99CC - adds r0, 0x1 - cmp r1, r0 - bne _080C996C - bl sub_80CADC4 - ldr r1, [r4] - movs r0, 0 - b _080C99CA - .pool -_080C996C: - movs r0, 0x5 - bl audio_play - bl sub_80CADC4 - ldr r1, [r4] - adds r1, r5 - ldrh r0, [r1] - subs r0, 0x17 - strh r0, [r1] - lsls r0, 24 - lsrs r0, 24 - bl sub_80CC680 - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - b _080C99CA -_080C9990: - bl sub_80CC6B0 - lsls r0, 24 - cmp r0, 0 - bne _080C99CC - movs r0, 0x1 - bl sub_80CD1A8 -_080C99A0: - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow - b _080C99CC - .pool -_080C99AC: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _080C99CC - ldr r4, =0x02039d08 - ldr r0, [r4] - movs r1, 0xF2 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - bl sub_80CC680 - ldr r1, [r4] - movs r0, 0x5 -_080C99CA: - strb r0, [r1] -_080C99CC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C9824 - - thumb_func_start sub_80C99D8 -sub_80C99D8: @ 80C99D8 - push {r4,r5,lr} - sub sp, 0x4 - ldr r5, =0x02039d08 - ldr r0, [r5] - ldrb r4, [r0] - cmp r4, 0x1 - beq _080C9A2C - cmp r4, 0x1 - bgt _080C99F4 - cmp r4, 0 - beq _080C99FE - b _080C9AB8 - .pool -_080C99F4: - cmp r4, 0x2 - beq _080C9A84 - cmp r4, 0x3 - beq _080C9A9C - b _080C9AB8 -_080C99FE: - movs r0, 0x5 - bl sub_80CAC58 - ldr r0, [r5] - ldr r1, =0x00001e5c - adds r0, r1 - ldr r2, =0x0000dac7 - str r4, [sp] - movs r1, 0xA - movs r3, 0x3 - bl sub_80C77E8 - bl get_preferred_box - lsls r0, 24 - lsrs r0, 24 - bl sub_80C78D4 - b _080C9A8E - .pool -_080C9A2C: - bl sub_80C78F0 - ldr r1, [r5] - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x000002ca - adds r1, r2 - strh r0, [r1] - movs r2, 0 - ldrsh r0, [r1, r2] - cmp r0, 0xC8 - beq _080C9AB8 - bl sub_80CADC4 - bl sub_80C78E4 - bl sub_80C7890 - ldr r0, [r5] - ldr r2, =0x000002ca - adds r1, r0, r2 - movs r2, 0 - ldrsh r0, [r1, r2] - cmp r0, 0xC9 - beq _080C9A6C - adds r4, r0, 0 - bl get_preferred_box - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _080C9A8E -_080C9A6C: - movs r0, 0x1 - bl sub_80CD1A8 - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow - b _080C9AB8 - .pool -_080C9A84: - ldr r1, =0x000002ca - adds r0, r1 - ldrb r0, [r0] - bl sub_80CC464 -_080C9A8E: - ldr r1, [r5] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C9AB8 - .pool -_080C9A9C: - bl sub_80CC54C - lsls r0, 24 - cmp r0, 0 - bne _080C9AB8 - ldr r0, [r5] - ldr r2, =0x000002ca - adds r0, r2 - ldrb r0, [r0] - bl sub_80D1D18 - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow -_080C9AB8: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C99D8 - - thumb_func_start sub_80C9AC8 -sub_80C9AC8: @ 80C9AC8 - push {r4,r5,lr} - sub sp, 0x4 - ldr r5, =0x02039d08 - ldr r0, [r5] - ldrb r4, [r0] - cmp r4, 0 - beq _080C9AE0 - cmp r4, 0x1 - beq _080C9AFE - b _080C9B18 - .pool -_080C9AE0: - bl sub_80CE760 - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, [r5] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C9B18 -_080C9AFE: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _080C9B18 - ldr r0, =0x02039d0f - strb r4, [r0] - ldr r1, [r5] - movs r0, 0x2 - strb r0, [r1, 0x2] - ldr r0, =sub_80C9E50 - bl add_to_c3_somehow -_080C9B18: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C9AC8 - - thumb_func_start sub_80C9B28 -sub_80C9B28: @ 80C9B28 - push {r4,r5,lr} - sub sp, 0x4 - ldr r5, =0x02039d08 - ldr r0, [r5] - ldrb r4, [r0] - cmp r4, 0 - beq _080C9B40 - cmp r4, 0x1 - beq _080C9B5E - b _080C9B78 - .pool -_080C9B40: - bl sub_80CE7E8 - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, [r5] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C9B78 -_080C9B5E: - bl fade_and_return_progress_probably - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _080C9B78 - ldr r0, =0x02039d0f - strb r1, [r0] - ldr r0, [r5] - strb r4, [r0, 0x2] - ldr r0, =sub_80C9E50 - bl add_to_c3_somehow -_080C9B78: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C9B28 - - thumb_func_start sub_80C9B88 -sub_80C9B88: @ 80C9B88 - push {r4,lr} - sub sp, 0x4 - ldr r4, =0x02039d08 - ldr r0, [r4] - ldrb r1, [r0] - cmp r1, 0 - beq _080C9BA0 - cmp r1, 0x1 - beq _080C9BBA - b _080C9BD6 - .pool -_080C9BA0: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C9BD6 -_080C9BBA: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _080C9BD6 - ldr r1, =0x02039d0f - movs r0, 0x2 - strb r0, [r1] - ldr r1, [r4] - movs r0, 0x3 - strb r0, [r1, 0x2] - ldr r0, =sub_80C9E50 - bl add_to_c3_somehow -_080C9BD6: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C9B88 - - thumb_func_start sub_80C9BE8 -sub_80C9BE8: @ 80C9BE8 - push {r4,lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0x4 - bls _080C9BF6 - b _080C9D08 -_080C9BF6: - lsls r0, 2 - ldr r1, =_080C9C08 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C9C08: - .4byte _080C9C1C - .4byte _080C9C78 - .4byte _080C9C8C - .4byte _080C9CC8 - .4byte _080C9CE4 -_080C9C1C: - bl sub_80CEAD0 - lsls r0, 24 - cmp r0, 0 - beq _080C9C40 - movs r0, 0x20 - bl audio_play - movs r0, 0xF - bl sub_80CAC58 - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x1 - strb r0, [r1] - b _080C9D08 - .pool -_080C9C40: - bl sub_80D127C - lsls r0, 24 - cmp r0, 0 - beq _080C9C58 - ldr r0, =sub_80C954C - bl add_to_c3_somehow - b _080C9D08 - .pool -_080C9C58: - movs r0, 0x5 - bl audio_play - movs r0, 0 - bl sub_80CAC58 - movs r0, 0 - bl sub_80CAD9C - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x2 - strb r0, [r1] - b _080C9D08 - .pool -_080C9C78: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0xF3 - ands r0, r1 - cmp r0, 0 - beq _080C9D08 - b _080C9CAA - .pool -_080C9C8C: - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _080C9CBC - cmp r1, 0 - bgt _080C9CA6 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _080C9CAA - b _080C9D08 -_080C9CA6: - cmp r1, 0x1 - bne _080C9D08 -_080C9CAA: - bl sub_80CADC4 - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow - b _080C9D08 - .pool -_080C9CBC: - movs r0, 0x3 - bl audio_play - bl sub_80CADC4 - b _080C9CD2 -_080C9CC8: - movs r0, 0x14 - movs r1, 0 - movs r2, 0x1 - bl sub_80F9BF4 -_080C9CD2: - ldr r0, =0x02039d08 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C9D08 - .pool -_080C9CE4: - bl sub_80F9C30 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _080C9D08 - bl sub_80CABE0 - bl calc_player_party_count - ldr r1, =0x020244e9 - strb r0, [r1] - ldr r0, =0x02039d08 - ldr r0, [r0] - strb r4, [r0, 0x2] - ldr r0, =sub_80C9E50 - bl add_to_c3_somehow -_080C9D08: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C9BE8 - - thumb_func_start sub_80C9D1C -sub_80C9D1C: @ 80C9D1C - push {r4,lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0x4 - bls _080C9D2A - b _080C9E3C -_080C9D2A: - lsls r0, 2 - ldr r1, =_080C9D3C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C9D3C: - .4byte _080C9D50 - .4byte _080C9DAC - .4byte _080C9DC0 - .4byte _080C9DFC - .4byte _080C9E18 -_080C9D50: - bl sub_80CEAD0 - lsls r0, 24 - cmp r0, 0 - beq _080C9D74 - movs r0, 0x20 - bl audio_play - movs r0, 0xF - bl sub_80CAC58 - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x1 - strb r0, [r1] - b _080C9E3C - .pool -_080C9D74: - bl sub_80D127C - lsls r0, 24 - cmp r0, 0 - beq _080C9D8C - ldr r0, =sub_80C954C - bl add_to_c3_somehow - b _080C9E3C - .pool -_080C9D8C: - movs r0, 0x5 - bl audio_play - movs r0, 0x12 - bl sub_80CAC58 - movs r0, 0 - bl sub_80CAD9C - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0x2 - strb r0, [r1] - b _080C9E3C - .pool -_080C9DAC: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0xF3 - ands r0, r1 - cmp r0, 0 - beq _080C9E3C - b _080C9DE0 - .pool -_080C9DC0: - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _080C9DE0 - cmp r1, 0 - bgt _080C9DDA - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _080C9DF0 - b _080C9E3C -_080C9DDA: - cmp r1, 0x1 - beq _080C9DF0 - b _080C9E3C -_080C9DE0: - bl sub_80CADC4 - ldr r0, =task_pokemon_box_related - bl add_to_c3_somehow - b _080C9E3C - .pool -_080C9DF0: - movs r0, 0x3 - bl audio_play - bl sub_80CADC4 - b _080C9E06 -_080C9DFC: - movs r0, 0x14 - movs r1, 0 - movs r2, 0 - bl sub_80F9BF4 -_080C9E06: - ldr r0, =0x02039d08 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C9E3C - .pool -_080C9E18: - bl sub_80F9C30 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _080C9E3C - bl sub_80CABE0 - bl calc_player_party_count - ldr r1, =0x020244e9 - strb r0, [r1] - ldr r0, =0x02039d08 - ldr r0, [r0] - strb r4, [r0, 0x2] - ldr r0, =sub_80C9E50 - bl add_to_c3_somehow -_080C9E3C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C9D1C - - thumb_func_start sub_80C9E50 -sub_80C9E50: @ 80C9E50 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r4, [r0, 0x2] - ldrb r0, [r0, 0x1] - cmp r0, 0x3 - bne _080C9E88 - bl sub_80D127C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080C9E88 - bl sub_80D12D4 - ldr r1, =0x02039d12 - b _080C9E8C - .pool -_080C9E88: - ldr r1, =0x02039d12 - movs r0, 0 -_080C9E8C: - strh r0, [r1] - cmp r4, 0x1 - beq _080C9EB4 - cmp r4, 0x1 - ble _080C9E9E - cmp r4, 0x2 - beq _080C9F1C - cmp r4, 0x3 - beq _080C9F48 -_080C9E9E: - bl sub_80C9FC8 - ldr r0, =sub_80C7678 - bl SetMainCallback2 - b _080C9F56 - .pool -_080C9EB4: - ldr r0, =0x02039d08 - ldr r1, [r0] - ldr r2, =0x0000218c - adds r0, r1, r2 - ldr r4, [r0] - subs r2, 0x5 - adds r0, r1, r2 - ldrb r7, [r0] - subs r2, 0x1 - adds r0, r1, r2 - ldrb r6, [r0] - ldr r0, =0x00002188 - adds r1, r0 - ldrb r5, [r1] - bl sub_80C9FC8 - cmp r5, 0 - bne _080C9F04 - ldr r0, =0x02039d14 - cmp r4, r0 - bne _080C9F04 - ldr r0, =c2_808CE60 - str r0, [sp] - movs r0, 0 - adds r1, r4, 0 - adds r2, r7, 0 - adds r3, r6, 0 - bl sub_81BFA80 - b _080C9F56 - .pool -_080C9F04: - ldr r0, =c2_808CE60 - str r0, [sp] - adds r0, r5, 0 - adds r1, r4, 0 - adds r2, r7, 0 - adds r3, r6, 0 - bl sub_81BF8EC - b _080C9F56 - .pool -_080C9F1C: - bl sub_80C9FC8 - bl get_preferred_box - lsls r0, 24 - lsrs r0, 24 - bl sav3_get_box_name - adds r1, r0, 0 - movs r0, 0 - str r0, [sp] - ldr r0, =c2_808CE60 - str r0, [sp, 0x4] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl do_choose_name_or_words_screen - b _080C9F56 - .pool -_080C9F48: - bl sub_80C9FC8 - ldr r2, =c2_808CE60 - movs r0, 0xB - movs r1, 0 - bl GoToBagMenu -_080C9F56: - mov r0, r8 - bl DestroyTask - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C9E50 - - thumb_func_start sub_80C9F6C -sub_80C9F6C: @ 80C9F6C - push {lr} - sub sp, 0x4 - ldr r0, =0x0203ce7c - ldrh r1, [r0] - mov r0, sp - strh r1, [r0] - cmp r1, 0 - beq _080C9FC0 - bl sub_80CFE08 - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =0x02039d0c - ldrb r0, [r0] - cmp r0, 0 - beq _080C9FAC - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xC - mov r2, sp - bl pokemon_setattr - b _080C9FB6 - .pool -_080C9FAC: - adds r0, r1, 0 - movs r1, 0xC - mov r2, sp - bl set_pokemon_data_from_selected_box -_080C9FB6: - mov r0, sp - ldrh r0, [r0] - movs r1, 0x1 - bl remove_item -_080C9FC0: - add sp, 0x4 - pop {r0} - bx r0 - thumb_func_end sub_80C9F6C - - thumb_func_start sub_80C9FC8 -sub_80C9FC8: @ 80C9FC8 - push {r4,lr} - bl sub_80D25F0 - bl sub_80D01B8 - ldr r4, =0x02039d08 - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - bl FreeAllWindowBuffers - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C9FC8 - - thumb_func_start sub_80C9FEC -sub_80C9FEC: @ 80C9FEC - push {lr} - sub sp, 0x4 - ldr r1, =0x00001f0f - movs r0, 0xE - bl SetGpuReg - ldr r1, =gUnknown_085720DC - movs r0, 0 - str r0, [sp] - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r0, =gUnknown_08572174 - ldr r1, =0x0600f800 - bl LZ77UnCompVram - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C9FEC - - thumb_func_start sub_80CA028 -sub_80CA028: @ 80CA028 - push {lr} - movs r0, 0x3 - movs r1, 0x80 - movs r2, 0x1 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0x80 - movs r2, 0x2 - bl ChangeBgY - pop {r0} - bx r0 - thumb_func_end sub_80CA028 - - thumb_func_start sub_80CA044 -sub_80CA044: @ 80CA044 - push {r4,r5,lr} - sub sp, 0x4 - ldr r1, =gUnknown_08572734 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r1, =gUnknown_08DD2FE8 - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r0, =gUnknown_085722A0 - ldr r5, =0x02039d08 - ldr r1, [r5] - ldr r4, =0x00005ac4 - adds r1, r4 - bl LZ77UnCompWram - ldr r1, [r5] - adds r1, r4 - movs r0, 0x1 - bl SetBgTilemapBuffer - movs r0, 0x1 - bl ShowBg - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CA044 - - thumb_func_start sub_80CA0A4 -sub_80CA0A4: @ 80CA0A4 - push {lr} - ldr r0, =gUnknown_08572714 - bl InitWindows - lsls r0, 16 - cmp r0, 0 - beq _080CA0C0 - bl DeactivateAllTextPrinters - movs r0, 0x1 - b _080CA0C2 - .pool -_080CA0C0: - movs r0, 0 -_080CA0C2: - pop {r1} - bx r1 - thumb_func_end sub_80CA0A4 - - thumb_func_start sub_80CA0C8 -sub_80CA0C8: @ 80CA0C8 - push {lr} - ldr r0, =gUnknown_08572744 - bl LoadTaggedObjectPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CA0C8 - - thumb_func_start sub_80CA0D8 -sub_80CA0D8: @ 80CA0D8 - push {lr} - ldr r0, =gUnknown_085723DC - movs r1, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_085723FC - movs r1, 0x20 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_085726F4 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x3 - beq _080CA124 - ldr r0, =gUnknown_0857241C - movs r1, 0x30 - movs r2, 0x20 - bl gpu_pal_apply - b _080CA12E - .pool -_080CA124: - ldr r0, =gUnknown_0857243C - movs r1, 0x30 - movs r2, 0x20 - bl gpu_pal_apply -_080CA12E: - ldr r1, =0x00001e05 - movs r0, 0xA - bl SetGpuReg - bl sub_80CA318 - bl sub_80CA154 - bl sub_80CA1C4 - bl sub_80CA230 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CA0D8 - - thumb_func_start sub_80CA154 -sub_80CA154: @ 80CA154 - push {r4,lr} - ldr r1, =0x0000dac8 - movs r0, 0x10 - movs r2, 0 - bl sub_811FFB4 - ldr r4, =0x02039d08 - ldr r1, [r4] - ldr r3, =0x00000d94 - adds r1, r3 - str r0, [r1] - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0, 0x5] - ldr r0, [r4] - adds r0, r3 - ldr r0, [r0] - adds r0, 0x43 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r4] - adds r0, r3 - ldr r2, [r0] - movs r1, 0x28 - strh r1, [r2, 0x20] - ldr r1, [r0] - movs r0, 0x96 - strh r0, [r1, 0x22] - movs r0, 0x10 - bl GetObjectTileRangeStartByTag - ldr r1, [r4] - movs r2, 0xDA - lsls r2, 4 - adds r1, r2 - lsls r0, 16 - lsrs r0, 11 - ldr r2, =0x06010000 - adds r0, r2 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CA154 - - thumb_func_start sub_80CA1C4 -sub_80CA1C4: @ 80CA1C4 - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0857274C - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp] - str r1, [sp, 0x4] - mov r0, sp - bl LoadObjectPic - movs r4, 0 -_080CA1DA: - lsls r1, r4, 6 - subs r1, r4 - adds r1, 0x8 - lsls r1, 16 - asrs r1, 16 - ldr r0, =gUnknown_085728BC - movs r2, 0x9 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02039d08 - ldr r2, [r1] - lsls r1, r4, 2 - ldr r3, =0x00000d98 - adds r2, r3 - adds r2, r1 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - str r1, [r2] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x1 - bls _080CA1DA - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CA1C4 - - thumb_func_start sub_80CA230 -sub_80CA230: @ 80CA230 - push {lr} - ldr r0, =0x02039d08 - ldr r1, [r0] - ldr r2, =0x00000ce4 - adds r0, r1, r2 - ldrh r0, [r0] - subs r2, 0x4 - adds r1, r2 - ldr r1, [r1] - bl sub_80CA44C - bl sub_80CA4FC - bl sub_80CA65C - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CA230 - - thumb_func_start BoxSetMosaic -BoxSetMosaic: @ 80CA260 - push {lr} - bl sub_80CA230 - ldr r3, =0x02039d08 - ldr r0, [r3] - movs r1, 0x89 - lsls r1, 6 - adds r0, r1 - ldr r2, [r0] - cmp r2, 0 - beq _080CA2AC - ldrb r0, [r2, 0x1] - movs r1, 0x10 - orrs r0, r1 - strb r0, [r2, 0x1] - ldr r1, [r3] - movs r0, 0x89 - lsls r0, 6 - adds r1, r0 - ldr r2, [r1] - movs r0, 0xA - strh r0, [r2, 0x2E] - ldr r2, [r1] - movs r0, 0x1 - strh r0, [r2, 0x30] - ldr r2, [r1] - ldr r0, =BoxSetMosaic2 - str r0, [r2, 0x1C] - ldr r0, [r1] - ldrh r0, [r0, 0x2E] - lsls r1, r0, 12 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x4C - bl SetGpuReg -_080CA2AC: - pop {r0} - bx r0 - .pool - thumb_func_end BoxSetMosaic - - thumb_func_start sub_80CA2B8 -sub_80CA2B8: @ 80CA2B8 - ldr r0, =0x02039d08 - ldr r0, [r0] - movs r1, 0x89 - lsls r1, 6 - adds r0, r1 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - lsls r0, 27 - lsrs r0, 31 - bx lr - .pool - thumb_func_end sub_80CA2B8 - - thumb_func_start BoxSetMosaic2 -BoxSetMosaic2: @ 80CA2D0 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - ldrh r1, [r4, 0x30] - subs r0, r1 - strh r0, [r4, 0x2E] - lsls r0, 16 - cmp r0, 0 - bge _080CA2E6 - movs r0, 0 - strh r0, [r4, 0x2E] -_080CA2E6: - ldrh r0, [r4, 0x2E] - lsls r1, r0, 12 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x4C - bl SetGpuReg - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080CA30E - ldrb r0, [r4, 0x1] - movs r1, 0x11 - negs r1, r1 - ands r1, r0 - strb r1, [r4, 0x1] - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] -_080CA30E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end BoxSetMosaic2 - - thumb_func_start sub_80CA318 -sub_80CA318: @ 80CA318 - push {r4-r7,lr} - sub sp, 0x28 - ldr r0, =0x02039d08 - mov r12, r0 - ldr r1, [r0] - ldr r4, =0x000022c4 - adds r0, r1, r4 - str r0, [sp, 0x18] - add r3, sp, 0x18 - movs r0, 0x82 - lsls r0, 10 - str r0, [r3, 0x4] - ldr r5, =0x00002244 - adds r1, r5 - str r1, [sp, 0x20] - ldr r0, =0x0000dac6 - add r2, sp, 0x20 - str r0, [r2, 0x4] - mov r1, sp - ldr r0, =gUnknown_08572754 - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - movs r6, 0 - adds r7, r2, 0 - mov r5, r12 - movs r2, 0 - ldr r1, =0x000007ff -_080CA352: - ldr r0, [r5] - adds r0, r4 - adds r0, r6 - strb r2, [r0] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, r1 - bls _080CA352 - movs r6, 0 - ldr r5, =0x02039d08 - ldr r4, =0x00002244 - movs r2, 0 -_080CA36C: - ldr r0, [r5] - lsls r1, r6, 1 - adds r0, r4 - adds r0, r1 - strh r2, [r0] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0xF - bls _080CA36C - ldr r0, =0x02039d08 - ldr r0, [r0] - movs r6, 0x89 - lsls r6, 6 - adds r0, r6 - movs r1, 0 - str r1, [r0] - adds r0, r3, 0 - bl LoadObjectPic - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - beq _080CA420 - adds r0, r7, 0 - bl LoadTaggedObjectPalette - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xFF - beq _080CA420 - b _080CA40C - .pool -_080CA3C4: - ldr r0, =0x02039d08 - ldr r2, [r0] - movs r7, 0x89 - lsls r7, 6 - adds r3, r2, r7 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - str r0, [r3] - lsls r0, r4, 4 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - ldr r3, =0x0000223a - adds r1, r2, r3 - strh r0, [r1] - ldr r6, =0x0000223c - adds r2, r6 - lsls r0, r5, 5 - ldr r7, =0x06010000 - adds r0, r7 - str r0, [r2] - b _080CA420 - .pool -_080CA40C: - mov r0, sp - movs r1, 0x28 - movs r2, 0x30 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - bne _080CA3C4 -_080CA420: - ldr r0, =0x02039d08 - ldr r0, [r0] - movs r1, 0x89 - lsls r1, 6 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - bne _080CA43C - movs r0, 0x2 - bl FreeObjectTilesByTag - ldr r0, =0x0000dac6 - bl FreeObjectPaletteByTag -_080CA43C: - add sp, 0x28 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CA318 - - thumb_func_start sub_80CA44C -sub_80CA44C: @ 80CA44C - push {r4-r7,lr} - sub sp, 0x4 - adds r3, r1, 0 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r6, =0x02039d08 - ldr r2, [r6] - movs r7, 0x89 - lsls r7, 6 - adds r0, r2, r7 - ldr r0, [r0] - cmp r0, 0 - beq _080CA4F2 - cmp r4, 0 - beq _080CA4E8 - lsls r0, r4, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r5, =0x000022c4 - adds r1, r2, r5 - movs r2, 0x1 - str r2, [sp] - adds r2, r4, 0 - bl DecompressMonPic - ldr r1, [r6] - ldr r2, =0x00000cdc - adds r0, r1, r2 - ldr r0, [r0] - ldr r4, =0x00002244 - adds r1, r4 - bl LZ77UnCompWram - ldr r0, [r6] - adds r5, r0, r5 - ldr r1, =0x0000223c - adds r0, r1 - ldr r1, [r0] - ldr r2, =0x04000200 - adds r0, r5, 0 - bl CpuSet - ldr r0, [r6] - adds r4, r0, r4 - ldr r2, =0x0000223a - adds r0, r2 - ldrh r1, [r0] - adds r0, r4, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, [r6] - adds r0, r7 - ldr r1, [r0] - adds r1, 0x3E - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - b _080CA4F2 - .pool -_080CA4E8: - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_080CA4F2: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80CA44C - - thumb_func_start sub_80CA4FC -sub_80CA4FC: @ 80CA4FC - push {r4-r6,lr} - sub sp, 0xC - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r6, =0x02039d08 - ldr r2, [r6] - ldrb r0, [r2, 0x1] - cmp r0, 0x3 - beq _080CA588 - ldr r0, =0x00000cf9 - adds r2, r0 - movs r4, 0 - str r4, [sp] - movs r5, 0xFF - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r3, 0x6 - bl Print - ldr r2, [r6] - ldr r1, =0x00000d1d - adds r2, r1 - movs r0, 0xF - str r0, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r1, 0x2 - movs r3, 0x6 - bl Print - ldr r2, [r6] - ldr r0, =0x00000d41 - adds r2, r0 - movs r0, 0x1D - str r0, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r1, 0x2 - movs r3, 0xA - bl Print - ldr r2, [r6] - ldr r1, =0x00000d65 - adds r2, r1 - movs r0, 0x2B - str r0, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r3, 0x6 - bl Print - b _080CA5E8 - .pool -_080CA588: - ldr r0, =0x00000d65 - adds r2, r0 - movs r4, 0 - str r4, [sp] - movs r5, 0xFF - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r3, 0x6 - bl Print - ldr r2, [r6] - ldr r1, =0x00000cf9 - adds r2, r1 - movs r0, 0xD - str r0, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r3, 0x6 - bl Print - ldr r2, [r6] - ldr r0, =0x00000d1d - adds r2, r0 - movs r0, 0x1C - str r0, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r1, 0x2 - movs r3, 0x6 - bl Print - ldr r2, [r6] - ldr r1, =0x00000d41 - adds r2, r1 - movs r0, 0x2A - str r0, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r1, 0x2 - movs r3, 0xA - bl Print -_080CA5E8: - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - ldr r4, =0x02039d08 - ldr r1, [r4] - ldr r2, =0x00000ce4 - adds r0, r1, r2 - ldrh r0, [r0] - cmp r0, 0 - beq _080CA640 - adds r2, 0x7 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, 0xB5 - adds r1, r2 - ldr r1, [r1] - bl sub_8120084 - ldr r0, [r4] - ldr r1, =0x00000d94 - adds r0, r1 - ldr r1, [r0] - adds r1, 0x3E - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - b _080CA64E - .pool -_080CA640: - ldr r2, =0x00000d94 - adds r0, r1, r2 - ldr r1, [r0] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 -_080CA64E: - strb r0, [r1] - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CA4FC - - thumb_func_start sub_80CA65C -sub_80CA65C: @ 80CA65C - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x00000ce4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _080CA6B4 - movs r0, 0x2 - str r0, [sp] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x8 - bl sub_80D27AC - movs r4, 0 -_080CA680: - ldr r0, =0x02039d08 - ldr r0, [r0] - lsls r1, r4, 2 - ldr r2, =0x00000d98 - adds r0, r2 - adds r0, r1 - ldr r0, [r0] - lsls r1, r4, 1 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - bl StartObjectImageAnimIfDifferent - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x1 - bls _080CA680 - b _080CA6E6 - .pool -_080CA6B4: - movs r0, 0x2 - str r0, [sp] - movs r0, 0 - movs r1, 0 - movs r2, 0x2 - movs r3, 0x8 - bl sub_80D27AC - movs r4, 0 -_080CA6C6: - ldr r0, =0x02039d08 - ldr r0, [r0] - lsls r1, r4, 2 - ldr r2, =0x00000d98 - adds r0, r2 - adds r0, r1 - ldr r0, [r0] - lsls r1, r4, 25 - lsrs r1, 24 - bl StartObjectImageAnim - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x1 - bls _080CA6C6 -_080CA6E6: - movs r0, 0 - bl sub_80D2918 - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CA65C - - thumb_func_start sub_80CA704 -sub_80CA704: @ 80CA704 - push {r4,lr} - sub sp, 0x4 - ldr r0, =gUnknown_08DD36C8 - ldr r4, =0x02039d08 - ldr r1, [r4] - adds r1, 0xB0 - bl LZ77UnCompWram - ldr r0, =gUnknown_08DD36A8 - movs r1, 0x10 - movs r2, 0x20 - bl gpu_pal_apply - ldr r2, [r4] - adds r2, 0xB0 - movs r0, 0x16 - str r0, [sp] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0xC - bl sub_80D2644 - ldr r2, =gUnknown_0857245C - movs r0, 0x4 - str r0, [sp] - movs r0, 0x2 - movs r1, 0x1 - movs r3, 0x9 - bl sub_80D2644 - movs r0, 0x1 - movs r1, 0xA - movs r2, 0 - bl sub_80D2770 - movs r0, 0x2 - movs r1, 0x15 - movs r2, 0 - bl sub_80D2770 - bl sub_80CAA74 - ldr r0, =0x02039d0c - ldrb r0, [r0] - cmp r0, 0 - beq _080CA790 - movs r0, 0x1 - bl sub_80CA984 - movs r0, 0x1 - bl sub_80CB7E8 - movs r0, 0x2 - bl sub_80D2918 - movs r0, 0x1 - bl sub_80D2918 - b _080CA7B2 - .pool -_080CA790: - movs r0, 0x2 - str r0, [sp] - movs r0, 0x1 - movs r1, 0 - movs r2, 0x14 - movs r3, 0xC - bl sub_80D27AC - movs r0, 0x1 - bl sub_80CA984 - movs r0, 0x1 - bl sub_80D2918 - movs r0, 0x2 - bl sub_80D2918 -_080CA7B2: - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x000002c7 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CA704 - - thumb_func_start sub_80CA7D4 -sub_80CA7D4: @ 80CA7D4 - push {lr} - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r0, 0xB0 - lsls r0, 2 - adds r2, r1, r0 - movs r3, 0 - movs r0, 0x14 - strh r0, [r2] - ldr r0, =0x000002c2 - adds r2, r1, r0 - movs r0, 0x2 - strh r0, [r2] - ldr r0, =0x000002c5 - adds r1, r0 - strb r3, [r1] - movs r0, 0 - bl sub_80CB7E8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CA7D4 - - thumb_func_start sub_80CA80C -sub_80CA80C: @ 80CA80C - push {r4,lr} - ldr r4, =0x02039d08 - ldr r2, [r4] - ldr r1, =0x000002c5 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x14 - beq _080CA87A - movs r0, 0xB0 - lsls r0, 2 - adds r1, r2, r0 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - ldr r0, =0x000002c2 - adds r1, r2, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl sub_80D27F4 - movs r0, 0x1 - bl sub_80D2918 - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x8 - bl sub_80CBAF0 - ldr r1, [r4] - ldr r0, =0x000002c5 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x14 - beq _080CA874 - movs r0, 0x1 - b _080CA87C - .pool -_080CA874: - ldr r1, =0x02039d0c - movs r0, 0x1 - strb r0, [r1] -_080CA87A: - movs r0, 0 -_080CA87C: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80CA80C - - thumb_func_start sub_80CA888 -sub_80CA888: @ 80CA888 - push {r4,lr} - ldr r4, =0x02039d08 - ldr r1, [r4] - movs r0, 0xB0 - lsls r0, 2 - adds r2, r1, r0 - movs r3, 0 - movs r0, 0 - strh r0, [r2] - ldr r0, =0x000002c2 - adds r2, r1, r0 - movs r0, 0x16 - strh r0, [r2] - ldr r0, =0x000002c5 - adds r1, r0 - strb r3, [r1] - ldr r0, [r4] - ldrb r0, [r0, 0x1] - cmp r0, 0x3 - bne _080CA8B4 - bl sub_80D11CC -_080CA8B4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CA888 - - thumb_func_start sub_80CA8C8 -sub_80CA8C8: @ 80CA8C8 - push {r4,r5,lr} - sub sp, 0x8 - ldr r5, =0x02039d08 - ldr r2, [r5] - ldr r1, =0x000002c5 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x14 - beq _080CA974 - movs r0, 0xB0 - lsls r0, 2 - adds r1, r2, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - ldr r4, =0x000002c2 - adds r1, r2, r4 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - movs r2, 0x1 - negs r2, r2 - movs r0, 0x1 - movs r1, 0x3 - bl sub_80D27F4 - movs r0, 0x1 - bl sub_80D2918 - movs r1, 0x80 - lsls r1, 1 - ldr r0, [r5] - adds r0, r4 - ldrb r3, [r0] - movs r0, 0xC - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r2, 0xA - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0x8 - negs r0, r0 - bl sub_80CBAF0 - ldr r1, [r5] - ldr r0, =0x000002c5 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x14 - beq _080CA94C - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - b _080CA976 - .pool -_080CA94C: - ldr r0, =0x02039d0c - movs r1, 0 - strb r1, [r0] - bl sub_80CBB9C - bl party_compaction - movs r0, 0x2 - str r0, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x9 - bl sub_80D27AC - movs r0, 0x2 - bl sub_80D2918 - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram -_080CA974: - movs r0, 0 -_080CA976: - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80CA8C8 - - thumb_func_start sub_80CA984 -sub_80CA984: @ 80CA984 - push {lr} - sub sp, 0x4 - lsls r0, 24 - cmp r0, 0 - beq _080CA99E - movs r0, 0x2 - str r0, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x9 - bl sub_80D27AC - b _080CA9AC -_080CA99E: - movs r0, 0x2 - str r0, [sp] - movs r1, 0 - movs r2, 0x2 - movs r3, 0x9 - bl sub_80D27AC -_080CA9AC: - movs r0, 0x2 - bl sub_80D2918 - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x4 - pop {r0} - bx r0 - thumb_func_end sub_80CA984 - - thumb_func_start sub_80CA9C0 -sub_80CA9C0: @ 80CA9C0 - ldr r2, =0x02039d08 - ldr r0, [r2] - ldr r1, =0x000002c7 - adds r0, r1 - movs r3, 0x1 - strb r3, [r0] - ldr r0, [r2] - adds r1, 0x1 - adds r0, r1 - movs r1, 0x1E - strb r1, [r0] - ldr r0, [r2] - ldr r1, =0x000002c9 - adds r0, r1 - strb r3, [r0] - bx lr - .pool - thumb_func_end sub_80CA9C0 - - thumb_func_start sub_80CA9EC -sub_80CA9EC: @ 80CA9EC - push {lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r2, =0x000002c7 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0 - beq _080CAA06 - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - bl sub_80CA984 -_080CAA06: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CA9EC - - thumb_func_start sub_80CAA14 -sub_80CAA14: @ 80CAA14 - push {r4,lr} - ldr r3, =0x02039d08 - ldr r1, [r3] - ldr r2, =0x000002c7 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080CAA60 - movs r0, 0xB2 - lsls r0, 2 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1E - bls _080CAA60 - ldr r0, [r3] - movs r1, 0xB2 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r3] - movs r2, 0 - ldr r4, =0x000002c9 - adds r1, r0, r4 - ldrb r0, [r1] - cmp r0, 0 - bne _080CAA54 - movs r2, 0x1 -_080CAA54: - strb r2, [r1] - ldr r0, [r3] - adds r0, r4 - ldrb r0, [r0] - bl sub_80CA984 -_080CAA60: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CAA14 - - thumb_func_start sub_80CAA74 -sub_80CAA74: @ 80CAA74 - push {r4,lr} - movs r4, 0x1 -_080CAA78: - movs r0, 0x64 - muls r0, r4 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - negs r1, r0 - orrs r1, r0 - lsrs r1, 31 - adds r0, r4, 0 - bl sub_80CAAA8 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _080CAA78 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CAA74 - - thumb_func_start sub_80CAAA8 -sub_80CAAA8: @ 80CAAA8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - ldr r7, =gUnknown_085724BC - cmp r1, 0 - beq _080CAAB8 - ldr r7, =gUnknown_085724A4 -_080CAAB8: - subs r0, 0x1 - lsls r1, r0, 1 - adds r1, r0 - adds r1, 0x1 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 18 - movs r1, 0xE0 - lsls r1, 11 - adds r0, r1 - lsrs r3, r0, 16 - movs r0, 0 - ldr r1, =0x02039d08 - mov r12, r1 -_080CAAD4: - movs r2, 0 - adds r4, r7, 0 - adds r4, 0x8 - adds r5, r3, 0 - adds r5, 0xC - adds r6, r0, 0x1 -_080CAAE0: - mov r0, r12 - ldr r1, [r0] - adds r0, r3, r2 - lsls r0, 1 - adds r1, 0xB0 - adds r1, r0 - lsls r0, r2, 1 - adds r0, r7 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x3 - bls _080CAAE0 - adds r7, r4, 0 - lsls r0, r5, 16 - lsrs r3, r0, 16 - lsls r0, r6, 16 - lsrs r0, 16 - cmp r0, 0x2 - bls _080CAAD4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CAAA8 - - thumb_func_start sub_80CAB20 -sub_80CAB20: @ 80CAB20 - push {lr} - sub sp, 0x4 - bl sub_80CAA74 - movs r0, 0x16 - str r0, [sp] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0xC - bl sub_80D27AC - movs r0, 0x1 - bl sub_80D2918 - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x4 - pop {r0} - bx r0 - thumb_func_end sub_80CAB20 - - thumb_func_start sub_80CAB4C -sub_80CAB4C: @ 80CAB4C - push {lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x000002c6 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - movs r0, 0x6 - bl audio_play - bl sub_80CA7D4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CAB4C - - thumb_func_start sub_80CAB70 -sub_80CAB70: @ 80CAB70 - push {r4,r5,lr} - ldr r4, =0x02039d08 - ldr r0, [r4] - ldr r5, =0x000002c6 - adds r0, r5 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080CABAA - cmp r0, 0x1 - bgt _080CAB94 - cmp r0, 0 - beq _080CAB9A - b _080CABD8 - .pool -_080CAB94: - cmp r0, 0x2 - beq _080CABD4 - b _080CABD8 -_080CAB9A: - bl sub_80CA80C - lsls r0, 24 - cmp r0, 0 - bne _080CABD8 - bl sub_80CDBA0 - b _080CABC4 -_080CABAA: - bl sub_80CD554 - lsls r0, 24 - cmp r0, 0 - bne _080CABD8 - ldr r0, [r4] - ldr r1, =0x00000cea - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080CABC4 - bl BoxSetMosaic -_080CABC4: - ldr r1, [r4] - adds r1, r5 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080CABD8 - .pool -_080CABD4: - movs r0, 0 - b _080CABDA -_080CABD8: - movs r0, 0x1 -_080CABDA: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80CAB70 - - thumb_func_start sub_80CABE0 -sub_80CABE0: @ 80CABE0 - push {r4,lr} - ldr r4, =0x02039d10 - bl get_preferred_box - ldrb r1, [r4] - lsls r0, 24 - lsrs r0, 24 - cmp r1, r0 - beq _080CAC0A - ldr r0, =0x000008d7 - bl FlagReset - ldr r4, =0x00004036 - bl get_preferred_box - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl VarSet -_080CAC0A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CABE0 - - thumb_func_start sub_80CAC1C -sub_80CAC1C: @ 80CAC1C - push {lr} - sub sp, 0xC - movs r1, 0xE8 - lsls r1, 5 - movs r0, 0x8 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0xD0 - bl sub_809882C - movs r0, 0x20 - str r0, [sp] - movs r0, 0x14 - 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 - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0xC - pop {r0} - bx r0 - thumb_func_end sub_80CAC1C - - thumb_func_start sub_80CAC58 -sub_80CAC58: @ 80CAC58 - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - bl sub_81AFBF0 - ldr r1, =gUnknown_0857276C - lsls r0, r6, 3 - adds r0, r1 - ldrb r0, [r0, 0x4] - cmp r0, 0x7 - bhi _080CAD30 - lsls r0, 2 - ldr r1, =_080CAC84 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080CAC84: - .4byte _080CAD30 - .4byte _080CACA4 - .4byte _080CACA4 - .4byte _080CACA4 - .4byte _080CACB8 - .4byte _080CACB8 - .4byte _080CACB8 - .4byte _080CACD0 -_080CACA4: - ldr r0, =0x02039d08 - ldr r1, [r0] - ldr r0, =0x00000cee - adds r1, r0 - b _080CACC0 - .pool -_080CACB8: - ldr r0, =0x02039d08 - ldr r1, [r0] - ldr r2, =0x000021e0 - adds r1, r2 -_080CACC0: - movs r0, 0 - bl sub_81AFC0C - b _080CAD30 - .pool -_080CACD0: - bl sub_80D127C - lsls r0, 24 - cmp r0, 0 - beq _080CACF4 - ldr r0, =0x02039d08 - ldr r4, [r0] - ldr r0, =0x000021eb - adds r4, r0 - bl sub_80D12B8 - adds r1, r0, 0 - adds r0, r4, 0 - b _080CAD00 - .pool -_080CACF4: - ldr r0, =0x02039d08 - ldr r1, [r0] - ldr r2, =0x000021eb - adds r0, r1, r2 - ldr r2, =0x00000d65 - adds r1, r2 -_080CAD00: - bl CopyString - adds r2, r0, 0 - b _080CAD16 - .pool -_080CAD14: - adds r2, r1, 0 -_080CAD16: - subs r1, r2, 0x1 - ldrb r0, [r1] - cmp r0, 0 - beq _080CAD14 - movs r0, 0xFF - strb r0, [r2] - ldr r0, =0x02039d08 - ldr r1, [r0] - ldr r0, =0x000021eb - adds r1, r0 - movs r0, 0 - bl sub_81AFC0C -_080CAD30: - ldr r5, =0x02039d08 - ldr r0, [r5] - ldr r4, =0x00002190 - adds r0, r4 - ldr r2, =gUnknown_0857276C - lsls r1, r6, 3 - adds r1, r2 - ldr r1, [r1] - bl sub_81AFC28 - movs r0, 0x1 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, [r5] - adds r2, r4 - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0xE - bl sub_8098858 - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CAC58 - - thumb_func_start sub_80CAD9C -sub_80CAD9C: @ 80CAD9C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_08572864 - movs r1, 0xB - movs r2, 0xE - movs r3, 0 - bl CreateYesNoMenu - lsls r4, 24 - asrs r4, 24 - adds r0, r4, 0 - bl MoveMenuCursorNoWrapAround - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CAD9C - - thumb_func_start sub_80CADC4 -sub_80CADC4: @ 80CADC4 - push {lr} - movs r0, 0x1 - movs r1, 0 - bl sub_8198070 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r0} - bx r0 - thumb_func_end sub_80CADC4 - - thumb_func_start sub_80CADD8 -sub_80CADD8: @ 80CADD8 - push {lr} - bl sub_80CFEF0 - movs r0, 0x12 - bl sub_80CFF34 - movs r0, 0x13 - bl sub_80CFF34 - movs r0, 0x14 - bl sub_80CFF34 - movs r0, 0x15 - bl sub_80CFF34 - bl sub_80D2494 - cmp r0, 0 - beq _080CAE04 - movs r0, 0x16 - bl sub_80CFF34 -_080CAE04: - bl sub_80CFFD0 - pop {r0} - bx r0 - thumb_func_end sub_80CADD8 - - thumb_func_start sub_80CAE0C -sub_80CAE0C: @ 80CAE0C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl sub_80CFEF0 - cmp r4, 0x1 - beq _080CAE4A - cmp r4, 0x1 - bgt _080CAE26 - cmp r4, 0 - beq _080CAE30 - b _080CAE96 -_080CAE26: - cmp r5, 0x2 - beq _080CAE64 - cmp r5, 0x3 - beq _080CAE7E - b _080CAE96 -_080CAE30: - movs r0, 0x17 - bl sub_80CFF34 - movs r0, 0x18 - bl sub_80CFF34 - movs r0, 0x19 - bl sub_80CFF34 - movs r0, 0x1A - bl sub_80CFF34 - b _080CAE96 -_080CAE4A: - movs r0, 0x1B - bl sub_80CFF34 - movs r0, 0x1C - bl sub_80CFF34 - movs r0, 0x1D - bl sub_80CFF34 - movs r0, 0x1E - bl sub_80CFF34 - b _080CAE96 -_080CAE64: - movs r0, 0x1F - bl sub_80CFF34 - movs r0, 0x20 - bl sub_80CFF34 - movs r0, 0x21 - bl sub_80CFF34 - movs r0, 0x22 - bl sub_80CFF34 - b _080CAE96 -_080CAE7E: - movs r0, 0x23 - bl sub_80CFF34 - movs r0, 0x24 - bl sub_80CFF34 - movs r0, 0x25 - bl sub_80CFF34 - movs r0, 0x26 - bl sub_80CFF34 -_080CAE96: - bl sub_80CFFD0 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80CAE0C - - thumb_func_start sub_80CAEA0 -sub_80CAEA0: @ 80CAEA0 - ldr r0, =0x02039d0d - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80CAEA0 - - thumb_func_start sub_80CAEAC -sub_80CAEAC: @ 80CAEAC - push {lr} - bl sub_80CEADC - lsls r0, 24 - cmp r0, 0 - bne _080CAEE8 - ldr r0, =0x02039d0c - ldrb r0, [r0] - cmp r0, 0 - beq _080CAED8 - bl sub_80CFE08 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x1 - bl sub_80D0D8C - b _080CAEE8 - .pool -_080CAED8: - bl sub_80CFE08 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0 - bl sub_80D0D8C -_080CAEE8: - ldr r1, =0x02039d12 - ldrh r0, [r1] - cmp r0, 0 - beq _080CAEFA - bl sub_80D0F38 - movs r0, 0x3 - bl sub_80CFE54 -_080CAEFA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CAEAC - - thumb_func_start sub_80CAF04 -sub_80CAF04: @ 80CAF04 - push {r4-r6,lr} - bl sub_80D2F04 - movs r2, 0 - ldr r3, =0x02039d08 - ldr r5, =0x00000b08 - movs r4, 0 - adds r6, r3, 0 -_080CAF14: - ldr r0, [r3] - lsls r1, r2, 1 - adds r0, r5 - adds r0, r1 - strh r4, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x27 - bls _080CAF14 - movs r2, 0 - ldr r5, =0x02039d08 - ldr r4, =0x00000b58 - movs r3, 0 -_080CAF30: - 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, 0x27 - bls _080CAF30 - movs r2, 0 - ldr r5, =0x02039d08 - movs r4, 0xA7 - lsls r4, 4 - movs r3, 0 -_080CAF4E: - ldr r0, [r5] - lsls r1, r2, 2 - adds r0, r4 - adds r0, r1 - str r3, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x5 - bls _080CAF4E - movs r2, 0 - ldr r5, =0x02039d08 - ldr r4, =0x00000a88 - movs r3, 0 -_080CAF6A: - ldr r0, [r5] - lsls r1, r2, 2 - adds r0, r4 - adds r0, r1 - str r3, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x1D - bls _080CAF6A - ldr r0, [r6] - ldr r2, =0x00000a6c - adds r1, r0, r2 - movs r2, 0 - str r2, [r1] - ldr r1, =0x0000078c - adds r0, r1 - strh r2, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CAF04 - - thumb_func_start sub_80CAFAC -sub_80CAFAC: @ 80CAFAC - push {lr} - bl sub_80CEB24 - lsls r0, 24 - movs r1, 0x1 - cmp r0, 0 - beq _080CAFBC - movs r1, 0x2 -_080CAFBC: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end sub_80CAFAC - - thumb_func_start sub_80CAFC4 -sub_80CAFC4: @ 80CAFC4 - push {r4-r6,lr} - sub sp, 0x8 - ldr r5, =0x02039d08 - ldr r0, [r5] - ldr r4, =0x000020a4 - adds r0, r4 - movs r1, 0 - bl pokemon_getattr - adds r6, r0, 0 - ldr r0, [r5] - adds r0, r4 - movs r1, 0x41 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sub_80CAFAC - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0 - bl sub_80CC230 - ldr r1, [r5] - ldr r2, =0x00000a6c - adds r1, r2 - str r0, [r1] - ldr r1, =sub_80CC100 - str r1, [r0, 0x1C] - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CAFC4 - - thumb_func_start sub_80CB028 -sub_80CB028: @ 80CB028 - 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 r9, r0 - movs r0, 0 - mov r8, r0 - movs r6, 0 - movs r7, 0 -_080CB042: - movs r5, 0 - adds r1, r7, 0x1 - mov r10, r1 -_080CB048: - mov r0, r9 - adds r1, r6, 0 - movs r2, 0x41 - bl get_pokemon_data_from_any_box - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _080CB0B0 - mov r0, r9 - adds r1, r6, 0 - movs r2, 0 - bl get_pokemon_data_from_any_box - adds r1, r0, 0 - lsls r2, r5, 1 - adds r2, r5 - lsls r2, 19 - movs r3, 0xC8 - lsls r3, 15 - adds r2, r3 - asrs r2, 16 - lsls r3, r7, 1 - adds r3, r7 - lsls r3, 19 - movs r0, 0xB0 - lsls r0, 14 - adds r3, r0 - movs r0, 0x2 - str r0, [sp] - movs r0, 0x13 - subs r0, r5 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - adds r0, r4, 0 - asrs r3, 16 - bl sub_80CC230 - ldr r1, =0x02039d08 - ldr r1, [r1] - mov r3, r8 - lsls r2, r3, 2 - ldr r3, =0x00000a88 - adds r1, r3 - adds r1, r2 - str r0, [r1] - b _080CB0C0 - .pool -_080CB0B0: - ldr r0, =0x02039d08 - ldr r0, [r0] - mov r2, r8 - lsls r1, r2, 2 - ldr r3, =0x00000a88 - adds r0, r3 - adds r0, r1 - str r4, [r0] -_080CB0C0: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - mov r0, r8 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x5 - bls _080CB048 - mov r1, r10 - lsls r0, r1, 16 - lsrs r7, r0, 16 - cmp r7, 0x4 - bls _080CB042 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x3 - bne _080CB126 - movs r6, 0 - movs r2, 0xD - negs r2, r2 - adds r4, r2, 0 -_080CB0F6: - mov r0, r9 - adds r1, r6, 0 - movs r2, 0xC - bl get_pokemon_data_from_any_box - cmp r0, 0 - bne _080CB11C - ldr r0, =0x02039d08 - ldr r0, [r0] - lsls r1, r6, 2 - ldr r3, =0x00000a88 - adds r0, r3 - adds r0, r1 - ldr r2, [r0] - ldrb r0, [r2, 0x1] - ands r0, r4 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0x1] -_080CB11C: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x1D - bls _080CB0F6 -_080CB126: - 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_80CB028 - - thumb_func_start sub_80CB140 -sub_80CB140: @ 80CB140 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r7, 0 - movs r1, 0x41 - bl get_pokemon_data_from_selected_box - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r0, 0 - beq _080CB1DA - adds r0, r7, 0 - movs r1, 0x6 - bl __umodsi3 - adds r6, r0, 0 - lsls r0, r6, 24 - lsrs r0, 24 - lsls r5, r0, 1 - adds r5, r0 - lsls r5, 19 - movs r0, 0xC8 - lsls r0, 15 - adds r5, r0 - lsrs r5, 16 - adds r0, r7, 0 - movs r1, 0x6 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 1 - adds r4, r0 - lsls r4, 19 - movs r0, 0xB0 - lsls r0, 14 - adds r4, r0 - lsrs r4, 16 - adds r0, r7, 0 - movs r1, 0 - bl get_pokemon_data_from_selected_box - adds r1, r0, 0 - movs r0, 0x2 - str r0, [sp] - movs r0, 0x13 - subs r0, r6 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - mov r0, r8 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_80CC230 - adds r3, r0, 0 - ldr r0, =0x02039d08 - ldr r2, [r0] - lsls r1, r7, 2 - ldr r4, =0x00000a88 - adds r0, r2, r4 - adds r0, r1 - str r3, [r0] - ldrb r0, [r2, 0x1] - cmp r0, 0x3 - bne _080CB1DA - ldrb r0, [r3, 0x1] - movs r1, 0xD - negs r1, r1 - ands r1, r0 - movs r0, 0x4 - orrs r1, r0 - strb r1, [r3, 0x1] -_080CB1DA: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CB140 - - thumb_func_start sub_80CB1F0 -sub_80CB1F0: @ 80CB1F0 - push {r4-r7,lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - ldr r7, =0x02039d08 - ldr r6, =0x00000a88 - movs r5, 0x1 - ldr r4, =sub_80CB278 -_080CB200: - ldr r0, [r7] - lsls r1, r2, 2 - adds r0, r6 - adds r1, r0, r1 - ldr r0, [r1] - cmp r0, 0 - beq _080CB218 - strh r3, [r0, 0x32] - ldr r0, [r1] - strh r5, [r0, 0x36] - ldr r0, [r1] - str r4, [r0, 0x1C] -_080CB218: - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x1D - bls _080CB200 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CB1F0 - - thumb_func_start sub_80CB234 -sub_80CB234: @ 80CB234 - push {lr} - adds r2, r0, 0 - ldrh r1, [r2, 0x30] - movs r3, 0x30 - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _080CB250 - subs r0, r1, 0x1 - strh r0, [r2, 0x30] - ldrh r0, [r2, 0x32] - ldrh r1, [r2, 0x20] - adds r0, r1 - strh r0, [r2, 0x20] - b _080CB266 -_080CB250: - ldr r0, =0x02039d08 - ldr r1, [r0] - ldr r3, =0x00000c66 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - ldrh r0, [r2, 0x34] - strh r0, [r2, 0x20] - ldr r0, =DummyObjectCallback - str r0, [r2, 0x1C] -_080CB266: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CB234 - - thumb_func_start sub_80CB278 -sub_80CB278: @ 80CB278 - push {lr} - adds r2, r0, 0 - ldrh r1, [r2, 0x36] - movs r3, 0x36 - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _080CB28C - subs r0, r1, 0x1 - strh r0, [r2, 0x36] - b _080CB2A8 -_080CB28C: - ldrh r0, [r2, 0x32] - ldrh r1, [r2, 0x20] - adds r0, r1 - strh r0, [r2, 0x20] - ldrh r1, [r2, 0x24] - adds r0, r1 - strh r0, [r2, 0x38] - subs r0, 0x45 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xB6 - bls _080CB2A8 - ldr r0, =DummyObjectCallback - str r0, [r2, 0x1C] -_080CB2A8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CB278 - - thumb_func_start sub_80CB2B0 -sub_80CB2B0: @ 80CB2B0 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r6, 0 - ldr r7, =0x02039d08 -_080CB2BA: - ldr r0, [r7] - lsls r4, r5, 2 - ldr r1, =0x00000a88 - adds r0, r1 - adds r0, r4 - ldr r0, [r0] - cmp r0, 0 - beq _080CB2DA - bl sub_80CC314 - ldr r0, [r7] - ldr r1, =0x00000a88 - adds r0, r1 - adds r0, r4 - movs r1, 0 - str r1, [r0] -_080CB2DA: - adds r0, r5, 0x6 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x4 - bls _080CB2BA - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CB2B0 - - thumb_func_start sub_80CB2F8 -sub_80CB2F8: @ 80CB2F8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0x8] - lsls r2, 16 - movs r1, 0x2C - mov r8, r1 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 19 - movs r3, 0xC8 - lsls r3, 15 - adds r1, r3 - lsrs r1, 16 - str r1, [sp, 0x10] - ldr r1, [sp, 0x8] - adds r1, 0x1 - lsrs r6, r2, 16 - str r6, [sp, 0xC] - asrs r2, 16 - muls r1, r2 - ldr r2, [sp, 0x10] - subs r1, r2, r1 - lsls r1, 16 - lsrs r2, r1, 16 - movs r1, 0x13 - subs r1, r0 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x14] - movs r3, 0 - mov r9, r3 - adds r5, r0, 0 - ldr r1, =0x02039d08 - ldr r0, [r1] - ldrb r0, [r0, 0x1] - cmp r0, 0x3 - beq _080CB3F0 - movs r7, 0x4 - lsls r2, 16 - mov r10, r2 -_080CB358: - ldr r6, =0x02039d08 - ldr r2, [r6] - lsls r0, r5, 1 - ldr r3, =0x00000ba8 - adds r1, r2, r3 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _080CB3C2 - lsls r4, r5, 2 - ldr r6, =0x00000be4 - adds r1, r2, r6 - adds r1, r4 - ldr r1, [r1] - mov r2, r8 - lsls r3, r2, 16 - asrs r3, 16 - movs r2, 0x2 - str r2, [sp] - ldr r6, [sp, 0x14] - str r6, [sp, 0x4] - mov r6, r10 - asrs r2, r6, 16 - bl sub_80CC230 - adds r2, r0, 0 - ldr r1, =0x02039d08 - ldr r0, [r1] - ldr r3, =0x00000a88 - adds r0, r3 - adds r1, r0, r4 - str r2, [r1] - cmp r2, 0 - beq _080CB3C2 - mov r6, sp - ldrh r6, [r6, 0x8] - strh r6, [r2, 0x30] - ldr r0, [r1] - mov r2, sp - ldrh r2, [r2, 0xC] - strh r2, [r0, 0x32] - ldr r0, [r1] - mov r3, sp - ldrh r3, [r3, 0x10] - strh r3, [r0, 0x34] - ldr r1, [r1] - ldr r0, =sub_80CB234 - str r0, [r1, 0x1C] - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_080CB3C2: - adds r0, r5, 0x6 - lsls r0, 24 - lsrs r5, r0, 24 - mov r0, r8 - adds r0, 0x18 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - subs r7, 0x1 - cmp r7, 0 - bge _080CB358 - b _080CB4A6 - .pool -_080CB3F0: - mov r10, r1 - movs r7, 0x4 - lsls r2, 16 - str r2, [sp, 0x18] -_080CB3F8: - mov r6, r10 - ldr r2, [r6] - lsls r0, r5, 1 - ldr r3, =0x00000ba8 - adds r1, r2, r3 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _080CB490 - lsls r4, r5, 2 - ldr r6, =0x00000be4 - adds r1, r2, r6 - adds r1, r4 - ldr r1, [r1] - mov r2, r8 - lsls r3, r2, 16 - asrs r3, 16 - movs r2, 0x2 - str r2, [sp] - ldr r6, [sp, 0x14] - str r6, [sp, 0x4] - ldr r6, [sp, 0x18] - asrs r2, r6, 16 - bl sub_80CC230 - adds r2, r0, 0 - mov r0, r10 - ldr r3, [r0] - ldr r1, =0x00000a88 - adds r0, r3, r1 - adds r1, r0, r4 - str r2, [r1] - cmp r2, 0 - beq _080CB490 - mov r6, sp - ldrh r6, [r6, 0x8] - strh r6, [r2, 0x30] - ldr r0, [r1] - mov r2, sp - ldrh r2, [r2, 0xC] - strh r2, [r0, 0x32] - ldr r0, [r1] - mov r6, sp - ldrh r6, [r6, 0x10] - strh r6, [r0, 0x34] - ldr r1, [r1] - ldr r0, =sub_80CB234 - str r0, [r1, 0x1C] - ldr r1, =0x00000c5c - adds r0, r3, r1 - ldrb r0, [r0] - adds r1, r5, 0 - movs r2, 0xC - bl get_pokemon_data_from_any_box - cmp r0, 0 - bne _080CB486 - mov r2, r10 - ldr r0, [r2] - ldr r3, =0x00000a88 - adds r0, r3 - adds r0, r4 - ldr r2, [r0] - ldrb r1, [r2, 0x1] - movs r6, 0xD - negs r6, r6 - adds r0, r6, 0 - ands r1, r0 - movs r0, 0x4 - orrs r1, r0 - strb r1, [r2, 0x1] -_080CB486: - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_080CB490: - adds r0, r5, 0x6 - lsls r0, 24 - lsrs r5, r0, 24 - mov r0, r8 - adds r0, 0x18 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - subs r7, 0x1 - cmp r7, 0 - bge _080CB3F8 -_080CB4A6: - mov r0, r9 - 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_80CB2F8 - - thumb_func_start sub_80CB4CC -sub_80CB4CC: @ 80CB4CC - push {r4-r7,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r6, =0x02039d08 - ldr r1, [r6] - ldr r2, =0x00000c6a - adds r1, r2 - movs r5, 0 - strb r5, [r1] - ldr r1, [r6] - ldr r3, =0x00000c6b - adds r1, r3 - strb r0, [r1] - ldr r1, [r6] - ldr r7, =0x00000c69 - adds r1, r7 - strb r4, [r1] - ldr r3, [r6] - movs r1, 0xC6 - lsls r1, 4 - adds r2, r3, r1 - movs r1, 0x20 - strh r1, [r2] - lsls r4, 24 - asrs r4, 24 - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 1 - negs r1, r1 - subs r7, 0x5 - adds r2, r3, r7 - strh r1, [r2] - ldr r1, =0x00000c66 - adds r3, r1 - strh r5, [r3] - bl sub_80CB6F0 - cmp r4, 0 - ble _080CB544 - ldr r0, [r6] - ldr r2, =0x00000c68 - adds r0, r2 - movs r1, 0 - b _080CB54C - .pool -_080CB544: - ldr r0, [r6] - ldr r3, =0x00000c68 - adds r0, r3 - movs r1, 0x5 -_080CB54C: - strb r1, [r0] - ldr r0, =0x02039d08 - ldr r2, [r0] - ldr r7, =0x00000c68 - adds r0, r2, r7 - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, 0x64 - ldr r3, =0x00000c62 - adds r1, r2, r3 - strh r0, [r1] - subs r7, 0x4 - adds r2, r7 - movs r1, 0 - ldrsh r0, [r2, r1] - bl sub_80CB1F0 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CB4CC - - thumb_func_start sub_80CB584 -sub_80CB584: @ 80CB584 - push {r4-r6,lr} - ldr r5, =0x02039d08 - ldr r0, [r5] - movs r4, 0xC6 - lsls r4, 4 - adds r1, r0, r4 - ldrh r0, [r1] - cmp r0, 0 - beq _080CB59A - subs r0, 0x1 - strh r0, [r1] -_080CB59A: - ldr r3, [r5] - ldr r6, =0x00000c6a - adds r0, r3, r6 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080CB61C - cmp r0, 0x1 - bgt _080CB5B8 - cmp r0, 0 - beq _080CB5C0 - b _080CB6DE - .pool -_080CB5B8: - cmp r0, 0x2 - bne _080CB5BE - b _080CB6CC -_080CB5BE: - b _080CB6DE -_080CB5C0: - ldr r0, =0x00000c62 - adds r1, r3, r0 - ldr r2, =0x00000c64 - adds r0, r3, r2 - ldrh r0, [r0] - ldrh r2, [r1] - adds r0, r2 - strh r0, [r1] - subs r0, 0x41 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xBA - bhi _080CB5DC - b _080CB6E8 -_080CB5DC: - ldr r1, =0x00000c68 - adds r0, r3, r1 - ldrb r0, [r0] - bl sub_80CB2B0 - ldr r2, [r5] - ldr r0, =0x00000c62 - adds r3, r2, r0 - ldr r1, =0x00000c69 - adds r0, r2, r1 - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - ldrh r1, [r3] - adds r0, r1 - strh r0, [r3] - adds r2, r6 - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - b _080CB6E8 - .pool -_080CB61C: - ldr r2, =0x00000c62 - adds r1, r3, r2 - ldr r6, =0x00000c64 - adds r2, r3, r6 - ldrh r0, [r2] - ldrh r6, [r1] - adds r0, r6 - strh r0, [r1] - ldr r6, =0x00000c68 - adds r0, r3, r6 - ldrb r0, [r0] - adds r1, r3, r4 - ldrh r1, [r1] - movs r3, 0 - ldrsh r2, [r2, r3] - bl sub_80CB2F8 - ldr r2, [r5] - ldr r3, =0x00000c66 - adds r1, r2, r3 - lsls r0, 24 - lsrs r0, 24 - ldrh r3, [r1] - adds r0, r3 - strh r0, [r1] - ldr r1, =0x00000c69 - adds r0, r2, r1 - movs r1, 0 - ldrsb r1, [r0, r1] - cmp r1, 0 - ble _080CB662 - adds r0, r2, r6 - ldrb r0, [r0] - cmp r0, 0x5 - beq _080CB66E -_080CB662: - cmp r1, 0 - bge _080CB69C - adds r0, r2, r6 - ldrb r0, [r0] - cmp r0, 0 - bne _080CB69C -_080CB66E: - ldr r0, =0x02039d08 - ldr r1, [r0] - ldr r2, =0x00000c6a - adds r1, r2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080CB6E8 - .pool -_080CB69C: - ldr r3, =0x02039d08 - ldr r0, [r3] - ldr r6, =0x00000c68 - adds r1, r0, r6 - ldr r2, =0x00000c69 - adds r0, r2 - ldrb r0, [r0] - ldrb r6, [r1] - adds r0, r6 - movs r2, 0 - strb r0, [r1] - ldr r0, [r3] - ldr r1, =0x00000c6a - adds r0, r1 - strb r2, [r0] - b _080CB6E8 - .pool -_080CB6CC: - ldr r2, =0x00000c66 - adds r0, r3, r2 - ldrh r0, [r0] - cmp r0, 0 - bne _080CB6E8 - adds r1, r3, r4 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_080CB6DE: - movs r0, 0 - b _080CB6EA - .pool -_080CB6E8: - movs r0, 0x1 -_080CB6EA: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80CB584 - - thumb_func_start sub_80CB6F0 -sub_80CB6F0: @ 80CB6F0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - movs r0, 0 - ldr r1, =0x02039d08 - mov r9, r1 -_080CB704: - adds r0, 0x1 - mov r8, r0 - movs r7, 0x5 -_080CB70A: - lsls r0, r5, 24 - lsrs r4, r0, 24 - adds r0, r6, 0 - adds r1, r4, 0 - movs r2, 0x41 - bl get_pokemon_data_from_any_box - mov r2, r9 - ldr r1, [r2] - lsls r2, r5, 1 - ldr r3, =0x00000ba8 - adds r1, r3 - adds r1, r2 - strh r0, [r1] - lsls r0, 16 - cmp r0, 0 - beq _080CB744 - adds r0, r6, 0 - adds r1, r4, 0 - movs r2, 0 - bl get_pokemon_data_from_any_box - mov r2, r9 - ldr r1, [r2] - lsls r2, r5, 2 - ldr r3, =0x00000be4 - adds r1, r3 - adds r1, r2 - str r0, [r1] -_080CB744: - adds r5, 0x1 - subs r7, 0x1 - cmp r7, 0 - bge _080CB70A - mov r0, r8 - cmp r0, 0x4 - ble _080CB704 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x00000c5c - adds r0, r1 - strb r6, [r0] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CB6F0 - - thumb_func_start sub_80CB778 -sub_80CB778: @ 80CB778 - push {r4,r5,lr} - lsls r0, 24 - ldr r5, =0x02039d08 - ldr r1, [r5] - lsrs r4, r0, 22 - ldr r0, =0x00000a88 - adds r1, r0 - adds r1, r4 - ldr r0, [r1] - cmp r0, 0 - beq _080CB79E - bl sub_80CC314 - ldr r0, [r5] - ldr r1, =0x00000a88 - adds r0, r1 - adds r0, r4 - movs r1, 0 - str r1, [r0] -_080CB79E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CB778 - - thumb_func_start sub_80CB7AC -sub_80CB7AC: @ 80CB7AC - push {lr} - lsls r0, 24 - lsls r1, 24 - lsrs r2, r1, 24 - ldr r1, =0x02039d08 - ldr r1, [r1] - lsrs r0, 22 - ldr r3, =0x00000a88 - adds r1, r3 - adds r1, r0 - ldr r3, [r1] - cmp r3, 0 - beq _080CB7DA - movs r0, 0x3 - adds r1, r2, 0 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x1] -_080CB7DA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CB7AC - - thumb_func_start sub_80CB7E8 -sub_80CB7E8: @ 80CB7E8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r4, =0x020244ec - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - adds r1, r0, 0 - movs r0, 0x1 - str r0, [sp] - movs r0, 0xC - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r2, 0x68 - movs r3, 0x40 - bl sub_80CC230 - ldr r1, =0x02039d08 - ldr r1, [r1] - movs r2, 0xA7 - lsls r2, 4 - adds r1, r2 - str r0, [r1] - movs r7, 0x1 - movs r6, 0x1 -_080CB830: - movs r0, 0x64 - adds r1, r6, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - beq _080CB894 - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - adds r1, r0, 0 - subs r0, r6, 0x1 - lsls r3, r0, 1 - adds r3, r0 - lsls r3, 19 - movs r0, 0x80 - lsls r0, 13 - adds r3, r0 - asrs r3, 16 - movs r0, 0x1 - str r0, [sp] - movs r0, 0xC - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r2, 0x98 - bl sub_80CC230 - ldr r1, =0x02039d08 - ldr r1, [r1] - lsls r2, r6, 2 - movs r3, 0xA7 - lsls r3, 4 - adds r1, r3 - adds r1, r2 - str r0, [r1] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - b _080CB8A4 - .pool -_080CB894: - ldr r0, =0x02039d08 - ldr r0, [r0] - lsls r1, r6, 2 - movs r2, 0xA7 - lsls r2, 4 - adds r0, r2 - adds r0, r1 - str r5, [r0] -_080CB8A4: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x5 - bls _080CB830 - ldr r3, =0x02039d08 - mov r0, r8 - cmp r0, 0 - bne _080CB8EA - movs r6, 0 - cmp r6, r7 - bcs _080CB8EA - mov r12, r3 - movs r5, 0xA7 - lsls r5, 4 - movs r4, 0x4 -_080CB8C4: - mov r2, r12 - ldr r1, [r2] - lsls r0, r6, 2 - adds r1, r5 - adds r1, r0 - ldr r2, [r1] - ldrh r0, [r2, 0x22] - subs r0, 0xA0 - strh r0, [r2, 0x22] - ldr r1, [r1] - adds r1, 0x3E - ldrb r0, [r1] - orrs r0, r4 - strb r0, [r1] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, r7 - bcc _080CB8C4 -_080CB8EA: - ldr r0, [r3] - ldrb r0, [r0, 0x1] - cmp r0, 0x3 - bne _080CB93C - movs r6, 0 - adds r7, r3, 0 - movs r5, 0xA7 - lsls r5, 4 -_080CB8FA: - ldr r0, [r7] - lsls r4, r6, 2 - adds r0, r5 - adds r0, r4 - ldr r0, [r0] - cmp r0, 0 - beq _080CB932 - movs r0, 0x64 - muls r0, r6 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xC - bl pokemon_getattr - cmp r0, 0 - bne _080CB932 - ldr r0, [r7] - adds r0, r5 - adds r0, r4 - ldr r2, [r0] - ldrb r1, [r2, 0x1] - movs r3, 0xD - negs r3, r3 - adds r0, r3, 0 - ands r1, r0 - movs r0, 0x4 - orrs r1, r0 - strb r1, [r2, 0x1] -_080CB932: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x5 - bls _080CB8FA -_080CB93C: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CB7E8 - - thumb_func_start sub_80CB950 -sub_80CB950: @ 80CB950 - push {r4-r7,lr} - sub sp, 0x4 - ldr r0, =0x02039d08 - ldr r1, [r0] - ldr r2, =0x00000c5e - adds r1, r2 - movs r2, 0 - strb r2, [r1] - movs r5, 0 - movs r6, 0 - adds r3, r0, 0 - movs r7, 0xA7 - lsls r7, 4 -_080CB96A: - ldr r0, [r3] - lsls r4, r5, 2 - adds r0, r7 - adds r0, r4 - ldr r0, [r0] - cmp r0, 0 - beq _080CB9A0 - cmp r5, r6 - beq _080CB99A - adds r1, r6, 0 - str r3, [sp] - bl sub_80CB9D0 - ldr r3, [sp] - ldr r2, [r3] - adds r0, r2, r7 - adds r0, r4 - movs r1, 0 - str r1, [r0] - ldr r0, =0x00000c5e - adds r2, r0 - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] -_080CB99A: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 -_080CB9A0: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x5 - bls _080CB96A - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CB950 - - thumb_func_start sub_80CB9BC -sub_80CB9BC: @ 80CB9BC - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x00000c5e - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80CB9BC - - thumb_func_start sub_80CB9D0 -sub_80CB9D0: @ 80CB9D0 - push {r4,lr} - adds r2, r0, 0 - lsls r1, 16 - lsrs r1, 16 - strh r1, [r2, 0x30] - cmp r1, 0 - bne _080CB9E4 - movs r3, 0x68 - movs r4, 0x40 - b _080CB9F6 -_080CB9E4: - movs r3, 0x98 - subs r1, 0x1 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 19 - movs r1, 0x80 - lsls r1, 13 - adds r0, r1 - lsrs r4, r0, 16 -_080CB9F6: - ldrh r0, [r2, 0x20] - lsls r0, 3 - strh r0, [r2, 0x32] - ldrh r0, [r2, 0x22] - lsls r0, 3 - strh r0, [r2, 0x34] - lsls r1, r3, 3 - movs r3, 0x32 - ldrsh r0, [r2, r3] - subs r0, r1, r0 - cmp r0, 0 - bge _080CBA10 - adds r0, 0x7 -_080CBA10: - asrs r0, 3 - strh r0, [r2, 0x36] - lsls r0, r4, 16 - asrs r0, 13 - movs r3, 0x34 - ldrsh r1, [r2, r3] - subs r0, r1 - cmp r0, 0 - bge _080CBA24 - adds r0, 0x7 -_080CBA24: - asrs r0, 3 - strh r0, [r2, 0x38] - movs r0, 0x8 - strh r0, [r2, 0x3A] - ldr r0, =sub_80CBA3C - str r0, [r2, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CB9D0 - - thumb_func_start sub_80CBA3C -sub_80CBA3C: @ 80CBA3C - push {r4,lr} - adds r3, r0, 0 - ldrh r2, [r3, 0x3A] - movs r1, 0x3A - ldrsh r0, [r3, r1] - cmp r0, 0 - beq _080CBA6C - ldrh r0, [r3, 0x36] - ldrh r4, [r3, 0x32] - adds r0, r4 - strh r0, [r3, 0x32] - ldrh r1, [r3, 0x38] - ldrh r4, [r3, 0x34] - adds r1, r4 - strh r1, [r3, 0x34] - lsls r0, 16 - asrs r0, 19 - strh r0, [r3, 0x20] - lsls r1, 16 - asrs r1, 19 - strh r1, [r3, 0x22] - subs r0, r2, 0x1 - strh r0, [r3, 0x3A] - b _080CBAB2 -_080CBA6C: - movs r1, 0x30 - ldrsh r0, [r3, r1] - cmp r0, 0 - bne _080CBA7C - movs r0, 0x68 - strh r0, [r3, 0x20] - movs r0, 0x40 - b _080CBA8E -_080CBA7C: - movs r0, 0x98 - strh r0, [r3, 0x20] - movs r4, 0x30 - ldrsh r1, [r3, r4] - subs r1, 0x1 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, 0x10 -_080CBA8E: - strh r0, [r3, 0x22] - ldr r0, =DummyObjectCallback - str r0, [r3, 0x1C] - ldr r0, =0x02039d08 - ldr r2, [r0] - movs r0, 0x30 - ldrsh r1, [r3, r0] - lsls r1, 2 - movs r4, 0xA7 - lsls r4, 4 - adds r0, r2, r4 - adds r0, r1 - str r3, [r0] - ldr r0, =0x00000c5e - adds r2, r0 - ldrb r0, [r2] - subs r0, 0x1 - strb r0, [r2] -_080CBAB2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CBA3C - - thumb_func_start sub_80CBAC4 -sub_80CBAC4: @ 80CBAC4 - push {r4,lr} - ldr r4, =0x02039d08 - ldr r0, [r4] - ldr r1, =0x00000a6c - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - beq _080CBAE2 - bl sub_80CC314 - ldr r0, [r4] - ldr r1, =0x00000a6c - adds r0, r1 - movs r1, 0 - str r1, [r0] -_080CBAE2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CBAC4 - - thumb_func_start sub_80CBAF0 -sub_80CBAF0: @ 80CBAF0 - push {r4-r6,lr} - movs r3, 0 - ldr r6, =0x02039d08 - lsls r0, 16 - asrs r4, r0, 16 - movs r5, 0x5 - negs r5, r5 -_080CBAFE: - ldr r0, [r6] - lsls r1, r3, 2 - movs r2, 0xA7 - lsls r2, 4 - adds r0, r2 - adds r2, r0, r1 - ldr r1, [r2] - cmp r1, 0 - beq _080CBB56 - ldrh r0, [r1, 0x22] - adds r0, r4, r0 - strh r0, [r1, 0x22] - ldr r2, [r2] - ldrh r1, [r2, 0x26] - ldrh r0, [r2, 0x22] - adds r1, r0 - adds r0, r2, 0 - adds r0, 0x29 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - adds r0, r1 - lsls r0, 16 - movs r1, 0x80 - lsls r1, 13 - adds r0, r1 - lsrs r0, 16 - cmp r0, 0xC0 - bls _080CBB4C - adds r0, r2, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - b _080CBB56 - .pool -_080CBB4C: - adds r2, 0x3E - ldrb r1, [r2] - adds r0, r5, 0 - ands r0, r1 - strb r0, [r2] -_080CBB56: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x5 - bls _080CBAFE - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80CBAF0 - - thumb_func_start sub_80CBB68 -sub_80CBB68: @ 80CBB68 - push {r4,r5,lr} - lsls r0, 24 - ldr r5, =0x02039d08 - ldr r1, [r5] - lsrs r4, r0, 22 - movs r0, 0xA7 - lsls r0, 4 - adds r1, r0 - adds r1, r4 - ldr r0, [r1] - cmp r0, 0 - beq _080CBB92 - bl sub_80CC314 - ldr r0, [r5] - movs r1, 0xA7 - lsls r1, 4 - adds r0, r1 - adds r0, r4 - movs r1, 0 - str r1, [r0] -_080CBB92: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CBB68 - - thumb_func_start sub_80CBB9C -sub_80CBB9C: @ 80CBB9C - push {r4-r6,lr} - movs r5, 0 - ldr r6, =0x02039d08 -_080CBBA2: - ldr r0, [r6] - lsls r4, r5, 2 - movs r1, 0xA7 - lsls r1, 4 - adds r0, r1 - adds r0, r4 - ldr r0, [r0] - cmp r0, 0 - beq _080CBBC6 - bl sub_80CC314 - ldr r0, [r6] - movs r1, 0xA7 - lsls r1, 4 - adds r0, r1 - adds r0, r4 - movs r1, 0 - str r1, [r0] -_080CBBC6: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x5 - bls _080CBBA2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CBB9C - - thumb_func_start sub_80CBBDC -sub_80CBBDC: @ 80CBBDC - push {lr} - lsls r0, 24 - lsls r1, 24 - lsrs r2, r1, 24 - ldr r1, =0x02039d08 - ldr r1, [r1] - lsrs r0, 22 - movs r3, 0xA7 - lsls r3, 4 - adds r1, r3 - adds r1, r0 - ldr r3, [r1] - cmp r3, 0 - beq _080CBC0C - movs r0, 0x3 - adds r1, r2, 0 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x1] -_080CBC0C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CBBDC - - thumb_func_start sub_80CBC14 -sub_80CBC14: @ 80CBC14 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r1, 24 - adds r5, r1, 0 - cmp r4, 0 - bne _080CBC44 - ldr r3, =0x02039d08 - ldr r0, [r3] - ldr r5, =0x00000a6c - adds r2, r0, r5 - lsls r1, 2 - adds r5, 0x4 - adds r0, r5 - adds r0, r1 - ldr r1, [r0] - str r1, [r2] - str r4, [r0] - b _080CBC60 - .pool -_080CBC44: - cmp r4, 0x1 - bne _080CBC96 - ldr r3, =0x02039d08 - ldr r0, [r3] - ldr r1, =0x00000a6c - adds r2, r0, r1 - lsls r1, r5, 2 - ldr r4, =0x00000a88 - adds r0, r4 - adds r0, r1 - ldr r1, [r0] - str r1, [r2] - movs r1, 0 - str r1, [r0] -_080CBC60: - adds r5, r3, 0 - ldr r0, [r5] - ldr r4, =0x00000a6c - adds r0, r4 - ldr r1, [r0] - ldr r0, =sub_80CC100 - str r0, [r1, 0x1C] - bl sub_80CAFAC - ldr r1, [r5] - adds r1, r4 - ldr r3, [r1] - movs r1, 0x3 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x5] - ldr r0, [r5] - adds r0, r4 - ldr r0, [r0] - adds r0, 0x43 - movs r1, 0x7 - strb r1, [r0] -_080CBC96: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CBC14 - - thumb_func_start sub_80CBCAC -sub_80CBCAC: @ 80CBCAC - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - cmp r0, 0xE - bne _080CBCF8 - ldr r3, =0x02039d08 - ldr r1, [r3] - lsls r5, r6, 2 - movs r4, 0xA7 - lsls r4, 4 - adds r0, r1, r4 - adds r0, r5 - ldr r2, =0x00000a6c - adds r1, r2 - ldr r2, [r1] - str r2, [r0] - ldrb r1, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0x5] - ldr r0, [r3] - adds r0, r4 - adds r0, r5 - ldr r0, [r0] - adds r0, 0x43 - movs r1, 0xC - strb r1, [r0] - b _080CBD34 - .pool -_080CBCF8: - ldr r5, =0x02039d08 - ldr r1, [r5] - lsls r4, r6, 2 - ldr r3, =0x00000a88 - adds r0, r1, r3 - adds r0, r4 - ldr r2, =0x00000a6c - adds r1, r2 - ldr r2, [r1] - str r2, [r0] - ldrb r1, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r2, 0x5] - ldr r0, [r5] - adds r0, r3 - adds r0, r4 - ldr r4, [r0] - adds r0, r6, 0 - movs r1, 0x6 - bl __umodsi3 - movs r1, 0x13 - subs r1, r0 - adds r4, 0x43 - strb r1, [r4] - adds r3, r5, 0 -_080CBD34: - ldr r1, [r3] - ldr r0, =0x00000a6c - adds r1, r0 - ldr r2, [r1] - ldr r0, =DummyObjectCallback - str r0, [r2, 0x1C] - movs r0, 0 - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CBCAC - - thumb_func_start sub_80CBD5C -sub_80CBD5C: @ 80CBD5C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - cmp r0, 0xE - bne _080CBD80 - ldr r3, =0x02039d08 - ldr r1, [r3] - movs r0, 0xB0 - lsls r0, 4 - adds r2, r1, r0 - lsls r0, r4, 2 - movs r4, 0xA7 - lsls r4, 4 - b _080CBD8E - .pool -_080CBD80: - ldr r3, =0x02039d08 - ldr r1, [r3] - movs r0, 0xB0 - lsls r0, 4 - adds r2, r1, r0 - lsls r0, r4, 2 - ldr r4, =0x00000a88 -_080CBD8E: - adds r0, r4 - adds r1, r0 - str r1, [r2] - ldr r1, [r3] - ldr r2, =0x00000a6c - adds r0, r1, r2 - ldr r2, [r0] - ldr r0, =DummyObjectCallback - str r0, [r2, 0x1C] - ldr r4, =0x00000c5d - adds r1, r4 - movs r0, 0 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CBD5C - - thumb_func_start sub_80CBDC4 -sub_80CBDC4: @ 80CBDC4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r6, =0x02039d08 - ldr r0, [r6] - ldr r1, =0x00000c5d - mov r9, r1 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0x10 - bne _080CBDE8 - movs r0, 0 - b _080CBEF4 - .pool -_080CBDE8: - adds r0, 0x1 - strb r0, [r1] - ldr r2, [r6] - ldr r5, =0x00000c5d - adds r0, r2, r5 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080CBE18 - movs r1, 0xB0 - lsls r1, 4 - adds r0, r2, r1 - ldr r0, [r0] - ldr r1, [r0] - ldrh r0, [r1, 0x22] - subs r0, 0x1 - strh r0, [r1, 0x22] - ldr r5, =0x00000a6c - adds r0, r2, r5 - ldr r1, [r0] - ldrh r0, [r1, 0x22] - adds r0, 0x1 - strh r0, [r1, 0x22] -_080CBE18: - ldr r3, [r6] - movs r7, 0xB0 - lsls r7, 4 - adds r4, r3, r7 - ldr r0, [r4] - ldr r0, [r0] - mov r8, r0 - ldr r5, =gUnknown_08329F40 - mov r0, r9 - adds r1, r3, r0 - ldrb r0, [r1] - lsls r0, 4 - adds r0, r5 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0 - bge _080CBE3C - adds r0, 0xF -_080CBE3C: - asrs r0, 4 - mov r2, r8 - strh r0, [r2, 0x24] - ldr r0, =0x00000a6c - mov r8, r0 - add r3, r8 - ldr r2, [r3] - ldrb r0, [r1] - lsls r0, 4 - adds r0, r5 - movs r5, 0 - ldrsh r0, [r0, r5] - cmp r0, 0 - bge _080CBE5A - adds r0, 0xF -_080CBE5A: - asrs r0, 4 - negs r0, r0 - strh r0, [r2, 0x24] - ldrb r0, [r1] - cmp r0, 0x8 - bne _080CBEBE - ldr r3, [r3] - ldr r0, [r4] - ldr r0, [r0] - ldrb r0, [r0, 0x5] - movs r5, 0x3 - movs r1, 0xC - ands r1, r0 - ldrb r2, [r3, 0x5] - movs r4, 0xD - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x5] - ldr r0, [r6] - mov r2, r8 - adds r1, r0, r2 - ldr r1, [r1] - adds r0, r7 - ldr r0, [r0] - ldr r0, [r0] - adds r0, 0x43 - ldrb r0, [r0] - adds r1, 0x43 - strb r0, [r1] - bl sub_80CAFAC - ldr r1, [r6] - adds r1, r7 - ldr r1, [r1] - ldr r1, [r1] - ands r5, r0 - lsls r5, 2 - ldrb r0, [r1, 0x5] - ands r4, r0 - orrs r4, r5 - strb r4, [r1, 0x5] - ldr r0, [r6] - adds r0, r7 - ldr r0, [r0] - ldr r0, [r0] - adds r0, 0x43 - movs r1, 0x7 - strb r1, [r0] -_080CBEBE: - ldr r1, [r6] - mov r5, r9 - adds r0, r1, r5 - ldrb r0, [r0] - cmp r0, 0x10 - bne _080CBEF2 - mov r0, r8 - adds r2, r1, r0 - ldr r3, [r2] - adds r1, r7 - ldr r0, [r1] - ldr r0, [r0] - str r0, [r2] - ldr r0, [r1] - str r3, [r0] - ldr r1, [r6] - mov r2, r8 - adds r0, r1, r2 - ldr r2, [r0] - ldr r0, =sub_80CC100 - str r0, [r2, 0x1C] - adds r1, r7 - ldr r0, [r1] - ldr r1, [r0] - ldr r0, =DummyObjectCallback - str r0, [r1, 0x1C] -_080CBEF2: - movs r0, 0x1 -_080CBEF4: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80CBDC4 - - thumb_func_start sub_80CBF14 -sub_80CBF14: @ 80CBF14 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - adds r2, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - cmp r0, 0x1 - beq _080CBF4C - cmp r0, 0x1 - bgt _080CBF2E - cmp r0, 0 - beq _080CBF34 - b _080CBFC0 -_080CBF2E: - cmp r2, 0x2 - beq _080CBF70 - b _080CBFC0 -_080CBF34: - ldr r3, =0x02039d08 - ldr r1, [r3] - ldr r0, =0x00000b04 - adds r2, r1, r0 - lsls r0, r4, 2 - movs r4, 0xA7 - lsls r4, 4 - b _080CBF58 - .pool -_080CBF4C: - ldr r3, =0x02039d08 - ldr r1, [r3] - ldr r0, =0x00000b04 - adds r2, r1, r0 - lsls r0, r4, 2 - ldr r4, =0x00000a88 -_080CBF58: - adds r0, r4 - adds r1, r0 - str r1, [r2] - adds r4, r3, 0 - b _080CBF80 - .pool -_080CBF70: - ldr r0, =0x02039d08 - ldr r1, [r0] - ldr r3, =0x00000b04 - adds r2, r1, r3 - ldr r4, =0x00000a6c - adds r1, r4 - str r1, [r2] - adds r4, r0, 0 -_080CBF80: - ldr r0, [r4] - ldr r1, =0x00000b04 - adds r0, r1 - ldr r0, [r0] - ldr r0, [r0] - cmp r0, 0 - beq _080CBFC0 - bl obj_alloc_rotscale_entry - ldr r0, [r4] - ldr r3, =0x00000b04 - adds r0, r3 - ldr r0, [r0] - ldr r2, [r0] - ldrb r1, [r2, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x1] - ldr r1, [r4] - adds r1, r3 - ldr r0, [r1] - ldr r2, [r0] - ldr r0, =gUnknown_0857291C - str r0, [r2, 0x10] - ldr r0, [r1] - ldr r0, [r0] - movs r1, 0 - bl StartObjectRotScalAnim -_080CBFC0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CBF14 - - thumb_func_start sub_80CBFD8 -sub_80CBFD8: @ 80CBFD8 - push {lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x00000b04 - adds r0, r1 - ldr r0, [r0] - ldr r1, [r0] - cmp r1, 0 - beq _080CBFF8 - adds r3, r1, 0 - adds r3, 0x3E - ldrb r2, [r3] - movs r0, 0x4 - ands r0, r2 - cmp r0, 0 - beq _080CC004 -_080CBFF8: - movs r0, 0 - b _080CC01A - .pool -_080CC004: - adds r0, r1, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080CC018 - movs r0, 0x4 - orrs r0, r2 - strb r0, [r3] -_080CC018: - movs r0, 0x1 -_080CC01A: - pop {r1} - bx r1 - thumb_func_end sub_80CBFD8 - - thumb_func_start sub_80CC020 -sub_80CC020: @ 80CC020 - push {r4,lr} - ldr r4, =0x02039d08 - ldr r0, [r4] - ldr r1, =0x00000b04 - adds r0, r1 - ldr r0, [r0] - ldr r0, [r0] - cmp r0, 0 - beq _080CC056 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - ldr r0, [r4] - ldr r1, =0x00000b04 - adds r0, r1 - ldr r0, [r0] - ldr r0, [r0] - bl sub_80CC314 - ldr r0, [r4] - ldr r1, =0x00000b04 - adds r0, r1 - ldr r1, [r0] - movs r0, 0 - str r0, [r1] -_080CC056: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CC020 - - thumb_func_start sub_80CC064 -sub_80CC064: @ 80CC064 - push {lr} - ldr r3, =0x02039d08 - ldr r0, [r3] - ldr r1, =0x00000b04 - adds r0, r1 - ldr r0, [r0] - ldr r0, [r0] - cmp r0, 0 - beq _080CC094 - adds r2, r0, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r0, [r3] - ldr r1, =0x00000b04 - adds r0, r1 - ldr r0, [r0] - ldr r0, [r0] - movs r1, 0x1 - bl StartObjectRotScalAnim -_080CC094: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CC064 - - thumb_func_start sub_80CC0A0 -sub_80CC0A0: @ 80CC0A0 - push {lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x00000b04 - adds r2, r0, r1 - ldr r0, [r2] - cmp r0, 0 - bne _080CC0BC - movs r0, 0 - b _080CC0D0 - .pool -_080CC0BC: - ldr r0, [r0] - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080CC0CE - movs r0, 0 - str r0, [r2] -_080CC0CE: - movs r0, 0x1 -_080CC0D0: - pop {r1} - bx r1 - thumb_func_end sub_80CC0A0 - - thumb_func_start sub_80CC0D4 -sub_80CC0D4: @ 80CC0D4 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02039d08 - ldr r1, [r1] - ldr r2, =0x00000a6c - adds r1, r2 - ldr r3, [r1] - movs r1, 0x3 - ands r0, r1 - lsls r0, 2 - ldrb r2, [r3, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x5] - bx lr - .pool - thumb_func_end sub_80CC0D4 - - thumb_func_start sub_80CC100 -sub_80CC100: @ 80CC100 - ldr r1, =0x02039d08 - ldr r1, [r1] - ldr r2, =0x00000cb4 - adds r1, r2 - ldr r2, [r1] - ldrh r2, [r2, 0x20] - strh r2, [r0, 0x20] - ldr r2, [r1] - ldrh r1, [r2, 0x26] - ldrh r2, [r2, 0x22] - adds r1, r2 - adds r1, 0x4 - strh r1, [r0, 0x22] - bx lr - .pool - thumb_func_end sub_80CC100 - - thumb_func_start sub_80CC124 -sub_80CC124: @ 80CC124 - push {r4-r6,lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r4, 0 - ldr r1, =0x02039d08 - ldr r0, [r1] - ldr r2, =0x00000b58 - adds r0, r2 - ldrh r0, [r0] - adds r2, r1, 0 - cmp r0, r3 - beq _080CC158 - adds r6, r2, 0 - ldr r5, =0x00000b58 -_080CC140: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x27 - bhi _080CC158 - ldr r0, [r6] - lsls r1, r4, 1 - adds r0, r5 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r3 - bne _080CC140 -_080CC158: - cmp r4, 0x28 - bne _080CC198 - movs r4, 0 - ldr r0, [r2] - ldr r5, =0x00000b58 - adds r0, r5 - ldrh r0, [r0] - cmp r0, 0 - beq _080CC184 - adds r6, r2, 0 -_080CC16C: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x27 - bhi _080CC184 - ldr r0, [r6] - lsls r1, r4, 1 - adds r0, r5 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - bne _080CC16C -_080CC184: - cmp r4, 0x28 - bne _080CC198 - ldr r0, =0x0000ffff - b _080CC1CA - .pool -_080CC198: - ldr r1, [r2] - lsls r2, r4, 1 - ldr r5, =0x00000b58 - adds r0, r1, r5 - adds r0, r2 - strh r3, [r0] - ldr r0, =0x00000b08 - adds r1, r0 - adds r1, r2 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - lsls r4, 20 - lsrs r4, 16 - adds r0, r3, 0 - movs r1, 0x1 - bl GetMonIconTiles - lsls r1, r4, 5 - ldr r2, =0x06010000 - adds r1, r2 - ldr r2, =0x04000080 - bl CpuSet - adds r0, r4, 0 -_080CC1CA: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80CC124 - - thumb_func_start sub_80CC1E0 -sub_80CC1E0: @ 80CC1E0 - push {r4-r6,lr} - lsls r0, 16 - lsrs r5, r0, 16 - movs r3, 0 - ldr r6, =0x02039d08 -_080CC1EA: - ldr r1, [r6] - lsls r2, r3, 1 - ldr r4, =0x00000b58 - adds r0, r1, r4 - adds r4, r0, r2 - ldrh r0, [r4] - cmp r0, r5 - bne _080CC220 - ldr r0, =0x00000b08 - adds r1, r0 - adds r1, r2 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _080CC22A - strh r0, [r4] - b _080CC22A - .pool -_080CC220: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x27 - bls _080CC1EA -_080CC22A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80CC1E0 - - thumb_func_start sub_80CC230 -sub_80CC230: @ 80CC230 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - ldr r4, [sp, 0x3C] - ldr r5, [sp, 0x40] - lsls r0, 16 - lsrs r6, r0, 16 - lsls r2, 16 - lsrs r2, 16 - str r2, [sp, 0x18] - lsls r3, 16 - lsrs r3, 16 - mov r8, r3 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - mov r9, r5 - mov r2, sp - ldr r0, =gUnknown_085728D4 - ldm r0!, {r3,r5,r7} - stm r2!, {r3,r5,r7} - ldm r0!, {r3,r5,r7} - stm r2!, {r3,r5,r7} - adds r0, r6, 0 - bl mon_icon_convert_unown_species_id - mov r10, r0 - mov r6, r10 - mov r2, sp - ldr r1, =gMonIconPaletteIndices - adds r1, r6, r1 - ldr r3, =0x0000dac0 - adds r0, r3, 0 - ldrb r1, [r1] - adds r0, r1 - strh r0, [r2, 0x2] - adds r0, r6, 0 - bl sub_80CC124 - lsls r0, 16 - lsrs r0, 16 - adds r5, r0, 0 - ldr r0, =0x0000ffff - cmp r5, r0 - beq _080CC302 - ldr r7, [sp, 0x18] - lsls r1, r7, 16 - asrs r1, 16 - mov r0, r8 - lsls r2, r0, 16 - asrs r2, 16 - mov r0, sp - mov r3, r9 - bl AddObjectToFront - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - beq _080CC2FC - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldr r2, =0x000003ff - ands r2, r5 - ldrh r3, [r0, 0x4] - ldr r1, =0xfffffc00 - ands r1, r3 - orrs r1, r2 - strh r1, [r0, 0x4] - movs r1, 0x3 - ands r4, r1 - lsls r3, r4, 2 - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - orrs r1, r3 - strb r1, [r0, 0x5] - mov r1, r10 - strh r1, [r0, 0x2E] - b _080CC304 - .pool -_080CC2FC: - adds r0, r6, 0 - bl sub_80CC1E0 -_080CC302: - movs r0, 0 -_080CC304: - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80CC230 - - thumb_func_start sub_80CC314 -sub_80CC314: @ 80CC314 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - bl sub_80CC1E0 - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80CC314 - - thumb_func_start sub_80CC32C -sub_80CC32C: @ 80CC32C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =sub_80CC370 - movs r1, 0x2 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0xC] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CC32C - - thumb_func_start sub_80CC35C -sub_80CC35C: @ 80CC35C - push {lr} - ldr r0, =sub_80CC370 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80CC35C - - thumb_func_start sub_80CC370 -sub_80CC370: @ 80CC370 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bhi _080CC454 - lsls r0, 2 - ldr r1, =_080CC39C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080CC39C: - .4byte _080CC3B0 - .4byte _080CC3E8 - .4byte _080CC41C - .4byte _080CC426 - .4byte _080CC44C -_080CC3B0: - ldr r1, =0x02039d08 - ldr r0, [r1] - ldr r2, =0x000002d2 - adds r0, r2 - movs r2, 0 - strb r2, [r0] - ldr r1, [r1] - movs r3, 0xB3 - lsls r3, 2 - adds r0, r1, r3 - strh r2, [r0] - ldr r0, =0x00004ac4 - adds r1, r0 - movs r2, 0x80 - lsls r2, 5 - movs r0, 0 - movs r3, 0x1 - bl RequestDma3Fill - strh r0, [r4, 0xA] - b _080CC458 - .pool -_080CC3E8: - movs r1, 0xA - ldrsh r0, [r4, r1] - bl CheckForSpaceForDma3Request - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080CC45E - ldr r0, =0x02039d08 - ldr r1, [r0] - ldr r2, =0x00004ac4 - adds r1, r2 - movs r0, 0x2 - bl SetBgTilemapBuffer - movs r0, 0x2 - bl ShowBg - b _080CC458 - .pool -_080CC41C: - ldrb r0, [r4, 0xC] - movs r1, 0 - bl sub_80CC7A0 - b _080CC458 -_080CC426: - bl sub_80CCA00 - cmp r0, 0 - beq _080CC45E - ldrb r0, [r4, 0xC] - bl sub_80CCB50 - bl sub_80CD02C - ldrb r0, [r4, 0xC] - bl sub_80CB028 - ldr r1, =0x00005b0a - movs r0, 0xC - bl SetGpuReg - b _080CC458 - .pool -_080CC44C: - adds r0, r2, 0 - bl DestroyTask - b _080CC458 -_080CC454: - movs r0, 0 - b _080CC45C -_080CC458: - ldrh r0, [r4, 0x8] - adds r0, 0x1 -_080CC45C: - strh r0, [r4, 0x8] -_080CC45E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80CC370 - - thumb_func_start sub_80CC464 -sub_80CC464: @ 80CC464 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r4, r0, 24 - mov r8, r4 - adds r0, r4, 0 - bl sub_80CC644 - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - ldr r5, =0x02039d08 - ldr r2, [r5] - lsls r0, r6, 24 - asrs r3, r0, 24 - movs r0, 0x6 - negs r0, r0 - adds r1, r0, 0 - cmp r3, 0 - ble _080CC490 - movs r1, 0x6 -_080CC490: - ldr r7, =0x000002ce - adds r0, r2, r7 - strh r1, [r0] - movs r1, 0x2 - cmp r3, 0 - ble _080CC49E - movs r1, 0x1 -_080CC49E: - ldr r7, =0x000002d3 - adds r0, r2, r7 - strb r1, [r0] - ldr r2, [r5] - movs r0, 0xB4 - lsls r0, 2 - adds r1, r2, r0 - movs r0, 0x20 - strh r0, [r1] - movs r1, 0xB5 - lsls r1, 2 - adds r0, r2, r1 - strb r4, [r0] - ldr r2, [r5] - movs r1, 0 - cmp r3, 0 - bgt _080CC4C2 - movs r1, 0x5 -_080CC4C2: - ldr r4, =0x000002d6 - adds r0, r2, r4 - strh r1, [r0] - movs r7, 0xB6 - lsls r7, 2 - adds r0, r2, r7 - strh r3, [r0] - movs r1, 0x38 - cmp r3, 0 - ble _080CC4DC - movs r0, 0x84 - lsls r0, 1 - adds r1, r0, 0 -_080CC4DC: - ldr r4, =0x000002da - adds r0, r2, r4 - strh r1, [r0] - movs r1, 0 - cmp r3, 0 - bgt _080CC4EA - movs r1, 0x5 -_080CC4EA: - movs r7, 0xB7 - lsls r7, 2 - adds r0, r2, r7 - strh r1, [r0] - ldr r0, =0x000002de - adds r1, r2, r0 - movs r0, 0 - strh r0, [r1] - movs r3, 0xB8 - lsls r3, 2 - adds r1, r2, r3 - movs r0, 0x2 - strh r0, [r1] - ldr r4, =0x00000a64 - adds r0, r2, r4 - mov r7, r8 - strb r7, [r0] - ldr r0, [r5] - ldr r1, =0x00000a65 - adds r0, r1 - strb r6, [r0] - ldr r0, [r5] - ldr r3, =0x00000a63 - adds r0, r3 - movs r1, 0 - strb r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CC464 - - thumb_func_start sub_80CC54C -sub_80CC54C: @ 80CC54C - push {r4-r6,lr} - ldr r4, =0x02039d08 - ldr r1, [r4] - ldr r5, =0x00000a63 - adds r0, r1, r5 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080CC594 - cmp r0, 0x1 - bgt _080CC570 - cmp r0, 0 - beq _080CC576 - b _080CC624 - .pool -_080CC570: - cmp r0, 0x2 - beq _080CC5E4 - b _080CC624 -_080CC576: - ldr r2, =0x00000a64 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - bl sub_80CC7A0 - ldr r1, [r4] - adds r1, r5 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080CC594: - bl sub_80CCA00 - cmp r0, 0 - beq _080CC632 - ldr r6, =0x02039d08 - ldr r1, [r6] - ldr r4, =0x00000a64 - adds r0, r1, r4 - ldrb r0, [r0] - ldr r5, =0x00000a65 - adds r1, r5 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - bl sub_80CB4CC - ldr r1, [r6] - adds r4, r1, r4 - ldrb r0, [r4] - adds r1, r5 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - bl sub_80CCCFC - ldr r0, [r6] - adds r0, r5 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - bl sub_80CD0B8 - b _080CC624 - .pool -_080CC5E4: - bl sub_80CB584 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, [r4] - movs r4, 0xB4 - lsls r4, 2 - adds r3, r2, r4 - ldrh r0, [r3] - cmp r0, 0 - beq _080CC620 - movs r0, 0xB3 - lsls r0, 2 - adds r1, r2, r0 - subs r4, 0x2 - adds r0, r2, r4 - ldrh r0, [r0] - ldrh r2, [r1] - adds r0, r2 - strh r0, [r1] - ldrh r0, [r3] - subs r0, 0x1 - strh r0, [r3] - lsls r0, 16 - cmp r0, 0 - bne _080CC632 - bl sub_80CCEE0 - bl sub_80CD158 -_080CC620: - adds r0, r5, 0 - b _080CC634 -_080CC624: - ldr r0, =0x02039d08 - ldr r1, [r0] - ldr r4, =0x00000a63 - adds r1, r4 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080CC632: - movs r0, 0x1 -_080CC634: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80CC54C - - thumb_func_start sub_80CC644 -sub_80CC644: @ 80CC644 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl get_preferred_box - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0 - cmp r1, r4 - beq _080CC66E -_080CC658: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xD - bls _080CC664 - movs r1, 0 -_080CC664: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r1, r4 - bne _080CC658 -_080CC66E: - movs r0, 0x1 - negs r0, r0 - cmp r2, 0x6 - bhi _080CC678 - movs r0, 0x1 -_080CC678: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80CC644 - - thumb_func_start sub_80CC680 -sub_80CC680: @ 80CC680 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl get_preferred_box - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - bl sub_80D2120 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x00000a62 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CC680 - - thumb_func_start sub_80CC6B0 -sub_80CC6B0: @ 80CC6B0 - push {r4,lr} - sub sp, 0x4 - ldr r1, =0x02039d08 - ldr r0, [r1] - ldr r2, =0x00000a62 - adds r0, r2 - ldrb r0, [r0] - adds r4, r1, 0 - cmp r0, 0x4 - bhi _080CC794 - lsls r0, 2 - ldr r1, =_080CC6DC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080CC6DC: - .4byte _080CC6F0 - .4byte _080CC718 - .4byte _080CC732 - .4byte _080CC76C - .4byte _080CC790 -_080CC6F0: - ldr r0, [r4] - movs r1, 0xE7 - lsls r1, 3 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0x1 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, [r4] - ldr r2, =0x00000a62 - adds r1, r2 - b _080CC77E - .pool -_080CC718: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _080CC794 - bl get_preferred_box - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_80CC7A0 - b _080CC776 -_080CC732: - bl sub_80CCA00 - cmp r0, 0x1 - bne _080CC794 - bl sub_80CCF9C - ldr r4, =0x02039d08 - ldr r0, [r4] - movs r1, 0xE7 - lsls r1, 3 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r1, [r4] - ldr r2, =0x00000a62 - adds r1, r2 - b _080CC77E - .pool -_080CC76C: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _080CC794 -_080CC776: - ldr r0, =0x02039d08 - ldr r1, [r0] - ldr r0, =0x00000a62 - adds r1, r0 -_080CC77E: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080CC794 - .pool -_080CC790: - movs r0, 0 - b _080CC796 -_080CC794: - movs r0, 0x1 -_080CC796: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80CC6B0 - - thumb_func_start sub_80CC7A0 -sub_80CC7A0: @ 80CC7A0 - push {r4-r7,lr} - sub sp, 0x8 - ldr r4, =0x02039d08 - ldr r2, [r4] - ldr r3, =0x000006f9 - adds r2, r3 - movs r3, 0 - strb r3, [r2] - ldr r2, [r4] - ldr r3, =0x000006fa - adds r2, r3 - strb r0, [r2] - ldr r0, [r4] - ldr r2, =0x000006fb - adds r0, r2 - strb r1, [r0] - ldr r1, [r4] - adds r2, r1, r2 - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r0, 0 - beq _080CC7E6 - movs r3, 0 - ldr r0, =0x000002d2 - adds r2, r1, r0 - ldrb r0, [r2] - cmp r0, 0 - bne _080CC7DA - movs r3, 0x1 -_080CC7DA: - strb r3, [r2] - ldr r0, [r4] - ldr r1, =0x00004ac4 - adds r0, r1 - bl sub_80CCAE0 -_080CC7E6: - ldr r7, =0x02039d08 - ldr r0, [r7] - ldr r2, =0x000006fa - adds r0, r2 - ldrb r0, [r0] - bl sub_80D20F8 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x10 - beq _080CC8C4 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_085775B8 - adds r6, r0, r1 - ldr r0, [r6, 0x4] - ldr r1, [r7] - ldr r5, =0x00000792 - adds r1, r5 - bl LZ77UnCompWram - ldr r0, [r7] - adds r5, r0, r5 - ldr r4, =0x000006fb - adds r1, r0, r4 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - ldr r3, =0x000002d2 - adds r0, r3 - ldrb r2, [r0] - adds r0, r5, 0 - bl sub_80CCA3C - ldr r1, [r7] - adds r4, r1, r4 - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0 - beq _080CC874 - ldr r0, [r6, 0x8] - ldr r2, =0x000002d2 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 21 - movs r3, 0x80 - lsls r3, 15 - adds r1, r3 - lsrs r1, 16 - movs r2, 0x40 - bl gpu_pal_apply - b _080CC888 - .pool -_080CC874: - ldr r0, [r6, 0x8] - ldr r2, =0x000002d2 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 6 - ldr r2, =0x02037794 - adds r1, r2 - movs r2, 0x20 - bl CpuSet -_080CC888: - ldr r0, [r6] - mov r1, sp - bl malloc_and_decompress - adds r1, r0, 0 - ldr r0, =0x02039d08 - ldr r3, [r0] - ldr r2, =0x00000a68 - adds r0, r3, r2 - str r1, [r0] - ldr r2, [sp] - lsls r2, 16 - lsrs r2, 16 - ldr r0, =0x000002d2 - adds r3, r0 - ldrb r3, [r3] - lsls r3, 8 - movs r0, 0x2 - bl LoadBgTiles - b _080CC9DA - .pool -_080CC8C4: - bl sub_80D24A8 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - ldr r0, =gUnknown_0857AF44 - adds r6, r1, r0 - ldr r0, [r6, 0x4] - ldr r1, [r7] - ldr r4, =0x00000792 - adds r1, r4 - bl LZ77UnCompWram - ldr r2, [r7] - adds r0, r2, r4 - ldr r5, =0x000006fb - adds r1, r2, r5 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - ldr r3, =0x000002d2 - adds r2, r3 - ldrb r2, [r2] - bl sub_80CCA3C - ldr r0, [r6, 0x8] - ldr r1, [r7] - adds r1, r4 - movs r2, 0x20 - bl CpuSet - bl sub_80D2510 - ldr r1, [r7] - ldr r2, =0x00000794 - adds r1, r2 - movs r2, 0x2 - bl CpuSet - bl sub_80D2510 - ldr r1, [r7] - ldr r3, =0x000007b4 - adds r1, r3 - movs r2, 0x2 - bl CpuSet - ldr r1, [r7] - adds r5, r1, r5 - movs r0, 0 - ldrsb r0, [r5, r0] - cmp r0, 0 - beq _080CC960 - adds r0, r1, r4 - ldr r2, =0x000002d2 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 21 - movs r3, 0x80 - lsls r3, 15 - adds r1, r3 - lsrs r1, 16 - movs r2, 0x40 - bl gpu_pal_apply - b _080CC976 - .pool -_080CC960: - ldr r2, =0x00000792 - adds r0, r1, r2 - ldr r3, =0x000002d2 - adds r1, r3 - ldrb r1, [r1] - lsls r1, 6 - ldr r2, =0x02037794 - adds r1, r2 - movs r2, 0x20 - bl CpuSet -_080CC976: - ldr r0, [r6] - mov r1, sp - bl malloc_and_decompress - ldr r6, =0x02039d08 - ldr r1, [r6] - ldr r5, =0x00000a68 - adds r1, r5 - str r0, [r1] - ldr r4, =gUnknown_0857B004 - bl sub_80D24DC - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - add r1, sp, 0x4 - bl malloc_and_decompress - adds r4, r0, 0 - ldr r0, [r6] - adds r0, r5 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 4 - adds r1, r0 - ldr r2, [sp, 0x4] - lsls r2, 9 - lsrs r2, 11 - movs r0, 0x80 - lsls r0, 19 - orrs r2, r0 - adds r0, r4, 0 - bl CpuSet - adds r0, r4, 0 - bl Free - ldr r0, [r6] - adds r5, r0, r5 - ldr r1, [r5] - ldr r2, [sp] - lsls r2, 16 - lsrs r2, 16 - ldr r3, =0x000002d2 - adds r0, r3 - ldrb r3, [r0] - lsls r3, 8 - movs r0, 0x2 - bl LoadBgTiles -_080CC9DA: - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CC7A0 - - thumb_func_start sub_80CCA00 -sub_80CCA00: @ 80CCA00 - push {r4,r5,lr} - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _080CCA12 - movs r0, 0 - b _080CCA2E -_080CCA12: - ldr r5, =0x02039d08 - ldr r0, [r5] - ldr r1, =0x00000a68 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - beq _080CCA2C - bl Free - ldr r0, [r5] - ldr r1, =0x00000a68 - adds r0, r1 - str r4, [r0] -_080CCA2C: - movs r0, 0x1 -_080CCA2E: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80CCA00 - - thumb_func_start sub_80CCA3C -sub_80CCA3C: @ 80CCA3C - push {r4-r7,lr} - sub sp, 0x24 - adds r5, r0, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r4, r2, 17 - ldr r0, =0x02039d08 - ldr r0, [r0] - movs r3, 0xB3 - lsls r3, 2 - adds r0, r3 - ldrh r3, [r0] - lsrs r3, 3 - adds r3, 0xA - lsls r1, 24 - asrs r7, r1, 24 - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 3 - adds r6, r3, r0 - movs r0, 0x3F - ands r6, r0 - movs r3, 0x14 - str r3, [sp] - movs r1, 0x12 - str r1, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0x2 - str r0, [sp, 0xC] - str r3, [sp, 0x10] - str r1, [sp, 0x14] - movs r0, 0x11 - str r0, [sp, 0x18] - lsls r2, 24 - asrs r2, 16 - str r2, [sp, 0x1C] - movs r0, 0xC0 - lsls r0, 10 - adds r4, r0 - asrs r4, 16 - str r4, [sp, 0x20] - movs r0, 0x2 - adds r1, r5, 0 - movs r2, 0 - movs r3, 0 - bl CopyRectToBgTilemapBufferRect - cmp r7, 0 - beq _080CCAD2 - cmp r7, 0 - ble _080CCAB0 - lsls r0, r6, 16 - movs r1, 0xA0 - lsls r1, 13 - adds r0, r1 - b _080CCAB6 - .pool -_080CCAB0: - lsls r0, r6, 16 - ldr r3, =0xfffc0000 - adds r0, r3 -_080CCAB6: - lsrs r6, r0, 16 - lsls r2, r6, 24 - lsrs r2, 24 - movs r0, 0x4 - str r0, [sp] - movs r0, 0x12 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0 - movs r3, 0x2 - bl FillBgTilemapBufferRect -_080CCAD2: - add sp, 0x24 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CCA3C - - thumb_func_start sub_80CCAE0 -sub_80CCAE0: @ 80CCAE0 - push {r4-r6,lr} - adds r2, r0, 0 - ldr r0, =0x02039d08 - ldr r0, [r0] - movs r1, 0xB3 - lsls r1, 2 - adds r0, r1 - ldrh r0, [r0] - lsrs r0, 3 - adds r3, r0, 0 - adds r3, 0x1E - movs r0, 0x3F - ands r3, r0 - adds r0, r3, 0 - cmp r0, 0x1F - bgt _080CCB10 - lsls r0, 1 - movs r6, 0x98 - lsls r6, 3 - adds r0, r6 - b _080CCB18 - .pool -_080CCB10: - lsls r0, 1 - movs r1, 0xC8 - lsls r1, 4 - adds r0, r1 -_080CCB18: - adds r2, r0 - movs r0, 0 - movs r5, 0 - movs r4, 0x3F -_080CCB20: - strh r5, [r2] - adds r2, 0x2 - adds r3, 0x1 - ands r3, r4 - adds r1, r3, 0 - cmp r1, 0 - bne _080CCB32 - ldr r6, =0xfffff7c0 - adds r2, r6 -_080CCB32: - cmp r1, 0x20 - bne _080CCB3C - movs r1, 0xF8 - lsls r1, 3 - adds r2, r1 -_080CCB3C: - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2B - bls _080CCB20 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CCAE0 - - thumb_func_start sub_80CCB50 -sub_80CCB50: @ 80CCB50 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x30 - mov r8, r0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =0x02039d08 - mov r10, r1 - ldr r1, [r1] - movs r2, 0xBE - lsls r2, 2 - adds r0, r1, r2 - str r0, [sp, 0x24] - mov r3, sp - adds r3, 0x24 - str r3, [sp, 0x2C] - ldr r0, =0x00030200 - str r0, [r3, 0x4] - ldr r4, =0x000006fc - adds r1, r4 - str r1, [sp, 0x14] - add r0, sp, 0x18 - ldr r7, =0x0000dac9 - strh r7, [r0] - add r0, sp, 0x1C - movs r1, 0 - movs r2, 0x8 - bl memset - add r1, sp, 0x14 - add r0, sp, 0x4 - movs r2, 0x10 - bl memcpy - mov r0, r8 - bl sub_80D20F8 - lsls r0, 24 - mov r5, r10 - ldr r4, [r5] - ldr r2, =gUnknown_08577574 - lsrs r0, 22 - adds r1, r0, r2 - ldrh r3, [r1] - movs r5, 0xE3 - lsls r5, 3 - adds r1, r4, r5 - strh r3, [r1] - adds r2, 0x2 - adds r0, r2 - ldrh r0, [r0] - ldr r1, =0x0000071a - adds r4, r1 - strh r0, [r4] - add r0, sp, 0x4 - bl LoadTaggedObjectPalettes - mov r2, r10 - ldr r0, [r2] - movs r6, 0xE7 - lsls r6, 3 - adds r0, r6 - movs r1, 0xFC - lsls r1, 2 - str r1, [r0] - adds r0, r7, 0 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - mov r4, r10 - ldr r3, [r4] - lsls r1, r0, 4 - movs r5, 0x87 - lsls r5, 1 - mov r9, r5 - add r1, r9 - ldr r4, =0x0000071c - adds r2, r3, r4 - strh r1, [r2] - adds r3, r6 - movs r5, 0x80 - lsls r5, 9 - adds r1, r5, 0 - lsls r1, r0 - ldr r0, [r3] - orrs r0, r1 - str r0, [r3] - adds r0, r7, 0 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - mov r1, r10 - ldr r4, [r1] - lsls r1, r0, 4 - add r1, r9 - ldr r3, =0x0000071e - adds r2, r4, r3 - strh r1, [r2] - adds r6, r4, r6 - lsls r5, r0 - ldr r0, [r6] - orrs r0, r5 - str r0, [r6] - ldr r5, =0x000021b8 - adds r4, r5 - mov r0, r8 - bl sav3_get_box_name - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x8 - bl CopyStringPadded - mov r4, r10 - ldr r1, [r4] - adds r5, r1, r5 - movs r0, 0xBE - lsls r0, 2 - adds r1, r0 - movs r0, 0x2 - str r0, [sp] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0 - bl sub_80C6D80 - ldr r0, [sp, 0x2C] - bl LoadObjectPic - mov r0, r8 - bl sav3_get_box_name - bl sub_80CD00C - movs r4, 0 - lsls r0, 16 - asrs r6, r0, 16 -_080CCC70: - lsls r1, r4, 5 - adds r1, r6, r1 - lsls r1, 16 - asrs r1, 16 - ldr r0, =gUnknown_0857B0A8 - movs r2, 0x1C - movs r3, 0x18 - bl AddObjectToFront - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r5, =0x02039d08 - ldr r2, [r5] - lsls r0, r4, 2 - movs r3, 0xE4 - lsls r3, 3 - adds r2, r3 - adds r2, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - str r0, [r2] - lsls r1, r4, 24 - lsrs r1, 24 - bl StartObjectImageAnim - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x1 - bls _080CCC70 - ldr r0, [r5] - movs r4, 0xDF - lsls r4, 3 - adds r0, r4 - movs r1, 0 - strb r1, [r0] - 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_80CCB50 - - thumb_func_start sub_80CCCFC -sub_80CCCFC: @ 80CCCFC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x28] - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - ldr r4, =0x02039d08 - ldr r2, [r4] - movs r1, 0xBE - lsls r1, 2 - adds r0, r2, r1 - str r0, [sp, 0x1C] - add r3, sp, 0x1C - ldr r5, =0x0000ffff - mov r12, r5 - movs r6, 0xC0 - lsls r6, 10 - mov r9, r6 - ldr r0, =0x00030200 - str r0, [r3, 0x4] - add r1, sp, 0x4 - ldr r0, =gUnknown_0857B0A8 - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - ldm r0!, {r5-r7} - stm r1!, {r5-r7} - movs r1, 0 - movs r5, 0xDF - lsls r5, 3 - adds r2, r5 - ldrb r0, [r2] - mov r8, r4 - adds r6, r3, 0 - cmp r0, 0 - bne _080CCD50 - movs r1, 0x1 -_080CCD50: - strb r1, [r2] - mov r7, r8 - ldr r0, [r7] - adds r0, r5 - ldrb r0, [r0] - cmp r0, 0 - bne _080CCD8C - ldr r0, [r6, 0x4] - mov r1, r12 - ands r0, r1 - mov r3, r9 - orrs r0, r3 - str r0, [r6, 0x4] - ldr r0, [r7] - ldr r5, =0x0000071c - adds r0, r5 - ldrh r0, [r0] - mov r9, r0 - b _080CCDB0 - .pool -_080CCD8C: - ldr r0, [r6, 0x4] - mov r7, r12 - ands r0, r7 - movs r1, 0x80 - lsls r1, 11 - orrs r0, r1 - str r0, [r6, 0x4] - mov r1, r8 - ldr r0, [r1] - ldr r3, =0x0000071c - adds r0, r3 - ldrh r0, [r0] - mov r9, r0 - add r1, sp, 0x4 - movs r0, 0x4 - strh r0, [r1] - ldr r0, =0x0000dac9 - strh r0, [r1, 0x2] -_080CCDB0: - mov r5, r8 - ldr r4, [r5] - ldr r5, =0x000021b8 - adds r4, r5 - ldr r0, [sp, 0x28] - bl sav3_get_box_name - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x8 - bl CopyStringPadded - mov r7, r8 - ldr r1, [r7] - adds r5, r1, r5 - movs r0, 0xBE - lsls r0, 2 - adds r1, r0 - movs r0, 0x2 - str r0, [sp] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0 - bl sub_80C6D80 - adds r0, r6, 0 - bl LoadObjectPic - ldr r0, [sp, 0x28] - bl sub_80D20F8 - lsls r0, 24 - lsrs r0, 22 - ldr r1, =gUnknown_08577574 - adds r0, r1 - mov r1, r9 - movs r2, 0x4 - bl gpu_pal_apply - ldr r0, [sp, 0x28] - bl sav3_get_box_name - bl sub_80CD00C - lsls r0, 16 - mov r1, r10 - lsls r2, r1, 24 - asrs r2, 24 - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 6 - lsrs r3, r0, 16 - str r3, [sp, 0x24] - asrs r0, 16 - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - movs r7, 0 - mov r9, r8 - negs r2, r2 - mov r8, r2 -_080CCE2E: - lsls r6, r7, 5 - mov r5, r10 - lsls r1, r5, 16 - asrs r1, 16 - adds r1, r6 - lsls r1, 16 - asrs r1, 16 - add r0, sp, 0x4 - movs r2, 0x1C - movs r3, 0x18 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - mov r1, r9 - ldr r2, [r1] - lsls r5, r7, 2 - movs r3, 0xE5 - lsls r3, 3 - adds r2, r3 - adds r2, r5 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - str r1, [r2] - mov r0, r8 - lsls r4, r0, 1 - add r4, r8 - lsls r4, 1 - strh r4, [r1, 0x2E] - ldr r1, [r2] - ldr r3, [sp, 0x24] - lsls r0, r3, 16 - asrs r0, 16 - adds r0, r6 - strh r0, [r1, 0x30] - ldr r0, [r2] - movs r6, 0 - strh r6, [r0, 0x32] - ldr r0, [r2] - ldr r1, =sub_80CCF30 - str r1, [r0, 0x1C] - lsls r1, r7, 24 - lsrs r1, 24 - bl StartObjectImageAnim - mov r1, r9 - ldr r0, [r1] - movs r3, 0xE4 - lsls r3, 3 - adds r0, r3 - adds r0, r5 - ldr r1, [r0] - strh r4, [r1, 0x2E] - ldr r2, [r0] - movs r1, 0x1 - strh r1, [r2, 0x30] - ldr r1, [r0] - ldr r0, =sub_80CCF64 - str r0, [r1, 0x1C] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, 0x1 - bls _080CCE2E - 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_80CCCFC - - thumb_func_start sub_80CCEE0 -sub_80CCEE0: @ 80CCEE0 - push {lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - movs r1, 0xDF - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080CCF00 - movs r0, 0x4 - bl FreeObjectTilesByTag - b _080CCF06 - .pool -_080CCF00: - movs r0, 0x3 - bl FreeObjectTilesByTag -_080CCF06: - ldr r0, =0x02039d08 - ldr r0, [r0] - movs r3, 0xE4 - lsls r3, 3 - adds r2, r0, r3 - adds r3, 0x8 - adds r1, r0, r3 - ldr r1, [r1] - str r1, [r2] - ldr r2, =0x00000724 - adds r1, r0, r2 - adds r3, 0x4 - adds r0, r3 - ldr r0, [r0] - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CCEE0 - - thumb_func_start sub_80CCF30 -sub_80CCF30: @ 80CCF30 - push {lr} - adds r2, r0, 0 - ldrh r1, [r2, 0x32] - movs r3, 0x32 - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _080CCF44 - subs r0, r1, 0x1 - strh r0, [r2, 0x32] - b _080CCF5C -_080CCF44: - ldrh r0, [r2, 0x2E] - ldrh r1, [r2, 0x20] - adds r0, r1 - strh r0, [r2, 0x20] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x30 - ldrsh r1, [r2, r3] - cmp r0, r1 - bne _080CCF5C - ldr r0, =DummyObjectCallback - str r0, [r2, 0x1C] -_080CCF5C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CCF30 - - thumb_func_start sub_80CCF64 -sub_80CCF64: @ 80CCF64 - push {lr} - adds r2, r0, 0 - ldrh r1, [r2, 0x30] - movs r3, 0x30 - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _080CCF78 - subs r0, r1, 0x1 - strh r0, [r2, 0x30] - b _080CCF96 -_080CCF78: - ldrh r0, [r2, 0x2E] - ldrh r1, [r2, 0x20] - adds r0, r1 - strh r0, [r2, 0x20] - ldrh r1, [r2, 0x24] - adds r0, r1 - strh r0, [r2, 0x32] - subs r0, 0x40 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xC0 - bls _080CCF96 - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles -_080CCF96: - pop {r0} - bx r0 - thumb_func_end sub_80CCF64 - - thumb_func_start sub_80CCF9C -sub_80CCF9C: @ 80CCF9C - push {lr} - bl get_preferred_box - lsls r0, 24 - lsrs r0, 24 - bl sub_80D20F8 - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =0x02039d08 - ldr r2, [r0] - movs r3, 0xDF - lsls r3, 3 - adds r0, r2, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _080CCFE4 - lsls r0, r1, 2 - ldr r1, =gUnknown_08577574 - adds r0, r1 - adds r3, 0x24 - adds r1, r2, r3 - ldrh r1, [r1] - lsls r1, 1 - ldr r2, =0x02037714 - adds r1, r2 - movs r2, 0x2 - bl CpuSet - b _080CCFFC - .pool -_080CCFE4: - lsls r0, r1, 2 - ldr r1, =gUnknown_08577574 - adds r0, r1 - ldr r3, =0x0000071e - adds r1, r2, r3 - ldrh r1, [r1] - lsls r1, 1 - ldr r2, =0x02037714 - adds r1, r2 - movs r2, 0x2 - bl CpuSet -_080CCFFC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CCF9C - - thumb_func_start sub_80CD00C -sub_80CD00C: @ 80CD00C - push {lr} - adds r1, r0, 0 - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - adds r1, r0, 0 - lsrs r0, r1, 31 - adds r1, r0 - asrs r1, 1 - movs r0, 0xB0 - subs r0, r1 - lsls r0, 16 - asrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_80CD00C - - thumb_func_start sub_80CD02C -sub_80CD02C: @ 80CD02C - push {r4,r5,lr} - ldr r0, =gUnknown_0857B080 - bl LoadObjectPic - movs r5, 0 -_080CD036: - lsls r1, r5, 4 - adds r1, r5 - lsls r1, 19 - movs r0, 0xB8 - lsls r0, 15 - adds r1, r0 - asrs r1, 16 - ldr r0, =gUnknown_0857B0E0 - movs r2, 0x1C - movs r3, 0x16 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _080CD088 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r4, r0, r1 - lsls r1, r5, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - movs r0, 0x1 - cmp r5, 0 - bne _080CD076 - movs r1, 0x1 - negs r1, r1 - adds r0, r1, 0 -_080CD076: - strh r0, [r4, 0x34] - ldr r0, =0x02039d08 - ldr r0, [r0] - lsls r1, r5, 2 - movs r2, 0xE6 - lsls r2, 3 - adds r0, r2 - adds r0, r1 - str r4, [r0] -_080CD088: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x1 - bls _080CD036 - bl sub_80CEADC - lsls r0, 24 - cmp r0, 0 - beq _080CD0A2 - movs r0, 0x1 - bl sub_80CD1A8 -_080CD0A2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CD02C - - thumb_func_start sub_80CD0B8 -sub_80CD0B8: @ 80CD0B8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r2, 0 - ldr r7, =0x02039d08 - mov r12, r7 - movs r6, 0xE6 - lsls r6, 3 - movs r4, 0 - movs r3, 0x2 -_080CD0CC: - mov r0, r12 - ldr r1, [r0] - lsls r0, r2, 2 - adds r1, r6 - adds r1, r0 - ldr r0, [r1] - strh r4, [r0, 0x24] - ldr r0, [r1] - strh r3, [r0, 0x2E] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x1 - bls _080CD0CC - lsls r0, r5, 24 - cmp r0, 0 - bge _080CD114 - ldr r1, [r7] - movs r2, 0xE6 - lsls r2, 3 - adds r3, r1, r2 - ldr r2, [r3] - movs r0, 0x1D - strh r0, [r2, 0x30] - ldr r0, =0x00000734 - adds r1, r0 - ldr r2, [r1] - movs r0, 0x5 - strh r0, [r2, 0x30] - ldr r0, [r3] - movs r2, 0x48 - b _080CD130 - .pool -_080CD114: - ldr r1, [r7] - movs r2, 0xE6 - lsls r2, 3 - adds r3, r1, r2 - ldr r2, [r3] - movs r0, 0x5 - strh r0, [r2, 0x30] - ldr r0, =0x00000734 - adds r1, r0 - ldr r2, [r1] - movs r0, 0x1D - strh r0, [r2, 0x30] - ldr r0, [r3] - movs r2, 0xF8 -_080CD130: - strh r2, [r0, 0x32] - ldr r0, [r1] - strh r2, [r0, 0x32] - ldr r1, [r7] - movs r2, 0xE6 - lsls r2, 3 - adds r0, r1, r2 - ldr r2, [r0] - movs r0, 0 - strh r0, [r2, 0x3C] - ldr r0, =0x00000734 - adds r1, r0 - ldr r1, [r1] - movs r0, 0x1 - strh r0, [r1, 0x3C] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CD0B8 - - thumb_func_start sub_80CD158 -sub_80CD158: @ 80CD158 - push {r4-r6,lr} - movs r3, 0 - movs r5, 0 - movs r6, 0x5 - negs r6, r6 - ldr r4, =0x02039d08 -_080CD164: - ldr r1, [r4] - lsls r0, r3, 2 - movs r2, 0xE6 - lsls r2, 3 - adds r1, r2 - adds r1, r0 - ldr r2, [r1] - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 3 - adds r0, 0x5C - strh r0, [r2, 0x20] - ldr r0, [r1] - strh r5, [r0, 0x24] - ldr r1, [r1] - adds r1, 0x3E - ldrb r2, [r1] - adds r0, r6, 0 - ands r0, r2 - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x1 - bls _080CD164 - movs r0, 0x1 - bl sub_80CD1A8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CD158 - - thumb_func_start sub_80CD1A8 -sub_80CD1A8: @ 80CD1A8 - push {r4-r6,lr} - lsls r0, 24 - cmp r0, 0 - beq _080CD1E4 - movs r2, 0 - ldr r6, =0x02039d08 - movs r5, 0xE6 - lsls r5, 3 - movs r3, 0 - movs r4, 0x1 -_080CD1BC: - ldr r1, [r6] - lsls r0, r2, 2 - adds r1, r5 - adds r1, r0 - ldr r0, [r1] - strh r4, [r0, 0x2E] - ldr r0, [r1] - strh r3, [r0, 0x30] - ldr r0, [r1] - strh r3, [r0, 0x32] - ldr r0, [r1] - strh r3, [r0, 0x36] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x1 - bls _080CD1BC - b _080CD204 - .pool -_080CD1E4: - movs r2, 0 - ldr r5, =0x02039d08 - movs r4, 0xE6 - lsls r4, 3 - movs r3, 0 -_080CD1EE: - ldr r0, [r5] - lsls r1, r2, 2 - adds r0, r4 - adds r0, r1 - ldr r0, [r0] - strh r3, [r0, 0x2E] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x1 - bls _080CD1EE -_080CD204: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CD1A8 - - thumb_func_start sub_80CD210 -sub_80CD210: @ 80CD210 - push {lr} - adds r2, r0, 0 - movs r1, 0x2E - ldrsh r0, [r2, r1] - cmp r0, 0x4 - bhi _080CD2DC - lsls r0, 2 - ldr r1, =_080CD22C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080CD22C: - .4byte _080CD240 - .4byte _080CD246 - .4byte _080CD274 - .4byte _080CD27A - .4byte _080CD2CC -_080CD240: - movs r0, 0 - strh r0, [r2, 0x24] - b _080CD2DC -_080CD246: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - movs r1, 0 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _080CD2DC - strh r1, [r2, 0x30] - ldrh r0, [r2, 0x34] - ldrh r3, [r2, 0x24] - adds r0, r3 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x32] - adds r0, 0x1 - strh r0, [r2, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - ble _080CD2DC - strh r1, [r2, 0x32] - strh r1, [r2, 0x24] - b _080CD2DC -_080CD274: - movs r0, 0x3 - strh r0, [r2, 0x2E] - b _080CD2DC -_080CD27A: - ldr r0, =0x02039d08 - ldr r1, [r0] - ldr r0, =0x000002ce - adds r1, r0 - ldrh r0, [r2, 0x20] - ldrh r1, [r1] - subs r0, r1 - strh r0, [r2, 0x20] - subs r0, 0x49 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAE - bls _080CD2A0 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r3] -_080CD2A0: - ldrh r0, [r2, 0x30] - subs r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - cmp r0, 0 - bne _080CD2DC - ldrh r0, [r2, 0x32] - strh r0, [r2, 0x20] - adds r3, r2, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - movs r0, 0x4 - strh r0, [r2, 0x2E] - b _080CD2DC - .pool -_080CD2CC: - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x000002ce - adds r0, r1 - ldrh r1, [r2, 0x20] - ldrh r0, [r0] - subs r1, r0 - strh r1, [r2, 0x20] -_080CD2DC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CD210 - - thumb_func_start sub_80CD2E8 -sub_80CD2E8: @ 80CD2E8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - adds r6, r1, 0 - ldr r4, [sp, 0x18] - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0857B0E0 - lsls r5, 16 - asrs r5, 16 - lsls r6, 16 - asrs r6, 16 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r4, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _080CD360 - movs r1, 0x1 - ands r1, r7 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r5, =0x02020630 - adds r6, r4, r5 - adds r0, r6, 0 - bl StartObjectImageAnim - movs r0, 0x3 - mov r1, r8 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r6, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r6, 0x5] - adds r5, 0x1C - adds r4, r5 - ldr r0, =DummyObjectCallback - str r0, [r4] - adds r0, r6, 0 - b _080CD362 - .pool -_080CD360: - movs r0, 0 -_080CD362: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80CD2E8 - - thumb_func_start sub_80CD36C -sub_80CD36C: @ 80CD36C - push {lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r1, [r0, 0x1] - cmp r1, 0x1 - beq _080CD388 - ldr r1, =0x02039d78 - movs r0, 0 - strb r0, [r1] - b _080CD38C - .pool -_080CD388: - ldr r0, =0x02039d78 - strb r1, [r0] -_080CD38C: - ldr r0, =0x02039d79 - movs r1, 0 - strb r1, [r0] - ldr r0, =0x02039d7a - strb r1, [r0] - ldr r0, =0x02039d7b - strb r1, [r0] - ldr r0, =0x02039d7c - strb r1, [r0] - ldr r0, =0x02039d7d - strb r1, [r0] - bl sub_80CDC0C - bl sub_80CFC14 - ldr r2, =0x02039d08 - ldr r0, [r2] - ldr r1, =0x00000cd6 - adds r0, r1 - movs r3, 0 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r2] - ldr r1, =0x000021ff - adds r0, r1 - strb r3, [r0] - bl sub_80CEB40 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CD36C - - thumb_func_start sub_80CD3EC -sub_80CD3EC: @ 80CD3EC - push {lr} - bl sub_80CFC14 - bl sub_80CEBDC - ldr r3, =0x02039d08 - ldr r0, [r3] - ldr r1, =0x00000cd6 - adds r0, r1 - movs r2, 0 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r3] - ldr r1, =0x000021ff - adds r0, r1 - strb r2, [r0] - ldr r0, =0x02039d7a - ldrb r0, [r0] - cmp r0, 0 - beq _080CD426 - ldr r0, [r3] - ldr r1, =0x000020a4 - adds r0, r1 - ldr r1, =0x02039d14 - movs r2, 0x64 - bl memcpy - bl sub_80CAFC4 -_080CD426: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CD3EC - - thumb_func_start sub_80CD444 -sub_80CD444: @ 80CD444 - push {r4-r6,lr} - adds r4, r2, 0 - adds r6, r3, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - cmp r0, 0x4 - bhi _080CD4FC - lsls r0, 2 - ldr r1, =_080CD464 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080CD464: - .4byte _080CD478 - .4byte _080CD4A6 - .4byte _080CD4CE - .4byte _080CD4D6 - .4byte _080CD4F4 -_080CD478: - adds r0, r5, 0 - movs r1, 0x6 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 3 - adds r1, 0x64 - strh r1, [r4] - adds r0, r5, 0 - movs r1, 0x6 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 3 - adds r1, 0x20 - strh r1, [r6] - b _080CD4FC -_080CD4A6: - cmp r5, 0 - bne _080CD4B2 - movs r0, 0x68 - strh r0, [r4] - movs r0, 0x34 - b _080CD4FA -_080CD4B2: - cmp r5, 0x6 - bne _080CD4BE - movs r0, 0x98 - strh r0, [r4] - movs r0, 0x84 - b _080CD4FA -_080CD4BE: - movs r0, 0x98 - strh r0, [r4] - subs r1, r5, 0x1 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, 0x4 - b _080CD4FA -_080CD4CE: - movs r0, 0xA2 - strh r0, [r4] - movs r0, 0xC - b _080CD4FA -_080CD4D6: - ldr r0, =0x02039d7a - ldrb r0, [r0] - movs r1, 0xE - cmp r0, 0 - beq _080CD4E2 - movs r1, 0x8 -_080CD4E2: - strh r1, [r6] - movs r0, 0x58 - muls r0, r5 - adds r0, 0x78 - strh r0, [r4] - b _080CD4FC - .pool -_080CD4F4: - movs r0, 0xA0 - strh r0, [r4] - movs r0, 0x60 -_080CD4FA: - strh r0, [r6] -_080CD4FC: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80CD444 - - thumb_func_start sub_80CD504 -sub_80CD504: @ 80CD504 - push {lr} - ldr r0, =0x02039d78 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - beq _080CD538 - cmp r0, 0x1 - bne _080CD54C - ldr r0, =0x02039d79 - movs r1, 0 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - b _080CD542 - .pool -_080CD538: - ldr r0, =0x02039d79 - ldrb r0, [r0] - movs r1, 0xB - bl get_pokemon_data_from_selected_box -_080CD542: - lsls r0, 16 - lsrs r0, 16 - b _080CD54E - .pool -_080CD54C: - movs r0, 0 -_080CD54E: - pop {r1} - bx r1 - thumb_func_end sub_80CD504 - - thumb_func_start sub_80CD554 -sub_80CD554: @ 80CD554 - push {r4-r7,lr} - ldr r7, =0x02039d08 - ldr r5, [r7] - movs r0, 0xCD - lsls r0, 4 - adds r1, r5, r0 - ldrh r0, [r1] - cmp r0, 0 - bne _080CD57E - ldrb r0, [r5, 0x1] - cmp r0, 0x3 - beq _080CD574 - movs r0, 0 - b _080CD69A - .pool -_080CD574: - bl sub_80D1218 - lsls r0, 24 - lsrs r0, 24 - b _080CD69A -_080CD57E: - subs r0, 0x1 - strh r0, [r1] - lsls r0, 16 - cmp r0, 0 - beq _080CD67C - ldr r1, =0x00000cbc - adds r4, r5, r1 - ldr r2, =0x00000cc4 - adds r1, r5, r2 - ldr r0, [r4] - ldr r1, [r1] - adds r0, r1 - str r0, [r4] - movs r0, 0xCC - lsls r0, 4 - adds r3, r5, r0 - adds r2, 0x4 - adds r1, r5, r2 - ldr r0, [r3] - ldr r1, [r1] - adds r0, r1 - str r0, [r3] - ldr r6, =0x00000cb4 - adds r1, r5, r6 - ldr r2, [r1] - ldr r0, [r4] - asrs r0, 8 - strh r0, [r2, 0x20] - ldr r2, [r1] - ldr r0, [r3] - asrs r0, 8 - strh r0, [r2, 0x22] - ldr r1, [r1] - ldrh r2, [r1, 0x20] - movs r3, 0x20 - ldrsh r0, [r1, r3] - movs r3, 0x80 - lsls r3, 1 - cmp r0, r3 - ble _080CD5DA - ldr r4, =0xffffff00 - adds r0, r2, r4 - lsls r0, 16 - asrs r0, 16 - adds r0, 0x40 - strh r0, [r1, 0x20] -_080CD5DA: - ldr r0, [r7] - adds r0, r6 - ldr r1, [r0] - ldrh r2, [r1, 0x20] - movs r4, 0x20 - ldrsh r0, [r1, r4] - cmp r0, 0x3F - bgt _080CD5F6 - movs r0, 0x40 - subs r0, r2 - lsls r0, 16 - asrs r0, 16 - subs r0, r3, r0 - strh r0, [r1, 0x20] -_080CD5F6: - ldr r0, [r7] - adds r0, r6 - ldr r1, [r0] - ldrh r2, [r1, 0x22] - movs r3, 0x22 - ldrsh r0, [r1, r3] - cmp r0, 0xB0 - ble _080CD612 - adds r0, r2, 0 - subs r0, 0xB0 - lsls r0, 16 - asrs r0, 16 - subs r0, 0x10 - strh r0, [r1, 0x22] -_080CD612: - ldr r0, [r7] - adds r0, r6 - ldr r2, [r0] - ldrh r3, [r2, 0x22] - movs r4, 0x22 - ldrsh r0, [r2, r4] - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bge _080CD632 - subs r0, r1, r3 - movs r1, 0xB0 - lsls r0, 16 - asrs r0, 16 - subs r1, r0 - strh r1, [r2, 0x22] -_080CD632: - ldr r0, [r7] - ldr r2, =0x00000cd7 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0 - beq _080CD698 - subs r0, 0x1 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - bne _080CD698 - ldr r0, [r7] - adds r0, r6 - ldr r2, [r0] - adds r2, 0x3F - ldrb r3, [r2] - lsrs r1, r3, 1 - movs r0, 0x1 - eors r1, r0 - ands r1, r0 - lsls r1, 1 - movs r0, 0x3 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - b _080CD698 - .pool -_080CD67C: - ldr r3, =0x00000cb4 - adds r2, r5, r3 - ldr r1, [r2] - ldr r4, =0x00000ccc - adds r0, r5, r4 - ldrh r0, [r0] - strh r0, [r1, 0x20] - ldr r1, [r2] - ldr r2, =0x00000cce - adds r0, r5, r2 - ldrh r0, [r0] - strh r0, [r1, 0x22] - bl sub_80CDA68 -_080CD698: - movs r0, 0x1 -_080CD69A: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80CD554 - - thumb_func_start sub_80CD6AC -sub_80CD6AC: @ 80CD6AC - push {r4-r6,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - mov r6, sp - adds r6, 0x2 - adds r0, r4, 0 - adds r1, r5, 0 - mov r2, sp - adds r3, r6, 0 - bl sub_80CD444 - ldr r1, =0x02039d08 - ldr r0, [r1] - ldr r2, =0x00000cd4 - adds r0, r2 - strb r4, [r0] - ldr r0, [r1] - ldr r3, =0x00000cd5 - adds r0, r3 - strb r5, [r0] - ldr r1, [r1] - mov r0, sp - ldrh r2, [r0] - subs r3, 0x9 - adds r0, r1, r3 - strh r2, [r0] - ldrh r0, [r6] - ldr r2, =0x00000cce - adds r1, r2 - strh r0, [r1] - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CD6AC - - thumb_func_start sub_80CD70C -sub_80CD70C: @ 80CD70C - push {r4-r7,lr} - ldr r0, =0x02039d08 - ldr r2, [r0] - ldr r3, =0x00000cd2 - adds r1, r2, r3 - ldrh r1, [r1] - adds r4, r0, 0 - cmp r1, 0 - beq _080CD730 - movs r0, 0xCD - lsls r0, 4 - adds r1, r2, r0 - movs r0, 0xC - b _080CD738 - .pool -_080CD730: - movs r3, 0xCD - lsls r3, 4 - adds r1, r2, r3 - movs r0, 0x6 -_080CD738: - strh r0, [r1] - ldr r1, [r4] - ldr r0, =0x00000cd7 - adds r2, r1, r0 - ldrb r0, [r2] - cmp r0, 0 - beq _080CD752 - movs r3, 0xCD - lsls r3, 4 - adds r0, r1, r3 - ldrh r0, [r0] - lsrs r0, 1 - strb r0, [r2] -_080CD752: - ldr r2, [r4] - ldr r1, =0x00000cd2 - adds r0, r2, r1 - movs r1, 0 - ldrsb r1, [r0, r1] - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _080CD78C - cmp r1, 0x1 - beq _080CD7AC - ldr r3, =0x00000cce - adds r0, r2, r3 - movs r3, 0 - ldrsh r1, [r0, r3] - ldr r3, =0x00000cb4 - adds r0, r2, r3 - ldr r0, [r0] - movs r2, 0x22 - ldrsh r0, [r0, r2] - b _080CD7C0 - .pool -_080CD78C: - ldr r3, =0x00000cce - adds r0, r2, r3 - movs r3, 0 - ldrsh r1, [r0, r3] - ldr r3, =0x00000cb4 - adds r0, r2, r3 - ldr r0, [r0] - movs r2, 0x22 - ldrsh r0, [r0, r2] - adds r0, 0xC0 - b _080CD7C0 - .pool -_080CD7AC: - ldr r3, =0x00000cce - adds r0, r2, r3 - movs r3, 0 - ldrsh r1, [r0, r3] - ldr r3, =0x00000cb4 - adds r0, r2, r3 - ldr r0, [r0] - movs r2, 0x22 - ldrsh r0, [r0, r2] - subs r0, 0xC0 -_080CD7C0: - subs r7, r1, r0 - ldr r2, [r4] - ldr r3, =0x00000cd3 - adds r0, r2, r3 - movs r1, 0 - ldrsb r1, [r0, r1] - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _080CD7FC - cmp r1, 0x1 - beq _080CD81C - ldr r1, =0x00000ccc - adds r0, r2, r1 - movs r3, 0 - ldrsh r1, [r0, r3] - ldr r3, =0x00000cb4 - adds r0, r2, r3 - ldr r0, [r0] - movs r2, 0x20 - ldrsh r0, [r0, r2] - b _080CD830 - .pool -_080CD7FC: - ldr r3, =0x00000ccc - adds r0, r2, r3 - movs r3, 0 - ldrsh r1, [r0, r3] - ldr r3, =0x00000cb4 - adds r0, r2, r3 - ldr r0, [r0] - movs r2, 0x20 - ldrsh r0, [r0, r2] - adds r0, 0xC0 - b _080CD830 - .pool -_080CD81C: - ldr r3, =0x00000ccc - adds r0, r2, r3 - movs r3, 0 - ldrsh r1, [r0, r3] - ldr r3, =0x00000cb4 - adds r0, r2, r3 - ldr r0, [r0] - movs r2, 0x20 - ldrsh r0, [r0, r2] - subs r0, 0xC0 -_080CD830: - subs r0, r1, r0 - lsls r7, 8 - lsls r0, 8 - ldr r4, [r4] - ldr r3, =0x00000cc4 - adds r6, r4, r3 - movs r1, 0xCD - lsls r1, 4 - adds r5, r4, r1 - ldrh r1, [r5] - bl __divsi3 - str r0, [r6] - ldr r2, =0x00000cc8 - adds r6, r4, r2 - ldrh r1, [r5] - adds r0, r7, 0 - bl __divsi3 - str r0, [r6] - ldr r3, =0x00000cbc - adds r2, r4, r3 - ldr r0, =0x00000cb4 - adds r1, r4, r0 - ldr r0, [r1] - movs r3, 0x20 - ldrsh r0, [r0, r3] - lsls r0, 8 - str r0, [r2] - movs r0, 0xCC - lsls r0, 4 - adds r4, r0 - ldr r0, [r1] - movs r1, 0x22 - ldrsh r0, [r0, r1] - lsls r0, 8 - str r0, [r4] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CD70C - - thumb_func_start sub_80CD894 -sub_80CD894: @ 80CD894 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - adds r0, r4, 0 - adds r1, r6, 0 - bl sub_80CD6AC - bl sub_80CD70C - ldr r5, =0x02039d08 - ldr r1, [r5] - ldrb r0, [r1, 0x1] - cmp r0, 0x3 - beq _080CD8E4 - ldr r2, =0x000021ff - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080CD8FC - ldr r0, =0x02039d7a - ldrb r0, [r0] - cmp r0, 0 - bne _080CD8FC - ldr r2, =0x00000cb4 - adds r0, r1, r2 - ldr r0, [r0] - movs r1, 0x1 - bl StartObjectImageAnim - b _080CD8FC - .pool -_080CD8E4: - bl sub_80D127C - lsls r0, 24 - cmp r0, 0 - bne _080CD8FC - ldr r0, [r5] - ldr r1, =0x00000cb4 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x1 - bl StartObjectImageAnim -_080CD8FC: - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x3 - bne _080CD95C - ldr r0, =0x02039d78 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - bne _080CD930 - ldr r0, =0x02039d79 - ldrb r1, [r0] - movs r0, 0 - bl sub_80D0E50 - b _080CD93E - .pool -_080CD930: - cmp r0, 0x1 - bne _080CD93E - ldr r0, =0x02039d79 - ldrb r1, [r0] - movs r0, 0x1 - bl sub_80D0E50 -_080CD93E: - cmp r4, 0 - bne _080CD950 - movs r0, 0 - adds r1, r6, 0 - bl sub_80D0D8C - b _080CD95C - .pool -_080CD950: - cmp r4, 0x1 - bne _080CD988 - movs r0, 0x1 - adds r1, r6, 0 - bl sub_80D0D8C -_080CD95C: - cmp r4, 0x1 - bne _080CD988 - ldr r0, =0x02039d78 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x1 - beq _080CD988 - ldr r1, =0x02039d08 - ldr r0, [r1] - ldr r2, =0x00000cd6 - adds r0, r2 - strb r4, [r0] - ldr r0, [r1] - ldr r1, =0x00000cb8 - adds r0, r1 - ldr r1, [r0] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] -_080CD988: - cmp r4, 0 - beq _080CD9E4 - cmp r4, 0 - blt _080CDA56 - cmp r4, 0x3 - bgt _080CDA56 - ldr r5, =0x02039d08 - ldr r0, [r5] - ldr r2, =0x00000cb4 - adds r0, r2 - ldr r4, [r0] - ldrb r1, [r4, 0x5] - movs r2, 0xD - negs r2, r2 - adds r0, r2, 0 - ands r0, r1 - movs r3, 0x4 - orrs r0, r3 - strb r0, [r4, 0x5] - ldr r0, [r5] - ldr r4, =0x00000cb8 - adds r0, r4 - ldr r1, [r0] - adds r1, 0x3E - ldrb r0, [r1] - orrs r0, r3 - strb r0, [r1] - ldr r0, [r5] - adds r0, r4 - ldr r1, [r0] - ldrb r0, [r1, 0x5] - ands r2, r0 - orrs r2, r3 - strb r2, [r1, 0x5] - b _080CDA56 - .pool -_080CD9E4: - ldr r3, =0x02039d08 - ldr r1, [r3] - ldr r2, =0x000021ff - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080CDA28 - ldr r2, =0x00000cb4 - adds r0, r1, r2 - ldr r2, [r0] - ldrb r1, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x5] - ldr r0, [r3] - ldr r1, =0x00000cb8 - adds r0, r1 - ldr r1, [r0] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - b _080CDA56 - .pool -_080CDA28: - ldr r2, =0x00000cb4 - adds r0, r1, r2 - ldr r2, [r0] - ldrb r1, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r2, 0x5] - ldr r0, =0x02039d78 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - bne _080CDA56 - ldr r0, =0x02039d7a - ldrb r0, [r0] - cmp r0, 0 - beq _080CDA56 - movs r0, 0x2 - bl sub_80CC0D4 -_080CDA56: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CD894 - - thumb_func_start sub_80CDA68 -sub_80CDA68: @ 80CDA68 - push {r4,lr} - ldr r1, =0x02039d78 - ldr r4, =0x02039d08 - ldr r2, [r4] - ldr r3, =0x00000cd4 - adds r0, r2, r3 - ldrb r0, [r0] - strb r0, [r1] - ldr r1, =0x02039d79 - adds r3, 0x1 - adds r0, r2, r3 - ldrb r0, [r0] - strb r0, [r1] - ldrb r0, [r2, 0x1] - cmp r0, 0x3 - beq _080CDAC0 - ldr r1, =0x000021ff - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080CDAD8 - ldr r0, =0x02039d7a - ldrb r0, [r0] - cmp r0, 0 - bne _080CDAD8 - subs r3, 0x21 - adds r0, r2, r3 - ldr r0, [r0] - movs r1, 0 - bl StartObjectImageAnim - b _080CDAD8 - .pool -_080CDAC0: - bl sub_80D127C - lsls r0, 24 - cmp r0, 0 - bne _080CDAD8 - ldr r0, [r4] - ldr r1, =0x00000cb4 - adds r0, r1 - ldr r0, [r0] - movs r1, 0 - bl StartObjectImageAnim -_080CDAD8: - bl sub_80CEB40 - ldr r0, =0x02039d78 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x1 - beq _080CDB0E - cmp r0, 0x1 - bgt _080CDAFC - cmp r0, 0 - beq _080CDB30 - b _080CDB8A - .pool -_080CDAFC: - cmp r0, 0x2 - beq _080CDB06 - cmp r0, 0x3 - bne _080CDB8A - b _080CDB1E -_080CDB06: - movs r0, 0x1 - bl sub_80CD1A8 - b _080CDB8A -_080CDB0E: - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r2, =0x00000cb8 - adds r0, r2 - ldr r0, [r0] - adds r0, 0x43 - movs r1, 0xD - strb r1, [r0] -_080CDB1E: - movs r0, 0x1 - bl sub_80CC0D4 - b _080CDB8A - .pool -_080CDB30: - ldr r4, =0x02039d08 - ldr r1, [r4] - ldr r3, =0x000021ff - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _080CDB8A - ldr r2, =0x00000cb4 - adds r0, r1, r2 - ldr r3, [r0] - ldrb r1, [r3, 0x5] - movs r2, 0xD - negs r2, r2 - adds r0, r2, 0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r3, 0x5] - ldr r0, [r4] - ldr r3, =0x00000cb8 - adds r0, r3 - ldr r1, [r0] - ldrb r0, [r1, 0x5] - ands r2, r0 - movs r0, 0x8 - orrs r2, r0 - strb r2, [r1, 0x5] - ldr r0, [r4] - adds r0, r3 - ldr r0, [r0] - adds r0, 0x43 - movs r1, 0x15 - strb r1, [r0] - ldr r0, [r4] - adds r0, r3 - ldr r1, [r0] - adds r1, 0x3E - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - movs r0, 0x2 - bl sub_80CC0D4 -_080CDB8A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CDA68 - - thumb_func_start sub_80CDBA0 -sub_80CDBA0: @ 80CDBA0 - push {lr} - ldr r0, =0x02039d7a - ldrb r0, [r0] - cmp r0, 0 - bne _080CDBB4 - movs r3, 0 - b _080CDBC2 - .pool -_080CDBB4: - bl calc_player_party_count - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x5 - bls _080CDBC2 - movs r3, 0x5 -_080CDBC2: - ldr r0, =0x02039d08 - ldr r2, [r0] - ldr r1, =0x00000cb4 - adds r0, r2, r1 - ldr r0, [r0] - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080CDBE0 - ldr r0, =0x00000cd7 - adds r1, r2, r0 - movs r0, 0x1 - strb r0, [r1] -_080CDBE0: - movs r0, 0x1 - adds r1, r3, 0 - bl sub_80CD894 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CDBA0 - - thumb_func_start sub_80CDBF8 -sub_80CDBF8: @ 80CDBF8 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0 - bl sub_80CD894 - pop {r0} - bx r0 - thumb_func_end sub_80CDBF8 - - thumb_func_start sub_80CDC0C -sub_80CDC0C: @ 80CDC0C - ldr r1, =0x02039d7e - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_80CDC0C - - thumb_func_start sub_80CDC18 -sub_80CDC18: @ 80CDC18 - ldr r0, =0x02039d7e - ldr r1, =0x02039d79 - ldrb r1, [r1] - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_80CDC18 - - thumb_func_start sub_80CDC2C -sub_80CDC2C: @ 80CDC2C - ldr r0, =0x02039d7e - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80CDC2C - - thumb_func_start sub_80CDC38 -sub_80CDC38: @ 80CDC38 - lsls r0, 24 - ldr r1, =0x02039d08 - ldr r1, [r1] - ldr r2, =0x00000d8c - adds r3, r1, r2 - ldr r2, =gUnknown_0857B998 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - str r0, [r3] - movs r0, 0xD9 - lsls r0, 4 - adds r1, r0 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_80CDC38 - - thumb_func_start sub_80CDC64 -sub_80CDC64: @ 80CDC64 - push {lr} - lsls r0, 24 - cmp r0, 0 - bne _080CDC84 - ldr r0, =0x02039d08 - ldr r1, [r0] - ldr r2, =0x00000d8c - adds r1, r2 - ldr r2, =sub_80CDEB4 - b _080CDC8E - .pool -_080CDC84: - ldr r0, =0x02039d08 - ldr r1, [r0] - ldr r2, =0x00000d8c - adds r1, r2 - ldr r2, =sub_80CDEC4 -_080CDC8E: - str r2, [r1] - ldr r0, [r0] - movs r1, 0xD9 - lsls r1, 4 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CDC64 - - thumb_func_start sub_80CDCAC -sub_80CDCAC: @ 80CDCAC - push {lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x00000d8c - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80CDCAC - - thumb_func_start sub_80CDCCC -sub_80CDCCC: @ 80CDCCC - push {r4,r5,lr} - ldr r4, =0x02039d08 - ldr r1, [r4] - movs r5, 0xD9 - lsls r5, 4 - adds r0, r1, r5 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080CDD1C - cmp r0, 0x1 - bgt _080CDCEC - cmp r0, 0 - beq _080CDCF6 - b _080CDD54 - .pool -_080CDCEC: - cmp r0, 0x2 - beq _080CDD40 - cmp r0, 0x3 - beq _080CDCFE - b _080CDD54 -_080CDCF6: - ldr r0, =0x02039d7a - ldrb r0, [r0] - cmp r0, 0 - beq _080CDD08 -_080CDCFE: - movs r0, 0 - b _080CDD56 - .pool -_080CDD08: - ldr r2, =0x00000cb4 - adds r0, r1, r2 - ldr r0, [r0] - movs r1, 0x2 - bl StartObjectImageAnim - b _080CDD4A - .pool -_080CDD1C: - bl sub_80CDED4 - lsls r0, 24 - cmp r0, 0 - bne _080CDD54 - ldr r0, [r4] - ldr r1, =0x00000cb4 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x3 - bl StartObjectImageAnim - bl sub_80CDF38 - b _080CDD4A - .pool -_080CDD40: - bl sub_80CDF08 - lsls r0, 24 - cmp r0, 0 - bne _080CDD54 -_080CDD4A: - ldr r1, [r4] - adds r1, r5 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080CDD54: - movs r0, 0x1 -_080CDD56: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80CDCCC - - thumb_func_start sub_80CDD5C -sub_80CDD5C: @ 80CDD5C - push {r4,r5,lr} - ldr r4, =0x02039d08 - ldr r0, [r4] - movs r5, 0xD9 - lsls r5, 4 - adds r0, r5 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080CDDA4 - cmp r0, 0x1 - bgt _080CDD7C - cmp r0, 0 - beq _080CDD82 - b _080CDDD0 - .pool -_080CDD7C: - cmp r0, 0x2 - beq _080CDDCC - b _080CDDD0 -_080CDD82: - bl sub_80CDED4 - lsls r0, 24 - cmp r0, 0 - bne _080CDDD0 - ldr r0, [r4] - ldr r1, =0x00000cb4 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x2 - bl StartObjectImageAnim - bl sub_80CDFAC - b _080CDDBC - .pool -_080CDDA4: - bl sub_80CDF08 - lsls r0, 24 - cmp r0, 0 - bne _080CDDD0 - ldr r0, [r4] - ldr r1, =0x00000cb4 - adds r0, r1 - ldr r0, [r0] - movs r1, 0 - bl StartObjectImageAnim -_080CDDBC: - ldr r1, [r4] - adds r1, r5 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080CDDD0 - .pool -_080CDDCC: - movs r0, 0 - b _080CDDD2 -_080CDDD0: - movs r0, 0x1 -_080CDDD2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80CDD5C - - thumb_func_start sub_80CDDD8 -sub_80CDDD8: @ 80CDDD8 - push {r4,r5,lr} - ldr r4, =0x02039d08 - ldr r1, [r4] - movs r5, 0xD9 - lsls r5, 4 - adds r0, r1, r5 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080CDE68 - cmp r0, 0x1 - bgt _080CDDF8 - cmp r0, 0 - beq _080CDDFE - b _080CDEAC - .pool -_080CDDF8: - cmp r0, 0x2 - beq _080CDEA8 - b _080CDEAC -_080CDDFE: - ldr r0, =0x02039d78 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - beq _080CDE20 - cmp r0, 0x1 - bne _080CDEA8 - ldr r0, =0x00000d91 - adds r1, r0 - movs r0, 0xE - b _080CDE2A - .pool -_080CDE20: - bl get_preferred_box - ldr r1, [r4] - ldr r2, =0x00000d91 - adds r1, r2 -_080CDE2A: - strb r0, [r1] - ldr r4, =0x02039d08 - ldr r0, [r4] - ldr r1, =0x00000cb4 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x2 - bl StartObjectImageAnim - ldr r0, [r4] - ldr r2, =0x00000d91 - adds r0, r2 - ldrb r0, [r0] - ldr r1, =0x02039d79 - ldrb r1, [r1] - bl sub_80CBD5C - ldr r1, [r4] - movs r0, 0xD9 - lsls r0, 4 - adds r1, r0 - b _080CDE94 - .pool -_080CDE68: - bl sub_80CBDC4 - lsls r0, 24 - cmp r0, 0 - bne _080CDEAC - ldr r0, [r4] - ldr r1, =0x00000cb4 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x3 - bl StartObjectImageAnim - ldr r0, [r4] - ldr r2, =0x00000d91 - adds r0, r2 - ldrb r0, [r0] - ldr r1, =0x02039d79 - ldrb r1, [r1] - bl diegohint1 - ldr r1, [r4] - adds r1, r5 -_080CDE94: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080CDEAC - .pool -_080CDEA8: - movs r0, 0 - b _080CDEAE -_080CDEAC: - movs r0, 0x1 -_080CDEAE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80CDDD8 - - thumb_func_start sub_80CDEB4 -sub_80CDEB4: @ 80CDEB4 - push {lr} - bl sub_80CDED4 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_80CDEB4 - - thumb_func_start sub_80CDEC4 -sub_80CDEC4: @ 80CDEC4 - push {lr} - bl sub_80CDF08 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_80CDEC4 - - thumb_func_start sub_80CDED4 -sub_80CDED4: @ 80CDED4 - push {lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x00000cb4 - adds r0, r1 - ldr r1, [r0] - movs r2, 0x26 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _080CDEEC - cmp r0, 0x8 - beq _080CDEFC -_080CDEEC: - ldrh r0, [r1, 0x26] - adds r0, 0x1 - strh r0, [r1, 0x26] - b _080CDF00 - .pool -_080CDEFC: - movs r0, 0 - b _080CDF02 -_080CDF00: - movs r0, 0x1 -_080CDF02: - pop {r1} - bx r1 - thumb_func_end sub_80CDED4 - - thumb_func_start sub_80CDF08 -sub_80CDF08: @ 80CDF08 - push {lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x00000cb4 - adds r0, r1 - ldr r1, [r0] - movs r2, 0x26 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _080CDF30 - ldrh r0, [r1, 0x26] - subs r0, 0x1 - strh r0, [r1, 0x26] - movs r0, 0x1 - b _080CDF32 - .pool -_080CDF30: - movs r0, 0 -_080CDF32: - pop {r1} - bx r1 - thumb_func_end sub_80CDF08 - - thumb_func_start sub_80CDF38 -sub_80CDF38: @ 80CDF38 - push {r4,lr} - ldr r0, =0x02039d78 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - beq _080CDF68 - cmp r0, 0x1 - bne _080CDF94 - ldr r4, =0x02039d79 - ldrb r1, [r4] - movs r0, 0xE - bl sub_80CE018 - ldrb r1, [r4] - movs r0, 0 - bl sub_80CBC14 - b _080CDF8E - .pool -_080CDF68: - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x000021ff - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080CDF8E - bl get_preferred_box - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x02039d79 - ldrb r1, [r4] - bl sub_80CE018 - ldrb r1, [r4] - movs r0, 0x1 - bl sub_80CBC14 -_080CDF8E: - ldr r1, =0x02039d7a - movs r0, 0x1 - strb r0, [r1] -_080CDF94: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CDF38 - - thumb_func_start sub_80CDFAC -sub_80CDFAC: @ 80CDFAC - push {r4,r5,lr} - ldr r0, =0x02039d78 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - beq _080CDFDC - cmp r0, 0x1 - bne _080CDFFE - ldr r4, =0x02039d79 - ldrb r1, [r4] - movs r0, 0xE - bl diegohint2 - ldrb r1, [r4] - movs r0, 0xE - bl sub_80CBCAC - b _080CDFF8 - .pool -_080CDFDC: - bl get_preferred_box - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =0x02039d79 - ldrb r1, [r5] - adds r0, r4, 0 - bl diegohint2 - ldrb r1, [r5] - adds r0, r4, 0 - bl sub_80CBCAC -_080CDFF8: - ldr r1, =0x02039d7a - movs r0, 0 - strb r0, [r1] -_080CDFFE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CDFAC - - thumb_func_start sub_80CE00C -sub_80CE00C: @ 80CE00C - push {lr} - bl sub_80CEB40 - pop {r0} - bx r0 - thumb_func_end sub_80CE00C - - thumb_func_start sub_80CE018 -sub_80CE018: @ 80CE018 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - cmp r4, 0xE - bne _080CE054 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x000020a4 - adds r0, r1 - ldr r3, =0x020244ec - ldr r1, =0x02039d79 - movs r2, 0 - ldrsb r2, [r1, r2] - movs r1, 0x64 - muls r1, r2 - adds r1, r3 - movs r2, 0x64 - bl memcpy - b _080CE064 - .pool -_080CE054: - ldr r0, =0x02039d08 - ldr r2, [r0] - ldr r0, =0x000020a4 - adds r2, r0 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80D2054 -_080CE064: - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80CE0E8 - ldr r0, =0x02039d7b - strb r4, [r0] - ldr r0, =0x02039d7c - strb r5, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CE018 - - thumb_func_start diegohint2 -diegohint2: @ 80CE08C - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - cmp r6, 0xE - bne _080CE0C0 - ldr r1, =0x020244ec - movs r0, 0x64 - muls r0, r7 - adds r0, r1 - ldr r1, =0x02039d08 - ldr r1, [r1] - ldr r2, =0x000020a4 - adds r1, r2 - movs r2, 0x64 - bl memcpy - b _080CE0D8 - .pool -_080CE0C0: - ldr r5, =0x02039d08 - ldr r0, [r5] - ldr r4, =0x000020a4 - adds r0, r4 - bl pokemon_restore_pp - ldr r2, [r5] - adds r2, r4 - adds r0, r6, 0 - adds r1, r7, 0 - bl sub_80D1F18 -_080CE0D8: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end diegohint2 - - thumb_func_start sub_80CE0E8 -sub_80CE0E8: @ 80CE0E8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r0, 0xE - bne _080CE108 - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - bl zero_pokemon_struct - b _080CE10C - .pool -_080CE108: - bl sub_80D2018 -_080CE10C: - pop {r0} - bx r0 - thumb_func_end sub_80CE0E8 - - thumb_func_start diegohint1 -diegohint1: @ 80CE110 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - cmp r6, 0xE - bne _080CE144 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x00002108 - adds r0, r1 - ldr r2, =0x020244ec - movs r1, 0x64 - muls r1, r7 - adds r1, r2 - movs r2, 0x64 - bl memcpy - b _080CE154 - .pool -_080CE144: - ldr r0, =0x02039d08 - ldr r2, [r0] - ldr r0, =0x00002108 - adds r2, r0 - adds r0, r6, 0 - adds r1, r7, 0 - bl sub_80D2054 -_080CE154: - adds r0, r6, 0 - adds r1, r7, 0 - bl diegohint2 - ldr r5, =0x02039d08 - ldr r1, [r5] - ldr r4, =0x000020a4 - adds r0, r1, r4 - ldr r2, =0x00002108 - adds r1, r2 - movs r2, 0x64 - bl memcpy - ldr r0, [r5] - adds r0, r4 - movs r1, 0 - bl sub_80CEC00 - ldr r0, =0x02039d7b - strb r6, [r0] - ldr r0, =0x02039d7c - strb r7, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end diegohint1 - - thumb_func_start sub_80CE19C -sub_80CE19C: @ 80CE19C - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r6, 0 - bl sub_80C6FD4 - lsls r0, 16 - lsrs r4, r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _080CE1BA - movs r0, 0 - b _080CE21A -_080CE1BA: - ldr r5, =0x02039d7a - ldrb r0, [r5] - cmp r0, 0 - beq _080CE1DC - lsls r4, 24 - lsrs r1, r4, 24 - adds r0, r6, 0 - bl diegohint2 - bl sub_80CBAC4 - movs r0, 0 - strb r0, [r5] - b _080CE1F6 - .pool -_080CE1DC: - ldr r5, =0x02039d79 - ldrb r1, [r5] - movs r0, 0xE - bl sub_80CE018 - lsls r4, 24 - lsrs r1, r4, 24 - adds r0, r6, 0 - bl diegohint2 - ldrb r0, [r5] - bl sub_80CBB68 -_080CE1F6: - bl get_preferred_box - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - bne _080CE208 - lsrs r0, r4, 24 - bl sub_80CB140 -_080CE208: - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x00000cb4 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x1 - bl StartObjectImageAnim - movs r0, 0x1 -_080CE21A: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80CE19C - - thumb_func_start sub_80CE22C -sub_80CE22C: @ 80CE22C - push {lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x00000cb4 - adds r0, r1 - ldr r0, [r0] - movs r1, 0 - bl StartObjectImageAnim - bl sub_80CEB40 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CE22C - - thumb_func_start sub_80CE250 -sub_80CE250: @ 80CE250 - push {lr} - ldr r0, =0x02039d7a - ldrb r0, [r0] - cmp r0, 0 - beq _080CE264 - movs r2, 0x2 - b _080CE274 - .pool -_080CE264: - ldr r0, =0x02039d78 - movs r1, 0 - ldrsb r1, [r0, r1] - movs r2, 0x1 - eors r1, r2 - negs r0, r1 - orrs r0, r1 - lsrs r2, r0, 31 -_080CE274: - ldr r0, =0x02039d79 - ldrb r1, [r0] - adds r0, r2, 0 - bl sub_80CBF14 - ldr r0, =0x02039d08 - ldr r1, [r0] - ldr r2, =0x000021e0 - adds r0, r1, r2 - ldr r2, =0x00000cee - adds r1, r2 - bl CopyString - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CE250 - - thumb_func_start sub_80CE2A8 -sub_80CE2A8: @ 80CE2A8 - push {lr} - bl sub_80CBFD8 - lsls r0, 24 - cmp r0, 0 - beq _080CE2B8 - movs r0, 0x1 - b _080CE2CA -_080CE2B8: - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x00000cb4 - adds r0, r1 - ldr r0, [r0] - movs r1, 0 - bl StartObjectImageAnim - movs r0, 0 -_080CE2CA: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80CE2A8 - - thumb_func_start sub_80CE2D8 -sub_80CE2D8: @ 80CE2D8 - push {lr} - bl sub_80CC020 - ldr r1, =0x02039d7a - ldrb r0, [r1] - cmp r0, 0 - beq _080CE2F0 - movs r0, 0 - strb r0, [r1] - b _080CE316 - .pool -_080CE2F0: - ldr r0, =0x02039d78 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x1 - bne _080CE304 - movs r2, 0xE - b _080CE30C - .pool -_080CE304: - bl get_preferred_box - lsls r0, 24 - lsrs r2, r0, 24 -_080CE30C: - ldr r0, =0x02039d79 - ldrb r1, [r0] - adds r0, r2, 0 - bl sub_80CE0E8 -_080CE316: - bl sub_80CEB40 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CE2D8 - - thumb_func_start sub_80CE324 -sub_80CE324: @ 80CE324 - push {lr} - ldr r0, =0x02039d7a - ldrb r0, [r0] - cmp r0, 0 - beq _080CE33E - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x00000cb4 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x3 - bl StartObjectImageAnim -_080CE33E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CE324 - - thumb_func_start sub_80CE350 -sub_80CE350: @ 80CE350 - push {r4,r5,lr} - adds r3, r0, 0 - movs r5, 0 - ldr r4, =gUnknown_0857B9A4 -_080CE358: - movs r1, 0 - ldrsb r1, [r4, r1] - cmp r1, 0x22 - beq _080CE378 - ldr r0, =0x03005d8c - ldr r2, [r0] - movs r0, 0x4 - ldrsb r0, [r2, r0] - cmp r1, r0 - bne _080CE37E - movs r1, 0x1 - ldrsb r1, [r4, r1] - movs r0, 0x5 - ldrsb r0, [r2, r0] - cmp r1, r0 - bne _080CE37E -_080CE378: - ldrh r0, [r4, 0x2] - strh r0, [r3] - adds r3, 0x2 -_080CE37E: - adds r4, 0x4 - adds r5, 0x1 - cmp r5, 0x5 - bls _080CE358 - ldr r1, =0x00000163 - adds r0, r1, 0 - strh r0, [r3] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CE350 - - thumb_func_start sub_80CE3A0 -sub_80CE3A0: @ 80CE3A0 - push {r4,r5,lr} - bl sub_80CE51C - adds r3, r0, 0 - cmp r3, 0 - bne _080CE3D0 - ldr r2, =0x02039d08 - ldr r0, [r2] - ldr r1, =0x0000216d - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r2] - ldr r2, =0x0000216c - adds r0, r2 - strb r3, [r0] - b _080CE504 - .pool -_080CE3D0: - ldr r0, =0x02039d7a - ldrb r0, [r0] - cmp r0, 0 - beq _080CE418 - ldr r4, =0x02039d08 - ldr r1, [r4] - ldr r3, =0x00002108 - adds r0, r1, r3 - ldr r2, =0x000020a4 - adds r1, r2 - movs r2, 0x64 - bl memcpy - ldr r0, [r4] - ldr r3, =0x00002170 - adds r0, r3 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r4] - ldr r1, =0x00002171 - adds r0, r1 - movs r1, 0x1 - negs r1, r1 - b _080CE494 - .pool -_080CE418: - ldr r0, =0x02039d78 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x1 - bne _080CE464 - ldr r4, =0x02039d08 - ldr r0, [r4] - ldr r2, =0x00002108 - adds r0, r2 - ldr r3, =0x020244ec - ldr r1, =0x02039d79 - movs r2, 0 - ldrsb r2, [r1, r2] - movs r1, 0x64 - muls r1, r2 - adds r1, r3 - movs r2, 0x64 - bl memcpy - ldr r0, [r4] - ldr r3, =0x00002170 - adds r0, r3 - movs r1, 0xE - strb r1, [r0] - b _080CE488 - .pool -_080CE464: - bl get_preferred_box - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02039d79 - ldrb r1, [r1] - ldr r4, =0x02039d08 - ldr r2, [r4] - ldr r3, =0x00002108 - adds r2, r3 - bl sub_80D2054 - bl get_preferred_box - ldr r1, [r4] - ldr r2, =0x00002170 - adds r1, r2 - strb r0, [r1] -_080CE488: - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x02039d79 - ldrb r1, [r1] - ldr r3, =0x00002171 - adds r0, r3 -_080CE494: - strb r1, [r0] - ldr r5, =0x02039d08 - ldr r0, [r5] - ldr r4, =0x00002176 - adds r0, r4 - bl sub_80CE350 - ldr r2, [r5] - ldr r1, =0x00002108 - adds r0, r2, r1 - adds r2, r4 - movs r1, 0x51 - bl pokemon_getattr - ldr r2, [r5] - ldr r3, =0x00002174 - adds r1, r2, r3 - strh r0, [r1] - lsls r0, 16 - cmp r0, 0 - beq _080CE4E8 - ldr r0, =0x0000216d - adds r1, r2, r0 - movs r0, 0 - strb r0, [r1] - b _080CE4F8 - .pool -_080CE4E8: - ldr r1, =0x0000216d - adds r0, r2, r1 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r5] - ldr r2, =0x0000216c - adds r0, r2 - strb r1, [r0] -_080CE4F8: - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r3, =0x00002172 - adds r0, r3 - movs r1, 0 - strh r1, [r0] -_080CE504: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CE3A0 - - thumb_func_start sub_80CE51C -sub_80CE51C: @ 80CE51C - push {r4-r6,lr} - ldr r0, =0x02039d7a - ldrb r1, [r0] - negs r0, r1 - orrs r0, r1 - lsrs r5, r0, 31 - movs r4, 0 -_080CE52A: - movs r0, 0x64 - muls r0, r4 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x5 - bl pokemon_getattr - cmp r0, 0 - beq _080CE53E - adds r5, 0x1 -_080CE53E: - adds r4, 0x1 - cmp r4, 0x5 - ble _080CE52A - cmp r5, 0x2 - ble _080CE554 -_080CE548: - movs r0, 0x1 - b _080CE578 - .pool -_080CE554: - movs r6, 0 -_080CE556: - movs r4, 0 -_080CE558: - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_80D2270 - cmp r0, 0 - beq _080CE56A - adds r5, 0x1 - cmp r5, 0x2 - bgt _080CE548 -_080CE56A: - adds r4, 0x1 - cmp r4, 0x1D - ble _080CE558 - adds r6, 0x1 - cmp r6, 0xD - ble _080CE556 - movs r0, 0 -_080CE578: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80CE51C - - thumb_func_start sub_80CE580 -sub_80CE580: @ 80CE580 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x02039d08 - ldr r2, [r0] - ldr r3, =0x0000216d - adds r1, r2, r3 - ldrb r1, [r1] - adds r5, r0, 0 - cmp r1, 0 - beq _080CE5B0 - ldr r1, =0x0000216c - adds r0, r2, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - b _080CE736 - .pool -_080CE5B0: - ldr r3, =0x00002172 - adds r0, r2, r3 - ldrh r0, [r0] - cmp r0, 0 - beq _080CE5C4 - cmp r0, 0x1 - beq _080CE690 - b _080CE732 - .pool -_080CE5C4: - movs r6, 0 -_080CE5C6: - ldr r2, [r5] - ldr r1, =0x00002170 - adds r0, r2, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0xE - bne _080CE5E4 - ldr r3, =0x00002171 - adds r0, r2, r3 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, r6 - beq _080CE606 -_080CE5E4: - movs r0, 0x64 - muls r0, r6 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x00002176 - adds r2, r1 - movs r1, 0x51 - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - ldr r1, [r5] - ldr r2, =0x00002174 - adds r1, r2 - ldrh r0, [r1] - bics r0, r4 - strh r0, [r1] -_080CE606: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x5 - bls _080CE5C6 - ldr r2, =0x02039d08 - ldr r1, [r2] - ldr r3, =0x00002174 - adds r0, r1, r3 - ldrh r0, [r0] - cmp r0, 0 - bne _080CE64C - subs r3, 0x7 - adds r0, r1, r3 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r2] - ldr r2, =0x0000216c - adds r0, r2 - strb r1, [r0] - b _080CE732 - .pool -_080CE64C: - ldr r3, =0x0000216e - adds r0, r1, r3 - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - adds r3, 0x1 - adds r0, r3 - strb r1, [r0] - ldr r1, [r2] - ldr r0, =0x00002172 - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _080CE732 - .pool -_080CE674: - ldr r1, =0x0000216d - adds r0, r5, r1 - movs r1, 0x1 - strb r1, [r0] - mov r2, r8 - ldr r0, [r2] - ldr r3, =0x0000216c - adds r0, r3 - strb r1, [r0] - b _080CE732 - .pool -_080CE690: - movs r6, 0 - mov r8, r5 - ldr r7, =0x0000ffff -_080CE696: - mov r0, r8 - ldr r3, [r0] - ldr r1, =0x0000216e - adds r0, r3, r1 - ldrb r0, [r0] - ldr r2, =0x0000216f - adds r1, r3, r2 - ldrb r1, [r1] - adds r2, 0x7 - adds r3, r2 - movs r2, 0x51 - bl sub_80D1ED0 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _080CE6E0 - ldr r5, [r5] - ldr r3, =0x00002170 - adds r0, r5, r3 - ldrh r2, [r0] - ldr r1, =0x0000216e - adds r0, r5, r1 - ldrh r3, [r0] - adds r1, r7, 0 - ands r1, r2 - adds r0, r7, 0 - ands r0, r3 - cmp r1, r0 - beq _080CE6E0 - ldr r2, =0x00002174 - adds r1, r5, r2 - ldrh r0, [r1] - bics r0, r4 - strh r0, [r1] - cmp r0, 0 - beq _080CE674 -_080CE6E0: - ldr r2, =0x02039d08 - ldr r1, [r2] - ldr r3, =0x0000216f - adds r1, r3 - ldrb r0, [r1] - adds r0, 0x1 - movs r3, 0 - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - adds r5, r2, 0 - cmp r0, 0x1D - ble _080CE728 - ldr r0, [r2] - ldr r1, =0x0000216f - adds r0, r1 - strb r3, [r0] - ldr r1, [r2] - ldr r0, =0x0000216e - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0xD - ble _080CE728 - ldr r0, [r2] - ldr r1, =0x0000216d - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r2] - ldr r2, =0x0000216c - adds r0, r2 - strb r3, [r0] -_080CE728: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x1D - bls _080CE696 -_080CE732: - movs r0, 0x1 - negs r0, r0 -_080CE736: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80CE580 - - thumb_func_start sub_80CE760 -sub_80CE760: @ 80CE760 - push {lr} - ldr r0, =0x02039d7a - ldrb r0, [r0] - cmp r0, 0 - beq _080CE77A - ldr r0, =0x02039d14 - ldr r1, =0x02039d08 - ldr r1, [r1] - ldr r2, =0x000020a4 - adds r1, r2 - movs r2, 0x64 - bl memcpy -_080CE77A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CE760 - - thumb_func_start sub_80CE790 -sub_80CE790: @ 80CE790 - push {lr} - ldr r0, =0x02039d7a - ldrb r0, [r0] - cmp r0, 0 - beq _080CE7D8 - ldr r0, =0x02039d7b - ldrb r0, [r0] - cmp r0, 0xE - bne _080CE7C8 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x000020a4 - adds r0, r1 - ldr r1, =0x02039d14 - movs r2, 0x64 - bl memcpy - b _080CE7D8 - .pool -_080CE7C8: - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x000020a4 - adds r0, r1 - ldr r1, =0x02039d14 - movs r2, 0x50 - bl memcpy -_080CE7D8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CE790 - - thumb_func_start sub_80CE7E8 -sub_80CE7E8: @ 80CE7E8 - push {r4,r5,lr} - ldr r0, =0x02039d7a - ldrb r5, [r0] - cmp r5, 0 - beq _080CE838 - bl sub_80CE760 - ldr r3, =0x02039d08 - ldr r1, [r3] - ldr r0, =0x0000218c - adds r2, r1, r0 - ldr r0, =0x02039d14 - str r0, [r2] - ldr r2, =0x00002187 - adds r1, r2 - movs r2, 0 - strb r2, [r1] - ldr r0, [r3] - ldr r4, =0x00002186 - adds r0, r4 - strb r2, [r0] - ldr r0, [r3] - ldr r1, =0x00002188 - adds r0, r1 - strb r2, [r0] - b _080CE8CA - .pool -_080CE838: - ldr r0, =0x02039d78 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x1 - bne _080CE894 - ldr r4, =0x02039d08 - ldr r1, [r4] - ldr r0, =0x0000218c - adds r2, r1, r0 - ldr r0, =0x020244ec - str r0, [r2] - ldr r0, =0x02039d79 - ldrb r0, [r0] - ldr r2, =0x00002187 - adds r1, r2 - strb r0, [r1] - bl sub_80C70C4 - ldr r1, [r4] - subs r0, 0x1 - ldr r2, =0x00002186 - adds r1, r2 - strb r0, [r1] - ldr r0, [r4] - ldr r4, =0x00002188 - adds r0, r4 - strb r5, [r0] - b _080CE8CA - .pool -_080CE894: - bl get_preferred_box - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl get_pokemon_by_box_and_pos - ldr r3, =0x02039d08 - ldr r2, [r3] - ldr r4, =0x0000218c - adds r1, r2, r4 - str r0, [r1] - ldr r0, =0x02039d79 - ldrb r0, [r0] - ldr r1, =0x00002187 - adds r2, r1 - strb r0, [r2] - ldr r0, [r3] - ldr r2, =0x00002186 - adds r0, r2 - movs r1, 0x1D - strb r1, [r0] - ldr r0, [r3] - subs r4, 0x4 - adds r0, r4 - movs r1, 0x2 - strb r1, [r0] -_080CE8CA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CE7E8 - - thumb_func_start sub_80CE8E4 -sub_80CE8E4: @ 80CE8E4 - push {lr} - ldr r0, =0x02039d7a - ldrb r0, [r0] - cmp r0, 0 - beq _080CE8F8 - bl sub_80CE790 - b _080CE900 - .pool -_080CE8F8: - ldr r0, =0x02039d79 - ldr r1, =0x0203cf20 - ldrb r1, [r1] - strb r1, [r0] -_080CE900: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CE8E4 - - thumb_func_start party_compaction -party_compaction: @ 80CE90C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r7, =0x0000ffff - movs r6, 0 - movs r5, 0 - movs r0, 0x64 - mov r9, r0 - ldr r1, =0x020244ec - mov r8, r1 - subs r0, 0x65 - mov r10, r0 -_080CE928: - mov r0, r9 - muls r0, r6 - mov r1, r8 - adds r4, r0, r1 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - cmp r0, 0 - beq _080CE960 - cmp r6, r5 - beq _080CE950 - mov r0, r9 - muls r0, r5 - add r0, r8 - adds r1, r4, 0 - movs r2, 0x64 - bl memcpy -_080CE950: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - b _080CE96A - .pool -_080CE960: - lsls r0, r7, 16 - asrs r0, 16 - cmp r0, r10 - bne _080CE96A - adds r7, r6, 0 -_080CE96A: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x5 - bls _080CE928 - lsls r7, 16 - cmp r5, 0x5 - bhi _080CE992 - movs r6, 0x64 - ldr r4, =0x020244ec -_080CE97E: - adds r0, r5, 0 - muls r0, r6 - adds r0, r4 - bl zero_pokemon_struct - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x5 - bls _080CE97E -_080CE992: - asrs r0, r7, 16 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end party_compaction - - thumb_func_start sub_80CE9A8 -sub_80CE9A8: @ 80CE9A8 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - strb r0, [r1] - ldr r2, =0x02039d08 - ldr r1, [r2] - ldr r3, =0x00000ceb - adds r1, r3 - strb r0, [r1] - ldr r0, =0x02039d7a - ldrb r0, [r0] - cmp r0, 0 - beq _080CE9E8 - ldr r0, [r2] - ldr r1, =0x000020a4 - adds r0, r1 - movs r1, 0x8 - mov r2, sp - bl pokemon_setattr - b _080CEA1C - .pool -_080CE9E8: - ldr r4, =0x02039d78 - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0x1 - bne _080CEA08 - ldr r0, =0x02039d79 - movs r1, 0 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x8 - mov r2, sp - bl pokemon_setattr -_080CEA08: - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0 - bne _080CEA1C - ldr r0, =0x02039d79 - ldrb r0, [r0] - movs r1, 0x8 - mov r2, sp - bl set_pokemon_data_from_selected_box -_080CEA1C: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CE9A8 - - thumb_func_start sub_80CEA30 -sub_80CEA30: @ 80CEA30 - push {lr} - ldr r0, =0x02039d78 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x1 - bne _080CEA64 - ldr r0, =0x02039d7a - ldrb r0, [r0] - cmp r0, 0 - bne _080CEA64 - ldr r0, =0x02039d79 - ldrb r0, [r0] - bl sub_80C7050 - lsls r0, 24 - cmp r0, 0 - bne _080CEA64 - movs r0, 0x1 - b _080CEA66 - .pool -_080CEA64: - movs r0, 0 -_080CEA66: - pop {r1} - bx r1 - thumb_func_end sub_80CEA30 - - thumb_func_start sub_80CEA6C -sub_80CEA6C: @ 80CEA6C - push {lr} - ldr r0, =0x02039d7a - ldrb r0, [r0] - cmp r0, 0 - beq _080CEAC8 - ldr r0, =0x02039d78 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x1 - bne _080CEAAC - ldr r0, =0x02039d79 - ldrb r0, [r0] - bl sub_80C7050 - lsls r0, 24 - cmp r0, 0 - bne _080CEAAC - ldr r0, =0x02039d08 - ldr r1, [r0] - ldr r2, =0x00000ced - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080CEAC8 - ldr r2, =0x000020a4 - adds r0, r1, r2 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _080CEAC8 -_080CEAAC: - movs r0, 0x1 - b _080CEACA - .pool -_080CEAC8: - movs r0, 0 -_080CEACA: - pop {r1} - bx r1 - thumb_func_end sub_80CEA6C - - thumb_func_start sub_80CEAD0 -sub_80CEAD0: @ 80CEAD0 - ldr r0, =0x02039d7a - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80CEAD0 - - thumb_func_start sub_80CEADC -sub_80CEADC: @ 80CEADC - push {lr} - movs r1, 0 - ldr r0, =0x02039d78 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x2 - bne _080CEAEE - movs r1, 0x1 -_080CEAEE: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80CEADC - - thumb_func_start sub_80CEAF8 -sub_80CEAF8: @ 80CEAF8 - push {lr} - movs r1, 0 - ldr r0, =0x02039d78 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x3 - bne _080CEB16 - ldr r0, =0x02039d79 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x1 - bne _080CEB16 - movs r1, 0x1 -_080CEB16: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80CEAF8 - - thumb_func_start sub_80CEB24 -sub_80CEB24: @ 80CEB24 - push {lr} - movs r1, 0 - ldr r0, =0x02039d78 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - bne _080CEB36 - movs r1, 0x1 -_080CEB36: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80CEB24 - - thumb_func_start sub_80CEB40 -sub_80CEB40: @ 80CEB40 - push {r4,lr} - ldr r0, =0x02039d08 - ldr r1, [r0] - movs r2, 0 - ldr r3, =0x02039d7a - ldrb r0, [r3] - cmp r0, 0 - bne _080CEB52 - movs r2, 0x1 -_080CEB52: - ldr r4, =0x00000cea - adds r0, r1, r4 - strb r2, [r0] - ldrb r0, [r3] - cmp r0, 0 - bne _080CEBD0 - ldr r0, =0x02039d78 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x1 - beq _080CEB8A - cmp r0, 0x1 - bgt _080CEB84 - cmp r0, 0 - beq _080CEBBA - b _080CEBD0 - .pool -_080CEB84: - cmp r0, 0x3 - bgt _080CEBD0 - b _080CEBB0 -_080CEB8A: - ldr r1, =0x02039d79 - movs r0, 0 - ldrsb r0, [r1, r0] - cmp r0, 0x5 - bgt _080CEBB0 - adds r1, r0, 0 - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0 - bl sub_80CEC00 - b _080CEBD0 - .pool -_080CEBB0: - movs r0, 0 - movs r1, 0x2 - bl sub_80CEC00 - b _080CEBD0 -_080CEBBA: - bl get_preferred_box - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02039d79 - ldrb r1, [r1] - bl get_pokemon_by_box_and_pos - movs r1, 0x1 - bl sub_80CEC00 -_080CEBD0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CEB40 - - thumb_func_start sub_80CEBDC -sub_80CEBDC: @ 80CEBDC - push {lr} - ldr r0, =0x02039d7a - ldrb r0, [r0] - cmp r0, 0 - beq _080CEBF8 - ldr r0, =0x02039d14 - movs r1, 0 - bl sub_80CEC00 - b _080CEBFC - .pool -_080CEBF8: - bl sub_80CEB40 -_080CEBFC: - pop {r0} - bx r0 - thumb_func_end sub_80CEBDC - - thumb_func_start sub_80CEC00 -sub_80CEC00: @ 80CEC00 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r5, r1, 0 - ldr r0, =0x02039d08 - mov r8, r0 - ldr r1, [r0] - ldr r3, =0x00000ce6 - adds r2, r1, r3 - movs r0, 0 - strh r0, [r2] - mov r9, r0 - mov r10, r0 - cmp r5, 0 - bne _080CED18 - adds r6, r4, 0 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - mov r2, r8 - ldr r1, [r2] - ldr r3, =0x00000ce4 - adds r1, r3 - strh r0, [r1] - lsls r0, 16 - cmp r0, 0 - bne _080CEC44 - b _080CEE34 -_080CEC44: - adds r0, r4, 0 - movs r1, 0x4 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - cmp r0, 0 - beq _080CEC74 - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x00000ced - adds r0, r2 - movs r1, 0x1 - strb r1, [r0] - b _080CEC86 - .pool -_080CEC74: - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - mov r3, r8 - ldr r1, [r3] - ldr r2, =0x00000ced - adds r1, r2 - strb r0, [r1] -_080CEC86: - ldr r4, =0x02039d08 - ldr r2, [r4] - ldr r5, =0x00000cee - adds r2, r5 - adds r0, r6, 0 - movs r1, 0x2 - bl pokemon_getattr - ldr r0, [r4] - adds r0, r5 - bl GetStringEnd_Limit7 - adds r0, r6, 0 - movs r1, 0x38 - bl pokemon_getattr - ldr r1, [r4] - ldr r3, =0x00000cec - adds r1, r3 - strb r0, [r1] - adds r0, r6, 0 - movs r1, 0x8 - bl pokemon_getattr - ldr r1, [r4] - ldr r2, =0x00000ceb - adds r1, r2 - strb r0, [r1] - adds r0, r6, 0 - movs r1, 0 - bl pokemon_getattr - ldr r1, [r4] - movs r3, 0xCE - lsls r3, 4 - adds r1, r3 - str r0, [r1] - adds r0, r6, 0 - bl pokemon_get_pal - ldr r1, [r4] - ldr r2, =0x00000cdc - adds r1, r2 - str r0, [r1] - adds r0, r6, 0 - bl pokemon_get_gender - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - adds r0, r6, 0 - movs r1, 0xC - bl pokemon_getattr - ldr r1, [r4] - ldr r3, =0x00000ce6 - adds r1, r3 - strh r0, [r1] - b _080CEE26 - .pool -_080CED18: - cmp r5, 0x1 - beq _080CED1E - b _080CEE1C -_080CED1E: - adds r7, r4, 0 - adds r0, r7, 0 - movs r1, 0x41 - bl pokemon_getattr_encrypted - mov r2, r8 - ldr r1, [r2] - ldr r3, =0x00000ce4 - adds r1, r3 - strh r0, [r1] - lsls r0, 16 - cmp r0, 0 - bne _080CED3A - b _080CEE34 -_080CED3A: - adds r0, r7, 0 - movs r1, 0x1 - bl pokemon_getattr_encrypted - mov r9, r0 - adds r0, r7, 0 - movs r1, 0x4 - bl pokemon_getattr_encrypted - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - cmp r0, 0 - beq _080CED6C - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x00000ced - adds r0, r2 - strb r5, [r0] - b _080CED7E - .pool -_080CED6C: - adds r0, r7, 0 - movs r1, 0x2D - bl pokemon_getattr_encrypted - mov r3, r8 - ldr r1, [r3] - ldr r2, =0x00000ced - adds r1, r2 - strb r0, [r1] -_080CED7E: - ldr r5, =0x02039d08 - ldr r2, [r5] - ldr r4, =0x00000cee - adds r2, r4 - adds r0, r7, 0 - movs r1, 0x2 - bl pokemon_getattr_encrypted - ldr r0, [r5] - adds r0, r4 - bl GetStringEnd_Limit7 - adds r0, r7, 0 - bl sub_80690C0 - ldr r1, [r5] - ldr r3, =0x00000cec - adds r1, r3 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0x8 - bl pokemon_getattr_encrypted - ldr r1, [r5] - ldr r2, =0x00000ceb - adds r1, r2 - strb r0, [r1] - adds r0, r7, 0 - movs r1, 0 - bl pokemon_getattr_encrypted - adds r2, r0, 0 - ldr r1, [r5] - movs r6, 0xCE - lsls r6, 4 - adds r0, r1, r6 - str r2, [r0] - subs r4, 0xA - adds r1, r4 - ldrh r0, [r1] - mov r1, r9 - bl species_and_otid_get_pal - ldr r1, [r5] - ldr r3, =0x00000cdc - adds r2, r1, r3 - str r0, [r2] - adds r4, r1, r4 - ldrh r0, [r4] - adds r1, r6 - ldr r1, [r1] - bl pokemon_species_get_gender_info - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - adds r0, r7, 0 - movs r1, 0xC - bl pokemon_getattr_encrypted - ldr r1, [r5] - ldr r2, =0x00000ce6 - adds r1, r2 - strh r0, [r1] - b _080CEE26 - .pool -_080CEE1C: - ldr r3, =0x00000ce4 - adds r0, r1, r3 - mov r1, r9 - strh r1, [r0] - strh r1, [r2] -_080CEE26: - ldr r0, =0x02039d08 - ldr r1, [r0] - ldr r2, =0x00000ce4 - adds r0, r1, r2 - ldrh r2, [r0] - cmp r2, 0 - bne _080CEE94 -_080CEE34: - ldr r4, =0x02039d08 - ldr r0, [r4] - ldr r3, =0x00000cee - adds r0, r3 - movs r1, 0 - movs r2, 0x5 - bl RepeatChar - ldr r0, [r4] - ldr r1, =0x00000cf9 - adds r0, r1 - movs r1, 0 - movs r2, 0x8 - bl RepeatChar - ldr r0, [r4] - ldr r2, =0x00000d1d - adds r0, r2 - movs r1, 0 - movs r2, 0x8 - bl RepeatChar - ldr r0, [r4] - ldr r3, =0x00000d41 - adds r0, r3 - movs r1, 0 - movs r2, 0x8 - bl RepeatChar - ldr r0, [r4] - ldr r1, =0x00000d65 - adds r0, r1 - b _080CEEF2 - .pool -_080CEE94: - ldr r3, =0x00000ced - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, 0 - beq _080CEF14 - mov r0, r10 - cmp r0, 0 - beq _080CEEC0 - ldr r2, =0x00000cf9 - adds r0, r1, r2 - adds r3, 0x1 - adds r1, r3 - movs r2, 0 - movs r3, 0x5 - bl CopyStringPadded - b _080CEECE - .pool -_080CEEC0: - ldr r2, =0x00000cf9 - adds r0, r1, r2 - ldr r1, =gUnknown_085E8264 - movs r2, 0 - movs r3, 0x8 - bl CopyStringPadded -_080CEECE: - ldr r4, =0x02039d08 - ldr r0, [r4] - ldr r3, =0x00000d1d - adds r0, r3 - movs r1, 0 - movs r2, 0x8 - bl RepeatChar - ldr r0, [r4] - ldr r1, =0x00000d41 - adds r0, r1 - movs r1, 0 - movs r2, 0x8 - bl RepeatChar - ldr r0, [r4] - ldr r2, =0x00000d65 - adds r0, r2 -_080CEEF2: - movs r1, 0 - movs r2, 0x8 - bl RepeatChar - b _080CF0B8 - .pool -_080CEF14: - cmp r2, 0x1D - beq _080CEF1C - cmp r2, 0x20 - bne _080CEF20 -_080CEF1C: - movs r3, 0xFF - mov r9, r3 -_080CEF20: - ldr r4, =0x02039d08 - ldr r1, [r4] - ldr r2, =0x00000cf9 - adds r0, r1, r2 - ldr r3, =0x00000cee - adds r1, r3 - movs r2, 0 - movs r3, 0x5 - bl CopyStringPadded - ldr r1, [r4] - ldr r0, =0x00000d1d - adds r2, r1, r0 - movs r0, 0xBA - strb r0, [r2] - ldr r3, =0x00000d1e - adds r2, r1, r3 - ldr r0, [r4] - ldr r1, =0x00000ce4 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r2, 0 - movs r2, 0 - movs r3, 0x5 - bl CopyStringPadded - ldr r4, [r4] - ldr r3, =0x00000d41 - adds r2, r4, r3 - movs r0, 0xFC - strb r0, [r2] - ldr r0, =0x00000d42 - adds r2, r4, r0 - movs r0, 0x4 - strb r0, [r2] - ldr r1, =0x00000d43 - adds r2, r4, r1 - mov r3, r9 - cmp r3, 0 - beq _080CEFD4 - cmp r3, 0xFE - beq _080CF000 - movs r0, 0x2 - strb r0, [r2] - ldr r0, =0x00000d44 - adds r2, r4, r0 - movs r0, 0x1 - strb r0, [r2] - adds r1, 0x2 - adds r2, r4, r1 - movs r0, 0x3 - strb r0, [r2] - ldr r3, =0x00000d46 - adds r2, r4, r3 - movs r0, 0x77 - strb r0, [r2] - ldr r0, =0x00000d47 - adds r2, r4, r0 - b _080CF020 - .pool -_080CEFD4: - strb r0, [r2] - ldr r1, =0x00000d44 - adds r2, r4, r1 - movs r0, 0x1 - strb r0, [r2] - ldr r3, =0x00000d45 - adds r2, r4, r3 - movs r0, 0x5 - strb r0, [r2] - ldr r0, =0x00000d46 - adds r2, r4, r0 - movs r0, 0xB5 - strb r0, [r2] - adds r1, 0x3 - adds r2, r4, r1 - b _080CF020 - .pool -_080CF000: - movs r0, 0x6 - strb r0, [r2] - ldr r3, =0x00000d44 - adds r2, r4, r3 - movs r0, 0x1 - strb r0, [r2] - ldr r0, =0x00000d45 - adds r2, r4, r0 - movs r0, 0x7 - strb r0, [r2] - ldr r1, =0x00000d46 - adds r2, r4, r1 - movs r0, 0xB6 - strb r0, [r2] - adds r3, 0x3 - adds r2, r4, r3 -_080CF020: - movs r0, 0xFC - strb r0, [r2] - adds r2, 0x1 - movs r0, 0x4 - strb r0, [r2] - adds r2, 0x1 - movs r0, 0x2 - strb r0, [r2] - adds r2, 0x1 - movs r0, 0x1 - strb r0, [r2] - adds r2, 0x1 - movs r0, 0x3 - strb r0, [r2] - adds r2, 0x1 - movs r5, 0 - strb r5, [r2] - adds r2, 0x1 - movs r0, 0xF9 - strb r0, [r2] - adds r2, 0x1 - movs r0, 0x5 - strb r0, [r2] - adds r2, 0x1 - ldr r4, =0x02039d08 - ldr r0, [r4] - ldr r1, =0x00000cec - adds r0, r1 - ldrb r1, [r0] - adds r0, r2, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - adds r2, r0, 0 - strb r5, [r2] - movs r0, 0xFF - strb r0, [r2, 0x1] - ldr r4, [r4] - ldr r2, =0x00000ce6 - adds r1, r4, r2 - ldrh r0, [r1] - cmp r0, 0 - beq _080CF0AC - ldr r3, =0x00000d65 - adds r4, r3 - bl itemid_get_item - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x8 - bl CopyStringPadded - b _080CF0B8 - .pool -_080CF0AC: - ldr r1, =0x00000d65 - adds r0, r4, r1 - movs r1, 0 - movs r2, 0x8 - bl RepeatChar -_080CF0B8: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CEC00 - - thumb_func_start sub_80CF0CC -sub_80CF0CC: @ 80CF0CC - push {lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x000021ff - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080CF0F4 - cmp r0, 0x1 - ble _080CF0E4 - cmp r0, 0x2 - beq _080CF0FA -_080CF0E4: - bl sub_80CF108 - b _080CF0FE - .pool -_080CF0F4: - bl sub_80CF374 - b _080CF0FE -_080CF0FA: - bl sub_80CF4B0 -_080CF0FE: - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_80CF0CC - - thumb_func_start sub_80CF108 -sub_80CF108: @ 80CF108 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x02039d78 - ldrb r0, [r0] - mov r8, r0 - ldr r2, =0x02039d79 - ldrb r4, [r2] - ldr r5, =0x02039d08 - ldr r0, [r5] - ldr r1, =0x00000cd2 - mov r10, r1 - add r0, r10 - movs r1, 0 - strb r1, [r0] - ldr r0, [r5] - ldr r7, =0x00000cd3 - adds r0, r7 - strb r1, [r0] - ldr r0, [r5] - ldr r3, =0x00000cd7 - mov r9, r3 - add r0, r9 - strb r1, [r0] - ldr r6, =0x030022c0 - ldrh r1, [r6, 0x30] - movs r0, 0x40 - ands r0, r1 - adds r3, r2, 0 - cmp r0, 0 - beq _080CF14C - b _080CF33C -_080CF14C: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080CF1A8 - movs r6, 0x1 - lsls r0, r4, 24 - movs r1, 0xC0 - lsls r1, 19 - adds r0, r1 - lsrs r4, r0, 24 - asrs r0, 24 - cmp r0, 0x1D - bgt _080CF168 - b _080CF358 -_080CF168: - movs r2, 0x3 - mov r8, r2 - subs r0, 0x1E - lsls r0, 24 - asrs r0, 24 - movs r1, 0x3 - bl __divsi3 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, [r5] - add r0, r10 - strb r6, [r0] - ldr r0, [r5] - add r0, r9 - strb r6, [r0] - b _080CF358 - .pool -_080CF1A8: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080CF1DE - movs r6, 0x1 - movs r0, 0 - ldrsb r0, [r3, r0] - movs r1, 0x6 - bl __modsi3 - lsls r0, 24 - cmp r0, 0 - beq _080CF1CA - lsls r0, r4, 24 - movs r3, 0xFF - lsls r3, 24 - b _080CF34C -_080CF1CA: - ldr r0, [r5] - adds r0, r7 - movs r1, 0xFF - strb r1, [r0] - lsls r0, r4, 24 - movs r1, 0xA0 - lsls r1, 19 - adds r0, r1 - lsrs r4, r0, 24 - b _080CF358 -_080CF1DE: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080CF212 - movs r6, 0x1 - movs r0, 0 - ldrsb r0, [r3, r0] - adds r0, 0x1 - movs r1, 0x6 - bl __modsi3 - cmp r0, 0 - beq _080CF204 - lsls r0, r4, 24 - movs r2, 0x80 - lsls r2, 17 - adds r0, r2 - lsrs r4, r0, 24 - b _080CF358 -_080CF204: - ldr r0, [r5] - adds r0, r7 - strb r6, [r0] - lsls r0, r4, 24 - movs r3, 0xFB - lsls r3, 24 - b _080CF34C -_080CF212: - ldrh r1, [r6, 0x2E] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _080CF220 - movs r6, 0x1 - b _080CF352 -_080CF220: - movs r4, 0x1 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080CF2E4 - bl sub_80CFA5C - lsls r0, 24 - cmp r0, 0 - beq _080CF2E4 - ldr r0, =0x02039d7d - ldrb r0, [r0] - cmp r0, 0 - bne _080CF244 - movs r0, 0x8 - b _080CF366 - .pool -_080CF244: - ldr r1, [r5] - ldrb r0, [r1, 0x1] - cmp r0, 0x2 - bne _080CF254 - ldr r0, =0x02039d7a - ldrb r0, [r0] - cmp r0, 0x1 - bne _080CF2D4 -_080CF254: - movs r0, 0 - bl sub_80CFF98 - subs r0, 0x1 - lsls r0, 24 - asrs r0, 24 - cmp r0, 0xE - bhi _080CF2E4 - lsls r0, 2 - ldr r1, =_080CF278 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080CF278: - .4byte _080CF2B4 - .4byte _080CF2B8 - .4byte _080CF2BC - .4byte _080CF2C0 - .4byte _080CF2C4 - .4byte _080CF2E4 - .4byte _080CF2E4 - .4byte _080CF2E4 - .4byte _080CF2E4 - .4byte _080CF2E4 - .4byte _080CF2E4 - .4byte _080CF2C8 - .4byte _080CF2CC - .4byte _080CF2E4 - .4byte _080CF2D0 -_080CF2B4: - movs r0, 0xB - b _080CF366 -_080CF2B8: - movs r0, 0xC - b _080CF366 -_080CF2BC: - movs r0, 0xD - b _080CF366 -_080CF2C0: - movs r0, 0xE - b _080CF366 -_080CF2C4: - movs r0, 0xF - b _080CF366 -_080CF2C8: - movs r0, 0x10 - b _080CF366 -_080CF2CC: - movs r0, 0x11 - b _080CF366 -_080CF2D0: - movs r0, 0x12 - b _080CF366 -_080CF2D4: - ldr r2, =0x000021ff - adds r0, r1, r2 - strb r4, [r0] - movs r0, 0x14 - b _080CF366 - .pool -_080CF2E4: - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080CF2F8 - movs r0, 0x13 - b _080CF366 - .pool -_080CF2F8: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0x1 - bne _080CF326 - ldrh r1, [r2, 0x2C] - movs r0, 0x80 - lsls r0, 2 - ands r0, r1 - cmp r0, 0 - beq _080CF318 - movs r0, 0xA - b _080CF366 - .pool -_080CF318: - movs r0, 0x80 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - beq _080CF326 - movs r0, 0x9 - b _080CF366 -_080CF326: - ldrh r1, [r2, 0x2E] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080CF338 - bl sub_80CFDC4 - movs r0, 0 - b _080CF366 -_080CF338: - movs r6, 0 - b _080CF364 -_080CF33C: - movs r6, 0x1 - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r0, 0x5 - ble _080CF352 - lsls r0, r4, 24 - movs r3, 0xFA - lsls r3, 24 -_080CF34C: - adds r0, r3 - lsrs r4, r0, 24 - b _080CF358 -_080CF352: - movs r0, 0x2 - mov r8, r0 - movs r4, 0 -_080CF358: - cmp r6, 0 - beq _080CF364 - mov r0, r8 - adds r1, r4, 0 - bl sub_80CD894 -_080CF364: - adds r0, r6, 0 -_080CF366: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80CF108 - - thumb_func_start sub_80CF374 -sub_80CF374: @ 80CF374 - push {r4,lr} - ldr r1, =0x030022c0 - ldrh r0, [r1, 0x2C] - movs r4, 0x1 - ands r4, r0 - cmp r4, 0 - beq _080CF428 - ldrh r1, [r1, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080CF3AC - ldr r4, =0x02039d79 - movs r0, 0 - ldrsb r0, [r4, r0] - movs r1, 0x6 - bl __divsi3 - lsls r0, 24 - cmp r0, 0 - beq _080CF420 - ldrb r1, [r4] - subs r1, 0x6 - b _080CF40E - .pool -_080CF3AC: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080CF3CC - ldr r1, =0x02039d79 - movs r0, 0 - ldrsb r0, [r1, r0] - adds r0, 0x6 - cmp r0, 0x1D - bgt _080CF420 - ldrb r1, [r1] - adds r1, 0x6 - b _080CF40E - .pool -_080CF3CC: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080CF3F0 - ldr r4, =0x02039d79 - movs r0, 0 - ldrsb r0, [r4, r0] - movs r1, 0x6 - bl __modsi3 - lsls r0, 24 - cmp r0, 0 - beq _080CF420 - ldrb r1, [r4] - subs r1, 0x1 - b _080CF40E - .pool -_080CF3F0: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080CF424 - ldr r4, =0x02039d79 - movs r0, 0 - ldrsb r0, [r4, r0] - adds r0, 0x1 - movs r1, 0x6 - bl __modsi3 - cmp r0, 0 - beq _080CF420 - ldrb r1, [r4] - adds r1, 0x1 -_080CF40E: - lsls r1, 24 - lsrs r1, 24 - movs r0, 0 - bl sub_80CD894 - movs r0, 0x15 - b _080CF49C - .pool -_080CF420: - movs r0, 0x18 - b _080CF49C -_080CF424: - movs r0, 0 - b _080CF49C -_080CF428: - bl sub_80D0BA4 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02039d79 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - cmp r0, r1 - beq _080CF47C - ldr r2, =0x02039d7a - ldr r0, =0x02039d08 - ldr r1, [r0] - ldr r3, =0x00000ce4 - adds r0, r1, r3 - ldrh r0, [r0] - negs r0, r0 - lsrs r0, 31 - strb r0, [r2] - ldr r0, =0x000021ff - adds r1, r0 - movs r0, 0x2 - strb r0, [r1] - bl get_preferred_box - ldr r1, =0x02039d7b - strb r0, [r1] - movs r0, 0x17 - b _080CF49C - .pool -_080CF47C: - ldr r1, =0x02039d08 - ldr r0, [r1] - ldr r2, =0x000021ff - adds r0, r2 - strb r4, [r0] - ldr r0, [r1] - ldr r3, =0x00000cb8 - adds r0, r3 - ldr r1, [r0] - adds r1, 0x3E - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - movs r0, 0x16 -_080CF49C: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80CF374 - - thumb_func_start sub_80CF4B0 -sub_80CF4B0: @ 80CF4B0 - push {r4,lr} - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080CF4DC - movs r0, 0 - bl sub_80D0580 - lsls r0, 24 - cmp r0, 0 - beq _080CF588 - ldr r0, =0x02039d79 - ldrb r1, [r0] - subs r1, 0x6 - b _080CF53A - .pool -_080CF4DC: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080CF4FC - movs r0, 0x1 - bl sub_80D0580 - lsls r0, 24 - cmp r0, 0 - beq _080CF588 - ldr r0, =0x02039d79 - ldrb r1, [r0] - adds r1, 0x6 - b _080CF53A - .pool -_080CF4FC: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080CF51C - movs r0, 0x2 - bl sub_80D0580 - lsls r0, 24 - cmp r0, 0 - beq _080CF5A2 - ldr r0, =0x02039d79 - ldrb r1, [r0] - subs r1, 0x1 - b _080CF53A - .pool -_080CF51C: - movs r0, 0x10 - ands r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _080CF54C - movs r0, 0x3 - bl sub_80D0580 - lsls r0, 24 - cmp r0, 0 - beq _080CF5B6 - ldr r0, =0x02039d79 - ldrb r1, [r0] - adds r1, 0x1 -_080CF53A: - lsls r1, 24 - lsrs r1, 24 - movs r0, 0 - bl sub_80CD894 - movs r0, 0x19 - b _080CF5BC - .pool -_080CF54C: - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080CF580 - bl sub_80D0BC0 - lsls r0, 24 - cmp r0, 0 - beq _080CF588 - ldr r0, =0x02039d7a - strb r4, [r0] - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x000021ff - adds r0, r1 - strb r4, [r0] - movs r0, 0x1A - b _080CF5BC - .pool -_080CF580: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080CF58C -_080CF588: - movs r0, 0x18 - b _080CF5BC -_080CF58C: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0x1 - bne _080CF5BA - ldrh r1, [r2, 0x2C] - movs r0, 0x80 - lsls r0, 2 - ands r0, r1 - cmp r0, 0 - beq _080CF5AC -_080CF5A2: - movs r0, 0xA - b _080CF5BC - .pool -_080CF5AC: - movs r0, 0x80 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - beq _080CF5BA -_080CF5B6: - movs r0, 0x9 - b _080CF5BC -_080CF5BA: - movs r0, 0 -_080CF5BC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80CF4B0 - - thumb_func_start sub_80CF5C4 -sub_80CF5C4: @ 80CF5C4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =0x02039d78 - ldrb r0, [r0] - mov r9, r0 - ldr r6, =0x02039d79 - ldrb r4, [r6] - ldr r2, =0x02039d08 - ldr r0, [r2] - ldr r1, =0x00000cd3 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - ldr r3, =0x00000cd2 - adds r0, r3 - strb r1, [r0] - ldr r0, [r2] - adds r3, 0x5 - adds r0, r3 - strb r1, [r0] - mov r8, r1 - movs r7, 0 - ldr r1, =0x030022c0 - ldrh r3, [r1, 0x30] - movs r0, 0x40 - ands r0, r3 - adds r5, r6, 0 - mov r12, r1 - cmp r0, 0 - beq _080CF608 - b _080CF7A8 -_080CF608: - movs r0, 0x80 - ands r0, r3 - cmp r0, 0 - beq _080CF64C - lsls r0, r4, 24 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r4, r0, 24 - asrs r0, 24 - cmp r0, 0x6 - ble _080CF622 - movs r4, 0 -_080CF622: - lsls r0, r4, 24 - asrs r0, 24 - movs r1, 0 - ldrsb r1, [r5, r1] - cmp r0, r1 - bne _080CF630 - b _080CF7C6 -_080CF630: - movs r7, 0x1 - b _080CF7CA - .pool -_080CF64C: - movs r0, 0x20 - ands r0, r3 - cmp r0, 0 - beq _080CF670 - ldrb r1, [r5] - movs r0, 0 - ldrsb r0, [r5, r0] - cmp r0, 0 - beq _080CF670 - movs r7, 0x1 - ldr r0, [r2] - ldr r2, =0x00000cd6 - adds r0, r2 - strb r1, [r0] - movs r4, 0 - b _080CF7C6 - .pool -_080CF670: - mov r3, r12 - ldrh r1, [r3, 0x30] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080CF69E - movs r0, 0 - ldrsb r0, [r5, r0] - cmp r0, 0 - bne _080CF694 - movs r7, 0x1 - ldr r0, [r2] - ldr r1, =0x00000cd6 - adds r0, r1 - ldrb r4, [r0] - b _080CF7C6 - .pool -_080CF694: - movs r7, 0x6 - movs r2, 0 - mov r9, r2 - movs r4, 0 - b _080CF7C6 -_080CF69E: - mov r3, r12 - ldrh r1, [r3, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080CF75C - movs r0, 0 - ldrsb r0, [r5, r0] - cmp r0, 0x6 - bne _080CF6C4 - ldr r0, [r2] - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bne _080CF6BE - movs r0, 0x4 - b _080CF7D8 -_080CF6BE: - movs r0, 0x1 - mov r8, r0 - b _080CF75C -_080CF6C4: - bl sub_80CFA5C - lsls r0, 24 - cmp r0, 0 - beq _080CF75C - ldr r0, =0x02039d7d - ldrb r0, [r0] - cmp r0, 0 - bne _080CF6E0 - movs r0, 0x8 - b _080CF7D8 - .pool -_080CF6E0: - movs r0, 0 - bl sub_80CFF98 - subs r0, 0x1 - lsls r0, 24 - asrs r0, 24 - cmp r0, 0xE - bhi _080CF75C - lsls r0, 2 - ldr r1, =_080CF700 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080CF700: - .4byte _080CF73C - .4byte _080CF740 - .4byte _080CF744 - .4byte _080CF748 - .4byte _080CF74C - .4byte _080CF75C - .4byte _080CF75C - .4byte _080CF75C - .4byte _080CF75C - .4byte _080CF75C - .4byte _080CF75C - .4byte _080CF750 - .4byte _080CF754 - .4byte _080CF75C - .4byte _080CF758 -_080CF73C: - movs r0, 0xB - b _080CF7D8 -_080CF740: - movs r0, 0xC - b _080CF7D8 -_080CF744: - movs r0, 0xD - b _080CF7D8 -_080CF748: - movs r0, 0xE - b _080CF7D8 -_080CF74C: - movs r0, 0xF - b _080CF7D8 -_080CF750: - movs r0, 0x10 - b _080CF7D8 -_080CF754: - movs r0, 0x11 - b _080CF7D8 -_080CF758: - movs r0, 0x12 - b _080CF7D8 -_080CF75C: - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2E] - movs r0, 0x2 - ands r0, r1 - mov r12, r2 - cmp r0, 0 - beq _080CF784 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bne _080CF780 - movs r0, 0x13 - b _080CF7D8 - .pool -_080CF780: - movs r1, 0x1 - mov r8, r1 -_080CF784: - mov r2, r8 - cmp r2, 0 - beq _080CF794 - movs r7, 0x6 - movs r3, 0 - mov r9, r3 - movs r4, 0 - b _080CF7C6 -_080CF794: - mov r0, r12 - ldrh r1, [r0, 0x2E] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080CF7C6 - bl sub_80CFDC4 - movs r0, 0 - b _080CF7D8 -_080CF7A8: - lsls r0, r4, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r4, r0, 24 - cmp r0, 0 - bge _080CF7B8 - movs r4, 0x6 -_080CF7B8: - lsls r0, r4, 24 - asrs r0, 24 - movs r1, 0 - ldrsb r1, [r6, r1] - cmp r0, r1 - beq _080CF7C6 - movs r7, 0x1 -_080CF7C6: - cmp r7, 0 - beq _080CF7D6 -_080CF7CA: - cmp r7, 0x6 - beq _080CF7D6 - mov r0, r9 - adds r1, r4, 0 - bl sub_80CD894 -_080CF7D6: - adds r0, r7, 0 -_080CF7D8: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80CF5C4 - - thumb_func_start sub_80CF7E4 -sub_80CF7E4: @ 80CF7E4 - push {r4-r6,lr} - ldr r3, =0x02039d08 - ldr r0, [r3] - ldr r1, =0x00000cd3 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r3] - ldr r2, =0x00000cd2 - adds r0, r2 - strb r1, [r0] - ldr r0, [r3] - ldr r5, =0x00000cd7 - adds r0, r5 - strb r1, [r0] - ldr r1, =0x030022c0 - ldrh r2, [r1, 0x30] - movs r0, 0x40 - ands r0, r2 - cmp r0, 0 - bne _080CF8AA - movs r0, 0x80 - ands r0, r2 - cmp r0, 0 - beq _080CF834 - movs r4, 0x1 - movs r1, 0 - movs r6, 0x2 - b _080CF8B6 - .pool -_080CF834: - ldrh r2, [r1, 0x2C] - movs r0, 0x20 - ands r0, r2 - cmp r0, 0 - bne _080CF85A - movs r0, 0x10 - ands r0, r2 - cmp r0, 0 - bne _080CF86E - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0x1 - bne _080CF872 - movs r0, 0x80 - lsls r0, 2 - ands r0, r2 - cmp r0, 0 - beq _080CF864 -_080CF85A: - movs r0, 0xA - b _080CF8D2 - .pool -_080CF864: - movs r0, 0x80 - lsls r0, 1 - ands r0, r2 - cmp r0, 0 - beq _080CF872 -_080CF86E: - movs r0, 0x9 - b _080CF8D2 -_080CF872: - ldrh r1, [r1, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080CF88A - movs r0, 0 - bl sub_80CD1A8 - bl sub_80CFA38 - movs r0, 0x7 - b _080CF8D2 -_080CF88A: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080CF896 - movs r0, 0x13 - b _080CF8D2 -_080CF896: - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080CF8A6 - bl sub_80CFDC4 - movs r0, 0 - b _080CF8D2 -_080CF8A6: - movs r4, 0 - b _080CF8D0 -_080CF8AA: - movs r4, 0x1 - movs r1, 0x3 - movs r6, 0 - ldr r0, [r3] - adds r0, r5 - strb r4, [r0] -_080CF8B6: - cmp r4, 0 - beq _080CF8D0 - lsls r5, r1, 24 - cmp r1, 0x2 - beq _080CF8C6 - movs r0, 0 - bl sub_80CD1A8 -_080CF8C6: - lsrs r0, r5, 24 - lsls r1, r6, 24 - lsrs r1, 24 - bl sub_80CD894 -_080CF8D0: - adds r0, r4, 0 -_080CF8D2: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80CF7E4 - - thumb_func_start sub_80CF8D8 -sub_80CF8D8: @ 80CF8D8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x02039d78 - ldrb r0, [r0] - mov r8, r0 - ldr r0, =0x02039d79 - mov r12, r0 - ldrb r2, [r0] - ldr r3, =0x02039d08 - ldr r0, [r3] - ldr r1, =0x00000cd3 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r3] - ldr r6, =0x00000cd2 - adds r0, r6 - strb r1, [r0] - ldr r0, [r3] - ldr r5, =0x00000cd7 - adds r0, r5 - strb r1, [r0] - ldr r7, =0x030022c0 - ldrh r1, [r7, 0x30] - movs r0, 0x40 - ands r0, r1 - adds r4, r3, 0 - cmp r0, 0 - bne _080CF9B2 - movs r0, 0x88 - ands r0, r1 - cmp r0, 0 - beq _080CF944 - movs r7, 0x1 - movs r0, 0x2 - mov r8, r0 - movs r2, 0 - ldr r0, [r4] - b _080CF9D0 - .pool -_080CF944: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080CF960 - movs r7, 0x1 - lsls r0, r2, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r2, r0, 24 - cmp r0, 0 - bge _080CF9D4 - movs r2, 0x1 - b _080CF9D4 -_080CF960: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080CF97E - movs r7, 0x1 - lsls r0, r2, 24 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r2, r0, 24 - asrs r0, 24 - cmp r0, 0x1 - ble _080CF9D4 - movs r2, 0 - b _080CF9D4 -_080CF97E: - ldrh r1, [r7, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080CF992 - movs r0, 0x4 - cmp r2, 0 - bne _080CF9E2 - movs r0, 0x5 - b _080CF9E2 -_080CF992: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080CF99E - movs r0, 0x13 - b _080CF9E2 -_080CF99E: - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080CF9AE - bl sub_80CFDC4 - movs r0, 0 - b _080CF9E2 -_080CF9AE: - movs r7, 0 - b _080CF9E0 -_080CF9B2: - movs r7, 0x1 - movs r0, 0 - mov r8, r0 - ldr r0, [r3] - adds r0, r6 - movs r1, 0xFF - strb r1, [r0] - mov r1, r12 - movs r0, 0 - ldrsb r0, [r1, r0] - movs r2, 0x1D - cmp r0, 0 - bne _080CF9CE - movs r2, 0x18 -_080CF9CE: - ldr r0, [r3] -_080CF9D0: - adds r0, r5 - strb r7, [r0] -_080CF9D4: - cmp r7, 0 - beq _080CF9E0 - mov r0, r8 - adds r1, r2, 0 - bl sub_80CD894 -_080CF9E0: - adds r0, r7, 0 -_080CF9E2: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80CF8D8 - - thumb_func_start sub_80CF9EC -sub_80CF9EC: @ 80CF9EC - push {r4,r5,lr} - movs r3, 0 - ldr r0, =gUnknown_0857B9BC - ldr r1, [r0] - adds r4, r0, 0 - cmp r1, 0 - beq _080CFA30 - ldr r5, =0x02039d78 -_080CF9FC: - lsls r0, r3, 3 - adds r2, r0, r4 - movs r1, 0x4 - ldrsb r1, [r2, r1] - movs r0, 0 - ldrsb r0, [r5, r0] - cmp r1, r0 - bne _080CFA20 - ldr r0, [r2] - bl _call_via_r0 - lsls r0, 24 - lsrs r0, 24 - b _080CFA32 - .pool -_080CFA20: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - lsls r0, r3, 3 - adds r0, r4 - ldr r0, [r0] - cmp r0, 0 - bne _080CF9FC -_080CFA30: - movs r0, 0 -_080CFA32: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80CF9EC - - thumb_func_start sub_80CFA38 -sub_80CFA38: @ 80CFA38 - push {lr} - bl sub_80CFEF0 - movs r0, 0x9 - bl sub_80CFF34 - movs r0, 0xA - bl sub_80CFF34 - movs r0, 0xB - bl sub_80CFF34 - movs r0, 0 - bl sub_80CFF34 - pop {r0} - bx r0 - thumb_func_end sub_80CFA38 - - thumb_func_start sub_80CFA5C -sub_80CFA5C: @ 80CFA5C - push {lr} - bl sub_80CFEF0 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x3 - bne _080CFA78 - bl sub_80CFB44 - b _080CFA7C - .pool -_080CFA78: - bl sub_80CFA84 -_080CFA7C: - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_80CFA5C - - thumb_func_start sub_80CFA84 -sub_80CFA84: @ 80CFA84 - push {lr} - bl sub_80CD504 - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - beq _080CFAAE - cmp r0, 0x1 - bgt _080CFAA8 - cmp r0, 0 - beq _080CFABA - b _080CFAF4 - .pool -_080CFAA8: - cmp r0, 0x2 - beq _080CFAC6 - b _080CFAF4 -_080CFAAE: - cmp r1, 0 - beq _080CFAF4 - movs r0, 0x1 - bl sub_80CFF34 - b _080CFAF8 -_080CFABA: - cmp r1, 0 - beq _080CFAF4 - movs r0, 0x2 - bl sub_80CFF34 - b _080CFAF8 -_080CFAC6: - ldr r0, =0x02039d7a - ldrb r0, [r0] - cmp r0, 0 - beq _080CFAE8 - cmp r1, 0 - beq _080CFAE0 - movs r0, 0x4 - bl sub_80CFF34 - b _080CFAF8 - .pool -_080CFAE0: - movs r0, 0x5 - bl sub_80CFF34 - b _080CFAF8 -_080CFAE8: - cmp r1, 0 - beq _080CFAF4 - movs r0, 0x3 - bl sub_80CFF34 - b _080CFAF8 -_080CFAF4: - movs r0, 0 - b _080CFB3E -_080CFAF8: - movs r0, 0x6 - bl sub_80CFF34 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x2 - bne _080CFB2A - ldr r0, =0x02039d78 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - bne _080CFB24 - movs r0, 0x2 - bl sub_80CFF34 - b _080CFB2A - .pool -_080CFB24: - movs r0, 0x1 - bl sub_80CFF34 -_080CFB2A: - movs r0, 0x8 - bl sub_80CFF34 - movs r0, 0x7 - bl sub_80CFF34 - movs r0, 0 - bl sub_80CFF34 - movs r0, 0x1 -_080CFB3E: - pop {r1} - bx r1 - thumb_func_end sub_80CFA84 - - thumb_func_start sub_80CFB44 -sub_80CFB44: @ 80CFB44 - push {r4,r5,lr} - ldr r4, =0x02039d08 - ldr r0, [r4] - ldr r5, =0x00000ce4 - adds r0, r5 - ldrh r1, [r0] - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - beq _080CFBDA - bl sub_80D127C - lsls r0, 24 - cmp r0, 0 - bne _080CFBAC - ldr r2, [r4] - ldr r0, =0x00000ce6 - adds r1, r2, r0 - ldrh r0, [r1] - cmp r0, 0 - bne _080CFB8C - adds r0, r2, r5 - ldrh r0, [r0] - cmp r0, 0 - beq _080CFBDA - movs r0, 0xE - bl sub_80CFF34 - b _080CFBE4 - .pool -_080CFB8C: - ldrh r0, [r1] - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - bne _080CFBA4 - movs r0, 0xC - bl sub_80CFF34 - movs r0, 0x10 - bl sub_80CFF34 -_080CFBA4: - movs r0, 0x11 - bl sub_80CFF34 - b _080CFBE4 -_080CFBAC: - ldr r2, [r4] - ldr r0, =0x00000ce6 - adds r1, r2, r0 - ldrh r0, [r1] - cmp r0, 0 - bne _080CFBCC - adds r0, r2, r5 - ldrh r0, [r0] - cmp r0, 0 - beq _080CFBDA - movs r0, 0xD - bl sub_80CFF34 - b _080CFBE4 - .pool -_080CFBCC: - ldrh r0, [r1] - bl itemid_is_mail - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080CFBDE -_080CFBDA: - movs r0, 0 - b _080CFBEC -_080CFBDE: - movs r0, 0xF - bl sub_80CFF34 -_080CFBE4: - movs r0, 0 - bl sub_80CFF34 - movs r0, 0x1 -_080CFBEC: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80CFB44 - - thumb_func_start sub_80CFBF4 -sub_80CFBF4: @ 80CFBF4 - ldr r1, =0x02039d08 - ldr r1, [r1] - ldr r2, =0x00000cb4 - adds r1, r2 - ldr r2, [r1] - ldrh r2, [r2, 0x20] - strh r2, [r0, 0x20] - ldr r1, [r1] - ldrh r1, [r1, 0x22] - adds r1, 0x14 - strh r1, [r0, 0x22] - bx lr - .pool - thumb_func_end sub_80CFBF4 - - thumb_func_start sub_80CFC14 -sub_80CFC14: @ 80CFC14 - push {r4-r6,lr} - sub sp, 0x2C - mov r1, sp - ldr r0, =gUnknown_0857B9E4 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - add r4, sp, 0x18 - adds r1, r4, 0 - ldr r0, =gUnknown_0857B9FC - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldr r0, [r0] - str r0, [r1] - mov r0, sp - bl LoadObjectPics - adds r0, r4, 0 - bl LoadTaggedObjectPalettes - ldr r0, =0x0000daca - bl IndexOfObjectPaletteTag - ldr r6, =0x02039d08 - ldr r1, [r6] - ldr r4, =0x00000cd8 - adds r1, r4 - strb r0, [r1] - ldr r0, =0x0000dac7 - bl IndexOfObjectPaletteTag - ldr r1, [r6] - ldr r5, =0x00000cd9 - adds r1, r5 - strb r0, [r1] - ldr r0, =0x02039d78 - ldrb r0, [r0] - ldr r1, =0x02039d79 - ldrb r1, [r1] - add r4, sp, 0x28 - mov r5, sp - adds r5, 0x2A - adds r2, r4, 0 - adds r3, r5, 0 - bl sub_80CD444 - ldr r0, =gUnknown_0857BA50 - movs r2, 0 - ldrsh r1, [r4, r2] - movs r3, 0 - ldrsh r2, [r5, r3] - movs r3, 0x6 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _080CFD18 - ldr r2, [r6] - ldr r4, =0x00000cb4 - adds r3, r2, r4 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - str r1, [r3] - ldr r0, =0x02039d7d - ldr r5, =0x00000cd8 - adds r2, r5 - ldrb r0, [r0] - adds r2, r0 - ldrb r2, [r2] - lsls r2, 4 - ldrb r3, [r1, 0x5] - movs r0, 0xF - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x5] - ldr r0, [r6] - adds r0, r4 - ldr r2, [r0] - ldrb r1, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0x5] - ldr r0, =0x02039d7a - ldrb r0, [r0] - cmp r0, 0 - beq _080CFD22 - ldr r0, [r6] - adds r0, r4 - ldr r0, [r0] - movs r1, 0x3 - bl StartObjectImageAnim - b _080CFD22 - .pool -_080CFD18: - ldr r0, [r6] - ldr r1, =0x00000cb4 - adds r0, r1 - movs r1, 0 - str r1, [r0] -_080CFD22: - ldr r0, =0x02039d78 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x1 - bne _080CFD3C - movs r3, 0xD - movs r4, 0x1 - b _080CFD40 - .pool -_080CFD3C: - movs r3, 0x15 - movs r4, 0x2 -_080CFD40: - ldr r0, =gUnknown_0857BA68 - movs r1, 0 - movs r2, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _080CFDA8 - ldr r5, =0x02039d08 - ldr r2, [r5] - ldr r3, =0x00000cb8 - adds r2, r3 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - str r1, [r2] - lsls r3, r4, 2 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] - ldr r0, =0x02039d78 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - beq _080CFDB4 - ldr r0, [r5] - ldr r4, =0x00000cb8 - adds r0, r4 - ldr r1, [r0] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - b _080CFDB4 - .pool -_080CFDA8: - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r5, =0x00000cb8 - adds r0, r5 - movs r1, 0 - str r1, [r0] -_080CFDB4: - add sp, 0x2C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CFC14 - - thumb_func_start sub_80CFDC4 -sub_80CFDC4: @ 80CFDC4 - push {lr} - ldr r2, =0x02039d7d - movs r1, 0 - ldrb r0, [r2] - cmp r0, 0 - bne _080CFDD2 - movs r1, 0x1 -_080CFDD2: - strb r1, [r2] - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r3, =0x00000cb4 - adds r1, r0, r3 - ldr r3, [r1] - ldr r1, =0x00000cd8 - adds r0, r1 - ldrb r2, [r2] - adds r0, r2 - ldrb r1, [r0] - lsls r1, 4 - ldrb r2, [r3, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x5] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CFDC4 - - thumb_func_start sub_80CFE08 -sub_80CFE08: @ 80CFE08 - ldr r0, =0x02039d79 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80CFE08 - - thumb_func_start sub_80CFE14 -sub_80CFE14: @ 80CFE14 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - ldr r0, =0x02039d78 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - bne _080CFE48 - ldr r4, =0x02039d79 - movs r0, 0 - ldrsb r0, [r4, r0] - movs r1, 0x6 - bl __modsi3 - strb r0, [r5] - movs r0, 0 - ldrsb r0, [r4, r0] - movs r1, 0x6 - bl __divsi3 - b _080CFE4C - .pool -_080CFE48: - movs r0, 0 - strb r0, [r5] -_080CFE4C: - strb r0, [r6] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80CFE14 - - thumb_func_start sub_80CFE54 -sub_80CFE54: @ 80CFE54 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r2, =0x00000cb4 - adds r0, r2 - ldr r0, [r0] - bl StartObjectImageAnim - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CFE54 - - thumb_func_start sub_80CFE78 -sub_80CFE78: @ 80CFE78 - ldr r0, =0x02039d7b - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80CFE78 - - thumb_func_start sub_80CFE84 -sub_80CFE84: @ 80CFE84 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x00000cb4 - adds r0, r1 - ldr r2, [r0] - ldrb r1, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0x5] - bx lr - .pool - thumb_func_end sub_80CFE84 - - thumb_func_start sub_80CFEA8 -sub_80CFEA8: @ 80CFEA8 - push {lr} - ldr r0, =0x02039d78 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - bne _080CFEC0 - ldr r0, =0x02039d79 - ldrb r1, [r0] - movs r0, 0 - bl sub_80D0E50 -_080CFEC0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CFEA8 - - thumb_func_start sub_80CFECC -sub_80CFECC: @ 80CFECC - push {lr} - ldr r0, =0x02039d78 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - bne _080CFEE4 - ldr r0, =0x02039d79 - ldrb r1, [r0] - movs r0, 0 - bl sub_80D0D8C -_080CFEE4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CFECC - - thumb_func_start sub_80CFEF0 -sub_80CFEF0: @ 80CFEF0 - ldr r2, =0x02039d08 - ldr r0, [r2] - ldr r1, =0x00000cac - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - ldr r3, =0x00000cad - adds r0, r3 - strb r1, [r0] - ldr r0, [r2] - subs r3, 0x41 - adds r0, r3 - strb r1, [r0] - ldr r0, [r2] - ldr r1, =0x00000c71 - adds r0, r1 - movs r1, 0xF - strb r1, [r0] - ldr r0, [r2] - adds r3, 0x6 - adds r0, r3 - movs r1, 0x5C - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_80CFEF0 - - thumb_func_start sub_80CFF34 -sub_80CFF34: @ 80CFF34 - push {r4,r5,lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r4, =0x02039d08 - ldr r2, [r4] - ldr r5, =0x00000cac - adds r1, r2, r5 - ldrb r0, [r1] - cmp r0, 0x6 - bhi _080CFF7E - adds r1, r0, 0 - lsls r1, 3 - ldr r0, =0x00000c74 - adds r1, r0 - adds r1, r2, r1 - ldr r2, =gUnknown_0857BA80 - lsls r0, r3, 2 - adds r0, r2 - ldr r0, [r0] - str r0, [r1] - str r3, [r1, 0x4] - bl GetStringLength - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, [r4] - ldr r2, =0x00000cad - adds r0, r2 - ldrb r2, [r0] - cmp r1, r2 - bls _080CFF74 - strb r1, [r0] -_080CFF74: - ldr r1, [r4] - adds r1, r5 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080CFF7E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CFF34 - - thumb_func_start sub_80CFF98 -sub_80CFF98: @ 80CFF98 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02039d08 - ldr r1, [r0] - ldr r3, =0x00000cac - adds r0, r1, r3 - ldrb r0, [r0] - cmp r2, r0 - bcs _080CFFC8 - lsls r0, r2, 3 - ldr r2, =0x00000c78 - adds r1, r2 - adds r1, r0 - movs r0, 0 - ldrsb r0, [r1, r0] - b _080CFFCC - .pool -_080CFFC8: - movs r0, 0x1 - negs r0, r0 -_080CFFCC: - pop {r1} - bx r1 - thumb_func_end sub_80CFF98 - - thumb_func_start sub_80CFFD0 -sub_80CFFD0: @ 80CFFD0 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r5, =0x02039d08 - ldr r1, [r5] - ldr r2, =0x00000cad - adds r0, r1, r2 - ldrb r0, [r0] - adds r0, 0x2 - subs r2, 0x3E - adds r1, r2 - strb r0, [r1] - ldr r1, [r5] - ldr r6, =0x00000cac - adds r0, r1, r6 - ldrb r0, [r0] - lsls r0, 1 - movs r3, 0xC7 - lsls r3, 4 - adds r1, r3 - strb r0, [r1] - ldr r1, [r5] - adds r2, r1, r2 - ldrb r2, [r2] - movs r0, 0x1D - subs r0, r2 - ldr r2, =0x00000c6d - adds r1, r2 - strb r0, [r1] - ldr r1, [r5] - adds r3, r1, r3 - ldrb r2, [r3] - movs r0, 0xF - subs r0, r2 - ldr r3, =0x00000c6e - adds r1, r3 - strb r0, [r1] - ldr r0, [r5] - ldr r1, =0x00000c6c - adds r0, r1 - bl AddWindow - ldr r1, [r5] - movs r4, 0xCB - lsls r4, 4 - adds r1, r4 - movs r2, 0 - mov r8, r2 - strh r0, [r1] - lsls r0, 24 - lsrs r0, 24 - bl ClearWindowTilemap - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - movs r1, 0 - movs r2, 0xB - movs r3, 0xE - bl SetWindowBorderStyle - ldr r2, [r5] - adds r0, r2, r4 - ldrb r0, [r0] - adds r1, r2, r6 - ldrb r1, [r1] - ldr r3, =0x00000c74 - adds r2, r3 - bl PrintMenuTable - ldr r1, [r5] - adds r4, r1, r4 - ldrb r0, [r4] - adds r1, r6 - ldrb r1, [r1] - movs r2, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, [r5] - ldr r1, =0x00000cae - adds r0, r1 - mov r2, r8 - strb r2, [r0] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80CFFD0 - - thumb_func_start sub_80D00A8 -sub_80D00A8: @ 80D00A8 - movs r0, 0 - bx lr - thumb_func_end sub_80D00A8 - - thumb_func_start sub_80D00AC -sub_80D00AC: @ 80D00AC - push {r4,r5,lr} - movs r5, 0x2 - negs r5, r5 - ldr r4, =0x030022c0 - ldrh r1, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080D0102 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080D00CE - movs r0, 0x5 - bl audio_play - adds r5, 0x1 -_080D00CE: - ldrh r1, [r4, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080D00EC - movs r0, 0x5 - bl audio_play - movs r0, 0x1 - negs r0, r0 - bl MoveMenuCursor - b _080D010A - .pool -_080D00EC: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080D010A - movs r0, 0x5 - bl audio_play - movs r0, 0x1 - bl MoveMenuCursor - b _080D010A -_080D0102: - bl GetMenuCursorPos - lsls r0, 24 - lsrs r5, r0, 24 -_080D010A: - movs r0, 0x2 - negs r0, r0 - cmp r5, r0 - beq _080D0116 - bl sub_80D013C -_080D0116: - cmp r5, 0 - blt _080D0128 - ldr r0, =0x02039d08 - ldr r0, [r0] - lsls r1, r5, 3 - ldr r2, =0x00000c78 - adds r0, r2 - adds r0, r1 - ldr r5, [r0] -_080D0128: - lsls r0, r5, 16 - asrs r0, 16 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D00AC - - thumb_func_start sub_80D013C -sub_80D013C: @ 80D013C - push {r4,r5,lr} - ldr r5, =0x02039d08 - ldr r0, [r5] - movs r4, 0xCB - lsls r4, 4 - adds r0, r4 - ldrb r0, [r0] - movs r1, 0x1 - bl sub_8198070 - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - bl RemoveWindow - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D013C - - thumb_func_start sub_80D0164 -sub_80D0164: @ 80D0164 - push {r4,lr} - ldr r4, =0x02039d80 - ldr r0, =0x00000974 - bl Alloc - str r0, [r4] - cmp r0, 0 - beq _080D01B0 - ldr r0, =gUnknown_0857BB1C - bl AddWindow8Bit - adds r1, r0, 0 - ldr r0, =0x02039d08 - ldr r0, [r0] - movs r2, 0x88 - lsls r2, 6 - adds r0, r2 - strh r1, [r0] - lsls r0, r1, 16 - lsrs r0, 16 - cmp r0, 0xFF - beq _080D01B0 - lsls r0, r1, 24 - lsrs r0, 24 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - b _080D01B2 - .pool -_080D01B0: - movs r0, 0 -_080D01B2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80D0164 - - thumb_func_start sub_80D01B8 -sub_80D01B8: @ 80D01B8 - push {lr} - ldr r0, =0x02039d80 - ldr r0, [r0] - cmp r0, 0 - beq _080D01C6 - bl Free -_080D01C6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D01B8 - - thumb_func_start sub_80D01D0 -sub_80D01D0: @ 80D01D0 - ldr r2, =0x02039d80 - ldr r1, [r2] - movs r3, 0 - strb r0, [r1] - ldr r0, [r2] - strb r3, [r0, 0x1] - bx lr - .pool - thumb_func_end sub_80D01D0 - - thumb_func_start sub_80D01E4 -sub_80D01E4: @ 80D01E4 - push {lr} - ldr r0, =0x02039d80 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0x5 - bhi _080D0244 - lsls r0, 2 - ldr r1, =_080D0204 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080D0204: - .4byte _080D021C - .4byte _080D0222 - .4byte _080D0228 - .4byte _080D022E - .4byte _080D0234 - .4byte _080D023A -_080D021C: - bl sub_80D024C - b _080D023E -_080D0222: - bl sub_80D0344 - b _080D023E -_080D0228: - bl sub_80D03B0 - b _080D023E -_080D022E: - bl sub_80D0420 - b _080D023E -_080D0234: - bl sub_80D04A0 - b _080D023E -_080D023A: - bl sub_80D04C8 -_080D023E: - lsls r0, 24 - lsrs r0, 24 - b _080D0246 -_080D0244: - movs r0, 0 -_080D0246: - pop {r1} - bx r1 - thumb_func_end sub_80D01E4 - - thumb_func_start sub_80D024C -sub_80D024C: @ 80D024C - push {r4-r6,lr} - sub sp, 0x8 - ldr r6, =0x02039d80 - ldr r1, [r6] - ldrb r0, [r1, 0x1] - cmp r0, 0x1 - beq _080D027C - cmp r0, 0x1 - bgt _080D0268 - cmp r0, 0 - beq _080D026E - b _080D0338 - .pool -_080D0268: - cmp r0, 0x2 - beq _080D0324 - b _080D0338 -_080D026E: - movs r0, 0 - bl HideBg - movs r0, 0x80 - bl sub_80D304C - b _080D030E -_080D027C: - adds r0, r1, 0x2 - adds r1, 0x3 - bl sub_80CFE14 - ldr r1, [r6] - ldrb r0, [r1, 0x2] - strb r0, [r1, 0x4] - ldr r1, [r6] - ldrb r0, [r1, 0x3] - strb r0, [r1, 0x5] - ldr r4, =0xfffffc00 - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - adds r1, r4, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - ldr r5, =0x02039d08 - ldr r0, [r5] - movs r4, 0x88 - lsls r4, 6 - adds r0, r4 - ldrb r0, [r0] - movs r1, 0 - bl FillWindowPixelBuffer8Bit - ldr r1, [r6] - ldrb r0, [r1, 0x2] - ldrb r1, [r1, 0x3] - bl sub_80D07B0 - movs r0, 0 - movs r1, 0x4 - movs r2, 0x1 - bl SetBgAttribute - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - bl PutWindowTilemap - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - movs r1, 0x3 - bl CopyWindowToVram8Bit - movs r0, 0xFC - lsls r0, 6 - ldr r2, =0x00007fff - movs r1, 0x8 - bl sub_80A2A20 - movs r0, 0x2 - bl sub_80CFE54 - movs r0, 0x8 - movs r1, 0x80 - bl SetGpuRegBits -_080D030E: - ldr r1, [r6] - ldrb r0, [r1, 0x1] - adds r0, 0x1 - strb r0, [r1, 0x1] - b _080D0338 - .pool -_080D0324: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _080D0338 - movs r0, 0 - bl ShowBg - movs r0, 0 - b _080D033A -_080D0338: - movs r0, 0x1 -_080D033A: - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80D024C - - thumb_func_start sub_80D0344 -sub_80D0344: @ 80D0344 - push {r4,lr} - ldr r4, =0x02039d80 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - beq _080D036E - cmp r0, 0x1 - bgt _080D0360 - cmp r0, 0 - beq _080D0366 - b _080D03A8 - .pool -_080D0360: - cmp r0, 0x2 - beq _080D0382 - b _080D03A8 -_080D0366: - movs r0, 0 - bl HideBg - b _080D0378 -_080D036E: - bl sub_80D0B5C - movs r0, 0 - bl sub_80CFE54 -_080D0378: - ldr r1, [r4] - ldrb r0, [r1, 0x1] - adds r0, 0x1 - strb r0, [r1, 0x1] - b _080D03A8 -_080D0382: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _080D03A8 - bl sub_80CFE84 - movs r0, 0x3 - bl stdpal_get - movs r1, 0xD0 - movs r2, 0x20 - bl gpu_pal_apply - movs r0, 0 - bl ShowBg - movs r0, 0 - b _080D03AA -_080D03A8: - movs r0, 0x1 -_080D03AA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80D0344 - - thumb_func_start sub_80D03B0 -sub_80D03B0: @ 80D03B0 - push {r4,lr} - ldr r4, =0x02039d80 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - cmp r0, 0 - beq _080D03C8 - cmp r0, 0x1 - beq _080D040C - b _080D0416 - .pool -_080D03C8: - bl sub_80CD554 - lsls r0, 24 - cmp r0, 0 - bne _080D0416 - ldr r1, [r4] - adds r0, r1, 0x6 - adds r1, 0x7 - bl sub_80CFE14 - bl sub_80D062C - ldr r1, [r4] - ldrb r0, [r1, 0x6] - strb r0, [r1, 0x4] - ldr r1, [r4] - ldrb r0, [r1, 0x7] - strb r0, [r1, 0x5] - ldr r0, =0x02039d08 - ldr r0, [r0] - movs r1, 0x88 - lsls r1, 6 - adds r0, r1 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram8Bit - ldr r1, [r4] - ldrb r0, [r1, 0x1] - adds r0, 0x1 - strb r0, [r1, 0x1] - b _080D0416 - .pool -_080D040C: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - b _080D0418 -_080D0416: - movs r0, 0x1 -_080D0418: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80D03B0 - - thumb_func_start sub_80D0420 -sub_80D0420: @ 80D0420 - push {r4,lr} - ldr r4, =0x02039d80 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - beq _080D044E - cmp r0, 0x1 - bgt _080D043C - cmp r0, 0 - beq _080D0442 - b _080D0498 - .pool -_080D043C: - cmp r0, 0x2 - beq _080D047A - b _080D0498 -_080D0442: - bl sub_80D08CC - bl sub_80D09A4 - movs r0, 0 - b _080D046C -_080D044E: - bl sub_80CDCAC - lsls r0, 24 - cmp r0, 0 - bne _080D0498 - movs r0, 0x3 - bl sub_80CFE54 - movs r1, 0x80 - lsls r1, 1 - movs r0, 0 - movs r2, 0x8 - bl sub_80D0884 - movs r0, 0x1 -_080D046C: - bl sub_80CDC64 - ldr r1, [r4] - ldrb r0, [r1, 0x1] - adds r0, 0x1 - strb r0, [r1, 0x1] - b _080D0498 -_080D047A: - bl sub_80D0894 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_80CDCAC - lsls r0, 24 - lsrs r0, 24 - cmp r4, 0 - bne _080D0498 - cmp r0, 0 - bne _080D0498 - movs r0, 0 - b _080D049A -_080D0498: - movs r0, 0x1 -_080D049A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80D0420 - - thumb_func_start sub_80D04A0 -sub_80D04A0: @ 80D04A0 - push {r4,lr} - bl sub_80CD554 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_80D0894 - lsls r0, 24 - lsrs r0, 24 - cmp r4, 0 - bne _080D04C0 - cmp r0, 0 - bne _080D04C0 - movs r0, 0 - b _080D04C2 -_080D04C0: - movs r0, 0x1 -_080D04C2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80D04A0 - - thumb_func_start sub_80D04C8 -sub_80D04C8: @ 80D04C8 - push {r4,lr} - ldr r4, =0x02039d80 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - beq _080D0506 - cmp r0, 0x1 - bgt _080D04E4 - cmp r0, 0 - beq _080D04EE - b _080D0576 - .pool -_080D04E4: - cmp r0, 0x2 - beq _080D0532 - cmp r0, 0x3 - beq _080D0550 - b _080D0576 -_080D04EE: - bl sub_80D0AAC - movs r1, 0xFF - lsls r1, 8 - movs r0, 0 - movs r2, 0x8 - bl sub_80D0884 - movs r0, 0 - bl sub_80CDC64 - b _080D0546 -_080D0506: - bl sub_80CDCAC - lsls r0, 24 - cmp r0, 0 - bne _080D0576 - bl sub_80D0894 - lsls r0, 24 - cmp r0, 0 - bne _080D0576 - bl sub_80D0A1C - movs r0, 0x2 - bl sub_80CFE54 - movs r0, 0x1 - bl sub_80CDC64 - movs r0, 0 - bl HideBg - b _080D0546 -_080D0532: - bl sub_80CDCAC - lsls r0, 24 - cmp r0, 0 - bne _080D0576 - movs r0, 0 - bl sub_80CFE54 - bl sub_80D0B5C -_080D0546: - ldr r1, [r4] - ldrb r0, [r1, 0x1] - adds r0, 0x1 - strb r0, [r1, 0x1] - b _080D0576 -_080D0550: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _080D0576 - movs r0, 0x3 - bl stdpal_get - movs r1, 0xD0 - movs r2, 0x20 - bl gpu_pal_apply - bl sub_80CFE84 - movs r0, 0 - bl ShowBg - movs r0, 0 - b _080D0578 -_080D0576: - movs r0, 0x1 -_080D0578: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80D04C8 - - thumb_func_start sub_80D0580 -sub_80D0580: @ 80D0580 - push {lr} - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x1 - beq _080D05BC - cmp r0, 0x1 - bgt _080D0596 - cmp r0, 0 - beq _080D05A0 - b _080D0624 -_080D0596: - cmp r1, 0x2 - beq _080D05DC - cmp r1, 0x3 - beq _080D05FC - b _080D0624 -_080D05A0: - ldr r0, =0x02039d80 - ldr r1, [r0] - ldrb r0, [r1, 0x9] - cmp r0, 0 - beq _080D060A - subs r0, 0x1 - strb r0, [r1, 0x9] - movs r1, 0x80 - lsls r1, 3 - movs r0, 0 - b _080D05F0 - .pool -_080D05BC: - ldr r0, =0x02039d80 - ldr r1, [r0] - ldrb r2, [r1, 0x9] - ldrb r0, [r1, 0xB] - adds r0, r2, r0 - cmp r0, 0x4 - bgt _080D060A - adds r0, r2, 0x1 - strb r0, [r1, 0x9] - movs r1, 0xFC - lsls r1, 8 - movs r0, 0 - b _080D05F0 - .pool -_080D05DC: - ldr r0, =0x02039d80 - ldr r1, [r0] - ldrb r0, [r1, 0x8] - cmp r0, 0 - beq _080D060A - subs r0, 0x1 - strb r0, [r1, 0x8] - movs r0, 0x80 - lsls r0, 3 - movs r1, 0 -_080D05F0: - movs r2, 0x6 - bl sub_80D0884 - b _080D0624 - .pool -_080D05FC: - ldr r0, =0x02039d80 - ldr r1, [r0] - ldrb r2, [r1, 0x8] - ldrb r0, [r1, 0xA] - adds r0, r2, r0 - cmp r0, 0x5 - ble _080D0614 -_080D060A: - movs r0, 0 - b _080D0626 - .pool -_080D0614: - adds r0, r2, 0x1 - strb r0, [r1, 0x8] - movs r0, 0xFC - lsls r0, 8 - movs r1, 0 - movs r2, 0x6 - bl sub_80D0884 -_080D0624: - movs r0, 0x1 -_080D0626: - pop {r1} - bx r1 - thumb_func_end sub_80D0580 - - thumb_func_start sub_80D062C -sub_80D062C: @ 80D062C - push {r4-r7,lr} - ldr r6, =0x02039d80 - ldr r2, [r6] - ldrb r3, [r2, 0x2] - ldrb r5, [r2, 0x6] - subs r1, r3, r5 - cmp r1, 0 - bge _080D063E - negs r1, r1 -_080D063E: - ldrb r0, [r2, 0x4] - subs r0, r3, r0 - cmp r0, 0 - bge _080D0648 - negs r0, r0 -_080D0648: - subs r0, r1, r0 - lsls r0, 16 - lsrs r4, r0, 16 - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x7] - subs r3, r1, r0 - cmp r3, 0 - bge _080D065A - negs r3, r3 -_080D065A: - ldrb r2, [r2, 0x5] - subs r0, r1, r2 - cmp r0, 0 - bge _080D0664 - negs r0, r0 -_080D0664: - subs r0, r3, r0 - lsls r0, 16 - lsrs r7, r0, 16 - lsls r0, r4, 16 - asrs r4, r0, 16 - cmp r4, 0 - ble _080D0678 - adds r0, r5, 0 - bl sub_80D06D0 -_080D0678: - cmp r4, 0 - bge _080D0694 - ldr r2, [r6] - ldrb r0, [r2, 0x4] - ldrb r1, [r2, 0x3] - ldrb r2, [r2, 0x5] - bl sub_80D0740 - ldr r2, [r6] - ldrb r0, [r2, 0x6] - ldrb r1, [r2, 0x3] - ldrb r2, [r2, 0x5] - bl sub_80D06D0 -_080D0694: - lsls r0, r7, 16 - asrs r4, r0, 16 - cmp r4, 0 - ble _080D06A8 - ldr r2, [r6] - ldrb r0, [r2, 0x7] - ldrb r1, [r2, 0x2] - ldrb r2, [r2, 0x4] - bl sub_80D0708 -_080D06A8: - cmp r4, 0 - bge _080D06C4 - ldr r2, [r6] - ldrb r0, [r2, 0x5] - ldrb r1, [r2, 0x2] - ldrb r2, [r2, 0x4] - bl sub_80D0778 - ldr r2, [r6] - ldrb r0, [r2, 0x7] - ldrb r1, [r2, 0x2] - ldrb r2, [r2, 0x4] - bl sub_80D0708 -_080D06C4: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D062C - - thumb_func_start sub_80D06D0 -sub_80D06D0: @ 80D06D0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - adds r1, r4, 0 - lsls r2, 24 - lsrs r5, r2, 24 - adds r0, r5, 0 - cmp r4, r5 - bls _080D06EE - adds r4, r5, 0 - adds r5, r1, 0 - cmp r0, r5 - bhi _080D0700 -_080D06EE: - adds r1, r4, 0 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r6, 0 - bl sub_80D07B0 - cmp r4, r5 - bls _080D06EE -_080D0700: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80D06D0 - - thumb_func_start sub_80D0708 -sub_80D0708: @ 80D0708 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - adds r1, r4, 0 - lsls r2, 24 - lsrs r5, r2, 24 - adds r0, r5, 0 - cmp r4, r5 - bls _080D0726 - adds r4, r5, 0 - adds r5, r1, 0 - cmp r0, r5 - bhi _080D0738 -_080D0726: - adds r0, r4, 0 - adds r1, r0, 0x1 - lsls r1, 24 - lsrs r4, r1, 24 - adds r1, r6, 0 - bl sub_80D07B0 - cmp r4, r5 - bls _080D0726 -_080D0738: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80D0708 - - thumb_func_start sub_80D0740 -sub_80D0740: @ 80D0740 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - adds r1, r4, 0 - lsls r2, 24 - lsrs r5, r2, 24 - adds r0, r5, 0 - cmp r4, r5 - bls _080D075E - adds r4, r5, 0 - adds r5, r1, 0 - cmp r0, r5 - bhi _080D0770 -_080D075E: - adds r1, r4, 0 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r6, 0 - bl sub_80D0834 - cmp r4, r5 - bls _080D075E -_080D0770: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80D0740 - - thumb_func_start sub_80D0778 -sub_80D0778: @ 80D0778 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - adds r1, r4, 0 - lsls r2, 24 - lsrs r5, r2, 24 - adds r0, r5, 0 - cmp r4, r5 - bls _080D0796 - adds r4, r5, 0 - adds r5, r1, 0 - cmp r0, r5 - bhi _080D07A8 -_080D0796: - adds r0, r4, 0 - adds r1, r0, 0x1 - lsls r1, 24 - lsrs r4, r1, 24 - adds r1, r6, 0 - bl sub_80D0834 - cmp r4, r5 - bls _080D0796 -_080D07A8: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80D0778 - - thumb_func_start sub_80D07B0 -sub_80D07B0: @ 80D07B0 - push {r4-r7,lr} - sub sp, 0x1C - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 1 - adds r7, r0, r1 - lsls r4, r7, 1 - adds r4, r6, r4 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0x41 - bl get_pokemon_data_from_selected_box - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0 - bl get_pokemon_data_from_selected_box - adds r1, r0, 0 - cmp r5, 0 - beq _080D0828 - adds r0, r5, 0 - movs r2, 0x1 - bl sub_80D2EDC - adds r4, r0, 0 - adds r0, r5, 0 - bl sub_80D3080 - adds r0, 0x8 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02039d08 - ldr r1, [r1] - movs r2, 0x88 - lsls r2, 6 - adds r1, r2 - ldrb r3, [r1] - movs r2, 0x20 - str r2, [sp] - str r2, [sp, 0x4] - lsls r1, r6, 1 - adds r1, r6 - lsls r1, 3 - str r1, [sp, 0x8] - lsls r1, r7, 3 - str r1, [sp, 0xC] - str r2, [sp, 0x10] - str r2, [sp, 0x14] - str r0, [sp, 0x18] - adds r0, r3, 0 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl BlitBitmapRectToWindow4BitTo8Bit -_080D0828: - add sp, 0x1C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D07B0 - - thumb_func_start sub_80D0834 -sub_80D0834: @ 80D0834 - push {r4,r5,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 1 - adds r5, r0, r1 - lsls r0, r5, 1 - adds r0, r4, r0 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x41 - bl get_pokemon_data_from_selected_box - lsls r0, 16 - cmp r0, 0 - beq _080D0878 - ldr r0, =0x02039d08 - ldr r0, [r0] - movs r1, 0x88 - lsls r1, 6 - adds r0, r1 - ldrb r0, [r0] - lsls r2, r4, 1 - adds r2, r4 - lsls r2, 3 - lsls r3, r5, 3 - movs r1, 0x20 - str r1, [sp] - str r1, [sp, 0x4] - movs r1, 0 - bl FillWindowPixelRect8Bit -_080D0878: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D0834 - - thumb_func_start sub_80D0884 -sub_80D0884: @ 80D0884 - ldr r3, =0x02039d80 - ldr r3, [r3] - strh r0, [r3, 0xC] - strh r1, [r3, 0xE] - strh r2, [r3, 0x10] - bx lr - .pool - thumb_func_end sub_80D0884 - - thumb_func_start sub_80D0894 -sub_80D0894: @ 80D0894 - push {r4,lr} - ldr r4, =0x02039d80 - ldr r1, [r4] - ldrh r0, [r1, 0x10] - cmp r0, 0 - beq _080D08BE - ldrh r1, [r1, 0xC] - movs r0, 0 - movs r2, 0x1 - bl ChangeBgX - ldr r0, [r4] - ldrh r1, [r0, 0xE] - movs r0, 0 - movs r2, 0x1 - bl ChangeBgY - ldr r1, [r4] - ldrh r0, [r1, 0x10] - subs r0, 0x1 - strh r0, [r1, 0x10] -_080D08BE: - ldr r0, [r4] - ldrb r0, [r0, 0x10] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D0894 - - thumb_func_start sub_80D08CC -sub_80D08CC: @ 80D08CC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r4, =0x02039d80 - ldr r1, [r4] - ldrb r0, [r1, 0x4] - ldrb r2, [r1, 0x2] - cmp r0, r2 - bls _080D08E4 - adds r0, r2, 0 -_080D08E4: - strb r0, [r1, 0x8] - ldr r1, [r4] - ldrb r0, [r1, 0x5] - ldrb r2, [r1, 0x3] - cmp r0, r2 - bls _080D08F2 - adds r0, r2, 0 -_080D08F2: - strb r0, [r1, 0x9] - ldr r2, [r4] - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x4] - subs r0, r1, r0 - cmp r0, 0 - bge _080D0902 - negs r0, r0 -_080D0902: - adds r0, 0x1 - strb r0, [r2, 0xA] - ldr r2, [r4] - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x5] - subs r0, r1, r0 - cmp r0, 0 - bge _080D0914 - negs r0, r0 -_080D0914: - adds r0, 0x1 - strb r0, [r2, 0xB] - bl get_preferred_box - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - movs r6, 0 - ldr r0, [r4] - ldrb r2, [r0, 0x8] - ldrb r1, [r0, 0xA] - adds r2, r1 - mov r8, r2 - ldrb r1, [r0, 0x9] - ldrb r0, [r0, 0xB] - adds r0, r1 - mov r9, r0 - adds r2, r1, 0 - cmp r2, r9 - bge _080D0990 -_080D093C: - lsls r0, r2, 1 - adds r0, r2 - ldr r3, =0x02039d80 - ldr r1, [r3] - lsls r0, 1 - ldrb r3, [r1, 0x8] - adds r0, r3 - lsls r0, 24 - lsrs r5, r0, 24 - ldrb r4, [r1, 0x8] - adds r7, r2, 0x1 - cmp r4, r8 - bge _080D098A - mov r0, r8 - subs r4, r0, r4 -_080D095A: - mov r0, r10 - adds r1, r5, 0 - bl get_pokemon_by_box_and_pos - adds r1, r0, 0 - ldr r2, =0x02039d80 - ldr r0, [r2] - lsls r2, r6, 2 - adds r2, r6 - lsls r2, 4 - adds r0, r2 - adds r0, 0x14 - movs r2, 0x50 - bl memcpy - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - subs r4, 0x1 - cmp r4, 0 - bne _080D095A -_080D098A: - adds r2, r7, 0 - cmp r2, r9 - blt _080D093C -_080D0990: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D08CC - - thumb_func_start sub_80D09A4 -sub_80D09A4: @ 80D09A4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r4, =0x02039d80 - ldr r0, [r4] - ldrb r2, [r0, 0x8] - ldrb r1, [r0, 0xA] - adds r7, r2, r1 - ldrb r1, [r0, 0x9] - ldrb r0, [r0, 0xB] - adds r1, r0 - mov r9, r1 - bl get_preferred_box - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, [r4] - ldrb r2, [r0, 0x9] - cmp r2, r9 - bge _080D0A0C -_080D09D0: - lsls r0, r2, 1 - adds r0, r2 - ldr r1, =0x02039d80 - ldr r1, [r1] - lsls r0, 1 - ldrb r3, [r1, 0x8] - adds r0, r3 - lsls r0, 24 - lsrs r5, r0, 24 - ldrb r4, [r1, 0x8] - adds r6, r2, 0x1 - cmp r4, r7 - bge _080D0A06 - subs r4, r7, r4 -_080D09EC: - adds r0, r5, 0 - bl sub_80CB778 - mov r0, r8 - adds r1, r5, 0 - bl sub_80D2018 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - subs r4, 0x1 - cmp r4, 0 - bne _080D09EC -_080D0A06: - adds r2, r6, 0 - cmp r2, r9 - blt _080D09D0 -_080D0A0C: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D09A4 - - thumb_func_start sub_80D0A1C -sub_80D0A1C: @ 80D0A1C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x02039d80 - ldr r0, [r0] - ldrb r2, [r0, 0x8] - ldrb r1, [r0, 0xA] - adds r2, r1 - mov r8, r2 - ldrb r1, [r0, 0x9] - ldrb r0, [r0, 0xB] - adds r0, r1 - mov r10, r0 - movs r6, 0 - adds r2, r1, 0 - cmp r2, r10 - bge _080D0A98 -_080D0A42: - lsls r0, r2, 1 - adds r0, r2 - ldr r3, =0x02039d80 - ldr r1, [r3] - lsls r0, 1 - ldrb r4, [r1, 0x8] - adds r0, r4 - lsls r0, 24 - lsrs r5, r0, 24 - ldrb r4, [r1, 0x8] - adds r7, r2, 0x1 - cmp r4, r8 - bge _080D0A92 - mov r9, r3 - mov r0, r8 - subs r4, r0, r4 -_080D0A62: - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 4 - adds r1, 0x14 - mov r2, r9 - ldr r0, [r2] - adds r0, r1 - movs r1, 0x5 - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _080D0A80 - adds r0, r5, 0 - bl sub_80CB140 -_080D0A80: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - subs r4, 0x1 - cmp r4, 0 - bne _080D0A62 -_080D0A92: - adds r2, r7, 0 - cmp r2, r10 - blt _080D0A42 -_080D0A98: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D0A1C - - thumb_func_start sub_80D0AAC -sub_80D0AAC: @ 80D0AAC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r4, =0x02039d80 - ldr r0, [r4] - ldrb r2, [r0, 0x8] - ldrb r1, [r0, 0xA] - adds r2, r1 - mov r10, r2 - ldrb r1, [r0, 0x9] - ldrb r0, [r0, 0xB] - adds r1, r0 - str r1, [sp] - bl get_preferred_box - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - movs r7, 0 - ldr r0, [r4] - ldrb r3, [r0, 0x9] - ldr r0, [sp] - cmp r3, r0 - bge _080D0B46 -_080D0AE2: - lsls r0, r3, 1 - adds r0, r3 - ldr r2, =0x02039d80 - ldr r1, [r2] - lsls r0, 1 - ldrb r4, [r1, 0x8] - adds r0, r4 - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r5, [r1, 0x8] - adds r3, 0x1 - mov r9, r3 - cmp r5, r10 - bge _080D0B3E - mov r8, r2 - mov r0, r10 - subs r5, r0, r5 -_080D0B04: - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 4 - adds r4, r0, 0 - adds r4, 0x14 - mov r1, r8 - ldr r0, [r1] - adds r0, r4 - movs r1, 0x5 - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _080D0B2C - mov r0, r8 - ldr r2, [r0] - adds r2, r4 - ldr r0, [sp, 0x4] - adds r1, r6, 0 - bl sub_80D1F18 -_080D0B2C: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - subs r5, 0x1 - cmp r5, 0 - bne _080D0B04 -_080D0B3E: - mov r3, r9 - ldr r1, [sp] - cmp r3, r1 - blt _080D0AE2 -_080D0B46: - 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_80D0AAC - - thumb_func_start sub_80D0B5C -sub_80D0B5C: @ 80D0B5C - push {lr} - sub sp, 0x8 - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0 - movs r1, 0x4 - movs r2, 0 - bl SetBgAttribute - movs r0, 0x8 - movs r1, 0x80 - bl ClearGpuRegBits - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0x8 - pop {r0} - bx r0 - thumb_func_end sub_80D0B5C - - thumb_func_start sub_80D0BA4 -sub_80D0BA4: @ 80D0BA4 - ldr r0, =0x02039d80 - ldr r2, [r0] - ldrb r1, [r2, 0x3] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - ldrb r2, [r2, 0x2] - adds r0, r2 - lsls r0, 24 - lsrs r0, 24 - bx lr - .pool - thumb_func_end sub_80D0BA4 - - thumb_func_start sub_80D0BC0 -sub_80D0BC0: @ 80D0BC0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r0, =0x02039d80 - ldr r0, [r0] - ldrb r2, [r0, 0x8] - ldrb r1, [r0, 0xA] - adds r2, r1 - mov r9, r2 - ldrb r1, [r0, 0x9] - ldrb r0, [r0, 0xB] - adds r0, r1, r0 - str r0, [sp] - movs r7, 0 - adds r6, r1, 0 - cmp r6, r0 - bge _080D0C4E - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 1 - mov r8, r0 -_080D0BF0: - ldr r2, =0x02039d80 - ldr r1, [r2] - ldrb r0, [r1, 0x8] - add r0, r8 - lsls r0, 24 - lsrs r5, r0, 24 - ldrb r4, [r1, 0x8] - cmp r4, r9 - bge _080D0C42 - mov r10, r2 -_080D0C04: - lsls r1, r7, 2 - adds r1, r7 - lsls r1, 4 - adds r1, 0x14 - mov r2, r10 - ldr r0, [r2] - adds r0, r1 - movs r1, 0x5 - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _080D0C30 - adds r0, r5, 0 - movs r1, 0x5 - bl get_pokemon_data_from_selected_box - cmp r0, 0 - beq _080D0C30 - movs r0, 0 - b _080D0C50 - .pool -_080D0C30: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r4, 0x1 - cmp r4, r9 - blt _080D0C04 -_080D0C42: - movs r0, 0x6 - add r8, r0 - adds r6, 0x1 - ldr r2, [sp] - cmp r6, r2 - blt _080D0BF0 -_080D0C4E: - movs r0, 0x1 -_080D0C50: - 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_80D0BC0 - - thumb_func_start sub_80D0C60 -sub_80D0C60: @ 80D0C60 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - ldr r3, =0x02039d08 - ldr r0, [r3] - ldrb r0, [r0, 0x1] - cmp r0, 0x3 - bne _080D0D3E - ldr r0, =0x03000f78 - str r0, [sp, 0x18] - ldr r1, =0xffff0000 - add r2, sp, 0x18 - ldr r0, [r2, 0x4] - ands r0, r1 - movs r1, 0x80 - lsls r1, 2 - orrs r0, r1 - str r0, [r2, 0x4] - mov r1, sp - ldr r0, =gUnknown_0857BC70 - ldm r0!, {r4-r6} - stm r1!, {r4-r6} - ldm r0!, {r4-r6} - stm r1!, {r4-r6} - movs r7, 0 - mov r9, r2 - mov r8, r3 - movs r0, 0 - mov r10, r0 -_080D0CA0: - adds r6, r7, 0x7 - lsls r1, r6, 16 - mov r2, r9 - ldrh r0, [r2, 0x4] - orrs r0, r1 - str r0, [r2, 0x4] - mov r0, r9 - bl LoadCompressedObjectPic - mov r4, r9 - ldrh r0, [r4, 0x6] - bl GetObjectTileRangeStartByTag - mov r5, r8 - ldr r1, [r5] - lsls r5, r7, 4 - ldr r2, =0x00002208 - adds r1, r2 - adds r1, r5 - lsls r0, 16 - lsrs r0, 11 - ldr r4, =0x06010000 - adds r0, r4 - str r0, [r1] - ldr r0, =0xffffdacb - adds r4, r7, r0 - lsls r0, r4, 16 - lsrs r0, 16 - bl AllocObjectPalette - mov r2, r8 - ldr r1, [r2] - adds r1, r5 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x0000220c - adds r1, r2 - strh r0, [r1] - ldrh r0, [r1] - lsls r0, 4 - movs r2, 0x80 - lsls r2, 1 - adds r0, r2 - strh r0, [r1] - mov r0, sp - strh r6, [r0] - strh r4, [r0, 0x2] - movs r1, 0 - movs r2, 0 - movs r3, 0xB - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - mov r4, r8 - ldr r2, [r4] - ldr r6, =0x00002204 - adds r2, r6 - adds r2, r5 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - str r1, [r2] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - ldr r0, [r4] - adds r0, r5 - ldr r1, =0x00002210 - adds r0, r1 - mov r2, r10 - strb r2, [r0] - adds r7, 0x1 - cmp r7, 0x2 - ble _080D0CA0 -_080D0D3E: - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r4, =0x00002234 - adds r0, r4 - movs r1, 0 - strh r1, [r0] - 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_80D0C60 - - thumb_func_start sub_80D0D8C -sub_80D0D8C: @ 80D0D8C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r7, r1, 24 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x3 - bne _080D0E42 - mov r0, r8 - adds r1, r7, 0 - bl sub_80D1324 - cmp r0, 0 - bne _080D0E42 - mov r0, r8 - cmp r0, 0 - beq _080D0DC4 - cmp r0, 0x1 - beq _080D0DDA - b _080D0E42 - .pool -_080D0DC4: - adds r0, r7, 0 - movs r1, 0x5 - bl get_pokemon_data_from_selected_box - cmp r0, 0 - beq _080D0E42 - adds r0, r7, 0 - movs r1, 0xC - bl get_pokemon_data_from_selected_box - b _080D0DFC -_080D0DDA: - cmp r7, 0x5 - bhi _080D0E42 - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x5 - bl pokemon_getattr - cmp r0, 0 - beq _080D0E42 - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr -_080D0DFC: - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _080D0E42 - adds r0, r4, 0 - bl GetItemIconPic - adds r6, r0, 0 - adds r0, r4, 0 - bl GetItemIconPalette - adds r5, r0, 0 - bl sub_80D12E8 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - mov r1, r8 - adds r2, r7, 0 - bl sub_80D140C - adds r0, r4, 0 - adds r1, r6, 0 - adds r2, r5, 0 - bl sub_80D1524 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80D15D4 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80D1740 -_080D0E42: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D0D8C - - thumb_func_start sub_80D0E50 -sub_80D0E50: @ 80D0E50 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x3 - bne _080D0E86 - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_80D1370 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0x2 - bl sub_80D15D4 - adds r0, r4, 0 - movs r1, 0 - adds r2, r6, 0 - adds r3, r5, 0 - bl sub_80D1604 -_080D0E86: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D0E50 - - thumb_func_start sub_80D0E90 -sub_80D0E90: @ 80D0E90 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - adds r7, r5, 0 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x3 - bne _080D0F20 - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_80D1370 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r1, 0 - mov r0, sp - strh r1, [r0] - adds r0, r4, 0 - movs r1, 0x3 - bl sub_80D15D4 - adds r0, r4, 0 - movs r1, 0x1 - adds r2, r6, 0 - adds r3, r5, 0 - bl sub_80D1604 - adds r0, r4, 0 - movs r1, 0x2 - movs r2, 0 - bl sub_80D140C - cmp r6, 0 - bne _080D0EF8 - adds r0, r5, 0 - movs r1, 0xC - mov r2, sp - bl set_pokemon_data_from_selected_box - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80CB7AC - b _080D0F10 - .pool -_080D0EF8: - movs r0, 0x64 - muls r0, r7 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xC - mov r2, sp - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x1 - bl sub_80CBBDC -_080D0F10: - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r2, =0x00000ce6 - adds r1, r0, r2 - ldrh r1, [r1] - ldr r2, =0x00002234 - adds r0, r2 - strh r1, [r0] -_080D0F20: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D0E90 - - thumb_func_start sub_80D0F38 -sub_80D0F38: @ 80D0F38 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r5, 0 - bl GetItemIconPic - mov r8, r0 - adds r0, r5, 0 - bl GetItemIconPalette - adds r6, r0, 0 - bl sub_80D12E8 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - mov r1, r8 - adds r2, r6, 0 - bl sub_80D1524 - adds r0, r4, 0 - movs r1, 0x6 - bl sub_80D15D4 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - movs r3, 0 - bl sub_80D1604 - adds r0, r4, 0 - movs r1, 0x2 - movs r2, 0 - bl sub_80D140C - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80D1740 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x00002234 - adds r0, r1 - strh r5, [r0] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D0F38 - - thumb_func_start sub_80D0FAC -sub_80D0FAC: @ 80D0FAC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r1, 24 - lsrs r7, r1, 24 - ldr r0, =0x02039d08 - mov r8, r0 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x3 - bne _080D106A - mov r0, r9 - adds r1, r7, 0 - bl sub_80D1370 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - movs r1, 0x3 - bl sub_80D15D4 - adds r0, r4, 0 - movs r1, 0x3 - movs r2, 0x2 - movs r3, 0 - bl sub_80D1604 - mov r1, r9 - cmp r1, 0 - bne _080D101C - adds r0, r7, 0 - movs r1, 0xC - bl get_pokemon_data_from_selected_box - lsls r0, 16 - lsrs r6, r0, 16 - mov r0, r8 - ldr r2, [r0] - ldr r4, =0x00002234 - adds r2, r4 - adds r0, r7, 0 - movs r1, 0xC - bl set_pokemon_data_from_selected_box - mov r1, r8 - ldr r0, [r1] - adds r0, r4 - b _080D1048 - .pool -_080D101C: - movs r0, 0x64 - adds r4, r7, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr - lsls r0, 16 - lsrs r6, r0, 16 - mov r0, r8 - ldr r2, [r0] - ldr r5, =0x00002234 - adds r2, r5 - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_setattr - mov r1, r8 - ldr r0, [r1] - adds r0, r5 -_080D1048: - strh r6, [r0] - movs r0, 0x2 - movs r1, 0 - bl sub_80D1370 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - movs r1, 0x4 - bl sub_80D15D4 - adds r0, r4, 0 - movs r1, 0x4 - mov r2, r9 - adds r3, r7, 0 - bl sub_80D1604 -_080D106A: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D0FAC - - thumb_func_start sub_80D1080 -sub_80D1080: @ 80D1080 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - mov r8, r5 - ldr r6, =0x02039d08 - ldr r0, [r6] - ldrb r0, [r0, 0x1] - cmp r0, 0x3 - bne _080D1100 - movs r0, 0x2 - movs r1, 0 - bl sub_80D1370 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0x4 - bl sub_80D15D4 - adds r0, r4, 0 - movs r1, 0x2 - adds r2, r7, 0 - adds r3, r5, 0 - bl sub_80D1604 - cmp r7, 0 - bne _080D10E0 - ldr r2, [r6] - ldr r0, =0x00002234 - adds r2, r0 - adds r0, r5, 0 - movs r1, 0xC - bl set_pokemon_data_from_selected_box - adds r0, r5, 0 - movs r1, 0 - bl sub_80CB7AC - b _080D1100 - .pool -_080D10E0: - movs r0, 0x64 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - ldr r1, =0x020244ec - adds r0, r1 - ldr r2, [r6] - ldr r1, =0x00002234 - adds r2, r1 - movs r1, 0xC - bl pokemon_setattr - mov r0, r8 - movs r1, 0 - bl sub_80CBBDC -_080D1100: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D1080 - - thumb_func_start sub_80D1114 -sub_80D1114: @ 80D1114 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - adds r7, r5, 0 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x3 - bne _080D1188 - movs r1, 0 - mov r0, sp - strh r1, [r0] - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_80D1370 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0x2 - bl sub_80D15D4 - adds r0, r4, 0 - movs r1, 0 - adds r2, r6, 0 - adds r3, r5, 0 - bl sub_80D1604 - cmp r6, 0 - bne _080D1170 - adds r0, r5, 0 - movs r1, 0xC - mov r2, sp - bl set_pokemon_data_from_selected_box - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80CB7AC - b _080D1188 - .pool -_080D1170: - movs r0, 0x64 - muls r0, r7 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xC - mov r2, sp - bl pokemon_setattr - adds r0, r7, 0 - movs r1, 0x1 - bl sub_80CBBDC -_080D1188: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D1114 - - thumb_func_start sub_80D1194 -sub_80D1194: @ 80D1194 - push {r4,lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x3 - bne _080D11C2 - movs r0, 0x2 - movs r1, 0 - bl sub_80D1370 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0x5 - bl sub_80D15D4 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x2 - movs r3, 0 - bl sub_80D1604 -_080D11C2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D1194 - - thumb_func_start sub_80D11CC -sub_80D11CC: @ 80D11CC - push {r4,lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x3 - bne _080D120A - movs r4, 0 -_080D11DA: - ldr r0, =0x02039d08 - ldr r1, [r0] - lsls r0, r4, 4 - adds r1, r0 - ldr r2, =0x00002210 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080D1204 - subs r2, 0x2 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080D1204 - lsls r0, r4, 24 - lsrs r0, 24 - movs r1, 0x7 - movs r2, 0x2 - movs r3, 0 - bl sub_80D1604 -_080D1204: - adds r4, 0x1 - cmp r4, 0x2 - ble _080D11DA -_080D120A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D11CC - - thumb_func_start sub_80D1218 -sub_80D1218: @ 80D1218 - push {r4,r5,lr} - movs r5, 0 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x00002204 - adds r4, r0, r1 - adds r3, r0, 0 -_080D1226: - ldr r1, =0x00002210 - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080D1268 - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x28 - ands r0, r1 - cmp r0, 0x8 - beq _080D124E - ldr r1, [r2, 0x1C] - ldr r0, =DummyObjectCallback - cmp r1, r0 - beq _080D1268 - ldr r0, =sub_80D1AD8 - cmp r1, r0 - beq _080D1268 -_080D124E: - movs r0, 0x1 - b _080D1274 - .pool -_080D1268: - adds r4, 0x10 - adds r3, 0x10 - adds r5, 0x1 - cmp r5, 0x2 - ble _080D1226 - movs r0, 0 -_080D1274: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80D1218 - - thumb_func_start sub_80D127C -sub_80D127C: @ 80D127C - push {lr} - ldr r0, =0x02039d08 - ldr r1, [r0] - ldrb r0, [r1, 0x1] - cmp r0, 0x3 - bne _080D12B0 - movs r2, 0 - ldr r0, =0x0000220e - adds r1, r0 -_080D128E: - ldrb r0, [r1, 0x2] - cmp r0, 0 - beq _080D12A8 - ldrb r0, [r1] - cmp r0, 0x2 - bne _080D12A8 - movs r0, 0x1 - b _080D12B2 - .pool -_080D12A8: - adds r1, 0x10 - adds r2, 0x1 - cmp r2, 0x2 - ble _080D128E -_080D12B0: - movs r0, 0 -_080D12B2: - pop {r1} - bx r1 - thumb_func_end sub_80D127C - - thumb_func_start sub_80D12B8 -sub_80D12B8: @ 80D12B8 - push {lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x00002234 - adds r0, r1 - ldrh r0, [r0] - bl itemid_get_item - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D12B8 - - thumb_func_start sub_80D12D4 -sub_80D12D4: @ 80D12D4 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x00002234 - adds r0, r1 - ldrh r0, [r0] - bx lr - .pool - thumb_func_end sub_80D12D4 - - thumb_func_start sub_80D12E8 -sub_80D12E8: @ 80D12E8 - push {r4,r5,lr} - movs r2, 0 - ldr r5, =0x02039d08 - ldr r3, =0x00002210 - movs r4, 0x1 -_080D12F2: - ldr r0, [r5] - lsls r1, r2, 4 - adds r0, r1 - adds r1, r0, r3 - ldrb r0, [r1] - cmp r0, 0 - bne _080D1310 - strb r4, [r1] - adds r0, r2, 0 - b _080D131C - .pool -_080D1310: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x2 - bls _080D12F2 - movs r0, 0x3 -_080D131C: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80D12E8 - - thumb_func_start sub_80D1324 -sub_80D1324: @ 80D1324 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r1, 24 - movs r3, 0 - ldr r0, =0x02039d08 - ldr r2, [r0] -_080D1334: - ldr r5, =0x00002210 - adds r0, r2, r5 - ldrb r0, [r0] - cmp r0, 0 - beq _080D1360 - subs r5, 0x2 - adds r0, r2, r5 - ldrb r0, [r0] - cmp r0, r4 - bne _080D1360 - adds r5, 0x1 - adds r0, r2, r5 - ldrb r0, [r0] - cmp r0, r1 - bne _080D1360 - movs r0, 0x1 - b _080D136A - .pool -_080D1360: - adds r2, 0x10 - adds r3, 0x1 - cmp r3, 0x2 - ble _080D1334 - movs r0, 0 -_080D136A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80D1324 - - thumb_func_start sub_80D1370 -sub_80D1370: @ 80D1370 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - movs r3, 0 - ldr r0, =0x02039d08 - ldr r1, [r0] -_080D1380: - lsls r0, r3, 4 - adds r2, r1, r0 - ldr r6, =0x00002210 - adds r0, r2, r6 - ldrb r0, [r0] - cmp r0, 0 - beq _080D13B0 - subs r6, 0x2 - adds r0, r2, r6 - ldrb r0, [r0] - cmp r0, r5 - bne _080D13B0 - adds r6, 0x1 - adds r0, r2, r6 - ldrb r0, [r0] - cmp r0, r4 - bne _080D13B0 - adds r0, r3, 0 - b _080D13BC - .pool -_080D13B0: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x2 - bls _080D1380 - movs r0, 0x3 -_080D13BC: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80D1370 - - thumb_func_start sub_80D13C4 -sub_80D13C4: @ 80D13C4 - push {r4-r6,lr} - adds r5, r0, 0 - movs r2, 0 - ldr r0, =0x02039d08 - ldr r3, [r0] - ldr r0, =0x00002204 - adds r4, r3, r0 - ldr r6, =0x00002210 -_080D13D4: - lsls r1, r2, 4 - adds r0, r3, r1 - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0 - beq _080D13F8 - adds r0, r4, r1 - ldr r0, [r0] - cmp r0, r5 - bne _080D13F8 - adds r0, r2, 0 - b _080D1404 - .pool -_080D13F8: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x2 - bls _080D13D4 - movs r0, 0x3 -_080D1404: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80D13C4 - - thumb_func_start sub_80D140C -sub_80D140C: @ 80D140C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r2, 24 - lsrs r7, r2, 24 - cmp r5, 0x2 - bhi _080D150A - cmp r1, 0 - beq _080D1438 - cmp r1, 0x1 - beq _080D1494 - ldr r4, =0x02039d08 - lsls r3, r5, 4 - b _080D14F4 - .pool -_080D1438: - adds r0, r7, 0 - movs r1, 0x6 - bl __umodsi3 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r7, 0 - movs r1, 0x6 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - ldr r6, =0x02039d08 - ldr r2, [r6] - lsls r5, 4 - ldr r1, =0x00002204 - adds r2, r1 - adds r2, r5 - ldr r3, [r2] - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 3 - adds r1, 0x70 - strh r1, [r3, 0x20] - ldr r3, [r2] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 3 - adds r1, 0x38 - strh r1, [r3, 0x22] - ldr r2, [r2] - ldrb r1, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r2, 0x5] - adds r4, r6, 0 - adds r3, r5, 0 - b _080D14F4 - .pool -_080D1494: - cmp r7, 0 - bne _080D14BC - ldr r4, =0x02039d08 - ldr r0, [r4] - lsls r3, r5, 4 - ldr r1, =0x00002204 - adds r0, r1 - adds r0, r3 - ldr r2, [r0] - movs r1, 0x74 - strh r1, [r2, 0x20] - ldr r1, [r0] - movs r0, 0x4C - strh r0, [r1, 0x22] - b _080D14DC - .pool -_080D14BC: - ldr r4, =0x02039d08 - ldr r0, [r4] - lsls r3, r5, 4 - ldr r1, =0x00002204 - adds r0, r1 - adds r0, r3 - ldr r2, [r0] - movs r1, 0xA4 - strh r1, [r2, 0x20] - ldr r2, [r0] - subs r1, r7, 0x1 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, 0x1C - strh r0, [r2, 0x22] -_080D14DC: - ldr r0, [r4] - ldr r1, =0x00002204 - adds r0, r1 - adds r0, r3 - ldr r2, [r0] - ldrb r1, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0x5] -_080D14F4: - ldr r0, [r4] - adds r0, r3 - ldr r1, =0x0000220e - adds r0, r1 - mov r1, r8 - strb r1, [r0] - ldr r0, [r4] - adds r0, r3 - ldr r1, =0x0000220f - adds r0, r1 - strb r7, [r0] -_080D150A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D140C - - thumb_func_start sub_80D1524 -sub_80D1524: @ 80D1524 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - mov r8, r1 - mov r9, r2 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x2 - bhi _080D15AC - movs r0, 0 - str r0, [sp] - ldr r4, =0x02039d08 - ldr r1, [r4] - ldr r6, =0x000042c4 - adds r1, r6 - ldr r2, =0x01000080 - mov r0, sp - bl CpuFastSet - ldr r1, [r4] - ldr r5, =0x000022c4 - adds r1, r5 - mov r0, r8 - bl LZ77UnCompWram - lsls r7, 4 - mov r8, r7 - adds r7, r4, 0 - movs r4, 0x2 -_080D1562: - ldr r1, [r7] - adds r0, r1, r5 - adds r1, r6 - movs r2, 0x18 - bl CpuFastSet - adds r6, 0x80 - adds r5, 0x60 - subs r4, 0x1 - cmp r4, 0 - bge _080D1562 - ldr r5, =0x02039d08 - ldr r1, [r5] - ldr r4, =0x000042c4 - adds r0, r1, r4 - ldr r2, =0x00002208 - adds r1, r2 - add r1, r8 - ldr r1, [r1] - movs r2, 0x80 - bl CpuFastSet - ldr r1, [r5] - adds r1, r4 - mov r0, r9 - bl LZ77UnCompWram - ldr r0, [r5] - adds r4, r0, r4 - add r0, r8 - ldr r1, =0x0000220c - adds r0, r1 - ldrh r1, [r0] - adds r0, r4, 0 - movs r2, 0x20 - bl gpu_pal_apply -_080D15AC: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D1524 - - thumb_func_start sub_80D15D4 -sub_80D15D4: @ 80D15D4 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r3, r1, 24 - cmp r2, 0x2 - bhi _080D15F6 - ldr r0, =0x02039d08 - ldr r0, [r0] - lsls r1, r2, 4 - ldr r2, =0x00002204 - adds r0, r2 - adds r0, r1 - ldr r0, [r0] - adds r1, r3, 0 - bl StartObjectRotScalAnim -_080D15F6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D15D4 - - thumb_func_start sub_80D1604 -sub_80D1604: @ 80D1604 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r0, r1, 24 - lsls r2, 24 - lsrs r5, r2, 24 - lsls r3, 24 - lsrs r3, 24 - cmp r4, 0x2 - bls _080D161C - b _080D172E -_080D161C: - cmp r0, 0x7 - bls _080D1622 - b _080D172E -_080D1622: - lsls r0, 2 - ldr r1, =_080D1630 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080D1630: - .4byte _080D1650 - .4byte _080D1674 - .4byte _080D1698 - .4byte _080D16C4 - .4byte _080D16F0 - .4byte _080D172E - .4byte _080D172E - .4byte _080D171C -_080D1650: - ldr r0, =0x02039d08 - ldr r0, [r0] - lsls r1, r4, 4 - ldr r2, =0x00002204 - adds r0, r2 - adds r0, r1 - ldr r1, [r0] - strh r4, [r1, 0x2E] - ldr r1, [r0] - ldr r0, =sub_80D1A48 - b _080D172C - .pool -_080D1674: - ldr r0, =0x02039d08 - ldr r0, [r0] - lsls r1, r4, 4 - ldr r2, =0x00002204 - adds r0, r2 - adds r0, r1 - ldr r2, [r0] - movs r1, 0 - strh r1, [r2, 0x2E] - ldr r1, [r0] - ldr r0, =sub_80D1A74 - b _080D172C - .pool -_080D1698: - ldr r0, =0x02039d08 - ldr r0, [r0] - lsls r1, r4, 4 - ldr r2, =0x00002204 - adds r0, r2 - adds r0, r1 - ldr r2, [r0] - movs r1, 0 - strh r1, [r2, 0x2E] - ldr r1, [r0] - strh r5, [r1, 0x3A] - ldr r1, [r0] - strh r3, [r1, 0x3C] - ldr r1, [r0] - ldr r0, =sub_80D1B14 - b _080D172C - .pool -_080D16C4: - ldr r0, =0x02039d08 - ldr r0, [r0] - lsls r1, r4, 4 - ldr r2, =0x00002204 - adds r0, r2 - adds r0, r1 - ldr r2, [r0] - movs r1, 0 - strh r1, [r2, 0x2E] - ldr r2, [r0] - ldr r1, =sub_80D1B94 - str r1, [r2, 0x1C] - strh r5, [r2, 0x3A] - ldr r0, [r0] - strh r3, [r0, 0x3C] - b _080D172E - .pool -_080D16F0: - ldr r0, =0x02039d08 - ldr r0, [r0] - lsls r1, r4, 4 - ldr r2, =0x00002204 - adds r0, r2 - adds r0, r1 - ldr r2, [r0] - movs r1, 0 - strh r1, [r2, 0x2E] - ldr r1, [r0] - strh r5, [r1, 0x3A] - ldr r1, [r0] - strh r3, [r1, 0x3C] - ldr r1, [r0] - ldr r0, =sub_80D1C30 - b _080D172C - .pool -_080D171C: - ldr r0, =0x02039d08 - ldr r0, [r0] - lsls r1, r4, 4 - ldr r2, =0x00002204 - adds r0, r2 - adds r0, r1 - ldr r1, [r0] - ldr r0, =sub_80D1CCC -_080D172C: - str r0, [r1, 0x1C] -_080D172E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D1604 - - thumb_func_start sub_80D1740 -sub_80D1740: @ 80D1740 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - cmp r2, 0x2 - bhi _080D1780 - ldr r1, =0x02039d08 - ldr r0, [r1] - lsls r2, 4 - adds r0, r2 - ldr r3, =0x00002210 - adds r0, r3 - strb r4, [r0] - ldr r0, [r1] - ldr r1, =0x00002204 - adds r0, r1 - adds r0, r2 - ldr r0, [r0] - movs r3, 0 - cmp r4, 0 - bne _080D176E - movs r3, 0x1 -_080D176E: - adds r2, r0, 0 - adds r2, 0x3E - lsls r3, 2 - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - orrs r0, r3 - strb r0, [r2] -_080D1780: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D1740 - - thumb_func_start GetItemIconPic -GetItemIconPic: @ 80D1794 - push {lr} - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - bl GetItemIconPicOrPalette - pop {r1} - bx r1 - thumb_func_end GetItemIconPic - - thumb_func_start GetItemIconPalette -GetItemIconPalette: @ 80D17A4 - push {lr} - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - bl GetItemIconPicOrPalette - pop {r1} - bx r1 - thumb_func_end GetItemIconPalette - - thumb_func_start sub_80D17B4 -sub_80D17B4: @ 80D17B4 - push {r4,lr} - sub sp, 0x14 - bl sub_80D127C - lsls r0, 24 - cmp r0, 0 - beq _080D17D4 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x00002234 - b _080D17DA - .pool -_080D17D4: - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x00000ce6 -_080D17DA: - adds r0, r1 - ldrh r0, [r0] - bl itemid_get_description - adds r4, r0, 0 - movs r0, 0x2 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - movs r0, 0x1 - str r0, [sp, 0x10] - movs r0, 0x2 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x4 - bl sub_8199F74 - add sp, 0x14 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D17B4 - - thumb_func_start sub_80D1818 -sub_80D1818: @ 80D1818 - push {lr} - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x00002236 - adds r0, r1 - movs r1, 0x15 - strh r1, [r0] - ldr r1, =gUnknown_0857BB24 - movs r3, 0x9D - lsls r3, 1 - movs r0, 0 - movs r2, 0x80 - bl LoadBgTiles - movs r0, 0 - bl sub_80D19B4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D1818 - - thumb_func_start sub_80D184C -sub_80D184C: @ 80D184C - push {r4,r5,lr} - sub sp, 0x10 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r2, =0x00002236 - adds r1, r0, r2 - ldrh r0, [r1] - cmp r0, 0 - bne _080D186C - movs r0, 0 - b _080D18D2 - .pool -_080D186C: - subs r0, 0x1 - strh r0, [r1] - ldrh r1, [r1] - movs r0, 0x15 - subs r5, r0, r1 - movs r4, 0 - cmp r4, r5 - bge _080D18BC -_080D187C: - movs r0, 0 - movs r1, 0xA - bl GetBgAttribute - adds r1, r0, 0 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r2, =0x00002236 - adds r0, r2 - adds r1, 0x14 - ldrh r0, [r0] - adds r1, r0 - adds r1, r4 - lsls r1, 16 - lsrs r1, 16 - lsls r2, r4, 24 - lsrs r2, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - movs r0, 0x15 - str r0, [sp, 0xC] - movs r0, 0 - movs r3, 0xD - bl WriteSequenceToBgTilemapBuffer - adds r4, 0x1 - cmp r4, r5 - blt _080D187C -_080D18BC: - adds r0, r5, 0 - bl sub_80D19B4 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r1, =0x00002236 - adds r0, r1 - ldrh r1, [r0] - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 -_080D18D2: - add sp, 0x10 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D184C - - thumb_func_start sub_80D18E4 -sub_80D18E4: @ 80D18E4 - push {r4,r5,lr} - sub sp, 0x10 - ldr r5, =0x02039d08 - ldr r0, [r5] - ldr r4, =0x00002236 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0x16 - bne _080D1904 - movs r0, 0 - b _080D19A4 - .pool -_080D1904: - cmp r0, 0 - bne _080D1920 - movs r0, 0x1 - str r0, [sp] - movs r0, 0x9 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0x15 - movs r3, 0xC - bl FillBgTilemapBufferRect -_080D1920: - ldr r1, [r5] - adds r1, r4 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - ldrh r1, [r1] - movs r0, 0x15 - subs r5, r0, r1 - movs r4, 0 - cmp r4, r5 - bge _080D1976 -_080D1936: - movs r0, 0 - movs r1, 0xA - bl GetBgAttribute - adds r1, r0, 0 - ldr r0, =0x02039d08 - ldr r0, [r0] - ldr r2, =0x00002236 - adds r0, r2 - adds r1, 0x14 - ldrh r0, [r0] - adds r1, r0 - adds r1, r4 - lsls r1, 16 - lsrs r1, 16 - lsls r2, r4, 24 - lsrs r2, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - movs r0, 0x15 - str r0, [sp, 0xC] - movs r0, 0 - movs r3, 0xD - bl WriteSequenceToBgTilemapBuffer - adds r4, 0x1 - cmp r4, r5 - blt _080D1936 -_080D1976: - cmp r5, 0 - blt _080D1980 - adds r0, r5, 0 - bl sub_80D19B4 -_080D1980: - adds r2, r5, 0x1 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0x9 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r3, 0xC - bl FillBgTilemapBufferRect - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 -_080D19A4: - add sp, 0x10 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D18E4 - - thumb_func_start sub_80D19B4 -sub_80D19B4: @ 80D19B4 - push {r4-r7,lr} - sub sp, 0xC - adds r7, r0, 0 - cmp r7, 0 - beq _080D19EC - movs r1, 0x9D - lsls r1, 1 - lsls r4, r7, 24 - lsrs r4, 24 - str r4, [sp] - movs r6, 0x1 - str r6, [sp, 0x4] - movs r5, 0xF - str r5, [sp, 0x8] - movs r0, 0 - movs r2, 0 - movs r3, 0xC - bl FillBgTilemapBufferRect - ldr r1, =0x0000093a - str r4, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r2, 0 - movs r3, 0x14 - bl FillBgTilemapBufferRect -_080D19EC: - ldr r1, =0x0000013b - lsls r5, r7, 24 - lsrs r5, 24 - movs r4, 0x1 - str r4, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r6, 0xF - str r6, [sp, 0x8] - movs r0, 0 - adds r2, r5, 0 - movs r3, 0xD - bl FillBgTilemapBufferRect - movs r1, 0x9E - lsls r1, 1 - str r4, [sp] - str r4, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - adds r2, r5, 0 - movs r3, 0xC - bl FillBgTilemapBufferRect - ldr r1, =0x0000013d - str r4, [sp] - str r4, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - adds r2, r5, 0 - movs r3, 0x14 - bl FillBgTilemapBufferRect - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D19B4 - - thumb_func_start sub_80D1A48 -sub_80D1A48: @ 80D1A48 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080D1A68 - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_80D1740 - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] -_080D1A68: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D1A48 - - thumb_func_start sub_80D1A74 -sub_80D1A74: @ 80D1A74 - push {lr} - adds r3, r0, 0 - movs r0, 0x2E - ldrsh r1, [r3, r0] - cmp r1, 0 - beq _080D1A86 - cmp r1, 0x1 - beq _080D1AA2 - b _080D1AD0 -_080D1A86: - ldrh r0, [r3, 0x20] - lsls r0, 4 - strh r0, [r3, 0x30] - ldrh r0, [r3, 0x22] - lsls r0, 4 - strh r0, [r3, 0x32] - movs r0, 0xA - strh r0, [r3, 0x34] - movs r0, 0x15 - strh r0, [r3, 0x36] - strh r1, [r3, 0x38] - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] -_080D1AA2: - ldrh r1, [r3, 0x30] - ldrh r0, [r3, 0x34] - subs r1, r0 - strh r1, [r3, 0x30] - ldrh r0, [r3, 0x32] - ldrh r2, [r3, 0x36] - subs r0, r2 - strh r0, [r3, 0x32] - lsls r1, 16 - asrs r1, 20 - strh r1, [r3, 0x20] - lsls r0, 16 - asrs r0, 20 - strh r0, [r3, 0x22] - ldrh r0, [r3, 0x38] - adds r0, 0x1 - strh r0, [r3, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB - ble _080D1AD0 - ldr r0, =sub_80D1AD8 - str r0, [r3, 0x1C] -_080D1AD0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D1A74 - - thumb_func_start sub_80D1AD8 -sub_80D1AD8: @ 80D1AD8 - ldr r1, =0x02039d08 - ldr r3, [r1] - ldr r1, =0x00000cb4 - adds r3, r1 - ldr r1, [r3] - ldrh r1, [r1, 0x20] - adds r1, 0x4 - strh r1, [r0, 0x20] - ldr r2, [r3] - ldrh r1, [r2, 0x26] - ldrh r2, [r2, 0x22] - adds r1, r2 - adds r1, 0x8 - strh r1, [r0, 0x22] - ldr r1, [r3] - ldrb r1, [r1, 0x5] - movs r2, 0xC - ands r2, r1 - ldrb r3, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r3 - orrs r1, r2 - strb r1, [r0, 0x5] - bx lr - .pool - thumb_func_end sub_80D1AD8 - - thumb_func_start sub_80D1B14 -sub_80D1B14: @ 80D1B14 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x2E - ldrsh r1, [r4, r0] - cmp r1, 0 - beq _080D1B26 - cmp r1, 0x1 - beq _080D1B42 - b _080D1B8A -_080D1B26: - ldrh r0, [r4, 0x20] - lsls r0, 4 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x22] - lsls r0, 4 - strh r0, [r4, 0x32] - movs r0, 0xA - strh r0, [r4, 0x34] - movs r0, 0x15 - strh r0, [r4, 0x36] - strh r1, [r4, 0x38] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_080D1B42: - ldrh r0, [r4, 0x34] - ldrh r1, [r4, 0x30] - adds r0, r1 - strh r0, [r4, 0x30] - ldrh r1, [r4, 0x36] - ldrh r2, [r4, 0x32] - adds r1, r2 - strh r1, [r4, 0x32] - lsls r0, 16 - asrs r0, 20 - strh r0, [r4, 0x20] - lsls r1, 16 - asrs r1, 20 - strh r1, [r4, 0x22] - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB - ble _080D1B8A - adds r0, r4, 0 - bl sub_80D13C4 - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x3A] - lsls r1, 24 - lsrs r1, 24 - ldrh r2, [r4, 0x3C] - lsls r2, 24 - lsrs r2, 24 - bl sub_80D140C - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] -_080D1B8A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D1B14 - - thumb_func_start sub_80D1B94 -sub_80D1B94: @ 80D1B94 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x2E - ldrsh r1, [r4, r0] - cmp r1, 0 - beq _080D1BA6 - cmp r1, 0x1 - beq _080D1BC2 - b _080D1C20 -_080D1BA6: - ldrh r0, [r4, 0x20] - lsls r0, 4 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x22] - lsls r0, 4 - strh r0, [r4, 0x32] - movs r0, 0xA - strh r0, [r4, 0x34] - movs r0, 0x15 - strh r0, [r4, 0x36] - strh r1, [r4, 0x38] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_080D1BC2: - ldrh r1, [r4, 0x30] - ldrh r0, [r4, 0x34] - subs r1, r0 - strh r1, [r4, 0x30] - ldrh r0, [r4, 0x32] - ldrh r2, [r4, 0x36] - subs r0, r2 - strh r0, [r4, 0x32] - lsls r1, 16 - asrs r1, 20 - strh r1, [r4, 0x20] - lsls r0, 16 - asrs r0, 20 - strh r0, [r4, 0x22] - ldr r1, =gUnknown_08329F40 - movs r2, 0x38 - ldrsh r0, [r4, r2] - lsls r0, 4 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 20 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB - ble _080D1C20 - adds r0, r4, 0 - bl sub_80D13C4 - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x3A] - lsls r1, 24 - lsrs r1, 24 - ldrh r2, [r4, 0x3C] - lsls r2, 24 - lsrs r2, 24 - bl sub_80D140C - movs r0, 0 - strh r0, [r4, 0x24] - ldr r0, =sub_80D1AD8 - str r0, [r4, 0x1C] -_080D1C20: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D1B94 - - thumb_func_start sub_80D1C30 -sub_80D1C30: @ 80D1C30 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x2E - ldrsh r1, [r4, r0] - cmp r1, 0 - beq _080D1C42 - cmp r1, 0x1 - beq _080D1C5E - b _080D1CBE -_080D1C42: - ldrh r0, [r4, 0x20] - lsls r0, 4 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x22] - lsls r0, 4 - strh r0, [r4, 0x32] - movs r0, 0xA - strh r0, [r4, 0x34] - movs r0, 0x15 - strh r0, [r4, 0x36] - strh r1, [r4, 0x38] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_080D1C5E: - ldrh r0, [r4, 0x34] - ldrh r1, [r4, 0x30] - adds r0, r1 - strh r0, [r4, 0x30] - ldrh r1, [r4, 0x36] - ldrh r2, [r4, 0x32] - adds r1, r2 - strh r1, [r4, 0x32] - lsls r0, 16 - asrs r0, 20 - strh r0, [r4, 0x20] - lsls r1, 16 - asrs r1, 20 - strh r1, [r4, 0x22] - ldr r1, =gUnknown_08329F40 - movs r2, 0x38 - ldrsh r0, [r4, r2] - lsls r0, 4 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 20 - negs r0, r0 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB - ble _080D1CBE - adds r0, r4, 0 - bl sub_80D13C4 - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x3A] - lsls r1, 24 - lsrs r1, 24 - ldrh r2, [r4, 0x3C] - lsls r2, 24 - lsrs r2, 24 - bl sub_80D140C - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x24] -_080D1CBE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D1C30 - - thumb_func_start sub_80D1CCC -sub_80D1CCC: @ 80D1CCC - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x22] - subs r0, 0x8 - strh r0, [r2, 0x22] - movs r1, 0x22 - ldrsh r0, [r2, r1] - movs r3, 0x26 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bge _080D1CFC - ldr r0, =DummyObjectCallback - str r0, [r2, 0x1C] - adds r0, r2, 0 - bl sub_80D13C4 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_80D1740 -_080D1CFC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D1CCC - - thumb_func_start TaskDummy0 -TaskDummy0: @ 80D1D04 - bx lr - thumb_func_end TaskDummy0 - - thumb_func_start nullsub_98 -nullsub_98: @ 80D1D08 - bx lr - thumb_func_end nullsub_98 - - thumb_func_start get_preferred_box -@ char get_preferred_box() -get_preferred_box: @ 80D1D0C - ldr r0, =0x03005d94 - ldr r0, [r0] - ldrb r0, [r0] - bx lr - .pool - thumb_func_end get_preferred_box - - thumb_func_start sub_80D1D18 -sub_80D1D18: @ 80D1D18 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xD - bhi _080D1D28 - ldr r0, =0x03005d94 - ldr r0, [r0] - strb r1, [r0] -_080D1D28: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D1D18 - - thumb_func_start get_pokemon_data_from_any_box -get_pokemon_data_from_any_box: @ 80D1D30 - push {r4,r5,lr} - adds r5, r2, 0 - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - cmp r3, 0xD - bhi _080D1D6C - cmp r4, 0x1D - bhi _080D1D6C - ldr r2, =0x03005d94 - lsls r0, r3, 2 - adds r0, r3 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 5 - adds r1, 0x4 - ldr r0, [r2] - adds r0, r1 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 4 - adds r0, r1 - adds r1, r5, 0 - bl pokemon_getattr_encrypted - b _080D1D6E - .pool -_080D1D6C: - movs r0, 0 -_080D1D6E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end get_pokemon_data_from_any_box - - thumb_func_start set_pokemon_data_from_any_box -set_pokemon_data_from_any_box: @ 80D1D74 - push {r4-r6,lr} - adds r5, r2, 0 - adds r6, r3, 0 - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - cmp r3, 0xD - bhi _080D1DAC - cmp r4, 0x1D - bhi _080D1DAC - ldr r2, =0x03005d94 - lsls r0, r3, 2 - adds r0, r3 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 5 - adds r1, 0x4 - ldr r0, [r2] - adds r0, r1 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 4 - adds r0, r1 - adds r1, r5, 0 - adds r2, r6, 0 - bl pokemon_setattr_encrypted -_080D1DAC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end set_pokemon_data_from_any_box - - thumb_func_start get_pokemon_data_from_selected_box -get_pokemon_data_from_selected_box: @ 80D1DB8 - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =0x03005d94 - ldr r0, [r0] - ldrb r0, [r0] - adds r1, r3, 0 - bl get_pokemon_data_from_any_box - pop {r1} - bx r1 - .pool - thumb_func_end get_pokemon_data_from_selected_box - - thumb_func_start set_pokemon_data_from_selected_box -set_pokemon_data_from_selected_box: @ 80D1DD8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r3, r2, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x03005d94 - ldr r0, [r0] - ldrb r0, [r0] - adds r1, r4, 0 - adds r2, r5, 0 - bl set_pokemon_data_from_any_box - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end set_pokemon_data_from_selected_box - - thumb_func_start sub_80D1DFC -sub_80D1DFC: @ 80D1DFC - push {r4,r5,lr} - adds r5, r2, 0 - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - cmp r3, 0xD - bhi _080D1E38 - cmp r4, 0x1D - bhi _080D1E38 - ldr r2, =0x03005d94 - lsls r0, r3, 2 - adds r0, r3 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 5 - adds r1, 0x4 - ldr r0, [r2] - adds r0, r1 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 4 - adds r0, r1 - movs r1, 0x2 - adds r2, r5, 0 - bl pokemon_getattr_encrypted - b _080D1E3C - .pool -_080D1E38: - movs r0, 0xFF - strb r0, [r5] -_080D1E3C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80D1DFC - - thumb_func_start sub_80D1E44 -sub_80D1E44: @ 80D1E44 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r2, r1, 24 - cmp r0, 0xD - bhi _080D1E84 - cmp r2, 0x1D - bhi _080D1E84 - ldr r6, =0x03005d94 - lsls r1, r0, 2 - adds r1, r0 - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 5 - adds r5, r0, 0x4 - ldr r0, [r6] - adds r0, r5 - lsls r1, r2, 2 - adds r1, r2 - lsls r4, r1, 4 - adds r0, r4 - movs r1, 0x5 - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _080D1E84 - ldr r0, [r6] - adds r0, r5 - adds r0, r4 - bl sub_80690C0 -_080D1E84: - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D1E44 - - thumb_func_start sub_80D1E90 -sub_80D1E90: @ 80D1E90 - push {r4,r5,lr} - adds r5, r2, 0 - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - cmp r3, 0xD - bhi _080D1EC6 - cmp r4, 0x1D - bhi _080D1EC6 - ldr r2, =0x03005d94 - lsls r0, r3, 2 - adds r0, r3 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 5 - adds r1, 0x4 - ldr r0, [r2] - adds r0, r1 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 4 - adds r0, r1 - movs r1, 0x2 - adds r2, r5, 0 - bl pokemon_setattr_encrypted -_080D1EC6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D1E90 - - thumb_func_start sub_80D1ED0 -sub_80D1ED0: @ 80D1ED0 - push {r4-r6,lr} - adds r5, r2, 0 - adds r6, r3, 0 - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - cmp r3, 0xD - bhi _080D1F10 - cmp r4, 0x1D - bhi _080D1F10 - ldr r2, =0x03005d94 - lsls r0, r3, 2 - adds r0, r3 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 5 - adds r1, 0x4 - ldr r0, [r2] - adds r0, r1 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 4 - adds r0, r1 - adds r1, r5, 0 - adds r2, r6, 0 - bl pokemon_getattr_encrypted - b _080D1F12 - .pool -_080D1F10: - movs r0, 0 -_080D1F12: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80D1ED0 - - thumb_func_start sub_80D1F18 -sub_80D1F18: @ 80D1F18 - push {r4,r5,lr} - adds r5, r2, 0 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r4, 0xD - bhi _080D1F4E - cmp r1, 0x1D - bhi _080D1F4E - ldr r0, =0x03005d94 - ldr r0, [r0] - lsls r3, r1, 2 - adds r3, r1 - lsls r3, 4 - lsls r2, r4, 2 - adds r2, r4 - lsls r1, r2, 4 - subs r1, r2 - lsls r1, 5 - adds r3, r1 - adds r0, r3 - adds r0, 0x4 - adds r1, r5, 0 - movs r2, 0x50 - bl memcpy -_080D1F4E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D1F18 - - thumb_func_start sub_80D1F58 -sub_80D1F58: @ 80D1F58 - push {r4,r5,lr} - adds r5, r2, 0 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r2, r1, 24 - cmp r4, 0xD - bhi _080D1F8E - cmp r2, 0x1D - bhi _080D1F8E - ldr r0, =0x03005d94 - ldr r1, [r0] - lsls r3, r2, 2 - adds r3, r2 - lsls r3, 4 - lsls r2, r4, 2 - adds r2, r4 - lsls r0, r2, 4 - subs r0, r2 - lsls r0, 5 - adds r3, r0 - adds r1, r3 - adds r1, 0x4 - adds r0, r5, 0 - movs r2, 0x50 - bl memcpy -_080D1F8E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D1F58 - - thumb_func_start sub_80D1F98 -sub_80D1F98: @ 80D1F98 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - ldr r4, [sp, 0x30] - ldr r5, [sp, 0x34] - ldr r6, [sp, 0x3C] - mov r12, r6 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 16 - lsrs r2, 16 - mov r9, r2 - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - mov r0, r12 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r7, 0xD - bhi _080D2004 - cmp r6, 0x1D - bhi _080D2004 - ldr r2, =0x03005d94 - lsls r0, r7, 2 - adds r0, r7 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 5 - adds r1, 0x4 - ldr r0, [r2] - adds r0, r1 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 4 - adds r0, r1 - str r5, [sp] - ldr r1, [sp, 0x38] - str r1, [sp, 0x4] - str r3, [sp, 0x8] - ldr r1, [sp, 0x40] - str r1, [sp, 0xC] - mov r1, r9 - mov r2, r8 - adds r3, r4, 0 - bl create_pokemon -_080D2004: - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D1F98 - - thumb_func_start sub_80D2018 -sub_80D2018: @ 80D2018 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - cmp r3, 0xD - bhi _080D2048 - cmp r4, 0x1D - bhi _080D2048 - ldr r2, =0x03005d94 - lsls r0, r3, 2 - adds r0, r3 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 5 - adds r1, 0x4 - ldr r0, [r2] - adds r0, r1 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 4 - adds r0, r1 - bl zero_pokemon_boxed_data -_080D2048: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D2018 - - thumb_func_start sub_80D2054 -sub_80D2054: @ 80D2054 - push {r4,r5,lr} - adds r5, r2, 0 - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - cmp r3, 0xD - bhi _080D2088 - cmp r4, 0x1D - bhi _080D2088 - ldr r2, =0x03005d94 - lsls r0, r3, 2 - adds r0, r3 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 5 - adds r1, 0x4 - ldr r0, [r2] - adds r0, r1 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 4 - adds r0, r1 - adds r1, r5, 0 - bl sub_8069004 -_080D2088: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D2054 - - thumb_func_start get_pokemon_by_box_and_pos -@ pokemon *get_pokemon_by_box_and_pos(u8 box_id, u8 pos) -get_pokemon_by_box_and_pos: @ 80D2094 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - cmp r3, 0xD - bhi _080D20C8 - cmp r4, 0x1D - bhi _080D20C8 - ldr r2, =0x03005d94 - lsls r0, r3, 2 - adds r0, r3 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 5 - adds r1, 0x4 - ldr r0, [r2] - adds r0, r1 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 4 - adds r0, r1 - b _080D20CA - .pool -_080D20C8: - movs r0, 0 -_080D20CA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end get_pokemon_by_box_and_pos - - thumb_func_start sav3_get_box_name -sav3_get_box_name: @ 80D20D0 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xD - bls _080D20DE - movs r0, 0 - b _080D20EC -_080D20DE: - ldr r0, =0x03005d94 - lsls r1, r2, 3 - adds r1, r2 - ldr r2, =0x00008344 - adds r1, r2 - ldr r0, [r0] - adds r0, r1 -_080D20EC: - pop {r1} - bx r1 - .pool - thumb_func_end sav3_get_box_name - - thumb_func_start sub_80D20F8 -sub_80D20F8: @ 80D20F8 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xD - bls _080D2106 - movs r0, 0 - b _080D2112 -_080D2106: - ldr r0, =0x03005d94 - ldr r0, [r0] - ldr r2, =0x000083c2 - adds r0, r2 - adds r0, r1 - ldrb r0, [r0] -_080D2112: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D20F8 - - thumb_func_start sub_80D2120 -sub_80D2120: @ 80D2120 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r2, 0xD - bhi _080D213E - cmp r1, 0x10 - bhi _080D213E - ldr r0, =0x03005d94 - ldr r0, [r0] - ldr r3, =0x000083c2 - adds r0, r3 - adds r0, r2 - strb r1, [r0] -_080D213E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D2120 - - thumb_func_start sub_80D214C -sub_80D214C: @ 80D214C - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r0 - lsls r1, 24 - lsrs r0, r1, 24 - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r3, 24 - adds r4, r3, 0 - ldr r2, =0x0000ffff - cmp r3, 0x1 - bhi _080D216E - movs r2, 0x1 - cmp r3, 0x1 - beq _080D2172 -_080D216E: - cmp r4, 0x3 - bne _080D21BC -_080D2172: - lsls r0, 24 - asrs r0, 24 - lsls r2, 16 - asrs r1, r2, 16 - adds r1, r0 - lsls r0, r1, 16 - asrs r1, r0, 16 - adds r6, r2, 0 - cmp r1, 0 - blt _080D2208 - cmp r1, r7 - bgt _080D2208 -_080D218A: - asrs r4, r0, 16 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 4 - add r0, r8 - movs r1, 0xB - bl pokemon_getattr_encrypted - cmp r0, 0 - bne _080D21B4 - asrs r0, r6, 16 - adds r0, r4, r0 - lsls r0, 16 - asrs r2, r0, 16 - cmp r2, 0 - blt _080D2208 - cmp r2, r7 - ble _080D218A - b _080D2208 - .pool -_080D21B4: - adds r0, r4, 0 - b _080D220C -_080D21B8: - adds r0, r5, 0 - b _080D220C -_080D21BC: - lsls r0, 24 - asrs r0, 24 - lsls r2, 16 - asrs r1, r2, 16 - adds r1, r0 - lsls r0, r1, 16 - asrs r1, r0, 16 - adds r6, r2, 0 - cmp r1, 0 - blt _080D2208 - cmp r1, r7 - bgt _080D2208 -_080D21D4: - asrs r5, r0, 16 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 4 - mov r1, r8 - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _080D21F8 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _080D21B8 -_080D21F8: - asrs r0, r6, 16 - adds r0, r5, r0 - lsls r0, 16 - asrs r2, r0, 16 - cmp r2, 0 - blt _080D2208 - cmp r2, r7 - ble _080D21D4 -_080D2208: - movs r0, 0x1 - negs r0, r0 -_080D220C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80D214C - - thumb_func_start sub_80D2218 -sub_80D2218: @ 80D2218 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - movs r2, 0 - ldr r0, =0x03005d94 - mov r8, r0 - movs r7, 0x4 -_080D2228: - movs r5, 0 - adds r6, r7, 0 - movs r4, 0 -_080D222E: - mov r1, r8 - ldr r0, [r1] - adds r0, r6 - adds r0, r4 - movs r1, 0x5 - str r2, [sp] - bl pokemon_getattr_encrypted - ldr r2, [sp] - cmp r0, 0 - bne _080D224C - movs r0, 0x1 - b _080D2262 - .pool -_080D224C: - adds r4, 0x50 - adds r5, 0x1 - cmp r5, 0x1D - ble _080D222E - movs r0, 0x96 - lsls r0, 4 - adds r7, r0 - adds r2, 0x1 - cmp r2, 0xD - ble _080D2228 - movs r0, 0 -_080D2262: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80D2218 - - thumb_func_start sub_80D2270 -sub_80D2270: @ 80D2270 - push {r4-r6,lr} - adds r2, r1, 0 - cmp r0, 0xD - bhi _080D22C8 - cmp r2, 0x1D - bhi _080D22C8 - ldr r6, =0x03005d94 - lsls r1, r0, 2 - adds r1, r0 - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 5 - adds r5, r0, 0x4 - ldr r0, [r6] - adds r0, r5 - lsls r1, r2, 2 - adds r1, r2 - lsls r4, r1, 4 - adds r0, r4 - movs r1, 0x5 - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _080D22C8 - ldr r0, [r6] - adds r0, r5 - adds r0, r4 - movs r1, 0x6 - bl pokemon_getattr_encrypted - cmp r0, 0 - bne _080D22C8 - ldr r0, [r6] - adds r0, r5 - adds r0, r4 - movs r1, 0x4 - bl pokemon_getattr_encrypted - cmp r0, 0 - bne _080D22C8 - movs r0, 0x1 - b _080D22CA - .pool -_080D22C8: - movs r0, 0 -_080D22CA: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80D2270 - - thumb_func_start sub_80D22D0 -sub_80D22D0: @ 80D22D0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r7, 0 - movs r0, 0 - ldr r1, =0x03005d94 - mov r9, r1 -_080D22E0: - lsls r1, r0, 2 - adds r2, r0, 0x1 - mov r8, r2 - adds r1, r0 - movs r5, 0 - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 5 - adds r4, r0, 0x4 - movs r6, 0x1D -_080D22F4: - mov r1, r9 - ldr r0, [r1] - adds r0, r4 - adds r0, r5 - movs r1, 0x5 - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _080D231A - mov r2, r9 - ldr r0, [r2] - adds r0, r4 - adds r0, r5 - movs r1, 0x6 - bl pokemon_getattr_encrypted - cmp r0, 0 - bne _080D231A - adds r7, 0x1 -_080D231A: - adds r5, 0x50 - subs r6, 0x1 - cmp r6, 0 - bge _080D22F4 - mov r0, r8 - cmp r0, 0xD - ble _080D22E0 - adds r0, r7, 0 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D22D0 - - thumb_func_start sub_80D233C -sub_80D233C: @ 80D233C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r7, 0 - movs r0, 0 - ldr r1, =0x03005d94 - mov r9, r1 -_080D234C: - lsls r1, r0, 2 - adds r2, r0, 0x1 - mov r8, r2 - adds r1, r0 - movs r5, 0 - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 5 - adds r4, r0, 0x4 - movs r6, 0x1D -_080D2360: - mov r1, r9 - ldr r0, [r1] - adds r0, r4 - adds r0, r5 - movs r1, 0x5 - bl pokemon_getattr_encrypted - cmp r0, 0 - bne _080D2384 - mov r2, r9 - ldr r0, [r2] - adds r0, r4 - adds r0, r5 - movs r1, 0x6 - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _080D2386 -_080D2384: - adds r7, 0x1 -_080D2386: - adds r5, 0x50 - subs r6, 0x1 - cmp r6, 0 - bge _080D2360 - mov r0, r8 - cmp r0, 0xD - ble _080D234C - adds r0, r7, 0 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D233C - - thumb_func_start sub_80D23A8 -sub_80D23A8: @ 80D23A8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - mov r1, sp - strh r0, [r1] - ldr r0, =0x00000163 - strh r0, [r1, 0x2] - movs r0, 0 - mov r8, r0 - ldr r7, =0x03005d94 - movs r5, 0x4 -_080D23C0: - movs r6, 0 - movs r4, 0 -_080D23C4: - ldr r0, [r7] - adds r0, r5 - adds r0, r4 - movs r1, 0x5 - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _080D2404 - ldr r0, [r7] - adds r0, r5 - adds r0, r4 - movs r1, 0x6 - bl pokemon_getattr_encrypted - cmp r0, 0 - bne _080D2404 - ldr r0, [r7] - adds r0, r5 - adds r0, r4 - movs r1, 0x51 - mov r2, sp - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _080D2404 - movs r0, 0x1 - b _080D241E - .pool -_080D2404: - adds r4, 0x50 - adds r6, 0x1 - cmp r6, 0x1D - ble _080D23C4 - movs r0, 0x96 - lsls r0, 4 - adds r5, r0 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0xD - ble _080D23C0 - movs r0, 0 -_080D241E: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80D23A8 - - thumb_func_start sub_80D242C -sub_80D242C: @ 80D242C - ldr r2, =0x03005d8c - ldr r0, [r2] - ldr r1, =0x00003d84 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - ldr r3, =0x00003d85 - adds r0, r3 - strb r1, [r0] - ldr r0, [r2] - adds r3, 0x1 - adds r0, r3 - strb r1, [r0] - ldr r1, [r2] - ldr r0, =0x00003d70 - adds r2, r1, r0 - ldr r0, =0x00007b35 - strh r0, [r2] - subs r3, 0x14 - adds r2, r1, r3 - ldr r0, =0x00006186 - strh r0, [r2] - ldr r0, =0x00003d74 - adds r1, r0 - movs r0, 0xFF - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_80D242C - - thumb_func_start sub_80D2480 -sub_80D2480: @ 80D2480 - ldr r1, =0x03005d8c - ldr r1, [r1] - ldr r2, =0x00003d86 - adds r1, r2 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_80D2480 - - thumb_func_start sub_80D2494 -sub_80D2494: @ 80D2494 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003d86 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80D2494 - - thumb_func_start sub_80D24A8 -sub_80D24A8: @ 80D24A8 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003d85 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80D24A8 - - thumb_func_start sub_80D24BC -sub_80D24BC: @ 80D24BC - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bhi _080D24D0 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00003d85 - adds r0, r2 - strb r1, [r0] -_080D24D0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D24BC - - thumb_func_start sub_80D24DC -sub_80D24DC: @ 80D24DC - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003d84 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80D24DC - - thumb_func_start sub_80D24F0 -sub_80D24F0: @ 80D24F0 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1D - bhi _080D2504 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00003d84 - adds r0, r2 - strb r1, [r0] -_080D2504: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D24F0 - - thumb_func_start sub_80D2510 -sub_80D2510: @ 80D2510 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003d70 - adds r0, r1 - bx lr - .pool - thumb_func_end sub_80D2510 - - thumb_func_start sub_80D2524 -sub_80D2524: @ 80D2524 - push {r4,lr} - ldr r2, =0x03005d8c - ldr r2, [r2] - ldr r4, =0x00003d70 - adds r3, r2, r4 - strh r0, [r3] - ldr r0, =0x00003d72 - adds r2, r0 - strh r1, [r2] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D2524 - - thumb_func_start sub_80D2548 -sub_80D2548: @ 80D2548 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003d74 - adds r0, r1 - bx lr - .pool - thumb_func_end sub_80D2548 - - thumb_func_start sub_80D255C -sub_80D255C: @ 80D255C - push {lr} - adds r1, r0, 0 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00003d74 - adds r0, r2 - bl CopyString - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D255C - - thumb_func_start sub_80D2578 -sub_80D2578: @ 80D2578 - push {lr} - movs r1, 0 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00003d74 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0xFF - bne _080D258C - movs r1, 0x1 -_080D258C: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D2578 - - thumb_func_start sub_80D259C -sub_80D259C: @ 80D259C - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r6, =0x02039d84 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 4 - bl Alloc - str r0, [r6] - ldr r5, =0x02039d88 - movs r1, 0 - cmp r0, 0 - beq _080D25BA - adds r1, r4, 0 -_080D25BA: - strh r1, [r5] - movs r2, 0 - cmp r2, r1 - bcs _080D25E2 - movs r3, 0 - adds r4, r5, 0 -_080D25C6: - ldr r0, [r6] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 4 - adds r1, r0 - str r3, [r1, 0x18] - adds r1, 0x2C - strb r3, [r1] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - ldrh r0, [r4] - cmp r2, r0 - bcc _080D25C6 -_080D25E2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D259C - - thumb_func_start sub_80D25F0 -sub_80D25F0: @ 80D25F0 - push {lr} - ldr r0, =0x02039d84 - ldr r0, [r0] - bl Free - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D25F0 - - thumb_func_start sub_80D2604 -sub_80D2604: @ 80D2604 - push {r4,r5,lr} - movs r4, 0 - ldr r0, =0x02039d88 - ldrh r0, [r0] - cmp r4, r0 - bge _080D2634 - movs r5, 0 -_080D2612: - ldr r0, =0x02039d84 - ldr r0, [r0] - adds r0, r5, r0 - adds r0, 0x2C - ldrb r0, [r0] - cmp r0, 0x1 - bne _080D2628 - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_80D2918 -_080D2628: - adds r5, 0x30 - adds r4, 0x1 - ldr r0, =0x02039d88 - ldrh r0, [r0] - cmp r4, r0 - blt _080D2612 -_080D2634: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D2604 - - thumb_func_start sub_80D2644 -sub_80D2644: @ 80D2644 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r4, r2, 0 - ldr r2, [sp, 0x24] - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r3, 16 - lsrs r3, 16 - mov r10, r3 - lsls r2, 16 - lsrs r2, 16 - str r2, [sp] - ldr r0, =0x02039d88 - ldrh r0, [r0] - cmp r6, r0 - bcs _080D272C - ldr r0, =0x02039d84 - mov r9, r0 - ldr r0, [r0] - lsls r1, r6, 1 - mov r8, r1 - adds r5, r1, r6 - lsls r5, 4 - adds r0, r5, r0 - movs r1, 0 - str r1, [r0, 0x18] - str r4, [r0, 0x1C] - adds r0, 0x2B - strb r7, [r0] - mov r2, r9 - ldr r0, [r2] - adds r0, r5, r0 - mov r3, r10 - strh r3, [r0, 0x24] - mov r1, sp - ldrh r1, [r1] - strh r1, [r0, 0x26] - adds r0, r7, 0 - movs r1, 0x3 - bl GetBgAttribute - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r7, 0 - movs r1, 0x9 - bl GetBgAttribute - lsls r0, 16 - lsrs r0, 16 - mov r2, r9 - ldr r1, [r2] - adds r5, r1 - ldr r2, =gUnknown_0857BC88 - lsls r4, 2 - lsls r1, r0, 4 - adds r4, r1 - adds r4, r2 - ldrh r1, [r4] - strh r1, [r5, 0x20] - ldrh r1, [r4, 0x2] - strh r1, [r5, 0x22] - mov r2, r8 - cmp r0, 0 - beq _080D26E8 - adds r1, r5, 0 - adds r1, 0x2A - movs r0, 0x1 - b _080D26EE - .pool -_080D26E8: - adds r1, r5, 0 - adds r1, 0x2A - movs r0, 0x2 -_080D26EE: - strb r0, [r1] - ldr r4, =0x02039d84 - ldr r1, [r4] - adds r2, r6 - lsls r2, 4 - adds r1, r2, r1 - adds r0, r1, 0 - adds r0, 0x2A - ldrb r0, [r0] - mov r3, r10 - muls r3, r0 - movs r0, 0 - strh r3, [r1, 0x28] - mov r3, r10 - strh r3, [r1, 0x10] - mov r5, sp - ldrh r5, [r5] - strh r5, [r1, 0x12] - strh r0, [r1, 0xC] - strh r0, [r1, 0xE] - strh r0, [r1, 0x14] - strh r0, [r1, 0x16] - adds r0, r1, 0 - adds r0, 0xC - ldm r0!, {r3,r5,r6} - stm r1!, {r3,r5,r6} - ldr r0, [r4] - adds r2, r0 - adds r2, 0x2C - movs r0, 0x1 - strb r0, [r2] -_080D272C: - 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_80D2644 - - thumb_func_start sub_80D2740 -sub_80D2740: @ 80D2740 - push {lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02039d88 - ldrh r0, [r0] - cmp r2, r0 - bcs _080D2764 - ldr r0, =0x02039d84 - ldr r1, [r0] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 4 - adds r0, r1 - str r3, [r0, 0x18] - adds r0, 0x2C - movs r1, 0x1 - strb r1, [r0] -_080D2764: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D2740 - - thumb_func_start sub_80D2770 -sub_80D2770: @ 80D2770 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 16 - lsrs r2, 16 - ldr r0, =0x02039d88 - ldrh r0, [r0] - cmp r3, r0 - bcs _080D279C - ldr r0, =0x02039d84 - ldr r1, [r0] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 4 - adds r0, r1 - strh r4, [r0, 0x14] - strh r2, [r0, 0x16] - adds r0, 0x2C - movs r1, 0x1 - strb r1, [r0] -_080D279C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D2770 - - thumb_func_start sub_80D27AC -sub_80D27AC: @ 80D27AC - push {r4-r6,lr} - ldr r4, [sp, 0x10] - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 16 - lsrs r6, r1, 16 - lsls r2, 16 - lsrs r2, 16 - lsls r3, 16 - lsrs r3, 16 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =0x02039d88 - ldrh r0, [r0] - cmp r5, r0 - bcs _080D27E6 - ldr r0, =0x02039d84 - ldr r1, [r0] - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 4 - adds r0, r1 - strh r6, [r0, 0xC] - strh r2, [r0, 0xE] - strh r3, [r0, 0x10] - strh r4, [r0, 0x12] - adds r0, 0x2C - movs r1, 0x1 - strb r1, [r0] -_080D27E6: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D27AC - - thumb_func_start sub_80D27F4 -sub_80D27F4: @ 80D27F4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r0, =0x02039d88 - ldrh r0, [r0] - cmp r5, r0 - bcc _080D280C - b _080D290E -_080D280C: - ldr r4, =0x02039d84 - lsls r2, r5, 1 - cmp r1, 0x5 - bls _080D2816 - b _080D2900 -_080D2816: - lsls r0, r1, 2 - ldr r1, =_080D282C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080D282C: - .4byte _080D2844 - .4byte _080D2864 - .4byte _080D2888 - .4byte _080D28A8 - .4byte _080D28CC - .4byte _080D28E8 -_080D2844: - ldr r4, =0x02039d84 - ldr r0, [r4] - lsls r3, r5, 1 - adds r1, r3, r5 - lsls r1, 4 - adds r1, r0 - lsls r2, r6, 24 - asrs r2, 24 - ldrh r0, [r1, 0x14] - adds r0, r2 - strh r0, [r1, 0x14] - ldrh r0, [r1, 0x10] - subs r0, r2 - b _080D287E - .pool -_080D2864: - ldr r4, =0x02039d84 - ldr r0, [r4] - lsls r3, r5, 1 - adds r1, r3, r5 - lsls r1, 4 - adds r1, r0 - lsls r2, r6, 24 - asrs r2, 24 - ldrh r0, [r1, 0xC] - adds r0, r2 - strh r0, [r1, 0xC] - ldrh r0, [r1, 0x10] - adds r0, r2 -_080D287E: - strh r0, [r1, 0x10] - adds r2, r3, 0 - b _080D2900 - .pool -_080D2888: - ldr r4, =0x02039d84 - ldr r0, [r4] - lsls r3, r5, 1 - adds r1, r3, r5 - lsls r1, 4 - adds r1, r0 - lsls r2, r6, 24 - asrs r2, 24 - ldrh r0, [r1, 0x16] - adds r0, r2 - strh r0, [r1, 0x16] - ldrh r0, [r1, 0x12] - subs r0, r2 - b _080D28C2 - .pool -_080D28A8: - ldr r4, =0x02039d84 - ldr r0, [r4] - lsls r3, r5, 1 - adds r1, r3, r5 - lsls r1, 4 - adds r1, r0 - lsls r2, r6, 24 - asrs r2, 24 - ldrh r0, [r1, 0xE] - subs r0, r2 - strh r0, [r1, 0xE] - ldrh r0, [r1, 0x12] - adds r0, r2 -_080D28C2: - strh r0, [r1, 0x12] - adds r2, r3, 0 - b _080D2900 - .pool -_080D28CC: - ldr r3, =0x02039d84 - ldr r0, [r3] - lsls r2, r5, 1 - adds r1, r2, r5 - lsls r1, 4 - adds r1, r0 - lsls r0, r6, 24 - asrs r0, 24 - ldrh r4, [r1, 0x14] - adds r0, r4 - strh r0, [r1, 0x14] - b _080D28FE - .pool -_080D28E8: - ldr r3, =0x02039d84 - ldr r0, [r3] - lsls r2, r5, 1 - adds r1, r2, r5 - lsls r1, 4 - adds r1, r0 - lsls r0, r6, 24 - asrs r0, 24 - ldrh r4, [r1, 0x16] - adds r0, r4 - strh r0, [r1, 0x16] -_080D28FE: - adds r4, r3, 0 -_080D2900: - ldr r0, [r4] - adds r1, r2, r5 - lsls r1, 4 - adds r1, r0 - adds r1, 0x2C - movs r0, 0x1 - strb r0, [r1] -_080D290E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D27F4 - - thumb_func_start sub_80D2918 -sub_80D2918: @ 80D2918 - push {r4-r6,lr} - lsls r0, 24 - lsrs r2, r0, 24 - adds r6, r2, 0 - ldr r0, =0x02039d88 - ldrh r0, [r0] - cmp r2, r0 - bcs _080D2952 - ldr r5, =0x02039d84 - ldr r0, [r5] - lsls r1, r2, 1 - adds r1, r2 - lsls r4, r1, 4 - adds r0, r4, r0 - ldr r0, [r0, 0x18] - cmp r0, 0 - beq _080D2940 - adds r0, r2, 0 - bl sub_80D2960 -_080D2940: - adds r0, r6, 0 - bl sub_80D29F8 - ldr r1, [r5] - adds r1, r4, r1 - adds r0, r1, 0 - adds r0, 0xC - ldm r0!, {r2-r4} - stm r1!, {r2-r4} -_080D2952: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D2918 - - thumb_func_start sub_80D2960 -sub_80D2960: @ 80D2960 - 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 - ldr r4, =0x02039d84 - ldr r1, [r4] - lsls r5, r0, 1 - adds r0, r5, r0 - lsls r0, 4 - adds r0, r1 - adds r1, r0, 0 - adds r1, 0x2A - ldrb r3, [r1] - ldrh r1, [r0, 0x20] - adds r2, r3, 0 - muls r2, r1 - mov r9, r2 - movs r6, 0xA - ldrsh r1, [r0, r6] - mov r2, r9 - muls r2, r1 - ldr r1, [r0, 0x18] - adds r1, r2 - movs r6, 0x8 - ldrsh r2, [r0, r6] - muls r2, r3 - adds r7, r1, r2 - movs r6, 0 - ldrh r0, [r0, 0x6] - cmp r6, r0 - bge _080D29E4 - mov r10, r4 -_080D29AA: - mov r0, r10 - ldr r1, [r0] - mov r2, r8 - adds r4, r5, r2 - lsls r4, 4 - adds r1, r4, r1 - adds r0, r1, 0 - adds r0, 0x2B - ldrb r0, [r0] - ldrb r2, [r1, 0x8] - ldrb r3, [r1, 0xA] - adds r3, r6 - lsls r3, 24 - lsrs r3, 24 - ldrb r1, [r1, 0x4] - str r1, [sp] - movs r1, 0x1 - str r1, [sp, 0x4] - adds r1, r7, 0 - bl CopyToBgTilemapBufferRect - add r7, r9 - adds r6, 0x1 - mov r1, r10 - ldr r0, [r1] - adds r4, r0 - ldrh r4, [r4, 0x6] - cmp r6, r4 - blt _080D29AA -_080D29E4: - 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_80D2960 - - thumb_func_start sub_80D29F8 -sub_80D29F8: @ 80D29F8 - 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 - ldr r4, =0x02039d84 - ldr r1, [r4] - lsls r5, r0, 1 - adds r0, r5, r0 - lsls r0, 4 - adds r0, r1 - adds r1, r0, 0 - adds r1, 0x2A - ldrb r3, [r1] - ldrh r1, [r0, 0x24] - adds r2, r3, 0 - muls r2, r1 - mov r9, r2 - movs r6, 0xE - ldrsh r1, [r0, r6] - mov r2, r9 - muls r2, r1 - ldr r1, [r0, 0x1C] - adds r1, r2 - movs r6, 0xC - ldrsh r2, [r0, r6] - muls r2, r3 - adds r7, r1, r2 - movs r6, 0 - ldrh r0, [r0, 0x12] - cmp r6, r0 - bge _080D2A7C - mov r10, r4 -_080D2A42: - mov r0, r10 - ldr r1, [r0] - mov r2, r8 - adds r4, r5, r2 - lsls r4, 4 - adds r1, r4, r1 - adds r0, r1, 0 - adds r0, 0x2B - ldrb r0, [r0] - ldrb r2, [r1, 0x14] - ldrb r3, [r1, 0x16] - adds r3, r6 - lsls r3, 24 - lsrs r3, 24 - ldrb r1, [r1, 0x10] - str r1, [sp] - movs r1, 0x1 - str r1, [sp, 0x4] - adds r1, r7, 0 - bl CopyToBgTilemapBufferRect - add r7, r9 - adds r6, 0x1 - mov r1, r10 - ldr r0, [r1] - adds r4, r0 - ldrh r4, [r4, 0x12] - cmp r6, r4 - blt _080D2A42 -_080D2A7C: - 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_80D29F8 - - thumb_func_start sub_80D2A90 -sub_80D2A90: @ 80D2A90 - ldr r3, =0x02039d8c - str r0, [r3] - str r1, [r0] - movs r1, 0 - strb r2, [r0, 0x5] - strb r1, [r0, 0x4] - bx lr - .pool - thumb_func_end sub_80D2A90 - - thumb_func_start sub_80D2AA4 -sub_80D2AA4: @ 80D2AA4 - push {r4,r5,lr} - ldr r2, =0x02039d8c - ldr r1, [r2] - ldrb r0, [r1, 0x4] - cmp r0, 0 - beq _080D2AE2 - movs r4, 0 - ldrb r1, [r1, 0x4] - cmp r4, r1 - bcs _080D2ADA - adds r5, r2, 0 -_080D2ABA: - ldr r0, [r5] - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 2 - ldr r0, [r0] - adds r0, r1 - ldr r1, [r0, 0x10] - bl _call_via_r1 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, [r5] - ldrb r0, [r0, 0x4] - cmp r4, r0 - bcc _080D2ABA -_080D2ADA: - ldr r0, =0x02039d8c - ldr r1, [r0] - movs r0, 0 - strb r0, [r1, 0x4] -_080D2AE2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D2AA4 - - thumb_func_start sub_80D2AEC -sub_80D2AEC: @ 80D2AEC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r9, r0 - mov r10, r3 - ldr r0, [sp, 0x24] - ldr r3, [sp, 0x28] - ldr r4, [sp, 0x2C] - ldr r5, [sp, 0x30] - ldr r6, [sp, 0x34] - lsls r1, 16 - lsrs r1, 16 - mov r12, r1 - lsls r2, 16 - lsrs r2, 16 - str r2, [sp] - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r3, 16 - lsrs r3, 16 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 16 - lsrs r6, 16 - ldr r0, =0x02039d8c - ldr r2, [r0] - ldrb r0, [r2, 0x4] - adds r1, r0, 0 - ldrb r7, [r2, 0x5] - cmp r1, r7 - bcs _080D2B74 - adds r0, 0x1 - strb r0, [r2, 0x4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - ldr r1, [r2] - adds r1, r0 - lsls r0, r4, 1 - strh r0, [r1, 0x8] - ldr r2, [sp] - lsls r0, r2, 5 - add r0, r12 - lsls r0, 1 - add r0, r9 - str r0, [r1, 0x4] - adds r0, r3, 0 - muls r0, r6 - add r0, r8 - lsls r0, 1 - add r0, r10 - str r0, [r1] - strh r5, [r1, 0xC] - strh r6, [r1, 0xA] - ldr r0, =sub_80D2B88 - str r0, [r1, 0x10] - movs r0, 0x1 - b _080D2B76 - .pool -_080D2B74: - movs r0, 0 -_080D2B76: - 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_80D2AEC - - thumb_func_start sub_80D2B88 -sub_80D2B88: @ 80D2B88 - push {r4,r5,lr} - adds r4, r0, 0 - movs r5, 0 - b _080D2BB2 -_080D2B90: - ldr r0, [r4] - ldr r1, [r4, 0x4] - ldrh r2, [r4, 0x8] - lsrs r2, 1 - bl CpuSet - ldr r0, [r4, 0x4] - adds r0, 0x40 - str r0, [r4, 0x4] - ldrh r1, [r4, 0xA] - lsls r1, 1 - ldr r0, [r4] - adds r0, r1 - str r0, [r4] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_080D2BB2: - ldrh r0, [r4, 0xC] - cmp r5, r0 - bcc _080D2B90 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80D2B88 - - thumb_func_start sub_80D2BC0 -sub_80D2BC0: @ 80D2BC0 - push {r4-r7,lr} - mov r12, r0 - ldr r0, [sp, 0x14] - lsls r1, 16 - lsrs r6, r1, 16 - lsls r2, 16 - lsrs r4, r2, 16 - lsls r3, 16 - lsrs r3, 16 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x02039d8c - ldr r2, [r0] - ldrb r0, [r2, 0x4] - adds r1, r0, 0 - ldrb r7, [r2, 0x5] - cmp r1, r7 - bcs _080D2C14 - adds r0, 0x1 - strb r0, [r2, 0x4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - ldr r1, [r2] - adds r1, r0 - lsls r0, r3, 1 - strh r0, [r1, 0x8] - lsls r0, r4, 5 - adds r0, r6 - lsls r0, 1 - add r0, r12 - str r0, [r1, 0x4] - strh r5, [r1, 0xC] - ldr r0, =sub_80D2C1C - str r0, [r1, 0x10] - movs r0, 0x1 - b _080D2C16 - .pool -_080D2C14: - movs r0, 0 -_080D2C16: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80D2BC0 - - thumb_func_start sub_80D2C1C -sub_80D2C1C: @ 80D2C1C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r6, r0, 0 - movs r0, 0 - ldrh r1, [r6, 0xC] - cmp r0, r1 - bcs _080D2CAA - movs r7, 0x80 - lsls r7, 5 - mov r5, sp - ldr r2, =0x040000d4 - mov r8, r2 - movs r1, 0x81 - lsls r1, 24 - mov r10, r1 -_080D2C42: - ldr r2, [r6, 0x4] - ldrh r3, [r6, 0x8] - mov r12, r2 - adds r0, 0x1 - mov r9, r0 - cmp r3, r7 - bhi _080D2C6C - movs r0, 0 - strh r0, [r5] - mov r2, sp - mov r0, r8 - str r2, [r0] - mov r1, r12 - str r1, [r0, 0x4] - lsrs r0, r3, 1 - mov r2, r10 - orrs r0, r2 - mov r1, r8 - b _080D2C94 - .pool -_080D2C6C: - movs r4, 0 - strh r4, [r5] - ldr r1, =0x040000d4 - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - ldr r0, =0x81000800 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r2, r7 - subs r3, r7 - cmp r3, r7 - bhi _080D2C6C - strh r4, [r5] - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - lsrs r0, r3, 1 - mov r2, r10 - orrs r0, r2 -_080D2C94: - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - mov r0, r12 - adds r0, 0x40 - str r0, [r6, 0x4] - mov r1, r9 - lsls r0, r1, 16 - lsrs r0, 16 - ldrh r2, [r6, 0xC] - cmp r0, r2 - bcc _080D2C42 -_080D2CAA: - 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_80D2C1C - - thumb_func_start sub_80D2CC4 -@ int sub_80D2CC4(u16 speciesId, int a2, u16 a3, u16 a4, u8 a5, u32 personality, int a7) -sub_80D2CC4: @ 80D2CC4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x30 - adds r4, r0, 0 - adds r6, r1, 0 - ldr r0, [sp, 0x4C] - ldr r1, [sp, 0x50] - ldr r5, [sp, 0x54] - lsls r4, 16 - lsrs r4, 16 - lsls r2, 16 - lsrs r2, 16 - mov r8, r2 - lsls r3, 16 - lsrs r7, r3, 16 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r0, =gUnknown_0857C570 - str r0, [sp, 0x18] - adds r0, r4, 0 - adds r2, r5, 0 - bl sub_80D2EDC - str r0, [sp, 0x1C] - ldr r0, =gUnknown_0857C5B4 - str r0, [sp, 0x20] - ldr r0, =gUnknown_0857C5E8 - str r0, [sp, 0x24] - str r6, [sp, 0x28] - ldr r0, =gMonIconPaletteIndices - adds r0, r4, r0 - ldr r1, =0x0000dac0 - adds r5, r1, 0 - ldrb r0, [r0] - adds r1, r5, r0 - add r0, sp, 0x2C - strh r1, [r0] - add r1, sp, 0x18 - mov r0, sp - movs r2, 0x18 - bl memcpy - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - bls _080D2D2A - mov r0, sp - strh r5, [r0, 0x14] -_080D2D2A: - mov r0, r8 - lsls r1, r0, 16 - asrs r1, 16 - lsls r2, r7, 16 - asrs r2, 16 - mov r0, sp - mov r3, r9 - bl sub_80D31B4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl sub_80D30DC - adds r0, r4, 0 - add sp, 0x30 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D2CC4 - - thumb_func_start sub_80D2D78 -sub_80D2D78: @ 80D2D78 - push {r4-r7,lr} - sub sp, 0x18 - adds r4, r2, 0 - adds r5, r3, 0 - ldr r6, [sp, 0x2C] - lsls r0, 16 - lsrs r0, 16 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 24 - lsrs r6, 24 - mov r3, sp - ldr r2, =gUnknown_0857C570 - str r2, [sp] - movs r2, 0 - str r2, [sp, 0x4] - ldr r2, =gUnknown_0857C5B4 - str r2, [sp, 0x8] - ldr r2, =gUnknown_0857C5E8 - str r2, [sp, 0xC] - str r1, [sp, 0x10] - ldr r2, =gMonIconPaletteIndices - adds r2, r0, r2 - ldr r7, =0x0000dac0 - adds r1, r7, 0 - ldrb r2, [r2] - adds r1, r2 - strh r1, [r3, 0x14] - ldr r1, [sp, 0x30] - bl GetMonIconTiles - str r0, [sp, 0x4] - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - mov r0, sp - adds r1, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl sub_80D31B4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl sub_80D30DC - adds r0, r4, 0 - add sp, 0x18 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D2D78 - - thumb_func_start mon_icon_convert_unown_species_id -@ u16 mon_icon_convert_unown_species_id(u16 speciesId, u32 personality) -mon_icon_convert_unown_species_id: @ 80D2E08 - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0xC9 - bne _080D2E32 - adds r0, r1, 0 - bl mon_icon_personality_to_unown_id - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _080D2E24 - movs r0, 0xC9 - b _080D2E2E -_080D2E24: - movs r1, 0xCE - lsls r1, 1 - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 -_080D2E2E: - adds r1, r0, 0 - b _080D2E40 -_080D2E32: - movs r0, 0xCE - lsls r0, 1 - adds r1, r2, 0 - cmp r1, r0 - bls _080D2E40 - movs r1, 0x82 - lsls r1, 1 -_080D2E40: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end mon_icon_convert_unown_species_id - - thumb_func_start mon_icon_personality_to_unown_id -mon_icon_personality_to_unown_id: @ 80D2E48 - push {lr} - adds r2, r0, 0 - cmp r2, 0 - beq _080D2E7E - movs r0, 0xC0 - lsls r0, 18 - ands r0, r2 - lsrs r0, 18 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r2 - lsrs r1, 12 - orrs r0, r1 - movs r1, 0xC0 - lsls r1, 2 - ands r1, r2 - lsrs r1, 6 - orrs r0, r1 - movs r1, 0x3 - ands r1, r2 - orrs r0, r1 - movs r1, 0x1C - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - b _080D2E80 -_080D2E7E: - movs r0, 0 -_080D2E80: - pop {r1} - bx r1 - thumb_func_end mon_icon_personality_to_unown_id - - thumb_func_start sub_80D2E84 -sub_80D2E84: @ 80D2E84 - push {r4,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - mov r1, sp - bl sub_80D45E8 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xC9 - bne _080D2EBA - mov r0, sp - ldrh r0, [r0] - cmp r0, 0 - bne _080D2EAA - mov r1, sp - adds r0, 0xC9 - b _080D2EB2 -_080D2EAA: - mov r1, sp - movs r2, 0xCE - lsls r2, 1 - adds r0, r2 -_080D2EB2: - strh r0, [r1] - mov r0, sp - ldrh r0, [r0] - b _080D2ED2 -_080D2EBA: - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - bls _080D2EC6 - movs r4, 0x82 - lsls r4, 1 -_080D2EC6: - adds r0, r4, 0 - movs r1, 0 - bl mon_icon_convert_unown_species_id - lsls r0, 16 - lsrs r0, 16 -_080D2ED2: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80D2E84 - - thumb_func_start sub_80D2EDC -@ void *sub_80D2EDC(u16 speciesId, u32 personality, bool32) -sub_80D2EDC: @ 80D2EDC - push {r4,lr} - adds r4, r2, 0 - lsls r0, 16 - lsrs r0, 16 - bl mon_icon_convert_unown_species_id - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl GetMonIconTiles - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80D2EDC - - thumb_func_start sub_80D2EF8 -sub_80D2EF8: @ 80D2EF8 - push {lr} - bl sub_80D328C - pop {r0} - bx r0 - thumb_func_end sub_80D2EF8 - - thumb_func_start sub_80D2F04 -sub_80D2F04: @ 80D2F04 - push {r4,r5,lr} - movs r4, 0 - ldr r5, =gMonIconPaletteTable -_080D2F0A: - lsls r0, r4, 3 - adds r0, r5 - bl LoadTaggedObjectPalette - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _080D2F0A - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D2F04 - - thumb_func_start sub_80D2F28 -sub_80D2F28: @ 80D2F28 - push {r4,lr} - lsls r0, 16 - lsrs r1, r0, 16 - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - bls _080D2F3A - movs r1, 0x82 - lsls r1, 1 -_080D2F3A: - ldr r0, =gMonIconPaletteIndices - adds r0, r1, r0 - ldrb r0, [r0] - ldr r1, =gMonIconPaletteTable - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x4] - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _080D2F5A - adds r0, r4, 0 - bl LoadTaggedObjectPalette -_080D2F5A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D2F28 - - thumb_func_start sub_80D2F68 -sub_80D2F68: @ 80D2F68 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gMonIconPaletteIndices - adds r0, r1 - ldrb r0, [r0] - ldr r1, =gMonIconPaletteTable - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x4] - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _080D2F8E - adds r0, r4, 0 - bl LoadTaggedObjectPalette -_080D2F8E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D2F68 - - thumb_func_start sub_80D2F9C -sub_80D2F9C: @ 80D2F9C - push {r4,r5,lr} - movs r4, 0 - ldr r5, =gMonIconPaletteTable -_080D2FA2: - lsls r0, r4, 3 - adds r0, r5 - ldrh r0, [r0, 0x4] - bl FreeObjectPaletteByTag - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _080D2FA2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D2F9C - - thumb_func_start sub_80D2FC0 -sub_80D2FC0: @ 80D2FC0 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - bls _080D2FD2 - movs r1, 0x82 - lsls r1, 1 -_080D2FD2: - ldr r0, =gMonIconPaletteIndices - adds r0, r1, r0 - ldrb r0, [r0] - ldr r1, =gMonIconPaletteTable - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x4] - bl FreeObjectPaletteByTag - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D2FC0 - - thumb_func_start sub_80D2FF0 -sub_80D2FF0: @ 80D2FF0 - push {lr} - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gMonIconPaletteIndices - adds r0, r1 - ldrb r0, [r0] - ldr r1, =gMonIconPaletteTable - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x4] - bl FreeObjectPaletteByTag - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D2FF0 - - thumb_func_start sub_80D3014 -sub_80D3014: @ 80D3014 - push {lr} - bl sub_80D30DC - pop {r0} - bx r0 - thumb_func_end sub_80D3014 - - thumb_func_start GetMonIconTiles -@ void *GetMonIconTiles(u16 speciesId, bool32) -GetMonIconTiles: @ 80D3020 - push {lr} - adds r3, r1, 0 - lsls r0, 16 - lsrs r0, 16 - ldr r2, =gMonIconTable - lsls r1, r0, 2 - adds r1, r2 - ldr r2, [r1] - movs r1, 0xCD - lsls r1, 1 - cmp r0, r1 - bne _080D3042 - cmp r3, 0x1 - bne _080D3042 - movs r0, 0x80 - lsls r0, 3 - adds r2, r0 -_080D3042: - adds r0, r2, 0 - pop {r1} - bx r1 - .pool - thumb_func_end GetMonIconTiles - - thumb_func_start sub_80D304C -sub_80D304C: @ 80D304C - push {r4-r6,lr} - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0xA0 - bhi _080D3074 - ldr r6, =gMonIconPaletteTable - movs r5, 0x5 -_080D305A: - ldr r0, [r6] - adds r1, r4, 0 - movs r2, 0x20 - bl gpu_pal_apply - adds r0, r4, 0 - adds r0, 0x10 - lsls r0, 16 - lsrs r4, r0, 16 - adds r6, 0x8 - subs r5, 0x1 - cmp r5, 0 - bge _080D305A -_080D3074: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D304C - - thumb_func_start sub_80D3080 -sub_80D3080: @ 80D3080 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - bls _080D3092 - movs r1, 0x82 - lsls r1, 1 -_080D3092: - ldr r0, =gMonIconPaletteIndices - adds r0, r1, r0 - ldrb r0, [r0] - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D3080 - - thumb_func_start sub_80D30A0 -sub_80D30A0: @ 80D30A0 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gMonIconPaletteIndices - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80D30A0 - - thumb_func_start sub_80D30B0 -sub_80D30B0: @ 80D30B0 - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - movs r0, 0xCE - lsls r0, 1 - cmp r2, r0 - bls _080D30C2 - movs r2, 0x82 - lsls r2, 1 -_080D30C2: - ldr r1, =gMonIconPaletteTable - ldr r0, =gMonIconPaletteIndices - adds r0, r2, r0 - ldrb r0, [r0] - lsls r0, 3 - adds r0, r1 - ldr r0, [r0] - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D30B0 - - thumb_func_start sub_80D30DC -sub_80D30DC: @ 80D30DC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r4, r0, 0 - movs r7, 0 - adds r6, r4, 0 - adds r6, 0x2C - ldrb r2, [r6] - movs r0, 0x3F - mov r9, r0 - ands r0, r2 - cmp r0, 0 - bne _080D3190 - movs r1, 0x2A - adds r1, r4 - mov r8, r1 - ldrb r1, [r1] - ldr r0, [r4, 0x8] - lsls r1, 2 - adds r1, r0 - adds r5, r4, 0 - adds r5, 0x2B - ldrb r0, [r5] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - movs r1, 0 - ldrsh r3, [r0, r1] - movs r0, 0x2 - negs r0, r0 - cmp r3, r0 - beq _080D3126 - adds r0, 0x1 - cmp r3, r0 - bne _080D312A - b _080D31A4 -_080D3126: - strb r7, [r5] - b _080D31A4 -_080D312A: - ldr r2, =gUnknown_0857C5F0 - ldrb r1, [r4, 0x3] - lsrs r1, 6 - lsls r1, 1 - ldrb r0, [r4, 0x1] - lsrs r0, 6 - lsls r0, 3 - adds r1, r0 - adds r1, r2 - ldrh r2, [r1] - adds r1, r2, 0 - muls r1, r3 - ldr r0, [r4, 0xC] - adds r0, r1 - ldrh r1, [r4, 0x4] - lsls r1, 22 - lsrs r1, 17 - ldr r3, =0x06010000 - adds r1, r3 - bl AddTilesToObjectCopyRequests - mov r0, r8 - ldrb r1, [r0] - ldr r0, [r4, 0x8] - lsls r1, 2 - adds r1, r0 - ldrb r0, [r5] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - lsls r0, 10 - lsrs r0, 26 - mov r1, r9 - ands r1, r0 - ldrb r2, [r6] - movs r0, 0x40 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r6] - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - ldrb r7, [r5] - b _080D31A4 - .pool -_080D3190: - lsls r0, r2, 26 - lsrs r0, 26 - subs r0, 0x1 - movs r1, 0x3F - ands r0, r1 - movs r1, 0x40 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r6] -_080D31A4: - adds r0, r7, 0 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80D30DC - - thumb_func_start sub_80D31B4 -sub_80D31B4: @ 80D31B4 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x38 - mov r9, r0 - adds r4, r1, 0 - adds r5, r2, 0 - mov r8, r3 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r0, 0 - str r0, [sp, 0x30] - ldr r2, =gUnknown_0857C5F0 - mov r0, r9 - ldr r6, [r0] - ldrb r1, [r6, 0x3] - lsrs r1, 6 - lsls r1, 1 - ldrb r0, [r6, 0x1] - lsrs r0, 6 - lsls r0, 3 - adds r1, r0 - adds r1, r2 - ldrh r2, [r1] - ldr r1, =0xffff0000 - add r3, sp, 0x30 - ldr r0, [r3, 0x4] - ands r0, r1 - orrs r0, r2 - str r0, [r3, 0x4] - add r1, sp, 0x18 - ldr r0, =0x0000ffff - strh r0, [r1] - mov r0, r9 - ldrh r2, [r0, 0x14] - mov r0, sp - adds r0, 0x1A - strh r2, [r0] - str r6, [sp, 0x1C] - mov r2, r9 - ldr r0, [r2, 0x8] - str r0, [sp, 0x20] - str r3, [sp, 0x24] - ldr r0, [r2, 0xC] - str r0, [sp, 0x28] - ldr r0, [r2, 0x10] - str r0, [sp, 0x2C] - mov r0, sp - movs r2, 0x18 - bl memcpy - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - mov r0, sp - adds r1, r4, 0 - adds r2, r5, 0 - mov r3, r8 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r6, =0x02020630 - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - adds r4, r3, r6 - adds r5, r4, 0 - adds r5, 0x2C - ldrb r1, [r5] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r5] - adds r4, 0x3F - ldrb r2, [r4] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r4] - adds r6, 0xC - adds r3, r6 - mov r2, r9 - ldr r1, [r2, 0x4] - str r1, [r3] - add sp, 0x38 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D31B4 - - thumb_func_start sub_80D328C -sub_80D328C: @ 80D328C - push {lr} - sub sp, 0x8 - movs r1, 0 - str r1, [sp] - ldr r3, =gUnknown_0857C5F0 - ldrb r2, [r0, 0x3] - lsrs r2, 6 - lsls r2, 1 - ldrb r1, [r0, 0x1] - lsrs r1, 6 - lsls r1, 3 - adds r2, r1 - adds r2, r3 - ldrh r3, [r2] - ldr r2, =0xffff0000 - ldr r1, [sp, 0x4] - ands r1, r2 - orrs r1, r3 - str r1, [sp, 0x4] - mov r1, sp - str r1, [r0, 0xC] - bl RemoveObjectAndFreeTiles - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D328C - - thumb_func_start sub_80D32C8 -sub_80D32C8: @ 80D32C8 - mov r12, r0 - adds r0, 0x2A - movs r3, 0 - strb r1, [r0] - mov r2, r12 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x40 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - mov r0, r12 - adds r0, 0x2B - strb r3, [r0] - bx lr - thumb_func_end sub_80D32C8 - - thumb_func_start exec_movement -exec_movement: @ 80D32E8 - push {r4,lr} - sub sp, 0x4 - adds r4, r3, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - beq _080D330A - movs r0, 0x1 - b _080D3332 -_080D330A: - ldr r0, =sub_80D3660 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _080D331C - movs r0, 0x32 - bl sub_80D33AC -_080D331C: - bl sub_80D33F4 - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - ldrb r1, [r1] - adds r2, r4, 0 - bl sub_80D3408 - lsls r0, 24 - lsrs r0, 24 -_080D3332: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end exec_movement - - thumb_func_start sub_80D3340 -sub_80D3340: @ 80D3340 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _080D3382 - bl sub_80D33F4 - lsls r0, 24 - lsrs r4, r0, 24 - mov r0, sp - ldrb r1, [r0] - adds r0, r4, 0 - bl sub_80D3474 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x10 - beq _080D3382 - adds r0, r4, 0 - bl sub_80D3584 - lsls r0, 24 - lsrs r0, 24 - b _080D3384 -_080D3382: - movs r0, 0x1 -_080D3384: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80D3340 - - thumb_func_start sub_80D338C -sub_80D338C: @ 80D338C - push {r4,lr} - bl sub_80D33F4 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xFF - beq _080D33A6 - adds r0, r4, 0 - bl sub_80D361C - adds r0, r4, 0 - bl DestroyTask -_080D33A6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80D338C - - thumb_func_start sub_80D33AC -sub_80D33AC: @ 80D33AC - push {r4,r5,lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =sub_80D3660 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x1 - lsls r1, r0, 2 - adds r1, r0 - lsls r3, r1, 3 - ldr r5, =0x03005e08 - ldr r0, =0x0000ffff - adds r4, r0, 0 -_080D33CC: - lsls r0, r2, 1 - adds r0, r3 - adds r0, r5 - ldrh r1, [r0] - orrs r1, r4 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bls _080D33CC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D33AC - - thumb_func_start sub_80D33F4 -sub_80D33F4: @ 80D33F4 - push {lr} - ldr r0, =sub_80D3660 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D33F4 - - thumb_func_start sub_80D3408 -sub_80D3408: @ 80D3408 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r9, r2 - lsls r0, 24 - lsrs r5, r0, 24 - adds r7, r5, 0 - lsls r1, 24 - lsrs r6, r1, 24 - mov r8, r6 - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_80D3474 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x10 - beq _080D3444 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_80D3584 - lsls r0, 24 - cmp r0, 0 - beq _080D3464 - adds r0, r5, 0 - adds r1, r4, 0 - adds r2, r6, 0 - b _080D345A -_080D3444: - adds r0, r7, 0 - movs r1, 0xFF - bl sub_80D3474 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x10 - beq _080D3464 - adds r0, r7, 0 - adds r1, r4, 0 - mov r2, r8 -_080D345A: - mov r3, r9 - bl sub_80D35DC - movs r0, 0 - b _080D3466 -_080D3464: - movs r0, 0x1 -_080D3466: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80D3408 - - thumb_func_start sub_80D3474 -sub_80D3474: @ 80D3474 - 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, =0x03005e08 - adds r1, r0 - adds r1, 0x2 - movs r2, 0 -_080D348C: - ldrb r0, [r1] - cmp r0, r3 - bne _080D349C - adds r0, r2, 0 - b _080D34AA - .pool -_080D349C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - adds r1, 0x1 - cmp r2, 0xF - bls _080D348C - movs r0, 0x10 -_080D34AA: - pop {r1} - bx r1 - thumb_func_end sub_80D3474 - - thumb_func_start sub_80D34B0 -sub_80D34B0: @ 80D34B0 - 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, =0x03005e08 - adds r1, r0 - adds r1, 0x2 - str r1, [r2] - movs r0, 0 - cmp r0, r3 - bcs _080D34DC -_080D34CE: - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - adds r1, 0x1 - cmp r0, r3 - bcc _080D34CE - str r1, [r2] -_080D34DC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D34B0 - - thumb_func_start sub_80D34E4 -sub_80D34E4: @ 80D34E4 - push {r4,lr} - sub sp, 0x4 - adds r4, r2, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r4, 24 - lsrs r4, 24 - mov r2, sp - bl sub_80D34B0 - ldr r0, [sp] - strb r4, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80D34E4 - - thumb_func_start sub_80D3508 -sub_80D3508: @ 80D3508 - push {r4,lr} - sub sp, 0x4 - adds r4, r2, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r2, sp - bl sub_80D34B0 - ldr r0, [sp] - ldrb r0, [r0] - strb r0, [r4] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80D3508 - - thumb_func_start sub_80D352C -sub_80D352C: @ 80D352C - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - ldr r2, =gUnknown_0832A328 - lsrs r1, 22 - adds r1, r2 - ldr r2, [r1] - mvns r2, r2 - lsls r2, 16 - lsrs r2, 16 - ldr r3, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r3 - ldrh r0, [r1, 0x8] - ands r2, r0 - strh r2, [r1, 0x8] - bx lr - .pool - thumb_func_end sub_80D352C - - thumb_func_start sub_80D355C -sub_80D355C: @ 80D355C - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - ldr r3, =0x03005e00 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - adds r2, r3 - ldr r0, =gUnknown_0832A328 - lsrs r1, 22 - adds r1, r0 - ldr r0, [r1] - ldrh r1, [r2, 0x8] - orrs r0, r1 - strh r0, [r2, 0x8] - bx lr - .pool - thumb_func_end sub_80D355C - - thumb_func_start sub_80D3584 -sub_80D3584: @ 80D3584 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - ldr r3, =0x03005e00 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - adds r2, r3 - ldr r0, =gUnknown_0832A328 - lsrs r1, 22 - adds r1, r0 - ldr r0, [r1] - ldrh r1, [r2, 0x8] - ands r0, r1 - cmp r0, 0 - bne _080D35B4 - movs r0, 0 - b _080D35B6 - .pool -_080D35B4: - movs r0, 0x1 -_080D35B6: - pop {r1} - bx r1 - thumb_func_end sub_80D3584 - - thumb_func_start npc_obj_offscreen_culling_and_flag_update -npc_obj_offscreen_culling_and_flag_update: @ 80D35BC - lsls r0, 24 - ldr r2, =0x02039d90 - lsrs r0, 22 - adds r0, r2 - str r1, [r0] - bx lr - .pool - thumb_func_end npc_obj_offscreen_culling_and_flag_update - - thumb_func_start sub_80D35CC -sub_80D35CC: @ 80D35CC - lsls r0, 24 - ldr r1, =0x02039d90 - lsrs r0, 22 - adds r0, r1 - ldr r0, [r0] - bx lr - .pool - thumb_func_end sub_80D35CC - - thumb_func_start sub_80D35DC -sub_80D35DC: @ 80D35DC - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r5, r0, 0 - adds r4, r1, 0 - adds r6, r2, 0 - mov r8, r3 - lsls r5, 24 - lsrs r5, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r6, 24 - lsrs r6, 24 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_80D352C - adds r0, r4, 0 - mov r1, r8 - bl npc_obj_offscreen_culling_and_flag_update - adds r0, r5, 0 - adds r1, r4, 0 - adds r2, r6, 0 - bl sub_80D34E4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80D35DC - - thumb_func_start sub_80D361C -sub_80D361C: @ 80D361C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r1, r0 - adds r4, r1, 0x2 - movs r5, 0 -_080D3630: - ldrb r0, [r4] - cmp r0, 0xFF - beq _080D3646 - adds r1, r0, 0 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - bl npc_sync_anim_pause_bits -_080D3646: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r4, 0x1 - cmp r5, 0xF - bls _080D3630 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D361C - - thumb_func_start sub_80D3660 -sub_80D3660: @ 80D3660 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r7, r0, 24 - movs r5, 0 - mov r6, sp -_080D366C: - adds r0, r7, 0 - adds r1, r5, 0 - mov r2, sp - bl sub_80D3508 - ldrb r0, [r6] - cmp r0, 0xFF - beq _080D3690 - adds r4, r0, 0 - adds r0, r5, 0 - bl sub_80D35CC - adds r3, r0, 0 - adds r0, r7, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_80D36A4 -_080D3690: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0xF - bls _080D366C - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80D3660 - - thumb_func_start sub_80D36A4 -sub_80D36A4: @ 80D36A4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r3, 0 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - mov r8, r6 - lsls r2, 24 - lsrs r2, 24 - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - adds r0, r4, 0 - bl FieldObjectIsSpecialAnimActive - lsls r0, 24 - cmp r0, 0 - beq _080D36DC - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080D370E -_080D36DC: - ldrb r1, [r5] - cmp r1, 0xFE - bne _080D36F8 - adds r0, r7, 0 - adds r1, r6, 0 - bl sub_80D355C - adds r0, r4, 0 - bl sub_8097404 - b _080D370E - .pool -_080D36F8: - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - lsls r0, 24 - cmp r0, 0 - bne _080D370E - adds r5, 0x1 - mov r0, r8 - adds r1, r5, 0 - bl npc_obj_offscreen_culling_and_flag_update -_080D370E: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80D36A4 - - thumb_func_start sub_80D3718 -sub_80D3718: @ 80D3718 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - movs r0, 0x52 - bl npc_before_player_of_type - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080D3754 - ldr r1, =0x03005db0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =0x0203ceec - ldr r0, =sub_80D3A9C - str r0, [r1] - movs r0, 0x1 - b _080D3A2C - .pool -_080D3754: - ldr r0, =0x0203ab40 - adds r1, r0, 0x2 - bl PlayerGetDestCoords - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - bl GetMonAbility - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0xC] - cmp r0, 0x34 - bne _080D3798 - ldr r1, =0x03001100 - movs r0, 0x5 - strb r0, [r1] - ldr r0, =0x03001101 - movs r1, 0x2 - b _080D37A2 - .pool -_080D3798: - ldr r1, =0x03001100 - movs r0, 0x3 - strb r0, [r1] - ldr r0, =0x03001101 - movs r1, 0x1 -_080D37A2: - strb r1, [r0] - ldr r0, =0x03001102 - strb r1, [r0] - movs r6, 0 - movs r1, 0 -_080D37AC: - mov r2, sp - adds r0, r2, r6 - strb r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x8 - bls _080D37AC - movs r6, 0 - ldr r2, =0x03001108 - movs r1, 0 -_080D37C2: - adds r0, r6, r2 - strb r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x18 - bls _080D37C2 - movs r3, 0 - str r3, [sp, 0x10] - movs r6, 0 -_080D37D6: - ldr r4, =0x0000ffff - adds r0, r6, r4 - ldr r1, =0x0203ab40 - ldrh r1, [r1, 0x2] - adds r0, r1 - movs r5, 0 - adds r2, r6, 0x1 - str r2, [sp, 0x18] - lsls r7, r6, 1 - lsls r0, 16 - str r0, [sp, 0x14] - asrs r0, 16 - mov r10, r0 - lsls r0, r6, 2 - adds r0, r6 - mov r9, r0 -_080D37F6: - ldr r3, =0x0000ffff - adds r0, r5, r3 - ldr r4, =0x0203ab40 - ldrh r4, [r4] - adds r0, r4 - lsls r0, 16 - lsrs r1, r0, 16 - mov r8, r1 - asrs r4, r0, 16 - adds r0, r4, 0 - mov r1, r10 - bl MapGridGetZCoordAt - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x0203ab40 - movs r1, 0x4 - ldrsb r1, [r2, r1] - cmp r0, r1 - bne _080D38BC - adds r0, r4, 0 - mov r1, r10 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_8088E64 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080D3846 - adds r0, r4, 0 - bl MetatileBehavior_IsAsh - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080D3856 -_080D3846: - adds r0, r5, 0x6 - add r0, r9 - ldr r3, =0x03001108 - adds r0, r3 - movs r1, 0x1 - strb r1, [r0] - movs r0, 0x1 - str r0, [sp, 0x10] -_080D3856: - mov r1, r8 - lsls r0, r1, 16 - asrs r0, 16 - ldr r2, [sp, 0x14] - asrs r1, r2, 16 - bl MapGridIsImpassableAt - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080D3890 - adds r0, r7, r6 - adds r0, r5 - mov r3, sp - adds r1, r3, r0 - b _080D38C4 - .pool -_080D3890: - adds r0, r7, r6 - adds r0, r5 - mov r2, sp - adds r1, r2, r0 - movs r0, 0x1 - strb r0, [r1] - adds r0, r4, 0 - bl sub_80899F8 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1 - bne _080D38C8 - adds r0, r5, 0x6 - add r0, r9 - ldr r3, =0x03001108 - adds r0, r3 - strb r1, [r0] - b _080D38C8 - .pool -_080D38BC: - adds r0, r7, r6 - adds r0, r5 - mov r4, sp - adds r1, r4, r0 -_080D38C4: - movs r0, 0 - strb r0, [r1] -_080D38C8: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _080D37F6 - ldr r1, [sp, 0x18] - lsls r0, r1, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bhi _080D38DE - b _080D37D6 -_080D38DE: - ldr r2, [sp, 0xC] - cmp r2, 0x34 - beq _080D38EE - ldr r3, [sp, 0x10] - cmp r3, 0x1 - beq _080D38EC - b _080D3A2A -_080D38EC: - b _080D3A1E -_080D38EE: - movs r6, 0 - ldr r4, =0x0203ab40 - mov r9, r4 - ldr r0, =gUnknown_0857C608 - mov r10, r0 -_080D38F8: - lsls r2, r6, 2 - mov r3, r10 - adds r1, r2, r3 - movs r0, 0 - ldrsb r0, [r1, r0] - mov r4, r9 - ldrh r4, [r4] - adds r0, r4 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - movs r0, 0x1 - ldrsb r0, [r1, r0] - mov r1, r9 - ldrh r1, [r1, 0x2] - adds r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 - movs r7, 0x1 - movs r5, 0 - ldr r3, =gUnknown_0857C60A - adds r0, r2, r3 - ldrb r0, [r0] - adds r6, 0x1 - str r6, [sp, 0x18] - adds r6, r2, 0 - cmp r0, 0 - beq _080D395A -_080D3930: - adds r1, r2, 0 - adds r0, r5, r2 - adds r0, r3 - ldrb r0, [r0] - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - add r0, sp - ldrb r0, [r0] - cmp r0, 0 - beq _080D39F4 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bhi _080D395A - adds r0, r5, r1 - adds r0, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _080D3930 -_080D395A: - cmp r7, 0x1 - bne _080D3A0C - mov r1, r8 - lsls r0, r1, 16 - asrs r5, r0, 16 - lsls r0, r4, 16 - asrs r4, r0, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetZCoordAt - lsls r0, 24 - lsrs r0, 24 - mov r2, r9 - movs r1, 0x4 - ldrsb r1, [r2, r1] - cmp r0, r1 - bne _080D3A0C - mov r3, r10 - adds r2, r6, r3 - movs r1, 0x1 - ldrsb r1, [r2, r1] - lsls r0, r1, 2 - adds r0, r1 - adds r0, 0xC - ldrb r2, [r2] - adds r0, r2 - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_8088E64 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080D39BC - adds r0, r4, 0 - bl MetatileBehavior_IsAsh - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080D39F8 -_080D39BC: - ldr r1, =0x03005db0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =0x0203ceec - ldr r0, =hm2_ruin_valley - str r0, [r1] - ldr r0, =0x03001108 - adds r0, r6, r0 - strb r7, [r0] - movs r4, 0x1 - str r4, [sp, 0x10] - b _080D3A0C - .pool -_080D39F4: - movs r7, 0 - b _080D395A -_080D39F8: - adds r0, r4, 0 - bl sub_80899F8 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1 - bne _080D3A0C - ldr r0, =0x03001108 - adds r0, r6, r0 - strb r1, [r0] -_080D3A0C: - ldr r1, [sp, 0x18] - lsls r0, r1, 24 - lsrs r6, r0, 24 - cmp r6, 0xF - bhi _080D3A18 - b _080D38F8 -_080D3A18: - ldr r2, [sp, 0x10] - cmp r2, 0x1 - bne _080D3A2A -_080D3A1E: - ldr r1, =0x03005db0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =0x0203ceec - ldr r0, =hm2_ruin_valley - str r0, [r1] -_080D3A2A: - ldr r0, [sp, 0x10] -_080D3A2C: - 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_80D3718 - - thumb_func_start hm2_ruin_valley -hm2_ruin_valley: @ 80D3A50 - push {lr} - movs r0, 0x1 - bl FieldEffectStart - bl brm_get_pokemon_selection - ldr r1, =0x02038c08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end hm2_ruin_valley - - thumb_func_start sub_80D3A6C -sub_80D3A6C: @ 80D3A6C - push {lr} - bl oei_task_add - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =sub_80D3AEC - lsrs r0, r2, 16 - strh r0, [r1, 0x18] - strh r2, [r1, 0x1A] - movs r0, 0x12 - bl sav12_xor_increment - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D3A6C - - thumb_func_start sub_80D3A9C -sub_80D3A9C: @ 80D3A9C - push {lr} - bl brm_get_pokemon_selection - ldr r1, =0x02038c08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - ldr r0, =gUnknown_08290705 - bl script_env_1_execute_new_script - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D3A9C - - thumb_func_start sub_80D3ABC -sub_80D3ABC: @ 80D3ABC - push {lr} - bl oei_task_add - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =sub_80D4354 - lsrs r0, r2, 16 - strh r0, [r1, 0x18] - strh r2, [r1, 0x1A] - movs r0, 0x12 - bl sav12_xor_increment - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D3ABC - - thumb_func_start sub_80D3AEC -sub_80D3AEC: @ 80D3AEC - push {lr} - movs r0, 0x1 - bl FieldEffectActiveListRemove - movs r0, 0x3A - bl FieldEffectStart - pop {r0} - bx r0 - thumb_func_end sub_80D3AEC - - thumb_func_start sub_80D3B00 -sub_80D3B00: @ 80D3B00 - push {r4-r7,lr} - movs r6, 0 - movs r0, 0x80 - bl audio_play - ldr r4, =0x0203ab40 - adds r1, r4, 0x2 - adds r0, r4, 0 - bl PlayerGetDestCoords - adds r7, r4, 0 -_080D3B16: - ldr r0, =0x03001108 - adds r0, r6, r0 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080D3B64 - adds r0, r6, 0 - movs r1, 0x5 - bl __umodsi3 - adds r4, r0, 0 - subs r4, 0x2 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - movs r1, 0x5 - bl __udivsi3 - adds r5, r0, 0 - subs r5, 0x2 - lsls r4, 24 - asrs r4, 24 - ldrh r0, [r7] - adds r4, r0 - lsls r5, 24 - asrs r5, 24 - ldrh r2, [r7, 0x2] - adds r5, r2 - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80D3C10 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_808E75C -_080D3B64: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x18 - bls _080D3B16 - ldr r2, =0x0203ab40 - ldr r0, =0x03001101 - ldrb r1, [r0] - ldrh r0, [r2] - subs r0, r1 - lsls r0, 16 - asrs r0, 16 - ldr r1, =0x03001102 - ldrb r1, [r1] - mvns r1, r1 - ldrh r2, [r2, 0x2] - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - bl sub_80D3D5C - bl DrawWholeMapView - ldr r4, =0x02039dd0 - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] - movs r6, 0 - ldr r5, =0x02020630 -_080D3BA0: - ldr r0, =0x02037590 - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r0, 0x2] - lsls r1, 23 - lsrs r1, 7 - movs r2, 0x80 - lsls r2, 12 - adds r1, r2 - asrs r1, 16 - ldrb r2, [r0] - adds r2, 0x14 - ldr r0, =gUnknown_0857C66C - movs r3, 0 - bl AddObjectToFront - ldr r1, [r4] - adds r1, r6 - strb r0, [r1] - ldr r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - lsls r1, r6, 5 - strh r1, [r0, 0x32] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x7 - bls _080D3BA0 - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D3B00 - - thumb_func_start sub_80D3C10 -sub_80D3C10: @ 80D3C10 - push {r4-r7,lr} - lsls r0, 16 - lsls r1, 16 - lsrs r6, r0, 16 - asrs r4, r0, 16 - lsrs r7, r1, 16 - asrs r5, r1, 16 - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridGetMetatileIdAt - adds r1, r0, 0 - ldr r0, =0x00000207 - cmp r1, r0 - bgt _080D3C5C - subs r0, 0x1 - cmp r1, r0 - bge _080D3CD4 - cmp r1, 0x25 - beq _080D3CF6 - cmp r1, 0x25 - bgt _080D3C4C - cmp r1, 0xD - beq _080D3C9C - cmp r1, 0x15 - beq _080D3C9C - b _080D3D00 - .pool -_080D3C4C: - movs r0, 0xE3 - lsls r0, 1 - cmp r1, r0 - beq _080D3CAC - adds r0, 0x1 - cmp r1, r0 - beq _080D3CB2 - b _080D3D00 -_080D3C5C: - ldr r0, =0x00000212 - cmp r1, r0 - beq _080D3CE4 - cmp r1, r0 - bgt _080D3C78 - subs r0, 0xA - cmp r1, r0 - beq _080D3C9C - adds r0, 0x2 - cmp r1, r0 - beq _080D3CE4 - b _080D3D00 - .pool -_080D3C78: - ldr r0, =0x00000282 - cmp r1, r0 - beq _080D3CC4 - cmp r1, r0 - bgt _080D3C90 - subs r0, 0x1 - cmp r1, r0 - beq _080D3CBC - b _080D3D00 - .pool -_080D3C90: - ldr r0, =0x00000283 - cmp r1, r0 - beq _080D3CCC - b _080D3D00 - .pool -_080D3C9C: - lsls r0, r6, 16 - asrs r0, 16 - lsls r1, r7, 16 - asrs r1, 16 - movs r2, 0x1 - bl MapGridSetMetatileIdAt - b _080D3D00 -_080D3CAC: - movs r2, 0xE7 - lsls r2, 1 - b _080D3CD6 -_080D3CB2: - ldr r2, =0x000001cf - b _080D3CD6 - .pool -_080D3CBC: - ldr r2, =0x00000279 - b _080D3CD6 - .pool -_080D3CC4: - ldr r2, =0x0000027a - b _080D3CD6 - .pool -_080D3CCC: - ldr r2, =0x0000027b - b _080D3CD6 - .pool -_080D3CD4: - ldr r2, =0x00000271 -_080D3CD6: - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridSetMetatileIdAt - b _080D3D00 - .pool -_080D3CE4: - lsls r0, r6, 16 - asrs r0, 16 - lsls r1, r7, 16 - asrs r1, 16 - movs r2, 0x86 - lsls r2, 2 - bl MapGridSetMetatileIdAt - b _080D3D00 -_080D3CF6: - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0xE - bl MapGridSetMetatileIdAt -_080D3D00: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80D3C10 - - thumb_func_start sub_80D3D08 -sub_80D3D08: @ 80D3D08 - push {lr} - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - bl MapGridGetMetatileIdAt - lsls r0, 16 - lsrs r1, r0, 16 - adds r2, r1, 0 - cmp r1, 0x1 - bne _080D3D24 - movs r0, 0x1 - b _080D3D56 -_080D3D24: - ldr r0, =0x00000279 - cmp r1, r0 - bne _080D3D34 - movs r0, 0x2 - b _080D3D56 - .pool -_080D3D34: - ldr r0, =0x0000027a - cmp r1, r0 - bne _080D3D44 - movs r0, 0x3 - b _080D3D56 - .pool -_080D3D44: - ldr r0, =0x0000027b - cmp r2, r0 - beq _080D3D54 - movs r0, 0 - b _080D3D56 - .pool -_080D3D54: - movs r0, 0x4 -_080D3D56: - pop {r1} - bx r1 - thumb_func_end sub_80D3D08 - - thumb_func_start sub_80D3D5C -sub_80D3D5C: @ 80D3D5C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - lsls r1, 16 - lsrs r1, 16 - mov r10, r1 - ldr r1, =0x03001100 - ldrb r2, [r1] - mov r3, r10 - adds r0, r2, r3 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp] - movs r4, 0 - cmp r4, r2 - blt _080D3D8A - b _080D3EA0 -_080D3D8A: - lsls r0, r3, 16 - asrs r7, r0, 16 -_080D3D8E: - mov r1, r9 - lsls r0, r1, 16 - asrs r0, 16 - lsls r4, 16 - asrs r1, r4, 16 - adds r0, r1 - lsls r0, 16 - lsrs r6, r0, 16 - asrs r5, r0, 16 - adds r0, r5, 0 - adds r1, r7, 0 - bl MapGridGetMetatileIdAt - mov r8, r4 - cmp r0, 0x15 - bne _080D3E12 - adds r4, r7, 0x1 - lsls r1, r4, 16 - asrs r1, 16 - adds r0, r5, 0 - bl sub_80D3D08 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _080D3DE8 - cmp r0, 0x2 - bgt _080D3DD0 - cmp r0, 0x1 - beq _080D3DDA - b _080D3E12 - .pool -_080D3DD0: - cmp r0, 0x3 - beq _080D3DF8 - cmp r0, 0x4 - beq _080D3E08 - b _080D3E12 -_080D3DDA: - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x82 - lsls r2, 2 - bl MapGridSetMetatileIdAt - b _080D3E12 -_080D3DE8: - adds r0, r5, 0 - adds r1, r4, 0 - ldr r2, =0x00000281 - bl MapGridSetMetatileIdAt - b _080D3E12 - .pool -_080D3DF8: - adds r0, r5, 0 - adds r1, r4, 0 - ldr r2, =0x00000282 - bl MapGridSetMetatileIdAt - b _080D3E12 - .pool -_080D3E08: - adds r0, r5, 0 - adds r1, r4, 0 - ldr r2, =0x00000283 - bl MapGridSetMetatileIdAt -_080D3E12: - lsls r0, r6, 16 - asrs r5, r0, 16 - ldr r3, [sp] - lsls r0, r3, 16 - asrs r4, r0, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - cmp r0, 0x1 - bne _080D3E8C - adds r4, 0x1 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - movs r1, 0x82 - lsls r1, 2 - cmp r0, r1 - bne _080D3E44 - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl MapGridSetMetatileIdAt -_080D3E44: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - ldr r1, =0x00000281 - cmp r0, r1 - bne _080D3E5C - adds r0, r5, 0 - adds r1, r4, 0 - ldr r2, =0x00000279 - bl MapGridSetMetatileIdAt -_080D3E5C: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - ldr r1, =0x00000282 - cmp r0, r1 - bne _080D3E74 - adds r0, r5, 0 - adds r1, r4, 0 - ldr r2, =0x0000027a - bl MapGridSetMetatileIdAt -_080D3E74: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - ldr r1, =0x00000283 - cmp r0, r1 - bne _080D3E8C - adds r0, r5, 0 - adds r1, r4, 0 - ldr r2, =0x0000027b - bl MapGridSetMetatileIdAt -_080D3E8C: - movs r1, 0x80 - lsls r1, 9 - add r1, r8 - lsrs r4, r1, 16 - asrs r1, 16 - ldr r0, =0x03001100 - ldrb r0, [r0] - cmp r1, r0 - bge _080D3EA0 - b _080D3D8E -_080D3EA0: - ldr r1, =0x03001100 - ldrb r0, [r1] - cmp r0, 0x5 - bne _080D3EC8 - mov r3, r9 - lsls r5, r3, 16 - asrs r5, 16 - mov r0, r10 - lsls r4, r0, 16 - asrs r4, 16 - movs r0, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_80D3EF4 - movs r0, 0x1 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_80D3EF4 -_080D3EC8: - 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_80D3D5C - - thumb_func_start sub_80D3EF4 -sub_80D3EF4: @ 80D3EF4 - 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 - lsls r1, 16 - lsrs r5, r1, 16 - adds r3, r5, 0 - lsls r2, 16 - lsrs r2, 16 - mov r10, r2 - cmp r0, 0 - bne _080D3F2C - mov r2, sp - ldr r1, =0x03001108 - ldrb r0, [r1, 0x5] - strb r0, [r2] - ldrb r0, [r1, 0xA] - strb r0, [r2, 0x1] - ldrb r0, [r1, 0xF] - strb r0, [r2, 0x2] - mov r8, r5 - b _080D3F4E - .pool -_080D3F2C: - cmp r0, 0x1 - beq _080D3F32 - b _080D414A -_080D3F32: - mov r2, sp - ldr r1, =0x03001108 - ldrb r0, [r1, 0x9] - strb r0, [r2] - ldrb r0, [r1, 0xE] - strb r0, [r2, 0x1] - ldrb r0, [r1, 0x13] - strb r0, [r2, 0x2] - lsls r0, r3, 16 - movs r1, 0x80 - lsls r1, 11 - adds r0, r1 - lsrs r0, 16 - mov r8, r0 -_080D3F4E: - mov r0, sp - ldrb r0, [r0] - cmp r0, 0x1 - bne _080D3FC6 - mov r1, r8 - lsls r0, r1, 16 - asrs r5, r0, 16 - mov r1, r10 - lsls r0, r1, 16 - asrs r0, 16 - adds r4, r0, 0x3 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - movs r1, 0x82 - lsls r1, 2 - cmp r0, r1 - bne _080D3F7E - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl MapGridSetMetatileIdAt -_080D3F7E: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - ldr r1, =0x00000281 - cmp r0, r1 - bne _080D3F96 - ldr r2, =0x00000279 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt -_080D3F96: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - ldr r1, =0x00000282 - cmp r0, r1 - bne _080D3FAE - ldr r2, =0x0000027a - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt -_080D3FAE: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - ldr r1, =0x00000283 - cmp r0, r1 - bne _080D3FC6 - ldr r2, =0x0000027b - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt -_080D3FC6: - mov r0, sp - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bne _080D40C0 - mov r0, r8 - lsls r5, r0, 16 - asrs r6, r5, 16 - mov r1, r10 - lsls r4, r1, 16 - asrs r7, r4, 16 - adds r1, r7, 0x2 - adds r0, r6, 0 - bl MapGridGetMetatileIdAt - mov r9, r4 - cmp r0, 0x15 - bne _080D4056 - adds r4, r7, 0x3 - lsls r1, r4, 16 - asrs r1, 16 - adds r0, r6, 0 - bl sub_80D3D08 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _080D4034 - cmp r0, 0x2 - bgt _080D4024 - cmp r0, 0x1 - beq _080D402E - b _080D4056 - .pool -_080D4024: - cmp r0, 0x3 - beq _080D403C - cmp r0, 0x4 - beq _080D404C - b _080D4056 -_080D402E: - movs r2, 0x82 - lsls r2, 2 - b _080D403E -_080D4034: - ldr r2, =0x00000281 - b _080D403E - .pool -_080D403C: - ldr r2, =0x00000282 -_080D403E: - adds r0, r6, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt - b _080D4056 - .pool -_080D404C: - ldr r2, =0x00000283 - adds r0, r6, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt -_080D4056: - asrs r5, 16 - mov r1, r9 - asrs r0, r1, 16 - adds r4, r0, 0x4 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - movs r1, 0x82 - lsls r1, 2 - cmp r0, r1 - bne _080D4078 - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl MapGridSetMetatileIdAt -_080D4078: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - ldr r1, =0x00000281 - cmp r0, r1 - bne _080D4090 - ldr r2, =0x00000279 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt -_080D4090: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - ldr r1, =0x00000282 - cmp r0, r1 - bne _080D40A8 - ldr r2, =0x0000027a - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt -_080D40A8: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileIdAt - ldr r1, =0x00000283 - cmp r0, r1 - bne _080D40C0 - ldr r2, =0x0000027b - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt -_080D40C0: - mov r0, sp - ldrb r0, [r0, 0x2] - cmp r0, 0x1 - bne _080D414A - mov r1, r8 - lsls r0, r1, 16 - asrs r5, r0, 16 - mov r1, r10 - lsls r0, r1, 16 - asrs r4, r0, 16 - adds r1, r4, 0x3 - adds r0, r5, 0 - bl MapGridGetMetatileIdAt - cmp r0, 0x15 - bne _080D414A - adds r4, 0x4 - lsls r1, r4, 16 - asrs r1, 16 - adds r0, r5, 0 - bl sub_80D3D08 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _080D4128 - cmp r0, 0x2 - bgt _080D4118 - cmp r0, 0x1 - beq _080D4122 - b _080D414A - .pool -_080D4118: - cmp r0, 0x3 - beq _080D4130 - cmp r0, 0x4 - beq _080D4140 - b _080D414A -_080D4122: - movs r2, 0x82 - lsls r2, 2 - b _080D4132 -_080D4128: - ldr r2, =0x00000281 - b _080D4132 - .pool -_080D4130: - ldr r2, =0x00000282 -_080D4132: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt - b _080D414A - .pool -_080D4140: - ldr r2, =0x00000283 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt -_080D414A: - 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_80D3EF4 - - thumb_func_start objc_8097BA8 -objc_8097BA8: @ 80D4160 - movs r2, 0 - movs r1, 0x8 - strh r1, [r0, 0x2E] - strh r2, [r0, 0x30] - strh r2, [r0, 0x34] - ldr r1, =objc_8097BBC - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end objc_8097BA8 - - thumb_func_start objc_8097BBC -objc_8097BBC: @ 80D4174 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r2, 0x2E - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x24] - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r2, 0x2E - ldrsh r1, [r4, r2] - bl cosine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x8 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x32] - ldrh r1, [r4, 0x2E] - adds r1, 0x1 - ldrh r2, [r4, 0x34] - lsls r0, r2, 16 - asrs r0, 18 - adds r1, r0 - strh r1, [r4, 0x2E] - adds r2, 0x1 - strh r2, [r4, 0x34] - ldrh r1, [r4, 0x30] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0x1C - beq _080D41C0 - adds r0, r1, 0x1 - strh r0, [r4, 0x30] - b _080D41C4 -_080D41C0: - ldr r0, =sub_80D41D0 - str r0, [r4, 0x1C] -_080D41C4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end objc_8097BBC - - thumb_func_start sub_80D41D0 -sub_80D41D0: @ 80D41D0 - push {r4-r6,lr} - movs r4, 0x1 -_080D41D4: - ldr r6, =0x02039dd0 - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =0x02020630 - adds r0, r5 - bl RemoveObjectAndFreeTiles - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _080D41D4 - ldr r0, [r6] - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x3A - bl FieldEffectStop - ldr r0, [r6] - bl Free - movs r0, 0 - str r0, [r6] - bl sub_80984F4 - bl script_env_2_disable - bl unown_chamber_related - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080D422A - ldr r0, =gUnknown_08267EDB - bl script_env_1_execute_new_script -_080D422A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D41D0 - - thumb_func_start sub_80D423C -sub_80D423C: @ 80D423C - push {r4,r5,lr} - lsls r0, 16 - asrs r5, r0, 16 - lsls r1, 16 - asrs r4, r1, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsLongGrass2 - lsls r0, 24 - cmp r0, 0 - beq _080D42AE - adds r4, 0x1 - lsls r1, r4, 16 - asrs r1, 16 - adds r0, r5, 0 - bl sub_80D3D08 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _080D428A - cmp r0, 0x2 - bgt _080D427A - cmp r0, 0x1 - beq _080D4284 - b _080D42AE -_080D427A: - cmp r0, 0x3 - beq _080D4294 - cmp r0, 0x4 - beq _080D42A4 - b _080D42AE -_080D4284: - movs r2, 0x82 - lsls r2, 2 - b _080D4296 -_080D428A: - ldr r2, =0x00000281 - b _080D4296 - .pool -_080D4294: - ldr r2, =0x00000282 -_080D4296: - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt - b _080D42AE - .pool -_080D42A4: - ldr r2, =0x00000283 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt -_080D42AE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D423C - - thumb_func_start sub_80D42B8 -sub_80D42B8: @ 80D42B8 - push {r4,r5,lr} - lsls r0, 16 - asrs r4, r0, 16 - lsls r1, 16 - asrs r5, r1, 16 - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridGetMetatileIdAt - cmp r0, 0x1 - bne _080D434A - adds r5, 0x1 - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl MetatileBehavior_IsLongGrassSouthEdge - lsls r0, 24 - cmp r0, 0 - beq _080D434A - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridGetMetatileIdAt - adds r1, r0, 0 - ldr r0, =0x00000281 - cmp r1, r0 - beq _080D4328 - cmp r1, r0 - bgt _080D4308 - subs r0, 0x79 - cmp r1, r0 - beq _080D431C - b _080D434A - .pool -_080D4308: - ldr r0, =0x00000282 - cmp r1, r0 - beq _080D4330 - adds r0, 0x1 - cmp r1, r0 - beq _080D4340 - b _080D434A - .pool -_080D431C: - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl MapGridSetMetatileIdAt - b _080D434A -_080D4328: - ldr r2, =0x00000279 - b _080D4332 - .pool -_080D4330: - ldr r2, =0x0000027a -_080D4332: - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridSetMetatileIdAt - b _080D434A - .pool -_080D4340: - ldr r2, =0x0000027b - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridSetMetatileIdAt -_080D434A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D42B8 - - thumb_func_start sub_80D4354 -sub_80D4354: @ 80D4354 - push {lr} - movs r0, 0x80 - bl audio_play - movs r0, 0x2 - bl FieldEffectActiveListRemove - bl script_env_2_enable_and_set_ctx_running - pop {r0} - bx r0 - thumb_func_end sub_80D4354 - - thumb_func_start sub_80D436C -sub_80D436C: @ 80D436C - push {r4,r5,lr} - movs r4, 0 - ldr r5, =0x03005d8c -_080D4372: - lsls r1, r4, 3 - adds r1, r4 - lsls r1, 2 - ldr r0, =0x00002be0 - adds r1, r0 - ldr r0, [r5] - adds r0, r1 - bl sub_80D439C - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _080D4372 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D436C - - thumb_func_start sub_80D439C -sub_80D439C: @ 80D439C - push {r4-r6,lr} - adds r3, r0, 0 - ldr r0, =0x0000ffff - adds r4, r0, 0 - adds r1, r3, 0 - movs r2, 0x8 -_080D43A8: - ldrh r0, [r1] - orrs r0, r4 - strh r0, [r1] - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _080D43A8 - movs r2, 0 - adds r6, r3, 0 - adds r6, 0x1A - adds r4, r3, 0 - adds r4, 0x12 - movs r5, 0xFF -_080D43C2: - adds r1, r4, r2 - ldrb r0, [r1] - orrs r0, r5 - strb r0, [r1] - adds r2, 0x1 - cmp r2, 0x7 - ble _080D43C2 - adds r1, r6, 0 - movs r2, 0 - adds r0, r1, 0x3 -_080D43D6: - strb r2, [r0] - subs r0, 0x1 - cmp r0, r1 - bge _080D43D6 - movs r1, 0 - movs r0, 0x1 - strh r0, [r3, 0x1E] - strh r1, [r3, 0x20] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D439C - - thumb_func_start sub_80D43F0 -sub_80D43F0: @ 80D43F0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0xC - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _080D4418 - adds r0, r4, 0 - movs r1, 0x40 - bl pokemon_getattr - cmp r0, 0xFF - beq _080D4418 - movs r0, 0x1 - b _080D441A -_080D4418: - movs r0, 0 -_080D441A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80D43F0 - - thumb_func_start sub_80D4420 -sub_80D4420: @ 80D4420 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - mov r8, r0 - lsls r1, 16 - lsrs r0, r1, 16 - str r0, [sp, 0x8] - mov r0, sp - movs r2, 0 - ldrb r3, [r0, 0x8] - strb r3, [r0] - lsrs r1, 24 - strb r1, [r0, 0x1] - add r3, sp, 0x4 - strb r2, [r3] - ldr r4, =0x03005d8c - mov r10, r4 - mov r9, r3 - adds r4, r3, 0 -_080D444C: - mov r1, r10 - ldr r0, [r1] - ldrb r2, [r4] - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - adds r0, r1 - movs r1, 0xB0 - lsls r1, 6 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _080D4468 - b _080D45A8 -_080D4468: - movs r4, 0 - ldr r2, =0x03005d90 - mov r12, r2 - ldr r7, =0x03005d8c - add r5, sp, 0x4 - ldr r3, =0x0000ffff - adds r6, r3, 0 -_080D4476: - ldr r2, [r7] - lsls r3, r4, 1 - ldrb r1, [r5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r3, r0 - ldr r0, =0x00002be0 - adds r2, r0 - adds r2, r3 - ldrh r0, [r2] - orrs r0, r6 - strh r0, [r2] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x8 - bls _080D4476 - movs r4, 0 - ldr r5, =0x03005d8c - add r3, sp, 0x4 -_080D44A0: - ldr r2, [r5] - ldrb r1, [r3] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r4, r0 - ldr r1, =0x00002bf2 - adds r2, r1 - adds r2, r0 - mov r1, r12 - ldr r0, [r1] - adds r0, r4 - ldrb r0, [r0] - strb r0, [r2] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bls _080D44A0 - mov r3, r10 - ldr r2, [r3] - mov r0, r9 - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r4, r0 - ldr r1, =0x00002bf2 - adds r2, r1 - adds r2, r0 - movs r0, 0xFF - strb r0, [r2] - mov r2, r9 - ldrb r1, [r2] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, [r3] - adds r0, r1 - ldr r3, =0x00002bf2 - adds r0, r3 - movs r1, 0 - bl sub_81DB4DC - movs r4, 0 - ldr r6, =0x03005d8c - add r3, sp, 0x4 - ldr r5, =0x03005d90 -_080D4500: - ldr r2, [r6] - ldrb r1, [r3] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r4, r0 - ldr r1, =0x00002bfa - adds r2, r1 - adds r2, r0 - ldr r0, [r5] - adds r0, 0xA - adds r0, r4 - ldrb r0, [r0] - strb r0, [r2] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _080D4500 - mov r0, r8 - movs r1, 0xB - bl pokemon_getattr_encrypted - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r8 - movs r1, 0 - bl pokemon_getattr_encrypted - adds r1, r0, 0 - adds r0, r4, 0 - bl sub_80D45C8 - mov r2, r10 - ldr r3, [r2] - mov r4, r9 - ldrb r2, [r4] - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - adds r1, r3, r1 - ldr r2, =0x00002bfe - adds r1, r2 - strh r0, [r1] - ldrb r1, [r4] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r3, r0 - movs r4, 0xB0 - lsls r4, 6 - adds r3, r4 - mov r0, sp - ldrh r0, [r0, 0x8] - strh r0, [r3] - mov r0, r8 - movs r1, 0x40 - mov r2, r9 - bl pokemon_setattr - mov r0, r8 - movs r1, 0xC - mov r2, sp - bl pokemon_setattr - mov r1, r9 - ldrb r0, [r1] - b _080D45B6 - .pool -_080D45A8: - adds r0, r2, 0x1 - strb r0, [r3] - ldrb r0, [r4] - cmp r0, 0x5 - bhi _080D45B4 - b _080D444C -_080D45B4: - movs r0, 0xFF -_080D45B6: - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80D4420 - - thumb_func_start sub_80D45C8 -sub_80D45C8: @ 80D45C8 - push {lr} - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xC9 - bne _080D45E0 - adds r0, r1, 0 - bl mon_icon_personality_to_unown_id - lsls r0, 16 - ldr r1, =0x75300000 - adds r0, r1 - lsrs r0, 16 -_080D45E0: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D45C8 - - thumb_func_start sub_80D45E8 -sub_80D45E8: @ 80D45E8 - push {lr} - lsls r0, 16 - lsrs r3, r0, 16 - ldr r0, =0xffff8ad0 - adds r2, r3, r0 - lsls r0, r2, 16 - lsrs r0, 16 - cmp r0, 0x1B - bhi _080D4604 - movs r0, 0xC9 - strh r2, [r1] - b _080D4606 - .pool -_080D4604: - adds r0, r3, 0 -_080D4606: - pop {r1} - bx r1 - thumb_func_end sub_80D45E8 - - thumb_func_start sub_80D460C -sub_80D460C: @ 80D460C - push {r4-r7,lr} - sub sp, 0x8 - adds r6, r0, 0 - adds r7, r1, 0 - ldrh r5, [r7, 0x20] - adds r1, r5, 0 - bl sub_80D4420 - add r4, sp, 0x4 - strb r0, [r4] - ldrb r2, [r4] - cmp r2, 0xFF - beq _080D4670 - ldr r0, =0x03005d8c - ldr r1, [r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r1, r0 - ldr r0, =0x00002be0 - adds r1, r0 - adds r0, r7, 0 - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - adds r0, r6, 0 - movs r1, 0x40 - adds r2, r4, 0 - bl pokemon_setattr - mov r0, sp - strb r5, [r0] - mov r1, sp - lsrs r0, r5, 8 - strb r0, [r1, 0x1] - adds r0, r6, 0 - movs r1, 0xC - mov r2, sp - bl pokemon_setattr - ldrb r0, [r4] - b _080D4672 - .pool -_080D4670: - movs r0, 0xFF -_080D4672: - add sp, 0x8 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80D460C - - thumb_func_start sub_80D467C -sub_80D467C: @ 80D467C - movs r0, 0 - bx lr - thumb_func_end sub_80D467C - - thumb_func_start sub_80D4680 -sub_80D4680: @ 80D4680 - push {r4,lr} - sub sp, 0x8 - adds r4, r0, 0 - bl sub_80D43F0 - lsls r0, 24 - cmp r0, 0 - beq _080D46D2 - adds r0, r4, 0 - movs r1, 0x40 - bl pokemon_getattr - add r2, sp, 0x4 - strb r0, [r2] - ldr r0, =0x03005d8c - ldr r3, [r0] - ldrb r1, [r2] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r3, r0 - movs r0, 0xB0 - lsls r0, 6 - adds r3, r0 - movs r1, 0 - movs r0, 0 - strh r0, [r3] - movs r0, 0xFF - strb r0, [r2] - mov r0, sp - strb r1, [r0] - strb r1, [r0, 0x1] - adds r0, r4, 0 - movs r1, 0x40 - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0xC - mov r2, sp - bl pokemon_setattr -_080D46D2: - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D4680 - - thumb_func_start sub_80D46E0 -sub_80D46E0: @ 80D46E0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005d8c - ldr r2, [r1] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r2, r1 - movs r0, 0xB0 - lsls r0, 6 - adds r2, r0 - movs r0, 0 - strh r0, [r2] - bx lr - .pool - thumb_func_end sub_80D46E0 - - thumb_func_start sub_80D4700 -sub_80D4700: @ 80D4700 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - adds r5, r0, 0 - mov r0, sp - movs r1, 0 - strb r1, [r0] - strb r1, [r0, 0x1] - add r1, sp, 0x4 - movs r0, 0xFF - strb r0, [r1] - movs r7, 0x6 - mov r9, r1 - ldr r0, =0x03005d8c - mov r8, r0 - ldr r3, =0x00002be0 -_080D4724: - mov r1, r8 - ldr r0, [r1] - lsls r1, r7, 3 - adds r1, r7 - lsls r1, 2 - adds r4, r0, r1 - movs r2, 0xB0 - lsls r2, 6 - adds r0, r4, r2 - ldrh r6, [r0] - cmp r6, 0 - bne _080D47A0 - adds r4, r3 - adds r0, r5, 0 - movs r1, 0x40 - str r3, [sp, 0x8] - bl pokemon_getattr - mov r1, r8 - ldr r2, [r1] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldr r3, [sp, 0x8] - adds r1, r3 - ldm r1!, {r0,r2,r3} - stm r4!, {r0,r2,r3} - ldm r1!, {r0,r2,r3} - stm r4!, {r0,r2,r3} - ldm r1!, {r0,r2,r3} - stm r4!, {r0,r2,r3} - adds r0, r5, 0 - movs r1, 0x40 - bl pokemon_getattr - mov r1, r8 - ldr r2, [r1] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r2, r1 - movs r3, 0xB0 - lsls r3, 6 - adds r2, r3 - strh r6, [r2] - adds r0, r5, 0 - movs r1, 0x40 - mov r2, r9 - bl pokemon_setattr - adds r0, r5, 0 - movs r1, 0xC - mov r2, sp - bl pokemon_setattr - adds r0, r7, 0 - b _080D47AC - .pool -_080D47A0: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0xF - bls _080D4724 - movs r0, 0xFF -_080D47AC: - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80D4700 - - thumb_func_start itemid_is_mail -itemid_is_mail: @ 80D47BC - push {lr} - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x84 - bgt _080D47CE - cmp r0, 0x79 - blt _080D47CE - movs r0, 0x1 - b _080D47D0 -_080D47CE: - movs r0, 0 -_080D47D0: - pop {r1} - bx r1 - thumb_func_end itemid_is_mail - - thumb_func_start sub_80D47D4 -sub_80D47D4: @ 80D47D4 - push {lr} - bl sub_80A0934 - bl AddMapNamePopUpWindowTask - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_80D47D4 - - thumb_func_start AddMapNamePopUpWindowTask -AddMapNamePopUpWindowTask: @ 80D47E4 - push {r4,lr} - movs r0, 0x80 - lsls r0, 7 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080D486C - ldr r4, =Task_MapNamePopUpWindow - adds r0, r4, 0 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _080D4844 - adds r0, r4, 0 - movs r1, 0x5A - bl CreateTask - ldr r4, =0x02039dd4 - strb r0, [r4] - movs r0, 0x12 - movs r1, 0x28 - bl SetGpuReg - ldr r2, =0x03005e00 - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x6 - strh r1, [r0, 0x8] - ldrb r1, [r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x28 - strh r1, [r0, 0xC] - b _080D486C - .pool -_080D4844: - ldr r3, =0x03005e00 - ldr r2, =0x02039dd4 - ldrb r0, [r2] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r3 - movs r4, 0x8 - ldrsh r0, [r1, r4] - cmp r0, 0x2 - beq _080D485E - movs r0, 0x2 - strh r0, [r1, 0x8] -_080D485E: - ldrb r0, [r2] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r3 - movs r0, 0x1 - strh r0, [r1, 0xE] -_080D486C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end AddMapNamePopUpWindowTask - - thumb_func_start Task_MapNamePopUpWindow -Task_MapNamePopUpWindow: @ 80D487C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r4, r1, r0 - movs r2, 0x8 - ldrsh r1, [r4, r2] - adds r3, r0, 0 - cmp r1, 0x6 - bhi _080D4966 - lsls r0, r1, 2 - ldr r1, =_080D48A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080D48A8: - .4byte _080D48DE - .4byte _080D4908 - .4byte _080D4920 - .4byte _080D4966 - .4byte _080D494C - .4byte _080D4960 - .4byte _080D48C4 -_080D48C4: - ldrh r0, [r4, 0x10] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1E - ble _080D4966 - strh r1, [r4, 0x8] - strh r1, [r4, 0x10] - bl ShowMapNamePopUpWindow - b _080D4966 -_080D48DE: - ldrh r0, [r4, 0xC] - subs r0, 0x2 - movs r2, 0 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - bgt _080D4966 - strh r2, [r4, 0xC] - movs r0, 0x1 - strh r0, [r4, 0x8] - ldr r0, =0x02039dd4 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r3 - strh r2, [r0, 0xA] - b _080D4966 - .pool -_080D4908: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x78 - ble _080D4966 - movs r0, 0 - strh r0, [r4, 0xA] - movs r0, 0x2 - strh r0, [r4, 0x8] - b _080D4966 -_080D4920: - ldrh r0, [r4, 0xC] - adds r0, 0x2 - movs r1, 0 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x27 - ble _080D4966 - movs r0, 0x28 - strh r0, [r4, 0xC] - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _080D4946 - movs r0, 0x6 - strh r0, [r4, 0x8] - strh r1, [r4, 0x10] - strh r1, [r4, 0xE] - b _080D4966 -_080D4946: - movs r0, 0x4 - strh r0, [r4, 0x8] - b _080D496E -_080D494C: - bl GetMapNamePopUpWindowId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_819746C - movs r0, 0x5 - strh r0, [r4, 0x8] - b _080D4966 -_080D4960: - bl HideMapNamePopUpWindow - b _080D496E -_080D4966: - ldrh r1, [r4, 0xC] - movs r0, 0x12 - bl SetGpuReg -_080D496E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end Task_MapNamePopUpWindow - - thumb_func_start HideMapNamePopUpWindow -HideMapNamePopUpWindow: @ 80D4974 - push {lr} - ldr r0, =Task_MapNamePopUpWindow - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - beq _080D49A4 - bl GetMapNamePopUpWindowId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_819746C - bl RemoveMapNamePopUpWindow - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg_ForcedBlank - ldr r0, =0x02039dd4 - ldrb r0, [r0] - bl DestroyTask -_080D49A4: - pop {r0} - bx r0 - .pool - thumb_func_end HideMapNamePopUpWindow - - thumb_func_start ShowMapNamePopUpWindow -ShowMapNamePopUpWindow: @ 80D49B0 - push {r4,r5,lr} - sub sp, 0x24 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - beq _080D4A08 - ldr r0, =0x02037318 - ldrh r1, [r0, 0x12] - movs r0, 0xBD - lsls r0, 1 - cmp r1, r0 - bne _080D49DC - mov r4, sp - adds r4, 0xF - ldr r0, =gUnknown_0857F544 - ldr r1, [r0, 0x1C] - b _080D49F2 - .pool -_080D49DC: - mov r4, sp - adds r4, 0xF - ldr r1, =gUnknown_0857F544 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r2, =0x00000cb2 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] -_080D49F2: - adds r0, r4, 0 - bl CopyString - b _080D4A18 - .pool -_080D4A08: - mov r4, sp - adds r4, 0xF - ldr r0, =0x02037318 - ldrb r1, [r0, 0x14] - adds r0, r4, 0 - movs r2, 0 - bl GetMapName -_080D4A18: - bl AddMapNamePopUpWindow - bl LoadMapNamePopUpWindowBg - movs r0, 0x7 - adds r1, r4, 0 - movs r2, 0x50 - bl GetStringCenterAlignXOffset - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - add r1, sp, 0xC - movs r5, 0 - movs r0, 0xFC - strb r0, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - adds r0, r1, 0 - strb r5, [r0, 0x2] - bl GetMapNamePopUpWindowId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x7 - add r2, sp, 0xC - adds r3, r4, 0 - bl Print - bl GetMapNamePopUpWindowId - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0x24 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ShowMapNamePopUpWindow - - thumb_func_start sub_80D4A78 -sub_80D4A78: @ 80D4A78 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - ldr r4, [sp, 0x3C] - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x10] - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x14] - movs r5, 0 - lsls r0, r1, 24 - asrs r1, r0, 24 - lsrs r3, r2, 24 - str r3, [sp, 0xC] - movs r6, 0xFF - lsls r6, 24 - adds r6, r2 - mov r8, r6 - str r0, [sp, 0x18] - subs r4, r1, 0x1 -_080D4AB4: - ldr r0, =0x0000021d - adds r1, r5, r0 - lsls r1, 16 - lsrs r1, 16 - lsls r2, r4, 24 - lsrs r2, 24 - movs r3, 0x1 - str r3, [sp] - str r3, [sp, 0x4] - movs r6, 0xE - mov r9, r6 - str r6, [sp, 0x8] - adds r0, r7, 0 - mov r6, r8 - lsrs r3, r6, 24 - bl FillBgTilemapBufferRect - adds r4, 0x1 - adds r5, 0x1 - cmp r5, 0xB - ble _080D4AB4 - ldr r1, =0x00000229 - movs r0, 0x1 - negs r0, r0 - add r0, r10 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0x1 - str r5, [sp] - str r5, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - adds r0, r7, 0 - mov r2, r8 - ldr r3, [sp, 0xC] - bl FillBgTilemapBufferRect - ldr r1, =0x0000022a - ldr r6, [sp, 0x10] - add r6, r10 - lsls r6, 24 - lsrs r6, 24 - str r5, [sp] - str r5, [sp, 0x4] - mov r3, r9 - str r3, [sp, 0x8] - adds r0, r7, 0 - adds r2, r6, 0 - ldr r3, [sp, 0xC] - bl FillBgTilemapBufferRect - ldr r1, =0x0000022b - ldr r4, [sp, 0xC] - adds r4, 0x1 - lsls r4, 24 - lsrs r4, 24 - str r5, [sp] - str r5, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - adds r0, r7, 0 - mov r2, r8 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - movs r1, 0x8B - lsls r1, 2 - str r5, [sp] - str r5, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - adds r0, r7, 0 - adds r2, r6, 0 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - ldr r1, =0x0000022d - ldr r4, [sp, 0xC] - adds r4, 0x2 - lsls r4, 24 - lsrs r4, 24 - str r5, [sp] - str r5, [sp, 0x4] - mov r3, r9 - str r3, [sp, 0x8] - adds r0, r7, 0 - mov r2, r8 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - ldr r1, =0x0000022e - str r5, [sp] - str r5, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - adds r0, r7, 0 - adds r2, r6, 0 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - movs r5, 0 - ldr r1, [sp, 0xC] - ldr r2, [sp, 0x14] - adds r0, r1, r2 - lsls r4, r0, 24 - movs r6, 0x1 -_080D4B8A: - ldr r3, =0x0000022f - adds r1, r5, r3 - lsls r1, 16 - lsrs r1, 16 - subs r0, r5, 0x1 - ldr r3, [sp, 0x18] - asrs r2, r3, 24 - adds r2, r0 - lsls r2, 24 - lsrs r2, 24 - str r6, [sp] - str r6, [sp, 0x4] - movs r0, 0xE - str r0, [sp, 0x8] - adds r0, r7, 0 - lsrs r3, r4, 24 - bl FillBgTilemapBufferRect - adds r5, 0x1 - cmp r5, 0xB - ble _080D4B8A - 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_80D4A78 - - thumb_func_start LoadMapNamePopUpWindowBg -LoadMapNamePopUpWindowBg: @ 80D4BE0 - push {r4,r5,lr} - sub sp, 0x8 - bl GetMapNamePopUpWindowId - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02037318 - ldrb r1, [r0, 0x14] - cmp r1, 0x57 - bls _080D4C0A - cmp r1, 0xC4 - bls _080D4C08 - adds r0, r1, 0 - subs r0, 0x6D - lsls r0, 16 - lsrs r1, r0, 16 - b _080D4C0A - .pool -_080D4C08: - movs r1, 0 -_080D4C0A: - ldr r0, =gUnknown_0857F464 - adds r0, r1, r0 - ldrb r4, [r0] - adds r0, r5, 0 - movs r1, 0 - bl GetWindowAttribute - lsls r0, 24 - lsrs r0, 24 - lsls r1, r4, 4 - subs r1, r4 - lsls r1, 6 - ldr r2, =gUnknown_0857DD04 - adds r1, r2 - movs r2, 0x80 - lsls r2, 3 - ldr r3, =0x0000021d - bl LoadBgTiles - ldr r1, =sub_80D4A78 - adds r0, r5, 0 - bl CallWindowFunction - adds r0, r5, 0 - bl PutWindowTilemap - ldr r0, =0x02037318 - ldrb r0, [r0, 0x16] - cmp r0, 0xE - bne _080D4C6C - ldr r0, =gUnknown_0857F444 - movs r1, 0xE0 - movs r2, 0x20 - bl gpu_pal_apply - b _080D4C7A - .pool -_080D4C6C: - lsls r0, r4, 5 - ldr r1, =gUnknown_0857F384 - adds r0, r1 - movs r1, 0xE0 - movs r2, 0x20 - bl gpu_pal_apply -_080D4C7A: - lsls r1, r4, 4 - subs r1, r4 - lsls r1, 6 - ldr r0, =gUnknown_0857C684 - adds r1, r0 - movs r0, 0x50 - str r0, [sp] - movs r0, 0x18 - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0 - bl BlitBitmapToWindow - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end LoadMapNamePopUpWindowBg - - thumb_func_start RemoveBagObject -@ void RemoveBagObject(u8 a1) -RemoveBagObject: @ 80D4CA8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0203ce54 - ldr r2, =0x00000804 - adds r1, r4, r2 - ldr r0, [r0] - adds r5, r0, r1 - ldrb r0, [r5] - cmp r0, 0xFF - beq _080D4CEE - adds r4, 0x64 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - movs r0, 0xFF - strb r0, [r5] -_080D4CEE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end RemoveBagObject - - thumb_func_start AddBagVisualObject -@ void AddBagVisualObject(u8 bagPocketId) -AddBagVisualObject: @ 80D4D00 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =0x0203ce54 - ldr r4, [r0] - ldr r0, =0x00000804 - adds r4, r0 - ldr r0, =gUnknown_0857FB4C - movs r1, 0x44 - movs r2, 0x42 - movs r3, 0 - bl AddObjectToFront - strb r0, [r4] - adds r0, r5, 0 - movs r1, 0 - bl SetBagVisualPocketId - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end AddBagVisualObject - - thumb_func_start SetBagVisualPocketId -@ void SetBagVisualPocketId(u8 bagPocketId, bool8 isSwitchingPockets) -SetBagVisualPocketId: @ 80D4D38 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 24 - ldr r0, =0x0203ce54 - ldr r0, [r0] - ldr r2, =0x00000804 - adds r0, r2 - ldrb r2, [r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02020630 - adds r2, r0, r2 - cmp r1, 0 - beq _080D4D84 - ldr r0, =0x0000fffb - strh r0, [r2, 0x26] - ldr r0, =ObjectCB_BagVisualSwitchingPockets - str r0, [r2, 0x1C] - adds r0, r3, 0x1 - strh r0, [r2, 0x2E] - adds r0, r2, 0 - movs r1, 0 - bl StartObjectImageAnim - b _080D4D90 - .pool -_080D4D84: - adds r1, r3, 0x1 - lsls r1, 24 - lsrs r1, 24 - adds r0, r2, 0 - bl StartObjectImageAnim -_080D4D90: - pop {r0} - bx r0 - thumb_func_end SetBagVisualPocketId - - thumb_func_start ObjectCB_BagVisualSwitchingPockets -@ void ObjectCB_BagVisualSwitchingPockets(struct obj *object) -ObjectCB_BagVisualSwitchingPockets: @ 80D4D94 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x26] - movs r2, 0x26 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _080D4DA8 - adds r0, r1, 0x1 - strh r0, [r4, 0x26] - b _080D4DB8 -_080D4DA8: - ldrh r1, [r4, 0x2E] - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] -_080D4DB8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ObjectCB_BagVisualSwitchingPockets - - thumb_func_start ShakeBagVisual -@ void ShakeBagVisual() -ShakeBagVisual: @ 80D4DC4 - push {r4,lr} - ldr r0, =0x0203ce54 - ldr r0, [r0] - ldr r1, =0x00000804 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r4, r0, r1 - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080D4DF4 - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - ldr r0, =ObjectCB_ShakeBagVisual - str r0, [r4, 0x1C] -_080D4DF4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ShakeBagVisual - - thumb_func_start ObjectCB_ShakeBagVisual -@ void ObjectCB_ShakeBagVisual(struct obj *object) -ObjectCB_ShakeBagVisual: @ 80D4E0C - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080D4E28 - adds r0, r4, 0 - movs r1, 0 - bl StartObjectRotScalAnim - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] -_080D4E28: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ObjectCB_ShakeBagVisual - - thumb_func_start AddSwitchPocketRotatingBallObject -@ void AddSwitchPocketRotatingBallObject(u16 rotationDirection) -AddSwitchPocketRotatingBallObject: @ 80D4E34 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - ldr r0, =0x0203ce54 - ldr r4, [r0] - ldr r0, =0x00000805 - adds r4, r0 - ldr r0, =gUnknown_0857FBA0 - bl LoadObjectPic - ldr r0, =gUnknown_0857FBA8 - bl LoadTaggedObjectPalette - ldr r0, =gUnknown_0857FBB0 - movs r1, 0x10 - movs r2, 0x10 - movs r3, 0 - bl AddObjectToFront - strb r0, [r4] - ldr r2, =0x02020630 - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r5, [r0, 0x2E] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end AddSwitchPocketRotatingBallObject - - thumb_func_start update_switch_pocket_rotating_ball_coords -@ void update_switch_pocket_rotating_ball_coords(struct obj *object) -update_switch_pocket_rotating_ball_coords: @ 80D4E8C - ldrh r2, [r0, 0x30] - ldrh r1, [r0, 0x34] - adds r1, 0x1 - movs r3, 0x1 - ands r1, r3 - subs r2, r1 - adds r1, r0, 0 - adds r1, 0x28 - strb r2, [r1] - ldrh r2, [r0, 0x30] - ldrh r1, [r0, 0x34] - adds r1, 0x1 - ands r1, r3 - subs r2, r1 - adds r0, 0x29 - strb r2, [r0] - bx lr - thumb_func_end update_switch_pocket_rotating_ball_coords - - thumb_func_start ObjectCB_SwitchPocketRotatingBallInit -@ void ObjectCB_SwitchPocketRotatingBallInit(struct obj *object) -ObjectCB_SwitchPocketRotatingBallInit: @ 80D4EB0 - push {r4,lr} - adds r4, r0, 0 - ldrb r1, [r4, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r4, 0x1] - movs r0, 0x2E - ldrsh r1, [r4, r0] - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _080D4ED8 - ldr r0, =gUnknown_0857FB98 - b _080D4EDA - .pool -_080D4ED8: - ldr r0, =gUnknown_0857FB9C -_080D4EDA: - str r0, [r4, 0x10] - adds r0, r4, 0 - bl obj_alloc_rotscale_entry - adds r0, r4, 0 - adds r0, 0x28 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - strh r0, [r4, 0x30] - adds r0, r4, 0 - adds r0, 0x29 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - strh r0, [r4, 0x30] - adds r0, r4, 0 - bl update_switch_pocket_rotating_ball_coords - ldr r0, =ObjectCB_SwitchPocketRotatingBallContinue - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ObjectCB_SwitchPocketRotatingBallInit - - thumb_func_start ObjectCB_SwitchPocketRotatingBallContinue -@ void ObjectCB_SwitchPocketRotatingBallContinue(struct obj *object) -ObjectCB_SwitchPocketRotatingBallContinue: @ 80D4F14 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - adds r0, r4, 0 - bl update_switch_pocket_rotating_ball_coords - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0x10 - bne _080D4F32 - movs r0, 0x1 - bl RemoveBagObject -_080D4F32: - pop {r4} - pop {r0} - bx r0 - thumb_func_end ObjectCB_SwitchPocketRotatingBallContinue - - thumb_func_start AddBagItemIconObject -@ void AddBagItemIconObject(u16 itemId, u8 a2) -AddBagItemIconObject: @ 80D4F38 - push {r4-r6,lr} - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 24 - lsrs r4, r1, 24 - ldr r0, =0x0203ce54 - ldr r2, =0x00000806 - adds r1, r4, r2 - ldr r0, [r0] - adds r5, r0, r1 - ldrb r0, [r5] - cmp r0, 0xFF - bne _080D4F86 - adds r4, 0x66 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - adds r0, r4, 0 - adds r1, r4, 0 - adds r2, r6, 0 - bl AddItemIconObject - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - beq _080D4F86 - strb r2, [r5] - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0x18 - strh r1, [r0, 0x24] - movs r1, 0x58 - strh r1, [r0, 0x26] -_080D4F86: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end AddBagItemIconObject - - thumb_func_start RemoveBagItemIconObject -@ void RemoveBagItemIconObject(u8 a1) -RemoveBagItemIconObject: @ 80D4F98 - push {lr} - lsls r0, 24 - movs r1, 0x80 - lsls r1, 18 - adds r0, r1 - lsrs r0, 24 - bl RemoveBagObject - pop {r0} - bx r0 - thumb_func_end RemoveBagItemIconObject - - thumb_func_start sub_80D4FAC -sub_80D4FAC: @ 80D4FAC - push {lr} - ldr r0, =0x0203ce54 - ldr r0, [r0] - ldr r1, =0x00000808 - adds r0, r1 - movs r1, 0x8 - bl sub_8122344 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D4FAC - - thumb_func_start sub_80D4FC8 -sub_80D4FC8: @ 80D4FC8 - push {lr} - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =0x0203ce54 - ldr r0, [r0] - ldr r1, =0x00000808 - adds r0, r1 - movs r1, 0x8 - bl sub_81223FC - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D4FC8 - - thumb_func_start sub_80D4FEC -sub_80D4FEC: @ 80D4FEC - push {lr} - adds r3, r0, 0 - lsls r3, 24 - ldr r0, =0x0203ce54 - ldr r0, [r0] - ldr r1, =0x00000808 - adds r0, r1 - lsrs r3, 4 - movs r1, 0x80 - lsls r1, 13 - adds r3, r1 - lsrs r3, 16 - movs r1, 0x88 - movs r2, 0x78 - bl sub_8122448 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D4FEC - - thumb_func_start sub_80D5018 -sub_80D5018: @ 80D5018 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - adds r4, r1, 0 - movs r2, 0x80 - lsls r2, 4 - adds r0, r4, 0 - movs r1, 0 - bl memset - movs r0, 0x80 - lsls r0, 1 - adds r4, r0 - movs r7, 0 -_080D5036: - adds r4, 0x20 - movs r5, 0 - adds r1, r7, 0x1 - mov r8, r1 -_080D503E: - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0x20 - bl memcpy - adds r4, 0x20 - adds r6, 0x20 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _080D503E - cmp r7, 0x5 - beq _080D505C - adds r4, 0x20 -_080D505C: - mov r1, r8 - lsls r0, r1, 24 - lsrs r7, r0, 24 - cmp r7, 0x5 - bls _080D5036 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80D5018 - - thumb_func_start sub_80D5070 -sub_80D5070: @ 80D5070 - push {r4,r5,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - cmp r4, 0x2A - bne _080D5082 - bl sub_80E162C -_080D5082: - ldr r5, =gBerryPicTable - lsls r4, 3 - adds r0, r5, 0x4 - adds r0, r4, r0 - ldr r0, [r0] - str r0, [sp] - ldr r1, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r1 - ldr r1, =0x00007544 - orrs r0, r1 - str r0, [sp, 0x4] - mov r0, sp - bl LoadCompressedObjectPalette - adds r4, r5 - ldr r0, [r4] - ldr r4, =0x0201d000 - adds r1, r4, 0 - bl LZDecompressWram - ldr r0, =0xfffff000 - adds r1, r4, r0 - adds r0, r4, 0 - bl sub_80D5018 - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5070 - - thumb_func_start sub_80D50D4 -sub_80D50D4: @ 80D50D4 - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - bl sub_80D5070 - ldr r0, =gUnknown_0857FBEC - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D50D4 - - thumb_func_start sub_80D510C -sub_80D510C: @ 80D510C - push {lr} - ldr r0, =0x00007544 - bl FreeObjectPaletteByTag - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D510C - - thumb_func_start sub_80D511C -sub_80D511C: @ 80D511C - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - mov r8, r3 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =0x00007544 - bl FreeObjectPaletteByTag - adds r0, r4, 0 - bl sub_80D5070 - ldr r0, =gUnknown_0857FC7C - adds r1, r5, 0 - adds r2, r6, 0 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - adds r4, r1, 0 - mov r0, r8 - cmp r0, 0x1 - bne _080D5172 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0x1 - bl StartObjectRotScalAnim -_080D5172: - adds r0, r4, 0 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D511C - - thumb_func_start sub_80D518C -sub_80D518C: @ 80D518C - push {lr} - adds r1, r0, 0 - ldr r0, =gUnknown_0857FE10 - lsls r1, 16 - asrs r1, 16 - movs r2, 0x74 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D518C - - thumb_func_start sub_80D51AC -sub_80D51AC: @ 80D51AC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x0203841e - ldrb r0, [r4] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - bne _080D51D0 - adds r0, r5, 0 - bl move_anim_task_del - b _080D520C - .pool -_080D51D0: - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r4, 0x2] - strh r1, [r0, 0x24] - ldrh r1, [r4, 0x4] - strh r1, [r0, 0x26] - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - strh r2, [r0, 0x8] - ldrh r1, [r4, 0x6] - strh r1, [r0, 0xA] - ldrh r1, [r4, 0x8] - strh r1, [r0, 0xC] - ldrh r1, [r4, 0x8] - strh r1, [r0, 0xE] - ldrh r1, [r4, 0x2] - strh r1, [r0, 0x10] - ldrh r1, [r4, 0x4] - strh r1, [r0, 0x12] - ldr r1, =sub_80D5220 - str r1, [r0] - adds r0, r5, 0 - bl _call_via_r1 -_080D520C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D51AC - - thumb_func_start sub_80D5220 -sub_80D5220: @ 80D5220 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r3, r0, r1 - ldrh r0, [r3, 0xE] - movs r2, 0xE - ldrsh r5, [r3, r2] - adds r7, r1, 0 - cmp r5, 0 - bne _080D52C6 - ldr r2, =0x02020630 - movs r6, 0x8 - ldrsh r1, [r3, r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - movs r6, 0x24 - ldrsh r0, [r1, r6] - adds r6, r2, 0 - cmp r0, 0 - bne _080D5264 - ldrh r0, [r3, 0x10] - strh r0, [r1, 0x24] - b _080D5266 - .pool -_080D5264: - strh r5, [r1, 0x24] -_080D5266: - lsls r2, r4, 2 - adds r0, r2, r4 - lsls r0, 3 - adds r3, r0, r7 - movs r0, 0x8 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r6 - movs r5, 0x26 - ldrsh r0, [r1, r5] - cmp r0, 0 - bne _080D5286 - ldrh r0, [r3, 0x12] - b _080D5288 -_080D5286: - movs r0, 0 -_080D5288: - strh r0, [r1, 0x26] - adds r0, r2, r4 - lsls r0, 3 - adds r2, r0, r7 - ldrh r0, [r2, 0xC] - strh r0, [r2, 0xE] - ldrh r0, [r2, 0xA] - subs r0, 0x1 - strh r0, [r2, 0xA] - lsls r0, 16 - asrs r3, r0, 16 - cmp r3, 0 - bne _080D52CA - movs r0, 0x8 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r3, [r0, 0x24] - movs r5, 0x8 - ldrsh r1, [r2, r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r3, [r0, 0x26] - adds r0, r4, 0 - bl move_anim_task_del - b _080D52CA -_080D52C6: - subs r0, 0x1 - strh r0, [r3, 0xE] -_080D52CA: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80D5220 - - thumb_func_start sub_80D52D0 -sub_80D52D0: @ 80D52D0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r6, 0 - ldr r2, =0x0203841e - ldrh r0, [r2] - movs r3, 0 - ldrsh r1, [r2, r3] - cmp r1, 0x3 - bgt _080D52FC - lsls r0, 24 - lsrs r0, 24 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0xFF - bne _080D5352 - b _080D5356 - .pool -_080D52FC: - cmp r1, 0x8 - beq _080D5348 - movs r1, 0 - ldrsh r0, [r2, r1] - cmp r0, 0x5 - beq _080D531C - cmp r0, 0x5 - bgt _080D5312 - cmp r0, 0x4 - beq _080D5318 - b _080D5324 -_080D5312: - cmp r0, 0x6 - beq _080D5320 - b _080D5324 -_080D5318: - movs r0, 0 - b _080D5326 -_080D531C: - movs r0, 0x2 - b _080D5326 -_080D5320: - movs r0, 0x1 - b _080D5326 -_080D5324: - movs r0, 0x3 -_080D5326: - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - bne _080D533C - movs r6, 0x1 -_080D533C: - ldr r0, =0x020241e4 - adds r0, r4, r0 - b _080D5350 - .pool -_080D5348: - ldr r1, =0x020241e4 - ldr r0, =0x02038436 - ldrb r0, [r0] - adds r0, r1 -_080D5350: - ldrb r3, [r0] -_080D5352: - cmp r6, 0 - beq _080D5368 -_080D5356: - adds r0, r5, 0 - bl move_anim_task_del - b _080D53A6 - .pool -_080D5368: - ldr r1, =0x02020630 - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - adds r0, r1 - ldr r2, =0x0203841e - ldrh r1, [r2, 0x2] - strh r1, [r0, 0x24] - ldrh r1, [r2, 0x4] - strh r1, [r0, 0x26] - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - strh r3, [r0, 0x8] - ldrh r1, [r2, 0x6] - strh r1, [r0, 0xA] - ldrh r1, [r2, 0x8] - strh r1, [r0, 0xC] - ldrh r1, [r2, 0x8] - strh r1, [r0, 0xE] - ldrh r1, [r2, 0x2] - strh r1, [r0, 0x10] - ldrh r1, [r2, 0x4] - strh r1, [r0, 0x12] - ldr r1, =sub_80D53BC - str r1, [r0] - adds r0, r5, 0 - bl _call_via_r1 -_080D53A6: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D52D0 - - thumb_func_start sub_80D53BC -sub_80D53BC: @ 80D53BC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r3, r0, r1 - ldrh r2, [r3, 0xE] - movs r4, 0xE - ldrsh r0, [r3, r4] - mov r12, r1 - cmp r0, 0 - bne _080D5474 - ldr r2, =0x02020630 - movs r7, 0x8 - ldrsh r1, [r3, r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r0, r2 - movs r0, 0x24 - ldrsh r1, [r4, r0] - ldrh r5, [r3, 0x10] - movs r7, 0x10 - ldrsh r0, [r3, r7] - adds r7, r2, 0 - cmp r1, r0 - bne _080D5408 - negs r0, r5 - strh r0, [r4, 0x24] - b _080D540A - .pool -_080D5408: - strh r5, [r4, 0x24] -_080D540A: - lsls r3, r6, 2 - adds r1, r3, r6 - lsls r1, 3 - add r1, r12 - movs r0, 0x8 - ldrsh r2, [r1, r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r4, r0, r7 - movs r0, 0x26 - ldrsh r2, [r4, r0] - mov r8, r2 - ldrh r5, [r1, 0x12] - movs r2, 0x12 - ldrsh r0, [r1, r2] - cmp r8, r0 - bne _080D5434 - negs r0, r5 - strh r0, [r4, 0x26] - b _080D5436 -_080D5434: - strh r5, [r4, 0x26] -_080D5436: - adds r0, r3, r6 - lsls r0, 3 - mov r4, r12 - adds r3, r0, r4 - ldrh r0, [r3, 0xC] - strh r0, [r3, 0xE] - ldrh r0, [r3, 0xA] - subs r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r2, r0, 16 - cmp r2, 0 - bne _080D5478 - movs r0, 0x8 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x24] - movs r4, 0x8 - ldrsh r1, [r3, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r2, [r0, 0x26] - adds r0, r6, 0 - bl move_anim_task_del - b _080D5478 -_080D5474: - subs r0, r2, 0x1 - strh r0, [r3, 0xE] -_080D5478: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80D53BC - - thumb_func_start sub_80D5484 -sub_80D5484: @ 80D5484 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x0203841e - ldrb r0, [r4] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0xFF - bne _080D54A8 - adds r0, r5, 0 - bl move_anim_task_del - b _080D54F6 - .pool -_080D54A8: - ldr r0, =0x02020630 - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r4, 0x2] - ldrh r2, [r1, 0x24] - adds r0, r2 - movs r2, 0 - strh r0, [r1, 0x24] - ldrh r0, [r4, 0x4] - ldrh r6, [r1, 0x26] - adds r0, r6 - strh r0, [r1, 0x26] - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - strh r3, [r1, 0x8] - strh r2, [r1, 0xA] - ldrh r0, [r4, 0x6] - strh r0, [r1, 0xC] - strh r2, [r1, 0xE] - ldrh r0, [r4, 0x8] - strh r0, [r1, 0x10] - movs r2, 0x2 - ldrsh r0, [r4, r2] - lsls r0, 1 - strh r0, [r1, 0x12] - movs r6, 0x4 - ldrsh r0, [r4, r6] - lsls r0, 1 - strh r0, [r1, 0x14] - ldr r2, =sub_80D5508 - str r2, [r1] - adds r0, r5, 0 - bl _call_via_r2 -_080D54F6: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5484 - - thumb_func_start sub_80D5508 -sub_80D5508: @ 80D5508 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r2, [r4, 0xE] - movs r3, 0xE - ldrsh r0, [r4, r3] - adds r6, r1, 0 - cmp r0, 0 - beq _080D5526 - b _080D5638 -_080D5526: - ldrh r1, [r4, 0xA] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080D5568 - ldr r2, =0x02020630 - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r4, 0x12] - ldrh r3, [r0, 0x24] - adds r1, r3 - strh r1, [r0, 0x24] - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r4, 0x14] - ldrh r3, [r0, 0x26] - adds r1, r3 - strh r1, [r0, 0x26] - adds r3, r2, 0 - b _080D5592 - .pool -_080D5568: - ldr r3, =0x02020630 - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x24] - ldrh r2, [r4, 0x12] - subs r1, r2 - strh r1, [r0, 0x24] - movs r2, 0x8 - ldrsh r1, [r4, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x26] - ldrh r2, [r4, 0x14] - subs r1, r2 - strh r1, [r0, 0x26] -_080D5592: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r6 - ldrh r0, [r4, 0x10] - strh r0, [r4, 0xE] - ldrh r0, [r4, 0xA] - adds r2, r0, 0x1 - strh r2, [r4, 0xA] - lsls r0, r2, 16 - asrs r0, 16 - movs r6, 0xC - ldrsh r1, [r4, r6] - cmp r0, r1 - blt _080D563C - movs r0, 0x1 - ands r2, r0 - cmp r2, 0 - beq _080D55F8 - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - movs r2, 0x12 - ldrsh r0, [r4, r2] - lsrs r2, r0, 31 - adds r0, r2 - asrs r0, 1 - ldrh r6, [r1, 0x24] - adds r0, r6 - strh r0, [r1, 0x24] - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - movs r2, 0x14 - ldrsh r0, [r4, r2] - lsrs r2, r0, 31 - adds r0, r2 - asrs r0, 1 - ldrh r3, [r1, 0x26] - adds r0, r3 - strh r0, [r1, 0x26] - b _080D5630 - .pool -_080D55F8: - movs r6, 0x8 - ldrsh r0, [r4, r6] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsrs r0, r1, 31 - adds r1, r0 - asrs r1, 1 - ldrh r0, [r2, 0x24] - subs r0, r1 - strh r0, [r2, 0x24] - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - movs r3, 0x14 - ldrsh r1, [r4, r3] - lsrs r0, r1, 31 - adds r1, r0 - asrs r1, 1 - ldrh r0, [r2, 0x26] - subs r0, r1 - strh r0, [r2, 0x26] -_080D5630: - adds r0, r5, 0 - bl move_anim_task_del - b _080D563C -_080D5638: - subs r0, r2, 0x1 - strh r0, [r4, 0xE] -_080D563C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80D5508 - - thumb_func_start sub_80D5644 -sub_80D5644: @ 80D5644 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =0x0203841e - ldrb r0, [r5] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r2, [r5, 0x2] - strh r2, [r1, 0x24] - ldr r2, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r2 - strh r0, [r1, 0x8] - ldrh r0, [r5, 0x2] - strh r0, [r1, 0xA] - ldrh r0, [r5, 0x4] - strh r0, [r1, 0xC] - ldrh r0, [r5, 0x6] - strh r0, [r1, 0xE] - ldrh r0, [r5, 0x8] - strh r0, [r1, 0x10] - ldr r2, =sub_80D56A4 - str r2, [r1] - adds r0, r4, 0 - bl _call_via_r2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5644 - - thumb_func_start sub_80D56A4 -sub_80D56A4: @ 80D56A4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r3, r0, r2 - ldrb r5, [r3, 0x8] - ldrh r4, [r3, 0xA] - ldrh r1, [r3, 0x18] - adds r0, r1, 0x1 - strh r0, [r3, 0x18] - movs r7, 0xC - ldrsh r0, [r3, r7] - lsls r1, 16 - asrs r1, 16 - mov r12, r2 - ldr r7, =0x02020630 - cmp r0, r1 - bne _080D56F6 - movs r0, 0 - strh r0, [r3, 0x18] - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r1, r0, r7 - ldrh r3, [r1, 0x24] - movs r0, 0x24 - ldrsh r2, [r1, r0] - lsls r0, r4, 16 - asrs r0, 16 - cmp r2, r0 - bne _080D56EE - negs r0, r2 - lsls r0, 16 - lsrs r4, r0, 16 -_080D56EE: - lsls r0, r4, 16 - asrs r0, 16 - adds r0, r3 - strh r0, [r1, 0x24] -_080D56F6: - lsls r2, r6, 2 - adds r2, r6 - lsls r2, 3 - add r2, r12 - strh r4, [r2, 0xA] - ldrh r1, [r2, 0xE] - ldrh r0, [r2, 0x1A] - adds r1, r0 - strh r1, [r2, 0x1A] - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r0, r7 - lsls r1, 16 - asrs r1, 24 - strh r1, [r0, 0x26] - ldrh r0, [r2, 0x10] - subs r0, 0x1 - strh r0, [r2, 0x10] - lsls r0, 16 - cmp r0, 0 - bne _080D5728 - adds r0, r6, 0 - bl move_anim_task_del -_080D5728: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D56A4 - - thumb_func_start sub_80D5738 -sub_80D5738: @ 80D5738 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - movs r6, 0x1 - ldr r4, =0x0203841e - ldrb r0, [r4] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r7, r0, 24 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x5 - ble _080D575C - movs r0, 0x5 - strh r0, [r4, 0x8] -_080D575C: - movs r1, 0 - movs r2, 0x8 - ldrsh r0, [r4, r2] - adds r3, r4, 0 - ldr r2, =0x03005e00 - mov r12, r2 - lsls r4, r5, 2 - ldr r2, =sub_80D57B8 - mov r8, r2 - cmp r1, r0 - bge _080D5782 - adds r2, r0, 0 -_080D5774: - lsls r0, r6, 25 - lsrs r6, r0, 24 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, r2 - blt _080D5774 -_080D5782: - adds r0, r4, r5 - lsls r0, 3 - add r0, r12 - strh r7, [r0, 0x8] - ldrh r1, [r3, 0x2] - strh r1, [r0, 0xA] - ldrh r1, [r3, 0x4] - strh r1, [r0, 0xC] - ldrh r1, [r3, 0x6] - strh r1, [r0, 0xE] - strh r6, [r0, 0x10] - mov r1, r8 - str r1, [r0] - adds r0, r5, 0 - bl _call_via_r8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5738 - - thumb_func_start sub_80D57B8 -sub_80D57B8: @ 80D57B8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r1 - ldrb r4, [r5, 0x8] - movs r1, 0x12 - ldrsh r0, [r5, r1] - movs r2, 0xA - ldrsh r1, [r5, r2] - bl sine - ldr r2, =0x02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r4, r1, r2 - strh r0, [r4, 0x24] - movs r1, 0x12 - ldrsh r0, [r5, r1] - movs r2, 0xC - ldrsh r1, [r5, r2] - bl cosine - negs r0, r0 - strh r0, [r4, 0x26] - ldrh r1, [r5, 0xC] - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r5, 0x10] - ldrh r1, [r5, 0x12] - adds r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r5, 0x12] - cmp r0, 0 - bne _080D5810 - ldrh r0, [r5, 0xE] - subs r0, 0x1 - strh r0, [r5, 0xE] -_080D5810: - movs r2, 0xE - ldrsh r0, [r5, r2] - cmp r0, 0 - bne _080D5822 - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - adds r0, r6, 0 - bl move_anim_task_del -_080D5822: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D57B8 - - thumb_func_start sub_80D5830 -sub_80D5830: @ 80D5830 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080D584C - ldr r1, =0x0203841e - ldrh r0, [r1, 0x2] - negs r0, r0 - strh r0, [r1, 0x2] -_080D584C: - adds r0, r4, 0 - bl sub_80D5738 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5830 - - thumb_func_start sub_80D5860 -sub_80D5860: @ 80D5860 - push {r4,lr} - adds r4, r0, 0 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080D5890 - ldr r1, =0x0203841e - ldrh r0, [r1, 0x2] - negs r0, r0 - b _080D5894 - .pool -_080D5890: - ldr r1, =0x0203841e - ldrh r0, [r1, 0x2] -_080D5894: - strh r0, [r4, 0x30] - ldrh r2, [r1] - movs r0, 0 - strh r2, [r4, 0x2E] - strh r0, [r4, 0x32] - ldr r1, =0x020241e4 - ldr r0, =0x02038436 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strh r0, [r4, 0x34] - strh r2, [r4, 0x36] - ldr r1, =sub_80D58D4 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A6630 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5860 - - thumb_func_start sub_80D58D4 -sub_80D58D4: @ 80D58D4 - push {lr} - ldrh r1, [r0, 0x36] - strh r1, [r0, 0x2E] - ldrh r1, [r0, 0x30] - negs r1, r1 - strh r1, [r0, 0x30] - ldr r1, =sub_80A6630 - str r1, [r0, 0x1C] - ldr r1, =move_anim_8072740 - bl oamt_set_x3A_32 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D58D4 - - thumb_func_start sub_80D58F8 -sub_80D58F8: @ 80D58F8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r5, =0x0203841e - ldrb r0, [r5, 0x4] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - ldrh r2, [r5] - movs r1, 0 - strh r2, [r4, 0x2E] - strh r1, [r4, 0x30] - ldrh r1, [r5, 0x2] - strh r1, [r4, 0x32] - strh r0, [r4, 0x34] - strh r2, [r4, 0x36] - ldr r1, =sub_80D5944 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A6630 - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D58F8 - - thumb_func_start sub_80D5944 -sub_80D5944: @ 80D5944 - push {lr} - ldrh r1, [r0, 0x36] - strh r1, [r0, 0x2E] - ldrh r1, [r0, 0x32] - negs r1, r1 - strh r1, [r0, 0x32] - ldr r1, =sub_80A6630 - str r1, [r0, 0x1C] - ldr r1, =move_anim_8072740 - bl oamt_set_x3A_32 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5944 - - thumb_func_start sub_80D5968 -sub_80D5968: @ 80D5968 - push {r4-r7,lr} - sub sp, 0x4 - adds r6, r0, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _080D598C - ldr r1, =0x020241e4 - ldr r0, =0x02038436 - b _080D5990 - .pool -_080D598C: - ldr r1, =0x020241e4 - ldr r0, =0x02038437 -_080D5990: - ldrb r0, [r0] - adds r0, r1 - ldrb r7, [r0] - ldr r5, =0x0203841e - ldrh r0, [r5, 0x4] - movs r3, 0 - strh r0, [r6, 0x2E] - ldr r0, =0x02020630 - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - adds r4, r0 - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r6, 0x30] - ldrh r0, [r4, 0x20] - strh r0, [r6, 0x32] - ldrh r0, [r4, 0x26] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r6, 0x34] - ldrh r0, [r4, 0x22] - strh r0, [r6, 0x36] - adds r0, r6, 0 - str r3, [sp] - bl sub_80A6E14 - ldr r3, [sp] - strh r3, [r6, 0x34] - strh r3, [r6, 0x36] - ldrh r0, [r4, 0x24] - strh r0, [r6, 0x38] - ldrh r0, [r4, 0x26] - strh r0, [r6, 0x3A] - adds r2, r6, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - movs r1, 0x2 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - bne _080D5A00 - strh r3, [r6, 0x32] - b _080D5A06 - .pool -_080D5A00: - cmp r0, 0x2 - bne _080D5A06 - strh r3, [r6, 0x30] -_080D5A06: - ldr r0, =0x0203841e - ldrh r1, [r0, 0x2] - lsls r0, r7, 8 - orrs r0, r1 - strh r0, [r6, 0x3C] - ldr r0, =sub_80D5A24 - str r0, [r6, 0x1C] - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5968 - - thumb_func_start sub_80D5A24 -sub_80D5A24: @ 80D5A24 - push {r4-r6,lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x3C] - lsls r1, r0, 24 - lsrs r4, r1, 24 - adds r5, r4, 0 - lsls r0, 16 - asrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r3, r1, r0 - ldrh r0, [r2, 0x2E] - movs r6, 0x2E - ldrsh r1, [r2, r6] - cmp r1, 0 - bne _080D5A64 - cmp r4, 0x1 - bhi _080D5A4E - strh r1, [r3, 0x24] -_080D5A4E: - cmp r5, 0x2 - beq _080D5A56 - cmp r5, 0 - bne _080D5A58 -_080D5A56: - strh r1, [r3, 0x26] -_080D5A58: - adds r0, r2, 0 - bl move_anim_8072740 - b _080D5A8E - .pool -_080D5A64: - subs r0, 0x1 - strh r0, [r2, 0x2E] - ldrh r1, [r2, 0x30] - ldrh r0, [r2, 0x34] - adds r1, r0 - strh r1, [r2, 0x34] - ldrh r0, [r2, 0x32] - ldrh r4, [r2, 0x36] - adds r0, r4 - strh r0, [r2, 0x36] - lsls r1, 16 - asrs r1, 24 - ldrh r6, [r2, 0x38] - adds r1, r6 - strh r1, [r3, 0x24] - ldrh r0, [r2, 0x36] - lsls r0, 16 - asrs r0, 24 - ldrh r2, [r2, 0x3A] - adds r0, r2 - strh r0, [r3, 0x26] -_080D5A8E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80D5A24 - - thumb_func_start sub_80D5A94 -sub_80D5A94: @ 80D5A94 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _080D5AB0 - ldr r0, =0x02038436 - b _080D5AB2 - .pool -_080D5AB0: - ldr r0, =0x02038437 -_080D5AB2: - ldrb r2, [r0] - ldr r0, =0x020241e4 - adds r0, r2, r0 - ldrb r6, [r0] - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080D5ADC - ldr r1, =0x0203841e - ldrh r0, [r1, 0x2] - negs r0, r0 - strh r0, [r1, 0x2] - movs r2, 0x6 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - bne _080D5ADC - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] -_080D5ADC: - ldr r2, =0x0203841e - ldrh r0, [r2, 0x8] - movs r4, 0 - strh r0, [r5, 0x2E] - ldr r0, =0x02020630 - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x20] - strh r0, [r5, 0x30] - ldrh r0, [r2, 0x2] - ldrh r3, [r1, 0x20] - adds r0, r3 - strh r0, [r5, 0x32] - ldrh r0, [r1, 0x22] - strh r0, [r5, 0x34] - ldrh r0, [r2, 0x4] - ldrh r1, [r1, 0x22] - adds r0, r1 - strh r0, [r5, 0x36] - adds r0, r5, 0 - bl sub_80A6E14 - strh r4, [r5, 0x34] - strh r4, [r5, 0x36] - strh r6, [r5, 0x38] - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r1, =move_anim_8072740 - adds r0, r5, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A6680 - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5A94 - - thumb_func_start sub_80D5B48 -sub_80D5B48: @ 80D5B48 - push {r4-r7,lr} - adds r6, r0, 0 - adds r2, r6, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _080D5B70 - ldr r0, =0x02038436 - b _080D5B72 - .pool -_080D5B70: - ldr r0, =0x02038437 -_080D5B72: - ldrb r1, [r0] - ldr r0, =0x020241e4 - adds r0, r1, r0 - ldrb r7, [r0] - adds r0, r1, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080D5B9C - ldr r1, =0x0203841e - ldrh r0, [r1, 0x2] - negs r0, r0 - strh r0, [r1, 0x2] - movs r2, 0x6 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - bne _080D5B9C - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] -_080D5B9C: - ldr r5, =0x0203841e - ldrh r0, [r5, 0x8] - strh r0, [r6, 0x2E] - ldr r0, =0x02020630 - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - adds r4, r0 - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r6, 0x30] - ldrh r1, [r5, 0x2] - adds r0, r1 - strh r0, [r6, 0x32] - ldrh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r6, 0x34] - ldrh r1, [r5, 0x4] - adds r0, r1 - strh r0, [r6, 0x36] - adds r0, r6, 0 - bl sub_80A6E14 - ldrh r0, [r4, 0x24] - lsls r0, 8 - strh r0, [r6, 0x34] - ldrh r0, [r4, 0x26] - lsls r0, 8 - strh r0, [r6, 0x36] - strh r7, [r6, 0x38] - ldrh r0, [r5, 0xA] - strh r0, [r6, 0x3A] - lsls r0, 16 - cmp r0, 0 - bne _080D5C04 - ldr r1, =move_anim_8072740 - adds r0, r6, 0 - bl oamt_set_x3A_32 - b _080D5C0C - .pool -_080D5C04: - ldr r1, =sub_80D5C20 - adds r0, r6, 0 - bl oamt_set_x3A_32 -_080D5C0C: - ldr r0, =sub_80A6680 - str r0, [r6, 0x1C] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5B48 - - thumb_func_start sub_80D5C20 -sub_80D5C20: @ 80D5C20 - push {r4,lr} - ldr r4, =0x02020630 - movs r1, 0x38 - ldrsh r2, [r0, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - movs r3, 0 - strh r3, [r1, 0x24] - movs r1, 0x38 - ldrsh r2, [r0, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - strh r3, [r1, 0x26] - bl move_anim_8072740 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5C20 - - thumb_func_start sub_80D5C50 -sub_80D5C50: @ 80D5C50 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r5, =0x0203841e - movs r0, 0x6 - ldrsh r1, [r5, r0] - movs r0, 0x80 - lsls r0, 8 - bl __divsi3 - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080D5C82 - ldrh r0, [r5, 0x2] - negs r0, r0 - strh r0, [r5, 0x2] - ldrh r0, [r5, 0xA] - negs r0, r0 - strh r0, [r5, 0xA] -_080D5C82: - ldrb r0, [r5] - bl obj_id_for_side_relative_to_move - ldr r1, =0x03005e00 - lsls r4, r6, 2 - adds r4, r6 - lsls r4, 3 - adds r4, r1 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x8] - movs r1, 0x2 - ldrsh r0, [r5, r1] - lsls r0, 8 - movs r2, 0x6 - ldrsh r1, [r5, r2] - bl __divsi3 - strh r0, [r4, 0xA] - ldrh r0, [r5, 0x4] - strh r0, [r4, 0xC] - ldrh r0, [r5, 0x6] - strh r0, [r4, 0xE] - ldrh r0, [r5, 0x8] - strh r0, [r4, 0x10] - movs r1, 0xA - ldrsh r0, [r5, r1] - lsls r0, 8 - movs r2, 0xC - ldrsh r1, [r5, r2] - bl __divsi3 - strh r0, [r4, 0x12] - ldrh r0, [r5, 0xC] - strh r0, [r4, 0x14] - strh r7, [r4, 0x16] - ldr r0, =sub_80D5CE4 - str r0, [r4] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5C50 - - thumb_func_start sub_80D5CE4 -sub_80D5CE4: @ 80D5CE4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r5, r1, r2 - ldrb r1, [r5, 0x8] - ldrh r0, [r5, 0xA] - ldrh r2, [r5, 0x1E] - adds r0, r2 - strh r0, [r5, 0x1E] - ldr r2, =0x02020630 - lsls r4, r1, 4 - adds r4, r1 - lsls r4, 2 - adds r4, r2 - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - ldrh r0, [r5, 0x1C] - lsrs r0, 8 - movs r2, 0xC - ldrsh r1, [r5, r2] - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r5, 0x16] - ldrh r1, [r5, 0x1C] - adds r0, r1 - strh r0, [r5, 0x1C] - ldrh r0, [r5, 0xE] - subs r0, 0x1 - strh r0, [r5, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _080D5D34 - ldr r0, =sub_80D5D48 - str r0, [r5] -_080D5D34: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5CE4 - - thumb_func_start sub_80D5D48 -sub_80D5D48: @ 80D5D48 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r1, [r4, 0x10] - movs r2, 0x10 - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _080D5D70 - subs r0, r1, 0x1 - strh r0, [r4, 0x10] - b _080D5DA4 - .pool -_080D5D70: - ldrb r0, [r4, 0x8] - ldrh r2, [r4, 0x12] - ldrh r1, [r4, 0x20] - adds r2, r1 - strh r2, [r4, 0x20] - ldr r3, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - lsls r2, 16 - asrs r2, 24 - ldrh r0, [r4, 0x1E] - lsls r0, 16 - asrs r0, 24 - adds r2, r0 - strh r2, [r1, 0x24] - ldrh r0, [r4, 0x14] - subs r0, 0x1 - strh r0, [r4, 0x14] - lsls r0, 16 - cmp r0, 0 - bne _080D5DA4 - adds r0, r5, 0 - bl move_anim_task_del -_080D5DA4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5D48 - - thumb_func_start sub_80D5DB0 -sub_80D5DB0: @ 80D5DB0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x0203841e - movs r2, 0 - ldrsh r0, [r1, r2] - cmp r0, 0x2 - beq _080D5DDE - cmp r0, 0x2 - bgt _080D5DD8 - cmp r0, 0 - blt _080D5E10 - ldrb r0, [r1] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r2, r0, 24 - b _080D5E18 - .pool -_080D5DD8: - cmp r0, 0x3 - beq _080D5DE8 - b _080D5E10 -_080D5DDE: - ldr r5, =0x02038436 - b _080D5DEA - .pool -_080D5DE8: - ldr r5, =0x02038437 -_080D5DEA: - ldrb r0, [r5] - movs r4, 0x2 - eors r0, r4 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080D5E10 - ldr r1, =0x020241e4 - ldrb r0, [r5] - eors r0, r4 - adds r0, r1 - ldrb r2, [r0] - b _080D5E18 - .pool -_080D5E10: - adds r0, r6, 0 - bl move_anim_task_del - b _080D5E58 -_080D5E18: - ldr r1, =0x03005e00 - lsls r4, r6, 2 - adds r0, r4, r6 - lsls r0, 3 - adds r5, r0, r1 - strh r2, [r5, 0x8] - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080D5E44 - ldr r0, =0x0203841e - ldrh r0, [r0, 0x2] - b _080D5E4A - .pool -_080D5E44: - ldr r0, =0x0203841e - ldrh r0, [r0, 0x2] - negs r0, r0 -_080D5E4A: - strh r0, [r5, 0xA] - ldr r0, =0x03005e00 - adds r1, r4, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80D5E6C - str r0, [r1] -_080D5E58: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5DB0 - - thumb_func_start sub_80D5E6C -sub_80D5E6C: @ 80D5E6C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrb r2, [r1, 0x8] - ldr r3, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r1, 0xA] - ldrh r2, [r0, 0x24] - adds r1, r2 - strh r1, [r0, 0x24] - movs r2, 0x24 - ldrsh r1, [r0, r2] - movs r2, 0x20 - ldrsh r0, [r0, r2] - adds r1, r0 - adds r1, 0x20 - movs r0, 0x98 - lsls r0, 1 - cmp r1, r0 - bls _080D5EAA - adds r0, r4, 0 - bl move_anim_task_del -_080D5EAA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5E6C - - thumb_func_start sub_80D5EB8 -sub_80D5EB8: @ 80D5EB8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r6, =0x02038436 - ldrb r0, [r6] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080D5ED4 - ldr r1, =0x0203841e - ldrh r0, [r1, 0x2] - negs r0, r0 - strh r0, [r1, 0x2] -_080D5ED4: - ldr r4, =0x0203841e - ldrb r0, [r4, 0x8] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r3, r5, 2 - adds r1, r3, r5 - lsls r1, 3 - adds r2, r1, r2 - ldrh r1, [r4] - strh r1, [r2, 0x8] - ldrh r1, [r4, 0x2] - strh r1, [r2, 0xA] - ldrh r1, [r4, 0x4] - strh r1, [r2, 0xC] - ldrh r1, [r4, 0x6] - strh r1, [r2, 0xE] - strh r0, [r2, 0x10] - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080D5F14 - ldrb r0, [r6] - b _080D5F18 - .pool -_080D5F14: - ldr r0, =0x02038437 - ldrb r0, [r0] -_080D5F18: - strh r0, [r2, 0x12] - ldr r1, =0x03005e00 - adds r0, r3, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1 - strh r1, [r0, 0x20] - ldr r1, =sub_80D5F3C - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5EB8 - - thumb_func_start sub_80D5F3C -sub_80D5F3C: @ 80D5F3C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r1 - ldrb r7, [r4, 0x10] - ldrh r0, [r4, 0xC] - ldrh r1, [r4, 0x1C] - adds r0, r1 - lsls r1, r0, 16 - strh r0, [r4, 0x1C] - lsrs r1, 24 - mov r8, r1 - mov r0, r8 - movs r2, 0xA - ldrsh r1, [r4, r2] - bl sine - lsls r0, 16 - lsrs r5, r0, 16 - mov r9, r5 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080D5F94 - ldr r0, =0x02020630 - lsls r2, r7, 4 - adds r1, r2, r7 - lsls r1, 2 - adds r1, r0 - strh r5, [r1, 0x24] - mov r9, r0 - adds r4, r2, 0 - b _080D5FDA - .pool -_080D5F94: - ldrb r0, [r4, 0x12] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080D5FBC - ldr r1, =0x02020630 - lsls r2, r7, 4 - adds r0, r2, r7 - lsls r0, 2 - adds r3, r0, r1 - lsls r0, r5, 16 - asrs r0, 16 - mov r9, r1 - adds r4, r2, 0 - cmp r0, 0 - bge _080D5FD8 - b _080D5FD6 - .pool -_080D5FBC: - ldr r1, =0x02020630 - lsls r2, r7, 4 - adds r0, r2, r7 - lsls r0, 2 - adds r3, r0, r1 - mov r4, r9 - lsls r0, r4, 16 - asrs r0, 16 - mov r9, r1 - adds r4, r2, 0 - cmp r0, 0 - bge _080D5FD6 - negs r0, r0 -_080D5FD6: - negs r0, r0 -_080D5FD8: - strh r0, [r3, 0x26] -_080D5FDA: - mov r5, r8 - cmp r5, 0x7F - bls _080D5FFC - ldr r1, =0x03005e00 - lsls r2, r6, 2 - adds r0, r2, r6 - lsls r0, 3 - adds r3, r0, r1 - movs r5, 0x1E - ldrsh r0, [r3, r5] - adds r5, r1, 0 - cmp r0, 0 - bne _080D5FFC - movs r1, 0x20 - ldrsh r0, [r3, r1] - cmp r0, 0x1 - beq _080D601E -_080D5FFC: - mov r2, r8 - cmp r2, 0x7E - bhi _080D6050 - ldr r1, =0x03005e00 - lsls r2, r6, 2 - adds r0, r2, r6 - lsls r0, 3 - adds r3, r0, r1 - movs r5, 0x1E - ldrsh r0, [r3, r5] - adds r5, r1, 0 - cmp r0, 0x1 - bne _080D6050 - movs r1, 0x20 - ldrsh r0, [r3, r1] - cmp r0, 0 - bne _080D6050 -_080D601E: - adds r1, r2, r6 - lsls r1, 3 - adds r1, r5 - ldrh r0, [r1, 0x1E] - movs r2, 0x1 - eors r0, r2 - strh r0, [r1, 0x1E] - ldrh r0, [r1, 0x20] - eors r0, r2 - strh r0, [r1, 0x20] - ldrh r0, [r1, 0xE] - subs r0, 0x1 - strh r0, [r1, 0xE] - lsls r0, 16 - asrs r3, r0, 16 - cmp r3, 0 - bne _080D6050 - adds r0, r4, r7 - lsls r0, 2 - add r0, r9 - strh r3, [r0, 0x24] - strh r3, [r0, 0x26] - adds r0, r6, 0 - bl move_anim_task_del -_080D6050: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D5F3C - - thumb_func_start sub_80D6064 -sub_80D6064: @ 80D6064 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r6, =0x0203841e - ldrb r0, [r6, 0x6] - bl obj_id_for_side_relative_to_move - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldrb r1, [r6, 0x8] - adds r0, r5, 0 - bl sub_80A7270 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r6] - strh r1, [r0, 0x8] - ldrh r1, [r6, 0x2] - strh r1, [r0, 0xA] - ldrh r1, [r6, 0x4] - strh r1, [r0, 0xC] - ldrh r1, [r6, 0x4] - strh r1, [r0, 0xE] - strh r5, [r0, 0x10] - movs r1, 0x80 - lsls r1, 1 - strh r1, [r0, 0x1C] - strh r1, [r0, 0x1E] - ldr r1, =sub_80D60BC - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D6064 - - thumb_func_start sub_80D60BC -sub_80D60BC: @ 80D60BC - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x8] - ldrh r1, [r4, 0x1C] - adds r0, r1 - strh r0, [r4, 0x1C] - ldrh r0, [r4, 0xA] - ldrh r3, [r4, 0x1E] - adds r0, r3 - strh r0, [r4, 0x1E] - ldrb r0, [r4, 0x10] - adds r6, r0, 0 - movs r0, 0x1C - ldrsh r1, [r4, r0] - movs r3, 0x1E - ldrsh r2, [r4, r3] - adds r0, r6, 0 - movs r3, 0 - bl obj_id_set_rotscale - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0 - bne _080D612C - ldrh r2, [r4, 0xE] - movs r3, 0xE - ldrsh r0, [r4, r3] - cmp r0, 0 - ble _080D6120 - ldrh r0, [r4, 0x8] - negs r0, r0 - strh r0, [r4, 0x8] - ldrh r0, [r4, 0xA] - negs r0, r0 - strh r0, [r4, 0xA] - strh r2, [r4, 0xC] - strh r1, [r4, 0xE] - b _080D612C - .pool -_080D6120: - adds r0, r6, 0 - bl sub_80A7344 - adds r0, r5, 0 - bl move_anim_task_del -_080D612C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80D60BC - - thumb_func_start sub_80D6134 -sub_80D6134: @ 80D6134 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =0x0203841e - ldrb r0, [r4, 0x4] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r1, 0 - bl sub_80A7270 - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r2, r0, r1 - movs r1, 0 - strh r1, [r2, 0xA] - ldrh r0, [r4] - strh r0, [r2, 0xC] - movs r3, 0x6 - ldrsh r0, [r4, r3] - cmp r0, 0x1 - beq _080D6178 - strh r1, [r2, 0xE] - b _080D6184 - .pool -_080D6178: - ldrh r0, [r4] - ldrh r1, [r4, 0x2] - adds r3, r0, 0 - muls r3, r1 - adds r0, r3, 0 - strh r0, [r2, 0xE] -_080D6184: - ldr r1, =0x03005e00 - lsls r4, r7, 2 - adds r0, r4, r7 - lsls r0, 3 - adds r5, r0, r1 - ldr r6, =0x0203841e - ldrh r0, [r6, 0x2] - strh r0, [r5, 0x10] - mov r0, r8 - strh r0, [r5, 0x12] - ldrh r0, [r6, 0x6] - strh r0, [r5, 0x14] - bl sub_80A4DF0 - lsls r0, 24 - mov r8, r4 - cmp r0, 0 - beq _080D61B8 - movs r0, 0x1 - strh r0, [r5, 0x16] - b _080D61DC - .pool -_080D61B8: - movs r1, 0x4 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _080D61C8 - ldr r0, =0x02038436 - b _080D61CA - .pool -_080D61C8: - ldr r0, =0x02038437 -_080D61CA: - ldrb r0, [r0] - bl battle_side_get_owner - movs r1, 0 - lsls r0, 24 - cmp r0, 0 - bne _080D61DA - movs r1, 0x1 -_080D61DA: - strh r1, [r5, 0x16] -_080D61DC: - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r4, r1, r0 - movs r3, 0x16 - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _080D6208 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080D6208 - movs r1, 0xE - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0xE] - movs r2, 0x10 - ldrsh r0, [r4, r2] - negs r0, r0 - strh r0, [r4, 0x10] -_080D6208: - ldr r0, =0x03005e00 - mov r3, r8 - adds r1, r3, r7 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80D6308 - str r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D6134 - - thumb_func_start sub_80D622C -sub_80D622C: @ 80D622C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x0203841e - ldrb r0, [r4, 0x4] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r1, 0 - bl sub_80A7270 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0xA] - ldrh r1, [r4] - strh r1, [r0, 0xC] - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080D6274 - ldr r0, =0x02038436 - b _080D6276 - .pool -_080D6274: - ldr r0, =0x02038437 -_080D6276: - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080D6288 - ldrh r0, [r4, 0x2] - negs r0, r0 - strh r0, [r4, 0x2] -_080D6288: - ldr r0, =0x0203841e - movs r2, 0x6 - ldrsh r1, [r0, r2] - adds r6, r0, 0 - cmp r1, 0x1 - beq _080D62B0 - ldr r2, =0x03005e00 - lsls r3, r5, 2 - adds r0, r3, r5 - lsls r0, 3 - adds r0, r2 - movs r1, 0 - strh r1, [r0, 0xE] - b _080D62CA - .pool -_080D62B0: - ldr r3, =0x03005e00 - lsls r4, r5, 2 - adds r0, r4, r5 - lsls r0, 3 - adds r0, r3 - ldrh r2, [r6] - ldrh r1, [r6, 0x2] - adds r7, r2, 0 - muls r7, r1 - adds r1, r7, 0 - strh r1, [r0, 0xE] - adds r2, r3, 0 - adds r3, r4, 0 -_080D62CA: - adds r1, r3, r5 - lsls r1, 3 - adds r1, r2 - ldrh r0, [r6, 0x2] - strh r0, [r1, 0x10] - mov r0, r8 - strh r0, [r1, 0x12] - ldrh r0, [r6, 0x6] - strh r0, [r1, 0x14] - movs r0, 0x1 - strh r0, [r1, 0x16] - movs r2, 0xE - ldrsh r0, [r1, r2] - negs r0, r0 - strh r0, [r1, 0xE] - movs r7, 0x10 - ldrsh r0, [r1, r7] - negs r0, r0 - strh r0, [r1, 0x10] - ldr r0, =sub_80D6308 - str r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D622C - - thumb_func_start sub_80D6308 -sub_80D6308: @ 80D6308 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x10] - ldrh r1, [r4, 0xE] - adds r0, r1 - strh r0, [r4, 0xE] - ldrb r0, [r4, 0x12] - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0xE] - adds r1, r2, 0 - bl obj_id_set_rotscale - movs r2, 0x16 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _080D633C - ldrb r0, [r4, 0x12] - bl sub_80A73A0 -_080D633C: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r2, 0xC - ldrsh r1, [r4, r2] - cmp r0, r1 - blt _080D6382 - movs r1, 0x14 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080D6364 - cmp r0, 0x1 - ble _080D636A - cmp r0, 0x2 - beq _080D6372 - b _080D636A - .pool -_080D6364: - ldrb r0, [r4, 0x12] - bl sub_80A7344 -_080D636A: - adds r0, r5, 0 - bl move_anim_task_del - b _080D6382 -_080D6372: - movs r0, 0 - strh r0, [r4, 0xA] - movs r2, 0x10 - ldrsh r0, [r4, r2] - negs r0, r0 - strh r0, [r4, 0x10] - movs r0, 0x1 - strh r0, [r4, 0x14] -_080D6382: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80D6308 - - thumb_func_start sub_80D6388 -sub_80D6388: @ 80D6388 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x0203841e - movs r2, 0 - ldrsh r1, [r0, r2] - mov r8, r0 - cmp r1, 0 - bne _080D63C0 - ldr r4, =0x03005e00 - lsls r5, r7, 2 - adds r0, r5, r7 - lsls r0, 3 - adds r6, r0, r4 - ldr r0, =0x02038408 - ldrh r0, [r0] - movs r1, 0xC - bl __udivsi3 - b _080D63D4 - .pool -_080D63C0: - ldr r4, =0x03005e00 - lsls r5, r7, 2 - adds r0, r5, r7 - lsls r0, 3 - adds r6, r0, r4 - ldr r0, =0x02038404 - ldr r0, [r0] - movs r1, 0xC - bl __divsi3 -_080D63D4: - strh r0, [r6, 0x26] - lsls r0, 16 - adds r1, r4, 0 - cmp r0, 0 - bgt _080D63E2 - movs r0, 0x1 - strh r0, [r6, 0x26] -_080D63E2: - movs r2, 0x26 - ldrsh r0, [r6, r2] - cmp r0, 0x10 - ble _080D63EE - movs r0, 0x10 - strh r0, [r6, 0x26] -_080D63EE: - adds r4, r5, r7 - lsls r4, 3 - adds r4, r1 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsrs r0, r1, 31 - adds r1, r0 - asrs r1, 1 - movs r5, 0 - strh r1, [r4, 0x24] - ldrh r2, [r4, 0x26] - movs r0, 0x1 - ands r0, r2 - adds r1, r0 - strh r1, [r4, 0x22] - strh r5, [r4, 0x20] - mov r1, r8 - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x1C] - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x1E] - movs r0, 0x1 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x16] - ldr r2, =0x02020630 - movs r0, 0x16 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x24] - strh r0, [r4, 0x18] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x26] - strh r0, [r4, 0x1A] - strh r5, [r4, 0x8] - mov r1, r8 - ldrh r0, [r1, 0x2] - strh r0, [r4, 0xA] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0xC] - ldr r0, =sub_80D646C - str r0, [r4] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D6388 - - thumb_func_start sub_80D646C -sub_80D646C: @ 80D646C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r3, r0, r1 - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] - lsls r0, 16 - asrs r0, 16 - movs r2, 0xA - ldrsh r1, [r3, r2] - cmp r0, r1 - ble _080D654A - movs r0, 0 - strh r0, [r3, 0x8] - ldrh r0, [r3, 0x20] - adds r1, r0, 0x1 - movs r0, 0x1 - ands r1, r0 - strh r1, [r3, 0x20] - movs r2, 0x1C - ldrsh r0, [r3, r2] - cmp r0, 0 - beq _080D64DE - cmp r1, 0 - beq _080D64C8 - ldr r2, =0x02020630 - movs r0, 0x16 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r3, 0x22] - ldrh r2, [r3, 0x18] - adds r1, r2 - b _080D64DC - .pool -_080D64C8: - ldr r2, =0x02020630 - movs r0, 0x16 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r3, 0x18] - ldrh r2, [r3, 0x24] - subs r1, r2 -_080D64DC: - strh r1, [r0, 0x24] -_080D64DE: - movs r1, 0x1E - ldrsh r0, [r3, r1] - cmp r0, 0 - beq _080D6518 - movs r2, 0x20 - ldrsh r4, [r3, r2] - cmp r4, 0 - beq _080D6508 - ldr r2, =0x02020630 - movs r0, 0x16 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r3, 0x26] - strh r1, [r0, 0x26] - b _080D6518 - .pool -_080D6508: - ldr r2, =0x02020630 - movs r0, 0x16 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r4, [r0, 0x26] -_080D6518: - ldrh r0, [r3, 0xC] - subs r0, 0x1 - strh r0, [r3, 0xC] - lsls r0, 16 - asrs r4, r0, 16 - cmp r4, 0 - bne _080D654A - ldr r2, =0x02020630 - movs r0, 0x16 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r4, [r0, 0x24] - movs r0, 0x16 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r4, [r0, 0x26] - adds r0, r5, 0 - bl move_anim_task_del -_080D654A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D646C - - thumb_func_start decrypt_bag_item_quantity -decrypt_bag_item_quantity: @ 80D6554 - adds r1, r0, 0 - ldr r0, =0x03005d90 - ldr r0, [r0] - adds r0, 0xAC - ldr r0, [r0] - ldrh r1, [r1] - eors r0, r1 - lsls r0, 16 - lsrs r0, 16 - bx lr - .pool - thumb_func_end decrypt_bag_item_quantity - - thumb_func_start encrypt_bag_item_quantity -encrypt_bag_item_quantity: @ 80D656C - lsls r1, 16 - lsrs r1, 16 - ldr r2, =0x03005d90 - ldr r2, [r2] - adds r2, 0xAC - ldr r2, [r2] - eors r1, r2 - strh r1, [r0] - bx lr - .pool - thumb_func_end encrypt_bag_item_quantity - - thumb_func_start sub_80D6584 -sub_80D6584: @ 80D6584 - ldrh r0, [r0] - bx lr - thumb_func_end sub_80D6584 - - thumb_func_start sub_80D6588 -sub_80D6588: @ 80D6588 - strh r1, [r0] - bx lr - thumb_func_end sub_80D6588 - - thumb_func_start encrypt_decrypt_all_item_quantities -encrypt_decrypt_all_item_quantities: @ 80D658C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - mov r8, r0 - movs r1, 0 - ldr r0, =0x02039dd8 - mov r9, r0 -_080D659E: - movs r6, 0 - lsls r5, r1, 3 - mov r2, r9 - adds r0, r5, r2 - adds r7, r1, 0x1 - ldrb r0, [r0, 0x4] - cmp r6, r0 - bcs _080D65CC - ldr r2, =0x02039dd8 -_080D65B0: - adds r4, r5, r2 - lsls r1, r6, 2 - ldr r0, [r4] - adds r0, r1 - adds r0, 0x2 - mov r1, r8 - str r2, [sp] - bl apply_u16_xor_crypto - adds r6, 0x1 - ldr r2, [sp] - ldrb r4, [r4, 0x4] - cmp r6, r4 - bcc _080D65B0 -_080D65CC: - adds r1, r7, 0 - cmp r1, 0x4 - bls _080D659E - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end encrypt_decrypt_all_item_quantities - - thumb_func_start call_encrypt_decrypt_all_item_quantities -call_encrypt_decrypt_all_item_quantities: @ 80D65E4 - push {lr} - bl encrypt_decrypt_all_item_quantities - pop {r0} - bx r0 - thumb_func_end call_encrypt_decrypt_all_item_quantities - - thumb_func_start init_bag_pockets -@ void init_bag_pockets() -init_bag_pockets: @ 80D65F0 - push {r4,lr} - ldr r1, =0x02039dd8 - ldr r0, =0x03005d8c - ldr r2, [r0] - movs r3, 0xAC - lsls r3, 3 - adds r0, r2, r3 - str r0, [r1] - movs r3, 0x1E - strb r3, [r1, 0x4] - movs r4, 0xBB - lsls r4, 3 - adds r0, r2, r4 - str r0, [r1, 0x20] - adds r0, r1, 0 - adds r0, 0x24 - strb r3, [r0] - movs r3, 0xCA - lsls r3, 3 - adds r0, r2, r3 - str r0, [r1, 0x8] - movs r0, 0x10 - strb r0, [r1, 0xC] - adds r4, 0xB8 - adds r0, r2, r4 - str r0, [r1, 0x10] - movs r0, 0x40 - strb r0, [r1, 0x14] - movs r0, 0xF2 - lsls r0, 3 - adds r2, r0 - str r2, [r1, 0x18] - movs r0, 0x2E - strb r0, [r1, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end init_bag_pockets - - thumb_func_start itemid_get_name -@ void itemid_get_name(int item_id, char *dest) -itemid_get_name: @ 80D6644 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 16 - lsrs r0, 16 - bl itemid_get_item - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - pop {r4} - pop {r0} - bx r0 - thumb_func_end itemid_get_name - - thumb_func_start sub_80D6660 -sub_80D6660: @ 80D6660 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 16 - lsrs r3, r0, 16 - adds r1, r3, 0 - cmp r3, 0x4 - bne _080D668C - cmp r2, 0x1 - bhi _080D667C - movs r0, 0x4 - bl itemid_get_item - adds r1, r0, 0 - b _080D667E -_080D667C: - ldr r1, =gUnknown_085EFCD4 -_080D667E: - adds r0, r4, 0 - bl CopyString - b _080D66BE - .pool -_080D668C: - adds r0, r3, 0 - subs r0, 0x85 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2A - bhi _080D66B0 - lsls r1, r3, 3 - subs r1, r3 - lsls r1, 2 - ldr r0, =gUnknown_085897E4 - adds r1, r0 - adds r0, r4, 0 - bl GetBerryCountString - b _080D66BE - .pool -_080D66B0: - adds r0, r1, 0 - bl itemid_get_item - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString -_080D66BE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80D6660 - - thumb_func_start GetBerryCountString -@ void GetBerryCountString(struct berry_info *berryInfo, u8 *dest, u32 berryCount) -GetBerryCountString: @ 80D66C4 - push {r4,lr} - ldr r4, =gUnknown_085EFCE5 - cmp r2, 0x1 - bhi _080D66CE - ldr r4, =gUnknown_085EFCDF -_080D66CE: - bl CopyString - movs r1, 0 - strb r1, [r0] - adds r0, 0x1 - adds r1, r4, 0 - bl CopyString - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end GetBerryCountString - - thumb_func_start IsBagPocketNonEmpty -@ bool8 IsBagPocketNonEmpty(u8 pocketId) -IsBagPocketNonEmpty: @ 80D66EC - push {lr} - lsls r0, 24 - movs r2, 0 - ldr r1, =0x02039dd8 - lsrs r0, 21 - subs r0, 0x8 - adds r0, r1 - ldrb r1, [r0, 0x4] - cmp r2, r1 - bcs _080D671E - ldr r3, [r0] -_080D6702: - lsls r0, r2, 2 - adds r0, r3 - ldrh r0, [r0] - cmp r0, 0 - beq _080D6714 - movs r0, 0x1 - b _080D6720 - .pool -_080D6714: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r1 - bcc _080D6702 -_080D671E: - movs r0, 0 -_080D6720: - pop {r1} - bx r1 - thumb_func_end IsBagPocketNonEmpty - - thumb_func_start sub_80D6724 -sub_80D6724: @ 80D6724 - push {r4-r7,lr} - lsls r0, 16 - lsrs r7, r0, 16 - lsls r1, 16 - lsrs r5, r1, 16 - adds r0, r7, 0 - bl itemid_get_pocket_number - lsls r0, 24 - cmp r0, 0 - beq _080D67B6 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _080D6752 - ldr r0, =0x00004004 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080D6768 -_080D6752: - adds r0, r7, 0 - adds r1, r5, 0 - bl sub_80D710C - lsls r0, 24 - lsrs r0, 24 - b _080D67B8 - .pool -_080D6764: - movs r0, 0x1 - b _080D67B8 -_080D6768: - adds r0, r7, 0 - bl itemid_get_pocket_number - subs r0, 0x1 - lsls r0, 24 - movs r6, 0 - ldr r1, =0x02039dd8 - lsrs r4, r0, 21 - b _080D67AE - .pool -_080D6780: - adds r0, r4, r1 - ldr r1, [r0] - lsls r0, r6, 2 - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, r7 - bne _080D67A6 - adds r0, r1, 0x2 - bl decrypt_bag_item_quantity - lsls r0, 16 - lsrs r0, 16 - cmp r0, r5 - bcs _080D6764 - subs r0, r5, r0 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - beq _080D6764 -_080D67A6: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x02039dd8 -_080D67AE: - adds r0, r4, r1 - ldrb r0, [r0, 0x4] - cmp r6, r0 - bcc _080D6780 -_080D67B6: - movs r0, 0 -_080D67B8: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D6724 - - thumb_func_start sub_80D67C4 -sub_80D67C4: @ 80D67C4 - push {r4,lr} - movs r4, 0x85 -_080D67C8: - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80D6724 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1 - bne _080D67E4 - ldr r0, =0x020375f0 - strh r1, [r0] - movs r0, 0x1 - b _080D67F6 - .pool -_080D67E4: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0xB2 - bls _080D67C8 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - movs r0, 0 -_080D67F6: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D67C4 - - thumb_func_start sub_80D6800 -sub_80D6800: @ 80D6800 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 16 - lsrs r5, r1, 16 - bl itemid_get_pocket_number - lsls r0, 24 - cmp r0, 0 - beq _080D6906 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _080D6838 - ldr r0, =0x00004004 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080D684C -_080D6838: - mov r0, r8 - adds r1, r5, 0 - bl sub_80D7184 - lsls r0, 24 - lsrs r0, 24 - b _080D6916 - .pool -_080D684C: - mov r0, r8 - bl itemid_get_pocket_number - subs r0, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r7, =0x000003e7 - cmp r2, 0x3 - beq _080D6860 - movs r7, 0x63 -_080D6860: - movs r6, 0 - ldr r1, =0x02039dd8 - lsls r4, r2, 3 - adds r0, r4, r1 - mov r9, r4 - ldrb r0, [r0, 0x4] - cmp r6, r0 - bcs _080D68BC - subs r0, r2, 0x2 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 -_080D6878: - adds r0, r4, r1 - ldr r1, [r0] - lsls r0, r6, 2 - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, r8 - bne _080D68AC - adds r0, r1, 0x2 - str r2, [sp] - bl decrypt_bag_item_quantity - lsls r0, 16 - lsrs r1, r0, 16 - adds r0, r1, r5 - ldr r2, [sp] - cmp r0, r7 - ble _080D6914 - mov r0, r10 - cmp r0, 0x1 - bls _080D6906 - subs r0, r7, r1 - subs r0, r5, r0 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - beq _080D6914 -_080D68AC: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x02039dd8 - adds r0, r4, r1 - ldrb r0, [r0, 0x4] - cmp r6, r0 - bcc _080D6878 -_080D68BC: - cmp r5, 0 - beq _080D6914 - movs r6, 0 - ldr r3, =0x02039dd8 - mov r1, r9 - adds r0, r1, r3 - ldrb r0, [r0, 0x4] - cmp r6, r0 - bcs _080D6902 - adds r4, r3, 0 - subs r0, r2, 0x2 - lsls r0, 24 - lsrs r2, r0, 24 -_080D68D6: - adds r0, r1, r4 - ldr r1, [r0] - lsls r0, r6, 2 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - bne _080D68F2 - cmp r5, r7 - bls _080D6914 - cmp r2, 0x1 - bls _080D6906 - subs r0, r5, r7 - lsls r0, 16 - lsrs r5, r0, 16 -_080D68F2: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - mov r1, r9 - adds r0, r1, r3 - ldrb r0, [r0, 0x4] - cmp r6, r0 - bcc _080D68D6 -_080D6902: - cmp r5, 0 - beq _080D6914 -_080D6906: - movs r0, 0 - b _080D6916 - .pool -_080D6914: - movs r0, 0x1 -_080D6916: - 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_80D6800 - - thumb_func_start bag_add_item -@ int bag_add_item(int item_id, int quantity) -bag_add_item: @ 80D6928 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - lsls r1, 16 - lsrs r5, r1, 16 - bl itemid_get_pocket_number - lsls r0, 24 - cmp r0, 0 - bne _080D694C - movs r0, 0 - b _080D6A92 -_080D694C: - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _080D6964 - ldr r0, =0x00004004 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080D6978 -_080D6964: - mov r0, r9 - adds r1, r5, 0 - bl sub_80D7204 - lsls r0, 24 - lsrs r0, 24 - b _080D6A92 - .pool -_080D6978: - mov r0, r9 - bl itemid_get_pocket_number - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r1, r0, 3 - ldr r0, =0x02039dd8 - adds r7, r1, r0 - ldrb r0, [r7, 0x4] - lsls r0, 2 - bl AllocZeroed - mov r8, r0 - ldr r1, [r7] - ldrb r2, [r7, 0x4] - lsls r2, 2 - bl memcpy - ldr r2, =0x000003e7 - mov r0, r10 - cmp r0, 0x3 - beq _080D69AA - movs r2, 0x63 -_080D69AA: - movs r6, 0 - ldrb r0, [r7, 0x4] - cmp r6, r0 - bcs _080D6A06 - mov r0, r10 - subs r0, 0x2 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] -_080D69BC: - lsls r0, r6, 2 - mov r3, r8 - adds r1, r0, r3 - ldrh r0, [r1] - cmp r0, r9 - bne _080D69FA - adds r4, r1, 0x2 - adds r0, r4, 0 - str r2, [sp, 0x4] - bl decrypt_bag_item_quantity - lsls r0, 16 - lsrs r0, 16 - adds r1, r0, r5 - ldr r2, [sp, 0x4] - cmp r1, r2 - ble _080D6A68 - ldr r1, [sp] - cmp r1, 0x1 - bls _080D6A74 - subs r0, r2, r0 - subs r0, r5, r0 - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - adds r1, r2, 0 - bl encrypt_bag_item_quantity - ldr r2, [sp, 0x4] - cmp r5, 0 - beq _080D6A7E -_080D69FA: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r0, [r7, 0x4] - cmp r6, r0 - bcc _080D69BC -_080D6A06: - cmp r5, 0 - beq _080D6A7E - movs r6, 0 - cmp r6, r0 - bcs _080D6A62 - mov r0, r10 - subs r0, 0x2 - lsls r0, 24 - lsrs r4, r0, 24 -_080D6A18: - lsls r0, r6, 2 - mov r3, r8 - adds r1, r0, r3 - ldrh r0, [r1] - cmp r0, 0 - bne _080D6A56 - mov r0, r9 - strh r0, [r1] - cmp r5, r2 - bhi _080D6A40 - adds r0, r1, 0x2 - adds r1, r5, 0 - bl encrypt_bag_item_quantity - b _080D6A7E - .pool -_080D6A40: - cmp r4, 0x1 - bls _080D6A74 - subs r0, r5, r2 - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r1, 0x2 - adds r1, r2, 0 - str r2, [sp, 0x4] - bl encrypt_bag_item_quantity - ldr r2, [sp, 0x4] -_080D6A56: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r1, [r7, 0x4] - cmp r6, r1 - bcc _080D6A18 -_080D6A62: - cmp r5, 0 - beq _080D6A7E - b _080D6A74 -_080D6A68: - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl encrypt_bag_item_quantity - b _080D6A7E -_080D6A74: - mov r0, r8 - bl Free - movs r0, 0 - b _080D6A92 -_080D6A7E: - ldr r0, [r7] - ldrb r2, [r7, 0x4] - lsls r2, 2 - mov r1, r8 - bl memcpy - mov r0, r8 - bl Free - movs r0, 0x1 -_080D6A92: - 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 bag_add_item - - thumb_func_start remove_item -@ pokescrcmd -remove_item: @ 80D6AA4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 16 - lsrs r7, r1, 16 - movs r4, 0 - bl itemid_get_pocket_number - lsls r0, 24 - cmp r0, 0 - beq _080D6B38 - mov r0, r8 - cmp r0, 0 - beq _080D6B38 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _080D6AE0 - ldr r0, =0x00004004 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080D6AF4 -_080D6AE0: - mov r0, r8 - adds r1, r7, 0 - bl sub_80D7334 - lsls r0, 24 - lsrs r0, 24 - b _080D6C5A - .pool -_080D6AF4: - mov r0, r8 - bl itemid_get_pocket_number - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r1, r0, 3 - ldr r0, =0x02039dd8 - adds r5, r1, r0 - movs r6, 0 - ldrb r2, [r5, 0x4] - cmp r6, r2 - bcs _080D6B34 -_080D6B10: - ldr r0, [r5] - lsls r1, r6, 2 - adds r1, r0 - ldrh r0, [r1] - cmp r0, r8 - bne _080D6B28 - adds r0, r1, 0x2 - bl decrypt_bag_item_quantity - adds r0, r4, r0 - lsls r0, 16 - lsrs r4, r0, 16 -_080D6B28: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r0, [r5, 0x4] - cmp r6, r0 - bcc _080D6B10 -_080D6B34: - cmp r4, r7 - bcs _080D6B40 -_080D6B38: - movs r0, 0 - b _080D6C5A - .pool -_080D6B40: - bl CurrentMapIsSecretBase - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080D6B70 - ldr r4, =0x000040ee - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 2 - adds r0, r2, 0 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet - ldr r0, =0x000040ed - mov r1, r8 - bl VarSet -_080D6B70: - mov r0, r9 - bl sub_81ABB2C - lsls r0, 24 - lsrs r1, r0, 24 - ldrb r0, [r5, 0x4] - cmp r0, r1 - bls _080D6BE6 - ldr r0, [r5] - lsls r1, 2 - adds r2, r1, r0 - ldrh r0, [r2] - adds r4, r1, 0 - cmp r0, r8 - bne _080D6BE6 - adds r0, r2, 0x2 - bl decrypt_bag_item_quantity - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r7 - bcc _080D6BB8 - ldr r0, [r5] - adds r0, r4 - adds r0, 0x2 - subs r1, r7 - lsls r1, 16 - lsrs r1, 16 - bl encrypt_bag_item_quantity - movs r7, 0 - b _080D6BCA - .pool -_080D6BB8: - subs r0, r7, r1 - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, [r5] - adds r0, r4 - adds r0, 0x2 - movs r1, 0 - bl encrypt_bag_item_quantity -_080D6BCA: - ldr r0, [r5] - adds r0, r4 - adds r0, 0x2 - bl decrypt_bag_item_quantity - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0 - bne _080D6BE2 - ldr r0, [r5] - adds r0, r4, r0 - strh r2, [r0] -_080D6BE2: - cmp r7, 0 - beq _080D6C58 -_080D6BE6: - movs r6, 0 - ldrb r0, [r5, 0x4] - cmp r6, r0 - bcs _080D6C58 -_080D6BEE: - ldr r0, [r5] - lsls r1, r6, 2 - adds r2, r1, r0 - ldrh r0, [r2] - adds r4, r1, 0 - cmp r0, r8 - bne _080D6C4C - adds r0, r2, 0x2 - bl decrypt_bag_item_quantity - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r7 - bcc _080D6C1E - ldr r0, [r5] - adds r0, r4 - adds r0, 0x2 - subs r1, r7 - lsls r1, 16 - lsrs r1, 16 - bl encrypt_bag_item_quantity - movs r7, 0 - b _080D6C30 -_080D6C1E: - subs r0, r7, r1 - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, [r5] - adds r0, r4 - adds r0, 0x2 - movs r1, 0 - bl encrypt_bag_item_quantity -_080D6C30: - ldr r0, [r5] - adds r0, r4 - adds r0, 0x2 - bl decrypt_bag_item_quantity - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0 - bne _080D6C48 - ldr r0, [r5] - adds r0, r4, r0 - strh r2, [r0] -_080D6C48: - cmp r7, 0 - beq _080D6C58 -_080D6C4C: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r2, [r5, 0x4] - cmp r6, r2 - bcc _080D6BEE -_080D6C58: - movs r0, 0x1 -_080D6C5A: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end remove_item - - thumb_func_start sub_80D6C68 -sub_80D6C68: @ 80D6C68 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl itemid_get_pocket_number - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_80D6C68 - - thumb_func_start sub_80D6C7C -sub_80D6C7C: @ 80D6C7C - push {r4-r7,lr} - adds r6, r0, 0 - lsls r1, 24 - movs r4, 0 - lsrs r1, 24 - cmp r4, r1 - bcs _080D6CA6 - adds r5, r1, 0 - movs r7, 0 -_080D6C8E: - lsls r0, r4, 2 - adds r0, r6 - strh r7, [r0] - adds r0, 0x2 - movs r1, 0 - bl encrypt_bag_item_quantity - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r5 - bcc _080D6C8E -_080D6CA6: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80D6C7C - - thumb_func_start sub_80D6CAC -sub_80D6CAC: @ 80D6CAC - push {lr} - movs r1, 0 - ldr r0, =0x03005d8c - ldr r2, [r0] - movs r3, 0x93 - lsls r3, 3 -_080D6CB8: - lsls r0, r1, 24 - asrs r1, r0, 24 - lsls r0, r1, 2 - adds r0, r2, r0 - adds r0, r3 - ldrh r0, [r0] - cmp r0, 0 - bne _080D6CD0 - adds r0, r1, 0 - b _080D6CE0 - .pool -_080D6CD0: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - asrs r0, 24 - cmp r0, 0x31 - ble _080D6CB8 - movs r0, 0x1 - negs r0, r0 -_080D6CE0: - pop {r1} - bx r1 - thumb_func_end sub_80D6CAC - - thumb_func_start sub_80D6CE4 -sub_80D6CE4: @ 80D6CE4 - push {r4,lr} - movs r2, 0 - movs r1, 0 - ldr r0, =0x03005d8c - ldr r3, [r0] - movs r4, 0x93 - lsls r4, 3 -_080D6CF2: - lsls r0, r1, 2 - adds r0, r3, r0 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0 - beq _080D6D04 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_080D6D04: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x31 - bls _080D6CF2 - adds r0, r2, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D6CE4 - - thumb_func_start sub_80D6D1C -sub_80D6D1C: @ 80D6D1C - push {r4-r6,lr} - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 16 - lsrs r5, r1, 16 - movs r4, 0 -_080D6D28: - ldr r0, =0x03005d8c - ldr r2, [r0] - lsls r1, r4, 2 - adds r0, r2, r1 - movs r3, 0x93 - lsls r3, 3 - adds r0, r3 - ldrh r0, [r0] - cmp r0, r6 - bne _080D6D5C - adds r0, r1, r2 - ldr r1, =0x0000049a - adds r0, r1 - bl sub_80D6584 - lsls r0, 16 - lsrs r0, 16 - cmp r0, r5 - bcc _080D6D5C - movs r0, 0x1 - b _080D6D68 - .pool -_080D6D5C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x31 - bls _080D6D28 - movs r0, 0 -_080D6D68: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80D6D1C - - thumb_func_start sub_80D6D70 -sub_80D6D70: @ 80D6D70 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 16 - lsrs r5, r1, 16 - movs r0, 0xC8 - bl AllocZeroed - adds r7, r0, 0 - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r0, 0x93 - lsls r0, 3 - adds r1, r0 - adds r0, r7, 0 - movs r2, 0xC8 - bl memcpy - movs r6, 0 -_080D6D9C: - lsls r0, r6, 2 - adds r1, r0, r7 - ldrh r0, [r1] - cmp r0, r8 - bne _080D6DD0 - adds r4, r1, 0x2 - adds r0, r4, 0 - bl sub_80D6584 - lsls r0, 16 - lsrs r2, r0, 16 - adds r1, r2, r5 - ldr r3, =0x000003e7 - cmp r1, r3 - ble _080D6E04 - ldr r1, =0x0000fc19 - adds r0, r5, r1 - adds r0, r2, r0 - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - adds r1, r3, 0 - bl sub_80D6588 - cmp r5, 0 - beq _080D6E20 -_080D6DD0: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x31 - bls _080D6D9C - cmp r5, 0 - beq _080D6E20 - bl sub_80D6CAC - lsls r0, 24 - asrs r1, r0, 24 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _080D6E10 - adds r0, r7, 0 - bl Free - movs r0, 0 - b _080D6E3A - .pool -_080D6E04: - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_80D6588 - b _080D6E20 -_080D6E10: - lsls r0, r1, 2 - adds r0, r7 - mov r1, r8 - strh r1, [r0] - adds r0, 0x2 - adds r1, r5, 0 - bl sub_80D6588 -_080D6E20: - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x93 - lsls r1, 3 - adds r0, r1 - adds r1, r7, 0 - movs r2, 0xC8 - bl memcpy - adds r0, r7, 0 - bl Free - movs r0, 0x1 -_080D6E3A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80D6D70 - - thumb_func_start sub_80D6E48 -sub_80D6E48: @ 80D6E48 - push {lr} - lsls r0, 24 - lsls r1, 16 - lsrs r1, 16 - ldr r2, =0x03005d8c - ldr r2, [r2] - lsrs r0, 22 - adds r3, r2, r0 - ldr r0, =0x0000049a - adds r2, r3, r0 - ldrh r0, [r2] - subs r0, r1 - strh r0, [r2] - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - bne _080D6E76 - movs r2, 0x93 - lsls r2, 3 - adds r0, r3, r2 - strh r1, [r0] - bl sub_80D6E84 -_080D6E76: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D6E48 - - thumb_func_start sub_80D6E84 -sub_80D6E84: @ 80D6E84 - push {r4-r7,lr} - movs r2, 0 -_080D6E88: - adds r1, r2, 0x1 - lsls r0, r1, 16 - lsrs r4, r0, 16 - adds r6, r1, 0 - cmp r4, 0x31 - bhi _080D6ECA - ldr r0, =0x03005d8c - mov r12, r0 - lsls r5, r2, 2 - movs r7, 0x93 - lsls r7, 3 -_080D6E9E: - mov r0, r12 - ldr r1, [r0] - adds r0, r1, r5 - adds r0, r7 - ldrh r0, [r0] - cmp r0, 0 - bne _080D6EC0 - movs r0, 0x93 - lsls r0, 3 - adds r1, r0 - adds r2, r1, r5 - ldr r3, [r2] - lsls r0, r4, 2 - adds r1, r0 - ldr r0, [r1] - str r0, [r2] - str r3, [r1] -_080D6EC0: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x31 - bls _080D6E9E -_080D6ECA: - lsls r0, r6, 16 - lsrs r2, r0, 16 - cmp r2, 0x30 - bls _080D6E88 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D6E84 - - thumb_func_start sub_80D6EDC -sub_80D6EDC: @ 80D6EDC - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00000496 - adds r1, r0, r2 - ldrh r2, [r1] - ldr r3, =0x00000103 - cmp r2, r3 - beq _080D6F04 - movs r0, 0x88 - lsls r0, 1 - cmp r2, r0 - beq _080D6F0C - b _080D6F0E - .pool -_080D6F04: - movs r0, 0x88 - lsls r0, 1 - strh r0, [r1] - b _080D6F0E -_080D6F0C: - strh r3, [r1] -_080D6F0E: - pop {r0} - bx r0 - thumb_func_end sub_80D6EDC - - thumb_func_start bag_pocket_get_itemid -@ int bag_pocket_get_itemid(int pocket_id_plus_1, int item_index_in_pocket) -bag_pocket_get_itemid: @ 80D6F14 - lsls r0, 24 - lsls r1, 16 - ldr r2, =0x02039dd8 - lsrs r0, 21 - subs r0, 0x8 - adds r0, r2 - ldr r0, [r0] - lsrs r1, 14 - adds r1, r0 - ldrh r0, [r1] - bx lr - .pool - thumb_func_end bag_pocket_get_itemid - - thumb_func_start bag_pocket_get_item_quantity -@ int bag_pocket_get_item_quantity(int pocket_id_plus_1, int item_index_in_pocket) -bag_pocket_get_item_quantity: @ 80D6F30 - push {lr} - lsls r0, 24 - lsls r1, 16 - ldr r2, =0x02039dd8 - lsrs r0, 21 - subs r0, 0x8 - adds r0, r2 - lsrs r1, 14 - ldr r0, [r0] - adds r0, r1 - adds r0, 0x2 - bl decrypt_bag_item_quantity - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end bag_pocket_get_item_quantity - - thumb_func_start swap32 -swap32: @ 80D6F58 - ldr r3, [r0] - ldr r2, [r1] - str r2, [r0] - str r3, [r1] - bx lr - thumb_func_end swap32 - - thumb_func_start sub_80D6F64 -sub_80D6F64: @ 80D6F64 - push {r4-r7,lr} - adds r6, r0, 0 - movs r3, 0 - b _080D6FA6 -_080D6F6C: - adds r1, r3, 0x1 - lsls r0, r1, 16 - lsrs r4, r0, 16 - adds r7, r1, 0 - cmp r4, r2 - bcs _080D6FA2 - lsls r5, r3, 2 -_080D6F7A: - ldr r0, [r6] - adds r0, r5 - adds r0, 0x2 - bl decrypt_bag_item_quantity - lsls r0, 16 - cmp r0, 0 - bne _080D6F96 - ldr r1, [r6] - adds r0, r1, r5 - lsls r2, r4, 2 - adds r1, r2 - bl swap32 -_080D6F96: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - ldrb r0, [r6, 0x4] - cmp r4, r0 - bcc _080D6F7A -_080D6FA2: - lsls r0, r7, 16 - lsrs r3, r0, 16 -_080D6FA6: - ldrb r2, [r6, 0x4] - subs r0, r2, 0x1 - cmp r3, r0 - blt _080D6F6C - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80D6F64 - - thumb_func_start sub_80D6FB4 -sub_80D6FB4: @ 80D6FB4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - movs r3, 0 - b _080D701A -_080D6FC0: - adds r1, r3, 0x1 - lsls r0, r1, 16 - lsrs r5, r0, 16 - mov r8, r1 - cmp r5, r2 - bcs _080D7014 - lsls r7, r3, 2 -_080D6FCE: - ldr r0, [r6] - adds r0, r7 - adds r0, 0x2 - bl decrypt_bag_item_quantity - lsls r0, 16 - lsls r4, r5, 2 - cmp r0, 0 - beq _080D6FFE - ldr r0, [r6] - adds r0, r4 - adds r0, 0x2 - bl decrypt_bag_item_quantity - lsls r0, 16 - cmp r0, 0 - beq _080D7008 - ldr r0, [r6] - adds r1, r7, r0 - adds r0, r4, r0 - ldrh r1, [r1] - ldrh r0, [r0] - cmp r1, r0 - bls _080D7008 -_080D6FFE: - ldr r1, [r6] - adds r0, r1, r7 - adds r1, r4 - bl swap32 -_080D7008: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldrb r0, [r6, 0x4] - cmp r5, r0 - bcc _080D6FCE -_080D7014: - mov r1, r8 - lsls r0, r1, 16 - lsrs r3, r0, 16 -_080D701A: - ldrb r2, [r6, 0x4] - subs r0, r2, 0x1 - cmp r3, r0 - blt _080D6FC0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80D6FB4 - - thumb_func_start sub_80D702C -sub_80D702C: @ 80D702C - push {r4-r6,lr} - adds r4, r0, 0 - adds r3, r2, 0 - cmp r1, r3 - beq _080D708C - lsls r0, r1, 2 - adds r0, r4 - ldr r6, [r0] - cmp r3, r1 - bls _080D7064 - subs r3, 0x1 - lsls r1, 16 - lsls r0, r3, 16 - asrs r2, r0, 16 - cmp r1, r0 - bge _080D7086 - adds r5, r2, 0 -_080D704E: - asrs r2, r1, 16 - lsls r0, r2, 2 - adds r0, r4 - ldr r1, [r0, 0x4] - str r1, [r0] - adds r2, 0x1 - lsls r1, r2, 16 - asrs r0, r1, 16 - cmp r0, r5 - blt _080D704E - b _080D7086 -_080D7064: - lsls r1, 16 - lsls r0, r3, 16 - asrs r2, r0, 16 - cmp r1, r0 - ble _080D7086 - adds r5, r2, 0 -_080D7070: - asrs r2, r1, 16 - lsls r1, r2, 2 - adds r1, r4 - subs r0, r1, 0x4 - ldr r0, [r0] - str r0, [r1] - subs r2, 0x1 - lsls r1, r2, 16 - asrs r0, r1, 16 - cmp r0, r5 - bgt _080D7070 -_080D7086: - lsls r0, r3, 2 - adds r0, r4 - str r6, [r0] -_080D708C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80D702C - - thumb_func_start sub_80D7094 -sub_80D7094: @ 80D7094 - push {r4,r5,lr} - movs r4, 0 - ldr r5, =0x02039dd8 -_080D709A: - lsls r1, r4, 3 - adds r1, r5 - ldr r0, [r1] - ldrb r1, [r1, 0x4] - bl sub_80D6C7C - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x4 - bls _080D709A - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D7094 - - thumb_func_start CountTotalItemQuantityInBag -@ u16 CountTotalItemQuantityInBag(u16 itemId) -CountTotalItemQuantityInBag: @ 80D70BC - push {r4-r7,lr} - lsls r0, 16 - lsrs r6, r0, 16 - movs r7, 0 - adds r0, r6, 0 - bl itemid_get_pocket_number - lsls r0, 24 - lsrs r0, 21 - ldr r1, =0x02039dd0 - adds r5, r0, r1 - movs r4, 0 - ldrb r0, [r5, 0x4] - cmp r7, r0 - bcs _080D70FE -_080D70DA: - ldr r0, [r5] - lsls r1, r4, 2 - adds r1, r0 - ldrh r0, [r1] - cmp r0, r6 - bne _080D70F2 - adds r0, r1, 0x2 - bl decrypt_bag_item_quantity - adds r0, r7, r0 - lsls r0, 16 - lsrs r7, r0, 16 -_080D70F2: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - ldrb r0, [r5, 0x4] - cmp r4, r0 - bcc _080D70DA -_080D70FE: - adds r0, r7, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end CountTotalItemQuantityInBag - - thumb_func_start sub_80D710C -sub_80D710C: @ 80D710C - push {r4,r5,lr} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 16 - lsrs r4, r1, 16 - ldr r0, =0x03005d90 - ldr r3, [r0] - ldr r1, =0x00000ca9 - adds r0, r3, r1 - ldrb r1, [r0] - lsls r1, 30 - lsrs r2, r1, 30 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x00000e2c - adds r0, r2 - adds r2, r3, r0 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - ldr r1, =0x00000e54 - adds r0, r1 - adds r3, r0 - movs r1, 0 -_080D7140: - lsls r0, r1, 1 - adds r0, r2 - ldrh r0, [r0] - cmp r0, r5 - bne _080D7170 - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, r4 - bcs _080D715C - subs r0, r4, r0 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - bne _080D7170 -_080D715C: - movs r0, 0x1 - b _080D717C - .pool -_080D7170: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x9 - bls _080D7140 - movs r0, 0 -_080D717C: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80D710C - - thumb_func_start sub_80D7184 -sub_80D7184: @ 80D7184 - push {r4,r5,lr} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 16 - lsrs r4, r1, 16 - ldr r0, =0x03005d90 - ldr r3, [r0] - ldr r1, =0x00000ca9 - adds r0, r3, r1 - ldrb r1, [r0] - lsls r1, 30 - lsrs r2, r1, 30 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x00000e2c - adds r0, r2 - adds r2, r3, r0 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - ldr r1, =0x00000e54 - adds r0, r1 - adds r3, r0 - movs r1, 0 -_080D71B8: - lsls r0, r1, 1 - adds r0, r2 - ldrh r0, [r0] - cmp r0, r5 - beq _080D71C6 - cmp r0, 0 - bne _080D71F0 -_080D71C6: - adds r0, r3, r1 - ldrb r0, [r0] - adds r0, r4 - cmp r0, 0x63 - ble _080D71DA - subs r0, 0x63 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - bne _080D71F0 -_080D71DA: - movs r0, 0x1 - b _080D71FC - .pool -_080D71F0: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x9 - bls _080D71B8 - movs r0, 0 -_080D71FC: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80D7184 - - thumb_func_start sub_80D7204 -sub_80D7204: @ 80D7204 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 16 - lsrs r7, r0, 16 - lsls r1, 16 - lsrs r4, r1, 16 - ldr r0, =0x03005d90 - ldr r3, [r0] - ldr r1, =0x00000ca9 - adds r0, r3, r1 - ldrb r1, [r0] - lsls r1, 30 - lsrs r2, r1, 30 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x00000e2c - adds r0, r2 - adds r0, r3 - mov r9, r0 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - ldr r1, =0x00000e54 - adds r0, r1 - adds r3, r0 - mov r8, r3 - movs r0, 0x14 - bl Alloc - adds r5, r0, 0 - movs r0, 0xA - bl Alloc - adds r6, r0, 0 - adds r0, r5, 0 - mov r1, r9 - movs r2, 0x14 - bl memcpy - adds r0, r6, 0 - mov r1, r8 - movs r2, 0xA - bl memcpy - movs r2, 0 -_080D7266: - lsls r0, r2, 1 - adds r0, r5 - ldrh r0, [r0] - cmp r0, r7 - bne _080D72AA - adds r1, r6, r2 - ldrb r0, [r1] - cmp r0, 0x62 - bhi _080D72AA - adds r0, r4 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x63 - bls _080D72A4 - ldrb r0, [r1] - subs r0, 0x63 - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x63 - strb r0, [r1] - b _080D72A6 - .pool -_080D72A4: - movs r4, 0 -_080D72A6: - cmp r4, 0 - beq _080D7304 -_080D72AA: - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x9 - bls _080D7266 - cmp r4, 0 - beq _080D7304 - movs r2, 0 -_080D72BA: - lsls r0, r2, 1 - adds r1, r0, r5 - ldrh r0, [r1] - cmp r0, 0 - bne _080D72E6 - strh r7, [r1] - adds r1, r6, r2 - strb r4, [r1] - lsls r0, r4, 24 - lsrs r0, 24 - cmp r0, 0x63 - bls _080D72E0 - ldrb r0, [r1] - subs r0, 0x63 - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x63 - strb r0, [r1] - b _080D72E2 -_080D72E0: - movs r4, 0 -_080D72E2: - cmp r4, 0 - beq _080D7304 -_080D72E6: - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x9 - bls _080D72BA - cmp r4, 0 - beq _080D7304 - adds r0, r5, 0 - bl Free - adds r0, r6, 0 - bl Free - movs r0, 0 - b _080D7326 -_080D7304: - mov r0, r9 - adds r1, r5, 0 - movs r2, 0x14 - bl memcpy - mov r0, r8 - adds r1, r6, 0 - movs r2, 0xA - bl memcpy - adds r0, r5, 0 - bl Free - adds r0, r6, 0 - bl Free - movs r0, 0x1 -_080D7326: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80D7204 - - thumb_func_start sub_80D7334 -sub_80D7334: @ 80D7334 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - lsls r1, 16 - lsrs r4, r1, 16 - ldr r0, =0x03005d90 - ldr r3, [r0] - ldr r1, =0x00000ca9 - adds r0, r3, r1 - ldrb r1, [r0] - lsls r1, 30 - lsrs r2, r1, 30 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x00000e2c - adds r0, r2 - adds r0, r3 - mov r8, r0 - lsrs r1, 30 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - ldr r1, =0x00000e54 - adds r0, r1 - adds r7, r3, r0 - ldr r1, =0x0203cf30 - ldrh r0, [r1, 0x8] - ldrh r1, [r1, 0x6] - adds r0, r1 - lsls r0, 16 - lsrs r2, r0, 16 - lsls r0, r2, 1 - mov r1, r8 - adds r3, r0, r1 - ldrh r0, [r3] - cmp r0, r9 - bne _080D73B4 - adds r1, r7, r2 - ldrb r0, [r1] - cmp r0, r4 - bcc _080D73B4 - subs r0, r4 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _080D744C - strh r0, [r3] - b _080D744C - .pool -_080D73B4: - movs r0, 0x14 - bl Alloc - adds r5, r0, 0 - movs r0, 0xA - bl Alloc - adds r6, r0, 0 - adds r0, r5, 0 - mov r1, r8 - movs r2, 0x14 - bl memcpy - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0xA - bl memcpy - movs r2, 0 -_080D73DA: - lsls r0, r2, 1 - adds r3, r0, r5 - ldrh r0, [r3] - cmp r0, r9 - bne _080D740E - adds r1, r6, r2 - ldrb r0, [r1] - cmp r0, r4 - bcc _080D73FC - subs r0, r4 - strb r0, [r1] - movs r4, 0 - lsls r0, 24 - cmp r0, 0 - bne _080D740A - strh r4, [r3] - b _080D740A -_080D73FC: - subs r0, r4, r0 - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0 - strb r0, [r1] - movs r0, 0 - strh r0, [r3] -_080D740A: - cmp r4, 0 - beq _080D742C -_080D740E: - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x9 - bls _080D73DA - cmp r4, 0 - beq _080D742C - adds r0, r5, 0 - bl Free - adds r0, r6, 0 - bl Free - movs r0, 0 - b _080D744E -_080D742C: - mov r0, r8 - adds r1, r5, 0 - movs r2, 0x14 - bl memcpy - adds r0, r7, 0 - adds r1, r6, 0 - movs r2, 0xA - bl memcpy - adds r0, r5, 0 - bl Free - adds r0, r6, 0 - bl Free -_080D744C: - movs r0, 0x1 -_080D744E: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80D7334 - - thumb_func_start itemid_sanitize -itemid_sanitize: @ 80D745C - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - movs r0, 0xBC - lsls r0, 1 - cmp r1, r0 - bhi _080D746E - adds r0, r1, 0 - b _080D7470 -_080D746E: - movs r0, 0 -_080D7470: - pop {r1} - bx r1 - thumb_func_end itemid_sanitize - - thumb_func_start itemid_get_item -@ item *itemid_get_item(s16 itemId) -itemid_get_item: @ 80D7474 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl itemid_sanitize - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x2C - muls r0, r1 - ldr r1, =gItems - adds r0, r1 - pop {r1} - bx r1 - .pool - thumb_func_end itemid_get_item - - thumb_func_start itemid_get_number -itemid_get_number: @ 80D7494 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gItems - bl itemid_sanitize - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x2C - muls r0, r1 - adds r0, r4 - ldrh r0, [r0, 0xE] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end itemid_get_number - - thumb_func_start itemid_get_market_price -itemid_get_market_price: @ 80D74B8 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gItems - bl itemid_sanitize - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x2C - muls r0, r1 - adds r0, r4 - ldrh r0, [r0, 0x10] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end itemid_get_market_price - - thumb_func_start itemid_get_x12 -itemid_get_x12: @ 80D74DC - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gItems - bl itemid_sanitize - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x2C - muls r0, r1 - adds r0, r4 - ldrb r0, [r0, 0x12] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end itemid_get_x12 - - thumb_func_start itemid_get_quality -itemid_get_quality: @ 80D7500 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gItems - bl itemid_sanitize - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x2C - muls r0, r1 - adds r0, r4 - ldrb r0, [r0, 0x13] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end itemid_get_quality - - thumb_func_start itemid_get_description -itemid_get_description: @ 80D7524 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gItems - bl itemid_sanitize - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x2C - muls r0, r1 - adds r4, 0x14 - adds r0, r4 - ldr r0, [r0] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end itemid_get_description - - thumb_func_start itemid_is_unique -itemid_is_unique: @ 80D7548 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gItems - bl itemid_sanitize - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x2C - muls r0, r1 - adds r0, r4 - ldrb r0, [r0, 0x18] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end itemid_is_unique - - thumb_func_start itemid_get_x19 -itemid_get_x19: @ 80D756C - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gItems - bl itemid_sanitize - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x2C - muls r0, r1 - adds r0, r4 - ldrb r0, [r0, 0x19] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end itemid_get_x19 - - thumb_func_start itemid_get_pocket_number -itemid_get_pocket_number: @ 80D7590 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gItems - bl itemid_sanitize - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x2C - muls r0, r1 - adds r0, r4 - ldrb r0, [r0, 0x1A] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end itemid_get_pocket_number - - thumb_func_start itemid_get_type -itemid_get_type: @ 80D75B4 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gItems - bl itemid_sanitize - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x2C - muls r0, r1 - adds r0, r4 - ldrb r0, [r0, 0x1B] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end itemid_get_type - - thumb_func_start itemid_get_overworld_function -itemid_get_overworld_function: @ 80D75D8 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gItems - bl itemid_sanitize - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x2C - muls r0, r1 - adds r4, 0x1C - adds r0, r4 - ldr r0, [r0] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end itemid_get_overworld_function - - thumb_func_start itemid_get_usage -itemid_get_usage: @ 80D75FC - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gItems - bl itemid_sanitize - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x2C - muls r0, r1 - adds r0, r4 - adds r0, 0x20 - ldrb r0, [r0] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end itemid_get_usage - - thumb_func_start itemid_get_battle_function -itemid_get_battle_function: @ 80D7620 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gItems - bl itemid_sanitize - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x2C - muls r0, r1 - adds r4, 0x24 - adds r0, r4 - ldr r0, [r0] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end itemid_get_battle_function - - thumb_func_start itemid_get_x28 -itemid_get_x28: @ 80D7644 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gItems - bl itemid_sanitize - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x2C - muls r0, r1 - adds r0, r4 - adds r0, 0x28 - ldrb r0, [r0] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end itemid_get_x28 - - thumb_func_start TaskDummy1 -TaskDummy1: @ 80D7668 - bx lr - thumb_func_end TaskDummy1 - - thumb_func_start sub_80D766C -sub_80D766C: @ 80D766C - ldr r1, =0x02039f2a - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_80D766C - - thumb_func_start sub_80D7678 -sub_80D7678: @ 80D7678 - push {r4,lr} - movs r0, 0 - movs r1, 0x40 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - ldr r4, =0x00003f3f - movs r0, 0x48 - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x4A - adds r1, r4, 0 - bl SetGpuReg - movs r1, 0xFE - lsls r1, 7 - movs r0, 0 - bl SetGpuRegBits - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r0, =0x02022e18 - strh r1, [r0] - ldr r0, =0x02022e1a - strh r1, [r0] - ldr r0, =0x02022e1c - strh r1, [r0] - ldr r0, =0x02022e1e - strh r1, [r0] - ldr r0, =0x02022e20 - strh r1, [r0] - ldr r0, =0x02022e22 - strh r1, [r0] - ldr r0, =0x02022e24 - strh r1, [r0] - ldr r0, =0x02022e26 - strh r1, [r0] - ldr r0, =0x02022e28 - strh r1, [r0] - ldr r0, =0x02022e2a - strh r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D7678 - - thumb_func_start sub_80D7724 -sub_80D7724: @ 80D7724 - push {r4,r5,lr} - ldr r0, =gUnknown_08C17AB0 - movs r1, 0xC0 - lsls r1, 19 - bl LZDecompressVram - ldr r0, =gUnknown_08C1850C - ldr r1, =0x06002000 - bl LZDecompressVram - ldr r1, =gUnknown_08C16FA8 - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - ldr r0, =gUnknown_08C16E90 - movs r2, 0x80 - lsls r2, 2 - movs r1, 0 - bl decompress_palette - bl sub_80D782C - movs r4, 0 - movs r5, 0xA0 -_080D775E: - ldr r0, =0x0201a004 - adds r0, r5, r0 - ldr r1, =0x02039f26 - adds r1, r4, r1 - ldrb r1, [r1] - adds r1, 0x5 - lsls r1, 4 - movs r2, 0x20 - bl gpu_pal_apply - adds r5, 0x20 - adds r4, 0x1 - cmp r4, 0x3 - ble _080D775E - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D7724 - - thumb_func_start sub_80D779C -sub_80D779C: @ 80D779C - push {r4,lr} - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_08587F34 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - movs r0, 0x3 - movs r1, 0x6 - movs r2, 0x1 - bl SetBgAttribute - movs r4, 0 -_080D77BA: - lsls r0, r4, 24 - lsrs r0, 24 - ldr r1, =0x02039f34 - ldr r1, [r1] - lsls r2, r4, 2 - adds r1, 0x24 - adds r1, r2 - ldr r1, [r1] - bl SetBgTilemapBuffer - adds r4, 0x1 - cmp r4, 0x3 - ble _080D77BA - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D779C - - thumb_func_start sub_80D77E4 -sub_80D77E4: @ 80D77E4 - push {lr} - ldr r0, =gUnknown_08587F44 - bl InitWindows - bl DeactivateAllTextPrinters - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080D7818 - ldr r2, =0x03003014 - ldrb r1, [r2] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - b _080D7822 - .pool -_080D7818: - ldr r0, =0x03003014 - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] -_080D7822: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D77E4 - - thumb_func_start sub_80D782C -sub_80D782C: @ 80D782C - push {r4,r5,lr} - ldr r0, =gUnknown_08587C30 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - movs r0, 0 - movs r1, 0 - movs r2, 0x2 - bl rboxid_80040B8 - movs r5, 0xA - movs r4, 0xFA - lsls r4, 16 -_080D7848: - lsrs r1, r4, 16 - ldr r0, =0x020378f6 - movs r2, 0x2 - bl gpu_pal_apply - movs r0, 0x80 - lsls r0, 9 - adds r4, r0 - adds r5, 0x1 - cmp r5, 0xD - ble _080D7848 - ldr r0, =0x00007e3f - movs r1, 0xF3 - movs r2, 0x2 - bl rboxid_80040B8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D782C - - thumb_func_start sub_80D787C -sub_80D787C: @ 80D787C - push {r4-r7,lr} - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r0, [r0] - movs r1, 0 - movs r2, 0x5C - bl memset - movs r5, 0 - movs r2, 0xFF -_080D7890: - ldr r0, [r4] - ldr r1, [r0] - adds r1, 0x2 - adds r1, r5 - ldrb r0, [r1] - orrs r0, r2 - strb r0, [r1] - adds r5, 0x1 - cmp r5, 0x3 - ble _080D7890 - movs r4, 0 - ldr r6, =0x02039f34 - movs r5, 0x3 -_080D78AA: - ldr r0, [r6] - ldr r0, [r0, 0x4] - adds r0, r4, r0 - movs r1, 0 - movs r2, 0x1C - bl memset - adds r4, 0x1C - subs r5, 0x1 - cmp r5, 0 - bge _080D78AA - ldr r4, =0x02039f34 - movs r7, 0x4 - negs r7, r7 - movs r6, 0xFF - movs r3, 0 - movs r5, 0x3 -_080D78CC: - ldr r0, [r4] - ldr r1, [r0, 0x4] - adds r1, r3, r1 - ldrb r2, [r1, 0xB] - adds r0, r7, 0 - ands r0, r2 - strb r0, [r1, 0xB] - ldr r0, [r4] - ldr r1, [r0, 0x4] - adds r1, r3, r1 - ldrb r0, [r1, 0x13] - orrs r0, r6 - strb r0, [r1, 0x13] - ldr r0, [r4] - ldr r1, [r0, 0x4] - adds r1, r3, r1 - ldrb r0, [r1, 0x14] - orrs r0, r6 - strb r0, [r1, 0x14] - adds r3, 0x1C - subs r5, 0x1 - cmp r5, 0 - bge _080D78CC - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r0, [r0, 0x8] - movs r1, 0 - movs r2, 0x14 - bl memset - ldr r0, [r4] - ldr r0, [r0, 0xC] - movs r1, 0 - movs r2, 0x44 - bl memset - ldr r2, [r4] - ldr r1, [r2, 0x10] - movs r0, 0 - str r0, [r1] - ldr r0, [r2, 0x14] - movs r1, 0 - movs r2, 0x10 - bl memset - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080D7938 - movs r0, 0 - bl sub_80DCE58 -_080D7938: - movs r5, 0 - adds r2, r4, 0 - movs r6, 0xFF - movs r3, 0 - ldr r4, =0x02039f26 -_080D7942: - ldr r0, [r2] - ldr r1, [r0, 0x4] - adds r1, r3, r1 - ldrb r0, [r1, 0x19] - orrs r0, r6 - strb r0, [r1, 0x19] - ldr r0, [r2] - ldr r1, [r0] - adds r1, 0x14 - adds r1, r5 - adds r0, r5, r4 - ldrb r0, [r0] - strb r0, [r1] - adds r3, 0x1C - adds r5, 0x1 - cmp r5, 0x3 - ble _080D7942 - bl sub_80DD590 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x1C] - movs r1, 0 - movs r2, 0x40 - bl memset - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D787C - - thumb_func_start sub_80D7988 -sub_80D7988: @ 80D7988 - push {r4,r5,lr} - ldr r4, =0x02039f34 - movs r0, 0x40 - bl AllocZeroed - str r0, [r4] - movs r0, 0x5C - bl AllocZeroed - ldr r1, [r4] - str r0, [r1] - movs r0, 0x70 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x4] - movs r0, 0x14 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x8] - movs r0, 0x44 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0xC] - movs r0, 0x10 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x10] - movs r0, 0x10 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x14] - movs r0, 0x14 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x18] - movs r0, 0x40 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x1C] - movs r0, 0xC - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x20] - movs r5, 0x80 - lsls r5, 5 - adds r0, r5, 0 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x24] - adds r0, r5, 0 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x28] - adds r0, r5, 0 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x2C] - adds r0, r5, 0 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x30] - movs r5, 0x80 - lsls r5, 4 - adds r0, r5, 0 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x34] - adds r0, r5, 0 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x38] - movs r0, 0x80 - lsls r0, 6 - bl AllocZeroed - ldr r2, [r4] - str r0, [r2, 0x3C] - ldr r1, =0x0202305c - str r0, [r1] - ldr r1, =0x02023060 - ldr r0, [r2, 0x28] - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D7988 - - thumb_func_start sub_80D7A5C -sub_80D7A5C: @ 80D7A5C - push {r4,r5,lr} - ldr r5, =0x02039f34 - ldr r0, [r5] - ldr r0, [r0] - bl Free - ldr r0, [r5] - movs r4, 0 - str r4, [r0] - ldr r0, [r0, 0x4] - bl Free - ldr r0, [r5] - str r4, [r0, 0x4] - ldr r0, [r0, 0x8] - bl Free - ldr r0, [r5] - str r4, [r0, 0x8] - ldr r0, [r0, 0xC] - bl Free - ldr r0, [r5] - str r4, [r0, 0xC] - ldr r0, [r0, 0x10] - bl Free - ldr r0, [r5] - str r4, [r0, 0x10] - ldr r0, [r0, 0x14] - bl Free - ldr r0, [r5] - str r4, [r0, 0x14] - ldr r0, [r0, 0x18] - bl Free - ldr r0, [r5] - str r4, [r0, 0x18] - ldr r0, [r0, 0x1C] - bl Free - ldr r0, [r5] - str r4, [r0, 0x1C] - ldr r0, [r0, 0x20] - bl Free - ldr r0, [r5] - str r4, [r0, 0x20] - ldr r0, [r0, 0x24] - bl Free - ldr r0, [r5] - str r4, [r0, 0x24] - ldr r0, [r0, 0x28] - bl Free - ldr r0, [r5] - str r4, [r0, 0x28] - ldr r0, [r0, 0x2C] - bl Free - ldr r0, [r5] - str r4, [r0, 0x2C] - ldr r0, [r0, 0x30] - bl Free - ldr r0, [r5] - str r4, [r0, 0x30] - ldr r0, [r0, 0x34] - bl Free - ldr r0, [r5] - str r4, [r0, 0x34] - ldr r0, [r0, 0x38] - bl Free - ldr r0, [r5] - str r4, [r0, 0x38] - ldr r0, [r0, 0x3C] - bl Free - ldr r0, [r5] - str r4, [r0, 0x3C] - bl Free - str r4, [r5] - ldr r0, =0x0202305c - str r4, [r0] - ldr r0, =0x02023060 - str r4, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D7A5C - - thumb_func_start sub_80D7B24 -sub_80D7B24: @ 80D7B24 - push {r4-r6,lr} - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r6, r0, r1 - ldrb r5, [r6] - cmp r5, 0x1 - beq _080D7BD4 - cmp r5, 0x1 - bgt _080D7B44 - cmp r5, 0 - beq _080D7B4E - b _080D7C56 - .pool -_080D7B44: - cmp r5, 0x2 - beq _080D7BDA - cmp r5, 0x3 - beq _080D7C04 - b _080D7C56 -_080D7B4E: - ldr r0, =0x02039f38 - strb r5, [r0] - bl sub_80D7988 - bl init_uns_table_pokemon_copy - ldr r4, =0x020244d4 - ldr r0, [r4] - ldr r0, [r0] - bl Free - ldr r0, [r4] - str r5, [r0] - movs r0, 0x80 - lsls r0, 7 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1] - movs r0, 0 - bl SetVBlankCallback - bl sub_80D779C - bl sub_80D77E4 - bl sub_80D7678 - bl dp12_8087EA4 - bl sub_80A1A74 - ldr r2, =0x02037fd4 - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - bl ResetAllObjectData - bl ResetTasks - bl ResetObjectPaletteAllocator - ldr r1, =0x0300301c - movs r0, 0x4 - strb r0, [r1] - ldr r0, =0x02000000 - movs r1, 0xD0 - lsls r1, 9 - adds r0, r1 - strb r5, [r0] - bl sub_806E414 - bl sub_80D787C - b _080D7BF6 - .pool -_080D7BD4: - movs r0, 0x2 - strb r0, [r6] - b _080D7C56 -_080D7BDA: - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r0, [r0] - adds r0, 0x59 - bl sub_80D7E44 - lsls r0, 24 - cmp r0, 0 - beq _080D7C56 - ldr r0, [r4] - ldr r0, [r0] - adds r0, 0x59 - movs r1, 0 - strb r1, [r0] -_080D7BF6: - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] - b _080D7C56 - .pool -_080D7C04: - bl sub_80DE224 - ldr r0, =0x02022e18 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e1a - strh r1, [r0] - movs r0, 0x2 - bl sub_80A2390 - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] - ldr r0, =vblank_cb_battle - bl SetVBlankCallback - ldr r0, =sub_80D7C7C - movs r1, 0xA - bl CreateTask - ldr r1, =0x02039f34 - ldr r1, [r1] - ldr r1, [r1] - strb r0, [r1, 0x8] - ldr r0, =sub_80D823C - bl SetMainCallback2 - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080D7C56 - bl sub_800E0E8 - movs r0, 0x8 - movs r1, 0x8 - bl sub_800DFB4 -_080D7C56: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D7B24 - - thumb_func_start sub_80D7C7C -sub_80D7C7C: @ 80D7C7C - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - bne _080D7CA2 - ldr r0, =0x03005e00 - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 3 - adds r1, r0 - strh r2, [r1, 0x8] - ldr r0, =sub_80D7CB4 - str r0, [r1] -_080D7CA2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D7C7C - - thumb_func_start sub_80D7CB4 -sub_80D7CB4: @ 80D7CB4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080D7D90 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080D7D3A - ldr r2, =0x03005e00 - lsls r1, r5, 2 - adds r0, r1, r5 - lsls r0, 3 - adds r4, r0, r2 - movs r2, 0x8 - ldrsh r0, [r4, r2] - adds r6, r1, 0 - cmp r0, 0x1 - beq _080D7D04 - cmp r0, 0x1 - bgt _080D7CF4 - cmp r0, 0 - beq _080D7CFA - b _080D7D3A - .pool -_080D7CF4: - cmp r0, 0x2 - beq _080D7D28 - b _080D7D3A -_080D7CFA: - bl sub_80DBF68 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080D7D04: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080D7D9E - bl sub_800ADF8 - ldr r0, =0x03005e00 - adds r1, r6, r5 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _080D7D9E - .pool -_080D7D28: - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080D7D9E - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080D7D3A: - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _080D7D9E - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _080D7D62 - bl sub_80DBF68 -_080D7D62: - ldr r0, =sub_80D7DAC - movs r1, 0 - bl CreateTask - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - strh r4, [r0, 0x8] - ldr r1, =TaskDummy1 - str r1, [r0] - b _080D7D9E - .pool -_080D7D90: - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80D80C8 - str r0, [r1] -_080D7D9E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D7CB4 - - thumb_func_start sub_80D7DAC -sub_80D7DAC: @ 80D7DAC - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =sub_80FC998 - ldr r2, =sub_80D7DC8 - bl SetTaskFuncWithFollowupFunc - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D7DAC - - thumb_func_start sub_80D7DC8 -sub_80D7DC8: @ 80D7DC8 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0x1 - strh r0, [r1, 0x8] - ldr r0, =sub_80D7DE8 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_80D7DC8 - - thumb_func_start sub_80D7DE8 -sub_80D7DE8: @ 80D7DE8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r5 - ldrh r1, [r0, 0x8] - subs r1, 0x1 - strh r1, [r0, 0x8] - lsls r1, 16 - cmp r1, 0 - bgt _080D7E2A - bl link_get_multiplayer_id - adds r0, r4, 0 - bl DestroyTask - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0] - ldrb r1, [r0, 0x8] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - ldr r1, =sub_80D80C8 - str r1, [r0] - ldr r1, =0x03005d80 - ldr r0, =0x030060b8 - ldr r0, [r0] - str r0, [r1] -_080D7E2A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D7DE8 - - thumb_func_start sub_80D7E44 -sub_80D7E44: @ 80D7E44 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x40 - mov r10, r0 - ldrb r0, [r0] - cmp r0, 0x6 - bls _080D7E5A - b _080D80A4 -_080D7E5A: - lsls r0, 2 - ldr r1, =_080D7E68 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080D7E68: - .4byte _080D7E84 - .4byte _080D7EC8 - .4byte _080D7ED8 - .4byte _080D7F28 - .4byte _080D7F40 - .4byte _080D7F7C - .4byte _080D8004 -_080D7E84: - ldr r2, =0x02037fd4 - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - movs r1, 0xC0 - lsls r1, 19 - movs r4, 0x80 - lsls r4, 8 - movs r0, 0 - adds r2, r4, 0 - movs r3, 0x1 - bl RequestDma3Fill - ldr r1, =0x06008000 - movs r0, 0 - adds r2, r4, 0 - movs r3, 0x1 - bl RequestDma3Fill - ldr r1, =0x06010000 - movs r0, 0 - adds r2, r4, 0 - movs r3, 0x1 - bl RequestDma3Fill - b _080D80AE - .pool -_080D7EC8: - ldr r0, =gUnknown_08C17AB0 - movs r1, 0xC0 - lsls r1, 19 - bl LZDecompressVram - b _080D80AE - .pool -_080D7ED8: - ldr r0, =gUnknown_08C1850C - ldr r4, =0x06002000 - adds r1, r4, 0 - bl LZDecompressVram - ldr r3, =0x02018000 - movs r5, 0x80 - lsls r5, 6 - ldr r1, =0x040000d4 - ldr r6, =0x84000400 - movs r2, 0x80 - lsls r2, 5 - movs r7, 0x84 - lsls r7, 24 -_080D7EF4: - str r4, [r1] - str r3, [r1, 0x4] - str r6, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r4, r2 - adds r3, r2 - subs r5, r2 - cmp r5, r2 - bhi _080D7EF4 - str r4, [r1] - str r3, [r1, 0x4] - lsrs r0, r5, 2 - orrs r0, r7 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - b _080D80AE - .pool -_080D7F28: - ldr r1, =gUnknown_08C16FA8 - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - b _080D80AE - .pool -_080D7F40: - ldr r1, =gUnknown_08C17170 - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0x2C] - ldr r2, =0x0201aa04 - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x84000200 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - b _080D80AE - .pool -_080D7F7C: - ldr r0, =gUnknown_08C16E90 - movs r2, 0x80 - lsls r2, 2 - movs r1, 0 - bl decompress_palette - ldr r5, =0x02037814 - ldr r6, =0x04000008 - adds r0, r5, 0 - mov r1, sp - adds r2, r6, 0 - bl CpuSet - ldr r0, =0x02039f25 - mov r9, r0 - ldrb r0, [r0] - adds r0, 0x5 - lsls r0, 5 - ldr r1, =0xffffff00 - adds r1, r5 - mov r8, r1 - add r0, r8 - add r4, sp, 0x20 - adds r1, r4, 0 - adds r2, r6, 0 - bl CpuSet - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - bl CpuSet - mov r2, r9 - ldrb r1, [r2] - adds r1, 0x5 - lsls r1, 5 - add r1, r8 - mov r0, sp - adds r2, r6, 0 - bl CpuSet - ldr r1, =0x0201a004 - ldr r0, =0x040000d4 - mov r2, r8 - str r2, [r0] - str r1, [r0, 0x4] - ldr r1, =0x84000080 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - bl sub_80D782C - b _080D80AE - .pool -_080D8004: - bl sub_80DD04C - bl sub_80DBF90 - bl sub_80DB2BC - bl sub_80DB120 - ldr r1, =0x02039f34 - ldr r1, [r1] - ldr r1, [r1] - movs r4, 0 - strb r0, [r1, 0x12] - bl sub_80DC2BC - bl sub_80DC4F0 - bl sub_80DC594 - bl sub_80DC5E8 - bl sub_80DC7EC - ldr r1, =0x02024076 - strb r4, [r1] - movs r0, 0x1 - strb r0, [r1, 0x1] - movs r3, 0x3 - strb r3, [r1, 0x2] - movs r2, 0x2 - strb r2, [r1, 0x3] - ldr r0, =0x02022fec - str r4, [r0] - ldr r4, =0x0202420b - strb r2, [r4] - ldr r0, =0x0202420c - strb r3, [r0] - bl sub_80DB0C4 - ldr r2, =0x020241e4 - ldrb r1, [r4] - adds r1, r2 - strb r0, [r1] - bl sub_80DEA20 - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x3 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - b _080D80AE - .pool -_080D80A4: - movs r0, 0 - mov r1, r10 - strb r0, [r1] - movs r0, 0x1 - b _080D80B8 -_080D80AE: - mov r2, r10 - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - movs r0, 0 -_080D80B8: - add sp, 0x40 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80D7E44 - - thumb_func_start sub_80D80C8 -sub_80D80C8: @ 80D80C8 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, =0x02037fd4 - ldrb r2, [r1, 0x8] - movs r0, 0x7F - ands r0, r2 - strb r0, [r1, 0x8] - ldrb r1, [r1, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - bne _080D80F8 - ldr r0, =0x03005e00 - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 3 - adds r1, r0 - strh r2, [r1, 0x8] - strh r2, [r1, 0xA] - ldr r0, =sub_80D8108 - str r0, [r1] -_080D80F8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D80C8 - - thumb_func_start sub_80D8108 -sub_80D8108: @ 80D8108 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r2, r1, 0 - cmp r0, 0x4 - bhi _080D8208 - lsls r0, 2 - ldr r1, =_080D8138 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080D8138: - .4byte _080D814C - .4byte _080D8176 - .4byte _080D8194 - .4byte _080D81B0 - .4byte _080D8208 -_080D814C: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0xA] - adds r1, r0, 0x1 - strh r1, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3C - ble _080D822C - movs r0, 0 - strh r0, [r4, 0xA] - movs r0, 0x61 - movs r1, 0 - bl audio_play_and_stuff - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080D822C -_080D8176: - ldr r1, =0x02022e1a - ldrh r0, [r1] - adds r0, 0x7 - strh r0, [r1] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA0 - ble _080D822C - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r2 - b _080D81FA - .pool -_080D8194: - bl sub_80DE350 - ldr r0, =0x03005e00 - 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 _080D822C - .pool -_080D81B0: - movs r0, 0x8 - bl GetGpuReg - mov r1, sp - strh r0, [r1] - movs r0, 0xC - bl GetGpuReg - mov r4, sp - adds r4, 0x2 - strh r0, [r4] - mov r3, sp - ldrb r2, [r3] - movs r1, 0x4 - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3] - ldrb r0, [r4] - ands r1, r0 - strb r1, [r4] - mov r0, sp - ldrh r1, [r0] - movs r0, 0x8 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0xC - bl SetGpuReg - bl sub_80DDB0C - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 -_080D81FA: - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - b _080D822C - .pool -_080D8208: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0] - ldrb r1, [r0, 0x6] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _080D822C - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r2 - strh r1, [r0, 0x8] - strh r1, [r0, 0xA] - ldr r1, =sub_80D833C - str r1, [r0] -_080D822C: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D8108 - - thumb_func_start sub_80D823C -sub_80D823C: @ 80D823C - push {r4,r5,lr} - bl CallObjectCallbacks - bl RunTasks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - movs r4, 0 -_080D8250: - ldr r5, =0x02039f38 - ldrb r0, [r5] - asrs r0, r4 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080D8266 - lsls r0, r4, 24 - lsrs r0, 24 - bl CopyBgTilemapBufferToVram -_080D8266: - adds r4, 0x1 - cmp r4, 0x3 - ble _080D8250 - movs r0, 0 - strb r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D823C - - thumb_func_start vblank_cb_battle -vblank_cb_battle: @ 80D827C - push {lr} - ldr r0, =0x02022e14 - ldrh r1, [r0] - movs r0, 0x10 - bl SetGpuReg - ldr r0, =0x02022e16 - ldrh r1, [r0] - movs r0, 0x12 - bl SetGpuReg - ldr r0, =0x02022e18 - ldrh r1, [r0] - movs r0, 0x14 - bl SetGpuReg - ldr r0, =0x02022e1a - ldrh r1, [r0] - movs r0, 0x16 - bl SetGpuReg - ldr r0, =0x02022e1c - ldrh r1, [r0] - movs r0, 0x18 - bl SetGpuReg - ldr r0, =0x02022e1e - ldrh r1, [r0] - movs r0, 0x1A - bl SetGpuReg - ldr r0, =0x02022e20 - ldrh r1, [r0] - movs r0, 0x1C - bl SetGpuReg - ldr r0, =0x02022e22 - ldrh r1, [r0] - movs r0, 0x1E - bl SetGpuReg - ldr r0, =0x02022e24 - ldrh r1, [r0] - movs r0, 0x40 - bl SetGpuReg - ldr r0, =0x02022e26 - ldrh r1, [r0] - movs r0, 0x44 - bl SetGpuReg - ldr r0, =0x02022e28 - ldrh r1, [r0] - movs r0, 0x42 - bl SetGpuReg - ldr r0, =0x02022e2a - ldrh r1, [r0] - movs r0, 0x46 - bl SetGpuReg - bl copy_pal_bg_faded_to_pal_ram - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl sub_80BA0A8 - pop {r0} - bx r0 - .pool - thumb_func_end vblank_cb_battle - - thumb_func_start sub_80D833C -sub_80D833C: @ 80D833C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0 - bne _080D840C - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r0, =0x02022e1e - strh r1, [r0] - bl sub_80DCD48 - ldr r1, =0x02037714 - ldr r2, =0x0201a204 - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x84000100 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - ldr r0, =0x02021cc4 - ldr r1, =0x02039f34 - ldr r1, [r1] - ldr r1, [r1] - ldrb r1, [r1, 0x1] - adds r1, 0x1 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalString - ldr r0, =0x02039f25 - ldrb r0, [r0] - bl sub_80DBCA8 - lsls r0, 24 - cmp r0, 0 - bne _080D83CC - ldr r0, =0x02022e2c - ldr r1, =gUnknown_0827D507 - bl CopyString - b _080D83D4 - .pool -_080D83CC: - ldr r0, =0x02022e2c - ldr r1, =gUnknown_0827D531 - bl CopyString -_080D83D4: - bl sub_80DB89C - ldr r4, =0x02021fc4 - ldr r1, =0x02022e2c - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80DEC30 - ldr r1, =0x03005e00 - 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 _080D841A - .pool -_080D840C: - bl sub_80DED4C - cmp r0, 0 - bne _080D841A - strh r0, [r4, 0x8] - ldr r0, =sub_80D8424 - str r0, [r4] -_080D841A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D833C - - thumb_func_start sub_80D8424 -sub_80D8424: @ 80D8424 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080D843C - cmp r1, 0x2 - bne _080D8482 -_080D843C: - movs r0, 0x5 - bl audio_play - ldr r0, =0x02039f25 - ldrb r0, [r0] - bl sub_80DBCA8 - lsls r0, 24 - cmp r0, 0 - bne _080D8474 - movs r0, 0x1 - bl sub_80DC490 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80D8490 - b _080D8480 - .pool -_080D8474: - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80D8894 -_080D8480: - str r0, [r1] -_080D8482: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D8424 - - thumb_func_start sub_80D8490 -sub_80D8490: @ 80D8490 - 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 - mov r9, r0 - ldr r0, =0x02022e16 - movs r1, 0xA0 - strh r1, [r0] - ldr r0, =0x02022e1e - strh r1, [r0] - movs r6, 0 - ldr r0, =0x02039f25 - mov r8, r0 - ldr r2, =0x02039e1e - mov r10, r2 - ldr r7, =0x02039f34 -_080D84B8: - lsls r1, r6, 1 - mov r0, r8 - ldrb r2, [r0] - lsls r0, r2, 6 - adds r1, r0 - add r1, r10 - ldrh r4, [r1] - add r5, sp, 0x4 - ldr r0, [r7] - ldr r1, [r0, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x8] - cmp r0, 0 - beq _080D853C - adds r0, r2, 0 - bl sub_80DE1E8 - lsls r0, 24 - cmp r0, 0 - beq _080D853C - ldr r0, [r7] - mov r2, r8 - ldrb r1, [r2] - ldr r2, [r0, 0x4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x8] - adds r1, r4, 0 - bl AreMovesContestCombo - lsls r0, 24 - cmp r0, 0 - beq _080D853C - ldr r0, [r7] - mov r2, r8 - ldrb r1, [r2] - ldr r2, [r0, 0x4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x15] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080D853C - add r0, sp, 0x4 - ldr r1, =gUnknown_085ED1A0 - b _080D8566 - .pool -_080D853C: - cmp r4, 0 - beq _080D856C - ldr r0, [r7] - mov r2, r8 - ldrb r1, [r2] - ldr r2, [r0, 0x4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x8] - cmp r0, r4 - bne _080D856C - ldr r0, =gContestMoves - lsls r1, r4, 3 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x3 - beq _080D856C - add r0, sp, 0x4 - ldr r1, =gUnknown_085ED1A7 -_080D8566: - bl CopyString - adds r5, r0, 0 -_080D856C: - movs r0, 0xD - adds r1, r4, 0 - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - adds r0, r5, 0 - bl CopyString - adds r4, r6, 0x5 - lsls r0, r4, 24 - lsrs r0, 24 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x7 - str r0, [sp] - adds r0, r4, 0 - add r1, sp, 0x4 - movs r2, 0x5 - movs r3, 0x1 - bl sub_80DEBD0 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x3 - bls _080D84B8 - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - bl sub_80D880C - ldr r2, =0x02039e00 - ldr r0, [r4] - ldr r0, [r0] - ldrb r1, [r0] - lsls r1, 1 - ldr r0, =0x02039f25 - ldrb r0, [r0] - lsls r0, 6 - adds r1, r0 - adds r2, 0x1E - adds r1, r2 - ldrh r0, [r1] - bl prints_contest_move_description - ldr r1, =0x03005e00 - mov r2, r9 - lsls r0, r2, 2 - add r0, r9 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80D8610 - str r1, [r0] - 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_80D8490 - - thumb_func_start sub_80D8610 -sub_80D8610: @ 80D8610 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - movs r6, 0 - ldr r3, =0x030022c0 - ldr r1, =0x02039e00 - ldr r0, =0x02039f25 - ldrb r0, [r0] - lsls r0, 6 - adds r1, 0x1E - adds r1, r0, r1 - movs r2, 0x3 -_080D8628: - ldrh r0, [r1] - cmp r0, 0 - beq _080D8634 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_080D8634: - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _080D8628 - ldrh r0, [r3, 0x2E] - movs r5, 0x1 - ands r5, r0 - cmp r5, 0 - beq _080D8670 - movs r0, 0x5 - bl audio_play - ldr r0, =0x03005e00 - lsls r1, r7, 2 - adds r1, r7 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80D8894 - str r0, [r1] - b _080D87FA - .pool -_080D8670: - ldrh r0, [r3, 0x30] - cmp r0, 0x20 - bne _080D8678 - b _080D87FA -_080D8678: - cmp r0, 0x20 - bgt _080D8682 - cmp r0, 0x2 - beq _080D868E - b _080D87FA -_080D8682: - cmp r0, 0x40 - beq _080D8730 - cmp r0, 0x80 - bne _080D868C - b _080D879C -_080D868C: - b _080D87FA -_080D868E: - movs r0, 0x5 - bl audio_play - movs r0, 0 - bl sub_80DC490 - ldr r0, =0x02021cc4 - ldr r1, =0x02039f34 - ldr r1, [r1] - ldr r1, [r1] - ldrb r1, [r1, 0x1] - adds r1, 0x1 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalString - ldr r0, =0x02039f25 - ldrb r0, [r0] - bl sub_80DBCA8 - lsls r0, 24 - cmp r0, 0 - bne _080D86DC - ldr r0, =0x02022e2c - ldr r1, =gUnknown_0827D507 - bl CopyString - b _080D86E4 - .pool -_080D86DC: - ldr r0, =0x02022e2c - ldr r1, =gUnknown_0827D531 - bl CopyString -_080D86E4: - bl sub_80DB89C - ldr r4, =0x02021fc4 - ldr r1, =0x02022e2c - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0 - bl sub_80DEC30 - ldr r0, =0x02022e16 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e1e - strh r1, [r0] - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80D8424 - str r1, [r0] - b _080D87FA - .pool -_080D8730: - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - bl sub_80D883C - ldr r0, [r4] - ldr r1, [r0] - ldrb r0, [r1] - cmp r0, 0 - bne _080D8754 - subs r0, r6, 0x1 - b _080D8756 - .pool -_080D8754: - subs r0, 0x1 -_080D8756: - strb r0, [r1] - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - bl sub_80D880C - ldr r2, =0x02039e00 - ldr r0, [r4] - ldr r0, [r0] - ldrb r1, [r0] - lsls r1, 1 - ldr r0, =0x02039f25 - ldrb r0, [r0] - lsls r0, 6 - adds r1, r0 - adds r2, 0x1E - adds r1, r2 - ldrh r0, [r1] - bl prints_contest_move_description - cmp r6, 0x1 - bls _080D87FA - movs r0, 0x5 - bl audio_play - b _080D87FA - .pool -_080D879C: - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - bl sub_80D883C - ldr r0, [r4] - ldr r1, [r0] - ldrb r2, [r1] - subs r0, r6, 0x1 - cmp r2, r0 - bne _080D87C0 - strb r5, [r1] - b _080D87C4 - .pool -_080D87C0: - adds r0, r2, 0x1 - strb r0, [r1] -_080D87C4: - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - bl sub_80D880C - ldr r2, =0x02039e00 - ldr r0, [r4] - ldr r0, [r0] - ldrb r1, [r0] - lsls r1, 1 - ldr r0, =0x02039f25 - ldrb r0, [r0] - lsls r0, 6 - adds r1, r0 - adds r2, 0x1E - adds r1, r2 - ldrh r0, [r1] - bl prints_contest_move_description - cmp r6, 0x1 - bls _080D87FA - movs r0, 0x5 - bl audio_play -_080D87FA: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D8610 - - thumb_func_start sub_80D880C -sub_80D880C: @ 80D880C - push {lr} - sub sp, 0x10 - adds r3, r0, 0 - lsls r3, 25 - movs r0, 0xF8 - lsls r0, 21 - adds r3, r0 - lsrs r3, 24 - movs r0, 0x2 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - str r0, [sp, 0xC] - movs r0, 0x2 - movs r1, 0x37 - movs r2, 0 - bl sub_80DECB8 - add sp, 0x10 - pop {r0} - bx r0 - thumb_func_end sub_80D880C - - thumb_func_start sub_80D883C -sub_80D883C: @ 80D883C - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x10 - adds r4, r0, 0 - lsls r4, 24 - asrs r4, 23 - adds r3, r4, 0 - adds r3, 0x1F - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x2 - mov r8, r0 - str r0, [sp] - movs r5, 0x1 - str r5, [sp, 0x4] - movs r6, 0x11 - str r6, [sp, 0x8] - str r5, [sp, 0xC] - movs r1, 0xB - movs r2, 0 - bl sub_80DECB8 - adds r4, 0x20 - lsls r4, 24 - lsrs r4, 24 - mov r0, r8 - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - str r5, [sp, 0xC] - movs r0, 0x2 - movs r1, 0xB - movs r2, 0 - adds r3, r4, 0 - bl sub_80DECB8 - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80D883C - - thumb_func_start sub_80D8894 -sub_80D8894: @ 80D8894 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080D890C - ldr r4, =0x02039f25 - ldrb r0, [r4] - bl sub_80DB8B8 - ldr r1, =0x02039f34 - ldr r1, [r1] - ldrb r2, [r4] - ldr r3, [r1, 0x4] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r3 - strh r0, [r1, 0x6] - ldr r4, =sub_80FC9F8 - adds r0, r4, 0 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =sub_80D892C - adds r1, r4, 0 - bl SetTaskFuncWithFollowupFunc - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =TaskDummy1 - str r1, [r0] - bl sub_80DBF68 - movs r0, 0 - bl sub_80DC490 - b _080D891E - .pool -_080D890C: - bl sub_80DB918 - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80D895C - str r0, [r1] -_080D891E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D8894 - - thumb_func_start sub_80D892C -sub_80D892C: @ 80D892C - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - ldr r2, =0x03005e00 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0] - ldrb r1, [r0, 0x8] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldr r1, =sub_80D895C - str r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D892C - - thumb_func_start sub_80D895C -sub_80D895C: @ 80D895C - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - bl sub_80DB89C - ldr r0, =0x02022e16 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e1e - strh r1, [r0] - movs r0, 0 - bl sub_80DC490 - movs r6, 0 - movs r5, 0xA0 - lsls r5, 19 -_080D897C: - lsrs r4, r5, 24 - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x80 - lsls r0, 17 - adds r5, r0 - adds r6, 0x1 - cmp r6, 0x3 - ble _080D897C - movs r0, 0 - bl sub_80DED60 - ldr r1, =0x02037b14 - ldr r0, =0x0201a604 - movs r2, 0x80 - lsls r2, 3 - ldr r4, =0x040000d4 - str r1, [r4] - str r0, [r4, 0x4] - lsrs r1, r2, 2 - movs r3, 0x84 - lsls r3, 24 - orrs r1, r3 - str r1, [r4, 0x8] - ldr r1, [r4, 0x8] - ldr r1, =0xfffffc00 - adds r0, r1 - movs r1, 0 - bl gpu_pal_apply - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x8] - strh r1, [r0, 0xA] - ldr r1, =sub_80D8A04 - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D895C - - thumb_func_start sub_80D8A04 -sub_80D8A04: @ 80D8A04 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _080D8A42 - movs r0, 0 - strh r0, [r4, 0x8] - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _080D8A42 - bl sub_80DDBE8 - movs r0, 0x1 - bl sub_80DE69C - ldr r0, =sub_80D8A50 - str r0, [r4] -_080D8A42: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D8A04 - - thumb_func_start sub_80D8A50 -sub_80D8A50: @ 80D8A50 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0] - ldrh r1, [r0, 0x6] - movs r0, 0x90 - lsls r0, 2 - ands r0, r1 - cmp r0, 0 - bne _080D8A76 - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80D8A88 - str r0, [r1] -_080D8A76: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D8A50 - - thumb_func_start sub_80D8A88 -sub_80D8A88: @ 80D8A88 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x03005e00 - lsls r3, r6, 2 - adds r1, r3, r6 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _080D8B18 - ldr r2, =0x02039f34 - ldr r0, [r2] - ldr r1, [r0] - movs r0, 0 - strb r0, [r1, 0x10] - ldr r0, [r2] - ldr r1, [r0] - ldr r0, =0x03005d80 - ldr r0, [r0] - str r0, [r1, 0x18] - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - adds r7, r3, 0 - cmp r0, 0 - beq _080D8B08 - bl sub_80DA8A4 - lsls r0, 24 - cmp r0, 0 - beq _080D8B08 - movs r4, 0 - ldr r1, =0x02039f30 - ldrb r0, [r1] - cmp r0, 0x3 - bgt _080D8B08 - adds r5, r1, 0 -_080D8ADE: - ldrb r0, [r5] - adds r0, r4 - lsls r0, 24 - lsrs r0, 24 - bl sub_80DB8B8 - ldr r1, =0x02039f34 - ldr r1, [r1] - ldrb r2, [r5] - adds r2, r4 - ldr r3, [r1, 0x4] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r3 - strh r0, [r1, 0x6] - adds r4, 0x1 - ldrb r0, [r5] - adds r0, r4, r0 - cmp r0, 0x3 - ble _080D8ADE -_080D8B08: - ldr r1, =0x03005e00 - adds r0, r7, r6 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x8] - ldr r1, =sub_80D8B38 - str r1, [r0] -_080D8B18: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80D8A88 - - thumb_func_start sub_80D8B38 -sub_80D8B38: @ 80D8B38 - 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 - ldr r2, =0x02039f34 - ldr r0, [r2] - ldr r0, [r0] - ldrb r6, [r0, 0x11] - ldr r1, =0x03005e00 - mov r3, r8 - lsls r0, r3, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r4, 0x8 - ldrsh r0, [r0, r4] - mov r9, r2 - adds r4, r1, 0 - cmp r0, 0x3B - bls _080D8B6E - bl _080DA100 -_080D8B6E: - lsls r0, 2 - ldr r1, =_080D8B84 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080D8B84: - .4byte _080D8C74 - .4byte _080D8D30 - .4byte _080D8D56 - .4byte _080D8DC4 - .4byte _080D8E7C - .4byte _080D8EC8 - .4byte _080D8F84 - .4byte _080D8FB8 - .4byte _080D9010 - .4byte _080D908C - .4byte _080D9FC0 - .4byte _080D9FEC - .4byte _080D9238 - .4byte _080D926C - .4byte _080D9774 - .4byte _080D9864 - .4byte _080D98D4 - .4byte _080D9904 - .4byte _080D99EC - .4byte _080D999E - .4byte _080DA024 - .4byte _080DA0A0 - .4byte _080DA0C2 - .4byte _080D90B4 - .4byte _080D9180 - .4byte _080D9388 - .4byte _080D939E - .4byte _080D947C - .4byte _080D94A0 - .4byte _080D9508 - .4byte _080D95EC - .4byte _080DA038 - .4byte _080DA080 - .4byte _080D9EBC - .4byte _080D9F48 - .4byte _080D929A - .4byte _080D92D0 - .4byte _080D92F6 - .4byte _080D9334 - .4byte _080D955C - .4byte _080D95C4 - .4byte _080D9A2C - .4byte _080DA100 - .4byte _080D9DAC - .4byte _080DA100 - .4byte _080D9830 - .4byte _080D997C - .4byte _080D921A - .4byte _080D91A4 - .4byte _080D91F4 - .4byte _080D935C - .4byte _080D9690 - .4byte _080D971C - .4byte _080D9BAA - .4byte _080D9C68 - .4byte _080D9F68 - .4byte _080D9F84 - .4byte _080D9DD4 - .4byte _080D9E60 - .4byte _080D9EA0 -_080D8C74: - bl sub_80DCD48 - movs r7, 0 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0] - ldr r0, [r0, 0x8] - ldrb r1, [r1, 0x10] - mov r5, r8 - lsls r5, 2 - mov r10, r5 - ldrb r2, [r0] - cmp r1, r2 - beq _080D8C9C - adds r2, r0, 0 -_080D8C92: - adds r7, 0x1 - adds r0, r2, r7 - ldrb r0, [r0] - cmp r1, r0 - bne _080D8C92 -_080D8C9C: - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r0, [r0] - strb r7, [r0, 0x11] - ldr r0, [r4] - ldr r2, [r0] - ldrb r6, [r2, 0x11] - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r5, 0x1 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _080D8D14 - ldrb r0, [r2, 0x7] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0x7] - bl sub_80DA8A4 - lsls r0, 24 - cmp r0, 0 - beq _080D8CD4 - ldr r0, [r4] - ldr r0, [r0] - ldrb r0, [r0, 0x11] - bl sub_80DD080 -_080D8CD4: - ldr r4, =sub_80FCC88 - adds r0, r4, 0 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =sub_80DA110 - adds r1, r4, 0 - bl SetTaskFuncWithFollowupFunc - bl sub_80DBF68 - ldr r1, =0x03005e00 - mov r0, r10 - add r0, r8 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0x8] - bl _080DA100 - .pool -_080D8D14: - adds r0, r6, 0 - bl sub_80DD080 - ldr r0, =0x03005e00 - mov r1, r10 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0x2 - strh r0, [r1, 0x8] - bl _080DA100 - .pool -_080D8D30: - mov r3, r9 - ldr r0, [r3] - ldr r0, [r0] - ldrb r1, [r0, 0x7] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080D8D44 - bl _080DA100 -_080D8D44: - mov r5, r8 - lsls r0, r5, 2 - add r0, r8 - lsls r0, 3 - adds r0, r4 - movs r1, 0x2 - strh r1, [r0, 0x8] - bl _080DA100 -_080D8D56: - adds r0, r6, 0 - bl sub_80DF080 - bl sub_80DF750 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r6, 3 - subs r0, r6 - lsls r0, 2 - adds r2, r0, r1 - ldrb r1, [r2, 0xC] - movs r0, 0x6 - ands r0, r1 - cmp r0, 0 - bne _080D8D86 - ldrb r1, [r2, 0xB] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - beq _080D8DA4 -_080D8D86: - ldr r0, =0x03005e00 - mov r2, r8 - lsls r1, r2, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0x1F - strh r0, [r1, 0x8] - bl _080DA100 - .pool -_080D8DA4: - bl sub_80DB89C - ldr r0, =0x03005e00 - mov r3, r8 - lsls r1, r3, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - strh r6, [r1, 0x1C] - movs r0, 0x3 - strh r0, [r1, 0x8] - bl _080DA100 - .pool -_080D8DC4: - mov r4, r8 - lsls r4, 2 - mov r10, r4 - ldr r1, =0x020244e4 - movs r2, 0 - adds r0, r1, 0x3 -_080D8DD0: - strb r2, [r0] - subs r0, 0x1 - cmp r0, r1 - bge _080D8DD0 - movs r7, 0x4 - mov r5, r9 - ldr r0, [r5] - ldr r0, [r0, 0x18] - movs r1, 0 - movs r2, 0x14 - bl memset - ldr r0, [r5] - ldr r0, [r0] - ldrb r0, [r0, 0x11] - bl sub_80DE9DC - ldr r4, =0x02039e00 - ldr r0, [r5] - ldr r0, [r0] - ldrb r3, [r0, 0x11] - lsls r2, r3, 6 - adds r0, r2, r4 - ldrh r0, [r0] - adds r1, r4, 0 - adds r1, 0x3C - adds r1, r2, r1 - ldr r1, [r1] - adds r4, 0x38 - adds r2, r4 - ldr r2, [r2] - bl sub_80DB174 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, =0x02020630 - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r3, r0, r2 - movs r1, 0x78 - strh r1, [r3, 0x24] - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_80DA134 - str r1, [r0] - ldr r0, =0x03005e00 - mov r4, r10 - add r4, r8 - lsls r4, 3 - adds r4, r0 - strh r5, [r4, 0xC] - ldr r1, =0x020241e4 - ldr r0, =0x0202420b - ldrb r0, [r0] - adds r0, r1 - strb r5, [r0] - mov r1, r9 - ldr r0, [r1] - ldr r0, [r0] - ldrb r0, [r0, 0x11] - bl sub_80DC9EC - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_80DCBE8 - strh r7, [r4, 0x8] - bl _080DA100 - .pool -_080D8E7C: - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r2, r0, r4 - ldrb r5, [r2, 0xC] - ldr r1, =0x02020630 - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r1, 0x1C - adds r0, r1 - ldr r1, [r0] - ldr r0, =DummyObjectCallback - cmp r1, r0 - beq _080D8EA0 - bl _080DA100 -_080D8EA0: - mov r3, r9 - ldr r0, [r3] - ldr r1, [r0, 0x14] - lsls r0, r6, 2 - adds r0, r1 - ldrb r1, [r0, 0x2] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080D8EB8 - bl _080DA100 -_080D8EB8: - movs r0, 0x5 - strh r0, [r2, 0x8] - bl _080DA100 - .pool -_080D8EC8: - mov r5, r9 - ldr r0, [r5] - ldr r1, [r0, 0x4] - lsls r0, r6, 3 - subs r0, r6 - lsls r5, r0, 2 - adds r1, r5, r1 - ldrb r1, [r1, 0xC] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080D8EF2 - mov r1, r8 - lsls r0, r1, 2 - add r0, r8 - lsls r0, 3 - adds r0, r4 - movs r1, 0x21 - strh r1, [r0, 0x8] - bl _080DA100 -_080D8EF2: - bl sub_80DB89C - ldr r0, =0x02021cc4 - lsls r1, r6, 6 - ldr r2, =0x02039e02 - adds r1, r2 - bl CopyString - mov r2, r9 - ldr r0, [r2] - ldr r0, [r0, 0x4] - adds r3, r5, r0 - ldrh r1, [r3, 0x6] - movs r0, 0xB1 - lsls r0, 1 - cmp r1, r0 - bhi _080D8F38 - ldr r0, =0x02021dc4 - adds r2, r1, 0 - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - b _080D8F48 - .pool -_080D8F38: - ldr r0, =0x02021dc4 - ldr r2, =gUnknown_08587F1C - ldrb r1, [r3, 0xA] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl CopyString -_080D8F48: - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_0827D55A - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80DEC30 - ldr r1, =0x03005e00 - mov r3, r8 - lsls r0, r3, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0x6 - strh r1, [r0, 0x8] - bl _080DA100 - .pool -_080D8F84: - bl sub_80DED4C - adds r1, r0, 0 - cmp r1, 0 - beq _080D8F92 - bl _080DA100 -_080D8F92: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0] - adds r0, 0x5A - strb r1, [r0] - ldr r1, =0x03005e00 - mov r4, r8 - lsls r0, r4, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0x7 - strh r1, [r0, 0x8] - bl _080DA100 - .pool -_080D8FB8: - mov r5, r9 - ldr r1, [r5] - ldr r0, [r1] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x6] - bl sub_80DE834 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, [r5] - ldr r0, [r0] - ldrb r0, [r0, 0x11] - bl sub_80DE864 - ldr r0, [r5] - ldr r0, [r0] - ldrb r0, [r0, 0x11] - bl sub_80DE9DC - adds r0, r4, 0 - bl sub_80DEAA8 - adds r0, r4, 0 - bl move_anim_start_t1 - ldr r1, =0x03005e00 - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - strh r1, [r0, 0x8] - bl _080DA100 - .pool -_080D9010: - ldr r0, =0x020383f8 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =0x020383fd - ldrb r4, [r0] - cmp r4, 0 - beq _080D9024 - bl _080DA100 -_080D9024: - adds r0, r6, 0 - bl sub_80DE9B0 - ldr r0, =0x02039f34 - ldr r1, [r0] - ldr r0, [r1] - adds r0, 0x5A - ldrb r0, [r0] - cmp r0, 0 - beq _080D9060 - ldr r0, =0x03005e00 - mov r3, r8 - lsls r1, r3, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - strh r4, [r1, 0x1C] - movs r0, 0x9 - strh r0, [r1, 0x8] - bl _080DA100 - .pool -_080D9060: - ldr r1, [r1, 0x4] - lsls r0, r6, 3 - subs r0, r6 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x15] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _080D907A - adds r0, r6, 0 - bl sub_80DC674 -_080D907A: - bl sub_80DE12C - ldr r0, =0x03005e00 - mov r4, r8 - lsls r1, r4, 2 - b _080D9192 - .pool -_080D908C: - mov r5, r8 - lsls r0, r5, 2 - add r0, r8 - lsls r0, 3 - adds r2, r0, r4 - ldrh r0, [r2, 0x1C] - adds r1, r0, 0x1 - strh r1, [r2, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1E - bgt _080D90A8 - bl _080DA100 -_080D90A8: - movs r0, 0 - strh r0, [r2, 0x1C] - movs r0, 0x7 - strh r0, [r2, 0x8] - bl _080DA100 -_080D90B4: - mov r0, r8 - lsls r2, r0, 2 - adds r0, r2, r0 - lsls r0, 3 - adds r7, r0, r4 - movs r0, 0 - strh r0, [r7, 0xA] - mov r1, r9 - ldr r0, [r1] - ldr r0, [r0, 0x4] - mov r12, r0 - lsls r1, r6, 3 - subs r0, r1, r6 - lsls r5, r0, 2 - mov r0, r12 - adds r3, r5, r0 - ldrb r0, [r3, 0x13] - mov r10, r2 - str r1, [sp, 0x4] - cmp r0, 0xFF - beq _080D90FA - ldrb r1, [r3, 0x13] - adds r0, r6, 0 - bl sub_80DD45C - mov r1, r9 - ldr r0, [r1] - ldr r0, [r0, 0x4] - adds r0, r5, r0 - movs r1, 0xFF - strb r1, [r0, 0x13] - movs r0, 0x18 - strh r0, [r7, 0x8] - bl _080DA100 -_080D90FA: - ldrb r0, [r3, 0x14] - cmp r0, 0xFF - beq _080D9178 - movs r7, 0 - cmp r7, r6 - beq _080D910E - mov r2, r12 - ldrb r0, [r2, 0x13] - cmp r0, 0xFF - bne _080D912C -_080D910E: - adds r7, 0x1 - cmp r7, 0x3 - bgt _080D912C - cmp r7, r6 - beq _080D910E - mov r3, r9 - ldr r0, [r3] - ldr r1, [r0, 0x4] - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x13] - cmp r0, 0xFF - beq _080D910E -_080D912C: - cmp r7, 0x4 - bne _080D9168 - mov r4, r9 - ldr r0, [r4] - ldr r0, [r0, 0x4] - ldr r5, [sp, 0x4] - subs r4, r5, r6 - lsls r4, 2 - adds r0, r4, r0 - ldrb r1, [r0, 0x14] - adds r0, r6, 0 - bl sub_80DD45C - mov r1, r9 - ldr r0, [r1] - ldr r0, [r0, 0x4] - adds r4, r0 - movs r0, 0xFF - strb r0, [r4, 0x14] - ldr r1, =0x03005e00 - mov r0, r10 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0x18 - strh r1, [r0, 0x8] - bl _080DA100 - .pool -_080D9168: - mov r0, r10 - add r0, r8 - lsls r0, 3 - adds r0, r4 - movs r1, 0x30 - strh r1, [r0, 0x8] - bl _080DA100 -_080D9178: - movs r0, 0x30 - strh r0, [r7, 0x8] - bl _080DA100 -_080D9180: - bl sub_80DED4C - cmp r0, 0 - beq _080D918C - bl _080DA100 -_080D918C: - ldr r0, =0x03005e00 - mov r2, r8 - lsls r1, r2, 2 -_080D9192: - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0x17 - strh r0, [r1, 0x8] - bl _080DA100 - .pool -_080D91A4: - mov r3, r9 - ldr r0, [r3] - ldr r1, [r0, 0x4] - lsls r0, r6, 3 - subs r0, r6 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x11] - movs r3, 0x3 - ands r3, r0 - cmp r3, 0x1 - bne _080D91C4 - movs r0, 0x5 - bl sub_80DD720 - b _080D91DA -_080D91C4: - cmp r3, 0x2 - bne _080D91D0 - movs r0, 0x6 - bl sub_80DD720 - b _080D91DA -_080D91D0: - cmp r3, 0x3 - bne _080D9208 - movs r0, 0x7 - bl sub_80DD720 -_080D91DA: - ldr r0, =0x03005e00 - mov r2, r8 - lsls r1, r2, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0x31 - strh r0, [r1, 0x8] - bl _080DA100 - .pool -_080D91F4: - mov r3, r9 - ldr r0, [r3] - ldr r0, [r0] - ldrb r1, [r0, 0x6] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080D9208 - bl _080DA100 -_080D9208: - mov r5, r8 - lsls r0, r5, 2 - add r0, r8 - lsls r0, 3 - adds r0, r4 - movs r1, 0x2F - strh r1, [r0, 0x8] - bl _080DA100 -_080D921A: - movs r0, 0x1 - bl sub_80DE008 - ldr r0, =0x03005e00 - mov r2, r8 - lsls r1, r2, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0xC - strh r0, [r1, 0x8] - bl _080DA100 - .pool -_080D9238: - mov r3, r9 - ldr r0, [r3] - ldr r1, [r0, 0x4] - lsls r0, r6, 3 - subs r0, r6 - lsls r0, 2 - adds r0, r1 - movs r4, 0x2 - ldrsh r1, [r0, r4] - movs r0, 0 - adds r2, r6, 0 - bl sub_80DC028 - ldr r1, =0x03005e00 - mov r5, r8 - lsls r0, r5, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0xD - strh r1, [r0, 0x8] - bl _080DA100 - .pool -_080D926C: - mov r0, r9 - ldr r1, [r0] - ldr r0, [r1] - ldrb r0, [r0, 0x11] - ldr r1, [r1, 0x14] - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x2] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080D9288 - bl _080DA100 -_080D9288: - mov r1, r8 - lsls r0, r1, 2 - add r0, r8 - lsls r0, 3 - adds r0, r4 - movs r1, 0x23 - strh r1, [r0, 0x8] - bl _080DA100 -_080D929A: - mov r2, r9 - ldr r0, [r2] - ldr r1, [r0, 0x4] - lsls r0, r6, 3 - subs r0, r6 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x10] - movs r0, 0x30 - ands r0, r1 - cmp r0, 0x10 - bne _080D92B8 - movs r0, 0x8 - bl sub_80DD720 -_080D92B8: - ldr r0, =0x03005e00 - mov r3, r8 - lsls r1, r3, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0x24 - strh r0, [r1, 0x8] - bl _080DA100 - .pool -_080D92D0: - mov r5, r9 - ldr r0, [r5] - ldr r0, [r0] - ldrb r1, [r0, 0x6] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080D92E4 - bl _080DA100 -_080D92E4: - mov r1, r8 - lsls r0, r1, 2 - add r0, r8 - lsls r0, 3 - adds r0, r4 - movs r1, 0x25 - strh r1, [r0, 0x8] - bl _080DA100 -_080D92F6: - adds r0, r6, 0 - movs r1, 0x1 - bl sub_80DB5B8 - lsls r0, 24 - cmp r0, 0 - beq _080D9320 - ldr r1, =0x03005e00 - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x1C] - movs r1, 0x26 - strh r1, [r0, 0x8] - bl _080DA100 - .pool -_080D9320: - ldr r0, =0x03005e00 - mov r3, r8 - lsls r1, r3, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - b _080D9354 - .pool -_080D9334: - mov r5, r8 - lsls r0, r5, 2 - add r0, r8 - lsls r0, 3 - adds r1, r0, r4 - ldrh r0, [r1, 0x1C] - adds r0, 0x1 - strh r0, [r1, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - bgt _080D9350 - bl _080DA100 -_080D9350: - movs r0, 0 - strh r0, [r1, 0x1C] -_080D9354: - movs r0, 0x32 - strh r0, [r1, 0x8] - bl _080DA100 -_080D935C: - adds r0, r6, 0 - bl sub_80DB798 - lsls r0, 24 - cmp r0, 0 - beq _080D936E - movs r0, 0x63 - bl audio_play -_080D936E: - ldr r0, =0x03005e00 - mov r2, r8 - lsls r1, r2, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0x19 - strh r0, [r1, 0x8] - bl _080DA100 - .pool -_080D9388: - mov r3, r8 - lsls r0, r3, 2 - add r0, r8 - lsls r0, 3 - adds r0, r4 - movs r1, 0 - strh r1, [r0, 0xA] - movs r1, 0x1A - strh r1, [r0, 0x8] - bl _080DA100 -_080D939E: - movs r3, 0 - movs r5, 0 - str r5, [sp] - mov r0, r8 - lsls r1, r0, 2 - adds r0, r1, r0 - lsls r0, 3 - adds r0, r4 - movs r2, 0xA - ldrsh r7, [r0, r2] - mov r10, r1 - cmp r7, 0x3 - bgt _080D9418 - ldr r5, =0x02039f26 - ldr r2, =0x02039f34 -_080D93BC: - movs r3, 0 - str r3, [sp] - adds r0, r3, 0 - cmp r0, r6 - beq _080D93E4 - ldrb r0, [r5] - cmp r0, r7 - bne _080D93E4 - ldr r0, [r2] - ldr r0, [r0, 0x4] - ldrb r0, [r0, 0x13] - cmp r0, 0xFF - beq _080D93E4 - movs r1, 0x1 - str r1, [sp] - b _080D940C - .pool -_080D93E4: - adds r3, 0x1 - cmp r3, 0x3 - bgt _080D940C - cmp r3, r6 - beq _080D93E4 - adds r0, r3, r5 - ldrb r0, [r0] - cmp r0, r7 - bne _080D93E4 - ldr r0, [r2] - ldr r1, [r0, 0x4] - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x13] - cmp r0, 0xFF - beq _080D93E4 - movs r0, 0x1 - str r0, [sp] -_080D940C: - ldr r1, [sp] - cmp r1, 0 - bne _080D9422 - adds r7, 0x1 - cmp r7, 0x3 - ble _080D93BC -_080D9418: - ldr r2, [sp] - lsls r0, r2, 24 - asrs r2, r0, 24 - cmp r2, 0 - beq _080D9464 -_080D9422: - mov r5, r10 - add r5, r8 - lsls r5, 3 - adds r5, r4 - ldr r0, =0x02039f26 - adds r0, r3, r0 - ldrb r0, [r0] - strh r0, [r5, 0xA] - lsls r0, r3, 24 - lsrs r0, 24 - mov r4, r9 - ldr r1, [r4] - ldr r1, [r1, 0x4] - lsls r4, r3, 3 - subs r4, r3 - lsls r4, 2 - adds r1, r4, r1 - ldrb r1, [r1, 0x13] - bl sub_80DD45C - mov r1, r9 - ldr r0, [r1] - ldr r0, [r0, 0x4] - adds r4, r0 - movs r0, 0xFF - strb r0, [r4, 0x13] - movs r0, 0x1B - strh r0, [r5, 0x8] - bl _080DA100 - .pool -_080D9464: - mov r0, r10 - add r0, r8 - lsls r0, 3 - adds r0, r4 - strh r2, [r0, 0xA] - strh r2, [r0, 0x1C] - movs r1, 0x33 - strh r1, [r0, 0x8] - bl sub_80DB884 - bl _080DA100 -_080D947C: - bl sub_80DED4C - cmp r0, 0 - beq _080D9488 - bl _080DA100 -_080D9488: - ldr r0, =0x03005e00 - mov r2, r8 - lsls r1, r2, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0x1C - strh r0, [r1, 0x8] - bl _080DA100 - .pool -_080D94A0: - movs r7, 0 - mov r3, r8 - lsls r0, r3, 2 - adds r1, r0, r3 - lsls r1, 3 - adds r1, r4 - movs r4, 0xA - ldrsh r2, [r1, r4] - ldr r1, =0x02039f26 - mov r10, r0 - adds r5, r1, 0 - ldrb r0, [r5] - cmp r2, r0 - beq _080D94CA - adds r1, r2, 0 - adds r2, r5, 0 -_080D94C0: - adds r7, 0x1 - adds r0, r7, r2 - ldrb r0, [r0] - cmp r1, r0 - bne _080D94C0 -_080D94CA: - mov r1, r9 - ldr r0, [r1] - ldr r1, [r0, 0x4] - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0xE] - ldrh r0, [r0, 0x2] - adds r0, r1 - lsls r0, 16 - asrs r0, 16 - negs r1, r1 - lsls r2, r7, 24 - lsrs r2, 24 - bl sub_80DC028 - ldr r1, =0x03005e00 - mov r0, r10 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1D - strh r1, [r0, 0x8] - bl _080DA100 - .pool -_080D9508: - movs r7, 0 - mov r2, r8 - lsls r0, r2, 2 - adds r1, r0, r2 - lsls r1, 3 - adds r1, r4 - movs r5, 0xA - ldrsh r3, [r1, r5] - ldr r1, =0x02039f26 - mov r10, r0 - adds r5, r1, 0 - ldrb r0, [r5] - cmp r3, r0 - beq _080D952E -_080D9524: - adds r7, 0x1 - adds r0, r7, r1 - ldrb r0, [r0] - cmp r3, r0 - bne _080D9524 -_080D952E: - mov r1, r9 - ldr r0, [r1] - ldr r1, [r0, 0x14] - lsls r0, r7, 2 - adds r0, r1 - ldrb r1, [r0, 0x2] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080D9546 - bl _080DA100 -_080D9546: - mov r0, r10 - add r0, r8 - lsls r0, 3 - adds r0, r4 - movs r1, 0x27 - strh r1, [r0, 0x8] - bl _080DA100 - .pool -_080D955C: - movs r7, 0 - mov r2, r8 - lsls r0, r2, 2 - adds r1, r0, r2 - lsls r1, 3 - adds r1, r4 - movs r3, 0xA - ldrsh r2, [r1, r3] - ldr r1, =0x02039f26 - mov r10, r0 - adds r5, r1, 0 - ldrb r4, [r5] - cmp r2, r4 - beq _080D9586 - adds r1, r2, 0 - adds r2, r5, 0 -_080D957C: - adds r7, 0x1 - adds r0, r7, r2 - ldrb r0, [r0] - cmp r1, r0 - bne _080D957C -_080D9586: - lsls r0, r7, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_80DB5B8 - lsls r0, 24 - cmp r0, 0 - beq _080D95B4 - ldr r1, =0x03005e00 - mov r0, r10 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x1C] - movs r1, 0x28 - strh r1, [r0, 0x8] - bl _080DA100 - .pool -_080D95B4: - ldr r0, =0x03005e00 - mov r1, r10 - add r1, r8 - lsls r1, 3 - adds r1, r0 - b _080D95E4 - .pool -_080D95C4: - mov r5, r8 - lsls r0, r5, 2 - add r0, r8 - lsls r0, 3 - adds r1, r0, r4 - ldrh r0, [r1, 0x1C] - adds r0, 0x1 - strh r0, [r1, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - bgt _080D95E0 - bl _080DA100 -_080D95E0: - movs r0, 0 - strh r0, [r1, 0x1C] -_080D95E4: - movs r0, 0x1E - strh r0, [r1, 0x8] - bl _080DA100 -_080D95EC: - movs r7, 0 - ldr r2, =0x02039f26 - ldrb r3, [r2] - mov r0, r8 - lsls r1, r0, 2 - adds r0, r1, r0 - lsls r0, 3 - adds r4, r0, r4 - movs r5, 0xA - ldrsh r0, [r4, r5] - mov r10, r1 - adds r5, r2, 0 - cmp r3, r0 - beq _080D961E - adds r3, r5, 0 - adds r2, r4, 0 -_080D960C: - adds r7, 0x1 - cmp r7, 0x3 - bgt _080D961E - adds r0, r7, r3 - ldrb r1, [r0] - movs r4, 0xA - ldrsh r0, [r2, r4] - cmp r1, r0 - bne _080D960C -_080D961E: - lsls r4, r7, 24 - lsrs r0, r4, 24 - bl sub_80DB798 - lsls r0, 24 - adds r6, r4, 0 - cmp r0, 0 - beq _080D963C - movs r0, 0x63 - bl audio_play - b _080D9642 - .pool -_080D963C: - movs r0, 0x64 - bl audio_play -_080D9642: - ldr r5, =0x02039f34 - ldr r0, [r5] - ldr r1, [r0, 0x4] - lsls r0, r7, 3 - subs r0, r7 - lsls r4, r0, 2 - adds r1, r4, r1 - ldrb r1, [r1, 0x15] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080D9670 - lsrs r0, r6, 24 - bl sub_80DC674 - ldr r0, [r5] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r2, [r1, 0x15] - movs r0, 0x21 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x15] -_080D9670: - ldr r0, =0x03005e00 - mov r1, r10 - add r1, r8 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - movs r0, 0x1A - strh r0, [r1, 0x8] - bl _080DA100 - .pool -_080D9690: - mov r5, r8 - lsls r2, r5, 2 - adds r0, r2, r5 - lsls r0, 3 - adds r4, r0, r4 - ldrh r0, [r4, 0x1C] - adds r1, r0, 0x1 - strh r1, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - mov r10, r2 - cmp r0, 0x9 - bgt _080D96AE - bl _080DA100 -_080D96AE: - movs r0, 0 - strh r0, [r4, 0x1C] - mov r1, r9 - ldr r0, [r1] - ldr r1, [r0, 0x4] - lsls r0, r6, 3 - subs r0, r6 - lsls r0, 2 - adds r2, r0, r1 - ldrb r1, [r2, 0xC] - movs r0, 0x6 - ands r0, r1 - cmp r0, 0 - bne _080D96D4 - ldrb r1, [r2, 0x11] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080D96F6 -_080D96D4: - bl sub_80DB89C - ldr r0, =0x02021cc4 - lsls r1, r6, 6 - ldr r2, =0x02039e02 - adds r1, r2 - bl CopyString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_0827E793 - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80DEC30 -_080D96F6: - ldr r0, =0x03005e00 - mov r1, r10 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0x34 - strh r0, [r1, 0x8] - bl _080DA100 - .pool -_080D971C: - bl sub_80DED4C - cmp r0, 0 - beq _080D9728 - bl _080DA100 -_080D9728: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r6, 3 - subs r0, r6 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x15] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _080D975C - ldr r0, =0x03005e00 - mov r2, r8 - lsls r1, r2, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0x11 - strh r0, [r1, 0x8] - bl _080DA100 - .pool -_080D975C: - ldr r0, =0x03005e00 - mov r3, r8 - lsls r1, r3, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0xE - strh r0, [r1, 0x8] - bl _080DA100 - .pool -_080D9774: - mov r4, r9 - ldr r0, [r4] - ldr r1, [r0, 0x4] - lsls r0, r6, 3 - subs r0, r6 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x16] - lsls r4, r0, 24 - lsrs r5, r4, 24 - cmp r5, 0 - beq _080D97DC - bl sub_80DB89C - asrs r0, r4, 24 - cmp r0, 0x1 - bne _080D97A0 - ldr r0, =gUnknown_0827E32E - b _080D97A6 - .pool -_080D97A0: - cmp r0, 0x2 - bne _080D97B4 - ldr r0, =gUnknown_0827E35B -_080D97A6: - movs r1, 0x1 - bl sub_80DEC30 - b _080D97BC - .pool -_080D97B4: - ldr r0, =gUnknown_0827E38D - movs r1, 0x1 - bl sub_80DEC30 -_080D97BC: - movs r0, 0x3 - bl sub_80DD720 - ldr r1, =0x03005e00 - mov r5, r8 - lsls r0, r5, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x1C] - b _080D9812 - .pool -_080D97DC: - bl sub_80DB89C - ldr r0, =0x02021cc4 - lsls r1, r6, 6 - ldr r2, =0x02039e02 - adds r1, r2 - bl CopyString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_0827E2FE - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80DEC30 - movs r0, 0x2 - bl sub_80DD720 - ldr r1, =0x03005e00 - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0x1C] -_080D9812: - movs r1, 0x2D - strh r1, [r0, 0x8] - bl _080DA100 - .pool -_080D9830: - mov r3, r9 - ldr r0, [r3] - ldr r2, [r0] - ldrb r1, [r2, 0x6] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080D9844 - bl _080DA100 -_080D9844: - ldrb r0, [r2, 0x11] - bl sub_80DC9B4 - ldr r1, =0x03005e00 - mov r4, r8 - lsls r0, r4, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0xF - strh r1, [r0, 0x8] - bl _080DA100 - .pool -_080D9864: - bl sub_80DED4C - cmp r0, 0 - beq _080D9870 - bl _080DA100 -_080D9870: - ldr r1, =0x03005e00 - mov r5, r8 - lsls r0, r5, 2 - add r0, r8 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - strh r0, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x32 - bgt _080D988E - bl _080DA100 -_080D988E: - ldr r7, =0x02039f34 - ldr r0, [r7] - ldr r1, [r0, 0x4] - lsls r0, r6, 3 - subs r0, r6 - lsls r5, r0, 2 - adds r2, r5, r1 - ldrb r1, [r2, 0x15] - movs r0, 0x10 - mov r8, r0 - ands r0, r1 - cmp r0, 0 - bne _080D98C2 - movs r1, 0x2 - ldrsh r0, [r2, r1] - ldrb r1, [r2, 0x17] - adds r2, r6, 0 - bl sub_80DC028 - ldr r0, [r7] - ldr r1, [r0, 0x4] - adds r1, r5, r1 - ldrh r0, [r1, 0x2] - ldrb r2, [r1, 0x17] - adds r0, r2 - strh r0, [r1, 0x2] -_080D98C2: - mov r3, r8 - strh r3, [r4, 0x8] - bl _080DA100 - .pool -_080D98D4: - mov r5, r9 - ldr r0, [r5] - ldr r1, [r0, 0x14] - lsls r0, r6, 2 - adds r0, r1 - ldrb r1, [r0, 0x2] - movs r0, 0x4 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _080D98F0 - bl _080DA100 -_080D98F0: - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r0, r4 - strh r1, [r0, 0x1C] - movs r1, 0x11 - strh r1, [r0, 0x8] - bl _080DA100 -_080D9904: - mov r3, r9 - ldr r0, [r3] - ldr r1, [r0, 0x4] - lsls r0, r6, 3 - subs r0, r6 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x15] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080D996C - bl sub_80DB89C - ldr r0, =0x02021cc4 - lsls r1, r6, 6 - ldr r2, =0x02039e02 - adds r1, r2 - bl CopyString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_0827E6E3 - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80DEC30 - ldr r0, =0x03005e00 - mov r5, r8 - lsls r4, r5, 2 - add r4, r8 - lsls r4, 3 - adds r4, r0 - movs r0, 0 - strh r0, [r4, 0x1C] - bl sub_80DD720 - movs r0, 0x2E - strh r0, [r4, 0x8] - b _080DA100 - .pool -_080D996C: - mov r1, r8 - lsls r0, r1, 2 - add r0, r8 - lsls r0, 3 - adds r0, r4 - movs r1, 0x29 - strh r1, [r0, 0x8] - b _080DA100 -_080D997C: - mov r2, r9 - ldr r0, [r2] - ldr r0, [r0] - ldrb r1, [r0, 0x6] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080D998E - b _080DA100 -_080D998E: - mov r3, r8 - lsls r0, r3, 2 - add r0, r8 - lsls r0, 3 - adds r0, r4 - movs r1, 0x13 - strh r1, [r0, 0x8] - b _080DA100 -_080D999E: - bl sub_80DED4C - cmp r0, 0 - beq _080D99A8 - b _080DA100 -_080D99A8: - ldr r5, =0x02039f34 - ldr r0, [r5] - ldr r1, [r0, 0x4] - lsls r4, r6, 3 - subs r4, r6 - lsls r4, 2 - adds r1, r4, r1 - movs r2, 0x2 - ldrsh r0, [r1, r2] - ldrb r1, [r1, 0x18] - negs r1, r1 - adds r2, r6, 0 - bl sub_80DC028 - ldr r0, [r5] - ldr r0, [r0, 0x4] - adds r4, r0 - ldrb r1, [r4, 0x18] - ldrh r0, [r4, 0x2] - subs r0, r1 - strh r0, [r4, 0x2] - ldr r1, =0x03005e00 - mov r3, r8 - lsls r0, r3, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0x12 - strh r1, [r0, 0x8] - b _080DA100 - .pool -_080D99EC: - bl sub_80DCD48 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0x14] - lsls r0, r6, 2 - adds r0, r1 - ldrb r1, [r0, 0x2] - movs r0, 0x4 - ands r0, r1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _080D9A0A - b _080DA100 -_080D9A0A: - ldr r0, =0x03005e00 - mov r5, r8 - lsls r4, r5, 2 - add r4, r8 - lsls r4, 3 - adds r4, r0 - strh r3, [r4, 0x1C] - bl sub_80DB89C - movs r0, 0x29 - strh r0, [r4, 0x8] - b _080DA100 - .pool -_080D9A2C: - mov r1, r9 - ldr r0, [r1] - ldr r2, [r0, 0x10] - ldrb r1, [r2, 0x1] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080D9A56 - ldr r0, [r2] - lsls r0, 20 - lsrs r0, 29 - cmp r6, r0 - beq _080D9A56 - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r0, r4 - movs r1, 0x39 - strh r1, [r0, 0x8] - b _080DA100 -_080D9A56: - mov r3, r9 - ldr r1, [r3] - ldr r0, [r1, 0x10] - ldrb r0, [r0] - str r0, [sp] - ldr r1, [r1, 0x4] - lsls r2, r6, 3 - subs r0, r2, r6 - lsls r0, 2 - adds r5, r0, r1 - ldrb r1, [r5, 0x11] - movs r0, 0x10 - ands r0, r1 - str r2, [sp, 0x4] - cmp r0, 0 - beq _080D9A94 - movs r4, 0x1 - str r4, [sp] - ldr r0, =0x02021ec4 - ldrh r2, [r5, 0x6] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - b _080D9AAE - .pool -_080D9A94: - ldr r0, =0x02021ec4 - ldr r3, =gUnknown_08587F08 - ldr r2, =gContestMoves - ldrh r1, [r5, 0x6] - lsls r1, 3 - adds r1, r2 - ldrb r1, [r1, 0x1] - lsls r1, 29 - lsrs r1, 27 - adds r1, r3 - ldr r1, [r1] - bl CopyString -_080D9AAE: - ldr r5, [sp] - lsls r0, r5, 24 - cmp r0, 0 - ble _080D9AD2 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0x4] - ldr r2, [sp, 0x4] - subs r0, r2, r6 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x15] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080D9AD2 - movs r3, 0 - str r3, [sp] -_080D9AD2: - bl sub_80DB89C - ldr r0, =0x02021cc4 - lsls r1, r6, 6 - ldr r2, =0x02039e02 - adds r1, r2 - bl CopyString - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r1, [r0] - ldrb r0, [r1, 0x13] - ldr r5, [sp] - lsls r2, r5, 24 - asrs r3, r2, 24 - adds r0, r3, r0 - strb r0, [r1, 0x13] - ldr r0, [r4] - ldr r1, [r0] - movs r0, 0x13 - ldrsb r0, [r1, r0] - adds r5, r2, 0 - cmp r0, 0 - bge _080D9B06 - movs r0, 0 - strb r0, [r1, 0x13] -_080D9B06: - cmp r3, 0 - bne _080D9B30 - ldr r0, =0x03005e00 - mov r2, r8 - lsls r1, r2, 2 - b _080D9F58 - .pool -_080D9B30: - cmp r3, 0 - bge _080D9B48 - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_0827E73C - bl ExpandStringRefs - b _080D9B74 - .pool -_080D9B48: - cmp r3, 0 - ble _080D9B6C - ldr r0, [r4] - ldr r0, [r0] - ldrb r0, [r0, 0x13] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x4 - bgt _080D9B6C - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_0827E717 - bl ExpandStringRefs - b _080D9B74 - .pool -_080D9B6C: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_0827E76A - bl ExpandStringRefs -_080D9B74: - ldr r0, =0x02021fc4 - movs r1, 0x1 - bl sub_80DEC30 - ldr r1, =0x03005e00 - mov r3, r8 - lsls r0, r3, 2 - add r0, r8 - lsls r0, 3 - adds r1, r0, r1 - movs r0, 0 - strh r0, [r1, 0x1C] - strh r0, [r1, 0x1E] - cmp r5, 0 - bge _080D9BA4 - movs r0, 0x35 - strh r0, [r1, 0x8] - b _080DA100 - .pool -_080D9BA4: - movs r0, 0x36 - strh r0, [r1, 0x8] - b _080DA100 -_080D9BAA: - mov r5, r8 - lsls r0, r5, 2 - add r0, r8 - lsls r0, 3 - adds r4, r0, r4 - movs r0, 0x1C - ldrsh r3, [r4, r0] - cmp r3, 0x1 - beq _080D9BE8 - cmp r3, 0x1 - bgt _080D9BC6 - cmp r3, 0 - beq _080D9BD0 - b _080DA100 -_080D9BC6: - cmp r3, 0x2 - beq _080D9C0C - cmp r3, 0x3 - beq _080D9C46 - b _080DA100 -_080D9BD0: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x1 - bl sub_80DDED0 - ldr r0, =0x00000187 - bl fanfare_play - b _080D9C3E - .pool -_080D9BE8: - mov r1, r9 - ldr r0, [r1] - ldr r0, [r0] - ldrb r0, [r0, 0x7] - ands r3, r0 - cmp r3, 0 - beq _080D9BF8 - b _080DA100 -_080D9BF8: - bl sub_80DED4C - cmp r0, 0 - beq _080D9C02 - b _080DA100 -_080D9C02: - movs r0, 0x1 - negs r0, r0 - bl sub_80DDCDC - b _080D9C3E -_080D9C0C: - mov r2, r9 - ldr r0, [r2] - ldr r0, [r0] - ldrb r1, [r0, 0x6] - movs r0, 0x20 - ands r0, r1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _080D9C22 - b _080DA100 -_080D9C22: - ldrh r0, [r4, 0x1E] - adds r1, r0, 0x1 - strh r1, [r4, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1D - bgt _080D9C32 - b _080DA100 -_080D9C32: - strh r2, [r4, 0x1E] - movs r1, 0x1 - negs r1, r1 - adds r0, r1, 0 - bl sub_80DDED0 -_080D9C3E: - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - strh r0, [r4, 0x1C] - b _080DA100 -_080D9C46: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _080D9C58 - b _080DA100 -_080D9C58: - strh r0, [r4, 0x1C] - strh r0, [r4, 0x1E] - movs r0, 0x2B - strh r0, [r4, 0x8] - b _080DA100 - .pool -_080D9C68: - mov r3, r8 - lsls r1, r3, 2 - adds r0, r1, r3 - lsls r0, 3 - adds r0, r4 - movs r5, 0x1C - ldrsh r0, [r0, r5] - mov r10, r1 - cmp r0, 0x4 - bls _080D9C7E - b _080DA100 -_080D9C7E: - lsls r0, 2 - ldr r1, =_080D9C8C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080D9C8C: - .4byte _080D9CA0 - .4byte _080D9CB0 - .4byte _080D9CD4 - .4byte _080D9D3E - .4byte _080D9D84 -_080D9CA0: - bl sub_80DED4C - cmp r0, 0 - beq _080D9CAA - b _080DA100 -_080D9CAA: - movs r0, 0x1 - movs r1, 0x1 - b _080D9D68 -_080D9CB0: - mov r1, r9 - ldr r0, [r1] - ldr r0, [r0] - ldrb r1, [r0, 0x7] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080D9CC2 - b _080DA100 -_080D9CC2: - bl sub_80DDE0C - movs r0, 0xDF - bl audio_play - movs r0, 0x1 - bl sub_80DDCDC - b _080D9D6C -_080D9CD4: - mov r3, r9 - ldr r2, [r3] - ldr r0, [r2] - ldrb r1, [r0, 0x6] - movs r0, 0x20 - ands r0, r1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _080D9CEA - b _080DA100 -_080D9CEA: - mov r0, r10 - add r0, r8 - lsls r0, 3 - adds r5, r0, r4 - ldrh r0, [r5, 0x1E] - adds r1, r0, 0x1 - strh r1, [r5, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1D - bgt _080D9D02 - b _080DA100 -_080D9D02: - strh r3, [r5, 0x1E] - ldr r0, [r2, 0x4] - lsls r4, r6, 3 - subs r4, r6 - lsls r4, 2 - adds r0, r4, r0 - movs r1, 0x2 - ldrsh r0, [r0, r1] - ldr r1, [r2, 0x10] - ldrb r1, [r1, 0x2] - lsls r1, 24 - asrs r1, 24 - adds r2, r6, 0 - bl sub_80DC028 - mov r2, r9 - ldr r1, [r2] - ldr r0, [r1, 0x4] - adds r4, r0 - ldr r0, [r1, 0x10] - ldrb r0, [r0, 0x2] - lsls r0, 24 - asrs r0, 24 - ldrh r3, [r4, 0x2] - adds r0, r3 - strh r0, [r4, 0x2] - ldrh r0, [r5, 0x1C] - adds r0, 0x1 - strh r0, [r5, 0x1C] - b _080DA100 -_080D9D3E: - mov r4, r9 - ldr r2, [r4] - ldr r1, [r2, 0x14] - lsls r0, r6, 2 - adds r0, r1 - ldrb r1, [r0, 0x2] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080D9D54 - b _080DA100 -_080D9D54: - ldr r0, [r2] - ldrb r1, [r0, 0x6] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080D9D62 - b _080DA100 -_080D9D62: - movs r1, 0x1 - negs r1, r1 - movs r0, 0x1 -_080D9D68: - bl sub_80DDED0 -_080D9D6C: - ldr r0, =0x03005e00 - mov r1, r10 - add r1, r8 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x1C] - adds r0, 0x1 - strh r0, [r1, 0x1C] - b _080DA100 - .pool -_080D9D84: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _080D9D96 - b _080DA100 -_080D9D96: - mov r0, r10 - add r0, r8 - lsls r0, 3 - adds r0, r4 - strh r3, [r0, 0x1C] - strh r3, [r0, 0x1E] - movs r1, 0x2B - strh r1, [r0, 0x8] - b _080DA100 - .pool -_080D9DAC: - mov r5, r9 - ldr r0, [r5] - ldr r1, [r0, 0x14] - lsls r0, r6, 2 - adds r0, r1 - ldrb r1, [r0, 0x2] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080D9DC2 - b _080DA100 -_080D9DC2: - bl sub_80DB89C - ldr r0, =0x03005e00 - mov r2, r8 - lsls r1, r2, 2 - b _080D9F58 - .pool -_080D9DD4: - bl sub_80DB89C - ldr r0, =0x02021ec4 - ldr r5, =0x02039f34 - ldr r1, [r5] - ldr r1, [r1, 0x10] - ldr r1, [r1] - lsls r1, 20 - lsrs r1, 29 - lsls r1, 6 - ldr r4, =0x02039e02 - adds r1, r4 - bl CopyString - ldr r0, =0x02021cc4 - lsls r1, r6, 6 - adds r1, r4 - bl CopyString - ldr r0, =0x02021dc4 - ldr r1, [r5] - ldr r2, [r1, 0x4] - lsls r1, r6, 3 - subs r1, r6 - lsls r1, 2 - adds r1, r2 - ldrh r2, [r1, 0x6] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_0827E7EA - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80DEC30 - ldr r1, =0x03005e00 - mov r3, r8 - lsls r0, r3, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0x3A - strh r1, [r0, 0x8] - b _080DA100 - .pool -_080D9E60: - bl sub_80DED4C - cmp r0, 0 - beq _080D9E6A - b _080DA100 -_080D9E6A: - bl sub_80DB89C - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_0827E817 - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80DEC30 - ldr r1, =0x03005e00 - mov r4, r8 - lsls r0, r4, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0x3B - strh r1, [r0, 0x8] - b _080DA100 - .pool -_080D9EA0: - bl sub_80DED4C - cmp r0, 0 - beq _080D9EAA - b _080DA100 -_080D9EAA: - bl sub_80DB89C - ldr r0, =0x03005e00 - mov r5, r8 - lsls r1, r5, 2 - b _080D9F58 - .pool -_080D9EBC: - mov r1, r9 - ldr r0, [r1] - ldr r1, [r0, 0x4] - lsls r0, r6, 3 - subs r0, r6 - lsls r4, r0, 2 - adds r2, r4, r1 - ldrb r1, [r2, 0x15] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080D9EDC - movs r0, 0x11 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x15] -_080D9EDC: - adds r0, r6, 0 - bl sub_80DC9B4 - ldr r0, =0x02021cc4 - lsls r1, r6, 6 - ldr r2, =0x02039e02 - adds r1, r2 - bl CopyString - ldr r0, =0x02021dc4 - mov r2, r9 - ldr r1, [r2] - ldr r1, [r1, 0x4] - adds r1, r4, r1 - ldrh r2, [r1, 0x6] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_0827E58A - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80DEC30 - ldr r1, =0x03005e00 - mov r3, r8 - lsls r0, r3, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0x22 - strh r1, [r0, 0x8] - b _080DA100 - .pool -_080D9F48: - bl sub_80DED4C - cmp r0, 0 - beq _080D9F52 - b _080DA100 -_080D9F52: - ldr r0, =0x03005e00 - mov r4, r8 - lsls r1, r4, 2 -_080D9F58: - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0x37 - strh r0, [r1, 0x8] - b _080DA100 - .pool -_080D9F68: - bl sub_80DDBE8 - ldr r0, =0x03005e00 - mov r5, r8 - lsls r1, r5, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0x38 - strh r0, [r1, 0x8] - b _080DA100 - .pool -_080D9F84: - mov r1, r9 - ldr r0, [r1] - ldr r2, [r0] - ldrb r1, [r2, 0x6] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _080D9F9A - b _080DA100 -_080D9F9A: - movs r0, 0x13 - ldrsb r0, [r2, r0] - cmp r0, 0x4 - ble _080D9FA8 - strb r1, [r2, 0x13] - bl sub_80DD940 -_080D9FA8: - ldr r0, =0x03005e00 - mov r2, r8 - lsls r1, r2, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0xA - strh r0, [r1, 0x8] - b _080DA100 - .pool -_080D9FC0: - mov r3, r8 - lsls r2, r3, 2 - add r2, r8 - lsls r2, 3 - adds r2, r4 - ldrb r5, [r2, 0xC] - ldr r1, =0x02020630 - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_80DA164 - str r1, [r0] - movs r0, 0xB - strh r0, [r2, 0x8] - b _080DA100 - .pool -_080D9FEC: - mov r5, r8 - lsls r0, r5, 2 - add r0, r8 - lsls r0, 3 - adds r4, r0, r4 - ldrb r5, [r4, 0xC] - ldr r1, =0x02020630 - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r6, r0, r1 - adds r0, r6, 0 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _080DA100 - adds r0, r6, 0 - bl obj_free_rotscale_entry - adds r0, r6, 0 - bl RemoveObjectAndFreeTiles - movs r0, 0x14 - strh r0, [r4, 0x8] - b _080DA100 - .pool -_080DA024: - mov r1, r8 - lsls r0, r1, 2 - add r0, r8 - lsls r0, 3 - adds r0, r4 - movs r1, 0 - strh r1, [r0, 0x1C] - movs r1, 0x15 - strh r1, [r0, 0x8] - b _080DA100 -_080DA038: - bl sub_80DB89C - ldr r0, =0x02021cc4 - lsls r1, r6, 6 - ldr r2, =0x02039e02 - adds r1, r2 - bl CopyString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_0827D56F - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80DEC30 - ldr r1, =0x03005e00 - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0x20 - strh r1, [r0, 0x8] - b _080DA100 - .pool -_080DA080: - bl sub_80DED4C - cmp r0, 0 - bne _080DA100 - ldr r0, =0x03005e00 - mov r3, r8 - lsls r1, r3, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0x15 - strh r0, [r1, 0x8] - b _080DA100 - .pool -_080DA0A0: - mov r5, r8 - lsls r0, r5, 2 - add r0, r8 - lsls r0, 3 - adds r1, r0, r4 - ldrh r0, [r1, 0x1C] - adds r0, 0x1 - strh r0, [r1, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1D - ble _080DA100 - movs r0, 0 - strh r0, [r1, 0x1C] - movs r0, 0x16 - strh r0, [r1, 0x8] - b _080DA100 -_080DA0C2: - mov r1, r9 - ldr r0, [r1] - ldr r1, [r0] - ldrb r0, [r1, 0x10] - adds r0, 0x1 - movs r2, 0 - strb r0, [r1, 0x10] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bne _080DA0F4 - mov r3, r8 - lsls r0, r3, 2 - add r0, r8 - lsls r0, 3 - adds r0, r4 - strh r2, [r0, 0x8] - strh r2, [r0, 0xA] - strh r2, [r0, 0xC] - ldr r1, =sub_80DA198 - str r1, [r0] - b _080DA100 - .pool -_080DA0F4: - mov r5, r8 - lsls r0, r5, 2 - add r0, r8 - lsls r0, 3 - adds r0, r4 - strh r2, [r0, 0x8] -_080DA100: - 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 sub_80D8B38 - - thumb_func_start sub_80DA110 -sub_80DA110: @ 80DA110 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02039f34 - ldr r1, [r1] - ldr r3, [r1] - ldrb r2, [r3, 0x7] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r3, 0x7] - bl DestroyTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA110 - - thumb_func_start sub_80DA134 -sub_80DA134: @ 80DA134 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x24] - movs r3, 0x24 - ldrsh r2, [r1, r3] - cmp r2, 0 - beq _080DA148 - subs r0, 0x2 - strh r0, [r1, 0x24] - b _080DA15C -_080DA148: - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1F - bne _080DA15C - strh r2, [r1, 0x2E] - ldr r0, =DummyObjectCallback - str r0, [r1, 0x1C] -_080DA15C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA134 - - thumb_func_start sub_80DA164 -sub_80DA164: @ 80DA164 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x24] - subs r0, 0x6 - strh r0, [r2, 0x24] - movs r1, 0x20 - ldrsh r0, [r2, r1] - movs r3, 0x24 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - bge _080DA18E - ldr r0, =DummyObjectCallback - str r0, [r2, 0x1C] - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_080DA18E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA164 - - thumb_func_start sub_80DA198 -sub_80DA198: @ 80DA198 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r5, r1, r2 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _080DA22E - cmp r0, 0x1 - bgt _080DA1C0 - cmp r0, 0 - beq _080DA1C6 - b _080DA250 - .pool -_080DA1C0: - cmp r0, 0x2 - beq _080DA248 - b _080DA250 -_080DA1C6: - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r6, 0x1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _080DA224 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0] - ldrb r0, [r2, 0x7] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0x7] - bl sub_80DA8A4 - lsls r0, 24 - cmp r0, 0 - beq _080DA1F4 - bl sub_80DB944 - bl sub_80DBA18 -_080DA1F4: - ldr r4, =sub_80FCC88 - adds r0, r4, 0 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =sub_80DA110 - adds r1, r4, 0 - bl SetTaskFuncWithFollowupFunc - bl sub_80DBF68 - strh r6, [r5, 0x8] - b _080DA250 - .pool -_080DA224: - bl sub_80DB944 - bl sub_80DBA18 - b _080DA23E -_080DA22E: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0] - ldrb r1, [r0, 0x7] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _080DA250 -_080DA23E: - movs r0, 0x2 - strh r0, [r5, 0x8] - b _080DA250 - .pool -_080DA248: - movs r0, 0 - strh r0, [r5, 0x8] - ldr r0, =sub_80DA25C - str r0, [r5] -_080DA250: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA198 - - thumb_func_start sub_80DA25C -sub_80DA25C: @ 80DA25C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - bl sub_80DE008 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x8] - strh r1, [r0, 0xA] - ldr r1, =sub_80DA28C - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA25C - - thumb_func_start sub_80DA28C -sub_80DA28C: @ 80DA28C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - movs r0, 0x8 - ldrsh r5, [r4, r0] - cmp r5, 0x1 - beq _080DA2D2 - cmp r5, 0x1 - bgt _080DA2B4 - cmp r5, 0 - beq _080DA2BA - b _080DA312 - .pool -_080DA2B4: - cmp r5, 0x2 - beq _080DA304 - b _080DA312 -_080DA2BA: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _080DA312 - movs r0, 0x2 - bl sub_80DE69C - strh r5, [r4, 0xA] - b _080DA2F6 -_080DA2D2: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0] - ldrb r1, [r0, 0x7] - movs r0, 0x2 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _080DA312 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _080DA312 - strh r1, [r4, 0xA] -_080DA2F6: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080DA312 - .pool -_080DA304: - bl sub_80DC3AC - movs r0, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0xA] - ldr r0, =sub_80DA31C - str r0, [r4] -_080DA312: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA28C - - thumb_func_start sub_80DA31C -sub_80DA31C: @ 80DA31C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80DC3C4 - lsls r0, 24 - cmp r0, 0 - beq _080DA33A - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80DA348 - str r0, [r1] -_080DA33A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA31C - - thumb_func_start sub_80DA348 -sub_80DA348: @ 80DA348 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x0201a204 - ldr r3, =0x02037714 - ldr r1, =0x040000d4 - str r2, [r1] - str r3, [r1, 0x4] - ldr r2, =0x84000100 - str r2, [r1, 0x8] - ldr r1, [r1, 0x8] - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0 - strh r0, [r1, 0x8] - movs r0, 0x2 - strh r0, [r1, 0xA] - ldr r0, =sub_80DA38C - str r0, [r1] - bx lr - .pool - thumb_func_end sub_80DA348 - - thumb_func_start sub_80DA38C -sub_80DA38C: @ 80DA38C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _080DA3BE - movs r0, 0 - strh r0, [r1, 0x8] - ldrh r0, [r1, 0xA] - subs r0, 0x1 - strh r0, [r1, 0xA] - lsls r0, 16 - cmp r0, 0 - bne _080DA3BE - ldr r0, =sub_80DA3CC - str r0, [r1] -_080DA3BE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA38C - - thumb_func_start sub_80DA3CC -sub_80DA3CC: @ 80DA3CC - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r6, r1, r2 - movs r1, 0x8 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _080DA448 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r5, =0x02039f25 - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r4, [r0, 0x1A] - bl sub_80DB89C - ldr r0, =0x02021cc4 - ldrb r1, [r5] - lsls r1, 6 - ldr r2, =0x02039e02 - adds r1, r2 - bl CopyString - ldr r5, =0x02021fc4 - ldr r0, =gUnknown_08587D90 - lsls r4, 2 - adds r4, r0 - ldr r1, [r4] - adds r0, r5, 0 - bl ExpandStringRefs - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80DEC30 - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - b _080DA45A - .pool -_080DA448: - bl sub_80DED4C - cmp r0, 0 - bne _080DA45A - strh r0, [r6, 0x8] - ldr r0, =sub_80DA464 - str r0, [r6] - bl sub_80DCD48 -_080DA45A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA3CC - - thumb_func_start sub_80DA464 -sub_80DA464: @ 80DA464 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0x8] - adds r1, r0, 0x1 - strh r1, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1D - ble _080DA48E - movs r0, 0 - strh r0, [r4, 0x8] - bl sub_80DC3AC - ldr r0, =sub_80DA49C - str r0, [r4] -_080DA48E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA464 - - thumb_func_start sub_80DA49C -sub_80DA49C: @ 80DA49C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80DC3C4 - lsls r0, 24 - cmp r0, 0 - beq _080DA4BE - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x8] - ldr r1, =sub_80DA4CC - str r1, [r0] -_080DA4BE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA49C - - thumb_func_start sub_80DA4CC -sub_80DA4CC: @ 80DA4CC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_80DE224 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80DE424 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA4CC - - thumb_func_start sub_80DA4F4 -sub_80DA4F4: @ 80DA4F4 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_80DE350 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80DA51C - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA4F4 - - thumb_func_start sub_80DA51C -sub_80DA51C: @ 80DA51C - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x8 - bl GetGpuReg - mov r1, sp - strh r0, [r1] - movs r0, 0xC - bl GetGpuReg - mov r4, sp - adds r4, 0x2 - strh r0, [r4] - mov r3, sp - ldrb r2, [r3] - movs r1, 0x4 - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3] - ldrb r0, [r4] - ands r1, r0 - strb r1, [r4] - mov r0, sp - ldrh r1, [r0] - movs r0, 0x8 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0xC - bl SetGpuReg - ldr r2, =0x02039f34 - ldr r0, [r2] - ldr r1, [r0] - ldrb r0, [r1, 0x1] - adds r0, 0x1 - strb r0, [r1, 0x1] - ldr r0, [r2] - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x5 - bne _080DA590 - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80DA5E8 - b _080DA5A0 - .pool -_080DA590: - bl sub_80DDB0C - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80DA5B4 -_080DA5A0: - str r0, [r1] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA51C - - thumb_func_start sub_80DA5B4 -sub_80DA5B4: @ 80DA5B4 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0] - ldrb r1, [r0, 0x6] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _080DA5D8 - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80D833C - str r0, [r1] -_080DA5D8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA5B4 - - thumb_func_start sub_80DA5E8 -sub_80DA5E8: @ 80DA5E8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02022e16 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e1e - strh r1, [r0] - ldr r4, =0x02039f34 - movs r3, 0 - ldr r2, =0x02039f10 - movs r1, 0x3 -_080DA600: - ldr r0, [r4] - ldr r0, [r0, 0x4] - adds r0, r3, r0 - ldrh r0, [r0, 0x4] - strh r0, [r2] - adds r3, 0x1C - adds r2, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _080DA600 - bl sub_80DBD18 - bl sub_80DB89C - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080DA65C - ldr r0, =0x02039f34 - ldr r2, [r0] - ldr r0, =0x02039f25 - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x8] - bl sub_80ED03C - b _080DA668 - .pool -_080DA65C: - bl sub_80DF250 - bl sub_80DF4F8 - bl sub_80DF750 -_080DA668: - ldr r1, =0x030060b8 - ldr r0, =0x03005d80 - ldr r0, [r0] - str r0, [r1] - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_0827D597 - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80DEC30 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0xC] - ldr r1, =sub_80DA6B4 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA5E8 - - thumb_func_start sub_80DA6B4 -sub_80DA6B4: @ 80DA6B4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_80DED4C - adds r4, r0, 0 - cmp r4, 0 - bne _080DA6EA - bl sub_80DE224 - ldr r0, =0x02022e18 - strh r4, [r0] - ldr r1, =0x02022e1a - movs r0, 0xA0 - strh r0, [r1] - movs r0, 0x62 - movs r1, 0 - bl audio_play_and_stuff - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - strh r4, [r0, 0x8] - ldr r1, =sub_80DA700 - str r1, [r0] -_080DA6EA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA6B4 - - thumb_func_start sub_80DA700 -sub_80DA700: @ 80DA700 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, =0x02022e1a - ldrh r0, [r1] - subs r0, 0x7 - strh r0, [r1] - lsls r0, 16 - cmp r0, 0 - bge _080DA718 - movs r0, 0 - strh r0, [r1] -_080DA718: - ldrh r2, [r1] - cmp r2, 0 - bne _080DA72E - ldr r0, =0x03005e00 - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80DA740 - str r0, [r1] - strh r2, [r1, 0x8] -_080DA72E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA700 - - thumb_func_start sub_80DA740 -sub_80DA740: @ 80DA740 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0x8] - adds r1, r0, 0x1 - strh r1, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x31 - ble _080DA794 - movs r0, 0 - strh r0, [r4, 0x8] - ldr r0, =0x02039f2a - ldrb r0, [r0] - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _080DA780 - ldr r0, =sub_80DA7A0 - b _080DA792 - .pool -_080DA780: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =sub_80DA830 -_080DA792: - str r0, [r4] -_080DA794: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA740 - - thumb_func_start sub_80DA7A0 -sub_80DA7A0: @ 80DA7A0 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =sub_80FCACC - adds r0, r5, 0 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =sub_80DA7EC - adds r1, r5, 0 - bl SetTaskFuncWithFollowupFunc - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =TaskDummy1 - str r1, [r0] - bl sub_80DBF68 - movs r0, 0 - bl sub_80DC490 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA7A0 - - thumb_func_start sub_80DA7EC -sub_80DA7EC: @ 80DA7EC - push {lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r2, =0x03005e00 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0] - ldrb r1, [r0, 0x8] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldr r1, =sub_80DA830 - str r1, [r0] - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA7EC - - thumb_func_start sub_80DA830 -sub_80DA830: @ 80DA830 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080DA860 - adds r0, r2, 0 - bl DestroyTask - ldr r0, =0x03005dac - ldr r1, =sub_80DA874 - str r1, [r0] - bl FreeAllWindowBuffers - bl sub_80D7A5C - bl sub_805F094 - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 -_080DA860: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA830 - - thumb_func_start sub_80DA874 -sub_80DA874: @ 80DA874 - push {lr} - bl script_env_2_disable - bl script_env_2_enable_and_set_ctx_running - pop {r0} - bx r0 - thumb_func_end sub_80DA874 - - thumb_func_start sub_80DA884 -sub_80DA884: @ 80DA884 - push {lr} - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080DA898 - ldr r1, =0x02039f25 - movs r0, 0x3 - strb r0, [r1] -_080DA898: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA884 - - thumb_func_start sub_80DA8A4 -sub_80DA8A4: @ 80DA8A4 - push {lr} - ldr r0, =0x02039f25 - ldr r1, =0x02039f2b - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - beq _080DA8C0 - movs r0, 0 - b _080DA8C2 - .pool -_080DA8C0: - movs r0, 0x1 -_080DA8C2: - pop {r1} - bx r1 - thumb_func_end sub_80DA8A4 - - thumb_func_start sub_80DA8C8 -sub_80DA8C8: @ 80DA8C8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r6, =0x03005d90 - ldr r1, [r6] - mov r0, sp - bl CopyString - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080DA8F2 - mov r0, sp - bl sub_80DF9D4 -_080DA8F2: - ldr r5, =0x02039f25 - ldrb r0, [r5] - lsls r0, 6 - ldr r4, =0x02039e0d - adds r0, r4 - mov r1, sp - movs r2, 0x8 - bl memcpy - ldr r0, [r6] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _080DA928 - ldrb r0, [r5] - lsls r0, 6 - adds r0, r4, r0 - movs r1, 0xD8 - b _080DA930 - .pool -_080DA928: - ldrb r0, [r5] - lsls r0, 6 - adds r0, r4, r0 - movs r1, 0xD9 -_080DA930: - strb r1, [r0, 0x8] - ldr r7, =0x02039e00 - ldr r6, =0x02039f25 - ldrb r0, [r6] - lsls r0, 6 - adds r1, r7, 0 - adds r1, 0x18 - adds r0, r1 - movs r1, 0 - str r1, [r0] - ldrb r0, [r6] - lsls r0, 6 - adds r0, r7 - adds r0, 0x2C - strb r1, [r0] - movs r0, 0x64 - mov r1, r8 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - ldrb r1, [r6] - lsls r1, 6 - adds r1, r7 - strh r0, [r1] - adds r0, r5, 0 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - mov r0, sp - bl GetStringEnd_Limit7 - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080DA994 - adds r0, r5, 0 - movs r1, 0x3 - bl pokemon_getattr - adds r1, r0, 0 - mov r0, sp - bl sub_80DF9E0 -_080DA994: - ldrb r0, [r6] - lsls r0, 6 - adds r4, r7, 0x2 - adds r0, r4 - mov r1, sp - movs r2, 0xB - bl memcpy - ldrb r0, [r6] - lsls r0, 6 - adds r0, r4 - mov r1, sp - bl CopyString - adds r0, r5, 0 - movs r1, 0x16 - bl pokemon_getattr - ldrb r1, [r6] - lsls r1, 6 - adds r1, r7 - adds r1, 0x26 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x17 - bl pokemon_getattr - ldrb r1, [r6] - lsls r1, 6 - adds r1, r7 - adds r1, 0x27 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x18 - bl pokemon_getattr - ldrb r1, [r6] - lsls r1, 6 - adds r1, r7 - adds r1, 0x28 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x21 - bl pokemon_getattr - ldrb r1, [r6] - lsls r1, 6 - adds r1, r7 - adds r1, 0x29 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x2F - bl pokemon_getattr - ldrb r1, [r6] - lsls r1, 6 - adds r1, r7 - adds r1, 0x2A - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x30 - bl pokemon_getattr - ldrb r1, [r6] - lsls r1, 6 - adds r1, r7 - adds r1, 0x2B - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0xD - bl pokemon_getattr - ldrb r1, [r6] - lsls r1, 6 - adds r1, r7 - strh r0, [r1, 0x1E] - adds r0, r5, 0 - movs r1, 0xE - bl pokemon_getattr - ldrb r1, [r6] - lsls r1, 6 - adds r1, r7 - strh r0, [r1, 0x20] - adds r0, r5, 0 - movs r1, 0xF - bl pokemon_getattr - ldrb r1, [r6] - lsls r1, 6 - adds r1, r7 - strh r0, [r1, 0x22] - adds r0, r5, 0 - movs r1, 0x10 - bl pokemon_getattr - ldrb r1, [r6] - lsls r1, 6 - adds r1, r7 - strh r0, [r1, 0x24] - adds r0, r5, 0 - movs r1, 0 - bl pokemon_getattr - ldrb r1, [r6] - lsls r1, 6 - adds r2, r7, 0 - adds r2, 0x38 - adds r1, r2 - str r0, [r1] - adds r0, r5, 0 - movs r1, 0x1 - bl pokemon_getattr - ldrb r1, [r6] - lsls r1, 6 - adds r2, r7, 0 - adds r2, 0x3C - adds r1, r2 - str r0, [r1] - adds r0, r5, 0 - movs r1, 0xC - bl pokemon_getattr - lsls r0, 16 - lsrs r2, r0, 16 - ldrb r0, [r6] - lsls r0, 6 - adds r1, r0, r7 - adds r0, r1, 0 - adds r0, 0x26 - ldrb r3, [r0] - adds r0, 0x1 - ldrb r5, [r0] - adds r0, 0x1 - ldrb r6, [r0] - adds r0, 0x1 - ldrb r7, [r0] - adds r0, 0x1 - ldrb r4, [r0] - cmp r2, 0xFE - bne _080DAAC4 - adds r3, 0x14 - b _080DAB12 - .pool -_080DAAC4: - cmp r2, 0xFF - bne _080DAAD4 - lsls r0, r5, 16 - movs r1, 0xA0 - lsls r1, 13 - adds r0, r1 - lsrs r5, r0, 16 - b _080DAB12 -_080DAAD4: - movs r0, 0x80 - lsls r0, 1 - cmp r2, r0 - bne _080DAAE8 - lsls r0, r6, 16 - movs r1, 0xA0 - lsls r1, 13 - adds r0, r1 - lsrs r6, r0, 16 - b _080DAB12 -_080DAAE8: - ldr r0, =0x00000101 - cmp r2, r0 - bne _080DAB00 - lsls r0, r7, 16 - movs r1, 0xA0 - lsls r1, 13 - adds r0, r1 - lsrs r7, r0, 16 - b _080DAB12 - .pool -_080DAB00: - movs r0, 0x81 - lsls r0, 1 - cmp r2, r0 - bne _080DAB12 - lsls r0, r4, 16 - movs r1, 0xA0 - lsls r1, 13 - adds r0, r1 - lsrs r4, r0, 16 -_080DAB12: - cmp r3, 0xFF - ble _080DAB18 - movs r3, 0xFF -_080DAB18: - lsls r0, r5, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _080DAB22 - movs r5, 0xFF -_080DAB22: - lsls r0, r6, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _080DAB2C - movs r6, 0xFF -_080DAB2C: - lsls r0, r7, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _080DAB36 - movs r7, 0xFF -_080DAB36: - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _080DAB40 - movs r4, 0xFF -_080DAB40: - ldr r2, =0x02039e00 - ldr r1, =0x02039f25 - ldrb r0, [r1] - lsls r0, 6 - adds r0, r2 - adds r0, 0x26 - strb r3, [r0] - ldrb r0, [r1] - lsls r0, 6 - adds r0, r2 - adds r0, 0x27 - strb r5, [r0] - ldrb r0, [r1] - lsls r0, 6 - adds r0, r2 - adds r0, 0x28 - strb r6, [r0] - ldrb r0, [r1] - lsls r0, 6 - adds r0, r2 - adds r0, 0x29 - strb r7, [r0] - ldrb r0, [r1] - lsls r0, 6 - adds r0, r2 - adds r0, 0x2A - strb r4, [r0] - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DA8C8 - - thumb_func_start sub_80DAB8C -sub_80DAB8C: @ 80DAB8C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x64 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - movs r6, 0 - movs r7, 0 - bl sub_80DA884 - ldr r0, =0x00000864 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080DABC0 - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080DABC0 - movs r7, 0x1 -_080DABC0: - movs r5, 0 - ldr r2, =gUnknown_085880A4 - ldr r3, =gUnknown_085898A4 -_080DABC6: - ldrb r0, [r2, 0x1C] - lsls r0, 30 - lsrs r0, 30 - cmp r8, r0 - bne _080DAC3A - cmp r7, 0x1 - bne _080DABEC - ldrb r0, [r3] - cmp r0, 0x1 - beq _080DAC3A - b _080DABF2 - .pool -_080DABEC: - ldrb r0, [r3] - cmp r0, 0x2 - beq _080DAC3A -_080DABF2: - cmp r4, 0 - bne _080DABFE - ldrb r0, [r2, 0x1C] - lsls r0, 29 - cmp r0, 0 - blt _080DAC2E -_080DABFE: - cmp r4, 0x1 - bne _080DAC0A - ldrb r0, [r2, 0x1C] - lsls r0, 28 - cmp r0, 0 - blt _080DAC2E -_080DAC0A: - cmp r4, 0x2 - bne _080DAC16 - ldrb r0, [r2, 0x1C] - lsls r0, 27 - cmp r0, 0 - blt _080DAC2E -_080DAC16: - cmp r4, 0x3 - bne _080DAC22 - ldrb r0, [r2, 0x1C] - lsls r0, 26 - cmp r0, 0 - blt _080DAC2E -_080DAC22: - cmp r4, 0x4 - bne _080DAC3A - ldrb r0, [r2, 0x1C] - lsls r0, 25 - cmp r0, 0 - bge _080DAC3A -_080DAC2E: - adds r0, r6, 0 - adds r1, r0, 0x1 - lsls r1, 24 - lsrs r6, r1, 24 - add r0, sp - strb r5, [r0] -_080DAC3A: - adds r2, 0x40 - adds r3, 0x1 - adds r5, 0x1 - cmp r5, 0x5F - bls _080DABC6 - mov r0, sp - adds r1, r0, r6 - movs r0, 0xFF - strb r0, [r1] - movs r5, 0 - ldr r7, =gUnknown_085880A4 -_080DAC50: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x02039e00 - lsls r2, r5, 6 - adds r2, r1 - mov r1, sp - adds r4, r1, r0 - ldrb r1, [r4] - lsls r1, 6 - adds r1, r7 - adds r0, r2, 0 - movs r2, 0x40 - bl memcpy - ldrb r0, [r4] - adds r2, r5, 0x1 - subs r1, r6, 0x1 - cmp r0, 0xFF - beq _080DAC92 - adds r3, r4, 0 -_080DAC86: - ldrb r0, [r3, 0x1] - strb r0, [r3] - adds r3, 0x1 - ldrb r0, [r3] - cmp r0, 0xFF - bne _080DAC86 -_080DAC92: - lsls r0, r1, 24 - lsrs r6, r0, 24 - adds r5, r2, 0 - cmp r5, 0x2 - ble _080DAC50 - ldr r0, =0x02039f24 - ldrb r0, [r0] - bl sub_80DA8C8 - add sp, 0x64 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DAB8C - - thumb_func_start sub_80DACBC -sub_80DACBC: @ 80DACBC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x64 - mov r8, r2 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r2, r1, 24 - movs r7, 0 - ldr r0, =0x02039f30 - ldrb r1, [r0] - mov r9, r0 - cmp r1, 0x4 - bne _080DACDE - b _080DADF6 -_080DACDE: - movs r5, 0 - ldr r3, =gUnknown_085880A4 - ldr r6, =gUnknown_085898A4 -_080DACE4: - ldrb r0, [r3, 0x1C] - lsls r0, 30 - lsrs r0, 30 - cmp r2, r0 - bne _080DAD56 - mov r0, r8 - cmp r0, 0x1 - bne _080DAD08 - ldrb r0, [r6] - cmp r0, 0x1 - beq _080DAD56 - b _080DAD0E - .pool -_080DAD08: - ldrb r0, [r6] - cmp r0, 0x2 - beq _080DAD56 -_080DAD0E: - cmp r4, 0 - bne _080DAD1A - ldrb r0, [r3, 0x1C] - lsls r0, 29 - cmp r0, 0 - blt _080DAD4A -_080DAD1A: - cmp r4, 0x1 - bne _080DAD26 - ldrb r0, [r3, 0x1C] - lsls r0, 28 - cmp r0, 0 - blt _080DAD4A -_080DAD26: - cmp r4, 0x2 - bne _080DAD32 - ldrb r0, [r3, 0x1C] - lsls r0, 27 - cmp r0, 0 - blt _080DAD4A -_080DAD32: - cmp r4, 0x3 - bne _080DAD3E - ldrb r0, [r3, 0x1C] - lsls r0, 26 - cmp r0, 0 - blt _080DAD4A -_080DAD3E: - cmp r4, 0x4 - bne _080DAD56 - ldrb r0, [r3, 0x1C] - lsls r0, 25 - cmp r0, 0 - bge _080DAD56 -_080DAD4A: - adds r0, r7, 0 - adds r1, r0, 0x1 - lsls r1, 24 - lsrs r7, r1, 24 - add r0, sp - strb r5, [r0] -_080DAD56: - adds r3, 0x40 - adds r6, 0x1 - adds r5, 0x1 - cmp r5, 0x5F - bls _080DACE4 - mov r3, sp - adds r1, r3, r7 - movs r0, 0xFF - strb r0, [r1] - movs r5, 0 - mov r0, r9 - ldrb r1, [r0] - movs r0, 0x4 - subs r0, r1 - cmp r5, r0 - bge _080DADF6 - ldr r3, =0x02039e00 - mov r8, r3 - mov r6, r9 - movs r0, 0x2 - add r0, r8 - mov r9, r0 -_080DAD82: - bl sub_80F903C - lsls r0, 16 - lsrs r0, 16 - adds r1, r7, 0 - bl __modsi3 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldrb r0, [r6] - adds r0, r5 - lsls r0, 6 - add r0, r8 - ldr r2, =gUnknown_085880A4 - mov r3, sp - adds r4, r3, r1 - ldrb r1, [r4] - lsls r1, 6 - adds r1, r2 - movs r2, 0x40 - bl memcpy - ldrb r0, [r6] - adds r0, r5 - lsls r0, 6 - mov r1, r8 - adds r1, 0xD - adds r0, r1 - bl sub_80DF9D4 - ldrb r0, [r6] - adds r0, r5 - lsls r0, 6 - add r0, r9 - movs r1, 0x2 - bl sub_80DF9E0 - ldrb r0, [r4] - adds r3, r5, 0x1 - subs r1, r7, 0x1 - cmp r0, 0xFF - beq _080DADE6 - adds r2, r4, 0 -_080DADDA: - ldrb r0, [r2, 0x1] - strb r0, [r2] - adds r2, 0x1 - ldrb r0, [r2] - cmp r0, 0xFF - bne _080DADDA -_080DADE6: - lsls r0, r1, 24 - lsrs r7, r0, 24 - adds r5, r3, 0 - ldrb r1, [r6] - movs r0, 0x4 - subs r0, r1 - cmp r5, r0 - blt _080DAD82 -_080DADF6: - add sp, 0x64 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DACBC - - thumb_func_start sub_80DAE0C -sub_80DAE0C: @ 80DAE0C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - beq _080DAE1E - movs r0, 0x3 - b _080DAE9A -_080DAE1E: - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - bne _080DAE2E - movs r0, 0x4 - b _080DAE9A -_080DAE2E: - ldr r0, =0x02039f2c - ldrh r0, [r0] - cmp r0, 0x4 - bhi _080DAE82 - lsls r0, 2 - ldr r1, =_080DAE48 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080DAE48: - .4byte _080DAE5C - .4byte _080DAE62 - .4byte _080DAE68 - .4byte _080DAE6E - .4byte _080DAE74 -_080DAE5C: - adds r0, r4, 0 - movs r1, 0x32 - b _080DAE78 -_080DAE62: - adds r0, r4, 0 - movs r1, 0x33 - b _080DAE78 -_080DAE68: - adds r0, r4, 0 - movs r1, 0x34 - b _080DAE78 -_080DAE6E: - adds r0, r4, 0 - movs r1, 0x35 - b _080DAE78 -_080DAE74: - adds r0, r4, 0 - movs r1, 0x36 -_080DAE78: - bl pokemon_getattr - lsls r0, 24 - lsrs r1, r0, 24 - b _080DAE86 -_080DAE82: - movs r0, 0 - b _080DAE9A -_080DAE86: - ldr r0, =0x02039f2e - adds r2, r1, 0 - ldrh r1, [r0] - movs r0, 0x2 - cmp r2, r1 - bhi _080DAE9A - movs r0, 0 - cmp r2, r1 - bcc _080DAE9A - movs r0, 0x1 -_080DAE9A: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80DAE0C - - thumb_func_start sub_80DAEA4 -sub_80DAEA4: @ 80DAEA4 - push {r4,r5,lr} - movs r5, 0 -_080DAEA8: - ldr r0, =0x02039f26 - adds r0, r5, r0 - ldrb r0, [r0] - movs r1, 0 - bl FillWindowPixelBuffer - lsls r4, r5, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_80DAF04 - adds r0, r4, 0 - bl sub_80DAF88 - adds r5, 0x1 - cmp r5, 0x3 - ble _080DAEA8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DAEA4 - - thumb_func_start sub_80DAED4 -sub_80DAED4: @ 80DAED4 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r4, r1, 24 - lsrs r4, 24 - ldr r0, =0x02022e2c - ldr r1, =gUnknown_085ED1AB - bl CopyString - adds r1, r0, 0 - subs r0, r1, 0x1 - strb r4, [r0] - adds r0, r1, 0 - adds r1, r5, 0 - bl CopyString - adds r1, r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80DAED4 - - thumb_func_start sub_80DAF04 -sub_80DAF04: @ 80DAF04 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r0, r1, 24 - movs r2, 0xA0 - lsls r2, 20 - adds r1, r2 - lsrs r1, 24 - bl sub_80DAF1C - pop {r0} - bx r0 - thumb_func_end sub_80DAF04 - - thumb_func_start sub_80DAF1C -sub_80DAF1C: @ 80DAF1C - push {r4,r5,lr} - sub sp, 0x24 - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gUnknown_085E8D3E - add r0, sp, 0x4 - bl CopyString - lsls r1, r5, 6 - ldr r0, =0x02039e0d - adds r1, r0 - add r0, sp, 0x4 - bl AppendString - add r0, sp, 0x4 - adds r1, r4, 0 - bl sub_80DAED4 - ldr r4, =0x02022e2c - movs r0, 0x7 - adds r1, r4, 0 - movs r2, 0x60 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - cmp r2, 0x37 - ble _080DAF5C - movs r2, 0x37 -_080DAF5C: - ldr r0, =0x02039f26 - adds r0, r5, r0 - ldrb r0, [r0] - movs r1, 0x7 - str r1, [sp] - adds r1, r4, 0 - movs r3, 0x1 - bl sub_80DEBD0 - add sp, 0x24 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DAF1C - - thumb_func_start sub_80DAF88 -sub_80DAF88: @ 80DAF88 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r0, r1, 24 - movs r2, 0xA0 - lsls r2, 20 - adds r1, r2 - lsrs r1, 24 - bl sub_80DAFA0 - pop {r0} - bx r0 - thumb_func_end sub_80DAF88 - - thumb_func_start sub_80DAFA0 -sub_80DAFA0: @ 80DAFA0 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r4, 6 - ldr r2, =0x02039e02 - adds r0, r2 - bl sub_80DAED4 - ldr r0, =0x02039f26 - adds r4, r0 - ldrb r0, [r4] - ldr r1, =0x02022e2c - movs r2, 0x7 - str r2, [sp] - movs r2, 0x5 - movs r3, 0x1 - bl sub_80DEBD0 - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DAFA0 - - thumb_func_start sub_80DAFE0 -sub_80DAFE0: @ 80DAFE0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r0, r1, 24 - cmp r0, 0x4 - bhi _080DB06C - lsls r0, 2 - ldr r1, =_080DAFFC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080DAFFC: - .4byte _080DB010 - .4byte _080DB028 - .4byte _080DB040 - .4byte _080DB050 - .4byte _080DB06C -_080DB010: - ldr r0, =0x02039e00 - lsls r2, 6 - adds r1, r2, r0 - adds r3, r1, 0 - adds r3, 0x26 - ldrb r5, [r3] - adds r3, 0x4 - ldrb r4, [r3] - adds r1, 0x27 - b _080DB07E - .pool -_080DB028: - ldr r0, =0x02039e00 - lsls r2, 6 - adds r1, r2, r0 - adds r3, r1, 0 - adds r3, 0x27 - ldrb r5, [r3] - subs r3, 0x1 - ldrb r4, [r3] - adds r1, 0x28 - b _080DB07E - .pool -_080DB040: - ldr r1, =0x02039e00 - lsls r2, 6 - adds r3, r2, r1 - adds r0, r3, 0 - adds r0, 0x28 - b _080DB05A - .pool -_080DB050: - ldr r1, =0x02039e00 - lsls r2, 6 - adds r3, r2, r1 - adds r0, r3, 0 - adds r0, 0x29 -_080DB05A: - ldrb r5, [r0] - subs r0, 0x1 - ldrb r4, [r0] - adds r0, 0x2 - ldrb r3, [r0] - adds r0, r1, 0 - b _080DB080 - .pool -_080DB06C: - ldr r0, =0x02039e00 - lsls r2, 6 - adds r1, r2, r0 - adds r3, r1, 0 - adds r3, 0x2A - ldrb r5, [r3] - subs r3, 0x1 - ldrb r4, [r3] - adds r1, 0x26 -_080DB07E: - ldrb r3, [r1] -_080DB080: - adds r1, r2, r0 - adds r1, 0x2B - adds r0, r4, r3 - ldrb r1, [r1] - adds r0, r1 - asrs r0, 1 - adds r0, r5, r0 - lsls r0, 16 - lsrs r0, 16 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80DAFE0 - - thumb_func_start sub_80DB09C -sub_80DB09C: @ 80DB09C - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 - ldr r5, =0x02039f00 -_080DB0A6: - lsls r0, r4, 24 - lsrs r0, 24 - adds r1, r6, 0 - bl sub_80DAFE0 - strh r0, [r5] - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _080DB0A6 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DB09C - - thumb_func_start sub_80DB0C4 -sub_80DB0C4: @ 80DB0C4 - push {r4,r5,lr} - ldr r0, =gUnknown_08587C00 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_08C1C6B8 - movs r1, 0x88 - lsls r1, 1 - movs r2, 0x20 - bl decompress_palette - ldr r0, =gUnknown_08587BE8 - movs r1, 0x70 - movs r2, 0x24 - movs r3, 0x1E - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r5, r2, r4 - ldrb r3, [r5, 0x5] - movs r1, 0xF - ands r1, r3 - movs r3, 0x10 - orrs r1, r3 - strb r1, [r5, 0x5] - adds r4, 0x1C - adds r2, r4 - ldr r1, =DummyObjectCallback - str r1, [r2] - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80DB0C4 - - thumb_func_start sub_80DB120 -sub_80DB120: @ 80DB120 - push {lr} - ldr r0, =gUnknown_08587C08 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_08587C10 - bl LoadCompressedObjectPalette - ldr r0, =gUnknown_08587C18 - movs r1, 0x60 - movs r2, 0xA - movs r3, 0x1D - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r1 - movs r1, 0x3E - adds r1, r2 - mov r12, r1 - ldrb r1, [r1] - movs r3, 0x4 - orrs r1, r3 - mov r3, r12 - strb r1, [r3] - ldrh r1, [r2, 0x4] - lsls r1, 22 - lsrs r1, 22 - strh r1, [r2, 0x2E] - pop {r1} - bx r1 - .pool - thumb_func_end sub_80DB120 - - thumb_func_start sub_80DB174 -sub_80DB174: @ 80DB174 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r1, 0 - adds r6, r2, 0 - adds r4, r3, 0 - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r5, 0 - bl sub_80DE84C - adds r5, r0, 0 - ldr r0, =0x02039f25 - ldrb r0, [r0] - cmp r4, r0 - bne _080DB1B8 - lsls r0, r5, 3 - ldr r1, =gMonBackPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - ldr r1, [r1, 0x4] - adds r2, r5, 0 - adds r3, r6, 0 - bl DecompressMonPic_DetectFrontOrBack_2 - b _080DB1CC - .pool -_080DB1B8: - lsls r0, r5, 3 - ldr r1, =gMonBackPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - ldr r1, [r1, 0x4] - adds r2, r5, 0 - adds r3, r6, 0 - bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack -_080DB1CC: - adds r0, r5, 0 - adds r1, r7, 0 - adds r2, r6, 0 - bl species_and_otid_get_pal - movs r1, 0x90 - lsls r1, 1 - movs r2, 0x20 - bl decompress_palette - adds r0, r5, 0 - movs r1, 0 - bl sub_806A068 - ldr r4, =0x0202499c - movs r0, 0x2 - adds r1, r5, 0 - movs r2, 0 - bl sub_80A600C - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - movs r1, 0x70 - movs r3, 0x1E - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02020630 - mov r8, r0 - lsls r0, r7, 4 - adds r0, r7 - lsls r6, r0, 2 - mov r0, r8 - adds r4, r6, r0 - ldrb r1, [r4, 0x5] - movs r0, 0xF - ands r0, r1 - movs r1, 0x20 - orrs r0, r1 - movs r1, 0xD - negs r1, r1 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r4, 0x5] - movs r0, 0x2 - bl sub_80A82E4 - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - mov r0, r8 - adds r0, 0x1C - adds r0, r6, r0 - ldr r1, =DummyObjectCallback - str r1, [r0] - ldrb r0, [r4, 0x5] - lsrs r0, 4 - strh r0, [r4, 0x2E] - strh r5, [r4, 0x32] - adds r0, r5, 0 - bl sub_80DB2A8 - lsls r0, 24 - cmp r0, 0 - beq _080DB278 - mov r0, r8 - adds r0, 0x10 - adds r0, r6, r0 - ldr r1, =gUnknown_082FF6C0 - b _080DB280 - .pool -_080DB278: - mov r0, r8 - adds r0, 0x10 - adds r0, r6, r0 - ldr r1, =gUnknown_082FF694 -_080DB280: - str r1, [r0] - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0 - bl StartObjectRotScalAnim - adds r0, r7, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80DB174 - - thumb_func_start sub_80DB2A8 -sub_80DB2A8: @ 80DB2A8 - push {lr} - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xC9 - beq _080DB2B6 - movs r0, 0x1 - b _080DB2B8 -_080DB2B6: - movs r0, 0 -_080DB2B8: - pop {r1} - bx r1 - thumb_func_end sub_80DB2A8 - - thumb_func_start sub_80DB2BC -sub_80DB2BC: @ 80DB2BC - push {r4-r6,lr} - ldr r5, =0x02039f34 - ldr r0, [r5] - ldr r0, [r0, 0x24] - movs r4, 0xA0 - lsls r4, 3 - adds r1, r0, r4 - movs r6, 0xA0 - lsls r6, 1 - adds r2, r6, 0 - bl CpuSet - ldr r0, [r5] - ldr r0, [r0, 0x2C] - adds r4, r0, r4 - adds r1, r4, 0 - adds r2, r6, 0 - bl CpuSet - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DB2BC - - thumb_func_start sub_80DB2EC -sub_80DB2EC: @ 80DB2EC - push {lr} - lsls r0, 16 - lsls r1, 24 - lsrs r3, r1, 24 - ldr r2, =gContestEffects - ldr r1, =gContestMoves - lsrs r0, 13 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x8 - bhi _080DB354 - lsls r0, 2 - ldr r1, =_080DB320 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080DB320: - .4byte _080DB344 - .4byte _080DB344 - .4byte _080DB34C - .4byte _080DB34C - .4byte _080DB354 - .4byte _080DB354 - .4byte _080DB354 - .4byte _080DB354 - .4byte _080DB344 -_080DB344: - ldr r0, =0x00009082 - b _080DB356 - .pool -_080DB34C: - ldr r0, =0x00009088 - b _080DB356 - .pool -_080DB354: - ldr r0, =0x00009086 -_080DB356: - lsls r1, r3, 12 - movs r2, 0x90 - lsls r2, 8 - adds r1, r2 - lsls r0, 16 - asrs r0, 16 - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80DB2EC - - thumb_func_start prints_contest_move_description -prints_contest_move_description: @ 80DB370 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r1, =gContestMoves - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0, 0x1] - lsls r0, 29 - lsrs r0, 29 - ldr r7, =0x00004040 - cmp r0, 0 - beq _080DB3A4 - adds r7, 0x5 - cmp r0, 0x1 - beq _080DB3A4 - adds r7, 0x5 - cmp r0, 0x2 - beq _080DB3A4 - adds r7, 0x40 - cmp r0, 0x3 - bne _080DB3A4 - subs r7, 0x20 -_080DB3A4: - movs r6, 0x5 - str r6, [sp] - movs r4, 0x1 - str r4, [sp, 0x4] - movs r5, 0x11 - str r5, [sp, 0x8] - str r4, [sp, 0xC] - movs r0, 0 - adds r1, r7, 0 - movs r2, 0xB - movs r3, 0x1F - bl sub_80DECB8 - adds r1, r7, 0 - adds r1, 0x10 - str r6, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - str r4, [sp, 0xC] - movs r0, 0 - movs r2, 0xB - movs r3, 0x20 - bl sub_80DECB8 - ldr r2, =gContestEffects - ldr r0, =gContestMoves - mov r3, r8 - lsls r1, r3, 3 - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 2 - adds r2, r0, r2 - ldrb r0, [r2, 0x1] - adds r7, r1, 0 - cmp r0, 0xFF - bne _080DB3FC - movs r6, 0 - b _080DB408 - .pool -_080DB3FC: - ldrb r0, [r2, 0x1] - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r6, r0, 24 -_080DB408: - cmp r6, 0x8 - bls _080DB40E - movs r6, 0x8 -_080DB40E: - ldr r1, =0x00005035 - movs r0, 0x8 - str r0, [sp] - movs r5, 0x1 - str r5, [sp, 0x4] - movs r4, 0x11 - str r4, [sp, 0x8] - movs r0, 0 - movs r2, 0x15 - movs r3, 0x1F - bl sub_80DED10 - ldr r1, =0x00005012 - str r6, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r2, 0x15 - movs r3, 0x1F - bl sub_80DED10 - ldr r1, =gContestEffects - ldr r0, =gContestMoves - adds r0, r7, r0 - ldrb r0, [r0] - lsls r0, 2 - adds r1, r0, r1 - ldrb r0, [r1, 0x2] - cmp r0, 0xFF - bne _080DB460 - movs r6, 0 - b _080DB46C - .pool -_080DB460: - ldrb r0, [r1, 0x2] - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r6, r0, 24 -_080DB46C: - cmp r6, 0x8 - bls _080DB472 - movs r6, 0x8 -_080DB472: - ldr r1, =0x00005036 - movs r0, 0x8 - str r0, [sp] - movs r5, 0x1 - str r5, [sp, 0x4] - movs r4, 0x11 - str r4, [sp, 0x8] - movs r0, 0 - movs r2, 0x15 - movs r3, 0x20 - bl sub_80DED10 - ldr r1, =0x00005014 - str r6, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r2, 0x15 - movs r3, 0x20 - bl sub_80DED10 - movs r0, 0xA - movs r1, 0 - bl FillWindowPixelBuffer - ldr r1, =gContestEffectDescriptionPointers - ldr r0, =gContestMoves - adds r0, r7, r0 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - movs r0, 0xA - bl sub_80DEB70 - ldr r1, =gUnknown_085E8D3E - movs r0, 0x9 - bl sub_80DEB70 - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end prints_contest_move_description - - thumb_func_start sub_80DB4E0 -sub_80DB4E0: @ 80DB4E0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 24 - lsrs r4, r1, 24 - ldr r0, =0x02039f26 - adds r0, r4, r0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - adds r0, 0x2 - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r4, 0 - bl sub_80DBCA8 - lsls r0, 24 - cmp r0, 0 - bne _080DB560 - cmp r5, 0 - beq _080DB560 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_80DB2EC - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0x2 - mov r8, r0 - str r0, [sp] - movs r5, 0x1 - str r5, [sp, 0x4] - movs r6, 0x11 - str r6, [sp, 0x8] - str r5, [sp, 0xC] - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x14 - adds r3, r7, 0 - bl sub_80DECB8 - adds r4, 0x10 - lsls r4, 16 - lsrs r4, 16 - adds r3, r7, 0x1 - lsls r3, 24 - lsrs r3, 24 - mov r0, r8 - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - str r5, [sp, 0xC] - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x14 - bl sub_80DECB8 - b _080DB576 - .pool -_080DB560: - movs r0, 0x2 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0x14 - adds r3, r7, 0 - bl sub_80DED10 -_080DB576: - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80DB4E0 - - thumb_func_start sub_80DB584 -sub_80DB584: @ 80DB584 - push {r4,r5,lr} - movs r4, 0 - movs r5, 0 -_080DB58A: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x4] - adds r0, r5, r0 - ldrh r0, [r0, 0x6] - lsls r1, r4, 24 - lsrs r1, 24 - bl sub_80DB4E0 - adds r5, 0x1C - adds r4, 0x1 - cmp r4, 0x3 - ble _080DB58A - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DB584 - - thumb_func_start sub_80DB5B0 -sub_80DB5B0: @ 80DB5B0 - ldr r0, =0x00002034 - bx lr - .pool - thumb_func_end sub_80DB5B0 - - thumb_func_start sub_80DB5B8 -sub_80DB5B8: @ 80DB5B8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - mov r10, r8 - ldr r0, =0x02039f34 - mov r9, r0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r7, r0, 2 - adds r3, r7, r1 - ldrb r0, [r3, 0x10] - movs r5, 0x30 - ands r5, r0 - cmp r5, 0 - bne _080DB5F4 - movs r0, 0 - b _080DB68A - .pool -_080DB5F4: - ldr r0, =0x02039f26 - adds r0, r2, r0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - adds r0, 0x2 - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0xD - ldrsb r0, [r3, r0] - movs r1, 0xA - bl __divsi3 - lsls r0, 24 - asrs r4, r0, 24 - cmp r5, 0x10 - bne _080DB648 - bl sub_80DB5B0 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x1 - str r0, [sp] - lsls r0, r4, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - movs r2, 0x13 - adds r3, r6, 0 - bl sub_80DED10 - mov r1, r8 - cmp r1, 0 - beq _080DB688 - movs r0, 0x5B - b _080DB672 - .pool -_080DB648: - adds r3, r6, r4 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0x3 - subs r0, r4 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0x13 - bl sub_80DED10 - mov r0, r10 - cmp r0, 0 - beq _080DB688 - movs r0, 0x26 -_080DB672: - bl audio_play - mov r1, r9 - ldr r0, [r1] - ldr r1, [r0, 0x4] - adds r1, r7, r1 - ldrb r2, [r1, 0x10] - movs r0, 0x31 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x10] -_080DB688: - movs r0, 0x1 -_080DB68A: - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80DB5B8 - - thumb_func_start sub_80DB69C -sub_80DB69C: @ 80DB69C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - movs r7, 0 - movs r0, 0x1 - mov r10, r0 - movs r1, 0x11 - mov r9, r1 - movs r0, 0 - mov r8, r0 -_080DB6B6: - ldr r0, =0x02039f26 - adds r0, r7, r0 - ldrb r0, [r0] - lsls r4, r0, 2 - adds r4, r0 - adds r4, 0x2 - lsls r4, 24 - lsrs r4, 24 - bl sub_80DB5B0 - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x4] - add r0, r8 - ldrb r0, [r0, 0xD] - lsls r0, 24 - asrs r0, 24 - movs r1, 0xA - bl __divsi3 - lsls r0, 24 - mov r1, r10 - str r1, [sp] - asrs r6, r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - movs r0, 0 - adds r1, r5, 0 - movs r2, 0x13 - adds r3, r4, 0 - bl sub_80DED10 - adds r4, r6 - lsls r4, 24 - lsrs r4, 24 - mov r1, r10 - str r1, [sp] - movs r0, 0x3 - subs r0, r6 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0x13 - adds r3, r4, 0 - bl sub_80DED10 - movs r1, 0x1C - add r8, r1 - adds r7, 0x1 - cmp r7, 0x3 - ble _080DB6B6 - 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_80DB69C - - thumb_func_start sub_80DB748 -sub_80DB748: @ 80DB748 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0 - cmp r1, 0x4 - bhi _080DB78A - lsls r0, r1, 2 - ldr r1, =_080DB764 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080DB764: - .4byte _080DB778 - .4byte _080DB77C - .4byte _080DB780 - .4byte _080DB784 - .4byte _080DB788 -_080DB778: - movs r0, 0x80 - b _080DB78A -_080DB77C: - movs r0, 0x84 - b _080DB78A -_080DB780: - movs r0, 0x86 - b _080DB78A -_080DB784: - movs r0, 0x88 - b _080DB78A -_080DB788: - movs r0, 0x82 -_080DB78A: - movs r1, 0x90 - lsls r1, 8 - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_80DB748 - - thumb_func_start sub_80DB798 -sub_80DB798: @ 80DB798 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - mov r9, r1 - movs r1, 0 - mov r8, r1 - ldr r1, =0x02039f26 - adds r1, r0, r1 - ldrb r2, [r1] - lsls r1, r2, 2 - adds r1, r2 - adds r1, 0x2 - lsls r1, 24 - lsrs r7, r1, 24 - ldr r1, =0x02039f34 - ldr r1, [r1] - ldr r2, [r1, 0x4] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r2, r1, r2 - ldr r0, [r2, 0x10] - ldr r1, =0x00ff0003 - ands r0, r1 - cmp r0, 0 - bne _080DB7DC - ldrb r0, [r2, 0xF] - cmp r0, 0 - beq _080DB7EC -_080DB7DC: - movs r0, 0 - b _080DB80E - .pool -_080DB7EC: - ldrb r1, [r2, 0xC] - mov r0, r9 - ands r0, r1 - cmp r0, 0 - beq _080DB7FA - movs r0, 0x1 - b _080DB80E -_080DB7FA: - movs r0, 0x6 - ands r0, r1 - cmp r0, 0 - bne _080DB80C - ldrb r1, [r2, 0xB] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080DB81A -_080DB80C: - movs r0, 0x2 -_080DB80E: - bl sub_80DB748 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - b _080DB81E -_080DB81A: - movs r0, 0 - mov r9, r0 -_080DB81E: - mov r1, r9 - cmp r1, 0 - beq _080DB85E - movs r6, 0x2 - str r6, [sp] - movs r4, 0x1 - str r4, [sp, 0x4] - movs r5, 0x11 - str r5, [sp, 0x8] - str r4, [sp, 0xC] - movs r0, 0 - mov r1, r8 - movs r2, 0x14 - adds r3, r7, 0 - bl sub_80DECB8 - mov r1, r8 - adds r1, 0x10 - lsls r1, 16 - lsrs r1, 16 - adds r3, r7, 0x1 - lsls r3, 24 - lsrs r3, 24 - str r6, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - str r4, [sp, 0xC] - movs r0, 0 - movs r2, 0x14 - bl sub_80DECB8 - b _080DB874 -_080DB85E: - movs r0, 0x2 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0x14 - adds r3, r7, 0 - bl sub_80DED10 -_080DB874: - mov r0, r9 - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80DB798 - - thumb_func_start sub_80DB884 -sub_80DB884: @ 80DB884 - push {r4,lr} - movs r4, 0 -_080DB888: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_80DB798 - adds r4, 0x1 - cmp r4, 0x3 - ble _080DB888 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80DB884 - - thumb_func_start sub_80DB89C -sub_80DB89C: @ 80DB89C - push {lr} - movs r0, 0x4 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x4 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0 - bl sub_80DED60 - pop {r0} - bx r0 - thumb_func_end sub_80DB89C - - thumb_func_start sub_80DB8B8 -sub_80DB8B8: @ 80DB8B8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - adds r0, r4, 0 - bl sub_80DBCA8 - lsls r0, 24 - cmp r0, 0 - beq _080DB8D0 - movs r0, 0 - b _080DB90A -_080DB8D0: - ldr r0, =0x02039f25 - ldrb r0, [r0] - cmp r4, r0 - beq _080DB8F4 - adds r0, r4, 0 - bl sub_81562C4 - bl sub_8156324 - lsls r0, 24 - ldr r2, =0x02039e00 - lsrs r0, 23 - lsls r1, r4, 6 - b _080DB902 - .pool -_080DB8F4: - ldr r2, =0x02039e00 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 1 - lsls r1, r5, 6 -_080DB902: - adds r0, r1 - adds r2, 0x1E - adds r0, r2 - ldrh r0, [r0] -_080DB90A: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80DB8B8 - - thumb_func_start sub_80DB918 -sub_80DB918: @ 80DB918 - push {r4,r5,lr} - movs r4, 0 - movs r5, 0 -_080DB91E: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_80DB8B8 - ldr r1, =0x02039f34 - ldr r1, [r1] - ldr r1, [r1, 0x4] - adds r1, r5, r1 - strh r0, [r1, 0x6] - adds r5, 0x1C - adds r4, 0x1 - cmp r4, 0x3 - ble _080DB91E - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DB918 - - thumb_func_start sub_80DB944 -sub_80DB944: @ 80DB944 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - ldr r5, =0x02039f34 - mov r4, sp - movs r3, 0 - movs r6, 0x3 -_080DB956: - ldr r2, [r5] - ldr r1, [r2, 0x4] - adds r1, r3, r1 - ldrh r0, [r1, 0x2] - ldrh r7, [r1, 0x4] - adds r0, r7 - strh r0, [r1, 0x4] - ldr r0, [r2, 0x4] - adds r0, r3, r0 - ldrh r0, [r0, 0x4] - strh r0, [r4] - adds r4, 0x2 - adds r3, 0x1C - subs r6, 0x1 - cmp r6, 0 - bge _080DB956 - movs r6, 0 -_080DB978: - movs r4, 0x3 - cmp r4, r6 - ble _080DB9A4 -_080DB97E: - subs r5, r4, 0x1 - lsls r0, r5, 1 - mov r1, sp - adds r3, r1, r0 - lsls r0, r4, 1 - adds r2, r1, r0 - ldrh r4, [r3] - movs r7, 0 - ldrsh r1, [r3, r7] - movs r7, 0 - ldrsh r0, [r2, r7] - cmp r1, r0 - bge _080DB99E - ldrh r0, [r2] - strh r4, [r2] - strh r0, [r3] -_080DB99E: - adds r4, r5, 0 - cmp r4, r6 - bgt _080DB97E -_080DB9A4: - adds r6, 0x1 - cmp r6, 0x2 - ble _080DB978 - movs r6, 0 - movs r0, 0x4 - negs r0, r0 - mov r9, r0 - ldr r1, =0x02039f34 - mov r8, r1 - movs r7, 0x3 - mov r12, r7 -_080DB9BA: - movs r4, 0 - lsls r0, r6, 3 - adds r7, r6, 0x1 - subs r0, r6 - lsls r5, r0, 2 - mov r3, sp -_080DB9C6: - mov r1, r8 - ldr r0, [r1] - ldr r0, [r0, 0x4] - adds r2, r5, r0 - movs r6, 0x4 - ldrsh r1, [r2, r6] - movs r6, 0 - ldrsh r0, [r3, r6] - cmp r1, r0 - bne _080DB9F0 - mov r0, r12 - ands r4, r0 - ldrb r1, [r2, 0xB] - mov r0, r9 - ands r0, r1 - orrs r0, r4 - strb r0, [r2, 0xB] - b _080DB9F8 - .pool -_080DB9F0: - adds r3, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _080DB9C6 -_080DB9F8: - adds r6, r7, 0 - cmp r6, 0x3 - ble _080DB9BA - movs r0, 0x1 - bl sub_80DCE58 - bl sub_80DD590 - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80DB944 - - thumb_func_start sub_80DBA18 -sub_80DBA18: @ 80DBA18 - push {r4,r5,lr} - ldr r4, =0x02039f34 - movs r2, 0 - movs r3, 0x3 -_080DBA20: - ldr r0, [r4] - ldr r0, [r0, 0x4] - adds r1, r2, r0 - ldrh r0, [r1, 0x6] - cmp r0, 0 - bne _080DBA34 - movs r1, 0x5 - b _080DBA52 - .pool -_080DBA34: - movs r5, 0x2 - ldrsh r0, [r1, r5] - movs r1, 0 - cmp r0, 0 - ble _080DBA52 - movs r1, 0x1 - cmp r0, 0x1D - ble _080DBA52 - movs r1, 0x2 - cmp r0, 0x3B - ble _080DBA52 - movs r1, 0x4 - cmp r0, 0x4F - bgt _080DBA52 - movs r1, 0x3 -_080DBA52: - ldr r0, [r4] - ldr r0, [r0, 0x4] - adds r0, r2, r0 - strb r1, [r0, 0x1A] - adds r2, 0x1C - subs r3, 0x1 - cmp r3, 0 - bge _080DBA20 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80DBA18 - - thumb_func_start sub_80DBA68 -sub_80DBA68: @ 80DBA68 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02039f34 - ldr r1, [r1] - ldr r2, [r1, 0x4] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r2, r1, r2 - ldrb r1, [r2, 0xC] - movs r0, 0x6 - ands r0, r1 - cmp r0, 0 - bne _080DBA90 - ldrb r1, [r2, 0xB] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080DBA98 -_080DBA90: - movs r0, 0 - b _080DBA9A - .pool -_080DBA98: - movs r0, 0x1 -_080DBA9A: - pop {r1} - bx r1 - thumb_func_end sub_80DBA68 - - thumb_func_start sub_80DBAA0 -sub_80DBAA0: @ 80DBAA0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r5, =0x02039f34 - movs r0, 0 - mov r8, r0 - movs r1, 0x7 - negs r1, r1 - mov r10, r1 - movs r0, 0x2 - negs r0, r0 - mov r9, r0 - movs r4, 0 - movs r6, 0x3 -_080DBAC0: - ldr r1, [r5] - ldr r0, [r1, 0x4] - adds r0, r4, r0 - movs r2, 0 - strh r2, [r0, 0x2] - ldr r0, [r1, 0x4] - adds r0, r4, r0 - strh r2, [r0] - ldr r0, [r1, 0x4] - adds r0, r4, r0 - mov r1, r8 - strb r1, [r0, 0x12] - ldr r0, [r5] - ldr r0, [r0, 0x4] - adds r3, r4, r0 - ldrb r2, [r3, 0xC] - movs r0, 0x6 - ands r0, r2 - cmp r0, 0 - beq _080DBAFC - lsls r0, r2, 29 - lsrs r0, 30 - subs r0, 0x1 - movs r1, 0x3 - ands r0, r1 - lsls r0, 1 - mov r1, r10 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xC] -_080DBAFC: - ldr r0, [r5] - ldr r0, [r0, 0x4] - adds r0, r4, r0 - mov r1, r8 - strb r1, [r0, 0xE] - ldr r0, [r5] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r2, [r1, 0x10] - mov r0, r9 - ands r0, r2 - strb r0, [r1, 0x10] - ldr r0, [r5] - ldr r0, [r0, 0x4] - adds r0, r4, r0 - mov r1, r8 - strb r1, [r0, 0xF] - ldr r0, [r5] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r2, [r1, 0x10] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x10] - ldr r0, [r5] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r2, [r1, 0x10] - movs r7, 0x5 - negs r7, r7 - adds r0, r7, 0 - ands r0, r2 - strb r0, [r1, 0x10] - ldr r0, [r5] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r2, [r1, 0x10] - movs r0, 0x9 - negs r0, r0 - mov r12, r0 - ands r0, r2 - strb r0, [r1, 0x10] - ldr r0, [r5] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r2, [r1, 0xC] - mov r0, r9 - ands r0, r2 - strb r0, [r1, 0xC] - ldr r0, [r5] - ldr r0, [r0, 0x4] - adds r0, r4, r0 - movs r1, 0xFF - strb r1, [r0, 0x13] - ldr r0, [r5] - ldr r0, [r0, 0x4] - adds r0, r4, r0 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0, 0x14] - ldr r0, [r5] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r2, [r1, 0x10] - movs r0, 0x31 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x10] - ldr r0, [r5] - ldr r2, [r0, 0x4] - adds r2, r4, r2 - ldrb r3, [r2, 0x15] - lsls r1, r3, 31 - lsrs r1, 31 - lsls r1, 2 - adds r0, r7, 0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x15] - ldr r0, [r5] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r2, [r1, 0x15] - mov r0, r9 - ands r0, r2 - strb r0, [r1, 0x15] - ldr r0, [r5] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r2, [r1, 0x11] - movs r0, 0x4 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x11] - ldr r0, [r5] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r2, [r1, 0x11] - movs r0, 0x21 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x11] - ldr r0, [r5] - ldr r0, [r0, 0x4] - adds r2, r4, r0 - ldrb r1, [r2, 0x11] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080DBBF4 - ldrb r1, [r2, 0xC] - mov r0, r10 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2, 0xC] - ldr r0, [r5] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r2, [r1, 0x11] - adds r0, r7, 0 - ands r0, r2 - strb r0, [r1, 0x11] -_080DBBF4: - ldr r0, [r5] - ldr r0, [r0, 0x4] - adds r2, r4, r0 - ldrb r1, [r2, 0x11] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _080DBC1A - ldrb r0, [r2, 0xB] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0xB] - ldr r0, [r5] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r2, [r1, 0x11] - mov r0, r12 - ands r0, r2 - strb r0, [r1, 0x11] -_080DBC1A: - ldr r0, [r5] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r2, [r1, 0x11] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x11] - adds r4, 0x1C - subs r6, 0x1 - cmp r6, 0 - blt _080DBC34 - b _080DBAC0 -_080DBC34: - movs r6, 0 - ldr r5, =0x02039f34 - movs r7, 0 - movs r4, 0 -_080DBC3C: - ldr r3, [r5] - ldr r0, [r3, 0x4] - adds r0, r4, r0 - ldrh r1, [r0, 0x6] - strh r1, [r0, 0x8] - ldr r2, [r3] - lsls r1, r6, 1 - ldrb r0, [r2, 0x1] - lsls r0, 3 - adds r1, r0 - adds r2, 0x1C - adds r2, r1 - ldr r0, [r3, 0x4] - adds r0, r4, r0 - ldrh r0, [r0, 0x6] - strh r0, [r2] - ldr r0, [r3, 0x4] - adds r0, r4, r0 - ldrh r0, [r0, 0x6] - bl sub_80DD9F0 - ldr r1, [r5] - ldr r2, [r1] - ldrb r1, [r2, 0x1] - lsls r1, 2 - adds r1, r6, r1 - adds r2, 0x44 - adds r2, r1 - strb r0, [r2] - ldr r0, [r5] - ldr r0, [r0, 0x4] - adds r0, r4, r0 - strh r7, [r0, 0x6] - adds r4, 0x1C - adds r6, 0x1 - cmp r6, 0x3 - ble _080DBC3C - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0x10] - ldrb r1, [r2, 0x1] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x1] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DBAA0 - - thumb_func_start sub_80DBCA8 -sub_80DBCA8: @ 80DBCA8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02039f34 - ldr r1, [r1] - ldr r2, [r1, 0x4] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r2, r1, r2 - ldrb r1, [r2, 0xC] - movs r0, 0x6 - ands r0, r1 - cmp r0, 0 - bne _080DBCD0 - ldrb r1, [r2, 0xB] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080DBCD8 -_080DBCD0: - movs r0, 0x1 - b _080DBCDA - .pool -_080DBCD8: - movs r0, 0 -_080DBCDA: - pop {r1} - bx r1 - thumb_func_end sub_80DBCA8 - - thumb_func_start sub_80DBCE0 -sub_80DBCE0: @ 80DBCE0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_80DBD34 - ldr r1, =0x02039f18 - lsls r4, 1 - adds r1, r4, r1 - strh r0, [r1] - ldr r2, =0x02039f08 - adds r2, r4, r2 - ldr r1, =0x02039f00 - adds r4, r1 - ldrh r4, [r4] - adds r0, r4 - strh r0, [r2] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DBCE0 - - thumb_func_start sub_80DBD18 -sub_80DBD18: @ 80DBD18 - push {r4,lr} - movs r4, 0 -_080DBD1C: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_80DBCE0 - adds r4, 0x1 - cmp r4, 0x3 - ble _080DBD1C - bl sub_80DBD4C - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80DBD18 - - thumb_func_start sub_80DBD34 -sub_80DBD34: @ 80DBD34 - lsls r0, 24 - ldr r1, =0x02039f10 - lsrs r0, 23 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - lsls r0, 17 - asrs r0, 16 - bx lr - .pool - thumb_func_end sub_80DBD34 - - thumb_func_start sub_80DBD4C -sub_80DBD4C: @ 80DBD4C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x70 - mov r0, sp - movs r1, 0 - movs r2, 0x8 - bl memset - movs r0, 0 - mov r9, r0 - mov r1, sp - adds r1, 0x8 - str r1, [sp, 0x64] - mov r3, sp - adds r3, 0xC - str r3, [sp, 0x68] - mov r6, sp - adds r6, 0x14 - str r6, [sp, 0x6C] - mov r4, sp -_080DBD7A: - bl GenerateRandomNumber - strh r0, [r4] - movs r2, 0 - cmp r2, r9 - bge _080DBDB8 - mov r1, sp - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r1] - cmp r0, r1 - bne _080DBD9C - subs r4, 0x2 - movs r7, 0x1 - negs r7, r7 - add r9, r7 - b _080DBDB8 -_080DBD9C: - adds r2, 0x1 - cmp r2, r9 - bge _080DBDB8 - lsls r0, r2, 1 - mov r3, sp - adds r1, r3, r0 - ldrh r0, [r4] - ldrh r1, [r1] - cmp r0, r1 - bne _080DBD9C - subs r4, 0x2 - movs r6, 0x1 - negs r6, r6 - add r9, r6 -_080DBDB8: - adds r4, 0x2 - movs r7, 0x1 - add r9, r7 - mov r0, r9 - cmp r0, 0x3 - ble _080DBD7A - movs r1, 0 - mov r9, r1 - mov r4, sp - ldr r6, =0x02039f08 - ldr r2, [sp, 0x64] - ldr r5, =0x02039f00 - ldr r3, [sp, 0x68] -_080DBDD2: - mov r7, r9 - lsls r1, r7, 4 - movs r7, 0 - ldrsh r0, [r6, r7] - str r0, [r2] - movs r7, 0 - ldrsh r0, [r5, r7] - str r0, [r3] - ldrh r0, [r4] - str r0, [r2, 0x8] - ldr r0, [sp, 0x6C] - adds r1, r0, r1 - mov r7, r9 - str r7, [r1] - adds r4, 0x2 - adds r6, 0x2 - adds r2, 0x10 - adds r5, 0x2 - adds r3, 0x10 - movs r0, 0x1 - add r9, r0 - mov r1, r9 - cmp r1, 0x3 - ble _080DBDD2 - movs r3, 0 - mov r9, r3 -_080DBE06: - movs r4, 0x3 - cmp r4, r9 - ble _080DBE90 - add r7, sp, 0x48 - ldr r6, [sp, 0x68] - str r6, [sp, 0x58] - ldr r0, [sp, 0x64] - adds r0, 0x8 - str r0, [sp, 0x5C] - ldr r1, [sp, 0x6C] - str r1, [sp, 0x60] -_080DBE1C: - subs r3, r4, 0x1 - mov r10, r3 - mov r0, r10 - adds r1, r4, 0 - ldr r2, [sp, 0x64] - bl sub_80DBF30 - lsls r0, 24 - cmp r0, 0 - beq _080DBE8A - mov r6, r10 - lsls r2, r6, 4 - ldr r0, [sp, 0x64] - adds r3, r0, r2 - ldr r0, [r3] - str r0, [sp, 0x48] - ldr r1, [sp, 0x58] - adds r6, r1, r2 - ldr r0, [r6] - str r0, [r7, 0x4] - ldr r0, [sp, 0x5C] - adds r0, r2 - mov r8, r0 - ldr r0, [r0] - str r0, [r7, 0x8] - ldr r1, [sp, 0x60] - adds r2, r1, r2 - ldr r0, [r2] - str r0, [r7, 0xC] - lsls r1, r4, 4 - ldr r0, [sp, 0x64] - adds r5, r0, r1 - ldr r0, [r5] - str r0, [r3] - ldr r3, [sp, 0x58] - adds r4, r3, r1 - ldr r0, [r4] - str r0, [r6] - ldr r6, [sp, 0x5C] - adds r3, r6, r1 - ldr r0, [r3] - mov r6, r8 - str r0, [r6] - ldr r0, [sp, 0x60] - adds r1, r0, r1 - ldr r0, [r1] - str r0, [r2] - ldr r0, [sp, 0x48] - str r0, [r5] - ldr r0, [r7, 0x4] - str r0, [r4] - ldr r0, [r7, 0x8] - str r0, [r3] - ldr r0, [r7, 0xC] - str r0, [r1] -_080DBE8A: - mov r4, r10 - cmp r4, r9 - bgt _080DBE1C -_080DBE90: - movs r1, 0x1 - add r9, r1 - mov r3, r9 - cmp r3, 0x2 - ble _080DBE06 - movs r6, 0 - mov r9, r6 - ldr r2, =0x02039f20 - ldr r1, [sp, 0x6C] -_080DBEA2: - ldr r0, [r1] - adds r0, r2 - mov r7, r9 - strb r7, [r0] - adds r1, 0x10 - movs r0, 0x1 - add r9, r0 - mov r3, r9 - cmp r3, 0x3 - ble _080DBEA2 - add sp, 0x70 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DBD4C - - thumb_func_start sub_80DBED4 -sub_80DBED4: @ 80DBED4 - push {lr} - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080DBF0E - ldr r0, =0x03005d90 - ldr r2, [r0] - ldr r1, =0x02039f20 - ldr r0, =0x02039f25 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r1, 1 - ldr r0, =0x02039f2c - ldrh r0, [r0] - lsls r0, 3 - adds r1, r0 - ldr r0, =0x00000624 - adds r2, r0 - adds r2, r1 - ldrh r0, [r2] - adds r0, 0x1 - ldr r1, =0x0000270f - cmp r0, r1 - ble _080DBF0C - adds r0, r1, 0 -_080DBF0C: - strh r0, [r2] -_080DBF0E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DBED4 - - thumb_func_start sub_80DBF30 -sub_80DBF30: @ 80DBF30 - push {lr} - lsls r0, 4 - adds r0, r2 - lsls r1, 4 - adds r3, r1, r2 - ldr r2, [r0] - ldr r1, [r3] - cmp r2, r1 - blt _080DBF60 - cmp r2, r1 - bgt _080DBF52 - ldr r2, [r0, 0x4] - ldr r1, [r3, 0x4] - cmp r2, r1 - blt _080DBF60 - cmp r2, r1 - ble _080DBF56 -_080DBF52: - movs r2, 0 - b _080DBF62 -_080DBF56: - ldr r1, [r0, 0x8] - ldr r0, [r3, 0x8] - movs r2, 0 - cmp r1, r0 - bge _080DBF62 -_080DBF60: - movs r2, 0x1 -_080DBF62: - adds r0, r2, 0 - pop {r1} - bx r1 - thumb_func_end sub_80DBF30 - - thumb_func_start sub_80DBF68 -sub_80DBF68: @ 80DBF68 - push {lr} - ldr r0, =0x02022e16 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e1e - strh r1, [r0] - bl sub_80DB89C - ldr r0, =gUnknown_0827E8DA - movs r1, 0 - bl sub_80DEC30 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DBF68 - - thumb_func_start sub_80DBF90 -sub_80DBF90: @ 80DBF90 - push {r4,r5,lr} - sub sp, 0xC - movs r5, 0x80 - lsls r5, 18 - movs r4, 0x3 -_080DBF9A: - lsrs r3, r5, 24 - movs r0, 0x8 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0x16 - bl sub_80DED10 - movs r0, 0xA0 - lsls r0, 19 - adds r5, r0 - subs r4, 0x1 - cmp r4, 0 - bge _080DBF9A - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80DBF90 - - thumb_func_start sub_80DBFC8 -sub_80DBFC8: @ 80DBFC8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x00005011 - cmp r0, 0 - beq _080DBFE2 - ldr r1, =0x00006011 - cmp r0, 0x1 - beq _080DBFE2 - ldr r1, =0x00008011 - cmp r0, 0x2 - bne _080DBFE2 - ldr r1, =0x00007011 -_080DBFE2: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80DBFC8 - - thumb_func_start sub_80DBFFC -sub_80DBFFC: @ 80DBFFC - push {lr} - lsls r0, 16 - asrs r0, 16 - movs r1, 0xA - bl __divsi3 - lsls r0, 24 - lsrs r1, r0, 24 - asrs r2, r0, 24 - cmp r2, 0x10 - ble _080DC016 - movs r1, 0x10 - b _080DC020 -_080DC016: - movs r0, 0x10 - negs r0, r0 - cmp r2, r0 - bge _080DC020 - movs r1, 0xF0 -_080DC020: - lsls r0, r1, 24 - asrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_80DBFFC - - thumb_func_start sub_80DC028 -sub_80DC028: @ 80DC028 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - adds r6, r1, 0 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 16 - lsrs r6, 16 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x14] - lsls r1, r2, 2 - adds r1, r0 - ldrb r0, [r1, 0x2] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1, 0x2] - ldr r0, =sub_80DC0F4 - movs r1, 0x14 - bl CreateTask - lsls r0, 24 - lsrs r7, r0, 24 - lsls r5, 16 - asrs r5, 16 - adds r0, r5, 0 - bl sub_80DBFFC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r6, 16 - asrs r6, 16 - adds r5, r6 - lsls r5, 16 - asrs r5, 16 - adds r0, r5, 0 - bl sub_80DBFFC - lsls r4, 24 - asrs r4, 24 - subs r0, r4 - lsls r0, 24 - lsrs r5, r0, 24 - mov r0, r8 - bl sub_80DBFC8 - ldr r2, =0x03005e00 - lsls r3, r7, 2 - adds r0, r3, r7 - lsls r0, 3 - adds r1, r0, r2 - adds r0, r4, 0 - cmp r4, 0 - bge _080DC0A0 - negs r0, r4 -_080DC0A0: - strh r0, [r1, 0x8] - lsls r0, r5, 24 - asrs r0, 24 - strh r0, [r1, 0xA] - cmp r4, 0 - bgt _080DC0B4 - cmp r4, 0 - bne _080DC0C8 - cmp r0, 0 - ble _080DC0C8 -_080DC0B4: - movs r0, 0x1 - strh r0, [r1, 0xC] - b _080DC0D6 - .pool -_080DC0C8: - ldr r2, =0x03005e00 - lsls r3, r7, 2 - adds r0, r3, r7 - lsls r0, 3 - adds r0, r2 - ldr r1, =0x0000ffff - strh r1, [r0, 0xC] -_080DC0D6: - adds r0, r3, r7 - lsls r0, 3 - adds r0, r2 - mov r1, r8 - strh r1, [r0, 0xE] - adds r0, r7, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80DC028 - - thumb_func_start sub_80DC0F4 -sub_80DC0F4: @ 80DC0F4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r4, r0, r1 - ldrb r0, [r4, 0xE] - mov r9, r0 - ldrh r3, [r4, 0x8] - ldrh r1, [r4, 0xA] - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - strh r0, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xE - bgt _080DC126 - b _080DC2A8 -_080DC126: - movs r0, 0 - strh r0, [r4, 0x1C] - ldrh r2, [r4, 0xA] - movs r5, 0xA - ldrsh r0, [r4, r5] - cmp r0, 0 - bne _080DC15C - adds r0, r7, 0 - bl DestroyTask - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x14] - mov r2, r9 - lsls r1, r2, 2 - adds r1, r0 - ldrb r2, [r1, 0x2] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x2] - b _080DC2A8 - .pool -_080DC15C: - cmp r3, 0 - bne _080DC1A4 - lsls r0, r1, 16 - mov r8, r0 - cmp r0, 0 - bge _080DC17A - mov r0, r9 - bl sub_80DBFC8 - adds r0, 0x2 - lsls r0, 16 - lsrs r6, r0, 16 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - b _080DC188 -_080DC17A: - mov r0, r9 - bl sub_80DBFC8 - lsls r0, 16 - lsrs r6, r0, 16 - ldrh r0, [r4, 0xA] - subs r0, 0x1 -_080DC188: - strh r0, [r4, 0xA] - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x8] - adds r2, r1, 0x1 - strh r2, [r0, 0x8] - lsls r1, 24 - lsrs r5, r1, 24 - b _080DC210 - .pool -_080DC1A4: - movs r3, 0xC - ldrsh r0, [r4, r3] - cmp r0, 0 - bge _080DC1DE - lsls r0, r1, 16 - mov r8, r0 - cmp r0, 0 - bge _080DC1CC - ldrh r0, [r4, 0x8] - adds r1, r0, 0x1 - strh r1, [r4, 0x8] - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r2, 0x1 - strh r0, [r4, 0xA] - mov r0, r9 - bl sub_80DBFC8 - adds r0, 0x2 - b _080DC20C -_080DC1CC: - ldrh r0, [r4, 0x8] - subs r0, 0x1 - strh r0, [r4, 0x8] - lsls r0, 24 - lsrs r5, r0, 24 - movs r6, 0 - subs r0, r2, 0x1 - strh r0, [r4, 0xA] - b _080DC210 -_080DC1DE: - lsls r0, r1, 16 - mov r8, r0 - cmp r0, 0 - bge _080DC1F8 - ldrh r0, [r4, 0x8] - subs r0, 0x1 - strh r0, [r4, 0x8] - lsls r0, 24 - lsrs r5, r0, 24 - movs r6, 0 - adds r0, r2, 0x1 - strh r0, [r4, 0xA] - b _080DC210 -_080DC1F8: - ldrh r0, [r4, 0x8] - adds r1, r0, 0x1 - strh r1, [r4, 0x8] - lsls r0, 24 - lsrs r5, r0, 24 - subs r0, r2, 0x1 - strh r0, [r4, 0xA] - mov r0, r9 - bl sub_80DBFC8 -_080DC20C: - lsls r0, 16 - lsrs r6, r0, 16 -_080DC210: - str r5, [sp, 0xC] - movs r0, 0 - mov r10, r0 - cmp r5, 0x7 - bls _080DC226 - movs r2, 0x1 - mov r10, r2 - adds r0, r5, 0 - subs r0, 0x8 - lsls r0, 24 - lsrs r5, r0, 24 -_080DC226: - adds r2, r5, 0 - adds r2, 0x16 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =0x02039f26 - add r0, r9 - ldrb r0, [r0] - lsls r3, r0, 2 - adds r3, r0 - adds r3, 0x2 - add r3, r10 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x1 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - adds r1, r6, 0 - bl sub_80DED10 - mov r3, r8 - cmp r3, 0 - ble _080DC284 - movs r0, 0x60 - bl audio_play - ldr r4, =0x030075f0 - adds r0, r4, 0 - bl m4aMPlayImmInit - ldr r1, =0x0000ffff - ldr r0, [sp, 0xC] - lsls r2, r0, 24 - asrs r2, 16 - adds r0, r4, 0 - bl MPlayPitchControl - b _080DC28A - .pool -_080DC284: - movs r0, 0x16 - bl audio_play -_080DC28A: - mov r2, r10 - cmp r2, 0 - bne _080DC2A8 - cmp r5, 0 - bne _080DC2A8 - cmp r6, 0 - bne _080DC2A8 - ldr r0, =0x03005e00 - lsls r1, r7, 2 - adds r1, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0xC] - negs r0, r0 - strh r0, [r1, 0xC] -_080DC2A8: - 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_80DC0F4 - - thumb_func_start sub_80DC2BC -sub_80DC2BC: @ 80DC2BC - push {r4,r5,lr} - ldr r0, =gUnknown_08587A74 - bl LoadObjectPic - movs r4, 0 - ldr r5, =gUnknown_08587A6C -_080DC2C8: - ldr r0, =0x02039f26 - adds r0, r4, r0 - ldrb r0, [r0] - adds r0, r5 - ldrb r2, [r0] - ldr r0, =gUnknown_08587AD0 - movs r1, 0xB4 - movs r3, 0x1 - bl AddObjectToFront - ldr r1, =0x02039f34 - ldr r1, [r1] - ldr r2, [r1, 0x14] - lsls r1, r4, 2 - adds r1, r2 - strb r0, [r1] - adds r4, 0x1 - cmp r4, 0x3 - ble _080DC2C8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DC2BC - - thumb_func_start sub_80DC308 -sub_80DC308: @ 80DC308 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r2, [r0, 0x14] - lsls r3, r6, 2 - adds r2, r3, r2 - ldrb r0, [r2, 0x2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x2] - ldr r1, [r4] - ldr r0, [r1, 0x14] - adds r3, r0 - ldrb r7, [r3] - ldr r1, [r1, 0x4] - lsls r0, r6, 3 - subs r0, r6 - lsls r0, 2 - adds r0, r1 - movs r1, 0x4 - ldrsh r0, [r0, r1] - movs r1, 0xA - bl __divsi3 - lsls r0, 17 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, 0x38 - ble _080DC350 - movs r5, 0x38 - b _080DC356 - .pool -_080DC350: - cmp r0, 0 - bge _080DC356 - movs r5, 0 -_080DC356: - ldr r2, =0x02020630 - lsls r3, r7, 4 - adds r0, r3, r7 - lsls r0, 2 - adds r4, r0, r2 - movs r0, 0x3E - adds r0, r4 - mov r12, r0 - ldrb r1, [r0] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - mov r1, r12 - strb r0, [r1] - strh r6, [r4, 0x2E] - strh r5, [r4, 0x30] - lsls r0, r5, 16 - asrs r0, 16 - movs r5, 0x24 - ldrsh r1, [r4, r5] - cmp r0, r1 - ble _080DC38C - movs r0, 0x1 - b _080DC38E - .pool -_080DC38C: - ldr r0, =0x0000ffff -_080DC38E: - strh r0, [r4, 0x32] - adds r0, r3, r7 - lsls r0, 2 - adds r1, r2, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_80DC408 - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DC308 - - thumb_func_start sub_80DC3AC -sub_80DC3AC: @ 80DC3AC - push {r4,lr} - movs r4, 0 -_080DC3B0: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_80DC308 - adds r4, 0x1 - cmp r4, 0x3 - ble _080DC3B0 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80DC3AC - - thumb_func_start sub_80DC3C4 -sub_80DC3C4: @ 80DC3C4 - push {r4,lr} - movs r2, 0 - ldr r3, =0x02039f34 - ldr r0, [r3] - ldr r0, [r0, 0x14] - ldrb r1, [r0, 0x2] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080DC3F2 - movs r4, 0x1 -_080DC3DA: - adds r2, 0x1 - cmp r2, 0x3 - bgt _080DC3F2 - ldr r0, [r3] - ldr r1, [r0, 0x14] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0, 0x2] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _080DC3DA -_080DC3F2: - cmp r2, 0x4 - beq _080DC400 - movs r0, 0 - b _080DC402 - .pool -_080DC400: - movs r0, 0x1 -_080DC402: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80DC3C4 - - thumb_func_start sub_80DC408 -sub_80DC408: @ 80DC408 - push {r4,lr} - adds r3, r0, 0 - ldrh r2, [r3, 0x24] - movs r0, 0x24 - ldrsh r1, [r3, r0] - movs r4, 0x30 - ldrsh r0, [r3, r4] - cmp r1, r0 - bne _080DC440 - ldr r0, =0x02039f34 - ldr r0, [r0] - movs r2, 0x2E - ldrsh r1, [r3, r2] - ldr r0, [r0, 0x14] - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x2] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x2] - ldr r0, =DummyObjectCallback - str r0, [r3, 0x1C] - b _080DC446 - .pool -_080DC440: - ldrh r0, [r3, 0x32] - adds r0, r2, r0 - strh r0, [r3, 0x24] -_080DC446: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80DC408 - - thumb_func_start sub_80DC44C -sub_80DC44C: @ 80DC44C - push {r4-r6,lr} - movs r2, 0 - ldr r6, =0x02020630 - ldr r5, =0x02039f34 - ldr r4, =gUnknown_08587A6C - ldr r3, =0x02039f26 -_080DC458: - ldr r0, [r5] - ldr r1, [r0, 0x14] - lsls r0, r2, 2 - adds r0, r1 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - adds r0, r2, r3 - ldrb r0, [r0] - adds r0, r4 - ldrb r0, [r0] - strh r0, [r1, 0x22] - adds r2, 0x1 - cmp r2, 0x3 - ble _080DC458 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DC44C - - thumb_func_start sub_80DC490 -sub_80DC490: @ 80DC490 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r3, 0 - ldr r7, =0x02039f26 - ldr r5, =0x02020630 - ldr r4, =0x02039f34 - movs r2, 0 -_080DC4A0: - adds r0, r3, r7 - ldrb r0, [r0] - cmp r0, 0x1 - bls _080DC4E2 - cmp r6, 0 - bne _080DC4CC - ldr r0, [r4] - ldr r0, [r0, 0x14] - adds r0, r2, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0xB4 - b _080DC4E0 - .pool -_080DC4CC: - ldr r0, [r4] - ldr r0, [r0, 0x14] - adds r0, r2, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x80 - lsls r1, 1 -_080DC4E0: - strh r1, [r0, 0x20] -_080DC4E2: - adds r2, 0x4 - adds r3, 0x1 - cmp r3, 0x3 - ble _080DC4A0 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80DC490 - - thumb_func_start sub_80DC4F0 -sub_80DC4F0: @ 80DC4F0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =gUnknown_08587B08 - bl LoadTaggedObjectPalette - movs r5, 0 - ldr r7, =0x02039f34 - ldr r0, =0x02020630 - mov r8, r0 - movs r6, 0 -_080DC506: - lsls r0, r5, 3 - ldr r1, =gUnknown_08587AE8 - adds r0, r1 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_08587B18 - adds r0, r6, r0 - ldr r2, =gUnknown_08587A70 - ldr r1, =0x02039f26 - adds r1, r5, r1 - ldrb r1, [r1] - adds r1, r2 - ldrb r2, [r1] - movs r1, 0xCC - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - ldr r1, [r1, 0x14] - lsls r4, r5, 2 - adds r1, r4, r1 - strb r0, [r1, 0x1] - ldr r0, [r7] - ldr r0, [r0, 0x14] - adds r0, r4, r0 - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldr r1, =gUnknown_08587B80 - bl SetSpriteOamTables_NoPriorityFromTable - ldr r0, [r7] - ldr r0, [r0, 0x14] - adds r4, r0 - ldrb r1, [r4, 0x1] - 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] - adds r6, 0x18 - adds r5, 0x1 - cmp r5, 0x3 - ble _080DC506 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DC4F0 - - thumb_func_start sub_80DC594 -sub_80DC594: @ 80DC594 - push {lr} - ldr r0, =gUnknown_08587BB0 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_08587BB8 - bl LoadTaggedObjectPalette - ldr r0, =gUnknown_08587BC8 - movs r1, 0x1E - movs r2, 0x2C - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x3E - ldrb r2, [r1] - movs r3, 0x4 - orrs r2, r3 - strb r2, [r1] - ldr r1, =0x02039f34 - ldr r1, [r1] - ldr r1, [r1] - adds r1, 0x58 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DC594 - - thumb_func_start sub_80DC5E8 -sub_80DC5E8: @ 80DC5E8 - push {r4,lr} - ldr r0, =sub_80DC728 - movs r1, 0x1E - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02039f34 - ldr r1, [r1] - ldr r1, [r1] - strb r0, [r1, 0xD] - movs r2, 0 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r4, =0x03005e08 - movs r3, 0xFF -_080DC60A: - lsls r0, r2, 3 - adds r0, r1 - adds r0, r4 - strh r3, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _080DC60A - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DC5E8 - - thumb_func_start sub_80DC630 -sub_80DC630: @ 80DC630 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x03005e00 - ldr r1, =0x02039f34 - ldr r5, [r1] - ldr r1, [r5] - ldrb r2, [r1, 0xD] - lsls r1, r2, 2 - adds r1, r2 - adds r1, r0 - lsls r1, 3 - adds r3, 0x8 - adds r1, r3 - movs r4, 0 - strh r4, [r1] - lsls r0, 2 - adds r0, 0x1 - lsls r0, 1 - ldr r1, [r5] - ldrb r2, [r1, 0xD] - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r0, r1 - adds r0, r3 - strh r4, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DC630 - - thumb_func_start sub_80DC674 -sub_80DC674: @ 80DC674 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =sub_80DC6A4 - movs r1, 0x1F - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DC674 - - thumb_func_start sub_80DC6A4 -sub_80DC6A4: @ 80DC6A4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - ldr r2, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x8] - adds r5, r0, 0 - ldr r0, =0x02039f34 - ldr r4, [r0] - ldr r0, [r4] - ldrb r1, [r0, 0xD] - lsls r0, r1, 2 - adds r0, r1 - adds r0, r5 - lsls r0, 3 - adds r7, r2, 0 - adds r7, 0x8 - adds r1, r0, r7 - movs r2, 0 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _080DC6DC - cmp r0, 0xFF - bne _080DC716 -_080DC6DC: - movs r3, 0 - movs r0, 0xFF - strh r0, [r1] - lsls r1, r5, 2 - adds r1, 0x1 - lsls r1, 1 - ldr r0, [r4] - ldrb r2, [r0, 0xD] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r1, r7 - strh r3, [r1] - ldr r0, [r4] - adds r0, 0x14 - adds r0, r5 - ldrb r0, [r0] - adds r0, 0x5 - lsls r0, 4 - adds r0, 0x6 - ldr r3, =0x00004bff - movs r1, 0x2 - movs r2, 0 - bl pal_fade_1 - adds r0, r6, 0 - bl DestroyTask -_080DC716: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DC6A4 - - thumb_func_start sub_80DC728 -sub_80DC728: @ 80DC728 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - movs r6, 0 - lsls r1, r0, 2 - adds r1, r0 - mov r9, r1 - lsls r7, r1, 3 - ldr r0, =0x03005e08 - mov r8, r0 - movs r1, 0x8 - negs r1, r1 - add r1, r8 - mov r10, r1 -_080DC74C: - lsls r0, r6, 26 - lsrs r3, r0, 24 - lsls r0, r3, 1 - adds r0, r7 - mov r4, r8 - adds r2, r0, r4 - ldrh r4, [r2] - movs r5, 0 - ldrsh r0, [r2, r5] - cmp r0, 0xFF - beq _080DC7CA - adds r0, r3, 0x1 - lsls r1, r0, 1 - adds r1, r7 - add r1, r8 - movs r5, 0 - ldrsh r1, [r1, r5] - adds r5, r0, 0 - cmp r1, 0 - bne _080DC77C - adds r0, r4, 0x1 - b _080DC77E - .pool -_080DC77C: - subs r0, r4, 0x1 -_080DC77E: - strh r0, [r2] - lsls r1, r3, 1 - mov r0, r9 - lsls r2, r0, 3 - adds r0, r1, r2 - mov r3, r10 - adds r3, 0x8 - adds r0, r3 - movs r4, 0 - ldrsh r0, [r0, r4] - adds r4, r1, 0 - cmp r0, 0x10 - beq _080DC79C - cmp r0, 0 - bne _080DC7AA -_080DC79C: - lsls r0, r5, 1 - adds r0, r2 - adds r0, r3 - ldrh r1, [r0] - movs r2, 0x1 - eors r1, r2 - strh r1, [r0] -_080DC7AA: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0] - adds r0, 0x14 - adds r0, r6 - ldrb r0, [r0] - adds r0, 0x5 - lsls r0, 4 - adds r0, 0x6 - adds r1, r4, r7 - add r1, r8 - ldrb r2, [r1] - movs r1, 0x2 - ldr r3, =0x00004bff - bl pal_fade_1 -_080DC7CA: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x3 - bls _080DC74C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DC728 - - thumb_func_start sub_80DC7EC -sub_80DC7EC: @ 80DC7EC - push {r4,lr} - ldr r0, =sub_80DC8D0 - movs r1, 0x1E - bl CreateTask - ldr r1, =0x02039f34 - ldr r1, [r1] - ldr r1, [r1] - strb r0, [r1, 0xE] - movs r4, 0 -_080DC800: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_80DC81C - adds r4, 0x1 - cmp r4, 0x3 - ble _080DC800 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DC7EC - - thumb_func_start sub_80DC81C -sub_80DC81C: @ 80DC81C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x03005e00 - ldr r1, =0x02039f34 - ldr r4, [r1] - ldr r1, [r4] - ldrb r2, [r1, 0xE] - lsls r1, r2, 2 - adds r1, r2 - adds r1, r0 - lsls r1, 3 - adds r3, 0x8 - adds r1, r3 - movs r5, 0 - movs r2, 0xFF - strh r2, [r1] - lsls r0, 2 - adds r0, 0x1 - lsls r0, 1 - ldr r1, [r4] - ldrb r2, [r1, 0xE] - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r0, r1 - adds r0, r3 - strh r5, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DC81C - - thumb_func_start sub_80DC864 -sub_80DC864: @ 80DC864 - push {r4,lr} - movs r4, 0 -_080DC868: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_80DC87C - adds r4, 0x1 - cmp r4, 0x3 - ble _080DC868 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80DC864 - - thumb_func_start sub_80DC87C -sub_80DC87C: @ 80DC87C - push {r4-r6,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_80DC81C - adds r0, r4, 0x5 - lsls r2, r0, 5 - ldr r3, =0x02037728 - adds r6, r2, r3 - ldr r5, =0x02037b28 - adds r2, r5 - ldr r1, =0x040000d4 - str r6, [r1] - str r2, [r1, 0x4] - ldr r2, =0x80000001 - str r2, [r1, 0x8] - ldr r6, [r1, 0x8] - lsls r0, 4 - adds r4, 0xC - adds r0, r4 - lsls r0, 1 - subs r3, 0x14 - adds r3, r0, r3 - subs r5, 0x14 - adds r0, r5 - str r3, [r1] - str r0, [r1, 0x4] - str r2, [r1, 0x8] - ldr r0, [r1, 0x8] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DC87C - - thumb_func_start sub_80DC8D0 -sub_80DC8D0: @ 80DC8D0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - movs r7, 0 - lsls r1, r0, 2 - adds r1, r0 - mov r9, r1 - lsls r6, r1, 3 - ldr r0, =0x03005e08 - mov r8, r0 - ldr r1, =0x00004bff - mov r10, r1 -_080DC8F0: - lsls r0, r7, 26 - lsrs r3, r0, 24 - lsls r0, r3, 1 - adds r0, r6 - mov r4, r8 - adds r2, r0, r4 - movs r5, 0 - ldrsh r0, [r2, r5] - cmp r0, 0xFF - beq _080DC996 - adds r0, r3, 0x2 - lsls r0, 1 - adds r0, r6 - adds r1, r0, r4 - ldrh r0, [r1] - adds r0, 0x1 - movs r4, 0 - strh r0, [r1] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _080DC996 - strh r4, [r1] - adds r0, r3, 0x1 - lsls r1, r0, 1 - adds r1, r6 - add r1, r8 - movs r4, 0 - ldrsh r1, [r1, r4] - adds r4, r0, 0 - cmp r1, 0 - bne _080DC940 - ldrh r0, [r2] - adds r0, 0x1 - b _080DC944 - .pool -_080DC940: - ldrh r0, [r2] - subs r0, 0x1 -_080DC944: - strh r0, [r2] - lsls r1, r3, 1 - mov r5, r9 - lsls r2, r5, 3 - adds r0, r1, r2 - ldr r3, =0x03005e00 - adds r3, 0x8 - adds r0, r3 - movs r5, 0 - ldrsh r0, [r0, r5] - adds r5, r1, 0 - cmp r0, 0x10 - beq _080DC962 - cmp r0, 0 - bne _080DC970 -_080DC962: - lsls r0, r4, 1 - adds r0, r2 - adds r0, r3 - ldrh r1, [r0] - movs r2, 0x1 - eors r1, r2 - strh r1, [r0] -_080DC970: - adds r4, r7, 0x5 - lsls r4, 4 - adds r0, r4, 0 - adds r0, 0xA - adds r5, r6 - add r5, r8 - ldrb r2, [r5] - movs r1, 0x1 - mov r3, r10 - bl pal_fade_1 - adds r4, 0xC - adds r4, r7 - ldrb r2, [r5] - adds r0, r4, 0 - movs r1, 0x1 - mov r3, r10 - bl pal_fade_1 -_080DC996: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x3 - bls _080DC8F0 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DC8D0 - - thumb_func_start sub_80DC9B4 -sub_80DC9B4: @ 80DC9B4 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x15] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080DC9E0 - adds r0, r2, 0 - bl sub_80DC630 - b _080DC9E6 - .pool -_080DC9E0: - adds r0, r2, 0 - bl sub_80DC674 -_080DC9E6: - pop {r0} - bx r0 - thumb_func_end sub_80DC9B4 - - thumb_func_start sub_80DC9EC -sub_80DC9EC: @ 80DC9EC - 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, 0xC] - ldr r6, =0x02039f26 - adds r6, r0, r6 - ldrb r0, [r6] - lsls r5, r0, 2 - adds r5, r0 - lsls r5, 27 - movs r0, 0x80 - lsls r0, 22 - adds r5, r0 - lsrs r5, 24 - ldr r1, [sp, 0xC] - lsls r4, r1, 3 - ldr r0, =gUnknown_08589904 - adds r0, r4, r0 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_08589924 - adds r4, r0 - adds r0, r4, 0 - bl LoadTaggedObjectPalette - ldr r2, [sp, 0xC] - lsls r4, r2, 1 - adds r4, r2 - lsls r4, 3 - ldr r0, =gUnknown_0858998C - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB8 - adds r2, r5, 0 - movs r3, 0x1D - bl AddObjectToFront - mov r9, r0 - mov r3, r9 - lsls r3, 24 - lsrs r3, 24 - mov r9, r3 - adds r0, r4, 0 - movs r1, 0xF8 - adds r2, r5, 0 - movs r3, 0x1D - bl AddObjectToFront - mov r8, r0 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r5, r0, 4 - add r5, r8 - lsls r5, 2 - ldr r1, =0x02020630 - adds r5, r1 - ldrh r2, [r5, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x40 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x4] - movs r4, 0xC0 - lsls r4, 19 - ldrb r0, [r6] - lsls r3, r0, 2 - adds r3, r0 - lsls r3, 6 - ldr r0, =0x0600e026 - adds r3, r0 - ldr r7, =0x02039f34 - ldr r0, [r7] - ldr r0, [r0, 0x34] - str r0, [sp] - movs r0, 0 - movs r1, 0x3 - adds r2, r4, 0 - bl rfu_MBOOT_CHILD_inheritanceLinkStatus - ldrb r0, [r6] - lsls r3, r0, 2 - adds r3, r0 - lsls r3, 6 - ldr r1, =0x0600e036 - adds r3, r1 - ldr r0, [r7] - ldr r0, [r0, 0x38] - str r0, [sp] - movs r0, 0 - movs r1, 0x3 - adds r2, r4, 0 - bl rfu_MBOOT_CHILD_inheritanceLinkStatus - movs r4, 0 - str r4, [sp, 0x4] - ldr r0, [r7] - ldr r1, [r0, 0x34] - movs r6, 0xA0 - lsls r6, 3 - adds r1, r6 - ldr r2, =0x050000c0 - mov r10, r2 - add r0, sp, 0x4 - bl CpuSet - str r4, [sp, 0x8] - add r0, sp, 0x8 - ldr r1, [r7] - ldr r1, [r1, 0x38] - adds r1, r6 - mov r2, r10 - bl CpuSet - ldr r0, [r7] - ldr r0, [r0, 0x34] - mov r3, r9 - lsls r4, r3, 4 - add r4, r9 - lsls r4, 2 - ldr r1, =0x02020630 - adds r4, r1 - ldrh r1, [r4, 0x4] - lsls r1, 22 - lsrs r1, 17 - ldr r6, =0x06010000 - adds r1, r6 - movs r2, 0x80 - lsls r2, 4 - mov r10, r2 - movs r3, 0x1 - bl RequestDma3Copy - ldr r0, [r7] - ldr r0, [r0, 0x38] - ldrh r1, [r5, 0x4] - lsls r1, 22 - lsrs r1, 17 - adds r1, r6 - mov r2, r10 - movs r3, 0x1 - bl RequestDma3Copy - mov r3, r8 - strh r3, [r4, 0x2E] - mov r0, r9 - strh r0, [r5, 0x2E] - mov r1, sp - ldrh r1, [r1, 0xC] - strh r1, [r4, 0x30] - mov r2, sp - ldrh r2, [r2, 0xC] - strh r2, [r5, 0x30] - mov r0, r9 - 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_80DC9EC - - thumb_func_start sub_80DCB78 -sub_80DCB78: @ 80DCB78 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02020630 - lsls r5, r0, 4 - adds r5, r0 - lsls r5, 2 - adds r5, r1 - ldrh r0, [r5, 0x2E] - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - adds r4, r1 - adds r0, r4, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - adds r0, r5, 0 - bl RemoveObjectAndFreeResources - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DCB78 - - thumb_func_start sub_80DCBB4 -sub_80DCBB4: @ 80DCBB4 - push {lr} - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x00000907 - movs r0, 0x52 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DCBB4 - - thumb_func_start sub_80DCBD0 -sub_80DCBD0: @ 80DCBD0 - push {lr} - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - pop {r0} - bx r0 - thumb_func_end sub_80DCBD0 - - thumb_func_start sub_80DCBE8 -sub_80DCBE8: @ 80DCBE8 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - adds r4, r0, 0 - mov r9, r1 - lsls r4, 24 - lsrs r4, 24 - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - bl sub_80DCBB4 - ldr r0, =0x02039f34 - ldr r1, [r0] - ldr r2, =0x02020630 - mov r8, r2 - lsls r6, r4, 4 - adds r6, r4 - lsls r6, 2 - adds r0, r6, r2 - movs r3, 0x30 - ldrsh r2, [r0, r3] - ldr r1, [r1, 0x14] - lsls r2, 2 - adds r2, r1 - ldrb r1, [r2, 0x2] - movs r3, 0x2 - orrs r1, r3 - strb r1, [r2, 0x2] - ldrh r5, [r0, 0x2E] - lsls r5, 24 - lsrs r5, 24 - movs r1, 0x1 - bl StartObjectRotScalAnim - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - mov r1, r8 - adds r0, r4, r1 - movs r1, 0x1 - bl StartObjectRotScalAnim - movs r2, 0x1C - add r8, r2 - add r6, r8 - ldr r0, =sub_80DCC84 - str r0, [r6] - add r4, r8 - ldr r0, =DummyObjectCallback - str r0, [r4] - mov r3, r9 - cmp r3, 0 - bne _080DCC70 - movs r0, 0x65 - bl audio_play - b _080DCC76 - .pool -_080DCC70: - movs r0, 0x2 - bl audio_play -_080DCC76: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80DCBE8 - - thumb_func_start sub_80DCC84 -sub_80DCC84: @ 80DCC84 - push {lr} - mov r12, r0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080DCCCC - mov r0, r12 - ldrh r1, [r0, 0x2E] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x02020630 - 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, 26 - cmp r0, 0 - bge _080DCCCC - mov r3, r12 - adds r3, 0x3E - ldrb r0, [r3] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r3] - adds r1, 0x3E - ldrb r0, [r1] - orrs r0, r2 - strb r0, [r1] - ldr r0, =sub_80DCCD8 - mov r1, r12 - str r0, [r1, 0x1C] -_080DCCCC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DCC84 - - thumb_func_start sub_80DCCD8 -sub_80DCCD8: @ 80DCCD8 - push {lr} - ldr r1, =0x02039f34 - ldr r1, [r1] - movs r3, 0x30 - ldrsh r2, [r0, r3] - ldr r1, [r1, 0x14] - lsls r2, 2 - adds r2, r1 - ldrb r3, [r2, 0x2] - movs r1, 0x3 - negs r1, r1 - ands r1, r3 - strb r1, [r2, 0x2] - ldrh r0, [r0, 0x2E] - lsls r0, 24 - lsrs r0, 24 - bl sub_80DCB78 - bl sub_80DCBD0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DCCD8 - - thumb_func_start sub_80DCD08 -sub_80DCD08: @ 80DCD08 - push {lr} - ldr r0, =0x02000000 - movs r1, 0xD0 - lsls r1, 9 - adds r2, r0, r1 - ldrb r1, [r2] - adds r3, r0, 0 - cmp r1, 0x1 - bne _080DCD24 - movs r0, 0 - b _080DCD26 - .pool -_080DCD24: - movs r0, 0x1 -_080DCD26: - strb r0, [r2] - movs r1, 0xD0 - lsls r1, 9 - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080DCD3E - bl sub_80DAEA4 - bl sub_80DB2BC - b _080DCD42 -_080DCD3E: - bl sub_80DCD48 -_080DCD42: - pop {r0} - bx r0 - thumb_func_end sub_80DCD08 - - thumb_func_start sub_80DCD48 -sub_80DCD48: @ 80DCD48 - push {r4,r5,lr} - sub sp, 0xC - ldr r0, =0x020322d5 - ldrb r0, [r0] - cmp r0, 0 - beq _080DCE44 - ldr r0, =0x02000000 - movs r1, 0xD0 - lsls r1, 9 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080DCE44 - cmp r0, 0 - blt _080DCD7C - cmp r0, 0x3 - bgt _080DCD7C - cmp r0, 0x2 - blt _080DCD7C - bl sub_80DF750 - b _080DCE44 - .pool -_080DCD7C: - movs r5, 0 -_080DCD7E: - adds r0, r5, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _080DCD7E - movs r5, 0 -_080DCD92: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r1 - add r2, sp, 0x4 - ldrh r4, [r0, 0x4] - movs r1, 0x4 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _080DCDBC - negs r0, r0 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r2, 0 - ldr r1, =gUnknown_085E8D40 - bl CopyString - adds r2, r0, 0 -_080DCDBC: - lsls r1, r4, 16 - asrs r1, 16 - adds r0, r2, 0 - movs r2, 0 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r0, =0x02039f26 - adds r0, r5, r0 - ldrb r0, [r0] - movs r1, 0x7 - str r1, [sp] - add r1, sp, 0x4 - movs r2, 0x37 - movs r3, 0x1 - bl sub_80DEBD0 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _080DCD92 - movs r5, 0 -_080DCDEA: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r1 - add r2, sp, 0x4 - ldrh r4, [r0, 0x2] - movs r1, 0x2 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _080DCE14 - negs r0, r0 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r2, 0 - ldr r1, =gUnknown_085E8D40 - bl CopyString - adds r2, r0, 0 -_080DCE14: - lsls r1, r4, 16 - asrs r1, 16 - adds r0, r2, 0 - movs r2, 0 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r0, =0x02039f26 - adds r0, r5, r0 - ldrb r0, [r0] - movs r1, 0x7 - str r1, [sp] - add r1, sp, 0x4 - movs r2, 0x5 - movs r3, 0x1 - bl sub_80DEBD0 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _080DCDEA - bl sub_80DB2BC -_080DCE44: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DCD48 - - thumb_func_start sub_80DCE58 -sub_80DCE58: @ 80DCE58 - 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 r8, r0 - add r4, sp, 0x4 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x8 - bl memset - movs r5, 0 - add r4, sp, 0x4 - adds r6, r4, 0 - movs r7, 0 -_080DCE7E: - bl GenerateRandomNumber - adds r1, r0, 0 - mov r0, sp - adds r0, r7 - adds r0, 0x4 - strh r1, [r0] - movs r2, 0 - cmp r2, r5 - bge _080DCEB6 - lsls r0, r1, 16 - lsrs r0, 16 - mov r1, sp - ldrh r1, [r1, 0x4] - cmp r0, r1 - beq _080DCEB0 -_080DCE9E: - adds r2, 0x1 - cmp r2, r5 - bge _080DCEB6 - lsls r0, r2, 1 - adds r0, r4, r0 - ldrh r1, [r6] - ldrh r0, [r0] - cmp r1, r0 - bne _080DCE9E -_080DCEB0: - subs r6, 0x2 - subs r7, 0x2 - subs r5, 0x1 -_080DCEB6: - adds r6, 0x2 - adds r7, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _080DCE7E - mov r2, r8 - cmp r2, 0 - bne _080DCF80 - movs r5, 0 - ldr r3, =0x02039f26 - mov r8, r3 -_080DCECC: - mov r6, r8 - strb r5, [r6] - movs r4, 0 - cmp r4, r5 - bge _080DCF48 - ldr r7, =0x02039f00 - mov r9, r7 - lsls r0, r5, 1 - adds r1, r0, 0 - add r1, r9 - mov r12, r1 - mov r2, sp - adds r2, 0x4 - str r2, [sp, 0xC] - add r0, sp - adds r0, 0x4 - str r0, [sp, 0x10] - ldr r3, =0x02039f26 - adds r6, r3, 0 - mov r10, r6 -_080DCEF4: - ldrb r0, [r3] - lsls r2, r0, 1 - mov r7, r9 - adds r0, r2, r7 - movs r6, 0 - ldrsh r1, [r0, r6] - mov r7, r12 - movs r6, 0 - ldrsh r0, [r7, r6] - cmp r1, r0 - blt _080DCF1C - cmp r1, r0 - bne _080DCF40 - ldr r7, [sp, 0xC] - adds r0, r7, r2 - ldrh r0, [r0] - ldr r1, [sp, 0x10] - ldrh r1, [r1] - cmp r0, r1 - bcs _080DCF40 -_080DCF1C: - adds r2, r5, 0 - cmp r5, r4 - ble _080DCF34 - subs r0, r5, 0x1 - mov r6, r10 - adds r1, r0, r6 -_080DCF28: - ldrb r0, [r1] - strb r0, [r1, 0x1] - subs r1, 0x1 - subs r2, 0x1 - cmp r2, r4 - bgt _080DCF28 -_080DCF34: - strb r5, [r3] - b _080DCF48 - .pool -_080DCF40: - adds r3, 0x1 - adds r4, 0x1 - cmp r4, r5 - blt _080DCEF4 -_080DCF48: - cmp r4, r5 - bne _080DCF50 - mov r7, r8 - strb r5, [r7] -_080DCF50: - movs r0, 0x1 - add r8, r0 - adds r5, 0x1 - cmp r5, 0x3 - ble _080DCECC - ldr r4, =0x02039f26 - mov r0, sp - adds r1, r4, 0 - movs r2, 0x4 - bl memcpy - movs r5, 0 -_080DCF68: - mov r1, sp - adds r0, r1, r5 - ldrb r0, [r0] - adds r0, r4 - strb r5, [r0] - adds r5, 0x1 - cmp r5, 0x3 - ble _080DCF68 - b _080DD034 - .pool -_080DCF80: - mov r0, sp - movs r1, 0xFF - movs r2, 0x4 - bl memset - movs r5, 0 - ldr r3, =0x02039f26 - movs r6, 0 -_080DCF90: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x4] - adds r0, r6, r0 - ldrb r0, [r0, 0xB] - lsls r0, 30 - lsrs r2, r0, 30 - mov r7, sp - adds r1, r7, r2 - b _080DCFB6 - .pool -_080DCFAC: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - mov r0, sp - adds r1, r0, r2 -_080DCFB6: - ldrb r0, [r1] - cmp r0, 0xFF - bne _080DCFAC - strb r5, [r1] - strb r2, [r3] - adds r3, 0x1 - adds r6, 0x1C - adds r5, 0x1 - cmp r5, 0x3 - ble _080DCF90 - movs r5, 0 -_080DCFCC: - movs r4, 0x3 - adds r1, r5, 0x1 - mov r10, r1 - cmp r4, r5 - ble _080DD02E - mov r9, r4 - ldr r2, =0x02039f26 - mov r8, r2 - add r3, sp, 0x4 - mov r12, r3 -_080DCFE0: - ldr r6, =0x02039f34 - ldr r0, [r6] - ldr r1, [r0, 0x4] - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r0, r1 - adds r1, r0, 0 - subs r1, 0x1C - ldrb r2, [r1, 0xB] - ldrb r3, [r0, 0xB] - mov r1, r9 - ands r1, r2 - mov r0, r9 - ands r0, r3 - subs r3, r4, 0x1 - cmp r1, r0 - bne _080DD028 - mov r0, r8 - adds r7, r3, r0 - adds r2, r4, r0 - ldrb r6, [r7] - ldrb r1, [r2] - cmp r6, r1 - bcs _080DD028 - lsls r0, r3, 1 - add r0, r12 - lsls r1, r4, 1 - add r1, r12 - ldrh r0, [r0] - ldrh r1, [r1] - cmp r0, r1 - bcs _080DD028 - ldrb r0, [r2] - strb r6, [r2] - strb r0, [r7] -_080DD028: - adds r4, r3, 0 - cmp r4, r5 - bgt _080DCFE0 -_080DD02E: - mov r5, r10 - cmp r5, 0x2 - ble _080DCFCC -_080DD034: - 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_80DCE58 - - thumb_func_start sub_80DD04C -sub_80DD04C: @ 80DD04C - push {r4,r5,lr} - movs r4, 0 - movs r5, 0xA0 -_080DD052: - ldr r0, =0x0201a004 - adds r0, r5, r0 - ldr r1, =0x02039f26 - adds r1, r4, r1 - ldrb r1, [r1] - adds r1, 0x5 - lsls r1, 4 - movs r2, 0x20 - bl gpu_pal_apply - adds r5, 0x20 - adds r4, 0x1 - cmp r4, 0x3 - ble _080DD052 - bl sub_80DAEA4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DD04C - - thumb_func_start sub_80DD080 -sub_80DD080: @ 80DD080 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r4, =0x02039f34 - ldr r3, [r4] - ldr r1, [r3, 0x4] - lsls r7, r6, 3 - subs r0, r7, r6 - lsls r5, r0, 2 - adds r1, r5, r1 - movs r2, 0 - strh r2, [r1, 0x2] - ldr r0, [r3, 0x4] - adds r0, r5, r0 - strh r2, [r0] - adds r0, r6, 0 - bl sub_80DBA68 - lsls r0, 24 - mov r8, r4 - cmp r0, 0 - bne _080DD0B4 - b _080DD3C4 -_080DD0B4: - ldr r0, [r4] - ldr r1, [r0, 0x4] - adds r1, r5, r1 - ldrh r0, [r1, 0x6] - ldr r2, =gContestMoves - lsls r0, 3 - adds r0, r2 - ldrb r2, [r0] - mov r9, r2 - ldrb r0, [r0, 0x1] - lsls r0, 29 - lsrs r0, 29 - strb r0, [r1, 0xA] - ldr r0, [r4] - ldr r0, [r0, 0x4] - adds r2, r5, r0 - ldrh r0, [r2, 0x6] - ldrh r1, [r2, 0x8] - cmp r0, r1 - bne _080DD110 - cmp r0, 0 - beq _080DD110 - ldrb r0, [r2, 0x15] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x15] - ldr r0, [r4] - ldr r2, [r0, 0x4] - adds r2, r5, r2 - ldrb r3, [r2, 0xB] - lsls r1, r3, 25 - lsrs r1, 29 - adds r1, 0x1 - movs r0, 0x7 - ands r1, r0 - lsls r1, 4 - movs r0, 0x71 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0xB] - b _080DD12C - .pool -_080DD110: - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r0, [r0, 0x4] - lsls r3, r6, 3 - subs r1, r3, r6 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0xB] - movs r0, 0x71 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0xB] - mov r8, r4 - adds r7, r3, 0 -_080DD12C: - mov r2, r8 - ldr r4, [r2] - ldr r2, [r4, 0x4] - subs r0, r7, r6 - lsls r0, 2 - adds r2, r0, r2 - ldr r3, =gContestEffects - mov r1, r9 - lsls r5, r1, 2 - adds r3, r5, r3 - ldrb r1, [r3, 0x1] - strh r1, [r2] - ldr r1, [r4, 0x4] - adds r0, r1 - ldrh r1, [r0] - strh r1, [r0, 0x2] - ldr r1, [r4, 0x8] - ldrb r0, [r3, 0x2] - strh r0, [r1, 0x4] - ldr r1, [r4, 0x8] - ldrh r0, [r1, 0x4] - strh r0, [r1, 0x6] - ldr r0, [r4, 0x8] - strb r6, [r0, 0x11] - movs r2, 0 - mov r9, r5 - mov r4, r8 - movs r3, 0 - movs r1, 0 -_080DD166: - ldr r0, [r4] - ldr r0, [r0, 0x4] - adds r0, r1, r0 - strb r3, [r0, 0xE] - ldr r0, [r4] - ldr r0, [r0, 0x8] - adds r0, 0xD - adds r0, r2 - strb r3, [r0] - adds r1, 0x1C - adds r2, 0x1 - cmp r2, 0x3 - ble _080DD166 - ldr r5, =0x02039f34 - ldr r0, [r5] - ldr r1, [r0, 0x4] - subs r0, r7, r6 - lsls r4, r0, 2 - adds r2, r4, r1 - ldrb r1, [r2, 0x15] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080DD1B4 - ldrh r0, [r2, 0x8] - ldrh r1, [r2, 0x6] - bl AreMovesContestCombo - lsls r0, 24 - cmp r0, 0 - bne _080DD1B4 - ldr r0, [r5] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r2, [r1, 0x15] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x15] -_080DD1B4: - ldr r0, =gContestEffectFunctionTable - add r0, r9 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0x4] - subs r0, r7, r6 - lsls r0, 2 - adds r2, r0, r1 - ldrb r1, [r2, 0x10] - movs r0, 0x30 - ands r0, r1 - cmp r0, 0x10 - bne _080DD1EC - ldrh r1, [r2, 0x2] - subs r1, 0xA - movs r0, 0xD - ldrsb r0, [r2, r0] - b _080DD206 - .pool -_080DD1EC: - ldrb r1, [r2, 0x11] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080DD200 - movs r1, 0xD - ldrsb r1, [r2, r1] - lsls r0, r1, 1 - adds r0, r1 - b _080DD204 -_080DD200: - movs r0, 0xD - ldrsb r0, [r2, r0] -_080DD204: - ldrh r1, [r2, 0x2] -_080DD206: - adds r0, r1 - strh r0, [r2, 0x2] - ldr r5, =0x02039f34 - ldr r0, [r5] - ldr r1, [r0, 0x4] - subs r0, r7, r6 - lsls r4, r0, 2 - adds r1, r4, r1 - movs r0, 0 - strb r0, [r1, 0x16] - ldr r0, [r5] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r2, [r1, 0x15] - movs r0, 0x41 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x15] - adds r0, r6, 0 - bl sub_80DE1E8 - lsls r0, 24 - cmp r0, 0 - beq _080DD2E2 - ldr r0, [r5] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrh r0, [r1, 0x8] - ldrh r1, [r1, 0x6] - bl AreMovesContestCombo - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _080DD29C - ldr r0, [r5] - ldr r0, [r0, 0x4] - adds r2, r4, r0 - ldrb r1, [r2, 0x15] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080DD29C - strb r3, [r2, 0x16] - ldr r0, [r5] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r0, [r1, 0x15] - movs r2, 0x40 - orrs r0, r2 - strb r0, [r1, 0x15] - ldr r0, [r5] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r2, [r1, 0x15] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x15] - ldr r0, [r5] - ldr r0, [r0, 0x4] - adds r0, r4, r0 - movs r1, 0 - ldrsh r2, [r0, r1] - ldrb r1, [r0, 0x16] - muls r1, r2 - strb r1, [r0, 0x17] - ldr r0, [r5] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r0, [r1, 0x15] - movs r2, 0x8 - b _080DD2C8 - .pool -_080DD29C: - ldr r2, =gContestMoves - ldr r5, =0x02039f34 - ldr r0, [r5] - ldr r1, [r0, 0x4] - subs r0, r7, r6 - lsls r4, r0, 2 - adds r3, r4, r1 - ldrh r0, [r3, 0x6] - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x2] - cmp r0, 0 - beq _080DD2D8 - ldrb r0, [r3, 0x15] - movs r1, 0x10 - orrs r0, r1 - strb r0, [r3, 0x15] - ldr r0, [r5] - ldr r1, [r0, 0x4] - adds r1, r4, r1 - ldrb r0, [r1, 0x15] - movs r2, 0x40 -_080DD2C8: - orrs r0, r2 - strb r0, [r1, 0x15] - b _080DD2E2 - .pool -_080DD2D8: - ldrb r1, [r3, 0x15] - movs r0, 0x11 - negs r0, r0 - ands r0, r1 - strb r0, [r3, 0x15] -_080DD2E2: - ldr r5, =0x02039f34 - ldr r0, [r5] - ldr r1, [r0, 0x4] - subs r0, r7, r6 - lsls r4, r0, 2 - adds r2, r4, r1 - ldrb r1, [r2, 0x15] - movs r0, 0x1 - mov r8, r0 - ands r0, r1 - cmp r0, 0 - beq _080DD30A - ldrb r0, [r2, 0xB] - lsls r0, 25 - lsrs r0, 29 - adds r0, 0x1 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 1 - strb r1, [r2, 0x18] -_080DD30A: - ldr r0, [r5] - ldr r0, [r0, 0x4] - adds r2, r4, r0 - ldrb r1, [r2, 0xC] - mov r0, r8 - ands r0, r1 - cmp r0, 0 - beq _080DD334 - ldrb r1, [r2, 0x15] - movs r0, 0x11 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x15] - ldr r2, [r5] - ldr r0, [r2, 0x4] - adds r0, r4, r0 - movs r1, 0 - strh r1, [r0, 0x2] - ldr r0, [r2, 0x4] - adds r0, r4, r0 - strh r1, [r0] -_080DD334: - ldr r0, [r5] - ldr r0, [r0, 0x4] - adds r0, r4, r0 - ldrh r0, [r0, 0x6] - bl sub_80DD9F0 - ldr r1, [r5] - ldr r1, [r1, 0x10] - strb r0, [r1] - ldr r2, [r5] - ldr r0, [r2, 0x4] - adds r0, r4, r0 - ldrb r1, [r0, 0x11] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080DD35C - ldr r0, [r2, 0x10] - mov r1, r8 - strb r1, [r0] -_080DD35C: - ldr r1, [r5] - ldr r3, [r1, 0x10] - movs r0, 0 - ldrsb r0, [r3, r0] - cmp r0, 0 - ble _080DD388 - ldr r0, [r1] - ldrb r0, [r0, 0x13] - lsls r0, 24 - asrs r0, 24 - movs r1, 0 - ldrsb r1, [r3, r1] - adds r0, r1 - cmp r0, 0x4 - ble _080DD384 - movs r0, 0x3C - b _080DD38A - .pool -_080DD384: - movs r0, 0xA - b _080DD38A -_080DD388: - movs r0, 0 -_080DD38A: - strb r0, [r3, 0x2] - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - movs r2, 0 - b _080DD3AE -_080DD3A2: - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 -_080DD3A8: - adds r2, 0x1 - cmp r2, 0x3 - bgt _080DD3B6 -_080DD3AE: - cmp r2, r6 - beq _080DD3A8 - cmp r0, 0 - bne _080DD3A2 -_080DD3B6: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0x4] - subs r0, r7, r6 - lsls r0, 2 - adds r0, r1 - strb r2, [r0, 0x1B] -_080DD3C4: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DD080 - - thumb_func_start sub_80DD3D4 -sub_80DD3D4: @ 80DD3D4 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02039f34 - ldr r2, [r2] - ldr r3, [r2, 0x4] - lsls r2, r0, 3 - subs r2, r0 - lsls r2, 2 - adds r2, r3 - strb r1, [r2, 0x13] - bx lr - .pool - thumb_func_end sub_80DD3D4 - - thumb_func_start sub_80DD3F0 -sub_80DD3F0: @ 80DD3F0 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02039f34 - ldr r2, [r2] - ldr r3, [r2, 0x4] - lsls r2, r0, 3 - subs r2, r0 - lsls r2, 2 - adds r2, r3 - strb r1, [r2, 0x14] - bx lr - .pool - thumb_func_end sub_80DD3F0 - - thumb_func_start sub_80DD40C -sub_80DD40C: @ 80DD40C - push {lr} - lsls r0, 24 - lsrs r0, 24 - adds r3, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r2, r1, 0 - cmp r1, 0x3B - bls _080DD426 - movs r1, 0x35 - bl sub_80DD3D4 - b _080DD456 -_080DD426: - cmp r1, 0x27 - bls _080DD432 - movs r1, 0x34 - bl sub_80DD3D4 - b _080DD456 -_080DD432: - cmp r1, 0x1D - bls _080DD43E - movs r1, 0x33 - bl sub_80DD3D4 - b _080DD456 -_080DD43E: - cmp r1, 0x13 - bls _080DD44A - movs r1, 0x32 - bl sub_80DD3D4 - b _080DD456 -_080DD44A: - cmp r2, 0x9 - bls _080DD456 - adds r0, r3, 0 - movs r1, 0x31 - bl sub_80DD3D4 -_080DD456: - pop {r0} - bx r0 - thumb_func_end sub_80DD40C - - thumb_func_start sub_80DD45C -sub_80DD45C: @ 80DD45C - push {r4-r6,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r6, r1, 24 - ldr r0, =0x02021cc4 - lsls r1, r4, 6 - ldr r2, =0x02039e02 - adds r1, r2 - bl CopyString - ldr r0, =0x02021dc4 - ldr r5, =0x02039f34 - ldr r1, [r5] - ldr r2, [r1, 0x4] - lsls r1, r4, 3 - subs r1, r4 - lsls r1, 2 - adds r1, r2 - ldrh r2, [r1, 0x6] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - ldr r3, =gContestMoves - ldr r1, [r5] - ldr r0, [r1, 0x8] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x6] - lsls r0, 3 - adds r0, r3 - ldrb r0, [r0, 0x1] - lsls r1, r0, 29 - cmp r1, 0 - bne _080DD4DC - ldr r0, =0x02021ec4 - ldr r1, =gUnknown_0827E837 - bl CopyString - b _080DD52C - .pool -_080DD4DC: - lsrs r0, r1, 29 - cmp r0, 0x1 - bne _080DD4F4 - ldr r0, =0x02021ec4 - ldr r1, =gUnknown_0827E83F - bl CopyString - b _080DD52C - .pool -_080DD4F4: - lsrs r0, r1, 29 - cmp r0, 0x2 - bne _080DD50C - ldr r0, =0x02021ec4 - ldr r1, =gUnknown_0827E847 - bl CopyString - b _080DD52C - .pool -_080DD50C: - lsrs r0, r1, 29 - cmp r0, 0x3 - bne _080DD524 - ldr r0, =0x02021ec4 - ldr r1, =gUnknown_0827E850 - bl CopyString - b _080DD52C - .pool -_080DD524: - ldr r0, =0x02021ec4 - ldr r1, =gUnknown_0827E85A - bl CopyString -_080DD52C: - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_08587E10 - lsls r0, r6, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r4, 0 - bl ExpandStringRefs - bl sub_80DB89C - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80DEC30 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DD45C - - thumb_func_start sub_80DD560 -sub_80DD560: @ 80DD560 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x02039f34 - ldr r1, [r4] - ldr r3, [r1, 0x4] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r3, r1, r3 - ldrb r0, [r3, 0xC] - movs r2, 0x1 - orrs r0, r2 - strb r0, [r3, 0xC] - ldr r0, [r4] - ldr r0, [r0, 0x4] - adds r1, r0 - movs r0, 0 - strh r0, [r1, 0x6] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DD560 - - thumb_func_start sub_80DD590 -sub_80DD590: @ 80DD590 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - movs r0, 0 - mov r12, r0 - movs r4, 0 - ldr r1, =0x02039f26 - mov r9, r1 - add r2, sp, 0x4 - mov r6, r9 - movs r5, 0 - adds r3, r2, 0 -_080DD5AC: - mov r0, sp - adds r1, r0, r4 - adds r0, r4, r6 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r3, r4 - strb r5, [r0] - adds r4, 0x1 - cmp r4, 0x3 - ble _080DD5AC - movs r4, 0 - ldr r7, =0x02039f34 - ldr r1, [r7] - mov r8, r1 - adds r5, r2, 0 -_080DD5CA: - movs r2, 0 - mov r0, r8 - ldr r1, [r0, 0x4] -_080DD5D0: - ldrb r0, [r1, 0x19] - cmp r0, r4 - beq _080DD604 - adds r1, 0x1C - adds r2, 0x1 - cmp r2, 0x3 - ble _080DD5D0 -_080DD5DE: - cmp r2, 0x4 - bne _080DD684 - movs r2, 0 - ldrb r0, [r5] - cmp r0, 0 - bne _080DD612 - ldr r0, [r7] - ldr r0, [r0, 0x4] - ldrb r0, [r0, 0x19] - cmp r0, 0xFF - bne _080DD612 - mov r12, r2 - movs r2, 0x1 - b _080DD63A - .pool -_080DD604: - mov r1, sp - adds r0, r1, r2 - strb r4, [r0] - adds r1, r5, r2 - movs r0, 0x1 - strb r0, [r1] - b _080DD5DE -_080DD612: - adds r2, 0x1 - cmp r2, 0x3 - bgt _080DD676 - adds r0, r5, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080DD612 - ldr r0, [r7] - ldr r1, [r0, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x19] - cmp r0, 0xFF - bne _080DD612 - lsls r0, r2, 24 - lsrs r0, 24 - mov r12, r0 - adds r2, 0x1 -_080DD63A: - cmp r2, 0x3 - bgt _080DD676 - ldr r6, =0x02039f26 - lsls r0, r2, 3 - subs r0, r2 - lsls r3, r0, 2 -_080DD646: - adds r0, r5, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080DD66E - ldr r0, [r7] - ldr r0, [r0, 0x4] - adds r0, r3, r0 - ldrb r0, [r0, 0x19] - cmp r0, 0xFF - bne _080DD66E - mov r1, r12 - adds r0, r1, r6 - adds r1, r2, r6 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bls _080DD66E - lsls r0, r2, 24 - lsrs r0, 24 - mov r12, r0 -_080DD66E: - adds r3, 0x1C - adds r2, 0x1 - cmp r2, 0x3 - ble _080DD646 -_080DD676: - mov r0, sp - add r0, r12 - strb r4, [r0] - mov r0, r12 - adds r1, r5, r0 - movs r0, 0x1 - strb r0, [r1] -_080DD684: - adds r4, 0x1 - cmp r4, 0x3 - ble _080DD5CA - movs r4, 0 - ldr r6, =0x02039f34 - movs r5, 0 -_080DD690: - ldr r0, [r6] - ldr r1, [r0, 0x8] - adds r1, r4 - mov r0, sp - adds r3, r0, r4 - ldrb r0, [r3] - strb r0, [r1] - ldr r0, [r6] - ldr r0, [r0, 0x4] - adds r0, r5, r0 - movs r1, 0xFF - strb r1, [r0, 0x19] - ldr r0, [r6] - ldr r1, [r0, 0x4] - adds r1, r5, r1 - ldrb r2, [r1, 0x10] - movs r0, 0x3F - ands r0, r2 - strb r0, [r1, 0x10] - mov r0, r9 - adds r1, r4, r0 - ldrb r0, [r3] - strb r0, [r1] - adds r5, 0x1C - adds r4, 0x1 - cmp r4, 0x3 - ble _080DD690 - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DD590 - - thumb_func_start sub_80DD6DC -sub_80DD6DC: @ 80DD6DC - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x30] - adds r1, r0, 0x1 - strh r1, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x54 - ble _080DD712 - movs r0, 0 - strh r0, [r2, 0x30] - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r3] - ldr r0, =DummyObjectCallback - str r0, [r2, 0x1C] - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0] - ldrb r1, [r2, 0x6] - movs r0, 0x11 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x6] -_080DD712: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DD6DC - - thumb_func_start sub_80DD720 -sub_80DD720: @ 80DD720 - push {r4,r5,lr} - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0] - ldrb r5, [r0, 0x12] - cmp r1, 0x8 - bls _080DD734 - b _080DD8D4 -_080DD734: - lsls r0, r1, 2 - ldr r1, =_080DD748 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080DD748: - .4byte _080DD76C - .4byte _080DD76C - .4byte _080DD79C - .4byte _080DD7D0 - .4byte _080DD804 - .4byte _080DD838 - .4byte _080DD86C - .4byte _080DD8D4 - .4byte _080DD8A0 -_080DD76C: - ldr r0, =0x02020630 - lsls r4, r5, 4 - adds r1, r4, r5 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x2E] - ldr r2, =0x000003ff - ands r2, r0 - ldrh r3, [r1, 0x4] - ldr r0, =0xfffffc00 - ands r0, r3 - orrs r0, r2 - strh r0, [r1, 0x4] - movs r0, 0x20 - bl audio_play - b _080DD8F8 - .pool -_080DD79C: - ldr r0, =0x02020630 - lsls r4, r5, 4 - adds r1, r4, r5 - lsls r1, 2 - adds r1, r0 - ldrh r2, [r1, 0x2E] - adds r2, 0x4 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r2, r0 - ldrh r3, [r1, 0x4] - ldr r0, =0xfffffc00 - ands r0, r3 - orrs r0, r2 - strh r0, [r1, 0x4] - movs r0, 0x1F - bl audio_play - b _080DD8F8 - .pool -_080DD7D0: - ldr r0, =0x02020630 - lsls r4, r5, 4 - adds r1, r4, r5 - lsls r1, 2 - adds r1, r0 - ldrh r2, [r1, 0x2E] - adds r2, 0x8 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r2, r0 - ldrh r3, [r1, 0x4] - ldr r0, =0xfffffc00 - ands r0, r3 - orrs r0, r2 - strh r0, [r1, 0x4] - movs r0, 0x1F - bl audio_play - b _080DD8F8 - .pool -_080DD804: - ldr r0, =0x02020630 - lsls r4, r5, 4 - adds r1, r4, r5 - lsls r1, 2 - adds r1, r0 - ldrh r2, [r1, 0x2E] - adds r2, 0xC - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r2, r0 - ldrh r3, [r1, 0x4] - ldr r0, =0xfffffc00 - ands r0, r3 - orrs r0, r2 - strh r0, [r1, 0x4] - movs r0, 0x2D - bl audio_play - b _080DD8F8 - .pool -_080DD838: - ldr r0, =0x02020630 - lsls r4, r5, 4 - adds r1, r4, r5 - lsls r1, 2 - adds r1, r0 - ldrh r2, [r1, 0x2E] - adds r2, 0xC - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r2, r0 - ldrh r3, [r1, 0x4] - ldr r0, =0xfffffc00 - ands r0, r3 - orrs r0, r2 - strh r0, [r1, 0x4] - movs r0, 0x2D - bl audio_play - b _080DD8F8 - .pool -_080DD86C: - ldr r0, =0x02020630 - lsls r4, r5, 4 - adds r1, r4, r5 - lsls r1, 2 - adds r1, r0 - ldrh r2, [r1, 0x2E] - adds r2, 0x10 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r2, r0 - ldrh r3, [r1, 0x4] - ldr r0, =0xfffffc00 - ands r0, r3 - orrs r0, r2 - strh r0, [r1, 0x4] - movs r0, 0x2D - bl audio_play - b _080DD8F8 - .pool -_080DD8A0: - ldr r0, =0x02020630 - lsls r4, r5, 4 - adds r1, r4, r5 - lsls r1, 2 - adds r1, r0 - ldrh r2, [r1, 0x2E] - adds r2, 0x18 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r2, r0 - ldrh r3, [r1, 0x4] - ldr r0, =0xfffffc00 - ands r0, r3 - orrs r0, r2 - strh r0, [r1, 0x4] - movs r0, 0xC3 - bl audio_play - b _080DD8F8 - .pool -_080DD8D4: - ldr r0, =0x02020630 - lsls r4, r5, 4 - adds r1, r4, r5 - lsls r1, 2 - adds r1, r0 - ldrh r2, [r1, 0x2E] - adds r2, 0x14 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r2, r0 - ldrh r3, [r1, 0x4] - ldr r0, =0xfffffc00 - ands r0, r3 - orrs r0, r2 - strh r0, [r1, 0x4] - movs r0, 0x2D - bl audio_play -_080DD8F8: - adds r2, r4, 0 - ldr r4, =0x02020630 - adds r2, r5 - lsls r2, 2 - adds r1, r2, r4 - movs r0, 0 - strh r0, [r1, 0x30] - adds r1, 0x3E - ldrb r3, [r1] - subs r0, 0x5 - ands r0, r3 - strb r0, [r1] - adds r4, 0x1C - adds r2, r4 - ldr r0, =sub_80DD6DC - str r0, [r2] - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0] - ldrb r0, [r2, 0x6] - movs r1, 0x10 - orrs r0, r1 - strb r0, [r2, 0x6] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DD720 - - thumb_func_start sub_80DD940 -sub_80DD940: @ 80DD940 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r5, 0 - ldr r6, =0x02039f34 - ldr r0, =0x02020630 - mov r9, r0 - ldr r0, =0x06010000 - mov r8, r0 - ldr r7, =0x04000008 -_080DD956: - ldr r0, [r6] - ldr r1, [r0] - movs r0, 0x13 - ldrsb r0, [r1, r0] - ldr r4, =gUnknown_08D8EC24 - cmp r5, r0 - bge _080DD966 - adds r4, 0x40 -_080DD966: - adds r0, r1, 0 - adds r0, 0x58 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - ldrh r1, [r0, 0x4] - lsls r1, 22 - lsrs r1, 22 - adds r0, r5, 0 - adds r0, 0x11 - adds r1, r0 - lsls r1, 5 - add r1, r8 - adds r0, r4, 0 - adds r2, r7, 0 - bl CpuSet - adds r0, r4, 0 - adds r0, 0x20 - ldr r1, [r6] - ldr r1, [r1] - adds r1, 0x58 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r9 - ldrh r1, [r1, 0x4] - lsls r1, 22 - lsrs r1, 22 - adds r2, r5, 0 - adds r2, 0x19 - adds r1, r2 - lsls r1, 5 - add r1, r8 - adds r2, r7, 0 - bl CpuSet - ldr r0, [r6] - ldr r0, [r0] - ldrb r0, [r0, 0x13] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x4 - ble _080DD9C8 - bl sub_80DDA20 -_080DD9C8: - adds r5, 0x1 - cmp r5, 0x4 - ble _080DD956 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DD940 - - thumb_func_start sub_80DD9F0 -sub_80DD9F0: @ 80DD9F0 - lsls r0, 16 - ldr r3, =gUnknown_085899EC - ldr r1, =gContestMoves - lsrs r0, 13 - adds r0, r1 - ldrb r1, [r0, 0x1] - lsls r1, 29 - lsrs r1, 29 - ldr r0, =0x02039f2c - ldrh r2, [r0] - lsls r0, r2, 2 - adds r0, r2 - adds r1, r0 - adds r1, r3 - movs r0, 0 - ldrsb r0, [r1, r0] - bx lr - .pool - thumb_func_end sub_80DD9F0 - - thumb_func_start sub_80DDA20 -sub_80DDA20: @ 80DDA20 - push {r4,r5,lr} - ldr r0, =c3_08130B10 - movs r1, 0xA - bl CreateTask - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =0x03005e00 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - movs r0, 0x1 - strh r0, [r4, 0xA] - ldr r0, =0x0000abe2 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xC] - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80DDA20 - - thumb_func_start c3_08130B10 -c3_08130B10: @ 80DDA60 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r2, r0, r1 - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _080DDAFE - movs r0, 0 - strh r0, [r2, 0x8] - movs r3, 0xE - ldrsh r0, [r2, r3] - cmp r0, 0 - bne _080DDA94 - ldrh r0, [r2, 0x10] - adds r0, 0x1 - b _080DDA98 - .pool -_080DDA94: - ldrh r0, [r2, 0x10] - subs r0, 0x1 -_080DDA98: - strh r0, [r2, 0x10] - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0xC - ldrsh r0, [r4, r1] - lsls r0, 4 - movs r3, 0x84 - lsls r3, 1 - adds r6, r3, 0 - adds r0, r6 - lsls r0, 16 - lsrs r0, 16 - ldrb r2, [r4, 0x10] - ldr r3, =0x00007fff - movs r1, 0x1 - bl pal_fade_1 - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080DDACA - cmp r0, 0x10 - bne _080DDAFE -_080DDACA: - ldrh r0, [r4, 0xE] - movs r1, 0x1 - eors r0, r1 - strh r0, [r4, 0xE] - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0] - ldrb r0, [r0, 0x13] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x4 - bgt _080DDAFE - movs r3, 0xC - ldrsh r0, [r4, r3] - lsls r0, 4 - adds r0, r6 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - movs r2, 0 - movs r3, 0x1F - bl pal_fade_1 - adds r0, r5, 0 - bl DestroyTask -_080DDAFE: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end c3_08130B10 - - thumb_func_start sub_80DDB0C -sub_80DDB0C: @ 80DDB0C - push {r4,lr} - ldr r0, =sub_80DDB6C - movs r1, 0xA - bl CreateTask - ldr r3, =0x02020630 - ldr r4, =0x02039f34 - ldr r2, [r4] - ldr r0, [r2] - adds r0, 0x58 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldr r1, =0x0000ffba - strh r1, [r0, 0x24] - ldr r0, [r2] - adds r0, 0x58 - ldrb r1, [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] - ldr r0, [r4] - ldr r2, [r0] - ldrb r0, [r2, 0x6] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2, 0x6] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DDB0C - - thumb_func_start sub_80DDB6C -sub_80DDB6C: @ 80DDB6C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r3, r0, 0 - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r0, [r0] - adds r0, 0x58 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r2, r0, r1 - ldr r0, =0x03005e00 - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 3 - adds r1, r0 - movs r5, 0xD0 - lsls r5, 3 - adds r0, r5, 0 - ldrh r5, [r1, 0x1C] - adds r0, r5 - strh r0, [r1, 0x1C] - lsls r0, 16 - asrs r0, 24 - ldrh r5, [r2, 0x24] - adds r0, r5 - strh r0, [r2, 0x24] - ldrb r0, [r1, 0x1C] - strh r0, [r1, 0x1C] - movs r1, 0x24 - ldrsh r0, [r2, r1] - cmp r0, 0 - ble _080DDBB8 - movs r0, 0 - strh r0, [r2, 0x24] -_080DDBB8: - movs r5, 0x24 - ldrsh r0, [r2, r5] - cmp r0, 0 - bne _080DDBD4 - ldr r0, [r4] - ldr r2, [r0] - ldrb r1, [r2, 0x6] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x6] - adds r0, r3, 0 - bl DestroyTask -_080DDBD4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DDB6C - - thumb_func_start sub_80DDBE8 -sub_80DDBE8: @ 80DDBE8 - push {r4,r5,lr} - ldr r5, =0x02020630 - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r2, [r0] - adds r0, r2, 0 - adds r0, 0x58 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _080DDC1C - ldrb r1, [r2, 0x6] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - b _080DDC40 - .pool -_080DDC1C: - ldr r0, =task08_080CD1CC - movs r1, 0xA - bl CreateTask - ldr r2, [r4] - ldr r0, [r2] - adds r0, 0x58 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0 - strh r1, [r0, 0x24] - ldr r2, [r2] - ldrb r0, [r2, 0x6] - movs r1, 0x40 - orrs r0, r1 -_080DDC40: - strb r0, [r2, 0x6] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DDBE8 - - thumb_func_start task08_080CD1CC -task08_080CD1CC: @ 80DDC4C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - ldr r5, =0x02039f34 - ldr r0, [r5] - ldr r0, [r0] - adds r0, 0x58 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r3, r0, r1 - ldr r0, =0x03005e00 - lsls r2, r4, 2 - adds r2, r4 - lsls r2, 3 - adds r2, r0 - movs r1, 0xD0 - lsls r1, 3 - adds r0, r1, 0 - ldrh r1, [r2, 0x1C] - adds r0, r1 - strh r0, [r2, 0x1C] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r3, 0x24] - subs r1, r0 - strh r1, [r3, 0x24] - ldrb r0, [r2, 0x1C] - strh r0, [r2, 0x1C] - movs r2, 0x24 - ldrsh r0, [r3, r2] - movs r1, 0x46 - negs r1, r1 - cmp r0, r1 - bge _080DDC9C - ldr r0, =0x0000ffba - strh r0, [r3, 0x24] -_080DDC9C: - movs r2, 0x24 - ldrsh r0, [r3, r2] - cmp r0, r1 - bne _080DDCC4 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, [r5] - ldr r2, [r0] - ldrb r1, [r2, 0x6] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x6] - adds r0, r4, 0 - bl DestroyTask -_080DDCC4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task08_080CD1CC - - thumb_func_start sub_80DDCDC -sub_80DDCDC: @ 80DDCDC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =sub_80DDD20 - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - lsls r4, 24 - asrs r4, 24 - strh r4, [r1, 0x8] - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0] - ldrb r0, [r2, 0x6] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r2, 0x6] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DDCDC - - thumb_func_start sub_80DDD20 -sub_80DDD20: @ 80DDD20 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x1C - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080DDD54 - cmp r0, 0x1 - bgt _080DDD48 - cmp r0, 0 - beq _080DDD4E - b _080DDD9C - .pool -_080DDD48: - cmp r0, 0x2 - beq _080DDD70 - b _080DDD9C -_080DDD4E: - bl sub_80DDB0C - b _080DDD64 -_080DDD54: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0] - ldrb r1, [r0, 0x6] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _080DDD9C -_080DDD64: - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - strh r0, [r4, 0x1C] - b _080DDD9C - .pool -_080DDD70: - ldrh r0, [r4, 0x1E] - adds r1, r0, 0x1 - strh r1, [r4, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _080DDD9C - movs r0, 0 - strh r0, [r4, 0x1E] - bl sub_80DD940 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0] - ldrb r1, [r2, 0x6] - movs r0, 0x21 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x6] - adds r0, r5, 0 - bl DestroyTask -_080DDD9C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DDD20 - - thumb_func_start sub_80DDDA8 -sub_80DDDA8: @ 80DDDA8 - ldr r3, =0x02020630 - ldr r0, =0x02039f34 - ldr r2, [r0] - ldr r0, [r2] - adds r0, 0x58 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0 - strh r1, [r0, 0x24] - ldr r0, [r2] - adds r0, 0x58 - ldrb r1, [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] - bx lr - .pool - thumb_func_end sub_80DDDA8 - - thumb_func_start sub_80DDDE4 -sub_80DDDE4: @ 80DDDE4 - ldr r2, =0x02020630 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0] - adds r0, 0x58 - 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] - bx lr - .pool - thumb_func_end sub_80DDDE4 - - thumb_func_start sub_80DDE0C -sub_80DDE0C: @ 80DDE0C - push {lr} - ldr r0, =sub_80DDE30 - movs r1, 0xF - bl CreateTask - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0] - ldrb r0, [r2, 0x6] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x6] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DDE0C - - thumb_func_start sub_80DDE30 -sub_80DDE30: @ 80DDE30 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x1C] - adds r1, r0, 0x1 - strh r1, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - ble _080DDEBA - movs r0, 0 - strh r0, [r4, 0x1C] - movs r1, 0x1E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080DDE78 - ldr r0, =0x02019000 - ldr r1, =0x06002000 - movs r2, 0x80 - lsls r2, 5 - movs r3, 0x1 - bl RequestDma3Copy - b _080DDE8C - .pool -_080DDE78: - ldr r0, =0x02018000 - ldr r1, =0x06002000 - movs r2, 0x80 - lsls r2, 5 - movs r3, 0x1 - bl RequestDma3Copy - ldrh r0, [r4, 0x20] - adds r0, 0x1 - strh r0, [r4, 0x20] -_080DDE8C: - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x1E] - movs r2, 0x1 - eors r1, r2 - strh r1, [r0, 0x1E] - movs r1, 0x20 - ldrsh r0, [r0, r1] - cmp r0, 0x9 - bne _080DDEBA - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0] - ldrb r1, [r2, 0x6] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x6] - adds r0, r5, 0 - bl DestroyTask -_080DDEBA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DDE30 - - thumb_func_start sub_80DDED0 -sub_80DDED0: @ 80DDED0 - push {r4-r7,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r5, r1, 24 - ldr r0, =sub_80DDF80 - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r6, r0, 24 - lsls r4, 24 - cmp r4, 0 - ble _080DDF38 - ldr r7, =0x0000237e - lsls r0, r5, 24 - adds r4, r0, 0 - cmp r4, 0 - ble _080DDF1C - movs r5, 0 - ldr r2, =0x02039f34 - ldr r0, [r2] - ldr r0, [r0] - movs r1, 0x13 - ldrsb r1, [r0, r1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 24 - lsrs r3, r0, 24 - b _080DDF4E - .pool -_080DDF1C: - ldr r2, =0x02039f34 - ldr r0, [r2] - ldr r0, [r0] - movs r1, 0x13 - ldrsb r1, [r0, r1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - movs r3, 0 - b _080DDF4E - .pool -_080DDF38: - movs r7, 0 - lsls r0, r5, 24 - adds r4, r0, 0 - cmp r4, 0 - ble _080DDF48 - movs r5, 0 - movs r3, 0xC - b _080DDF4C -_080DDF48: - movs r5, 0xC - movs r3, 0 -_080DDF4C: - ldr r2, =0x02039f34 -_080DDF4E: - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - strh r7, [r0, 0x8] - strh r5, [r0, 0xA] - asrs r1, r4, 24 - strh r1, [r0, 0xC] - strh r3, [r0, 0xE] - ldr r0, [r2] - ldr r2, [r0] - ldrb r1, [r2, 0x7] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x7] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DDED0 - - thumb_func_start sub_80DDF80 -sub_80DDF80: @ 80DDF80 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r3, r0, r2 - ldrh r0, [r3, 0x1C] - adds r1, r0, 0x1 - strh r1, [r3, 0x1C] - lsls r0, 16 - cmp r0, 0 - blt _080DDFFC - movs r0, 0 - strh r0, [r3, 0x1C] - movs r1, 0xC - ldrsh r0, [r3, r1] - cmp r0, 0 - ble _080DDFB4 - ldrh r0, [r3, 0xA] - adds r0, 0x1 - b _080DDFB8 - .pool -_080DDFB4: - ldrh r0, [r3, 0xA] - subs r0, 0x1 -_080DDFB8: - strh r0, [r3, 0xA] - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r2 - ldrb r2, [r4, 0xA] - ldrh r3, [r4, 0x8] - movs r0, 0x11 - movs r1, 0x1 - bl pal_fade_1 - ldrb r2, [r4, 0xA] - ldrh r3, [r4, 0x8] - movs r0, 0x1A - movs r1, 0x1 - bl pal_fade_1 - movs r2, 0xA - ldrsh r1, [r4, r2] - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _080DDFFC - adds r0, r5, 0 - bl DestroyTask - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0] - ldrb r1, [r2, 0x7] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x7] -_080DDFFC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DDF80 - - thumb_func_start sub_80DE008 -sub_80DE008: @ 80DE008 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - movs r5, 0 - ldr r0, =0x02039f34 - mov r9, r0 - mov r8, r9 - ldr r6, =0x02020630 - movs r4, 0 - movs r7, 0 -_080DE026: - mov r1, r8 - ldr r0, [r1] - ldr r0, [r0, 0x4] - adds r0, r7, r0 - ldrb r1, [r0, 0x10] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0 - beq _080DE0BC - mov r2, r10 - cmp r2, 0 - beq _080DE0BC - lsls r0, r5, 24 - lsrs r0, 24 - bl sub_80DE0F0 - mov r3, r8 - ldr r1, [r3] - ldr r1, [r1, 0x14] - adds r1, r4, r1 - ldrb r2, [r1, 0x1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r6 - ldrh r1, [r1, 0x4] - lsls r1, 22 - lsrs r1, 17 - ldr r2, =0x060100c0 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - mov r0, r8 - ldr r3, [r0] - ldr r0, [r3, 0x14] - adds r0, r4, r0 - ldrb r0, [r0, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldr r2, =gUnknown_08587A70 - ldr r0, =0x02039f26 - adds r0, r5, r0 - ldrb r0, [r0] - adds r0, r2 - ldrb r0, [r0] - strh r0, [r1, 0x22] - ldr r0, [r3, 0x14] - adds r0, r4, r0 - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - movs r3, 0x5 - negs r3, r3 - adds r2, r3, 0 - ands r1, r2 - b _080DE0D6 - .pool -_080DE0BC: - mov r1, r9 - ldr r0, [r1] - ldr r0, [r0, 0x14] - adds r0, r4, r0 - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 -_080DE0D6: - strb r1, [r0] - adds r4, 0x4 - adds r7, 0x1C - adds r5, 0x1 - cmp r5, 0x3 - ble _080DE026 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80DE008 - - thumb_func_start sub_80DE0F0 -sub_80DE0F0: @ 80DE0F0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02039f34 - ldr r1, [r1] - ldr r2, [r1, 0x4] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r2, r1, r2 - ldrb r1, [r2, 0x10] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0x40 - bne _080DE120 - ldrb r0, [r2, 0x19] - lsls r0, 5 - ldr r1, =gUnknown_08D8E9B4 - adds r0, r1 - b _080DE122 - .pool -_080DE120: - ldr r0, =gUnknown_08D8EA34 -_080DE122: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80DE0F0 - - thumb_func_start sub_80DE12C -sub_80DE12C: @ 80DE12C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - movs r7, 0 - movs r0, 0x2 - mov r10, r0 - movs r0, 0x1 - mov r8, r0 - movs r0, 0x11 - mov r9, r0 -_080DE146: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - adds r0, 0xD - adds r0, r7 - ldrb r0, [r0] - cmp r0, 0 - beq _080DE1CA - lsls r0, r7, 24 - lsrs r0, 24 - bl sub_80DBCA8 - lsls r0, 24 - cmp r0, 0 - bne _080DE1CA - ldr r0, =0x02039f26 - adds r0, r7, r0 - ldrb r0, [r0] - lsls r5, r0, 2 - adds r5, r0 - adds r6, r5, 0x2 - movs r0, 0x3 - bl sub_80DB748 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r6, 24 - lsrs r6, 24 - mov r0, r10 - str r0, [sp] - mov r0, r8 - str r0, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - mov r0, r8 - str r0, [sp, 0xC] - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x14 - adds r3, r6, 0 - bl sub_80DECB8 - adds r4, 0x10 - lsls r4, 16 - lsrs r4, 16 - adds r5, 0x3 - lsls r5, 24 - lsrs r5, 24 - mov r0, r10 - str r0, [sp] - mov r0, r8 - str r0, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - mov r0, r8 - str r0, [sp, 0xC] - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x14 - adds r3, r5, 0 - bl sub_80DECB8 - movs r0, 0x63 - bl audio_play -_080DE1CA: - adds r7, 0x1 - cmp r7, 0x3 - ble _080DE146 - 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_80DE12C - - thumb_func_start sub_80DE1E8 -sub_80DE1E8: @ 80DE1E8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02039f34 - ldr r1, [r1] - ldr r2, [r1, 0x4] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r2, r1, r2 - ldrb r1, [r2, 0x15] - movs r3, 0x1 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _080DE212 - ldrb r1, [r2, 0xC] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _080DE21C -_080DE212: - movs r0, 0 - b _080DE21E - .pool -_080DE21C: - movs r0, 0x1 -_080DE21E: - pop {r1} - bx r1 - thumb_func_end sub_80DE1E8 - - thumb_func_start sub_80DE224 -sub_80DE224: @ 80DE224 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - movs r0, 0xA - bl GetGpuReg - mov r1, sp - strh r0, [r1] - mov r2, sp - ldrb r1, [r2] - movs r4, 0x4 - negs r4, r4 - adds r0, r4, 0 - ands r0, r1 - strb r0, [r2] - ldrb r1, [r2, 0x1] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x1] - ldrb r1, [r2, 0x1] - movs r0, 0x21 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x1] - ldrb r1, [r2] - movs r0, 0xD - negs r0, r0 - mov r8, r0 - ands r0, r1 - strb r0, [r2] - mov r0, sp - ldrh r1, [r0] - movs r0, 0xA - bl SetGpuReg - movs r0, 0x8 - bl GetGpuReg - mov r6, sp - adds r6, 0x2 - strh r0, [r6] - movs r0, 0xC - bl GetGpuReg - add r5, sp, 0x4 - strh r0, [r5] - ldrb r1, [r6] - adds r0, r4, 0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r6] - ldrb r0, [r5] - ands r4, r0 - orrs r4, r1 - strb r4, [r5] - ldrh r1, [r6] - movs r0, 0x8 - bl SetGpuReg - ldrh r1, [r5] - movs r0, 0xC - bl SetGpuReg - ldr r1, =0x02022e18 - movs r0, 0xF0 - strh r0, [r1] - ldr r4, =0x02022e1a - movs r0, 0xA0 - strh r0, [r4] - movs r0, 0x14 - movs r1, 0xF0 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x16 - bl SetGpuReg - movs r0, 0 - str r0, [sp, 0x8] - add r0, sp, 0x8 - ldr r4, =0x02039f34 - ldr r1, [r4] - ldr r1, [r1, 0x28] - ldr r2, =0x05000400 - bl CpuSet - ldr r1, =gUnknown_08C17980 - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x1 - bl sub_80DED60 - movs r5, 0 - ldr r7, =0x02020630 - movs r6, 0x4 -_080DE2F0: - ldr r0, [r4] - ldr r0, [r0, 0x14] - lsls r3, r5, 2 - adds r0, r3, r0 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - ldrb r2, [r1, 0x5] - mov r0, r8 - ands r0, r2 - orrs r0, r6 - strb r0, [r1, 0x5] - ldr r0, [r4] - ldr r0, [r0, 0x14] - adds r3, r0 - ldrb r0, [r3, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - ldrb r2, [r1, 0x5] - mov r0, r8 - ands r0, r2 - orrs r0, r6 - strb r0, [r1, 0x5] - adds r5, 0x1 - cmp r5, 0x3 - ble _080DE2F0 - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DE224 - - thumb_func_start sub_80DE350 -sub_80DE350: @ 80DE350 - push {r4-r7,lr} - sub sp, 0x8 - ldr r1, =0x06008000 - movs r2, 0x80 - lsls r2, 6 - movs r0, 0 - movs r3, 0x1 - bl RequestDma3Fill - movs r5, 0 - str r5, [sp] - ldr r6, =0x02039f34 - ldr r0, [r6] - ldr r1, [r0, 0x28] - ldr r2, =0x05000400 - mov r0, sp - bl CpuSet - movs r0, 0x1 - bl sub_80DED60 - movs r0, 0xA - bl GetGpuReg - add r3, sp, 0x4 - strh r0, [r3] - ldrb r1, [r3] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r3] - mov r1, sp - adds r1, 0x5 - ldrb r2, [r1] - movs r0, 0x3F - ands r0, r2 - strb r0, [r1] - ldrb r2, [r1] - movs r0, 0x21 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldrb r1, [r3] - movs r4, 0xD - negs r4, r4 - adds r0, r4, 0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r3] - ldrh r1, [r3] - movs r0, 0xA - bl SetGpuReg - ldr r0, =0x02022e18 - strh r5, [r0] - ldr r0, =0x02022e1a - strh r5, [r0] - ldr r7, =0x02020630 -_080DE3CA: - ldr r0, [r6] - ldr r0, [r0, 0x14] - lsls r3, r5, 2 - adds r0, r3, r0 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - ldrb r2, [r1, 0x5] - adds r0, r4, 0 - ands r0, r2 - strb r0, [r1, 0x5] - ldr r0, [r6] - ldr r0, [r0, 0x14] - adds r3, r0 - ldrb r0, [r3, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - ldrb r2, [r1, 0x5] - adds r0, r4, 0 - ands r0, r2 - strb r0, [r1, 0x5] - adds r5, 0x1 - cmp r5, 0x3 - ble _080DE3CA - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DE350 - - thumb_func_start sub_80DE424 -sub_80DE424: @ 80DE424 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =0x02022e18 - movs r0, 0 - strh r0, [r1] - ldr r1, =0x02022e1a - movs r0, 0xA0 - strh r0, [r1] - movs r0, 0x62 - movs r1, 0 - bl audio_play_and_stuff - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80DE464 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DE424 - - thumb_func_start sub_80DE464 -sub_80DE464: @ 80DE464 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, =0x02022e1a - ldrh r0, [r1] - subs r0, 0x7 - strh r0, [r1] - lsls r0, 16 - cmp r0, 0 - bge _080DE47C - movs r0, 0 - strh r0, [r1] -_080DE47C: - ldrh r2, [r1] - cmp r2, 0 - bne _080DE496 - ldr r0, =0x03005e00 - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 3 - adds r1, r0 - strh r2, [r1, 0x8] - strh r2, [r1, 0xA] - strh r2, [r1, 0xC] - ldr r0, =sub_80DE4A8 - str r0, [r1] -_080DE496: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DE464 - - thumb_func_start sub_80DE4A8 -sub_80DE4A8: @ 80DE4A8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r3, r4, 2 - adds r0, r3, r4 - lsls r0, 3 - adds r5, r0, r1 - movs r0, 0x8 - ldrsh r1, [r5, r0] - cmp r1, 0x1 - beq _080DE52C - cmp r1, 0x1 - bgt _080DE4D0 - cmp r1, 0 - beq _080DE4DA - b _080DE5B4 - .pool -_080DE4D0: - cmp r1, 0x2 - beq _080DE58A - cmp r1, 0x3 - beq _080DE5A4 - b _080DE5B4 -_080DE4DA: - movs r2, 0 - adds r6, r3, 0 - ldr r5, =0x02039f34 - ldr r3, =0x02039f26 -_080DE4E2: - ldr r0, [r5] - ldr r1, [r0] - adds r1, 0x14 - adds r1, r2 - adds r0, r2, r3 - ldrb r0, [r0] - strb r0, [r1] - adds r2, 0x1 - cmp r2, 0x3 - ble _080DE4E2 - bl sub_80DBF90 - bl sub_80DC864 - bl sub_80DB69C - bl sub_80DD04C - movs r0, 0x1 - bl sub_80DE008 - bl sub_80DC44C - ldr r0, =0x03005e00 - adds r1, r6, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x8] - b _080DE5B4 - .pool -_080DE52C: - ldr r0, =0x02039f2a - ldrb r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _080DE584 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0] - ldrb r0, [r2, 0x7] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0x7] - bl sub_80DA8A4 - lsls r0, 24 - cmp r0, 0 - beq _080DE552 - bl sub_80DBAA0 -_080DE552: - ldr r4, =sub_80FCC88 - adds r0, r4, 0 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =sub_80DA110 - adds r1, r4, 0 - bl SetTaskFuncWithFollowupFunc - bl sub_80DBF68 - movs r0, 0x2 - strh r0, [r5, 0x8] - b _080DE5B4 - .pool -_080DE584: - bl sub_80DBAA0 - b _080DE59A -_080DE58A: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0] - ldrb r1, [r0, 0x7] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _080DE5B4 -_080DE59A: - movs r0, 0x3 - strh r0, [r5, 0x8] - b _080DE5B4 - .pool -_080DE5A4: - bl sub_80DB884 - bl sub_80DB2BC - movs r0, 0 - strh r0, [r5, 0x8] - ldr r0, =sub_80DE5F4 - str r0, [r5] -_080DE5B4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DE4A8 - - thumb_func_start sub_80DE5C0 -sub_80DE5C0: @ 80DE5C0 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x02022e1a - ldrh r0, [r1] - adds r0, 0x7 - strh r0, [r1] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA0 - ble _080DE5E4 - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80DA4F4 - str r0, [r1] -_080DE5E4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DE5C0 - - thumb_func_start sub_80DE5F4 -sub_80DE5F4: @ 80DE5F4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrh r2, [r1, 0xC] - movs r3, 0xC - ldrsh r0, [r1, r3] - cmp r0, 0x9 - bgt _080DE618 - adds r0, r2, 0x1 - strh r0, [r1, 0xC] - b _080DE654 - .pool -_080DE618: - ldrh r3, [r1, 0xA] - movs r4, 0xA - ldrsh r0, [r1, r4] - cmp r0, 0 - bne _080DE636 - ldrh r2, [r1, 0x8] - movs r4, 0x8 - ldrsh r0, [r1, r4] - cmp r0, 0x10 - bne _080DE632 - adds r0, r3, 0x1 - strh r0, [r1, 0xA] - b _080DE654 -_080DE632: - adds r0, r2, 0x1 - b _080DE652 -_080DE636: - ldrh r0, [r1, 0x8] - movs r3, 0x8 - ldrsh r2, [r1, r3] - cmp r2, 0 - bne _080DE650 - strh r2, [r1, 0xA] - strh r2, [r1, 0xC] - ldr r0, =sub_80DE65C - str r0, [r1] - b _080DE654 - .pool -_080DE650: - subs r0, 0x1 -_080DE652: - strh r0, [r1, 0x8] -_080DE654: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80DE5F4 - - thumb_func_start sub_80DE65C -sub_80DE65C: @ 80DE65C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r1, [r4, 0xC] - movs r2, 0xC - ldrsh r0, [r4, r2] - cmp r0, 0x9 - bgt _080DE680 - adds r0, r1, 0x1 - strh r0, [r4, 0xC] - b _080DE690 - .pool -_080DE680: - movs r0, 0 - strh r0, [r4, 0xC] - movs r0, 0x61 - movs r1, 0 - bl audio_play_and_stuff - ldr r0, =sub_80DE5C0 - str r0, [r4] -_080DE690: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DE65C - - thumb_func_start sub_80DE69C -sub_80DE69C: @ 80DE69C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r7, 0 - ldr r6, =0x02020630 - ldr r5, =0x02039f34 -_080DE6AE: - bl rotscale_alloc_entry - ldr r1, [r5] - ldr r1, [r1, 0x14] - lsls r4, r7, 2 - adds r1, r4, r1 - ldrb r1, [r1] - lsls r3, r1, 4 - adds r3, r1 - lsls r3, 2 - adds r3, r6 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1F - ands r0, r1 - lsls r0, 1 - ldrb r1, [r3, 0x3] - movs r2, 0x3F - negs r2, r2 - mov r12, r2 - mov r2, r12 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x3] - ldr r0, [r5] - ldr r0, [r0, 0x14] - adds r0, r4, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r2, [r0, 0x1] - movs r3, 0x4 - negs r3, r3 - adds r1, r3, 0 - ands r2, r1 - movs r1, 0x1 - orrs r2, r1 - strb r2, [r0, 0x1] - ldr r0, [r5] - ldr r0, [r0, 0x14] - adds r0, r4, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r1, r8 - bl StartObjectRotScalAnim - mov r0, r8 - cmp r0, 0x2 - bne _080DE74C - ldr r0, [r5] - ldr r0, [r0, 0x14] - adds r0, r4, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl AnimateObject - ldr r0, [r5] - ldr r0, [r0, 0x14] - adds r0, r4, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - movs r3, 0x5 - negs r3, r3 - adds r2, r3, 0 - ands r1, r2 - strb r1, [r0] -_080DE74C: - adds r7, 0x1 - cmp r7, 0x3 - ble _080DE6AE - ldr r0, =sub_80DE794 - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - mov r0, r8 - strh r0, [r1, 0x8] - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0] - ldrb r0, [r2, 0x7] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2, 0x7] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DE69C - - thumb_func_start sub_80DE794 -sub_80DE794: @ 80DE794 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, =0x02020630 - ldr r3, =0x02039f34 - ldr r0, [r3] - ldr r0, [r0, 0x14] - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _080DE822 - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldrb r0, [r1, 0x8] - cmp r0, 0x1 - bne _080DE7EC - movs r4, 0 - adds r5, r2, 0 - movs r2, 0x4 -_080DE7CC: - ldr r0, [r3] - ldr r1, [r0, 0x14] - lsls r0, r4, 2 - adds r0, r1 - 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 r4, 0x1 - cmp r4, 0x3 - ble _080DE7CC -_080DE7EC: - movs r4, 0 -_080DE7EE: - ldr r5, =0x02039f34 - ldr r0, [r5] - ldr r1, [r0, 0x14] - lsls r0, r4, 2 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl obj_free_rotscale_entry - adds r4, 0x1 - cmp r4, 0x3 - ble _080DE7EE - ldr r0, [r5] - ldr r2, [r0] - ldrb r1, [r2, 0x7] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x7] - adds r0, r6, 0 - bl DestroyTask -_080DE822: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DE794 - - thumb_func_start sub_80DE834 -sub_80DE834: @ 80DE834 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - movs r0, 0xB1 - lsls r0, 1 - cmp r1, r0 - bls _080DE844 - movs r1, 0x1 -_080DE844: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end sub_80DE834 - - thumb_func_start sub_80DE84C -sub_80DE84C: @ 80DE84C - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x0000019b - cmp r1, r0 - bls _080DE85A - movs r1, 0 -_080DE85A: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80DE84C - - thumb_func_start sub_80DE864 -sub_80DE864: @ 80DE864 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r1, [r0, 0x4] - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x6] - bl sub_80DE834 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r1, =0x02039e00 - lsls r0, r7, 6 - adds r0, r1 - ldrh r0, [r0] - bl sub_80DE84C - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, [r4] - ldr r0, [r0, 0x18] - movs r1, 0 - movs r2, 0x14 - bl memset - bl sub_80A3934 - ldr r1, =0x020244e4 - movs r2, 0 - adds r0, r1, 0x3 -_080DE8A8: - strb r2, [r0] - subs r0, 0x1 - cmp r0, r1 - bge _080DE8A8 - cmp r5, 0x90 - beq _080DE920 - cmp r5, 0x90 - bgt _080DE8DE - cmp r5, 0x4C - beq _080DE978 - cmp r5, 0x4C - bgt _080DE8D4 - cmp r5, 0xD - beq _080DE978 - b _080DE9A2 - .pool -_080DE8D4: - cmp r5, 0x82 - beq _080DE978 - cmp r5, 0x8F - beq _080DE978 - b _080DE9A2 -_080DE8DE: - cmp r5, 0xD8 - beq _080DE960 - cmp r5, 0xD8 - bgt _080DE8EC - cmp r5, 0xAE - beq _080DE8FA - b _080DE9A2 -_080DE8EC: - cmp r5, 0xDA - beq _080DE96C - movs r0, 0x88 - lsls r0, 1 - cmp r5, r0 - beq _080DE920 - b _080DE9A2 -_080DE8FA: - ldr r0, =gBaseStats - lsls r1, r6, 3 - subs r1, r6 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x6] - cmp r0, 0x7 - beq _080DE910 - ldrb r0, [r1, 0x7] - cmp r0, 0x7 - bne _080DE99C -_080DE910: - ldr r1, =0x02038432 - movs r0, 0 - b _080DE9A0 - .pool -_080DE920: - ldr r6, =0x02039f34 - ldr r0, [r6] - ldr r1, [r0, 0x4] - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r1 - ldrb r4, [r0, 0x1B] - ldr r5, =0x02039e00 - lsls r4, 6 - adds r0, r4, r5 - ldrh r0, [r0] - bl sub_80DE84C - ldr r2, [r6] - ldr r1, [r2, 0x18] - strh r0, [r1, 0x2] - ldr r2, [r2, 0x18] - adds r5, 0x38 - adds r4, r5 - ldr r0, [r4] - str r0, [r2, 0x10] - ldrb r0, [r2, 0x4] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x4] - b _080DE9A2 - .pool -_080DE960: - ldr r1, =0x0203841a - movs r0, 0xFF - b _080DE9A0 - .pool -_080DE96C: - ldr r1, =0x0203841a - movs r0, 0 - b _080DE9A0 - .pool -_080DE978: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0] - adds r2, r0, 0 - adds r2, 0x5A - ldrb r1, [r2] - cmp r1, 0 - bne _080DE99C - movs r0, 0x2 - strb r0, [r2] - ldr r0, =0x02038432 - strb r1, [r0] - b _080DE9A2 - .pool -_080DE99C: - ldr r1, =0x02038432 - movs r0, 0x1 -_080DE9A0: - strb r0, [r1] -_080DE9A2: - bl sub_80DEA5C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DE864 - - thumb_func_start sub_80DE9B0 -sub_80DE9B0: @ 80DE9B0 - push {r4,lr} - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r0, [r0, 0x18] - movs r1, 0 - movs r2, 0x14 - bl memset - ldr r0, [r4] - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x5A - ldrb r0, [r1] - cmp r0, 0 - beq _080DE9D2 - subs r0, 0x1 - strb r0, [r1] -_080DE9D2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DE9B0 - - thumb_func_start sub_80DE9DC -sub_80DE9DC: @ 80DE9DC - push {r4-r6,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r6, =0x02039f34 - ldr r0, [r6] - ldr r0, [r0, 0x18] - strb r4, [r0, 0x5] - ldr r5, =0x02039e00 - lsls r4, 6 - adds r0, r4, r5 - ldrh r0, [r0] - bl sub_80DE84C - ldr r2, [r6] - ldr r1, [r2, 0x18] - strh r0, [r1] - ldr r1, [r2, 0x18] - adds r0, r5, 0 - adds r0, 0x38 - adds r0, r4, r0 - ldr r0, [r0] - str r0, [r1, 0x8] - adds r5, 0x3C - adds r4, r5 - ldr r0, [r4] - str r0, [r1, 0xC] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DE9DC - - thumb_func_start sub_80DEA20 -sub_80DEA20: @ 80DEA20 - push {lr} - ldr r0, =DummyObjectCallback - bl object_new_hidden_with_callback - ldr r1, =0x020241e4 - strb r0, [r1, 0x3] - ldr r0, =0x0202420c - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl obj_alloc_rotscale_entry - bl sub_80DEA5C - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DEA20 - - thumb_func_start sub_80DEA5C -sub_80DEA5C: @ 80DEA5C - push {r4,lr} - ldr r0, =0x020241e4 - ldrb r0, [r0, 0x3] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - movs r0, 0 - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - movs r0, 0x3 - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x20] - movs r0, 0x3 - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - adds r4, 0x3E - ldrb r0, [r4] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DEA5C - - thumb_func_start sub_80DEAA8 -sub_80DEAA8: @ 80DEAA8 - push {lr} - lsls r0, 16 - lsrs r0, 16 - ldr r2, =gBattleMoves - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x6] - cmp r0, 0x20 - bhi _080DEB60 - lsls r0, 2 - ldr r1, =_080DEAD0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080DEAD0: - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB54 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB54 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 - .4byte _080DEB60 -_080DEB54: - ldr r1, =0x0202420c - movs r0, 0x2 - b _080DEB64 - .pool -_080DEB60: - ldr r1, =0x0202420c - movs r0, 0x3 -_080DEB64: - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DEAA8 - - thumb_func_start sub_80DEB70 -sub_80DEB70: @ 80DEB70 - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - str r1, [sp] - mov r0, sp - movs r2, 0 - strb r4, [r0, 0x4] - movs r1, 0x1 - strb r1, [r0, 0x5] - strb r2, [r0, 0x6] - strb r1, [r0, 0x7] - strb r2, [r0, 0x8] - strb r1, [r0, 0x9] - strb r2, [r0, 0xA] - strb r2, [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 r0, 0xF0 - strb r0, [r2, 0xC] - ldrb r0, [r2, 0xD] - ands r1, r0 - strb r1, [r2, 0xD] - mov r1, sp - movs r0, 0x80 - strb r0, [r1, 0xD] - mov r0, sp - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl PutWindowTilemap - movs r0, 0 - bl sub_80DED60 - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80DEB70 - - thumb_func_start sub_80DEBD0 -sub_80DEBD0: @ 80DEBD0 - push {r4,r5,lr} - sub sp, 0x10 - adds r5, r0, 0 - ldr r4, [sp, 0x1C] - str r1, [sp] - mov r0, sp - movs r1, 0 - strb r5, [r0, 0x4] - strb r4, [r0, 0x5] - strb r2, [r0, 0x6] - strb r3, [r0, 0x7] - strb r2, [r0, 0x8] - strb r3, [r0, 0x9] - strb r1, [r0, 0xA] - strb r1, [r0, 0xB] - mov r3, sp - ldrb r2, [r3, 0xC] - subs r1, 0x10 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0xC] - mov r2, sp - movs r0, 0xF0 - strb r0, [r2, 0xC] - ldrb r0, [r2, 0xD] - ands r1, r0 - strb r1, [r2, 0xD] - mov r1, sp - movs r0, 0x80 - strb r0, [r1, 0xD] - mov r0, sp - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - lsls r5, 24 - lsrs r5, 24 - adds r0, r5, 0 - bl PutWindowTilemap - movs r0, 0 - bl sub_80DED60 - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80DEBD0 - - thumb_func_start sub_80DEC30 -sub_80DEC30: @ 80DEC30 - push {r4,r5,lr} - sub sp, 0x10 - str r0, [sp] - mov r2, sp - movs r3, 0 - movs r0, 0x4 - strb r0, [r2, 0x4] - mov r0, sp - movs r5, 0x1 - strb r5, [r0, 0x5] - strb r3, [r0, 0x6] - strb r5, [r0, 0x7] - strb r3, [r0, 0x8] - strb r5, [r0, 0x9] - strb r3, [r0, 0xA] - strb r3, [r0, 0xB] - mov r4, sp - ldrb r3, [r4, 0xC] - movs r2, 0x10 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r4, 0xC] - mov r3, sp - movs r0, 0x10 - strb r0, [r3, 0xC] - ldrb r0, [r3, 0xD] - ands r2, r0 - strb r2, [r3, 0xD] - mov r2, sp - movs r0, 0x80 - strb r0, [r2, 0xD] - cmp r1, 0 - bne _080DEC80 - mov r0, sp - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - b _080DECA4 -_080DEC80: - ldr r0, =0x02039f2a - ldrb r1, [r0] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _080DEC94 - movs r1, 0x4 - b _080DEC9C - .pool -_080DEC94: - bl sav2_get_text_speed - lsls r0, 24 - lsrs r1, r0, 24 -_080DEC9C: - mov r0, sp - movs r2, 0 - bl AddTextPrinter -_080DECA4: - movs r0, 0x4 - bl PutWindowTilemap - movs r0, 0 - bl sub_80DED60 - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80DEC30 - - thumb_func_start sub_80DECB8 -sub_80DECB8: @ 80DECB8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - mov r8, r0 - ldr r0, [sp, 0x28] - ldr r4, [sp, 0x2C] - ldr r5, [sp, 0x30] - ldr r6, [sp, 0x34] - mov r7, r8 - lsls r7, 24 - lsrs r7, 24 - mov r8, r7 - lsls r1, 16 - lsrs r1, 16 - 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 - str r0, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - lsls r6, 16 - asrs r6, 16 - str r6, [sp, 0xC] - mov r0, r8 - bl WriteSequenceToBgTilemapBuffer - mov r0, r8 - bl sub_80DED60 - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80DECB8 - - thumb_func_start sub_80DED10 -sub_80DED10: @ 80DED10 - 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, 16 - lsrs r1, 16 - 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_80DECB8 - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80DED10 - - thumb_func_start sub_80DED4C -sub_80DED4C: @ 80DED4C - push {lr} - bl RunTextPrinters - movs r0, 0x4 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_80DED4C - - thumb_func_start sub_80DED60 -sub_80DED60: @ 80DED60 - ldr r2, =0x02039f38 - movs r1, 0x1 - lsls r1, r0 - ldrb r0, [r2] - orrs r1, r0 - strb r1, [r2] - bx lr - .pool - thumb_func_end sub_80DED60 - - thumb_func_start sub_80DED74 -sub_80DED74: @ 80DED74 - push {r4-r6,lr} - movs r0, 0 - ldr r6, =0x03005d90 - ldr r5, =0x00000624 - movs r4, 0 -_080DED7E: - adds r3, r0, 0x1 - lsls r1, r0, 3 - movs r2, 0x3 -_080DED84: - ldr r0, [r6] - adds r0, r5 - adds r0, r1 - strh r4, [r0] - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _080DED84 - adds r0, r3, 0 - cmp r0, 0x4 - ble _080DED7E - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DED74 - - thumb_func_start sub_80DEDA8 -sub_80DEDA8: @ 80DEDA8 - 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] - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0 - ldr r1, =0x02039f20 - ldrb r0, [r1] - cmp r0, 0 - beq _080DEDE6 -_080DEDD8: - adds r5, 0x1 - cmp r5, 0x2 - bgt _080DEDE6 - adds r0, r5, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080DEDD8 -_080DEDE6: - ldr r0, [sp] - cmp r0, 0xFF - bne _080DEE00 - ldr r0, =0x02039f25 - ldrb r0, [r0] - cmp r5, r0 - beq _080DEE00 - movs r0, 0 - b _080DEF90 - .pool -_080DEE00: - ldr r0, =0x02039f2c - ldrh r0, [r0] - cmp r0, 0x4 - bhi _080DEE4C - lsls r0, 2 - ldr r1, =_080DEE1C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080DEE1C: - .4byte _080DEE4C - .4byte _080DEE30 - .4byte _080DEE36 - .4byte _080DEE3C - .4byte _080DEE42 -_080DEE30: - mov r0, r8 - adds r0, 0x3 - b _080DEE46 -_080DEE36: - mov r0, r8 - adds r0, 0x6 - b _080DEE46 -_080DEE3C: - mov r0, r8 - adds r0, 0x9 - b _080DEE46 -_080DEE42: - mov r0, r8 - adds r0, 0xC -_080DEE46: - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 -_080DEE4C: - ldr r1, [sp] - cmp r1, 0xFE - bne _080DEE54 - b _080DEF50 -_080DEE54: - adds r0, r1, 0 - movs r1, 0x1 - bl sub_80DEFA8 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r2, =0x03005d8c - mov r10, r2 - ldr r0, [r2] - mov r3, r9 - lsls r7, r3, 5 - ldr r6, =0x00002e90 - adds r2, r0, r6 - adds r2, r7 - ldr r4, =0x02039e00 - lsls r5, 6 - adds r1, r4, 0 - adds r1, 0x38 - adds r1, r5, r1 - ldr r1, [r1] - str r1, [r2] - adds r1, r0, r7 - adds r2, r5, r4 - ldrh r2, [r2] - ldr r3, =0x00002e98 - adds r1, r3 - strh r2, [r1] - ldr r1, =0x00002e94 - adds r2, r0, r1 - adds r2, r7 - adds r1, r4, 0 - adds r1, 0x3C - adds r1, r5, r1 - ldr r1, [r1] - str r1, [r2] - adds r6, r7, r6 - adds r0, r6 - adds r0, 0xB - adds r1, r4, 0x2 - adds r1, r5, r1 - bl CopyString - mov r2, r10 - ldr r0, [r2] - adds r0, r6 - adds r0, 0x16 - adds r4, 0xD - adds r5, r4 - adds r1, r5, 0 - bl CopyString - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080DEEF4 - mov r3, r10 - ldr r0, [r3] - adds r0, r7 - ldr r1, =0x00002eae - adds r0, r1 - movs r1, 0x4 - b _080DEF02 - .pool -_080DEEF4: - mov r2, r10 - ldr r0, [r2] - adds r0, r7 - ldr r1, =0x02039f2e - ldrh r1, [r1] - ldr r3, =0x00002eae - adds r0, r3 -_080DEF02: - strb r1, [r0] - ldr r0, [sp] - cmp r0, 0xFF - beq _080DEF34 - ldr r0, =0x03005d8c - ldr r0, [r0] - mov r2, r9 - lsls r1, r2, 5 - adds r0, r1 - ldr r1, =0x02039f2c - ldrh r1, [r1] - ldr r3, =0x00002e9a - adds r0, r3 - strb r1, [r0] - b _080DEF8E - .pool -_080DEF34: - ldr r0, =0x03005d8c - ldr r0, [r0] - mov r2, r9 - lsls r1, r2, 5 - adds r0, r1 - ldr r3, =0x00002e9a - adds r0, r3 - mov r1, r8 - strb r1, [r0] - b _080DEF8E - .pool -_080DEF50: - ldr r6, =0x02039f3c - ldr r4, =0x02039e00 - lsls r5, 6 - adds r0, r4, 0 - adds r0, 0x38 - adds r0, r5, r0 - ldr r0, [r0] - str r0, [r6] - adds r0, r4, 0 - adds r0, 0x3C - adds r0, r5, r0 - ldr r0, [r0] - str r0, [r6, 0x4] - adds r0, r5, r4 - ldrh r0, [r0] - strh r0, [r6, 0x8] - adds r0, r6, 0 - adds r0, 0xB - adds r1, r4, 0x2 - adds r1, r5, r1 - bl CopyString - adds r0, r6, 0 - adds r0, 0x16 - adds r4, 0xD - adds r5, r4 - adds r1, r5, 0 - bl CopyString - mov r2, r8 - strb r2, [r6, 0xA] -_080DEF8E: - movs r0, 0x1 -_080DEF90: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80DEDA8 - - thumb_func_start sub_80DEFA8 -sub_80DEFA8: @ 80DEFA8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r0, 0x3 - bgt _080DEFF8 - cmp r0, 0 - blt _080DEFF8 - cmp r1, 0 - beq _080DEFE6 - movs r2, 0x5 - ldr r0, =0x03005d8c - mov r12, r0 - ldr r4, =0x00002e90 - ldr r3, =0x00002e70 -_080DEFC8: - mov r1, r12 - ldr r0, [r1] - lsls r1, r2, 5 - adds r1, r0 - adds r0, r1, r4 - adds r1, r3 - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldm r1!, {r5,r6} - stm r0!, {r5,r6} - subs r2, 0x1 - cmp r2, 0 - bgt _080DEFC8 -_080DEFE6: - movs r0, 0 - b _080DF03A - .pool -_080DEFF8: - ldr r0, =0x02039f2c - ldrh r0, [r0] - cmp r0, 0x4 - bhi _080DF038 - lsls r0, 2 - ldr r1, =_080DF014 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080DF014: - .4byte _080DF028 - .4byte _080DF02C - .4byte _080DF030 - .4byte _080DF034 - .4byte _080DF038 -_080DF028: - movs r0, 0x8 - b _080DF03A -_080DF02C: - movs r0, 0x9 - b _080DF03A -_080DF030: - movs r0, 0xA - b _080DF03A -_080DF034: - movs r0, 0xB - b _080DF03A -_080DF038: - movs r0, 0xC -_080DF03A: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80DEFA8 - - thumb_func_start sub_80DF040 -sub_80DF040: @ 80DF040 - push {r4-r7,lr} - movs r2, 0 - ldr r0, =0x03005d8c - mov r12, r0 - ldr r4, =0x00002e90 - ldr r3, =gUnknown_08587FA4 -_080DF04C: - mov r1, r12 - ldr r0, [r1] - lsls r1, r2, 5 - adds r0, r1 - adds r0, r4 - adds r1, r3, 0 - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldm r1!, {r5-r7} - stm r0!, {r5-r7} - ldm r1!, {r5,r6} - stm r0!, {r5,r6} - adds r3, 0x20 - adds r2, 0x1 - cmp r2, 0x7 - ble _080DF04C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80DF040 - - thumb_func_start sub_80DF080 -sub_80DF080: @ 80DF080 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r2, =0x02039f34 - ldr r3, [r2] - ldr r5, [r3, 0x10] - ldrb r1, [r5, 0x1] - movs r7, 0x1 - adds r0, r7, 0 - ands r0, r1 - adds r6, r2, 0 - cmp r0, 0 - bne _080DF0D2 - movs r0, 0 - ldrsb r0, [r5, r0] - cmp r0, 0 - ble _080DF0D2 - ldr r1, [r3, 0x4] - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x15] - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - bne _080DF0D2 - ldr r1, [r3, 0x1C] - lsls r2, r4, 4 - adds r1, r2, r1 - ldrb r3, [r1, 0xC] - movs r0, 0x1 - orrs r0, r3 - strb r0, [r1, 0xC] - ldr r0, [r6] - ldr r0, [r0, 0x1C] - adds r2, r0 - ldrb r0, [r2, 0xE] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2, 0xE] -_080DF0D2: - ldr r3, [r6] - ldr r1, [r3, 0x4] - lsls r2, r4, 3 - subs r0, r2, r4 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0xC] - movs r5, 0x1 - adds r0, r5, 0 - ands r0, r1 - adds r7, r2, 0 - cmp r0, 0 - beq _080DF0FA - ldr r0, [r3, 0x1C] - lsls r1, r4, 4 - adds r1, r0 - ldrb r2, [r1, 0xC] - movs r0, 0x2 - orrs r0, r2 - strb r0, [r1, 0xC] -_080DF0FA: - ldr r3, [r6] - ldr r2, [r3, 0x10] - ldrb r1, [r2, 0x1] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _080DF126 - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r0, 0 - beq _080DF126 - movs r0, 0x2 - ldrsb r0, [r2, r0] - cmp r0, 0x3C - bne _080DF126 - ldr r0, [r3, 0x1C] - lsls r1, r4, 4 - adds r1, r0 - ldrb r2, [r1, 0xC] - movs r0, 0x4 - orrs r0, r2 - strb r0, [r1, 0xC] -_080DF126: - ldr r3, [r6] - ldr r1, [r3, 0x4] - subs r0, r7, r4 - lsls r0, 2 - adds r2, r0, r1 - ldrb r1, [r2, 0x15] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080DF14E - ldrb r0, [r2, 0x16] - cmp r0, 0 - beq _080DF14E - ldr r0, [r3, 0x1C] - lsls r1, r4, 4 - adds r1, r0 - ldrb r2, [r1, 0xC] - movs r0, 0x8 - orrs r0, r2 - strb r0, [r1, 0xC] -_080DF14E: - movs r3, 0 - movs r5, 0 -_080DF152: - cmp r3, r4 - beq _080DF180 - ldr r1, [r6] - ldr r0, [r1, 0x4] - adds r0, r5, r0 - ldrb r0, [r0, 0xE] - cmp r0, 0 - beq _080DF180 - ldr r0, [r1, 0x1C] - lsls r2, r4, 4 - adds r2, r0 - ldrb r0, [r2, 0xC] - movs r1, 0x10 - orrs r0, r1 - strb r0, [r2, 0xC] - ldr r0, [r6] - ldr r0, [r0, 0x1C] - lsls r2, r3, 4 - adds r2, r0 - ldrb r0, [r2, 0xC] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2, 0xC] -_080DF180: - adds r5, 0x1C - adds r3, 0x1 - cmp r3, 0x3 - ble _080DF152 - ldr r2, [r6] - ldr r1, [r2, 0x4] - subs r0, r7, r4 - lsls r5, r0, 2 - adds r1, r5, r1 - ldrb r3, [r1, 0xC] - movs r0, 0x6 - ands r0, r3 - cmp r0, 0 - bne _080DF1A6 - ldrb r1, [r1, 0xB] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080DF1BC -_080DF1A6: - ldr r0, [r2, 0x1C] - lsls r1, r4, 4 - adds r1, r0 - ldrb r2, [r1, 0xC] - movs r0, 0x20 - orrs r0, r2 - strb r0, [r1, 0xC] - b _080DF1F6 - .pool -_080DF1BC: - movs r0, 0x1 - ands r0, r3 - cmp r0, 0 - bne _080DF1F6 - ldr r2, [r2, 0x1C] - lsls r3, r4, 4 - adds r2, r3, r2 - ldrb r0, [r2, 0xC] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0xC] - ldr r0, [r6] - ldr r1, [r0, 0x1C] - adds r1, r3, r1 - ldrb r0, [r1, 0xE] - movs r2, 0x1 - orrs r0, r2 - strb r0, [r1, 0xE] - ldr r1, [r6] - ldr r0, [r1, 0x1C] - adds r3, r0 - ldr r0, [r1] - ldrb r0, [r0, 0x1] - lsls r0, 1 - adds r3, r0 - ldr r0, [r1, 0x4] - adds r0, r5, r0 - ldrh r0, [r0, 0x6] - strh r0, [r3] -_080DF1F6: - ldr r2, [r6] - ldr r1, [r2, 0x4] - subs r0, r7, r4 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x15] - movs r5, 0x1 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _080DF21A - ldr r0, [r2, 0x1C] - lsls r1, r4, 4 - adds r1, r0 - ldrb r2, [r1, 0xD] - movs r0, 0x2 - orrs r0, r2 - strb r0, [r1, 0xD] -_080DF21A: - ldr r2, [r6] - ldr r0, [r2] - ldrb r0, [r0, 0x13] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x4 - bne _080DF24A - ldr r3, [r2, 0x10] - ldrb r1, [r3, 0x1] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _080DF24A - movs r0, 0 - ldrsb r0, [r3, r0] - cmp r0, 0 - bge _080DF24A - ldr r0, [r2, 0x1C] - lsls r1, r4, 4 - adds r1, r0 - ldrb r2, [r1, 0xD] - movs r0, 0x20 - orrs r0, r2 - strb r0, [r1, 0xD] -_080DF24A: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80DF080 - - thumb_func_start sub_80DF250 -sub_80DF250: @ 80DF250 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x38 - movs r1, 0 - movs r0, 0 - str r0, [sp, 0x20] - movs r4, 0 - ldr r6, =0x02039f34 - mov r2, sp - adds r2, 0xC - str r2, [sp, 0x28] - mov r3, sp - adds r3, 0x14 - str r3, [sp, 0x2C] - mov r7, sp - adds r7, 0x2 - str r7, [sp, 0x24] - ldr r5, =0x02039f20 - movs r2, 0 - movs r3, 0x80 - lsls r3, 17 -_080DF280: - adds r0, r4, r5 - ldrb r0, [r0] - cmp r0, 0 - bne _080DF298 - lsrs r0, r2, 24 - str r0, [sp, 0x20] - b _080DF29E - .pool -_080DF298: - cmp r0, 0x3 - bne _080DF29E - lsrs r1, r2, 24 -_080DF29E: - adds r2, r3 - adds r4, 0x1 - cmp r4, 0x3 - ble _080DF280 - ldr r0, [r6] - ldr r0, [r0, 0x1C] - lsls r1, 4 - adds r1, r0 - ldrb r2, [r1, 0xD] - movs r0, 0x1 - orrs r0, r2 - strb r0, [r1, 0xD] - movs r4, 0 - ldr r1, [sp, 0x20] - lsls r1, 4 - str r1, [sp, 0x30] - mov r9, r4 - mov r10, r4 -_080DF2C2: - ldr r2, [sp, 0x20] - cmp r4, r2 - beq _080DF2EE - ldr r1, =0x02039f08 - lsls r0, r2, 1 - adds r0, r1 - movs r3, 0 - ldrsh r2, [r0, r3] - add r1, r10 - movs r6, 0 - ldrsh r0, [r1, r6] - subs r2, r0 - cmp r2, 0x32 - bgt _080DF2EE - ldr r7, =0x02039f34 - ldr r0, [r7] - ldr r2, [r0, 0x1C] - add r2, r9 - ldrb r0, [r2, 0xD] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0xD] -_080DF2EE: - ldr r1, =0x02039f34 - ldr r0, [r1] - ldr r0, [r0, 0x1C] - mov r3, r9 - adds r2, r3, r0 - ldrb r1, [r2, 0xE] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _080DF30A - ldrb r0, [r2, 0xD] - movs r1, 0x8 - orrs r0, r1 - strb r0, [r2, 0xD] -_080DF30A: - movs r5, 0 - ldr r2, =0x02039f00 - add r2, r10 - movs r6, 0 - ldrsh r1, [r2, r6] - ldr r7, =0x02039f00 - movs r3, 0 - ldrsh r0, [r7, r3] - cmp r1, r0 - blt _080DF336 - adds r3, r2, 0 - adds r2, r7, 0 -_080DF322: - adds r2, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - bgt _080DF336 - movs r6, 0 - ldrsh r1, [r3, r6] - movs r7, 0 - ldrsh r0, [r2, r7] - cmp r1, r0 - bge _080DF322 -_080DF336: - cmp r5, 0x4 - bne _080DF354 - ldr r1, =0x02039f20 - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080DF354 - ldr r2, =0x02039f34 - ldr r0, [r2] - ldr r2, [r0, 0x1C] - add r2, r9 - ldrb r0, [r2, 0xD] - movs r1, 0x10 - orrs r0, r1 - strb r0, [r2, 0xD] -_080DF354: - movs r3, 0 - mov r12, r3 - mov r8, r3 - movs r5, 0 - ldr r0, =0x02039f00 - add r0, r10 - movs r7, 0 - ldrsh r6, [r0, r7] - str r6, [sp, 0x34] - ldr r2, =0x02039f00 - ldr r0, =0x02039f18 - mov r1, r10 - adds r6, r1, r0 - adds r3, r0, 0 -_080DF370: - movs r7, 0 - ldrsh r0, [r2, r7] - ldr r1, [sp, 0x34] - cmp r1, r0 - ble _080DF37E - movs r7, 0x1 - mov r12, r7 -_080DF37E: - movs r0, 0 - ldrsh r1, [r6, r0] - movs r7, 0 - ldrsh r0, [r3, r7] - cmp r1, r0 - ble _080DF38E - movs r0, 0x1 - mov r8, r0 -_080DF38E: - adds r2, 0x2 - adds r3, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _080DF370 - mov r1, r12 - cmp r1, 0 - bne _080DF3B4 - mov r2, r8 - cmp r2, 0 - bne _080DF3B4 - ldr r3, =0x02039f34 - ldr r0, [r3] - ldr r2, [r0, 0x1C] - add r2, r9 - ldrb r0, [r2, 0xD] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2, 0xD] -_080DF3B4: - ldr r6, =0x02039f34 - ldr r0, [r6] - ldr r0, [r0, 0x1C] - mov r7, r9 - adds r2, r7, r0 - ldrb r1, [r2, 0xE] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080DF3D0 - ldrb r0, [r2, 0xD] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0xD] -_080DF3D0: - movs r0, 0x10 - add r9, r0 - movs r1, 0x2 - add r10, r1 - adds r4, 0x1 - cmp r4, 0x3 - bgt _080DF3E0 - b _080DF2C2 -_080DF3E0: - movs r4, 0 - movs r5, 0 - movs r3, 0 - ldr r2, [sp, 0x28] - mov r1, sp -_080DF3EA: - strh r3, [r1] - adds r0, r2, r4 - strb r5, [r0] - adds r1, 0x2 - adds r4, 0x1 - cmp r4, 0x4 - ble _080DF3EA - mov r1, sp - ldr r0, =0x0000ffff - strh r0, [r1, 0xA] - movs r0, 0 - ldr r2, [sp, 0x28] - strb r0, [r2, 0x5] - movs r4, 0 - ldr r0, =0x02039f34 - ldr r0, [r0] - mov r8, r0 - ldr r7, [sp, 0x30] -_080DF40E: - mov r3, r8 - ldr r0, [r3, 0x1C] - adds r0, r7, r0 - lsls r1, r4, 1 - adds r0, r1 - ldrh r0, [r0] - adds r4, 0x1 - mov r12, r4 - cmp r0, 0 - beq _080DF450 - ldr r0, =0x02039f34 - ldr r6, [r0] - ldr r3, [sp, 0x28] - mov r4, sp - movs r5, 0x4 -_080DF42C: - ldr r0, [r6, 0x1C] - adds r0, r7, r0 - adds r0, r1 - ldrh r0, [r0] - ldrh r2, [r4] - cmp r0, r2 - beq _080DF440 - cmp r2, 0 - bne _080DF446 - strh r0, [r4] -_080DF440: - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] -_080DF446: - adds r3, 0x1 - adds r4, 0x2 - subs r5, 0x1 - cmp r5, 0 - bge _080DF42C -_080DF450: - mov r4, r12 - cmp r4, 0x4 - ble _080DF40E - mov r0, sp - ldrh r0, [r0] - ldr r6, [sp, 0x2C] - strh r0, [r6] - ldr r7, [sp, 0x28] - ldrb r3, [r7] - movs r6, 0 - movs r4, 0x1 - ldr r1, [sp, 0x24] - ldrh r0, [r1] - ldr r1, =0x0000ffff - cmp r0, r1 - beq _080DF4C0 - ldr r5, [sp, 0x2C] - adds r7, r1, 0 - mov r2, sp - adds r2, 0x2 -_080DF478: - ldr r0, [sp, 0x28] - adds r1, r0, r4 - ldrb r0, [r1] - cmp r3, r0 - bcs _080DF4A4 - ldrh r0, [r2] - strh r0, [r5] - ldrb r3, [r1] - movs r6, 0x1 - b _080DF4B6 - .pool -_080DF4A4: - cmp r3, r0 - bne _080DF4B6 - lsls r0, r6, 1 - adds r0, r5, r0 - ldrh r1, [r2] - strh r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_080DF4B6: - adds r2, 0x2 - adds r4, 0x1 - ldrh r0, [r2] - cmp r0, r7 - bne _080DF478 -_080DF4C0: - bl GenerateRandomNumber - ldr r1, =0x02039f34 - ldr r1, [r1] - ldr r4, [r1, 0x1C] - ldr r1, [sp, 0x30] - adds r4, r1, r4 - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - lsls r0, 1 - ldr r2, [sp, 0x2C] - adds r0, r2, r0 - ldrh r0, [r0] - strh r0, [r4, 0xA] - 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 sub_80DF250 - - thumb_func_start sub_80DF4F8 -sub_80DF4F8: @ 80DF4F8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - ldr r1, =0x02039f20 - ldr r0, =0x02039f25 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080DF514 - b _080DF6EE -_080DF514: - movs r7, 0 - movs r3, 0 - ldr r0, =0x02039f34 - mov r12, r0 -_080DF51C: - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080DF528 - lsls r0, r3, 24 - lsrs r7, r0, 24 -_080DF528: - adds r3, 0x1 - cmp r3, 0x3 - ble _080DF51C - movs r1, 0 - mov r9, r1 - mov r10, r1 - movs r3, 0 - lsls r2, r7, 1 - lsls r4, r7, 4 - mov r8, r4 - ldr r1, =0x02039f00 - adds r0, r2, r1 - movs r6, 0 - ldrsh r5, [r0, r6] - str r5, [sp, 0x8] - adds r5, r1, 0 - ldr r0, =0x02039f18 - adds r2, r0 - adds r4, r0, 0 -_080DF54E: - movs r1, 0 - ldrsh r0, [r5, r1] - ldr r6, [sp, 0x8] - cmp r6, r0 - bge _080DF562 - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_080DF562: - movs r0, 0 - ldrsh r1, [r2, r0] - movs r6, 0 - ldrsh r0, [r4, r6] - cmp r1, r0 - bge _080DF578 - mov r0, r10 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 -_080DF578: - adds r5, 0x2 - adds r4, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - ble _080DF54E - mov r1, r12 - ldr r0, [r1] - ldr r0, [r0, 0x1C] - add r0, r8 - ldrb r1, [r0, 0xC] - movs r4, 0 - movs r2, 0x1 - movs r3, 0x7 -_080DF592: - adds r0, r1, 0 - ands r0, r2 - cmp r0, 0 - beq _080DF5A0 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_080DF5A0: - lsrs r1, 1 - subs r3, 0x1 - cmp r3, 0 - bge _080DF592 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __modsi3 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x1C] - add r0, r8 - ldrb r1, [r0, 0xC] - movs r4, 0 - movs r2, 0 - movs r3, 0 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080DF5DC - cmp r5, 0 - beq _080DF5F6 -_080DF5D6: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_080DF5DC: - lsrs r1, 1 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - adds r3, 0x1 - cmp r3, 0x7 - bgt _080DF5F6 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080DF5DC - cmp r5, r4 - bne _080DF5D6 -_080DF5F6: - movs r1, 0x1 - adds r0, r1, 0 - lsls r0, r2 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r7, 0 - bne _080DF628 - mov r0, sp - strb r1, [r0] - ldr r1, =0x02039f34 - ldr r0, [r1] - ldr r0, [r0, 0x1C] - ldrb r4, [r0, 0x1D] - movs r3, 0x2 - b _080DF638 - .pool -_080DF628: - mov r1, sp - movs r0, 0 - strb r0, [r1] - ldr r1, =0x02039f34 - ldr r0, [r1] - ldr r0, [r0, 0x1C] - ldrb r4, [r0, 0xD] - movs r3, 0x1 -_080DF638: - mov r12, r1 - movs r5, 0x1 - lsls r2, 24 - str r2, [sp, 0x4] - cmp r3, 0x3 - bgt _080DF682 -_080DF644: - cmp r3, r7 - beq _080DF67C - mov r6, r12 - ldr r2, [r6] - ldr r0, [r2, 0x1C] - lsls r1, r3, 4 - adds r0, r1, r0 - ldrb r0, [r0, 0xD] - cmp r4, r0 - bcs _080DF66C - mov r0, sp - strb r3, [r0] - ldr r0, [r2, 0x1C] - adds r0, r1, r0 - ldrb r4, [r0, 0xD] - movs r5, 0x1 - b _080DF67C - .pool -_080DF66C: - cmp r4, r0 - bne _080DF67C - mov r1, sp - adds r0, r1, r5 - strb r3, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080DF67C: - adds r3, 0x1 - cmp r3, 0x3 - ble _080DF644 -_080DF682: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __modsi3 - add r0, sp - ldrb r6, [r0] - movs r2, 0x80 - movs r3, 0 - ldr r5, =0x02039f34 - ldr r0, [r5] - ldr r0, [r0, 0x1C] - lsls r1, r6, 4 - adds r0, r1, r0 - ldrb r0, [r0, 0xD] - ands r0, r2 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _080DF6C4 -_080DF6AE: - lsrs r2, 1 - adds r3, 0x1 - cmp r3, 0x7 - bgt _080DF6C4 - ldr r0, [r5] - ldr r0, [r0, 0x1C] - adds r0, r1, r0 - ldrb r4, [r0, 0xD] - ands r4, r2 - cmp r4, 0 - beq _080DF6AE -_080DF6C4: - mov r0, r9 - bl sub_80ECDA4 - mov r0, r10 - bl sub_80ECDF4 - ldr r5, [sp, 0x4] - lsrs r0, r5, 24 - bl sub_80ECE34 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x1C] - add r0, r8 - ldrh r0, [r0, 0xA] - bl sub_80ECE74 - adds r0, r4, 0 - adds r1, r6, 0 - bl sub_80ECEB4 -_080DF6EE: - 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_80DF4F8 - - thumb_func_start sub_80DF704 -sub_80DF704: @ 80DF704 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, =0x02000000 - movs r1, 0xD0 - lsls r1, 9 - adds r2, r0, r1 - ldrb r1, [r2] - adds r4, r0, 0 - cmp r1, 0 - bne _080DF72C - cmp r3, 0 - bne _080DF728 - movs r0, 0x2 - b _080DF72E - .pool -_080DF728: - movs r0, 0x3 - b _080DF72E -_080DF72C: - movs r0, 0 -_080DF72E: - strb r0, [r2] - movs r1, 0xD0 - lsls r1, 9 - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080DF746 - bl sub_80DAEA4 - bl sub_80DB2BC - b _080DF74A -_080DF746: - bl sub_80DF750 -_080DF74A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80DF704 - - thumb_func_start sub_80DF750 -sub_80DF750: @ 80DF750 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x34 - ldr r0, =0x020322d5 - ldrb r0, [r0] - cmp r0, 0 - bne _080DF766 - b _080DF924 -_080DF766: - ldr r0, =0x02000000 - movs r1, 0xD0 - lsls r1, 9 - adds r0, r1 - ldrb r0, [r0] - subs r0, 0x2 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _080DF77C - b _080DF924 -_080DF77C: - movs r7, 0 - mov r2, sp - adds r2, 0x18 - str r2, [sp, 0x30] -_080DF784: - adds r0, r7, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x3 - bls _080DF784 - ldr r0, =0x02000000 - movs r1, 0xD0 - lsls r1, 9 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x2 - bne _080DF874 - movs r7, 0 - movs r2, 0x7 - mov r10, r2 - ldr r0, [sp, 0x30] - mov r9, r0 -_080DF7AE: - add r0, sp, 0x4 - ldr r1, =gUnknown_085ED1B2 - bl CopyString - adds r5, r0, 0 - ldr r0, =0x02039f26 - adds r0, r7, r0 - ldrb r0, [r0] - mov r1, r10 - str r1, [sp] - add r1, sp, 0x4 - movs r2, 0x5 - movs r3, 0x1 - bl sub_80DEBD0 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0x1C] - lsls r0, r7, 4 - adds r0, r1 - ldrb r4, [r0, 0xC] - movs r6, 0x7 - adds r2, r7, 0x1 - mov r8, r2 -_080DF7DE: - movs r1, 0x1 - ands r1, r4 - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalString - adds r5, r0, 0 - lsrs r4, 1 - lsls r0, r6, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r6, r0, 24 - asrs r0, 24 - movs r2, 0x1 - negs r2, r2 - cmp r0, r2 - bgt _080DF7DE - movs r6, 0 - ldr r4, =0x02039f26 - ldr r3, [sp, 0x30] -_080DF80A: - lsls r0, r6, 24 - asrs r0, 24 - adds r2, r3, r0 - mov r1, sp - adds r1, r0 - adds r1, 0x4 - ldrb r1, [r1] - strb r1, [r2] - adds r0, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - asrs r5, r0, 24 - cmp r5, 0x4 - ble _080DF80A - mov r0, r9 - adds r1, r0, r5 - movs r0, 0xFF - strb r0, [r1] - adds r4, r7, r4 - ldrb r0, [r4] - mov r1, r10 - str r1, [sp] - mov r1, r9 - movs r2, 0x5 - movs r3, 0x1 - bl sub_80DEBD0 - ldrb r0, [r4] - mov r1, sp - adds r1, r5 - adds r1, 0x4 - mov r2, r10 - str r2, [sp] - movs r2, 0x37 - movs r3, 0x1 - bl sub_80DEBD0 - mov r1, r8 - lsls r0, r1, 24 - lsrs r7, r0, 24 - cmp r7, 0x3 - bls _080DF7AE - b _080DF920 - .pool -_080DF874: - movs r7, 0 - mov r2, sp - adds r2, 0x6 - str r2, [sp, 0x2C] - ldr r0, [sp, 0x30] - mov r9, r0 - movs r1, 0x7 - mov r10, r1 -_080DF884: - add r0, sp, 0x4 - ldr r1, =gUnknown_085ED1B5 - bl CopyString - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0x1C] - lsls r0, r7, 4 - adds r0, r1 - ldrb r4, [r0, 0xD] - ldr r5, [sp, 0x2C] - movs r6, 0x7 - adds r2, r7, 0x1 - mov r8, r2 -_080DF8A0: - movs r1, 0x1 - ands r1, r4 - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalString - adds r5, r0, 0 - lsrs r4, 1 - lsls r0, r6, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r6, r0, 24 - asrs r0, 24 - movs r2, 0x1 - negs r2, r2 - cmp r0, r2 - bgt _080DF8A0 - movs r6, 0 - ldr r4, =0x02039f26 - ldr r3, [sp, 0x30] -_080DF8CC: - lsls r0, r6, 24 - asrs r0, 24 - adds r2, r3, r0 - mov r1, sp - adds r1, r0 - adds r1, 0x4 - ldrb r1, [r1] - strb r1, [r2] - adds r0, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - asrs r5, r0, 24 - cmp r5, 0x4 - ble _080DF8CC - mov r0, r9 - adds r1, r0, r5 - movs r0, 0xFF - strb r0, [r1] - adds r4, r7, r4 - ldrb r0, [r4] - mov r1, r10 - str r1, [sp] - mov r1, r9 - movs r2, 0x5 - movs r3, 0x1 - bl sub_80DEBD0 - ldrb r0, [r4] - mov r1, sp - adds r1, r5 - adds r1, 0x4 - mov r2, r10 - str r2, [sp] - movs r2, 0x37 - movs r3, 0x1 - bl sub_80DEBD0 - mov r1, r8 - lsls r0, r1, 24 - lsrs r7, r0, 24 - cmp r7, 0x3 - bls _080DF884 -_080DF920: - bl sub_80DB2BC -_080DF924: - 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_80DF750 - - thumb_func_start sub_80DF940 -sub_80DF940: @ 80DF940 - push {r4,r5,lr} - adds r4, r0, 0 - movs r5, 0x2 - ldrb r0, [r4] - cmp r0, 0xFC - bne _080DF956 - ldrb r0, [r4, 0x1] - cmp r0, 0x15 - bne _080DF956 - movs r0, 0x2 - b _080DF9CC -_080DF956: - adds r0, r4, 0 - bl GetStringLength - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x5 - bhi _080DF9CA - ldrb r0, [r4] - cmp r0, 0xFF - beq _080DF9CA -_080DF96A: - ldrb r1, [r4] - adds r0, r1, 0 - adds r0, 0x45 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x33 - bls _080DF9BE - adds r0, r1, 0 - adds r0, 0x5F - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x9 - bls _080DF9BE - adds r0, r1, 0 - cmp r0, 0 - beq _080DF9BE - cmp r0, 0xAD - beq _080DF9BE - cmp r0, 0xB8 - beq _080DF9BE - cmp r0, 0xAB - beq _080DF9BE - cmp r0, 0xAC - beq _080DF9BE - cmp r0, 0xB5 - beq _080DF9BE - cmp r0, 0xB6 - beq _080DF9BE - cmp r0, 0xBA - beq _080DF9BE - cmp r0, 0xAE - beq _080DF9BE - cmp r0, 0xB0 - beq _080DF9BE - cmp r0, 0xB1 - beq _080DF9BE - cmp r0, 0xB2 - beq _080DF9BE - cmp r0, 0xB3 - beq _080DF9BE - cmp r0, 0xB1 - bne _080DF9C8 -_080DF9BE: - adds r4, 0x1 - ldrb r0, [r4] - cmp r0, 0xFF - bne _080DF96A - b _080DF9CA -_080DF9C8: - movs r5, 0x1 -_080DF9CA: - adds r0, r5, 0 -_080DF9CC: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80DF940 - - thumb_func_start sub_80DF9D4 -sub_80DF9D4: @ 80DF9D4 - ldrb r2, [r0, 0x5] - movs r1, 0xFF - strb r1, [r0, 0x5] - strb r2, [r0, 0x7] - bx lr - thumb_func_end sub_80DF9D4 - - thumb_func_start sub_80DF9E0 -sub_80DF9E0: @ 80DF9E0 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - bl StripExtendedControlCodes - cmp r4, 0x1 - bne _080DF9F8 - movs r0, 0xFF - strb r0, [r5, 0x5] - movs r0, 0xFC - strb r0, [r5, 0xA] - b _080DFA00 -_080DF9F8: - ldrb r1, [r5, 0x5] - movs r0, 0xFF - strb r0, [r5, 0x5] - strb r1, [r5, 0xA] -_080DFA00: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80DF9E0 - - thumb_func_start sub_80DFA08 -sub_80DFA08: @ 80DFA08 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - adds r4, r5, 0x2 - cmp r6, 0x1 - bne _080DFA28 - adds r0, r4, 0 - bl sub_80DF940 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StopMusicWhileStringIsPrinted - b _080DFA3E -_080DFA28: - ldrb r0, [r4, 0xA] - cmp r0, 0xFC - bne _080DFA38 - adds r0, r4, 0 - movs r1, 0x1 - bl StopMusicWhileStringIsPrinted - b _080DFA3E -_080DFA38: - strb r0, [r4, 0x5] - movs r0, 0xFF - strb r0, [r4, 0xA] -_080DFA3E: - adds r4, r5, 0 - adds r4, 0xD - cmp r6, 0x1 - bne _080DFA68 - movs r0, 0xFF - strb r0, [r4, 0x7] - ldrb r0, [r4, 0x4] - strb r0, [r4, 0x6] - ldrb r0, [r4, 0x3] - strb r0, [r4, 0x5] - ldrb r0, [r4, 0x2] - strb r0, [r4, 0x4] - ldrb r0, [r4, 0x1] - strb r0, [r4, 0x3] - ldrb r0, [r5, 0xD] - strb r0, [r4, 0x2] - movs r0, 0x15 - strb r0, [r4, 0x1] - movs r0, 0xFC - strb r0, [r5, 0xD] - b _080DFA70 -_080DFA68: - ldrb r0, [r4, 0x7] - strb r0, [r4, 0x5] - movs r0, 0xFF - strb r0, [r4, 0x7] -_080DFA70: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80DFA08 - - thumb_func_start CreateShopMenu -@ s8 CreateShopMenu(s8 type) -CreateShopMenu: @ 80DFA78 - push {r4,r5,lr} - sub sp, 0x10 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl script_env_2_enable - ldr r5, =0x02039f60 - strb r4, [r5, 0xF] - cmp r4, 0 - bne _080DFACC - ldr r0, =gUnknown_08589A38 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp] - str r1, [sp, 0x4] - ldr r4, =gUnknown_08589A10 - adds r0, r4, 0 - movs r1, 0x3 - bl GetMaxWidthInMenuTable - lsls r0, 24 - ldr r2, =0x00ffffff - ldr r1, [sp] - ands r1, r2 - orrs r1, r0 - str r1, [sp] - mov r0, sp - bl AddWindow - strb r0, [r5, 0xE] - str r4, [r5, 0x4] - movs r5, 0x3 - b _080DFAF8 - .pool -_080DFACC: - ldr r0, =gUnknown_08589A38 - ldr r1, [r0, 0xC] - ldr r0, [r0, 0x8] - str r0, [sp, 0x8] - str r1, [sp, 0xC] - ldr r4, =gUnknown_08589A28 - adds r0, r4, 0 - movs r1, 0x2 - bl GetMaxWidthInMenuTable - lsls r0, 24 - ldr r2, =0x00ffffff - ldr r1, [sp, 0x8] - ands r1, r2 - orrs r1, r0 - str r1, [sp, 0x8] - add r0, sp, 0x8 - bl AddWindow - strb r0, [r5, 0xE] - str r4, [r5, 0x4] - movs r5, 0x2 -_080DFAF8: - ldr r4, =0x02039f60 - ldrb r0, [r4, 0xE] - movs r1, 0 - bl SetStandardWindowBorderStyle - ldrb r0, [r4, 0xE] - ldr r2, [r4, 0x4] - adds r1, r5, 0 - bl PrintMenuTable - ldrb r0, [r4, 0xE] - adds r1, r5, 0 - movs r2, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - ldrb r0, [r4, 0xE] - bl PutWindowTilemap - ldrb r0, [r4, 0xE] - movs r1, 0x1 - bl CopyWindowToVram - ldr r0, =Task_ShopMenu - movs r1, 0x8 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - add sp, 0x10 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end CreateShopMenu - - thumb_func_start SetShopMenuCallback -@ void SetShopMenuCallback() -SetShopMenuCallback: @ 80DFB4C - ldr r1, =0x02039f60 - str r0, [r1] - bx lr - .pool - thumb_func_end SetShopMenuCallback - - thumb_func_start SetShopItemsForSale -@ int SetShopItemsForSale(s16 *itemsForSale) -SetShopItemsForSale: @ 80DFB58 - push {lr} - adds r1, r0, 0 - movs r2, 0 - ldr r3, =0x02039f60 - str r1, [r3, 0x8] - strh r2, [r3, 0xC] - ldrh r0, [r1] - cmp r0, 0 - beq _080DFB80 -_080DFB6A: - ldrh r0, [r3, 0xC] - adds r0, 0x1 - strh r0, [r3, 0xC] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - bne _080DFB6A -_080DFB80: - pop {r0} - bx r0 - .pool - thumb_func_end SetShopItemsForSale - - thumb_func_start Task_ShopMenu -@ void Task_ShopMenu(u8 taskId) -Task_ShopMenu: @ 80DFB88 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl ProcessMenuInputNoWrapAround - lsls r0, 24 - asrs r2, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r2, r0 - beq _080DFBC4 - adds r0, 0x1 - cmp r2, r0 - bne _080DFBB4 - movs r0, 0x5 - bl audio_play - adds r0, r4, 0 - bl HandleShopMenuQuit - b _080DFBC4 -_080DFBB4: - ldr r0, =0x02039f60 - ldr r1, [r0, 0x4] - lsls r0, r2, 3 - adds r0, r1 - ldr r1, [r0, 0x4] - adds r0, r5, 0 - bl _call_via_r1 -_080DFBC4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end Task_ShopMenu - - thumb_func_start HandleShopMenuBuy -@ void HandleShopMenuBuy(u8 taskId) -HandleShopMenuBuy: @ 80DFBD0 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r2, =0x03005e08 - adds r4, r1, r2 - ldr r3, =CB2_InitBuyMenu - lsrs r0, r3, 16 - strh r0, [r4, 0x10] - strh r3, [r4, 0x12] - subs r2, 0x8 - adds r1, r2 - ldr r0, =Task_GoToBuyOrSellMenu - str r0, [r1] - movs r0, 0x1 - movs r1, 0 - bl fade_screen - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end HandleShopMenuBuy - - thumb_func_start HandleShopMenuSell -@ void HandleShopMenuSell(u8 taskId) -HandleShopMenuSell: @ 80DFC0C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r2, =0x03005e08 - adds r4, r1, r2 - ldr r3, =CB2_GoToSellMenu - lsrs r0, r3, 16 - strh r0, [r4, 0x10] - strh r3, [r4, 0x12] - subs r2, 0x8 - adds r1, r2 - ldr r0, =Task_GoToBuyOrSellMenu - str r0, [r1] - movs r0, 0x1 - movs r1, 0 - bl fade_screen - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end HandleShopMenuSell - - thumb_func_start CB2_ExitSellMenu -@ int CB2_ExitSellMenu() -CB2_ExitSellMenu: @ 80DFC48 - push {lr} - ldr r0, =0x03005dac - ldr r1, =MapPostLoadHook_ExitBuyOrSellMenu - str r1, [r0] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end CB2_ExitSellMenu - - thumb_func_start HandleShopMenuQuit -@ void HandleShopMenuQuit(u8 taskId) -HandleShopMenuQuit: @ 80DFC68 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =0x02039f60 - ldrb r0, [r5, 0xE] - movs r1, 0x2 - bl sub_8198070 - ldrb r0, [r5, 0xE] - bl RemoveWindow - bl SaveRecordedItemPurchasesForTVShow - bl script_env_2_disable - adds r0, r4, 0 - bl DestroyTask - ldr r5, [r5] - cmp r5, 0 - beq _080DFC98 - bl _call_via_r5 -_080DFC98: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end HandleShopMenuQuit - - thumb_func_start Task_GoToBuyOrSellMenu -@ int Task_GoToBuyOrSellMenu(u8 taskId) -Task_GoToBuyOrSellMenu: @ 80DFCA4 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080DFCD2 - adds r0, r2, 0 - bl DestroyTask - ldrh r0, [r4, 0x10] - lsls r0, 16 - ldrh r1, [r4, 0x12] - orrs r0, r1 - bl SetMainCallback2 -_080DFCD2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end Task_GoToBuyOrSellMenu - - thumb_func_start MapPostLoadHook_ExitBuyOrSellMenu -@ void MapPostLoadHook_ExitBuyOrSellMenu() -MapPostLoadHook_ExitBuyOrSellMenu: @ 80DFCE0 - push {lr} - bl pal_fill_black - ldr r0, =Task_ExitSellMenu - movs r1, 0x8 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end MapPostLoadHook_ExitBuyOrSellMenu - - thumb_func_start Task_ExitSellMenu -@ void Task_ExitSellMenu(u8 taskId) -Task_ExitSellMenu: @ 80DFCF8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl sub_80ABDFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080DFD36 - ldr r0, =0x02039f60 - ldrb r0, [r0, 0xF] - cmp r0, 0x2 - bne _080DFD2C - ldr r1, =gUnknown_085E95C7 - ldr r2, =ReturnToShopMenuAfterExitingSellMenu - adds r0, r4, 0 - bl DisplayItemMessageOnField - b _080DFD36 - .pool -_080DFD2C: - ldr r1, =gUnknown_085E959B - ldr r2, =ReturnToShopMenuAfterExitingSellMenu - adds r0, r5, 0 - bl DisplayItemMessageOnField -_080DFD36: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end Task_ExitSellMenu - - thumb_func_start ReturnToShopMenuAfterExitingSellMenu -@ void ReturnToShopMenuAfterExitingSellMenu(u8 taskId) -ReturnToShopMenuAfterExitingSellMenu: @ 80DFD44 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x02039f60 - ldrb r0, [r0, 0xF] - bl CreateShopMenu - adds r0, r4, 0 - bl DestroyTask - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ReturnToShopMenuAfterExitingSellMenu - - thumb_func_start CB2_BuyMenu -@ void CB2_BuyMenu() -CB2_BuyMenu: @ 80DFD64 - push {lr} - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end CB2_BuyMenu - - thumb_func_start VBlankCB_BuyMenu -@ void VBlankCB_BuyMenu() -VBlankCB_BuyMenu: @ 80DFD80 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end VBlankCB_BuyMenu - - thumb_func_start CB2_InitBuyMenu -@ void CB2_InitBuyMenu() -CB2_InitBuyMenu: @ 80DFD94 - push {r4,r5,lr} - sub sp, 0xC - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r5, r0, r1 - ldrb r4, [r5] - cmp r4, 0 - beq _080DFE20 - cmp r4, 0x1 - bne _080DFDAC - b _080DFEE4 -_080DFDAC: - bl BuyMenuDrawGraphics - bl BuyMenuAddScrollIndicatorArrows - ldr r0, =Task_BuyMenu - movs r1, 0x8 - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x03006310 - movs r1, 0 - movs r2, 0 - bl ListMenuInit - ldr r2, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r2 - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - strh r0, [r1, 0x16] - movs r4, 0x1 - negs r4, r4 - adds r0, r4, 0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - str r5, [sp] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =VBlankCB_BuyMenu - bl SetVBlankCallback - ldr r0, =CB2_BuyMenu - bl SetMainCallback2 - b _080DFEF4 - .pool -_080DFE20: - bl SetVBlankHBlankCallbacksToNull - str r4, [sp, 0x8] - movs r1, 0xE0 - lsls r1, 19 - ldr r2, =0x01000100 - add r0, sp, 0x8 - bl CpuFastSet - bl remove_some_task - bl reset_temp_tile_data_buffers - bl ResetObjectPaletteAllocator - bl sub_80A1A74 - bl ResetAllObjectData - bl ResetTasks - bl clear_scheduled_bg_copies_to_vram - ldr r4, =0x02039f70 - ldr r0, =0x000020b0 - bl AllocZeroed - str r0, [r4] - ldr r1, =0x0000200b - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r4] - ldr r1, =0x0000200d - adds r0, r1 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - ldr r0, [r4] - ldr r1, =0x0000200e - adds r0, r1 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - bl BuyMenuBuildListMenuTemplate - bl BuyMenuInitBgs - movs r4, 0x20 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - bl BuyMenuInitWindows - bl BuyMenuDecompressBgGraphics - b _080DFEEE - .pool -_080DFEE4: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _080DFEF4 -_080DFEEE: - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] -_080DFEF4: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end CB2_InitBuyMenu - - thumb_func_start BuyMenuFreeMemory -@ void BuyMenuFreeMemory() -BuyMenuFreeMemory: @ 80DFEFC - push {lr} - ldr r0, =0x02039f70 - ldr r0, [r0] - bl Free - ldr r0, =0x02039f74 - ldr r0, [r0] - bl Free - ldr r0, =0x02039f78 - ldr r0, [r0] - bl Free - bl FreeAllWindowBuffers - pop {r0} - bx r0 - .pool - thumb_func_end BuyMenuFreeMemory - - thumb_func_start BuyMenuBuildListMenuTemplate -@ void BuyMenuBuildListMenuTemplate() -BuyMenuBuildListMenuTemplate: @ 80DFF2C - push {r4-r7,lr} - ldr r7, =0x02039f74 - ldr r4, =0x02039f60 - ldrh r0, [r4, 0xC] - adds r0, 0x1 - lsls r0, 3 - bl Alloc - str r0, [r7] - ldr r5, =0x02039f78 - ldrh r0, [r4, 0xC] - adds r0, 0x1 - lsls r0, 4 - bl Alloc - str r0, [r5] - movs r6, 0 - ldrh r0, [r4, 0xC] - cmp r6, r0 - bcs _080DFF78 -_080DFF54: - lsls r1, r6, 3 - ldr r0, [r7] - adds r0, r1 - ldr r2, [r4, 0x8] - lsls r1, r6, 1 - adds r1, r2 - ldrh r1, [r1] - lsls r3, r6, 4 - ldr r2, [r5] - adds r2, r3 - bl BuyMenuSetListEntry - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldrh r2, [r4, 0xC] - cmp r6, r2 - bcc _080DFF54 -_080DFF78: - ldr r4, =0x02039f78 - lsls r5, r6, 4 - ldr r0, [r4] - adds r0, r5 - ldr r1, =gUnknown_085E8CF7 - bl CopyString - ldr r2, =0x02039f74 - ldr r0, [r2] - lsls r1, r6, 3 - adds r1, r0 - ldr r0, [r4] - adds r0, r5 - str r0, [r1] - movs r0, 0x2 - negs r0, r0 - str r0, [r1, 0x4] - ldr r3, =0x03006310 - adds r1, r3, 0 - ldr r0, =gUnknown_08589A48 - ldm r0!, {r4-r6} - stm r1!, {r4-r6} - ldm r0!, {r4-r6} - stm r1!, {r4-r6} - ldr r0, [r2] - str r0, [r3] - ldr r0, =0x02039f60 - ldrh r0, [r0, 0xC] - adds r1, r0, 0x1 - strh r1, [r3, 0xC] - lsls r0, r1, 16 - lsrs r0, 16 - cmp r0, 0x8 - bls _080DFFDC - movs r0, 0x8 - strh r0, [r3, 0xE] - b _080DFFDE - .pool -_080DFFDC: - strh r1, [r3, 0xE] -_080DFFDE: - ldr r0, =0x02039f70 - ldr r0, [r0] - ldr r1, =0x03006310 - ldrh r1, [r1, 0xE] - ldr r2, =0x00002004 - adds r0, r2 - strh r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end BuyMenuBuildListMenuTemplate - - thumb_func_start BuyMenuSetListEntry -@ void BuyMenuSetListEntry(struct ListMenuEntry *entry, u16 code, u8 *str) -BuyMenuSetListEntry: @ 80E0000 - push {r4-r6,lr} - adds r6, r0, 0 - adds r5, r2, 0 - lsls r1, 16 - lsrs r4, r1, 16 - ldr r0, =0x02039f60 - ldrb r0, [r0, 0xF] - cmp r0, 0 - bne _080E0020 - adds r0, r4, 0 - adds r1, r5, 0 - bl itemid_get_name - b _080E002C - .pool -_080E0020: - lsls r1, r4, 5 - ldr r0, =gUnknown_085A5C09 - adds r1, r0 - adds r0, r5, 0 - bl CopyString -_080E002C: - str r5, [r6] - str r4, [r6, 0x4] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end BuyMenuSetListEntry - - thumb_func_start BuyMenuPrintItemDescriptionAndShowItemIcon -@ void BuyMenuPrintItemDescriptionAndShowItemIcon(s32 menuEntryCode, bool8 isInitialSelection, struct ListMenu *listMenu) -BuyMenuPrintItemDescriptionAndShowItemIcon: @ 80E003C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r7, r0, 0 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x1 - beq _080E0054 - movs r0, 0x5 - bl audio_play -_080E0054: - movs r0, 0x2 - negs r0, r0 - cmp r7, r0 - beq _080E0078 - lsls r4, r7, 16 - lsrs r0, r4, 16 - ldr r1, =0x02039f70 - ldr r1, [r1] - ldr r2, =0x0000200c - adds r1, r2 - ldrb r1, [r1] - bl BuyMenuAddItemIcon - b _080E008A - .pool -_080E0078: - ldr r0, =0x0000ffff - ldr r1, =0x02039f70 - ldr r1, [r1] - ldr r2, =0x0000200c - adds r1, r2 - ldrb r1, [r1] - bl BuyMenuAddItemIcon - lsls r4, r7, 16 -_080E008A: - lsrs r4, 16 - mov r8, r4 - ldr r6, =0x02039f70 - ldr r0, [r6] - ldr r5, =0x0000200c - adds r0, r5 - ldrb r0, [r0] - movs r4, 0x1 - adds r1, r4, 0 - eors r1, r0 - mov r0, r8 - bl BuyMenuRemoveItemIcon - ldr r1, [r6] - adds r1, r5 - ldrb r0, [r1] - eors r0, r4 - strb r0, [r1] - movs r0, 0x2 - negs r0, r0 - cmp r7, r0 - beq _080E00E8 - ldr r0, =0x02039f60 - ldrb r0, [r0, 0xF] - cmp r0, 0 - bne _080E00D8 - mov r0, r8 - bl itemid_get_description - adds r4, r0, 0 - b _080E00EA - .pool -_080E00D8: - ldr r0, =gUnknown_085A5C08 - lsls r1, r7, 5 - adds r0, 0x18 - adds r1, r0 - ldr r4, [r1] - b _080E00EA - .pool -_080E00E8: - ldr r4, =gUnknown_085E93E0 -_080E00EA: - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x2 - adds r1, r4, 0 - movs r2, 0x3 - movs r3, 0x1 - bl BuyMenuPrint - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end BuyMenuPrintItemDescriptionAndShowItemIcon - - thumb_func_start BuyMenuPrintPriceInList -@ void BuyMenuPrintPriceInList(u8 windowId, s32 menuEntryCode, u8 y) -BuyMenuPrintPriceInList: @ 80E0114 - push {r4-r7,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r2, 24 - lsrs r7, r2, 24 - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - beq _080E01AC - ldr r0, =0x02039f60 - ldrb r0, [r0, 0xF] - cmp r0, 0 - bne _080E0164 - ldr r5, =0x02021cc4 - lsls r0, r1, 16 - lsrs r0, 16 - bl itemid_get_market_price - adds r4, r0, 0 - movs r0, 0x1 - bl GetPriceReduction - lsls r4, 16 - lsrs r4, 16 - lsls r0, 24 - lsrs r0, 24 - asrs r4, r0 - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x5 - bl ConvertIntToDecimalString - b _080E0176 - .pool -_080E0164: - ldr r0, =0x02021cc4 - ldr r2, =gUnknown_085A5C08 - lsls r1, 5 - adds r1, r2 - ldrh r1, [r1, 0x14] - movs r2, 0 - movs r3, 0x5 - bl ConvertIntToDecimalString -_080E0176: - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E969C - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0x7 - adds r1, r4, 0 - movs r2, 0x78 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - ldr r0, =gUnknown_08589AB3 - str r0, [sp, 0x8] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0xC] - str r4, [sp, 0x10] - adds r0, r6, 0 - movs r1, 0x7 - adds r3, r7, 0 - bl AddTextPrinterParametrized2 -_080E01AC: - add sp, 0x14 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end BuyMenuPrintPriceInList - - thumb_func_start BuyMenuAddScrollIndicatorArrows -@ void BuyMenuAddScrollIndicatorArrows() -BuyMenuAddScrollIndicatorArrows: @ 80E01C8 - push {r4,r5,lr} - sub sp, 0x10 - ldr r5, =0x02039f70 - ldr r2, [r5] - ldr r4, =0x0000200b - adds r0, r2, r4 - ldrb r0, [r0] - cmp r0, 0xFF - bne _080E0206 - ldr r0, =0x02039f60 - ldrh r1, [r0, 0xC] - adds r0, r1, 0x1 - cmp r0, 0x8 - ble _080E0206 - subs r0, r1, 0x7 - str r0, [sp] - ldr r0, =0x00000834 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - ldr r1, =0x00002008 - adds r0, r2, r1 - str r0, [sp, 0xC] - movs r0, 0x2 - movs r1, 0xAC - movs r2, 0xC - movs r3, 0x94 - bl AddScrollIndicatorArrowPairParametrized - ldr r1, [r5] - adds r1, r4 - strb r0, [r1] -_080E0206: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end BuyMenuAddScrollIndicatorArrows - - thumb_func_start BuyMenuRemoveScrollIndicatorArrows -@ void BuyMenuRemoveScrollIndicatorArrows() -BuyMenuRemoveScrollIndicatorArrows: @ 80E0224 - push {r4,lr} - ldr r4, =0x02039f70 - ldr r0, [r4] - ldr r2, =0x0000200b - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _080E0242 - bl RemoveScrollIndicatorArrowPair - ldr r0, [r4] - ldr r1, =0x0000200b - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] -_080E0242: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end BuyMenuRemoveScrollIndicatorArrows - - thumb_func_start BuyMenuPrintCursor -@ void BuyMenuPrintCursor(u8 taskId, u8 colorSetId) -BuyMenuPrintCursor: @ 80E0250 - push {r4,lr} - sub sp, 0x8 - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - bl ListMenuGetYCoordForPrintingArrowCursor - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r1, =gUnknown_085E8D60 - movs r0, 0 - str r0, [sp] - str r4, [sp, 0x4] - movs r0, 0x1 - movs r2, 0 - bl BuyMenuPrint - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end BuyMenuPrintCursor - - thumb_func_start BuyMenuAddItemIcon -@ void BuyMenuAddItemIcon(u16 id, u8 iconSlot) -BuyMenuAddItemIcon: @ 80E0284 - push {r4,lr} - sub sp, 0x8 - lsls r0, 16 - lsrs r2, r0, 16 - lsls r1, 24 - lsrs r3, r1, 24 - ldr r0, =0x02039f70 - ldr r4, =0x0000200d - adds r1, r3, r4 - ldr r0, [r0] - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0xFF - bne _080E0310 - ldr r0, =0x02039f60 - ldrb r0, [r0, 0xF] - cmp r0, 0 - beq _080E02AE - ldr r0, =0x0000ffff - cmp r2, r0 - bne _080E02F0 -_080E02AE: - ldr r0, =0x0000083e - adds r1, r3, r0 - adds r0, r1, 0 - bl AddItemIconObject - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - beq _080E0310 - strb r2, [r4] - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0x18 - strh r1, [r0, 0x24] - movs r1, 0x58 - strh r1, [r0, 0x26] - b _080E0310 - .pool -_080E02F0: - lsls r0, r2, 24 - lsrs r0, 24 - ldr r2, =0x0000083e - adds r1, r3, r2 - str r1, [sp] - str r1, [sp, 0x4] - movs r1, 0x14 - movs r2, 0x54 - movs r3, 0x1 - bl AddDecorationIconObject - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - beq _080E0310 - strb r2, [r4] -_080E0310: - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end BuyMenuAddItemIcon - - thumb_func_start BuyMenuRemoveItemIcon -@ void BuyMenuRemoveItemIcon(u16 id, u8 iconSlot) -BuyMenuRemoveItemIcon: @ 80E031C - push {r4,r5,lr} - lsls r1, 24 - lsrs r4, r1, 24 - ldr r0, =0x02039f70 - ldr r2, =0x0000200d - adds r1, r4, r2 - ldr r0, [r0] - adds r5, r0, r1 - ldrb r0, [r5] - cmp r0, 0xFF - beq _080E0356 - ldr r0, =0x0000083e - adds r4, r0 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - movs r0, 0xFF - strb r0, [r5] -_080E0356: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end BuyMenuRemoveItemIcon - - thumb_func_start BuyMenuInitBgs -@ void BuyMenuInitBgs() -BuyMenuInitBgs: @ 80E036C - push {r4,lr} - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_08589A60 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r4, =0x02039f70 - ldr r1, [r4] - movs r0, 0x80 - lsls r0, 4 - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - movs r0, 0xC0 - lsls r0, 5 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - ldr r1, [r4] - movs r0, 0x80 - lsls r0, 5 - adds r1, r0 - movs r0, 0x3 - bl SetBgTilemapBuffer - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0x1C - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - 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, 0x3 - bl ShowBg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end BuyMenuInitBgs - - thumb_func_start BuyMenuDecompressBgGraphics -@ void BuyMenuDecompressBgGraphics() -BuyMenuDecompressBgGraphics: @ 80E0424 - push {lr} - sub sp, 0x4 - ldr r1, =gUnknown_08D9AFBC - movs r2, 0xE8 - lsls r2, 2 - ldr r3, =0x000003e3 - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - bl decompress_and_copy_tile_data_to_vram - ldr r0, =gUnknown_08D9B0F0 - ldr r1, =0x02039f70 - ldr r1, [r1] - bl LZDecompressWram - ldr r0, =gUnknown_08D9B0C8 - movs r1, 0xC0 - movs r2, 0x20 - bl decompress_palette - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end BuyMenuDecompressBgGraphics - - thumb_func_start BuyMenuInitWindows -@ void BuyMenuInitWindows() -BuyMenuInitWindows: @ 80E0468 - push {lr} - ldr r0, =gUnknown_08589A70 - bl InitWindows - bl DeactivateAllTextPrinters - movs r0, 0 - movs r1, 0x1 - movs r2, 0xD0 - bl sub_809882C - movs r0, 0 - movs r1, 0xA - movs r2, 0xE0 - bl copy_textbox_border_tile_patterns_to_vram - movs r0, 0 - bl PutWindowTilemap - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x2 - bl PutWindowTilemap - pop {r0} - bx r0 - .pool - thumb_func_end BuyMenuInitWindows - - thumb_func_start BuyMenuPrint -@ void BuyMenuPrint(u8 windowId, u8 *str, u8 x, u8 y, u8 speed, u8 colorSetId) -BuyMenuPrint: @ 80E04A4 - push {r4-r6,lr} - sub sp, 0x14 - ldr r6, [sp, 0x24] - ldr r5, [sp, 0x28] - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r5, 24 - lsrs r5, 24 - movs r4, 0 - str r4, [sp] - str r4, [sp, 0x4] - lsls r4, r5, 1 - adds r4, r5 - ldr r5, =gUnknown_08589AB0 - adds r4, r5 - str r4, [sp, 0x8] - lsls r6, 24 - asrs r6, 24 - str r6, [sp, 0xC] - str r1, [sp, 0x10] - movs r1, 0x1 - bl AddTextPrinterParametrized2 - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end BuyMenuPrint - - thumb_func_start BuyMenuDisplayMessage -@ void BuyMenuDisplayMessage(u8 taskId, u8 *str, void ( *callback)(u8 taskId)) -BuyMenuDisplayMessage: @ 80E04E8 - 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 sav2_get_text_speed - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - str r1, [sp] - str r0, [sp, 0x4] - str r5, [sp, 0x8] - str r6, [sp, 0xC] - adds r0, r4, 0 - movs r1, 0x5 - movs r2, 0xA - movs r3, 0xE - bl DisplayMessageAndContinueTask - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end BuyMenuDisplayMessage - - thumb_func_start BuyMenuDrawGraphics -@ void BuyMenuDrawGraphics() -BuyMenuDrawGraphics: @ 80E0524 - push {lr} - bl BuyMenuDrawMapGraphics - bl BuyMenuCopyMenuBgToBg1TilemapBuffer - movs r0, 0x13 - movs r1, 0xB - bl AddMoneyLabelObject - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - bl DecryptMoney - adds r3, r0, 0 - movs r0, 0 - movs r1, 0x1 - movs r2, 0xD - bl set_window_border_style_and_print_money_box - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x3 - bl schedule_bg_copy_tilemap_to_vram - pop {r0} - bx r0 - .pool - thumb_func_end BuyMenuDrawGraphics - - thumb_func_start BuyMenuDrawMapGraphics -@ void BuyMenuDrawMapGraphics() -BuyMenuDrawMapGraphics: @ 80E0570 - push {lr} - bl BuyMenuCollectFieldObjectData - bl BuyMenuDrawFieldObjects - bl BuyMenuDrawMapBg - pop {r0} - bx r0 - thumb_func_end BuyMenuDrawMapGraphics - - thumb_func_start BuyMenuDrawMapBg -@ void BuyMenuDrawMapBg() -BuyMenuDrawMapBg: @ 80E0584 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r0, =0x02037318 - ldr r0, [r0] - mov r9, r0 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl GetXYCoordsOneStepInFrontOfPlayer - mov r1, sp - mov r0, sp - ldrh r0, [r0] - subs r0, 0x4 - strh r0, [r1] - ldrh r0, [r4] - subs r0, 0x4 - strh r0, [r4] - movs r1, 0 - mov r10, r4 -_080E05B6: - movs r4, 0 - lsls r7, r1, 16 - asrs r0, r7, 16 - mov r8, r0 -_080E05BE: - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - lsls r4, 16 - asrs r5, r4, 16 - adds r0, r5 - mov r2, r10 - movs r3, 0 - ldrsh r1, [r2, r3] - add r1, r8 - bl MapGridGetMetatileIdAt - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r5, 0 - mov r1, r8 - bl BuyMenuCheckForOverlapWithMenuBg - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E0608 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - adds r0, r5 - mov r2, r10 - movs r3, 0 - ldrsh r1, [r2, r3] - add r1, r8 - bl MapGridGetMetatileLayerTypeAt - lsls r0, 24 - lsrs r5, r0, 24 - b _080E060A - .pool -_080E0608: - movs r5, 0x1 -_080E060A: - ldr r0, =0x000001ff - cmp r6, r0 - bhi _080E062C - asrs r0, r4, 16 - mov r2, r9 - ldr r1, [r2, 0x10] - lsls r3, r6, 4 - ldr r2, [r1, 0xC] - adds r2, r3 - asrs r1, r7, 16 - adds r3, r5, 0 - bl BuyMenuDrawMapMetatile - b _080E0644 - .pool -_080E062C: - asrs r0, r4, 16 - mov r3, r9 - ldr r2, [r3, 0x14] - ldr r3, =0xfffffe00 - adds r1, r6, r3 - lsls r1, 4 - ldr r2, [r2, 0xC] - adds r2, r1 - asrs r1, r7, 16 - adds r3, r5, 0 - bl BuyMenuDrawMapMetatile -_080E0644: - movs r1, 0x80 - lsls r1, 9 - adds r0, r4, r1 - lsrs r4, r0, 16 - asrs r0, 16 - cmp r0, 0xE - ble _080E05BE - adds r0, r7, r1 - lsrs r1, r0, 16 - asrs r0, 16 - cmp r0, 0x9 - ble _080E05B6 - 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 BuyMenuDrawMapBg - - thumb_func_start BuyMenuDrawMapMetatile -@ void BuyMenuDrawMapMetatile(u16 x, u16 y, u16 *src, u8 metatileLayerType) -BuyMenuDrawMapMetatile: @ 80E0670 - push {r4-r7,lr} - adds r7, r2, 0 - lsls r3, 24 - lsrs r3, 24 - adds r2, r3, 0 - lsls r0, 17 - lsrs r5, r0, 16 - lsls r1, 22 - lsrs r1, 16 - cmp r3, 0x1 - beq _080E06C0 - cmp r3, 0x1 - bgt _080E0690 - cmp r3, 0 - beq _080E0696 - b _080E0728 -_080E0690: - cmp r2, 0x2 - beq _080E06F8 - b _080E0728 -_080E0696: - ldr r6, =0x02039f70 - ldr r0, [r6] - movs r2, 0xC0 - lsls r2, 5 - adds r0, r2 - lsls r5, 16 - asrs r5, 16 - lsls r4, r1, 16 - asrs r4, 16 - adds r1, r5, 0 - adds r2, r4, 0 - adds r3, r7, 0 - bl BuyMenuDrawMapMetatileLayer - ldr r0, [r6] - movs r1, 0x80 - lsls r1, 4 - b _080E06E2 - .pool -_080E06C0: - ldr r6, =0x02039f70 - ldr r0, [r6] - movs r2, 0x80 - lsls r2, 5 - adds r0, r2 - lsls r5, 16 - asrs r5, 16 - lsls r4, r1, 16 - asrs r4, 16 - adds r1, r5, 0 - adds r2, r4, 0 - adds r3, r7, 0 - bl BuyMenuDrawMapMetatileLayer - ldr r0, [r6] - movs r1, 0xC0 - lsls r1, 5 -_080E06E2: - adds r0, r1 - adds r3, r7, 0 - adds r3, 0x8 - adds r1, r5, 0 - adds r2, r4, 0 - bl BuyMenuDrawMapMetatileLayer - b _080E0728 - .pool -_080E06F8: - ldr r6, =0x02039f70 - ldr r0, [r6] - movs r2, 0x80 - lsls r2, 5 - adds r0, r2 - lsls r5, 16 - asrs r5, 16 - lsls r4, r1, 16 - asrs r4, 16 - adds r1, r5, 0 - adds r2, r4, 0 - adds r3, r7, 0 - bl BuyMenuDrawMapMetatileLayer - ldr r0, [r6] - movs r1, 0x80 - lsls r1, 4 - adds r0, r1 - adds r3, r7, 0 - adds r3, 0x8 - adds r1, r5, 0 - adds r2, r4, 0 - bl BuyMenuDrawMapMetatileLayer -_080E0728: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end BuyMenuDrawMapMetatile - - thumb_func_start BuyMenuDrawMapMetatileLayer -@ int BuyMenuDrawMapMetatileLayer(void *tilemapBuffer, s16 xOffset, s16 yOffset, u16 *src) -BuyMenuDrawMapMetatileLayer: @ 80E0734 - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - adds r1, r2 - lsls r1, 1 - adds r1, r0 - ldrh r0, [r3] - strh r0, [r1] - ldrh r0, [r3, 0x2] - strh r0, [r1, 0x2] - adds r2, r1, 0 - adds r2, 0x40 - ldrh r0, [r3, 0x4] - strh r0, [r2] - adds r1, 0x42 - ldrh r0, [r3, 0x6] - strh r0, [r1] - bx lr - thumb_func_end BuyMenuDrawMapMetatileLayer - - thumb_func_start BuyMenuCollectFieldObjectData -@ void BuyMenuCollectFieldObjectData() -BuyMenuCollectFieldObjectData: @ 80E075C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - movs r0, 0 - mov r8, r0 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl GetXYCoordsOneStepInFrontOfPlayer - movs r7, 0 - ldr r5, =0x02039f70 - ldr r3, =0x00002010 - movs r2, 0x10 -_080E0780: - ldr r1, [r5] - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 1 - adds r1, r3 - adds r1, r0 - strh r2, [r1] - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0xF - bls _080E0780 - movs r7, 0 - str r4, [sp, 0x8] - ldr r1, =0x02039f70 - mov r9, r1 - mov r2, sp - str r2, [sp, 0x4] -_080E07A4: - movs r3, 0 - adds r4, r7, 0x1 - str r4, [sp, 0xC] -_080E07AA: - ldr r1, =0x0000fffc - adds r0, r3, r1 - ldr r2, [sp, 0x4] - ldrh r2, [r2] - adds r0, r2 - lsls r0, 16 - asrs r0, 16 - ldr r4, =0x0000fffe - adds r1, r7, r4 - ldr r2, [sp, 0x8] - ldrh r2, [r2] - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - str r3, [sp, 0x10] - bl GetFieldObjectIdByXY - lsls r0, 24 - lsrs r6, r0, 24 - ldr r3, [sp, 0x10] - cmp r6, 0x10 - beq _080E08C2 - mov r4, r9 - ldr r1, [r4] - mov r0, r8 - lsls r4, r0, 2 - adds r0, r4, r0 - lsls r5, r0, 1 - ldr r2, =0x00002010 - adds r0, r1, r2 - adds r0, r5 - movs r2, 0 - mov r10, r2 - strh r6, [r0] - ldr r2, =0x00002012 - adds r0, r1, r2 - adds r0, r5 - strh r3, [r0] - ldr r0, =0x00002014 - adds r1, r0 - adds r1, r5 - strh r7, [r1] - ldr r1, [sp, 0x4] - movs r2, 0 - ldrsh r0, [r1, r2] - subs r1, r3, 0x4 - adds r0, r1 - ldr r1, [sp, 0x8] - movs r2, 0 - ldrsh r1, [r1, r2] - mov r12, r1 - subs r1, r7, 0x2 - add r1, r12 - str r3, [sp, 0x10] - bl MapGridGetMetatileLayerTypeAt - mov r1, r9 - ldr r2, [r1] - ldr r1, =0x00002018 - adds r1, r2 - mov r12, r1 - add r12, r5 - lsls r0, 24 - lsrs r0, 24 - mov r1, r12 - strh r0, [r1] - ldr r1, =0x02037350 - lsls r0, r6, 3 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x18] - lsls r0, 28 - lsrs r0, 28 - ldr r3, [sp, 0x10] - cmp r0, 0x2 - beq _080E0884 - cmp r0, 0x2 - bgt _080E0870 - cmp r0, 0x1 - beq _080E0876 - b _080E08A4 - .pool -_080E0870: - cmp r0, 0x3 - beq _080E0894 - b _080E08A4 -_080E0876: - ldr r4, =0x00002016 - adds r0, r2, r4 - adds r0, r5 - mov r1, r10 - b _080E08B6 - .pool -_080E0884: - ldr r4, =0x00002016 - adds r0, r2, r4 - adds r0, r5 - movs r1, 0x1 - b _080E08B6 - .pool -_080E0894: - ldr r1, =0x00002016 - adds r0, r2, r1 - adds r0, r5 - movs r1, 0x2 - b _080E08B6 - .pool -_080E08A4: - mov r2, r9 - ldr r0, [r2] - mov r2, r8 - adds r1, r4, r2 - lsls r1, 1 - ldr r4, =0x00002016 - adds r0, r4 - adds r0, r1 - movs r1, 0x3 -_080E08B6: - strh r1, [r0] - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 -_080E08C2: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x6 - bhi _080E08CE - b _080E07AA -_080E08CE: - ldr r1, [sp, 0xC] - lsls r0, r1, 24 - lsrs r7, r0, 24 - cmp r7, 0x4 - bhi _080E08DA - b _080E07A4 -_080E08DA: - 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 BuyMenuCollectFieldObjectData - - thumb_func_start BuyMenuDrawFieldObjects -@ void BuyMenuDrawFieldObjects() -BuyMenuDrawFieldObjects: @ 80E08F0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r7, 0 - ldr r0, =0x02039f70 - mov r8, r0 - ldr r1, =0x02037350 - mov r10, r1 - ldr r2, =0x02020630 - mov r9, r2 -_080E090A: - mov r3, r8 - ldr r0, [r3] - lsls r1, r7, 2 - adds r1, r7 - lsls r5, r1, 1 - ldr r4, =0x00002010 - adds r0, r4 - adds r1, r0, r5 - movs r2, 0 - ldrsh r0, [r1, r2] - cmp r0, 0x10 - beq _080E09D8 - adds r1, r0, 0 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - add r0, r10 - ldrb r0, [r0, 0x5] - bl GetFieldObjectGraphicsInfo - mov r4, r8 - ldr r3, [r4] - ldr r2, =0x00002010 - adds r1, r3, r2 - adds r1, r5 - movs r4, 0 - ldrsh r2, [r1, r4] - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - add r1, r10 - ldrb r4, [r1, 0x5] - ldr r2, =0x00002012 - adds r1, r3, r2 - adds r1, r5 - ldrh r2, [r1] - lsls r2, 4 - adds r2, 0x8 - lsls r2, 16 - asrs r2, 16 - ldr r1, =0x00002014 - adds r3, r1 - adds r3, r5 - ldrh r3, [r3] - lsls r3, 4 - movs r1, 0xA - ldrsh r0, [r0, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - subs r0, 0x30 - subs r3, r0 - lsls r3, 16 - asrs r3, 16 - movs r0, 0x2 - str r0, [sp] - adds r0, r4, 0 - ldr r1, =DummyObjectCallback - bl AddPseudoFieldObject - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - ldr r2, =0x00002010 - adds r1, r5, r2 - mov r3, r8 - ldr r0, [r3] - adds r0, r1 - bl BuyMenuCheckIfFieldObjectOverlapsMenuBg - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E09C0 - lsls r2, r4, 4 - adds r2, r4 - lsls r2, 2 - add r2, r9 - adds r2, 0x42 - ldrb r0, [r2] - movs r4, 0x40 - negs r4, r4 - adds r1, r4, 0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x3F - ands r0, r1 - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] -_080E09C0: - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - add r0, r9 - mov r2, r8 - ldr r1, [r2] - ldr r3, =0x00002016 - adds r1, r3 - adds r1, r5 - ldrb r1, [r1] - bl StartObjectImageAnim -_080E09D8: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0xF - bls _080E090A - 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 BuyMenuDrawFieldObjects - - thumb_func_start BuyMenuCheckIfFieldObjectOverlapsMenuBg -BuyMenuCheckIfFieldObjectOverlapsMenuBg: @ 80E0A14 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2 - ldrsh r0, [r4, r1] - movs r2, 0x4 - ldrsh r1, [r4, r2] - adds r1, 0x2 - bl BuyMenuCheckForOverlapWithMenuBg - lsls r0, 24 - cmp r0, 0 - bne _080E0A38 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080E0A38 - movs r0, 0x1 - b _080E0A3A -_080E0A38: - movs r0, 0 -_080E0A3A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end BuyMenuCheckIfFieldObjectOverlapsMenuBg - - thumb_func_start BuyMenuCopyMenuBgToBg1TilemapBuffer -@ void BuyMenuCopyMenuBgToBg1TilemapBuffer() -BuyMenuCopyMenuBgToBg1TilemapBuffer: @ 80E0A40 - push {r4-r6,lr} - ldr r0, =0x02039f70 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 4 - adds r4, r0, r1 - adds r3, r0, 0 - movs r1, 0 - ldr r0, =0x0000c3e3 - adds r6, r0, 0 - ldr r5, =0x000003ff -_080E0A56: - lsls r0, r1, 16 - asrs r2, r0, 16 - lsls r1, r2, 1 - adds r0, r1, r3 - ldrh r0, [r0] - cmp r0, 0 - beq _080E0A6A - adds r1, r4 - adds r0, r6 - strh r0, [r1] -_080E0A6A: - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - asrs r0, 16 - cmp r0, r5 - ble _080E0A56 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end BuyMenuCopyMenuBgToBg1TilemapBuffer - - thumb_func_start BuyMenuCheckForOverlapWithMenuBg -@ bool8 BuyMenuCheckForOverlapWithMenuBg(u16 x, u16 y) -BuyMenuCheckForOverlapWithMenuBg: @ 80E0A88 - push {lr} - ldr r2, =0x02039f70 - ldr r2, [r2] - lsls r0, 1 - lsls r1, 6 - adds r1, r0 - lsls r1, 1 - adds r1, r2 - ldrh r0, [r1] - cmp r0, 0 - bne _080E0AC0 - adds r0, r1, 0 - adds r0, 0x40 - ldrh r0, [r0] - cmp r0, 0 - bne _080E0AC0 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _080E0AC0 - adds r0, r1, 0 - adds r0, 0x42 - ldrh r0, [r0] - cmp r0, 0 - bne _080E0AC0 - movs r0, 0x1 - b _080E0AC2 - .pool -_080E0AC0: - movs r0, 0 -_080E0AC2: - pop {r1} - bx r1 - thumb_func_end BuyMenuCheckForOverlapWithMenuBg - - thumb_func_start Task_BuyMenu -@ void Task_BuyMenu(u8 taskId) -Task_BuyMenu: @ 80E0AC8 - 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, =0x03005e08 - adds r4, r0, r1 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080E0AEA - b _080E0C8E -_080E0AEA: - ldrb r0, [r4, 0xE] - bl ListMenuHandleInput - adds r5, r0, 0 - ldrb r0, [r4, 0xE] - ldr r7, =0x02039f70 - ldr r2, [r7] - ldr r3, =0x00002008 - adds r1, r2, r3 - subs r3, 0x2 - adds r2, r3 - bl get_coro_args_x18_x1A - movs r0, 0x2 - negs r0, r0 - cmp r5, r0 - beq _080E0B24 - adds r0, 0x1 - cmp r5, r0 - bne _080E0B32 - b _080E0C8E - .pool -_080E0B24: - movs r0, 0x5 - bl audio_play - adds r0, r6, 0 - bl ExitBuyMenu - b _080E0C8E -_080E0B32: - movs r0, 0x5 - bl audio_play - strh r5, [r4, 0xA] - movs r0, 0x2 - bl ClearWindowTilemap - bl BuyMenuRemoveScrollIndicatorArrows - ldrb r0, [r4, 0xE] - movs r1, 0x2 - bl BuyMenuPrintCursor - ldr r0, =0x02039f60 - ldrb r0, [r0, 0xF] - cmp r0, 0 - bne _080E0B80 - lsls r0, r5, 16 - lsrs r0, 16 - bl itemid_get_market_price - adds r4, r0, 0 - movs r0, 0x1 - bl GetPriceReduction - ldr r1, [r7] - movs r2, 0x80 - lsls r2, 6 - adds r1, r2 - lsls r4, 16 - lsrs r4, 16 - lsls r0, 24 - lsrs r0, 24 - asrs r4, r0 - str r4, [r1] - b _080E0B92 - .pool -_080E0B80: - ldr r1, [r7] - movs r3, 0x80 - lsls r3, 6 - adds r1, r3 - ldr r2, =gUnknown_085A5C08 - lsls r0, r5, 5 - adds r0, r2 - ldrh r0, [r0, 0x14] - str r0, [r1] -_080E0B92: - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - ldr r2, =0x02039f70 - mov r8, r2 - ldr r1, [r2] - movs r7, 0x80 - lsls r7, 6 - adds r1, r7 - ldr r1, [r1] - bl IsEnoughMoney - lsls r0, 24 - cmp r0, 0 - bne _080E0BD0 - ldr r1, =gUnknown_085E9539 - ldr r2, =BuyMenuReturnToItemList - b _080E0C28 - .pool -_080E0BD0: - ldr r4, =0x02039f60 - ldrb r0, [r4, 0xF] - cmp r0, 0 - bne _080E0C38 - lsls r0, r5, 16 - lsrs r5, r0, 16 - ldr r1, =0x02021cc4 - adds r0, r5, 0 - bl itemid_get_name - adds r0, r5, 0 - bl itemid_get_pocket_number - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _080E0C24 - ldr r4, =0x02021dc4 - 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 CopyString - ldr r1, =gUnknown_085E9417 - b _080E0C26 - .pool -_080E0C24: - ldr r1, =gUnknown_085E93EF -_080E0C26: - ldr r2, =Task_BuyHowManyDialogueInit -_080E0C28: - adds r0, r6, 0 - bl BuyMenuDisplayMessage - b _080E0C8E - .pool -_080E0C38: - ldr r0, =0x02021cc4 - lsls r1, r5, 5 - ldr r2, =gUnknown_085A5C09 - adds r1, r2 - bl CopyString - ldr r0, =0x02021dc4 - mov r3, r8 - ldr r1, [r3] - adds r1, r7 - ldr r1, [r1] - movs r2, 0 - movs r3, 0x6 - bl ConvertIntToDecimalString - ldrb r0, [r4, 0xF] - cmp r0, 0x1 - bne _080E0C7C - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E9468 - bl ExpandStringRefs - b _080E0C84 - .pool -_080E0C7C: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E9493 - bl ExpandStringRefs -_080E0C84: - ldr r1, =0x02021fc4 - ldr r2, =BuyMenuConfirmPurchase - adds r0, r6, 0 - bl BuyMenuDisplayMessage -_080E0C8E: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end Task_BuyMenu - - thumb_func_start Task_BuyHowManyDialogueInit -@ void Task_BuyHowManyDialogueInit(u8 taskId) -Task_BuyHowManyDialogueInit: @ 80E0CA4 - push {r4-r6,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r5, r6, 2 - adds r5, r6 - lsls r5, 3 - ldr r0, =0x03005e08 - adds r5, r0 - ldrh r0, [r5, 0xA] - bl CountTotalItemQuantityInBag - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0x3 - movs r1, 0 - movs r2, 0x1 - movs r3, 0xD - bl SetWindowBorderStyle - ldr r0, =0x02021cc4 - adds r1, r4, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E93D5 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x3 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl BuyMenuPrint - movs r0, 0x1 - strh r0, [r5, 0x2] - movs r0, 0x4 - movs r1, 0 - movs r2, 0x1 - movs r3, 0xD - bl SetWindowBorderStyle - adds r0, r6, 0 - bl BuyMenuPrintItemQuantityAndPrice - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - bl DecryptMoney - ldr r1, =0x02039f70 - ldr r4, [r1] - movs r2, 0x80 - lsls r2, 6 - adds r1, r4, r2 - ldr r1, [r1] - bl __udivsi3 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x63 - bls _080E0D60 - ldr r0, =0x0000200a - adds r1, r4, r0 - movs r0, 0x63 - strb r0, [r1] - b _080E0D66 - .pool -_080E0D60: - ldr r2, =0x0000200a - adds r0, r4, r2 - strb r1, [r0] -_080E0D66: - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =Task_BuyHowManyDialogueHandleInput - str r0, [r1] - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end Task_BuyHowManyDialogueInit - - thumb_func_start Task_BuyHowManyDialogueHandleInput -@ void Task_BuyHowManyDialogueHandleInput(u8 taskId) -Task_BuyHowManyDialogueHandleInput: @ 80E0D88 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - adds r4, r6, 0 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - adds r0, r5, 0x2 - ldr r7, =0x02039f70 - ldr r1, [r7] - ldr r2, =0x0000200a - adds r1, r2 - ldrb r1, [r1] - bl AdjustQuantityAccordingToDPadInput - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E0DF0 - ldrh r0, [r5, 0xA] - bl itemid_get_market_price - adds r4, r0, 0 - movs r0, 0x1 - bl GetPriceReduction - ldr r1, [r7] - movs r2, 0x80 - lsls r2, 6 - adds r1, r2 - lsls r4, 16 - lsrs r4, 16 - lsls r0, 24 - lsrs r0, 24 - asrs r4, r0 - movs r2, 0x2 - ldrsh r0, [r5, r2] - muls r0, r4 - str r0, [r1] - adds r0, r6, 0 - bl BuyMenuPrintItemQuantityAndPrice - b _080E0EA4 - .pool -_080E0DF0: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080E0E74 - movs r0, 0x5 - bl audio_play - movs r0, 0x4 - movs r1, 0 - bl sub_8198070 - movs r0, 0x3 - movs r1, 0 - bl sub_8198070 - movs r0, 0x4 - bl ClearWindowTilemap - movs r0, 0x3 - bl ClearWindowTilemap - movs r0, 0x1 - bl PutWindowTilemap - ldrh r0, [r5, 0xA] - ldr r1, =0x02021cc4 - bl itemid_get_name - ldr r0, =0x02021dc4 - movs r2, 0x2 - ldrsh r1, [r5, r2] - movs r2, 0 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, =0x02021ec4 - ldr r1, [r7] - movs r2, 0x80 - lsls r2, 6 - adds r1, r2 - ldr r1, [r1] - movs r2, 0 - movs r3, 0x6 - bl ConvertIntToDecimalString - ldr r1, =gUnknown_085E943F - ldr r2, =BuyMenuConfirmPurchase - adds r0, r6, 0 - bl BuyMenuDisplayMessage - b _080E0EA4 - .pool -_080E0E74: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080E0EA4 - movs r0, 0x5 - bl audio_play - movs r0, 0x4 - movs r1, 0 - bl sub_8198070 - movs r0, 0x3 - movs r1, 0 - bl sub_8198070 - movs r0, 0x4 - bl ClearWindowTilemap - movs r0, 0x3 - bl ClearWindowTilemap - adds r0, r4, 0 - bl BuyMenuReturnToItemList -_080E0EA4: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end Task_BuyHowManyDialogueHandleInput - - thumb_func_start BuyMenuConfirmPurchase -@ void BuyMenuConfirmPurchase(u8 taskId) -BuyMenuConfirmPurchase: @ 80E0EAC - push {lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_08589AA8 - movs r2, 0 - str r2, [sp] - movs r2, 0x1 - str r2, [sp, 0x4] - movs r2, 0xD - str r2, [sp, 0x8] - ldr r2, =gUnknown_08589A08 - str r2, [sp, 0xC] - movs r2, 0x1 - movs r3, 0 - bl CreateYesNoMenuWithCallbacks - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end BuyMenuConfirmPurchase - - thumb_func_start BuyMenuTryMakePurchase -@ void BuyMenuTryMakePurchase(u8 taskId) -BuyMenuTryMakePurchase: @ 80E0EDC - 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, =0x03005e08 - adds r4, r0, r1 - movs r0, 0x1 - bl PutWindowTilemap - ldr r6, =0x02039f60 - ldrb r0, [r6, 0xF] - cmp r0, 0 - bne _080E0F40 - ldrh r0, [r4, 0xA] - ldrh r1, [r4, 0x2] - bl bag_add_item - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E0F30 - ldr r1, =gUnknown_085E94C5 - ldr r2, =BuyMenuSubtractMoney - adds r0, r5, 0 - bl BuyMenuDisplayMessage - adds r0, r5, 0 - bl RecordItemPurchase - b _080E0F7A - .pool -_080E0F30: - ldr r1, =gUnknown_085E9558 - ldr r2, =BuyMenuReturnToItemList - b _080E0F60 - .pool -_080E0F40: - ldrb r0, [r4, 0xA] - bl IsThereStorageSpaceForDecoration - lsls r0, 24 - cmp r0, 0 - beq _080E0F70 - ldrb r0, [r6, 0xF] - cmp r0, 0x1 - bne _080E0F5C - ldr r1, =gUnknown_085E94E7 - b _080E0F5E - .pool -_080E0F5C: - ldr r1, =gUnknown_085E9510 -_080E0F5E: - ldr r2, =BuyMenuSubtractMoney -_080E0F60: - adds r0, r5, 0 - bl BuyMenuDisplayMessage - b _080E0F7A - .pool -_080E0F70: - ldr r1, =gUnknown_085E957F - ldr r2, =BuyMenuReturnToItemList - adds r0, r7, 0 - bl BuyMenuDisplayMessage -_080E0F7A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end BuyMenuTryMakePurchase - - thumb_func_start BuyMenuSubtractMoney -@ void BuyMenuSubtractMoney(u8 taskId) -BuyMenuSubtractMoney: @ 80E0F88 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0x26 - bl sav12_xor_increment - ldr r5, =0x03005d8c - ldr r0, [r5] - movs r4, 0x92 - lsls r4, 3 - adds r0, r4 - ldr r1, =0x02039f70 - ldr r1, [r1] - movs r2, 0x80 - lsls r2, 6 - adds r1, r2 - ldr r1, [r1] - bl subtract_money - movs r0, 0x5F - bl audio_play - ldr r0, [r5] - adds r0, r4 - bl DecryptMoney - adds r1, r0, 0 - movs r0, 0 - movs r2, 0 - bl PrintMoneyAmountInMoneyBox - ldr r0, =0x02039f60 - ldrb r0, [r0, 0xF] - cmp r0, 0 - bne _080E0FF0 - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =Task_ReturnToItemListAfterItemPurchase - b _080E0FFC - .pool -_080E0FF0: - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =Task_ReturnToItemListAfterDecorationPurchase -_080E0FFC: - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end BuyMenuSubtractMoney - - thumb_func_start Task_ReturnToItemListAfterItemPurchase -@ void Task_ReturnToItemListAfterItemPurchase(u8 taskId) -Task_ReturnToItemListAfterItemPurchase: @ 80E100C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _080E1072 - movs r0, 0x5 - bl audio_play - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0x4 - bne _080E106C - movs r1, 0x2 - ldrsh r0, [r5, r1] - cmp r0, 0x9 - ble _080E106C - movs r0, 0xC - movs r1, 0x1 - bl bag_add_item - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E106C - ldr r1, =gUnknown_085E95EA - ldr r2, =BuyMenuReturnToItemList - adds r0, r4, 0 - bl BuyMenuDisplayMessage - b _080E1072 - .pool -_080E106C: - adds r0, r4, 0 - bl BuyMenuReturnToItemList -_080E1072: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end Task_ReturnToItemListAfterItemPurchase - - thumb_func_start Task_ReturnToItemListAfterDecorationPurchase -@ void Task_ReturnToItemListAfterDecorationPurchase(u8 taskId) -Task_ReturnToItemListAfterDecorationPurchase: @ 80E1078 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _080E1096 - movs r0, 0x5 - bl audio_play - adds r0, r4, 0 - bl BuyMenuReturnToItemList -_080E1096: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end Task_ReturnToItemListAfterDecorationPurchase - - thumb_func_start BuyMenuReturnToItemList -@ void BuyMenuReturnToItemList(u8 taskId) -BuyMenuReturnToItemList: @ 80E10A0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r5, =0x03005e08 - adds r6, r4, r5 - movs r0, 0x5 - movs r1, 0 - bl sub_8197DF8 - ldrb r0, [r6, 0xE] - movs r1, 0x1 - bl BuyMenuPrintCursor - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x2 - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - bl BuyMenuAddScrollIndicatorArrows - subs r5, 0x8 - adds r4, r5 - ldr r0, =Task_BuyMenu - str r0, [r4] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end BuyMenuReturnToItemList - - thumb_func_start BuyMenuPrintItemQuantityAndPrice -@ void BuyMenuPrintItemQuantityAndPrice(u8 taskId) -BuyMenuPrintItemQuantityAndPrice: @ 80E10EC - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e08 - adds r4, r0 - movs r0, 0x4 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =0x02039f70 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 6 - adds r0, r1 - ldr r3, [r0] - movs r0, 0xFF - str r0, [sp] - movs r0, 0x4 - movs r1, 0x26 - movs r2, 0x1 - bl PrintMoneyAmount - ldr r0, =0x02021cc4 - movs r2, 0x2 - ldrsh r1, [r4, r2] - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E8DA0 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x4 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl BuyMenuPrint - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end BuyMenuPrintItemQuantityAndPrice - - thumb_func_start ExitBuyMenu -@ void ExitBuyMenu(u8 taskId) -ExitBuyMenu: @ 80E1168 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =0x03005dac - ldr r0, =MapPostLoadHook_ExitBuyOrSellMenu - str r0, [r1] - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =Task_ExitBuyMenu - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ExitBuyMenu - - thumb_func_start Task_ExitBuyMenu -@ void Task_ExitBuyMenu(u8 taskId) -Task_ExitBuyMenu: @ 80E11B0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080E11D6 - bl RemoveMoneyLabelObject - bl BuyMenuFreeMemory - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - adds r0, r4, 0 - bl DestroyTask -_080E11D6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end Task_ExitBuyMenu - - thumb_func_start ClearItemPurchases -@ void ClearItemPurchases() -ClearItemPurchases: @ 80E11E4 - push {lr} - ldr r0, =0x02039f7c - movs r1, 0 - strb r1, [r0] - ldr r0, =0x02039f80 - movs r1, 0 - movs r2, 0xC - bl memset - pop {r0} - bx r0 - .pool - thumb_func_end ClearItemPurchases - - thumb_func_start RecordItemPurchase -@ void RecordItemPurchase(u8 taskId) -RecordItemPurchase: @ 80E1204 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r4, r1, r0 - movs r3, 0 - ldr r5, =0x02039f80 - adds r6, r5, 0 -_080E121A: - lsls r0, r3, 2 - adds r2, r0, r6 - ldrh r1, [r2] - movs r7, 0xA - ldrsh r0, [r4, r7] - cmp r1, r0 - bne _080E1250 - ldrh r0, [r2, 0x2] - cmp r0, 0 - beq _080E1250 - adds r1, r0, 0 - movs r3, 0x2 - ldrsh r0, [r4, r3] - adds r0, r1, r0 - cmp r0, 0xFF - ble _080E1248 - movs r0, 0xFF - strh r0, [r2, 0x2] - b _080E127A - .pool -_080E1248: - ldrh r0, [r4, 0x2] - adds r0, r1, r0 - strh r0, [r2, 0x2] - b _080E127A -_080E1250: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x2 - bls _080E121A - ldr r2, =0x02039f7c - ldrb r0, [r2] - cmp r0, 0x2 - bhi _080E127A - lsls r0, 2 - adds r0, r5 - ldrh r1, [r4, 0xA] - strh r1, [r0] - ldrb r0, [r2] - lsls r0, 2 - adds r0, r5 - ldrh r1, [r4, 0x2] - strh r1, [r0, 0x2] - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] -_080E127A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end RecordItemPurchase - - thumb_func_start CreatePokemartMenu -@ void CreatePokemartMenu(u16 *itemsForSale) -CreatePokemartMenu: @ 80E1284 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0 - bl CreateShopMenu - adds r0, r4, 0 - bl SetShopItemsForSale - bl ClearItemPurchases - ldr r0, =script_env_2_enable_and_set_ctx_running - bl SetShopMenuCallback - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end CreatePokemartMenu - - thumb_func_start CreateDecorationShop1Menu -@ void CreateDecorationShop1Menu(u16 *itemsForSale) -CreateDecorationShop1Menu: @ 80E12A8 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x1 - bl CreateShopMenu - adds r0, r4, 0 - bl SetShopItemsForSale - ldr r0, =script_env_2_enable_and_set_ctx_running - bl SetShopMenuCallback - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end CreateDecorationShop1Menu - - thumb_func_start CreateDecorationShop2Menu -@ void CreateDecorationShop2Menu(u16 *itemsForSale) -CreateDecorationShop2Menu: @ 80E12C8 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x2 - bl CreateShopMenu - adds r0, r4, 0 - bl SetShopItemsForSale - ldr r0, =script_env_2_enable_and_set_ctx_running - bl SetShopMenuCallback - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end CreateDecorationShop2Menu - - thumb_func_start sub_80E12E8 -sub_80E12E8: @ 80E12E8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - mov r9, r1 - lsls r0, 24 - lsrs r0, 24 - lsls r2, 16 - lsrs r2, 16 - mov r10, r2 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrh r0, [r1, 0x10] - subs r0, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldrh r0, [r1, 0x12] - subs r0, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - ldrh r4, [r1, 0xA] - movs r2, 0xC - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _080E13AC - movs r2, 0 - lsls r5, 16 - str r5, [sp, 0xC] - lsls r0, r3, 16 - lsls r1, r4, 16 - asrs r0, 16 - str r0, [sp] - asrs r1, 16 - str r1, [sp, 0x4] - lsls r0, r1, 1 - mov r1, r9 - adds r7, r0, r1 -_080E133C: - movs r4, 0 - lsls r2, 16 - mov r8, r2 - asrs r0, r2, 16 - ldr r2, [sp] - adds r6, r2, r0 -_080E1348: - ldr r0, [sp, 0xC] - asrs r1, r0, 16 - lsls r4, 16 - asrs r0, r4, 16 - adds r5, r1, r0 - adds r0, r5, 0 - adds r1, r6, 0 - bl MapGridGetMetatileIdAt - movs r2, 0 - ldrsh r1, [r7, r2] - lsls r0, 16 - asrs r0, 16 - cmp r1, r0 - bne _080E1390 - ldr r0, [sp, 0x4] - cmp r0, 0x2 - beq _080E1380 - ldrh r0, [r7, 0x2] - mov r2, r10 - orrs r2, r0 - adds r0, r5, 0 - adds r1, r6, 0 - bl MapGridSetMetatileIdAt - b _080E1390 - .pool -_080E1380: - mov r1, r9 - ldrh r0, [r1] - mov r2, r10 - orrs r2, r0 - adds r0, r5, 0 - adds r1, r6, 0 - bl MapGridSetMetatileIdAt -_080E1390: - movs r2, 0x80 - lsls r2, 9 - adds r0, r4, r2 - lsrs r4, r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _080E1348 - adds r0, r2, 0 - add r0, r8 - lsrs r2, r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _080E133C - b _080E1434 -_080E13AC: - movs r2, 0 - lsls r5, 16 - str r5, [sp, 0xC] - lsls r0, r3, 16 - lsls r1, r4, 16 - asrs r0, 16 - str r0, [sp, 0x8] - asrs r7, r1, 16 -_080E13BC: - movs r4, 0 - lsls r2, 16 - mov r8, r2 - asrs r0, r2, 16 - ldr r1, [sp, 0x8] - adds r6, r1, r0 -_080E13C8: - ldr r2, [sp, 0xC] - asrs r1, r2, 16 - lsls r4, 16 - asrs r0, r4, 16 - adds r5, r1, r0 - adds r0, r5, 0 - adds r1, r6, 0 - bl MapGridGetMetatileIdAt - movs r1, 0x2 - subs r1, r7 - lsls r1, 1 - add r1, r9 - movs r2, 0 - ldrsh r1, [r1, r2] - lsls r0, 16 - asrs r0, 16 - cmp r1, r0 - bne _080E141A - cmp r7, 0x2 - beq _080E140A - movs r0, 0x1 - subs r0, r7 - lsls r0, 1 - add r0, r9 - ldrh r0, [r0] - mov r2, r10 - orrs r2, r0 - adds r0, r5, 0 - adds r1, r6, 0 - bl MapGridSetMetatileIdAt - b _080E141A -_080E140A: - mov r1, r9 - ldrh r0, [r1, 0x4] - mov r2, r10 - orrs r2, r0 - adds r0, r5, 0 - adds r1, r6, 0 - bl MapGridSetMetatileIdAt -_080E141A: - movs r2, 0x80 - lsls r2, 9 - adds r0, r4, r2 - lsrs r4, r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _080E13C8 - adds r0, r2, 0 - add r0, r8 - lsrs r2, r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _080E13BC -_080E1434: - 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_80E12E8 - - thumb_func_start sub_80E1444 -sub_80E1444: @ 80E1444 - push {r4,r5,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - movs r0, 0x1 - strh r0, [r4, 0x6] - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x6 - bhi _080E14DE - lsls r0, 2 - ldr r1, =_080E1474 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080E1474: - .4byte _080E1490 - .4byte _080E1498 - .4byte _080E14A0 - .4byte _080E14A8 - .4byte _080E14B0 - .4byte _080E14C4 - .4byte _080E14D4 -_080E1490: - ldr r1, =gUnknown_08589ABA - b _080E14C6 - .pool -_080E1498: - ldr r1, =gUnknown_08589AC0 - b _080E14C6 - .pool -_080E14A0: - ldr r1, =gUnknown_08589AC6 - b _080E14B2 - .pool -_080E14A8: - ldr r1, =gUnknown_08589ACC - b _080E14C6 - .pool -_080E14B0: - ldr r1, =gUnknown_08589AD2 -_080E14B2: - movs r2, 0xC0 - lsls r2, 4 - adds r0, r3, 0 - bl sub_80E12E8 - b _080E14DE - .pool -_080E14C4: - ldr r1, =gUnknown_08589AD8 -_080E14C6: - adds r0, r3, 0 - movs r2, 0 - bl sub_80E12E8 - b _080E14DE - .pool -_080E14D4: - ldr r1, =gUnknown_08589ADE - adds r0, r3, 0 - movs r2, 0 - bl sub_80E12E8 -_080E14DE: - ldrh r0, [r4] - adds r0, 0x1 - movs r1, 0x7 - ands r0, r1 - strh r0, [r4] - adds r5, r0, 0 - cmp r5, 0 - bne _080E1502 - bl DrawWholeMapView - movs r1, 0x2 - ldrsh r0, [r4, r1] - adds r0, 0x1 - movs r1, 0x3 - bl __modsi3 - strh r0, [r4, 0x2] - strh r5, [r4, 0x6] -_080E1502: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E1444 - - thumb_func_start sub_80E150C -sub_80E150C: @ 80E150C - push {r4-r7,lr} - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - ldr r6, =sub_80E1444 - adds r0, r6, 0 - movs r1, 0 - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r7, r0, r1 - adds r0, r7, 0 - adds r0, 0x8 - adds r1, r7, 0 - adds r1, 0xA - bl PlayerGetDestCoords - movs r0, 0 - strh r0, [r7] - strh r0, [r7, 0x2] - strh r5, [r7, 0x4] - adds r0, r4, 0 - bl _call_via_r6 - adds r0, r4, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E150C - - thumb_func_start sub_80E1558 -sub_80E1558: @ 80E1558 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_80E150C - ldr r1, =0x02039f8c - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E1558 - - thumb_func_start sub_80E1570 -sub_80E1570: @ 80E1570 - push {lr} - ldr r0, =0x02039f8c - ldrb r0, [r0] - bl DestroyTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E1570 - - thumb_func_start sub_80E1584 -sub_80E1584: @ 80E1584 - push {lr} - ldr r2, =0x03005e00 - ldr r0, =0x02039f8c - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r1, r0, r2 - movs r2, 0xE - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _080E15B0 - movs r2, 0xA - ldrsh r0, [r1, r2] - cmp r0, 0x2 - bne _080E15B0 - movs r0, 0 - b _080E15B2 - .pool -_080E15B0: - movs r0, 0x1 -_080E15B2: - pop {r1} - bx r1 - thumb_func_end sub_80E1584 - - thumb_func_start sub_80E15B8 -sub_80E15B8: @ 80E15B8 - push {lr} - sub sp, 0x4 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x000031f8 - adds r1, r0 - ldr r2, =0x0100001a - mov r0, sp - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E15B8 - - thumb_func_start sub_80E15E4 -sub_80E15E4: @ 80E15E4 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000031f8 - adds r3, r0, r1 - movs r2, 0 -_080E15F2: - adds r0, r3, r2 - adds r1, r4, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x33 - bls _080E15F2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E15E4 - - thumb_func_start sub_80E1610 -sub_80E1610: @ 80E1610 - push {lr} - adds r3, r0, 0 - movs r2, 0 - movs r1, 0 -_080E1618: - adds r0, r3, r1 - ldrb r0, [r0] - adds r2, r0 - adds r1, 0x1 - cmp r1, 0x2F - bls _080E1618 - adds r0, r2, 0 - pop {r1} - bx r1 - thumb_func_end sub_80E1610 - - thumb_func_start sub_80E162C -sub_80E162C: @ 80E162C - push {r4,lr} - ldr r4, =0x03005d8c - ldr r1, [r4] - ldr r2, =0x0000320c - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080E1674 - ldr r2, =0x00003202 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080E1674 - ldr r2, =0x000031f8 - adds r0, r1, r2 - bl sub_80E1610 - ldr r1, [r4] - ldr r2, =0x00003228 - adds r1, r2 - ldr r1, [r1] - cmp r0, r1 - bne _080E1674 - movs r0, 0x1 - b _080E1676 - .pool -_080E1674: - movs r0, 0 -_080E1676: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80E162C - - thumb_func_start GetBerryInfo -@ struct berry_info *GetBerryInfo(u8 berryType) -GetBerryInfo: @ 80E167C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2B - bne _080E16A0 - bl sub_80E162C - cmp r0, 0 - beq _080E16A0 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000031f8 - b _080E16B4 - .pool -_080E16A0: - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2A - bls _080E16AC - movs r4, 0x1 -_080E16AC: - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - ldr r1, =gBerries - 0x1c @ 1-based array -_080E16B4: - adds r0, r1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetBerryInfo - - thumb_func_start GetBerryTreeInfo -@ struct BerryTreeInfo *GetBerryTreeInfo(u8 berryTreeId) -GetBerryTreeInfo: @ 80E16C0 - lsls r0, 24 - ldr r1, =0x03005d8c - lsrs r0, 21 - ldr r2, =0x0000169c - adds r0, r2 - ldr r1, [r1] - adds r1, r0 - adds r0, r1, 0 - bx lr - .pool - thumb_func_end GetBerryTreeInfo - - thumb_func_start FieldObjectInteractionWaterBerryTree -@ bool8 FieldObjectInteractionWaterBerryTree() -FieldObjectInteractionWaterBerryTree: @ 80E16DC - push {lr} - ldr r0, =0x03005df0 - ldrb r0, [r0] - bl FieldObjectGetBerryTreeId - lsls r0, 24 - lsrs r0, 24 - bl GetBerryTreeInfo - adds r2, r0, 0 - ldrb r0, [r2, 0x1] - lsls r0, 25 - lsrs r0, 25 - cmp r0, 0x2 - beq _080E1718 - cmp r0, 0x2 - bgt _080E1708 - cmp r0, 0x1 - beq _080E1712 - b _080E172E - .pool -_080E1708: - cmp r0, 0x3 - beq _080E171E - cmp r0, 0x4 - beq _080E1724 - b _080E172E -_080E1712: - ldrb r0, [r2, 0x5] - movs r1, 0x10 - b _080E1728 -_080E1718: - ldrb r0, [r2, 0x5] - movs r1, 0x20 - b _080E1728 -_080E171E: - ldrb r0, [r2, 0x5] - movs r1, 0x40 - b _080E1728 -_080E1724: - ldrb r0, [r2, 0x5] - movs r1, 0x80 -_080E1728: - orrs r0, r1 - strb r0, [r2, 0x5] - b _080E1732 -_080E172E: - movs r0, 0 - b _080E1734 -_080E1732: - movs r0, 0x1 -_080E1734: - pop {r1} - bx r1 - thumb_func_end FieldObjectInteractionWaterBerryTree - - thumb_func_start IsPlayerFacingPlantedBerryTree -@ bool8 IsPlayerFacingPlantedBerryTree() -IsPlayerFacingPlantedBerryTree: @ 80E1738 - push {lr} - bl GetFieldObjectScriptPointerForComparison - ldr r1, =gUnknown_082742F9 - cmp r0, r1 - bne _080E1768 - ldr r0, =0x03005df0 - ldrb r0, [r0] - bl FieldObjectGetBerryTreeId - lsls r0, 24 - lsrs r0, 24 - bl GetStageByBerryTreeId - lsls r0, 24 - cmp r0, 0 - bne _080E1768 - movs r0, 0x1 - b _080E176A - .pool -_080E1768: - movs r0, 0 -_080E176A: - pop {r1} - bx r1 - thumb_func_end IsPlayerFacingPlantedBerryTree - - thumb_func_start WaterBerryTree -@ bool8 WaterBerryTree() -WaterBerryTree: @ 80E1770 - push {lr} - bl GetFieldObjectScriptPointerForComparison - ldr r1, =gUnknown_082742F9 - cmp r0, r1 - bne _080E178C - bl FieldObjectInteractionWaterBerryTree - lsls r0, 24 - lsrs r0, 24 - b _080E178E - .pool -_080E178C: - movs r0, 0 -_080E178E: - pop {r1} - bx r1 - thumb_func_end WaterBerryTree - - thumb_func_start RemoveAllBerryTrees -@ void RemoveAllBerryTrees() -RemoveAllBerryTrees: @ 80E1794 - push {r4-r6,lr} - movs r2, 0 - ldr r6, =0x03005d8c - ldr r5, =0x0000169c - ldr r0, =gUnknown_0858ABD0 - ldr r3, [r0] - ldr r4, [r0, 0x4] -_080E17A2: - ldr r0, [r6] - lsls r1, r2, 3 - adds r0, r1 - adds r0, r5 - str r3, [r0] - str r4, [r0, 0x4] - adds r2, 0x1 - cmp r2, 0x7F - ble _080E17A2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end RemoveAllBerryTrees - - thumb_func_start BerryTreeGrow -@ bool8 BerryTreeGrow(struct BerryTreeInfo *berryTree) -BerryTreeGrow: @ 80E17C8 - push {r4,lr} - adds r4, r0, 0 - ldrb r1, [r4, 0x1] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080E17DA -_080E17D6: - movs r0, 0 - b _080E1866 -_080E17DA: - lsls r0, r1, 25 - lsrs r0, 25 - cmp r0, 0x5 - bhi _080E1864 - lsls r0, 2 - ldr r1, =_080E17F0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080E17F0: - .4byte _080E17D6 - .4byte _080E1810 - .4byte _080E1810 - .4byte _080E1810 - .4byte _080E1808 - .4byte _080E1828 -_080E1808: - adds r0, r4, 0 - bl CalcBerryYield - strb r0, [r4, 0x4] -_080E1810: - ldrb r2, [r4, 0x1] - lsls r1, r2, 25 - lsrs r1, 25 - adds r1, 0x1 - movs r0, 0x7F - ands r1, r0 - movs r0, 0x80 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x1] - b _080E1864 -_080E1828: - ldrb r0, [r4, 0x5] - movs r1, 0x11 - negs r1, r1 - ands r1, r0 - movs r0, 0x21 - negs r0, r0 - ands r1, r0 - subs r0, 0x20 - ands r1, r0 - movs r0, 0x7F - ands r1, r0 - movs r0, 0 - strb r0, [r4, 0x4] - ldrb r2, [r4, 0x1] - subs r0, 0x80 - ands r0, r2 - movs r2, 0x2 - orrs r0, r2 - strb r0, [r4, 0x1] - adds r1, 0x1 - movs r0, 0xF - ands r1, r0 - strb r1, [r4, 0x5] - cmp r1, 0xA - bne _080E1864 - ldr r0, =gUnknown_0858ABD0 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r4] - str r1, [r4, 0x4] -_080E1864: - movs r0, 0x1 -_080E1866: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end BerryTreeGrow - - thumb_func_start BerryTreeTimeUpdate -@ void BerryTreeTimeUpdate(s32 deltaSeconds) -BerryTreeTimeUpdate: @ 80E1870 - push {r4-r7,lr} - adds r6, r0, 0 - movs r2, 0 -_080E1876: - ldr r1, =0x03005d8c - lsls r0, r2, 3 - ldr r3, =0x0000169c - adds r0, r3 - ldr r1, [r1] - adds r4, r1, r0 - ldrb r0, [r4] - adds r7, r2, 0x1 - cmp r0, 0 - beq _080E1910 - ldrb r1, [r4, 0x1] - movs r0, 0x7F - ands r0, r1 - cmp r0, 0 - beq _080E1910 - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080E1910 - ldrb r0, [r4] - bl GetStageDurationByBerryType - lsls r0, 16 - lsrs r0, 16 - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 3 - subs r1, r0 - cmp r6, r1 - blt _080E18CC - ldr r0, =gUnknown_0858ABD0 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r4] - str r1, [r4, 0x4] - b _080E1910 - .pool -_080E18CC: - adds r5, r6, 0 - cmp r5, 0 - beq _080E1910 - ldrh r1, [r4, 0x2] - cmp r1, r5 - ble _080E18DC - subs r0, r1, r5 - b _080E190E -_080E18DC: - subs r5, r1 - ldrb r0, [r4] - bl GetStageDurationByBerryType - strh r0, [r4, 0x2] - adds r0, r4, 0 - bl BerryTreeGrow - cmp r0, 0 - beq _080E1910 - ldrb r1, [r4, 0x1] - movs r0, 0x7F - ands r0, r1 - cmp r0, 0x5 - bne _080E1900 - ldrh r0, [r4, 0x2] - lsls r0, 2 - strh r0, [r4, 0x2] -_080E1900: - cmp r5, 0 - beq _080E1910 - ldrh r0, [r4, 0x2] - adds r1, r0, 0 - cmp r0, r5 - ble _080E18DC - subs r0, r5 -_080E190E: - strh r0, [r4, 0x2] -_080E1910: - adds r2, r7, 0 - cmp r2, 0x7F - ble _080E1876 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end BerryTreeTimeUpdate - - thumb_func_start PlantBerryTree -@ void PlantBerryTree(u8 berryTreeId, u8 berryType, u8 stage, u8 a4) -PlantBerryTree: @ 80E191C - push {r4-r7,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r3, 24 - lsrs r7, r3, 24 - bl GetBerryTreeInfo - adds r6, r0, 0 - ldr r0, =gUnknown_0858ABD0 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r6] - str r1, [r6, 0x4] - strb r4, [r6] - adds r0, r4, 0 - bl GetStageDurationByBerryType - strh r0, [r6, 0x2] - movs r1, 0x7F - ands r1, r5 - ldrb r2, [r6, 0x1] - movs r0, 0x80 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r6, 0x1] - cmp r5, 0x5 - bne _080E196E - adds r0, r6, 0 - bl CalcBerryYield - strb r0, [r6, 0x4] - ldrh r0, [r6, 0x2] - lsls r0, 2 - strh r0, [r6, 0x2] -_080E196E: - cmp r7, 0 - bne _080E197A - ldrb r0, [r6, 0x1] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r6, 0x1] -_080E197A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end PlantBerryTree - - thumb_func_start RemoveBerryTree -@ void RemoveBerryTree(u8 berryTreeId) -RemoveBerryTree: @ 80E1984 - lsls r0, 24 - ldr r1, =0x03005d8c - ldr r2, [r1] - lsrs r0, 21 - adds r2, r0 - ldr r0, =0x0000169c - adds r2, r0 - ldr r0, =gUnknown_0858ABD0 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r2] - str r1, [r2, 0x4] - bx lr - .pool - thumb_func_end RemoveBerryTree - - thumb_func_start GetBerryTypeByBerryTreeId -@ u8 GetBerryTypeByBerryTreeId(u8 berryTreeId) -GetBerryTypeByBerryTreeId: @ 80E19AC - lsls r0, 24 - ldr r1, =0x03005d8c - ldr r1, [r1] - lsrs r0, 21 - adds r1, r0 - ldr r0, =0x0000169c - adds r1, r0 - ldrb r0, [r1] - bx lr - .pool - thumb_func_end GetBerryTypeByBerryTreeId - - thumb_func_start GetStageByBerryTreeId -@ u8 GetStageByBerryTreeId(u8 berryTreeId) -GetStageByBerryTreeId: @ 80E19C8 - lsls r0, 24 - ldr r1, =0x03005d8c - ldr r1, [r1] - lsrs r0, 21 - adds r1, r0 - ldr r0, =0x0000169d - adds r1, r0 - ldrb r0, [r1] - lsls r0, 25 - lsrs r0, 25 - bx lr - .pool - thumb_func_end GetStageByBerryTreeId - - thumb_func_start ItemIdToBerryType -@ u8 ItemIdToBerryType(u16 itemId) -ItemIdToBerryType: @ 80E19E8 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - ldr r2, =0xff7b0000 - adds r0, r2 - lsrs r0, 16 - cmp r0, 0x2A - bhi _080E1A08 - adds r0, r1, 0 - adds r0, 0x7C - lsls r0, 24 - lsrs r0, 24 - b _080E1A0A - .pool -_080E1A08: - movs r0, 0x1 -_080E1A0A: - pop {r1} - bx r1 - thumb_func_end ItemIdToBerryType - - thumb_func_start BerryTypeToItemId -@ u16 BerryTypeToItemId(u16 berryType) -BerryTypeToItemId: @ 80E1A10 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - ldr r2, =0xffff0000 - adds r0, r2 - lsrs r0, 16 - cmp r0, 0x2A - bhi _080E1A30 - adds r0, r1, 0 - adds r0, 0x84 - lsls r0, 16 - lsrs r0, 16 - b _080E1A32 - .pool -_080E1A30: - movs r0, 0x85 -_080E1A32: - pop {r1} - bx r1 - thumb_func_end BerryTypeToItemId - - thumb_func_start GetBerryNameByBerryType -@ void GetBerryNameByBerryType(u8 berryType, u8 *dest) -GetBerryNameByBerryType: @ 80E1A38 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - bl GetBerryInfo - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0x6 - bl memcpy - movs r0, 0xFF - strb r0, [r4, 0x6] - pop {r4} - pop {r0} - bx r0 - thumb_func_end GetBerryNameByBerryType - - thumb_func_start GetBerryCountStringByBerryType -@ void GetBerryCountStringByBerryType(u8 berryType, u8 *dest, u32 berryCount) -GetBerryCountStringByBerryType: @ 80E1A58 - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r0, 24 - lsrs r0, 24 - bl GetBerryInfo - adds r1, r0, 0 - adds r0, r4, 0 - adds r2, r5, 0 - bl GetBerryCountString - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end GetBerryCountStringByBerryType - - thumb_func_start ResetBerryTreeSparkleFlag -@ void ResetBerryTreeSparkleFlag(u8 berryTreeId) -ResetBerryTreeSparkleFlag: @ 80E1A78 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetBerryTreeInfo - ldrb r2, [r0, 0x1] - movs r1, 0x7F - ands r1, r2 - strb r1, [r0, 0x1] - pop {r0} - bx r0 - thumb_func_end ResetBerryTreeSparkleFlag - - thumb_func_start BerryTreeGetNumStagesWatered -@ u8 BerryTreeGetNumStagesWatered(struct BerryTreeInfo *berryTree) -BerryTreeGetNumStagesWatered: @ 80E1A90 - push {lr} - ldrb r2, [r0, 0x5] - movs r0, 0x10 - ands r0, r2 - lsls r0, 24 - lsrs r0, 24 - negs r0, r0 - lsrs r1, r0, 31 - movs r0, 0x20 - ands r0, r2 - cmp r0, 0 - beq _080E1AAA - adds r1, 0x1 -_080E1AAA: - movs r0, 0x40 - ands r0, r2 - cmp r0, 0 - beq _080E1AB8 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 -_080E1AB8: - movs r0, 0x80 - ands r0, r2 - cmp r0, 0 - beq _080E1AC6 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 -_080E1AC6: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end BerryTreeGetNumStagesWatered - - thumb_func_start GetNumStagesWateredByBerryTreeId -@ u8 GetNumStagesWateredByBerryTreeId(u8 berryTreeId) -GetNumStagesWateredByBerryTreeId: @ 80E1ACC - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetBerryTreeInfo - bl BerryTreeGetNumStagesWatered - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end GetNumStagesWateredByBerryTreeId - - thumb_func_start CalcBerryYieldInternal -@ u8 CalcBerryYieldInternal(u16 max, u16 min, u8 numStagesWatered) -CalcBerryYieldInternal: @ 80E1AE4 - push {r4-r6,lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - lsrs r6, r1, 16 - lsls r2, 24 - lsrs r2, 24 - cmp r2, 0 - bne _080E1AFA - lsls r0, r6, 24 - b _080E1B2E -_080E1AFA: - subs r1, r0, r6 - subs r0, r2, 0x1 - adds r5, r1, 0 - muls r5, r0 - adds r4, r1, 0 - muls r4, r2 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - subs r4, r5 - adds r4, 0x1 - adds r1, r4, 0 - bl __umodsi3 - adds r5, r0 - movs r0, 0x3 - ands r0, r5 - cmp r0, 0x1 - bls _080E1B28 - lsrs r0, r5, 2 - adds r0, 0x1 - b _080E1B2A -_080E1B28: - lsrs r0, r5, 2 -_080E1B2A: - adds r0, r6 - lsls r0, 24 -_080E1B2E: - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end CalcBerryYieldInternal - - thumb_func_start CalcBerryYield -@ u8 CalcBerryYield(struct BerryTreeInfo *berryTree) -CalcBerryYield: @ 80E1B38 - push {r4-r6,lr} - adds r4, r0, 0 - ldrb r0, [r4] - bl GetBerryInfo - ldrb r6, [r0, 0xB] - ldrb r5, [r0, 0xA] - adds r0, r4, 0 - bl BerryTreeGetNumStagesWatered - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r5, 0 - adds r1, r6, 0 - bl CalcBerryYieldInternal - lsls r0, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end CalcBerryYield - - thumb_func_start GetBerryCountByBerryTreeId -@ u8 GetBerryCountByBerryTreeId(u8 berryTreeId) -GetBerryCountByBerryTreeId: @ 80E1B64 - lsls r0, 24 - ldr r1, =0x03005d8c - ldr r1, [r1] - lsrs r0, 21 - adds r1, r0 - movs r0, 0xB5 - lsls r0, 5 - adds r1, r0 - ldrb r0, [r1] - bx lr - .pool - thumb_func_end GetBerryCountByBerryTreeId - - thumb_func_start GetStageDurationByBerryType -@ u16 GetStageDurationByBerryType(u8 berryType) -GetStageDurationByBerryType: @ 80E1B7C - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl GetBerryInfo - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 18 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end GetStageDurationByBerryType - - thumb_func_start FieldObjectInteractionGetBerryTreeData -@ void FieldObjectInteractionGetBerryTreeData() -FieldObjectInteractionGetBerryTreeData: @ 80E1B94 - push {r4-r6,lr} - ldr r0, =0x03005df0 - ldrb r0, [r0] - bl FieldObjectGetBerryTreeId - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - bl GetBerryTypeByBerryTreeId - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r5, 0 - bl ResetBerryTreeSparkleFlag - ldr r0, =0x020375f2 - ldrb r0, [r0] - ldr r1, =0x03005d8c - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl sub_8092E9C - lsls r0, 24 - cmp r0, 0 - beq _080E1BE0 - ldr r1, =0x020375e0 - movs r0, 0xFF - strh r0, [r1] - b _080E1BEE - .pool -_080E1BE0: - ldr r4, =0x020375e0 - adds r0, r5, 0 - bl GetStageByBerryTreeId - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] -_080E1BEE: - ldr r4, =0x020375e2 - adds r0, r5, 0 - bl GetNumStagesWateredByBerryTreeId - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - ldr r4, =0x020375e4 - adds r0, r5, 0 - bl GetBerryCountByBerryTreeId - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - ldr r1, =0x02021cc4 - ldrh r2, [r4] - adds r0, r6, 0 - bl GetBerryCountStringByBerryType - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectInteractionGetBerryTreeData - - thumb_func_start FieldObjectInteractionGetBerryName -@ void FieldObjectInteractionGetBerryName() -FieldObjectInteractionGetBerryName: @ 80E1C2C - push {lr} - ldr r0, =0x03005df0 - ldrb r0, [r0] - bl FieldObjectGetBerryTreeId - lsls r0, 24 - lsrs r0, 24 - bl GetBerryTypeByBerryTreeId - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02021cc4 - bl GetBerryNameByBerryType - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectInteractionGetBerryName - - thumb_func_start FieldObjectInteractionGetBerryCountString -@ void FieldObjectInteractionGetBerryCountString() -FieldObjectInteractionGetBerryCountString: @ 80E1C54 - push {r4,r5,lr} - ldr r0, =0x03005df0 - ldrb r0, [r0] - bl FieldObjectGetBerryTreeId - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl GetBerryTypeByBerryTreeId - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r4, 0 - bl GetBerryCountByBerryTreeId - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r1, =0x02021cc4 - adds r0, r5, 0 - bl GetBerryCountStringByBerryType - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectInteractionGetBerryCountString - - thumb_func_start ChooseBerry -@ void ChooseBerry() -ChooseBerry: @ 80E1C94 - push {lr} - ldr r0, =CB2_ChooseBerry - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end ChooseBerry - - thumb_func_start FieldObjectInteractionPlantBerryTree -@ void FieldObjectInteractionPlantBerryTree() -FieldObjectInteractionPlantBerryTree: @ 80E1CA4 - push {r4,lr} - ldr r0, =0x0203ce7c - ldrh r0, [r0] - bl ItemIdToBerryType - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x03005df0 - ldrb r0, [r0] - bl FieldObjectGetBerryTreeId - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - movs r2, 0x1 - movs r3, 0x1 - bl PlantBerryTree - bl FieldObjectInteractionGetBerryTreeData - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectInteractionPlantBerryTree - - thumb_func_start FieldObjectInteractionPickBerryTree -@ void FieldObjectInteractionPickBerryTree() -FieldObjectInteractionPickBerryTree: @ 80E1CDC - push {r4-r6,lr} - ldr r0, =0x03005df0 - ldrb r0, [r0] - bl FieldObjectGetBerryTreeId - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r5, 0 - bl GetBerryTypeByBerryTreeId - lsls r0, 24 - lsrs r0, 24 - ldr r6, =0x020375e0 - bl BerryTypeToItemId - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl GetBerryCountByBerryTreeId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl bag_add_item - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectInteractionPickBerryTree - - thumb_func_start FieldObjectInteractionRemoveBerryTree -@ void FieldObjectInteractionRemoveBerryTree() -FieldObjectInteractionRemoveBerryTree: @ 80E1D28 - push {lr} - ldr r0, =0x03005df0 - ldrb r0, [r0] - bl FieldObjectGetBerryTreeId - lsls r0, 24 - lsrs r0, 24 - bl RemoveBerryTree - ldr r0, =0x020375f2 - ldrb r0, [r0] - ldr r1, =0x03005d8c - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl sub_8092EF0 - pop {r0} - bx r0 - .pool - thumb_func_end FieldObjectInteractionRemoveBerryTree - - thumb_func_start PlayerHasBerries -@ bool8 PlayerHasBerries() -PlayerHasBerries: @ 80E1D5C - push {lr} - movs r0, 0x4 - bl IsBagPocketNonEmpty - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end PlayerHasBerries - - thumb_func_start ResetBerryTreeSparkleFlags -@ void ResetBerryTreeSparkleFlags() -ResetBerryTreeSparkleFlags: @ 80E1D6C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl GetCameraCoords - mov r0, sp - ldrh r2, [r0] - ldrh r1, [r4] - adds r1, 0x3 - adds r3, r2, 0 - adds r3, 0xE - lsls r1, 16 - movs r5, 0x80 - lsls r5, 12 - adds r0, r1, r5 - lsrs r0, 16 - mov r10, r0 - mov r5, sp - lsls r2, 16 - asrs r2, 16 - mov r9, r2 - ldr r4, =0x02037350 - lsls r3, 16 - asrs r3, 16 - mov r8, r3 - asrs r7, r1, 16 - movs r6, 0xF -_080E1DB0: - ldrb r0, [r4] - lsls r0, 31 - cmp r0, 0 - beq _080E1DEC - ldrb r0, [r4, 0x6] - cmp r0, 0xC - bne _080E1DEC - ldrh r0, [r4, 0x10] - strh r0, [r5] - ldrh r0, [r4, 0x12] - mov r1, sp - strh r0, [r1, 0x2] - movs r2, 0 - ldrsh r1, [r5, r2] - cmp r9, r1 - bgt _080E1DEC - cmp r1, r8 - bgt _080E1DEC - lsls r0, 16 - asrs r1, r0, 16 - cmp r7, r1 - bgt _080E1DEC - mov r2, r10 - lsls r0, r2, 16 - asrs r0, 16 - cmp r1, r0 - bgt _080E1DEC - ldrb r0, [r4, 0x1D] - bl ResetBerryTreeSparkleFlag -_080E1DEC: - adds r4, 0x24 - subs r6, 0x1 - cmp r6, 0 - bge _080E1DB0 - 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 ResetBerryTreeSparkleFlags - - thumb_func_start Multichoice -@ bool8 Multichoice(u8 x, u8 y, u8 menuId, bool8 noCancelling) -Multichoice: @ 80E1E08 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r5, r2, 24 - lsls r3, 24 - lsrs r4, r3, 24 - ldr r0, =sub_80E2058 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080E1E4C - ldr r0, =0x020375f0 - movs r1, 0xFF - strh r1, [r0] - movs r0, 0 - str r0, [sp] - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r5, 0 - adds r3, r4, 0 - bl DoMultichoice - movs r0, 0x1 - b _080E1E4E - .pool -_080E1E4C: - movs r0, 0 -_080E1E4E: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end Multichoice - - thumb_func_start sub_80E1E58 -sub_80E1E58: @ 80E1E58 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - ldr r4, [sp, 0x1C] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - lsls r3, 24 - lsrs r5, r3, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =sub_80E2058 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080E1EA8 - ldr r1, =0x020375f0 - movs r0, 0xFF - strh r0, [r1] - str r4, [sp] - mov r0, r8 - adds r1, r7, 0 - adds r2, r6, 0 - adds r3, r5, 0 - bl DoMultichoice - movs r0, 0x1 - b _080E1EAA - .pool -_080E1EA8: - movs r0, 0 -_080E1EAA: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80E1E58 - - thumb_func_start sub_80E1EB8 -sub_80E1EB8: @ 80E1EB8 - push {r4,r5,lr} - adds r4, r0, 0 - movs r5, 0 - b _080E1EEC -_080E1EC0: - cmp r1, 0xFD - bne _080E1EE4 - adds r4, 0x1 - ldrb r0, [r4] - cmp r0, 0x1 - bne _080E1EEC - ldr r0, =0x03005d90 - ldr r0, [r0] - bl GetStringLength - adds r0, r5, r0 - lsls r0, 16 - lsrs r5, r0, 16 - adds r4, 0x1 - b _080E1EEC - .pool -_080E1EE4: - adds r4, 0x1 - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_080E1EEC: - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - bne _080E1EC0 - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80E1EB8 - - thumb_func_start DoMultichoice -@ void DoMultichoice(u8 x, u8 y, u8 menuId, bool8 noCancelling) -DoMultichoice: @ 80E1EFC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r4, [sp, 0x28] - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp] - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x4] - ldr r1, =gUnknown_0858B760 - lsls r0, r2, 3 - adds r0, r1 - ldrb r6, [r0, 0x4] - ldr r0, [r0] - mov r8, r0 - movs r1, 0 - cmp r1, r6 - bge _080E1F4C - mov r5, r8 - adds r4, r6, 0 -_080E1F3C: - ldr r0, [r5] - bl display_text_and_get_width - adds r1, r0, 0 - adds r5, 0x8 - subs r4, 0x1 - cmp r4, 0 - bne _080E1F3C -_080E1F4C: - adds r0, r1, 0 - bl convert_pixel_width_to_tile_width - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r7, 0 - adds r1, r4, 0 - bl sub_80E2D5C - lsls r0, 24 - lsrs r7, r0, 24 - lsls r3, r6, 25 - lsrs r3, 24 - adds r0, r7, 0 - mov r1, r9 - adds r2, r4, 0 - bl CreateWindowFromRect - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0 - bl SetStandardWindowBorderStyle - adds r0, r4, 0 - adds r1, r6, 0 - mov r2, r8 - bl PrintMenuTable - adds r0, r4, 0 - adds r1, r6, 0 - ldr r2, [sp, 0x4] - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, [sp] - adds r1, r6, 0 - adds r2, r4, 0 - mov r3, r10 - bl sub_80E1FBC - 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 DoMultichoice - - thumb_func_start sub_80E1FBC -sub_80E1FBC: @ 80E1FBC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r4, r3, 24 - ldr r1, =0x02039f90 - movs r0, 0x2 - strb r0, [r1] - movs r2, 0 - ldr r6, =sub_80E2058 - ldr r5, =gUnknown_0858BB68 - movs r3, 0xC -_080E1FE6: - adds r0, r2, r5 - ldrb r0, [r0] - cmp r0, r4 - bne _080E1FF0 - strb r3, [r1] -_080E1FF0: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _080E1FE6 - adds r0, r6, 0 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0, r1 - mov r0, r8 - strh r0, [r1, 0x10] - cmp r7, 0x3 - bls _080E202C - movs r0, 0x1 - b _080E202E - .pool -_080E202C: - movs r0, 0 -_080E202E: - strh r0, [r1, 0x12] - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - mov r1, r9 - strh r1, [r0, 0x14] - strh r4, [r0, 0x16] - adds r0, r4, 0 - bl sub_80E2A94 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E1FBC - - thumb_func_start sub_80E2058 -sub_80E2058: @ 80E2058 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080E20FC - ldr r1, =0x02039f90 - ldrb r0, [r1] - cmp r0, 0 - beq _080E2090 - subs r0, 0x1 - strb r0, [r1] - b _080E20FC - .pool -_080E2090: - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _080E209E - bl ProcessMenuInputNoWrapAround - b _080E20A2 -_080E209E: - bl ProcessMenuInput -_080E20A2: - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0 - beq _080E20B8 - ldrb r0, [r5, 0xE] - bl sub_80E2A94 -_080E20B8: - lsls r0, r4, 24 - asrs r1, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - beq _080E20FC - adds r0, 0x1 - cmp r1, r0 - bne _080E20E8 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _080E20FC - movs r0, 0x5 - bl audio_play - ldr r1, =0x020375f0 - movs r0, 0x7F - strh r0, [r1] - b _080E20EC - .pool -_080E20E8: - ldr r0, =0x020375f0 - strh r1, [r0] -_080E20EC: - ldrb r0, [r5, 0xC] - bl sub_80E2A78 - adds r0, r6, 0 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running -_080E20FC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E2058 - - thumb_func_start yes_no_box -yes_no_box: @ 80E2108 - push {r4,lr} - ldr r4, =task_yes_no_maybe - adds r0, r4, 0 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080E2138 - ldr r1, =0x020375f0 - movs r0, 0xFF - strh r0, [r1] - bl sub_8197930 - adds r0, r4, 0 - movs r1, 0x50 - bl CreateTask - movs r0, 0x1 - b _080E213A - .pool -_080E2138: - movs r0, 0 -_080E213A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end yes_no_box - - thumb_func_start sub_80E2140 -sub_80E2140: @ 80E2140 - push {lr} - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0xFF - beq _080E2154 - movs r0, 0x1 - b _080E2156 - .pool -_080E2154: - movs r0, 0 -_080E2156: - pop {r1} - bx r1 - thumb_func_end sub_80E2140 - - thumb_func_start task_yes_no_maybe -task_yes_no_maybe: @ 80E215C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r1 - ldrh r2, [r1, 0xC] - movs r3, 0xC - ldrsh r0, [r1, r3] - cmp r0, 0x4 - bgt _080E2180 - adds r0, r2, 0x1 - strh r0, [r1, 0xC] - b _080E21C4 - .pool -_080E2180: - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _080E21A4 - cmp r1, r0 - bgt _080E219C - subs r0, 0x1 - cmp r1, r0 - beq _080E21C4 - b _080E21BA -_080E219C: - cmp r1, 0 - beq _080E21B4 - cmp r1, 0x1 - bne _080E21BA -_080E21A4: - movs r0, 0x5 - bl audio_play - ldr r1, =0x020375f0 - movs r0, 0 - b _080E21B8 - .pool -_080E21B4: - ldr r1, =0x020375f0 - movs r0, 0x1 -_080E21B8: - strh r0, [r1] -_080E21BA: - adds r0, r4, 0 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running -_080E21C4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_yes_no_maybe - - thumb_func_start sub_80E21D0 -sub_80E21D0: @ 80E21D0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - ldr r4, [sp, 0x30] - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x4] - lsls r2, 24 - lsrs r5, r2, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x8] - lsls r4, 24 - lsrs r4, 24 - mov r10, r4 - ldr r0, =sub_80E2308 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E2210 - movs r0, 0 - b _080E22E8 - .pool -_080E2210: - ldr r0, =0x020375f0 - movs r1, 0xFF - strh r1, [r0] - movs r2, 0 - movs r6, 0 - ldr r1, =gUnknown_0858B760 - lsls r5, 3 - adds r0, r5, r1 - str r5, [sp, 0xC] - ldrb r0, [r0, 0x4] - cmp r2, r0 - bge _080E2246 - mov r8, r1 -_080E222A: - mov r0, r8 - adds r4, r5, r0 - ldr r1, [r4] - lsls r0, r6, 3 - adds r0, r1 - ldr r0, [r0] - adds r1, r2, 0 - bl display_text_and_get_width - adds r2, r0, 0 - adds r6, 0x1 - ldrb r4, [r4, 0x4] - cmp r6, r4 - blt _080E222A -_080E2246: - adds r0, r2, 0 - bl convert_pixel_width_to_tile_width - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - mov r1, r10 - muls r1, r5 - mov r8, r1 - adds r0, r7, 0 - bl sub_80E2D5C - lsls r0, 24 - lsrs r7, r0, 24 - ldr r2, =gUnknown_0858B760 - mov r9, r2 - ldr r0, [sp, 0xC] - add r9, r0 - mov r1, r9 - ldrb r0, [r1, 0x4] - mov r1, r10 - bl __udivsi3 - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =sub_80E2308 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - mov r2, sp - ldrh r2, [r2, 0x8] - strh r2, [r4, 0x10] - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r3, r6, 25 - lsrs r3, 24 - adds r0, r7, 0 - ldr r1, [sp, 0x4] - mov r2, r8 - bl CreateWindowFromRect - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x14] - movs r1, 0 - bl SetStandardWindowBorderStyle - ldrb r0, [r4, 0x14] - lsls r5, 27 - lsrs r5, 24 - mov r2, r9 - ldr r1, [r2] - str r1, [sp] - adds r1, r5, 0 - mov r2, r10 - adds r3, r6, 0 - bl sub_81997AC - ldrb r0, [r4, 0x14] - movs r1, 0 - str r1, [sp] - adds r1, r5, 0 - mov r2, r10 - adds r3, r6, 0 - bl sub_8199944 - ldrb r0, [r4, 0x14] - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0x1 -_080E22E8: - 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_80E21D0 - - thumb_func_start sub_80E2308 -sub_80E2308: @ 80E2308 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - bl sub_8199334 - lsls r0, 24 - asrs r1, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - beq _080E2360 - adds r0, 0x1 - cmp r1, r0 - bne _080E234C - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _080E2360 - movs r0, 0x5 - bl audio_play - ldr r1, =0x020375f0 - movs r0, 0x7F - strh r0, [r1] - b _080E2350 - .pool -_080E234C: - ldr r0, =0x020375f0 - strh r1, [r0] -_080E2350: - ldrb r0, [r5, 0xC] - bl sub_80E2A78 - adds r0, r4, 0 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running -_080E2360: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E2308 - - thumb_func_start sp109_CreatePCMenu -@ bool sp109_CreatePCMenu() -sp109_CreatePCMenu: @ 80E236C - push {lr} - ldr r0, =sub_80E2058 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080E2394 - ldr r1, =0x020375f0 - movs r0, 0xFF - strh r0, [r1] - bl CreatePCMenu - movs r0, 0x1 - b _080E2396 - .pool -_080E2394: - movs r0, 0 -_080E2396: - pop {r1} - bx r1 - thumb_func_end sp109_CreatePCMenu - - thumb_func_start CreatePCMenu -CreatePCMenu: @ 80E239C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - movs r7, 0x8 - movs r5, 0 - movs r4, 0 - ldr r6, =gUnknown_0858BB70 -_080E23AC: - ldm r6!, {r0} - adds r1, r5, 0 - bl display_text_and_get_width - adds r5, r0, 0 - adds r4, 0x1 - cmp r4, 0x3 - bls _080E23AC - ldr r6, =0x00000864 - adds r0, r6, 0 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080E23D4 - ldr r0, =gUnknown_085EB18B - adds r1, r5, 0 - bl display_text_and_get_width - adds r5, r0, 0 -_080E23D4: - adds r0, r5, 0 - bl convert_pixel_width_to_tile_width - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r6, 0 - bl FlagGet - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - beq _080E2448 - movs r0, 0x4 - mov r8, r0 - movs r0, 0 - movs r1, 0 - adds r2, r4, 0 - movs r3, 0x8 - bl CreateWindowFromRect - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r6, 0 - movs r1, 0 - bl SetStandardWindowBorderStyle - ldr r2, =gUnknown_085EB18B - movs r0, 0x21 - str r0, [sp] - movs r5, 0xFF - str r5, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - adds r0, r6, 0 - movs r1, 0x1 - adds r3, r7, 0 - bl Print - ldr r2, =gUnknown_085EB198 - movs r0, 0x31 - str r0, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - adds r0, r6, 0 - movs r1, 0x1 - adds r3, r7, 0 - bl Print - b _080E247A - .pool -_080E2448: - movs r0, 0x3 - mov r8, r0 - movs r0, 0 - movs r1, 0 - adds r2, r4, 0 - movs r3, 0x6 - bl CreateWindowFromRect - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r6, 0 - movs r1, 0 - bl SetStandardWindowBorderStyle - ldr r2, =gUnknown_085EB198 - movs r0, 0x21 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - str r5, [sp, 0x8] - adds r0, r6, 0 - movs r1, 0x1 - adds r3, r7, 0 - bl Print -_080E247A: - ldr r0, =0x000008ab - bl FlagGet - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _080E24B0 - ldr r2, =gUnknown_085EB176 - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r6, 0 - movs r1, 0x1 - adds r3, r7, 0 - bl Print - b _080E24C6 - .pool -_080E24B0: - ldr r2, =gUnknown_085EB169 - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - str r1, [sp, 0x8] - adds r0, r6, 0 - movs r1, 0x1 - adds r3, r7, 0 - bl Print -_080E24C6: - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EB183 - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r7, 0 - movs r3, 0x11 - bl sub_819A024 - adds r0, r6, 0 - mov r1, r8 - movs r2, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - adds r0, r6, 0 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0 - mov r1, r8 - adds r2, r6, 0 - movs r3, 0x1 - bl sub_80E1FBC - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end CreatePCMenu - - thumb_func_start sub_80E2514 -sub_80E2514: @ 80E2514 - push {lr} - sub sp, 0x10 - movs r0, 0 - movs r1, 0x1 - bl sub_819786C - ldr r2, =gUnknown_0827266F - 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, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParametrized - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E2514 - - thumb_func_start sub_80E2548 -sub_80E2548: @ 80E2548 - push {lr} - ldr r0, =sub_80E2058 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080E2570 - ldr r1, =0x020375f0 - movs r0, 0xFF - strh r0, [r1] - bl sub_80E2578 - movs r0, 0x1 - b _080E2572 - .pool -_080E2570: - movs r0, 0 -_080E2572: - pop {r1} - bx r1 - thumb_func_end sub_80E2548 - - thumb_func_start sub_80E2578 -sub_80E2578: @ 80E2578 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - movs r5, 0 - movs r4, 0 - ldr r3, =0x03001124 - movs r2, 0xFF -_080E258A: - adds r0, r4, r3 - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bls _080E258A - movs r0, 0x1 - movs r1, 0 - bl GetFontAttribute - ldr r0, =0x020375e0 - ldrh r1, [r0] - cmp r1, 0 - bne _080E25D2 - ldr r4, =0x03001124 - adds r0, r5, r4 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0xE8 - lsls r0, 1 - bl FlagGet - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1 - bne _080E25D2 - adds r0, r5, r4 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080E25D2: - ldr r0, =0x00000113 - movs r1, 0x1 - bl sub_80D6724 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E2630 - ldr r0, =0x000008b3 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E2630 - ldr r2, =0x020375e0 - ldrh r0, [r2] - cmp r0, 0 - bne _080E2606 - ldr r0, =0x03001124 - adds r0, r5, r0 - movs r1, 0x2 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080E2606: - ldrh r0, [r2] - cmp r0, 0x1 - bne _080E2630 - movs r4, 0xD7 - lsls r4, 1 - adds r0, r4, 0 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _080E2630 - ldr r0, =0x03001124 - adds r0, r5, r0 - movs r1, 0x2 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - bl FlagSet -_080E2630: - movs r0, 0xB9 - lsls r0, 1 - movs r1, 0x1 - bl sub_80D6724 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E2690 - movs r0, 0x8E - lsls r0, 4 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E2690 - ldr r2, =0x020375e0 - ldrh r0, [r2] - cmp r0, 0 - bne _080E2668 - ldr r0, =0x03001124 - adds r0, r5, r0 - movs r1, 0x3 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080E2668: - ldrh r0, [r2] - cmp r0, 0x1 - bne _080E2690 - ldr r4, =0x000001db - adds r0, r4, 0 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _080E2690 - ldr r0, =0x03001124 - adds r0, r5, r0 - movs r1, 0x3 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - bl FlagSet -_080E2690: - ldr r0, =0x00000173 - movs r1, 0x1 - bl sub_80D6724 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E26EC - ldr r0, =0x000008d5 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E26EC - ldr r2, =0x020375e0 - ldrh r0, [r2] - cmp r0, 0 - bne _080E26C4 - ldr r0, =0x03001124 - adds r0, r5, r0 - movs r1, 0x4 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080E26C4: - ldrh r0, [r2] - cmp r0, 0x1 - bne _080E26EC - ldr r4, =0x000001af - adds r0, r4, 0 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _080E26EC - ldr r0, =0x03001124 - adds r0, r5, r0 - movs r1, 0x4 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - bl FlagSet -_080E26EC: - movs r0, 0xBC - lsls r0, 1 - movs r1, 0x1 - bl sub_80D6724 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E274C - ldr r0, =0x000008d6 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E274C - ldr r2, =0x020375e0 - ldrh r0, [r2] - cmp r0, 0 - bne _080E2722 - ldr r0, =0x03001124 - adds r0, r5, r0 - movs r1, 0x5 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080E2722: - ldrh r0, [r2] - cmp r0, 0x1 - bne _080E274C - movs r4, 0xD8 - lsls r4, 1 - adds r0, r4, 0 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _080E274C - ldr r0, =0x03001124 - adds r0, r5, r0 - movs r1, 0x5 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - bl FlagSet -_080E274C: - ldr r0, =0x03001124 - adds r0, r5, r0 - movs r1, 0x6 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0 - bne _080E276E - movs r0, 0xE8 - lsls r0, 1 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 -_080E276E: - adds r7, r5, 0 - cmp r7, 0x7 - bne _080E27A4 - ldr r1, =0x020375e0 - movs r0, 0xB - strh r0, [r1] - bl sub_813A128 - b _080E2860 - .pool -_080E27A4: - movs r1, 0 - movs r4, 0 - lsls r6, r7, 25 - subs r0, r7, 0x1 - mov r9, r0 - ldr r5, =gUnknown_0858BB80 -_080E27B0: - ldr r0, =0x03001124 - adds r0, r4, r0 - ldrb r0, [r0] - cmp r0, 0xFF - beq _080E27C6 - lsls r0, 2 - adds r0, r5 - ldr r0, [r0] - bl display_text_and_get_width - adds r1, r0, 0 -_080E27C6: - adds r4, 0x1 - cmp r4, 0x6 - bls _080E27B0 - adds r0, r1, 0 - bl convert_pixel_width_to_tile_width - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x1C - subs r0, r2 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x6 - subs r1, r7 - lsls r1, 25 - lsrs r1, 24 - lsrs r3, r6, 24 - bl CreateWindowFromRect - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r6, 0 - movs r1, 0 - bl SetStandardWindowBorderStyle - movs r5, 0 - movs r4, 0 - ldr r0, =gUnknown_0858BB80 - mov r8, r0 -_080E2802: - ldr r0, =0x03001124 - adds r1, r4, r0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _080E2834 - lsls r0, 2 - add r0, r8 - ldr 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 - movs r1, 0x1 - movs r3, 0x8 - bl Print - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080E2834: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bls _080E2802 - mov r0, r9 - lsls r2, r0, 24 - lsrs r2, 24 - adds r0, r6, 0 - adds r1, r7, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - adds r0, r6, 0 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0 - adds r1, r7, 0 - adds r2, r6, 0 - movs r3, 0x8 - bl sub_80E1FBC -_080E2860: - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E2578 - - thumb_func_start sub_80E2878 -sub_80E2878: @ 80E2878 - push {lr} - ldr r2, =0x020375f0 - ldrh r0, [r2] - cmp r0, 0x7F - beq _080E288C - ldr r0, =0x03001124 - ldrh r1, [r2] - adds r1, r0 - ldrb r0, [r1] - strh r0, [r2] -_080E288C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E2878 - - thumb_func_start task_picbox -task_picbox: @ 80E2898 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080E28F8 - cmp r0, 0x1 - bgt _080E28C0 - cmp r0, 0 - beq _080E28DE - b _080E28F8 - .pool -_080E28C0: - cmp r0, 0x2 - beq _080E28CA - cmp r0, 0x3 - beq _080E28EC - b _080E28F8 -_080E28CA: - movs r0, 0xC - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - ldrb r1, [r4, 0xC] - bl sub_80B6070 -_080E28DE: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080E28F8 - .pool -_080E28EC: - ldrb r0, [r4, 0x12] - bl sub_80E2A78 - adds r0, r5, 0 - bl DestroyTask -_080E28F8: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end task_picbox - - thumb_func_start sub_80E2900 -sub_80E2900: @ 80E2900 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r4, =task_picbox - adds r0, r4, 0 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _080E29B8 - lsls r1, r7, 19 - movs r0, 0xA0 - lsls r0, 14 - adds r1, r0 - asrs r1, 16 - lsls r2, r6, 19 - adds r2, r0 - asrs r2, 16 - mov r0, r8 - movs r3, 0 - bl sub_80B5F84 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r4, 0 - movs r1, 0x50 - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r7, 0 - adds r1, r6, 0 - movs r2, 0x8 - movs r3, 0x8 - bl CreateWindowFromRect - ldr r1, =0x03005e00 - lsls r3, r4, 2 - adds r3, r4 - lsls r3, 3 - adds r3, r1 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - strh r0, [r3, 0x12] - strh r1, [r3, 0x8] - mov r0, r8 - strh r0, [r3, 0xA] - strh r5, [r3, 0xC] - ldr r4, =0x02020630 - lsls r1, r5, 4 - adds r1, r5 - lsls r1, 2 - adds r0, r4, 0 - adds r0, 0x1C - adds r0, r1, r0 - ldr r2, =DummyObjectCallback - str r2, [r0] - adds r1, r4 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] - ldrb r0, [r3, 0x12] - movs r1, 0x1 - bl SetStandardWindowBorderStyle - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - b _080E29BA - .pool -_080E29B8: - movs r0, 0 -_080E29BA: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80E2900 - - thumb_func_start picbox_close -picbox_close: @ 80E29C4 - push {lr} - ldr r0, =task_picbox - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _080E29F4 - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - ldr r0, =sub_80E29FC - b _080E29F6 - .pool -_080E29F4: - movs r0, 0 -_080E29F6: - pop {r1} - bx r1 - thumb_func_end picbox_close - - thumb_func_start sub_80E29FC -sub_80E29FC: @ 80E29FC - push {lr} - ldr r0, =task_picbox - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _080E2A14 - movs r0, 0 - b _080E2A16 - .pool -_080E2A14: - movs r0, 0x1 -_080E2A16: - pop {r1} - bx r1 - thumb_func_end sub_80E29FC - - thumb_func_start CreateWindowFromRect -CreateWindowFromRect: @ 80E2A1C - 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 - add sp, 0x20 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end CreateWindowFromRect - - thumb_func_start sub_80E2A78 -sub_80E2A78: @ 80E2A78 - 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_80E2A78 - - thumb_func_start sub_80E2A94 -sub_80E2A94: @ 80E2A94 - push {r4,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x4A - cmp r0, 0x5 - bhi _080E2B70 - lsls r0, 2 - ldr r1, =_080E2AB0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080E2AB0: - .4byte _080E2B40 - .4byte _080E2B08 - .4byte _080E2AD8 - .4byte _080E2AC8 - .4byte _080E2AE8 - .4byte _080E2AF8 -_080E2AC8: - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r4, =gUnknown_0858BBAC - b _080E2B12 - .pool -_080E2AD8: - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r4, =gUnknown_0858BB9C - b _080E2B12 - .pool -_080E2AE8: - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r4, =gUnknown_0858BBBC - b _080E2B12 - .pool -_080E2AF8: - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r4, =gUnknown_0858BBCC - b _080E2B12 - .pool -_080E2B08: - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r4, =gUnknown_0858BBEC -_080E2B12: - bl GetMenuCursorPos - lsls r0, 24 - lsrs r0, 22 - adds r0, r4 - ldr r2, [r0] - 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, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParametrized - b _080E2B70 - .pool -_080E2B40: - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r4, =gUnknown_0858BBE0 - bl GetMenuCursorPos - lsls r0, 24 - lsrs r0, 22 - adds r0, r4 - ldr r2, [r0] - 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, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParametrized -_080E2B70: - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E2A94 - - thumb_func_start sp106_CreateStartMenu -sp106_CreateStartMenu: @ 80E2B7C - push {lr} - ldr r0, =sub_80E2058 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080E2BA4 - ldr r1, =0x020375f0 - movs r0, 0xFF - strh r0, [r1] - bl CreateStartMenu - movs r0, 0x1 - b _080E2BA6 - .pool -_080E2BA4: - movs r0, 0 -_080E2BA6: - pop {r1} - bx r1 - thumb_func_end sp106_CreateStartMenu - - thumb_func_start CreateStartMenu -CreateStartMenu: @ 80E2BAC - push {r4-r6,lr} - sub sp, 0xC - movs r0, 0x15 - movs r1, 0 - movs r2, 0x7 - movs r3, 0x12 - bl CreateWindowFromRect - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0 - bl SetStandardWindowBorderStyle - ldr r2, =gUnknown_085EB25C - movs r0, 0x9 - str r0, [sp] - movs r5, 0xFF - str r5, [sp, 0x4] - movs r6, 0 - str r6, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - movs r3, 0x8 - bl Print - ldr r2, =gUnknown_085EB264 - movs r0, 0x19 - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - movs r3, 0x8 - bl Print - ldr r2, =gUnknown_085EB26C - movs r0, 0x29 - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - movs r3, 0x8 - bl Print - ldr r2, =gUnknown_085EB270 - movs r0, 0x39 - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - movs r3, 0x8 - bl Print - ldr r0, =0x03005d90 - ldr r2, [r0] - movs r0, 0x49 - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - movs r3, 0x8 - bl Print - ldr r2, =gUnknown_085EB279 - movs r0, 0x59 - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - movs r3, 0x8 - bl Print - ldr r2, =gUnknown_085EB27E - movs r0, 0x69 - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - movs r3, 0x8 - bl Print - ldr r2, =gUnknown_085EB285 - movs r0, 0x79 - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - movs r3, 0x8 - bl Print - movs r0, 0x10 - str r0, [sp] - movs r0, 0x8 - str r0, [sp, 0x4] - str r6, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - movs r3, 0x9 - bl sub_81983AC - movs r0, 0 - movs r1, 0x8 - adds r2, r4, 0 - movs r3, 0x56 - bl sub_80E2CC4 - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end CreateStartMenu - - thumb_func_start sub_80E2CC4 -sub_80E2CC4: @ 80E2CC4 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r2, 0 - adds r6, r3, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - ldr r1, =0x02039f90 - movs r0, 0x2 - strb r0, [r1] - ldr r0, =sub_80E2058 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0 - strh r4, [r1, 0x10] - strh r0, [r1, 0x12] - strh r5, [r1, 0x14] - strh r6, [r1, 0x16] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E2CC4 - - thumb_func_start display_text_and_get_width_internal -display_text_and_get_width_internal: @ 80E2D10 - push {lr} - sub sp, 0x40 - adds r1, r0, 0 - mov r0, sp - bl ExpandStringRefs - movs r0, 0x1 - mov r1, sp - movs r2, 0 - bl GetStringWidth - add sp, 0x40 - pop {r1} - bx r1 - thumb_func_end display_text_and_get_width_internal - - thumb_func_start display_text_and_get_width -display_text_and_get_width: @ 80E2D2C - push {r4,lr} - adds r4, r1, 0 - bl display_text_and_get_width_internal - cmp r0, r4 - bge _080E2D3A - adds r0, r4, 0 -_080E2D3A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end display_text_and_get_width - - thumb_func_start convert_pixel_width_to_tile_width -convert_pixel_width_to_tile_width: @ 80E2D40 - push {lr} - adds r1, r0, 0 - adds r0, 0x9 - cmp r0, 0 - bge _080E2D4C - adds r0, 0x7 -_080E2D4C: - asrs r0, 3 - adds r0, 0x1 - cmp r0, 0x1C - ble _080E2D56 - movs r0, 0x1C -_080E2D56: - pop {r1} - bx r1 - thumb_func_end convert_pixel_width_to_tile_width - - thumb_func_start sub_80E2D5C -sub_80E2D5C: @ 80E2D5C - push {lr} - adds r2, r0, 0 - adds r0, r2, r1 - cmp r0, 0x1C - ble _080E2D70 - movs r0, 0x1C - subs r2, r0, r1 - cmp r2, 0 - bge _080E2D70 - movs r2, 0 -_080E2D70: - adds r0, r2, 0 - pop {r1} - bx r1 - thumb_func_end sub_80E2D5C - - thumb_func_start do_choose_name_or_words_screen -@ int do_choose_name_or_words_screen(u8 type, sav2 *sav2_ptr, s16 player_gender, s16 a4, int a5, void ( *after_finishing_callback)()) -do_choose_name_or_words_screen: @ 80E2D78 - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r1 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r2, 16 - lsrs r5, r2, 16 - lsls r3, 16 - lsrs r6, r3, 16 - ldr r4, =0x02039f94 - movs r0, 0xF2 - lsls r0, 5 - bl Alloc - str r0, [r4] - cmp r0, 0 - bne _080E2DA8 - ldr r0, [sp, 0x1C] - bl SetMainCallback2 - b _080E2DE2 - .pool -_080E2DA8: - ldr r1, =0x00001e2c - adds r0, r1 - strb r7, [r0] - ldr r0, [r4] - ldr r2, =0x00001e34 - adds r1, r0, r2 - strh r5, [r1] - adds r2, 0x2 - adds r1, r0, r2 - strh r6, [r1] - ldr r1, =0x00001e38 - adds r2, r0, r1 - ldr r1, [sp, 0x18] - str r1, [r2] - ldr r2, =0x00001e30 - adds r1, r0, r2 - mov r2, r8 - str r2, [r1] - ldr r1, =0x00001e3c - adds r0, r1 - ldr r2, [sp, 0x1C] - str r2, [r0] - cmp r7, 0 - bne _080E2DDC - bl StartTimer1 -_080E2DDC: - ldr r0, =c2_choose_name_or_words_screen - bl SetMainCallback2 -_080E2DE2: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end do_choose_name_or_words_screen - - thumb_func_start c2_choose_name_or_words_screen -c2_choose_name_or_words_screen: @ 80E2E04 - push {lr} - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x7 - bhi _080E2E9C - lsls r0, 2 - ldr r1, =_080E2E28 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080E2E28: - .4byte _080E2E48 - .4byte _080E2E52 - .4byte _080E2E58 - .4byte _080E2E5E - .4byte _080E2E68 - .4byte _080E2E6E - .4byte _080E2E74 - .4byte _080E2E7A -_080E2E48: - bl sub_80E4F70 - bl choose_name_or_words_screen_setup - b _080E2E86 -_080E2E52: - bl choose_name_or_words_screen_init_bgs - b _080E2E86 -_080E2E58: - bl sub_80A1A74 - b _080E2E86 -_080E2E5E: - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - b _080E2E86 -_080E2E68: - bl ResetTasks - b _080E2E86 -_080E2E6E: - bl choose_name_or_words_screen_apply_bg_pals - b _080E2E86 -_080E2E74: - bl choose_name_or_words_screen_load_bg_tile_patterns - b _080E2E86 -_080E2E7A: - bl sub_80E3CC8 - bl fade_and_return_progress_probably - bl sub_80E501C -_080E2E86: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080E2EA4 - .pool -_080E2E9C: - bl sub_80E4CB8 - bl sub_80E3194 -_080E2EA4: - pop {r0} - bx r0 - thumb_func_end c2_choose_name_or_words_screen - - thumb_func_start choose_name_or_words_screen_setup -@ void choose_name_or_words_screen_setup() -choose_name_or_words_screen_setup: @ 80E2EA8 - push {r4-r7,lr} - ldr r5, =0x02039f94 - ldr r0, [r5] - ldr r1, =0x00001e10 - adds r0, r1 - movs r2, 0 - strb r2, [r0] - ldr r1, [r5] - ldr r3, =0x00001e18 - adds r0, r1, r3 - movs r4, 0 - strh r2, [r0] - ldr r7, =0x00001e1a - adds r0, r1, r7 - strh r2, [r0] - ldr r0, =0x00001e1c - adds r2, r1, r0 - movs r3, 0x1 - movs r0, 0x1 - strh r0, [r2] - adds r7, 0x4 - adds r2, r1, r7 - movs r0, 0x2 - strh r0, [r2] - movs r0, 0xF1 - lsls r0, 5 - adds r1, r0 - strb r4, [r1] - ldr r0, [r5] - ldr r1, =0x00001e21 - adds r0, r1 - strb r3, [r0] - ldr r1, [r5] - ldr r6, =0x00001e28 - adds r3, r1, r6 - ldr r2, =gUnknown_0858BFD8 - ldr r4, =0x00001e2c - adds r0, r1, r4 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - str r0, [r3] - ldrb r0, [r0, 0x4] - ldr r2, =0x00001e22 - adds r1, r2 - strb r0, [r1] - ldr r2, [r5] - adds r0, r2, r6 - ldr r0, [r0] - ldrb r1, [r0, 0x1] - lsls r1, 3 - movs r0, 0xF0 - subs r0, r1 - asrs r3, r0, 1 - adds r0, r3, 0x6 - subs r7, 0x8 - adds r1, r2, r7 - strh r0, [r1] - adds r2, r4 - ldrb r0, [r2] - cmp r0, 0x4 - bne _080E2F2C - adds r0, r3, 0 - adds r0, 0x11 - strh r0, [r1] -_080E2F2C: - ldr r0, [r5] - ldr r4, =0x030022b0 - ldrh r1, [r4] - ldr r2, =0x00001e25 - adds r0, r2 - strb r1, [r0] - ldr r0, [r5] - movs r3, 0xC0 - lsls r3, 5 - adds r0, r3 - movs r1, 0xFF - movs r2, 0x10 - bl memset - ldr r1, [r5] - adds r0, r1, r6 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0 - beq _080E2F64 - movs r7, 0xC0 - lsls r7, 5 - adds r0, r1, r7 - ldr r2, =0x00001e30 - adds r1, r2 - ldr r1, [r1] - bl CopyString -_080E2F64: - movs r0, 0x10 - strh r0, [r4] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end choose_name_or_words_screen_setup - - thumb_func_start sub_80E2FA4 -sub_80E2FA4: @ 80E2FA4 - push {r4,r5,lr} - movs r3, 0 - ldr r4, =0x02020630 - movs r5, 0x5 - negs r5, r5 -_080E2FAE: - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - adds r0, r4 - adds r2, r0, 0 - adds r2, 0x3E - ldrb r1, [r2] - lsls r0, r1, 31 - cmp r0, 0 - beq _080E2FC8 - adds r0, r5, 0 - ands r0, r1 - strb r0, [r2] -_080E2FC8: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3F - bls _080E2FAE - movs r0, 0 - bl sub_80E3E3C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E2FA4 - - thumb_func_start choose_name_or_words_screen_init_bgs -choose_name_or_words_screen_init_bgs: @ 80E2FE4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - movs r3, 0xC0 - lsls r3, 19 - movs r4, 0xC0 - lsls r4, 9 - add r0, sp, 0xC - mov r8, r0 - add r2, sp, 0x8 - movs r6, 0 - ldr r1, =0x040000d4 - movs r5, 0x80 - lsls r5, 5 - ldr r7, =0x81000800 - movs r0, 0x81 - lsls r0, 24 - mov r12, r0 -_080E300A: - strh r6, [r2] - add r0, sp, 0x8 - str r0, [r1] - str r3, [r1, 0x4] - str r7, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r3, r5 - subs r4, r5 - cmp r4, r5 - bhi _080E300A - strh r6, [r2] - add r2, sp, 0x8 - str r2, [r1] - str r3, [r1, 0x4] - lsrs r0, r4, 1 - mov r2, r12 - orrs r0, r2 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r0, 0xE0 - lsls r0, 19 - movs r3, 0x80 - lsls r3, 3 - movs r4, 0 - str r4, [sp, 0xC] - ldr r2, =0x040000d4 - mov r1, r8 - str r1, [r2] - str r0, [r2, 0x4] - lsrs r0, r3, 2 - movs r1, 0x85 - lsls r1, 24 - orrs r0, r1 - str r0, [r2, 0x8] - ldr r0, [r2, 0x8] - movs r1, 0xA0 - lsls r1, 19 - add r0, sp, 0x8 - strh r4, [r0] - str r0, [r2] - str r1, [r2, 0x4] - lsrs r3, 1 - movs r0, 0x81 - lsls r0, 24 - orrs r3, r0 - str r3, [r2, 0x8] - ldr r0, [r2, 0x8] - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0858BE00 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - 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 - bl sub_81971D0 - bl sub_8197200 -_080E30D8: - lsls r0, r4, 3 - ldr r1, =gUnknown_0858BE10 - adds r0, r1 - bl AddWindow - ldr r5, =0x02039f94 - ldr r1, [r5] - ldr r2, =0x00001e11 - adds r1, r2 - adds r1, r4 - strb r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _080E30D8 - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r1, 0xC8 - lsls r1, 3 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x0000080c - movs r0, 0x52 - bl SetGpuReg - ldr r1, [r5] - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r5] - movs r0, 0x80 - lsls r0, 4 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - ldr r1, [r5] - movs r2, 0x80 - lsls r2, 5 - adds r1, r2 - movs r0, 0x3 - bl SetBgTilemapBuffer - movs r4, 0x20 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end choose_name_or_words_screen_init_bgs - - thumb_func_start sub_80E3194 -sub_80E3194: @ 80E3194 - push {lr} - ldr r0, =sub_80E31B0 - movs r1, 0x2 - bl CreateTask - ldr r0, =sub_80E4F58 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E3194 - - thumb_func_start sub_80E31B0 -sub_80E31B0: @ 80E31B0 - push {lr} - ldr r0, =0x02039f94 - ldr r0, [r0] - ldr r1, =0x00001e10 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x9 - bhi _080E3240 - lsls r0, 2 - ldr r1, =_080E31D8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080E31D8: - .4byte _080E3200 - .4byte _080E320E - .4byte _080E3218 - .4byte _080E3214 - .4byte _080E321E - .4byte _080E3224 - .4byte _080E322A - .4byte _080E3230 - .4byte _080E3236 - .4byte _080E323C -_080E3200: - bl sub_80E3294 - bl sub_80E2FA4 - bl sub_80E4F84 - b _080E3240 -_080E320E: - bl sub_80E335C - b _080E3240 -_080E3214: - bl sub_80E33A8 -_080E3218: - bl sub_80E3398 - b _080E3240 -_080E321E: - bl sub_80E3640 - b _080E3240 -_080E3224: - bl sub_80E3680 - b _080E3240 -_080E322A: - bl pokemon_store - b _080E3240 -_080E3230: - bl sub_80E3604 - b _080E3240 -_080E3236: - bl sub_80E3448 - b _080E3240 -_080E323C: - bl sub_80E347C -_080E3240: - pop {r0} - bx r0 - thumb_func_end sub_80E31B0 - - thumb_func_start sub_80E3244 -sub_80E3244: @ 80E3244 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0858BEBB - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80E3244 - - thumb_func_start sub_80E3254 -sub_80E3254: @ 80E3254 - ldr r1, =gUnknown_0858BEBE - ldr r0, =0x02039f94 - ldr r0, [r0] - ldr r2, =0x00001e22 - adds r0, r2 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80E3254 - - thumb_func_start sub_80E3274 -sub_80E3274: @ 80E3274 - ldr r1, =gUnknown_0858BEC1 - ldr r0, =0x02039f94 - ldr r0, [r0] - ldr r2, =0x00001e22 - adds r0, r2 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80E3274 - - thumb_func_start sub_80E3294 -sub_80E3294: @ 80E3294 - push {r4-r6,lr} - sub sp, 0x4 - ldr r1, =gUnknown_08DD4544 - movs r0, 0x3 - bl sub_80E4CF8 - ldr r5, =0x02039f94 - ldr r0, [r5] - ldr r1, =0x00001e22 - adds r0, r1 - movs r6, 0 - movs r1, 0x1 - strb r1, [r0] - ldr r1, =gUnknown_08DD46E0 - movs r0, 0x2 - bl sub_80E4CF8 - ldr r1, =gUnknown_08DD4620 - movs r0, 0x1 - bl sub_80E4CF8 - ldr r0, [r5] - ldr r1, =0x00001e12 - adds r0, r1 - ldrb r0, [r0] - movs r1, 0 - bl sub_80E4DE4 - ldr r0, [r5] - ldr r1, =0x00001e11 - adds r0, r1 - ldrb r0, [r0] - movs r1, 0x1 - bl sub_80E4DE4 - movs r0, 0x2 - movs r1, 0 - bl nullsub_10 - movs r0, 0x1 - movs r1, 0x1 - bl nullsub_10 - bl sub_80E4D10 - bl sub_80E4964 - bl sub_80E4EF0 - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - movs r4, 0x1 - negs r4, r4 - adds r0, r4, 0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - str r6, [sp] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r1, [r5] - ldr r0, =0x00001e10 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E3294 - - thumb_func_start sub_80E335C -sub_80E335C: @ 80E335C - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080E3384 - movs r0, 0x1 - bl sub_80E4630 - movs r0, 0x1 - bl sub_80E3E94 - ldr r0, =0x02039f94 - ldr r1, [r0] - ldr r0, =0x00001e10 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080E3384: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E335C - - thumb_func_start sub_80E3398 -sub_80E3398: @ 80E3398 - push {lr} - bl sub_80E44BC - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_80E3398 - - thumb_func_start sub_80E33A8 -sub_80E33A8: @ 80E33A8 - push {lr} - bl sub_80E3F04 - lsls r0, 24 - cmp r0, 0 - beq _080E33CA - movs r0, 0x1 - bl sub_80E4630 - bl sub_80E3E28 - ldr r0, =0x02039f94 - ldr r0, [r0] - ldr r1, =0x00001e10 - adds r0, r1 - movs r1, 0x2 - strb r1, [r0] -_080E33CA: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E33A8 - - thumb_func_start pokemon_store -pokemon_store: @ 80E33D8 - push {r4,lr} - bl sub_80E4BE4 - movs r0, 0 - bl sub_80E4630 - movs r0, 0 - bl sub_80E3E94 - movs r0, 0x3 - movs r1, 0 - movs r2, 0x1 - bl sub_80E3948 - ldr r4, =0x02039f94 - ldr r0, [r4] - ldr r1, =0x00001e2c - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x2 - bne _080E342C - bl calc_player_party_count - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bls _080E342C - bl pokemon_transfer_to_pc_with_message - ldr r0, [r4] - ldr r1, =0x00001e10 - adds r0, r1 - movs r1, 0x7 - strb r1, [r0] - movs r0, 0 - b _080E343A - .pool -_080E342C: - ldr r0, =0x02039f94 - ldr r0, [r0] - ldr r1, =0x00001e10 - adds r0, r1 - movs r1, 0x8 - strb r1, [r0] - movs r0, 0x1 -_080E343A: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end pokemon_store - - thumb_func_start sub_80E3448 -sub_80E3448: @ 80E3448 - push {lr} - sub sp, 0x4 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x02039f94 - ldr r1, [r0] - ldr r0, =0x00001e10 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0 - add sp, 0x4 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E3448 - - thumb_func_start sub_80E347C -sub_80E347C: @ 80E347C - push {r4,r5,lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _080E34C6 - ldr r4, =0x02039f94 - ldr r0, [r4] - ldr r1, =0x00001e2c - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080E34A0 - bl SeedRngAndSetTrainerId -_080E34A0: - ldr r0, [r4] - ldr r1, =0x00001e3c - adds r0, r1 - ldr r0, [r0] - bl SetMainCallback2 - ldr r0, =sub_80E31B0 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - bl FreeAllWindowBuffers - ldr r0, [r4] - bl Free - str r5, [r4] -_080E34C6: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E347C - - thumb_func_start pokemon_transfer_to_pc_with_message -pokemon_transfer_to_pc_with_message: @ 80E34E4 - push {r4,r5,lr} - sub sp, 0x10 - movs r5, 0 - bl sub_813B260 - lsls r0, 24 - cmp r0, 0 - bne _080E3534 - ldr r4, =0x02021cc4 - ldr r0, =0x00004036 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - bl sav3_get_box_name - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - ldr r0, =0x02021dc4 - ldr r1, =0x02039f94 - ldr r1, [r1] - ldr r2, =0x00001e30 - adds r1, r2 - ldr r1, [r1] - bl CopyString - b _080E3574 - .pool -_080E3534: - ldr r4, =0x02021cc4 - ldr r0, =0x00004036 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - bl sav3_get_box_name - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - ldr r0, =0x02021dc4 - ldr r1, =0x02039f94 - ldr r1, [r1] - ldr r2, =0x00001e30 - adds r1, r2 - ldr r1, [r1] - bl CopyString - ldr r4, =0x02021ec4 - bl get_unknown_box_id - lsls r0, 24 - lsrs r0, 24 - bl sav3_get_box_name - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - movs r5, 0x2 -_080E3574: - ldr r0, =0x000008ab - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080E3586 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080E3586: - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_0858BDB8 - lsls r0, r5, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - ldr r2, =0x03003014 - 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, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl AddTextPrinterParametrized - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end pokemon_transfer_to_pc_with_message - - thumb_func_start sub_80E3604 -sub_80E3604: @ 80E3604 - push {lr} - bl RunTextPrinters - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _080E362E - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080E362E - ldr r0, =0x02039f94 - ldr r0, [r0] - ldr r1, =0x00001e10 - adds r0, r1 - movs r1, 0x8 - strb r1, [r0] -_080E362E: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E3604 - - thumb_func_start sub_80E3640 -sub_80E3640: @ 80E3640 - push {lr} - movs r0, 0 - bl sub_80E4630 - bl sub_80E4050 - bl sub_80E373C - movs r0, 0x1 - bl sub_80E3E3C - movs r0, 0 - movs r1, 0 - movs r2, 0x1 - bl sub_80E3948 - movs r0, 0x6 - bl audio_play - ldr r0, =0x02039f94 - ldr r0, [r0] - ldr r1, =0x00001e10 - adds r0, r1 - movs r1, 0x5 - strb r1, [r0] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E3640 - - thumb_func_start sub_80E3680 -sub_80E3680: @ 80E3680 - push {r4-r6,lr} - sub sp, 0x4 - bl sub_80E3794 - lsls r0, 24 - cmp r0, 0 - beq _080E3732 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl sub_80E3DFC - bl sub_80E3F70 - movs r5, 0 - mov r1, sp - movs r2, 0 - ldrsh r1, [r1, r2] - lsls r0, 24 - lsrs r0, 24 - adds r6, r4, 0 - cmp r1, r0 - bne _080E36B2 - movs r5, 0x1 -_080E36B2: - ldr r2, =0x02039f94 - ldr r0, [r2] - ldr r1, =0x00001e10 - adds r0, r1 - movs r1, 0x2 - strb r1, [r0] - ldr r1, [r2] - ldr r3, =0x00001e22 - adds r1, r3 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r4, [r2] - adds r4, r3 - ldrb r0, [r4] - movs r1, 0x3 - bl __umodsi3 - strb r0, [r4] - cmp r5, 0 - beq _080E36F4 - mov r4, sp - bl sub_80E3F70 - lsls r0, 24 - lsrs r0, 24 - b _080E3712 - .pool -_080E36F4: - mov r0, sp - movs r2, 0 - ldrsh r4, [r0, r2] - bl sub_80E3F70 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - blt _080E3714 - mov r4, sp - bl sub_80E3F70 - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x1 -_080E3712: - strh r0, [r4] -_080E3714: - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r6, r2] - bl sub_80E3D78 - bl sub_80E4E5C - movs r0, 0x1 - bl sub_80E4630 - movs r0, 0 - bl sub_80E3E3C -_080E3732: - movs r0, 0 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80E3680 - - thumb_func_start sub_80E373C -sub_80E373C: @ 80E373C - push {r4,lr} - ldr r4, =sub_80E375C - adds r0, r4, 0 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E373C - - thumb_func_start sub_80E375C -sub_80E375C: @ 80E375C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_0858BEC4 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_080E376E: - 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 _080E376E - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E375C - - thumb_func_start sub_80E3794 -sub_80E3794: @ 80E3794 - push {lr} - ldr r0, =sub_80E375C - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _080E37AC - movs r0, 0 - b _080E37AE - .pool -_080E37AC: - movs r0, 0x1 -_080E37AE: - pop {r1} - bx r1 - thumb_func_end sub_80E3794 - - thumb_func_start sub_80E37B4 -sub_80E37B4: @ 80E37B4 - ldr r1, =0x02039f94 - ldr r1, [r1] - ldr r3, =0x00001e18 - adds r2, r1, r3 - movs r3, 0 - strh r3, [r2] - ldr r2, =0x00001e1a - adds r1, r2 - strh r3, [r1] - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - movs r0, 0 - bx lr - .pool - thumb_func_end sub_80E37B4 - - thumb_func_start sub_80E37DC -sub_80E37DC: @ 80E37DC - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r5, =0x02039f94 - ldr r0, [r5] - ldr r2, =0x00001e1a - adds r1, r0, r2 - str r1, [sp] - ldr r1, =0x00001e18 - adds r0, r1 - str r0, [sp, 0x4] - ldrh r0, [r4, 0xA] - adds r0, 0x4 - strh r0, [r4, 0xA] - movs r2, 0xA - ldrsh r0, [r4, r2] - movs r1, 0x28 - bl sine - ldr r1, [r5] - movs r2, 0xF1 - lsls r2, 5 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 2 - add r1, sp - ldr r1, [r1] - strh r0, [r1] - ldrh r0, [r4, 0xA] - adds r0, 0x80 - movs r1, 0xFF - ands r0, r1 - movs r1, 0x28 - bl sine - ldr r1, [r5] - ldr r2, =0x00001e21 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 2 - add r1, sp - ldr r1, [r1] - strh r0, [r1] - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x3F - ble _080E3852 - ldr r0, [r5] - ldr r1, =0x00001e1c - adds r2, r0, r1 - ldrb r3, [r2] - adds r1, 0x2 - adds r0, r1 - ldrh r1, [r0] - strh r1, [r2] - strh r3, [r0] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080E3852: - movs r0, 0 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E37DC - - thumb_func_start sub_80E3870 -sub_80E3870: @ 80E3870 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r5, =0x02039f94 - ldr r0, [r5] - ldr r2, =0x00001e1a - adds r1, r0, r2 - str r1, [sp] - ldr r3, =0x00001e18 - adds r0, r3 - str r0, [sp, 0x4] - ldrh r0, [r4, 0xA] - adds r0, 0x4 - strh r0, [r4, 0xA] - movs r1, 0xA - ldrsh r0, [r4, r1] - movs r1, 0x28 - bl sine - ldr r1, [r5] - movs r2, 0xF1 - lsls r2, 5 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 2 - add r1, sp - ldr r1, [r1] - strh r0, [r1] - ldrh r0, [r4, 0xA] - adds r0, 0x80 - movs r1, 0xFF - ands r0, r1 - movs r1, 0x28 - bl sine - ldr r1, [r5] - ldr r3, =0x00001e21 - adds r1, r3 - ldrb r1, [r1] - lsls r1, 2 - add r1, sp - ldr r1, [r1] - strh r0, [r1] - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x7F - ble _080E38EA - ldr r0, [r5] - movs r2, 0xF1 - lsls r2, 5 - adds r1, r0, r2 - ldrb r2, [r1] - adds r0, r3 - ldrb r0, [r0] - strb r0, [r1] - ldr r0, [r5] - adds r0, r3 - strb r2, [r0] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080E38EA: - movs r0, 0 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E3870 - - thumb_func_start sub_80E3904 -sub_80E3904: @ 80E3904 - push {lr} - ldr r0, =sub_80E375C - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E3904 - - thumb_func_start sub_80E3920 -sub_80E3920: @ 80E3920 - push {lr} - ldr r0, =c3_0809E58C - movs r1, 0x3 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0x3 - strh r0, [r1, 0x8] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E3920 - - thumb_func_start sub_80E3948 -sub_80E3948: @ 80E3948 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r0, =c3_0809E58C - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r4, r1, r0 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r5, r0 - bne _080E3988 - cmp r6, 0 - bne _080E3988 - strh r7, [r4, 0xA] - movs r0, 0x1 - strh r0, [r4, 0xC] - b _080E39B4 - .pool -_080E3988: - cmp r5, 0x3 - bne _080E3998 - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _080E3998 - cmp r6, 0 - beq _080E39B4 -_080E3998: - ldrh r1, [r4, 0x8] - movs r2, 0x8 - ldrsh r0, [r4, r2] - cmp r0, 0x3 - beq _080E39AA - lsls r0, r1, 24 - lsrs r0, 24 - bl sub_80E3AE8 -_080E39AA: - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r7, 0 - bl sub_80E3B10 -_080E39B4: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80E3948 - - thumb_func_start c3_0809E58C -c3_0809E58C: @ 80E39BC - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r4, r1, r0 - ldrh r1, [r4, 0x8] - movs r2, 0x8 - ldrsh r0, [r4, r2] - cmp r0, 0x3 - beq _080E3A6E - movs r3, 0xC - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _080E3A6E - lsls r0, r1, 24 - lsrs r0, 24 - bl sub_80E3A74 - lsls r0, 16 - lsrs r0, 16 - ldrb r3, [r4, 0xE] - adds r1, r3, 0 - adds r2, r3, 0 - bl sub_80B609C - ldrh r1, [r4, 0x12] - movs r2, 0x12 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _080E3A08 - subs r0, r1, 0x1 - strh r0, [r4, 0x12] - lsls r0, 16 - cmp r0, 0 - bne _080E3A6E -_080E3A08: - movs r0, 0x2 - strh r0, [r4, 0x12] - ldrh r1, [r4, 0x10] - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r0, 0 - blt _080E3A32 - ldrh r2, [r4, 0xE] - movs r3, 0xE - ldrsh r0, [r4, r3] - cmp r0, 0xD - bgt _080E3A28 - adds r0, r2, r1 - b _080E3A36 - .pool -_080E3A28: - movs r0, 0x10 - strh r0, [r4, 0xE] - ldrh r0, [r4, 0x14] - adds r0, 0x1 - b _080E3A3C -_080E3A32: - ldrh r3, [r4, 0xE] - adds r0, r1, r3 -_080E3A36: - strh r0, [r4, 0xE] - ldrh r2, [r4, 0x14] - adds r0, r1, r2 -_080E3A3C: - strh r0, [r4, 0x14] - movs r3, 0xE - ldrsh r0, [r4, r3] - ldrh r1, [r4, 0xE] - cmp r0, 0x10 - bne _080E3A5C - movs r2, 0x14 - ldrsh r0, [r4, r2] - cmp r0, 0x16 - bne _080E3A5C - ldr r0, =0x0000fffc - strh r0, [r4, 0x10] - b _080E3A6E - .pool -_080E3A5C: - lsls r0, r1, 16 - asrs r1, r0, 16 - cmp r1, 0 - bne _080E3A6E - ldrh r0, [r4, 0xA] - strh r0, [r4, 0xC] - movs r0, 0x2 - strh r0, [r4, 0x10] - strh r1, [r4, 0x14] -_080E3A6E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end c3_0809E58C - - thumb_func_start sub_80E3A74 -sub_80E3A74: @ 80E3A74 - push {r4-r6,lr} - sub sp, 0x10 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x4 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 20 - movs r1, 0x87 - lsls r1, 1 - adds r5, r1, 0 - adds r0, r5 - add r6, sp, 0x8 - strh r0, [r6] - movs r0, 0x6 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 20 - adds r0, r5 - mov r1, sp - adds r1, 0xA - strh r0, [r1] - movs r0, 0x7 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 20 - adds r0, r5 - add r1, sp, 0xC - strh r0, [r1] - movs r0, 0x7 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 20 - ldr r1, =0x00000101 - adds r0, r1 - mov r1, sp - adds r1, 0xE - strh r0, [r1] - mov r0, sp - adds r1, r6, 0 - movs r2, 0x8 - bl memcpy - lsls r4, 1 - mov r1, sp - adds r0, r1, r4 - ldrh r0, [r0] - add sp, 0x10 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E3A74 - - thumb_func_start sub_80E3AE8 -sub_80E3AE8: @ 80E3AE8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_80E3A74 - lsls r0, 16 - ldr r2, =0x02037b14 - lsrs r0, 15 - adds r2, r0, r2 - ldr r1, =0x02037714 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E3AE8 - - thumb_func_start sub_80E3B10 -sub_80E3B10: @ 80E3B10 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - movs r3, 0 - strh r1, [r0, 0x8] - strh r2, [r0, 0xA] - movs r1, 0x1 - strh r1, [r0, 0xC] - movs r2, 0x4 - strh r2, [r0, 0xE] - movs r1, 0x2 - strh r1, [r0, 0x10] - strh r3, [r0, 0x12] - strh r2, [r0, 0x14] - bx lr - thumb_func_end sub_80E3B10 - - thumb_func_start sub_80E3B30 -sub_80E3B30: @ 80E3B30 - push {r4-r6,lr} - adds r5, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080E3B48 - adds r0, r5, 0 - movs r1, 0 - bl StartObjectImageAnim -_080E3B48: - ldrh r0, [r5, 0x36] - movs r1, 0xFF - ands r1, r0 - adds r6, r5, 0 - adds r6, 0x3E - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r6] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r6] - movs r0, 0x2E - ldrsh r4, [r5, r0] - bl sub_80E3F70 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _080E3B7C - ldrb r0, [r6] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r6] -_080E3B7C: - ldrb r1, [r6] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _080E3BAC - movs r1, 0x36 - ldrsh r0, [r5, r1] - movs r1, 0xFF - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _080E3BAC - movs r2, 0x2E - ldrsh r1, [r5, r2] - movs r2, 0x32 - ldrsh r0, [r5, r2] - cmp r1, r0 - bne _080E3BAC - movs r0, 0x30 - ldrsh r1, [r5, r0] - movs r2, 0x34 - ldrsh r0, [r5, r2] - cmp r1, r0 - beq _080E3BB6 -_080E3BAC: - movs r0, 0 - strh r0, [r5, 0x38] - movs r0, 0x2 - strh r0, [r5, 0x3A] - strh r0, [r5, 0x3C] -_080E3BB6: - ldrh r0, [r5, 0x3C] - subs r0, 0x1 - strh r0, [r5, 0x3C] - lsls r0, 16 - cmp r0, 0 - bne _080E3BDE - ldrh r1, [r5, 0x3A] - ldrh r2, [r5, 0x38] - adds r0, r1, r2 - strh r0, [r5, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - beq _080E3BD6 - cmp r0, 0 - bne _080E3BDA -_080E3BD6: - negs r0, r1 - strh r0, [r5, 0x3A] -_080E3BDA: - movs r0, 0x2 - strh r0, [r5, 0x3C] -_080E3BDE: - movs r1, 0x36 - ldrsh r0, [r5, r1] - movs r1, 0xFF - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _080E3C14 - ldrh r4, [r5, 0x38] - lsls r5, r4, 24 - lsrs r5, 24 - lsls r4, 16 - asrs r4, 17 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 4 - ldr r2, =0x01010000 - adds r0, r2 - lsrs r0, 16 - adds r1, r4, 0 - adds r2, r5, 0 - adds r3, r5, 0 - bl sub_80B609C -_080E3C14: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E3B30 - - thumb_func_start sub_80E3C20 -sub_80E3C20: @ 80E3C20 - push {r4,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r1, =gUnknown_0858BED4 - mov r0, sp - movs r2, 0x8 - bl memcpy - ldrh r1, [r4, 0x2E] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _080E3C44 - subs r0, r1, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - cmp r0, 0 - bne _080E3C52 -_080E3C44: - movs r0, 0x8 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - movs r1, 0x3 - ands r0, r1 - strh r0, [r4, 0x30] -_080E3C52: - movs r1, 0x30 - ldrsh r0, [r4, r1] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - strh r0, [r4, 0x24] - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E3C20 - - thumb_func_start sub_80E3C6C -sub_80E3C6C: @ 80E3C6C - push {r4,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r1, =gUnknown_0858BEDC - mov r0, sp - movs r2, 0x8 - bl memcpy - bl sub_80E4A60 - lsls r0, 24 - ldrh r1, [r4, 0x2E] - lsls r1, 24 - cmp r0, r1 - beq _080E3C98 - movs r0, 0 - strh r0, [r4, 0x26] - strh r0, [r4, 0x30] - b _080E3CBE - .pool -_080E3C98: - movs r1, 0x30 - ldrsh r0, [r4, r1] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _080E3CC0 - ldrh r0, [r4, 0x30] - adds r0, 0x1 - movs r1, 0x3 - ands r0, r1 - strh r0, [r4, 0x30] - movs r0, 0 -_080E3CBE: - strh r0, [r4, 0x32] -_080E3CC0: - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80E3C6C - - thumb_func_start sub_80E3CC8 -sub_80E3CC8: @ 80E3CC8 - push {lr} - bl sub_80E3CE4 - bl sub_80E3F8C - bl sub_80E4218 - bl sub_80E4290 - bl sub_80E4354 - pop {r0} - bx r0 - thumb_func_end sub_80E3CC8 - - thumb_func_start sub_80E3CE4 -sub_80E3CE4: @ 80E3CE4 - push {r4-r6,lr} - ldr r0, =gUnknown_0858C138 - movs r1, 0x26 - movs r2, 0x58 - movs r3, 0x1 - bl AddObjectToFront - ldr r5, =0x02039f94 - ldr r1, [r5] - ldr r4, =0x00001e23 - adds r1, r4 - strb r0, [r1] - movs r0, 0x1 - bl sub_80E3E3C - ldr r6, =0x02020630 - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r3, [r1, 0x5] - movs r2, 0xD - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - movs r3, 0x4 - orrs r0, r3 - strb r0, [r1, 0x5] - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r1, [r0, 0x1] - ands r2, r1 - orrs r2, r3 - strb r2, [r0, 0x1] - ldr r2, [r5] - adds r2, r4 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x1 - strh r1, [r0, 0x3A] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x2 - strh r1, [r0, 0x3A] - movs r0, 0 - movs r1, 0 - bl sub_80E3D78 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E3CE4 - - thumb_func_start sub_80E3D78 -sub_80E3D78: @ 80E3D78 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsls r1, 16 - lsrs r7, r1, 16 - ldr r1, =0x02039f94 - ldr r1, [r1] - ldr r2, =0x00001e23 - adds r1, r2 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - ldr r2, =0x02020630 - adds r5, r1, r2 - lsrs r1, r0, 16 - mov r8, r1 - asrs r6, r0, 16 - ldr r4, =gUnknown_0858BEA0 - bl sub_80E3274 - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r0, [r0] - cmp r6, r0 - bge _080E3DD8 - bl sub_80E3274 - ldr r1, =gUnknown_0858BEA3 - lsls r0, 24 - lsrs r0, 21 - adds r0, r6, r0 - adds r0, r1 - ldrb r0, [r0] - adds r0, 0x26 - b _080E3DDA - .pool -_080E3DD8: - movs r0, 0 -_080E3DDA: - strh r0, [r5, 0x20] - lsls r0, r7, 16 - asrs r0, 12 - adds r0, 0x58 - strh r0, [r5, 0x22] - ldrh r0, [r5, 0x2E] - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x30] - strh r0, [r5, 0x34] - mov r2, r8 - strh r2, [r5, 0x2E] - strh r7, [r5, 0x30] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80E3D78 - - thumb_func_start sub_80E3DFC -sub_80E3DFC: @ 80E3DFC - ldr r2, =0x02039f94 - ldr r2, [r2] - ldr r3, =0x00001e23 - adds r2, r3 - ldrb r3, [r2] - lsls r2, r3, 4 - adds r2, r3 - lsls r2, 2 - ldr r3, =0x02020630 - adds r2, r3 - ldrh r3, [r2, 0x2E] - strh r3, [r0] - ldrh r0, [r2, 0x30] - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_80E3DFC - - thumb_func_start sub_80E3E28 -sub_80E3E28: @ 80E3E28 - push {lr} - bl sub_80E3F70 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl sub_80E3D78 - pop {r0} - bx r0 - thumb_func_end sub_80E3E28 - - thumb_func_start sub_80E3E3C -sub_80E3E3C: @ 80E3E3C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =0x02020630 - ldr r1, =0x02039f94 - ldr r4, [r1] - ldr r1, =0x00001e23 - adds r4, r1 - ldrb r1, [r4] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r5 - ldrh r3, [r2, 0x36] - ldr r1, =0xffffff00 - ands r1, r3 - strh r1, [r2, 0x36] - ldrb r2, [r4] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r5 - ldrh r2, [r1, 0x36] - orrs r0, r2 - strh r0, [r1, 0x36] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0 - bl StartObjectImageAnim - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E3E3C - - thumb_func_start sub_80E3E94 -sub_80E3E94: @ 80E3E94 - push {r4,r5,lr} - lsls r0, 24 - ldr r5, =0x02020630 - ldr r1, =0x02039f94 - ldr r4, [r1] - ldr r1, =0x00001e23 - adds r4, r1 - ldrb r1, [r4] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r5 - ldrh r3, [r2, 0x36] - movs r1, 0xFF - ands r1, r3 - strh r1, [r2, 0x36] - ldrb r2, [r4] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r5 - lsrs r0, 16 - ldrh r2, [r1, 0x36] - orrs r0, r2 - strh r0, [r1, 0x36] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E3E94 - - thumb_func_start sub_80E3ED8 -sub_80E3ED8: @ 80E3ED8 - push {lr} - ldr r0, =0x02039f94 - ldr r0, [r0] - ldr r1, =0x00001e23 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0x1 - bl StartObjectImageAnim - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E3ED8 - - thumb_func_start sub_80E3F04 -sub_80E3F04: @ 80E3F04 - ldr r2, =0x02020630 - ldr r0, =0x02039f94 - ldr r0, [r0] - ldr r1, =0x00001e23 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 27 - lsrs r0, 31 - bx lr - .pool - thumb_func_end sub_80E3F04 - - thumb_func_start sub_80E3F30 -sub_80E3F30: @ 80E3F30 - push {r4,r5,lr} - sub sp, 0x4 - mov r5, sp - adds r5, 0x2 - mov r0, sp - adds r1, r5, 0 - bl sub_80E3DFC - mov r0, sp - movs r1, 0 - ldrsh r4, [r0, r1] - bl sub_80E3F70 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - blt _080E3F64 - ldr r0, =gUnknown_0858BEE4 - movs r2, 0 - ldrsh r1, [r5, r2] - adds r1, r0 - ldrb r0, [r1] - b _080E3F66 - .pool -_080E3F64: - movs r0, 0 -_080E3F66: - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80E3F30 - - thumb_func_start sub_80E3F70 -sub_80E3F70: @ 80E3F70 - push {r4,lr} - ldr r4, =gUnknown_0858BEA0 - bl sub_80E3274 - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r0, [r0] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E3F70 - - thumb_func_start sub_80E3F8C -sub_80E3F8C: @ 80E3F8C - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =gUnknown_0858C0C0 - movs r1, 0xCC - movs r2, 0x58 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02039f94 - ldr r1, [r1] - ldr r2, =0x00001e24 - adds r1, r2 - strb r0, [r1] - lsls r5, r0, 4 - adds r5, r0 - lsls r5, 2 - ldr r0, =0x02020630 - mov r8, r0 - add r5, r8 - ldr r1, =gUnknown_0858C050 - adds r0, r5, 0 - bl SetSpriteOamTables_NoPriorityFromTable - adds r1, r5, 0 - adds r1, 0x3E - ldrb r0, [r1] - movs r6, 0x4 - orrs r0, r6 - strb r0, [r1] - ldr r0, =gUnknown_0858C0F0 - movs r1, 0xCC - movs r2, 0x54 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x3A] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - add r4, r8 - ldr r1, =gUnknown_0858C058 - adds r0, r4, 0 - bl SetSpriteOamTables_NoPriorityFromTable - adds r4, 0x3E - ldrb r0, [r4] - orrs r0, r6 - strb r0, [r4] - ldr r0, =gUnknown_0858C0D8 - movs r1, 0xCC - movs r2, 0x53 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r8 - ldrb r3, [r2, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r3 - orrs r1, r6 - strb r1, [r2, 0x5] - strh r0, [r5, 0x3C] - adds r2, 0x3E - ldrb r0, [r2] - orrs r0, r6 - strb r0, [r2] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E3F8C - - thumb_func_start sub_80E4050 -sub_80E4050: @ 80E4050 - ldr r0, =0x02039f94 - ldr r2, [r0] - ldr r1, =0x00001e24 - adds r0, r2, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0x2 - strh r1, [r0, 0x2E] - ldr r1, =0x00001e22 - adds r2, r1 - ldrb r1, [r2] - strh r1, [r0, 0x30] - bx lr - .pool - thumb_func_end sub_80E4050 - - thumb_func_start sub_80E4084 -sub_80E4084: @ 80E4084 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =gUnknown_0858BEE8 -_080E408A: - movs r1, 0x2E - 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 _080E408A - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E4084 - - thumb_func_start sub_80E40AC -sub_80E40AC: @ 80E40AC - push {r4-r6,lr} - adds r6, r0, 0 - movs r1, 0x3A - ldrsh r0, [r6, r1] - lsls r5, r0, 4 - adds r5, r0 - lsls r5, 2 - ldr r1, =0x02020630 - adds r5, r1 - movs r2, 0x3C - ldrsh r0, [r6, r2] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - adds r4, r1 - ldr r0, =0x02039f94 - ldr r0, [r0] - ldr r1, =0x00001e22 - adds r0, r1 - ldrb r0, [r0] - bl sub_80E3244 - lsls r0, 24 - lsrs r0, 24 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_80E41B8 - ldrh r0, [r6, 0x2E] - adds r0, 0x1 - strh r0, [r6, 0x2E] - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E40AC - - thumb_func_start sub_80E4100 -sub_80E4100: @ 80E4100 - movs r0, 0 - bx lr - thumb_func_end sub_80E4100 - - thumb_func_start sub_80E4104 -sub_80E4104: @ 80E4104 - push {r4,r5,lr} - adds r3, r0, 0 - movs r0, 0x3A - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r2, =0x02020630 - adds r4, r0, r2 - movs r0, 0x3C - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r5, r0, r2 - ldrh r0, [r4, 0x26] - adds r0, 0x1 - strh r0, [r4, 0x26] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _080E4168 - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - ldr r0, =0x0000fffc - strh r0, [r4, 0x26] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r3, 0x30] - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x1 - movs r1, 0x3 - bl __modsi3 - lsls r0, 24 - lsrs r0, 24 - bl sub_80E3244 - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_80E41B8 -_080E4168: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E4104 - - thumb_func_start sub_80E4178 -sub_80E4178: @ 80E4178 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x3A - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r2, r0, r1 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - ldrh r0, [r2, 0x26] - adds r0, 0x1 - strh r0, [r2, 0x26] - lsls r0, 16 - cmp r0, 0 - blt _080E41AC - movs r0, 0 - strh r0, [r2, 0x26] - movs r0, 0x1 - strh r0, [r4, 0x2E] -_080E41AC: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E4178 - - thumb_func_start sub_80E41B8 -sub_80E41B8: @ 80E41B8 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r5, r0, 0 - adds r6, r1, 0 - mov r8, r2 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0858BEF8 - lsls r4, r5, 1 - adds r0, r4, r0 - ldrh r0, [r0] - bl IndexOfObjectPaletteTag - lsls r0, 4 - mov r1, r8 - ldrb r2, [r1, 0x5] - movs r1, 0xF - ands r1, r2 - orrs r1, r0 - mov r0, r8 - strb r1, [r0, 0x5] - ldr r0, =gUnknown_0858BEFE - adds r4, r0 - ldrh r0, [r4] - bl GetObjectTileRangeStartByTag - adds r1, r6, 0 - adds r1, 0x40 - strh r0, [r1] - adds r6, 0x42 - movs r1, 0x3F - ands r1, r5 - ldrb r2, [r6] - movs r0, 0x40 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r6] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E41B8 - - thumb_func_start sub_80E4218 -sub_80E4218: @ 80E4218 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =gUnknown_0858C108 - movs r1, 0xCC - movs r2, 0x74 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r6, =0x02020630 - adds r4, r6 - ldr r0, =gUnknown_0858C070 - mov r8, r0 - adds r0, r4, 0 - mov r1, r8 - bl SetSpriteOamTables_NoPriorityFromTable - adds r4, 0x3E - ldrb r0, [r4] - movs r5, 0x4 - orrs r0, r5 - strb r0, [r4] - ldr r0, =gUnknown_0858C120 - movs r1, 0xCC - movs r2, 0x8C - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - adds r4, r6 - adds r0, r4, 0 - mov r1, r8 - bl SetSpriteOamTables_NoPriorityFromTable - adds r4, 0x3E - ldrb r0, [r4] - orrs r0, r5 - strb r0, [r4] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E4218 - - thumb_func_start sub_80E4290 -sub_80E4290: @ 80E4290 - push {r4-r6,lr} - ldr r5, =0x02039f94 - ldr r0, [r5] - ldr r4, =0x00001e16 - adds r0, r4 - ldrh r1, [r0] - subs r1, 0x5 - ldr r0, =gUnknown_0858C150 - lsls r1, 16 - asrs r1, 16 - movs r2, 0x38 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - ldr r3, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0, 0x5] - movs r2, 0xC - orrs r1, r2 - strb r1, [r0, 0x5] - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r5] - adds r4, r0, r4 - ldrh r1, [r4] - movs r5, 0 - ldr r2, =0x00001e28 - adds r0, r2 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r5, r0 - bcs _080E4334 - adds r6, r3, 0 -_080E42E2: - lsls r1, 16 - asrs r4, r1, 16 - movs r0, 0xC0 - lsls r0, 10 - adds r1, r0 - asrs r1, 16 - ldr r0, =gUnknown_0858C168 - movs r2, 0x3C - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r1, [r0, 0x5] - movs r2, 0xC - orrs r1, r2 - strb r1, [r0, 0x5] - strh r5, [r0, 0x2E] - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r4, 0x8 - lsls r4, 16 - lsrs r1, r4, 16 - ldr r0, =0x02039f94 - ldr r0, [r0] - ldr r2, =0x00001e28 - adds r0, r2 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r5, r0 - bcc _080E42E2 -_080E4334: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E4290 - - thumb_func_start sub_80E4354 -sub_80E4354: @ 80E4354 - push {lr} - ldr r1, =gUnknown_0858BF04 - ldr r0, =0x02039f94 - ldr r0, [r0] - ldr r2, =0x00001e28 - adds r0, r2 - ldr r0, [r0] - ldrb r0, [r0, 0x2] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E4354 - - thumb_func_start TaskDummy2 -TaskDummy2: @ 80E4380 - bx lr - thumb_func_end TaskDummy2 - - thumb_func_start sub_80E4384 -sub_80E4384: @ 80E4384 - push {lr} - sub sp, 0x4 - ldr r0, =0x02039f94 - ldr r0, [r0] - ldr r1, =0x00001e34 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0 - bl sub_808BD3C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =DummyObjectCallback - movs r2, 0 - str r2, [sp] - movs r2, 0x38 - movs r3, 0x25 - bl AddPseudoFieldObject - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x5] - movs r2, 0xC - orrs r1, r2 - strb r1, [r0, 0x5] - movs r1, 0x4 - bl StartObjectImageAnim - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E4384 - - thumb_func_start sub_80E43E0 -sub_80E43E0: @ 80E43E0 - push {r4,lr} - ldr r0, =gUnknown_0858C180 - movs r1, 0x38 - movs r2, 0x29 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - ldr r1, =gUnknown_0858C078 - adds r0, r4, 0 - bl SetSpriteOamTables_NoPriorityFromTable - ldrb r0, [r4, 0x5] - movs r1, 0xC - orrs r0, r1 - strb r0, [r4, 0x5] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E43E0 - - thumb_func_start sub_80E4420 -sub_80E4420: @ 80E4420 - push {lr} - sub sp, 0xC - bl sub_80D2F04 - ldr r0, =0x02039f94 - ldr r3, [r0] - ldr r1, =0x00001e34 - adds r0, r3, r1 - ldrh r0, [r0] - ldr r1, =DummyObjectCallback - movs r2, 0 - str r2, [sp] - ldr r2, =0x00001e38 - adds r3, r2 - ldr r2, [r3] - str r2, [sp, 0x4] - movs r2, 0x1 - str r2, [sp, 0x8] - movs r2, 0x38 - movs r3, 0x28 - bl sub_80D2CC4 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x5] - movs r2, 0xC - orrs r0, r2 - strb r0, [r1, 0x5] - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E4420 - - thumb_func_start sub_80E447C -sub_80E447C: @ 80E447C - push {lr} - sub sp, 0x4 - ldr r1, =DummyObjectCallback - movs r0, 0 - str r0, [sp] - movs r0, 0x13 - movs r2, 0x38 - movs r3, 0x25 - bl AddPseudoFieldObject - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x5] - movs r2, 0xC - orrs r1, r2 - strb r1, [r0, 0x5] - movs r1, 0x4 - bl StartObjectImageAnim - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E447C - - thumb_func_start sub_80E44BC -sub_80E44BC: @ 80E44BC - push {r4,r5,lr} - bl sub_80E460C - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl sub_80E3F30 - lsls r0, 24 - lsrs r0, 24 - cmp r4, 0x8 - bne _080E44DA - bl sub_80E45E0 - b _080E44F6 -_080E44DA: - cmp r4, 0x6 - bne _080E44E4 - bl sub_80E4AF8 - b _080E4504 -_080E44E4: - cmp r5, 0x9 - beq _080E4500 - ldr r1, =gUnknown_0858BF18 - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r5, 0 - bl _call_via_r1 -_080E44F6: - lsls r0, 24 - lsrs r0, 24 - b _080E4506 - .pool -_080E4500: - bl sub_80E3E28 -_080E4504: - movs r0, 0 -_080E4506: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80E44BC - - thumb_func_start sub_80E450C -sub_80E450C: @ 80E450C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl sub_80E3948 - cmp r4, 0x5 - bne _080E4546 - bl sub_80E4B54 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_80E3ED8 - cmp r4, 0 - beq _080E4546 - movs r0, 0x2 - bl sub_80E4630 - ldr r0, =0x02039f94 - ldr r0, [r0] - ldr r1, =0x00001e10 - adds r0, r1 - movs r1, 0x3 - strb r1, [r0] -_080E4546: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E450C - - thumb_func_start sub_80E4558 -sub_80E4558: @ 80E4558 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - movs r1, 0x1 - movs r2, 0 - bl sub_80E3948 - cmp r4, 0x5 - beq _080E4572 - movs r0, 0 - b _080E457A -_080E4572: - bl sub_80E45E0 - lsls r0, 24 - lsrs r0, 24 -_080E457A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80E4558 - - thumb_func_start sub_80E4580 -sub_80E4580: @ 80E4580 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - bl sub_80E3948 - cmp r4, 0x5 - bne _080E459A - bl sub_80E4AF8 -_080E459A: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80E4580 - - thumb_func_start sub_80E45A4 -sub_80E45A4: @ 80E45A4 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0 - bl sub_80E3948 - cmp r4, 0x5 - beq _080E45BE - movs r0, 0 - b _080E45D2 -_080E45BE: - movs r0, 0x5 - bl audio_play - ldr r0, =0x02039f94 - ldr r0, [r0] - ldr r1, =0x00001e10 - adds r0, r1 - movs r1, 0x6 - strb r1, [r0] - movs r0, 0x1 -_080E45D2: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E45A4 - - thumb_func_start sub_80E45E0 -sub_80E45E0: @ 80E45E0 - ldr r0, =0x02039f94 - ldr r0, [r0] - ldr r1, =0x00001e10 - adds r0, r1 - movs r1, 0x4 - strb r1, [r0] - movs r0, 0x1 - bx lr - .pool - thumb_func_end sub_80E45E0 - - thumb_func_start sub_80E45F8 -sub_80E45F8: @ 80E45F8 - push {lr} - ldr r0, =sub_80E465C - movs r1, 0x1 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E45F8 - - thumb_func_start sub_80E460C -sub_80E460C: @ 80E460C - push {lr} - ldr r0, =sub_80E465C - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrb r0, [r1, 0xA] - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E460C - - thumb_func_start sub_80E4630 -sub_80E4630: @ 80E4630 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =sub_80E465C - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E4630 - - thumb_func_start sub_80E465C -sub_80E465C: @ 80E465C - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_0858BF28 - ldr r2, =0x03005e00 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E465C - - thumb_func_start sub_80E468C -sub_80E468C: @ 80E468C - movs r1, 0 - strh r1, [r0, 0xA] - bx lr - thumb_func_end sub_80E468C - - thumb_func_start sub_80E4692 -sub_80E4692: @ 80E4692 - push {lr} - adds r2, r0, 0 - movs r0, 0 - strh r0, [r2, 0xA] - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080E46B4 - movs r0, 0x5 - strh r0, [r2, 0xA] - b _080E46E4 - .pool -_080E46B4: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080E46C2 - movs r0, 0x6 - strh r0, [r2, 0xA] - b _080E46E4 -_080E46C2: - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080E46D0 - movs r0, 0x8 - strh r0, [r2, 0xA] - b _080E46E4 -_080E46D0: - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _080E46DE - movs r0, 0x9 - strh r0, [r2, 0xA] - b _080E46E4 -_080E46DE: - adds r0, r2, 0 - bl sub_80E46F0 -_080E46E4: - pop {r0} - bx r0 - thumb_func_end sub_80E4692 - - thumb_func_start sub_80E46E8 -sub_80E46E8: @ 80E46E8 - movs r1, 0 - strh r1, [r0, 0xA] - bx lr - thumb_func_end sub_80E46E8 - - thumb_func_start sub_80E46F0 -sub_80E46F0: @ 80E46F0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x34 - mov r9, r0 - ldr r1, =gUnknown_0858BF34 - mov r0, sp - movs r2, 0xA - bl memcpy - add r0, sp, 0xC - mov r10, r0 - ldr r1, =gUnknown_0858BF3E - movs r2, 0xA - bl memcpy - mov r1, sp - adds r1, 0x18 - str r1, [sp, 0x2C] - ldr r1, =gUnknown_0858BF48 - ldr r0, [sp, 0x2C] - movs r2, 0x8 - bl memcpy - mov r2, sp - adds r2, 0x20 - str r2, [sp, 0x30] - ldr r1, =gUnknown_0858BF50 - adds r0, r2, 0 - movs r2, 0x6 - bl memcpy - add r4, sp, 0x28 - mov r5, sp - adds r5, 0x2A - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80E3DFC - ldr r0, =0x030022c0 - ldrh r2, [r0, 0x30] - movs r0, 0x40 - ands r0, r2 - lsls r0, 16 - lsrs r0, 16 - negs r0, r0 - lsrs r1, r0, 31 - movs r0, 0x80 - ands r0, r2 - adds r6, r4, 0 - cmp r0, 0 - beq _080E475E - movs r1, 0x2 -_080E475E: - movs r0, 0x20 - ands r0, r2 - cmp r0, 0 - beq _080E4768 - movs r1, 0x3 -_080E4768: - movs r0, 0x10 - ands r0, r2 - cmp r0, 0 - beq _080E4772 - movs r1, 0x4 -_080E4772: - ldrh r0, [r6] - mov r8, r0 - lsls r1, 1 - mov r2, sp - adds r7, r2, r1 - ldrh r0, [r7] - add r0, r8 - strh r0, [r6] - add r1, r10 - ldrh r0, [r1] - ldrh r1, [r5] - adds r0, r1 - strh r0, [r5] - movs r2, 0 - ldrsh r0, [r6, r2] - cmp r0, 0 - bge _080E479E - bl sub_80E3F70 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6] -_080E479E: - movs r0, 0 - ldrsh r4, [r6, r0] - bl sub_80E3F70 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - ble _080E47B2 - movs r0, 0 - strh r0, [r6] -_080E47B2: - movs r1, 0 - ldrsh r0, [r7, r1] - cmp r0, 0 - beq _080E481E - movs r2, 0 - ldrsh r4, [r6, r2] - bl sub_80E3F70 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _080E47F0 - ldrh r0, [r5] - mov r1, r9 - strh r0, [r1, 0xC] - movs r2, 0 - ldrsh r0, [r5, r2] - lsls r0, 1 - ldr r1, [sp, 0x2C] - adds r0, r1, r0 - b _080E481A - .pool -_080E47F0: - mov r2, r8 - lsls r4, r2, 16 - asrs r4, 16 - bl sub_80E3F70 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _080E481E - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - bne _080E4810 - mov r2, r9 - ldrh r0, [r2, 0xC] - b _080E481C -_080E4810: - movs r1, 0 - ldrsh r0, [r5, r1] - lsls r0, 1 - ldr r2, [sp, 0x30] - adds r0, r2, r0 -_080E481A: - ldrh r0, [r0] -_080E481C: - strh r0, [r5] -_080E481E: - movs r0, 0 - ldrsh r4, [r6, r0] - bl sub_80E3F70 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _080E4860 - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0 - bge _080E483A - movs r0, 0x2 - strh r0, [r5] -_080E483A: - movs r2, 0 - ldrsh r0, [r5, r2] - cmp r0, 0x2 - ble _080E4846 - movs r0, 0 - strh r0, [r5] -_080E4846: - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _080E4856 - movs r0, 0x1 - mov r2, r9 - strh r0, [r2, 0xC] - b _080E4878 -_080E4856: - cmp r0, 0x2 - bne _080E4878 - mov r1, r9 - strh r0, [r1, 0xC] - b _080E4878 -_080E4860: - movs r2, 0 - ldrsh r0, [r5, r2] - cmp r0, 0 - bge _080E486C - movs r0, 0x3 - strh r0, [r5] -_080E486C: - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0x3 - ble _080E4878 - movs r0, 0 - strh r0, [r5] -_080E4878: - movs r2, 0 - ldrsh r0, [r6, r2] - movs r2, 0 - ldrsh r1, [r5, r2] - bl sub_80E3D78 - 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_80E46F0 - - thumb_func_start sub_80E4894 -sub_80E4894: @ 80E4894 - push {r4,r5,lr} - sub sp, 0xC - ldr r5, =0x02039f94 - ldr r0, [r5] - ldr r4, =0x00001e14 - adds r0, r4 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r1, [r5] - adds r0, r1, r4 - ldrb r0, [r0] - ldr r2, =0x00001e28 - adds r1, r2 - ldr r1, [r1] - ldr r2, [r1, 0x8] - movs r1, 0x1 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - bl PutWindowTilemap - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E4894 - - thumb_func_start sub_80E48E8 -sub_80E48E8: @ 80E48E8 - push {r4,r5,lr} - sub sp, 0x2C - ldr r5, =0x02039f94 - ldr r0, [r5] - ldr r1, =0x00001e34 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - add r0, sp, 0xC - bl CopyString - ldr r0, [r5] - ldr r1, =0x00001e28 - adds r0, r1 - ldr r0, [r0] - ldr r1, [r0, 0x8] - add r0, sp, 0xC - movs r2, 0xF - bl AppendString_LimitN - ldr r0, [r5] - ldr r4, =0x00001e14 - adds r0, r4 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - movs r1, 0x1 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - add r2, sp, 0xC - movs r3, 0x8 - bl Print - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - bl PutWindowTilemap - add sp, 0x2C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E48E8 - - thumb_func_start sub_80E4964 -sub_80E4964: @ 80E4964 - push {lr} - ldr r1, =gUnknown_0858BF58 - ldr r0, =0x02039f94 - ldr r0, [r0] - ldr r2, =0x00001e2c - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E4964 - - thumb_func_start sub_80E498C -sub_80E498C: @ 80E498C - push {lr} - ldr r1, =gUnknown_0858BF6C - ldr r0, =0x02039f94 - ldr r0, [r0] - ldr r2, =0x00001e28 - adds r0, r2 - ldr r0, [r0] - ldrb r0, [r0, 0x3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E498C - - thumb_func_start TaskDummy3 -TaskDummy3: @ 80E49B8 - bx lr - thumb_func_end TaskDummy3 - - thumb_func_start sub_80E49BC -sub_80E49BC: @ 80E49BC - push {r4,r5,lr} - sub sp, 0x10 - movs r4, 0 - ldr r1, =gUnknown_085E8D49 - add r0, sp, 0xC - bl CopyString - ldr r5, =0x02039f94 - ldr r0, [r5] - ldr r1, =0x00001e36 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0xFF - beq _080E4A0C - cmp r0, 0xFE - bne _080E49E6 - ldr r1, =gUnknown_085E8D4B - add r0, sp, 0xC - bl CopyString - movs r4, 0x1 -_080E49E6: - ldr r0, [r5] - ldr r1, =0x00001e13 - adds r0, r1 - ldrb r0, [r0] - lsls r1, r4, 1 - adds r1, r4 - ldr r2, =gUnknown_0858BF74 - adds r1, r2 - str r1, [sp] - movs r1, 0x1 - negs r1, r1 - str r1, [sp, 0x4] - add r1, sp, 0xC - str r1, [sp, 0x8] - movs r1, 0x1 - movs r2, 0x68 - movs r3, 0x1 - bl box_print -_080E4A0C: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E49BC - - thumb_func_start sub_80E4A2C -sub_80E4A2C: @ 80E4A2C - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - ldr r6, =gUnknown_0858BE40 - bl sub_80E3274 - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 13 - adds r4, r5 - lsls r0, 24 - lsrs r0, 19 - adds r4, r0 - adds r4, r6 - ldrb r0, [r4] - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E4A2C - - thumb_func_start sub_80E4A60 -sub_80E4A60: @ 80E4A60 - push {r4,r5,lr} - movs r2, 0 - ldr r0, =0x02039f94 - ldr r4, [r0] - ldr r3, =0x00001e28 - adds r1, r4, r3 - ldr r1, [r1] - ldrb r3, [r1, 0x1] - adds r5, r0, 0 - cmp r2, r3 - bcs _080E4A9A - movs r0, 0xC0 - lsls r0, 5 - adds r1, r4, r0 -_080E4A7C: - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0xFF - bne _080E4A90 - adds r0, r2, 0 - b _080E4AAA - .pool -_080E4A90: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r3 - bcc _080E4A7C -_080E4A9A: - ldr r0, [r5] - ldr r1, =0x00001e28 - adds r0, r1 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 -_080E4AAA: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E4A60 - - thumb_func_start sub_80E4AB4 -sub_80E4AB4: @ 80E4AB4 - push {lr} - ldr r0, =0x02039f94 - ldr r2, [r0] - ldr r1, =0x00001e28 - adds r0, r2, r1 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - subs r0, 0x1 - lsls r1, r0, 24 - cmp r1, 0 - ble _080E4AF0 - movs r0, 0xC0 - lsls r0, 5 - adds r3, r2, r0 -_080E4AD0: - asrs r2, r1, 24 - adds r0, r3, r2 - ldrb r0, [r0] - cmp r0, 0xFF - beq _080E4AE8 - lsrs r0, r1, 24 - b _080E4AF2 - .pool -_080E4AE8: - subs r0, r2, 0x1 - lsls r1, r0, 24 - cmp r1, 0 - bgt _080E4AD0 -_080E4AF0: - movs r0, 0 -_080E4AF2: - pop {r1} - bx r1 - thumb_func_end sub_80E4AB4 - - thumb_func_start sub_80E4AF8 -sub_80E4AF8: @ 80E4AF8 - push {r4-r6,lr} - bl sub_80E4AB4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r6, =0x02039f94 - ldr r0, [r6] - movs r5, 0xC0 - lsls r5, 5 - adds r0, r5 - adds r0, r4 - movs r1, 0 - strb r1, [r0] - bl sub_80E4D10 - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - ldr r0, [r6] - adds r0, r5 - adds r0, r4 - movs r1, 0xFF - strb r1, [r0] - bl sub_80E3F30 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _080E4B38 - cmp r0, 0x2 - bne _080E4B42 -_080E4B38: - movs r0, 0x1 - movs r1, 0 - movs r2, 0x1 - bl sub_80E3948 -_080E4B42: - movs r0, 0x17 - bl audio_play - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E4AF8 - - thumb_func_start sub_80E4B54 -sub_80E4B54: @ 80E4B54 - push {r4,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl sub_80E3DFC - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl sub_80E4A2C - lsls r0, 24 - lsrs r0, 24 - bl sub_80E4BBC - bl sub_80E4D10 - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - movs r0, 0x5 - bl audio_play - bl sub_80E4AB4 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02039f94 - ldr r1, [r1] - ldr r2, =0x00001e28 - adds r1, r2 - ldr r1, [r1] - ldrb r1, [r1, 0x1] - subs r1, 0x1 - cmp r0, r1 - bne _080E4BB0 - movs r0, 0x1 - b _080E4BB2 - .pool -_080E4BB0: - movs r0, 0 -_080E4BB2: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80E4B54 - - thumb_func_start sub_80E4BBC -sub_80E4BBC: @ 80E4BBC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_80E4A60 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02039f94 - ldr r1, [r1] - movs r2, 0xC0 - lsls r2, 5 - adds r1, r2 - adds r1, r0 - strb r4, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E4BBC - - thumb_func_start sub_80E4BE4 -sub_80E4BE4: @ 80E4BE4 - push {r4,r5,lr} - movs r2, 0 - ldr r1, =0x02039f94 - ldr r0, [r1] - ldr r4, =0x00001e28 - adds r0, r4 - ldr r0, [r0] - adds r5, r1, 0 - b _080E4C44 - .pool -_080E4C00: - ldr r1, [r1] - movs r0, 0xC0 - lsls r0, 5 - adds r3, r1, r0 - adds r0, r3, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080E4C34 - cmp r0, 0xFF - beq _080E4C34 - ldr r2, =0x00001e30 - adds r0, r1, r2 - ldr r0, [r0] - adds r1, r4 - ldr r1, [r1] - ldrb r2, [r1, 0x1] - adds r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - adds r1, r3, 0 - bl CopyString_LimitN - b _080E4C4A - .pool -_080E4C34: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - adds r1, r5, 0 - ldr r0, [r1] - ldr r4, =0x00001e28 - adds r0, r4 - ldr r0, [r0] -_080E4C44: - ldrb r0, [r0, 0x1] - cmp r2, r0 - bcc _080E4C00 -_080E4C4A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E4BE4 - - thumb_func_start choose_name_or_words_screen_load_bg_tile_patterns -choose_name_or_words_screen_load_bg_tile_patterns: @ 80E4C54 - push {r4-r6,lr} - ldr r0, =gUnknown_08DD3838 - ldr r6, =0x02039f94 - ldr r1, [r6] - ldr r4, =0x00001810 - adds r1, r4 - bl LZ77UnCompWram - ldr r1, [r6] - adds r1, r4 - movs r5, 0xC0 - lsls r5, 3 - movs r0, 0x1 - adds r2, r5, 0 - movs r3, 0 - bl LoadBgTiles - ldr r1, [r6] - adds r1, r4 - movs r0, 0x2 - adds r2, r5, 0 - movs r3, 0 - bl LoadBgTiles - ldr r1, [r6] - adds r1, r4 - movs r0, 0x3 - adds r2, r5, 0 - movs r3, 0 - bl LoadBgTiles - ldr r0, =gUnknown_0858C1C8 - bl LoadObjectPics - ldr r0, =gUnknown_0858C230 - bl LoadTaggedObjectPalettes - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end choose_name_or_words_screen_load_bg_tile_patterns - - thumb_func_start sub_80E4CB8 -sub_80E4CB8: @ 80E4CB8 - push {lr} - bl sub_80E45F8 - bl sub_80E3920 - pop {r0} - bx r0 - thumb_func_end sub_80E4CB8 - - thumb_func_start choose_name_or_words_screen_apply_bg_pals -choose_name_or_words_screen_apply_bg_pals: @ 80E4CC8 - push {lr} - ldr r0, =gUnknown_08DD3778 - movs r1, 0 - movs r2, 0xC0 - bl gpu_pal_apply - ldr r0, =gUnknown_0858BD78 - movs r1, 0xA0 - movs r2, 0x20 - bl gpu_pal_apply - movs r0, 0x2 - bl stdpal_get - movs r1, 0xB0 - movs r2, 0x20 - bl gpu_pal_apply - pop {r0} - bx r0 - .pool - thumb_func_end choose_name_or_words_screen_apply_bg_pals - - thumb_func_start sub_80E4CF8 -sub_80E4CF8: @ 80E4CF8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - pop {r0} - bx r0 - thumb_func_end sub_80E4CF8 - - thumb_func_start nullsub_10 -nullsub_10: @ 80E4D0C - bx lr - thumb_func_end nullsub_10 - - thumb_func_start sub_80E4D10 -sub_80E4D10: @ 80E4D10 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - ldr r7, =0x02039f94 - ldr r1, [r7] - ldr r2, =0x00001e28 - adds r0, r1, r2 - ldr r0, [r0] - ldrb r6, [r0, 0x1] - subs r2, 0x12 - adds r0, r1, r2 - ldrh r0, [r0] - subs r0, 0x40 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - ldr r0, =0x00001e13 - adds r1, r0 - ldrb r0, [r1] - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r4, 0 - cmp r4, r6 - bcs _080E4DA6 - add r5, sp, 0xC - mov r10, r4 - ldr r0, =gUnknown_085E8218 - ldrb r0, [r0] - mov r8, r0 -_080E4D52: - ldr r0, [r7] - movs r1, 0xC0 - lsls r1, 5 - adds r0, r1 - adds r0, r4 - ldrb r0, [r0] - strb r0, [r5] - mov r2, r8 - strb r2, [r5, 0x1] - ldrb r0, [r5] - bl sub_80E503C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - cmp r0, 0x1 - bne _080E4D76 - movs r1, 0x2 -_080E4D76: - ldr r0, [r7] - ldr r2, =0x00001e13 - adds r0, r2 - ldrb r0, [r0] - lsls r3, r4, 3 - add r3, r9 - adds r3, r1 - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - mov r1, r10 - str r1, [sp, 0x8] - movs r1, 0x1 - add r2, sp, 0xC - bl Print - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r6 - bcc _080E4D52 -_080E4DA6: - bl sub_80E498C - ldr r5, =0x02039f94 - ldr r0, [r5] - ldr r4, =0x00001e13 - adds r0, r4 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - bl PutWindowTilemap - 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_80E4D10 - - thumb_func_start sub_80E4DE4 -sub_80E4DE4: @ 80E4DE4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - ldr r0, =gUnknown_0858BF88 - adds r0, r5, r0 - ldrb r1, [r0] - adds r0, r6, 0 - bl FillWindowPixelBuffer - movs r4, 0 - ldr r1, =gUnknown_0858BF8C - lsls r0, r5, 2 - adds r0, r1 - ldr r7, [r0] - ldr r0, =gUnknown_0858C198 - mov r8, r0 -_080E4E0E: - lsls r3, r4, 4 - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - str r7, [sp] - movs r0, 0 - str r0, [sp, 0x4] - lsls r0, r4, 2 - lsls r1, r5, 4 - adds r0, r1 - add r0, r8 - ldr r0, [r0] - str r0, [sp, 0x8] - adds r0, r6, 0 - movs r1, 0x1 - movs r2, 0 - bl box_print - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _080E4E0E - adds r0, r6, 0 - bl PutWindowTilemap - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E4DE4 - - thumb_func_start sub_80E4E5C -sub_80E4E5C: @ 80E4E5C - push {r4-r6,lr} - movs r0, 0xA - bl GetGpuReg - adds r4, r0, 0 - movs r5, 0x3 - ands r4, r5 - movs r0, 0xC - bl GetGpuReg - ands r0, r5 - cmp r4, r0 - bls _080E4E8C - movs r5, 0x1 - movs r6, 0x1 - ldr r1, =0x02039f94 - ldr r0, [r1] - ldr r2, =0x00001e11 - b _080E4E96 - .pool -_080E4E8C: - movs r5, 0x2 - movs r6, 0x2 - ldr r1, =0x02039f94 - ldr r0, [r1] - ldr r2, =0x00001e12 -_080E4E96: - adds r0, r2 - ldrb r4, [r0] - adds r0, r1, 0 - ldr r1, =gUnknown_0858BF98 - ldr r0, [r0] - ldr r2, =0x00001e22 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r5, 0 - bl sub_80E4CF8 - bl sub_80E3254 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_80E4DE4 - bl sub_80E3254 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl nullsub_10 - adds r0, r6, 0 - bl CopyBgTilemapBufferToVram - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E4E5C - - thumb_func_start sub_80E4EF0 -sub_80E4EF0: @ 80E4EF0 - push {r4,r5,lr} - sub sp, 0x10 - ldr r1, =gUnknown_0858BFA4 - add r0, sp, 0xC - movs r2, 0x3 - bl memcpy - ldr r5, =0x02039f94 - ldr r0, [r5] - ldr r4, =0x00001e15 - adds r0, r4 - ldrb r0, [r0] - movs r1, 0xFF - bl FillWindowPixelBuffer - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - add r1, sp, 0xC - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - ldr r1, =gUnknown_085EEAF6 - str r1, [sp, 0x8] - movs r1, 0 - movs r2, 0x2 - movs r3, 0x1 - bl box_print - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - bl PutWindowTilemap - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E4EF0 - - thumb_func_start sub_80E4F58 -sub_80E4F58: @ 80E4F58 - push {lr} - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_80E4F58 - - thumb_func_start sub_80E4F70 -sub_80E4F70: @ 80E4F70 - push {lr} - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - bl SetHBlankCallback - pop {r0} - bx r0 - thumb_func_end sub_80E4F70 - - thumb_func_start sub_80E4F84 -sub_80E4F84: @ 80E4F84 - push {lr} - ldr r0, =sub_80E4F94 - bl SetVBlankCallback - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E4F84 - - thumb_func_start sub_80E4F94 -sub_80E4F94: @ 80E4F94 - push {r4,r5,lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - ldr r5, =0x02039f94 - ldr r0, [r5] - ldr r1, =0x00001e18 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x16 - bl SetGpuReg - ldr r0, [r5] - ldr r1, =0x00001e1a - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x1A - bl SetGpuReg - movs r0, 0xA - bl GetGpuReg - ldr r4, =0x0000fffc - adds r1, r4, 0 - ands r1, r0 - movs r0, 0xA - bl SetGpuReg - ldr r0, [r5] - ldr r1, =0x00001e1c - adds r0, r1 - ldrh r1, [r0] - movs r0, 0xA - bl SetGpuRegBits - movs r0, 0xC - bl GetGpuReg - ands r4, r0 - movs r0, 0xC - adds r1, r4, 0 - bl SetGpuReg - ldr r0, [r5] - ldr r1, =0x00001e1e - adds r0, r1 - ldrh r1, [r0] - movs r0, 0xC - bl SetGpuRegBits - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E4F94 - - thumb_func_start sub_80E501C -sub_80E501C: @ 80E501C - push {lr} - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - pop {r0} - bx r0 - thumb_func_end sub_80E501C - - thumb_func_start sub_80E503C -sub_80E503C: @ 80E503C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r2, 0 - ldr r0, =gUnknown_0858BDC8 - ldrb r1, [r0] - adds r3, r0, 0 - cmp r1, 0xFF - beq _080E5066 - adds r1, r3, 0 -_080E5050: - adds r0, r2, r1 - ldrb r0, [r0] - cmp r4, r0 - beq _080E5066 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - adds r0, r2, r3 - ldrb r0, [r0] - cmp r0, 0xFF - bne _080E5050 -_080E5066: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E503C - - thumb_func_start sub_80E5074 -sub_80E5074: @ 80E5074 - push {lr} - sub sp, 0x8 - ldr r0, =0x03005d90 - ldr r1, [r0] - ldrb r2, [r1, 0x8] - movs r0, 0 - str r0, [sp] - ldr r0, =sub_8086194 - str r0, [sp, 0x4] - movs r0, 0 - movs r3, 0 - bl do_choose_name_or_words_screen - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E5074 - - thumb_func_start sub_80E509C -sub_80E509C: @ 80E509C - push {lr} - sub sp, 0x8 - ldr r0, =0x03005d90 - ldr r1, [r0] - ldrb r2, [r1, 0x8] - movs r0, 0 - str r0, [sp] - ldr r0, =sub_8086194 - str r0, [sp, 0x4] - movs r0, 0x1 - movs r3, 0 - bl do_choose_name_or_words_screen - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E509C - - thumb_func_start sub_80E50C4 -sub_80E50C4: @ 80E50C4 - push {lr} - sub sp, 0x8 - ldr r0, =0x03005d90 - ldr r1, [r0] - ldrb r2, [r1, 0x8] - movs r0, 0 - str r0, [sp] - ldr r0, =sub_8086194 - str r0, [sp, 0x4] - movs r0, 0x2 - movs r3, 0 - bl do_choose_name_or_words_screen - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E50C4 - - thumb_func_start sub_80E50EC -sub_80E50EC: @ 80E50EC - push {lr} - sub sp, 0x8 - ldr r0, =0x03005d90 - ldr r1, [r0] - ldrb r2, [r1, 0x8] - movs r0, 0 - str r0, [sp] - ldr r0, =sub_8086194 - str r0, [sp, 0x4] - movs r0, 0x3 - movs r3, 0 - bl do_choose_name_or_words_screen - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E50EC - - thumb_func_start DecryptMoney -@ int DecryptMoney(u32 *moneyPointer) -DecryptMoney: @ 80E5114 - ldr r1, =0x03005d90 - ldr r1, [r1] - adds r1, 0xAC - ldr r0, [r0] - ldr r1, [r1] - eors r0, r1 - bx lr - .pool - thumb_func_end DecryptMoney - - thumb_func_start EncryptMoney -@ void EncryptMoney(u32 *moneyPointer, u32 moneyAmount) -EncryptMoney: @ 80E5128 - ldr r2, =0x03005d90 - ldr r2, [r2] - adds r2, 0xAC - ldr r2, [r2] - eors r2, r1 - str r2, [r0] - bx lr - .pool - thumb_func_end EncryptMoney - - thumb_func_start IsEnoughMoney -@ bool8 IsEnoughMoney(u32 *moneyPointer, u32 price) -IsEnoughMoney: @ 80E513C - push {r4,lr} - adds r4, r1, 0 - bl DecryptMoney - cmp r0, r4 - bcs _080E514C - movs r0, 0 - b _080E514E -_080E514C: - movs r0, 0x1 -_080E514E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end IsEnoughMoney - - thumb_func_start add_money -@ void add_money(int *money_ptr, int amount) -add_money: @ 80E5154 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - bl DecryptMoney - adds r5, r0, 0 - adds r0, r5, r4 - ldr r5, =0x000f423f - adds r4, r5, 0 - cmp r0, r5 - bhi _080E5178 - adds r5, r0, 0 - adds r0, r6, 0 - bl DecryptMoney - cmp r5, r0 - bcs _080E5178 - adds r5, r4, 0 -_080E5178: - adds r0, r6, 0 - adds r1, r5, 0 - bl EncryptMoney - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end add_money - - thumb_func_start subtract_money -@ void subtract_money(int *money_ptr, int amount) -subtract_money: @ 80E518C - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - bl DecryptMoney - adds r1, r0, 0 - cmp r1, r4 - bcs _080E51A0 - movs r1, 0 - b _080E51A2 -_080E51A0: - subs r1, r4 -_080E51A2: - adds r0, r5, 0 - bl EncryptMoney - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end subtract_money - - thumb_func_start sub_80E51B0 -sub_80E51B0: @ 80E51B0 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - ldr r1, =0x020375e2 - ldrh r1, [r1] - bl IsEnoughMoney - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E51B0 - - thumb_func_start sub_80E51D4 -sub_80E51D4: @ 80E51D4 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - ldr r1, =0x020375e2 - ldrh r1, [r1] - bl subtract_money - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E51D4 - - thumb_func_start PrintMoneyAmountInMoneyBox -@ void PrintMoneyAmountInMoneyBox(u8 windowId, int amount, s8 a3) -PrintMoneyAmountInMoneyBox: @ 80E51F4 - push {lr} - sub sp, 0x4 - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp] - movs r1, 0x26 - movs r2, 0x1 - bl PrintMoneyAmount - add sp, 0x4 - pop {r0} - bx r0 - thumb_func_end PrintMoneyAmountInMoneyBox - - thumb_func_start PrintMoneyAmount -@ void PrintMoneyAmount(u8 windowId, char x, char y, int amount, u8 a5) -PrintMoneyAmount: @ 80E5214 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - ldr r4, [sp, 0x24] - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r2, 24 - lsrs r6, r2, 24 - lsls r4, 24 - lsrs r5, r4, 24 - ldr r4, =0x02021cc4 - adds r0, r4, 0 - adds r1, r3, 0 - movs r2, 0 - movs r3, 0x6 - bl ConvertIntToDecimalString - adds r0, r4, 0 - bl GetStringLength - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - subs r1, r0 - ldr r2, =0x02021fc4 - adds r0, r1, 0 - subs r1, 0x1 - cmp r0, 0 - ble _080E5264 - movs r3, 0x77 -_080E5258: - strb r3, [r2] - adds r2, 0x1 - adds r0, r1, 0 - subs r1, 0x1 - cmp r0, 0 - bgt _080E5258 -_080E5264: - ldr r1, =gUnknown_085E969C - adds r0, r2, 0 - bl ExpandStringRefs - ldr r2, =0x02021fc4 - str r6, [sp] - str r5, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r7, 0 - movs r1, 0x1 - mov r3, r8 - bl Print - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end PrintMoneyAmount - - thumb_func_start set_window_border_style_and_print_money_box -@ void set_window_border_style_and_print_money_box(u8 windowId, u16 tileStart, u8 palette, int amount) -set_window_border_style_and_print_money_box: @ 80E5298 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r6, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - mov r8, r3 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - adds r0, r6, 0 - movs r1, 0 - adds r2, r4, 0 - adds r3, r5, 0 - bl SetWindowBorderStyle - adds r0, r6, 0 - mov r1, r8 - movs r2, 0 - bl PrintMoneyAmountInMoneyBox - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end set_window_border_style_and_print_money_box - - thumb_func_start sub_80E52D4 -sub_80E52D4: @ 80E52D4 - push {lr} - adds r1, r0, 0 - ldr r0, =0x02039f98 - ldrb r0, [r0] - movs r2, 0 - bl PrintMoneyAmountInMoneyBox - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E52D4 - - thumb_func_start sub_80E52EC -@ void sub_80E52EC(int money, int x, int y) -sub_80E52EC: @ 80E52EC - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x18 - mov r8, r0 - adds r4, r1, 0 - adds r3, r2, 0 - lsls r4, 24 - lsls r3, 24 - lsrs r6, r4, 24 - movs r0, 0x80 - lsls r0, 17 - adds r4, r0 - lsrs r4, 24 - lsrs r5, r3, 24 - adds r3, r0 - lsrs r3, 24 - movs r0, 0xA - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - movs r0, 0x8 - str r0, [sp, 0xC] - add r0, sp, 0x10 - movs r1, 0 - adds r2, r4, 0 - bl rbox_template_set - ldr r4, =0x02039f98 - add r0, sp, 0x10 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl FillWindowPixelBuffer - ldrb r0, [r4] - bl PutWindowTilemap - ldrb r0, [r4] - movs r1, 0x1 - bl CopyWindowToVram - ldrb r0, [r4] - movs r1, 0x85 - lsls r1, 2 - movs r2, 0xE - mov r3, r8 - bl set_window_border_style_and_print_money_box - lsls r6, 19 - movs r0, 0x98 - lsls r0, 13 - adds r6, r0 - lsrs r6, 16 - lsls r5, 19 - movs r0, 0xB0 - lsls r0, 12 - adds r5, r0 - lsrs r5, 16 - adds r0, r6, 0 - adds r1, r5, 0 - bl AddMoneyLabelObject - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E52EC - - thumb_func_start sub_80E5384 -sub_80E5384: @ 80E5384 - push {r4,lr} - bl RemoveMoneyLabelObject - ldr r4, =0x02039f98 - ldrb r0, [r4] - movs r1, 0 - bl sub_8198070 - ldrb r0, [r4] - movs r1, 0x2 - bl CopyWindowToVram - ldrb r0, [r4] - bl RemoveWindow - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E5384 - - thumb_func_start AddMoneyLabelObject -AddMoneyLabelObject: @ 80E53AC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - ldr r0, =gUnknown_0858C2A4 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0858C2AC - bl LoadCompressedObjectPalette - ldr r0, =gUnknown_0858C28C - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0 - bl AddObjectToFront - ldr r1, =0x02039f99 - strb r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end AddMoneyLabelObject - - thumb_func_start RemoveMoneyLabelObject -RemoveMoneyLabelObject: @ 80E53F4 - push {lr} - ldr r0, =0x02039f99 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeResources - pop {r0} - bx r0 - .pool - thumb_func_end RemoveMoneyLabelObject - - thumb_func_start AreMovesContestCombo -@ u8 AreMovesContestCombo(u16 moveId1, u16 moveId2) -AreMovesContestCombo: @ 80E5414 - push {r4,lr} - sub sp, 0x4 - lsls r0, 16 - lsls r1, 16 - ldr r2, =gContestMoves - lsrs r0, 13 - adds r0, r2 - ldrb r4, [r0, 0x2] - mov r3, sp - lsrs r1, 13 - adds r1, r2 - ldrb r0, [r1, 0x3] - strb r0, [r3] - mov r2, sp - ldrb r0, [r1, 0x4] - strb r0, [r2, 0x1] - ldrb r0, [r1, 0x5] - strb r0, [r2, 0x2] - mov r0, sp - ldrb r1, [r1, 0x6] - strb r1, [r0, 0x3] - cmp r4, 0 - beq _080E5470 - mov r0, sp - ldrb r0, [r0] - cmp r4, r0 - beq _080E545E - mov r0, sp - ldrb r0, [r0, 0x1] - cmp r4, r0 - beq _080E545E - mov r0, sp - ldrb r0, [r0, 0x2] - cmp r4, r0 - beq _080E545E - cmp r4, r1 - bne _080E5470 -_080E545E: - ldr r0, =gComboStarterLookupTable - adds r0, r4, r0 - ldrb r0, [r0] - b _080E5472 - .pool -_080E5470: - movs r0, 0 -_080E5472: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end AreMovesContestCombo - - thumb_func_start ContestEffectFunc_080E547C -ContestEffectFunc_080E547C: @ 80E547C - bx lr - thumb_func_end ContestEffectFunc_080E547C - - thumb_func_start ContestEffectFunc_080E5480 -ContestEffectFunc_080E5480: @ 80E5480 - push {lr} - ldr r3, =0x02039f34 - ldr r1, [r3] - ldr r0, [r1, 0x8] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x10] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0, 0x10] - ldr r0, [r3] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0 - bl sub_80DD3D4 - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E5480 - - thumb_func_start ContestEffectFunc_080E54B0 -ContestEffectFunc_080E54B0: @ 80E54B0 - push {lr} - ldr r3, =0x02039f34 - ldr r1, [r3] - ldr r0, [r1, 0x8] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x11] - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0, 0x11] - ldr r0, [r3] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x1 - bl sub_80DD3D4 - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E54B0 - - thumb_func_start ContestEffectFunc_080E54E0 -ContestEffectFunc_080E54E0: @ 80E54E0 - ldr r3, =0x02039f34 - ldr r1, [r3] - ldr r0, [r1, 0x8] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x10] - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0, 0x10] - ldr r1, [r3] - ldr r0, [r1, 0x8] - ldrb r0, [r0, 0x11] - ldr r2, [r1, 0x4] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1, 0x15] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x15] - ldr r1, [r3] - ldr r0, [r1, 0x8] - ldrb r0, [r0, 0x11] - ldr r2, [r1, 0x4] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1, 0xB] - movs r0, 0x71 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0xB] - bx lr - .pool - thumb_func_end ContestEffectFunc_080E54E0 - - thumb_func_start ContestEffectFunc_080E5534 -ContestEffectFunc_080E5534: @ 80E5534 - push {lr} - ldr r3, =0x02039f34 - ldr r1, [r3] - ldr r0, [r1, 0x8] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0, 0x12] - ldr r0, [r3] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x2 - bl sub_80DD3D4 - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E5534 - - thumb_func_start ContestEffectFunc_080E5560 -ContestEffectFunc_080E5560: @ 80E5560 - push {lr} - ldr r3, =0x02039f34 - ldr r1, [r3] - ldr r0, [r1, 0x8] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x10] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0, 0x10] - ldr r0, [r3] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x3 - bl sub_80DD3D4 - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E5560 - - thumb_func_start ContestEffectFunc_080E5590 -ContestEffectFunc_080E5590: @ 80E5590 - push {lr} - ldr r3, =0x02039f34 - ldr r1, [r3] - ldr r0, [r1, 0x8] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0x14 - strb r1, [r0, 0xF] - ldr r0, [r3] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x4 - bl sub_80DD3D4 - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E5590 - - thumb_func_start ContestEffectFunc_080E55BC -ContestEffectFunc_080E55BC: @ 80E55BC - push {lr} - ldr r3, =0x02039f34 - ldr r1, [r3] - ldr r0, [r1, 0x8] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x10] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0, 0x10] - ldr r0, [r3] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x5 - bl sub_80DD3D4 - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E55BC - - thumb_func_start ContestEffectFunc_080E55EC -ContestEffectFunc_080E55EC: @ 80E55EC - push {r4,r5,lr} - movs r2, 0 - ldr r5, =0x02039f34 - ldr r0, [r5] - ldr r1, [r0, 0x8] - ldrb r4, [r1, 0x11] - adds r3, r1, r4 - ldrb r0, [r3] - cmp r0, 0 - beq _080E563A - subs r0, 0x1 - ldrb r1, [r1] - cmp r0, r1 - beq _080E5622 - adds r3, r5, 0 -_080E560A: - adds r2, 0x1 - cmp r2, 0x3 - bgt _080E5622 - ldr r0, [r3] - ldr r1, [r0, 0x8] - adds r0, r1, r4 - ldrb r0, [r0] - subs r0, 0x1 - adds r1, r2 - ldrb r1, [r1] - cmp r0, r1 - bne _080E560A -_080E5622: - ldr r1, =0x02039f34 - ldr r0, [r1] - ldr r0, [r0, 0x8] - strb r2, [r0, 0x8] - ldr r0, [r1] - ldr r1, [r0, 0x8] - movs r0, 0xFF - strb r0, [r1, 0x9] - bl sub_80E6A2C - lsls r0, 24 - lsrs r2, r0, 24 -_080E563A: - cmp r2, 0 - bne _080E564C - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x36 - bl sub_80DD3F0 -_080E564C: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x30 - bl sub_80DD3D4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E55EC - - thumb_func_start ContestEffectFunc_080E5664 -ContestEffectFunc_080E5664: @ 80E5664 - push {r4-r6,lr} - movs r1, 0 - ldr r2, =0x02039f34 - ldr r0, [r2] - ldr r0, [r0, 0x8] - ldrb r5, [r0, 0x11] - adds r0, r5 - ldrb r0, [r0] - cmp r0, 0 - beq _080E56B4 - movs r3, 0 - movs r4, 0 - adds r6, r2, 0 -_080E567E: - ldr r0, [r6] - ldr r2, [r0, 0x8] - adds r0, r2, r5 - adds r1, r2, r3 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bls _080E5698 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r4 - strb r3, [r0] - adds r4, 0x1 -_080E5698: - adds r3, 0x1 - cmp r3, 0x3 - ble _080E567E - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - adds r0, 0x8 - adds r0, r4 - movs r1, 0xFF - strb r1, [r0] - bl sub_80E6A2C - lsls r0, 24 - lsrs r1, r0, 24 -_080E56B4: - cmp r1, 0 - bne _080E56C6 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x36 - bl sub_80DD3F0 -_080E56C6: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x30 - bl sub_80DD3D4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E5664 - - thumb_func_start ContestEffectFunc_080E56E0 -ContestEffectFunc_080E56E0: @ 80E56E0 - push {lr} - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x14 - cmp r0, 0x1 - bls _080E5702 - movs r1, 0x3C - cmp r0, 0x7 - bhi _080E5702 - movs r1, 0x28 -_080E5702: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - strh r1, [r0, 0x4] - bl ContestEffectFunc_080E55EC - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E56E0 - - thumb_func_start ContestEffectFunc_080E5718 -ContestEffectFunc_080E5718: @ 80E5718 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r7, 0 - ldr r1, =0x02039f34 - ldr r0, [r1] - ldr r0, [r0, 0x8] - ldrb r5, [r0, 0x11] - adds r0, r5 - ldrb r0, [r0] - mov r8, r1 - cmp r0, 0 - beq _080E579E - movs r4, 0 - mov r6, r8 -_080E5736: - ldr r0, [r6] - ldr r2, [r0, 0x8] - adds r0, r2, r5 - adds r1, r2, r4 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bls _080E5798 - strb r4, [r2, 0x8] - ldr r0, [r6] - ldr r1, [r0, 0x8] - movs r0, 0xFF - strb r0, [r1, 0x9] - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - cmp r0, 0 - beq _080E5782 - movs r1, 0xA - cmp r0, 0x2 - bls _080E5782 - movs r1, 0x14 - cmp r0, 0x4 - bls _080E5782 - movs r1, 0x1E - cmp r0, 0x6 - bls _080E5782 - movs r1, 0x3C - cmp r0, 0x8 - bhi _080E5782 - movs r1, 0x28 -_080E5782: - ldr r0, [r6] - ldr r0, [r0, 0x8] - strh r1, [r0, 0x4] - bl sub_80E6A2C - lsls r0, 24 - cmp r0, 0 - beq _080E5798 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 -_080E5798: - adds r4, 0x1 - cmp r4, 0x3 - ble _080E5736 -_080E579E: - mov r1, r8 - ldr r0, [r1] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x30 - bl sub_80DD3D4 - cmp r7, 0 - bne _080E57BE - mov r1, r8 - ldr r0, [r1] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x36 - bl sub_80DD3F0 -_080E57BE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E5718 - - thumb_func_start ContestEffectFunc_080E57CC -ContestEffectFunc_080E57CC: @ 80E57CC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r0, 0 - mov r9, r0 - ldr r1, =0x02039f34 - ldr r0, [r1] - ldr r0, [r0, 0x8] - ldrb r2, [r0, 0x11] - mov r8, r2 - add r0, r8 - ldrb r0, [r0] - mov r10, r1 - cmp r0, 0 - beq _080E5858 - movs r6, 0 - mov r7, r10 - movs r5, 0 -_080E57F4: - ldr r2, [r7] - ldr r0, [r2, 0x8] - mov r3, r8 - adds r1, r0, r3 - adds r0, r6 - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - bls _080E5850 - ldr r0, [r2, 0x4] - adds r0, r5, r0 - ldrb r1, [r0, 0x15] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080E5850 - lsls r0, r6, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_80E69C8 - lsls r0, 24 - cmp r0, 0 - beq _080E5850 - ldr r0, [r7] - ldr r2, [r0, 0x4] - adds r2, r5, r2 - ldrb r0, [r2, 0x15] - movs r3, 0x11 - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 - strb r0, [r2, 0x15] - ldr r0, [r7] - ldr r2, [r0, 0x4] - adds r2, r5, r2 - ldrb r0, [r2, 0x15] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r2, 0x15] - adds r0, r4, 0 - movs r1, 0x8 - bl sub_80DD3D4 - movs r0, 0x1 - mov r9, r0 -_080E5850: - adds r5, 0x1C - adds r6, 0x1 - cmp r6, 0x3 - ble _080E57F4 -_080E5858: - mov r1, r10 - ldr r0, [r1] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x7 - bl sub_80DD3D4 - mov r2, r9 - cmp r2, 0 - bne _080E587A - mov r3, r10 - ldr r0, [r3] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x36 - bl sub_80DD3F0 -_080E587A: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E57CC - - thumb_func_start ContestEffectFunc_080E588C -ContestEffectFunc_080E588C: @ 80E588C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r0, 0 - mov r9, r0 - ldr r1, =0x02039f34 - ldr r0, [r1] - ldr r0, [r0, 0x8] - ldrb r7, [r0, 0x11] - adds r0, r7 - ldrb r0, [r0] - adds r4, r1, 0 - cmp r0, 0 - beq _080E590A - movs r5, 0 - movs r6, 0 - mov r8, r4 -_080E58B0: - ldr r3, [r4] - ldr r2, [r3, 0x8] - adds r0, r2, r7 - adds r1, r2, r5 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bls _080E5900 - ldr r0, [r3, 0x4] - adds r0, r6, r0 - ldrb r1, [r0, 0x15] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080E58D8 - movs r0, 0x32 - b _080E58DA - .pool -_080E58D8: - movs r0, 0xA -_080E58DA: - strh r0, [r2, 0x4] - mov r1, r8 - ldr r0, [r1] - ldr r0, [r0, 0x8] - strb r5, [r0, 0x8] - ldr r0, [r1] - ldr r1, [r0, 0x8] - movs r0, 0xFF - strb r0, [r1, 0x9] - bl sub_80E6A2C - lsls r0, 24 - cmp r0, 0 - beq _080E5900 - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_080E5900: - adds r6, 0x1C - adds r5, 0x1 - ldr r4, =0x02039f34 - cmp r5, 0x3 - ble _080E58B0 -_080E590A: - ldr r0, [r4] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x30 - bl sub_80DD3D4 - mov r0, r9 - cmp r0, 0 - bne _080E5928 - ldr r0, [r4] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x36 - bl sub_80DD3F0 -_080E5928: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E588C - - thumb_func_start ContestEffectFunc_080E5938 -ContestEffectFunc_080E5938: @ 80E5938 - push {r4,lr} - ldr r4, =0x02039f34 - ldr r1, [r4] - ldr r0, [r1, 0x8] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x11] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0, 0x11] - bl ContestEffectFunc_080E5664 - ldr r0, [r4] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x30 - bl sub_80DD3D4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E5938 - - thumb_func_start ContestEffectFunc_080E5970 -ContestEffectFunc_080E5970: @ 80E5970 - push {r4,lr} - ldr r4, =0x02039f34 - ldr r1, [r4] - ldr r0, [r1, 0x8] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x6] - ldr r1, =gContestMoves - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0, 0x1] - lsls r0, 29 - lsrs r0, 29 - bl sub_80E6934 - ldr r0, [r4] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x30 - bl sub_80DD3D4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E5970 - - thumb_func_start ContestEffectFunc_080E59B0 -ContestEffectFunc_080E59B0: @ 80E59B0 - push {lr} - movs r0, 0 - bl sub_80E6934 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x30 - bl sub_80DD3D4 - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E59B0 - - thumb_func_start ContestEffectFunc_080E59D0 -ContestEffectFunc_080E59D0: @ 80E59D0 - push {lr} - movs r0, 0x1 - bl sub_80E6934 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x30 - bl sub_80DD3D4 - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E59D0 - - thumb_func_start ContestEffectFunc_080E59F0 -ContestEffectFunc_080E59F0: @ 80E59F0 - push {lr} - movs r0, 0x2 - bl sub_80E6934 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x30 - bl sub_80DD3D4 - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E59F0 - - thumb_func_start ContestEffectFunc_080E5A10 -ContestEffectFunc_080E5A10: @ 80E5A10 - push {lr} - movs r0, 0x3 - bl sub_80E6934 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x30 - bl sub_80DD3D4 - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E5A10 - - thumb_func_start ContestEffectFunc_080E5A30 -ContestEffectFunc_080E5A30: @ 80E5A30 - push {lr} - movs r0, 0x4 - bl sub_80E6934 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x30 - bl sub_80DD3D4 - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E5A30 - - thumb_func_start ContestEffectFunc_080E5A50 -ContestEffectFunc_080E5A50: @ 80E5A50 - push {r4-r6,lr} - movs r4, 0 - ldr r2, =0x02039f34 - ldr r0, [r2] - ldr r0, [r0, 0x8] - ldrb r1, [r0, 0x11] - adds r0, r1 - ldrb r0, [r0] - adds r6, r2, 0 - cmp r0, 0x3 - beq _080E5AB0 - movs r5, 0 -_080E5A68: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0x8] - ldrb r0, [r1, 0x11] - adds r0, r1, r0 - ldrb r0, [r0] - adds r0, 0x1 - adds r1, r5 - ldrb r1, [r1] - cmp r0, r1 - bne _080E5AAA - lsls r0, r5, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_80E69C8 - lsls r0, 24 - cmp r0, 0 - beq _080E5AA0 - adds r0, r4, 0 - bl sub_80DD560 - adds r0, r4, 0 - movs r1, 0xA - b _080E5AA4 - .pool -_080E5AA0: - adds r0, r4, 0 - movs r1, 0x3C -_080E5AA4: - bl sub_80DD3D4 - movs r4, 0x1 -_080E5AAA: - adds r5, 0x1 - cmp r5, 0x3 - ble _080E5A68 -_080E5AB0: - ldr r0, [r6] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x9 - bl sub_80DD3D4 - cmp r4, 0 - bne _080E5ACC - ldr r0, [r6] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x36 - bl sub_80DD3F0 -_080E5ACC: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end ContestEffectFunc_080E5A50 - - thumb_func_start ContestEffectFunc_080E5AD4 -ContestEffectFunc_080E5AD4: @ 80E5AD4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - movs r0, 0 - mov r9, r0 - movs r1, 0 - str r1, [sp, 0x18] - mov r0, sp - movs r1, 0xFF - movs r2, 0x5 - bl memset - movs r5, 0 - movs r4, 0 - add r2, sp, 0x10 - mov r8, r2 - add r3, sp, 0x8 - mov r10, r3 - movs r6, 0 -_080E5B00: - ldr r0, =0x02039f34 - ldr r2, [r0] - ldr r1, [r2, 0x8] - ldrb r0, [r1, 0x11] - adds r0, r1, r0 - adds r1, r5 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcs _080E5B38 - ldr r0, [r2, 0x4] - adds r0, r6, r0 - ldrb r1, [r0, 0xC] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080E5B38 - lsls r0, r5, 24 - lsrs r0, 24 - bl sub_80DBCA8 - lsls r0, 24 - cmp r0, 0 - bne _080E5B38 - mov r1, sp - adds r0, r1, r4 - strb r5, [r0] - adds r4, 0x1 -_080E5B38: - adds r6, 0x1C - adds r5, 0x1 - cmp r5, 0x3 - ble _080E5B00 - cmp r4, 0x1 - bne _080E5B50 - movs r0, 0x3C - mov r2, r8 - strh r0, [r2] - b _080E5B7E - .pool -_080E5B50: - cmp r4, 0x2 - bne _080E5B5E - movs r0, 0x1E - mov r3, r8 - strh r0, [r3] - strh r0, [r3, 0x2] - b _080E5B7E -_080E5B5E: - cmp r4, 0x3 - bne _080E5B6E - movs r0, 0x14 - mov r6, r8 - strh r0, [r6] - strh r0, [r6, 0x2] - strh r0, [r6, 0x4] - b _080E5B7E -_080E5B6E: - mov r1, r8 - movs r2, 0 - mov r0, r8 - adds r0, 0x6 -_080E5B76: - strh r2, [r0] - subs r0, 0x2 - cmp r0, r1 - bge _080E5B76 -_080E5B7E: - movs r5, 0 - ldr r7, =0x02039f34 - movs r6, 0 - mov r4, r10 -_080E5B86: - ldr r0, [r7] - ldr r0, [r0, 0x4] - adds r0, r6, r0 - ldrb r1, [r0, 0x15] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080E5BD0 - lsls r0, r5, 24 - lsrs r0, 24 - bl sub_80DE1E8 - lsls r0, 24 - cmp r0, 0 - beq _080E5BD0 - ldr r0, [r7] - ldr r0, [r0, 0x4] - adds r0, r6, r0 - ldrh r0, [r0, 0x8] - lsls r0, 3 - ldr r1, =gContestMoves - adds r0, r1 - ldrb r0, [r0, 0x2] - ldr r2, =gComboStarterLookupTable - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - b _080E5BD2 - .pool -_080E5BD0: - movs r0, 0 -_080E5BD2: - strh r0, [r4] - ldr r0, [r7] - ldr r0, [r0, 0x4] - adds r0, r6, r0 - ldrb r0, [r0, 0xD] - lsls r0, 24 - asrs r0, 24 - movs r1, 0xA - bl __divsi3 - lsls r0, 24 - asrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 1 - ldrh r0, [r4] - subs r0, r1 - strh r0, [r4] - adds r6, 0x1C - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _080E5B86 - mov r3, r8 - movs r6, 0 - ldrsh r0, [r3, r6] - cmp r0, 0 - beq _080E5CA0 - movs r5, 0 - mov r0, sp - ldrb r0, [r0] - cmp r0, 0xFF - beq _080E5CA0 - mov r4, sp -_080E5C16: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r1, r5, 1 - add r1, r8 - movs r3, 0 - ldrsh r2, [r1, r3] - ldrb r3, [r4] - lsls r1, r3, 1 - add r1, r10 - movs r6, 0 - ldrsh r1, [r1, r6] - adds r2, r1 - cmp r0, r2 - bge _080E5C66 - adds r0, r3, 0 - bl sub_80E69C8 - lsls r0, 24 - cmp r0, 0 - beq _080E5C70 - ldrb r0, [r4] - bl sub_80DD560 - ldrb r0, [r4] - movs r1, 0xA - bl sub_80DD3D4 - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - b _080E5C6A -_080E5C66: - movs r0, 0x1 - str r0, [sp, 0x18] -_080E5C6A: - ldr r1, [sp, 0x18] - cmp r1, 0 - beq _080E5C86 -_080E5C70: - movs r2, 0 - str r2, [sp, 0x18] - ldrb r0, [r4] - movs r1, 0x3C - bl sub_80DD3D4 - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_080E5C86: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - adds r0, 0xD - ldrb r3, [r4] - adds r0, r3 - movs r1, 0x1 - strb r1, [r0] - adds r4, 0x1 - adds r5, 0x1 - ldrb r0, [r4] - cmp r0, 0xFF - bne _080E5C16 -_080E5CA0: - ldr r6, =0x02039f34 - ldr r0, [r6] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0xB - bl sub_80DD3D4 - mov r0, r9 - cmp r0, 0 - bne _080E5CC0 - ldr r0, [r6] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x36 - bl sub_80DD3F0 -_080E5CC0: - 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 ContestEffectFunc_080E5AD4 - - thumb_func_start ContestEffectFunc_080E5CD4 -ContestEffectFunc_080E5CD4: @ 80E5CD4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r0, 0 - mov r8, r0 - movs r6, 0 - ldr r7, =0x02039f34 - movs r5, 0 -_080E5CE4: - ldr r2, [r7] - ldr r0, [r2, 0x8] - ldrb r1, [r0, 0x11] - adds r1, r0, r1 - adds r0, r6 - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - bls _080E5D46 - ldr r0, [r2, 0x4] - adds r0, r5, r0 - ldrb r0, [r0, 0xD] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - ble _080E5D46 - lsls r0, r6, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_80E69C8 - lsls r0, 24 - cmp r0, 0 - beq _080E5D46 - ldr r0, [r7] - ldr r0, [r0, 0x4] - adds r0, r5, r0 - movs r1, 0 - strb r1, [r0, 0xD] - ldr r0, [r7] - ldr r2, [r0, 0x4] - adds r2, r5, r2 - ldrb r1, [r2, 0x10] - movs r3, 0x31 - negs r3, r3 - adds r0, r3, 0 - ands r1, r0 - movs r0, 0x20 - orrs r1, r0 - strb r1, [r2, 0x10] - adds r0, r4, 0 - movs r1, 0xD - bl sub_80DD3D4 - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 -_080E5D46: - adds r5, 0x1C - adds r6, 0x1 - cmp r6, 0x3 - ble _080E5CE4 - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0xC - bl sub_80DD3D4 - mov r0, r8 - cmp r0, 0 - bne _080E5D6E - ldr r0, [r4] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x39 - bl sub_80DD3F0 -_080E5D6E: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E5CD4 - - thumb_func_start ContestEffectFunc_080E5D7C -ContestEffectFunc_080E5D7C: @ 80E5D7C - push {r4-r7,lr} - movs r7, 0 - movs r4, 0 - ldr r5, =0x02039f34 - movs r6, 0 -_080E5D86: - ldr r3, [r5] - ldr r2, [r3, 0x8] - ldrb r0, [r2, 0x11] - adds r0, r2, r0 - adds r1, r2, r4 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bls _080E5DD2 - ldr r0, [r3, 0x4] - adds r0, r6, r0 - ldrb r0, [r0, 0xD] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - ble _080E5DB0 - movs r0, 0x28 - b _080E5DB2 - .pool -_080E5DB0: - movs r0, 0xA -_080E5DB2: - strh r0, [r2, 0x4] - ldr r0, [r5] - ldr r0, [r0, 0x8] - strb r4, [r0, 0x8] - ldr r0, [r5] - ldr r1, [r0, 0x8] - movs r0, 0xFF - strb r0, [r1, 0x9] - bl sub_80E6A2C - lsls r0, 24 - cmp r0, 0 - beq _080E5DD2 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 -_080E5DD2: - adds r6, 0x1C - adds r4, 0x1 - cmp r4, 0x3 - ble _080E5D86 - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0xE - bl sub_80DD3D4 - cmp r7, 0 - bne _080E5DF8 - ldr r0, [r4] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x39 - bl sub_80DD3F0 -_080E5DF8: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E5D7C - - thumb_func_start ContestEffectFunc_080E5E04 -ContestEffectFunc_080E5E04: @ 80E5E04 - push {r4,lr} - ldr r1, =0x02039f26 - ldr r0, =0x02039f34 - ldr r4, [r0] - ldr r0, [r4, 0x8] - ldrb r2, [r0, 0x11] - adds r1, r2, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _080E5E46 - ldr r0, [r4, 0x4] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x6] - ldr r3, =gContestEffects - ldr r2, =gContestMoves - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x1] - lsls r0, 1 - ldrh r2, [r1, 0x2] - adds r0, r2 - strh r0, [r1, 0x2] - ldr r0, [r4, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0xF - bl sub_80DD3D4 -_080E5E46: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E5E04 - - thumb_func_start ContestEffectFunc_080E5E5C -ContestEffectFunc_080E5E5C: @ 80E5E5C - push {r4,lr} - ldr r1, =0x02039f26 - ldr r0, =0x02039f34 - ldr r4, [r0] - ldr r0, [r4, 0x8] - ldrb r2, [r0, 0x11] - adds r1, r2, r1 - ldrb r0, [r1] - cmp r0, 0x3 - bne _080E5E9E - ldr r0, [r4, 0x4] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x6] - ldr r3, =gContestEffects - ldr r2, =gContestMoves - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x1] - lsls r0, 1 - ldrh r2, [r1, 0x2] - adds r0, r2 - strh r0, [r1, 0x2] - ldr r0, [r4, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x10 - bl sub_80DD3D4 -_080E5E9E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E5E5C - - thumb_func_start ContestEffectFunc_080E5EB4 -ContestEffectFunc_080E5EB4: @ 80E5EB4 - push {r4-r7,lr} - movs r1, 0 - movs r5, 0 - ldr r0, =0x02039f34 - ldr r4, [r0] - ldr r2, [r4, 0x8] - ldrb r0, [r2, 0x11] - adds r0, r2, r0 - ldrb r6, [r0] - movs r3, 0 -_080E5EC8: - adds r0, r2, r1 - ldrb r0, [r0] - cmp r6, r0 - bls _080E5EDA - ldr r0, [r4, 0x4] - adds r0, r3, r0 - movs r7, 0x2 - ldrsh r0, [r0, r7] - adds r5, r0 -_080E5EDA: - adds r3, 0x1C - adds r1, 0x1 - cmp r1, 0x3 - ble _080E5EC8 - cmp r5, 0 - bge _080E5EE8 - movs r5, 0 -_080E5EE8: - ldr r0, =0x02039f34 - ldr r3, [r0] - ldr r0, [r3, 0x8] - ldrb r2, [r0, 0x11] - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080E5EFC - cmp r5, 0 - bne _080E5F0C -_080E5EFC: - adds r0, r2, 0 - movs r1, 0x12 - bl sub_80DD3D4 - b _080E5F2C - .pool -_080E5F0C: - ldr r0, [r3, 0x4] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r0, 1 - ldrh r2, [r1, 0x2] - adds r0, r2 - strh r0, [r1, 0x2] - ldr r0, [r3, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x11 - bl sub_80DD3D4 -_080E5F2C: - ldr r4, =0x02039f34 - ldr r1, [r4] - ldr r0, [r1, 0x8] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - movs r7, 0x2 - ldrsh r0, [r0, r7] - bl sub_80E6B70 - ldr r2, [r4] - ldr r1, [r2, 0x8] - ldrb r3, [r1, 0x11] - ldr r2, [r2, 0x4] - lsls r1, r3, 3 - subs r1, r3 - lsls r1, 2 - adds r1, r2 - strh r0, [r1, 0x2] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E5EB4 - - thumb_func_start ContestEffectFunc_080E5F64 -ContestEffectFunc_080E5F64: @ 80E5F64 - push {r4-r7,lr} - movs r6, 0 - ldr r0, =0x02039f34 - ldr r4, [r0] - ldr r2, [r4, 0x8] - ldrb r1, [r2, 0x11] - adds r3, r2, r1 - ldrb r1, [r3] - adds r7, r0, 0 - cmp r1, 0 - beq _080E5FB2 - movs r1, 0 - adds r5, r4, 0 - adds r4, r2, 0 - ldrb r0, [r3] - subs r3, r0, 0x1 - movs r2, 0 -_080E5F86: - adds r0, r4, r1 - ldrb r0, [r0] - cmp r3, r0 - bne _080E5F94 - ldr r0, [r5, 0x4] - adds r0, r2, r0 - ldrh r6, [r0, 0x2] -_080E5F94: - adds r2, 0x1C - adds r1, 0x1 - cmp r1, 0x3 - ble _080E5F86 - ldr r3, [r7] - ldr r0, [r3, 0x8] - ldrb r2, [r0, 0x11] - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080E5FB2 - lsls r0, r6, 16 - asrs r4, r0, 16 - cmp r4, 0 - bgt _080E5FC4 -_080E5FB2: - ldr r0, [r7] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x14 - bl sub_80DD3D4 - b _080E5FDE - .pool -_080E5FC4: - ldr r1, [r3, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0, 0x2] - adds r1, r4, r1 - strh r1, [r0, 0x2] - ldr r0, [r3, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x13 - bl sub_80DD3D4 -_080E5FDE: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ContestEffectFunc_080E5F64 - - thumb_func_start ContestEffectFunc_080E5FE4 -ContestEffectFunc_080E5FE4: @ 80E5FE4 - push {r4,r5,lr} - ldr r1, =0x02039f34 - ldr r3, [r1] - ldr r0, [r3, 0x8] - ldrb r2, [r0, 0x11] - adds r0, r2 - ldrb r4, [r0] - adds r5, r1, 0 - cmp r4, 0 - bne _080E600C - ldr r0, [r3, 0x4] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - movs r0, 0xA - b _080E601C - .pool -_080E600C: - ldr r0, [r3, 0x4] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 2 -_080E601C: - strh r0, [r1, 0x2] - cmp r4, 0 - bne _080E6030 - ldr r0, [r5] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x15 - bl sub_80DD3D4 - b _080E6060 -_080E6030: - cmp r4, 0x1 - bne _080E6042 - ldr r0, [r5] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x16 - bl sub_80DD3D4 - b _080E6060 -_080E6042: - cmp r4, 0x2 - bne _080E6054 - ldr r0, [r5] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x17 - bl sub_80DD3D4 - b _080E6060 -_080E6054: - ldr r0, [r5] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x18 - bl sub_80DD3D4 -_080E6060: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end ContestEffectFunc_080E5FE4 - - thumb_func_start ContestEffectFunc_080E6068 -ContestEffectFunc_080E6068: @ 80E6068 - push {r4,lr} - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x2 - bhi _080E6098 - movs r4, 0xA - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x1A - bl sub_80DD3D4 - b _080E60FC - .pool -_080E6098: - cmp r0, 0x5 - bhi _080E60B4 - movs r4, 0x14 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x1B - bl sub_80DD3D4 - b _080E60FC - .pool -_080E60B4: - cmp r0, 0x7 - bhi _080E60D0 - movs r4, 0x28 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x1C - bl sub_80DD3D4 - b _080E60FC - .pool -_080E60D0: - cmp r1, 0x8 - bhi _080E60EC - movs r4, 0x3C - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x1D - bl sub_80DD3D4 - b _080E60FC - .pool -_080E60EC: - movs r4, 0x50 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x1E - bl sub_80DD3D4 -_080E60FC: - ldr r0, =0x02039f34 - ldr r1, [r0] - ldr r0, [r1, 0x8] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - strh r4, [r0, 0x2] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E6068 - - thumb_func_start ContestEffectFunc_080E611C -ContestEffectFunc_080E611C: @ 80E611C - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r2, =0x02039f34 - ldr r0, [r2] - ldr r3, [r0, 0x8] - ldrb r0, [r3, 0x11] - adds r0, r3, r0 - movs r1, 0 - ldrsb r1, [r0, r1] - subs r0, r1, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - mov r8, r2 - cmp r1, 0 - beq _080E61F8 - mov r7, r8 - ldrb r6, [r3] -_080E6140: - movs r2, 0 - lsls r0, r4, 24 - asrs r1, r0, 24 - adds r5, r0, 0 - cmp r6, r1 - beq _080E616A - ldr r4, =0x02039f34 -_080E614E: - lsls r0, r2, 24 - movs r2, 0x80 - lsls r2, 17 - adds r0, r2 - lsrs r2, r0, 24 - asrs r3, r0, 24 - cmp r3, 0x3 - bgt _080E616A - ldr r0, [r4] - ldr r0, [r0, 0x8] - adds r0, r3 - ldrb r0, [r0] - cmp r0, r1 - bne _080E614E -_080E616A: - ldr r0, [r7] - lsls r3, r2, 24 - asrs r1, r3, 24 - ldr r2, [r0, 0x4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r2, r0, r2 - ldrb r1, [r2, 0xB] - movs r0, 0x80 - ands r0, r1 - mov r12, r3 - cmp r0, 0 - bne _080E6190 - ldrb r1, [r2, 0xC] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - beq _080E61A4 -_080E6190: - movs r1, 0xFF - lsls r1, 24 - adds r0, r5, r1 - lsrs r4, r0, 24 - cmp r0, 0 - blt _080E61F8 - b _080E6140 - .pool -_080E61A4: - mov r2, r8 - ldr r6, [r2] - ldr r0, [r6, 0x8] - ldrb r1, [r0, 0x11] - ldr r4, [r6, 0x4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r5, r0, r4 - ldrh r0, [r5, 0x6] - ldr r3, =gContestMoves - lsls r0, 3 - adds r7, r0, r3 - ldrb r2, [r7, 0x1] - lsls r2, 29 - mov r0, r12 - asrs r1, r0, 24 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x6] - lsls r0, 3 - adds r0, r3 - ldrb r0, [r0, 0x1] - lsls r0, 29 - cmp r2, r0 - bne _080E61F8 - ldr r1, =gContestEffects - ldrb r0, [r7] - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x1] - lsls r0, 1 - ldrh r1, [r5, 0x2] - adds r0, r1 - strh r0, [r5, 0x2] - ldr r0, [r6, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x1F - bl sub_80DD3D4 -_080E61F8: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E611C - - thumb_func_start ContestEffectFunc_080E620C -ContestEffectFunc_080E620C: @ 80E620C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =0x02039f34 - ldr r3, [r0] - ldr r1, [r3, 0x8] - ldrb r2, [r1, 0x11] - adds r1, r2 - ldrb r1, [r1] - mov r9, r0 - cmp r1, 0 - beq _080E62AC - ldr r1, [r3, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x6] - mov r8, r0 - movs r6, 0 - ldr r0, =gContestMoves - mov r12, r0 - movs r7, 0 -_080E623C: - mov r1, r9 - ldr r4, [r1] - ldr r0, [r4, 0x8] - ldrb r2, [r0, 0x11] - adds r1, r0, r2 - ldrb r1, [r1] - subs r1, 0x1 - adds r0, r6 - ldrb r0, [r0] - cmp r1, r0 - bne _080E62A4 - mov r1, r8 - lsls r0, r1, 3 - mov r1, r12 - adds r5, r0, r1 - ldrb r1, [r5, 0x1] - lsls r1, 29 - ldr r3, [r4, 0x4] - adds r0, r7, r3 - ldrh r0, [r0, 0x6] - lsls r0, 3 - add r0, r12 - ldrb r0, [r0, 0x1] - lsls r0, 29 - cmp r1, r0 - beq _080E62A4 - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r3 - ldr r2, =gContestEffects - ldrb r0, [r5] - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - lsls r0, 1 - ldrh r2, [r1, 0x2] - adds r0, r2 - strh r0, [r1, 0x2] - ldr r0, [r4, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x20 - bl sub_80DD3D4 - b _080E62AC - .pool -_080E62A4: - adds r7, 0x1C - adds r6, 0x1 - cmp r6, 0x3 - ble _080E623C -_080E62AC: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ContestEffectFunc_080E620C - - thumb_func_start ContestEffectFunc_080E62B8 -ContestEffectFunc_080E62B8: @ 80E62B8 - push {r4-r7,lr} - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r1, [r0, 0x11] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080E632E - movs r5, 0 - movs r6, 0 -_080E62CE: - ldr r0, =0x02039f34 - ldr r4, [r0] - ldr r1, [r4, 0x8] - ldrb r2, [r1, 0x11] - adds r0, r1, r2 - ldrb r0, [r0] - subs r0, 0x1 - adds r1, r5 - ldrb r1, [r1] - cmp r0, r1 - bne _080E6326 - ldr r1, [r4, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r3, r0, r1 - adds r1, r6, r1 - movs r0, 0x2 - ldrsh r2, [r3, r0] - movs r7, 0x2 - ldrsh r0, [r1, r7] - cmp r2, r0 - ble _080E6314 - adds r0, r2, 0 - lsls r0, 1 - strh r0, [r3, 0x2] - ldr r0, [r4, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x21 - bl sub_80DD3D4 - b _080E6326 - .pool -_080E6314: - cmp r2, r0 - bge _080E6326 - movs r0, 0 - strh r0, [r3, 0x2] - ldr r0, [r4, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x22 - bl sub_80DD3D4 -_080E6326: - adds r6, 0x1C - adds r5, 0x1 - cmp r5, 0x3 - ble _080E62CE -_080E632E: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ContestEffectFunc_080E62B8 - - thumb_func_start ContestEffectFunc_080E6334 -ContestEffectFunc_080E6334: @ 80E6334 - push {r4,lr} - ldr r4, =0x02039f34 - ldr r1, [r4] - ldr r0, [r1, 0x8] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r1, r0, r1 - ldrb r3, [r1, 0xD] - movs r0, 0xD - ldrsb r0, [r1, r0] - cmp r0, 0x1D - bgt _080E6388 - adds r0, r3, 0 - adds r0, 0xA - strb r0, [r1, 0xD] - ldr r1, [r4] - ldr r0, [r1, 0x8] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x10] - movs r1, 0x31 - negs r1, r1 - ands r1, r2 - movs r2, 0x10 - orrs r1, r2 - strb r1, [r0, 0x10] - ldr r0, [r4] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x23 - bl sub_80DD3D4 - b _080E6390 - .pool -_080E6388: - adds r0, r2, 0 - movs r1, 0x3A - bl sub_80DD3D4 -_080E6390: - pop {r4} - pop {r0} - bx r0 - thumb_func_end ContestEffectFunc_080E6334 - - thumb_func_start ContestEffectFunc_080E6398 -ContestEffectFunc_080E6398: @ 80E6398 - push {lr} - ldr r3, =0x02039f34 - ldr r1, [r3] - ldr r0, [r1, 0x8] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x11] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0, 0x11] - ldr r1, [r3] - ldr r0, [r1, 0x8] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0xD] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - beq _080E63DC - adds r0, r2, 0 - movs r1, 0x24 - bl sub_80DD3D4 - b _080E63E4 - .pool -_080E63DC: - adds r0, r2, 0 - movs r1, 0x3B - bl sub_80DD3D4 -_080E63E4: - pop {r0} - bx r0 - thumb_func_end ContestEffectFunc_080E6398 - - thumb_func_start ContestEffectFunc_080E63E8 -ContestEffectFunc_080E63E8: @ 80E63E8 - push {r4-r7,lr} - sub sp, 0x4 - ldr r0, =0x02039f34 - ldr r2, [r0] - ldr r1, [r2] - ldrb r1, [r1, 0x1] - mov r12, r0 - cmp r1, 0x4 - bne _080E63FC - b _080E6518 -_080E63FC: - movs r6, 0 - adds r4, r2, 0 -_080E6400: - lsls r1, r6, 24 - asrs r1, 24 - mov r0, sp - adds r3, r0, r1 - ldr r2, [r4, 0x4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x19] - strb r0, [r3] - adds r1, 0x1 - lsls r1, 24 - lsrs r6, r1, 24 - asrs r1, 24 - cmp r1, 0x3 - ble _080E6400 - mov r1, r12 - ldr r0, [r1] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - mov r2, sp - adds r1, r2, r0 - movs r0, 0xFF - strb r0, [r1] - movs r6, 0 - mov r3, r12 - ldr r7, [r3] -_080E6438: - movs r5, 0 -_080E643A: - lsls r0, r5, 24 - asrs r2, r0, 24 - ldr r0, [r7, 0x8] - ldrb r0, [r0, 0x11] - cmp r2, r0 - beq _080E6474 - lsls r0, r6, 24 - asrs r3, r0, 24 - mov r0, sp - adds r4, r0, r2 - ldrb r1, [r4] - cmp r3, r1 - bne _080E6474 - ldr r0, [r7, 0x4] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - lsls r0, r3, 24 - lsrs r0, 24 - ldrb r1, [r1, 0x19] - cmp r0, r1 - bne _080E6474 - adds r0, r3, 0x1 - strb r0, [r4] - b _080E6484 - .pool -_080E6474: - lsls r0, r5, 24 - movs r2, 0x80 - lsls r2, 17 - adds r0, r2 - lsrs r5, r0, 24 - asrs r0, 24 - cmp r0, 0x3 - ble _080E643A -_080E6484: - cmp r5, 0x4 - beq _080E6498 - lsls r0, r6, 24 - movs r3, 0x80 - lsls r3, 17 - adds r0, r3 - lsrs r6, r0, 24 - asrs r0, 24 - cmp r0, 0x3 - ble _080E6438 -_080E6498: - mov r4, r12 - ldr r1, [r4] - ldr r0, [r1, 0x8] - ldrb r0, [r0, 0x11] - mov r3, sp - adds r2, r3, r0 - movs r0, 0 - strb r0, [r2] - ldr r0, [r1, 0x8] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x10] - movs r1, 0x3F - ands r1, r2 - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0, 0x10] - movs r6, 0 - mov r3, r12 -_080E64C6: - ldr r0, [r3] - lsls r1, r6, 24 - asrs r1, 24 - ldr r2, [r0, 0x4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - mov r4, sp - adds r2, r4, r1 - ldrb r2, [r2] - strb r2, [r0, 0x19] - adds r1, 0x1 - lsls r1, 24 - lsrs r6, r1, 24 - asrs r1, 24 - cmp r1, 0x3 - ble _080E64C6 - mov r0, r12 - ldr r1, [r0] - ldr r0, [r1, 0x8] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x11] - movs r1, 0x4 - negs r1, r1 - ands r1, r2 - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0, 0x11] - mov r1, r12 - ldr r0, [r1] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x25 - bl sub_80DD3D4 -_080E6518: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ContestEffectFunc_080E63E8 - - thumb_func_start ContestEffectFunc_080E6520 -ContestEffectFunc_080E6520: @ 80E6520 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - ldr r0, =0x02039f34 - ldr r2, [r0] - ldr r1, [r2] - ldrb r1, [r1, 0x1] - mov r12, r0 - cmp r1, 0x4 - bne _080E6538 - b _080E6658 -_080E6538: - movs r6, 0 - adds r4, r2, 0 -_080E653C: - lsls r1, r6, 24 - asrs r1, 24 - mov r0, sp - adds r3, r0, r1 - ldr r2, [r4, 0x4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x19] - strb r0, [r3] - adds r1, 0x1 - lsls r1, 24 - lsrs r6, r1, 24 - asrs r1, 24 - cmp r1, 0x3 - ble _080E653C - mov r1, r12 - ldr r0, [r1] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - mov r2, sp - adds r1, r2, r0 - movs r0, 0xFF - strb r0, [r1] - movs r6, 0x3 - mov r3, r12 - ldr r7, [r3] - movs r4, 0x1 - negs r4, r4 - mov r8, r4 -_080E657A: - movs r5, 0 -_080E657C: - lsls r0, r5, 24 - asrs r2, r0, 24 - ldr r0, [r7, 0x8] - ldrb r0, [r0, 0x11] - cmp r2, r0 - beq _080E65B4 - lsls r0, r6, 24 - asrs r3, r0, 24 - mov r0, sp - adds r4, r0, r2 - ldrb r1, [r4] - cmp r3, r1 - bne _080E65B4 - ldr r0, [r7, 0x4] - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - lsls r0, r3, 24 - lsrs r0, 24 - ldrb r1, [r1, 0x19] - cmp r0, r1 - bne _080E65B4 - subs r0, r3, 0x1 - strb r0, [r4] - b _080E65C4 - .pool -_080E65B4: - lsls r0, r5, 24 - movs r2, 0x80 - lsls r2, 17 - adds r0, r2 - lsrs r5, r0, 24 - asrs r0, 24 - cmp r0, 0x3 - ble _080E657C -_080E65C4: - cmp r5, 0x4 - beq _080E65D8 - lsls r0, r6, 24 - movs r3, 0xFF - lsls r3, 24 - adds r0, r3 - lsrs r6, r0, 24 - asrs r0, 24 - cmp r0, r8 - bgt _080E657A -_080E65D8: - mov r4, r12 - ldr r1, [r4] - ldr r0, [r1, 0x8] - ldrb r0, [r0, 0x11] - mov r3, sp - adds r2, r3, r0 - movs r0, 0x3 - strb r0, [r2] - ldr r0, [r1, 0x8] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x10] - movs r1, 0x3F - ands r1, r2 - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0, 0x10] - movs r6, 0 - mov r3, r12 -_080E6606: - ldr r0, [r3] - lsls r1, r6, 24 - asrs r1, 24 - ldr r2, [r0, 0x4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - mov r4, sp - adds r2, r4, r1 - ldrb r2, [r2] - strb r2, [r0, 0x19] - adds r1, 0x1 - lsls r1, 24 - lsrs r6, r1, 24 - asrs r1, 24 - cmp r1, 0x3 - ble _080E6606 - mov r0, r12 - ldr r1, [r0] - ldr r0, [r1, 0x8] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x11] - movs r1, 0x4 - negs r1, r1 - ands r1, r2 - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0, 0x11] - mov r1, r12 - ldr r0, [r1] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x26 - bl sub_80DD3D4 -_080E6658: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ContestEffectFunc_080E6520 - - thumb_func_start ContestEffectFunc_080E6664 -ContestEffectFunc_080E6664: @ 80E6664 - bx lr - thumb_func_end ContestEffectFunc_080E6664 - - thumb_func_start ContestEffectFunc_080E6668 -ContestEffectFunc_080E6668: @ 80E6668 - push {r4-r7,lr} - sub sp, 0x8 - ldr r0, =0x02039f34 - ldr r1, [r0] - ldr r0, [r1] - ldrb r0, [r0, 0x1] - cmp r0, 0x4 - beq _080E676C - movs r6, 0 - add r5, sp, 0x4 - adds r4, r1, 0 - adds r7, r5, 0 -_080E6680: - lsls r1, r6, 24 - asrs r1, 24 - mov r0, sp - adds r3, r0, r1 - ldr r2, [r4, 0x4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x19] - strb r0, [r3] - adds r0, r7, r1 - strb r6, [r0] - adds r1, 0x1 - lsls r1, 24 - lsrs r6, r1, 24 - asrs r1, 24 - cmp r1, 0x3 - ble _080E6680 - movs r6, 0 - adds r7, r5, 0 -_080E66AA: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - lsls r2, r6, 24 - asrs r2, 24 - movs r1, 0x4 - subs r1, r2 - bl __modsi3 - lsls r0, 24 - lsrs r4, r0, 24 - movs r1, 0 -_080E66C4: - lsls r0, r1, 24 - asrs r2, r0, 24 - adds r3, r7, r2 - ldrb r1, [r3] - adds r5, r0, 0 - cmp r1, 0xFF - beq _080E66EE - cmp r4, 0 - bne _080E66E8 - mov r1, sp - adds r0, r1, r2 - strb r6, [r0] - movs r0, 0xFF - strb r0, [r3] - b _080E66FC - .pool -_080E66E8: - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_080E66EE: - movs r1, 0x80 - lsls r1, 17 - adds r0, r5, r1 - lsrs r1, r0, 24 - asrs r0, 24 - cmp r0, 0x3 - ble _080E66C4 -_080E66FC: - lsls r0, r6, 24 - movs r6, 0x80 - lsls r6, 17 - adds r0, r6 - lsrs r6, r0, 24 - asrs r0, 24 - cmp r0, 0x3 - ble _080E66AA - movs r6, 0 - ldr r5, =0x02039f34 - adds r4, r5, 0 -_080E6712: - ldr r0, [r4] - lsls r3, r6, 24 - asrs r3, 24 - ldr r1, [r0, 0x4] - lsls r2, r3, 3 - subs r2, r3 - lsls r2, 2 - adds r1, r2, r1 - mov r6, sp - adds r0, r6, r3 - ldrb r0, [r0] - strb r0, [r1, 0x19] - ldr r0, [r4] - ldr r0, [r0, 0x4] - adds r2, r0 - ldrb r1, [r2, 0x10] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x10] - adds r3, 0x1 - lsls r3, 24 - lsrs r6, r3, 24 - asrs r3, 24 - cmp r3, 0x3 - ble _080E6712 - ldr r1, [r5] - ldr r0, [r1, 0x8] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x11] - movs r2, 0x3 - orrs r1, r2 - strb r1, [r0, 0x11] - ldr r0, [r5] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x27 - bl sub_80DD3D4 -_080E676C: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E6668 - - thumb_func_start ContestEffectFunc_080E6778 -ContestEffectFunc_080E6778: @ 80E6778 - push {lr} - ldr r3, =gContestMoves - ldr r0, =0x02039f34 - ldr r1, [r0] - ldr r0, [r1, 0x8] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r2, r0, r1 - ldrh r0, [r2, 0x6] - lsls r0, 3 - adds r0, r3 - ldrb r0, [r0, 0x1] - lsls r0, 29 - ldr r1, =0x02039f2c - lsrs r0, 29 - ldrh r1, [r1] - cmp r0, r1 - beq _080E67AA - ldrb r0, [r2, 0x11] - movs r1, 0x10 - orrs r0, r1 - strb r0, [r2, 0x11] -_080E67AA: - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E6778 - - thumb_func_start ContestEffectFunc_080E67BC -ContestEffectFunc_080E67BC: @ 80E67BC - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r0, 0 - mov r8, r0 - movs r4, 0 - ldr r5, =0x02039f34 - movs r6, 0 -_080E67CC: - ldr r3, [r5] - ldr r2, [r3, 0x8] - ldrb r0, [r2, 0x11] - adds r0, r2, r0 - adds r1, r2, r4 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bls _080E682E - ldr r0, [r3, 0x4] - adds r1, r6, r0 - movs r7, 0x2 - ldrsh r0, [r1, r7] - cmp r0, 0 - ble _080E6808 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r2, 0x4] - ldr r0, [r3, 0x8] - movs r1, 0x4 - ldrsh r0, [r0, r1] - bl sub_80E6BB4 - ldr r1, [r5] - ldr r1, [r1, 0x8] - strh r0, [r1, 0x4] - b _080E680C - .pool -_080E6808: - movs r0, 0xA - strh r0, [r2, 0x4] -_080E680C: - ldr r0, [r5] - ldr r0, [r0, 0x8] - strb r4, [r0, 0x8] - ldr r0, [r5] - ldr r1, [r0, 0x8] - movs r0, 0xFF - strb r0, [r1, 0x9] - bl sub_80E6A2C - lsls r0, 24 - cmp r0, 0 - beq _080E682E - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 -_080E682E: - adds r6, 0x1C - adds r4, 0x1 - cmp r4, 0x3 - ble _080E67CC - mov r7, r8 - cmp r7, 0 - bne _080E684A - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x36 - bl sub_80DD3F0 -_080E684A: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x30 - bl sub_80DD3D4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E67BC - - thumb_func_start ContestEffectFunc_080E6868 -ContestEffectFunc_080E6868: @ 80E6868 - push {r4,lr} - ldr r0, =0x02039f34 - ldr r1, [r0] - ldr r0, [r1] - ldrb r0, [r0, 0x13] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - bne _080E688C - movs r4, 0xA - ldr r0, [r1, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x1A - bl sub_80DD3D4 - b _080E68CE - .pool -_080E688C: - cmp r0, 0x1 - bne _080E689E - movs r4, 0x14 - ldr r0, [r1, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x1B - bl sub_80DD3D4 - b _080E68CE -_080E689E: - cmp r0, 0x2 - bne _080E68B0 - movs r4, 0x1E - ldr r0, [r1, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x1C - bl sub_80DD3D4 - b _080E68CE -_080E68B0: - cmp r0, 0x3 - bne _080E68C2 - movs r4, 0x32 - ldr r0, [r1, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x1D - bl sub_80DD3D4 - b _080E68CE -_080E68C2: - movs r4, 0x3C - ldr r0, [r1, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x1E - bl sub_80DD3D4 -_080E68CE: - ldr r0, =0x02039f34 - ldr r1, [r0] - ldr r0, [r1, 0x8] - ldrb r2, [r0, 0x11] - ldr r1, [r1, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - strh r4, [r0, 0x2] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E6868 - - thumb_func_start ContestEffectFunc_080E68EC -ContestEffectFunc_080E68EC: @ 80E68EC - push {r4,lr} - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r2, [r0, 0x10] - ldrb r1, [r2, 0x1] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080E692A - movs r0, 0x1 - orrs r0, r1 - strb r0, [r2, 0x1] - ldr r0, [r4] - ldr r3, [r0, 0x10] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x7 - ands r1, r0 - lsls r1, 1 - ldrb r2, [r3, 0x1] - movs r0, 0xF - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x1] - ldr r0, [r4] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x3D - bl sub_80DD3D4 -_080E692A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ContestEffectFunc_080E68EC - - thumb_func_start sub_80E6934 -sub_80E6934: @ 80E6934 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r7, 0 - movs r4, 0 - ldr r6, =0x02039f34 - ldr r0, =gContestMoves - mov r9, r0 - movs r5, 0 -_080E694E: - ldr r3, [r6] - ldr r2, [r3, 0x8] - ldrb r0, [r2, 0x11] - adds r0, r2, r0 - adds r1, r2, r4 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bls _080E699E - ldr r0, [r3, 0x4] - adds r0, r5, r0 - ldrh r0, [r0, 0x6] - lsls r0, 3 - add r0, r9 - ldrb r0, [r0, 0x1] - lsls r0, 29 - lsrs r0, 29 - cmp r8, r0 - bne _080E6980 - movs r0, 0x28 - b _080E6982 - .pool -_080E6980: - movs r0, 0xA -_080E6982: - strh r0, [r2, 0x4] - ldr r0, [r6] - ldr r0, [r0, 0x8] - strb r4, [r0, 0x8] - ldr r0, [r6] - ldr r1, [r0, 0x8] - movs r0, 0xFF - strb r0, [r1, 0x9] - bl sub_80E6A2C - lsls r0, 24 - cmp r0, 0 - beq _080E699E - adds r7, 0x1 -_080E699E: - adds r5, 0x1C - adds r4, 0x1 - cmp r4, 0x3 - ble _080E694E - cmp r7, 0 - bne _080E69B8 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x11] - movs r1, 0x36 - bl sub_80DD3F0 -_080E69B8: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E6934 - - thumb_func_start sub_80E69C8 -sub_80E69C8: @ 80E69C8 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =0x02039f34 - ldr r0, [r2] - ldr r0, [r0, 0x8] - adds r0, 0xD - adds r0, r3 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r2] - ldr r1, [r0, 0x4] - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r2, r0, r1 - ldrb r1, [r2, 0x10] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080E69FC - adds r0, r3, 0 - movs r1, 0x2D - b _080E6A22 - .pool -_080E69FC: - ldrb r0, [r2, 0x12] - cmp r0, 0 - bne _080E6A1A - ldrb r1, [r2, 0xB] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080E6A26 - ldrb r1, [r2, 0xC] - movs r0, 0x6 - ands r0, r1 - cmp r0, 0 - bne _080E6A26 - movs r0, 0x1 - b _080E6A28 -_080E6A1A: - subs r0, 0x1 - strb r0, [r2, 0x12] - adds r0, r3, 0 - movs r1, 0x2C -_080E6A22: - bl sub_80DD3D4 -_080E6A26: - movs r0, 0 -_080E6A28: - pop {r1} - bx r1 - thumb_func_end sub_80E69C8 - - thumb_func_start sub_80E6A2C -sub_80E6A2C: @ 80E6A2C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - mov r0, sp - movs r1, 0 - movs r2, 0x8 - bl memset - movs r7, 0 - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x8] - cmp r0, 0xFF - beq _080E6B10 - mov r8, r4 -_080E6A4E: - mov r1, r8 - ldr r0, [r1] - ldr r0, [r0, 0x8] - adds r0, 0x8 - adds r0, r7 - ldrb r5, [r0] - adds r6, r5, 0 - adds r0, r5, 0 - bl sub_80E69C8 - lsls r0, 24 - cmp r0, 0 - beq _080E6AFE - ldr r2, [r4] - ldr r1, [r2, 0x8] - ldrh r0, [r1, 0x4] - strh r0, [r1, 0x6] - ldr r1, [r2, 0x4] - lsls r0, r5, 3 - subs r0, r5 - lsls r4, r0, 2 - adds r1, r4, r1 - ldrb r1, [r1, 0x10] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080E6A8E - ldr r1, [r2, 0x8] - movs r2, 0x6 - ldrsh r0, [r1, r2] - lsls r0, 1 - strh r0, [r1, 0x6] -_080E6A8E: - mov r0, r8 - ldr r3, [r0] - ldr r0, [r3, 0x4] - adds r1, r4, r0 - ldrb r0, [r1, 0x10] - movs r4, 0x1 - ands r4, r0 - cmp r4, 0 - beq _080E6AB4 - ldr r1, [r3, 0x8] - movs r0, 0xA - strh r0, [r1, 0x6] - adds r0, r5, 0 - movs r1, 0x2F - bl sub_80DD3D4 - b _080E6AFE - .pool -_080E6AB4: - ldr r2, [r3, 0x8] - ldrb r1, [r1, 0xF] - ldrh r0, [r2, 0x6] - subs r0, r1 - strh r0, [r2, 0x6] - ldr r2, [r3, 0x8] - ldrh r1, [r2, 0x6] - movs r3, 0x6 - ldrsh r0, [r2, r3] - cmp r0, 0 - bgt _080E6AD6 - strh r4, [r2, 0x6] - adds r0, r5, 0 - movs r1, 0x2E - bl sub_80DD3D4 - b _080E6AFE -_080E6AD6: - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl sub_80E6B3C - mov r1, r8 - ldr r0, [r1] - ldr r0, [r0, 0x8] - ldrb r1, [r0, 0x6] - adds r0, r6, 0 - bl sub_80DD40C - lsls r0, r6, 1 - mov r2, sp - adds r1, r2, r0 - mov r3, r8 - ldr r0, [r3] - ldr r0, [r0, 0x8] - ldrh r0, [r0, 0x6] - strh r0, [r1] -_080E6AFE: - adds r7, 0x1 - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r0, [r0, 0x8] - adds r0, 0x8 - adds r0, r7 - ldrb r0, [r0] - cmp r0, 0xFF - bne _080E6A4E -_080E6B10: - movs r7, 0 - mov r1, sp -_080E6B14: - movs r2, 0 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _080E6B24 - movs r0, 0x1 - b _080E6B2E - .pool -_080E6B24: - adds r1, 0x2 - adds r7, 0x1 - cmp r7, 0x3 - ble _080E6B14 - movs r0, 0 -_080E6B2E: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80E6A2C - - thumb_func_start sub_80E6B3C -sub_80E6B3C: @ 80E6B3C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x02039f34 - ldr r4, [r2] - ldr r3, [r4, 0x4] - lsls r2, r0, 3 - subs r2, r0 - lsls r2, 2 - adds r3, r2, r3 - ldrh r0, [r3, 0x2] - subs r0, r1 - strh r0, [r3, 0x2] - ldr r0, [r4, 0x4] - adds r2, r0 - ldrb r0, [r2, 0xE] - adds r1, r0 - strb r1, [r2, 0xE] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E6B3C - - thumb_func_start sub_80E6B70 -sub_80E6B70: @ 80E6B70 - push {r4,r5,lr} - lsls r0, 16 - lsrs r5, r0, 16 - asrs r4, r0, 16 - adds r0, r4, 0 - cmp r4, 0 - bge _080E6B80 - negs r0, r4 -_080E6B80: - movs r1, 0xA - bl __modsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r4, 0 - bge _080E6B9E - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0 - beq _080E6BA8 - adds r0, r4, 0 - subs r0, 0xA - adds r0, r1, r0 - b _080E6BA4 -_080E6B9E: - lsls r0, 16 - asrs r0, 16 - subs r0, r4, r0 -_080E6BA4: - lsls r0, 16 - lsrs r5, r0, 16 -_080E6BA8: - lsls r0, r5, 16 - asrs r0, 16 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80E6B70 - - thumb_func_start sub_80E6BB4 -sub_80E6BB4: @ 80E6BB4 - push {r4,r5,lr} - lsls r0, 16 - lsrs r5, r0, 16 - asrs r4, r0, 16 - adds r0, r4, 0 - cmp r4, 0 - bge _080E6BC4 - negs r0, r4 -_080E6BC4: - movs r1, 0xA - bl __modsi3 - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0 - beq _080E6BDC - adds r0, r4, 0 - adds r0, 0xA - subs r0, r1 - lsls r0, 16 - lsrs r5, r0, 16 -_080E6BDC: - lsls r0, r5, 16 - asrs r0, 16 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80E6BB4 - - thumb_func_start sub_80E6BE8 -sub_80E6BE8: @ 80E6BE8 - push {lr} - ldr r0, =sub_80E715C - bl sub_80B37D4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E6BE8 - - thumb_func_start sub_80E6BF8 -sub_80E6BF8: @ 80E6BF8 - push {r4,lr} - ldr r2, =0x03001134 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r3, =0x00001a9c - adds r0, r1, r3 - str r0, [r2] - ldr r2, =0x03001138 - ldr r4, =0x000027cc - adds r0, r1, r4 - str r0, [r2] - ldr r2, =0x0300113c - ldr r3, =0x00002b50 - adds r0, r1, r3 - str r0, [r2] - ldr r2, =0x03001140 - ldr r4, =0x00002e28 - adds r0, r1, r4 - str r0, [r2] - ldr r2, =0x03001144 - ldr r3, =0x00002e68 - adds r0, r1, r3 - str r0, [r2] - ldr r2, =0x03001148 - ldr r0, =0x02039f9c - str r0, [r2] - ldr r2, =0x0300114c - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r4, =0x0000064c - adds r3, r0, r4 - str r3, [r2] - ldr r2, =0x03001150 - ldr r4, =0x00003b58 - adds r1, r4 - str r1, [r2] - ldr r1, =0x03001154 - adds r0, 0xDC - str r0, [r1] - ldr r0, =0x03001158 - str r3, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E6BF8 - - thumb_func_start sub_80E6CA0 -sub_80E6CA0: @ 80E6CA0 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x03001134 - ldr r1, [r0] - movs r4, 0xC8 - lsls r4, 4 - adds r0, r5, 0 - adds r2, r4, 0 - bl memcpy - adds r4, r5, r4 - ldr r0, =0x03001138 - ldr r1, [r0] - movs r2, 0xE1 - lsls r2, 2 - adds r0, r4, 0 - bl memcpy - adds r0, r4, 0 - bl sub_80F14F8 - ldr r1, =0x00001004 - adds r0, r5, r1 - ldr r1, =0x0300113c - ldr r1, [r1] - movs r2, 0x40 - bl memcpy - ldr r2, =0x00001044 - adds r0, r5, r2 - ldr r1, =0x03001140 - ldr r1, [r1] - movs r2, 0x40 - bl memcpy - ldr r1, =0x00001084 - adds r0, r5, r1 - ldr r1, =0x03001144 - ldr r1, [r1] - movs r2, 0x28 - bl memcpy - ldr r2, =0x000010ac - adds r0, r5, r2 - bl sub_80E89F8 - ldr r0, =0x0300114c - ldr r0, [r0] - ldr r2, =0x00001124 - adds r1, r5, r2 - bl sub_81659DC - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _080E6D1C - bl sub_81539D4 - ldr r2, =0x000011c8 - adds r1, r5, r2 - strh r0, [r1] -_080E6D1C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E6CA0 - - thumb_func_start sub_80E6D54 -sub_80E6D54: @ 80E6D54 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x03001134 - ldr r1, [r0] - movs r4, 0xC8 - lsls r4, 4 - adds r0, r5, 0 - adds r2, r4, 0 - bl memcpy - adds r0, r5, 0 - bl sub_80EB18C - adds r4, r5, r4 - ldr r0, =0x03001138 - ldr r1, [r0] - movs r2, 0xE1 - lsls r2, 2 - adds r0, r4, 0 - bl memcpy - adds r0, r4, 0 - bl sub_80F1208 - ldr r1, =0x00001004 - adds r0, r5, r1 - ldr r1, =0x0300113c - ldr r1, [r1] - movs r2, 0x40 - bl memcpy - ldr r2, =0x00001044 - adds r4, r5, r2 - ldr r0, =0x03001140 - ldr r1, [r0] - adds r0, r4, 0 - movs r2, 0x40 - bl memcpy - adds r0, r4, 0 - bl sub_8120B70 - ldr r1, =0x00001084 - adds r0, r5, r1 - ldr r1, =0x03001144 - ldr r1, [r1] - movs r2, 0x28 - bl memcpy - ldr r2, =0x000010ac - adds r4, r5, r2 - adds r0, r4, 0 - bl sub_80E89F8 - adds r0, r4, 0 - bl sub_80E8A54 - ldr r0, =0x0300114c - ldr r0, [r0] - ldr r1, =0x00001124 - adds r4, r5, r1 - adds r1, r4, 0 - bl sub_81659DC - adds r0, r4, 0 - bl TaskDummy4 - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _080E6DEE - bl sub_81539D4 - ldr r2, =0x000011c8 - adds r1, r5, r2 - strh r0, [r1] -_080E6DEE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E6D54 - - thumb_func_start sub_80E6E24 -sub_80E6E24: @ 80E6E24 - push {r4,r5,lr} - bl sub_80E9914 - bl sub_80F0BB8 - bl sub_80E6BF8 - bl sub_800A064 - cmp r0, 0 - beq _080E6E60 - bl sub_800A03C - cmp r0, 0 - bne _080E6E50 - ldr r0, =0x0203a018 - ldr r0, [r0] - bl sub_80E6CA0 - b _080E6F12 - .pool -_080E6E50: - ldr r0, =0x0203a018 - ldr r0, [r0] - bl sub_80E6D54 - b _080E6F12 - .pool -_080E6E60: - ldr r5, =0x0203a018 - ldr r0, [r5] - ldr r1, =0x03001134 - ldr r1, [r1] - movs r4, 0xC8 - lsls r4, 4 - adds r2, r4, 0 - bl memcpy - ldr r0, [r5] - adds r0, r4 - ldr r1, =0x03001138 - ldr r1, [r1] - movs r2, 0xE1 - lsls r2, 2 - bl memcpy - ldr r0, [r5] - ldr r1, =0x00001004 - adds r0, r1 - ldr r1, =0x0300113c - ldr r1, [r1] - movs r2, 0x40 - bl memcpy - ldr r0, [r5] - ldr r2, =0x00001044 - adds r0, r2 - ldr r1, =0x03001140 - ldr r1, [r1] - movs r2, 0x40 - bl memcpy - ldr r0, [r5] - ldr r1, =0x00001214 - adds r0, r1 - ldr r1, =0x03001150 - ldr r1, [r1] - movs r2, 0x40 - bl memcpy - ldr r0, [r5] - ldr r2, =0x00001084 - adds r0, r2 - ldr r1, =0x03001144 - ldr r1, [r1] - movs r2, 0x28 - bl memcpy - ldr r0, [r5] - ldr r1, =0x000010ac - adds r0, r1 - bl sub_80E89F8 - ldr r0, [r5] - ldr r4, =0x00001124 - adds r0, r4 - ldr r1, =0x0300114c - ldr r1, [r1] - movs r2, 0xEC - bl memcpy - ldr r0, [r5] - adds r0, r4 - bl sub_80E8AC0 - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _080E6EFA - bl sub_81539D4 - ldr r1, [r5] - ldr r2, =0x00001210 - adds r1, r2 - strh r0, [r1] -_080E6EFA: - ldr r0, [r5] - ldr r1, =0x00001254 - adds r0, r1 - ldr r1, =0x03001154 - ldr r1, [r1] - bl sub_80E8110 - ldr r0, [r5] - ldr r2, =0x000012dc - adds r0, r2 - bl sub_80E8260 -_080E6F12: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E6E24 - - thumb_func_start sub_80E6F60 -sub_80E6F60: @ 80E6F60 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r4, r0, 0 - bl sub_800A064 - cmp r0, 0 - beq _080E7014 - ldr r5, =0x0203a014 - ldr r0, [r5] - movs r1, 0xC8 - lsls r1, 4 - mov r8, r1 - add r0, r8 - bl sub_80E7B2C - ldr r0, [r5] - ldr r6, =0x00001230 - lsls r4, 24 - lsrs r4, 24 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80EAF80 - ldr r3, [r5] - ldr r1, =0x000010ac - adds r0, r3, r1 - add r3, r8 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80E7B60 - ldr r0, [r5] - ldr r1, =0x00001124 - adds r0, r1 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80E7948 - ldr r0, [r5] - add r0, r8 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80F01E8 - ldr r0, [r5] - ldr r1, =0x00001004 - adds r0, r1 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80F0C7C - ldr r0, [r5] - ldr r1, =0x00001044 - adds r0, r1 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80E78C4 - ldr r0, [r5] - ldr r1, =0x00001084 - adds r0, r1 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_812287C - ldr r0, [r5] - ldr r1, =0x000011c8 - adds r0, r1 - adds r1, r4, 0 - bl sub_80E7F68 - b _080E70BE - .pool -_080E7014: - ldr r5, =0x0203a014 - ldr r0, [r5] - movs r1, 0xC8 - lsls r1, 4 - mov r8, r1 - add r0, r8 - bl sub_80E7B2C - ldr r0, [r5] - ldr r6, =0x00001444 - lsls r4, 24 - lsrs r4, 24 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80EAF80 - ldr r0, [r5] - add r0, r8 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80F01E8 - ldr r0, [r5] - ldr r1, =0x00001004 - adds r0, r1 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80F0C7C - ldr r0, [r5] - ldr r1, =0x00001044 - adds r0, r1 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80E78C4 - ldr r0, [r5] - ldr r1, =0x00001084 - adds r0, r1 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_812287C - ldr r3, [r5] - ldr r1, =0x000010ac - adds r0, r3, r1 - add r3, r8 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80E7B60 - ldr r0, [r5] - ldr r1, =0x00001124 - adds r0, r1 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80E7948 - ldr r0, [r5] - ldr r1, =0x00001210 - adds r0, r1 - adds r1, r4, 0 - bl sub_80E7F68 - ldr r0, [r5] - ldr r1, =0x00001214 - adds r0, r1 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80E7A14 - ldr r0, [r5] - ldr r1, =0x00001254 - adds r0, r1 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80E8468 - ldr r0, [r5] - ldr r1, =0x000012dc - adds r0, r1 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_80E89AC -_080E70BE: - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E6F60 - - thumb_func_start sub_80E70F4 -sub_80E70F4: @ 80E70F4 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0 - bl Print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80E70F4 - - thumb_func_start sub_80E7128 -sub_80E7128: @ 80E7128 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x32 - bne _080E7150 - movs r0, 0xE2 - bl audio_play - movs r0, 0 - strh r0, [r4, 0x8] -_080E7150: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E7128 - - thumb_func_start sub_80E715C -sub_80E715C: @ 80E715C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0x5 - bls _080E7176 - b _080E730A -_080E7176: - lsls r0, 2 - ldr r1, =_080E7188 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080E7188: - .4byte _080E71A0 - .4byte _080E7218 - .4byte _080E724C - .4byte _080E726C - .4byte _080E72AC - .4byte _080E72C0 -_080E71A0: - ldr r4, =0x0203a018 - ldr r0, =0x00001444 - bl Alloc - str r0, [r4] - ldr r4, =0x0203a014 - ldr r0, =0x00005110 - bl Alloc - str r0, [r4] - ldr r0, =0x020375e2 - ldrb r0, [r0] - bl sub_8009628 - movs r0, 0x80 - lsls r0, 7 - movs r1, 0x1 - bl VarSet - ldr r1, =0x03001130 - movs r0, 0 - strb r0, [r1] - bl sub_80E6E24 - bl sub_80FB00C - movs r0, 0x1 - strh r0, [r5] - ldr r0, =sub_80E7324 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x14] - ldr r0, =sub_80E7128 - movs r1, 0x51 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x1E] - b _080E730A - .pool -_080E7218: - ldr r2, =0x03005e00 - movs r0, 0x14 - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x4] - cmp r0, 0 - bne _080E730A - movs r0, 0x2 - strh r0, [r5] - ldr r0, =0x00000894 - bl FlagSet - bl sub_80FB074 - ldrb r0, [r5, 0x1E] - bl DestroyTask - b _080E730A - .pool -_080E724C: - ldr r0, =sub_80E7FF8 - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x14] - movs r0, 0x3 - strh r0, [r5] - movs r0, 0xE0 - bl audio_play - b _080E730A - .pool -_080E726C: - ldr r2, =0x03005e00 - movs r0, 0x14 - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r4, [r0, 0x4] - cmp r4, 0 - bne _080E730A - movs r0, 0x4 - strh r0, [r5] - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _080E7296 - bl sub_80B3050 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x14] -_080E7296: - ldr r0, =gUnknown_085EEA8E - bl sub_80E70F4 - strh r4, [r5, 0x10] - b _080E730A - .pool -_080E72AC: - ldrh r0, [r5, 0x10] - adds r0, 0x1 - strh r0, [r5, 0x10] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3C - ble _080E730A - movs r0, 0x5 - strh r0, [r5] - b _080E730A -_080E72C0: - ldr r2, =0x03005e00 - movs r0, 0x14 - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x4] - cmp r0, 0 - bne _080E730A - ldr r0, =0x0203a014 - ldr r0, [r0] - bl Free - ldr r0, =0x0203a018 - ldr r0, [r0] - bl Free - bl sub_808729C - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _080E72F8 - ldr r0, =sub_80AF2B4 - movs r1, 0xA - bl CreateTask -_080E72F8: - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - adds r0, r4, 0 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running -_080E730A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E715C - - thumb_func_start sub_80E7324 -sub_80E7324: @ 80E7324 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r6, =0x03005e00 - adds r5, r0, r6 - movs r0, 0x8 - ldrsh r1, [r5, r0] - cmp r1, 0x64 - beq _080E73A0 - cmp r1, 0x64 - bgt _080E7362 - cmp r1, 0x1 - bne _080E7346 - b _080E7464 -_080E7346: - cmp r1, 0x1 - bgt _080E7354 - cmp r1, 0 - beq _080E7384 - b _080E7566 - .pool -_080E7354: - cmp r1, 0x2 - bne _080E735A - b _080E7490 -_080E735A: - cmp r1, 0x5 - bne _080E7360 - b _080E7550 -_080E7360: - b _080E7566 -_080E7362: - cmp r1, 0xC9 - beq _080E73F8 - cmp r1, 0xC9 - bgt _080E7370 - cmp r1, 0x65 - beq _080E73B8 - b _080E7566 -_080E7370: - ldr r0, =0x0000012d - cmp r1, r0 - beq _080E7432 - adds r0, 0x63 - cmp r1, r0 - beq _080E744A - b _080E7566 - .pool -_080E7384: - ldr r0, =gUnknown_085EEA7E - bl sub_80E70F4 - movs r0, 0xE1 - lsls r0, 3 - strh r0, [r5, 0x18] - movs r0, 0xC8 - lsls r0, 1 - strh r0, [r5, 0x8] - bl sub_8009FAC - b _080E7566 - .pool -_080E73A0: - ldrh r0, [r5, 0x20] - adds r0, 0x1 - strh r0, [r5, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - bgt _080E73B0 - b _080E7566 -_080E73B0: - movs r0, 0 - strh r0, [r5, 0x20] - movs r0, 0x65 - b _080E7564 -_080E73B8: - bl sub_800ABAC - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_800ABBC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E73EA - bl sub_800AA48 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - beq _080E73DA - b _080E7566 -_080E73DA: - movs r0, 0x15 - bl audio_play - movs r1, 0 - movs r0, 0xC9 - strh r0, [r5, 0x8] - strh r1, [r5, 0x20] - b _080E7566 -_080E73EA: - movs r0, 0x16 - bl audio_play - ldr r0, =0x0000012d - b _080E7564 - .pool -_080E73F8: - bl sub_800AA48 - adds r4, r0, 0 - bl sub_800ABAC - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _080E740C - b _080E7566 -_080E740C: - ldrh r4, [r5, 0x20] - adds r4, 0x1 - strh r4, [r5, 0x20] - lsls r4, 16 - asrs r4, 16 - bl sub_800ABAC - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 1 - cmp r4, r1 - bgt _080E742A - b _080E7566 -_080E742A: - bl sub_800A620 - movs r0, 0x1 - b _080E7564 -_080E7432: - bl sub_800AA48 - adds r4, r0, 0 - bl sub_800ABAC - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _080E7446 - b _080E7566 -_080E7446: - movs r0, 0x1 - b _080E7564 -_080E744A: - ldrh r0, [r5, 0x20] - adds r0, 0x1 - strh r0, [r5, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - bgt _080E745A - b _080E7566 -_080E745A: - movs r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0 - strh r0, [r5, 0x20] - b _080E7566 -_080E7464: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _080E746E - b _080E7566 -_080E746E: - ldr r4, =0x02021cc4 - bl sub_80E7810 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - movs r0, 0x5 - b _080E7564 - .pool -_080E7490: - bl sub_800ABAC - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - strh r0, [r5, 0x14] - strh r1, [r5, 0x8] - bl sub_80E7810 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x12] - ldr r0, =sub_80E756C - str r0, [r5] - bl sub_800A064 - cmp r0, 0 - beq _080E7504 - ldr r0, =0x0203a018 - ldr r0, [r0] - adds r1, r5, 0 - adds r1, 0xC - bl sub_80E7808 - ldr r0, =sub_80E7630 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x1C] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r0, r1, r6 - strh r4, [r0, 0x8] - ldr r0, =0x0203a014 - ldr r0, [r0] - adds r1, r6, r1 - adds r1, 0x12 - bl sub_80E7808 - ldr r1, =0x0300115c - ldr r0, =0x00001230 - str r0, [r1] - b _080E7566 - .pool -_080E7504: - ldr r0, =0x0203a018 - ldr r0, [r0] - adds r1, r5, 0 - adds r1, 0xC - bl sub_80E7808 - ldr r0, =sub_80E7630 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x1C] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r0, r1, r6 - strh r4, [r0, 0x8] - ldr r0, =0x0203a014 - ldr r0, [r0] - adds r1, r6, r1 - adds r1, 0x12 - bl sub_80E7808 - ldr r1, =0x0300115c - ldr r0, =0x00001444 - str r0, [r1] - b _080E7566 - .pool -_080E7550: - ldrh r0, [r5, 0x1C] - adds r0, 0x1 - strh r0, [r5, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3C - ble _080E7566 - movs r0, 0 - strh r0, [r5, 0x1C] - movs r0, 0x2 -_080E7564: - strh r0, [r5, 0x8] -_080E7566: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80E7324 - - thumb_func_start sub_80E756C -sub_80E756C: @ 80E756C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r5, r1, r0 - movs r2, 0x8 - ldrsh r1, [r5, r2] - adds r2, r0, 0 - cmp r1, 0x4 - bhi _080E7624 - lsls r0, r1, 2 - ldr r1, =_080E7598 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080E7598: - .4byte _080E75AC - .4byte _080E75D0 - .4byte _080E7624 - .4byte _080E75E2 - .4byte _080E760E -_080E75AC: - adds r0, r5, 0 - adds r0, 0xC - bl sub_80E77FC - adds r1, r0, 0 - movs r0, 0x10 - ldrsh r2, [r5, r0] - movs r0, 0xC8 - muls r0, r2 - adds r1, r0 - ldr r0, =0x020228c4 - movs r2, 0xC8 - bl memcpy - b _080E75FC - .pool -_080E75D0: - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _080E75FC - movs r0, 0x1 - bl sub_800A4D8 - b _080E75FC -_080E75E2: - ldrh r0, [r5, 0x10] - adds r0, 0x1 - strh r0, [r5, 0x10] - movs r1, 0x10 - ldrsh r4, [r5, r1] - ldr r0, =0x0300115c - ldr r0, [r0] - movs r1, 0xC8 - bl __udivsi3 - adds r0, 0x1 - cmp r4, r0 - bne _080E7608 -_080E75FC: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - b _080E7624 - .pool -_080E7608: - movs r0, 0 - strh r0, [r5, 0x8] - b _080E7624 -_080E760E: - movs r1, 0x1C - ldrsh r0, [r5, r1] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrb r0, [r1, 0x4] - cmp r0, 0 - bne _080E7624 - ldr r0, =sub_80E77D4 - str r0, [r5] -_080E7624: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E756C - - thumb_func_start sub_80E7630 -sub_80E7630: @ 80E7630 - 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] - lsls r0, 2 - ldr r1, [sp] - adds r0, r1 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r0, r1 - mov r10, r0 - bl sub_800A550 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - movs r2, 0 - str r2, [sp, 0x8] - bl sub_800A9D8 - lsls r0, 24 - lsrs r0, 24 - ldr r3, [sp, 0x4] - cmp r3, r0 - bne _080E773E - movs r4, 0 - mov r8, r4 - b _080E771C - .pool -_080E7678: - ldr r1, [sp, 0x4] - mov r0, r8 - asrs r1, r0 - movs r0, 0x1 - ands r1, r0 - movs r2, 0x1 - add r2, r8 - mov r9, r2 - cmp r1, 0 - beq _080E7714 - mov r0, r10 - adds r0, 0x12 - bl sub_80E77FC - mov r3, r9 - lsls r4, r3, 1 - mov r5, r10 - adds r5, 0x8 - adds r4, r5, r4 - movs r2, 0 - ldrsh r1, [r4, r2] - movs r7, 0xC8 - muls r1, r7 - adds r0, r1 - ldr r3, =0x0300115c - ldr r1, [r3] - mov r2, r8 - muls r2, r1 - adds r1, r2, 0 - adds r6, r0, r1 - mov r0, r8 - bl sub_80E7820 - adds r1, r0, 0 - movs r3, 0 - ldrsh r2, [r4, r3] - adds r0, r2, 0x1 - muls r0, r7 - ldr r4, =0x0300115c - ldr r3, [r4] - cmp r0, r3 - bls _080E76DC - muls r2, r7 - subs r2, r3, r2 - adds r0, r6, 0 - bl memcpy - b _080E76E4 - .pool -_080E76DC: - adds r0, r6, 0 - movs r2, 0xC8 - bl memcpy -_080E76E4: - mov r0, r8 - bl sub_800A5EC - mov r0, r9 - lsls r1, r0, 1 - adds r1, r5, r1 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - movs r2, 0 - ldrsh r4, [r1, r2] - ldr r3, =0x0300115c - ldr r0, [r3] - movs r1, 0xC8 - bl __udivsi3 - adds r0, 0x1 - cmp r4, r0 - bne _080E7714 - ldr r0, [sp, 0x8] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] -_080E7714: - mov r4, r9 - lsls r0, r4, 24 - lsrs r0, 24 - mov r8, r0 -_080E771C: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r8, r0 - bcc _080E7678 - ldr r2, =0x03005e00 - mov r0, r10 - movs r3, 0x8 - ldrsh r1, [r0, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] -_080E773E: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - ldr r4, [sp, 0x8] - cmp r4, r0 - bne _080E7752 - ldr r0, [sp] - bl DestroyTask -_080E7752: - 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_80E7630 - - thumb_func_start sub_80E776C -sub_80E776C: @ 80E776C - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - ldr r2, =0x03005e00 - adds r0, r2 - movs r4, 0x1C - ldrsh r1, [r0, r4] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x4] - cmp r0, 0 - bne _080E7794 - adds r0, r3, 0 - bl DestroyTask -_080E7794: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E776C - - thumb_func_start sub_80E77A0 -sub_80E77A0: @ 80E77A0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r1, r0 - ldr r0, =sub_80E776C - str r0, [r1] - ldr r0, =0x03001130 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080E77C4 - movs r2, 0x12 - ldrsh r0, [r1, r2] - bl sub_80E6F60 -_080E77C4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E77A0 - - thumb_func_start sub_80E77D4 -sub_80E77D4: @ 80E77D4 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =sub_80E77A0 - str r0, [r1] - ldr r1, =0x03001130 - movs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_80E77D4 - - thumb_func_start sub_80E77FC -sub_80E77FC: @ 80E77FC - adds r1, r0, 0 - ldrh r0, [r1] - ldrh r1, [r1, 0x2] - lsls r1, 16 - orrs r0, r1 - bx lr - thumb_func_end sub_80E77FC - - thumb_func_start sub_80E7808 -sub_80E7808: @ 80E7808 - strh r0, [r1] - lsrs r0, 16 - strh r0, [r1, 0x2] - bx lr - thumb_func_end sub_80E7808 - - thumb_func_start sub_80E7810 -sub_80E7810: @ 80E7810 - push {lr} - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_80E7810 - - thumb_func_start sub_80E7820 -sub_80E7820: @ 80E7820 - lsls r0, 24 - lsrs r0, 16 - ldr r1, =0x020223c4 - adds r0, r1 - bx lr - .pool - thumb_func_end sub_80E7820 - - thumb_func_start sub_80E7830 -sub_80E7830: @ 80E7830 - push {r4,lr} - adds r4, r0, 0 - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - beq _080E7868 - cmp r0, 0x3 - bhi _080E784A - cmp r0, 0x2 - beq _080E7850 - b _080E78B8 -_080E784A: - cmp r0, 0x4 - beq _080E7894 - b _080E78B8 -_080E7850: - movs r3, 0 - ldr r2, =gUnknown_0858CF8C - adds r1, r4, 0 -_080E7856: - adds r0, r3, r2 - ldrb r0, [r0] - stm r1!, {r0} - adds r3, 0x1 - cmp r3, 0x1 - bls _080E7856 - b _080E78B8 - .pool -_080E7868: - movs r0, 0 - bl sub_800A2A4 - adds r2, r0, 0 - movs r0, 0x1 - ands r2, r0 - movs r3, 0 - ldr r1, =gUnknown_0858CF8E - lsls r0, r2, 1 - adds r0, r2 - adds r1, r0, r1 - adds r2, r4, 0 -_080E7880: - ldrb r0, [r1] - stm r2!, {r0} - adds r1, 0x1 - adds r3, 0x1 - cmp r3, 0x2 - bls _080E7880 - b _080E78B8 - .pool -_080E7894: - movs r0, 0 - bl sub_800A2A4 - movs r1, 0x9 - bl __umodsi3 - adds r2, r0, 0 - movs r3, 0 - ldr r1, =gUnknown_0858CF94 - lsls r0, r2, 2 - adds r1, r0, r1 - adds r2, r4, 0 -_080E78AC: - ldrb r0, [r1] - stm r2!, {r0} - adds r1, 0x1 - adds r3, 0x1 - cmp r3, 0x3 - bls _080E78AC -_080E78B8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E7830 - - thumb_func_start sub_80E78C4 -sub_80E78C4: @ 80E78C4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - mov r9, r0 - mov r8, r1 - lsls r2, 24 - lsrs r7, r2, 24 - mov r0, sp - bl sub_80E7830 - lsls r0, r7, 2 - add r0, sp - ldr r1, [r0] - mov r0, r8 - muls r0, r1 - mov r2, r9 - adds r6, r2, r0 - ldr r2, =0x020229e8 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r4, [r0] - ldrh r5, [r0, 0x1A] - bl sub_800A064 - cmp r0, 0 - beq _080E7910 - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_8120D34 - b _080E791A - .pool -_080E7910: - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_8120CD0 -_080E791A: - ldr r0, =0x03001140 - ldr r0, [r0] - lsls r1, r7, 2 - add r1, sp - ldr r1, [r1] - mov r2, r8 - muls r2, r1 - adds r1, r2, 0 - add r1, r9 - movs r2, 0x40 - bl memcpy - bl sub_8120670 - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E78C4 - - thumb_func_start sub_80E7948 -sub_80E7948: @ 80E7948 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - mov r8, r0 - adds r7, r1, 0 - lsls r2, 24 - lsrs r6, r2, 24 - mov r0, sp - bl sub_80E7830 - bl sub_800A064 - cmp r0, 0 - beq _080E79AC - lsls r0, r6, 2 - mov r1, sp - adds r5, r1, r0 - ldr r0, [r5] - muls r0, r7 - add r0, r8 - adds r4, r7, 0 - muls r4, r6 - mov r1, r8 - adds r6, r1, r4 - adds r1, r6, 0 - bl sub_816587C - mov r9, r4 - cmp r0, 0x1 - bne _080E79FE - adds r7, r6, 0 - ldr r2, =0x020229e8 - ldr r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x1A] - adds r0, r7, 0 - adds r0, 0xE4 - strb r1, [r0] - adds r0, r7, 0 - bl sub_8164F70 - b _080E79FE - .pool -_080E79AC: - adds r5, r7, 0 - muls r5, r6 - mov r0, r8 - adds r4, r0, r5 - lsls r0, r6, 2 - add r0, sp - ldr r0, [r0] - adds r1, r7, 0 - muls r1, r0 - add r1, r8 - adds r0, r4, 0 - movs r2, 0xEC - bl memcpy - adds r7, r4, 0 - movs r6, 0 - mov r9, r5 -_080E79CE: - movs r0, 0x2C - muls r0, r6 - adds r0, 0x34 - adds r1, r7, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _080E79F2 - adds r4, r1, 0 - adds r4, 0x20 - adds r0, r4, 0 - bl sub_8009228 - cmp r0, 0 - beq _080E79F2 - adds r0, r4, 0 - movs r1, 0x1 - bl StopMusicWhileStringIsPrinted -_080E79F2: - adds r6, 0x1 - cmp r6, 0x3 - ble _080E79CE - adds r0, r7, 0 - bl sub_8164F70 -_080E79FE: - mov r0, r8 - add r0, r9 - bl sub_81628A0 - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80E7948 - - thumb_func_start sub_80E7A14 -sub_80E7A14: @ 80E7A14 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - mov r8, r0 - adds r7, r1, 0 - lsls r2, 24 - lsrs r5, r2, 24 - mov r0, sp - bl sub_80E7830 - adds r0, r7, 0 - muls r0, r5 - add r0, r8 - ldr r6, =0x03001150 - ldr r1, [r6] - movs r2, 0x40 - bl memcpy - bl sub_818D9AC - lsls r0, 24 - cmp r0, 0 - bne _080E7A60 - movs r0, 0x40 - bl Alloc - adds r4, r0, 0 - cmp r4, 0 - beq _080E7A8A - ldr r1, [r6] - movs r2, 0x40 - bl memcpy - b _080E7A62 - .pool -_080E7A60: - movs r4, 0 -_080E7A62: - ldr r0, =0x03001150 - ldr r0, [r0] - lsls r1, r5, 2 - add r1, sp - ldr r1, [r1] - muls r1, r7 - add r1, r8 - movs r2, 0x40 - bl memcpy - bl sub_818DA78 - cmp r4, 0 - beq _080E7A8A - adds r0, r4, 0 - bl sub_818E570 - adds r0, r4, 0 - bl Free -_080E7A8A: - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E7A14 - - thumb_func_start sub_80E7A9C -sub_80E7A9C: @ 80E7A9C - ldrh r0, [r0, 0x20] - lsls r0, 24 - lsrs r0, 24 - bx lr - thumb_func_end sub_80E7A9C - - thumb_func_start sub_80E7AA4 -sub_80E7AA4: @ 80E7AA4 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0x38 - mov r8, r0 - mov r10, r1 - mov r9, r2 - adds r4, r3, 0 - ldr r5, [sp, 0x54] - lsls r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsrs r4, 23 - add r4, r9 - ldrb r0, [r4] - mov r6, r10 - muls r6, r0 - add r6, r8 - ldrb r0, [r4, 0x1] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 3 - adds r1, r6, r1 - mov r0, sp - movs r2, 0x38 - bl memcpy - lsls r5, 1 - add r5, r9 - ldrb r0, [r5] - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - add r8, r0 - ldrb r1, [r4, 0x1] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 3 - adds r6, r0 - ldrb r0, [r5, 0x1] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 3 - add r1, r8 - adds r0, r6, 0 - movs r2, 0x38 - bl memcpy - ldrb r1, [r5, 0x1] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 3 - add r8, r0 - mov r0, r8 - mov r1, sp - movs r2, 0x38 - bl memcpy - add sp, 0x38 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80E7AA4 - - thumb_func_start sub_80E7B2C -sub_80E7B2C: @ 80E7B2C - push {r4,lr} - adds r3, r0, 0 - movs r2, 0 - movs r1, 0 - ldr r4, =0x03001160 -_080E7B36: - adds r0, r3, r1 - ldrb r0, [r0] - adds r0, r2, r0 - lsls r0, 24 - lsrs r2, r0, 24 - adds r1, 0x1 - cmp r1, 0xFF - ble _080E7B36 - strb r2, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E7B2C - - thumb_func_start sub_80E7B54 -sub_80E7B54: @ 80E7B54 - ldr r0, =0x03001160 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_80E7B54 - - thumb_func_start sub_80E7B60 -sub_80E7B60: @ 80E7B60 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x58 - str r0, [sp, 0x2C] - str r1, [sp, 0x30] - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - bl GenerateRandomNumber2 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x38] - ldr r0, =0x020229e8 - ldrh r0, [r0, 0x4] - bl SeedRng2 - bl sub_8009FCC - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0 - mov r8, r0 - mov r1, sp - adds r1, 0x1C - str r1, [sp, 0x4C] - mov r2, sp - adds r2, 0x1D - str r2, [sp, 0x50] - mov r3, sp - adds r3, 0xC - str r3, [sp, 0x48] - movs r7, 0xFF - add r3, sp, 0x8 - movs r2, 0 - adds r6, r1, 0 - ldr r5, [sp, 0x50] -_080E7BB0: - mov r1, sp - add r1, r8 - adds r1, 0x4 - ldrb r0, [r1] - orrs r0, r7 - strb r0, [r1] - mov r1, r8 - adds r0, r3, r1 - strb r2, [r0] - lsls r1, 1 - adds r0, r6, r1 - strb r2, [r0] - adds r1, r5, r1 - strb r2, [r1] - mov r0, r8 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r0, 0x3 - bls _080E7BB0 - bl sub_800A064 - str r0, [sp, 0x3C] - movs r2, 0 - mov r8, r2 - lsls r4, 16 - str r4, [sp, 0x54] - ldr r0, [sp, 0x30] - mov r3, r9 - muls r3, r0 - str r3, [sp, 0x44] - b _080E7D04 - .pool -_080E7BF8: - ldr r1, [sp, 0x30] - mov r0, r8 - muls r0, r1 - ldr r2, [sp, 0x2C] - adds r7, r2, r0 - ldr r1, =0x020229e8 - mov r3, r8 - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0, 0x1A] - mov r9, r1 - ldrb r0, [r0] - str r0, [sp, 0x40] - movs r6, 0 - ldr r0, [r7, 0x70] - cmp r6, r0 - bcs _080E7CFA - movs r2, 0x10 - negs r2, r2 - mov r10, r2 -_080E7C24: - lsls r0, r6, 3 - subs r0, r6 - lsls r0, 3 - adds r5, r7, r0 - ldrh r0, [r5, 0x20] - cmp r0, 0 - beq _080E7CEE - ldr r3, [sp, 0x3C] - cmp r3, 0 - beq _080E7C9A - adds r4, r5, 0 - adds r4, 0x24 - adds r0, r4, 0 - bl GetStringLength - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x5 - bhi _080E7C54 - movs r4, 0x1 - b _080E7C5C - .pool -_080E7C54: - adds r0, r4, 0 - bl StripExtendedControlCodes - mov r4, r9 -_080E7C5C: - ldrh r1, [r5, 0x2C] - ldr r0, =0x000015fc - cmp r1, r0 - bne _080E7C74 - adds r0, r5, 0 - adds r0, 0x2C - bl StripExtendedControlCodes - movs r1, 0x1 - b _080E7C76 - .pool -_080E7C74: - mov r1, r9 -_080E7C76: - ldr r0, [sp, 0x40] - subs r0, 0x1 - cmp r0, 0x1 - bhi _080E7CEE - adds r2, r5, 0 - adds r2, 0x37 - movs r0, 0xF - ands r4, r0 - ldrb r0, [r2] - mov r3, r10 - ands r0, r3 - orrs r0, r4 - lsls r1, 4 - movs r3, 0xF - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - b _080E7CEE -_080E7C9A: - mov r0, r9 - cmp r0, 0x1 - bne _080E7CEE - adds r0, r5, 0 - adds r0, 0x24 - bl sub_8009228 - cmp r0, 0 - beq _080E7CBA - adds r0, r5, 0 - adds r0, 0x37 - ldrb r1, [r0] - mov r2, r10 - ands r1, r2 - movs r2, 0x1 - b _080E7CC6 -_080E7CBA: - adds r0, r5, 0 - adds r0, 0x37 - ldrb r1, [r0] - mov r3, r10 - ands r1, r3 - movs r2, 0x2 -_080E7CC6: - orrs r1, r2 - strb r1, [r0] - adds r4, r0, 0 - adds r0, r5, 0 - adds r0, 0x2C - bl sub_8009228 - cmp r0, 0 - beq _080E7CE2 - ldrb r0, [r4] - movs r1, 0xF - ands r1, r0 - movs r0, 0x10 - b _080E7CEA -_080E7CE2: - ldrb r0, [r4] - movs r1, 0xF - ands r1, r0 - movs r0, 0x20 -_080E7CEA: - orrs r1, r0 - strb r1, [r4] -_080E7CEE: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, [r7, 0x70] - cmp r6, r0 - bcc _080E7C24 -_080E7CFA: - mov r0, r8 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 -_080E7D04: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r8, r0 - bcs _080E7D12 - b _080E7BF8 -_080E7D12: - movs r0, 0 - str r0, [sp, 0x34] - mov r8, r0 - ldr r1, [sp, 0x54] - lsrs r0, r1, 16 - ldr r2, [sp, 0x34] - cmp r2, r0 - bcs _080E7D70 - adds r5, r0, 0 -_080E7D24: - ldr r3, [sp, 0x30] - mov r0, r8 - muls r0, r3 - ldr r1, [sp, 0x2C] - adds r7, r1, r0 - ldr r0, [r7, 0x70] - cmp r0, 0 - beq _080E7D62 - movs r6, 0 - cmp r6, r0 - bcs _080E7D62 - adds r3, r7, 0 - adds r3, 0x74 - ldr r2, [sp, 0x4C] - mov r0, r8 - lsls r1, r0, 1 - movs r4, 0x1 -_080E7D46: - lsls r0, r6, 1 - adds r0, r3, r0 - ldrh r0, [r0] - cmp r0, 0 - bne _080E7D56 - adds r0, r6, r1 - adds r0, r2, r0 - strb r4, [r0] -_080E7D56: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, [r7, 0x70] - cmp r6, r0 - bcc _080E7D46 -_080E7D62: - mov r0, r8 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r8, r5 - bcc _080E7D24 -_080E7D70: - movs r6, 0 - mov r8, r6 - ldr r1, [sp, 0x54] - cmp r1, 0 - beq _080E7E64 - add r2, sp, 0x24 - mov r10, r2 - movs r3, 0x25 - add r3, sp - mov r9, r3 -_080E7D84: - ldr r1, [sp, 0x30] - mov r0, r8 - muls r0, r1 - ldr r2, [sp, 0x2C] - adds r7, r2, r0 - mov r3, r8 - lsls r1, r3, 1 - ldr r2, [sp, 0x4C] - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080E7DA6 - ldr r3, [sp, 0x50] - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080E7DB0 -_080E7DA6: - ldr r0, [sp, 0x34] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x34] -_080E7DB0: - ldr r2, [sp, 0x4C] - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080E7DD4 - ldr r3, [sp, 0x50] - adds r0, r3, r1 - ldrb r2, [r0] - cmp r2, 0 - bne _080E7DD4 -_080E7DC4: - lsls r1, r6, 1 - mov r3, r10 - adds r0, r3, r1 - mov r3, r8 - strb r3, [r0] - add r1, r9 - strb r2, [r1] - b _080E7E4E -_080E7DD4: - ldr r2, [sp, 0x4C] - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080E7DE8 - ldr r3, [sp, 0x50] - adds r0, r3, r1 - ldrb r2, [r0] - cmp r2, 0x1 - beq _080E7DC4 -_080E7DE8: - ldr r2, [sp, 0x4C] - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080E7E54 - ldr r3, [sp, 0x50] - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080E7E54 - lsls r5, r6, 1 - mov r1, r10 - adds r0, r1, r5 - mov r2, r8 - strb r2, [r0] - adds r0, r7, 0 - bl sub_80E7A9C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r7, 0 - adds r0, 0x38 - bl sub_80E7A9C - lsls r0, 24 - lsrs r1, r0, 24 - cmp r4, 0 - bne _080E7E30 - cmp r1, 0 - beq _080E7E34 - mov r3, r9 - adds r1, r3, r5 - movs r0, 0x1 - strb r0, [r1] - b _080E7E4E -_080E7E30: - cmp r1, 0 - beq _080E7E48 -_080E7E34: - bl GenerateRandomNumber2 - mov r1, r9 - adds r2, r1, r5 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 - strb r0, [r2] - b _080E7E4E -_080E7E48: - mov r2, r9 - adds r0, r2, r5 - strb r1, [r0] -_080E7E4E: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 -_080E7E54: - mov r0, r8 - adds r0, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - mov r8, r3 - ldr r1, [sp, 0x54] - cmp r0, r1 - bcc _080E7D84 -_080E7E64: - movs r2, 0 - mov r8, r2 - ldr r3, [sp, 0x44] - lsls r0, r3, 4 - subs r0, r3 - lsls r0, 3 - ldr r1, [sp, 0x2C] - adds r7, r1, r0 - ldr r1, [sp, 0x48] -_080E7E76: - mov r2, r8 - lsls r0, r2, 2 - adds r0, r1, r0 - str r7, [r0] - mov r0, r8 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r0, 0x3 - bls _080E7E76 - bl sub_80E7B54 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r1, r0, 24 - ldr r3, [sp, 0x34] - cmp r3, 0x3 - beq _080E7EC8 - cmp r3, 0x3 - bgt _080E7EAE - cmp r3, 0x2 - beq _080E7EB6 - b _080E7F1C -_080E7EAE: - ldr r0, [sp, 0x34] - cmp r0, 0x4 - beq _080E7EE8 - b _080E7F1C -_080E7EB6: - add r2, sp, 0x24 - movs r0, 0x1 - str r0, [sp] - ldr r0, [sp, 0x2C] - ldr r1, [sp, 0x30] - movs r3, 0 - bl sub_80E7AA4 - b _080E7F1C -_080E7EC8: - ldr r0, =gUnknown_0858CFB8 - lsls r1, 1 - adds r2, r1, r0 - ldrb r3, [r2] - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - add r2, sp, 0x24 - str r0, [sp] - ldr r0, [sp, 0x2C] - ldr r1, [sp, 0x30] - bl sub_80E7AA4 - b _080E7F1C - .pool -_080E7EE8: - add r6, sp, 0x24 - ldr r4, =gUnknown_0858CFBE - lsls r5, r1, 2 - adds r0, r5, r4 - ldrb r3, [r0] - adds r0, r4, 0x1 - adds r0, r5, r0 - ldrb r0, [r0] - str r0, [sp] - ldr r0, [sp, 0x2C] - ldr r1, [sp, 0x30] - adds r2, r6, 0 - bl sub_80E7AA4 - adds r0, r4, 0x2 - adds r0, r5, r0 - ldrb r3, [r0] - adds r4, 0x3 - adds r5, r4 - ldrb r0, [r5] - str r0, [sp] - ldr r0, [sp, 0x2C] - ldr r1, [sp, 0x30] - adds r2, r6, 0 - bl sub_80E7AA4 -_080E7F1C: - ldr r1, [sp, 0x2C] - ldr r2, [sp, 0x44] - adds r7, r1, r2 - ldr r4, =0x03005d8c - ldr r0, [r4] - movs r3, 0xC2 - lsls r3, 6 - adds r0, r3 - adds r1, r7, 0 - movs r2, 0x38 - bl memcpy - ldr r0, [r4] - ldr r1, =0x0000310c - adds r0, r1 - adds r1, r7, 0 - adds r1, 0x38 - movs r2, 0x38 - bl memcpy - ldr r0, [sp, 0x38] - bl SeedRng - 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_80E7B60 - - thumb_func_start sub_80E7F68 -sub_80E7F68: @ 80E7F68 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - cmp r1, 0 - beq _080E7FEC - ldrh r0, [r4] - cmp r0, 0 - beq _080E7FEC - bl sub_80D6C68 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bne _080E7FEC - ldrh r0, [r4] - movs r1, 0x1 - bl sub_80D6724 - lsls r0, 24 - cmp r0, 0 - bne _080E7FE4 - ldrh r0, [r4] - movs r1, 0x1 - bl sub_80D6D1C - lsls r0, 24 - cmp r0, 0 - bne _080E7FE4 - ldrh r0, [r4] - movs r1, 0x1 - bl bag_add_item - lsls r0, 24 - cmp r0, 0 - beq _080E7FE4 - ldr r0, =0x00004001 - ldrh r1, [r4] - bl VarSet - ldr r0, =0x02021cc4 - ldr r1, =0x020229f0 - bl CopyString - ldrh r1, [r4] - ldr r0, =0x00000113 - cmp r1, r0 - bne _080E7FEC - ldr r0, =0x000008b3 - bl FlagSet - b _080E7FEC - .pool -_080E7FE4: - ldr r0, =0x00004001 - movs r1, 0 - bl VarSet -_080E7FEC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E7F68 - - thumb_func_start sub_80E7FF8 -sub_80E7FF8: @ 80E7FF8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x9 - bls _080E8012 - b _080E810A -_080E8012: - lsls r0, 2 - ldr r1, =_080E8024 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080E8024: - .4byte _080E80F2 - .4byte _080E804C - .4byte _080E805A - .4byte _080E8064 - .4byte _080E807C - .4byte _080E8090 - .4byte _080E80A4 - .4byte _080E80C0 - .4byte _080E80EE - .4byte _080E80FA -_080E804C: - bl sub_800A064 - cmp r0, 0 - bne _080E80F2 - movs r0, 0x6 - strh r0, [r4, 0x8] - b _080E810A -_080E805A: - bl sub_8076D5C - bl sub_8153430 - b _080E80F2 -_080E8064: - bl sub_8153474 - lsls r0, 24 - cmp r0, 0 - beq _080E810A - bl sav2_gender2_inplace_and_xFE - movs r1, 0 - movs r0, 0x4 - strh r0, [r4, 0x8] - strh r1, [r4, 0xA] - b _080E810A -_080E807C: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - ble _080E810A - bl sub_800AC34 - b _080E80F2 -_080E8090: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _080E810A - adds r0, r5, 0 - bl DestroyTask - b _080E810A - .pool -_080E80A4: - movs r0, 0 - bl sub_801048C - lsls r0, 24 - cmp r0, 0 - bne _080E810A - ldr r0, =sub_8153688 - movs r1, 0x5 - bl CreateTask - b _080E80F2 - .pool -_080E80C0: - ldr r0, =sub_8153688 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _080E810A - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _080E80E8 - movs r0, 0x1 - bl sub_801048C - movs r0, 0x8 - strh r0, [r4, 0x8] - b _080E810A - .pool -_080E80E8: - movs r0, 0x4 - strh r0, [r4, 0x8] - b _080E810A -_080E80EE: - bl sub_800ADF8 -_080E80F2: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080E810A -_080E80FA: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080E810A - adds r0, r5, 0 - bl DestroyTask -_080E810A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80E7FF8 - - thumb_func_start sub_80E8110 -sub_80E8110: @ 80E8110 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - str r0, [sp] - mov r10, r1 - adds r1, r0, 0 - adds r1, 0x38 - movs r0, 0xFF - strb r0, [r1] - ldr r1, [sp] - adds r1, 0x7C - movs r0, 0x1 - negs r0, r0 - strb r0, [r1] - ldr r0, [sp] - mov r1, r10 - movs r2, 0x44 - bl memcpy - movs r0, 0 - str r0, [sp, 0x8] - movs r1, 0 - str r1, [sp, 0xC] - movs r2, 0 - str r2, [sp, 0x4] - mov r8, r2 - movs r7, 0 - ldr r0, =0x03005d90 - mov r9, r0 -_080E8150: - mov r1, r9 - ldr r0, [r1] - adds r0, 0xB2 - ldrb r0, [r0] - lsls r0, 27 - lsrs r0, 30 - adds r0, r7, r0 - movs r1, 0x3 - bl __modsi3 - adds r6, r0, 0x1 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - mov r2, r10 - adds r1, r0, r2 - adds r0, r1, 0 - adds r0, 0x38 - ldrb r0, [r0] - cmp r0, 0xFF - beq _080E81B8 - adds r5, r1, 0 - adds r5, 0x34 - adds r0, r5, 0 - bl sub_80842DC - adds r4, r0, 0 - mov r1, r9 - ldr r0, [r1] - adds r0, 0xA - bl sub_80842DC - cmp r4, r0 - beq _080E819A - movs r2, 0x1 - add r8, r2 - str r6, [sp, 0x4] -_080E819A: - adds r0, r5, 0 - bl sub_80842DC - adds r4, r0, 0 - mov r1, r9 - ldr r0, [r1] - adds r0, 0xA - bl sub_80842DC - cmp r4, r0 - bne _080E81B8 - ldr r2, [sp, 0xC] - adds r2, 0x1 - str r2, [sp, 0xC] - str r6, [sp, 0x8] -_080E81B8: - adds r7, 0x1 - cmp r7, 0x1 - ble _080E8150 - mov r0, r8 - cmp r0, 0 - bne _080E81D0 - ldr r1, [sp, 0xC] - cmp r1, 0 - beq _080E81D0 - mov r8, r1 - ldr r2, [sp, 0x8] - str r2, [sp, 0x4] -_080E81D0: - mov r0, r8 - cmp r0, 0x1 - beq _080E81E0 - cmp r0, 0x2 - beq _080E81EC - b _080E824C - .pool -_080E81E0: - ldr r2, [sp, 0x4] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r10 - b _080E820E -_080E81EC: - bl GenerateRandomNumber2 - lsls r0, 16 - ldr r1, =0x33330000 - cmp r0, r1 - bls _080E8224 - ldr r0, =0x03005d90 - ldr r0, [r0] - adds r0, 0xB2 - ldrb r0, [r0] - lsls r0, 27 - lsrs r0, 30 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r10 - adds r1, 0x44 -_080E820E: - ldr r0, [sp] - adds r0, 0x44 - movs r2, 0x44 - bl memcpy - b _080E824C - .pool -_080E8224: - ldr r0, =0x03005d90 - ldr r0, [r0] - adds r0, 0xB2 - ldrb r0, [r0] - lsls r0, 27 - lsrs r0, 30 - adds r0, 0x1 - movs r1, 0x3 - bl __modsi3 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r10 - adds r1, 0x44 - ldr r0, [sp] - adds r0, 0x44 - movs r2, 0x44 - bl memcpy -_080E824C: - 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_80E8110 - - thumb_func_start sub_80E8260 -sub_80E8260: @ 80E8260 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - mov r8, r0 - movs r6, 0 - ldr r0, =0x03005d90 - mov r10, r0 -_080E8274: - movs r7, 0 - lsls r0, r6, 5 - adds r6, 0x1 - mov r9, r6 - mov r1, r8 - adds r4, r0, r1 - adds r0, 0x6 - adds r6, r1, r0 - adds r5, r4, 0 -_080E8286: - mov r2, r10 - ldr r1, [r2] - adds r1, 0xA - adds r0, r5, 0 - bl sub_80842F4 - movs r0, 0x2 - strb r0, [r4, 0xE] - mov r0, r10 - ldr r1, [r0] - adds r0, r6, 0 - bl CopyString - adds r4, 0x10 - adds r6, 0x10 - adds r5, 0x10 - adds r7, 0x1 - cmp r7, 0x1 - ble _080E8286 - mov r6, r9 - cmp r6, 0x8 - ble _080E8274 - ldr r1, =0x03005d90 - mov r10, r1 - ldr r2, =0x00000ee1 - str r2, [sp, 0x4] - movs r4, 0x99 - lsls r4, 1 - add r4, r8 - movs r0, 0x95 - lsls r0, 1 - add r0, r8 - mov r9, r0 - ldr r1, =0x00000ef1 - str r1, [sp, 0x8] - movs r6, 0x92 - lsls r6, 1 - add r6, r8 - movs r5, 0x90 - lsls r5, 1 - add r5, r8 - movs r7, 0x1 -_080E82DA: - movs r0, 0x2 - strb r0, [r4, 0x8] - mov r2, r10 - ldr r1, [r2] - adds r1, 0xA - adds r0, r5, 0 - bl sub_80842F4 - mov r0, r10 - ldr r1, [r0] - ldr r2, [sp, 0x8] - adds r1, r2 - adds r0, r6, 0 - bl sub_80842F4 - mov r0, r10 - ldr r1, [r0] - mov r0, r9 - bl CopyString - mov r2, r10 - ldr r1, [r2] - ldr r0, [sp, 0x4] - adds r1, r0 - adds r0, r4, 0 - bl CopyString - ldr r1, [sp, 0x4] - adds r1, 0x8 - str r1, [sp, 0x4] - adds r4, 0x1C - movs r2, 0x1C - add r9, r2 - ldr r0, [sp, 0x8] - adds r0, 0x4 - str r0, [sp, 0x8] - adds r6, 0x1C - adds r5, 0x1C - subs r7, 0x1 - cmp r7, 0 - bge _080E82DA - movs r6, 0 - ldr r0, =0x03005d90 - ldr r3, [r0] - mov r4, r8 - movs r1, 0xC4 - adds r1, r4 - mov r9, r1 - movs r2, 0x84 - adds r2, r4 - mov r8, r2 - movs r0, 0x44 - adds r0, r4 - mov r12, r0 - adds r7, r4, 0x4 - movs r1, 0xCF - lsls r1, 4 - adds r1, r3, r1 - str r1, [sp] - mov r10, r4 - ldr r2, =0x00000cf4 - adds r5, r3, r2 -_080E8356: - lsls r2, r6, 1 - ldr r1, [sp] - ldrh r0, [r1] - strh r0, [r7] - ldrh r0, [r5] - strh r0, [r7, 0x20] - ldrh r0, [r5, 0x4] - mov r1, r12 - strh r0, [r1] - ldr r1, =0x00000d14 - adds r0, r3, r1 - adds r0, r2 - ldrh r0, [r0] - mov r1, r12 - strh r0, [r1, 0x20] - movs r1, 0xDD - lsls r1, 4 - adds r0, r3, r1 - adds r0, r2 - ldrh r0, [r0] - mov r1, r8 - strh r0, [r1] - ldr r1, =0x00000dde - adds r0, r3, r1 - adds r0, r2 - ldrh r0, [r0] - mov r1, r8 - strh r0, [r1, 0x20] - ldr r1, =0x00000dea - adds r0, r3, r1 - adds r0, r2 - ldrh r0, [r0] - mov r1, r9 - strh r0, [r1] - ldr r1, =0x00000e08 - adds r0, r3, r1 - adds r0, r2 - ldrh r0, [r0] - mov r1, r9 - strh r0, [r1, 0x20] - ldr r1, =0x00000e1e - adds r0, r3, r1 - adds r0, r2 - ldrh r1, [r0] - movs r0, 0x82 - lsls r0, 1 - add r0, r10 - strh r1, [r0] - ldr r1, =0x00000cfc - adds r0, r3, r1 - adds r0, r2 - ldrh r1, [r0] - movs r2, 0x94 - lsls r2, 1 - adds r0, r4, r2 - strh r1, [r0] - adds r4, 0x1C - movs r0, 0x10 - add r9, r0 - add r8, r0 - add r12, r0 - adds r7, 0x10 - ldr r1, [sp] - adds r1, 0x2 - str r1, [sp] - add r10, r0 - adds r5, 0x2 - adds r6, 0x1 - cmp r6, 0x1 - ble _080E8356 - 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_80E8260 - - thumb_func_start sub_80E841C -sub_80E841C: @ 80E841C - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r0, 0 - movs r0, 0 - mov r8, r0 - adds r6, r1, 0 - adds r6, 0x34 - adds r5, r1, 0 -_080E842E: - adds r0, r7, 0 - adds r0, 0x34 - bl sub_80842DC - adds r4, r0, 0 - adds r0, r6, 0 - bl sub_80842DC - cmp r4, r0 - bne _080E844E - ldrb r0, [r7, 0x2] - ldrb r1, [r5, 0x2] - cmp r0, r1 - bne _080E844E - movs r0, 0x1 - b _080E845E -_080E844E: - adds r6, 0x44 - adds r5, 0x44 - movs r0, 0x1 - add r8, r0 - mov r1, r8 - cmp r1, 0x3 - ble _080E842E - movs r0, 0 -_080E845E: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80E841C - - thumb_func_start sub_80E8468 -sub_80E8468: @ 80E8468 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - adds r6, r0, 0 - adds r5, r1, 0 - adds r4, r2, 0 - mov r0, sp - bl sub_80E7830 - lsls r4, 2 - mov r1, sp - adds r0, r1, r4 - ldr r0, [r0] - muls r0, r5 - adds r3, r6, r0 - movs r7, 0 - movs r2, 0 - mov r8, r2 - movs r5, 0 - adds r6, r3, 0 - adds r6, 0x38 - adds r4, r3, 0 -_080E8496: - ldrb r0, [r6] - cmp r0, 0xFF - beq _080E84B4 - ldr r0, =0x03005d90 - ldr r1, [r0] - adds r1, 0xDC - adds r0, r4, 0 - str r3, [sp, 0x10] - bl sub_80E841C - ldr r3, [sp, 0x10] - cmp r0, 0 - bne _080E84B4 - adds r7, 0x1 - mov r8, r5 -_080E84B4: - adds r6, 0x44 - adds r4, 0x44 - adds r5, 0x1 - cmp r5, 0x1 - ble _080E8496 - cmp r7, 0x1 - beq _080E84CC - cmp r7, 0x2 - beq _080E8508 - b _080E8566 - .pool -_080E84CC: - ldr r4, =0x03005d90 - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0xB2 - ldrb r1, [r1] - lsls r1, 27 - lsrs r1, 30 - adds r2, r1, 0x1 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r0, r1 - adds r0, 0xDC - mov r2, r8 - lsls r1, r2, 4 - add r1, r8 - lsls r1, 2 - adds r1, r3 - movs r2, 0x44 - bl memcpy - ldr r4, [r4] - adds r4, 0xB2 - ldrb r5, [r4] - lsls r0, r5, 27 - lsrs r0, 30 - adds r0, 0x1 - b _080E8550 - .pool -_080E8508: - movs r5, 0 - adds r6, r3, 0 -_080E850C: - movs r0, 0x1 - eors r0, r5 - ldr r7, =0x03005d90 - ldr r4, [r7] - adds r1, r4, 0 - adds r1, 0xB2 - ldrb r1, [r1] - lsls r1, 27 - lsrs r1, 30 - adds r0, r1 - movs r1, 0x3 - bl __modsi3 - adds r2, r0, 0x1 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r4, r0 - adds r4, 0xDC - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0x44 - bl memcpy - adds r6, 0x44 - adds r5, 0x1 - cmp r5, 0x1 - ble _080E850C - ldr r4, [r7] - adds r4, 0xB2 - ldrb r5, [r4] - lsls r0, r5, 27 - lsrs r0, 30 - adds r0, 0x2 -_080E8550: - movs r1, 0x3 - bl __modsi3 - movs r1, 0x3 - ands r0, r1 - lsls r0, 3 - movs r1, 0x19 - negs r1, r1 - ands r1, r5 - orrs r1, r0 - strb r1, [r4] -_080E8566: - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E8468 - - thumb_func_start sub_80E8578 -sub_80E8578: @ 80E8578 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x54 - str r0, [sp] - ldr r0, [sp, 0x74] - movs r4, 0 - mov r8, r4 - movs r5, 0 - str r5, [sp, 0x4] - ldr r4, =0x03001168 - b _080E85A0 - .pool -_080E8598: - adds r1, r2 - ldr r6, [sp, 0x4] - adds r6, 0x1 - str r6, [sp, 0x4] -_080E85A0: - ldr r5, [sp, 0x4] - cmp r5, r0 - bge _080E85B6 - cmp r5, r3 - beq _080E85B0 - stm r4!, {r1} - movs r6, 0x1 - add r8, r6 -_080E85B0: - mov r5, r8 - cmp r5, 0x3 - bne _080E8598 -_080E85B6: - movs r6, 0 - str r6, [sp, 0x4] - subs r0, 0x1 - str r0, [sp, 0x24] -_080E85BE: - movs r0, 0 - str r0, [sp, 0x8] - ldr r1, [sp, 0x4] - adds r1, 0x1 - str r1, [sp, 0x28] - ldr r2, [sp, 0x4] - lsls r2, 1 - str r2, [sp, 0x34] - ldr r3, [sp, 0x4] - adds r3, r2, r3 - str r3, [sp, 0x10] - movs r4, 0 - str r4, [sp, 0x44] - movs r5, 0 - str r5, [sp, 0x48] -_080E85DC: - movs r6, 0 - mov r8, r6 - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r2, [sp, 0x10] - lsls r0, r2, 5 - ldr r3, [sp, 0x48] - adds r0, r3, r0 - adds r3, r0, r1 - lsls r0, r2, 6 - ldr r4, [sp, 0x44] - adds r0, r4, r0 - ldr r5, [sp] - adds r2, r0, r5 -_080E85F8: - adds r0, r2, 0 - movs r6, 0x87 - lsls r6, 2 - adds r1, r3, r6 - ldm r1!, {r4-r6} - stm r0!, {r4-r6} - ldr r1, [r1] - str r1, [r0] - adds r3, 0x10 - adds r2, 0x10 - movs r0, 0x1 - add r8, r0 - mov r1, r8 - cmp r1, 0x2 - ble _080E85F8 - movs r2, 0 - mov r8, r2 - ldr r3, [sp, 0x24] - cmp r8, r3 - bge _080E86DC - ldr r4, [sp, 0x4] - lsls r4, 5 - mov r9, r4 - ldr r5, [sp, 0x8] - lsls r7, r5, 4 - ldr r6, [sp, 0x34] - ldr r1, [sp, 0x4] - adds r0, r6, r1 - lsls r0, 6 - str r0, [sp, 0x14] - ldr r2, [sp] - adds r0, r2, r0 - ldr r3, [sp, 0x44] - str r3, [sp, 0x18] - adds r0, r3 - str r0, [sp, 0x1C] - ldr r4, [sp, 0x14] - adds r0, r3, r4 - adds r0, r2 - adds r0, 0x30 - mov r10, r0 -_080E864A: - movs r5, 0 - str r5, [sp, 0xC] - movs r3, 0 - mov r6, r8 - lsls r6, 2 - str r6, [sp, 0x38] - ldr r1, [sp, 0x18] - ldr r2, [sp, 0x14] - adds r0, r1, r2 - ldr r4, [sp] - adds r5, r0, r4 - ldr r0, =0x03001168 - adds r0, r6, r0 - str r0, [sp, 0x50] -_080E8666: - lsls r0, r3, 4 - ldr r6, [sp, 0x1C] - adds r0, r6, r0 - str r3, [sp, 0x4C] - bl sub_80842DC - adds r4, r0, 0 - ldr r1, [sp, 0x50] - ldr r0, [r1] - add r0, r9 - adds r0, r7 - bl sub_80842DC - ldr r3, [sp, 0x4C] - cmp r4, r0 - bne _080E86A8 - ldr r2, [sp, 0xC] - adds r2, 0x1 - str r2, [sp, 0xC] - ldr r4, [sp, 0x50] - ldr r0, [r4] - mov r6, r9 - adds r1, r7, r6 - adds r1, r0, r1 - ldrh r0, [r5, 0x4] - ldrh r2, [r1, 0x4] - cmp r0, r2 - bcs _080E86A8 - adds r0, r5, 0 - ldm r1!, {r2,r4,r6} - stm r0!, {r2,r4,r6} - ldr r1, [r1] - str r1, [r0] -_080E86A8: - adds r5, 0x10 - adds r3, 0x1 - cmp r3, 0x2 - ble _080E8666 - ldr r3, [sp, 0xC] - cmp r3, 0 - bne _080E86CE - ldr r0, =0x03001168 - ldr r4, [sp, 0x38] - adds r0, r4, r0 - ldr r0, [r0] - mov r5, r9 - adds r2, r7, r5 - mov r1, r10 - adds r0, r2 - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldr r0, [r0] - str r0, [r1] -_080E86CE: - movs r4, 0x10 - add r10, r4 - movs r5, 0x1 - add r8, r5 - ldr r6, [sp, 0x24] - cmp r8, r6 - blt _080E864A -_080E86DC: - ldr r0, [sp, 0x44] - adds r0, 0x60 - str r0, [sp, 0x44] - ldr r1, [sp, 0x48] - adds r1, 0x30 - str r1, [sp, 0x48] - ldr r2, [sp, 0x8] - adds r2, 0x1 - str r2, [sp, 0x8] - cmp r2, 0x1 - bgt _080E86F4 - b _080E85DC -_080E86F4: - ldr r3, [sp, 0x28] - str r3, [sp, 0x4] - cmp r3, 0x8 - bgt _080E86FE - b _080E85BE -_080E86FE: - movs r4, 0 - str r4, [sp, 0x8] -_080E8702: - ldr r5, [sp, 0x8] - adds r5, 0x1 - str r5, [sp, 0x2C] - ldr r0, =0x03005d90 - ldr r1, [r0] - movs r0, 0x54 - ldr r6, [sp, 0x8] - muls r0, r6 - adds r3, r0, r1 - movs r0, 0xA8 - muls r0, r6 - ldr r1, [sp] - adds r2, r0, r1 - movs r4, 0x2 - mov r8, r4 -_080E8720: - movs r5, 0xD8 - lsls r5, 3 - adds r0, r2, r5 - ldr r6, =0x0000057c - adds r1, r3, r6 - ldm r1!, {r4-r6} - stm r0!, {r4-r6} - ldm r1!, {r4-r6} - stm r0!, {r4-r6} - ldr r1, [r1] - str r1, [r0] - adds r3, 0x1C - adds r2, 0x1C - movs r0, 0x1 - negs r0, r0 - add r8, r0 - mov r1, r8 - cmp r1, 0 - bge _080E8720 - movs r2, 0 - mov r8, r2 - ldr r3, [sp, 0x24] - cmp r8, r3 - blt _080E8752 - b _080E885A -_080E8752: - ldr r4, [sp, 0x8] - lsls r1, r4, 3 - movs r0, 0xA8 - adds r5, r4, 0 - muls r5, r0 - str r5, [sp, 0x20] - str r5, [sp, 0x3C] - subs r1, r4 - lsls r1, 2 - mov r10, r1 -_080E8766: - movs r6, 0 - str r6, [sp, 0xC] - mov r0, r8 - lsls r0, 2 - str r0, [sp, 0x38] - mov r1, r8 - adds r1, 0x1 - str r1, [sp, 0x30] - ldr r0, =0x03001168 - ldr r2, [sp, 0x38] - adds r2, r0 - mov r9, r2 - ldr r3, [sp] - movs r4, 0xD8 - lsls r4, 3 - adds r0, r3, r4 - ldr r5, [sp, 0x3C] - adds r7, r5, r0 - str r6, [sp, 0x40] - movs r3, 0x2 -_080E878E: - ldr r1, [sp, 0x20] - movs r2, 0xD8 - lsls r2, 3 - adds r0, r1, r2 - ldr r4, [sp] - adds r0, r4, r0 - ldr r6, [sp, 0x40] - adds r5, r0, r6 - adds r0, r5, 0 - str r3, [sp, 0x4C] - bl sub_80842DC - adds r4, r0, 0 - movs r6, 0x90 - lsls r6, 1 - add r6, r10 - mov r1, r9 - ldr r0, [r1] - adds r0, r6 - bl sub_80842DC - ldr r3, [sp, 0x4C] - cmp r4, r0 - bne _080E8808 - adds r0, r5, 0x4 - bl sub_80842DC - adds r4, r0, 0 - mov r2, r9 - ldr r0, [r2] - adds r0, r6 - adds r0, 0x4 - bl sub_80842DC - ldr r3, [sp, 0x4C] - cmp r4, r0 - bne _080E8808 - ldr r4, [sp, 0xC] - adds r4, 0x1 - str r4, [sp, 0xC] - mov r5, r9 - ldr r0, [r5] - mov r6, r10 - adds r2, r0, r6 - movs r0, 0x94 - lsls r0, 1 - adds r1, r2, r0 - ldrh r0, [r7, 0x8] - ldrh r1, [r1] - cmp r0, r1 - bcs _080E8808 - adds r0, r7, 0 - movs r4, 0x90 - lsls r4, 1 - adds r1, r2, r4 - ldm r1!, {r2,r5,r6} - stm r0!, {r2,r5,r6} - ldm r1!, {r4-r6} - stm r0!, {r4-r6} - ldr r1, [r1] - str r1, [r0] -_080E8808: - adds r7, 0x1C - ldr r0, [sp, 0x40] - adds r0, 0x1C - str r0, [sp, 0x40] - subs r3, 0x1 - cmp r3, 0 - bge _080E878E - ldr r1, [sp, 0xC] - cmp r1, 0 - bne _080E8850 - mov r0, r8 - adds r0, 0x3 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r2, [sp, 0x20] - adds r1, r2 - ldr r3, [sp] - adds r1, r3, r1 - ldr r0, =0x03001168 - ldr r4, [sp, 0x38] - adds r0, r4, r0 - ldr r0, [r0] - add r0, r10 - movs r5, 0xD8 - lsls r5, 3 - adds r1, r5 - movs r6, 0x90 - lsls r6, 1 - adds r0, r6 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2,r5,r6} - stm r1!, {r2,r5,r6} - ldr r0, [r0] - str r0, [r1] -_080E8850: - ldr r3, [sp, 0x30] - mov r8, r3 - ldr r4, [sp, 0x24] - cmp r8, r4 - blt _080E8766 -_080E885A: - ldr r5, [sp, 0x2C] - str r5, [sp, 0x8] - cmp r5, 0x1 - bgt _080E8864 - b _080E8702 -_080E8864: - add sp, 0x54 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E8578 - - thumb_func_start sub_80E8880 -sub_80E8880: @ 80E8880 - push {r4-r7,lr} - mov r12, r0 - adds r7, r1, 0 - movs r5, 0 -_080E8888: - movs r2, 0 - movs r4, 0x1 - negs r4, r4 - movs r1, 0 - adds r6, r5, 0x1 - adds r3, r7, 0 -_080E8894: - ldrh r0, [r3, 0x4] - cmp r0, r2 - ble _080E889E - adds r4, r1, 0 - adds r2, r0, 0 -_080E889E: - adds r3, 0x10 - adds r1, 0x1 - cmp r1, 0x5 - ble _080E8894 - cmp r4, 0 - blt _080E88C0 - lsls r1, r5, 4 - lsls r2, r4, 4 - adds r2, r7 - add r1, r12 - 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] -_080E88C0: - adds r5, r6, 0 - cmp r5, 0x2 - ble _080E8888 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80E8880 - - thumb_func_start sub_80E88CC -sub_80E88CC: @ 80E88CC - push {r4-r7,lr} - mov r12, r0 - adds r6, r1, 0 - movs r5, 0 -_080E88D4: - movs r3, 0 - movs r4, 0x1 - negs r4, r4 - movs r2, 0 - adds r7, r5, 0x1 - adds r1, r6, 0 -_080E88E0: - ldrh r0, [r1, 0x8] - cmp r0, r3 - ble _080E88EA - adds r4, r2, 0 - adds r3, r0, 0 -_080E88EA: - adds r1, 0x1C - adds r2, 0x1 - cmp r2, 0x5 - ble _080E88E0 - cmp r4, 0 - blt _080E8918 - lsls r1, r5, 3 - subs r1, r5 - lsls r1, 2 - lsls r2, r4, 3 - subs r2, r4 - lsls r2, 2 - adds r2, r6 - add r1, r12 - adds r0, r2, 0 - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldr r0, [r0] - str r0, [r1] - movs r0, 0 - strh r0, [r2, 0x8] -_080E8918: - adds r5, r7, 0 - cmp r5, 0x2 - ble _080E88D4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80E88CC - - thumb_func_start sub_80E8924 -sub_80E8924: @ 80E8924 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r9, r0 - movs r0, 0 - ldr r1, =0x03005d90 - mov r10, r1 -_080E8936: - lsls r1, r0, 1 - adds r2, r0, 0x1 - mov r8, r2 - adds r1, r0 - lsls r0, r1, 5 - movs r2, 0x87 - lsls r2, 2 - adds r7, r0, r2 - lsls r1, 6 - mov r0, r9 - adds r4, r0, r1 - movs r6, 0 - movs r5, 0x1 -_080E8950: - mov r1, r10 - ldr r0, [r1] - adds r0, r7 - adds r0, r6 - adds r1, r4, 0 - bl sub_80E8880 - adds r4, 0x60 - adds r6, 0x30 - subs r5, 0x1 - cmp r5, 0 - bge _080E8950 - mov r0, r8 - cmp r0, 0x8 - ble _080E8936 - movs r5, 0 - ldr r4, =0x03005d90 -_080E8972: - movs r0, 0x54 - adds r1, r5, 0 - muls r1, r0 - ldr r2, =0x0000057c - adds r1, r2 - ldr r0, [r4] - adds r0, r1 - movs r1, 0xA8 - muls r1, r5 - movs r2, 0xD8 - lsls r2, 3 - adds r1, r2 - add r1, r9 - bl sub_80E88CC - adds r5, 0x1 - cmp r5, 0x1 - ble _080E8972 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E8924 - - thumb_func_start sub_80E89AC -sub_80E89AC: @ 80E89AC - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r6, r0, 0 - mov r8, r1 - mov r9, r2 - bl sub_8009FCC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x81 - lsls r0, 4 - bl AllocZeroed - adds r5, r0, 0 - str r4, [sp] - adds r1, r6, 0 - mov r2, r8 - mov r3, r9 - bl sub_80E8578 - adds r0, r5, 0 - bl sub_80E8924 - adds r0, r5, 0 - bl Free - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80E89AC - - thumb_func_start sub_80E89F8 -sub_80E89F8: @ 80E89F8 - push {r4-r6,lr} - adds r6, r0, 0 - ldr r5, =0x02039f9c - ldr r4, =0x03005d8c - ldr r1, [r4] - movs r0, 0xC2 - lsls r0, 6 - adds r1, r0 - adds r0, r5, 0 - movs r2, 0x38 - bl memcpy - ldr r1, [r4] - ldr r0, =0x0000310c - adds r1, r0 - adds r0, r5, 0 - adds r0, 0x38 - movs r2, 0x38 - bl memcpy - ldr r0, [r4] - ldr r1, =0x00003030 - adds r0, r1 - adds r1, r5, 0 - bl sub_806FA9C - ldr r0, =0x03001148 - ldr r1, [r0] - adds r0, r6, 0 - movs r2, 0x78 - bl memcpy - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E89F8 - - thumb_func_start sub_80E8A54 -sub_80E8A54: @ 80E8A54 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r5, r0, 0 - movs r0, 0 - mov r9, r0 - ldr r0, [r5, 0x70] - cmp r9, r0 - bcs _080E8AAE - adds r4, r5, 0 - adds r4, 0x2C - movs r0, 0x24 - adds r0, r5 - mov r8, r0 - adds r7, r5, 0 - adds r7, 0x37 - adds r6, r5, 0 -_080E8A78: - ldrh r0, [r6, 0x20] - cmp r0, 0 - beq _080E8A9A - ldrb r1, [r4, 0xB] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x1 - beq _080E8A90 - mov r0, r8 - movs r1, 0xFC - bl sub_81DB4DC -_080E8A90: - ldrb r1, [r7] - lsrs r1, 4 - adds r0, r4, 0 - bl StopMusicWhileStringIsPrinted -_080E8A9A: - adds r4, 0x38 - movs r0, 0x38 - add r8, r0 - adds r7, 0x38 - adds r6, 0x38 - movs r0, 0x1 - add r9, r0 - ldr r0, [r5, 0x70] - cmp r9, r0 - bcc _080E8A78 -_080E8AAE: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80E8A54 - - thumb_func_start TaskDummy4 -TaskDummy4: @ 80E8ABC - bx lr - thumb_func_end TaskDummy4 - - thumb_func_start sub_80E8AC0 -sub_80E8AC0: @ 80E8AC0 - push {r4,r5,lr} - adds r5, r0, 0 - movs r4, 0 -_080E8AC6: - movs r0, 0x2C - muls r0, r4 - adds r0, 0x34 - adds r1, r5, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _080E8ADC - adds r0, r1, 0 - adds r0, 0x20 - bl StripExtendedControlCodes -_080E8ADC: - adds r4, 0x1 - cmp r4, 0x3 - ble _080E8AC6 - adds r0, r5, 0 - bl sub_8164F70 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80E8AC0 - - thumb_func_start sub_80E8AF0 -sub_80E8AF0: @ 80E8AF0 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r0, 0 - str r0, [sp] - ldr r2, =0x01000028 - mov r0, sp - adds r1, r4, 0 - bl CpuFastSet - movs r2, 0 - adds r4, 0x2 - movs r3, 0xFF -_080E8B0A: - adds r0, r4, r2 - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x6 - bls _080E8B0A - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E8AF0 - - thumb_func_start sub_80E8B28 -sub_80E8B28: @ 80E8B28 - push {r4,r5,lr} - movs r4, 0 - ldr r5, =0x03005d8c -_080E8B2E: - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 5 - ldr r0, =0x00001a9c - adds r1, r0 - ldr r0, [r5] - adds r0, r1 - bl sub_80E8AF0 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x13 - bls _080E8B2E - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E8B28 - - thumb_func_start sub_80E8B58 -sub_80E8B58: @ 80E8B58 - ldr r0, =0x0203a01c - ldr r1, =0x020375e0 - ldrh r1, [r1] - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_80E8B58 - - thumb_func_start sub_80E8B6C -sub_80E8B6C: @ 80E8B6C - push {r4,lr} - ldr r0, =0x020375f0 - movs r1, 0 - strh r1, [r0] - movs r3, 0 - adds r4, r0, 0 - b _080E8B86 - .pool -_080E8B80: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 -_080E8B86: - cmp r3, 0x13 - bhi _080E8BB0 - ldr r2, =0x0203a01c - ldr r0, =0x03005d8c - ldr r1, [r0] - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 5 - adds r1, r0 - ldr r0, =0x00001a9c - adds r1, r0 - ldrb r0, [r2] - ldrb r1, [r1] - cmp r0, r1 - bne _080E8B80 - movs r0, 0x1 - strh r0, [r4] - ldr r0, =0x00004054 - adds r1, r3, 0 - bl VarSet -_080E8BB0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E8B6C - - thumb_func_start sub_80E8BC8 -sub_80E8BC8: @ 80E8BC8 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00001a9c - adds r0, r1 - ldrb r1, [r0] - cmp r1, 0 - beq _080E8BEC - ldr r1, =0x020375f0 - movs r0, 0x1 - strh r0, [r1] - b _080E8BF0 - .pool -_080E8BEC: - ldr r0, =0x020375f0 - strh r1, [r0] -_080E8BF0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E8BC8 - - thumb_func_start sub_80E8BF8 -sub_80E8BF8: @ 80E8BF8 - 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 - adds r1, r0, 0 - ldr r2, =0x00000fff - adds r0, r2, 0 - ands r1, r0 - adds r0, r1, 0 - subs r0, 0x90 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _080E8C34 - movs r0, 0x1 - b _080E8C8E - .pool -_080E8C34: - adds r0, r1, 0 - subs r0, 0x92 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _080E8C44 - movs r0, 0x2 - b _080E8C8E -_080E8C44: - adds r0, r1, 0 - subs r0, 0x9A - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _080E8C54 - movs r0, 0x3 - b _080E8C8E -_080E8C54: - adds r0, r1, 0 - subs r0, 0x94 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _080E8C64 - movs r0, 0x4 - b _080E8C8E -_080E8C64: - adds r0, r1, 0 - subs r0, 0x96 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bls _080E8C78 - cmp r1, 0x9C - beq _080E8C78 - cmp r1, 0x9D - bne _080E8C7C -_080E8C78: - movs r0, 0x5 - b _080E8C8E -_080E8C7C: - adds r0, r1, 0 - subs r0, 0x98 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bls _080E8C8C - movs r0, 0 - b _080E8C8E -_080E8C8C: - movs r0, 0x6 -_080E8C8E: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80E8BF8 - - thumb_func_start sub_80E8C98 -sub_80E8C98: @ 80E8C98 - push {r4,lr} - ldr r4, =0x020375e6 - bl sub_80E8BF8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E8C98 - - thumb_func_start sub_80E8CB0 -sub_80E8CB0: @ 80E8CB0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - str r0, [sp] - str r1, [sp, 0x4] - lsls r2, 16 - lsrs r2, 16 - mov r10, r2 - ldr r0, =0x02037318 - ldr r0, [r0] - mov r8, r0 - movs r0, 0 - mov r12, r0 - mov r1, r8 - ldr r0, [r1, 0x4] - cmp r12, r0 - bge _080E8D3C - ldr r4, [r1] -_080E8CDA: - movs r2, 0 - mov r0, r12 - lsls r7, r0, 16 - cmp r2, r4 - bge _080E8D28 - asrs r0, r7, 16 - adds r6, r0, 0 - muls r6, r4 - mov r1, r8 - ldr r5, [r1, 0xC] - ldr r0, =0x000003ff - mov r9, r0 -_080E8CF2: - lsls r0, r2, 16 - asrs r3, r0, 16 - adds r0, r6, r3 - lsls r0, 1 - adds r0, r5 - ldrh r1, [r0] - mov r0, r9 - ands r0, r1 - cmp r0, r10 - bne _080E8D1C - ldr r1, [sp] - strh r2, [r1] - mov r0, r12 - ldr r2, [sp, 0x4] - strh r0, [r2] - b _080E8D3C - .pool -_080E8D1C: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - asrs r0, 16 - cmp r0, r4 - blt _080E8CF2 -_080E8D28: - movs r2, 0x80 - lsls r2, 9 - adds r1, r7, r2 - lsrs r0, r1, 16 - mov r12, r0 - asrs r1, 16 - mov r2, r8 - ldr r0, [r2, 0x4] - cmp r1, r0 - blt _080E8CDA -_080E8D3C: - 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 sub_80E8CB0 - - thumb_func_start sub_80E8D4C -sub_80E8D4C: @ 80E8D4C - push {r4-r7,lr} - mov r7, r8 - push {r7} - 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 MapGridGetMetatileIdAt - movs r5, 0 - mov r12, r4 - lsls r0, 16 - asrs r3, r0, 16 - ldr r1, =gUnknown_0858CFCC - mov r8, r1 - adds r7, r0, 0 - mov r4, sp - mov r6, r12 -_080E8D80: - ldr r0, =gUnknown_0858CFCC - lsls r1, r5, 2 - adds r2, r1, r0 - ldrh r0, [r2] - cmp r0, r3 - bne _080E8D9C - movs r3, 0 - ldrsh r0, [r4, r3] - movs r5, 0 - ldrsh r1, [r6, r5] - ldrh r3, [r2, 0x2] - b _080E8DC4 - .pool -_080E8D9C: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x6 - bls _080E8D80 - movs r5, 0 - mov r4, sp - mov r6, r12 -_080E8DAC: - lsls r0, r5, 2 - mov r1, r8 - adds r3, r0, r1 - ldrh r1, [r3, 0x2] - asrs r0, r7, 16 - cmp r1, r0 - bne _080E8DDE - movs r2, 0 - ldrsh r0, [r4, r2] - movs r5, 0 - ldrsh r1, [r6, r5] - ldrh r3, [r3] -_080E8DC4: - movs r5, 0xC0 - lsls r5, 4 - adds r2, r5, 0 - orrs r2, r3 - bl MapGridSetMetatileIdAt - movs r1, 0 - ldrsh r0, [r4, r1] - movs r2, 0 - ldrsh r1, [r6, r2] - bl CurrentMapDrawMetatileAt - b _080E8DE8 -_080E8DDE: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x6 - bls _080E8DAC -_080E8DE8: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80E8D4C - - thumb_func_start sub_80E8DF4 -sub_80E8DF4: @ 80E8DF4 - push {lr} - adds r2, r0, 0 - movs r1, 0 -_080E8DFA: - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _080E8E06 - adds r0, r1, 0 - b _080E8E12 -_080E8E06: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x6 - bls _080E8DFA - movs r0, 0x7 -_080E8E12: - pop {r1} - bx r1 - thumb_func_end sub_80E8DF4 - - thumb_func_start sub_80E8E18 -sub_80E8E18: @ 80E8E18 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r2, =0x03005d8c - ldr r0, [r2] - ldr r1, =0x0203a01c - ldrb r1, [r1] - ldr r3, =0x00001a9c - adds r0, r3 - strb r1, [r0] - movs r3, 0 - ldr r5, =0x00001aa5 - ldr r4, =0x03005d90 -_080E8E32: - ldr r1, [r2] - adds r1, r5 - adds r1, r3 - ldr r0, [r4] - adds r0, 0xA - adds r0, r3 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x3 - bls _080E8E32 - ldr r0, =0x00004054 - movs r1, 0 - bl VarSet - ldr r6, =0x03005d8c - ldr r4, [r6] - ldr r0, =0x00001a9e - adds r4, r0 - ldr r1, =0x03005d90 - mov r8, r1 - ldr r5, [r1] - adds r0, r5, 0 - bl sub_80E8DF4 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl CopyString_LimitN - ldr r3, [r6] - mov r1, r8 - ldr r0, [r1] - ldrb r0, [r0, 0x8] - ldr r1, =0x00001a9d - adds r3, r1 - movs r1, 0x1 - ands r1, r0 - lsls r1, 4 - ldrb r2, [r3] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - ldr r0, [r6] - ldr r3, =0x00001aa9 - adds r0, r3 - movs r1, 0x2 - strb r1, [r0] - ldr r0, =0x00004026 - ldr r1, =0x02037318 - ldrb r1, [r1, 0x14] - bl VarSet - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E8E18 - - thumb_func_start sub_80E8EE0 -sub_80E8EE0: @ 80E8EE0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r8, r0 - movs r5, 0 - b _080E8F8A -_080E8EEE: - mov r0, r8 - ldr r1, [r0, 0x10] - lsls r2, r5, 1 - adds r0, r2, r5 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x5] - adds r6, r1, 0 - adds r1, r5, 0x1 - mov r9, r1 - cmp r0, 0x8 - bne _080E8F82 - movs r4, 0 - ldr r7, =0x03005d8c -_080E8F0A: - ldr r1, [r7] - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 5 - adds r1, r0 - ldr r0, =0x00001a9c - adds r1, r0 - ldrb r1, [r1] - adds r0, r2, r5 - lsls r0, 2 - adds r3, r0, r6 - ldr r0, [r3, 0x8] - cmp r1, r0 - bne _080E8F78 - ldrh r5, [r3] - adds r5, 0x7 - ldrh r4, [r3, 0x2] - adds r4, 0x7 - lsls r5, 16 - asrs r0, r5, 16 - lsls r4, 16 - asrs r1, r4, 16 - bl MapGridGetMetatileIdAt - movs r3, 0 - lsls r0, 16 - asrs r1, r0, 16 - ldr r6, =gUnknown_0858CFCC -_080E8F42: - lsls r0, r3, 2 - adds r2, r0, r6 - ldrh r0, [r2] - cmp r0, r1 - bne _080E8F6C - ldrh r0, [r2, 0x2] - movs r1, 0xC0 - lsls r1, 4 - adds r2, r1, 0 - orrs r2, r0 - asrs r0, r5, 16 - asrs r1, r4, 16 - bl MapGridSetMetatileIdAt - b _080E8F82 - .pool -_080E8F6C: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x6 - bls _080E8F42 - b _080E8F82 -_080E8F78: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x13 - bls _080E8F0A -_080E8F82: - mov r1, r9 - lsls r0, r1, 16 - lsrs r5, r0, 16 - mov r0, r8 -_080E8F8A: - ldrb r0, [r0, 0x3] - cmp r5, r0 - bcc _080E8EEE - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80E8EE0 - - thumb_func_start sub_80E8F9C -sub_80E8F9C: @ 80E8F9C - push {lr} - ldr r0, =0x0203a01c - ldrb r0, [r0] - movs r1, 0xA - bl __udivsi3 - ldr r2, =gUnknown_0858CFE8 - lsls r0, 26 - asrs r0, 24 - adds r1, r0, r2 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - adds r0, 0x1 - adds r0, r2 - movs r2, 0 - ldrsb r2, [r0, r2] - movs r0, 0x19 - bl warp1_set_2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E8F9C - - thumb_func_start sub_80E8FD0 -sub_80E8FD0: @ 80E8FD0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r1 - movs r1, 0x8 - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _080E8FF4 - cmp r0, 0x1 - beq _080E900C - b _080E904A - .pool -_080E8FF4: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080E904A - movs r0, 0x1 - strh r0, [r2, 0x8] - b _080E904A - .pool -_080E900C: - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x03005d8c - ldr r2, [r1] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 5 - adds r2, r1 - ldr r0, =0x00001aac - adds r2, r0 - ldrb r0, [r2] - cmp r0, 0xFE - bhi _080E9030 - adds r0, 0x1 - strb r0, [r2] -_080E9030: - bl sub_80E8F9C - bl warp_in - ldr r0, =0x03005dac - ldr r1, =sub_80AF168 - str r1, [r0] - ldr r0, =c2_load_new_map - bl SetMainCallback2 - adds r0, r4, 0 - bl DestroyTask -_080E904A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E8FD0 - - thumb_func_start sub_80E9068 -sub_80E9068: @ 80E9068 - push {lr} - ldr r0, =sub_80E8FD0 - movs r1, 0 - bl CreateTask - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r0, =0x03005d8c - 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_80E9068 - - thumb_func_start sub_80E909C -sub_80E909C: @ 80E909C - push {lr} - ldr r0, =0x02037318 - ldrb r0, [r0, 0x17] - cmp r0, 0x9 - bne _080E90C0 - ldr r0, =0x00004097 - bl VarGet - lsls r0, 16 - cmp r0, 0 - bne _080E90C0 - movs r0, 0 - b _080E90C2 - .pool -_080E90C0: - movs r0, 0x1 -_080E90C2: - pop {r1} - bx r1 - thumb_func_end sub_80E909C - - thumb_func_start sub_80E90C8 -sub_80E90C8: @ 80E90C8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - movs r1, 0x2 - bl FieldObjectTurn - bl sub_80ABDFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E90F8 - bl script_env_2_enable_and_set_ctx_running - adds r0, r4, 0 - bl DestroyTask -_080E90F8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E90C8 - - thumb_func_start sub_80E9108 -sub_80E9108: @ 80E9108 - push {r4,lr} - sub sp, 0x4 - bl script_env_2_enable - bl HideMapNamePopUpWindow - mov r4, sp - adds r4, 0x2 - movs r2, 0x88 - lsls r2, 2 - mov r0, sp - adds r1, r4, 0 - bl sub_80E8CB0 - mov r1, sp - mov r0, sp - ldrh r0, [r0] - adds r0, 0x7 - strh r0, [r1] - ldrh r0, [r4] - adds r0, 0x7 - strh r0, [r4] - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - movs r2, 0xE2 - lsls r2, 4 - bl MapGridSetMetatileIdAt - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl CurrentMapDrawMetatileAt - bl pal_fill_black - ldr r0, =sub_80E90C8 - movs r1, 0 - bl CreateTask - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E9108 - - thumb_func_start sub_80E916C -sub_80E916C: @ 80E916C - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080E91D4 - ldr r0, =0x0203a01c - ldrb r0, [r0] - movs r1, 0xA - bl __udivsi3 - ldr r1, =0x03005d8c - ldr r1, [r1] - movs r5, 0x4 - ldrsb r5, [r1, r5] - ldrb r1, [r1, 0x5] - lsls r1, 24 - asrs r1, 24 - movs r2, 0x1 - negs r2, r2 - ldr r4, =gUnknown_0858CFE8 - lsls r0, 26 - asrs r0, 24 - adds r3, r0, 0x2 - adds r3, r4 - ldrb r3, [r3] - lsls r3, 24 - asrs r3, 24 - adds r0, 0x3 - adds r0, r4 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - adds r0, r5, 0 - bl warp1_set - bl warp_in - ldr r1, =0x03005dac - ldr r0, =sub_80E9108 - str r0, [r1] - ldr r0, =c2_load_new_map - bl SetMainCallback2 - adds r0, r6, 0 - bl DestroyTask -_080E91D4: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E916C - - thumb_func_start sub_80E91F8 -sub_80E91F8: @ 80E91F8 - push {lr} - ldr r0, =sub_80E916C - movs r1, 0 - bl CreateTask - movs r0, 0x1 - movs r1, 0 - bl fade_screen - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E91F8 - - thumb_func_start CurrentMapIsSecretBase -CurrentMapIsSecretBase: @ 80E9214 - push {lr} - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r0, 0x4 - ldrsb r0, [r1, r0] - cmp r0, 0x19 - bne _080E9230 - ldrb r0, [r1, 0x5] - cmp r0, 0x17 - bhi _080E9230 - movs r0, 0x1 - b _080E9232 - .pool -_080E9230: - movs r0, 0 -_080E9232: - pop {r1} - bx r1 - thumb_func_end CurrentMapIsSecretBase - - thumb_func_start sub_80E9238 -sub_80E9238: @ 80E9238 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - bl CurrentMapIsSecretBase - lsls r0, 24 - cmp r0, 0 - beq _080E9328 - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - lsrs r5, r0, 16 - ldr r1, =0x03005d8c - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 5 - ldr r2, =0x00001a9c - adds r0, r2 - ldr r1, [r1] - adds r1, r0 - adds r7, r1, 0 - adds r7, 0x12 - adds r6, r1, 0 - adds r6, 0x22 - movs r1, 0 - mov r0, sp - strh r1, [r0] - mov r4, sp -_080E927A: - ldrh r2, [r4] - adds r1, r7, r2 - ldrb r0, [r1] - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x77 - bhi _080E92AC - ldr r0, =gUnknown_085A5C08 - ldrb r3, [r1] - lsls r1, r3, 5 - adds r1, r0 - ldrb r0, [r1, 0x11] - cmp r0, 0x4 - beq _080E92AC - adds r0, r6, r2 - ldrb r2, [r0] - lsrs r0, r2, 4 - adds r0, 0x7 - movs r1, 0xF - ands r1, r2 - adds r1, 0x7 - adds r2, r3, 0 - bl sub_8127D38 -_080E92AC: - ldrh r0, [r4] - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - strh r0, [r4] - cmp r0, 0xF - bls _080E927A - cmp r5, 0 - beq _080E92F4 - mov r4, sp - adds r4, 0x2 - movs r2, 0x88 - lsls r2, 2 - mov r0, sp - adds r1, r4, 0 - bl sub_80E8CB0 - mov r0, sp - ldrh r0, [r0] - adds r0, 0x7 - ldrh r1, [r4] - adds r1, 0x7 - ldr r2, =0x00000e21 - bl MapGridSetMetatileIdAt - b _080E9328 - .pool -_080E92F4: - mov r0, r8 - cmp r0, 0x1 - bne _080E9328 - ldr r0, =0x00004089 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _080E9328 - mov r4, sp - adds r4, 0x2 - movs r2, 0x88 - lsls r2, 2 - mov r0, sp - adds r1, r4, 0 - bl sub_80E8CB0 - mov r0, sp - ldrh r0, [r0] - adds r0, 0x7 - ldrh r1, [r4] - adds r1, 0x7 - ldr r2, =0x00000e0a - bl MapGridSetMetatileIdAt -_080E9328: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E9238 - - thumb_func_start sub_80E933C -sub_80E933C: @ 80E933C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - bl CurrentMapIsSecretBase - lsls r0, 24 - cmp r0, 0 - bne _080E9374 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x0000271c - adds r1, r0, r1 - str r1, [sp, 0x4] - ldr r2, =0x00002728 - adds r2, r0, r2 - str r2, [sp, 0x8] - movs r3, 0xC - str r3, [sp, 0x10] - b _080E939C - .pool -_080E9374: - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - ldr r2, =0x03005d8c - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 5 - ldr r4, =0x00001a9c - adds r1, r4 - ldr r0, [r2] - adds r0, r1 - adds r1, r0, 0 - adds r1, 0x12 - str r1, [sp, 0x4] - adds r0, 0x22 - str r0, [sp, 0x8] - movs r2, 0x10 - str r2, [sp, 0x10] -_080E939C: - movs r6, 0 - b _080E955A - .pool -_080E93AC: - ldr r4, [sp, 0x4] - adds r0, r4, r6 - ldrb r1, [r0] - mov r10, r0 - adds r0, r6, 0x1 - str r0, [sp, 0x14] - cmp r1, 0 - bne _080E93BE - b _080E9554 -_080E93BE: - mov r1, r10 - ldrb r0, [r1] - lsls r0, 5 - ldr r2, =gUnknown_085A5C08 - adds r0, r2 - ldrb r1, [r0, 0x11] - ldrb r0, [r0, 0x13] - str r0, [sp, 0xC] - cmp r1, 0x4 - beq _080E93D4 - b _080E9554 -_080E93D4: - movs r5, 0 - ldr r0, =0x02037318 - ldr r3, [r0, 0x4] - ldrb r4, [r3] - mov r9, r0 - cmp r5, r4 - bcs _080E9412 - ldr r0, [r3, 0x4] - ldrh r2, [r0, 0x14] - ldr r1, =0x020375e0 - ldrh r0, [r1] - adds r0, 0xAE - adds r7, r1, 0 - cmp r2, r0 - beq _080E9412 - adds r2, r4, 0 -_080E93F4: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r2 - bcs _080E9412 - ldr r1, [r3, 0x4] - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x14] - ldrh r0, [r7] - adds r0, 0xAE - cmp r1, r0 - bne _080E93F4 -_080E9412: - mov r3, r9 - ldr r0, [r3, 0x4] - ldrb r0, [r0] - cmp r5, r0 - bne _080E941E - b _080E9554 -_080E941E: - ldr r4, =0x020375e4 - mov r8, r4 - ldr r0, [sp, 0x8] - adds r1, r0, r6 - ldrb r0, [r1] - lsrs r0, 4 - strh r0, [r4] - ldr r7, =0x020375e6 - ldrb r1, [r1] - movs r0, 0xF - ands r0, r1 - strh r0, [r7] - ldrh r0, [r4] - adds r0, 0x7 - ldrh r1, [r7] - adds r1, 0x7 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_8089350 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080E9462 - adds r0, r4, 0 - bl sub_8089364 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E9554 -_080E9462: - ldr r6, =0x020375f0 - mov r1, r9 - ldr r0, [r1, 0x4] - ldr r1, [r0, 0x4] - lsls r4, r5, 1 - adds r4, r5 - lsls r4, 3 - adds r1, r4, r1 - ldr r2, =0x00003f20 - adds r0, r2, 0 - ldrb r1, [r1, 0x1] - adds r0, r1 - strh r0, [r6] - ldrh r0, [r6] - mov r3, r10 - ldrb r1, [r3] - lsls r1, 5 - ldr r2, =gUnknown_085A5C24 - adds r1, r2 - ldr r1, [r1] - ldrh r1, [r1] - bl VarSet - mov r3, r9 - ldr r0, [r3, 0x4] - ldr r0, [r0, 0x4] - adds r4, r0 - ldrb r0, [r4] - strh r0, [r6] - ldr r0, =0x020375e0 - ldrh r0, [r0] - adds r0, 0xAE - lsls r0, 16 - lsrs r0, 16 - bl FlagReset - ldrb r0, [r6] - ldr r5, =0x03005d8c - ldr r2, [r5] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl show_sprite - ldrb r0, [r6] - ldr r2, [r5] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - mov r4, r8 - movs r3, 0 - ldrsh r4, [r4, r3] - mov r8, r4 - movs r4, 0 - ldrsh r7, [r7, r4] - str r7, [sp] - mov r3, r8 - bl sub_808EBA8 - ldrb r0, [r6] - ldr r2, [r5] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl sub_808F254 - bl CurrentMapIsSecretBase - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E954C - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080E954C - ldr r0, [sp, 0xC] - cmp r0, 0x6 - bne _080E9538 - ldrb r0, [r6] - ldr r2, [r5] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - movs r3, 0x6 - bl sub_808F28C - b _080E954C - .pool -_080E9538: - ldr r1, [sp, 0xC] - cmp r1, 0x7 - bne _080E954C - ldrb r0, [r6] - ldr r2, [r5] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - movs r3, 0x7 - bl sub_808F28C -_080E954C: - ldr r1, =0x020375e0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_080E9554: - ldr r2, [sp, 0x14] - lsls r0, r2, 24 - lsrs r6, r0, 24 -_080E955A: - ldr r3, [sp, 0x10] - cmp r6, r3 - bcs _080E9562 - b _080E93AC -_080E9562: - 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_80E933C - - thumb_func_start sub_80E9578 -sub_80E9578: @ 80E9578 - push {r4-r6,lr} - movs r5, 0 - ldr r1, =0x02037318 - ldr r0, [r1, 0x4] - ldrb r0, [r0] - cmp r5, r0 - bcs _080E95C4 - adds r6, r1, 0 -_080E9588: - ldr r0, [r6, 0x4] - ldr r1, [r0, 0x4] - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 3 - adds r1, r0, r1 - ldrh r4, [r1, 0x14] - adds r0, r4, 0 - subs r0, 0xAE - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xD - bhi _080E95B6 - ldrb r0, [r1] - ldr r1, =0x03005d8c - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl RemoveFieldObjectByLocalIdAndMap - adds r0, r4, 0 - bl FlagSet -_080E95B6: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r6, 0x4] - ldrb r0, [r0] - cmp r5, r0 - bcc _080E9588 -_080E95C4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E9578 - - thumb_func_start sub_80E95D4 -sub_80E95D4: @ 80E95D4 - push {r4,r5,lr} - ldr r5, =0x0000401f - ldr r4, =gUnknown_0858D060 - ldr r0, =0x00004054 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - bl sub_80EA20C - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r1, [r0] - adds r0, r5, 0 - bl VarSet - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E95D4 - - thumb_func_start sub_80E9608 -sub_80E9608: @ 80E9608 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r3, 0 - ldrb r0, [r4, 0x3] - cmp r3, r0 - bge _080E9660 - ldr r6, =0x0203a01c -_080E9618: - lsls r3, 16 - asrs r1, r3, 16 - ldr r2, [r4, 0x10] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r2, r0, r2 - ldrb r0, [r2, 0x5] - cmp r0, 0x8 - bne _080E9650 - movs r0, 0 - ldrsh r1, [r5, r0] - ldrh r0, [r2] - adds r0, 0x7 - cmp r1, r0 - bne _080E9650 - movs r0, 0x2 - ldrsh r1, [r5, r0] - ldrh r0, [r2, 0x2] - adds r0, 0x7 - cmp r1, r0 - bne _080E9650 - ldr r0, [r2, 0x8] - strb r0, [r6] - b _080E9660 - .pool -_080E9650: - movs r1, 0x80 - lsls r1, 9 - adds r0, r3, r1 - lsrs r3, r0, 16 - asrs r0, 16 - ldrb r1, [r4, 0x3] - cmp r0, r1 - blt _080E9618 -_080E9660: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80E9608 - - thumb_func_start sub_80E9668 -sub_80E9668: @ 80E9668 - push {lr} - bl sub_80E9608 - bl sub_80E8B6C - ldr r0, =gUnknown_08275BB7 - bl script_env_1_execute_new_script - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E9668 - - thumb_func_start sub_80E9680 -sub_80E9680: @ 80E9680 - push {lr} - bl sub_80E8B58 - bl sub_80E8B6C - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0x1 - beq _080E969C - movs r0, 0x1 - b _080E969E - .pool -_080E969C: - movs r0, 0 -_080E969E: - pop {r1} - bx r1 - thumb_func_end sub_80E9680 - - thumb_func_start sub_80E96A4 -sub_80E96A4: @ 80E96A4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080E96DC - cmp r0, 0x1 - bgt _080E96CC - cmp r0, 0 - beq _080E96D2 - b _080E9714 - .pool -_080E96CC: - cmp r0, 0x2 - beq _080E96F4 - b _080E9714 -_080E96D2: - bl script_env_2_enable - movs r0, 0x1 - strh r0, [r4, 0x8] - b _080E9714 -_080E96DC: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080E9714 - movs r0, 0x2 - strh r0, [r4, 0x8] - b _080E9714 - .pool -_080E96F4: - movs r0, 0x7E - bl copy_saved_warp2_bank_and_enter_x_to_warp1 - bl warp_in - ldr r0, =0x03005dac - ldr r1, =mapldr_default - str r1, [r0] - ldr r0, =c2_load_new_map - bl SetMainCallback2 - bl script_env_2_disable - adds r0, r5, 0 - bl DestroyTask -_080E9714: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E96A4 - - thumb_func_start sub_80E9728 -sub_80E9728: @ 80E9728 - push {lr} - ldr r0, =sub_80E96A4 - movs r1, 0 - bl CreateTask - movs r0, 0x1 - movs r1, 0 - bl fade_screen - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E9728 - - thumb_func_start sub_80E9744 -sub_80E9744: @ 80E9744 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00001a9c - adds r0, r1 - ldr r1, =0x0203a01c - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - beq _080E9770 - ldr r1, =0x020375f0 - movs r0, 0x1 - b _080E9774 - .pool -_080E9770: - ldr r1, =0x020375f0 - movs r0, 0 -_080E9774: - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E9744 - - thumb_func_start sub_80E9780 -sub_80E9780: @ 80E9780 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r6, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0x03005d8c - mov r8, r0 - lsls r5, r1, 2 - adds r5, r1 - lsls r5, 5 - ldr r4, [r0] - adds r4, r5, r4 - ldr r1, =0x00001a9e - adds r4, r1 - adds r0, r4, 0 - bl sub_80E8DF4 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r6, 0 - adds r1, r4, 0 - bl CopyString_LimitN - movs r1, 0xFF - strb r1, [r0] - mov r1, r8 - ldr r0, [r1] - adds r0, r5 - ldr r1, =0x00001aa9 - adds r0, r1 - ldrb r1, [r0] - adds r0, r6, 0 - bl StopMusicWhileStringIsPrinted - ldr r1, =gUnknown_085EA72F - adds r0, r6, 0 - bl AppendString - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80E9780 - - thumb_func_start GetSecretBaseMapName -GetSecretBaseMapName: @ 80E97EC - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x00004054 - bl VarGet - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_80E9780 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetSecretBaseMapName - - thumb_func_start sub_80E980C -sub_80E980C: @ 80E980C - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =0x00004054 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005d8c - mov r8, r1 - lsls r5, r0, 2 - adds r5, r0 - lsls r5, 5 - ldr r4, [r1] - adds r4, r5, r4 - ldr r0, =0x00001a9e - adds r4, r0 - ldr r6, =0x02021cc4 - adds r0, r4, 0 - bl sub_80E8DF4 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r6, 0 - adds r1, r4, 0 - bl CopyString_LimitN - movs r1, 0xFF - strb r1, [r0] - mov r1, r8 - ldr r0, [r1] - adds r0, r5 - ldr r1, =0x00001aa9 - adds r0, r1 - ldrb r1, [r0] - adds r0, r6, 0 - bl StopMusicWhileStringIsPrinted - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E980C - - thumb_func_start sub_80E9878 -sub_80E9878: @ 80E9878 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005d8c - ldr r2, [r1] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 5 - adds r2, r1 - ldr r0, =0x00001a9d - adds r2, r0 - ldrb r0, [r2] - lsrs r0, 6 - cmp r0, 0 - bne _080E98A4 - movs r0, 0 - b _080E98A6 - .pool -_080E98A4: - movs r0, 0x1 -_080E98A6: - pop {r1} - bx r1 - thumb_func_end sub_80E9878 - - thumb_func_start sub_80E98AC -sub_80E98AC: @ 80E98AC - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x1A - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x1B - bl pokemon_getattr - adds r4, r0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x1C - bl pokemon_getattr - adds r4, r0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x1D - bl pokemon_getattr - adds r4, r0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x1E - bl pokemon_getattr - adds r4, r0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x1F - bl pokemon_getattr - adds r4, r0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r4, 0 - movs r1, 0x6 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80E98AC - - thumb_func_start sub_80E9914 -sub_80E9914: @ 80E9914 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - movs r0, 0 - mov r10, r0 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r2, =0x00001ad0 - adds r2, r1, r2 - str r2, [sp] - ldr r3, =0x00001a9c - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _080E993A - b _080E9A60 -_080E993A: - movs r6, 0 - ldr r7, =0x00001ae8 - adds r7, r1, r7 - str r7, [sp, 0x14] - ldr r0, =0x00001b18 - adds r0, r1, r0 - str r0, [sp, 0xC] - ldr r2, =0x00001b24 - adds r2, r1, r2 - str r2, [sp, 0x10] - adds r3, 0x94 - adds r3, r1, r3 - str r3, [sp, 0x18] - ldr r7, =0x00001b36 - adds r7, r1, r7 - str r7, [sp, 0x1C] - mov r9, r6 -_080E995C: - movs r4, 0 - lsls r5, r6, 2 - lsls r3, r6, 1 - ldr r0, =0x020244ec - mov r8, r0 - adds r1, r6, 0x1 - str r1, [sp, 0x4] - adds r2, r5, 0 - ldr r1, [sp, 0x14] -_080E996E: - adds r0, r2, r4 - lsls r0, 1 - adds r0, r1, r0 - mov r7, r9 - strh r7, [r0] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x3 - bls _080E996E - ldr r1, [sp, 0xC] - adds r0, r1, r3 - mov r2, r9 - strh r2, [r0] - ldr r7, [sp, 0x10] - adds r0, r7, r3 - strh r2, [r0] - ldr r1, [sp, 0x18] - adds r0, r1, r6 - mov r2, r9 - strb r2, [r0] - ldr r3, [sp] - adds r0, r3, r5 - mov r7, r9 - str r7, [r0] - ldr r1, [sp, 0x1C] - adds r0, r1, r6 - strb r7, [r0] - movs r2, 0x64 - adds r5, r6, 0 - muls r5, r2 - mov r3, r8 - adds r4, r5, r3 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _080E9A54 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _080E9A54 - movs r4, 0 - mov r7, r10 - lsls r7, 2 - mov r8, r7 - mov r0, r10 - lsls r7, r0, 1 - adds r0, 0x1 - str r0, [sp, 0x8] - ldr r2, =0x020244ec -_080E99DA: - adds r1, r4, 0 - adds r1, 0xD - adds r0, r5, r2 - str r2, [sp, 0x20] - bl pokemon_getattr - mov r3, r8 - adds r1, r3, r4 - lsls r1, 1 - ldr r3, [sp, 0x14] - adds r1, r3, r1 - strh r0, [r1] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r2, [sp, 0x20] - cmp r4, 0x3 - bls _080E99DA - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - ldr r2, [sp, 0xC] - adds r1, r2, r7 - strh r0, [r1] - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr - ldr r3, [sp, 0x10] - adds r1, r3, r7 - strh r0, [r1] - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - ldr r1, [sp, 0x18] - add r1, r10 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - ldr r1, [sp] - add r1, r8 - str r0, [r1] - adds r0, r4, 0 - bl sub_80E98AC - ldr r1, [sp, 0x1C] - add r1, r10 - strb r0, [r1] - ldr r7, [sp, 0x8] - lsls r0, r7, 16 - lsrs r0, 16 - mov r10, r0 -_080E9A54: - ldr r1, [sp, 0x4] - lsls r0, r1, 16 - lsrs r6, r0, 16 - cmp r6, 0x5 - bhi _080E9A60 - b _080E995C -_080E9A60: - 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_80E9914 - - thumb_func_start sub_80E9A90 -sub_80E9A90: @ 80E9A90 - push {r4-r6,lr} - ldr r5, =0x03005d8c - ldr r0, [r5] - ldr r4, =0x00001aaa - adds r1, r0, r4 - ldrh r6, [r1] - ldr r1, =0x00001a9c - adds r0, r1 - bl sub_80E8AF0 - ldr r0, [r5] - adds r0, r4 - strh r6, [r0] - bl sub_80E9728 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E9A90 - - thumb_func_start sub_80E9AC0 -sub_80E9AC0: @ 80E9AC0 - push {lr} - movs r0, 0x14 - bl sav12_xor_increment - bl sub_80E9A90 - pop {r0} - bx r0 - thumb_func_end sub_80E9AC0 - - thumb_func_start sub_80E9AD0 -sub_80E9AD0: @ 80E9AD0 - push {r4-r7,lr} - ldr r0, =0x02037318 - ldr r4, [r0, 0x4] - movs r6, 0 - b _080E9B62 - .pool -_080E9AE0: - ldr r2, [r4, 0x10] - lsls r1, r6, 1 - adds r0, r1, r6 - lsls r0, 2 - adds r2, r0, r2 - ldrb r0, [r2, 0x5] - adds r7, r1, 0 - cmp r0, 0x8 - bne _080E9B5C - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00001a9c - adds r0, r1 - ldrb r1, [r0] - ldr r0, [r2, 0x8] - cmp r1, r0 - bne _080E9B5C - ldrh r0, [r2] - adds r0, 0x7 - ldrh r1, [r2, 0x2] - adds r1, 0x7 - bl MapGridGetMetatileIdAt - movs r1, 0 - ldr r5, =gUnknown_0858CFCC - lsls r0, 16 - asrs r2, r0, 16 -_080E9B16: - lsls r0, r1, 2 - adds r3, r0, r5 - ldrh r0, [r3, 0x2] - cmp r0, r2 - beq _080E9B3C - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x6 - bls _080E9B16 -_080E9B2A: - bl DrawWholeMapView - b _080E9B68 - .pool -_080E9B3C: - ldr r0, [r4, 0x10] - adds r1, r7, r6 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x7 - ldrh r1, [r1, 0x2] - adds r1, 0x7 - ldrh r3, [r3] - movs r4, 0xC0 - lsls r4, 4 - adds r2, r4, 0 - orrs r2, r3 - bl MapGridSetMetatileIdAt - b _080E9B2A -_080E9B5C: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 -_080E9B62: - ldrb r0, [r4, 0x3] - cmp r6, r0 - bcc _080E9AE0 -_080E9B68: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80E9AD0 - - thumb_func_start sub_80E9B70 -sub_80E9B70: @ 80E9B70 - push {r4-r6,lr} - bl sub_80E9AD0 - movs r0, 0x14 - bl sav12_xor_increment - ldr r5, =0x03005d8c - ldr r0, [r5] - ldr r4, =0x00001aaa - adds r1, r0, r4 - ldrh r6, [r1] - ldr r1, =0x00001a9c - adds r0, r1 - bl sub_80E8AF0 - ldr r0, [r5] - adds r0, r4 - strh r6, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E9B70 - - thumb_func_start sub_80E9BA8 -sub_80E9BA8: @ 80E9BA8 - push {r4,r5,lr} - movs r5, 0 - movs r4, 0x1 -_080E9BAE: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_80E9878 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E9BC4 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080E9BC4: - lsls r0, r4, 16 - movs r1, 0x80 - lsls r1, 9 - adds r0, r1 - lsrs r4, r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _080E9BAE - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80E9BA8 - - thumb_func_start sub_80E9BDC -sub_80E9BDC: @ 80E9BDC - push {lr} - ldr r0, =0x00004054 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - bl sub_80E9878 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1 - bne _080E9C04 - ldr r0, =0x020375f0 - strh r1, [r0] - b _080E9C22 - .pool -_080E9C04: - bl sub_80E9BA8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x9 - bls _080E9C1C - ldr r1, =0x020375f0 - movs r0, 0x2 - b _080E9C20 - .pool -_080E9C1C: - ldr r1, =0x020375f0 - movs r0, 0 -_080E9C20: - strh r0, [r1] -_080E9C22: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E9BDC - - thumb_func_start sub_80E9C2C -sub_80E9C2C: @ 80E9C2C - push {lr} - ldr r0, =0x00004054 - bl VarGet - ldr r1, =0x03005d8c - ldr r2, [r1] - lsls r0, 16 - lsrs r0, 16 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 5 - adds r2, r1 - ldr r0, =0x00001a9d - adds r2, r0 - ldrb r3, [r2] - lsrs r1, r3, 6 - movs r0, 0x1 - eors r1, r0 - lsls r1, 6 - movs r0, 0x3F - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x86 - lsls r0, 1 - bl FlagSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E9C2C - - thumb_func_start sub_80E9C74 -sub_80E9C74: @ 80E9C74 - push {lr} - ldr r0, =sub_8126AD8 - movs r1, 0 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E9C74 - - thumb_func_start sub_80E9C88 -sub_80E9C88: @ 80E9C88 - push {lr} - ldr r0, =sub_80E9C9C - movs r1, 0 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E9C88 - - thumb_func_start sub_80E9C9C -sub_80E9C9C: @ 80E9C9C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r7, r0, 3 - ldr r0, =0x03005e08 - mov r8, r0 - adds r5, r7, r0 - bl script_env_2_enable - bl sub_80E9BA8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - cmp r0, 0 - beq _080E9D10 - movs r0, 0 - strh r0, [r5, 0x2] - strh r0, [r5, 0x4] - movs r0, 0 - movs r1, 0 - bl sub_8197434 - ldr r4, =0x0203a020 - movs r0, 0xDC - lsls r0, 1 - bl AllocZeroed - str r0, [r4] - ldr r0, =gUnknown_0858D06C - bl AddWindow - strh r0, [r5, 0xC] - adds r0, r6, 0 - bl game_continue - adds r0, r6, 0 - bl sub_80E9E00 - mov r0, r8 - subs r0, 0x8 - adds r0, r7, r0 - ldr r1, =sub_80E9E90 - str r1, [r0] - b _080E9D1A - .pool -_080E9D10: - ldr r1, =gUnknown_085EA785 - ldr r2, =task_pc_turn_off - adds r0, r6, 0 - bl DisplayItemMessageOnField -_080E9D1A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E9C9C - - thumb_func_start game_continue -game_continue: @ 80E9D2C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r7, r1, r0 - movs r6, 0 - movs r5, 0x1 - ldr r0, =0x0203a020 - mov r8, r0 -_080E9D48: - adds r0, r5, 0 - bl sub_80E9878 - lsls r0, 24 - cmp r0, 0 - beq _080E9D7C - lsls r4, r6, 5 - adds r4, 0x58 - mov r1, r8 - ldr r0, [r1] - adds r0, r4 - adds r1, r5, 0 - bl sub_80E9780 - mov r3, r8 - ldr r0, [r3] - lsls r2, r6, 3 - adds r1, r0, r2 - adds r4, r0, r4 - str r4, [r1] - adds r0, 0x4 - adds r0, r2 - str r5, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_080E9D7C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x13 - bls _080E9D48 - ldr r4, =0x0203a020 - ldr r1, [r4] - lsls r3, r6, 3 - adds r2, r1, r3 - ldr r0, =gUnknown_085E8CF0 - str r0, [r2] - adds r1, 0x4 - adds r1, r3 - movs r0, 0x2 - negs r0, r0 - str r0, [r1] - adds r2, r6, 0x1 - strh r2, [r7] - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, 0x7 - bgt _080E9DB8 - strh r2, [r7, 0x6] - b _080E9DBC - .pool -_080E9DB8: - movs r0, 0x8 - strh r0, [r7, 0x6] -_080E9DBC: - ldr r2, =0x03006310 - adds r1, r2, 0 - ldr r0, =gUnknown_0858D07C - ldm r0!, {r3,r5,r6} - stm r1!, {r3,r5,r6} - ldm r0!, {r3,r5,r6} - stm r1!, {r3,r5,r6} - ldrh r0, [r7, 0xC] - strb r0, [r2, 0x10] - ldrh r0, [r7] - strh r0, [r2, 0xC] - ldr r0, [r4] - str r0, [r2] - ldrh r0, [r7, 0x6] - strh r0, [r2, 0xE] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end game_continue - - thumb_func_start sub_80E9DEC -sub_80E9DEC: @ 80E9DEC - push {lr} - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x1 - beq _080E9DFC - movs r0, 0x5 - bl audio_play -_080E9DFC: - pop {r0} - bx r0 - thumb_func_end sub_80E9DEC - - thumb_func_start sub_80E9E00 -sub_80E9E00: @ 80E9E00 - 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, =0x03005e08 - adds r4, r0 - ldrb r0, [r4, 0xC] - movs r1, 0 - bl SetStandardWindowBorderStyle - ldr r0, =0x03006310 - ldrh r1, [r4, 0x4] - ldrh r2, [r4, 0x2] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xA] - adds r0, r5, 0 - bl sub_80E9E44 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E9E00 - - thumb_func_start sub_80E9E44 -sub_80E9E44: @ 80E9E44 - push {r4,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e08 - adds r4, r0 - movs r1, 0 - ldrsh r0, [r4, r1] - movs r2, 0x6 - ldrsh r1, [r4, r2] - subs r0, r1 - str r0, [sp] - ldr r0, =0x000013f8 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - adds r0, r4, 0x4 - str r0, [sp, 0xC] - movs r0, 0x2 - movs r1, 0xBC - movs r2, 0xC - movs r3, 0x94 - bl AddScrollIndicatorArrowPairParametrized - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x10] - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E9E44 - - thumb_func_start sub_80E9E90 -sub_80E9E90: @ 80E9E90 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldrb r0, [r4, 0xA] - bl ListMenuHandleInput - adds r5, r0, 0 - ldrb r0, [r4, 0xA] - adds r1, r4, 0x4 - adds r2, r4, 0x2 - bl get_coro_args_x18_x1A - movs r0, 0x2 - negs r0, r0 - cmp r5, r0 - beq _080E9EC8 - adds r0, 0x1 - cmp r5, r0 - bne _080E9F0C - b _080E9F1A - .pool -_080E9EC8: - movs r0, 0x5 - bl audio_play - ldrb r0, [r4, 0xA] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - ldrb r0, [r4, 0x10] - bl RemoveScrollIndicatorArrowPair - ldrb r0, [r4, 0xC] - movs r1, 0 - bl sub_819746C - ldrb r0, [r4, 0xC] - bl ClearWindowTilemap - ldrb r0, [r4, 0xC] - bl RemoveWindow - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =0x0203a020 - ldr r0, [r0] - bl Free - adds r0, r6, 0 - bl task_pc_turn_off - b _080E9F1A - .pool -_080E9F0C: - movs r0, 0x5 - bl audio_play - strh r5, [r4, 0x8] - adds r0, r6, 0 - bl sub_80E9F20 -_080E9F1A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80E9E90 - - thumb_func_start sub_80E9F20 -sub_80E9F20: @ 80E9F20 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r6, =0x03005e08 - adds r5, r4, r6 - ldrb r0, [r5, 0x10] - bl RemoveScrollIndicatorArrowPair - ldr r0, =gUnknown_0858D06C - ldr r1, [r0, 0xC] - ldr r0, [r0, 0x8] - str r0, [sp] - str r1, [sp, 0x4] - ldr r0, =gUnknown_0858D048 - mov r8, r0 - movs r1, 0x2 - bl GetMaxWidthInMenuTable - lsls r0, 24 - ldr r2, =0x00ffffff - ldr r1, [sp] - ands r1, r2 - orrs r1, r0 - str r1, [sp] - mov r0, sp - bl AddWindow - strh r0, [r5, 0xE] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl SetStandardWindowBorderStyle - ldrb r0, [r5, 0xE] - movs r1, 0x2 - mov r2, r8 - bl PrintMenuTable - ldrb r0, [r5, 0xE] - movs r1, 0x2 - movs r2, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - subs r6, 0x8 - adds r4, r6 - ldr r0, =sub_80E9FB0 - str r0, [r4] - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E9F20 - - thumb_func_start sub_80E9FB0 -sub_80E9FB0: @ 80E9FB0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - bl ProcessMenuInputNoWrapAround - lsls r0, 24 - asrs r4, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _080E9FF2 - adds r0, 0x1 - cmp r4, r0 - bne _080E9FDC - movs r0, 0x5 - bl audio_play - adds r0, r5, 0 - bl sub_80EA18C - b _080E9FF2 -_080E9FDC: - movs r0, 0x5 - bl audio_play - ldr r0, =gUnknown_0858D048 - lsls r1, r4, 3 - adds r0, 0x4 - adds r1, r0 - ldr r1, [r1] - adds r0, r6, 0 - bl _call_via_r1 -_080E9FF2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E9FB0 - - thumb_func_start sub_80E9FFC -sub_80E9FFC: @ 80E9FFC - 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, =0x03005e08 - adds r4, r0 - ldrb r0, [r4, 0xC] - movs r1, 0 - bl sub_819746C - ldrb r0, [r4, 0xE] - movs r1, 0 - bl sub_819746C - ldrb r0, [r4, 0xC] - bl ClearWindowTilemap - ldrb r0, [r4, 0xE] - bl ClearWindowTilemap - ldrb r0, [r4, 0xE] - bl RemoveWindow - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =0x02021cc4 - ldrb r1, [r4, 0x8] - bl sub_80E9780 - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EA737 - adds r0, r4, 0 - bl ExpandStringRefs - ldr r2, =sub_80EA06C - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E9FFC - - thumb_func_start sub_80EA06C -sub_80EA06C: @ 80EA06C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8197930 - ldr r1, =gUnknown_0858D058 - adds r0, r4, 0 - bl sub_8121F68 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EA06C - - thumb_func_start sub_80EA08C -sub_80EA08C: @ 80EA08C - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, r4, 2 - adds r5, r4 - lsls r5, 3 - ldr r0, =0x03005e08 - mov r8, r0 - adds r6, r5, r0 - movs r0, 0 - movs r1, 0 - bl sub_8197434 - ldrb r0, [r6, 0xA] - adds r1, r6, 0x4 - mov r9, r1 - adds r1, r6, 0x2 - mov r10, r1 - mov r1, r9 - mov r2, r10 - bl sub_81AE6C8 - ldr r0, =0x03005d8c - ldr r2, [r0] - movs r0, 0x8 - ldrsh r1, [r6, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 5 - adds r2, r0 - ldr r1, =0x00001a9d - adds r2, r1 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - bl game_continue - ldrb r2, [r6, 0x6] - ldrb r3, [r6] - mov r0, r9 - mov r1, r10 - bl sub_812225C - adds r0, r4, 0 - bl sub_80E9E00 - movs r0, 0x8 - negs r0, r0 - add r8, r0 - add r5, r8 - ldr r0, =sub_80E9E90 - str r0, [r5] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EA08C - - thumb_func_start sub_80EA120 -sub_80EA120: @ 80EA120 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_085EA762 - ldr r2, =sub_80EA08C - bl DisplayItemMessageOnField - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EA120 - - thumb_func_start sub_80EA13C -sub_80EA13C: @ 80EA13C - 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, =0x03005e08 - mov r8, r0 - adds r6, r4, r0 - movs r0, 0 - movs r1, 0 - bl sub_8197434 - ldrb r0, [r6, 0xA] - adds r1, r6, 0x4 - adds r6, 0x2 - adds r2, r6, 0 - bl sub_81AE6C8 - adds r0, r5, 0 - bl sub_80E9E00 - movs r0, 0x8 - negs r0, r0 - add r8, r0 - add r4, r8 - ldr r0, =sub_80E9E90 - str r0, [r4] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EA13C - - thumb_func_start sub_80EA18C -sub_80EA18C: @ 80EA18C - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r6, =0x03005e08 - adds r5, r4, r6 - bl sub_80E9E44 - ldrb r0, [r5, 0xE] - movs r1, 0 - bl sub_819746C - ldrb r0, [r5, 0xE] - bl ClearWindowTilemap - ldrb r0, [r5, 0xE] - bl RemoveWindow - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - subs r6, 0x8 - adds r4, r6 - ldr r0, =sub_80E9E90 - str r0, [r4] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EA18C - - thumb_func_start task_pc_turn_off -task_pc_turn_off: @ 80EA1D0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - bne _080EA1F4 - ldr r0, =gUnknown_0823B4E8 - bl script_env_1_execute_new_script - b _080EA1FA - .pool -_080EA1F4: - ldr r0, =gUnknown_0823B5E9 - bl script_env_1_execute_new_script -_080EA1FA: - adds r0, r4, 0 - bl DestroyTask - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_pc_turn_off - - thumb_func_start sub_80EA20C -sub_80EA20C: @ 80EA20C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005d8c - ldr r4, [r1] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 5 - adds r4, r1 - ldr r1, =0x00001aa5 - adds r0, r4, r1 - ldrb r0, [r0] - movs r1, 0x5 - bl __umodsi3 - ldr r1, =0x00001a9d - adds r4, r1 - ldrb r2, [r4] - lsls r2, 27 - lsrs r2, 31 - lsls r1, r2, 2 - adds r1, r2 - adds r0, r1 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80EA20C - - thumb_func_start sub_80EA250 -sub_80EA250: @ 80EA250 - push {lr} - ldr r0, =0x00004054 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - bl sub_80EA20C - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0 - bne _080EA278 - ldr r0, =gUnknown_08274966 - b _080EA2DA - .pool -_080EA278: - cmp r0, 0x1 - bne _080EA284 - ldr r0, =gUnknown_08274D13 - b _080EA2DA - .pool -_080EA284: - cmp r0, 0x2 - bne _080EA290 - ldr r0, =gUnknown_08274FFE - b _080EA2DA - .pool -_080EA290: - cmp r0, 0x3 - bne _080EA29C - ldr r0, =gUnknown_08275367 - b _080EA2DA - .pool -_080EA29C: - cmp r0, 0x4 - bne _080EA2A8 - ldr r0, =gUnknown_082756C7 - b _080EA2DA - .pool -_080EA2A8: - cmp r0, 0x5 - bne _080EA2B4 - ldr r0, =gUnknown_08274B24 - b _080EA2DA - .pool -_080EA2B4: - cmp r0, 0x6 - bne _080EA2C0 - ldr r0, =gUnknown_08274E75 - b _080EA2DA - .pool -_080EA2C0: - cmp r0, 0x7 - bne _080EA2CC - ldr r0, =gUnknown_082751E1 - b _080EA2DA - .pool -_080EA2CC: - cmp r1, 0x8 - beq _080EA2D8 - ldr r0, =gUnknown_082758CC - b _080EA2DA - .pool -_080EA2D8: - ldr r0, =gUnknown_082754F6 -_080EA2DA: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80EA250 - - thumb_func_start sub_80EA2E4 -sub_80EA2E4: @ 80EA2E4 - push {lr} - movs r0, 0x1 - bl sub_813BADC - ldr r1, =0x02038bca - movs r2, 0x80 - lsls r2, 3 - adds r0, r2, 0 - strh r0, [r1] - ldr r1, =0x02022fec - ldr r0, =0x08000008 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EA2E4 - - thumb_func_start sub_80EA30C -sub_80EA30C: @ 80EA30C - push {lr} - ldr r0, =0x00004054 - bl VarGet - ldr r1, =0x03005d8c - ldr r3, [r1] - lsls r0, 16 - lsrs r0, 16 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 5 - adds r3, r1 - ldr r0, =0x020375f0 - ldrb r0, [r0] - ldr r1, =0x00001a9d - adds r3, r1 - movs r1, 0x1 - ands r1, r0 - lsls r1, 5 - ldrb r2, [r3] - movs r0, 0x21 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EA30C - - thumb_func_start sub_80EA354 -sub_80EA354: @ 80EA354 - push {r4-r7,lr} - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x00000922 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _080EA39A - movs r3, 0 - ldr r7, =0x03005d8c - ldr r4, =0x00001a9d - movs r6, 0x21 - negs r6, r6 -_080EA376: - ldr r1, [r7] - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 5 - adds r1, r0 - adds r1, r4 - ldrb r2, [r1] - adds r0, r6, 0 - ands r0, r2 - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x13 - bls _080EA376 - ldr r0, =0x00000922 - bl FlagSet -_080EA39A: - ldr r4, =0x020375e0 - lsls r0, r5, 24 - lsrs r0, 24 - bl sub_80EA20C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - ldr r2, =0x020375f0 - ldr r0, =0x03005d8c - ldr r1, [r0] - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 5 - adds r1, r0 - ldr r0, =0x00001a9d - adds r1, r0 - ldrb r0, [r1] - lsls r0, 26 - lsrs r0, 31 - strh r0, [r2] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EA354 - - thumb_func_start sub_80EA3E4 -sub_80EA3E4: @ 80EA3E4 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r5, r1, r0 - movs r1, 0x2 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _080EA448 - cmp r0, 0x1 - bgt _080EA40C - cmp r0, 0 - beq _080EA414 - b _080EA820 - .pool -_080EA40C: - cmp r0, 0x2 - bne _080EA412 - b _080EA810 -_080EA412: - b _080EA820 -_080EA414: - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _080EA434 - ldr r1, =0x0203a01d - movs r0, 0x1 - strb r0, [r1] - b _080EA438 - .pool -_080EA434: - ldr r0, =0x0203a01d - strb r1, [r0] -_080EA438: - adds r0, r5, 0x4 - adds r1, r5, 0x6 - bl PlayerGetDestCoords - b _080EA81C - .pool -_080EA448: - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - ldrh r2, [r0] - movs r3, 0 - ldrsh r1, [r0, r3] - movs r3, 0x4 - ldrsh r0, [r5, r3] - adds r6, r4, 0 - cmp r1, r0 - bne _080EA474 - movs r0, 0 - ldrsh r1, [r6, r0] - movs r3, 0x6 - ldrsh r0, [r5, r3] - cmp r1, r0 - bne _080EA474 - b _080EA820 -_080EA474: - strh r2, [r5, 0x4] - ldrh r0, [r6] - strh r0, [r5, 0x6] - ldr r4, =0x000040ec - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r6, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r5, r0, 24 - mov r0, sp - movs r3, 0 - ldrsh r0, [r0, r3] - movs r2, 0 - ldrsh r1, [r6, r2] - bl MapGridGetMetatileIdAt - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x8D - lsls r0, 2 - cmp r4, r0 - beq _080EA4C2 - adds r0, 0x8 - cmp r4, r0 - bne _080EA4E8 -_080EA4C2: - ldr r0, =0x0203a01d - ldrb r0, [r0] - cmp r0, 0x1 - beq _080EA4CC - b _080EA820 -_080EA4CC: - ldr r4, =0x000040ef - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r0, 0x20 - b _080EA7FA - .pool -_080EA4E8: - ldr r3, =0xfffffd48 - adds r0, r4, r3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bls _080EA51A - movs r0, 0xB0 - lsls r0, 2 - cmp r4, r0 - beq _080EA51A - adds r0, 0x1 - cmp r4, r0 - beq _080EA51A - adds r0, 0x1 - cmp r4, r0 - beq _080EA51A - adds r0, 0x6 - cmp r4, r0 - beq _080EA51A - adds r0, 0x1 - cmp r4, r0 - beq _080EA51A - adds r0, 0x1 - cmp r4, r0 - bne _080EA540 -_080EA51A: - ldr r0, =0x0203a01d - ldrb r0, [r0] - cmp r0, 0x1 - beq _080EA524 - b _080EA820 -_080EA524: - ldr r4, =0x000040ee - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r0, 0x1 - b _080EA7FA - .pool -_080EA540: - ldr r0, =0x00000239 - cmp r4, r0 - beq _080EA558 - adds r0, 0x8 - cmp r4, r0 - beq _080EA558 - adds r0, 0x10 - cmp r4, r0 - beq _080EA558 - adds r0, 0x8 - cmp r4, r0 - bne _080EA57C -_080EA558: - ldr r0, =0x0203a01d - ldrb r0, [r0] - cmp r0, 0x1 - beq _080EA562 - b _080EA820 -_080EA562: - ldr r4, =0x000040ee - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r0, 0x4 - b _080EA7FA - .pool -_080EA57C: - cmp r5, 0x34 - bne _080EA586 - ldr r0, =0x0000026d - cmp r4, r0 - beq _080EA59E -_080EA586: - cmp r5, 0x35 - bne _080EA5CC - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r6, r2] - bl MapGridGetMetatileIdAt - ldr r1, =0x0000026a - cmp r0, r1 - bne _080EA5CC -_080EA59E: - ldr r0, =0x0203a01d - ldrb r0, [r0] - cmp r0, 0x1 - beq _080EA5A8 - b _080EA820 -_080EA5A8: - ldr r4, =0x000040ef - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r3, 0x80 - lsls r3, 2 - adds r0, r3, 0 - b _080EA7FA - .pool -_080EA5CC: - cmp r5, 0xC1 - bne _080EA618 - ldr r0, =0x0000023d - cmp r4, r0 - bne _080EA618 - ldr r0, =0x0203a01d - ldrb r0, [r0] - cmp r0, 0x1 - beq _080EA5E0 - b _080EA820 -_080EA5E0: - ldr r4, =0x000040ef - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 5 - adds r0, r2, 0 - eors r1, r0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r3, 0x80 - lsls r3, 6 - adds r0, r3, 0 - b _080EA7FA - .pool -_080EA618: - cmp r5, 0x47 - bne _080EA668 - ldr r0, =0x0000023e - cmp r4, r0 - bne _080EA668 - ldr r0, =0x0203a01d - ldrb r0, [r0] - cmp r0, 0x1 - beq _080EA62C - b _080EA820 -_080EA62C: - ldr r4, =0x000040ef - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 5 - adds r0, r2, 0 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r3, 0x80 - lsls r3, 6 - adds r0, r3, 0 - eors r1, r0 - b _080EA7FC - .pool -_080EA668: - adds r0, r5, 0 - bl sub_80893C8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080EA698 - ldr r0, =0x0203a01d - ldrb r0, [r0] - cmp r0, 0x1 - beq _080EA680 - b _080EA820 -_080EA680: - ldr r4, =0x000040ef - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r0, 0x80 - b _080EA7FA - .pool -_080EA698: - adds r0, r5, 0 - bl sub_808938C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080EA72C - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r6, r2] - bl MapGridGetMetatileIdAt - lsls r0, 16 - asrs r0, 16 - mov r1, sp - movs r3, 0 - ldrsh r1, [r1, r3] - movs r3, 0 - ldrsh r2, [r6, r3] - bl sub_80FA5E4 - ldr r0, =0x0203a01d - ldrb r0, [r0] - cmp r0, 0x1 - beq _080EA6D0 - b _080EA820 -_080EA6D0: - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r6, r2] - bl MapGridGetMetatileIdAt - adds r1, r0, 0 - movs r0, 0xCE - lsls r0, 2 - cmp r1, r0 - beq _080EA70C - cmp r1, r0 - bgt _080EA6FC - movs r0, 0x8A - lsls r0, 2 - cmp r1, r0 - beq _080EA714 - b _080EA820 - .pool -_080EA6FC: - movs r0, 0xCF - lsls r0, 2 - cmp r1, r0 - beq _080EA70C - adds r0, 0x4 - cmp r1, r0 - beq _080EA70C - b _080EA820 -_080EA70C: - ldr r4, =0x000040ee - b _080EA7F0 - .pool -_080EA714: - ldr r4, =0x000040ee - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r3, 0x80 - lsls r3, 1 - adds r0, r3, 0 - b _080EA7FA - .pool -_080EA72C: - adds r0, r5, 0 - bl sub_80893A0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080EA778 - ldr r0, =0x0203a01d - ldrb r0, [r0] - cmp r0, 0x1 - bne _080EA75E - ldr r4, =0x000040ef - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 3 - adds r0, r2, 0 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet -_080EA75E: - mov r0, sp - movs r3, 0 - ldrsh r0, [r0, r3] - movs r2, 0 - ldrsh r1, [r6, r2] - bl sub_80FA794 - b _080EA820 - .pool -_080EA778: - adds r0, r5, 0 - bl sub_80893B4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080EA7A8 - ldr r0, =0x0203a01d - ldrb r0, [r0] - cmp r0, 0x1 - bne _080EA820 - ldr r4, =0x000040ee - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r3, 0x80 - lsls r3, 8 - adds r0, r3, 0 - b _080EA7FA - .pool -_080EA7A8: - adds r0, r5, 0 - bl MetatileBehavior_0xBB - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080EA7D8 - ldr r0, =0x0203a01d - ldrb r0, [r0] - cmp r0, 0x1 - bne _080EA820 - ldr r4, =0x000040ef - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 7 - adds r0, r2, 0 - b _080EA7FA - .pool -_080EA7D8: - adds r0, r5, 0 - bl MetatileBehavior_0xBC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080EA820 - ldr r0, =0x0203a01d - ldrb r0, [r0] - cmp r0, 0x1 - bne _080EA820 - ldr r4, =0x000040ef -_080EA7F0: - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r0, 0x2 -_080EA7FA: - orrs r1, r0 -_080EA7FC: - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet - b _080EA820 - .pool -_080EA810: - ldrb r0, [r5, 0x8] - bl FieldEffectActiveListContains - lsls r0, 24 - cmp r0, 0 - bne _080EA820 -_080EA81C: - movs r0, 0x1 - strh r0, [r5, 0x2] -_080EA820: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80EA3E4 - - thumb_func_start sub_80EA828 -sub_80EA828: @ 80EA828 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r2, 0 - mov r8, r3 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r6, =0x03005d8c - ldr r0, [r6] - lsls r2, r5, 2 - adds r2, r5 - lsls r4, r2, 5 - adds r0, r4 - ldr r2, =0x00001a9c - mov r9, r2 - add r0, r9 - movs r2, 0xA0 - bl memcpy - ldr r2, [r6] - adds r2, r4 - ldr r0, =0x00001a9d - adds r2, r0 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - subs r0, r7, 0x1 - cmp r0, 0x1 - bhi _080EA876 - ldr r0, [r6] - adds r0, r4 - ldr r1, =0x00001aa9 - adds r0, r1 - movs r1, 0x2 - strb r1, [r0] -_080EA876: - cmp r7, 0x3 - bne _080EA8B8 - mov r2, r8 - cmp r2, 0x1 - bne _080EA8B8 - mov r1, r9 - adds r0, r4, r1 - ldr r1, [r6] - adds r1, r0 - adds r2, r1, 0x2 - movs r3, 0 - ldrb r0, [r1, 0x2] - cmp r0, 0xFF - beq _080EA8A0 -_080EA892: - adds r3, 0x1 - cmp r3, 0x6 - bgt _080EA8A0 - adds r0, r2, r3 - ldrb r0, [r0] - cmp r0, 0xFF - bne _080EA892 -_080EA8A0: - cmp r3, 0x5 - ble _080EA8B8 - ldr r0, =0x03005d8c - ldr r1, [r0] - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 5 - adds r1, r0 - ldr r2, =0x00001aa9 - adds r1, r2 - movs r0, 0x2 - strb r0, [r1] -_080EA8B8: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EA828 - - thumb_func_start sub_80EA8D4 -sub_80EA8D4: @ 80EA8D4 - push {r4,lr} - movs r2, 0 - adds r4, r0, 0 - adds r4, 0x9 - adds r3, r1, 0 - adds r3, 0x9 -_080EA8E0: - adds r0, r4, r2 - adds r1, r3, r2 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - beq _080EA8F0 - movs r0, 0 - b _080EA8FC -_080EA8F0: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _080EA8E0 - movs r0, 0x1 -_080EA8FC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80EA8D4 - - thumb_func_start sub_80EA904 -sub_80EA904: @ 80EA904 - push {r4-r6,lr} - adds r6, r0, 0 - adds r5, r1, 0 - movs r3, 0 - ldrb r0, [r6, 0x2] - cmp r0, 0xFF - bne _080EA918 - ldrb r0, [r5, 0x2] - cmp r0, 0xFF - beq _080EA946 -_080EA918: - adds r2, r6, 0x2 - adds r0, r2, r3 - adds r4, r5, 0x2 - adds r1, r4, r3 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - beq _080EA92C - movs r0, 0 - b _080EA948 -_080EA92C: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x6 - bhi _080EA946 - adds r0, r2, r3 - ldrb r0, [r0] - cmp r0, 0xFF - bne _080EA918 - adds r0, r4, r3 - ldrb r0, [r0] - cmp r0, 0xFF - bne _080EA918 -_080EA946: - movs r0, 0x1 -_080EA948: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80EA904 - - thumb_func_start sub_80EA950 -sub_80EA950: @ 80EA950 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrb r2, [r4, 0x1] - movs r0, 0x10 - adds r1, r0, 0 - ands r1, r2 - ldrb r2, [r5, 0x1] - ands r0, r2 - cmp r1, r0 - bne _080EA986 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80EA8D4 - lsls r0, 24 - cmp r0, 0 - beq _080EA986 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80EA904 - lsls r0, 24 - cmp r0, 0 - beq _080EA986 - movs r0, 0x1 - b _080EA988 -_080EA986: - movs r0, 0 -_080EA988: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80EA950 - - thumb_func_start sub_80EA990 -sub_80EA990: @ 80EA990 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - movs r1, 0 - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r4, =0x00001a9c -_080EA99E: - lsls r0, r1, 16 - asrs r1, r0, 16 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 5 - adds r0, r2, r0 - adds r0, r4 - ldrb r0, [r0] - cmp r0, r3 - bne _080EA9C0 - adds r0, r1, 0 - b _080EA9D0 - .pool -_080EA9C0: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _080EA99E - movs r0, 0x1 - negs r0, r0 -_080EA9D0: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80EA990 - - thumb_func_start sub_80EA9D8 -sub_80EA9D8: @ 80EA9D8 - push {r4,lr} - movs r2, 0x1 - ldr r0, =0x03005d8c - ldr r3, [r0] - ldr r4, =0x00001a9c -_080EA9E2: - lsls r0, r2, 16 - asrs r1, r0, 16 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 5 - adds r0, r3, r0 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _080EAA04 - lsls r0, r2, 24 - lsrs r0, 24 - b _080EAA12 - .pool -_080EAA04: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _080EA9E2 - movs r0, 0 -_080EAA12: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80EA9D8 - - thumb_func_start sub_80EAA18 -sub_80EAA18: @ 80EAA18 - push {r4,lr} - movs r3, 0x1 - ldr r0, =0x03005d8c - ldr r4, [r0] -_080EAA20: - lsls r2, r3, 16 - asrs r1, r2, 16 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 5 - adds r0, r4, r0 - ldr r1, =0x00001a9d - adds r0, r1 - ldrb r1, [r0] - lsrs r0, r1, 6 - cmp r0, 0 - bne _080EAA4C - lsls r0, r1, 28 - cmp r0, 0 - bne _080EAA4C - lsls r0, r3, 24 - lsrs r0, 24 - b _080EAA5C - .pool -_080EAA4C: - movs r1, 0x80 - lsls r1, 9 - adds r0, r2, r1 - lsrs r3, r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _080EAA20 - movs r0, 0 -_080EAA5C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80EAA18 - - thumb_func_start sub_80EAA64 -sub_80EAA64: @ 80EAA64 - push {r4-r7,lr} - adds r5, r0, 0 - adds r6, r1, 0 - adds r7, r2, 0 - ldrb r0, [r5] - cmp r0, 0 - beq _080EAAEC - ldrb r0, [r5] - bl sub_80EA990 - lsls r0, 16 - lsrs r4, r0, 16 - asrs r2, r0, 16 - cmp r2, 0 - beq _080EAAEC - movs r0, 0x1 - negs r0, r0 - cmp r2, r0 - beq _080EAAC4 - ldr r0, =0x03005d8c - ldr r1, [r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 5 - adds r1, r0 - ldr r0, =0x00001a9d - adds r1, r0 - ldrb r1, [r1] - lsls r0, r1, 28 - lsrs r0, 28 - cmp r0, 0x1 - beq _080EAAEC - lsrs r0, r1, 6 - cmp r0, 0x2 - bne _080EAAB4 - ldrb r1, [r5, 0x1] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x1 - bne _080EAAEC -_080EAAB4: - lsls r4, 24 - lsrs r4, 24 - b _080EAADC - .pool -_080EAAC4: - bl sub_80EA9D8 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _080EAADC - bl sub_80EAA18 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _080EAAEC -_080EAADC: - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - adds r3, r7, 0 - bl sub_80EA828 - adds r0, r4, 0 - b _080EAAEE -_080EAAEC: - movs r0, 0 -_080EAAEE: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80EAA64 - - thumb_func_start sub_80EAAF4 -sub_80EAAF4: @ 80EAAF4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xA0 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00001a9c - adds r7, r0, r1 - movs r2, 0x1 -_080EAB08: - adds r1, r2, 0x1 - lsls r0, r1, 24 - lsrs r5, r0, 24 - mov r9, r1 - cmp r5, 0x13 - bhi _080EAB84 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 5 - adds r6, r0, r7 - movs r0, 0xC0 - mov r8, r0 -_080EAB20: - ldrb r0, [r6, 0x1] - mov r3, r8 - ands r3, r0 - cmp r3, 0 - bne _080EAB3E - lsls r2, r5, 2 - adds r0, r2, r5 - lsls r0, 5 - adds r0, r7 - ldrb r1, [r0, 0x1] - mov r0, r8 - ands r0, r1 - adds r4, r2, 0 - cmp r0, 0x40 - beq _080EAB56 -_080EAB3E: - cmp r3, 0x80 - bne _080EAB7A - lsls r2, r5, 2 - adds r0, r2, r5 - lsls r0, 5 - adds r0, r7 - ldrb r1, [r0, 0x1] - mov r0, r8 - ands r0, r1 - adds r4, r2, 0 - cmp r0, 0x80 - beq _080EAB7A -_080EAB56: - mov r0, sp - adds r1, r6, 0 - movs r2, 0xA0 - bl memcpy - adds r4, r5 - lsls r4, 5 - adds r4, r7 - adds r0, r6, 0 - adds r1, r4, 0 - movs r2, 0xA0 - bl memcpy - adds r0, r4, 0 - mov r1, sp - movs r2, 0xA0 - bl memcpy -_080EAB7A: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x13 - bls _080EAB20 -_080EAB84: - mov r1, r9 - lsls r0, r1, 24 - lsrs r2, r0, 24 - cmp r2, 0x12 - bls _080EAB08 - add sp, 0xA0 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EAAF4 - - thumb_func_start sub_80EABA4 -sub_80EABA4: @ 80EABA4 - push {r4-r6,lr} - adds r5, r0, 0 - lsls r1, 24 - lsrs r6, r1, 24 - movs r4, 0x1 -_080EABAE: - ldr r0, [r5] - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 5 - adds r3, r1, r0 - ldrb r0, [r3, 0x1] - lsrs r0, 6 - cmp r0, r6 - bne _080EABCA - ldr r1, [r5, 0x4] - ldr r2, [r5, 0x8] - adds r0, r3, 0 - bl sub_80EAA64 -_080EABCA: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x13 - bls _080EABAE - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80EABA4 - - thumb_func_start sub_80EABDC -sub_80EABDC: @ 80EABDC - push {r4-r6,lr} - adds r5, r0, 0 - ldrb r0, [r5] - cmp r0, 0 - beq _080EABF8 - ldrb r0, [r5, 0x1] - lsls r0, 27 - ldr r1, =0x03005d90 - ldr r3, [r1] - lsrs r0, 31 - adds r6, r1, 0 - ldrb r1, [r3, 0x8] - cmp r0, r1 - beq _080EAC00 -_080EABF8: - movs r0, 0 - b _080EAC56 - .pool -_080EAC00: - movs r2, 0 - adds r4, r5, 0 - adds r4, 0x9 - adds r3, 0xA -_080EAC08: - adds r0, r4, r2 - adds r1, r3, r2 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bne _080EABF8 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _080EAC08 - movs r2, 0 - ldrb r0, [r5, 0x2] - cmp r0, 0xFF - bne _080EAC2A - ldr r0, [r6] - b _080EAC4E -_080EAC2A: - adds r3, r5, 0x2 - adds r0, r3, r2 - ldr r4, [r6] - adds r1, r4, r2 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bne _080EABF8 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x6 - bhi _080EAC54 - adds r0, r3, r2 - ldrb r0, [r0] - cmp r0, 0xFF - bne _080EAC2A - adds r0, r4, r2 -_080EAC4E: - ldrb r0, [r0] - cmp r0, 0xFF - bne _080EAC2A -_080EAC54: - movs r0, 0x1 -_080EAC56: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80EABDC - - thumb_func_start sub_80EAC5C -sub_80EAC5C: @ 80EAC5C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r10, r0 - mov r9, r1 - mov r8, r2 - movs r5, 0 - movs r6, 0 -_080EAC70: - movs r0, 0x1 - ands r0, r5 - cmp r0, 0 - bne _080EAC9A - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 5 - mov r1, r10 - adds r4, r1, r0 - adds r0, r4, 0 - bl sub_80EABDC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080EAC9A - adds r0, r4, 0 - bl sub_80E8AF0 - movs r0, 0x1 - orrs r5, r0 -_080EAC9A: - movs r7, 0x2 - movs r0, 0x2 - ands r0, r5 - cmp r0, 0 - bne _080EACC8 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 5 - mov r1, r9 - adds r4, r1, r0 - adds r0, r4, 0 - bl sub_80EABDC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080EACC8 - adds r0, r4, 0 - bl sub_80E8AF0 - orrs r5, r7 - lsls r0, r5, 24 - lsrs r5, r0, 24 -_080EACC8: - movs r7, 0x4 - movs r0, 0x4 - ands r0, r5 - cmp r0, 0 - bne _080EACF6 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 5 - mov r1, r8 - adds r4, r1, r0 - adds r0, r4, 0 - bl sub_80EABDC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080EACF6 - adds r0, r4, 0 - bl sub_80E8AF0 - orrs r5, r7 - lsls r0, r5, 24 - lsrs r5, r0, 24 -_080EACF6: - cmp r5, 0x7 - beq _080EAD04 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x13 - bls _080EAC70 -_080EAD04: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80EAC5C - - thumb_func_start sub_80EAD14 -sub_80EAD14: @ 80EAD14 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - mov r8, r1 - lsls r2, 24 - lsrs r7, r2, 24 - movs r5, 0 -_080EAD24: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 5 - mov r1, r8 - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0 - beq _080EAD7E - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_80EA950 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080EAD7E - cmp r7, 0 - bne _080EAD50 - adds r0, r4, 0 - bl sub_80E8AF0 - b _080EAD88 -_080EAD50: - ldrh r0, [r6, 0xE] - ldrh r3, [r4, 0xE] - cmp r0, r3 - bls _080EAD60 - adds r0, r4, 0 - bl sub_80E8AF0 - b _080EAD88 -_080EAD60: - ldrb r0, [r6, 0x1] - lsls r0, 28 - lsrs r0, 28 - ldrb r1, [r4, 0x1] - movs r3, 0x10 - negs r3, r3 - adds r2, r3, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0x1] - adds r0, r6, 0 - bl sub_80E8AF0 - movs r0, 0x1 - b _080EAD8A -_080EAD7E: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x13 - bls _080EAD24 -_080EAD88: - movs r0, 0 -_080EAD8A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80EAD14 - - thumb_func_start sub_80EAD94 -sub_80EAD94: @ 80EAD94 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r9, r0 - adds r7, r1, 0 - mov r8, r2 - adds r6, r3, 0 - movs r5, 0x1 -_080EADA6: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 5 - mov r1, r9 - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0 - beq _080EADF8 - ldrb r1, [r4, 0x1] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0x40 - bne _080EADCE - movs r2, 0x10 - negs r2, r2 - adds r0, r2, 0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r4, 0x1] -_080EADCE: - adds r0, r4, 0 - adds r1, r7, 0 - adds r2, r5, 0 - bl sub_80EAD14 - lsls r0, 24 - cmp r0, 0 - bne _080EADF8 - adds r0, r4, 0 - mov r1, r8 - adds r2, r5, 0 - bl sub_80EAD14 - lsls r0, 24 - cmp r0, 0 - bne _080EADF8 - adds r0, r4, 0 - adds r1, r6, 0 - adds r2, r5, 0 - bl sub_80EAD14 -_080EADF8: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x13 - bls _080EADA6 - movs r5, 0 -_080EAE04: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 5 - adds r4, r0, r7 - ldrb r0, [r4] - cmp r0, 0 - beq _080EAE38 - ldrb r0, [r4, 0x1] - movs r2, 0x21 - negs r2, r2 - adds r1, r2, 0 - ands r0, r1 - strb r0, [r4, 0x1] - adds r0, r4, 0 - mov r1, r8 - adds r2, r5, 0 - bl sub_80EAD14 - lsls r0, 24 - cmp r0, 0 - bne _080EAE38 - adds r0, r4, 0 - adds r1, r6, 0 - adds r2, r5, 0 - bl sub_80EAD14 -_080EAE38: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x13 - bls _080EAE04 - movs r5, 0 - movs r0, 0x21 - negs r0, r0 - adds r7, r0, 0 -_080EAE4A: - lsls r0, r5, 2 - adds r0, r5 - lsls r4, r0, 5 - mov r2, r8 - adds r1, r4, r2 - ldrb r0, [r1] - cmp r0, 0 - beq _080EAE6A - ldrb r0, [r1, 0x1] - ands r0, r7 - strb r0, [r1, 0x1] - adds r0, r1, 0 - adds r1, r6, 0 - adds r2, r5, 0 - bl sub_80EAD14 -_080EAE6A: - adds r1, r4, r6 - ldrb r0, [r1] - cmp r0, 0 - beq _080EAE78 - ldrb r0, [r1, 0x1] - ands r0, r7 - strb r0, [r1, 0x1] -_080EAE78: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x13 - bls _080EAE4A - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80EAD94 - - thumb_func_start sub_80EAE90 -sub_80EAE90: @ 80EAE90 - push {r4,lr} - adds r4, r0, 0 - adds r3, r1, 0 - ldrb r1, [r4, 0x1] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x1 - bne _080EAEAE - adds r0, r4, 0 - adds r1, r3, 0 - bl sub_80EAA64 - adds r0, r4, 0 - bl sub_80E8AF0 -_080EAEAE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80EAE90 - - thumb_func_start sub_80EAEB4 -sub_80EAEB4: @ 80EAEB4 - push {r4-r6,lr} - adds r5, r0, 0 - movs r6, 0 -_080EAEBA: - lsls r4, r6, 2 - adds r4, r6 - lsls r4, 5 - ldr r0, [r5] - adds r0, r4 - ldr r1, [r5, 0x4] - ldr r2, [r5, 0x8] - bl sub_80EAE90 - ldr r0, [r5, 0xC] - adds r0, r4 - ldr r1, [r5, 0x10] - ldr r2, [r5, 0x14] - bl sub_80EAE90 - ldr r0, [r5, 0x18] - adds r0, r4 - ldr r1, [r5, 0x1C] - ldr r2, [r5, 0x20] - bl sub_80EAE90 - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x13 - bls _080EAEBA - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80EAEB4 - - thumb_func_start sub_80EAEF4 -sub_80EAEF4: @ 80EAEF4 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r0, [r4] - ldr r1, [r4, 0xC] - ldr r2, [r4, 0x18] - bl sub_80EAC5C - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00001a9c - adds r0, r1 - ldr r1, [r4] - ldr r2, [r4, 0xC] - ldr r3, [r4, 0x18] - bl sub_80EAD94 - adds r0, r4, 0 - bl sub_80EAEB4 - ldr r0, [r4] - ldr r1, [r4, 0x4] - ldr r2, [r4, 0x8] - bl sub_80EAA64 - ldr r0, [r4, 0xC] - ldr r1, [r4, 0x10] - ldr r2, [r4, 0x14] - bl sub_80EAA64 - ldr r0, [r4, 0x18] - ldr r1, [r4, 0x1C] - ldr r2, [r4, 0x20] - bl sub_80EAA64 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80EABA4 - adds r6, r4, 0 - adds r6, 0xC - adds r0, r6, 0 - movs r1, 0x1 - bl sub_80EABA4 - adds r5, r4, 0 - adds r5, 0x18 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80EABA4 - adds r0, r4, 0 - movs r1, 0 - bl sub_80EABA4 - adds r0, r6, 0 - movs r1, 0 - bl sub_80EABA4 - adds r0, r5, 0 - movs r1, 0 - bl sub_80EABA4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EAEF4 - - thumb_func_start sub_80EAF80 -sub_80EAF80: @ 80EAF80 - push {r4-r7,lr} - sub sp, 0x24 - adds r6, r0, 0 - adds r5, r1, 0 - lsls r2, 24 - lsrs r7, r2, 24 - movs r0, 0x60 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _080EAF9A - b _080EB16A -_080EAF9A: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _080EAFAC - cmp r0, 0x3 - beq _080EAFC8 - b _080EAFD6 -_080EAFAC: - lsls r4, r5, 1 - adds r0, r6, r4 - movs r1, 0 - adds r2, r5, 0 - bl memset - adds r4, r5 - adds r4, r6, r4 - adds r0, r4, 0 - movs r1, 0 - adds r2, r5, 0 - bl memset - b _080EAFD6 -_080EAFC8: - lsls r0, r5, 1 - adds r0, r5 - adds r0, r6, r0 - movs r1, 0 - adds r2, r5, 0 - bl memset -_080EAFD6: - cmp r7, 0x1 - beq _080EB030 - cmp r7, 0x1 - bgt _080EAFE4 - cmp r7, 0 - beq _080EAFEE - b _080EB0D4 -_080EAFE4: - cmp r7, 0x2 - beq _080EB074 - cmp r7, 0x3 - beq _080EB0A8 - b _080EB0D4 -_080EAFEE: - adds r0, r6, r5 - str r0, [sp] - ldr r4, =0x020229e8 - movs r3, 0xFF - ldrb r0, [r4, 0x1C] - str r0, [sp, 0x4] - ldrh r0, [r4, 0x36] - str r0, [sp, 0x8] - lsls r1, r5, 1 - adds r0, r6, r1 - str r0, [sp, 0xC] - ldrh r2, [r4, 0x38] - adds r0, r3, 0 - ands r0, r2 - str r0, [sp, 0x10] - adds r0, r4, 0 - adds r0, 0x52 - ldrh r0, [r0] - str r0, [sp, 0x14] - adds r1, r5 - adds r1, r6, r1 - str r1, [sp, 0x18] - adds r0, r4, 0 - adds r0, 0x54 - ldrh r0, [r0] - ands r3, r0 - str r3, [sp, 0x1C] - adds r0, r4, 0 - adds r0, 0x6E - ldrh r0, [r0] - b _080EB0D2 - .pool -_080EB030: - lsls r2, r5, 1 - adds r0, r6, r2 - str r0, [sp] - ldr r4, =0x020229e8 - ldrh r3, [r4, 0x38] - movs r1, 0xFF - adds r0, r1, 0 - ands r0, r3 - str r0, [sp, 0x4] - adds r0, r4, 0 - adds r0, 0x52 - ldrh r0, [r0] - str r0, [sp, 0x8] - adds r2, r5 - adds r2, r6, r2 - str r2, [sp, 0xC] - adds r0, r4, 0 - adds r0, 0x54 - ldrh r2, [r0] - adds r0, r1, 0 - ands r0, r2 - str r0, [sp, 0x10] - adds r0, r4, 0 - adds r0, 0x6E - ldrh r0, [r0] - str r0, [sp, 0x14] - str r6, [sp, 0x18] - ldrh r0, [r4] - ands r1, r0 - str r1, [sp, 0x1C] - ldrh r0, [r4, 0x1A] - b _080EB0D2 - .pool -_080EB074: - lsls r0, r5, 1 - adds r0, r5 - adds r0, r6, r0 - str r0, [sp] - ldr r1, =0x020229e8 - adds r0, r1, 0 - adds r0, 0x54 - ldrb r0, [r0] - str r0, [sp, 0x4] - adds r0, r1, 0 - adds r0, 0x6E - ldrh r0, [r0] - str r0, [sp, 0x8] - str r6, [sp, 0xC] - ldrb r0, [r1] - str r0, [sp, 0x10] - ldrh r0, [r1, 0x1A] - str r0, [sp, 0x14] - adds r0, r6, r5 - str r0, [sp, 0x18] - ldrb r0, [r1, 0x1C] - str r0, [sp, 0x1C] - ldrh r0, [r1, 0x36] - b _080EB0D2 - .pool -_080EB0A8: - str r6, [sp] - ldr r1, =0x020229e8 - ldrb r0, [r1] - str r0, [sp, 0x4] - ldrh r0, [r1, 0x1A] - str r0, [sp, 0x8] - adds r0, r6, r5 - str r0, [sp, 0xC] - movs r2, 0xFF - ldrb r0, [r1, 0x1C] - str r0, [sp, 0x10] - ldrh r0, [r1, 0x36] - str r0, [sp, 0x14] - lsls r0, r5, 1 - adds r0, r6, r0 - str r0, [sp, 0x18] - ldrh r0, [r1, 0x38] - ands r2, r0 - str r2, [sp, 0x1C] - adds r1, 0x52 - ldrh r0, [r1] -_080EB0D2: - str r0, [sp, 0x20] -_080EB0D4: - mov r0, sp - bl sub_80EAEF4 - movs r3, 0x1 - ldr r6, =0x03005d8c - movs r7, 0x10 - negs r7, r7 -_080EB0E2: - ldr r0, [r6] - lsls r1, r3, 2 - adds r1, r3 - lsls r4, r1, 5 - adds r0, r4 - ldr r5, =0x00001a9d - adds r2, r0, r5 - ldrb r1, [r2] - lsls r0, r1, 28 - lsrs r0, 28 - cmp r0, 0x1 - bne _080EB112 - movs r0, 0x3F - ands r0, r1 - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - ldr r1, [r6] - adds r1, r4 - adds r1, r5 - ldrb r2, [r1] - adds r0, r7, 0 - ands r0, r2 - strb r0, [r1] -_080EB112: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x13 - bls _080EB0E2 - bl sub_80EAAF4 - movs r3, 0x1 - ldr r7, =0x03005d8c - adds r6, r7, 0 - adds r4, r5, 0 - movs r5, 0x3F -_080EB12A: - ldr r0, [r6] - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 5 - adds r0, r1 - adds r2, r0, r4 - ldrb r1, [r2] - lsrs r0, r1, 6 - cmp r0, 0x2 - bne _080EB144 - adds r0, r5, 0 - ands r0, r1 - strb r0, [r2] -_080EB144: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x13 - bls _080EB12A - ldr r1, [r7] - ldr r2, =0x00001a9c - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080EB16A - ldr r0, =0x00001aaa - adds r2, r1, r0 - ldrh r1, [r2] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _080EB16A - adds r0, r1, 0x1 - strh r0, [r2] -_080EB16A: - add sp, 0x24 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EAF80 - - thumb_func_start sub_80EB18C -sub_80EB18C: @ 80EB18C - push {r4,r5,lr} - movs r5, 0 - adds r4, r0, 0 -_080EB192: - ldrb r0, [r4, 0xD] - cmp r0, 0x1 - bne _080EB19E - adds r0, r4, 0 - bl sub_80E8AF0 -_080EB19E: - adds r4, 0xA0 - adds r5, 0x1 - cmp r5, 0x13 - bls _080EB192 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80EB18C - - thumb_func_start sub_80EB1AC -sub_80EB1AC: @ 80EB1AC - push {lr} - ldr r0, =0x000040ec - movs r1, 0 - bl VarSet - ldr r0, =0x000040ed - movs r1, 0 - bl VarSet - ldr r0, =0x000040ee - movs r1, 0 - bl VarSet - ldr r0, =0x000040ef - movs r1, 0 - bl VarSet - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080EB1FC - ldr r0, =0x000040f0 - movs r1, 0x1 - bl VarSet - b _080EB204 - .pool -_080EB1FC: - ldr r0, =0x000040f0 - movs r1, 0 - bl VarSet -_080EB204: - ldr r1, =0x0203a01d - movs r0, 0 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EB1AC - - thumb_func_start sub_80EB218 -sub_80EB218: @ 80EB218 - push {r4-r6,lr} - ldr r5, =0x000040f0 - adds r0, r5, 0 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080EB272 - ldr r6, =0x0203a01d - ldrb r0, [r6] - cmp r0, 0x1 - bne _080EB272 - bl CurrentMapIsSecretBase - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _080EB272 - adds r0, r5, 0 - movs r1, 0 - bl VarSet - strb r4, [r6] - bl sub_80EEA70 - ldr r0, =0x000040ec - movs r1, 0 - bl VarSet - ldr r0, =0x000040ed - movs r1, 0 - bl VarSet - ldr r0, =0x000040ee - movs r1, 0 - bl VarSet - ldr r0, =0x000040ef - movs r1, 0 - bl VarSet - adds r0, r5, 0 - movs r1, 0 - bl VarSet -_080EB272: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EB218 - - thumb_func_start sub_80EB290 -sub_80EB290: @ 80EB290 - push {r4,lr} - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080EB2BA - ldr r4, =0x000040ef - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 4 - adds r0, r2, 0 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet -_080EB2BA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EB290 - - thumb_func_start sub_80EB2C8 -sub_80EB2C8: @ 80EB2C8 - push {r4,lr} - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080EB2F2 - ldr r4, =0x000040ee - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 3 - adds r0, r2, 0 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet -_080EB2F2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EB2C8 - - thumb_func_start sub_80EB300 -sub_80EB300: @ 80EB300 - push {r4,r5,lr} - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080EB34C - ldr r5, =0x000040ee - adds r0, r5, 0 - bl VarGet - ldr r1, =0x0000c7ff - ands r1, r0 - adds r0, r5, 0 - bl VarSet - ldr r4, =0x000040ef - adds r0, r4, 0 - bl VarGet - ldr r1, =0x0000fffe - ands r1, r0 - adds r0, r4, 0 - bl VarSet - adds r0, r5, 0 - bl VarGet - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 6 - adds r0, r2, 0 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - bl VarSet -_080EB34C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EB300 - - thumb_func_start sub_80EB368 -sub_80EB368: @ 80EB368 - push {r4,r5,lr} - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080EB3B4 - ldr r5, =0x000040ee - adds r0, r5, 0 - bl VarGet - ldr r1, =0x0000c7ff - ands r1, r0 - adds r0, r5, 0 - bl VarSet - ldr r4, =0x000040ef - adds r0, r4, 0 - bl VarGet - ldr r1, =0x0000fffe - ands r1, r0 - adds r0, r4, 0 - bl VarSet - adds r0, r5, 0 - bl VarGet - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 4 - adds r0, r2, 0 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - bl VarSet -_080EB3B4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EB368 - - thumb_func_start sub_80EB3D0 -sub_80EB3D0: @ 80EB3D0 - push {r4,r5,lr} - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080EB41C - ldr r5, =0x000040ee - adds r0, r5, 0 - bl VarGet - ldr r1, =0x0000c7ff - ands r1, r0 - adds r0, r5, 0 - bl VarSet - ldr r4, =0x000040ef - adds r0, r4, 0 - bl VarGet - ldr r1, =0x0000fffe - ands r1, r0 - adds r0, r4, 0 - bl VarSet - adds r0, r5, 0 - bl VarGet - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 5 - adds r0, r2, 0 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - bl VarSet -_080EB41C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EB3D0 - - thumb_func_start sub_80EB438 -sub_80EB438: @ 80EB438 - push {r4,lr} - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080EB480 - ldr r4, =0x000040ee - adds r0, r4, 0 - bl VarGet - ldr r1, =0x0000c7ff - ands r1, r0 - adds r0, r4, 0 - bl VarSet - adds r4, 0x1 - adds r0, r4, 0 - bl VarGet - ldr r1, =0x0000fffe - ands r1, r0 - adds r0, r4, 0 - bl VarSet - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r0, 0x1 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet -_080EB480: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EB438 - - thumb_func_start sub_80EB498 -sub_80EB498: @ 80EB498 - 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 MapGridGetMetatileIdAt - ldr r1, =0xfffffce4 - adds r0, r1 - cmp r0, 0x18 - bhi _080EB55C - lsls r0, 2 - ldr r1, =_080EB4D0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080EB4D0: - .4byte _080EB534 - .4byte _080EB534 - .4byte _080EB534 - .4byte _080EB534 - .4byte _080EB55C - .4byte _080EB55C - .4byte _080EB55C - .4byte _080EB55C - .4byte _080EB534 - .4byte _080EB534 - .4byte _080EB534 - .4byte _080EB534 - .4byte _080EB55C - .4byte _080EB55C - .4byte _080EB55C - .4byte _080EB55C - .4byte _080EB534 - .4byte _080EB534 - .4byte _080EB55C - .4byte _080EB55C - .4byte _080EB534 - .4byte _080EB534 - .4byte _080EB534 - .4byte _080EB534 - .4byte _080EB534 -_080EB534: - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080EB55C - ldr r4, =0x000040ee - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 7 - adds r0, r2, 0 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet -_080EB55C: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EB498 - - thumb_func_start sub_80EB56C -sub_80EB56C: @ 80EB56C - 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 MapGridGetMetatileIdAt - ldr r1, =0xfffffdd4 - adds r0, r1 - cmp r0, 0xCF - bls _080EB594 - b _080EB9D0 -_080EB594: - lsls r0, 2 - ldr r1, =_080EB5A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080EB5A8: - .4byte _080EB930 - .4byte _080EB97C - .4byte _080EB97C - .4byte _080EB97C - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB930 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9AC - .4byte _080EB954 - .4byte _080EB954 - .4byte _080EB8E8 - .4byte _080EB8E8 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9AC - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9AC - .4byte _080EB9AC - .4byte _080EB9AC - .4byte _080EB9AC - .4byte _080EB9AC - .4byte _080EB9AC - .4byte _080EB9AC - .4byte _080EB9AC - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9AC - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9AC - .4byte _080EB9AC - .4byte _080EB9AC - .4byte _080EB9D0 - .4byte _080EB9AC - .4byte _080EB9AC - .4byte _080EB9AC - .4byte _080EB9AC - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9AC - .4byte _080EB9AC - .4byte _080EB9AC - .4byte _080EB9AC - .4byte _080EB9AC - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB90C - .4byte _080EB90C - .4byte _080EB90C - .4byte _080EB90C - .4byte _080EB90C - .4byte _080EB90C - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB90C - .4byte _080EB90C - .4byte _080EB90C - .4byte _080EB90C - .4byte _080EB90C - .4byte _080EB90C - .4byte _080EB90C - .4byte _080EB90C - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB9D0 - .4byte _080EB90C - .4byte _080EB90C - .4byte _080EB90C - .4byte _080EB90C -_080EB8E8: - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080EB9D0 - ldr r4, =0x000040ee - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r0, 0x40 - b _080EB994 - .pool -_080EB90C: - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080EB9D0 - ldr r4, =0x000040ee - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r0, 0x8 - b _080EB994 - .pool -_080EB930: - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080EB9D0 - ldr r4, =0x000040ef - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r0, 0x40 - b _080EB994 - .pool -_080EB954: - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080EB9D0 - ldr r4, =0x000040ef - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 - b _080EB994 - .pool -_080EB97C: - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080EB9D0 - ldr r4, =0x000040ef - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r0, 0x10 -_080EB994: - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet - b _080EB9D0 - .pool -_080EB9AC: - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080EB9D0 - ldr r4, =0x000040ef - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r0, 0x8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet -_080EB9D0: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EB56C - - thumb_func_start sub_80EB9E0 -sub_80EB9E0: @ 80EB9E0 - 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 MapGridGetMetatileIdAt - ldr r1, =0xfffffd6f - adds r0, r1 - cmp r0, 0x35 - bls _080EBA08 - b _080EBB18 -_080EBA08: - lsls r0, 2 - ldr r1, =_080EBA1C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080EBA1C: - .4byte _080EBAF4 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBAF4 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBAF4 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBAF4 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBAF4 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBAF4 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBAF4 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBAF4 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBAF4 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBAF4 - .4byte _080EBB18 - .4byte _080EBB18 - .4byte _080EBAF4 -_080EBAF4: - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080EBB18 - ldr r4, =0x000040ef - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r0, 0x8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet -_080EBB18: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EB9E0 - - thumb_func_start sub_80EBB28 -sub_80EBB28: @ 80EBB28 - 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 MapGridGetMetatileIdAt - ldr r1, =0xfffffddb - adds r0, r1 - cmp r0, 0xA2 - bls _080EBB50 - b _080EBE6C -_080EBB50: - lsls r0, 2 - ldr r1, =_080EBB64 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080EBB64: - .4byte _080EBE48 - .4byte _080EBE48 - .4byte _080EBE48 - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE14 - .4byte _080EBE14 - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBDF0 - .4byte _080EBE6C - .4byte _080EBDF0 - .4byte _080EBDF0 - .4byte _080EBE6C - .4byte _080EBDF0 - .4byte _080EBDF0 - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBDF0 - .4byte _080EBE6C - .4byte _080EBDF0 - .4byte _080EBDF0 - .4byte _080EBDF0 - .4byte _080EBE6C - .4byte _080EBDF0 - .4byte _080EBDF0 - .4byte _080EBDF0 - .4byte _080EBE6C - .4byte _080EBDF0 - .4byte _080EBE6C - .4byte _080EBDF0 - .4byte _080EBE6C - .4byte _080EBDF0 - .4byte _080EBDF0 - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBDF0 - .4byte _080EBDF0 - .4byte _080EBE6C - .4byte _080EBDF0 - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBE6C - .4byte _080EBDF0 - .4byte _080EBDF0 - .4byte _080EBE6C - .4byte _080EBDF0 -_080EBDF0: - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080EBE6C - ldr r4, =0x000040ef - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r0, 0x8 - b _080EBE30 - .pool -_080EBE14: - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080EBE6C - ldr r4, =0x000040ef - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 -_080EBE30: - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet - b _080EBE6C - .pool -_080EBE48: - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080EBE6C - ldr r4, =0x000040ef - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r0, 0x10 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet -_080EBE6C: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EBB28 - - thumb_func_start sub_80EBE7C -sub_80EBE7C: @ 80EBE7C - 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 MapGridGetMetatileIdAt - adds r1, r0, 0 - ldr r0, =0x0000028e - cmp r1, r0 - bgt _080EBECC - subs r0, 0x1 - cmp r1, r0 - blt _080EBECC - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080EBECC - ldr r4, =0x000040ef - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r0, 0x4 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet -_080EBECC: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EBE7C - - thumb_func_start sub_80EBEE0 -sub_80EBEE0: @ 80EBEE0 - push {r4-r7,lr} - movs r3, 0 - ldr r6, =0x03005d8c - movs r5, 0 - ldr r7, =0x000027ce -_080EBEEA: - ldr r0, [r6] - lsls r1, r3, 3 - adds r1, r3 - lsls r1, 2 - adds r0, r1 - ldr r2, =0x000027cc - adds r0, r2 - strb r5, [r0] - ldr r0, [r6] - adds r0, r1 - adds r2, 0x1 - adds r0, r2 - strb r5, [r0] - movs r2, 0 - adds r4, r3, 0x1 - adds r3, r1, 0 -_080EBF0A: - ldr r0, [r6] - adds r1, r2, r3 - adds r0, r7 - adds r0, r1 - strb r5, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x21 - bls _080EBF0A - lsls r0, r4, 24 - lsrs r3, r0, 24 - cmp r3, 0x18 - bls _080EBEEA - bl sub_80EEE5C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EBEE0 - - thumb_func_start special_0x44 -special_0x44: @ 80EBF3C - push {r4-r7,lr} - movs r4, 0x5 - ldr r1, =0x03005d8c - ldr r0, [r1] - movs r2, 0xA2 - lsls r2, 6 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080EBF70 - adds r3, r1, 0 - subs r2, 0xB4 -_080EBF54: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x17 - bhi _080EBF70 - ldr r0, [r3] - lsls r1, r4, 3 - adds r1, r4 - lsls r1, 2 - adds r0, r1 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080EBF54 -_080EBF70: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __modsi3 - lsls r0, 24 - lsrs r5, r0, 24 - adds r7, r5, 0 - ldr r6, =0x03005d8c -_080EBF86: - ldr r1, [r6] - lsls r0, r5, 3 - adds r0, r5 - lsls r4, r0, 2 - adds r1, r4 - ldr r0, =0x000027cc - adds r1, r0 - ldrb r0, [r1] - bl sub_80EFFE0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - beq _080EBFBC - ldr r0, [r6] - adds r0, r4 - ldr r1, =0x000027cd - adds r0, r1 - ldrb r0, [r0] - b _080EBFCC - .pool -_080EBFBC: - ldr r2, =0x000027cc - adds r0, r4, r2 - ldr r1, [r6] - adds r1, r0 - ldrh r0, [r1, 0x16] - cmp r0, 0 - bne _080EBFD8 - ldrb r0, [r1, 0x1] -_080EBFCC: - cmp r0, 0x1 - bne _080EBFD8 - adds r0, r5, 0 - b _080EBFEC - .pool -_080EBFD8: - cmp r5, 0 - bne _080EBFE0 - movs r5, 0x17 - b _080EBFE6 -_080EBFE0: - subs r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080EBFE6: - cmp r5, r7 - bne _080EBF86 - movs r0, 0xFF -_080EBFEC: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end special_0x44 - - thumb_func_start sub_80EBFF4 -sub_80EBFF4: @ 80EBFF4 - push {lr} - bl special_0x44 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xFF - bne _080EC006 - movs r0, 0xFF - b _080EC03E -_080EC006: - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r3, =0x00002b90 - adds r0, r2, r3 - ldrh r0, [r0] - cmp r0, 0 - beq _080EC03C - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2, r0 - ldr r2, =0x000027cc - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x29 - bne _080EC03C - bl sub_80EC18C - lsls r0, 24 - lsrs r0, 24 - b _080EC03E - .pool -_080EC03C: - adds r0, r1, 0 -_080EC03E: - pop {r1} - bx r1 - thumb_func_end sub_80EBFF4 - - thumb_func_start UpdateTVScreensOnMap -@ void UpdateTVScreensOnMap(s32 mapWidth, s32 mapHeight) -UpdateTVScreensOnMap: @ 80EC044 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, =0x00000891 - bl FlagSet - bl CheckForBigMovieOrEmergencyNewsOnTV - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EC06A - cmp r0, 0x2 - beq _080EC0BE - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r0, [r0, 0x4] - cmp r0, 0xD - bne _080EC080 -_080EC06A: - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x3 - bl SetTVMetatilesOnMap - b _080EC0BE - .pool -_080EC080: - ldr r0, =0x00000892 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080EC0BE - bl sub_80EBFF4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _080EC0AE - bl sub_80EEF20 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _080EC0AE - bl IsTVShowInSearchOfTrainersAiring - lsls r0, 24 - cmp r0, 0 - beq _080EC0BE -_080EC0AE: - ldr r0, =0x00000891 - bl FlagReset - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x3 - bl SetTVMetatilesOnMap -_080EC0BE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end UpdateTVScreensOnMap - - thumb_func_start SetTVMetatilesOnMap -@ void SetTVMetatilesOnMap(s32 mapWidth, s32 mapHeight, u16 metatileId) -SetTVMetatilesOnMap: @ 80EC0CC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r9, r0 - mov r10, r1 - lsls r2, 16 - lsrs r2, 16 - movs r5, 0 - cmp r5, r10 - bge _080EC120 - movs r1, 0xC0 - lsls r1, 4 - adds r0, r1, 0 - mov r8, r2 - mov r1, r8 - orrs r1, r0 - mov r8, r1 -_080EC0F2: - movs r4, 0 - adds r7, r5, 0x1 - cmp r4, r9 - bge _080EC11A - mov r0, r8 - lsls r6, r0, 16 -_080EC0FE: - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridGetMetatileBehaviorAt - cmp r0, 0x86 - bne _080EC114 - adds r0, r4, 0 - adds r1, r5, 0 - lsrs r2, r6, 16 - bl MapGridSetMetatileIdAt -_080EC114: - adds r4, 0x1 - cmp r4, r9 - blt _080EC0FE -_080EC11A: - adds r5, r7, 0 - cmp r5, r10 - blt _080EC0F2 -_080EC120: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end SetTVMetatilesOnMap - - thumb_func_start TurnOffTVScreen -TurnOffTVScreen: @ 80EC130 - push {lr} - ldr r1, =0x03005dc0 - ldr r0, [r1] - ldr r1, [r1, 0x4] - movs r2, 0x2 - bl SetTVMetatilesOnMap - bl DrawWholeMapView - pop {r0} - bx r0 - .pool - thumb_func_end TurnOffTVScreen - - thumb_func_start TurnOnTVScreen -TurnOnTVScreen: @ 80EC14C - push {lr} - ldr r1, =0x03005dc0 - ldr r0, [r1] - ldr r1, [r1, 0x4] - movs r2, 0x3 - bl SetTVMetatilesOnMap - bl DrawWholeMapView - pop {r0} - bx r0 - .pool - thumb_func_end TurnOnTVScreen - - thumb_func_start special_0x45 -special_0x45: @ 80EC168 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x020375e0 - ldrh r2, [r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r1, r0 - ldr r0, =0x000027cc - adds r1, r0 - ldrb r0, [r1] - bx lr - .pool - thumb_func_end special_0x45 - - thumb_func_start sub_80EC18C -sub_80EC18C: @ 80EC18C - push {r4,lr} - movs r2, 0 - ldr r0, =0x03005d8c - ldr r3, [r0] -_080EC194: - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r1, r3, r0 - ldr r4, =0x000027cc - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _080EC1C0 - cmp r0, 0x29 - beq _080EC1C0 - adds r4, 0x1 - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080EC1C0 - adds r0, r2, 0 - b _080EC1CC - .pool -_080EC1C0: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x17 - bls _080EC194 - movs r0, 0xFF -_080EC1CC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80EC18C - - thumb_func_start special_0x4a -special_0x4a: @ 80EC1D4 - push {lr} - ldr r3, =0x03005d8c - ldr r2, =0x020375e0 - ldrh r1, [r2] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r3, [r3] - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0x29 - bne _080EC214 - ldr r1, =0x00002b90 - adds r0, r3, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _080EC214 - bl sub_80EC18C - lsls r0, 24 - lsrs r0, 24 - b _080EC216 - .pool -_080EC214: - ldrb r0, [r2] -_080EC216: - pop {r1} - bx r1 - thumb_func_end special_0x4a - - thumb_func_start GabbyAndTyNewGameInitData -GabbyAndTyNewGameInitData: @ 80EC21C - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - ldr r3, =0x03005d8c - ldr r2, [r3] - ldr r1, =0x00002ba4 - adds r0, r2, r1 - movs r4, 0 - mov r10, r4 - movs r1, 0 - strh r1, [r0] - ldr r4, =0x00002ba6 - adds r0, r2, r4 - strh r1, [r0] - adds r4, 0x2 - adds r0, r2, r4 - strh r1, [r0] - ldr r0, =0x00002baa - adds r1, r2, r0 - ldr r0, =0x0000ffff - strh r0, [r1] - adds r4, 0x6 - adds r2, r4 - ldrb r1, [r2] - movs r0, 0x2 - negs r0, r0 - mov r9, r0 - ands r0, r1 - strb r0, [r2] - ldr r1, [r3] - adds r1, r4 - ldrb r2, [r1] - movs r0, 0x3 - negs r0, r0 - mov r8, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, r4 - ldrb r2, [r1] - movs r6, 0x5 - negs r6, r6 - adds r0, r6, 0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, r4 - ldrb r2, [r1] - movs r5, 0x9 - negs r5, r5 - adds r0, r5, 0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, r4 - ldrb r2, [r1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, r4 - ldrb r2, [r1] - movs r0, 0x1F - ands r0, r2 - strb r0, [r1] - ldr r0, [r3] - ldr r2, =0x00002baf - adds r0, r2 - ldrb r1, [r0] - mov r4, r9 - ands r4, r1 - strb r4, [r0] - ldr r0, [r3] - adds r0, r2 - ldrb r1, [r0] - mov r4, r8 - ands r4, r1 - strb r4, [r0] - ldr r0, [r3] - adds r0, r2 - ldrb r1, [r0] - ands r6, r1 - strb r6, [r0] - ldr r0, [r3] - adds r0, r2 - ldrb r1, [r0] - ands r5, r1 - strb r5, [r0] - ldr r1, [r3] - adds r1, r2 - ldrb r2, [r1] - movs r0, 0xF - ands r0, r2 - strb r0, [r1] - ldr r0, [r3] - ldr r1, =0x00002bac - adds r0, r1 - mov r4, r10 - strb r4, [r0] - ldr r0, [r3] - adds r1, 0x1 - adds r0, r1 - strb r4, [r0] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end GabbyAndTyNewGameInitData - - thumb_func_start GabbyAndTyBeforeInterview -GabbyAndTyBeforeInterview: @ 80EC31C - push {r4,lr} - ldr r3, =0x03005d8c - ldr r2, [r3] - ldr r0, =0x03005d10 - mov r12, r0 - ldrh r1, [r0, 0x6] - ldr r4, =0x00002ba4 - adds r0, r2, r4 - strh r1, [r0] - mov r0, r12 - ldrh r1, [r0, 0x26] - adds r4, 0x2 - adds r0, r2, r4 - strh r1, [r0] - mov r0, r12 - ldrh r1, [r0, 0x22] - adds r4, 0x2 - adds r0, r2, r4 - strh r1, [r0] - ldr r0, =0x00002bad - adds r2, r0 - ldrb r1, [r2] - adds r0, r1, 0 - adds r4, r3, 0 - cmp r0, 0xFF - beq _080EC354 - adds r0, r1, 0x1 - strb r0, [r2] -_080EC354: - ldr r2, [r4] - mov r0, r12 - ldrb r1, [r0, 0x5] - lsls r1, 31 - ldr r0, =0x00002bae - adds r2, r0 - lsrs r1, 31 - ldrb r3, [r2] - movs r0, 0x2 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - mov r1, r12 - ldrb r0, [r1] - cmp r0, 0 - beq _080EC398 - ldr r0, [r4] - ldr r1, =0x00002bae - adds r0, r1 - ldrb r1, [r0] - movs r2, 0x2 - orrs r1, r2 - b _080EC3A6 - .pool -_080EC398: - ldr r0, [r4] - ldr r1, =0x00002bae - adds r0, r1 - ldrb r2, [r0] - movs r1, 0x3 - negs r1, r1 - ands r1, r2 -_080EC3A6: - strb r1, [r0] - mov r1, r12 - ldrb r0, [r1, 0x3] - cmp r0, 0 - beq _080EC3C4 - ldr r0, [r4] - ldr r1, =0x00002bae - adds r0, r1 - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - b _080EC3D2 - .pool -_080EC3C4: - ldr r0, [r4] - ldr r1, =0x00002bae - adds r0, r1 - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 -_080EC3D2: - strb r1, [r0] - mov r0, r12 - ldrb r1, [r0, 0x5] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _080EC410 - movs r1, 0 - mov r0, r12 - adds r0, 0x36 - ldrb r0, [r0] - cmp r0, 0 - bne _080EC410 -_080EC3EC: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xA - bhi _080EC41E - mov r0, r12 - adds r0, 0x36 - adds r0, r1, r0 - ldrb r0, [r0] - cmp r0, 0 - beq _080EC3EC - ldr r0, [r4] - ldr r4, =0x00002bae - adds r0, r4 - b _080EC416 - .pool -_080EC410: - ldr r0, [r4] - ldr r1, =0x00002bae - adds r0, r1 -_080EC416: - ldrb r1, [r0] - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0] -_080EC41E: - bl TakeTVShowInSearchOfTrainersOffTheAir - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r4, =0x00002ba8 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0 - bne _080EC436 - movs r0, 0x1 - bl FlagSet -_080EC436: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end GabbyAndTyBeforeInterview - - thumb_func_start GabbyAndTyAfterInterview -GabbyAndTyAfterInterview: @ 80EC448 - push {r4-r6,lr} - ldr r5, =0x03005d8c - ldr r2, [r5] - ldr r6, =0x00002bae - adds r0, r2, r6 - ldrb r1, [r0] - lsls r1, 31 - ldr r4, =0x00002baf - adds r2, r4 - lsrs r1, 31 - ldrb r3, [r2] - movs r0, 0x2 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r2, [r5] - adds r0, r2, r6 - ldrb r0, [r0] - adds r2, r4 - movs r1, 0x2 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x3 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r2, [r5] - adds r0, r2, r6 - ldrb r0, [r0] - adds r2, r4 - movs r1, 0x4 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r2, [r5] - adds r0, r2, r6 - ldrb r0, [r0] - adds r2, r4 - movs r1, 0x8 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x9 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r1, [r5] - adds r1, r6 - ldrb r0, [r1] - movs r2, 0x10 - orrs r0, r2 - strb r0, [r1] - ldr r0, [r5] - ldr r1, =0x02037318 - ldrb r1, [r1, 0x14] - ldr r2, =0x00002bac - adds r0, r2 - strb r1, [r0] - movs r0, 0x6 - bl sav12_xor_increment - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end GabbyAndTyAfterInterview - - thumb_func_start TakeTVShowInSearchOfTrainersOffTheAir -TakeTVShowInSearchOfTrainersOffTheAir: @ 80EC4E8 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x00002bae - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - bx lr - .pool - thumb_func_end TakeTVShowInSearchOfTrainersOffTheAir - - thumb_func_start GabbyAndTyGetBattleNum -GabbyAndTyGetBattleNum: @ 80EC504 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00002bad - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0x5 - bls _080EC522 - ldrb r0, [r1] - movs r1, 0x3 - bl __umodsi3 - adds r0, 0x6 - lsls r0, 24 - lsrs r0, 24 -_080EC522: - pop {r1} - bx r1 - .pool - thumb_func_end GabbyAndTyGetBattleNum - - thumb_func_start IsTVShowInSearchOfTrainersAiring -IsTVShowInSearchOfTrainersAiring: @ 80EC530 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002bae - adds r0, r1 - ldrb r0, [r0] - lsls r0, 27 - lsrs r0, 31 - bx lr - .pool - thumb_func_end IsTVShowInSearchOfTrainersAiring - - thumb_func_start GabbyAndTyGetLastQuote -GabbyAndTyGetLastQuote: @ 80EC548 - push {r4,r5,lr} - ldr r5, =0x03005d8c - ldr r0, [r5] - ldr r2, =0x00002baa - adds r1, r0, r2 - ldrh r0, [r1] - ldr r4, =0x0000ffff - cmp r0, r4 - beq _080EC584 - ldr r0, =0x02021cc4 - ldrh r1, [r1] - bl CopyEasyChatWord - ldr r1, [r5] - ldr r0, =0x00002baa - adds r1, r0 - ldrh r2, [r1] - adds r0, r4, 0 - orrs r0, r2 - strh r0, [r1] - movs r0, 0x1 - b _080EC586 - .pool -_080EC584: - movs r0, 0 -_080EC586: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end GabbyAndTyGetLastQuote - - thumb_func_start GabbyAndTyGetLastBattleTrivia -GabbyAndTyGetLastBattleTrivia: @ 80EC58C - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002baf - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080EC5AC - movs r0, 0x1 - b _080EC5D2 - .pool -_080EC5AC: - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _080EC5B8 - movs r0, 0x2 - b _080EC5D2 -_080EC5B8: - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080EC5C4 - movs r0, 0x3 - b _080EC5D2 -_080EC5C4: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _080EC5D0 - movs r0, 0 - b _080EC5D2 -_080EC5D0: - movs r0, 0x4 -_080EC5D2: - pop {r1} - bx r1 - thumb_func_end GabbyAndTyGetLastBattleTrivia - - thumb_func_start GabbyAndTySetScriptVarsToFieldObjectLocalIds -GabbyAndTySetScriptVarsToFieldObjectLocalIds: @ 80EC5D8 - push {lr} - bl GabbyAndTyGetBattleNum - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x1 - cmp r0, 0x7 - bhi _080EC6B0 - lsls r0, 2 - ldr r1, =_080EC5F8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080EC5F8: - .4byte _080EC618 - .4byte _080EC62C - .4byte _080EC640 - .4byte _080EC654 - .4byte _080EC668 - .4byte _080EC67C - .4byte _080EC690 - .4byte _080EC6A4 -_080EC618: - ldr r1, =0x020375e0 - movs r0, 0xE - strh r0, [r1] - ldr r1, =0x020375e2 - movs r0, 0xD - b _080EC6AE - .pool -_080EC62C: - ldr r1, =0x020375e0 - movs r0, 0x5 - strh r0, [r1] - ldr r1, =0x020375e2 - movs r0, 0x6 - b _080EC6AE - .pool -_080EC640: - ldr r1, =0x020375e0 - movs r0, 0x12 - strh r0, [r1] - ldr r1, =0x020375e2 - movs r0, 0x11 - b _080EC6AE - .pool -_080EC654: - ldr r1, =0x020375e0 - movs r0, 0x15 - strh r0, [r1] - ldr r1, =0x020375e2 - movs r0, 0x16 - b _080EC6AE - .pool -_080EC668: - ldr r1, =0x020375e0 - movs r0, 0x8 - strh r0, [r1] - ldr r1, =0x020375e2 - movs r0, 0x9 - b _080EC6AE - .pool -_080EC67C: - ldr r1, =0x020375e0 - movs r0, 0x13 - strh r0, [r1] - ldr r1, =0x020375e2 - movs r0, 0x14 - b _080EC6AE - .pool -_080EC690: - ldr r1, =0x020375e0 - movs r0, 0x17 - strh r0, [r1] - ldr r1, =0x020375e2 - movs r0, 0x18 - b _080EC6AE - .pool -_080EC6A4: - ldr r1, =0x020375e0 - movs r0, 0xA - strh r0, [r1] - ldr r1, =0x020375e2 - movs r0, 0xB -_080EC6AE: - strh r0, [r1] -_080EC6B0: - pop {r0} - bx r0 - .pool - thumb_func_end GabbyAndTySetScriptVarsToFieldObjectLocalIds - - thumb_func_start InterviewAfter -InterviewAfter: @ 80EC6BC - push {lr} - ldr r0, =0x020375e2 - ldrh r0, [r0] - subs r0, 0x1 - cmp r0, 0x7 - bhi _080EC724 - lsls r0, 2 - ldr r1, =_080EC6DC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080EC6DC: - .4byte _080EC6FC - .4byte _080EC702 - .4byte _080EC708 - .4byte _080EC70E - .4byte _080EC724 - .4byte _080EC714 - .4byte _080EC71A - .4byte _080EC720 -_080EC6FC: - bl sub_80ED548 - b _080EC724 -_080EC702: - bl sub_80ED5B8 - b _080EC724 -_080EC708: - bl sub_80ED610 - b _080EC724 -_080EC70E: - bl TaskDummy5 - b _080EC724 -_080EC714: - bl sub_80ECF5C - b _080EC724 -_080EC71A: - bl sub_80ED164 - b _080EC724 -_080EC720: - bl sub_80ECA38 -_080EC724: - pop {r0} - bx r0 - thumb_func_end InterviewAfter - - thumb_func_start sub_80EC728 -sub_80EC728: @ 80EC728 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r4, 0 - bl sub_80EED88 - bl sub_80ED718 - ldr r5, =0x03005d10 - ldrh r0, [r5, 0x28] - cmp r0, 0 - bne _080EC74C - bl sub_80EC8FC - b _080EC888 - .pool -_080EC74C: - bl sub_80EC8A4 - ldr r0, =0x0000ffff - bl sub_80EFB38 - lsls r0, 24 - cmp r0, 0 - beq _080EC75E - b _080EC888 -_080EC75E: - ldrh r1, [r5, 0x28] - movs r0, 0xB - muls r0, r1 - ldr r1, =gSpeciesNames - adds r0, r1 - adds r1, r5, 0 - adds r1, 0x2A - bl CompareString - cmp r0, 0 - bne _080EC776 - b _080EC888 -_080EC776: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFB08 - ldr r1, =0x030060bc - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EC888 - movs r0, 0x15 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EC888 - movs r2, 0 - adds r1, r5, 0 - adds r1, 0x36 -_080EC7A8: - adds r0, r2, r1 - ldrb r0, [r0] - adds r0, r4, r0 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xA - bls _080EC7A8 - cmp r4, 0 - bne _080EC7CA - ldrb r1, [r5, 0x5] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080EC888 -_080EC7CA: - movs r4, 0 - ldr r2, =0x03005d8c - ldr r0, =0x030060bc - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r6, r1, r0 - movs r0, 0x15 - strb r0, [r6] - strb r4, [r6, 0x1] - ldrb r1, [r5, 0x5] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080EC81C - movs r4, 0x1 - movs r0, 0x1 - adds r3, r6, 0 - adds r3, 0x13 - ldr r1, =0x03005d90 - mov r8, r1 - adds r7, r6, 0x4 - b _080EC84E - .pool -_080EC81C: - movs r2, 0 - ldr r0, =0x02024208 - mov r12, r0 - adds r3, r6, 0 - adds r3, 0x13 - ldr r1, =0x03005d90 - mov r8, r1 - adds r7, r6, 0x4 - adds r1, r5, 0 - adds r1, 0x36 -_080EC830: - adds r0, r2, r1 - ldrb r0, [r0] - adds r0, r4, r0 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xA - bls _080EC830 - cmp r4, 0xFF - bls _080EC84A - movs r4, 0xFF -_080EC84A: - mov r1, r12 - ldrh r0, [r1] -_080EC84E: - strb r4, [r6, 0x12] - strb r0, [r6, 0xF] - mov r0, r8 - ldr r1, [r0] - adds r0, r3, 0 - bl CopyString - ldr r4, =0x03005d3a - adds r0, r7, 0 - adds r1, r4, 0 - bl CopyString - adds r0, r7, 0 - bl sub_81DB604 - adds r5, r0, 0 - adds r0, r7, 0 - bl StripExtendedControlCodes - subs r4, 0x2A - ldrh r0, [r4, 0x28] - strh r0, [r6, 0x10] - adds r0, r6, 0 - bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r6, 0x2] - strb r5, [r6, 0x3] -_080EC888: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EC728 - - thumb_func_start sub_80EC8A4 -sub_80EC8A4: @ 80EC8A4 - push {r4,lr} - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x00002b2c - adds r4, r1, r0 - ldrb r0, [r4] - cmp r0, 0x19 - beq _080EC8CA - ldr r2, =0x000027cc - adds r0, r1, r2 - movs r1, 0x18 - bl sub_80EF910 - movs r0, 0x5 - bl sub_80847F8 - strh r0, [r4, 0x6] - movs r0, 0x19 - strb r0, [r4] -_080EC8CA: - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - ldr r1, =0x03005d10 - ldrh r0, [r1, 0x28] - strh r0, [r4, 0x4] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x8] - ldr r0, =0x02037318 - ldrb r0, [r0, 0x14] - strb r0, [r4, 0xA] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EC8A4 - - thumb_func_start sub_80EC8FC -sub_80EC8FC: @ 80EC8FC - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x0000ffff - bl sub_80EFB38 - lsls r0, 24 - cmp r0, 0 - bne _080EC9B4 - movs r1, 0 - movs r5, 0 - ldr r2, =0x03005d46 -_080EC914: - adds r0, r1, r2 - ldrb r0, [r0] - adds r0, r5, r0 - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xA - bls _080EC914 - cmp r5, 0xFF - bls _080EC92E - movs r5, 0xFF -_080EC92E: - cmp r5, 0x2 - bls _080EC9B4 - ldr r0, =0x0202433a - mov r8, r0 - ldrb r0, [r0] - cmp r0, 0x6 - beq _080EC940 - cmp r0, 0x1 - bne _080EC9B4 -_080EC940: - ldr r7, =0x03005d8c - ldr r0, [r7] - ldr r6, =0x000027cc - adds r0, r6 - bl sub_80EFB08 - ldr r4, =0x030060bc - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EC9B4 - movs r0, 0x17 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EC9B4 - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldr r4, [r7] - adds r4, r0 - movs r1, 0 - movs r0, 0x17 - strb r0, [r4] - strb r1, [r4, 0x1] - ldr r1, =0x03005d10 - ldrh r0, [r1, 0x6] - strh r0, [r4, 0xC] - ldrh r0, [r1, 0x20] - strh r0, [r4, 0xE] - strb r5, [r4, 0x10] - mov r1, r8 - ldrb r0, [r1] - strb r0, [r4, 0x11] - ldr r0, =0x02037318 - ldrb r0, [r0, 0x14] - strb r0, [r4, 0x12] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r4, 0x2] -_080EC9B4: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EC8FC - - thumb_func_start sub_80EC9E8 -sub_80EC9E8: @ 80EC9E8 - push {r4,lr} - adds r4, r0, 0 - bl sub_80F0020 - strb r0, [r4, 0x1E] - lsrs r2, r0, 8 - strb r2, [r4, 0x1F] - adds r1, r4, 0 - adds r1, 0x20 - strb r0, [r1] - adds r1, 0x1 - strb r2, [r1] - adds r1, 0x1 - strb r0, [r1] - adds r0, r4, 0 - adds r0, 0x23 - strb r2, [r0] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80EC9E8 - - thumb_func_start sub_80ECA10 -sub_80ECA10: @ 80ECA10 - push {r4,lr} - adds r4, r0, 0 - bl sub_80F0020 - adds r1, r4, 0 - adds r1, 0x20 - strb r0, [r1] - lsrs r1, r0, 8 - adds r2, r4, 0 - adds r2, 0x21 - strb r1, [r2] - adds r2, 0x1 - strb r0, [r2] - adds r0, r4, 0 - adds r0, 0x23 - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80ECA10 - - thumb_func_start sub_80ECA38 -sub_80ECA38: @ 80ECA38 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x03005d8c - mov r8, r0 - ldr r7, [r0] - ldr r1, =0x00002b2c - adds r6, r7, r1 - ldrb r1, [r6] - cmp r1, 0x8 - bne _080ECACE - ldr r0, =0x030060bc - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r5, =0x000027cc - adds r4, r5 - adds r4, r7, r4 - strb r1, [r4] - movs r0, 0x1 - strb r0, [r4, 0x1] - adds r0, r4, 0 - adds r0, 0x14 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - ldr r0, =0x02039f2c - ldrh r0, [r0] - strb r0, [r4, 0x1C] - ldr r0, =0x02039f24 - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - strh r0, [r4, 0x12] - ldrh r0, [r6, 0x2] - strh r0, [r4, 0x2] - ldrb r0, [r6, 0xC] - strb r0, [r4, 0xC] - ldrb r0, [r6, 0xD] - strb r0, [r4, 0xD] - ldrb r0, [r6, 0xE] - strb r0, [r4, 0xE] - ldrh r0, [r6, 0x10] - strh r0, [r4, 0x10] - ldrb r0, [r6, 0xF] - strb r0, [r4, 0xF] - adds r0, r4, 0x4 - ldr r2, =0x00002b30 - adds r1, r7, r2 - bl CopyString - adds r0, r4, 0 - bl sub_80ECA10 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r4, 0x1D] - ldrb r0, [r6, 0x1E] - strb r0, [r4, 0x1E] - mov r1, r8 - ldr r0, [r1] - adds r0, r5 - movs r1, 0x18 - bl sub_80EF910 -_080ECACE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ECA38 - - thumb_func_start sub_80ECB00 -sub_80ECB00: @ 80ECB00 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 16 - lsrs r1, 16 - mov r10, r1 - lsls r2, 16 - lsrs r2, 16 - mov r9, r2 - lsls r3, 16 - lsrs r3, 16 - mov r8, r3 - ldr r6, =0x03005d8c - ldr r0, [r6] - ldr r5, =0x000027cc - adds r0, r5 - bl sub_80EFADC - ldr r4, =0x030060bc - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080ECBEC - movs r0, 0xA - bl sub_80EF550 - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0x1 - beq _080ECBEC - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, [r6] - adds r4, r1, r0 - movs r0, 0xA - strb r0, [r4] - movs r5, 0x1 - strb r5, [r4, 0x1] - adds r0, r4, 0x4 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _080ECBA0 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _080ECBA2 - strb r5, [r4, 0x18] - b _080ECBA4 - .pool -_080ECBA0: - movs r0, 0x2 -_080ECBA2: - strb r0, [r4, 0x18] -_080ECBA4: - mov r0, r10 - strh r0, [r4, 0x14] - mov r0, r9 - strh r0, [r4, 0x16] - mov r0, r8 - strh r0, [r4, 0x2] - lsls r0, r7, 3 - subs r0, r7 - lsls r5, r0, 2 - ldr r6, =0x020229f0 - adds r1, r5, r6 - mov r0, sp - bl CopyString - mov r0, sp - bl StripExtendedControlCodes - adds r0, r4, 0 - adds r0, 0xC - mov r1, sp - bl CopyString - adds r0, r4, 0 - bl sub_80ECA10 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r4, 0x19] - cmp r0, 0x1 - beq _080ECBE8 - adds r0, r6, r5 - ldrh r0, [r0, 0x12] - cmp r0, 0x1 - bne _080ECBEA -_080ECBE8: - movs r0, 0x1 -_080ECBEA: - strb r0, [r4, 0x1A] -_080ECBEC: - 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_80ECB00 - - thumb_func_start sub_80ECC04 -sub_80ECC04: @ 80ECC04 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - mov r10, r0 - ldr r0, [sp, 0x44] - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x20] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r0, =0x03005d8c - mov r8, r0 - ldr r0, [r0] - ldr r7, =0x000027cc - adds r0, r7 - bl sub_80EFADC - ldr r4, =0x030060bc - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080ECC54 - movs r0, 0x9 - bl sub_80EF550 - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0x1 - bne _080ECC68 -_080ECC54: - movs r0, 0 - b _080ECCEE - .pool -_080ECC68: - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - mov r2, r8 - ldr r1, [r2] - adds r4, r1, r0 - movs r0, 0x9 - strb r0, [r4] - movs r7, 0x1 - strb r7, [r4, 0x1] - adds r0, r4, 0 - adds r0, 0xC - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - mov r0, sp - mov r1, r10 - bl CopyString - mov r0, sp - bl StripExtendedControlCodes - adds r0, r4, 0x4 - mov r1, sp - bl CopyString - movs r0, 0x7 - ands r5, r0 - ldrb r1, [r4, 0x3] - subs r0, 0xF - ands r0, r1 - orrs r0, r5 - movs r1, 0x3 - ands r6, r1 - lsls r2, r6, 3 - subs r1, 0x1C - ands r0, r1 - orrs r0, r2 - strb r0, [r4, 0x3] - add r0, sp, 0x20 - ldrb r0, [r0] - strb r0, [r4, 0x2] - adds r0, r4, 0 - bl sub_80ECA10 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r4, 0x14] - cmp r0, 0x1 - beq _080ECCDA - mov r1, r9 - cmp r1, 0x1 - bne _080ECCE8 -_080ECCDA: - strb r7, [r4, 0x15] - b _080ECCEC - .pool -_080ECCE8: - mov r2, r9 - strb r2, [r4, 0x15] -_080ECCEC: - movs r0, 0x1 -_080ECCEE: - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80ECC04 - - thumb_func_start sub_80ECD00 -sub_80ECD00: @ 80ECD00 - push {r4-r6,lr} - sub sp, 0x20 - ldr r6, =0x03005d8c - ldr r0, =0x020375e4 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r6] - adds r4, r1, r0 - ldr r0, =0x020375e2 - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - strb r0, [r4, 0x16] - adds r0, r4, 0x2 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - movs r0, 0xB - strb r0, [r4] - movs r5, 0x1 - strb r5, [r4, 0x1] - bl sub_80F0020 - strb r0, [r4, 0xA] - lsrs r0, 8 - strb r0, [r4, 0xB] - ldr r1, =0x02021cc4 - mov r0, sp - bl CopyString - mov r0, sp - bl StripExtendedControlCodes - adds r0, r4, 0 - adds r0, 0xC - mov r1, sp - bl CopyString - adds r0, r4, 0 - bl sub_80ECA10 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r4, 0x17] - cmp r0, 0x1 - beq _080ECD74 - ldr r0, [r6] - ldr r1, =0x000031a0 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080ECD98 -_080ECD74: - strb r5, [r4, 0x18] - b _080ECD9A - .pool -_080ECD98: - strb r0, [r4, 0x18] -_080ECD9A: - add sp, 0x20 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80ECD00 - - thumb_func_start sub_80ECDA4 -sub_80ECDA4: @ 80ECDA4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r5, =0x03005d8c - ldr r0, [r5] - ldr r4, =0x000027cc - adds r0, r4 - movs r1, 0x18 - bl sub_80EF910 - ldr r0, [r5] - adds r0, r4 - bl sub_80EFADC - ldr r1, =0x030060bc - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080ECDDC - ldr r0, [r5] - ldr r1, =0x00002b2c - adds r0, r1 - strb r6, [r0, 0xD] - movs r1, 0x8 - strb r1, [r0] -_080ECDDC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ECDA4 - - thumb_func_start sub_80ECDF4 -sub_80ECDF4: @ 80ECDF4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002b2c - adds r4, r0, r1 - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFADC - ldr r1, =0x030060bc - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080ECE1C - strb r5, [r4, 0xE] -_080ECE1C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ECDF4 - - thumb_func_start sub_80ECE34 -sub_80ECE34: @ 80ECE34 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002b2c - adds r4, r0, r1 - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFADC - ldr r1, =0x030060bc - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080ECE5C - strb r5, [r4, 0xF] -_080ECE5C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ECE34 - - thumb_func_start sub_80ECE74 -sub_80ECE74: @ 80ECE74 - push {r4,r5,lr} - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002b2c - adds r4, r0, r1 - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFADC - ldr r1, =0x030060bc - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080ECE9C - strh r5, [r4, 0x10] -_080ECE9C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ECE74 - - thumb_func_start sub_80ECEB4 -sub_80ECEB4: @ 80ECEB4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - ldr r0, =0x03005d8c - ldr r4, [r0] - ldr r0, =0x00002b2c - adds r5, r4, r0 - ldr r1, =0x000027cc - adds r0, r4, r1 - bl sub_80EFADC - ldr r1, =0x030060bc - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080ECF4C - ldr r2, =0x02039e00 - lsls r1, r6, 6 - adds r0, r1, r2 - ldrh r0, [r0] - strh r0, [r5, 0x2] - ldr r0, =0x00002b30 - adds r4, r0 - adds r2, 0xD - adds r1, r2 - adds r0, r4, 0 - bl CopyString - adds r0, r4, 0 - bl StripExtendedControlCodes - strb r7, [r5, 0xC] - adds r1, r6, 0x1 - ldr r0, =0x02039f30 - ldrb r0, [r0] - cmp r1, r0 - ble _080ECF30 - ldr r0, =0x020229e8 - ldrh r0, [r0, 0x1A] - b _080ECF4A - .pool -_080ECF30: - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080ECF48 - ldr r1, =0x020229e8 - lsls r0, r6, 3 - subs r0, r6 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x1A] - cmp r0, 0x1 - bne _080ECF4A -_080ECF48: - movs r0, 0x1 -_080ECF4A: - strb r0, [r5, 0x1E] -_080ECF4C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ECEB4 - - thumb_func_start sub_80ECF5C -sub_80ECF5C: @ 80ECF5C - push {r4-r7,lr} - ldr r0, =0x03005d8c - ldr r6, [r0] - ldr r0, =0x00002b2c - adds r5, r6, r0 - ldrb r2, [r5] - cmp r2, 0x6 - bne _080ED02C - ldr r0, =0x030060bc - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - adds r4, r6, r0 - strb r2, [r4] - movs r7, 0x1 - strb r7, [r4, 0x1] - ldrh r0, [r5, 0x2] - strh r0, [r4, 0x2] - adds r0, r4, 0 - adds r0, 0x16 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - adds r0, r4, 0 - adds r0, 0x8 - ldr r2, =0x00002b34 - adds r1, r6, r2 - bl CopyString - ldrb r0, [r5, 0x13] - lsls r0, 29 - lsrs r0, 29 - ldrb r2, [r4, 0x13] - movs r3, 0x8 - negs r3, r3 - adds r1, r3, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0x13] - ldrb r2, [r5, 0x13] - movs r0, 0x18 - ands r0, r2 - movs r2, 0x19 - negs r2, r2 - ands r2, r1 - orrs r2, r0 - strb r2, [r4, 0x13] - ldrh r0, [r5, 0x14] - strh r0, [r4, 0x14] - ldrb r0, [r5, 0x13] - movs r1, 0x60 - ands r1, r0 - movs r0, 0x61 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x13] - ldrb r1, [r5, 0x13] - lsls r1, 29 - lsrs r1, 29 - ands r0, r3 - orrs r0, r1 - strb r0, [r4, 0x13] - adds r0, r4, 0 - bl sub_80ECA10 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r4, 0x1E] - cmp r0, 0x1 - beq _080ECFFA - ldrb r0, [r5, 0x1F] - cmp r0, 0x1 - bne _080ED01C -_080ECFFA: - strb r7, [r4, 0x1F] - b _080ED01E - .pool -_080ED01C: - strb r0, [r4, 0x1F] -_080ED01E: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000027cc - adds r0, r1 - movs r1, 0x18 - bl sub_80EF910 -_080ED02C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ECF5C - - thumb_func_start sub_80ED03C -sub_80ED03C: @ 80ED03C - push {r4-r6,lr} - lsls r0, 16 - lsrs r6, r0, 16 - ldr r4, =0x03005d8c - ldr r0, [r4] - ldr r1, =0x00002b2c - adds r5, r0, r1 - bl sub_80EF7B4 - ldr r0, [r4] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFADC - ldr r1, =0x030060bc - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080ED07A - ldr r0, [r4] - ldr r1, =0x000027cc - adds r0, r1 - movs r1, 0x18 - bl sub_80EF910 - strh r6, [r5, 0x14] - movs r0, 0x6 - strb r0, [r5] -_080ED07A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ED03C - - thumb_func_start sub_80ED090 -sub_80ED090: @ 80ED090 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x03005d8c - ldr r4, [r0] - ldr r0, =0x00002b2c - adds r7, r4, r0 - ldr r1, =0x000027cc - adds r0, r4, r1 - bl sub_80EFADC - ldr r1, =0x030060bc - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080ED134 - movs r3, 0x3 - adds r0, r5, 0 - ands r0, r3 - lsls r0, 5 - ldrb r1, [r7, 0x13] - movs r2, 0x61 - negs r2, r2 - ands r2, r1 - orrs r2, r0 - strb r2, [r7, 0x13] - ldr r0, =0x02039f2c - ldrb r0, [r0] - movs r1, 0x7 - ands r1, r0 - movs r0, 0x8 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r7, 0x13] - ldr r1, =0x02039f2e - ldrb r1, [r1] - ands r3, r1 - lsls r3, 3 - movs r1, 0x19 - negs r1, r1 - ands r0, r1 - orrs r0, r3 - strb r0, [r7, 0x13] - ldr r0, =0x02039f24 - mov r8, r0 - ldrb r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0x2] - mov r1, r8 - ldrb r0, [r1] - muls r0, r6 - adds r0, r5 - ldr r1, =0x00002b34 - adds r4, r1 - movs r1, 0x2 - adds r2, r4, 0 - bl pokemon_getattr - adds r0, r4, 0 - bl StripExtendedControlCodes - mov r1, r8 - ldrb r0, [r1] - muls r0, r6 - adds r0, r5 - movs r1, 0x3 - bl pokemon_getattr - strb r0, [r7, 0x1F] -_080ED134: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ED090 - - thumb_func_start sub_80ED164 -sub_80ED164: @ 80ED164 - push {r4-r6,lr} - ldr r2, =0x03005d8c - ldr r0, =0x030060bc - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r6, r1, r0 - movs r0, 0x7 - strb r0, [r6] - movs r0, 0x1 - strb r0, [r6, 0x1] - adds r0, r6, 0x2 - ldr r4, =0x03005d90 - ldr r1, [r4] - bl CopyString - adds r0, r6, 0 - adds r0, 0xC - ldr r1, [r4] - ldr r2, =0x00000bd8 - adds r1, r2 - bl CopyString - ldr r1, [r4] - ldr r2, =0x00000bd4 - adds r0, r1, r2 - ldrh r0, [r0] - strh r0, [r6, 0xA] - adds r2, 0x2 - adds r0, r1, r2 - ldrh r0, [r0] - strh r0, [r6, 0x14] - ldr r5, =0x00000d07 - adds r1, r5 - ldrb r0, [r1] - movs r1, 0 - bl sub_8164FCC - strh r0, [r6, 0x16] - ldr r0, [r4] - ldr r1, =0x00000d06 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r6, 0x1C] - ldr r0, [r4] - adds r0, r5 - ldrb r0, [r0] - cmp r0, 0 - bne _080ED1F4 - movs r0, 0x32 - b _080ED1F6 - .pool -_080ED1F4: - movs r0, 0x64 -_080ED1F6: - strb r0, [r6, 0x1A] - ldr r0, =0x020375e0 - ldrh r0, [r0] - strb r0, [r6, 0x1B] - adds r0, r6, 0 - bl sub_80ECA10 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r6, 0x1D] - cmp r0, 0x1 - beq _080ED21C - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r2, =0x00000beb - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080ED21E -_080ED21C: - movs r0, 0x1 -_080ED21E: - strb r0, [r6, 0x1E] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ED164 - - thumb_func_start SaveRecordedItemPurchasesForTVShow -@ void SaveRecordedItemPurchasesForTVShow() -SaveRecordedItemPurchasesForTVShow: @ 80ED238 - push {r4-r7,lr} - ldr r5, =0x03005d8c - ldr r0, [r5] - ldrh r1, [r0, 0x4] - ldr r0, =0x00003c1a - cmp r1, r0 - beq _080ED2F2 - ldr r0, =0x0000371a - cmp r1, r0 - beq _080ED2F2 - ldr r0, =0x00005555 - bl sub_80EFB38 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _080ED2F2 - ldr r0, [r5] - ldr r7, =0x000027cc - adds r0, r7 - bl sub_80EFB08 - ldr r6, =0x030060bc - strb r0, [r6] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080ED2F2 - movs r0, 0x16 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080ED2F2 - bl sub_80EF500 - ldr r2, =0x02039f80 - ldrh r0, [r2, 0x2] - cmp r0, 0x13 - bls _080ED2F2 - movs r1, 0 - ldrsb r1, [r6, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, [r5] - adds r5, r1, r0 - movs r0, 0x16 - strb r0, [r5] - strb r4, [r5, 0x1] - ldr r0, =0x02037318 - ldrb r0, [r0, 0x14] - strb r0, [r5, 0x12] - movs r4, 0 - adds r7, r5, 0x6 - mov r12, r2 - adds r6, r5, 0 - adds r6, 0xC -_080ED2B6: - lsls r2, r4, 1 - adds r3, r7, r2 - lsls r1, r4, 2 - add r1, r12 - ldrh r0, [r1] - strh r0, [r3] - adds r2, r6, r2 - ldrh r0, [r1, 0x2] - strh r0, [r2] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _080ED2B6 - movs r0, 0x1 - bl GetPriceReduction - strb r0, [r5, 0x2] - adds r0, r5, 0 - adds r0, 0x13 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - adds r0, r5, 0 - bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r5, 0x3] -_080ED2F2: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end SaveRecordedItemPurchasesForTVShow - - thumb_func_start sub_80ED320 -sub_80ED320: @ 80ED320 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - bl sub_80EF7A8 - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0x1 - beq _080ED400 - ldr r0, =0x020375e0 - mov r8, r0 - ldrh r0, [r0] - movs r7, 0x64 - muls r0, r7 - ldr r6, =0x020244ec - adds r0, r6 - ldr r4, =0x02021cc4 - movs r1, 0x2 - adds r2, r4, 0 - bl pokemon_getattr - ldr r1, =0x03005d90 - mov r9, r1 - ldr r0, [r1] - bl GetStringLength - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bls _080ED400 - adds r0, r4, 0 - bl GetStringLength - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bls _080ED400 - ldr r2, =0x03005d8c - ldr r0, =0x030060bc - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r4, [r2] - adds r4, r0 - movs r0, 0x5 - strb r0, [r4] - movs r5, 0x1 - strb r5, [r4, 0x1] - mov r2, r8 - ldrh r0, [r2] - muls r0, r7 - adds r0, r6 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - strh r0, [r4, 0x2] - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - strb r0, [r4, 0x1A] - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - ands r0, r5 - strb r0, [r4, 0x1B] - ldrh r0, [r4, 0x2] - bl sub_80EFA24 - strh r0, [r4, 0x1C] - adds r0, r4, 0 - adds r0, 0xF - mov r2, r9 - ldr r1, [r2] - bl CopyString - mov r1, r8 - ldrh r0, [r1] - muls r0, r7 - adds r0, r6 - adds r5, r4, 0x4 - movs r1, 0x2 - adds r2, r5, 0 - bl pokemon_getattr - adds r0, r5, 0 - bl StripExtendedControlCodes - adds r0, r4, 0 - bl sub_80ECA10 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r4, 0x1E] - mov r2, r8 - ldrh r0, [r2] - muls r0, r7 - adds r0, r6 - movs r1, 0x3 - bl pokemon_getattr - strb r0, [r4, 0x1F] -_080ED400: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ED320 - - thumb_func_start StartMassOutbreak -StartMassOutbreak: @ 80ED430 - push {r4,r5,lr} - ldr r4, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r0, [r0] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x000027cc - adds r1, r0 - ldr r2, [r4] - adds r1, r2, r1 - ldrh r3, [r1, 0xC] - ldr r5, =0x00002b90 - adds r0, r2, r5 - strh r3, [r0] - ldrb r0, [r1, 0x10] - ldr r3, =0x00002b92 - adds r2, r3 - strb r0, [r2] - ldr r0, [r4] - ldrb r2, [r1, 0x11] - adds r5, 0x3 - adds r0, r5 - strb r2, [r0] - ldr r0, [r4] - ldrb r2, [r1, 0x14] - adds r3, 0x2 - adds r0, r3 - strb r2, [r0] - ldr r0, [r4] - ldrb r2, [r1, 0x2] - adds r5, 0x2 - adds r0, r5 - strb r2, [r0] - ldr r2, [r4] - ldrh r3, [r1, 0xE] - adds r5, 0x1 - adds r0, r2, r5 - strh r3, [r0] - ldrh r3, [r1, 0x4] - adds r5, 0x2 - adds r0, r2, r5 - strh r3, [r0] - ldrh r3, [r1, 0x6] - adds r5, 0x2 - adds r0, r2, r5 - strh r3, [r0] - ldrh r3, [r1, 0x8] - adds r5, 0x2 - adds r0, r2, r5 - strh r3, [r0] - ldrh r3, [r1, 0xA] - adds r5, 0x2 - adds r0, r2, r5 - strh r3, [r0] - ldrb r0, [r1, 0x3] - ldr r3, =0x00002ba0 - adds r2, r3 - strb r0, [r2] - ldr r0, [r4] - ldrb r1, [r1, 0x13] - adds r5, 0x3 - adds r0, r5 - strb r1, [r0] - ldr r0, [r4] - ldr r1, =0x00002ba2 - adds r0, r1 - movs r1, 0x2 - strh r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end StartMassOutbreak - - thumb_func_start sub_80ED4DC -sub_80ED4DC: @ 80ED4DC - push {r4,lr} - bl sub_80EFA88 - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0x1 - beq _080ED532 - ldr r2, =0x03005d8c - ldr r0, =0x030060bc - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - adds r0, r4, 0 - adds r0, 0x17 - bl sub_818E848 - movs r0, 0x2 - strb r0, [r4, 0x18] - movs r0, 0xC - strb r0, [r4] - movs r0, 0x1 - strb r0, [r4, 0x1] - adds r0, r4, 0x2 - bl sub_818E81C - adds r0, r4, 0 - adds r0, 0xA - adds r1, r4, 0 - adds r1, 0xB - bl sub_818E7E0 - bl sub_818E880 - strb r0, [r4, 0x16] - adds r0, r4, 0 - bl sub_80ECA10 -_080ED532: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ED4DC - - thumb_func_start sub_80ED548 -sub_80ED548: @ 80ED548 - push {r4,lr} - ldr r2, =0x03005d8c - ldr r0, =0x030060bc - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r4, [r2] - adds r4, r0 - movs r0, 0x1 - strb r0, [r4] - strb r0, [r4, 0x1] - adds r0, r4, 0 - adds r0, 0x10 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - strh r0, [r4, 0x2] - adds r0, r4, 0 - bl sub_80ECA10 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r4, 0x18] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ED548 - - thumb_func_start sub_80ED5B8 -sub_80ED5B8: @ 80ED5B8 - push {r4,r5,lr} - ldr r2, =0x03005d8c - ldr r0, =0x030060bc - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r4, [r2] - adds r4, r0 - movs r5, 0 - movs r0, 0x2 - strb r0, [r4] - movs r0, 0x1 - strb r0, [r4, 0x1] - adds r0, r4, 0 - adds r0, 0x10 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - strh r5, [r4, 0x2] - adds r0, r4, 0 - bl sub_80ECA10 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r4, 0x18] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ED5B8 - - thumb_func_start sub_80ED610 -sub_80ED610: @ 80ED610 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r2, =0x03005d8c - ldr r0, =0x030060bc - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r5, r1, r0 - movs r0, 0x3 - strb r0, [r5] - movs r0, 0x1 - mov r8, r0 - mov r1, r8 - strb r1, [r5, 0x1] - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - movs r7, 0x64 - muls r0, r7 - ldr r6, =0x020244ec - adds r0, r6 - movs r1, 0x20 - movs r2, 0 - bl pokemon_getattr - lsrs r0, 4 - movs r1, 0xF - ands r0, r1 - ldrb r2, [r5, 0x4] - movs r1, 0x10 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r5, 0x4] - ldr r0, =0x020375e6 - ldrb r0, [r0] - lsls r0, 4 - movs r2, 0xF - ands r1, r2 - orrs r1, r0 - strb r1, [r5, 0x4] - adds r0, r5, 0x5 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - muls r0, r7 - adds r0, r6 - adds r4, r5, 0 - adds r4, 0x10 - movs r1, 0x2 - adds r2, r4, 0 - bl pokemon_getattr - adds r0, r4, 0 - bl StripExtendedControlCodes - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - muls r0, r7 - adds r0, r6 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - strh r0, [r5, 0x2] - adds r0, r5, 0 - bl sub_80ECA10 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r5, 0xD] - cmp r0, 0x1 - beq _080ED6D4 - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - muls r0, r7 - adds r0, r6 - movs r1, 0x3 - bl pokemon_getattr - cmp r0, 0x1 - bne _080ED6F4 -_080ED6D4: - mov r0, r8 - b _080ED706 - .pool -_080ED6F4: - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - muls r0, r7 - adds r0, r6 - movs r1, 0x3 - bl pokemon_getattr -_080ED706: - strb r0, [r5, 0xE] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80ED610 - - thumb_func_start TaskDummy5 -TaskDummy5: @ 80ED714 - bx lr - thumb_func_end TaskDummy5 - - thumb_func_start sub_80ED718 -sub_80ED718: @ 80ED718 - push {r4-r6,lr} - ldr r0, =0x00000864 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080ED7E4 - movs r1, 0 - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r3, =0x000027cc -_080ED72E: - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2, r0 - adds r0, r3 - ldrb r0, [r0] - cmp r0, 0x29 - beq _080ED7E4 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x17 - bls _080ED72E - ldr r0, =0x00000147 - bl sub_80EFB38 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _080ED7E4 - ldr r6, =0x03005d8c - ldr r0, [r6] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFADC - ldr r4, =0x030060bc - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080ED7E4 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x5 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r2, 0 - ldrsb r2, [r4, r2] - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - ldr r2, =0x000027cc - adds r1, r2 - ldr r4, [r6] - adds r4, r1 - movs r1, 0x29 - strb r1, [r4] - movs r3, 0x1 - strb r3, [r4, 0x1] - ldr r2, =gUnknown_0858D094 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0xA] - strb r0, [r4, 0x14] - strb r5, [r4, 0x2] - strb r5, [r4, 0x3] - ldrh r0, [r1] - movs r2, 0 - strh r0, [r4, 0xC] - strh r5, [r4, 0xE] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x4] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x6] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x8] - ldrh r0, [r1, 0x8] - strh r0, [r4, 0xA] - ldrb r0, [r1, 0xB] - strb r0, [r4, 0x10] - strb r2, [r4, 0x11] - strb r2, [r4, 0x12] - movs r0, 0x32 - strb r0, [r4, 0x13] - strb r2, [r4, 0x15] - strh r3, [r4, 0x16] - adds r0, r4, 0 - bl sub_80ECA10 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r4, 0x18] -_080ED7E4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ED718 - - thumb_func_start EndMassOutbreak -EndMassOutbreak: @ 80ED808 - push {r4,r5,lr} - ldr r3, =0x03005d8c - ldr r0, [r3] - ldr r2, =0x00002b90 - adds r1, r0, r2 - movs r4, 0 - movs r2, 0 - strh r2, [r1] - ldr r5, =0x00002b92 - adds r0, r5 - strb r4, [r0] - ldr r0, [r3] - ldr r1, =0x00002b93 - adds r0, r1 - strb r4, [r0] - ldr r0, [r3] - adds r5, 0x2 - adds r0, r5 - strb r4, [r0] - ldr r0, [r3] - adds r1, 0x2 - adds r0, r1 - strb r4, [r0] - ldr r0, [r3] - adds r5, 0x2 - adds r1, r0, r5 - strh r2, [r1] - adds r5, 0x2 - adds r1, r0, r5 - strh r2, [r1] - adds r5, 0x2 - adds r1, r0, r5 - strh r2, [r1] - adds r5, 0x2 - adds r1, r0, r5 - strh r2, [r1] - adds r5, 0x2 - adds r1, r0, r5 - strh r2, [r1] - ldr r1, =0x00002ba0 - adds r0, r1 - strb r4, [r0] - ldr r0, [r3] - adds r5, 0x3 - adds r0, r5 - strb r4, [r0] - ldr r0, [r3] - adds r1, 0x2 - adds r0, r1 - strh r2, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end EndMassOutbreak - - thumb_func_start sub_80ED888 -sub_80ED888: @ 80ED888 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r4, 0 - bl sub_80ED8B4 - adds r0, r4, 0 - bl UpdateMassOutbreakTimeLeft - adds r0, r4, 0 - bl sub_80EF120 - adds r0, r4, 0 - bl sub_80EDA48 - adds r0, r4, 0 - bl sub_80EEB98 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80ED888 - - thumb_func_start sub_80ED8B4 -sub_80ED8B4: @ 80ED8B4 - push {r4-r7,lr} - lsls r0, 16 - lsrs r5, r0, 16 - ldr r1, =0x03005d8c - ldr r0, [r1] - ldr r2, =0x00002b90 - adds r0, r2 - ldrh r0, [r0] - mov r12, r1 - cmp r0, 0 - bne _080ED91C - movs r1, 0 - ldr r6, =0x000027cc -_080ED8CE: - mov r7, r12 - ldr r4, [r7] - lsls r0, r1, 3 - adds r0, r1 - lsls r3, r0, 2 - adds r2, r4, r3 - adds r0, r2, r6 - ldrb r0, [r0] - cmp r0, 0x29 - bne _080ED912 - ldr r7, =0x000027cd - adds r0, r2, r7 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080ED912 - adds r0, r3, r6 - adds r1, r4, r0 - ldrh r0, [r1, 0x16] - cmp r0, r5 - bcs _080ED90C - movs r0, 0 - strh r0, [r1, 0x16] - b _080ED91C - .pool -_080ED90C: - subs r0, r5 - strh r0, [r1, 0x16] - b _080ED91C -_080ED912: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x17 - bls _080ED8CE -_080ED91C: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80ED8B4 - - thumb_func_start UpdateMassOutbreakTimeLeft -UpdateMassOutbreakTimeLeft: @ 80ED924 - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r3, =0x00002ba2 - adds r1, r0, r3 - ldrh r0, [r1] - cmp r0, r2 - bhi _080ED948 - bl EndMassOutbreak - b _080ED94C - .pool -_080ED948: - subs r0, r2 - strh r0, [r1] -_080ED94C: - pop {r0} - bx r0 - thumb_func_end UpdateMassOutbreakTimeLeft - - thumb_func_start sub_80ED950 -sub_80ED950: @ 80ED950 - push {r4,lr} - lsls r0, 24 - cmp r0, 0 - beq _080ED978 - ldr r4, =0x0203a026 - ldrh r0, [r4] - lsrs r0, 8 - cmp r0, 0x4 - bls _080ED966 - bl sub_80ED9A8 -_080ED966: - ldrb r0, [r4] - strh r0, [r4] - cmp r0, 0xFF - beq _080ED99C - adds r0, 0x1 - b _080ED99A - .pool -_080ED978: - ldr r4, =0x0203a026 - ldrb r0, [r4] - cmp r0, 0x4 - bls _080ED984 - bl sub_80ED9A8 -_080ED984: - ldrh r0, [r4] - movs r1, 0xFF - lsls r1, 8 - ands r1, r0 - strh r1, [r4] - lsrs r0, r1, 8 - cmp r0, 0xFF - beq _080ED99C - movs r2, 0x80 - lsls r2, 1 - adds r0, r1, r2 -_080ED99A: - strh r0, [r4] -_080ED99C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ED950 - - thumb_func_start sub_80ED9A8 -sub_80ED9A8: @ 80ED9A8 - push {r4-r6,lr} - ldr r6, =0x03005d8c - ldr r0, [r6] - ldr r5, =0x000027cc - adds r0, r5 - bl sub_80EFB08 - ldr r4, =0x030060bc - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EDA18 - movs r0, 0x18 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EDA18 - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r4, [r6] - adds r4, r0 - movs r1, 0 - movs r0, 0x18 - strb r0, [r4] - strb r1, [r4, 0x1] - ldr r1, =0x0203a026 - ldrh r0, [r1] - strb r0, [r4, 0x2] - ldrh r0, [r1] - lsrs r0, 8 - strb r0, [r4, 0x3] - ldr r0, =0x0203a024 - ldrh r0, [r0] - strh r0, [r4, 0x4] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r4, 0x6] -_080EDA18: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ED9A8 - - thumb_func_start sub_80EDA3C -sub_80EDA3C: @ 80EDA3C - ldr r1, =0x0203a024 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_80EDA3C - - thumb_func_start sub_80EDA48 -sub_80EDA48: @ 80EDA48 - push {r4,lr} - ldr r4, =0x03005d8c - ldr r0, [r4] - ldr r2, =0x00002b2c - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0x19 - bne _080EDA6E - ldrh r0, [r1, 0x2] - cmp r0, 0x13 - bls _080EDA62 - bl sub_80EDA80 -_080EDA62: - ldr r0, [r4] - ldr r1, =0x000027cc - adds r0, r1 - movs r1, 0x18 - bl sub_80EF910 -_080EDA6E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EDA48 - - thumb_func_start sub_80EDA80 -sub_80EDA80: @ 80EDA80 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r7, =0x03005d8c - ldr r0, [r7] - ldr r1, =0x00002b2c - adds r5, r0, r1 - ldr r0, =0x0000ffff - bl sub_80EFB38 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _080EDB1C - ldr r0, [r7] - ldr r1, =0x000027cc - mov r8, r1 - add r0, r8 - bl sub_80EFB08 - ldr r4, =0x030060bc - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EDB1C - movs r0, 0x19 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EDB1C - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldr r4, [r7] - adds r4, r0 - movs r0, 0x19 - strb r0, [r4] - strb r6, [r4, 0x1] - ldrh r0, [r5, 0x2] - strh r0, [r4, 0x2] - movs r0, 0x5 - bl sub_80847F8 - ldrh r1, [r5, 0x6] - subs r0, r1 - strh r0, [r4, 0x6] - ldrh r0, [r5, 0x4] - strh r0, [r4, 0x4] - ldrh r0, [r5, 0x8] - strh r0, [r4, 0x8] - ldrb r0, [r5, 0xA] - strb r0, [r4, 0xA] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r4, 0xB] - ldr r0, [r7] - add r0, r8 - movs r1, 0x18 - bl sub_80EF910 -_080EDB1C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EDA80 - - thumb_func_start sub_80EDB44 -sub_80EDB44: @ 80EDB44 - push {r4-r7,lr} - movs r0, 0x1A - movs r1, 0x1 - bl sub_80EF46C - ldr r4, =0x03005d8c - ldr r0, [r4] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFB08 - ldr r2, =0x030060bc - strb r0, [r2] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EDC40 - movs r1, 0 - ldrsb r1, [r2, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r2, =0x000027cc - adds r0, r2 - ldr r1, [r4] - adds r4, r1, r0 - movs r1, 0 - movs r0, 0x1A - strb r0, [r4] - strb r1, [r4, 0x1] - ldr r6, =0x00000867 - movs r5, 0 -_080EDB88: - lsls r0, r6, 16 - lsrs r0, 16 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080EDB9C - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080EDB9C: - adds r6, 0x1 - ldr r0, =0x0000086e - cmp r6, r0 - bls _080EDB88 - strb r5, [r4, 0x4] - bl sub_809D42C - cmp r0, 0 - beq _080EDBCC - movs r0, 0x1 - bl pokedex_count - b _080EDBD2 - .pool -_080EDBCC: - movs r0, 0x1 - bl sub_80C0844 -_080EDBD2: - strh r0, [r4, 0x2] - ldr r1, =0x02037318 - ldrb r0, [r1, 0x14] - strb r0, [r4, 0x7] - ldrh r0, [r1, 0x12] - movs r1, 0 - strh r0, [r4, 0xA] - strb r1, [r4, 0x5] - strb r1, [r4, 0x6] - movs r6, 0 - adds r7, r4, 0 - adds r7, 0x13 -_080EDBEA: - ldr r0, =gUnknown_0858D0DE - lsls r5, r6, 1 - adds r0, r5, r0 - ldrh r0, [r0] - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080EDC04 - ldrb r0, [r4, 0x5] - adds r0, 0x1 - strb r0, [r4, 0x5] -_080EDC04: - ldr r0, =gUnknown_0858D0D0 - adds r0, r5, r0 - ldrh r0, [r0] - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080EDC1C - ldrb r0, [r4, 0x6] - adds r0, 0x1 - strb r0, [r4, 0x6] -_080EDC1C: - adds r6, 0x1 - cmp r6, 0x6 - bls _080EDBEA - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r2, =0x00000eb8 - adds r0, r1, r2 - ldrh r0, [r0] - strh r0, [r4, 0x8] - adds r0, r7, 0 - bl CopyString - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r4, 0xC] -_080EDC40: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EDB44 - - thumb_func_start sub_80EDC60 -sub_80EDC60: @ 80EDC60 - push {r4-r7,lr} - adds r5, r0, 0 - ldr r7, =0x03005d8c - ldr r0, [r7] - ldr r6, =0x000027cc - adds r0, r6 - bl sub_80EFB08 - ldr r4, =0x030060bc - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EDCCE - movs r0, 0x1B - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EDCCE - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldr r4, [r7] - adds r4, r0 - movs r1, 0 - movs r0, 0x1B - strb r0, [r4] - strb r1, [r4, 0x1] - ldr r1, =0x03005d90 - ldr r0, [r1] - ldrb r0, [r0, 0x8] - strb r0, [r4, 0x8] - ldrh r0, [r5] - strh r0, [r4, 0x4] - ldrh r0, [r5, 0x2] - strh r0, [r4, 0x6] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, [r1] - bl CopyString - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r4, 0x9] -_080EDCCE: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EDC60 - - thumb_func_start sub_80EDCE8 -sub_80EDCE8: @ 80EDCE8 - push {r4-r6,lr} - ldr r6, =0x03005d8c - ldr r0, [r6] - ldr r5, =0x000027cc - adds r0, r5 - bl sub_80EFB08 - ldr r4, =0x030060bc - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EDD56 - movs r0, 0x1C - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EDD56 - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r4, [r6] - adds r4, r0 - movs r1, 0 - movs r0, 0x1C - strb r0, [r4] - strb r1, [r4, 0x1] - ldr r0, =0x020375e2 - ldrh r0, [r0] - strh r0, [r4, 0x2] - ldr r1, =0x02037318 - ldrb r0, [r1, 0x14] - strb r0, [r4, 0x4] - ldrh r0, [r1, 0x12] - strh r0, [r4, 0x6] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r4, 0x5] -_080EDD56: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EDCE8 - - thumb_func_start sub_80EDD78 -sub_80EDD78: @ 80EDD78 - push {r4-r6,lr} - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFB08 - ldr r1, =0x030060bc - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EDE54 - movs r0, 0x1D - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EDE54 - movs r5, 0 - ldr r0, =0x0203a02a - ldrb r1, [r0] - adds r6, r0, 0 - cmp r1, 0 - beq _080EDDCC - cmp r1, 0x1 - beq _080EDDEE - b _080EDE54 - .pool -_080EDDCC: - ldr r0, =0x0203a028 - ldrh r1, [r0] - adds r0, r1, 0 - adds r0, 0xC8 - cmp r4, r0 - blt _080EDDE4 - movs r5, 0x1 - subs r0, r4, r1 - b _080EDE12 - .pool -_080EDDE4: - cmp r1, 0x63 - bls _080EDE54 - adds r0, r1, 0 - subs r0, 0x64 - b _080EDE0C -_080EDDEE: - ldr r0, =0x0203a028 - ldrh r1, [r0] - adds r0, r1, 0 - adds r0, 0x32 - cmp r4, r0 - blt _080EDE04 - movs r5, 0x1 - subs r0, r4, r1 - b _080EDE12 - .pool -_080EDE04: - cmp r1, 0x31 - bls _080EDE54 - adds r0, r1, 0 - subs r0, 0x32 -_080EDE0C: - cmp r4, r0 - bgt _080EDE54 - subs r0, r1, r4 -_080EDE12: - lsls r0, 16 - lsrs r3, r0, 16 - ldr r2, =0x03005d8c - ldr r0, =0x030060bc - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r4, [r2] - adds r4, r0 - movs r1, 0 - movs r0, 0x1D - strb r0, [r4] - strb r1, [r4, 0x1] - strh r3, [r4, 0x4] - ldrb r0, [r6] - strb r0, [r4, 0x3] - strb r5, [r4, 0x2] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r4, 0x8] -_080EDE54: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EDD78 - - thumb_func_start sub_80EDE70 -sub_80EDE70: @ 80EDE70 - ldr r2, =0x0203a02a - movs r1, 0 - strb r1, [r2] - ldr r1, =0x0203a028 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_80EDE70 - - thumb_func_start sub_80EDE84 -sub_80EDE84: @ 80EDE84 - ldr r2, =0x0203a02a - movs r1, 0x1 - strb r1, [r2] - ldr r1, =0x0203a028 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_80EDE84 - - thumb_func_start sub_80EDE98 -sub_80EDE98: @ 80EDE98 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r8, r0 - movs r3, 0 - ldr r6, =0x030060d0 - ldr r7, =0x03005d8c - adds r2, r6, 0 - movs r1, 0 -_080EDEAC: - adds r0, r3, r2 - strb r1, [r0] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0xF - bls _080EDEAC - movs r3, 0 - movs r5, 0 -_080EDEBE: - ldr r0, [r7] - ldr r1, =0x00001aae - adds r0, r1 - adds r0, r3 - ldrb r4, [r0] - adds r3, 0x1 - cmp r4, 0 - beq _080EDF0A - movs r1, 0 - ldrb r0, [r6] - cmp r0, 0 - bne _080EDEE8 - strb r4, [r6] - b _080EDF04 - .pool -_080EDEE8: - adds r0, r1, r6 - ldrb r0, [r0] - cmp r0, r4 - beq _080EDF0A - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bhi _080EDF0A - adds r2, r1, r6 - ldrb r0, [r2] - cmp r0, 0 - bne _080EDEE8 - strb r4, [r2] -_080EDF04: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080EDF0A: - lsls r0, r3, 24 - lsrs r3, r0, 24 - cmp r3, 0xF - bls _080EDEBE - cmp r5, 0x4 - bls _080EDF1E - movs r0, 0x4 - mov r1, r8 - strb r0, [r1, 0x3] - b _080EDF22 -_080EDF1E: - mov r0, r8 - strb r5, [r0, 0x3] -_080EDF22: - mov r1, r8 - ldrb r0, [r1, 0x3] - cmp r0, 0 - beq _080EDFA4 - cmp r0, 0x1 - bne _080EDF34 - ldrb r0, [r6] - strb r0, [r1, 0x4] - b _080EDFA4 -_080EDF34: - movs r6, 0 - adds r7, r5, 0 - muls r7, r5 - cmp r6, r7 - bge _080EDF7E - ldr r0, =0x030060d0 - mov r9, r0 -_080EDF42: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __modsi3 - lsls r0, 24 - lsrs r4, r0, 24 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __modsi3 - lsls r0, 24 - lsrs r1, r0, 24 - mov r0, r9 - adds r2, r4, r0 - ldrb r3, [r2] - add r1, r9 - ldrb r0, [r1] - strb r0, [r2] - strb r3, [r1] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, r7 - blt _080EDF42 -_080EDF7E: - movs r3, 0 - mov r1, r8 - ldrb r1, [r1, 0x3] - cmp r3, r1 - bcs _080EDFA4 - mov r2, r8 - adds r2, 0x4 - ldr r4, =0x030060d0 -_080EDF8E: - adds r1, r2, r3 - adds r0, r3, r4 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - mov r0, r8 - ldrb r0, [r0, 0x3] - cmp r3, r0 - bcc _080EDF8E -_080EDFA4: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EDE98 - - thumb_func_start sub_80EDFB4 -sub_80EDFB4: @ 80EDFB4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r10, r0 - movs r7, 0 - movs r0, 0 - mov r9, r0 - ldr r1, =0x030060c0 - mov r8, r1 -_080EDFCA: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _080EE094 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _080EE094 - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - ldr r2, =0x030060e0 - mov r3, r9 - lsls r1, r3, 3 - adds r6, r1, r2 - strb r0, [r6] - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - strh r0, [r6, 0x2] - movs r5, 0 - adds r0, r4, 0 - movs r1, 0xD - bl pokemon_getattr - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _080EE020 - mov r0, r8 - strh r1, [r0] - movs r5, 0x1 -_080EE020: - adds r0, r4, 0 - movs r1, 0xE - bl pokemon_getattr - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _080EE03C - lsls r0, r5, 1 - add r0, r8 - strh r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080EE03C: - adds r0, r4, 0 - movs r1, 0xF - bl pokemon_getattr - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _080EE058 - lsls r0, r5, 1 - add r0, r8 - strh r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080EE058: - adds r0, r4, 0 - movs r1, 0x10 - bl pokemon_getattr - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _080EE074 - lsls r0, r5, 1 - add r0, r8 - strh r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080EE074: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __modsi3 - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - strh r0, [r6, 0x4] - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_080EE094: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x5 - bls _080EDFCA - movs r7, 0 - movs r1, 0 - cmp r1, r9 - bcs _080EE0BE - ldr r2, =0x030060e0 -_080EE0A8: - lsls r0, r7, 3 - adds r0, r2 - ldrb r0, [r0] - adds r0, r1, r0 - lsls r0, 16 - lsrs r1, r0, 16 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, r9 - bcc _080EE0A8 -_080EE0BE: - adds r0, r1, 0 - mov r1, r9 - bl __divsi3 - mov r1, r10 - strb r0, [r1, 0x2] - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - mov r1, r9 - bl __modsi3 - lsls r0, 16 - ldr r1, =0x030060e0 - lsrs r0, 13 - adds r0, r1 - ldrh r1, [r0, 0x2] - mov r2, r10 - strh r1, [r2, 0x8] - ldrh r0, [r0, 0x4] - strh r0, [r2, 0xA] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EDFB4 - - thumb_func_start sub_80EE104 -sub_80EE104: @ 80EE104 - push {r4,lr} - movs r0, 0x1F - movs r1, 0x1 - bl sub_80EF46C - ldr r4, =0x03005d8c - ldr r0, [r4] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFB08 - ldr r2, =0x030060bc - strb r0, [r2] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EE168 - movs r1, 0 - ldrsb r1, [r2, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r4, [r4] - adds r4, r0 - movs r1, 0 - movs r0, 0x1F - strb r0, [r4] - strb r1, [r4, 0x1] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - adds r0, r4, 0 - bl sub_80EDE98 - adds r0, r4, 0 - bl sub_80EDFB4 - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r4, 0xC] -_080EE168: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EE104 - - thumb_func_start sub_80EE184 -sub_80EE184: @ 80EE184 - push {r4-r7,lr} - ldr r6, =0x03005d8c - ldr r0, [r6] - ldr r5, =0x000027cc - adds r0, r5 - bl sub_80EFB08 - ldr r4, =0x030060bc - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _080EE1A4 - b _080EE2C2 -_080EE1A4: - movs r0, 0x1E - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080EE1B6 - b _080EE2C2 -_080EE1B6: - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, [r6] - adds r4, r1, r0 - movs r1, 0 - movs r0, 0x1E - strb r0, [r4] - strb r1, [r4, 0x1] - movs r5, 0 - ldr r6, =0x03005d10 - ldr r3, =0x02037318 - ldr r7, =0x03005d90 - adds r2, r6, 0 - adds r2, 0x36 -_080EE1DA: - adds r0, r1, r2 - ldrb r0, [r0] - adds r0, r5, r0 - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xA - bls _080EE1DA - ldrb r1, [r6, 0x5] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080EE1FE - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_080EE1FE: - ldrb r0, [r3, 0x14] - strb r0, [r4, 0x4] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, [r7] - bl CopyString - ldrh r0, [r6, 0x6] - strh r0, [r4, 0xA] - ldr r0, =0x0202433a - ldrb r0, [r0] - subs r0, 0x1 - cmp r0, 0x9 - bhi _080EE282 - lsls r0, 2 - ldr r1, =_080EE244 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080EE244: - .4byte _080EE276 - .4byte _080EE26C - .4byte _080EE26C - .4byte _080EE27A - .4byte _080EE27A - .4byte _080EE27E - .4byte _080EE272 - .4byte _080EE27A - .4byte _080EE282 - .4byte _080EE27E -_080EE26C: - movs r0, 0 - strb r0, [r4] - b _080EE2C2 -_080EE272: - movs r0, 0 - b _080EE280 -_080EE276: - movs r0, 0x1 - b _080EE280 -_080EE27A: - movs r0, 0x2 - b _080EE280 -_080EE27E: - movs r0, 0x3 -_080EE280: - strb r0, [r4, 0x5] -_080EE282: - ldr r1, =0x03005d10 - ldrh r0, [r1, 0x20] - strh r0, [r4, 0x2] - ldrb r0, [r4, 0x5] - cmp r0, 0x1 - beq _080EE2B2 - cmp r0, 0x1 - bgt _080EE2B6 - cmp r0, 0 - bne _080EE2B6 - ldrb r1, [r1, 0x5] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080EE2A8 - movs r0, 0x1 - b _080EE2AC - .pool -_080EE2A8: - lsls r0, r1, 26 - lsrs r0, 28 -_080EE2AC: - strh r0, [r4, 0x6] - strh r5, [r4, 0x8] - b _080EE2B6 -_080EE2B2: - ldrh r0, [r1, 0x22] - strh r0, [r4, 0xC] -_080EE2B6: - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r4, 0xE] -_080EE2C2: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EE184 - - thumb_func_start sub_80EE2CC -sub_80EE2CC: @ 80EE2CC - push {r4-r6,lr} - ldr r6, =0x03005d8c - ldr r0, [r6] - ldr r5, =0x000027cc - adds r0, r5 - bl sub_80EFB08 - ldr r4, =0x030060bc - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EE33A - movs r0, 0x20 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EE33A - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r4, [r6] - adds r4, r0 - movs r1, 0 - movs r0, 0x20 - strb r0, [r4] - strb r1, [r4, 0x1] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - ldr r0, =0x020375e0 - ldrb r1, [r0] - movs r0, 0x4 - subs r0, r1 - strb r0, [r4, 0x4] - ldr r0, =0x020375e2 - ldrh r0, [r0] - strh r0, [r4, 0x2] - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r4, 0x5] -_080EE33A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EE2CC - - thumb_func_start sub_80EE35C -sub_80EE35C: @ 80EE35C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r7, r3, 0 - ldr r3, [sp, 0x24] - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - lsls r2, 24 - lsrs r6, r2, 24 - lsls r3, 16 - lsrs r3, 16 - str r3, [sp] - ldr r0, =0x03005d8c - mov r8, r0 - ldr r0, [r0] - ldr r5, =0x000027cc - adds r0, r5 - bl sub_80EFB08 - ldr r4, =0x030060bc - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EE426 - movs r0, 0x21 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EE426 - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r2, r8 - ldr r1, [r2] - adds r4, r1, r0 - movs r1, 0 - movs r0, 0x21 - strb r0, [r4] - strb r1, [r4, 0x1] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - mov r0, r10 - strh r0, [r4, 0x4] - mov r1, r9 - strh r1, [r4, 0x6] - lsls r0, r6, 1 - adds r0, r7 - ldrh r0, [r0] - strh r0, [r4, 0x2] - movs r2, 0 - movs r3, 0 - adds r5, r4, 0 - adds r5, 0x8 -_080EE3EE: - cmp r2, r6 - beq _080EE408 - lsls r0, r2, 1 - adds r0, r7 - ldrh r1, [r0] - cmp r1, 0 - beq _080EE408 - lsls r0, r3, 1 - adds r0, r5, r0 - strh r1, [r0] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 -_080EE408: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _080EE3EE - strb r3, [r4, 0x10] - mov r2, sp - ldrh r2, [r2] - strh r2, [r4, 0xE] - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r4, 0x11] -_080EE426: - 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_80EE35C - - thumb_func_start sub_80EE44C -sub_80EE44C: @ 80EE44C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r7, r1, 24 - ldr r6, =0x03005d8c - ldr r0, [r6] - ldr r5, =0x000027cc - adds r0, r5 - bl sub_80EFB08 - ldr r4, =0x030060bc - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EE4BE - movs r0, 0x27 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EE4BE - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r4, [r6] - adds r4, r0 - movs r1, 0 - movs r0, 0x27 - strb r0, [r4] - strb r1, [r4, 0x1] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - mov r0, r8 - strb r0, [r4, 0x2] - strb r7, [r4, 0x3] - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r4, 0x4] -_080EE4BE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EE44C - - thumb_func_start sub_80EE4DC -sub_80EE4DC: @ 80EE4DC - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - ldr r7, =0x03005d8c - ldr r0, [r7] - ldr r5, =0x000027cc - adds r0, r5 - bl sub_80EFB08 - ldr r4, =0x030060bc - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EE59A - movs r0, 0x23 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EE59A - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, [r7] - adds r5, r1, r0 - movs r1, 0 - movs r0, 0x23 - strb r0, [r5] - strb r1, [r5, 0x1] - adds r0, r5, 0 - adds r0, 0x13 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - adds r4, r5, 0x4 - adds r0, r6, 0 - movs r1, 0x2 - adds r2, r4, 0 - bl pokemon_getattr - adds r0, r4, 0 - bl StripExtendedControlCodes - adds r0, r6, 0 - bl sub_80EE5A4 - strb r0, [r5, 0x2] - mov r0, r8 - bl sub_80EE69C - strb r0, [r5, 0x3] - adds r0, r5, 0 - bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r5, 0xF] - cmp r0, 0x1 - beq _080EE578 - adds r0, r6, 0 - movs r1, 0x3 - bl pokemon_getattr - cmp r0, 0x1 - bne _080EE590 -_080EE578: - movs r0, 0x1 - b _080EE598 - .pool -_080EE590: - adds r0, r6, 0 - movs r1, 0x3 - bl pokemon_getattr -_080EE598: - strb r0, [r5, 0x10] -_080EE59A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80EE4DC - - thumb_func_start sub_80EE5A4 -sub_80EE5A4: @ 80EE5A4 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x32 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x33 - bl pokemon_getattr - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x34 - bl pokemon_getattr - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x35 - bl pokemon_getattr - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x36 - bl pokemon_getattr - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x43 - bl pokemon_getattr - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x44 - bl pokemon_getattr - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x45 - bl pokemon_getattr - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x46 - bl pokemon_getattr - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x47 - bl pokemon_getattr - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x48 - bl pokemon_getattr - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x49 - bl pokemon_getattr - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x4A - bl pokemon_getattr - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x4B - bl pokemon_getattr - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x4C - bl pokemon_getattr - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x4D - bl pokemon_getattr - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x4E - bl pokemon_getattr - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80EE5A4 - - thumb_func_start sub_80EE69C -sub_80EE69C: @ 80EE69C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x43 - beq _080EE722 - cmp r0, 0x32 - bne _080EE6AE - movs r0, 0x1 - b _080EE728 -_080EE6AE: - cmp r0, 0x33 - bne _080EE6B6 - movs r0, 0x5 - b _080EE728 -_080EE6B6: - cmp r0, 0x34 - bne _080EE6BE - movs r0, 0x9 - b _080EE728 -_080EE6BE: - cmp r0, 0x35 - bne _080EE6C6 - movs r0, 0xD - b _080EE728 -_080EE6C6: - cmp r0, 0x36 - bne _080EE6CE - movs r0, 0x11 - b _080EE728 -_080EE6CE: - cmp r0, 0x44 - bne _080EE6D6 - movs r0, 0x15 - b _080EE728 -_080EE6D6: - cmp r0, 0x45 - bne _080EE6DE - movs r0, 0x16 - b _080EE728 -_080EE6DE: - cmp r0, 0x46 - bne _080EE6E6 - movs r0, 0x17 - b _080EE728 -_080EE6E6: - cmp r0, 0x47 - bne _080EE6EE - movs r0, 0x18 - b _080EE728 -_080EE6EE: - cmp r0, 0x48 - bne _080EE6F6 - movs r0, 0x19 - b _080EE728 -_080EE6F6: - cmp r0, 0x49 - bne _080EE6FE - movs r0, 0x1A - b _080EE728 -_080EE6FE: - cmp r0, 0x4A - bne _080EE706 - movs r0, 0x1B - b _080EE728 -_080EE706: - cmp r0, 0x4B - bne _080EE70E - movs r0, 0x1C - b _080EE728 -_080EE70E: - cmp r0, 0x4C - bne _080EE716 - movs r0, 0x1D - b _080EE728 -_080EE716: - cmp r0, 0x4D - bne _080EE71E - movs r0, 0x1E - b _080EE728 -_080EE71E: - cmp r0, 0x4E - beq _080EE726 -_080EE722: - movs r0, 0 - b _080EE728 -_080EE726: - movs r0, 0x1F -_080EE728: - pop {r1} - bx r1 - thumb_func_end sub_80EE69C - - thumb_func_start sub_80EE72C -sub_80EE72C: @ 80EE72C - push {r4-r6,lr} - ldr r5, =0x03005d8c - ldr r0, [r5] - ldr r6, =0x000027cc - adds r0, r6 - bl sub_80EFB08 - ldr r4, =0x030060bc - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EE79C - movs r0, 0x22 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EE79C - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldr r4, [r5] - adds r4, r0 - movs r1, 0 - movs r0, 0x22 - strb r0, [r4] - strb r1, [r4, 0x1] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - ldr r0, [r5] - ldr r2, =0x00002bb0 - adds r1, r0, r2 - ldrh r1, [r1] - strh r1, [r4, 0x4] - ldr r1, =0x00002bb2 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r4, 0x6] - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r4, 0x8] -_080EE79C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EE72C - - thumb_func_start sub_80EE7C0 -sub_80EE7C0: @ 80EE7C0 - push {r4,lr} - ldr r4, =0x03005d8c - ldr r0, [r4] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFADC - ldr r1, =0x030060bc - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EE810 - movs r0, 0xB - bl sub_80EF550 - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0x1 - beq _080EE810 - ldr r0, [r4] - ldr r1, =0x00003150 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0xFF - beq _080EE810 - movs r0, 0 - b _080EE812 - .pool -_080EE810: - movs r0, 0x1 -_080EE812: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80EE7C0 - - thumb_func_start sub_80EE818 -sub_80EE818: @ 80EE818 - push {r4-r7,lr} - movs r0, 0x24 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080EE870 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000027cc - adds r7, r0, r1 - bl sub_80F0020 - adds r4, r0, 0 - movs r6, 0x5 - lsrs r5, r4, 8 -_080EE83C: - lsls r0, r6, 3 - adds r0, r6 - lsls r0, 2 - adds r1, r0, r7 - ldrb r0, [r1] - cmp r0, 0x24 - bne _080EE866 - movs r3, 0xFF - adds r0, r4, 0 - ands r0, r3 - adds r2, r1, 0 - adds r2, 0x22 - ldrb r2, [r2] - cmp r0, r2 - bne _080EE866 - adds r0, r5, 0 - ands r0, r3 - adds r1, 0x23 - ldrb r1, [r1] - cmp r0, r1 - beq _080EE89C -_080EE866: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x17 - bls _080EE83C -_080EE870: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFB08 - ldr r1, =0x030060bc - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EE8C0 - movs r0, 0x1 - b _080EE8C2 - .pool -_080EE89C: - ldr r5, =0x03005d8c - ldr r0, [r5] - ldr r4, =0x000027cc - adds r0, r4 - adds r1, r6, 0 - bl sub_80EF910 - ldr r0, [r5] - adds r0, r4 - bl sub_80EF93C - movs r0, 0x1 - b _080EE8C2 - .pool -_080EE8C0: - movs r0, 0 -_080EE8C2: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80EE818 - - thumb_func_start sub_80EE8C8 -sub_80EE8C8: @ 80EE8C8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 24 - lsrs r4, r1, 24 - ldr r5, =0x03005d8c - ldr r0, [r5] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFB08 - ldr r2, =0x030060bc - strb r0, [r2] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _080EE8F4 - b _080EEA52 -_080EE8F4: - movs r1, 0 - ldrsb r1, [r2, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r2, =0x000027cc - adds r0, r2 - ldr r1, [r5] - adds r7, r1, r0 - movs r1, 0 - movs r0, 0x24 - strb r0, [r7] - strb r1, [r7, 0x1] - adds r0, r7, 0 - adds r0, 0x13 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - strh r6, [r7, 0x2] - strb r4, [r7, 0xD] - subs r0, r4, 0x1 - cmp r0, 0xC - bls _080EE926 - b _080EEA46 -_080EE926: - lsls r0, 2 - ldr r1, =_080EE944 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080EE944: - .4byte _080EE978 - .4byte _080EE9A8 - .4byte _080EE9E8 - .4byte _080EEA00 - .4byte _080EE978 - .4byte _080EE978 - .4byte _080EE978 - .4byte _080EE978 - .4byte _080EE978 - .4byte _080EE978 - .4byte _080EE978 - .4byte _080EE978 - .4byte _080EE978 -_080EE978: - ldr r4, =0x020244ec - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0x4] - adds r0, r4, 0 - adds r0, 0x64 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0x6] - adds r4, 0xC8 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0x8] - b _080EEA46 - .pool -_080EE9A8: - ldr r4, =0x020244ec - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0x4] - adds r0, r4, 0 - adds r0, 0x64 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0x6] - adds r0, r4, 0 - adds r0, 0xC8 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0x8] - movs r1, 0x96 - lsls r1, 1 - adds r0, r4, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0xA] - b _080EEA46 - .pool -_080EE9E8: - ldr r4, =0x020244ec - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0x4] - adds r4, 0x64 - adds r0, r4, 0 - b _080EEA3C - .pool -_080EEA00: - ldr r2, =0x03005d8c - mov r8, r2 - ldr r6, =0x03005d90 - ldr r0, [r6] - ldr r1, =0x00000caa - adds r0, r1 - ldrh r0, [r0] - movs r5, 0x64 - adds r1, r0, 0 - muls r1, r5 - movs r4, 0xEA - lsls r4, 1 - adds r1, r4 - ldr r0, [r2] - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0x4] - ldr r0, [r6] - ldr r2, =0x00000cac - adds r0, r2 - ldrh r0, [r0] - adds r1, r0, 0 - muls r1, r5 - adds r1, r4 - mov r2, r8 - ldr r0, [r2] - adds r0, r1 -_080EEA3C: - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - strh r0, [r7, 0x6] -_080EEA46: - adds r0, r7, 0 - bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r7, 0xC] -_080EEA52: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EE8C8 - - thumb_func_start sub_80EEA70 -sub_80EEA70: @ 80EEA70 - push {r4-r7,lr} - sub sp, 0x20 - movs r0, 0x26 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080EEA86 - b _080EEB8C -_080EEA86: - ldr r7, =0x03005d8c - ldr r0, [r7] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFB08 - ldr r2, =0x030060bc - strb r0, [r2] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EEB8C - movs r1, 0 - ldrsb r1, [r2, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r7] - adds r5, r1, r0 - movs r1, 0 - movs r0, 0x26 - strb r0, [r5] - strb r1, [r5, 0x1] - adds r0, r5, 0 - adds r0, 0x13 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - ldr r0, =0x000040ec - bl VarGet - strh r0, [r5, 0x2] - bl sub_80E980C - ldr r1, =0x02021cc4 - mov r0, sp - bl CopyString - mov r0, sp - bl StripExtendedControlCodes - adds r0, r5, 0x4 - mov r1, sp - bl CopyString - ldr r0, =0x000040ed - bl VarGet - strh r0, [r5, 0x10] - ldr r0, =0x000040ee - bl VarGet - adds r4, r0, 0 - ldr r0, =0x000040ef - bl VarGet - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - adds r4, r0 - str r4, [r5, 0xC] - adds r0, r5, 0 - bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r5, 0x1B] - cmp r0, 0x1 - beq _080EEB3A - ldr r4, [r7] - ldr r6, =0x00004054 - adds r0, r6, 0 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 5 - adds r4, r1 - ldr r0, =0x00001aa9 - adds r4, r0 - ldrb r0, [r4] - cmp r0, 0x1 - bne _080EEB70 -_080EEB3A: - movs r0, 0x1 - b _080EEB8A - .pool -_080EEB70: - adds r0, r6, 0 - bl VarGet - ldr r2, [r7] - lsls r0, 16 - lsrs r0, 16 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 5 - adds r2, r1 - ldr r1, =0x00001aa9 - adds r2, r1 - ldrb r0, [r2] -_080EEB8A: - strb r0, [r5, 0x1C] -_080EEB8C: - add sp, 0x20 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EEA70 - - thumb_func_start sub_80EEB98 -sub_80EEB98: @ 80EEB98 - push {r4-r7,lr} - movs r5, 0 - ldr r6, =gUnknown_0858D0EC - adds r7, r6, 0x2 - b _080EEBAE - .pool -_080EEBA8: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080EEBAE: - cmp r5, 0x6 - bhi _080EEBCE - lsls r4, r5, 2 - adds r0, r4, r6 - ldrh r0, [r0] - bl VarGet - adds r4, r7 - lsls r0, 16 - lsrs r0, 16 - ldrh r4, [r4] - cmp r0, r4 - bcc _080EEBA8 - adds r0, r5, 0 - bl sub_80EEBF4 -_080EEBCE: - movs r5, 0 - ldr r4, =gUnknown_0858D0EC -_080EEBD2: - lsls r0, r5, 2 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0 - bl VarSet - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x6 - bls _080EEBD2 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EEB98 - - thumb_func_start sub_80EEBF4 -sub_80EEBF4: @ 80EEBF4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x25 - movs r1, 0x1 - bl sub_80EF46C - ldr r4, =0x03005d8c - ldr r0, [r4] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFB08 - ldr r2, =0x030060bc - strb r0, [r2] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EEC60 - movs r1, 0 - ldrsb r1, [r2, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r4, [r4] - adds r4, r0 - movs r1, 0 - movs r0, 0x25 - strb r0, [r4] - strb r1, [r4, 0x1] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - strb r5, [r4, 0x4] - ldr r1, =gUnknown_0858D0EC - lsls r0, r5, 2 - adds r0, r1 - ldrh r0, [r0] - bl VarGet - strh r0, [r4, 0x2] - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r4, 0x5] -_080EEC60: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EEBF4 - - thumb_func_start sub_80EEC80 -sub_80EEC80: @ 80EEC80 - push {r4,lr} - ldr r4, =0x000040e6 - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EEC80 - - thumb_func_start sub_80EECA4 -sub_80EECA4: @ 80EECA4 - push {r4,lr} - ldr r4, =0x000040eb - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EECA4 - - thumb_func_start sub_80EECC8 -sub_80EECC8: @ 80EECC8 - push {r4,lr} - ldr r4, =0x000040e7 - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EECC8 - - thumb_func_start sub_80EECEC -sub_80EECEC: @ 80EECEC - push {r4,lr} - ldr r4, =0x000040e8 - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EECEC - - thumb_func_start sub_80EED10 -sub_80EED10: @ 80EED10 - push {r4,lr} - ldr r4, =0x000040e9 - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EED10 - - thumb_func_start sub_80EED34 -sub_80EED34: @ 80EED34 - push {r4,lr} - ldr r4, =0x000040ea - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - ldr r0, =0x020375e4 - ldrh r0, [r0] - adds r1, r0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EED34 - - thumb_func_start sub_80EED60 -sub_80EED60: @ 80EED60 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r5, =0x000040f1 - adds r0, r5, 0 - bl VarGet - adds r4, r0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl VarSet - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EED60 - - thumb_func_start sub_80EED88 -sub_80EED88: @ 80EED88 - push {r4-r7,lr} - ldr r0, =0x00000864 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080EEE0C - ldr r6, =0x03005d8c - ldr r0, [r6] - ldr r7, =0x00002b50 - adds r0, r7 - bl sub_80EEE30 - ldr r5, =0x030060bc - strb r0, [r5] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EEE0C - ldr r0, =0x0000028f - bl sub_80EFB38 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EEE0C - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - ands r0, r1 - adds r4, r0, 0x1 - adds r0, r4, 0 - bl sub_80EF0E4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EEE0C - ldr r1, [r6] - movs r0, 0 - ldrsb r0, [r5, r0] - lsls r0, 2 - adds r1, r0 - adds r1, r7 - strb r4, [r1] - ldr r2, [r6] - movs r0, 0 - ldrsb r0, [r5, r0] - lsls r0, 2 - adds r0, r2, r0 - ldr r1, =0x00002b52 - adds r0, r1 - movs r1, 0x4 - strh r1, [r0] - movs r0, 0 - ldrsb r0, [r5, r0] - lsls r0, 2 - adds r2, r0 - ldr r0, =0x00002b51 - adds r2, r0 - movs r0, 0x1 - strb r0, [r2] -_080EEE0C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EED88 - - thumb_func_start sub_80EEE30 -sub_80EEE30: @ 80EEE30 - push {lr} - adds r2, r0, 0 - movs r1, 0 -_080EEE36: - lsls r0, r1, 24 - asrs r1, r0, 24 - lsls r0, r1, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080EEE48 - adds r0, r1, 0 - b _080EEE58 -_080EEE48: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - asrs r0, 24 - cmp r0, 0xF - ble _080EEE36 - movs r0, 0x1 - negs r0, r0 -_080EEE58: - pop {r1} - bx r1 - thumb_func_end sub_80EEE30 - - thumb_func_start sub_80EEE5C -sub_80EEE5C: @ 80EEE5C - push {r4,lr} - movs r4, 0 -_080EEE60: - adds r0, r4, 0 - bl sub_80EEE78 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _080EEE60 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80EEE5C - - thumb_func_start sub_80EEE78 -sub_80EEE78: @ 80EEE78 - push {r4,lr} - lsls r0, 24 - ldr r3, =0x03005d8c - ldr r1, [r3] - lsrs r0, 22 - adds r1, r0 - ldr r2, =0x00002b50 - adds r1, r2 - movs r2, 0 - strb r2, [r1] - ldr r1, [r3] - adds r1, r0 - ldr r4, =0x00002b51 - adds r1, r4 - strb r2, [r1] - ldr r1, [r3] - adds r1, r0 - ldr r0, =0x00002b52 - adds r1, r0 - strh r2, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EEE78 - - thumb_func_start sub_80EEEB8 -sub_80EEEB8: @ 80EEEB8 - push {r4-r7,lr} - movs r2, 0 - ldr r6, =0x03005d8c -_080EEEBE: - ldr r0, =0x03005d8c - ldr r0, [r0] - lsls r1, r2, 2 - adds r0, r1 - ldr r3, =0x00002b50 - adds r0, r3 - ldrb r0, [r0] - adds r5, r2, 0x1 - cmp r0, 0 - bne _080EEF12 - lsls r0, r5, 24 - b _080EEF0C - .pool -_080EEEE0: - ldr r3, [r6] - lsls r4, r2, 2 - adds r0, r3, r4 - ldr r7, =0x00002b50 - adds r0, r7 - ldrb r0, [r0] - cmp r0, 0 - beq _080EEF08 - adds r0, r3, r7 - adds r1, r0, r1 - adds r0, r4 - ldr r0, [r0] - str r0, [r1] - adds r0, r2, 0 - bl sub_80EEE78 - b _080EEF12 - .pool -_080EEF08: - adds r0, r2, 0x1 - lsls r0, 24 -_080EEF0C: - lsrs r2, r0, 24 - cmp r2, 0xF - bls _080EEEE0 -_080EEF12: - lsls r0, r5, 24 - lsrs r2, r0, 24 - cmp r2, 0xE - bls _080EEEBE - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80EEEB8 - - thumb_func_start sub_80EEF20 -sub_80EEF20: @ 80EEF20 - push {r4,lr} - movs r2, 0 - ldr r0, =0x03005d8c - ldr r3, [r0] -_080EEF28: - lsls r0, r2, 2 - adds r1, r3, r0 - ldr r4, =0x00002b50 - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _080EEF58 - adds r4, 0x1 - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080EEF58 - adds r4, 0x1 - adds r0, r1, r4 - ldrh r0, [r0] - cmp r0, 0x2 - bhi _080EEF58 - adds r0, r2, 0 - b _080EEF64 - .pool -_080EEF58: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bls _080EEF28 - movs r0, 0xFF -_080EEF64: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80EEF20 - - thumb_func_start sub_80EEF6C -sub_80EEF6C: @ 80EEF6C - push {r4,r5,lr} - bl sub_80EEF20 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - bne _080EEF84 - ldr r1, =0x020375f0 - movs r0, 0 - b _080EF01A - .pool -_080EEF84: - ldr r5, =0x03005d8c - ldr r0, [r5] - lsls r4, r2, 2 - adds r1, r0, r4 - ldr r0, =0x00002b52 - adds r2, r1, r0 - ldrh r0, [r2] - cmp r0, 0 - bne _080EEFE8 - ldr r2, =0x00002b51 - adds r1, r2 - movs r0, 0x2 - strb r0, [r1] - ldr r0, =0x03005cf8 - ldrb r0, [r0, 0x2] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x13 - bgt _080EEFC8 - ldr r1, =gUnknown_0858D11C - ldr r0, [r5] - adds r0, r4 - subs r2, 0x1 - b _080EEFD0 - .pool -_080EEFC8: - ldr r1, =gUnknown_0858D130 - ldr r0, [r5] - adds r0, r4 - ldr r2, =0x00002b50 -_080EEFD0: - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl box_related_two__2 - b _080EF016 - .pool -_080EEFE8: - ldrh r1, [r2] - ldr r0, =0x02021cc4 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalString - ldr r0, [r5] - adds r0, r4 - ldr r1, =0x00002b51 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r1, =gUnknown_0858D108 - ldr r0, [r5] - adds r0, r4 - ldr r2, =0x00002b50 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl box_related_two__2 -_080EF016: - ldr r1, =0x020375f0 - movs r0, 0x1 -_080EF01A: - strh r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EEF6C - - thumb_func_start GetPriceReduction -GetPriceReduction: @ 80EF038 - push {r4,r5,lr} - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - bne _080EF048 - b _080EF08A -_080EF044: - movs r0, 0x1 - b _080EF08C -_080EF048: - movs r2, 0 - ldr r4, =0x03005d8c -_080EF04C: - ldr r1, [r4] - lsls r0, r2, 2 - adds r1, r0 - ldr r5, =0x00002b50 - adds r0, r1, r5 - ldrb r0, [r0] - cmp r0, r3 - bne _080EF080 - ldr r2, =0x00002b51 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x2 - bne _080EF08A - adds r0, r3, 0 - bl IsPriceDiscounted - lsls r0, 24 - cmp r0, 0 - bne _080EF044 - b _080EF08A - .pool -_080EF080: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bls _080EF04C -_080EF08A: - movs r0, 0 -_080EF08C: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end GetPriceReduction - - thumb_func_start IsPriceDiscounted -IsPriceDiscounted: @ 80EF094 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EF0A6 - cmp r0, 0x3 - beq _080EF0C8 -_080EF0A2: - movs r0, 0x1 - b _080EF0D6 -_080EF0A6: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - movs r0, 0x80 - lsls r0, 1 - cmp r1, r0 - bne _080EF0D4 - ldr r0, =0x020375f2 - ldrh r0, [r0] - cmp r0, 0x19 - beq _080EF0A2 - b _080EF0D4 - .pool -_080EF0C8: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - ldr r0, =0x0000150d - cmp r1, r0 - beq _080EF0A2 -_080EF0D4: - movs r0, 0 -_080EF0D6: - pop {r1} - bx r1 - .pool - thumb_func_end IsPriceDiscounted - - thumb_func_start sub_80EF0E4 -sub_80EF0E4: @ 80EF0E4 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - bne _080EF0F2 -_080EF0EE: - movs r0, 0x1 - b _080EF112 -_080EF0F2: - movs r1, 0 - ldr r0, =0x03005d8c - ldr r3, [r0] - ldr r4, =0x00002b50 -_080EF0FA: - lsls r0, r1, 2 - adds r0, r3, r0 - adds r0, r4 - ldrb r0, [r0] - cmp r0, r2 - beq _080EF0EE - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bls _080EF0FA - movs r0, 0 -_080EF112: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80EF0E4 - - thumb_func_start sub_80EF120 -sub_80EF120: @ 80EF120 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r7, r0, 16 - movs r6, 0 - ldr r0, =0x03005d8c - mov r8, r0 -_080EF130: - mov r1, r8 - ldr r0, [r1] - lsls r1, r6, 2 - adds r2, r0, r1 - ldr r3, =0x00002b50 - adds r0, r2, r3 - ldrb r0, [r0] - adds r4, r1, 0 - cmp r0, 0 - beq _080EF196 - ldr r1, =0x00002b52 - adds r0, r2, r1 - ldrh r0, [r0] - cmp r0, r7 - bcs _080EF164 - adds r0, r6, 0 - bl sub_80EEE78 - b _080EF196 - .pool -_080EF164: - ldr r5, =0x00002b51 - adds r0, r2, r5 - ldrb r0, [r0] - cmp r0, 0 - bne _080EF186 - ldr r0, =0x00000864 - bl FlagGet - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1 - bne _080EF186 - mov r2, r8 - ldr r0, [r2] - adds r0, r4 - adds r0, r5 - strb r1, [r0] -_080EF186: - mov r3, r8 - ldr r1, [r3] - adds r1, r4 - ldr r0, =0x00002b52 - adds r1, r0 - ldrh r0, [r1] - subs r0, r7 - strh r0, [r1] -_080EF196: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0xF - bls _080EF130 - bl sub_80EEEB8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EF120 - - thumb_func_start sub_80EF1BC -sub_80EF1BC: @ 80EF1BC - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - adds r2, r1, 0 - cmp r1, 0x1 - beq _080EF1FC - cmp r1, 0x1 - bgt _080EF1D6 - cmp r1, 0 - beq _080EF1E0 - b _080EF244 -_080EF1D6: - cmp r2, 0x2 - beq _080EF218 - cmp r2, 0x3 - beq _080EF234 - b _080EF244 -_080EF1E0: - ldr r1, =gUnknown_0858D144 - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =gUnknown_0858BAF0 - ldr r1, [r1, 0x14] - bl CopyString - b _080EF244 - .pool -_080EF1FC: - ldr r1, =gUnknown_0858D144 - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =gUnknown_0858BAF0 - ldr r1, [r1, 0x18] - bl CopyString - b _080EF244 - .pool -_080EF218: - ldr r1, =gUnknown_0858D144 - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =gUnknown_0858BAF0 - ldr r1, [r1, 0x1C] - bl CopyString - b _080EF244 - .pool -_080EF234: - ldr r1, =gUnknown_0858D144 - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =gUnknown_0858BAF0 - ldr r1, [r1, 0x20] - bl CopyString -_080EF244: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EF1BC - - thumb_func_start CopyContestCategoryToStringVar -@ void CopyContestCategoryToStringVar(u8 stringVarIndex, u8 contestCategoryId) -CopyContestCategoryToStringVar: @ 80EF250 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r0, r1, 24 - cmp r0, 0x4 - bhi _080EF300 - lsls r0, 2 - ldr r1, =_080EF26C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080EF26C: - .4byte _080EF280 - .4byte _080EF29C - .4byte _080EF2B8 - .4byte _080EF2D4 - .4byte _080EF2F0 -_080EF280: - ldr r1, =gUnknown_0858D144 - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =gUnknown_0858BAF0 - ldr r1, [r1] - bl CopyString - b _080EF300 - .pool -_080EF29C: - ldr r1, =gUnknown_0858D144 - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =gUnknown_0858BAF0 - ldr r1, [r1, 0x4] - bl CopyString - b _080EF300 - .pool -_080EF2B8: - ldr r1, =gUnknown_0858D144 - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =gUnknown_0858BAF0 - ldr r1, [r1, 0x8] - bl CopyString - b _080EF300 - .pool -_080EF2D4: - ldr r1, =gUnknown_0858D144 - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =gUnknown_0858BAF0 - ldr r1, [r1, 0xC] - bl CopyString - b _080EF300 - .pool -_080EF2F0: - ldr r1, =gUnknown_0858D144 - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =gUnknown_0858BAF0 - ldr r1, [r1, 0x10] - bl CopyString -_080EF300: - pop {r0} - bx r0 - .pool - thumb_func_end CopyContestCategoryToStringVar - - thumb_func_start SetContestCategoryStringVarForInterview -@ void SetContestCategoryStringVarForInterview() -SetContestCategoryStringVarForInterview: @ 80EF30C - push {lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r1, r0 - ldrb r1, [r1, 0x13] - lsls r1, 29 - lsrs r1, 29 - movs r0, 0x1 - bl CopyContestCategoryToStringVar - pop {r0} - bx r0 - .pool - thumb_func_end SetContestCategoryStringVarForInterview - - thumb_func_start sub_80EF340 -sub_80EF340: @ 80EF340 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - bl sub_80EF370 - adds r3, r0, 0 - ldr r0, =gUnknown_0858D144 - lsls r4, 2 - adds r4, r0 - ldr r0, [r4] - lsls r3, 24 - lsrs r3, 24 - adds r1, r5, 0 - movs r2, 0 - bl ConvertIntToDecimalString - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EF340 - - thumb_func_start sub_80EF370 -sub_80EF370: @ 80EF370 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0xA - bl __divsi3 - cmp r0, 0 - beq _080EF3FC - adds r0, r4, 0 - movs r1, 0x64 - bl __divsi3 - cmp r0, 0 - bne _080EF38E - movs r0, 0x2 - b _080EF406 -_080EF38E: - movs r1, 0xFA - lsls r1, 2 - adds r0, r4, 0 - bl __divsi3 - cmp r0, 0 - bne _080EF3A0 - movs r0, 0x3 - b _080EF406 -_080EF3A0: - ldr r1, =0x00002710 - adds r0, r4, 0 - bl __divsi3 - cmp r0, 0 - bne _080EF3B4 - movs r0, 0x4 - b _080EF406 - .pool -_080EF3B4: - ldr r1, =0x000186a0 - adds r0, r4, 0 - bl __divsi3 - cmp r0, 0 - bne _080EF3C8 - movs r0, 0x5 - b _080EF406 - .pool -_080EF3C8: - ldr r1, =0x000f4240 - adds r0, r4, 0 - bl __divsi3 - cmp r0, 0 - bne _080EF3DC - movs r0, 0x6 - b _080EF406 - .pool -_080EF3DC: - ldr r1, =0x00989680 - adds r0, r4, 0 - bl __divsi3 - cmp r0, 0 - bne _080EF3F0 - movs r0, 0x7 - b _080EF406 - .pool -_080EF3F0: - ldr r1, =0x05f5e100 - adds r0, r4, 0 - bl __divsi3 - cmp r0, 0 - beq _080EF404 -_080EF3FC: - movs r0, 0x1 - b _080EF406 - .pool -_080EF404: - movs r0, 0x8 -_080EF406: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80EF370 - - thumb_func_start sub_80EF40C -sub_80EF40C: @ 80EF40C - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r1, 0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r7, 0 - movs r5, 0 -_080EF41E: - lsls r4, r5, 1 - adds r0, r6, 0x6 - adds r1, r0, r4 - ldrh r0, [r1] - cmp r0, 0 - beq _080EF43E - bl itemid_get_market_price - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - adds r1, 0xC - adds r1, r4 - ldrh r1, [r1] - muls r0, r1 - adds r7, r0 -_080EF43E: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _080EF41E - ldrb r0, [r6, 0x2] - cmp r0, 0x1 - bne _080EF458 - asrs r1, r7, 1 - mov r0, r8 - bl sub_80EF340 - b _080EF460 -_080EF458: - mov r0, r8 - adds r1, r7, 0 - bl sub_80EF340 -_080EF460: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80EF40C - - thumb_func_start sub_80EF46C -sub_80EF46C: @ 80EF46C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - ldr r5, =0x03005d8c - ldr r0, [r5] - ldr r4, =0x000027cc - adds r0, r4 - mov r8, r0 - bl sub_80F0020 - adds r7, r0, 0 - movs r6, 0x5 -_080EF494: - lsls r0, r6, 3 - adds r0, r6 - lsls r0, 2 - mov r2, r8 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, r10 - bne _080EF4E4 - movs r3, 0xFF - adds r0, r7, 0 - ands r0, r3 - adds r2, r1, 0 - adds r2, 0x22 - ldrb r2, [r2] - cmp r0, r2 - bne _080EF4E4 - lsrs r0, r7, 8 - ands r0, r3 - adds r1, 0x23 - ldrb r1, [r1] - cmp r0, r1 - bne _080EF4E4 - mov r0, r9 - cmp r0, 0x1 - bne _080EF4D8 - ldr r0, [r5] - adds r0, r4 - adds r1, r6, 0 - bl sub_80EF910 - ldr r0, [r5] - adds r0, r4 - bl sub_80EF93C -_080EF4D8: - movs r0, 0x1 - b _080EF4F0 - .pool -_080EF4E4: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x17 - bls _080EF494 - movs r0, 0 -_080EF4F0: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80EF46C - - thumb_func_start sub_80EF500 -sub_80EF500: @ 80EF500 - push {r4-r7,lr} - movs r2, 0 -_080EF504: - adds r1, r2, 0x1 - lsls r0, r1, 24 - lsrs r5, r0, 24 - adds r7, r1, 0 - cmp r5, 0x2 - bhi _080EF53C - ldr r6, =0x02039f80 - lsls r0, r2, 2 - adds r4, r0, r6 -_080EF516: - lsls r0, r5, 2 - adds r3, r0, r6 - ldrh r0, [r4, 0x2] - ldrh r1, [r3, 0x2] - cmp r0, r1 - bcs _080EF532 - ldrh r1, [r4] - adds r2, r0, 0 - ldrh r0, [r3] - strh r0, [r4] - ldrh r0, [r3, 0x2] - strh r0, [r4, 0x2] - strh r1, [r3] - strh r2, [r3, 0x2] -_080EF532: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _080EF516 -_080EF53C: - lsls r0, r7, 24 - lsrs r2, r0, 24 - cmp r2, 0x1 - bls _080EF504 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EF500 - - thumb_func_start sub_80EF550 -sub_80EF550: @ 80EF550 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r1, 0 - ldr r5, =0x03005d8c - ldr r4, =0x000027cc -_080EF55C: - ldr r3, [r5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r2, r3, r0 - adds r0, r2, r4 - ldrb r0, [r0] - cmp r0, r6 - bne _080EF5A4 - ldr r6, =0x000027cd - adds r0, r2, r6 - ldrb r2, [r0] - cmp r2, 0x1 - bne _080EF590 - ldr r0, =0x020375f0 - strh r2, [r0] - b _080EF5B2 - .pool -_080EF590: - adds r0, r3, r4 - bl sub_80EF910 - ldr r0, [r5] - adds r0, r4 - bl sub_80EF93C - bl sub_80EFA88 - b _080EF5B2 -_080EF5A4: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x4 - bls _080EF55C - bl sub_80EFA88 -_080EF5B2: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80EF550 - - thumb_func_start InterviewBefore -InterviewBefore: @ 80EF5B8 - push {lr} - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x020375e2 - ldrh r0, [r0] - subs r0, 0x1 - cmp r0, 0xA - bhi _080EF646 - lsls r0, 2 - ldr r1, =_080EF5E0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080EF5E0: - .4byte _080EF60C - .4byte _080EF612 - .4byte _080EF618 - .4byte _080EF61E - .4byte _080EF624 - .4byte _080EF62A - .4byte _080EF630 - .4byte _080EF636 - .4byte _080EF63C - .4byte _080EF646 - .4byte _080EF642 -_080EF60C: - bl sub_80EF64C - b _080EF646 -_080EF612: - bl sub_80EF6C4 - b _080EF646 -_080EF618: - bl sub_80EF704 - b _080EF646 -_080EF61E: - bl sub_80EF79C - b _080EF646 -_080EF624: - bl sub_80EF7A8 - b _080EF646 -_080EF62A: - bl sub_80EF7B4 - b _080EF646 -_080EF630: - bl sub_80EF80C - b _080EF646 -_080EF636: - bl sub_80EF7F4 - b _080EF646 -_080EF63C: - bl sub_80EF800 - b _080EF646 -_080EF642: - bl sub_80EF84C -_080EF646: - pop {r0} - bx r0 - thumb_func_end InterviewBefore - - thumb_func_start sub_80EF64C -sub_80EF64C: @ 80EF64C - push {r4,lr} - movs r0, 0x1 - bl sub_80EF550 - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0 - bne _080EF6A0 - ldr r4, =0x02021cc4 - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - movs r1, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r4, 0 - bl CopyString - ldr r2, =0x03005d8c - ldr r0, =0x030060bc - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, [r2] - adds r0, r1 - ldr r1, =0x000027d0 - adds r0, r1 - movs r1, 0x6 - bl sub_811F88C -_080EF6A0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EF64C - - thumb_func_start sub_80EF6C4 -sub_80EF6C4: @ 80EF6C4 - push {lr} - movs r0, 0x2 - bl sub_80EF550 - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0 - bne _080EF6F0 - ldr r2, =0x03005d8c - ldr r0, =0x030060bc - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, [r2] - adds r0, r1 - ldr r1, =0x000027d0 - adds r0, r1 - movs r1, 0x6 - bl sub_811F88C -_080EF6F0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EF6C4 - - thumb_func_start sub_80EF704 -sub_80EF704: @ 80EF704 - push {r4-r6,lr} - movs r0, 0x3 - bl sub_80EF550 - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0 - bne _080EF774 - ldr r6, =0x02021cc4 - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - movs r1, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r6, 0 - bl CopyString - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - muls r0, r5 - adds r0, r4 - ldr r4, =0x02021dc4 - movs r1, 0x2 - adds r2, r4, 0 - bl pokemon_getattr - adds r0, r4, 0 - bl GetStringEnd_Limit7 - ldr r2, =0x03005d8c - ldr r0, =0x030060bc - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, [r2] - adds r0, r1 - ldr r1, =0x000027e8 - adds r0, r1 - movs r1, 0x2 - bl sub_811F88C -_080EF774: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EF704 - - thumb_func_start sub_80EF79C -sub_80EF79C: @ 80EF79C - ldr r1, =0x020375f0 - movs r0, 0x1 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_80EF79C - - thumb_func_start sub_80EF7A8 -sub_80EF7A8: @ 80EF7A8 - push {lr} - movs r0, 0x5 - bl sub_80EF550 - pop {r0} - bx r0 - thumb_func_end sub_80EF7A8 - - thumb_func_start sub_80EF7B4 -sub_80EF7B4: @ 80EF7B4 - push {lr} - movs r0, 0x6 - bl sub_80EF550 - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0 - bne _080EF7E0 - ldr r2, =0x03005d8c - ldr r0, =0x030060bc - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, [r2] - adds r0, r1 - ldr r1, =0x000027d0 - adds r0, r1 - movs r1, 0x2 - bl sub_811F88C -_080EF7E0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EF7B4 - - thumb_func_start sub_80EF7F4 -sub_80EF7F4: @ 80EF7F4 - push {lr} - movs r0, 0x8 - bl sub_80EF550 - pop {r0} - bx r0 - thumb_func_end sub_80EF7F4 - - thumb_func_start sub_80EF800 -sub_80EF800: @ 80EF800 - push {lr} - movs r0, 0x9 - bl sub_80EF550 - pop {r0} - bx r0 - thumb_func_end sub_80EF800 - - thumb_func_start sub_80EF80C -sub_80EF80C: @ 80EF80C - push {lr} - movs r0, 0x7 - bl sub_80EF550 - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0 - bne _080EF838 - ldr r2, =0x03005d8c - ldr r0, =0x030060bc - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, [r2] - adds r0, r1 - ldr r1, =0x000027e4 - adds r0, r1 - movs r1, 0x1 - bl sub_811F88C -_080EF838: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EF80C - - thumb_func_start sub_80EF84C -sub_80EF84C: @ 80EF84C - push {lr} - movs r0, 0xB - bl sub_80EF550 - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0 - bne _080EF878 - ldr r2, =0x03005d8c - ldr r0, =0x030060bc - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, [r2] - adds r0, r1 - ldr r1, =0x000027e0 - adds r0, r1 - movs r1, 0x1 - bl sub_811F88C -_080EF878: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EF84C - - thumb_func_start sub_80EF88C -sub_80EF88C: @ 80EF88C - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - ldr r6, =0x02021cc4 - adds r0, r5, 0 - movs r1, 0x2 - adds r2, r6, 0 - bl pokemon_getattr - mov r4, sp - adds r0, r5, 0 - movs r1, 0x3 - mov r2, sp - bl pokemon_getattr - strb r0, [r4] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _080EF8EC - adds r0, r5, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - movs r1, 0xB - muls r0, r1 - ldr r1, =gSpeciesNames - adds r0, r1 - adds r1, r6, 0 - bl CompareString - cmp r0, 0 - bne _080EF8EC - movs r0, 0 - b _080EF8EE - .pool -_080EF8EC: - movs r0, 0x1 -_080EF8EE: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80EF88C - - thumb_func_start sub_80EF8F8 -sub_80EF8F8: @ 80EF8F8 - push {lr} - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - bl sub_80EF88C - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_80EF8F8 - - thumb_func_start sub_80EF910 -sub_80EF910: @ 80EF910 - push {lr} - lsls r1, 24 - lsrs r1, 24 - lsls r2, r1, 3 - adds r2, r1 - lsls r2, 2 - adds r2, r0 - movs r0, 0 - strb r0, [r2] - strb r0, [r2, 0x1] - movs r1, 0 - adds r2, 0x2 - movs r3, 0 -_080EF92A: - adds r0, r2, r1 - strb r3, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x21 - bls _080EF92A - pop {r0} - bx r0 - thumb_func_end sub_80EF910 - - thumb_func_start sub_80EF93C -sub_80EF93C: @ 80EF93C - push {r4-r7,lr} - adds r4, r0, 0 - movs r5, 0 -_080EF942: - lsls r0, r5, 3 - adds r0, r5 - lsls r1, r0, 2 - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _080EF986 - adds r0, r5, 0x1 - b _080EF97E -_080EF954: - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r3, r0, r4 - ldrb r0, [r3] - cmp r0, 0 - beq _080EF97C - adds r1, r4 - adds r0, r3, 0 - ldm r0!, {r3,r6,r7} - stm r1!, {r3,r6,r7} - ldm r0!, {r3,r6,r7} - stm r1!, {r3,r6,r7} - ldm r0!, {r3,r6,r7} - stm r1!, {r3,r6,r7} - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_80EF910 - b _080EF986 -_080EF97C: - adds r0, r2, 0x1 -_080EF97E: - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x4 - bls _080EF954 -_080EF986: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _080EF942 - movs r5, 0x5 -_080EF992: - lsls r0, r5, 3 - adds r0, r5 - lsls r1, r0, 2 - adds r0, r1, r4 - ldrb r0, [r0] - adds r5, 0x1 - cmp r0, 0 - bne _080EF9D8 - lsls r0, r5, 24 - b _080EF9D2 -_080EF9A6: - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r3, r0, r4 - ldrb r0, [r3] - cmp r0, 0 - beq _080EF9CE - adds r1, r4 - adds r0, r3, 0 - ldm r0!, {r3,r6,r7} - stm r1!, {r3,r6,r7} - ldm r0!, {r3,r6,r7} - stm r1!, {r3,r6,r7} - ldm r0!, {r3,r6,r7} - stm r1!, {r3,r6,r7} - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_80EF910 - b _080EF9D8 -_080EF9CE: - adds r0, r2, 0x1 - lsls r0, 24 -_080EF9D2: - lsrs r2, r0, 24 - cmp r2, 0x17 - bls _080EF9A6 -_080EF9D8: - lsls r0, r5, 24 - lsrs r5, r0, 24 - cmp r5, 0x17 - bls _080EF992 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80EF93C - - thumb_func_start sub_80EF9E8 -sub_80EF9E8: @ 80EF9E8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r0, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, 16 - lsrs r0, 16 - bl sub_80EFA24 - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - ldr r0, =gUnknown_0858D144 - lsls r4, 2 - adds r4, r0 - ldr r0, [r4] - movs r1, 0xB - muls r1, r5 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80EF9E8 - - thumb_func_start sub_80EFA24 -sub_80EFA24: @ 80EFA24 - push {r4-r6,lr} - lsls r0, 16 - lsrs r5, r0, 16 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x0000019b - bl __umodsi3 - adds r0, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - adds r6, r4, 0 - b _080EFA62 - .pool -_080EFA48: - cmp r4, 0x1 - bne _080EFA54 - ldr r4, =0x0000019b - b _080EFA5A - .pool -_080EFA54: - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_080EFA5A: - cmp r4, r6 - bne _080EFA62 - adds r4, r5, 0 - b _080EFA7E -_080EFA62: - adds r0, r4, 0 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - bl pokedex_flag_operation - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x1 - bne _080EFA48 - cmp r4, r5 - beq _080EFA48 -_080EFA7E: - adds r0, r4, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80EFA24 - - thumb_func_start sub_80EFA88 -sub_80EFA88: @ 80EFA88 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFADC - ldr r1, =0x030060bc - strb r0, [r1] - ldr r2, =0x020375e4 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - strh r1, [r2] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _080EFACC - ldr r1, =0x020375f0 - movs r0, 0x1 - b _080EFAD0 - .pool -_080EFACC: - ldr r1, =0x020375f0 - movs r0, 0 -_080EFAD0: - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EFA88 - - thumb_func_start sub_80EFADC -sub_80EFADC: @ 80EFADC - push {lr} - adds r2, r0, 0 - movs r1, 0 -_080EFAE2: - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080EFAF6 - lsls r0, r1, 24 - asrs r0, 24 - b _080EFB04 -_080EFAF6: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x4 - bls _080EFAE2 - movs r0, 0x1 - negs r0, r0 -_080EFB04: - pop {r1} - bx r1 - thumb_func_end sub_80EFADC - - thumb_func_start sub_80EFB08 -sub_80EFB08: @ 80EFB08 - push {lr} - adds r2, r0, 0 - movs r1, 0x5 -_080EFB0E: - lsls r0, r1, 24 - asrs r1, r0, 24 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080EFB24 - adds r0, r1, 0 - b _080EFB34 -_080EFB24: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - asrs r0, 24 - cmp r0, 0x17 - ble _080EFB0E - movs r0, 0x1 - negs r0, r0 -_080EFB34: - pop {r1} - bx r1 - thumb_func_end sub_80EFB08 - - thumb_func_start sub_80EFB38 -sub_80EFB38: @ 80EFB38 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - cmp r0, r4 - bls _080EFB50 - movs r0, 0x1 - b _080EFB52 -_080EFB50: - movs r0, 0 -_080EFB52: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80EFB38 - - thumb_func_start sub_80EFB58 -sub_80EFB58: @ 80EFB58 - push {r4-r6,lr} - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - bl __umodsi3 - lsls r0, 24 - lsrs r2, r0, 24 - adds r5, r4, 0x4 - ldr r6, =0x0000ffff - b _080EFB7E - .pool -_080EFB78: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_080EFB7E: - cmp r2, 0x6 - bne _080EFB84 - movs r2, 0 -_080EFB84: - lsls r1, r2, 1 - adds r0, r5, r1 - ldrh r0, [r0] - adds r3, r4, 0x4 - cmp r0, r6 - beq _080EFB78 - ldr r0, =0x02021ec4 - adds r1, r3, r1 - ldrh r1, [r1] - bl CopyEasyChatWord - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EFB58 - - thumb_func_start sub_80EFBA4 -sub_80EFBA4: @ 80EFBA4 - push {lr} - adds r2, r0, 0 - movs r3, 0 - movs r1, 0 - ldrb r0, [r2, 0x4] - cmp r0, 0xFF - beq _080EFBD0 - adds r2, 0x4 -_080EFBB4: - adds r0, r2, r1 - ldrb r0, [r0] - adds r0, r3, r0 - lsls r0, 16 - lsrs r3, r0, 16 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xA - bhi _080EFBD0 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _080EFBB4 -_080EFBD0: - movs r0, 0x7 - ands r3, r0 - adds r0, r3, 0 - pop {r1} - bx r1 - thumb_func_end sub_80EFBA4 - - thumb_func_start sub_80EFBDC -sub_80EFBDC: @ 80EFBDC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - ldr r4, [sp, 0x2C] - ldr r5, [sp, 0x30] - mov r8, r5 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - lsls r3, 16 - lsrs r3, 16 - lsls r4, 16 - lsrs r4, 16 - movs r2, 0 - movs r7, 0xFF -_080EFC06: - mov r1, sp - adds r0, r1, r2 - ldrb r1, [r0] - orrs r1, r7 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x2 - bls _080EFC06 - cmp r3, 0 - bne _080EFC72 - mov r4, r8 - adds r4, 0xF - adds r0, r4, 0 - bl GetStringLength - lsls r0, 16 - lsrs r2, r0, 16 - cmp r6, 0 - bne _080EFC36 - mov r0, sp - adds r1, r4, r5 - b _080EFC40 -_080EFC36: - cmp r6, 0x1 - bne _080EFC46 - mov r0, sp - subs r1, r2, r5 - adds r1, r4, r1 -_080EFC40: - ldrb r1, [r1] - strb r1, [r0] - b _080EFC6C -_080EFC46: - cmp r6, 0x2 - bne _080EFC56 - mov r1, sp - adds r0, r4, r5 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r5, 0x1 - b _080EFC66 -_080EFC56: - mov r1, sp - subs r0, r2, 0x2 - subs r0, r5 - adds r0, r4, r0 - ldrb r0, [r0] - strb r0, [r1] - subs r0, r2, 0x1 - subs r0, r5 -_080EFC66: - adds r0, r4, r0 - ldrb r0, [r0] - strb r0, [r1, 0x1] -_080EFC6C: - mov r2, r8 - ldrb r1, [r2, 0x1E] - b _080EFCC8 -_080EFC72: - cmp r3, 0x1 - bne _080EFCD0 - mov r4, r8 - adds r4, 0x4 - adds r0, r4, 0 - bl GetStringLength - lsls r0, 16 - lsrs r2, r0, 16 - cmp r6, 0 - bne _080EFC8E - mov r0, sp - adds r1, r4, r5 - b _080EFC98 -_080EFC8E: - cmp r6, 0x1 - bne _080EFC9E - mov r0, sp - subs r1, r2, r5 - adds r1, r4, r1 -_080EFC98: - ldrb r1, [r1] - strb r1, [r0] - b _080EFCC4 -_080EFC9E: - cmp r6, 0x2 - bne _080EFCAE - mov r1, sp - adds r0, r4, r5 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r5, 0x1 - b _080EFCBE -_080EFCAE: - mov r1, sp - subs r0, r2, 0x2 - subs r0, r5 - adds r0, r4, r0 - ldrb r0, [r0] - strb r0, [r1] - subs r0, r2, 0x1 - subs r0, r5 -_080EFCBE: - adds r0, r4, r0 - ldrb r0, [r0] - strb r0, [r1, 0x1] -_080EFCC4: - mov r5, r8 - ldrb r1, [r5, 0x1F] -_080EFCC8: - mov r0, sp - bl StopMusicWhileStringIsPrinted - b _080EFD30 -_080EFCD0: - movs r0, 0xB - muls r4, r0 - ldr r7, =gSpeciesNames - adds r0, r4, r7 - bl GetStringLength - lsls r0, 16 - lsrs r2, r0, 16 - cmp r6, 0 - bne _080EFCF0 - mov r0, sp - adds r1, r5, r4 - b _080EFCFA - .pool -_080EFCF0: - cmp r6, 0x1 - bne _080EFD02 - mov r0, sp - subs r1, r2, r5 - adds r1, r4 -_080EFCFA: - adds r1, r7 - ldrb r1, [r1] - strb r1, [r0] - b _080EFD30 -_080EFD02: - cmp r6, 0x2 - bne _080EFD16 - mov r1, sp - adds r0, r5, r4 - adds r0, r7 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r4, 0x1 - adds r0, r5, r0 - b _080EFD2A -_080EFD16: - mov r1, sp - subs r0, r2, 0x2 - subs r0, r5 - adds r0, r4 - adds r0, r7 - ldrb r0, [r0] - strb r0, [r1] - subs r0, r2, 0x1 - subs r0, r5 - adds r0, r4 -_080EFD2A: - adds r0, r7 - ldrb r0, [r0] - strb r0, [r1, 0x1] -_080EFD30: - ldr r0, =gUnknown_0858D144 - mov r2, r9 - lsls r1, r2, 2 - adds r1, r0 - ldr r0, [r1] - mov r1, sp - bl CopyString - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EFBDC - - thumb_func_start sub_80EFD54 -sub_80EFD54: @ 80EFD54 - push {r4,lr} - movs r1, 0 - ldr r0, =0x03005d8c - ldr r3, [r0] - ldr r0, =0x020375e0 - ldrh r2, [r0] - ldr r4, =0x000027cc -_080EFD62: - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r3, r0 - adds r0, r4 - ldrb r0, [r0] - cmp r0, r2 - bne _080EFD84 - movs r0, 0x1 - b _080EFD90 - .pool -_080EFD84: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x4 - bls _080EFD62 - movs r0, 0 -_080EFD90: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80EFD54 - - thumb_func_start sub_80EFD98 -sub_80EFD98: @ 80EFD98 - push {r4,lr} - ldr r0, =0x020375e0 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r4, =0x02021cc4 - movs r1, 0x2 - adds r2, r4, 0 - bl pokemon_getattr - ldr r0, =0x02021ec4 - adds r1, r4, 0 - bl CompareString - cmp r0, 0 - beq _080EFDD4 - bl sub_80ED320 - movs r0, 0x1 - b _080EFDD6 - .pool -_080EFDD4: - movs r0, 0 -_080EFDD6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80EFD98 - - thumb_func_start sub_80EFDDC -sub_80EFDDC: @ 80EFDDC - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0x8 - ldr r0, =0x020375e0 - mov r9, r0 - ldrh r0, [r0] - movs r1, 0x64 - mov r8, r1 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - ldr r6, =0x020244ec - adds r0, r6 - ldr r2, =0x02021ec4 - movs r1, 0x2 - bl pokemon_getattr - mov r1, r9 - ldrh r0, [r1] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r6 - ldr r1, =0x02021dc4 - mov r10, r1 - movs r1, 0x2 - mov r2, r10 - bl pokemon_getattr - mov r1, r9 - ldrh r0, [r1] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r6 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - mov r1, r9 - ldrh r0, [r1] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r6 - bl pokemon_get_gender - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - mov r1, r9 - ldrh r0, [r1] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r6 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - str r0, [sp] - ldr r0, =c2_080CC144 - str r0, [sp, 0x4] - movs r0, 0x3 - mov r1, r10 - adds r2, r5, 0 - adds r3, r4, 0 - bl do_choose_name_or_words_screen - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EFDDC - - thumb_func_start c2_080CC144 -c2_080CC144: @ 80EFE98 - push {lr} - ldr r0, =0x020375e0 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r2, =0x02021dc4 - movs r1, 0x2 - bl pokemon_setattr - bl c2_exit_to_overworld_1_continue_scripts_restart_music - pop {r0} - bx r0 - .pool - thumb_func_end c2_080CC144 - - thumb_func_start sub_80EFEC4 -sub_80EFEC4: @ 80EFEC4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x8 - ldr r0, =0x020375f6 - ldrb r0, [r0] - ldr r1, =0x020375f8 - ldrb r1, [r1] - bl get_pokemon_by_box_and_pos - adds r6, r0, 0 - ldr r2, =0x02021ec4 - movs r1, 0x2 - bl pokemon_getattr_encrypted - ldr r0, =0x02021dc4 - mov r8, r0 - adds r0, r6, 0 - movs r1, 0x2 - mov r2, r8 - bl pokemon_getattr_encrypted - adds r0, r6, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr_encrypted - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r6, 0 - bl pokemon_roll_gender - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr_encrypted - str r0, [sp] - ldr r0, =sub_80EFF48 - str r0, [sp, 0x4] - movs r0, 0x3 - mov r1, r8 - adds r2, r5, 0 - adds r3, r4, 0 - bl do_choose_name_or_words_screen - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EFEC4 - - thumb_func_start sub_80EFF48 -sub_80EFF48: @ 80EFF48 - push {lr} - ldr r0, =0x020375f6 - ldrb r0, [r0] - ldr r1, =0x020375f8 - ldrb r1, [r1] - ldr r2, =0x02021dc4 - bl sub_80D1E90 - bl c2_exit_to_overworld_1_continue_scripts_restart_music - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EFF48 - - thumb_func_start sub_80EFF6C -sub_80EFF6C: @ 80EFF6C - push {r4,lr} - ldr r0, =0x020375e0 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r4, =0x02021cc4 - movs r1, 0x2 - adds r2, r4, 0 - bl pokemon_getattr - adds r0, r4, 0 - bl GetStringEnd_Limit7 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EFF6C - - thumb_func_start sub_80EFF9C -sub_80EFF9C: @ 80EFF9C - push {r4,lr} - bl sub_80F0020 - adds r4, r0, 0 - ldr r0, =0x020375e0 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1 - movs r2, 0 - bl pokemon_getattr - cmp r4, r0 - bne _080EFFD0 - ldr r1, =0x020375f0 - movs r0, 0 - b _080EFFD4 - .pool -_080EFFD0: - ldr r1, =0x020375f0 - movs r0, 0x1 -_080EFFD4: - strh r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EFF9C - - thumb_func_start sub_80EFFE0 -sub_80EFFE0: @ 80EFFE0 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - adds r2, r1, 0 - cmp r1, 0 - beq _080F0016 - subs r0, r1, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - bhi _080EFFFA - movs r0, 0x2 - b _080F001C -_080EFFFA: - adds r0, r1, 0 - subs r0, 0x15 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - bhi _080F000A - movs r0, 0x3 - b _080F001C -_080F000A: - adds r0, r2, 0 - subs r0, 0x29 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - bls _080F001A -_080F0016: - movs r0, 0 - b _080F001C -_080F001A: - movs r0, 0x4 -_080F001C: - pop {r1} - bx r1 - thumb_func_end sub_80EFFE0 - - thumb_func_start sub_80F0020 -sub_80F0020: @ 80F0020 - ldr r0, =0x03005d90 - ldr r2, [r0] - ldrb r0, [r2, 0xD] - lsls r0, 24 - ldrb r1, [r2, 0xC] - lsls r1, 16 - orrs r0, r1 - ldrb r1, [r2, 0xB] - lsls r1, 8 - orrs r0, r1 - ldrb r1, [r2, 0xA] - orrs r0, r1 - bx lr - .pool - thumb_func_end sub_80F0020 - - thumb_func_start CheckForBigMovieOrEmergencyNewsOnTV -CheckForBigMovieOrEmergencyNewsOnTV: @ 80F0040 - push {lr} - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r0, 0x4 - ldrsb r0, [r1, r0] - cmp r0, 0x1 - bne _080F0060 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _080F006C - movs r0, 0x5 - ldrsb r0, [r1, r0] - cmp r0, 0 - beq _080F0074 -_080F0060: - movs r0, 0 - b _080F009E - .pool -_080F006C: - movs r0, 0x5 - ldrsb r0, [r1, r0] - cmp r0, 0x2 - bne _080F0060 -_080F0074: - ldr r0, =0x000008bd - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080F0092 - movs r0, 0x89 - lsls r0, 4 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080F009C -_080F0092: - movs r0, 0x1 - b _080F009E - .pool -_080F009C: - movs r0, 0x2 -_080F009E: - pop {r1} - bx r1 - thumb_func_end CheckForBigMovieOrEmergencyNewsOnTV - - thumb_func_start GetMomOrDadStringForTVMessage -GetMomOrDadStringForTVMessage: @ 80F00A4 - push {r4,lr} - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r0, 0x4 - ldrsb r0, [r1, r0] - cmp r0, 0x1 - bne _080F0104 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _080F00EC - movs r0, 0x5 - ldrsb r0, [r1, r0] - cmp r0, 0 - bne _080F0104 - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EAD08 - bl CopyString - ldr r0, =0x00004003 - movs r1, 0x1 - bl VarSet - b _080F0104 - .pool -_080F00EC: - movs r0, 0x5 - ldrsb r0, [r1, r0] - cmp r0, 0x2 - bne _080F0104 - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EAD08 - bl CopyString - ldr r0, =0x00004003 - movs r1, 0x1 - bl VarSet -_080F0104: - ldr r4, =0x00004003 - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - beq _080F0142 - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - beq _080F0158 - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bls _080F016C - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080F0158 -_080F0142: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EAD08 - bl CopyString - b _080F01A8 - .pool -_080F0158: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EAD04 - bl CopyString - b _080F01A8 - .pool -_080F016C: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080F0198 - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EAD08 - bl CopyString - adds r0, r4, 0 - movs r1, 0x1 - bl VarSet - b _080F01A8 - .pool -_080F0198: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EAD04 - bl CopyString - adds r0, r4, 0 - movs r1, 0x2 - bl VarSet -_080F01A8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end GetMomOrDadStringForTVMessage - - thumb_func_start sub_80F01B8 -sub_80F01B8: @ 80F01B8 - push {lr} - ldr r0, =0x000040bc - movs r1, 0 - bl VarSet - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrb r1, [r0, 0x5] - ldrb r2, [r0, 0x4] - movs r0, 0x5 - bl RemoveFieldObjectByLocalIdAndMap - ldr r0, =0x00000396 - bl FlagSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F01B8 - - thumb_func_start sub_80F01E8 -sub_80F01E8: @ 80F01E8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r0, 0 - adds r5, r1, 0 - lsls r2, 24 - lsrs r6, r2, 24 - movs r0, 0xE1 - lsls r0, 4 - bl Alloc - mov r8, r0 - cmp r0, 0 - bne _080F0206 - b _080F0344 -_080F0206: - movs r4, 0 -_080F0208: - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 5 - adds r0, r4 - lsls r0, 2 - add r0, r8 - adds r1, r4, 0 - muls r1, r5 - adds r1, r7, r1 - movs r2, 0xE1 - lsls r2, 2 - bl memcpy - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _080F0208 - mov r5, r8 - movs r4, 0 - ldr r7, =0x020229e8 - b _080F0276 - .pool -_080F0238: - lsls r0, r4, 3 - subs r2, r0, r4 - lsls r0, r2, 2 - adds r3, r0, r7 - ldrb r1, [r3] - subs r0, r1, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _080F025A - lsls r0, r2, 5 - adds r0, r4 - lsls r0, 2 - adds r0, r5, r0 - bl sub_80F1254 - b _080F0270 -_080F025A: - cmp r1, 0x3 - bne _080F0270 - ldrh r0, [r3, 0x1A] - cmp r0, 0x1 - bne _080F0270 - lsls r0, r2, 5 - adds r0, r4 - lsls r0, 2 - adds r0, r5, r0 - bl sub_80F12A4 -_080F0270: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_080F0276: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bcc _080F0238 - cmp r6, 0x1 - beq _080F02C4 - cmp r6, 0x1 - bgt _080F0290 - cmp r6, 0 - beq _080F029A - b _080F031E -_080F0290: - cmp r6, 0x2 - beq _080F02DC - cmp r6, 0x3 - beq _080F0304 - b _080F031E -_080F029A: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000027cc - adds r0, r1 - movs r2, 0xE1 - lsls r2, 2 - adds r1, r5, r2 - movs r3, 0xE1 - lsls r3, 3 - adds r2, r5, r3 - ldr r4, =0x00000a8c - adds r3, r5, r4 - bl sub_80F0358 - b _080F031E - .pool -_080F02C4: - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x000027cc - adds r1, r0 - movs r3, 0xE1 - lsls r3, 3 - adds r2, r5, r3 - b _080F02EA - .pool -_080F02DC: - movs r0, 0xE1 - lsls r0, 2 - adds r1, r5, r0 - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r3, =0x000027cc - adds r2, r3 -_080F02EA: - ldr r4, =0x00000a8c - adds r3, r5, r4 - adds r0, r5, 0 - bl sub_80F0358 - b _080F031E - .pool -_080F0304: - movs r0, 0xE1 - lsls r0, 2 - adds r1, r5, r0 - movs r3, 0xE1 - lsls r3, 3 - adds r2, r5, r3 - ldr r0, =0x03005d8c - ldr r3, [r0] - ldr r4, =0x000027cc - adds r3, r4 - adds r0, r5, 0 - bl sub_80F0358 -_080F031E: - ldr r5, =0x03005d8c - ldr r0, [r5] - ldr r4, =0x000027cc - adds r0, r4 - bl sub_80EF93C - bl sub_80F0C04 - ldr r0, [r5] - adds r0, r4 - bl sub_80EF93C - bl sub_80F0708 - bl sub_80F0B64 - mov r0, r8 - bl Free -_080F0344: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F01E8 - - thumb_func_start sub_80F0358 -sub_80F0358: @ 80F0358 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - str r0, [sp, 0x10] - str r1, [sp, 0x14] - str r2, [sp, 0x18] - str r3, [sp, 0x1C] - add r0, sp, 0x10 - str r0, [sp] - add r0, sp, 0x14 - str r0, [sp, 0x4] - add r0, sp, 0x18 - str r0, [sp, 0x8] - add r0, sp, 0x1C - str r0, [sp, 0xC] - bl sub_8009FCC - ldr r1, =0x03001174 - strb r0, [r1] -_080F0384: - movs r6, 0 - ldr r0, =0x03001174 - ldrb r1, [r0] - cmp r6, r1 - bcs _080F0384 - mov r10, r0 -_080F0390: - cmp r6, 0 - bne _080F0398 - ldr r2, =0x0203a02c - strb r6, [r2] -_080F0398: - lsls r4, r6, 2 - mov r3, sp - adds r0, r3, r4 - ldr r0, [r0] - ldr r0, [r0] - bl sub_80F06D0 - ldr r1, =0x03001176 - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - adds r7, r4, 0 - cmp r0, r1 - bne _080F03E0 - ldr r1, =0x0203a02c - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - mov r2, r10 - ldrb r2, [r2] - cmp r0, r2 - beq _080F048C - adds r6, 0x1 - mov r9, r6 - b _080F0470 - .pool -_080F03E0: - movs r5, 0 - mov r3, r10 - ldrb r0, [r3] - subs r0, 0x1 - adds r2, r6, 0x1 - mov r9, r2 - cmp r5, r0 - bge _080F0456 - ldr r3, =0x03001174 - mov r8, r3 -_080F03F4: - adds r0, r6, r5 - adds r4, r0, 0x1 - mov r0, r8 - ldrb r1, [r0] - adds r0, r4, 0 - bl __modsi3 - lsls r0, 2 - add r0, sp - ldr r0, [r0] - ldr r0, [r0] - bl sub_80EFB08 - ldr r1, =0x030060bc - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080F0446 - mov r2, r8 - ldrb r1, [r2] - adds r0, r4, 0 - bl __modsi3 - adds r2, r0, 0 - lsls r0, r2, 2 - add r0, sp - ldr r0, [r0] - mov r3, sp - adds r1, r3, r7 - ldr r1, [r1] - lsls r2, 24 - lsrs r2, 24 - bl sub_80F049C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080F0456 -_080F0446: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - mov r1, r8 - ldrb r0, [r1] - subs r0, 0x1 - cmp r5, r0 - blt _080F03F4 -_080F0456: - mov r2, r10 - ldrb r0, [r2] - subs r0, 0x1 - cmp r5, r0 - bne _080F0470 - mov r3, sp - adds r0, r3, r7 - ldr r0, [r0] - ldr r0, [r0] - ldr r1, =0x03001176 - ldrb r1, [r1] - bl sub_80EF910 -_080F0470: - mov r1, r9 - lsls r0, r1, 24 - lsrs r6, r0, 24 - mov r2, r10 - ldrb r2, [r2] - cmp r6, r2 - bcc _080F0390 - b _080F0384 - .pool -_080F048C: - 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_80F0358 - - thumb_func_start sub_80F049C -sub_80F049C: @ 80F049C - push {r4-r7,lr} - sub sp, 0x4 - lsls r2, 24 - lsrs r7, r2, 24 - ldr r4, [r0] - ldr r6, [r1] - movs r5, 0 - ldr r2, =0x03001176 - movs r1, 0 - ldrsb r1, [r2, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0] - str r2, [sp] - bl sub_80EFFE0 - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - ldr r2, [sp] - cmp r0, 0x3 - beq _080F050C - cmp r0, 0x3 - bgt _080F04DC - cmp r0, 0x2 - beq _080F04E2 - b _080F055A - .pool -_080F04DC: - cmp r1, 0x4 - beq _080F0534 - b _080F055A -_080F04E2: - ldr r0, =0x030060bc - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r4, r0 - ldrb r2, [r2] - lsls r2, 24 - asrs r2, 24 - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - adds r1, r6, r1 - adds r2, r7, 0 - bl sub_80F0580 - b _080F0556 - .pool -_080F050C: - ldr r0, =0x030060bc - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r4, r0 - ldrb r2, [r2] - lsls r2, 24 - asrs r2, 24 - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - adds r1, r6, r1 - adds r2, r7, 0 - bl sub_80F05E8 - b _080F0556 - .pool -_080F0534: - ldr r0, =0x030060bc - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r4, r0 - ldrb r2, [r2] - lsls r2, 24 - asrs r2, 24 - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - adds r1, r6, r1 - adds r2, r7, 0 - bl sub_80F0668 -_080F0556: - lsls r0, 24 - lsrs r5, r0, 24 -_080F055A: - cmp r5, 0x1 - beq _080F0568 - movs r0, 0 - b _080F0574 - .pool -_080F0568: - ldr r0, =0x03001176 - ldrb r1, [r0] - adds r0, r6, 0 - bl sub_80EF910 - movs r0, 0x1 -_080F0574: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80F049C - - thumb_func_start sub_80F0580 -sub_80F0580: @ 80F0580 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - lsls r0, r2, 24 - lsrs r0, 24 - bl sub_800A2A4 - adds r5, r0, 0 - movs r2, 0xFF - ands r0, r2 - adds r1, r4, 0 - adds r1, 0x22 - ldrb r1, [r1] - cmp r0, r1 - bne _080F05B0 - lsrs r0, r5, 8 - ands r0, r2 - adds r1, r4, 0 - adds r1, 0x23 - ldrb r1, [r1] - cmp r0, r1 - bne _080F05B0 - movs r0, 0 - b _080F05E0 -_080F05B0: - adds r1, r4, 0 - adds r1, 0x20 - ldrb r0, [r1] - adds r2, r4, 0 - adds r2, 0x22 - strb r0, [r2] - adds r3, r4, 0 - adds r3, 0x21 - ldrb r0, [r3] - adds r2, 0x1 - strb r0, [r2] - strb r5, [r1] - lsrs r0, r5, 8 - strb r0, [r3] - adds r1, r6, 0 - adds r0, r4, 0 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - movs r0, 0x1 - strb r0, [r6, 0x1] -_080F05E0: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80F0580 - - thumb_func_start sub_80F05E8 -sub_80F05E8: @ 80F05E8 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - lsls r0, r2, 24 - lsrs r0, 24 - bl sub_800A2A4 - adds r2, r0, 0 - movs r3, 0xFF - ands r0, r3 - adds r1, r4, 0 - adds r1, 0x20 - ldrb r1, [r1] - cmp r0, r1 - bne _080F0614 - lsrs r0, r2, 8 - ands r0, r3 - adds r1, r4, 0 - adds r1, 0x21 - ldrb r1, [r1] - cmp r0, r1 - beq _080F0634 -_080F0614: - movs r3, 0xFF - adds r0, r2, 0 - ands r0, r3 - adds r1, r4, 0 - adds r1, 0x22 - lsrs r5, r2, 8 - ldrb r1, [r1] - cmp r0, r1 - bne _080F0638 - adds r0, r5, 0 - ands r0, r3 - adds r1, r4, 0 - adds r1, 0x23 - ldrb r1, [r1] - cmp r0, r1 - bne _080F0638 -_080F0634: - movs r0, 0 - b _080F0660 -_080F0638: - ldrb r1, [r4, 0x1E] - adds r0, r4, 0 - adds r0, 0x20 - strb r1, [r0] - ldrb r0, [r4, 0x1F] - adds r1, r4, 0 - adds r1, 0x21 - strb r0, [r1] - strb r2, [r4, 0x1E] - strb r5, [r4, 0x1F] - adds r1, r6, 0 - adds r0, r4, 0 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - movs r0, 0x1 - strb r0, [r6, 0x1] -_080F0660: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80F05E8 - - thumb_func_start sub_80F0668 -sub_80F0668: @ 80F0668 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - lsls r0, r2, 24 - lsrs r0, 24 - bl sub_800A2A4 - adds r5, r0, 0 - movs r2, 0xFF - ands r0, r2 - adds r1, r4, 0 - adds r1, 0x22 - ldrb r1, [r1] - cmp r0, r1 - bne _080F0698 - lsrs r0, r5, 8 - ands r0, r2 - adds r1, r4, 0 - adds r1, 0x23 - ldrb r1, [r1] - cmp r0, r1 - bne _080F0698 - movs r0, 0 - b _080F06CA -_080F0698: - adds r1, r4, 0 - adds r1, 0x20 - ldrb r0, [r1] - adds r2, r4, 0 - adds r2, 0x22 - strb r0, [r2] - adds r3, r4, 0 - adds r3, 0x21 - ldrb r0, [r3] - adds r2, 0x1 - strb r0, [r2] - strb r5, [r1] - lsrs r0, r5, 8 - strb r0, [r3] - adds r1, r6, 0 - adds r0, r4, 0 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - movs r0, 0x1 - strb r0, [r6, 0x1] - strh r0, [r6, 0x16] -_080F06CA: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80F0668 - - thumb_func_start sub_80F06D0 -sub_80F06D0: @ 80F06D0 - push {lr} - adds r3, r0, 0 - movs r2, 0 -_080F06D6: - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r3 - ldrb r0, [r1, 0x1] - cmp r0, 0 - bne _080F06F6 - ldrb r0, [r1] - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3B - bhi _080F06F6 - lsls r0, r2, 24 - asrs r0, 24 - b _080F0704 -_080F06F6: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x17 - bls _080F06D6 - movs r0, 0x1 - negs r0, r0 -_080F0704: - pop {r1} - bx r1 - thumb_func_end sub_80F06D0 - - thumb_func_start sub_80F0708 -sub_80F0708: @ 80F0708 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - movs r0, 0 - mov r9, r0 -_080F0716: - ldr r3, =0x03005d8c - ldr r1, [r3] - mov r4, r9 - lsls r2, r4, 3 - adds r0, r2, r4 - lsls r0, 2 - adds r1, r0 - ldr r0, =0x000027cc - adds r1, r0 - ldrb r0, [r1] - adds r7, r2, 0 - cmp r0, 0x29 - bls _080F0732 - b _080F0AD8 -_080F0732: - lsls r0, 2 - ldr r1, =_080F0748 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F0748: - .4byte _080F0AE2 - .4byte _080F0848 - .4byte _080F0AE2 - .4byte _080F0860 - .4byte _080F0878 - .4byte _080F0890 - .4byte _080F08BC - .4byte _080F08D4 - .4byte _080F07F0 - .4byte _080F0AE2 - .4byte _080F081C - .4byte _080F0AE2 - .4byte _080F0AE2 - .4byte _080F0AD8 - .4byte _080F0AD8 - .4byte _080F0AD8 - .4byte _080F0AD8 - .4byte _080F0AD8 - .4byte _080F0AD8 - .4byte _080F0AD8 - .4byte _080F0AD8 - .4byte _080F0900 - .4byte _080F0AE2 - .4byte _080F0918 - .4byte _080F0944 - .4byte _080F095C - .4byte _080F0AE2 - .4byte _080F0AE2 - .4byte _080F0AE2 - .4byte _080F0AE2 - .4byte _080F0974 - .4byte _080F09A0 - .4byte _080F0AE2 - .4byte _080F09C0 - .4byte _080F0AE2 - .4byte _080F0AE2 - .4byte _080F09F4 - .4byte _080F0AE2 - .4byte _080F0AE2 - .4byte _080F0AE2 - .4byte _080F0AD8 - .4byte _080F0AE2 -_080F07F0: - ldr r0, [r3] - mov r1, r9 - adds r4, r7, r1 - lsls r4, 2 - adds r0, r4, r0 - ldr r6, =0x000027cc - adds r0, r6 - ldrh r0, [r0, 0x12] - lsls r5, r1, 24 - lsrs r5, 24 - adds r1, r5, 0 - str r3, [sp, 0x4] - bl sub_80F0B24 - ldr r3, [sp, 0x4] - ldr r0, [r3] - adds r4, r0 - adds r4, r6 - ldrh r0, [r4, 0x2] - b _080F09E6 - .pool -_080F081C: - ldr r0, [r3] - mov r2, r9 - adds r4, r7, r2 - lsls r4, 2 - adds r0, r4, r0 - ldr r6, =0x000027cc - adds r0, r6 - ldrh r0, [r0, 0x16] - lsls r5, r2, 24 - lsrs r5, 24 - adds r1, r5, 0 - str r3, [sp, 0x4] - bl sub_80F0B24 - ldr r3, [sp, 0x4] - ldr r0, [r3] - adds r4, r0 - adds r4, r6 - ldrh r0, [r4, 0x2] - b _080F09E6 - .pool -_080F0848: - ldr r0, [r3] - mov r4, r9 - adds r1, r7, r4 - lsls r1, 2 - adds r1, r0 - ldr r0, =0x000027cc - adds r1, r0 - ldrh r0, [r1, 0x2] - b _080F09B0 - .pool -_080F0860: - ldr r0, [r3] - mov r2, r9 - adds r1, r7, r2 - lsls r1, 2 - adds r1, r0 - ldr r4, =0x000027cc - adds r1, r4 - ldrh r0, [r1, 0x2] - lsls r1, r2, 24 - b _080F09B2 - .pool -_080F0878: - ldr r0, [r3] - mov r2, r9 - adds r1, r7, r2 - lsls r1, 2 - adds r1, r0 - ldr r4, =0x000027cc - adds r1, r4 - ldrh r0, [r1, 0x6] - lsls r1, r2, 24 - b _080F09B2 - .pool -_080F0890: - ldr r0, [r3] - mov r1, r9 - adds r4, r7, r1 - lsls r4, 2 - adds r0, r4, r0 - ldr r6, =0x000027cc - adds r0, r6 - ldrh r0, [r0, 0x2] - lsls r5, r1, 24 - lsrs r5, 24 - adds r1, r5, 0 - str r3, [sp, 0x4] - bl sub_80F0B24 - ldr r3, [sp, 0x4] - ldr r0, [r3] - adds r4, r0 - adds r4, r6 - ldrh r0, [r4, 0x1C] - b _080F09E6 - .pool -_080F08BC: - ldr r0, [r3] - mov r2, r9 - adds r1, r7, r2 - lsls r1, 2 - adds r1, r0 - ldr r4, =0x000027cc - adds r1, r4 - ldrh r0, [r1, 0x2] - lsls r1, r2, 24 - b _080F09B2 - .pool -_080F08D4: - ldr r0, [r3] - mov r1, r9 - adds r4, r7, r1 - lsls r4, 2 - adds r0, r4, r0 - ldr r6, =0x000027cc - adds r0, r6 - ldrh r0, [r0, 0xA] - lsls r5, r1, 24 - lsrs r5, 24 - adds r1, r5, 0 - str r3, [sp, 0x4] - bl sub_80F0B24 - ldr r3, [sp, 0x4] - ldr r0, [r3] - adds r4, r0 - adds r4, r6 - ldrh r0, [r4, 0x14] - b _080F09E6 - .pool -_080F0900: - ldr r0, [r3] - mov r2, r9 - adds r1, r7, r2 - lsls r1, 2 - adds r1, r0 - ldr r4, =0x000027cc - adds r1, r4 - ldrh r0, [r1, 0x10] - lsls r1, r2, 24 - b _080F09B2 - .pool -_080F0918: - ldr r0, [r3] - mov r1, r9 - adds r4, r7, r1 - lsls r4, 2 - adds r0, r4, r0 - ldr r6, =0x000027cc - adds r0, r6 - ldrh r0, [r0, 0xC] - lsls r5, r1, 24 - lsrs r5, 24 - adds r1, r5, 0 - str r3, [sp, 0x4] - bl sub_80F0B24 - ldr r3, [sp, 0x4] - ldr r0, [r3] - adds r4, r0 - adds r4, r6 - ldrh r0, [r4, 0xE] - b _080F09E6 - .pool -_080F0944: - ldr r0, [r3] - mov r2, r9 - adds r1, r7, r2 - lsls r1, 2 - adds r1, r0 - ldr r4, =0x000027cc - adds r1, r4 - ldrh r0, [r1, 0x4] - lsls r1, r2, 24 - b _080F09B2 - .pool -_080F095C: - ldr r0, [r3] - mov r1, r9 - adds r4, r7, r1 - lsls r4, 2 - adds r0, r4, r0 - ldr r6, =0x000027cc - adds r0, r6 - ldrh r0, [r0, 0x8] - b _080F09D0 - .pool -_080F0974: - ldr r0, [r3] - mov r2, r9 - adds r4, r7, r2 - lsls r4, 2 - adds r0, r4, r0 - ldr r6, =0x000027cc - adds r0, r6 - ldrh r0, [r0, 0x2] - lsls r5, r2, 24 - lsrs r5, 24 - adds r1, r5, 0 - str r3, [sp, 0x4] - bl sub_80F0B24 - ldr r3, [sp, 0x4] - ldr r0, [r3] - adds r4, r0 - adds r4, r6 - ldrh r0, [r4, 0xA] - b _080F09E6 - .pool -_080F09A0: - ldr r0, [r3] - mov r4, r9 - adds r1, r7, r4 - lsls r1, 2 - adds r1, r0 - ldr r0, =0x000027cc - adds r1, r0 - ldrh r0, [r1, 0x8] -_080F09B0: - lsls r1, r4, 24 -_080F09B2: - lsrs r1, 24 - bl sub_80F0B24 - b _080F0AE2 - .pool -_080F09C0: - ldr r0, [r3] - mov r1, r9 - adds r4, r7, r1 - lsls r4, 2 - adds r0, r4, r0 - ldr r6, =0x000027cc - adds r0, r6 - ldrh r0, [r0, 0x6] -_080F09D0: - lsls r5, r1, 24 - lsrs r5, 24 - adds r1, r5, 0 - str r3, [sp, 0x4] - bl sub_80F0B24 - ldr r3, [sp, 0x4] - ldr r0, [r3] - adds r4, r0 - adds r4, r6 - ldrh r0, [r4, 0x4] -_080F09E6: - adds r1, r5, 0 - bl sub_80F0B24 - b _080F0AE2 - .pool -_080F09F4: - ldr r0, [r3] - mov r2, r9 - adds r4, r7, r2 - lsls r4, 2 - adds r0, r4, r0 - ldr r5, =0x000027cc - adds r0, r5 - ldrh r0, [r0, 0x4] - lsls r2, 24 - mov r8, r2 - lsrs r6, r2, 24 - adds r1, r6, 0 - str r3, [sp, 0x4] - bl sub_80F0B24 - ldr r3, [sp, 0x4] - ldr r0, [r3] - adds r0, r4, r0 - adds r0, r5 - ldrh r0, [r0, 0x6] - adds r1, r6, 0 - bl sub_80F0B24 - ldr r3, [sp, 0x4] - ldr r0, [r3] - adds r4, r0 - adds r4, r5 - ldrb r0, [r4, 0xD] - subs r0, 0x1 - mov r6, r8 - cmp r0, 0xC - bhi _080F0AE2 - lsls r0, 2 - ldr r1, =_080F0A48 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F0A48: - .4byte _080F0A7C - .4byte _080F0AA0 - .4byte _080F0AE2 - .4byte _080F0AE2 - .4byte _080F0A7C - .4byte _080F0A7C - .4byte _080F0A7C - .4byte _080F0A7C - .4byte _080F0A7C - .4byte _080F0A7C - .4byte _080F0A7C - .4byte _080F0A7C - .4byte _080F0A7C -_080F0A7C: - ldr r0, =0x03005d8c - ldr r1, [r0] - mov r4, r9 - adds r0, r7, r4 - lsls r0, 2 - adds r0, r1 - ldr r1, =0x000027cc - adds r0, r1 - ldrh r0, [r0, 0x8] - lsrs r1, r6, 24 - bl sub_80F0B24 - b _080F0AE2 - .pool -_080F0AA0: - ldr r2, =0x03005d8c - ldr r0, [r2] - mov r1, r9 - adds r4, r7, r1 - lsls r4, 2 - adds r0, r4, r0 - ldr r5, =0x000027cc - adds r0, r5 - ldrh r0, [r0, 0x8] - lsrs r6, 24 - adds r1, r6, 0 - str r2, [sp] - bl sub_80F0B24 - ldr r2, [sp] - ldr r0, [r2] - adds r4, r0 - adds r4, r5 - ldrh r0, [r4, 0xA] - adds r1, r6, 0 - bl sub_80F0B24 - b _080F0AE2 - .pool -_080F0AD8: - mov r2, r9 - lsls r0, r2, 24 - lsrs r0, 24 - bl sub_80F0B00 -_080F0AE2: - mov r0, r9 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - cmp r0, 0x17 - bhi _080F0AF2 - b _080F0716 -_080F0AF2: - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80F0708 - - thumb_func_start sub_80F0B00 -sub_80F0B00: @ 80F0B00 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005d8c - ldr r2, [r1] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r2, r1 - ldr r0, =0x000027cd - adds r2, r0 - movs r0, 0 - strb r0, [r2] - bx lr - .pool - thumb_func_end sub_80F0B00 - - thumb_func_start sub_80F0B24 -sub_80F0B24: @ 80F0B24 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 24 - lsrs r4, r1, 24 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - bl pokedex_flag_operation - lsls r0, 24 - asrs r2, r0, 24 - cmp r2, 0 - bne _080F0B56 - ldr r0, =0x03005d8c - ldr r1, [r0] - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - adds r1, r0 - ldr r0, =0x000027cd - adds r1, r0 - strb r2, [r1] -_080F0B56: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F0B24 - - thumb_func_start sub_80F0B64 -sub_80F0B64: @ 80F0B64 - push {r4-r6,lr} - ldr r0, =0x00000864 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080F0BA2 - movs r2, 0 - ldr r4, =0x000027cd - movs r3, 0 - ldr r5, =0x03005d8c -_080F0B7C: - ldr r0, [r5] - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - adds r1, r0, r1 - ldr r6, =0x000027cc - adds r0, r1, r6 - ldrb r0, [r0] - cmp r0, 0x7 - beq _080F0B94 - cmp r0, 0x29 - bne _080F0B98 -_080F0B94: - adds r0, r1, r4 - strb r3, [r0] -_080F0B98: - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x17 - bls _080F0B7C -_080F0BA2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F0B64 - - thumb_func_start sub_80F0BB8 -sub_80F0BB8: @ 80F0BB8 - push {r4-r6,lr} - movs r5, 0 - ldr r6, =0x03005d8c -_080F0BBE: - ldr r1, [r6] - lsls r0, r5, 3 - adds r0, r5 - lsls r4, r0, 2 - adds r1, r4 - ldr r0, =0x000027cc - adds r1, r0 - ldrb r0, [r1] - bl sub_80EFFE0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _080F0BE6 - ldr r0, [r6] - adds r0, r4 - ldr r1, =0x000027cd - adds r0, r1 - movs r1, 0 - strb r1, [r0] -_080F0BE6: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x4 - bls _080F0BBE - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F0BB8 - - thumb_func_start sub_80F0C04 -sub_80F0C04: @ 80F0C04 - push {r4,r5,lr} - movs r3, 0 - movs r2, 0x5 - ldr r0, =0x03005d8c - ldr r4, [r0] - ldr r5, =0x000027cc -_080F0C10: - lsls r0, r2, 24 - asrs r1, r0, 24 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r4, r0 - adds r0, r5 - ldrb r0, [r0] - cmp r0, 0 - bne _080F0C2E - lsls r0, r3, 24 - movs r2, 0x80 - lsls r2, 17 - adds r0, r2 - lsrs r3, r0, 24 -_080F0C2E: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - asrs r0, 24 - cmp r0, 0x17 - ble _080F0C10 - movs r2, 0 - lsls r0, r3, 24 - asrs r0, 24 - movs r1, 0x5 - subs r0, r1, r0 - cmp r2, r0 - bge _080F0C6E - adds r5, r0, 0 -_080F0C4A: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000027cc - adds r0, r1 - lsls r1, r2, 24 - asrs r4, r1, 24 - movs r2, 0xA0 - lsls r2, 19 - adds r1, r2 - lsrs r1, 24 - bl sub_80EF910 - adds r4, 0x1 - lsls r4, 24 - lsrs r2, r4, 24 - asrs r4, 24 - cmp r4, r5 - blt _080F0C4A -_080F0C6E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F0C04 - - thumb_func_start sub_80F0C7C -sub_80F0C7C: @ 80F0C7C - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r0 - adds r7, r1, 0 - lsls r2, 24 - lsrs r6, r2, 24 - movs r0, 0x80 - lsls r0, 1 - bl Alloc - adds r5, r0, 0 - cmp r5, 0 - beq _080F0D4C - movs r4, 0 -_080F0C9A: - lsls r0, r4, 6 - adds r0, r5 - adds r1, r4, 0 - muls r1, r7 - add r1, r8 - movs r2, 0x40 - bl memcpy - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _080F0C9A - cmp r6, 0x1 - beq _080F0CF0 - cmp r6, 0x1 - bgt _080F0CC2 - cmp r6, 0 - beq _080F0CCC - b _080F0D3E -_080F0CC2: - cmp r6, 0x2 - beq _080F0D08 - cmp r6, 0x3 - beq _080F0D28 - b _080F0D3E -_080F0CCC: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002b50 - adds r0, r1 - adds r1, r5, 0 - adds r1, 0x40 - adds r2, r5, 0 - adds r2, 0x80 - adds r3, r5, 0 - adds r3, 0xC0 - bl sub_80F0D60 - b _080F0D3E - .pool -_080F0CF0: - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x00002b50 - adds r1, r0 - adds r2, r5, 0 - adds r2, 0x80 - b _080F0D14 - .pool -_080F0D08: - adds r1, r5, 0 - adds r1, 0x40 - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r0, =0x00002b50 - adds r2, r0 -_080F0D14: - adds r3, r5, 0 - adds r3, 0xC0 - adds r0, r5, 0 - bl sub_80F0D60 - b _080F0D3E - .pool -_080F0D28: - adds r1, r5, 0 - adds r1, 0x40 - adds r2, r5, 0 - adds r2, 0x80 - ldr r0, =0x03005d8c - ldr r3, [r0] - ldr r0, =0x00002b50 - adds r3, r0 - adds r0, r5, 0 - bl sub_80F0D60 -_080F0D3E: - bl sub_80F0EEC - bl sub_80F0F24 - adds r0, r5, 0 - bl Free -_080F0D4C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F0C7C - - thumb_func_start sub_80F0D60 -sub_80F0D60: @ 80F0D60 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - str r0, [sp, 0x10] - str r1, [sp, 0x14] - str r2, [sp, 0x18] - str r3, [sp, 0x1C] - add r0, sp, 0x10 - str r0, [sp] - add r0, sp, 0x14 - str r0, [sp, 0x4] - add r0, sp, 0x18 - str r0, [sp, 0x8] - add r0, sp, 0x1C - str r0, [sp, 0xC] - bl sub_8009FCC - ldr r1, =0x03001175 - strb r0, [r1] - movs r0, 0 - mov r10, r0 -_080F0D90: - movs r7, 0 - mov r1, r10 - adds r1, 0x1 - str r1, [sp, 0x20] - b _080F0E28 - .pool -_080F0DA0: - lsls r4, r7, 2 - mov r1, sp - adds r0, r1, r4 - ldr r0, [r0] - ldr r0, [r0] - mov r1, r10 - bl sub_80F0ECC - ldr r1, =0x03001176 - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - mov r8, r4 - adds r1, r7, 0x1 - mov r9, r1 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080F0E22 - movs r5, 0 - ldr r1, =0x03001175 - ldrb r0, [r1] - subs r0, 0x1 - cmp r5, r0 - bge _080F0E22 - adds r6, r1, 0 -_080F0DD4: - adds r0, r7, r5 - adds r4, r0, 0x1 - ldrb r1, [r6] - adds r0, r4, 0 - bl __modsi3 - lsls r0, 2 - add r0, sp - ldr r0, [r0] - ldr r0, [r0] - bl sub_80EEE30 - ldr r1, =0x030060bc - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080F0E14 - ldrb r1, [r6] - adds r0, r4, 0 - bl __modsi3 - lsls r0, 2 - add r0, sp - ldr r0, [r0] - mov r1, sp - add r1, r8 - ldr r1, [r1] - bl sub_80F0E58 -_080F0E14: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldrb r0, [r6] - subs r0, 0x1 - cmp r5, r0 - blt _080F0DD4 -_080F0E22: - mov r1, r9 - lsls r0, r1, 24 - lsrs r7, r0, 24 -_080F0E28: - ldr r0, =0x03001175 - ldrb r0, [r0] - cmp r7, r0 - bcc _080F0DA0 - ldr r1, [sp, 0x20] - lsls r0, r1, 24 - lsrs r0, 24 - mov r10, r0 - cmp r0, 0xF - bls _080F0D90 - 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_80F0D60 - - thumb_func_start sub_80F0E58 -sub_80F0E58: @ 80F0E58 - push {lr} - ldr r0, [r0] - ldr r1, [r1] - ldr r2, =0x03001176 - ldrb r2, [r2] - lsls r2, 24 - asrs r2, 24 - lsls r2, 2 - adds r1, r2 - ldr r2, =0x030060bc - ldrb r2, [r2] - lsls r2, 24 - asrs r2, 24 - bl sub_80F0E84 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F0E58 - - thumb_func_start sub_80F0E84 -sub_80F0E84: @ 80F0E84 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r2, 24 - lsrs r6, r2, 24 - ldrb r3, [r5] - adds r0, r3, 0 - cmp r0, 0 - bne _080F0E9A -_080F0E96: - movs r0, 0 - b _080F0EC6 -_080F0E9A: - movs r1, 0 - adds r2, r3, 0 - adds r3, r0, 0 -_080F0EA0: - lsls r0, r1, 2 - adds r0, r4 - ldrb r0, [r0] - cmp r0, r3 - beq _080F0E96 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bls _080F0EA0 - lsls r0, r6, 24 - asrs r0, 22 - adds r0, r4 - strb r2, [r0] - movs r1, 0x1 - strb r1, [r0, 0x1] - ldrh r1, [r5, 0x2] - strh r1, [r0, 0x2] - movs r0, 0x1 -_080F0EC6: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80F0E84 - - thumb_func_start sub_80F0ECC -sub_80F0ECC: @ 80F0ECC - push {lr} - lsls r1, 24 - lsrs r2, r1, 24 - lsls r1, r2, 2 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _080F0EE2 - lsls r0, r2, 24 - asrs r0, 24 - b _080F0EE6 -_080F0EE2: - movs r0, 0x1 - negs r0, r0 -_080F0EE6: - pop {r1} - bx r1 - thumb_func_end sub_80F0ECC - - thumb_func_start sub_80F0EEC -sub_80F0EEC: @ 80F0EEC - push {r4,lr} - movs r4, 0 -_080F0EF0: - ldr r0, =0x03005d8c - ldr r0, [r0] - lsls r1, r4, 2 - adds r0, r1 - ldr r1, =0x00002b50 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x4 - bls _080F0F08 - adds r0, r4, 0 - bl sub_80EEE78 -_080F0F08: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _080F0EF0 - bl sub_80EEEB8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F0EEC - - thumb_func_start sub_80F0F24 -sub_80F0F24: @ 80F0F24 - push {r4,r5,lr} - ldr r0, =0x00000864 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080F0F50 - movs r2, 0 - ldr r5, =0x03005d8c - ldr r4, =0x00002b51 - movs r3, 0 -_080F0F3C: - ldr r0, [r5] - lsls r1, r2, 2 - adds r0, r1 - adds r0, r4 - strb r3, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bls _080F0F3C -_080F0F50: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F0F24 - - thumb_func_start sub_80F0F64 -sub_80F0F64: @ 80F0F64 - push {r4-r7,lr} - adds r6, r0, 0 - adds r5, r1, 0 - movs r0, 0x2C - bl AllocZeroed - adds r4, r0, 0 - movs r7, 0 -_080F0F74: - lsls r0, r7, 3 - adds r1, r0, r7 - lsls r1, 2 - adds r1, r6 - ldrb r1, [r1] - subs r1, 0x1 - adds r2, r0, 0 - cmp r1, 0x28 - bls _080F0F88 - b _080F11F4 -_080F0F88: - lsls r0, r1, 2 - ldr r1, =_080F0F98 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F0F98: - .4byte _080F103C - .4byte _080F103C - .4byte _080F105A - .4byte _080F11F4 - .4byte _080F1152 - .4byte _080F111E - .4byte _080F10E6 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F1092 - .4byte _080F10C6 - .4byte _080F118A - .4byte _080F11AA - .4byte _080F11CA - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11EA -_080F103C: - adds r0, r2, r7 - lsls r0, 2 - adds r0, r6, r0 - str r0, [r4] - adds r0, 0x10 - bl sub_8009228 - cmp r0, 0 - beq _080F1056 - ldr r1, [r4] - movs r0, 0x1 - strb r0, [r1, 0x18] - b _080F11F4 -_080F1056: - ldr r0, [r4] - b _080F11F2 -_080F105A: - adds r0, r2, r7 - lsls r0, 2 - adds r0, r6, r0 - str r0, [r4, 0x4] - adds r0, 0x5 - bl sub_8009228 - cmp r0, 0 - beq _080F1074 - ldr r1, [r4, 0x4] - movs r0, 0x1 - strb r0, [r1, 0xD] - b _080F1078 -_080F1074: - ldr r0, [r4, 0x4] - strb r5, [r0, 0xD] -_080F1078: - ldr r0, [r4, 0x4] - adds r0, 0x10 - bl sub_8009228 - cmp r0, 0 - beq _080F108C - ldr r1, [r4, 0x4] - movs r0, 0x1 - strb r0, [r1, 0xE] - b _080F11F4 -_080F108C: - ldr r0, [r4, 0x4] - strb r5, [r0, 0xE] - b _080F11F4 -_080F1092: - adds r0, r2, r7 - lsls r0, 2 - adds r0, r6, r0 - str r0, [r4, 0x18] - adds r0, 0x13 - bl sub_8009228 - cmp r0, 0 - beq _080F10AC - ldr r1, [r4, 0x18] - movs r0, 0x1 - strb r0, [r1, 0x2] - b _080F10B0 -_080F10AC: - ldr r0, [r4, 0x18] - strb r5, [r0, 0x2] -_080F10B0: - ldr r0, [r4, 0x18] - adds r0, 0x4 - bl sub_8009228 - cmp r0, 0 - beq _080F10C0 - ldr r1, [r4, 0x18] - b _080F10DA -_080F10C0: - ldr r0, [r4, 0x18] - strb r5, [r0, 0x3] - b _080F11F4 -_080F10C6: - adds r0, r2, r7 - lsls r0, 2 - adds r0, r6, r0 - str r0, [r4, 0x1C] - adds r0, 0x13 - bl sub_8009228 - cmp r0, 0 - beq _080F10E0 - ldr r1, [r4, 0x1C] -_080F10DA: - movs r0, 0x1 - strb r0, [r1, 0x3] - b _080F11F4 -_080F10E0: - ldr r0, [r4, 0x1C] - strb r5, [r0, 0x3] - b _080F11F4 -_080F10E6: - adds r0, r2, r7 - lsls r0, 2 - adds r0, r6, r0 - str r0, [r4, 0x14] - adds r0, 0x2 - bl sub_8009228 - cmp r0, 0 - beq _080F1100 - ldr r1, [r4, 0x14] - movs r0, 0x1 - strb r0, [r1, 0x1D] - b _080F1104 -_080F1100: - ldr r0, [r4, 0x14] - strb r5, [r0, 0x1D] -_080F1104: - ldr r0, [r4, 0x14] - adds r0, 0xC - bl sub_8009228 - cmp r0, 0 - beq _080F1118 - ldr r1, [r4, 0x14] - movs r0, 0x1 - strb r0, [r1, 0x1E] - b _080F11F4 -_080F1118: - ldr r0, [r4, 0x14] - strb r5, [r0, 0x1E] - b _080F11F4 -_080F111E: - adds r0, r2, r7 - lsls r0, 2 - adds r0, r6, r0 - str r0, [r4, 0x10] - adds r0, 0x16 - bl sub_8009228 - cmp r0, 0 - beq _080F1138 - ldr r1, [r4, 0x10] - movs r0, 0x1 - strb r0, [r1, 0x1E] - b _080F113C -_080F1138: - ldr r0, [r4, 0x10] - strb r5, [r0, 0x1E] -_080F113C: - ldr r0, [r4, 0x10] - adds r0, 0x8 - bl sub_8009228 - cmp r0, 0 - beq _080F114C - ldr r1, [r4, 0x10] - b _080F117E -_080F114C: - ldr r0, [r4, 0x10] - strb r5, [r0, 0x1F] - b _080F11F4 -_080F1152: - adds r0, r2, r7 - lsls r0, 2 - adds r0, r6, r0 - str r0, [r4, 0xC] - adds r0, 0xF - bl sub_8009228 - cmp r0, 0 - beq _080F116C - ldr r1, [r4, 0xC] - movs r0, 0x1 - strb r0, [r1, 0x1E] - b _080F1170 -_080F116C: - ldr r0, [r4, 0xC] - strb r5, [r0, 0x1E] -_080F1170: - ldr r0, [r4, 0xC] - adds r0, 0x4 - bl sub_8009228 - cmp r0, 0 - beq _080F1184 - ldr r1, [r4, 0xC] -_080F117E: - movs r0, 0x1 - strb r0, [r1, 0x1F] - b _080F11F4 -_080F1184: - ldr r0, [r4, 0xC] - strb r5, [r0, 0x1F] - b _080F11F4 -_080F118A: - adds r0, r2, r7 - lsls r0, 2 - adds r0, r6, r0 - str r0, [r4, 0x8] - adds r0, 0x13 - bl sub_8009228 - cmp r0, 0 - beq _080F11A4 - ldr r1, [r4, 0x8] - movs r0, 0x1 - strb r0, [r1, 0x2] - b _080F11F4 -_080F11A4: - ldr r0, [r4, 0x8] - strb r5, [r0, 0x2] - b _080F11F4 -_080F11AA: - adds r0, r2, r7 - lsls r0, 2 - adds r0, r6, r0 - str r0, [r4, 0x20] - adds r0, 0x13 - bl sub_8009228 - cmp r0, 0 - beq _080F11C4 - ldr r1, [r4, 0x20] - movs r0, 0x1 - strb r0, [r1, 0x6] - b _080F11F4 -_080F11C4: - ldr r0, [r4, 0x20] - strb r5, [r0, 0x6] - b _080F11F4 -_080F11CA: - adds r0, r2, r7 - lsls r0, 2 - adds r0, r6, r0 - str r0, [r4, 0x24] - adds r0, 0x13 - bl sub_8009228 - cmp r0, 0 - beq _080F11E4 - ldr r1, [r4, 0x24] - movs r0, 0x1 - strb r0, [r1, 0xB] - b _080F11F4 -_080F11E4: - ldr r0, [r4, 0x24] - strb r5, [r0, 0xB] - b _080F11F4 -_080F11EA: - adds r0, r2, r7 - lsls r0, 2 - adds r0, r6, r0 - str r0, [r4, 0x28] -_080F11F2: - strb r5, [r0, 0x18] -_080F11F4: - adds r7, 0x1 - cmp r7, 0x17 - bgt _080F11FC - b _080F0F74 -_080F11FC: - adds r0, r4, 0 - bl Free - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80F0F64 - - thumb_func_start sub_80F1208 -sub_80F1208: @ 80F1208 - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_80F14F8 - adds r4, r5, 0 - movs r1, 0xD8 - lsls r1, 2 - adds r0, r4, r1 - cmp r4, r0 - bcs _080F124C -_080F121C: - ldrb r0, [r4] - cmp r0, 0x7 - bne _080F1240 - ldrb r0, [r4, 0x1D] - cmp r0, 0x1 - bne _080F1230 - ldrb r0, [r4, 0x1E] - cmp r0, 0x1 - bne _080F1236 - b _080F1240 -_080F1230: - ldrb r0, [r4, 0x1E] - cmp r0, 0x1 - bne _080F1240 -_080F1236: - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x24 - bl memset -_080F1240: - adds r4, 0x24 - movs r1, 0xD8 - lsls r1, 2 - adds r0, r5, r1 - cmp r4, r0 - bcc _080F121C -_080F124C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80F1208 - - thumb_func_start sub_80F1254 -sub_80F1254: @ 80F1254 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r4, 0 - movs r1, 0xD8 - lsls r1, 2 - adds r0, r4, r1 - cmp r4, r0 - bcs _080F128A -_080F1264: - ldrb r0, [r4] - cmp r0, 0x7 - bne _080F127E - adds r0, r4, 0 - adds r0, 0xC - bl sub_8009228 - cmp r0, 0 - beq _080F127A - movs r0, 0x1 - b _080F127C -_080F127A: - movs r0, 0x2 -_080F127C: - strb r0, [r4, 0x1E] -_080F127E: - adds r4, 0x24 - movs r1, 0xD8 - lsls r1, 2 - adds r0, r5, r1 - cmp r4, r0 - bcc _080F1264 -_080F128A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80F1254 - - thumb_func_start sub_80F1290 -sub_80F1290: @ 80F1290 - push {lr} - bl sub_8009228 - movs r1, 0x2 - cmp r0, 0 - beq _080F129E - movs r1, 0x1 -_080F129E: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end sub_80F1290 - - thumb_func_start sub_80F12A4 -sub_80F12A4: @ 80F12A4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r4, 0 - movs r1, 0xD8 - lsls r1, 2 - adds r0, r4, r1 - cmp r4, r0 - bcc _080F12B6 - b _080F14F0 -_080F12B6: - ldrb r0, [r4] - subs r0, 0x1 - cmp r0, 0x28 - bls _080F12C0 - b _080F14E2 -_080F12C0: - lsls r0, 2 - ldr r1, =_080F12D0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F12D0: - .4byte _080F1374 - .4byte _080F137A - .4byte _080F1380 - .4byte _080F138E - .4byte _080F139A - .4byte _080F13A8 - .4byte _080F13BE - .4byte _080F13CC - .4byte _080F13E0 - .4byte _080F13F4 - .4byte _080F1408 - .4byte _080F1416 - .4byte _080F14E2 - .4byte _080F14E2 - .4byte _080F14E2 - .4byte _080F14E2 - .4byte _080F14E2 - .4byte _080F14E2 - .4byte _080F14E2 - .4byte _080F14E2 - .4byte _080F142A - .4byte _080F1438 - .4byte _080F1444 - .4byte _080F1450 - .4byte _080F145C - .4byte _080F14AC - .4byte _080F1468 - .4byte _080F14B8 - .4byte _080F148C - .4byte _080F1474 - .4byte _080F14AC - .4byte _080F14B8 - .4byte _080F1480 - .4byte _080F148C - .4byte _080F1498 - .4byte _080F14AC - .4byte _080F14B8 - .4byte _080F14C4 - .4byte _080F14D8 - .4byte _080F14E2 - .4byte _080F14E2 -_080F1374: - adds r0, r4, 0 - adds r0, 0x10 - b _080F1422 -_080F137A: - adds r0, r4, 0 - adds r0, 0x10 - b _080F1422 -_080F1380: - adds r0, r4, 0x5 - bl sub_80F1290 - strb r0, [r4, 0xD] - adds r0, r4, 0 - adds r0, 0x10 - b _080F1478 -_080F138E: - adds r0, r4, 0 - adds r0, 0xB - bl sub_80F1290 - strb r0, [r4, 0x17] - b _080F14E2 -_080F139A: - adds r0, r4, 0 - adds r0, 0xF - bl sub_80F1290 - strb r0, [r4, 0x1E] - adds r0, r4, 0x4 - b _080F13B6 -_080F13A8: - adds r0, r4, 0 - adds r0, 0x16 - bl sub_80F1290 - strb r0, [r4, 0x1E] - adds r0, r4, 0 - adds r0, 0x8 -_080F13B6: - bl sub_80F1290 - strb r0, [r4, 0x1F] - b _080F14E2 -_080F13BE: - adds r0, r4, 0x2 - bl sub_80F1290 - strb r0, [r4, 0x1D] - adds r0, r4, 0 - adds r0, 0xC - b _080F13D8 -_080F13CC: - adds r0, r4, 0 - adds r0, 0x14 - bl sub_80F1290 - strb r0, [r4, 0x1D] - adds r0, r4, 0x4 -_080F13D8: - bl sub_80F1290 - strb r0, [r4, 0x1E] - b _080F14E2 -_080F13E0: - adds r0, r4, 0 - adds r0, 0xC - bl sub_80F1290 - strb r0, [r4, 0x14] - adds r0, r4, 0x4 - bl sub_80F1290 - strb r0, [r4, 0x15] - b _080F14E2 -_080F13F4: - adds r0, r4, 0x4 - bl sub_80F1290 - strb r0, [r4, 0x19] - adds r0, r4, 0 - adds r0, 0xC - bl sub_80F1290 - strb r0, [r4, 0x1A] - b _080F14E2 -_080F1408: - adds r0, r4, 0x2 - bl sub_80F1290 - strb r0, [r4, 0x17] - adds r0, r4, 0 - adds r0, 0xC - b _080F1422 -_080F1416: - adds r0, r4, 0x2 - bl sub_80F1290 - strb r0, [r4, 0x17] - adds r0, r4, 0 - adds r0, 0xB -_080F1422: - bl sub_80F1290 - strb r0, [r4, 0x18] - b _080F14E2 -_080F142A: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0x2] - adds r0, r4, 0x4 - b _080F143C -_080F1438: - adds r0, r4, 0 - adds r0, 0x13 -_080F143C: - bl sub_80F1290 - strb r0, [r4, 0x3] - b _080F14E2 -_080F1444: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0x2] - b _080F14E2 -_080F1450: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0x6] - b _080F14E2 -_080F145C: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0xB] - b _080F14E2 -_080F1468: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0x9] - b _080F14E2 -_080F1474: - adds r0, r4, 0 - adds r0, 0x13 -_080F1478: - bl sub_80F1290 - strb r0, [r4, 0xE] - b _080F14E2 -_080F1480: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0x11] - b _080F14E2 -_080F148C: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0x8] - b _080F14E2 -_080F1498: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0xF] - adds r0, r4, 0x4 - bl sub_80F1290 - strb r0, [r4, 0x10] - b _080F14E2 -_080F14AC: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0xC] - b _080F14E2 -_080F14B8: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0x5] - b _080F14E2 -_080F14C4: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0x1B] - adds r0, r4, 0x4 - bl sub_80F1290 - strb r0, [r4, 0x1C] - b _080F14E2 -_080F14D8: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0x4] -_080F14E2: - adds r4, 0x24 - movs r1, 0xD8 - lsls r1, 2 - adds r0, r5, r1 - cmp r4, r0 - bcs _080F14F0 - b _080F12B6 -_080F14F0: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80F12A4 - - thumb_func_start sub_80F14F8 -sub_80F14F8: @ 80F14F8 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r5, 0 - movs r6, 0x17 -_080F1500: - ldrb r0, [r4] - cmp r0, 0x17 - beq _080F151C - cmp r0, 0x19 - bne _080F152C - ldrb r0, [r4, 0xA] - cmp r0, 0x58 - bls _080F152C - adds r0, r5, 0 - movs r1, 0 - movs r2, 0x24 - bl memset - b _080F152C -_080F151C: - ldrb r0, [r4, 0x12] - cmp r0, 0x58 - bls _080F152C - adds r0, r5, 0 - movs r1, 0 - movs r2, 0x24 - bl memset -_080F152C: - adds r4, 0x24 - adds r5, 0x24 - subs r6, 0x1 - cmp r6, 0 - bge _080F1500 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80F14F8 - - thumb_func_start sub_80F153C -sub_80F153C: @ 80F153C - push {lr} - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r2, r0 - ldr r1, =0x000027cd - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080F155A - b _080F16E6 -_080F155A: - subs r1, 0x1 - adds r0, r2, r1 - ldrb r0, [r0] - subs r0, 0x1 - cmp r0, 0x28 - bls _080F1568 - b _080F16E6 -_080F1568: - lsls r0, 2 - ldr r1, =_080F1584 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F1584: - .4byte _080F1628 - .4byte _080F162E - .4byte _080F1634 - .4byte _080F163A - .4byte _080F165E - .4byte _080F1646 - .4byte _080F164C - .4byte _080F1664 - .4byte _080F1670 - .4byte _080F166A - .4byte _080F16B8 - .4byte _080F16E2 - .4byte _080F16E6 - .4byte _080F16E6 - .4byte _080F16E6 - .4byte _080F16E6 - .4byte _080F16E6 - .4byte _080F16E6 - .4byte _080F16E6 - .4byte _080F16E6 - .4byte _080F1652 - .4byte _080F1658 - .4byte _080F1676 - .4byte _080F167C - .4byte _080F1682 - .4byte _080F1688 - .4byte _080F168E - .4byte _080F1694 - .4byte _080F169A - .4byte _080F16A0 - .4byte _080F16A6 - .4byte _080F16AC - .4byte _080F16B2 - .4byte _080F16BE - .4byte _080F16C4 - .4byte _080F16CA - .4byte _080F16D0 - .4byte _080F16D6 - .4byte _080F16DC - .4byte _080F16E6 - .4byte _080F1640 -_080F1628: - bl DoTVShowPokemonFanClubLetter - b _080F16E6 -_080F162E: - bl DoTVShowRecentHappenings - b _080F16E6 -_080F1634: - bl DoTVShowPokemonFanClubOpinions - b _080F16E6 -_080F163A: - bl DoTVShowDummiedOut - b _080F16E6 -_080F1640: - bl DoTVShowPokemonNewsMassOutbreak - b _080F16E6 -_080F1646: - bl DoTVShowBravoTrainerPokemonProfile - b _080F16E6 -_080F164C: - bl DoTVShowBravoTrainerBattleTower - b _080F16E6 -_080F1652: - bl DoTVShowPokemonTodaySuccessfulCapture - b _080F16E6 -_080F1658: - bl DoTVShowTodaysSmartShopper - b _080F16E6 -_080F165E: - bl DoTVShowTheNameRaterShow - b _080F16E6 -_080F1664: - bl DoTVShowPokemonContestLiveUpdates - b _080F16E6 -_080F166A: - bl DoTVShowPokemonBattleUpdate - b _080F16E6 -_080F1670: - bl DoTVShow3CheersForPokeblocks - b _080F16E6 -_080F1676: - bl DoTVShowPokemonTodayFailedCapture - b _080F16E6 -_080F167C: - bl DoTVShowPokemonAngler - b _080F16E6 -_080F1682: - bl DoTVShowTheWorldOfMasters - b _080F16E6 -_080F1688: - bl DoTVShowTodaysRivalTrainer - b _080F16E6 -_080F168E: - bl DoTVShowDewfordTrendWatcherNetwork - b _080F16E6 -_080F1694: - bl DoTVShowHoennTreasureInvestigators - b _080F16E6 -_080F169A: - bl DoTVShowFindThatGamer - b _080F16E6 -_080F16A0: - bl DoTVShowBreakingNewsTV - b _080F16E6 -_080F16A6: - bl DoTVShowSecretBaseVisit - b _080F16E6 -_080F16AC: - bl DoTVShowPokemonLotterWinnerFlashReport - b _080F16E6 -_080F16B2: - bl DoTVShowThePokemonBattleSeminar - b _080F16E6 -_080F16B8: - bl DoTVShowTrainerFanClubSpecial - b _080F16E6 -_080F16BE: - bl DoTVShowTrainerFanClub - b _080F16E6 -_080F16C4: - bl DoTVShowSpotTheCuties - b _080F16E6 -_080F16CA: - bl DoTVShowPokemonNewsBattleFrontier - b _080F16E6 -_080F16D0: - bl DoTVShowWhatsNo1InHoennToday - b _080F16E6 -_080F16D6: - bl DoTVShowSecretBaseSecrets - b _080F16E6 -_080F16DC: - bl DoTVShowSafariFanClub - b _080F16E6 -_080F16E2: - bl DoTVShowPokemonContestLiveUpdates2 -_080F16E6: - pop {r0} - bx r0 - thumb_func_end sub_80F153C - - thumb_func_start DoTVShowBravoTrainerPokemonProfile -DoTVShowBravoTrainerPokemonProfile: @ 80F16EC - push {r4,r5,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r5, [r0] - cmp r5, 0x8 - bls _080F1712 - b _080F1952 -_080F1712: - lsls r0, r5, 2 - ldr r1, =_080F1734 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F1734: - .4byte _080F1758 - .4byte _080F17B0 - .4byte _080F17E8 - .4byte _080F1818 - .4byte _080F184C - .4byte _080F1880 - .4byte _080F18C4 - .4byte _080F190C - .4byte _080F193C -_080F1758: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x16 - ldrb r2, [r4, 0x1E] - bl sub_81DB5E8 - ldrb r1, [r4, 0x13] - lsls r1, 29 - lsrs r1, 29 - movs r0, 0x1 - bl CopyContestCategoryToStringVar - ldrb r1, [r4, 0x13] - lsls r1, 27 - lsrs r1, 30 - movs r0, 0x2 - bl sub_80EF1BC - ldrh r1, [r4, 0x2] - movs r0, 0xB - muls r0, r1 - ldr r1, =gSpeciesNames - adds r0, r1 - adds r1, r4, 0 - adds r1, 0x8 - bl CompareString - cmp r0, 0 - bne _080F17A4 - ldr r1, =0x0203a030 - movs r0, 0x8 - b _080F1950 - .pool -_080F17A4: - ldr r1, =0x0203a030 - movs r0, 0x1 - b _080F1950 - .pool -_080F17B0: - ldr r0, =0x02021cc4 - ldrh r2, [r4, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021dc4 - adds r1, r4, 0 - adds r1, 0x8 - ldrb r2, [r4, 0x1F] - bl sub_81DB5E8 - ldrb r1, [r4, 0x13] - lsls r1, 29 - lsrs r1, 29 - movs r0, 0x2 - bl CopyContestCategoryToStringVar - b _080F194C - .pool -_080F17E8: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x16 - ldrb r2, [r4, 0x1E] - bl sub_81DB5E8 - ldrb r1, [r4, 0x13] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - bne _080F180C - ldr r1, =0x0203a030 - movs r0, 0x3 - b _080F1950 - .pool -_080F180C: - ldr r1, =0x0203a030 - movs r0, 0x4 - b _080F1950 - .pool -_080F1818: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x16 - ldrb r2, [r4, 0x1E] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r1, [r4, 0x4] - bl CopyEasyChatWord - ldrb r1, [r4, 0x13] - lsls r1, 25 - lsrs r1, 30 - adds r1, 0x1 - movs r0, 0x2 - bl sub_80EF340 - ldr r1, =0x0203a030 - movs r0, 0x5 - b _080F1950 - .pool -_080F184C: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x16 - ldrb r2, [r4, 0x1E] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r1, [r4, 0x4] - bl CopyEasyChatWord - ldrb r1, [r4, 0x13] - lsls r1, 25 - lsrs r1, 30 - adds r1, 0x1 - movs r0, 0x2 - bl sub_80EF340 - ldr r1, =0x0203a030 - movs r0, 0x5 - b _080F1950 - .pool -_080F1880: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x16 - ldrb r2, [r4, 0x1E] - bl sub_81DB5E8 - ldrb r1, [r4, 0x13] - lsls r1, 29 - lsrs r1, 29 - movs r0, 0x1 - bl CopyContestCategoryToStringVar - ldr r0, =0x02021ec4 - ldrh r1, [r4, 0x6] - bl CopyEasyChatWord - ldrh r0, [r4, 0x14] - cmp r0, 0 - beq _080F18B8 - ldr r1, =0x0203a030 - movs r0, 0x6 - b _080F1950 - .pool -_080F18B8: - ldr r1, =0x0203a030 - movs r0, 0x7 - b _080F1950 - .pool -_080F18C4: - ldr r0, =0x02021cc4 - ldrh r2, [r4, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021dc4 - ldrh r2, [r4, 0x14] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021ec4 - ldrh r1, [r4, 0x6] - bl CopyEasyChatWord - ldr r1, =0x0203a030 - movs r0, 0x7 - b _080F1950 - .pool -_080F190C: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x16 - ldrb r2, [r4, 0x1E] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r4, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - bl TVShowDone - b _080F1952 - .pool -_080F193C: - ldr r0, =0x02021cc4 - ldrh r2, [r4, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString -_080F194C: - ldr r1, =0x0203a030 - movs r0, 0x2 -_080F1950: - strb r0, [r1] -_080F1952: - ldr r0, =gUnknown_0858D204 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowBravoTrainerPokemonProfile - - thumb_func_start DoTVShowBravoTrainerBattleTower -DoTVShowBravoTrainerBattleTower: @ 80F1974 - push {r4,r5,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r5, [r0] - adds r2, r0, 0 - cmp r5, 0xE - bls _080F199C - b _080F1BEA -_080F199C: - lsls r0, r5, 2 - ldr r1, =_080F19C0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F19C0: - .4byte _080F19FC - .4byte _080F1A40 - .4byte _080F1A90 - .4byte _080F1AB4 - .4byte _080F1AE0 - .4byte _080F1B28 - .4byte _080F1B38 - .4byte _080F1B48 - .4byte _080F1B4E - .4byte _080F1B4E - .4byte _080F1B4E - .4byte _080F1B68 - .4byte _080F1B94 - .4byte _080F1B94 - .4byte _080F1BCC -_080F19FC: - ldr r0, =0x02021cc4 - adds r1, r4, 0x2 - ldrb r2, [r4, 0x1D] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r4, 0xA] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldrh r0, [r4, 0x16] - cmp r0, 0x6 - bls _080F1A34 - ldr r1, =0x0203a030 - movs r0, 0x1 - strb r0, [r1] - b _080F1BEA - .pool -_080F1A34: - ldr r1, =0x0203a030 - movs r0, 0x2 - strb r0, [r1] - b _080F1BEA - .pool -_080F1A40: - ldrb r0, [r4, 0x1A] - cmp r0, 0x32 - bne _080F1A58 - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EAEB1 - bl CopyString - b _080F1A60 - .pool -_080F1A58: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EAEB8 - bl CopyString -_080F1A60: - ldrh r1, [r4, 0x16] - movs r0, 0x1 - bl sub_80EF340 - ldrb r0, [r4, 0x1C] - cmp r0, 0x1 - bne _080F1A84 - ldr r1, =0x0203a030 - movs r0, 0x3 - strb r0, [r1] - b _080F1BEA - .pool -_080F1A84: - ldr r1, =0x0203a030 - movs r0, 0x4 - strb r0, [r1] - b _080F1BEA - .pool -_080F1A90: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x1E] - bl sub_81DB5E8 - ldrh r1, [r4, 0x16] - adds r1, 0x1 - movs r0, 0x1 - bl sub_80EF340 -_080F1AA6: - ldrb r0, [r4, 0x1B] - cmp r0, 0 - beq _080F1B02 - b _080F1B1C - .pool -_080F1AB4: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x1E] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r4, 0x14] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - b _080F1AA6 - .pool -_080F1AE0: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x1E] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r4, 0x14] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldrb r0, [r4, 0x1B] - cmp r0, 0 - bne _080F1B1C -_080F1B02: - ldr r1, =0x0203a030 - movs r0, 0x5 - strb r0, [r1] - b _080F1BEA - .pool -_080F1B1C: - ldr r1, =0x0203a030 - movs r0, 0x6 - strb r0, [r1] - b _080F1BEA - .pool -_080F1B28: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x1E] - b _080F1B54 - .pool -_080F1B38: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x1E] - b _080F1B54 - .pool -_080F1B48: - movs r0, 0xB - strb r0, [r2] - b _080F1BEA -_080F1B4E: - ldr r0, =0x02021cc4 - adds r1, r4, 0x2 - ldrb r2, [r4, 0x1D] -_080F1B54: - bl sub_81DB5E8 - ldr r1, =0x0203a030 - movs r0, 0xB - strb r0, [r1] - b _080F1BEA - .pool -_080F1B68: - ldr r0, =0x02021cc4 - ldrh r1, [r4, 0x18] - bl CopyEasyChatWord - ldrb r0, [r4, 0x1B] - cmp r0, 0 - bne _080F1B88 - ldr r1, =0x0203a030 - movs r0, 0xC - strb r0, [r1] - b _080F1BEA - .pool -_080F1B88: - ldr r1, =0x0203a030 - movs r0, 0xD - strb r0, [r1] - b _080F1BEA - .pool -_080F1B94: - ldr r0, =0x02021cc4 - ldrh r1, [r4, 0x18] - bl CopyEasyChatWord - ldr r0, =0x02021dc4 - adds r1, r4, 0x2 - ldrb r2, [r4, 0x1D] - bl sub_81DB5E8 - ldr r0, =0x02021ec4 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x1E] - bl sub_81DB5E8 - ldr r1, =0x0203a030 - movs r0, 0xE - strb r0, [r1] - b _080F1BEA - .pool -_080F1BCC: - ldr r0, =0x02021cc4 - adds r1, r4, 0x2 - ldrb r2, [r4, 0x1D] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r4, 0xA] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - bl TVShowDone -_080F1BEA: - ldr r0, =gUnknown_0858D240 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowBravoTrainerBattleTower - - thumb_func_start DoTVShowTodaysSmartShopper -DoTVShowTodaysSmartShopper: @ 80F1C0C - push {r4-r6,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r5, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r6, [r0] - adds r2, r0, 0 - cmp r6, 0xC - bls _080F1C34 - b _080F1E2C -_080F1C34: - lsls r0, r6, 2 - ldr r1, =_080F1C58 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F1C58: - .4byte _080F1C8C - .4byte _080F1CC8 - .4byte _080F1D10 - .4byte _080F1D22 - .4byte _080F1D10 - .4byte _080F1D10 - .4byte _080F1D4C - .4byte _080F1D7C - .4byte _080F1DAC - .4byte _080F1DB8 - .4byte _080F1DC6 - .4byte _080F1DD8 - .4byte _080F1E1C -_080F1C8C: - ldr r0, =0x02021cc4 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x3] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrb r1, [r5, 0x12] - movs r2, 0 - bl GetMapName - ldrh r0, [r5, 0xC] - cmp r0, 0xFE - bls _080F1CBC - ldr r1, =0x0203a030 - movs r0, 0xB - strb r0, [r1] - b _080F1E2C - .pool -_080F1CBC: - ldr r1, =0x0203a030 - movs r0, 0x1 - strb r0, [r1] - b _080F1E2C - .pool -_080F1CC8: - ldr r0, =0x02021cc4 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x3] - bl sub_81DB5E8 - ldr r4, =0x02021dc4 - ldrh r0, [r5, 0x6] - bl itemid_get_item - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - ldrh r1, [r5, 0xC] - movs r0, 0x2 - bl sub_80EF340 - ldr r4, =0x0203a030 - bl GenerateRandomNumber - ldrb r2, [r4] - adds r2, 0x1 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - ands r0, r1 - adds r0, r2 - strb r0, [r4] - b _080F1E2C - .pool -_080F1D10: - ldrh r0, [r5, 0x8] - cmp r0, 0 - beq _080F1D1C - movs r0, 0x6 - strb r0, [r2] - b _080F1E2C -_080F1D1C: - movs r0, 0xA - strb r0, [r2] - b _080F1E2C -_080F1D22: - ldrh r1, [r5, 0xC] - adds r1, 0x1 - movs r0, 0x2 - bl sub_80EF340 - ldrh r0, [r5, 0x8] - cmp r0, 0 - beq _080F1D40 - ldr r1, =0x0203a030 - movs r0, 0x6 - strb r0, [r1] - b _080F1E2C - .pool -_080F1D40: - ldr r1, =0x0203a030 - movs r0, 0xA - strb r0, [r1] - b _080F1E2C - .pool -_080F1D4C: - ldr r4, =0x02021dc4 - ldrh r0, [r5, 0x8] - bl itemid_get_item - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - ldrh r1, [r5, 0xE] - movs r0, 0x2 - bl sub_80EF340 - ldrh r0, [r5, 0xA] - cmp r0, 0 - beq _080F1D94 - ldr r1, =0x0203a030 - movs r0, 0x7 - strb r0, [r1] - b _080F1E2C - .pool -_080F1D7C: - ldr r4, =0x02021dc4 - ldrh r0, [r5, 0xA] - bl itemid_get_item - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - ldrh r1, [r5, 0x10] - movs r0, 0x2 - bl sub_80EF340 -_080F1D94: - ldrb r0, [r5, 0x2] - cmp r0, 0x1 - beq _080F1DFA - ldr r1, =0x0203a030 - movs r0, 0x9 - strb r0, [r1] - b _080F1E2C - .pool -_080F1DAC: - ldrh r0, [r5, 0xC] - cmp r0, 0xFE - bls _080F1DD2 - movs r0, 0xC - strb r0, [r2] - b _080F1E2C -_080F1DB8: - movs r0, 0x1 - adds r1, r5, 0 - bl sub_80EF40C - bl TVShowDone - b _080F1E2C -_080F1DC6: - ldrb r0, [r5, 0x2] - cmp r0, 0x1 - bne _080F1DD2 - movs r0, 0x8 - strb r0, [r2] - b _080F1E2C -_080F1DD2: - movs r0, 0x9 - strb r0, [r2] - b _080F1E2C -_080F1DD8: - ldr r0, =0x02021cc4 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x3] - bl sub_81DB5E8 - ldr r4, =0x02021dc4 - ldrh r0, [r5, 0x6] - bl itemid_get_item - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - ldrb r0, [r5, 0x2] - cmp r0, 0x1 - bne _080F1E10 -_080F1DFA: - ldr r1, =0x0203a030 - movs r0, 0x8 - strb r0, [r1] - b _080F1E2C - .pool -_080F1E10: - ldr r1, =0x0203a030 - movs r0, 0xC - strb r0, [r1] - b _080F1E2C - .pool -_080F1E1C: - ldr r0, =0x02021cc4 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x3] - bl sub_81DB5E8 - bl TVShowDone -_080F1E2C: - ldr r0, =gUnknown_0858D1D0 - lsls r1, r6, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowTodaysSmartShopper - - thumb_func_start DoTVShowTheNameRaterShow -DoTVShowTheNameRaterShow: @ 80F1E48 - push {r4-r6,lr} - sub sp, 0x8 - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r5, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r6, [r0] - adds r2, r0, 0 - cmp r6, 0x12 - bls _080F1E72 - b _080F20FE -_080F1E72: - lsls r0, r6, 2 - ldr r1, =_080F1E94 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F1E94: - .4byte _080F1EE0 - .4byte _080F1F28 - .4byte _080F1F4A - .4byte _080F1F28 - .4byte _080F1F28 - .4byte _080F1F28 - .4byte _080F1F28 - .4byte _080F1F28 - .4byte _080F1F28 - .4byte _080F1F90 - .4byte _080F1F90 - .4byte _080F1F90 - .4byte _080F20EC - .4byte _080F1FCC - .4byte _080F200C - .4byte _080F202C - .4byte _080F2074 - .4byte _080F20A4 - .4byte _080F20F0 -_080F1EE0: - ldr r0, =0x02021cc4 - adds r1, r5, 0 - adds r1, 0xF - ldrb r2, [r5, 0x1E] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r5, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021ec4 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x1F] - bl sub_81DB5E8 - ldr r4, =0x0203a030 - adds r0, r5, 0 - bl sub_80EFBA4 - adds r0, 0x1 - strb r0, [r4] - b _080F20FE - .pool -_080F1F28: - ldrb r0, [r5, 0x1A] - cmp r0, 0 - bne _080F1F34 - movs r0, 0x9 - strb r0, [r2] - b _080F20FE -_080F1F34: - cmp r0, 0x1 - bne _080F1F3E - movs r0, 0xA - strb r0, [r2] - b _080F20FE -_080F1F3E: - cmp r0, 0x2 - beq _080F1F44 - b _080F20FE -_080F1F44: - movs r0, 0xB - strb r0, [r2] - b _080F20FE -_080F1F4A: - ldr r0, =0x02021cc4 - adds r1, r5, 0 - adds r1, 0xF - ldrb r2, [r5, 0x1E] - bl sub_81DB5E8 - ldrb r0, [r5, 0x1A] - cmp r0, 0 - bne _080F1F6C - ldr r1, =0x0203a030 - movs r0, 0x9 - strb r0, [r1] - b _080F20FE - .pool -_080F1F6C: - cmp r0, 0x1 - bne _080F1F7C - ldr r1, =0x0203a030 - movs r0, 0xA - strb r0, [r1] - b _080F20FE - .pool -_080F1F7C: - cmp r0, 0x2 - beq _080F1F82 - b _080F20FE -_080F1F82: - ldr r1, =0x0203a030 - movs r0, 0xB - strb r0, [r1] - b _080F20FE - .pool -_080F1F90: - ldr r0, =0x02021cc4 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x1F] - bl sub_81DB5E8 - movs r4, 0 - str r4, [sp] - str r5, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_80EFBDC - str r4, [sp] - str r5, [sp, 0x4] - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0 - movs r3, 0x1 - bl sub_80EFBDC - ldr r1, =0x0203a030 - movs r0, 0xC - strb r0, [r1] - b _080F20FE - .pool -_080F1FCC: - ldr r0, =0x02021cc4 - adds r1, r5, 0 - adds r1, 0xF - ldrb r2, [r5, 0x1E] - bl sub_81DB5E8 - movs r4, 0 - str r4, [sp] - str r5, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0x2 - movs r3, 0 - bl sub_80EFBDC - str r4, [sp] - str r5, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0x3 - movs r3, 0x1 - bl sub_80EFBDC - ldr r1, =0x0203a030 - movs r0, 0xE - strb r0, [r1] - b _080F20FE - .pool -_080F200C: - movs r4, 0 - str r4, [sp] - str r5, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0x2 - movs r3, 0x1 - bl sub_80EFBDC - str r4, [sp] - str r5, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0x3 - movs r3, 0 - b _080F20D2 -_080F202C: - movs r0, 0 - str r0, [sp] - str r5, [sp, 0x4] - movs r1, 0 - movs r2, 0x2 - movs r3, 0x1 - bl sub_80EFBDC - ldr r0, =0x02021dc4 - ldrh r2, [r5, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldrh r0, [r5, 0x2] - str r0, [sp] - str r5, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0x3 - movs r3, 0x2 - bl sub_80EFBDC - ldr r1, =0x0203a030 - movs r0, 0x10 - strb r0, [r1] - b _080F20FE - .pool -_080F2074: - ldrh r0, [r5, 0x2] - str r0, [sp] - str r5, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0x2 - movs r3, 0x2 - bl sub_80EFBDC - movs r0, 0 - str r0, [sp] - str r5, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0x3 - movs r3, 0x1 - bl sub_80EFBDC - ldr r1, =0x0203a030 - movs r0, 0x11 - strb r0, [r1] - b _080F20FE - .pool -_080F20A4: - movs r0, 0 - str r0, [sp] - str r5, [sp, 0x4] - movs r1, 0 - movs r2, 0x2 - movs r3, 0x1 - bl sub_80EFBDC - ldr r0, =0x02021dc4 - ldrh r2, [r5, 0x1C] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldrh r0, [r5, 0x1C] - str r0, [sp] - str r5, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0x3 - movs r3, 0x2 -_080F20D2: - bl sub_80EFBDC - ldr r1, =0x0203a030 - movs r0, 0x12 - strb r0, [r1] - b _080F20FE - .pool -_080F20EC: - movs r6, 0x12 - strb r6, [r2] -_080F20F0: - ldr r0, =0x02021cc4 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x1F] - bl sub_81DB5E8 - bl TVShowDone -_080F20FE: - ldr r0, =gUnknown_0858D338 - lsls r1, r6, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowTheNameRaterShow - - thumb_func_start DoTVShowPokemonTodaySuccessfulCapture -DoTVShowPokemonTodaySuccessfulCapture: @ 80F211C - push {r4-r6,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r5, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r6, [r0] - adds r2, r0, 0 - cmp r6, 0xB - bls _080F2144 - b _080F2358 -_080F2144: - lsls r0, r6, 2 - ldr r1, =_080F2168 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F2168: - .4byte _080F2198 - .4byte _080F21EC - .4byte _080F21F2 - .4byte _080F222C - .4byte _080F2264 - .4byte _080F226A - .4byte _080F22A0 - .4byte _080F22F4 - .4byte _080F22F4 - .4byte _080F2324 - .4byte _080F2324 - .4byte _080F2354 -_080F2198: - ldr r0, =0x02021cc4 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x2] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r5, 0x10] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021ec4 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x3] - bl sub_81DB5E8 - ldrb r0, [r5, 0xF] - cmp r0, 0x1 - bne _080F21E0 - ldr r1, =0x0203a030 - movs r0, 0x5 - strb r0, [r1] - b _080F2358 - .pool -_080F21E0: - ldr r1, =0x0203a030 - movs r0, 0x1 - strb r0, [r1] - b _080F2358 - .pool -_080F21EC: - movs r0, 0x2 - strb r0, [r2] - b _080F2358 -_080F21F2: - ldr r4, =0x02021dc4 - ldrb r0, [r5, 0xF] - bl itemid_get_item - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - ldrb r1, [r5, 0x12] - movs r0, 0x2 - bl sub_80EF340 - ldrb r0, [r5, 0x12] - cmp r0, 0x3 - bhi _080F2220 - ldr r1, =0x0203a030 - movs r0, 0x3 - strb r0, [r1] - b _080F2358 - .pool -_080F2220: - ldr r1, =0x0203a030 - movs r0, 0x4 - strb r0, [r1] - b _080F2358 - .pool -_080F222C: - ldr r0, =0x02021cc4 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x2] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r5, 0x10] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021ec4 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x3] - bl sub_81DB5E8 - b _080F2286 - .pool -_080F2264: - movs r0, 0x6 - strb r0, [r2] - b _080F2358 -_080F226A: - ldr r0, =0x02021cc4 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x2] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r5, 0x10] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString -_080F2286: - ldr r1, =0x0203a030 - movs r0, 0x6 - strb r0, [r1] - b _080F2358 - .pool -_080F22A0: - ldr r0, =0x02021cc4 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x2] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r5, 0x10] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021ec4 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x3] - bl sub_81DB5E8 - ldr r4, =0x0203a030 - bl GenerateRandomNumber - ldrb r2, [r4] - adds r2, 0x1 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - ands r0, r1 - adds r0, r2 - strb r0, [r4] - b _080F2358 - .pool -_080F22F4: - ldr r0, =0x02021cc4 - ldrh r1, [r5, 0x10] - movs r4, 0xB - muls r1, r4 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021dc4 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x3] - bl sub_81DB5E8 - ldrh r1, [r5, 0x10] - movs r0, 0x2 - bl sub_80EF9E8 - b _080F233E - .pool -_080F2324: - ldr r0, =0x02021cc4 - ldrh r1, [r5, 0x10] - movs r4, 0xB - muls r1, r4 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021dc4 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x3] - bl sub_81DB5E8 -_080F233E: - ldr r0, =0x0203a030 - strb r4, [r0] - b _080F2358 - .pool -_080F2354: - bl TVShowDone -_080F2358: - ldr r0, =gUnknown_0858D1A0 - lsls r1, r6, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowPokemonTodaySuccessfulCapture - - thumb_func_start DoTVShowPokemonTodayFailedCapture -DoTVShowPokemonTodayFailedCapture: @ 80F2370 - push {r4,r5,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r5, [r0] - cmp r5, 0x6 - bls _080F2396 - b _080F24C0 -_080F2396: - lsls r0, r5, 2 - ldr r1, =_080F23B8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F23B8: - .4byte _080F23D4 - .4byte _080F2408 - .4byte _080F245C - .4byte _080F245C - .4byte _080F24A0 - .4byte _080F24A0 - .4byte _080F24BC -_080F23D4: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x2] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r4, 0xC] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r1, =0x0203a030 - movs r0, 0x1 - strb r0, [r1] - b _080F24C0 - .pool -_080F2408: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x2] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrb r1, [r4, 0x12] - movs r2, 0 - bl GetMapName - ldr r0, =0x02021ec4 - ldrh r2, [r4, 0xE] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldrb r0, [r4, 0x11] - cmp r0, 0x1 - bne _080F2450 - ldr r1, =0x0203a030 - movs r0, 0x3 - strb r0, [r1] - b _080F24C0 - .pool -_080F2450: - ldr r1, =0x0203a030 - movs r0, 0x2 - strb r0, [r1] - b _080F24C0 - .pool -_080F245C: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x2] - bl sub_81DB5E8 - ldrb r1, [r4, 0x10] - movs r0, 0x1 - bl sub_80EF340 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _080F2494 - ldr r1, =0x0203a030 - movs r0, 0x5 - strb r0, [r1] - b _080F24C0 - .pool -_080F2494: - ldr r1, =0x0203a030 - movs r0, 0x4 - strb r0, [r1] - b _080F24C0 - .pool -_080F24A0: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x2] - bl sub_81DB5E8 - ldr r1, =0x0203a030 - movs r0, 0x6 - strb r0, [r1] - b _080F24C0 - .pool -_080F24BC: - bl TVShowDone -_080F24C0: - ldr r0, =gUnknown_0858D394 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowPokemonTodayFailedCapture - - thumb_func_start DoTVShowPokemonFanClubLetter -DoTVShowPokemonFanClubLetter: @ 80F24D8 - push {r4-r7,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r5, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r7, [r0] - adds r6, r0, 0 - cmp r7, 0x33 - bls _080F2500 - b _080F26F0 -_080F2500: - lsls r0, r7, 2 - ldr r1, =_080F2524 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F2524: - .4byte _080F25F4 - .4byte _080F2628 - .4byte _080F2654 - .4byte _080F265A - .4byte _080F2672 - .4byte _080F2672 - .4byte _080F2672 - .4byte _080F2684 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26A6 - .4byte _080F26CC -_080F25F4: - ldr r0, =0x02021cc4 - adds r1, r5, 0 - adds r1, 0x10 - ldrb r2, [r5, 0x18] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r5, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r1, =0x0203a030 - movs r0, 0x32 - strb r0, [r1] - b _080F26F0 - .pool -_080F2628: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - ands r0, r1 - adds r2, r0, 0x1 - cmp r2, 0x1 - bne _080F2648 - ldr r1, =0x0203a030 - movs r0, 0x2 - strb r0, [r1] - b _080F26F0 - .pool -_080F2648: - ldr r1, =0x0203a030 - adds r0, r2, 0x2 - strb r0, [r1] - b _080F26F0 - .pool -_080F2654: - movs r0, 0x33 - strb r0, [r6] - b _080F26F0 -_080F265A: - bl GenerateRandomNumber - ldrb r4, [r6] - adds r4, 0x1 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - adds r0, r4 - strb r0, [r6] - b _080F26F0 -_080F2672: - adds r0, r5, 0 - bl sub_80EFB58 - ldr r1, =0x0203a030 - movs r0, 0x7 - strb r0, [r1] - b _080F26F0 - .pool -_080F2684: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1F - bl __umodsi3 - adds r0, 0x46 - lsls r0, 16 - lsrs r2, r0, 16 - movs r0, 0x2 - adds r1, r2, 0 - bl sub_80EF340 - bl TVShowDone - b _080F26F0 -_080F26A6: - ldr r4, =0x02021fc4 - adds r1, r5, 0x4 - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertEasyChatWordsToString - adds r0, r4, 0 - bl box_related_two__2 - ldr r1, =0x0203a030 - movs r0, 0x1 - strb r0, [r1] - b _080F26FC - .pool -_080F26CC: - ldr r4, =0x02021fc4 - adds r1, r5, 0x4 - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertEasyChatWordsToString - adds r0, r4, 0 - bl box_related_two__2 - ldr r1, =0x0203a030 - movs r0, 0x3 - strb r0, [r1] - b _080F26FC - .pool -_080F26F0: - ldr r0, =gUnknown_0858D150 - lsls r1, r7, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 -_080F26FC: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowPokemonFanClubLetter - - thumb_func_start DoTVShowRecentHappenings -DoTVShowRecentHappenings: @ 80F2708 - push {r4-r7,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r5, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r6, [r0] - adds r7, r0, 0 - cmp r6, 0x32 - bls _080F2730 - b _080F288C -_080F2730: - lsls r0, r6, 2 - ldr r1, =_080F2754 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F2754: - .4byte _080F2820 - .4byte _080F2844 - .4byte _080F285C - .4byte _080F285C - .4byte _080F285C - .4byte _080F2862 - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F2868 -_080F2820: - ldr r0, =0x02021cc4 - adds r1, r5, 0 - adds r1, 0x10 - ldrb r2, [r5, 0x18] - bl sub_81DB5E8 - adds r0, r5, 0 - bl sub_80EFB58 - ldr r1, =0x0203a030 - movs r0, 0x32 - strb r0, [r1] - b _080F288C - .pool -_080F2844: - bl GenerateRandomNumber - ldrb r4, [r7] - adds r4, 0x1 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - adds r0, r4 - strb r0, [r7] - b _080F288C -_080F285C: - movs r0, 0x5 - strb r0, [r7] - b _080F288C -_080F2862: - bl TVShowDone - b _080F288C -_080F2868: - ldr r4, =0x02021fc4 - adds r1, r5, 0x4 - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertEasyChatWordsToString - adds r0, r4, 0 - bl box_related_two__2 - ldr r1, =0x0203a030 - movs r0, 0x1 - strb r0, [r1] - b _080F2898 - .pool -_080F288C: - ldr r0, =gUnknown_0858D170 - lsls r1, r6, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 -_080F2898: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowRecentHappenings - - thumb_func_start DoTVShowPokemonFanClubOpinions -DoTVShowPokemonFanClubOpinions: @ 80F28A4 - push {r4-r6,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r6, =0x0203a030 - ldrb r5, [r6] - cmp r5, 0x3 - bgt _080F28E8 - cmp r5, 0x1 - bge _080F2930 - cmp r5, 0 - beq _080F28EE - b _080F297E - .pool -_080F28E8: - cmp r5, 0x4 - beq _080F2968 - b _080F297E -_080F28EE: - ldr r0, =0x02021cc4 - adds r1, r4, 0x5 - ldrb r2, [r4, 0xD] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r4, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021ec4 - adds r1, r4, 0 - adds r1, 0x10 - ldrb r2, [r4, 0xE] - bl sub_81DB5E8 - ldrb r0, [r4, 0x4] - lsrs r0, 4 - adds r0, 0x1 - strb r0, [r6] - b _080F297E - .pool -_080F2930: - ldr r0, =0x02021cc4 - adds r1, r4, 0x5 - ldrb r2, [r4, 0xD] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r4, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021ec4 - ldrh r1, [r4, 0x1C] - bl CopyEasyChatWord - movs r0, 0x4 - strb r0, [r6] - b _080F297E - .pool -_080F2968: - ldr r0, =0x02021cc4 - adds r1, r4, 0x5 - ldrb r2, [r4, 0xD] - bl sub_81DB5E8 - ldr r0, =0x02021ec4 - ldrh r1, [r4, 0x1E] - bl CopyEasyChatWord - bl TVShowDone -_080F297E: - ldr r0, =gUnknown_0858D188 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowPokemonFanClubOpinions - - thumb_func_start DoTVShowDummiedOut -DoTVShowDummiedOut: @ 80F299C - bx lr - thumb_func_end DoTVShowDummiedOut - - thumb_func_start DoTVShowPokemonNewsMassOutbreak -DoTVShowPokemonNewsMassOutbreak: @ 80F29A0 - push {r4,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r4, [r2] - adds r4, r0 - ldr r0, =0x02021cc4 - ldrb r1, [r4, 0x10] - movs r2, 0 - bl GetMapName - ldr r0, =0x02021dc4 - ldrh r2, [r4, 0xC] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - bl TVShowDone - bl StartMassOutbreak - ldr r1, =gUnknown_0858D19C - ldr r0, =0x0203a030 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl box_related_two__2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowPokemonNewsMassOutbreak - - thumb_func_start DoTVShowPokemonContestLiveUpdates -DoTVShowPokemonContestLiveUpdates: @ 80F2A10 - push {r4-r7,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r6, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r7, [r0] - adds r2, r0, 0 - cmp r7, 0x20 - bls _080F2A38 - b _080F311C -_080F2A38: - lsls r0, r7, 2 - ldr r1, =_080F2A5C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F2A5C: - .4byte _080F2AE0 - .4byte _080F2B54 - .4byte _080F2BA2 - .4byte _080F2BC8 - .4byte _080F2BF4 - .4byte _080F2D2C - .4byte _080F2D40 - .4byte _080F2D54 - .4byte _080F2D68 - .4byte _080F2DE8 - .4byte _080F2DFC - .4byte _080F2E10 - .4byte _080F2E24 - .4byte _080F2E38 - .4byte _080F2E4C - .4byte _080F2ECC - .4byte _080F2EE0 - .4byte _080F2EF4 - .4byte _080F2F08 - .4byte _080F2F1C - .4byte _080F2F30 - .4byte _080F2F44 - .4byte _080F2F58 - .4byte _080F2F94 - .4byte _080F3064 - .4byte _080F3080 - .4byte _080F30E0 - .4byte _080F30E0 - .4byte _080F30A8 - .4byte _080F30AE - .4byte _080F30E0 - .4byte _080F30E0 - .4byte _080F30FC -_080F2AE0: - ldr r0, =0x02021cc4 - ldrb r1, [r6, 0x1C] - bl sub_818E868 - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021ec4 - adds r1, r6, 0 - adds r1, 0x14 - ldrb r2, [r6, 0x1D] - bl sub_81DB5E8 - ldrb r0, [r6, 0xD] - ldrb r1, [r6, 0xE] - cmp r0, r1 - bne _080F2B38 - cmp r0, 0 - bne _080F2B2C - ldr r1, =0x0203a030 - movs r0, 0x1 - strb r0, [r1] - b _080F311C - .pool -_080F2B2C: - ldr r1, =0x0203a030 - movs r0, 0x3 - strb r0, [r1] - b _080F311C - .pool -_080F2B38: - cmp r0, r1 - bls _080F2B48 - ldr r1, =0x0203a030 - movs r0, 0x2 - strb r0, [r1] - b _080F311C - .pool -_080F2B48: - ldr r1, =0x0203a030 - movs r0, 0x4 - strb r0, [r1] - b _080F311C - .pool -_080F2B54: - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldrb r1, [r6, 0xF] - cmp r1, 0x8 - bne _080F2B6C - b _080F2CF0 -_080F2B6C: - cmp r1, 0x8 - bgt _080F2B88 -_080F2B70: - cmp r1, 0x2 - bne _080F2B76 - b _080F2CD8 -_080F2B76: - cmp r1, 0x2 - bgt _080F2B7C - b _080F2C96 -_080F2B7C: - b _080F2CAC - .pool -_080F2B88: - cmp r1, 0x20 - bne _080F2B8E - b _080F2D08 -_080F2B8E: - cmp r1, 0x20 - bgt _080F2B94 - b _080F2CBA -_080F2B94: - cmp r1, 0x40 - bne _080F2B9A - b _080F2D14 -_080F2B9A: - cmp r1, 0x80 - beq _080F2BA0 - b _080F311C -_080F2BA0: - b _080F2D20 -_080F2BA2: - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString -_080F2BB2: - ldrb r1, [r6, 0xF] - cmp r1, 0x8 - bne _080F2BBA - b _080F2CF0 -_080F2BBA: - cmp r1, 0x8 - ble _080F2B70 - b _080F2B88 - .pool -_080F2BC8: - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021ec4 - adds r1, r6, 0 - adds r1, 0x14 - ldrb r2, [r6, 0x1D] - bl sub_81DB5E8 - b _080F2BB2 - .pool -_080F2BF4: - ldrb r0, [r6, 0x1C] - cmp r0, 0x4 - bhi _080F2C74 - lsls r0, 2 - ldr r1, =_080F2C08 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F2C08: - .4byte _080F2C1C - .4byte _080F2C30 - .4byte _080F2C44 - .4byte _080F2C58 - .4byte _080F2C6C -_080F2C1C: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EB0E8 - bl CopyString - b _080F2C74 - .pool -_080F2C30: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EB0ED - bl CopyString - b _080F2C74 - .pool -_080F2C44: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EB0F4 - bl CopyString - b _080F2C74 - .pool -_080F2C58: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EB0F9 - bl CopyString - b _080F2C74 - .pool -_080F2C6C: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EB0FF - bl CopyString -_080F2C74: - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldrb r1, [r6, 0xF] - cmp r1, 0x8 - beq _080F2CF0 - cmp r1, 0x8 - bgt _080F2CB2 - cmp r1, 0x2 - beq _080F2CD8 - cmp r1, 0x2 - bgt _080F2CAC -_080F2C96: - cmp r1, 0x1 - beq _080F2CCA - b _080F311C - .pool -_080F2CAC: - cmp r1, 0x4 - beq _080F2CE4 - b _080F311C -_080F2CB2: - cmp r1, 0x20 - beq _080F2D08 - cmp r1, 0x20 - bgt _080F2CC0 -_080F2CBA: - cmp r1, 0x10 - beq _080F2CFC - b _080F311C -_080F2CC0: - cmp r1, 0x40 - beq _080F2D14 - cmp r1, 0x80 - beq _080F2D20 - b _080F311C -_080F2CCA: - ldr r1, =0x0203a030 - movs r0, 0x8 - strb r0, [r1] - b _080F311C - .pool -_080F2CD8: - ldr r1, =0x0203a030 - movs r0, 0x5 - strb r0, [r1] - b _080F311C - .pool -_080F2CE4: - ldr r1, =0x0203a030 - movs r0, 0xE - strb r0, [r1] - b _080F311C - .pool -_080F2CF0: - ldr r1, =0x0203a030 - movs r0, 0x7 - strb r0, [r1] - b _080F311C - .pool -_080F2CFC: - ldr r1, =0x0203a030 - movs r0, 0x6 - strb r0, [r1] - b _080F311C - .pool -_080F2D08: - ldr r1, =0x0203a030 - movs r0, 0x14 - strb r0, [r1] - b _080F311C - .pool -_080F2D14: - ldr r1, =0x0203a030 - movs r0, 0x15 - strb r0, [r1] - b _080F311C - .pool -_080F2D20: - ldr r1, =0x0203a030 - movs r0, 0x16 - strb r0, [r1] - b _080F311C - .pool -_080F2D2C: - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2D40: - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2D54: - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2D68: - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldrb r0, [r6, 0x1C] - cmp r0, 0x4 - bls _080F2D80 - b _080F311C -_080F2D80: - lsls r0, 2 - ldr r1, =_080F2D98 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F2D98: - .4byte _080F2DAC - .4byte _080F2DB8 - .4byte _080F2DC4 - .4byte _080F2DD0 - .4byte _080F2DDC -_080F2DAC: - ldr r1, =0x0203a030 - movs r0, 0x9 - strb r0, [r1] - b _080F311C - .pool -_080F2DB8: - ldr r1, =0x0203a030 - movs r0, 0xA - strb r0, [r1] - b _080F311C - .pool -_080F2DC4: - ldr r1, =0x0203a030 - movs r0, 0xB - strb r0, [r1] - b _080F311C - .pool -_080F2DD0: - ldr r1, =0x0203a030 - movs r0, 0xC - strb r0, [r1] - b _080F311C - .pool -_080F2DDC: - ldr r1, =0x0203a030 - movs r0, 0xD - strb r0, [r1] - b _080F311C - .pool -_080F2DE8: - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2DFC: - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2E10: - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2E24: - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2E38: - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2E4C: - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldrb r0, [r6, 0x1C] - cmp r0, 0x4 - bls _080F2E64 - b _080F311C -_080F2E64: - lsls r0, 2 - ldr r1, =_080F2E7C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F2E7C: - .4byte _080F2E90 - .4byte _080F2E9C - .4byte _080F2EA8 - .4byte _080F2EB4 - .4byte _080F2EC0 -_080F2E90: - ldr r1, =0x0203a030 - movs r0, 0xF - strb r0, [r1] - b _080F311C - .pool -_080F2E9C: - ldr r1, =0x0203a030 - movs r0, 0x10 - strb r0, [r1] - b _080F311C - .pool -_080F2EA8: - ldr r1, =0x0203a030 - movs r0, 0x11 - strb r0, [r1] - b _080F311C - .pool -_080F2EB4: - ldr r1, =0x0203a030 - movs r0, 0x12 - strb r0, [r1] - b _080F311C - .pool -_080F2EC0: - ldr r1, =0x0203a030 - movs r0, 0x13 - strb r0, [r1] - b _080F311C - .pool -_080F2ECC: - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2EE0: - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2EF4: - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2F08: - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2F1C: - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2F30: - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2F44: - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2F58: - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021ec4 - ldrh r2, [r6, 0x10] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames -_080F2F72: - adds r1, r2 - bl CopyString - ldr r1, =0x0203a030 - movs r0, 0x17 - strb r0, [r1] - b _080F311C - .pool -_080F2F94: - ldr r0, =0x02021cc4 - ldrh r1, [r6, 0x12] - movs r5, 0xB - muls r1, r5 - ldr r4, =gSpeciesNames - adds r1, r4 - bl CopyString - ldr r0, =0x02021dc4 - adds r1, r6, 0x4 - ldrb r2, [r6, 0x1E] - bl sub_81DB5E8 - ldr r0, =0x02021ec4 - ldrh r1, [r6, 0x2] - muls r1, r5 - adds r1, r4 - bl CopyString - ldrb r0, [r6, 0xC] - cmp r0, 0x8 - beq _080F3028 - cmp r0, 0x8 - bgt _080F2FEA - cmp r0, 0x2 - beq _080F3010 - cmp r0, 0x2 - bgt _080F2FE4 - cmp r0, 0x1 - beq _080F3002 - b _080F311C - .pool -_080F2FE4: - cmp r0, 0x4 - beq _080F301C - b _080F311C -_080F2FEA: - cmp r0, 0x20 - beq _080F3040 - cmp r0, 0x20 - bgt _080F2FF8 - cmp r0, 0x10 - beq _080F3034 - b _080F311C -_080F2FF8: - cmp r0, 0x40 - beq _080F304C - cmp r0, 0x80 - beq _080F3058 - b _080F311C -_080F3002: - ldr r1, =0x0203a030 - movs r0, 0x1F - strb r0, [r1] - b _080F311C - .pool -_080F3010: - ldr r1, =0x0203a030 - movs r0, 0x1E - strb r0, [r1] - b _080F311C - .pool -_080F301C: - ldr r1, =0x0203a030 - movs r0, 0x1D - strb r0, [r1] - b _080F311C - .pool -_080F3028: - ldr r1, =0x0203a030 - movs r0, 0x1C - strb r0, [r1] - b _080F311C - .pool -_080F3034: - ldr r1, =0x0203a030 - movs r0, 0x1B - strb r0, [r1] - b _080F311C - .pool -_080F3040: - ldr r1, =0x0203a030 - movs r0, 0x1A - strb r0, [r1] - b _080F311C - .pool -_080F304C: - ldr r1, =0x0203a030 - movs r0, 0x19 - strb r0, [r1] - b _080F311C - .pool -_080F3058: - ldr r1, =0x0203a030 - movs r0, 0x18 - strb r0, [r1] - b _080F311C - .pool -_080F3064: - ldr r0, =0x02021cc4 - ldrh r2, [r6, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - b _080F30EA - .pool -_080F3080: - ldr r0, =0x02021cc4 - adds r1, r6, 0x4 - ldrb r2, [r6, 0x1E] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - b _080F30EA - .pool -_080F30A8: - movs r0, 0x20 - strb r0, [r2] - b _080F311C -_080F30AE: - ldr r0, =0x02021cc4 - adds r1, r6, 0 - adds r1, 0x14 - ldrb r2, [r6, 0x1D] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021ec4 - b _080F30E2 - .pool -_080F30E0: - ldr r0, =0x02021cc4 -_080F30E2: - adds r1, r6, 0x4 - ldrb r2, [r6, 0x1E] - bl sub_81DB5E8 -_080F30EA: - ldr r1, =0x0203a030 - movs r0, 0x20 - strb r0, [r1] - b _080F311C - .pool -_080F30FC: - ldr r0, =0x02021cc4 - adds r1, r6, 0 - adds r1, 0x14 - ldrb r2, [r6, 0x1D] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - bl TVShowDone -_080F311C: - ldr r0, =gUnknown_0858D27C - lsls r1, r7, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowPokemonContestLiveUpdates - - thumb_func_start DoTVShowPokemonBattleUpdate -DoTVShowPokemonBattleUpdate: @ 80F3140 - push {r4,r5,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r5, [r0] - adds r2, r0, 0 - cmp r5, 0x7 - bls _080F3168 - b _080F3362 -_080F3168: - lsls r0, r5, 2 - ldr r1, =_080F318C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F318C: - .4byte _080F31AC - .4byte _080F31CA - .4byte _080F321C - .4byte _080F3268 - .4byte _080F329C - .4byte _080F32C0 - .4byte _080F32EC - .4byte _080F3338 -_080F31AC: - ldrb r1, [r4, 0x18] - cmp r1, 0 - bge _080F31B4 - b _080F3362 -_080F31B4: - cmp r1, 0x1 - ble _080F31BE - cmp r1, 0x2 - beq _080F31C4 - b _080F3362 -_080F31BE: - movs r0, 0x1 - strb r0, [r2] - b _080F3362 -_080F31C4: - movs r0, 0x5 - strb r0, [r2] - b _080F3362 -_080F31CA: - ldr r0, =0x02021cc4 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x19] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x1A] - bl sub_81DB5E8 - ldrb r0, [r4, 0x18] - cmp r0, 0 - bne _080F3200 - ldr r0, =0x02021ec4 - ldr r1, =gUnknown_085ECB64 - bl CopyString - b _080F3208 - .pool -_080F3200: - ldr r0, =0x02021ec4 - ldr r1, =gUnknown_085ECB6B - bl CopyString -_080F3208: - ldr r1, =0x0203a030 - movs r0, 0x2 - strb r0, [r1] - b _080F3362 - .pool -_080F321C: - ldr r0, =0x02021cc4 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x19] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r4, 0x16] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021ec4 - ldrh r2, [r4, 0x14] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - ldr r1, =0x0203a030 - movs r0, 0x3 - strb r0, [r1] - b _080F3362 - .pool -_080F3268: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x1A] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r4, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r1, =0x0203a030 - movs r0, 0x4 - strb r0, [r1] - b _080F3362 - .pool -_080F329C: - ldr r0, =0x02021cc4 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x19] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x1A] - bl sub_81DB5E8 - bl TVShowDone - b _080F3362 - .pool -_080F32C0: - ldr r0, =0x02021cc4 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x19] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x1A] - bl sub_81DB5E8 - ldr r1, =0x0203a030 - movs r0, 0x6 - strb r0, [r1] - b _080F3362 - .pool -_080F32EC: - ldr r0, =0x02021cc4 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x19] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r4, 0x16] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021ec4 - ldrh r2, [r4, 0x14] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - ldr r1, =0x0203a030 - movs r0, 0x7 - strb r0, [r1] - b _080F3362 - .pool -_080F3338: - ldr r0, =0x02021cc4 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x19] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x1A] - bl sub_81DB5E8 - ldr r0, =0x02021ec4 - ldrh r2, [r4, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - bl TVShowDone -_080F3362: - ldr r0, =gUnknown_0858D300 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowPokemonBattleUpdate - - thumb_func_start DoTVShow3CheersForPokeblocks -DoTVShow3CheersForPokeblocks: @ 80F3388 - push {r4,r5,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r5, [r0] - cmp r5, 0x5 - bls _080F33AE - b _080F3624 -_080F33AE: - lsls r0, r5, 2 - ldr r1, =_080F33D0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F33D0: - .4byte _080F33E8 - .4byte _080F3418 - .4byte _080F3500 - .4byte _080F350C - .4byte _080F35F4 - .4byte _080F3620 -_080F33E8: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x14] - bl sub_81DB5E8 - ldrb r0, [r4, 0x2] - cmp r0, 0x14 - bls _080F340C - ldr r1, =0x0203a030 - movs r0, 0x1 - strb r0, [r1] - b _080F3624 - .pool -_080F340C: - ldr r1, =0x0203a030 - movs r0, 0x3 - strb r0, [r1] - b _080F3624 - .pool -_080F3418: - ldrb r0, [r4, 0x3] - lsls r0, 29 - lsrs r0, 29 - cmp r0, 0x4 - bhi _080F349C - lsls r0, 2 - ldr r1, =_080F3430 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F3430: - .4byte _080F3444 - .4byte _080F3458 - .4byte _080F346C - .4byte _080F3480 - .4byte _080F3494 -_080F3444: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085ECB48 - bl CopyString - b _080F349C - .pool -_080F3458: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085ECB4E - bl CopyString - b _080F349C - .pool -_080F346C: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085ECB52 - bl CopyString - b _080F349C - .pool -_080F3480: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085ECB58 - bl CopyString - b _080F349C - .pool -_080F3494: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085ECB5F - bl CopyString -_080F349C: - ldrb r0, [r4, 0x2] - cmp r0, 0x18 - bls _080F34BC - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085ECB2A - bl CopyString - b _080F34DC - .pool -_080F34BC: - cmp r0, 0x16 - bls _080F34D4 - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085ECB20 - bl CopyString - b _080F34DC - .pool -_080F34D4: - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085ECB1B - bl CopyString -_080F34DC: - ldr r0, =0x02021ec4 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x14] - bl sub_81DB5E8 - ldr r1, =0x0203a030 - movs r0, 0x2 - strb r0, [r1] - b _080F3624 - .pool -_080F3500: - ldr r0, =0x02021cc4 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x15] - b _080F3606 - .pool -_080F350C: - ldrb r0, [r4, 0x3] - lsls r0, 29 - lsrs r0, 29 - cmp r0, 0x4 - bhi _080F3590 - lsls r0, 2 - ldr r1, =_080F3524 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F3524: - .4byte _080F3538 - .4byte _080F354C - .4byte _080F3560 - .4byte _080F3574 - .4byte _080F3588 -_080F3538: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085ECB48 - bl CopyString - b _080F3590 - .pool -_080F354C: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085ECB4E - bl CopyString - b _080F3590 - .pool -_080F3560: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085ECB52 - bl CopyString - b _080F3590 - .pool -_080F3574: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085ECB58 - bl CopyString - b _080F3590 - .pool -_080F3588: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085ECB5F - bl CopyString -_080F3590: - ldrb r0, [r4, 0x2] - cmp r0, 0x10 - bls _080F35B0 - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085ECB34 - bl CopyString - b _080F35D0 - .pool -_080F35B0: - cmp r0, 0xD - bls _080F35C8 - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085ECB3A - bl CopyString - b _080F35D0 - .pool -_080F35C8: - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085ECB3E - bl CopyString -_080F35D0: - ldr r0, =0x02021ec4 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x14] - bl sub_81DB5E8 - ldr r1, =0x0203a030 - movs r0, 0x4 - strb r0, [r1] - b _080F3624 - .pool -_080F35F4: - ldr r0, =0x02021cc4 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x15] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x14] -_080F3606: - bl sub_81DB5E8 - ldr r1, =0x0203a030 - movs r0, 0x5 - strb r0, [r1] - b _080F3624 - .pool -_080F3620: - bl TVShowDone -_080F3624: - ldr r0, =gUnknown_0858D228 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShow3CheersForPokeblocks - - thumb_func_start DoTVShowInSearchOfTrainers -DoTVShowInSearchOfTrainers: @ 80F363C - push {r4-r7,lr} - ldr r0, =0x020375f0 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x0203a030 - ldrb r7, [r0] - adds r2, r0, 0 - cmp r7, 0x8 - bls _080F3650 - b _080F37EA -_080F3650: - lsls r0, r7, 2 - ldr r1, =_080F3668 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F3668: - .4byte _080F368C - .4byte _080F36D4 - .4byte _080F36DA - .4byte _080F372C - .4byte _080F379C - .4byte _080F379C - .4byte _080F379C - .4byte _080F379C - .4byte _080F37A2 -_080F368C: - ldr r0, =0x02021cc4 - ldr r4, =0x03005d8c - ldr r1, [r4] - ldr r2, =0x00002bac - adds r1, r2 - ldrb r1, [r1] - movs r2, 0 - bl GetMapName - ldr r0, [r4] - ldr r1, =0x00002bad - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bls _080F36C8 - ldr r1, =0x0203a030 - movs r0, 0x1 - strb r0, [r1] - b _080F37EA - .pool -_080F36C8: - ldr r1, =0x0203a030 - movs r0, 0x2 - strb r0, [r1] - b _080F37EA - .pool -_080F36D4: - movs r0, 0x2 - strb r0, [r2] - b _080F37EA -_080F36DA: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002bae - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080F36FC - movs r0, 0x4 - strb r0, [r2] - b _080F37EA - .pool -_080F36FC: - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _080F370A - movs r0, 0x5 - strb r0, [r2] - b _080F37EA -_080F370A: - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080F3718 - movs r0, 0x6 - strb r0, [r2] - b _080F37EA -_080F3718: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080F3726 - movs r0, 0x7 - strb r0, [r2] - b _080F37EA -_080F3726: - movs r0, 0x3 - strb r0, [r2] - b _080F37EA -_080F372C: - ldr r0, =0x02021cc4 - ldr r4, =0x03005d8c - ldr r1, [r4] - ldr r2, =0x00002ba4 - adds r1, r2 - ldrh r1, [r1] - movs r6, 0xB - muls r1, r6 - ldr r5, =gSpeciesNames - adds r1, r5 - bl CopyString - ldr r0, =0x02021dc4 - ldr r1, [r4] - ldr r2, =0x00002ba8 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021ec4 - ldr r1, [r4] - ldr r2, =0x00002ba6 - adds r1, r2 - ldrh r1, [r1] - muls r1, r6 - adds r1, r5 - bl CopyString - ldr r1, =0x0203a030 - movs r0, 0x8 - strb r0, [r1] - b _080F37EA - .pool -_080F379C: - movs r0, 0x8 - strb r0, [r2] - b _080F37EA -_080F37A2: - ldr r0, =0x02021cc4 - ldr r4, =0x03005d8c - ldr r1, [r4] - ldr r2, =0x00002baa - adds r1, r2 - ldrh r1, [r1] - bl CopyEasyChatWord - ldr r0, =0x02021dc4 - ldr r1, [r4] - ldr r2, =0x00002ba4 - adds r1, r2 - ldrh r1, [r1] - movs r6, 0xB - muls r1, r6 - ldr r5, =gSpeciesNames - adds r1, r5 - bl CopyString - ldr r0, =0x02021ec4 - ldr r1, [r4] - ldr r2, =0x00002ba6 - adds r1, r2 - ldrh r1, [r1] - muls r1, r6 - adds r1, r5 - bl CopyString - ldr r1, =0x020375f0 - movs r0, 0x1 - strh r0, [r1] - ldr r1, =0x0203a030 - movs r0, 0 - strb r0, [r1] - bl TakeTVShowInSearchOfTrainersOffTheAir -_080F37EA: - ldr r0, =gUnknown_0858D66C - lsls r1, r7, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowInSearchOfTrainers - - thumb_func_start DoTVShowPokemonAngler -DoTVShowPokemonAngler: @ 80F3828 - push {r4,r5,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r0, =0x020375f0 - movs r1, 0 - strh r1, [r0] - ldrb r0, [r4, 0x2] - ldrb r2, [r4, 0x3] - cmp r0, r2 - bcs _080F3868 - ldr r0, =0x0203a030 - strb r1, [r0] - b _080F3870 - .pool -_080F3868: - ldr r1, =0x0203a030 - movs r0, 0x1 - strb r0, [r1] - adds r0, r1, 0 -_080F3870: - ldrb r5, [r0] - cmp r5, 0 - beq _080F3880 - cmp r5, 0x1 - beq _080F38B8 - b _080F38E0 - .pool -_080F3880: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x6] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r4, 0x4] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldrb r1, [r4, 0x3] - movs r0, 0x2 - bl sub_80EF340 - bl TVShowDone - b _080F38E0 - .pool -_080F38B8: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x6] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r4, 0x4] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldrb r1, [r4, 0x2] - movs r0, 0x2 - bl sub_80EF340 - bl TVShowDone -_080F38E0: - ldr r0, =gUnknown_0858D3B0 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowPokemonAngler - - thumb_func_start DoTVShowTheWorldOfMasters -DoTVShowTheWorldOfMasters: @ 80F3904 - push {r4-r6,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r6, =0x0203a030 - ldrb r5, [r6] - cmp r5, 0x1 - beq _080F3974 - cmp r5, 0x1 - bgt _080F3948 - cmp r5, 0 - beq _080F394E - b _080F39BE - .pool -_080F3948: - cmp r5, 0x2 - beq _080F3994 - b _080F39BE -_080F394E: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0xB] - bl sub_81DB5E8 - ldrh r1, [r4, 0x6] - movs r0, 0x1 - bl sub_80EF340 - ldrh r1, [r4, 0x2] - movs r0, 0x2 - bl sub_80EF340 - movs r0, 0x1 - strb r0, [r6] - b _080F39BE - .pool -_080F3974: - ldr r0, =0x02021cc4 - ldrh r2, [r4, 0x8] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - movs r0, 0x2 - strb r0, [r6] - b _080F39BE - .pool -_080F3994: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0xB] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrb r1, [r4, 0xA] - movs r2, 0 - bl GetMapName - ldr r0, =0x02021ec4 - ldrh r2, [r4, 0x4] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - bl TVShowDone -_080F39BE: - ldr r0, =gUnknown_0858D3B8 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowTheWorldOfMasters - - thumb_func_start DoTVShowTodaysRivalTrainer -DoTVShowTodaysRivalTrainer: @ 80F39E4 - push {r4,r5,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r5, [r0] - adds r2, r0, 0 - cmp r5, 0xA - bls _080F3A0C - b _080F3BE8 -_080F3A0C: - lsls r0, r5, 2 - ldr r1, =_080F3A30 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F3A30: - .4byte _080F3A5C - .4byte _080F3B30 - .4byte _080F3B58 - .4byte _080F3B90 - .4byte _080F3BA2 - .4byte _080F3BC4 - .4byte _080F3BD8 - .4byte _080F3A92 - .4byte _080F3AC0 - .4byte _080F3ADC - .4byte _080F3AF8 -_080F3A5C: - ldrb r0, [r4, 0x7] - cmp r0, 0x56 - beq _080F3A6C - cmp r0, 0x57 - beq _080F3A72 - movs r0, 0x7 - strb r0, [r2] - b _080F3BE8 -_080F3A6C: - movs r0, 0x8 - strb r0, [r2] - b _080F3BE8 -_080F3A72: - ldrh r1, [r4, 0xA] - ldr r0, =0x00000117 - cmp r1, r0 - bgt _080F3A8C - subs r0, 0x2 - cmp r1, r0 - blt _080F3A8C - movs r0, 0xA - strb r0, [r2] - b _080F3BE8 - .pool -_080F3A8C: - movs r0, 0x9 - strb r0, [r2] - b _080F3BE8 -_080F3A92: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0xC] - bl sub_81DB5E8 - ldrh r1, [r4, 0x2] - movs r0, 0x1 - bl sub_80EF340 - ldr r0, =0x02021ec4 - ldrb r1, [r4, 0x7] - movs r2, 0 - bl GetMapName -_080F3AB0: - ldrb r0, [r4, 0x4] - cmp r0, 0 - bne _080F3B12 - b _080F3B24 - .pool -_080F3AC0: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0xC] - bl sub_81DB5E8 - ldrh r1, [r4, 0x2] - movs r0, 0x1 - bl sub_80EF340 - b _080F3AB0 - .pool -_080F3ADC: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0xC] - bl sub_81DB5E8 - ldrh r1, [r4, 0x2] - movs r0, 0x1 - bl sub_80EF340 - b _080F3AB0 - .pool -_080F3AF8: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0xC] - bl sub_81DB5E8 - ldrh r1, [r4, 0x2] - movs r0, 0x1 - bl sub_80EF340 - ldrb r0, [r4, 0x4] - cmp r0, 0 - beq _080F3B24 -_080F3B12: - ldr r1, =0x0203a030 - movs r0, 0x1 - strb r0, [r1] - b _080F3BE8 - .pool -_080F3B24: - ldr r1, =0x0203a030 - movs r0, 0x2 - strb r0, [r1] - b _080F3BE8 - .pool -_080F3B30: - ldrb r1, [r4, 0x4] - movs r0, 0 - bl sub_80EF340 - ldr r0, =0x000008a8 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080F3BCC - ldr r0, [r4, 0x4] - ldr r1, =0x00ffff00 - ands r0, r1 - cmp r0, 0 - bne _080F3B6E - b _080F3B84 - .pool -_080F3B58: - ldr r0, =0x000008a8 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080F3BCC - ldr r0, [r4, 0x4] - ldr r1, =0x00ffff00 - ands r0, r1 - cmp r0, 0 - beq _080F3B84 -_080F3B6E: - ldr r1, =0x0203a030 - movs r0, 0x4 - strb r0, [r1] - b _080F3BE8 - .pool -_080F3B84: - ldr r1, =0x0203a030 - movs r0, 0x3 - strb r0, [r1] - b _080F3BE8 - .pool -_080F3B90: - ldrh r0, [r4, 0x8] - cmp r0, 0 - bne _080F3B9C - movs r0, 0x6 - strb r0, [r2] - b _080F3BE8 -_080F3B9C: - movs r0, 0x5 - strb r0, [r2] - b _080F3BE8 -_080F3BA2: - ldrb r1, [r4, 0x6] - movs r0, 0 - bl sub_80EF340 - ldrb r1, [r4, 0x5] - movs r0, 0x1 - bl sub_80EF340 - ldrh r0, [r4, 0x8] - cmp r0, 0 - beq _080F3BCC - ldr r1, =0x0203a030 - movs r0, 0x5 - strb r0, [r1] - b _080F3BE8 - .pool -_080F3BC4: - ldrh r1, [r4, 0x8] - movs r0, 0 - bl sub_80EF340 -_080F3BCC: - ldr r1, =0x0203a030 - movs r0, 0x6 - strb r0, [r1] - b _080F3BE8 - .pool -_080F3BD8: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0xC] - bl sub_81DB5E8 - bl TVShowDone -_080F3BE8: - ldr r0, =gUnknown_0858D3C4 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowTodaysRivalTrainer - - thumb_func_start DoTVShowDewfordTrendWatcherNetwork -DoTVShowDewfordTrendWatcherNetwork: @ 80F3C04 - push {r4,r5,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r5, [r0] - cmp r5, 0x6 - bls _080F3C2A - b _080F3D54 -_080F3C2A: - lsls r0, r5, 2 - ldr r1, =_080F3C4C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F3C4C: - .4byte _080F3C68 - .4byte _080F3CA0 - .4byte _080F3CA0 - .4byte _080F3CD4 - .4byte _080F3D0C - .4byte _080F3D0C - .4byte _080F3D40 -_080F3C68: - ldr r0, =0x02021cc4 - ldrh r1, [r4, 0x4] - bl CopyEasyChatWord - ldr r0, =0x02021dc4 - ldrh r1, [r4, 0x6] - bl CopyEasyChatWord - ldrb r0, [r4, 0x8] - cmp r0, 0 - bne _080F3C94 - ldr r1, =0x0203a030 - movs r0, 0x1 - strb r0, [r1] - b _080F3D54 - .pool -_080F3C94: - ldr r1, =0x0203a030 - movs r0, 0x2 - strb r0, [r1] - b _080F3D54 - .pool -_080F3CA0: - ldr r0, =0x02021cc4 - ldrh r1, [r4, 0x4] - bl CopyEasyChatWord - ldr r0, =0x02021dc4 - ldrh r1, [r4, 0x6] - bl CopyEasyChatWord - ldr r0, =0x02021ec4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x9] - bl sub_81DB5E8 - ldr r1, =0x0203a030 - movs r0, 0x3 - strb r0, [r1] - b _080F3D54 - .pool -_080F3CD4: - ldr r0, =0x02021cc4 - ldrh r1, [r4, 0x4] - bl CopyEasyChatWord - ldr r0, =0x02021dc4 - ldrh r1, [r4, 0x6] - bl CopyEasyChatWord - ldrb r0, [r4, 0x8] - cmp r0, 0 - bne _080F3D00 - ldr r1, =0x0203a030 - movs r0, 0x4 - strb r0, [r1] - b _080F3D54 - .pool -_080F3D00: - ldr r1, =0x0203a030 - movs r0, 0x5 - strb r0, [r1] - b _080F3D54 - .pool -_080F3D0C: - ldr r0, =0x02021cc4 - ldrh r1, [r4, 0x4] - bl CopyEasyChatWord - ldr r0, =0x02021dc4 - ldrh r1, [r4, 0x6] - bl CopyEasyChatWord - ldr r0, =0x02021ec4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x9] - bl sub_81DB5E8 - ldr r1, =0x0203a030 - movs r0, 0x6 - strb r0, [r1] - b _080F3D54 - .pool -_080F3D40: - ldr r0, =0x02021cc4 - ldrh r1, [r4, 0x4] - bl CopyEasyChatWord - ldr r0, =0x02021dc4 - ldrh r1, [r4, 0x6] - bl CopyEasyChatWord - bl TVShowDone -_080F3D54: - ldr r0, =gUnknown_0858D3F0 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowDewfordTrendWatcherNetwork - - thumb_func_start DoTVShowHoennTreasureInvestigators -DoTVShowHoennTreasureInvestigators: @ 80F3D74 - push {r4-r7,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r5, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r7, =0x0203a030 - ldrb r6, [r7] - cmp r6, 0x1 - beq _080F3E02 - cmp r6, 0x1 - bgt _080F3DB8 - cmp r6, 0 - beq _080F3DBE - b _080F3E5C - .pool -_080F3DB8: - cmp r6, 0x2 - beq _080F3E3C - b _080F3E5C -_080F3DBE: - ldr r4, =0x02021cc4 - ldrh r0, [r5, 0x2] - bl itemid_get_item - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - ldrb r0, [r5, 0x4] - cmp r0, 0x57 - bne _080F3DFC - ldrh r1, [r5, 0x6] - ldr r0, =0x00000117 - cmp r1, r0 - bgt _080F3DF0 - subs r0, 0x2 - cmp r1, r0 - blt _080F3DF0 - movs r0, 0x2 - strb r0, [r7] - b _080F3E5C - .pool -_080F3DF0: - ldr r1, =0x0203a030 - movs r0, 0x1 - strb r0, [r1] - b _080F3E5C - .pool -_080F3DFC: - movs r0, 0x1 - strb r0, [r7] - b _080F3E5C -_080F3E02: - ldr r4, =0x02021cc4 - ldrh r0, [r5, 0x2] - bl itemid_get_item - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - ldr r0, =0x02021dc4 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x5] - bl sub_81DB5E8 - ldr r0, =0x02021ec4 - ldrb r1, [r5, 0x4] - movs r2, 0 - bl GetMapName - bl TVShowDone - b _080F3E5C - .pool -_080F3E3C: - ldr r4, =0x02021cc4 - ldrh r0, [r5, 0x2] - bl itemid_get_item - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - ldr r0, =0x02021dc4 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x5] - bl sub_81DB5E8 - bl TVShowDone -_080F3E5C: - ldr r0, =gUnknown_0858D40C - lsls r1, r6, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowHoennTreasureInvestigators - - thumb_func_start DoTVShowFindThatGamer -DoTVShowFindThatGamer: @ 80F3E7C - push {r4,r5,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r5, [r0] - cmp r5, 0x1 - beq _080F3F28 - cmp r5, 0x1 - bgt _080F3EC0 - cmp r5, 0 - beq _080F3ECC - b _080F4008 - .pool -_080F3EC0: - cmp r5, 0x2 - beq _080F3F78 - cmp r5, 0x3 - bne _080F3ECA - b _080F3FCC -_080F3ECA: - b _080F4008 -_080F3ECC: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x8] - bl sub_81DB5E8 - ldrb r0, [r4, 0x3] - cmp r0, 0 - beq _080F3EE8 - cmp r0, 0x1 - beq _080F3EFC - b _080F3F04 - .pool -_080F3EE8: - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085ECB0C - bl CopyString - b _080F3F04 - .pool -_080F3EFC: - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085ECB12 - bl CopyString -_080F3F04: - ldrb r1, [r4, 0x2] - cmp r1, 0x1 - bne _080F3F1C - ldr r0, =0x0203a030 - strb r1, [r0] - b _080F4008 - .pool -_080F3F1C: - ldr r1, =0x0203a030 - movs r0, 0x2 - strb r0, [r1] - b _080F4008 - .pool -_080F3F28: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x8] - bl sub_81DB5E8 - ldrb r0, [r4, 0x3] - cmp r0, 0 - beq _080F3F44 - cmp r0, 0x1 - beq _080F3F58 - b _080F3F60 - .pool -_080F3F44: - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085ECB0C - bl CopyString - b _080F3F60 - .pool -_080F3F58: - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085ECB12 - bl CopyString -_080F3F60: - ldrh r1, [r4, 0x4] - movs r0, 0x2 - bl sub_80EF340 - bl TVShowDone - b _080F4008 - .pool -_080F3F78: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x8] - bl sub_81DB5E8 - ldrb r0, [r4, 0x3] - cmp r0, 0 - beq _080F3F94 - cmp r0, 0x1 - beq _080F3FA8 - b _080F3FB0 - .pool -_080F3F94: - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085ECB0C - bl CopyString - b _080F3FB0 - .pool -_080F3FA8: - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085ECB12 - bl CopyString -_080F3FB0: - ldrh r1, [r4, 0x4] - movs r0, 0x2 - bl sub_80EF340 - ldr r1, =0x0203a030 - movs r0, 0x3 - strb r0, [r1] - b _080F4008 - .pool -_080F3FCC: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x8] - bl sub_81DB5E8 - ldrb r1, [r4, 0x3] - cmp r1, 0 - beq _080F3FE8 - cmp r1, 0x1 - beq _080F3FFC - b _080F4004 - .pool -_080F3FE8: - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085ECB12 - bl CopyString - b _080F4004 - .pool -_080F3FFC: - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085ECB0C - bl CopyString -_080F4004: - bl TVShowDone -_080F4008: - ldr r0, =gUnknown_0858D418 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowFindThatGamer - - thumb_func_start DoTVShowBreakingNewsTV -DoTVShowBreakingNewsTV: @ 80F4028 - push {r4-r7,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r6, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r7, [r0] - adds r2, r0, 0 - cmp r7, 0xC - bls _080F4050 - b _080F4344 -_080F4050: - lsls r0, r7, 2 - ldr r1, =_080F4074 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F4074: - .4byte _080F40A8 - .4byte _080F40BA - .4byte _080F40FC - .4byte _080F4140 - .4byte _080F4168 - .4byte _080F418C - .4byte _080F41D0 - .4byte _080F4254 - .4byte _080F42C8 - .4byte _080F42F4 - .4byte _080F42F4 - .4byte _080F4334 - .4byte _080F4284 -_080F40A8: - ldrb r0, [r6, 0x5] - cmp r0, 0 - bne _080F40B4 - movs r0, 0x1 - strb r0, [r2] - b _080F4344 -_080F40B4: - movs r0, 0x5 - strb r0, [r2] - b _080F4344 -_080F40BA: - ldr r0, =0x02021cc4 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xE] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021ec4 - ldrb r1, [r6, 0x4] - movs r2, 0 - bl GetMapName - ldr r1, =0x0203a030 - movs r0, 0x2 - strb r0, [r1] - b _080F4344 - .pool -_080F40FC: - ldr r0, =0x02021cc4 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xE] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r1, [r6, 0x2] - movs r5, 0xB - muls r1, r5 - ldr r4, =gSpeciesNames - adds r1, r4 - bl CopyString - ldr r0, =0x02021ec4 - ldrh r1, [r6, 0xA] - muls r1, r5 - adds r1, r4 - bl CopyString - ldr r1, =0x0203a030 - movs r0, 0x3 - strb r0, [r1] - b _080F4344 - .pool -_080F4140: - ldrh r1, [r6, 0x8] - movs r0, 0 - bl sub_80EF340 - ldr r4, =0x02021dc4 - ldrh r0, [r6, 0x6] - bl itemid_get_item - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - ldr r1, =0x0203a030 - movs r0, 0x4 - strb r0, [r1] - b _080F4344 - .pool -_080F4168: - ldr r0, =0x02021cc4 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xE] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrb r1, [r6, 0x4] - movs r2, 0 - bl GetMapName - bl TVShowDone - b _080F4344 - .pool -_080F418C: - ldr r0, =0x02021cc4 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xE] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021ec4 - ldrb r1, [r6, 0x4] - movs r2, 0 - bl GetMapName - ldr r1, =0x0203a030 - movs r0, 0x6 - strb r0, [r1] - b _080F4344 - .pool -_080F41D0: - ldr r0, =0x02021cc4 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xE] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r1, [r6, 0x2] - movs r5, 0xB - muls r1, r5 - ldr r4, =gSpeciesNames - adds r1, r4 - bl CopyString - ldr r0, =0x02021ec4 - ldrh r1, [r6, 0xA] - muls r1, r5 - adds r1, r4 - bl CopyString - ldrb r0, [r6, 0x5] - cmp r0, 0x2 - beq _080F423C - cmp r0, 0x2 - bgt _080F4218 - cmp r0, 0x1 - beq _080F421E - b _080F4344 - .pool -_080F4218: - cmp r0, 0x3 - beq _080F4248 - b _080F4344 -_080F421E: - ldrh r0, [r6, 0xC] - cmp r0, 0 - bne _080F4230 - ldr r1, =0x0203a030 - movs r0, 0xC - strb r0, [r1] - b _080F4344 - .pool -_080F4230: - ldr r1, =0x0203a030 - movs r0, 0x7 - strb r0, [r1] - b _080F4344 - .pool -_080F423C: - ldr r1, =0x0203a030 - movs r0, 0x9 - strb r0, [r1] - b _080F4344 - .pool -_080F4248: - ldr r1, =0x0203a030 - movs r0, 0xA - strb r0, [r1] - b _080F4344 - .pool -_080F4254: - ldr r0, =0x02021cc4 - ldrh r2, [r6, 0xC] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0xA] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - b _080F42A8 - .pool -_080F4284: - ldr r0, =0x02021cc4 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xE] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r1, [r6, 0x2] - movs r5, 0xB - muls r1, r5 - ldr r4, =gSpeciesNames - adds r1, r4 - bl CopyString - ldr r0, =0x02021ec4 - ldrh r1, [r6, 0xA] - muls r1, r5 - adds r1, r4 -_080F42A8: - bl CopyString - ldr r1, =0x0203a030 - movs r0, 0x8 - strb r0, [r1] - b _080F4344 - .pool -_080F42C8: - ldr r0, =0x02021cc4 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xE] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrb r1, [r6, 0x4] - movs r2, 0 - bl GetMapName - ldr r1, =0x0203a030 - movs r0, 0xB - strb r0, [r1] - b _080F4344 - .pool -_080F42F4: - ldr r0, =0x02021cc4 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xE] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r1, [r6, 0x2] - movs r4, 0xB - muls r1, r4 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021ec4 - ldrb r1, [r6, 0x4] - movs r2, 0 - bl GetMapName - ldr r0, =0x0203a030 - strb r4, [r0] - b _080F4344 - .pool -_080F4334: - ldr r0, =0x02021cc4 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xE] - bl sub_81DB5E8 - bl TVShowDone -_080F4344: - ldr r0, =gUnknown_0858D428 - lsls r1, r7, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowBreakingNewsTV - - thumb_func_start DoTVShowSecretBaseVisit -DoTVShowSecretBaseVisit: @ 80F4360 - push {r4-r6,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r5, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r6, [r0] - adds r2, r0, 0 - cmp r6, 0xD - bls _080F4388 - b _080F4588 -_080F4388: - lsls r0, r6, 2 - ldr r1, =_080F43AC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F43AC: - .4byte _080F43E4 - .4byte _080F4414 - .4byte _080F44E4 - .4byte _080F4448 - .4byte _080F44E4 - .4byte _080F449C - .4byte _080F44C0 - .4byte _080F44E4 - .4byte _080F44EA - .4byte _080F4538 - .4byte _080F4538 - .4byte _080F4538 - .4byte _080F4538 - .4byte _080F4584 -_080F43E4: - ldr r0, =0x02021cc4 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0xC] - bl sub_81DB5E8 - ldrb r0, [r5, 0x3] - cmp r0, 0 - bne _080F4408 - ldr r1, =0x0203a030 - movs r0, 0x2 - strb r0, [r1] - b _080F4588 - .pool -_080F4408: - ldr r1, =0x0203a030 - movs r0, 0x1 - strb r0, [r1] - b _080F4588 - .pool -_080F4414: - ldr r0, =0x02021dc4 - ldrb r1, [r5, 0x4] - lsls r1, 5 - ldr r2, =gUnknown_085A5C09 - adds r1, r2 - bl CopyString - ldrb r0, [r5, 0x3] - cmp r0, 0x1 - bne _080F443C - ldr r1, =0x0203a030 - movs r0, 0x4 - strb r0, [r1] - b _080F4588 - .pool -_080F443C: - ldr r1, =0x0203a030 - movs r0, 0x3 - strb r0, [r1] - b _080F4588 - .pool -_080F4448: - ldr r0, =0x02021dc4 - ldrb r1, [r5, 0x5] - lsls r1, 5 - ldr r2, =gUnknown_085A5C09 - adds r1, r2 - bl CopyString - ldrb r1, [r5, 0x3] - cmp r1, 0x3 - beq _080F4484 - cmp r1, 0x3 - bgt _080F4470 - cmp r1, 0x2 - beq _080F4476 - b _080F4588 - .pool -_080F4470: - cmp r1, 0x4 - beq _080F4490 - b _080F4588 -_080F4476: - ldr r1, =0x0203a030 - movs r0, 0x7 - strb r0, [r1] - b _080F4588 - .pool -_080F4484: - ldr r1, =0x0203a030 - movs r0, 0x6 - strb r0, [r1] - b _080F4588 - .pool -_080F4490: - ldr r1, =0x0203a030 - movs r0, 0x5 - strb r0, [r1] - b _080F4588 - .pool -_080F449C: - ldr r0, =0x02021dc4 - ldrb r1, [r5, 0x6] - lsls r1, 5 - ldr r4, =gUnknown_085A5C09 - adds r1, r4 - bl CopyString - ldr r0, =0x02021ec4 - ldrb r1, [r5, 0x7] - lsls r1, 5 - adds r1, r4 - b _080F44CA - .pool -_080F44C0: - ldr r0, =0x02021dc4 - ldrb r1, [r5, 0x6] - lsls r1, 5 - ldr r2, =gUnknown_085A5C09 - adds r1, r2 -_080F44CA: - bl CopyString - ldr r1, =0x0203a030 - movs r0, 0x8 - strb r0, [r1] - b _080F4588 - .pool -_080F44E4: - movs r0, 0x8 - strb r0, [r2] - b _080F4588 -_080F44EA: - ldr r0, =0x02021cc4 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0xC] - bl sub_81DB5E8 - ldrb r1, [r5, 0x2] - cmp r1, 0x18 - bhi _080F450C - ldr r1, =0x0203a030 - movs r0, 0xC - strb r0, [r1] - b _080F4588 - .pool -_080F450C: - cmp r1, 0x31 - bhi _080F451C - ldr r1, =0x0203a030 - movs r0, 0xB - strb r0, [r1] - b _080F4588 - .pool -_080F451C: - cmp r1, 0x45 - bhi _080F452C - ldr r1, =0x0203a030 - movs r0, 0xA - strb r0, [r1] - b _080F4588 - .pool -_080F452C: - ldr r1, =0x0203a030 - movs r0, 0x9 - strb r0, [r1] - b _080F4588 - .pool -_080F4538: - ldr r0, =0x02021cc4 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0xC] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r5, 0x8] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021ec4 - ldrh r1, [r5, 0xA] - movs r4, 0xD - muls r1, r4 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - ldr r0, =0x0203a030 - strb r4, [r0] - b _080F4588 - .pool -_080F4584: - bl TVShowDone -_080F4588: - ldr r0, =gUnknown_0858D45C - lsls r1, r6, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowSecretBaseVisit - - thumb_func_start DoTVShowPokemonLotterWinnerFlashReport -DoTVShowPokemonLotterWinnerFlashReport: @ 80F45A0 - push {r4-r6,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r5, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r6, [r0] - ldr r0, =0x02021cc4 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x5] - bl sub_81DB5E8 - ldrb r0, [r5, 0x4] - cmp r0, 0 - bne _080F45FC - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085ECB72 - bl CopyString - b _080F4634 - .pool -_080F45FC: - cmp r0, 0x1 - bne _080F4614 - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085ECB7A - bl CopyString - b _080F4634 - .pool -_080F4614: - cmp r0, 0x2 - bne _080F462C - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085ECB80 - bl CopyString - b _080F4634 - .pool -_080F462C: - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085ECB87 - bl CopyString -_080F4634: - ldr r4, =0x02021ec4 - ldrh r0, [r5, 0x2] - bl itemid_get_item - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - bl TVShowDone - ldr r1, =gUnknown_0858D494 - lsls r0, r6, 2 - adds r0, r1 - ldr r0, [r0] - bl box_related_two__2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowPokemonLotterWinnerFlashReport - - thumb_func_start DoTVShowThePokemonBattleSeminar -DoTVShowThePokemonBattleSeminar: @ 80F466C - push {r4-r7,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r6, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r7, [r0] - cmp r7, 0x6 - bls _080F4692 - b _080F4858 -_080F4692: - lsls r0, r7, 2 - ldr r1, =_080F46B4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F46B4: - .4byte _080F46D0 - .4byte _080F4714 - .4byte _080F4760 - .4byte _080F47B4 - .4byte _080F47EC - .4byte _080F4814 - .4byte _080F4838 -_080F46D0: - ldr r0, =0x02021cc4 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0x11] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r1, [r6, 0x6] - movs r5, 0xB - muls r1, r5 - ldr r4, =gSpeciesNames - adds r1, r4 - bl CopyString - ldr r0, =0x02021ec4 - ldrh r1, [r6, 0x4] - muls r1, r5 - adds r1, r4 - bl CopyString - ldr r1, =0x0203a030 - movs r0, 0x1 - strb r0, [r1] - b _080F4858 - .pool -_080F4714: - ldr r0, =0x02021cc4 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0x11] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x4] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021ec4 - ldrh r2, [r6, 0x2] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - ldr r1, =0x0203a030 - movs r0, 0x2 - strb r0, [r1] - b _080F4858 - .pool -_080F4760: - ldr r0, =0x02021cc4 - ldrh r2, [r6, 0x6] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldrb r1, [r6, 0x10] - cmp r1, 0x2 - beq _080F479C - cmp r1, 0x2 - bgt _080F4788 - cmp r1, 0x1 - beq _080F478E - b _080F4824 - .pool -_080F4788: - cmp r1, 0x3 - beq _080F47A8 - b _080F4824 -_080F478E: - ldr r1, =0x0203a030 - movs r0, 0x5 - strb r0, [r1] - b _080F4858 - .pool -_080F479C: - ldr r1, =0x0203a030 - movs r0, 0x4 - strb r0, [r1] - b _080F4858 - .pool -_080F47A8: - ldr r0, =0x0203a030 - strb r1, [r0] - b _080F4858 - .pool -_080F47B4: - ldr r0, =0x02021cc4 - ldrh r1, [r6, 0x8] - movs r5, 0xD - muls r1, r5 - ldr r4, =gMoveNames - adds r1, r4 - bl CopyString - ldr r0, =0x02021dc4 - ldrh r1, [r6, 0xA] - muls r1, r5 - adds r1, r4 - bl CopyString - ldr r0, =0x02021ec4 - ldrh r1, [r6, 0xC] - muls r1, r5 - adds r1, r4 - b _080F4820 - .pool -_080F47EC: - ldr r0, =0x02021cc4 - ldrh r1, [r6, 0x8] - movs r5, 0xD - muls r1, r5 - ldr r4, =gMoveNames - adds r1, r4 - bl CopyString - ldr r0, =0x02021dc4 - ldrh r1, [r6, 0xA] - muls r1, r5 - adds r1, r4 - b _080F4820 - .pool -_080F4814: - ldr r0, =0x02021dc4 - ldrh r2, [r6, 0x8] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 -_080F4820: - bl CopyString -_080F4824: - ldr r1, =0x0203a030 - movs r0, 0x6 - strb r0, [r1] - b _080F4858 - .pool -_080F4838: - ldr r0, =0x02021cc4 - ldrh r1, [r6, 0xE] - movs r5, 0xD - muls r1, r5 - ldr r4, =gMoveNames - adds r1, r4 - bl CopyString - ldr r0, =0x02021dc4 - ldrh r1, [r6, 0x2] - muls r1, r5 - adds r1, r4 - bl CopyString - bl TVShowDone -_080F4858: - ldr r0, =gUnknown_0858D498 - lsls r1, r7, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowThePokemonBattleSeminar - - thumb_func_start DoTVShowTrainerFanClubSpecial -DoTVShowTrainerFanClubSpecial: @ 80F487C - push {r4,r5,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r5, [r0] - cmp r5, 0x5 - bls _080F48A2 - b _080F499A -_080F48A2: - lsls r0, r5, 2 - ldr r1, =_080F48C4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F48C4: - .4byte _080F48DC - .4byte _080F4944 - .4byte _080F4944 - .4byte _080F4944 - .4byte _080F4944 - .4byte _080F4978 -_080F48DC: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x18] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - adds r1, r4, 0x2 - ldrb r2, [r4, 0x17] - bl sub_81DB5E8 - ldr r0, =0x02021ec4 - ldrh r1, [r4, 0x14] - bl CopyEasyChatWord - ldrb r1, [r4, 0x16] - cmp r1, 0x59 - bls _080F4918 - ldr r1, =0x0203a030 - movs r0, 0x1 - strb r0, [r1] - b _080F499A - .pool -_080F4918: - cmp r1, 0x45 - bls _080F4928 - ldr r1, =0x0203a030 - movs r0, 0x2 - strb r0, [r1] - b _080F499A - .pool -_080F4928: - cmp r1, 0x1D - bls _080F4938 - ldr r1, =0x0203a030 - movs r0, 0x3 - strb r0, [r1] - b _080F499A - .pool -_080F4938: - ldr r1, =0x0203a030 - movs r0, 0x4 - strb r0, [r1] - b _080F499A - .pool -_080F4944: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x18] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - adds r1, r4, 0x2 - ldrb r2, [r4, 0x17] - bl sub_81DB5E8 - ldrb r1, [r4, 0x16] - movs r0, 0x2 - bl sub_80EF340 - ldr r1, =0x0203a030 - movs r0, 0x5 - strb r0, [r1] - b _080F499A - .pool -_080F4978: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x18] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - adds r1, r4, 0x2 - ldrb r2, [r4, 0x17] - bl sub_81DB5E8 - ldr r0, =0x02021ec4 - ldrh r1, [r4, 0x14] - bl CopyEasyChatWord - bl TVShowDone -_080F499A: - ldr r0, =gUnknown_0858D320 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowTrainerFanClubSpecial - - thumb_func_start DoTVShowTrainerFanClub -DoTVShowTrainerFanClub: @ 80F49BC - push {r4,r5,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r5, [r0] - adds r2, r0, 0 - cmp r5, 0xB - bls _080F49E4 - b _080F4B3A -_080F49E4: - lsls r0, r5, 2 - ldr r1, =_080F4A08 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F4A08: - .4byte _080F4A38 - .4byte _080F4B14 - .4byte _080F4B14 - .4byte _080F4B14 - .4byte _080F4B14 - .4byte _080F4B14 - .4byte _080F4B14 - .4byte _080F4B14 - .4byte _080F4B14 - .4byte _080F4B14 - .4byte _080F4B14 - .4byte _080F4B1A -_080F4A38: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x8] - bl sub_81DB5E8 - adds r0, r4, 0 - adds r0, 0x23 - ldrb r0, [r0] - lsls r0, 8 - adds r1, r4, 0 - adds r1, 0x22 - ldrb r1, [r1] - adds r0, r1 - movs r1, 0xA - bl __umodsi3 - cmp r0, 0x9 - bls _080F4A60 - b _080F4B3A -_080F4A60: - lsls r0, 2 - ldr r1, =_080F4A74 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F4A74: - .4byte _080F4A9C - .4byte _080F4AA8 - .4byte _080F4AB4 - .4byte _080F4AC0 - .4byte _080F4ACC - .4byte _080F4AD8 - .4byte _080F4AE4 - .4byte _080F4AF0 - .4byte _080F4AFC - .4byte _080F4B08 -_080F4A9C: - ldr r1, =0x0203a030 - movs r0, 0x1 - strb r0, [r1] - b _080F4B3A - .pool -_080F4AA8: - ldr r1, =0x0203a030 - movs r0, 0x2 - strb r0, [r1] - b _080F4B3A - .pool -_080F4AB4: - ldr r1, =0x0203a030 - movs r0, 0x3 - strb r0, [r1] - b _080F4B3A - .pool -_080F4AC0: - ldr r1, =0x0203a030 - movs r0, 0x4 - strb r0, [r1] - b _080F4B3A - .pool -_080F4ACC: - ldr r1, =0x0203a030 - movs r0, 0x5 - strb r0, [r1] - b _080F4B3A - .pool -_080F4AD8: - ldr r1, =0x0203a030 - movs r0, 0x6 - strb r0, [r1] - b _080F4B3A - .pool -_080F4AE4: - ldr r1, =0x0203a030 - movs r0, 0x7 - strb r0, [r1] - b _080F4B3A - .pool -_080F4AF0: - ldr r1, =0x0203a030 - movs r0, 0x8 - strb r0, [r1] - b _080F4B3A - .pool -_080F4AFC: - ldr r1, =0x0203a030 - movs r0, 0x9 - strb r0, [r1] - b _080F4B3A - .pool -_080F4B08: - ldr r1, =0x0203a030 - movs r0, 0xA - strb r0, [r1] - b _080F4B3A - .pool -_080F4B14: - movs r0, 0xB - strb r0, [r2] - b _080F4B3A -_080F4B1A: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x8] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - ldrh r1, [r4, 0x4] - bl CopyEasyChatWord - ldr r0, =0x02021ec4 - ldrh r1, [r4, 0x6] - bl CopyEasyChatWord - bl TVShowDone -_080F4B3A: - ldr r0, =gUnknown_0858D4B4 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowTrainerFanClub - - thumb_func_start DoTVShowSpotTheCuties -DoTVShowSpotTheCuties: @ 80F4B5C - push {r4,r5,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r5, [r0] - cmp r5, 0xF - bls _080F4B82 - b _080F4D84 -_080F4B82: - lsls r0, r5, 2 - ldr r1, =_080F4BA4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F4BA4: - .4byte _080F4BE4 - .4byte _080F4C30 - .4byte _080F4C30 - .4byte _080F4C30 - .4byte _080F4C64 - .4byte _080F4D64 - .4byte _080F4D64 - .4byte _080F4D64 - .4byte _080F4D64 - .4byte _080F4D64 - .4byte _080F4D64 - .4byte _080F4D64 - .4byte _080F4D64 - .4byte _080F4D64 - .4byte _080F4D64 - .4byte _080F4D80 -_080F4BE4: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0xF] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x10] - bl sub_81DB5E8 - ldrb r1, [r4, 0x2] - cmp r1, 0x9 - bhi _080F4C14 - ldr r1, =0x0203a030 - movs r0, 0x1 - strb r0, [r1] - b _080F4D84 - .pool -_080F4C14: - cmp r1, 0x13 - bhi _080F4C24 - ldr r1, =0x0203a030 - movs r0, 0x2 - strb r0, [r1] - b _080F4D84 - .pool -_080F4C24: - ldr r1, =0x0203a030 - movs r0, 0x3 - strb r0, [r1] - b _080F4D84 - .pool -_080F4C30: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0xF] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x10] - bl sub_81DB5E8 - ldrb r1, [r4, 0x2] - movs r0, 0x2 - bl sub_80EF340 - ldr r1, =0x0203a030 - movs r0, 0x4 - strb r0, [r1] - b _080F4D84 - .pool -_080F4C64: - ldr r0, =0x02021dc4 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x10] - bl sub_81DB5E8 - ldrb r0, [r4, 0x3] - cmp r0, 0x18 - bls _080F4C76 - b _080F4D84 -_080F4C76: - lsls r0, 2 - ldr r1, =_080F4C88 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F4C88: - .4byte _080F4CEC - .4byte _080F4CF8 - .4byte _080F4CF8 - .4byte _080F4CF8 - .4byte _080F4CF8 - .4byte _080F4D04 - .4byte _080F4D04 - .4byte _080F4D04 - .4byte _080F4D04 - .4byte _080F4D10 - .4byte _080F4D10 - .4byte _080F4D10 - .4byte _080F4D10 - .4byte _080F4D1C - .4byte _080F4D1C - .4byte _080F4D1C - .4byte _080F4D1C - .4byte _080F4D28 - .4byte _080F4D28 - .4byte _080F4D28 - .4byte _080F4D28 - .4byte _080F4D34 - .4byte _080F4D40 - .4byte _080F4D4C - .4byte _080F4D58 -_080F4CEC: - ldr r1, =0x0203a030 - movs r0, 0x5 - strb r0, [r1] - b _080F4D84 - .pool -_080F4CF8: - ldr r1, =0x0203a030 - movs r0, 0x6 - strb r0, [r1] - b _080F4D84 - .pool -_080F4D04: - ldr r1, =0x0203a030 - movs r0, 0x7 - strb r0, [r1] - b _080F4D84 - .pool -_080F4D10: - ldr r1, =0x0203a030 - movs r0, 0x8 - strb r0, [r1] - b _080F4D84 - .pool -_080F4D1C: - ldr r1, =0x0203a030 - movs r0, 0x9 - strb r0, [r1] - b _080F4D84 - .pool -_080F4D28: - ldr r1, =0x0203a030 - movs r0, 0xA - strb r0, [r1] - b _080F4D84 - .pool -_080F4D34: - ldr r1, =0x0203a030 - movs r0, 0xB - strb r0, [r1] - b _080F4D84 - .pool -_080F4D40: - ldr r1, =0x0203a030 - movs r0, 0xC - strb r0, [r1] - b _080F4D84 - .pool -_080F4D4C: - ldr r1, =0x0203a030 - movs r0, 0xD - strb r0, [r1] - b _080F4D84 - .pool -_080F4D58: - ldr r1, =0x0203a030 - movs r0, 0xE - strb r0, [r1] - b _080F4D84 - .pool -_080F4D64: - ldr r0, =0x02021dc4 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x10] - bl sub_81DB5E8 - ldr r1, =0x0203a030 - movs r0, 0xF - strb r0, [r1] - b _080F4D84 - .pool -_080F4D80: - bl TVShowDone -_080F4D84: - ldr r0, =gUnknown_0858D4E4 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowSpotTheCuties - - thumb_func_start DoTVShowPokemonNewsBattleFrontier -DoTVShowPokemonNewsBattleFrontier: @ 80F4D9C - push {r4-r7,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r6, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r7, [r0] - adds r2, r0, 0 - cmp r7, 0x12 - bls _080F4DC4 - b _080F5014 -_080F4DC4: - lsls r0, r7, 2 - ldr r1, =_080F4DE8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F4DE8: - .4byte _080F4E34 - .4byte _080F4F18 - .4byte _080F4ECE - .4byte _080F4EF4 - .4byte _080F4EF4 - .4byte _080F4F18 - .4byte _080F4F18 - .4byte _080F4F18 - .4byte _080F4F18 - .4byte _080F4F18 - .4byte _080F4F18 - .4byte _080F4F18 - .4byte _080F4F18 - .4byte _080F4F18 - .4byte _080F4F3C - .4byte _080F4F74 - .4byte _080F4F9C - .4byte _080F4FE0 - .4byte _080F5004 -_080F4E34: - ldrb r0, [r6, 0xD] - subs r0, 0x1 - cmp r0, 0xC - bls _080F4E3E - b _080F5014 -_080F4E3E: - lsls r0, 2 - ldr r1, =_080F4E4C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F4E4C: - .4byte _080F4E80 - .4byte _080F4E86 - .4byte _080F4E8C - .4byte _080F4E92 - .4byte _080F4E98 - .4byte _080F4E9E - .4byte _080F4EA4 - .4byte _080F4EAA - .4byte _080F4EB0 - .4byte _080F4EB6 - .4byte _080F4EBC - .4byte _080F4EC2 - .4byte _080F4EC8 -_080F4E80: - movs r0, 0x1 - strb r0, [r2] - b _080F5014 -_080F4E86: - movs r0, 0x2 - strb r0, [r2] - b _080F5014 -_080F4E8C: - movs r0, 0x3 - strb r0, [r2] - b _080F5014 -_080F4E92: - movs r0, 0x4 - strb r0, [r2] - b _080F5014 -_080F4E98: - movs r0, 0x5 - strb r0, [r2] - b _080F5014 -_080F4E9E: - movs r0, 0x6 - strb r0, [r2] - b _080F5014 -_080F4EA4: - movs r0, 0x7 - strb r0, [r2] - b _080F5014 -_080F4EAA: - movs r0, 0x8 - strb r0, [r2] - b _080F5014 -_080F4EB0: - movs r0, 0x9 - strb r0, [r2] - b _080F5014 -_080F4EB6: - movs r0, 0xA - strb r0, [r2] - b _080F5014 -_080F4EBC: - movs r0, 0xB - strb r0, [r2] - b _080F5014 -_080F4EC2: - movs r0, 0xC - strb r0, [r2] - b _080F5014 -_080F4EC8: - movs r0, 0xD - strb r0, [r2] - b _080F5014 -_080F4ECE: - ldr r0, =0x02021cc4 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xC] - bl sub_81DB5E8 - ldrh r1, [r6, 0x2] - movs r0, 0x1 - bl sub_80EF340 - ldr r1, =0x0203a030 - movs r0, 0x10 - strb r0, [r1] - b _080F5014 - .pool -_080F4EF4: - ldr r0, =0x02021cc4 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xC] - bl sub_81DB5E8 - ldrh r1, [r6, 0x2] - movs r0, 0x1 - bl sub_80EF340 - ldr r1, =0x0203a030 - movs r0, 0xF - strb r0, [r1] - b _080F5014 - .pool -_080F4F18: - ldr r0, =0x02021cc4 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xC] - bl sub_81DB5E8 - ldrh r1, [r6, 0x2] - movs r0, 0x1 - bl sub_80EF340 - ldr r1, =0x0203a030 - movs r0, 0xE - strb r0, [r1] - b _080F5014 - .pool -_080F4F3C: - ldr r0, =0x02021cc4 - ldrh r1, [r6, 0x4] - movs r5, 0xB - muls r1, r5 - ldr r4, =gSpeciesNames - adds r1, r4 - bl CopyString - ldr r0, =0x02021dc4 - ldrh r1, [r6, 0x6] - muls r1, r5 - adds r1, r4 - bl CopyString - ldr r0, =0x02021ec4 - ldrh r1, [r6, 0x8] - muls r1, r5 - adds r1, r4 - b _080F4FEC - .pool -_080F4F74: - ldr r0, =0x02021cc4 - ldrh r1, [r6, 0x4] - movs r5, 0xB - muls r1, r5 - ldr r4, =gSpeciesNames - adds r1, r4 - bl CopyString - ldr r0, =0x02021dc4 - ldrh r1, [r6, 0x6] - muls r1, r5 - adds r1, r4 - b _080F4FEC - .pool -_080F4F9C: - ldr r0, =0x02021cc4 - ldrh r1, [r6, 0x4] - movs r5, 0xB - muls r1, r5 - ldr r4, =gSpeciesNames - adds r1, r4 - bl CopyString - ldr r0, =0x02021dc4 - ldrh r1, [r6, 0x6] - muls r1, r5 - adds r1, r4 - bl CopyString - ldr r0, =0x02021ec4 - ldrh r1, [r6, 0x8] - muls r1, r5 - adds r1, r4 - bl CopyString - ldr r1, =0x0203a030 - movs r0, 0x11 - strb r0, [r1] - b _080F5014 - .pool -_080F4FE0: - ldr r0, =0x02021cc4 - ldrh r2, [r6, 0xA] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 -_080F4FEC: - bl CopyString - ldr r1, =0x0203a030 - movs r0, 0x12 - strb r0, [r1] - b _080F5014 - .pool -_080F5004: - ldr r0, =0x02021cc4 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xC] - bl sub_81DB5E8 - bl TVShowDone -_080F5014: - ldr r0, =gUnknown_0858D524 - lsls r1, r7, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowPokemonNewsBattleFrontier - - thumb_func_start DoTVShowWhatsNo1InHoennToday -DoTVShowWhatsNo1InHoennToday: @ 80F5030 - push {r4,r5,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r5, [r0] - cmp r5, 0x8 - bls _080F5056 - b _080F5164 -_080F5056: - lsls r0, r5, 2 - ldr r1, =_080F5078 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F5078: - .4byte _080F509C - .4byte _080F5130 - .4byte _080F5130 - .4byte _080F5130 - .4byte _080F5130 - .4byte _080F5130 - .4byte _080F5130 - .4byte _080F5130 - .4byte _080F5154 -_080F509C: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x5] - bl sub_81DB5E8 - ldrb r0, [r4, 0x4] - cmp r0, 0x6 - bhi _080F5164 - lsls r0, 2 - ldr r1, =_080F50C0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F50C0: - .4byte _080F50DC - .4byte _080F50E8 - .4byte _080F50F4 - .4byte _080F5100 - .4byte _080F510C - .4byte _080F5118 - .4byte _080F5124 -_080F50DC: - ldr r1, =0x0203a030 - movs r0, 0x1 - strb r0, [r1] - b _080F5164 - .pool -_080F50E8: - ldr r1, =0x0203a030 - movs r0, 0x2 - strb r0, [r1] - b _080F5164 - .pool -_080F50F4: - ldr r1, =0x0203a030 - movs r0, 0x3 - strb r0, [r1] - b _080F5164 - .pool -_080F5100: - ldr r1, =0x0203a030 - movs r0, 0x4 - strb r0, [r1] - b _080F5164 - .pool -_080F510C: - ldr r1, =0x0203a030 - movs r0, 0x5 - strb r0, [r1] - b _080F5164 - .pool -_080F5118: - ldr r1, =0x0203a030 - movs r0, 0x6 - strb r0, [r1] - b _080F5164 - .pool -_080F5124: - ldr r1, =0x0203a030 - movs r0, 0x7 - strb r0, [r1] - b _080F5164 - .pool -_080F5130: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x5] - bl sub_81DB5E8 - ldrh r1, [r4, 0x2] - movs r0, 0x1 - bl sub_80EF340 - ldr r1, =0x0203a030 - movs r0, 0x8 - strb r0, [r1] - b _080F5164 - .pool -_080F5154: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x5] - bl sub_81DB5E8 - bl TVShowDone -_080F5164: - ldr r0, =gUnknown_0858D570 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowWhatsNo1InHoennToday - - thumb_func_start sub_80F5180 -sub_80F5180: @ 80F5180 - push {r4,lr} - movs r1, 0 - movs r2, 0 - ldr r3, [r0, 0xC] - movs r4, 0x1 -_080F518A: - adds r0, r3, 0 - lsrs r0, r1 - ands r0, r4 - cmp r0, 0 - beq _080F519A - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_080F519A: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1F - bls _080F518A - adds r0, r2, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80F5180 - - thumb_func_start sub_80F51AC -sub_80F51AC: @ 80F51AC - push {r4-r6,lr} - lsls r1, 24 - lsrs r4, r1, 24 - movs r2, 0 - movs r3, 0 - ldr r1, [r0, 0xC] - movs r5, 0x1 - ldr r6, =gUnknown_0858D690 -_080F51BC: - adds r0, r1, 0 - lsrs r0, r2 - ands r0, r5 - cmp r0, 0 - beq _080F51DA - cmp r3, r4 - bne _080F51D4 - adds r0, r2, r6 - ldrb r0, [r0] - b _080F51E6 - .pool -_080F51D4: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 -_080F51DA: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x1F - bls _080F51BC - movs r0, 0 -_080F51E6: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80F51AC - - thumb_func_start DoTVShowSecretBaseSecrets -DoTVShowSecretBaseSecrets: @ 80F51EC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r5, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r2, [r0] - mov r9, r2 - adds r2, r0, 0 - mov r0, r9 - cmp r0, 0x2B - bls _080F521E - b _080F552A -_080F521E: - lsls r0, 2 - ldr r1, =_080F5240 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F5240: - .4byte _080F52F0 - .4byte _080F5348 - .4byte _080F53C4 - .4byte _080F5444 - .4byte _080F5498 - .4byte _080F5498 - .4byte _080F5498 - .4byte _080F54C4 - .4byte _080F54E8 - .4byte _080F54EC - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F54F0 - .4byte _080F5510 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 -_080F52F0: - ldr r0, =0x02021cc4 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x1C] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x1B] - bl sub_81DB5E8 - adds r0, r5, 0 - bl sub_80F5180 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _080F5328 - ldr r1, =0x0203a030 - movs r0, 0x8 - strb r0, [r1] - b _080F552A - .pool -_080F5328: - movs r0, 0x1 - strb r0, [r5, 0x12] - bl GenerateRandomNumber - ldr r4, =0x0203a031 - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - strb r0, [r4] - ldrb r1, [r4] - b _080F542A - .pool -_080F5348: - ldr r0, =0x02021dc4 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x1B] - bl sub_81DB5E8 - adds r0, r5, 0 - bl sub_80F5180 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x1 - beq _080F53DE - cmp r6, 0x2 - beq _080F5370 - movs r4, 0 - b _080F538A - .pool -_080F5370: - strb r6, [r5, 0x12] - ldr r0, =0x0203a031 - ldrb r0, [r0] - cmp r0, 0 - bne _080F5384 - adds r0, r5, 0 - movs r1, 0x1 - b _080F542C - .pool -_080F5384: - adds r0, r5, 0 - movs r1, 0 - b _080F542C -_080F538A: - bl GenerateRandomNumber - ldr r7, =0x0203a031 - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - strb r0, [r7, 0x1] - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r7] - cmp r0, r1 - bne _080F53B2 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x0000fffe - cmp r4, r0 - bls _080F538A -_080F53B2: - movs r0, 0x2 - strb r0, [r5, 0x12] - ldrb r1, [r7, 0x1] - b _080F542A - .pool -_080F53C4: - ldr r0, =0x02021dc4 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x1B] - bl sub_81DB5E8 - adds r0, r5, 0 - bl sub_80F5180 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bne _080F53F0 -_080F53DE: - ldr r1, =0x0203a030 - movs r0, 0x9 - strb r0, [r1] - b _080F552A - .pool -_080F53F0: - movs r4, 0 - ldr r7, =0x0203a031 - ldr r2, =0x0000fffe - mov r8, r2 -_080F53F8: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - strb r0, [r7, 0x2] - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r7] - cmp r0, r1 - beq _080F5418 - ldrb r2, [r7, 0x1] - cmp r0, r2 - bne _080F5422 -_080F5418: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r8 - bls _080F53F8 -_080F5422: - movs r0, 0x3 - strb r0, [r5, 0x12] - ldr r0, =0x0203a031 - ldrb r1, [r0, 0x2] -_080F542A: - adds r0, r5, 0 -_080F542C: - bl sub_80F51AC - ldr r1, =0x0203a030 - strb r0, [r1] - b _080F552A - .pool -_080F5444: - ldr r0, =0x02021cc4 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x1C] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x1B] - bl sub_81DB5E8 - ldrh r1, [r5, 0x2] - movs r0, 0x2 - bl sub_80EF340 - ldrh r0, [r5, 0x2] - cmp r0, 0x1E - bhi _080F547C - ldr r1, =0x0203a030 - movs r0, 0x4 - strb r0, [r1] - b _080F552A - .pool -_080F547C: - cmp r0, 0x64 - bhi _080F548C - ldr r1, =0x0203a030 - movs r0, 0x5 - strb r0, [r1] - b _080F552A - .pool -_080F548C: - ldr r1, =0x0203a030 - movs r0, 0x6 - strb r0, [r1] - b _080F552A - .pool -_080F5498: - ldr r0, =0x02021cc4 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x1C] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x1B] - bl sub_81DB5E8 - ldr r1, =0x0203a030 - movs r0, 0x7 - strb r0, [r1] - b _080F552A - .pool -_080F54C4: - ldr r0, =0x02021cc4 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x1C] - bl sub_81DB5E8 - ldr r0, =0x02021dc4 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x1B] - bl sub_81DB5E8 - bl TVShowDone - b _080F552A - .pool -_080F54E8: - movs r0, 0x3 - b _080F5528 -_080F54EC: - movs r0, 0x3 - b _080F5528 -_080F54F0: - ldr r4, =0x02021dc4 - ldrh r0, [r5, 0x10] - bl itemid_get_item - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - ldr r1, =0x0203a030 - ldrb r0, [r5, 0x12] - strb r0, [r1] - b _080F552A - .pool -_080F5510: - adds r0, r5, 0 - adds r0, 0x22 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080F5522 - movs r0, 0x16 - b _080F5528 -_080F5522: - movs r0, 0x15 - b _080F5528 -_080F5526: - ldrb r0, [r5, 0x12] -_080F5528: - strb r0, [r2] -_080F552A: - ldr r0, =gUnknown_0858D594 - mov r2, r9 - lsls r1, r2, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowSecretBaseSecrets - - thumb_func_start DoTVShowSafariFanClub -DoTVShowSafariFanClub: @ 80F5548 - push {r4,r5,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x0203a030 - ldrb r5, [r0] - adds r2, r0, 0 - cmp r5, 0xA - bls _080F5570 - b _080F56BC -_080F5570: - lsls r0, r5, 2 - ldr r1, =_080F5594 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F5594: - .4byte _080F55C0 - .4byte _080F55DC - .4byte _080F5614 - .4byte _080F5628 - .4byte _080F569A - .4byte _080F562E - .4byte _080F5650 - .4byte _080F5680 - .4byte _080F5694 - .4byte _080F569A - .4byte _080F56B8 -_080F55C0: - ldrb r1, [r4, 0x2] - cmp r1, 0 - bne _080F55CC - movs r0, 0x6 - strb r0, [r2] - b _080F56BC -_080F55CC: - cmp r1, 0x3 - bhi _080F55D6 - movs r0, 0x5 - strb r0, [r2] - b _080F56BC -_080F55D6: - movs r0, 0x1 - strb r0, [r2] - b _080F56BC -_080F55DC: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x4] - bl sub_81DB5E8 - ldrb r1, [r4, 0x2] - movs r0, 0x1 - bl sub_80EF340 - ldrb r0, [r4, 0x3] - cmp r0, 0 - bne _080F5608 - ldr r1, =0x0203a030 - movs r0, 0x3 - strb r0, [r1] - b _080F56BC - .pool -_080F5608: - ldr r1, =0x0203a030 - movs r0, 0x2 - strb r0, [r1] - b _080F56BC - .pool -_080F5614: - ldrb r1, [r4, 0x3] - movs r0, 0x1 - bl sub_80EF340 - ldr r1, =0x0203a030 - movs r0, 0x4 - strb r0, [r1] - b _080F56BC - .pool -_080F5628: - movs r0, 0x4 - strb r0, [r2] - b _080F56BC -_080F562E: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x4] - bl sub_81DB5E8 - ldrb r1, [r4, 0x2] - movs r0, 0x1 - bl sub_80EF340 - ldrb r0, [r4, 0x3] - cmp r0, 0 - beq _080F5662 - b _080F5674 - .pool -_080F5650: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x4] - bl sub_81DB5E8 - ldrb r0, [r4, 0x3] - cmp r0, 0 - bne _080F5674 -_080F5662: - ldr r1, =0x0203a030 - movs r0, 0x8 - strb r0, [r1] - b _080F56BC - .pool -_080F5674: - ldr r1, =0x0203a030 - movs r0, 0x7 - strb r0, [r1] - b _080F56BC - .pool -_080F5680: - ldrb r1, [r4, 0x3] - movs r0, 0x1 - bl sub_80EF340 - ldr r1, =0x0203a030 - movs r0, 0x9 - strb r0, [r1] - b _080F56BC - .pool -_080F5694: - movs r0, 0x9 - strb r0, [r2] - b _080F56BC -_080F569A: - ldr r0, =0x02021cc4 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x4] - bl sub_81DB5E8 - ldr r1, =0x0203a030 - movs r0, 0xA - strb r0, [r1] - b _080F56BC - .pool -_080F56B8: - bl TVShowDone -_080F56BC: - ldr r0, =gUnknown_0858D640 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowSafariFanClub - - thumb_func_start DoTVShowPokemonContestLiveUpdates2 -DoTVShowPokemonContestLiveUpdates2: @ 80F56D4 - push {r4-r6,lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r6, =0x0203a030 - ldrb r5, [r6] - cmp r5, 0x2 - bgt _080F5718 - cmp r5, 0x1 - bge _080F5744 - cmp r5, 0 - beq _080F571E - b _080F575E - .pool -_080F5718: - cmp r5, 0x3 - beq _080F574E - b _080F575E -_080F571E: - ldr r0, =0x02021cc4 - ldrb r1, [r4, 0xA] - bl sub_818E868 - ldrb r1, [r4, 0x16] - cmp r1, 0x1 - bne _080F5734 - strb r1, [r6] - b _080F575E - .pool -_080F5734: - cmp r1, 0 - bne _080F573E - movs r0, 0x2 - strb r0, [r6] - b _080F575E -_080F573E: - movs r0, 0x3 - strb r0, [r6] - b _080F575E -_080F5744: - ldr r0, =0x02021ec4 - adds r1, r4, 0x2 - ldrb r2, [r4, 0x17] - bl sub_81DB5E8 -_080F574E: - ldr r0, =0x02021dc4 - adds r1, r4, 0 - adds r1, 0xB - ldrb r2, [r4, 0x18] - bl sub_81DB5E8 - bl TVShowDone -_080F575E: - ldr r0, =gUnknown_0858D384 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowPokemonContestLiveUpdates2 - - thumb_func_start TVShowDone -TVShowDone: @ 80F577C - ldr r1, =0x020375f0 - movs r0, 0x1 - strh r0, [r1] - ldr r1, =0x0203a030 - movs r0, 0 - strb r0, [r1] - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r2, r0 - ldr r0, =0x000027cd - adds r2, r0 - movs r0, 0 - strb r0, [r2] - bx lr - .pool - thumb_func_end TVShowDone - - thumb_func_start ResetTVShowState -ResetTVShowState: @ 80F57B8 - ldr r1, =0x0203a030 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end ResetTVShowState - - thumb_func_start sub_80F57C4 -sub_80F57C4: @ 80F57C4 - push {r4,lr} - movs r0, 0 - movs r1, 0x40 - bl SetGpuReg - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0858D888 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - movs r4, 0 -_080F57E0: - lsls r0, r4, 24 - lsrs r0, 24 - ldr r1, =0x0203a034 - ldr r1, [r1] - lsls r2, r4, 2 - adds r1, 0xC - adds r1, r2 - ldr r1, [r1] - bl SetBgTilemapBuffer - adds r4, 0x1 - cmp r4, 0x3 - ble _080F57E0 - ldr r0, =gUnknown_0858D898 - bl InitWindows - bl DeactivateAllTextPrinters - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - ldr r1, =0x00003f2e - movs r0, 0x4A - 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, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0x1C - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - movs r1, 0xFF - lsls r1, 8 - movs r0, 0 - bl SetGpuRegBits - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r0, =0x02022e18 - strh r1, [r0] - ldr r0, =0x02022e1a - strh r1, [r0] - ldr r0, =0x02022e1c - strh r1, [r0] - ldr r0, =0x02022e1e - strh r1, [r0] - ldr r0, =0x02022e20 - strh r1, [r0] - ldr r0, =0x02022e22 - strh r1, [r0] - ldr r0, =0x02022e24 - strh r1, [r0] - ldr r0, =0x02022e26 - strh r1, [r0] - ldr r0, =0x02022e28 - strh r1, [r0] - ldr r0, =0x02022e2a - strh r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F57C4 - - thumb_func_start sub_80F591C -sub_80F591C: @ 80F591C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - ldr r0, =gUnknown_08C19588 - movs r1, 0xC0 - lsls r1, 19 - bl LZDecompressVram - ldr r1, =gUnknown_08C1A12C - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r1, =gUnknown_08C1A000 - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r1, =gUnknown_08C19EEC - movs r0, 0 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - bl sub_80F71C8 - ldr r0, =gUnknown_08C1A2B4 - movs r2, 0x80 - lsls r2, 2 - movs r1, 0 - bl decompress_palette - ldr r0, =gUnknown_0858D6B0 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - movs r7, 0 - movs r0, 0x1 - mov r8, r0 -_080F5976: - lsls r5, r7, 24 - lsrs r5, 24 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80F7310 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80F7364 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - movs r6, 0 - lsls r1, r7, 1 - adds r2, r7, 0x1 - str r2, [sp, 0xC] - lsls r4, 24 - asrs r4, 24 - mov r10, r4 - adds r1, r7 - adds r0, r1, 0x6 - lsls r0, 24 - mov r9, r0 - adds r1, 0x5 - lsls r7, r1, 24 -_080F59B0: - ldr r1, =0x000060b2 - cmp r6, r10 - bge _080F59B8 - adds r1, 0x2 -_080F59B8: - ldr r4, [sp, 0x8] - lsls r0, r4, 24 - asrs r0, 24 - adds r2, r0, 0 - cmp r0, 0 - bge _080F59C6 - negs r2, r0 -_080F59C6: - cmp r6, r2 - bge _080F59F4 - ldr r5, =0x000060a4 - cmp r0, 0 - bge _080F59F6 - adds r5, 0x2 - b _080F59F6 - .pool -_080F59F4: - ldr r5, =0x000060a2 -_080F59F6: - adds r4, r6, 0 - adds r4, 0x13 - lsls r4, 24 - lsrs r4, 24 - mov r0, r8 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x1 - adds r2, r4, 0 - lsrs r3, r7, 24 - bl FillBgTilemapBufferRect_Palette0 - mov r2, r8 - str r2, [sp] - str r2, [sp, 0x4] - movs r0, 0x1 - adds r1, r5, 0 - adds r2, r4, 0 - mov r4, r9 - lsrs r3, r4, 24 - bl FillBgTilemapBufferRect_Palette0 - adds r6, 0x1 - cmp r6, 0x9 - ble _080F59B0 - ldr r7, [sp, 0xC] - cmp r7, 0x3 - ble _080F5976 - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - 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_80F591C - - thumb_func_start sub_80F5A74 -sub_80F5A74: @ 80F5A74 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - lsls r1, r5, 6 - ldr r0, =0x02039e00 - adds r7, r1, r0 - ldr r6, =0x02022e2c - ldr r0, =0x02039f25 - ldrb r0, [r0] - cmp r5, r0 - bne _080F5A96 - ldr r1, =gUnknown_085ED21E - adds r0, r6, 0 - bl CopyString - adds r6, r0, 0 -_080F5A96: - adds r1, r7, 0x2 - adds r0, r6, 0 - bl CopyString - ldr r4, =0x02022e2c - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0 - bl sub_80F7ED0 - ldr r1, =gUnknown_085E8D3E - adds r0, r6, 0 - bl CopyString - adds r1, r7, 0 - adds r1, 0xD - adds r0, r6, 0 - bl AppendString - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x32 - bl sub_80F7ED0 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F5A74 - - thumb_func_start sub_80F5AE0 -sub_80F5AE0: @ 80F5AE0 - push {r4,lr} - movs r4, 0 -_080F5AE4: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_80F5A74 - adds r4, 0x1 - cmp r4, 0x3 - ble _080F5AE4 - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80F5AE0 - - thumb_func_start sub_80F5B00 -sub_80F5B00: @ 80F5B00 - push {r4-r6,lr} - sub sp, 0x4 - ldr r5, =0x02037fd4 - ldrb r0, [r5, 0x8] - movs r6, 0x80 - orrs r0, r6 - strb r0, [r5, 0x8] - movs r0, 0 - bl SetVBlankCallback - bl sub_80F7DF4 - bl sub_80F57C4 - bl dp12_8087EA4 - bl sub_80A1A74 - bl ResetAllObjectData - bl ResetTasks - bl ResetObjectPaletteAllocator - bl sub_80F591C - bl sub_80F6A9C - movs r0, 0 - movs r1, 0x1 - bl sub_80F6A64 - bl sub_80F5AE0 - ldr r4, =0x0203a034 - ldr r0, [r4] - ldr r0, [r0] - movs r1, 0 - movs r2, 0x18 - bl memset - ldr r0, [r4] - ldr r0, [r0, 0x4] - movs r1, 0 - movs r2, 0x50 - bl memset - bl sub_80F6DC0 - bl sub_80F6AE8 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldrb r1, [r5, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r5, 0x8] - ldr r0, =sub_80F5CE4 - movs r1, 0x5 - bl CreateTask - ldr r1, [r4] - ldr r1, [r1] - strb r0, [r1, 0x2] - ldr r0, =sub_80F5C00 - bl SetMainCallback2 - ldr r1, =0x02022e28 - movs r0, 0xF0 - strh r0, [r1] - ldr r1, =0x02022e2a - ldr r2, =0x000080a0 - adds r0, r2, 0 - strh r0, [r1] - ldr r0, =sub_80F68B4 - movs r1, 0x14 - bl CreateTask - bl sub_80F7880 - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080F5BE4 - ldrb r0, [r5, 0x8] - orrs r0, r6 - strb r0, [r5, 0x8] - b _080F5BEC - .pool -_080F5BE4: - movs r0, 0xDF - lsls r0, 1 - bl song_play_for_text -_080F5BEC: - ldr r0, =sub_80F5C24 - bl SetVBlankCallback - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F5B00 - - thumb_func_start sub_80F5C00 -sub_80F5C00: @ 80F5C00 - push {lr} - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTasks - bl fade_and_return_progress_probably - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - pop {r0} - bx r0 - thumb_func_end sub_80F5C00 - - thumb_func_start sub_80F5C24 -sub_80F5C24: @ 80F5C24 - push {lr} - ldr r0, =0x02022e14 - ldrh r1, [r0] - movs r0, 0x10 - bl SetGpuReg - ldr r0, =0x02022e16 - ldrh r1, [r0] - movs r0, 0x12 - bl SetGpuReg - ldr r0, =0x02022e18 - ldrh r1, [r0] - movs r0, 0x14 - bl SetGpuReg - ldr r0, =0x02022e1a - ldrh r1, [r0] - movs r0, 0x16 - bl SetGpuReg - ldr r0, =0x02022e1c - ldrh r1, [r0] - movs r0, 0x18 - bl SetGpuReg - ldr r0, =0x02022e1e - ldrh r1, [r0] - movs r0, 0x1A - bl SetGpuReg - ldr r0, =0x02022e20 - ldrh r1, [r0] - movs r0, 0x1C - bl SetGpuReg - ldr r0, =0x02022e22 - ldrh r1, [r0] - movs r0, 0x1E - bl SetGpuReg - ldr r0, =0x02022e24 - ldrh r1, [r0] - movs r0, 0x40 - bl SetGpuReg - ldr r0, =0x02022e26 - ldrh r1, [r0] - movs r0, 0x44 - bl SetGpuReg - ldr r0, =0x02022e28 - ldrh r1, [r0] - movs r0, 0x42 - bl SetGpuReg - ldr r0, =0x02022e2a - ldrh r1, [r0] - movs r0, 0x46 - bl SetGpuReg - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - bl sub_80BA0A8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F5C24 - - thumb_func_start sub_80F5CE4 -sub_80F5CE4: @ 80F5CE4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r3, =0x02039f2a - ldrb r1, [r3] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080F5CF8 - b _080F5E2E -_080F5CF8: - ldr r2, =0x03005e00 - lsls r1, r6, 2 - adds r0, r1, r6 - lsls r0, 3 - adds r4, r0, r2 - movs r2, 0x8 - ldrsh r0, [r4, r2] - adds r7, r1, 0 - cmp r0, 0x1 - beq _080F5DE0 - cmp r0, 0x1 - bgt _080F5D20 - cmp r0, 0 - beq _080F5D2A - b _080F5E2E - .pool -_080F5D20: - cmp r0, 0x2 - beq _080F5DF4 - cmp r0, 0x3 - beq _080F5E0A - b _080F5E2E -_080F5D2A: - bl sub_80DBED4 - ldr r1, =0x02039f20 - ldr r0, =0x02039f25 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080F5D58 - movs r0, 0x23 - bl sav12_xor_increment - ldr r1, =0x020375e2 - movs r0, 0x8 - strh r0, [r1] - bl InterviewBefore - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0x1 - beq _080F5D58 - bl InterviewAfter -_080F5D58: - movs r0, 0x2 - bl sub_813BADC - ldr r0, =0x02039f2e - ldrb r0, [r0] - bl sub_80DEDA8 - movs r0, 0xFE - bl sub_80DEDA8 - ldr r1, =0x02039f5c - movs r0, 0x1 - strb r0, [r1] - movs r0, 0xFE - movs r1, 0 - bl sub_80DEFA8 - ldr r1, =0x02039f5d - strb r0, [r1] - ldr r5, =0x00004086 - adds r0, r5, 0 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0 - bl VarSet - bl sub_8076D5C - movs r0, 0x1 - bl save_game_when_memory_present - bl sav2_gender2_inplace_and_xFE - adds r0, r5, 0 - adds r1, r4, 0 - bl VarSet - ldr r0, =0x03005e00 - adds r1, r7, r6 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _080F5E2E - .pool -_080F5DE0: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - ldrb r1, [r3] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _080F5E2E - movs r0, 0x64 - b _080F5E2C -_080F5DF4: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080F5EBA - bl sub_800ADF8 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080F5EBA -_080F5E0A: - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080F5EBA - movs r0, 0xDF - lsls r0, 1 - bl song_play_for_text - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] - ldrh r0, [r4, 0x8] - adds r0, 0x1 -_080F5E2C: - strh r0, [r4, 0x8] -_080F5E2E: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - bne _080F5EBA - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r1 - strh r2, [r4, 0x8] - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r5, 0x1 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _080F5E78 - ldr r0, =gUnknown_085ED207 - bl sub_80F707C - ldr r0, =sub_80F5ED8 - b _080F5EB8 - .pool -_080F5E78: - movs r0, 0x24 - bl sav12_xor_increment - ldr r1, =0x02039f20 - ldr r0, =0x02039f25 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080F5E92 - movs r0, 0x25 - bl sav12_xor_increment -_080F5E92: - ldr r0, =0x02039f2e - ldrb r0, [r0] - bl sub_80DEDA8 - movs r0, 0xFE - bl sub_80DEDA8 - ldr r0, =0x02039f5c - strb r5, [r0] - movs r0, 0xFE - movs r1, 0 - bl sub_80DEFA8 - ldr r1, =0x02039f5d - strb r0, [r1] - movs r0, 0x2 - bl sub_813BADC - ldr r0, =sub_80F5F74 -_080F5EB8: - str r0, [r4] -_080F5EBA: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F5CE4 - - thumb_func_start sub_80F5ED8 -sub_80F5ED8: @ 80F5ED8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _080F5EFC - ldr r0, =sub_80F5F14 - movs r1, 0 - bl CreateTask - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =TaskDummy - str r1, [r0] -_080F5EFC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F5ED8 - - thumb_func_start sub_80F5F14 -sub_80F5F14: @ 80F5F14 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =sub_80FC998 - ldr r2, =sub_80F5F30 - bl SetTaskFuncWithFollowupFunc - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F5F14 - - thumb_func_start sub_80F5F30 -sub_80F5F30: @ 80F5F30 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080F5F60 - adds r0, r4, 0 - bl DestroyTask - ldr r2, =0x03005e00 - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r0, [r0] - ldrb r1, [r0, 0x2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldr r1, =sub_80F5F74 - str r1, [r0] - bl sub_80F7144 -_080F5F60: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F5F30 - - thumb_func_start sub_80F5F74 -sub_80F5F74: @ 80F5F74 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r1, [r4, 0x8] - movs r2, 0x8 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _080F5FC4 - ldr r0, =sub_80F68F0 - movs r1, 0x14 - bl CreateTask - ldr r0, =gUnknown_085ED1B8 - ldr r1, =0x0203a034 - ldr r1, [r1] - ldr r1, [r1] - ldrb r1, [r1] - bl sub_80F6B78 - lsls r0, 16 - asrs r0, 16 - movs r3, 0x88 - lsls r3, 3 - movs r1, 0x90 - movs r2, 0x78 - b _080F6016 - .pool -_080F5FC4: - cmp r0, 0x1 - bne _080F5FDC - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r0, [r0] - ldrb r0, [r0, 0x4] - cmp r0, 0 - bne _080F6048 - b _080F5FF0 - .pool -_080F5FDC: - cmp r0, 0x2 - bne _080F5FF8 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x15 - bne _080F6048 - movs r0, 0 -_080F5FF0: - strh r0, [r4, 0xA] - adds r0, r1, 0x1 - strh r0, [r4, 0x8] - b _080F6048 -_080F5FF8: - cmp r0, 0x3 - bne _080F6030 - ldr r0, =gUnknown_085ED1D0 - ldr r1, =0x0203a034 - ldr r1, [r1] - ldr r1, [r1] - ldrb r1, [r1] - bl sub_80F6B78 - lsls r0, 16 - asrs r0, 16 - ldr r2, =0x0000ffff - movs r3, 0x88 - lsls r3, 3 - movs r1, 0x90 -_080F6016: - bl sub_80F6E9C - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080F6048 - .pool -_080F6030: - cmp r0, 0x4 - bne _080F6048 - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r0, [r0] - ldrb r0, [r0, 0x4] - cmp r0, 0x2 - bne _080F6048 - movs r0, 0 - strh r0, [r4, 0x8] - ldr r0, =sub_80F6058 - str r0, [r4] -_080F6048: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F5F74 - - thumb_func_start sub_80F6058 -sub_80F6058: @ 80F6058 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080F60C0 - cmp r0, 0x1 - bgt _080F6080 - cmp r0, 0 - beq _080F6086 - b _080F60E6 - .pool -_080F6080: - cmp r0, 0x2 - beq _080F60D4 - b _080F60E6 -_080F6086: - ldr r5, =0x0203a034 - ldr r0, [r5] - ldr r0, [r0] - ldrb r0, [r0, 0xA] - cmp r0, 0 - bne _080F60E6 - ldrh r1, [r4, 0xC] - adds r0, r1, 0x1 - strh r0, [r4, 0xC] - lsls r1, 24 - lsrs r1, 24 - movs r0, 0 - bl sub_80F7A80 - ldr r0, [r5] - ldr r0, [r0] - ldrb r0, [r0, 0x14] - cmp r0, 0 - bne _080F60B8 - movs r0, 0x2 - strh r0, [r4, 0x8] - b _080F60E6 - .pool -_080F60B8: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080F60E6 -_080F60C0: - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r0, [r0] - ldrb r0, [r0, 0x14] - cmp r0, 0 - bne _080F60E6 - strh r0, [r4, 0x8] - b _080F60E6 - .pool -_080F60D4: - movs r0, 0x88 - lsls r0, 3 - bl sub_80F6EF4 - movs r0, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0xC] - ldr r0, =sub_80F60F0 - str r0, [r4] -_080F60E6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F6058 - - thumb_func_start sub_80F60F0 -sub_80F60F0: @ 80F60F0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - adds r4, r2, 0 - ldr r0, =0x0203a034 - ldr r5, [r0] - ldr r0, [r5] - ldrb r3, [r0, 0x4] - cmp r3, 0 - bne _080F614C - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0, r1 - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x15 - bne _080F615E - strh r3, [r1, 0xA] - ldr r0, =gUnknown_085ED1E9 - ldr r1, [r5] - ldrb r1, [r1] - bl sub_80F6B78 - lsls r0, 16 - asrs r0, 16 - ldr r2, =0x0000ffff - movs r3, 0x88 - lsls r3, 3 - movs r1, 0x90 - bl sub_80F6E9C - b _080F615E - .pool -_080F614C: - cmp r3, 0x2 - bne _080F615E - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80F616C - str r0, [r1] -_080F615E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F60F0 - - thumb_func_start sub_80F616C -sub_80F616C: @ 80F616C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080F61D4 - cmp r0, 0x1 - bgt _080F6194 - cmp r0, 0 - beq _080F619A - b _080F61F8 - .pool -_080F6194: - cmp r0, 0x2 - beq _080F61E8 - b _080F61F8 -_080F619A: - ldr r5, =0x0203a034 - ldr r0, [r5] - ldr r0, [r0] - ldrb r0, [r0, 0xA] - cmp r0, 0 - bne _080F61F8 - ldrh r1, [r4, 0xC] - adds r0, r1, 0x1 - strh r0, [r4, 0xC] - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x1 - bl sub_80F7A80 - ldr r0, [r5] - ldr r0, [r0] - ldrb r0, [r0, 0x14] - cmp r0, 0 - bne _080F61CC - movs r0, 0x2 - strh r0, [r4, 0x8] - b _080F61F8 - .pool -_080F61CC: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080F61F8 -_080F61D4: - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r0, [r0] - ldrb r0, [r0, 0x14] - cmp r0, 0 - bne _080F61F8 - strh r0, [r4, 0x8] - b _080F61F8 - .pool -_080F61E8: - movs r0, 0x88 - lsls r0, 3 - bl sub_80F6EF4 - movs r0, 0 - strh r0, [r4, 0x8] - ldr r0, =sub_80F6204 - str r0, [r4] -_080F61F8: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F616C - - thumb_func_start sub_80F6204 -sub_80F6204: @ 80F6204 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x64 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r2, r1, 0 - cmp r0, 0x5 - bls _080F6226 - b _080F63F4 -_080F6226: - lsls r0, 2 - ldr r1, =_080F6238 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F6238: - .4byte _080F6250 - .4byte _080F6274 - .4byte _080F6292 - .4byte _080F62CC - .4byte _080F6334 - .4byte _080F63E4 -_080F6250: - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r0, [r0] - ldrb r0, [r0, 0x4] - cmp r0, 0 - beq _080F625E - b _080F63F4 -_080F625E: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - b _080F63F4 - .pool -_080F6274: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r1, r0, r2 - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1F - beq _080F628C - b _080F63F4 -_080F628C: - movs r0, 0 - strh r0, [r1, 0xA] - b _080F63BC -_080F6292: - movs r4, 0 - lsls r6, r5, 2 - ldr r7, =0x03005e00 -_080F6298: - ldr r0, =sub_80F73DC - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r7 - ldr r0, =0x02039f20 - adds r0, r4, r0 - ldrb r0, [r0] - strh r0, [r1, 0x8] - strh r4, [r1, 0xA] - adds r4, 0x1 - cmp r4, 0x3 - ble _080F6298 - b _080F63B4 - .pool -_080F62CC: - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r0, [r0] - ldrb r0, [r0, 0x5] - cmp r0, 0x4 - beq _080F62DA - b _080F63F4 -_080F62DA: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1F - beq _080F62F2 - b _080F63F4 -_080F62F2: - movs r0, 0 - strh r0, [r4, 0xA] - ldr r0, =sub_80F74BC - movs r1, 0xA - bl CreateTask - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r4, 0 - ldr r1, =0x02039f20 - ldrb r0, [r1] - cmp r0, 0 - beq _080F631C -_080F630E: - adds r4, 0x1 - cmp r4, 0x3 - bgt _080F631C - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080F630E -_080F631C: - lsls r0, r4, 24 - lsrs r0, 24 - movs r1, 0xE - bl sub_80F77E0 - b _080F63F4 - .pool -_080F6334: - lsls r1, r5, 2 - adds r0, r1, r5 - lsls r0, 3 - adds r2, r0, r2 - ldrh r0, [r2, 0xA] - adds r0, 0x1 - strh r0, [r2, 0xA] - lsls r0, 16 - asrs r0, 16 - adds r6, r1, 0 - cmp r0, 0x15 - bne _080F63F4 - movs r0, 0 - strh r0, [r2, 0xA] - movs r4, 0 - ldr r1, =0x02039f20 - ldrb r0, [r1] - ldr r7, =0x02021cc4 - ldr r2, =0x02039e0d - mov r8, r2 - cmp r0, 0 - beq _080F636E -_080F6360: - adds r4, 0x1 - cmp r4, 0x3 - bgt _080F636E - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080F6360 -_080F636E: - lsls r4, 6 - mov r0, r8 - adds r1, r4, r0 - adds r0, r7, 0 - bl CopyString - adds r0, r7, 0 - bl sub_81DB5AC - ldr r0, =0x02021dc4 - mov r1, r8 - subs r1, 0xB - adds r4, r1 - adds r1, r4, 0 - bl CopyString - ldr r1, =gUnknown_085ED1FA - mov r0, sp - bl ExpandStringRefs - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r0, [r0] - ldrb r1, [r0] - mov r0, sp - bl sub_80F6B78 - lsls r0, 16 - asrs r0, 16 - ldr r2, =0x0000ffff - movs r3, 0x88 - lsls r3, 3 - movs r1, 0x90 - bl sub_80F6E9C -_080F63B4: - ldr r0, =0x03005e00 - adds r1, r6, r5 - lsls r1, 3 - adds r1, r0 -_080F63BC: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _080F63F4 - .pool -_080F63E4: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r2 - movs r1, 0 - strh r1, [r0, 0x8] - ldr r1, =sub_80F6404 - str r1, [r0] -_080F63F4: - add sp, 0x64 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F6204 - - thumb_func_start sub_80F6404 -sub_80F6404: @ 80F6404 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r4, r1, 0 - cmp r0, 0x5 - bls _080F6428 - b _080F669C -_080F6428: - lsls r0, 2 - ldr r1, =_080F643C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F643C: - .4byte _080F6454 - .4byte _080F658C - .4byte _080F65DC - .4byte _080F65F0 - .4byte _080F6638 - .4byte _080F667C -_080F6454: - ldr r1, =0x02022e24 - movs r0, 0xF0 - strh r0, [r1] - ldr r1, =0x02022e26 - ldr r3, =0x00005050 - adds r0, r3, 0 - strh r0, [r1] - movs r2, 0 - ldr r1, =0x02039f20 - ldrb r0, [r1] - lsls r4, r7, 2 - mov r10, r4 - ldr r3, =0x02039e00 - ldr r4, =0x02039f25 - mov r9, r4 - ldr r4, =gMonFrontPicTable - mov r12, r4 - ldr r4, =0x020244d4 - mov r8, r4 - cmp r0, 0 - beq _080F648C -_080F647E: - adds r2, 0x1 - cmp r2, 0x3 - bgt _080F648C - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080F647E -_080F648C: - lsls r1, r2, 6 - adds r0, r1, r3 - ldrh r6, [r0] - adds r0, r3, 0 - adds r0, 0x38 - adds r0, r1, r0 - ldr r4, [r0] - adds r0, r3, 0 - adds r0, 0x3C - adds r1, r0 - ldr r5, [r1] - mov r0, r9 - ldrb r0, [r0] - cmp r2, r0 - bne _080F64E0 - lsls r0, r6, 3 - add r0, r12 - mov r2, r8 - ldr r1, [r2] - ldr r1, [r1, 0x8] - adds r2, r6, 0 - adds r3, r4, 0 - bl DecompressMonPic_DetectFrontOrBack_2 - b _080F64F2 - .pool -_080F64E0: - lsls r0, r6, 3 - add r0, r12 - mov r3, r8 - ldr r1, [r3] - ldr r1, [r1, 0x8] - adds r2, r6, 0 - adds r3, r4, 0 - bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack -_080F64F2: - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_806E7CC - adds r4, r0, 0 - bl LoadCompressedObjectPalette - adds r0, r6, 0 - movs r1, 0x1 - bl sub_806A068 - ldr r0, =0x0202499c - ldrh r1, [r4, 0x4] - strh r1, [r0, 0x2] - movs r1, 0x88 - lsls r1, 1 - movs r2, 0x50 - movs r3, 0xA - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r5, =0x02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r3, r2, r5 - strh r6, [r3, 0x30] - ldrb r4, [r3, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r4 - strb r1, [r3, 0x5] - adds r5, 0x1C - adds r2, r5 - ldr r1, =sub_80F75A8 - str r1, [r2] - ldr r1, =0x0203a034 - ldr r1, [r1] - ldr r1, [r1] - strb r0, [r1, 0x8] - ldr r0, =gUnknown_0858D878 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0858D880 - bl LoadCompressedObjectPalette - ldr r0, =sub_80F7670 - movs r1, 0xA - bl CreateTask - ldr r0, =0x03005e00 - mov r4, r10 - adds r1, r4, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _080F669C - .pool -_080F658C: - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r4, r0, r4 - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - beq _080F65A4 - b _080F669C -_080F65A4: - movs r0, 0 - strh r0, [r4, 0xE] - ldrh r0, [r4, 0xC] - adds r0, 0x2 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x20 - ble _080F65BA - movs r0, 0x20 - strh r0, [r4, 0xC] -_080F65BA: - ldrb r2, [r4, 0xC] - ldr r3, =0x02022e26 - movs r0, 0x50 - subs r0, r2 - lsls r0, 8 - adds r1, r2, 0 - adds r1, 0x50 - orrs r0, r1 - strh r0, [r3] - cmp r2, 0x20 - bne _080F669C - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080F669C - .pool -_080F65DC: - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r0, [r0] - ldrb r0, [r0, 0x6] - cmp r0, 0x1 - bne _080F669C - b _080F6664 - .pool -_080F65F0: - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r3, r0, r4 - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x79 - bne _080F669C - movs r0, 0 - strh r0, [r3, 0xA] - ldr r2, =0x02020630 - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r0, [r0] - ldrb r1, [r0, 0x8] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_80F7620 - str r1, [r0] - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] - b _080F669C - .pool -_080F6638: - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r0, [r0] - ldrb r0, [r0, 0x6] - cmp r0, 0x2 - bne _080F669C - ldr r3, =0x02022e26 - ldrh r0, [r3] - lsrs r2, r0, 8 - adds r0, r2, 0x2 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x50 - bls _080F6656 - movs r2, 0x50 -_080F6656: - lsls r1, r2, 8 - movs r0, 0xA0 - subs r0, r2 - orrs r1, r0 - strh r1, [r3] - cmp r2, 0x50 - bne _080F669C -_080F6664: - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r4 - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - b _080F669C - .pool -_080F667C: - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r2, [r0] - ldrb r0, [r2, 0x6] - cmp r0, 0x2 - bne _080F669C - movs r1, 0 - movs r0, 0x1 - strb r0, [r2, 0x9] - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r4 - strh r1, [r0, 0x8] - ldr r1, =sub_80F66B4 - str r1, [r0] -_080F669C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F6404 - - thumb_func_start sub_80F66B4 -sub_80F66B4: @ 80F66B4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r2, 0x1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _080F6702 - ldr r0, =0x02039f2a - ldrb r1, [r0] - adds r0, r2, 0 - ands r0, r1 - lsls r6, r7, 2 - cmp r0, 0 - bne _080F66F2 - ldr r5, =0x02039e00 - movs r4, 0x3 -_080F66DA: - ldrh r0, [r5] - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x2 - bl pokedex_flag_operation - adds r5, 0x40 - subs r4, 0x1 - cmp r4, 0 - bge _080F66DA -_080F66F2: - ldr r1, =0x03005e00 - adds r0, r6, r7 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x1C] - ldr r1, =sub_80F671C - str r1, [r0] -_080F6702: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F66B4 - - thumb_func_start sub_80F671C -sub_80F671C: @ 80F671C - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080F6760 - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r4, r1, r0 - movs r1, 0x1C - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080F676E - ldr r0, =gUnknown_085ED207 - bl sub_80F707C - bl sub_800AC34 - ldr r0, =sub_80F677C - str r0, [r4] - b _080F676E - .pool -_080F6760: - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =task_repel - str r0, [r1] -_080F676E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F671C - - thumb_func_start sub_80F677C -sub_80F677C: @ 80F677C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _080F67AC - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080F679A - bl sub_800E084 -_080F679A: - bl sub_80F7144 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =task_repel - str r0, [r1] -_080F67AC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F677C - - thumb_func_start task_repel -task_repel: @ 80F67C4 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080F67E6 - ldr r1, =0x02039f20 - ldr r0, =0x02039f25 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - bl sub_80ED090 -_080F67E6: - movs r0, 0 - str r0, [sp] - movs r0, 0xFF - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl sub_80A27B0 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80F6820 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_repel - - thumb_func_start sub_80F6820 -sub_80F6820: @ 80F6820 - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - adds r5, r2, 0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080F68A8 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080F6868 - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r0, [r0] - ldrb r0, [r0, 0x3] - bl DestroyTask - ldr r0, =0x0000ffff - b _080F686E - .pool -_080F6868: - cmp r0, 0x1 - bne _080F6884 - ldr r0, =0xffff0000 -_080F686E: - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - b _080F68A8 - .pool -_080F6884: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - adds r0, r5, 0 - bl DestroyTask - bl FreeAllWindowBuffers - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - bl sub_80F7E64 -_080F68A8: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F6820 - - thumb_func_start sub_80F68B4 -sub_80F68B4: @ 80F68B4 - push {r4,r5,lr} - ldr r2, =0x02022e20 - ldrh r3, [r2] - adds r0, r3, 0x2 - strh r0, [r2] - ldr r4, =0x02022e22 - ldrh r5, [r4] - adds r1, r5, 0x1 - strh r1, [r4] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xFF - bls _080F68D4 - adds r0, r3, 0 - subs r0, 0xFD - strh r0, [r2] -_080F68D4: - lsls r0, r1, 16 - lsrs r0, 16 - cmp r0, 0xFF - bls _080F68E2 - adds r0, r5, 0 - subs r0, 0xFE - strh r0, [r4] -_080F68E2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F68B4 - - thumb_func_start sub_80F68F0 -sub_80F68F0: @ 80F68F0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r2, r0, r1 - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _080F6972 - movs r0, 0 - strh r0, [r2, 0x8] - movs r3, 0xC - ldrsh r0, [r2, r3] - cmp r0, 0 - bne _080F6924 - ldrh r0, [r2, 0xA] - adds r0, 0x1 - b _080F6928 - .pool -_080F6924: - ldrh r0, [r2, 0xA] - subs r0, 0x1 -_080F6928: - strh r0, [r2, 0xA] - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r1, r0, r1 - movs r2, 0xA - ldrsh r0, [r1, r2] - cmp r0, 0x10 - bne _080F693E - movs r0, 0x1 - b _080F6942 -_080F693E: - cmp r0, 0 - bne _080F6944 -_080F6942: - strh r0, [r1, 0xC] -_080F6944: - ldr r0, =0x03005e00 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - ldrb r2, [r4, 0xA] - ldr r3, =0x00002ede - movs r0, 0x6B - movs r1, 0x1 - bl pal_fade_1 - ldrb r2, [r4, 0xA] - ldr r3, =0x00007fff - movs r0, 0x68 - movs r1, 0x1 - bl pal_fade_1 - ldrb r2, [r4, 0xA] - ldr r3, =0x000077be - movs r0, 0x6E - movs r1, 0x1 - bl pal_fade_1 -_080F6972: - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r3, 0xA - ldrsh r4, [r0, r3] - cmp r4, 0 - bne _080F69A4 - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r0, [r0] - strb r4, [r0, 0xA] - b _080F69AE - .pool -_080F69A4: - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r1, [r0] - movs r0, 0x1 - strb r0, [r1, 0xA] -_080F69AE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F68F0 - - thumb_func_start sub_80F69B8 -sub_80F69B8: @ 80F69B8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - lsls r0, 16 - lsrs r7, r0, 16 - lsls r1, 24 - lsrs r4, r1, 24 - mov r8, r4 - lsls r2, 24 - lsrs r5, r2, 24 - lsls r3, 24 - lsrs r6, r3, 24 - ldr r0, =0x02039f25 - movs r2, 0 - ldrb r0, [r0] - cmp r4, r0 - bne _080F69DE - movs r2, 0x1 -_080F69DE: - adds r0, r7, 0 - ldr r1, [sp, 0x28] - bl sub_80D2EDC - adds r3, r0, 0 - lsls r0, r5, 9 - adds r0, 0x80 - adds r3, r0 - cmp r6, 0 - beq _080F6A40 - lsls r1, r4, 9 - ldr r0, =0x06004000 - adds r1, r0 - movs r2, 0xC0 - lsls r2, 1 - adds r0, r3, 0 - movs r3, 0x1 - bl RequestDma3Copy - adds r0, r4, 0 - adds r0, 0xA - lsls r0, 28 - lsls r1, r4, 20 - movs r2, 0x80 - lsls r2, 18 - adds r1, r2 - orrs r1, r0 - lsrs r1, 16 - lsls r3, r4, 1 - adds r3, r4 - adds r3, 0x4 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x4 - str r0, [sp] - movs r0, 0x3 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - str r0, [sp, 0xC] - movs r2, 0x3 - bl WriteSequenceToBgTilemapBuffer - b _080F6A54 - .pool -_080F6A40: - mov r0, r8 - lsls r1, r0, 9 - ldr r2, =0x06004000 - adds r1, r2 - movs r2, 0xC0 - lsls r2, 1 - adds r0, r3, 0 - movs r3, 0x1 - bl RequestDma3Copy -_080F6A54: - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F69B8 - - thumb_func_start sub_80F6A64 -sub_80F6A64: @ 80F6A64 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - movs r5, 0 - ldr r4, =0x02039e00 -_080F6A74: - ldrh r0, [r4] - lsls r1, r5, 24 - lsrs r1, 24 - ldr r2, [r4, 0x38] - str r2, [sp] - adds r2, r7, 0 - adds r3, r6, 0 - bl sub_80F69B8 - adds r4, 0x40 - adds r5, 0x1 - cmp r5, 0x3 - ble _080F6A74 - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F6A64 - - thumb_func_start sub_80F6A9C -sub_80F6A9C: @ 80F6A9C - push {r4-r6,lr} - movs r4, 0 - ldr r6, =gMonIconPaletteIndices - movs r5, 0xA0 - lsls r5, 16 -_080F6AA6: - ldr r1, =0x02039e00 - lsls r0, r4, 6 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0 - bl mon_icon_convert_unown_species_id - lsls r0, 16 - lsrs r0, 16 - adds r0, r6 - ldrb r0, [r0] - lsls r0, 5 - ldr r1, =gMonIconPalettes - adds r0, r1 - lsrs r1, r5, 16 - movs r2, 0x20 - bl gpu_pal_apply - movs r0, 0x80 - lsls r0, 13 - adds r5, r0 - adds r4, 0x1 - cmp r4, 0x3 - ble _080F6AA6 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F6A9C - - thumb_func_start sub_80F6AE8 -sub_80F6AE8: @ 80F6AE8 - push {r4,lr} - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080F6B58 - bl sub_800E0E8 - movs r0, 0x8 - movs r1, 0x8 - bl sub_800DFB4 - ldr r4, =0x02020630 - ldr r0, =0x02022b10 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x43 - movs r1, 0x1 - strb r1, [r0] - ldr r0, =gUnknown_0858D8E0 - bl LoadObjectPic - adds r1, r0, 0 - lsls r1, 16 - movs r0, 0x1 - negs r0, r0 - lsrs r1, 11 - ldr r2, =0x06010000 - adds r1, r2 - movs r2, 0x80 - movs r3, 0x1 - bl RequestDma3Fill - ldr r0, =gUnknown_0858D8C8 - movs r1, 0x8 - movs r2, 0x8 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r2, [r1, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - movs r2, 0x8 - orrs r0, r2 - strb r0, [r1, 0x1] -_080F6B58: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F6AE8 - - thumb_func_start sub_80F6B78 -sub_80F6B78: @ 80F6B78 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x44 - adds r5, r0, 0 - lsls r1, 24 - lsrs r7, r1, 24 - add r4, sp, 0x20 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x8 - bl memset - movs r0, 0x1E - strb r0, [r4, 0x3] - movs r0, 0x2 - strb r0, [r4, 0x4] - adds r0, r4, 0 - bl AddWindow - lsls r6, r0, 24 - lsrs r4, r6, 24 - adds r0, r4, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0 - bl GetStringWidth - adds r2, r0, 0 - adds r2, 0x9 - cmp r2, 0 - bge _080F6BC4 - adds r2, 0x7 -_080F6BC4: - asrs r2, 3 - mov r10, r2 - cmp r2, 0x1E - ble _080F6BD0 - movs r1, 0x1E - mov r10, r1 -_080F6BD0: - mov r1, r10 - lsls r2, r1, 3 - subs r2, r0 - lsrs r0, r2, 31 - adds r2, r0 - asrs r2, 1 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_0858D8E8 - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - str r5, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - adds r0, r4, 0 - movs r1, 0x7 - bl GetWindowAttribute - mov r9, r0 - ldr r2, =gUnknown_0858D6D0 - mov r8, r2 - lsls r1, r7, 4 - adds r1, r7 - lsls r1, 2 - ldr r3, =0x02020630 - adds r1, r3 - ldrh r0, [r1, 0x4] - lsls r0, 22 - lsrs r0, 17 - ldr r2, =0x06010000 - adds r0, r2 - str r0, [sp, 0xC] - str r6, [sp, 0x38] - mov r7, sp - adds r7, 0x1C - str r7, [sp, 0x2C] - mov r0, r10 - adds r0, 0x2 - str r0, [sp, 0x30] - movs r5, 0 - add r7, sp, 0x10 - mov r12, r7 - adds r6, r1, 0 - adds r6, 0x2E - movs r4, 0x2 -_080F6C34: - adds r0, r6, r5 - movs r7, 0 - ldrsh r1, [r0, r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0, 0x4] - lsls r0, 22 - lsrs r0, 17 - adds r0, r2 - mov r1, r12 - adds r1, 0x4 - mov r12, r1 - subs r1, 0x4 - stm r1!, {r0} - adds r5, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _080F6C34 - mov r7, r8 - adds r7, 0x80 - mov r2, r8 - adds r2, 0x40 - str r2, [sp, 0x28] - mov r0, r8 - adds r0, 0x20 - str r0, [sp, 0x3C] - mov r1, r8 - adds r1, 0xA0 - str r1, [sp, 0x40] - adds r2, 0x20 - str r2, [sp, 0x34] - add r5, sp, 0xC - movs r6, 0 - movs r4, 0x3 -_080F6C7C: - str r6, [sp, 0x1C] - ldm r5!, {r1} - ldr r0, [sp, 0x2C] - ldr r2, =0x05000100 - bl CpuSet - subs r4, 0x1 - cmp r4, 0 - bge _080F6C7C - ldr r5, [sp, 0xC] - ldr r6, =0x04000008 - mov r0, r8 - adds r1, r5, 0 - adds r2, r6, 0 - bl CpuSet - movs r0, 0x80 - lsls r0, 1 - adds r1, r5, r0 - adds r0, r7, 0 - adds r2, r6, 0 - bl CpuSet - movs r2, 0x80 - lsls r2, 2 - adds r1, r5, r2 - adds r0, r7, 0 - adds r2, r6, 0 - bl CpuSet - movs r7, 0xC0 - lsls r7, 2 - adds r1, r5, r7 - ldr r0, [sp, 0x28] - adds r2, r6, 0 - bl CpuSet - movs r4, 0 - cmp r4, r10 - bge _080F6D32 - adds r7, r6, 0 -_080F6CCE: - adds r6, r4, 0x1 - adds r0, r6, 0 - cmp r6, 0 - bge _080F6CDA - adds r0, r4, 0 - adds r0, 0x8 -_080F6CDA: - asrs r0, 3 - lsls r1, r0, 2 - add r1, sp - adds r1, 0xC - lsls r0, 3 - subs r0, r6, r0 - lsls r0, 5 - ldr r1, [r1] - adds r5, r1, r0 - mov r0, r8 - adds r0, 0xC0 - adds r1, r5, 0 - adds r2, r7, 0 - bl CpuSet - movs r0, 0x80 - lsls r0, 1 - adds r1, r5, r0 - mov r0, r9 - adds r2, r7, 0 - bl CpuSet - movs r0, 0xF0 - lsls r0, 2 - add r0, r9 - movs r2, 0x80 - lsls r2, 2 - adds r1, r5, r2 - adds r2, r7, 0 - bl CpuSet - movs r0, 0xC0 - lsls r0, 2 - adds r1, r5, r0 - mov r0, r8 - adds r0, 0xE0 - adds r2, r7, 0 - bl CpuSet - movs r1, 0x20 - add r9, r1 - adds r4, r6, 0 - cmp r4, r10 - blt _080F6CCE -_080F6D32: - adds r2, r4, 0x1 - adds r0, r2, 0 - cmp r2, 0 - bge _080F6D3E - adds r0, r4, 0 - adds r0, 0x8 -_080F6D3E: - asrs r0, 3 - lsls r1, r0, 2 - add r1, sp - adds r1, 0xC - lsls r0, 3 - subs r0, r2, r0 - lsls r0, 5 - ldr r1, [r1] - adds r5, r1, r0 - ldr r4, =0x04000008 - ldr r0, [sp, 0x3C] - adds r1, r5, 0 - adds r2, r4, 0 - bl CpuSet - movs r2, 0x80 - lsls r2, 1 - adds r1, r5, r2 - ldr r0, [sp, 0x40] - adds r2, r4, 0 - bl CpuSet - movs r7, 0x80 - lsls r7, 2 - adds r1, r5, r7 - ldr r0, [sp, 0x40] - adds r2, r4, 0 - bl CpuSet - movs r0, 0xC0 - lsls r0, 2 - adds r1, r5, r0 - ldr r0, [sp, 0x34] - adds r2, r4, 0 - bl CpuSet - ldr r1, [sp, 0x38] - lsrs r0, r1, 24 - bl RemoveWindow - ldr r2, [sp, 0x30] - lsls r1, r2, 3 - movs r0, 0xF0 - subs r0, r1 - asrs r0, 1 - add sp, 0x44 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80F6B78 - - thumb_func_start sub_80F6DC0 -sub_80F6DC0: @ 80F6DC0 - push {r4-r6,lr} - sub sp, 0x20 - mov r1, sp - ldr r0, =gUnknown_0858D7F8 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - add r5, sp, 0x18 - ldr r6, =gUnknown_0858D810 - movs r4, 0x7 -_080F6DD6: - adds r0, r6, 0 - bl LoadObjectPic - adds r6, 0x8 - subs r4, 0x1 - cmp r4, 0 - bge _080F6DD6 - ldr r0, =gUnknown_0858D850 - bl LoadTaggedObjectPalette - movs r4, 0 - mov r6, sp -_080F6DEE: - mov r0, sp - movs r1, 0x88 - lsls r1, 1 - movs r2, 0x90 - movs r3, 0xA - bl AddObjectToFront - adds r1, r5, r4 - strb r0, [r1] - ldrh r0, [r6] - adds r0, 0x1 - strh r0, [r6] - adds r4, 0x1 - cmp r4, 0x7 - ble _080F6DEE - ldr r2, =0x02020630 - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r5, 0x1] - movs r3, 0 - strh r1, [r0, 0x2E] - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r5, 0x2] - strh r1, [r0, 0x30] - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r5, 0x3] - strh r1, [r0, 0x32] - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r5, 0x5] - strh r1, [r0, 0x2E] - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r5, 0x6] - strh r1, [r0, 0x30] - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r5, 0x7] - strh r1, [r0, 0x32] - ldr r1, =0x0203a034 - ldr r0, [r1] - ldr r2, [r0] - ldrb r0, [r5] - strb r0, [r2] - ldr r0, [r1] - ldr r0, [r0] - strb r3, [r0, 0x4] - ldr r0, [r1] - ldr r1, [r0] - ldrb r0, [r5, 0x4] - strb r0, [r1, 0x1] - bl sub_80F7144 - add sp, 0x20 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F6DC0 - - thumb_func_start sub_80F6E9C -sub_80F6E9C: @ 80F6E9C - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r4, =0x0203a034 - ldr r4, [r4] - mov r8, r4 - ldr r4, [r4] - ldrb r5, [r4] - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - ldr r5, =0x02020630 - adds r4, r5 - movs r6, 0 - movs r5, 0x88 - lsls r5, 1 - strh r5, [r4, 0x20] - strh r1, [r4, 0x22] - strh r6, [r4, 0x24] - strh r6, [r4, 0x26] - lsls r0, 16 - asrs r0, 16 - adds r0, 0x20 - strh r0, [r4, 0x36] - strh r2, [r4, 0x38] - strh r3, [r4, 0x3A] - strh r6, [r4, 0x3C] - ldr r0, =sub_80F6F68 - str r0, [r4, 0x1C] - mov r0, r8 - ldr r1, [r0] - movs r0, 0x1 - strb r0, [r1, 0x4] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F6E9C - - thumb_func_start sub_80F6EF4 -sub_80F6EF4: @ 80F6EF4 - push {r4,r5,lr} - ldr r1, =0x0203a034 - ldr r4, [r1] - ldr r1, [r4] - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - ldr r2, =0x02020630 - adds r1, r2 - ldrh r2, [r1, 0x24] - ldrh r3, [r1, 0x20] - adds r2, r3 - movs r3, 0 - strh r2, [r1, 0x20] - ldrh r2, [r1, 0x26] - ldrh r5, [r1, 0x22] - adds r2, r5 - strh r2, [r1, 0x22] - strh r3, [r1, 0x26] - strh r3, [r1, 0x24] - strh r0, [r1, 0x3A] - strh r3, [r1, 0x3C] - ldr r0, =sub_80F7014 - str r0, [r1, 0x1C] - ldr r1, [r4] - movs r0, 0x3 - strb r0, [r1, 0x4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F6EF4 - - thumb_func_start sub_80F6F40 -sub_80F6F40: @ 80F6F40 - movs r3, 0 - movs r2, 0 - movs r1, 0x88 - lsls r1, 1 - strh r1, [r0, 0x20] - movs r1, 0x90 - strh r1, [r0, 0x22] - strh r2, [r0, 0x26] - strh r2, [r0, 0x24] - ldr r1, =DummyObjectCallback - str r1, [r0, 0x1C] - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r0, [r0] - strb r3, [r0, 0x4] - bx lr - .pool - thumb_func_end sub_80F6F40 - - thumb_func_start sub_80F6F68 -sub_80F6F68: @ 80F6F68 - push {r4-r7,lr} - adds r3, r0, 0 - ldrh r2, [r3, 0x3A] - ldrh r0, [r3, 0x3C] - adds r2, r0 - lsls r1, r2, 16 - asrs r1, 24 - ldrh r0, [r3, 0x20] - subs r0, r1 - strh r0, [r3, 0x20] - movs r1, 0xFF - ands r2, r1 - strh r2, [r3, 0x3C] - lsls r0, 16 - asrs r0, 16 - ldrh r2, [r3, 0x36] - movs r4, 0x36 - ldrsh r1, [r3, r4] - cmp r0, r1 - bge _080F6F92 - strh r2, [r3, 0x20] -_080F6F92: - movs r4, 0 - ldr r6, =0x02020630 - movs r5, 0x40 - adds r2, r3, 0 - adds r2, 0x2E -_080F6F9C: - movs r7, 0 - ldrsh r0, [r2, r7] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrh r0, [r3, 0x24] - ldrh r7, [r3, 0x20] - adds r0, r7 - adds r0, r5 - strh r0, [r1, 0x20] - adds r5, 0x40 - adds r2, 0x2 - adds r4, 0x1 - cmp r4, 0x2 - ble _080F6F9C - movs r0, 0x20 - ldrsh r1, [r3, r0] - movs r2, 0x36 - ldrsh r0, [r3, r2] - cmp r1, r0 - bne _080F6FCC - ldr r0, =sub_80F6FDC - str r0, [r3, 0x1C] -_080F6FCC: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F6F68 - - thumb_func_start sub_80F6FDC -sub_80F6FDC: @ 80F6FDC - push {lr} - adds r2, r0, 0 - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r1, [r0] - movs r0, 0x2 - strb r0, [r1, 0x4] - ldrh r3, [r2, 0x38] - ldr r1, =0xffff0000 - lsrs r0, r1, 16 - cmp r3, r0 - beq _080F7008 - subs r0, r3, 0x1 - strh r0, [r2, 0x38] - lsls r0, 16 - asrs r0, 16 - asrs r1, 16 - cmp r0, r1 - bne _080F7008 - ldrh r0, [r2, 0x3A] - bl sub_80F6EF4 -_080F7008: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F6FDC - - thumb_func_start sub_80F7014 -sub_80F7014: @ 80F7014 - push {r4-r7,lr} - adds r3, r0, 0 - ldrh r2, [r3, 0x3A] - ldrh r0, [r3, 0x3C] - adds r2, r0 - lsls r1, r2, 16 - asrs r1, 24 - ldrh r0, [r3, 0x20] - subs r0, r1 - strh r0, [r3, 0x20] - movs r0, 0xFF - ands r2, r0 - strh r2, [r3, 0x3C] - movs r4, 0 - ldr r6, =0x02020630 - movs r5, 0x40 - adds r2, r3, 0 - adds r2, 0x2E -_080F7038: - movs r1, 0 - ldrsh r0, [r2, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrh r0, [r3, 0x24] - ldrh r7, [r3, 0x20] - adds r0, r7 - adds r0, r5 - strh r0, [r1, 0x20] - adds r5, 0x40 - adds r2, 0x2 - adds r4, 0x1 - cmp r4, 0x2 - ble _080F7038 - movs r1, 0x20 - ldrsh r0, [r3, r1] - movs r2, 0x24 - ldrsh r1, [r3, r2] - adds r0, r1 - movs r1, 0xE0 - negs r1, r1 - cmp r0, r1 - bge _080F7070 - adds r0, r3, 0 - bl sub_80F6F40 -_080F7070: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F7014 - - thumb_func_start sub_80F707C -sub_80F707C: @ 80F707C - push {r4-r7,lr} - ldr r4, =0x0203a034 - ldr r1, [r4] - ldr r1, [r1] - ldrb r1, [r1, 0x1] - bl sub_80F6B78 - lsls r0, 16 - lsrs r0, 16 - ldr r1, [r4] - ldr r1, [r1] - ldrb r2, [r1, 0x1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - ldr r3, =0x02020630 - adds r4, r1, r3 - adds r0, 0x20 - strh r0, [r4, 0x20] - movs r0, 0x50 - strh r0, [r4, 0x22] - adds r5, r4, 0 - adds r5, 0x3E - ldrb r1, [r5] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r1 - strb r0, [r5] - movs r5, 0 - adds r6, r3, 0 - mov r12, r2 - movs r3, 0x40 -_080F70BE: - lsls r0, r5, 1 - adds r2, r4, 0 - adds r2, 0x2E - adds r2, r0 - movs r1, 0 - ldrsh r0, [r2, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrh r0, [r4, 0x24] - ldrh r7, [r4, 0x20] - adds r0, r7 - adds r0, r3 - strh r0, [r1, 0x20] - movs r0, 0 - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrh r1, [r4, 0x22] - strh r1, [r0, 0x22] - movs r1, 0 - ldrsh r0, [r2, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - adds r1, 0x3E - ldrb r2, [r1] - mov r0, r12 - ands r0, r2 - strb r0, [r1] - adds r3, 0x40 - adds r5, 0x1 - cmp r5, 0x2 - ble _080F70BE - ldr r1, =0x02022e24 - movs r0, 0xF0 - strh r0, [r1] - ldr r2, =0x02022e26 - ldrh r1, [r4, 0x22] - adds r0, r1, 0 - subs r0, 0x10 - lsls r0, 8 - adds r1, 0x10 - orrs r0, r1 - strh r0, [r2] - ldr r1, =0x00003f3e - movs r0, 0x48 - bl SetGpuReg - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F707C - - thumb_func_start sub_80F7144 -sub_80F7144: @ 80F7144 - push {r4-r7,lr} - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r0, [r0] - ldrb r0, [r0, 0x1] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r3, =0x02020630 - adds r2, r3 - movs r0, 0x3E - adds r0, r2 - mov r12, r0 - ldrb r0, [r0] - movs r1, 0x4 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - ldr r7, =0x02022e24 - ldr r6, =0x02022e26 - adds r5, r3, 0 - movs r4, 0x4 - adds r2, 0x2E - movs r3, 0x2 -_080F7174: - movs r1, 0 - ldrsh r0, [r2, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r1, 0x3E - ldrb r0, [r1] - orrs r0, r4 - strb r0, [r1] - adds r2, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _080F7174 - movs r0, 0 - strh r0, [r7] - strh r0, [r6] - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - ldrh r1, [r6] - movs r0, 0x44 - bl SetGpuReg - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F7144 - - thumb_func_start sub_80F71C8 -sub_80F71C8: @ 80F71C8 - push {r4-r6,lr} - sub sp, 0xC - movs r5, 0x5 - movs r4, 0x1 - ldr r0, =0x02039f2a - ldrb r1, [r0] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _080F71F8 - ldr r1, =gUnknown_08DC6498 - str r5, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r2, 0x5 - movs r3, 0x1 - bl CopyToBgTilemapBufferRect - movs r5, 0xA - b _080F7240 - .pool -_080F71F8: - ldr r0, =0x02039f2e - ldrh r2, [r0] - cmp r2, 0 - bne _080F720C - ldr r1, =gUnknown_08DC63F8 - b _080F722E - .pool -_080F720C: - cmp r2, 0x1 - bne _080F7218 - ldr r1, =gUnknown_08DC6420 - b _080F722E - .pool -_080F7218: - cmp r2, 0x2 - bne _080F722C - ldr r1, =gUnknown_08DC6448 - movs r0, 0xA - str r0, [sp] - str r2, [sp, 0x4] - movs r0, 0x2 - b _080F7236 - .pool -_080F722C: - ldr r1, =gUnknown_08DC6470 -_080F722E: - movs r0, 0xA - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] -_080F7236: - movs r2, 0x5 - movs r3, 0x1 - bl CopyToBgTilemapBufferRect - movs r5, 0xF -_080F7240: - ldr r0, =0x02039f2c - ldrh r0, [r0] - cmp r0, 0 - bne _080F725C - movs r6, 0 - ldr r1, =gUnknown_08DC64AC - b _080F7298 - .pool -_080F725C: - cmp r0, 0x1 - bne _080F726C - movs r6, 0x1 - ldr r1, =gUnknown_08DC64C0 - b _080F7298 - .pool -_080F726C: - cmp r0, 0x2 - bne _080F7290 - movs r6, 0x2 - ldr r1, =gUnknown_08DC64D4 - lsls r2, r5, 24 - lsrs r2, 24 - lsls r4, 24 - lsrs r3, r4, 24 - movs r0, 0x5 - str r0, [sp] - str r6, [sp, 0x4] - movs r0, 0x2 - bl CopyToBgTilemapBufferRect - b _080F72CC - .pool -_080F7290: - cmp r0, 0x3 - bne _080F72B4 - movs r6, 0x3 - ldr r1, =gUnknown_08DC64E8 -_080F7298: - lsls r2, r5, 24 - lsrs r2, 24 - lsls r4, 24 - lsrs r3, r4, 24 - movs r0, 0x5 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - bl CopyToBgTilemapBufferRect - b _080F72CC - .pool -_080F72B4: - movs r6, 0x4 - ldr r1, =gUnknown_08DC64FC - lsls r2, r5, 24 - lsrs r2, 24 - lsls r4, 24 - lsrs r3, r4, 24 - movs r0, 0x5 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - bl CopyToBgTilemapBufferRect -_080F72CC: - adds r5, 0x5 - ldr r1, =gUnknown_08DC6510 - lsls r2, r5, 24 - lsrs r2, 24 - lsrs r3, r4, 24 - movs r0, 0x6 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - bl CopyToBgTilemapBufferRect - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0x20 - str r0, [sp] - movs r0, 0x4 - str r0, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F71C8 - - thumb_func_start sub_80F7310 -sub_80F7310: @ 80F7310 - push {r4,r5,lr} - lsls r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - ldr r1, =0x02039f00 - lsrs r0, 23 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - lsls r4, r0, 16 - adds r0, r4, 0 - movs r1, 0x3F - bl __udivsi3 - adds r1, r0, 0 - ldr r0, =0x0000ffff - ands r0, r1 - cmp r0, 0 - beq _080F733C - movs r0, 0x80 - lsls r0, 9 - adds r1, r0 -_080F733C: - lsrs r1, 16 - cmp r1, 0 - bne _080F7348 - cmp r4, 0 - beq _080F7348 - movs r1, 0x1 -_080F7348: - cmp r5, 0 - beq _080F7352 - cmp r1, 0xA - bls _080F7352 - movs r1, 0xA -_080F7352: - lsls r0, r1, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80F7310 - - thumb_func_start sub_80F7364 -sub_80F7364: @ 80F7364 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - ldr r1, =0x02039f18 - lsls r0, r5, 1 - adds r0, r1 - movs r2, 0 - ldrsh r0, [r0, r2] - adds r7, r1, 0 - cmp r0, 0 - bge _080F7380 - negs r0, r0 -_080F7380: - lsls r4, r0, 16 - adds r0, r4, 0 - movs r1, 0x50 - bl __udivsi3 - adds r2, r0, 0 - ldr r0, =0x0000ffff - ands r0, r2 - cmp r0, 0 - beq _080F739A - movs r0, 0x80 - lsls r0, 9 - adds r2, r0 -_080F739A: - lsrs r2, 16 - cmp r2, 0 - bne _080F73A6 - cmp r4, 0 - beq _080F73A6 - movs r2, 0x1 -_080F73A6: - cmp r6, 0 - beq _080F73B0 - cmp r2, 0xA - bls _080F73B0 - movs r2, 0xA -_080F73B0: - lsls r0, r5, 1 - adds r0, r7 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _080F73CC - negs r0, r2 - lsls r0, 24 - b _080F73CE - .pool -_080F73CC: - lsls r0, r2, 24 -_080F73CE: - lsrs r0, 24 - lsls r0, 24 - asrs r0, 24 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80F7364 - - thumb_func_start sub_80F73DC -sub_80F73DC: @ 80F73DC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =0x03005e00 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r7, r0, r1 - ldrh r2, [r7, 0x1C] - movs r0, 0x1C - ldrsh r6, [r7, r0] - cmp r6, 0 - bne _080F741C - movs r1, 0x8 - ldrsh r0, [r7, r1] - movs r1, 0x3 - subs r1, r0 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - strh r0, [r7, 0x1E] - adds r0, r2, 0x1 - strh r0, [r7, 0x1C] - b _080F74A4 - .pool -_080F741C: - cmp r6, 0x1 - bne _080F74A4 - ldrh r0, [r7, 0x1E] - subs r0, 0x1 - strh r0, [r7, 0x1E] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _080F74A4 - movs r2, 0x8 - ldrsh r4, [r7, r2] - lsls r4, 17 - ldr r0, =0x50430000 - adds r4, r0 - lsrs r4, 16 - movs r1, 0xA - ldrsh r0, [r7, r1] - lsls r3, r0, 1 - adds r3, r0 - adds r3, 0x5 - lsls r3, 24 - lsrs r3, 24 - movs r2, 0x2 - mov r9, r2 - str r2, [sp] - str r6, [sp, 0x4] - movs r5, 0x11 - str r5, [sp, 0x8] - str r6, [sp, 0xC] - movs r0, 0x2 - adds r1, r4, 0 - movs r2, 0x1 - bl WriteSequenceToBgTilemapBuffer - adds r4, 0x10 - lsls r4, 16 - lsrs r4, 16 - movs r1, 0xA - ldrsh r0, [r7, r1] - lsls r3, r0, 1 - adds r3, r0 - adds r3, 0x6 - lsls r3, 24 - lsrs r3, 24 - mov r2, r9 - str r2, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - str r6, [sp, 0xC] - movs r0, 0x2 - adds r1, r4, 0 - movs r2, 0x1 - bl WriteSequenceToBgTilemapBuffer - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r1, [r0] - ldrb r0, [r1, 0x5] - adds r0, 0x1 - strb r0, [r1, 0x5] - mov r0, r8 - bl DestroyTask - movs r0, 0x18 - bl audio_play -_080F74A4: - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F73DC - - thumb_func_start sub_80F74BC -sub_80F74BC: @ 80F74BC - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r1, =0x02039f20 - ldrb r0, [r1] - ldr r6, =0x0203a034 - cmp r0, 0 - beq _080F74DE -_080F74D0: - adds r4, 0x1 - cmp r4, 0x3 - bgt _080F74DE - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080F74D0 -_080F74DE: - ldr r1, [r6] - lsls r3, r4, 1 - adds r3, r4 - lsls r0, r3, 6 - movs r2, 0x80 - lsls r2, 1 - adds r0, r2 - ldr r1, [r1, 0x14] - adds r1, r0 - adds r3, 0x4 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x20 - str r0, [sp] - movs r0, 0x3 - str r0, [sp, 0x4] - movs r0, 0x9 - str r0, [sp, 0x8] - movs r0, 0x2 - movs r2, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - strh r4, [r0, 0x1C] - movs r1, 0x1 - strh r1, [r0, 0x20] - ldr r1, =sub_80F753C - str r1, [r0] - ldr r0, [r6] - ldr r0, [r0] - strb r5, [r0, 0x3] - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F74BC - - thumb_func_start sub_80F753C -sub_80F753C: @ 80F753C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0x1E] - adds r0, 0x1 - strh r0, [r4, 0x1E] - lsls r0, 16 - asrs r5, r0, 16 - cmp r5, 0x1 - bne _080F75A0 - movs r0, 0 - strh r0, [r4, 0x1E] - ldrh r2, [r4, 0x20] - lsls r2, 24 - lsrs r2, 24 - ldr r3, =0x00006f8d - movs r0, 0x91 - movs r1, 0x1 - bl pal_fade_1 - movs r1, 0x22 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080F7590 - ldrh r0, [r4, 0x20] - adds r0, 0x1 - strh r0, [r4, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - bne _080F75A0 - strh r5, [r4, 0x22] - b _080F75A0 - .pool -_080F7590: - ldrh r0, [r4, 0x20] - subs r0, 0x1 - strh r0, [r4, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bne _080F75A0 - strh r0, [r4, 0x22] -_080F75A0: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80F753C - - thumb_func_start sub_80F75A8 -sub_80F75A8: @ 80F75A8 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x2E] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0x9 - bgt _080F75D0 - adds r0, r1, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bne _080F7610 - ldrh r0, [r4, 0x30] - movs r1, 0 - bl cry_related - movs r0, 0 - strh r0, [r4, 0x30] - b _080F7610 -_080F75D0: - movs r0, 0xC0 - lsls r0, 3 - adds r2, r0, 0 - ldrh r1, [r4, 0x30] - adds r2, r1 - lsls r1, r2, 16 - asrs r1, 24 - ldrh r0, [r4, 0x20] - subs r0, r1 - strh r0, [r4, 0x20] - movs r1, 0xFF - ands r2, r1 - strh r2, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x77 - bgt _080F75F6 - movs r0, 0x78 - strh r0, [r4, 0x20] -_080F75F6: - movs r2, 0x20 - ldrsh r0, [r4, r2] - cmp r0, 0x78 - bne _080F7610 - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x30] - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r1, [r0] - movs r0, 0x1 - strb r0, [r1, 0x6] -_080F7610: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F75A8 - - thumb_func_start sub_80F7620 -sub_80F7620: @ 80F7620 - push {lr} - adds r3, r0, 0 - movs r0, 0xC0 - lsls r0, 3 - adds r2, r0, 0 - ldrh r0, [r3, 0x30] - adds r2, r0 - lsls r1, r2, 16 - asrs r1, 24 - ldrh r0, [r3, 0x20] - subs r0, r1 - strh r0, [r3, 0x20] - movs r1, 0xFF - ands r2, r1 - strh r2, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - bge _080F7664 - ldr r0, =DummyObjectCallback - str r0, [r3, 0x1C] - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r1, [r0] - movs r0, 0x2 - strb r0, [r1, 0x6] -_080F7664: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F7620 - - thumb_func_start sub_80F7670 -sub_80F7670: @ 80F7670 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r1, r0, r1 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _080F7732 - movs r0, 0 - strh r0, [r1, 0x8] - ldr r0, =0x0203a034 - mov r8, r0 - ldr r0, [r0] - ldr r0, [r0] - ldrb r0, [r0, 0x7] - cmp r0, 0x27 - bhi _080F7732 - ldr r4, =gUnknown_0858D860 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF0 - bl __umodsi3 - adds r1, r0, 0 - subs r1, 0x14 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - movs r2, 0x2C - movs r3, 0x5 - bl AddObjectToFront - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl GenerateRandomNumber - ldr r1, =0x02020630 - lsls r5, r4, 4 - adds r5, r4 - lsls r5, 2 - adds r5, r1 - lsls r0, 23 - lsrs r0, 23 - strh r0, [r5, 0x2E] - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x18 - bl __umodsi3 - adds r0, 0x10 - strh r0, [r5, 0x30] - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xFF - ands r0, r1 - adds r0, 0x30 - strh r0, [r5, 0x32] - bl GenerateRandomNumber - ldrh r6, [r5, 0x4] - lsls r4, r6, 22 - lsrs r4, 22 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x11 - bl __umodsi3 - adds r4, r0 - ldr r1, =0x000003ff - adds r0, r1, 0 - ands r4, r0 - ldr r0, =0xfffffc00 - ands r0, r6 - orrs r0, r4 - strh r0, [r5, 0x4] - mov r1, r8 - ldr r0, [r1] - ldr r1, [r0] - ldrb r0, [r1, 0x7] - adds r0, 0x1 - strb r0, [r1, 0x7] -_080F7732: - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r0, [r0] - ldrb r0, [r0, 0x9] - cmp r0, 0 - beq _080F7744 - adds r0, r7, 0 - bl DestroyTask -_080F7744: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F7670 - - thumb_func_start sub_80F7768 -sub_80F7768: @ 80F7768 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - ldrh r1, [r4, 0x34] - adds r0, r1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 24 - movs r2, 0x30 - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x24] - ldrh r1, [r4, 0x32] - ldrh r0, [r4, 0x36] - adds r1, r0 - lsls r0, r1, 16 - asrs r0, 24 - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - movs r0, 0xFF - ands r1, r0 - strh r1, [r4, 0x36] - ldrh r0, [r4, 0x22] - adds r0, 0x1 - strh r0, [r4, 0x22] - ldr r5, =0x0203a034 - ldr r0, [r5] - ldr r0, [r0] - ldrb r0, [r0, 0x9] - cmp r0, 0 - beq _080F77B6 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_080F77B6: - movs r1, 0x20 - ldrsh r0, [r4, r1] - cmp r0, 0xF8 - bgt _080F77C6 - movs r2, 0x22 - ldrsh r0, [r4, r2] - cmp r0, 0x74 - ble _080F77D6 -_080F77C6: - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - ldr r0, [r5] - ldr r1, [r0] - ldrb r0, [r1, 0x7] - subs r0, 0x1 - strb r0, [r1, 0x7] -_080F77D6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F7768 - - thumb_func_start sub_80F77E0 -sub_80F77E0: @ 80F77E0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =sub_80F7824 - movs r1, 0x8 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - strh r5, [r1, 0xA] - ldr r0, =0x02039e00 - lsls r4, 6 - adds r4, r0 - ldrh r0, [r4] - strh r0, [r1, 0xC] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F77E0 - - thumb_func_start sub_80F7824 -sub_80F7824: @ 80F7824 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrb r5, [r4, 0x8] - ldrh r0, [r4, 0x1C] - adds r1, r0, 0x1 - strh r1, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - movs r2, 0xA - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _080F786E - movs r0, 0 - strh r0, [r4, 0x1C] - ldrh r0, [r4, 0xC] - ldrb r2, [r4, 0x1E] - ldr r1, =0x02039e00 - lsls r3, r5, 6 - adds r1, 0x38 - adds r3, r1 - ldr r1, [r3] - str r1, [sp] - adds r1, r5, 0 - movs r3, 0 - bl sub_80F69B8 - ldrh r0, [r4, 0x1E] - movs r1, 0x1 - eors r0, r1 - strh r0, [r4, 0x1E] -_080F786E: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F7824 - - thumb_func_start sub_80F7880 -sub_80F7880: @ 80F7880 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r0, =0x02039f08 - ldrh r2, [r0] - adds r4, r0, 0 - adds r3, r4, 0x2 - movs r0, 0x2 - mov r8, r0 -_080F7898: - lsls r0, r2, 16 - asrs r0, 16 - movs r5, 0 - ldrsh r1, [r3, r5] - cmp r0, r1 - bge _080F78A6 - ldrh r2, [r3] -_080F78A6: - adds r3, 0x2 - movs r0, 0x1 - negs r0, r0 - add r8, r0 - mov r1, r8 - cmp r1, 0 - bge _080F7898 - lsls r0, r2, 16 - str r0, [sp] - cmp r0, 0 - bge _080F78E4 - ldrh r2, [r4] - adds r3, r4, 0x2 - movs r4, 0x2 - mov r8, r4 -_080F78C4: - lsls r0, r2, 16 - asrs r0, 16 - movs r5, 0 - ldrsh r1, [r3, r5] - cmp r0, r1 - ble _080F78D2 - ldrh r2, [r3] -_080F78D2: - adds r3, 0x2 - movs r0, 0x1 - negs r0, r0 - add r8, r0 - lsls r1, r2, 16 - str r1, [sp] - mov r4, r8 - cmp r4, 0 - bge _080F78C4 -_080F78E4: - movs r5, 0 - mov r8, r5 - mov r10, r5 -_080F78EA: - ldr r0, =0x02039f00 - mov r1, r8 - lsls r7, r1, 1 - adds r0, r7, r0 - movs r2, 0 - ldrsh r1, [r0, r2] - lsls r0, r1, 5 - subs r0, r1 - lsls r0, 2 - adds r0, r1 - lsls r0, 3 - ldr r4, [sp] - asrs r5, r4, 16 - adds r1, r5, 0 - cmp r5, 0 - bge _080F790C - negs r1, r5 -_080F790C: - bl __divsi3 - adds r4, r0, 0 - movs r1, 0xA - bl __modsi3 - cmp r0, 0x4 - ble _080F791E - adds r4, 0xA -_080F791E: - ldr r0, =0x0203a034 - mov r9, r0 - ldr r0, [r0] - ldr r0, [r0, 0x4] - mov r1, r10 - adds r6, r1, r0 - adds r0, r4, 0 - movs r1, 0xA - bl __divsi3 - str r0, [r6] - ldr r0, =0x02039f18 - adds r7, r0 - movs r2, 0 - ldrsh r1, [r7, r2] - cmp r1, 0 - bge _080F7942 - negs r1, r1 -_080F7942: - lsls r0, r1, 5 - subs r0, r1 - lsls r0, 2 - adds r0, r1 - lsls r0, 3 - adds r1, r5, 0 - cmp r1, 0 - bge _080F7954 - negs r1, r1 -_080F7954: - bl __divsi3 - adds r4, r0, 0 - movs r1, 0xA - bl __modsi3 - cmp r0, 0x4 - ble _080F7966 - adds r4, 0xA -_080F7966: - adds r0, r4, 0 - movs r1, 0xA - bl __divsi3 - str r0, [r6, 0x4] - movs r4, 0 - ldrsh r0, [r7, r4] - cmp r0, 0 - bge _080F797C - movs r0, 0x1 - strb r0, [r6, 0x10] -_080F797C: - mov r5, r9 - ldr r0, [r5] - ldr r0, [r0, 0x4] - mov r1, r10 - adds r4, r1, r0 - ldr r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - subs r0, r1 - lsls r0, 11 - movs r1, 0x64 - bl __divsi3 - adds r1, r0, 0 - movs r5, 0xFF - ands r0, r5 - cmp r0, 0x7F - bls _080F79A8 - movs r2, 0x80 - lsls r2, 1 - adds r1, r2 -_080F79A8: - lsrs r0, r1, 8 - str r0, [r4, 0x8] - ldr r1, [r4, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - subs r0, r1 - lsls r0, 11 - movs r1, 0x64 - bl __divsi3 - adds r1, r0, 0 - ands r0, r5 - cmp r0, 0x7F - bls _080F79CC - movs r5, 0x80 - lsls r5, 1 - adds r1, r5 -_080F79CC: - lsrs r0, r1, 8 - str r0, [r4, 0xC] - mov r0, r8 - lsls r4, r0, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80F7310 - mov r2, r9 - ldr r1, [r2] - ldr r1, [r1, 0x4] - add r1, r10 - strb r0, [r1, 0x11] - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80F7364 - mov r4, r9 - ldr r1, [r4] - ldr r1, [r1, 0x4] - add r1, r10 - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - bge _080F7A02 - negs r0, r0 -_080F7A02: - strb r0, [r1, 0x12] - ldr r0, =0x02039f20 - add r0, r8 - ldrb r0, [r0] - cmp r0, 0 - beq _080F7A60 - mov r5, r9 - ldr r0, [r5] - ldr r0, [r0, 0x4] - mov r2, r10 - adds r1, r2, r0 - ldr r5, [r1, 0x8] - ldrh r3, [r1, 0x8] - ldr r4, [r1, 0xC] - ldrh r2, [r1, 0xC] - ldrb r0, [r1, 0x10] - cmp r0, 0 - beq _080F7A2C - lsls r0, r2, 16 - negs r0, r0 - lsrs r2, r0, 16 -_080F7A2C: - lsls r0, r3, 16 - asrs r3, r0, 16 - lsls r0, r2, 16 - asrs r2, r0, 16 - adds r0, r3, r2 - cmp r0, 0x58 - bne _080F7A60 - cmp r2, 0 - ble _080F7A58 - subs r0, r4, 0x1 - str r0, [r1, 0xC] - b _080F7A60 - .pool -_080F7A58: - cmp r3, 0 - ble _080F7A60 - subs r0, r5, 0x1 - str r0, [r1, 0x8] -_080F7A60: - movs r4, 0x14 - add r10, r4 - movs r5, 0x1 - add r8, r5 - mov r0, r8 - cmp r0, 0x3 - bgt _080F7A70 - b _080F78EA -_080F7A70: - 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_80F7880 - - thumb_func_start sub_80F7A80 -sub_80F7A80: @ 80F7A80 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - lsls r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - movs r1, 0 - str r1, [sp, 0x8] - movs r3, 0 - str r3, [sp, 0xC] - cmp r0, 0 - bne _080F7B5C - mov r9, r3 - ldr r4, =0x0203a034 - mov r10, r4 - movs r7, 0xA0 - lsls r7, 19 - movs r6, 0 -_080F7AAC: - mov r1, r10 - ldr r0, [r1] - ldr r0, [r0, 0x4] - adds r0, r6, r0 - ldrb r2, [r0, 0x11] - cmp r8, r2 - bcs _080F7B2E - adds r2, 0x13 - mov r3, r8 - subs r2, r3 - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - lsrs r3, r7, 24 - movs r0, 0x1 - str r0, [sp] - str r0, [sp, 0x4] - ldr r1, =0x000060b3 - bl FillBgTilemapBufferRect_Palette0 - ldr r0, =sub_80F7CA8 - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r5, r0, 24 - mov r0, r10 - ldr r4, [r0] - ldr r1, [r4, 0x4] - adds r1, r6, r1 - ldr r0, [r1, 0x8] - lsls r0, 16 - ldrb r1, [r1, 0x11] - bl __udivsi3 - mov r1, r8 - adds r1, 0x1 - adds r3, r0, 0 - muls r3, r1 - ldr r0, =0x0000ffff - ands r0, r3 - ldr r1, =0x00007fff - cmp r0, r1 - bls _080F7B0A - movs r1, 0x80 - lsls r1, 9 - adds r3, r1 -_080F7B0A: - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - mov r1, r9 - strh r1, [r0, 0x8] - lsrs r1, r3, 16 - strh r1, [r0, 0xA] - ldr r1, [r4] - ldrb r0, [r1, 0x14] - adds r0, 0x1 - strb r0, [r1, 0x14] - ldr r0, [sp, 0x8] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] -_080F7B2E: - movs r3, 0xC0 - lsls r3, 18 - adds r7, r3 - adds r6, 0x14 - movs r4, 0x1 - add r9, r4 - mov r0, r9 - cmp r0, 0x3 - ble _080F7AAC - b _080F7C7E - .pool -_080F7B5C: - movs r1, 0 - mov r9, r1 - mov r10, r1 - movs r3, 0xC0 - lsls r3, 19 - str r3, [sp, 0x10] -_080F7B68: - ldr r4, =0x0203a034 - ldr r0, [r4] - ldr r0, [r0, 0x4] - add r0, r10 - ldrb r2, [r0, 0x12] - ldrb r0, [r0, 0x10] - ldr r1, =0x000060a3 - cmp r0, 0 - beq _080F7B7C - adds r1, 0x2 -_080F7B7C: - lsls r0, r2, 24 - asrs r0, 24 - cmp r8, r0 - bge _080F7C64 - mov r3, r8 - lsls r2, r3, 24 - asrs r2, 24 - subs r2, 0x13 - subs r2, r0, r2 - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldr r4, [sp, 0x10] - lsrs r3, r4, 24 - movs r7, 0x1 - str r7, [sp] - str r7, [sp, 0x4] - movs r0, 0x1 - bl FillBgTilemapBufferRect_Palette0 - ldr r0, =sub_80F7CA8 - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x0203a034 - ldr r6, [r0] - ldr r1, [r6, 0x4] - add r1, r10 - ldr r0, [r1, 0xC] - lsls r0, 16 - ldrb r1, [r1, 0x12] - bl __udivsi3 - mov r1, r8 - adds r1, 0x1 - adds r3, r0, 0 - muls r3, r1 - ldr r0, =0x0000ffff - ands r0, r3 - ldr r1, =0x00007fff - cmp r0, r1 - bls _080F7BDA - movs r1, 0x80 - lsls r1, 9 - adds r3, r1 -_080F7BDA: - ldr r1, =0x03005e00 - lsls r2, r5, 2 - adds r0, r2, r5 - lsls r0, 3 - adds r4, r0, r1 - mov r0, r9 - strh r0, [r4, 0x8] - ldr r0, [r6, 0x4] - add r0, r10 - ldrb r0, [r0, 0x10] - adds r6, r1, 0 - cmp r0, 0 - beq _080F7C1C - strh r7, [r4, 0xC] - ldr r0, [sp, 0xC] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0xC] - b _080F7C26 - .pool -_080F7C1C: - ldr r0, [sp, 0x8] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] -_080F7C26: - ldr r1, =0x0203a034 - ldr r0, [r1] - ldr r0, [r0, 0x4] - mov r4, r10 - adds r1, r4, r0 - ldrb r0, [r1, 0x10] - ldr r4, =0x0203a034 - cmp r0, 0 - beq _080F7C4C - adds r0, r2, r5 - lsls r0, 3 - adds r0, r6 - lsrs r2, r3, 16 - ldr r1, [r1, 0x8] - subs r1, r2 - b _080F7C58 - .pool -_080F7C4C: - adds r0, r2, r5 - lsls r0, 3 - adds r0, r6 - lsrs r2, r3, 16 - ldr r1, [r1, 0x8] - adds r1, r2 -_080F7C58: - strh r1, [r0, 0xA] - ldr r0, [r4] - ldr r1, [r0] - ldrb r0, [r1, 0x14] - adds r0, 0x1 - strb r0, [r1, 0x14] -_080F7C64: - movs r0, 0x14 - add r10, r0 - ldr r1, [sp, 0x10] - movs r3, 0xC0 - lsls r3, 18 - adds r1, r3 - str r1, [sp, 0x10] - movs r4, 0x1 - add r9, r4 - mov r0, r9 - cmp r0, 0x3 - bgt _080F7C7E - b _080F7B68 -_080F7C7E: - ldr r1, [sp, 0xC] - cmp r1, 0 - beq _080F7C8A - movs r0, 0x16 - bl audio_play -_080F7C8A: - ldr r3, [sp, 0x8] - cmp r3, 0 - beq _080F7C96 - movs r0, 0x15 - bl audio_play -_080F7C96: - 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_80F7A80 - - thumb_func_start sub_80F7CA8 -sub_80F7CA8: @ 80F7CA8 - 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 - movs r4, 0 - mov r9, r4 - ldr r1, =0x03005e00 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrb r6, [r0, 0x8] - ldrh r7, [r0, 0xA] - ldrh r1, [r0, 0xC] - mov r12, r1 - movs r2, 0xC - ldrsh r0, [r0, r2] - cmp r0, 0 - beq _080F7CF8 - ldr r2, =0x0203a034 - ldr r0, [r2] - ldr r0, [r0] - lsls r1, r6, 1 - adds r0, 0xC - adds r0, r1 - movs r3, 0 - ldrsh r0, [r0, r3] - adds r5, r1, 0 - cmp r0, 0 - bgt _080F7D10 - b _080F7D0E - .pool -_080F7CF8: - ldr r2, =0x0203a034 - ldr r0, [r2] - ldr r0, [r0] - lsls r1, r6, 1 - adds r0, 0xC - adds r0, r1 - movs r3, 0 - ldrsh r0, [r0, r3] - adds r5, r1, 0 - cmp r0, 0x57 - ble _080F7D10 -_080F7D0E: - movs r4, 0x1 -_080F7D10: - ldr r0, [r2] - ldr r0, [r0] - adds r0, 0xC - adds r2, r0, r5 - ldrh r3, [r2] - movs r0, 0 - ldrsh r1, [r2, r0] - lsls r0, r7, 16 - asrs r0, 16 - cmp r1, r0 - bne _080F7D2A - movs r1, 0x1 - mov r9, r1 -_080F7D2A: - mov r0, r9 - cmp r0, 0 - bne _080F7D4A - cmp r4, 0 - beq _080F7D3C - strh r7, [r2] - b _080F7D4A - .pool -_080F7D3C: - mov r1, r12 - cmp r1, 0 - beq _080F7D46 - subs r0, r3, 0x1 - b _080F7D48 -_080F7D46: - adds r0, r3, 0x1 -_080F7D48: - strh r0, [r2] -_080F7D4A: - cmp r4, 0 - bne _080F7DC4 - mov r2, r9 - cmp r2, 0 - bne _080F7DCA - movs r2, 0 -_080F7D56: - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r0, [r0] - adds r0, 0xC - adds r0, r5 - movs r1, 0 - ldrsh r3, [r0, r1] - adds r0, r2, 0x1 - lsls r1, r0, 3 - adds r4, r0, 0 - cmp r3, r1 - blt _080F7D78 - movs r0, 0x8 - b _080F7D94 - .pool -_080F7D78: - lsls r0, r2, 3 - cmp r3, r0 - blt _080F7D92 - adds r0, r3, 0 - cmp r3, 0 - bge _080F7D86 - adds r0, r3, 0x7 -_080F7D86: - asrs r0, 3 - lsls r0, 3 - subs r0, r3, r0 - lsls r0, 24 - lsrs r0, 24 - b _080F7D94 -_080F7D92: - movs r0, 0 -_080F7D94: - cmp r0, 0x3 - bhi _080F7DA0 - ldr r3, =0x0000504c - b _080F7DA2 - .pool -_080F7DA0: - ldr r3, =0x00005057 -_080F7DA2: - adds r1, r0, r3 - adds r2, 0x7 - lsls r2, 24 - lsrs r2, 24 - adds r3, r5, r6 - adds r3, 0x6 - lsls r3, 24 - movs r0, 0x1 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x2 - lsrs r3, 24 - bl FillBgTilemapBufferRect_Palette0 - adds r2, r4, 0 - cmp r2, 0xA - ble _080F7D56 -_080F7DC4: - mov r0, r9 - cmp r0, 0 - beq _080F7DDC -_080F7DCA: - ldr r0, =0x0203a034 - ldr r0, [r0] - ldr r1, [r0] - ldrb r0, [r1, 0x14] - subs r0, 0x1 - strb r0, [r1, 0x14] - mov r0, r8 - bl DestroyTask -_080F7DDC: - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F7CA8 - - thumb_func_start sub_80F7DF4 -sub_80F7DF4: @ 80F7DF4 - push {r4,r5,lr} - ldr r4, =0x0203a034 - movs r0, 0x20 - bl AllocZeroed - str r0, [r4] - movs r0, 0x18 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1] - movs r0, 0x50 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x4] - movs r5, 0x80 - lsls r5, 4 - adds r0, r5, 0 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x8] - adds r0, r5, 0 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0xC] - adds r0, r5, 0 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x10] - adds r0, r5, 0 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x14] - adds r0, r5, 0 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x18] - movs r0, 0x80 - lsls r0, 5 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x1C] - bl init_uns_table_pokemon_copy - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F7DF4 - - thumb_func_start sub_80F7E64 -sub_80F7E64: @ 80F7E64 - push {r4,r5,lr} - ldr r5, =0x0203a034 - ldr r0, [r5] - ldr r0, [r0] - bl Free - ldr r0, [r5] - movs r4, 0 - str r4, [r0] - ldr r0, [r0, 0x4] - bl Free - ldr r0, [r5] - str r4, [r0, 0x4] - ldr r0, [r0, 0x8] - bl Free - ldr r0, [r5] - str r4, [r0, 0x8] - ldr r0, [r0, 0xC] - bl Free - ldr r0, [r5] - str r4, [r0, 0xC] - ldr r0, [r0, 0x10] - bl Free - ldr r0, [r5] - str r4, [r0, 0x10] - ldr r0, [r0, 0x14] - bl Free - ldr r0, [r5] - str r4, [r0, 0x14] - ldr r0, [r0, 0x18] - bl Free - ldr r0, [r5] - str r4, [r0, 0x18] - ldr r0, [r0, 0x1C] - bl Free - ldr r0, [r5] - str r4, [r0, 0x1C] - bl Free - str r4, [r5] - bl sub_805F094 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F7E64 - - thumb_func_start sub_80F7ED0 -sub_80F7ED0: @ 80F7ED0 - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - str r1, [sp] - mov r0, sp - movs r3, 0 - strb r4, [r0, 0x4] - mov r1, sp - movs r0, 0x7 - strb r0, [r1, 0x5] - mov r0, sp - strb r2, [r0, 0x6] - movs r1, 0x2 - 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, 0x12 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0xC] - mov r2, sp - movs r0, 0x10 - strb r0, [r2, 0xC] - ldrb r0, [r2, 0xD] - ands r1, r0 - strb r1, [r2, 0xD] - mov r1, sp - movs r0, 0x80 - strb r0, [r1, 0xD] - mov r0, sp - movs r1, 0 - movs r2, 0 - bl AddTextPrinter - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl PutWindowTilemap - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80F7ED0 - - thumb_func_start sub_80F7F30 -sub_80F7F30: @ 80F7F30 - push {r4,r5,lr} - ldr r0, =0x02039f24 - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - bl sub_80DAE0C - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - cmp r5, 0 - beq _080F7F5E - ldr r4, =0x02039f2c - ldrb r0, [r4] - ldr r1, =0x02039f2e - ldrb r1, [r1] - bl sub_80DAB8C - ldrb r0, [r4] - bl sub_80DB09C -_080F7F5E: - ldr r0, =0x020375f0 - strh r5, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F7F30 - - thumb_func_start sub_80F7F7C -sub_80F7F7C: @ 80F7F7C - push {r4,lr} - movs r4, 0 - ldr r0, =0x02039f24 - ldrb r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r2, r1, r0 - ldr r0, =0x02039f2c - ldrh r0, [r0] - cmp r0, 0x4 - bhi _080F7FEE - lsls r0, 2 - ldr r1, =_080F7FB0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F7FB0: - .4byte _080F7FC4 - .4byte _080F7FCA - .4byte _080F7FD0 - .4byte _080F7FD6 - .4byte _080F7FDC -_080F7FC4: - adds r0, r2, 0 - movs r1, 0x32 - b _080F7FE0 -_080F7FCA: - adds r0, r2, 0 - movs r1, 0x33 - b _080F7FE0 -_080F7FD0: - adds r0, r2, 0 - movs r1, 0x34 - b _080F7FE0 -_080F7FD6: - adds r0, r2, 0 - movs r1, 0x35 - b _080F7FE0 -_080F7FDC: - adds r0, r2, 0 - movs r1, 0x36 -_080F7FE0: - bl pokemon_getattr - ldr r1, =0x02039f2e - ldrh r1, [r1] - cmp r0, r1 - bls _080F7FEE - movs r4, 0x1 -_080F7FEE: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80F7F7C - - thumb_func_start sub_80F7FFC -sub_80F7FFC: @ 80F7FFC - push {r4-r7,lr} - sub sp, 0x4 - ldr r1, =0x02039f20 - ldr r0, =0x02039f25 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080F8010 - b _080F8250 -_080F8010: - ldr r0, =0x02039f2c - ldrh r0, [r0] - cmp r0, 0x4 - bls _080F801A - b _080F8250 -_080F801A: - lsls r0, 2 - ldr r1, =_080F8034 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F8034: - .4byte _080F8048 - .4byte _080F80B8 - .4byte _080F8124 - .4byte _080F8190 - .4byte _080F81F8 -_080F8048: - ldr r6, =0x02039f24 - ldrb r0, [r6] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - movs r1, 0x32 - bl pokemon_getattr - lsls r0, 24 - lsrs r1, r0, 24 - mov r0, sp - strb r1, [r0] - ldr r0, =0x02039f2e - ldrh r0, [r0] - cmp r1, r0 - bls _080F806C - b _080F8250 -_080F806C: - adds r0, r1, 0 - cmp r0, 0x3 - bls _080F8074 - b _080F8250 -_080F8074: - adds r1, r0, 0x1 - mov r0, sp - strb r1, [r0] - ldrb r0, [r6] - muls r0, r5 - adds r0, r4 - movs r1, 0x32 - mov r2, sp - bl pokemon_setattr - ldrb r0, [r6] - muls r0, r5 - adds r0, r4 - bl sub_80EE5A4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bhi _080F809C - b _080F8250 -_080F809C: - ldrb r0, [r6] - muls r0, r5 - adds r0, r4 - movs r1, 0x32 - bl sub_80EE4DC - b _080F8250 - .pool -_080F80B8: - mov r4, sp - ldr r7, =0x02039f24 - ldrb r0, [r7] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - movs r1, 0x33 - bl pokemon_getattr - strb r0, [r4] - mov r0, sp - ldrb r2, [r0] - ldr r0, =0x02039f2e - ldrh r0, [r0] - cmp r2, r0 - bls _080F80DC - b _080F8250 -_080F80DC: - cmp r2, 0x3 - bls _080F80E2 - b _080F8250 -_080F80E2: - mov r1, sp - adds r0, r2, 0x1 - strb r0, [r1] - ldrb r0, [r7] - muls r0, r6 - adds r0, r5 - movs r1, 0x33 - mov r2, sp - bl pokemon_setattr - ldrb r0, [r7] - muls r0, r6 - adds r0, r5 - bl sub_80EE5A4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bhi _080F810A - b _080F8250 -_080F810A: - ldrb r0, [r7] - muls r0, r6 - adds r0, r5 - movs r1, 0x33 - bl sub_80EE4DC - b _080F8250 - .pool -_080F8124: - mov r4, sp - ldr r7, =0x02039f24 - ldrb r0, [r7] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - movs r1, 0x34 - bl pokemon_getattr - strb r0, [r4] - mov r0, sp - ldrb r2, [r0] - ldr r0, =0x02039f2e - ldrh r0, [r0] - cmp r2, r0 - bls _080F8148 - b _080F8250 -_080F8148: - cmp r2, 0x3 - bls _080F814E - b _080F8250 -_080F814E: - mov r1, sp - adds r0, r2, 0x1 - strb r0, [r1] - ldrb r0, [r7] - muls r0, r6 - adds r0, r5 - movs r1, 0x34 - mov r2, sp - bl pokemon_setattr - ldrb r0, [r7] - muls r0, r6 - adds r0, r5 - bl sub_80EE5A4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bls _080F8250 - ldrb r0, [r7] - muls r0, r6 - adds r0, r5 - movs r1, 0x34 - bl sub_80EE4DC - b _080F8250 - .pool -_080F8190: - mov r4, sp - ldr r7, =0x02039f24 - ldrb r0, [r7] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - movs r1, 0x35 - bl pokemon_getattr - strb r0, [r4] - mov r0, sp - ldrb r2, [r0] - ldr r0, =0x02039f2e - ldrh r0, [r0] - cmp r2, r0 - bhi _080F8250 - cmp r2, 0x3 - bhi _080F8250 - mov r1, sp - adds r0, r2, 0x1 - strb r0, [r1] - ldrb r0, [r7] - muls r0, r6 - adds r0, r5 - movs r1, 0x35 - mov r2, sp - bl pokemon_setattr - ldrb r0, [r7] - muls r0, r6 - adds r0, r5 - bl sub_80EE5A4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bls _080F8250 - ldrb r0, [r7] - muls r0, r6 - adds r0, r5 - movs r1, 0x35 - bl sub_80EE4DC - b _080F8250 - .pool -_080F81F8: - mov r4, sp - ldr r7, =0x02039f24 - ldrb r0, [r7] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - movs r1, 0x36 - bl pokemon_getattr - strb r0, [r4] - mov r0, sp - ldrb r2, [r0] - ldr r0, =0x02039f2e - ldrh r0, [r0] - cmp r2, r0 - bhi _080F8250 - cmp r2, 0x3 - bhi _080F8250 - mov r1, sp - adds r0, r2, 0x1 - strb r0, [r1] - ldrb r0, [r7] - muls r0, r6 - adds r0, r5 - movs r1, 0x36 - mov r2, sp - bl pokemon_setattr - ldrb r0, [r7] - muls r0, r6 - adds r0, r5 - bl sub_80EE5A4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bls _080F8250 - ldrb r0, [r7] - muls r0, r6 - adds r0, r5 - movs r1, 0x36 - bl sub_80EE4DC -_080F8250: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F7FFC - - thumb_func_start sub_80F8264 -sub_80F8264: @ 80F8264 - push {r4,lr} - ldr r4, =0x02021cc4 - ldr r0, =0x020375e4 - ldrh r1, [r0] - lsls r1, 6 - ldr r0, =0x02039e0d - adds r1, r0 - adds r0, r4, 0 - bl CopyString - adds r0, r4, 0 - bl sub_81DB5AC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F8264 - - thumb_func_start sub_80F8290 -sub_80F8290: @ 80F8290 - push {lr} - ldr r0, =0x02021ec4 - ldr r1, =0x020375e4 - ldrh r1, [r1] - lsls r1, 6 - ldr r2, =0x02039e02 - adds r1, r2 - bl CopyString - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F8290 - - thumb_func_start sub_80F82B4 -sub_80F82B4: @ 80F82B4 - push {r4-r6,lr} - movs r1, 0 - movs r2, 0 - ldr r5, =0x020375e0 - ldr r4, =0x02039f00 - ldr r0, =0x020375e4 - ldrh r0, [r0] - lsls r0, 1 - adds r0, r4 - movs r6, 0 - ldrsh r3, [r0, r6] -_080F82CA: - lsls r0, r1, 1 - adds r0, r4 - movs r6, 0 - ldrsh r0, [r0, r6] - cmp r3, r0 - bge _080F82DC - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_080F82DC: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x3 - bls _080F82CA - strh r2, [r5] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F82B4 - - thumb_func_start sub_80F82FC -sub_80F82FC: @ 80F82FC - ldr r2, =0x020375e0 - ldr r1, =0x02039f00 - ldr r0, =0x020375e4 - ldrh r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] - bx lr - .pool - thumb_func_end sub_80F82FC - - thumb_func_start sub_80F831C -sub_80F831C: @ 80F831C - push {lr} - movs r1, 0 - ldr r2, =0x02039f20 - ldrb r0, [r2] - ldr r3, =0x020375e2 - cmp r0, 0 - beq _080F833C -_080F832A: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x3 - bhi _080F833C - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080F832A -_080F833C: - strh r1, [r3] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F831C - - thumb_func_start sub_80F834C -sub_80F834C: @ 80F834C - push {r4,lr} - movs r1, 0 - ldr r2, =0x02039f20 - ldrb r0, [r2] - ldr r4, =0x02021ec4 - ldr r3, =0x02039e0d - cmp r0, 0 - beq _080F836E -_080F835C: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x3 - bhi _080F836E - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080F835C -_080F836E: - lsls r1, 6 - adds r1, r3 - adds r0, r4, 0 - bl CopyString - adds r0, r4, 0 - bl sub_81DB5AC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F834C - - thumb_func_start sub_80F8390 -sub_80F8390: @ 80F8390 - push {r4,lr} - movs r1, 0 - ldr r2, =0x02039f20 - ldrb r0, [r2] - ldr r4, =0x02021cc4 - ldr r3, =0x02039e02 - cmp r0, 0 - beq _080F83B2 -_080F83A0: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x3 - bhi _080F83B2 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080F83A0 -_080F83B2: - lsls r1, 6 - adds r1, r3 - adds r0, r4, 0 - bl CopyString - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F8390 - - thumb_func_start sub_80F83D0 -sub_80F83D0: @ 80F83D0 - push {lr} - ldr r0, =sub_80D7B24 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F83D0 - - thumb_func_start sub_80F83E0 -sub_80F83E0: @ 80F83E0 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080F83FE - adds r0, r2, 0 - bl DestroyTask - ldr r0, =sub_80F83D0 - bl SetMainCallback2 -_080F83FE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F83E0 - - thumb_func_start sub_80F840C -sub_80F840C: @ 80F840C - push {lr} - sub sp, 0x4 - bl script_env_2_enable - ldr r0, =sub_80F83E0 - movs r1, 0xA - bl CreateTask - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F840C - - thumb_func_start sub_80F8438 -sub_80F8438: @ 80F8438 - ldr r2, =0x020375e0 - ldr r1, =0x02039e00 - ldr r0, =0x020375e4 - ldrh r0, [r0] - lsls r0, 6 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] - bx lr - .pool - thumb_func_end sub_80F8438 - - thumb_func_start sub_80F8458 -sub_80F8458: @ 80F8458 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080F8476 - adds r0, r2, 0 - bl DestroyTask - ldr r0, =sub_80F5B00 - bl SetMainCallback2 -_080F8476: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F8458 - - thumb_func_start sub_80F8484 -sub_80F8484: @ 80F8484 - push {lr} - sub sp, 0x4 - bl script_env_2_enable - ldr r0, =sub_80F8458 - movs r1, 0xA - bl CreateTask - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F8484 - - thumb_func_start sub_80F84B0 -sub_80F84B0: @ 80F84B0 - ldr r0, =0x020375e0 - ldr r1, =0x02039f25 - ldrb r1, [r1] - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_80F84B0 - - thumb_func_start sub_80F84C4 -sub_80F84C4: @ 80F84C4 - push {r4-r6,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - bl script_env_2_enable - ldr r6, =sub_80FC580 - adds r0, r6, 0 - movs r1, 0 - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r2, =sub_80F8508 - adds r0, r4, 0 - adds r1, r6, 0 - bl SetTaskFuncWithFollowupFunc - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0x1A] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F84C4 - - thumb_func_start sub_80F8508 -sub_80F8508: @ 80F8508 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080F8540 - ldr r0, =0x02039f24 - ldrb r0, [r0] - bl sub_80DA8C8 - ldr r1, =sub_80FC6BC - ldr r2, =sub_80F8568 - adds r0, r4, 0 - bl SetTaskFuncWithFollowupFunc - b _080F8556 - .pool -_080F8540: - ldr r0, =0x02039f24 - ldrb r0, [r0] - bl sub_80DA8C8 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81D9DE4 - str r1, [r0] -_080F8556: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F8508 - - thumb_func_start sub_80F8568 -sub_80F8568: @ 80F8568 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =sub_80FC804 - ldr r2, =sub_80F8584 - bl SetTaskFuncWithFollowupFunc - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F8568 - - thumb_func_start sub_80F8584 -sub_80F8584: @ 80F8584 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =sub_80FCE48 - ldr r2, =sub_80F85A0 - bl SetTaskFuncWithFollowupFunc - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F8584 - - thumb_func_start sub_80F85A0 -sub_80F85A0: @ 80F85A0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =sub_80FC894 - ldr r2, =sub_80F85BC - bl SetTaskFuncWithFollowupFunc - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F85A0 - - thumb_func_start sub_80F85BC -sub_80F85BC: @ 80F85BC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - movs r3, 0 - ldr r5, =0x02039f30 - mov r12, r5 - ldr r0, =0x020375e0 - mov r9, r0 - add r1, sp, 0x4 - mov r8, r1 - ldrb r0, [r5] - cmp r3, r0 - bcs _080F8606 - lsls r0, r6, 2 - adds r0, r6 - lsls r4, r0, 3 - ldr r7, =0x03005e08 -_080F85EC: - mov r1, sp - adds r2, r1, r3 - adds r1, r3, 0x1 - lsls r0, r1, 1 - adds r0, r4 - adds r0, r7 - ldrh r0, [r0] - strb r0, [r2] - lsls r1, 24 - lsrs r3, r1, 24 - ldrb r0, [r5] - cmp r3, r0 - bcc _080F85EC -_080F8606: - movs r3, 0 - mov r1, r12 - ldrb r0, [r1] - cmp r3, r0 - bcs _080F862A - adds r4, r0, 0 - mov r2, sp -_080F8614: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r4 - bcs _080F862A - mov r0, sp - adds r1, r0, r3 - ldrb r0, [r2] - ldrb r1, [r1] - cmp r0, r1 - beq _080F8614 -_080F862A: - mov r1, r12 - ldrb r1, [r1] - cmp r3, r1 - bne _080F8644 - movs r0, 0 - b _080F8646 - .pool -_080F8644: - movs r0, 0x1 -_080F8646: - mov r1, r9 - strh r0, [r1] - movs r3, 0 - mov r4, r12 - ldrb r0, [r4] - cmp r3, r0 - bcs _080F8678 - mov r5, r8 - lsls r0, r6, 2 - adds r0, r6 - lsls r2, r0, 3 - ldr r7, =0x03005e08 -_080F865E: - adds r1, r5, r3 - adds r0, r3, 0x5 - lsls r0, 1 - adds r0, r2 - adds r0, r7 - ldrh r0, [r0] - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldrb r1, [r4] - cmp r3, r1 - bcc _080F865E -_080F8678: - mov r0, r8 - bl sub_80F86E0 - ldr r1, =0x02039f2b - strb r0, [r1] - ldr r0, =0x02039f2c - ldrb r0, [r0] - bl sub_80DB09C - ldr r1, =sub_80FCF40 - ldr r2, =sub_80F86B8 - adds r0, r6, 0 - bl SetTaskFuncWithFollowupFunc - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F85BC - - thumb_func_start sub_80F86B8 -sub_80F86B8: @ 80F86B8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - bl sub_80DCE58 - ldr r1, =sub_80FCFD0 - ldr r2, =sub_80F8714 - adds r0, r4, 0 - bl SetTaskFuncWithFollowupFunc - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F86B8 - - thumb_func_start sub_80F86E0 -sub_80F86E0: @ 80F86E0 - push {r4,r5,lr} - adds r3, r0, 0 - movs r4, 0 - movs r2, 0x1 - ldr r0, =0x02039f30 - ldrb r0, [r0] - cmp r2, r0 - bge _080F8708 - adds r5, r0, 0 -_080F86F2: - adds r0, r3, r4 - adds r1, r3, r2 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bcs _080F8702 - lsls r0, r2, 24 - lsrs r4, r0, 24 -_080F8702: - adds r2, 0x1 - cmp r2, r5 - blt _080F86F2 -_080F8708: - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80F86E0 - - thumb_func_start sub_80F8714 -sub_80F8714: @ 80F8714 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0x1 - bne _080F8748 - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080F877E - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80F878C - str r0, [r1] - b _080F877E - .pool -_080F8748: - ldr r5, =0x02039e02 - movs r4, 0x3 -_080F874C: - adds r0, r5, 0 - bl GetStringEnd_Limit7 - adds r5, 0x40 - subs r4, 0x1 - cmp r4, 0 - bge _080F874C - adds r0, r6, 0 - bl DestroyTask - ldr r0, =0x03005d8c - 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 - bl script_env_2_disable - bl script_env_2_enable_and_set_ctx_running -_080F877E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F8714 - - thumb_func_start sub_80F878C -sub_80F878C: @ 80F878C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_800AC34 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80F87B4 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F878C - - thumb_func_start sub_80F87B4 -sub_80F87B4: @ 80F87B4 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _080F87D0 - adds r0, r1, 0 - bl DestroyTask - bl script_env_2_disable - bl script_env_2_enable_and_set_ctx_running -_080F87D0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F87B4 - - thumb_func_start sub_80F87D8 -sub_80F87D8: @ 80F87D8 - push {r4,lr} - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r1, =0x02039e00 - ldrb r3, [r1, 0x15] - ldr r4, =0x000013bc - adds r0, r2, r4 - strh r3, [r0] - adds r0, r1, 0 - adds r0, 0x55 - ldrb r3, [r0] - adds r4, 0x2 - adds r0, r2, r4 - strh r3, [r0] - adds r1, 0x95 - ldrb r0, [r1] - movs r1, 0x9E - lsls r1, 5 - adds r2, r1 - strh r0, [r2] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F87D8 - - thumb_func_start sub_80F8814 -sub_80F8814: @ 80F8814 - push {lr} - ldr r0, =0x020375e2 - ldrb r0, [r0] - adds r1, r0, 0 - cmp r0, 0x1 - beq _080F883A - cmp r0, 0x1 - bgt _080F8830 - cmp r0, 0 - beq _080F8836 - b _080F8842 - .pool -_080F8830: - cmp r1, 0x2 - beq _080F883E - b _080F8842 -_080F8836: - movs r1, 0x3 - b _080F8844 -_080F883A: - movs r1, 0x4 - b _080F8844 -_080F883E: - movs r1, 0x5 - b _080F8844 -_080F8842: - movs r1, 0x64 -_080F8844: - ldr r0, =0x020375e0 - strh r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F8814 - - thumb_func_start sub_80F8850 -sub_80F8850: @ 80F8850 - push {lr} - bl sub_80F8264 - bl sub_80F8290 - bl sub_80F8438 - pop {r0} - bx r0 - thumb_func_end sub_80F8850 - - thumb_func_start sub_80F8864 -sub_80F8864: @ 80F8864 - push {lr} - ldr r0, =0x02039f2c - ldrh r0, [r0] - cmp r0, 0x4 - bhi _080F88A4 - lsls r0, 2 - ldr r1, =_080F8880 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F8880: - .4byte _080F8894 - .4byte _080F8898 - .4byte _080F889C - .4byte _080F88A0 - .4byte _080F88A4 -_080F8894: - movs r1, 0x8 - b _080F88A6 -_080F8898: - movs r1, 0x9 - b _080F88A6 -_080F889C: - movs r1, 0xA - b _080F88A6 -_080F88A0: - movs r1, 0xB - b _080F88A6 -_080F88A4: - movs r1, 0xC -_080F88A6: - ldr r0, =0x03005d8c - ldr r0, [r0] - lsls r1, 5 - adds r0, r1 - ldr r1, =0x00002e98 - adds r0, r1 - ldrh r1, [r0] - cmp r1, 0 - bne _080F88CC - ldr r0, =0x020375e0 - strh r1, [r0] - b _080F88D2 - .pool -_080F88CC: - ldr r1, =0x020375e0 - movs r0, 0x1 - strh r0, [r1] -_080F88D2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F8864 - - thumb_func_start sub_80F88DC -sub_80F88DC: @ 80F88DC - push {lr} - movs r0, 0xFF - bl sub_80DEDA8 - pop {r0} - bx r0 - thumb_func_end sub_80F88DC - - thumb_func_start sub_80F88E8 -sub_80F88E8: @ 80F88E8 - push {lr} - ldr r0, =0x02039f20 - ldr r1, =0x02039f25 - ldrb r2, [r1] - adds r0, r2, r0 - ldrb r0, [r0] - cmp r0, 0 - bne _080F8930 - ldr r0, =0x02039f2e - ldrh r0, [r0] - cmp r0, 0x3 - bne _080F8930 - ldr r1, =0x02039f08 - lsls r0, r2, 1 - adds r0, r1 - movs r2, 0 - ldrsh r1, [r0, r2] - ldr r0, =0x0000031f - cmp r1, r0 - ble _080F8930 - ldr r1, =0x020375e0 - movs r0, 0x1 - b _080F8934 - .pool -_080F8930: - ldr r1, =0x020375e0 - movs r0, 0 -_080F8934: - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F88E8 - - thumb_func_start sub_80F8940 -sub_80F8940: @ 80F8940 - push {lr} - movs r3, 0 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00002f98 - adds r1, r0, r2 - movs r2, 0x4 -_080F894E: - ldrh r0, [r1] - cmp r0, 0 - beq _080F895A - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 -_080F895A: - adds r1, 0x20 - subs r2, 0x1 - cmp r2, 0 - bge _080F894E - adds r0, r3, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80F8940 - - thumb_func_start sub_80F8970 -sub_80F8970: @ 80F8970 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r0, =0x02039f00 - mov r12, r0 - ldr r1, =0x020375e4 - mov r9, r1 - ldr r2, =0x02039e02 - mov r10, r2 - mov r2, r12 - mov r1, sp - movs r6, 0x3 -_080F898E: - ldrh r0, [r2] - strh r0, [r1] - adds r2, 0x2 - adds r1, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _080F898E - movs r6, 0 -_080F899E: - movs r1, 0x3 - cmp r1, r6 - ble _080F89C8 -_080F89A4: - subs r5, r1, 0x1 - lsls r0, r5, 1 - mov r4, sp - adds r3, r4, r0 - lsls r0, r1, 1 - adds r2, r4, r0 - ldrh r4, [r3] - movs r7, 0 - ldrsh r1, [r3, r7] - movs r7, 0 - ldrsh r0, [r2, r7] - cmp r1, r0 - bge _080F89C2 - strh r4, [r2] - strh r0, [r3] -_080F89C2: - adds r1, r5, 0 - cmp r1, r6 - bgt _080F89A4 -_080F89C8: - adds r6, 0x1 - cmp r6, 0x2 - ble _080F899E - mov r2, r9 - ldrh r0, [r2] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - movs r2, 0 - mov r8, r2 - movs r6, 0 - lsls r0, 16 - asrs r4, r0, 16 - adds r3, r0, 0 - mov r1, sp - mov r5, r9 -_080F89E8: - movs r7, 0 - ldrsh r0, [r1, r7] - cmp r0, r4 - bne _080F8A02 - lsls r0, r2, 24 - movs r2, 0x80 - lsls r2, 17 - adds r0, r2 - lsrs r2, r0, 24 - ldrh r7, [r5] - cmp r6, r7 - bne _080F8A02 - mov r8, r2 -_080F8A02: - adds r1, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _080F89E8 - movs r6, 0 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - asrs r1, r3, 16 - lsls r2, 24 - mov r9, r2 - cmp r0, r1 - beq _080F8A30 - adds r2, r1, 0 - mov r1, sp -_080F8A20: - adds r1, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - bgt _080F8A30 - movs r4, 0 - ldrsh r0, [r1, r4] - cmp r0, r2 - bne _080F8A20 -_080F8A30: - lsls r0, r6, 24 - lsrs r7, r0, 24 - mov r2, r8 - movs r6, 0 - asrs r1, r3, 16 - mov r5, r12 - movs r4, 0 - ldrsh r0, [r5, r4] - b _080F8A66 - .pool -_080F8A50: - subs r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_080F8A56: - adds r6, 0x1 - cmp r6, 0x3 - bgt _080F8A6E - lsls r0, r6, 1 - add r0, r12 - asrs r1, r3, 16 - movs r5, 0 - ldrsh r0, [r0, r5] -_080F8A66: - cmp r1, r0 - bne _080F8A56 - cmp r2, 0x1 - bne _080F8A50 -_080F8A6E: - lsls r4, r6, 6 - mov r0, r10 - adds r1, r4, r0 - ldr r0, =0x02021cc4 - bl CopyString - ldr r5, =0x02021dc4 - mov r0, r10 - adds r0, 0xB - adds r4, r0 - adds r0, r5, 0 - adds r1, r4, 0 - bl CopyString - adds r0, r5, 0 - bl sub_81DB5AC - mov r1, r9 - asrs r0, r1, 24 - cmp r0, 0x1 - beq _080F8A9C - cmp r8, r0 - bne _080F8AB0 -_080F8A9C: - ldr r0, =0x020375e4 - strh r7, [r0] - b _080F8AB6 - .pool -_080F8AB0: - ldr r1, =0x020375e4 - adds r0, r7, 0x4 - strh r0, [r1] -_080F8AB6: - 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_80F8970 - - thumb_func_start sub_80F8ACC -sub_80F8ACC: @ 80F8ACC - push {lr} - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F8ACC - - thumb_func_start sub_80F8ADC -sub_80F8ADC: @ 80F8ADC - push {lr} - ldr r0, =sub_812FDEC - bl SetMainCallback2 - ldr r1, =0x030022c0 - ldr r0, =sub_80F8ACC - str r0, [r1, 0x8] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F8ADC - - thumb_func_start sub_80F8AFC -sub_80F8AFC: @ 80F8AFC - push {r4,r5,lr} - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080F8B7C - movs r3, 0 - ldr r0, =0x02039f30 - adds r4, r0, 0 - ldr r5, =0x02039e00 - ldrb r0, [r4] - cmp r3, r0 - bge _080F8B50 - adds r2, r5, 0 - ldr r1, =0x020229e8 -_080F8B1C: - ldrb r0, [r1] - subs r0, 0x1 - cmp r0, 0x1 - bhi _080F8B44 - ldrb r0, [r1, 0x13] - cmp r0, 0 - bne _080F8B40 - movs r0, 0xEB - b _080F8B42 - .pool -_080F8B40: - movs r0, 0xEC -_080F8B42: - strb r0, [r2, 0x15] -_080F8B44: - adds r2, 0x40 - adds r1, 0x1C - adds r3, 0x1 - ldrb r0, [r4] - cmp r3, r0 - blt _080F8B1C -_080F8B50: - ldr r0, =0x00004010 - ldrb r1, [r5, 0x15] - bl VarSet - ldr r0, =0x00004011 - adds r1, r5, 0 - adds r1, 0x55 - ldrb r1, [r1] - bl VarSet - ldr r0, =0x00004012 - adds r1, r5, 0 - adds r1, 0x95 - ldrb r1, [r1] - bl VarSet - ldr r0, =0x00004013 - adds r1, r5, 0 - adds r1, 0xD5 - ldrb r1, [r1] - bl VarSet -_080F8B7C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F8AFC - - thumb_func_start sub_80F8B94 -sub_80F8B94: @ 80F8B94 - push {r4-r7,lr} - ldr r1, =0x0300301c - movs r0, 0xC - strb r0, [r1] - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080F8C6E - movs r5, 0 - ldr r0, =0x02039f30 - ldrb r0, [r0] - cmp r5, r0 - bge _080F8C6E - movs r7, 0 - movs r6, 0x60 - movs r4, 0xB0 - lsls r4, 17 -_080F8BBA: - ldr r0, =gUnknown_0858D8EC - adds r0, r5, r0 - ldrb r0, [r0] - ldr r1, =0x03005d8c - ldr r2, [r1] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl GetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02037350 - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r6 - strb r0, [r1, 0x5] - ldr r0, =0x020229e8 - adds r1, r7, r0 - ldrb r0, [r1] - subs r0, 0x1 - cmp r0, 0x1 - bhi _080F8C38 - ldrb r0, [r1, 0x13] - cmp r0, 0 - bne _080F8C2C - lsrs r1, r4, 16 - ldr r0, =gFieldObjectPalette33 - b _080F8C42 - .pool -_080F8C2C: - lsrs r1, r4, 16 - ldr r0, =gFieldObjectPalette34 - b _080F8C42 - .pool -_080F8C38: - ldrb r0, [r1, 0x13] - cmp r0, 0 - bne _080F8C50 - lsrs r1, r4, 16 - ldr r0, =gFieldObjectPalette8 -_080F8C42: - movs r2, 0x20 - bl gpu_pal_apply - b _080F8C5A - .pool -_080F8C50: - lsrs r1, r4, 16 - ldr r0, =gFieldObjectPalette17 - movs r2, 0x20 - bl gpu_pal_apply -_080F8C5A: - movs r0, 0x80 - lsls r0, 13 - adds r4, r0 - adds r7, 0x1C - adds r6, 0x10 - adds r5, 0x1 - ldr r0, =0x02039f30 - ldrb r0, [r0] - cmp r5, r0 - blt _080F8BBA -_080F8C6E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F8B94 - - thumb_func_start sub_80F8C7C -sub_80F8C7C: @ 80F8C7C - push {r4-r6,lr} - sub sp, 0x4 - ldr r6, =0x02039f24 - ldrb r0, [r6] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - movs r1, 0x46 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - strb r0, [r1] - cmp r0, 0 - bne _080F8D18 - ldr r0, =0x02039f20 - ldr r1, =0x02039f25 - ldrb r2, [r1] - adds r0, r2, r0 - ldrb r0, [r0] - cmp r0, 0 - bne _080F8D18 - ldr r0, =0x02039f2e - ldrh r0, [r0] - cmp r0, 0x3 - bne _080F8D18 - ldr r1, =0x02039f08 - lsls r0, r2, 1 - adds r0, r1 - movs r2, 0 - ldrsh r1, [r0, r2] - ldr r0, =0x0000031f - cmp r1, r0 - ble _080F8D18 - movs r1, 0x1 - mov r0, sp - strb r1, [r0] - ldrb r0, [r6] - muls r0, r5 - adds r0, r4 - movs r1, 0x46 - mov r2, sp - bl pokemon_setattr - ldrb r0, [r6] - muls r0, r5 - adds r0, r4 - bl sub_80EE5A4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bls _080F8CF6 - ldrb r0, [r6] - muls r0, r5 - adds r0, r4 - movs r1, 0x46 - bl sub_80EE4DC -_080F8CF6: - movs r0, 0x1 - b _080F8D1A - .pool -_080F8D18: - movs r0, 0 -_080F8D1A: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80F8C7C - - thumb_func_start sub_80F8D24 -sub_80F8D24: @ 80F8D24 - movs r0, 0 - bx lr - thumb_func_end sub_80F8D24 - - thumb_func_start sub_80F8D28 -sub_80F8D28: @ 80F8D28 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r7, =sub_80F8EE8 - adds r0, r7, 0 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _080F8D44 - b _080F8E9C -_080F8D44: - bl init_uns_table_pokemon_copy - movs r0, 0xA - mov r9, r0 - movs r1, 0x3 - mov r10, r1 - ldr r2, =0x02039e00 - ldr r4, =0x020375e4 - ldrh r1, [r4] - lsls r1, 6 - adds r0, r1, r2 - ldrh r6, [r0] - adds r0, r2, 0 - adds r0, 0x38 - adds r0, r1, r0 - ldr r5, [r0] - adds r2, 0x3C - adds r1, r2 - ldr r1, [r1] - mov r8, r1 - adds r0, r7, 0 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x8] - strh r6, [r0, 0xA] - ldr r1, =0x02039f25 - ldrh r0, [r4] - ldrb r1, [r1] - cmp r0, r1 - bne _080F8DC4 - lsls r0, r6, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - ldr r1, [r1, 0x8] - adds r2, r6, 0 - adds r3, r5, 0 - bl DecompressMonPic_DetectFrontOrBack_2 - b _080F8DD8 - .pool -_080F8DC4: - lsls r0, r6, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - ldr r1, [r1, 0x8] - adds r2, r6, 0 - adds r3, r5, 0 - bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack -_080F8DD8: - adds r0, r6, 0 - mov r1, r8 - adds r2, r5, 0 - bl sub_806E7CC - adds r4, r0, 0 - bl LoadCompressedObjectPalette - adds r0, r6, 0 - movs r1, 0x1 - bl sub_806A068 - ldr r0, =0x0202499c - ldrh r1, [r4, 0x4] - strh r1, [r0, 0x2] - mov r1, r9 - adds r1, 0x1 - lsls r1, 19 - movs r2, 0x80 - lsls r2, 14 - adds r1, r2 - asrs r1, 16 - mov r3, r10 - lsls r2, r3, 19 - movs r3, 0xA0 - lsls r3, 14 - adds r2, r3 - asrs r2, 16 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080F8E58 - movs r0, 0x4 - ands r0, r1 - lsls r4, r5, 4 - cmp r0, 0 - bne _080F8E6C - adds r0, r4, r5 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0 - bl sub_806ED40 - b _080F8E6C - .pool -_080F8E58: - lsls r4, r5, 4 - adds r0, r4, r5 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0 - bl sub_806ED40 -_080F8E6C: - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0xC] - mov r1, r9 - strh r1, [r0, 0xE] - mov r2, r10 - strh r2, [r0, 0x10] - ldr r3, =0x02020630 - adds r1, r4, r5 - lsls r1, 2 - adds r0, r3, 0 - adds r0, 0x1C - adds r0, r1, r0 - ldr r2, =DummyObjectCallback - str r2, [r0] - adds r1, r3 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] -_080F8E9C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F8D28 - - thumb_func_start sub_80F8EB8 -sub_80F8EB8: @ 80F8EB8 - push {lr} - ldr r0, =sub_80F8EE8 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _080F8EDC - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - bl sub_805F094 -_080F8EDC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F8EB8 - - thumb_func_start sub_80F8EE8 -sub_80F8EE8: @ 80F8EE8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r5, r0, r1 - movs r2, 0x8 - ldrsh r0, [r5, r2] - adds r2, r1, 0 - cmp r0, 0x4 - bhi _080F8F98 - lsls r0, 2 - ldr r1, =_080F8F14 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F8F14: - .4byte _080F8F78 - .4byte _080F8F28 - .4byte _080F8F98 - .4byte _080F8F42 - .4byte _080F8F84 -_080F8F28: - movs r0, 0xA - movs r1, 0x3 - movs r2, 0x8 - movs r3, 0x8 - bl CreateWindowFromRect - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x12] - movs r1, 0x1 - bl SetStandardWindowBorderStyle - b _080F8F78 -_080F8F42: - movs r0, 0xC - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r4, r0, r1 - ldrb r0, [r4, 0x5] - lsrs r0, 4 - bl GetObjectPaletteTagBySlot - lsls r0, 16 - lsrs r0, 16 - bl FreeObjectPaletteByTag - ldrb r0, [r4, 0x1] - lsls r0, 30 - cmp r0, 0 - beq _080F8F72 - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry -_080F8F72: - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_080F8F78: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - b _080F8F98 - .pool -_080F8F84: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x12] - bl sub_80E2A78 - adds r0, r4, 0 - bl DestroyTask -_080F8F98: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80F8EE8 - - thumb_func_start sub_80F8FA0 -sub_80F8FA0: @ 80F8FA0 - push {r4,lr} - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080F8FD8 - ldr r0, =0x02039f30 - ldrb r0, [r0] - cmp r0, 0x4 - bne _080F8FD8 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _080F8FD8 - ldr r4, =0x020375f0 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - b _080F8FDE - .pool -_080F8FD8: - ldr r1, =0x020375f0 - movs r0, 0x4 - strh r0, [r1] -_080F8FDE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F8FA0 - - thumb_func_start sub_80F8FE8 -sub_80F8FE8: @ 80F8FE8 - push {r4,lr} - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080F9020 - ldr r2, =0x030060b8 - ldr r1, [r2] - ldr r0, =0x41c64e6d - muls r0, r1 - ldr r1, =0x00006073 - adds r0, r1 - str r0, [r2] - lsrs r0, 16 - ldr r4, =0x020375f0 - b _080F902A - .pool -_080F9020: - ldr r4, =0x020375f0 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 -_080F902A: - ldrh r1, [r4] - bl __umodsi3 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F8FE8 - - thumb_func_start sub_80F903C -sub_80F903C: @ 80F903C - ldr r2, =0x030060b8 - ldr r1, [r2] - ldr r0, =0x41c64e6d - muls r0, r1 - ldr r1, =0x00006073 - adds r0, r1 - str r0, [r2] - lsrs r0, 16 - bx lr - .pool - thumb_func_end sub_80F903C - - thumb_func_start sub_80F905C -sub_80F905C: @ 80F905C - push {lr} - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _080F9074 - movs r0, 0 - b _080F907E - .pool -_080F9074: - ldr r0, =sub_80F9088 - movs r1, 0x5 - bl CreateTask - movs r0, 0x1 -_080F907E: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80F905C - - thumb_func_start sub_80F9088 -sub_80F9088: @ 80F9088 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080F90C0 - cmp r0, 0x1 - beq _080F90CE - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080F90D4 - bl script_env_2_enable_and_set_ctx_running - adds r0, r5, 0 - bl DestroyTask - b _080F90D4 - .pool -_080F90C0: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080F90D4 - bl sub_800ADF8 -_080F90CE: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080F90D4: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80F9088 - - thumb_func_start sub_80F90DC -sub_80F90DC: @ 80F90DC - push {lr} - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080F90FE - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _080F90FE - bl sub_800E0E8 - movs r0, 0x8 - movs r1, 0x8 - bl sub_800DFB4 -_080F90FE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F90DC - - thumb_func_start sub_80F910C -sub_80F910C: @ 80F910C - push {lr} - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080F9126 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _080F9126 - bl sub_800E084 -_080F9126: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F910C - - thumb_func_start sub_80F9134 -sub_80F9134: @ 80F9134 - push {lr} - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _080F914C - movs r0, 0 - b _080F914E - .pool -_080F914C: - movs r0, 0x1 -_080F914E: - pop {r1} - bx r1 - thumb_func_end sub_80F9134 - - thumb_func_start sub_80F9154 -sub_80F9154: @ 80F9154 - ldr r1, =0x02039f2a - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_80F9154 - - thumb_func_start sub_80F9160 -sub_80F9160: @ 80F9160 - push {lr} - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _080F9178 - movs r0, 0 - b _080F917A - .pool -_080F9178: - movs r0, 0x1 -_080F917A: - pop {r1} - bx r1 - thumb_func_end sub_80F9160 - - thumb_func_start sp000_heal_pokemon -sp000_heal_pokemon: @ 80F9180 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r0, 0 - mov r8, r0 - ldr r0, =0x020244e9 - ldrb r0, [r0] - cmp r8, r0 - bcs _080F922C - ldr r1, =0x020244ec - mov r10, r1 - mov r6, sp -_080F919E: - movs r0, 0x64 - mov r4, r8 - muls r4, r0 - add r4, r10 - adds r0, r4, 0 - movs r1, 0x3A - bl pokemon_getattr - lsls r1, r0, 16 - strb r0, [r6] - lsrs r1, 24 - strb r1, [r6, 0x1] - adds r0, r4, 0 - movs r1, 0x39 - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x15 - bl pokemon_getattr - lsls r0, 24 - lsrs r7, r0, 24 - movs r5, 0 - movs r1, 0x1 - add r1, r8 - mov r9, r1 -_080F91D4: - adds r1, r5, 0 - adds r1, 0xD - adds r0, r4, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - adds r1, r7, 0 - adds r2, r5, 0 - bl CalcPPWithPPUps - strb r0, [r6] - adds r1, r5, 0 - adds r1, 0x11 - adds r0, r4, 0 - mov r2, sp - bl pokemon_setattr - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _080F91D4 - movs r0, 0 - strb r0, [r6] - strb r0, [r6, 0x1] - strb r0, [r6, 0x2] - strb r0, [r6, 0x3] - movs r1, 0x64 - mov r0, r8 - muls r0, r1 - add r0, r10 - movs r1, 0x37 - mov r2, sp - bl pokemon_setattr - mov r1, r9 - lsls r0, r1, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =0x020244e9 - ldrb r0, [r0] - cmp r8, r0 - bcc _080F919E -_080F922C: - 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 sp000_heal_pokemon - - thumb_func_start sub_80F9244 -@ void sub_80F9244(s16 species_num, u8 level, int held_item) -sub_80F9244: @ 80F9244 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x78 - adds r5, r0, 0 - adds r3, r1, 0 - adds r4, r2, 0 - lsls r5, 16 - lsrs r5, 16 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 16 - lsrs r0, r4, 16 - mov r8, r0 - add r6, sp, 0x14 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r3, 0 - movs r3, 0x20 - bl create_pokemon_set_level - add r0, sp, 0x10 - mov r1, r8 - strb r1, [r0] - lsrs r4, 24 - strb r4, [r0, 0x1] - adds r0, r6, 0 - movs r1, 0xC - add r2, sp, 0x10 - bl pokemon_setattr - adds r0, r6, 0 - bl pokemon_catch - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r5, 0 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r5, r0, 16 - cmp r4, 0x1 - bgt _080F92B8 - cmp r4, 0 - blt _080F92B8 - adds r0, r5, 0 - movs r1, 0x2 - bl pokedex_flag_operation - adds r0, r5, 0 - movs r1, 0x3 - bl pokedex_flag_operation -_080F92B8: - adds r0, r4, 0 - add sp, 0x78 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80F9244 - - thumb_func_start sub_80F92C8 -sub_80F92C8: @ 80F92C8 - push {lr} - sub sp, 0x68 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - mov r0, sp - movs r2, 0x1 - bl sub_8070954 - add r2, sp, 0x64 - movs r0, 0x1 - strb r0, [r2] - mov r0, sp - movs r1, 0x2D - bl pokemon_setattr - mov r0, sp - bl pokemon_catch - lsls r0, 24 - lsrs r0, 24 - add sp, 0x68 - pop {r1} - bx r1 - thumb_func_end sub_80F92C8 - - thumb_func_start sub_80F92F8 -sub_80F92F8: @ 80F92F8 - push {lr} - bl sub_806B5C4 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1 - beq _080F9314 - cmp r1, 0x1 - bgt _080F9310 - cmp r1, 0 - beq _080F9314 - b _080F9318 -_080F9310: - cmp r1, 0x2 - bne _080F9318 -_080F9314: - ldr r0, =0x020375f0 - strh r1, [r0] -_080F9318: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F92F8 - - thumb_func_start sub_80F9320 -sub_80F9320: @ 80F9320 - push {r4-r7,lr} - lsls r0, 16 - lsrs r6, r0, 16 - movs r5, 0 - movs r7, 0xCE - lsls r7, 1 -_080F932C: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - beq _080F9360 - cmp r0, r7 - beq _080F9360 - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr - cmp r0, r6 - bne _080F9360 - movs r0, 0x1 - b _080F9368 - .pool -_080F9360: - adds r5, 0x1 - cmp r5, 0x5 - ble _080F932C - movs r0, 0 -_080F9368: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80F9320 - - thumb_func_start sub_80F9370 -sub_80F9370: @ 80F9370 - push {r4,lr} - movs r0, 0xAF - bl sub_80F9320 - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - cmp r4, 0x1 - bne _080F9392 - movs r0, 0xAF - bl ItemIdToBerryType - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02021cc4 - bl GetBerryNameByBerryType -_080F9392: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80F9370 - - thumb_func_start sub_80F93A0 -sub_80F93A0: @ 80F93A0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 24 - lsrs r5, 24 - lsls r7, r2, 16 - lsrs r6, r7, 16 - bl zero_enemy_party_data - ldr r0, =0x02024744 - mov r8, r0 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - str r0, [sp, 0x8] - str r0, [sp, 0xC] - mov r0, r8 - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0x20 - bl create_pokemon_set_level - cmp r6, 0 - beq _080F93EE - add r0, sp, 0x10 - strb r6, [r0] - adds r1, r0, 0 - lsrs r0, r7, 24 - strb r0, [r1, 0x1] - mov r0, r8 - movs r1, 0xC - add r2, sp, 0x10 - bl pokemon_setattr -_080F93EE: - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F93A0 - - thumb_func_start sub_80F9400 -sub_80F9400: @ 80F9400 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 24 - lsrs r2, 24 - cmp r3, 0x6 - bls _080F941C - ldr r0, =0x020244e9 - ldrb r0, [r0] - subs r0, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 -_080F941C: - movs r0, 0x64 - muls r0, r3 - ldr r1, =0x020244ec - adds r0, r1 - adds r1, r4, 0 - bl sub_80691F4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F9400 - - thumb_func_start sub_80F9438 -sub_80F9438: @ 80F9438 - push {lr} - ldr r0, =0x030022c0 - ldr r1, =sub_80F9460 - str r1, [r0, 0x8] - ldr r0, =0x000040cf - movs r1, 0x9 - bl VarSet - movs r0, 0 - bl sub_81B8518 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F9438 - - thumb_func_start sub_80F9460 -sub_80F9460: @ 80F9460 - push {lr} - ldr r0, =0x0203cef8 - ldrb r1, [r0] - cmp r1, 0 - bne _080F9478 - ldr r0, =0x020375f0 - strh r1, [r0] - b _080F947E - .pool -_080F9478: - ldr r1, =0x020375f0 - movs r0, 0x1 - strh r0, [r1] -_080F947E: - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F9460 - - thumb_func_start sub_80F9490 -sub_80F9490: @ 80F9490 - push {lr} - ldr r1, =0x030022c0 - ldr r0, =sub_80F94B8 - str r0, [r1, 0x8] - ldr r0, =0x020375e0 - ldrb r0, [r0] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - bl sub_81B8518 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F9490 - - thumb_func_start sub_80F94B8 -sub_80F94B8: @ 80F94B8 - push {lr} - ldr r0, =0x0203cef8 - ldrb r1, [r0] - cmp r1, 0 - bne _080F94D0 - ldr r0, =0x020375f0 - strh r1, [r0] - b _080F94D6 - .pool -_080F94D0: - ldr r1, =0x020375f0 - movs r0, 0x1 - strh r0, [r1] -_080F94D6: - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F94B8 - - thumb_func_start sub_80F94E8 -sub_80F94E8: @ 80F94E8 - push {r4-r7,lr} - sub sp, 0x198 - add r0, sp, 0x190 - movs r1, 0 - str r1, [r0] - ldr r2, =0x05000064 - mov r1, sp - bl CpuSet - movs r5, 0 - movs r7, 0x64 - ldr r6, =0x020244ec - mov r4, sp -_080F9502: - ldr r0, =0x0203cef8 - adds r1, r5, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _080F951C - subs r0, 0x1 - adds r1, r0, 0 - muls r1, r7 - adds r1, r6 - adds r0, r4, 0 - movs r2, 0x64 - bl memcpy -_080F951C: - adds r4, 0x64 - adds r5, 0x1 - cmp r5, 0x3 - ble _080F9502 - add r0, sp, 0x194 - movs r1, 0 - str r1, [r0] - ldr r4, =0x020244ec - ldr r2, =0x05000096 - adds r1, r4, 0 - bl CpuSet - mov r5, sp - add r6, sp, 0x12C -_080F9538: - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x64 - bl memcpy - adds r5, 0x64 - adds r4, 0x64 - cmp r5, r6 - ble _080F9538 - bl calc_player_party_count - add sp, 0x198 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F94E8 - - thumb_func_start sub_80F9568 -sub_80F9568: @ 80F9568 - push {lr} - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _080F9580 - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - bne _080F9584 -_080F9580: - movs r0, 0 - b _080F9586 -_080F9584: - movs r0, 0x1 -_080F9586: - pop {r1} - bx r1 - thumb_func_end sub_80F9568 - - thumb_func_start sub_80F958C -sub_80F958C: @ 80F958C - push {r4,r5,lr} - ldr r4, =0x020244ec - movs r5, 0 -_080F9592: - adds r0, r4, 0 - bl sub_80F9568 - cmp r0, 0 - beq _080F95B0 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _080F95B0 - movs r0, 0 - b _080F95BA - .pool -_080F95B0: - adds r5, 0x1 - adds r4, 0x64 - cmp r5, 0x5 - ble _080F9592 - movs r0, 0x1 -_080F95BA: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80F958C - - thumb_func_start sub_80F95C0 -sub_80F95C0: @ 80F95C0 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - adds r4, r0, 0 - muls r4, r1 - ldr r0, =0x020244ec - adds r4, r0 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x7 - bl happiness_algorithm - adds r0, r4, 0 - movs r1, 0x37 - mov r2, sp - bl pokemon_setattr - ldr r5, =0x02021cc4 - adds r0, r4, 0 - movs r1, 0x2 - adds r2, r5, 0 - bl pokemon_getattr - adds r0, r5, 0 - bl GetStringEnd_Limit7 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F95C0 - - thumb_func_start sub_80F960C -sub_80F960C: @ 80F960C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - bl sub_80F9568 - cmp r0, 0 - beq _080F964C - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - bne _080F964C - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - bl pokemon_ailments_get_primary - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080F964C - movs r0, 0x1 - b _080F964E - .pool -_080F964C: - movs r0, 0 -_080F964E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80F960C - - thumb_func_start sub_80F9654 -sub_80F9654: @ 80F9654 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - movs r0, 0 - ldrsh r5, [r4, r0] - cmp r5, 0x1 - beq _080F96AE - cmp r5, 0x1 - bgt _080F967C - cmp r5, 0 - beq _080F9682 - b _080F9722 - .pool -_080F967C: - cmp r5, 0x2 - beq _080F96C0 - b _080F9722 -_080F9682: - ldrh r1, [r4, 0x2] - movs r2, 0x2 - ldrsh r0, [r4, r2] - cmp r0, 0x5 - bgt _080F96A8 -_080F968C: - lsls r0, r1, 24 - lsrs r0, 24 - bl sub_80F960C - cmp r0, 0 - bne _080F96FC - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - adds r1, r0, 0 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - ble _080F968C -_080F96A8: - movs r0, 0x2 - strh r0, [r4] - b _080F9722 -_080F96AE: - bl sub_809833C - lsls r0, 24 - cmp r0, 0 - beq _080F9722 - ldrh r0, [r4] - subs r0, 0x1 - strh r0, [r4] - b _080F9722 -_080F96C0: - bl sub_80F958C - adds r1, r0, 0 - cmp r1, 0 - beq _080F9714 - bl InBattlePyramid - adds r4, r0, 0 - bl InBattlePike - orrs r4, r0 - lsls r4, 24 - cmp r4, 0 - bne _080F96E6 - bl sub_81D5C18 - lsls r0, 24 - cmp r0, 0 - beq _080F96F0 -_080F96E6: - ldr r0, =0x020375f0 - strh r5, [r0] - b _080F9718 - .pool -_080F96F0: - ldr r1, =0x020375f0 - movs r0, 0x1 - strh r0, [r1] - b _080F9718 - .pool -_080F96FC: - ldrb r0, [r4, 0x2] - bl sub_80F95C0 - ldr r0, =gUnknown_085ECF5D - bl box_related_two__2 - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _080F9722 - .pool -_080F9714: - ldr r0, =0x020375f0 - strh r1, [r0] -_080F9718: - bl script_env_2_enable_and_set_ctx_running - adds r0, r6, 0 - bl DestroyTask -_080F9722: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F9654 - - thumb_func_start sub_80F972C -sub_80F972C: @ 80F972C - push {lr} - ldr r0, =sub_80F9654 - movs r1, 0x50 - bl CreateTask - bl script_env_2_set_ctx_paused - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F972C - - thumb_func_start overworld_poison -overworld_poison: @ 80F9744 - push {r4-r7,lr} - sub sp, 0x4 - ldr r4, =0x020244ec - movs r7, 0 - movs r6, 0 - movs r5, 0x5 -_080F9750: - adds r0, r4, 0 - movs r1, 0x5 - bl pokemon_getattr - cmp r0, 0 - beq _080F9794 - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - bl pokemon_ailments_get_primary - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080F9794 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - str r0, [sp] - cmp r0, 0 - beq _080F9786 - subs r0, 0x1 - str r0, [sp] - cmp r0, 0 - bne _080F9788 -_080F9786: - adds r6, 0x1 -_080F9788: - adds r0, r4, 0 - movs r1, 0x39 - mov r2, sp - bl pokemon_setattr - adds r7, 0x1 -_080F9794: - adds r4, 0x64 - subs r5, 0x1 - cmp r5, 0 - bge _080F9750 - cmp r6, 0 - bne _080F97A4 - cmp r7, 0 - beq _080F97A8 -_080F97A4: - bl overworld_posion_effect -_080F97A8: - cmp r6, 0 - beq _080F97B4 - movs r0, 0x2 - b _080F97BE - .pool -_080F97B4: - cmp r7, 0 - bne _080F97BC - movs r0, 0 - b _080F97BE -_080F97BC: - movs r0, 0x1 -_080F97BE: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end overworld_poison - - thumb_func_start sub_80F97C8 -sub_80F97C8: @ 80F97C8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r5, r0, 0 - movs r1, 0 - bl pokemon_getattr - lsls r0, 16 - str r0, [sp, 0x4] - lsrs r0, 16 - str r0, [sp] - adds r0, r5, 0 - movs r1, 0x27 - bl pokemon_getattr - adds r7, r0, 0 - movs r6, 0xF - ands r7, r6 - adds r0, r5, 0 - movs r1, 0x28 - bl pokemon_getattr - mov r8, r0 - mov r1, r8 - ands r1, r6 - mov r8, r1 - adds r0, r5, 0 - movs r1, 0x29 - bl pokemon_getattr - mov r9, r0 - mov r3, r9 - ands r3, r6 - mov r9, r3 - adds r0, r5, 0 - movs r1, 0x2A - bl pokemon_getattr - mov r10, r0 - ands r0, r6 - mov r10, r0 - adds r0, r5, 0 - movs r1, 0x2B - bl pokemon_getattr - adds r4, r0, 0 - ands r4, r6 - adds r0, r5, 0 - movs r1, 0x2C - bl pokemon_getattr - adds r2, r0, 0 - ands r2, r6 - mov r1, r8 - mov r3, r9 - eors r1, r3 - mov r8, r1 - mov r0, r8 - muls r0, r7 - movs r1, 0xFF - ldr r3, [sp] - ands r3, r1 - eors r0, r3 - eors r4, r2 - mov r1, r10 - muls r1, r4 - ldr r3, [sp, 0x4] - lsrs r2, r3, 24 - eors r1, r2 - lsls r0, 8 - adds r0, r1 - 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_80F97C8 - - thumb_func_start sub_80F986C -sub_80F986C: @ 80F986C - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - movs r1, 0x1 - ldr r3, =gUnknown_0858D8F0 -_080F9876: - lsls r0, r1, 3 - adds r0, r3 - ldrh r0, [r0, 0x4] - cmp r2, r0 - bcs _080F988C - subs r0, r1, 0x1 - lsls r0, 24 - lsrs r0, 24 - b _080F9898 - .pool -_080F988C: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xE - bls _080F9876 - adds r0, r1, 0 -_080F9898: - pop {r1} - bx r1 - thumb_func_end sub_80F986C - - thumb_func_start sub_80F989C -sub_80F989C: @ 80F989C - push {r4-r7,lr} - sub sp, 0x8 - adds r6, r1, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r6, 16 - lsrs r6, 16 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - bl sub_80C0630 - lsls r0, 16 - lsrs r7, r0, 16 - adds r0, r6, 0 - bl sub_80F986C - lsls r0, 24 - ldr r1, =gUnknown_0858D8F0 - lsrs r0, 21 - adds r0, r1 - ldrh r1, [r0] - str r1, [sp] - movs r2, 0 - str r2, [sp, 0x4] - ldrb r2, [r0, 0x2] - movs r3, 0 - ldrh r4, [r0, 0x4] - movs r5, 0 - adds r0, r6, 0 - movs r1, 0 - subs r0, r4 - sbcs r1, r5 - bl __udivdi3 - ldr r2, [sp] - ldr r3, [sp, 0x4] - adds r2, r0 - adcs r3, r1 - str r2, [sp] - str r3, [sp, 0x4] - adds r0, r7, 0 - movs r1, 0 - bl __muldi3 - movs r2, 0xA - movs r3, 0 - bl __udivdi3 - add sp, 0x8 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80F989C - - thumb_func_start sub_80F9910 -sub_80F9910: @ 80F9910 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r4, r1, 2 - adds r4, r1 - lsls r4, 1 - adds r0, r4, 0 - bl __floatsidf - cmp r4, 0 - bge _080F992C - ldr r3, _080F9974 - ldr r2, _080F9970 - bl __adddf3 -_080F992C: - ldr r2, _080F9978 - ldr r3, _080F997C - bl __divdf3 - bl __fixunsdfsi - adds r4, r0, 0 - movs r1, 0xA - bl __udivsi3 - adds r1, r0, 0 - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x8 - bl ConvertIntToDecimalString - adds r5, r0, 0 - ldr r1, _080F9980 - bl AppendString - adds r5, r0, 0 - adds r0, r4, 0 - movs r1, 0xA - bl __umodsi3 - adds r1, r0, 0 - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalString - pop {r4,r5} - pop {r0} - bx r0 - .align 2, 0 -_080F9970: .4byte 0x41f00000 -_080F9974: .4byte 0x00000000 -_080F9978: .4byte 0x40396666 -_080F997C: .4byte 0x66666666 -_080F9980: .4byte gUnknown_085EED24 - thumb_func_end sub_80F9910 - - thumb_func_start sub_80F9984 -sub_80F9984: @ 80F9984 - push {r4-r7,lr} - sub sp, 0x4 - adds r7, r1, 0 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r1, =0x020375f0 - ldrh r0, [r1] - cmp r0, 0xFF - bne _080F99A0 - movs r0, 0 - b _080F9A0A - .pool -_080F99A0: - ldrh r1, [r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0x1 - beq _080F99C2 - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, r6 - beq _080F99CC -_080F99C2: - movs r0, 0x1 - b _080F9A0A - .pool -_080F99CC: - mov r4, sp - adds r0, r5, 0 - bl sub_80F97C8 - strh r0, [r4] - mov r0, sp - ldrh r1, [r0] - adds r0, r6, 0 - bl sub_80F989C - adds r5, r0, 0 - ldrh r1, [r7] - adds r0, r6, 0 - bl sub_80F989C - adds r4, r0, 0 - ldr r0, =0x02021dc4 - adds r1, r5, 0 - bl sub_80F9910 - cmp r5, r4 - bls _080F9A08 - mov r0, sp - ldrh r0, [r0] - strh r0, [r7] - movs r0, 0x3 - b _080F9A0A - .pool -_080F9A08: - movs r0, 0x2 -_080F9A0A: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80F9984 - - thumb_func_start sub_80F9A14 -sub_80F9A14: @ 80F9A14 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 16 - lsrs r4, 16 - ldrh r1, [r5] - adds r0, r4, 0 - bl sub_80F989C - adds r1, r0, 0 - ldr r0, =0x02021ec4 - bl sub_80F9910 - ldr r0, =0x02021cc4 - movs r1, 0xB - muls r1, r4 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldrh r1, [r5] - movs r0, 0x80 - lsls r0, 8 - cmp r1, r0 - bne _080F9A64 - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085ECF6B - bl CopyString - b _080F9A6E - .pool -_080F9A64: - ldr r0, =0x02021dc4 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString -_080F9A6E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F9A14 - - thumb_func_start sub_80F9A7C -sub_80F9A7C: @ 80F9A7C - push {lr} - ldr r0, =0x00004047 - movs r1, 0x80 - lsls r1, 8 - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F9A7C - - thumb_func_start sub_80F9A90 -sub_80F9A90: @ 80F9A90 - push {lr} - ldr r0, =0x00004047 - bl GetVarPointer - adds r1, r0, 0 - movs r0, 0x95 - lsls r0, 1 - bl sub_80F9A14 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F9A90 - - thumb_func_start sub_80F9AAC -sub_80F9AAC: @ 80F9AAC - push {r4,lr} - ldr r0, =0x00004047 - bl GetVarPointer - adds r1, r0, 0 - ldr r4, =0x020375f0 - movs r0, 0x95 - lsls r0, 1 - bl sub_80F9984 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F9AAC - - thumb_func_start sub_80F9AD4 -sub_80F9AD4: @ 80F9AD4 - push {lr} - ldr r0, =0x0000404f - movs r1, 0x80 - lsls r1, 8 - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F9AD4 - - thumb_func_start sub_80F9AE8 -sub_80F9AE8: @ 80F9AE8 - push {lr} - ldr r0, =0x0000404f - bl GetVarPointer - adds r1, r0, 0 - ldr r0, =0x00000127 - bl sub_80F9A14 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F9AE8 - - thumb_func_start sub_80F9B04 -sub_80F9B04: @ 80F9B04 - push {r4,lr} - ldr r0, =0x0000404f - bl GetVarPointer - adds r1, r0, 0 - ldr r4, =0x020375f0 - ldr r0, =0x00000127 - bl sub_80F9984 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F9B04 - - thumb_func_start sub_80F9B30 -sub_80F9B30: @ 80F9B30 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - movs r7, 0 - add r4, sp, 0x8 - movs r0, 0x1 - strb r0, [r4] - ldr r1, =gUnknown_0858D970 - mov r0, sp - movs r2, 0x7 - bl memcpy - mov r8, r4 - cmp r6, 0xA - bhi _080F9BAC - cmp r5, 0x40 - bhi _080F9BAC - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000031a8 - adds r0, r1 - adds r0, r6 - strb r5, [r0] - movs r5, 0 -_080F9B6A: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _080F9B9C - adds r0, r4, 0 - movs r1, 0x6 - bl pokemon_getattr - cmp r0, 0 - bne _080F9B9C - mov r1, sp - adds r0, r1, r6 - ldrb r1, [r0] - adds r0, r4, 0 - mov r2, r8 - bl pokemon_setattr - movs r7, 0x1 -_080F9B9C: - adds r5, 0x1 - cmp r5, 0x5 - ble _080F9B6A - cmp r7, 0 - beq _080F9BAC - ldr r0, =0x0000089b - bl FlagSet -_080F9BAC: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F9B30 - - thumb_func_start sub_80F9BCC -sub_80F9BCC: @ 80F9BCC - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r3, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =sub_80F9C90 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_80F9C44 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F9BCC - - thumb_func_start sub_80F9BF4 -sub_80F9BF4: @ 80F9BF4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r3, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =sub_80F9DFC - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_80F9C44 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F9BF4 - - thumb_func_start sub_80F9C1C -sub_80F9C1C: @ 80F9C1C - push {lr} - ldr r0, =sub_80F9C90 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80F9C1C - - thumb_func_start sub_80F9C30 -sub_80F9C30: @ 80F9C30 - push {lr} - ldr r0, =sub_80F9DFC - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80F9C30 - - thumb_func_start sub_80F9C44 -sub_80F9C44: @ 80F9C44 - push {r4,r5,lr} - lsls r1, 16 - lsrs r4, r1, 16 - adds r5, r4, 0 - lsls r3, 24 - lsrs r3, 24 - adds r1, r3, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - adds r2, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0, r1 - movs r0, 0 - strh r0, [r1, 0x8] - movs r0, 0x10 - cmp r4, 0 - beq _080F9C72 - adds r0, r4, 0 -_080F9C72: - strh r0, [r1, 0xA] - movs r0, 0x14 - cmp r5, 0 - beq _080F9C7C - adds r0, r5, 0 -_080F9C7C: - strh r0, [r1, 0xC] - ldr r1, [r1] - adds r0, r2, 0 - bl _call_via_r1 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F9C44 - - thumb_func_start sub_80F9C90 -sub_80F9C90: @ 80F9C90 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080F9D10 - cmp r0, 0x1 - bgt _080F9CB8 - cmp r0, 0 - beq _080F9CC2 - b _080F9DDE - .pool -_080F9CB8: - cmp r0, 0x2 - beq _080F9D32 - cmp r0, 0x3 - beq _080F9D94 - b _080F9DDE -_080F9CC2: - movs r0, 0x78 - strh r0, [r4, 0xE] - strh r0, [r4, 0x10] - movs r0, 0x50 - strh r0, [r4, 0x12] - movs r0, 0x51 - strh r0, [r4, 0x14] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl SetGpuRegBits - ldrh r1, [r4, 0xE] - lsls r1, 8 - ldrh r0, [r4, 0x10] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x40 - bl SetGpuReg - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x14] - 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, 0 - bl SetGpuReg - b _080F9DEE -_080F9D10: - movs r0, 0x50 - bl GetGpuReg - strh r0, [r4, 0x16] - movs r0, 0x54 - bl GetGpuReg - strh r0, [r4, 0x18] - movs r0, 0x50 - movs r1, 0xBF - bl SetGpuReg - movs r0, 0x54 - movs r1, 0x10 - bl SetGpuReg - b _080F9DEE -_080F9D32: - ldrh r0, [r4, 0xE] - ldrh r1, [r4, 0xA] - subs r0, r1 - movs r5, 0 - strh r0, [r4, 0xE] - ldrh r2, [r4, 0x10] - adds r1, r2 - strh r1, [r4, 0x10] - lsls r0, 16 - cmp r0, 0 - ble _080F9D50 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xEF - ble _080F9D76 -_080F9D50: - strh r5, [r4, 0xE] - movs r0, 0xF0 - strh r0, [r4, 0x10] - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - ldrh r1, [r4, 0x16] - movs r0, 0x50 - bl SetGpuReg - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - movs r2, 0 - bl sub_80A2A20 - ldr r0, =0x02037b14 - strh r5, [r0] -_080F9D76: - ldrh r1, [r4, 0xE] - lsls r1, 8 - ldrh r0, [r4, 0x10] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x40 - bl SetGpuReg - movs r1, 0xE - ldrsh r0, [r4, r1] - b _080F9DD8 - .pool -_080F9D94: - ldrh r0, [r4, 0x12] - ldrh r1, [r4, 0xC] - subs r0, r1 - strh r0, [r4, 0x12] - ldrh r2, [r4, 0x14] - adds r1, r2 - strh r1, [r4, 0x14] - lsls r0, 16 - cmp r0, 0 - ble _080F9DB0 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x9F - ble _080F9DC2 -_080F9DB0: - movs r0, 0 - strh r0, [r4, 0x12] - movs r0, 0xA0 - strh r0, [r4, 0x14] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl ClearGpuRegBits -_080F9DC2: - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x14] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r1, 0x12 - ldrsh r0, [r4, r1] -_080F9DD8: - cmp r0, 0 - bne _080F9DF4 - b _080F9DEE -_080F9DDE: - ldrh r1, [r4, 0x16] - movs r0, 0x50 - bl SetGpuReg - adds r0, r5, 0 - bl DestroyTask - b _080F9DF4 -_080F9DEE: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080F9DF4: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80F9C90 - - thumb_func_start sub_80F9DFC -sub_80F9DFC: @ 80F9DFC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _080F9E38 - cmp r1, 0x1 - bgt _080F9E24 - cmp r1, 0 - beq _080F9E2E - b _080F9F2C - .pool -_080F9E24: - cmp r1, 0x2 - beq _080F9E86 - cmp r1, 0x3 - beq _080F9ED8 - b _080F9F2C -_080F9E2E: - ldr r0, =0x02037b14 - strh r1, [r0] - b _080F9F4E - .pool -_080F9E38: - movs r1, 0 - strh r1, [r4, 0xE] - movs r0, 0xF0 - strh r0, [r4, 0x10] - strh r1, [r4, 0x12] - movs r0, 0xA0 - strh r0, [r4, 0x14] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl SetGpuRegBits - ldrh r1, [r4, 0xE] - lsls r1, 8 - ldrh r0, [r4, 0x10] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x40 - bl SetGpuReg - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x14] - 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, 0 - bl SetGpuReg - b _080F9F4E -_080F9E86: - ldrh r0, [r4, 0xC] - ldrh r2, [r4, 0x12] - adds r1, r0, r2 - strh r1, [r4, 0x12] - ldrh r2, [r4, 0x14] - subs r0, r2, r0 - strh r0, [r4, 0x14] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x4F - bgt _080F9EA4 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x51 - bgt _080F9EBC -_080F9EA4: - movs r0, 0x50 - strh r0, [r4, 0x12] - movs r0, 0x51 - strh r0, [r4, 0x14] - movs r0, 0x50 - movs r1, 0xBF - bl SetGpuReg - movs r0, 0x54 - movs r1, 0x10 - bl SetGpuReg -_080F9EBC: - ldrh r1, [r4, 0x12] - lsls r1, 8 - ldrh r0, [r4, 0x14] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0x50 - bne _080F9F54 - b _080F9F4E -_080F9ED8: - ldrh r0, [r4, 0xA] - ldrh r2, [r4, 0xE] - adds r1, r0, r2 - strh r1, [r4, 0xE] - ldrh r2, [r4, 0x10] - subs r0, r2, r0 - strh r0, [r4, 0x10] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x77 - bgt _080F9EF6 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x78 - bgt _080F9F0C -_080F9EF6: - movs r0, 0x78 - strh r0, [r4, 0xE] - strh r0, [r4, 0x10] - subs r0, 0x79 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - ldr r1, =0x02037b14 - movs r0, 0 - strh r0, [r1] -_080F9F0C: - ldrh r1, [r4, 0xE] - lsls r1, 8 - ldrh r0, [r4, 0x10] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x40 - bl SetGpuReg - movs r1, 0xE - ldrsh r0, [r4, r1] - cmp r0, 0x78 - bne _080F9F54 - b _080F9F4E - .pool -_080F9F2C: - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - bl ClearGpuRegBits - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - adds r0, r5, 0 - bl DestroyTask - b _080F9F54 -_080F9F4E: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080F9F54: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80F9DFC - - thumb_func_start sub_80F9F5C -sub_80F9F5C: @ 80F9F5C - push {lr} - ldr r0, =0x0203ab40 - ldr r1, =0x02037318 - ldr r1, [r1, 0x4] - bl sub_80E9608 - bl sub_80E8B6C - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F9F5C - - thumb_func_start sub_80F9F78 -sub_80F9F78: @ 80F9F78 - push {lr} - ldr r0, =0x02037590 - ldrb r1, [r0] - movs r0, 0x6 - ands r0, r1 - cmp r0, 0 - beq _080F9FC0 - ldr r1, =0x02038c08 - ldr r0, [r1, 0x4] - cmp r0, 0x2 - beq _080F9FAE - cmp r0, 0x2 - bgt _080F9FA0 - cmp r0, 0x1 - beq _080F9FA6 - b _080F9FFE - .pool -_080F9FA0: - cmp r0, 0x3 - beq _080F9FB6 - b _080F9FDC -_080F9FA6: - movs r0, 0x10 - str r0, [r1, 0x14] - movs r0, 0x28 - b _080F9FFC -_080F9FAE: - movs r0, 0x10 - str r0, [r1, 0x14] - movs r0, 0x8 - b _080F9FFC -_080F9FB6: - movs r0, 0x8 - negs r0, r0 - str r0, [r1, 0x14] - movs r0, 0x18 - b _080F9FFC -_080F9FC0: - ldr r1, =0x02038c08 - ldr r0, [r1, 0x4] - cmp r0, 0x2 - beq _080F9FEA - cmp r0, 0x2 - bgt _080F9FD8 - cmp r0, 0x1 - beq _080F9FE2 - b _080F9FFE - .pool -_080F9FD8: - cmp r0, 0x3 - beq _080F9FEE -_080F9FDC: - cmp r0, 0x4 - beq _080F9FF8 - b _080F9FFE -_080F9FE2: - movs r0, 0x8 - str r0, [r1, 0x14] - movs r0, 0x28 - b _080F9FFC -_080F9FEA: - movs r0, 0x8 - b _080F9FFA -_080F9FEE: - movs r0, 0x8 - negs r0, r0 - str r0, [r1, 0x14] - movs r0, 0x18 - b _080F9FFC -_080F9FF8: - movs r0, 0x18 -_080F9FFA: - str r0, [r1, 0x14] -_080F9FFC: - str r0, [r1, 0x18] -_080F9FFE: - pop {r0} - bx r0 - thumb_func_end sub_80F9F78 - - thumb_func_start sub_80FA004 -sub_80FA004: @ 80FA004 - push {r4,lr} - bl sub_80E8BC8 - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0x1 - beq _080FA0AE - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _080FA0AE - ldr r4, =0x0203ab40 - adds r1, r4, 0x2 - adds r0, r4, 0 - bl GetXYCoordsOneStepInFrontOfPlayer - movs r1, 0 - ldrsh r0, [r4, r1] - movs r2, 0x2 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_808923C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080FA070 - bl sub_80F9F5C - ldr r1, =0x03005db0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =0x0203ceec - ldr r0, =sub_80FA0DC - b _080FA0C0 - .pool -_080FA070: - adds r0, r4, 0 - bl sub_808925C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080FA0A0 - bl sub_80F9F5C - ldr r1, =0x03005db0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =0x0203ceec - ldr r0, =sub_80FA1E8 - b _080FA0C0 - .pool -_080FA0A0: - adds r0, r4, 0 - bl is_tile_x98 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080FA0B2 -_080FA0AE: - movs r0, 0 - b _080FA0C4 -_080FA0B2: - bl sub_80F9F5C - ldr r1, =0x03005db0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =0x0203ceec - ldr r0, =sub_80FA34C -_080FA0C0: - str r0, [r1] - movs r0, 0x1 -_080FA0C4: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80FA004 - - thumb_func_start sub_80FA0DC -sub_80FA0DC: @ 80FA0DC - push {lr} - bl brm_get_pokemon_selection - ldr r1, =0x02038c08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - ldr r0, =gUnknown_08275A86 - bl script_env_1_execute_new_script - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FA0DC - - thumb_func_start oei_sweet_scent -oei_sweet_scent: @ 80FA0FC - push {lr} - bl oei_task_add - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =sub_80FA128 - lsrs r0, r2, 16 - strh r0, [r1, 0x18] - strh r2, [r1, 0x1A] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end oei_sweet_scent - - thumb_func_start sub_80FA128 -sub_80FA128: @ 80FA128 - push {lr} - movs r0, 0xB - bl FieldEffectActiveListRemove - movs r0, 0x37 - bl FieldEffectStart - pop {r0} - bx r0 - thumb_func_end sub_80FA128 - - thumb_func_start sub_80FA13C -sub_80FA13C: @ 80FA13C - push {r4,lr} - bl sub_80F9F78 - ldr r0, =gUnknown_0858E600 - ldr r3, =0x02020630 - ldr r1, =0x02037590 - ldrb r1, [r1, 0x4] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r3 - ldrh r1, [r2, 0x2] - lsls r1, 23 - lsrs r1, 23 - ldr r4, =0x02038c08 - ldr r3, [r4, 0x14] - adds r1, r3 - lsls r1, 16 - asrs r1, 16 - ldrb r2, [r2] - ldr r3, [r4, 0x18] - adds r2, r3 - lsls r2, 16 - asrs r2, 16 - movs r3, 0x94 - bl AddObjectToFront - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80FA13C - - thumb_func_start sub_80FA18C -sub_80FA18C: @ 80FA18C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x83 - bl audio_play - movs r0, 0 - strh r0, [r4, 0x2E] - ldr r0, =sub_80FA1A8 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FA18C - - thumb_func_start sub_80FA1A8 -sub_80FA1A8: @ 80FA1A8 - push {lr} - adds r1, r0, 0 - ldrh r2, [r1, 0x2E] - movs r3, 0x2E - ldrsh r0, [r1, r3] - cmp r0, 0x27 - bgt _080FA1C8 - adds r0, r2, 0x1 - strh r0, [r1, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - bne _080FA1D0 - bl sub_80E8D4C - b _080FA1D0 -_080FA1C8: - movs r0, 0 - strh r0, [r1, 0x2E] - ldr r0, =sub_80FA1D8 - str r0, [r1, 0x1C] -_080FA1D0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FA1A8 - - thumb_func_start sub_80FA1D8 -sub_80FA1D8: @ 80FA1D8 - push {lr} - movs r1, 0x37 - bl FieldEffectStop - bl script_env_2_enable_and_set_ctx_running - pop {r0} - bx r0 - thumb_func_end sub_80FA1D8 - - thumb_func_start sub_80FA1E8 -sub_80FA1E8: @ 80FA1E8 - push {lr} - bl brm_get_pokemon_selection - ldr r1, =0x02038c08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - ldr r0, =gUnknown_08275ADF - bl script_env_1_execute_new_script - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FA1E8 - - thumb_func_start sub_80FA208 -sub_80FA208: @ 80FA208 - push {lr} - bl oei_task_add - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =sub_80FA234 - lsrs r0, r2, 16 - strh r0, [r1, 0x18] - strh r2, [r1, 0x1A] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80FA208 - - thumb_func_start sub_80FA234 -sub_80FA234: @ 80FA234 - push {lr} - movs r0, 0x1A - bl FieldEffectActiveListRemove - movs r0, 0x38 - bl FieldEffectStart - pop {r0} - bx r0 - thumb_func_end sub_80FA234 - - thumb_func_start sub_80FA248 -sub_80FA248: @ 80FA248 - push {r4,lr} - ldr r1, =0x0203ab40 - movs r2, 0 - ldrsh r0, [r1, r2] - movs r2, 0x2 - ldrsh r1, [r1, r2] - bl MapGridGetMetatileBehaviorAt - adds r2, r0, 0 - ldr r1, =0x00000fff - adds r0, r1, 0 - ands r2, r0 - cmp r2, 0x96 - bne _080FA26A - ldr r1, =0x02038c08 - movs r0, 0 - str r0, [r1, 0x1C] -_080FA26A: - cmp r2, 0x9C - bne _080FA274 - ldr r1, =0x02038c08 - movs r0, 0x2 - str r0, [r1, 0x1C] -_080FA274: - bl sub_80F9F78 - ldr r0, =gUnknown_0858E618 - ldr r3, =0x02020630 - ldr r1, =0x02037590 - ldrb r1, [r1, 0x4] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r3 - ldrh r1, [r2, 0x2] - lsls r1, 23 - lsrs r1, 23 - ldr r4, =0x02038c08 - ldr r3, [r4, 0x14] - adds r1, r3 - lsls r1, 16 - asrs r1, 16 - ldrb r2, [r2] - ldr r3, [r4, 0x18] - adds r2, r3 - lsls r2, 16 - asrs r2, 16 - movs r3, 0x94 - bl AddObjectToFront - ldr r0, [r4, 0x1C] - cmp r0, 0x1 - beq _080FA2B2 - cmp r0, 0x3 - bne _080FA2B6 -_080FA2B2: - bl sub_80E8D4C -_080FA2B6: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80FA248 - - thumb_func_start sub_80FA2D8 -sub_80FA2D8: @ 80FA2D8 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x9B - bl audio_play - ldr r0, =0x02038c08 - ldr r1, [r0, 0x1C] - adds r2, r4, 0 - adds r2, 0x2A - movs r0, 0 - strb r1, [r2] - strh r0, [r4, 0x2E] - ldr r0, =sub_80FA304 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FA2D8 - - thumb_func_start sub_80FA304 -sub_80FA304: @ 80FA304 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x27 - ble _080FA32E - ldr r0, =0x02038c08 - ldr r0, [r0, 0x1C] - cmp r0, 0 - beq _080FA322 - cmp r0, 0x2 - bne _080FA326 -_080FA322: - bl sub_80E8D4C -_080FA326: - movs r0, 0 - strh r0, [r4, 0x2E] - ldr r0, =sub_80FA33C - str r0, [r4, 0x1C] -_080FA32E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FA304 - - thumb_func_start sub_80FA33C -sub_80FA33C: @ 80FA33C - push {lr} - movs r1, 0x38 - bl FieldEffectStop - bl script_env_2_enable_and_set_ctx_running - pop {r0} - bx r0 - thumb_func_end sub_80FA33C - - thumb_func_start sub_80FA34C -sub_80FA34C: @ 80FA34C - push {lr} - bl brm_get_pokemon_selection - ldr r1, =0x02038c08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - ldr r0, =gUnknown_08275B38 - bl script_env_1_execute_new_script - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FA34C - - thumb_func_start sub_80FA36C -sub_80FA36C: @ 80FA36C - push {lr} - bl oei_task_add - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =sub_80FA398 - lsrs r0, r2, 16 - strh r0, [r1, 0x18] - strh r2, [r1, 0x1A] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80FA36C - - thumb_func_start sub_80FA398 -sub_80FA398: @ 80FA398 - push {lr} - movs r0, 0x1B - bl FieldEffectActiveListRemove - movs r0, 0x39 - bl FieldEffectStart - pop {r0} - bx r0 - thumb_func_end sub_80FA398 - - thumb_func_start sub_80FA3AC -sub_80FA3AC: @ 80FA3AC - push {r4,lr} - bl sub_80F9F78 - ldr r0, =gUnknown_0858E630 - ldr r3, =0x02020630 - ldr r1, =0x02037590 - ldrb r1, [r1, 0x4] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r3 - ldrh r1, [r2, 0x2] - lsls r1, 23 - lsrs r1, 23 - ldr r4, =0x02038c08 - ldr r3, [r4, 0x14] - adds r1, r3 - lsls r1, 16 - asrs r1, 16 - ldrb r2, [r2] - ldr r3, [r4, 0x18] - adds r2, r3 - lsls r2, 16 - asrs r2, 16 - movs r3, 0x94 - bl AddObjectToFront - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80FA3AC - - thumb_func_start sub_80FA3FC -sub_80FA3FC: @ 80FA3FC - push {r4,lr} - adds r4, r0, 0 - movs r0, 0xA9 - bl audio_play - movs r0, 0 - strh r0, [r4, 0x2E] - ldr r0, =sub_80FA418 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FA3FC - - thumb_func_start sub_80FA418 -sub_80FA418: @ 80FA418 - push {lr} - adds r1, r0, 0 - ldrh r2, [r1, 0x2E] - movs r3, 0x2E - ldrsh r0, [r1, r3] - cmp r0, 0x27 - bgt _080FA438 - adds r0, r2, 0x1 - strh r0, [r1, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - bne _080FA440 - bl sub_80E8D4C - b _080FA440 -_080FA438: - movs r0, 0 - strh r0, [r1, 0x2E] - ldr r0, =sub_80FA448 - str r0, [r1, 0x1C] -_080FA440: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FA418 - - thumb_func_start sub_80FA448 -sub_80FA448: @ 80FA448 - push {lr} - movs r1, 0x39 - bl FieldEffectStop - bl script_env_2_enable_and_set_ctx_running - pop {r0} - bx r0 - thumb_func_end sub_80FA448 - - thumb_func_start sub_80FA458 -sub_80FA458: @ 80FA458 - push {r4,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl GetXYCoordsOneStepInFrontOfPlayer - ldr r0, =sub_80FA4A0 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - mov r0, sp - ldrh r0, [r0] - movs r2, 0 - strh r0, [r1, 0x8] - ldrh r0, [r4] - strh r0, [r1, 0xA] - strh r2, [r1, 0xC] - movs r0, 0 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80FA458 - - thumb_func_start sub_80FA4A0 -sub_80FA4A0: @ 80FA4A0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldrh r0, [r4, 0x4] - subs r0, 0x4 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - bhi _080FA56E - lsls r0, 2 - ldr r1, =_080FA4D0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080FA4D0: - .4byte _080FA514 - .4byte _080FA56E - .4byte _080FA56E - .4byte _080FA56E - .4byte _080FA522 - .4byte _080FA56E - .4byte _080FA56E - .4byte _080FA56E - .4byte _080FA514 - .4byte _080FA56E - .4byte _080FA56E - .4byte _080FA56E - .4byte _080FA522 - .4byte _080FA56E - .4byte _080FA56E - .4byte _080FA56E - .4byte _080FA540 -_080FA514: - movs r1, 0 - ldrsh r0, [r4, r1] - movs r2, 0x2 - ldrsh r1, [r4, r2] - movs r2, 0x89 - lsls r2, 2 - b _080FA52E -_080FA522: - movs r1, 0 - ldrsh r0, [r4, r1] - movs r2, 0x2 - ldrsh r1, [r4, r2] - movs r2, 0x88 - lsls r2, 2 -_080FA52E: - bl MapGridSetMetatileIdAt - movs r1, 0 - ldrsh r0, [r4, r1] - movs r2, 0x2 - ldrsh r1, [r4, r2] - bl CurrentMapDrawMetatileAt - b _080FA56E -_080FA540: - movs r1, 0 - ldrsh r0, [r4, r1] - movs r2, 0x2 - ldrsh r1, [r4, r2] - movs r2, 0x89 - lsls r2, 2 - bl MapGridSetMetatileIdAt - movs r1, 0 - ldrsh r0, [r4, r1] - movs r2, 0x2 - ldrsh r1, [r4, r2] - bl CurrentMapDrawMetatileAt - movs r0, 0x3D - bl FieldEffectActiveListRemove - bl script_env_2_enable_and_set_ctx_running - adds r0, r5, 0 - bl DestroyTask - b _080FA574 -_080FA56E: - ldrh r0, [r4, 0x4] - adds r0, 0x1 - strh r0, [r4, 0x4] -_080FA574: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80FA4A0 - - thumb_func_start sub_80FA57C -sub_80FA57C: @ 80FA57C - push {r4,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl GetXYCoordsOneStepInFrontOfPlayer - movs r0, 0x3 - bl audio_play - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - bne _080FA5B8 - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - movs r2, 0xE2 - lsls r2, 4 - bl MapGridSetMetatileIdAt - b _080FA5C8 - .pool -_080FA5B8: - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - ldr r2, =0x00000e21 - bl MapGridSetMetatileIdAt -_080FA5C8: - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl CurrentMapDrawMetatileAt - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FA57C - - thumb_func_start sub_80FA5E4 -sub_80FA5E4: @ 80FA5E4 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 16 - lsrs r6, 16 - ldr r0, =sub_80FA62C - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0 - strh r4, [r1, 0x8] - strh r5, [r1, 0xA] - strh r6, [r1, 0xC] - strh r0, [r1, 0xE] - movs r0, 0x1 - strh r0, [r1, 0x10] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FA5E4 - - thumb_func_start sub_80FA62C -sub_80FA62C: @ 80FA62C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldrh r1, [r4, 0x6] - movs r2, 0x6 - ldrsh r0, [r4, r2] - cmp r0, 0x6 - bne _080FA650 - movs r0, 0 - b _080FA652 - .pool -_080FA650: - adds r0, r1, 0x1 -_080FA652: - strh r0, [r4, 0x6] - movs r3, 0x6 - ldrsh r0, [r4, r3] - cmp r0, 0 - bne _080FA6A4 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x2 - bne _080FA66C - movs r2, 0 - ldrsh r0, [r4, r2] - bl sub_80FA6AC -_080FA66C: - movs r3, 0x2 - ldrsh r0, [r4, r3] - movs r2, 0x4 - ldrsh r1, [r4, r2] - ldrh r2, [r4, 0x8] - ldrh r3, [r4] - adds r2, r3 - lsls r2, 16 - lsrs r2, 16 - bl MapGridSetMetatileIdAt - movs r1, 0x2 - ldrsh r0, [r4, r1] - movs r2, 0x4 - ldrsh r1, [r4, r2] - bl CurrentMapDrawMetatileAt - ldrh r1, [r4, 0x8] - movs r3, 0x8 - ldrsh r0, [r4, r3] - cmp r0, 0x3 - bne _080FA6A0 - adds r0, r5, 0 - bl DestroyTask - b _080FA6A4 -_080FA6A0: - adds r0, r1, 0x1 - strh r0, [r4, 0x8] -_080FA6A4: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80FA62C - - thumb_func_start sub_80FA6AC -sub_80FA6AC: @ 80FA6AC - push {lr} - lsls r0, 16 - asrs r1, r0, 16 - movs r0, 0xCE - lsls r0, 2 - cmp r1, r0 - beq _080FA6D8 - cmp r1, r0 - bgt _080FA6C8 - movs r0, 0x8A - lsls r0, 2 - cmp r1, r0 - beq _080FA6F0 - b _080FA6F6 -_080FA6C8: - movs r0, 0xCF - lsls r0, 2 - cmp r1, r0 - beq _080FA6E0 - adds r0, 0x4 - cmp r1, r0 - beq _080FA6E8 - b _080FA6F6 -_080FA6D8: - movs r0, 0x4A - bl audio_play - b _080FA6F6 -_080FA6E0: - movs r0, 0x4B - bl audio_play - b _080FA6F6 -_080FA6E8: - movs r0, 0x4C - bl audio_play - b _080FA6F6 -_080FA6F0: - movs r0, 0x4E - bl audio_play -_080FA6F6: - pop {r0} - bx r0 - thumb_func_end sub_80FA6AC - - thumb_func_start sub_80FA6FC -sub_80FA6FC: @ 80FA6FC - movs r0, 0 - bx lr - thumb_func_end sub_80FA6FC - - thumb_func_start sub_80FA700 -sub_80FA700: @ 80FA700 - movs r0, 0 - bx lr - thumb_func_end sub_80FA700 - - thumb_func_start sub_80FA704 -sub_80FA704: @ 80FA704 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r1, 0 - lsls r5, 16 - lsrs r5, 16 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0x4D - bl audio_play - lsls r5, 16 - asrs r5, 16 - lsls r4, 16 - asrs r4, 16 - ldr r2, =0x00000276 - adds r0, r5, 0 - adds r1, r4, 0 - bl MapGridSetMetatileIdAt - subs r6, r4, 0x1 - ldr r2, =0x0000026e - adds r0, r5, 0 - adds r1, r6, 0 - bl MapGridSetMetatileIdAt - adds r0, r5, 0 - adds r1, r4, 0 - bl CurrentMapDrawMetatileAt - adds r0, r5, 0 - adds r1, r6, 0 - bl CurrentMapDrawMetatileAt - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FA704 - - thumb_func_start sub_80FA754 -sub_80FA754: @ 80FA754 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - 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, 0x7 - bne _080FA788 - movs r2, 0xA - ldrsh r0, [r1, r2] - movs r3, 0xC - ldrsh r1, [r1, r3] - bl sub_80FA704 - adds r0, r4, 0 - bl DestroyTask - b _080FA78C - .pool -_080FA788: - adds r0, r2, 0x1 - strh r0, [r1, 0x8] -_080FA78C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80FA754 - - thumb_func_start sub_80FA794 -sub_80FA794: @ 80FA794 - push {r4-r7,lr} - lsls r0, 16 - lsrs r5, r0, 16 - adds r7, r5, 0 - lsls r1, 16 - lsrs r4, r1, 16 - adds r6, r4, 0 - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080FA7BC - lsls r0, r5, 16 - asrs r0, 16 - lsls r1, r4, 16 - asrs r1, 16 - bl sub_80FA704 - b _080FA7DE -_080FA7BC: - cmp r0, 0x2 - bne _080FA7DE - ldr r0, =sub_80FA754 - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0 - strh r0, [r1, 0x8] - strh r7, [r1, 0xA] - strh r6, [r1, 0xC] -_080FA7DE: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FA794 - - thumb_func_start sub_80FA7EC -sub_80FA7EC: @ 80FA7EC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r1 - ldrh r2, [r1, 0xA] - movs r3, 0xA - ldrsh r0, [r1, r3] - cmp r0, 0x7 - beq _080FA808 - b _080FA966 -_080FA808: - ldr r2, =0xfffffd88 - adds r0, r2, 0 - ldrh r1, [r1, 0x8] - adds r0, r1 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3B - bls _080FA81A - b _080FA95E -_080FA81A: - lsls r0, 2 - ldr r1, =_080FA830 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080FA830: - .4byte _080FA920 - .4byte _080FA928 - .4byte _080FA930 - .4byte _080FA938 - .4byte _080FA940 - .4byte _080FA948 - .4byte _080FA950 - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA95E - .4byte _080FA958 -_080FA920: - movs r0, 0x3E - bl audio_play - b _080FA95E -_080FA928: - movs r0, 0x3F - bl audio_play - b _080FA95E -_080FA930: - movs r0, 0x40 - bl audio_play - b _080FA95E -_080FA938: - movs r0, 0x41 - bl audio_play - b _080FA95E -_080FA940: - movs r0, 0x42 - bl audio_play - b _080FA95E -_080FA948: - movs r0, 0x43 - bl audio_play - b _080FA95E -_080FA950: - movs r0, 0x44 - bl audio_play - b _080FA95E -_080FA958: - movs r0, 0x45 - bl audio_play -_080FA95E: - adds r0, r4, 0 - bl DestroyTask - b _080FA96A -_080FA966: - adds r0, r2, 0x1 - strh r0, [r1, 0xA] -_080FA96A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80FA7EC - - thumb_func_start sub_80FA970 -sub_80FA970: @ 80FA970 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =sub_80FA7EC - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0 - strh r4, [r1, 0x8] - strh r0, [r1, 0xA] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FA970 - - thumb_func_start sub_80FA9A4 -sub_80FA9A4: @ 80FA9A4 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - bne _080FA9BC - movs r0, 0xC3 - bl audio_play -_080FA9BC: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1F - ble _080FA9CA - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_080FA9CA: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80FA9A4 - - thumb_func_start sub_80FA9D0 -sub_80FA9D0: @ 80FA9D0 - push {r4,lr} - sub sp, 0x4 - ldr r3, =0x02037350 - ldr r2, =0x02037590 - ldrb r1, [r2, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x10] - mov r0, sp - strh r1, [r0] - ldrb r1, [r2, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0, 0x12] - mov r4, sp - adds r4, 0x2 - strh r0, [r4] - mov r0, sp - adds r1, r4, 0 - movs r2, 0x8 - movs r3, 0x4 - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x58] - mov r1, sp - movs r2, 0 - ldrsh r1, [r1, r2] - movs r3, 0 - ldrsh r2, [r4, r3] - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _080FAA5E - ldr r3, =0x02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r4, r2, r3 - movs r0, 0x3E - adds r0, r4 - mov r12, r0 - ldrb r0, [r0] - movs r1, 0x2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - ldrb r1, [r4, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - movs r1, 0xF - ands r0, r1 - movs r1, 0x50 - orrs r0, r1 - strb r0, [r4, 0x5] - adds r3, 0x1C - adds r2, r3 - ldr r0, =sub_80FA9A4 - str r0, [r2] - movs r0, 0 - strh r0, [r4, 0x2E] -_080FAA5E: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FA9D0 - - thumb_func_start sub_80FAA7C -sub_80FAA7C: @ 80FAA7C - push {r4,lr} - sub sp, 0x4 - bl script_env_2_enable - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl GetXYCoordsOneStepInFrontOfPlayer - ldr r1, =0x02038c08 - mov r0, sp - movs r2, 0 - ldrsh r0, [r0, r2] - str r0, [r1, 0x14] - movs r3, 0 - ldrsh r0, [r4, r3] - str r0, [r1, 0x18] - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _080FAAFC - cmp r0, 0x2 - bgt _080FAABC - cmp r0, 0x1 - beq _080FAAC6 - b _080FAB8C - .pool -_080FAABC: - cmp r0, 0x3 - beq _080FAB2C - cmp r0, 0x4 - beq _080FAB64 - b _080FAB8C -_080FAAC6: - ldr r0, =gUnknown_0858E68C - ldr r3, =0x02020630 - ldr r1, =0x02037590 - ldrb r1, [r1, 0x4] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r3 - ldrh r1, [r2, 0x2] - lsls r1, 23 - lsrs r1, 7 - movs r3, 0x80 - lsls r3, 12 - adds r1, r3 - asrs r1, 16 - ldrb r2, [r2] - adds r2, 0x20 - movs r3, 0 - bl AddObjectToFront - b _080FAB8C - .pool -_080FAAFC: - ldr r0, =gUnknown_0858E68C - ldr r3, =0x02020630 - ldr r1, =0x02037590 - ldrb r1, [r1, 0x4] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r3 - ldrh r1, [r2, 0x2] - lsls r1, 23 - lsrs r1, 7 - movs r3, 0x80 - lsls r3, 12 - adds r1, r3 - asrs r1, 16 - ldrb r2, [r2] - b _080FAB4C - .pool -_080FAB2C: - ldr r0, =gUnknown_0858E68C - ldr r3, =0x02020630 - ldr r1, =0x02037590 - ldrb r1, [r1, 0x4] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r3 - ldrh r1, [r2, 0x2] - lsls r1, 23 - lsrs r1, 7 - ldr r3, =0xfff80000 - adds r1, r3 - asrs r1, 16 - ldrb r2, [r2] - adds r2, 0x10 -_080FAB4C: - movs r3, 0x94 - bl AddObjectToFront - b _080FAB8C - .pool -_080FAB64: - ldr r0, =gUnknown_0858E68C - ldr r3, =0x02020630 - ldr r1, =0x02037590 - ldrb r1, [r1, 0x4] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r3 - ldrh r1, [r2, 0x2] - lsls r1, 23 - lsrs r1, 7 - movs r3, 0xC0 - lsls r3, 13 - adds r1, r3 - asrs r1, 16 - ldrb r2, [r2] - adds r2, 0x10 - movs r3, 0x94 - bl AddObjectToFront -_080FAB8C: - movs r0, 0 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80FAA7C - - thumb_func_start door_restore_tilemap -door_restore_tilemap: @ 80FABA4 - push {r4,r5,lr} - adds r5, r0, 0 - movs r0, 0x83 - bl audio_play - ldr r4, =0x02038c08 - ldr r0, [r4, 0x14] - ldr r1, [r4, 0x18] - subs r1, 0x1 - bl MapGridGetMetatileIdAt - ldr r1, =0x00000286 - cmp r0, r1 - bne _080FABDC - ldr r0, [r4, 0x14] - ldr r1, [r4, 0x18] - subs r1, 0x1 - ldr r2, =0x00000e02 - bl MapGridSetMetatileIdAt - b _080FABEA - .pool -_080FABDC: - ldr r0, [r4, 0x14] - ldr r1, [r4, 0x18] - subs r1, 0x1 - movs r2, 0xA1 - lsls r2, 2 - bl MapGridSetMetatileIdAt -_080FABEA: - ldr r4, =0x02038c08 - ldr r0, [r4, 0x14] - ldr r1, [r4, 0x18] - ldr r2, =0x0000020a - bl MapGridSetMetatileIdAt - ldr r0, [r4, 0x14] - ldr r1, [r4, 0x18] - subs r1, 0x1 - bl CurrentMapDrawMetatileAt - ldr r0, [r4, 0x14] - ldr r1, [r4, 0x18] - bl CurrentMapDrawMetatileAt - movs r0, 0 - strh r0, [r5, 0x2E] - ldr r0, =sub_80FAC24 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end door_restore_tilemap - - thumb_func_start sub_80FAC24 -sub_80FAC24: @ 80FAC24 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r1, [r5, 0x2E] - movs r2, 0x2E - ldrsh r0, [r5, r2] - cmp r0, 0x11 - bgt _080FAC38 - adds r0, r1, 0x1 - strh r0, [r5, 0x2E] - b _080FAC54 -_080FAC38: - ldr r4, =0x02038c08 - ldr r0, [r4, 0x14] - ldr r1, [r4, 0x18] - ldr r2, =0x00000e8c - bl MapGridSetMetatileIdAt - ldr r0, [r4, 0x14] - ldr r1, [r4, 0x18] - bl CurrentMapDrawMetatileAt - movs r0, 0 - strh r0, [r5, 0x2E] - ldr r0, =sub_80FAC68 - str r0, [r5, 0x1C] -_080FAC54: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FAC24 - - thumb_func_start sub_80FAC68 -sub_80FAC68: @ 80FAC68 - push {lr} - movs r1, 0x34 - bl FieldEffectStop - bl script_env_2_enable_and_set_ctx_running - pop {r0} - bx r0 - thumb_func_end sub_80FAC68 - - thumb_func_start sub_80FAC78 -sub_80FAC78: @ 80FAC78 - 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 MapGridGetMetatileIdAt - adds r1, r0, 0 - ldr r0, =0x000002f5 - cmp r1, r0 - beq _080FAD6C - cmp r1, r0 - bgt _080FACB4 - subs r0, 0x17 - cmp r1, r0 - beq _080FAD14 - adds r0, 0x16 - cmp r1, r0 - beq _080FAD60 - b _080FADCE - .pool -_080FACB4: - ldr r0, =0x000002f6 - cmp r1, r0 - beq _080FADA4 - adds r0, 0x40 - cmp r1, r0 - beq _080FACC2 - b _080FADCE -_080FACC2: - ldr r0, =0x02021cc4 - movs r1, 0x64 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085EA88B - bl CopyString - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080FADCE - ldr r4, =0x000040ee - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r0, 0x10 - b _080FAD8A - .pool -_080FAD14: - ldr r0, =0x02021cc4 - movs r1, 0x32 - movs r2, 0 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085EA890 - bl CopyString - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080FADCE - ldr r4, =0x000040ee - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r0, 0x20 - b _080FAD8A - .pool -_080FAD60: - ldr r1, =0x020375f0 - movs r0, 0x1 - b _080FAD70 - .pool -_080FAD6C: - ldr r1, =0x020375f0 - movs r0, 0x2 -_080FAD70: - strh r0, [r1] - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080FADCE - ldr r4, =0x000040ee - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r0, 0x80 -_080FAD8A: - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet - b _080FADCE - .pool -_080FADA4: - ldr r1, =0x020375f0 - movs r0, 0x3 - strh r0, [r1] - ldr r0, =0x00004054 - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _080FADCE - ldr r4, =0x000040ee - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - movs r0, 0x80 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet -_080FADCE: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FAC78 - - thumb_func_start sub_80FADE4 -sub_80FADE4: @ 80FADE4 - push {r4-r6,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r6, r4, 0 - lsls r1, 24 - lsrs r5, r1, 24 - bl CurrentMapIsSecretBase - lsls r0, 24 - cmp r0, 0 - beq _080FAE28 - cmp r5, 0 - bne _080FAE1C - ldr r1, =0xfffffd7b - adds r0, r4, r1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bls _080FAE10 - ldr r0, =0x00000237 - cmp r4, r0 - bne _080FAE28 -_080FAE10: - movs r0, 0x1 - b _080FAE2A - .pool -_080FAE1C: - ldr r0, =0x0000028d - cmp r4, r0 - beq _080FAE10 - ldr r0, =0x0000023f - cmp r6, r0 - beq _080FAE10 -_080FAE28: - movs r0, 0 -_080FAE2A: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80FADE4 - - thumb_func_start task50_overworld_posion_effect -task50_overworld_posion_effect: @ 80FAE38 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r1, r0, r1 - movs r3, 0 - ldrsh r0, [r1, r3] - cmp r0, 0x1 - beq _080FAE76 - cmp r0, 0x1 - bgt _080FAE60 - cmp r0, 0 - beq _080FAE66 - b _080FAE92 - .pool -_080FAE60: - cmp r0, 0x2 - beq _080FAE8A - b _080FAE92 -_080FAE66: - ldrh r0, [r1, 0x2] - adds r0, 0x2 - strh r0, [r1, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _080FAE92 - b _080FAE82 -_080FAE76: - ldrh r0, [r1, 0x2] - subs r0, 0x2 - strh r0, [r1, 0x2] - lsls r0, 16 - cmp r0, 0 - bne _080FAE92 -_080FAE82: - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _080FAE92 -_080FAE8A: - adds r0, r2, 0 - bl DestroyTask - b _080FAEA2 -_080FAE92: - ldrh r0, [r1, 0x2] - lsls r1, r0, 4 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x4C - bl SetGpuReg -_080FAEA2: - pop {r0} - bx r0 - thumb_func_end task50_overworld_posion_effect - - thumb_func_start overworld_posion_effect -overworld_posion_effect: @ 80FAEA8 - push {lr} - movs r0, 0x4F - bl audio_play - ldr r0, =task50_overworld_posion_effect - movs r1, 0x50 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end overworld_posion_effect - - thumb_func_start c3_80A0DD8_is_running -c3_80A0DD8_is_running: @ 80FAEC0 - push {lr} - ldr r0, =task50_overworld_posion_effect - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end c3_80A0DD8_is_running - - thumb_func_start sub_80FAED4 -sub_80FAED4: @ 80FAED4 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =sub_80FAEF0 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_80FAED4 - - thumb_func_start sub_80FAEF0 -sub_80FAEF0: @ 80FAEF0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - adds r0, r4, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _080FAF1C - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080FAF4E -_080FAF1C: - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - bl sub_808C228 - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - bl GetStepInPlaceDelay16AnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetSpecialAnim - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80FAF64 - str r1, [r0] -_080FAF4E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FAEF0 - - thumb_func_start sub_80FAF64 -sub_80FAF64: @ 80FAF64 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r5, r0, r1 - adds r0, r5, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _080FAFC8 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r1 - ldrh r0, [r2, 0xA] - adds r1, r0, 0x1 - strh r1, [r2, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - bgt _080FAFC4 - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - bl GetStepInPlaceDelay16AnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl FieldObjectSetSpecialAnim - b _080FAFC8 - .pool -_080FAFC4: - ldr r0, =sub_80FAFD4 - str r0, [r2] -_080FAFC8: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FAF64 - - thumb_func_start sub_80FAFD4 -sub_80FAFD4: @ 80FAFD4 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_808BCD0 - lsls r0, 24 - lsrs r0, 24 - bl SetPlayerAvatarTransitionFlags - adds r0, r4, 0 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80FAFD4 - - thumb_func_start sub_80FAFF8 -sub_80FAFF8: @ 80FAFF8 - push {lr} - ldr r0, =sub_80FAED4 - movs r1, 0x50 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FAFF8 - - thumb_func_start sub_80FB00C -sub_80FB00C: @ 80FB00C - push {r4,r5,lr} - ldr r0, =gUnknown_0858E864 - bl LoadTaggedObjectPalette - ldr r0, =gUnknown_0858E880 - movs r1, 0 - movs r2, 0 - movs r3, 0x52 - bl AddObjectToFront - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x40 - beq _080FB06C - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - ldr r1, =0x02020630 - adds r4, r0, r1 - adds r2, r4, 0 - adds r2, 0x20 - adds r3, r4, 0 - adds r3, 0x22 - movs r0, 0x10 - movs r1, 0xD - bl sub_8092FF0 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x20] - adds r0, 0x10 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x22] - adds r0, 0x2 - strh r0, [r4, 0x22] - adds r0, r5, 0 - b _080FB06E - .pool -_080FB06C: - movs r0, 0x40 -_080FB06E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80FB00C - - thumb_func_start sub_80FB074 -sub_80FB074: @ 80FB074 - push {r4-r7,lr} - ldr r4, =0x02020630 - adds r7, r4, 0 - movs r6, 0 - movs r5, 0x3F -_080FB07E: - adds r0, r7, 0 - adds r0, 0x14 - adds r0, r6, r0 - ldr r1, [r0] - ldr r0, =gUnknown_0858E880 - cmp r1, r0 - bne _080FB098 - adds r0, r4, 0 - bl FreeObjectPalette - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_080FB098: - adds r4, 0x44 - adds r6, 0x44 - subs r5, 0x1 - cmp r5, 0 - bge _080FB07E - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FB074 - - thumb_func_start sub_80FB0B0 -sub_80FB0B0: @ 80FB0B0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x78 - bl __modsi3 - cmp r0, 0 - bne _080FB0C4 - movs r0, 0x1 - negs r0, r0 - b _080FB0D6 -_080FB0C4: - adds r0, r4, 0 - movs r1, 0xA - bl __modsi3 - cmp r0, 0x4 - ble _080FB0D4 - movs r0, 0 - b _080FB0D6 -_080FB0D4: - movs r0, 0x1 -_080FB0D6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80FB0B0 - - thumb_func_start sub_80FB0DC -sub_80FB0DC: @ 80FB0DC - push {lr} - adds r0, 0x78 - movs r1, 0xB4 - bl __modsi3 - cmp r0, 0 - beq _080FB0EE - movs r0, 0 - b _080FB0F2 -_080FB0EE: - movs r0, 0x1 - negs r0, r0 -_080FB0F2: - pop {r1} - bx r1 - thumb_func_end sub_80FB0DC - - thumb_func_start sub_80FB0F8 -sub_80FB0F8: @ 80FB0F8 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r5, r1, r0 - movs r1, 0 - ldrsh r0, [r5, r1] - adds r0, 0x1E - bl sub_80FB0DC - ldr r4, =0x03005d8c - ldr r2, [r4] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - lsls r0, 18 - movs r3, 0xC0 - lsls r3, 10 - orrs r0, r3 - asrs r0, 16 - str r0, [sp] - movs r0, 0x1 - movs r3, 0x3 - bl sub_808E82C - movs r3, 0 - ldrsh r0, [r5, r3] - bl sub_80FB0DC - ldr r2, [r4] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - lsls r0, 17 - ldr r3, =0xfffd0000 - adds r0, r3 - asrs r0, 16 - str r0, [sp] - movs r0, 0x2 - movs r3, 0 - bl sub_808E82C - movs r1, 0 - ldrsh r0, [r5, r1] - bl sub_80FB0DC - ldr r2, [r4] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - movs r4, 0 - movs r3, 0x3 - negs r3, r3 - lsls r0, 18 - asrs r0, 16 - str r0, [sp] - movs r0, 0x3 - bl sub_808E82C - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - lsls r0, 16 - ldr r1, =0x75300000 - cmp r0, r1 - bne _080FB180 - strh r4, [r5] -_080FB180: - movs r3, 0 - ldrsh r0, [r5, r3] - bl sub_80FB0B0 - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl SetCameraPanning - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FB0F8 - - thumb_func_start sub_80FB1AC -sub_80FB1AC: @ 80FB1AC - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r3, r0, 3 - ldr r4, =0x03005e08 - adds r7, r3, r4 - ldrh r1, [r7] - adds r1, 0x1 - strh r1, [r7] - ldrh r0, [r7, 0x4] - adds r0, 0x1 - strh r0, [r7, 0x4] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x5 - ble _080FB1DC - movs r0, 0 - strh r0, [r7] - ldrh r0, [r7, 0x2] - adds r0, 0x1 - strh r0, [r7, 0x2] -_080FB1DC: - ldrh r0, [r7, 0x2] - cmp r0, 0x13 - bne _080FB1F0 - adds r0, r2, 0 - bl DestroyTask - b _080FB2A8 - .pool -_080FB1F0: - ldr r2, =gUnknown_0858E898 - movs r1, 0x2 - ldrsh r0, [r7, r1] - adds r0, r2 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x2 - bne _080FB20C - adds r0, r4, 0 - subs r0, 0x8 - adds r0, r3, r0 - ldr r1, =sub_80FB2C0 - str r1, [r0] -_080FB20C: - movs r4, 0x2 - ldrsh r0, [r7, r4] - adds r0, r2 - movs r5, 0 - ldrsb r5, [r0, r5] - lsls r5, 16 - lsrs r5, 16 - movs r1, 0x4 - ldrsh r0, [r7, r1] - bl sub_80FB0B0 - adds r1, r0, 0 - lsls r5, 16 - asrs r5, 16 - lsls r1, 16 - asrs r1, 16 - adds r0, r5, 0 - bl SetCameraPanning - movs r4, 0x4 - ldrsh r0, [r7, r4] - adds r0, 0x1E - bl sub_80FB0DC - ldr r6, =0x03005d8c - ldr r2, [r6] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - movs r3, 0x3 - subs r3, r5 - lsls r3, 16 - asrs r3, 16 - lsls r0, 18 - movs r4, 0xC0 - lsls r4, 10 - orrs r0, r4 - asrs r0, 16 - str r0, [sp] - movs r0, 0x1 - bl sub_808E82C - movs r1, 0x4 - ldrsh r0, [r7, r1] - bl sub_80FB0DC - ldr r2, [r6] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - negs r3, r5 - lsls r3, 16 - asrs r3, 16 - lsls r0, 17 - ldr r4, =0xfffd0000 - adds r0, r4 - asrs r0, 16 - str r0, [sp] - movs r0, 0x2 - bl sub_808E82C - movs r1, 0x4 - ldrsh r0, [r7, r1] - bl sub_80FB0DC - ldr r2, [r6] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - movs r4, 0x3 - negs r4, r4 - adds r3, r4, 0 - subs r3, r5 - lsls r3, 16 - asrs r3, 16 - lsls r0, 18 - asrs r0, 16 - str r0, [sp] - movs r0, 0x3 - bl sub_808E82C -_080FB2A8: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FB1AC - - thumb_func_start sub_80FB2C0 -sub_80FB2C0: @ 80FB2C0 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - adds r3, r0, 0 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r2, r0, r1 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - ble _080FB2F0 - movs r0, 0 - strh r0, [r2] - ldrh r0, [r2, 0x2] - adds r0, 0x1 - strh r0, [r2, 0x2] -_080FB2F0: - ldrh r0, [r2, 0x2] - cmp r0, 0x13 - bne _080FB304 - adds r0, r3, 0 - bl DestroyTask - b _080FB358 - .pool -_080FB304: - ldr r1, =gUnknown_0858E898 - movs r3, 0x2 - ldrsh r0, [r2, r3] - adds r0, r1 - movs r1, 0 - mov r8, r1 - movs r6, 0 - ldrsb r6, [r0, r6] - adds r0, r6, 0 - bl SetCameraPanning - ldr r5, =0x03005d8c - ldr r0, [r5] - ldrb r1, [r0, 0x5] - ldrb r2, [r0, 0x4] - movs r3, 0x3 - subs r3, r6 - movs r0, 0x3 - str r0, [sp] - movs r0, 0x1 - bl sub_808E82C - ldr r0, [r5] - ldrb r1, [r0, 0x5] - ldrb r2, [r0, 0x4] - negs r3, r6 - mov r4, r8 - subs r4, 0x3 - str r4, [sp] - movs r0, 0x2 - bl sub_808E82C - ldr r0, [r5] - ldrb r1, [r0, 0x5] - ldrb r2, [r0, 0x4] - subs r4, r6 - mov r3, r8 - str r3, [sp] - movs r0, 0x3 - adds r3, r4, 0 - bl sub_808E82C -_080FB358: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FB2C0 - - thumb_func_start sub_80FB36C -sub_80FB36C: @ 80FB36C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x5 - bls _080FB386 - b _080FB4D8 -_080FB386: - lsls r0, 2 - ldr r1, =_080FB398 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080FB398: - .4byte _080FB3B0 - .4byte _080FB3E8 - .4byte _080FB404 - .4byte _080FB450 - .4byte _080FB474 - .4byte _080FB492 -_080FB3B0: - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5A - beq _080FB3C0 - b _080FB4D8 -_080FB3C0: - movs r0, 0 - bl SetCameraPanningCallback - movs r0, 0 - strh r0, [r4, 0x2] - ldr r0, =sub_80FB0F8 - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x4] - movs r0, 0x1 - strh r0, [r4] - movs r0, 0x31 - bl audio_play - b _080FB4D8 - .pool -_080FB3E8: - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x96 - bne _080FB4D8 - bl pal_fill_black - movs r0, 0 - strh r0, [r4, 0x2] - movs r0, 0x2 - strh r0, [r4] - b _080FB4D8 -_080FB404: - ldrh r0, [r4, 0x2] - adds r3, r0, 0x1 - strh r3, [r4, 0x2] - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - bne _080FB4D8 - lsls r1, r3, 16 - movs r0, 0x96 - lsls r0, 17 - cmp r1, r0 - ble _080FB4D8 - strh r2, [r4, 0x2] - ldrb r0, [r4, 0x4] - bl DestroyTask - ldr r0, =sub_80FB1AC - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x6] - movs r0, 0x3 - strh r0, [r4] - movs r0, 0x32 - bl audio_play - b _080FB4D8 - .pool -_080FB450: - ldr r2, =0x03005e00 - movs r0, 0x6 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r5, [r0, 0x4] - cmp r5, 0 - bne _080FB4D8 - bl InstallCameraPanAheadCallback - strh r5, [r4, 0x2] - movs r0, 0x4 - strh r0, [r4] - b _080FB4D8 - .pool -_080FB474: - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5A - bne _080FB4D8 - movs r0, 0x33 - bl audio_play - movs r0, 0 - strh r0, [r4, 0x2] - movs r0, 0x5 - strh r0, [r4] - b _080FB4D8 -_080FB492: - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x78 - bne _080FB4D8 - movs r2, 0x82 - lsls r2, 2 - movs r0, 0xB - movs r1, 0x8 - bl MapGridSetMetatileIdAt - movs r2, 0x84 - lsls r2, 2 - movs r0, 0xB - movs r1, 0x9 - bl MapGridSetMetatileIdAt - movs r2, 0x86 - lsls r2, 2 - movs r0, 0xB - movs r1, 0xA - bl MapGridSetMetatileIdAt - bl DrawWholeMapView - movs r0, 0x34 - bl audio_play - adds r0, r5, 0 - bl DestroyTask - bl script_env_2_disable -_080FB4D8: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80FB36C - - thumb_func_start sub_80FB4E0 -sub_80FB4E0: @ 80FB4E0 - push {lr} - sub sp, 0x4 - ldr r2, =0x0000020d - movs r0, 0xB - movs r1, 0x8 - bl MapGridSetMetatileIdAt - ldr r2, =0x00000215 - movs r0, 0xB - movs r1, 0x9 - bl MapGridSetMetatileIdAt - ldr r2, =0x0000021d - movs r0, 0xB - movs r1, 0xA - bl MapGridSetMetatileIdAt - bl DrawWholeMapView - bl script_env_2_enable - movs r0, 0 - str r0, [sp] - ldr r1, =0x02037b14 - ldr r2, =0x01000100 - mov r0, sp - bl CpuFastSet - ldr r0, =sub_80FB36C - movs r1, 0xA - bl CreateTask - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FB4E0 - - thumb_func_start sub_80FB540 -sub_80FB540: @ 80FB540 - push {r4-r6,lr} - sub sp, 0x4 - ldr r0, =sub_80FB36C - bl FuncIsActiveTask - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _080FB58A - ldr r4, =0x03005d8c - ldr r0, [r4] - ldrb r1, [r0, 0x5] - ldrb r2, [r0, 0x4] - movs r0, 0x3 - str r0, [sp] - movs r0, 0x1 - movs r3, 0x3 - bl sub_808E82C - ldr r0, [r4] - ldrb r1, [r0, 0x5] - ldrb r2, [r0, 0x4] - movs r5, 0x3 - negs r5, r5 - str r5, [sp] - movs r0, 0x2 - movs r3, 0 - bl sub_808E82C - ldr r0, [r4] - ldrb r1, [r0, 0x5] - ldrb r2, [r0, 0x4] - str r6, [sp] - movs r0, 0x3 - adds r3, r5, 0 - bl sub_808E82C -_080FB58A: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FB540 - - thumb_func_start sub_80FB59C -sub_80FB59C: @ 80FB59C - push {r4-r6,lr} - sub sp, 0xC - mov r4, sp - adds r4, 0x5 - mov r5, sp - adds r5, 0x6 - add r6, sp, 0x8 - add r0, sp, 0x4 - adds r1, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl sub_8137FFC - lsls r0, 24 - cmp r0, 0 - bne _080FB5DE - add r0, sp, 0x4 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - movs r1, 0 - ldrsb r1, [r4, r1] - movs r2, 0x1 - negs r2, r2 - movs r3, 0 - ldrsb r3, [r5, r3] - movs r4, 0 - ldrsb r4, [r6, r4] - str r4, [sp] - bl warp1_set - movs r0, 0x1 - b _080FB5E0 -_080FB5DE: - movs r0, 0 -_080FB5E0: - add sp, 0xC - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80FB59C - - thumb_func_start sub_80FB5E8 -sub_80FB5E8: @ 80FB5E8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldr r0, =0x000040b4 - bl GetVarPointer - adds r7, r0, 0 - ldr r0, =0x03005d8c - ldr r3, [r0] - adds r6, r3, 0x4 - movs r0, 0 - ldrsh r2, [r4, r0] - cmp r2, 0x1 - beq _080FB648 - cmp r2, 0x1 - bgt _080FB624 - cmp r2, 0 - beq _080FB62E - b _080FB6E2 - .pool -_080FB624: - cmp r2, 0x2 - beq _080FB68A - cmp r2, 0x3 - beq _080FB6C4 - b _080FB6E2 -_080FB62E: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080FB6E2 - strh r2, [r4, 0x2] - movs r0, 0x2 - strh r0, [r4] - b _080FB6E2 - .pool -_080FB648: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _080FB656 - strh r2, [r4, 0x2] -_080FB656: - ldrb r1, [r6, 0x1] - ldrb r2, [r3, 0x4] - movs r0, 0xFF - bl sub_80D3340 - lsls r0, 24 - cmp r0, 0 - beq _080FB6E2 - movs r0, 0x1 - bl sub_8137FC0 - cmp r0, 0x1 - bne _080FB686 - ldrh r0, [r7] - cmp r0, 0x2 - bne _080FB680 - movs r0, 0x9 - b _080FB682 - .pool -_080FB680: - movs r0, 0xA -_080FB682: - strh r0, [r7] - b _080FB692 -_080FB686: - movs r0, 0x2 - strh r0, [r4] -_080FB68A: - movs r1, 0x2 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080FB698 -_080FB692: - movs r0, 0x3 - strh r0, [r4] - b _080FB6E2 -_080FB698: - ldrh r0, [r7] - cmp r0, 0x2 - bne _080FB6AC - ldrb r1, [r6, 0x1] - ldrb r2, [r6] - ldr r3, =gUnknown_0858E8AB - b _080FB6B2 - .pool -_080FB6AC: - ldrb r1, [r6, 0x1] - ldrb r2, [r6] - ldr r3, =gUnknown_0858E8AD -_080FB6B2: - movs r0, 0xFF - bl exec_movement - movs r0, 0x1 - strh r0, [r4] - b _080FB6E2 - .pool -_080FB6C4: - ldr r0, =0x00004001 - bl FlagReset - movs r0, 0x80 - lsls r0, 7 - bl FlagReset - movs r0, 0 - bl copy_saved_warp2_bank_and_enter_x_to_warp1 - bl sp13E_warp_to_last_warp - adds r0, r5, 0 - bl DestroyTask -_080FB6E2: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FB5E8 - - thumb_func_start sub_80FB6EC -sub_80FB6EC: @ 80FB6EC - push {r4,lr} - sub sp, 0x4 - ldr r1, =DummyObjectCallback - movs r0, 0 - str r0, [sp] - movs r0, 0x8C - movs r2, 0x70 - movs r3, 0x50 - bl AddPseudoFieldObject - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r4, r1, r2 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r0, =0x000040b4 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bne _080FB74C - movs r0, 0x4 - bl FieldObjectDirectionToImageAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - b _080FB75E - .pool -_080FB74C: - movs r0, 0x3 - bl FieldObjectDirectionToImageAnimId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim -_080FB75E: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80FB6EC - - thumb_func_start sub_80FB768 -sub_80FB768: @ 80FB768 - push {lr} - bl sub_80FB6EC - ldr r2, =0x02037350 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0, 0x1] - bl pal_fill_black - ldr r0, =sub_80FB5E8 - movs r1, 0x50 - bl CreateTask - bl script_env_2_enable - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FB768 - - thumb_func_start sub_80FB7A4 -sub_80FB7A4: @ 80FB7A4 - push {lr} - ldr r0, =0x0000088d - bl FlagSet - ldr r0, =0x00004001 - bl FlagSet - movs r0, 0x80 - lsls r0, 7 - bl FlagSet - ldr r0, =0x03005d8c - 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 - bl sub_80FB59C - bl sub_80AF8B8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FB7A4 - - thumb_func_start GetCurrentMapRotatingGatePuzzleType -GetCurrentMapRotatingGatePuzzleType: @ 80FB7E8 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - movs r0, 0x86 - lsls r0, 1 - cmp r1, r0 - bne _080FB800 - movs r0, 0x1 - b _080FB812 - .pool -_080FB800: - ldr r0, =0x0000081d - cmp r1, r0 - beq _080FB810 - movs r0, 0 - b _080FB812 - .pool -_080FB810: - movs r0, 0x2 -_080FB812: - pop {r1} - bx r1 - thumb_func_end GetCurrentMapRotatingGatePuzzleType - - thumb_func_start sub_80FB818 -sub_80FB818: @ 80FB818 - push {r4-r6,lr} - movs r0, 0x80 - lsls r0, 7 - bl GetVarPointer - adds r5, r0, 0 - movs r3, 0 - ldr r4, =0x0203a048 - ldrb r0, [r4] - cmp r3, r0 - bge _080FB844 - ldr r6, =0x0203a044 -_080FB830: - adds r2, r5, r3 - ldr r1, [r6] - lsls r0, r3, 3 - adds r0, r1 - ldrb r0, [r0, 0x5] - strb r0, [r2] - adds r3, 0x1 - ldrb r0, [r4] - cmp r3, r0 - blt _080FB830 -_080FB844: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FB818 - - thumb_func_start sub_80FB854 -sub_80FB854: @ 80FB854 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x80 - lsls r0, 7 - bl GetVarPointer - adds r0, r4 - ldrb r0, [r0] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80FB854 - - thumb_func_start sub_80FB870 -sub_80FB870: @ 80FB870 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0x80 - lsls r0, 7 - bl GetVarPointer - adds r0, r4 - strb r5, [r0] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80FB870 - - thumb_func_start sub_80FB890 -sub_80FB890: @ 80FB890 - push {r4,r5,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - bl sub_80FB854 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r4, 0x1 - bne _080FB8B4 - cmp r1, 0 - beq _080FB8B0 - subs r0, r1, 0x1 - lsls r0, 24 - b _080FB8BE -_080FB8B0: - movs r1, 0x3 - b _080FB8C0 -_080FB8B4: - adds r1, 0x1 - lsls r1, 24 - movs r0, 0xC0 - lsls r0, 18 - ands r0, r1 -_080FB8BE: - lsrs r1, r0, 24 -_080FB8C0: - adds r0, r5, 0 - bl sub_80FB870 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80FB890 - - thumb_func_start sub_80FB8CC -sub_80FB8CC: @ 80FB8CC - push {lr} - bl GetCurrentMapRotatingGatePuzzleType - cmp r0, 0x1 - beq _080FB8E0 - cmp r0, 0x1 - ble _080FB914 - cmp r0, 0x2 - beq _080FB8F8 - b _080FB914 -_080FB8E0: - ldr r1, =0x0203a044 - ldr r0, =gUnknown_0858E8B0 - str r0, [r1] - ldr r1, =0x0203a048 - movs r0, 0x8 - b _080FB902 - .pool -_080FB8F8: - ldr r1, =0x0203a044 - ldr r0, =gUnknown_0858E8F0 - str r0, [r1] - ldr r1, =0x0203a048 - movs r0, 0xB -_080FB902: - strb r0, [r1] - movs r1, 0 - ldr r3, =0x0203a038 - movs r2, 0x40 -_080FB90A: - adds r0, r1, r3 - strb r2, [r0] - adds r1, 0x1 - cmp r1, 0xA - bls _080FB90A -_080FB914: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FB8CC - - thumb_func_start sub_80FB928 -sub_80FB928: @ 80FB928 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp] - lsls r1, 16 - lsrs r1, 16 - mov r10, r1 - ldr r0, =0x03005d8c - ldr r2, [r0] - ldrh r1, [r2] - subs r0, r1, 0x2 - lsls r0, 16 - lsrs r3, r0, 16 - adds r1, 0x11 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - ldrh r1, [r2, 0x2] - subs r0, r1, 0x2 - lsls r0, 16 - lsrs r2, r0, 16 - adds r1, 0xE - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - movs r5, 0 - ldr r0, =0x0203a048 - ldrb r0, [r0] - cmp r5, r0 - bcs _080FB9DA - lsls r0, r2, 16 - asrs r7, r0, 16 - lsls r0, r3, 16 - asrs r6, r0, 16 -_080FB976: - ldr r0, =0x0203a044 - ldr r0, [r0] - lsls r1, r5, 3 - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x7 - lsls r0, 16 - lsrs r2, r0, 16 - ldrh r0, [r1, 0x2] - adds r0, 0x7 - lsls r0, 16 - asrs r1, r0, 16 - cmp r7, r1 - bgt _080FB9CC - mov r3, r8 - lsls r0, r3, 16 - asrs r0, 16 - cmp r0, r1 - blt _080FB9CC - lsls r0, r2, 16 - asrs r1, r0, 16 - cmp r6, r1 - bgt _080FB9CC - mov r2, r9 - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, r1 - blt _080FB9CC - ldr r0, =0x0203a038 - adds r4, r5, r0 - ldrb r0, [r4] - cmp r0, 0x40 - bne _080FB9CC - ldr r3, [sp] - lsls r1, r3, 16 - mov r0, r10 - lsls r2, r0, 16 - adds r0, r5, 0 - asrs r1, 16 - asrs r2, 16 - bl sub_80FB9FC - strb r0, [r4] -_080FB9CC: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x0203a048 - ldrb r0, [r0] - cmp r5, r0 - bcc _080FB976 -_080FB9DA: - 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_80FB928 - - thumb_func_start sub_80FB9FC -sub_80FB9FC: @ 80FB9FC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x18 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 16 - lsrs r2, 16 - mov r8, r2 - ldr r0, =0x0203a044 - lsls r1, r6, 3 - ldr r0, [r0] - adds r4, r0, r1 - ldrb r0, [r4, 0x4] - cmp r0, 0 - beq _080FBA24 - cmp r0, 0x4 - bne _080FBA34 -_080FBA24: - mov r1, sp - ldr r0, =gUnknown_08591FE0 - b _080FBA38 - .pool -_080FBA34: - mov r1, sp - ldr r0, =gUnknown_08591FC8 -_080FBA38: - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - mov r2, sp - ldrb r0, [r4, 0x4] - movs r3, 0x98 - lsls r3, 5 - adds r1, r3, 0 - adds r0, r1 - strh r0, [r2] - mov r0, sp - movs r1, 0 - movs r2, 0 - movs r3, 0x94 - bl AddObjectToFront - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x40 - beq _080FBAD4 - ldrh r0, [r4] - adds r0, 0x7 - ldrh r1, [r4, 0x2] - adds r1, 0x7 - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - ldr r2, =0x02020630 - adds r4, r2 - strh r6, [r4, 0x2E] - movs r2, 0x3E - adds r2, r4 - mov r12, r2 - ldrb r2, [r2] - movs r3, 0x2 - orrs r2, r3 - mov r3, r12 - strb r2, [r3] - lsls r0, 16 - asrs r0, 16 - lsls r2, r7, 16 - asrs r2, 16 - adds r0, r2 - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - mov r3, r8 - lsls r2, r3, 16 - asrs r2, 16 - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - adds r2, r4, 0 - adds r2, 0x20 - adds r3, r4, 0 - adds r3, 0x22 - bl sub_8092FF0 - adds r0, r4, 0 - bl sub_80FBB64 - adds r0, r6, 0 - bl sub_80FB854 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectRotScalAnim - adds r0, r5, 0 - b _080FBAD6 - .pool -_080FBAD4: - movs r0, 0x40 -_080FBAD6: - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80FB9FC - - thumb_func_start sub_80FBAE4 -sub_80FBAE4: @ 80FBAE4 - push {r4-r7,lr} - adds r6, r0, 0 - ldrh r0, [r6, 0x30] - lsls r0, 24 - lsrs r5, r0, 24 - ldrh r0, [r6, 0x32] - lsls r0, 24 - lsrs r4, r0, 24 - adds r7, r4, 0 - adds r0, r6, 0 - bl sub_80FBB64 - cmp r5, 0x1 - bne _080FBB2A - adds r0, r4, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_811A138 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - beq _080FBB1A - adds r0, r4, 0 - adds r0, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 -_080FBB1A: - movs r0, 0x30 - bl audio_play - adds r0, r6, 0 - adds r1, r4, 0 - bl StartObjectRotScalAnim - b _080FBB58 -_080FBB2A: - cmp r5, 0x2 - bne _080FBB58 - adds r0, r7, 0 - adds r0, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_811A138 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - beq _080FBB4A - adds r0, r4, 0 - adds r0, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 -_080FBB4A: - movs r0, 0x30 - bl audio_play - adds r0, r6, 0 - adds r1, r4, 0 - bl StartObjectRotScalAnim -_080FBB58: - movs r0, 0 - strh r0, [r6, 0x30] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80FBAE4 - - thumb_func_start sub_80FBB64 -sub_80FBB64: @ 80FBB64 - push {r4-r6,lr} - mov r12, r0 - mov r4, r12 - adds r4, 0x3E - ldrb r0, [r4] - movs r5, 0x5 - negs r5, r5 - ands r5, r0 - strb r5, [r4] - mov r0, r12 - ldrh r1, [r0, 0x24] - ldrh r2, [r0, 0x20] - adds r1, r2 - adds r0, 0x28 - movs r2, 0 - ldrsb r2, [r0, r2] - ldr r0, =0x02021bbc - adds r2, r1 - ldrh r0, [r0] - adds r2, r0 - lsls r2, 16 - mov r3, r12 - ldrh r1, [r3, 0x26] - ldrh r0, [r3, 0x22] - adds r1, r0 - mov r0, r12 - adds r0, 0x29 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldr r3, =0x02021bbe - adds r0, r1 - ldrh r3, [r3] - adds r0, r3 - lsls r0, 16 - movs r3, 0x80 - lsls r3, 15 - adds r1, r2, r3 - lsrs r1, 16 - lsrs r6, r0, 16 - adds r0, r3 - lsrs r3, r0, 16 - asrs r2, 16 - cmp r2, 0xFF - bgt _080FBBCA - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bge _080FBBD2 -_080FBBCA: - movs r1, 0x4 - adds r0, r5, 0 - orrs r0, r1 - strb r0, [r4] -_080FBBD2: - lsls r0, r6, 16 - asrs r0, 16 - cmp r0, 0xAF - bgt _080FBBE6 - lsls r0, r3, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bge _080FBBF2 -_080FBBE6: - mov r0, r12 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_080FBBF2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FBB64 - - thumb_func_start LoadRotatingGatePics -@ void LoadRotatingGatePics() -LoadRotatingGatePics: @ 80FBC00 - push {lr} - ldr r0, =gUnknown_08591D58 - bl LoadObjectPics - pop {r0} - bx r0 - .pool - thumb_func_end LoadRotatingGatePics - - thumb_func_start sub_80FBC10 -sub_80FBC10: @ 80FBC10 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x03005d8c - ldr r2, [r0] - ldrh r1, [r2] - subs r0, r1, 0x2 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - adds r1, 0x11 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - ldrh r1, [r2, 0x2] - subs r0, r1, 0x2 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - adds r1, 0xE - lsls r1, 16 - lsrs r7, r1, 16 - movs r6, 0 - b _080FBCB6 - .pool -_080FBC48: - ldr r0, =0x0203a044 - ldr r0, [r0] - lsls r1, r6, 3 - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x7 - lsls r0, 16 - lsrs r2, r0, 16 - ldrh r0, [r1, 0x2] - adds r0, 0x7 - lsls r0, 16 - lsrs r3, r0, 16 - ldr r0, =0x0203a038 - adds r0, r6, r0 - ldrb r0, [r0] - cmp r0, 0x40 - beq _080FBCB4 - lsls r0, r2, 16 - mov r2, r10 - lsls r1, r2, 16 - asrs r2, r0, 16 - cmp r0, r1 - blt _080FBC94 - mov r1, r9 - lsls r0, r1, 16 - asrs r0, 16 - cmp r2, r0 - bgt _080FBC94 - lsls r0, r3, 16 - mov r2, r8 - lsls r1, r2, 16 - asrs r2, r0, 16 - cmp r0, r1 - blt _080FBC94 - lsls r0, r7, 16 - asrs r0, 16 - cmp r2, r0 - ble _080FBCB4 -_080FBC94: - ldr r0, =0x0203a038 - adds r5, r6, r0 - ldrb r0, [r5] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - adds r0, r4, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - movs r0, 0x40 - strb r0, [r5] -_080FBCB4: - adds r6, 0x1 -_080FBCB6: - ldr r0, =0x0203a048 - ldrb r0, [r0] - cmp r6, r0 - blt _080FBC48 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FBC10 - - thumb_func_start sub_80FBCDC -sub_80FBCDC: @ 80FBCDC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r4, r0, 24 - cmp r1, 0x1 - bne _080FBCFC - ldr r0, =gUnknown_08592058 - mov r10, r0 - b _080FBD08 - .pool -_080FBCFC: - cmp r1, 0x2 - beq _080FBD04 -_080FBD00: - movs r0, 0 - b _080FBD98 -_080FBD04: - ldr r1, =gUnknown_08592038 - mov r10, r1 -_080FBD08: - adds r0, r4, 0 - bl sub_80FB854 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - ldr r0, =0x0203a044 - ldr r1, [r0] - lsls r0, r4, 3 - adds r0, r1 - ldrb r2, [r0, 0x4] - ldrh r1, [r0] - adds r1, 0x7 - ldrh r0, [r0, 0x2] - adds r0, 0x7 - movs r3, 0 - lsls r2, 3 - str r2, [sp, 0x4] - lsls r1, 16 - asrs r1, 16 - mov r9, r1 - lsls r0, 16 - asrs r0, 16 - mov r8, r0 -_080FBD38: - movs r6, 0 - ldr r2, [sp] - adds r7, r2, r3 - lsls r0, r3, 1 - adds r5, r7, 0 - ldr r1, [sp, 0x4] - adds r0, r1 - ldr r2, =gUnknown_08592078 - adds r4, r0, r2 -_080FBD4A: - adds r0, r5, 0 - cmp r5, 0 - bge _080FBD52 - adds r0, r7, 0x3 -_080FBD52: - asrs r0, 2 - lsls r0, 2 - subs r0, r5, r0 - lsls r0, 1 - adds r0, r6 - lsls r0, 24 - lsrs r1, r0, 24 - ldrb r0, [r4] - cmp r0, 0 - beq _080FBD88 - lsls r1, 2 - add r1, r10 - movs r0, 0 - ldrsb r0, [r1, r0] - add r0, r9 - ldrb r1, [r1, 0x1] - lsls r1, 24 - asrs r1, 24 - add r1, r8 - str r3, [sp, 0x8] - bl MapGridIsImpassableAt - lsls r0, 24 - lsrs r0, 24 - ldr r3, [sp, 0x8] - cmp r0, 0x1 - beq _080FBD00 -_080FBD88: - adds r4, 0x1 - adds r6, 0x1 - cmp r6, 0x1 - ble _080FBD4A - adds r3, 0x1 - cmp r3, 0x3 - ble _080FBD38 - movs r0, 0x1 -_080FBD98: - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80FBCDC - - thumb_func_start sub_80FBDB4 -sub_80FBDB4: @ 80FBDB4 - push {r4-r6,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - lsls r4, 24 - lsrs r5, r4, 24 - lsrs r4, 25 - movs r0, 0x1 - ands r5, r0 - adds r0, r6, 0 - bl sub_80FB854 - subs r4, r0 - adds r1, r4, 0x4 - adds r0, r1, 0 - cmp r1, 0 - bge _080FBDDA - adds r0, r4, 0x7 -_080FBDDA: - asrs r0, 2 - lsls r0, 2 - subs r0, r1, r0 - ldr r1, =0x0203a044 - ldr r2, [r1] - lsls r1, r6, 3 - adds r1, r2 - ldrb r1, [r1, 0x4] - ldr r2, =gUnknown_08592078 - lsls r0, 24 - asrs r0, 23 - adds r0, r5 - lsls r1, 3 - adds r0, r1 - adds r0, r2 - ldrb r0, [r0] - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80FBDB4 - - thumb_func_start sub_80FBE08 -sub_80FBE08: @ 80FBE08 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, =0x0203a038 - adds r2, r3, r0 - ldrb r0, [r2] - cmp r0, 0x40 - beq _080FBE2C - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - strh r1, [r4, 0x30] - adds r0, r3, 0 - bl sub_80FB854 - strh r0, [r4, 0x32] -_080FBE2C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FBE08 - - thumb_func_start sub_80FBE3C -sub_80FBE3C: @ 80FBE3C - push {lr} - lsls r0, 24 - lsrs r0, 24 - adds r3, r0, 0 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - cmp r0, 0x2 - bne _080FBE58 - ldr r3, =gUnknown_08591FF8 - b _080FBE7A - .pool -_080FBE58: - cmp r0, 0x1 - bne _080FBE64 - ldr r3, =gUnknown_08592008 - b _080FBE7A - .pool -_080FBE64: - cmp r0, 0x3 - bne _080FBE70 - ldr r3, =gUnknown_08592018 - b _080FBE7A - .pool -_080FBE70: - cmp r3, 0x4 - beq _080FBE78 - movs r0, 0xFF - b _080FBE88 -_080FBE78: - ldr r3, =gUnknown_08592028 -_080FBE7A: - lsls r0, r2, 16 - lsls r1, 16 - asrs r1, 16 - asrs r0, 14 - adds r0, r1 - adds r0, r3, r0 - ldrb r0, [r0] -_080FBE88: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80FBE3C - - thumb_func_start sub_80FBE90 -sub_80FBE90: @ 80FBE90 - push {lr} - bl GetCurrentMapRotatingGatePuzzleType - cmp r0, 0 - beq _080FBEA2 - bl sub_80FB8CC - bl sub_80FB818 -_080FBEA2: - pop {r0} - bx r0 - thumb_func_end sub_80FBE90 - - thumb_func_start RotatingGatePuzzleCameraUpdate -@ void RotatingGatePuzzleCameraUpdate(s32 deltaX, s32 deltaY) -RotatingGatePuzzleCameraUpdate: @ 80FBEA8 - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 16 - lsrs r5, r1, 16 - bl GetCurrentMapRotatingGatePuzzleType - cmp r0, 0 - beq _080FBECA - lsls r0, r4, 16 - asrs r0, 16 - lsls r1, r5, 16 - asrs r1, 16 - bl sub_80FB928 - bl sub_80FBC10 -_080FBECA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end RotatingGatePuzzleCameraUpdate - - thumb_func_start sub_80FBED0 -sub_80FBED0: @ 80FBED0 - push {lr} - bl GetCurrentMapRotatingGatePuzzleType - cmp r0, 0 - beq _080FBEEA - bl LoadRotatingGatePics - bl sub_80FB8CC - movs r0, 0 - movs r1, 0 - bl sub_80FB928 -_080FBEEA: - pop {r0} - bx r0 - thumb_func_end sub_80FBED0 - - thumb_func_start CheckForRotatingGatePuzzleCollision -CheckForRotatingGatePuzzleCollision: @ 80FBEF0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 16 - lsrs r2, 16 - mov r8, r2 - bl GetCurrentMapRotatingGatePuzzleType - cmp r0, 0 - bne _080FBF24 - b _080FBFC2 -_080FBF12: - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80FBE08 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80FB890 - b _080FBFC2 -_080FBF24: - movs r6, 0 - ldr r0, =0x0203a048 - ldrb r0, [r0] - cmp r6, r0 - bge _080FBFC2 - lsls r0, r4, 16 - asrs r7, r0, 16 -_080FBF32: - ldr r0, =0x0203a044 - ldr r1, [r0] - lsls r0, r6, 3 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x7 - ldrh r0, [r0, 0x2] - adds r0, 0x7 - lsls r0, 16 - lsrs r2, r0, 16 - lsls r1, 16 - asrs r4, r1, 16 - subs r0, r4, 0x2 - cmp r0, r7 - bgt _080FBFB8 - adds r0, r4, 0x1 - cmp r7, r0 - bgt _080FBFB8 - lsls r0, r2, 16 - asrs r3, r0, 16 - subs r1, r3, 0x2 - mov r2, r8 - lsls r0, r2, 16 - asrs r2, r0, 16 - cmp r1, r2 - bgt _080FBFB8 - adds r0, r3, 0x1 - cmp r2, r0 - bgt _080FBFB8 - subs r1, r7, r4 - adds r1, 0x2 - subs r2, r3 - adds r2, 0x2 - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - mov r0, r9 - bl sub_80FBE3C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _080FBFB8 - lsrs r5, r0, 4 - movs r1, 0xF - ands r1, r0 - lsls r0, r6, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_80FBDB4 - cmp r0, 0 - beq _080FBFB8 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80FBCDC - cmp r0, 0 - bne _080FBF12 - movs r0, 0x1 - b _080FBFC4 - .pool -_080FBFB8: - adds r6, 0x1 - ldr r0, =0x0203a048 - ldrb r0, [r0] - cmp r6, r0 - blt _080FBF32 -_080FBFC2: - movs r0, 0 -_080FBFC4: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end CheckForRotatingGatePuzzleCollision - - thumb_func_start sub_80FBFD4 -sub_80FBFD4: @ 80FBFD4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 16 - lsrs r2, 16 - mov r8, r2 - bl GetCurrentMapRotatingGatePuzzleType - cmp r0, 0 - bne _080FBFFA - b _080FC08A -_080FBFF6: - movs r0, 0x1 - b _080FC08C -_080FBFFA: - movs r6, 0 - ldr r0, =0x0203a048 - ldrb r0, [r0] - cmp r6, r0 - bge _080FC08A - lsls r0, r4, 16 - asrs r7, r0, 16 -_080FC008: - ldr r0, =0x0203a044 - ldr r1, [r0] - lsls r0, r6, 3 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x7 - ldrh r0, [r0, 0x2] - adds r0, 0x7 - lsls r0, 16 - lsrs r2, r0, 16 - lsls r1, 16 - asrs r4, r1, 16 - subs r0, r4, 0x2 - cmp r0, r7 - bgt _080FC080 - adds r0, r4, 0x1 - cmp r7, r0 - bgt _080FC080 - lsls r0, r2, 16 - asrs r3, r0, 16 - subs r1, r3, 0x2 - mov r2, r8 - lsls r0, r2, 16 - asrs r2, r0, 16 - cmp r1, r2 - bgt _080FC080 - adds r0, r3, 0x1 - cmp r2, r0 - bgt _080FC080 - subs r1, r7, r4 - adds r1, 0x2 - subs r2, r3 - adds r2, 0x2 - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - mov r0, r9 - bl sub_80FBE3C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _080FC080 - lsrs r5, r0, 4 - movs r1, 0xF - ands r1, r0 - lsls r0, r6, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_80FBDB4 - cmp r0, 0 - beq _080FC080 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80FBCDC - cmp r0, 0 - beq _080FBFF6 -_080FC080: - adds r6, 0x1 - ldr r0, =0x0203a048 - ldrb r0, [r0] - cmp r6, r0 - blt _080FC008 -_080FC08A: - movs r0, 0 -_080FC08C: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80FBFD4 - - thumb_func_start GetSafariZoneFlag -GetSafariZoneFlag: @ 80FC0A0 - push {lr} - ldr r0, =0x0000088c - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end GetSafariZoneFlag - - thumb_func_start SetSafariZoneFlag -SetSafariZoneFlag: @ 80FC0B4 - push {lr} - ldr r0, =0x0000088c - bl FlagSet - pop {r0} - bx r0 - .pool - thumb_func_end SetSafariZoneFlag - - thumb_func_start ResetSafariZoneFlag -ResetSafariZoneFlag: @ 80FC0C4 - push {lr} - ldr r0, =0x0000088c - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end ResetSafariZoneFlag - - thumb_func_start sub_80FC0D4 -sub_80FC0D4: @ 80FC0D4 - push {lr} - movs r0, 0x11 - bl sav12_xor_increment - bl SetSafariZoneFlag - bl sub_80FC244 - ldr r1, =0x0203a04c - movs r0, 0x1E - strb r0, [r1] - ldr r1, =0x0203a04e - movs r2, 0xFA - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r1] - ldr r0, =0x0203a050 - movs r1, 0 - strb r1, [r0] - ldr r0, =0x0203a051 - strb r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC0D4 - - thumb_func_start sub_80FC114 -sub_80FC114: @ 80FC114 - push {lr} - ldr r0, =0x0203a050 - ldrb r0, [r0] - ldr r1, =0x0203a051 - ldrb r1, [r1] - bl sub_80EE44C - bl ResetSafariZoneFlag - bl sub_80FC244 - ldr r1, =0x0203a04c - movs r0, 0 - strb r0, [r1] - ldr r1, =0x0203a04e - movs r0, 0 - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC114 - - thumb_func_start safari_step -safari_step: @ 80FC14C - push {lr} - bl GetSafariZoneFlag - cmp r0, 0 - beq _080FC168 - bl sub_80FC480 - ldr r1, =0x0203a04e - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - lsls r0, 16 - cmp r0, 0 - beq _080FC170 -_080FC168: - movs r0, 0 - b _080FC178 - .pool -_080FC170: - ldr r0, =gUnknown_082A4B8A - bl script_env_1_execute_new_script - movs r0, 0x1 -_080FC178: - pop {r1} - bx r1 - .pool - thumb_func_end safari_step - - thumb_func_start sub_80FC180 -sub_80FC180: @ 80FC180 - push {lr} - ldr r0, =gUnknown_082A4B6F - bl script_env_1_execute_new_script - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC180 - - thumb_func_start sub_80FC190 -sub_80FC190: @ 80FC190 - push {lr} - ldr r1, =0x0203a051 - ldr r0, =0x03005d10 - ldrb r0, [r0, 0x1F] - ldrb r2, [r1] - adds r0, r2 - strb r0, [r1] - ldr r2, =0x0202433a - ldrb r0, [r2] - cmp r0, 0x7 - bne _080FC1AE - ldr r1, =0x0203a050 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080FC1AE: - ldr r0, =0x0203a04c - ldrb r0, [r0] - cmp r0, 0 - beq _080FC1D8 - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - b _080FC21C - .pool -_080FC1D8: - ldrb r0, [r2] - cmp r0, 0x8 - bne _080FC208 - ldr r0, =gUnknown_082A4B4C - bl script_env_2_execute_new_script - bl warp_in - ldr r1, =0x03005dac - ldr r0, =sub_80AF6F0 - str r0, [r1] - ldr r0, =c2_load_new_map - bl SetMainCallback2 - b _080FC21C - .pool -_080FC208: - cmp r0, 0x7 - bne _080FC21C - ldr r0, =gUnknown_082A4B9B - bl script_env_1_execute_new_script - bl script_env_2_set_ctx_paused - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 -_080FC21C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC190 - - thumb_func_start sub_80FC228 -sub_80FC228: @ 80FC228 - push {lr} - lsls r0, 24 - lsrs r0, 20 - ldr r1, =0x0203a054 - adds r0, r1 - movs r1, 0 - movs r2, 0x10 - bl memset - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC228 - - thumb_func_start sub_80FC244 -sub_80FC244: @ 80FC244 - push {lr} - ldr r0, =0x0203a054 - movs r1, 0 - movs r2, 0xA0 - bl memset - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC244 - - thumb_func_start sub_80FC258 -sub_80FC258: @ 80FC258 - push {r4,r5,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl GetXYCoordsOneStepInFrontOfPlayer - movs r5, 0 -_080FC26A: - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r1, =0x0203a054 - lsls r0, r5, 4 - adds r3, r0, r1 - movs r1, 0x5 - ldrsb r1, [r2, r1] - movs r0, 0x4 - ldrsb r0, [r3, r0] - cmp r1, r0 - bne _080FC2C4 - mov r0, sp - movs r2, 0 - ldrsh r1, [r3, r2] - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r1, r0 - bne _080FC2C4 - movs r0, 0x2 - ldrsh r1, [r3, r0] - movs r2, 0 - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _080FC2C4 - ldr r0, =0x020375f0 - strh r5, [r0] - ldr r1, =gUnknown_085B262C - ldrb r0, [r3, 0x8] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldr r0, =0x02021cc4 - bl CopyString - b _080FC2D6 - .pool -_080FC2C4: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x9 - bls _080FC26A - ldr r1, =0x020375f0 - ldr r2, =0x0000ffff - adds r0, r2, 0 - strh r0, [r1] -_080FC2D6: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC258 - - thumb_func_start sub_80FC2E8 -sub_80FC2E8: @ 80FC2E8 - push {r4-r7,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - movs r5, 0 - adds r6, r4, 0 - ldr r0, =0x03005d8c - ldr r7, [r0] - mov r4, sp - ldr r0, =0x0203a054 - mov r12, r0 -_080FC306: - lsls r0, r5, 4 - mov r1, r12 - adds r3, r0, r1 - movs r1, 0x5 - ldrsb r1, [r7, r1] - movs r0, 0x4 - ldrsb r0, [r3, r0] - cmp r1, r0 - bne _080FC364 - ldrh r0, [r4] - ldrh r1, [r3] - subs r0, r1 - strh r0, [r4] - adds r2, r6, 0 - ldrh r0, [r2] - ldrh r1, [r3, 0x2] - subs r0, r1 - strh r0, [r2] - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _080FC336 - negs r0, r0 - strh r0, [r4] -_080FC336: - movs r1, 0 - ldrsh r0, [r2, r1] - cmp r0, 0 - bge _080FC342 - negs r0, r0 - strh r0, [r2] -_080FC342: - movs r2, 0 - ldrsh r0, [r4, r2] - movs r2, 0 - ldrsh r1, [r6, r2] - adds r0, r1 - cmp r0, 0x5 - bgt _080FC364 - ldr r0, =0x020375f0 - strh r5, [r0] - b _080FC376 - .pool -_080FC364: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x9 - bls _080FC306 - ldr r1, =0x020375f0 - ldr r2, =0x0000ffff - adds r0, r2, 0 - strh r0, [r1] -_080FC376: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC2E8 - - thumb_func_start sub_80FC388 -sub_80FC388: @ 80FC388 - push {lr} - bl sub_80FC258 - ldr r2, =0x020375f0 - ldrh r1, [r2] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _080FC3B0 - adds r0, r1, 0 - lsls r0, 4 - ldr r1, =0x0203a05c - adds r0, r1 - b _080FC3B2 - .pool -_080FC3B0: - movs r0, 0 -_080FC3B2: - pop {r1} - bx r1 - thumb_func_end sub_80FC388 - - thumb_func_start sub_80FC3B8 -sub_80FC3B8: @ 80FC3B8 - push {lr} - bl sub_80FC2E8 - ldr r2, =0x020375f0 - ldrh r1, [r2] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _080FC3E0 - adds r0, r1, 0 - lsls r0, 4 - ldr r1, =0x0203a05c - adds r0, r1 - b _080FC3E2 - .pool -_080FC3E0: - movs r0, 0 -_080FC3E2: - pop {r1} - bx r1 - thumb_func_end sub_80FC3B8 - - thumb_func_start sub_80FC3E8 -sub_80FC3E8: @ 80FC3E8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r1, 0 - ldr r2, =0x0203a054 - mov r6, sp - adds r6, 0x2 - movs r0, 0x8 - adds r0, r2 - mov r9, r0 - ldr r7, =0x03005d8c -_080FC408: - lsls r5, r1, 4 - adds r4, r5, r2 - movs r0, 0x4 - ldrsb r0, [r4, r0] - cmp r0, 0 - bne _080FC468 - movs r3, 0 - ldrsh r0, [r4, r3] - cmp r0, 0 - bne _080FC468 - movs r3, 0x2 - ldrsh r0, [r4, r3] - cmp r0, 0 - bne _080FC468 - mov r0, sp - adds r1, r6, 0 - bl GetXYCoordsOneStepInFrontOfPlayer - ldr r0, [r7] - ldrb r0, [r0, 0x5] - strb r0, [r4, 0x4] - mov r0, r9 - adds r2, r5, r0 - ldr r0, [r7] - mov r3, r8 - lsls r1, r3, 3 - ldr r3, =0x00000848 - adds r0, r3 - adds r0, r1 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r2] - str r1, [r2, 0x4] - movs r0, 0x64 - strb r0, [r4, 0x5] - mov r0, sp - ldrh r0, [r0] - strh r0, [r4] - ldrh r0, [r6] - strh r0, [r4, 0x2] - b _080FC472 - .pool -_080FC468: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x9 - bls _080FC408 -_080FC472: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80FC3E8 - - thumb_func_start sub_80FC480 -sub_80FC480: @ 80FC480 - push {r4,r5,lr} - movs r4, 0 - ldr r5, =0x0203a054 -_080FC486: - lsls r0, r4, 4 - adds r1, r0, r5 - ldrb r0, [r1, 0x5] - cmp r0, 0 - beq _080FC4A0 - subs r0, 0x1 - strb r0, [r1, 0x5] - lsls r0, 24 - cmp r0, 0 - bne _080FC4A0 - adds r0, r4, 0 - bl sub_80FC228 -_080FC4A0: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x9 - bls _080FC486 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC480 - - thumb_func_start sub_80FC4B4 -sub_80FC4B4: @ 80FC4B4 - push {lr} - bl sub_80FC258 - ldr r3, =0x020375f0 - ldrh r1, [r3] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _080FC4EC - ldr r0, =0x02021dc4 - ldr r2, =0x0203a054 - lsls r1, 4 - adds r1, r2 - ldrb r1, [r1, 0x5] - movs r2, 0x2 - movs r3, 0x3 - bl ConvertIntToDecimalString - movs r0, 0x1 - b _080FC4EE - .pool -_080FC4EC: - movs r0, 0 -_080FC4EE: - pop {r1} - bx r1 - thumb_func_end sub_80FC4B4 - - thumb_func_start sub_80FC4F4 -sub_80FC4F4: @ 80FC4F4 - push {r4,r5,lr} - adds r2, r0, 0 - lsls r4, r1, 16 - lsrs r4, 16 - ldr r5, =0x0201c000 - adds r0, r5, 0 - adds r1, r2, 0 - adds r2, r4, 0 - bl memcpy - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - adds r1, r5, 0 - adds r2, r4, 0 - bl link_0800A448 - lsls r0, 24 - cmp r0, 0 - bne _080FC528 - movs r0, 0 - b _080FC52A - .pool -_080FC528: - movs r0, 0x1 -_080FC52A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80FC4F4 - - thumb_func_start sub_80FC530 -sub_80FC530: @ 80FC530 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0x80 - lsls r4, 17 - lsls r4, r5 - lsrs r4, 24 - bl sub_800A550 - ands r4, r0 - cmp r4, 0 - beq _080FC552 - adds r0, r5, 0 - bl sub_800A5EC - movs r0, 0x1 - b _080FC554 -_080FC552: - movs r0, 0 -_080FC554: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80FC530 - - thumb_func_start sub_80FC55C -sub_80FC55C: @ 80FC55C - push {r4,lr} - bl sub_800A550 - adds r4, r0, 0 - bl sub_800A9D8 - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _080FC574 - movs r0, 0 - b _080FC57A -_080FC574: - bl sub_800A5B4 - movs r0, 0x1 -_080FC57A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80FC55C - - thumb_func_start sub_80FC580 -sub_80FC580: @ 80FC580 - push {r4-r6,lr} - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0 - ldr r5, =0x03005e00 - ldr r6, =sub_80FC5C0 - ldr r4, =0x020223c4 - movs r3, 0xFF -_080FC590: - lsls r0, r1, 8 - adds r0, r4 - strh r3, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x3 - bls _080FC590 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r5 - movs r1, 0 - strh r1, [r0, 0x8] - str r6, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC580 - - thumb_func_start sub_80FC5C0 -sub_80FC5C0: @ 80FC5C0 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =sub_80FC5DC - str r0, [r1] - bx lr - .pool - thumb_func_end sub_80FC5C0 - - thumb_func_start sub_80FC5DC -sub_80FC5DC: @ 80FC5DC - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _080FC650 - bl link_get_multiplayer_id - ldr r1, =0x02039f25 - strb r0, [r1] - bl sub_8009FCC - ldr r4, =0x02039f30 - strb r0, [r4] - ldr r1, =0x02039f2a - movs r0, 0x1 - strb r0, [r1] - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0x1 - bne _080FC60C - movs r0, 0x3 - strb r0, [r1] -_080FC60C: - movs r3, 0 - ldrb r2, [r4] - cmp r3, r2 - bge _080FC64A - ldr r1, =0x020229e8 - ldrb r0, [r1] - subs r0, 0x1 - adds r6, r4, 0 - cmp r0, 0x1 - bls _080FC63A - adds r4, r2, 0 - adds r2, r1, 0 - movs r5, 0xFF -_080FC626: - adds r2, 0x1C - adds r3, 0x1 - cmp r3, r4 - bge _080FC64A - ldrh r1, [r2] - adds r0, r5, 0 - ands r0, r1 - subs r0, 0x1 - cmp r0, 0x1 - bhi _080FC626 -_080FC63A: - ldrb r6, [r6] - cmp r3, r6 - bge _080FC64A - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_080FC64A: - adds r0, r7, 0 - bl SwitchTaskToFollowupFunc -_080FC650: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC5DC - - thumb_func_start sub_80FC670 -sub_80FC670: @ 80FC670 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02039f2a - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _080FC698 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080FC6A0 - cmp r0, 0x1 - beq _080FC6AE - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080FC6B4 -_080FC698: - movs r0, 0x1 - b _080FC6B6 - .pool -_080FC6A0: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080FC6B4 - bl sub_800ADF8 -_080FC6AE: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_080FC6B4: - movs r0, 0 -_080FC6B6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80FC670 - - thumb_func_start sub_80FC6BC -sub_80FC6BC: @ 80FC6BC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r6, r7, 2 - adds r0, r6, r7 - lsls r4, r0, 3 - ldr r5, =0x03005e08 - adds r0, r4, r5 - adds r0, 0x18 - bl sub_80FC670 - cmp r0, 0 - bne _080FC6DC - b _080FC7F4 -_080FC6DC: - adds r0, r5, 0 - subs r0, 0x8 - adds r4, r0 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080FC758 - cmp r0, 0x1 - bgt _080FC6F8 - cmp r0, 0 - beq _080FC6FE - b _080FC7DC - .pool -_080FC6F8: - cmp r0, 0xA - beq _080FC7C0 - b _080FC7DC -_080FC6FE: - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _080FC738 - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080FC7F4 - ldr r0, =0x020228c4 - ldr r1, =0x02039f25 - ldrb r1, [r1] - lsls r1, 6 - ldr r2, =0x02039e00 - adds r1, r2 - movs r2, 0x40 - bl memcpy - movs r0, 0xA - strh r0, [r4, 0x8] - b _080FC7F4 - .pool -_080FC738: - ldr r0, =0x020228c4 - ldr r1, =0x02039f25 - ldrb r1, [r1] - lsls r1, 6 - ldr r2, =0x02039e00 - adds r1, r2 - movs r2, 0x40 - bl memcpy - b _080FC7D6 - .pool -_080FC758: - bl sub_80FC55C - lsls r0, 24 - cmp r0, 0 - beq _080FC7F4 - movs r5, 0 - ldr r0, =0x02039f30 - mov r8, r6 - ldrb r0, [r0] - cmp r5, r0 - bge _080FC798 - ldr r6, =0x020229e8 -_080FC770: - lsls r4, r5, 6 - ldr r0, =0x02039e00 - adds r4, r0 - lsls r1, r5, 8 - ldr r0, =0x020223c4 - adds r1, r0 - adds r0, r4, 0 - movs r2, 0x40 - bl memcpy - ldrh r1, [r6, 0x1A] - adds r0, r4, 0 - bl sub_80DFA08 - adds r6, 0x1C - adds r5, 0x1 - ldr r0, =0x02039f30 - ldrb r0, [r0] - cmp r5, r0 - blt _080FC770 -_080FC798: - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _080FC7F4 - .pool -_080FC7C0: - ldrh r0, [r4, 0x1E] - adds r0, 0x1 - strh r0, [r4, 0x1E] - lsls r0, 16 - movs r1, 0x96 - lsls r1, 17 - cmp r0, r1 - ble _080FC7F4 - movs r0, 0x2 - bl sub_800A4D8 -_080FC7D6: - movs r0, 0x1 - strh r0, [r4, 0x8] - b _080FC7F4 -_080FC7DC: - ldr r0, =0x03005e00 - lsls r1, r7, 2 - adds r1, r7 - lsls r1, 3 - adds r1, r0 - movs r0, 0 - strh r0, [r1, 0x8] - strh r0, [r1, 0x1E] - strh r0, [r1, 0x20] - adds r0, r7, 0 - bl SwitchTaskToFollowupFunc -_080FC7F4: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC6BC - - thumb_func_start sub_80FC804 -sub_80FC804: @ 80FC804 - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _080FC830 - cmp r0, 0x1 - beq _080FC858 - movs r0, 0 - strh r0, [r5, 0x8] - adds r0, r2, 0 - bl SwitchTaskToFollowupFunc - b _080FC880 - .pool -_080FC830: - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _080FC87A - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080FC880 - ldr r0, =0x03005d80 - movs r1, 0x4 - bl sub_80FC4F4 - cmp r0, 0x1 - bne _080FC880 - b _080FC87A - .pool -_080FC858: - movs r0, 0 - bl sub_80FC530 - lsls r0, 24 - cmp r0, 0 - beq _080FC880 - ldr r0, =0x03005d80 - ldr r4, =0x020223c4 - adds r1, r4, 0 - movs r2, 0x4 - bl memcpy - ldr r0, =0x030060b8 - adds r1, r4, 0 - movs r2, 0x4 - bl memcpy -_080FC87A: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] -_080FC880: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC804 - - thumb_func_start sub_80FC894 -sub_80FC894: @ 80FC894 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - mov r8, r0 - adds r0, r6 - lsls r5, r0, 3 - ldr r7, =0x03005e08 - adds r0, r5, r7 - adds r0, 0x18 - bl sub_80FC670 - cmp r0, 0 - beq _080FC986 - movs r1, 0x8 - negs r1, r1 - adds r1, r7 - mov r9, r1 - adds r4, r5, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080FC90C - cmp r0, 0x1 - bgt _080FC8D8 - cmp r0, 0 - beq _080FC8DE - b _080FC96E - .pool -_080FC8D8: - cmp r0, 0xA - beq _080FC954 - b _080FC96E -_080FC8DE: - ldr r1, =0x020228c4 - ldrh r0, [r4, 0x1A] - strb r0, [r1] - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _080FC904 - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080FC986 - movs r0, 0xA - strh r0, [r4, 0x8] - b _080FC986 - .pool -_080FC904: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080FC986 -_080FC90C: - bl sub_80FC55C - lsls r0, 24 - cmp r0, 0 - beq _080FC986 - movs r3, 0 - ldr r1, =0x02039f30 - ldrb r0, [r1] - cmp r3, r0 - bge _080FC93A - ldr r4, =0x020223c4 - adds r0, r7, 0x2 - adds r2, r5, r0 - movs r5, 0x80 - lsls r5, 1 -_080FC92A: - ldrh r0, [r4] - strh r0, [r2] - adds r4, r5 - adds r2, 0x2 - adds r3, 0x1 - ldrb r0, [r1] - cmp r3, r0 - blt _080FC92A -_080FC93A: - mov r0, r8 - adds r1, r0, r6 - lsls r1, 3 - add r1, r9 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _080FC986 - .pool -_080FC954: - ldrh r0, [r4, 0x1E] - adds r0, 0x1 - strh r0, [r4, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - ble _080FC986 - movs r0, 0x2 - bl sub_800A4D8 - movs r0, 0x1 - strh r0, [r4, 0x8] - b _080FC986 -_080FC96E: - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - movs r0, 0 - strh r0, [r1, 0x8] - strh r0, [r1, 0x1E] - strh r0, [r1, 0x20] - adds r0, r6, 0 - bl SwitchTaskToFollowupFunc -_080FC986: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC894 - - thumb_func_start sub_80FC998 -sub_80FC998: @ 80FC998 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080FC9C4 - cmp r0, 0x1 - beq _080FC9E0 - movs r0, 0 - strh r0, [r4, 0x8] - adds r0, r2, 0 - bl SwitchTaskToFollowupFunc - b _080FC9F0 - .pool -_080FC9C4: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080FC9F0 - ldr r0, =0x02039f25 - movs r1, 0x1 - bl sub_80FC4F4 - cmp r0, 0x1 - bne _080FC9F0 - b _080FC9EA - .pool -_080FC9E0: - bl sub_80FC55C - lsls r0, 24 - cmp r0, 0 - beq _080FC9F0 -_080FC9EA: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080FC9F0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80FC998 - - thumb_func_start sub_80FC9F8 -sub_80FC9F8: @ 80FC9F8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x03005e00 - mov r8, r0 - lsls r7, r5, 2 - adds r0, r7, r5 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080FCA30 - cmp r0, 0x1 - beq _080FCA68 - movs r0, 0 - strh r0, [r4, 0x8] - adds r0, r5, 0 - bl SwitchTaskToFollowupFunc - b _080FCAB2 - .pool -_080FCA30: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080FCAB2 - ldr r0, =0x02039f34 - ldr r2, [r0] - ldr r0, =0x02039f25 - ldrb r0, [r0] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r0, [r2, 0x4] - adds r0, r1 - adds r0, 0x6 - movs r1, 0x2 - bl sub_80FC4F4 - cmp r0, 0x1 - bne _080FCAB2 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080FCAB2 - .pool -_080FCA68: - bl sub_80FC55C - lsls r0, 24 - cmp r0, 0 - beq _080FCAB2 - movs r2, 0 - ldr r6, =0x02039f30 - mov r9, r8 - mov r12, r7 - ldrb r0, [r6] - cmp r2, r0 - bge _080FCAA4 - ldr r1, =0x02039f34 - mov r8, r1 - ldr r4, =0x020223c4 - movs r3, 0 - movs r7, 0x80 - lsls r7, 1 -_080FCA8C: - mov r1, r8 - ldr r0, [r1] - ldr r0, [r0, 0x4] - adds r0, r3, r0 - ldrh r1, [r4] - strh r1, [r0, 0x6] - adds r4, r7 - adds r3, 0x1C - adds r2, 0x1 - ldrb r0, [r6] - cmp r2, r0 - blt _080FCA8C -_080FCAA4: - mov r0, r12 - adds r1, r0, r5 - lsls r1, 3 - add r1, r9 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_080FCAB2: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FC9F8 - - thumb_func_start sub_80FCACC -sub_80FCACC: @ 80FCACC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r1 - movs r3, 0x8 - ldrsh r0, [r2, r3] - adds r3, r1, 0 - cmp r0, 0xB - bls _080FCAE8 - b _080FCC78 -_080FCAE8: - lsls r0, 2 - ldr r1, =_080FCAFC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080FCAFC: - .4byte _080FCB2C - .4byte _080FCB44 - .4byte _080FCB6C - .4byte _080FCB90 - .4byte _080FCBA4 - .4byte _080FCB6C - .4byte _080FCBCC - .4byte _080FCBE0 - .4byte _080FCB6C - .4byte _080FCC08 - .4byte _080FCC38 - .4byte _080FCB6C -_080FCB2C: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _080FCB38 - b _080FCC82 -_080FCB38: - ldr r0, =0x02039f08 - movs r1, 0x8 - b _080FCC16 - .pool -_080FCB44: - bl sub_80FC55C - lsls r0, 24 - cmp r0, 0 - bne _080FCB50 - b _080FCC82 -_080FCB50: - ldr r0, =0x02039f08 - ldr r1, =0x02039f2b - ldrb r1, [r1] - lsls r1, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0x8 - b _080FCC50 - .pool -_080FCB6C: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r3 - ldrh r0, [r2, 0xA] - adds r1, r0, 0x1 - strh r1, [r2, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bgt _080FCB84 - b _080FCC82 -_080FCB84: - movs r0, 0 - strh r0, [r2, 0xA] - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - b _080FCC82 -_080FCB90: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080FCC82 - ldr r0, =0x02039f10 - movs r1, 0x8 - b _080FCC16 - .pool -_080FCBA4: - bl sub_80FC55C - lsls r0, 24 - cmp r0, 0 - beq _080FCC82 - ldr r0, =0x02039f10 - ldr r1, =0x02039f2b - ldrb r1, [r1] - lsls r1, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0x8 - b _080FCC50 - .pool -_080FCBCC: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080FCC82 - ldr r0, =0x02039f18 - movs r1, 0x8 - b _080FCC16 - .pool -_080FCBE0: - bl sub_80FC55C - lsls r0, 24 - cmp r0, 0 - beq _080FCC82 - ldr r0, =0x02039f18 - ldr r1, =0x02039f2b - ldrb r1, [r1] - lsls r1, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0x8 - b _080FCC50 - .pool -_080FCC08: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080FCC82 - ldr r0, =0x02039f20 - movs r1, 0x4 -_080FCC16: - bl sub_80FC4F4 - cmp r0, 0x1 - bne _080FCC82 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _080FCC82 - .pool -_080FCC38: - bl sub_80FC55C - lsls r0, 24 - cmp r0, 0 - beq _080FCC82 - ldr r0, =0x02039f20 - ldr r1, =0x02039f2b - ldrb r1, [r1] - lsls r1, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0x4 -_080FCC50: - bl memcpy - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - b _080FCC82 - .pool -_080FCC78: - movs r0, 0 - strh r0, [r2, 0x8] - adds r0, r4, 0 - bl SwitchTaskToFollowupFunc -_080FCC82: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80FCACC - - thumb_func_start sub_80FCC88 -sub_80FCC88: @ 80FCC88 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r1 - movs r3, 0x8 - ldrsh r0, [r2, r3] - adds r3, r1, 0 - cmp r0, 0xB - bls _080FCCA4 - b _080FCE38 -_080FCCA4: - lsls r0, 2 - ldr r1, =_080FCCB8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080FCCB8: - .4byte _080FCCE8 - .4byte _080FCD04 - .4byte _080FCD30 - .4byte _080FCD54 - .4byte _080FCD6C - .4byte _080FCD30 - .4byte _080FCD98 - .4byte _080FCDB0 - .4byte _080FCD30 - .4byte _080FCDC8 - .4byte _080FCDF8 - .4byte _080FCD30 -_080FCCE8: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _080FCCF4 - b _080FCE42 -_080FCCF4: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x4] - movs r1, 0x70 - b _080FCDD6 - .pool -_080FCD04: - bl sub_80FC55C - lsls r0, 24 - cmp r0, 0 - bne _080FCD10 - b _080FCE42 -_080FCD10: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x4] - ldr r1, =0x02039f2b - ldrb r1, [r1] - lsls r1, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0x70 - b _080FCE10 - .pool -_080FCD30: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r3 - ldrh r0, [r2, 0xA] - adds r1, r0, 0x1 - strh r1, [r2, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bgt _080FCD48 - b _080FCE42 -_080FCD48: - movs r0, 0 - strh r0, [r2, 0xA] - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - b _080FCE42 -_080FCD54: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080FCE42 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - movs r1, 0x14 - b _080FCDD6 - .pool -_080FCD6C: - bl sub_80FC55C - lsls r0, 24 - cmp r0, 0 - beq _080FCE42 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldr r1, =0x02039f2b - ldrb r1, [r1] - lsls r1, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0x14 - b _080FCE10 - .pool -_080FCD98: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080FCE42 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x10] - b _080FCDD4 - .pool -_080FCDB0: - bl sub_80FC55C - lsls r0, 24 - cmp r0, 0 - beq _080FCE42 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x10] - b _080FCE04 - .pool -_080FCDC8: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080FCE42 - ldr r0, =0x02039f26 -_080FCDD4: - movs r1, 0x4 -_080FCDD6: - bl sub_80FC4F4 - cmp r0, 0x1 - bne _080FCE42 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _080FCE42 - .pool -_080FCDF8: - bl sub_80FC55C - lsls r0, 24 - cmp r0, 0 - beq _080FCE42 - ldr r0, =0x02039f26 -_080FCE04: - ldr r1, =0x02039f2b - ldrb r1, [r1] - lsls r1, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0x4 -_080FCE10: - bl memcpy - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - b _080FCE42 - .pool -_080FCE38: - movs r0, 0 - strh r0, [r2, 0x8] - adds r0, r4, 0 - bl SwitchTaskToFollowupFunc -_080FCE42: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80FCC88 - - thumb_func_start sub_80FCE48 -sub_80FCE48: @ 80FCE48 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - mov r8, r0 - adds r0, r6 - lsls r5, r0, 3 - ldr r7, =0x03005e08 - adds r0, r5, r7 - adds r0, 0x18 - bl sub_80FC670 - cmp r0, 0 - beq _080FCF2E - movs r1, 0x8 - negs r1, r1 - adds r1, r7 - mov r9, r1 - adds r4, r5, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _080FCEC0 - cmp r0, 0x1 - bgt _080FCE8C - cmp r0, 0 - beq _080FCE92 - b _080FCF16 - .pool -_080FCE8C: - cmp r0, 0xA - beq _080FCEFC - b _080FCF16 -_080FCE92: - ldr r1, =0x020228c4 - movs r0, 0x6E - strb r0, [r1] - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _080FCEB8 - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080FCF2E - movs r0, 0xA - strh r0, [r4, 0x8] - b _080FCF2E - .pool -_080FCEB8: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _080FCF2E -_080FCEC0: - bl sub_80FC55C - lsls r0, 24 - cmp r0, 0 - beq _080FCF2E - mov r1, r8 - mov r8, r9 - ldr r4, =0x020223c4 - adds r0, r7, 0 - adds r0, 0xA - adds r2, r5, r0 - movs r5, 0x80 - lsls r5, 1 - movs r3, 0x3 -_080FCEDC: - ldrh r0, [r4] - strh r0, [r2] - adds r4, r5 - adds r2, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _080FCEDC - adds r1, r6 - lsls r1, 3 - add r1, r8 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _080FCF2E - .pool -_080FCEFC: - ldrh r0, [r4, 0x1E] - adds r0, 0x1 - strh r0, [r4, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - ble _080FCF2E - movs r0, 0x2 - bl sub_800A4D8 - movs r0, 0x1 - strh r0, [r4, 0x8] - b _080FCF2E -_080FCF16: - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - movs r0, 0 - strh r0, [r1, 0x8] - strh r0, [r1, 0x1E] - strh r0, [r1, 0x20] - adds r0, r6, 0 - bl SwitchTaskToFollowupFunc -_080FCF2E: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FCE48 - - thumb_func_start sub_80FCF40 -sub_80FCF40: @ 80FCF40 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r4, r0, 3 - ldr r6, =0x03005e08 - adds r0, r4, r6 - adds r0, 0x18 - bl sub_80FC670 - cmp r0, 0 - beq _080FCFBE - adds r0, r6, 0 - subs r0, 0x8 - adds r4, r0 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080FCF80 - cmp r0, 0x1 - beq _080FCF9C - movs r0, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0x20] - adds r0, r5, 0 - bl SwitchTaskToFollowupFunc - b _080FCFBE - .pool -_080FCF80: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080FCFBE - ldr r0, =0x02039f00 - movs r1, 0x8 - bl sub_80FC4F4 - cmp r0, 0x1 - bne _080FCFBE - b _080FCFB8 - .pool -_080FCF9C: - bl sub_80FC55C - lsls r0, 24 - cmp r0, 0 - beq _080FCFBE - ldr r0, =0x02039f00 - ldr r1, =0x02039f2b - ldrb r1, [r1] - lsls r1, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0x8 - bl memcpy -_080FCFB8: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080FCFBE: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FCF40 - - thumb_func_start sub_80FCFD0 -sub_80FCFD0: @ 80FCFD0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r4, r0, 3 - ldr r6, =0x03005e08 - adds r0, r4, r6 - adds r0, 0x18 - bl sub_80FC670 - cmp r0, 0 - beq _080FD04E - adds r0, r6, 0 - subs r0, 0x8 - adds r4, r0 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080FD010 - cmp r0, 0x1 - beq _080FD02C - movs r0, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0x20] - adds r0, r5, 0 - bl SwitchTaskToFollowupFunc - b _080FD04E - .pool -_080FD010: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _080FD04E - ldr r0, =0x02039f26 - movs r1, 0x4 - bl sub_80FC4F4 - cmp r0, 0x1 - bne _080FD04E - b _080FD048 - .pool -_080FD02C: - bl sub_80FC55C - lsls r0, 24 - cmp r0, 0 - beq _080FD04E - ldr r0, =0x02039f26 - ldr r1, =0x02039f2b - ldrb r1, [r1] - lsls r1, 8 - ldr r2, =0x020223c4 - adds r1, r2 - movs r2, 0x4 - bl memcpy -_080FD048: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080FD04E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FCFD0 - - thumb_func_start SetUpItemUseCallback -@ void SetUpItemUseCallback(u8 taskId) -SetUpItemUseCallback: @ 80FD060 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x0203ce7c - ldrh r0, [r1] - cmp r0, 0xAF - bne _080FD084 - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldrb r0, [r1, 0x10] - b _080FD08A - .pool -_080FD084: - ldrh r0, [r1] - bl itemid_get_type -_080FD08A: - subs r0, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _080FD0B8 - ldr r0, =0x0203ce54 - ldr r2, [r0] - ldr r1, =gUnknown_085920D8 - lsls r0, r4, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [r2] - adds r0, r5, 0 - bl unknown_ItemMenu_Confirm - b _080FD0CC - .pool -_080FD0B8: - ldr r0, =0x0203cf2c - ldr r2, [r0] - ldr r1, =gUnknown_085920D8 - lsls r0, r4, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [r2] - adds r0, r5, 0 - bl sub_81C5B14 -_080FD0CC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end SetUpItemUseCallback - - thumb_func_start SetUpItemUseOnFieldCallback -@ void SetUpItemUseOnFieldCallback() -SetUpItemUseOnFieldCallback: @ 80FD0DC - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r1, 0xE - ldrsh r0, [r0, r1] - cmp r0, 0x1 - beq _080FD110 - ldr r1, =0x03005dac - ldr r0, =MapPostLoadHook_UseItem - str r0, [r1] - adds r0, r2, 0 - bl SetUpItemUseCallback - b _080FD11A - .pool -_080FD110: - ldr r0, =0x0203a0f4 - ldr r1, [r0] - adds r0, r2, 0 - bl _call_via_r1 -_080FD11A: - pop {r0} - bx r0 - .pool - thumb_func_end SetUpItemUseOnFieldCallback - - thumb_func_start MapPostLoadHook_UseItem -@ void MapPostLoadHook_UseItem() -MapPostLoadHook_UseItem: @ 80FD124 - push {lr} - bl pal_fill_black - ldr r0, =Task_CallItemUseOnFieldCallback - movs r1, 0x8 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end MapPostLoadHook_UseItem - - thumb_func_start Task_CallItemUseOnFieldCallback -@ void Task_CallItemUseOnFieldCallback(u8 taskId) -Task_CallItemUseOnFieldCallback: @ 80FD13C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80ABDFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080FD158 - ldr r0, =0x0203a0f4 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 -_080FD158: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end Task_CallItemUseOnFieldCallback - - thumb_func_start DisplayCannotUseItemMessage -@ void DisplayCannotUseItemMessage(u8 taskId, bool8 isUsingRegisteredKeyItemOnField, u8 *str) -DisplayCannotUseItemMessage: @ 80FD164 - push {r4-r6,lr} - adds r4, r1, 0 - adds r1, r2, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r6, =0x02021fc4 - adds r0, r6, 0 - bl ExpandStringRefs - cmp r4, 0 - bne _080FD1B4 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _080FD1A0 - ldr r3, =bag_menu_inits_lists_menu - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r6, 0 - bl DisplayItemMessage - b _080FD1BE - .pool -_080FD1A0: - ldr r1, =gUnknown_085E8F31 - ldr r2, =sub_81C6714 - adds r0, r5, 0 - bl DisplayItemMessageInBattlePyramid - b _080FD1BE - .pool -_080FD1B4: - ldr r2, =CleanUpAfterFailingToUseRegisteredKeyItemOnField - adds r0, r5, 0 - adds r1, r6, 0 - bl DisplayItemMessageOnField -_080FD1BE: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end DisplayCannotUseItemMessage - - thumb_func_start DisplayDadsAdviceCannotUseItemMessage -@ void DisplayDadsAdviceCannotUseItemMessage(u8 taskId, bool8 isUsingRegisteredKeyItemOnField) -DisplayDadsAdviceCannotUseItemMessage: @ 80FD1C8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085E8F31 - bl DisplayCannotUseItemMessage - pop {r0} - bx r0 - .pool - thumb_func_end DisplayDadsAdviceCannotUseItemMessage - - thumb_func_start DisplayCannotDismountBikeMessage -@ void DisplayCannotDismountBikeMessage(u8 taskId, bool8 isUsingRegisteredKeyItemOnField) -DisplayCannotDismountBikeMessage: @ 80FD1E0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085E8F6E - bl DisplayCannotUseItemMessage - pop {r0} - bx r0 - .pool - thumb_func_end DisplayCannotDismountBikeMessage - - thumb_func_start CleanUpAfterFailingToUseRegisteredKeyItemOnField -@ void CleanUpAfterFailingToUseRegisteredKeyItemOnField(u8 taskId) -CleanUpAfterFailingToUseRegisteredKeyItemOnField: @ 80FD1F8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - adds r0, r4, 0 - bl DestroyTask - bl sub_80984F4 - bl script_env_2_disable - pop {r4} - pop {r0} - bx r0 - thumb_func_end CleanUpAfterFailingToUseRegisteredKeyItemOnField - - thumb_func_start CheckIfItemIsTMHMOrEvolutionStone -@ u8 CheckIfItemIsTMHMOrEvolutionStone(u16 itemId) -CheckIfItemIsTMHMOrEvolutionStone: @ 80FD21C - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl itemid_get_overworld_function - ldr r1, =ItemUseOutOfBattle_TMHM - cmp r0, r1 - bne _080FD238 - movs r0, 0x1 - b _080FD24E - .pool -_080FD238: - adds r0, r4, 0 - bl itemid_get_overworld_function - ldr r1, =ItemUseOutOfBattle_EvolutionStone - cmp r0, r1 - beq _080FD24C - movs r0, 0 - b _080FD24E - .pool -_080FD24C: - movs r0, 0x2 -_080FD24E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end CheckIfItemIsTMHMOrEvolutionStone - - thumb_func_start sub_80FD254 -sub_80FD254: @ 80FD254 - push {lr} - sub sp, 0x24 - mov r1, sp - ldr r0, =0x0203ce7c - ldrh r0, [r0] - strh r0, [r1, 0x20] - ldr r1, =bag_menu_mail_related - mov r0, sp - movs r2, 0 - bl sub_8121478 - add sp, 0x24 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FD254 - - thumb_func_start ItemUseOutOfBattle_Mail -@ void ItemUseOutOfBattle_Mail(int taskId) -ItemUseOutOfBattle_Mail: @ 80FD278 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0203ce54 - ldr r2, [r1] - ldr r1, =sub_80FD254 - str r1, [r2] - bl unknown_ItemMenu_Confirm - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseOutOfBattle_Mail - - thumb_func_start ItemUseOutOfBattle_Bike -@ void ItemUseOutOfBattle_Bike(int taskId) -ItemUseOutOfBattle_Bike: @ 80FD298 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r6, r0, r1 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0000088b - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080FD30E - adds r0, r4, 0 - bl MetatileBehavior_IsVerticalRail - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080FD30E - adds r0, r4, 0 - bl MetatileBehavior_IsHorizontalRail - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080FD30E - adds r0, r4, 0 - bl MetatileBehavior_IsIsolatedVerticalRail - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080FD30E - adds r0, r4, 0 - bl MetatileBehavior_IsIsolatedHorizontalRail - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080FD320 -_080FD30E: - ldrb r1, [r6, 0x6] - adds r0, r5, 0 - bl DisplayCannotDismountBikeMessage - b _080FD350 - .pool -_080FD320: - bl sav1_map_is_biking_allowed - cmp r0, 0x1 - bne _080FD348 - bl sub_8119FF8 - lsls r0, 24 - cmp r0, 0 - bne _080FD348 - ldr r1, =0x0203a0f4 - ldr r0, =ItemUseOnFieldCB_Bike - str r0, [r1] - adds r0, r5, 0 - bl SetUpItemUseOnFieldCallback - b _080FD350 - .pool -_080FD348: - ldrb r1, [r6, 0x6] - adds r0, r5, 0 - bl DisplayDadsAdviceCannotUseItemMessage -_080FD350: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end ItemUseOutOfBattle_Bike - - thumb_func_start ItemUseOnFieldCB_Bike -ItemUseOnFieldCB_Bike: @ 80FD358 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0203ce7c - ldrh r0, [r0] - bl itemid_get_x28 - lsls r0, 24 - cmp r0, 0 - bne _080FD378 - movs r0, 0x2 - bl GetOnOffBike - b _080FD37E - .pool -_080FD378: - movs r0, 0x4 - bl GetOnOffBike -_080FD37E: - bl sub_80984F4 - bl script_env_2_disable - adds r0, r4, 0 - bl DestroyTask - pop {r4} - pop {r0} - bx r0 - thumb_func_end ItemUseOnFieldCB_Bike - - thumb_func_start CanFish -@ bool8 CanFish() -CanFish: @ 80FD394 - push {r4-r6,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, 16 - lsrs r6, r0, 16 - lsls r0, r6, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - bl MetatileBehavior_IsWaterfall - lsls r0, 24 - cmp r0, 0 - bne _080FD41C - movs r0, 0x10 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - bne _080FD41C - movs r0, 0x8 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - bne _080FD3EC - bl IsPlayerFacingSurfableFishableWater - lsls r0, 24 - cmp r0, 0 - beq _080FD41C -_080FD3E8: - movs r0, 0x1 - b _080FD41E -_080FD3EC: - adds r0, r5, 0 - bl MetatileBehavior_IsSurfableWaterOrUnderwater - lsls r0, 24 - cmp r0, 0 - beq _080FD40C - mov r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r4, r2] - bl MapGridIsImpassableAt - lsls r0, 24 - cmp r0, 0 - beq _080FD3E8 -_080FD40C: - lsls r0, r6, 24 - lsrs r0, 24 - bl sub_8089510 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080FD3E8 -_080FD41C: - movs r0, 0 -_080FD41E: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end CanFish - - thumb_func_start ItemUseOutOfBattle_Rod -ItemUseOutOfBattle_Rod: @ 80FD428 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl CanFish - cmp r0, 0x1 - bne _080FD44C - ldr r1, =0x0203a0f4 - ldr r0, =ItemUseOnFieldCB_Rod - str r0, [r1] - adds r0, r4, 0 - bl SetUpItemUseOnFieldCallback - b _080FD45E - .pool -_080FD44C: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrb r1, [r1, 0xE] - adds r0, r4, 0 - bl DisplayDadsAdviceCannotUseItemMessage -_080FD45E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseOutOfBattle_Rod - - thumb_func_start ItemUseOnFieldCB_Rod -ItemUseOnFieldCB_Rod: @ 80FD468 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x0203ce7c - ldrh r0, [r0] - bl itemid_get_x28 - lsls r0, 24 - lsrs r0, 24 - bl StartFishing - adds r0, r4, 0 - bl DestroyTask - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseOnFieldCB_Rod - - thumb_func_start ItemUseOutOfBattle_Itemfinder -ItemUseOutOfBattle_Itemfinder: @ 80FD490 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x27 - bl sav12_xor_increment - ldr r1, =0x0203a0f4 - ldr r0, =ItemUseOnFieldCB_Itemfinder - str r0, [r1] - adds r0, r4, 0 - bl SetUpItemUseOnFieldCallback - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseOutOfBattle_Itemfinder - - thumb_func_start ItemUseOnFieldCB_Itemfinder -ItemUseOnFieldCB_Itemfinder: @ 80FD4B8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037318 - ldr r0, [r0, 0x4] - adds r1, r4, 0 - bl ItemfinderCheckForHiddenItems - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080FD4EC - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80FD504 - str r0, [r1] - b _080FD4F6 - .pool -_080FD4EC: - ldr r1, =gUnknown_085E9002 - ldr r2, =sub_80FD5CC - adds r0, r4, 0 - bl DisplayItemMessageOnField -_080FD4F6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseOnFieldCB_Itemfinder - - thumb_func_start sub_80FD504 -sub_80FD504: @ 80FD504 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r6, r5, 2 - adds r0, r6, r5 - lsls r7, r0, 3 - ldr r0, =0x03005e08 - mov r8, r0 - adds r4, r7, r0 - movs r1, 0x6 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080FD5B8 - movs r2, 0x8 - ldrsh r0, [r4, r2] - cmp r0, 0x4 - bne _080FD5AC - movs r1, 0 - ldrsh r0, [r4, r1] - movs r2, 0x2 - ldrsh r1, [r4, r2] - bl sub_80FD9B0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _080FD564 - ldr r1, =gUnknown_085920E4 - subs r0, 0x1 - adds r0, r1 - ldrb r0, [r0] - bl sub_80FDA24 - mov r0, r8 - subs r0, 0x8 - adds r0, r7, r0 - ldr r1, =sub_80FDA94 - str r1, [r0] - b _080FD5C2 - .pool -_080FD564: - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0 - adds r3, r6, 0 - ldr r7, =gUnknown_085920E4 - movs r6, 0x3 -_080FD574: - adds r0, r1, r7 - adds r1, 0x1 - ldrb r0, [r0] - cmp r2, r0 - bne _080FD584 - adds r0, r1, 0 - ands r0, r6 - strh r0, [r4, 0xA] -_080FD584: - lsls r0, r1, 24 - lsrs r1, r0, 24 - cmp r1, 0x3 - bls _080FD574 - ldr r1, =0x03005e00 - adds r0, r3, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80FDADC - str r1, [r0] - movs r0, 0 - strh r0, [r4, 0x6] - strh r0, [r4, 0x4] - b _080FD5C2 - .pool -_080FD5AC: - movs r0, 0x48 - bl audio_play - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080FD5B8: - ldrh r0, [r4, 0x6] - adds r0, 0x1 - movs r1, 0x1F - ands r0, r1 - strh r0, [r4, 0x6] -_080FD5C2: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80FD504 - - thumb_func_start sub_80FD5CC -sub_80FD5CC: @ 80FD5CC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - bl sub_80984F4 - bl script_env_2_disable - adds r0, r4, 0 - bl DestroyTask - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80FD5CC - - thumb_func_start ItemfinderCheckForHiddenItems -@ bool8 ItemfinderCheckForHiddenItems(struct map_events *events, u8 taskId) -ItemfinderCheckForHiddenItems: @ 80FD5F0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - adds r5, r0, 0 - lsls r1, 24 - lsrs r6, r1, 24 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0xC] - movs r3, 0 - mov r9, r4 - ldrb r0, [r5, 0x3] - cmp r3, r0 - bge _080FD6A4 - subs r1, 0x5 - mov r8, r1 -_080FD628: - lsls r3, 16 - asrs r1, r3, 16 - ldr r2, [r5, 0x10] - lsls r0, r1, 1 - adds r0, r1 - lsls r4, r0, 2 - adds r1, r4, r2 - ldrb r0, [r1, 0x5] - adds r7, r3, 0 - cmp r0, 0x7 - bne _080FD694 - movs r2, 0xFA - lsls r2, 1 - adds r0, r2, 0 - ldrh r1, [r1, 0xA] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _080FD694 - ldr r1, [r5, 0x10] - adds r1, r4, r1 - ldrh r2, [r1] - adds r2, 0x7 - mov r0, sp - ldrh r0, [r0] - subs r2, r0 - ldrh r0, [r1, 0x2] - adds r0, 0x7 - mov r3, r9 - ldrh r1, [r3] - subs r0, r1 - lsls r0, 16 - lsrs r0, 16 - lsls r2, 16 - asrs r1, r2, 16 - movs r3, 0xE0 - lsls r3, 11 - adds r2, r3 - lsrs r2, 16 - cmp r2, 0xE - bhi _080FD694 - lsls r0, 16 - asrs r2, r0, 16 - cmp r2, r8 - blt _080FD694 - cmp r2, 0x5 - bgt _080FD694 - adds r0, r6, 0 - bl sub_80FD8E0 -_080FD694: - movs r1, 0x80 - lsls r1, 9 - adds r0, r7, r1 - lsrs r3, r0, 16 - asrs r0, 16 - ldrb r2, [r5, 0x3] - cmp r0, r2 - blt _080FD628 -_080FD6A4: - adds r0, r6, 0 - bl sub_80FD7C8 - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - movs r3, 0xC - ldrsh r0, [r1, r3] - cmp r0, 0x1 - beq _080FD6C4 - movs r0, 0 - b _080FD6C6 - .pool -_080FD6C4: - movs r0, 0x1 -_080FD6C6: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end ItemfinderCheckForHiddenItems - - thumb_func_start sub_80FD6D4 -sub_80FD6D4: @ 80FD6D4 - push {r4-r6,lr} - lsls r1, 16 - lsrs r3, r1, 16 - lsls r2, 16 - lsrs r4, r2, 16 - ldrb r2, [r0, 0x3] - ldr r5, [r0, 0x10] - movs r1, 0 - cmp r1, r2 - bge _080FD728 - lsls r0, r3, 16 - asrs r6, r0, 16 - lsls r0, r4, 16 - asrs r4, r0, 16 - adds r3, r5, 0 -_080FD6F2: - ldrb r0, [r3, 0x5] - cmp r0, 0x7 - bne _080FD720 - ldrh r0, [r3] - cmp r6, r0 - bne _080FD720 - ldrh r0, [r3, 0x2] - cmp r4, r0 - bne _080FD720 - movs r1, 0xFA - lsls r1, 1 - adds r0, r1, 0 - ldrh r3, [r3, 0xA] - adds r0, r3 - lsls r0, 16 - lsrs r0, 16 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _080FD728 - movs r0, 0x1 - b _080FD72A -_080FD720: - adds r3, 0xC - adds r1, 0x1 - cmp r1, r2 - blt _080FD6F2 -_080FD728: - movs r0, 0 -_080FD72A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80FD6D4 - - thumb_func_start sub_80FD730 -sub_80FD730: @ 80FD730 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - bl mapconnection_get_mapheader - adds r3, r0, 0 - ldrb r0, [r4] - cmp r0, 0x2 - beq _080FD758 - cmp r0, 0x2 - bgt _080FD74E - cmp r0, 0x1 - beq _080FD76C - b _080FD7AC -_080FD74E: - cmp r0, 0x3 - beq _080FD784 - cmp r0, 0x4 - beq _080FD78E - b _080FD7AC -_080FD758: - ldr r0, [r4, 0x4] - adds r0, 0x7 - subs r0, r5, r0 - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, [r3] - ldr r0, [r0, 0x4] - subs r0, 0x7 - adds r0, r6 - b _080FD7A2 -_080FD76C: - ldr r0, [r4, 0x4] - adds r0, 0x7 - subs r0, r5, r0 - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x02037318 - ldr r0, [r0] - ldr r0, [r0, 0x4] - b _080FD79E - .pool -_080FD784: - ldr r0, [r3] - ldr r0, [r0] - subs r0, 0x7 - adds r0, r5 - b _080FD798 -_080FD78E: - ldr r0, =0x02037318 - ldr r0, [r0] - ldr r0, [r0] - adds r0, 0x7 - subs r0, r5, r0 -_080FD798: - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, [r4, 0x4] -_080FD79E: - adds r0, 0x7 - subs r0, r6, r0 -_080FD7A2: - lsls r0, 16 - lsrs r2, r0, 16 - b _080FD7B0 - .pool -_080FD7AC: - movs r0, 0 - b _080FD7C2 -_080FD7B0: - ldr r0, [r3, 0x4] - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - bl sub_80FD6D4 - lsls r0, 24 - lsrs r0, 24 -_080FD7C2: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80FD730 - - thumb_func_start sub_80FD7C8 -sub_80FD7C8: @ 80FD7C8 - 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, 0x4] - ldr r0, =0x02037318 - ldr r1, [r0] - ldr r0, [r1] - adds r0, 0x7 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x8] - ldr r0, [r1, 0x4] - adds r0, 0x7 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0xC] - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - mov r0, sp - ldrh r0, [r0] - subs r0, 0x7 - lsls r0, 16 - lsrs r3, r0, 16 - asrs r0, 16 - mov r1, sp - movs r2, 0 - ldrsh r1, [r1, r2] - adds r1, 0x7 - cmp r0, r1 - bgt _080FD8CC -_080FD816: - mov r5, sp - ldrh r0, [r5, 0x2] - subs r0, 0x5 - lsls r0, 16 - lsrs r4, r0, 16 - lsls r2, r4, 16 - asrs r1, r2, 16 - movs r6, 0x2 - ldrsh r0, [r5, r6] - adds r0, 0x5 - lsls r3, 16 - mov r8, r3 - cmp r1, r0 - bgt _080FD8B6 - movs r0, 0x7 - str r0, [sp, 0x10] - mov r1, r8 - asrs r1, 16 - mov r9, r1 - mov r10, r0 -_080FD83E: - ldr r3, [sp, 0x10] - cmp r3, r9 - bgt _080FD860 - ldr r5, [sp, 0x8] - lsls r0, r5, 16 - asrs r0, 16 - cmp r9, r0 - bge _080FD860 - asrs r1, r2, 16 - cmp r10, r1 - bgt _080FD860 - ldr r6, [sp, 0xC] - lsls r0, r6, 16 - asrs r0, 16 - lsls r7, r4, 16 - cmp r1, r0 - blt _080FD89E -_080FD860: - mov r0, r8 - asrs r5, r0, 16 - lsls r4, 16 - asrs r6, r4, 16 - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_8088A8C - adds r7, r4, 0 - cmp r0, 0 - beq _080FD89E - adds r1, r5, 0 - adds r2, r6, 0 - bl sub_80FD730 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080FD89E - mov r0, sp - ldrh r1, [r0] - subs r1, r5, r1 - lsls r1, 16 - asrs r1, 16 - ldrh r2, [r0, 0x2] - subs r2, r6, r2 - lsls r2, 16 - asrs r2, 16 - ldr r0, [sp, 0x4] - bl sub_80FD8E0 -_080FD89E: - movs r1, 0x80 - lsls r1, 9 - adds r0, r7, r1 - lsrs r4, r0, 16 - lsls r2, r4, 16 - asrs r1, r2, 16 - mov r3, sp - movs r5, 0x2 - ldrsh r0, [r3, r5] - adds r0, 0x5 - cmp r1, r0 - ble _080FD83E -_080FD8B6: - movs r1, 0x80 - lsls r1, 9 - add r1, r8 - lsrs r3, r1, 16 - asrs r1, 16 - mov r0, sp - movs r6, 0 - ldrsh r0, [r0, r6] - adds r0, 0x7 - cmp r1, r0 - ble _080FD816 -_080FD8CC: - 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_80FD7C8 - - thumb_func_start sub_80FD8E0 -sub_80FD8E0: @ 80FD8E0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 16 - lsrs r2, 16 - mov r12, r2 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r3, r1, r0 - movs r1, 0x4 - ldrsh r0, [r3, r1] - cmp r0, 0 - bne _080FD918 - strh r7, [r3] - mov r0, r12 - strh r0, [r3, 0x2] - movs r0, 0x1 - strh r0, [r3, 0x4] - b _080FD9A2 - .pool -_080FD918: - movs r1, 0 - ldrsh r0, [r3, r1] - cmp r0, 0 - bge _080FD928 - negs r0, r0 - lsls r0, 16 - lsrs r4, r0, 16 - b _080FD92A -_080FD928: - ldrh r4, [r3] -_080FD92A: - movs r1, 0x2 - ldrsh r0, [r3, r1] - ldrh r1, [r3, 0x2] - mov r9, r1 - cmp r0, 0 - bge _080FD93E - negs r0, r0 - lsls r0, 16 - lsrs r2, r0, 16 - b _080FD940 -_080FD93E: - ldrh r2, [r3, 0x2] -_080FD940: - lsls r1, r7, 16 - asrs r0, r1, 16 - cmp r0, 0 - bge _080FD950 - negs r0, r0 - lsls r0, 16 - lsrs r6, r0, 16 - b _080FD952 -_080FD950: - lsrs r6, r1, 16 -_080FD952: - mov r1, r12 - lsls r0, r1, 16 - asrs r1, r0, 16 - mov r8, r0 - cmp r1, 0 - bge _080FD964 - negs r0, r1 - lsls r0, 16 - b _080FD966 -_080FD964: - mov r0, r8 -_080FD966: - lsrs r5, r0, 16 - lsls r0, r4, 16 - asrs r0, 16 - lsls r1, r2, 16 - asrs r2, r1, 16 - adds r4, r0, r2 - lsls r0, r6, 16 - asrs r0, 16 - lsls r1, r5, 16 - asrs r1, 16 - adds r0, r1 - cmp r4, r0 - ble _080FD988 - strh r7, [r3] - mov r1, r12 - strh r1, [r3, 0x2] - b _080FD9A2 -_080FD988: - cmp r4, r0 - bne _080FD9A2 - cmp r2, r1 - bgt _080FD99C - cmp r2, r1 - bne _080FD9A2 - mov r1, r9 - lsls r0, r1, 16 - cmp r0, r8 - bge _080FD9A2 -_080FD99C: - strh r7, [r3] - mov r0, r12 - strh r0, [r3, 0x2] -_080FD9A2: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80FD8E0 - - thumb_func_start sub_80FD9B0 -sub_80FD9B0: @ 80FD9B0 - push {r4,r5,lr} - lsls r0, 16 - lsls r1, 16 - lsrs r1, 16 - lsrs r2, r0, 16 - cmp r0, 0 - bne _080FD9C2 - cmp r1, 0 - beq _080FDA1C -_080FD9C2: - lsls r0, r2, 16 - asrs r2, r0, 16 - adds r5, r0, 0 - cmp r2, 0 - bge _080FD9D4 - negs r0, r2 - lsls r0, 16 - lsrs r4, r0, 16 - b _080FD9D6 -_080FD9D4: - lsrs r4, r5, 16 -_080FD9D6: - lsls r0, r1, 16 - asrs r2, r0, 16 - adds r1, r0, 0 - cmp r2, 0 - bge _080FD9E8 - negs r0, r2 - lsls r0, 16 - lsrs r3, r0, 16 - b _080FD9EA -_080FD9E8: - lsrs r3, r1, 16 -_080FD9EA: - lsls r0, r4, 16 - asrs r2, r0, 16 - lsls r0, r3, 16 - asrs r0, 16 - cmp r2, r0 - ble _080FDA02 - cmp r5, 0 - bge _080FD9FE - movs r0, 0x4 - b _080FDA1E -_080FD9FE: - movs r0, 0x2 - b _080FDA1E -_080FDA02: - cmp r2, r0 - bge _080FDA0C - cmp r1, 0 - blt _080FDA14 - b _080FDA18 -_080FDA0C: - cmp r2, r0 - bne _080FDA1C - cmp r1, 0 - bge _080FDA18 -_080FDA14: - movs r0, 0x1 - b _080FDA1E -_080FDA18: - movs r0, 0x3 - b _080FDA1E -_080FDA1C: - movs r0, 0 -_080FDA1E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80FD9B0 - - thumb_func_start sub_80FDA24 -sub_80FDA24: @ 80FDA24 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - 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 r4, =0x02037350 - adds r0, r4 - bl FieldObjectClearAnimIfSpecialAnimFinished - 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 - adds r0, r4 - bl FieldObjectClearAnim - 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 - adds r0, r4 - bl npc_sync_anim_pause_bits - adds r0, r5, 0 - bl PlayerTurnInPlace - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FDA24 - - thumb_func_start sub_80FDA94 -sub_80FDA94: @ 80FDA94 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - 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, =0x02037350 - adds r0, r1 - bl FieldObjectCheckIfSpecialAnimFinishedOrInactive - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080FDACA - ldr r1, =gUnknown_085E8F93 - ldr r2, =sub_80FD5CC - adds r0, r4, 0 - bl DisplayItemMessageOnField -_080FDACA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FDA94 - - thumb_func_start sub_80FDADC -sub_80FDADC: @ 80FDADC - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - 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, =0x02037350 - adds r0, r1 - bl FieldObjectCheckIfSpecialAnimFinishedOrInactive - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080FDB1C - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080FDB50 -_080FDB1C: - ldr r1, =gUnknown_085920E4 - movs r2, 0xA - ldrsh r0, [r4, r2] - adds r0, r1 - ldrb r0, [r0] - bl sub_80FDA24 - movs r0, 0x1 - strh r0, [r4, 0x4] - ldrh r0, [r4, 0xA] - adds r0, 0x1 - movs r1, 0x3 - ands r0, r1 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0x6] - adds r0, 0x1 - strh r0, [r4, 0x6] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _080FDB50 - ldr r1, =gUnknown_085E8FDB - ldr r2, =sub_80FD5CC - adds r0, r5, 0 - bl DisplayItemMessageOnField -_080FDB50: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FDADC - - thumb_func_start ItemUseOutOfBattle_PokeblockCase -ItemUseOutOfBattle_PokeblockCase: @ 80FDB6C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080FDB98 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrb r1, [r1, 0xE] - adds r0, r4, 0 - bl DisplayDadsAdviceCannotUseItemMessage - b _080FDBDA - .pool -_080FDB98: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r5, r1, r0 - movs r1, 0xE - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _080FDBC8 - ldr r0, =0x0203ce54 - ldr r1, [r0] - ldr r0, =sub_80FDBEC - str r0, [r1] - adds r0, r4, 0 - bl unknown_ItemMenu_Confirm - b _080FDBDA - .pool -_080FDBC8: - ldr r0, =0x03005dac - ldr r1, =sub_80AF6D4 - str r1, [r0] - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r0, =sub_80FDC00 - str r0, [r5] -_080FDBDA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseOutOfBattle_PokeblockCase - - thumb_func_start sub_80FDBEC -sub_80FDBEC: @ 80FDBEC - push {lr} - ldr r1, =bag_menu_mail_related - movs r0, 0 - bl sub_81357FC - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FDBEC - - thumb_func_start sub_80FDC00 -sub_80FDC00: @ 80FDC00 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080FDC24 - bl overworld_free_bg_tilemaps - ldr r1, =c2_exit_to_overworld_2_switch - movs r0, 0 - bl sub_81357FC - adds r0, r4, 0 - bl DestroyTask -_080FDC24: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FDC00 - - thumb_func_start ItemUseOutOfBattle_CoinCase -ItemUseOutOfBattle_CoinCase: @ 80FDC34 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x02021cc4 - bl GetCoins - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E9026 - adds r0, r4, 0 - bl ExpandStringRefs - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0xE - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _080FDC90 - ldr r3, =bag_menu_inits_lists_menu - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl DisplayItemMessage - b _080FDC9A - .pool -_080FDC90: - ldr r2, =CleanUpAfterFailingToUseRegisteredKeyItemOnField - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField -_080FDC9A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseOutOfBattle_CoinCase - - thumb_func_start ItemUseOutOfBattle_PowderJar -ItemUseOutOfBattle_PowderJar: @ 80FDCA4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x02021cc4 - bl sub_80247BC - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x5 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E9138 - adds r0, r4, 0 - bl ExpandStringRefs - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0xE - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _080FDCFC - ldr r3, =bag_menu_inits_lists_menu - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl DisplayItemMessage - b _080FDD06 - .pool -_080FDCFC: - ldr r2, =CleanUpAfterFailingToUseRegisteredKeyItemOnField - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField -_080FDD06: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseOutOfBattle_PowderJar - - thumb_func_start sub_80FDD10 -sub_80FDD10: @ 80FDD10 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl IsPlayerFacingPlantedBerryTree - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080FDD58 - ldr r1, =0x0203a0f4 - ldr r0, =sub_80FDD74 - str r0, [r1] - ldr r1, =0x03005dac - ldr r0, =MapPostLoadHook_UseItem - str r0, [r1] - ldr r0, =0x0203ce54 - ldr r1, [r0] - ldr r0, =c2_exit_to_overworld_2_switch - str r0, [r1] - adds r0, r4, 0 - bl unknown_ItemMenu_Confirm - b _080FDD68 - .pool -_080FDD58: - ldr r0, =0x0203ce7c - ldrh r0, [r0] - bl itemid_get_overworld_function - adds r1, r0, 0 - adds r0, r4, 0 - bl _call_via_r1 -_080FDD68: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FDD10 - - thumb_func_start sub_80FDD74 -sub_80FDD74: @ 80FDD74 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x0203ce7c - ldrh r0, [r0] - movs r1, 0x1 - bl remove_item - bl script_env_2_enable - ldr r0, =gUnknown_08274482 - bl script_env_1_execute_new_script - adds r0, r4, 0 - bl DestroyTask - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FDD74 - - thumb_func_start ItemUseOutOfBattle_WailmerPail -ItemUseOutOfBattle_WailmerPail: @ 80FDDA4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl sub_80FDE2C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080FDDC8 - ldr r1, =0x0203a0f4 - ldr r0, =sub_80FDE7C - b _080FDDD8 - .pool -_080FDDC8: - bl WaterBerryTree - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080FDDEC - ldr r1, =0x0203a0f4 - ldr r0, =sub_80FDE08 -_080FDDD8: - str r0, [r1] - adds r0, r4, 0 - bl SetUpItemUseOnFieldCallback - b _080FDDFE - .pool -_080FDDEC: - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldrb r1, [r1, 0xE] - adds r0, r5, 0 - bl DisplayDadsAdviceCannotUseItemMessage -_080FDDFE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseOutOfBattle_WailmerPail - - thumb_func_start sub_80FDE08 -sub_80FDE08: @ 80FDE08 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl script_env_2_enable - ldr r0, =gUnknown_082744C0 - bl script_env_1_execute_new_script - adds r0, r4, 0 - bl DestroyTask - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FDE08 - - thumb_func_start sub_80FDE2C -sub_80FDE2C: @ 80FDE2C - push {r4,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl GetXYCoordsOneStepInFrontOfPlayer - bl PlayerGetZCoord - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - mov r0, sp - ldrh r0, [r0] - ldrh r1, [r4] - bl GetFieldObjectIdByXYZ - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x10 - beq _080FDE68 - ldr r0, =0x02037350 - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x5] - cmp r0, 0xE4 - beq _080FDE70 -_080FDE68: - movs r0, 0 - b _080FDE72 - .pool -_080FDE70: - movs r0, 0x1 -_080FDE72: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80FDE2C - - thumb_func_start sub_80FDE7C -sub_80FDE7C: @ 80FDE7C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl script_env_2_enable - ldr r0, =gUnknown_08242CFC - bl script_env_1_execute_new_script - adds r0, r4, 0 - bl DestroyTask - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FDE7C - - thumb_func_start ItemUseOutOfBattle_Medicine -ItemUseOutOfBattle_Medicine: @ 80FDEA0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03006328 - ldr r1, =ItemUseCB_Medicine - str r1, [r2] - bl SetUpItemUseCallback - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseOutOfBattle_Medicine - - thumb_func_start ItemUseOutOfBattle_ReduceEV -ItemUseOutOfBattle_ReduceEV: @ 80FDEBC - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03006328 - ldr r1, =sub_81B67C8 - str r1, [r2] - bl SetUpItemUseCallback - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseOutOfBattle_ReduceEV - - thumb_func_start ItemUseOutOfBattle_SacredAsh -ItemUseOutOfBattle_SacredAsh: @ 80FDED8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03006328 - ldr r1, =sub_81B79E8 - str r1, [r2] - bl SetUpItemUseCallback - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseOutOfBattle_SacredAsh - - thumb_func_start ItemUseOutOfBattle_PPRecovery -ItemUseOutOfBattle_PPRecovery: @ 80FDEF4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03006328 - ldr r1, =dp05_ether - str r1, [r2] - bl SetUpItemUseCallback - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseOutOfBattle_PPRecovery - - thumb_func_start ItemUseOutOfBattle_PPUp -ItemUseOutOfBattle_PPUp: @ 80FDF10 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03006328 - ldr r1, =dp05_pp_up - str r1, [r2] - bl SetUpItemUseCallback - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseOutOfBattle_PPUp - - thumb_func_start ItemUseOutOfBattle_RareCandy -ItemUseOutOfBattle_RareCandy: @ 80FDF2C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03006328 - ldr r1, =dp05_rare_candy - str r1, [r2] - bl SetUpItemUseCallback - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseOutOfBattle_RareCandy - - thumb_func_start ItemUseOutOfBattle_TMHM -ItemUseOutOfBattle_TMHM: @ 80FDF48 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0203ce7c - ldrh r1, [r0] - movs r0, 0xA9 - lsls r0, 1 - cmp r1, r0 - bls _080FDF74 - ldr r2, =gUnknown_085E9047 - ldr r3, =sub_80FDF90 - adds r0, r4, 0 - movs r1, 0x1 - bl DisplayItemMessage - b _080FDF80 - .pool -_080FDF74: - ldr r2, =gUnknown_085E9037 - ldr r3, =sub_80FDF90 - adds r0, r4, 0 - movs r1, 0x1 - bl DisplayItemMessage -_080FDF80: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseOutOfBattle_TMHM - - thumb_func_start sub_80FDF90 -sub_80FDF90: @ 80FDF90 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x2 - bl audio_play - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =task08_0809AD8C - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FDF90 - - thumb_func_start task08_0809AD8C -task08_0809AD8C: @ 80FDFBC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _080FE000 - ldr r4, =0x02021cc4 - ldr r0, =0x0203ce7c - ldrh r0, [r0] - 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 CopyString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E9058 - adds r0, r4, 0 - bl ExpandStringRefs - ldr r3, =sub_80FE024 - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl DisplayItemMessage -_080FE000: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task08_0809AD8C - - thumb_func_start sub_80FE024 -sub_80FE024: @ 80FE024 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_085920E8 - movs r1, 0x6 - bl bag_menu_yes_no - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FE024 - - thumb_func_start sub_80FE03C -sub_80FE03C: @ 80FE03C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03006328 - ldr r1, =sub_81B6DC4 - str r1, [r2] - bl SetUpItemUseCallback - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FE03C - - thumb_func_start sub_80FE058 -sub_80FE058: @ 80FE058 - push {r4,lr} - ldr r4, =0x0203ce7c - ldrh r0, [r4] - movs r1, 0x1 - bl remove_item - ldrh r0, [r4] - ldr r1, =0x02021dc4 - bl itemid_get_name - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E9080 - bl ExpandStringRefs - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _080FE0AC - ldrh r0, [r4] - bl itemid_get_pocket_number - lsls r0, 24 - lsrs r0, 24 - bl sub_81AB9A8 - ldrh r0, [r4] - bl itemid_get_pocket_number - lsls r0, 24 - lsrs r0, 24 - bl sub_81ABA88 - b _080FE0B4 - .pool -_080FE0AC: - bl sub_81C5924 - bl sub_81C59BC -_080FE0B4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80FE058 - - thumb_func_start ItemUseOutOfBattle_Repel -ItemUseOutOfBattle_Repel: @ 80FE0BC - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - ldr r0, =0x00004021 - bl VarGet - lsls r0, 16 - cmp r0, 0 - bne _080FE0EC - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80FE124 - str r0, [r1] - b _080FE116 - .pool -_080FE0EC: - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _080FE10C - ldr r2, =gUnknown_085E9092 - ldr r3, =bag_menu_inits_lists_menu - adds r0, r4, 0 - movs r1, 0x1 - bl DisplayItemMessage - b _080FE116 - .pool -_080FE10C: - ldr r1, =gUnknown_085E9092 - ldr r2, =sub_81C6714 - adds r0, r5, 0 - bl DisplayItemMessageInBattlePyramid -_080FE116: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseOutOfBattle_Repel - - thumb_func_start sub_80FE124 -sub_80FE124: @ 80FE124 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r4, r1, 3 - ldr r5, =0x03005e08 - adds r1, r4, r5 - ldrh r0, [r1, 0x10] - adds r0, 0x1 - strh r0, [r1, 0x10] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _080FE156 - movs r0, 0 - strh r0, [r1, 0x10] - movs r0, 0x2F - bl audio_play - adds r0, r5, 0 - subs r0, 0x8 - adds r0, r4, r0 - ldr r1, =sub_80FE164 - str r1, [r0] -_080FE156: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FE124 - - thumb_func_start sub_80FE164 -sub_80FE164: @ 80FE164 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - bne _080FE1C2 - ldr r4, =0x00004021 - ldr r0, =0x0203ce7c - ldrh r0, [r0] - bl itemid_get_quality - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl VarSet - bl sub_80FE058 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _080FE1B8 - ldr r2, =0x02021fc4 - ldr r3, =bag_menu_inits_lists_menu - adds r0, r5, 0 - movs r1, 0x1 - bl DisplayItemMessage - b _080FE1C2 - .pool -_080FE1B8: - ldr r1, =0x02021fc4 - ldr r2, =sub_81C6714 - adds r0, r6, 0 - bl DisplayItemMessageInBattlePyramid -_080FE1C2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FE164 - - thumb_func_start sub_80FE1D0 -sub_80FE1D0: @ 80FE1D0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x18] - adds r0, 0x1 - strh r0, [r1, 0x18] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _080FE226 - movs r0, 0x75 - bl audio_play - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _080FE21C - ldr r2, =0x02021fc4 - ldr r3, =bag_menu_inits_lists_menu - adds r0, r4, 0 - movs r1, 0x1 - bl DisplayItemMessage - b _080FE226 - .pool -_080FE21C: - ldr r1, =0x02021fc4 - ldr r2, =sub_81C6714 - adds r0, r5, 0 - bl DisplayItemMessageInBattlePyramid -_080FE226: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FE1D0 - - thumb_func_start ItemUseOutOfBattle_BlackWhiteFlute -ItemUseOutOfBattle_BlackWhiteFlute: @ 80FE234 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x0203ce7c - ldrh r0, [r4] - ldr r1, =0x02021dc4 - bl itemid_get_name - ldrh r0, [r4] - cmp r0, 0x2B - bne _080FE278 - ldr r0, =0x000008ad - bl FlagSet - ldr r0, =0x000008ae - bl FlagReset - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E90C6 - bl ExpandStringRefs - b _080FE28C - .pool -_080FE278: - ldr r0, =0x000008ae - bl FlagSet - ldr r0, =0x000008ad - bl FlagReset - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E90F4 - bl ExpandStringRefs -_080FE28C: - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x18] - ldr r1, =sub_80FE1D0 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseOutOfBattle_BlackWhiteFlute - - thumb_func_start task08_080A1C44 -task08_080A1C44: @ 80FE2BC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl player_avatar_init_params_reset - bl sub_80B7CC8 - adds r0, r4, 0 - bl DestroyTask - pop {r4} - pop {r0} - bx r0 - thumb_func_end task08_080A1C44 - - thumb_func_start re_escape_rope -re_escape_rope: @ 80FE2D8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl flagmods_08054D70 - bl sub_80FE058 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x8] - ldr r1, =0x02021fc4 - ldr r2, =task08_080A1C44 - adds r0, r4, 0 - bl DisplayItemMessageOnField - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end re_escape_rope - - thumb_func_start sub_80FE314 -sub_80FE314: @ 80FE314 - push {lr} - ldr r0, =0x02037318 - ldrb r1, [r0, 0x1A] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _080FE32C - movs r0, 0 - b _080FE32E - .pool -_080FE32C: - movs r0, 0x1 -_080FE32E: - pop {r1} - bx r1 - thumb_func_end sub_80FE314 - - thumb_func_start ItemUseOutOfBattle_EscapeRope -ItemUseOutOfBattle_EscapeRope: @ 80FE334 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80FE314 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080FE35C - ldr r1, =0x0203a0f4 - ldr r0, =re_escape_rope - str r0, [r1] - adds r0, r4, 0 - bl SetUpItemUseOnFieldCallback - b _080FE36E - .pool -_080FE35C: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrb r1, [r1, 0xE] - adds r0, r4, 0 - bl DisplayDadsAdviceCannotUseItemMessage -_080FE36E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseOutOfBattle_EscapeRope - - thumb_func_start ItemUseOutOfBattle_EvolutionStone -ItemUseOutOfBattle_EvolutionStone: @ 80FE378 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03006328 - ldr r1, =sub_81B7C74 - str r1, [r2] - bl SetUpItemUseCallback - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseOutOfBattle_EvolutionStone - - thumb_func_start ItemUseInBattle_PokeBall -ItemUseInBattle_PokeBall: @ 80FE394 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl sub_806B8B0 - lsls r0, 24 - cmp r0, 0 - bne _080FE3D0 - ldr r0, =0x0203ce7c - ldrh r0, [r0] - movs r1, 0x1 - bl remove_item - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _080FE3C8 - adds r0, r4, 0 - bl unknown_ItemMenu_Confirm - b _080FE3FA - .pool -_080FE3C8: - adds r0, r4, 0 - bl sub_81C5B14 - b _080FE3FA -_080FE3D0: - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _080FE3F0 - ldr r2, =gUnknown_085E9125 - ldr r3, =bag_menu_inits_lists_menu - adds r0, r4, 0 - movs r1, 0x1 - bl DisplayItemMessage - b _080FE3FA - .pool -_080FE3F0: - ldr r1, =gUnknown_085E9125 - ldr r2, =sub_81C6714 - adds r0, r5, 0 - bl DisplayItemMessageInBattlePyramid -_080FE3FA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseInBattle_PokeBall - - thumb_func_start sub_80FE408 -sub_80FE408: @ 80FE408 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _080FE43A - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _080FE434 - adds r0, r4, 0 - bl unknown_ItemMenu_Confirm - b _080FE43A - .pool -_080FE434: - adds r0, r5, 0 - bl sub_81C5B14 -_080FE43A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80FE408 - - thumb_func_start sub_80FE440 -sub_80FE440: @ 80FE440 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x18] - adds r0, 0x1 - strh r0, [r1, 0x18] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _080FE4AC - movs r0, 0x1 - bl audio_play - ldr r4, =0x0203ce7c - ldrh r0, [r4] - movs r1, 0x1 - bl remove_item - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _080FE49C - ldrh r0, [r4] - bl sub_806CF78 - adds r2, r0, 0 - ldr r3, =sub_80FE408 - adds r0, r5, 0 - movs r1, 0x1 - bl DisplayItemMessage - b _080FE4AC - .pool -_080FE49C: - ldrh r0, [r4] - bl sub_806CF78 - adds r1, r0, 0 - ldr r2, =sub_80FE408 - adds r0, r6, 0 - bl DisplayItemMessageInBattlePyramid -_080FE4AC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FE440 - - thumb_func_start ItemUseInBattle_StatIncrease -ItemUseInBattle_StatIncrease: @ 80FE4B8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x0202406e - ldr r0, =0x020244b8 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x0203ce7c - ldrh r1, [r1] - lsls r2, 24 - lsrs r2, 24 - movs r3, 0 - bl ExecuteTableBasedItemEffect_ - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _080FE52C - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _080FE518 - ldr r2, =gUnknown_085E96F6 - ldr r3, =bag_menu_inits_lists_menu - adds r0, r4, 0 - movs r1, 0x1 - bl DisplayItemMessage - b _080FE53C - .pool -_080FE518: - ldr r1, =gUnknown_085E96F6 - ldr r2, =sub_81C6714 - adds r0, r4, 0 - bl DisplayItemMessageInBattlePyramid - b _080FE53C - .pool -_080FE52C: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_80FE440 - str r0, [r1] - strh r2, [r1, 0x18] -_080FE53C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseInBattle_StatIncrease - - thumb_func_start sub_80FE54C -sub_80FE54C: @ 80FE54C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _080FE574 - ldr r0, =0x0203ce54 - ldr r1, [r0] - ldr r0, =sub_81B89F0 - str r0, [r1] - adds r0, r4, 0 - bl unknown_ItemMenu_Confirm - b _080FE582 - .pool -_080FE574: - ldr r0, =0x0203cf2c - ldr r1, [r0] - ldr r0, =sub_81B89F0 - str r0, [r1] - adds r0, r4, 0 - bl sub_81C5B14 -_080FE582: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FE54C - - thumb_func_start ItemUseInBattle_Medicine -ItemUseInBattle_Medicine: @ 80FE590 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03006328 - ldr r1, =ItemUseCB_Medicine - str r1, [r2] - bl sub_80FE54C - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseInBattle_Medicine - - thumb_func_start sub_80FE5AC -sub_80FE5AC: @ 80FE5AC - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03006328 - ldr r1, =sub_81B79E8 - str r1, [r2] - bl sub_80FE54C - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FE5AC - - thumb_func_start ItemUseInBattle_PPRecovery -ItemUseInBattle_PPRecovery: @ 80FE5C8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03006328 - ldr r1, =dp05_ether - str r1, [r2] - bl sub_80FE54C - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseInBattle_PPRecovery - - thumb_func_start ItemUseInBattle_Escape -ItemUseInBattle_Escape: @ 80FE5E4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - bne _080FE634 - bl sub_80FE058 - bl InBattlePyramid - lsls r0, 24 - cmp r0, 0 - bne _080FE620 - ldr r2, =0x02021fc4 - ldr r3, =unknown_ItemMenu_Confirm - adds r0, r4, 0 - movs r1, 0x1 - bl DisplayItemMessage - b _080FE646 - .pool -_080FE620: - ldr r1, =0x02021fc4 - ldr r2, =sub_81C5B14 - adds r0, r4, 0 - bl DisplayItemMessageInBattlePyramid - b _080FE646 - .pool -_080FE634: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrb r1, [r1, 0xE] - adds r0, r4, 0 - bl DisplayDadsAdviceCannotUseItemMessage -_080FE646: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseInBattle_Escape - - thumb_func_start ItemUseOutOfBattle_EnigmaBerry -ItemUseOutOfBattle_EnigmaBerry: @ 80FE650 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0203ce7c - ldrh r0, [r0] - bl GetItemEffectType - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x1 - cmp r0, 0x14 - bls _080FE66A - b _080FE75C -_080FE66A: - lsls r0, 2 - ldr r1, =_080FE67C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080FE67C: - .4byte _080FE708 - .4byte _080FE6D0 - .4byte _080FE6D0 - .4byte _080FE6D0 - .4byte _080FE6D0 - .4byte _080FE6D0 - .4byte _080FE6D0 - .4byte _080FE75C - .4byte _080FE75C - .4byte _080FE6EC - .4byte _080FE6D0 - .4byte _080FE6D0 - .4byte _080FE6D0 - .4byte _080FE6D0 - .4byte _080FE6D0 - .4byte _080FE6D0 - .4byte _080FE6D0 - .4byte _080FE75C - .4byte _080FE724 - .4byte _080FE724 - .4byte _080FE740 -_080FE6D0: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x10] - adds r0, r4, 0 - bl ItemUseOutOfBattle_Medicine - b _080FE770 - .pool -_080FE6EC: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x10] - adds r0, r4, 0 - bl ItemUseOutOfBattle_SacredAsh - b _080FE770 - .pool -_080FE708: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x10] - adds r0, r4, 0 - bl ItemUseOutOfBattle_RareCandy - b _080FE770 - .pool -_080FE724: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x10] - adds r0, r4, 0 - bl ItemUseOutOfBattle_PPUp - b _080FE770 - .pool -_080FE740: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x10] - adds r0, r4, 0 - bl ItemUseOutOfBattle_PPRecovery - b _080FE770 - .pool -_080FE75C: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0x4 - strh r0, [r1, 0x10] - adds r0, r4, 0 - bl ItemUseOutOfBattle_CannotUse -_080FE770: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseOutOfBattle_EnigmaBerry - - thumb_func_start ItemUseInBattle_EnigmaBerry -ItemUseInBattle_EnigmaBerry: @ 80FE77C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0203ce7c - ldrh r0, [r0] - bl GetItemEffectType - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x15 - bhi _080FE814 - lsls r0, 2 - ldr r1, =_080FE7A4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080FE7A4: - .4byte _080FE7FC - .4byte _080FE814 - .4byte _080FE804 - .4byte _080FE804 - .4byte _080FE804 - .4byte _080FE804 - .4byte _080FE804 - .4byte _080FE804 - .4byte _080FE804 - .4byte _080FE804 - .4byte _080FE814 - .4byte _080FE804 - .4byte _080FE814 - .4byte _080FE814 - .4byte _080FE814 - .4byte _080FE814 - .4byte _080FE814 - .4byte _080FE814 - .4byte _080FE814 - .4byte _080FE814 - .4byte _080FE814 - .4byte _080FE80C -_080FE7FC: - adds r0, r4, 0 - bl ItemUseInBattle_StatIncrease - b _080FE81A -_080FE804: - adds r0, r4, 0 - bl ItemUseInBattle_Medicine - b _080FE81A -_080FE80C: - adds r0, r4, 0 - bl ItemUseInBattle_PPRecovery - b _080FE81A -_080FE814: - adds r0, r4, 0 - bl ItemUseOutOfBattle_CannotUse -_080FE81A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end ItemUseInBattle_EnigmaBerry - - thumb_func_start ItemUseOutOfBattle_CannotUse -ItemUseOutOfBattle_CannotUse: @ 80FE820 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrb r1, [r1, 0xE] - bl DisplayDadsAdviceCannotUseItemMessage - pop {r0} - bx r0 - .pool - thumb_func_end ItemUseOutOfBattle_CannotUse - - thumb_func_start sub_80FE840 -sub_80FE840: @ 80FE840 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x0203841e - ldrh r0, [r5] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r5, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldrh r0, [r5, 0x4] - strh r0, [r4, 0x2E] - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x30] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080FE87C - ldrh r0, [r5, 0x8] - negs r0, r0 - b _080FE87E - .pool -_080FE87C: - ldrh r0, [r5, 0x8] -_080FE87E: - strh r0, [r4, 0x34] - ldr r0, =0x0203841e - ldrh r0, [r0, 0xA] - strh r0, [r4, 0x36] - ldr r0, =sub_80FE898 - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FE840 - - thumb_func_start sub_80FE898 -sub_80FE898: @ 80FE898 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x2E] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _080FE8D4 - subs r0, r1, 0x1 - strh r0, [r4, 0x2E] - ldrh r1, [r4, 0x32] - lsls r0, r1, 16 - asrs r0, 24 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r1, r0 - strh r1, [r4, 0x32] - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r2, 0x34 - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x36] - ldrh r1, [r4, 0x38] - adds r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x38] - b _080FE8DA -_080FE8D4: - adds r0, r4, 0 - bl move_anim_8072740 -_080FE8DA: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80FE898 - - thumb_func_start sub_80FE8E0 -sub_80FE8E0: @ 80FE8E0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r0, =0x0203841e - ldrh r0, [r0, 0x4] - strh r0, [r4, 0x2E] - ldr r5, =0x02038436 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r4, 0x1C] - ldr r1, =move_anim_8074EE0 - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FE8E0 - - thumb_func_start sub_80FE930 -sub_80FE930: @ 80FE930 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r5, =0x0203841e - ldrb r1, [r5, 0x6] - adds r0, r4, 0 - bl StartObjectImageAnim - ldrh r0, [r5, 0x4] - strh r0, [r4, 0x2E] - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r4, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FE930 - - thumb_func_start sub_80FE988 -sub_80FE988: @ 80FE988 - push {r4-r6,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r6, =0x0203841e - ldrh r0, [r6, 0x4] - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x30] - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x34] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x36] - adds r0, r4, 0 - bl obj_translate_based_on_private_1_2_3_4 - ldrh r0, [r6, 0x6] - strh r0, [r4, 0x38] - ldr r1, =sub_80FE9E4 - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FE988 - - thumb_func_start sub_80FE9E4 -sub_80FE9E4: @ 80FE9E4 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - beq _080FE9FA - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - b _080FEA4E -_080FE9FA: - movs r1, 0x38 - ldrsh r0, [r4, r1] - cmp r0, 0x7F - ble _080FEA14 - ldr r0, =0x02038437 - ldrb r0, [r0] - bl sub_80A82E4 - adds r0, 0x1 - b _080FEA1E - .pool -_080FEA14: - ldr r0, =0x02038437 - ldrb r0, [r0] - bl sub_80A82E4 - adds r0, 0x6 -_080FEA1E: - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r1, 0x5 - bl sine - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r1, 0xE - bl cosine - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x38] - adds r0, 0xF - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x38] -_080FEA4E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FE9E4 - - thumb_func_start sub_80FEA58 -sub_80FEA58: @ 80FEA58 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r1 - ldrh r0, [r5, 0x8] - subs r0, 0x1 - movs r2, 0 - strh r0, [r5, 0x8] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _080FEAB2 - ldrh r0, [r5, 0xA] - adds r0, 0x1 - strh r0, [r5, 0xA] - movs r0, 0x6 - strh r0, [r5, 0x8] - ldr r1, =0x0203841e - movs r0, 0xF - strh r0, [r1] - strh r2, [r1, 0x2] - movs r0, 0x50 - strh r0, [r1, 0x4] - strh r2, [r1, 0x6] - ldr r4, =gUnknown_08592210 - ldr r0, =0x02038437 - ldrb r0, [r0] - bl sub_80A82E4 - adds r3, r0, 0 - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl AddObjectAndAnimateForOneFrame -_080FEAB2: - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0xF - bne _080FEAC0 - adds r0, r6, 0 - bl move_anim_task_del -_080FEAC0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FEA58 - - thumb_func_start sub_80FEAD8 -sub_80FEAD8: @ 80FEAD8 - push {r4-r6,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A6980 - ldr r6, =0x0203841e - ldrh r0, [r6, 0x6] - strh r0, [r4, 0x2E] - ldr r5, =0x02038436 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x36] - ldrh r0, [r6, 0x4] - strh r0, [r4, 0x38] - adds r0, r4, 0 - bl sub_80A68D4 - ldr r0, =sub_80FEB28 - str r0, [r4, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FEAD8 - - thumb_func_start sub_80FEB28 -sub_80FEB28: @ 80FEB28 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _080FEB3C - adds r0, r4, 0 - bl move_anim_8072740 -_080FEB3C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80FEB28 - - thumb_func_start sub_80FEB44 -sub_80FEB44: @ 80FEB44 - push {r4,r5,lr} - adds r5, r0, 0 - bl GenerateRandomNumber2 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x7 - ands r1, r0 - adds r0, r5, 0 - bl StartObjectImageAnim - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080FEB90 - ldrh r0, [r5, 0x20] - subs r0, 0x14 - b _080FEB94 - .pool -_080FEB90: - ldrh r0, [r5, 0x20] - adds r0, 0x14 -_080FEB94: - strh r0, [r5, 0x20] - bl GenerateRandomNumber2 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1F - ands r0, r1 - adds r0, 0x40 - strh r0, [r5, 0x2E] - ldrh r0, [r5, 0x20] - strh r0, [r5, 0x30] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x22] - strh r0, [r5, 0x34] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x36] - adds r0, r5, 0 - bl sub_80A7160 - bl GenerateRandomNumber2 - movs r1, 0xFF - ands r1, r0 - strh r1, [r5, 0x38] - adds r0, r5, 0 - adds r0, 0x43 - ldrb r0, [r0] - strh r0, [r5, 0x3A] - ldr r1, =sub_80FEBFC - str r1, [r5, 0x1C] - adds r0, r5, 0 - bl _call_via_r1 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FEB44 - - thumb_func_start sub_80FEBFC -sub_80FEBFC: @ 80FEBFC - push {r4,lr} - adds r4, r0, 0 - bl sub_80A70E8 - lsls r0, 24 - cmp r0, 0 - beq _080FEC12 - adds r0, r4, 0 - bl move_anim_8072740 - b _080FEC42 -_080FEC12: - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r1, 0xC - bl cosine - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - movs r1, 0x38 - ldrsh r0, [r4, r1] - cmp r0, 0x7E - bgt _080FEC2E - ldrh r0, [r4, 0x3A] - b _080FEC32 -_080FEC2E: - ldrh r0, [r4, 0x3A] - adds r0, 0x1 -_080FEC32: - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - ldrh r0, [r4, 0x38] - adds r0, 0x18 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x38] -_080FEC42: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80FEBFC - - thumb_func_start sub_80FEC48 -sub_80FEC48: @ 80FEC48 - push {r4-r6,lr} - adds r6, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080FEC68 - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] -_080FEC68: - ldr r4, =0x0203841e - ldrh r0, [r4, 0x8] - strh r0, [r6, 0x2E] - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x4] - adds r0, r1 - strh r0, [r6, 0x32] - ldrb r0, [r5] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x6] - adds r0, r1 - strh r0, [r6, 0x36] - ldrh r0, [r4, 0xA] - strh r0, [r6, 0x38] - adds r0, r6, 0 - bl sub_80A68D4 - ldr r0, =sub_80FECB8 - str r0, [r6, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FEC48 - - thumb_func_start sub_80FECB8 -sub_80FECB8: @ 80FECB8 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _080FECE2 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - movs r0, 0xA - strh r0, [r4, 0x2E] - ldr r0, =sub_80A64B0 - str r0, [r4, 0x1C] - ldr r1, =sub_80FECF0 - adds r0, r4, 0 - bl oamt_set_x3A_32 -_080FECE2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FECB8 - - thumb_func_start sub_80FECF0 -sub_80FECF0: @ 80FECF0 - push {r4,lr} - adds r4, r0, 0 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnim - movs r0, 0x3C - strh r0, [r4, 0x2E] - ldr r0, =sub_80A64B0 - str r0, [r4, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FECF0 - - thumb_func_start sub_80FED28 -sub_80FED28: @ 80FED28 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A6980 - ldr r5, =0x0203841e - ldrb r1, [r5, 0x8] - adds r0, r4, 0 - bl StartObjectImageAnim - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - bne _080FED52 - ldrb r0, [r4, 0x1] - movs r1, 0xD - negs r1, r1 - ands r1, r0 - movs r0, 0x4 - orrs r1, r0 - strb r1, [r4, 0x1] -_080FED52: - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x2E] - ldrh r0, [r5, 0x4] - strh r0, [r4, 0x30] - ldr r1, =sub_80FED74 - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FED28 - - thumb_func_start sub_80FED74 -sub_80FED74: @ 80FED74 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x20 - bl sine - strh r0, [r4, 0x24] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x3 - negs r1, r1 - bl cosine - ldrh r1, [r4, 0x32] - adds r1, 0x18 - strh r1, [r4, 0x32] - lsls r1, 16 - asrs r1, 24 - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - subs r0, 0x40 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x7F - bhi _080FEDC8 - ldr r0, =0x02038437 - ldrb r0, [r0] - bl sub_80A8328 - movs r1, 0x3 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r4, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - b _080FEDEC - .pool -_080FEDC8: - ldr r0, =0x02038437 - ldrb r0, [r0] - bl sub_80A8328 - adds r0, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _080FEDDC - movs r2, 0x3 -_080FEDDC: - movs r0, 0x3 - ands r2, r0 - lsls r2, 2 - ldrb r1, [r4, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - orrs r0, r2 -_080FEDEC: - strb r0, [r4, 0x5] - ldrh r0, [r4, 0x30] - adds r0, 0x2 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _080FEE10 - adds r0, r4, 0 - bl move_anim_8072740 -_080FEE10: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FED74 - - thumb_func_start sub_80FEE1C -sub_80FEE1C: @ 80FEE1C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080FEE36 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _080FEE3E -_080FEE36: - adds r0, r4, 0 - bl move_anim_task_del - b _080FEE70 -_080FEE3E: - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080FEE60 - movs r0, 0x2 - movs r1, 0x4 - movs r2, 0x3 - bl lcd_bg_operations - b _080FEE6A - .pool -_080FEE60: - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations -_080FEE6A: - adds r0, r4, 0 - bl move_anim_task_del -_080FEE70: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80FEE1C - - thumb_func_start sub_80FEE78 -sub_80FEE78: @ 80FEE78 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0 - bl sub_80A69CC - ldr r5, =0x0203841e - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x30] - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x34] - ldr r0, =0x02038436 - ldrb r0, [r0] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r5, [r5, 0x4] - adds r0, r5 - strh r0, [r4, 0x36] - adds r0, r4, 0 - bl obj_translate_based_on_private_1_2_3_4 - movs r0, 0x40 - strh r0, [r4, 0x38] - ldr r1, =sub_80FEECC - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FEE78 - - thumb_func_start sub_80FEECC -sub_80FEECC: @ 80FEECC - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - bne _080FEF38 - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r1, 0x20 - bl sine - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r1, 0x5 - negs r1, r1 - bl cosine - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x38] - subs r0, 0x40 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x7F - bhi _080FEF18 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl sub_80A82E4 - subs r0, 0x1 - b _080FEF22 - .pool -_080FEF18: - ldr r0, =0x02038436 - ldrb r0, [r0] - bl sub_80A82E4 - adds r0, 0x1 -_080FEF22: - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - ldrh r0, [r4, 0x38] - adds r0, 0x5 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x38] - b _080FEF3E - .pool -_080FEF38: - adds r0, r4, 0 - bl move_anim_8072740 -_080FEF3E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80FEECC - - thumb_func_start sub_80FEF44 -sub_80FEF44: @ 80FEF44 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r5, =0x0203841e - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x30] - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x34] - ldr r0, =0x02038436 - ldrb r0, [r0] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r5, [r5, 0x4] - adds r0, r5 - strh r0, [r4, 0x36] - adds r0, r4, 0 - bl obj_translate_based_on_private_1_2_3_4 - movs r0, 0x40 - strh r0, [r4, 0x38] - ldr r1, =sub_80FEF98 - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FEF44 - - thumb_func_start sub_80FEF98 -sub_80FEF98: @ 80FEF98 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - bne _080FEFF0 - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r1, 0x8 - bl sine - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - ldrh r1, [r4, 0x38] - adds r0, r1, 0 - subs r0, 0x3B - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x4 - bls _080FEFD0 - adds r0, r1, 0 - subs r0, 0xBB - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x4 - bhi _080FEFE4 -_080FEFD0: - ldrb r2, [r4, 0x3] - lsls r1, r2, 26 - lsrs r1, 27 - movs r0, 0x8 - eors r1, r0 - lsls r1, 1 - subs r0, 0x47 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x3] -_080FEFE4: - ldrh r0, [r4, 0x38] - adds r0, 0x5 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x38] - b _080FEFF6 -_080FEFF0: - adds r0, r4, 0 - bl move_anim_8072740 -_080FEFF6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80FEF98 - - thumb_func_start sub_80FEFFC -sub_80FEFFC: @ 80FEFFC - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x02038436 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x20] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - ldr r1, =0x0203841e - ldrh r0, [r1] - strh r0, [r4, 0x2E] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x32] - ldr r0, =sub_80FF044 - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FEFFC - - thumb_func_start sub_80FF044 -sub_80FF044: @ 80FF044 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x32] - movs r2, 0x32 - ldrsh r3, [r1, r2] - cmp r3, 0 - bne _080FF078 - ldrh r0, [r1, 0x30] - movs r2, 0x1 - ands r2, r0 - cmp r2, 0 - beq _080FF066 - movs r0, 0x80 - strh r0, [r1, 0x2E] - strh r3, [r1, 0x30] - strh r3, [r1, 0x32] - b _080FF06C -_080FF066: - strh r2, [r1, 0x2E] - strh r2, [r1, 0x30] - strh r2, [r1, 0x32] -_080FF06C: - ldr r0, =sub_80FF090 - str r0, [r1, 0x1C] - b _080FF08C - .pool -_080FF078: - subs r0, 0x1 - strh r0, [r1, 0x32] - ldrh r0, [r1, 0x2E] - ldrh r2, [r1, 0x20] - adds r0, r2 - strh r0, [r1, 0x20] - ldrh r0, [r1, 0x30] - ldrh r2, [r1, 0x22] - adds r0, r2 - strh r0, [r1, 0x22] -_080FF08C: - pop {r0} - bx r0 - thumb_func_end sub_80FF044 - - thumb_func_start sub_80FF090 -sub_80FF090: @ 80FF090 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080FF0B4 - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r1, 0x19 - bl sine - negs r0, r0 - b _080FF0BE - .pool -_080FF0B4: - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r1, 0x19 - bl sine -_080FF0BE: - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x2E] - adds r0, 0x2 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080FF0DE - ldrh r0, [r4, 0x26] - adds r0, 0x1 - strh r0, [r4, 0x26] -_080FF0DE: - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0x50 - ble _080FF0EC - adds r0, r4, 0 - bl move_anim_8072740 -_080FF0EC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80FF090 - - thumb_func_start sub_80FF0F4 -sub_80FF0F4: @ 80FF0F4 - push {r4-r6,lr} - adds r5, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080FF114 - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] -_080FF114: - ldr r6, =0x0203841e - ldrh r0, [r6, 0x8] - strh r0, [r5, 0x2E] - movs r1, 0xC - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _080FF154 - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x4] - adds r0, r1 - strh r0, [r5, 0x32] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r6, [r6, 0x6] - adds r0, r6 - b _080FF174 - .pool -_080FF154: - ldr r0, =0x02038437 - ldrb r0, [r0] - adds r2, r5, 0 - adds r2, 0x32 - adds r3, r5, 0 - adds r3, 0x36 - movs r1, 0x1 - bl sub_80A8924 - ldrh r0, [r6, 0x4] - ldrh r1, [r5, 0x32] - adds r0, r1 - strh r0, [r5, 0x32] - ldrh r0, [r6, 0x6] - ldrh r1, [r5, 0x36] - adds r0, r1 -_080FF174: - strh r0, [r5, 0x36] - ldr r0, =0x0203841e - ldrh r0, [r0, 0xA] - strh r0, [r5, 0x38] - adds r0, r5, 0 - bl sub_80A68D4 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - adds r4, r0, 0 - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _080FF1AC - movs r0, 0x1 - b _080FF1AE - .pool -_080FF1AC: - movs r0, 0 -_080FF1AE: - strh r0, [r5, 0x2E] - ldr r0, =sub_80FF1C0 - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FF0F4 - - thumb_func_start sub_80FF1C0 -sub_80FF1C0: @ 80FF1C0 - push {r4-r7,lr} - adds r6, r0, 0 - movs r7, 0 - ldrh r5, [r6, 0x2E] - ldrh r4, [r6, 0x3C] - movs r0, 0x1 - strh r0, [r6, 0x2E] - adds r0, r6, 0 - bl sub_80A6900 - ldrh r0, [r6, 0x3C] - strh r5, [r6, 0x2E] - lsls r4, 16 - asrs r4, 16 - cmp r4, 0xC8 - ble _080FF1F2 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x37 - bgt _080FF1F2 - ldrh r0, [r6, 0x6] - cmp r0, 0 - bne _080FF1F8 - adds r0, 0x1 - strh r0, [r6, 0x6] -_080FF1F2: - ldrh r0, [r6, 0x6] - cmp r0, 0 - beq _080FF22A -_080FF1F8: - movs r1, 0x2E - ldrsh r0, [r6, r1] - cmp r0, 0 - beq _080FF22A - adds r3, r6, 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] - ldrh r0, [r6, 0x6] - adds r0, 0x1 - strh r0, [r6, 0x6] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1E - bne _080FF22A - movs r7, 0x1 -_080FF22A: - movs r2, 0x20 - ldrsh r0, [r6, r2] - movs r2, 0x24 - ldrsh r1, [r6, r2] - adds r0, r1 - adds r0, 0x10 - movs r1, 0x88 - lsls r1, 1 - cmp r0, r1 - bhi _080FF254 - movs r0, 0x22 - ldrsh r1, [r6, r0] - movs r2, 0x26 - ldrsh r0, [r6, r2] - adds r1, r0 - cmp r1, 0xA0 - bgt _080FF254 - movs r0, 0x10 - negs r0, r0 - cmp r1, r0 - bge _080FF256 -_080FF254: - movs r7, 0x1 -_080FF256: - cmp r7, 0 - beq _080FF260 - adds r0, r6, 0 - bl move_anim_8072740 -_080FF260: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80FF1C0 - - thumb_func_start sub_80FF268 -sub_80FF268: @ 80FF268 - push {r4,lr} - adds r4, r0, 0 - bl battle_type_is_double - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080FF28A - ldr r0, =0x02038437 - ldrb r0, [r0] - adds r2, r4, 0 - adds r2, 0x20 - adds r3, r4, 0 - adds r3, 0x22 - movs r1, 0x1 - bl sub_80A8924 -_080FF28A: - ldrh r0, [r4, 0x22] - adds r0, 0x20 - strh r0, [r4, 0x22] - ldr r1, =0x0203841e - ldrh r0, [r1] - strh r0, [r4, 0x2E] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x32] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x34] - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x36] - ldr r0, =sub_80FF2BC - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FF268 - - thumb_func_start sub_80FF2BC -sub_80FF2BC: @ 80FF2BC - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x30] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0xFF - bne _080FF2D2 - ldrh r0, [r4, 0x22] - subs r0, 0x2 - strh r0, [r4, 0x22] - b _080FF2E0 -_080FF2D2: - cmp r0, 0 - ble _080FF2E0 - ldrh r0, [r4, 0x22] - subs r0, 0x2 - strh r0, [r4, 0x22] - subs r0, r1, 0x2 - strh r0, [r4, 0x30] -_080FF2E0: - ldrh r3, [r4, 0x32] - ldrh r5, [r4, 0x38] - adds r2, r3, r5 - strh r2, [r4, 0x38] - movs r0, 0x2E - ldrsh r1, [r4, r0] - movs r5, 0x36 - ldrsh r0, [r4, r5] - cmp r1, r0 - bge _080FF2F8 - adds r0, r2, r3 - strh r0, [r4, 0x38] -_080FF2F8: - ldrh r1, [r4, 0x38] - movs r0, 0xFF - ands r0, r1 - strh r0, [r4, 0x38] - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r2, 0x34 - ldrsh r1, [r4, r2] - bl cosine - strh r0, [r4, 0x24] - movs r5, 0x38 - ldrsh r0, [r4, r5] - movs r1, 0x5 - bl sine - strh r0, [r4, 0x26] - movs r1, 0x38 - ldrsh r0, [r4, r1] - cmp r0, 0x7F - bgt _080FF338 - ldr r0, =0x02038437 - ldrb r0, [r0] - bl sub_80A8328 - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x1 - b _080FF346 - .pool -_080FF338: - ldr r0, =0x02038437 - ldrb r0, [r0] - bl sub_80A8328 - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x1 -_080FF346: - movs r1, 0x3 - ands r0, r1 - lsls r0, 2 - ldrb r2, [r4, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0x5] - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - cmp r0, 0 - bne _080FF36A - adds r0, r4, 0 - bl move_anim_8072740 -_080FF36A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FF2BC - - thumb_func_start sub_80FF374 -sub_80FF374: @ 80FF374 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0 - bl sub_80A6980 - adds r2, r5, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r4, =0x0203841e - ldrb r1, [r4, 0x4] - adds r0, r5, 0 - bl StartObjectRotScalAnim - ldrh r0, [r4, 0x4] - strh r0, [r5, 0x3A] - ldrh r0, [r4, 0x6] - strh r0, [r5, 0x3C] - ldr r0, =sub_80FF3B0 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FF374 - - thumb_func_start sub_80FF3B0 -sub_80FF3B0: @ 80FF3B0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0203841e - ldrh r1, [r0, 0xE] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _080FF3DA - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - movs r0, 0x1 - bl obj_id_for_side_relative_to_move - movs r0, 0x80 - lsls r0, 1 - strh r0, [r4, 0x2E] - ldr r0, =sub_80FF3EC - str r0, [r4, 0x1C] -_080FF3DA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FF3B0 - - thumb_func_start sub_80FF3EC -sub_80FF3EC: @ 80FF3EC - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x1 - bl obj_id_for_side_relative_to_move - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080FF404 - ldrh r0, [r4, 0x2E] - adds r0, 0xB - b _080FF408 -_080FF404: - ldrh r0, [r4, 0x2E] - subs r0, 0xB -_080FF408: - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bne _080FF424 - movs r0, 0 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x32] - movs r1, 0x1 - eors r0, r1 - strh r0, [r4, 0x32] -_080FF424: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080FF452 - ldrh r0, [r4, 0x3C] - subs r0, 0x1 - strh r0, [r4, 0x3C] - lsls r0, 16 - cmp r0, 0 - ble _080FF44C - ldrh r1, [r4, 0x3A] - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectRotScalAnim - b _080FF452 -_080FF44C: - adds r0, r4, 0 - bl move_anim_8072740 -_080FF452: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80FF3EC - - thumb_func_start sub_80FF458 -sub_80FF458: @ 80FF458 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x1 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =0x02020630 - mov r10, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - mov r2, r10 - adds r7, r0, r2 - adds r0, r7, 0 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _080FF498 - adds r0, r4, 0 - bl move_anim_task_del - b _080FF51C - .pool -_080FF498: - adds r0, r1, 0 - movs r1, 0x1 - bl sub_80A7270 - ldr r0, =0x03005e00 - lsls r6, r4, 2 - adds r6, r4 - lsls r6, 3 - adds r6, r0 - ldrb r0, [r7, 0x5] - lsls r0, 28 - lsrs r0, 30 - strh r0, [r6, 0x24] - ldr r0, =0x02038437 - mov r9, r0 - ldrb r0, [r0] - bl sub_80A8328 - movs r1, 0x3 - mov r8, r1 - mov r1, r8 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r7, 0x5] - movs r5, 0xD - negs r5, r5 - adds r0, r5, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r7, 0x5] - movs r0, 0x3 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r1, r0, 24 - lsls r4, r1, 4 - adds r4, r1 - lsls r4, 2 - add r4, r10 - ldrb r0, [r4, 0x5] - lsls r0, 28 - lsrs r0, 30 - strh r0, [r6, 0x26] - mov r2, r9 - ldrb r1, [r2] - movs r0, 0x2 - eors r0, r1 - bl sub_80A8328 - mov r1, r8 - ands r1, r0 - lsls r1, 2 - ldrb r0, [r4, 0x5] - ands r5, r0 - orrs r5, r1 - strb r5, [r4, 0x5] - ldr r1, =0x0203841e - ldrh r0, [r1] - strh r0, [r6, 0x8] - ldrh r0, [r1, 0x2] - strh r0, [r6, 0xA] - movs r0, 0x80 - lsls r0, 1 - strh r0, [r6, 0x1E] - ldr r0, =sub_80FF53C - str r0, [r6] -_080FF51C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FF458 - - thumb_func_start sub_80FF53C -sub_80FF53C: @ 80FF53C - push {r4-r6,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r1 - ldrh r1, [r4, 0x8] - ldrh r0, [r4, 0x1C] - adds r1, r0 - strh r1, [r4, 0x1C] - ldr r2, =0x02020630 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r5, r0, r2 - lsls r1, 16 - asrs r1, 24 - strh r1, [r5, 0x24] - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080FF586 - ldrh r0, [r5, 0x24] - negs r0, r0 - strh r0, [r5, 0x24] -_080FF586: - ldrh r0, [r4, 0x1E] - adds r0, 0x10 - strh r0, [r4, 0x1E] - movs r0, 0x1E - ldrsh r2, [r4, r0] - adds r0, r6, 0 - adds r1, r2, 0 - movs r3, 0 - bl obj_id_set_rotscale - adds r0, r6, 0 - bl sub_80A7E6C - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bne _080FF5B4 - strh r0, [r4, 0x8] - ldr r0, =sub_80FF5CC - str r0, [r4] -_080FF5B4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FF53C - - thumb_func_start sub_80FF5CC -sub_80FF5CC: @ 80FF5CC - push {r4-r7,lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, =0x0203841e - ldrh r1, [r0, 0xE] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _080FF660 - ldr r0, =0x03005e00 - lsls r2, r3, 2 - adds r1, r2, r3 - lsls r1, 3 - adds r7, r1, r0 - movs r1, 0x8 - ldrsh r5, [r7, r1] - adds r4, r0, 0 - cmp r5, 0 - bne _080FF674 - movs r0, 0x1 - bl obj_id_for_side_relative_to_move - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_80A7344 - ldr r6, =0x02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r6 - strh r5, [r1, 0x24] - strh r5, [r1, 0x26] - movs r5, 0x3 - ldrh r2, [r7, 0x24] - ands r2, r5 - lsls r2, 2 - ldrb r3, [r1, 0x5] - movs r4, 0xD - negs r4, r4 - adds r0, r4, 0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x5] - movs r0, 0x3 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrh r0, [r7, 0x26] - ands r0, r5 - lsls r0, 2 - ldrb r2, [r1, 0x5] - ands r4, r2 - orrs r4, r0 - strb r4, [r1, 0x5] - ldrh r0, [r7, 0x8] - adds r0, 0x1 - strh r0, [r7, 0x8] - b _080FF68E - .pool -_080FF660: - ldr r1, =0x03005e00 - lsls r2, r3, 2 - adds r0, r2, r3 - lsls r0, 3 - adds r0, r1 - movs r4, 0x8 - ldrsh r0, [r0, r4] - adds r4, r1, 0 - cmp r0, 0 - beq _080FF68E -_080FF674: - adds r1, r2, r3 - lsls r1, 3 - adds r1, r4 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bne _080FF68E - adds r0, r3, 0 - bl move_anim_task_del -_080FF68E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FF5CC - - thumb_func_start sub_80FF698 -sub_80FF698: @ 80FF698 - push {r4-r6,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _080FF6AA - cmp r0, 0x1 - beq _080FF704 - b _080FF756 -_080FF6AA: - ldr r6, =0x02038437 - ldrb r0, [r6] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080FF6C2 - ldr r1, =0x0203841e - movs r2, 0 - ldrsh r0, [r1, r2] - negs r0, r0 - strh r0, [r1] -_080FF6C2: - ldrb r0, [r6] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - ldr r4, =0x0203841e - lsrs r0, 24 - ldrh r1, [r4] - adds r0, r1 - strh r0, [r5, 0x20] - ldrb r0, [r6] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r4, [r4, 0x2] - adds r0, r4 - strh r0, [r5, 0x22] - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - b _080FF756 - .pool -_080FF704: - adds r2, r5, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080FF756 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80082B8 - movs r0, 0x19 - strh r0, [r5, 0x2E] - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x32] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x36] - ldr r0, =sub_80A70C0 - str r0, [r5, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r5, 0 - bl oamt_set_x3A_32 -_080FF756: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FF698 - - thumb_func_start sub_80FF768 -sub_80FF768: @ 80FF768 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _080FF7D4 - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r4, =0x0203841e - ldrh r0, [r4] - strh r0, [r5, 0x24] - ldrh r0, [r4, 0x2] - strh r0, [r5, 0x26] - ldrb r0, [r4, 0x4] - adds r0, 0x1E - adds r1, r5, 0 - adds r1, 0x43 - strb r0, [r1] - ldrb r1, [r4, 0x6] - adds r0, r5, 0 - bl StartObjectImageAnim - ldrh r0, [r4, 0x8] - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - movs r2, 0x22 - ldrsh r0, [r5, r2] - movs r2, 0x26 - ldrsh r1, [r5, r2] - adds r0, r1 - cmp r0, 0x78 - ble _080FF7D4 - ldrh r0, [r5, 0x22] - adds r1, r0, 0 - subs r1, 0x78 - ldrh r2, [r5, 0x26] - adds r0, r2 - adds r1, r0 - strh r1, [r5, 0x22] -_080FF7D4: - ldr r0, =sub_80FF8DC - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FF768 - - thumb_func_start sub_80FF7EC -sub_80FF7EC: @ 80FF7EC - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0x4 - mov r9, r0 - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - mov r8, r0 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r6, =0x02038437 - ldrb r0, [r6] - movs r1, 0x2 - bl sub_80A5C6C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r6] - movs r1, 0x3 - bl sub_80A5C6C - adds r2, r0, 0 - lsls r2, 24 - subs r4, r5 - lsls r4, 16 - lsrs r2, 24 - mov r1, r8 - subs r2, r1 - lsls r2, 16 - lsrs r2, 16 - lsrs r3, r4, 16 - mov r10, r3 - asrs r4, 16 - ldr r6, =0x0203841e - movs r1, 0 - ldrsh r0, [r6, r1] - muls r0, r4 - movs r1, 0x64 - str r2, [sp] - bl __divsi3 - adds r5, r0 - mov r3, r9 - strh r5, [r3, 0x20] - ldr r2, [sp] - lsls r0, r2, 16 - asrs r0, 16 - movs r3, 0 - ldrsh r1, [r6, r3] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - add r8, r0 - mov r1, r8 - mov r0, r9 - strh r1, [r0, 0x22] - ldrh r0, [r6, 0x2] - mov r3, r9 - strh r0, [r3, 0x24] - ldrh r0, [r6, 0x4] - strh r0, [r3, 0x26] - ldrb r0, [r6, 0x6] - adds r0, 0x1E - mov r1, r9 - adds r1, 0x43 - strb r0, [r1] - ldrb r1, [r6, 0x8] - mov r0, r9 - bl StartObjectImageAnim - ldrh r0, [r6, 0xA] - mov r1, r9 - strh r0, [r1, 0x32] - ldr r0, =sub_80FF8DC - str r0, [r1, 0x1C] - ldr r1, =0x0203a0f8 - mov r3, r9 - ldrh r0, [r3, 0x20] - strh r0, [r1] - ldrh r0, [r3, 0x22] - strh r0, [r1, 0x2] - mov r0, r10 - strh r0, [r1, 0x4] - ldr r2, [sp] - strh r2, [r1, 0x6] - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FF7EC - - thumb_func_start sub_80FF8DC -sub_80FF8DC: @ 80FF8DC - push {lr} - adds r3, r0, 0 - ldrh r1, [r3, 0x2E] - adds r1, 0x1 - strh r1, [r3, 0x2E] - lsls r1, 16 - asrs r1, 16 - movs r2, 0x32 - ldrsh r0, [r3, r2] - subs r0, 0xA - cmp r1, r0 - ble _080FF91C - movs r0, 0x2E - ldrsh r1, [r3, r0] - lsrs r0, r1, 31 - adds r0, r1, r0 - asrs r0, 1 - lsls r0, 1 - subs r1, r0 - movs r2, 0x3E - adds r2, r3 - mov r12, r2 - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] -_080FF91C: - movs r2, 0x2E - ldrsh r1, [r3, r2] - movs r2, 0x32 - ldrsh r0, [r3, r2] - cmp r1, r0 - ble _080FF92E - adds r0, r3, 0 - bl move_anim_8072740 -_080FF92E: - pop {r0} - bx r0 - thumb_func_end sub_80FF8DC - - thumb_func_start sub_80FF934 -sub_80FF934: @ 80FF934 - push {r4-r6,lr} - adds r6, r0, 0 - movs r1, 0x2E - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _080FF974 - ldr r5, =0x02038436 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - ldr r4, =0x0203841e - lsrs r0, 24 - ldrh r2, [r4] - adds r0, r2 - strh r0, [r6, 0x20] - ldrb r0, [r5] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x2] - adds r0, r1 - strh r0, [r6, 0x22] - ldrh r0, [r4, 0x4] - strh r0, [r6, 0x30] - ldrh r0, [r4, 0x6] - strh r0, [r6, 0x32] - ldrh r0, [r4, 0x8] - strh r0, [r6, 0x34] -_080FF974: - ldrh r0, [r6, 0x2E] - adds r0, 0x1 - strh r0, [r6, 0x2E] - ldrh r1, [r6, 0x30] - muls r0, r1 - strh r0, [r6, 0x24] - movs r2, 0x2E - ldrsh r1, [r6, r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - movs r1, 0xFF - ands r0, r1 - movs r2, 0x32 - ldrsh r1, [r6, r2] - bl sine - strh r0, [r6, 0x26] - movs r0, 0x2E - ldrsh r1, [r6, r0] - movs r2, 0x34 - ldrsh r0, [r6, r2] - cmp r1, r0 - ble _080FF9AA - adds r0, r6, 0 - bl move_anim_8072740 -_080FF9AA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FF934 - - thumb_func_start sub_80FF9B8 -sub_80FF9B8: @ 80FF9B8 - push {r4,r5,lr} - movs r2, 0x20 - ldrsh r4, [r0, r2] - lsls r4, 8 - movs r3, 0x22 - ldrsh r2, [r0, r3] - orrs r4, r2 - movs r5, 0x3A - ldrsh r2, [r0, r5] - lsls r2, 8 - movs r5, 0x3C - ldrsh r3, [r0, r5] - orrs r2, r3 - lsls r1, 8 - strh r4, [r0, 0x38] - strh r2, [r0, 0x3A] - strh r1, [r0, 0x3C] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80FF9B8 - - thumb_func_start sub_80FF9E0 -sub_80FF9E0: @ 80FF9E0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r8, r0 - ldrh r0, [r0, 0x38] - lsrs r1, r0, 8 - mov r10, r1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - mov r1, r8 - ldrh r0, [r1, 0x3A] - lsrs r2, r0, 8 - lsls r0, 24 - lsrs r4, r0, 24 - ldrh r1, [r1, 0x3C] - lsls r0, r1, 16 - asrs r0, 24 - lsls r0, 16 - lsrs r6, r0, 16 - movs r3, 0xFF - ands r3, r1 - cmp r2, 0 - bne _080FFA1A - movs r2, 0x20 - negs r2, r2 - b _080FFA22 -_080FFA1A: - cmp r2, 0xFF - bne _080FFA22 - movs r2, 0x88 - lsls r2, 1 -_080FFA22: - mov r0, r9 - subs r4, r0 - lsls r4, 16 - lsrs r4, 16 - mov r1, r10 - subs r0, r2, r1 - lsls r5, r3, 16 - asrs r5, 16 - muls r0, r5 - lsls r1, r6, 16 - asrs r7, r1, 16 - adds r1, r7, 0 - bl __divsi3 - adds r6, r0, 0 - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 - muls r0, r5 - adds r1, r7, 0 - bl __divsi3 - add r6, r10 - mov r1, r8 - strh r6, [r1, 0x20] - add r0, r9 - strh r0, [r1, 0x22] - adds r5, 0x1 - lsls r5, 16 - lsrs r3, r5, 16 - asrs r5, 16 - cmp r5, r7 - beq _080FFA74 - lsls r1, r7, 8 - lsls r0, r3, 16 - asrs r0, 16 - orrs r0, r1 - mov r1, r8 - strh r0, [r1, 0x3C] - movs r0, 0 - b _080FFA76 -_080FFA74: - movs r0, 0x1 -_080FFA76: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80FF9E0 - - thumb_func_start sub_80FFA84 -sub_80FFA84: @ 80FFA84 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0xA - bne _080FFA98 - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim -_080FFA98: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x32 - ble _080FFAAC - adds r0, r4, 0 - bl move_anim_8072740 -_080FFAAC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80FFA84 - - thumb_func_start sub_80FFAB4 -sub_80FFAB4: @ 80FFAB4 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - lsls r0, 7 - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl __divsi3 - ldrh r1, [r4, 0x2E] - adds r1, r0 - movs r5, 0 - strh r1, [r4, 0x2E] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x7F - ble _080FFADE - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - strh r5, [r4, 0x2E] -_080FFADE: - ldrh r0, [r4, 0x2E] - adds r0, 0x80 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x30 - ldrsh r2, [r4, r1] - lsls r2, 3 - movs r1, 0x1E - subs r1, r2 - lsls r1, 16 - asrs r1, 16 - bl sine - strh r0, [r4, 0x26] - adds r0, r4, 0 - bl sub_80FF9E0 - lsls r0, 24 - cmp r0, 0 - beq _080FFB0E - strh r5, [r4, 0x26] - strh r5, [r4, 0x2E] - ldr r0, =sub_80FFA84 - str r0, [r4, 0x1C] -_080FFB0E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FFAB4 - - thumb_func_start sub_80FFB18 -sub_80FFB18: @ 80FFB18 - push {r4-r6,lr} - adds r5, r0, 0 - movs r1, 0 - bl sub_80A69CC - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02038436 - ldrb r1, [r0] - movs r0, 0x2 - eors r0, r1 - ldrb r4, [r4] - cmp r0, r4 - bne _080FFB68 - strh r6, [r5, 0x3A] - adds r0, r2, 0 - adds r0, 0xA - strh r0, [r5, 0x3C] - adds r0, r5, 0 - movs r1, 0x3C - bl sub_80FF9B8 - movs r0, 0x1 - b _080FFB7A - .pool -_080FFB68: - strh r6, [r5, 0x3A] - adds r0, r2, 0 - adds r0, 0xA - strh r0, [r5, 0x3C] - adds r0, r5, 0 - movs r1, 0x3C - bl sub_80FF9B8 - movs r0, 0x3 -_080FFB7A: - strh r0, [r5, 0x34] - movs r0, 0x3C - strh r0, [r5, 0x36] - ldr r0, =sub_80FFAB4 - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FFB18 - - thumb_func_start sub_80FFB90 -sub_80FFB90: @ 80FFB90 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - lsls r0, 7 - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl __divsi3 - ldrh r1, [r4, 0x2E] - adds r1, r0 - movs r5, 0 - strh r1, [r4, 0x2E] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x7F - ble _080FFBBA - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - strh r5, [r4, 0x2E] -_080FFBBA: - ldrh r0, [r4, 0x2E] - adds r0, 0x80 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x30 - ldrsh r2, [r4, r1] - lsls r2, 3 - movs r1, 0x1E - subs r1, r2 - lsls r1, 16 - asrs r1, 16 - bl sine - strh r0, [r4, 0x26] - adds r0, r4, 0 - bl sub_80FF9E0 - lsls r0, 24 - cmp r0, 0 - beq _080FFBEC - strh r5, [r4, 0x26] - strh r5, [r4, 0x2E] - adds r0, r4, 0 - bl move_anim_8072740 -_080FFBEC: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80FFB90 - - thumb_func_start sub_80FFBF4 -sub_80FFBF4: @ 80FFBF4 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _080FFC38 - strh r0, [r5, 0x3A] - adds r0, r6, 0 - adds r0, 0xA - strh r0, [r5, 0x3C] - adds r0, r5, 0 - movs r1, 0x28 - bl sub_80FF9B8 - movs r0, 0x3 - strh r0, [r5, 0x34] - movs r0, 0x3C - strh r0, [r5, 0x36] - ldr r0, =sub_80FFAB4 - b _080FFC62 - .pool -_080FFC38: - movs r0, 0xFF - strh r0, [r5, 0x3A] - adds r0, r6, 0 - adds r0, 0xA - strh r0, [r5, 0x3C] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080FFC50 - movs r0, 0 - strh r0, [r5, 0x3A] -_080FFC50: - adds r0, r5, 0 - movs r1, 0x28 - bl sub_80FF9B8 - movs r0, 0x3 - strh r0, [r5, 0x34] - movs r0, 0x3C - strh r0, [r5, 0x36] - ldr r0, =sub_80FFB90 -_080FFC62: - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FFBF4 - - thumb_func_start sub_80FFC70 -sub_80FFC70: @ 80FFC70 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080FFC8A - adds r0, r4, 0 - movs r1, 0 - bl sub_80A6980 - ldr r0, =0x0203841e - ldrh r0, [r0, 0x4] - strh r0, [r4, 0x30] -_080FFC8A: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - ldrh r1, [r4, 0x30] - muls r0, r1 - strh r0, [r4, 0x26] - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080FFCAA - adds r0, r4, 0 - bl move_anim_8072740 -_080FFCAA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FFC70 - - thumb_func_start sub_80FFCB4 -sub_80FFCB4: @ 80FFCB4 - push {r4-r6,lr} - adds r5, r0, 0 - movs r1, 0 - bl sub_80A6980 - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02038437 - ldrb r1, [r0] - movs r0, 0x2 - eors r0, r1 - ldrb r4, [r4] - cmp r0, r4 - bne _080FFD04 - strh r6, [r5, 0x3A] - adds r0, r2, 0 - adds r0, 0xA - strh r0, [r5, 0x3C] - adds r0, r5, 0 - movs r1, 0x3C - bl sub_80FF9B8 - movs r0, 0x1 - b _080FFD16 - .pool -_080FFD04: - strh r6, [r5, 0x3A] - adds r0, r2, 0 - adds r0, 0xA - strh r0, [r5, 0x3C] - adds r0, r5, 0 - movs r1, 0x3C - bl sub_80FF9B8 - movs r0, 0x3 -_080FFD16: - strh r0, [r5, 0x34] - movs r0, 0x3C - strh r0, [r5, 0x36] - ldr r0, =sub_80FFD2C - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FFCB4 - - thumb_func_start sub_80FFD2C -sub_80FFD2C: @ 80FFD2C - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - lsls r0, 7 - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl __divsi3 - ldrh r1, [r4, 0x2E] - adds r1, r0 - movs r5, 0 - strh r1, [r4, 0x2E] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x7F - ble _080FFD56 - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - strh r5, [r4, 0x2E] -_080FFD56: - ldrh r0, [r4, 0x2E] - adds r0, 0x80 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x30 - ldrsh r2, [r4, r1] - lsls r2, 3 - movs r1, 0x1E - subs r1, r2 - lsls r1, 16 - asrs r1, 16 - bl sine - strh r0, [r4, 0x26] - lsls r0, 16 - cmp r0, 0 - bne _080FFD8A - movs r0, 0x3F - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0x7D - bl audio_play_and_stuff -_080FFD8A: - adds r0, r4, 0 - bl sub_80FF9E0 - lsls r0, 24 - cmp r0, 0 - beq _080FFDB2 - strh r5, [r4, 0x26] - strh r5, [r4, 0x2E] - ldr r0, =sub_80FFA84 - str r0, [r4, 0x1C] - movs r0, 0x40 - negs r0, r0 - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0x7D - bl audio_play_and_stuff -_080FFDB2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FFD2C - - thumb_func_start sub_80FFDBC -sub_80FFDBC: @ 80FFDBC - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080FFE50 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080FFDE4 - ldr r0, =0x0203841e - ldrh r1, [r0, 0x2] - strh r1, [r4, 0x30] - movs r1, 0x78 - strh r1, [r4, 0x20] - adds r5, r0, 0 - b _080FFE06 - .pool -_080FFDE4: - ldr r0, =0x0203841e - movs r1, 0x2 - ldrsh r3, [r0, r1] - adds r1, r3, 0 - subs r1, 0x20 - adds r2, r1, 0 - adds r5, r0, 0 - cmp r1, 0 - bge _080FFDFA - adds r2, r3, 0 - adds r2, 0xDF -_080FFDFA: - asrs r0, r2, 8 - lsls r0, 8 - subs r0, r1, r0 - strh r0, [r4, 0x30] - movs r0, 0x46 - strh r0, [r4, 0x20] -_080FFE06: - ldrh r0, [r5] - strh r0, [r4, 0x22] - strh r0, [r4, 0x32] - movs r0, 0x14 - strh r0, [r4, 0x36] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x3C - bl cosine - strh r0, [r4, 0x24] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x14 - bl sine - strh r0, [r4, 0x26] - ldr r0, =sub_80FFE58 - str r0, [r4, 0x1C] - ldrh r0, [r4, 0x30] - subs r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xBE - bhi _080FFE48 - adds r1, r4, 0 - adds r1, 0x43 - movs r0, 0x1F - b _080FFE4E - .pool -_080FFE48: - adds r1, r4, 0 - adds r1, 0x43 - movs r0, 0x1D -_080FFE4E: - strb r0, [r1] -_080FFE50: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80FFDBC - - thumb_func_start sub_80FFE58 -sub_80FFE58: @ 80FFE58 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080FFE6A - cmp r0, 0x1 - beq _080FFE9A - b _080FFEBA -_080FFE6A: - ldrh r5, [r4, 0x32] - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x4E - ble _080FFE82 - movs r0, 0x1 - strh r0, [r4, 0x34] - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - b _080FFEBA -_080FFE82: - movs r1, 0x36 - ldrsh r0, [r4, r1] - movs r1, 0xA - bl __divsi3 - adds r0, r5, r0 - strh r0, [r4, 0x32] - ldrh r1, [r4, 0x36] - adds r1, 0x3 - strh r1, [r4, 0x36] - strh r0, [r4, 0x22] - b _080FFEBA -_080FFE9A: - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _080FFEBA - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080FFEBA - movs r0, 0 - strh r0, [r4, 0x2E] - strh r0, [r4, 0x32] - ldr r0, =sub_80FFEC4 - str r0, [r4, 0x1C] -_080FFEBA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FFE58 - - thumb_func_start sub_80FFEC4 -sub_80FFEC4: @ 80FFEC4 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r5, =gUnknown_08592700 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r3, r0, r1 - adds r0, r5, 0x1 - adds r0, r3, r0 - ldrh r2, [r4, 0x32] - movs r6, 0x32 - ldrsh r1, [r4, r6] - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r1, r0 - bne _080FFF10 - adds r0, r5, 0x2 - adds r0, r3, r0 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x7F - bne _080FFEFC - movs r0, 0 - strh r0, [r4, 0x2E] - ldr r0, =sub_80FFF7C - str r0, [r4, 0x1C] -_080FFEFC: - movs r0, 0 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _080FFF76 - .pool -_080FFF10: - adds r0, r2, 0x1 - strh r0, [r4, 0x32] - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r0, r1 - adds r1, r0, r5 - movs r2, 0 - ldrsb r2, [r1, r2] - adds r1, r5, 0x2 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - muls r0, r2 - ldrh r1, [r4, 0x30] - adds r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080FFF5E - ldrh r0, [r4, 0x30] - subs r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xBE - bhi _080FFF56 - adds r1, r4, 0 - adds r1, 0x43 - movs r0, 0x1F - b _080FFF5C -_080FFF56: - adds r1, r4, 0 - adds r1, 0x43 - movs r0, 0x1D -_080FFF5C: - strb r0, [r1] -_080FFF5E: - movs r6, 0x30 - ldrsh r0, [r4, r6] - movs r1, 0x3C - bl cosine - strh r0, [r4, 0x24] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x14 - bl sine - strh r0, [r4, 0x26] -_080FFF76: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80FFEC4 - - thumb_func_start sub_80FFF7C -sub_80FFF7C: @ 80FFF7C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x14 - ble _080FFF8E - adds r0, r4, 0 - bl move_anim_8072740 -_080FFF8E: - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsrs r0, r1, 31 - adds r0, r1, r0 - asrs r0, 1 - lsls r0, 1 - subs r1, r0 - adds r3, r4, 0 - adds r3, 0x3E - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80FFF7C - - thumb_func_start sub_80FFFC0 -sub_80FFFC0: @ 80FFFC0 - 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, =0x03005e00 - adds r5, r0, r1 - ldr r4, =0x02038437 - ldrb r0, [r4] - bl sub_80A82E4 - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x1 - strh r0, [r5, 0x10] - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x14] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x16] - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A861C - strh r0, [r5, 0x1C] - ldrb r0, [r4] - movs r1, 0 - bl sub_80A861C - strh r0, [r5, 0x1E] - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x1 - negs r2, r2 - adds r1, r2, 0 - cmp r0, 0x1 - bne _08100028 - movs r1, 0x1 -_08100028: - strh r1, [r5, 0x12] - movs r3, 0x12 - ldrsh r0, [r5, r3] - lsls r0, 6 - movs r1, 0x38 - subs r1, r0 - strh r1, [r5, 0x1A] - ldrh r0, [r5, 0x16] - subs r0, r1 - ldrh r1, [r5, 0x14] - adds r0, r1 - strh r0, [r5, 0x18] - ldr r0, =gUnknown_08592778 - movs r2, 0x18 - ldrsh r1, [r5, r2] - movs r3, 0x1A - ldrsh r2, [r5, r3] - ldrb r3, [r5, 0x10] - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0xC] - cmp r0, 0x40 - bne _08100060 - adds r0, r6, 0 - bl move_anim_task_del -_08100060: - ldr r4, =0x02020630 - movs r0, 0xC - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xA - strh r1, [r0, 0x2E] - movs r2, 0xC - ldrsh r1, [r5, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r5, 0x18] - strh r1, [r0, 0x30] - movs r3, 0xC - ldrsh r0, [r5, r3] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r4 - movs r1, 0x1C - ldrsh r0, [r5, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - adds r0, 0xA - movs r3, 0x12 - ldrsh r1, [r5, r3] - muls r1, r0 - ldrh r0, [r5, 0x14] - subs r0, r1 - strh r0, [r2, 0x32] - movs r0, 0xC - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r5, 0x1A] - strh r1, [r0, 0x34] - movs r1, 0xC - ldrsh r0, [r5, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - movs r2, 0x1E - ldrsh r0, [r5, r2] - lsrs r2, r0, 31 - adds r0, r2 - asrs r0, 1 - adds r0, 0xA - movs r3, 0x12 - ldrsh r2, [r5, r3] - muls r0, r2 - ldrh r2, [r5, 0x16] - adds r0, r2 - strh r0, [r1, 0x36] - movs r3, 0xC - ldrsh r1, [r5, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl sub_8100504 - movs r1, 0xC - ldrsh r2, [r5, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - strh r0, [r1, 0x38] - movs r2, 0xC - ldrsh r1, [r5, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl sub_80A68D4 - ldr r0, =sub_8100128 - str r0, [r5] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80FFFC0 - - thumb_func_start sub_8100128 -sub_8100128: @ 8100128 - push {r4-r6,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r6, r0, r1 - movs r0, 0xC - ldrsh r1, [r6, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r5, [r6, r1] - cmp r5, 0x7 - bne _08100150 - b _08100380 -_08100150: - cmp r5, 0x7 - bgt _0810019E - cmp r5, 0x3 - bne _0810015A - b _08100272 -_0810015A: - cmp r5, 0x3 - bgt _08100174 - cmp r5, 0x1 - beq _08100204 - cmp r5, 0x1 - bgt _08100254 - cmp r5, 0 - beq _081001E6 - b _081004FC - .pool -_08100174: - cmp r5, 0x5 - bne _0810017A - b _081002E8 -_0810017A: - cmp r5, 0x5 - ble _08100180 - b _08100362 -_08100180: - adds r0, r6, 0 - adds r1, r2, 0 - bl sub_8100524 - adds r0, r4, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - bne _08100196 - b _081004FC -_08100196: - movs r0, 0x5 - strh r0, [r6, 0x26] - movs r0, 0xFF - b _081004FA -_0810019E: - cmp r5, 0xB - bne _081001A4 - b _08100464 -_081001A4: - cmp r5, 0xB - bgt _081001D2 - cmp r5, 0x9 - bne _081001AE - b _081003D2 -_081001AE: - cmp r5, 0x9 - ble _081001B4 - b _08100448 -_081001B4: - adds r0, r6, 0 - adds r1, r2, 0 - bl sub_8100524 - adds r0, r4, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - bne _081001CA - b _081004FC -_081001CA: - movs r0, 0x9 - strh r0, [r6, 0x26] - movs r0, 0xFF - b _081004FA -_081001D2: - cmp r5, 0xD - bne _081001D8 - b _081004D6 -_081001D8: - cmp r5, 0xD - bge _081001DE - b _081004B6 -_081001DE: - cmp r5, 0xFF - bne _081001E4 - b _081004E6 -_081001E4: - b _081004FC -_081001E6: - adds r0, r6, 0 - adds r1, r2, 0 - bl sub_8100524 - adds r0, r4, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - bne _081001FC - b _081004FC -_081001FC: - movs r0, 0x1 - strh r0, [r6, 0x26] - movs r0, 0xFF - b _081004FA -_08100204: - ldrh r2, [r4, 0x24] - ldrh r3, [r4, 0x20] - adds r2, r3 - movs r0, 0 - strh r2, [r4, 0x20] - ldrh r1, [r4, 0x26] - ldrh r3, [r4, 0x22] - adds r1, r3 - strh r1, [r4, 0x22] - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - movs r0, 0xA - strh r0, [r4, 0x2E] - strh r2, [r4, 0x30] - ldrh r0, [r6, 0x14] - strh r0, [r4, 0x32] - strh r1, [r4, 0x34] - ldrh r0, [r6, 0x16] - strh r0, [r4, 0x36] - adds r0, r4, 0 - bl sub_8100504 - strh r0, [r4, 0x38] - ldrh r0, [r6, 0x10] - adds r0, 0x2 - strh r0, [r6, 0x10] - strh r5, [r6, 0xE] - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - ldrb r1, [r6, 0xE] - adds r0, r4, 0 - bl StartObjectImageAnim - adds r0, r4, 0 - bl sub_80A68D4 - ldrh r0, [r6, 0x8] - adds r0, 0x1 - b _081004FA -_08100254: - adds r0, r6, 0 - adds r1, r2, 0 - bl sub_8100524 - adds r0, r4, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - bne _0810026A - b _081004FC -_0810026A: - movs r0, 0x3 - strh r0, [r6, 0x26] - movs r0, 0xFF - b _081004FA -_08100272: - ldrh r1, [r4, 0x24] - ldrh r0, [r4, 0x20] - adds r1, r0 - movs r0, 0 - strh r1, [r4, 0x20] - ldrh r2, [r4, 0x26] - ldrh r3, [r4, 0x22] - adds r2, r3 - strh r2, [r4, 0x22] - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - movs r0, 0xA - strh r0, [r4, 0x2E] - strh r1, [r4, 0x30] - movs r1, 0x1C - ldrsh r0, [r6, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - adds r0, 0xA - movs r3, 0x12 - ldrsh r1, [r6, r3] - muls r1, r0 - ldrh r0, [r6, 0x14] - subs r0, r1 - strh r0, [r4, 0x32] - strh r2, [r4, 0x34] - movs r1, 0x1E - ldrsh r0, [r6, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - adds r0, 0xA - movs r2, 0x12 - ldrsh r1, [r6, r2] - muls r1, r0 - ldrh r0, [r6, 0x16] - subs r0, r1 - strh r0, [r4, 0x36] - adds r0, r4, 0 - bl sub_8100504 - strh r0, [r4, 0x38] - movs r0, 0x2 - strh r0, [r6, 0xE] - ldrh r0, [r6, 0x10] - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - ldrb r1, [r6, 0xE] - adds r0, r4, 0 - bl StartObjectImageAnim - adds r0, r4, 0 - bl sub_80A68D4 - ldrh r0, [r6, 0x8] - adds r0, 0x1 - b _081004FA -_081002E8: - ldrh r1, [r4, 0x24] - ldrh r3, [r4, 0x20] - adds r1, r3 - movs r0, 0 - strh r1, [r4, 0x20] - ldrh r2, [r4, 0x26] - ldrh r3, [r4, 0x22] - adds r2, r3 - strh r2, [r4, 0x22] - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - movs r0, 0xA - strh r0, [r4, 0x2E] - strh r1, [r4, 0x30] - movs r1, 0x1C - ldrsh r0, [r6, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - adds r0, 0xA - movs r3, 0x12 - ldrsh r1, [r6, r3] - muls r0, r1 - ldrh r1, [r6, 0x14] - adds r0, r1 - strh r0, [r4, 0x32] - strh r2, [r4, 0x34] - movs r2, 0x1E - ldrsh r0, [r6, r2] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - adds r0, 0xA - movs r3, 0x12 - ldrsh r1, [r6, r3] - muls r0, r1 - ldrh r1, [r6, 0x16] - adds r0, r1 - strh r0, [r4, 0x36] - adds r0, r4, 0 - bl sub_8100504 - strh r0, [r4, 0x38] - ldrh r1, [r6, 0x10] - subs r1, 0x2 - strh r1, [r6, 0x10] - movs r0, 0x3 - strh r0, [r6, 0xE] - adds r0, r4, 0 - adds r0, 0x43 - strb r1, [r0] - ldrb r1, [r6, 0xE] - adds r0, r4, 0 - bl StartObjectImageAnim - adds r0, r4, 0 - bl sub_80A68D4 - ldrh r0, [r6, 0x8] - adds r0, 0x1 - b _081004FA -_08100362: - adds r0, r6, 0 - adds r1, r2, 0 - bl sub_8100524 - adds r0, r4, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - bne _08100378 - b _081004FC -_08100378: - movs r0, 0x7 - strh r0, [r6, 0x26] - movs r0, 0xFF - b _081004FA -_08100380: - ldrh r2, [r4, 0x24] - ldrh r3, [r4, 0x20] - adds r2, r3 - movs r0, 0 - strh r2, [r4, 0x20] - ldrh r1, [r4, 0x26] - ldrh r3, [r4, 0x22] - adds r1, r3 - strh r1, [r4, 0x22] - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - movs r0, 0xA - strh r0, [r4, 0x2E] - strh r2, [r4, 0x30] - ldrh r0, [r6, 0x14] - strh r0, [r4, 0x32] - strh r1, [r4, 0x34] - ldrh r0, [r6, 0x16] - strh r0, [r4, 0x36] - adds r0, r4, 0 - bl sub_8100504 - strh r0, [r4, 0x38] - ldrh r1, [r6, 0x10] - adds r1, 0x2 - strh r1, [r6, 0x10] - movs r0, 0x4 - strh r0, [r6, 0xE] - adds r0, r4, 0 - adds r0, 0x43 - strb r1, [r0] - ldrb r1, [r6, 0xE] - adds r0, r4, 0 - bl StartObjectImageAnim - adds r0, r4, 0 - bl sub_80A68D4 - ldrh r0, [r6, 0x8] - adds r0, 0x1 - b _081004FA -_081003D2: - ldrh r1, [r4, 0x24] - ldrh r0, [r4, 0x20] - adds r1, r0 - movs r0, 0 - strh r1, [r4, 0x20] - ldrh r2, [r4, 0x26] - ldrh r3, [r4, 0x22] - adds r2, r3 - strh r2, [r4, 0x22] - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - movs r0, 0xA - strh r0, [r4, 0x2E] - strh r1, [r4, 0x30] - movs r1, 0x1C - ldrsh r0, [r6, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - adds r0, 0xA - movs r3, 0x12 - ldrsh r1, [r6, r3] - muls r1, r0 - ldrh r0, [r6, 0x14] - subs r0, r1 - strh r0, [r4, 0x32] - strh r2, [r4, 0x34] - movs r1, 0x1E - ldrsh r0, [r6, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - adds r0, 0xA - movs r2, 0x12 - ldrsh r1, [r6, r2] - muls r0, r1 - ldrh r3, [r6, 0x16] - adds r0, r3 - strh r0, [r4, 0x36] - adds r0, r4, 0 - bl sub_8100504 - strh r0, [r4, 0x38] - movs r0, 0x5 - strh r0, [r6, 0xE] - ldrh r0, [r6, 0x10] - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - ldrb r1, [r6, 0xE] - adds r0, r4, 0 - bl StartObjectImageAnim - adds r0, r4, 0 - bl sub_80A68D4 - ldrh r0, [r6, 0x8] - adds r0, 0x1 - b _081004FA -_08100448: - adds r0, r6, 0 - adds r1, r2, 0 - bl sub_8100524 - adds r0, r4, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _081004FC - movs r0, 0xB - strh r0, [r6, 0x26] - movs r0, 0xFF - b _081004FA -_08100464: - ldrh r2, [r4, 0x24] - ldrh r0, [r4, 0x20] - adds r2, r0 - movs r0, 0 - strh r2, [r4, 0x20] - ldrh r1, [r4, 0x26] - ldrh r3, [r4, 0x22] - adds r1, r3 - strh r1, [r4, 0x22] - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - movs r0, 0xA - strh r0, [r4, 0x2E] - strh r2, [r4, 0x30] - ldrh r0, [r6, 0x18] - strh r0, [r4, 0x32] - strh r1, [r4, 0x34] - ldrh r0, [r6, 0x1A] - strh r0, [r4, 0x36] - adds r0, r4, 0 - bl sub_8100504 - strh r0, [r4, 0x38] - ldrh r1, [r6, 0x10] - subs r1, 0x2 - strh r1, [r6, 0x10] - movs r0, 0x6 - strh r0, [r6, 0xE] - adds r0, r4, 0 - adds r0, 0x43 - strb r1, [r0] - ldrb r1, [r6, 0xE] - adds r0, r4, 0 - bl StartObjectImageAnim - adds r0, r4, 0 - bl sub_80A68D4 - ldrh r0, [r6, 0x8] - adds r0, 0x1 - b _081004FA -_081004B6: - adds r0, r6, 0 - adds r1, r2, 0 - bl sub_8100524 - adds r0, r4, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _081004FC - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - ldrh r0, [r6, 0x8] - adds r0, 0x1 - b _081004FA -_081004D6: - movs r1, 0x20 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _081004FC - adds r0, r2, 0 - bl move_anim_task_del - b _081004FC -_081004E6: - ldrh r0, [r6, 0xA] - adds r0, 0x1 - strh r0, [r6, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - ble _081004FC - movs r0, 0 - strh r0, [r6, 0xA] - ldrh r0, [r6, 0x26] -_081004FA: - strh r0, [r6, 0x8] -_081004FC: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8100128 - - thumb_func_start sub_8100504 -sub_8100504: @ 8100504 - push {lr} - movs r2, 0x8 - movs r3, 0x36 - ldrsh r1, [r0, r3] - movs r3, 0x22 - ldrsh r0, [r0, r3] - cmp r1, r0 - bge _0810051A - negs r0, r2 - lsls r0, 16 - lsrs r2, r0, 16 -_0810051A: - lsls r0, r2, 16 - asrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_8100504 - - thumb_func_start sub_8100524 -sub_8100524: @ 8100524 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - lsls r1, 24 - lsrs r7, r1, 24 - ldrh r0, [r6, 0x24] - adds r0, 0x1 - strh r0, [r6, 0x24] - lsls r0, 16 - cmp r0, 0 - ble _081005BA - movs r0, 0 - strh r0, [r6, 0x24] - ldr r0, =0x02020630 - mov r8, r0 - movs r2, 0xC - ldrsh r1, [r6, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldrh r1, [r0, 0x24] - ldrh r2, [r0, 0x20] - adds r1, r2 - ldrh r2, [r0, 0x26] - ldrh r0, [r0, 0x22] - adds r2, r0 - ldr r0, =gUnknown_08592778 - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - ldrb r3, [r6, 0x10] - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _081005BA - lsls r5, r0, 4 - adds r5, r0 - lsls r5, 2 - mov r0, r8 - adds r4, r5, r0 - strh r7, [r4, 0x3A] - movs r0, 0xC - strh r0, [r4, 0x3C] - ldr r0, =0x03005e00 - lsls r1, r7, 2 - adds r1, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x20] - adds r0, 0x1 - strh r0, [r1, 0x20] - ldrh r2, [r6, 0x22] - movs r0, 0x1 - ands r0, r2 - strh r0, [r4, 0x2E] - ldrh r0, [r1, 0x22] - adds r0, 0x1 - strh r0, [r1, 0x22] - ldrb r1, [r6, 0xE] - adds r0, r4, 0 - bl StartObjectImageAnim - ldrh r0, [r6, 0x10] - adds r4, 0x43 - strb r0, [r4] - mov r0, r8 - adds r0, 0x1C - adds r5, r0 - ldr r0, =sub_81005D4 - str r0, [r5] -_081005BA: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8100524 - - thumb_func_start sub_81005D4 -sub_81005D4: @ 81005D4 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _08100636 - movs r0, 0 - strh r0, [r4, 0x2E] - 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] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _08100636 - ldr r3, =0x03005e00 - movs r0, 0x3C - ldrsh r1, [r4, r0] - lsls r1, 1 - movs r0, 0x3A - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_08100636: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81005D4 - - thumb_func_start sub_8100640 -sub_8100640: @ 8100640 - push {r4-r7,lr} - adds r4, r0, 0 - ldr r0, =0x0203841e - movs r1, 0xC - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0810065C - ldr r0, =0x02038436 - b _0810065E - .pool -_0810065C: - ldr r0, =0x02038437 -_0810065E: - ldrb r6, [r0] - adds r0, r6, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08100688 - movs r0, 0 - strh r0, [r4, 0x36] - ldr r1, =0x0203841e - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x32] - ldr r0, =0x0000fff0 - b _08100698 - .pool -_08100688: - movs r0, 0x1 - strh r0, [r4, 0x36] - ldr r1, =0x0203841e - ldrh r0, [r1, 0x6] - negs r0, r0 - strh r0, [r4, 0x32] - movs r0, 0x80 - lsls r0, 1 -_08100698: - strh r0, [r4, 0x20] - adds r7, r1, 0 - adds r5, r7, 0 - ldrh r0, [r5, 0x2] - strh r0, [r4, 0x30] - ldrh r0, [r5, 0x4] - strh r0, [r4, 0x2E] - ldrh r0, [r5, 0x8] - strh r0, [r4, 0x34] - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _081006CE - cmp r0, 0x1 - bgt _081006C0 - cmp r0, 0 - beq _081006CA - b _08100738 - .pool -_081006C0: - cmp r0, 0x2 - beq _081006D4 - cmp r0, 0x3 - beq _08100700 - b _08100738 -_081006CA: - ldrh r0, [r5] - b _081006E4 -_081006CE: - ldrh r0, [r5] - strh r0, [r4, 0x22] - b _0810071A -_081006D4: - adds r0, r6, 0 - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r5, [r5] - adds r0, r5 -_081006E4: - strh r0, [r4, 0x22] - adds r0, r6, 0 - bl sub_80A8328 - movs r1, 0x3 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r4, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x5] - b _08100738 -_08100700: - ldr r0, =0x02038437 - ldrb r0, [r0] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r7, [r7] - adds r0, r7 - strh r0, [r4, 0x22] - movs r0, 0x1 - bl obj_id_for_side_relative_to_move -_0810071A: - adds r0, r6, 0 - bl sub_80A8328 - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x1 - movs r1, 0x3 - ands r0, r1 - lsls r0, 2 - ldrb r2, [r4, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0x5] -_08100738: - ldr r0, =sub_810074C - str r0, [r4, 0x1C] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8100640 - - thumb_func_start sub_810074C -sub_810074C: @ 810074C - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x3C - ldrsh r3, [r4, r0] - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - movs r1, 0x30 - ldrsh r2, [r4, r1] - ldr r1, =gUnknown_08329F40 - movs r5, 0x2E - ldrsh r0, [r4, r5] - lsls r0, 1 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - muls r0, r2 - asrs r0, 8 - strh r0, [r4, 0x26] - movs r2, 0x32 - ldrsh r0, [r4, r2] - muls r0, r3 - strh r0, [r4, 0x24] - movs r5, 0x34 - ldrsh r0, [r4, r5] - muls r0, r3 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x2E] - movs r1, 0x36 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081007A4 - movs r2, 0x24 - ldrsh r0, [r4, r2] - movs r5, 0x20 - ldrsh r1, [r4, r5] - adds r0, r1 - cmp r0, 0xF7 - ble _081007BC - b _081007B6 - .pool -_081007A4: - movs r1, 0x24 - ldrsh r0, [r4, r1] - movs r2, 0x20 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bgt _081007BC -_081007B6: - adds r0, r4, 0 - bl move_anim_8074EE0 -_081007BC: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_810074C - - thumb_func_start sub_81007C4 -sub_81007C4: @ 81007C4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _081007E8 - cmp r0, 0x1 - beq _0810081C - b _08100876 - .pool -_081007E8: - ldr r0, =0x0000274f - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 20 - movs r2, 0x80 - lsls r2, 1 - adds r4, r2, 0 - adds r0, r4 - strh r0, [r5, 0x18] - ldr r0, =0x000027b0 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 20 - adds r0, r4 - strh r0, [r5, 0x20] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - b _08100876 - .pool -_0810081C: - ldrh r0, [r5, 0x1A] - adds r0, 0x1 - movs r7, 0 - strh r0, [r5, 0x1A] - lsls r0, 16 - cmp r0, 0 - blt _08100876 - strh r7, [r5, 0x1A] - ldrh r0, [r5, 0x18] - ldrb r2, [r5, 0x1C] - ldr r4, =gUnknown_08592878 - movs r3, 0x1E - ldrsh r1, [r5, r3] - lsls r1, 1 - adds r1, r4 - ldrh r3, [r1] - movs r1, 0x10 - bl pal_fade_1 - ldrh r0, [r5, 0x20] - ldrb r2, [r5, 0x1C] - movs r3, 0x1E - ldrsh r1, [r5, r3] - lsls r1, 1 - adds r1, r4 - ldrh r3, [r1] - movs r1, 0x10 - bl pal_fade_1 - ldrh r0, [r5, 0x1C] - adds r0, 0x1 - strh r0, [r5, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x11 - bne _08100876 - strh r7, [r5, 0x1C] - ldrh r0, [r5, 0x1E] - adds r0, 0x1 - strh r0, [r5, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - bne _08100876 - strh r7, [r5, 0x1E] -_08100876: - ldr r0, =0x0203841e - movs r2, 0xE - ldrsh r1, [r0, r2] - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _0810088A - adds r0, r6, 0 - bl move_anim_task_del -_0810088A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81007C4 - - thumb_func_start sub_8100898 -sub_8100898: @ 8100898 - push {r4-r7,lr} - sub sp, 0x4 - adds r6, r0, 0 - ldr r1, =0x0203841e - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _081008B4 - adds r0, r6, 0 - bl move_anim_8072740 - b _0810098E - .pool -_081008B4: - movs r3, 0 - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _081008C4 - ldr r4, =0x02038436 - b _081008C6 - .pool -_081008C4: - ldr r4, =0x02038437 -_081008C6: - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r5, r0, 24 - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x0203841e - ldrh r1, [r0, 0x8] - strh r1, [r6, 0x2E] - movs r3, 0x2 - ldrsh r1, [r0, r3] - adds r7, r0, 0 - cmp r1, 0 - bne _08100908 - ldrh r0, [r7, 0x4] - adds r0, r5 - strh r0, [r6, 0x20] - ldrh r0, [r7, 0x6] - adds r0, r2 - strh r0, [r6, 0x22] - strh r5, [r6, 0x38] - strh r2, [r6, 0x3A] - b _08100918 - .pool -_08100908: - strh r5, [r6, 0x20] - strh r2, [r6, 0x22] - ldrh r0, [r7, 0x4] - adds r0, r5 - strh r0, [r6, 0x38] - ldrh r0, [r7, 0x6] - adds r0, r2 - strh r0, [r6, 0x3A] -_08100918: - ldrh r4, [r6, 0x20] - lsls r0, r4, 4 - strh r0, [r6, 0x30] - ldrh r5, [r6, 0x22] - lsls r0, r5, 4 - strh r0, [r6, 0x32] - movs r1, 0x38 - ldrsh r0, [r6, r1] - movs r2, 0x20 - ldrsh r1, [r6, r2] - subs r0, r1 - lsls r0, 4 - movs r3, 0x8 - ldrsh r1, [r7, r3] - bl __divsi3 - strh r0, [r6, 0x34] - movs r1, 0x3A - ldrsh r0, [r6, r1] - movs r2, 0x22 - ldrsh r1, [r6, r2] - subs r0, r1 - lsls r0, 4 - movs r3, 0x8 - ldrsh r1, [r7, r3] - bl __divsi3 - strh r0, [r6, 0x36] - ldrh r0, [r6, 0x38] - subs r0, r4 - lsls r0, 16 - asrs r0, 16 - ldrh r1, [r6, 0x3A] - subs r1, r5 - lsls r1, 16 - asrs r1, 16 - bl sub_80A74F4 - lsls r0, 16 - lsrs r4, r0, 16 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0810097A - ldr r1, =0xffff8000 - adds r0, r4, r1 - lsls r0, 16 - lsrs r4, r0, 16 -_0810097A: - movs r3, 0x80 - lsls r3, 1 - str r4, [sp] - adds r0, r6, 0 - movs r1, 0 - adds r2, r3, 0 - bl sub_80A73E0 - ldr r0, =sub_81009A0 - str r0, [r6, 0x1C] -_0810098E: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8100898 - - thumb_func_start sub_81009A0 -sub_81009A0: @ 81009A0 - push {r4,lr} - adds r2, r0, 0 - ldrh r3, [r2, 0x2E] - movs r1, 0x2E - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _081009D0 - ldrh r0, [r2, 0x34] - ldrh r4, [r2, 0x30] - adds r0, r4 - strh r0, [r2, 0x30] - ldrh r1, [r2, 0x36] - ldrh r4, [r2, 0x32] - adds r1, r4 - strh r1, [r2, 0x32] - lsls r0, 16 - asrs r0, 20 - strh r0, [r2, 0x20] - lsls r1, 16 - asrs r1, 20 - strh r1, [r2, 0x22] - subs r0, r3, 0x1 - strh r0, [r2, 0x2E] - b _081009D6 -_081009D0: - adds r0, r2, 0 - bl move_anim_8074EE0 -_081009D6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81009A0 - - thumb_func_start sub_81009DC -sub_81009DC: @ 81009DC - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _081009F2 - adds r0, r2, 0 - bl move_anim_8072740 -_081009F2: - pop {r0} - bx r0 - thumb_func_end sub_81009DC - - thumb_func_start sub_81009F8 -sub_81009F8: @ 81009F8 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08100A20 - ldr r2, =0x0203841e - ldrh r0, [r4, 0x20] - ldrh r1, [r2] - subs r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r2, 0x2] - b _08100A2C - .pool -_08100A20: - ldr r0, =0x0203841e - ldrh r1, [r0] - ldrh r2, [r4, 0x20] - adds r1, r2 - strh r1, [r4, 0x20] - ldrh r0, [r0, 0x2] -_08100A2C: - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r0, =sub_80A67D8 - str r0, [r4, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81009F8 - - thumb_func_start sub_8100A50 -sub_8100A50: @ 8100A50 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08100A6A - adds r0, r5, 0 - movs r1, 0x1 - bl StartObjectImageAnim -_08100A6A: - ldr r0, =sub_81009DC - str r0, [r5, 0x1C] - ldr r4, =0x0203841e - movs r0, 0 - ldrsh r1, [r4, r0] - adds r0, r5, 0 - bl sub_80A6864 - ldrh r0, [r4, 0x2] - ldrh r1, [r5, 0x22] - adds r0, r1 - strh r0, [r5, 0x22] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8100A50 - - thumb_func_start sub_8100A94 -sub_8100A94: @ 8100A94 - push {r4,lr} - adds r4, r0, 0 - ldr r1, =0x0203841e - ldrh r0, [r1] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - ldrh r0, [r1, 0x2] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x2E] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x34] - ldrh r0, [r1, 0xA] - strh r0, [r4, 0x38] - ldrb r1, [r1, 0xC] - adds r0, r4, 0 - bl StartObjectRotScalAnim - ldr r1, =move_anim_8074EE0 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A66DC - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8100A94 - - thumb_func_start sub_8100AE0 -sub_8100AE0: @ 8100AE0 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08100B14 - ldrh r0, [r5, 0x22] - adds r0, 0x8 - strh r0, [r5, 0x22] -_08100B14: - ldr r0, =sub_8100CCC - str r0, [r5, 0x1C] - ldr r0, =0x0203841e - movs r2, 0x4 - ldrsh r1, [r0, r2] - adds r3, r0, 0 - cmp r1, 0 - bne _08100B3C - ldrh r0, [r3] - ldrh r1, [r5, 0x20] - adds r0, r1 - strh r0, [r5, 0x20] - b _08100B50 - .pool -_08100B3C: - ldrh r0, [r5, 0x20] - ldrh r1, [r3] - subs r0, r1 - strh r0, [r5, 0x20] - adds r2, r5, 0 - adds r2, 0x3F - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] -_08100B50: - ldrh r0, [r3, 0x2] - ldrh r2, [r5, 0x22] - adds r0, r2 - strh r0, [r5, 0x22] - ldr r1, =0xfffffc00 - adds r0, r1, 0 - ldrh r2, [r5, 0x30] - adds r1, r0, r2 - strh r1, [r5, 0x30] - movs r2, 0x80 - lsls r2, 3 - adds r0, r2, 0 - ldrh r2, [r5, 0x32] - adds r0, r2 - strh r0, [r5, 0x32] - ldrh r0, [r3, 0x4] - strh r0, [r5, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _08100B7E - negs r0, r1 - strh r0, [r5, 0x30] -_08100B7E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8100AE0 - - thumb_func_start sub_8100B88 -sub_8100B88: @ 8100B88 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - ldr r0, =0x0203841e - movs r1, 0x6 - ldrsh r0, [r0, r1] - cmp r0, 0x1 - beq _08100BA8 - cmp r0, 0x1 - ble _08100C24 - cmp r0, 0x2 - beq _08100BC8 - b _08100C24 - .pool -_08100BA8: - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r4, 0x2 - eors r0, r4 - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r7, r0, 24 - ldrb r0, [r5] - eors r4, r0 - adds r0, r4, 0 - b _08100C34 - .pool -_08100BC8: - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r7, r0, 24 - ldrb r0, [r5] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r4, r0, 24 - ldrb r0, [r5] - movs r2, 0x2 - mov r8, r2 - mov r1, r8 - eors r0, r1 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _08100C3E - ldrb r0, [r5] - mov r2, r8 - eors r0, r2 - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, r7 - lsrs r7, r0, 1 - ldrb r0, [r5] - mov r1, r8 - eors r0, r1 - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - lsrs r4, r0, 1 - b _08100C3E - .pool -_08100C24: - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r7, r0, 24 - ldrb r0, [r4] -_08100C34: - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r4, r0, 24 -_08100C3E: - strh r7, [r6, 0x20] - strh r4, [r6, 0x22] - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08100C56 - ldrh r0, [r6, 0x22] - adds r0, 0x8 - strh r0, [r6, 0x22] -_08100C56: - ldr r0, =sub_8100CCC - str r0, [r6, 0x1C] - ldr r0, =0x0203841e - movs r2, 0x4 - ldrsh r1, [r0, r2] - adds r3, r0, 0 - cmp r1, 0 - bne _08100C7C - ldrh r0, [r3] - ldrh r1, [r6, 0x20] - adds r0, r1 - strh r0, [r6, 0x20] - b _08100C90 - .pool -_08100C7C: - ldrh r0, [r6, 0x20] - ldrh r1, [r3] - subs r0, r1 - strh r0, [r6, 0x20] - adds r2, r6, 0 - adds r2, 0x3F - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] -_08100C90: - ldrh r0, [r3, 0x2] - ldrh r2, [r6, 0x22] - adds r0, r2 - strh r0, [r6, 0x22] - ldr r1, =0xfffffc00 - adds r0, r1, 0 - ldrh r2, [r6, 0x30] - adds r1, r0, r2 - strh r1, [r6, 0x30] - movs r2, 0x80 - lsls r2, 3 - adds r0, r2, 0 - ldrh r2, [r6, 0x32] - adds r0, r2 - strh r0, [r6, 0x32] - ldrh r0, [r3, 0x4] - strh r0, [r6, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _08100CBE - negs r0, r1 - strh r0, [r6, 0x30] -_08100CBE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8100B88 - - thumb_func_start sub_8100CCC -sub_8100CCC: @ 8100CCC - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x30] - ldrh r2, [r4, 0x34] - adds r0, r1, r2 - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x32] - ldrh r2, [r4, 0x36] - adds r0, r2 - strh r0, [r4, 0x36] - movs r2, 0x38 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _08100CEE - adds r0, r1, 0 - adds r0, 0x18 - b _08100CF2 -_08100CEE: - adds r0, r1, 0 - subs r0, 0x18 -_08100CF2: - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x32] - subs r0, 0x18 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - bne _08100D28 - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - movs r0, 0x3 - strh r0, [r4, 0x2E] - ldr r0, =sub_80A64B0 - str r0, [r4, 0x1C] -_08100D28: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8100CCC - - thumb_func_start sub_8100D38 -sub_8100D38: @ 8100D38 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r1, [r5, 0x32] - movs r2, 0x32 - ldrsh r0, [r5, r2] - cmp r0, 0x1 - ble _08100DDC - ldrh r1, [r5, 0x34] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08100D94 - adds r3, r5, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r1 - strb r0, [r3] - ldr r4, =0x02020630 - movs r0, 0x2E - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r3, [r0] - adds r1, r2, 0 - ands r1, r3 - strb r1, [r0] - movs r0, 0x30 - ldrsh r1, [r5, r0] - 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] - b _08100DCA - .pool -_08100D94: - adds r1, r5, 0 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - ldr r3, =0x02020630 - movs r0, 0x2E - ldrsh r1, [r5, 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] - movs r0, 0x30 - ldrsh r1, [r5, 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] -_08100DCA: - movs r0, 0 - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x34] - adds r0, 0x1 - strh r0, [r5, 0x34] - b _08100DE0 - .pool -_08100DDC: - adds r0, r1, 0x1 - strh r0, [r5, 0x32] -_08100DE0: - movs r1, 0x34 - ldrsh r0, [r5, r1] - cmp r0, 0xA - bne _08100E10 - movs r2, 0x2E - ldrsh r1, [r5, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl RemoveObjectAndFreeTiles - movs r0, 0x30 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - adds r0, r5, 0 - bl move_anim_8072740 -_08100E10: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8100D38 - - thumb_func_start sub_8100E1C -sub_8100E1C: @ 8100E1C - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x0203841e - ldrh r0, [r4, 0x4] - strh r0, [r5, 0x2E] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08100E44 - ldrh r0, [r5, 0x20] - ldrh r1, [r4] - subs r0, r1 - b _08100E4A - .pool -_08100E44: - ldrh r0, [r4] - ldrh r1, [r5, 0x20] - adds r0, r1 -_08100E4A: - strh r0, [r5, 0x20] - ldr r4, =0x0203841e - ldrb r1, [r4, 0xA] - adds r0, r5, 0 - bl StartObjectImageAnim - ldrh r0, [r4, 0x6] - negs r0, r0 - strh r0, [r5, 0x30] - ldrh r0, [r4, 0x2] - ldrh r1, [r5, 0x22] - adds r0, r1 - strh r0, [r5, 0x22] - ldrh r0, [r4, 0x8] - strh r0, [r5, 0x34] - ldr r1, =sub_8100E80 - str r1, [r5, 0x1C] - adds r0, r5, 0 - bl _call_via_r1 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8100E1C - - thumb_func_start sub_8100E80 -sub_8100E80: @ 8100E80 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r1, 0x64 - bl cosine - strh r0, [r4, 0x24] - movs r2, 0x2E - ldrsh r0, [r4, r2] - movs r1, 0x14 - bl sine - strh r0, [r4, 0x26] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x7F - bgt _08100EAC - adds r1, r4, 0 - adds r1, 0x43 - movs r0, 0 - b _08100EB2 -_08100EAC: - adds r1, r4, 0 - adds r1, 0x43 - movs r0, 0xE -_08100EB2: - strb r0, [r1] - ldrh r0, [r4, 0x30] - ldrh r2, [r4, 0x2E] - adds r0, r2 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x38] - adds r0, 0x82 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x34 - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _08100EE8 - adds r0, r4, 0 - bl move_anim_8072740 -_08100EE8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8100E80 - - thumb_func_start sub_8100EF0 -sub_8100EF0: @ 8100EF0 - push {r4-r6,lr} - adds r5, r0, 0 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _08100F06 - ldr r1, =0x0203841e - ldrh r0, [r1, 0x2] - adds r0, 0x8 - strh r0, [r1, 0x2] -_08100F06: - ldr r6, =0x02038436 - ldrb r0, [r6] - movs r1, 0 - bl sub_80A60AC - lsls r0, 24 - ldr r4, =0x0203841e - lsrs r0, 24 - ldrh r1, [r4] - adds r0, r1 - strh r0, [r5, 0x20] - ldrb r0, [r6] - movs r1, 0x1 - bl sub_80A60AC - lsls r0, 24 - lsrs r0, 24 - ldrh r4, [r4, 0x2] - adds r0, r4 - strh r0, [r5, 0x22] - ldrb r0, [r6] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08100F44 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _08100F6C -_08100F44: - ldrb r0, [r6] - bl sub_80A8328 - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x1 - movs r1, 0x3 - ands r0, r1 - lsls r0, 2 - ldrb r2, [r5, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r5, 0x5] - b _08100F84 - .pool -_08100F6C: - ldrb r0, [r6] - bl sub_80A8328 - movs r1, 0x3 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r5, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] -_08100F84: - ldr r0, =0x0203841e - ldrh r0, [r0, 0x4] - strh r0, [r5, 0x2E] - ldr r0, =0x00002828 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 20 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - strh r0, [r5, 0x32] - movs r4, 0x10 - movs r0, 0x10 - strh r0, [r5, 0x3C] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldrh r0, [r5, 0x3C] - lsls r1, r0, 8 - subs r4, r0 - orrs r1, r4 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldr r0, =sub_8100FD4 - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8100EF0 - - thumb_func_start sub_8100FD4 -sub_8100FD4: @ 8100FD4 - push {r4-r6,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x38] - adds r0, 0x60 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 24 - negs r0, r0 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _08101032 - movs r0, 0 - strh r0, [r4, 0x30] - ldr r1, =0x02037b14 - movs r2, 0x32 - ldrsh r0, [r4, r2] - adds r0, 0x1 - lsls r0, 1 - adds r0, r1 - ldrh r5, [r0] - movs r2, 0 - adds r6, r1, 0 - adds r3, r6, 0 -_0810100C: - movs r1, 0x32 - ldrsh r0, [r4, r1] - adds r2, 0x1 - adds r0, r2 - lsls r1, r0, 1 - adds r1, r3 - adds r0, 0x1 - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - strh r0, [r1] - cmp r2, 0x5 - ble _0810100C - movs r2, 0x32 - ldrsh r0, [r4, r2] - adds r0, 0x7 - lsls r0, 1 - adds r0, r6 - strh r5, [r0] -_08101032: - ldrh r2, [r4, 0x3C] - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0x6 - ble _0810106C - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - ble _08101080 - ldrh r0, [r4, 0x3A] - adds r0, 0x1 - strh r0, [r4, 0x3A] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0810106C - movs r0, 0 - strh r0, [r4, 0x3A] - subs r2, 0x1 - strh r2, [r4, 0x3C] - lsls r1, r2, 8 - movs r0, 0x10 - subs r0, r2 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg -_0810106C: - ldrh r1, [r4, 0x2E] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _08101080 - subs r0, r1, 0x1 - strh r0, [r4, 0x2E] - b _081010C2 - .pool -_08101080: - ldrh r0, [r4, 0x3A] - adds r0, 0x1 - strh r0, [r4, 0x3A] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _081010C2 - movs r0, 0 - strh r0, [r4, 0x3A] - ldrh r2, [r4, 0x3C] - adds r2, 0x1 - strh r2, [r4, 0x3C] - lsls r1, r2, 8 - movs r0, 0x10 - subs r0, r2 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0x10 - bne _081010C2 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_80A67F4 - str r0, [r4, 0x1C] -_081010C2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8100FD4 - - thumb_func_start sub_81010CC -sub_81010CC: @ 81010CC - push {r4-r6,lr} - adds r4, r0, 0 - ldr r6, =0x02038437 - ldrb r0, [r6] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - strh r0, [r4, 0x20] - ldrb r0, [r6] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0000ffe8 - adds r0, r1 - strh r0, [r4, 0x22] - strh r5, [r4, 0x2E] - strh r5, [r4, 0x30] - strh r5, [r4, 0x32] - strh r5, [r4, 0x34] - strh r5, [r4, 0x36] - strh r5, [r4, 0x3A] - movs r0, 0x10 - strh r0, [r4, 0x3C] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldrh r1, [r4, 0x3C] - lsls r1, 8 - ldrh r0, [r4, 0x3A] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldr r0, =sub_8101138 - str r0, [r4, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81010CC - - thumb_func_start sub_8101138 -sub_8101138: @ 8101138 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bls _08101146 - b _08101290 -_08101146: - lsls r0, 2 - ldr r1, =_08101154 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08101154: - .4byte _08101168 - .4byte _081011CC - .4byte _081011E8 - .4byte _08101266 - .4byte _0810127A -_08101168: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - cmp r0, 0 - bgt _08101176 - b _08101290 -_08101176: - movs r0, 0 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08101198 - ldrh r1, [r4, 0x3A] - movs r2, 0x3A - ldrsh r0, [r4, r2] - cmp r0, 0xF - bgt _081011A6 - adds r0, r1, 0x1 - strh r0, [r4, 0x3A] - b _081011A6 -_08101198: - ldrh r1, [r4, 0x3C] - movs r2, 0x3C - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _081011A6 - subs r0, r1, 0x1 - strh r0, [r4, 0x3C] -_081011A6: - ldrh r1, [r4, 0x3C] - lsls r1, 8 - ldrh r0, [r4, 0x3A] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x3A - ldrsh r0, [r4, r1] - cmp r0, 0x10 - bne _08101290 - movs r2, 0x3C - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _08101290 - strh r0, [r4, 0x30] - b _08101272 -_081011CC: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _08101290 - movs r0, 0 - strh r0, [r4, 0x30] - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - b _08101272 -_081011E8: - adds r0, r4, 0 - movs r1, 0x10 - movs r2, 0x4 - bl sub_8101298 - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _0810120A - movs r0, 0 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x22] - adds r0, 0x1 - strh r0, [r4, 0x22] -_0810120A: - ldrh r0, [r4, 0x32] - adds r1, r0, 0x1 - strh r1, [r4, 0x32] - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x1D - ble _08101290 - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - beq _08101230 - ldrh r1, [r4, 0x3A] - movs r2, 0x3A - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _0810123E - subs r0, r1, 0x1 - strh r0, [r4, 0x3A] - b _0810123E -_08101230: - ldrh r1, [r4, 0x3C] - movs r2, 0x3C - ldrsh r0, [r4, r2] - cmp r0, 0xF - bgt _0810123E - adds r0, r1, 0x1 - strh r0, [r4, 0x3C] -_0810123E: - ldrh r1, [r4, 0x3C] - lsls r1, 8 - ldrh r0, [r4, 0x3A] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x3A - ldrsh r1, [r4, r0] - cmp r1, 0 - bne _08101290 - movs r2, 0x3C - ldrsh r0, [r4, r2] - cmp r0, 0x10 - bne _08101290 - strh r1, [r4, 0x30] - strh r1, [r4, 0x32] - b _08101272 -_08101266: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_08101272: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _08101290 -_0810127A: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl move_anim_8072740 -_08101290: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8101138 - - thumb_func_start sub_8101298 -sub_8101298: @ 8101298 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0xB - bgt _081012AA - ldrh r0, [r4, 0x36] - adds r0, 0x2 - strh r0, [r4, 0x36] -_081012AA: - ldrh r5, [r4, 0x34] - adds r0, r5, 0 - subs r0, 0x12 - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - cmp r0, 0x17 - bhi _081012C0 - ldrh r0, [r4, 0x36] - subs r0, 0x2 - strh r0, [r4, 0x36] -_081012C0: - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x2F - ble _081012CE - ldrh r0, [r4, 0x36] - adds r0, 0x2 - strh r0, [r4, 0x36] -_081012CE: - movs r1, 0x36 - ldrsh r0, [r4, r1] - movs r1, 0x9 - bl __divsi3 - strh r0, [r4, 0x24] - movs r1, 0x36 - ldrsh r0, [r4, r1] - movs r1, 0xE - bl __divsi3 - strh r0, [r4, 0x26] - lsls r0, 16 - cmp r0, 0 - bge _081012F4 - movs r1, 0x26 - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0x26] -_081012F4: - adds r0, r5, 0x1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3B - ble _08101304 - movs r0, 0 - strh r0, [r4, 0x34] -_08101304: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8101298 - - thumb_func_start sub_810130C -sub_810130C: @ 810130C - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x0203841e - movs r1, 0x4 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _08101320 - adds r0, r4, 0 - bl sub_80A6838 -_08101320: - movs r0, 0 - ldrsh r1, [r5, r0] - adds r0, r4, 0 - bl sub_80A6864 - ldrh r0, [r5, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldrh r0, [r5, 0xA] - strh r0, [r4, 0x2E] - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x30] - ldrh r0, [r5, 0x8] - strh r0, [r4, 0x32] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A656C - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810130C - - thumb_func_start sub_810135C -sub_810135C: @ 810135C - push {r4-r6,lr} - adds r5, r0, 0 - ldr r0, =0x0203841e - movs r1, 0x4 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08101378 - ldr r0, =0x02038436 - b _0810137A - .pool -_08101378: - ldr r0, =0x02038437 -_0810137A: - ldrb r6, [r0] - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _081013C4 - movs r1, 0x2 - adds r0, r6, 0 - eors r0, r1 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _081013C4 - ldr r4, =0x0203841e - ldrb r1, [r4, 0xC] - adds r2, r5, 0 - adds r2, 0x20 - adds r3, r5, 0 - adds r3, 0x22 - adds r0, r6, 0 - bl sub_80A8924 - movs r2, 0 - ldrsh r1, [r4, r2] - adds r0, r5, 0 - bl sub_80A6864 - ldrh r0, [r4, 0x2] - ldrh r1, [r5, 0x22] - adds r0, r1 - strh r0, [r5, 0x22] - b _08101414 - .pool -_081013C4: - ldr r4, =0x0203841e - movs r2, 0xC - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _081013E8 - adds r0, r6, 0 - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - adds r0, r6, 0 - movs r1, 0x1 - b _081013FA - .pool -_081013E8: - adds r0, r6, 0 - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - adds r0, r6, 0 - movs r1, 0x3 -_081013FA: - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r4, [r4, 0x2] - adds r0, r4 - strh r0, [r5, 0x22] - ldr r0, =0x0203841e - movs r2, 0 - ldrsh r1, [r0, r2] - adds r0, r5, 0 - bl sub_80A6864 -_08101414: - ldr r1, =0x0203841e - ldrh r0, [r1, 0xA] - strh r0, [r5, 0x2E] - ldrh r0, [r1, 0x6] - strh r0, [r5, 0x30] - ldrh r0, [r1, 0x8] - strh r0, [r5, 0x32] - ldr r1, =move_anim_8072740 - adds r0, r5, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A656C - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810135C - - thumb_func_start sub_8101440 -sub_8101440: @ 8101440 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6838 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08101474 - ldr r0, =0x0203841e - ldrh r1, [r0] - ldrh r2, [r4, 0x20] - adds r1, r2 - strh r1, [r4, 0x20] - ldrh r0, [r0, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - b _0810148E - .pool -_08101474: - ldr r2, =0x0203841e - ldrh r0, [r4, 0x20] - ldrh r1, [r2] - subs r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r2, 0x2] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnim -_0810148E: - ldr r0, =sub_81014A0 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8101440 - - thumb_func_start sub_81014A0 -sub_81014A0: @ 81014A0 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1E - ble _081014D8 - movs r0, 0x2E - ldrsh r1, [r4, r0] - movs r0, 0x1E - subs r0, r1 - movs r1, 0x3 - bl __divsi3 - strh r0, [r4, 0x26] - movs r1, 0x30 - ldrsh r0, [r4, r1] - lsls r0, 18 - asrs r0, 16 - movs r1, 0x3 - bl sine - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] -_081014D8: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _081014EC - adds r0, r4, 0 - bl move_anim_8072740 -_081014EC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81014A0 - - thumb_func_start sub_81014F4 -sub_81014F4: @ 81014F4 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6838 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0810152C - ldr r1, =0x0203841e - ldrh r0, [r1] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - ldrh r0, [r1, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - movs r0, 0x1 - strh r0, [r4, 0x34] - b _0810154A - .pool -_0810152C: - ldr r2, =0x0203841e - ldrh r0, [r4, 0x20] - ldrh r1, [r2] - subs r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r2, 0x2] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - ldr r0, =0x0000ffff - strh r0, [r4, 0x34] - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim -_0810154A: - ldr r0, =sub_8101560 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81014F4 - - thumb_func_start sub_8101560 -sub_8101560: @ 8101560 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r1, 0x28 - bl __divsi3 - negs r0, r0 - strh r0, [r4, 0x26] - movs r2, 0x36 - ldrsh r0, [r4, r2] - movs r1, 0xA - bl __divsi3 - strh r0, [r4, 0x24] - movs r1, 0x34 - ldrsh r0, [r4, r1] - lsls r0, 1 - ldrh r2, [r4, 0x36] - adds r0, r2 - strh r0, [r4, 0x36] - ldrh r0, [r4, 0x30] - ldrh r2, [r4, 0x2E] - adds r1, r0, r2 - strh r1, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3C - ble _081015A4 - adds r0, r4, 0 - bl move_anim_8074EE0 -_081015A4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8101560 - - thumb_func_start sub_81015AC -sub_81015AC: @ 81015AC - push {lr} - ldrh r1, [r0, 0x20] - subs r1, 0x20 - strh r1, [r0, 0x20] - ldrh r1, [r0, 0x22] - subs r1, 0x20 - strh r1, [r0, 0x22] - movs r1, 0x14 - strh r1, [r0, 0x2E] - ldr r1, =sub_80A64B0 - str r1, [r0, 0x1C] - ldr r1, =sub_81015D4 - bl oamt_set_x3A_32 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81015AC - - thumb_func_start sub_81015D4 -sub_81015D4: @ 81015D4 - push {r4-r6,lr} - adds r5, r0, 0 - ldrh r6, [r5, 0x38] - movs r1, 0x1 - adds r0, r1, 0 - ands r0, r6 - cmp r0, 0 - beq _081015EA - cmp r0, 0x1 - beq _08101604 - b _0810166A -_081015EA: - strh r1, [r5, 0x2E] - ldr r0, =sub_80A64B0 - str r0, [r5, 0x1C] - ldr r1, =sub_81015D4 - adds r0, r5, 0 - bl oamt_set_x3A_32 - b _0810166A - .pool -_08101604: - ldrh r3, [r5, 0x24] - ldrh r0, [r5, 0x20] - adds r3, r0 - movs r0, 0 - strh r3, [r5, 0x20] - ldrh r4, [r5, 0x26] - ldrh r1, [r5, 0x22] - adds r4, r1 - strh r4, [r5, 0x22] - strh r0, [r5, 0x26] - strh r0, [r5, 0x24] - movs r0, 0x8 - strh r0, [r5, 0x2E] - ldr r2, =gUnknown_08592CD0 - lsls r0, r6, 16 - asrs r0, 24 - lsls r0, 1 - adds r1, r0, r2 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - adds r3, r1 - strh r3, [r5, 0x32] - adds r2, 0x1 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - adds r4, r0 - strh r4, [r5, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r5, 0x1C] - ldr r1, =sub_8101684 - adds r0, r5, 0 - bl oamt_set_x3A_32 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1, 0 - ldrh r1, [r5, 0x38] - adds r0, r1 - strh r0, [r5, 0x38] - movs r0, 0x3F - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xD2 - bl audio_play_and_stuff -_0810166A: - ldrh r0, [r5, 0x38] - movs r1, 0x1 - eors r0, r1 - strh r0, [r5, 0x38] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81015D4 - - thumb_func_start sub_8101684 -sub_8101684: @ 8101684 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x38] - lsls r0, 16 - asrs r0, 24 - cmp r0, 0x4 - bne _081016AC - movs r0, 0xA - strh r0, [r2, 0x2E] - ldr r0, =sub_80A64B0 - str r0, [r2, 0x1C] - ldr r1, =sub_81016B8 - adds r0, r2, 0 - bl oamt_set_x3A_32 - b _081016B0 - .pool -_081016AC: - ldr r0, =sub_81015D4 - str r0, [r2, 0x1C] -_081016B0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8101684 - - thumb_func_start sub_81016B8 -sub_81016B8: @ 81016B8 - push {r4-r7,lr} - adds r5, r0, 0 - ldrh r1, [r5, 0x6] - cmp r1, 0 - bne _081016E0 - movs r0, 0x3 - strh r0, [r5, 0x2E] - strh r1, [r5, 0x30] - strh r1, [r5, 0x32] - ldr r0, =sub_80A64B0 - str r0, [r5, 0x1C] - ldr r1, =sub_8101774 - adds r0, r5, 0 - bl oamt_set_x3A_32 - b _08101760 - .pool -_081016E0: - ldrh r0, [r5, 0x6] - cmp r0, 0x2 - beq _08101700 - cmp r0, 0x2 - bgt _081016F0 - cmp r0, 0x1 - beq _081016F6 - b _08101714 -_081016F0: - cmp r0, 0x3 - beq _08101708 - b _08101714 -_081016F6: - ldr r6, =0x0000fff8 - adds r7, r6, 0 - b _08101718 - .pool -_08101700: - ldr r7, =0x0000fff8 - b _08101716 - .pool -_08101708: - movs r7, 0x8 - ldr r6, =0x0000fff8 - b _08101718 - .pool -_08101714: - movs r7, 0x8 -_08101716: - movs r6, 0x8 -_08101718: - ldrh r0, [r5, 0x24] - ldrh r1, [r5, 0x20] - adds r0, r1 - movs r1, 0 - strh r0, [r5, 0x20] - ldrh r0, [r5, 0x26] - ldrh r2, [r5, 0x22] - adds r0, r2 - strh r0, [r5, 0x22] - strh r1, [r5, 0x26] - strh r1, [r5, 0x24] - movs r0, 0x6 - strh r0, [r5, 0x2E] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, r7 - strh r0, [r5, 0x32] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, r6 - strh r0, [r5, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r5, 0x1C] - ldr r1, =sub_8101820 - adds r0, r5, 0 - bl oamt_set_x3A_32 -_08101760: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81016B8 - - thumb_func_start sub_8101774 -sub_8101774: @ 8101774 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08101794 - ldrh r0, [r4, 0x30] - adds r0, 0x3 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - ble _081017A4 - movs r0, 0x10 - b _081017A2 -_08101794: - ldrh r0, [r4, 0x30] - subs r0, 0x3 - strh r0, [r4, 0x30] - lsls r0, 16 - cmp r0, 0 - bge _081017A4 - movs r0, 0 -_081017A2: - strh r0, [r4, 0x30] -_081017A4: - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x1 - movs r3, 0x1 - bl sub_80A75AC - ldrh r1, [r4, 0x30] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x00007fff - bl sub_80A2A20 - movs r3, 0x30 - ldrsh r0, [r4, r3] - cmp r0, 0x10 - bne _0810180C - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - ldrb r1, [r4, 0x5] - lsrs r1, 4 - lsls r0, r1, 5 - ldr r2, =0x02037924 - adds r0, r2 - lsls r1, 4 - ldr r3, =0x00000101 - adds r2, r3, 0 - orrs r1, r2 - movs r2, 0x4 - bl gpu_pal_apply - movs r0, 0x3F - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xC0 - bl audio_play_and_stuff - b _08101814 - .pool -_0810180C: - cmp r0, 0 - bne _08101814 - ldr r0, =sub_8101820 - str r0, [r4, 0x1C] -_08101814: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8101774 - - thumb_func_start sub_8101820 -sub_8101820: @ 8101820 - push {lr} - adds r2, r0, 0 - ldr r0, =0x0203841e - ldrh r1, [r0, 0xE] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08101838 - movs r0, 0 - strh r0, [r2, 0x30] - strh r0, [r2, 0x2E] - ldr r0, =sub_8101848 - str r0, [r2, 0x1C] -_08101838: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8101820 - - thumb_func_start sub_8101848 -sub_8101848: @ 8101848 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r1, 0x3 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _0810187C - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - 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] -_0810187C: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0x8 - bne _08101890 - adds r0, r4, 0 - bl move_anim_8072740 -_08101890: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8101848 - - thumb_func_start sub_8101898 -sub_8101898: @ 8101898 - push {r4,lr} - adds r3, r0, 0 - ldr r0, =0x0203841e - ldrh r0, [r0] - strh r0, [r3, 0x6] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _081018BC - ldrh r0, [r3, 0x20] - subs r0, 0x18 - strh r0, [r3, 0x20] - ldrh r0, [r3, 0x22] - subs r0, 0x18 - strh r0, [r3, 0x22] - b _0810190E - .pool -_081018BC: - cmp r0, 0x2 - bne _081018D8 - ldrh r0, [r3, 0x20] - subs r0, 0x18 - strh r0, [r3, 0x20] - ldrh r0, [r3, 0x22] - adds r0, 0x18 - strh r0, [r3, 0x22] - ldrb r1, [r3, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - movs r1, 0x20 - b _0810190A -_081018D8: - cmp r0, 0x3 - bne _081018F4 - ldrh r0, [r3, 0x20] - adds r0, 0x18 - strh r0, [r3, 0x20] - ldrh r0, [r3, 0x22] - subs r0, 0x18 - strh r0, [r3, 0x22] - ldrb r1, [r3, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - movs r1, 0x10 - b _0810190A -_081018F4: - ldrh r0, [r3, 0x20] - adds r0, 0x18 - strh r0, [r3, 0x20] - ldrh r0, [r3, 0x22] - adds r0, 0x18 - strh r0, [r3, 0x22] - ldrb r1, [r3, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - movs r1, 0x30 -_0810190A: - orrs r0, r1 - strb r0, [r3, 0x3] -_0810190E: - ldrh r2, [r3, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x10 - ldr r4, =0x000003ff - adds r0, r4, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r3, 0x4] - ldr r1, =sub_81015AC - str r1, [r3, 0x1C] - adds r0, r3, 0 - bl _call_via_r1 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8101898 - - thumb_func_start sub_8101940 -sub_8101940: @ 8101940 - push {lr} - adds r3, r0, 0 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - movs r0, 0 - strh r0, [r3, 0x2E] - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x1 - beq _0810197C - cmp r0, 0x1 - bgt _0810196C - cmp r0, 0 - beq _08101972 - b _0810198C - .pool -_0810196C: - cmp r0, 0x2 - beq _08101984 - b _0810198C -_08101972: - ldr r0, =sub_8101998 - b _0810198E - .pool -_0810197C: - ldr r0, =sub_8101A74 - b _0810198E - .pool -_08101984: - ldr r0, =sub_8101AC4 - b _0810198E - .pool -_0810198C: - ldr r0, =sub_8101B84 -_0810198E: - str r0, [r3, 0x1C] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8101940 - - thumb_func_start sub_8101998 -sub_8101998: @ 8101998 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x6 - strh r0, [r4, 0x2E] - ldr r5, =0x02038436 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - movs r2, 0x2 - negs r2, r2 - adds r1, r2, 0 - cmp r0, 0 - beq _081019B6 - movs r1, 0x2 -_081019B6: - strh r1, [r4, 0x30] - movs r0, 0 - strh r0, [r4, 0x32] - ldr r1, =0x020241e4 - ldrb r0, [r5] - adds r0, r1 - ldrb r0, [r0] - strh r0, [r4, 0x34] - ldr r1, =sub_81019E8 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A6630 - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8101998 - - thumb_func_start sub_81019E8 -sub_81019E8: @ 81019E8 - push {r4-r6,lr} - adds r5, r0, 0 - movs r0, 0x2E - ldrsh r6, [r5, r0] - cmp r6, 0 - bne _08101A24 - ldr r1, =0x020241e4 - ldr r4, =0x02038436 - ldrb r0, [r4] - adds r0, r1 - ldrb r0, [r0] - strh r0, [r5, 0x34] - movs r1, 0 - bl sub_80A7270 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x3A] - ldr r2, =0xfffffd00 - adds r1, r2, 0 - cmp r0, 0 - beq _08101A20 - movs r0, 0xC0 - lsls r0, 2 - adds r1, r0, 0 -_08101A20: - strh r1, [r5, 0x36] - strh r6, [r5, 0x38] -_08101A24: - ldrh r0, [r5, 0x36] - ldrh r1, [r5, 0x38] - adds r0, r1 - strh r0, [r5, 0x38] - ldrh r0, [r5, 0x34] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r5, 0x38] - adds r1, r2, 0 - bl obj_id_set_rotscale - ldrh r0, [r5, 0x34] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A73A0 - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _08101A5E - movs r0, 0 - strh r0, [r5, 0x2E] - ldr r0, =sub_8101B84 - str r0, [r5, 0x1C] -_08101A5E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81019E8 - - thumb_func_start sub_8101A74 -sub_8101A74: @ 8101A74 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x4 - strh r0, [r4, 0x2E] - ldr r5, =0x02038436 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - movs r1, 0x3 - cmp r0, 0 - beq _08101A92 - movs r0, 0x3 - negs r0, r0 - adds r1, r0, 0 -_08101A92: - strh r1, [r4, 0x30] - movs r0, 0 - strh r0, [r4, 0x32] - ldr r1, =0x020241e4 - ldrb r0, [r5] - adds r0, r1 - ldrb r0, [r0] - strh r0, [r4, 0x34] - ldr r1, =sub_8101B84 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A6630 - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8101A74 - - thumb_func_start sub_8101AC4 -sub_8101AC4: @ 8101AC4 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _08101ADE - movs r0, 0 - strh r0, [r1, 0x2E] - ldr r0, =sub_8101AE8 - str r0, [r1, 0x1C] -_08101ADE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8101AC4 - - thumb_func_start sub_8101AE8 -sub_8101AE8: @ 8101AE8 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _08101B38 - ldr r1, =0x020241e4 - ldr r4, =0x02038436 - ldrb r0, [r4] - adds r0, r1 - ldrb r0, [r0] - strh r0, [r5, 0x34] - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x3A] - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08101B2C - movs r0, 0xFC - lsls r0, 8 - strh r0, [r5, 0x36] - movs r0, 0xC0 - lsls r0, 4 - b _08101B36 - .pool -_08101B2C: - movs r0, 0x80 - lsls r0, 3 - strh r0, [r5, 0x36] - movs r0, 0xF4 - lsls r0, 8 -_08101B36: - strh r0, [r5, 0x38] -_08101B38: - ldrh r0, [r5, 0x36] - ldrh r1, [r5, 0x38] - adds r0, r1 - strh r0, [r5, 0x38] - ldrh r0, [r5, 0x34] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r5, 0x38] - adds r1, r2, 0 - bl obj_id_set_rotscale - ldrh r0, [r5, 0x34] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A73A0 - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _08101B78 - ldrh r0, [r5, 0x34] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A7344 - ldr r0, =sub_8101B84 - str r0, [r5, 0x1C] -_08101B78: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8101AE8 - - thumb_func_start sub_8101B84 -sub_8101B84: @ 8101B84 - push {lr} - bl move_anim_8072740 - pop {r0} - bx r0 - thumb_func_end sub_8101B84 - - thumb_func_start sub_8101B90 -sub_8101B90: @ 8101B90 - movs r1, 0 - strh r1, [r0, 0x2E] - ldr r1, =sub_8101BA0 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_8101B90 - - thumb_func_start sub_8101BA0 -sub_8101BA0: @ 8101BA0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x2E - ldrsh r5, [r4, r0] - cmp r5, 0x1 - beq _08101BFA - cmp r5, 0x1 - bgt _08101BB6 - cmp r5, 0 - beq _08101BBC - b _08101C8E -_08101BB6: - cmp r5, 0x2 - beq _08101C4C - b _08101C8E -_08101BBC: - strh r5, [r4, 0x30] - ldr r1, =0x020241e4 - ldr r2, =0x02038436 - ldrb r0, [r2] - adds r0, r1 - ldrb r0, [r0] - strh r0, [r4, 0x32] - ldrb r0, [r2] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x34] - ldr r2, =0xfffffe00 - adds r1, r2, 0 - cmp r0, 0 - beq _08101BE4 - movs r0, 0x80 - lsls r0, 2 - adds r1, r0, 0 -_08101BE4: - strh r1, [r4, 0x36] - strh r5, [r4, 0x38] - ldrh r0, [r4, 0x32] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_80A7270 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_08101BFA: - ldrh r0, [r4, 0x36] - ldrh r1, [r4, 0x38] - adds r0, r1 - strh r0, [r4, 0x38] - ldrh r0, [r4, 0x32] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0x38] - adds r1, r2, 0 - bl obj_id_set_rotscale - ldrh r0, [r4, 0x32] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A73A0 - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _08101C8E - movs r0, 0 - strh r0, [r4, 0x30] - movs r2, 0x36 - ldrsh r0, [r4, r2] - negs r0, r0 - strh r0, [r4, 0x36] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _08101C8E - .pool -_08101C4C: - ldrh r0, [r4, 0x36] - ldrh r1, [r4, 0x38] - adds r0, r1 - strh r0, [r4, 0x38] - ldrh r0, [r4, 0x32] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0x38] - adds r1, r2, 0 - bl obj_id_set_rotscale - ldrh r0, [r4, 0x32] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A73A0 - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _08101C8E - ldrh r0, [r4, 0x32] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A7344 - adds r0, r4, 0 - bl move_anim_8072740 -_08101C8E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8101BA0 - - thumb_func_start sub_8101C94 -sub_8101C94: @ 8101C94 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r1 - ldr r1, =0x020241e4 - ldr r2, =0x02038436 - ldrb r0, [r2] - adds r0, r1 - ldrb r0, [r0] - movs r4, 0 - strh r0, [r5, 0x8] - ldrb r0, [r2] - bl battle_side_get_owner - lsls r0, 24 - lsrs r2, r0, 24 - strh r2, [r5, 0xA] - strh r4, [r5, 0xC] - ldr r0, =0x0203841e - movs r3, 0 - ldrsh r1, [r0, r3] - cmp r1, 0 - beq _08101CE8 - cmp r1, 0x1 - beq _08101D04 - adds r0, r6, 0 - bl move_anim_task_del - b _08101D22 - .pool -_08101CE8: - strh r1, [r5, 0xC] - movs r0, 0x8 - strh r0, [r5, 0xE] - strh r1, [r5, 0x10] - movs r0, 0x3 - strh r0, [r5, 0x12] - cmp r2, 0 - bne _08101CFC - negs r0, r0 - strh r0, [r5, 0x12] -_08101CFC: - ldr r0, =sub_8101D2C - b _08101D20 - .pool -_08101D04: - movs r0, 0x8 - strh r0, [r5, 0xE] - movs r0, 0xC0 - lsls r0, 3 - strh r0, [r5, 0x10] - movs r1, 0xC0 - strh r1, [r5, 0x12] - cmp r2, 0 - bne _08101D1E - negs r0, r0 - strh r0, [r5, 0x10] - negs r0, r1 - strh r0, [r5, 0x12] -_08101D1E: - ldr r0, =sub_8101EEC -_08101D20: - str r0, [r5] -_08101D22: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8101C94 - - thumb_func_start sub_8101D2C -sub_8101D2C: @ 8101D2C - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bls _08101D46 - b _08101EE6 -_08101D46: - lsls r0, 2 - ldr r1, =_08101D58 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08101D58: - .4byte _08101D6C - .4byte _08101D9E - .4byte _08101DF8 - .4byte _08101E70 - .4byte _08101EB4 -_08101D6C: - movs r2, 0xE - ldrsh r1, [r4, r2] - cmp r1, 0 - beq _08101D7C - ldrh r2, [r4, 0x12] - ldrh r3, [r4, 0x10] - adds r2, r3 - b _08101EC2 -_08101D7C: - movs r0, 0x8 - strh r0, [r4, 0xE] - strh r1, [r4, 0x10] - movs r1, 0xA - ldrsh r0, [r4, r1] - movs r1, 0xC0 - cmp r0, 0 - bne _08101D92 - movs r2, 0xC0 - negs r2, r2 - adds r1, r2, 0 -_08101D92: - strh r1, [r4, 0x12] - ldrb r0, [r4, 0x8] - movs r1, 0 - bl sub_80A7270 - b _08101EA8 -_08101D9E: - movs r3, 0xE - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _08101DC4 - ldrh r0, [r4, 0x12] - ldrh r1, [r4, 0x10] - adds r0, r1 - strh r0, [r4, 0x10] - ldrb r0, [r4, 0x8] - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0x10] - adds r1, r2, 0 - bl obj_id_set_rotscale - ldrb r0, [r4, 0x8] - bl sub_80A73A0 - b _08101ED4 -_08101DC4: - movs r0, 0x8 - strh r0, [r4, 0xE] - ldr r2, =0x02020630 - movs r3, 0x8 - ldrsh r1, [r4, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x24] - strh r0, [r4, 0x10] - movs r1, 0xA - ldrsh r0, [r4, r1] - movs r2, 0x2 - negs r2, r2 - adds r1, r2, 0 - cmp r0, 0 - bne _08101DEA - movs r1, 0x2 -_08101DEA: - strh r1, [r4, 0x12] - movs r0, 0x1 - strh r0, [r4, 0x14] - b _08101EA8 - .pool -_08101DF8: - ldrh r2, [r4, 0xE] - movs r3, 0xE - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _08101E54 - ldrh r1, [r4, 0x14] - movs r3, 0x14 - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _08101E12 - subs r0, r1, 0x1 - strh r0, [r4, 0x14] - b _08101EE6 -_08101E12: - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - beq _08101E34 - ldr r2, =0x02020630 - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r4, 0x12] - ldrh r2, [r4, 0x10] - adds r1, r2 - b _08101E48 - .pool -_08101E34: - ldr r2, =0x02020630 - movs r3, 0x8 - ldrsh r1, [r4, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r4, 0x10] - ldrh r2, [r4, 0x12] - subs r1, r2 -_08101E48: - strh r1, [r0, 0x24] - movs r0, 0x1 - strh r0, [r4, 0x14] - b _08101ED4 - .pool -_08101E54: - ldr r2, =0x02020630 - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r4, 0x10] - strh r1, [r0, 0x24] - movs r0, 0xC - strh r0, [r4, 0xE] - b _08101EA8 - .pool -_08101E70: - ldrh r1, [r4, 0xE] - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08101E80 - subs r0, r1, 0x1 - strh r0, [r4, 0xE] - b _08101EE6 -_08101E80: - movs r0, 0x3 - strh r0, [r4, 0xE] - ldr r2, =0x02020630 - movs r3, 0x8 - ldrsh r1, [r4, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x24] - strh r0, [r4, 0x10] - movs r1, 0xA - ldrsh r0, [r4, r1] - movs r2, 0x8 - negs r2, r2 - adds r1, r2, 0 - cmp r0, 0 - bne _08101EA6 - movs r1, 0x8 -_08101EA6: - strh r1, [r4, 0x12] -_08101EA8: - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - b _08101EE6 - .pool -_08101EB4: - movs r3, 0xE - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _08101EE0 - ldrh r2, [r4, 0x12] - ldrh r0, [r4, 0x10] - adds r2, r0 -_08101EC2: - strh r2, [r4, 0x10] - ldr r3, =0x02020630 - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r2, [r0, 0x24] -_08101ED4: - ldrh r0, [r4, 0xE] - subs r0, 0x1 - strh r0, [r4, 0xE] - b _08101EE6 - .pool -_08101EE0: - adds r0, r2, 0 - bl move_anim_task_del -_08101EE6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8101D2C - - thumb_func_start sub_8101EEC -sub_8101EEC: @ 8101EEC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0xE - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _08101F2C - ldrh r0, [r4, 0x10] - ldrh r1, [r4, 0x12] - subs r0, r1 - strh r0, [r4, 0x10] - ldrb r0, [r4, 0x8] - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0x10] - adds r1, r2, 0 - bl obj_id_set_rotscale - ldrb r0, [r4, 0x8] - bl sub_80A73A0 - ldrh r0, [r4, 0xE] - subs r0, 0x1 - strh r0, [r4, 0xE] - b _08101F38 - .pool -_08101F2C: - ldrb r0, [r4, 0x8] - bl sub_80A7344 - adds r0, r5, 0 - bl move_anim_task_del -_08101F38: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8101EEC - - thumb_func_start sub_8101F40 -sub_8101F40: @ 8101F40 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =0x0203841e - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _08101F5C - ldr r4, =0x02038436 - b _08101F5E - .pool -_08101F5C: - ldr r4, =0x02038437 -_08101F5E: - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x2] - adds r0, r1 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r6, [r6, 0x4] - adds r0, r6 - strh r0, [r5, 0x22] - movs r0, 0 - strh r0, [r5, 0x2E] - strh r0, [r5, 0x30] - ldr r1, =sub_810208C - adds r0, r5, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A67D8 - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8101F40 - - thumb_func_start sub_8101FA8 -sub_8101FA8: @ 8101FA8 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0000ffd0 - adds r0, r1 - strh r0, [r4, 0x20] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - ldr r1, =sub_8102044 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A67D8 - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8101FA8 - - thumb_func_start sub_8101FF0 -sub_8101FF0: @ 8101FF0 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0203841e - ldr r2, =0x0000ffd0 - adds r0, r2 - ldrh r1, [r1] - adds r0, r1 - movs r6, 0 - strh r0, [r4, 0x20] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnim - strh r6, [r4, 0x2E] - strh r6, [r4, 0x30] - ldr r0, =sub_810208C - str r0, [r4, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8101FF0 - - thumb_func_start sub_8102044 -sub_8102044: @ 8102044 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _0810206E - movs r0, 0xC - strh r0, [r4, 0x2E] - movs r0, 0x8 - strh r0, [r4, 0x30] - movs r0, 0 - strh r0, [r4, 0x32] - ldr r1, =sub_810207C - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A653C - str r0, [r4, 0x1C] -_0810206E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8102044 - - thumb_func_start sub_810207C -sub_810207C: @ 810207C - movs r1, 0 - strh r1, [r0, 0x2E] - strh r1, [r0, 0x30] - ldr r1, =sub_810208C - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_810207C - - thumb_func_start sub_810208C -sub_810208C: @ 810208C - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _081020D4 - movs r0, 0 - strh r0, [r3, 0x2E] - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - lsrs r1, r2, 2 - movs r0, 0x1 - eors r1, r0 - ands r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - ldrh r0, [r3, 0x30] - adds r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _081020D4 - adds r0, r3, 0 - bl move_anim_8072740 -_081020D4: - pop {r0} - bx r0 - thumb_func_end sub_810208C - - thumb_func_start sub_81020D8 -sub_81020D8: @ 81020D8 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =0x0203841e - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _081020F4 - ldr r4, =0x02038436 - b _081020F6 - .pool -_081020F4: - ldr r4, =0x02038437 -_081020F6: - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x2] - adds r0, r1 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r6, [r6, 0x4] - adds r0, r6 - strh r0, [r5, 0x22] - movs r0, 0 - strh r0, [r5, 0x2E] - ldr r0, =0x0203841e - ldrh r0, [r0, 0x6] - strh r0, [r5, 0x30] - ldr r0, =sub_810213C - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81020D8 - - thumb_func_start sub_810213C -sub_810213C: @ 810213C - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x30 - ldrsh r1, [r2, r3] - cmp r0, r1 - ble _0810215C - movs r0, 0 - strh r0, [r2, 0x2E] - ldrh r0, [r2, 0x22] - subs r0, 0x1 - strh r0, [r2, 0x22] -_0810215C: - ldrh r0, [r2, 0x22] - ldrh r1, [r2, 0x2E] - subs r0, r1 - strh r0, [r2, 0x22] - adds r0, r2, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08102178 - adds r0, r2, 0 - bl move_anim_8072740 -_08102178: - pop {r0} - bx r0 - thumb_func_end sub_810213C - - thumb_func_start sub_810217C -sub_810217C: @ 810217C - push {r4-r6,lr} - adds r4, r0, 0 - ldr r6, =0x02038436 - ldrb r0, [r6] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - strh r0, [r4, 0x20] - ldrb r0, [r6] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - subs r0, 0xC - strh r0, [r4, 0x22] - strh r5, [r4, 0x2E] - movs r0, 0x2 - strh r0, [r4, 0x30] - strh r5, [r4, 0x32] - strh r5, [r4, 0x34] - strh r5, [r4, 0x36] - subs r0, 0x42 - bl sub_80A5178 - lsls r0, 24 - asrs r0, 24 - strh r0, [r4, 0x38] - ldr r0, =sub_81021CC - str r0, [r4, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810217C - - thumb_func_start sub_81021CC -sub_81021CC: @ 81021CC - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x30 - ldrsh r1, [r4, r2] - cmp r0, r1 - blt _08102238 - adds r3, r4, 0 - adds r3, 0x3E - ldrb r2, [r3] - lsrs r1, r2, 2 - movs r0, 0x1 - eors r1, r0 - ands r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - movs r1, 0x4 - ands r0, r1 - cmp r0, 0 - bne _0810221E - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0810221E - ldrh r1, [r4, 0x38] - lsls r1, 24 - asrs r1, 24 - movs r0, 0xC2 - bl audio_play_and_stuff -_0810221E: - movs r1, 0 - strh r1, [r4, 0x2E] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _08102238 - strh r1, [r4, 0x32] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] -_08102238: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08102262 - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0x10 - ble _08102262 - adds r0, r4, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08102262 - adds r0, r4, 0 - bl move_anim_8072740 -_08102262: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81021CC - - thumb_func_start sub_8102268 -sub_8102268: @ 8102268 - push {r4-r6,lr} - adds r6, r0, 0 - movs r1, 0x2E - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _081022B2 - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - ldr r5, =0x0203841e - lsrs r0, 24 - ldrh r1, [r5] - adds r0, r1 - strh r0, [r6, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r5, [r5, 0x2] - adds r0, r5 - strh r0, [r6, 0x22] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _081022AC - ldrh r0, [r6, 0x22] - adds r0, 0xA - strh r0, [r6, 0x22] -_081022AC: - ldrh r0, [r6, 0x2E] - adds r0, 0x1 - strh r0, [r6, 0x2E] -_081022B2: - ldr r0, =0x0203841e - ldrh r1, [r0, 0xE] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _081022C2 - adds r0, r6, 0 - bl move_anim_8072740 -_081022C2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8102268 - - thumb_func_start sub_81022D4 -sub_81022D4: @ 81022D4 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _08102300 - ldr r1, =0x0203841e - ldr r0, =0x0000ffff - strh r0, [r1, 0xE] - b _0810233E - .pool -_08102300: - cmp r0, 0x2 - bne _0810230C - adds r0, r2, 0 - bl move_anim_task_del - b _08102344 -_0810230C: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _08102344 - movs r0, 0 - strh r0, [r4, 0x8] - ldrh r2, [r4, 0xA] - adds r2, 0x1 - strh r2, [r4, 0xA] - lsls r1, r2, 8 - movs r0, 0x10 - subs r0, r2 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x10 - bne _08102344 -_0810233E: - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] -_08102344: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81022D4 - - thumb_func_start sub_810234C -sub_810234C: @ 810234C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - bl sub_80A6980 - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - ldr r0, =0x0203841e - ldrh r0, [r0, 0x4] - strh r0, [r4, 0x2E] - ldr r0, =sub_810237C - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810234C - - thumb_func_start sub_810237C -sub_810237C: @ 810237C - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r1, [r5, 0x2E] - movs r2, 0x2E - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _08102390 - subs r0, r1, 0x1 - strh r0, [r5, 0x2E] - b _081023CC -_08102390: - adds r2, r5, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - movs r0, 0x1E - strh r0, [r5, 0x2E] - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x32] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r5, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r5, 0 - bl oamt_set_x3A_32 -_081023CC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810237C - - thumb_func_start sub_81023E0 -sub_81023E0: @ 81023E0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _08102428 - movs r0, 0 - strh r0, [r4, 0x8] - ldrh r1, [r4, 0xA] - adds r1, 0x1 - strh r1, [r4, 0xA] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x10 - bne _08102428 - adds r0, r5, 0 - bl move_anim_task_del -_08102428: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81023E0 - - thumb_func_start sub_8102434 -sub_8102434: @ 8102434 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - movs r4, 0 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - bcs _08102490 - ldr r6, =0x0203841e - ldr r5, =0x03005d70 -_08102448: - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0x1 - bne _08102464 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08102464 - adds r0, r4, r5 - ldrb r0, [r0] - bl sub_8072984 -_08102464: - movs r1, 0x2 - ldrsh r0, [r6, r1] - cmp r0, 0x1 - bne _08102482 - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08102482 - adds r0, r4, r5 - ldrb r0, [r0] - bl sub_8072984 -_08102482: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - bcc _08102448 -_08102490: - adds r0, r7, 0 - bl move_anim_task_del - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8102434 - - thumb_func_start sub_81024A8 -sub_81024A8: @ 81024A8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - b _081024C2 -_081024B2: - ldr r0, =0x03005d70 - adds r0, r4, r0 - ldrb r0, [r0] - bl sub_80729D0 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_081024C2: - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - bcc _081024B2 - adds r0, r5, 0 - bl move_anim_task_del - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81024A8 - - thumb_func_start sub_81024E0 -sub_81024E0: @ 81024E0 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _081024F6 - movs r0, 0x30 - strh r0, [r4, 0x20] - movs r0, 0x28 - b _081024FE -_081024F6: - ldr r0, =0x0203841e - ldrh r1, [r0] - strh r1, [r4, 0x20] - ldrh r0, [r0, 0x2] -_081024FE: - strh r0, [r4, 0x22] - ldrb r1, [r4, 0x1] - movs r0, 0x3F - ands r0, r1 - strb r0, [r4, 0x1] - ldrb r0, [r4, 0x3] - movs r1, 0xC0 - orrs r0, r1 - strb r0, [r4, 0x3] - movs r0, 0 - strh r0, [r4, 0x2E] - ldr r0, =sub_8102528 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81024E0 - - thumb_func_start sub_8102528 -sub_8102528: @ 8102528 - push {lr} - adds r1, r0, 0 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _0810253A - adds r0, r1, 0 - bl move_anim_8072740 -_0810253A: - pop {r0} - bx r0 - thumb_func_end sub_8102528 - - thumb_func_start sub_8102540 -sub_8102540: @ 8102540 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02038436 - ldrb r0, [r0] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - ldr r2, =0x0203841e - lsrs r0, 24 - ldrh r1, [r2] - adds r0, r1 - movs r1, 0 - strh r0, [r4, 0x20] - ldrh r0, [r2, 0x2] - strh r0, [r4, 0x22] - strh r1, [r4, 0x2E] - strh r1, [r4, 0x30] - strh r1, [r4, 0x32] - strh r1, [r4, 0x34] - movs r0, 0x1 - strh r0, [r4, 0x36] - ldr r0, =sub_8102584 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8102540 - - thumb_func_start sub_8102584 -sub_8102584: @ 8102584 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x30] - adds r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _081025AE - movs r0, 0 - strh r0, [r1, 0x30] - ldrh r2, [r1, 0x32] - movs r3, 0x32 - ldrsh r0, [r1, r3] - cmp r0, 0x77 - bgt _081025AE - ldrh r0, [r1, 0x22] - adds r0, 0x1 - strh r0, [r1, 0x22] - adds r0, r2, 0x1 - strh r0, [r1, 0x32] -_081025AE: - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _081025BC - adds r0, r1, 0 - bl move_anim_8072740 -_081025BC: - pop {r0} - bx r0 - thumb_func_end sub_8102584 - - thumb_func_start sub_81025C0 -sub_81025C0: @ 81025C0 - 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 - movs r4, 0 - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_80A75AC - mov r8, r0 - ldr r0, =0x0000ffff - mov r1, r8 - ands r1, r0 - mov r8, r1 - ldr r0, =0x03005e00 - mov r9, r0 - lsls r5, r7, 2 - adds r5, r7 - lsls r5, 3 - adds r6, r5, r0 - strh r4, [r6, 0x8] - strh r4, [r6, 0xA] - strh r4, [r6, 0xC] - strh r1, [r6, 0xE] - strh r4, [r6, 0x10] - strh r4, [r6, 0x12] - strh r4, [r6, 0x14] - movs r0, 0xD - strh r0, [r6, 0x16] - movs r0, 0xE - strh r0, [r6, 0x18] - movs r0, 0xF - strh r0, [r6, 0x1A] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x1 - movs r3, 0x1 - bl sub_80A76C4 - mov r10, r0 - mov r1, r8 - orrs r1, r0 - mov r8, r1 - movs r0, 0x8 - add r9, r0 - add r5, r9 - adds r0, r5, 0 - adds r0, 0x1C - adds r5, 0x1E - adds r1, r5, 0 - mov r2, r8 - bl sub_80A8048 - ldr r0, =0x000027d2 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - movs r4, 0x80 - lsls r4, 9 - adds r1, r4, 0 - lsls r1, r0 - mov r0, r10 - orrs r0, r1 - mov r10, r0 - ldr r0, =0x000027d3 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0 - mov r1, r10 - orrs r4, r1 - ldr r0, =0x00007fbb - str r0, [sp] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =sub_81026A8 - str r1, [r6] - adds r0, r7, 0 - bl _call_via_r1 - 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_81025C0 - - thumb_func_start sub_81026A8 -sub_81026A8: @ 81026A8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _08102794 - cmp r1, 0x1 - bgt _081026D4 - cmp r1, 0 - beq _081026E2 - b _08102832 - .pool -_081026D4: - cmp r1, 0x2 - bne _081026DA - b _081027EC -_081026DA: - cmp r1, 0x3 - bne _081026E0 - b _08102820 -_081026E0: - b _08102832 -_081026E2: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - cmp r0, 0 - bgt _081026F0 - b _08102832 -_081026F0: - strh r1, [r4, 0xA] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - bgt _0810273C - ldrh r0, [r4, 0x16] - ldrh r1, [r4, 0x10] - adds r0, r1 - strh r0, [r4, 0x10] - ldrh r2, [r4, 0x18] - ldrh r3, [r4, 0x12] - adds r2, r3 - strh r2, [r4, 0x12] - ldrh r1, [r4, 0x1A] - ldrh r5, [r4, 0x14] - adds r1, r5 - strh r1, [r4, 0x14] - lsls r0, 16 - asrs r0, 19 - lsls r0, 16 - lsrs r0, 16 - lsls r2, 16 - asrs r2, 19 - lsls r2, 16 - lsls r1, 16 - asrs r1, 19 - lsls r1, 16 - lsrs r2, 11 - orrs r0, r2 - lsrs r1, 6 - orrs r0, r1 - lsls r0, 16 - lsrs r0, 16 - mov r12, r0 - b _08102746 -_0810273C: - ldr r7, =0x00007fbb - mov r12, r7 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_08102746: - movs r2, 0x1 - movs r3, 0 - movs r1, 0 -_0810274C: - movs r5, 0xE - ldrsh r0, [r4, r5] - ands r0, r2 - lsls r5, r2, 17 - adds r6, r3, 0 - adds r6, 0x10 - adds r1, 0x1 - mov r8, r1 - cmp r0, 0 - beq _08102778 - movs r1, 0x1 - ldr r2, =0x02037b14 -_08102764: - adds r0, r3, r1 - lsls r0, 1 - adds r0, r2 - mov r7, r12 - strh r7, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0xF - bls _08102764 -_08102778: - lsrs r2, r5, 16 - lsls r0, r6, 16 - lsrs r3, r0, 16 - mov r1, r8 - lsls r0, r1, 16 - lsrs r1, r0, 16 - cmp r1, 0xF - bls _0810274C - b _08102832 - .pool -_08102794: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08102832 - movs r2, 0 - ldr r3, =0x02020630 - movs r5, 0x14 - adds r5, r3 - mov r12, r5 - ldr r7, =gUnknown_08592EBC - mov r8, r7 - ldr r6, =gUnknown_08592EEC - movs r5, 0x1 -_081027B2: - lsls r0, r2, 4 - adds r0, r2 - lsls r1, r0, 2 - mov r7, r12 - adds r0, r1, r7 - ldr r0, [r0] - cmp r0, r8 - beq _081027C6 - cmp r0, r6 - bne _081027CA -_081027C6: - adds r0, r1, r3 - strh r5, [r0, 0x2E] -_081027CA: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3F - bls _081027B2 - movs r0, 0 - strh r0, [r4, 0xA] - b _08102814 - .pool -_081027EC: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1E - ble _08102832 - movs r1, 0x24 - ldrsh r0, [r4, r1] - movs r2, 0x26 - ldrsh r1, [r4, r2] - bl sub_80A8050 - ldr r1, =0x00007fbb - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe -_08102814: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _08102832 - .pool -_08102820: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08102832 - adds r0, r2, 0 - bl move_anim_task_del -_08102832: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81026A8 - - thumb_func_start sub_8102844 -sub_8102844: @ 8102844 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =0x0203841e - movs r1, 0x4 - ldrsh r0, [r6, r1] - cmp r0, 0x1 - bgt _08102856 - movs r0, 0x2 - strh r0, [r6, 0x4] -_08102856: - movs r1, 0x4 - ldrsh r0, [r6, r1] - cmp r0, 0x7F - ble _08102862 - movs r0, 0x7F - strh r0, [r6, 0x4] -_08102862: - movs r0, 0 - strh r0, [r5, 0x2E] - ldrh r0, [r6, 0x4] - strh r0, [r5, 0x30] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6] - adds r0, r1 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r6, [r6, 0x2] - adds r0, r6 - strh r0, [r5, 0x22] - ldrh r1, [r5, 0x20] - strh r1, [r5, 0x3A] - strh r0, [r5, 0x3C] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _081028D4 - ldrb r1, [r5, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r5, 0x3] - ldrh r0, [r5, 0x20] - adds r0, 0x28 - strh r0, [r5, 0x20] - ldrh r4, [r5, 0x22] - adds r4, 0x14 - strh r4, [r5, 0x22] - lsls r0, 7 - strh r0, [r5, 0x32] - movs r0, 0x30 - ldrsh r1, [r5, r0] - ldr r0, =0xffffec00 - b _081028FA - .pool -_081028D4: - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0810291C - ldrh r0, [r5, 0x20] - subs r0, 0x28 - strh r0, [r5, 0x20] - ldrh r4, [r5, 0x22] - adds r4, 0x14 - strh r4, [r5, 0x22] - lsls r0, 7 - strh r0, [r5, 0x32] - movs r0, 0x30 - ldrsh r1, [r5, r0] - movs r0, 0xA0 - lsls r0, 5 -_081028FA: - bl __divsi3 - strh r0, [r5, 0x34] - lsls r4, 7 - strh r4, [r5, 0x36] - movs r0, 0x30 - ldrsh r1, [r5, r0] - ldr r0, =0xfffff600 - bl __divsi3 - strh r0, [r5, 0x38] - b _08102958 - .pool -_0810291C: - ldrh r0, [r5, 0x20] - adds r0, 0x28 - strh r0, [r5, 0x20] - ldrh r4, [r5, 0x22] - subs r4, 0x14 - strh r4, [r5, 0x22] - lsls r0, 7 - strh r0, [r5, 0x32] - movs r0, 0x30 - ldrsh r1, [r5, r0] - ldr r0, =0xffffec00 - bl __divsi3 - strh r0, [r5, 0x34] - lsls r4, 7 - strh r4, [r5, 0x36] - movs r0, 0x30 - ldrsh r1, [r5, r0] - movs r0, 0xA0 - lsls r0, 4 - bl __divsi3 - strh r0, [r5, 0x38] - ldrb r1, [r5, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - movs r1, 0x30 - orrs r0, r1 - strb r0, [r5, 0x3] -_08102958: - ldr r0, =sub_810296C - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8102844 - - thumb_func_start sub_810296C -sub_810296C: @ 810296C - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x34] - ldrh r1, [r2, 0x32] - adds r0, r1 - strh r0, [r2, 0x32] - ldrh r1, [r2, 0x38] - ldrh r3, [r2, 0x36] - adds r1, r3 - strh r1, [r2, 0x36] - lsls r0, 16 - asrs r0, 23 - strh r0, [r2, 0x20] - lsls r1, 16 - asrs r1, 23 - strh r1, [r2, 0x22] - ldrh r0, [r2, 0x30] - subs r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _081029A2 - ldrh r0, [r2, 0x3A] - strh r0, [r2, 0x20] - ldrh r0, [r2, 0x3C] - strh r0, [r2, 0x22] -_081029A2: - movs r1, 0x30 - ldrsh r0, [r2, r1] - cmp r0, 0 - bne _081029B0 - adds r0, r2, 0 - bl move_anim_8072740 -_081029B0: - pop {r0} - bx r0 - thumb_func_end sub_810296C - - thumb_func_start sub_81029B4 -sub_81029B4: @ 81029B4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r6, r0, r1 - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x8] - ldr r0, =0x00002771 - bl AllocObjectPalette - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0xA] - movs r1, 0xA - ldrsh r0, [r6, r1] - lsls r0, 20 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r3, r0, 16 - ldr r2, =0x02020630 - movs r0, 0x8 - ldrsh r1, [r6, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - adds r0, 0x10 - lsls r4, r0, 4 - movs r5, 0x1 - ldr r2, =0x02037714 -_08102A0C: - adds r1, r3, r5 - lsls r1, 1 - adds r1, r2 - adds r0, r4, r5 - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0xF - bls _08102A0C - adds r0, r3, 0 - movs r1, 0x10 - movs r2, 0xB - movs r3, 0 - bl pal_fade_1 - movs r0, 0 - strh r0, [r6, 0xE] - movs r5, 0 - ldr r7, =0x02020630 - movs r1, 0x1C - adds r1, r7 - mov r9, r1 - b _08102A88 - .pool -_08102A54: - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r4, r2, r7 - ldrb r1, [r6, 0xA] - lsls r1, 4 - ldrb r3, [r4, 0x5] - movs r0, 0xF - ands r0, r3 - orrs r0, r1 - strb r0, [r4, 0x5] - movs r0, 0 - strh r0, [r4, 0x2E] - lsls r0, r5, 7 - strh r0, [r4, 0x30] - mov r0, r8 - strh r0, [r4, 0x32] - add r2, r9 - ldr r0, =sub_8102B3C - str r0, [r2] - ldrh r0, [r6, 0xE] - adds r0, 0x1 - strh r0, [r6, 0xE] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_08102A88: - cmp r5, 0x1 - bhi _08102A9A - movs r0, 0 - bl duplicate_obj_of_side_rel2move_in_transparent_mode - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08102A54 -_08102A9A: - ldr r0, =sub_8102AE0 - str r0, [r6] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08102AC8 - movs r1, 0x80 - lsls r1, 2 - movs r0, 0 - bl ClearGpuRegBits - b _08102AD2 - .pool -_08102AC8: - movs r1, 0x80 - lsls r1, 3 - movs r0, 0 - bl ClearGpuRegBits -_08102AD2: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81029B4 - - thumb_func_start sub_8102AE0 -sub_8102AE0: @ 8102AE0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r0, r1 - movs r1, 0xE - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08102B32 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08102B1C - movs r1, 0x80 - lsls r1, 2 - movs r0, 0 - bl SetGpuRegBits - b _08102B26 - .pool -_08102B1C: - movs r1, 0x80 - lsls r1, 3 - movs r0, 0 - bl SetGpuRegBits -_08102B26: - ldr r0, =0x00002771 - bl FreeObjectPaletteByTag - adds r0, r4, 0 - bl move_anim_task_del -_08102B32: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8102AE0 - - thumb_func_start sub_8102B3C -sub_8102B3C: @ 8102B3C - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0x34] - adds r0, 0x1 - strh r0, [r5, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _08102B58 - movs r0, 0 - strh r0, [r5, 0x34] - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] -_08102B58: - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0x40 - ble _08102B80 - ldr r2, =0x03005e00 - movs r0, 0x32 - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r0, 0xE] - subs r1, 0x1 - strh r1, [r0, 0xE] - adds r0, r5, 0 - bl obj_delete_but_dont_free_vram - b _08102BC2 - .pool -_08102B80: - ldr r4, =gUnknown_08329F40 - movs r1, 0x2E - ldrsh r0, [r5, r1] - lsls r0, 1 - adds r0, r4 - movs r2, 0 - ldrsh r0, [r0, r2] - movs r1, 0x6 - bl __divsi3 - strh r0, [r5, 0x36] - movs r1, 0x2E - ldrsh r0, [r5, r1] - lsls r0, 1 - adds r0, r4 - movs r2, 0 - ldrsh r0, [r0, r2] - movs r1, 0xD - bl __divsi3 - strh r0, [r5, 0x38] - ldrh r1, [r5, 0x30] - adds r1, r0 - movs r0, 0xFF - ands r1, r0 - strh r1, [r5, 0x30] - movs r1, 0x30 - ldrsh r0, [r5, r1] - movs r2, 0x36 - ldrsh r1, [r5, r2] - bl sine - strh r0, [r5, 0x24] -_08102BC2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8102B3C - - thumb_func_start sub_8102BCC -sub_8102BCC: @ 8102BCC - push {r4,lr} - adds r4, r0, 0 - ldr r1, =move_anim_8072740 - bl oamt_set_x3A_32 - ldr r0, =sub_80A67D8 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8102BCC - - thumb_func_start sub_8102BE8 -sub_8102BE8: @ 8102BE8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r4, =gUnknown_08593020 - ldrh r0, [r4] - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0xFF - beq _08102C2C - lsls r0, r3, 20 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r3, r0, 16 - movs r2, 0x1 - ldr r5, =0x02037b14 -_08102C14: - adds r1, r3, r2 - lsls r1, 1 - adds r1, r5 - lsls r0, r2, 1 - adds r0, r4 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x5 - bls _08102C14 -_08102C2C: - movs r4, 0x1 - ldr r0, =gUnknown_08593020 - mov r8, r0 -_08102C32: - lsls r0, r4, 1 - adds r0, r4 - lsls r5, r0, 2 - mov r1, r8 - adds r0, r5, r1 - ldrh r0, [r0] - bl AllocObjectPalette - lsls r0, 24 - lsrs r3, r0, 24 - adds r4, 0x1 - mov r12, r4 - cmp r3, 0xFF - beq _08102C7A - lsls r0, r3, 20 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r3, r0, 16 - movs r2, 0x1 - ldr r7, =0x02037b14 - ldr r6, =gUnknown_08593020 - adds r4, r5, 0 -_08102C60: - adds r1, r3, r2 - lsls r1, 1 - adds r1, r7 - lsls r0, r2, 1 - adds r0, r4 - adds r0, r6 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x5 - bls _08102C60 -_08102C7A: - mov r1, r12 - lsls r0, r1, 16 - lsrs r4, r0, 16 - cmp r4, 0x3 - bls _08102C32 - mov r0, r9 - bl move_anim_task_del - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8102BE8 - - thumb_func_start sub_8102CA0 -sub_8102CA0: @ 8102CA0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0x1 - ldr r6, =gUnknown_08593020 -_08102CAA: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r6 - ldrh r0, [r0] - bl FreeObjectPaletteByTag - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x3 - bls _08102CAA - adds r0, r5, 0 - bl move_anim_task_del - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8102CA0 - - thumb_func_start sub_8102CD4 -sub_8102CD4: @ 8102CD4 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - bl sub_80A6838 - ldr r4, =0x0203841e - ldrb r1, [r4] - adds r0, r5, 0 - bl StartObjectImageAnim - ldr r2, =gUnknown_08593020 - movs r0, 0x2 - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0] - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _08102D10 - lsls r2, r0, 4 - ldrb r1, [r5, 0x5] - movs r0, 0xF - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0x5] -_08102D10: - ldrh r0, [r4, 0x2] - movs r1, 0 - strh r0, [r5, 0x30] - strh r1, [r5, 0x32] - ldrh r0, [r4, 0x4] - strh r0, [r5, 0x34] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _08102D34 - movs r6, 0x30 - movs r3, 0x28 - b _08102D4E - .pool -_08102D34: - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r3, r0, 24 -_08102D4E: - ldrh r0, [r5, 0x20] - lsls r1, r0, 4 - strh r1, [r5, 0x36] - ldrh r1, [r5, 0x22] - lsls r2, r1, 4 - strh r2, [r5, 0x38] - subs r0, r6, r0 - lsls r0, 16 - asrs r0, 16 - subs r1, r3, r1 - lsls r1, 16 - asrs r1, 16 - adds r2, r5, 0 - adds r2, 0x3A - adds r3, r5, 0 - adds r3, 0x3C - movs r4, 0x28 - str r4, [sp] - bl sub_8102D8C - ldr r0, =sub_8102DE4 - str r0, [r5, 0x1C] - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8102CD4 - - thumb_func_start sub_8102D8C -sub_8102D8C: @ 8102D8C - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r2, 0 - mov r8, r3 - ldr r2, [sp, 0x18] - lsls r1, 16 - lsrs r6, r1, 16 - lsls r2, 24 - lsrs r1, r2, 24 - lsls r0, 16 - asrs r2, r0, 16 - cmp r2, 0 - bge _08102DAE - lsls r0, r1, 24 - negs r0, r0 - lsrs r1, r0, 24 -_08102DAE: - lsls r5, r2, 8 - lsls r1, 24 - asrs r1, 24 - adds r0, r5, 0 - bl __divsi3 - adds r4, r0, 0 - cmp r4, 0 - bne _08102DC2 - movs r4, 0x1 -_08102DC2: - adds r0, r5, 0 - adds r1, r4, 0 - bl __divsi3 - strh r0, [r7] - lsls r0, r6, 16 - asrs r0, 8 - adds r1, r4, 0 - bl __divsi3 - mov r1, r8 - strh r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8102D8C - - thumb_func_start sub_8102DE4 -sub_8102DE4: @ 8102DE4 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - movs r5, 0 - strh r0, [r4, 0x2E] - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r1, r0, r1 - adds r0, r1, 0 - cmp r1, 0 - bge _08102E00 - adds r0, 0xFF -_08102E00: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - ldrh r1, [r4, 0x3A] - ldrh r2, [r4, 0x36] - adds r1, r2 - strh r1, [r4, 0x36] - ldrh r2, [r4, 0x3C] - ldrh r3, [r4, 0x38] - adds r2, r3 - strh r2, [r4, 0x38] - lsls r1, 16 - asrs r1, 20 - strh r1, [r4, 0x20] - lsls r2, 16 - asrs r2, 20 - strh r2, [r4, 0x22] - lsls r0, 16 - asrs r0, 16 - movs r1, 0xF - bl sine - strh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - ldrh r0, [r4, 0x20] - adds r0, 0x10 - lsls r0, 16 - movs r1, 0x88 - lsls r1, 17 - cmp r0, r1 - bhi _08102E4E - lsls r0, r2, 16 - asrs r1, r0, 16 - movs r0, 0x10 - negs r0, r0 - cmp r1, r0 - blt _08102E4E - cmp r1, 0x80 - ble _08102E56 -_08102E4E: - adds r0, r4, 0 - bl move_anim_8074EE0 - b _08102EA6 -_08102E56: - movs r0, 0x34 - ldrsh r1, [r4, r0] - cmp r1, 0 - beq _08102EA6 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, r1 - ble _08102EA6 - strh r5, [r4, 0x32] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _08102E7E - strh r5, [r4, 0x30] -_08102E7E: - ldr r2, =gUnknown_08593020 - movs r3, 0x30 - ldrsh r1, [r4, r3] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0] - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _08102EA6 - lsls r2, r0, 4 - ldrb r1, [r4, 0x5] - movs r0, 0xF - ands r0, r1 - orrs r0, r2 - strb r0, [r4, 0x5] -_08102EA6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8102DE4 - - thumb_func_start sub_8102EB0 -sub_8102EB0: @ 8102EB0 - push {r4-r7,lr} - adds r6, r0, 0 - ldr r7, =0x02038436 - ldrb r0, [r7] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08102ECE - ldr r1, =0x0203841e - movs r2, 0x2 - ldrsh r0, [r1, r2] - negs r0, r0 - strh r0, [r1, 0x2] -_08102ECE: - ldrb r0, [r7] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - ldr r4, =0x0203841e - lsrs r0, 24 - ldrh r1, [r4, 0x2] - adds r0, r1 - movs r5, 0 - strh r0, [r6, 0x20] - ldrb r0, [r7] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r2, [r4, 0x4] - adds r0, r2 - strh r0, [r6, 0x22] - ldrb r1, [r4] - adds r0, r6, 0 - bl StartObjectImageAnim - strh r5, [r6, 0x32] - strh r5, [r6, 0x34] - ldrh r0, [r6, 0x20] - lsls r0, 4 - strh r0, [r6, 0x36] - ldrh r0, [r6, 0x22] - lsls r0, 4 - strh r0, [r6, 0x38] - movs r1, 0x2 - ldrsh r0, [r4, r1] - lsls r0, 4 - movs r1, 0x5 - bl __divsi3 - strh r0, [r6, 0x3A] - movs r2, 0x4 - ldrsh r0, [r4, r2] - lsls r0, 7 - movs r1, 0x5 - bl __divsi3 - strh r0, [r6, 0x3C] - ldr r0, =sub_8102F40 - str r0, [r6, 0x1C] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8102EB0 - - thumb_func_start sub_8102F40 -sub_8102F40: @ 8102F40 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x3A] - ldrh r1, [r4, 0x36] - adds r0, r1 - strh r0, [r4, 0x36] - ldrh r1, [r4, 0x3C] - ldrh r2, [r4, 0x38] - adds r1, r2 - strh r1, [r4, 0x38] - lsls r0, 16 - asrs r0, 20 - strh r0, [r4, 0x20] - lsls r1, 16 - asrs r1, 20 - strh r1, [r4, 0x22] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x5 - ble _08102F9E - movs r2, 0x34 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _08102F9E - ldrh r0, [r4, 0x32] - adds r0, 0x10 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x32] - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r1, 0x12 - bl cosine - strh r0, [r4, 0x24] - movs r2, 0x32 - ldrsh r0, [r4, r2] - movs r1, 0x12 - bl sine - strh r0, [r4, 0x26] - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08102F9E - movs r0, 0x1 - strh r0, [r4, 0x34] -_08102F9E: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x30 - bne _08102FB2 - adds r0, r4, 0 - bl move_anim_8074EE0 -_08102FB2: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8102F40 - - thumb_func_start sub_8102FB8 -sub_8102FB8: @ 8102FB8 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x1 - bne _08102FDC - ldrb r0, [r5, 0x3] - movs r1, 0x3F - negs r1, r1 - ands r1, r0 - movs r0, 0x10 - orrs r1, r0 - strb r1, [r5, 0x3] - movs r6, 0x10 - b _08102FDE - .pool -_08102FDC: - ldr r6, =0x0000fff0 -_08102FDE: - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, r6 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x8 - strh r0, [r5, 0x22] - movs r0, 0x8 - strh r0, [r5, 0x2E] - ldr r0, =sub_80A64B0 - str r0, [r5, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r5, 0 - bl oamt_set_x3A_32 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8102FB8 - - thumb_func_start sub_8103028 -sub_8103028: @ 8103028 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_80A6838 - ldrh r0, [r4, 0x22] - adds r0, 0x8 - strh r0, [r4, 0x22] - ldr r5, =0x0203841e - ldrb r1, [r5, 0x2] - adds r0, r4, 0 - bl StartObjectImageAnim - ldr r2, =gUnknown_08593020 - movs r0, 0x4 - ldrsh r1, [r5, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0] - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _08103068 - lsls r2, r0, 4 - ldrb r1, [r4, 0x5] - movs r0, 0xF - ands r0, r1 - orrs r0, r2 - strb r0, [r4, 0x5] -_08103068: - movs r1, 0 - ldrsh r0, [r5, r1] - movs r2, 0x20 - cmp r0, 0 - bne _08103074 - ldr r2, =0x0000ffe0 -_08103074: - movs r0, 0x28 - strh r0, [r4, 0x2E] - ldrh r1, [r4, 0x20] - strh r1, [r4, 0x30] - lsls r0, r2, 16 - asrs r0, 16 - adds r0, r1 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x34] - subs r0, 0x28 - strh r0, [r4, 0x36] - adds r0, r4, 0 - bl obj_translate_based_on_private_1_2_3_4 - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x38] - ldr r0, =sub_81030B0 - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103028 - - thumb_func_start sub_81030B0 -sub_81030B0: @ 81030B0 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - bne _08103100 - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r1, 0x8 - bl sine - lsls r0, 16 - lsrs r1, r0, 16 - ldrh r2, [r4, 0x24] - movs r3, 0x24 - ldrsh r0, [r4, r3] - cmp r0, 0 - bge _081030DC - lsls r0, r1, 16 - negs r0, r0 - lsrs r1, r0, 16 -_081030DC: - lsls r0, r1, 16 - asrs r0, 16 - adds r0, r2 - strh r0, [r4, 0x24] - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r1, 0x4 - bl sine - ldrh r3, [r4, 0x26] - adds r0, r3 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x38] - adds r0, 0x8 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x38] - b _08103106 -_08103100: - adds r0, r4, 0 - bl move_anim_8072740 -_08103106: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81030B0 - - thumb_func_start sub_810310C -sub_810310C: @ 810310C - push {r4-r6,lr} - adds r6, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0810312C - adds r0, r5, 0 - movs r1, 0x5 - bl sub_80A861C - adds r0, 0x8 - b _08103136 -_0810312C: - adds r0, r5, 0 - movs r1, 0x4 - bl sub_80A861C - subs r0, 0x8 -_08103136: - strh r0, [r6, 0x20] - adds r0, r5, 0 - movs r1, 0x3 - bl sub_80A5C6C - adds r4, r0, 0 - adds r0, r5, 0 - movs r1, 0 - bl sub_80A861C - lsls r4, 24 - lsrs r4, 24 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08103158 - adds r0, 0x3 -_08103158: - asrs r0, 2 - subs r0, r4, r0 - strh r0, [r6, 0x22] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_810310C - - thumb_func_start sub_8103164 -sub_8103164: @ 8103164 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08103180 - ldr r0, =0x02038436 - b _08103182 - .pool -_08103180: - ldr r0, =0x02038437 -_08103182: - ldrb r4, [r0] - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_810310C - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - negs r1, r0 - orrs r1, r0 - lsrs r1, 31 - ldr r0, =0x0203841e - ldrh r0, [r0, 0x2] - strh r0, [r5, 0x2E] - adds r0, r1, 0x2 - strh r0, [r5, 0x30] - adds r0, r5, 0 - bl StartObjectImageAnim - ldr r1, =sub_81031D0 - adds r0, r5, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A67D8 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103164 - - thumb_func_start sub_81031D0 -sub_81031D0: @ 81031D0 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - cmp r0, 0 - bne _081031F8 - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldrh r1, [r4, 0x30] - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - ldr r0, =sub_80A67D8 - str r0, [r4, 0x1C] -_081031F8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81031D0 - - thumb_func_start sub_8103208 -sub_8103208: @ 8103208 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08103224 - ldr r0, =0x02038436 - b _08103226 - .pool -_08103224: - ldr r0, =0x02038437 -_08103226: - ldrb r0, [r0] - adds r1, r4, 0 - bl sub_810310C - movs r0, 0 - strh r0, [r4, 0x2E] - ldr r1, =sub_8103250 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A67BC - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103208 - - thumb_func_start sub_8103250 -sub_8103250: @ 8103250 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - ble _08103276 - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - ldr r1, =move_anim_8074EE0 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A67BC - str r0, [r4, 0x1C] -_08103276: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103250 - - thumb_func_start sub_8103284 -sub_8103284: @ 8103284 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _081032A0 - ldr r0, =0x02038436 - b _081032A2 - .pool -_081032A0: - ldr r0, =0x02038437 -_081032A2: - ldrb r5, [r0] - adds r0, r5, 0 - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - movs r6, 0 - strh r0, [r4, 0x20] - adds r0, r5, 0 - movs r1, 0x2 - bl sub_80A861C - strh r0, [r4, 0x22] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - bgt _081032CA - movs r0, 0xA - strh r0, [r4, 0x22] -_081032CA: - movs r0, 0x1 - strh r0, [r4, 0x2E] - strh r6, [r4, 0x30] - adds r1, r4, 0 - adds r1, 0x43 - ldrb r0, [r1] - strh r0, [r4, 0x32] - ldrb r0, [r1] - adds r0, 0x4 - strh r0, [r4, 0x34] - strh r6, [r4, 0x36] - ldr r1, =sub_8103300 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A67BC - str r0, [r4, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103284 - - thumb_func_start sub_8103300 -sub_8103300: @ 8103300 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x36] - adds r0, 0x1 - strh r0, [r1, 0x36] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - ble _08103316 - ldr r0, =sub_8103320 - str r0, [r1, 0x1C] -_08103316: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103300 - - thumb_func_start sub_8103320 -sub_8103320: @ 8103320 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x30] - adds r1, r0, 0x4 - strh r1, [r2, 0x30] - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xFE - ble _08103352 - ldrh r0, [r2, 0x2E] - subs r0, 0x1 - strh r0, [r2, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bne _0810334C - strh r0, [r2, 0x24] - ldr r0, =sub_8103250 - str r0, [r2, 0x1C] - b _08103388 - .pool -_0810334C: - movs r0, 0xFF - ands r1, r0 - strh r1, [r2, 0x30] -_08103352: - movs r1, 0x30 - ldrsh r0, [r2, r1] - cmp r0, 0x4F - ble _08103362 - ldrh r0, [r2, 0x34] - adds r1, r2, 0 - adds r1, 0x43 - strb r0, [r1] -_08103362: - movs r3, 0x30 - ldrsh r0, [r2, r3] - cmp r0, 0x9F - ble _08103372 - ldrh r0, [r2, 0x32] - adds r1, r2, 0 - adds r1, 0x43 - strb r0, [r1] -_08103372: - ldr r1, =gUnknown_08329F40 - movs r3, 0x30 - ldrsh r0, [r2, r3] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 19 - asrs r1, r0, 1 - adds r0, r1 - strh r0, [r2, 0x24] -_08103388: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103320 - - thumb_func_start sub_8103390 -sub_8103390: @ 8103390 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _081033AC - ldr r0, =0x02038436 - b _081033AE - .pool -_081033AC: - ldr r0, =0x02038437 -_081033AE: - ldrb r4, [r0] - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_810310C - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _081033D4 - adds r0, r5, 0 - movs r1, 0 - bl StartObjectImageAnim - movs r0, 0x2 - b _081033DE - .pool -_081033D4: - adds r0, r5, 0 - movs r1, 0x1 - bl StartObjectImageAnim - movs r0, 0x3 -_081033DE: - strh r0, [r5, 0x2E] - ldr r0, =sub_81033F0 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103390 - - thumb_func_start sub_81033F0 -sub_81033F0: @ 81033F0 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - ble _0810341E - movs r0, 0 - strh r0, [r4, 0x30] - ldrh r1, [r4, 0x2E] - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - ldr r1, =sub_810342C - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A67D8 - str r0, [r4, 0x1C] -_0810341E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81033F0 - - thumb_func_start sub_810342C -sub_810342C: @ 810342C - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x30] - adds r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - ble _08103444 - adds r0, r1, 0 - bl move_anim_8072740 -_08103444: - pop {r0} - bx r0 - thumb_func_end sub_810342C - - thumb_func_start sub_8103448 -sub_8103448: @ 8103448 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_80A6838 - ldr r5, =0x0203841e - movs r0, 0 - ldrsh r1, [r5, r0] - adds r0, r4, 0 - bl sub_80A6864 - ldrh r0, [r5, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldrh r0, [r5, 0x4] - strh r0, [r4, 0x30] - ldrh r0, [r5, 0x8] - strh r0, [r4, 0x32] - ldrh r0, [r5, 0xA] - strh r0, [r4, 0x34] - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x36] - ldr r1, =move_anim_8074EE0 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r1, =sub_80A6450 - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103448 - - thumb_func_start sub_8103498 -sub_8103498: @ 8103498 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _081034B4 - ldr r0, =0x02038436 - b _081034B6 - .pool -_081034B4: - ldr r0, =0x02038437 -_081034B6: - ldrb r0, [r0] - adds r1, r4, 0 - bl sub_810310C - movs r0, 0 - strh r0, [r4, 0x2E] - strh r0, [r4, 0x30] - ldr r0, =sub_81034D8 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103498 - - thumb_func_start sub_81034D8 -sub_81034D8: @ 81034D8 - push {lr} - adds r1, r0, 0 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0x1 - beq _0810350A - cmp r0, 0x1 - bgt _081034EE - cmp r0, 0 - beq _081034F4 - b _08103538 -_081034EE: - cmp r0, 0x2 - beq _08103524 - b _08103538 -_081034F4: - ldrh r0, [r1, 0x26] - subs r0, 0x3 - strh r0, [r1, 0x26] - ldrh r0, [r1, 0x30] - adds r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bne _08103538 - b _0810351C -_0810350A: - ldrh r0, [r1, 0x26] - adds r0, 0x3 - strh r0, [r1, 0x26] - ldrh r0, [r1, 0x30] - subs r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - cmp r0, 0 - bne _08103538 -_0810351C: - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - b _08103538 -_08103524: - ldrh r0, [r1, 0x30] - adds r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x40 - bne _08103538 - adds r0, r1, 0 - bl move_anim_8072740 -_08103538: - pop {r0} - bx r0 - thumb_func_end sub_81034D8 - - thumb_func_start sub_810353C -sub_810353C: @ 810353C - push {r4,lr} - adds r4, r0, 0 - ldr r3, =0x02020630 - movs r0, 0x32 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r4, 0x30] - ldrh r2, [r0, 0x24] - adds r1, r2 - strh r1, [r0, 0x24] - movs r1, 0x30 - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0x30] - movs r0, 0x2E - ldrsh r2, [r4, r0] - cmp r2, 0 - bne _0810357A - movs r0, 0x32 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r2, [r0, 0x24] - adds r0, r4, 0 - bl move_anim_8074EE0 -_0810357A: - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - strh r0, [r4, 0x2E] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810353C - - thumb_func_start sub_810358C -sub_810358C: @ 810358C - push {r4-r6,lr} - adds r5, r0, 0 - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r1, =0x020241e4 - ldr r0, =0x02038437 - ldrb r0, [r0] - adds r0, r1 - ldrb r6, [r0] - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _081035E4 - ldr r0, =0x0203841e - ldrh r1, [r5, 0x20] - ldrh r2, [r0] - subs r1, r2 - strh r1, [r5, 0x20] - adds r1, r0, 0 - b _081035EE - .pool -_081035E4: - ldr r1, =0x0203841e - ldrh r0, [r1] - ldrh r2, [r5, 0x20] - adds r0, r2 - strh r0, [r5, 0x20] -_081035EE: - ldrh r0, [r1, 0x2] - ldrh r2, [r5, 0x22] - adds r0, r2 - strh r0, [r5, 0x22] - ldrh r0, [r1, 0x4] - strh r0, [r5, 0x2E] - ldrh r0, [r1, 0x6] - strh r0, [r5, 0x30] - strh r6, [r5, 0x32] - ldr r0, =sub_810353C - str r0, [r5, 0x1C] - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810358C - - thumb_func_start sub_8103620 -sub_8103620: @ 8103620 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x2E] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x38] - ldr r0, =sub_80A64B0 - str r0, [r4, 0x1C] - ldr r1, =sub_8103658 - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103620 - - thumb_func_start sub_8103658 -sub_8103658: @ 8103658 - push {lr} - ldrh r1, [r0, 0x30] - strh r1, [r0, 0x2E] - ldrh r1, [r0, 0x20] - strh r1, [r0, 0x32] - ldrh r1, [r0, 0x22] - adds r1, 0xF - strh r1, [r0, 0x36] - ldr r1, =sub_80A6EEC - str r1, [r0, 0x1C] - ldr r1, =sub_8103680 - bl oamt_set_x3A_32 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103658 - - thumb_func_start sub_8103680 -sub_8103680: @ 8103680 - push {lr} - adds r1, r0, 0 - ldrh r2, [r1, 0x38] - movs r3, 0x38 - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _08103696 - adds r0, r1, 0 - bl move_anim_8072740 - b _0810369A -_08103696: - subs r0, r2, 0x1 - strh r0, [r1, 0x38] -_0810369A: - pop {r0} - bx r0 - thumb_func_end sub_8103680 - - thumb_func_start sub_81036A0 -sub_81036A0: @ 81036A0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =0x020241e4 - ldr r0, =0x02038436 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - movs r1, 0 - bl sub_80A7270 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81036DC - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81036A0 - - thumb_func_start sub_81036DC -sub_81036DC: @ 81036DC - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x020241e4 - ldr r0, =0x02038436 - ldrb r0, [r0] - adds r1, r0, r1 - ldrb r4, [r1] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08103718 - ldr r1, =0x03005e00 - lsls r2, r5, 2 - adds r0, r2, r5 - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x8] - negs r0, r0 - lsls r0, 16 - lsrs r3, r0, 16 - adds r6, r2, 0 - b _08103726 - .pool -_08103718: - ldr r2, =0x03005e00 - lsls r1, r5, 2 - adds r0, r1, r5 - lsls r0, 3 - adds r0, r2 - ldrh r3, [r0, 0x8] - adds r6, r1, 0 -_08103726: - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - bl obj_id_set_rotscale - ldr r1, =0x03005e00 - adds r0, r6, r5 - lsls r0, 3 - adds r1, r0, r1 - movs r2, 0xA - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _08103760 - ldrh r0, [r1, 0x8] - adds r0, 0xB0 - strh r0, [r1, 0x8] - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0, 0x26] - adds r1, 0x1 - b _0810378A - .pool -_08103760: - cmp r0, 0x1 - bne _08103776 - ldrh r0, [r1, 0xE] - adds r0, 0x1 - strh r0, [r1, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1E - bne _081037D0 - movs r0, 0x2 - b _081037CE -_08103776: - ldrh r0, [r1, 0x8] - subs r0, 0xB0 - strh r0, [r1, 0x8] - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0, 0x26] - subs r1, 0x1 -_0810378A: - strh r1, [r0, 0x26] - adds r0, r4, 0 - bl sub_80A73A0 - ldr r0, =0x03005e00 - adds r1, r6, r5 - lsls r1, 3 - adds r1, r0 - movs r3, 0x8 - ldrsh r2, [r1, r3] - movs r0, 0xF2 - lsls r0, 4 - cmp r2, r0 - beq _081037AA - cmp r2, 0 - bne _081037D0 -_081037AA: - ldrh r2, [r1, 0xA] - movs r3, 0xA - ldrsh r0, [r1, r3] - cmp r0, 0x2 - bne _081037CC - adds r0, r4, 0 - bl sub_80A7344 - adds r0, r5, 0 - bl move_anim_task_del - b _081037D0 - .pool -_081037CC: - adds r0, r2, 0x1 -_081037CE: - strh r0, [r1, 0xA] -_081037D0: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81036DC - - thumb_func_start sub_81037D8 -sub_81037D8: @ 81037D8 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_80A6838 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08103804 - ldr r0, =0x0203841e - ldrh r1, [r4, 0x20] - ldrh r2, [r0] - subs r1, r2 - strh r1, [r4, 0x20] - adds r5, r0, 0 - b _08103810 - .pool -_08103804: - ldr r1, =0x0203841e - ldrh r0, [r1] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - adds r5, r1, 0 -_08103810: - ldrh r0, [r5, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810384C - adds r3, r4, 0 - adds r3, 0x3F - ldrb r0, [r3] - movs r1, 0x1 - adds r2, r0, 0 - orrs r2, r1 - strb r2, [r3] - movs r1, 0x4 - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08103860 - movs r0, 0x2 - orrs r2, r0 - strb r2, [r3] - b _08103860 - .pool -_0810384C: - movs r2, 0x4 - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _08103860 - adds r2, r4, 0 - adds r2, 0x3F - ldrb r0, [r2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] -_08103860: - ldr r0, =sub_80A67D8 - str r0, [r4, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81037D8 - - thumb_func_start sub_810387C -sub_810387C: @ 810387C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - bl sub_80A69CC - ldr r0, =sub_80A67BC - str r0, [r4, 0x1C] - ldr r1, =sub_81038A0 - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810387C - - thumb_func_start sub_81038A0 -sub_81038A0: @ 81038A0 - push {lr} - movs r1, 0x6 - strh r1, [r0, 0x2E] - ldrh r1, [r0, 0x20] - strh r1, [r0, 0x32] - ldrh r1, [r0, 0x22] - subs r1, 0x20 - strh r1, [r0, 0x36] - ldr r1, =sub_80A6EEC - str r1, [r0, 0x1C] - ldr r1, =move_anim_8072740 - bl oamt_set_x3A_32 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81038A0 - - thumb_func_start sub_81038C8 -sub_81038C8: @ 81038C8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r5, r0, 0 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _081038EC - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] - b _0810390E - .pool -_081038EC: - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810390E - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] - ldrh r0, [r1, 0x2] - negs r0, r0 - strh r0, [r1, 0x2] - ldrh r0, [r1, 0x6] - negs r0, r0 - strh r0, [r1, 0x6] -_0810390E: - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - ldr r6, =0x0203841e - lsrs r0, 24 - ldrh r1, [r6, 0x4] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r2, [r6, 0x6] - adds r0, r2 - lsls r0, 16 - lsrs r0, 16 - adds r7, r0, 0 - ldrh r1, [r5, 0x20] - mov r2, r8 - lsls r0, r2, 16 - asrs r0, 16 - subs r0, r1 - lsls r0, 16 - asrs r0, 16 - ldrh r2, [r5, 0x22] - lsls r1, r7, 16 - asrs r1, 16 - subs r1, r2 - lsls r1, 16 - asrs r1, 16 - bl sub_80A74F4 - lsls r0, 16 - movs r1, 0xF0 - lsls r1, 24 - adds r0, r1 - lsrs r4, r0, 16 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _08103980 - ldr r2, =0xffffa000 - adds r0, r4, r2 - lsls r0, 16 - lsrs r4, r0, 16 -_08103980: - movs r3, 0x80 - lsls r3, 1 - str r4, [sp] - adds r0, r5, 0 - movs r1, 0 - adds r2, r3, 0 - bl sub_80A73E0 - ldrh r0, [r6, 0x8] - strh r0, [r5, 0x2E] - mov r0, r8 - strh r0, [r5, 0x32] - strh r7, [r5, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r5, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r5, 0 - bl oamt_set_x3A_32 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81038C8 - - thumb_func_start sub_81039CC -sub_81039CC: @ 81039CC - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x2E] - subs r1, r0, 0x1 - strh r1, [r3, 0x2E] - lsls r0, 16 - cmp r0, 0 - bgt _081039F6 - ldr r2, =0x03005e00 - movs r0, 0x3C - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r0, 0xA] - subs r1, 0x1 - strh r1, [r0, 0xA] - adds r0, r3, 0 - bl RemoveObjectAndFreeTiles -_081039F6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81039CC - - thumb_func_start sub_8103A00 -sub_8103A00: @ 8103A00 - push {r4,lr} - adds r2, r0, 0 - movs r0, 0x3C - ldrsh r1, [r2, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r3, 0x2E - ldrsh r1, [r2, r3] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - ble _08103A34 - ldrh r0, [r2, 0x34] - ldrh r1, [r2, 0x38] - adds r0, r1 - strh r0, [r2, 0x38] - ldrh r0, [r2, 0x36] - ldrh r3, [r2, 0x3A] - adds r0, r3 - b _08103A42 - .pool -_08103A34: - ldrh r0, [r2, 0x38] - ldrh r1, [r2, 0x34] - subs r0, r1 - strh r0, [r2, 0x38] - ldrh r0, [r2, 0x3A] - ldrh r1, [r2, 0x36] - subs r0, r1 -_08103A42: - strh r0, [r2, 0x3A] - ldrh r0, [r2, 0x38] - ldrh r1, [r2, 0x30] - adds r3, r0, r1 - strh r3, [r2, 0x30] - ldrh r0, [r2, 0x3A] - ldrh r1, [r2, 0x32] - adds r0, r1 - strh r0, [r2, 0x32] - ldrh r1, [r4, 0x16] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08103A66 - lsls r0, r3, 16 - lsrs r0, 24 - negs r0, r0 - b _08103A6A -_08103A66: - lsls r0, r3, 16 - lsrs r0, 24 -_08103A6A: - strh r0, [r2, 0x24] - ldrh r1, [r4, 0x18] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08103A7E - ldrh r0, [r2, 0x32] - lsrs r0, 8 - negs r0, r0 - b _08103A82 -_08103A7E: - ldrh r0, [r2, 0x32] - lsrs r0, 8 -_08103A82: - strh r0, [r2, 0x26] - ldrh r0, [r2, 0x2E] - subs r1, r0, 0x1 - strh r1, [r2, 0x2E] - lsls r0, 16 - cmp r0, 0 - bgt _08103A98 - movs r0, 0x1E - strh r0, [r2, 0x2E] - ldr r0, =sub_81039CC - str r0, [r2, 0x1C] -_08103A98: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103A00 - - thumb_func_start sub_8103AA4 -sub_8103AA4: @ 8103AA4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r0, 0 - movs r0, 0x3C - ldrsh r1, [r7, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r6, r0, r1 - ldrh r2, [r6, 0x16] - movs r1, 0x2 - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - ldrh r3, [r7, 0x30] - adds r2, r0, r3 - strh r2, [r7, 0x30] - ldrh r0, [r6, 0x18] - ands r1, r0 - ldrh r0, [r7, 0x32] - adds r1, r0 - strh r1, [r7, 0x32] - ldrh r1, [r6, 0x16] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08103AEC - lsls r0, r2, 16 - lsrs r0, 24 - negs r0, r0 - b _08103AF0 - .pool -_08103AEC: - lsls r0, r2, 16 - lsrs r0, 24 -_08103AF0: - strh r0, [r7, 0x24] - ldrh r1, [r6, 0x18] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08103B04 - ldrh r0, [r7, 0x32] - lsrs r0, 8 - negs r0, r0 - b _08103B08 -_08103B04: - ldrh r0, [r7, 0x32] - lsrs r0, 8 -_08103B08: - strh r0, [r7, 0x26] - ldrh r0, [r7, 0x2E] - subs r1, r0, 0x1 - strh r1, [r7, 0x2E] - lsls r0, 16 - cmp r0, 0 - bgt _08103BD4 - movs r4, 0 - movs r0, 0x8 - strh r0, [r7, 0x2E] - movs r0, 0x4 - strh r0, [r6, 0x12] - movs r0, 0x80 - lsls r0, 5 - bl sub_8151624 - lsls r0, 16 - lsrs r5, r0, 16 - ldrh r0, [r7, 0x24] - ldrh r1, [r7, 0x20] - adds r2, r0, r1 - strh r2, [r7, 0x20] - ldrh r0, [r7, 0x26] - ldrh r3, [r7, 0x22] - adds r0, r3 - strh r0, [r7, 0x22] - strh r4, [r7, 0x26] - strh r4, [r7, 0x24] - ldrh r3, [r6, 0x1E] - movs r0, 0x1E - ldrsh r1, [r6, r0] - lsls r0, r2, 16 - asrs r0, 16 - cmp r1, r0 - blt _08103B52 - subs r0, r3, r2 - b _08103B54 -_08103B52: - subs r0, r2, r3 -_08103B54: - lsls r0, 24 - lsrs r4, r0, 16 - ldrh r3, [r6, 0x20] - movs r0, 0x20 - ldrsh r1, [r6, r0] - ldrh r2, [r7, 0x22] - movs r6, 0x22 - ldrsh r0, [r7, r6] - cmp r1, r0 - blt _08103B6C - subs r0, r3, r2 - b _08103B6E -_08103B6C: - subs r0, r2, r3 -_08103B6E: - lsls r0, 24 - lsrs r0, 16 - mov r8, r0 - movs r0, 0 - strh r0, [r7, 0x32] - strh r0, [r7, 0x30] - strh r0, [r7, 0x3A] - strh r0, [r7, 0x38] - lsls r0, r4, 16 - asrs r0, 16 - lsls r5, 16 - asrs r5, 16 - adds r1, r5, 0 - bl sub_8151534 - adds r4, r0, 0 - lsls r4, 16 - asrs r4, 16 - movs r6, 0xE0 - lsls r6, 1 - adds r0, r6, 0 - bl sub_8151624 - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl sub_8151534 - strh r0, [r7, 0x34] - mov r1, r8 - lsls r0, r1, 16 - asrs r0, 16 - adds r1, r5, 0 - bl sub_8151534 - adds r4, r0, 0 - lsls r4, 16 - asrs r4, 16 - adds r0, r6, 0 - bl sub_8151624 - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl sub_8151534 - strh r0, [r7, 0x36] - ldr r0, =sub_8103A00 - str r0, [r7, 0x1C] -_08103BD4: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103AA4 - - thumb_func_start sub_8103BE4 -sub_8103BE4: @ 8103BE4 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r1, 0xA - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08103C02 - adds r0, r2, 0 - bl move_anim_task_del -_08103C02: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103BE4 - - thumb_func_start sub_8103C0C -sub_8103C0C: @ 8103C0C - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r5, r0, r1 - ldrh r0, [r5, 0x8] - subs r1, r0, 0x1 - strh r1, [r5, 0x8] - lsls r0, 16 - cmp r0, 0 - bgt _08103CE0 - ldr r0, =gUnknown_085933B0 - movs r2, 0x1A - ldrsh r1, [r5, r2] - movs r3, 0x1C - ldrsh r2, [r5, r3] - ldrb r3, [r5, 0xC] - ldrb r4, [r5, 0xA] - subs r3, r4 - lsls r3, 24 - lsrs r3, 24 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - mov r12, r0 - lsls r0, 4 - add r0, r12 - lsls r0, 2 - ldr r1, =0x02020630 - adds r6, r0, r1 - movs r1, 0x10 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _08103C6C - cmp r0, 0x2 - beq _08103C82 - b _08103C90 - .pool -_08103C6C: - ldrb r2, [r6, 0x3] - lsls r1, r2, 26 - lsrs r1, 27 - movs r0, 0x18 - orrs r1, r0 - lsls r1, 1 - subs r0, 0x57 - ands r0, r2 - orrs r0, r1 - strb r0, [r6, 0x3] - b _08103C90 -_08103C82: - ldrb r0, [r6, 0x3] - movs r1, 0x3F - negs r1, r1 - ands r1, r0 - movs r0, 0x10 - orrs r1, r0 - strb r1, [r6, 0x3] -_08103C90: - ldr r3, =0x03005e00 - lsls r2, r7, 2 - adds r2, r7 - lsls r2, 3 - adds r4, r2, r3 - ldrh r0, [r4, 0x12] - ldrh r1, [r4, 0x14] - subs r0, r1 - strh r0, [r6, 0x2E] - strh r7, [r6, 0x3C] - movs r1, 0xA - ldrsh r0, [r4, r1] - adds r0, 0xD - lsls r0, 1 - adds r0, r2 - adds r3, 0x8 - adds r0, r3 - mov r2, r12 - strh r2, [r0] - ldrh r0, [r4, 0xE] - strh r0, [r4, 0x8] - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - movs r0, 0x3F - negs r0, r0 - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0x9A - bl audio_play_and_stuff - movs r3, 0xA - ldrsh r0, [r4, r3] - cmp r0, 0x2 - ble _08103CE0 - ldr r0, =sub_8103BE4 - str r0, [r4] -_08103CE0: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103C0C - - thumb_func_start sub_8103CF0 -sub_8103CF0: @ 8103CF0 - 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 - movs r0, 0 - mov r9, r0 - movs r5, 0 - mov r0, sp - mov r1, r9 - strh r1, [r0] - mov r4, sp - adds r4, 0x2 - strh r1, [r4] - bl sub_80A4DF0 - lsls r0, 24 - mov r10, r4 - cmp r0, 0 - beq _08103D5C - ldr r1, =0x03005e00 - lsls r2, r7, 2 - adds r0, r2, r7 - lsls r0, 3 - adds r0, r1 - movs r1, 0x2 - strh r1, [r0, 0x10] - ldr r3, =0x0203841e - ldrh r0, [r3] - negs r0, r0 - strh r0, [r3] - ldrh r1, [r3, 0x4] - movs r0, 0x1 - ands r0, r1 - mov r8, r2 - cmp r0, 0 - beq _08103D54 - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strh r0, [r3, 0x4] - b _08103DB6 - .pool -_08103D54: - movs r0, 0x1 - orrs r0, r1 - strh r0, [r3, 0x4] - b _08103DB6 -_08103D5C: - ldr r1, =0x02024076 - ldr r0, =0x02038437 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - movs r3, 0x1 - adds r0, r3, 0 - ands r0, r1 - lsls r2, r7, 2 - mov r8, r2 - cmp r0, 0 - bne _08103DB6 - ldr r1, =0x03005e00 - adds r0, r2, r7 - lsls r0, 3 - adds r0, r1 - strh r3, [r0, 0x10] - ldr r2, =0x0203841e - ldrh r0, [r2] - negs r0, r0 - strh r0, [r2] - ldrh r0, [r2, 0x2] - negs r0, r0 - strh r0, [r2, 0x2] - ldrh r1, [r2, 0x4] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _08103DB0 - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - b _08103DB4 - .pool -_08103DB0: - movs r0, 0x1 - orrs r0, r1 -_08103DB4: - strh r0, [r2, 0x4] -_08103DB6: - ldr r5, =0x02038436 - ldrb r0, [r5] - movs r1, 0 - bl sub_80A5C6C - ldr r1, =0x03005e00 - mov r3, r8 - adds r4, r3, r7 - lsls r4, 3 - adds r4, r1 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x1A] - adds r6, r0, 0 - ldrb r0, [r5] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x1C] - mov r9, r0 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08103E20 - ldr r4, =0x02038437 - ldrb r1, [r4] - movs r0, 0x2 - eors r0, r1 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _08103E20 - ldrb r0, [r4] - movs r1, 0 - mov r2, sp - mov r3, r10 - bl sub_80A8924 - b _08103E42 - .pool -_08103E20: - mov r5, sp - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - mov r1, r10 - strh r0, [r1] -_08103E42: - mov r4, sp - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - mov r2, sp - ldr r3, =0x0203841e - ldrh r0, [r3] - ldrh r2, [r2] - adds r0, r2 - strh r0, [r1, 0x1E] - strh r0, [r4] - ldrh r0, [r3, 0x2] - mov r3, r10 - ldrh r3, [r3] - adds r0, r3 - strh r0, [r1, 0x20] - mov r1, r10 - strh r0, [r1] - mov r0, sp - ldrh r2, [r0] - movs r3, 0 - ldrsh r0, [r0, r3] - adds r1, r6, 0 - cmp r0, r1 - blt _08103E88 - subs r0, r2, r1 - b _08103E8A - .pool -_08103E88: - subs r0, r1, r2 -_08103E8A: - lsls r0, 16 - lsrs r0, 16 - lsls r4, r0, 16 - asrs r4, 16 - ldr r5, =0x0203841e - ldrh r1, [r5, 0x4] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - lsls r0, 16 - asrs r0, 16 - bl sub_8151624 - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl sub_8151534 - ldr r2, =0x03005e00 - mov r3, r8 - adds r1, r3, r7 - lsls r1, 3 - adds r6, r1, r2 - strh r0, [r6, 0x12] - movs r1, 0x12 - ldrsh r0, [r6, r1] - movs r1, 0x80 - bl sub_8151534 - strh r0, [r6, 0x14] - ldrh r0, [r5, 0x4] - strh r0, [r6, 0x16] - mov r2, r10 - ldrh r1, [r2] - movs r3, 0 - ldrsh r0, [r2, r3] - mov r4, r9 - cmp r0, r4 - blt _08103F08 - subs r4, r1, r4 - lsls r4, 16 - asrs r4, 16 - movs r1, 0x12 - ldrsh r0, [r6, r1] - bl sub_8151624 - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl sub_8151534 - movs r1, 0x2 - negs r1, r1 - ands r1, r0 - strh r1, [r6, 0x18] - b _08103F28 - .pool -_08103F08: - subs r4, r1 - lsls r4, 16 - asrs r4, 16 - movs r2, 0x12 - ldrsh r0, [r6, r2] - bl sub_8151624 - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl sub_8151534 - movs r1, 0x1 - orrs r0, r1 - strh r0, [r6, 0x18] -_08103F28: - ldr r1, =0x03005e00 - mov r3, r8 - adds r0, r3, r7 - lsls r0, 3 - adds r5, r0, r1 - ldr r4, =0x0203841e - ldrh r0, [r4, 0x6] - strh r0, [r5, 0xE] - ldrh r1, [r4, 0x8] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08103F78 - movs r0, 0x80 - eors r0, r1 - strh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3F - ble _08103FA0 - ldr r0, =0x02038437 - ldrb r0, [r0] - bl sub_80A82E4 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x0000ffc0 - adds r1, r2, 0 - ldrh r4, [r4, 0x8] - adds r1, r4 - adds r0, r1 - b _08103FB0 - .pool -_08103F78: - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x3F - ble _08103FA0 - ldr r0, =0x02038437 - ldrb r0, [r0] - bl sub_80A82E4 - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x0000ffc0 - adds r1, r3, 0 - ldrh r4, [r4, 0x8] - adds r1, r4 - adds r0, r1 - b _08103FB0 - .pool -_08103FA0: - ldr r0, =0x02038437 - ldrb r0, [r0] - bl sub_80A82E4 - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x8] - subs r0, r1 -_08103FB0: - strh r0, [r5, 0xC] - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - movs r3, 0xC - ldrsh r0, [r1, r3] - cmp r0, 0x2 - bgt _08103FC8 - movs r0, 0x3 - strh r0, [r1, 0xC] -_08103FC8: - ldr r0, =sub_8103C0C - str r0, [r1] - 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_8103CF0 - - thumb_func_start sub_8103FE8 -sub_8103FE8: @ 8103FE8 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - bl sub_80A69CC - ldr r0, =gUnknown_085934A0 - ldrh r0, [r0, 0x2] - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 20 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - strh r0, [r4, 0x2E] - ldr r0, =sub_8104018 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103FE8 - - thumb_func_start sub_8104018 -sub_8104018: @ 8104018 - push {r4-r7,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _0810407C - movs r0, 0 - strh r0, [r4, 0x30] - ldrh r5, [r4, 0x2E] - ldr r1, =0x02037b14 - adds r0, r5, 0 - adds r0, 0x8 - lsls r0, 1 - adds r0, r1 - ldrh r7, [r0] - adds r6, r1, 0 - adds r1, r5, 0 - adds r1, 0x9 - lsls r0, r5, 1 - adds r0, r6 - adds r2, r0, 0 - adds r2, 0x10 - movs r3, 0x7 - lsls r1, 1 - adds r1, r6 -_08104050: - ldrh r0, [r1] - strh r0, [r2] - adds r1, 0x2 - adds r2, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _08104050 - adds r0, r5, 0 - adds r0, 0xF - lsls r0, 1 - adds r0, r6 - strh r7, [r0] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x18 - bne _0810407C - adds r0, r4, 0 - bl move_anim_8072740 -_0810407C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104018 - - thumb_func_start sub_8104088 -sub_8104088: @ 8104088 - push {r4-r7,lr} - sub sp, 0x4 - adds r5, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - ldr r4, =0x0203841e - lsrs r0, 24 - ldrh r1, [r4, 0x6] - adds r0, r1 - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _081040CC - ldrh r0, [r4, 0x4] - negs r0, r0 - strh r0, [r4, 0x4] -_081040CC: - lsls r0, r6, 16 - asrs r0, 16 - ldrh r1, [r4, 0x4] - adds r0, r1 - lsls r0, 16 - ldrh r1, [r5, 0x20] - lsrs r6, r0, 16 - asrs r0, 16 - subs r0, r1 - lsls r0, 16 - asrs r0, 16 - ldrh r2, [r5, 0x22] - lsls r1, r7, 16 - asrs r1, 16 - subs r1, r2 - lsls r1, 16 - asrs r1, 16 - bl sub_80A74F4 - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 24 - adds r0, r1 - lsrs r0, 16 - movs r3, 0x80 - lsls r3, 1 - str r0, [sp] - adds r0, r5, 0 - movs r1, 0 - adds r2, r3, 0 - bl sub_80A73E0 - ldrh r0, [r4, 0x8] - strh r0, [r5, 0x2E] - strh r6, [r5, 0x32] - strh r7, [r5, 0x36] - ldr r0, =sub_80A7000 - str r0, [r5, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r5, 0 - bl oamt_set_x3A_32 - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104088 - - thumb_func_start sub_810413C -sub_810413C: @ 810413C - ldr r1, =0x0000fff0 - strh r1, [r0, 0x32] - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - ldr r1, =sub_8104154 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_810413C - - thumb_func_start sub_8104154 -sub_8104154: @ 8104154 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x80 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08104178 - ldrh r0, [r4, 0x24] - negs r0, r0 - strh r0, [r4, 0x24] -_08104178: - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r2, 0x32 - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x5 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7E - ble _081041B8 - movs r0, 0 - strh r0, [r4, 0x30] - movs r1, 0x32 - ldrsh r0, [r4, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _081041B8 - adds r0, r4, 0 - bl move_anim_8072740 -_081041B8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104154 - - thumb_func_start sub_81041C4 -sub_81041C4: @ 81041C4 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - movs r0, 0x14 - strh r0, [r4, 0x2E] - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r4, 0x1C] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r1, =sub_810421C - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81041C4 - - thumb_func_start sub_810421C -sub_810421C: @ 810421C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x3F - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xA6 - bl audio_play_and_stuff - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - movs r1, 0 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - strh r1, [r4, 0x26] - strh r1, [r4, 0x24] - movs r2, 0 - movs r1, 0x7 - adds r0, r4, 0 - adds r0, 0x3C -_08104250: - strh r2, [r0] - subs r0, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _08104250 - bl GenerateRandomNumber2 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x7 - ands r0, r1 - ldr r2, =0x0000fff4 - adds r1, r2, 0 - subs r1, r0 - strh r1, [r4, 0x3A] - bl GenerateRandomNumber2 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA0 - bl __umodsi3 - adds r0, 0xA0 - strh r0, [r4, 0x3C] - ldr r0, =sub_81042A0 - str r0, [r4, 0x1C] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810421C - - thumb_func_start sub_81042A0 -sub_81042A0: @ 81042A0 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x3C] - ldrh r2, [r4, 0x2E] - adds r0, r1, r2 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r2, r0, 24 - strh r2, [r4, 0x24] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081042BE - negs r0, r2 - strh r0, [r4, 0x24] -_081042BE: - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r2, 0x3A - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x8 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7E - ble _081042FE - movs r0, 0 - strh r0, [r4, 0x30] - movs r1, 0x32 - ldrsh r0, [r4, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _081042FE - adds r0, r4, 0 - bl move_anim_8072740 -_081042FE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81042A0 - - thumb_func_start sub_8104304 -sub_8104304: @ 8104304 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - bl sub_80A69CC - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08104322 - ldrh r0, [r4, 0x22] - adds r0, 0x10 - strh r0, [r4, 0x22] -_08104322: - ldr r1, =0x0203841e - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x2E] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0xA] - strh r0, [r4, 0x32] - ldrh r0, [r1, 0xC] - strh r0, [r4, 0x34] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x36] - ldr r0, =sub_80A62EC - str r0, [r4, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104304 - - thumb_func_start sub_8104364 -sub_8104364: @ 8104364 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - movs r7, 0x20 - ldr r4, =0x0000ffe0 - movs r0, 0x10 - mov r8, r0 - ldr r6, =0x0000fff0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08104390 - adds r7, r4, 0 - movs r4, 0x20 - mov r8, r6 - movs r6, 0x10 - adds r0, r5, 0 - movs r1, 0x1 - bl StartObjectImageAnim -_08104390: - lsls r0, r7, 16 - asrs r0, 16 - ldrh r1, [r5, 0x20] - adds r0, r1 - strh r0, [r5, 0x20] - lsls r0, r4, 16 - asrs r0, 16 - ldrh r1, [r5, 0x22] - adds r0, r1 - strh r0, [r5, 0x22] - movs r0, 0x6 - strh r0, [r5, 0x2E] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - add r0, r8 - strh r0, [r5, 0x32] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, r6 - strh r0, [r5, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r5, 0x1C] - ldr r1, =sub_81043F8 - adds r0, r5, 0 - bl oamt_set_x3A_32 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104364 - - thumb_func_start sub_81043F8 -sub_81043F8: @ 81043F8 - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0810440E - adds r0, r2, 0 - bl move_anim_8072740 -_0810440E: - pop {r0} - bx r0 - thumb_func_end sub_81043F8 - - thumb_func_start sub_8104414 -sub_8104414: @ 8104414 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r5, r0, 0 - movs r0, 0x20 - mov r8, r0 - ldr r4, =0x0000ffe0 - movs r2, 0x10 - mov r9, r2 - ldr r6, =0x0000fff0 - ldr r7, =0x0203841e - ldrh r1, [r7] - movs r2, 0 - ldrsh r0, [r7, r2] - cmp r0, 0 - beq _08104448 - mov r8, r4 - movs r4, 0x20 - mov r9, r6 - movs r6, 0x10 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl StartObjectImageAnim -_08104448: - mov r0, r8 - lsls r1, r0, 16 - asrs r1, 16 - ldrh r2, [r5, 0x20] - adds r1, r2 - strh r1, [r5, 0x20] - lsls r0, r4, 16 - asrs r0, 16 - ldrh r2, [r5, 0x22] - adds r0, r2 - strh r0, [r5, 0x22] - movs r0, 0x6 - strh r0, [r5, 0x2E] - strh r1, [r5, 0x30] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - add r0, r9 - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x22] - strh r0, [r5, 0x34] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, r6 - strh r0, [r5, 0x36] - adds r0, r5, 0 - bl obj_translate_based_on_private_1_2_3_4 - ldrh r0, [r7] - strh r0, [r5, 0x38] - ldrh r0, [r5, 0x2E] - strh r0, [r5, 0x3A] - ldr r0, =sub_81044BC - str r0, [r5, 0x1C] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104414 - - thumb_func_start sub_81044BC -sub_81044BC: @ 81044BC - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - beq _08104520 - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08104520 - adds r0, r4, 0 - movs r1, 0 - bl SeekObjectImageAnim - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - movs r2, 0 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - movs r0, 0x2 - strh r0, [r4, 0x24] - ldr r0, =0x0000fffe - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x3A] - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x30] - movs r1, 0x1 - eors r0, r1 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x32] - eors r0, r1 - strh r0, [r4, 0x32] - strh r2, [r4, 0x36] - strh r2, [r4, 0x34] - ldr r0, =sub_8104530 - str r0, [r4, 0x1C] -_08104520: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81044BC - - thumb_func_start sub_8104530 -sub_8104530: @ 8104530 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _08104548 - ldrh r0, [r4, 0x24] - negs r0, r0 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x26] - negs r0, r0 - strh r0, [r4, 0x26] -_08104548: - ldrh r0, [r4, 0x34] - movs r1, 0x1 - eors r0, r1 - movs r1, 0 - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x33 - bne _0810458A - strh r1, [r4, 0x26] - strh r1, [r4, 0x24] - strh r1, [r4, 0x36] - strh r1, [r4, 0x34] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x38] - movs r1, 0x1 - eors r1, r0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - ldr r0, =sub_8104594 - str r0, [r4, 0x1C] -_0810458A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104530 - - thumb_func_start sub_8104594 -sub_8104594: @ 8104594 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - beq _081045A8 - adds r0, r4, 0 - bl move_anim_8072740 -_081045A8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8104594 - - thumb_func_start sub_81045B0 -sub_81045B0: @ 81045B0 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0x1 - bl obj_id_for_side_relative_to_move - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80A7270 - adds r0, r4, 0 - movs r1, 0xD0 - movs r2, 0xD0 - movs r3, 0 - bl obj_id_set_rotscale - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - adds r0, 0x10 - movs r1, 0 - bl sub_80A750C - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x50 - strh r1, [r0, 0x8] - ldr r1, =sub_8104614 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81045B0 - - thumb_func_start sub_8104614 -sub_8104614: @ 8104614 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x8] - subs r1, 0x1 - strh r1, [r0, 0x8] - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _08104664 - movs r0, 0x1 - bl obj_id_for_side_relative_to_move - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_80A7344 - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - adds r0, 0x10 - movs r1, 0x1 - bl sub_80A750C - adds r0, r5, 0 - bl move_anim_task_del -_08104664: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104614 - - thumb_func_start sub_8104674 -sub_8104674: @ 8104674 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - strh r0, [r4, 0x8] - movs r1, 0 - bl sub_80A7270 - strh r5, [r4, 0xA] - strh r5, [r4, 0xC] - strh r5, [r4, 0xE] - movs r0, 0x80 - lsls r0, 1 - strh r0, [r4, 0x10] - strh r5, [r4, 0x12] - strh r5, [r4, 0x14] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl sub_80A82E4 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x16] - ldr r0, =sub_81046CC - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104674 - - thumb_func_start sub_81046CC -sub_81046CC: @ 81046CC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x5 - bls _081046E6 - b _081047F6 -_081046E6: - lsls r0, 2 - ldr r1, =_081046F8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081046F8: - .4byte _08104710 - .4byte _08104758 - .4byte _0810478E - .4byte _08104794 - .4byte _081047A4 - .4byte _081047D8 -_08104710: - movs r2, 0xC - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08104720 - cmp r0, 0x3 - beq _08104720 - cmp r0, 0x6 - bne _08104728 -_08104720: - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8104800 -_08104728: - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x10] - adds r0, 0x28 - strh r0, [r4, 0x10] - ldrb r0, [r4, 0x8] - movs r1, 0x10 - ldrsh r2, [r4, r1] - adds r1, r2, 0 - movs r3, 0 - bl obj_id_set_rotscale - ldrb r0, [r4, 0x8] - bl sub_80A7E6C - movs r2, 0xC - ldrsh r0, [r4, r2] - cmp r0, 0x20 - bne _081047F6 - ldrh r0, [r4, 0x12] - adds r0, 0x1 - strh r0, [r4, 0x12] - b _081047D0 -_08104758: - movs r1, 0x14 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081047F6 - movs r2, 0x12 - ldrsh r1, [r4, r2] - cmp r1, 0x3 - bne _0810476E - strh r0, [r4, 0xC] - strh r1, [r4, 0xA] - b _081047F6 -_0810476E: - strh r0, [r4, 0xC] - strh r0, [r4, 0xE] - movs r2, 0x80 - lsls r2, 1 - strh r2, [r4, 0x10] - ldrb r0, [r4, 0x8] - adds r1, r2, 0 - movs r3, 0 - bl obj_id_set_rotscale - ldrb r0, [r4, 0x8] - bl sub_80A7E6C - movs r0, 0x2 - strh r0, [r4, 0xA] - b _081047F6 -_0810478E: - movs r0, 0 - strh r0, [r4, 0xA] - b _081047F6 -_08104794: - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x20 - ble _081047F6 - b _081047CC -_081047A4: - ldrh r0, [r4, 0xC] - adds r0, 0x2 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x10] - subs r0, 0x50 - strh r0, [r4, 0x10] - ldrb r0, [r4, 0x8] - movs r1, 0x10 - ldrsh r2, [r4, r1] - adds r1, r2, 0 - movs r3, 0 - bl obj_id_set_rotscale - ldrb r0, [r4, 0x8] - bl sub_80A7E6C - movs r2, 0xC - ldrsh r0, [r4, r2] - cmp r0, 0x20 - bne _081047F6 -_081047CC: - movs r0, 0 - strh r0, [r4, 0xC] -_081047D0: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - b _081047F6 -_081047D8: - ldrb r0, [r4, 0x8] - bl sub_80A7344 - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strh r1, [r0, 0x26] - adds r0, r5, 0 - bl move_anim_task_del -_081047F6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81046CC - - thumb_func_start sub_8104800 -sub_8104800: @ 8104800 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - movs r0, 0 - bl duplicate_obj_of_side_rel2move_in_transparent_mode - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r0, 16 - asrs r4, r0, 16 - cmp r4, 0 - blt _081048DA - bl rotscale_alloc_entry - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0xFF - bne _08104844 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl obj_delete_but_dont_free_vram - b _081048DA - .pool -_08104844: - ldr r5, =0x02020630 - lsls r3, r4, 4 - adds r3, r4 - lsls r3, 2 - adds r4, r3, r5 - ldrb r1, [r4, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x3 - orrs r0, r1 - strb r0, [r4, 0x1] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x1F - ands r6, r0 - lsls r2, r6, 1 - ldrb r1, [r4, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - orrs r0, r2 - strb r0, [r4, 0x3] - ldrb r0, [r7, 0x16] - ldrb r1, [r7, 0xE] - subs r0, r1 - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - ldrh r0, [r7, 0xE] - adds r0, 0x1 - strh r0, [r7, 0xE] - ldrh r0, [r7, 0x14] - adds r0, 0x1 - strh r0, [r7, 0x14] - movs r0, 0x10 - strh r0, [r4, 0x2E] - mov r0, r9 - strh r0, [r4, 0x30] - movs r0, 0x6 - strh r0, [r4, 0x32] - adds r5, 0x1C - adds r3, r5 - ldr r0, =sub_81048F0 - str r0, [r3] - mov r1, r8 - lsls r0, r1, 24 - lsrs r0, 24 - movs r1, 0x10 - ldrsh r2, [r7, r1] - adds r1, r2, 0 - movs r3, 0 - bl obj_id_set_rotscale - ldrb r0, [r4, 0x1] - movs r3, 0x4 - negs r3, r3 - ands r3, r0 - movs r0, 0x1 - orrs r3, r0 - strb r3, [r4, 0x1] - lsrs r1, r3, 6 - ldrb r2, [r4, 0x3] - lsrs r2, 6 - lsls r3, 30 - lsrs r3, 30 - adds r0, r4, 0 - bl CalcVecFromObjectCenterToObjectUpperLeft -_081048DA: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104800 - - thumb_func_start sub_81048F0 -sub_81048F0: @ 81048F0 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - cmp r0, 0 - bne _0810492E - ldr r3, =0x03005e00 - movs r0, 0x32 - ldrsh r1, [r4, r0] - lsls r1, 1 - movs r0, 0x30 - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - adds r0, r4, 0 - bl obj_delete_but_dont_free_vram -_0810492E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81048F0 - - thumb_func_start sub_8104938 -sub_8104938: @ 8104938 - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - ldr r5, =0x0203841e - movs r1, 0x2 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _08104964 - adds r0, r2, 0 - bl move_anim_task_del - b _0810498A - .pool -_08104964: - ldrb r0, [r5] - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r2, 0 - strh r1, [r4, 0x8] - strh r2, [r4, 0xA] - ldrh r0, [r5, 0x2] - strh r0, [r4, 0xC] - strh r2, [r4, 0xE] - strh r2, [r4, 0x10] - ldr r2, =gUnknown_085935E8 - adds r0, r4, 0 - bl sub_80A7CFC - ldr r0, =sub_8104998 - str r0, [r4] -_0810498A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104938 - - thumb_func_start sub_8104998 -sub_8104998: @ 8104998 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r0, 0xA - ldrsh r5, [r4, r0] - cmp r5, 0x1 - beq _08104A00 - cmp r5, 0x1 - bgt _081049C0 - cmp r5, 0 - beq _081049CA - b _08104AA8 - .pool -_081049C0: - cmp r5, 0x2 - beq _08104A34 - cmp r5, 0x3 - beq _08104A64 - b _08104AA8 -_081049CA: - adds r0, r4, 0 - bl sub_80A7D34 - ldrh r2, [r4, 0x10] - adds r2, 0x3 - strh r2, [r4, 0x10] - ldr r3, =0x02020630 - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x26] - adds r1, r2 - strh r1, [r0, 0x26] - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _08104AA8 - strh r5, [r4, 0xE] - b _08104A5C - .pool -_08104A00: - adds r0, r4, 0 - bl sub_80A7D34 - ldr r2, =0x02020630 - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r4, 0x10] - ldrh r2, [r0, 0x26] - adds r1, r2 - strh r1, [r0, 0x26] - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _08104AA8 - movs r0, 0 - strh r0, [r4, 0xE] - b _08104A5C - .pool -_08104A34: - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _08104A5C - ldr r2, =0x02020630 - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x26] - subs r1, 0x2 - strh r1, [r0, 0x26] - ldrh r0, [r4, 0x10] - subs r0, 0x2 - strh r0, [r4, 0x10] - b _08104AA8 - .pool -_08104A5C: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - b _08104AA8 -_08104A64: - adds r0, r4, 0 - bl sub_80A7D34 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _08104AA8 - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _08104A9C - ldr r2, =0x02020630 - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r5, [r0, 0x26] - adds r0, r6, 0 - bl move_anim_task_del - b _08104AA8 - .pool -_08104A9C: - ldrb r1, [r4, 0x8] - ldr r2, =gUnknown_085935E8 - adds r0, r4, 0 - bl sub_80A7CFC - strh r5, [r4, 0xA] -_08104AA8: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104998 - - thumb_func_start sub_8104AB4 -sub_8104AB4: @ 8104AB4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - movs r0, 0 - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_08593608 - adds r0, r4, 0 - bl sub_80A7CFC - ldr r0, =sub_8104AF0 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104AB4 - - thumb_func_start sub_8104AF0 -sub_8104AF0: @ 8104AF0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r0, r1 - bl sub_80A7D34 - lsls r0, 24 - cmp r0, 0 - bne _08104B10 - adds r0, r4, 0 - bl move_anim_task_del -_08104B10: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104AF0 - - thumb_func_start sub_8104B1C -sub_8104B1C: @ 8104B1C - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x02038436 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08104B50 - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnim - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x20 - strh r0, [r4, 0x20] - movs r0, 0x40 - b _08104B6A - .pool -_08104B50: - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnim - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x20 - strh r0, [r4, 0x20] - ldr r0, =0x0000ffc0 -_08104B6A: - strh r0, [r4, 0x30] - ldr r0, =0x02038436 - ldrb r0, [r0] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - strh r0, [r4, 0x22] - movs r0, 0x34 - strh r0, [r4, 0x2E] - strh r1, [r4, 0x32] - strh r1, [r4, 0x34] - strh r1, [r4, 0x36] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A656C - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104B1C - - thumb_func_start sub_8104BAC -sub_8104BAC: @ 8104BAC - push {r4-r6,lr} - adds r6, r0, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08104BC8 - ldr r0, =0x02038436 - b _08104BCA - .pool -_08104BC8: - ldr r0, =0x02038437 -_08104BCA: - ldrb r5, [r0] - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08104BE4 - ldr r1, =0x0203841e - movs r2, 0x2 - ldrsh r0, [r1, r2] - negs r0, r0 - strh r0, [r1, 0x2] -_08104BE4: - adds r0, r5, 0 - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - ldr r4, =0x0203841e - lsrs r0, 24 - ldrh r1, [r4, 0x2] - adds r0, r1 - strh r0, [r6, 0x20] - adds r0, r5, 0 - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r4, [r4, 0x4] - adds r0, r4 - strh r0, [r6, 0x22] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - bgt _08104C16 - movs r0, 0x8 - strh r0, [r6, 0x22] -_08104C16: - ldr r1, =move_anim_8074EE0 - adds r0, r6, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A67BC - str r0, [r6, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104BAC - - thumb_func_start sub_8104C38 -sub_8104C38: @ 8104C38 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - movs r0, 0 - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0 - strh r1, [r4, 0x8] - strh r0, [r4, 0xA] - ldr r2, =gUnknown_085936A4 - adds r0, r4, 0 - bl sub_80A7CFC - ldr r0, =sub_8104C78 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104C38 - - thumb_func_start sub_8104C78 -sub_8104C78: @ 8104C78 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r0, r1 - bl sub_80A7D34 - lsls r0, 24 - cmp r0, 0 - bne _08104C98 - adds r0, r4, 0 - bl move_anim_task_del -_08104C98: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104C78 - - thumb_func_start sub_8104CA4 -sub_8104CA4: @ 8104CA4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r4, r1, r0 - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - movs r2, 0 - strh r0, [r4, 0x8] - strh r2, [r4, 0xA] - movs r0, 0x4 - strh r0, [r4, 0xC] - movs r0, 0x7 - strh r0, [r4, 0xE] - movs r0, 0x3 - strh r0, [r4, 0x10] - ldr r3, =0x02020630 - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0, 0x20] - strh r0, [r4, 0x12] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0, 0x22] - strh r0, [r4, 0x14] - strh r2, [r4, 0x16] - strh r2, [r4, 0x18] - movs r0, 0x2 - strh r0, [r4, 0x1A] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08104D0E - movs r1, 0xC - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0xC] -_08104D0E: - ldr r0, =sub_8104D28 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104CA4 - - thumb_func_start sub_8104D28 -sub_8104D28: @ 8104D28 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r3, r0, r1 - ldrh r0, [r3, 0x16] - adds r0, 0x1 - strh r0, [r3, 0x16] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _08104D8E - movs r0, 0 - strh r0, [r3, 0x16] - ldrh r0, [r3, 0x18] - adds r0, 0x1 - strh r0, [r3, 0x18] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08104D78 - ldr r2, =0x02020630 - movs r0, 0x8 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r3, 0x1A] - ldrh r2, [r0, 0x22] - adds r1, r2 - b _08104D8C - .pool -_08104D78: - ldr r2, =0x02020630 - movs r5, 0x8 - ldrsh r1, [r3, r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - ldrh r2, [r3, 0x1A] - subs r1, r2 -_08104D8C: - strh r1, [r0, 0x22] -_08104D8E: - movs r1, 0xA - ldrsh r0, [r3, r1] - cmp r0, 0x1 - beq _08104DDC - cmp r0, 0x1 - bgt _08104DA4 - cmp r0, 0 - beq _08104DAA - b _08104E6C - .pool -_08104DA4: - cmp r0, 0x2 - beq _08104E0C - b _08104E6C -_08104DAA: - ldr r2, =0x02020630 - movs r5, 0x8 - ldrsh r1, [r3, r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r3, 0xC] - ldrh r2, [r0, 0x20] - adds r1, r2 - strh r1, [r0, 0x20] - ldrh r0, [r3, 0xE] - subs r0, 0x1 - strh r0, [r3, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _08104E6C - movs r0, 0xE - strh r0, [r3, 0xE] - movs r0, 0x1 - strh r0, [r3, 0xA] - b _08104E6C - .pool -_08104DDC: - ldr r2, =0x02020630 - movs r5, 0x8 - ldrsh r1, [r3, r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x20] - ldrh r2, [r3, 0xC] - subs r1, r2 - strh r1, [r0, 0x20] - ldrh r0, [r3, 0xE] - subs r0, 0x1 - strh r0, [r3, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _08104E6C - movs r0, 0x7 - strh r0, [r3, 0xE] - movs r0, 0x2 - strh r0, [r3, 0xA] - b _08104E6C - .pool -_08104E0C: - ldr r2, =0x02020630 - movs r0, 0x8 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r3, 0xC] - ldrh r5, [r0, 0x20] - adds r1, r5 - strh r1, [r0, 0x20] - ldrh r0, [r3, 0xE] - subs r0, 0x1 - strh r0, [r3, 0xE] - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0 - bne _08104E6C - ldrh r0, [r3, 0x10] - subs r0, 0x1 - strh r0, [r3, 0x10] - lsls r0, 16 - cmp r0, 0 - beq _08104E48 - movs r0, 0x7 - strh r0, [r3, 0xE] - strh r1, [r3, 0xA] - b _08104E6C - .pool -_08104E48: - ldrh r1, [r3, 0x18] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08104E66 - movs r0, 0x8 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - ldrh r2, [r3, 0x1A] - subs r1, r2 - strh r1, [r0, 0x22] -_08104E66: - adds r0, r4, 0 - bl move_anim_task_del -_08104E6C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8104D28 - - thumb_func_start sub_8104E74 -sub_8104E74: @ 8104E74 - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r5, r1, r0 - ldr r4, =0x02038437 - ldrb r0, [r4] - bl sub_80A6190 - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x20 - movs r1, 0 - strh r0, [r5, 0x8] - movs r0, 0x4 - strh r0, [r5, 0xA] - strh r1, [r5, 0xC] - strh r1, [r5, 0xE] - strh r1, [r5, 0x10] - strh r1, [r5, 0x12] - ldrb r0, [r4] - bl sub_80A861C - strh r0, [r5, 0x26] - ldrb r0, [r4] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08104ED4 - ldr r0, =0x02022e18 - ldrh r0, [r0] - strh r0, [r5, 0x14] - ldr r0, =0x04000014 - b _08104EDC - .pool -_08104ED4: - ldr r0, =0x02022e1c - ldrh r0, [r0] - strh r0, [r5, 0x14] - ldr r0, =0x04000018 -_08104EDC: - str r0, [sp] - ldrh r0, [r5, 0x8] - adds r1, r0, 0 - subs r1, 0x40 - lsls r2, r1, 16 - lsls r0, 16 - cmp r2, r0 - bgt _08104F1A - ldr r4, =0x02038c28 - movs r0, 0xF0 - lsls r0, 3 - adds r6, r4, r0 -_08104EF4: - asrs r3, r2, 16 - cmp r3, 0 - blt _08104F0C - lsls r1, r3, 1 - adds r2, r1, r4 - ldrh r0, [r5, 0x14] - adds r0, 0xF0 - strh r0, [r2] - adds r1, r6 - ldrh r0, [r5, 0x14] - adds r0, 0xF0 - strh r0, [r1] -_08104F0C: - adds r0, r3, 0x1 - lsls r2, r0, 16 - asrs r1, r2, 16 - movs r3, 0x8 - ldrsh r0, [r5, r3] - cmp r1, r0 - ble _08104EF4 -_08104F1A: - ldr r0, =0xa2600001 - str r0, [sp, 0x4] - mov r1, sp - movs r2, 0 - movs r0, 0x1 - strb r0, [r1, 0x8] - mov r0, sp - strb r2, [r0, 0x9] - ldr r0, [sp] - ldr r1, [sp, 0x4] - ldr r2, [sp, 0x8] - bl sub_80BA038 - ldr r0, =sub_8104F54 - str r0, [r5] - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104E74 - - thumb_func_start sub_8104F54 -sub_8104F54: @ 8104F54 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r3, r0, r1 - movs r1, 0x10 - ldrsh r0, [r3, r1] - cmp r0, 0 - beq _08104F78 - cmp r0, 0x1 - beq _08104F8E - b _0810500E - .pool -_08104F78: - ldrh r0, [r3, 0x12] - adds r0, 0x1 - strh r0, [r3, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _0810500E - ldrh r0, [r3, 0x10] - adds r0, 0x1 - strh r0, [r3, 0x10] - b _0810500E -_08104F8E: - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _0810500E - movs r0, 0 - strh r0, [r3, 0xA] - ldrh r1, [r3, 0xE] - movs r0, 0x3 - ands r0, r1 - strh r0, [r3, 0xC] - ldrh r0, [r3, 0x8] - subs r0, r1 - strh r0, [r3, 0x12] - movs r2, 0xC - ldrsh r1, [r3, r2] - cmp r1, 0x1 - beq _08104FC4 - cmp r1, 0x1 - ble _08104FCC - cmp r1, 0x2 - beq _08104FC8 - cmp r1, 0x3 - beq _08104FC8 - b _08104FCC -_08104FC4: - subs r0, 0x2 - b _08104FCA -_08104FC8: - adds r0, 0x1 -_08104FCA: - strh r0, [r3, 0x12] -_08104FCC: - movs r1, 0x12 - ldrsh r0, [r3, r1] - cmp r0, 0 - blt _08104FF0 - ldr r2, =0x02038c28 - lsls r0, 1 - adds r0, r2 - ldrh r1, [r3, 0x14] - strh r1, [r0] - movs r1, 0x12 - ldrsh r0, [r3, r1] - lsls r0, 1 - movs r1, 0xF0 - lsls r1, 3 - adds r2, r1 - adds r0, r2 - ldrh r1, [r3, 0x14] - strh r1, [r0] -_08104FF0: - ldrh r0, [r3, 0xE] - adds r0, 0x1 - strh r0, [r3, 0xE] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x26 - ldrsh r1, [r3, r2] - cmp r0, r1 - blt _0810500E - ldr r1, =0x02039b28 - movs r0, 0x3 - strb r0, [r1, 0x15] - adds r0, r4, 0 - bl move_anim_task_del -_0810500E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104F54 - - thumb_func_start sub_810501C -sub_810501C: @ 810501C - push {r4-r6,lr} - adds r4, r0, 0 - ldr r6, =0x02038437 - ldrb r0, [r6] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x10 - movs r5, 0 - strh r0, [r4, 0x20] - ldrb r0, [r6] - bl sub_80A6190 - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x10 - strh r0, [r4, 0x22] - strh r5, [r4, 0x2E] - strh r5, [r4, 0x30] - strh r5, [r4, 0x32] - movs r0, 0x10 - strh r0, [r4, 0x34] - strh r5, [r4, 0x36] - ldrb r0, [r6] - movs r1, 0 - bl sub_80A861C - adds r0, 0x2 - strh r0, [r4, 0x38] - movs r0, 0x3F - bl sub_80A5178 - lsls r0, 24 - asrs r0, 24 - strh r0, [r4, 0x3A] - ldr r0, =sub_8105078 - str r0, [r4, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810501C - - thumb_func_start sub_8105078 -sub_8105078: @ 8105078 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x2E - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _081050DC - cmp r1, 0x1 - bgt _0810508E - cmp r1, 0 - beq _08105094 - b _081051BC -_0810508E: - cmp r1, 0x2 - beq _0810516E - b _081051BC -_08105094: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _081050BE - strh r1, [r4, 0x32] - adds r3, r4, 0 - adds r3, 0x3E - ldrb r2, [r3] - lsrs r1, r2, 2 - movs r0, 0x1 - eors r1, r0 - ands r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_081050BE: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - ble _081051BC - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x5 - negs r1, r1 - ands r1, r0 - strb r1, [r2] - b _08105166 -_081050DC: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _08105122 - ldrh r2, [r4, 0x32] - movs r3, 0x32 - ldrsh r1, [r4, r3] - movs r3, 0x38 - ldrsh r0, [r4, r3] - cmp r1, r0 - bge _08105122 - movs r0, 0 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x22] - subs r0, 0x1 - strh r0, [r4, 0x22] - adds r0, r2, 0x1 - strh r0, [r4, 0x32] - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r1, 0xA - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _08105122 - ldrh r1, [r4, 0x3A] - lsls r1, 24 - asrs r1, 24 - movs r0, 0xCD - bl audio_play_and_stuff -_08105122: - ldrh r0, [r4, 0x34] - ldrh r2, [r4, 0x36] - adds r1, r0, r2 - strh r1, [r4, 0x36] - lsls r0, r1, 16 - asrs r2, r0, 16 - cmp r2, 0x1F - ble _08105136 - movs r0, 0x40 - b _08105144 -_08105136: - movs r0, 0x20 - negs r0, r0 - cmp r2, r0 - bgt _08105150 - movs r2, 0x40 - negs r2, r2 - adds r0, r2, 0 -_08105144: - subs r0, r1 - strh r0, [r4, 0x36] - movs r3, 0x34 - ldrsh r0, [r4, r3] - negs r0, r0 - strh r0, [r4, 0x34] -_08105150: - ldrh r0, [r4, 0x36] - movs r2, 0 - strh r0, [r4, 0x24] - movs r0, 0x38 - ldrsh r1, [r4, r0] - movs r3, 0x32 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _081051BC - strh r2, [r4, 0x30] - strh r2, [r4, 0x32] -_08105166: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _081051BC -_0810516E: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0810519A - movs r0, 0 - strh r0, [r4, 0x32] - adds r3, r4, 0 - adds r3, 0x3E - ldrb r2, [r3] - lsrs r1, r2, 2 - movs r0, 0x1 - eors r1, r0 - ands r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_0810519A: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - ble _081051BC - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - bl move_anim_8072740 -_081051BC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8105078 - - thumb_func_start sub_81051C4 -sub_81051C4: @ 81051C4 - push {r4-r7,lr} - sub sp, 0x4 - adds r6, r0, 0 - movs r5, 0 - mov r0, sp - strh r5, [r0] - mov r1, sp - adds r1, 0x2 - strh r5, [r1] - ldr r0, =0x0203841e - movs r3, 0x4 - ldrsh r2, [r0, r3] - adds r7, r1, 0 - adds r1, r0, 0 - cmp r2, 0 - bne _081051F0 - ldr r0, =0x02038436 - b _081051F2 - .pool -_081051F0: - ldr r0, =0x02038437 -_081051F2: - ldrb r5, [r0] - ldrb r1, [r1, 0x6] - movs r0, 0x1 - adds r4, r0, 0 - eors r4, r1 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0810526A - movs r1, 0x2 - adds r0, r5, 0 - eors r0, r1 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _0810526A - adds r0, r5, 0 - adds r1, r4, 0 - mov r2, sp - adds r3, r7, 0 - bl sub_80A8924 - cmp r4, 0 - bne _08105230 - adds r0, r5, 0 - movs r1, 0 - b _08105234 - .pool -_08105230: - adds r0, r5, 0 - movs r1, 0x2 -_08105234: - bl sub_80A5C6C - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08105260 - ldr r2, =0x0203841e - mov r0, sp - ldrh r1, [r0] - subs r1, r4 - ldrh r0, [r2] - subs r1, r0 - subs r0, r1 - strh r0, [r2] - b _0810526A - .pool -_08105260: - ldr r1, =0x0203841e - mov r0, sp - ldrh r0, [r0] - subs r0, r4 - strh r0, [r1] -_0810526A: - ldr r1, =sub_80A77C8 - str r1, [r6, 0x1C] - adds r0, r6, 0 - bl _call_via_r1 - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81051C4 - - thumb_func_start sub_8105284 -sub_8105284: @ 8105284 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - beq _0810529E - adds r0, r4, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl move_anim_8072740 -_0810529E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8105284 - - thumb_func_start sub_81052A4 -sub_81052A4: @ 81052A4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r5, r0, 0 - movs r6, 0 - mov r0, sp - strh r6, [r0] - mov r1, sp - adds r1, 0x2 - strh r6, [r1] - ldr r0, =0x0203841e - movs r2, 0xA - ldrsh r0, [r0, r2] - cmp r0, 0 - bne _081052DC - ldr r0, =0x02038436 - ldrb r7, [r0] - ldr r0, =0x02038437 - b _081052E2 - .pool -_081052DC: - ldr r0, =0x02038437 - ldrb r7, [r0] - ldr r0, =0x02038436 -_081052E2: - ldrb r0, [r0] - mov r8, r0 - ldr r0, =0x0203841e - movs r3, 0xC - ldrsh r0, [r0, r3] - cmp r0, 0 - bne _08105308 - movs r0, 0 - mov r10, r0 - movs r1, 0x1 - str r1, [sp, 0x4] - b _08105310 - .pool -_08105308: - movs r2, 0x2 - mov r10, r2 - movs r3, 0x3 - str r3, [sp, 0x4] -_08105310: - adds r0, r7, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810536C - adds r0, r7, 0 - mov r1, r10 - bl sub_80A5C6C - lsls r0, 24 - ldr r1, =0x0203841e - lsrs r0, 24 - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - movs r0, 0x2 - mov r4, r8 - eors r4, r0 - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _0810535C - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - adds r0, r4, r0 - b _081053EA - .pool -_0810535C: - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - add r0, r8 - b _081053EA - .pool -_0810536C: - adds r0, r7, 0 - mov r1, r10 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0203841e - ldrh r1, [r1] - subs r0, r1 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _081053E4 - movs r0, 0x2 - adds r4, r7, 0 - eors r4, r0 - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _081053E4 - ldr r3, =0x02020630 - ldr r2, =0x020241e4 - adds r0, r7, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r6, r0, r3 - adds r2, r4, r2 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, r0, r3 - movs r0, 0x20 - ldrsh r1, [r6, r0] - movs r3, 0x20 - ldrsh r0, [r2, r3] - cmp r1, r0 - bge _081053E0 - adds r0, r2, 0 - adds r0, 0x43 - ldrb r0, [r0] - adds r0, 0x1 - b _081053FA - .pool -_081053E0: - adds r0, r6, 0 - b _081053F4 -_081053E4: - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - adds r0, r7, r0 -_081053EA: - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 -_081053F4: - adds r0, 0x43 - ldrb r0, [r0] - subs r0, 0x1 -_081053FA: - adds r1, r5, 0 - adds r1, 0x43 - strb r0, [r1] - adds r0, r7, 0 - ldr r1, [sp, 0x4] - bl sub_80A5C6C - lsls r0, 24 - ldr r4, =0x0203841e - lsrs r0, 24 - ldrh r1, [r4, 0x2] - adds r0, r1 - lsls r0, 16 - lsrs r6, r0, 16 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0810544C - movs r1, 0x2 - mov r0, r8 - eors r0, r1 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _0810544C - ldrb r1, [r4, 0xC] - mov r0, r8 - mov r2, sp - mov r3, sp - adds r3, 0x2 - bl sub_80A8924 - b _0810546C - .pool -_0810544C: - mov r4, sp - mov r0, r8 - mov r1, r10 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - mov r0, r8 - ldr r1, [sp, 0x4] - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - mov r2, sp - strh r0, [r2, 0x2] -_0810546C: - mov r0, r8 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08105490 - mov r3, sp - mov r2, sp - ldr r1, =0x0203841e - ldrh r0, [r1, 0x6] - ldrh r2, [r2] - adds r0, r2 - strh r0, [r3] - adds r2, r1, 0 - b _0810549E - .pool -_08105490: - mov r3, sp - mov r0, sp - ldr r2, =0x0203841e - ldrh r0, [r0] - ldrh r1, [r2, 0x6] - subs r0, r1 - strh r0, [r3] -_0810549E: - ldrh r1, [r2, 0x8] - mov r3, sp - ldrh r3, [r3, 0x2] - adds r1, r3 - mov r0, sp - strh r1, [r0, 0x2] - mov r3, r9 - strh r3, [r5, 0x30] - strh r3, [r5, 0x20] - strh r6, [r5, 0x34] - strh r6, [r5, 0x22] - ldrh r0, [r0] - strh r0, [r5, 0x32] - strh r1, [r5, 0x36] - ldrh r0, [r2] - strh r0, [r5, 0x2E] - adds r0, r5, 0 - bl obj_translate_based_on_private_1_2_3_4 - ldr r1, =sub_8105284 - str r1, [r5, 0x1C] - adds r0, r5, 0 - bl _call_via_r1 - 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_81052A4 - - thumb_func_start sub_81054E8 -sub_81054E8: @ 81054E8 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x000027db - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _0810550E - lsls r0, 20 - ldr r1, =0x01010000 - adds r0, r1 - lsrs r0, 16 - ldr r1, =0x0203841e - ldrb r2, [r1, 0xA] - ldrh r3, [r1, 0x8] - movs r1, 0xF - bl pal_fade_1 -_0810550E: - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - ldr r1, =sub_80A77C8 - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81054E8 - - thumb_func_start sub_8105538 -sub_8105538: @ 8105538 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - bl sub_80A69CC - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - movs r1, 0xA0 - cmp r0, 0 - beq _08105554 - ldr r1, =0x0000ff60 -_08105554: - movs r0, 0xE0 - lsls r0, 2 - strh r0, [r4, 0x2E] - strh r1, [r4, 0x30] - ldr r0, =0x0203841e - ldrh r0, [r0, 0x4] - strh r0, [r4, 0x3C] - ldr r0, =sub_810557C - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105538 - - thumb_func_start sub_810557C -sub_810557C: @ 810557C - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r2, [r4, 0x2E] - lsls r0, r2, 16 - asrs r0, 24 - ldrh r1, [r4, 0x26] - subs r1, r0 - movs r5, 0 - strh r1, [r4, 0x26] - ldrh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - subs r2, 0x20 - strh r2, [r4, 0x2E] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - movs r1, 0xA0 - cmp r0, 0 - beq _081055AC - ldr r1, =0x0000ff60 -_081055AC: - lsls r0, r1, 16 - asrs r0, 16 - ldrh r1, [r4, 0x30] - adds r0, r1 - strh r0, [r4, 0x30] - ldrh r1, [r4, 0x26] - movs r2, 0x26 - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _081055E0 - ldrh r2, [r4, 0x22] - adds r0, r1, r2 - strh r0, [r4, 0x22] - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - strh r5, [r4, 0x26] - strh r5, [r4, 0x24] - strh r5, [r4, 0x2E] - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - ldr r0, =sub_81055F4 - str r0, [r4, 0x1C] -_081055E0: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810557C - - thumb_func_start sub_81055F4 -sub_81055F4: @ 81055F4 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r1, r0, 0x1 - strh r1, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _08105612 - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectRotScalAnim - ldr r0, =sub_810561C - str r0, [r4, 0x1C] -_08105612: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81055F4 - - thumb_func_start sub_810561C -sub_810561C: @ 810561C - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08105682 - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - movs r0, 0 - strh r0, [r4, 0x2E] - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08105668 - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x10 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - ldr r0, =sub_8105694 - b _08105680 - .pool -_08105668: - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x20 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - ldr r0, =sub_810571C -_08105680: - str r0, [r4, 0x1C] -_08105682: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810561C - - thumb_func_start sub_8105694 -sub_8105694: @ 8105694 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x26] - subs r0, 0x2 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - bne _081056CA - movs r0, 0x10 - strh r0, [r4, 0x2E] - movs r0, 0 - strh r0, [r4, 0x30] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldrh r1, [r4, 0x2E] - movs r0, 0x52 - bl SetGpuReg - ldr r0, =sub_81056D4 - str r0, [r4, 0x1C] -_081056CA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105694 - - thumb_func_start sub_81056D4 -sub_81056D4: @ 81056D4 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - adds r1, r0, 0x1 - strh r1, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x3 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _08105712 - ldrh r1, [r4, 0x2E] - subs r1, 0x1 - strh r1, [r4, 0x2E] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08105712 - ldr r0, =sub_810571C - str r0, [r4, 0x1C] -_08105712: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81056D4 - - thumb_func_start sub_810571C -sub_810571C: @ 810571C - push {lr} - adds r3, r0, 0 - ldr r0, =0x0203841e - ldrh r1, [r0, 0xE] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08105754 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - movs r1, 0x3C - ldrsh r0, [r3, r1] - cmp r0, 0 - bne _08105750 - ldr r0, =sub_810575C - b _08105752 - .pool -_08105750: - ldr r0, =move_anim_8072740 -_08105752: - str r0, [r3, 0x1C] -_08105754: - pop {r0} - bx r0 - .pool - thumb_func_end sub_810571C - - thumb_func_start sub_810575C -sub_810575C: @ 810575C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl move_anim_8072740 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810575C - - thumb_func_start sub_810577C -sub_810577C: @ 810577C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - movs r0, 0 - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - strh r1, [r4, 0x8] - ldr r2, =gUnknown_085938B0 - adds r0, r4, 0 - bl sub_80A7CFC - ldr r0, =sub_81057B8 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810577C - - thumb_func_start sub_81057B8 -sub_81057B8: @ 81057B8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - adds r0, r4, 0 - bl sub_80A7D34 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - bne _08105802 - ldr r2, =0x02020630 - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x26] - movs r0, 0x8 - ldrsh r1, [r4, 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] - adds r0, r5, 0 - bl move_anim_task_del -_08105802: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81057B8 - - thumb_func_start sub_8105810 -sub_8105810: @ 8105810 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r4, r1, r0 - movs r0, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - strh r0, [r4, 0xE] - movs r0, 0x3 - strh r0, [r4, 0x20] - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08105850 - ldr r0, =0x0000ffff - strh r0, [r4, 0x22] - movs r0, 0x8 - b _08105856 - .pool -_08105850: - movs r0, 0x1 - strh r0, [r4, 0x22] - ldr r0, =0x0000fff8 -_08105856: - strh r0, [r4, 0x24] - movs r0, 0x1 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - ldr r0, =sub_8105878 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105810 - - thumb_func_start sub_8105878 -sub_8105878: @ 8105878 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r3, r0, r1 - movs r0, 0x8 - ldrsh r4, [r3, r0] - cmp r4, 0x1 - beq _081058CC - cmp r4, 0x1 - bgt _081058A0 - cmp r4, 0 - beq _081058AA - b _08105992 - .pool -_081058A0: - cmp r4, 0x2 - beq _08105948 - cmp r4, 0x3 - beq _08105962 - b _08105992 -_081058AA: - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r3, 0x24] - ldrh r2, [r0, 0x24] - adds r1, r2 - strh r1, [r0, 0x24] - strh r4, [r3, 0xA] - strh r4, [r3, 0xC] - strh r4, [r3, 0xE] - b _0810595A - .pool -_081058CC: - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _08105992 - movs r0, 0 - strh r0, [r3, 0xA] - ldrh r0, [r3, 0xC] - adds r0, 0x1 - strh r0, [r3, 0xC] - ands r0, r4 - lsls r0, 16 - cmp r0, 0 - beq _08105904 - ldr r2, =0x02020630 - movs r4, 0x26 - ldrsh r1, [r3, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x24] - adds r1, 0x6 - b _08105916 - .pool -_08105904: - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x24] - subs r1, 0x6 -_08105916: - strh r1, [r0, 0x24] - ldrh r0, [r3, 0xE] - adds r0, 0x1 - strh r0, [r3, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _08105992 - ldrh r1, [r3, 0xC] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0810595A - movs r1, 0x26 - ldrsh r0, [r3, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x24] - subs r0, 0x6 - strh r0, [r1, 0x24] - b _0810595A - .pool -_08105948: - ldrh r0, [r3, 0x20] - subs r0, 0x1 - strh r0, [r3, 0x20] - lsls r0, 16 - cmp r0, 0 - beq _0810595A - movs r0, 0 - strh r0, [r3, 0x8] - b _08105992 -_0810595A: - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] - b _08105992 -_08105962: - ldr r2, =0x02020630 - movs r4, 0x26 - ldrsh r1, [r3, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r3, 0x22] - ldrh r4, [r0, 0x24] - adds r1, r4 - strh r1, [r0, 0x24] - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x24 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08105992 - adds r0, r5, 0 - bl move_anim_task_del -_08105992: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105878 - - thumb_func_start sub_810599C -sub_810599C: @ 810599C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - movs r0, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - strh r0, [r4, 0xE] - movs r0, 0x1 - strh r0, [r4, 0x10] - movs r0, 0xE - strh r0, [r4, 0x22] - movs r0, 0x2 - strh r0, [r4, 0x24] - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - ldr r0, =sub_81059E0 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810599C - - thumb_func_start sub_81059E0 -sub_81059E0: @ 81059E0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r2, [r4, r0] - cmp r2, 0 - bne _08105AA6 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x10 - ldrsh r1, [r4, r3] - cmp r0, r1 - ble _08105AA6 - strh r2, [r4, 0xA] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08105A3C - ldr r3, =0x02020630 - movs r6, 0x26 - ldrsh r1, [r4, r6] - 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 - b _08105A52 - .pool -_08105A3C: - ldr r3, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - 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 -_08105A52: - strb r1, [r0] - ldrh r0, [r4, 0xE] - adds r0, 0x1 - movs r2, 0 - strh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 16 - movs r6, 0x22 - ldrsh r1, [r4, r6] - cmp r0, r1 - blt _08105AA6 - ldrh r0, [r4, 0x10] - adds r0, 0x1 - strh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 16 - movs r6, 0x24 - ldrsh r1, [r4, r6] - cmp r0, r1 - bge _08105A88 - strh r2, [r4, 0xA] - strh r2, [r4, 0xC] - strh r2, [r4, 0xE] - b _08105AA6 - .pool -_08105A88: - movs r0, 0x26 - 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] - adds r0, r5, 0 - bl move_anim_task_del -_08105AA6: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81059E0 - - thumb_func_start sub_8105AAC -sub_8105AAC: @ 8105AAC - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - movs r0, 0 - strh r0, [r4, 0x8] - movs r1, 0x4 - strh r1, [r4, 0xA] - strh r0, [r4, 0xC] - strh r0, [r4, 0xE] - strh r0, [r4, 0x10] - strh r0, [r4, 0x12] - strh r0, [r4, 0x14] - strh r0, [r4, 0x16] - strh r0, [r4, 0x18] - strh r0, [r4, 0x22] - ldr r5, =0x02038436 - ldrb r0, [r5] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x24] - ldrb r0, [r5] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - ldr r0, =sub_8105B08 - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105AAC - - thumb_func_start sub_8105B08 -sub_8105B08: @ 8105B08 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r0, 0x18 - ldrsh r2, [r4, r0] - cmp r2, 0x1 - beq _08105B74 - cmp r2, 0x1 - bgt _08105B30 - cmp r2, 0 - beq _08105B36 - b _08105B90 - .pool -_08105B30: - cmp r2, 0x2 - beq _08105B8C - b _08105B90 -_08105B36: - ldrh r0, [r4, 0x10] - adds r0, 0x1 - strh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _08105B90 - strh r2, [r4, 0x10] - ldrh r0, [r4, 0x12] - adds r0, 0x1 - movs r1, 0x1 - ands r0, r1 - strh r0, [r4, 0x12] - ldrh r0, [r4, 0x14] - adds r0, 0x1 - strh r0, [r4, 0x14] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _08105B90 - movs r1, 0x16 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08105B6E - strh r2, [r4, 0x14] - movs r0, 0x1 - strh r0, [r4, 0x18] - b _08105B90 -_08105B6E: - movs r0, 0x2 - strh r0, [r4, 0x18] - b _08105B90 -_08105B74: - movs r1, 0 - strh r1, [r4, 0x12] - ldrh r0, [r4, 0x10] - adds r0, 0x1 - strh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _08105B90 - strh r2, [r4, 0x16] - strh r1, [r4, 0x18] - b _08105B90 -_08105B8C: - movs r0, 0x1 - strh r0, [r4, 0x12] -_08105B90: - movs r2, 0x8 - ldrsh r5, [r4, r2] - cmp r5, 0 - beq _08105B9E - cmp r5, 0x1 - beq _08105C34 - b _08105C42 -_08105B9E: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _08105C42 - strh r5, [r4, 0xA] - ldr r0, =gUnknown_085938DC - movs r3, 0x24 - ldrsh r1, [r4, r3] - movs r3, 0x26 - ldrsh r2, [r4, r3] - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - beq _08105C42 - ldr r0, =0x02020630 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - strh r6, [r1, 0x2E] - movs r0, 0xD - strh r0, [r1, 0x30] - ldr r2, =gUnknown_085938F4 - movs r3, 0xC - ldrsh r0, [r4, r3] - lsls r0, 1 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - strh r0, [r1, 0x24] - movs r3, 0xC - ldrsh r0, [r4, r3] - lsls r0, 1 - adds r2, 0x1 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - strh r0, [r1, 0x26] - ldrh r0, [r4, 0x22] - adds r0, 0x1 - strh r0, [r4, 0x22] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _08105C42 - strh r5, [r4, 0xC] - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - ble _08105C42 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _08105C42 - .pool -_08105C34: - movs r1, 0x22 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08105C42 - adds r0, r6, 0 - bl move_anim_task_del -_08105C42: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8105B08 - - thumb_func_start sub_8105C48 -sub_8105C48: @ 8105C48 - push {r4,lr} - adds r3, r0, 0 - ldr r4, =0x03005e00 - movs r0, 0x2E - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r1, 0x3E - adds r1, r3 - mov r12, r1 - movs r2, 0x1 - ldrb r1, [r0, 0x12] - ands r1, r2 - lsls r1, 2 - mov r0, r12 - ldrb r2, [r0] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - adds r0, r3, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08105CAA - movs r0, 0x30 - ldrsh r1, [r3, r0] - lsls r1, 1 - movs r0, 0x2E - ldrsh r2, [r3, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r0, r4, 0 - adds r0, 0x8 - adds r1, r0 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r3, 0 - bl RemoveObjectAndFreeTiles -_08105CAA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105C48 - - thumb_func_start sub_8105CB4 -sub_8105CB4: @ 8105CB4 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x000027de - bl IndexOfObjectPaletteTag - mov r1, sp - strb r0, [r1] - movs r4, 0x1 - ldr r0, =0x00002710 - adds r5, r0, 0 -_08105CCC: - subs r0, r5, r4 - lsls r0, 16 - lsrs r0, 16 - bl AllocObjectPalette - mov r2, sp - adds r1, r2, r4 - strb r0, [r1] - adds r4, 0x1 - cmp r4, 0x2 - ble _08105CCC - movs r0, 0x80 - lsls r0, 6 - bl AllocZeroed - adds r1, r0, 0 - ldr r0, =0x020244d4 - ldr r0, [r0] - movs r2, 0xBE - lsls r2, 1 - adds r0, r2 - str r1, [r0] - ldr r0, =gUnknown_08C22610 - bl LZDecompressWram - movs r4, 0 -_08105D00: - ldr r5, =0x020244d4 - ldr r0, [r5] - movs r1, 0xBE - lsls r1, 1 - adds r0, r1 - lsls r1, r4, 6 - ldr r0, [r0] - adds r0, r1 - mov r2, sp - adds r1, r2, r4 - ldrb r1, [r1] - lsls r1, 20 - movs r2, 0x80 - lsls r2, 17 - adds r1, r2 - lsrs r1, 16 - movs r2, 0x20 - bl gpu_pal_apply - adds r4, 0x1 - cmp r4, 0x2 - ble _08105D00 - ldr r0, [r5] - movs r4, 0xBE - lsls r4, 1 - adds r0, r4 - ldr r0, [r0] - bl Free - ldr r0, [r5] - adds r0, r4 - movs r1, 0 - str r1, [r0] - adds r0, r6, 0 - bl move_anim_task_del - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105CB4 - - thumb_func_start sub_8105D60 -sub_8105D60: @ 8105D60 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r5, =gUnknown_08593950 - movs r4, 0x2 -_08105D6A: - ldrh r0, [r5] - bl FreeObjectPaletteByTag - adds r5, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _08105D6A - adds r0, r6, 0 - bl move_anim_task_del - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105D60 - - thumb_func_start sub_8105D88 -sub_8105D88: @ 8105D88 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r1, 24 - lsls r2, 24 - lsrs r3, r2, 24 - movs r0, 0x1 - ands r3, r0 - negs r0, r3 - orrs r0, r3 - asrs r0, 31 - movs r3, 0x20 - ands r0, r3 - ldrh r4, [r5, 0x4] - lsls r3, r4, 22 - lsrs r3, 22 - lsrs r1, 22 - adds r0, r1 - adds r3, r0 - ldr r1, =0x000003ff - adds r0, r1, 0 - ands r3, r0 - ldr r0, =0xfffffc00 - ands r0, r4 - orrs r0, r3 - strh r0, [r5, 0x4] - ldr r0, =gUnknown_08593950 - lsrs r2, 25 - lsls r2, 1 - adds r2, r0 - ldrh r0, [r2] - bl IndexOfObjectPaletteTag - lsls r0, 4 - ldrb r2, [r5, 0x5] - movs r1, 0xF - ands r1, r2 - orrs r1, r0 - strb r1, [r5, 0x5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105D88 - - thumb_func_start sub_8105DE8 -sub_8105DE8: @ 8105DE8 - push {r4-r6,lr} - adds r5, r0, 0 - movs r1, 0 - bl sub_80A69CC - ldr r6, =0x02038436 - ldrb r0, [r6] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08105E08 - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] -_08105E08: - ldr r4, =0x0203841e - ldrh r0, [r4, 0x8] - strh r0, [r5, 0x2E] - ldrb r0, [r6] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x4] - adds r0, r1 - strh r0, [r5, 0x32] - ldrb r0, [r6] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x6] - adds r0, r1 - strh r0, [r5, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r5, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r5, 0 - bl oamt_set_x3A_32 - ldrb r1, [r4, 0xA] - ldrb r2, [r4, 0xC] - adds r0, r5, 0 - bl sub_8105D88 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105DE8 - - thumb_func_start sub_8105E60 -sub_8105E60: @ 8105E60 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _08105E7A - adds r0, r4, 0 - movs r1, 0 - bl sub_80A69CC -_08105E7A: - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x8 - bl sine - strh r0, [r4, 0x24] - ldrh r2, [r4, 0x32] - lsls r0, r2, 16 - asrs r0, 24 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x7 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - subs r2, 0x80 - strh r2, [r4, 0x32] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x3C - bne _08105EAA - adds r0, r4, 0 - bl move_anim_8072740 -_08105EAA: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8105E60 - - thumb_func_start sub_8105EB0 -sub_8105EB0: @ 8105EB0 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - movs r6, 0xF0 - cmp r0, 0 - beq _08105EC4 - movs r6, 0x98 -_08105EC4: - movs r5, 0 - ldr r1, =0x02022e24 - strh r6, [r1] - ldr r4, =0x02022e26 - movs r0, 0xA0 - strh r0, [r4] - ldrh r1, [r1] - movs r0, 0x40 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x44 - bl SetGpuReg - ldr r1, =0x00003f1f - movs r0, 0x48 - bl SetGpuReg - ldr r1, =0x00003f3f - movs r0, 0x4A - bl SetGpuReg - movs r0, 0x50 - movs r1, 0xC8 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0x10 - bl SetGpuReg - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0x8] - strh r6, [r0, 0xA] - ldr r1, =sub_8105F30 - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105EB0 - - thumb_func_start sub_8105F30 -sub_8105F30: @ 8105F30 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r3, r1, r2 - ldrh r0, [r3, 0x8] - adds r4, r0, 0 - adds r4, 0xD - strh r4, [r3, 0x8] - ldrh r0, [r3, 0xA] - adds r2, r0, 0 - subs r2, 0xD - strh r2, [r3, 0xA] - lsls r1, r4, 16 - lsls r0, r2, 16 - cmp r1, r0 - blt _08105F70 - ldr r0, =0x02022e24 - movs r1, 0 - strh r1, [r0] - ldr r0, =sub_8105F84 - str r0, [r3] - b _08105F78 - .pool -_08105F70: - ldr r1, =0x02022e24 - lsls r0, r4, 8 - orrs r2, r0 - strh r2, [r1] -_08105F78: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105F30 - - thumb_func_start sub_8105F84 -sub_8105F84: @ 8105F84 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r1, r0, r1 - ldrh r0, [r1, 0x1C] - adds r0, 0x1 - movs r4, 0 - strh r0, [r1, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _08105FD8 - movs r0, 0x88 - strh r0, [r1, 0x1E] - movs r0, 0x50 - movs r1, 0x88 - bl SetGpuReg - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_80A75AC - ldr r2, =0x00007fff - movs r1, 0x10 - bl sub_80A2A20 - b _0810600C - .pool -_08105FD8: - cmp r0, 0x4 - ble _0810600C - ldr r0, =0x02022e24 - strh r4, [r0] - ldr r0, =0x02022e26 - strh r4, [r0] - ldr r4, =0x00003f3f - movs r0, 0x48 - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x4A - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - adds r0, r5, 0 - bl move_anim_task_del -_0810600C: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105F84 - - thumb_func_start sub_8106020 -sub_8106020: @ 8106020 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - movs r0, 0x1 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r1 - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _0810607C - movs r0, 0x1 - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_08593988 - adds r0, r5, 0 - bl sub_80A7CFC - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - movs r1, 0x4 - strh r1, [r0, 0x24] - b _081060A4 - .pool -_0810607C: - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r4, r0, r1 - ldrh r0, [r4, 0x24] - negs r0, r0 - strh r0, [r4, 0x24] - adds r0, r5, 0 - bl sub_80A7D34 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _081060A4 - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - adds r0, r6, 0 - bl move_anim_task_del -_081060A4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8106020 - - thumb_func_start sub_81060B0 -sub_81060B0: @ 81060B0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r1 - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _0810610C - movs r0, 0 - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_08593988 - adds r0, r5, 0 - bl sub_80A7CFC - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - movs r1, 0x4 - strh r1, [r0, 0x24] - b _08106134 - .pool -_0810610C: - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r4, r0, r1 - ldrh r0, [r4, 0x24] - negs r0, r0 - strh r0, [r4, 0x24] - adds r0, r5, 0 - bl sub_80A7D34 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08106134 - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - adds r0, r6, 0 - bl move_anim_task_del -_08106134: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81060B0 - - thumb_func_start sub_8106140 -sub_8106140: @ 8106140 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - movs r0, 0x5F - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x30] - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x34] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x36] - adds r0, r4, 0 - bl obj_translate_based_on_private_1_2_3_4 - ldr r0, =sub_810618C - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8106140 - - thumb_func_start sub_810618C -sub_810618C: @ 810618C - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - bne _081061B6 - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r1, 0xE - bl sine - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x38] - adds r0, 0x4 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x38] - b _081061BC -_081061B6: - adds r0, r4, 0 - bl move_anim_8072740 -_081061BC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810618C - - thumb_func_start sub_81061C4 -sub_81061C4: @ 81061C4 - push {r4,lr} - adds r4, r0, 0 - ldrh r2, [r4, 0x2E] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081061E8 - ldr r1, =0x0203841e - ldrh r0, [r1] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x32] - adds r0, r2, 0x1 - strh r0, [r4, 0x2E] - b _08106244 - .pool -_081061E8: - ldrh r0, [r4, 0x30] - ldrh r2, [r4, 0x36] - adds r0, r2 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - movs r1, 0x34 - ldrsh r0, [r4, r1] - movs r2, 0x32 - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x34] - adds r0, 0x3 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x34] - cmp r0, 0x64 - ble _08106236 - movs r0, 0x34 - ldrsh r1, [r4, r0] - lsrs r0, r1, 31 - adds r0, r1, r0 - asrs r0, 1 - lsls r0, 1 - subs r1, r0 - adds r3, r4, 0 - adds r3, 0x3E - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_08106236: - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0x78 - ble _08106244 - adds r0, r4, 0 - bl move_anim_8072740 -_08106244: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81061C4 - - thumb_func_start sub_810624C -sub_810624C: @ 810624C - push {lr} - ldr r2, =0x0203841e - ldrh r1, [r2] - strh r1, [r0, 0x20] - movs r1, 0xA0 - strh r1, [r0, 0x22] - ldrh r1, [r2, 0x4] - strh r1, [r0, 0x2E] - ldrh r1, [r2, 0x2] - strh r1, [r0, 0x30] - ldr r1, =sub_80A64B0 - str r1, [r0, 0x1C] - ldr r1, =sub_810627C - bl oamt_set_x3A_32 - pop {r0} - bx r0 - .pool - thumb_func_end sub_810624C - - thumb_func_start sub_810627C -sub_810627C: @ 810627C - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x32] - adds r0, r1 - strh r0, [r4, 0x32] - lsls r0, 16 - lsrs r0, 24 - negs r0, r0 - strh r0, [r4, 0x26] - movs r1, 0x34 - ldrsh r0, [r4, r1] - movs r1, 0x4 - bl sine - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x34] - adds r0, 0x3 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x26] - ldrh r1, [r4, 0x22] - adds r0, r1 - lsls r0, 16 - asrs r5, r0, 16 - cmp r5, 0x48 - bgt _081062E2 - movs r0, 0x34 - ldrsh r1, [r4, r0] - lsrs r0, r1, 31 - adds r0, r1, r0 - asrs r0, 1 - lsls r0, 1 - subs r1, r0 - adds r3, r4, 0 - adds r3, 0x3E - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - cmp r5, 0x40 - bgt _081062E2 - adds r0, r4, 0 - bl move_anim_8072740 -_081062E2: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_810627C - - thumb_func_start sub_81062E8 -sub_81062E8: @ 81062E8 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x3 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl lcd_bg_operations - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0810632A - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl lcd_bg_operations -_0810632A: - ldr r0, =0x02022e18 - movs r1, 0 - strh r1, [r0] - ldr r4, =0x02022e1a - strh r1, [r4] - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x16 - bl SetGpuReg - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08C232E0 - mov r2, sp - ldrh r2, [r2, 0xA] - bl sub_80A6CC0 - ldr r1, =gUnknown_08C23D78 - mov r0, sp - movs r2, 0 - bl sub_80A6D60 - ldr r0, =gUnknown_08C23D50 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - movs r2, 0x20 - bl decompress_palette - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81063A8 - str r1, [r0] - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81062E8 - - thumb_func_start sub_81063A8 -sub_81063A8: @ 81063A8 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x20 - ldrsh r0, [r0, r2] - adds r2, r1, 0 - cmp r0, 0x4 - bls _081063C6 - b _081064F0 -_081063C6: - lsls r0, 2 - ldr r1, =_081063D8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081063D8: - .4byte _081063EC - .4byte _08106430 - .4byte _08106452 - .4byte _08106496 - .4byte _081064BC -_081063EC: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - movs r5, 0 - strh r0, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _081064F0 - strh r5, [r4, 0x1C] - ldrh r1, [r4, 0x1E] - adds r1, 0x1 - strh r1, [r4, 0x1E] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x1E - ldrsh r0, [r4, r1] - cmp r0, 0x10 - bne _081064F0 - ldrh r0, [r4, 0x20] - adds r0, 0x1 - strh r0, [r4, 0x20] - strh r5, [r4, 0x1E] - b _081064F0 -_08106430: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r2 - ldrh r0, [r1, 0x1E] - adds r0, 0x1 - strh r0, [r1, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8D - bne _081064F0 - movs r0, 0x10 - strh r0, [r1, 0x1E] - ldrh r0, [r1, 0x20] - adds r0, 0x1 - strh r0, [r1, 0x20] - b _081064F0 -_08106452: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - strh r0, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _081064F0 - movs r0, 0 - strh r0, [r4, 0x1C] - ldrh r1, [r4, 0x1E] - subs r1, 0x1 - strh r1, [r4, 0x1E] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r2, 0x1E - ldrsh r1, [r4, r2] - cmp r1, 0 - bne _081064F0 - ldrh r0, [r4, 0x20] - adds r0, 0x1 - strh r0, [r4, 0x20] - strh r1, [r4, 0x1E] - b _081064F0 -_08106496: - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x9] - bl sub_80A6C68 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - b _081064F0 - .pool -_081064BC: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _081064D0 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0 - bl lcd_bg_operations -_081064D0: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - adds r0, r4, 0 - bl move_anim_task_del -_081064F0: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81063A8 - - thumb_func_start sub_81064F8 -sub_81064F8: @ 81064F8 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl lcd_bg_operations - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0810653A - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl lcd_bg_operations -_0810653A: - ldr r0, =0x02022e18 - movs r1, 0 - strh r1, [r0] - ldr r4, =0x02022e1a - strh r1, [r4] - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x16 - bl SetGpuReg - mov r0, sp - bl sub_80A6B30 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _08106578 - ldr r1, =gUnknown_08D93960 - b _0810658A - .pool -_08106578: - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0810659C - ldr r1, =gUnknown_08D93598 -_0810658A: - mov r0, sp - movs r2, 0 - bl sub_80A6D60 - b _081065A6 - .pool -_0810659C: - ldr r1, =gUnknown_08D9377C - mov r0, sp - movs r2, 0 - bl sub_80A6D60 -_081065A6: - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08C249F8 - mov r2, sp - ldrh r2, [r2, 0xA] - bl sub_80A6CC0 - ldr r0, =gUnknown_08C249D0 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - movs r2, 0x20 - bl decompress_palette - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81065EC - str r1, [r0] - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81064F8 - - thumb_func_start sub_81065EC -sub_81065EC: @ 81065EC - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x20 - ldrsh r0, [r0, r2] - adds r2, r1, 0 - cmp r0, 0x4 - bls _0810660A - b _08106730 -_0810660A: - lsls r0, 2 - ldr r1, =_0810661C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0810661C: - .4byte _08106630 - .4byte _08106674 - .4byte _08106696 - .4byte _081066DA - .4byte _081066FC -_08106630: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - movs r5, 0 - strh r0, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _08106730 - strh r5, [r4, 0x1C] - ldrh r1, [r4, 0x1E] - adds r1, 0x1 - strh r1, [r4, 0x1E] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x1E - ldrsh r0, [r4, r1] - cmp r0, 0xE - bne _08106730 - ldrh r0, [r4, 0x20] - adds r0, 0x1 - strh r0, [r4, 0x20] - strh r5, [r4, 0x1E] - b _08106730 -_08106674: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r2 - ldrh r0, [r1, 0x1E] - adds r0, 0x1 - strh r0, [r1, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x15 - bne _08106730 - movs r0, 0xE - strh r0, [r1, 0x1E] - ldrh r0, [r1, 0x20] - adds r0, 0x1 - strh r0, [r1, 0x20] - b _08106730 -_08106696: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - strh r0, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _08106730 - movs r0, 0 - strh r0, [r4, 0x1C] - ldrh r1, [r4, 0x1E] - subs r1, 0x1 - strh r1, [r4, 0x1E] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r2, 0x1E - ldrsh r1, [r4, r2] - cmp r1, 0 - bne _08106730 - ldrh r0, [r4, 0x20] - adds r0, 0x1 - strh r0, [r4, 0x20] - strh r1, [r4, 0x1E] - b _08106730 -_081066DA: - mov r0, sp - bl sub_80A6B30 - movs r0, 0x1 - bl sub_80A6C68 - movs r0, 0x2 - bl sub_80A6C68 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x20] - adds r0, 0x1 - strh r0, [r1, 0x20] -_081066FC: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _08106710 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0 - bl lcd_bg_operations -_08106710: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - adds r0, r4, 0 - bl move_anim_task_del -_08106730: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81065EC - - thumb_func_start sub_810673C -sub_810673C: @ 810673C - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x02038436 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x20] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x0203841e - ldrh r0, [r1] - strh r0, [r4, 0x2E] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x30] - ldrb r0, [r5] - bl sub_80A82E4 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x3C] - ldr r1, =sub_810679C - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810673C - - thumb_func_start sub_810679C -sub_810679C: @ 810679C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - subs r0, 0x40 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x7F - bhi _081067B2 - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - b _081067B6 -_081067B2: - ldrh r0, [r4, 0x3C] - subs r0, 0x1 -_081067B6: - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - movs r1, 0x30 - ldrsh r0, [r4, r1] - ldrh r1, [r4, 0x32] - lsls r1, 16 - asrs r1, 24 - bl sine - strh r0, [r4, 0x24] - movs r2, 0x30 - ldrsh r0, [r4, r2] - ldrh r1, [r4, 0x34] - lsls r1, 16 - asrs r1, 24 - bl cosine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x9 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - movs r3, 0x38 - ldrsh r2, [r4, r3] - cmp r2, 0 - beq _08106828 - cmp r2, 0x1 - bne _08106858 - ldr r1, =0xfffffc00 - adds r0, r1, 0 - ldrh r2, [r4, 0x32] - adds r0, r2 - strh r0, [r4, 0x32] - ldr r3, =0xffffff00 - adds r0, r3, 0 - ldrh r1, [r4, 0x34] - adds r0, r1 - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x2E - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _08106858 - movs r0, 0x2 - strh r0, [r4, 0x38] - b _08106868 - .pool -_08106828: - movs r3, 0x80 - lsls r3, 3 - adds r0, r3, 0 - ldrh r1, [r4, 0x32] - adds r0, r1 - strh r0, [r4, 0x32] - movs r3, 0x80 - lsls r3, 1 - adds r0, r3, 0 - ldrh r1, [r4, 0x34] - adds r0, r1 - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x2E - ldrsh r1, [r4, r3] - cmp r0, r1 - bne _08106858 - strh r2, [r4, 0x36] - movs r0, 0x1 - strh r0, [r4, 0x38] -_08106858: - ldr r0, =0x0203841e - ldrh r1, [r0, 0xE] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08106868 - adds r0, r4, 0 - bl move_anim_8072740 -_08106868: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810679C - - thumb_func_start sub_8106878 -sub_8106878: @ 8106878 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r4, =0x0203841e - movs r1, 0 - ldrsh r0, [r4, r1] - movs r1, 0xA - bl sine - strh r0, [r5, 0x2E] - movs r1, 0 - ldrsh r0, [r4, r1] - movs r1, 0x7 - bl cosine - strh r0, [r5, 0x30] - ldr r0, =sub_81068CC - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8106878 - - thumb_func_start sub_81068CC -sub_81068CC: @ 81068CC - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - ldrh r1, [r2, 0x24] - adds r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x30] - ldrh r3, [r2, 0x26] - adds r0, r3 - strh r0, [r2, 0x26] - movs r1, 0x20 - ldrsh r0, [r2, r1] - movs r3, 0x24 - ldrsh r1, [r2, r3] - adds r0, r1 - adds r0, 0x10 - movs r1, 0x88 - lsls r1, 1 - cmp r0, r1 - bhi _0810690A - movs r0, 0x22 - ldrsh r1, [r2, r0] - movs r3, 0x26 - ldrsh r0, [r2, r3] - adds r1, r0 - cmp r1, 0xA0 - bgt _0810690A - movs r0, 0x10 - negs r0, r0 - cmp r1, r0 - bge _08106910 -_0810690A: - adds r0, r2, 0 - bl move_anim_8072740 -_08106910: - pop {r0} - bx r0 - thumb_func_end sub_81068CC - - thumb_func_start sub_8106914 -sub_8106914: @ 8106914 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - ldrh r1, [r2, 0x24] - adds r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x30] - ldrh r3, [r2, 0x26] - adds r0, r3 - strh r0, [r2, 0x26] - ldrh r0, [r2, 0x34] - adds r1, r0, 0x1 - strh r1, [r2, 0x34] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x32 - ldrsh r1, [r2, r3] - cmp r0, r1 - blt _08106940 - adds r0, r2, 0 - bl move_anim_8072740 -_08106940: - pop {r0} - bx r0 - thumb_func_end sub_8106914 - - thumb_func_start sub_8106944 -sub_8106944: @ 8106944 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r4, =0x0203841e - movs r1, 0 - ldrsh r0, [r4, r1] - movs r1, 0xA - bl sine - strh r0, [r5, 0x2E] - movs r1, 0 - ldrsh r0, [r4, r1] - movs r1, 0x7 - bl cosine - strh r0, [r5, 0x30] - ldrh r0, [r4, 0x2] - strh r0, [r5, 0x32] - ldr r0, =sub_8106914 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8106944 - - thumb_func_start sub_810699C -sub_810699C: @ 810699C - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _081069B2 - adds r0, r2, 0 - bl move_anim_8072740 -_081069B2: - pop {r0} - bx r0 - thumb_func_end sub_810699C - - thumb_func_start sub_81069B8 -sub_81069B8: @ 81069B8 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r0, =sub_810699C - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81069B8 - - thumb_func_start sub_81069D0 -sub_81069D0: @ 81069D0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081069EE - ldr r0, =0x0203841e - ldrh r1, [r0] - ldrh r2, [r4, 0x20] - adds r1, r2 - strh r1, [r4, 0x20] - ldrh r0, [r0, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] -_081069EE: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r2, 0x2E - ldrsh r1, [r4, r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r5, r0, 1 - movs r0, 0xFF - ands r5, r0 - adds r0, r5, 0 - movs r1, 0x50 - bl sine - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x4F - bgt _08106A32 - adds r0, r5, 0 - movs r1, 0x50 - bl cosine - movs r2, 0x2E - ldrsh r1, [r4, r2] - lsrs r2, r1, 31 - adds r1, r2 - asrs r1, 1 - lsls r0, 16 - asrs r0, 24 - adds r1, r0 - strh r1, [r4, 0x26] -_08106A32: - movs r0, 0x2E - ldrsh r2, [r4, r0] - cmp r2, 0x5A - ble _08106A50 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - movs r0, 0x32 - ldrsh r1, [r4, r0] - lsrs r0, r1, 31 - adds r1, r0 - asrs r1, 1 - ldrh r0, [r4, 0x24] - subs r0, r1 - strh r0, [r4, 0x24] -_08106A50: - cmp r2, 0x64 - ble _08106A5A - adds r0, r4, 0 - bl move_anim_8072740 -_08106A5A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81069D0 - - thumb_func_start sub_8106A64 -sub_8106A64: @ 8106A64 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - movs r1, 0x34 - ldrsh r0, [r4, r1] - movs r1, 0x5 - bl sine - strh r0, [r4, 0x24] - movs r1, 0x38 - ldrsh r0, [r4, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x34] - adds r0, 0x3 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x34] - movs r1, 0x38 - ldrsh r0, [r4, r1] - cmp r0, 0x14 - ble _08106ABA - adds r1, r0, 0 - lsrs r0, r1, 31 - adds r0, r1, r0 - asrs r0, 1 - lsls r0, 1 - subs r1, r0 - adds r3, r4, 0 - adds r3, 0x3E - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_08106ABA: - movs r1, 0x38 - ldrsh r0, [r4, r1] - cmp r0, 0x1E - ble _08106AC8 - adds r0, r4, 0 - bl move_anim_8072740 -_08106AC8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8106A64 - - thumb_func_start sub_8106AD0 -sub_8106AD0: @ 8106AD0 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r2, [r4, 0x2E] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08106AF4 - ldr r1, =0x0203841e - ldrh r0, [r1] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x32] - adds r0, r2, 0x1 - strh r0, [r4, 0x2E] - b _08106B48 - .pool -_08106AF4: - ldrh r0, [r4, 0x30] - ldrh r2, [r4, 0x36] - adds r0, r2 - movs r5, 0 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - movs r1, 0x34 - ldrsh r0, [r4, r1] - movs r2, 0x32 - ldrsh r1, [r4, r2] - bl sine - adds r2, r0, 0 - strh r2, [r4, 0x26] - ldrh r0, [r4, 0x34] - adds r0, 0x3 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x34] - cmp r0, 0x46 - ble _08106B48 - ldr r0, =sub_8106A64 - str r0, [r4, 0x1C] - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r1, [r4, 0x22] - adds r0, r2, r1 - strh r0, [r4, 0x22] - strh r5, [r4, 0x24] - strh r5, [r4, 0x26] - bl GenerateRandomNumber2 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xB4 - bl __umodsi3 - strh r0, [r4, 0x34] -_08106B48: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8106AD0 - - thumb_func_start sub_8106B54 -sub_8106B54: @ 8106B54 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08106B8E - ldr r1, =0x0203841e - ldrh r0, [r1] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - ldrh r0, [r1, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnim - ldr r0, =0x02038437 - ldrb r0, [r0] - bl sub_80A82E4 - subs r0, 0x1 - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - movs r0, 0x1 - strh r0, [r4, 0x32] -_08106B8E: - ldrh r0, [r4, 0x32] - ldrh r2, [r4, 0x2E] - adds r0, r2 - strh r0, [r4, 0x2E] - movs r1, 0x2E - ldrsh r0, [r4, r1] - lsls r1, r0, 2 - adds r0, r1, 0 - cmp r1, 0 - bge _08106BA4 - adds r0, 0xFF -_08106BA4: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - strh r0, [r4, 0x30] - lsls r0, 16 - cmp r0, 0 - bge _08106BB6 - movs r0, 0 - strh r0, [r4, 0x30] -_08106BB6: - movs r0, 0x30 - ldrsh r2, [r4, r0] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _08106BC4 - adds r0, 0x3 -_08106BC4: - asrs r0, 2 - movs r1, 0x1E - subs r1, r0 - adds r0, r2, 0 - bl cosine - strh r0, [r4, 0x24] - movs r0, 0x30 - ldrsh r2, [r4, r0] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _08106BE0 - adds r0, 0x7 -_08106BE0: - asrs r0, 3 - movs r1, 0xA - subs r1, r0 - adds r0, r2, 0 - bl sine - strh r0, [r4, 0x26] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0x80 - ble _08106C04 - ldrh r1, [r4, 0x32] - movs r2, 0x32 - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _08106C04 - ldr r0, =0x0000ffff - strh r0, [r4, 0x32] -_08106C04: - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08106C18 - movs r2, 0x32 - ldrsh r0, [r4, r2] - cmp r0, 0 - bge _08106C18 - movs r0, 0x1 - strh r0, [r4, 0x32] -_08106C18: - ldrh r0, [r4, 0x34] - adds r1, r0, 0x1 - strh r1, [r4, 0x34] - subs r0, 0x9 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x46 - bls _08106C5C - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsrs r0, r1, 31 - adds r0, r1, r0 - asrs r0, 1 - lsls r0, 1 - subs r1, r0 - adds r3, r4, 0 - adds r3, 0x3E - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - b _08106C6A - .pool -_08106C5C: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_08106C6A: - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0x5A - ble _08106C78 - adds r0, r4, 0 - bl move_anim_8072740 -_08106C78: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8106B54 - - thumb_func_start sub_8106C80 -sub_8106C80: @ 8106C80 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08106CB4 - ldr r1, =0x0203841e - ldrh r0, [r1] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - ldrh r0, [r1, 0x2] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - ldrb r1, [r1, 0x4] - adds r0, r4, 0 - bl StartObjectImageAnim - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _08106CC8 - .pool -_08106CB4: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08106CC8 - adds r0, r4, 0 - bl move_anim_8072740 -_08106CC8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8106C80 - - thumb_func_start sub_8106CD0 -sub_8106CD0: @ 8106CD0 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r1, =0x0203841e - movs r2, 0x4 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _08106CEC - adds r0, r5, 0 - bl move_anim_8072740 - b _08106D50 - .pool -_08106CEC: - movs r2, 0 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _08106CFC - ldr r4, =0x02038436 - b _08106CFE - .pool -_08106CFC: - ldr r4, =0x02038437 -_08106CFE: - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r0, =0x0203841e - movs r2, 0x2 - ldrsh r1, [r0, r2] - adds r2, r0, 0 - cmp r1, 0 - bne _08106D34 - ldrh r0, [r5, 0x20] - adds r0, 0x20 - b _08106D38 - .pool -_08106D34: - ldrh r0, [r5, 0x20] - subs r0, 0x20 -_08106D38: - strh r0, [r5, 0x20] - ldrh r0, [r2, 0x4] - strh r0, [r5, 0x2E] - ldrh r1, [r2, 0x2] - strh r1, [r5, 0x30] - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl StartObjectImageAnim - ldr r0, =sub_8106D5C - str r0, [r5, 0x1C] -_08106D50: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8106CD0 - - thumb_func_start sub_8106D5C -sub_8106D5C: @ 8106D5C - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08106D8C - ldrh r0, [r2, 0x2E] - subs r0, 0x1 - strh r0, [r2, 0x2E] - lsls r0, 16 - cmp r0, 0 - beq _08106D86 - ldrh r1, [r2, 0x30] - lsls r1, 24 - lsrs r1, 24 - adds r0, r2, 0 - bl StartObjectImageAnim - b _08106D8C -_08106D86: - adds r0, r2, 0 - bl move_anim_8072740 -_08106D8C: - pop {r0} - bx r0 - thumb_func_end sub_8106D5C - - thumb_func_start sub_8106D90 -sub_8106D90: @ 8106D90 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =0x0203841e - ldrb r0, [r0] - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - ldr r2, =gUnknown_08593B98 - adds r0, r4, 0 - bl sub_80A7CFC - ldr r0, =sub_8106DD4 - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8106D90 - - thumb_func_start sub_8106DD4 -sub_8106DD4: @ 8106DD4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r0, r1 - bl sub_80A7D34 - lsls r0, 24 - cmp r0, 0 - bne _08106DF4 - adds r0, r4, 0 - bl move_anim_task_del -_08106DF4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8106DD4 - - thumb_func_start sub_8106E00 -sub_8106E00: @ 8106E00 - push {r4-r7,lr} - adds r5, r0, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08106E1C - ldr r0, =0x02038436 - b _08106E1E - .pool -_08106E1C: - ldr r0, =0x02038437 -_08106E1E: - ldrb r6, [r0] - adds r0, r6, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08106E38 - ldr r1, =0x0203841e - movs r2, 0x2 - ldrsh r0, [r1, r2] - negs r0, r0 - strh r0, [r1, 0x2] -_08106E38: - adds r0, r6, 0 - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - ldr r7, =0x0203841e - lsrs r0, 24 - ldrh r3, [r7, 0x2] - adds r0, r3 - movs r4, 0 - strh r0, [r5, 0x20] - adds r0, r6, 0 - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r7, 0x4] - adds r0, r1 - strh r0, [r5, 0x22] - strh r4, [r5, 0x2E] - ldrh r1, [r5, 0x20] - lsls r1, 3 - strh r1, [r5, 0x30] - lsls r0, 3 - strh r0, [r5, 0x32] - movs r2, 0x2 - ldrsh r0, [r7, r2] - lsls r0, 3 - cmp r0, 0 - bge _08106E78 - adds r0, 0x7 -_08106E78: - asrs r0, 3 - strh r0, [r5, 0x34] - movs r3, 0x4 - ldrsh r0, [r7, r3] - lsls r0, 3 - cmp r0, 0 - bge _08106E88 - adds r0, 0x7 -_08106E88: - asrs r0, 3 - strh r0, [r5, 0x36] - ldrh r2, [r5, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - movs r3, 0x6 - ldrsh r0, [r7, r3] - lsls r0, 4 - adds r1, r0 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x4] - ldr r0, =sub_8106EC8 - str r0, [r5, 0x1C] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8106E00 - - thumb_func_start sub_8106EC8 -sub_8106EC8: @ 8106EC8 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x34] - ldrh r1, [r2, 0x30] - adds r0, r1 - strh r0, [r2, 0x30] - ldrh r1, [r2, 0x36] - ldrh r3, [r2, 0x32] - adds r1, r3 - strh r1, [r2, 0x32] - lsls r0, 16 - asrs r0, 19 - strh r0, [r2, 0x20] - lsls r1, 16 - asrs r1, 19 - strh r1, [r2, 0x22] - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - ble _08106EFC - adds r0, r2, 0 - bl move_anim_8072740 -_08106EFC: - pop {r0} - bx r0 - thumb_func_end sub_8106EC8 - - thumb_func_start sub_8106F00 -sub_8106F00: @ 8106F00 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08106F22 - ldr r0, =0x0203841e - ldrh r1, [r0] - movs r0, 0x78 - subs r0, r1 - strh r0, [r4, 0x30] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_08106F22: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x30 - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _08106F40 - ldrb r0, [r4, 0x5] - lsrs r0, 4 - adds r0, 0x10 - movs r1, 0 - bl sub_80A750C -_08106F40: - movs r0, 0x2E - ldrsh r1, [r4, r0] - movs r2, 0x30 - ldrsh r0, [r4, r2] - adds r0, 0x50 - cmp r1, r0 - bne _08106F54 - adds r0, r4, 0 - bl move_anim_8072740 -_08106F54: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8106F00 - - thumb_func_start sub_8106F60 -sub_8106F60: @ 8106F60 - push {r4-r6,lr} - adds r6, r0, 0 - movs r1, 0x2E - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _08106F8E - movs r5, 0x78 - strh r5, [r6, 0x20] - ldr r4, =0x0203841e - movs r2, 0 - ldrsh r0, [r4, r2] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - subs r0, 0xF - strh r0, [r6, 0x22] - ldrb r1, [r4, 0x2] - adds r0, r6, 0 - bl StartObjectImageAnim - strh r5, [r6, 0x38] - ldrh r0, [r4, 0x4] - strh r0, [r6, 0x34] -_08106F8E: - ldrh r0, [r6, 0x2E] - adds r0, 0x1 - movs r5, 0 - strh r0, [r6, 0x2E] - movs r1, 0x2E - ldrsh r0, [r6, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r6, 0x30] - movs r2, 0x2E - ldrsh r0, [r6, r2] - lsls r4, r0, 1 - adds r4, r0 - ldrh r0, [r6, 0x34] - adds r4, r0 - movs r2, 0xFF - ldrh r0, [r6, 0x3A] - adds r0, 0xA - movs r1, 0xFF - ands r0, r1 - strh r0, [r6, 0x3A] - ands r4, r2 - adds r0, r4, 0 - movs r1, 0x64 - bl cosine - strh r0, [r6, 0x24] - adds r0, r4, 0 - movs r1, 0xA - bl sine - adds r4, r0, 0 - movs r1, 0x3A - ldrsh r0, [r6, r1] - movs r1, 0x4 - bl cosine - ldrh r2, [r6, 0x30] - adds r4, r2 - adds r0, r4 - strh r0, [r6, 0x26] - movs r0, 0x2E - ldrsh r1, [r6, r0] - movs r2, 0x38 - ldrsh r0, [r6, r2] - cmp r1, r0 - ble _0810700A - ldr r0, =sub_8107018 - str r0, [r6, 0x1C] - strh r5, [r6, 0x2E] - adds r0, r6, 0 - bl oamt_add_pos2_onto_pos1 - movs r0, 0x5 - strh r0, [r6, 0x32] - strh r5, [r6, 0x36] - strh r5, [r6, 0x34] - adds r0, r6, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim -_0810700A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8106F60 - - thumb_func_start sub_8107018 -sub_8107018: @ 8107018 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - ble _08107032 - movs r0, 0 - strh r0, [r1, 0x2E] - ldr r0, =sub_810703C - str r0, [r1, 0x1C] -_08107032: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8107018 - - thumb_func_start sub_810703C -sub_810703C: @ 810703C - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x32] - ldrh r2, [r4, 0x34] - adds r0, r1, r2 - strh r0, [r4, 0x34] - strh r0, [r4, 0x26] - adds r1, 0x1 - strh r1, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x30 - ble _08107066 - lsls r0, r1, 16 - cmp r0, 0 - ble _08107066 - ldrh r0, [r4, 0x36] - subs r1, r0, 0x5 - strh r1, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x36] -_08107066: - movs r1, 0x36 - ldrsh r0, [r4, r1] - cmp r0, 0x3 - ble _08107098 - movs r2, 0x32 - ldrsh r1, [r4, r2] - lsrs r0, r1, 31 - adds r0, r1, r0 - asrs r0, 1 - lsls r0, 1 - subs r1, r0 - adds r3, r4, 0 - adds r3, 0x3E - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - adds r0, r4, 0 - bl move_anim_8072740 -_08107098: - movs r1, 0x36 - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bne _081070A6 - adds r0, r4, 0 - bl move_anim_8072740 -_081070A6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810703C - - thumb_func_start sub_81070AC -sub_81070AC: @ 81070AC - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081070F8 - ldr r4, =0x02038436 - ldrb r1, [r4] - movs r0, 0x2 - eors r0, r1 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _081070F8 - ldrb r0, [r4] - adds r2, r5, 0 - adds r2, 0x20 - adds r3, r5, 0 - adds r3, 0x22 - movs r1, 0 - bl sub_80A8924 - ldrh r0, [r5, 0x22] - adds r0, 0x28 - strh r0, [r5, 0x22] - adds r0, r5, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - b _08107118 - .pool -_081070F8: - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x28 - strh r0, [r5, 0x22] -_08107118: - movs r0, 0xD - strh r0, [r5, 0x2E] - ldrh r0, [r5, 0x20] - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x22] - subs r0, 0x48 - strh r0, [r5, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r5, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r5, 0 - bl oamt_set_x3A_32 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81070AC - - thumb_func_start sub_8107144 -sub_8107144: @ 8107144 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x0203841e - ldr r1, =0x02038400 - ldr r1, [r1] - ldrb r2, [r1, 0x10] - movs r1, 0x1 - ands r1, r2 - strh r1, [r3, 0xE] - bl move_anim_task_del - pop {r0} - bx r0 - .pool - thumb_func_end sub_8107144 - - thumb_func_start update_fury_cutter_counter_copy -update_fury_cutter_counter_copy: @ 8107168 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x0203841e - ldr r1, =0x02038400 - ldr r1, [r1] - ldrb r1, [r1, 0x10] - strh r1, [r2, 0xE] - bl move_anim_task_del - pop {r0} - bx r0 - .pool - thumb_func_end update_fury_cutter_counter_copy - - thumb_func_start sub_8107188 -sub_8107188: @ 8107188 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _081071B0 - ldr r1, =0x0203841e - ldrh r0, [r1] - strh r0, [r5, 0xA] - ldrh r0, [r1, 0x2] - strh r0, [r5, 0xC] - ldrh r0, [r1, 0x4] - strh r0, [r5, 0xE] -_081071B0: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r2, 0x8 - ldrsh r0, [r5, r2] - movs r2, 0xC - ldrsh r1, [r5, r2] - bl __modsi3 - cmp r0, 0x1 - bne _081071F8 - bl GenerateRandomNumber2 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF0 - bl __umodsi3 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl GenerateRandomNumber2 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x50 - bl __umodsi3 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_08595020 - adds r1, r4, 0 - movs r3, 0x4 - bl AddObjectToFront -_081071F8: - movs r0, 0x8 - ldrsh r1, [r5, r0] - movs r2, 0xE - ldrsh r0, [r5, r2] - cmp r1, r0 - bne _0810720A - adds r0, r6, 0 - bl move_anim_task_del -_0810720A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8107188 - - thumb_func_start sub_810721C -sub_810721C: @ 810721C - ldr r1, =sub_8107228 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_810721C - - thumb_func_start sub_8107228 -sub_8107228: @ 8107228 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xD - bgt _08107246 - ldrh r0, [r2, 0x24] - adds r0, 0x1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x26] - adds r0, 0x4 - strh r0, [r2, 0x26] -_08107246: - adds r0, r2, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0810725A - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles -_0810725A: - pop {r0} - bx r0 - thumb_func_end sub_8107228 - - thumb_func_start sub_8107260 -sub_8107260: @ 8107260 - push {r4-r6,lr} - adds r6, r0, 0 - ldr r5, =0x02038436 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08107290 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x0203841e - ldrh r1, [r4] - subs r0, r1 - b _081072A2 - .pool -_08107290: - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - ldr r4, =0x0203841e - lsrs r0, 24 - ldrh r1, [r4] - adds r0, r1 -_081072A2: - strh r0, [r6, 0x20] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r4, [r4, 0x2] - adds r0, r4 - strh r0, [r6, 0x22] - adds r2, r6, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _081072D8 - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] -_081072D8: - ldr r5, =0x0203841e - ldrh r0, [r5, 0xC] - strh r0, [r6, 0x2E] - ldrh r0, [r6, 0x20] - strh r0, [r6, 0x30] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x32] - ldrh r0, [r6, 0x22] - strh r0, [r6, 0x34] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x36] - adds r0, r6, 0 - bl obj_translate_based_on_private_1_2_3_4 - ldr r0, =DummyObjectCallback - bl object_new_hidden_with_callback - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - strh r4, [r6, 0x38] - ldrb r0, [r5, 0x8] - movs r2, 0x4 - ldrsh r1, [r5, r2] - bl sine - ldrh r1, [r6, 0x20] - subs r1, r0 - strh r1, [r6, 0x20] - ldrb r0, [r5, 0x8] - movs r2, 0x6 - ldrsh r1, [r5, r2] - bl cosine - ldrh r1, [r6, 0x22] - subs r1, r0 - strh r1, [r6, 0x22] - ldr r0, =0x02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r5, 0x4] - strh r0, [r1, 0x2E] - ldrh r0, [r5, 0x6] - strh r0, [r1, 0x30] - ldrh r0, [r5, 0xA] - strh r0, [r1, 0x32] - ldrb r0, [r5, 0x8] - lsls r0, 8 - strh r0, [r1, 0x34] - ldrh r0, [r5, 0xC] - strh r0, [r1, 0x36] - ldr r1, =sub_8107380 - str r1, [r6, 0x1C] - adds r0, r6, 0 - bl _call_via_r1 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8107260 - - thumb_func_start sub_8107380 -sub_8107380: @ 8107380 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r5, r0, 0 - ldrh r1, [r5, 0x38] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r7, r0, r2 - ldrh r4, [r7, 0x36] - lsls r4, 24 - lsrs r4, 24 - ldrh r0, [r7, 0x34] - mov r8, r0 - movs r0, 0x1 - strh r0, [r5, 0x2E] - adds r0, r5, 0 - bl sub_80A6F3C - mov r1, r8 - lsrs r6, r1, 8 - movs r0, 0x2E - ldrsh r1, [r7, r0] - adds r0, r6, 0 - bl sine - ldrh r1, [r5, 0x24] - adds r0, r1 - strh r0, [r5, 0x24] - movs r0, 0x30 - ldrsh r1, [r7, r0] - adds r0, r6, 0 - bl cosine - ldrh r1, [r5, 0x26] - adds r0, r1 - strh r0, [r5, 0x26] - ldrh r0, [r7, 0x32] - mov r1, r8 - adds r1, r0 - strh r1, [r7, 0x34] - subs r4, 0x1 - lsls r4, 24 - lsrs r4, 24 - cmp r4, 0 - beq _081073EC - strh r4, [r7, 0x36] - b _081073F6 - .pool -_081073EC: - ldr r0, =sub_8107408 - str r0, [r5, 0x1C] - adds r0, r7, 0 - bl RemoveObjectAndFreeTiles -_081073F6: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8107380 - - thumb_func_start sub_8107408 -sub_8107408: @ 8107408 - push {lr} - adds r3, r0, 0 - adds r3, 0x2C - ldrb r2, [r3] - movs r1, 0x41 - negs r1, r1 - ands r1, r2 - strb r1, [r3] - ldr r1, =sub_80A67D8 - str r1, [r0, 0x1C] - ldr r1, =sub_8107430 - bl oamt_set_x3A_32 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8107408 - - thumb_func_start sub_8107430 -sub_8107430: @ 8107430 - push {lr} - movs r1, 0xA - strh r1, [r0, 0x2E] - ldr r1, =sub_80A64B0 - str r1, [r0, 0x1C] - ldr r1, =move_anim_8074EE0 - bl oamt_set_x3A_32 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8107430 - - thumb_func_start sub_810744C -sub_810744C: @ 810744C - push {r4-r7,lr} - adds r5, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810747C - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - negs r0, r0 - lsls r0, 16 - lsrs r6, r0, 16 - adds r7, r1, 0 - b _08107482 - .pool -_0810747C: - ldr r0, =0x0203841e - ldrh r6, [r0, 0x4] - adds r7, r0, 0 -_08107482: - ldrh r0, [r7, 0x8] - strh r0, [r5, 0x2E] - ldrh r0, [r5, 0x20] - strh r0, [r5, 0x30] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, r6 - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x22] - strh r0, [r5, 0x34] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r7, [r7, 0x6] - adds r0, r7 - strh r0, [r5, 0x36] - adds r0, r5, 0 - bl obj_translate_based_on_private_1_2_3_4 - ldr r0, =sub_81074E4 - str r0, [r5, 0x1C] - adds r2, r5, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r1, [r5, 0x1C] - adds r0, r5, 0 - bl _call_via_r1 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810744C - - thumb_func_start sub_81074E4 -sub_81074E4: @ 81074E4 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0203841e - ldrh r1, [r0, 0xE] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08107506 - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnim - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] -_08107506: - adds r0, r4, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - beq _08107518 - adds r0, r4, 0 - bl move_anim_8072740 -_08107518: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81074E4 - - thumb_func_start sub_8107528 -sub_8107528: @ 8107528 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - ldr r0, =0x0203841e - ldrh r0, [r0] - strh r0, [r4, 0x8] - ldr r0, =0x0000279c - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 20 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - strh r0, [r4, 0xC] - ldr r0, =sub_810756C - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8107528 - - thumb_func_start sub_810756C -sub_810756C: @ 810756C - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r1 - ldrh r0, [r2, 0x1C] - adds r0, 0x1 - strh r0, [r2, 0x1C] - lsls r0, 16 - asrs r0, 16 - mov r12, r1 - cmp r0, 0x3 - bne _081075BE - movs r0, 0 - strh r0, [r2, 0x1C] - ldrh r0, [r2, 0xC] - adds r0, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r1, =0x02037b14 - lsls r0, r5, 1 - adds r0, r1 - ldrh r6, [r0] - adds r7, r1, 0 - adds r3, r0, 0x2 - movs r1, 0x6 - adds r2, r0, 0 -_081075A8: - ldrh r0, [r3] - strh r0, [r2] - adds r3, 0x2 - adds r2, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _081075A8 - adds r0, r5, 0x7 - lsls r0, 1 - adds r0, r7 - strh r6, [r0] -_081075BE: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - add r0, r12 - ldrh r1, [r0, 0x1E] - adds r1, 0x1 - strh r1, [r0, 0x1E] - lsls r1, 16 - asrs r1, 16 - movs r2, 0x8 - ldrsh r0, [r0, r2] - cmp r1, r0 - bne _081075DE - adds r0, r4, 0 - bl move_anim_task_del -_081075DE: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810756C - - thumb_func_start sub_81075EC -sub_81075EC: @ 81075EC - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - movs r0, 0x1E - strh r0, [r5, 0x2E] - ldrh r0, [r5, 0x20] - strh r0, [r5, 0x30] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x22] - strh r0, [r5, 0x34] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x36] - adds r0, r5, 0 - bl obj_translate_based_on_private_1_2_3_4 - movs r0, 0x2E - ldrsh r1, [r5, r0] - movs r0, 0xD2 - lsls r0, 8 - bl __divsi3 - strh r0, [r5, 0x38] - ldr r0, =0x0203841e - ldrh r2, [r0, 0x6] - strh r2, [r5, 0x3C] - ldrh r1, [r0, 0xE] - movs r3, 0xE - ldrsh r0, [r0, r3] - cmp r0, 0x7F - ble _0810765C - adds r0, r1, 0 - subs r0, 0x7F - lsls r0, 8 - strh r0, [r5, 0x3A] - negs r0, r2 - strh r0, [r5, 0x3C] - b _08107660 - .pool -_0810765C: - lsls r0, r1, 8 - strh r0, [r5, 0x3A] -_08107660: - ldr r1, =sub_8107674 - str r1, [r5, 0x1C] - adds r0, r5, 0 - bl _call_via_r1 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81075EC - - thumb_func_start sub_8107674 -sub_8107674: @ 8107674 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - beq _08107688 - adds r0, r4, 0 - bl move_anim_8072740 -_08107688: - ldrh r0, [r4, 0x3A] - lsls r0, 16 - asrs r0, 24 - movs r2, 0x3C - ldrsh r1, [r4, r2] - bl sine - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - movs r2, 0x3A - ldrsh r0, [r4, r2] - movs r2, 0x38 - ldrsh r1, [r4, r2] - adds r0, r1 - asrs r0, 8 - cmp r0, 0x7F - ble _081076B8 - movs r0, 0 - strh r0, [r4, 0x3A] - ldrh r0, [r4, 0x3C] - negs r0, r0 - strh r0, [r4, 0x3C] - b _081076C0 -_081076B8: - ldrh r0, [r4, 0x38] - ldrh r1, [r4, 0x3A] - adds r0, r1 - strh r0, [r4, 0x3A] -_081076C0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8107674 - - thumb_func_start sub_81076C8 -sub_81076C8: @ 81076C8 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r3, =0x0203841e - ldrh r0, [r3] - movs r2, 0 - strh r0, [r1, 0x8] - strh r2, [r3, 0xE] - ldr r0, =sub_81076F4 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_81076C8 - - thumb_func_start sub_81076F4 -sub_81076F4: @ 81076F4 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =0x0203841e - ldrh r0, [r2, 0xE] - adds r0, 0x3 - movs r1, 0xFF - ands r0, r1 - strh r0, [r2, 0xE] - ldr r1, =0x03005e00 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x8] - subs r1, 0x1 - strh r1, [r0, 0x8] - lsls r1, 16 - cmp r1, 0 - bne _08107722 - adds r0, r3, 0 - bl move_anim_task_del -_08107722: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81076F4 - - thumb_func_start sub_8107730 -sub_8107730: @ 8107730 - push {r4-r7,lr} - adds r4, r0, 0 - ldr r7, =0x02038436 - ldrb r0, [r7] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x20] - ldrb r0, [r7] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - ldr r6, =0x0000fff6 - strh r6, [r4, 0x26] - ldrb r0, [r7] - bl sub_80A82E4 - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0810778A - ldrb r0, [r7] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08107784 - movs r0, 0xA - strh r0, [r4, 0x24] - b _0810778C - .pool -_08107784: - strh r6, [r4, 0x24] - subs r0, r5, 0x2 - b _0810778E -_0810778A: - strh r6, [r4, 0x24] -_0810778C: - adds r0, r5, 0x2 -_0810778E: - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - ldr r0, =sub_81077A4 - str r0, [r4, 0x1C] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8107730 - - thumb_func_start sub_81077A4 -sub_81077A4: @ 81077A4 - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _081077BA - adds r0, r2, 0 - bl move_anim_8072740 -_081077BA: - pop {r0} - bx r0 - thumb_func_end sub_81077A4 - - thumb_func_start sub_81077C0 -sub_81077C0: @ 81077C0 - push {r4-r7,lr} - adds r6, r0, 0 - ldr r5, =0x02038436 - ldrb r0, [r5] - bl battle_side_get_owner - adds r4, r0, 0 - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _0810780A - ldr r4, =0x0203841e - movs r1, 0 - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4] - ldrb r0, [r5] - bl battle_get_per_side_status - lsls r0, 24 - cmp r0, 0 - beq _08107802 - ldrb r0, [r5] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0810780A -_08107802: - movs r1, 0 - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4] -_0810780A: - ldr r5, =0x0203841e - movs r1, 0xA - ldrsh r0, [r5, r1] - movs r1, 0xFF - lsls r1, 8 - ands r0, r1 - movs r1, 0 - cmp r0, 0 - bne _0810781E - movs r1, 0x1 -_0810781E: - ldrb r0, [r5, 0xA] - movs r7, 0x1 - cmp r0, 0 - bne _08107828 - movs r7, 0x3 -_08107828: - adds r0, r6, 0 - bl sub_80A69CC - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08107842 - ldrh r0, [r5, 0x4] - negs r0, r0 - strh r0, [r5, 0x4] -_08107842: - ldrh r0, [r5, 0x8] - strh r0, [r6, 0x2E] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r5, 0x4] - adds r0, r1 - strh r0, [r6, 0x32] - ldrb r0, [r4] - adds r1, r7, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r5, [r5, 0x6] - adds r0, r5 - strh r0, [r6, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r6, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r6, 0 - bl oamt_set_x3A_32 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81077C0 - - thumb_func_start sub_8107894 -sub_8107894: @ 8107894 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A6980 - ldr r0, =0x0203841e - ldrh r1, [r0, 0x8] - strh r1, [r4, 0x2E] - ldrh r0, [r0, 0x4] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x22] - adds r1, r0 - strh r1, [r4, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r4, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8107894 - - thumb_func_start sub_81078D0 -sub_81078D0: @ 81078D0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0203841e - movs r1, 0x6 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _081078EC - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80A6980 - b _081078F4 - .pool -_081078EC: - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80A69CC -_081078F4: - ldr r0, =0x0203841e - ldrh r0, [r0, 0x4] - strh r0, [r4, 0x3C] - ldr r0, =sub_810790C - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81078D0 - - thumb_func_start sub_810790C -sub_810790C: @ 810790C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0xB - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x2E] - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r1, 0x4 - bl sine - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x30] - adds r0, 0x30 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 - negs r0, r0 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x3C] - subs r0, 0x1 - strh r0, [r4, 0x3C] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0810794C - adds r0, r4, 0 - bl move_anim_8072740 -_0810794C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810790C - - thumb_func_start sub_8107954 -sub_8107954: @ 8107954 - 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 - mov r10, r0 - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0 - movs r2, 0x1 - bl lcd_bg_operations - mov r0, sp - bl sub_80A6B30 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _081079E0 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl lcd_bg_operations - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081079D0 - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08D95E00 - bl sub_80A6D48 - b _081079EA - .pool -_081079D0: - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08D960D0 - bl sub_80A6D48 - b _081079EA - .pool -_081079E0: - ldr r1, =gUnknown_08D963A4 - mov r0, sp - movs r2, 0x1 - bl sub_80A6D60 -_081079EA: - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08D94AB8 - mov r2, sp - ldrh r2, [r2, 0xA] - bl sub_80A6CC0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08107A24 - ldr r0, =gUnknown_08D95DD8 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - movs r2, 0x20 - bl decompress_palette - b _08107A32 - .pool -_08107A24: - ldr r0, =gUnknown_08D8FB9C - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - movs r2, 0x20 - bl decompress_palette -_08107A32: - ldr r0, =sub_8107D58 - ldr r4, =0x03005e00 - mov r2, r10 - lsls r5, r2, 2 - adds r1, r5, r2 - lsls r1, 3 - adds r6, r1, r4 - ldrb r1, [r6, 0x7] - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r0, 0 - mov r9, r0 - mov r1, r8 - strh r1, [r6, 0x26] - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r7, r0, r4 - mov r0, r9 - strh r0, [r7, 0x8] - movs r0, 0x80 - lsls r0, 5 - strh r0, [r7, 0xA] - strh r0, [r7, 0xC] - bl sub_80A4DF0 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _08107AB4 - ldr r1, =0x0000ffb0 - adds r0, r1, 0 - ldr r2, =0x02022e18 - strh r0, [r2] - adds r1, 0x20 - adds r0, r1, 0 - ldr r2, =0x02022e1a - strh r0, [r2] - movs r0, 0x2 - strh r0, [r6, 0x8] - movs r0, 0x1 - strh r0, [r6, 0xA] - mov r0, r9 - strh r0, [r7, 0xE] - b _08107B0E - .pool -_08107AB4: - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1 - bne _08107AF8 - ldr r2, =0x0000ff20 - adds r0, r2, 0 - ldr r2, =0x02022e18 - strh r0, [r2] - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 - ldr r2, =0x02022e1a - strh r0, [r2] - movs r0, 0x2 - strh r0, [r6, 0x8] - ldr r0, =0x0000ffff - strh r0, [r6, 0xA] - strh r1, [r7, 0xE] - b _08107B0E - .pool -_08107AF8: - ldr r0, =0x02022e18 - strh r4, [r0] - ldr r1, =0x0000ffd0 - adds r0, r1, 0 - ldr r2, =0x02022e1a - strh r0, [r2] - ldr r0, =0x0000fffe - strh r0, [r6, 0x8] - movs r0, 0x1 - strh r0, [r6, 0xA] - strh r4, [r7, 0xE] -_08107B0E: - ldr r0, =0x02022e18 - ldrh r1, [r0] - movs r0, 0x14 - bl SetGpuReg - ldr r2, =0x02022e1a - ldrh r1, [r2] - movs r0, 0x16 - bl SetGpuReg - ldr r1, =0x03005e00 - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r1, r0, r1 - movs r2, 0xE - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _08107B54 - movs r0, 0x30 - strh r0, [r1, 0x10] - movs r0, 0x70 - b _08107B58 - .pool -_08107B54: - movs r0, 0 - strh r0, [r1, 0x10] -_08107B58: - strh r0, [r1, 0x12] - ldr r1, =0x03005e00 - mov r2, r10 - adds r0, r5, r2 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1 - strh r1, [r0, 0x14] - ldr r1, =sub_8107B84 - str 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_8107954 - - thumb_func_start sub_8107B84 -sub_8107B84: @ 8107B84 - push {r4-r7,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x02022e18 - ldr r2, =0x02022e1a - ldr r0, =0x03005e00 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - ldrh r0, [r4, 0x8] - ldrh r3, [r1] - adds r0, r3 - strh r0, [r1] - ldrh r0, [r4, 0xA] - ldrh r1, [r2] - adds r0, r1 - strh r0, [r2] - mov r0, sp - bl sub_80A6B30 - ldrh r0, [r4, 0xA] - ldrh r3, [r4, 0xC] - adds r0, r3 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x12] - adds r0, 0x1 - strh r0, [r4, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _08107C18 - ldr r1, =0x02037b14 - mov r0, sp - ldrb r0, [r0, 0x8] - lsls r0, 4 - adds r0, 0x7 - lsls r0, 1 - adds r0, r1 - ldrh r6, [r0] - movs r2, 0x6 - adds r7, r1, 0 - adds r3, r7, 0 - mov r4, sp -_08107BDE: - ldrb r0, [r4, 0x8] - lsls r0, 4 - adds r1, r2, 0x1 - adds r0, r1 - lsls r1, r0, 1 - adds r1, r3 - subs r0, 0x1 - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - strh r0, [r1] - subs r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - bne _08107BDE - mov r0, sp - ldrb r0, [r0, 0x8] - lsls r0, 4 - adds r0, 0x1 - lsls r0, 1 - adds r0, r7 - strh r6, [r0] - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - strh r2, [r0, 0x12] -_08107C18: - ldr r1, =0x03005e00 - lsls r2, r5, 2 - adds r0, r2, r5 - lsls r0, 3 - adds r3, r0, r1 - ldrh r0, [r3, 0x14] - adds r0, 0x1 - strh r0, [r3, 0x14] - lsls r0, 16 - asrs r0, 16 - adds r4, r1, 0 - adds r6, r2, 0 - cmp r0, 0x1 - ble _08107C86 - movs r0, 0 - strh r0, [r3, 0x14] - ldrh r0, [r3, 0xE] - adds r2, r0, 0x1 - strh r2, [r3, 0xE] - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, 0xD - bgt _08107C62 - movs r1, 0x26 - ldrsh r0, [r3, r1] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r4 - movs r0, 0x10 - subs r0, r2 - lsls r0, 8 - orrs r2, r0 - strh r2, [r1, 0xA] - ldrh r0, [r3, 0x10] - adds r0, 0x1 - strh r0, [r3, 0x10] -_08107C62: - movs r1, 0xE - ldrsh r0, [r3, r1] - cmp r0, 0x36 - ble _08107C86 - ldrh r2, [r3, 0x10] - subs r2, 0x1 - strh r2, [r3, 0x10] - movs r1, 0x26 - ldrsh r0, [r3, r1] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r4 - movs r0, 0x10 - subs r0, r2 - lsls r0, 8 - orrs r2, r0 - strh r2, [r1, 0xA] -_08107C86: - adds r0, r6, r5 - lsls r0, 3 - adds r2, r0, r4 - movs r3, 0x26 - ldrsh r1, [r2, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - ldrh r0, [r0, 0xA] - movs r3, 0x1F - ands r3, r0 - cmp r3, 0 - bne _08107CA8 - strh r3, [r2, 0x8] - ldr r0, =sub_8107CC4 - str r0, [r2] -_08107CA8: - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8107B84 - - thumb_func_start sub_8107CC4 -sub_8107CC4: @ 8107CC4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r7, =0x02022e18 - ldr r0, =0x02022e1a - mov r8, r0 - ldr r6, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r6 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08107D08 - movs r0, 0x1 - bl sub_80A6C68 - movs r0, 0x2 - bl sub_80A6C68 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _08107D4A - .pool -_08107D08: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _08107D1C - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0 - bl lcd_bg_operations -_08107D1C: - movs r0, 0 - strh r0, [r7] - mov r1, r8 - strh r0, [r1] - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - ldr r1, =0x0000ffff - strh r1, [r0, 0x26] - adds r0, r5, 0 - bl move_anim_task_del -_08107D4A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8107CC4 - - thumb_func_start sub_8107D58 -sub_8107D58: @ 8107D58 - 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, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _08107D74 - b _08107EAC -_08107D74: - cmp r0, 0x1 - bgt _08107D84 - cmp r0, 0 - beq _08107D8C - b _08108022 - .pool -_08107D84: - cmp r0, 0x2 - bne _08107D8A - b _08107F78 -_08107D8A: - b _08108022 -_08107D8C: - movs r3, 0 - movs r2, 0x10 - ldrsh r0, [r4, r2] - ldr r1, =0x02038c28 - mov r12, r1 - cmp r3, r0 - bge _08107DCA - mov r7, r12 - movs r5, 0xF0 - lsls r5, 3 - add r5, r12 - ldr r6, =0x0000ffff -_08107DA4: - lsls r2, r3, 16 - asrs r2, 16 - lsls r1, r2, 1 - adds r3, r1, r7 - adds r1, r5 - ldrh r0, [r4, 0xC] - strh r0, [r1] - ldrh r1, [r4, 0xC] - adds r0, r6, 0 - ands r0, r1 - strh r0, [r3] - adds r2, 0x1 - lsls r2, 16 - lsrs r3, r2, 16 - asrs r2, 16 - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r2, r0 - blt _08107DA4 -_08107DCA: - ldrh r3, [r4, 0x10] - lsls r2, r3, 16 - asrs r1, r2, 16 - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bge _08107E04 - ldr r5, =0x02038c28 - movs r0, 0xF0 - lsls r0, 3 - adds r6, r5, r0 - ldr r7, =0x0000ffff -_08107DE2: - asrs r2, 16 - lsls r1, r2, 1 - adds r3, r1, r5 - adds r1, r6 - ldrh r0, [r4, 0xA] - strh r0, [r1] - ldrh r1, [r4, 0xA] - adds r0, r7, 0 - ands r0, r1 - strh r0, [r3] - adds r2, 0x1 - lsls r2, 16 - asrs r1, r2, 16 - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - blt _08107DE2 -_08107E04: - ldrh r3, [r4, 0x12] - lsls r2, r3, 16 - asrs r0, r2, 16 - cmp r0, 0x9F - bgt _08107E3A - ldr r5, =0x02038c28 - movs r0, 0xF0 - lsls r0, 3 - adds r6, r5, r0 - ldr r7, =0x0000ffff -_08107E18: - asrs r2, 16 - lsls r1, r2, 1 - adds r3, r1, r5 - adds r1, r6 - ldrh r0, [r4, 0xC] - strh r0, [r1] - ldrh r1, [r4, 0xC] - adds r0, r7, 0 - ands r0, r1 - strh r0, [r3] - adds r2, 0x1 - lsls r2, 16 - lsrs r3, r2, 16 - lsls r2, r3, 16 - asrs r0, r2, 16 - cmp r0, 0x9F - ble _08107E18 -_08107E3A: - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08107E64 - lsls r0, r3, 16 - asrs r0, 15 - mov r3, r12 - adds r2, r0, r3 - movs r1, 0xF0 - lsls r1, 3 - add r1, r12 - adds r0, r1 - ldrh r1, [r4, 0xA] - strh r1, [r0] - ldrh r0, [r4, 0xA] - b _08107E7A - .pool -_08107E64: - lsls r0, r3, 16 - asrs r0, 15 - mov r1, r12 - adds r2, r0, r1 - movs r1, 0xF0 - lsls r1, 3 - add r1, r12 - adds r0, r1 - ldrh r1, [r4, 0xC] - strh r1, [r0] - ldrh r0, [r4, 0xC] -_08107E7A: - strh r0, [r2] - ldr r0, =0x04000052 - str r0, [sp] - ldr r0, =0xa2600001 - str r0, [sp, 0x4] - mov r1, sp - movs r2, 0 - movs r0, 0x1 - strb r0, [r1, 0x8] - mov r0, sp - strb r2, [r0, 0x9] - ldr r0, [sp] - ldr r1, [sp, 0x4] - ldr r2, [sp, 0x8] - bl sub_80BA038 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _08108022 - .pool -_08107EAC: - movs r2, 0xE - ldrsh r1, [r4, r2] - cmp r1, 0 - bne _08107EC4 - ldrh r0, [r4, 0x10] - subs r0, 0x1 - strh r0, [r4, 0x10] - lsls r0, 16 - cmp r0, 0 - bgt _08107ED8 - strh r1, [r4, 0x10] - b _08107ED2 -_08107EC4: - ldrh r0, [r4, 0x12] - adds r0, 0x1 - strh r0, [r4, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6F - ble _08107ED8 -_08107ED2: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_08107ED8: - movs r3, 0 - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r3, r0 - bge _08107F0C - ldr r6, =0x02038c28 - ldr r5, =0x02039b28 -_08107EE6: - lsls r1, r3, 16 - asrs r1, 16 - lsls r3, r1, 1 - ldrb r2, [r5, 0x14] - lsls r0, r2, 4 - subs r0, r2 - lsls r0, 7 - adds r3, r0 - adds r3, r6 - ldrh r0, [r4, 0xC] - strh r0, [r3] - adds r1, 0x1 - lsls r1, 16 - lsrs r3, r1, 16 - asrs r1, 16 - movs r2, 0x10 - ldrsh r0, [r4, r2] - cmp r1, r0 - blt _08107EE6 -_08107F0C: - ldrh r3, [r4, 0x10] - lsls r2, r3, 16 - asrs r1, r2, 16 - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bge _08107F40 - ldr r6, =0x02038c28 - ldr r5, =0x02039b28 -_08107F1E: - asrs r3, r2, 16 - lsls r2, r3, 1 - ldrb r1, [r5, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r2, r0 - adds r2, r6 - ldrh r0, [r4, 0xA] - strh r0, [r2] - adds r3, 0x1 - lsls r2, r3, 16 - asrs r1, r2, 16 - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - blt _08107F1E -_08107F40: - ldrh r3, [r4, 0x12] - lsls r1, r3, 16 - asrs r0, r1, 16 - cmp r0, 0x9F - bgt _08108022 - ldr r6, =0x02038c28 - ldr r5, =0x02039b28 -_08107F4E: - asrs r3, r1, 16 - lsls r2, r3, 1 - ldrb r1, [r5, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r2, r0 - adds r2, r6 - ldrh r0, [r4, 0xC] - strh r0, [r2] - adds r3, 0x1 - lsls r1, r3, 16 - asrs r0, r1, 16 - cmp r0, 0x9F - ble _08107F4E - b _08108022 - .pool -_08107F78: - movs r3, 0 - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r3, r0 - bge _08107FAC - ldr r6, =0x02038c28 - ldr r5, =0x02039b28 -_08107F86: - lsls r1, r3, 16 - asrs r1, 16 - lsls r3, r1, 1 - ldrb r2, [r5, 0x14] - lsls r0, r2, 4 - subs r0, r2 - lsls r0, 7 - adds r3, r0 - adds r3, r6 - ldrh r0, [r4, 0xC] - strh r0, [r3] - adds r1, 0x1 - lsls r1, 16 - lsrs r3, r1, 16 - asrs r1, 16 - movs r2, 0x10 - ldrsh r0, [r4, r2] - cmp r1, r0 - blt _08107F86 -_08107FAC: - ldrh r3, [r4, 0x10] - lsls r2, r3, 16 - asrs r1, r2, 16 - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - bge _08107FE0 - ldr r6, =0x02038c28 - ldr r5, =0x02039b28 -_08107FBE: - asrs r3, r2, 16 - lsls r2, r3, 1 - ldrb r1, [r5, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r2, r0 - adds r2, r6 - ldrh r0, [r4, 0xA] - strh r0, [r2] - adds r3, 0x1 - lsls r2, r3, 16 - asrs r1, r2, 16 - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - blt _08107FBE -_08107FE0: - ldrh r3, [r4, 0x12] - lsls r1, r3, 16 - asrs r0, r1, 16 - cmp r0, 0x9F - bgt _0810800C - ldr r6, =0x02038c28 - ldr r5, =0x02039b28 -_08107FEE: - asrs r3, r1, 16 - lsls r2, r3, 1 - ldrb r1, [r5, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r2, r0 - adds r2, r6 - ldrh r0, [r4, 0xC] - strh r0, [r2] - adds r3, 0x1 - lsls r1, r3, 16 - asrs r0, r1, 16 - cmp r0, 0x9F - ble _08107FEE -_0810800C: - movs r0, 0x26 - ldrsh r1, [r4, r0] - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _08108022 - bl remove_some_task - adds r0, r7, 0 - bl DestroyTask -_08108022: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8107D58 - - thumb_func_start sub_8108034 -sub_8108034: @ 8108034 - push {r4-r6,lr} - adds r4, r0, 0 - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x8 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80A6980 - bl GenerateRandomNumber2 - movs r5, 0xFF - ands r5, r0 - movs r0, 0x80 - lsls r0, 1 - adds r6, r0, 0 - orrs r5, r6 - bl GenerateRandomNumber2 - ldr r1, =0x000001ff - ands r1, r0 - adds r0, r1, 0 - cmp r0, 0xFF - ble _0810807A - subs r0, r6, r0 - lsls r0, 16 - lsrs r1, r0, 16 -_0810807A: - strh r5, [r4, 0x30] - strh r1, [r4, 0x32] - ldr r0, =sub_8108098 - str r0, [r4, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8108034 - - thumb_func_start sub_8108098 -sub_8108098: @ 8108098 - push {r4,lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x30] - ldrh r1, [r2, 0x34] - adds r3, r0, r1 - strh r3, [r2, 0x34] - ldrh r1, [r2, 0x32] - ldrh r4, [r2, 0x36] - adds r1, r4 - strh r1, [r2, 0x36] - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _081080BC - lsls r0, r3, 16 - asrs r0, 24 - negs r0, r0 - b _081080C0 -_081080BC: - lsls r0, r3, 16 - asrs r0, 24 -_081080C0: - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x36] - lsls r0, 16 - asrs r0, 24 - strh r0, [r2, 0x26] - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x15 - bne _081080DE - adds r0, r2, 0 - bl move_anim_8072740 -_081080DE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8108098 - - thumb_func_start sub_81080E4 -sub_81080E4: @ 81080E4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x22] - strh r0, [r4, 0x12] - bl sub_8108384 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_80A7270 - ldr r0, =sub_8108140 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81080E4 - - thumb_func_start sub_8108140 -sub_8108140: @ 8108140 - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x7 - bls _0810815C - b _0810837A -_0810815C: - lsls r0, 2 - ldr r1, =_08108170 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08108170: - .4byte _08108190 - .4byte _081081B6 - .4byte _08108248 - .4byte _0810827E - .4byte _08108292 - .4byte _081082A0 - .4byte _08108320 - .4byte _0810836C -_08108190: - ldrh r1, [r4, 0x26] - lsls r1, 24 - lsrs r1, 24 - movs r3, 0x80 - lsls r3, 1 - movs r0, 0xE0 - str r0, [sp] - movs r0, 0x80 - lsls r0, 2 - str r0, [sp, 0x4] - movs r0, 0x20 - str r0, [sp, 0x8] - adds r0, r4, 0 - adds r2, r3, 0 - bl sub_80A805C - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_081081B6: - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _08108212 - movs r0, 0 - strh r0, [r4, 0xE] - ldrh r0, [r4, 0x10] - adds r0, 0x1 - strh r0, [r4, 0x10] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08108200 - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3 - strh r1, [r0, 0x24] - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - adds r1, 0x1 - strh r1, [r0, 0x22] - b _08108212 - .pool -_08108200: - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000fffd - strh r1, [r0, 0x24] -_08108212: - adds r0, r4, 0 - bl sub_80A80C8 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - beq _08108222 - b _0810837A -_08108222: - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A7E6C - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r5, [r0, 0x24] - strh r5, [r4, 0xE] - b _0810835C - .pool -_08108248: - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bgt _08108258 - b _0810837A -_08108258: - ldrh r1, [r4, 0x26] - lsls r1, 24 - lsrs r1, 24 - movs r3, 0x80 - lsls r3, 2 - movs r0, 0xC0 - lsls r0, 1 - str r0, [sp] - movs r0, 0xE0 - str r0, [sp, 0x4] - movs r0, 0x8 - str r0, [sp, 0x8] - adds r0, r4, 0 - movs r2, 0xE0 - bl sub_80A805C - movs r0, 0 - strh r0, [r4, 0xE] - b _0810835E -_0810827E: - adds r0, r4, 0 - bl sub_80A80C8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0810837A - strh r0, [r4, 0xE] - strh r0, [r4, 0x10] - b _0810835E -_08108292: - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_8108408 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_081082A0: - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0810837A - movs r0, 0 - strh r0, [r4, 0xE] - ldrh r0, [r4, 0x10] - adds r0, 0x1 - strh r0, [r4, 0x10] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081082D8 - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x26] - adds r1, 0x2 - b _081082EA - .pool -_081082D8: - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x26] - subs r1, 0x2 -_081082EA: - strh r1, [r0, 0x26] - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r0, 0xA - bne _0810837A - ldrh r1, [r4, 0x26] - lsls r1, 24 - lsrs r1, 24 - movs r2, 0xC0 - lsls r2, 1 - movs r0, 0x80 - lsls r0, 1 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x8 - str r0, [sp, 0x8] - adds r0, r4, 0 - movs r3, 0xE0 - bl sub_80A805C - movs r0, 0 - strh r0, [r4, 0xE] - strh r0, [r4, 0x10] - b _0810835E - .pool -_08108320: - ldr r6, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrh r1, [r0, 0x22] - subs r1, 0x1 - strh r1, [r0, 0x22] - adds r0, r4, 0 - bl sub_80A80C8 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0810837A - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A7344 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrh r1, [r4, 0x12] - strh r1, [r0, 0x22] -_0810835C: - strh r5, [r4, 0x10] -_0810835E: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0810837A - .pool -_0810836C: - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0810837A - adds r0, r2, 0 - bl move_anim_task_del -_0810837A: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8108140 - - thumb_func_start sub_8108384 -sub_8108384: @ 8108384 - push {r4,r5,lr} - ldr r4, =0x02038436 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _081083B8 - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - b _081083C8 - .pool -_081083B4: - adds r0, r2, 0 - b _081083FA -_081083B8: - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 -_081083C8: - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x3A - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - lsls r0, 16 - lsrs r3, r0, 16 - lsrs r4, 18 - movs r2, 0 -_081083E6: - adds r1, r2, 0x1 - adds r0, r4, 0 - muls r0, r1 - cmp r3, r0 - blt _081083B4 - lsls r0, r1, 24 - lsrs r2, r0, 24 - cmp r2, 0x2 - bls _081083E6 - movs r0, 0x3 -_081083FA: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8108384 - - thumb_func_start sub_8108408 -sub_8108408: @ 8108408 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - adds r7, r0, 0 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0xAC - ldrb r0, [r4] - bl sub_80A82E4 - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - ldrh r1, [r7, 0xA] - movs r0, 0x4 - subs r0, r1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r0, 0 - bgt _08108458 - movs r1, 0x1 -_08108458: - movs r0, 0 - str r0, [sp, 0x4] - lsls r0, r1, 16 - mov r10, r8 - mov r9, r6 - mov r1, r10 - lsls r1, 4 - str r1, [sp, 0xC] - mov r1, r9 - lsls r1, 4 - str r1, [sp, 0x10] - asrs r0, 16 - mov r8, r0 -_08108472: - ldr r0, =gUnknown_08595268 - mov r1, r10 - mov r2, r9 - ldr r3, [sp, 0x8] - bl AddObjectToFront - lsls r0, 24 - lsrs r2, r0, 24 - lsls r6, r5, 16 - cmp r2, 0x40 - beq _081084DA - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r5, r0, r1 - mov r0, sp - ldrh r0, [r0, 0x4] - strh r0, [r5, 0x30] - mov r1, sp - ldrh r1, [r1, 0xC] - strh r1, [r5, 0x32] - mov r0, sp - ldrh r0, [r0, 0x10] - strh r0, [r5, 0x34] - asrs r4, r6, 16 - adds r0, r4, 0 - movs r1, 0x40 - bl cosine - strh r0, [r5, 0x36] - adds r0, r4, 0 - movs r1, 0x40 - bl sine - strh r0, [r5, 0x38] - mov r1, sp - ldrh r1, [r1] - strh r1, [r5, 0x3A] - movs r0, 0x2 - strh r0, [r5, 0x3C] - ldrh r1, [r7, 0xC] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081084D4 - adds r0, r5, 0 - bl sub_810851C -_081084D4: - ldrh r0, [r7, 0xC] - adds r0, 0x1 - strh r0, [r7, 0xC] -_081084DA: - mov r1, r8 - lsls r0, r1, 1 - asrs r1, r6, 16 - adds r1, r0 - lsls r1, 16 - movs r0, 0xFF - lsls r0, 16 - ands r0, r1 - lsrs r5, r0, 16 - ldr r1, [sp, 0x4] - lsls r0, r1, 16 - asrs r0, 16 - add r0, r8 - lsls r0, 16 - lsrs r1, r0, 16 - str r1, [sp, 0x4] - asrs r0, 16 - cmp r0, 0x13 - ble _08108472 - 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_8108408 - - thumb_func_start sub_810851C -sub_810851C: @ 810851C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0810852E - cmp r0, 0x1 - beq _08108564 - b _081085BE -_0810852E: - movs r2, 0x30 - ldrsh r0, [r4, r2] - movs r1, 0x6 - bl __modsi3 - lsls r0, 16 - asrs r0, 16 - lsls r1, r0, 1 - adds r1, r0 - ldrh r0, [r4, 0x36] - adds r1, r0 - strh r1, [r4, 0x36] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x3 - bl __modsi3 - lsls r0, 16 - asrs r0, 16 - lsls r1, r0, 1 - adds r1, r0 - ldrh r2, [r4, 0x38] - adds r1, r2 - strh r1, [r4, 0x38] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_08108564: - ldrh r0, [r4, 0x36] - ldrh r1, [r4, 0x32] - adds r0, r1 - strh r0, [r4, 0x32] - ldrh r1, [r4, 0x38] - ldrh r2, [r4, 0x34] - adds r1, r2 - strh r1, [r4, 0x34] - lsls r0, 16 - asrs r0, 20 - strh r0, [r4, 0x20] - lsls r1, 16 - asrs r2, r1, 20 - strh r2, [r4, 0x22] - adds r0, 0x8 - lsls r0, 16 - movs r1, 0x80 - lsls r1, 17 - cmp r0, r1 - bhi _0810859A - adds r1, r2, 0 - movs r0, 0x8 - negs r0, r0 - cmp r1, r0 - blt _0810859A - cmp r1, 0x78 - ble _081085BE -_0810859A: - ldr r3, =0x03005e00 - movs r0, 0x3C - ldrsh r1, [r4, r0] - lsls r1, 1 - movs r0, 0x3A - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_081085BE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810851C - - thumb_func_start sub_81085C8 -sub_81085C8: @ 81085C8 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r4, r1, r0 - bl sub_8108384 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xA] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08108600 - movs r0, 0x88 - strh r0, [r4, 0x10] - movs r0, 0x28 - b _08108606 - .pool -_08108600: - movs r0, 0x10 - strh r0, [r4, 0x10] - movs r0, 0x50 -_08108606: - strh r0, [r4, 0x14] - movs r0, 0x62 - strh r0, [r4, 0x12] - ldrh r0, [r4, 0x10] - adds r0, 0x31 - strh r0, [r4, 0x16] - movs r0, 0xA - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - adds r0, 0x5 - strh r0, [r4, 0x20] - ldr r0, =sub_810862C - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81085C8 - - thumb_func_start sub_810862C -sub_810862C: @ 810862C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r7, =0x03005e00 - adds r4, r0, r7 - movs r0, 0x8 - ldrsh r2, [r4, r0] - cmp r2, 0 - beq _08108654 - cmp r2, 0x1 - beq _08108704 - b _08108712 - .pool -_08108654: - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _0810866A - strh r2, [r4, 0xC] - adds r0, r4, 0 - bl sub_810871C -_0810866A: - movs r1, 0x1C - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081086E4 - movs r2, 0x22 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _081086E4 - ldr r5, =0x0203841e - movs r1, 0x1 - mov r8, r1 - mov r2, r8 - strh r2, [r5] - strh r0, [r5, 0x2] - movs r0, 0xC - strh r0, [r5, 0x4] - ldr r6, =sub_81152DC - adds r0, r6, 0 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _081086B4 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r7 - ldr r1, [r0] - adds r0, r2, 0 - bl _call_via_r1 - ldr r1, =0x020383fe - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_081086B4: - movs r0, 0x3 - strh r0, [r5] - adds r0, r6, 0 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _081086E0 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r7 - ldr r1, [r0] - adds r0, r2, 0 - bl _call_via_r1 - ldr r1, =0x020383fe - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_081086E0: - mov r0, r8 - strh r0, [r4, 0x22] -_081086E4: - movs r2, 0x1E - ldrsh r1, [r4, r2] - movs r2, 0x20 - ldrsh r0, [r4, r2] - cmp r1, r0 - blt _08108712 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _08108712 - .pool -_08108704: - movs r2, 0x1A - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _08108712 - adds r0, r1, 0 - bl move_anim_task_del -_08108712: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_810862C - - thumb_func_start sub_810871C -sub_810871C: @ 810871C - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r6, r1, 24 - ldr r1, =gUnknown_08329F40 - movs r2, 0x18 - ldrsh r0, [r4, r2] - lsls r0, 1 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - adds r0, 0x3 - asrs r0, 4 - ldrh r2, [r4, 0x14] - adds r0, r2 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =gUnknown_08595268 - movs r2, 0x16 - ldrsh r1, [r4, r2] - movs r2, 0 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _08108776 - ldr r3, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x1C - adds r1, r0, r1 - ldr r2, =sub_81087C0 - str r2, [r1] - adds r0, r3 - strh r5, [r0, 0x38] - strh r6, [r0, 0x3A] - movs r1, 0x9 - strh r1, [r0, 0x3C] - ldrh r0, [r4, 0x1A] - adds r0, 0x1 - strh r0, [r4, 0x1A] -_08108776: - ldrh r0, [r4, 0x1E] - adds r0, 0x1 - strh r0, [r4, 0x1E] - ldrh r0, [r4, 0x18] - adds r0, 0x27 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x18] - movs r0, 0x16 - ldrsh r1, [r4, r0] - ldr r0, =0x41c64e6d - muls r0, r1 - ldr r1, =0x00003039 - adds r0, r1 - movs r2, 0x12 - ldrsh r1, [r4, r2] - bl __modsi3 - ldrh r1, [r4, 0x10] - adds r1, r0 - strh r1, [r4, 0x16] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810871C - - thumb_func_start sub_81087C0 -sub_81087C0: @ 81087C0 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _08108856 - ldrh r0, [r5, 0x22] - adds r0, 0x8 - strh r0, [r5, 0x22] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x38 - ldrsh r1, [r5, r2] - cmp r0, r1 - blt _08108856 - ldr r2, =0x03005e00 - movs r3, 0x3A - ldrsh r1, [r5, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x1 - strh r1, [r0, 0x1C] - ldr r0, =gUnknown_08597388 - movs r2, 0x20 - ldrsh r1, [r5, r2] - movs r3, 0x22 - ldrsh r2, [r5, r3] - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x30] - cmp r0, 0x40 - beq _08108850 - movs r0, 0x30 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - movs r1, 0x3 - bl StartObjectRotScalAnim - movs r2, 0x30 - ldrsh r1, [r5, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r5, 0x3A] - strh r1, [r0, 0x3A] - movs r3, 0x30 - ldrsh r1, [r5, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r5, 0x3C] - strh r1, [r0, 0x3C] - movs r0, 0x30 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, 0x1C - adds r0, r4 - ldr r1, =sub_810886C - str r1, [r0] -_08108850: - adds r0, r5, 0 - bl RemoveObjectAndFreeTiles -_08108856: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81087C0 - - thumb_func_start sub_810886C -sub_810886C: @ 810886C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _081088D8 - movs r0, 0 - strh r0, [r4, 0x30] - 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] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - bne _081088D8 - ldr r3, =0x03005e00 - movs r0, 0x3C - ldrsh r1, [r4, r0] - lsls r1, 1 - movs r0, 0x3A - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_081088D8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810886C - - thumb_func_start sub_81088E4 -sub_81088E4: @ 81088E4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r5, r1, r0 - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - movs r6, 0 - strh r0, [r5, 0xE] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x10] - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - movs r2, 0x1 - negs r2, r2 - adds r1, r2, 0 - cmp r0, 0 - bne _08108928 - movs r1, 0x1 -_08108928: - strh r1, [r5, 0x16] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0810893C - movs r1, 0x16 - ldrsh r0, [r5, r1] - negs r0, r0 - strh r0, [r5, 0x16] -_0810893C: - movs r2, 0x16 - ldrsh r0, [r5, r2] - lsls r0, 3 - ldrh r1, [r5, 0xE] - adds r0, r1 - strh r0, [r5, 0x12] - movs r2, 0x16 - ldrsh r1, [r5, r2] - lsls r1, 3 - ldrh r0, [r5, 0x10] - subs r0, r1 - strh r0, [r5, 0x14] - ldr r0, =0x0000ffe0 - strh r0, [r5, 0x1A] - strh r6, [r5, 0xA] - strh r6, [r5, 0x8] - ldr r0, =sub_8108978 - str r0, [r5] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81088E4 - - thumb_func_start sub_8108978 -sub_8108978: @ 8108978 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x6 - bls _08108992 - b _08108AB2 -_08108992: - lsls r0, 2 - ldr r1, =_081089A4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081089A4: - .4byte _081089C0 - .4byte _081089D0 - .4byte _081089EA - .4byte _08108A2C - .4byte _08108A4E - .4byte _08108A7C - .4byte _08108AA2 -_081089C0: - adds r0, r4, 0 - bl sub_8108AC0 - movs r1, 0x1C - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _08108AB8 - b _08108AAA -_081089D0: - adds r0, r4, 0 - bl sub_8108AC0 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - ble _08108AB8 - movs r0, 0 - strh r0, [r4, 0xA] - b _08108AAA -_081089EA: - adds r0, r4, 0 - bl sub_8108AC0 - movs r1, 0x16 - ldrsh r0, [r4, r1] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 1 - ldrh r0, [r4, 0x12] - adds r1, r0 - movs r2, 0 - strh r1, [r4, 0x12] - adds r1, 0x10 - lsls r1, 16 - movs r0, 0x88 - lsls r0, 17 - cmp r1, r0 - bls _08108AB8 - ldrh r0, [r4, 0x20] - adds r0, 0x1 - strh r0, [r4, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _08108A28 - movs r0, 0x1 - strh r0, [r4, 0x22] - movs r0, 0x6 - strh r0, [r4, 0x8] - strh r2, [r4, 0xA] - b _08108AB8 -_08108A28: - strh r2, [r4, 0xA] - b _08108AAA -_08108A2C: - adds r0, r4, 0 - bl sub_8108AC0 - movs r0, 0x16 - ldrsh r1, [r4, r0] - lsls r1, 1 - ldrh r0, [r4, 0x14] - subs r0, r1 - strh r0, [r4, 0x14] - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _08108AB8 - b _08108AAA -_08108A4E: - adds r0, r4, 0 - bl sub_8108AC0 - movs r1, 0x16 - ldrsh r0, [r4, r1] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 1 - ldrh r0, [r4, 0x12] - subs r0, r1 - strh r0, [r4, 0x12] - adds r0, 0x10 - lsls r0, 16 - movs r1, 0x88 - lsls r1, 17 - cmp r0, r1 - bls _08108AB8 - ldrh r0, [r4, 0x20] - adds r0, 0x1 - strh r0, [r4, 0x20] - movs r0, 0 - strh r0, [r4, 0xA] - b _08108AAA -_08108A7C: - adds r0, r4, 0 - bl sub_8108AC0 - movs r0, 0x16 - ldrsh r1, [r4, r0] - lsls r1, 1 - ldrh r0, [r4, 0x14] - subs r0, r1 - strh r0, [r4, 0x14] - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _08108AB8 - movs r0, 0x2 - strh r0, [r4, 0x8] - b _08108AB8 -_08108AA2: - movs r1, 0x18 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08108AB8 -_08108AAA: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _08108AB8 -_08108AB2: - adds r0, r2, 0 - bl move_anim_task_del -_08108AB8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8108978 - - thumb_func_start sub_8108AC0 -sub_8108AC0: @ 8108AC0 - push {r4-r6,lr} - adds r6, r0, 0 - ldrh r0, [r6, 0xC] - adds r0, 0x1 - strh r0, [r6, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _08108B1A - movs r0, 0 - strh r0, [r6, 0xC] - ldr r0, =gUnknown_08595268 - movs r2, 0xE - ldrsh r1, [r6, r2] - movs r3, 0x10 - ldrsh r2, [r6, r3] - movs r3, 0xA - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _08108B1A - ldr r5, =0x02020630 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - adds r0, r4, r5 - movs r1, 0x10 - strh r1, [r0, 0x2E] - ldrh r1, [r6, 0x12] - strh r1, [r0, 0x32] - ldrh r1, [r6, 0x14] - strh r1, [r0, 0x36] - ldrh r1, [r6, 0x1A] - strh r1, [r0, 0x38] - bl sub_80A68D4 - adds r5, 0x1C - adds r4, r5 - ldr r0, =sub_8108B2C - str r0, [r4] - ldrh r0, [r6, 0x18] - adds r0, 0x1 - strh r0, [r6, 0x18] -_08108B1A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8108AC0 - - thumb_func_start sub_8108B2C -sub_8108B2C: @ 8108B2C - push {r4-r6,lr} - adds r6, r0, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _08108B86 - ldrh r0, [r6, 0x24] - ldrh r1, [r6, 0x20] - adds r0, r1 - strh r0, [r6, 0x20] - ldrh r0, [r6, 0x26] - ldrh r1, [r6, 0x22] - adds r0, r1 - strh r0, [r6, 0x22] - movs r0, 0x6 - strh r0, [r6, 0x2E] - bl GenerateRandomNumber2 - movs r4, 0x1F - adds r1, r4, 0 - ands r1, r0 - ldr r5, =0x0000fff0 - adds r1, r5 - ldrh r0, [r6, 0x20] - adds r1, r0 - strh r1, [r6, 0x32] - bl GenerateRandomNumber2 - ands r4, r0 - adds r4, r5 - ldrh r1, [r6, 0x22] - adds r4, r1 - strh r4, [r6, 0x36] - bl GenerateRandomNumber2 - movs r1, 0x7 - ands r1, r0 - mvns r1, r1 - strh r1, [r6, 0x38] - adds r0, r6, 0 - bl sub_80A68D4 - ldr r0, =sub_8108B94 - str r0, [r6, 0x1C] -_08108B86: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8108B2C - - thumb_func_start sub_8108B94 -sub_8108B94: @ 8108B94 - push {r4-r6,lr} - adds r5, r0, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _08108BD0 - movs r4, 0 - ldr r6, =0x03005e00 -_08108BA6: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r6 - ldr r1, [r2] - ldr r0, =sub_8108978 - cmp r1, r0 - bne _08108BC6 - movs r0, 0x1 - strh r0, [r2, 0x1C] - ldrh r0, [r2, 0x18] - subs r0, 0x1 - strh r0, [r2, 0x18] - adds r0, r5, 0 - bl RemoveObjectAndFreeTiles -_08108BC6: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0xF - bls _08108BA6 -_08108BD0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8108B94 - - thumb_func_start sub_8108BE0 -sub_8108BE0: @ 8108BE0 - ldr r2, =0x0203841e - ldrh r1, [r2] - strh r1, [r0, 0x20] - ldrh r1, [r2, 0x2] - strh r1, [r0, 0x22] - ldrh r1, [r2, 0x4] - strh r1, [r0, 0x2E] - ldrh r1, [r2, 0x6] - strh r1, [r0, 0x30] - ldrh r1, [r2, 0x8] - strh r1, [r0, 0x32] - ldrh r1, [r2, 0xA] - strh r1, [r0, 0x34] - ldr r1, =sub_8108C08 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_8108BE0 - - thumb_func_start sub_8108C08 -sub_8108C08: @ 8108C08 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x36] - ldrh r1, [r4, 0x2E] - subs r0, r1 - strh r0, [r4, 0x36] - movs r1, 0x36 - ldrsh r0, [r4, r1] - movs r1, 0xA - bl __divsi3 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - ldrh r2, [r4, 0x38] - adds r0, r2 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x38] - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r2, 0x32 - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x34] - subs r0, 0x1 - strh r0, [r4, 0x34] - lsls r0, 16 - cmp r0, 0 - bne _08108C4C - adds r0, r4, 0 - bl move_anim_8072740 -_08108C4C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8108C08 - - thumb_func_start sub_8108C54 -sub_8108C54: @ 8108C54 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x34] - adds r0, r1 - strh r0, [r4, 0x34] - ldrh r1, [r4, 0x32] - ldrh r2, [r4, 0x36] - adds r1, r2 - strh r1, [r4, 0x36] - lsls r0, 16 - asrs r0, 23 - strh r0, [r4, 0x24] - lsls r1, 16 - asrs r1, 23 - strh r1, [r4, 0x26] - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - cmp r0, 0 - bne _08108C8C - adds r0, r4, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_08108C8C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8108C54 - - thumb_func_start sub_8108C94 -sub_8108C94: @ 8108C94 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x30] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x34] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x36] - ldr r0, =sub_8108CDC - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8108C94 - - thumb_func_start sub_8108CDC -sub_8108CDC: @ 8108CDC - push {r4-r6,lr} - adds r4, r0, 0 - movs r0, 0x30 - ldrsh r1, [r4, r0] - movs r2, 0x20 - ldrsh r0, [r4, r2] - subs r6, r1, r0 - movs r0, 0x32 - ldrsh r1, [r4, r0] - movs r2, 0x22 - ldrsh r0, [r4, r2] - subs r5, r1, r0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - muls r0, r6 - movs r2, 0x34 - ldrsh r1, [r4, r2] - bl __divsi3 - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - muls r0, r5 - movs r2, 0x34 - ldrsh r1, [r4, r2] - bl __divsi3 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x36 - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _08108D34 - movs r0, 0 - strh r0, [r4, 0x38] - adds r0, r4, 0 - adds r1, r6, 0 - adds r2, r5, 0 - bl sub_8108D54 -_08108D34: - movs r0, 0x34 - ldrsh r1, [r4, r0] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _08108D46 - adds r0, r4, 0 - bl move_anim_8072740 -_08108D46: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8108CDC - - thumb_func_start sub_8108D54 -sub_8108D54: @ 8108D54 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - adds r4, r1, 0 - adds r5, r2, 0 - movs r2, 0x2E - ldrsh r1, [r0, r2] - lsrs r2, r1, 31 - adds r1, r2 - lsls r1, 15 - lsrs r1, 16 - str r1, [sp] - ldrh r1, [r0, 0x24] - ldrh r3, [r0, 0x20] - adds r1, r3 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - ldrh r1, [r0, 0x26] - ldrh r0, [r0, 0x22] - adds r1, r0 - lsls r1, 16 - lsrs r1, 16 - mov r10, r1 - bl GenerateRandomNumber2 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - adds r0, r5, r0 - subs r0, 0x5 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - bl GenerateRandomNumber2 - negs r4, r4 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - adds r4, r0 - subs r4, 0x5 - lsls r4, 16 - lsrs r7, r4, 16 - movs r6, 0 - mov r0, r8 - lsls r0, 16 - mov r8, r0 - mov r1, r10 - lsls r1, 16 - str r1, [sp, 0xC] - ldr r2, [sp] - lsls r2, 16 - str r2, [sp, 0x10] - asrs r1, 16 - lsls r0, r7, 16 - asrs r5, r0, 16 - str r0, [sp, 0x14] - negs r3, r5 - str r3, [sp, 0x4] - asrs r0, r2, 16 - adds r1, r0 - lsls r1, 16 - mov r10, r1 -_08108DE2: - ldr r0, =gUnknown_08595310 - mov r2, r8 - asrs r1, r2, 16 - mov r3, r10 - asrs r2, r3, 16 - movs r3, 0x82 - bl AddObjectToFront - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r4, r0, r1 - movs r0, 0x14 - strh r0, [r4, 0x2E] - mov r0, r9 - strh r0, [r4, 0x30] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl sub_80A82E4 - subs r0, 0x1 - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - cmp r5, 0 - bge _08108E30 - mov r1, sp - ldrh r1, [r1, 0x4] - strh r1, [r4, 0x32] - b _08108E32 - .pool -_08108E30: - strh r7, [r4, 0x32] -_08108E32: - lsls r0, r6, 16 - movs r2, 0x80 - lsls r2, 9 - adds r0, r2 - lsrs r6, r0, 16 - cmp r0, 0 - ble _08108DE2 - movs r6, 0 - ldr r3, [sp, 0xC] - asrs r1, r3, 16 - ldr r0, [sp, 0x14] - asrs r5, r0, 16 - negs r2, r5 - str r2, [sp, 0x8] - ldr r3, [sp, 0x10] - asrs r0, r3, 16 - subs r1, r0 - lsls r1, 16 - mov r10, r1 -_08108E58: - ldr r0, =gUnknown_08595310 - mov r2, r8 - asrs r1, r2, 16 - mov r3, r10 - asrs r2, r3, 16 - movs r3, 0x82 - bl AddObjectToFront - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r4, r0, r1 - movs r0, 0x14 - strh r0, [r4, 0x2E] - mov r0, r9 - strh r0, [r4, 0x30] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl sub_80A82E4 - subs r0, 0x1 - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - cmp r5, 0 - ble _08108EA8 - mov r1, sp - ldrh r1, [r1, 0x8] - strh r1, [r4, 0x32] - b _08108EAA - .pool -_08108EA8: - strh r7, [r4, 0x32] -_08108EAA: - lsls r0, r6, 16 - movs r2, 0x80 - lsls r2, 9 - adds r0, r2 - lsrs r6, r0, 16 - cmp r0, 0 - ble _08108E58 - 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_8108D54 - - thumb_func_start sub_8108EC8 -sub_8108EC8: @ 8108EC8 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0203841e - ldrh r0, [r0] - strh r0, [r4, 0x2E] - movs r0, 0x3C - strh r0, [r4, 0x30] - movs r0, 0x9 - strh r0, [r4, 0x32] - movs r0, 0x1E - strh r0, [r4, 0x34] - movs r0, 0xFE - lsls r0, 8 - strh r0, [r4, 0x36] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r1, =sub_80A634C - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8108EC8 - - thumb_func_start sub_8108F08 -sub_8108F08: @ 8108F08 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x0203841e - movs r0, 0 - ldrsh r1, [r5, r0] - adds r0, r4, 0 - bl sub_80A6864 - ldrh r0, [r5, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldrh r0, [r5, 0x8] - strh r0, [r4, 0x2E] - ldrh r0, [r5, 0x4] - strh r0, [r4, 0x30] - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x32] - ldr r0, =sub_80A656C - str r0, [r4, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8108F08 - - thumb_func_start sub_8108F4C -sub_8108F4C: @ 8108F4C - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6838 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08108F88 - ldr r2, =0x0203841e - ldrh r0, [r4, 0x20] - ldrh r1, [r2] - subs r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r2, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldrh r0, [r2, 0x8] - negs r0, r0 - strh r0, [r4, 0x32] - adds r1, r2, 0 - b _08108F9E - .pool -_08108F88: - ldr r1, =0x0203841e - ldrh r0, [r1] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - ldrh r0, [r1, 0x2] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x32] -_08108F9E: - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x36] - ldrh r0, [r1, 0xA] - strh r0, [r4, 0x34] - ldr r0, =sub_8109028 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8108F4C - - thumb_func_start sub_8108FBC -sub_8108FBC: @ 8108FBC - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08108FF0 - ldr r2, =0x0203841e - ldrh r0, [r4, 0x20] - ldrh r1, [r2] - subs r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r2, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldrh r0, [r2, 0x8] - strh r0, [r4, 0x32] - adds r1, r2, 0 - b _08109008 - .pool -_08108FF0: - ldr r1, =0x0203841e - ldrh r0, [r1] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - ldrh r0, [r1, 0x2] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - ldrh r0, [r1, 0x8] - negs r0, r0 - strh r0, [r4, 0x32] -_08109008: - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x36] - ldrh r0, [r1, 0xA] - strh r0, [r4, 0x34] - ldr r0, =sub_8109028 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8108FBC - - thumb_func_start sub_8109028 -sub_8109028: @ 8109028 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x36 - ldrsh r1, [r2, r3] - cmp r0, r1 - bge _0810904E - ldrh r0, [r2, 0x32] - ldrh r1, [r2, 0x24] - adds r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x34] - ldrh r3, [r2, 0x26] - adds r0, r3 - strh r0, [r2, 0x26] -_0810904E: - movs r0, 0x2E - ldrsh r1, [r2, r0] - movs r3, 0x30 - ldrsh r0, [r2, r3] - cmp r1, r0 - bne _08109060 - adds r0, r2, 0 - bl move_anim_8074EE0 -_08109060: - pop {r0} - bx r0 - thumb_func_end sub_8109028 - - thumb_func_start sub_8109064 -sub_8109064: @ 8109064 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6838 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08109090 - ldr r0, =0x0203841e - ldrh r1, [r4, 0x20] - ldrh r2, [r0] - subs r1, r2 - strh r1, [r4, 0x20] - b _081090A2 - .pool -_08109090: - ldr r0, =0x0203841e - ldrh r1, [r0] - ldrh r2, [r4, 0x20] - adds r1, r2 - strh r1, [r4, 0x20] - adds r2, r4, 0 - adds r2, 0x43 - movs r1, 0x8 - strb r1, [r2] -_081090A2: - adds r2, r0, 0 - ldrh r0, [r2, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - movs r1, 0 - strh r0, [r4, 0x22] - ldrh r0, [r2, 0x4] - strh r0, [r4, 0x2E] - ldrh r0, [r2, 0x6] - strh r0, [r4, 0x30] - ldrh r0, [r2, 0x8] - strh r0, [r4, 0x32] - ldrh r0, [r2, 0xA] - strh r0, [r4, 0x34] - ldrh r0, [r2, 0xC] - strh r0, [r4, 0x36] - strh r1, [r4, 0x38] - ldr r0, =sub_81090D8 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8109064 - - thumb_func_start sub_81090D8 -sub_81090D8: @ 81090D8 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _08109160 - movs r2, 0x38 - ldrsh r1, [r4, r2] - ldr r0, =0x00002710 - cmp r1, r0 - ble _081090F6 - adds r1, r4, 0 - adds r1, 0x43 - movs r0, 0x1 - strb r0, [r1] -_081090F6: - movs r1, 0x2E - ldrsh r0, [r4, r1] - ldrh r1, [r4, 0x38] - lsls r1, 16 - asrs r1, 24 - ldrh r2, [r4, 0x30] - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - bl sine - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - ldrh r1, [r4, 0x38] - lsls r1, 16 - asrs r1, 24 - ldrh r2, [r4, 0x30] - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - bl cosine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - ldrh r2, [r4, 0x2E] - adds r1, r0, r2 - strh r1, [r4, 0x2E] - ldrh r0, [r4, 0x36] - ldrh r2, [r4, 0x38] - adds r0, r2 - strh r0, [r4, 0x38] - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _0810914C - ldr r2, =0xffffff00 - b _08109154 - .pool -_0810914C: - cmp r0, 0 - bge _08109158 - movs r2, 0x80 - lsls r2, 1 -_08109154: - adds r0, r1, r2 - strh r0, [r4, 0x2E] -_08109158: - ldrh r0, [r4, 0x34] - subs r0, 0x1 - strh r0, [r4, 0x34] - b _08109166 -_08109160: - adds r0, r4, 0 - bl move_anim_8074EE0 -_08109166: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81090D8 - - thumb_func_start sub_810916C -sub_810916C: @ 810916C - push {lr} - movs r1, 0 - strh r1, [r0, 0x20] - strh r1, [r0, 0x22] - movs r1, 0x3C - strh r1, [r0, 0x2E] - movs r1, 0x8C - strh r1, [r0, 0x32] - movs r1, 0x50 - strh r1, [r0, 0x36] - ldr r1, =sub_80A6EEC - str r1, [r0, 0x1C] - ldr r1, =move_anim_8072740 - bl oamt_set_x3A_32 - pop {r0} - bx r0 - .pool - thumb_func_end sub_810916C - - thumb_func_start sub_8109198 -sub_8109198: @ 8109198 - push {r4-r6,lr} - adds r6, r0, 0 - ldr r5, =0x02038436 - ldrb r0, [r5] - bl battle_side_get_owner - adds r4, r0, 0 - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _081091DE - movs r0, 0x2 - bl battle_get_side_with_given_state - ldrb r1, [r5] - lsls r0, 24 - lsrs r0, 24 - cmp r1, r0 - beq _081091D6 - movs r0, 0x3 - bl battle_get_side_with_given_state - ldrb r1, [r5] - lsls r0, 24 - lsrs r0, 24 - cmp r1, r0 - bne _081091DE -_081091D6: - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] -_081091DE: - ldr r1, =sub_80A7938 - str r1, [r6, 0x1C] - adds r0, r6, 0 - bl _call_via_r1 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8109198 - - thumb_func_start sub_8109200 -sub_8109200: @ 8109200 - ldr r2, =0x0203841e - ldrh r1, [r2] - negs r1, r1 - strh r1, [r2] - ldrh r1, [r2, 0x4] - negs r1, r1 - strh r1, [r2, 0x4] - ldr r1, =sub_80A7938 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_8109200 - - thumb_func_start sub_810921C -sub_810921C: @ 810921C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r0, =0x0203841e - ldrh r0, [r0, 0x4] - movs r1, 0 - strh r0, [r4, 0x3C] - strh r1, [r4, 0x2E] - ldr r0, =sub_8109244 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810921C - - thumb_func_start sub_8109244 -sub_8109244: @ 8109244 - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_8109338 - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x12 - bne _0810928E - movs r0, 0x19 - strh r0, [r5, 0x2E] - ldrh r0, [r5, 0x20] - strh r0, [r5, 0x30] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x22] - strh r0, [r5, 0x34] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x36] - adds r0, r5, 0 - bl obj_translate_based_on_private_1_2_3_4 - ldr r0, =sub_810929C - str r0, [r5, 0x1C] -_0810928E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8109244 - - thumb_func_start sub_810929C -sub_810929C: @ 810929C - push {r4-r6,lr} - adds r6, r0, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - beq _081092E4 - movs r4, 0 - strh r4, [r6, 0x2E] - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x20] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x22] - strh r4, [r6, 0x26] - strh r4, [r6, 0x24] - ldr r1, =sub_8109314 - str r1, [r6, 0x1C] - adds r0, r6, 0 - bl _call_via_r1 - b _0810930E - .pool -_081092E4: - movs r1, 0x3C - ldrsh r0, [r6, r1] - movs r1, 0x1C - bl sine - ldrh r1, [r6, 0x24] - adds r0, r1 - strh r0, [r6, 0x24] - movs r1, 0x3C - ldrsh r0, [r6, r1] - movs r1, 0x1C - bl cosine - ldrh r1, [r6, 0x26] - adds r0, r1 - strh r0, [r6, 0x26] - ldrh r0, [r6, 0x3C] - adds r0, 0x14 - movs r1, 0xFF - ands r0, r1 - strh r0, [r6, 0x3C] -_0810930E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_810929C - - thumb_func_start sub_8109314 -sub_8109314: @ 8109314 - push {r4,lr} - adds r4, r0, 0 - bl sub_8109338 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1F - bne _08109330 - adds r0, r4, 0 - bl move_anim_8072740 -_08109330: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8109314 - - thumb_func_start sub_8109338 -sub_8109338: @ 8109338 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r1, 0x1C - bl sine - strh r0, [r4, 0x24] - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r1, 0x1C - bl cosine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x3C] - adds r0, 0x14 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x3C] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8109338 - - thumb_func_start sub_8109364 -sub_8109364: @ 8109364 - push {r4,lr} - adds r4, r0, 0 - ldr r1, =0x0203841e - ldrh r0, [r1] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - ldrh r0, [r1, 0x2] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x2E] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x32] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A653C - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8109364 - - thumb_func_start sub_81093A4 -sub_81093A4: @ 81093A4 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x2E] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_80A64B0 - str r0, [r4, 0x1C] - ldr r1, =sub_81093E4 - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81093A4 - - thumb_func_start sub_81093E4 -sub_81093E4: @ 81093E4 - push {lr} - adds r3, r0, 0 - adds r3, 0x3E - ldrb r2, [r3] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r3] - ldrh r1, [r0, 0x30] - movs r2, 0 - strh r1, [r0, 0x2E] - strh r2, [r0, 0x30] - ldr r1, =sub_810940C - str r1, [r0, 0x1C] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81093E4 - - thumb_func_start sub_810940C -sub_810940C: @ 810940C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x30 - ldrsh r0, [r4, r1] - ldrh r1, [r4, 0x32] - lsls r1, 16 - asrs r1, 24 - bl sine - strh r0, [r4, 0x24] - movs r1, 0x30 - ldrsh r0, [r4, r1] - ldrh r1, [r4, 0x32] - lsls r1, 16 - asrs r1, 24 - bl cosine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0xA - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x32] - adds r0, 0xD0 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _08109458 - adds r0, r4, 0 - bl move_anim_8072740 -_08109458: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810940C - - thumb_func_start sub_8109460 -sub_8109460: @ 8109460 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - strh r0, [r4, 0x26] - strh r5, [r4, 0x8] - strh r5, [r4, 0xA] - strh r5, [r4, 0xC] - strh r5, [r4, 0xE] - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x22] - strh r0, [r4, 0x10] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x12] - strh r5, [r4, 0x14] - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_80A7270 - ldr r0, =sub_81094D0 - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8109460 - - thumb_func_start sub_81094D0 -sub_81094D0: @ 81094D0 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x6 - bls _081094EC - b _081097AA -_081094EC: - lsls r0, 2 - ldr r1, =_08109500 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08109500: - .4byte _0810951C - .4byte _08109542 - .4byte _081095F4 - .4byte _08109654 - .4byte _08109672 - .4byte _08109748 - .4byte _0810979C -_0810951C: - ldrh r1, [r4, 0x26] - lsls r1, 24 - lsrs r1, 24 - movs r3, 0x80 - lsls r3, 1 - movs r0, 0xE0 - str r0, [sp] - movs r0, 0x80 - lsls r0, 2 - str r0, [sp, 0x4] - movs r0, 0x20 - str r0, [sp, 0x8] - adds r0, r4, 0 - adds r2, r3, 0 - bl sub_80A805C - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_08109542: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0810958A - movs r0, 0 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08109578 - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3 - b _08109588 - .pool -_08109578: - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000fffd -_08109588: - strh r1, [r0, 0x24] -_0810958A: - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081095B8 - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _081095B8 - movs r0, 0 - strh r0, [r4, 0xE] - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - adds r1, 0x1 - strh r1, [r0, 0x22] -_081095B8: - adds r0, r4, 0 - bl sub_80A80C8 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - beq _081095C8 - b _081097AA -_081095C8: - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A7E6C - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r5, [r0, 0x24] - strh r5, [r4, 0xA] - strh r5, [r4, 0xC] - strh r5, [r4, 0xE] - b _08109790 - .pool -_081095F4: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bgt _08109604 - b _081097AA -_08109604: - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0810962E - ldrh r1, [r4, 0x26] - lsls r1, 24 - lsrs r1, 24 - movs r3, 0x80 - lsls r3, 2 - movs r0, 0xC0 - lsls r0, 1 - str r0, [sp] - movs r0, 0xF0 - str r0, [sp, 0x4] - movs r0, 0x6 - str r0, [sp, 0x8] - adds r0, r4, 0 - movs r2, 0xE0 - bl sub_80A805C - b _0810964E -_0810962E: - ldrh r1, [r4, 0x26] - lsls r1, 24 - lsrs r1, 24 - movs r3, 0x80 - lsls r3, 2 - movs r0, 0xC0 - lsls r0, 1 - str r0, [sp] - movs r0, 0xC0 - str r0, [sp, 0x4] - movs r0, 0x6 - str r0, [sp, 0x8] - adds r0, r4, 0 - movs r2, 0xE0 - bl sub_80A805C -_0810964E: - movs r0, 0 - strh r0, [r4, 0xA] - b _08109790 -_08109654: - adds r0, r4, 0 - bl sub_80A80C8 - lsls r0, 24 - cmp r0, 0 - beq _08109662 - b _081097AA -_08109662: - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - adds r1, r5, 0 - movs r2, 0x6 - bl sub_81097B4 - b _08109790 -_08109672: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _081096C0 - movs r0, 0 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081096AC - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x26] - adds r1, 0x3 - b _081096BE - .pool -_081096AC: - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x26] - subs r1, 0x3 -_081096BE: - strh r1, [r0, 0x26] -_081096C0: - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x18 - ble _081097AA - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081096FC - ldrh r1, [r4, 0x26] - lsls r1, 24 - lsrs r1, 24 - movs r2, 0xC0 - lsls r2, 1 - movs r0, 0x80 - lsls r0, 1 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x8 - str r0, [sp, 0x8] - adds r0, r4, 0 - movs r3, 0xF0 - bl sub_80A805C - b _0810971A - .pool -_081096FC: - ldrh r1, [r4, 0x26] - lsls r1, 24 - lsrs r1, 24 - movs r2, 0xC0 - lsls r2, 1 - movs r0, 0x80 - lsls r0, 1 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x8 - str r0, [sp, 0x8] - adds r0, r4, 0 - movs r3, 0xC0 - bl sub_80A805C -_0810971A: - ldrh r1, [r4, 0xC] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08109738 - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x26] - subs r1, 0x3 - strh r1, [r0, 0x26] -_08109738: - movs r0, 0 - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - strh r0, [r4, 0xE] - b _08109790 - .pool -_08109748: - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _08109764 - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - subs r1, 0x1 - strh r1, [r0, 0x22] -_08109764: - adds r0, r4, 0 - bl sub_80A80C8 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _081097AA - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r4, 0x10] - strh r1, [r0, 0x22] - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A7344 - strh r5, [r4, 0xC] -_08109790: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _081097AA - .pool -_0810979C: - movs r1, 0x14 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081097AA - adds r0, r5, 0 - bl move_anim_task_del -_081097AA: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81094D0 - - thumb_func_start sub_81097B4 -sub_81097B4: @ 81097B4 - 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 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - adds r0, r4, 0 - bl sub_8109930 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrh r4, [r0, 0x20] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0810980C - adds r0, r4, 0 - subs r0, 0xC - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0x1 - b _08109816 - .pool -_0810980C: - adds r0, r4, 0 - adds r0, 0x10 - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0xFF -_08109816: - movs r6, 0 - movs r5, 0 - lsls r4, 16 - str r4, [sp, 0x8] - mov r1, r9 - lsls r1, 16 - str r1, [sp, 0x4] - ldr r2, =gUnknown_085955CC - mov r9, r2 - lsls r0, 24 - asrs r0, 24 - str r0, [sp] - mov r3, r8 - lsls r3, 1 - mov r10, r3 -_08109834: - ldr r0, =gUnknown_085955B4 - ldr r2, [sp, 0x8] - asrs r1, r2, 16 - ldr r3, [sp, 0x4] - asrs r2, r3, 16 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - beq _081098B6 - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r4, r0, r1 - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - lsls r0, r5, 2 - adds r0, 0x40 - adds r1, r0 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r3, =0xfffffc00 - adds r0, r3, 0 - ands r2, r0 - orrs r2, r1 - strh r2, [r4, 0x4] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x4 - bls _0810987E - movs r5, 0 -_0810987E: - lsls r2, r6, 2 - mov r1, r9 - adds r0, r2, r1 - ldrh r0, [r0] - ldr r3, [sp] - adds r1, r0, 0 - muls r1, r3 - lsls r1, 16 - asrs r1, 16 - ldr r0, =gUnknown_085955CE - adds r2, r0 - movs r3, 0 - ldrsh r2, [r2, r3] - adds r0, r4, 0 - bl sub_8109984 - strh r7, [r4, 0x3A] - mov r0, r8 - strh r0, [r4, 0x3C] - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - add r0, r10 - ldr r1, =0x03005e08 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x1 - strh r1, [r0] -_081098B6: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x6 - bls _08109834 - 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_81097B4 - - thumb_func_start sub_81098EC -sub_81098EC: @ 81098EC - push {r4,lr} - adds r4, r0, 0 - bl sub_81099A0 - adds r0, r4, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08109926 - ldr r3, =0x03005e00 - movs r0, 0x3C - ldrsh r1, [r4, r0] - lsls r1, 1 - movs r0, 0x3A - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_08109926: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81098EC - - thumb_func_start sub_8109930 -sub_8109930: @ 8109930 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r2, [r1, 0x26] - ldrh r0, [r1, 0x22] - adds r2, r0 - adds r1, 0x29 - movs r0, 0 - ldrsb r0, [r1, r0] - adds r0, r2 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08109970 - lsls r0, r4, 16 - movs r1, 0x94 - lsls r1, 15 - b _08109976 - .pool -_08109970: - lsls r0, r4, 16 - movs r1, 0xB0 - lsls r1, 14 -_08109976: - adds r0, r1 - lsrs r4, r0, 16 - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8109930 - - thumb_func_start sub_8109984 -sub_8109984: @ 8109984 - movs r3, 0 - strh r3, [r0, 0x2E] - strh r3, [r0, 0x30] - ldrh r3, [r0, 0x20] - lsls r3, 3 - strh r3, [r0, 0x32] - ldrh r3, [r0, 0x22] - lsls r3, 3 - strh r3, [r0, 0x34] - lsls r1, 3 - strh r1, [r0, 0x36] - lsls r2, 3 - strh r2, [r0, 0x38] - bx lr - thumb_func_end sub_8109984 - - thumb_func_start sub_81099A0 -sub_81099A0: @ 81099A0 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _081099CA - movs r0, 0 - strh r0, [r2, 0x2E] - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - ldrh r0, [r2, 0x30] - adds r1, r0, 0 - muls r1, r0 - adds r0, r1, 0 - ldrh r3, [r2, 0x34] - adds r0, r3 - strh r0, [r2, 0x34] -_081099CA: - ldrh r0, [r2, 0x36] - ldrh r1, [r2, 0x32] - adds r0, r1 - strh r0, [r2, 0x32] - lsls r0, 16 - asrs r0, 19 - strh r0, [r2, 0x20] - ldrh r1, [r2, 0x38] - ldrh r3, [r2, 0x34] - adds r1, r3 - strh r1, [r2, 0x34] - lsls r1, 16 - asrs r3, r1, 19 - strh r3, [r2, 0x22] - adds r0, 0x8 - lsls r0, 16 - movs r1, 0x80 - lsls r1, 17 - cmp r0, r1 - bhi _08109A00 - adds r1, r3, 0 - movs r0, 0x8 - negs r0, r0 - cmp r1, r0 - blt _08109A00 - cmp r1, 0x78 - ble _08109A0C -_08109A00: - adds r0, r2, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_08109A0C: - pop {r0} - bx r0 - thumb_func_end sub_81099A0 - - thumb_func_start sub_8109A10 -sub_8109A10: @ 8109A10 - push {r4,r5,lr} - ldr r3, =0x0203841e - ldrh r1, [r3] - movs r2, 0 - strh r1, [r0, 0x20] - ldrh r1, [r3, 0x2] - strh r1, [r0, 0x22] - strh r2, [r0, 0x2E] - strh r2, [r0, 0x30] - strh r2, [r0, 0x32] - ldrh r1, [r3, 0x4] - strh r1, [r0, 0x3A] - ldrh r1, [r3, 0x6] - strh r1, [r0, 0x3C] - ldrh r4, [r0, 0x4] - lsls r2, r4, 22 - lsrs r2, 22 - movs r5, 0x8 - ldrsh r1, [r3, r5] - lsls r1, 4 - adds r2, r1 - ldr r3, =0x000003ff - adds r1, r3, 0 - ands r2, r1 - ldr r1, =0xfffffc00 - ands r1, r4 - orrs r1, r2 - strh r1, [r0, 0x4] - ldr r1, =sub_8109A64 - str r1, [r0, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8109A10 - - thumb_func_start sub_8109A64 -sub_8109A64: @ 8109A64 - push {r4,lr} - adds r2, r0, 0 - movs r1, 0x2E - ldrsh r0, [r2, r1] - cmp r0, 0x1 - beq _08109A96 - cmp r0, 0x1 - bgt _08109A7A - cmp r0, 0 - beq _08109A80 - b _08109AF4 -_08109A7A: - cmp r0, 0x2 - beq _08109AB4 - b _08109AF4 -_08109A80: - ldrh r1, [r2, 0x3A] - movs r3, 0x3A - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _08109A90 - subs r0, r1, 0x1 - strh r0, [r2, 0x3A] - b _08109AF4 -_08109A90: - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] -_08109A96: - ldrh r0, [r2, 0x22] - adds r0, 0x8 - strh r0, [r2, 0x22] - lsls r0, 16 - asrs r0, 16 - ldrh r3, [r2, 0x3C] - movs r4, 0x3C - ldrsh r1, [r2, r4] - cmp r0, r1 - blt _08109AF4 - strh r3, [r2, 0x22] - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - b _08109AF4 -_08109AB4: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _08109AE0 - movs r0, 0 - strh r0, [r2, 0x30] - ldrh r0, [r2, 0x32] - adds r0, 0x1 - strh r0, [r2, 0x32] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08109ADC - ldr r0, =0x0000fffd - b _08109ADE - .pool -_08109ADC: - movs r0, 0x3 -_08109ADE: - strh r0, [r2, 0x26] -_08109AE0: - ldrh r0, [r2, 0x34] - adds r0, 0x1 - strh r0, [r2, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - ble _08109AF4 - adds r0, r2, 0 - bl move_anim_8072740 -_08109AF4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8109A64 - - thumb_func_start sub_8109AFC -sub_8109AFC: @ 8109AFC - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _08109B70 - cmp r0, 0x1 - bgt _08109B12 - cmp r0, 0 - beq _08109B18 - b _08109C3E -_08109B12: - cmp r0, 0x2 - beq _08109BCE - b _08109C3E -_08109B18: - adds r0, r5, 0 - movs r1, 0 - bl sub_80A69CC - ldr r4, =0x0203841e - ldrb r1, [r4, 0x4] - adds r0, r5, 0 - bl StartObjectImageAnim - ldrh r0, [r4, 0x4] - strh r0, [r5, 0x3C] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08109B48 - movs r0, 0x4 - b _08109B4A - .pool -_08109B48: - ldr r0, =0x0000fffc -_08109B4A: - strh r0, [r5, 0x36] - ldr r0, =0x02038437 - ldrb r0, [r0] - bl sub_80A8328 - movs r1, 0x3 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r5, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - b _08109BC6 - .pool -_08109B70: - ldrh r0, [r5, 0x30] - adds r0, 0xC0 - strh r0, [r5, 0x30] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08109B94 - ldrh r0, [r5, 0x30] - lsls r0, 16 - asrs r0, 24 - negs r0, r0 - b _08109B9A - .pool -_08109B94: - ldrh r0, [r5, 0x30] - lsls r0, 16 - asrs r0, 24 -_08109B9A: - strh r0, [r5, 0x26] - movs r2, 0x32 - ldrsh r0, [r5, r2] - movs r2, 0x36 - ldrsh r1, [r5, r2] - bl sine - strh r0, [r5, 0x24] - ldrh r0, [r5, 0x32] - adds r0, 0x4 - movs r1, 0xFF - ands r0, r1 - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x34] - adds r0, 0x1 - strh r0, [r5, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _08109C3E - movs r0, 0 - strh r0, [r5, 0x34] -_08109BC6: - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - b _08109C3E -_08109BCE: - movs r1, 0x32 - ldrsh r0, [r5, r1] - movs r2, 0x36 - ldrsh r1, [r5, r2] - bl sine - adds r2, r0, 0 - movs r3, 0 - strh r2, [r5, 0x24] - ldrh r0, [r5, 0x32] - adds r0, 0x4 - movs r1, 0xFF - ands r0, r1 - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x34] - adds r0, 0x1 - strh r0, [r5, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1F - bne _08109C3E - ldrh r0, [r5, 0x20] - adds r1, r2, r0 - strh r1, [r5, 0x20] - ldrh r0, [r5, 0x26] - ldrh r2, [r5, 0x22] - adds r0, r2 - strh r0, [r5, 0x22] - strh r3, [r5, 0x26] - strh r3, [r5, 0x24] - movs r0, 0x80 - lsls r0, 1 - strh r0, [r5, 0x2E] - strh r1, [r5, 0x30] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x22] - strh r0, [r5, 0x34] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x36] - adds r0, r5, 0 - bl sub_80A6FD4 - ldr r0, =sub_8109C4C - str r0, [r5, 0x1C] -_08109C3E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8109AFC - - thumb_func_start sub_8109C4C -sub_8109C4C: @ 8109C4C - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - bne _08109CA4 - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r1, 0x10 - bl sine - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - ldrh r2, [r4, 0x38] - adds r0, r2, 0x4 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x38] - ldrh r0, [r4, 0x38] - lsls r2, 16 - asrs r2, 16 - cmp r2, 0 - beq _08109C82 - cmp r2, 0xC4 - ble _08109CAA -_08109C82: - lsls r0, 16 - cmp r0, 0 - ble _08109CAA - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08109CAA - ldr r0, =0x02038440 - movs r1, 0 - ldrsb r1, [r0, r1] - movs r0, 0x90 - bl audio_play_and_stuff - b _08109CAA - .pool -_08109CA4: - adds r0, r4, 0 - bl move_anim_8072740 -_08109CAA: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8109C4C - - thumb_func_start sub_8109CB0 -sub_8109CB0: @ 8109CB0 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x2E] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _08109CC8 - ldr r0, =0x0203841e - ldrh r0, [r0] - strh r0, [r4, 0x30] - adds r0, r1, 0x1 - strh r0, [r4, 0x2E] -_08109CC8: - movs r0, 0xC0 - lsls r0, 1 - adds r1, r0, 0 - ldrh r2, [r4, 0x34] - adds r1, r2 - strh r1, [r4, 0x34] - ldrh r0, [r4, 0x36] - adds r0, 0xA0 - strh r0, [r4, 0x36] - movs r2, 0x30 - ldrsh r0, [r4, r2] - lsls r1, 16 - asrs r1, 24 - bl sine - strh r0, [r4, 0x24] - movs r1, 0x30 - ldrsh r0, [r4, r1] - ldrh r1, [r4, 0x36] - lsls r1, 16 - asrs r1, 24 - bl cosine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x7 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _08109D64 - ldrh r0, [r4, 0x30] - subs r0, 0x40 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x83 - bls _08109D3C - ldr r0, =0x02038437 - ldrb r0, [r0] - bl sub_80A8328 - movs r1, 0x3 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r4, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x5] - b _08109D80 - .pool -_08109D3C: - ldr r0, =0x02038437 - ldrb r0, [r0] - bl sub_80A8328 - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x1 - movs r1, 0x3 - ands r0, r1 - lsls r0, 2 - ldrb r2, [r4, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0x5] - b _08109D80 - .pool -_08109D64: - ldrh r0, [r4, 0x30] - subs r0, 0x40 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x83 - bls _08109D78 - adds r1, r4, 0 - adds r1, 0x43 - movs r0, 0x1D - b _08109D7E -_08109D78: - adds r1, r4, 0 - adds r1, 0x43 - movs r0, 0x1F -_08109D7E: - strb r0, [r1] -_08109D80: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _08109DA8 - 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] -_08109DA8: - movs r2, 0x32 - ldrsh r0, [r4, r2] - cmp r0, 0x1E - bne _08109DB6 - adds r0, r4, 0 - bl move_anim_8072740 -_08109DB6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8109CB0 - - thumb_func_start sub_8109DBC -sub_8109DBC: @ 8109DBC - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r4, r1, r0 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - movs r2, 0x1 - negs r2, r2 - adds r1, r2, 0 - cmp r0, 0 - bne _08109DE2 - movs r1, 0x1 -_08109DE2: - strh r1, [r4, 0x20] - ldr r0, =0x02038437 - ldrb r1, [r0] - movs r0, 0x2 - eors r0, r1 - bl b_side_obj__get_some_boolean - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x1 - strh r0, [r4, 0x22] - movs r0, 0x1 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x24] - movs r0, 0x3 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - ldr r0, =sub_8109E2C - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8109DBC - - thumb_func_start sub_8109E2C -sub_8109E2C: @ 8109E2C - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r2, r0, r1 - movs r0, 0x8 - ldrsh r3, [r2, r0] - cmp r3, 0x1 - beq _08109EF4 - cmp r3, 0x1 - bgt _08109E54 - cmp r3, 0 - beq _08109E62 - b _0810A054 - .pool -_08109E54: - cmp r3, 0x2 - bne _08109E5A - b _08109F7C -_08109E5A: - cmp r3, 0x3 - bne _08109E60 - b _0810A010 -_08109E60: - b _0810A054 -_08109E62: - movs r1, 0x20 - ldrsh r0, [r2, r1] - lsls r0, 1 - ldrh r5, [r2, 0x1C] - adds r0, r5 - strh r0, [r2, 0x1C] - ldrh r0, [r2, 0xA] - adds r0, 0x1 - strh r0, [r2, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _08109E94 - strh r3, [r2, 0xA] - ldrh r0, [r2, 0xC] - adds r0, 0x1 - strh r0, [r2, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08109E90 - movs r0, 0x2 - b _08109E92 -_08109E90: - ldr r0, =0x0000fffe -_08109E92: - strh r0, [r2, 0x1E] -_08109E94: - movs r1, 0 - strh r1, [r2, 0xE] - movs r7, 0x22 - ldrsh r0, [r2, r7] - cmp r1, r0 - bge _08109ED6 - ldr r4, =0x02020630 - adds r3, r2, 0 - adds r3, 0x8 -_08109EA6: - movs r1, 0xE - ldrsh r0, [r2, r1] - adds r0, 0xE - lsls r0, 1 - adds r0, r3, r0 - movs r5, 0 - ldrsh r0, [r0, r5] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r2, 0x1E] - ldrh r7, [r2, 0x1C] - adds r0, r7 - strh r0, [r1, 0x24] - ldrh r0, [r2, 0xE] - adds r0, 0x1 - strh r0, [r2, 0xE] - lsls r0, 16 - asrs r0, 16 - movs r5, 0x22 - ldrsh r1, [r2, r5] - cmp r0, r1 - blt _08109EA6 -_08109ED6: - ldrh r0, [r2, 0x1A] - adds r0, 0x1 - strh r0, [r2, 0x1A] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - beq _08109EE6 - b _0810A054 -_08109EE6: - movs r0, 0 - strh r0, [r2, 0x1A] - b _0810A000 - .pool -_08109EF4: - ldrh r0, [r2, 0xA] - adds r0, 0x1 - strh r0, [r2, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _08109F1C - movs r0, 0 - strh r0, [r2, 0xA] - ldrh r0, [r2, 0xC] - adds r0, 0x1 - strh r0, [r2, 0xC] - ands r0, r3 - lsls r0, 16 - cmp r0, 0 - beq _08109F18 - movs r0, 0x2 - b _08109F1A -_08109F18: - ldr r0, =0x0000fffe -_08109F1A: - strh r0, [r2, 0x1E] -_08109F1C: - movs r1, 0 - strh r1, [r2, 0xE] - movs r7, 0x22 - ldrsh r0, [r2, r7] - cmp r1, r0 - bge _08109F5E - ldr r4, =0x02020630 - adds r3, r2, 0 - adds r3, 0x8 -_08109F2E: - movs r1, 0xE - ldrsh r0, [r2, r1] - adds r0, 0xE - lsls r0, 1 - adds r0, r3, r0 - movs r5, 0 - ldrsh r0, [r0, r5] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r2, 0x1E] - ldrh r7, [r2, 0x1C] - adds r0, r7 - strh r0, [r1, 0x24] - ldrh r0, [r2, 0xE] - adds r0, 0x1 - strh r0, [r2, 0xE] - lsls r0, 16 - asrs r0, 16 - movs r5, 0x22 - ldrsh r1, [r2, r5] - cmp r0, r1 - blt _08109F2E -_08109F5E: - ldrh r0, [r2, 0x1A] - adds r0, 0x1 - strh r0, [r2, 0x1A] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x60 - bne _0810A054 - movs r0, 0 - strh r0, [r2, 0x1A] - b _0810A000 - .pool -_08109F7C: - movs r7, 0x20 - ldrsh r1, [r2, r7] - lsls r1, 1 - ldrh r0, [r2, 0x1C] - subs r0, r1 - strh r0, [r2, 0x1C] - ldrh r0, [r2, 0xA] - adds r0, 0x1 - strh r0, [r2, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _08109FB0 - movs r0, 0 - strh r0, [r2, 0xA] - ldrh r0, [r2, 0xC] - adds r0, 0x1 - strh r0, [r2, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08109FAC - strh r3, [r2, 0x1E] - b _08109FB0 -_08109FAC: - ldr r0, =0x0000fffe - strh r0, [r2, 0x1E] -_08109FB0: - movs r1, 0 - strh r1, [r2, 0xE] - movs r3, 0x22 - ldrsh r0, [r2, r3] - cmp r1, r0 - bge _08109FF2 - ldr r4, =0x02020630 - adds r3, r2, 0 - adds r3, 0x8 -_08109FC2: - movs r5, 0xE - ldrsh r0, [r2, r5] - adds r0, 0xE - lsls r0, 1 - adds r0, r3, r0 - movs r7, 0 - ldrsh r0, [r0, r7] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r2, 0x1E] - ldrh r5, [r2, 0x1C] - adds r0, r5 - strh r0, [r1, 0x24] - ldrh r0, [r2, 0xE] - adds r0, 0x1 - strh r0, [r2, 0xE] - lsls r0, 16 - asrs r0, 16 - movs r7, 0x22 - ldrsh r1, [r2, r7] - cmp r0, r1 - blt _08109FC2 -_08109FF2: - ldrh r0, [r2, 0x1A] - adds r0, 0x1 - strh r0, [r2, 0x1A] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - bne _0810A054 -_0810A000: - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - b _0810A054 - .pool -_0810A010: - movs r1, 0 - strh r1, [r2, 0xE] - movs r3, 0x22 - ldrsh r0, [r2, r3] - cmp r1, r0 - bge _0810A04E - ldr r6, =0x02020630 - adds r3, r2, 0 - adds r3, 0x8 - movs r5, 0 -_0810A024: - movs r7, 0xE - ldrsh r0, [r2, r7] - adds r0, 0xE - lsls r0, 1 - adds r0, r3, r0 - movs r7, 0 - ldrsh r1, [r0, r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r5, [r0, 0x24] - ldrh r0, [r2, 0xE] - adds r0, 0x1 - strh r0, [r2, 0xE] - lsls r0, 16 - asrs r0, 16 - movs r7, 0x22 - ldrsh r1, [r2, r7] - cmp r0, r1 - blt _0810A024 -_0810A04E: - adds r0, r4, 0 - bl move_anim_task_del -_0810A054: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8109E2C - - thumb_func_start sub_810A060 -sub_810A060: @ 810A060 - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x8] - lsls r0, 4 - ldr r1, =0x0203841e - ldrb r2, [r1] - ldrh r3, [r1, 0x2] - movs r1, 0x10 - bl pal_fade_1 - adds r0, r4, 0 - bl move_anim_task_del - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810A060 - - thumb_func_start sub_810A094 -sub_810A094: @ 810A094 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r2, r0, r1 - movs r3, 0x8 - ldrsh r0, [r2, r3] - mov r9, r1 - ldr r4, =0x0203841e - mov r8, r4 - cmp r0, 0 - bne _0810A0CA - ldrh r0, [r4] - strh r0, [r2, 0xA] - ldrh r0, [r4, 0x2] - strh r0, [r2, 0xC] - ldrh r0, [r4, 0x4] - strh r0, [r2, 0xE] - ldrh r0, [r4, 0x6] - strh r0, [r2, 0x10] -_0810A0CA: - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - ldr r1, =0x020241e4 - ldr r0, =0x02038437 - ldrb r0, [r0] - adds r0, r1 - ldrb r6, [r0] - movs r5, 0x10 - ldrsh r0, [r2, r5] - cmp r0, 0 - bne _0810A100 - ldr r4, =gUnknown_08595684 - movs r1, 0x8 - ldrsh r0, [r2, r1] - b _0810A106 - .pool -_0810A100: - ldr r4, =gUnknown_08595694 - movs r3, 0x8 - ldrsh r0, [r2, r3] -_0810A106: - movs r1, 0xA - bl __modsi3 - lsls r0, 16 - asrs r0, 16 - adds r0, r4 - ldrb r5, [r0] - lsls r0, r7, 2 - adds r1, r0, r7 - lsls r1, 3 - add r1, r9 - movs r4, 0xE - ldrsh r1, [r1, r4] - mov r12, r0 - cmp r1, 0x1 - bne _0810A154 - ldr r2, =0x02020630 - lsls r3, r6, 4 - adds r0, r3, r6 - lsls r0, 2 - adds r0, r2 - mov r10, r0 - mov r0, r8 - movs r4, 0x2 - ldrsh r1, [r0, r4] - lsls r0, r5, 24 - asrs r0, 24 - muls r0, r1 - cmp r0, 0 - bge _0810A144 - negs r0, r0 -_0810A144: - mov r5, r10 - strh r0, [r5, 0x26] - b _0810A16E - .pool -_0810A154: - ldr r3, =0x02020630 - lsls r4, r6, 4 - adds r2, r4, r6 - lsls r2, 2 - adds r2, r3 - lsls r0, r5, 24 - asrs r0, 24 - mov r5, r8 - ldrh r1, [r5, 0x2] - muls r0, r1 - strh r0, [r2, 0x24] - adds r2, r3, 0 - adds r3, r4, 0 -_0810A16E: - mov r1, r12 - adds r0, r1, r7 - lsls r0, 3 - add r0, r9 - movs r4, 0x8 - ldrsh r1, [r0, r4] - movs r5, 0xA - ldrsh r0, [r0, r5] - cmp r1, r0 - bne _0810A194 - adds r0, r3, r6 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strh r1, [r0, 0x24] - strh r1, [r0, 0x26] - adds r0, r7, 0 - bl move_anim_task_del -_0810A194: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810A094 - - thumb_func_start sub_810A1A8 -sub_810A1A8: @ 810A1A8 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810A1D0 - ldr r0, =0x0203841e - ldrh r1, [r4, 0x20] - ldrh r2, [r0] - subs r1, r2 - strh r1, [r4, 0x20] - b _0810A1DC - .pool -_0810A1D0: - ldr r1, =0x0203841e - ldrh r0, [r1] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - adds r0, r1, 0 -_0810A1DC: - ldrh r0, [r0, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r0, =sub_810A1F8 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810A1A8 - - thumb_func_start sub_810A1F8 -sub_810A1F8: @ 810A1F8 - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0810A20E - adds r0, r2, 0 - bl move_anim_8072740 -_0810A20E: - pop {r0} - bx r0 - thumb_func_end sub_810A1F8 - - thumb_func_start sub_810A214 -sub_810A214: @ 810A214 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810A23C - ldr r0, =0x0203841e - ldrh r1, [r4, 0x20] - ldrh r0, [r0] - subs r1, r0 - strh r1, [r4, 0x20] - b _0810A246 - .pool -_0810A23C: - ldr r0, =0x0203841e - ldrh r0, [r0] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] -_0810A246: - ldr r0, =sub_810A258 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810A214 - - thumb_func_start sub_810A258 -sub_810A258: @ 810A258 - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0810A26E - adds r0, r2, 0 - bl move_anim_8074EE0 -_0810A26E: - pop {r0} - bx r0 - thumb_func_end sub_810A258 - - thumb_func_start sub_810A274 -sub_810A274: @ 810A274 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810A2C4 - ldr r2, =0x0203841e - ldrh r0, [r5, 0x20] - ldrh r1, [r2] - subs r0, r1 - strh r0, [r5, 0x20] - ldrh r0, [r5, 0x22] - ldrh r1, [r2, 0x2] - subs r0, r1 - strh r0, [r5, 0x22] - b _0810A2D8 - .pool -_0810A2C4: - ldr r0, =0x0203841e - ldrh r1, [r0] - ldrh r2, [r5, 0x20] - adds r1, r2 - strh r1, [r5, 0x20] - ldrh r1, [r0, 0x2] - ldrh r2, [r5, 0x22] - adds r1, r2 - strh r1, [r5, 0x22] - adds r2, r0, 0 -_0810A2D8: - movs r0, 0 - strh r0, [r5, 0x2E] - ldrh r0, [r2, 0x4] - strh r0, [r5, 0x30] - ldrh r0, [r2, 0x6] - strh r0, [r5, 0x32] - ldrh r0, [r2, 0x8] - strh r0, [r5, 0x34] - ldr r1, =move_anim_8074EE0 - adds r0, r5, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A62EC - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810A274 - - thumb_func_start sub_810A308 -sub_810A308: @ 810A308 - push {r4-r7,lr} - adds r5, r0, 0 - ldr r0, =0x0203841e - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0x1 - beq _0810A380 - cmp r0, 0x1 - bgt _0810A324 - cmp r0, 0 - beq _0810A32E - b _0810A380 - .pool -_0810A324: - cmp r0, 0x2 - beq _0810A338 - cmp r0, 0x3 - beq _0810A35C - b _0810A380 -_0810A32E: - ldr r0, =0x02038436 - b _0810A382 - .pool -_0810A338: - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r6, 0x2 - eors r0, r6 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - bne _0810A354 - ldrb r4, [r4] - b _0810A384 - .pool -_0810A354: - ldrb r0, [r4] - adds r4, r6, 0 - eors r4, r0 - b _0810A384 -_0810A35C: - ldr r0, =0x02038436 - ldrb r0, [r0] - movs r4, 0x2 - eors r0, r4 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _0810A380 - ldr r0, =0x02038437 - ldrb r0, [r0] - eors r4, r0 - b _0810A384 - .pool -_0810A380: - ldr r0, =0x02038437 -_0810A382: - ldrb r4, [r0] -_0810A384: - ldr r0, =0x0203841e - movs r2, 0xA - ldrsh r0, [r0, r2] - cmp r0, 0 - bne _0810A3AC - adds r0, r4, 0 - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - adds r0, r4, 0 - movs r1, 0x1 - b _0810A3BE - .pool -_0810A3AC: - adds r0, r4, 0 - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - adds r0, r4, 0 - movs r1, 0x3 -_0810A3BE: - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r7, =gUnknown_08329F40 - ldr r6, =0x0203841e - movs r1, 0 - ldrsh r0, [r6, r1] - lsls r0, 1 - adds r0, r7 - movs r2, 0 - ldrsh r1, [r0, r2] - movs r2, 0x2 - ldrsh r0, [r6, r2] - muls r0, r1 - asrs r0, 8 - strh r0, [r5, 0x24] - movs r1, 0 - ldrsh r0, [r6, r1] - adds r0, 0x40 - lsls r0, 1 - adds r0, r7 - movs r2, 0 - ldrsh r1, [r0, r2] - movs r2, 0x2 - ldrsh r0, [r6, r2] - muls r0, r1 - asrs r0, 8 - strh r0, [r5, 0x26] - ldrh r1, [r6, 0xC] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0810A422 - adds r0, r4, 0 - bl sub_80A8328 - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x1 - movs r1, 0x3 - ands r0, r1 - lsls r0, 2 - ldrb r2, [r5, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r5, 0x5] -_0810A422: - ldrb r2, [r5, 0x3] - lsls r2, 26 - lsrs r2, 27 - movs r0, 0x4 - ldrsh r1, [r6, r0] - lsls r0, r1, 1 - adds r0, r7 - ldrh r0, [r0] - ldr r3, =0x02021bc0 - lsls r2, 3 - adds r2, r3 - adds r1, 0x40 - lsls r1, 1 - adds r1, r7 - ldrh r1, [r1] - strh r1, [r2, 0x6] - strh r1, [r2] - strh r0, [r2, 0x2] - lsls r0, 16 - asrs r0, 16 - negs r0, r0 - strh r0, [r2, 0x4] - ldrh r0, [r6, 0x6] - strh r0, [r5, 0x2E] - ldr r0, =sub_810E2C8 - str r0, [r5, 0x1C] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810A308 - - thumb_func_start sub_810A46C -sub_810A46C: @ 810A46C - push {r4-r6,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r5, =0x0203841e - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x30] - ldr r6, =0x02038437 - ldrb r0, [r6] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x34] - ldrb r0, [r6] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x36] - adds r0, r4, 0 - bl obj_translate_based_on_private_1_2_3_4 - ldrh r0, [r5, 0x4] - strh r0, [r4, 0x38] - ldrh r0, [r5, 0xA] - strh r0, [r4, 0x3A] - ldrh r0, [r5, 0x8] - strh r0, [r4, 0x3C] - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - movs r3, 0xC - ldrsh r0, [r5, r3] - lsls r0, 2 - adds r1, r0 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - ldr r1, =sub_810A4F4 - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810A46C - - thumb_func_start sub_810A4F4 -sub_810A4F4: @ 810A4F4 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - bne _0810A55E - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl sine - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - movs r2, 0x3C - ldrsh r0, [r4, r2] - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl cosine - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x3A] - ldrh r2, [r4, 0x3C] - adds r0, r2 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x3C] - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r1, 0x3 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _0810A564 - 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] - b _0810A564 -_0810A55E: - adds r0, r4, 0 - bl move_anim_8072740 -_0810A564: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810A4F4 - - thumb_func_start sub_810A56C -sub_810A56C: @ 810A56C - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x38] - subs r0, 0x1 - strh r0, [r3, 0x38] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0810A5A4 - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - 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 - mov r1, r12 - strb r0, [r1] - ldrh r0, [r3, 0x36] - strh r0, [r3, 0x38] -_0810A5A4: - ldrh r0, [r3, 0x34] - subs r1, r0, 0x1 - strh r1, [r3, 0x34] - lsls r0, 16 - cmp r0, 0 - bgt _0810A5B6 - adds r0, r3, 0 - bl move_anim_8072740 -_0810A5B6: - pop {r0} - bx r0 - thumb_func_end sub_810A56C - - thumb_func_start sub_810A5BC -sub_810A5BC: @ 810A5BC - push {r4-r6,lr} - adds r6, r0, 0 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0810A5D8 - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0810A5E0 -_0810A5D8: - ldr r1, =0x0203841e - ldrh r0, [r1, 0x2] - negs r0, r0 - strh r0, [r1, 0x2] -_0810A5E0: - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - ldr r4, =0x0203841e - lsrs r0, 24 - ldrh r1, [r4, 0x2] - adds r0, r1 - strh r0, [r6, 0x20] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x4] - adds r0, r1 - strh r0, [r6, 0x22] - ldrh r0, [r4] - strh r0, [r6, 0x34] - ldrh r0, [r4, 0x6] - strh r0, [r6, 0x36] - strh r0, [r6, 0x38] - ldr r0, =sub_810A56C - str r0, [r6, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810A5BC - - thumb_func_start sub_810A628 -sub_810A628: @ 810A628 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r1, =0x0203841e - ldrh r0, [r1, 0x6] - strh r0, [r5, 0x2E] - movs r2, 0xE - ldrsh r0, [r1, r2] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0810A64C - ldr r0, =0x02038437 - b _0810A64E - .pool -_0810A64C: - ldr r0, =0x02038436 -_0810A64E: - ldrb r6, [r0] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0810A666 - adds r0, r6, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0810A66E -_0810A666: - ldr r1, =0x0203841e - ldrh r0, [r1] - negs r0, r0 - strh r0, [r1] -_0810A66E: - adds r0, r6, 0 - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - ldr r4, =0x0203841e - lsrs r0, 24 - ldrh r3, [r4] - adds r0, r3 - strh r0, [r5, 0x20] - adds r0, r6, 0 - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x2] - adds r0, r1 - strh r0, [r5, 0x22] - ldrh r1, [r4, 0xE] - ldr r0, =0x00007fff - ands r0, r1 - strh r0, [r5, 0x36] - ldrh r0, [r4, 0x4] - strh r0, [r5, 0x38] - ldrh r0, [r4, 0xA] - strh r0, [r5, 0x3A] - ldrh r0, [r4, 0x8] - strh r0, [r5, 0x3C] - ldrh r2, [r5, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - movs r3, 0xC - ldrsh r0, [r4, r3] - lsls r0, 2 - adds r1, r0 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x4] - ldr r1, =sub_810A6EC - str r1, [r5, 0x1C] - adds r0, r5, 0 - bl _call_via_r1 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810A628 - - thumb_func_start sub_810A6EC -sub_810A6EC: @ 810A6EC - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x24] - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl cosine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x3A] - ldrh r1, [r4, 0x3C] - adds r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x3C] - movs r2, 0x3C - ldrsh r0, [r4, r2] - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl __modsi3 - cmp r0, 0 - bne _0810A742 - 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] -_0810A742: - ldrh r0, [r4, 0x2E] - subs r1, r0, 0x1 - strh r1, [r4, 0x2E] - lsls r0, 16 - cmp r0, 0 - bgt _0810A754 - adds r0, r4, 0 - bl move_anim_8072740 -_0810A754: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810A6EC - - thumb_func_start sub_810A75C -sub_810A75C: @ 810A75C - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0 - bl sub_80A6980 - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - ldr r3, =0x0203841e - movs r5, 0x6 - ldrsh r0, [r3, r5] - lsls r0, 2 - adds r1, r0 - ldr r5, =0x000003ff - adds r0, r5, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - movs r1, 0x6 - ldrsh r0, [r3, r1] - cmp r0, 0x1 - bne _0810A7A4 - ldrb r0, [r4, 0x3] - movs r1, 0x3F - negs r1, r1 - ands r1, r0 - movs r0, 0x10 - b _0810A7B2 - .pool -_0810A7A4: - cmp r0, 0x2 - bne _0810A7B6 - ldrb r0, [r4, 0x3] - movs r1, 0x3F - negs r1, r1 - ands r1, r0 - movs r0, 0x20 -_0810A7B2: - orrs r1, r0 - strb r1, [r4, 0x3] -_0810A7B6: - ldr r0, =0x0203841e - ldrh r0, [r0, 0x4] - strh r0, [r4, 0x2E] - ldr r0, =sub_80A64B0 - str r0, [r4, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810A75C - - thumb_func_start sub_810A7DC -sub_810A7DC: @ 810A7DC - push {r4-r6,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r6, =0x02038437 - ldrb r0, [r6] - movs r1, 0 - bl sub_80A5C6C - ldr r1, =0x03005e00 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r1 - lsls r0, 24 - ldr r5, =0x0203841e - lsrs r0, 24 - ldrh r1, [r5] - adds r0, r1 - strh r0, [r4, 0x8] - ldrb r0, [r6] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r5, 0x2] - adds r0, r1 - strh r0, [r4, 0xA] - ldrh r0, [r5, 0x4] - strh r0, [r4, 0xC] - ldr r0, =sub_810A834 - str r0, [r4] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810A7DC - - thumb_func_start sub_810A834 -sub_810A834: @ 810A834 - 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 - movs r5, 0 - movs r7, 0 - ldr r1, =0x03005e00 - lsls r0, 2 - add r0, r9 - lsls r0, 3 - adds r0, r1 - ldrb r2, [r0, 0xC] - str r2, [sp] - ldrh r4, [r0, 0x8] - ldrh r6, [r0, 0xA] - movs r3, 0xC - ldrsh r0, [r0, r3] - mov r10, r1 - cmp r0, 0 - bne _0810A878 - movs r0, 0 - mov r8, r0 - movs r2, 0x1 - movs r1, 0x10 - mov r12, r1 - b _0810A882 - .pool -_0810A878: - movs r2, 0x10 - mov r12, r2 - movs r3, 0x8 - mov r8, r3 - movs r2, 0x4 -_0810A882: - mov r0, r9 - lsls r1, r0, 2 - adds r0, r1, r0 - lsls r0, 3 - add r0, r10 - movs r3, 0x1C - ldrsh r0, [r0, r3] - mov r10, r1 - cmp r0, 0xA - bhi _0810A978 - lsls r0, 2 - ldr r1, =_0810A8A4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0810A8A4: - .4byte _0810A8D0 - .4byte _0810A978 - .4byte _0810A8E4 - .4byte _0810A978 - .4byte _0810A904 - .4byte _0810A978 - .4byte _0810A91A - .4byte _0810A978 - .4byte _0810A93C - .4byte _0810A978 - .4byte _0810A970 -_0810A8D0: - ldr r0, =gUnknown_08595828 - lsls r1, r4, 16 - asrs r1, 16 - lsls r2, r6, 16 - asrs r2, 16 - mov r4, r12 - lsls r3, r4, 16 - b _0810A952 - .pool -_0810A8E4: - mov r0, r12 - lsls r3, r0, 17 - mov r1, r8 - adds r0, r1, r2 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r0, =gUnknown_08595828 - lsls r1, r4, 16 - asrs r1, 16 - lsls r2, r6, 16 - asrs r2, 16 - b _0810A952 - .pool -_0810A904: - mov r3, r12 - lsls r0, r3, 16 - asrs r0, 16 - lsls r3, r0, 1 - adds r3, r0 - lsls r0, r2, 1 - add r0, r8 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - b _0810A946 -_0810A91A: - mov r0, r12 - lsls r3, r0, 18 - lsls r0, r2, 1 - adds r0, r2 - add r0, r8 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r0, =gUnknown_08595828 - lsls r1, r4, 16 - asrs r1, 16 - lsls r2, r6, 16 - asrs r2, 16 - b _0810A952 - .pool -_0810A93C: - mov r1, r12 - lsls r0, r1, 16 - asrs r0, 16 - lsls r3, r0, 2 - adds r3, r0 -_0810A946: - ldr r0, =gUnknown_08595828 - lsls r1, r4, 16 - asrs r1, 16 - lsls r2, r6, 16 - asrs r2, 16 - lsls r3, 16 -_0810A952: - asrs r3, 16 - adds r2, r3 - lsls r2, 16 - asrs r2, 16 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - b _0810A978 - .pool -_0810A970: - mov r0, r9 - bl move_anim_task_del - b _0810A9BC -_0810A978: - cmp r7, 0 - beq _0810A9AC - ldr r4, =0x02020630 - lsls r3, r5, 4 - adds r3, r5 - lsls r3, 2 - adds r0, r3, r4 - ldrh r5, [r0, 0x4] - lsls r2, r5, 22 - lsrs r2, 22 - add r2, r8 - ldr r6, =0x000003ff - adds r1, r6, 0 - ands r2, r1 - ldr r1, =0xfffffc00 - ands r1, r5 - orrs r1, r2 - strh r1, [r0, 0x4] - mov r1, sp - ldrh r1, [r1] - strh r1, [r0, 0x2E] - adds r4, 0x1C - adds r3, r4 - ldr r1, [r3] - bl _call_via_r1 -_0810A9AC: - ldr r0, =0x03005e00 - mov r1, r10 - add r1, r9 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x1C] - adds r0, 0x1 - strh r0, [r1, 0x1C] -_0810A9BC: - 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_810A834 - - thumb_func_start sub_810A9DC -sub_810A9DC: @ 810A9DC - push {lr} - adds r3, r0, 0 - movs r1, 0x2E - ldrsh r0, [r3, r1] - cmp r0, 0 - bne _0810A9FE - ldrb r1, [r3, 0x1] - movs r2, 0x3F - adds r0, r2, 0 - ands r0, r1 - movs r1, 0x80 - orrs r0, r1 - strb r0, [r3, 0x1] - ldrb r0, [r3, 0x3] - ands r2, r0 - strb r2, [r3, 0x3] - b _0810AA12 -_0810A9FE: - ldrb r2, [r3, 0x1] - movs r1, 0x3F - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3, 0x1] - ldrb r0, [r3, 0x3] - ands r1, r0 - movs r0, 0x40 - orrs r1, r0 - strb r1, [r3, 0x3] -_0810AA12: - ldrh r0, [r3, 0x30] - adds r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - bne _0810AA26 - adds r0, r3, 0 - bl RemoveObjectAndFreeTiles -_0810AA26: - pop {r0} - bx r0 - thumb_func_end sub_810A9DC - - thumb_func_start sub_810AA2C -sub_810AA2C: @ 810AA2C - push {r4-r7,lr} - adds r4, r0, 0 - ldr r0, =0x0203841e - ldrh r1, [r0] - ldrh r2, [r4, 0x20] - adds r1, r2 - strh r1, [r4, 0x20] - ldrh r0, [r0, 0x2] - ldrh r3, [r4, 0x22] - adds r0, r3 - strh r0, [r4, 0x22] - ldr r0, =gUnknown_08595840 - adds r1, 0x20 - lsls r1, 16 - asrs r1, 16 - movs r7, 0x22 - ldrsh r2, [r4, r7] - adds r3, r4, 0 - adds r3, 0x43 - ldrb r3, [r3] - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r6, r2, r3 - ldrh r5, [r6, 0x4] - lsls r1, r5, 22 - lsrs r1, 22 - adds r1, 0x8 - ldr r7, =0x000003ff - adds r0, r7, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r5 - orrs r0, r1 - strh r0, [r6, 0x4] - ldr r1, =0x020383fe - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - adds r3, 0x1C - adds r2, r3 - ldr r0, =sub_810AAB0 - str r0, [r2] - str r0, [r4, 0x1C] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810AA2C - - thumb_func_start sub_810AAB0 -sub_810AAB0: @ 810AAB0 - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bne _0810AAE4 - movs r0, 0 - strh r0, [r3, 0x2E] - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - 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 - mov r1, r12 - strb r0, [r1] -_0810AAE4: - ldrh r0, [r3, 0x30] - adds r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x33 - bne _0810AAF8 - adds r0, r3, 0 - bl move_anim_8072740 -_0810AAF8: - pop {r0} - bx r0 - thumb_func_end sub_810AAB0 - - thumb_func_start sub_810AAFC -sub_810AAFC: @ 810AAFC - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r5, r1, r0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0810AB28 - ldr r4, =0x02038436 - b _0810AB2A - .pool -_0810AB28: - ldr r4, =0x02038437 -_0810AB2A: - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x24] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x26] - ldr r2, =0x0203841e - ldrh r0, [r2, 0x2] - movs r1, 0 - strh r0, [r5, 0x14] - strh r1, [r5, 0x16] - strh r1, [r5, 0x18] - strh r1, [r5, 0x1A] - strh r1, [r5, 0x1C] - ldrh r0, [r2, 0x6] - strh r0, [r5, 0x1E] - strh r1, [r5, 0x20] - ldrh r0, [r2, 0x4] - strh r0, [r5, 0x22] - ldr r0, =sub_810AB78 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810AAFC - - thumb_func_start sub_810AB78 -sub_810AB78: @ 810AB78 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - adds r2, r6, 0 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r5, r0, r1 - movs r1, 0x14 - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _0810AC78 - ldrh r0, [r5, 0x20] - adds r0, 0x1 - movs r7, 0 - strh r0, [r5, 0x20] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x22 - ldrsh r1, [r5, r2] - cmp r0, r1 - ble _0810AC86 - strh r7, [r5, 0x20] - ldr r0, =gUnknown_085958A8 - movs r3, 0x24 - ldrsh r1, [r5, r3] - movs r3, 0x26 - ldrsh r2, [r5, r3] - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _0810AC86 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - ldr r1, =gUnknown_08595858 - movs r2, 0x1A - ldrsh r0, [r5, r2] - lsls r0, 1 - adds r0, r1 - movs r3, 0 - ldrsb r3, [r0, r3] - ldrh r0, [r4, 0x20] - adds r3, r0 - strh r3, [r4, 0x20] - movs r2, 0x1A - ldrsh r0, [r5, r2] - lsls r0, 1 - adds r1, 0x1 - adds r0, r1 - movs r2, 0 - ldrsb r2, [r0, r2] - ldrh r0, [r4, 0x22] - adds r2, r0 - strh r2, [r4, 0x22] - movs r1, 0x18 - ldrsh r0, [r5, r1] - lsls r1, r0, 2 - adds r1, r0 - movs r0, 0x28 - subs r0, r1 - strh r0, [r4, 0x2E] - strh r3, [r4, 0x30] - ldrh r0, [r5, 0x24] - strh r0, [r4, 0x32] - strh r2, [r4, 0x34] - ldrh r0, [r5, 0x26] - strh r0, [r4, 0x36] - strh r6, [r4, 0x38] - adds r0, r4, 0 - bl obj_translate_based_on_private_1_2_3_4 - ldr r1, =sub_810ACC0 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A67D8 - str r0, [r4, 0x1C] - ldrh r0, [r5, 0x1A] - adds r0, 0x1 - strh r0, [r5, 0x1A] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - ble _0810AC30 - strh r7, [r5, 0x1A] -_0810AC30: - ldrh r0, [r5, 0x1C] - adds r0, 0x1 - strh r0, [r5, 0x1C] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x1E - ldrsh r1, [r5, r2] - cmp r0, r1 - blt _0810AC52 - strh r7, [r5, 0x1C] - ldrh r1, [r5, 0x18] - movs r3, 0x18 - ldrsh r0, [r5, r3] - cmp r0, 0x5 - bgt _0810AC52 - adds r0, r1, 0x1 - strh r0, [r5, 0x18] -_0810AC52: - ldrh r0, [r5, 0x16] - adds r0, 0x1 - strh r0, [r5, 0x16] - ldrh r0, [r5, 0x14] - subs r0, 0x1 - strh r0, [r5, 0x14] - b _0810AC86 - .pool -_0810AC78: - movs r1, 0x16 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0810AC86 - adds r0, r2, 0 - bl move_anim_task_del -_0810AC86: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_810AB78 - - thumb_func_start sub_810AC8C -sub_810AC8C: @ 810AC8C - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - beq _0810ACB4 - ldr r2, =0x03005e00 - movs r0, 0x38 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r0, 0x16] - subs r1, 0x1 - strh r1, [r0, 0x16] - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0810ACB4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810AC8C - - thumb_func_start sub_810ACC0 -sub_810ACC0: @ 810ACC0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl StartObjectImageAnim - ldr r0, =sub_810AC8C - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810ACC0 - - thumb_func_start sub_810ACD8 -sub_810ACD8: @ 810ACD8 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0810ACF4 - ldr r4, =0x02038436 - b _0810ACF6 - .pool -_0810ACF4: - ldr r4, =0x02038437 -_0810ACF6: - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r1, =move_anim_8074EE0 - adds r0, r5, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A67BC - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810ACD8 - - thumb_func_start sub_810AD30 -sub_810AD30: @ 810AD30 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0810AD4C - ldr r4, =0x02038436 - b _0810AD4E - .pool -_0810AD4C: - ldr r4, =0x02038437 -_0810AD4E: - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r1, =0x0203841e - ldrh r0, [r1, 0x2] - strh r0, [r5, 0x24] - ldrh r0, [r1, 0x4] - strh r0, [r5, 0x26] - ldr r1, =move_anim_8072740 - adds r0, r5, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A67D8 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810AD30 - - thumb_func_start sub_810AD98 -sub_810AD98: @ 810AD98 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x3A] - movs r0, 0x10 - strh r0, [r5, 0x3C] - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0810ADE6 - movs r1, 0x3C - ldrsh r0, [r5, r1] - negs r0, r0 - strh r0, [r5, 0x3C] -_0810ADE6: - ldr r0, =sub_810ADF8 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810AD98 - - thumb_func_start sub_810ADF8 -sub_810ADF8: @ 810ADF8 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0810AE0A - cmp r0, 0x1 - beq _0810AE20 - b _0810AE50 -_0810AE0A: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x28 - ble _0810AE50 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0810AE50 -_0810AE20: - ldrh r2, [r4, 0x3C] - ldrh r1, [r4, 0x20] - adds r0, r2, r1 - strh r0, [r4, 0x20] - ldr r3, =0x02020630 - movs r0, 0x3A - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x24] - adds r2, r1 - strh r2, [r0, 0x24] - ldrh r0, [r4, 0x20] - adds r0, 0x50 - lsls r0, 16 - movs r1, 0xC8 - lsls r1, 17 - cmp r0, r1 - bls _0810AE50 - adds r0, r4, 0 - bl move_anim_8074EE0 -_0810AE50: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810ADF8 - - thumb_func_start sub_810AE5C -sub_810AE5C: @ 810AE5C - push {r4-r6,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _0810AEF0 - cmp r0, 0x1 - bgt _0810AE84 - cmp r0, 0 - beq _0810AE90 - b _0810AFC0 - .pool -_0810AE84: - cmp r0, 0x2 - beq _0810AF4C - cmp r0, 0x3 - bne _0810AE8E - b _0810AFA0 -_0810AE8E: - b _0810AFC0 -_0810AE90: - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - movs r6, 0 - strh r0, [r5, 0x26] - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x24] - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0810AECC - ldr r0, =0x0000ffe0 - strh r0, [r5, 0x24] - movs r0, 0x2 - b _0810AED2 - .pool -_0810AECC: - movs r0, 0x20 - strh r0, [r5, 0x24] - ldr r0, =0x0000fffe -_0810AED2: - strh r0, [r5, 0x22] - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r5, 0x24] - strh r1, [r0, 0x24] - b _0810AF92 - .pool -_0810AEF0: - ldrh r0, [r5, 0xA] - adds r0, 0x1 - strh r0, [r5, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0810AFC0 - movs r0, 0 - strh r0, [r5, 0xA] - ldr r4, =0x02020630 - movs r1, 0x26 - ldrsh r0, [r5, r1] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r4 - adds r2, 0x3E - ldrb r3, [r2] - lsls r0, r3, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldrh r1, [r5, 0x24] - movs r2, 0x24 - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _0810AF92 - ldrh r2, [r5, 0x22] - adds r2, r1, r2 - strh r2, [r5, 0x24] - movs r0, 0x26 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r2, [r0, 0x24] - b _0810AFC0 - .pool -_0810AF4C: - ldrh r0, [r5, 0xA] - adds r0, 0x1 - strh r0, [r5, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0810AFC0 - movs r0, 0 - strh r0, [r5, 0xA] - ldr r1, =0x02020630 - movs r2, 0x26 - ldrsh r0, [r5, r2] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r1 - adds r2, 0x3E - ldrb r3, [r2] - lsls r0, r3, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r5, 0xC] - adds r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - bne _0810AFC0 -_0810AF92: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - b _0810AFC0 - .pool -_0810AFA0: - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r5, r0] - 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] - adds r0, r3, 0 - bl move_anim_task_del -_0810AFC0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810AE5C - - thumb_func_start sub_810AFCC -sub_810AFCC: @ 810AFCC - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - bne _0810AFE6 - b _0810B10C -_0810AFE6: - cmp r0, 0x1 - bgt _0810AFF4 - cmp r0, 0 - beq _0810AFFC - b _0810B14E - .pool -_0810AFF4: - cmp r0, 0x2 - bne _0810AFFA - b _0810B140 -_0810AFFA: - b _0810B14E -_0810AFFC: - ldr r4, =0x02038436 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - movs r2, 0x1 - negs r2, r2 - adds r1, r2, 0 - cmp r0, 0 - bne _0810B012 - movs r1, 0x1 -_0810B012: - movs r6, 0 - strh r1, [r5, 0xA] - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r2, [r0, r1] - adds r3, r0, 0 - cmp r2, 0 - beq _0810B048 - cmp r2, 0x4 - beq _0810B070 - ldrh r1, [r3] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0810B0A8 - movs r0, 0x80 - lsls r0, 1 - strh r0, [r5, 0xE] - ldr r0, =0x0000fff0 - b _0810B0B0 - .pool -_0810B048: - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0xE] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x12] - movs r2, 0xA - ldrsh r0, [r5, r2] - lsls r0, 7 - adds r0, 0x78 - strh r0, [r5, 0x10] - b _0810B0E6 -_0810B070: - movs r0, 0xA - ldrsh r1, [r5, r0] - lsls r1, 7 - movs r0, 0x78 - subs r0, r1 - strh r0, [r5, 0xE] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x12] - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - movs r2, 0xA - ldrsh r1, [r5, r2] - lsls r1, 5 - subs r0, r1 - strh r0, [r5, 0x10] - b _0810B0E6 - .pool -_0810B0A8: - ldr r0, =0x0000fff0 - strh r0, [r5, 0xE] - movs r0, 0x80 - lsls r0, 1 -_0810B0B0: - strh r0, [r5, 0x10] - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0x1 - bne _0810B0D0 - movs r2, 0 - ldrsh r0, [r3, r2] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 1 - movs r0, 0x50 - subs r0, r1 - strh r0, [r5, 0x12] - b _0810B0E6 - .pool -_0810B0D0: - movs r0, 0 - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - adds r0, 0x28 - strh r0, [r5, 0x12] - ldrh r1, [r5, 0xE] - ldrh r0, [r5, 0x10] - strh r0, [r5, 0xE] - strh r1, [r5, 0x10] -_0810B0E6: - movs r2, 0xE - ldrsh r1, [r5, r2] - movs r2, 0x10 - ldrsh r0, [r5, r2] - cmp r1, r0 - bge _0810B0FC - movs r1, 0 - movs r0, 0x1 - strh r0, [r5, 0xA] - strh r1, [r5, 0x14] - b _0810B138 -_0810B0FC: - ldr r0, =0x0000ffff - strh r0, [r5, 0xA] - movs r0, 0x3 - strh r0, [r5, 0x14] - b _0810B138 - .pool -_0810B10C: - ldrh r0, [r5, 0xC] - adds r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - cmp r0, 0 - ble _0810B14E - movs r0, 0 - strh r0, [r5, 0xC] - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_810B154 - lsls r0, 24 - cmp r0, 0 - bne _0810B138 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_810B154 - lsls r0, 24 - cmp r0, 0 - beq _0810B14E -_0810B138: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - b _0810B14E -_0810B140: - movs r1, 0x16 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0810B14E - adds r0, r4, 0 - bl move_anim_task_del -_0810B14E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_810AFCC - - thumb_func_start sub_810B154 -sub_810B154: @ 810B154 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - ldr r0, =gUnknown_08595A00 - movs r2, 0xE - ldrsh r1, [r4, r2] - movs r3, 0x12 - ldrsh r2, [r4, r3] - movs r3, 0x23 - bl AddObjectToFront - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - beq _0810B18A - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - strh r5, [r0, 0x3A] - movs r1, 0x7 - strh r1, [r0, 0x3C] - ldrh r0, [r4, 0x16] - adds r0, 0x1 - strh r0, [r4, 0x16] -_0810B18A: - ldrh r1, [r4, 0xA] - ldrh r5, [r4, 0x14] - adds r0, r1, r5 - strh r0, [r4, 0x14] - lsls r0, 16 - cmp r0, 0 - bge _0810B19C - movs r0, 0x3 - strh r0, [r4, 0x14] -_0810B19C: - movs r2, 0x14 - ldrsh r0, [r4, r2] - cmp r0, 0x3 - ble _0810B1A8 - movs r0, 0 - strh r0, [r4, 0x14] -_0810B1A8: - movs r3, 0xA - ldrsh r0, [r4, r3] - lsls r0, 4 - ldrh r5, [r4, 0xE] - adds r2, r0, r5 - strh r2, [r4, 0xE] - lsls r0, r1, 16 - asrs r3, r0, 16 - cmp r3, 0x1 - bne _0810B1C8 - lsls r0, r2, 16 - asrs r0, 16 - movs r5, 0x10 - ldrsh r1, [r4, r5] - cmp r0, r1 - bge _0810B1DC -_0810B1C8: - movs r0, 0x1 - negs r0, r0 - cmp r3, r0 - bne _0810B1E8 - lsls r0, r2, 16 - asrs r0, 16 - movs r2, 0x10 - ldrsh r1, [r4, r2] - cmp r0, r1 - bgt _0810B1E8 -_0810B1DC: - movs r0, 0x1 - b _0810B1EA - .pool -_0810B1E8: - movs r0, 0 -_0810B1EA: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_810B154 - - thumb_func_start sub_810B1F0 -sub_810B1F0: @ 810B1F0 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - ble _0810B230 - ldr r3, =0x03005e00 - movs r0, 0x3C - ldrsh r1, [r4, r0] - lsls r1, 1 - movs r0, 0x3A - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0810B230: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810B1F0 - - thumb_func_start sub_810B23C -sub_810B23C: @ 810B23C - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _0810B24E - cmp r0, 0x1 - beq _0810B280 - b _0810B294 -_0810B24E: - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - adds r0, r5, 0 - movs r1, 0x2 - bl StartObjectRotScalAnim - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - b _0810B294 - .pool -_0810B280: - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0810B294 - adds r0, r5, 0 - bl move_anim_8074EE0 -_0810B294: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_810B23C - - thumb_func_start sub_810B29C -sub_810B29C: @ 810B29C - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x4 - bls _0810B2B6 - b _0810B428 -_0810B2B6: - lsls r0, 2 - ldr r1, =_0810B2C8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0810B2C8: - .4byte _0810B2DC - .4byte _0810B36C - .4byte _0810B3A8 - .4byte _0810B404 - .4byte _0810B414 -_0810B2DC: - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x14] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x16] - movs r0, 0x4 - strh r0, [r5, 0x18] - ldr r0, =0x02038437 - ldrb r0, [r0] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x1C] - movs r2, 0x1C - ldrsh r0, [r5, r2] - movs r2, 0x14 - ldrsh r1, [r5, r2] - subs r0, r1 - movs r1, 0x5 - bl __divsi3 - strh r0, [r5, 0x1A] - movs r0, 0x7 - strh r0, [r5, 0x10] - ldr r0, =0x0000ffff - strh r0, [r5, 0x12] - movs r0, 0xC - strh r0, [r5, 0x1E] - subs r0, 0x4C - bl sub_80A5178 - lsls r0, 24 - asrs r0, 24 - strh r0, [r5, 0x20] - movs r0, 0x3F - bl sub_80A5178 - lsls r0, 24 - asrs r0, 24 - strh r0, [r5, 0x22] - ldrh r0, [r5, 0x20] - strh r0, [r5, 0x24] - movs r1, 0x22 - ldrsh r0, [r5, r1] - movs r2, 0x20 - ldrsh r1, [r5, r2] - subs r0, r1 - movs r1, 0x3 - bl __divsi3 - strh r0, [r5, 0x26] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - b _0810B426 - .pool -_0810B36C: - ldrh r0, [r5, 0xA] - adds r0, 0x1 - strh r0, [r5, 0xA] - lsls r0, 16 - cmp r0, 0 - ble _0810B39C - movs r0, 0 - strh r0, [r5, 0xA] - adds r0, r5, 0 - adds r1, r2, 0 - bl sub_810B430 - lsls r0, 24 - cmp r0, 0 - beq _0810B39C - movs r1, 0xC - ldrsh r0, [r5, r1] - cmp r0, 0x5 - bne _0810B396 - movs r0, 0x3 - b _0810B39A -_0810B396: - ldrh r0, [r5, 0x8] - adds r0, 0x1 -_0810B39A: - strh r0, [r5, 0x8] -_0810B39C: - ldrh r1, [r5, 0x1E] - movs r2, 0x1E - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _0810B428 - b _0810B41E -_0810B3A8: - ldrh r1, [r5, 0x1E] - movs r2, 0x1E - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _0810B3B6 - subs r0, r1, 0x1 - strh r0, [r5, 0x1E] -_0810B3B6: - ldrh r0, [r5, 0xA] - adds r0, 0x1 - movs r3, 0 - strh r0, [r5, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0810B428 - strh r3, [r5, 0xA] - ldrh r1, [r5, 0xC] - movs r2, 0x1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _0810B3E2 - movs r0, 0x4 - strh r0, [r5, 0x16] - movs r0, 0x44 - strh r0, [r5, 0x18] - strh r3, [r5, 0x10] - strh r2, [r5, 0x12] - b _0810B3F2 -_0810B3E2: - movs r0, 0x44 - strh r0, [r5, 0x16] - movs r0, 0x4 - strh r0, [r5, 0x18] - movs r0, 0x7 - strh r0, [r5, 0x10] - ldr r0, =0x0000ffff - strh r0, [r5, 0x12] -_0810B3F2: - movs r1, 0x1E - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _0810B424 - movs r0, 0x4 - b _0810B426 - .pool -_0810B404: - movs r1, 0xE - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0810B428 - adds r0, r2, 0 - bl move_anim_task_del - b _0810B428 -_0810B414: - ldrh r1, [r5, 0x1E] - movs r2, 0x1E - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _0810B424 -_0810B41E: - subs r0, r1, 0x1 - strh r0, [r5, 0x1E] - b _0810B428 -_0810B424: - movs r0, 0x1 -_0810B426: - strh r0, [r5, 0x8] -_0810B428: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_810B29C - - thumb_func_start sub_810B430 -sub_810B430: @ 810B430 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - ldr r0, =gUnknown_08595A30 - movs r2, 0x14 - ldrsh r1, [r4, r2] - movs r3, 0x16 - ldrsh r2, [r4, r3] - movs r3, 0x23 - bl AddObjectToFront - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - beq _0810B49C - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r3, r0, r1 - ldrh r2, [r3, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - ldrh r6, [r4, 0x10] - adds r1, r6 - ldr r6, =0x000003ff - adds r0, r6, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r3, 0x4] - ldrh r0, [r4, 0x12] - ldrh r1, [r4, 0x10] - adds r0, r1 - strh r0, [r4, 0x10] - lsls r0, 16 - cmp r0, 0 - bge _0810B484 - movs r0, 0x7 - strh r0, [r4, 0x10] -_0810B484: - movs r2, 0x10 - ldrsh r0, [r4, r2] - cmp r0, 0x7 - ble _0810B490 - movs r0, 0 - strh r0, [r4, 0x10] -_0810B490: - strh r5, [r3, 0x3A] - movs r0, 0x3 - strh r0, [r3, 0x3C] - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] -_0810B49C: - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r0, 0 - bne _0810B4BE - movs r5, 0x12 - ldrsh r0, [r4, r5] - cmp r0, 0 - ble _0810B4BE - ldrh r1, [r4, 0x26] - ldrh r6, [r4, 0x24] - adds r1, r6 - strh r1, [r4, 0x24] - lsls r1, 24 - asrs r1, 24 - movs r0, 0x76 - bl audio_play_and_stuff -_0810B4BE: - movs r0, 0x12 - ldrsh r3, [r4, r0] - ldrh r2, [r4, 0x16] - cmp r3, 0 - bge _0810B4D4 - lsls r0, r2, 16 - asrs r0, 16 - movs r5, 0x18 - ldrsh r1, [r4, r5] - cmp r0, r1 - ble _0810B4E4 -_0810B4D4: - cmp r3, 0 - ble _0810B508 - lsls r0, r2, 16 - asrs r0, 16 - movs r6, 0x18 - ldrsh r1, [r4, r6] - cmp r0, r1 - blt _0810B508 -_0810B4E4: - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x1A] - ldrh r1, [r4, 0x14] - adds r0, r1 - strh r0, [r4, 0x14] - movs r0, 0x1 - b _0810B514 - .pool -_0810B508: - movs r3, 0x12 - ldrsh r0, [r4, r3] - lsls r0, 3 - adds r0, r2, r0 - strh r0, [r4, 0x16] - movs r0, 0 -_0810B514: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_810B430 - - thumb_func_start sub_810B51C -sub_810B51C: @ 810B51C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - ble _0810B552 - ldr r3, =0x03005e00 - movs r0, 0x3C - ldrsh r1, [r4, r0] - lsls r1, 1 - movs r0, 0x3A - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0810B552: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810B51C - - thumb_func_start sub_810B55C -sub_810B55C: @ 810B55C - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _0810B5D8 - cmp r0, 0x1 - bgt _0810B584 - cmp r0, 0 - beq _0810B58A - b _0810B60E - .pool -_0810B584: - cmp r0, 0x2 - beq _0810B600 - b _0810B60E -_0810B58A: - ldr r0, =0x02038437 - ldrb r0, [r0] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x20 - strh r0, [r5, 0x26] - strh r0, [r5, 0x24] - cmp r0, 0x10 - ble _0810B5B4 - adds r2, r0, 0 -_0810B5A4: - adds r1, r2, 0 - subs r1, 0x20 - adds r2, r1, 0 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x10 - bgt _0810B5A4 - strh r1, [r5, 0x24] -_0810B5B4: - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldrb r0, [r4] - bl sub_80A82E4 - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x2 - strh r0, [r5, 0x20] - b _0810B5F8 - .pool -_0810B5D8: - ldrh r0, [r5, 0xA] - adds r0, 0x1 - strh r0, [r5, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0810B60E - movs r0, 0 - strh r0, [r5, 0xA] - adds r0, r5, 0 - adds r1, r2, 0 - bl sub_810B614 - lsls r0, 24 - cmp r0, 0 - beq _0810B60E -_0810B5F8: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - b _0810B60E -_0810B600: - movs r1, 0x1C - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0810B60E - adds r0, r2, 0 - bl move_anim_task_del -_0810B60E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_810B55C - - thumb_func_start sub_810B614 -sub_810B614: @ 810B614 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - ldr r0, =gUnknown_085956C0 - movs r2, 0x22 - ldrsh r1, [r4, r2] - movs r3, 0x24 - ldrsh r2, [r4, r3] - ldrh r3, [r4, 0x20] - lsls r3, 24 - lsrs r3, 24 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _0810B658 - ldr r3, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x1C - adds r1, r0, r1 - ldr r2, =sub_810B684 - str r2, [r1] - adds r0, r3 - strh r5, [r0, 0x3A] - movs r1, 0xA - strh r1, [r0, 0x3C] - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - strh r0, [r4, 0x1C] -_0810B658: - ldrh r2, [r4, 0x24] - movs r0, 0x24 - ldrsh r1, [r4, r0] - movs r3, 0x26 - ldrsh r0, [r4, r3] - cmp r1, r0 - bge _0810B67C - adds r0, r2, 0 - adds r0, 0x20 - strh r0, [r4, 0x24] - movs r0, 0 - b _0810B67E - .pool -_0810B67C: - movs r0, 0x1 -_0810B67E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_810B614 - - thumb_func_start sub_810B684 -sub_810B684: @ 810B684 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0810B6B8 - ldr r3, =0x03005e00 - movs r0, 0x3C - ldrsh r1, [r4, r0] - lsls r1, 1 - movs r0, 0x3A - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0810B6B8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810B684 - - thumb_func_start sub_810B6C4 -sub_810B6C4: @ 810B6C4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r5, r0, 0 - ldrh r2, [r5, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x7 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x4] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r3, r0, 24 - ldrb r0, [r4] - movs r1, 0x3 - str r3, [sp] - bl sub_80A5C6C - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x0203841e - ldrh r0, [r1, 0x8] - strh r0, [r5, 0x2E] - ldrh r0, [r1] - ldr r3, [sp] - adds r0, r3 - strh r0, [r5, 0x30] - ldrh r0, [r1, 0x4] - mov r4, r9 - adds r0, r4, r0 - strh r0, [r5, 0x32] - ldrh r0, [r1, 0x2] - adds r0, r6 - strh r0, [r5, 0x34] - ldrh r0, [r1, 0x6] - mov r7, r8 - adds r0, r7, r0 - strh r0, [r5, 0x36] - adds r0, r5, 0 - bl sub_80A64EC - adds r4, 0x20 - movs r0, 0x98 - lsls r0, 1 - mov r12, r0 - ldr r3, [sp] - cmp r4, r12 - bhi _0810B79E - adds r0, r7, 0 - adds r0, 0x20 - ldrh r1, [r5, 0x30] - ldrh r2, [r5, 0x32] - cmp r0, 0xE0 - bhi _0810B79E - adds r4, r1, 0 - mov r10, r12 -_0810B76A: - mov r7, r9 - lsls r1, r7, 16 - asrs r1, 16 - adds r1, r4 - lsls r1, 16 - mov r7, r8 - lsls r0, r7, 16 - asrs r0, 16 - adds r0, r2 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsrs r0, r1, 16 - mov r9, r0 - movs r7, 0x80 - lsls r7, 14 - adds r1, r7 - lsrs r1, 16 - cmp r1, r10 - bhi _0810B79E - mov r1, r8 - lsls r0, r1, 16 - adds r0, r7 - lsrs r0, 16 - cmp r0, 0xE0 - bls _0810B76A -_0810B79E: - ldrh r0, [r5, 0x30] - negs r7, r0 - strh r7, [r5, 0x30] - ldrh r0, [r5, 0x32] - negs r4, r0 - strh r4, [r5, 0x32] - lsls r0, r3, 16 - movs r1, 0x80 - lsls r1, 14 - adds r0, r1 - lsrs r0, 16 - movs r2, 0x98 - lsls r2, 1 - mov r12, r2 - ldr r1, =0x0203841e - mov r10, r1 - cmp r0, r12 - bhi _0810B80A - lsls r1, r6, 16 - movs r2, 0x80 - lsls r2, 14 - adds r0, r1, r2 - b _0810B802 - .pool -_0810B7E0: - lsls r1, r3, 16 - asrs r1, 16 - adds r1, r7 - lsls r1, 16 - asrs r0, r2, 16 - adds r0, r4 - lsls r0, 16 - lsrs r6, r0, 16 - lsrs r3, r1, 16 - movs r0, 0x80 - lsls r0, 14 - adds r1, r0 - lsrs r1, 16 - cmp r1, r12 - bhi _0810B80A - lsls r1, r6, 16 - adds r0, r1, r0 -_0810B802: - lsrs r0, 16 - adds r2, r1, 0 - cmp r0, 0xE0 - bls _0810B7E0 -_0810B80A: - strh r3, [r5, 0x20] - strh r6, [r5, 0x22] - mov r1, r10 - ldrh r0, [r1, 0x8] - strh r0, [r5, 0x2E] - strh r3, [r5, 0x30] - mov r2, r9 - strh r2, [r5, 0x32] - strh r6, [r5, 0x34] - mov r3, r8 - strh r3, [r5, 0x36] - adds r0, r5, 0 - bl sub_80A64EC - mov r7, r10 - ldrh r0, [r7, 0xA] - strh r0, [r5, 0x34] - ldrh r0, [r7, 0xC] - strh r0, [r5, 0x36] - ldr r0, =sub_810B848 - str r0, [r5, 0x1C] - 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_810B6C4 - - thumb_func_start sub_810B848 -sub_810B848: @ 810B848 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0810B8A0 - ldrh r1, [r4, 0x30] - ldrh r2, [r4, 0x38] - adds r1, r2 - strh r1, [r4, 0x38] - ldrh r0, [r4, 0x32] - ldrh r2, [r4, 0x3A] - adds r0, r2 - strh r0, [r4, 0x3A] - strh r1, [r4, 0x24] - strh r0, [r4, 0x26] - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r2, 0x34 - ldrsh r1, [r4, r2] - bl sine - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - movs r2, 0x3C - ldrsh r0, [r4, r2] - movs r2, 0x34 - ldrsh r1, [r4, r2] - bl sine - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x36] - ldrh r2, [r4, 0x3C] - adds r0, r2 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x3C] - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - strh r0, [r4, 0x2E] - b _0810B8A6 -_0810B8A0: - adds r0, r4, 0 - bl move_anim_8072740 -_0810B8A6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810B848 - - thumb_func_start sub_810B8AC -sub_810B8AC: @ 810B8AC - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0203841e - ldrh r0, [r0] - strh r0, [r4, 0x2E] - movs r0, 0x3C - strh r0, [r4, 0x30] - movs r0, 0x9 - strh r0, [r4, 0x32] - movs r0, 0x1E - strh r0, [r4, 0x34] - movs r0, 0xFE - lsls r0, 8 - strh r0, [r4, 0x36] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r1, =sub_80A634C - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810B8AC - - thumb_func_start sub_810B8EC -sub_810B8EC: @ 810B8EC - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r0, =0x02038437 - ldrb r0, [r0] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810B92C - ldr r0, =0x0203841e - ldrh r1, [r4, 0x32] - ldrh r0, [r0, 0x4] - subs r1, r0 - strh r1, [r4, 0x32] - b _0810B936 - .pool -_0810B92C: - ldr r0, =0x0203841e - ldrh r0, [r0, 0x4] - ldrh r1, [r4, 0x32] - adds r0, r1 - strh r0, [r4, 0x32] -_0810B936: - ldr r0, =0x02038437 - ldrb r0, [r0] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - ldr r1, =0x0203841e - lsrs r0, 24 - ldrh r2, [r1, 0x6] - adds r0, r2 - strh r0, [r4, 0x36] - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x2E] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A6EEC - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810B8EC - - thumb_func_start sub_810B974 -sub_810B974: @ 810B974 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x0203841e - movs r1, 0x4 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0810B990 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80A6980 - b _0810B9C6 - .pool -_0810B990: - ldr r0, =0x02038437 - ldrb r0, [r0] - adds r2, r4, 0 - adds r2, 0x20 - adds r3, r4, 0 - adds r3, 0x22 - movs r1, 0x1 - bl sub_80A8924 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810B9B6 - ldrh r0, [r5] - negs r0, r0 - strh r0, [r5] -_0810B9B6: - ldrh r0, [r5] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r5, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] -_0810B9C6: - ldr r1, =sub_810B9E8 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A67BC - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810B974 - - thumb_func_start sub_810B9E8 -sub_810B9E8: @ 810B9E8 - push {lr} - adds r3, r0, 0 - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - 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 - mov r1, r12 - strb r0, [r1] - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - bne _0810BA1E - adds r0, r3, 0 - bl move_anim_8074EE0 -_0810BA1E: - pop {r0} - bx r0 - thumb_func_end sub_810B9E8 - - thumb_func_start sub_810BA24 -sub_810BA24: @ 810BA24 - push {r4-r7,lr} - sub sp, 0x10 - adds r5, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r6, =0x0203841e - ldrh r0, [r6, 0x8] - strh r0, [r5, 0x2E] - ldrh r0, [r5, 0x20] - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x22] - strh r0, [r5, 0x34] - movs r1, 0xA - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0810BA74 - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x32] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r6, [r6, 0x6] - adds r0, r6 - strh r0, [r5, 0x36] - b _0810BA86 - .pool -_0810BA74: - ldr r0, =0x02038437 - ldrb r0, [r0] - adds r2, r5, 0 - adds r2, 0x32 - adds r3, r5, 0 - adds r3, 0x36 - movs r1, 0x1 - bl sub_80A8924 -_0810BA86: - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810BAAC - ldr r0, =0x0203841e - ldrh r1, [r5, 0x32] - ldrh r0, [r0, 0x4] - subs r1, r0 - strh r1, [r5, 0x32] - b _0810BAB6 - .pool -_0810BAAC: - ldr r0, =0x0203841e - ldrh r0, [r0, 0x4] - ldrh r2, [r5, 0x32] - adds r0, r2 - strh r0, [r5, 0x32] -_0810BAB6: - adds r7, r5, 0 - adds r7, 0x2E - adds r2, r7, 0 - mov r1, sp - movs r4, 0x7 -_0810BAC0: - ldrh r0, [r2] - strh r0, [r1] - adds r2, 0x2 - adds r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _0810BAC0 - adds r0, r5, 0 - bl sub_80A7160 - ldrh r0, [r5, 0x30] - movs r1, 0x1 - eors r0, r1 - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x32] - eors r0, r1 - strh r0, [r5, 0x32] -_0810BAE2: - movs r0, 0x1 - strh r0, [r5, 0x2E] - adds r0, r5, 0 - bl sub_80A70E8 - movs r0, 0x20 - ldrsh r1, [r5, r0] - movs r2, 0x24 - ldrsh r0, [r5, r2] - adds r1, r0 - adds r1, 0x10 - movs r0, 0x88 - lsls r0, 1 - cmp r1, r0 - bhi _0810BB16 - movs r0, 0x22 - ldrsh r1, [r5, r0] - movs r2, 0x26 - ldrsh r0, [r5, r2] - adds r1, r0 - cmp r1, 0xA0 - bgt _0810BB16 - movs r0, 0x10 - negs r0, r0 - cmp r1, r0 - bge _0810BAE2 -_0810BB16: - ldrh r0, [r5, 0x24] - ldrh r1, [r5, 0x20] - adds r0, r1 - movs r1, 0 - strh r0, [r5, 0x20] - ldrh r0, [r5, 0x26] - ldrh r2, [r5, 0x22] - adds r0, r2 - strh r0, [r5, 0x22] - strh r1, [r5, 0x26] - strh r1, [r5, 0x24] - ldr r6, =sub_80A718C - ldr r1, =sub_810BB60 - mov r3, sp - adds r2, r7, 0 - movs r4, 0x7 -_0810BB36: - ldrh r0, [r3] - strh r0, [r2] - adds r3, 0x2 - adds r2, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _0810BB36 - str r6, [r5, 0x1C] - adds r0, r5, 0 - bl oamt_set_x3A_32 - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810BA24 - - thumb_func_start sub_810BB60 -sub_810BB60: @ 810BB60 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - movs r5, 0 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - strh r5, [r4, 0x26] - strh r5, [r4, 0x24] - movs r0, 0x80 - strh r0, [r4, 0x2E] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x0000ffec - cmp r0, 0 - beq _0810BB90 - movs r1, 0x14 -_0810BB90: - movs r2, 0x2E - ldrsh r0, [r4, r2] - lsls r1, 16 - asrs r1, 16 - bl sine - strh r0, [r4, 0x34] - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r1, 0xF - bl cosine - strh r0, [r4, 0x36] - strh r5, [r4, 0x38] - ldr r1, =sub_810BBC8 - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810BB60 - - thumb_func_start sub_810BBC8 -sub_810BBC8: @ 810BBC8 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x0000ffec - cmp r0, 0 - beq _0810BBDE - movs r1, 0x14 -_0810BBDE: - movs r2, 0x38 - ldrsh r0, [r4, r2] - cmp r0, 0x1F - bgt _0810BC24 - movs r2, 0x2E - ldrsh r0, [r4, r2] - lsls r1, 16 - asrs r1, 16 - bl sine - ldrh r1, [r4, 0x34] - subs r0, r1 - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r1, 0xF - bl cosine - ldrh r1, [r4, 0x36] - subs r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x2E] - adds r0, 0x10 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - b _0810BC42 - .pool -_0810BC24: - ldrh r0, [r4, 0x24] - ldrh r2, [r4, 0x20] - adds r0, r2 - movs r1, 0 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - strh r1, [r4, 0x26] - strh r1, [r4, 0x24] - strh r1, [r4, 0x36] - strh r1, [r4, 0x34] - ldr r0, =sub_810BC4C - str r0, [r4, 0x1C] -_0810BC42: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810BBC8 - - thumb_func_start sub_810BC4C -sub_810BC4C: @ 810BC4C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x1 - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl sub_80A70E8 - movs r1, 0x20 - ldrsh r0, [r4, r1] - movs r2, 0x24 - ldrsh r1, [r4, r2] - adds r0, r1 - adds r0, 0x10 - movs r1, 0x88 - lsls r1, 1 - cmp r0, r1 - bhi _0810BC88 - movs r1, 0x22 - ldrsh r0, [r4, r1] - movs r2, 0x26 - ldrsh r1, [r4, r2] - adds r1, r0, r1 - movs r0, 0x80 - lsls r0, 1 - cmp r1, r0 - bgt _0810BC88 - movs r0, 0x10 - negs r0, r0 - cmp r1, r0 - bge _0810BC8E -_0810BC88: - adds r0, r4, 0 - bl move_anim_8072740 -_0810BC8E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810BC4C - - thumb_func_start sub_810BC94 -sub_810BC94: @ 810BC94 - push {r4-r7,lr} - sub sp, 0x10 - adds r5, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r1, =0x0203841e - ldrh r0, [r1, 0x8] - strh r0, [r5, 0x2E] - ldrh r0, [r5, 0x20] - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x22] - strh r0, [r5, 0x34] - movs r2, 0xE - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _0810BCE0 - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x32] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x36] - b _0810BCF2 - .pool -_0810BCE0: - ldr r0, =0x02038437 - ldrb r0, [r0] - adds r2, r5, 0 - adds r2, 0x32 - adds r3, r5, 0 - adds r3, 0x36 - movs r1, 0x1 - bl sub_80A8924 -_0810BCF2: - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810BD1C - ldr r0, =0x0203841e - ldrh r1, [r5, 0x32] - ldrh r2, [r0, 0x4] - subs r1, r2 - strh r1, [r5, 0x32] - adds r1, r0, 0 - b _0810BD26 - .pool -_0810BD1C: - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - ldrh r2, [r5, 0x32] - adds r0, r2 - strh r0, [r5, 0x32] -_0810BD26: - ldrh r0, [r1, 0x6] - ldrh r1, [r5, 0x36] - adds r0, r1 - strh r0, [r5, 0x36] - adds r0, r5, 0 - bl sub_80A7160 - adds r7, r5, 0 - adds r7, 0x2E - adds r2, r7, 0 - mov r1, sp - movs r4, 0x7 -_0810BD3E: - ldrh r0, [r2] - strh r0, [r1] - adds r2, 0x2 - adds r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _0810BD3E - ldrh r0, [r5, 0x30] - movs r1, 0x1 - eors r0, r1 - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x32] - eors r0, r1 - strh r0, [r5, 0x32] -_0810BD5A: - movs r0, 0x1 - strh r0, [r5, 0x2E] - adds r0, r5, 0 - bl sub_80A70E8 - movs r2, 0x20 - ldrsh r1, [r5, r2] - movs r2, 0x24 - ldrsh r0, [r5, r2] - adds r1, r0 - adds r1, 0x10 - movs r0, 0x88 - lsls r0, 1 - cmp r1, r0 - bhi _0810BD8E - movs r0, 0x22 - ldrsh r1, [r5, r0] - movs r2, 0x26 - ldrsh r0, [r5, r2] - adds r1, r0 - cmp r1, 0xA0 - bgt _0810BD8E - movs r0, 0x10 - negs r0, r0 - cmp r1, r0 - bge _0810BD5A -_0810BD8E: - ldrh r0, [r5, 0x24] - ldrh r1, [r5, 0x20] - adds r0, r1 - movs r1, 0 - strh r0, [r5, 0x20] - ldrh r0, [r5, 0x26] - ldrh r2, [r5, 0x22] - adds r0, r2 - strh r0, [r5, 0x22] - strh r1, [r5, 0x26] - strh r1, [r5, 0x24] - ldr r1, =0x0203841e - ldr r6, =sub_810BDD8 - mov r3, sp - adds r2, r7, 0 - movs r4, 0x7 -_0810BDAE: - ldrh r0, [r3] - strh r0, [r2] - adds r3, 0x2 - adds r2, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _0810BDAE - ldrh r0, [r1, 0xA] - strh r0, [r5, 0x38] - ldrh r0, [r1, 0xC] - strh r0, [r5, 0x3A] - str r6, [r5, 0x1C] - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810BC94 - - thumb_func_start sub_810BDD8 -sub_810BDD8: @ 810BDD8 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A70E8 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0810BDEC - movs r0, 0x1 - strh r0, [r4, 0x2E] -_0810BDEC: - movs r2, 0x3C - ldrsh r0, [r4, r2] - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl sine - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x3A] - ldrh r2, [r4, 0x3C] - adds r0, r2 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x3C] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _0810BE42 - movs r2, 0x20 - ldrsh r0, [r4, r2] - movs r2, 0x24 - ldrsh r1, [r4, r2] - adds r0, r1 - adds r0, 0x10 - movs r1, 0x88 - lsls r1, 1 - cmp r0, r1 - bhi _0810BE3C - movs r0, 0x22 - ldrsh r1, [r4, r0] - movs r2, 0x26 - ldrsh r0, [r4, r2] - adds r1, r0 - cmp r1, 0xA0 - bgt _0810BE3C - movs r0, 0x10 - negs r0, r0 - cmp r1, r0 - bge _0810BE42 -_0810BE3C: - adds r0, r4, 0 - bl move_anim_8072740 -_0810BE42: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810BDD8 - - thumb_func_start sub_810BE48 -sub_810BE48: @ 810BE48 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0810BEB4 - ldr r5, =0x0203841e - movs r1, 0x4 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0810BE6C - adds r0, r4, 0 - movs r1, 0 - bl sub_80A6980 - b _0810BEA2 - .pool -_0810BE6C: - ldr r0, =0x02038437 - ldrb r0, [r0] - adds r2, r4, 0 - adds r2, 0x20 - adds r3, r4, 0 - adds r3, 0x22 - movs r1, 0 - bl sub_80A8924 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810BE92 - ldrh r0, [r5] - negs r0, r0 - strh r0, [r5] -_0810BE92: - ldrh r0, [r5] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r5, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] -_0810BEA2: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0810BEC8 - .pool -_0810BEB4: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0810BEC8 - adds r0, r4, 0 - bl move_anim_8072740 -_0810BEC8: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_810BE48 - - thumb_func_start sub_810BED0 -sub_810BED0: @ 810BED0 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =0x0203841e - movs r1, 0x8 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0810BF40 - movs r1, 0xA - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0810BEF4 - adds r0, r5, 0 - movs r1, 0 - bl sub_80A69CC - b _0810BF32 - .pool -_0810BEF4: - ldr r4, =0x02038436 - ldrb r0, [r4] - adds r2, r5, 0 - adds r2, 0x20 - adds r3, r5, 0 - adds r3, 0x22 - movs r1, 0 - bl sub_80A8924 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810BF20 - ldrh r0, [r5, 0x20] - ldrh r1, [r6] - subs r0, r1 - b _0810BF26 - .pool -_0810BF20: - ldrh r0, [r6] - ldrh r1, [r5, 0x20] - adds r0, r1 -_0810BF26: - strh r0, [r5, 0x20] - ldr r0, =0x0203841e - ldrh r0, [r0, 0x2] - ldrh r1, [r5, 0x22] - adds r0, r1 - strh r0, [r5, 0x22] -_0810BF32: - ldr r0, =0x02038436 - b _0810BF90 - .pool -_0810BF40: - movs r1, 0xA - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0810BF52 - adds r0, r5, 0 - movs r1, 0 - bl sub_80A6980 - b _0810BF8E -_0810BF52: - ldr r4, =0x02038437 - ldrb r0, [r4] - adds r2, r5, 0 - adds r2, 0x20 - adds r3, r5, 0 - adds r3, 0x22 - movs r1, 0 - bl sub_80A8924 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810BF7C - ldrh r0, [r5, 0x20] - ldrh r1, [r6] - subs r0, r1 - b _0810BF82 - .pool -_0810BF7C: - ldrh r0, [r6] - ldrh r1, [r5, 0x20] - adds r0, r1 -_0810BF82: - strh r0, [r5, 0x20] - ldr r0, =0x0203841e - ldrh r0, [r0, 0x2] - ldrh r1, [r5, 0x22] - adds r0, r1 - strh r0, [r5, 0x22] -_0810BF8E: - ldr r0, =0x02038437 -_0810BF90: - ldrb r0, [r0] - strh r0, [r5, 0x3C] - ldr r0, =0x0203841e - movs r1, 0xA - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _0810BFA8 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - bne _0810BFB4 -_0810BFA8: - movs r0, 0x20 - b _0810BFB6 - .pool -_0810BFB4: - movs r0, 0x40 -_0810BFB6: - strh r0, [r5, 0x3A] - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0810BFCC - ldrh r0, [r5, 0x22] - adds r0, 0x8 - strh r0, [r5, 0x22] -_0810BFCC: - ldr r1, =0x0203841e - ldrh r0, [r1, 0x6] - strh r0, [r5, 0x2E] - ldrh r0, [r5, 0x20] - strh r0, [r5, 0x30] - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x22] - strh r0, [r5, 0x34] - ldrh r1, [r1, 0x4] - adds r0, r1 - strh r0, [r5, 0x36] - adds r0, r5, 0 - bl obj_translate_based_on_private_1_2_3_4 - movs r0, 0x40 - strh r0, [r5, 0x38] - ldr r1, =sub_810C008 - str r1, [r5, 0x1C] - adds r0, r5, 0 - bl _call_via_r1 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810BED0 - - thumb_func_start sub_810C008 -sub_810C008: @ 810C008 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - bne _0810C092 - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r2, 0x3A - ldrsh r1, [r4, r2] - bl sine - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - movs r2, 0x38 - ldrsh r0, [r4, r2] - movs r1, 0x6 - negs r1, r1 - bl cosine - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x38] - subs r0, 0x40 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x7F - bhi _0810C064 - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A8328 - movs r1, 0x3 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r4, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x5] - b _0810C086 -_0810C064: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A8328 - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x1 - movs r1, 0x3 - ands r0, r1 - lsls r0, 2 - ldrb r2, [r4, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0x5] -_0810C086: - ldrh r0, [r4, 0x38] - adds r0, 0x3 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x38] - b _0810C098 -_0810C092: - adds r0, r4, 0 - bl move_anim_8072740 -_0810C098: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810C008 - - thumb_func_start sub_810C0A0 -sub_810C0A0: @ 810C0A0 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl lcd_bg_operations - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0810C0E2 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl lcd_bg_operations -_0810C0E2: - ldr r0, =0x02022e18 - movs r1, 0 - strh r1, [r0] - ldr r4, =0x02022e1a - strh r1, [r4] - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x16 - bl SetGpuReg - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_0854CAD0 - movs r2, 0x80 - lsls r2, 4 - mov r3, sp - ldrh r3, [r3, 0xA] - bl LoadBgTiles - ldr r1, =gUnknown_08D932E0 - mov r0, sp - movs r2, 0 - bl sub_80A6D60 - ldr r0, =gUnknown_0854C270 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_810C164 - str r1, [r0] - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810C0A0 - - thumb_func_start sub_810C164 -sub_810C164: @ 810C164 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x02022e18 - ldr r2, =0x0000ffff - adds r0, r2, 0 - ldrh r2, [r1] - adds r0, r2 - strh r0, [r1] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x20 - ldrsh r0, [r0, r2] - adds r2, r1, 0 - cmp r0, 0x4 - bls _0810C18E - b _0810C2DA -_0810C18E: - lsls r0, 2 - ldr r1, =_0810C1A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0810C1A8: - .4byte _0810C1BC - .4byte _0810C214 - .4byte _0810C236 - .4byte _0810C27A - .4byte _0810C29C -_0810C1BC: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - movs r5, 0 - strh r0, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - beq _0810C1D6 - b _0810C2DA -_0810C1D6: - strh r5, [r4, 0x1C] - ldrh r0, [r4, 0x1A] - adds r0, 0x1 - strh r0, [r4, 0x1A] - ldr r1, =gUnknown_08595C5C - movs r2, 0x1A - ldrsh r0, [r4, r2] - adds r0, r1 - ldrb r1, [r0] - strh r1, [r4, 0x1E] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x1E - ldrsh r0, [r4, r1] - cmp r0, 0x9 - bne _0810C2DA - ldrh r0, [r4, 0x20] - adds r0, 0x1 - strh r0, [r4, 0x20] - strh r5, [r4, 0x1E] - b _0810C2DA - .pool -_0810C214: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r2 - ldrh r0, [r1, 0x1E] - adds r0, 0x1 - strh r0, [r1, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x51 - bne _0810C2DA - movs r0, 0x9 - strh r0, [r1, 0x1E] - ldrh r0, [r1, 0x20] - adds r0, 0x1 - strh r0, [r1, 0x20] - b _0810C2DA -_0810C236: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - strh r0, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0810C2DA - movs r0, 0 - strh r0, [r4, 0x1C] - ldrh r1, [r4, 0x1E] - subs r1, 0x1 - strh r1, [r4, 0x1E] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r2, 0x1E - ldrsh r1, [r4, r2] - cmp r1, 0 - bne _0810C2DA - ldrh r0, [r4, 0x20] - adds r0, 0x1 - strh r0, [r4, 0x20] - strh r1, [r4, 0x1E] - b _0810C2DA -_0810C27A: - mov r0, sp - bl sub_80A6B30 - movs r0, 0x1 - bl sub_80A6C68 - movs r0, 0x2 - bl sub_80A6C68 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x20] - adds r0, 0x1 - strh r0, [r1, 0x20] -_0810C29C: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0810C2B0 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0 - bl lcd_bg_operations -_0810C2B0: - ldr r0, =0x02022e18 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e1a - strh r1, [r0] - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - adds r0, r4, 0 - bl move_anim_task_del -_0810C2DA: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810C164 - - thumb_func_start sub_810C2F0 -sub_810C2F0: @ 810C2F0 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x02038436 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x20] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - ldr r0, =sub_80A7820 - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810C2F0 - - thumb_func_start sub_810C324 -sub_810C324: @ 810C324 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl lcd_bg_operations - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0810C366 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl lcd_bg_operations -_0810C366: - ldr r0, =0x02022e18 - movs r1, 0 - strh r1, [r0] - ldr r4, =0x02022e1a - strh r1, [r4] - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x16 - bl SetGpuReg - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_0854CAD0 - movs r2, 0x80 - lsls r2, 4 - mov r3, sp - ldrh r3, [r3, 0xA] - bl LoadBgTiles - ldr r1, =gUnknown_08D932E0 - mov r0, sp - movs r2, 0 - bl sub_80A6D60 - ldr r0, =gUnknown_0854C270 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =0x0000ffff - strh r1, [r0, 0x26] - ldr r1, =sub_810C3F0 - str r1, [r0] - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810C324 - - thumb_func_start sub_810C3F0 -sub_810C3F0: @ 810C3F0 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r2, =0x02022e18 - ldr r3, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r3 - ldrh r0, [r1, 0x26] - ldrh r5, [r2] - adds r0, r5 - strh r0, [r2] - movs r2, 0x20 - ldrsh r0, [r1, r2] - cmp r0, 0x4 - bls _0810C416 - b _0810C54A -_0810C416: - lsls r0, 2 - ldr r1, =_0810C42C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0810C42C: - .4byte _0810C440 - .4byte _0810C484 - .4byte _0810C4A6 - .4byte _0810C4EA - .4byte _0810C50C -_0810C440: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r3 - ldrh r0, [r4, 0x1A] - adds r0, 0x1 - strh r0, [r4, 0x1A] - ldr r1, =gUnknown_08595C88 - movs r5, 0x1A - ldrsh r0, [r4, r5] - adds r0, r1 - ldrb r1, [r0] - strh r1, [r4, 0x1E] - movs r0, 0x11 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x1E - ldrsh r0, [r4, r1] - cmp r0, 0x5 - bne _0810C54A - ldrh r0, [r4, 0x20] - adds r0, 0x1 - strh r0, [r4, 0x20] - movs r0, 0 - strh r0, [r4, 0x1E] - b _0810C54A - .pool -_0810C484: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r3 - ldrh r0, [r1, 0x1E] - adds r0, 0x1 - strh r0, [r1, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x51 - bne _0810C54A - movs r0, 0x5 - strh r0, [r1, 0x1E] - ldrh r0, [r1, 0x20] - adds r0, 0x1 - strh r0, [r1, 0x20] - b _0810C54A -_0810C4A6: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r3 - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - strh r0, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0810C54A - movs r0, 0 - strh r0, [r4, 0x1C] - ldrh r1, [r4, 0x1E] - subs r1, 0x1 - strh r1, [r4, 0x1E] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r2, 0x1E - ldrsh r1, [r4, r2] - cmp r1, 0 - bne _0810C54A - ldrh r0, [r4, 0x20] - adds r0, 0x1 - strh r0, [r4, 0x20] - strh r1, [r4, 0x1E] - b _0810C54A -_0810C4EA: - mov r0, sp - bl sub_80A6B30 - movs r0, 0x1 - bl sub_80A6C68 - movs r0, 0x2 - bl sub_80A6C68 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x20] - adds r0, 0x1 - strh r0, [r1, 0x20] -_0810C50C: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0810C520 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0 - bl lcd_bg_operations -_0810C520: - ldr r0, =0x02022e18 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e1a - strh r1, [r0] - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - adds r0, r4, 0 - bl move_anim_task_del -_0810C54A: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810C3F0 - - thumb_func_start sub_810C560 -sub_810C560: @ 810C560 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - ldr r6, =0x0203841e - ldrh r0, [r6] - strh r0, [r5, 0x2E] - ldr r0, =0x02038436 - mov r8, r0 - ldrb r0, [r0] - movs r1, 0x2 - bl sub_80A5C6C - adds r4, r0, 0 - ldr r7, =0x02038437 - ldrb r0, [r7] - movs r1, 0x2 - bl sub_80A5C6C - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bcs _0810C594 - movs r0, 0x80 - lsls r0, 8 - strh r0, [r5, 0x3C] -_0810C594: - ldr r3, =0x02024076 - ldrb r0, [r7] - adds r0, r3 - ldrb r1, [r0] - movs r2, 0x1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _0810C5F4 - ldrh r0, [r6, 0x2] - negs r0, r0 - strh r0, [r6, 0x2] - ldrh r0, [r6, 0x6] - negs r0, r0 - strh r0, [r6, 0x6] - movs r1, 0x3C - ldrsh r0, [r5, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0810C5F0 - mov r1, r8 - ldrb r0, [r1] - adds r0, r3 - ldrb r1, [r0] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _0810C5F0 - movs r0, 0x1 - bl obj_id_for_side_relative_to_move - ldr r2, =0x02020630 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x43 - ldrb r0, [r1] - adds r0, 0x1 - adds r1, r5, 0 - adds r1, 0x43 - strb r0, [r1] -_0810C5F0: - movs r0, 0x1 - strh r0, [r5, 0x3A] -_0810C5F4: - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r6, =0x0203841e - movs r1, 0xE - ldrsh r0, [r6, r1] - cmp r0, 0 - beq _0810C65C - ldrh r0, [r6, 0x2] - ldrh r1, [r5, 0x20] - adds r0, r1 - strh r0, [r5, 0x30] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x6] - adds r0, r1 - strh r0, [r5, 0x32] - ldrh r0, [r6, 0x4] - ldrh r1, [r5, 0x22] - adds r0, r1 - strh r0, [r5, 0x34] - ldrb r0, [r4] - movs r1, 0x3 - b _0810C684 - .pool -_0810C65C: - ldrh r0, [r6, 0x2] - ldrh r1, [r5, 0x20] - adds r0, r1 - strh r0, [r5, 0x30] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x6] - adds r0, r1 - strh r0, [r5, 0x32] - ldrh r0, [r6, 0x4] - ldrh r1, [r5, 0x22] - adds r0, r1 - strh r0, [r5, 0x34] - ldrb r0, [r4] - movs r1, 0x1 -_0810C684: - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r6, [r6, 0x8] - adds r0, r6 - strh r0, [r5, 0x36] - ldrb r0, [r4] - bl sub_80A8328 - lsls r0, 24 - lsrs r0, 16 - ldrh r1, [r5, 0x3C] - orrs r0, r1 - strh r0, [r5, 0x3C] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0810C6B8 - movs r0, 0x1 - strh r0, [r5, 0x3A] - adds r1, r5, 0 - adds r1, 0x43 - movs r0, 0x80 - strb r0, [r1] -_0810C6B8: - adds r0, r5, 0 - bl obj_translate_based_on_private_1_2_3_4 - ldr r0, =sub_810C6D4 - str r0, [r5, 0x1C] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810C560 - - thumb_func_start sub_810C6D4 -sub_810C6D4: @ 810C6D4 - push {r4-r6,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x3C] - movs r5, 0xFF - movs r1, 0xFF - ands r1, r0 - cmp r1, 0x1 - beq _0810C7BC - cmp r1, 0x1 - bgt _0810C6EE - cmp r1, 0 - beq _0810C6F6 - b _0810C90C -_0810C6EE: - cmp r1, 0x2 - bne _0810C6F4 - b _0810C8D0 -_0810C6F4: - b _0810C90C -_0810C6F6: - adds r0, r4, 0 - bl sub_80A6F3C - ldr r1, =gUnknown_08329F40 - movs r2, 0x38 - ldrsh r0, [r4, r2] - lsls r0, 1 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - asrs r0, 4 - ldrh r2, [r4, 0x24] - adds r0, r2 - strh r0, [r4, 0x24] - movs r1, 0x3A - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0810C724 - ldrh r0, [r4, 0x38] - subs r0, 0x8 - b _0810C728 - .pool -_0810C724: - ldrh r0, [r4, 0x38] - adds r0, 0x8 -_0810C728: - ands r0, r5 - strh r0, [r4, 0x38] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _0810C736 - b _0810C90C -_0810C736: - movs r5, 0x50 - strh r5, [r4, 0x2E] - ldr r6, =0x02038437 - ldrb r0, [r6] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x20] - strh r0, [r4, 0x30] - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x26] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - strh r0, [r4, 0x34] - adds r0, 0x1D - strh r0, [r4, 0x36] - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0810C78C - ldr r1, =0x02024076 - ldrb r0, [r6] - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0810C78C - movs r0, 0xCC - strh r0, [r4, 0x38] - b _0810C78E - .pool -_0810C78C: - strh r5, [r4, 0x38] -_0810C78E: - movs r0, 0 - strh r0, [r4, 0x26] - ldr r1, =gUnknown_08329F40 - movs r2, 0x38 - ldrsh r0, [r4, r2] - lsls r0, 1 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - asrs r0, 3 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x38] - adds r0, 0x2 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x38] - adds r0, r4, 0 - bl obj_translate_based_on_private_1_2_3_4 - b _0810C90C - .pool -_0810C7BC: - adds r0, r4, 0 - bl sub_80A6F3C - ldr r1, =gUnknown_08329F40 - movs r2, 0x38 - ldrsh r0, [r4, r2] - lsls r0, 1 - adds r0, r1 - movs r2, 0 - ldrsh r0, [r0, r2] - asrs r0, 3 - ldrh r2, [r4, 0x24] - adds r0, r2 - strh r0, [r4, 0x24] - movs r2, 0x38 - ldrsh r0, [r4, r2] - adds r0, 0x40 - lsls r0, 1 - adds r0, r1 - movs r2, 0 - ldrsh r1, [r0, r2] - lsls r0, r1, 1 - adds r0, r1 - negs r0, r0 - asrs r0, 8 - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0810C83A - ldrh r1, [r4, 0x38] - adds r0, r1, 0 - subs r0, 0x40 - lsls r0, 16 - lsrs r0, 16 - adds r3, r1, 0 - cmp r0, 0x7F - bhi _0810C81C - ldrh r1, [r4, 0x3C] - lsls r1, 16 - asrs r1, 24 - b _0810C824 - .pool -_0810C81C: - ldrh r1, [r4, 0x3C] - lsls r1, 16 - asrs r1, 24 - adds r1, 0x1 -_0810C824: - movs r0, 0x3 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r4, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x5] - adds r0, r3, 0x4 - b _0810C85A -_0810C83A: - ldrh r0, [r4, 0x38] - subs r0, 0x40 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x7F - bhi _0810C84E - adds r1, r4, 0 - adds r1, 0x43 - movs r0, 0x80 - b _0810C854 -_0810C84E: - adds r1, r4, 0 - adds r1, 0x43 - movs r0, 0x8C -_0810C854: - strb r0, [r1] - ldrh r0, [r4, 0x38] - subs r0, 0x4 -_0810C85A: - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x38] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - bgt _0810C90C - movs r5, 0 - movs r0, 0xC0 - lsls r0, 2 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - strh r0, [r4, 0x34] - adds r0, 0x4 - strh r0, [r4, 0x36] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0810C8B4 - ldr r1, =0x02024076 - ldr r0, =0x02038437 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0810C8B4 - movs r0, 0x80 - lsls r0, 1 - b _0810C8B6 - .pool -_0810C8B4: - ldr r0, =0x0000fff0 -_0810C8B6: - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x3C] - strh r1, [r4, 0x26] - strh r1, [r4, 0x24] - adds r0, r4, 0 - bl sub_80A6FD4 - b _0810C90C - .pool -_0810C8D0: - adds r0, r4, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - beq _0810C90C - ldrb r0, [r4, 0x1] - lsls r0, 30 - lsrs r0, 30 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0810C8FE - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - ldrb r1, [r4, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x1] -_0810C8FE: - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - ldr r1, =0x020383fe - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] -_0810C90C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810C6D4 - - thumb_func_start sub_810C918 -sub_810C918: @ 810C918 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r1, r0 - ldr r0, =sub_810C934 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_810C918 - - thumb_func_start sub_810C934 -sub_810C934: @ 810C934 - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r5, [r4, r0] - cmp r5, 0x1 - beq _0810C978 - cmp r5, 0x1 - bgt _0810C95C - cmp r5, 0 - beq _0810C962 - b _0810C9DC - .pool -_0810C95C: - cmp r5, 0x2 - beq _0810C9CE - b _0810C9DC -_0810C962: - ldrh r0, [r4, 0x10] - adds r0, 0x1 - strh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _0810C9DC - strh r5, [r4, 0x10] - strh r5, [r4, 0x12] - strh r5, [r4, 0xC] - b _0810C9B4 -_0810C978: - ldrh r1, [r4, 0x12] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r0, 0 - bne _0810C9C8 - ldrb r0, [r4, 0xE] - ldrb r1, [r4, 0xC] - movs r3, 0x1 - bl sub_810C9E4 - lsls r0, 24 - cmp r0, 0 - beq _0810C998 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] -_0810C998: - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bne _0810C9C4 - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bne _0810C9BC -_0810C9B4: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0810C9DC -_0810C9BC: - ldrh r0, [r4, 0x8] - subs r0, 0x1 - strh r0, [r4, 0x8] - b _0810C9DC -_0810C9C4: - strh r5, [r4, 0x12] - b _0810C9DC -_0810C9C8: - subs r0, r1, 0x1 - strh r0, [r4, 0x12] - b _0810C9DC -_0810C9CE: - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0810C9DC - adds r0, r2, 0 - bl move_anim_task_del -_0810C9DC: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_810C934 - - thumb_func_start sub_810C9E4 -sub_810C9E4: @ 810C9E4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - lsls r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp] - lsls r3, 24 - lsrs r3, 24 - mov r10, r3 - movs r1, 0 - str r1, [sp, 0x4] - ldr r1, =gUnknown_08595CB4 - lsrs r0, 22 - adds r4, r0, r1 - ldrb r0, [r4, 0x3] - lsls r0, 24 - asrs r0, 28 - mov r8, r0 - cmp r0, 0x2 - beq _0810CAD0 - ldrh r0, [r4, 0x2] - lsls r0, 20 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _0810CAD0 - movs r0, 0x1 - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r5, 0 - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r6, r0, 24 - mov r1, r8 - cmp r1, 0 - beq _0810CA60 - cmp r1, 0x1 - beq _0810CA96 - b _0810CAE2 - .pool -_0810CA60: - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A861C - lsls r0, 16 - asrs r0, 16 - movs r1, 0x6 - bl __divsi3 - lsls r1, r7, 16 - asrs r1, 16 - subs r1, r0 - lsls r1, 16 - lsrs r7, r1, 16 - adds r0, r5, 0 - movs r1, 0 - bl sub_80A861C - lsls r0, 16 - asrs r0, 16 - movs r1, 0x6 - bl __divsi3 - lsls r1, r6, 16 - asrs r1, 16 - subs r1, r0 - b _0810CACA -_0810CA96: - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A861C - lsls r0, 16 - asrs r0, 16 - movs r1, 0x6 - bl __divsi3 - lsls r1, r7, 16 - asrs r1, 16 - adds r1, r0 - lsls r1, 16 - lsrs r7, r1, 16 - adds r0, r5, 0 - movs r1, 0 - bl sub_80A861C - lsls r0, 16 - asrs r0, 16 - movs r1, 0x6 - bl __divsi3 - lsls r1, r6, 16 - asrs r1, 16 - adds r1, r0 -_0810CACA: - lsls r1, 16 - lsrs r6, r1, 16 - b _0810CAE2 -_0810CAD0: - ldrh r0, [r4] - lsls r0, 22 - asrs r0, 6 - lsrs r7, r0, 16 - ldr r0, [r4] - lsls r0, 12 - asrs r0, 22 - lsls r0, 16 - lsrs r6, r0, 16 -_0810CAE2: - lsls r0, r6, 16 - asrs r0, 16 - adds r0, 0x8 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - lsls r1, r7, 16 - asrs r1, 16 - subs r1, r0 - ldr r0, =gUnknown_08595D2C - lsls r1, 16 - asrs r1, 16 - movs r2, 0x8 - negs r2, r2 - movs r3, 0x12 - bl AddObjectToFront - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x40 - beq _0810CB44 - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - adds r0, r4, 0 - mov r1, r9 - bl StartObjectRotScalAnim - mov r0, sp - ldrh r0, [r0, 0x4] - strh r0, [r4, 0x2E] - strh r7, [r4, 0x34] - strh r6, [r4, 0x36] - mov r1, r9 - strh r1, [r4, 0x38] - mov r0, sp - ldrh r0, [r0] - strh r0, [r4, 0x3A] - mov r1, r10 - strh r1, [r4, 0x3C] - movs r0, 0x1 - b _0810CB46 - .pool -_0810CB44: - movs r0, 0 -_0810CB46: - 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_810C9E4 - - thumb_func_start sub_810CB58 -sub_810CB58: @ 810CB58 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x20] - adds r0, 0x4 - strh r0, [r4, 0x20] - ldrh r1, [r4, 0x22] - adds r2, r1, 0 - adds r2, 0x8 - strh r2, [r4, 0x22] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x34 - ldrsh r1, [r4, r3] - cmp r0, r1 - bge _0810CB82 - lsls r0, r2, 16 - asrs r0, 16 - movs r2, 0x36 - ldrsh r1, [r4, r2] - cmp r0, r1 - blt _0810CC32 -_0810CB82: - movs r3, 0x2E - ldrsh r0, [r4, r3] - cmp r0, 0x1 - bne _0810CC04 - movs r1, 0x38 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0810CC04 - ldr r0, =gUnknown_08595B68 - movs r2, 0x34 - ldrsh r1, [r4, r2] - movs r3, 0x36 - ldrsh r2, [r4, r3] - adds r3, r4, 0 - adds r3, 0x43 - ldrb r3, [r3] - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2E] - cmp r0, 0x40 - beq _0810CBE6 - ldr r2, =0x02020630 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r2, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_810CC3C - str r1, [r0] - movs r3, 0x2E - ldrsh r1, [r4, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r4, 0x3A] - strh r1, [r0, 0x3A] - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r4, 0x3C] - strh r1, [r0, 0x3C] -_0810CBE6: - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - b _0810CC32 - .pool -_0810CC04: - ldr r3, =0x03005e00 - movs r2, 0x3C - ldrsh r1, [r4, r2] - lsls r1, 1 - movs r0, 0x3A - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0810CC32: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810CB58 - - thumb_func_start sub_810CC3C -sub_810CC3C: @ 810CC3C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - bne _0810CC7C - ldr r3, =0x03005e00 - movs r0, 0x3C - ldrsh r1, [r4, r0] - lsls r1, 1 - movs r0, 0x3A - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0810CC7C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810CC3C - - thumb_func_start unc_080B06FC -unc_080B06FC: @ 810CC88 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r0, =0x02038400 - ldr r0, [r0] - ldrb r1, [r0, 0x11] - lsrs r0, r1, 4 - lsls r1, 28 - lsrs r1, 28 - subs r0, r1 - subs r0, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x4 - bls _0810CCA6 - movs r1, 0x4 -_0810CCA6: - adds r0, r5, 0 - bl StartObjectRotScalAnim - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r6, =0x0203841e - ldrh r0, [r6, 0x8] - strh r0, [r5, 0x2E] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810CCCE - ldrh r0, [r6, 0x4] - negs r0, r0 - strh r0, [r6, 0x4] -_0810CCCE: - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x4] - adds r0, r1 - strh r0, [r5, 0x32] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x6] - adds r0, r1 - strh r0, [r5, 0x36] - ldrh r0, [r6, 0xA] - strh r0, [r5, 0x38] - adds r0, r5, 0 - bl sub_80A68D4 - ldr r0, =sub_810CD1C - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end unc_080B06FC - - thumb_func_start sub_810CD1C -sub_810CD1C: @ 810CD1C - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _0810CD3E - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnim - ldr r0, =sub_80A67D8 - str r0, [r4, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 -_0810CD3E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810CD1C - - thumb_func_start sub_810CD4C -sub_810CD4C: @ 810CD4C - push {r4-r6,lr} - adds r4, r0, 0 - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x8 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80A6980 - bl GenerateRandomNumber2 - movs r5, 0xFF - ands r5, r0 - movs r0, 0x80 - lsls r0, 1 - adds r6, r0, 0 - orrs r5, r6 - bl GenerateRandomNumber2 - ldr r1, =0x000001ff - ands r1, r0 - adds r0, r1, 0 - cmp r0, 0xFF - ble _0810CD92 - subs r0, r6, r0 - lsls r0, 16 - lsrs r1, r0, 16 -_0810CD92: - strh r5, [r4, 0x30] - strh r1, [r4, 0x32] - ldr r0, =sub_810CDB0 - str r0, [r4, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810CD4C - - thumb_func_start sub_810CDB0 -sub_810CDB0: @ 810CDB0 - push {r4,lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x30] - ldrh r1, [r2, 0x34] - adds r3, r0, r1 - strh r3, [r2, 0x34] - ldrh r1, [r2, 0x32] - ldrh r4, [r2, 0x36] - adds r1, r4 - strh r1, [r2, 0x36] - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0810CDD4 - lsls r0, r3, 16 - asrs r0, 24 - negs r0, r0 - b _0810CDD8 -_0810CDD4: - lsls r0, r3, 16 - asrs r0, 24 -_0810CDD8: - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x36] - lsls r0, 16 - asrs r0, 24 - strh r0, [r2, 0x26] - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x15 - bne _0810CDF6 - adds r0, r2, 0 - bl move_anim_8072740 -_0810CDF6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810CDB0 - - thumb_func_start sub_810CDFC -sub_810CDFC: @ 810CDFC - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0203841e - ldrb r3, [r1] - lsls r3, 1 - adds r3, r1 - ldr r1, =0x02038400 - ldr r1, [r1] - ldrb r1, [r1, 0x11] - lsrs r2, r1, 4 - lsls r1, 28 - lsrs r1, 28 - subs r2, r1 - subs r2, 0x1 - strh r2, [r3] - bl move_anim_task_del - pop {r0} - bx r0 - .pool - thumb_func_end sub_810CDFC - - thumb_func_start unc_080B08A0 -unc_080B08A0: @ 810CE2C - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x0203841e - movs r0, 0 - ldrsh r1, [r5, r0] - adds r0, r4, 0 - bl sub_80A6864 - ldrh r0, [r5, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - movs r0, 0xF - strh r0, [r4, 0x2E] - ldr r0, =sub_80A64B0 - str r0, [r4, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end unc_080B08A0 - - thumb_func_start sub_810CE68 -sub_810CE68: @ 810CE68 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x0203841e - movs r1, 0xE - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _0810CE90 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810CE90 - ldrh r0, [r4, 0x2] - negs r0, r0 - strh r0, [r4, 0x2] - ldrh r0, [r4, 0x6] - negs r0, r0 - strh r0, [r4, 0x6] -_0810CE90: - ldr r4, =0x0203841e - ldrb r1, [r4, 0xC] - adds r0, r5, 0 - bl StartObjectImageAnim - movs r0, 0 - strh r0, [r4, 0xC] - adds r0, r5, 0 - bl sub_80A7938 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810CE68 - - thumb_func_start sub_810CEB4 -sub_810CEB4: @ 810CEB4 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0810CED0 - ldr r0, =0x0203841e - ldrh r1, [r0, 0x2] - negs r1, r1 - strh r1, [r0, 0x2] - ldrh r1, [r0, 0x6] - negs r1, r1 - strh r1, [r0, 0x6] -_0810CED0: - adds r0, r4, 0 - bl sub_810CE68 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810CEB4 - - thumb_func_start sub_810CEE0 -sub_810CEE0: @ 810CEE0 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x0203841e - ldrb r1, [r4, 0x8] - bl StartObjectImageAnim - movs r1, 0x6 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0810CF04 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A69CC - b _0810CF0C - .pool -_0810CF04: - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A6980 -_0810CF0C: - ldr r0, =0x0203841e - ldrh r0, [r0, 0x4] - strh r0, [r5, 0x2E] - ldr r0, =sub_80A64B0 - str r0, [r5, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r5, 0 - bl oamt_set_x3A_32 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810CEE0 - - thumb_func_start sub_810CF30 -sub_810CF30: @ 810CF30 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r5, r0, 0 - ldr r0, =0x0203841e - movs r2, 0 - ldrsh r1, [r0, r2] - mov r9, r0 - cmp r1, 0 - bne _0810CF54 - ldr r0, =0x02038436 - b _0810CF56 - .pool -_0810CF54: - ldr r0, =0x02038437 -_0810CF56: - ldrb r0, [r0] - mov r8, r0 - mov r4, r9 - movs r3, 0x4 - ldrsh r0, [r4, r3] - cmp r0, 0 - bge _0810CF74 - bl GenerateRandomNumber2 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x5 - bl __umodsi3 - strh r0, [r4, 0x4] -_0810CF74: - ldrb r1, [r4, 0x4] - adds r0, r5, 0 - bl StartObjectImageAnim - mov r0, r8 - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - mov r0, r8 - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - mov r0, r8 - movs r1, 0x1 - bl sub_80A861C - lsls r0, 16 - asrs r1, r0, 16 - lsrs r0, 31 - adds r1, r0 - lsls r1, 15 - lsrs r6, r1, 16 - mov r0, r8 - movs r1, 0 - bl sub_80A861C - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0810CFBE - adds r0, 0x3 -_0810CFBE: - lsls r4, r0, 14 - lsrs r4, 16 - bl GenerateRandomNumber2 - lsls r0, 16 - lsrs r0, 16 - lsls r1, r6, 16 - asrs r1, 16 - bl __modsi3 - lsls r0, 16 - lsrs r6, r0, 16 - bl GenerateRandomNumber2 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 16 - asrs r4, 16 - adds r1, r4, 0 - bl __modsi3 - lsls r0, 16 - lsrs r4, r0, 16 - bl GenerateRandomNumber2 - movs r7, 0x1 - adds r1, r7, 0 - ands r1, r0 - cmp r1, 0 - beq _0810D000 - lsls r0, r6, 16 - negs r0, r0 - lsrs r6, r0, 16 -_0810D000: - bl GenerateRandomNumber2 - adds r1, r7, 0 - ands r1, r0 - cmp r1, 0 - beq _0810D012 - lsls r0, r4, 16 - negs r0, r0 - lsrs r4, r0, 16 -_0810D012: - ldr r0, =0x02024076 - add r0, r8 - ldrb r1, [r0] - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - bne _0810D028 - lsls r0, r4, 16 - ldr r1, =0xfff00000 - adds r0, r1 - lsrs r4, r0, 16 -_0810D028: - lsls r0, r6, 16 - asrs r0, 16 - ldrh r2, [r5, 0x20] - adds r0, r2 - strh r0, [r5, 0x20] - lsls r0, r4, 16 - asrs r0, 16 - ldrh r3, [r5, 0x22] - adds r0, r3 - strh r0, [r5, 0x22] - mov r1, r9 - ldrh r0, [r1, 0x2] - strh r0, [r5, 0x2E] - ldr r0, =gUnknown_08597358 - movs r2, 0x20 - ldrsh r1, [r5, r2] - movs r3, 0x22 - ldrsh r2, [r5, r3] - adds r3, r5, 0 - adds r3, 0x43 - ldrb r3, [r3] - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x3C] - cmp r0, 0x40 - beq _0810D08C - movs r0, 0x3C - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - movs r1, 0 - bl StartObjectRotScalAnim - movs r2, 0x3C - ldrsh r1, [r5, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, 0x1C - adds r0, r4 - ldr r1, =DummyObjectCallback - str r1, [r0] -_0810D08C: - ldr r0, =sub_810D0B8 - str r0, [r5, 0x1C] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810CF30 - - thumb_func_start sub_810D0B8 -sub_810D0B8: @ 810D0B8 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r1, [r5, 0x2E] - movs r2, 0x2E - ldrsh r0, [r5, r2] - cmp r0, 0 - bne _0810D100 - movs r1, 0x3C - ldrsh r0, [r5, r1] - cmp r0, 0x40 - beq _0810D0F4 - ldr r4, =0x02020630 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - movs r0, 0x3C - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles -_0810D0F4: - adds r0, r5, 0 - bl move_anim_8072740 - b _0810D104 - .pool -_0810D100: - subs r0, r1, 0x1 - strh r0, [r5, 0x2E] -_0810D104: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_810D0B8 - - thumb_func_start sub_810D10C -sub_810D10C: @ 810D10C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A6980 - movs r0, 0x1E - strh r0, [r4, 0x2E] - ldr r0, =0x0203841e - movs r1, 0x4 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0810D130 - ldrh r0, [r4, 0x20] - subs r0, 0x14 - strh r0, [r4, 0x32] - b _0810D142 - .pool -_0810D130: - ldrh r0, [r4, 0x20] - adds r0, 0x14 - strh r0, [r4, 0x32] - adds r2, r4, 0 - adds r2, 0x3F - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] -_0810D142: - ldrh r0, [r4, 0x22] - subs r0, 0x14 - strh r0, [r4, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r4, 0x1C] - ldr r1, =sub_810D164 - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810D10C - - thumb_func_start sub_810D164 -sub_810D164: @ 810D164 - push {r4-r6,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0x38] - adds r0, 0x1 - movs r6, 0 - strh r0, [r5, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB - bne _0810D1A4 - ldrh r2, [r5, 0x20] - ldrh r4, [r5, 0x24] - subs r0, r2, r4 - strh r0, [r5, 0x32] - ldrh r1, [r5, 0x22] - ldrh r3, [r5, 0x26] - subs r0, r1, r3 - strh r0, [r5, 0x36] - movs r0, 0x8 - strh r0, [r5, 0x2E] - adds r2, r4 - strh r2, [r5, 0x20] - adds r1, r3 - strh r1, [r5, 0x22] - strh r6, [r5, 0x26] - strh r6, [r5, 0x24] - ldr r0, =sub_80A6EEC - str r0, [r5, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r5, 0 - bl oamt_set_x3A_32 -_0810D1A4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810D164 - - thumb_func_start sub_810D1B4 -sub_810D1B4: @ 810D1B4 - push {r4-r6,lr} - adds r6, r0, 0 - ldr r0, =0x02038436 - ldrb r1, [r0] - movs r0, 0x2 - ldr r2, =0x02038437 - eors r0, r1 - ldrb r1, [r2] - cmp r0, r1 - bne _0810D1E0 - ldrb r0, [r2] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _0810D1E0 - ldr r1, =0x0203841e - movs r2, 0 - ldrsh r0, [r1, r2] - negs r0, r0 - strh r0, [r1] -_0810D1E0: - adds r0, r6, 0 - movs r1, 0x1 - bl sub_80A6980 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810D1FE - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] -_0810D1FE: - ldr r4, =0x0203841e - ldrh r0, [r4, 0x6] - movs r5, 0 - strh r0, [r6, 0x2E] - ldrh r0, [r6, 0x20] - strh r0, [r6, 0x30] - ldrh r1, [r4, 0x4] - adds r0, r1 - strh r0, [r6, 0x32] - ldrh r0, [r6, 0x22] - strh r0, [r6, 0x34] - strh r0, [r6, 0x36] - adds r0, r6, 0 - bl obj_translate_based_on_private_1_2_3_4 - ldrh r0, [r4, 0xA] - strh r0, [r6, 0x38] - ldrh r0, [r4, 0x8] - strh r0, [r6, 0x3A] - strh r5, [r6, 0x3C] - ldr r0, =sub_810D240 - str r0, [r6, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810D1B4 - - thumb_func_start sub_810D240 -sub_810D240: @ 810D240 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - bne _0810D26C - ldrh r0, [r4, 0x3C] - lsls r0, 16 - asrs r0, 24 - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl sine - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x3A] - ldrh r2, [r4, 0x3C] - adds r0, r2 - strh r0, [r4, 0x3C] - b _0810D272 -_0810D26C: - adds r0, r4, 0 - bl move_anim_8072740 -_0810D272: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810D240 - - thumb_func_start sub_810D278 -sub_810D278: @ 810D278 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A6980 - ldr r5, =0x0203841e - ldrb r1, [r5, 0x4] - adds r0, r4, 0 - bl StartObjectImageAnim - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x2E] - ldr r0, =sub_80A64B0 - str r0, [r4, 0x1C] - ldr r1, =sub_810D2B0 - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810D278 - - thumb_func_start sub_810D2B0 -sub_810D2B0: @ 810D2B0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - bl StartObjectRotScalAnim - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x14 - strh r0, [r4, 0x2E] - ldr r0, =sub_80A64B0 - str r0, [r4, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810D2B0 - - thumb_func_start sub_810D2E4 -sub_810D2E4: @ 810D2E4 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A6980 - ldr r0, =0x0203841e - ldrh r0, [r0, 0x4] - strh r0, [r4, 0x2E] - ldr r0, =sub_810D308 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810D2E4 - - thumb_func_start sub_810D308 -sub_810D308: @ 810D308 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0x2E] - subs r0, 0x1 - strh r0, [r5, 0x2E] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0810D34C - movs r0, 0x6 - strh r0, [r5, 0x2E] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x32] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r5, 0x1C] - ldr r1, =sub_810D360 - adds r0, r5, 0 - bl oamt_set_x3A_32 -_0810D34C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810D308 - - thumb_func_start sub_810D360 -sub_810D360: @ 810D360 - push {lr} - movs r1, 0xF - strh r1, [r0, 0x2E] - ldr r1, =sub_80A64B0 - str r1, [r0, 0x1C] - ldr r1, =move_anim_8072740 - bl oamt_set_x3A_32 - pop {r0} - bx r0 - .pool - thumb_func_end sub_810D360 - - thumb_func_start sub_810D37C -sub_810D37C: @ 810D37C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0810D3A8 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80A6980 - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0810D404 - .pool -_0810D3A8: - ldrh r0, [r4, 0x30] - ldrh r2, [r4, 0x36] - adds r0, r2 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - movs r1, 0x34 - ldrsh r0, [r4, r1] - movs r2, 0x32 - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x34] - adds r0, 0x3 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x34] - cmp r0, 0x64 - ble _0810D3F6 - movs r0, 0x34 - ldrsh r1, [r4, r0] - lsrs r0, r1, 31 - adds r0, r1, r0 - asrs r0, 1 - lsls r0, 1 - subs r1, r0 - adds r3, r4, 0 - adds r3, 0x3E - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_0810D3F6: - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0x78 - ble _0810D404 - adds r0, r4, 0 - bl move_anim_8072740 -_0810D404: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810D37C - - thumb_func_start sub_810D40C -sub_810D40C: @ 810D40C - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0810D428 - ldr r4, =0x02038436 - b _0810D42A - .pool -_0810D428: - ldr r4, =0x02038437 -_0810D42A: - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r1, =0x0203841e - ldrh r0, [r1, 0x2] - ldrh r2, [r5, 0x20] - adds r0, r2 - movs r2, 0 - strh r0, [r5, 0x20] - ldrh r0, [r1, 0x4] - ldrh r3, [r5, 0x22] - adds r0, r3 - strh r0, [r5, 0x22] - strh r2, [r5, 0x2E] - ldrh r0, [r1, 0x6] - strh r0, [r5, 0x30] - ldrh r0, [r1, 0x8] - strh r0, [r5, 0x32] - strh r2, [r5, 0x34] - ldr r0, =sub_810D47C - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810D40C - - thumb_func_start sub_810D47C -sub_810D47C: @ 810D47C - push {lr} - adds r1, r0, 0 - movs r0, 0x2E - ldrsh r2, [r1, r0] - cmp r2, 0 - beq _0810D48E - cmp r2, 0x1 - beq _0810D4B2 - b _0810D4EC -_0810D48E: - ldrh r0, [r1, 0x30] - subs r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - cmp r0, 0 - bne _0810D4EC - movs r2, 0x32 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _0810D4AA - adds r0, r1, 0 - bl move_anim_8072740 - b _0810D4EC -_0810D4AA: - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - b _0810D4EC -_0810D4B2: - ldrh r0, [r1, 0x30] - adds r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0810D4DA - movs r0, 0 - strh r0, [r1, 0x30] - ldrh r0, [r1, 0x34] - adds r0, 0x1 - strh r0, [r1, 0x34] - ands r0, r2 - lsls r0, 16 - cmp r0, 0 - beq _0810D4D6 - movs r0, 0x2 - b _0810D4D8 -_0810D4D6: - ldr r0, =0x0000fffe -_0810D4D8: - strh r0, [r1, 0x24] -_0810D4DA: - ldrh r0, [r1, 0x32] - subs r0, 0x1 - strh r0, [r1, 0x32] - lsls r0, 16 - cmp r0, 0 - bne _0810D4EC - adds r0, r1, 0 - bl move_anim_8072740 -_0810D4EC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_810D47C - - thumb_func_start sub_810D4F4 -sub_810D4F4: @ 810D4F4 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =0x0203841e - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0810D520 - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r2, [r6, 0x4] - adds r0, r2 - b _0810D532 - .pool -_0810D520: - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x4] - adds r0, r1 -_0810D532: - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r6, [r6, 0x6] - adds r0, r6 - strh r0, [r5, 0x22] - ldrh r2, [r5, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - ldr r3, =0x0203841e - movs r4, 0x2 - ldrsh r0, [r3, r4] - lsls r0, 4 - adds r1, r0 - ldr r4, =0x000003ff - adds r0, r4, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x4] - movs r1, 0 - movs r0, 0 - strh r0, [r5, 0x2E] - movs r2, 0x2 - ldrsh r0, [r3, r2] - cmp r0, 0x1 - beq _0810D5A0 - cmp r0, 0x1 - bgt _0810D58C - cmp r0, 0 - beq _0810D596 - b _0810D5C6 - .pool -_0810D58C: - cmp r0, 0x2 - beq _0810D5B0 - cmp r0, 0x3 - beq _0810D5C0 - b _0810D5C6 -_0810D596: - ldr r0, =0x0000fffd - b _0810D5C0 - .pool -_0810D5A0: - movs r0, 0x3 - strh r0, [r5, 0x3A] - ldr r0, =0x0000fffd - strh r0, [r5, 0x3C] - b _0810D5CE - .pool -_0810D5B0: - ldr r0, =0x0000fffd - strh r0, [r5, 0x3A] - movs r0, 0x3 - strh r0, [r5, 0x3C] - b _0810D5CE - .pool -_0810D5C0: - strh r0, [r5, 0x3A] - strh r0, [r5, 0x3C] - b _0810D5CE -_0810D5C6: - adds r0, r5, 0 - bl move_anim_8072740 - b _0810D5D2 -_0810D5CE: - ldr r0, =sub_810D5DC - str r0, [r5, 0x1C] -_0810D5D2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810D4F4 - - thumb_func_start sub_810D5DC -sub_810D5DC: @ 810D5DC - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x3A] - ldrh r2, [r1, 0x20] - adds r0, r2 - strh r0, [r1, 0x20] - ldrh r0, [r1, 0x3C] - ldrh r2, [r1, 0x22] - adds r0, r2 - strh r0, [r1, 0x22] - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x28 - ble _0810D604 - adds r0, r1, 0 - bl move_anim_8072740 -_0810D604: - pop {r0} - bx r0 - thumb_func_end sub_810D5DC - - thumb_func_start sub_810D608 -sub_810D608: @ 810D608 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0810D664 - ldr r4, =0x0202420b - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl sub_80A8328 - movs r1, 0x3 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r5, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - ldr r0, =0x02038437 - b _0810D680 - .pool -_0810D664: - ldr r0, =0x02038437 - ldrb r0, [r0] - bl sub_80A8328 - movs r1, 0x3 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r5, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - ldr r0, =0x02038436 -_0810D680: - ldrb r0, [r0] - strh r0, [r5, 0x3C] - movs r0, 0 - strh r0, [r5, 0x2E] - movs r0, 0xC - strh r0, [r5, 0x30] - movs r0, 0x8 - strh r0, [r5, 0x32] - ldr r0, =sub_810D6A8 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810D608 - - thumb_func_start sub_810D6A8 -sub_810D6A8: @ 810D6A8 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB4 - bne _0810D704 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x10 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x36] - adds r0, r4, 0 - bl obj_translate_based_on_private_1_2_3_4 - ldr r1, =move_anim_8074EE0 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A6F98 - str r0, [r4, 0x1C] -_0810D704: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810D6A8 - - thumb_func_start sub_810D714 -sub_810D714: @ 810D714 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x0203841e - ldrh r0, [r4] - strh r0, [r5, 0x20] - movs r2, 0x78 - strh r2, [r5, 0x22] - ldrh r0, [r4, 0x6] - strh r0, [r5, 0x2E] - adds r0, r5, 0 - adds r0, 0x36 - adds r1, r5, 0 - adds r1, 0x38 - lsls r2, 8 - bl sub_80A8048 - ldrh r0, [r4, 0x2] - strh r0, [r5, 0x3A] - ldrh r2, [r5, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - movs r3, 0x4 - ldrsh r0, [r4, r3] - lsls r0, 2 - adds r1, r0 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x4] - ldr r0, =sub_810D770 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810D714 - - thumb_func_start sub_810D770 -sub_810D770: @ 810D770 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r0, 0 - movs r1, 0x2E - ldrsh r0, [r7, r1] - cmp r0, 0 - beq _0810D7C2 - movs r2, 0x36 - ldrsh r0, [r7, r2] - movs r2, 0x38 - ldrsh r1, [r7, r2] - bl sub_80A8050 - adds r4, r0, 0 - movs r1, 0x3A - ldrsh r0, [r7, r1] - subs r4, r0 - adds r0, r7, 0 - adds r0, 0x36 - adds r1, r7, 0 - adds r1, 0x38 - adds r2, r4, 0 - bl sub_80A8048 - asrs r4, 8 - strh r4, [r7, 0x22] - lsls r4, 16 - asrs r4, 16 - movs r0, 0x8 - negs r0, r0 - cmp r4, r0 - bge _0810D7BA - adds r0, r7, 0 - bl move_anim_8072740 - b _0810D818 -_0810D7BA: - ldrh r0, [r7, 0x2E] - subs r0, 0x1 - strh r0, [r7, 0x2E] - b _0810D818 -_0810D7C2: - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r2, =0x02038437 - mov r8, r2 - ldrb r0, [r2] - movs r1, 0x2 - bl sub_80A5C6C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - mov r1, r8 - ldrb r0, [r1] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - subs r4, r6 - strh r4, [r7, 0x2E] - lsrs r0, 24 - subs r0, r5 - strh r0, [r7, 0x30] - ldrh r0, [r7, 0x20] - lsls r0, 4 - strh r0, [r7, 0x32] - ldrh r0, [r7, 0x22] - lsls r0, 4 - strh r0, [r7, 0x34] - ldr r0, =sub_810D830 - str r0, [r7, 0x1C] -_0810D818: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810D770 - - thumb_func_start sub_810D830 -sub_810D830: @ 810D830 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - ldrh r1, [r2, 0x32] - adds r0, r1 - strh r0, [r2, 0x32] - ldrh r1, [r2, 0x30] - ldrh r3, [r2, 0x34] - adds r1, r3 - strh r1, [r2, 0x34] - lsls r0, 16 - asrs r0, 20 - strh r0, [r2, 0x20] - lsls r1, 16 - asrs r3, r1, 20 - strh r3, [r2, 0x22] - adds r0, 0x8 - lsls r0, 16 - movs r1, 0x80 - lsls r1, 17 - cmp r0, r1 - bhi _0810D86A - adds r1, r3, 0 - movs r0, 0x8 - negs r0, r0 - cmp r1, r0 - blt _0810D86A - cmp r1, 0x78 - ble _0810D870 -_0810D86A: - adds r0, r2, 0 - bl move_anim_8072740 -_0810D870: - pop {r0} - bx r0 - thumb_func_end sub_810D830 - - thumb_func_start sub_810D874 -sub_810D874: @ 810D874 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0810D8B8 - ldr r4, =0x0202420b - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r0, =0x02038437 - ldrb r4, [r0] - ldr r0, =0x02038436 - b _0810D8BE - .pool -_0810D8B8: - ldr r0, =0x02038436 - ldrb r4, [r0] - ldr r0, =0x02038437 -_0810D8BE: - ldrb r0, [r0] - bl sub_80A8328 - movs r1, 0x3 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r5, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0810D8F8 - ldrb r2, [r5, 0x3] - lsls r1, r2, 26 - lsrs r1, 27 - movs r0, 0x8 - orrs r1, r0 - lsls r1, 1 - subs r0, 0x47 - b _0810D912 - .pool -_0810D8F8: - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0810D918 - ldrb r2, [r5, 0x3] - lsls r1, r2, 26 - lsrs r1, 27 - movs r0, 0x18 - orrs r1, r0 - lsls r1, 1 - subs r0, 0x57 -_0810D912: - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x3] -_0810D918: - movs r0, 0x10 - strh r0, [r5, 0x2E] - ldrh r0, [r5, 0x20] - strh r0, [r5, 0x30] - adds r0, r4, 0 - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x22] - strh r0, [r5, 0x34] - adds r0, r4, 0 - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x36] - adds r0, r5, 0 - bl obj_translate_based_on_private_1_2_3_4 - ldr r1, =move_anim_8072740 - adds r0, r5, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A6F98 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810D874 - - thumb_func_start sub_810D960 -sub_810D960: @ 810D960 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x2E - ldrsh r1, [r4, r0] - movs r2, 0x36 - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _0810D976 - adds r0, r4, 0 - bl move_anim_8072740 -_0810D976: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810D960 - - thumb_func_start sub_810D984 -sub_810D984: @ 810D984 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r1, =0x0203841e - ldrh r0, [r1, 0x6] - strh r0, [r5, 0x30] - ldrh r0, [r1] - strh r0, [r5, 0x32] - ldrh r0, [r1, 0x2] - strh r0, [r5, 0x34] - ldrh r0, [r1, 0x4] - strh r0, [r5, 0x36] - ldr r0, =0x02038432 - ldrb r6, [r0] - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0810D9CE - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0810D9CE: - movs r0, 0x1 - ands r6, r0 - cmp r6, 0 - beq _0810D9E2 - ldrh r0, [r5, 0x32] - negs r0, r0 - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x30] - adds r0, 0x1 - strh r0, [r5, 0x30] -_0810D9E2: - ldrh r1, [r5, 0x30] - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl StartObjectImageAnim - ldrh r0, [r5, 0x32] - strh r0, [r5, 0x24] - ldrh r0, [r5, 0x34] - strh r0, [r5, 0x26] - ldr r0, =sub_810D960 - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810D984 - - thumb_func_start sub_810DA10 -sub_810DA10: @ 810DA10 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0203841e - movs r1, 0x4 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0810DA2C - adds r0, r4, 0 - movs r1, 0 - bl sub_80A69CC - b _0810DA34 - .pool -_0810DA2C: - adds r0, r4, 0 - movs r1, 0 - bl sub_80A6980 -_0810DA34: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0810DA48 - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectImageAnim - b _0810DA5E -_0810DA48: - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810DA5E - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnim -_0810DA5E: - ldr r0, =sub_80A67D8 - str r0, [r4, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810DA10 - - thumb_func_start sub_810DA7C -sub_810DA7C: @ 810DA7C - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0810DAB6 - ldrh r0, [r4, 0x30] - adds r0, 0x28 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x2 - bl sine - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x28 - ble _0810DAB6 - adds r0, r4, 0 - bl move_anim_8072740 -_0810DAB6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810DA7C - - thumb_func_start sub_810DABC -sub_810DABC: @ 810DABC - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0810DAF4 - cmp r0, 0x1 - bgt _0810DB0E - cmp r0, 0 - bne _0810DB0E - movs r0, 0 - bl sub_80A6DAC - ldr r0, =0x0203841e - ldrh r0, [r0] - strh r0, [r4, 0x18] - b _0810DB06 - .pool -_0810DAF4: - ldrh r0, [r4, 0x18] - subs r0, 0x1 - strh r0, [r4, 0x18] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0810DB1A -_0810DB06: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0810DB1A -_0810DB0E: - movs r2, 0xA0 - lsls r2, 3 - adds r0, r2, 0 - ldrh r1, [r4, 0x1A] - adds r0, r1 - strh r0, [r4, 0x1A] -_0810DB1A: - movs r2, 0xB0 - lsls r2, 4 - adds r0, r2, 0 - ldrh r1, [r4, 0x1C] - adds r0, r1 - strh r0, [r4, 0x1C] - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0810DB50 - ldr r1, =0x02022e20 - ldrh r0, [r4, 0x1A] - lsls r0, 16 - asrs r0, 24 - ldrh r2, [r1] - adds r0, r2 - strh r0, [r1] - adds r7, r1, 0 - b _0810DB60 - .pool -_0810DB50: - ldr r2, =0x02022e20 - ldrh r1, [r4, 0x1A] - lsls r1, 16 - asrs r1, 24 - ldrh r0, [r2] - subs r0, r1 - strh r0, [r2] - adds r7, r2, 0 -_0810DB60: - ldr r3, =0x02022e22 - ldrh r2, [r4, 0x1C] - lsls r0, r2, 16 - asrs r0, 24 - ldrh r1, [r3] - adds r0, r1 - strh r0, [r3] - movs r0, 0xFF - ldrb r1, [r4, 0x1A] - movs r5, 0 - strh r1, [r4, 0x1A] - ands r0, r2 - strh r0, [r4, 0x1C] - ldr r0, =0x0203841e - movs r2, 0xE - ldrsh r1, [r0, r2] - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _0810DB98 - strh r5, [r7] - strh r5, [r3] - movs r0, 0x1 - bl sub_80A6DAC - adds r0, r6, 0 - bl move_anim_task_del -_0810DB98: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810DABC - - thumb_func_start sub_810DBAC -sub_810DBAC: @ 810DBAC - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x0203841e - movs r1, 0x6 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0810DBC2 - adds r0, r5, 0 - movs r1, 0x2 - bl StartObjectImageAnim -_0810DBC2: - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A69CC - ldrh r0, [r4, 0x4] - strh r0, [r5, 0x2E] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x32] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x36] - ldr r0, =0x0000ffe2 - strh r0, [r5, 0x38] - adds r0, r5, 0 - bl sub_80A68D4 - ldr r0, =sub_810DC10 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810DBAC - - thumb_func_start sub_810DC10 -sub_810DC10: @ 810DC10 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _0810DC24 - adds r0, r4, 0 - bl move_anim_8072740 -_0810DC24: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810DC10 - - thumb_func_start sub_810DC2C -sub_810DC2C: @ 810DC2C - push {r4-r6,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldr r5, =0x0203841e - movs r1, 0x6 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0810DC44 - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectImageAnim -_0810DC44: - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r0, =0x02038437 - ldrb r0, [r0] - mov r6, sp - adds r6, 0x2 - movs r1, 0x1 - mov r2, sp - adds r3, r6, 0 - bl sub_80A8924 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810DC72 - ldrh r0, [r5, 0x8] - negs r0, r0 - strh r0, [r5, 0x8] -_0810DC72: - ldrh r0, [r5, 0x4] - strh r0, [r4, 0x2E] - mov r1, sp - ldrh r0, [r5, 0x8] - ldrh r1, [r1] - adds r0, r1 - strh r0, [r4, 0x32] - ldrh r0, [r5, 0xA] - ldrh r6, [r6] - adds r0, r6 - strh r0, [r4, 0x36] - ldr r0, =0x0000ffe2 - strh r0, [r4, 0x38] - adds r0, r4, 0 - bl sub_80A68D4 - ldr r0, =sub_810DCB4 - str r0, [r4, 0x1C] - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810DC2C - - thumb_func_start sub_810DCB4 -sub_810DCB4: @ 810DCB4 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _0810DCC8 - adds r0, r4, 0 - bl move_anim_8072740 -_0810DCC8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810DCB4 - - thumb_func_start sub_810DCD0 -sub_810DCD0: @ 810DCD0 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x0203841e - ldrh r0, [r5, 0x4] - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x30] - ldrh r1, [r5] - adds r0, r1 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x34] - ldrh r1, [r5, 0x2] - adds r0, r1 - strh r0, [r4, 0x36] - adds r0, r4, 0 - bl sub_80A6E14 - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r2, 0x4 - ldrsh r1, [r5, r2] - bl __divsi3 - strh r0, [r4, 0x38] - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r2, 0x4 - ldrsh r1, [r5, r2] - bl __divsi3 - strh r0, [r4, 0x3A] - ldr r0, =sub_810DD24 - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810DCD0 - - thumb_func_start sub_810DD24 -sub_810DD24: @ 810DD24 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A656C - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x38] - subs r0, r1 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x32] - ldrh r1, [r4, 0x3A] - subs r0, r1 - strh r0, [r4, 0x32] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0810DD4A - adds r0, r4, 0 - bl move_anim_8072740 -_0810DD4A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810DD24 - - thumb_func_start sub_810DD50 -sub_810DD50: @ 810DD50 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02038437 - ldrb r0, [r0] - adds r2, r4, 0 - adds r2, 0x20 - adds r3, r4, 0 - adds r3, 0x22 - movs r1, 0x1 - bl sub_80A8924 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810DD7C - ldr r1, =0x0203841e - ldrh r0, [r1] - negs r0, r0 - strh r0, [r1] -_0810DD7C: - ldr r0, =0x0203841e - ldrh r2, [r0] - ldrh r1, [r4, 0x20] - adds r2, r1 - strh r2, [r4, 0x20] - ldrh r1, [r0, 0x2] - ldrh r3, [r4, 0x22] - adds r1, r3 - strh r1, [r4, 0x22] - ldrh r3, [r0, 0x8] - strh r3, [r4, 0x2E] - ldrh r0, [r0, 0x4] - adds r2, r0 - strh r2, [r4, 0x32] - adds r1, r3 - strh r1, [r4, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r4, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810DD50 - - thumb_func_start sub_810DDC4 -sub_810DDC4: @ 810DDC4 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x0203841e - movs r1, 0x4 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0810DDE0 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80A6980 - b _0810DE16 - .pool -_0810DDE0: - ldr r0, =0x02038437 - ldrb r0, [r0] - adds r2, r4, 0 - adds r2, 0x20 - adds r3, r4, 0 - adds r3, 0x22 - movs r1, 0x1 - bl sub_80A8924 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810DE06 - ldrh r0, [r5] - negs r0, r0 - strh r0, [r5] -_0810DE06: - ldrh r0, [r5] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r5, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] -_0810DE16: - ldr r0, =sub_810DE2C - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810DDC4 - - thumb_func_start sub_810DE2C -sub_810DE2C: @ 810DE2C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0xB - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x2E] - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r1, 0x4 - bl sine - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x30] - adds r0, 0x30 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 - negs r0, r0 - strh r0, [r4, 0x26] - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0810DE68 - adds r0, r4, 0 - bl move_anim_8072740 -_0810DE68: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810DE2C - - thumb_func_start sub_810DE70 -sub_810DE70: @ 810DE70 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - bl sub_80A6980 - ldrh r0, [r4, 0x22] - adds r0, 0x14 - strh r0, [r4, 0x22] - movs r0, 0xBF - strh r0, [r4, 0x30] - ldr r1, =sub_810DE98 - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810DE70 - - thumb_func_start sub_810DE98 -sub_810DE98: @ 810DE98 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x20 - bl sine - strh r0, [r4, 0x24] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x8 - bl cosine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x5 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x47 - bne _0810DED2 - adds r0, r4, 0 - bl move_anim_8072740 -_0810DED2: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810DE98 - - thumb_func_start sub_810DED8 -sub_810DED8: @ 810DED8 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - ldr r1, =0x0203841e - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x8] - ldrh r0, [r1] - strh r0, [r4, 0xA] - ldr r0, =0x00002719 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xC] - ldr r0, =sub_810DF18 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810DED8 - - thumb_func_start sub_810DF18 -sub_810DF18: @ 810DF18 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r3, r0, r2 - ldrh r0, [r3, 0x1C] - adds r1, r0, 0x1 - strh r1, [r3, 0x1C] - lsls r0, 16 - asrs r0, 16 - movs r4, 0xA - ldrsh r1, [r3, r4] - adds r7, r2, 0 - cmp r0, r1 - bne _0810DF76 - movs r0, 0 - strh r0, [r3, 0x1C] - ldrb r0, [r3, 0xC] - ldr r2, =0x02037b14 - lsls r0, 4 - movs r3, 0x84 - lsls r3, 1 - adds r1, r0, r3 - lsls r1, 1 - adds r1, r2 - ldrh r6, [r1] - movs r4, 0x7 - mov r12, r0 - ldr r0, =0x00000107 - add r0, r12 - lsls r0, 1 - adds r3, r0, r2 -_0810DF5E: - ldrh r0, [r3] - strh r0, [r1] - subs r3, 0x2 - subs r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bgt _0810DF5E - ldr r0, =0x00000101 - add r0, r12 - lsls r0, 1 - adds r0, r2 - strh r6, [r0] -_0810DF76: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r7 - ldrh r1, [r0, 0x8] - subs r1, 0x1 - strh r1, [r0, 0x8] - lsls r1, 16 - cmp r1, 0 - bne _0810DF90 - adds r0, r5, 0 - bl move_anim_task_del -_0810DF90: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810DF18 - - thumb_func_start sub_810DFA8 -sub_810DFA8: @ 810DFA8 - push {r4-r6,lr} - adds r6, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810DFC8 - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] -_0810DFC8: - ldr r4, =0x0203841e - ldrh r0, [r4, 0x8] - strh r0, [r6, 0x2E] - ldrh r0, [r6, 0x20] - strh r0, [r6, 0x30] - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x4] - adds r0, r1 - strh r0, [r6, 0x32] - ldrh r0, [r6, 0x22] - strh r0, [r6, 0x34] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r4, [r4, 0x6] - adds r0, r4 - strh r0, [r6, 0x36] - adds r0, r6, 0 - bl obj_translate_based_on_private_1_2_3_4 - ldr r0, =sub_80A67BC - str r0, [r6, 0x1C] - ldr r1, =sub_810E028 - adds r0, r6, 0 - bl oamt_set_x3A_32 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810DFA8 - - thumb_func_start sub_810E028 -sub_810E028: @ 810E028 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - beq _0810E03C - adds r0, r4, 0 - bl move_anim_8072740 -_0810E03C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810E028 - - thumb_func_start sub_810E044 -sub_810E044: @ 810E044 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x02038436 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810E070 - ldr r1, =0x0203841e - ldrh r0, [r1] - negs r0, r0 - strh r0, [r1] - ldrh r0, [r1, 0x2] - negs r0, r0 - strh r0, [r1, 0x2] - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] - ldrh r0, [r1, 0x6] - negs r0, r0 - strh r0, [r1, 0x6] -_0810E070: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0810E088 - ldr r0, =0x0203841e - ldrh r1, [r0, 0x2] - negs r1, r1 - strh r1, [r0, 0x2] - ldrh r1, [r0, 0x6] - negs r1, r1 - strh r1, [r0, 0x6] -_0810E088: - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - ldr r2, =0x0203841e - ldrh r1, [r2] - ldrh r3, [r5, 0x20] - adds r1, r3 - strh r1, [r5, 0x20] - lsrs r0, 24 - ldrh r1, [r2, 0x2] - adds r0, r1 - strh r0, [r5, 0x22] - ldrh r0, [r2, 0x8] - strh r0, [r5, 0x2E] - movs r3, 0xC - ldrsh r0, [r2, r3] - cmp r0, 0 - bne _0810E0EC - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x32] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x36] - b _0810E0FE - .pool -_0810E0EC: - ldr r0, =0x02038437 - ldrb r0, [r0] - adds r2, r5, 0 - adds r2, 0x32 - adds r3, r5, 0 - adds r3, 0x36 - movs r1, 0x1 - bl sub_80A8924 -_0810E0FE: - ldr r4, =0x0203841e - ldrh r0, [r4, 0x4] - ldrh r1, [r5, 0x32] - adds r0, r1 - strh r0, [r5, 0x32] - ldrh r0, [r4, 0x6] - ldrh r3, [r5, 0x36] - adds r0, r3 - strh r0, [r5, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r5, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r5, 0 - bl oamt_set_x3A_32 - ldrb r1, [r4, 0xA] - adds r0, r5, 0 - bl SeekObjectImageAnim - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810E044 - - thumb_func_start sub_810E13C -sub_810E13C: @ 810E13C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x2E] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x30] - ldr r0, =sub_810E184 - str r0, [r4, 0x1C] - movs r0, 0 - bl obj_id_for_side_relative_to_move - ldr r2, =0x02020630 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810E13C - - thumb_func_start sub_810E184 -sub_810E184: @ 810E184 - push {lr} - adds r2, r0, 0 - ldrh r1, [r2, 0x2E] - movs r3, 0x2E - ldrsh r0, [r2, r3] - cmp r0, 0 - ble _0810E198 - subs r0, r1, 0x1 - strh r0, [r2, 0x2E] - b _0810E1AA -_0810E198: - ldrh r0, [r2, 0x30] - ldrh r1, [r2, 0x32] - adds r0, r1 - strh r0, [r2, 0x32] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r2, 0x26] - subs r1, r0 - strh r1, [r2, 0x26] -_0810E1AA: - movs r3, 0x22 - ldrsh r0, [r2, r3] - movs r3, 0x26 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - bge _0810E1C2 - adds r0, r2, 0 - bl move_anim_8072740 -_0810E1C2: - pop {r0} - bx r0 - thumb_func_end sub_810E184 - - thumb_func_start sub_810E1C8 -sub_810E1C8: @ 810E1C8 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810E1F8 - movs r0, 0x88 - lsls r0, 1 - strh r0, [r5, 0x20] - ldr r0, =0x0000ffe0 - strh r0, [r5, 0x22] - adds r0, r5, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - b _0810E1FE - .pool -_0810E1F8: - ldr r0, =0x0000ffe0 - strh r0, [r5, 0x20] - strh r0, [r5, 0x22] -_0810E1FE: - ldr r0, =0x0203841e - ldrh r0, [r0] - strh r0, [r5, 0x2E] - ldrh r0, [r5, 0x20] - strh r0, [r5, 0x30] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x22] - strh r0, [r5, 0x34] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x36] - adds r0, r5, 0 - bl obj_translate_based_on_private_1_2_3_4 - ldr r0, =sub_810E24C - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810E1C8 - - thumb_func_start sub_810E24C -sub_810E24C: @ 810E24C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x1 - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl sub_80A6F3C - ldrh r1, [r4, 0x34] - lsrs r0, r1, 8 - cmp r0, 0xC8 - bls _0810E274 - ldrh r0, [r4, 0x24] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - movs r0, 0 - strh r0, [r4, 0x24] - movs r0, 0xFF - ands r0, r1 - strh r0, [r4, 0x34] -_0810E274: - movs r1, 0x20 - ldrsh r0, [r4, r1] - movs r2, 0x24 - ldrsh r1, [r4, r2] - adds r0, r1 - adds r0, 0x20 - movs r1, 0x98 - lsls r1, 1 - cmp r0, r1 - bhi _0810E296 - movs r1, 0x22 - ldrsh r0, [r4, r1] - movs r2, 0x26 - ldrsh r1, [r4, r2] - adds r0, r1 - cmp r0, 0xA0 - ble _0810E2BC -_0810E296: - movs r0, 0 - bl obj_id_for_side_relative_to_move - ldr r2, =0x02020630 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x3E - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - adds r0, r4, 0 - bl move_anim_8072740 -_0810E2BC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810E24C - - thumb_func_start sub_810E2C8 -sub_810E2C8: @ 810E2C8 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - subs r1, r0, 0x1 - strh r1, [r4, 0x2E] - lsls r0, 16 - cmp r0, 0 - bgt _0810E308 - ldrb r0, [r4, 0x1] - lsls r0, 30 - lsrs r0, 30 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0810E2FA - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - ldrb r1, [r4, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x1] -_0810E2FA: - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - ldr r1, =0x020383fe - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] -_0810E308: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810E2C8 - - thumb_func_start sub_810E314 -sub_810E314: @ 810E314 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r0, 0 - adds r5, r7, 0 - adds r5, 0x2E - ldr r0, =0x0203841e - ldrh r1, [r0, 0xE] - movs r0, 0x80 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - beq _0810E33C - ldr r0, =0x02038436 - b _0810E33E - .pool -_0810E33C: - ldr r0, =0x02038437 -_0810E33E: - ldrb r6, [r0] - adds r0, r6, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0810E354 - ldr r1, =0x0203841e - ldrh r0, [r1] - negs r0, r0 - strh r0, [r1] -_0810E354: - adds r0, r6, 0 - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - ldr r4, =0x0203841e - lsrs r0, 24 - ldrh r1, [r4] - adds r0, r1 - strh r0, [r7, 0x20] - adds r0, r6, 0 - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - ldrh r1, [r4, 0x2] - lsrs r0, 24 - adds r1, r0, r1 - strh r1, [r7, 0x22] - lsls r1, 8 - strh r1, [r5, 0x8] - ldrh r1, [r4, 0xC] - adds r0, r1 - lsls r0, 1 - ldrh r2, [r5, 0xE] - movs r1, 0x1 - ands r1, r2 - orrs r1, r0 - strh r1, [r5, 0xE] - ldrb r0, [r5] - movs r2, 0x4 - mov r8, r2 - mov r1, r8 - orrs r0, r1 - strb r0, [r5] - ldrh r0, [r4, 0x4] - ldrb r1, [r4, 0x4] - strh r1, [r5, 0x2] - lsls r0, 16 - lsrs r0, 24 - strh r0, [r5, 0xA] - ldrh r0, [r4, 0x6] - strh r0, [r5, 0x4] - ldrh r0, [r4, 0x8] - strh r0, [r5, 0x6] - ldrh r0, [r4, 0xA] - strh r0, [r5, 0xC] - subs r1, 0x40 - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0x7F - bhi _0810E44A - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0810E3F0 - adds r0, r6, 0 - bl sub_80A8328 - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x1 - movs r1, 0x3 - ands r0, r1 - lsls r0, 2 - ldrb r2, [r7, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r7, 0x5] - b _0810E408 - .pool -_0810E3F0: - adds r0, r6, 0 - bl sub_80A8328 - movs r1, 0x3 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r7, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r7, 0x5] -_0810E408: - ldrb r1, [r5, 0xE] - movs r4, 0x2 - negs r4, r4 - adds r0, r4, 0 - ands r0, r1 - strb r0, [r5, 0xE] - movs r2, 0x4 - ldrsh r0, [r5, r2] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - bne _0810E4AA - adds r3, r7, 0 - adds r3, 0x3F - ldrb r2, [r3] - lsls r0, r2, 31 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - adds r0, r4, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - lsls r0, 31 - lsrs r0, 31 - adds r1, r7, 0 - adds r1, 0x2A - strb r0, [r1] - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - b _0810E4A2 -_0810E44A: - adds r0, r6, 0 - bl sub_80A8328 - movs r1, 0x3 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r7, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r7, 0x5] - ldrb r0, [r5, 0xE] - movs r4, 0x1 - orrs r0, r4 - strb r0, [r5, 0xE] - movs r1, 0x4 - ldrsh r0, [r5, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0810E4AA - adds r3, r7, 0 - adds r3, 0x3F - ldrb r2, [r3] - lsls r1, r2, 31 - lsrs r1, 31 - movs r0, 0x1 - eors r1, r0 - ands r1, r4 - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - lsls r0, 31 - lsrs r0, 31 - adds r1, r7, 0 - adds r1, 0x2A - strb r0, [r1] - ldrb r0, [r3] - mov r2, r8 - orrs r0, r2 -_0810E4A2: - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - strb r0, [r3] -_0810E4AA: - ldrh r1, [r5, 0x2] - lsrs r1, 6 - lsls r1, 4 - ldrb r2, [r5] - movs r0, 0xF - ands r0, r2 - orrs r0, r1 - strb r0, [r5] - ldr r3, =gUnknown_08329F40 - ldrh r0, [r5, 0x2] - lsls r0, 1 - adds r0, r3 - movs r2, 0 - ldrsh r1, [r0, r2] - ldrb r0, [r5, 0xC] - muls r0, r1 - asrs r0, 8 - strh r0, [r7, 0x24] - ldrb r2, [r7, 0x3] - lsls r2, 26 - lsrs r2, 27 - movs r1, 0x24 - ldrsh r0, [r7, r1] - negs r0, r0 - asrs r0, 1 - ldrb r5, [r5, 0xA] - adds r0, r5 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r3 - ldrh r4, [r1] - ldr r1, =0x02021bc0 - lsls r2, 3 - adds r2, r1 - adds r0, 0x40 - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - strh r0, [r2, 0x6] - strh r0, [r2] - strh r4, [r2, 0x2] - lsls r0, r4, 16 - asrs r0, 16 - negs r0, r0 - strh r0, [r2, 0x4] - ldr r0, =sub_810E520 - str r0, [r7, 0x1C] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810E314 - - thumb_func_start sub_810E520 -sub_810E520: @ 810E520 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r5, r0, 0 - movs r6, 0 - adds r4, r5, 0 - adds r4, 0x2E - ldrb r2, [r4] - movs r7, 0x1 - movs r0, 0x1 - mov r9, r0 - ands r0, r2 - cmp r0, 0 - beq _0810E55A - ldrb r0, [r4, 0x1] - adds r1, r0, 0 - adds r1, 0xFF - strb r1, [r4, 0x1] - lsls r0, 24 - cmp r0, 0 - beq _0810E54E - b _0810EA36 -_0810E54E: - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r4] - strb r6, [r4, 0x1] - b _0810EA36 -_0810E55A: - ldrh r0, [r4, 0x2] - lsrs r1, r0, 6 - mov r12, r0 - cmp r1, 0x1 - bne _0810E566 - b _0810E68A -_0810E566: - cmp r1, 0x1 - bgt _0810E570 - cmp r1, 0 - beq _0810E57E - b _0810E97C -_0810E570: - cmp r1, 0x2 - bne _0810E576 - b _0810E77E -_0810E576: - cmp r1, 0x3 - bne _0810E57C - b _0810E872 -_0810E57C: - b _0810E97C -_0810E57E: - lsls r1, r2, 24 - lsrs r0, r1, 28 - cmp r0, 0x1 - bne _0810E592 - movs r0, 0x8 - orrs r0, r2 - orrs r0, r7 - strb r0, [r4] - strb r6, [r4, 0x1] - b _0810E680 -_0810E592: - lsrs r0, r1, 28 - cmp r0, 0x3 - bne _0810E5B4 - lsls r0, r2, 30 - lsrs r0, 31 - movs r1, 0x1 - eors r0, r1 - ands r0, r7 - lsls r0, 1 - movs r1, 0x3 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - orrs r1, r7 - strb r1, [r4] - strb r6, [r4, 0x1] - b _0810E680 -_0810E5B4: - movs r0, 0x8 - ands r0, r2 - cmp r0, 0 - beq _0810E680 - adds r3, r5, 0 - adds r3, 0x3F - ldrb r2, [r3] - lsls r1, r2, 31 - lsrs r1, 31 - movs r6, 0x1 - eors r1, r6 - ands r1, r7 - movs r0, 0x2 - negs r0, r0 - mov r8, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - lsls r0, 31 - lsrs r0, 31 - adds r1, r5, 0 - adds r1, 0x2A - strb r0, [r1] - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - strb r0, [r3] - ldrb r1, [r4] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0810E672 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0810E642 - ldrb r1, [r4, 0xE] - mov r0, r9 - ands r0, r1 - cmp r0, 0 - bne _0810E628 - ldrb r2, [r5, 0x5] - lsls r1, r2, 28 - lsrs r1, 30 - subs r1, 0x1 - movs r0, 0x3 - ands r1, r0 - lsls r1, 2 - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - b _0810E660 -_0810E628: - ldrb r2, [r5, 0x5] - lsls r1, r2, 28 - lsrs r1, 30 - adds r1, 0x1 - movs r0, 0x3 - ands r1, r0 - lsls r1, 2 - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - b _0810E660 -_0810E642: - ldrb r1, [r4, 0xE] - mov r0, r9 - ands r0, r1 - cmp r0, 0 - bne _0810E656 - adds r1, r5, 0 - adds r1, 0x43 - ldrb r0, [r1] - subs r0, 0xC - b _0810E65E -_0810E656: - adds r1, r5, 0 - adds r1, 0x43 - ldrb r0, [r1] - adds r0, 0xC -_0810E65E: - strb r0, [r1] -_0810E660: - ldrb r2, [r4, 0xE] - lsls r0, r2, 31 - lsrs r0, 31 - eors r0, r6 - ands r0, r7 - mov r1, r8 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0xE] -_0810E672: - ldrb r1, [r4] - movs r0, 0x9 - negs r0, r0 - ands r0, r1 - strb r0, [r4] - ldrh r1, [r4, 0x2] - mov r12, r1 -_0810E680: - ldrb r1, [r4] - movs r0, 0xF - ands r0, r1 - strb r0, [r4] - b _0810E97C -_0810E68A: - lsls r1, r2, 24 - lsrs r0, r1, 28 - cmp r0, 0 - bne _0810E698 - movs r0, 0x8 - orrs r0, r2 - b _0810E6A0 -_0810E698: - lsrs r0, r1, 28 - cmp r0, 0x2 - bne _0810E6A8 - adds r0, r2, 0 -_0810E6A0: - orrs r0, r7 - strb r0, [r4] - strb r6, [r4, 0x1] - b _0810E774 -_0810E6A8: - movs r0, 0x8 - ands r0, r2 - cmp r0, 0 - beq _0810E774 - adds r3, r5, 0 - adds r3, 0x3F - ldrb r2, [r3] - lsls r1, r2, 31 - lsrs r1, 31 - movs r6, 0x1 - eors r1, r6 - ands r1, r7 - movs r0, 0x2 - negs r0, r0 - mov r8, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - lsls r0, 31 - lsrs r0, 31 - adds r1, r5, 0 - adds r1, 0x2A - strb r0, [r1] - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - strb r0, [r3] - ldrb r1, [r4] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0810E766 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0810E736 - ldrb r1, [r4, 0xE] - mov r0, r9 - ands r0, r1 - cmp r0, 0 - bne _0810E71C - ldrb r2, [r5, 0x5] - lsls r1, r2, 28 - lsrs r1, 30 - subs r1, 0x1 - movs r0, 0x3 - ands r1, r0 - lsls r1, 2 - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - b _0810E754 -_0810E71C: - ldrb r2, [r5, 0x5] - lsls r1, r2, 28 - lsrs r1, 30 - adds r1, 0x1 - movs r0, 0x3 - ands r1, r0 - lsls r1, 2 - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - b _0810E754 -_0810E736: - ldrb r1, [r4, 0xE] - mov r0, r9 - ands r0, r1 - cmp r0, 0 - bne _0810E74A - adds r1, r5, 0 - adds r1, 0x43 - ldrb r0, [r1] - subs r0, 0xC - b _0810E752 -_0810E74A: - adds r1, r5, 0 - adds r1, 0x43 - ldrb r0, [r1] - adds r0, 0xC -_0810E752: - strb r0, [r1] -_0810E754: - ldrb r2, [r4, 0xE] - lsls r0, r2, 31 - lsrs r0, 31 - eors r0, r6 - ands r0, r7 - mov r1, r8 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0xE] -_0810E766: - ldrb r1, [r4] - movs r0, 0x9 - negs r0, r0 - ands r0, r1 - strb r0, [r4] - ldrh r1, [r4, 0x2] - mov r12, r1 -_0810E774: - ldrb r0, [r4] - movs r1, 0xF - ands r1, r0 - movs r0, 0x10 - b _0810E978 -_0810E77E: - lsls r1, r2, 24 - lsrs r0, r1, 28 - cmp r0, 0x3 - bne _0810E78C - movs r0, 0x8 - orrs r0, r2 - b _0810E794 -_0810E78C: - lsrs r0, r1, 28 - cmp r0, 0x1 - bne _0810E79C - adds r0, r2, 0 -_0810E794: - orrs r0, r7 - strb r0, [r4] - strb r6, [r4, 0x1] - b _0810E868 -_0810E79C: - movs r0, 0x8 - ands r0, r2 - cmp r0, 0 - beq _0810E868 - adds r3, r5, 0 - adds r3, 0x3F - ldrb r2, [r3] - lsls r1, r2, 31 - lsrs r1, 31 - movs r6, 0x1 - eors r1, r6 - ands r1, r7 - movs r0, 0x2 - negs r0, r0 - mov r8, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - lsls r0, 31 - lsrs r0, 31 - adds r1, r5, 0 - adds r1, 0x2A - strb r0, [r1] - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - strb r0, [r3] - ldrb r1, [r4] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0810E85A - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0810E82A - ldrb r1, [r4, 0xE] - mov r0, r9 - ands r0, r1 - cmp r0, 0 - bne _0810E810 - ldrb r2, [r5, 0x5] - lsls r1, r2, 28 - lsrs r1, 30 - subs r1, 0x1 - movs r0, 0x3 - ands r1, r0 - lsls r1, 2 - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - b _0810E848 -_0810E810: - ldrb r2, [r5, 0x5] - lsls r1, r2, 28 - lsrs r1, 30 - adds r1, 0x1 - movs r0, 0x3 - ands r1, r0 - lsls r1, 2 - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - b _0810E848 -_0810E82A: - ldrb r1, [r4, 0xE] - mov r0, r9 - ands r0, r1 - cmp r0, 0 - bne _0810E83E - adds r1, r5, 0 - adds r1, 0x43 - ldrb r0, [r1] - subs r0, 0xC - b _0810E846 -_0810E83E: - adds r1, r5, 0 - adds r1, 0x43 - ldrb r0, [r1] - adds r0, 0xC -_0810E846: - strb r0, [r1] -_0810E848: - ldrb r2, [r4, 0xE] - lsls r0, r2, 31 - lsrs r0, 31 - eors r0, r6 - ands r0, r7 - mov r1, r8 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0xE] -_0810E85A: - ldrb r1, [r4] - movs r0, 0x9 - negs r0, r0 - ands r0, r1 - strb r0, [r4] - ldrh r1, [r4, 0x2] - mov r12, r1 -_0810E868: - ldrb r0, [r4] - movs r1, 0xF - ands r1, r0 - movs r0, 0x20 - b _0810E978 -_0810E872: - lsls r1, r2, 24 - lsrs r0, r1, 28 - cmp r0, 0x2 - bne _0810E882 - movs r0, 0x8 - orrs r0, r2 - strb r0, [r4] - b _0810E970 -_0810E882: - lsrs r0, r1, 28 - cmp r0, 0 - bne _0810E8A4 - lsls r0, r2, 30 - lsrs r0, 31 - movs r1, 0x1 - eors r0, r1 - ands r0, r7 - lsls r0, 1 - movs r1, 0x3 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - orrs r1, r7 - strb r1, [r4] - strb r6, [r4, 0x1] - b _0810E970 -_0810E8A4: - movs r0, 0x8 - ands r0, r2 - cmp r0, 0 - beq _0810E970 - adds r3, r5, 0 - adds r3, 0x3F - ldrb r2, [r3] - lsls r1, r2, 31 - lsrs r1, 31 - movs r6, 0x1 - eors r1, r6 - ands r1, r7 - movs r0, 0x2 - negs r0, r0 - mov r8, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - lsls r0, 31 - lsrs r0, 31 - adds r1, r5, 0 - adds r1, 0x2A - strb r0, [r1] - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - strb r0, [r3] - ldrb r1, [r4] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0810E962 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0810E932 - ldrb r1, [r4, 0xE] - mov r0, r9 - ands r0, r1 - cmp r0, 0 - bne _0810E918 - ldrb r2, [r5, 0x5] - lsls r1, r2, 28 - lsrs r1, 30 - subs r1, 0x1 - movs r0, 0x3 - ands r1, r0 - lsls r1, 2 - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - b _0810E950 -_0810E918: - ldrb r2, [r5, 0x5] - lsls r1, r2, 28 - lsrs r1, 30 - adds r1, 0x1 - movs r0, 0x3 - ands r1, r0 - lsls r1, 2 - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - b _0810E950 -_0810E932: - ldrb r1, [r4, 0xE] - mov r0, r9 - ands r0, r1 - cmp r0, 0 - bne _0810E946 - adds r1, r5, 0 - adds r1, 0x43 - ldrb r0, [r1] - subs r0, 0xC - b _0810E94E -_0810E946: - adds r1, r5, 0 - adds r1, 0x43 - ldrb r0, [r1] - adds r0, 0xC -_0810E94E: - strb r0, [r1] -_0810E950: - ldrb r2, [r4, 0xE] - lsls r0, r2, 31 - lsrs r0, 31 - eors r0, r6 - ands r0, r7 - mov r1, r8 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0xE] -_0810E962: - ldrb r1, [r4] - movs r0, 0x9 - negs r0, r0 - ands r0, r1 - strb r0, [r4] - ldrh r1, [r4, 0x2] - mov r12, r1 -_0810E970: - ldrb r0, [r4] - movs r1, 0xF - ands r1, r0 - movs r0, 0x30 -_0810E978: - orrs r1, r0 - strb r1, [r4] -_0810E97C: - ldrb r1, [r4] - lsls r1, 30 - lsrs r1, 31 - adds r0, r4, 0 - adds r0, 0xC - adds r0, r1 - ldrb r1, [r0] - ldr r3, =gUnknown_08329F40 - mov r2, r12 - lsls r0, r2, 1 - adds r0, r3 - movs r2, 0 - ldrsh r0, [r0, r2] - muls r0, r1 - asrs r0, 8 - strh r0, [r5, 0x24] - ldrb r2, [r5, 0x3] - lsls r2, 26 - lsrs r2, 27 - movs r1, 0x24 - ldrsh r0, [r5, r1] - negs r0, r0 - asrs r0, 1 - ldrb r1, [r4, 0xA] - adds r0, r1 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r3 - ldrh r6, [r1] - ldr r1, =0x02021bc0 - lsls r2, 3 - adds r2, r1 - adds r0, 0x40 - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - strh r0, [r2, 0x6] - strh r0, [r2] - strh r6, [r2, 0x2] - lsls r0, r6, 16 - asrs r0, 16 - negs r0, r0 - strh r0, [r2, 0x4] - ldrh r0, [r4, 0x6] - ldrh r2, [r4, 0x8] - adds r0, r2 - strh r0, [r4, 0x8] - lsls r0, 16 - lsrs r0, 24 - strh r0, [r5, 0x22] - movs r1, 0x4 - ldrsh r0, [r4, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0810EA0C - ldrh r0, [r4, 0x4] - subs r1, 0x1 - ands r1, r0 - ldrh r0, [r4, 0x2] - subs r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x2] - b _0810EA1C - .pool -_0810EA0C: - ldrh r0, [r4, 0x4] - ldr r1, =0x00007fff - ands r1, r0 - ldrh r2, [r4, 0x2] - adds r1, r2 - movs r0, 0xFF - ands r1, r0 - strh r1, [r4, 0x2] -_0810EA1C: - movs r0, 0x22 - ldrsh r1, [r5, r0] - movs r2, 0x26 - ldrsh r0, [r5, r2] - adds r1, r0 - ldrh r0, [r4, 0xE] - lsrs r0, 1 - cmp r1, r0 - blt _0810EA36 - movs r0, 0 - strh r0, [r5, 0x2E] - ldr r0, =sub_810E2C8 - str r0, [r5, 0x1C] -_0810EA36: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810E520 - - thumb_func_start sub_810EA4C -sub_810EA4C: @ 810EA4C - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, =0x02038437 - ldrb r0, [r0] - bl sub_80A8328 - movs r1, 0x3 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r4, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x5] - ldr r5, =0x02038436 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x20] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - ldr r0, =sub_80A7820 - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810EA4C - - thumb_func_start sub_810EAA0 -sub_810EAA0: @ 810EAA0 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x0203841e - movs r1, 0x4 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0810EABC - adds r0, r5, 0 - movs r1, 0 - bl sub_80A69CC - b _0810EAC4 - .pool -_0810EABC: - adds r0, r5, 0 - movs r1, 0 - bl sub_80A6980 -_0810EAC4: - ldr r4, =0x0203841e - movs r2, 0x4 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0810EADC - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810EAF2 -_0810EADC: - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _0810EAF8 - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0810EAF8 -_0810EAF2: - ldrh r0, [r5, 0x20] - adds r0, 0x8 - strh r0, [r5, 0x20] -_0810EAF8: - ldr r4, =0x0203841e - ldrb r1, [r4, 0x8] - adds r0, r5, 0 - bl SeekObjectImageAnim - ldrh r0, [r5, 0x20] - subs r0, 0x20 - strh r0, [r5, 0x20] - ldr r0, =0x00000ccc - strh r0, [r5, 0x30] - ldrh r1, [r4, 0x8] - movs r0, 0xC - adds r2, r0, 0 - muls r2, r1 - adds r0, r2, 0 - ldrh r2, [r5, 0x24] - adds r0, r2 - strh r0, [r5, 0x24] - strh r1, [r5, 0x2E] - ldrh r0, [r4, 0x6] - strh r0, [r5, 0x3C] - ldr r0, =sub_810EB40 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810EAA0 - - thumb_func_start sub_810EB40 -sub_810EB40: @ 810EB40 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r4, 0x24] - adds r0, r1 - movs r1, 0 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bne _0810EB6A - strh r1, [r4, 0x2E] - strh r1, [r4, 0x24] - adds r0, r4, 0 - bl StartObjectImageAnim -_0810EB6A: - ldrh r0, [r4, 0x3C] - subs r0, 0x1 - strh r0, [r4, 0x3C] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0810EB82 - adds r0, r4, 0 - bl move_anim_8072740 -_0810EB82: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810EB40 - - thumb_func_start sub_810EB88 -sub_810EB88: @ 810EB88 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r7, r0, r1 - ldrh r0, [r7, 0x8] - movs r1, 0x1F - ands r0, r1 - cmp r0, 0 - bne _0810EC02 - ldr r1, =0x020383fe - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r1, 0x8 - ldrsh r0, [r7, r1] - movs r5, 0xD - negs r5, r5 - adds r1, r5, 0 - bl sine - ldr r4, =0x0203841e - strh r0, [r4] - movs r1, 0x8 - ldrsh r0, [r7, r1] - adds r1, r5, 0 - bl cosine - strh r0, [r4, 0x2] - movs r0, 0x1 - strh r0, [r4, 0x4] - movs r0, 0x3 - strh r0, [r4, 0x6] - ldr r0, =gUnknown_085973E8 - mov r8, r0 - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - mov r0, r8 - adds r1, r4, 0 - movs r3, 0x3 - bl AddObjectAndAnimateForOneFrame -_0810EC02: - ldrh r0, [r7, 0x8] - adds r0, 0x8 - strh r0, [r7, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _0810EC16 - adds r0, r6, 0 - bl move_anim_task_del -_0810EC16: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810EB88 - - thumb_func_start sub_810EC34 -sub_810EC34: @ 810EC34 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0810EC46 - cmp r0, 0x1 - beq _0810EC78 - b _0810EC8C -_0810EC46: - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80A69CC - movs r0, 0 - bl obj_id_for_side_relative_to_move - ldr r2, =0x02020630 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0810EC8C - .pool -_0810EC78: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0810EC8C - adds r0, r4, 0 - bl move_anim_8072740 -_0810EC8C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810EC34 - - thumb_func_start sub_810EC94 -sub_810EC94: @ 810EC94 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0810ECCC - cmp r0, 0x1 - bgt _0810ECAA - cmp r0, 0 - beq _0810ECB0 - b _0810ED1E -_0810ECAA: - cmp r0, 0x2 - beq _0810ECE0 - b _0810ED1E -_0810ECB0: - ldr r0, =0x02038437 - ldrb r0, [r0] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - negs r0, r0 - subs r0, 0x20 - strh r0, [r4, 0x26] - b _0810ECD8 - .pool -_0810ECCC: - ldrh r0, [r4, 0x26] - adds r0, 0xA - strh r0, [r4, 0x26] - lsls r0, 16 - cmp r0, 0 - blt _0810ED1E -_0810ECD8: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0810ED1E -_0810ECE0: - ldrh r0, [r4, 0x26] - subs r0, 0xA - strh r0, [r4, 0x26] - movs r2, 0x22 - ldrsh r0, [r4, r2] - movs r2, 0x26 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - bge _0810ED1E - movs r0, 0 - bl obj_id_for_side_relative_to_move - ldr r2, =0x02020630 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x3E - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - adds r0, r4, 0 - bl move_anim_8072740 -_0810ED1E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810EC94 - - thumb_func_start sub_810ED28 -sub_810ED28: @ 810ED28 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x2E] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x30] - ldr r0, =sub_810ED70 - str r0, [r4, 0x1C] - movs r0, 0 - bl obj_id_for_side_relative_to_move - ldr r2, =0x02020630 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810ED28 - - thumb_func_start sub_810ED70 -sub_810ED70: @ 810ED70 - push {lr} - adds r2, r0, 0 - ldrh r1, [r2, 0x2E] - movs r3, 0x2E - ldrsh r0, [r2, r3] - cmp r0, 0 - ble _0810ED84 - subs r0, r1, 0x1 - strh r0, [r2, 0x2E] - b _0810EDC8 -_0810ED84: - movs r1, 0x22 - ldrsh r0, [r2, r1] - movs r3, 0x26 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - ble _0810EDAA - ldrh r0, [r2, 0x30] - ldrh r1, [r2, 0x32] - adds r0, r1 - strh r0, [r2, 0x32] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r2, 0x26] - subs r1, r0 - strh r1, [r2, 0x26] - b _0810EDC8 -_0810EDAA: - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r3] - ldrh r0, [r2, 0x34] - adds r1, r0, 0x1 - strh r1, [r2, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _0810EDC8 - ldr r0, =sub_810EDD0 - str r0, [r2, 0x1C] -_0810EDC8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_810ED70 - - thumb_func_start sub_810EDD0 -sub_810EDD0: @ 810EDD0 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x32] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r2, 0x26] - adds r0, r1 - strh r0, [r2, 0x26] - movs r3, 0x22 - ldrsh r0, [r2, r3] - movs r3, 0x26 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - ble _0810EE00 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] -_0810EE00: - movs r1, 0x26 - ldrsh r0, [r2, r1] - cmp r0, 0 - ble _0810EE0E - adds r0, r2, 0 - bl move_anim_8072740 -_0810EE0E: - pop {r0} - bx r0 - thumb_func_end sub_810EDD0 - - thumb_func_start sub_810EE14 -sub_810EE14: @ 810EE14 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _0810EE28 - cmp r0, 0x1 - beq _0810EE80 - b _0810EEEC -_0810EE28: - ldr r0, =0x0203841e - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0 - bne _0810EE40 - ldr r4, =0x02038436 - b _0810EE42 - .pool -_0810EE40: - ldr r4, =0x02038437 -_0810EE42: - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - movs r0, 0 - movs r3, 0x80 - lsls r3, 2 - strh r3, [r5, 0x30] - movs r2, 0x80 - lsls r2, 1 - str r0, [sp] - adds r0, r5, 0 - movs r1, 0 - bl sub_80A73E0 - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - b _0810EEEC - .pool -_0810EE80: - movs r1, 0x32 - ldrsh r0, [r5, r1] - cmp r0, 0xB - bgt _0810EE8E - ldrh r0, [r5, 0x30] - subs r0, 0x28 - b _0810EE92 -_0810EE8E: - ldrh r0, [r5, 0x30] - adds r0, 0x28 -_0810EE92: - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x32] - adds r0, 0x1 - movs r1, 0 - strh r0, [r5, 0x32] - movs r2, 0x80 - lsls r2, 1 - movs r0, 0x30 - ldrsh r3, [r5, r0] - str r1, [sp] - adds r0, r5, 0 - bl sub_80A73E0 - ldrb r1, [r5, 0x3] - lsls r1, 26 - lsrs r1, 27 - movs r0, 0xF4 - lsls r0, 6 - ldr r2, =0x02021bc0 - lsls r1, 3 - adds r1, r2 - movs r2, 0x6 - ldrsh r1, [r1, r2] - bl __divsi3 - adds r1, r0, 0x1 - cmp r1, 0x80 - ble _0810EECC - movs r1, 0x80 -_0810EECC: - movs r0, 0x40 - subs r0, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r1, r0, 1 - strh r1, [r5, 0x26] - movs r1, 0x32 - ldrsh r0, [r5, r1] - cmp r0, 0x18 - bne _0810EEEC - adds r0, r5, 0 - bl sub_80A749C - adds r0, r5, 0 - bl move_anim_8072740 -_0810EEEC: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810EE14 - - thumb_func_start sub_810EEF8 -sub_810EEF8: @ 810EEF8 - push {r4,r5,lr} - adds r5, r0, 0 - bl GenerateRandomNumber2 - ldr r4, =0x000001ff - ands r4, r0 - bl GenerateRandomNumber2 - movs r1, 0x7F - ands r1, r0 - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0810EF20 - movs r2, 0xB8 - lsls r2, 2 - adds r0, r4, r2 - b _0810EF28 - .pool -_0810EF20: - movs r2, 0xB8 - lsls r2, 2 - adds r0, r2, 0 - subs r0, r4 -_0810EF28: - strh r0, [r5, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0810EF3C - movs r2, 0xE0 - lsls r2, 2 - adds r0, r2, 0 - adds r0, r1, r0 - b _0810EF44 -_0810EF3C: - movs r2, 0xE0 - lsls r2, 2 - adds r0, r2, 0 - subs r0, r1 -_0810EF44: - strh r0, [r5, 0x30] - ldr r2, =0x0203841e - ldrh r0, [r2] - strh r0, [r5, 0x32] - lsls r0, 16 - cmp r0, 0 - beq _0810EF60 - ldrb r0, [r5, 0x3] - movs r1, 0x3F - negs r1, r1 - ands r1, r0 - movs r0, 0x10 - orrs r1, r0 - strb r1, [r5, 0x3] -_0810EF60: - movs r1, 0x2 - ldrsh r0, [r2, r1] - cmp r0, 0 - bne _0810EF74 - ldr r4, =0x02038436 - b _0810EF76 - .pool -_0810EF74: - ldr r4, =0x02038437 -_0810EF76: - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x20 - strh r0, [r5, 0x22] - ldr r0, =sub_810EFA8 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810EEF8 - - thumb_func_start sub_810EFA8 -sub_810EFA8: @ 810EFA8 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0810EFC0 - ldrh r3, [r4, 0x2E] - lsls r0, r3, 16 - asrs r0, 24 - ldrh r1, [r4, 0x24] - adds r0, r1 - b _0810EFCA -_0810EFC0: - ldrh r3, [r4, 0x2E] - lsls r1, r3, 16 - asrs r1, 24 - ldrh r0, [r4, 0x24] - subs r0, r1 -_0810EFCA: - strh r0, [r4, 0x24] - ldrh r2, [r4, 0x30] - lsls r1, r2, 16 - asrs r1, 24 - ldrh r0, [r4, 0x26] - subs r0, r1 - strh r0, [r4, 0x26] - strh r3, [r4, 0x2E] - adds r0, r2, 0 - subs r0, 0x20 - strh r0, [r4, 0x30] - lsls r0, r3, 16 - cmp r0, 0 - bge _0810EFEA - movs r0, 0 - strh r0, [r4, 0x2E] -_0810EFEA: - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1F - bne _0810EFFE - adds r0, r4, 0 - bl move_anim_8072740 -_0810EFFE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810EFA8 - - thumb_func_start sub_810F004 -sub_810F004: @ 810F004 - movs r1, 0 - strh r1, [r0, 0x3A] - movs r1, 0x40 - strh r1, [r0, 0x3C] - ldr r1, =sub_810F018 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_810F004 - - thumb_func_start sub_810F018 -sub_810F018: @ 810F018 - push {lr} - adds r3, r0, 0 - movs r0, 0x2E - ldrsh r1, [r3, r0] - cmp r1, 0 - beq _0810F02A - cmp r1, 0x1 - beq _0810F078 - b _0810F07E -_0810F02A: - ldrh r0, [r3, 0x30] - adds r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _0810F07E - strh r1, [r3, 0x30] - movs r1, 0x3E - adds r1, r3 - mov r12, r1 - ldrb r2, [r1] - 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 - mov r1, r12 - strb r0, [r1] - ldrh r0, [r3, 0x32] - adds r0, 0x1 - strh r0, [r3, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - ble _0810F07E - ldrb r1, [r1] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0810F07E - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - b _0810F07E -_0810F078: - adds r0, r3, 0 - bl move_anim_8072740 -_0810F07E: - pop {r0} - bx r0 - thumb_func_end sub_810F018 - - thumb_func_start sub_810F084 -sub_810F084: @ 810F084 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - mov r8, r0 - ldrh r4, [r0, 0x20] - ldrh r5, [r0, 0x22] - ldr r6, =0x02038436 - ldrb r0, [r6] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - strh r0, [r1, 0x20] - ldrb r0, [r6] - movs r1, 0x3 - bl sub_80A5C6C - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - mov r2, r8 - strh r6, [r2, 0x22] - ldrh r0, [r2, 0x20] - mov r9, r0 - mov r1, r9 - lsls r0, r1, 4 - strh r0, [r2, 0x36] - lsls r0, r6, 4 - strh r0, [r2, 0x38] - lsls r4, 16 - asrs r4, 16 - movs r1, 0x20 - ldrsh r0, [r2, r1] - subs r0, r4, r0 - lsls r0, 4 - movs r1, 0xC - bl __divsi3 - mov r2, r8 - strh r0, [r2, 0x3A] - lsls r5, 16 - asrs r5, 16 - movs r1, 0x22 - ldrsh r0, [r2, r1] - subs r0, r5, r0 - lsls r0, 4 - movs r1, 0xC - bl __divsi3 - mov r2, r8 - strh r0, [r2, 0x3C] - mov r0, r9 - subs r4, r0 - lsls r4, 16 - asrs r4, 16 - subs r5, r6 - lsls r5, 16 - asrs r5, 16 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_80A74F4 - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 24 - adds r0, r1 - lsrs r0, 16 - movs r3, 0x80 - lsls r3, 1 - str r0, [sp] - mov r0, r8 - movs r1, 0x1 - adds r2, r3, 0 - bl sub_80A73E0 - ldr r0, =sub_810F140 - mov r2, r8 - str r0, [r2, 0x1C] - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810F084 - - thumb_func_start sub_810F140 -sub_810F140: @ 810F140 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x3A] - ldrh r1, [r2, 0x36] - adds r0, r1 - strh r0, [r2, 0x36] - ldrh r1, [r2, 0x3C] - ldrh r3, [r2, 0x38] - adds r1, r3 - strh r1, [r2, 0x38] - lsls r0, 16 - asrs r0, 20 - strh r0, [r2, 0x20] - lsls r1, 16 - asrs r3, r1, 20 - strh r3, [r2, 0x22] - adds r0, 0x2D - lsls r0, 16 - movs r1, 0xA5 - lsls r1, 17 - cmp r0, r1 - bhi _0810F17A - adds r1, r3, 0 - cmp r1, 0x9D - bgt _0810F17A - movs r0, 0x2D - negs r0, r0 - cmp r1, r0 - bge _0810F180 -_0810F17A: - adds r0, r2, 0 - bl move_anim_8074EE0 -_0810F180: - pop {r0} - bx r0 - thumb_func_end sub_810F140 - - thumb_func_start sub_810F184 -sub_810F184: @ 810F184 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0810F1BC - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - b _0810F1DA - .pool -_0810F1BC: - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x3E - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 -_0810F1DA: - strb r0, [r1] - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810F184 - - thumb_func_start sub_810F1EC -sub_810F1EC: @ 810F1EC - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - bl sub_80A4DF0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810F212 - mov r0, r8 - cmp r0, 0 - beq _0810F22E -_0810F212: - ldrb r1, [r5, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r5, 0x5] - adds r1, r5, 0 - adds r1, 0x43 - movs r0, 0xC8 - strb r0, [r1] - mov r1, r8 - cmp r1, 0 - bne _0810F2B8 -_0810F22E: - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r4, r0, 24 - adds r7, r4, 0 - adds r0, r4, 0 - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - eors r0, r1 - negs r1, r0 - orrs r1, r0 - lsrs r6, r1, 31 - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _0810F264 - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0 - bl sub_80A438C -_0810F264: - movs r0, 0x2 - adds r4, r0, 0 - eors r4, r7 - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _0810F284 - movs r0, 0x1 - eors r6, r0 - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0 - bl sub_80A438C -_0810F284: - mov r0, r8 - cmp r0, 0 - bne _0810F2B8 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0810F2B8 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0810F2B0 - movs r0, 0x48 - strh r0, [r5, 0x20] - movs r0, 0x50 - b _0810F2F2 - .pool -_0810F2B0: - movs r0, 0xB0 - strh r0, [r5, 0x20] - movs r0, 0x28 - b _0810F2F2 -_0810F2B8: - ldr r6, =0x02038436 - ldrb r0, [r6] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810F2CE - ldr r1, =0x0203841e - ldrh r0, [r1] - negs r0, r0 - strh r0, [r1] -_0810F2CE: - ldrb r0, [r6] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - ldr r4, =0x0203841e - lsrs r0, 24 - ldrh r1, [r4] - adds r0, r1 - strh r0, [r5, 0x20] - ldrb r0, [r6] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r4, [r4, 0x2] - adds r0, r4 -_0810F2F2: - strh r0, [r5, 0x22] - ldr r0, =0x0203841e - ldrh r0, [r0, 0x4] - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 20 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - strh r0, [r5, 0x2E] - mov r0, r8 - cmp r0, 0 - beq _0810F32C - ldrh r0, [r5, 0x22] - adds r0, 0x9 - strh r0, [r5, 0x22] - ldr r1, =sub_810F3C8 - str r1, [r5, 0x1C] - adds r0, r5, 0 - bl _call_via_r1 - b _0810F330 - .pool -_0810F32C: - ldr r0, =sub_810F340 - str r0, [r5, 0x1C] -_0810F330: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810F1EC - - thumb_func_start sub_810F340 -sub_810F340: @ 810F340 - push {r4,r5,lr} - adds r5, r0, 0 - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r4, r0, 24 - movs r1, 0x3C - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0810F35C - movs r0, 0x1 - strh r0, [r5, 0x3C] - b _0810F3B6 -_0810F35C: - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _0810F382 - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - adds r0, r4, r0 - 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] -_0810F382: - movs r0, 0x2 - eors r4, r0 - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _0810F3AC - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - adds r0, r4, r0 - 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] -_0810F3AC: - ldr r1, =sub_810F3C8 - str r1, [r5, 0x1C] - adds r0, r5, 0 - bl _call_via_r1 -_0810F3B6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810F340 - - thumb_func_start sub_810F3C8 -sub_810F3C8: @ 810F3C8 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x34] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldrh r1, [r4, 0x34] - movs r2, 0x34 - ldrsh r0, [r4, r2] - cmp r0, 0xD - bne _0810F3F4 - ldr r0, =sub_810F400 - str r0, [r4, 0x1C] - b _0810F3F8 - .pool -_0810F3F4: - adds r0, r1, 0x1 - strh r0, [r4, 0x34] -_0810F3F8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810F3C8 - - thumb_func_start sub_810F400 -sub_810F400: @ 810F400 - push {r4-r7,lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x30] - adds r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _0810F45E - movs r0, 0 - strh r0, [r3, 0x30] - ldrh r4, [r3, 0x2E] - ldr r1, =0x02037b14 - adds r0, r4, 0 - adds r0, 0x8 - lsls r0, 1 - adds r0, r1 - ldrh r7, [r0] - movs r5, 0x8 - adds r6, r1, 0 - adds r1, r4, 0x7 - lsls r0, r4, 1 - adds r0, r6 - adds r2, r0, 0 - adds r2, 0x10 - lsls r1, 1 - adds r1, r6 -_0810F436: - ldrh r0, [r1] - strh r0, [r2] - subs r1, 0x2 - subs r2, 0x2 - subs r5, 0x1 - cmp r5, 0 - bgt _0810F436 - adds r0, r4, 0x1 - lsls r0, 1 - adds r0, r6 - strh r7, [r0] - ldrh r0, [r3, 0x32] - adds r0, 0x1 - strh r0, [r3, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - bne _0810F45E - ldr r0, =sub_810F46C - str r0, [r3, 0x1C] -_0810F45E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810F400 - - thumb_func_start sub_810F46C -sub_810F46C: @ 810F46C - push {r4-r6,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0x34] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldrh r0, [r5, 0x34] - subs r0, 0x1 - strh r0, [r5, 0x34] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0810F512 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0810F502 - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _0810F4D4 - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - adds r0, r4, r0 - ldrb r1, [r0] - 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] -_0810F4D4: - movs r0, 0x2 - adds r4, r0, 0 - eors r4, r6 - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _0810F502 - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - adds r0, r4, r0 - ldrb r1, [r0] - 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] -_0810F502: - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_810F524 - str r0, [r5, 0x1C] -_0810F512: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810F46C - - thumb_func_start sub_810F524 -sub_810F524: @ 810F524 - push {r4-r6,lr} - adds r6, r0, 0 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0810F57C - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - eors r0, r1 - negs r1, r0 - orrs r1, r0 - lsrs r5, r1, 31 - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _0810F562 - adds r0, r5, 0 - bl sub_80A477C -_0810F562: - movs r0, 0x2 - eors r4, r0 - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _0810F57C - movs r0, 0x1 - eors r5, r0 - adds r0, r5, 0 - bl sub_80A477C -_0810F57C: - ldr r0, =move_anim_8072740 - str r0, [r6, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810F524 - - thumb_func_start sub_810F58C -sub_810F58C: @ 810F58C - push {r4-r6,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0810F618 - ldr r5, =0x0203841e - movs r1, 0x6 - ldrsh r0, [r5, r1] - movs r6, 0 - cmp r0, 0 - bne _0810F5A6 - movs r6, 0x1 -_0810F5A6: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0810F5EE - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0810F5EE - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0810F5E0 - ldrh r0, [r5] - movs r1, 0x48 - subs r1, r0 - strh r1, [r4, 0x20] - ldrh r0, [r5, 0x2] - adds r0, 0x50 - strh r0, [r4, 0x22] - b _0810F610 - .pool -_0810F5E0: - ldrh r0, [r5] - adds r0, 0xB0 - strh r0, [r4, 0x20] - ldrh r0, [r5, 0x2] - adds r0, 0x28 - strh r0, [r4, 0x22] - b _0810F610 -_0810F5EE: - ldr r0, =0x0203841e - movs r1, 0x4 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0810F608 - adds r0, r4, 0 - adds r1, r6, 0 - bl sub_80A69CC - b _0810F610 - .pool -_0810F608: - adds r0, r4, 0 - adds r1, r6, 0 - bl sub_80A6980 -_0810F610: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0810F62C -_0810F618: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x30 - ands r0, r1 - cmp r0, 0 - beq _0810F62C - adds r0, r4, 0 - bl move_anim_8074EE0 -_0810F62C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_810F58C - - thumb_func_start sub_810F634 -sub_810F634: @ 810F634 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0810F684 - adds r0, r5, 0 - movs r1, 0x1 - bl StartObjectImageAnim - ldrh r0, [r5, 0x20] - subs r0, 0x28 - strh r0, [r5, 0x20] - ldrh r0, [r5, 0x22] - adds r0, 0xA - strh r0, [r5, 0x22] - ldr r0, =0x0000ffff - b _0810F692 - .pool -_0810F684: - ldrh r0, [r5, 0x20] - adds r0, 0x28 - strh r0, [r5, 0x20] - ldrh r0, [r5, 0x22] - subs r0, 0xA - strh r0, [r5, 0x22] - movs r0, 0x1 -_0810F692: - strh r0, [r5, 0x30] - ldr r1, =move_anim_8072740 - adds r0, r5, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A67D8 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810F634 - - thumb_func_start sub_810F6B0 -sub_810F6B0: @ 810F6B0 - push {r4-r7,lr} - adds r5, r0, 0 - ldr r6, =0x02038436 - ldrb r0, [r6] - movs r1, 0x1 - bl sub_80A861C - lsls r0, 16 - asrs r1, r0, 16 - lsrs r0, 31 - adds r1, r0 - lsls r1, 15 - lsrs r4, r1, 16 - ldrb r0, [r6] - movs r1, 0 - bl sub_80A861C - lsls r0, 16 - asrs r1, r0, 16 - lsrs r0, 31 - adds r1, r0 - asrs r1, 1 - negs r1, r1 - lsls r1, 16 - lsrs r7, r1, 16 - ldrb r0, [r6] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0810F6F6 - lsls r0, r4, 16 - negs r0, r0 - lsrs r4, r0, 16 -_0810F6F6: - ldrb r0, [r6] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - strh r0, [r5, 0x20] - ldrb r0, [r6] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, r7 - strh r0, [r5, 0x22] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - bgt _0810F722 - movs r0, 0x10 - strh r0, [r5, 0x22] -_0810F722: - ldr r1, =sub_810F740 - adds r0, r5, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A67D8 - str r0, [r5, 0x1C] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810F6B0 - - thumb_func_start sub_810F740 -sub_810F740: @ 810F740 - push {r4,lr} - adds r4, r0, 0 - ldrb r1, [r4, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r4, 0x1] - ldr r0, =gUnknown_08596740 - str r0, [r4, 0x10] - movs r0, 0 - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl obj_alloc_rotscale_entry - ldr r0, =sub_810F774 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810F740 - - thumb_func_start sub_810F774 -sub_810F774: @ 810F774 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0810F786 - cmp r0, 0x1 - beq _0810F7B4 - b _0810F7CC -_0810F786: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0810F7CC - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - ldrb r1, [r4, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x1] - movs r0, 0x12 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0810F7CC -_0810F7B4: - ldrh r0, [r4, 0x30] - subs r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0810F7CC - adds r0, r4, 0 - bl move_anim_8072740 -_0810F7CC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810F774 - - thumb_func_start sub_810F7D4 -sub_810F7D4: @ 810F7D4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - movs r0, 0 - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - strh r1, [r4, 0x8] - ldr r2, =gUnknown_0859675C - adds r0, r4, 0 - bl sub_80A7CFC - ldr r0, =sub_810F810 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810F7D4 - - thumb_func_start sub_810F810 -sub_810F810: @ 810F810 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r0, r1 - bl sub_80A7D34 - lsls r0, 24 - cmp r0, 0 - bne _0810F830 - adds r0, r4, 0 - bl move_anim_task_del -_0810F830: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810F810 - - thumb_func_start sub_810F83C -sub_810F83C: @ 810F83C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r4, r1, r0 - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - strh r0, [r4, 0x8] - strh r1, [r4, 0xA] - strh r1, [r4, 0xC] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - movs r1, 0x8 - cmp r0, 0 - beq _0810F870 - movs r1, 0x4 -_0810F870: - strh r1, [r4, 0xE] - ldrb r1, [r4, 0x8] - ldr r2, =gUnknown_0859677C - adds r0, r4, 0 - bl sub_80A7CFC - ldr r0, =sub_810F898 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810F83C - - thumb_func_start sub_810F898 -sub_810F898: @ 810F898 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0810F8BC - cmp r0, 0x1 - beq _0810F8D8 - b _0810F936 - .pool -_0810F8BC: - adds r0, r4, 0 - bl sub_80A7D34 - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _0810F936 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - b _0810F936 -_0810F8D8: - movs r1, 0xE - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0810F900 - ldr r2, =0x02020630 - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x26] - subs r1, 0x8 - strh r1, [r0, 0x26] - ldrh r0, [r4, 0xE] - subs r0, 0x1 - strh r0, [r4, 0xE] - b _0810F936 - .pool -_0810F900: - ldr r3, =0x02020630 - movs r0, 0x8 - ldrsh r1, [r4, r0] - 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] - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0x88 - lsls r1, 1 - strh r1, [r0, 0x20] - ldrb r0, [r4, 0x8] - bl sub_80A7344 - adds r0, r5, 0 - bl move_anim_task_del -_0810F936: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810F898 - - thumb_func_start sub_810F940 -sub_810F940: @ 810F940 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r5, r1, r0 - movs r1, 0 - movs r0, 0x10 - strh r0, [r5, 0xE] - strh r1, [r5, 0x10] - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x24] - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A861C - lsls r0, 16 - asrs r0, 16 - movs r1, 0x3 - bl __divsi3 - lsls r0, 16 - lsrs r6, r0, 16 - ldrb r0, [r4] - movs r1, 0 - bl sub_80A861C - lsls r0, 16 - asrs r0, 16 - movs r1, 0x3 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - adds r1, r0, 0 - cmp r0, r6 - bcs _0810F9AA - adds r1, r6, 0 -_0810F9AA: - strh r1, [r5, 0x20] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0x10 - bl SetGpuReg - ldr r0, =sub_810F9D4 - str r0, [r5] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810F940 - - thumb_func_start sub_810F9D4 -sub_810F9D4: @ 810F9D4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _0810FAD4 - cmp r1, 0x1 - bgt _0810F9FC - cmp r1, 0 - beq _0810FA0A - b _0810FB5A - .pool -_0810F9FC: - cmp r1, 0x2 - bne _0810FA02 - b _0810FB36 -_0810FA02: - cmp r1, 0x3 - bne _0810FA08 - b _0810FB44 -_0810FA08: - b _0810FB5A -_0810FA0A: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - bgt _0810FA1A - b _0810FB5A -_0810FA1A: - strh r1, [r4, 0xA] - ldr r0, =gUnknown_08596794 - movs r2, 0x22 - ldrsh r1, [r4, r2] - movs r3, 0x24 - ldrsh r2, [r4, r3] - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r2, r0, 24 - movs r0, 0xC - ldrsh r1, [r4, r0] - adds r1, 0x8 - lsls r1, 1 - adds r0, r4, 0 - adds r0, 0x8 - adds r0, r1 - strh r2, [r0] - cmp r2, 0x40 - beq _0810FABE - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0810FA78 - cmp r0, 0x1 - bgt _0810FA5C - cmp r0, 0 - beq _0810FA66 - b _0810FABE - .pool -_0810FA5C: - cmp r0, 0x2 - beq _0810FA90 - cmp r0, 0x3 - beq _0810FAA8 - b _0810FABE -_0810FA66: - ldr r0, =0x02020630 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r4, 0x20] - b _0810FAB6 - .pool -_0810FA78: - ldr r0, =0x02020630 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r4, 0x20] - negs r0, r0 - strh r0, [r1, 0x24] - ldrh r0, [r4, 0x20] - b _0810FABC - .pool -_0810FA90: - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r4, 0x20] - strh r1, [r0, 0x24] - ldrh r1, [r4, 0x20] - strh r1, [r0, 0x26] - b _0810FABE - .pool -_0810FAA8: - ldr r0, =0x02020630 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r4, 0x20] - negs r0, r0 -_0810FAB6: - strh r0, [r1, 0x24] - ldrh r0, [r4, 0x20] - negs r0, r0 -_0810FABC: - strh r0, [r1, 0x26] -_0810FABE: - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _0810FB5A - b _0810FB36 - .pool -_0810FAD4: - ldrh r0, [r4, 0xA] - ands r1, r0 - cmp r1, 0 - beq _0810FAE4 - ldrh r0, [r4, 0xE] - subs r0, 0x1 - strh r0, [r4, 0xE] - b _0810FAEA -_0810FAE4: - ldrh r0, [r4, 0x10] - adds r0, 0x1 - strh r0, [r4, 0x10] -_0810FAEA: - ldrh r1, [r4, 0x10] - lsls r1, 8 - ldrh r0, [r4, 0xE] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x20 - bne _0810FB5A - movs r5, 0x8 - adds r6, r4, 0 - adds r6, 0x8 -_0810FB10: - lsls r0, r5, 1 - adds r1, r6, r0 - movs r2, 0 - ldrsh r0, [r1, r2] - cmp r0, 0x40 - beq _0810FB2C - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles -_0810FB2C: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0xC - bls _0810FB10 -_0810FB36: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0810FB5A - .pool -_0810FB44: - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - adds r0, r5, 0 - bl move_anim_task_del -_0810FB5A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_810F9D4 - - thumb_func_start sub_810FB60 -sub_810FB60: @ 810FB60 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x30 - ldrsh r1, [r4, r0] - movs r2, 0x2E - ldrsh r0, [r4, r2] - subs r0, 0xA - cmp r1, r0 - ble _0810FB8A - ldrh r0, [r4, 0x30] - movs r1, 0x1 - ands r1, r0 - adds r3, r4, 0 - adds r3, 0x3E - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_0810FB8A: - movs r0, 0x30 - ldrsh r1, [r4, r0] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _0810FB9C - adds r0, r4, 0 - bl move_anim_8072740 -_0810FB9C: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810FB60 - - thumb_func_start sub_810FBA8 -sub_810FBA8: @ 810FBA8 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =0x0203841e - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0810FBD4 - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] -_0810FBD4: - ldrh r0, [r6, 0x2] - strh r0, [r5, 0x2E] - ldr r0, =sub_810FB60 - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810FBA8 - - thumb_func_start sub_810FBF0 -sub_810FBF0: @ 810FBF0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r5, r1, r0 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0810FC94 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x1 - bne _0810FC60 - ldr r0, =0x0000fff6 - strh r0, [r5, 0x1C] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x5 - bl sub_80A861C - subs r0, 0x8 - strh r0, [r5, 0x1E] - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A861C - adds r0, 0x8 - strh r0, [r5, 0x20] - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x5 - bl sub_80A861C - subs r0, 0x8 - strh r0, [r5, 0x22] - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A861C - adds r0, 0x8 - b _0810FD1E - .pool -_0810FC60: - movs r0, 0xA - strh r0, [r5, 0x1C] - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x4 - bl sub_80A861C - adds r0, 0x8 - strh r0, [r5, 0x1E] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A861C - subs r0, 0x8 - strh r0, [r5, 0x20] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x4 - bl sub_80A861C - adds r0, 0x8 - b _0810FD12 - .pool -_0810FC94: - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x1 - bne _0810FCE8 - ldr r0, =0x0000fff6 - strh r0, [r5, 0x1C] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x4 - bl sub_80A861C - adds r0, 0x8 - strh r0, [r5, 0x1E] - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A861C - adds r0, 0x8 - strh r0, [r5, 0x20] - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x4 - bl sub_80A861C - adds r0, 0x8 - strh r0, [r5, 0x22] - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A861C - adds r0, 0x8 - b _0810FD1E - .pool -_0810FCE8: - movs r0, 0xA - strh r0, [r5, 0x1C] - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x5 - bl sub_80A861C - subs r0, 0x8 - strh r0, [r5, 0x1E] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A861C - subs r0, 0x8 - strh r0, [r5, 0x20] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x5 - bl sub_80A861C - subs r0, 0x8 -_0810FD12: - strh r0, [r5, 0x22] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A861C - subs r0, 0x8 -_0810FD1E: - strh r0, [r5, 0x24] - movs r0, 0x6 - strh r0, [r5, 0xA] - ldr r0, =sub_810FD3C - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810FBF0 - - thumb_func_start sub_810FD3C -sub_810FD3C: @ 810FD3C - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r5, r0, r1 - movs r0, 0x8 - ldrsh r1, [r5, r0] - cmp r1, 0 - beq _0810FD60 - cmp r1, 0x1 - beq _0810FDD4 - b _0810FDE8 - .pool -_0810FD60: - ldrh r0, [r5, 0xA] - adds r0, 0x1 - strh r0, [r5, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - ble _0810FDE8 - strh r1, [r5, 0xA] - ldr r0, =gUnknown_08596864 - movs r2, 0x1E - ldrsh r1, [r5, r2] - movs r3, 0x20 - ldrsh r2, [r5, r3] - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _0810FDB4 - ldr r0, =0x02020630 - lsls r4, r1, 4 - adds r4, r1 - lsls r4, 2 - adds r4, r0 - movs r0, 0x10 - strh r0, [r4, 0x2E] - ldrh r0, [r5, 0x22] - strh r0, [r4, 0x32] - ldrh r0, [r5, 0x24] - strh r0, [r4, 0x36] - ldrh r0, [r5, 0x1C] - strh r0, [r4, 0x38] - adds r0, r4, 0 - bl sub_80A68D4 - ldrb r0, [r5, 0xC] - movs r1, 0x3 - ands r1, r0 - adds r0, r4, 0 - bl StartObjectRotScalAnim -_0810FDB4: - ldrh r0, [r5, 0xC] - adds r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - bne _0810FDE8 - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - b _0810FDE8 - .pool -_0810FDD4: - ldrh r0, [r5, 0xA] - adds r0, 0x1 - strh r0, [r5, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x11 - ble _0810FDE8 - adds r0, r2, 0 - bl move_anim_task_del -_0810FDE8: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_810FD3C - - thumb_func_start sub_810FDF0 -sub_810FDF0: @ 810FDF0 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _0810FE0E - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0810FE0E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810FDF0 - - thumb_func_start sub_810FE14 -sub_810FE14: @ 810FE14 - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r4, r1, r0 - ldr r0, =0x02038437 - ldrb r0, [r0] - bl sub_80A6190 - lsls r0, 24 - lsrs r1, r0, 24 - adds r0, r1, 0 - subs r0, 0x20 - strh r0, [r4, 0x24] - ldr r0, =0x0203841e - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0x1 - beq _0810FE6A - cmp r0, 0x1 - bgt _0810FE58 - cmp r0, 0 - beq _0810FE5E - b _0810FE86 - .pool -_0810FE58: - cmp r0, 0x2 - beq _0810FE76 - b _0810FE86 -_0810FE5E: - movs r0, 0x2 - strh r0, [r4, 0x1E] - movs r0, 0x5 - strh r0, [r4, 0x20] - movs r0, 0x40 - b _0810FE7E -_0810FE6A: - movs r0, 0x2 - strh r0, [r4, 0x1E] - movs r0, 0x5 - strh r0, [r4, 0x20] - movs r0, 0xC0 - b _0810FE7E -_0810FE76: - movs r0, 0x4 - strh r0, [r4, 0x1E] - strh r0, [r4, 0x20] - movs r0, 0 -_0810FE7E: - strh r0, [r4, 0x22] - adds r0, r1, 0 - adds r0, 0x20 - strh r0, [r4, 0x26] -_0810FE86: - movs r1, 0x24 - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _0810FE92 - movs r0, 0 - strh r0, [r4, 0x24] -_0810FE92: - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0810FEB8 - ldr r0, =0x02022e18 - ldrh r0, [r0] - strh r0, [r4, 0x1C] - ldr r0, =0x04000014 - b _0810FEC0 - .pool -_0810FEB8: - ldr r0, =0x02022e1c - ldrh r0, [r0] - strh r0, [r4, 0x1C] - ldr r0, =0x04000018 -_0810FEC0: - str r0, [sp] - ldrh r1, [r4, 0x24] - lsls r3, r1, 16 - asrs r1, r3, 16 - movs r2, 0x24 - ldrsh r0, [r4, r2] - adds r0, 0x40 - cmp r1, r0 - bgt _0810FEFA - ldr r5, =0x02038c28 - movs r0, 0xF0 - lsls r0, 3 - adds r6, r5, r0 -_0810FEDA: - asrs r3, 16 - lsls r1, r3, 1 - adds r2, r1, r5 - ldrh r0, [r4, 0x1C] - strh r0, [r2] - adds r1, r6 - ldrh r0, [r4, 0x1C] - strh r0, [r1] - adds r3, 0x1 - lsls r3, 16 - asrs r1, r3, 16 - movs r2, 0x24 - ldrsh r0, [r4, r2] - adds r0, 0x40 - cmp r1, r0 - ble _0810FEDA -_0810FEFA: - ldr r0, =0xa2600001 - str r0, [sp, 0x4] - mov r1, sp - movs r2, 0 - movs r0, 0x1 - strb r0, [r1, 0x8] - mov r0, sp - strb r2, [r0, 0x9] - ldr r0, [sp] - ldr r1, [sp, 0x4] - ldr r2, [sp, 0x8] - bl sub_80BA038 - ldr r0, =sub_810FF34 - str r0, [r4] - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810FE14 - - thumb_func_start sub_810FF34 -sub_810FF34: @ 810FF34 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _0811000E - cmp r0, 0x1 - bgt _0810FF60 - cmp r0, 0 - beq _0810FF66 - b _08110026 - .pool -_0810FF60: - cmp r0, 0x2 - beq _08110020 - b _08110026 -_0810FF66: - ldrh r3, [r5, 0x22] - ldrh r4, [r5, 0x24] - movs r2, 0x24 - ldrsh r1, [r5, r2] - movs r2, 0x26 - ldrsh r0, [r5, r2] - cmp r1, r0 - bgt _0810FFFE - ldr r0, =gUnknown_08329F40 - mov r9, r0 - movs r7, 0x3 - ldr r1, =0x02038c28 - mov r12, r1 - movs r2, 0xF0 - lsls r2, 3 - add r2, r12 - mov r8, r2 -_0810FF88: - lsls r2, r3, 16 - asrs r0, r2, 15 - add r0, r9 - movs r3, 0 - ldrsh r0, [r0, r3] - movs r3, 0x20 - ldrsh r1, [r5, r3] - asrs r0, r1 - lsls r0, 16 - lsrs r1, r0, 16 - asrs r3, r0, 16 - adds r6, r2, 0 - cmp r3, 0 - ble _0810FFB8 - ldrh r1, [r5, 0xA] - adds r0, r7, 0 - ands r0, r1 - adds r0, r3, r0 - b _0810FFC4 - .pool -_0810FFB8: - cmp r3, 0 - bge _0810FFC8 - ldrh r1, [r5, 0xA] - adds r0, r7, 0 - ands r0, r1 - subs r0, r3, r0 -_0810FFC4: - lsls r0, 16 - lsrs r1, r0, 16 -_0810FFC8: - lsls r2, r4, 16 - asrs r2, 16 - lsls r3, r2, 1 - mov r0, r12 - adds r4, r3, r0 - ldrh r0, [r5, 0x1C] - lsls r1, 16 - asrs r1, 16 - adds r0, r1, r0 - strh r0, [r4] - add r3, r8 - ldrh r0, [r5, 0x1C] - adds r1, r0 - strh r1, [r3] - asrs r0, r6, 16 - ldrh r1, [r5, 0x1E] - adds r0, r1 - lsls r0, 16 - lsrs r3, r0, 16 - adds r2, 0x1 - lsls r2, 16 - lsrs r4, r2, 16 - asrs r2, 16 - movs r1, 0x26 - ldrsh r0, [r5, r1] - cmp r2, r0 - ble _0810FF88 -_0810FFFE: - ldrh r0, [r5, 0xA] - adds r0, 0x1 - strh r0, [r5, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x17 - ble _08110026 - b _08110014 -_0811000E: - ldr r1, =0x02039b28 - movs r0, 0x3 - strb r0, [r1, 0x15] -_08110014: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - b _08110026 - .pool -_08110020: - adds r0, r2, 0 - bl move_anim_task_del -_08110026: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_810FF34 - - thumb_func_start sub_8110034 -sub_8110034: @ 8110034 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r4, r0, 24 - mov r8, r4 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r7, r0, r1 - bl rotscale_alloc_entry - lsls r0, 24 - lsrs r5, r0, 24 - mov r10, r5 - adds r6, r5, 0 - cmp r6, 0xFF - bne _0811006C - adds r0, r4, 0 - bl move_anim_task_del - b _08110116 - .pool -_0811006C: - ldr r1, =0x0203841e - ldrb r0, [r1] - bl duplicate_obj_of_side_rel2move_in_transparent_mode - lsls r0, 16 - lsrs r1, r0, 16 - mov r9, r1 - asrs r0, 16 - cmp r0, 0 - bge _08110094 - adds r0, r5, 0 - bl rotscale_free_entry - mov r0, r8 - bl move_anim_task_del - b _08110116 - .pool -_08110094: - ldr r2, =0x02020630 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - adds r0, r2, 0 - adds r0, 0x1C - adds r0, r4, r0 - ldr r1, =DummyObjectCallback - str r1, [r0] - adds r4, r2 - ldrb r0, [r4, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r4, 0x1] - movs r0, 0x1F - ands r6, r0 - lsls r2, r6, 1 - ldrb r1, [r4, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - orrs r0, r2 - strb r0, [r4, 0x3] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - adds r1, r4, 0 - adds r1, 0x43 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r1, r9 - lsls r0, r1, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - movs r3, 0 - bl obj_id_set_rotscale - ldrb r3, [r4, 0x1] - lsrs r1, r3, 6 - ldrb r2, [r4, 0x3] - lsrs r2, 6 - lsls r3, 30 - lsrs r3, 30 - adds r0, r4, 0 - bl CalcVecFromObjectCenterToObjectUpperLeft - ldr r1, =0x0203841e - ldrb r0, [r1] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x22] - mov r0, r10 - strh r0, [r7, 0x24] - mov r1, r9 - strh r1, [r7, 0x26] - ldr r0, =sub_8110134 - str r0, [r7] -_08110116: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8110034 - - thumb_func_start sub_8110134 -sub_8110134: @ 8110134 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _081101B8 - cmp r0, 0x1 - bgt _0811015C - cmp r0, 0 - beq _08110166 - b _08110238 - .pool -_0811015C: - cmp r0, 0x2 - beq _08110208 - cmp r0, 0x3 - beq _08110228 - b _08110238 -_08110166: - ldrh r0, [r4, 0xA] - adds r0, 0x4 - strh r0, [r4, 0xA] - ldr r1, =gUnknown_08329F40 - movs r2, 0xA - ldrsh r0, [r4, r2] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r1, 16 - asrs r1, 17 - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 - subs r0, r1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0xC - ldrsh r2, [r4, r1] - adds r1, r2, 0 - movs r3, 0 - bl obj_id_set_rotscale - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x22] - lsls r1, 24 - lsrs r1, 24 - bl sub_80A7EC0 - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0x30 - bne _08110238 - b _0811021A - .pool -_081101B8: - ldrh r0, [r4, 0xA] - subs r0, 0x4 - strh r0, [r4, 0xA] - ldr r1, =gUnknown_08329F40 - movs r2, 0xA - ldrsh r0, [r4, r2] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r1, 16 - asrs r1, 17 - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 - subs r0, r1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0xC - ldrsh r2, [r4, r1] - adds r1, r2, 0 - movs r3, 0 - bl obj_id_set_rotscale - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x22] - lsls r1, 24 - lsrs r1, 24 - bl sub_80A7EC0 - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _08110238 - b _0811021A - .pool -_08110208: - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl obj_delete_but_dont_free_vram -_0811021A: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _08110238 - .pool -_08110228: - ldrh r0, [r4, 0x24] - lsls r0, 24 - lsrs r0, 24 - bl rotscale_free_entry - adds r0, r5, 0 - bl move_anim_task_del -_08110238: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8110134 - - thumb_func_start sub_8110240 -sub_8110240: @ 8110240 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _081102B8 - cmp r0, 0x1 - bgt _08110256 - cmp r0, 0 - beq _08110260 - b _08110360 -_08110256: - cmp r0, 0x2 - beq _081102EA - cmp r0, 0x3 - beq _0811034A - b _08110360 -_08110260: - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0811028E - ldrh r0, [r5, 0x22] - adds r0, 0xC - strh r0, [r5, 0x22] -_0811028E: - movs r0, 0x8 - strh r0, [r5, 0x30] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldrh r0, [r5, 0x30] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - b _081102E2 - .pool -_081102B8: - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08110360 - movs r0, 0x40 - negs r0, r0 - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xCB - bl audio_play_and_stuff - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80082B8 -_081102E2: - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - b _08110360 -_081102EA: - ldrh r0, [r5, 0x32] - adds r1, r0, 0x1 - strh r1, [r5, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0811032E - movs r0, 0 - strh r0, [r5, 0x32] - ldrh r1, [r5, 0x30] - subs r1, 0x1 - strh r1, [r5, 0x30] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x30 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0811032E - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_0811032E: - movs r0, 0xE0 - lsls r0, 2 - adds r2, r0, 0 - ldrh r1, [r5, 0x34] - adds r2, r1 - lsls r1, r2, 16 - asrs r1, 24 - ldrh r0, [r5, 0x26] - subs r0, r1 - strh r0, [r5, 0x26] - movs r0, 0xFF - ands r2, r0 - strh r2, [r5, 0x34] - b _08110360 -_0811034A: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r5, 0 - bl move_anim_8072740 -_08110360: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8110240 - - thumb_func_start sub_8110368 -sub_8110368: @ 8110368 - push {r4-r6,lr} - adds r6, r0, 0 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _08110394 - adds r0, r6, 0 - movs r1, 0x2 - bl StartObjectRotScalAnim - ldr r0, =0x0203841e - ldrh r1, [r0, 0x4] - negs r1, r1 - strh r1, [r0, 0x4] - ldrh r1, [r0] - negs r1, r1 - strh r1, [r0] - b _081103C4 - .pool -_08110394: - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _081103C4 - adds r0, r6, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - ldr r1, =0x0203841e - ldrh r0, [r1, 0x2] - negs r0, r0 - strh r0, [r1, 0x2] - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] - ldrh r0, [r1, 0x6] - negs r0, r0 - strh r0, [r1, 0x6] - ldrh r0, [r1] - negs r0, r0 - strh r0, [r1] -_081103C4: - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A60AC - lsls r0, 24 - ldr r4, =0x0203841e - lsrs r0, 24 - ldrh r1, [r4] - adds r0, r1 - strh r0, [r6, 0x20] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A60AC - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x2] - adds r0, r1 - strh r0, [r6, 0x22] - ldrh r0, [r4, 0x8] - strh r0, [r6, 0x2E] - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x4] - adds r0, r1 - strh r0, [r6, 0x32] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r4, [r4, 0x6] - adds r0, r4 - strh r0, [r6, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r6, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r6, 0 - bl oamt_set_x3A_32 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8110368 - - thumb_func_start sub_8110438 -sub_8110438: @ 8110438 - push {r4-r6,lr} - adds r6, r0, 0 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0811045C - ldr r1, =0x0203841e - ldrh r0, [r1] - negs r0, r0 - strh r0, [r1] - adds r0, r6, 0 - movs r1, 0x2 - bl StartObjectRotScalAnim - b _08110478 - .pool -_0811045C: - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08110478 - ldr r0, =0x0203841e - ldrh r1, [r0, 0x2] - negs r1, r1 - strh r1, [r0, 0x2] - ldrh r1, [r0] - negs r1, r1 - strh r1, [r0] -_08110478: - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A60AC - lsls r0, 24 - ldr r4, =0x0203841e - lsrs r0, 24 - ldrh r1, [r4] - adds r0, r1 - strh r0, [r6, 0x20] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A60AC - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x2] - adds r0, r1 - strh r0, [r6, 0x22] - ldrh r0, [r4, 0x4] - strh r0, [r6, 0x2E] - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x32] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r6, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r6, 0 - bl oamt_set_x3A_32 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8110438 - - thumb_func_start sub_81104E4 -sub_81104E4: @ 81104E4 - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _08110500 - ldr r0, =0x0203841e - movs r2, 0x4 - ldrsh r1, [r0, r2] - lsrs r2, r1, 31 - adds r1, r2 - asrs r1, 1 - strh r1, [r0, 0x4] -_08110500: - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - strh r0, [r5, 0x2E] - ldrh r0, [r5, 0x20] - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x22] - strh r0, [r5, 0x34] - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _08110548 - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x32] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x36] - b _0811055A - .pool -_08110548: - ldr r0, =0x02038437 - ldrb r0, [r0] - adds r2, r5, 0 - adds r2, 0x32 - adds r3, r5, 0 - adds r3, 0x36 - movs r1, 0x1 - bl sub_80A8924 -_0811055A: - adds r0, r5, 0 - bl sub_80A6FD4 - ldr r0, =0x0203841e - ldrh r0, [r0, 0x6] - strh r0, [r5, 0x38] - ldr r0, =sub_811057C - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81104E4 - - thumb_func_start sub_811057C -sub_811057C: @ 811057C - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - beq _08110592 - adds r0, r4, 0 - bl move_anim_8072740 - b _081105AE -_08110592: - movs r1, 0x3A - ldrsh r0, [r4, r1] - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl sine - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x3A] - adds r0, 0xD - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x3A] -_081105AE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_811057C - - thumb_func_start sub_81105B4 -sub_81105B4: @ 81105B4 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02038437 - ldrb r0, [r0] - adds r2, r4, 0 - adds r2, 0x20 - adds r3, r4, 0 - adds r3, 0x22 - movs r1, 0 - bl sub_80A8924 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _081105F0 - ldr r0, =0x0203841e - ldrh r1, [r4, 0x20] - ldrh r2, [r0] - subs r1, r2 - strh r1, [r4, 0x20] - b _081105FC - .pool -_081105F0: - ldr r1, =0x0203841e - ldrh r0, [r1] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - adds r0, r1, 0 -_081105FC: - ldrh r0, [r0, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08110618 - ldrh r0, [r4, 0x22] - adds r0, 0x8 - strh r0, [r4, 0x22] -_08110618: - ldr r0, =sub_8110630 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81105B4 - - thumb_func_start sub_8110630 -sub_8110630: @ 8110630 - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bne _08110664 - movs r0, 0 - strh r0, [r3, 0x2E] - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - 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 - mov r1, r12 - strb r0, [r1] -_08110664: - ldrh r0, [r3, 0x30] - adds r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x33 - bne _08110678 - adds r0, r3, 0 - bl move_anim_8072740 -_08110678: - pop {r0} - bx r0 - thumb_func_end sub_8110630 - - thumb_func_start sub_811067C -sub_811067C: @ 811067C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0x10 - bl SetGpuReg - movs r0, 0x10 - strh r0, [r4, 0x2E] - ldr r0, =sub_81106A4 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811067C - - thumb_func_start sub_81106A4 -sub_81106A4: @ 81106A4 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x32] - movs r2, 0x32 - ldrsh r0, [r4, r2] - cmp r0, 0x13 - bgt _081106B8 - adds r0, r1, 0x1 - strh r0, [r4, 0x32] - b _081106F6 -_081106B8: - ldrh r1, [r4, 0x30] - adds r0, r1, 0x1 - strh r0, [r4, 0x30] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081106F6 - ldrh r1, [r4, 0x2E] - subs r1, 0x1 - strh r1, [r4, 0x2E] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081106F6 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_8110700 - str r0, [r4, 0x1C] -_081106F6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81106A4 - - thumb_func_start sub_8110700 -sub_8110700: @ 8110700 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl move_anim_8072740 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8110700 - - thumb_func_start sub_8110720 -sub_8110720: @ 8110720 - push {r4-r7,lr} - sub sp, 0x4 - adds r7, r0, 0 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _08110740 - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] - b _08110762 - .pool -_08110740: - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08110762 - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] - ldrh r0, [r1, 0x2] - negs r0, r0 - strh r0, [r1, 0x2] - ldrh r0, [r1, 0x6] - negs r0, r0 - strh r0, [r1, 0x6] -_08110762: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _081107B2 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - adds r4, r0, 0 - ldr r5, =0x02038437 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _081107B2 - ldrb r0, [r5] - bl battle_get_per_side_status - lsls r0, 24 - cmp r0, 0 - beq _081107A0 - ldrb r0, [r5] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081107B2 -_081107A0: - ldr r0, =0x0203841e - movs r2, 0x4 - ldrsh r1, [r0, r2] - negs r1, r1 - strh r1, [r0, 0x4] - movs r2, 0 - ldrsh r1, [r0, r2] - negs r1, r1 - strh r1, [r0] -_081107B2: - adds r0, r7, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - adds r4, r0, 0 - lsls r4, 24 - ldr r6, =0x0203841e - lsrs r4, 24 - ldrh r0, [r6, 0x4] - adds r4, r0 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldrh r2, [r6, 0x6] - adds r1, r2 - lsls r1, 16 - ldrh r2, [r7, 0x20] - lsls r0, r4, 16 - asrs r0, 16 - subs r0, r2 - lsls r0, 16 - asrs r0, 16 - ldrh r2, [r7, 0x22] - lsrs r5, r1, 16 - asrs r1, 16 - subs r1, r2 - lsls r1, 16 - asrs r1, 16 - bl sub_80A74F4 - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 24 - adds r0, r1 - lsrs r0, 16 - movs r3, 0x80 - lsls r3, 1 - str r0, [sp] - adds r0, r7, 0 - movs r1, 0 - adds r2, r3, 0 - bl sub_80A73E0 - ldrh r0, [r6, 0x8] - strh r0, [r7, 0x2E] - strh r4, [r7, 0x32] - strh r5, [r7, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r7, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r7, 0 - bl oamt_set_x3A_32 - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8110720 - - thumb_func_start sub_8110850 -sub_8110850: @ 8110850 - push {r4-r6,lr} - adds r6, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08110870 - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] -_08110870: - ldr r4, =0x0203841e - ldrh r0, [r4, 0x8] - strh r0, [r6, 0x2E] - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x4] - adds r0, r1 - strh r0, [r6, 0x32] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x6] - adds r0, r1 - strh r0, [r6, 0x36] - ldrh r0, [r4, 0xA] - strh r0, [r6, 0x38] - adds r0, r6, 0 - bl sub_80A68D4 - ldr r0, =sub_81108CC - str r0, [r6, 0x1C] - adds r2, r6, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8110850 - - thumb_func_start sub_81108CC -sub_81108CC: @ 81108CC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - adds r4, r0, 0 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x5 - negs r1, r1 - ands r1, r0 - strb r1, [r2] - adds r0, r4, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _081108F8 - adds r0, r4, 0 - bl move_anim_8072740 - b _08110988 -_081108F8: - movs r0, 0x2E - adds r0, r4 - mov r8, r0 - ldrh r7, [r4, 0x20] - ldrh r5, [r4, 0x24] - ldrh r1, [r4, 0x22] - mov r12, r1 - ldrh r6, [r4, 0x26] - mov r2, r8 - add r1, sp, 0x4 - movs r3, 0x7 -_0811090E: - ldrh r0, [r2] - strh r0, [r1] - adds r2, 0x2 - adds r1, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _0811090E - adds r0, r7, r5 - lsls r0, 16 - lsrs r5, r0, 16 - mov r2, r12 - adds r0, r2, r6 - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r4, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - bne _08110988 - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - lsls r1, r5, 16 - asrs r1, 16 - subs r0, r1 - lsls r0, 16 - asrs r0, 16 - ldrh r1, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r1, r2 - lsls r2, r6, 16 - asrs r2, 16 - subs r1, r2 - lsls r1, 16 - asrs r1, 16 - bl sub_80A74F4 - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 24 - adds r0, r1 - lsrs r0, 16 - movs r3, 0x80 - lsls r3, 1 - str r0, [sp] - adds r0, r4, 0 - movs r1, 0 - adds r2, r3, 0 - bl sub_80A73E0 - add r2, sp, 0x4 - mov r1, r8 - movs r3, 0x7 -_0811097A: - ldrh r0, [r2] - strh r0, [r1] - adds r2, 0x2 - adds r1, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _0811097A -_08110988: - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81108CC - - thumb_func_start sub_8110994 -sub_8110994: @ 8110994 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _081109B0 - ldr r4, =0x02038436 - b _081109B2 - .pool -_081109B0: - ldr r4, =0x02038437 -_081109B2: - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x12 - strh r0, [r5, 0x22] - ldr r1, =move_anim_8074EE0 - adds r0, r5, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A67BC - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8110994 - - thumb_func_start sub_81109F0 -sub_81109F0: @ 81109F0 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =0x0203841e - movs r1, 0x6 - ldrsh r0, [r6, r1] - cmp r0, 0 - beq _08110A10 - ldr r0, =0x02038437 - ldrb r0, [r0] - adds r2, r5, 0 - adds r2, 0x20 - adds r3, r5, 0 - adds r3, 0x22 - movs r1, 0 - bl sub_80A8924 -_08110A10: - ldrh r0, [r6] - ldrh r1, [r5, 0x20] - adds r0, r1 - movs r4, 0 - strh r0, [r5, 0x20] - ldrh r0, [r5, 0x22] - adds r0, 0xE - strh r0, [r5, 0x22] - ldrb r1, [r6, 0x2] - adds r0, r5, 0 - bl StartObjectImageAnim - adds r0, r5, 0 - bl AnimateObject - strh r4, [r5, 0x2E] - strh r4, [r5, 0x30] - movs r0, 0x4 - strh r0, [r5, 0x32] - movs r0, 0x10 - strh r0, [r5, 0x34] - ldr r0, =0x0000ffba - strh r0, [r5, 0x36] - ldrh r0, [r6, 0x4] - strh r0, [r5, 0x38] - ldr r1, =sub_8110A70 - adds r0, r5, 0 - bl oamt_set_x3A_32 - ldr r1, =sub_80A6450 - str r1, [r5, 0x1C] - adds r0, r5, 0 - bl _call_via_r1 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81109F0 - - thumb_func_start sub_8110A70 -sub_8110A70: @ 8110A70 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x38] - ldrh r2, [r4, 0x20] - adds r0, r1, r2 - strh r0, [r4, 0x20] - movs r0, 0xC0 - strh r0, [r4, 0x2E] - strh r1, [r4, 0x30] - movs r0, 0x4 - strh r0, [r4, 0x32] - movs r0, 0x20 - strh r0, [r4, 0x34] - ldr r0, =0x0000ffe8 - strh r0, [r4, 0x36] - ldr r1, =move_anim_8074EE0 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r1, =sub_80A6450 - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8110A70 - - thumb_func_start sub_8110AB4 -sub_8110AB4: @ 8110AB4 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x0203841e - ldrb r1, [r4, 0xA] - bl StartObjectImageAnim - adds r0, r5, 0 - bl AnimateObject - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08110AE4 - ldrh r0, [r5, 0x20] - ldrh r1, [r4] - subs r0, r1 - b _08110AEA - .pool -_08110AE4: - ldrh r0, [r4] - ldrh r1, [r5, 0x20] - adds r0, r1 -_08110AEA: - strh r0, [r5, 0x20] - ldr r3, =0x0203841e - ldrh r2, [r3, 0x2] - ldrh r0, [r5, 0x22] - adds r2, r0 - movs r4, 0 - strh r2, [r5, 0x22] - ldrh r0, [r3, 0x8] - strh r0, [r5, 0x2E] - ldrh r0, [r5, 0x20] - strh r0, [r5, 0x30] - ldrh r1, [r3, 0x4] - adds r0, r1 - strh r0, [r5, 0x32] - strh r2, [r5, 0x34] - ldrh r0, [r3, 0x6] - adds r2, r0 - strh r2, [r5, 0x36] - adds r0, r5, 0 - bl sub_80A6E14 - strh r4, [r5, 0x34] - strh r4, [r5, 0x36] - ldr r0, =sub_80A656C - str r0, [r5, 0x1C] - ldr r1, =move_anim_8074EE0 - adds r0, r5, 0 - bl oamt_set_x3A_32 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8110AB4 - - thumb_func_start sub_8110B38 -sub_8110B38: @ 8110B38 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0203841e - movs r1, 0xC - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08110B54 - adds r0, r4, 0 - movs r1, 0 - bl sub_80A69CC - b _08110B5C - .pool -_08110B54: - adds r0, r4, 0 - movs r1, 0 - bl sub_80A6980 -_08110B5C: - ldr r1, =0x0203841e - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x2E] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x32] - ldrh r0, [r1, 0xA] - strh r0, [r4, 0x34] - ldr r0, =sub_8110B80 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8110B38 - - thumb_func_start sub_8110B80 -sub_8110B80: @ 8110B80 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x36] - adds r0, r1 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 24 - negs r0, r0 - strh r0, [r4, 0x26] - movs r2, 0x38 - ldrsh r0, [r4, r2] - movs r2, 0x34 - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - ldrh r1, [r4, 0x38] - adds r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x38] - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _08110BC6 - adds r0, r4, 0 - bl move_anim_8072740 -_08110BC6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8110B80 - - thumb_func_start sub_8110BCC -sub_8110BCC: @ 8110BCC - push {r4-r6,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl lcd_bg_operations - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _08110C10 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl lcd_bg_operations -_08110C10: - ldr r0, =0x02022e18 - strh r5, [r0] - ldr r4, =0x02022e1a - strh r5, [r4] - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x16 - bl SetGpuReg - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08D8D58C - mov r2, sp - ldrh r2, [r2, 0xA] - bl sub_80A6CC0 - ldr r1, =gUnknown_08D8D410 - mov r0, sp - movs r2, 0 - bl sub_80A6D60 - ldr r0, =gUnknown_08D8DAB8 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - movs r2, 0x20 - bl decompress_palette - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08110C6E - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08110C6E - movs r5, 0x1 -_08110C6E: - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - strh r5, [r1, 0x8] - ldr r0, =sub_8110CB0 - str r0, [r1] - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8110BCC - - thumb_func_start sub_8110CB0 -sub_8110CB0: @ 8110CB0 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r2, r1, 0 - cmp r0, 0 - bne _08110CE4 - ldr r1, =0x02022e18 - ldr r3, =0x0000fffa - adds r0, r3, 0 - ldrh r3, [r1] - adds r0, r3 - b _08110CEA - .pool -_08110CE4: - ldr r1, =0x02022e18 - ldrh r0, [r1] - adds r0, 0x6 -_08110CEA: - strh r0, [r1] - ldr r1, =0x02022e1a - ldr r3, =0x0000ffff - adds r0, r3, 0 - ldrh r3, [r1] - adds r0, r3 - strh r0, [r1] - lsls r1, r5, 2 - adds r0, r1, r5 - lsls r0, 3 - adds r0, r2 - movs r3, 0x20 - ldrsh r0, [r0, r3] - adds r4, r1, 0 - cmp r0, 0x4 - bls _08110D0C - b _08110E3A -_08110D0C: - lsls r0, 2 - ldr r1, =_08110D28 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08110D28: - .4byte _08110D3C - .4byte _08110D7E - .4byte _08110D98 - .4byte _08110DDA - .4byte _08110DFC -_08110D3C: - adds r0, r4, r5 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - movs r5, 0 - strh r0, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _08110E3A - strh r5, [r4, 0x1C] - ldrh r1, [r4, 0x1E] - adds r1, 0x1 - strh r1, [r4, 0x1E] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x1E - ldrsh r0, [r4, r1] - cmp r0, 0x7 - bne _08110E3A - ldrh r0, [r4, 0x20] - adds r0, 0x1 - strh r0, [r4, 0x20] - strh r5, [r4, 0x1E] - b _08110E3A -_08110D7E: - adds r0, r4, r5 - lsls r0, 3 - adds r1, r0, r2 - ldrh r0, [r1, 0x1E] - adds r0, 0x1 - strh r0, [r1, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x65 - bne _08110E3A - movs r0, 0x7 - strh r0, [r1, 0x1E] - b _08110DF0 -_08110D98: - adds r0, r4, r5 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - strh r0, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _08110E3A - movs r0, 0 - strh r0, [r4, 0x1C] - ldrh r1, [r4, 0x1E] - subs r1, 0x1 - strh r1, [r4, 0x1E] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r2, 0x1E - ldrsh r1, [r4, r2] - cmp r1, 0 - bne _08110E3A - ldrh r0, [r4, 0x20] - adds r0, 0x1 - strh r0, [r4, 0x20] - strh r1, [r4, 0x1E] - b _08110E3A -_08110DDA: - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x9] - bl sub_80A6C68 - ldr r0, =0x03005e00 - adds r1, r4, r5 - lsls r1, 3 - adds r1, r0 -_08110DF0: - ldrh r0, [r1, 0x20] - adds r0, 0x1 - strh r0, [r1, 0x20] - b _08110E3A - .pool -_08110DFC: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _08110E10 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0 - bl lcd_bg_operations -_08110E10: - ldr r0, =0x02022e18 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e1a - strh r1, [r0] - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - adds r0, r5, 0 - bl move_anim_task_del -_08110E3A: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8110CB0 - - thumb_func_start sub_8110E4C -sub_8110E4C: @ 8110E4C - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _08110EC8 - ldr r4, =0x0203841e - movs r2, 0x6 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08110E98 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08110E98 - movs r0, 0x98 - lsls r0, 1 - strh r0, [r5, 0x20] - ldrh r0, [r4, 0x2] - negs r0, r0 - strh r0, [r4, 0x2] - movs r0, 0x1 - strh r0, [r5, 0x38] - ldrb r1, [r5, 0x3] - subs r0, 0x40 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r5, 0x3] - b _08110E9C - .pool -_08110E98: - ldr r0, =0x0000ffc0 - strh r0, [r5, 0x20] -_08110E9C: - ldr r4, =0x0203841e - ldrh r0, [r4] - strh r0, [r5, 0x22] - ldr r1, =gUnknown_08596BC0 - adds r0, r5, 0 - bl SetSpriteOamTables_NoPriorityFromTable - ldrh r0, [r4, 0x2] - strh r0, [r5, 0x30] - ldrh r0, [r4, 0x4] - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - b _08110F24 - .pool -_08110EC8: - ldrh r1, [r5, 0x30] - ldrh r3, [r5, 0x34] - adds r1, r3 - ldrh r2, [r5, 0x32] - ldrh r0, [r5, 0x36] - adds r2, r0 - lsls r0, r1, 16 - asrs r0, 24 - ldrh r3, [r5, 0x24] - adds r0, r3 - strh r0, [r5, 0x24] - lsls r0, r2, 16 - asrs r0, 24 - ldrh r3, [r5, 0x26] - adds r0, r3 - strh r0, [r5, 0x26] - movs r0, 0xFF - ands r1, r0 - strh r1, [r5, 0x34] - ands r2, r0 - strh r2, [r5, 0x36] - movs r1, 0x38 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _08110F0E - movs r2, 0x20 - ldrsh r0, [r5, r2] - movs r3, 0x24 - ldrsh r1, [r5, r3] - adds r0, r1 - movs r1, 0x88 - lsls r1, 1 - cmp r0, r1 - ble _08110F24 - b _08110F20 -_08110F0E: - movs r1, 0x20 - ldrsh r0, [r5, r1] - movs r2, 0x24 - ldrsh r1, [r5, r2] - adds r0, r1 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - bge _08110F24 -_08110F20: - ldr r0, =move_anim_8072740 - str r0, [r5, 0x1C] -_08110F24: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8110E4C - - thumb_func_start sub_8110F30 -sub_8110F30: @ 8110F30 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x0203841e - ldrb r1, [r5, 0x8] - bl StartObjectImageAnim - adds r0, r4, 0 - movs r1, 0 - bl sub_80A69CC - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x32] - ldrh r0, [r5, 0x4] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r4, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8110F30 - - thumb_func_start sub_8110F74 -sub_8110F74: @ 8110F74 - 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 - ldr r0, =0x03005e00 - adds r6, r1, r0 - ldr r5, =0x02038436 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldrb r0, [r5] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 8 - movs r1, 0xC0 - lsls r1, 13 - adds r0, r1 - lsrs r7, r0, 16 - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 8 - movs r2, 0xC0 - lsls r2, 13 - adds r0, r2 - lsrs r0, 16 - mov r8, r0 - ldrb r1, [r5] - movs r0, 0x2 - eors r0, r1 - ldrb r4, [r4] - cmp r0, r4 - bne _08110FE4 - mov r8, r7 -_08110FE4: - bl sub_811135C - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bne _08111000 - movs r0, 0x20 - b _08111006 - .pool -_08111000: - lsls r1, r5, 3 - movs r0, 0x30 - subs r0, r1 -_08111006: - strh r0, [r6, 0x18] - movs r4, 0 - strh r4, [r6, 0x8] - strh r4, [r6, 0x1E] - strh r4, [r6, 0x1A] - movs r0, 0x1 - strh r0, [r6, 0x20] - movs r1, 0x18 - ldrsh r0, [r6, r1] - cmp r0, 0 - bge _0811101E - adds r0, 0x7 -_0811101E: - asrs r0, 3 - subs r0, 0x1 - strh r0, [r6, 0x1C] - mov r2, r9 - lsls r0, r2, 3 - strh r0, [r6, 0xC] - lsls r0, r7, 3 - strh r0, [r6, 0xE] - mov r1, r10 - subs r0, r1, r2 - lsls r0, 3 - movs r2, 0x18 - ldrsh r1, [r6, r2] - bl __divsi3 - strh r0, [r6, 0x10] - mov r1, r8 - subs r0, r1, r7 - lsls r0, 3 - movs r2, 0x18 - ldrsh r1, [r6, r2] - bl __divsi3 - strh r0, [r6, 0x12] - strh r4, [r6, 0x14] - strh r4, [r6, 0x16] - movs r0, 0x40 - negs r0, r0 - bl sub_80A5178 - adds r4, r0, 0 - lsls r4, 24 - asrs r4, 8 - lsrs r4, 16 - movs r0, 0x3F - bl sub_80A5178 - lsls r0, 24 - strh r4, [r6, 0x22] - asrs r0, 24 - lsls r4, 16 - asrs r4, 16 - subs r0, r4 - movs r2, 0x18 - ldrsh r1, [r6, r2] - bl __divsi3 - strh r0, [r6, 0x24] - strh r5, [r6, 0xA] - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x26] - ldr r0, =sub_81110A4 - 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_8110F74 - - thumb_func_start sub_81110A4 -sub_81110A4: @ 81110A4 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bls _081110BE - b _0811120C -_081110BE: - lsls r0, 2 - ldr r1, =_081110D0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081110D0: - .4byte _081110E4 - .4byte _08111148 - .4byte _08111150 - .4byte _081111AC - .4byte _081111FE -_081110E4: - ldrh r2, [r4, 0x14] - ldrh r0, [r4, 0x10] - subs r2, r0 - strh r2, [r4, 0x14] - ldrh r0, [r4, 0x16] - ldrh r1, [r4, 0x12] - subs r0, r1 - strh r0, [r4, 0x16] - ldr r3, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - lsls r2, 16 - asrs r2, 19 - strh r2, [r0, 0x24] - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r4, 0x16] - lsls r0, 16 - asrs r0, 19 - strh r0, [r1, 0x26] - ldrh r0, [r4, 0x1A] - adds r0, 0x1 - strh r0, [r4, 0x1A] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bne _08111134 - movs r0, 0x14 - strh r0, [r4, 0x1E] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_08111134: - ldrh r1, [r4, 0x22] - lsls r1, 24 - asrs r1, 24 - movs r0, 0xA2 - bl audio_play_and_stuff - b _0811120C - .pool -_08111148: - ldrh r0, [r4, 0x1E] - subs r0, 0x1 - strh r0, [r4, 0x1E] - b _081111F0 -_08111150: - ldrh r0, [r4, 0x1A] - subs r0, 0x1 - strh r0, [r4, 0x1A] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - beq _08111170 - ldrh r0, [r4, 0x10] - ldrh r2, [r4, 0x14] - adds r0, r2 - strh r0, [r4, 0x14] - ldrh r0, [r4, 0x12] - ldrh r1, [r4, 0x16] - adds r0, r1 - strh r0, [r4, 0x16] - b _0811117A -_08111170: - strh r0, [r4, 0x14] - strh r0, [r4, 0x16] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0811117A: - ldr r2, =0x02020630 - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r4, 0x14] - lsls r0, 16 - asrs r0, 19 - strh r0, [r1, 0x24] - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r4, 0x16] - lsls r0, 16 - asrs r0, 19 - strh r0, [r1, 0x26] - b _0811120C - .pool -_081111AC: - ldrh r0, [r4, 0x10] - ldrh r2, [r4, 0xC] - adds r0, r2 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x12] - ldrh r1, [r4, 0xE] - adds r0, r1 - strh r0, [r4, 0xE] - ldrh r0, [r4, 0x1A] - adds r0, 0x1 - strh r0, [r4, 0x1A] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x1C - ldrsh r1, [r4, r2] - cmp r0, r1 - blt _081111EA - movs r0, 0 - strh r0, [r4, 0x1A] - adds r0, r4, 0 - bl sub_8111214 - ldrh r1, [r4, 0x24] - ldrh r0, [r4, 0x22] - adds r1, r0 - strh r1, [r4, 0x22] - lsls r1, 24 - asrs r1, 24 - movs r0, 0xAF - bl audio_play_and_stuff -_081111EA: - ldrh r0, [r4, 0x18] - subs r0, 0x1 - strh r0, [r4, 0x18] -_081111F0: - lsls r0, 16 - cmp r0, 0 - bne _0811120C - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0811120C -_081111FE: - movs r1, 0x1E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0811120C - adds r0, r2, 0 - bl move_anim_task_del -_0811120C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81110A4 - - thumb_func_start sub_8111214 -sub_8111214: @ 8111214 - push {r4-r7,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0xA] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bhi _08111304 - lsls r0, 2 - ldr r1, =_08111234 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08111234: - .4byte _08111248 - .4byte _08111254 - .4byte _08111254 - .4byte _08111260 - .4byte _0811126C -_08111248: - ldr r3, =gUnknown_08596C28 - movs r5, 0 - b _08111270 - .pool -_08111254: - ldr r3, =gUnknown_08596C40 - movs r5, 0x50 - b _08111270 - .pool -_08111260: - ldr r3, =gUnknown_08596C40 - movs r5, 0x40 - b _08111270 - .pool -_0811126C: - ldr r3, =gUnknown_08596C40 - movs r5, 0x30 -_08111270: - ldrh r1, [r4, 0xC] - lsls r1, 16 - asrs r1, 19 - lsls r1, 16 - lsrs r1, 16 - ldrh r2, [r4, 0xE] - lsls r2, 16 - asrs r2, 19 - lsls r2, 16 - movs r6, 0x20 - ldrsh r0, [r4, r6] - lsls r0, 2 - adds r1, r0 - lsls r1, 16 - lsrs r6, r1, 16 - asrs r1, 16 - lsrs r7, r2, 16 - asrs r2, 16 - adds r0, r3, 0 - movs r3, 0x23 - bl AddObjectToFront - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - beq _081112FC - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0x12 - strh r1, [r0, 0x2E] - movs r2, 0x20 - ldrsh r1, [r4, r2] - lsls r2, r1, 2 - adds r2, r1 - lsls r2, 2 - adds r2, r6, r2 - movs r6, 0xA - ldrsh r3, [r4, r6] - lsls r1, r3, 1 - adds r1, r3 - adds r2, r1 - strh r2, [r0, 0x32] - strh r7, [r0, 0x36] - movs r1, 0xA - ldrsh r2, [r4, r1] - lsls r2, 1 - movs r3, 0x10 - negs r3, r3 - adds r1, r3, 0 - subs r1, r2 - strh r1, [r0, 0x38] - ldrh r3, [r0, 0x4] - lsls r2, r3, 22 - lsrs r2, 22 - adds r2, r5 - ldr r5, =0x000003ff - adds r1, r5, 0 - ands r2, r1 - ldr r1, =0xfffffc00 - ands r1, r3 - orrs r1, r2 - strh r1, [r0, 0x4] - bl sub_80A68D4 - ldrh r0, [r4, 0x1E] - adds r0, 0x1 - strh r0, [r4, 0x1E] -_081112FC: - movs r6, 0x20 - ldrsh r0, [r4, r6] - negs r0, r0 - strh r0, [r4, 0x20] -_08111304: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8111214 - - thumb_func_start sub_811131C -sub_811131C: @ 811131C - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _0811134E - ldr r0, =sub_81110A4 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _08111348 - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x1E] - subs r0, 0x1 - strh r0, [r1, 0x1E] -_08111348: - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0811134E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811131C - - thumb_func_start sub_811135C -sub_811135C: @ 811135C - push {lr} - ldr r0, =0x02038400 - ldr r0, [r0] - ldrb r1, [r0, 0x11] - lsrs r0, r1, 4 - lsls r1, 28 - lsrs r1, 28 - subs r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xFF - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0x4 - bls _0811137E - movs r1, 0x1 -_0811137E: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_811135C - - thumb_func_start sub_8111388 -sub_8111388: @ 8111388 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x0203841e - ldrb r1, [r5, 0x8] - bl StartObjectImageAnim - ldrh r0, [r5] - strh r0, [r4, 0x24] - ldrh r0, [r5, 0x2] - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x34] - ldrh r1, [r5, 0x4] - subs r0, r1 - strh r0, [r4, 0x34] - movs r0, 0x3 - strh r0, [r4, 0x2E] - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x30] - ldr r0, =sub_81113C8 - str r0, [r4, 0x1C] - adds r4, 0x3E - ldrb r0, [r4] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8111388 - - thumb_func_start sub_81113C8 -sub_81113C8: @ 81113C8 - push {lr} - adds r2, r0, 0 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x5 - negs r1, r1 - ands r1, r0 - strb r1, [r3] - ldrh r1, [r2, 0x34] - movs r3, 0x34 - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _08111400 - ldrh r3, [r2, 0x32] - adds r0, r1, r3 - strh r0, [r2, 0x26] - ldrh r0, [r2, 0x2E] - adds r1, r0 - strh r1, [r2, 0x34] - adds r0, 0x1 - strh r0, [r2, 0x2E] - lsls r1, 16 - cmp r1, 0 - ble _08111412 - movs r0, 0 - strh r0, [r2, 0x34] - b _08111412 -_08111400: - ldrh r0, [r2, 0x30] - subs r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - cmp r0, 0 - bne _08111412 - adds r0, r2, 0 - bl move_anim_8072740 -_08111412: - pop {r0} - bx r0 - thumb_func_end sub_81113C8 - - thumb_func_start sub_8111418 -sub_8111418: @ 8111418 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08111434 - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim -_08111434: - adds r0, r4, 0 - bl sub_80A7820 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8111418 - - thumb_func_start sub_8111444 -sub_8111444: @ 8111444 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x20] - ldrb r0, [r5] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x0203841e - ldrh r3, [r2] - ldrh r5, [r4, 0x20] - adds r1, r3, r5 - strh r1, [r4, 0x20] - ldrh r1, [r2, 0x2] - adds r0, r1 - strh r0, [r4, 0x22] - strh r3, [r4, 0x30] - strh r1, [r4, 0x32] - ldrh r0, [r2, 0x4] - strh r0, [r4, 0x38] - ldrb r1, [r2, 0x6] - adds r0, r4, 0 - bl StartObjectImageAnim - ldr r0, =sub_811149C - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8111444 - - thumb_func_start sub_811149C -sub_811149C: @ 811149C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x8 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x34] - adds r0, r1 - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x32] - ldrh r2, [r4, 0x36] - adds r0, r2 - strh r0, [r4, 0x36] - movs r1, 0x34 - ldrsh r0, [r4, r1] - movs r1, 0x28 - bl __divsi3 - ldrh r1, [r4, 0x24] - adds r1, r0 - strh r1, [r4, 0x24] - movs r2, 0x2E - ldrsh r0, [r4, r2] - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl sine - ldrh r1, [r4, 0x26] - subs r1, r0 - strh r1, [r4, 0x26] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x8C - ble _081114E6 - adds r0, r4, 0 - bl move_anim_8072740 -_081114E6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_811149C - - thumb_func_start sub_81114EC -sub_81114EC: @ 81114EC - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =0x02038404 - ldr r0, [r2] - cmp r0, 0x20 - bgt _08111500 - ldr r1, =0x0203841e - movs r0, 0 - strh r0, [r1, 0xE] -_08111500: - ldr r2, [r2] - adds r0, r2, 0 - subs r0, 0x21 - cmp r0, 0x20 - bhi _08111510 - ldr r1, =0x0203841e - movs r0, 0x1 - strh r0, [r1, 0xE] -_08111510: - cmp r2, 0x41 - ble _0811151A - ldr r1, =0x0203841e - movs r0, 0x2 - strh r0, [r1, 0xE] -_0811151A: - adds r0, r3, 0 - bl move_anim_task_del - pop {r0} - bx r0 - .pool - thumb_func_end sub_81114EC - - thumb_func_start sub_811152C -sub_811152C: @ 811152C - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0811154E - movs r0, 0 - bl sub_80A6DAC - movs r0, 0xC8 - strh r0, [r5, 0xA] -_0811154E: - ldr r4, =0x02022e22 - movs r1, 0xA - ldrsh r0, [r5, r1] - movs r1, 0xA - bl __divsi3 - ldrh r1, [r4] - adds r1, r0 - strh r1, [r4] - ldrh r0, [r5, 0xA] - subs r0, 0x3 - strh r0, [r5, 0xA] - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x78 - bne _0811157A - movs r0, 0x1 - bl sub_80A6DAC - adds r0, r6, 0 - bl move_anim_task_del -_0811157A: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811152C - - thumb_func_start sub_8111590 -sub_8111590: @ 8111590 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081115BC - movs r0, 0 - bl sub_80A6DAC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - ldr r0, =0x02022e22 - ldrh r0, [r0] - strh r0, [r4, 0xC] -_081115BC: - ldrh r0, [r4, 0xA] - adds r0, 0x50 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0xA] - ldr r6, =0x02022e22 - movs r2, 0xA - ldrsh r1, [r4, r2] - movs r0, 0x4 - bl cosine - ldrh r4, [r4, 0xC] - adds r0, r4 - strh r0, [r6] - ldr r0, =0x0203841e - movs r2, 0xE - ldrsh r1, [r0, r2] - ldr r0, =0x00000fff - cmp r1, r0 - bne _081115F4 - movs r0, 0 - strh r0, [r6] - movs r0, 0x1 - bl sub_80A6DAC - adds r0, r5, 0 - bl move_anim_task_del -_081115F4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8111590 - - thumb_func_start sub_811160C -sub_811160C: @ 811160C - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r0, =0x0203841e - ldrh r0, [r0, 0x4] - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x30] - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x34] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x36] - adds r0, r4, 0 - bl sub_80A6FD4 - ldr r0, =sub_8111674 - str r0, [r4, 0x1C] - movs r0, 0x10 - strh r0, [r4, 0x3A] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldrh r1, [r4, 0x3A] - movs r0, 0x52 - bl SetGpuReg - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811160C - - thumb_func_start sub_8111674 -sub_8111674: @ 8111674 - push {r4,lr} - adds r4, r0, 0 - bl sub_8111764 - adds r0, r4, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - beq _08111694 - ldr r0, =sub_81116E8 - str r0, [r4, 0x1C] - b _081116DE - .pool -_08111694: - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r1, 0xA - bl sine - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r1, 0xF - bl cosine - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r2, [r4, 0x38] - adds r0, r2, 0x5 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x38] - ldrh r0, [r4, 0x38] - lsls r2, 16 - asrs r2, 16 - cmp r2, 0 - beq _081116CC - cmp r2, 0xC4 - ble _081116DE -_081116CC: - lsls r0, 16 - cmp r0, 0 - ble _081116DE - ldr r0, =0x02038440 - movs r1, 0 - ldrsb r1, [r0, r1] - movs r0, 0xC4 - bl audio_play_and_stuff -_081116DE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8111674 - - thumb_func_start sub_81116E8 -sub_81116E8: @ 81116E8 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x1 - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl sub_80A6F3C - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r1, 0xA - bl sine - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r1, 0xF - bl cosine - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r2, [r4, 0x38] - adds r0, r2, 0x5 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x38] - ldrh r0, [r4, 0x38] - lsls r2, 16 - asrs r2, 16 - cmp r2, 0 - beq _0811172E - cmp r2, 0xC4 - ble _0811173A -_0811172E: - lsls r0, 16 - cmp r0, 0 - ble _0811173A - movs r0, 0xC4 - bl audio_play -_0811173A: - movs r1, 0x3A - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08111758 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_80A67F4 - str r0, [r4, 0x1C] - b _0811175E - .pool -_08111758: - adds r0, r4, 0 - bl sub_8111764 -_0811175E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81116E8 - - thumb_func_start sub_8111764 -sub_8111764: @ 8111764 - push {r4,lr} - adds r4, r0, 0 - ldrh r2, [r4, 0x3A] - movs r1, 0x3A - ldrsh r0, [r4, r1] - cmp r0, 0xFF - ble _08111788 - adds r0, r2, 0x1 - strh r0, [r4, 0x3A] - lsls r0, 16 - ldr r1, =0x010d0000 - cmp r0, r1 - bne _081117EE - movs r0, 0 - b _081117EC - .pool -_08111788: - ldrh r1, [r4, 0x3C] - adds r3, r1, 0x1 - strh r3, [r4, 0x3C] - movs r0, 0xFF - ands r0, r1 - cmp r0, 0 - bne _081117EE - ldr r1, =0xffffff00 - ands r1, r3 - strh r1, [r4, 0x3C] - movs r0, 0x80 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - beq _081117B0 - adds r0, r2, 0x1 - b _081117B2 - .pool -_081117B0: - subs r0, r2, 0x1 -_081117B2: - strh r0, [r4, 0x3A] - ldrh r0, [r4, 0x3A] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r2, 0x3A - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _081117D4 - cmp r0, 0x10 - bne _081117E0 -_081117D4: - ldrh r0, [r4, 0x3C] - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - eors r0, r1 - strh r0, [r4, 0x3C] -_081117E0: - movs r1, 0x3A - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081117EE - movs r0, 0x80 - lsls r0, 1 -_081117EC: - strh r0, [r4, 0x3A] -_081117EE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8111764 - - thumb_func_start sub_81117F4 -sub_81117F4: @ 81117F4 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A6980 - ldr r1, =sub_8111814 - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81117F4 - - thumb_func_start sub_8111814 -sub_8111814: @ 8111814 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r1, 0x20 - bl sine - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r1, 0x8 - bl cosine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x2E] - subs r0, 0x41 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x82 - bhi _08111848 - ldrb r0, [r4, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r0 - movs r0, 0x8 - b _08111852 -_08111848: - ldrb r0, [r4, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r0 - movs r0, 0x4 -_08111852: - orrs r1, r0 - strb r1, [r4, 0x5] - ldrh r0, [r4, 0x2E] - adds r0, 0x13 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x32] - adds r0, 0x50 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3D - bne _08111884 - adds r0, r4, 0 - bl move_anim_8072740 -_08111884: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8111814 - - thumb_func_start sub_811188C -sub_811188C: @ 811188C - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0 - bl obj_id_for_side_relative_to_move - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80A7270 - adds r0, r4, 0 - movs r1, 0x80 - movs r2, 0x80 - movs r3, 0 - bl obj_id_set_rotscale - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - movs r1, 0x80 - strh r1, [r0, 0x8] - ldr r1, =0x0203841e - ldrh r1, [r1] - strh r1, [r0, 0xA] - strh r2, [r0, 0xC] - movs r1, 0x10 - strh r1, [r0, 0xE] - ldr r1, =sub_8111914 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811188C - - thumb_func_start sub_8111914 -sub_8111914: @ 8111914 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - strh r0, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bne _0811195C - movs r0, 0 - strh r0, [r4, 0x1C] - ldrh r1, [r4, 0xC] - adds r1, 0x1 - strh r1, [r4, 0xC] - ldrh r0, [r4, 0xE] - subs r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0x9 - bne _0811195C - ldr r0, =sub_811196C - str r0, [r4] -_0811195C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8111914 - - thumb_func_start sub_811196C -sub_811196C: @ 811196C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r1, [r4, 0xA] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _08111994 - subs r0, r1, 0x1 - strh r0, [r4, 0xA] - b _081119D8 - .pool -_08111994: - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r1, r0, 24 - ldrh r0, [r4, 0x8] - adds r0, 0x8 - strh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xFF - bgt _081119BC - movs r0, 0x8 - ldrsh r2, [r4, r0] - adds r0, r1, 0 - adds r1, r2, 0 - movs r3, 0 - bl obj_id_set_rotscale - b _081119D8 -_081119BC: - adds r0, r1, 0 - bl sub_80A7344 - adds r0, r5, 0 - bl move_anim_task_del - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg -_081119D8: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_811196C - - thumb_func_start sub_81119E0 -sub_81119E0: @ 81119E0 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r4, r0, 0 - ldrh r5, [r4, 0x20] - ldrh r6, [r4, 0x22] - ldr r0, =0x02038436 - mov r8, r0 - ldrb r0, [r0] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - mov r9, r1 - strh r0, [r4, 0x20] - mov r1, r8 - ldrb r0, [r1] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - mov r1, r9 - strh r1, [r4, 0x2E] - ldr r2, =0x0203841e - ldrh r1, [r2] - strh r1, [r4, 0x30] - ldrh r1, [r2, 0x2] - strh r1, [r4, 0x32] - ldrh r1, [r2, 0x4] - strh r1, [r4, 0x34] - ldrh r1, [r4, 0x20] - lsls r1, 4 - strh r1, [r4, 0x36] - lsls r0, 4 - strh r0, [r4, 0x38] - lsls r5, 16 - asrs r5, 16 - movs r1, 0x20 - ldrsh r0, [r4, r1] - subs r5, r0 - lsls r5, 4 - movs r0, 0 - ldrsh r1, [r2, r0] - lsls r1, 1 - adds r0, r5, 0 - str r2, [sp] - bl __divsi3 - strh r0, [r4, 0x3A] - lsls r6, 16 - asrs r6, 16 - movs r1, 0x22 - ldrsh r0, [r4, r1] - subs r6, r0 - lsls r6, 4 - ldr r2, [sp] - movs r0, 0 - ldrsh r1, [r2, r0] - lsls r1, 1 - adds r0, r6, 0 - bl __divsi3 - strh r0, [r4, 0x3C] - ldr r0, =sub_8111A88 - str r0, [r4, 0x1C] - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81119E0 - - thumb_func_start sub_8111A88 -sub_8111A88: @ 8111A88 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _08111AD2 - cmp r0, 0x1 - bgt _08111A9E - cmp r0, 0 - beq _08111AA8 - b _08111B96 -_08111A9E: - cmp r0, 0x2 - beq _08111B3C - cmp r0, 0x3 - beq _08111B90 - b _08111B96 -_08111AA8: - ldrh r0, [r5, 0x3A] - ldrh r2, [r5, 0x36] - adds r0, r2 - strh r0, [r5, 0x36] - ldrh r1, [r5, 0x3C] - ldrh r2, [r5, 0x38] - adds r1, r2 - strh r1, [r5, 0x38] - lsls r0, 16 - asrs r0, 20 - strh r0, [r5, 0x20] - lsls r1, 16 - asrs r1, 20 - strh r1, [r5, 0x22] - ldrh r0, [r5, 0x30] - subs r0, 0x1 - strh r0, [r5, 0x30] - lsls r0, 16 - cmp r0, 0 - bgt _08111B96 - b _08111B82 -_08111AD2: - ldrh r0, [r5, 0x32] - subs r0, 0x1 - strh r0, [r5, 0x32] - lsls r0, 16 - cmp r0, 0 - bgt _08111B96 - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x30] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x20] - lsls r0, 4 - strh r0, [r5, 0x36] - ldrh r0, [r5, 0x22] - lsls r0, 4 - strh r0, [r5, 0x38] - movs r1, 0x30 - ldrsh r0, [r5, r1] - movs r2, 0x20 - ldrsh r1, [r5, r2] - subs r0, r1 - lsls r0, 4 - movs r2, 0x34 - ldrsh r1, [r5, r2] - bl __divsi3 - strh r0, [r5, 0x3A] - movs r1, 0x32 - ldrsh r0, [r5, r1] - movs r2, 0x22 - ldrsh r1, [r5, r2] - subs r0, r1 - lsls r0, 4 - movs r2, 0x34 - ldrsh r1, [r5, r2] - bl __divsi3 - strh r0, [r5, 0x3C] - b _08111B82 - .pool -_08111B3C: - ldrh r0, [r5, 0x3A] - ldrh r1, [r5, 0x36] - adds r0, r1 - strh r0, [r5, 0x36] - ldrh r1, [r5, 0x3C] - ldrh r2, [r5, 0x38] - adds r1, r2 - strh r1, [r5, 0x38] - lsls r0, 16 - asrs r0, 20 - strh r0, [r5, 0x20] - lsls r1, 16 - asrs r1, 20 - strh r1, [r5, 0x22] - ldrh r0, [r5, 0x34] - subs r0, 0x1 - strh r0, [r5, 0x34] - lsls r0, 16 - cmp r0, 0 - bgt _08111B96 - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] -_08111B82: - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - b _08111B96 - .pool -_08111B90: - adds r0, r5, 0 - bl move_anim_8074EE0 -_08111B96: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8111A88 - - thumb_func_start sub_8111B9C -sub_8111B9C: @ 8111B9C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A6980 - ldr r0, =sub_8111BB4 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8111B9C - - thumb_func_start sub_8111BB4 -sub_8111BB4: @ 8111BB4 - push {r4-r6,lr} - adds r3, r0, 0 - movs r5, 0 - movs r6, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08111C4A - adds r1, r3, 0 - adds r1, 0x3E - ldrb r2, [r1] - movs r0, 0x4 - ands r0, r2 - adds r4, r1, 0 - cmp r0, 0 - bne _08111BDE - movs r0, 0x4 - orrs r0, r2 - strb r0, [r4] -_08111BDE: - movs r1, 0x2E - ldrsh r0, [r3, r1] - cmp r0, 0 - beq _08111BEE - cmp r0, 0x1 - beq _08111BF8 - movs r6, 0x1 - b _08111C02 -_08111BEE: - movs r1, 0x30 - ldrsh r0, [r3, r1] - cmp r0, 0x2 - bne _08111C02 - b _08111C06 -_08111BF8: - movs r1, 0x30 - ldrsh r0, [r3, r1] - cmp r0, 0x4 - bne _08111C02 - movs r5, 0x1 -_08111C02: - cmp r5, 0 - beq _08111C38 -_08111C06: - ldrb r2, [r4] - 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, [r4] - ldrh r0, [r3, 0x32] - adds r0, 0x1 - movs r1, 0 - strh r0, [r3, 0x32] - strh r1, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _08111C4A - strh r1, [r3, 0x32] - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - b _08111C4A -_08111C38: - cmp r6, 0 - beq _08111C44 - adds r0, r3, 0 - bl move_anim_8072740 - b _08111C4A -_08111C44: - ldrh r0, [r3, 0x30] - adds r0, 0x1 - strh r0, [r3, 0x30] -_08111C4A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8111BB4 - - thumb_func_start sub_8111C50 -sub_8111C50: @ 8111C50 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r5, r0, r1 - movs r0, 0x1 - bl duplicate_obj_of_side_rel2move_in_transparent_mode - movs r6, 0 - movs r1, 0 - strh r0, [r5, 0x8] - lsls r0, 16 - cmp r0, 0 - bge _08111C80 - adds r0, r4, 0 - bl move_anim_task_del - b _08111D5C - .pool -_08111C80: - strh r1, [r5, 0xA] - movs r0, 0xF - strh r0, [r5, 0xC] - movs r0, 0x2 - strh r0, [r5, 0xE] - strh r1, [r5, 0x10] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldrh r1, [r5, 0xE] - lsls r1, 8 - ldrh r0, [r5, 0xC] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldr r4, =0x02020630 - movs r0, 0x8 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x50 - strh r1, [r0, 0x2E] - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08111CF4 - movs r0, 0x8 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000ff70 - strh r1, [r0, 0x30] - movs r0, 0x8 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x70 - b _08111D12 - .pool -_08111CF4: - movs r0, 0x8 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x90 - strh r1, [r0, 0x30] - movs r0, 0x8 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000ff90 -_08111D12: - strh r1, [r0, 0x32] - ldr r4, =0x02020630 - movs r0, 0x8 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r2, 0 - strh r2, [r0, 0x34] - movs r0, 0x8 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r2, [r0, 0x36] - movs r0, 0x8 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =DummyObjectCallback - bl oamt_set_x3A_32 - movs r0, 0x8 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, 0x1C - adds r0, r4 - ldr r1, =sub_80A656C - str r1, [r0] - ldr r0, =sub_8111D78 - str r0, [r5] -_08111D5C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8111C50 - - thumb_func_start sub_8111D78 -sub_8111D78: @ 8111D78 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _08111E1C - cmp r0, 0x1 - bgt _08111DA0 - cmp r0, 0 - beq _08111DA6 - b _08111E48 - .pool -_08111DA0: - cmp r0, 0x2 - beq _08111E42 - b _08111E48 -_08111DA6: - ldrh r1, [r4, 0xA] - adds r1, 0x1 - strh r1, [r4, 0xA] - movs r0, 0x3 - ands r0, r1 - strh r0, [r4, 0x12] - cmp r0, 0x1 - bne _08111DC4 - ldrh r1, [r4, 0xC] - movs r2, 0xC - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _08111DC4 - subs r0, r1, 0x1 - strh r0, [r4, 0xC] -_08111DC4: - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0x3 - bne _08111DDA - ldrh r1, [r4, 0xE] - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r0, 0xF - bgt _08111DDA - adds r0, r1, 0x1 - strh r0, [r4, 0xE] -_08111DDA: - ldrh r1, [r4, 0xE] - lsls r1, 8 - ldrh r0, [r4, 0xC] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldr r1, [r4, 0xC] - movs r0, 0x80 - lsls r0, 13 - cmp r1, r0 - bne _08111E48 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x50 - ble _08111E48 - movs r2, 0x8 - ldrsh r1, [r4, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl obj_delete_but_dont_free_vram - movs r0, 0x1 - strh r0, [r4, 0x10] - b _08111E48 - .pool -_08111E1C: - ldrh r0, [r4, 0x14] - adds r0, 0x1 - strh r0, [r4, 0x14] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _08111E48 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - ldrh r0, [r4, 0x10] - adds r0, 0x1 - strh r0, [r4, 0x10] - b _08111E48 -_08111E42: - adds r0, r2, 0 - bl move_anim_task_del -_08111E48: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8111D78 - - thumb_func_start sub_8111E50 -sub_8111E50: @ 8111E50 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r2, =0x03005e00 - adds r1, r2 - movs r2, 0 - strh r2, [r1, 0x26] - ldr r2, =sub_8111E78 - str r2, [r1] - bl _call_via_r2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8111E50 - - thumb_func_start sub_8111E78 -sub_8111E78: @ 8111E78 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r5, r0, r1 - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r6, r0, 24 - movs r1, 0x26 - ldrsh r0, [r5, r1] - cmp r0, 0x4 - bls _08111EA4 - b _081120C6 -_08111EA4: - lsls r0, 2 - ldr r1, =_08111EBC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08111EBC: - .4byte _08111ED0 - .4byte _08111FD0 - .4byte _08112014 - .4byte _0811207C - .4byte _081120A8 -_08111ED0: - ldr r7, =0x00002771 - adds r0, r7, 0 - bl AllocObjectPalette - lsls r0, 24 - lsrs r0, 24 - movs r2, 0 - mov r8, r2 - strh r0, [r5, 0x24] - cmp r0, 0xFF - beq _08111EFE - cmp r0, 0xF - beq _08111EFE - movs r0, 0x1 - bl duplicate_obj_of_side_rel2move_in_transparent_mode - strh r0, [r5, 0x8] - lsls r0, 16 - cmp r0, 0 - bge _08111F0C - adds r0, r7, 0 - bl FreeObjectPaletteByTag -_08111EFE: - adds r0, r4, 0 - bl move_anim_task_del - b _081120CC - .pool -_08111F0C: - ldr r4, =0x02020630 - movs r1, 0x8 - ldrsh r0, [r5, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrh r2, [r5, 0x24] - lsls r2, 4 - ldrb r3, [r1, 0x5] - movs r0, 0xF - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x5] - movs r2, 0x8 - ldrsh r0, [r5, r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r2, [r1, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x1] - movs r0, 0x8 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x5] - movs r2, 0xC - orrs r1, r2 - strb r1, [r0, 0x5] - movs r1, 0x8 - ldrsh r0, [r5, r1] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r4 - ldr r0, =0x020244d0 - ldr r1, [r0] - ldr r0, =0x02038437 - ldrb r0, [r0] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - lsls r1, 31 - adds r2, 0x3E - lsrs r1, 31 - lsls r1, 2 - ldrb r3, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - mov r2, r8 - strh r2, [r5, 0xA] - strh r2, [r5, 0xC] - movs r0, 0x10 - strh r0, [r5, 0xE] - movs r0, 0x1 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - movs r0, 0x22 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - adds r0, 0x10 - lsls r0, 4 - strh r0, [r5, 0x10] - cmp r6, 0x1 - bne _08111FC4 - movs r1, 0x80 - lsls r1, 2 - b _08111FC8 - .pool -_08111FC4: - movs r1, 0x80 - lsls r1, 3 -_08111FC8: - movs r0, 0 - bl ClearGpuRegBits - b _081120C6 -_08111FD0: - movs r1, 0x24 - ldrsh r0, [r5, r1] - adds r0, 0x10 - lsls r0, 4 - strh r0, [r5, 0x24] - movs r2, 0x10 - ldrsh r0, [r5, r2] - lsls r0, 1 - ldr r1, =0x02037714 - adds r0, r1 - movs r2, 0x24 - ldrsh r1, [r5, r2] - lsls r1, 1 - ldr r2, =0x02037b14 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - ldrh r0, [r5, 0x10] - ldr r3, =0x00003c0d - movs r1, 0x10 - movs r2, 0xA - bl pal_fade_1 - b _081120C6 - .pool -_08112014: - ldr r2, =0x02020630 - movs r0, 0x22 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x26] - ldrh r0, [r0, 0x22] - adds r1, r0 - subs r1, 0x20 - lsls r1, 16 - lsrs r2, r1, 16 - cmp r1, 0 - bge _08112034 - movs r2, 0 -_08112034: - cmp r6, 0x1 - bne _08112054 - lsls r0, r2, 24 - lsrs r0, 24 - adds r1, r2, 0 - adds r1, 0x40 - lsls r1, 24 - lsrs r1, 24 - movs r2, 0 - str r2, [sp] - movs r2, 0x4 - str r2, [sp, 0x4] - str r6, [sp, 0x8] - b _0811206C - .pool -_08112054: - lsls r0, r2, 24 - lsrs r0, 24 - adds r1, r2, 0 - adds r1, 0x40 - lsls r1, 24 - lsrs r1, 24 - movs r2, 0 - str r2, [sp] - movs r2, 0x8 - str r2, [sp, 0x4] - movs r2, 0x1 - str r2, [sp, 0x8] -_0811206C: - movs r2, 0x2 - movs r3, 0x6 - bl sub_80BA384 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x1C] - b _081120C6 -_0811207C: - cmp r6, 0x1 - bne _08112090 - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - b _08112098 - .pool -_08112090: - ldr r1, =0x00003f44 - movs r0, 0x50 - bl SetGpuReg -_08112098: - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - b _081120C6 - .pool -_081120A8: - cmp r6, 0x1 - bne _081120B8 - movs r1, 0x80 - lsls r1, 2 - movs r0, 0 - bl SetGpuRegBits - b _081120C2 -_081120B8: - movs r1, 0x80 - lsls r1, 3 - movs r0, 0 - bl SetGpuRegBits -_081120C2: - ldr r0, =sub_81120DC - str r0, [r5] -_081120C6: - ldrh r0, [r5, 0x26] - adds r0, 0x1 - strh r0, [r5, 0x26] -_081120CC: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8111E78 - - thumb_func_start sub_81120DC -sub_81120DC: @ 81120DC - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - ldrh r1, [r4, 0xA] - adds r1, 0x1 - strh r1, [r4, 0xA] - movs r0, 0x1 - ands r0, r1 - strh r0, [r4, 0x12] - cmp r0, 0 - bne _08112114 - ldr r1, =gUnknown_08329F40 - movs r2, 0xA - ldrsh r0, [r4, r2] - lsls r0, 1 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - movs r1, 0x12 - bl __divsi3 - strh r0, [r4, 0xC] -_08112114: - movs r2, 0x12 - ldrsh r0, [r4, r2] - cmp r0, 0x1 - bne _08112136 - ldr r1, =gUnknown_08329F40 - movs r2, 0xA - ldrsh r0, [r4, r2] - lsls r0, 1 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - movs r1, 0x12 - bl __divsi3 - movs r1, 0x10 - subs r1, r0 - strh r1, [r4, 0xE] -_08112136: - ldrh r1, [r4, 0xE] - lsls r1, 8 - ldrh r0, [r4, 0xC] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0x80 - bne _0811215E - movs r0, 0 - strh r0, [r4, 0x26] - ldr r1, =sub_8112170 - str r1, [r4] - adds r0, r5, 0 - bl _call_via_r1 -_0811215E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81120DC - - thumb_func_start sub_8112170 -sub_8112170: @ 8112170 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r6, r0, 24 - movs r1, 0x26 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _081121DC - cmp r0, 0x1 - bgt _081121A8 - cmp r0, 0 - beq _081121AE - b _08112258 - .pool -_081121A8: - cmp r0, 0x2 - beq _081121F0 - b _08112258 -_081121AE: - ldr r1, =0x02039b28 - movs r0, 0x3 - strb r0, [r1, 0x15] - movs r0, 0x1 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x24] - cmp r6, 0x1 - bne _081121D0 - movs r1, 0x80 - lsls r1, 2 - b _081121D4 - .pool -_081121D0: - movs r1, 0x80 - lsls r1, 3 -_081121D4: - movs r0, 0 - bl ClearGpuRegBits - b _08112258 -_081121DC: - ldrh r0, [r4, 0x10] - ldr r3, =0x00003c0d - movs r1, 0x10 - movs r2, 0 - bl pal_fade_1 - b _08112258 - .pool -_081121F0: - ldr r3, =0x02020630 - movs r0, 0x24 - ldrsh r1, [r4, r0] - 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] - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - bl obj_delete_but_dont_free_vram - ldr r0, =0x00002771 - bl FreeObjectPaletteByTag - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - cmp r6, 0x1 - bne _08112248 - movs r1, 0x80 - lsls r1, 2 - movs r0, 0 - bl SetGpuRegBits - b _08112252 - .pool -_08112248: - movs r1, 0x80 - lsls r1, 3 - movs r0, 0 - bl SetGpuRegBits -_08112252: - adds r0, r5, 0 - bl move_anim_task_del -_08112258: - ldrh r0, [r4, 0x26] - adds r0, 0x1 - strh r0, [r4, 0x26] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8112170 - - thumb_func_start sub_8112264 -sub_8112264: @ 8112264 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r7, r0, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _081122AC - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 8 - movs r2, 0xE0 - lsls r2, 13 - adds r0, r2 - lsrs r5, r0, 16 - ldr r4, =0x02038437 - b _081122D0 - .pool -_081122AC: - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 8 - movs r2, 0xE0 - lsls r2, 13 - adds r0, r2 - lsrs r5, r0, 16 - ldr r4, =0x02038436 -_081122D0: - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 8 - movs r1, 0xE0 - lsls r1, 13 - adds r0, r1 - lsrs r0, 16 - mov r9, r0 - mov r8, r5 - mov r2, r9 - subs r4, r2, r5 - lsls r4, 16 - lsrs r4, 16 - lsls r0, r6, 4 - strh r0, [r7, 0x2E] - lsls r0, r5, 4 - strh r0, [r7, 0x30] - mov r1, r10 - subs r0, r1, r6 - lsls r0, 4 - ldr r5, =0x0203841e - movs r2, 0x2 - ldrsh r1, [r5, r2] - bl __divsi3 - strh r0, [r7, 0x32] - lsls r4, 16 - asrs r4, 12 - movs r0, 0x2 - ldrsh r1, [r5, r0] - adds r0, r4, 0 - bl __divsi3 - strh r0, [r7, 0x34] - ldrh r0, [r5, 0x2] - strh r0, [r7, 0x36] - mov r1, r10 - strh r1, [r7, 0x38] - mov r2, r9 - strh r2, [r7, 0x3A] - movs r1, 0x36 - ldrsh r0, [r7, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r7, 0x3C] - ldrb r1, [r7, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r7, 0x5] - strh r6, [r7, 0x20] - mov r2, r8 - strh r2, [r7, 0x22] - ldr r0, =sub_8112384 - str r0, [r7, 0x1C] - adds r2, r7, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8112264 - - thumb_func_start sub_8112384 -sub_8112384: @ 8112384 - push {r4,lr} - adds r2, r0, 0 - ldrh r3, [r2, 0x36] - movs r1, 0x36 - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _081123BC - ldrh r0, [r2, 0x32] - ldrh r4, [r2, 0x2E] - adds r0, r4 - strh r0, [r2, 0x2E] - ldrh r1, [r2, 0x34] - ldrh r4, [r2, 0x30] - adds r1, r4 - strh r1, [r2, 0x30] - lsls r0, 16 - asrs r0, 20 - strh r0, [r2, 0x20] - lsls r1, 16 - asrs r1, 20 - strh r1, [r2, 0x22] - subs r0, r3, 0x1 - strh r0, [r2, 0x36] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bne _081123BC - strh r0, [r2, 0x2E] -_081123BC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8112384 - - thumb_func_start sub_81123C4 -sub_81123C4: @ 81123C4 - 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 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r1, r0 - str r1, [sp] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0 - ldr r1, [sp] - strh r0, [r1, 0x12] - strh r0, [r1, 0x14] - strh r0, [r1, 0x16] - strh r0, [r1, 0x18] - movs r0, 0x10 - strh r0, [r1, 0x1A] - ldr r2, =0x0203841e - ldrh r0, [r2] - strh r0, [r1, 0x1C] - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A861C - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x8] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _08112434 - b _08112530 -_08112434: - movs r4, 0 -_08112436: - lsls r1, r4, 16 - asrs r3, r1, 16 - ldr r0, =0x02038436 - ldrb r2, [r0] - str r1, [sp, 0x10] - cmp r3, r2 - beq _08112502 - movs r0, 0x2 - eors r2, r0 - cmp r3, r2 - beq _08112502 - lsls r0, r4, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _08112502 - ldr r6, [sp, 0x4] - ldr r3, [sp, 0x8] - lsls r0, r3, 16 - asrs r7, r0, 16 - ldr r0, =gUnknown_08596DB8 - adds r1, r6, 0 - adds r2, r7, 0 - movs r3, 0x37 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x40 - beq _08112502 - adds r0, r4, 0 - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - adds r0, r4, 0 - movs r1, 0x3 - bl sub_80A861C - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - mov r0, r8 - lsls r5, r0, 4 - add r5, r8 - lsls r5, 2 - ldr r1, =0x02020630 - adds r4, r5, r1 - lsls r0, r6, 4 - strh r0, [r4, 0x2E] - lsls r0, r7, 4 - strh r0, [r4, 0x30] - mov r2, r10 - subs r0, r2, r6 - lsls r0, 4 - ldr r3, =0x0203841e - movs r2, 0x2 - ldrsh r1, [r3, r2] - bl __divsi3 - strh r0, [r4, 0x32] - mov r3, r9 - lsls r0, r3, 16 - asrs r0, 16 - subs r0, r7 - lsls r0, 4 - ldr r2, =0x0203841e - movs r3, 0x2 - ldrsh r1, [r2, r3] - bl __divsi3 - strh r0, [r4, 0x34] - ldr r1, =0x0203841e - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x36] - mov r2, r10 - strh r2, [r4, 0x38] - mov r3, r9 - strh r3, [r4, 0x3A] - ldr r0, =0x0202064c - adds r5, r0 - ldr r0, =sub_8112384 - str r0, [r5] - ldr r2, [sp] - movs r3, 0x20 - ldrsh r1, [r2, r3] - adds r1, 0xD - lsls r1, 1 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1 - mov r1, r8 - strh r1, [r0] - ldrh r0, [r2, 0x20] - adds r0, 0x1 - strh r0, [r2, 0x20] -_08112502: - ldr r2, [sp, 0x10] - movs r3, 0x80 - lsls r3, 9 - adds r0, r2, r3 - lsrs r4, r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _08112436 - b _081125B4 - .pool -_08112530: - ldr r0, =gUnknown_08596DB8 - ldr r7, [sp, 0x4] - ldr r2, [sp, 0x8] - lsls r1, r2, 16 - asrs r1, 16 - str r1, [sp, 0xC] - adds r1, r7, 0 - ldr r2, [sp, 0xC] - movs r3, 0x37 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x40 - beq _081125B4 - movs r3, 0x30 - mov r10, r3 - movs r0, 0x28 - mov r9, r0 - ldr r6, =0x02020630 - mov r1, r8 - lsls r5, r1, 4 - add r5, r8 - lsls r5, 2 - adds r4, r5, r6 - lsls r0, r7, 4 - strh r0, [r4, 0x2E] - ldr r2, [sp, 0xC] - lsls r0, r2, 4 - strh r0, [r4, 0x30] - subs r0, r3, r7 - lsls r0, 4 - ldr r3, =0x0203841e - movs r2, 0x2 - ldrsh r1, [r3, r2] - bl __divsi3 - strh r0, [r4, 0x32] - mov r3, r9 - ldr r1, [sp, 0xC] - subs r0, r3, r1 - lsls r0, 4 - ldr r2, =0x0203841e - movs r3, 0x2 - ldrsh r1, [r2, r3] - bl __divsi3 - strh r0, [r4, 0x34] - ldr r1, =0x0203841e - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x36] - mov r2, r10 - strh r2, [r4, 0x38] - mov r3, r9 - strh r3, [r4, 0x3A] - adds r6, 0x1C - adds r5, r6 - ldr r0, =sub_8112384 - str r0, [r5] - mov r1, r8 - ldr r0, [sp] - strh r1, [r0, 0x22] - movs r0, 0x1 - ldr r2, [sp] - strh r0, [r2, 0x20] -_081125B4: - ldr r0, =sub_81125E0 - ldr r3, [sp] - str r0, [r3] - 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_81123C4 - - thumb_func_start sub_81125E0 -sub_81125E0: @ 81125E0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _08112696 - cmp r1, 0x1 - bgt _08112608 - cmp r1, 0 - beq _08112616 - b _08112752 - .pool -_08112608: - cmp r1, 0x2 - bne _0811260E - b _08112728 -_0811260E: - cmp r1, 0x3 - bne _08112614 - b _0811273C -_08112614: - b _08112752 -_08112616: - movs r2, 0x14 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0811267C - ldrh r0, [r4, 0x12] - adds r0, 0x1 - strh r0, [r4, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0811267C - strh r1, [r4, 0x12] - ldrh r0, [r4, 0x16] - adds r0, 0x1 - strh r0, [r4, 0x16] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0811264C - ldrh r1, [r4, 0x18] - movs r2, 0x18 - ldrsh r0, [r4, r2] - cmp r0, 0xF - bgt _0811265A - adds r0, r1, 0x1 - strh r0, [r4, 0x18] - b _0811265A -_0811264C: - ldrh r1, [r4, 0x1A] - movs r2, 0x1A - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0811265A - subs r0, r1, 0x1 - strh r0, [r4, 0x1A] -_0811265A: - ldrh r1, [r4, 0x1A] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x16 - ldrsh r0, [r4, r1] - cmp r0, 0x17 - ble _0811267C - movs r0, 0 - strh r0, [r4, 0x16] - movs r0, 0x1 - strh r0, [r4, 0x14] -_0811267C: - ldrh r1, [r4, 0x1C] - movs r2, 0x1C - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0811268C - subs r0, r1, 0x1 - strh r0, [r4, 0x1C] - b _08112752 -_0811268C: - movs r1, 0x14 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _08112752 - b _08112734 -_08112696: - ldrh r0, [r4, 0x12] - adds r0, 0x1 - strh r0, [r4, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _08112752 - movs r0, 0 - strh r0, [r4, 0x12] - ldrh r0, [r4, 0x16] - adds r0, 0x1 - strh r0, [r4, 0x16] - ands r0, r1 - lsls r0, 16 - cmp r0, 0 - beq _081126C6 - ldrh r1, [r4, 0x18] - movs r2, 0x18 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _081126D4 - subs r0, r1, 0x1 - strh r0, [r4, 0x18] - b _081126D4 -_081126C6: - ldrh r1, [r4, 0x1A] - movs r2, 0x1A - ldrsh r0, [r4, r2] - cmp r0, 0xF - bgt _081126D4 - adds r0, r1, 0x1 - strh r0, [r4, 0x1A] -_081126D4: - ldrh r1, [r4, 0x1A] - lsls r1, 8 - ldrh r0, [r4, 0x18] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldr r1, [r4, 0x18] - movs r0, 0x80 - lsls r0, 13 - cmp r1, r0 - bne _08112752 - movs r5, 0 - b _08112718 -_081126F4: - adds r1, r5, 0 - adds r1, 0xD - lsls r1, 1 - adds r0, r4, 0 - adds r0, 0x8 - adds r0, r1 - movs r2, 0 - ldrsh r1, [r0, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_08112718: - movs r1, 0x20 - ldrsh r0, [r4, r1] - cmp r5, r0 - blt _081126F4 - b _08112734 - .pool -_08112728: - ldrh r0, [r4, 0x12] - adds r0, 0x1 - strh r0, [r4, 0x12] - lsls r0, 16 - cmp r0, 0 - ble _08112752 -_08112734: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _08112752 -_0811273C: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r5, 0 - bl move_anim_task_del -_08112752: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81125E0 - - thumb_func_start sub_8112758 -sub_8112758: @ 8112758 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02022e24 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e26 - strh r1, [r0] - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - ldr r1, =0x00003f1f - movs r0, 0x4A - bl SetGpuReg - movs r0, 0x50 - movs r1, 0xC8 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0x10 - bl SetGpuReg - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _081127A0 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _081127B8 -_081127A0: - movs r6, 0x28 - b _081127BA - .pool -_081127B8: - movs r6, 0xC8 -_081127BA: - ldr r1, =0x02022e24 - lsls r3, r6, 16 - asrs r2, r3, 16 - lsls r0, r2, 8 - orrs r0, r2 - strh r0, [r1] - ldr r1, =0x02022e26 - movs r5, 0x28 - ldr r0, =0x00002828 - strh r0, [r1] - lsrs r3, 16 - movs r1, 0xF0 - subs r1, r2 - movs r4, 0x48 - ldr r2, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r2 - strh r3, [r0, 0xA] - strh r1, [r0, 0xC] - strh r5, [r0, 0xE] - strh r4, [r0, 0x10] - strh r6, [r0, 0x12] - strh r5, [r0, 0x14] - ldr r1, =sub_811280C - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8112758 - - thumb_func_start sub_811280C -sub_811280C: @ 811280C - 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 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r1, [r4, 0x8] - adds r0, r1, 0x1 - strh r0, [r4, 0x8] - ldrh r5, [r4, 0xA] - ldrh r7, [r4, 0xC] - ldrh r0, [r4, 0xE] - mov r10, r0 - ldrh r2, [r4, 0x10] - str r2, [sp, 0xC] - ldrh r0, [r4, 0x12] - ldrh r2, [r4, 0x14] - mov r8, r2 - lsls r1, 16 - asrs r6, r1, 16 - cmp r6, 0xF - ble _08112848 - b _08112938 -_08112848: - lsls r0, 16 - asrs r0, 16 - bl __floatsidf - str r0, [sp, 0x10] - str r1, [sp, 0x14] - lsls r0, r5, 16 - asrs r0, 16 - bl __floatsidf - ldr r2, =0x3fb00000 - ldr r3, =0x00000000 - bl __muldf3 - adds r5, r1, 0 - adds r4, r0, 0 - adds r0, r6, 0 - bl __floatsidf - str r0, [sp, 0x18] - str r1, [sp, 0x1C] - adds r1, r5, 0 - adds r0, r4, 0 - ldr r2, [sp, 0x18] - ldr r3, [sp, 0x1C] - bl __muldf3 - adds r3, r1, 0 - adds r2, r0, 0 - ldr r0, [sp, 0x10] - ldr r1, [sp, 0x14] - bl __subdf3 - bl __fixunsdfsi - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - lsls r0, r7, 16 - asrs r0, 16 - bl __floatsidf - ldr r2, =0x3fb00000 - ldr r3, =0x00000000 - bl __muldf3 - ldr r2, [sp, 0x18] - ldr r3, [sp, 0x1C] - bl __muldf3 - adds r3, r1, 0 - adds r2, r0, 0 - ldr r0, [sp, 0x10] - ldr r1, [sp, 0x14] - bl __adddf3 - bl __fixunsdfsi - lsls r0, 16 - lsrs r7, r0, 16 - mov r1, r8 - lsls r0, r1, 16 - asrs r0, 16 - bl __floatsidf - adds r5, r1, 0 - adds r4, r0, 0 - mov r2, r10 - lsls r0, r2, 16 - asrs r0, 16 - bl __floatsidf - ldr r2, =0x3fb00000 - ldr r3, =0x00000000 - bl __muldf3 - ldr r2, [sp, 0x18] - ldr r3, [sp, 0x1C] - bl __muldf3 - adds r3, r1, 0 - adds r2, r0, 0 - adds r1, r5, 0 - adds r0, r4, 0 - bl __subdf3 - bl __fixunsdfsi - lsls r0, 16 - lsrs r6, r0, 16 - ldr r1, [sp, 0xC] - lsls r0, r1, 16 - asrs r0, 16 - bl __floatsidf - ldr r2, =0x3fb00000 - ldr r3, =0x00000000 - bl __muldf3 - ldr r2, [sp, 0x18] - ldr r3, [sp, 0x1C] - bl __muldf3 - adds r3, r1, 0 - adds r2, r0, 0 - adds r1, r5, 0 - adds r0, r4, 0 - bl __adddf3 - bl __fixunsdfsi - lsls r0, 16 - lsrs r5, r0, 16 - b _08112966 - .pool -_08112938: - movs r2, 0 - mov r9, r2 - movs r7, 0xF0 - movs r6, 0 - movs r5, 0x70 - str r6, [sp] - str r6, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0x1 - movs r1, 0 - movs r3, 0 - bl sub_80A75AC - lsls r0, 16 - lsrs r0, 16 - str r6, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =sub_8112994 - str r0, [r4] -_08112966: - ldr r1, =0x02022e24 - mov r2, r9 - lsls r0, r2, 8 - orrs r7, r0 - strh r7, [r1] - ldr r1, =0x02022e26 - lsls r0, r6, 8 - orrs r5, r0 - strh r5, [r1] - 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_811280C - - thumb_func_start sub_8112994 -sub_8112994: @ 8112994 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _081129DA - ldr r0, =0x02022e24 - strh r1, [r0] - ldr r0, =0x02022e26 - strh r1, [r0] - ldr r4, =0x00003f3f - movs r0, 0x48 - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x4A - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - adds r0, r5, 0 - bl move_anim_task_del -_081129DA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8112994 - - thumb_func_start sub_81129F0 -sub_81129F0: @ 81129F0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08112A24 - movs r2, 0x18 - ldr r3, =0x0000fffe - ldrb r0, [r4, 0x3] - movs r1, 0x3F - negs r1, r1 - ands r1, r0 - movs r0, 0x10 - orrs r1, r0 - strb r1, [r4, 0x3] - b _08112A28 - .pool -_08112A24: - ldr r2, =0x0000ffe8 - movs r3, 0x2 -_08112A28: - lsls r0, r2, 16 - asrs r0, 16 - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - strh r3, [r4, 0x30] - movs r0, 0x3C - strh r0, [r4, 0x2E] - ldr r0, =sub_8112A4C - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81129F0 - - thumb_func_start sub_8112A4C -sub_8112A4C: @ 8112A4C - push {r4,lr} - adds r3, r0, 0 - ldrh r1, [r3, 0x2E] - movs r2, 0x2E - ldrsh r0, [r3, r2] - cmp r0, 0 - ble _08112A5E - subs r0, r1, 0x1 - b _08112AC2 -_08112A5E: - ldrh r0, [r3, 0x30] - ldrh r4, [r3, 0x24] - adds r1, r0, r4 - strh r1, [r3, 0x24] - adds r0, r1, 0x7 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xE - bls _08112AC4 - ldrh r0, [r3, 0x20] - adds r0, r1 - strh r0, [r3, 0x20] - movs r0, 0 - strh r0, [r3, 0x24] - ldrh r2, [r3, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x8 - ldr r4, =0x000003ff - adds r0, r4, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r3, 0x4] - ldrh r0, [r3, 0x32] - adds r0, 0x1 - strh r0, [r3, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bne _08112AC0 - movs r0, 0x1E - strh r0, [r3, 0x2E] - ldr r0, =sub_80A64B0 - str r0, [r3, 0x1C] - ldr r1, =sub_8112ACC - adds r0, r3, 0 - bl oamt_set_x3A_32 - b _08112AC4 - .pool -_08112AC0: - movs r0, 0x28 -_08112AC2: - strh r0, [r3, 0x2E] -_08112AC4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8112A4C - - thumb_func_start sub_8112ACC -sub_8112ACC: @ 8112ACC - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x2E - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08112AF6 - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0x10 - bl SetGpuReg - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - strh r5, [r4, 0x30] - strh r5, [r4, 0x32] - b _08112B3A -_08112AF6: - ldrh r1, [r4, 0x30] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0x1 - bgt _08112B06 - adds r0, r1, 0x1 - strh r0, [r4, 0x30] - b _08112B3A -_08112B06: - movs r0, 0 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - movs r1, 0x10 - subs r1, r0 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x10 - bne _08112B3A - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_8112B44 - str r0, [r4, 0x1C] -_08112B3A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8112ACC - - thumb_func_start sub_8112B44 -sub_8112B44: @ 8112B44 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - ldr r0, =0x02022e24 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e26 - strh r1, [r0] - adds r0, r4, 0 - bl move_anim_8072740 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8112B44 - - thumb_func_start sub_8112B78 -sub_8112B78: @ 8112B78 - push {r4-r7,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - movs r1, 0xC - bl sine - strh r0, [r5, 0x24] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08112B9C - ldrh r0, [r5, 0x24] - negs r0, r0 - strh r0, [r5, 0x24] -_08112B9C: - ldrh r0, [r5, 0x2E] - adds r0, 0x6 - movs r1, 0xFF - ands r0, r1 - strh r0, [r5, 0x2E] - movs r1, 0x80 - lsls r1, 1 - adds r0, r1, 0 - ldrh r1, [r5, 0x30] - adds r0, r1 - strh r0, [r5, 0x30] - lsls r0, 16 - asrs r0, 24 - negs r0, r0 - strh r0, [r5, 0x26] - ldrh r0, [r5, 0x3C] - adds r0, 0x1 - strh r0, [r5, 0x3C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _08112BE8 - ldr r0, =0x0000050b - strh r0, [r5, 0x3A] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldrh r1, [r5, 0x3A] - movs r0, 0x52 - bl SetGpuReg - b _08112C40 - .pool -_08112BE8: - cmp r0, 0x1E - ble _08112C40 - ldrh r0, [r5, 0x32] - adds r0, 0x1 - strh r0, [r5, 0x32] - ldrh r1, [r5, 0x3A] - lsls r0, r1, 16 - asrs r0, 24 - lsls r0, 16 - movs r6, 0xFF - ands r6, r1 - movs r1, 0x80 - lsls r1, 9 - adds r0, r1 - lsrs r7, r0, 16 - cmp r7, 0x10 - bls _08112C0C - movs r7, 0x10 -_08112C0C: - subs r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r0, 0 - bge _08112C18 - movs r6, 0 -_08112C18: - lsls r4, r7, 8 - orrs r4, r6 - lsls r1, r4, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - strh r4, [r5, 0x3A] - cmp r7, 0x10 - bne _08112C40 - cmp r6, 0 - bne _08112C40 - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_8112C4C - str r0, [r5, 0x1C] -_08112C40: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8112B78 - - thumb_func_start sub_8112C4C -sub_8112C4C: @ 8112C4C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl move_anim_8072740 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8112C4C - - thumb_func_start sub_8112C6C -sub_8112C6C: @ 8112C6C - 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 r0, =0x03005e00 - adds r4, r0 - movs r6, 0 - strh r6, [r4, 0x8] - movs r0, 0x10 - mov r8, r0 - mov r0, r8 - strh r0, [r4, 0xA] - ldr r5, =0x02038436 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x1A] - ldrb r0, [r5] - bl sub_80A6190 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x1C] - ldrb r0, [r5] - movs r1, 0x1 - bl sub_80A861C - lsls r0, 16 - asrs r1, r0, 16 - lsrs r0, 31 - adds r1, r0 - asrs r1, 1 - adds r1, 0x8 - strh r1, [r4, 0x1E] - strh r6, [r4, 0x16] - ldrb r0, [r5] - bl sub_80A8328 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x12] - ldrb r0, [r5] - bl sub_80A82E4 - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x2 - strh r0, [r4, 0x14] - strh r6, [r4, 0xE] - mov r0, r8 - strh r0, [r4, 0x10] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - strh r6, [r4, 0x18] - ldr r0, =sub_8112D10 - str r0, [r4] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8112C6C - - thumb_func_start sub_8112D10 -sub_8112D10: @ 8112D10 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x5 - bls _08112D2A - b _08112E96 -_08112D2A: - lsls r0, 2 - ldr r1, =_08112D3C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08112D3C: - .4byte _08112D54 - .4byte _08112DC4 - .4byte _08112E06 - .4byte _08112E1A - .4byte _08112E70 - .4byte _08112E80 -_08112D54: - movs r6, 0 -_08112D56: - movs r2, 0x1A - ldrsh r1, [r4, r2] - movs r0, 0x1C - ldrsh r2, [r4, r0] - ldrb r3, [r4, 0x14] - ldr r0, =gUnknown_08596E30 - bl AddObjectToFront - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - beq _08112DAA - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r5, r0, r1 - strh r7, [r5, 0x2E] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - movs r1, 0 - lsls r0, 24 - cmp r0, 0 - bne _08112D8C - movs r1, 0x1 -_08112D8C: - strh r1, [r5, 0x30] - movs r0, 0x2A - muls r0, r6 - movs r1, 0xFF - ands r0, r1 - strh r0, [r5, 0x32] - ldrh r0, [r4, 0x1E] - strh r0, [r5, 0x34] - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 1 - strh r0, [r5, 0x38] - ldrh r0, [r4, 0x16] - adds r0, 0x1 - strh r0, [r4, 0x16] -_08112DAA: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x5 - bls _08112D56 - b _08112E78 - .pool -_08112DC4: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08112DE2 - ldrh r1, [r4, 0xE] - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r0, 0xD - bgt _08112DF0 - adds r0, r1, 0x1 - strh r0, [r4, 0xE] - b _08112DF0 -_08112DE2: - ldrh r1, [r4, 0x10] - movs r2, 0x10 - ldrsh r0, [r4, r2] - cmp r0, 0x4 - ble _08112DF0 - subs r0, r1, 0x1 - strh r0, [r4, 0x10] -_08112DF0: - movs r1, 0xE - ldrsh r0, [r4, r1] - ldrh r2, [r4, 0xE] - ldrh r1, [r4, 0x10] - cmp r0, 0xE - bne _08112E60 - cmp r1, 0x4 - bne _08112E60 - movs r0, 0 - strh r0, [r4, 0xA] - b _08112E5A -_08112E06: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1E - ble _08112E96 - movs r0, 0 - strh r0, [r4, 0xA] - b _08112E78 -_08112E1A: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08112E38 - ldrh r1, [r4, 0xE] - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _08112E46 - subs r0, r1, 0x1 - strh r0, [r4, 0xE] - b _08112E46 -_08112E38: - ldrh r1, [r4, 0x10] - movs r2, 0x10 - ldrsh r0, [r4, r2] - cmp r0, 0xF - bgt _08112E46 - adds r0, r1, 0x1 - strh r0, [r4, 0x10] -_08112E46: - movs r1, 0xE - ldrsh r0, [r4, r1] - ldrh r2, [r4, 0xE] - ldrh r1, [r4, 0x10] - cmp r0, 0 - bne _08112E60 - cmp r1, 0x10 - bne _08112E60 - movs r0, 0x1 - strh r0, [r4, 0x18] -_08112E5A: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_08112E60: - lsls r1, 8 - orrs r1, r2 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - b _08112E96 -_08112E70: - movs r2, 0x16 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _08112E96 -_08112E78: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _08112E96 -_08112E80: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r7, 0 - bl move_anim_task_del -_08112E96: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8112D10 - - thumb_func_start sub_8112E9C -sub_8112E9C: @ 8112E9C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08112EAE - ldrh r0, [r4, 0x32] - adds r0, 0x2 - b _08112EB2 -_08112EAE: - ldrh r0, [r4, 0x32] - subs r0, 0x2 -_08112EB2: - strh r0, [r4, 0x32] - ldrh r1, [r4, 0x32] - movs r0, 0xFF - ands r0, r1 - strh r0, [r4, 0x32] - movs r2, 0x32 - ldrsh r0, [r4, r2] - movs r2, 0x34 - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - subs r0, 0x41 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x7E - bhi _08112EF4 - ldr r2, =0x03005e00 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r0, 0x12] - adds r1, 0x1 - movs r0, 0x3 - ands r1, r0 - b _08112F08 - .pool -_08112EF4: - ldr r2, =0x03005e00 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x3 - ldrb r1, [r0, 0x12] - ands r1, r2 -_08112F08: - lsls r1, 2 - ldrb r2, [r4, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x5] - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - movs r1, 0x38 - ldrsh r0, [r4, r1] - lsls r0, 3 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x3A] - movs r2, 0x3A - ldrsh r0, [r4, r2] - movs r1, 0x7 - bl sine - strh r0, [r4, 0x26] - ldr r2, =0x03005e00 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r1, r0, r2 - movs r2, 0x18 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _08112F56 - ldrh r0, [r1, 0x16] - subs r0, 0x1 - strh r0, [r1, 0x16] - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_08112F56: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8112E9C - - thumb_func_start sub_8112F60 -sub_8112F60: @ 8112F60 - adds r3, r0, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r3] - ldr r2, =0x020241e4 - ldr r1, =0x02038436 - ldrb r1, [r1] - adds r1, r2 - ldrb r1, [r1] - strh r1, [r0, 0x38] - movs r1, 0x80 - strh r1, [r0, 0x2E] - movs r1, 0xA - strh r1, [r0, 0x30] - ldr r2, =0x0203841e - ldrh r1, [r2] - strh r1, [r0, 0x32] - ldrh r1, [r2, 0x2] - strh r1, [r0, 0x34] - ldr r1, =sub_8112FB8 - str r1, [r0, 0x1C] - ldr r2, =0x02020630 - movs r3, 0x38 - ldrsh r1, [r0, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - bx lr - .pool - thumb_func_end sub_8112F60 - - thumb_func_start sub_8112FB8 -sub_8112FB8: @ 8112FB8 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0x34] - movs r1, 0x34 - ldrsh r3, [r5, r1] - cmp r3, 0 - beq _08113020 - subs r0, 0x1 - strh r0, [r5, 0x34] - movs r2, 0x2E - ldrsh r0, [r5, r2] - movs r2, 0x30 - ldrsh r1, [r5, r2] - bl sine - ldr r4, =0x02020630 - movs r1, 0x38 - ldrsh r2, [r5, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - strh r0, [r1, 0x24] - movs r2, 0x2E - ldrsh r0, [r5, r2] - movs r2, 0x30 - ldrsh r1, [r5, r2] - bl cosine - movs r1, 0x38 - ldrsh r2, [r5, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - strh r0, [r1, 0x26] - ldrh r0, [r5, 0x32] - ldrh r2, [r5, 0x2E] - adds r1, r0, r2 - strh r1, [r5, 0x2E] - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _08113054 - ldr r2, =0xffffff00 - adds r0, r1, r2 - strh r0, [r5, 0x2E] - b _08113054 - .pool -_08113020: - ldr r2, =0x02020630 - movs r0, 0x38 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x24] - movs r0, 0x38 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x26] - movs r0, 0x38 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - subs r1, 0x8 - strh r1, [r0, 0x22] - ldr r0, =move_anim_8074EE0 - str r0, [r5, 0x1C] -_08113054: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8112FB8 - - thumb_func_start sub_8113064 -sub_8113064: @ 8113064 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _081130B4 - ldr r2, =0x0203841e - ldrh r0, [r5, 0x20] - ldrh r1, [r2] - subs r0, r1 - strh r0, [r5, 0x20] - ldrh r0, [r2, 0x6] - negs r0, r0 - strh r0, [r2, 0x6] - ldrh r0, [r2, 0x8] - negs r0, r0 - strh r0, [r2, 0x8] - adds r1, r2, 0 - b _081130BE - .pool -_081130B4: - ldr r1, =0x0203841e - ldrh r0, [r1] - ldrh r2, [r5, 0x20] - adds r0, r2 - strh r0, [r5, 0x20] -_081130BE: - ldrh r0, [r1, 0x2] - ldrh r2, [r5, 0x22] - adds r0, r2 - strh r0, [r5, 0x22] - ldrh r0, [r1, 0x4] - strh r0, [r5, 0x2E] - ldrh r0, [r1, 0x6] - strh r0, [r5, 0x30] - ldrh r0, [r1, 0x8] - strh r0, [r5, 0x34] - ldrh r0, [r1, 0xA] - strh r0, [r5, 0x38] - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r1, =move_anim_8074EE0 - adds r0, r5, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A66DC - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8113064 - - thumb_func_start sub_8113100 -sub_8113100: @ 8113100 - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_80A6838 - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x32] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x36] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08113164 - ldr r2, =0x0203841e - ldrh r0, [r5, 0x20] - ldrh r1, [r2, 0x2] - subs r0, r1 - strh r0, [r5, 0x20] - ldrh r0, [r5, 0x22] - adds r1, r0 - strh r1, [r5, 0x22] - ldrh r0, [r5, 0x32] - ldrh r1, [r2, 0x4] - subs r0, r1 - strh r0, [r5, 0x32] - ldrh r0, [r2, 0x6] - ldrh r1, [r5, 0x36] - adds r0, r1 - strh r0, [r5, 0x36] - b _0811318E - .pool -_08113164: - ldr r1, =0x0203841e - ldrh r0, [r1] - ldrh r2, [r5, 0x20] - adds r0, r2 - strh r0, [r5, 0x20] - ldrh r0, [r1, 0x2] - ldrh r2, [r5, 0x22] - adds r0, r2 - strh r0, [r5, 0x22] - ldrh r0, [r1, 0x4] - ldrh r2, [r5, 0x32] - adds r0, r2 - strh r0, [r5, 0x32] - ldrh r0, [r1, 0x6] - ldrh r1, [r5, 0x36] - adds r0, r1 - strh r0, [r5, 0x36] - adds r0, r5, 0 - movs r1, 0x1 - bl StartObjectImageAnim -_0811318E: - ldr r0, =0x0203841e - ldrh r0, [r0, 0x8] - strh r0, [r5, 0x2E] - ldr r0, =sub_80A6EEC - str r0, [r5, 0x1C] - ldr r1, =move_anim_8074EE0 - adds r0, r5, 0 - bl oamt_set_x3A_32 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8113100 - - thumb_func_start sub_81131B4 -sub_81131B4: @ 81131B4 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _081131D0 - ldr r4, =0x02038436 - b _081131D2 - .pool -_081131D0: - ldr r4, =0x02038437 -_081131D2: - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r4, =0x0203841e - movs r0, 0x2 - ldrsh r1, [r4, r0] - adds r0, r5, 0 - bl sub_80A6864 - ldrh r0, [r4, 0x4] - ldrh r1, [r5, 0x22] - adds r0, r1 - strh r0, [r5, 0x22] - ldr r0, =sub_80A67D8 - str r0, [r5, 0x1C] - ldr r1, =move_anim_8074EE0 - adds r0, r5, 0 - bl oamt_set_x3A_32 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81131B4 - - thumb_func_start sub_8113224 -sub_8113224: @ 8113224 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0811323E - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim -_0811323E: - adds r0, r4, 0 - bl sub_8113100 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8113224 - - thumb_func_start sub_8113250 -sub_8113250: @ 8113250 - push {r4-r7,lr} - adds r6, r0, 0 - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - strh r0, [r6, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x22] - strh r5, [r6, 0x36] - movs r0, 0x1 - strh r0, [r6, 0x38] - ldr r0, =0x0203841e - ldrh r0, [r0] - strh r0, [r6, 0x3A] - ldr r4, =0x0202420b - ldrb r0, [r4] - movs r1, 0 - bl sub_80A861C - lsls r7, r0, 16 - lsrs r5, r7, 16 - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A861C - lsls r1, r0, 16 - lsrs r0, r1, 16 - cmp r5, r0 - bls _081132B0 - lsrs r0, r7, 17 - b _081132B2 - .pool -_081132B0: - lsrs r0, r1, 17 -_081132B2: - strh r0, [r6, 0x3C] - movs r1, 0x3A - ldrsh r0, [r6, r1] - movs r2, 0x3C - ldrsh r1, [r6, r2] - bl cosine - strh r0, [r6, 0x24] - movs r1, 0x3A - ldrsh r0, [r6, r1] - movs r2, 0x3C - ldrsh r1, [r6, r2] - bl sine - strh r0, [r6, 0x26] - ldr r0, =sub_81132E0 - str r0, [r6, 0x1C] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8113250 - - thumb_func_start sub_81132E0 -sub_81132E0: @ 81132E0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x2E - ldrsh r5, [r4, r0] - cmp r5, 0 - beq _081132F2 - cmp r5, 0x1 - beq _0811335E - b _081133E2 -_081132F2: - ldrh r0, [r4, 0x3A] - ldrh r1, [r4, 0x38] - subs r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x3A] - movs r1, 0x3A - ldrsh r0, [r4, r1] - movs r2, 0x3C - ldrsh r1, [r4, r2] - bl cosine - strh r0, [r4, 0x24] - movs r1, 0x3A - ldrsh r0, [r4, r1] - movs r2, 0x3C - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - ble _08113344 - strh r5, [r4, 0x36] - ldrh r1, [r4, 0x38] - movs r2, 0x38 - ldrsh r0, [r4, r2] - cmp r0, 0xF - bgt _08113344 - adds r0, r1, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - ble _08113344 - movs r0, 0x10 - strh r0, [r4, 0x38] -_08113344: - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3C - ble _081133E2 - movs r0, 0 - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _081133E2 -_0811335E: - ldrh r0, [r4, 0x3A] - ldrh r1, [r4, 0x38] - subs r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x3A] - ldrh r1, [r4, 0x3C] - movs r2, 0x3C - ldrsh r0, [r4, r2] - cmp r0, 0x95 - bgt _08113386 - adds r0, r1, 0 - adds r0, 0x8 - strh r0, [r4, 0x3C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x95 - ble _08113386 - movs r0, 0x96 - strh r0, [r4, 0x3C] -_08113386: - movs r1, 0x3A - ldrsh r0, [r4, r1] - movs r2, 0x3C - ldrsh r1, [r4, r2] - bl cosine - strh r0, [r4, 0x24] - movs r1, 0x3A - ldrsh r0, [r4, r1] - movs r2, 0x3C - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - ble _081133CE - movs r0, 0 - strh r0, [r4, 0x36] - ldrh r1, [r4, 0x38] - movs r2, 0x38 - ldrsh r0, [r4, r2] - cmp r0, 0xF - bgt _081133CE - adds r0, r1, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - ble _081133CE - movs r0, 0x10 - strh r0, [r4, 0x38] -_081133CE: - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _081133E2 - adds r0, r4, 0 - bl move_anim_8072740 -_081133E2: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81132E0 - - thumb_func_start sub_81133E8 -sub_81133E8: @ 81133E8 - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r4, r1, r0 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08113424 - ldr r0, =0x04000014 - str r0, [sp] - ldr r0, =0x02022e18 - b _0811342A - .pool -_08113424: - ldr r0, =0x04000018 - str r0, [sp] - ldr r0, =0x02022e1c -_0811342A: - ldrh r0, [r0] - strh r0, [r4, 0xC] - ldr r0, =0xa2600001 - str r0, [sp, 0x4] - mov r1, sp - movs r5, 0 - movs r0, 0x1 - strb r0, [r1, 0x8] - mov r0, sp - strb r5, [r0, 0x9] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl sub_80A6190 - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - subs r1, 0x20 - strh r1, [r4, 0xE] - adds r0, 0x20 - strh r0, [r4, 0x10] - cmp r1, 0 - bge _0811345A - strh r5, [r4, 0xE] -_0811345A: - ldrh r3, [r4, 0xE] - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r3, r0 - bgt _08113488 - ldr r5, =0x02038c28 - movs r0, 0xF0 - lsls r0, 3 - adds r6, r5, r0 -_0811346C: - lsls r1, r3, 1 - adds r2, r1, r5 - ldrh r0, [r4, 0xC] - strh r0, [r2] - adds r1, r6 - ldrh r0, [r4, 0xC] - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r3, r0 - ble _0811346C -_08113488: - ldr r0, [sp] - ldr r1, [sp, 0x4] - ldr r2, [sp, 0x8] - bl sub_80BA038 - ldr r0, =sub_81134B8 - str r0, [r4] - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81133E8 - - thumb_func_start sub_81134B8 -sub_81134B8: @ 81134B8 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r2, r0, r1 - movs r1, 0x8 - ldrsh r0, [r2, r1] - cmp r0, 0x4 - bhi _0811356E - lsls r0, 2 - ldr r1, =_081134E4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081134E4: - .4byte _081134F8 - .4byte _0811351A - .4byte _0811352A - .4byte _08113556 - .4byte _08113568 -_081134F8: - ldrh r0, [r2, 0x16] - adds r0, 0x1 - strh r0, [r2, 0x16] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0811354E - movs r0, 0 - strh r0, [r2, 0x16] - ldrh r0, [r2, 0x14] - adds r0, 0x1 - strh r0, [r2, 0x14] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bne _0811354E - b _08113548 -_0811351A: - ldrh r0, [r2, 0xA] - adds r0, 0x1 - strh r0, [r2, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3C - ble _0811354E - b _08113548 -_0811352A: - ldrh r0, [r2, 0x16] - adds r0, 0x1 - strh r0, [r2, 0x16] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0811354E - movs r0, 0 - strh r0, [r2, 0x16] - ldrh r0, [r2, 0x14] - subs r0, 0x1 - strh r0, [r2, 0x14] - lsls r0, 16 - cmp r0, 0 - bne _0811354E -_08113548: - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] -_0811354E: - adds r0, r2, 0 - bl sub_8113574 - b _0811356E -_08113556: - ldr r1, =0x02039b28 - movs r0, 0x3 - strb r0, [r1, 0x15] - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - b _0811356E - .pool -_08113568: - adds r0, r3, 0 - bl move_anim_task_del -_0811356E: - pop {r0} - bx r0 - thumb_func_end sub_81134B8 - - thumb_func_start sub_8113574 -sub_8113574: @ 8113574 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - ldrh r3, [r5, 0x12] - ldrh r4, [r5, 0xE] - movs r1, 0x10 - ldrsh r0, [r5, r1] - cmp r4, r0 - bgt _081135CA - ldr r7, =0x02038c28 - mov r12, r7 - ldr r0, =gUnknown_08329F40 - mov r8, r0 - ldr r6, =0x02039b28 -_08113592: - lsls r2, r4, 1 - ldrb r1, [r6, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r2, r0 - add r2, r12 - lsls r0, r3, 1 - add r0, r8 - movs r7, 0 - ldrsh r1, [r0, r7] - movs r7, 0x14 - ldrsh r0, [r5, r7] - muls r0, r1 - asrs r0, 7 - ldrh r1, [r5, 0xC] - adds r0, r1 - strh r0, [r2] - adds r3, 0x8 - movs r0, 0xFF - ands r3, r0 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - movs r7, 0x10 - ldrsh r0, [r5, r7] - cmp r4, r0 - ble _08113592 -_081135CA: - ldrh r0, [r5, 0x12] - adds r0, 0x9 - movs r1, 0xFF - ands r0, r1 - strh r0, [r5, 0x12] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8113574 - - thumb_func_start sub_81135EC -sub_81135EC: @ 81135EC - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r4, r0, 0 - ldr r5, =0x0203841e - movs r0, 0x4 - ldrsh r1, [r5, r0] - lsls r0, r1, 1 - adds r0, r1 - movs r1, 0x5 - bl __divsi3 - adds r6, r0, 0 - ldr r1, =0x02038436 - mov r8, r1 - ldrb r0, [r1] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x20] - mov r2, r8 - ldrb r0, [r2] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r3, [r5, 0x8] - adds r0, r3 - strh r0, [r4, 0x22] - movs r1, 0x2 - ldrsh r0, [r5, r1] - movs r2, 0x4 - ldrsh r1, [r5, r2] - bl cosine - strh r0, [r4, 0x30] - movs r3, 0x2 - ldrsh r0, [r5, r3] - lsls r6, 16 - asrs r6, 16 - adds r1, r6, 0 - bl sine - strh r0, [r4, 0x32] - ldrh r1, [r4, 0x30] - ldrh r2, [r5] - adds r3, r2, 0 - muls r3, r1 - adds r1, r3, 0 - ldrh r3, [r4, 0x20] - adds r1, r3 - strh r1, [r4, 0x20] - adds r1, r2, 0 - muls r1, r0 - adds r0, r1, 0 - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x34] - ldr r0, =sub_811369C - str r0, [r4, 0x1C] - adds r4, 0x2E - ldr r2, =0x0203a100 - movs r1, 0x6 -_08113674: - ldrh r0, [r4] - strh r0, [r2] - adds r4, 0x2 - adds r2, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _08113674 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81135EC - - thumb_func_start sub_811369C -sub_811369C: @ 811369C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x36] - adds r0, r1 - strh r0, [r4, 0x36] - ldrh r0, [r4, 0x32] - ldrh r2, [r4, 0x38] - adds r0, r2 - strh r0, [r4, 0x38] - movs r1, 0x36 - ldrsh r0, [r4, r1] - movs r1, 0xA - bl __divsi3 - strh r0, [r4, 0x24] - movs r2, 0x38 - ldrsh r0, [r4, r2] - movs r1, 0xA - bl __divsi3 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x34 - ldrsh r1, [r4, r2] - cmp r0, r1 - ble _081136E0 - adds r0, r4, 0 - bl move_anim_8072740 -_081136E0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_811369C - - thumb_func_start sub_81136E8 -sub_81136E8: @ 81136E8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =0x0203841e - ldrh r1, [r1] - strh r1, [r0, 0x8] - ldr r1, =0x02038436 - ldrb r4, [r1] - movs r1, 0x10 - strh r1, [r0, 0xA] - movs r0, 0x52 - bl SetGpuReg - adds r0, r4, 0 - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08113734 - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - b _0811373C - .pool -_08113734: - ldr r1, =0x00003f44 - movs r0, 0x50 - bl SetGpuReg -_0811373C: - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_811375C - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81136E8 - - thumb_func_start sub_811375C -sub_811375C: @ 811375C - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r6, r0, r1 - ldrh r0, [r6, 0xA] - lsrs r4, r0, 8 - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xC - ldrsh r0, [r6, r2] - ldrb r2, [r6, 0x8] - cmp r0, r2 - bne _081137D8 - adds r4, 0x1 - lsls r4, 24 - lsrs r4, 24 - subs r0, r1, 0x1 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r4, 8 - orrs r1, r0 - movs r5, 0 - strh r1, [r6, 0xA] - ldrh r1, [r6, 0xA] - movs r0, 0x52 - bl SetGpuReg - strh r5, [r6, 0xC] - cmp r4, 0x10 - bne _081137DE - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02038436 - ldrb r0, [r0] - adds r0, r1 - 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] - adds r0, r7, 0 - bl move_anim_task_del - b _081137DE - .pool -_081137D8: - ldrh r0, [r6, 0xC] - adds r0, 0x1 - strh r0, [r6, 0xC] -_081137DE: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_811375C - - thumb_func_start sub_81137E4 -sub_81137E4: @ 81137E4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - adds r2, r1 - ldr r0, =0x0203841e - ldrh r0, [r0] - strh r0, [r2, 0x8] - movs r1, 0x80 - lsls r1, 5 - strh r1, [r2, 0xA] - ldr r0, =sub_811381C - str r0, [r2] - movs r0, 0x52 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end sub_81137E4 - - thumb_func_start sub_811381C -sub_811381C: @ 811381C - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r6, r0, r1 - ldrh r0, [r6, 0xA] - lsrs r4, r0, 8 - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xC - ldrsh r0, [r6, r2] - ldrb r2, [r6, 0x8] - cmp r0, r2 - bne _0811387C - subs r4, 0x1 - lsls r4, 24 - lsrs r4, 24 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r4, 8 - orrs r1, r0 - movs r5, 0 - strh r1, [r6, 0xA] - ldrh r1, [r6, 0xA] - movs r0, 0x52 - bl SetGpuReg - strh r5, [r6, 0xC] - cmp r4, 0 - bne _08113882 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r7, 0 - bl move_anim_task_del - b _08113882 - .pool -_0811387C: - ldrh r0, [r6, 0xC] - adds r0, 0x1 - strh r0, [r6, 0xC] -_08113882: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_811381C - - thumb_func_start sub_8113888 -sub_8113888: @ 8113888 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081138BC - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - b _081138C4 - .pool -_081138BC: - ldr r1, =0x00003f44 - movs r0, 0x50 - bl SetGpuReg -_081138C4: - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8113888 - - thumb_func_start sub_81138D4 -sub_81138D4: @ 81138D4 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r6, =0x02038437 - ldrb r0, [r6] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x30] - ldr r5, =0x02038436 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrb r0, [r6] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x34] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x36] - movs r0, 0x7E - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl sub_80A6E14 - ldrh r0, [r4, 0x30] - negs r0, r0 - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x32] - negs r0, r0 - strh r0, [r4, 0x36] - ldr r0, =0x0000ffd8 - strh r0, [r4, 0x3A] - ldr r1, =sub_8113950 - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81138D4 - - thumb_func_start sub_8113950 -sub_8113950: @ 8113950 - push {r4-r6,lr} - adds r4, r0, 0 - ldrh r5, [r4, 0x30] - ldrh r0, [r4, 0x34] - adds r2, r5, r0 - strh r2, [r4, 0x34] - ldrh r3, [r4, 0x32] - ldrh r6, [r4, 0x36] - adds r1, r3, r6 - strh r1, [r4, 0x36] - lsls r0, r2, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - lsls r0, r1, 16 - asrs r0, 24 - strh r0, [r4, 0x26] - movs r6, 0x3C - ldrsh r0, [r4, r6] - cmp r0, 0 - bne _08113992 - adds r0, r2, r5 - strh r0, [r4, 0x34] - adds r1, r3 - strh r1, [r4, 0x36] - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - lsls r1, 16 - asrs r1, 24 - strh r1, [r4, 0x26] - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - strh r0, [r4, 0x2E] -_08113992: - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r2, 0x3A - ldrsh r1, [r4, r2] - bl sine - ldrh r6, [r4, 0x26] - adds r0, r6 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x38] - adds r0, 0x3 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x38] - cmp r0, 0x7F - ble _081139C2 - movs r0, 0 - strh r0, [r4, 0x38] - ldrh r0, [r4, 0x3A] - adds r0, 0x14 - strh r0, [r4, 0x3A] - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] -_081139C2: - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - cmp r0, 0 - bne _081139D4 - adds r0, r4, 0 - bl move_anim_8072740 -_081139D4: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8113950 - - thumb_func_start sub_81139DC -sub_81139DC: @ 81139DC - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x0203841e - ldrh r0, [r5] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r5, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldrb r1, [r5, 0x4] - adds r0, r4, 0 - bl StartObjectRotScalAnim - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x2E] - ldrh r0, [r5, 0x8] - strh r0, [r4, 0x30] - ldrh r0, [r5, 0xA] - strh r0, [r4, 0x32] - ldr r0, =sub_8113A18 - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81139DC - - thumb_func_start sub_8113A18 -sub_8113A18: @ 8113A18 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - ldrh r1, [r2, 0x36] - adds r0, r1 - strh r0, [r2, 0x36] - ldrh r1, [r2, 0x30] - ldrh r3, [r2, 0x38] - adds r1, r3 - strh r1, [r2, 0x38] - lsls r0, 16 - asrs r0, 24 - strh r0, [r2, 0x24] - lsls r1, 16 - asrs r1, 24 - strh r1, [r2, 0x26] - ldrh r0, [r2, 0x34] - adds r0, 0x1 - strh r0, [r2, 0x34] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x32 - ldrsh r1, [r2, r3] - cmp r0, r1 - bne _08113A4E - ldr r0, =sub_8113A58 - str r0, [r2, 0x1C] -_08113A4E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8113A18 - - thumb_func_start sub_8113A58 -sub_8113A58: @ 8113A58 - push {lr} - adds r3, r0, 0 - ldrh r1, [r3, 0x36] - ldrh r0, [r3, 0x2E] - subs r1, r0 - strh r1, [r3, 0x36] - ldrh r0, [r3, 0x38] - ldrh r2, [r3, 0x30] - subs r0, r2 - strh r0, [r3, 0x38] - lsls r1, 16 - asrs r1, 24 - strh r1, [r3, 0x24] - lsls r0, 16 - asrs r0, 24 - strh r0, [r3, 0x26] - ldrh r0, [r3, 0x34] - subs r0, 0x1 - strh r0, [r3, 0x34] - lsls r0, 16 - cmp r0, 0 - bne _08113A8A - adds r0, r3, 0 - bl move_anim_8074EE0 -_08113A8A: - pop {r0} - bx r0 - thumb_func_end sub_8113A58 - - thumb_func_start sub_8113A90 -sub_8113A90: @ 8113A90 - push {r4-r7,lr} - adds r4, r0, 0 - ldr r0, =0x0203841e - movs r2, 0 - ldrsh r1, [r0, r2] - adds r3, r0, 0 - cmp r1, 0 - bne _08113AAC - ldr r0, =0x02038436 - b _08113AAE - .pool -_08113AAC: - ldr r0, =0x02038437 -_08113AAE: - ldrb r5, [r0] - movs r6, 0x14 - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x4 - ldr r7, =0x000003ff - adds r0, r7, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - movs r1, 0x2 - ldrsh r0, [r3, r1] - cmp r0, 0x1 - beq _08113B0C - cmp r0, 0x1 - bgt _08113AE8 - cmp r0, 0 - beq _08113AF2 - b _08113B60 - .pool -_08113AE8: - cmp r0, 0x2 - beq _08113B26 - cmp r0, 0x3 - beq _08113B3E - b _08113B60 -_08113AF2: - adds r0, r5, 0 - movs r1, 0x5 - bl sub_80A861C - subs r0, 0x8 - strh r0, [r4, 0x20] - adds r0, r5, 0 - movs r1, 0x2 - bl sub_80A861C - adds r0, 0x8 - strh r0, [r4, 0x22] - b _08113B60 -_08113B0C: - adds r0, r5, 0 - movs r1, 0x5 - bl sub_80A861C - subs r0, 0xE - strh r0, [r4, 0x20] - adds r0, r5, 0 - movs r1, 0x2 - bl sub_80A861C - adds r0, 0x10 - strh r0, [r4, 0x22] - b _08113B60 -_08113B26: - adds r0, r5, 0 - movs r1, 0x4 - bl sub_80A861C - adds r0, 0x8 - strh r0, [r4, 0x20] - adds r0, r5, 0 - movs r1, 0x2 - bl sub_80A861C - adds r0, 0x8 - b _08113B54 -_08113B3E: - adds r0, r5, 0 - movs r1, 0x4 - bl sub_80A861C - adds r0, 0xE - strh r0, [r4, 0x20] - adds r0, r5, 0 - movs r1, 0x2 - bl sub_80A861C - adds r0, 0x10 -_08113B54: - strh r0, [r4, 0x22] - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - movs r6, 0xEC -_08113B60: - movs r0, 0x20 - strh r0, [r4, 0x2E] - lsls r0, r6, 24 - asrs r0, 24 - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x22] - adds r0, 0xC - strh r0, [r4, 0x36] - ldr r0, =0x0000fff4 - strh r0, [r4, 0x38] - adds r0, r4, 0 - bl sub_80A68D4 - ldr r0, =sub_8113B90 - str r0, [r4, 0x1C] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8113A90 - - thumb_func_start sub_8113B90 -sub_8113B90: @ 8113B90 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _08113BA4 - adds r0, r4, 0 - bl move_anim_8074EE0 -_08113BA4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8113B90 - - thumb_func_start sub_8113BAC -sub_8113BAC: @ 8113BAC - push {r4-r7,lr} - sub sp, 0x1C - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r5, r1, r0 - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x1F - movs r6, 0 - strh r0, [r5, 0x16] - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A861C - subs r0, 0x7 - strh r0, [r5, 0x14] - ldrh r1, [r5, 0x16] - strh r1, [r5, 0x12] - strh r0, [r5, 0x10] - subs r1, r0 - lsls r1, 8 - strh r1, [r5, 0x22] - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - subs r1, 0x20 - strh r1, [r5, 0x24] - adds r0, 0x20 - strh r0, [r5, 0x26] - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08113C1C - ldr r0, =0x0000fff4 - b _08113C1E - .pool -_08113C1C: - ldr r0, =0x0000ffc0 -_08113C1E: - strh r0, [r5, 0x18] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0xE] - cmp r0, 0x1 - bne _08113C80 - add r4, sp, 0xC - adds r0, r4, 0 - bl sub_80A6B30 - ldr r0, =0x02022e1a - ldrh r0, [r0] - strh r0, [r5, 0x1C] - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - ldrb r1, [r4, 0x8] - lsls r1, 4 - movs r0, 0 - movs r2, 0x20 - bl rboxid_80040B8 - ldr r0, =0x04000016 - str r0, [sp] - movs r7, 0x2 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _08113CB0 - ldr r1, =0x02022e1c - b _08113CAA - .pool -_08113C80: - ldr r0, =0x02022e1e - ldrh r0, [r0] - strh r0, [r5, 0x1C] - ldr r1, =0x00003f44 - movs r0, 0x50 - bl SetGpuReg - movs r0, 0 - movs r1, 0x90 - movs r2, 0x20 - bl rboxid_80040B8 - ldr r0, =0x0400001a - str r0, [sp] - movs r7, 0x4 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _08113CB0 - ldr r1, =0x02022e18 -_08113CAA: - ldrh r0, [r1] - adds r0, 0xF0 - strh r0, [r1] -_08113CB0: - ldr r0, =0xa2600001 - str r0, [sp, 0x4] - mov r2, sp - movs r1, 0 - movs r0, 0x1 - strb r0, [r2, 0x8] - mov r0, sp - strb r1, [r0, 0x9] - strh r1, [r5, 0x1E] - movs r0, 0x10 - strh r0, [r5, 0x20] - strh r1, [r5, 0x8] - strh r1, [r5, 0xA] - strh r1, [r5, 0xC] - movs r0, 0x3 - bl sub_8114374 - movs r3, 0 - ldr r4, =0x02038c28 - movs r0, 0xF0 - lsls r0, 3 - adds r6, r4, r0 -_08113CDC: - lsls r1, r3, 1 - adds r2, r1, r4 - ldrh r0, [r5, 0x1C] - strh r0, [r2] - adds r1, r6 - ldrh r0, [r5, 0x1C] - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x6F - bls _08113CDC - ldr r0, [sp] - ldr r1, [sp, 0x4] - ldr r2, [sp, 0x8] - bl sub_80BA038 - movs r0, 0x3F - eors r7, r0 - movs r1, 0xFC - lsls r1, 6 - adds r0, r1, 0 - orrs r7, r0 - movs r0, 0x4A - adds r1, r7, 0 - bl SetGpuReg - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - ldr r2, =0x02022e24 - ldrh r0, [r5, 0x24] - lsls r0, 8 - ldrh r1, [r5, 0x26] - orrs r0, r1 - strh r0, [r2] - ldr r1, =0x02022e26 - movs r0, 0xA0 - strh r0, [r1] - ldr r0, =sub_8113D60 - str r0, [r5] - add sp, 0x1C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8113BAC - - thumb_func_start sub_8113D60 -sub_8113D60: @ 8113D60 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bls _08113D7A - b _08113E72 -_08113D7A: - lsls r0, 2 - ldr r1, =_08113D8C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08113D8C: - .4byte _08113DA0 - .4byte _08113E02 - .4byte _08113E1C - .4byte _08113E58 - .4byte _08113E6C -_08113DA0: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _08113E72 - movs r0, 0 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08113DD0 - ldrh r1, [r4, 0x1E] - movs r2, 0x1E - ldrsh r0, [r4, r2] - cmp r0, 0xC - beq _08113DDE - adds r0, r1, 0x1 - strh r0, [r4, 0x1E] - b _08113DDE -_08113DD0: - ldrh r1, [r4, 0x20] - movs r2, 0x20 - ldrsh r0, [r4, r2] - cmp r0, 0x8 - beq _08113DDE - subs r0, r1, 0x1 - strh r0, [r4, 0x20] -_08113DDE: - ldrh r1, [r4, 0x20] - lsls r1, 8 - ldrh r0, [r4, 0x1E] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x1E - ldrsh r0, [r4, r1] - cmp r0, 0xC - bne _08113E72 - movs r2, 0x20 - ldrsh r0, [r4, r2] - cmp r0, 0x8 - bne _08113E72 - b _08113E5E -_08113E02: - ldrh r0, [r4, 0x10] - subs r0, 0x8 - strh r0, [r4, 0x10] - adds r0, r4, 0 - bl sub_8114244 - movs r0, 0x10 - ldrsh r1, [r4, r0] - movs r2, 0x18 - ldrsh r0, [r4, r2] - cmp r1, r0 - bge _08113E72 - b _08113E5E -_08113E1C: - ldrh r0, [r4, 0x10] - subs r0, 0x8 - strh r0, [r4, 0x10] - adds r0, r4, 0 - bl sub_8114244 - ldrh r1, [r4, 0x24] - adds r1, 0x4 - strh r1, [r4, 0x24] - ldrh r0, [r4, 0x26] - subs r2, r0, 0x4 - strh r2, [r4, 0x26] - lsls r1, 16 - lsls r0, r2, 16 - cmp r1, r0 - blt _08113E3E - strh r2, [r4, 0x24] -_08113E3E: - ldr r3, =0x02022e24 - ldrh r2, [r4, 0x24] - lsls r0, r2, 8 - ldrh r1, [r4, 0x26] - orrs r0, r1 - strh r0, [r3] - lsls r2, 16 - lsls r1, 16 - cmp r2, r1 - bne _08113E72 - b _08113E5E - .pool -_08113E58: - ldr r1, =0x02039b28 - movs r0, 0x3 - strb r0, [r1, 0x15] -_08113E5E: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _08113E72 - .pool -_08113E6C: - adds r0, r2, 0 - bl move_anim_task_del -_08113E72: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8113D60 - - thumb_func_start sub_8113E78 -sub_8113E78: @ 8113E78 - push {r4-r7,lr} - sub sp, 0x1C - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x4 - bls _08113E94 - b _081140A6 -_08113E94: - lsls r0, 2 - ldr r1, =_08113EA8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08113EA8: - .4byte _08113EBC - .4byte _08113F40 - .4byte _08113F84 - .4byte _08113FF0 - .4byte _08114058 -_08113EBC: - bl sub_80A4DF0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08113EF8 - ldr r0, =0x02022e24 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e26 - strh r1, [r0] - ldr r4, =0x00003f3f - movs r0, 0x48 - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x4A - adds r1, r4, 0 - bl SetGpuReg - adds r0, r6, 0 - bl move_anim_task_del - b _081140A6 - .pool -_08113EF8: - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0xE] - cmp r0, 0x1 - bne _08113F24 - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x02022e1c - b _08113F2E - .pool -_08113F24: - ldr r1, =0x00003f44 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x02022e18 -_08113F2E: - ldrh r0, [r1] - adds r0, 0xF0 - strh r0, [r1] - b _08114044 - .pool -_08113F40: - movs r1, 0xE - ldrsh r0, [r5, r1] - cmp r0, 0x1 - bne _08113F68 - mov r0, sp - bl sub_80A6B30 - ldr r0, =0x02022e1a - ldrh r0, [r0] - strh r0, [r5, 0x1C] - mov r0, sp - ldrb r1, [r0, 0x8] - lsls r1, 4 - movs r0, 0 - movs r2, 0x20 - bl rboxid_80040B8 - b _08113F78 - .pool -_08113F68: - ldr r0, =0x02022e1e - ldrh r0, [r0] - strh r0, [r5, 0x1C] - movs r0, 0 - movs r1, 0x90 - movs r2, 0x20 - bl rboxid_80040B8 -_08113F78: - movs r0, 0x3 - bl sub_8114374 - b _08114044 - .pool -_08113F84: - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x1F - movs r6, 0 - strh r0, [r5, 0x16] - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A861C - subs r0, 0x7 - strh r0, [r5, 0x14] - ldrh r1, [r5, 0x16] - subs r1, r0 - lsls r1, 8 - strh r1, [r5, 0x22] - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - subs r1, r0, 0x4 - strh r1, [r5, 0x24] - adds r0, 0x4 - strh r0, [r5, 0x26] - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08113FD8 - ldr r0, =0x0000fff4 - b _08113FDA - .pool -_08113FD8: - ldr r0, =0x0000ffc0 -_08113FDA: - strh r0, [r5, 0x18] - ldrh r0, [r5, 0x18] - strh r0, [r5, 0x10] - strh r0, [r5, 0x12] - movs r0, 0xC - strh r0, [r5, 0x1E] - movs r0, 0x8 - strh r0, [r5, 0x20] - b _08114044 - .pool -_08113FF0: - movs r1, 0xE - ldrsh r0, [r5, r1] - cmp r0, 0x1 - bne _08114000 - ldr r0, =0x04000016 - b _08114002 - .pool -_08114000: - ldr r0, =0x0400001a -_08114002: - str r0, [sp, 0x10] - movs r3, 0 - add r4, sp, 0x10 - ldr r6, =0x02038c28 - movs r0, 0xF0 - lsls r0, 3 - adds r7, r6, r0 -_08114010: - lsls r1, r3, 1 - adds r2, r1, r6 - ldrh r0, [r5, 0x1C] - adds r0, 0x9F - subs r0, r3 - strh r0, [r2] - adds r1, r7 - ldrh r0, [r5, 0x1C] - adds r0, 0x9F - subs r0, r3 - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x6F - bls _08114010 - ldr r1, =0xa2600001 - str r1, [r4, 0x4] - movs r2, 0 - movs r0, 0x1 - strb r0, [r4, 0x8] - strb r2, [r4, 0x9] - ldr r0, [sp, 0x10] - ldr r2, [r4, 0x8] - bl sub_80BA038 -_08114044: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - b _081140A6 - .pool -_08114058: - movs r1, 0xE - ldrsh r0, [r5, r1] - cmp r0, 0x1 - bne _08114070 - ldr r1, =0x00003f3d - movs r0, 0x4A - bl SetGpuReg - b _08114078 - .pool -_08114070: - ldr r1, =0x00003f3b - movs r0, 0x4A - bl SetGpuReg -_08114078: - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - ldr r2, =0x02022e24 - ldrh r0, [r5, 0x24] - lsls r0, 8 - ldrh r1, [r5, 0x26] - orrs r0, r1 - strh r0, [r2] - ldr r1, =0x02022e26 - movs r0, 0xA0 - strh r0, [r1] - movs r0, 0 - strh r0, [r5, 0x8] - strh r0, [r5, 0xA] - strh r0, [r5, 0xC] - ldr r1, =0x0000080c - movs r0, 0x52 - bl SetGpuReg - ldr r0, =sub_81140C8 - str r0, [r5] -_081140A6: - add sp, 0x1C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8113E78 - - thumb_func_start sub_81140C8 -sub_81140C8: @ 81140C8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bls _081140E2 - b _08114232 -_081140E2: - lsls r0, 2 - ldr r1, =_081140F4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081140F4: - .4byte _08114108 - .4byte _08114134 - .4byte _0811419C - .4byte _081141FE - .4byte _08114210 -_08114108: - ldrh r0, [r4, 0x12] - adds r0, 0x8 - strh r0, [r4, 0x12] - lsls r0, 16 - asrs r0, 16 - ldrh r2, [r4, 0x16] - movs r3, 0x16 - ldrsh r1, [r4, r3] - cmp r0, r1 - blt _0811411E - strh r2, [r4, 0x12] -_0811411E: - adds r0, r4, 0 - bl sub_8114244 - movs r0, 0x12 - ldrsh r1, [r4, r0] - movs r2, 0x16 - ldrsh r0, [r4, r2] - cmp r1, r0 - beq _08114132 - b _08114232 -_08114132: - b _08114204 -_08114134: - movs r3, 0x26 - ldrsh r0, [r4, r3] - movs r2, 0x24 - ldrsh r1, [r4, r2] - subs r0, r1 - cmp r0, 0x3F - bgt _08114150 - ldrh r0, [r4, 0x24] - subs r0, 0x4 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x26] - adds r0, 0x4 - strh r0, [r4, 0x26] - b _08114154 -_08114150: - movs r0, 0x1 - strh r0, [r4, 0xA] -_08114154: - ldr r2, =0x02022e24 - ldrh r0, [r4, 0x24] - lsls r0, 8 - ldrh r1, [r4, 0x26] - orrs r0, r1 - strh r0, [r2] - ldrh r0, [r4, 0x10] - adds r0, 0x8 - strh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 16 - ldrh r2, [r4, 0x14] - movs r3, 0x14 - ldrsh r1, [r4, r3] - cmp r0, r1 - blt _08114176 - strh r2, [r4, 0x10] -_08114176: - adds r0, r4, 0 - bl sub_8114244 - movs r0, 0x10 - ldrsh r1, [r4, r0] - movs r2, 0x14 - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _08114232 - movs r3, 0xA - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _08114232 - movs r0, 0 - strh r0, [r4, 0xA] - b _08114204 - .pool -_0811419C: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _08114232 - movs r0, 0 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081141CC - ldrh r1, [r4, 0x1E] - movs r2, 0x1E - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _081141DA - subs r0, r1, 0x1 - strh r0, [r4, 0x1E] - b _081141DA -_081141CC: - ldrh r1, [r4, 0x20] - movs r3, 0x20 - ldrsh r0, [r4, r3] - cmp r0, 0xF - bgt _081141DA - adds r0, r1, 0x1 - strh r0, [r4, 0x20] -_081141DA: - ldrh r1, [r4, 0x20] - lsls r1, 8 - ldrh r0, [r4, 0x1E] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x1E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08114232 - movs r2, 0x20 - ldrsh r0, [r4, r2] - cmp r0, 0x10 - bne _08114232 - b _08114204 -_081141FE: - ldr r1, =0x02039b28 - movs r0, 0x3 - strb r0, [r1, 0x15] -_08114204: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _08114232 - .pool -_08114210: - ldr r0, =0x02022e24 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e26 - strh r1, [r0] - ldr r4, =0x00003f3f - movs r0, 0x48 - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x4A - adds r1, r4, 0 - bl SetGpuReg - adds r0, r5, 0 - bl move_anim_task_del -_08114232: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81140C8 - - thumb_func_start sub_8114244 -sub_8114244: @ 8114244 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - ldrh r0, [r6, 0x12] - ldrh r4, [r6, 0x10] - subs r0, r4 - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0 - beq _08114338 - movs r2, 0x22 - ldrsh r0, [r6, r2] - bl __divsi3 - mov r8, r0 - movs r3, 0x14 - ldrsh r0, [r6, r3] - lsls r5, r0, 8 - lsls r0, r4, 16 - movs r4, 0 - cmp r0, 0 - ble _081142A4 - ldr r0, =0x02038c28 - mov r12, r0 - ldr r7, =0x02039b28 -_08114278: - lsls r2, r4, 16 - asrs r2, 16 - lsls r3, r2, 1 - ldrb r1, [r7, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r3, r0 - add r3, r12 - adds r1, r2, 0 - subs r1, 0x9F - ldrh r0, [r6, 0x1C] - subs r0, r1 - strh r0, [r3] - adds r2, 0x1 - lsls r2, 16 - lsrs r4, r2, 16 - asrs r2, 16 - movs r1, 0x10 - ldrsh r0, [r6, r1] - cmp r2, r0 - blt _08114278 -_081142A4: - ldrh r4, [r6, 0x10] - lsls r3, r4, 16 - asrs r1, r3, 16 - movs r2, 0x12 - ldrsh r0, [r6, r2] - cmp r1, r0 - bgt _081142EE - ldr r0, =0x02038c28 - mov r12, r0 - ldr r7, =0x02039b28 -_081142B8: - asrs r4, r3, 16 - cmp r4, 0 - blt _081142DA - asrs r1, r5, 8 - subs r1, r4 - lsls r3, r4, 1 - ldrb r2, [r7, 0x14] - lsls r0, r2, 4 - subs r0, r2 - lsls r0, 7 - adds r3, r0 - add r3, r12 - lsls r1, 16 - asrs r1, 16 - ldrh r2, [r6, 0x1C] - adds r1, r2 - strh r1, [r3] -_081142DA: - add r5, r8 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - lsls r3, r4, 16 - asrs r1, r3, 16 - movs r2, 0x12 - ldrsh r0, [r6, r2] - cmp r1, r0 - ble _081142B8 -_081142EE: - movs r3, 0x1C - ldrsh r0, [r6, r3] - adds r0, 0x9F - lsls r2, r4, 16 - asrs r1, r2, 16 - subs r5, r0, r1 - movs r3, 0x16 - ldrsh r0, [r6, r3] - cmp r1, r0 - bge _08114366 - ldr r7, =0x02038c28 - ldr r4, =0x02039b28 -_08114306: - asrs r3, r2, 16 - cmp r3, 0 - blt _0811431E - lsls r2, r3, 1 - ldrb r1, [r4, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r2, r0 - adds r2, r7 - strh r5, [r2] - subs r5, 0x1 -_0811431E: - adds r0, r3, 0x1 - lsls r2, r0, 16 - asrs r1, r2, 16 - movs r3, 0x16 - ldrsh r0, [r6, r3] - cmp r1, r0 - blt _08114306 - b _08114366 - .pool -_08114338: - movs r1, 0x1C - ldrsh r0, [r6, r1] - adds r5, r0, 0 - adds r5, 0x9F - movs r4, 0 - ldr r3, =0x02038c28 - movs r2, 0xF0 - lsls r2, 3 - adds r6, r3, r2 -_0811434A: - lsls r0, r4, 16 - asrs r0, 16 - lsls r2, r0, 1 - adds r1, r2, r3 - strh r5, [r1] - adds r2, r6 - strh r5, [r2] - subs r5, 0x1 - adds r0, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - asrs r0, 16 - cmp r0, 0x6F - ble _0811434A -_08114366: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8114244 - - thumb_func_start sub_8114374 -sub_8114374: @ 8114374 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - movs r4, 0 - ldr r7, =0x02020630 - movs r1, 0x3 - ands r0, r1 - lsls r5, r0, 2 - movs r0, 0xD - negs r0, r0 - adds r6, r0, 0 -_0811438A: - lsls r0, r4, 24 - lsrs r0, 24 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _081143AA - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - ldrb r0, [r1, 0x5] - ands r0, r6 - orrs r0, r5 - strb r0, [r1, 0x5] -_081143AA: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x3 - bls _0811438A - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8114374 - - thumb_func_start sub_81143C0 -sub_81143C0: @ 81143C0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r6, =0x02038436 - ldrb r0, [r6] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - eors r0, r1 - negs r1, r0 - orrs r1, r0 - lsrs r4, r1, 31 - ldrb r0, [r6] - adds r1, r4, 0 - movs r2, 0x1 - bl sub_80A438C - ldr r0, =0x02020630 - mov r9, r0 - ldr r0, =0x020241e4 - mov r8, r0 - ldrb r0, [r6] - add r0, r8 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r9 - adds r1, 0x3E - ldrb r2, [r1] - movs r7, 0x5 - negs r7, r7 - adds r0, r7, 0 - ands r0, r2 - strb r0, [r1] - ldrb r0, [r6] - movs r5, 0x2 - eors r0, r5 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _0811444E - ldrb r0, [r6] - eors r0, r5 - movs r1, 0x1 - eors r4, r1 - adds r1, r4, 0 - movs r2, 0x1 - bl sub_80A438C - ldrb r0, [r6] - eors r0, r5 - add r0, r8 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - adds r0, 0x3E - ldrb r2, [r0] - adds r1, r7, 0 - ands r1, r2 - strb r1, [r0] -_0811444E: - mov r0, r10 - bl move_anim_task_del - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81143C0 - - thumb_func_start sub_8114470 -sub_8114470: @ 8114470 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r4, =0x02038436 - ldrb r0, [r4] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - eors r0, r1 - negs r1, r0 - orrs r1, r0 - lsrs r5, r1, 31 - adds r0, r5, 0 - bl sub_80A477C - ldrb r1, [r4] - movs r0, 0x2 - eors r0, r1 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _081144AC - movs r0, 0x1 - eors r5, r0 - adds r0, r5, 0 - bl sub_80A477C -_081144AC: - adds r0, r6, 0 - bl move_anim_task_del - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8114470 - - thumb_func_start sub_81144BC -sub_81144BC: @ 81144BC - push {r4,lr} - adds r4, r0, 0 - ldr r1, =0x0203841e - ldrh r0, [r1] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - ldrh r0, [r1, 0x2] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - ldrb r1, [r1, 0x4] - adds r0, r4, 0 - bl StartObjectImageAnim - ldr r0, =sub_80A67D8 - str r0, [r4, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81144BC - - thumb_func_start sub_81144F8 -sub_81144F8: @ 81144F8 - push {r4-r7,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r7, r0, 24 - movs r6, 0 - ldr r0, =0x02022e24 - strh r6, [r0] - ldr r0, =0x02022e26 - strh r6, [r0] - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - ldr r1, =0x00003f3d - movs r0, 0x4A - bl SetGpuReg - movs r1, 0x80 - lsls r1, 8 - movs r0, 0 - bl SetGpuRegBits - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x00000c08 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl lcd_bg_operations - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0811455C - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl lcd_bg_operations -_0811455C: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _081145D6 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _081145D6 - ldr r4, =0x02038436 - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - beq _0811458C - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - cmp r0, 0 - bne _081145D6 -_0811458C: - ldrb r0, [r4] - movs r5, 0x2 - eors r0, r5 - bl b_side_obj__get_some_boolean - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081145D6 - ldr r3, =0x02020630 - ldr r1, =0x020241e4 - ldrb r0, [r4] - eors r0, r5 - adds r0, r1 - ldrb r0, [r0] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - ldrb r3, [r2, 0x5] - lsls r1, r3, 28 - lsrs r1, 30 - subs r1, 0x1 - movs r0, 0x3 - ands r1, r0 - lsls r1, 2 - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x5] - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - movs r6, 0x1 -_081145D6: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _08114614 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldrh r5, [r0] - b _0811465C - .pool -_08114614: - ldr r4, =0x02038436 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08114640 - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - b _08114650 - .pool -_08114640: - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec -_08114650: - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 -_0811465C: - movs r0, 0 - bl obj_id_for_side_relative_to_move - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x02038436 - ldrb r0, [r0] - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_80A89C8 - lsls r0, 24 - lsrs r5, r0, 24 - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08C1D210 - bl sub_80A6D48 - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08C1D0AC - mov r2, sp - ldrh r2, [r2, 0xA] - bl sub_80A6CC0 - ldr r0, =gUnknown_08C1D1E8 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - movs r2, 0x20 - bl decompress_palette - ldr r2, =0x02022e18 - ldr r0, =0x02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x20] - negs r0, r0 - adds r0, 0x60 - strh r0, [r2] - ldr r2, =0x02022e1a - ldrh r0, [r1, 0x22] - negs r0, r0 - adds r0, 0x20 - strh r0, [r2] - ldrb r0, [r1, 0x5] - lsrs r0, 4 - adds r0, 0x10 - adds r1, r0, 0 - ldr r2, =0x0203841e - movs r3, 0x2 - ldrsh r0, [r2, r3] - cmp r0, 0 - bne _08114708 - adds r0, r1, 0 - movs r1, 0 - bl sub_80A750C - b _08114714 - .pool -_08114708: - lsls r0, r1, 4 - ldrh r3, [r2, 0x4] - movs r1, 0x10 - movs r2, 0xB - bl pal_fade_1 -_08114714: - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0x8] - ldr r2, =0x0203841e - ldrh r1, [r2] - strh r1, [r0, 0xA] - ldrh r1, [r2, 0x2] - strh r1, [r0, 0xC] - ldrh r1, [r2, 0x4] - strh r1, [r0, 0xE] - strh r6, [r0, 0x14] - ldr r1, =sub_8114748 - str r1, [r0] - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81144F8 - - thumb_func_start sub_8114748 -sub_8114748: @ 8114748 - push {r4-r6,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x1C] - adds r0, 0x4 - movs r5, 0 - strh r0, [r4, 0x1C] - ldr r2, =0x02022e18 - ldrh r3, [r2] - subs r1, r3, 0x4 - strh r1, [r2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x80 - beq _08114776 - b _08114886 -_08114776: - strh r5, [r4, 0x1C] - adds r0, r3, 0 - adds r0, 0x7C - strh r0, [r2] - ldrh r0, [r4, 0x1E] - adds r0, 0x1 - strh r0, [r4, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _08114824 - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - ldr r5, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x5] - lsrs r0, 4 - adds r0, 0x10 - adds r1, r0, 0 - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _081147B8 - adds r0, r1, 0 - movs r1, 0x1 - bl sub_80A750C -_081147B8: - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x9] - bl sub_80A6C68 - movs r1, 0x14 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _08114886 - ldr r2, =0x020241e4 - ldr r0, =0x02038436 - ldrb r1, [r0] - movs r0, 0x2 - eors r0, r1 - adds r0, r2 - ldrb r0, [r0] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r5 - ldrb r3, [r2, 0x5] - lsls r1, r3, 28 - lsrs r1, 30 - adds r1, 0x1 - movs r0, 0x3 - ands r1, r0 - lsls r1, 2 - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x5] - b _08114886 - .pool -_08114824: - cmp r0, 0x3 - bne _08114886 - ldr r0, =0x02022e24 - strh r5, [r0] - ldr r0, =0x02022e26 - strh r5, [r0] - ldr r4, =0x00003f3f - movs r0, 0x48 - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x4A - adds r1, r4, 0 - bl SetGpuReg - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _08114856 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0 - bl lcd_bg_operations -_08114856: - movs r0, 0 - bl GetGpuReg - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 8 - adds r0, r2, 0 - eors r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r6, 0 - bl move_anim_task_del -_08114886: - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8114748 - - thumb_func_start sub_811489C -sub_811489C: @ 811489C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r0, =0x0203841e - movs r2, 0 - ldrsh r1, [r0, r2] - adds r2, r0, 0 - cmp r1, 0x7 - bhi _08114900 - lsls r0, r1, 2 - ldr r1, =_081148C4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081148C4: - .4byte _081148E4 - .4byte _081148E4 - .4byte _081148E4 - .4byte _081148E4 - .4byte _081148F0 - .4byte _081148F4 - .4byte _081148F8 - .4byte _081148FC -_081148E4: - ldrb r0, [r2] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r2, r0, 24 - b _08114902 -_081148F0: - movs r4, 0 - b _08114908 -_081148F4: - movs r4, 0x2 - b _08114908 -_081148F8: - movs r4, 0x1 - b _08114908 -_081148FC: - movs r4, 0x3 - b _08114908 -_08114900: - movs r2, 0xFF -_08114902: - movs r0, 0 - cmp r0, 0 - beq _0811492E -_08114908: - adds r0, r4, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _0811492C - ldr r0, =0x020241e4 - adds r0, r4, r0 - ldrb r2, [r0] - b _0811492E - .pool -_0811492C: - movs r2, 0xFF -_0811492E: - cmp r2, 0xFF - beq _0811494A - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - adds r0, 0x10 - ldr r1, =0x0203841e - ldrb r1, [r1, 0x2] - bl sub_80A750C -_0811494A: - adds r0, r5, 0 - bl move_anim_task_del - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811489C - - thumb_func_start sub_8114960 -sub_8114960: @ 8114960 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =0x02038432 - ldrb r0, [r2] - cmp r0, 0x1 - bhi _08114974 - ldr r1, =0x0203841e - movs r0, 0 - strh r0, [r1, 0xE] -_08114974: - ldrb r0, [r2] - cmp r0, 0x2 - bne _08114980 - ldr r1, =0x0203841e - movs r0, 0x1 - strh r0, [r1, 0xE] -_08114980: - adds r0, r3, 0 - bl move_anim_task_del - pop {r0} - bx r0 - .pool - thumb_func_end sub_8114960 - - thumb_func_start sub_8114994 -sub_8114994: @ 8114994 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x02038436 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x20] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - movs r0, 0x14 - strh r0, [r4, 0x2E] - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x36] - ldr r0, =0x0000ffd8 - strh r0, [r4, 0x38] - adds r0, r4, 0 - bl sub_80A68D4 - ldr r0, =sub_81149FC - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8114994 - - thumb_func_start sub_81149FC -sub_81149FC: @ 81149FC - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _08114A50 - ldrh r0, [r5, 0x24] - ldrh r1, [r5, 0x20] - adds r0, r1 - movs r1, 0 - strh r0, [r5, 0x20] - ldrh r0, [r5, 0x26] - ldrh r2, [r5, 0x22] - adds r0, r2 - strh r0, [r5, 0x22] - strh r1, [r5, 0x26] - strh r1, [r5, 0x24] - movs r0, 0x14 - strh r0, [r5, 0x2E] - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x32] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x36] - movs r0, 0x28 - strh r0, [r5, 0x38] - adds r0, r5, 0 - bl sub_80A68D4 - ldr r0, =sub_8114A60 - str r0, [r5, 0x1C] -_08114A50: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81149FC - - thumb_func_start sub_8114A60 -sub_8114A60: @ 8114A60 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _08114A74 - adds r0, r4, 0 - bl move_anim_8072740 -_08114A74: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8114A60 - - thumb_func_start sub_8114A7C -sub_8114A7C: @ 8114A7C - push {r4-r6,lr} - adds r6, r0, 0 - movs r1, 0x1 - bl sub_80A6980 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08114A9C - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] -_08114A9C: - ldr r4, =0x0203841e - ldrh r0, [r4, 0x8] - strh r0, [r6, 0x2E] - ldr r5, =0x02038437 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x4] - adds r0, r1 - strh r0, [r6, 0x32] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r4, [r4, 0x6] - adds r0, r4 - strh r0, [r6, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r6, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r6, 0 - bl oamt_set_x3A_32 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8114A7C - - thumb_func_start sub_8114AF0 -sub_8114AF0: @ 8114AF0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A60AC - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A60AC - lsls r0, 24 - lsrs r7, r0, 24 - bl GenerateRandomNumber2 - movs r4, 0x1F - adds r5, r4, 0 - ands r5, r0 - bl GenerateRandomNumber2 - ands r4, r0 - adds r1, r5, 0 - cmp r1, 0x10 - ble _08114B38 - movs r0, 0x10 - subs r0, r1 - lsls r0, 16 - lsrs r5, r0, 16 -_08114B38: - lsls r0, r4, 16 - asrs r1, r0, 16 - cmp r1, 0x10 - ble _08114B48 - movs r0, 0x10 - subs r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 -_08114B48: - ldr r0, =0x0203841e - ldrh r0, [r0, 0x4] - strh r0, [r6, 0x2E] - mov r1, r8 - adds r0, r1, r5 - strh r0, [r6, 0x32] - adds r0, r7, r4 - strh r0, [r6, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r6, 0x1C] - ldr r1, =move_anim_8074EE0 - adds r0, r6, 0 - bl oamt_set_x3A_32 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8114AF0 - - thumb_func_start sub_8114B80 -sub_8114B80: @ 8114B80 - push {r4-r6,lr} - adds r5, r0, 0 - ldrh r2, [r5, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x1 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x4] - ldr r6, =0x0203841e - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _08114BF4 - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r2, [r6, 0x2] - adds r0, r2 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r3, [r6, 0x4] - adds r0, r3 - strh r0, [r5, 0x22] - movs r1, 0x2 - ldrsh r0, [r6, r1] - movs r2, 0x1 - negs r2, r2 - adds r1, r2, 0 - cmp r0, 0 - ble _08114BDA - movs r1, 0x1 -_08114BDA: - strh r1, [r5, 0x2E] - ldr r0, =sub_8114C10 - b _08114C02 - .pool -_08114BF4: - ldrh r0, [r6, 0x2] - strh r0, [r5, 0x20] - ldrh r0, [r6, 0x4] - strh r0, [r5, 0x22] - negs r0, r0 - strh r0, [r5, 0x26] - ldr r0, =sub_8114C4C -_08114C02: - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8114B80 - - thumb_func_start sub_8114C10 -sub_8114C10: @ 8114C10 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _08114C2E - movs r0, 0 - strh r0, [r2, 0x30] - ldrh r0, [r2, 0x2E] - ldrh r1, [r2, 0x20] - adds r0, r1 - strh r0, [r2, 0x20] -_08114C2E: - ldrh r0, [r2, 0x22] - subs r0, 0x4 - strh r0, [r2, 0x22] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x4 - negs r1, r1 - cmp r0, r1 - bge _08114C46 - adds r0, r2, 0 - bl move_anim_8072740 -_08114C46: - pop {r0} - bx r0 - thumb_func_end sub_8114C10 - - thumb_func_start sub_8114C4C -sub_8114C4C: @ 8114C4C - push {lr} - adds r3, r0, 0 - movs r0, 0x2E - ldrsh r1, [r3, r0] - cmp r1, 0 - beq _08114C5E - cmp r1, 0x1 - beq _08114C74 - b _08114CB6 -_08114C5E: - ldrh r0, [r3, 0x26] - adds r0, 0x4 - strh r0, [r3, 0x26] - lsls r0, 16 - cmp r0, 0 - blt _08114CB6 - strh r1, [r3, 0x26] - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - b _08114CB6 -_08114C74: - ldrh r0, [r3, 0x30] - adds r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - cmp r0, 0 - ble _08114CB6 - movs r0, 0 - strh r0, [r3, 0x30] - movs r1, 0x3E - adds r1, r3 - mov r12, r1 - ldrb r2, [r1] - 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 - mov r1, r12 - strb r0, [r1] - ldrh r0, [r3, 0x32] - adds r0, 0x1 - strh r0, [r3, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bne _08114CB6 - adds r0, r3, 0 - bl move_anim_8072740 -_08114CB6: - pop {r0} - bx r0 - thumb_func_end sub_8114C4C - - thumb_func_start sub_8114CBC -sub_8114CBC: @ 8114CBC - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r1, r0, r1 - ldr r0, =0x0203841e - movs r3, 0 - ldrsh r0, [r0, r3] - cmp r0, 0 - bne _08114CE8 - ldr r0, =sub_8114CFC - b _08114CEA - .pool -_08114CE8: - ldr r0, =sub_8114EB4 -_08114CEA: - str r0, [r1] - ldr r1, [r1] - adds r0, r2, 0 - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8114CBC - - thumb_func_start sub_8114CFC -sub_8114CFC: @ 8114CFC - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bls _08114D16 - b _08114EAA -_08114D16: - lsls r0, 2 - ldr r1, =_08114D28 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08114D28: - .4byte _08114D3C - .4byte _08114DC4 - .4byte _08114DD4 - .4byte _08114E78 - .4byte _08114E8C -_08114D3C: - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x1C] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x1E] - cmp r0, 0x1 - bne _08114D70 - ldr r0, =0x02022e18 - ldrh r0, [r0] - strh r0, [r4, 0x20] - ldr r0, =0x02022e1a - b _08114D78 - .pool -_08114D70: - ldr r0, =0x02022e1c - ldrh r0, [r0] - strh r0, [r4, 0x20] - ldr r0, =0x02022e1e -_08114D78: - ldrh r0, [r0] - strh r0, [r4, 0x22] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl sub_80A6190 - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - subs r1, 0x20 - strh r1, [r4, 0x24] - adds r0, 0x20 - strh r0, [r4, 0x26] - cmp r1, 0 - bge _08114D9A - movs r0, 0 - strh r0, [r4, 0x24] -_08114D9A: - ldr r2, =0x02020630 - movs r3, 0x1C - ldrsh r1, [r4, r3] - 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] - b _08114E7E - .pool -_08114DC4: - ldrb r0, [r4, 0x1E] - movs r2, 0x24 - ldrsh r1, [r4, r2] - movs r3, 0x26 - ldrsh r2, [r4, r3] - bl sub_81150E0 - b _08114E7E -_08114DD4: - ldrh r0, [r4, 0xC] - adds r0, 0x6 - movs r1, 0x7F - ands r0, r1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x10] - adds r0, 0x1 - strh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _08114DF6 - movs r0, 0 - strh r0, [r4, 0x10] - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] -_08114DF6: - ldr r1, =gUnknown_08329F40 - movs r2, 0xC - ldrsh r0, [r4, r2] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 20 - ldrh r3, [r4, 0xE] - adds r2, r0, r3 - strh r2, [r4, 0x12] - movs r1, 0x1E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _08114E20 - ldr r1, =0x02022e1a - b _08114E22 - .pool -_08114E20: - ldr r1, =0x02022e1e -_08114E22: - ldrh r0, [r4, 0x22] - subs r0, r2 - strh r0, [r1] - movs r2, 0x12 - ldrsh r0, [r4, r2] - cmp r0, 0x3F - ble _08114EAA - ldrh r0, [r4, 0x24] - movs r1, 0x78 - subs r2, r1, r0 - strh r2, [r4, 0x12] - movs r3, 0x1E - ldrsh r0, [r4, r3] - cmp r0, 0x1 - bne _08114E4C - ldr r1, =0x02022e1a - b _08114E4E - .pool -_08114E4C: - ldr r1, =0x02022e1e -_08114E4E: - ldrh r0, [r4, 0x22] - subs r0, r2 - strh r0, [r1] - ldr r2, =0x02020630 - movs r1, 0x1C - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r2, [r1, 0x20] - movs r3, 0x88 - lsls r3, 1 - adds r0, r3, 0 - subs r0, r2 - strh r0, [r1, 0x24] - b _08114E7E - .pool -_08114E78: - ldr r1, =0x02039b28 - movs r0, 0x3 - strb r0, [r1, 0x15] -_08114E7E: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _08114EAA - .pool -_08114E8C: - adds r0, r2, 0 - bl move_anim_task_del - ldr r2, =0x02020630 - movs r0, 0x1C - ldrsh r1, [r4, 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] -_08114EAA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8114CFC - - thumb_func_start sub_8114EB4 -sub_8114EB4: @ 8114EB4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r3, r1, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r3] - movs r4, 0 - strh r4, [r1, 0x24] - strh r4, [r1, 0x26] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08114F00 - ldr r0, =0x02022e1a - b _08114F02 - .pool -_08114F00: - ldr r0, =0x02022e1e -_08114F02: - strh r4, [r0] - adds r0, r5, 0 - bl move_anim_task_del - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8114EB4 - - thumb_func_start sub_8114F14 -sub_8114F14: @ 8114F14 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r1, r0, r1 - ldr r0, =0x0203841e - movs r3, 0 - ldrsh r0, [r0, r3] - cmp r0, 0 - bne _08114F40 - ldr r0, =sub_8114F54 - b _08114F42 - .pool -_08114F40: - ldr r0, =sub_8114FD8 -_08114F42: - str r0, [r1] - ldr r1, [r1] - adds r0, r2, 0 - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8114F14 - - thumb_func_start sub_8114F54 -sub_8114F54: @ 8114F54 - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r5, [r4, r0] - cmp r5, 0 - beq _08114F78 - cmp r5, 0x1 - beq _08114FCC - b _08114FD2 - .pool -_08114F78: - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x1C] - ldr r3, =0x02020630 - movs r0, 0x1C - 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, 0x1C - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r5, [r0, 0x24] - movs r1, 0x1C - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r2, [r1, 0x22] - movs r0, 0xA0 - subs r0, r2 - strh r0, [r1, 0x26] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _08114FD2 - .pool -_08114FCC: - adds r0, r2, 0 - bl move_anim_task_del -_08114FD2: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8114F54 - - thumb_func_start sub_8114FD8 -sub_8114FD8: @ 8114FD8 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bhi _081150DA - lsls r0, 2 - ldr r1, =_08115004 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08115004: - .4byte _08115018 - .4byte _0811506C - .4byte _0811507A - .4byte _08115094 - .4byte _081150D4 -_08115018: - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x1C] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x1E] - cmp r0, 0x1 - bne _08115044 - ldr r0, =0x02022e18 - b _08115046 - .pool -_08115044: - ldr r0, =0x02022e1c -_08115046: - ldrh r0, [r0] - strh r0, [r4, 0x20] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl sub_80A6190 - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - subs r1, 0x20 - strh r1, [r4, 0x24] - adds r0, 0x20 - strh r0, [r4, 0x26] - b _081150C2 - .pool -_0811506C: - ldrb r0, [r4, 0x1E] - movs r1, 0x26 - ldrsh r2, [r4, r1] - movs r1, 0 - bl sub_81150E0 - b _081150C2 -_0811507A: - ldr r2, =0x02020630 - movs r0, 0x1C - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x60 - strh r1, [r0, 0x26] - b _081150C2 - .pool -_08115094: - ldr r2, =0x02020630 - movs r0, 0x1C - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x26] - subs r1, 0x8 - strh r1, [r0, 0x26] - movs r0, 0x1C - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x26 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _081150DA - ldr r1, =0x02039b28 - movs r0, 0x3 - strb r0, [r1, 0x15] -_081150C2: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _081150DA - .pool -_081150D4: - adds r0, r2, 0 - bl move_anim_task_del -_081150DA: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8114FD8 - - thumb_func_start sub_81150E0 -sub_81150E0: @ 81150E0 - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r4, r2, 16 - cmp r0, 0x1 - bne _08115104 - ldr r0, =0x02022e18 - ldrh r3, [r0] - ldr r0, =0x04000014 - b _0811510A - .pool -_08115104: - ldr r0, =0x02022e1c - ldrh r3, [r0] - ldr r0, =0x04000018 -_0811510A: - str r0, [sp] - lsls r0, r1, 16 - cmp r0, 0 - bge _08115114 - movs r1, 0 -_08115114: - lsls r2, r1, 16 - lsls r0, r4, 16 - asrs r4, r0, 16 - cmp r2, r0 - bge _08115140 - ldr r5, =0x02038c28 - movs r0, 0xF0 - lsls r0, 3 - adds r6, r5, r0 -_08115126: - asrs r2, 16 - lsls r1, r2, 1 - adds r0, r1, r5 - strh r3, [r0] - adds r1, r6 - strh r3, [r1] - adds r2, 0x1 - lsls r2, 16 - lsrs r1, r2, 16 - lsls r2, r1, 16 - asrs r0, r2, 16 - cmp r0, r4 - blt _08115126 -_08115140: - lsls r1, 16 - asrs r0, r1, 16 - cmp r0, 0x9F - bgt _0811516E - ldr r4, =0x02038c28 - lsls r0, r3, 16 - asrs r0, 16 - adds r3, r0, 0 - adds r3, 0xF0 - movs r0, 0xF0 - lsls r0, 3 - adds r5, r4, r0 -_08115158: - asrs r2, r1, 16 - lsls r1, r2, 1 - adds r0, r1, r4 - strh r3, [r0] - adds r1, r5 - strh r3, [r1] - adds r2, 0x1 - lsls r1, r2, 16 - asrs r0, r1, 16 - cmp r0, 0x9F - ble _08115158 -_0811516E: - ldr r0, =0xa2600001 - str r0, [sp, 0x4] - mov r1, sp - movs r2, 0 - movs r0, 0x1 - strb r0, [r1, 0x8] - mov r0, sp - strb r2, [r0, 0x9] - ldr r0, [sp] - ldr r1, [sp, 0x4] - ldr r2, [sp, 0x8] - bl sub_80BA038 - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81150E0 - - thumb_func_start sub_81151A0 -sub_81151A0: @ 81151A0 - push {r4-r7,lr} - adds r5, r0, 0 - ldr r0, =0x0203841e - movs r2, 0 - ldrsh r1, [r0, r2] - adds r7, r0, 0 - cmp r1, 0 - bne _081151BC - ldr r0, =0x02038436 - b _081151BE - .pool -_081151BC: - ldr r0, =0x02038437 -_081151BE: - ldrb r4, [r0] - movs r6, 0x18 - adds r1, r7, 0 - movs r2, 0x2 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - bne _081151DA - negs r0, r6 - lsls r0, 16 - lsrs r6, r0, 16 - movs r2, 0x4 - ldrsh r0, [r1, r2] - negs r0, r0 - strh r0, [r1, 0x4] -_081151DA: - adds r0, r4, 0 - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, r6 - strh r0, [r5, 0x20] - adds r0, r4, 0 - bl sub_80A6190 - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x1E - strh r0, [r5, 0x22] - ldrh r1, [r7, 0xA] - strh r1, [r5, 0x2E] - ldrh r1, [r7, 0x4] - ldrh r2, [r5, 0x20] - adds r1, r2 - strh r1, [r5, 0x32] - ldrh r1, [r7, 0x6] - adds r0, r1 - strh r0, [r5, 0x36] - ldrh r0, [r7, 0x8] - strh r0, [r5, 0x38] - adds r0, r5, 0 - bl sub_80A68D4 - ldr r0, =sub_8115228 - str r0, [r5, 0x1C] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81151A0 - - thumb_func_start sub_8115228 -sub_8115228: @ 8115228 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _0811523C - adds r0, r4, 0 - bl move_anim_8072740 -_0811523C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8115228 - - thumb_func_start sub_8115244 -sub_8115244: @ 8115244 - push {r4-r6,lr} - adds r6, r0, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08115260 - ldr r0, =0x02038436 - b _08115262 - .pool -_08115260: - ldr r0, =0x02038437 -_08115262: - ldrb r5, [r0] - adds r0, r5, 0 - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x0000fff0 - adds r0, r2 - ldr r4, =0x0203841e - movs r3, 0x2 - ldrsh r1, [r4, r3] - lsls r1, 5 - adds r0, r1 - strh r0, [r6, 0x20] - adds r0, r5, 0 - bl sub_80A6190 - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x20 - strh r0, [r6, 0x22] - ldrh r2, [r6, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - movs r3, 0x2 - ldrsh r0, [r4, r3] - lsls r0, 3 - adds r1, r0 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r6, 0x4] - ldr r1, =move_anim_8072740 - adds r0, r6, 0 - bl oamt_set_x3A_32 - ldrh r0, [r4, 0x4] - strh r0, [r6, 0x2E] - ldr r0, =sub_80A64B0 - str r0, [r6, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8115244 - - thumb_func_start sub_81152DC -sub_81152DC: @ 81152DC - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - ldr r0, =0x0203841e - ldrh r2, [r0, 0x2] - movs r3, 0x2 - ldrsh r1, [r0, r3] - adds r6, r0, 0 - cmp r1, 0 - beq _08115308 - adds r0, r2, 0x3 - b _08115314 - .pool -_08115308: - ldr r0, =0x02038408 - ldrh r0, [r0] - movs r1, 0xA - bl __udivsi3 - adds r0, 0x3 -_08115314: - strh r0, [r4, 0x26] - strh r0, [r4, 0x24] - adds r1, r6, 0 - ldrh r0, [r1, 0x4] - strh r0, [r4, 0xE] - movs r2, 0 - ldrsh r0, [r1, r2] - cmp r0, 0x4 - beq _08115340 - cmp r0, 0x5 - bne _08115380 - ldr r0, =0x02022e20 - ldrh r0, [r0] - strh r0, [r4, 0x22] - ldr r0, =sub_81153AC - b _0811539E - .pool -_08115340: - movs r0, 0 - strh r0, [r4, 0x22] - movs r5, 0 -_08115346: - lsls r0, r5, 24 - lsrs r0, 24 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _08115370 - movs r3, 0x22 - ldrsh r0, [r4, r3] - adds r0, 0x9 - lsls r0, 1 - adds r1, r4, 0 - adds r1, 0x8 - adds r1, r0 - ldr r0, =0x020241e4 - adds r0, r5, r0 - ldrb r0, [r0] - strh r0, [r1] - ldrh r0, [r4, 0x22] - adds r0, 0x1 - strh r0, [r4, 0x22] -_08115370: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x3 - bls _08115346 - b _0811539C - .pool -_08115380: - ldrb r0, [r6] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x1A] - cmp r0, 0xFF - bne _08115398 - adds r0, r5, 0 - bl move_anim_task_del - b _081153A0 -_08115398: - movs r0, 0x1 - strh r0, [r4, 0x22] -_0811539C: - ldr r0, =sub_81154A4 -_0811539E: - str r0, [r4] -_081153A0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81152DC - - thumb_func_start sub_81153AC -sub_81153AC: @ 81153AC - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r3, r0, r1 - movs r0, 0x8 - ldrsh r1, [r3, r0] - cmp r1, 0x1 - beq _08115430 - cmp r1, 0x1 - bgt _081153D4 - cmp r1, 0 - beq _081153DA - b _0811549C - .pool -_081153D4: - cmp r1, 0x2 - beq _08115490 - b _0811549C -_081153DA: - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0811549C - strh r1, [r3, 0xA] - ldrh r1, [r3, 0xC] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08115404 - ldr r1, =0x02022e20 - ldrh r0, [r3, 0x26] - ldrh r2, [r3, 0x22] - adds r0, r2 - strh r0, [r1] - b _0811540E - .pool -_08115404: - ldr r0, =0x02022e20 - ldrh r1, [r3, 0x22] - ldrh r2, [r3, 0x26] - subs r1, r2 - strh r1, [r0] -_0811540E: - ldrh r0, [r3, 0xC] - adds r0, 0x1 - strh r0, [r3, 0xC] - lsls r0, 16 - asrs r0, 16 - movs r2, 0xE - ldrsh r1, [r3, r2] - cmp r0, r1 - bne _0811549C - movs r0, 0 - strh r0, [r3, 0xC] - ldrh r0, [r3, 0x24] - subs r0, 0x1 - strh r0, [r3, 0x24] - b _08115484 - .pool -_08115430: - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0811549C - movs r0, 0 - strh r0, [r3, 0xA] - ldrh r0, [r3, 0xC] - ands r1, r0 - cmp r1, 0 - bne _0811545C - ldr r1, =0x02022e20 - ldrh r0, [r3, 0x24] - ldrh r2, [r3, 0x22] - adds r0, r2 - strh r0, [r1] - b _08115466 - .pool -_0811545C: - ldr r0, =0x02022e20 - ldrh r1, [r3, 0x22] - ldrh r2, [r3, 0x24] - subs r1, r2 - strh r1, [r0] -_08115466: - ldrh r0, [r3, 0xC] - adds r0, 0x1 - strh r0, [r3, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0811549C - movs r0, 0 - strh r0, [r3, 0xC] - ldrh r0, [r3, 0x24] - subs r0, 0x1 - strh r0, [r3, 0x24] - lsls r0, 16 - cmp r0, 0 - bne _0811549C -_08115484: - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] - b _0811549C - .pool -_08115490: - ldr r1, =0x02022e20 - ldrh r0, [r3, 0x22] - strh r0, [r1] - adds r0, r2, 0 - bl move_anim_task_del -_0811549C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81153AC - - thumb_func_start sub_81154A4 -sub_81154A4: @ 81154A4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r5, [r4, r0] - cmp r5, 0x1 - beq _08115504 - cmp r5, 0x1 - bgt _081154CC - cmp r5, 0 - beq _081154D2 - b _0811557E - .pool -_081154CC: - cmp r5, 0x2 - beq _08115540 - b _0811557E -_081154D2: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0811557E - strh r5, [r4, 0xA] - adds r0, r4, 0 - bl sub_8115588 - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - movs r2, 0xE - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _0811557E - strh r5, [r4, 0xC] - ldrh r0, [r4, 0x24] - subs r0, 0x1 - strh r0, [r4, 0x24] - b _08115538 -_08115504: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - movs r5, 0 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0811557E - strh r5, [r4, 0xA] - adds r0, r4, 0 - bl sub_8115588 - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0811557E - strh r5, [r4, 0xC] - ldrh r0, [r4, 0x24] - subs r0, 0x1 - strh r0, [r4, 0x24] - lsls r0, 16 - cmp r0, 0 - bne _0811557E -_08115538: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0811557E -_08115540: - movs r2, 0 - movs r7, 0x22 - ldrsh r0, [r4, r7] - cmp r2, r0 - bge _08115578 - ldr r0, =0x02020630 - mov r12, r0 - adds r5, r4, 0 - adds r5, 0x8 - movs r6, 0 -_08115554: - adds r0, r2, 0 - adds r0, 0x9 - lsls r0, 1 - adds r0, r5, r0 - movs r7, 0 - ldrsh r1, [r0, r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r12 - strh r6, [r0, 0x24] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - movs r1, 0x22 - ldrsh r0, [r4, r1] - cmp r2, r0 - blt _08115554 -_08115578: - adds r0, r3, 0 - bl move_anim_task_del -_0811557E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81154A4 - - thumb_func_start sub_8115588 -sub_8115588: @ 8115588 - push {r4-r7,lr} - adds r3, r0, 0 - ldrh r1, [r3, 0xC] - movs r4, 0x1 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - bne _081155B0 - movs r0, 0x24 - ldrsh r1, [r3, r0] - lsrs r0, r1, 31 - adds r1, r0 - asrs r1, 1 - ldrh r2, [r3, 0x24] - adds r0, r4, 0 - ands r0, r2 - adds r1, r0 - lsls r1, 16 - lsrs r4, r1, 16 - b _081155C0 -_081155B0: - movs r1, 0x24 - ldrsh r0, [r3, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - negs r0, r0 - lsls r0, 16 - lsrs r4, r0, 16 -_081155C0: - movs r2, 0 - movs r7, 0x22 - ldrsh r0, [r3, r7] - cmp r2, r0 - bge _081155F4 - ldr r6, =0x02020630 - adds r5, r3, 0 - adds r5, 0x8 -_081155D0: - adds r0, r2, 0 - adds r0, 0x9 - lsls r0, 1 - adds r0, r5, r0 - movs r7, 0 - ldrsh r1, [r0, r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r4, [r0, 0x24] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - movs r1, 0x22 - ldrsh r0, [r3, r1] - cmp r2, r0 - blt _081155D0 -_081155F4: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8115588 - - thumb_func_start sub_8115600 -sub_8115600: @ 8115600 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - ldr r3, =0x0203841e - movs r2, 0 - ldr r0, =0x02038408 - ldrh r0, [r0] - cmp r0, 0x63 - bls _08115614 - movs r2, 0x1 -_08115614: - strh r2, [r3, 0x1E] - adds r0, r1, 0 - bl move_anim_task_del - pop {r0} - bx r0 - .pool - thumb_func_end sub_8115600 - - thumb_func_start sub_8115628 -sub_8115628: @ 8115628 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r2, =0x0203841e - ldrh r1, [r2] - movs r0, 0x1 - ands r0, r1 - adds r6, r2, 0 - cmp r0, 0 - beq _08115648 - ldr r0, =0x02038437 - b _0811564A - .pool -_08115648: - ldr r0, =0x02038436 -_0811564A: - ldrb r0, [r0] - adds r5, r0, 0 - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0x1 - ble _0811565A - movs r0, 0x2 - eors r5, r0 -_0811565A: - ldr r0, =sub_81156D0 - ldrb r1, [r6, 0x2] - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - adds r0, r5, 0 - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x20 - subs r1, r0 - ldr r2, =0x000001ff - adds r0, r2, 0 - ands r1, r0 - strh r1, [r4, 0xA] - adds r0, r5, 0 - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x40 - subs r1, r0 - movs r0, 0xFF - ands r1, r0 - strh r1, [r4, 0xC] - ldr r2, =0x02022e20 - ldrh r0, [r4, 0xA] - strh r0, [r2] - ldr r0, =0x02022e22 - strh r1, [r0] - ldrh r0, [r6, 0x4] - strh r0, [r4, 0xE] - adds r0, r7, 0 - bl move_anim_task_del - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8115628 - - thumb_func_start sub_81156D0 -sub_81156D0: @ 81156D0 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r2, r0, r1 - ldr r0, =0x0203841e - movs r4, 0xE - ldrsh r1, [r0, r4] - movs r4, 0xE - ldrsh r0, [r2, r4] - cmp r1, r0 - bne _08115710 - ldr r0, =0x02022e20 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e22 - strh r1, [r0] - adds r0, r3, 0 - bl DestroyTask - b _0811571C - .pool -_08115710: - ldr r1, =0x02022e20 - ldrh r0, [r2, 0xA] - strh r0, [r1] - ldr r1, =0x02022e22 - ldrh r0, [r2, 0xC] - strh r0, [r1] -_0811571C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81156D0 - - thumb_func_start sub_811572C -sub_811572C: @ 811572C - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x0203841e - ldrh r0, [r5] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r5, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldrh r0, [r5, 0x4] - strh r0, [r4, 0x2E] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _0811576C - ldrh r0, [r5, 0x6] - negs r0, r0 - strh r0, [r4, 0x30] - movs r0, 0x1 - strh r0, [r4, 0x36] - b _0811577A - .pool -_0811576C: - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x30] - strh r1, [r4, 0x36] - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnim -_0811577A: - ldr r0, =0x0203841e - ldrh r0, [r0, 0x8] - strh r0, [r4, 0x34] - ldr r1, =sub_8115798 - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811572C - - thumb_func_start sub_8115798 -sub_8115798: @ 8115798 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r1, 0x1E - bl cosine - strh r0, [r4, 0x24] - movs r2, 0x2E - ldrsh r0, [r4, r2] - movs r1, 0xA - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x2E] - cmp r0, 0x7F - bhi _081157CA - ldrb r0, [r4, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r0 - movs r0, 0x4 - orrs r1, r0 - strb r1, [r4, 0x5] - b _081157D2 -_081157CA: - ldrb r0, [r4, 0x5] - movs r1, 0xC - orrs r0, r1 - strb r0, [r4, 0x5] -_081157D2: - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x2E] - adds r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x34 - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _081157F6 - adds r0, r4, 0 - bl move_anim_8072740 -_081157F6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8115798 - - thumb_func_start sub_81157FC -sub_81157FC: @ 81157FC - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - ldr r4, =0x0203841e - movs r1, 0 - ldrsh r0, [r4, r1] - bl sub_811583C - movs r1, 0x2 - ldrsb r1, [r4, r1] - ldrb r2, [r4, 0x4] - ldrb r3, [r4, 0x6] - ldrh r4, [r4, 0x8] - str r4, [sp] - bl pal_fade_maybe - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_8115884 - str r0, [r5, 0x1C] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81157FC - - thumb_func_start sub_811583C -sub_811583C: @ 811583C - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0xC - lsls r0, 16 - lsrs r0, 16 - movs r4, 0x1 - mov r8, r0 - mov r1, r8 - ands r1, r4 - mov r8, r1 - lsls r0, 16 - asrs r1, r0, 17 - ands r1, r4 - asrs r2, r0, 18 - ands r2, r4 - asrs r3, r0, 19 - ands r3, r4 - asrs r6, r0, 20 - ands r6, r4 - asrs r5, r0, 21 - ands r5, r4 - asrs r0, 22 - ands r0, r4 - str r6, [sp] - str r5, [sp, 0x4] - str r0, [sp, 0x8] - mov r0, r8 - bl sub_80A75AC - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_811583C - - thumb_func_start sub_8115884 -sub_8115884: @ 8115884 - push {lr} - adds r2, r0, 0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0811589A - adds r0, r2, 0 - bl move_anim_8072740 -_0811589A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8115884 - - thumb_func_start sub_81158A4 -sub_81158A4: @ 81158A4 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x0203841e - ldrh r0, [r4, 0x2] - strh r0, [r5, 0x2E] - strh r0, [r5, 0x30] - ldrh r0, [r4, 0x4] - strh r0, [r5, 0x32] - ldrh r0, [r4, 0x6] - strh r0, [r5, 0x34] - ldrh r0, [r4, 0x8] - strh r0, [r5, 0x36] - ldrh r0, [r4, 0xA] - strh r0, [r5, 0x38] - ldrh r0, [r4, 0xC] - strh r0, [r5, 0x3A] - ldrh r0, [r4] - strh r0, [r5, 0x3C] - movs r1, 0x3C - ldrsh r0, [r5, r1] - bl sub_811583C - ldrb r1, [r4, 0x8] - ldrh r2, [r4, 0x6] - bl sub_80A2A20 - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_81158F8 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81158A4 - - thumb_func_start sub_81158F8 -sub_81158F8: @ 81158F8 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x2E] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _0811590C - subs r0, r1, 0x1 - strh r0, [r4, 0x2E] - b _0811597C -_0811590C: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0811597C - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08115930 - ldr r0, =sub_8115984 - str r0, [r4, 0x1C] - b _0811597C - .pool -_08115930: - movs r2, 0x3C - ldrsh r0, [r4, r2] - bl sub_811583C - adds r3, r0, 0 - ldrh r1, [r4, 0x30] - movs r0, 0x80 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - beq _08115956 - ldrh r1, [r4, 0x36] - lsls r1, 24 - lsrs r1, 24 - ldrh r2, [r4, 0x34] - adds r0, r3, 0 - bl sub_80A2A20 - b _08115964 -_08115956: - ldrh r1, [r4, 0x3A] - lsls r1, 24 - lsrs r1, 24 - ldrh r2, [r4, 0x38] - adds r0, r3, 0 - bl sub_80A2A20 -_08115964: - ldrh r0, [r4, 0x30] - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - eors r0, r1 - strh r0, [r4, 0x30] - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x32] - subs r0, 0x1 - strh r0, [r4, 0x32] -_0811597C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81158F8 - - thumb_func_start sub_8115984 -sub_8115984: @ 8115984 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081159AA - movs r1, 0x3C - ldrsh r0, [r4, r1] - bl sub_811583C - movs r1, 0 - movs r2, 0 - bl sub_80A2A20 - adds r0, r4, 0 - bl move_anim_8072740 -_081159AA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8115984 - - thumb_func_start sub_81159B4 -sub_81159B4: @ 81159B4 - push {r4,lr} - adds r4, r0, 0 - ldr r1, =0x0203841e - ldrh r0, [r1] - ldrh r2, [r4, 0x20] - adds r0, r2 - movs r2, 0 - strh r0, [r4, 0x20] - ldrh r0, [r1, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - strh r2, [r4, 0x2E] - movs r0, 0xA - strh r0, [r4, 0x30] - movs r0, 0x8 - strh r0, [r4, 0x32] - movs r0, 0x28 - strh r0, [r4, 0x34] - movs r0, 0x70 - strh r0, [r4, 0x36] - strh r2, [r4, 0x38] - ldr r1, =move_anim_8074EE0 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r1, =sub_80A634C - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81159B4 - - thumb_func_start sub_8115A04 -sub_8115A04: @ 8115A04 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - ldr r3, =0x0203841e - ldrh r1, [r3] - movs r5, 0 - strh r1, [r4, 0x8] - ldrh r1, [r3, 0x2] - strh r1, [r4, 0xA] - ldrh r1, [r3, 0x4] - strh r1, [r4, 0xC] - ldrh r1, [r3, 0x6] - strh r1, [r4, 0xE] - ldrh r2, [r3, 0x8] - strh r2, [r4, 0x10] - ldrh r1, [r3, 0xA] - strh r1, [r4, 0x12] - strh r5, [r4, 0x18] - lsls r2, 24 - lsrs r2, 24 - movs r1, 0 - bl sub_8115A54 - ldr r0, =sub_8115AA4 - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8115A04 - - thumb_func_start sub_8115A54 -sub_8115A54: @ 8115A54 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - bl sub_811583C - movs r1, 0xA - ldrsb r1, [r4, r1] - ldrh r2, [r4, 0x12] - str r2, [sp] - adds r2, r5, 0 - adds r3, r6, 0 - bl pal_fade_maybe - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x18] - movs r1, 0x1 - eors r0, r1 - strh r0, [r4, 0x18] - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8115A54 - - thumb_func_start sub_8115AA4 -sub_8115AA4: @ 8115AA4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r3, r0, 24 - adds r4, r3, 0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08115B06 - ldr r1, =0x03005e00 - lsls r2, r3, 2 - adds r0, r2, r3 - lsls r0, 3 - adds r3, r0, r1 - movs r5, 0xC - ldrsh r0, [r3, r5] - adds r6, r1, 0 - adds r5, r2, 0 - cmp r0, 0 - ble _08115B00 - movs r1, 0x18 - ldrsh r0, [r3, r1] - cmp r0, 0 - bne _08115AE4 - ldrb r1, [r3, 0xE] - ldrb r2, [r3, 0x10] - b _08115AE8 - .pool -_08115AE4: - ldrb r1, [r3, 0x10] - ldrb r2, [r3, 0xE] -_08115AE8: - adds r0, r5, r4 - lsls r0, 3 - adds r0, r6 - movs r3, 0xC - ldrsh r0, [r0, r3] - cmp r0, 0x1 - bne _08115AF8 - movs r2, 0 -_08115AF8: - adds r0, r4, 0 - bl sub_8115A54 - b _08115B06 -_08115B00: - adds r0, r4, 0 - bl move_anim_task_del -_08115B06: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8115AA4 - - thumb_func_start sub_8115B0C -sub_8115B0C: @ 8115B0C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - ldr r3, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r3 - ldr r2, =0x0203841e - ldrh r1, [r2] - strh r1, [r0, 0x8] - ldrh r1, [r2, 0x2] - strh r1, [r0, 0xA] - ldrh r1, [r2, 0x4] - strh r1, [r0, 0xC] - ldrh r1, [r2, 0x6] - strh r1, [r0, 0xE] - ldrh r1, [r2, 0x8] - strh r1, [r0, 0x10] - ldrh r1, [r2, 0xA] - strh r1, [r0, 0x12] - strh r5, [r0, 0x18] - movs r4, 0 - ldr r0, =0x0202406c - ldrb r1, [r0] - mov r9, r3 - mov r8, r2 - cmp r5, r1 - bge _08115B74 - ldr r0, =0x02038436 - ldrb r3, [r0] - ldr r7, =0x02038437 - movs r0, 0x1 - mov r12, r0 - adds r2, r1, 0 -_08115B5A: - cmp r4, r3 - beq _08115B6E - ldrb r1, [r7] - cmp r4, r1 - beq _08115B6E - adds r1, r4, 0 - adds r1, 0x10 - mov r0, r12 - lsls r0, r1 - orrs r5, r0 -_08115B6E: - adds r4, 0x1 - cmp r4, r2 - blt _08115B5A -_08115B74: - mov r2, r8 - movs r1, 0 - ldrsh r0, [r2, r1] - cmp r0, 0x1 - bne _08115B82 - movs r0, 0xE - orrs r5, r0 -_08115B82: - lsls r4, r6, 2 - adds r4, r6 - lsls r4, 3 - add r4, r9 - lsrs r0, r5, 16 - strh r0, [r4, 0x1A] - movs r0, 0xFF - ands r5, r0 - strh r5, [r4, 0x1C] - ldrb r2, [r4, 0x10] - adds r0, r6, 0 - movs r1, 0 - bl sub_8115BC8 - ldr r0, =sub_8115C18 - str r0, [r4] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8115B0C - - thumb_func_start sub_8115BC8 -sub_8115BC8: @ 8115BC8 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r1, 0 - adds r3, r2, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r3, 24 - lsrs r3, 24 - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - ldrh r0, [r4, 0x1A] - lsls r0, 16 - ldrh r1, [r4, 0x1C] - orrs r0, r1 - movs r1, 0xA - ldrsb r1, [r4, r1] - ldrh r2, [r4, 0x12] - str r2, [sp] - adds r2, r5, 0 - bl pal_fade_maybe - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x18] - movs r1, 0x1 - eors r0, r1 - strh r0, [r4, 0x18] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8115BC8 - - thumb_func_start sub_8115C18 -sub_8115C18: @ 8115C18 - push {r4-r6,lr} - lsls r0, 24 - lsrs r3, r0, 24 - adds r4, r3, 0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08115C7A - ldr r1, =0x03005e00 - lsls r2, r3, 2 - adds r0, r2, r3 - lsls r0, 3 - adds r3, r0, r1 - movs r5, 0xC - ldrsh r0, [r3, r5] - adds r6, r1, 0 - adds r5, r2, 0 - cmp r0, 0 - ble _08115C74 - movs r1, 0x18 - ldrsh r0, [r3, r1] - cmp r0, 0 - bne _08115C58 - ldrb r1, [r3, 0xE] - ldrb r2, [r3, 0x10] - b _08115C5C - .pool -_08115C58: - ldrb r1, [r3, 0x10] - ldrb r2, [r3, 0xE] -_08115C5C: - adds r0, r5, r4 - lsls r0, 3 - adds r0, r6 - movs r3, 0xC - ldrsh r0, [r0, r3] - cmp r0, 0x1 - bne _08115C6C - movs r2, 0 -_08115C6C: - adds r0, r4, 0 - bl sub_8115BC8 - b _08115C7A -_08115C74: - adds r0, r4, 0 - bl move_anim_task_del -_08115C7A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8115C18 - - thumb_func_start sub_8115C80 -sub_8115C80: @ 8115C80 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - ldr r3, =0x0203841e - ldrh r1, [r3] - movs r5, 0 - strh r1, [r4, 0x8] - ldrh r1, [r3, 0x2] - strh r1, [r4, 0xA] - ldrh r1, [r3, 0x4] - strh r1, [r4, 0xC] - ldrh r1, [r3, 0x6] - strh r1, [r4, 0xE] - ldrh r2, [r3, 0x8] - strh r2, [r4, 0x10] - ldrh r1, [r3, 0xA] - strh r1, [r4, 0x12] - strh r5, [r4, 0x18] - lsls r2, 24 - lsrs r2, 24 - movs r1, 0 - bl sub_8115CD0 - ldr r0, =sub_8115D2C - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8115C80 - - thumb_func_start sub_8115CD0 -sub_8115CD0: @ 8115CD0 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - ldrh r0, [r4, 0x8] - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x10 - movs r2, 0x1 - lsls r2, r0 - movs r1, 0xA - ldrsb r1, [r4, r1] - ldrh r0, [r4, 0x12] - str r0, [sp] - adds r0, r2, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl pal_fade_maybe - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x18] - movs r1, 0x1 - eors r0, r1 - strh r0, [r4, 0x18] - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8115CD0 - - thumb_func_start sub_8115D2C -sub_8115D2C: @ 8115D2C - push {r4-r6,lr} - lsls r0, 24 - lsrs r3, r0, 24 - adds r4, r3, 0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08115D8E - ldr r1, =0x03005e00 - lsls r2, r3, 2 - adds r0, r2, r3 - lsls r0, 3 - adds r3, r0, r1 - movs r5, 0xC - ldrsh r0, [r3, r5] - adds r6, r1, 0 - adds r5, r2, 0 - cmp r0, 0 - ble _08115D88 - movs r1, 0x18 - ldrsh r0, [r3, r1] - cmp r0, 0 - bne _08115D6C - ldrb r1, [r3, 0xE] - ldrb r2, [r3, 0x10] - b _08115D70 - .pool -_08115D6C: - ldrb r1, [r3, 0x10] - ldrb r2, [r3, 0xE] -_08115D70: - adds r0, r5, r4 - lsls r0, 3 - adds r0, r6 - movs r3, 0xC - ldrsh r0, [r0, r3] - cmp r0, 0x1 - bne _08115D80 - movs r2, 0 -_08115D80: - adds r0, r4, 0 - bl sub_8115CD0 - b _08115D8E -_08115D88: - adds r0, r4, 0 - bl move_anim_task_del -_08115D8E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8115D2C - - thumb_func_start sub_8115D94 -sub_8115D94: @ 8115D94 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - ldr r5, =0x0203841e - ldrh r0, [r5, 0x2] - strh r0, [r4, 0x8] - ldrh r0, [r5, 0x2] - strh r0, [r4, 0xA] - ldrh r0, [r5, 0x4] - strh r0, [r4, 0xC] - ldrh r0, [r5, 0x6] - strh r0, [r4, 0xE] - ldrh r0, [r5, 0x8] - strh r0, [r4, 0x10] - ldrh r0, [r5, 0xA] - strh r0, [r4, 0x12] - ldrh r0, [r5, 0xC] - strh r0, [r4, 0x14] - ldrh r0, [r5] - strh r0, [r4, 0x16] - ldrh r0, [r5] - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x10 - movs r1, 0x1 - lsls r1, r0 - ldrb r3, [r5, 0x8] - ldrh r0, [r5, 0x6] - str r0, [sp] - adds r0, r1, 0 - movs r1, 0 - adds r2, r3, 0 - bl pal_fade_maybe - ldr r0, =sub_8115E00 - str r0, [r4] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8115D94 - - thumb_func_start sub_8115E00 -sub_8115E00: @ 8115E00 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r1, [r4, 0x8] - movs r2, 0x8 - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _08115E28 - subs r0, r1, 0x1 - strh r0, [r4, 0x8] - b _08115EAC - .pool -_08115E28: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08115EAC - movs r3, 0xC - ldrsh r0, [r4, r3] - cmp r0, 0 - bne _08115E4C - ldr r0, =sub_8115EB8 - str r0, [r4] - b _08115EAC - .pool -_08115E4C: - ldrh r0, [r4, 0x16] - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x10 - movs r2, 0x1 - lsls r2, r0 - ldrh r1, [r4, 0xA] - movs r0, 0x80 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - beq _08115E7A - ldrb r3, [r4, 0x10] - ldrh r0, [r4, 0xE] - str r0, [sp] - adds r0, r2, 0 - movs r1, 0 - adds r2, r3, 0 - bl pal_fade_maybe - b _08115E8A -_08115E7A: - ldrb r3, [r4, 0x14] - ldrh r0, [r4, 0x12] - str r0, [sp] - adds r0, r2, 0 - movs r1, 0 - adds r2, r3, 0 - bl pal_fade_maybe -_08115E8A: - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0xA] - movs r3, 0x80 - lsls r3, 1 - adds r2, r3, 0 - eors r0, r2 - strh r0, [r1, 0xA] - movs r2, 0xFF - ands r0, r2 - strh r0, [r1, 0x8] - ldrh r0, [r1, 0xC] - subs r0, 0x1 - strh r0, [r1, 0xC] -_08115EAC: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8115E00 - - thumb_func_start sub_8115EB8 -sub_8115EB8: @ 8115EB8 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _08115EFE - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x16] - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x10 - movs r1, 0x1 - lsls r1, r0 - str r5, [sp] - adds r0, r1, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl pal_fade_maybe - adds r0, r4, 0 - bl move_anim_task_del -_08115EFE: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8115EB8 - - thumb_func_start sub_8115F10 -sub_8115F10: @ 8115F10 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r2, 0 - ldr r0, =0x02038436 - ldrb r6, [r0] - ldr r0, =0x02038437 - ldrb r7, [r0] - ldr r4, =0x0203841e - ldrh r1, [r4] - movs r5, 0x80 - lsls r5, 1 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _08115F4A - str r2, [sp] - str r2, [sp, 0x4] - str r2, [sp, 0x8] - movs r0, 0x1 - movs r1, 0 - movs r3, 0 - bl sub_80A75AC - adds r2, r0, 0 -_08115F4A: - ldrh r1, [r4, 0x2] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _08115F5C - movs r0, 0x80 - lsls r0, 9 - lsls r0, r6 - orrs r2, r0 -_08115F5C: - ldrh r1, [r4, 0x4] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _08115F6E - movs r0, 0x80 - lsls r0, 9 - lsls r0, r7 - orrs r2, r0 -_08115F6E: - adds r0, r2, 0 - bl sub_80A2218 - mov r0, r8 - bl move_anim_task_del - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8115F10 - - thumb_func_start sub_8115F94 -sub_8115F94: @ 8115F94 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0 - ldr r1, =0x03005e00 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08115FD6 - ldr r1, =0x0203841e - ldrh r0, [r1] - strh r0, [r4, 0xC] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0xE] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x10] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0xA] - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x12] - ldrh r0, [r1, 0xA] - strh r0, [r4, 0x14] - ldrh r0, [r1, 0xC] - strh r0, [r4, 0x16] -_08115FD6: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - ldr r0, =0x02038436 - ldrb r0, [r0] - mov r9, r0 - ldr r0, =0x02038437 - ldrb r0, [r0] - mov r10, r0 - ldrh r1, [r4, 0xC] - movs r7, 0x80 - lsls r7, 1 - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _08115FF8 - ldr r5, =0x0000ffff -_08115FF8: - movs r6, 0x1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _08116028 - ldr r2, =0x02020630 - ldr r0, =0x03005d70 - add r0, r9 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x14 - adds r0, r2 - ldr r0, [r0] - ldrh r0, [r0, 0x2] - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - adds r1, r6, 0 - lsls r1, r0 - lsls r1, 16 - orrs r5, r1 -_08116028: - ldrh r1, [r4, 0xE] - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _0811603C - adds r0, r6, 0 - mov r2, r9 - lsls r0, r2 - lsls r0, 16 - orrs r5, r0 -_0811603C: - ldrh r1, [r4, 0x10] - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _08116050 - adds r0, r6, 0 - mov r1, r10 - lsls r0, r1 - lsls r0, 16 - orrs r5, r0 -_08116050: - movs r1, 0x12 - ldrsb r1, [r4, r1] - movs r2, 0x14 - ldrsb r2, [r4, r2] - movs r3, 0x16 - ldrsb r3, [r4, r3] - adds r0, r5, 0 - bl sub_80A2260 - movs r2, 0x8 - ldrsh r1, [r4, r2] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _0811607A - adds r0, r5, 0 - bl sub_80A2334 - mov r0, r8 - bl move_anim_task_del -_0811607A: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8115F94 - - thumb_func_start sub_81160A4 -sub_81160A4: @ 81160A4 - push {r4,lr} - adds r4, r0, 0 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r1, =0x0203841e - ldrh r0, [r1] - negs r0, r0 - strh r0, [r4, 0x2E] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x30] - strh r0, [r4, 0x32] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x34] - movs r2, 0x6 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - beq _081160EC - cmp r0, 0x1 - bgt _081160DC - cmp r0, 0 - beq _081160E2 - b _08116104 - .pool -_081160DC: - cmp r0, 0x2 - beq _081160F4 - b _08116104 -_081160E2: - ldr r1, =0x02022e20 - b _081160F6 - .pool -_081160EC: - ldr r1, =0x02022e22 - b _081160F6 - .pool -_081160F4: - ldr r1, =0x02021bbc -_081160F6: - adds r0, r4, 0 - bl oamt_set_x3A_32 - b _0811610C - .pool -_08116104: - ldr r1, =0x02021bbe - adds r0, r4, 0 - bl oamt_set_x3A_32 -_0811610C: - movs r0, 0x3A - ldrsh r1, [r4, r0] - movs r2, 0x3C - ldrsh r0, [r4, r2] - lsls r0, 16 - orrs r1, r0 - ldrh r0, [r1] - strh r0, [r4, 0x36] - ldr r0, =0x0203841e - ldrh r0, [r0, 0x6] - strh r0, [r4, 0x38] - subs r0, 0x2 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _08116130 - bl sub_81161F4 -_08116130: - ldr r0, =sub_8116148 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81160A4 - - thumb_func_start sub_8116148 -sub_8116148: @ 8116148 - push {r4-r7,lr} - adds r3, r0, 0 - ldrh r1, [r3, 0x34] - movs r2, 0x34 - ldrsh r0, [r3, r2] - cmp r0, 0 - ble _0811618A - subs r0, r1, 0x1 - strh r0, [r3, 0x34] - ldrh r1, [r3, 0x30] - movs r2, 0x30 - ldrsh r0, [r3, r2] - cmp r0, 0 - ble _0811616A - subs r0, r1, 0x1 - strh r0, [r3, 0x30] - b _081161E2 -_0811616A: - ldrh r0, [r3, 0x32] - strh r0, [r3, 0x30] - movs r0, 0x3A - ldrsh r1, [r3, r0] - movs r2, 0x3C - ldrsh r0, [r3, r2] - lsls r0, 16 - orrs r1, r0 - ldrh r0, [r3, 0x2E] - ldrh r2, [r1] - adds r0, r2 - strh r0, [r1] - ldrh r0, [r3, 0x2E] - negs r0, r0 - strh r0, [r3, 0x2E] - b _081161E2 -_0811618A: - movs r0, 0x3A - ldrsh r1, [r3, r0] - movs r2, 0x3C - ldrsh r0, [r3, r2] - lsls r0, 16 - orrs r1, r0 - ldrh r0, [r3, 0x36] - strh r0, [r1] - ldrh r0, [r3, 0x38] - subs r0, 0x2 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _081161DC - movs r4, 0 - ldr r5, =0x0202406c - ldrb r0, [r5] - cmp r4, r0 - bcs _081161DC - ldr r2, =0x02020630 - mov r12, r2 - ldr r6, =0x020241e4 - movs r7, 0x3 - negs r7, r7 -_081161BA: - adds r0, r4, r6 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r12 - adds r1, 0x3E - ldrb r2, [r1] - adds r0, r7, 0 - ands r0, r2 - strb r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldrb r0, [r5] - cmp r4, r0 - bcc _081161BA -_081161DC: - adds r0, r3, 0 - bl move_anim_8072740 -_081161E2: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8116148 - - thumb_func_start sub_81161F4 -sub_81161F4: @ 81161F4 - push {r4-r6,lr} - ldr r6, =0x02020630 - ldr r4, =0x020241e4 - ldr r5, =0x02038436 - ldrb r0, [r5] - adds r0, r4 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x3 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - ldr r3, =0x02038437 - ldrb r0, [r3] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - ldr r0, =0x0203841e - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0x2 - bne _0811627C - ldrb r0, [r5] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0] - ldrb r0, [r3] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - b _08116298 - .pool -_0811627C: - cmp r0, 0 - bne _08116284 - ldrb r0, [r5] - b _08116286 -_08116284: - ldrb r0, [r3] -_08116286: - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x2 -_08116298: - orrs r1, r2 - strb r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81161F4 - - thumb_func_start sub_81162A4 -sub_81162A4: @ 81162A4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - adds r2, r1 - ldr r3, =0x0203841e - ldrh r1, [r3] - strh r1, [r2, 0x8] - ldrh r1, [r3, 0x2] - strh r1, [r2, 0xA] - ldrh r1, [r3, 0x4] - strh r1, [r2, 0xC] - ldrh r1, [r3, 0x6] - strh r1, [r2, 0xE] - ldrh r1, [r3, 0x6] - strh r1, [r2, 0x18] - ldr r4, =0x02022e20 - ldrh r1, [r3] - strh r1, [r4] - ldr r4, =0x02022e22 - ldrh r1, [r3, 0x2] - strh r1, [r4] - ldr r1, =sub_81162F8 - str r1, [r2] - bl _call_via_r1 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81162A4 - - thumb_func_start sub_81162F8 -sub_81162F8: @ 81162F8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r3, r0, r1 - ldrh r2, [r3, 0xE] - movs r4, 0xE - ldrsh r0, [r3, r4] - mov r12, r1 - cmp r0, 0 - bne _0811637E - ldr r0, =0x02022e20 - ldrh r2, [r0] - movs r7, 0x8 - ldrsh r1, [r3, r7] - adds r6, r0, 0 - cmp r2, r1 - bne _08116330 - ldrh r0, [r3, 0x8] - negs r0, r0 - b _08116332 - .pool -_08116330: - ldrh r0, [r3, 0x8] -_08116332: - strh r0, [r6] - ldr r2, =0x02022e22 - ldrh r3, [r2] - lsls r1, r5, 2 - adds r0, r1, r5 - lsls r0, 3 - mov r7, r12 - adds r4, r0, r7 - movs r7, 0xA - ldrsh r0, [r4, r7] - cmn r3, r0 - bne _08116354 - movs r0, 0 - b _08116358 - .pool -_08116354: - ldrh r0, [r4, 0xA] - negs r0, r0 -_08116358: - strh r0, [r2] - adds r0, r1, r5 - lsls r0, 3 - add r0, r12 - ldrh r1, [r0, 0x18] - strh r1, [r0, 0xE] - ldrh r1, [r0, 0xC] - subs r1, 0x1 - strh r1, [r0, 0xC] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0 - bne _08116382 - strh r1, [r6] - strh r1, [r2] - adds r0, r5, 0 - bl move_anim_task_del - b _08116382 -_0811637E: - subs r0, r2, 0x1 - strh r0, [r3, 0xE] -_08116382: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81162F8 - - thumb_func_start sub_8116388 -sub_8116388: @ 8116388 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x0203841e - ldrb r1, [r4, 0x6] - bl StartObjectRotScalAnim - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081163AC - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A69CC - b _081163B4 - .pool -_081163AC: - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A6980 -_081163B4: - ldr r0, =sub_80A67BC - str r0, [r5, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r5, 0 - bl oamt_set_x3A_32 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8116388 - - thumb_func_start sub_81163D0 -sub_81163D0: @ 81163D0 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x0203841e - ldrb r1, [r4, 0x6] - bl StartObjectRotScalAnim - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081163F4 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A69CC - b _081163FC - .pool -_081163F4: - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A6980 -_081163FC: - ldr r0, =0x0203841e - ldrh r0, [r0, 0x8] - strh r0, [r5, 0x2E] - ldr r0, =sub_80A67BC - str r0, [r5, 0x1C] - ldr r1, =sub_810E2C8 - adds r0, r5, 0 - bl oamt_set_x3A_32 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81163D0 - - thumb_func_start sub_8116420 -sub_8116420: @ 8116420 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08116444 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _08116444 - ldr r1, =0x0203841e - ldrh r0, [r1, 0x2] - negs r0, r0 - strh r0, [r1, 0x2] -_08116444: - adds r0, r4, 0 - bl sub_8116388 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8116420 - - thumb_func_start sub_8116458 -sub_8116458: @ 8116458 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x0203841e - movs r0, 0x2 - ldrsh r1, [r5, r0] - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _08116474 - bl GenerateRandomNumber2 - movs r1, 0x3 - ands r1, r0 - strh r1, [r5, 0x2] -_08116474: - ldrb r1, [r5, 0x2] - adds r0, r4, 0 - bl StartObjectRotScalAnim - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _08116494 - adds r0, r4, 0 - movs r1, 0 - bl sub_80A69CC - b _0811649C - .pool -_08116494: - adds r0, r4, 0 - movs r1, 0 - bl sub_80A6980 -_0811649C: - bl GenerateRandomNumber2 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x30 - bl __umodsi3 - ldr r1, =0x0000ffe8 - adds r0, r1 - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - bl GenerateRandomNumber2 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x18 - bl __umodsi3 - ldr r1, =0x0000fff4 - adds r0, r1 - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - ldr r1, =move_anim_8074EE0 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A67BC - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8116458 - - thumb_func_start sub_81164F0 -sub_81164F0: @ 81164F0 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x0203841e - ldrb r0, [r5] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2E] - ldr r2, =0x02020630 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x24] - ldrh r0, [r0, 0x20] - adds r1, r0 - strh r1, [r4, 0x20] - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x26] - ldrh r0, [r0, 0x22] - adds r1, r0 - strh r1, [r4, 0x22] - ldrh r0, [r5, 0x2] - strh r0, [r4, 0x24] - ldrh r0, [r5, 0x4] - strh r0, [r4, 0x26] - ldrb r1, [r5, 0x6] - adds r0, r4, 0 - bl StartObjectRotScalAnim - ldr r1, =move_anim_8074EE0 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A67BC - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81164F0 - - thumb_func_start sub_8116560 -sub_8116560: @ 8116560 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0203841e - movs r1, 0x4 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0811657C - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80A69CC - b _08116584 - .pool -_0811657C: - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80A6980 -_08116584: - ldr r0, =0x0203841e - ldrh r0, [r0, 0x6] - strh r0, [r4, 0x2E] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A64B0 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8116560 - - thumb_func_start sub_81165A8 -sub_81165A8: @ 81165A8 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x0203841e - ldrb r1, [r4, 0x6] - bl StartObjectRotScalAnim - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081165CC - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A69CC - b _081165D4 - .pool -_081165CC: - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A6980 -_081165D4: - ldr r0, =sub_81165E4 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81165A8 - - thumb_func_start sub_81165E4 -sub_81165E4: @ 81165E4 - push {lr} - adds r3, r0, 0 - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - 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 - mov r1, r12 - strb r0, [r1] - ldrh r0, [r3, 0x2E] - adds r1, r0, 0x1 - strh r1, [r3, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - ble _0811661A - adds r0, r3, 0 - bl move_anim_8072740 -_0811661A: - pop {r0} - bx r0 - thumb_func_end sub_81165E4 - - thumb_func_start sub_8116620 -sub_8116620: @ 8116620 - push {r4-r6,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r4, =0x0203841e - movs r1, 0 - ldrsh r0, [r4, r1] - bl sub_811583C - adds r6, r0, 0 - ldrh r3, [r4] - lsls r3, 16 - asrs r0, r3, 23 - movs r4, 0x1 - ands r0, r4 - asrs r1, r3, 24 - ands r1, r4 - asrs r2, r3, 25 - ands r2, r4 - asrs r3, 26 - ands r3, r4 - bl sub_80A76C4 - orrs r6, r0 - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_8116874 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8116620 - - thumb_func_start sub_8116664 -sub_8116664: @ 8116664 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r7, r0, 24 - mov r1, sp - movs r0, 0xFF - strb r0, [r1, 0x1] - movs r0, 0x1 - bl sub_811583C - adds r5, r0, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x7 - bhi _0811670E - lsls r0, 2 - ldr r1, =_08116698 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08116698: - .4byte _081166BA - .4byte _081166C6 - .4byte _081166B8 - .4byte _081166C4 - .4byte _081166D4 - .4byte _081166EC - .4byte _081166F4 - .4byte _08116700 -_081166B8: - movs r5, 0 -_081166BA: - mov r0, sp - ldr r1, =0x02038436 - b _081166CA - .pool -_081166C4: - movs r5, 0 -_081166C6: - mov r0, sp - ldr r1, =0x02038437 -_081166CA: - ldrb r1, [r1] - strb r1, [r0] - b _0811670E - .pool -_081166D4: - mov r1, sp - ldr r0, =0x02038436 - ldrb r0, [r0] - strb r0, [r1] - ldr r0, =0x02038437 - ldrb r0, [r0] - strb r0, [r1, 0x1] - b _0811670E - .pool -_081166EC: - mov r1, sp - movs r0, 0xFF - strb r0, [r1] - b _0811670E -_081166F4: - movs r5, 0 - mov r2, sp - ldr r0, =0x02038436 - b _08116706 - .pool -_08116700: - movs r5, 0 - mov r2, sp - ldr r0, =0x02038437 -_08116706: - ldrb r0, [r0] - movs r1, 0x2 - eors r0, r1 - strb r0, [r2] -_0811670E: - movs r4, 0 - mov r6, sp -_08116712: - ldrb r0, [r6] - cmp r4, r0 - beq _0811673C - ldrb r0, [r6, 0x1] - cmp r4, r0 - beq _0811673C - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _0811673C - adds r0, r4, 0 - bl sub_80A77AC - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x80 - lsls r1, 9 - lsls r1, r0 - orrs r5, r1 -_0811673C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _08116712 - adds r0, r7, 0 - adds r1, r5, 0 - bl sub_8116874 - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8116664 - - thumb_func_start sub_811675C -sub_811675C: @ 811675C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - bl sub_811583C - adds r2, r0, 0 - ldr r0, =0x02022ff0 - ldrb r0, [r0] - cmp r0, 0x9 - bhi _08116832 - lsls r0, 2 - ldr r1, =_0811678C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0811678C: - .4byte _081167B4 - .4byte _081167C4 - .4byte _081167D0 - .4byte _081167E0 - .4byte _081167EC - .4byte _081167FC - .4byte _0811680C - .4byte _0811681C - .4byte _0811682C - .4byte _0811682C -_081167B4: - ldr r1, =0x0203841e - ldr r0, =0x00000b0c - b _08116830 - .pool -_081167C4: - ldr r1, =0x0203841e - movs r0, 0x9E - lsls r0, 4 - b _08116830 - .pool -_081167D0: - ldr r1, =0x0203841e - ldr r0, =0x00002f1e - b _08116830 - .pool -_081167E0: - ldr r1, =0x0203841e - movs r0, 0x90 - lsls r0, 7 - b _08116830 - .pool -_081167EC: - ldr r1, =0x0203841e - ldr r0, =0x00007ecb - b _08116830 - .pool -_081167FC: - ldr r1, =0x0203841e - ldr r0, =0x00007ecb - b _08116830 - .pool -_0811680C: - ldr r1, =0x0203841e - ldr r0, =0x00002a16 - b _08116830 - .pool -_0811681C: - ldr r1, =0x0203841e - ldr r0, =0x00000d2e - b _08116830 - .pool -_0811682C: - ldr r1, =0x0203841e - ldr r0, =0x00007fff -_08116830: - strh r0, [r1, 0x8] -_08116832: - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_8116874 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811675C - - thumb_func_start sub_8116848 -sub_8116848: @ 8116848 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x0203841e - ldrh r0, [r0] - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x10 - movs r1, 0x1 - lsls r1, r0 - adds r0, r4, 0 - bl sub_8116874 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8116848 - - thumb_func_start sub_8116874 -sub_8116874: @ 8116874 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x03005e00 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - adds r2, r3 - strh r1, [r2, 0x8] - lsrs r1, 16 - strh r1, [r2, 0xA] - ldr r3, =0x0203841e - ldrh r1, [r3, 0x2] - strh r1, [r2, 0xC] - ldrh r1, [r3, 0x4] - strh r1, [r2, 0xE] - ldrh r1, [r3, 0x6] - strh r1, [r2, 0x10] - ldrh r1, [r3, 0x8] - strh r1, [r2, 0x12] - ldrh r1, [r3, 0x4] - strh r1, [r2, 0x1C] - ldr r1, =sub_81168B8 - str r1, [r2] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8116874 - - thumb_func_start sub_81168B8 -sub_81168B8: @ 81168B8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r7, r0, 24 - movs r6, 0 - ldr r2, =0x03005e00 - lsls r5, r7, 2 - adds r0, r5, r7 - lsls r0, 3 - adds r3, r0, r2 - ldrh r0, [r3, 0x1A] - mov r8, r0 - movs r4, 0x1A - ldrsh r1, [r3, r4] - movs r4, 0xC - ldrsh r0, [r3, r4] - mov r9, r2 - cmp r1, r0 - bne _0811694E - strh r6, [r3, 0x1A] - movs r0, 0x8 - ldrsh r4, [r3, r0] - movs r1, 0xA - ldrsh r0, [r3, r1] - lsls r0, 16 - orrs r4, r0 - mov r8, r5 - cmp r4, 0 - beq _0811691A - adds r5, r3, 0 -_081168F8: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0811690C - ldrb r2, [r5, 0x1C] - ldrh r3, [r5, 0x12] - adds r0, r6, 0 - movs r1, 0x10 - bl pal_fade_1 -_0811690C: - adds r0, r6, 0 - adds r0, 0x10 - lsls r0, 16 - lsrs r6, r0, 16 - lsrs r4, 1 - cmp r4, 0 - bne _081168F8 -_0811691A: - mov r4, r8 - adds r0, r4, r7 - lsls r0, 3 - mov r1, r9 - adds r2, r0, r1 - ldrh r0, [r2, 0x1C] - movs r4, 0x1C - ldrsh r3, [r2, r4] - movs r4, 0x10 - ldrsh r1, [r2, r4] - cmp r3, r1 - bge _0811693C - adds r0, 0x1 - strh r0, [r2, 0x1C] - b _08116954 - .pool -_0811693C: - cmp r3, r1 - ble _08116946 - subs r0, 0x1 - strh r0, [r2, 0x1C] - b _08116954 -_08116946: - adds r0, r7, 0 - bl move_anim_task_del - b _08116954 -_0811694E: - mov r0, r8 - adds r0, 0x1 - strh r0, [r3, 0x1A] -_08116954: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81168B8 - - thumb_func_start sub_8116960 -sub_8116960: @ 8116960 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r4, =0x0203841e - ldrb r0, [r4] - ldrb r1, [r4, 0x2] - ldrb r2, [r4, 0x4] - ldrb r3, [r4, 0x6] - ldrb r4, [r4, 0x8] - str r4, [sp] - bl sub_80A27B0 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81169A0 - str r1, [r0] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8116960 - - thumb_func_start sub_81169A0 -sub_81169A0: @ 81169A0 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081169B8 - adds r0, r2, 0 - bl move_anim_task_del -_081169B8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81169A0 - - thumb_func_start sub_81169C0 -sub_81169C0: @ 81169C0 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r1, r0 - ldr r2, =0x0203841e - ldrh r0, [r2] - movs r3, 0 - strh r0, [r1, 0x8] - strh r3, [r1, 0xA] - ldrh r0, [r2, 0x2] - strh r0, [r1, 0xC] - ldrh r0, [r2, 0x4] - strh r0, [r1, 0xE] - ldrh r0, [r2, 0x6] - strh r0, [r1, 0x10] - strh r3, [r1, 0x12] - ldr r0, =sub_81169F8 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_81169C0 - - thumb_func_start sub_81169F8 -sub_81169F8: @ 81169F8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r2, r5, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _08116ABC - ldrh r1, [r4, 0xA] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08116A28 - subs r0, r1, 0x1 - strh r0, [r4, 0xA] - b _08116ACA - .pool -_08116A28: - ldrb r0, [r4, 0x8] - bl duplicate_obj_of_side_rel2move_in_transparent_mode - strh r0, [r4, 0x14] - lsls r0, 16 - cmp r0, 0 - blt _08116AA6 - ldr r6, =0x02020630 - movs r1, 0x14 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r3, r1, r6 - movs r2, 0x8 - ldrsh r0, [r4, r2] - movs r2, 0x2 - cmp r0, 0 - beq _08116A50 - movs r2, 0x1 -_08116A50: - lsls r2, 2 - ldrb r1, [r3, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0x5] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrh r1, [r4, 0xE] - strh r1, [r0, 0x2E] - movs r2, 0x14 - ldrsh r1, [r4, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r5, [r0, 0x30] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x5 - strh r1, [r0, 0x32] - movs r2, 0x14 - ldrsh r1, [r4, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r6, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_8116AD0 - str r1, [r0] - ldrh r0, [r4, 0x12] - adds r0, 0x1 - strh r0, [r4, 0x12] -_08116AA6: - ldrh r0, [r4, 0x10] - subs r0, 0x1 - strh r0, [r4, 0x10] - ldrh r0, [r4, 0xC] - strh r0, [r4, 0xA] - b _08116ACA - .pool -_08116ABC: - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08116ACA - adds r0, r2, 0 - bl move_anim_task_del -_08116ACA: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81169F8 - - thumb_func_start sub_8116AD0 -sub_8116AD0: @ 8116AD0 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x2E] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08116AE4 - subs r0, r1, 0x1 - strh r0, [r4, 0x2E] - b _08116B08 -_08116AE4: - ldr r3, =0x03005e00 - movs r0, 0x32 - ldrsh r1, [r4, r0] - lsls r1, 1 - movs r0, 0x30 - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r4, 0 - bl obj_delete_but_dont_free_vram -_08116B08: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8116AD0 - - thumb_func_start sub_8116B14 -sub_8116B14: @ 8116B14 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r7, 0 - ldr r0, =0x02022e24 - strh r7, [r0] - ldr r0, =0x02022e26 - strh r7, [r0] - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - ldr r1, =0x00003f3d - movs r0, 0x4A - bl SetGpuReg - movs r1, 0x80 - lsls r1, 8 - movs r0, 0 - bl SetGpuRegBits - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x00000c08 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0xA - bl GetGpuReg - add r4, sp, 0x10 - strh r0, [r4] - ldrb r1, [r4] - movs r0, 0x4 - negs r0, r0 - mov r8, r0 - ands r0, r1 - strb r0, [r4] - mov r2, sp - adds r2, 0x11 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - strb r0, [r2] - ldrh r1, [r4] - movs r0, 0xA - bl SetGpuReg - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _08116BA2 - ldrb r1, [r4] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4] - ldrh r1, [r4] - movs r0, 0xA - bl SetGpuReg -_08116BA2: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08116C26 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _08116C26 - ldr r5, =0x02038436 - ldrb r0, [r5] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - beq _08116BD2 - ldrb r0, [r5] - bl battle_get_per_side_status - lsls r0, 24 - cmp r0, 0 - bne _08116C26 -_08116BD2: - ldrb r0, [r5] - movs r6, 0x2 - eors r0, r6 - bl b_side_obj__get_some_boolean - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08116C26 - ldr r3, =0x02020630 - ldr r1, =0x020241e4 - ldrb r0, [r5] - eors r0, r6 - adds r0, r1 - ldrb r0, [r0] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - ldrb r3, [r2, 0x5] - lsls r1, r3, 28 - lsrs r1, 30 - subs r1, 0x1 - movs r0, 0x3 - ands r1, r0 - lsls r1, 2 - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x5] - ldrb r1, [r4] - mov r0, r8 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r4] - ldrh r1, [r4] - movs r0, 0xA - bl SetGpuReg - movs r7, 0x1 -_08116C26: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _08116C64 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldrh r5, [r0] - b _08116CAC - .pool -_08116C64: - ldr r4, =0x02038436 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08116C90 - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - b _08116CA0 - .pool -_08116C90: - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec -_08116CA0: - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 -_08116CAC: - movs r0, 0 - bl obj_id_for_side_relative_to_move - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x02038436 - ldrb r0, [r0] - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_80A89C8 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - mov r0, sp - bl sub_80A6B30 - ldr r1, =gUnknown_08C20684 - mov r0, sp - movs r2, 0 - bl sub_80A6D60 - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08C20668 - mov r2, sp - ldrh r2, [r2, 0xA] - bl sub_80A6CC0 - ldr r0, =gUnknown_08597418 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - adds r1, 0x1 - movs r2, 0x2 - bl gpu_pal_apply - ldr r2, =0x02022e18 - ldr r0, =0x02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x20] - negs r0, r0 - adds r0, 0x20 - strh r0, [r2] - ldr r2, =0x02022e1a - ldrh r0, [r1, 0x22] - negs r0, r0 - adds r0, 0x20 - strh r0, [r2] - ldr r1, =0x03005e00 - mov r2, r9 - lsls r0, r2, 2 - add r0, r9 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0x8] - strh r7, [r0, 0x14] - ldr r1, =sub_8116D64 - 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_8116B14 - - thumb_func_start sub_8116D64 -sub_8116D64: @ 8116D64 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r1 - ldrh r0, [r5, 0x1C] - adds r0, 0x4 - movs r1, 0 - mov r8, r1 - strh r0, [r5, 0x1C] - ldr r7, =0x02022e1a - ldrh r2, [r7] - subs r1, r2, 0x4 - strh r1, [r7] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x40 - bne _08116E86 - mov r0, r8 - strh r0, [r5, 0x1C] - adds r0, r2, 0 - adds r0, 0x3C - strh r0, [r7] - ldrh r0, [r5, 0x1E] - adds r0, 0x1 - strh r0, [r5, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _08116E86 - movs r0, 0 - bl sub_80A477C - ldr r0, =0x02022e24 - mov r1, r8 - strh r1, [r0] - ldr r0, =0x02022e26 - strh r1, [r0] - ldr r4, =0x00003f3f - movs r0, 0x48 - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x4A - adds r1, r4, 0 - bl SetGpuReg - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _08116DF6 - movs r0, 0xA - bl GetGpuReg - add r1, sp, 0x10 - strh r0, [r1] - ldrb r2, [r1] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldrh r1, [r1] - movs r0, 0xA - bl SetGpuReg -_08116DF6: - movs r0, 0 - bl GetGpuReg - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 8 - adds r0, r2, 0 - eors r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl obj_id_for_side_relative_to_move - ldr r4, =0x02020630 - movs r0, 0x8 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x9] - bl sub_80A6C68 - movs r1, 0x14 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - bne _08116E7C - ldr r2, =0x020241e4 - ldr r0, =0x02038436 - ldrb r1, [r0] - movs r0, 0x2 - eors r0, r1 - adds r0, r2 - ldrb r0, [r0] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r4 - ldrb r3, [r2, 0x5] - lsls r1, r3, 28 - lsrs r1, 30 - adds r1, 0x1 - movs r0, 0x3 - ands r1, r0 - lsls r1, 2 - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x5] -_08116E7C: - mov r2, r8 - strh r2, [r7] - adds r0, r6, 0 - bl move_anim_task_del -_08116E86: - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8116D64 - - thumb_func_start sub_8116EB4 -sub_8116EB4: @ 8116EB4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x0203a110 - movs r0, 0x18 - bl AllocZeroed - str r0, [r4] - movs r2, 0 - ldr r3, =0x0203841e -_08116EC8: - ldr r1, [r4] - lsls r0, r2, 1 - adds r1, 0x4 - adds r1, r0 - adds r0, r3 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _08116EC8 - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8116F04 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8116EB4 - - thumb_func_start sub_8116F04 -sub_8116F04: @ 8116F04 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x0203a110 - ldr r1, [r0] - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _08116F24 - ldr r0, =0x02038436 - b _08116F26 - .pool -_08116F24: - ldr r0, =0x02038437 -_08116F26: - ldrb r0, [r0] - strb r0, [r1] - ldr r4, =0x0203a110 - ldr r2, [r4] - ldrb r0, [r2] - movs r1, 0x2 - eors r0, r1 - strb r0, [r2, 0x1] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _08116F56 - ldr r1, [r4] - movs r2, 0xA - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _08116F5C - ldrb r0, [r1, 0x1] - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - bne _08116F5C -_08116F56: - ldr r1, [r4] - movs r0, 0 - strh r0, [r1, 0xA] -_08116F5C: - ldr r0, =0x02022e24 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e26 - strh r1, [r0] - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - ldr r1, =0x00003f3d - movs r0, 0x4A - bl SetGpuReg - movs r1, 0x80 - lsls r1, 8 - movs r0, 0 - bl SetGpuRegBits - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl lcd_bg_operations - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _08116FBA - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl lcd_bg_operations -_08116FBA: - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _08117036 - ldr r4, =0x0203a110 - ldr r1, [r4] - movs r2, 0xA - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _08117036 - ldrb r0, [r1] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - beq _08116FEC - ldr r0, [r4] - ldrb r0, [r0] - bl battle_get_per_side_status - lsls r0, 24 - cmp r0, 0 - bne _08117036 -_08116FEC: - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl b_side_obj__get_some_boolean - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bne _08117036 - ldr r3, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - adds r0, r1 - ldrb r0, [r0] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - ldrb r3, [r2, 0x5] - lsls r1, r3, 28 - lsrs r1, 30 - subs r1, 0x1 - movs r0, 0x3 - ands r1, r0 - lsls r1, 2 - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x5] - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - ldr r0, [r4] - strb r5, [r0, 0x2] -_08117036: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _08117078 - ldr r0, =0x0203a110 - ldr r1, [r0] - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldrh r0, [r0] - b _081170C4 - .pool -_08117078: - ldr r4, =0x0203a110 - ldr r0, [r4] - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _081170A8 - ldr r1, =0x0202406e - ldr r0, [r4] - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - b _081170BA - .pool -_081170A8: - ldr r1, =0x0202406e - ldr r0, [r4] - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec -_081170BA: - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - ldr r1, [r4] -_081170C4: - strh r0, [r1, 0x14] - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81170EC - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8116F04 - - thumb_func_start sub_81170EC -sub_81170EC: @ 81170EC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0 - mov r8, r0 - ldr r6, =0x020241e4 - ldr r4, =0x0203a110 - ldr r2, [r4] - ldrb r0, [r2] - adds r1, r0, r6 - ldrb r1, [r1] - ldrh r2, [r2, 0x14] - bl sub_80A89C8 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r2, [r4] - movs r1, 0xA - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _0811712E - ldrb r0, [r2, 0x1] - adds r1, r0, r6 - ldrb r1, [r1] - ldrh r2, [r2, 0x14] - bl sub_80A89C8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 -_0811712E: - mov r0, sp - bl sub_80A6B30 - ldr r0, [r4] - movs r4, 0x4 - ldrsh r0, [r0, r4] - cmp r0, 0 - bne _08117158 - ldr r1, =gUnknown_08C2D930 - mov r0, sp - movs r2, 0 - bl sub_80A6D60 - b _08117162 - .pool -_08117158: - ldr r1, =gUnknown_08C2DA4C - mov r0, sp - movs r2, 0 - bl sub_80A6D60 -_08117162: - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08C2D720 - mov r2, sp - ldrh r2, [r2, 0xA] - bl sub_80A6CC0 - ldr r0, =0x0203a110 - ldr r0, [r0] - movs r1, 0x6 - ldrsh r0, [r0, r1] - cmp r0, 0x6 - bhi _081171F8 - lsls r0, 2 - ldr r1, =_08117198 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08117198: - .4byte _081171B4 - .4byte _081171BC - .4byte _081171C4 - .4byte _081171CC - .4byte _081171D4 - .4byte _081171DC - .4byte _081171E4 -_081171B4: - ldr r0, =gUnknown_08C2DB88 - b _081171E6 - .pool -_081171BC: - ldr r0, =gUnknown_08C2DB68 - b _081171E6 - .pool -_081171C4: - ldr r0, =gUnknown_08C2DBA8 - b _081171E6 - .pool -_081171CC: - ldr r0, =gUnknown_08C2DBC8 - b _081171E6 - .pool -_081171D4: - ldr r0, =gUnknown_08C2DC08 - b _081171E6 - .pool -_081171DC: - ldr r0, =gUnknown_08C2DC28 - b _081171E6 - .pool -_081171E4: - ldr r0, =gUnknown_08C2DC48 -_081171E6: - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - movs r2, 0x20 - bl decompress_palette - b _08117206 - .pool -_081171F8: - ldr r0, =gUnknown_08C2DBE8 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - movs r2, 0x20 - bl decompress_palette -_08117206: - ldr r3, =0x02022e18 - movs r2, 0 - strh r2, [r3] - ldr r0, =0x02022e1a - strh r2, [r0] - ldr r1, =0x0203a110 - ldr r0, [r1] - movs r4, 0x4 - ldrsh r0, [r0, r4] - adds r4, r1, 0 - cmp r0, 0x1 - bne _08117248 - movs r0, 0x40 - strh r0, [r3] - ldr r2, =0x03005e00 - lsls r3, r5, 2 - adds r0, r3, r5 - lsls r0, 3 - adds r0, r2 - ldr r1, =0x0000fffd - b _08117254 - .pool -_08117248: - ldr r2, =0x03005e00 - lsls r3, r5, 2 - adds r0, r3, r5 - lsls r0, 3 - adds r0, r2 - movs r1, 0x3 -_08117254: - strh r1, [r0, 0xA] - ldr r0, [r4] - movs r1, 0xC - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08117274 - adds r0, r3, r5 - lsls r0, 3 - adds r0, r2 - movs r1, 0xA - strh r1, [r0, 0x10] - movs r1, 0x14 - b _08117280 - .pool -_08117274: - adds r0, r3, r5 - lsls r0, 3 - adds r0, r2 - movs r1, 0xD - strh r1, [r0, 0x10] - movs r1, 0x1E -_08117280: - strh r1, [r0, 0x12] - adds r1, r3, r5 - lsls r1, 3 - adds r1, r2 - strh r7, [r1, 0x8] - ldr r3, [r4] - ldrh r0, [r3, 0xA] - strh r0, [r1, 0xC] - mov r4, r8 - strh r4, [r1, 0xE] - ldrb r0, [r3, 0x2] - strh r0, [r1, 0x14] - ldr r2, =0x020241e4 - ldrb r0, [r3, 0x1] - adds r0, r2 - ldrb r0, [r0] - strh r0, [r1, 0x16] - ldr r0, =sub_81172EC - str r0, [r1] - movs r1, 0x4 - ldrsh r0, [r3, r1] - cmp r0, 0 - bne _081172CC - movs r0, 0x40 - negs r0, r0 - bl sub_80A5278 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xEF - bl audio_play_and_stuff - b _081172E0 - .pool -_081172CC: - movs r0, 0x40 - negs r0, r0 - bl sub_80A5278 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xF5 - bl audio_play_and_stuff -_081172E0: - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81170EC - - thumb_func_start sub_81172EC -sub_81172EC: @ 81172EC - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, =0x02022e1a - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r1 - ldrh r0, [r5, 0xA] - ldrh r1, [r2] - adds r0, r1 - strh r0, [r2] - movs r0, 0x26 - ldrsh r2, [r5, r0] - cmp r2, 0x1 - beq _08117362 - cmp r2, 0x1 - bgt _08117320 - cmp r2, 0 - beq _0811732A - b _08117478 - .pool -_08117320: - cmp r2, 0x2 - beq _08117378 - cmp r2, 0x3 - beq _081173B6 - b _08117478 -_0811732A: - ldrh r0, [r5, 0x1E] - adds r1, r0, 0x1 - strh r1, [r5, 0x1E] - lsls r0, 16 - cmp r0, 0 - bgt _08117338 - b _08117478 -_08117338: - strh r2, [r5, 0x1E] - ldrh r1, [r5, 0x20] - adds r1, 0x1 - strh r1, [r5, 0x20] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r2, 0x20 - ldrsh r1, [r5, r2] - movs r2, 0x10 - ldrsh r0, [r5, r2] - cmp r1, r0 - beq _08117360 - b _08117478 -_08117360: - b _081173AE -_08117362: - ldrh r0, [r5, 0x1C] - adds r0, 0x1 - strh r0, [r5, 0x1C] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x12 - ldrsh r1, [r5, r2] - cmp r0, r1 - beq _08117376 - b _08117478 -_08117376: - b _081173AE -_08117378: - ldrh r0, [r5, 0x1E] - adds r1, r0, 0x1 - strh r1, [r5, 0x1E] - lsls r0, 16 - cmp r0, 0 - ble _08117478 - movs r0, 0 - strh r0, [r5, 0x1E] - ldrh r1, [r5, 0x20] - subs r1, 0x1 - strh r1, [r5, 0x20] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x20 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _08117478 - movs r0, 0 - bl sub_80A477C -_081173AE: - ldrh r0, [r5, 0x26] - adds r0, 0x1 - strh r0, [r5, 0x26] - b _08117478 -_081173B6: - ldr r0, =0x02022e24 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e26 - strh r1, [r0] - ldr r4, =0x00003f3f - movs r0, 0x48 - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x4A - adds r1, r4, 0 - bl SetGpuReg - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _081173E6 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0 - bl lcd_bg_operations -_081173E6: - movs r0, 0 - bl GetGpuReg - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 8 - adds r0, r2, 0 - eors r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x8 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl RemoveObjectAndFreeTiles - movs r1, 0xC - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _0811743A - movs r2, 0xE - ldrsh r1, [r5, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles -_0811743A: - movs r1, 0x14 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - bne _08117466 - movs r2, 0x16 - ldrsh r0, [r5, r2] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r4 - ldrb r3, [r2, 0x5] - lsls r1, r3, 28 - lsrs r1, 30 - adds r1, 0x1 - movs r0, 0x3 - ands r1, r0 - lsls r1, 2 - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x5] -_08117466: - ldr r4, =0x0203a110 - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - adds r0, r6, 0 - bl move_anim_task_del -_08117478: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81172EC - - thumb_func_start sub_8117494 -sub_8117494: @ 8117494 - push {r4-r6,lr} - sub sp, 0xC - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x1 - movs r3, 0x1 - bl sub_80A76C4 - adds r6, r0, 0 - movs r1, 0 - bl sub_81175C4 - ldr r0, =0x03005e00 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - lsrs r0, r6, 16 - movs r5, 0 - strh r0, [r4, 0x24] - str r5, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_80A75AC - adds r6, r0, 0 - ldr r1, =0x0000ffff - ands r6, r1 - adds r0, r6, 0 - bl sub_81175C4 - strh r6, [r4, 0x26] - strh r5, [r4, 0x8] - strh r5, [r4, 0xA] - ldr r0, =sub_8117500 - str r0, [r4] - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8117494 - - thumb_func_start sub_8117500 -sub_8117500: @ 8117500 - push {r4-r6,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _08117544 - cmp r1, 0x1 - bgt _08117528 - cmp r1, 0 - beq _0811752E - b _081175BE - .pool -_08117528: - cmp r1, 0x2 - beq _081175B8 - b _081175BE -_0811752E: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - ble _081175BE - strh r1, [r4, 0xA] - movs r0, 0x10 - strh r0, [r4, 0xC] - b _081175AC -_08117544: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _081175BE - movs r0, 0 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - movs r5, 0 - movs r6, 0x1 -_08117560: - movs r1, 0x26 - ldrsh r0, [r4, r1] - asrs r0, r5 - ands r0, r6 - cmp r0, 0 - beq _0811757A - lsls r0, r5, 20 - lsrs r0, 16 - ldrb r2, [r4, 0xC] - movs r1, 0x10 - ldr r3, =0x0000ffff - bl pal_fade_1 -_0811757A: - movs r1, 0x24 - ldrsh r0, [r4, r1] - asrs r0, r5 - ands r0, r6 - cmp r0, 0 - beq _0811759A - lsls r0, r5, 20 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r0, 16 - ldrb r2, [r4, 0xC] - movs r1, 0x10 - movs r3, 0 - bl pal_fade_1 -_0811759A: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0xF - bls _08117560 - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081175BE -_081175AC: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _081175BE - .pool -_081175B8: - adds r0, r2, 0 - bl move_anim_task_del -_081175BE: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8117500 - - thumb_func_start sub_81175C4 -sub_81175C4: @ 81175C4 - push {r4-r6,lr} - adds r3, r0, 0 - lsls r1, 16 - lsrs r6, r1, 16 - movs r2, 0 -_081175CE: - movs r0, 0x1 - ands r0, r3 - lsrs r4, r3, 1 - adds r5, r2, 0x1 - cmp r0, 0 - beq _081175FA - lsls r0, r2, 20 - lsrs r2, r0, 16 - adds r0, r2, 0 - adds r0, 0x10 - cmp r2, r0 - bge _081175FA - ldr r1, =0x02037b14 - adds r3, r0, 0 -_081175EA: - lsls r0, r2, 1 - adds r0, r1 - strh r6, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, r3 - blt _081175EA -_081175FA: - adds r3, r4, 0 - lsls r0, r5, 16 - lsrs r2, r0, 16 - cmp r2, 0x1F - bls _081175CE - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81175C4 - - thumb_func_start sub_8117610 -sub_8117610: @ 8117610 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 - movs r2, 0 - ldr r0, =0x02038436 - ldrb r3, [r0] - movs r5, 0x1 -_08117620: - cmp r3, r2 - beq _0811762E - adds r1, r2, 0 - adds r1, 0x10 - adds r0, r5, 0 - lsls r0, r1 - orrs r4, r0 -_0811762E: - adds r2, 0x1 - cmp r2, 0x3 - bls _08117620 - movs r2, 0x5 - ldr r0, =0x0203841e - adds r1, r0, 0 - adds r1, 0x8 -_0811763C: - ldrh r0, [r1] - strh r0, [r1, 0x2] - subs r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bne _0811763C - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_8116874 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8117610 - - thumb_func_start sub_8117660 -sub_8117660: @ 8117660 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0 - bl sub_80A6DAC - ldr r0, =sub_81176D8 - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x0203841e - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0811769C - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0811769C - ldrh r0, [r4] - negs r0, r0 - strh r0, [r4] - ldrh r0, [r4, 0x2] - negs r0, r0 - strh r0, [r4, 0x2] -_0811769C: - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r2, =0x0203841e - ldrh r0, [r2] - strh r0, [r1, 0xA] - ldrh r0, [r2, 0x2] - strh r0, [r1, 0xC] - ldrh r0, [r2, 0x6] - strh r0, [r1, 0xE] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - adds r0, r6, 0 - bl move_anim_task_del - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8117660 - - thumb_func_start sub_81176D8 -sub_81176D8: @ 81176D8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldrh r3, [r1, 0xA] - ldrh r0, [r1, 0x1C] - adds r3, r0 - movs r4, 0 - mov r12, r4 - strh r3, [r1, 0x1C] - ldrh r2, [r1, 0xC] - ldrh r7, [r1, 0x1E] - adds r2, r7 - strh r2, [r1, 0x1E] - ldr r6, =0x02022e20 - lsls r0, r3, 16 - asrs r0, 24 - ldrh r4, [r6] - adds r0, r4 - strh r0, [r6] - ldr r4, =0x02022e22 - lsls r0, r2, 16 - asrs r0, 24 - ldrh r7, [r4] - adds r0, r7 - strh r0, [r4] - movs r0, 0xFF - ands r3, r0 - strh r3, [r1, 0x1C] - ands r2, r0 - strh r2, [r1, 0x1E] - ldr r0, =0x0203841e - movs r3, 0xE - ldrsh r2, [r0, r3] - movs r7, 0xE - ldrsh r0, [r1, r7] - cmp r2, r0 - bne _0811773E - mov r0, r12 - strh r0, [r6] - strh r0, [r4] - movs r0, 0x1 - bl sub_80A6DAC - adds r0, r5, 0 - bl DestroyTask -_0811773E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81176D8 - - thumb_func_start sub_8117754 -sub_8117754: @ 8117754 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - ldr r1, =0x0203841e - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0xE] - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8117754 - - thumb_func_start sub_8117780 -sub_8117780: @ 8117780 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - ldr r1, =0x0203841e - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0xE] - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8117780 - - thumb_func_start sub_81177AC -sub_81177AC: @ 81177AC - push {r4,r5,lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r5, =0x0203841e - movs r4, 0 - ldr r0, =0x02038436 - ldrb r2, [r0] - movs r0, 0x2 - ldr r1, =0x02038437 - eors r0, r2 - ldrb r1, [r1] - cmp r0, r1 - bne _081177C8 - movs r4, 0x1 -_081177C8: - strh r4, [r5, 0xE] - adds r0, r3, 0 - bl move_anim_task_del - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81177AC - - thumb_func_start sub_81177E4 -sub_81177E4: @ 81177E4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r6, =0x02020630 -_081177EE: - ldr r0, =0x02038436 - ldrb r0, [r0] - cmp r4, r0 - beq _0811782C - lsls r0, r4, 24 - lsrs r0, 24 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _0811782C - ldr r0, =0x020241e4 - adds r0, r4, r0 - ldrb r0, [r0] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r6 - ldr r1, =0x0203841e - adds r2, 0x3E - movs r0, 0x1 - ldrb r3, [r1] - ands r3, r0 - lsls r3, 2 - ldrb r0, [r2] - movs r7, 0x5 - negs r7, r7 - adds r1, r7, 0 - ands r0, r1 - orrs r0, r3 - strb r0, [r2] -_0811782C: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x3 - bls _081177EE - adds r0, r5, 0 - bl move_anim_task_del - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81177E4 - - thumb_func_start sub_8117854 -sub_8117854: @ 8117854 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - ldr r1, [sp, 0x44] - ldr r4, [sp, 0x48] - ldr r5, [sp, 0x4C] - ldr r6, [sp, 0x50] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r2, 16 - lsrs r2, 16 - str r2, [sp, 0x14] - lsls r3, 24 - lsrs r7, r3, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - 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 r10, r6 - movs r0, 0 - str r0, [sp, 0x20] - movs r0, 0x2 - adds r6, r7, 0 - eors r6, r0 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _081178B6 - mov r1, r8 - cmp r1, 0 - beq _081178BA - adds r0, r6, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - bne _081178BA -_081178B6: - movs r2, 0 - mov r8, r2 -_081178BA: - ldr r0, =0x02022e24 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e26 - strh r1, [r0] - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - ldr r1, =0x00003f3d - movs r0, 0x4A - bl SetGpuReg - movs r1, 0x80 - lsls r1, 8 - movs r0, 0 - bl SetGpuRegBits - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0xA - bl GetGpuReg - add r4, sp, 0x10 - strh r0, [r4] - ldrb r1, [r4] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - strb r0, [r4] - mov r2, sp - adds r2, 0x11 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - strb r0, [r2] - ldrb r0, [r2] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r2] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _08117930 - ldrb r0, [r4] - movs r1, 0xD - negs r1, r1 - ands r1, r0 - movs r0, 0x4 - orrs r1, r0 - strb r1, [r4] -_08117930: - ldrh r1, [r4] - movs r0, 0xA - bl SetGpuReg - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _08117964 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldrh r4, [r0] - b _081179A2 - .pool -_08117964: - adds r0, r7, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08117988 - ldr r1, =0x0202406e - lsls r0, r7, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - b _08117996 - .pool -_08117988: - ldr r1, =0x0202406e - lsls r0, r7, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec -_08117996: - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 -_081179A2: - ldr r5, =0x020241e4 - adds r0, r7, r5 - ldrb r1, [r0] - adds r0, r7, 0 - adds r2, r4, 0 - bl sub_80A89C8 - lsls r0, 24 - lsrs r7, r0, 24 - mov r0, r8 - cmp r0, 0 - beq _081179CC - adds r0, r6, r5 - ldrb r1, [r0] - adds r0, r6, 0 - adds r2, r4, 0 - bl sub_80A89C8 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x20] -_081179CC: - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldr r1, [sp, 0x58] - movs r2, 0 - bl sub_80A6D60 - mov r0, sp - ldrb r0, [r0, 0x9] - mov r1, sp - ldrh r2, [r1, 0xA] - ldr r1, [sp, 0x54] - bl sub_80A6CC0 - mov r0, sp - ldrb r1, [r0, 0x8] - lsls r1, 4 - ldr r0, [sp, 0x5C] - movs r2, 0x20 - bl decompress_palette - ldr r0, =0x02022e18 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e1a - strh r1, [r0] - ldr r1, =0x03005e00 - mov r2, r9 - lsls r0, r2, 2 - add r0, r9 - lsls r0, 3 - adds r0, r1 - mov r1, sp - ldrh r1, [r1, 0x14] - strh r1, [r0, 0xA] - mov r2, sp - ldrh r2, [r2, 0x18] - strh r2, [r0, 0x10] - mov r1, r10 - strh r1, [r0, 0x12] - mov r2, sp - ldrh r2, [r2, 0x1C] - strh r2, [r0, 0x14] - strh r7, [r0, 0x8] - mov r1, r8 - strh r1, [r0, 0xC] - mov r2, sp - ldrh r2, [r2, 0x20] - strh r2, [r0, 0xE] - ldr r1, =sub_8117A60 - str r1, [r0] - 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_8117854 - - thumb_func_start sub_8117A60 -sub_8117A60: @ 8117A60 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r3, r0, r1 - movs r0, 0xA - ldrsh r2, [r3, r0] - adds r5, r1, 0 - cmp r2, 0 - bge _08117A7E - negs r2, r2 -_08117A7E: - ldrh r0, [r3, 0x22] - adds r4, r0, r2 - strh r4, [r3, 0x22] - movs r1, 0xA - ldrsh r0, [r3, r1] - cmp r0, 0 - bge _08117AA4 - ldr r2, =0x02022e1a - lsls r1, r4, 16 - asrs r1, 24 - ldrh r0, [r2] - subs r0, r1 - strh r0, [r2] - b _08117AB0 - .pool -_08117AA4: - ldr r1, =0x02022e1a - lsls r0, r4, 16 - asrs r0, 24 - ldrh r2, [r1] - adds r0, r2 - strh r0, [r1] -_08117AB0: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r5 - ldrh r1, [r5, 0x22] - movs r0, 0xFF - ands r0, r1 - movs r2, 0 - strh r0, [r5, 0x22] - movs r3, 0x26 - ldrsh r0, [r5, r3] - cmp r0, 0x1 - beq _08117B1A - cmp r0, 0x1 - bgt _08117AD8 - cmp r0, 0 - beq _08117ADE - b _08117C0C - .pool -_08117AD8: - cmp r0, 0x2 - beq _08117B34 - b _08117C0C -_08117ADE: - ldrh r0, [r5, 0x1E] - adds r1, r0, 0x1 - strh r1, [r5, 0x1E] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x14 - ldrsh r1, [r5, r3] - cmp r0, r1 - bge _08117AF2 - b _08117C0C -_08117AF2: - strh r2, [r5, 0x1E] - ldrh r1, [r5, 0x20] - adds r1, 0x1 - strh r1, [r5, 0x20] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x20 - ldrsh r1, [r5, r0] - movs r2, 0x10 - ldrsh r0, [r5, r2] - cmp r1, r0 - bne _08117C0C - b _08117B2C -_08117B1A: - ldrh r0, [r5, 0x1C] - adds r0, 0x1 - strh r0, [r5, 0x1C] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x12 - ldrsh r1, [r5, r3] - cmp r0, r1 - bne _08117C0C -_08117B2C: - ldrh r0, [r5, 0x26] - adds r0, 0x1 - strh r0, [r5, 0x26] - b _08117C0C -_08117B34: - ldrh r0, [r5, 0x1E] - adds r1, r0, 0x1 - strh r1, [r5, 0x1E] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x14 - ldrsh r1, [r5, r3] - cmp r0, r1 - blt _08117C0C - strh r2, [r5, 0x1E] - ldrh r1, [r5, 0x20] - subs r1, 0x1 - strh r1, [r5, 0x20] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x20 - ldrsh r4, [r5, r0] - cmp r4, 0 - bne _08117C0C - movs r0, 0 - bl sub_80A477C - ldr r0, =0x02022e24 - strh r4, [r0] - ldr r0, =0x02022e26 - strh r4, [r0] - ldr r4, =0x00003f3f - movs r0, 0x48 - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x4A - adds r1, r4, 0 - bl SetGpuReg - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _08117BB2 - movs r0, 0xA - bl GetGpuReg - mov r1, sp - strh r0, [r1] - mov r2, sp - ldrb r1, [r2] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - strb r0, [r2] - mov r0, sp - ldrh r1, [r0] - movs r0, 0xA - bl SetGpuReg -_08117BB2: - movs r0, 0 - bl GetGpuReg - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 8 - adds r0, r2, 0 - eors r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r3, 0x8 - ldrsh r1, [r5, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl RemoveObjectAndFreeTiles - movs r1, 0xC - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08117C06 - movs r2, 0xE - ldrsh r1, [r5, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles -_08117C06: - adds r0, r6, 0 - bl move_anim_task_del -_08117C0C: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8117A60 - - thumb_func_start sub_8117C24 -sub_8117C24: @ 8117C24 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x0203841e - ldr r1, =0x02022ff0 - ldrb r1, [r1] - strh r1, [r2] - bl move_anim_task_del - pop {r0} - bx r0 - .pool - thumb_func_end sub_8117C24 - - thumb_func_start sub_8117C44 -sub_8117C44: @ 8117C44 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x80 - lsls r0, 6 - bl AllocZeroed - ldr r1, =0x020244d4 - ldr r1, [r1] - movs r2, 0xBE - lsls r2, 1 - adds r1, r2 - str r0, [r1] - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8117C44 - - thumb_func_start sub_8117C70 -sub_8117C70: @ 8117C70 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r6, =0x020244d4 - ldr r0, [r6] - movs r5, 0xBE - lsls r5, 1 - adds r0, r5 - ldr r0, [r0] - bl Free - ldr r0, [r6] - adds r0, r5 - movs r1, 0 - str r1, [r0] - adds r0, r4, 0 - bl move_anim_task_del - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8117C70 - - thumb_func_start sub_8117CA0 -sub_8117CA0: @ 8117CA0 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08117CE4 - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_80A75AC - adds r1, r0, 0 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08117CFC - movs r2, 0x1 -_08117CD2: - lsrs r1, 1 - adds r4, 0x1 - adds r0, r1, 0 - ands r0, r2 - cmp r0, 0 - beq _08117CD2 - b _08117CFC - .pool -_08117CE4: - cmp r0, 0x1 - bne _08117CF0 - ldr r0, =0x02038436 - b _08117CF6 - .pool -_08117CF0: - cmp r0, 0x2 - bne _08117CFC - ldr r0, =0x02038437 -_08117CF6: - ldrb r0, [r0] - adds r4, r0, 0 - adds r4, 0x10 -_08117CFC: - ldr r0, =0x020244d4 - ldr r1, [r0] - ldr r0, =0x0203841e - movs r2, 0x2 - ldrsh r0, [r0, r2] - movs r2, 0xBE - lsls r2, 1 - adds r1, r2 - ldr r1, [r1] - lsls r0, 5 - adds r0, r1 - lsls r1, r4, 5 - ldr r2, =0x02037714 - adds r1, r2 - movs r2, 0x20 - bl memcpy - adds r0, r5, 0 - bl move_anim_task_del - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8117CA0 - - thumb_func_start sub_8117D3C -sub_8117D3C: @ 8117D3C - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08117D80 - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_80A75AC - adds r1, r0, 0 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08117D98 - movs r2, 0x1 -_08117D6E: - lsrs r1, 1 - adds r4, 0x1 - adds r0, r1, 0 - ands r0, r2 - cmp r0, 0 - beq _08117D6E - b _08117D98 - .pool -_08117D80: - cmp r0, 0x1 - bne _08117D8C - ldr r0, =0x02038436 - b _08117D92 - .pool -_08117D8C: - cmp r0, 0x2 - bne _08117D98 - ldr r0, =0x02038437 -_08117D92: - ldrb r0, [r0] - adds r4, r0, 0 - adds r4, 0x10 -_08117D98: - lsls r0, r4, 5 - ldr r1, =0x02037714 - adds r0, r1 - ldr r1, =0x020244d4 - ldr r2, [r1] - ldr r1, =0x0203841e - movs r3, 0x2 - ldrsh r1, [r1, r3] - movs r3, 0xBE - lsls r3, 1 - adds r2, r3 - ldr r2, [r2] - lsls r1, 5 - adds r1, r2 - movs r2, 0x20 - bl memcpy - adds r0, r5, 0 - bl move_anim_task_del - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8117D3C - - thumb_func_start sub_8117DD8 -sub_8117DD8: @ 8117DD8 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08117E1C - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_80A75AC - adds r1, r0, 0 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08117E34 - movs r2, 0x1 -_08117E0A: - lsrs r1, 1 - adds r4, 0x1 - adds r0, r1, 0 - ands r0, r2 - cmp r0, 0 - beq _08117E0A - b _08117E34 - .pool -_08117E1C: - cmp r0, 0x1 - bne _08117E28 - ldr r0, =0x02038436 - b _08117E2E - .pool -_08117E28: - cmp r0, 0x2 - bne _08117E34 - ldr r0, =0x02038437 -_08117E2E: - ldrb r0, [r0] - adds r4, r0, 0 - adds r4, 0x10 -_08117E34: - lsls r1, r4, 5 - ldr r0, =0x02037714 - adds r0, r1, r0 - ldr r2, =0x02037b14 - adds r1, r2 - movs r2, 0x20 - bl memcpy - adds r0, r5, 0 - bl move_anim_task_del - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8117DD8 - - thumb_func_start sub_8117E60 -sub_8117E60: @ 8117E60 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _08117E80 - ldr r1, =0x0203841e - movs r0, 0x1 - strh r0, [r1, 0xE] - b _08117E84 - .pool -_08117E80: - ldr r0, =0x0203841e - strh r1, [r0, 0xE] -_08117E84: - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8117E60 - - thumb_func_start sub_8117E94 -sub_8117E94: @ 8117E94 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02038436 - ldr r1, =0x0202420c - ldrb r1, [r1] - strb r1, [r2] - ldr r2, =0x02038437 - ldr r1, =0x0202420e - ldrb r1, [r1] - strb r1, [r2] - bl move_anim_task_del - pop {r0} - bx r0 - .pool - thumb_func_end sub_8117E94 - - thumb_func_start sub_8117EC4 -sub_8117EC4: @ 8117EC4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - adds r4, r0, 0 - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _08117EF8 - ldr r1, =0x0203841e - movs r0, 0x1 - b _08117EFC - .pool -_08117EF8: - ldr r1, =0x0203841e - movs r0, 0 -_08117EFC: - strh r0, [r1, 0xE] - adds r0, r5, 0 - bl move_anim_task_del - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8117EC4 - - thumb_func_start sub_8117F10 -sub_8117F10: @ 8117F10 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02038437 - ldr r1, =0x0202420c - ldrb r1, [r1] - strb r1, [r2] - bl move_anim_task_del - pop {r0} - bx r0 - .pool - thumb_func_end sub_8117F10 - - thumb_func_start sub_8117F30 -sub_8117F30: @ 8117F30 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02038436 - ldr r1, =0x0202420b - ldrb r1, [r1] - strb r1, [r2] - ldr r2, =0x02038437 - ldr r1, =0x0202420e - ldrb r1, [r1] - strb r1, [r2] - bl move_anim_task_del - pop {r0} - bx r0 - .pool - thumb_func_end sub_8117F30 - - thumb_func_start sub_8117F60 -sub_8117F60: @ 8117F60 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _08117F78 - adds r0, r4, 0 - bl move_anim_task_del - b _08117FB4 -_08117F78: - ldr r0, =0x03005e00 - lsls r3, r4, 2 - adds r3, r4 - lsls r3, 3 - adds r3, r0 - ldr r0, =0x020244d0 - ldr r4, [r0] - ldr r2, =0x02038436 - ldrb r0, [r2] - ldr r1, [r4] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - lsls r0, 31 - lsrs r0, 31 - strh r0, [r3, 0x8] - ldrb r1, [r2] - ldr r0, [r4] - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x1 - orrs r0, r2 - strb r0, [r1] - ldr r0, =sub_8117FD0 - str r0, [r3] - ldr r1, =0x020383fe - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] -_08117FB4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8117F60 - - thumb_func_start sub_8117FD0 -sub_8117FD0: @ 8117FD0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0203841e - movs r2, 0xE - ldrsh r1, [r0, r2] - movs r0, 0x80 - lsls r0, 5 - cmp r1, r0 - bne _08118014 - ldr r0, =0x020244d0 - ldr r1, [r0] - ldr r0, =0x02038436 - ldrb r3, [r0] - ldr r0, [r1] - lsls r3, 2 - adds r3, r0 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0, 0x8] - movs r1, 0x1 - ands r1, r0 - ldrb r2, [r3] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - adds r0, r4, 0 - bl DestroyTask -_08118014: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8117FD0 - - thumb_func_start lcd_bg_operations -lcd_bg_operations: @ 811802C - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r4, r2, 24 - cmp r6, 0x3 - bls _08118040 - b _08118132 -_08118040: - ldr r0, =gUnknown_0859741A - adds r0, r6, r0 - ldrb r0, [r0] - bl GetGpuReg - ldr r1, =0x0203a114 - strh r0, [r1] - cmp r5, 0x6 - bhi _08118124 - lsls r0, r5, 2 - ldr r1, =_08118068 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08118068: - .4byte _08118084 - .4byte _08118098 - .4byte _081180B0 - .4byte _081180C8 - .4byte _081180E0 - .4byte _081180FC - .4byte _08118110 -_08118084: - ldr r2, =0x0203a114 - lsls r3, r4, 6 - ldrb r1, [r2, 0x1] - movs r0, 0x3F - ands r0, r1 - orrs r0, r3 - strb r0, [r2, 0x1] - b _08118124 - .pool -_08118098: - ldr r3, =0x0203a114 - movs r0, 0x1 - adds r1, r4, 0 - ands r1, r0 - lsls r1, 5 - ldrb r2, [r3, 0x1] - movs r0, 0x21 - negs r0, r0 - b _0811811E - .pool -_081180B0: - ldr r3, =0x0203a114 - movs r0, 0x1 - adds r1, r4, 0 - ands r1, r0 - lsls r1, 6 - ldrb r2, [r3] - movs r0, 0x41 - negs r0, r0 - b _081180EE - .pool -_081180C8: - ldr r3, =0x0203a114 - movs r0, 0x3 - adds r1, r4, 0 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0xD - negs r0, r0 - b _081180EE - .pool -_081180E0: - ldr r3, =0x0203a114 - movs r0, 0x3 - adds r1, r4, 0 - ands r1, r0 - ldrb r2, [r3] - movs r0, 0x4 - negs r0, r0 -_081180EE: - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - b _08118124 - .pool -_081180FC: - ldr r2, =0x0203a114 - lsls r3, r4, 7 - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - orrs r0, r3 - strb r0, [r2] - b _08118124 - .pool -_08118110: - ldr r3, =0x0203a114 - movs r0, 0x1F - adds r1, r4, 0 - ands r1, r0 - ldrb r2, [r3, 0x1] - movs r0, 0x20 - negs r0, r0 -_0811811E: - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x1] -_08118124: - ldr r0, =gUnknown_0859741A - adds r0, r6, r0 - ldrb r0, [r0] - ldr r1, =0x0203a114 - ldrh r1, [r1] - bl SetGpuReg -_08118132: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end lcd_bg_operations - - thumb_func_start sub_8118140 -sub_8118140: @ 8118140 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - cmp r2, 0x3 - bhi _081181C8 - ldr r0, =gUnknown_0859741E - adds r0, r2, r0 - ldrb r0, [r0] - bl GetGpuReg - mov r1, sp - strh r0, [r1] - cmp r4, 0x6 - bhi _081181C8 - lsls r0, r4, 2 - ldr r1, =_08118174 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08118174: - .4byte _08118190 - .4byte _08118198 - .4byte _081181A0 - .4byte _081181A8 - .4byte _081181B0 - .4byte _081181B8 - .4byte _081181C0 -_08118190: - ldr r0, [sp] - lsls r0, 16 - lsrs r0, 30 - b _081181CA -_08118198: - ldr r0, [sp] - lsls r0, 18 - lsrs r0, 31 - b _081181CA -_081181A0: - ldr r0, [sp] - lsls r0, 25 - lsrs r0, 31 - b _081181CA -_081181A8: - ldr r0, [sp] - lsls r0, 28 - lsrs r0, 30 - b _081181CA -_081181B0: - ldr r0, [sp] - lsls r0, 30 - lsrs r0, 30 - b _081181CA -_081181B8: - ldr r0, [sp] - lsls r0, 24 - lsrs r0, 31 - b _081181CA -_081181C0: - ldr r0, [sp] - lsls r0, 19 - lsrs r0, 27 - b _081181CA -_081181C8: - movs r0, 0 -_081181CA: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8118140 - - thumb_func_start battle_intro_launch -battle_intro_launch: @ 81181D4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r2, =0x02022fec - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _08118208 - ldr r0, =0x02038bce - ldrh r1, [r0] - ldr r0, =0x00000c03 - cmp r1, r0 - beq _08118208 - ldr r0, =sub_8118D68 - b _08118258 - .pool -_08118208: - ldr r2, [r2] - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - beq _0811821C - ldr r0, =task00_battle_intro_wireless - b _08118258 - .pool -_0811821C: - ldr r0, =0x003f0100 - ands r0, r2 - cmp r0, 0 - beq _08118230 - ldr r0, =task_battle_intro_anim - b _08118258 - .pool -_08118230: - movs r0, 0x80 - lsls r0, 5 - ands r2, r0 - cmp r2, 0 - beq _08118250 - ldr r0, =gUnknown_82E9530 - ldrb r0, [r0] - cmp r0, 0x2 - beq _08118250 - movs r4, 0x3 - ldr r0, =task00_battle_intro_80BC6C8 - b _08118258 - .pool -_08118250: - ldr r1, =gUnknown_08597424 - lsls r0, r4, 2 - adds r0, r1 - ldr r0, [r0] -_08118258: - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - movs r0, 0 - strh r0, [r1, 0x8] - strh r4, [r1, 0xA] - strh r0, [r1, 0xC] - strh r0, [r1, 0xE] - strh r0, [r1, 0x10] - strh r0, [r1, 0x12] - strh r0, [r1, 0x14] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end battle_intro_launch - - thumb_func_start sub_811828C -sub_811828C: @ 811828C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - ldr r0, =0x02022e18 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e1a - strh r1, [r0] - ldr r0, =0x02022e1c - strh r1, [r0] - ldr r0, =0x02022e1e - strh r1, [r0] - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - ldr r4, =0x00003f3f - movs r0, 0x48 - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x4A - adds r1, r4, 0 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811828C - - thumb_func_start task_battle_intro_80BC47C -task_battle_intro_80BC47C: @ 81182EC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x02022e18 - ldrh r0, [r1] - adds r0, 0x6 - strh r0, [r1] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - mov r8, r1 - cmp r0, 0x4 - bls _08118318 - b _0811852A -_08118318: - lsls r0, 2 - ldr r1, =_08118330 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08118330: - .4byte _08118344 - .4byte _08118374 - .4byte _0811839C - .4byte _081183E4 - .4byte _08118524 -_08118344: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08118360 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - add r0, r8 - movs r1, 0x10 - b _0811836A - .pool -_08118360: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - add r0, r8 - movs r1, 0x1 -_0811836A: - strh r1, [r0, 0xC] - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - b _0811852A -_08118374: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - mov r3, r8 - adds r1, r0, r3 - ldrh r0, [r1, 0xC] - subs r0, 0x1 - strh r0, [r1, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _0811838C - b _0811852A -_0811838C: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - b _0811852A -_0811839C: - ldr r1, =0x02022e26 - ldrh r0, [r1] - subs r0, 0xFF - strh r0, [r1] - movs r1, 0xFF - lsls r1, 8 - ands r0, r1 - movs r1, 0xC0 - lsls r1, 6 - cmp r0, r1 - beq _081183B4 - b _0811852A -_081183B4: - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - add r1, r8 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - movs r0, 0xF0 - strh r0, [r1, 0xC] - movs r0, 0x20 - strh r0, [r1, 0xE] - ldr r2, =0x020243fc - ldrh r1, [r2] - ldr r0, =0x0000fffe - ands r0, r1 - strh r0, [r2] - b _0811852A - .pool -_081183E4: - lsls r0, r4, 2 - adds r1, r0, r4 - lsls r1, 3 - mov r5, r8 - adds r2, r1, r5 - ldrh r3, [r2, 0xE] - movs r5, 0xE - ldrsh r1, [r2, r5] - mov r12, r0 - cmp r1, 0 - beq _08118400 - subs r0, r3, 0x1 - strh r0, [r2, 0xE] - b _0811842E -_08118400: - movs r1, 0xA - ldrsh r0, [r2, r1] - cmp r0, 0x1 - bne _08118420 - ldr r2, =0x02022e1a - ldrh r1, [r2] - ldr r0, =0x0000ffb0 - cmp r1, r0 - beq _0811842E - subs r0, r1, 0x2 - b _0811842C - .pool -_08118420: - ldr r2, =0x02022e1a - ldrh r1, [r2] - ldr r0, =0x0000ffc8 - cmp r1, r0 - beq _0811842E - subs r0, r1, 0x1 -_0811842C: - strh r0, [r2] -_0811842E: - ldr r2, =0x02022e26 - ldrh r1, [r2] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - cmp r0, 0 - beq _08118442 - ldr r3, =0xfffffc04 - adds r0, r1, r3 - strh r0, [r2] -_08118442: - mov r5, r12 - adds r0, r5, r4 - lsls r0, 3 - mov r2, r8 - adds r1, r0, r2 - ldrh r2, [r1, 0xC] - movs r3, 0xC - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _0811845A - subs r0, r2, 0x2 - strh r0, [r1, 0xC] -_0811845A: - movs r3, 0 - ldr r5, =0x02039b28 - mov r9, r5 - ldr r7, =0x02038c28 - mov r6, r9 - adds r5, r1, 0 -_08118466: - lsls r2, r3, 1 - ldrb r1, [r6, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r2, r0 - adds r2, r7 - ldrh r0, [r5, 0xC] - strh r0, [r2] - adds r3, 0x1 - cmp r3, 0x4F - ble _08118466 - cmp r3, 0x9F - bgt _081184AA - ldr r7, =0x02038c28 - ldr r6, =0x02039b28 - ldr r1, =0x03005e00 - mov r2, r12 - adds r0, r2, r4 - lsls r0, 3 - adds r5, r0, r1 -_08118490: - lsls r2, r3, 1 - ldrb r1, [r6, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r2, r0 - adds r2, r7 - ldrh r0, [r5, 0xC] - negs r0, r0 - strh r0, [r2] - adds r3, 0x1 - cmp r3, 0x9F - ble _08118490 -_081184AA: - mov r3, r12 - adds r0, r3, r4 - lsls r0, 3 - mov r5, r8 - adds r1, r0, r5 - movs r0, 0xC - ldrsh r2, [r1, r0] - cmp r2, 0 - bne _0811852A - movs r0, 0x3 - mov r3, r9 - strb r0, [r3, 0x15] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - str r2, [sp] - ldr r1, =0x0600e000 - ldr r2, =0x05000200 - mov r0, sp - bl CpuSet - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - bl SetBgAttribute - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0 - bl SetBgAttribute - movs r1, 0x9C - lsls r1, 8 - movs r0, 0xA - bl SetGpuReg - movs r1, 0xBC - lsls r1, 7 - movs r0, 0xC - bl SetGpuReg - b _0811852A - .pool -_08118524: - adds r0, r4, 0 - bl sub_811828C -_0811852A: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end task_battle_intro_80BC47C - - thumb_func_start task00_battle_intro_80BC6C8 -task00_battle_intro_80BC6C8: @ 8118538 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r2, 0xA - ldrsh r0, [r0, r2] - adds r2, r1, 0 - cmp r0, 0x3 - beq _08118578 - cmp r0, 0x3 - bgt _08118568 - cmp r0, 0x2 - beq _0811856C - b _08118580 - .pool -_08118568: - cmp r0, 0x4 - bne _08118580 -_0811856C: - ldr r1, =0x02022e18 - ldrh r0, [r1] - adds r0, 0x8 - b _0811857E - .pool -_08118578: - ldr r1, =0x02022e18 - ldrh r0, [r1] - adds r0, 0x6 -_0811857E: - strh r0, [r1] -_08118580: - lsls r0, r5, 2 - adds r1, r0, r5 - lsls r1, 3 - adds r4, r1, r2 - movs r3, 0xA - ldrsh r1, [r4, r3] - adds r6, r0, 0 - cmp r1, 0x4 - bne _081185E4 - ldr r7, =0x02022e1a - ldrh r0, [r4, 0x14] - bl cosine2 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _081185A6 - ldr r1, =0x000001ff - adds r0, r1 -_081185A6: - asrs r0, 9 - subs r0, 0x8 - strh r0, [r7] - ldrh r1, [r4, 0x14] - movs r2, 0x14 - ldrsh r0, [r4, r2] - cmp r0, 0xB3 - bgt _081185C8 - adds r0, r1, 0x4 - b _081185CA - .pool -_081185C8: - adds r0, r1, 0x6 -_081185CA: - strh r0, [r4, 0x14] - ldr r2, =0x03005e00 - adds r0, r6, r5 - lsls r0, 3 - adds r3, r0, r2 - movs r0, 0x14 - ldrsh r1, [r3, r0] - movs r0, 0xB4 - lsls r0, 1 - cmp r1, r0 - bne _081185E4 - movs r0, 0 - strh r0, [r3, 0x14] -_081185E4: - adds r0, r6, r5 - lsls r0, 3 - adds r0, r2 - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0x4 - bls _081185F4 - b _0811881A -_081185F4: - lsls r0, 2 - ldr r1, =_08118608 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08118608: - .4byte _0811861C - .4byte _0811864C - .4byte _08118678 - .4byte _081186C8 - .4byte _08118814 -_0811861C: - ldr r1, =0x03005e00 - adds r0, r6, r5 - lsls r0, 3 - adds r2, r0, r1 - movs r3, 0x10 - strh r3, [r2, 0x10] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08118640 - strh r3, [r2, 0xC] - b _08118644 - .pool -_08118640: - movs r0, 0x1 - strh r0, [r2, 0xC] -_08118644: - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - b _0811881A -_0811864C: - ldr r0, =0x03005e00 - adds r1, r6, r5 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0xC] - subs r0, 0x1 - strh r0, [r1, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _08118662 - b _0811881A -_08118662: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - b _0811881A - .pool -_08118678: - ldr r1, =0x02022e26 - ldrh r0, [r1] - subs r0, 0xFF - strh r0, [r1] - movs r1, 0xFF - lsls r1, 8 - ands r0, r1 - movs r1, 0xC0 - lsls r1, 6 - cmp r0, r1 - beq _08118690 - b _0811881A -_08118690: - ldr r0, =0x03005e00 - adds r1, r6, r5 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - movs r0, 0xF0 - strh r0, [r1, 0xC] - movs r0, 0x20 - strh r0, [r1, 0xE] - movs r0, 0x1 - strh r0, [r1, 0x12] - ldr r2, =0x020243fc - ldrh r1, [r2] - ldr r0, =0x0000fffe - ands r0, r1 - strh r0, [r2] - b _0811881A - .pool -_081186C8: - ldr r0, =0x03005e00 - adds r1, r6, r5 - lsls r1, 3 - adds r1, r0 - ldrh r2, [r1, 0xE] - movs r3, 0xE - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _08118708 - subs r0, r2, 0x1 - strh r0, [r1, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _08118728 - ldr r1, =0x00001842 - movs r0, 0x50 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0xF - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - b _08118728 - .pool -_08118708: - ldrh r2, [r1, 0x10] - movs r0, 0x1F - ands r0, r2 - cmp r0, 0 - beq _08118728 - ldrh r0, [r1, 0x12] - subs r0, 0x1 - strh r0, [r1, 0x12] - lsls r0, 16 - cmp r0, 0 - bne _08118728 - adds r0, r2, 0 - adds r0, 0xFF - strh r0, [r1, 0x10] - movs r0, 0x4 - strh r0, [r1, 0x12] -_08118728: - ldr r2, =0x02022e26 - ldrh r1, [r2] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - cmp r0, 0 - beq _0811873C - ldr r3, =0xfffffc04 - adds r0, r1, r3 - strh r0, [r2] -_0811873C: - ldr r0, =0x03005e00 - adds r1, r6, r5 - lsls r1, 3 - adds r1, r0 - ldrh r2, [r1, 0xC] - movs r3, 0xC - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _08118752 - subs r0, r2, 0x2 - strh r0, [r1, 0xC] -_08118752: - movs r3, 0 - ldr r0, =0x02039b28 - mov r8, r0 - ldr r2, =0x02038c28 - mov r12, r2 - mov r7, r8 - adds r4, r1, 0 -_08118760: - lsls r2, r3, 1 - ldrb r1, [r7, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r2, r0 - add r2, r12 - ldrh r0, [r4, 0xC] - strh r0, [r2] - adds r3, 0x1 - cmp r3, 0x4F - ble _08118760 - cmp r3, 0x9F - bgt _081187A4 - ldr r0, =0x02038c28 - mov r12, r0 - ldr r7, =0x02039b28 - ldr r1, =0x03005e00 - adds r0, r6, r5 - lsls r0, 3 - adds r4, r0, r1 -_0811878A: - lsls r2, r3, 1 - ldrb r1, [r7, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r2, r0 - add r2, r12 - ldrh r0, [r4, 0xC] - negs r0, r0 - strh r0, [r2] - adds r3, 0x1 - cmp r3, 0x9F - ble _0811878A -_081187A4: - ldr r1, =0x03005e00 - adds r0, r6, r5 - lsls r0, 3 - adds r1, r0, r1 - movs r3, 0xC - ldrsh r2, [r1, r3] - cmp r2, 0 - bne _0811881A - movs r0, 0x3 - mov r3, r8 - strb r0, [r3, 0x15] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - str r2, [sp] - ldr r1, =0x0600e000 - ldr r2, =0x05000200 - mov r0, sp - bl CpuSet - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - bl SetBgAttribute - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0 - bl SetBgAttribute - movs r1, 0x9C - lsls r1, 8 - movs r0, 0xA - bl SetGpuReg - movs r1, 0xBC - lsls r1, 7 - movs r0, 0xC - bl SetGpuReg - b _0811881A - .pool -_08118814: - adds r0, r5, 0 - bl sub_811828C -_0811881A: - ldr r0, =0x03005e00 - adds r1, r6, r5 - lsls r1, 3 - adds r1, r0 - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0x4 - beq _08118832 - ldrh r1, [r1, 0x10] - movs r0, 0x52 - bl SetGpuReg -_08118832: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end task00_battle_intro_80BC6C8 - - thumb_func_start task_battle_intro_anim -task_battle_intro_anim: @ 8118844 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x02022e18 - ldrh r0, [r1] - adds r0, 0x8 - strh r0, [r1] - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r4, r1, 0 - cmp r0, 0x4 - bls _0811886E - b _08118A96 -_0811886E: - lsls r0, 2 - ldr r1, =_08118884 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08118884: - .4byte _08118898 - .4byte _081188F0 - .4byte _0811891C - .4byte _0811896C - .4byte _08118A90 -_08118898: - ldr r1, =0x00001842 - movs r0, 0x50 - bl SetGpuReg - ldr r4, =0x00000808 - movs r0, 0x52 - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r2, r0, r1 - strh r4, [r2, 0x10] - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x02000002 - ands r0, r1 - cmp r0, 0 - beq _081188E4 - movs r0, 0x10 - b _081188E6 - .pool -_081188E4: - movs r0, 0x1 -_081188E6: - strh r0, [r2, 0xC] - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - b _08118A96 -_081188F0: - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0xC] - subs r0, 0x1 - strh r0, [r1, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _08118908 - b _08118A96 -_08118908: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - b _08118A96 - .pool -_0811891C: - ldr r1, =0x02022e26 - ldrh r0, [r1] - subs r0, 0xFF - strh r0, [r1] - movs r1, 0xFF - lsls r1, 8 - ands r0, r1 - movs r1, 0xC0 - lsls r1, 6 - cmp r0, r1 - beq _08118934 - b _08118A96 -_08118934: - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - movs r0, 0xF0 - strh r0, [r1, 0xC] - movs r0, 0x20 - strh r0, [r1, 0xE] - movs r0, 0x1 - strh r0, [r1, 0x12] - ldr r2, =0x020243fc - ldrh r1, [r2] - ldr r0, =0x0000fffe - ands r0, r1 - strh r0, [r2] - b _08118A96 - .pool -_0811896C: - lsls r0, r5, 2 - adds r1, r0, r5 - lsls r1, 3 - adds r2, r1, r4 - ldrh r3, [r2, 0xE] - movs r6, 0xE - ldrsh r1, [r2, r6] - mov r12, r0 - cmp r1, 0 - beq _08118986 - subs r0, r3, 0x1 - strh r0, [r2, 0xE] - b _081189A6 -_08118986: - ldrh r1, [r2, 0x10] - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - beq _081189A6 - ldrh r0, [r2, 0x12] - subs r0, 0x1 - strh r0, [r2, 0x12] - lsls r0, 16 - cmp r0, 0 - bne _081189A6 - adds r0, r1, 0 - adds r0, 0xFF - strh r0, [r2, 0x10] - movs r0, 0x6 - strh r0, [r2, 0x12] -_081189A6: - ldr r2, =0x02022e26 - ldrh r1, [r2] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - cmp r0, 0 - beq _081189BA - ldr r3, =0xfffffc04 - adds r0, r1, r3 - strh r0, [r2] -_081189BA: - mov r6, r12 - adds r0, r6, r5 - lsls r0, 3 - adds r1, r0, r4 - ldrh r2, [r1, 0xC] - movs r3, 0xC - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _081189D0 - subs r0, r2, 0x2 - strh r0, [r1, 0xC] -_081189D0: - movs r3, 0 - ldr r6, =0x02039b28 - mov r8, r6 - ldr r7, =0x02038c28 - adds r4, r1, 0 -_081189DA: - lsls r2, r3, 1 - ldrb r1, [r6, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r2, r0 - adds r2, r7 - ldrh r0, [r4, 0xC] - strh r0, [r2] - adds r3, 0x1 - cmp r3, 0x4F - ble _081189DA - cmp r3, 0x9F - bgt _08118A1E - ldr r7, =0x02038c28 - ldr r6, =0x02039b28 - ldr r1, =0x03005e00 - mov r2, r12 - adds r0, r2, r5 - lsls r0, 3 - adds r4, r0, r1 -_08118A04: - lsls r2, r3, 1 - ldrb r1, [r6, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r2, r0 - adds r2, r7 - ldrh r0, [r4, 0xC] - negs r0, r0 - strh r0, [r2] - adds r3, 0x1 - cmp r3, 0x9F - ble _08118A04 -_08118A1E: - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r1, r0, r1 - movs r3, 0xC - ldrsh r2, [r1, r3] - cmp r2, 0 - bne _08118A96 - movs r0, 0x3 - mov r6, r8 - strb r0, [r6, 0x15] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - str r2, [sp] - ldr r1, =0x0600e000 - ldr r2, =0x05000200 - mov r0, sp - bl CpuSet - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - bl SetBgAttribute - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0 - bl SetBgAttribute - movs r1, 0x9C - lsls r1, 8 - movs r0, 0xA - bl SetGpuReg - movs r1, 0xBC - lsls r1, 7 - movs r0, 0xC - bl SetGpuReg - b _08118A96 - .pool -_08118A90: - adds r0, r5, 0 - bl sub_811828C -_08118A96: - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0x4 - beq _08118AB0 - ldrh r1, [r1, 0x10] - movs r0, 0x52 - bl SetGpuReg -_08118AB0: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end task_battle_intro_anim - - thumb_func_start task00_battle_intro_wireless -task00_battle_intro_wireless: @ 8118AC0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r7, r0, r1 - movs r1, 0x8 - ldrsh r0, [r7, r1] - cmp r0, 0x1 - ble _08118B36 - movs r2, 0x10 - ldrsh r0, [r7, r2] - cmp r0, 0 - bne _08118B36 - ldr r2, =0x02022e18 - ldrh r1, [r2] - movs r0, 0x80 - lsls r0, 8 - ands r0, r1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - bne _08118AFE - cmp r1, 0x4F - bhi _08118B18 -_08118AFE: - adds r0, r1, 0x3 - strh r0, [r2] - ldr r1, =0x02022e1c - ldrh r0, [r1] - subs r0, 0x3 - strh r0, [r1] - b _08118B36 - .pool -_08118B18: - str r5, [sp] - ldr r1, =0x0600e000 - ldr r4, =0x05000200 - mov r0, sp - adds r2, r4, 0 - bl CpuSet - str r5, [sp, 0x4] - add r0, sp, 0x4 - ldr r1, =0x0600f000 - adds r2, r4, 0 - bl CpuSet - movs r0, 0x1 - strh r0, [r7, 0x10] -_08118B36: - ldr r0, =0x03005e00 - lsls r2, r6, 2 - adds r1, r2, r6 - lsls r1, 3 - adds r1, r0 - movs r3, 0x8 - ldrsh r1, [r1, r3] - mov r9, r0 - adds r5, r2, 0 - cmp r1, 0x4 - bls _08118B4E - b _08118D5A -_08118B4E: - lsls r0, r1, 2 - ldr r1, =_08118B6C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08118B6C: - .4byte _08118B80 - .4byte _08118B92 - .4byte _08118C38 - .4byte _08118C7C - .4byte _08118D54 -_08118B80: - adds r0, r5, r6 - lsls r0, 3 - add r0, r9 - movs r1, 0x20 - strh r1, [r0, 0xC] - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - b _08118D5A -_08118B92: - adds r0, r5, r6 - lsls r0, 3 - mov r2, r9 - adds r1, r0, r2 - ldrh r0, [r1, 0xC] - subs r0, 0x1 - strh r0, [r1, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _08118BA8 - b _08118D5A -_08118BA8: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - ldr r4, =0x02020630 - ldr r5, =0x0202449c - ldr r0, [r5] - adds r0, 0x7D - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r3, [r1, 0x1] - movs r2, 0xD - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - movs r3, 0x8 - mov r9, r3 - mov r3, r9 - orrs r0, r3 - strb r0, [r1, 0x1] - ldr r3, [r5] - adds r0, r3, 0 - adds r0, 0x7D - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - movs r1, 0x1C - adds r1, r4 - mov r8, r1 - add r0, r8 - ldr r6, =sub_8038B74 - str r6, [r0] - adds r3, 0x7E - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x1] - ands r2, r1 - mov r3, r9 - orrs r2, r3 - strb r2, [r0, 0x1] - ldr r0, [r5] - adds r0, 0x7E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - str r6, [r0] - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - ldr r1, =0x00003f06 - movs r0, 0x4A - bl SetGpuReg - b _08118D5A - .pool -_08118C38: - ldr r1, =0x02022e26 - ldrh r0, [r1] - subs r0, 0xFF - strh r0, [r1] - movs r1, 0xFF - lsls r1, 8 - ands r0, r1 - movs r1, 0xC0 - lsls r1, 6 - cmp r0, r1 - beq _08118C50 - b _08118D5A -_08118C50: - adds r1, r5, r6 - lsls r1, 3 - add r1, r9 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - movs r0, 0xF0 - strh r0, [r1, 0xC] - movs r0, 0x20 - strh r0, [r1, 0xE] - ldr r2, =0x020243fc - ldrh r1, [r2] - ldr r0, =0x0000fffe - ands r0, r1 - strh r0, [r2] - b _08118D5A - .pool -_08118C7C: - ldr r2, =0x02022e26 - ldrh r1, [r2] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - cmp r0, 0 - beq _08118C90 - ldr r3, =0xfffffc04 - adds r0, r1, r3 - strh r0, [r2] -_08118C90: - adds r0, r5, r6 - lsls r0, 3 - mov r2, r9 - adds r1, r0, r2 - ldrh r2, [r1, 0xC] - movs r3, 0xC - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _08118CA6 - subs r0, r2, 0x2 - strh r0, [r1, 0xC] -_08118CA6: - movs r3, 0 - ldr r0, =0x02039b28 - mov r12, r0 - ldr r2, =0x02038c28 - mov r8, r2 - mov r7, r12 - adds r4, r1, 0 -_08118CB4: - lsls r2, r3, 1 - ldrb r1, [r7, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r2, r0 - add r2, r8 - ldrh r0, [r4, 0xC] - strh r0, [r2] - adds r3, 0x1 - cmp r3, 0x4F - ble _08118CB4 - cmp r3, 0x9F - bgt _08118CF8 - ldr r0, =0x02038c28 - mov r8, r0 - ldr r7, =0x02039b28 - ldr r1, =0x03005e00 - adds r0, r5, r6 - lsls r0, 3 - adds r4, r0, r1 -_08118CDE: - lsls r2, r3, 1 - ldrb r1, [r7, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r2, r0 - add r2, r8 - ldrh r0, [r4, 0xC] - negs r0, r0 - strh r0, [r2] - adds r3, 0x1 - cmp r3, 0x9F - ble _08118CDE -_08118CF8: - adds r0, r5, r6 - lsls r0, 3 - mov r2, r9 - adds r1, r0, r2 - movs r3, 0xC - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _08118D5A - movs r0, 0x3 - mov r2, r12 - strb r0, [r2, 0x15] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - bl SetBgAttribute - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0 - bl SetBgAttribute - movs r1, 0x9C - lsls r1, 8 - movs r0, 0xA - bl SetGpuReg - movs r1, 0xBC - lsls r1, 7 - movs r0, 0xC - bl SetGpuReg - b _08118D5A - .pool -_08118D54: - adds r0, r6, 0 - bl sub_811828C -_08118D5A: - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end task00_battle_intro_wireless - - thumb_func_start sub_8118D68 -sub_8118D68: @ 8118D68 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r6, r1, 0 - cmp r0, 0x5 - bls _08118D86 - b _08118FB2 -_08118D86: - lsls r0, 2 - ldr r1, =_08118D98 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08118D98: - .4byte _08118DB0 - .4byte _08118DBE - .4byte _08118E4C - .4byte _08118EA8 - .4byte _08118F00 - .4byte _08118FAC -_08118DB0: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r6 - movs r1, 0x1 - strh r1, [r0, 0xC] - b _08118F84 -_08118DBE: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r6 - ldrh r0, [r1, 0xC] - subs r0, 0x1 - strh r0, [r1, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _08118DD4 - b _08118FB2 -_08118DD4: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - ldr r1, =0x00005c0a - movs r0, 0xA - bl SetGpuReg - ldr r1, =0x00005e0a - movs r0, 0xC - bl SetGpuReg - movs r0, 0 - bl GetGpuReg - adds r1, r0, 0 - ldr r2, =0x0000f040 - adds r0, r2, 0 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0 - bl SetGpuReg - movs r1, 0xF8 - lsls r1, 6 - movs r0, 0x48 - bl SetGpuReg - ldr r1, =0x00003f3f - movs r0, 0x4A - bl SetGpuReg - ldr r1, =0x02022e16 - ldr r2, =0x0000ffd0 - adds r0, r2, 0 - strh r0, [r1] - ldr r1, =0x02022e18 - movs r0, 0xF0 - strh r0, [r1] - ldr r1, =0x02022e1c - subs r2, 0xC0 - adds r0, r2, 0 - strh r0, [r1] - b _08118FB2 - .pool -_08118E4C: - ldr r2, =0x02022e26 - ldrh r3, [r2] - movs r1, 0x80 - lsls r1, 1 - adds r0, r1, 0 - adds r1, r3, r0 - strh r1, [r2] - movs r5, 0xFF - lsls r5, 8 - ands r1, r5 - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - beq _08118E6E - adds r0, r3, 0 - adds r0, 0xFF - strh r0, [r2] -_08118E6E: - ldrh r0, [r2] - adds r1, r5, 0 - ands r1, r0 - movs r0, 0x80 - lsls r0, 6 - cmp r1, r0 - beq _08118E7E - b _08118FB2 -_08118E7E: - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r6 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - movs r0, 0xF0 - strh r0, [r1, 0xC] - ldr r2, =0x020243fc - ldrh r1, [r2] - ldr r0, =0x0000fffe - ands r0, r1 - strh r0, [r2] - b _08118FB2 - .pool -_08118EA8: - ldr r3, =0x02022e26 - ldrh r2, [r3] - movs r0, 0xFF - lsls r0, 8 - ands r0, r2 - movs r1, 0x98 - lsls r1, 7 - cmp r0, r1 - beq _08118EC2 - movs r1, 0xFF - lsls r1, 2 - adds r0, r2, r1 - strh r0, [r3] -_08118EC2: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r3, r0, r6 - ldrh r1, [r3, 0xC] - movs r2, 0xC - ldrsh r0, [r3, r2] - cmp r0, 0 - beq _08118ED8 - subs r0, r1, 0x2 - strh r0, [r3, 0xC] -_08118ED8: - ldr r1, =0x02022e18 - ldrh r0, [r3, 0xC] - strh r0, [r1] - ldr r2, =0x02022e1c - negs r1, r0 - strh r1, [r2] - lsls r0, 16 - cmp r0, 0 - bne _08118FB2 - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] - b _08118FB2 - .pool -_08118F00: - ldr r1, =0x02022e16 - ldrh r0, [r1] - adds r3, r0, 0x2 - strh r3, [r1] - ldr r1, =0x02022e1e - ldrh r0, [r1] - adds r0, 0x2 - strh r0, [r1] - ldr r5, =0x02022e26 - ldrh r2, [r5] - movs r0, 0xFF - lsls r0, 8 - ands r0, r2 - movs r1, 0xA0 - lsls r1, 7 - cmp r0, r1 - beq _08118F28 - adds r0, r2, 0 - adds r0, 0xFF - strh r0, [r5] -_08118F28: - lsls r0, r3, 16 - lsrs r0, 16 - cmp r0, 0 - bne _08118FB2 - str r0, [sp] - ldr r1, =0x0600e000 - ldr r2, =0x05000800 - mov r0, sp - bl CpuSet - movs r0, 0 - bl GetGpuReg - ldr r1, =0x0000bfff - ands r1, r0 - movs r0, 0 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - bl SetBgAttribute - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0 - bl SetBgAttribute - movs r1, 0x9C - lsls r1, 8 - movs r0, 0xA - bl SetGpuReg - movs r1, 0xBC - lsls r1, 7 - movs r0, 0xC - bl SetGpuReg - ldr r1, =0x02039b28 - movs r0, 0x3 - strb r0, [r1, 0x15] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 -_08118F84: - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - b _08118FB2 - .pool -_08118FAC: - adds r0, r4, 0 - bl sub_811828C -_08118FB2: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8118D68 - - thumb_func_start sub_8118FBC -sub_8118FBC: @ 8118FBC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - str r0, [sp] - adds r6, r2, 0 - adds r4, r3, 0 - ldr r0, [sp, 0x24] - ldr r7, [sp, 0x28] - ldr r2, [sp, 0x2C] - mov r9, r2 - ldr r5, [sp, 0x30] - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020244d4 - ldr r2, [r1] - lsls r4, 2 - adds r2, 0x4 - adds r2, r4 - ldr r1, =0x020244e4 - adds r0, r1 - ldrb r1, [r0] - lsls r1, 11 - ldr r0, [r2] - adds r0, r1 - movs r2, 0x80 - lsls r2, 3 - adds r1, r7, 0 - bl CpuSet - ldr r1, [sp] - lsls r0, r1, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 5 - adds r1, r7, 0 - adds r3, r5, 0 - bl LoadBgTiles - adds r0, r6, 0 - adds r0, 0x8 - cmp r6, r0 - bge _08119068 - mov r12, r0 - mov r2, r8 - lsls r7, r2, 1 -_0811903A: - mov r1, r8 - adds r2, r1, 0 - adds r2, 0x8 - adds r4, r6, 0x1 - cmp r1, r2 - bge _08119062 - mov r0, r10 - lsls r3, r0, 12 - lsls r0, r6, 6 - add r0, r9 - adds r6, r7, r0 - subs r1, r2, r1 -_08119052: - adds r0, r5, 0 - orrs r0, r3 - strh r0, [r6] - adds r5, 0x1 - adds r6, 0x2 - subs r1, 0x1 - cmp r1, 0 - bne _08119052 -_08119062: - adds r6, r4, 0 - cmp r6, r12 - blt _0811903A -_08119068: - ldr r1, [sp] - lsls r0, r1, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 4 - mov r1, r9 - movs r3, 0 - bl LoadBgTilemap - 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_8118FBC - - thumb_func_start sub_8119094 -sub_8119094: @ 8119094 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r4, [sp, 0x24] - ldr r5, [sp, 0x28] - mov r8, r5 - ldr r5, [sp, 0x2C] - ldr r6, [sp, 0x30] - mov r9, r6 - lsls r0, 24 - lsrs r0, 24 - mov r12, r0 - lsls r1, 24 - lsls r2, 24 - lsls r3, 24 - lsls r4, 24 - lsrs r4, 24 - mov r10, r4 - mov r7, r8 - lsls r7, 16 - lsrs r6, r7, 16 - lsls r5, 24 - lsrs r5, 24 - mov r0, r9 - lsls r0, 24 - mov r9, r0 - ldr r4, =0x040000d4 - ldr r0, =0x020244d4 - ldr r0, [r0] - lsrs r2, 22 - adds r0, 0x4 - adds r0, r2 - lsrs r3, 13 - ldr r0, [r0] - adds r0, r3 - str r0, [r4] - movs r0, 0xC0 - lsls r0, 19 - adds r6, r0 - str r6, [r4, 0x4] - ldr r0, =0x80000400 - str r0, [r4, 0x8] - ldr r0, [r4, 0x8] - adds r2, r7, 0 - lsrs r2, 21 - mov r6, r9 - lsrs r6, 15 - subs r4, r2, r6 - lsrs r0, r1, 24 - adds r1, r0, 0 - adds r1, 0x8 - cmp r0, r1 - bge _08119148 - mov r9, r1 - mov r7, r12 - lsls r7, 1 - mov r8, r7 - lsls r5, 11 - str r5, [sp] -_08119110: - mov r2, r12 - adds r3, r2, 0 - adds r3, 0x8 - adds r5, r0, 0x1 - cmp r2, r3 - bge _08119142 - mov r1, r10 - lsls r6, r1, 12 - lsls r0, 6 - movs r7, 0xC0 - lsls r7, 19 - adds r0, r7 - ldr r1, [sp] - adds r0, r1, r0 - mov r7, r8 - adds r1, r7, r0 - subs r2, r3, r2 -_08119132: - adds r0, r4, 0 - orrs r0, r6 - strh r0, [r1] - adds r4, 0x1 - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bne _08119132 -_08119142: - adds r0, r5, 0 - cmp r0, r9 - blt _08119110 -_08119148: - 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_8119094 - - thumb_func_start MovePlayerOnBike -@ void MovePlayerOnBike(int dpad_direction, int buttons_new, int buttons_held) -MovePlayerOnBike: @ 8119164 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 16 - lsrs r2, 16 - ldr r0, =0x02037590 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0811918C - adds r0, r3, 0 - adds r1, r4, 0 - bl MovePlayerOnMachBike - b _08119194 - .pool -_0811918C: - adds r0, r3, 0 - adds r1, r4, 0 - bl MovePlayerOnAcroBike -_08119194: - pop {r4} - pop {r0} - bx r0 - thumb_func_end MovePlayerOnBike - - thumb_func_start MovePlayerOnMachBike -MovePlayerOnMachBike: @ 811919C - push {r4,lr} - sub sp, 0x4 - mov r1, sp - strb r0, [r1] - ldr r4, =gUnknown_0859744C - mov r0, sp - bl CheckMovementInputMachBike - lsls r0, 24 - lsrs r0, 22 - adds r0, r4 - mov r1, sp - ldrb r1, [r1] - ldr r2, [r0] - adds r0, r1, 0 - bl _call_via_r2 - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end MovePlayerOnMachBike - - thumb_func_start CheckMovementInputMachBike -CheckMovementInputMachBike: @ 81191CC - push {r4,lr} - adds r4, r0, 0 - bl player_get_direction_upper_nybble - lsls r0, 24 - lsrs r0, 24 - adds r3, r0, 0 - ldrb r1, [r4] - cmp r1, 0 - bne _081191F4 - strb r0, [r4] - ldr r2, =0x02037590 - ldrb r0, [r2, 0xB] - cmp r0, 0 - bne _08119208 - strb r1, [r2, 0x2] - movs r0, 0 - b _0811921C - .pool -_081191F4: - ldr r2, =0x02037590 - cmp r1, r3 - beq _08119218 - ldrb r0, [r2, 0x2] - cmp r0, 0x2 - beq _08119218 - ldrb r0, [r2, 0xB] - cmp r0, 0 - beq _08119214 - strb r3, [r4] -_08119208: - movs r0, 0x2 - strb r0, [r2, 0x2] - movs r0, 0x3 - b _0811921C - .pool -_08119214: - movs r0, 0x1 - b _0811921A -_08119218: - movs r0, 0x2 -_0811921A: - strb r0, [r2, 0x2] -_0811921C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end CheckMovementInputMachBike - - thumb_func_start sub_8119224 -sub_8119224: @ 8119224 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl PlayerFaceDirection - bl sub_811A128 - pop {r0} - bx r0 - thumb_func_end sub_8119224 - - thumb_func_start sub_8119238 -sub_8119238: @ 8119238 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - ldrb r1, [r4, 0x1E] - adds r0, r5, 0 - bl sub_8119F74 - lsls r0, 24 - cmp r0, 0 - beq _08119270 - adds r0, r5, 0 - bl PlayerTurnInPlace - bl sub_811A128 - b _0811927A - .pool -_08119270: - ldrb r0, [r4, 0x18] - lsls r0, 28 - lsrs r0, 28 - bl sub_8119224 -_0811927A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8119238 - - thumb_func_start sub_8119280 -sub_8119280: @ 8119280 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r7, r5, 0 - ldr r6, =0x02037590 - ldrb r1, [r6, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - ldrb r1, [r4, 0x1E] - adds r0, r5, 0 - bl sub_8119F74 - lsls r0, 24 - cmp r0, 0 - bne _081192C6 - ldrb r0, [r6, 0xB] - cmp r0, 0 - beq _081192BC - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl sub_8119344 - b _0811933A - .pool -_081192BC: - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl sub_8119224 - b _0811933A -_081192C6: - adds r0, r5, 0 - bl sub_8119E38 - lsls r0, 24 - lsrs r4, r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0xA - bhi _08119316 - cmp r4, 0x6 - bne _081192E8 - adds r0, r5, 0 - bl PlayerJumpLedge - b _0811933A -_081192E8: - bl sub_811A128 - cmp r4, 0x4 - bne _08119304 - adds r0, r5, 0 - bl IsPlayerCollidingWithFarawayIslandMew - lsls r0, 24 - cmp r0, 0 - beq _08119304 - adds r0, r5, 0 - bl PlayerOnBikeCollideWithFarawayIslandMew - b _0811933A -_08119304: - subs r0, r4, 0x5 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _0811933A - adds r0, r7, 0 - bl PlayerOnBikeCollide - b _0811933A -_08119316: - ldr r1, =gUnknown_0859745C - ldrb r0, [r6, 0xA] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r7, 0 - bl _call_via_r1 - ldrb r2, [r6, 0xA] - lsls r0, r2, 24 - lsrs r1, r0, 24 - lsrs r0, 25 - adds r0, r2, r0 - strb r0, [r6, 0xB] - cmp r1, 0x1 - bhi _0811933A - adds r0, r2, 0x1 - strb r0, [r6, 0xA] -_0811933A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8119280 - - thumb_func_start sub_8119344 -sub_8119344: @ 8119344 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r7, r5, 0 - ldr r6, =0x02037590 - ldrb r0, [r6, 0xB] - cmp r0, 0 - beq _0811935A - subs r0, 0x1 - strb r0, [r6, 0xB] - strb r0, [r6, 0xA] -_0811935A: - adds r0, r5, 0 - bl sub_8119E38 - lsls r0, 24 - lsrs r4, r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0xA - bhi _081193AE - cmp r4, 0x6 - bne _08119380 - adds r0, r5, 0 - bl PlayerJumpLedge - b _081193BE - .pool -_08119380: - bl sub_811A128 - cmp r4, 0x4 - bne _0811939C - adds r0, r5, 0 - bl IsPlayerCollidingWithFarawayIslandMew - lsls r0, 24 - cmp r0, 0 - beq _0811939C - adds r0, r5, 0 - bl PlayerOnBikeCollideWithFarawayIslandMew - b _081193BE -_0811939C: - subs r0, r4, 0x5 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _081193BE - adds r0, r7, 0 - bl PlayerOnBikeCollide - b _081193BE -_081193AE: - ldr r0, =gUnknown_0859745C - ldrb r1, [r6, 0xA] - lsls r1, 2 - adds r1, r0 - ldr r1, [r1] - adds r0, r7, 0 - bl _call_via_r1 -_081193BE: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8119344 - - thumb_func_start MovePlayerOnAcroBike -@ void MovePlayerOnAcroBike(int dpad_direction, int buttons_new, int buttons_held) -MovePlayerOnAcroBike: @ 81193C8 - push {r4,lr} - sub sp, 0x4 - mov r3, sp - strb r0, [r3] - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - ldr r4, =gUnknown_08597468 - mov r0, sp - bl CheckMovementInputAcroBike - lsls r0, 24 - lsrs r0, 22 - adds r0, r4 - mov r1, sp - ldrb r1, [r1] - ldr r2, [r0] - adds r0, r1, 0 - bl _call_via_r2 - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end MovePlayerOnAcroBike - - thumb_func_start CheckMovementInputAcroBike -CheckMovementInputAcroBike: @ 8119400 - push {r4,lr} - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - ldr r4, =gUnknown_0859749C - ldr r3, =0x02037590 - ldrb r3, [r3, 0x8] - lsls r3, 2 - adds r3, r4 - ldr r3, [r3] - bl _call_via_r3 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end CheckMovementInputAcroBike - - thumb_func_start CheckMovementInputAcroBikeNormal -CheckMovementInputAcroBikeNormal: @ 811942C - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r6, r1, 16 - lsls r2, 16 - lsrs r5, r2, 16 - bl player_get_direction_upper_nybble - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =0x02037590 - movs r0, 0 - strb r0, [r2, 0xA] - ldrb r1, [r4] - cmp r1, 0 - bne _0811946C - movs r0, 0x2 - ands r0, r6 - cmp r0, 0 - beq _08119464 - strb r3, [r4] - strb r1, [r2, 0x2] - movs r0, 0x2 - strb r0, [r2, 0x8] - movs r0, 0x3 - b _081194C0 - .pool -_08119464: - strb r3, [r4] - strb r1, [r2, 0x2] - movs r0, 0 - b _081194C0 -_0811946C: - cmp r1, r3 - bne _08119492 - movs r0, 0x2 - ands r0, r5 - cmp r0, 0 - beq _0811948A - ldrb r0, [r2, 0xB] - cmp r0, 0 - bne _0811948A - adds r0, 0x1 - strb r0, [r2, 0xB] - movs r0, 0x4 - strb r0, [r2, 0x8] - movs r0, 0xB - b _081194C0 -_0811948A: - ldrb r0, [r4] - ldr r2, =0x02037590 - cmp r0, r3 - beq _081194BC -_08119492: - ldr r0, =0x02037590 - ldrb r1, [r0, 0x2] - adds r2, r0, 0 - cmp r1, 0x2 - beq _081194BC - movs r1, 0 - movs r0, 0x1 - strb r0, [r2, 0x8] - ldrb r0, [r4] - strb r0, [r2, 0x9] - strb r1, [r2, 0x2] - adds r0, r4, 0 - adds r1, r6, 0 - adds r2, r5, 0 - bl CheckMovementInputAcroBike - lsls r0, 24 - lsrs r0, 24 - b _081194C0 - .pool -_081194BC: - movs r0, 0x2 - strb r0, [r2, 0x2] -_081194C0: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end CheckMovementInputAcroBikeNormal - - thumb_func_start CheckMovementInputAcroBikeChangingDirection -CheckMovementInputAcroBikeChangingDirection: @ 81194C8 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r4, =0x02037590 - ldrb r0, [r4, 0x9] - strb r0, [r5] - ldrb r0, [r4, 0xA] - adds r0, 0x1 - strb r0, [r4, 0xA] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6 - bls _081194F4 - movs r0, 0x1 - strb r0, [r4, 0x2] - movs r0, 0 - strb r0, [r4, 0x8] - bl sub_811A128 - movs r0, 0x1 - b _0811953A - .pool -_081194F4: - bl player_get_direction_upper_nybble - lsls r0, 24 - lsrs r6, r0, 24 - bl sub_8119D30 - ldrb r1, [r5] - lsls r0, 24 - lsrs r0, 24 - cmp r1, r0 - bne _08119536 - bl sub_811A128 - movs r0, 0x1 - strb r0, [r4, 0xB] - adds r0, r6, 0 - bl GetOppositeDirection - ldrb r1, [r5] - lsls r0, 24 - lsrs r0, 24 - cmp r1, r0 - bne _0811952A - movs r0, 0x6 - strb r0, [r4, 0x8] - movs r0, 0x9 - b _0811953A -_0811952A: - movs r0, 0x2 - strb r0, [r4, 0x2] - movs r0, 0x5 - strb r0, [r4, 0x8] - movs r0, 0x8 - b _0811953A -_08119536: - strb r6, [r5] - movs r0, 0 -_0811953A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end CheckMovementInputAcroBikeChangingDirection - - thumb_func_start CheckMovementInputAcroBikeStandingWheelie -CheckMovementInputAcroBikeStandingWheelie: @ 8119540 - push {r4-r7,lr} - adds r7, r0, 0 - lsls r4, r2, 16 - lsrs r4, 16 - bl player_get_direction_upper_nybble - lsls r0, 24 - lsrs r6, r0, 24 - ldr r5, =0x02037590 - ldrb r1, [r5, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r1, r0, r1 - movs r0, 0 - strb r0, [r5, 0x2] - movs r0, 0x2 - ands r4, r0 - lsls r4, 16 - lsrs r4, 16 - cmp r4, 0 - bne _08119594 - strb r4, [r5, 0xA] - ldrb r0, [r1, 0x1E] - bl MetatileBehavior_IsBumpySlope - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0811959A - strb r6, [r7] - strb r0, [r5, 0x8] - bl sub_811A128 - movs r0, 0x4 - b _081195D8 - .pool -_08119594: - ldrb r0, [r5, 0xA] - adds r0, 0x1 - strb r0, [r5, 0xA] -_0811959A: - ldr r1, =0x02037590 - ldrb r0, [r1, 0xA] - cmp r0, 0x27 - bls _081195B4 - strb r6, [r7] - movs r0, 0x3 - strb r0, [r1, 0x8] - bl sub_811A128 - movs r0, 0x6 - b _081195D8 - .pool -_081195B4: - ldrb r0, [r7] - cmp r0, r6 - bne _081195CA - movs r0, 0x2 - strb r0, [r1, 0x2] - movs r0, 0x4 - strb r0, [r1, 0x8] - bl sub_811A128 - movs r0, 0xA - b _081195D8 -_081195CA: - cmp r0, 0 - beq _081195D4 - movs r0, 0x1 - strb r0, [r1, 0x2] - b _081195D6 -_081195D4: - strb r6, [r7] -_081195D6: - movs r0, 0x5 -_081195D8: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end CheckMovementInputAcroBikeStandingWheelie - - thumb_func_start CheckMovementInputAcroBikeBunnyHop -CheckMovementInputAcroBikeBunnyHop: @ 81195E0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r6, r0, 0 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - lsls r2, 16 - lsrs r2, 16 - mov r8, r2 - bl player_get_direction_upper_nybble - lsls r0, 24 - lsrs r5, r0, 24 - adds r2, r5, 0 - ldr r4, =0x02037590 - ldrb r1, [r4, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r7, r0, r1 - movs r0, 0x2 - mov r1, r8 - ands r0, r1 - cmp r0, 0 - bne _08119652 - bl sub_811A128 - ldrb r0, [r7, 0x1E] - bl MetatileBehavior_IsBumpySlope - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _08119648 - movs r0, 0x2 - strb r0, [r4, 0x8] - adds r0, r6, 0 - mov r1, r9 - mov r2, r8 - bl CheckMovementInputAcroBike - lsls r0, 24 - lsrs r0, 24 - b _08119676 - .pool -_08119648: - strb r5, [r6] - strb r0, [r4, 0x2] - strb r0, [r4, 0x8] - movs r0, 0x4 - b _08119676 -_08119652: - ldrb r0, [r6] - cmp r0, 0 - bne _0811965C - strb r5, [r6] - b _08119668 -_0811965C: - cmp r0, r2 - beq _0811966E - ldrb r0, [r4, 0x2] - cmp r0, 0x2 - beq _0811966E - movs r0, 0x1 -_08119668: - strb r0, [r4, 0x2] - movs r0, 0x6 - b _08119676 -_0811966E: - ldr r1, =0x02037590 - movs r0, 0x2 - strb r0, [r1, 0x2] - movs r0, 0x7 -_08119676: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end CheckMovementInputAcroBikeBunnyHop - - thumb_func_start CheckMovementInputAcroBikeMovingWheelie -CheckMovementInputAcroBikeMovingWheelie: @ 8119688 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r6, r0, 0 - lsls r1, 16 - lsrs r1, 16 - mov r10, r1 - lsls r2, 16 - lsrs r2, 16 - mov r8, r2 - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r5, r0, 24 - adds r2, r5, 0 - ldr r4, =0x02037590 - ldrb r1, [r4, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r7, r0, r1 - movs r0, 0x2 - mov r9, r0 - movs r0, 0x2 - mov r1, r8 - ands r0, r1 - cmp r0, 0 - bne _08119720 - bl sub_811A128 - ldrb r0, [r7, 0x1E] - bl MetatileBehavior_IsBumpySlope - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0811970C - strb r1, [r4, 0x8] - ldrb r0, [r6] - cmp r0, 0 - bne _081196EC - strb r5, [r6] - b _081196F6 - .pool -_081196EC: - cmp r0, r5 - beq _081196FC - ldrb r0, [r4, 0x2] - cmp r0, 0x2 - beq _081196FC -_081196F6: - strb r1, [r4, 0x2] - movs r0, 0x4 - b _08119750 -_081196FC: - ldr r1, =0x02037590 - movs r0, 0x2 - strb r0, [r1, 0x2] - movs r0, 0xC - b _08119750 - .pool -_0811970C: - mov r0, r9 - strb r0, [r4, 0x8] - adds r0, r6, 0 - mov r1, r10 - mov r2, r8 - bl CheckMovementInputAcroBike - lsls r0, 24 - lsrs r0, 24 - b _08119750 -_08119720: - ldrb r0, [r6] - cmp r0, 0 - bne _08119736 - strb r5, [r6] - mov r1, r9 - strb r1, [r4, 0x8] - strb r0, [r4, 0x2] - bl sub_811A128 - movs r0, 0x5 - b _08119750 -_08119736: - cmp r2, r0 - beq _08119748 - ldrb r0, [r4, 0x2] - cmp r0, 0x2 - beq _08119748 - movs r0, 0 - strb r0, [r4, 0x2] - movs r0, 0x5 - b _08119750 -_08119748: - ldr r1, =0x02037590 - movs r0, 0x2 - strb r0, [r1, 0x2] - movs r0, 0xA -_08119750: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end CheckMovementInputAcroBikeMovingWheelie - - thumb_func_start CheckMovementInputAcroBikeUnknownMode5 -CheckMovementInputAcroBikeUnknownMode5: @ 8119764 - push {r4-r6,lr} - mov r6, r8 - push {r6} - mov r8, r0 - adds r4, r1, 0 - adds r5, r2, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - ldr r6, =0x02037590 - ldrb r1, [r6, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - ldrb r2, [r0, 0x1] - movs r1, 0x3 - negs r1, r1 - ands r1, r2 - strb r1, [r0, 0x1] - ldrb r1, [r0, 0x18] - lsls r1, 28 - lsrs r1, 28 - bl FieldObjectSetDirection - movs r0, 0 - strb r0, [r6, 0x8] - mov r0, r8 - adds r1, r4, 0 - adds r2, r5, 0 - bl CheckMovementInputAcroBike - lsls r0, 24 - lsrs r0, 24 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end CheckMovementInputAcroBikeUnknownMode5 - - thumb_func_start CheckMovementInputAcroBikeUnknownMode6 -CheckMovementInputAcroBikeUnknownMode6: @ 81197C0 - push {r4,lr} - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - ldr r4, =0x02037590 - movs r3, 0 - strb r3, [r4, 0x8] - bl CheckMovementInputAcroBike - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end CheckMovementInputAcroBikeUnknownMode6 - - thumb_func_start sub_81197E4 -sub_81197E4: @ 81197E4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl PlayerFaceDirection - pop {r0} - bx r0 - thumb_func_end sub_81197E4 - - thumb_func_start sub_81197F4 -sub_81197F4: @ 81197F4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r5, r0, r1 - ldrb r1, [r5, 0x1E] - adds r0, r4, 0 - bl sub_8119F74 - lsls r0, 24 - cmp r0, 0 - bne _0811981A - ldrb r0, [r5, 0x18] - lsrs r4, r0, 4 -_0811981A: - adds r0, r4, 0 - bl PlayerFaceDirection - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81197F4 - - thumb_func_start sub_8119830 -sub_8119830: @ 8119830 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - ldrb r1, [r4, 0x1E] - adds r0, r5, 0 - bl sub_8119F74 - lsls r0, 24 - cmp r0, 0 - bne _08119868 - ldrb r0, [r4, 0x18] - lsrs r0, 4 - bl sub_81197E4 - b _081198BA - .pool -_08119868: - adds r0, r5, 0 - bl sub_8119E38 - lsls r0, 24 - lsrs r4, r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0xA - bhi _081198B4 - cmp r4, 0x6 - bne _0811988A - adds r0, r5, 0 - bl PlayerJumpLedge - b _081198BA -_0811988A: - cmp r4, 0x4 - bne _081198A2 - adds r0, r5, 0 - bl IsPlayerCollidingWithFarawayIslandMew - lsls r0, 24 - cmp r0, 0 - beq _081198A2 - adds r0, r5, 0 - bl PlayerOnBikeCollideWithFarawayIslandMew - b _081198BA -_081198A2: - subs r0, r4, 0x5 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _081198BA - adds r0, r6, 0 - bl PlayerOnBikeCollide - b _081198BA -_081198B4: - adds r0, r6, 0 - bl PlayerGoSpeed2 -_081198BA: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8119830 - - thumb_func_start sub_81198C0 -sub_81198C0: @ 81198C0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r5, r0, r1 - ldrb r1, [r5, 0x1E] - adds r0, r4, 0 - bl sub_8119F74 - lsls r0, 24 - cmp r0, 0 - bne _081198E6 - ldrb r0, [r5, 0x18] - lsrs r4, r0, 4 -_081198E6: - adds r0, r4, 0 - bl sub_808B8C0 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81198C0 - - thumb_func_start sub_81198FC -sub_81198FC: @ 81198FC - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r5, r0, r1 - ldrb r1, [r5, 0x1E] - adds r0, r4, 0 - bl sub_8119F74 - lsls r0, 24 - cmp r0, 0 - bne _08119922 - ldrb r0, [r5, 0x18] - lsrs r4, r0, 4 -_08119922: - adds r0, r4, 0 - bl sub_808B8D8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81198FC - - thumb_func_start sub_8119938 -sub_8119938: @ 8119938 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r5, r0, r1 - ldrb r1, [r5, 0x1E] - adds r0, r4, 0 - bl sub_8119F74 - lsls r0, 24 - cmp r0, 0 - bne _0811995E - ldrb r0, [r5, 0x18] - lsrs r4, r0, 4 -_0811995E: - adds r0, r4, 0 - bl sub_808B8A8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8119938 - - thumb_func_start sub_8119974 -sub_8119974: @ 8119974 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r5, r0, r1 - ldrb r1, [r5, 0x1E] - adds r0, r4, 0 - bl sub_8119F74 - lsls r0, 24 - cmp r0, 0 - bne _0811999A - ldrb r0, [r5, 0x18] - lsrs r4, r0, 4 -_0811999A: - adds r0, r4, 0 - bl sub_808B8F0 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8119974 - - thumb_func_start sub_81199B0 -sub_81199B0: @ 81199B0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r5, r0, r1 - ldrb r1, [r5, 0x1E] - adds r0, r4, 0 - bl sub_8119F74 - lsls r0, 24 - cmp r0, 0 - bne _081199E4 - ldrb r0, [r5, 0x18] - lsrs r0, 4 - bl sub_8119974 - b _08119A1E - .pool -_081199E4: - adds r0, r4, 0 - bl sub_8119E38 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _08119A18 - cmp r1, 0x9 - beq _08119A18 - cmp r1, 0x6 - bne _08119A02 - adds r0, r4, 0 - bl sub_808B938 - b _08119A1E -_08119A02: - subs r0, r1, 0x5 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _08119A1E - cmp r1, 0xB - bhi _08119A18 - adds r0, r4, 0 - bl sub_8119974 - b _08119A1E -_08119A18: - adds r0, r4, 0 - bl sub_808B914 -_08119A1E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81199B0 - - thumb_func_start sub_8119A24 -sub_8119A24: @ 8119A24 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - bl sub_8119E38 - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0 - beq _08119A58 - cmp r0, 0x7 - beq _08119A84 - cmp r0, 0x9 - bls _08119A50 - adds r0, r1, 0 - adds r1, r5, 0 - bl sub_8119FC4 - lsls r0, 24 - cmp r0, 0 - bne _08119A58 -_08119A50: - adds r0, r5, 0 - bl sub_81197F4 - b _08119A84 -_08119A58: - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - movs r0, 0x22 - bl audio_play - ldrb r0, [r4, 0x1] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4, 0x1] - adds r0, r5, 0 - bl sub_8093514 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl player_npc_set_state_and_x22_etc -_08119A84: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8119A24 - - thumb_func_start sub_8119A94 -sub_8119A94: @ 8119A94 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_808B95C - pop {r0} - bx r0 - thumb_func_end sub_8119A94 - - thumb_func_start sub_8119AA4 -sub_8119AA4: @ 8119AA4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - ldr r7, =0x02037590 - ldrb r1, [r7, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r5, r0, r1 - ldrb r1, [r5, 0x1E] - adds r0, r4, 0 - bl sub_8119F74 - lsls r0, 24 - cmp r0, 0 - bne _08119ADC - ldrb r0, [r5, 0x18] - lsrs r0, 4 - bl sub_808B8A8 - b _08119B2C - .pool -_08119ADC: - adds r0, r4, 0 - bl sub_8119E38 - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xFF - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0xA - bhi _08119B22 - cmp r1, 0x6 - bne _08119AFE - adds r0, r4, 0 - bl sub_808B938 - b _08119B2C -_08119AFE: - cmp r1, 0x9 - beq _08119B12 - cmp r1, 0x4 - bhi _08119B2C - ldrb r0, [r5, 0x1E] - bl MetatileBehavior_IsBumpySlope - lsls r0, 24 - cmp r0, 0 - beq _08119B1A -_08119B12: - adds r0, r4, 0 - bl sub_808B8A8 - b _08119B2C -_08119B1A: - adds r0, r4, 0 - bl sub_808B980 - b _08119B2C -_08119B22: - adds r0, r6, 0 - bl sub_808B9BC - movs r0, 0x2 - strb r0, [r7, 0x2] -_08119B2C: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8119AA4 - - thumb_func_start sub_8119B34 -sub_8119B34: @ 8119B34 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - ldr r7, =0x02037590 - ldrb r1, [r7, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r5, r0, r1 - ldrb r1, [r5, 0x1E] - adds r0, r4, 0 - bl sub_8119F74 - lsls r0, 24 - cmp r0, 0 - bne _08119B6C - ldrb r0, [r5, 0x18] - lsrs r0, 4 - bl sub_808B8C0 - b _08119BBC - .pool -_08119B6C: - adds r0, r4, 0 - bl sub_8119E38 - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xFF - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0xA - bhi _08119BB2 - cmp r1, 0x6 - bne _08119B8E - adds r0, r4, 0 - bl sub_808B938 - b _08119BBC -_08119B8E: - cmp r1, 0x9 - beq _08119BA2 - cmp r1, 0x4 - bhi _08119BBC - ldrb r0, [r5, 0x1E] - bl MetatileBehavior_IsBumpySlope - lsls r0, 24 - cmp r0, 0 - beq _08119BAA -_08119BA2: - adds r0, r4, 0 - bl sub_808B8A8 - b _08119BBC -_08119BAA: - adds r0, r4, 0 - bl sub_808B980 - b _08119BBC -_08119BB2: - adds r0, r6, 0 - bl sub_808B9A4 - movs r0, 0x2 - strb r0, [r7, 0x2] -_08119BBC: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8119B34 - - thumb_func_start sub_8119BC4 -sub_8119BC4: @ 8119BC4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r5, r0, r1 - ldrb r1, [r5, 0x1E] - adds r0, r4, 0 - bl sub_8119F74 - lsls r0, 24 - cmp r0, 0 - bne _08119BFC - ldrb r0, [r5, 0x18] - lsrs r0, 4 - bl sub_808B8D8 - b _08119C36 - .pool -_08119BFC: - adds r0, r4, 0 - bl sub_8119E38 - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xFF - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0xA - bhi _08119C30 - cmp r1, 0x6 - bne _08119C1E - adds r0, r4, 0 - bl PlayerJumpLedge - b _08119C36 -_08119C1E: - subs r0, r1, 0x5 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _08119C36 - adds r0, r4, 0 - bl sub_808B8D8 - b _08119C36 -_08119C30: - adds r0, r6, 0 - bl npc_use_some_d2s -_08119C36: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8119BC4 - - thumb_func_start sub_8119C3C -@ void sub_8119C3C(int buttons_new, int buttons_held) -sub_8119C3C: @ 8119C3C - push {lr} - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, 16 - lsrs r2, r1, 16 - ldr r0, =0x02037590 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08119C5A - adds r0, r3, 0 - adds r1, r2, 0 - bl sub_8119C64 -_08119C5A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8119C3C - - thumb_func_start sub_8119C64 -@ void sub_8119C64(int buttons_new, int buttons_held) -sub_8119C64: @ 8119C64 - push {r4,r5,lr} - lsls r1, 16 - lsrs r5, r1, 16 - adds r0, r5, 0 - bl sub_8119DF8 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r4, =0x02037590 - ldr r0, [r4, 0xC] - movs r1, 0xF - ands r0, r1 - cmp r2, r0 - bne _08119C90 - ldrb r0, [r4, 0x14] - cmp r0, 0xFE - bhi _08119C9A - adds r0, 0x1 - strb r0, [r4, 0x14] - b _08119C9A - .pool -_08119C90: - adds r0, r2, 0 - bl sub_8119D80 - movs r0, 0 - strb r0, [r4, 0xB] -_08119C9A: - movs r0, 0xF - adds r2, r5, 0 - ands r2, r0 - ldr r4, =0x02037590 - ldr r0, [r4, 0x10] - movs r1, 0xF - ands r0, r1 - cmp r2, r0 - bne _08119CBC - ldrb r0, [r4, 0x1C] - cmp r0, 0xFE - bhi _08119CC6 - adds r0, 0x1 - strb r0, [r4, 0x1C] - b _08119CC6 - .pool -_08119CBC: - adds r0, r2, 0 - bl sub_8119DBC - movs r0, 0 - strb r0, [r4, 0xB] -_08119CC6: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8119C64 - - thumb_func_start sub_8119CCC -sub_8119CCC: @ 8119CCC - push {r4,r5,lr} - adds r3, r0, 0 - adds r4, r1, 0 - movs r2, 0 - ldrb r0, [r3] - cmp r0, 0 - beq _08119CF6 - ldr r5, =0x020375a4 -_08119CDC: - adds r0, r2, r5 - adds r1, r3, r2 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bhi _08119D0C - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - adds r0, r3, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _08119CDC -_08119CF6: - movs r2, 0 - ldrb r0, [r4] - cmp r0, 0 - beq _08119D26 - ldr r3, =0x020375ac -_08119D00: - adds r0, r2, r3 - adds r1, r4, r2 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bls _08119D18 -_08119D0C: - movs r0, 0 - b _08119D28 - .pool -_08119D18: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - adds r0, r4, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _08119D00 -_08119D26: - movs r0, 0x1 -_08119D28: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8119CCC - - thumb_func_start sub_8119D30 -sub_8119D30: @ 8119D30 - push {r4-r6,lr} - movs r6, 0 - movs r5, 0 -_08119D36: - ldr r0, =gUnknown_085974C0 - adds r4, r5, r0 - ldr r0, =0x02037590 - ldr r1, [r0, 0xC] - ldr r2, [r0, 0x10] - ldr r0, [r4, 0x8] - ands r1, r0 - ldr r0, [r4, 0xC] - ands r2, r0 - ldr r0, [r4] - cmp r1, r0 - bne _08119D70 - ldr r0, [r4, 0x4] - cmp r2, r0 - bne _08119D70 - ldr r0, [r4, 0x10] - ldr r1, [r4, 0x14] - bl sub_8119CCC - lsls r0, 24 - cmp r0, 0 - beq _08119D70 - ldrb r0, [r4, 0x18] - b _08119D7A - .pool -_08119D70: - adds r5, 0x1C - adds r6, 0x1 - cmp r6, 0x3 - bls _08119D36 - movs r0, 0 -_08119D7A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8119D30 - - thumb_func_start sub_8119D80 -sub_8119D80: @ 8119D80 - push {r4,lr} - lsls r0, 24 - ldr r3, =0x02037590 - ldr r2, [r3, 0xC] - lsls r2, 4 - movs r1, 0xF0 - lsls r1, 20 - ands r1, r0 - lsrs r1, 24 - orrs r2, r1 - str r2, [r3, 0xC] - movs r1, 0x7 - adds r4, r3, 0 - adds r3, 0x14 -_08119D9C: - adds r2, r1, r3 - subs r1, 0x1 - adds r0, r1, r3 - ldrb r0, [r0] - strb r0, [r2] - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0 - bne _08119D9C - movs r0, 0x1 - strb r0, [r4, 0x14] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8119D80 - - thumb_func_start sub_8119DBC -sub_8119DBC: @ 8119DBC - push {r4,lr} - lsls r0, 24 - ldr r3, =0x02037590 - ldr r2, [r3, 0x10] - lsls r2, 4 - movs r1, 0xF0 - lsls r1, 20 - ands r1, r0 - lsrs r1, 24 - orrs r2, r1 - str r2, [r3, 0x10] - movs r1, 0x7 - adds r4, r3, 0 - adds r3, 0x1C -_08119DD8: - adds r2, r1, r3 - subs r1, 0x1 - adds r0, r1, r3 - ldrb r0, [r0] - strb r0, [r2] - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0 - bne _08119DD8 - movs r0, 0x1 - strb r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8119DBC - - thumb_func_start sub_8119DF8 -sub_8119DF8: @ 8119DF8 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - adds r2, r1, 0 - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08119E0C - movs r0, 0x2 - b _08119E32 -_08119E0C: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08119E18 - movs r0, 0x1 - b _08119E32 -_08119E18: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08119E24 - movs r0, 0x3 - b _08119E32 -_08119E24: - movs r0, 0x10 - ands r2, r0 - cmp r2, 0 - bne _08119E30 - movs r0, 0 - b _08119E32 -_08119E30: - movs r0, 0x4 -_08119E32: - pop {r1} - bx r1 - thumb_func_end sub_8119DF8 - - thumb_func_start sub_8119E38 -sub_8119E38: @ 8119E38 - push {r4-r6,lr} - sub sp, 0x8 - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =0x02037590 - ldrb r0, [r0, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - ldrh r1, [r4, 0x10] - add r0, sp, 0x4 - strh r1, [r0] - ldrh r0, [r4, 0x12] - mov r5, sp - adds r5, 0x6 - strh r0, [r5] - adds r0, r6, 0 - add r1, sp, 0x4 - adds r2, r5, 0 - bl MoveCoords - add r0, sp, 0x4 - movs r1, 0 - ldrsh r0, [r0, r1] - movs r2, 0 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - add r1, sp, 0x4 - movs r3, 0 - ldrsh r1, [r1, r3] - movs r3, 0 - ldrsh r2, [r5, r3] - str r0, [sp] - adds r0, r4, 0 - adds r3, r6, 0 - bl sub_8119EA4 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8119E38 - - thumb_func_start sub_8119EA4 -sub_8119EA4: @ 8119EA4 - push {r4,r5,lr} - sub sp, 0x4 - ldr r4, [sp, 0x10] - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - adds r5, r4, 0 - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - str r5, [sp] - bl CheckForFieldObjectCollision - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bhi _08119EE4 - cmp r4, 0 - bne _08119EE0 - adds r0, r5, 0 - bl IsRunningDisallowedByMetatile - lsls r0, 24 - cmp r0, 0 - beq _08119EDC - movs r4, 0x2 -_08119EDC: - cmp r4, 0 - beq _08119EE4 -_08119EE0: - bl sub_8119F50 -_08119EE4: - adds r0, r4, 0 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8119EA4 - - thumb_func_start sub_8119EF0 -sub_8119EF0: @ 8119EF0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl IsRunningDisallowedByMetatile - lsls r0, 24 - cmp r0, 0 - bne _08119F08 - ldr r0, =0x02037318 - ldrb r0, [r0, 0x17] - cmp r0, 0x8 - bne _08119F10 -_08119F08: - movs r0, 0x1 - b _08119F12 - .pool -_08119F10: - movs r0, 0 -_08119F12: - pop {r1} - bx r1 - thumb_func_end sub_8119EF0 - - thumb_func_start IsRunningDisallowedByMetatile -@ bool8 IsRunningDisallowedByMetatile(u8 metatileBehavior) -IsRunningDisallowedByMetatile: @ 8119F18 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl MetatileBehavior_IsRunningDisallowed - lsls r0, 24 - cmp r0, 0 - bne _08119F42 - adds r0, r4, 0 - bl MetatileBehavior_IsFortreeBridge - lsls r0, 24 - cmp r0, 0 - beq _08119F46 - bl PlayerGetZCoord - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - bne _08119F46 -_08119F42: - movs r0, 0x1 - b _08119F48 -_08119F46: - movs r0, 0 -_08119F48: - pop {r4} - pop {r1} - bx r1 - thumb_func_end IsRunningDisallowedByMetatile - - thumb_func_start sub_8119F50 -sub_8119F50: @ 8119F50 - push {lr} - ldr r0, =0x0203ab54 - ldrb r0, [r0] - cmp r0, 0 - beq _08119F66 - ldr r1, =0x0203ab55 - ldrb r0, [r1] - cmp r0, 0x63 - bhi _08119F66 - adds r0, 0x1 - strb r0, [r1] -_08119F66: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8119F50 - - thumb_func_start sub_8119F74 -sub_8119F74: @ 8119F74 - push {r4,r5,lr} - lsls r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - adds r5, r4, 0 - movs r1, 0xFD - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bhi _08119F9E - adds r0, r4, 0 - bl MetatileBehavior_IsIsolatedVerticalRail - lsls r0, 24 - cmp r0, 0 - bne _08119FB6 - adds r0, r4, 0 - bl MetatileBehavior_IsVerticalRail - b _08119FB0 -_08119F9E: - adds r0, r5, 0 - bl MetatileBehavior_IsIsolatedHorizontalRail - lsls r0, 24 - cmp r0, 0 - bne _08119FB6 - adds r0, r5, 0 - bl MetatileBehavior_IsHorizontalRail -_08119FB0: - lsls r0, 24 - cmp r0, 0 - beq _08119FBA -_08119FB6: - movs r0, 0 - b _08119FBC -_08119FBA: - movs r0, 0x1 -_08119FBC: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8119F74 - - thumb_func_start sub_8119FC4 -sub_8119FC4: @ 8119FC4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - adds r2, r0, 0 - lsls r1, 24 - movs r3, 0xFF - lsls r3, 24 - adds r1, r3 - lsrs r1, 24 - cmp r1, 0x1 - bhi _08119FE4 - cmp r0, 0xA - beq _08119FEC - cmp r0, 0xC - bne _08119FF0 - b _08119FEC -_08119FE4: - cmp r2, 0xB - beq _08119FEC - cmp r2, 0xD - bne _08119FF0 -_08119FEC: - movs r0, 0 - b _08119FF2 -_08119FF0: - movs r0, 0x1 -_08119FF2: - pop {r1} - bx r1 - thumb_func_end sub_8119FC4 - - thumb_func_start sub_8119FF8 -sub_8119FF8: @ 8119FF8 - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x02037590 - ldrb r1, [r0] - movs r0, 0x18 - ands r0, r1 - cmp r0, 0 - bne _0811A038 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - 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 IsRunningDisallowedByMetatile - lsls r0, 24 - cmp r0, 0 - bne _0811A038 - movs r0, 0 - b _0811A03A - .pool -_0811A038: - movs r0, 0x1 -_0811A03A: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8119FF8 - - thumb_func_start player_should_look_direction_be_enforced_upon_movement -player_should_look_direction_be_enforced_upon_movement: @ 811A044 - push {lr} - movs r0, 0x4 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _0811A078 - ldr r2, =0x02037350 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1E] - bl MetatileBehavior_IsBumpySlope - lsls r0, 24 - cmp r0, 0 - beq _0811A078 - movs r0, 0 - b _0811A07A - .pool -_0811A078: - movs r0, 0x1 -_0811A07A: - pop {r1} - bx r1 - thumb_func_end player_should_look_direction_be_enforced_upon_movement - - thumb_func_start GetOnOffBike -@ void GetOnOffBike(u8 transitionFlags) -GetOnOffBike: @ 811A080 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x02037348 - movs r0, 0 - strb r0, [r1] - ldr r0, =0x02037590 - ldrb r1, [r0] - movs r0, 0x6 - ands r0, r1 - cmp r0, 0 - beq _0811A0B0 - movs r0, 0x1 - bl SetPlayerAvatarTransitionFlags - bl sav1_reset_battle_music_maybe - bl sub_8085784 - b _0811A0C4 - .pool -_0811A0B0: - adds r0, r2, 0 - bl SetPlayerAvatarTransitionFlags - ldr r4, =0x00000193 - adds r0, r4, 0 - bl sav1_set_battle_music_maybe - adds r0, r4, 0 - bl sub_80858C4 -_0811A0C4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end GetOnOffBike - - thumb_func_start sub_811A0D0 -sub_811A0D0: @ 811A0D0 - push {lr} - ldr r2, =0x02037590 - movs r3, 0 - strb r3, [r2, 0x8] - strb r3, [r2, 0x9] - strb r3, [r2, 0xA] - strb r3, [r2, 0xB] - str r0, [r2, 0xC] - str r1, [r2, 0x10] - movs r1, 0 - adds r2, 0x14 -_0811A0E6: - adds r0, r1, r2 - strb r3, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x7 - bls _0811A0E6 - movs r1, 0 - ldr r3, =0x020375ac - movs r2, 0 -_0811A0FA: - adds r0, r1, r3 - strb r2, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x7 - bls _0811A0FA - pop {r0} - bx r0 - .pool - thumb_func_end sub_811A0D0 - - thumb_func_start sub_811A114 -sub_811A114: @ 811A114 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02037590 - strb r0, [r2, 0xA] - lsrs r1, r0, 1 - adds r0, r1 - strb r0, [r2, 0xB] - bx lr - .pool - thumb_func_end sub_811A114 - - thumb_func_start sub_811A128 -sub_811A128: @ 811A128 - ldr r1, =0x02037590 - movs r0, 0 - strb r0, [r1, 0xA] - strb r0, [r1, 0xB] - bx lr - .pool - thumb_func_end sub_811A128 - - thumb_func_start sub_811A138 -sub_811A138: @ 811A138 - push {lr} - sub sp, 0x8 - ldr r1, =gUnknown_085974B8 - mov r0, sp - movs r2, 0x6 - bl memcpy - ldr r2, =0x02037590 - ldrb r1, [r2] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0811A168 - ldrb r0, [r2, 0xA] - lsls r0, 1 - add r0, sp - movs r1, 0 - ldrsh r0, [r0, r1] - b _0811A182 - .pool -_0811A168: - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0811A174 - movs r0, 0x3 - b _0811A182 -_0811A174: - movs r0, 0x88 - ands r0, r1 - cmp r0, 0 - bne _0811A180 - movs r0, 0x1 - b _0811A182 -_0811A180: - movs r0, 0x2 -_0811A182: - add sp, 0x8 - pop {r1} - bx r1 - thumb_func_end sub_811A138 - - thumb_func_start sub_811A188 -sub_811A188: @ 811A188 - push {r4,r5,lr} - sub sp, 0x4 - ldr r5, =0x02037590 - ldrb r1, [r5] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0811A1D0 - mov r4, sp - adds r4, 0x2 - mov r0, sp - adds r1, r4, 0 - bl PlayerGetDestCoords - 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_IsBumpySlope - lsls r0, 24 - cmp r0, 0 - beq _0811A1D0 - movs r0, 0x2 - strb r0, [r5, 0x8] - bl player_get_direction_upper_nybble - lsls r0, 24 - lsrs r0, 24 - bl sub_808C1B4 -_0811A1D0: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811A188 - - thumb_func_start IsRunningDisallowed -@ bool8 IsRunningDisallowed(u8 metatileBehavior) -IsRunningDisallowed: @ 811A1DC - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02037318 - ldrb r1, [r0, 0x1A] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0811A1FC - adds r0, r2, 0 - bl IsRunningDisallowedByMetatile - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0811A204 -_0811A1FC: - movs r0, 0x1 - b _0811A206 - .pool -_0811A204: - movs r0, 0 -_0811A206: - pop {r1} - bx r1 - thumb_func_end IsRunningDisallowed - - thumb_func_start sub_811A20C -sub_811A20C: @ 811A20C - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - adds r6, r0, 0 - mov r8, r1 - mov r9, r2 - adds r5, r3, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r5, 24 - lsrs r5, 24 - bl ResetTasks - ldr r0, =sub_811A2C0 - movs r1, 0 - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - strh r6, [r0, 0xA] - strh r5, [r0, 0x16] - adds r0, r4, 0 - movs r1, 0x2 - mov r2, r8 - bl SetWordTaskArg - adds r0, r4, 0 - movs r1, 0x4 - mov r2, r9 - bl SetWordTaskArg - ldr r0, =sub_811A278 - bl SetMainCallback2 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811A20C - - thumb_func_start sub_811A278 -sub_811A278: @ 811A278 - push {lr} - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_811A278 - - thumb_func_start sub_811A290 -sub_811A290: @ 811A290 - push {lr} - bl copy_pal_bg_faded_to_pal_ram - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - pop {r0} - bx r0 - thumb_func_end sub_811A290 - - thumb_func_start sub_811A2A4 -sub_811A2A4: @ 811A2A4 - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x03005e00 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - adds r2, r3 - str r1, [r2] - movs r0, 0 - strh r0, [r2, 0x8] - bx lr - .pool - thumb_func_end sub_811A2A4 - - thumb_func_start sub_811A2C0 -sub_811A2C0: @ 811A2C0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl is_c1_link_related_active - cmp r0, 0 - bne _0811A2DC -_0811A2CE: - adds r0, r4, 0 - bl sub_811A428 - lsls r0, 24 - cmp r0, 0 - bne _0811A2CE - b _0811A2EA -_0811A2DC: - adds r0, r4, 0 - bl sub_811A428 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0811A2F2 -_0811A2EA: - ldr r1, =sub_811A2FC - adds r0, r4, 0 - bl sub_811A2A4 -_0811A2F2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811A2C0 - - thumb_func_start sub_811A2FC -sub_811A2FC: @ 811A2FC - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0x5 - bls _0811A318 - b _0811A41C -_0811A318: - lsls r0, 2 - ldr r1, =_0811A32C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0811A32C: - .4byte _0811A344 - .4byte _0811A370 - .4byte _0811A3CC - .4byte _0811A3D4 - .4byte _0811A3EC - .4byte _0811A40C -_0811A344: - ldr r0, =sub_811A290 - bl SetVBlankCallback - movs r4, 0x1 - negs r4, r4 - adds r0, r4, 0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - adds r1, r4, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - movs r0, 0x5 - b _0811A41A - .pool -_0811A370: - bl sub_811AAAC - lsls r0, 16 - lsrs r4, r0, 16 - adds r6, r4, 0 - adds r0, r4, 0 - bl sub_811A88C - cmp r0, 0 - beq _0811A39E - movs r0, 0x1 - negs r0, r0 - movs r1, 0x2 - negs r1, r1 - movs r2, 0 - str r2, [sp] - movs r3, 0x10 - bl pal_fade_maybe - movs r0, 0x3 - strh r0, [r5] - strh r4, [r5, 0xC] - b _0811A41C -_0811A39E: - cmp r4, 0x18 - bne _0811A3B6 - movs r1, 0x1 - negs r1, r1 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - movs r0, 0x4 - b _0811A41A -_0811A3B6: - cmp r6, 0 - beq _0811A41C - movs r0, 0x5 - bl audio_play - adds r0, r6, 0 - bl sub_811C158 - ldrh r0, [r5] - adds r0, 0x1 - b _0811A41A -_0811A3CC: - bl sub_811C170 - lsls r0, 24 - b _0811A414 -_0811A3D4: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0811A41C - ldrh r0, [r5, 0xC] - bl sub_811A8A4 - b _0811A41C - .pool -_0811A3EC: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0811A41C - adds r0, r2, 0 - movs r1, 0x4 - bl GetWordTaskArg - bl sub_811A4D0 - b _0811A41C - .pool -_0811A40C: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 -_0811A414: - cmp r0, 0 - bne _0811A41C - movs r0, 0x1 -_0811A41A: - strh r0, [r5] -_0811A41C: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811A2FC - - thumb_func_start sub_811A428 -sub_811A428: @ 811A428 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r6, r0, r1 - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0x4 - bhi _0811A4BC - lsls r0, 2 - ldr r1, =_0811A454 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0811A454: - .4byte _0811A468 - .4byte _0811A47C - .4byte _0811A482 - .4byte _0811A498 - .4byte _0811A4B0 -_0811A468: - movs r0, 0 - bl SetVBlankCallback - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - bl sub_80A1A74 - b _0811A4C0 -_0811A47C: - bl sub_811F28C - b _0811A49C -_0811A482: - ldrb r4, [r6, 0x2] - adds r0, r5, 0 - movs r1, 0x2 - bl GetWordTaskArg - adds r1, r0, 0 - ldrb r2, [r6, 0xE] - adds r0, r4, 0 - bl sub_811A95C - b _0811A49C -_0811A498: - bl sub_811BF8C -_0811A49C: - lsls r0, 24 - cmp r0, 0 - bne _0811A4C0 - adds r0, r5, 0 - movs r1, 0x4 - bl GetWordTaskArg - bl sub_811A4D0 - b _0811A4C0 -_0811A4B0: - bl sub_811BFA4 - lsls r0, 24 - cmp r0, 0 - beq _0811A4C0 - b _0811A4C6 -_0811A4BC: - movs r0, 0 - b _0811A4C8 -_0811A4C0: - ldrh r0, [r6] - adds r0, 0x1 - strh r0, [r6] -_0811A4C6: - movs r0, 0x1 -_0811A4C8: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_811A428 - - thumb_func_start sub_811A4D0 -sub_811A4D0: @ 811A4D0 - push {r4,lr} - adds r4, r0, 0 - bl sub_811C13C - bl sub_811AA90 - bl sub_811F2B8 - bl FreeAllWindowBuffers - adds r0, r4, 0 - bl SetMainCallback2 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_811A4D0 - - thumb_func_start easy_chat_input_maybe -easy_chat_input_maybe: @ 811A4F0 - push {r4,r5,lr} - movs r5, 0x3 - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0x14 - bls _0811A4FE - b _0811A7D4 -_0811A4FE: - lsls r0, 2 - ldr r1, =_0811A510 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0811A510: - .4byte _0811A564 - .4byte _0811A578 - .4byte _0811A58C - .4byte _0811A5A0 - .4byte _0811A5B4 - .4byte _0811A604 - .4byte _0811A5D8 - .4byte _0811A630 - .4byte _0811A664 - .4byte _0811A688 - .4byte _0811A6B4 - .4byte _0811A6D4 - .4byte _0811A708 - .4byte _0811A72C - .4byte _0811A73C - .4byte _0811A770 - .4byte _0811A7D4 - .4byte _0811A784 - .4byte _0811A798 - .4byte _0811A7AC - .4byte _0811A7BC -_0811A564: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002bb0 - adds r4, r0, r1 - b _0811A7C2 - .pool -_0811A578: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00002bbc - adds r4, r0, r2 - b _0811A7C2 - .pool -_0811A58C: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r3, =0x00002bc8 - adds r4, r0, r3 - b _0811A7C2 - .pool -_0811A5A0: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002bd4 - adds r4, r0, r1 - b _0811A7C2 - .pool -_0811A5B4: - ldr r2, =0x03005d8c - ldr r0, =0x020375e2 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r3, =0x00002be0 - adds r0, r3 - ldr r1, [r2] - adds r4, r1, r0 - b _0811A7C2 - .pool -_0811A5D8: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00002e36 - adds r1, r0, r2 - ldr r3, =0x00002e2a - adds r2, r0, r3 - movs r3, 0x5 -_0811A5E6: - ldrh r0, [r2] - strh r0, [r2, 0xC] - adds r2, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _0811A5E6 - adds r4, r1, 0 - b _0811A7C2 - .pool -_0811A604: - ldr r2, =0x03005d8c - ldr r0, =0x020375e2 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, [r2] - adds r0, r1 - ldr r1, =0x000027d0 - adds r4, r0, r1 - ldr r0, =0x020375e4 - ldrb r5, [r0] - b _0811A7C2 - .pool -_0811A630: - ldr r2, =0x03005d8c - ldr r0, =0x020375e2 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r3, =0x000027cc - adds r0, r3 - ldr r1, [r2] - adds r1, r0 - ldr r0, =0x020375e4 - ldrh r0, [r0] - lsls r0, 1 - adds r0, 0x1C - adds r4, r1, r0 - movs r5, 0x1 - b _0811A7C2 - .pool -_0811A664: - ldr r2, =0x03005d8c - ldr r0, =0x020375e2 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, [r2] - adds r0, r1 - ldr r1, =0x000027ce - adds r4, r0, r1 - movs r5, 0 - b _0811A7C2 - .pool -_0811A688: - ldr r4, =0x02021ec4 - ldr r1, =0x03005d8c - ldr r0, [r1] - ldr r2, =0x00002e6c - adds r0, r2 - ldrh r0, [r0] - strh r0, [r4] - ldr r0, [r1] - ldr r3, =0x00002e6e - adds r0, r3 - ldrh r0, [r0] - strh r0, [r4, 0x2] - b _0811A7C2 - .pool -_0811A6B4: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002baa - adds r4, r0, r1 - ldr r2, =0x0000ffff - adds r0, r2, 0 - strh r0, [r4] - movs r5, 0x1 - b _0811A7C2 - .pool -_0811A6D4: - ldr r2, =0x03005d8c - ldr r0, =0x020375e2 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r3, =0x000027cc - adds r0, r3 - ldr r1, [r2] - adds r1, r0 - ldr r0, =0x020375e4 - ldrh r0, [r0] - lsls r0, 1 - adds r0, 0x4 - adds r4, r1, r0 - movs r5, 0 - b _0811A7C2 - .pool -_0811A708: - ldr r2, =0x03005d8c - ldr r0, =0x020375e2 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, [r2] - adds r0, r1 - ldr r1, =0x000027e4 - adds r4, r0, r1 - movs r5, 0x1 - b _0811A7C2 - .pool -_0811A72C: - ldr r4, =0x02021ec4 - adds r0, r4, 0 - movs r1, 0x2 - bl sub_811F88C - b _0811A7C2 - .pool -_0811A73C: - ldr r2, =0x03005d8c - ldr r0, =0x020375e2 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r3, =0x000027cc - adds r0, r3 - ldr r1, [r2] - adds r1, r0 - adds r4, r1, 0 - adds r4, 0x14 - ldr r2, =0x0000ffff - adds r0, r2, 0 - strh r0, [r1, 0x14] - movs r5, 0x2 - b _0811A7C2 - .pool -_0811A770: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r3, =0x00003b6e - adds r4, r0, r3 - b _0811A7C2 - .pool -_0811A784: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003b5a - adds r4, r0, r1 - b _0811A7C2 - .pool -_0811A798: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00003b6c - adds r4, r0, r2 - b _0811A7C2 - .pool -_0811A7AC: - ldr r0, =0x03005d90 - ldr r0, [r0] - movs r3, 0x82 - lsls r3, 1 - adds r4, r0, r3 - b _0811A7C2 - .pool -_0811A7BC: - bl sub_801B058 - adds r4, r0, 0 -_0811A7C2: - bl overworld_free_bg_tilemaps - ldr r0, =0x020375e0 - ldrb r0, [r0] - ldr r2, =sub_80861B0 - adds r1, r4, 0 - adds r3, r5, 0 - bl sub_811A20C -_0811A7D4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end easy_chat_input_maybe - - thumb_func_start sub_811A7E4 -sub_811A7E4: @ 811A7E4 - push {lr} - bl fade_and_return_progress_probably - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _0811A804 - cmp r0, 0x1 - beq _0811A80E - b _0811A840 - .pool -_0811A804: - movs r0, 0x1 - movs r1, 0 - bl fade_screen - b _0811A840 -_0811A80E: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0811A84E - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - ldr r1, =0x0000ffff - strh r1, [r0, 0x16] - bl overworld_free_bg_tilemaps - bl sub_811A8F0 - b _0811A84E - .pool -_0811A840: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0811A84E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_811A7E4 - - thumb_func_start sub_811A858 -sub_811A858: @ 811A858 - push {lr} - ldr r0, =sub_811A7E4 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_811A858 - - thumb_func_start sub_811A868 -sub_811A868: @ 811A868 - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - movs r0, 0 - ldr r1, =gUnknown_08597530 -_0811A872: - ldrh r3, [r1] - cmp r2, r3 - beq _0811A884 - adds r1, 0x8 - adds r0, 0x1 - cmp r0, 0x3 - bls _0811A872 - movs r0, 0x1 - negs r0, r0 -_0811A884: - pop {r1} - bx r1 - .pool - thumb_func_end sub_811A868 - - thumb_func_start sub_811A88C -sub_811A88C: @ 811A88C - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl sub_811A868 - adds r1, r0, 0 - mvns r1, r1 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - pop {r1} - bx r1 - thumb_func_end sub_811A88C - - thumb_func_start sub_811A8A4 -sub_811A8A4: @ 811A8A4 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - bl sub_811A868 - adds r4, r0, 0 - bl ResetTasks - ldr r0, =gUnknown_08597530 - lsls r4, 3 - adds r0, 0x4 - adds r4, r0 - ldr r0, [r4] - bl sub_811A4D0 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811A8A4 - - thumb_func_start sub_811A8CC -sub_811A8CC: @ 811A8CC - push {lr} - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x00003b6e - adds r1, r0 - ldr r2, =sub_80861B0 - movs r0, 0xF - movs r3, 0x3 - bl sub_811A20C - pop {r0} - bx r0 - .pool - thumb_func_end sub_811A8CC - - thumb_func_start sub_811A8F0 -sub_811A8F0: @ 811A8F0 - push {lr} - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x00003b5a - adds r1, r0 - ldr r2, =sub_80861B0 - movs r0, 0x10 - movs r3, 0x3 - bl sub_811A20C - pop {r0} - bx r0 - .pool - thumb_func_end sub_811A8F0 - - thumb_func_start sub_811A914 -sub_811A914: @ 811A914 - push {lr} - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x00003b6c - adds r1, r0 - ldr r2, =sub_80861B0 - movs r0, 0x12 - movs r3, 0x3 - bl sub_811A20C - pop {r0} - bx r0 - .pool - thumb_func_end sub_811A914 - - thumb_func_start sub_811A938 -sub_811A938: @ 811A938 - push {lr} - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x00003b5a - adds r1, r0 - ldr r2, =sub_80861B0 - movs r0, 0x11 - movs r3, 0x3 - bl sub_811A20C - pop {r0} - bx r0 - .pool - thumb_func_end sub_811A938 - - thumb_func_start sub_811A95C -sub_811A95C: @ 811A95C - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r1 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r4, =0x0203a118 - movs r0, 0x50 - bl Alloc - str r0, [r4] - cmp r0, 0 - bne _0811A984 - movs r0, 0 - b _0811AA7E - .pool -_0811A984: - movs r7, 0 - strb r5, [r0] - ldr r0, [r4] - mov r1, r8 - str r1, [r0, 0x38] - strb r7, [r0, 0x5] - ldr r0, [r4] - strb r7, [r0, 0x6] - ldr r0, [r4] - strb r7, [r0, 0x9] - ldr r0, [r4] - strb r6, [r0, 0x12] - ldr r0, [r4] - strb r7, [r0, 0x13] - adds r0, r5, 0 - bl sub_811BCC8 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r5, 0x10 - bne _0811A9C6 - ldr r0, [r4] - adds r0, 0x14 - bl sub_811BDF0 - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0x14 - str r1, [r0, 0x34] - movs r1, 0x7 - strb r1, [r0, 0x4] - lsls r0, r6, 1 - b _0811A9DE -_0811A9C6: - ldr r0, [r4] - strb r7, [r0, 0x4] - ldr r3, [r4] - ldr r1, =gUnknown_08597550 - lsls r2, r6, 1 - adds r0, r2, r6 - lsls r0, 3 - adds r1, 0x4 - adds r0, r1 - ldr r0, [r0] - str r0, [r3, 0x34] - adds r0, r2, 0 -_0811A9DE: - ldr r3, =0x0203a118 - ldr r2, [r3] - ldr r1, =gUnknown_08597550 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x1] - strb r1, [r2, 0x2] - ldr r1, [r3] - ldrb r0, [r0, 0x2] - strb r0, [r1, 0x3] - ldr r0, [r3] - ldrb r2, [r0, 0x2] - ldrb r1, [r0, 0x3] - adds r4, r2, 0 - muls r4, r1 - adds r1, r4, 0 - strb r1, [r0, 0x7] - ldr r0, [r3] - strb r6, [r0, 0x1] - ldr r1, [r3] - ldrb r0, [r1, 0x7] - adds r4, r3, 0 - cmp r0, 0x9 - bls _0811AA14 - movs r0, 0x9 - strb r0, [r1, 0x7] -_0811AA14: - mov r0, r8 - cmp r0, 0 - beq _0811AA34 - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0x3C - ldrb r2, [r0, 0x7] - mov r0, r8 - bl CpuSet - b _0811AA64 - .pool -_0811AA34: - movs r3, 0 - ldr r0, [r4] - ldrb r0, [r0, 0x7] - cmp r3, r0 - bge _0811AA5C - adds r6, r4, 0 - ldr r1, =0x0000ffff - adds r5, r1, 0 -_0811AA44: - ldr r2, [r6] - lsls r0, r3, 1 - adds r1, r2, 0 - adds r1, 0x3C - adds r1, r0 - ldrh r0, [r1] - orrs r0, r5 - strh r0, [r1] - adds r3, 0x1 - ldrb r2, [r2, 0x7] - cmp r3, r2 - blt _0811AA44 -_0811AA5C: - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x3C - str r0, [r1, 0x38] -_0811AA64: - bl sub_811F3AC - ldr r1, =0x0203a118 - ldr r2, [r1] - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - adds r0, 0x1 - strb r0, [r2, 0xD] - movs r0, 0x1 -_0811AA7E: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_811A95C - - thumb_func_start sub_811AA90 -sub_811AA90: @ 811AA90 - push {r4,lr} - ldr r4, =0x0203a118 - ldr r0, [r4] - cmp r0, 0 - beq _0811AAA2 - bl Free - movs r0, 0 - str r0, [r4] -_0811AAA2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811AA90 - - thumb_func_start sub_811AAAC -sub_811AAAC: @ 811AAAC - push {lr} - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r0, [r0, 0x4] - cmp r0, 0xA - bhi _0811AB3E - lsls r0, 2 - ldr r1, =_0811AACC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0811AACC: - .4byte _0811AAF8 - .4byte _0811AAFE - .4byte _0811AB04 - .4byte _0811AB0A - .4byte _0811AB10 - .4byte _0811AB16 - .4byte _0811AB1C - .4byte _0811AB22 - .4byte _0811AB28 - .4byte _0811AB2E - .4byte _0811AB34 -_0811AAF8: - bl sub_811AB68 - b _0811AB38 -_0811AAFE: - bl sub_811ACDC - b _0811AB38 -_0811AB04: - bl sub_811AE44 - b _0811AB38 -_0811AB0A: - bl sub_811AF00 - b _0811AB38 -_0811AB10: - bl sub_811AF8C - b _0811AB38 -_0811AB16: - bl sub_811B040 - b _0811AB38 -_0811AB1C: - bl sub_811AFEC - b _0811AB38 -_0811AB22: - bl sub_811B08C - b _0811AB38 -_0811AB28: - bl sub_811B0BC - b _0811AB38 -_0811AB2E: - bl sub_811B0E8 - b _0811AB38 -_0811AB34: - bl sub_811B0F8 -_0811AB38: - lsls r0, 16 - lsrs r0, 16 - b _0811AB40 -_0811AB3E: - movs r0, 0 -_0811AB40: - pop {r1} - bx r1 - thumb_func_end sub_811AAAC - - thumb_func_start sub_811AB44 -sub_811AB44: @ 811AB44 - push {lr} - bl sub_811BA68 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _0811AB5E - cmp r0, 0x2 - blt _0811AB62 - cmp r0, 0x8 - bgt _0811AB62 - cmp r0, 0x7 - blt _0811AB62 -_0811AB5E: - movs r0, 0x1 - b _0811AB64 -_0811AB62: - movs r0, 0 -_0811AB64: - pop {r1} - bx r1 - thumb_func_end sub_811AB44 - - thumb_func_start sub_811AB68 -sub_811AB68: @ 811AB68 - push {r4-r7,lr} - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0811ABB8 - bl sub_811BF78 - ldr r1, =0x0203a118 - ldr r3, [r1] - movs r2, 0 - movs r0, 0x2 - strb r0, [r3, 0x4] - ldr r0, [r1] - strb r2, [r0, 0xA] - ldr r0, [r1] - strb r2, [r0, 0xB] - ldr r0, [r1] - strb r2, [r0, 0xC] - movs r0, 0x9 - b _0811ACCC - .pool -_0811AB9C: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _0811AC68 - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0811AC58 - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _0811AC48 - movs r0, 0 - b _0811ACCC -_0811ABB8: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0811AC78 - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - bne _0811AC7E - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0811AB9C - ldr r2, =0x0203a118 - ldr r1, [r2] - ldrb r0, [r1, 0x6] - subs r0, 0x1 -_0811ABD8: - strb r0, [r1, 0x6] -_0811ABDA: - adds r7, r2, 0 - adds r4, r7, 0 - ldr r2, [r4] - movs r0, 0x6 - ldrsb r0, [r2, r0] - ldr r6, =gUnknown_08597550 - cmp r0, 0 - bge _0811ABF8 - ldrb r0, [r2, 0x1] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 3 - adds r1, r6 - ldrb r0, [r1, 0x2] - strb r0, [r2, 0x6] -_0811ABF8: - ldr r3, [r4] - movs r2, 0x6 - ldrsb r2, [r3, r2] - adds r5, r6, 0 - ldrb r1, [r3, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - ldrb r0, [r0, 0x2] - cmp r2, r0 - ble _0811AC14 - movs r0, 0 - strb r0, [r3, 0x6] -_0811AC14: - ldr r3, [r4] - movs r2, 0x6 - ldrsb r2, [r3, r2] - ldrb r1, [r3, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r1, r0, r5 - ldrb r0, [r1, 0x2] - cmp r2, r0 - bne _0811AC88 - movs r0, 0x5 - ldrsb r0, [r3, r0] - cmp r0, 0x2 - ble _0811AC36 - movs r0, 0x2 - strb r0, [r3, 0x5] -_0811AC36: - ldr r1, [r4] - movs r0, 0x1 - strb r0, [r1, 0x4] - movs r0, 0x3 - b _0811ACCC - .pool -_0811AC48: - ldr r2, =0x0203a118 - ldr r1, [r2] - ldrb r0, [r1, 0x5] - adds r0, 0x1 - strb r0, [r1, 0x5] - b _0811ABDA - .pool -_0811AC58: - ldr r2, =0x0203a118 - ldr r1, [r2] - ldrb r0, [r1, 0x6] - adds r0, 0x1 - b _0811ABD8 - .pool -_0811AC68: - ldr r2, =0x0203a118 - ldr r1, [r2] - ldrb r0, [r1, 0x5] - subs r0, 0x1 - strb r0, [r1, 0x5] - b _0811ABDA - .pool -_0811AC78: - bl sub_811B150 - b _0811AC82 -_0811AC7E: - bl sub_811B1B4 -_0811AC82: - lsls r0, 16 - lsrs r0, 16 - b _0811ACCC -_0811AC88: - movs r0, 0x5 - ldrsb r0, [r3, r0] - cmp r0, 0 - bge _0811AC96 - ldrb r0, [r1, 0x1] - subs r0, 0x1 - strb r0, [r3, 0x5] -_0811AC96: - ldr r3, [r4] - movs r2, 0x5 - ldrsb r2, [r3, r2] - ldrb r1, [r3, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - ldrb r0, [r0, 0x1] - cmp r2, r0 - blt _0811ACB0 - movs r0, 0 - strb r0, [r3, 0x5] -_0811ACB0: - bl sub_811AB44 - cmp r0, 0 - beq _0811ACCA - ldr r2, [r7] - ldr r0, [r2, 0x4] - ldr r1, =0x00ffff00 - ands r0, r1 - ldr r1, =0x00040100 - cmp r0, r1 - bne _0811ACCA - movs r0, 0 - strb r0, [r2, 0x5] -_0811ACCA: - movs r0, 0x2 -_0811ACCC: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_811AB68 - - thumb_func_start sub_811ACDC -sub_811ACDC: @ 811ACDC - push {r4-r6,lr} - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0811AD4A - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r0, [r0, 0x5] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x1 - beq _0811AD3E - b _0811AD24 - .pool -_0811AD04: - movs r0, 0x20 - ands r0, r2 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0 - bne _0811ADE0 - movs r0, 0x80 - ands r0, r2 - cmp r0, 0 - bne _0811ADD0 - movs r0, 0x10 - ands r0, r2 - cmp r0, 0 - bne _0811ADC0 - movs r0, 0 - b _0811AE32 -_0811AD24: - cmp r0, 0x1 - bgt _0811AD2E - cmp r0, 0 - beq _0811AD38 - b _0811AD4A -_0811AD2E: - cmp r0, 0x2 - beq _0811ADF6 - cmp r0, 0x3 - beq _0811AD44 - b _0811AD4A -_0811AD38: - bl sub_811B184 - b _0811ADFA -_0811AD3E: - bl sub_811B150 - b _0811ADFA -_0811AD44: - bl sub_811B264 - b _0811ADFA -_0811AD4A: - ldrh r2, [r2, 0x2E] - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - bne _0811ADF0 - movs r0, 0x8 - ands r0, r2 - cmp r0, 0 - bne _0811ADF6 - movs r0, 0x40 - ands r0, r2 - cmp r0, 0 - beq _0811AD04 - ldr r2, =0x0203a118 - ldr r1, [r2] - ldrb r0, [r1, 0x6] - subs r0, 0x1 - strb r0, [r1, 0x6] -_0811AD6E: - adds r6, r2, 0 -_0811AD70: - adds r5, r6, 0 - ldr r4, [r5] - movs r3, 0x6 - ldrsb r3, [r4, r3] - ldr r2, =gUnknown_08597550 - ldrb r1, [r4, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r1, r0, r2 - ldrb r0, [r1, 0x2] - cmp r3, r0 - bne _0811AE00 - bl sub_811BA3C - movs r2, 0x3 - cmp r0, 0 - beq _0811AD96 - movs r2, 0x4 -_0811AD96: - ldr r1, [r5] - movs r0, 0x5 - ldrsb r0, [r1, r0] - cmp r0, 0 - bge _0811ADA4 - subs r0, r2, 0x1 - strb r0, [r1, 0x5] -_0811ADA4: - ldr r1, [r5] - movs r0, 0x5 - ldrsb r0, [r1, r0] - cmp r0, r2 - blt _0811ADB2 - movs r0, 0 - strb r0, [r1, 0x5] -_0811ADB2: - movs r0, 0x3 - b _0811AE32 - .pool -_0811ADC0: - ldr r2, =0x0203a118 - ldr r1, [r2] - ldrb r0, [r1, 0x5] - adds r0, 0x1 - strb r0, [r1, 0x5] - b _0811AD6E - .pool -_0811ADD0: - ldr r1, =0x0203a118 - ldr r0, [r1] - strb r3, [r0, 0x6] - adds r6, r1, 0 - b _0811AD70 - .pool -_0811ADE0: - ldr r2, =0x0203a118 - ldr r1, [r2] - ldrb r0, [r1, 0x5] - subs r0, 0x1 - strb r0, [r1, 0x5] - b _0811AD6E - .pool -_0811ADF0: - bl sub_811B150 - b _0811ADFA -_0811ADF6: - bl sub_811B1B4 -_0811ADFA: - lsls r0, 16 - lsrs r0, 16 - b _0811AE32 -_0811AE00: - movs r0, 0x5 - ldrsb r0, [r4, r0] - ldrb r1, [r1, 0x1] - cmp r0, r1 - blt _0811AE0E - subs r0, r1, 0x1 - strb r0, [r4, 0x5] -_0811AE0E: - bl sub_811AB44 - cmp r0, 0 - beq _0811AE28 - ldr r2, [r6] - ldr r0, [r2, 0x4] - ldr r1, =0x00ffff00 - ands r0, r1 - ldr r1, =0x00040100 - cmp r0, r1 - bne _0811AE28 - movs r0, 0 - strb r0, [r2, 0x5] -_0811AE28: - ldr r0, =0x0203a118 - ldr r1, [r0] - movs r0, 0 - strb r0, [r1, 0x4] - movs r0, 0x2 -_0811AE32: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_811ACDC - - thumb_func_start sub_811AE44 -sub_811AE44: @ 811AE44 - push {lr} - ldr r1, =0x030022c0 - ldrh r2, [r1, 0x2E] - movs r0, 0x2 - ands r0, r2 - adds r3, r1, 0 - cmp r0, 0 - beq _0811AE60 - bl sub_811B32C - b _0811AEF6 - .pool -_0811AE60: - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - beq _0811AEAE - ldr r0, =0x0203a118 - ldr r2, [r0] - movs r1, 0xA - ldrsb r1, [r2, r1] - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _0811AE84 - bl sub_811B2B0 - b _0811AEF6 - .pool -_0811AE84: - movs r0, 0xB - ldrsb r0, [r2, r0] - cmp r0, 0x1 - beq _0811AEA2 - cmp r0, 0x1 - bgt _0811AE96 - cmp r0, 0 - beq _0811AE9C - b _0811AEAE -_0811AE96: - cmp r0, 0x2 - beq _0811AEA8 - b _0811AEAE -_0811AE9C: - bl sub_811B33C - b _0811AEF6 -_0811AEA2: - bl sub_811B368 - b _0811AEF6 -_0811AEA8: - bl sub_811B32C - b _0811AEF6 -_0811AEAE: - ldrh r1, [r3, 0x2E] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0811AEBE - bl sub_811B33C - b _0811AEF6 -_0811AEBE: - ldrh r1, [r3, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0811AECC - movs r0, 0x2 - b _0811AEF2 -_0811AECC: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0811AED8 - movs r0, 0x3 - b _0811AEF2 -_0811AED8: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0811AEE4 - movs r0, 0x1 - b _0811AEF2 -_0811AEE4: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _0811AEF0 - movs r0, 0 - b _0811AEFA -_0811AEF0: - movs r0, 0 -_0811AEF2: - bl sub_811B528 -_0811AEF6: - lsls r0, 16 - lsrs r0, 16 -_0811AEFA: - pop {r1} - bx r1 - thumb_func_end sub_811AE44 - - thumb_func_start sub_811AF00 -sub_811AF00: @ 811AF00 - push {lr} - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0811AF24 - ldr r0, =0x0203a118 - ldr r1, [r0] - movs r0, 0x2 - strb r0, [r1, 0x4] - movs r0, 0xE - b _0811AF86 - .pool -_0811AF24: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0811AF32 - bl sub_811B394 - b _0811AF82 -_0811AF32: - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0811AF3E - movs r0, 0x4 - b _0811AF7E -_0811AF3E: - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0811AF4A - movs r0, 0x5 - b _0811AF7E -_0811AF4A: - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0811AF58 - movs r0, 0x2 - b _0811AF7E -_0811AF58: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0811AF64 - movs r0, 0x3 - b _0811AF7E -_0811AF64: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0811AF70 - movs r0, 0x1 - b _0811AF7E -_0811AF70: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _0811AF7C - movs r0, 0 - b _0811AF86 -_0811AF7C: - movs r0, 0 -_0811AF7E: - bl sub_811B794 -_0811AF82: - lsls r0, 16 - lsrs r0, 16 -_0811AF86: - pop {r1} - bx r1 - thumb_func_end sub_811AF00 - - thumb_func_start sub_811AF8C -sub_811AF8C: @ 811AF8C - push {lr} - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _0811AFC0 - cmp r1, 0 - bgt _0811AFA8 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _0811AFAC - b _0811AFE4 -_0811AFA8: - cmp r1, 0x1 - bne _0811AFE4 -_0811AFAC: - bl sub_811B2A4 - ldr r1, =0x0203a118 - ldr r1, [r1] - strb r0, [r1, 0x4] - movs r0, 0x7 - b _0811AFE6 - .pool -_0811AFC0: - ldr r0, =0x020375f0 - strh r1, [r0] - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r0, [r0] - subs r0, 0x11 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _0811AFD8 - bl sub_811B3E4 -_0811AFD8: - movs r0, 0x18 - b _0811AFE6 - .pool -_0811AFE4: - movs r0, 0 -_0811AFE6: - pop {r1} - bx r1 - thumb_func_end sub_811AF8C - - thumb_func_start sub_811AFEC -sub_811AFEC: @ 811AFEC - push {r4,lr} - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _0811B020 - cmp r1, 0 - bgt _0811B008 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _0811B00C - b _0811B038 -_0811B008: - cmp r1, 0x1 - bne _0811B038 -_0811B00C: - bl sub_811B2A4 - ldr r1, =0x0203a118 - ldr r1, [r1] - strb r0, [r1, 0x4] - movs r0, 0x7 - b _0811B03A - .pool -_0811B020: - bl sub_811BE9C - ldr r4, =0x020375f0 - bl sub_811B4EC - strh r0, [r4] - bl sub_811B3E4 - movs r0, 0x18 - b _0811B03A - .pool -_0811B038: - movs r0, 0 -_0811B03A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811AFEC - - thumb_func_start sub_811B040 -sub_811B040: @ 811B040 - push {lr} - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _0811B070 - cmp r1, 0 - bgt _0811B05C - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _0811B060 - b _0811B084 -_0811B05C: - cmp r1, 0x1 - bne _0811B084 -_0811B060: - ldr r0, =0x0203a118 - ldr r1, [r0] - movs r0, 0x1 - strb r0, [r1, 0x4] - movs r0, 0x7 - b _0811B086 - .pool -_0811B070: - bl sub_811B418 - ldr r0, =0x0203a118 - ldr r1, [r0] - movs r0, 0x1 - strb r0, [r1, 0x4] - movs r0, 0x8 - b _0811B086 - .pool -_0811B084: - movs r0, 0 -_0811B086: - pop {r1} - bx r1 - thumb_func_end sub_811B040 - - thumb_func_start sub_811B08C -sub_811B08C: @ 811B08C - push {lr} - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0811B0A4 - movs r0, 0x1A - b _0811B0B8 - .pool -_0811B0A4: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0811B0B0 - movs r0, 0 - b _0811B0B8 -_0811B0B0: - bl sub_811B150 - lsls r0, 16 - lsrs r0, 16 -_0811B0B8: - pop {r1} - bx r1 - thumb_func_end sub_811B08C - - thumb_func_start sub_811B0BC -sub_811B0BC: @ 811B0BC - push {lr} - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _0811B0D4 - movs r0, 0 - b _0811B0E0 - .pool -_0811B0D4: - bl sub_811B2A4 - ldr r1, =0x0203a118 - ldr r1, [r1] - strb r0, [r1, 0x4] - movs r0, 0x7 -_0811B0E0: - pop {r1} - bx r1 - .pool - thumb_func_end sub_811B0BC - - thumb_func_start sub_811B0E8 -sub_811B0E8: @ 811B0E8 - ldr r0, =0x0203a118 - ldr r1, [r0] - movs r0, 0xA - strb r0, [r1, 0x4] - movs r0, 0x6 - bx lr - .pool - thumb_func_end sub_811B0E8 - - thumb_func_start sub_811B0F8 -sub_811B0F8: @ 811B0F8 - push {r4,lr} - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _0811B134 - cmp r1, 0 - bgt _0811B114 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _0811B118 - b _0811B148 -_0811B114: - cmp r1, 0x1 - bne _0811B148 -_0811B118: - bl sub_811B454 - ldr r2, =0x0203a118 - ldr r1, [r2] - movs r0, 0 - strb r0, [r1, 0x8] - ldr r1, [r2] - movs r0, 0x8 - strb r0, [r1, 0x4] - movs r0, 0x1F - b _0811B14A - .pool -_0811B134: - ldr r4, =0x020375f0 - bl sub_811B4EC - strh r0, [r4] - bl sub_811B3E4 - movs r0, 0x18 - b _0811B14A - .pool -_0811B148: - movs r0, 0 -_0811B14A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811B0F8 - - thumb_func_start sub_811B150 -sub_811B150: @ 811B150 - push {lr} - ldr r1, =0x0203a118 - ldr r2, [r1] - ldrb r0, [r2] - cmp r0, 0x13 - beq _0811B160 - cmp r0, 0xB - bne _0811B174 -_0811B160: - ldrb r0, [r2, 0x4] - strb r0, [r2, 0x8] - ldr r1, [r1] - movs r0, 0x8 - strb r0, [r1, 0x4] - movs r0, 0x22 - b _0811B180 - .pool -_0811B174: - ldrb r0, [r2, 0x4] - strb r0, [r2, 0x8] - ldr r1, [r1] - movs r0, 0x4 - strb r0, [r1, 0x4] - movs r0, 0x5 -_0811B180: - pop {r1} - bx r1 - thumb_func_end sub_811B150 - - thumb_func_start sub_811B184 -sub_811B184: @ 811B184 - push {lr} - ldr r2, =0x0203a118 - ldr r0, [r2] - ldrb r1, [r0, 0x4] - strb r1, [r0, 0x8] - ldr r1, [r2] - ldrb r0, [r1] - cmp r0, 0x6 - bne _0811B1A8 - ldrb r0, [r1, 0x4] - strb r0, [r1, 0x8] - ldr r1, [r2] - movs r0, 0x8 - strb r0, [r1, 0x4] - movs r0, 0x20 - b _0811B1AE - .pool -_0811B1A8: - movs r0, 0x5 - strb r0, [r1, 0x4] - movs r0, 0x4 -_0811B1AE: - pop {r1} - bx r1 - thumb_func_end sub_811B184 - - thumb_func_start sub_811B1B4 -sub_811B1B4: @ 811B1B4 - push {r4,lr} - ldr r4, =0x0203a118 - ldr r1, [r4] - ldrb r0, [r1, 0x4] - strb r0, [r1, 0x8] - ldr r1, [r4] - ldrb r0, [r1] - cmp r0, 0x11 - bne _0811B1DC - bl sub_811BD64 - cmp r0, 0 - bne _0811B1FA - bl sub_811BDB0 - cmp r0, 0 - bne _0811B1E8 - b _0811B256 - .pool -_0811B1DC: - cmp r0, 0x12 - bne _0811B204 - bl sub_811BDB0 - cmp r0, 0 - beq _0811B1F2 -_0811B1E8: - ldr r1, [r4] - movs r0, 0x8 - strb r0, [r1, 0x4] - movs r0, 0x1E - b _0811B25C -_0811B1F2: - bl sub_811BD64 - cmp r0, 0 - beq _0811B256 -_0811B1FA: - ldr r1, [r4] - movs r0, 0x8 - strb r0, [r1, 0x4] - movs r0, 0x1D - b _0811B25C -_0811B204: - cmp r0, 0x9 - beq _0811B20C - cmp r0, 0xD - bne _0811B21E -_0811B20C: - bl sub_811BD2C - cmp r0, 0 - bne _0811B256 - ldr r1, [r4] - movs r0, 0x8 - strb r0, [r1, 0x4] - movs r0, 0x21 - b _0811B25C -_0811B21E: - cmp r0, 0x13 - beq _0811B226 - cmp r0, 0xB - bne _0811B238 -_0811B226: - bl sub_811BCF4 - cmp r0, 0 - beq _0811B256 - ldr r1, [r4] - movs r0, 0x8 - strb r0, [r1, 0x4] - movs r0, 0x22 - b _0811B25C -_0811B238: - cmp r0, 0x14 - beq _0811B258 - bl sub_811BCF4 - cmp r0, 0x1 - beq _0811B24C - bl sub_811B4EC - cmp r0, 0 - bne _0811B256 -_0811B24C: - ldr r1, [r4] - movs r0, 0x4 - strb r0, [r1, 0x4] - movs r0, 0x5 - b _0811B25C -_0811B256: - ldr r1, [r4] -_0811B258: - movs r0, 0x6 - strb r0, [r1, 0x4] -_0811B25C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811B1B4 - - thumb_func_start sub_811B264 -sub_811B264: @ 811B264 - push {lr} - ldr r2, =0x0203a118 - ldr r1, [r2] - ldrb r0, [r1, 0x4] - strb r0, [r1, 0x8] - ldr r0, [r2] - ldrb r0, [r0] - cmp r0, 0x11 - beq _0811B28E - cmp r0, 0x11 - bgt _0811B284 - cmp r0, 0xF - beq _0811B28A - b _0811B29E - .pool -_0811B284: - cmp r0, 0x12 - beq _0811B296 - b _0811B29E -_0811B28A: - movs r0, 0x19 - b _0811B2A0 -_0811B28E: - bl sub_811B3E4 - movs r0, 0x1C - b _0811B2A0 -_0811B296: - bl sub_811B3E4 - movs r0, 0x1B - b _0811B2A0 -_0811B29E: - movs r0, 0 -_0811B2A0: - pop {r1} - bx r1 - thumb_func_end sub_811B264 - - thumb_func_start sub_811B2A4 -sub_811B2A4: @ 811B2A4 - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - bx lr - .pool - thumb_func_end sub_811B2A4 - - thumb_func_start sub_811B2B0 -sub_811B2B0: @ 811B2B0 - push {lr} - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r0, [r0, 0x9] - cmp r0, 0 - bne _0811B2DC - bl sub_811B8E8 - lsls r0, 24 - lsrs r0, 24 - bl sub_811F3B8 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0 - bl sub_811F548 - b _0811B2EC - .pool -_0811B2DC: - bl sub_811B908 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x1 - bl sub_811F548 -_0811B2EC: - bl sub_811F5B0 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - beq _0811B324 - ldr r2, =0x0203a118 - ldr r3, [r2] - subs r0, 0x1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - movs r1, 0 - strb r0, [r3, 0xF] - ldr r0, [r2] - strb r1, [r0, 0xE] - ldr r0, [r2] - strb r1, [r0, 0x10] - ldr r0, [r2] - strb r1, [r0, 0x11] - ldr r1, [r2] - movs r0, 0x3 - strb r0, [r1, 0x4] - movs r0, 0xB - b _0811B326 - .pool -_0811B324: - movs r0, 0 -_0811B326: - pop {r1} - bx r1 - thumb_func_end sub_811B2B0 - - thumb_func_start sub_811B32C -sub_811B32C: @ 811B32C - ldr r0, =0x0203a118 - ldr r1, [r0] - movs r0, 0 - strb r0, [r1, 0x4] - movs r0, 0xA - bx lr - .pool - thumb_func_end sub_811B32C - - thumb_func_start sub_811B33C -sub_811B33C: @ 811B33C - push {lr} - ldr r1, =0x0203a118 - ldr r0, [r1] - movs r2, 0 - strb r2, [r0, 0xA] - ldr r0, [r1] - strb r2, [r0, 0xB] - ldr r0, [r1] - strb r2, [r0, 0xC] - ldr r1, [r1] - ldrb r0, [r1, 0x9] - cmp r0, 0 - bne _0811B360 - movs r0, 0x1 - strb r0, [r1, 0x9] - b _0811B362 - .pool -_0811B360: - strb r2, [r1, 0x9] -_0811B362: - movs r0, 0x17 - pop {r1} - bx r1 - thumb_func_end sub_811B33C - - thumb_func_start sub_811B368 -sub_811B368: @ 811B368 - push {lr} - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0x6 - beq _0811B388 - ldr r0, =0x0000ffff - bl sub_811B488 - movs r0, 0x1 - b _0811B390 - .pool -_0811B388: - movs r0, 0x20 - bl audio_play - movs r0, 0 -_0811B390: - pop {r1} - bx r1 - thumb_func_end sub_811B368 - - thumb_func_start sub_811B394 -sub_811B394: @ 811B394 - push {r4,r5,lr} - bl sub_811B940 - lsls r0, 16 - lsrs r0, 16 - bl sub_811F578 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl sub_811BF88 - adds r5, r0, 0 - cmp r5, 0 - beq _0811B3BC - movs r0, 0x20 - bl audio_play - movs r0, 0 - b _0811B3DC -_0811B3BC: - adds r0, r4, 0 - bl sub_811B488 - ldr r0, =0x0203a118 - ldr r1, [r0] - ldrb r0, [r1] - cmp r0, 0x6 - bne _0811B3D8 - movs r0, 0x9 - strb r0, [r1, 0x4] - movs r0, 0xD - b _0811B3DC - .pool -_0811B3D8: - strb r5, [r1, 0x4] - movs r0, 0xC -_0811B3DC: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_811B394 - - thumb_func_start sub_811B3E4 -sub_811B3E4: @ 811B3E4 - push {r4,r5,lr} - movs r4, 0 - ldr r3, =0x0203a118 - ldr r0, [r3] - ldrb r0, [r0, 0x7] - cmp r4, r0 - bge _0811B40E - adds r5, r3, 0 -_0811B3F4: - ldr r3, [r5] - ldr r1, [r3, 0x38] - lsls r2, r4, 1 - adds r1, r2, r1 - adds r0, r3, 0 - adds r0, 0x3C - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - adds r4, 0x1 - ldrb r3, [r3, 0x7] - cmp r4, r3 - blt _0811B3F4 -_0811B40E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811B3E4 - - thumb_func_start sub_811B418 -sub_811B418: @ 811B418 - push {r4,r5,lr} - movs r3, 0 - ldr r2, =0x0203a118 - ldr r0, [r2] - ldrb r0, [r0, 0x7] - cmp r3, r0 - bge _0811B444 - adds r5, r2, 0 - ldr r0, =0x0000ffff - adds r4, r0, 0 -_0811B42C: - ldr r2, [r5] - lsls r0, r3, 1 - adds r1, r2, 0 - adds r1, 0x3C - adds r1, r0 - ldrh r0, [r1] - orrs r0, r4 - strh r0, [r1] - adds r3, 0x1 - ldrb r2, [r2, 0x7] - cmp r3, r2 - blt _0811B42C -_0811B444: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811B418 - - thumb_func_start sub_811B454 -sub_811B454: @ 811B454 - push {r4,r5,lr} - movs r4, 0 - ldr r3, =0x0203a118 - ldr r0, [r3] - ldrb r0, [r0, 0x7] - cmp r4, r0 - bge _0811B47E - adds r5, r3, 0 -_0811B464: - ldr r3, [r5] - lsls r1, r4, 1 - adds r2, r3, 0 - adds r2, 0x3C - adds r2, r1 - ldr r0, [r3, 0x38] - adds r1, r0 - ldrh r0, [r1] - strh r0, [r2] - adds r4, 0x1 - ldrb r3, [r3, 0x7] - cmp r4, r3 - blt _0811B464 -_0811B47E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811B454 - - thumb_func_start sub_811B488 -sub_811B488: @ 811B488 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sub_811B8C8 - lsls r0, 16 - ldr r1, =0x0203a118 - ldr r1, [r1] - lsrs r0, 15 - adds r1, 0x3C - adds r1, r0 - strh r4, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811B488 - - thumb_func_start sub_811B4AC -sub_811B4AC: @ 811B4AC - push {r4,r5,lr} - movs r2, 0 - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r1, [r0, 0x7] - cmp r2, r1 - bcs _0811B4E2 - adds r5, r1, 0 - adds r4, r0, 0 - adds r4, 0x3C - ldr r3, [r0, 0x38] -_0811B4C2: - lsls r0, r2, 1 - adds r1, r4, r0 - adds r0, r3 - ldrh r1, [r1] - ldrh r0, [r0] - cmp r1, r0 - beq _0811B4D8 - movs r0, 0x1 - b _0811B4E4 - .pool -_0811B4D8: - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, r5 - bcc _0811B4C2 -_0811B4E2: - movs r0, 0 -_0811B4E4: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_811B4AC - - thumb_func_start sub_811B4EC -sub_811B4EC: @ 811B4EC - push {lr} - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r0, [r0] - subs r0, 0x11 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _0811B51C - bl sub_811BD64 - cmp r0, 0 - bne _0811B50E - bl sub_811BDB0 - cmp r0, 0 - beq _0811B518 -_0811B50E: - movs r0, 0 - b _0811B524 - .pool -_0811B518: - movs r0, 0x1 - b _0811B524 -_0811B51C: - bl sub_811B4AC - lsls r0, 24 - lsrs r0, 24 -_0811B524: - pop {r1} - bx r1 - thumb_func_end sub_811B4EC - - thumb_func_start sub_811B528 -sub_811B528: @ 811B528 - push {lr} - adds r2, r0, 0 - ldr r0, =0x0203a118 - ldr r3, [r0] - movs r1, 0xA - ldrsb r1, [r3, r1] - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _0811B558 - ldrb r0, [r3, 0x9] - cmp r0, 0 - bne _0811B550 - adds r0, r2, 0 - bl sub_811B568 - b _0811B55E - .pool -_0811B550: - adds r0, r2, 0 - bl sub_811B634 - b _0811B55E -_0811B558: - adds r0, r2, 0 - bl sub_811B6C4 -_0811B55E: - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_811B528 - - thumb_func_start sub_811B568 -sub_811B568: @ 811B568 - push {r4,lr} - cmp r0, 0x1 - beq _0811B5DE - cmp r0, 0x1 - bcc _0811B5FE - cmp r0, 0x2 - beq _0811B57C - cmp r0, 0x3 - beq _0811B5A4 - b _0811B62A -_0811B57C: - ldr r0, =0x0203a118 - ldr r1, [r0] - movs r0, 0xB - ldrsb r0, [r1, r0] - ldrb r3, [r1, 0xC] - cmn r0, r3 - beq _0811B62A - ldrb r2, [r1, 0xB] - cmp r0, 0 - beq _0811B59C - subs r0, r2, 0x1 - strb r0, [r1, 0xB] -_0811B594: - movs r0, 0xF - b _0811B62C - .pool -_0811B59C: - subs r0, r3, 0x1 - strb r0, [r1, 0xC] - movs r0, 0x11 - b _0811B62C -_0811B5A4: - ldr r0, =0x0203a118 - ldr r2, [r0] - movs r1, 0xB - ldrsb r1, [r2, r1] - ldrb r3, [r2, 0xC] - adds r1, r3 - ldrb r0, [r2, 0xD] - subs r0, 0x1 - cmp r1, r0 - bge _0811B62A - ldrb r1, [r2, 0xB] - movs r0, 0xB - ldrsb r0, [r2, r0] - cmp r0, 0x2 - bgt _0811B5D0 - adds r0, r1, 0x1 - strb r0, [r2, 0xB] - movs r4, 0xF - b _0811B5D6 - .pool -_0811B5D0: - adds r0, r3, 0x1 - strb r0, [r2, 0xC] - movs r4, 0x10 -_0811B5D6: - bl sub_811B978 - adds r0, r4, 0 - b _0811B62C -_0811B5DE: - ldr r0, =0x0203a118 - ldr r1, [r0] - ldrb r2, [r1, 0xA] - movs r0, 0xA - ldrsb r0, [r1, r0] - cmp r0, 0 - beq _0811B5F8 - subs r0, r2, 0x1 - strb r0, [r1, 0xA] - b _0811B594 - .pool -_0811B5F8: - bl sub_811B744 - b _0811B594 -_0811B5FE: - ldr r0, =0x0203a118 - ldr r1, [r0] - ldrb r2, [r1, 0xA] - movs r0, 0xA - ldrsb r0, [r1, r0] - cmp r0, 0 - bgt _0811B624 - adds r0, r2, 0x1 - strb r0, [r1, 0xA] - bl sub_811B9C8 - lsls r0, 24 - cmp r0, 0 - beq _0811B594 - bl sub_811B744 - b _0811B594 - .pool -_0811B624: - bl sub_811B744 - b _0811B594 -_0811B62A: - movs r0, 0 -_0811B62C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811B568 - - thumb_func_start sub_811B634 -sub_811B634: @ 811B634 - push {lr} - cmp r0, 0x1 - beq _0811B6A0 - cmp r0, 0x1 - bcc _0811B684 - cmp r0, 0x2 - beq _0811B64A - cmp r0, 0x3 - beq _0811B66A - movs r0, 0 - b _0811B6BC -_0811B64A: - ldr r0, =0x0203a118 - ldr r1, [r0] - ldrb r2, [r1, 0xB] - movs r0, 0xB - ldrsb r0, [r1, r0] - cmp r0, 0 - ble _0811B660 - subs r0, r2, 0x1 - b _0811B662 - .pool -_0811B660: - movs r0, 0x3 -_0811B662: - strb r0, [r1, 0xB] - bl sub_811B978 - b _0811B6BA -_0811B66A: - ldr r0, =0x0203a118 - ldr r1, [r0] - ldrb r2, [r1, 0xB] - movs r0, 0xB - ldrsb r0, [r1, r0] - cmp r0, 0x2 - bgt _0811B680 - adds r0, r2, 0x1 - b _0811B662 - .pool -_0811B680: - movs r0, 0 - b _0811B662 -_0811B684: - ldr r0, =0x0203a118 - ldr r1, [r0] - ldrb r0, [r1, 0xA] - adds r0, 0x1 - strb r0, [r1, 0xA] - bl sub_811B9C8 - lsls r0, 24 - cmp r0, 0 - beq _0811B6BA - b _0811B6B6 - .pool -_0811B6A0: - ldr r2, =0x0203a118 - ldr r1, [r2] - ldrb r0, [r1, 0xA] - subs r0, 0x1 - strb r0, [r1, 0xA] - ldr r0, [r2] - ldrb r0, [r0, 0xA] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - bge _0811B6BA -_0811B6B6: - bl sub_811B744 -_0811B6BA: - movs r0, 0xF -_0811B6BC: - pop {r1} - bx r1 - .pool - thumb_func_end sub_811B634 - - thumb_func_start sub_811B6C4 -sub_811B6C4: @ 811B6C4 - push {lr} - adds r2, r0, 0 - cmp r2, 0x1 - beq _0811B714 - cmp r2, 0x1 - bcc _0811B728 - cmp r2, 0x2 - beq _0811B6DC - cmp r2, 0x3 - beq _0811B6F8 - movs r0, 0 - b _0811B73A -_0811B6DC: - ldr r0, =0x0203a118 - ldr r1, [r0] - ldrb r3, [r1, 0xB] - movs r0, 0xB - ldrsb r0, [r1, r0] - cmp r0, 0 - beq _0811B6F4 - subs r0, r3, 0x1 - b _0811B736 - .pool -_0811B6F4: - strb r2, [r1, 0xB] - b _0811B738 -_0811B6F8: - ldr r0, =0x0203a118 - ldr r1, [r0] - ldrb r2, [r1, 0xB] - movs r0, 0xB - ldrsb r0, [r1, r0] - cmp r0, 0x1 - bgt _0811B710 - adds r0, r2, 0x1 - b _0811B736 - .pool -_0811B710: - movs r0, 0 - b _0811B736 -_0811B714: - ldr r0, =0x0203a118 - ldr r1, [r0] - ldrb r0, [r1, 0xB] - adds r0, 0x1 - strb r0, [r1, 0xB] - bl sub_811B768 - b _0811B738 - .pool -_0811B728: - ldr r2, =0x0203a118 - ldr r1, [r2] - movs r0, 0 - strb r0, [r1, 0xA] - ldr r1, [r2] - ldrb r0, [r1, 0xB] - adds r0, 0x1 -_0811B736: - strb r0, [r1, 0xB] -_0811B738: - movs r0, 0xF -_0811B73A: - pop {r1} - bx r1 - .pool - thumb_func_end sub_811B6C4 - - thumb_func_start sub_811B744 -sub_811B744: @ 811B744 - push {lr} - ldr r2, =0x0203a118 - ldr r1, [r2] - movs r0, 0xFF - strb r0, [r1, 0xA] - ldr r2, [r2] - ldrb r1, [r2, 0xB] - movs r0, 0xB - ldrsb r0, [r2, r0] - cmp r0, 0 - beq _0811B75E - subs r0, r1, 0x1 - strb r0, [r2, 0xB] -_0811B75E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_811B744 - - thumb_func_start sub_811B768 -sub_811B768: @ 811B768 - push {r4,lr} - ldr r4, =0x0203a118 - ldr r1, [r4] - ldrb r0, [r1, 0x9] - cmp r0, 0 - bne _0811B784 - movs r0, 0x1 - strb r0, [r1, 0xA] - bl sub_811B978 - b _0811B78E - .pool -_0811B784: - ldrb r0, [r1, 0xB] - bl sub_811B960 - ldr r1, [r4] - strb r0, [r1, 0xA] -_0811B78E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_811B768 - - thumb_func_start sub_811B794 -sub_811B794: @ 811B794 - push {r4,lr} - cmp r0, 0x5 - bls _0811B79C - b _0811B8C0 -_0811B79C: - lsls r0, 2 - ldr r1, =_0811B7AC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0811B7AC: - .4byte _0811B848 - .4byte _0811B826 - .4byte _0811B7C4 - .4byte _0811B7F0 - .4byte _0811B870 - .4byte _0811B890 -_0811B7C4: - ldr r0, =0x0203a118 - ldr r1, [r0] - movs r0, 0x11 - ldrsb r0, [r1, r0] - ldrb r3, [r1, 0xE] - adds r0, r3 - cmp r0, 0 - bgt _0811B7D6 - b _0811B8C0 -_0811B7D6: - ldrb r2, [r1, 0x11] - movs r0, 0x11 - ldrsb r0, [r1, r0] - cmp r0, 0 - ble _0811B7E8 - subs r0, r2, 0x1 - b _0811B80E - .pool -_0811B7E8: - subs r0, r3, 0x1 - strb r0, [r1, 0xE] - movs r4, 0x13 - b _0811B81E -_0811B7F0: - ldr r0, =0x0203a118 - ldr r1, [r0] - movs r0, 0x11 - ldrsb r0, [r1, r0] - ldrb r3, [r1, 0xE] - adds r0, r3 - ldrb r2, [r1, 0xF] - cmp r0, r2 - bge _0811B8C0 - ldrb r2, [r1, 0x11] - movs r0, 0x11 - ldrsb r0, [r1, r0] - cmp r0, 0x2 - bgt _0811B818 - adds r0, r2, 0x1 -_0811B80E: - strb r0, [r1, 0x11] - movs r4, 0x12 - b _0811B81E - .pool -_0811B818: - adds r0, r3, 0x1 - strb r0, [r1, 0xE] - movs r4, 0x14 -_0811B81E: - bl sub_811B9A0 - adds r0, r4, 0 - b _0811B8C2 -_0811B826: - ldr r0, =0x0203a118 - ldr r1, [r0] - ldrb r2, [r1, 0x10] - movs r0, 0x10 - ldrsb r0, [r1, r0] - cmp r0, 0 - ble _0811B83C - subs r0, r2, 0x1 - b _0811B83E - .pool -_0811B83C: - movs r0, 0x1 -_0811B83E: - strb r0, [r1, 0x10] - bl sub_811B9A0 -_0811B844: - movs r0, 0x12 - b _0811B8C2 -_0811B848: - ldr r4, =0x0203a118 - ldr r1, [r4] - ldrb r2, [r1, 0x10] - movs r0, 0x10 - ldrsb r0, [r1, r0] - cmp r0, 0 - bgt _0811B866 - adds r0, r2, 0x1 - strb r0, [r1, 0x10] - bl sub_811BA1C - lsls r0, 24 - cmp r0, 0 - beq _0811B844 - ldr r1, [r4] -_0811B866: - movs r0, 0 - strb r0, [r1, 0x10] - b _0811B844 - .pool -_0811B870: - ldr r0, =0x0203a118 - ldr r2, [r0] - ldrb r0, [r2, 0xE] - adds r1, r0, 0 - cmp r1, 0 - beq _0811B8C0 - cmp r1, 0x3 - bls _0811B888 - subs r0, 0x4 - b _0811B88A - .pool -_0811B888: - movs r0, 0 -_0811B88A: - strb r0, [r2, 0xE] - movs r0, 0x15 - b _0811B8C2 -_0811B890: - ldr r3, =0x0203a118 - ldr r1, [r3] - ldrb r2, [r1, 0xE] - ldrb r0, [r1, 0xF] - subs r0, 0x4 - cmp r2, r0 - bgt _0811B8C0 - adds r0, r2, 0x4 - strb r0, [r1, 0xE] - ldr r2, [r3] - ldrb r1, [r2, 0xE] - ldrb r3, [r2, 0xF] - subs r0, r3, 0x3 - cmp r1, r0 - ble _0811B8B4 - adds r0, r3, 0 - adds r0, 0xFD - strb r0, [r2, 0xE] -_0811B8B4: - bl sub_811B9A0 - movs r0, 0x16 - b _0811B8C2 - .pool -_0811B8C0: - movs r0, 0 -_0811B8C2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811B794 - - thumb_func_start sub_811B8C8 -sub_811B8C8: @ 811B8C8 - ldr r0, =0x0203a118 - ldr r0, [r0] - movs r2, 0x6 - ldrsb r2, [r0, r2] - ldrb r1, [r0, 0x2] - muls r1, r2 - ldrb r0, [r0, 0x5] - lsls r0, 24 - asrs r0, 24 - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - bx lr - .pool - thumb_func_end sub_811B8C8 - - thumb_func_start sub_811B8E8 -sub_811B8E8: @ 811B8E8 - ldr r0, =0x0203a118 - ldr r0, [r0] - movs r1, 0xB - ldrsb r1, [r0, r1] - ldrb r2, [r0, 0xC] - adds r1, r2 - lsls r1, 1 - ldrb r0, [r0, 0xA] - lsls r0, 24 - asrs r0, 24 - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - bx lr - .pool - thumb_func_end sub_811B8E8 - - thumb_func_start sub_811B908 -sub_811B908: @ 811B908 - push {lr} - ldr r0, =0x0203a118 - ldr r1, [r0] - ldrb r0, [r1, 0xA] - movs r3, 0 - cmp r0, 0x6 - bhi _0811B91A - movs r3, 0xA - ldrsb r3, [r1, r3] -_0811B91A: - ldrb r0, [r1, 0xB] - movs r2, 0 - cmp r0, 0x3 - bhi _0811B926 - movs r2, 0xB - ldrsb r2, [r1, r2] -_0811B926: - ldr r0, =gUnknown_08597748 - lsls r1, r2, 3 - subs r1, r2 - adds r1, r3, r1 - adds r1, r0 - ldrb r0, [r1] - pop {r1} - bx r1 - .pool - thumb_func_end sub_811B908 - - thumb_func_start sub_811B940 -sub_811B940: @ 811B940 - ldr r0, =0x0203a118 - ldr r0, [r0] - movs r1, 0x11 - ldrsb r1, [r0, r1] - ldrb r2, [r0, 0xE] - adds r1, r2 - lsls r1, 1 - ldrb r0, [r0, 0x10] - lsls r0, 24 - asrs r0, 24 - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - bx lr - .pool - thumb_func_end sub_811B940 - - thumb_func_start sub_811B960 -sub_811B960: @ 811B960 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _0811B96E - cmp r0, 0x1 - beq _0811B972 -_0811B96E: - movs r0, 0x6 - b _0811B974 -_0811B972: - movs r0, 0x5 -_0811B974: - pop {r1} - bx r1 - thumb_func_end sub_811B960 - - thumb_func_start sub_811B978 -sub_811B978: @ 811B978 - push {lr} - b _0811B98E -_0811B97C: - ldr r0, =0x0203a118 - ldr r1, [r0] - ldrb r2, [r1, 0xA] - movs r0, 0xA - ldrsb r0, [r1, r0] - cmp r0, 0 - beq _0811B998 - subs r0, r2, 0x1 - strb r0, [r1, 0xA] -_0811B98E: - bl sub_811B9C8 - lsls r0, 24 - cmp r0, 0 - bne _0811B97C -_0811B998: - pop {r0} - bx r0 - .pool - thumb_func_end sub_811B978 - - thumb_func_start sub_811B9A0 -sub_811B9A0: @ 811B9A0 - push {lr} - b _0811B9B6 -_0811B9A4: - ldr r0, =0x0203a118 - ldr r1, [r0] - ldrb r2, [r1, 0x10] - movs r0, 0x10 - ldrsb r0, [r1, r0] - cmp r0, 0 - beq _0811B9C0 - subs r0, r2, 0x1 - strb r0, [r1, 0x10] -_0811B9B6: - bl sub_811BA1C - lsls r0, 24 - cmp r0, 0 - bne _0811B9A4 -_0811B9C0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_811B9A0 - - thumb_func_start sub_811B9C8 -sub_811B9C8: @ 811B9C8 - push {r4,lr} - ldr r4, =0x0203a118 - ldr r1, [r4] - ldrb r0, [r1, 0x9] - cmp r0, 0 - bne _0811B9F8 - bl sub_811B8E8 - adds r4, r0, 0 - bl sub_811F3AC - movs r1, 0 - lsls r0, 24 - lsls r4, 16 - lsrs r4, 16 - lsrs r0, 24 - cmp r4, r0 - bcc _0811B9EE - movs r1, 0x1 -_0811B9EE: - adds r0, r1, 0 - b _0811BA14 - .pool -_0811B9F8: - ldrb r0, [r1, 0xB] - bl sub_811B960 - movs r2, 0 - ldr r1, [r4] - ldrb r1, [r1, 0xA] - lsls r1, 24 - asrs r1, 24 - lsls r0, 24 - lsrs r0, 24 - cmp r1, r0 - ble _0811BA12 - movs r2, 0x1 -_0811BA12: - adds r0, r2, 0 -_0811BA14: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811B9C8 - - thumb_func_start sub_811BA1C -sub_811BA1C: @ 811BA1C - push {r4,lr} - bl sub_811B940 - adds r4, r0, 0 - bl sub_811F5B0 - movs r1, 0 - lsls r4, 16 - lsls r0, 16 - cmp r4, r0 - bcc _0811BA34 - movs r1, 0x1 -_0811BA34: - adds r0, r1, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811BA1C - - thumb_func_start sub_811BA3C -sub_811BA3C: @ 811BA3C - ldr r2, =gUnknown_08597550 - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x3] - lsrs r0, 7 - bx lr - .pool - thumb_func_end sub_811BA3C - - thumb_func_start sub_811BA5C -sub_811BA5C: @ 811BA5C - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_811BA5C - - thumb_func_start sub_811BA68 -sub_811BA68: @ 811BA68 - ldr r2, =gUnknown_08597550 - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r1, [r0, 0x1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r0, [r0, 0x3] - lsls r0, 25 - lsrs r0, 25 - bx lr - .pool - thumb_func_end sub_811BA68 - - thumb_func_start sub_811BA88 -sub_811BA88: @ 811BA88 - ldr r0, =0x0203a118 - ldr r0, [r0] - ldr r0, [r0, 0x34] - bx lr - .pool - thumb_func_end sub_811BA88 - - thumb_func_start sub_811BA94 -sub_811BA94: @ 811BA94 - ldr r0, =0x0203a118 - ldr r0, [r0] - adds r0, 0x3C - bx lr - .pool - thumb_func_end sub_811BA94 - - thumb_func_start sub_811BAA0 -sub_811BAA0: @ 811BAA0 - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r0, [r0, 0x3] - bx lr - .pool - thumb_func_end sub_811BAA0 - - thumb_func_start sub_811BAAC -sub_811BAAC: @ 811BAAC - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r0, [r0, 0x2] - bx lr - .pool - thumb_func_end sub_811BAAC - - thumb_func_start sub_811BAB8 -sub_811BAB8: @ 811BAB8 - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r0, [r0, 0x5] - bx lr - .pool - thumb_func_end sub_811BAB8 - - thumb_func_start sub_811BAC4 -sub_811BAC4: @ 811BAC4 - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r0, [r0, 0x6] - bx lr - .pool - thumb_func_end sub_811BAC4 - - thumb_func_start sub_811BAD0 -sub_811BAD0: @ 811BAD0 - push {r4,r5,lr} - ldr r4, =gUnknown_08597550 - ldr r2, =0x0203a118 - ldr r5, [r2] - ldrb r3, [r5, 0x1] - lsls r2, r3, 1 - adds r2, r3 - lsls r2, 3 - adds r3, r4, 0 - adds r3, 0x8 - adds r2, r3 - ldr r2, [r2] - str r2, [r0] - ldrb r2, [r5, 0x1] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 3 - adds r4, 0xC - adds r0, r4 - ldr r0, [r0] - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811BAD0 - - thumb_func_start sub_811BB08 -sub_811BB08: @ 811BB08 - push {r4,r5,lr} - ldr r4, =gUnknown_08597550 - ldr r2, =0x0203a118 - ldr r5, [r2] - ldrb r3, [r5, 0x1] - lsls r2, r3, 1 - adds r2, r3 - lsls r2, 3 - adds r3, r4, 0 - adds r3, 0x10 - adds r2, r3 - ldr r2, [r2] - str r2, [r0] - ldrb r2, [r5, 0x1] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 3 - adds r4, 0x14 - adds r0, r4 - ldr r0, [r0] - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811BB08 - - thumb_func_start sub_811BB40 -sub_811BB40: @ 811BB40 - push {lr} - adds r2, r0, 0 - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0x4 - bne _0811BB5C - ldr r0, =gUnknown_085EC3B4 - b _0811BB7A - .pool -_0811BB5C: - cmp r0, 0x4 - blt _0811BB78 - cmp r0, 0x10 - bgt _0811BB78 - cmp r0, 0xF - blt _0811BB78 - ldr r0, =gUnknown_085EC706 - str r0, [r2] - ldr r0, =gUnknown_085EC727 - b _0811BB7E - .pool -_0811BB78: - ldr r0, =gUnknown_085EC3A6 -_0811BB7A: - str r0, [r2] - movs r0, 0 -_0811BB7E: - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_811BB40 - - thumb_func_start sub_811BB88 -sub_811BB88: @ 811BB88 - ldr r2, =gUnknown_085EC410 - str r2, [r0] - ldr r0, =gUnknown_085EC42F - str r0, [r1] - bx lr - .pool - thumb_func_end sub_811BB88 - - thumb_func_start sub_811BB9C -sub_811BB9C: @ 811BB9C - ldr r2, =0x0203a118 - ldr r3, [r2] - ldrb r2, [r3, 0xA] - strb r2, [r0] - ldrb r0, [r3, 0xB] - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_811BB9C - - thumb_func_start sub_811BBB0 -sub_811BBB0: @ 811BBB0 - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r0, [r0, 0x9] - bx lr - .pool - thumb_func_end sub_811BBB0 - - thumb_func_start sub_811BBBC -sub_811BBBC: @ 811BBBC - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r0, [r0, 0xC] - bx lr - .pool - thumb_func_end sub_811BBBC - - thumb_func_start sub_811BBC8 -sub_811BBC8: @ 811BBC8 - ldr r2, =0x0203a118 - ldr r3, [r2] - ldrb r2, [r3, 0x10] - strb r2, [r0] - ldrb r0, [r3, 0x11] - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_811BBC8 - - thumb_func_start sub_811BBDC -sub_811BBDC: @ 811BBDC - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r0, [r0, 0xE] - bx lr - .pool - thumb_func_end sub_811BBDC - - thumb_func_start sub_811BBE8 -sub_811BBE8: @ 811BBE8 - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r0, [r0, 0xF] - bx lr - .pool - thumb_func_end sub_811BBE8 - - thumb_func_start sub_811BBF4 -sub_811BBF4: @ 811BBF4 - movs r0, 0 - bx lr - thumb_func_end sub_811BBF4 - - thumb_func_start sub_811BBF8 -sub_811BBF8: @ 811BBF8 - push {lr} - ldr r0, =0x0203a118 - ldr r1, [r0] - ldrb r0, [r1, 0x4] - cmp r0, 0x2 - beq _0811BC10 - cmp r0, 0x3 - beq _0811BC1A - b _0811BC24 - .pool -_0811BC10: - ldrb r0, [r1, 0x9] - cmp r0, 0 - bne _0811BC24 - ldrb r0, [r1, 0xC] - b _0811BC1C -_0811BC1A: - ldrb r0, [r1, 0xE] -_0811BC1C: - cmp r0, 0 - beq _0811BC24 - movs r0, 0x1 - b _0811BC26 -_0811BC24: - movs r0, 0 -_0811BC26: - pop {r1} - bx r1 - thumb_func_end sub_811BBF8 - - thumb_func_start sub_811BC2C -sub_811BC2C: @ 811BC2C - push {lr} - ldr r0, =0x0203a118 - ldr r2, [r0] - ldrb r0, [r2, 0x4] - cmp r0, 0x2 - beq _0811BC44 - cmp r0, 0x3 - beq _0811BC5A - b _0811BC68 - .pool -_0811BC44: - ldrb r0, [r2, 0x9] - cmp r0, 0 - bne _0811BC68 - ldrb r1, [r2, 0xC] - adds r1, 0x4 - ldrb r0, [r2, 0xD] - subs r0, 0x1 - cmp r1, r0 - bgt _0811BC68 - movs r0, 0x1 - b _0811BC6A -_0811BC5A: - ldrb r0, [r2, 0xE] - adds r0, 0x4 - ldrb r2, [r2, 0xF] - cmp r0, r2 - bgt _0811BC68 - movs r0, 0x1 - b _0811BC6A -_0811BC68: - movs r0, 0 -_0811BC6A: - pop {r1} - bx r1 - thumb_func_end sub_811BC2C - - thumb_func_start sub_811BC70 -sub_811BC70: @ 811BC70 - push {lr} - bl sub_811BA3C - pop {r1} - bx r1 - thumb_func_end sub_811BC70 - - thumb_func_start sub_811BC7C -sub_811BC7C: @ 811BC7C - push {r4,r5,lr} - adds r5, r0, 0 - lsls r1, 24 - lsrs r3, r1, 24 - movs r2, 0 - cmp r2, r3 - bcs _0811BCB2 - ldr r0, =0x0203a118 - ldr r0, [r0] - adds r4, r0, 0 - adds r4, 0x3C -_0811BC92: - lsls r0, r2, 1 - adds r1, r0, r5 - adds r0, r4, r0 - ldrh r1, [r1] - ldrh r0, [r0] - cmp r1, r0 - beq _0811BCA8 - movs r0, 0x1 - b _0811BCB4 - .pool -_0811BCA8: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r3 - bcc _0811BC92 -_0811BCB2: - movs r0, 0 -_0811BCB4: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_811BC7C - - thumb_func_start sub_811BCBC -sub_811BCBC: @ 811BCBC - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r0, [r0, 0x12] - bx lr - .pool - thumb_func_end sub_811BCBC - - thumb_func_start sub_811BCC8 -sub_811BCC8: @ 811BCC8 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - movs r1, 0 - ldr r2, =gUnknown_08597550 -_0811BCD2: - ldrb r0, [r2] - cmp r0, r3 - bne _0811BCE4 - lsls r0, r1, 24 - lsrs r0, 24 - b _0811BCEE - .pool -_0811BCE4: - adds r2, 0x18 - adds r1, 0x1 - cmp r1, 0x14 - bls _0811BCD2 - movs r0, 0 -_0811BCEE: - pop {r1} - bx r1 - thumb_func_end sub_811BCC8 - - thumb_func_start sub_811BCF4 -sub_811BCF4: @ 811BCF4 - push {r4,lr} - movs r2, 0 - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r1, [r0, 0x7] - cmp r2, r1 - bge _0811BD24 - ldr r4, =0x0000ffff - adds r3, r1, 0 - adds r1, r0, 0 - adds r1, 0x3C -_0811BD0A: - ldrh r0, [r1] - cmp r0, r4 - beq _0811BD1C - movs r0, 0 - b _0811BD26 - .pool -_0811BD1C: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, r3 - blt _0811BD0A -_0811BD24: - movs r0, 0x1 -_0811BD26: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811BCF4 - - thumb_func_start sub_811BD2C -sub_811BD2C: @ 811BD2C - push {r4,lr} - movs r2, 0 - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r1, [r0, 0x7] - cmp r2, r1 - bge _0811BD5C - ldr r4, =0x0000ffff - adds r3, r1, 0 - adds r1, r0, 0 - adds r1, 0x3C -_0811BD42: - ldrh r0, [r1] - cmp r0, r4 - bne _0811BD54 - movs r0, 0 - b _0811BD5E - .pool -_0811BD54: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, r3 - blt _0811BD42 -_0811BD5C: - movs r0, 0x1 -_0811BD5E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811BD2C - - thumb_func_start sub_811BD64 -sub_811BD64: @ 811BD64 - push {r4,lr} - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0x11 - bne _0811BD80 - bl sub_811BCF4 - b _0811BD9C - .pool -_0811BD7C: - movs r0, 0 - b _0811BD9C -_0811BD80: - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r2, 0 - ldr r3, =0x0000ffff - ldr r4, =0x00003b5a - adds r1, r0, r4 -_0811BD8C: - ldrh r0, [r1] - cmp r0, r3 - bne _0811BD7C - adds r1, 0x2 - adds r2, 0x1 - cmp r2, 0x8 - ble _0811BD8C - movs r0, 0x1 -_0811BD9C: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_811BD64 - - thumb_func_start sub_811BDB0 -sub_811BDB0: @ 811BDB0 - push {lr} - ldr r0, =0x0203a118 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0x12 - bne _0811BDC8 - bl sub_811BCF4 - b _0811BDDE - .pool -_0811BDC8: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - movs r2, 0 - ldrh r1, [r0, 0x14] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _0811BDDC - movs r2, 0x1 -_0811BDDC: - adds r0, r2, 0 -_0811BDDE: - pop {r1} - bx r1 - .pool - thumb_func_end sub_811BDB0 - - thumb_func_start sub_811BDF0 -sub_811BDF0: @ 811BDF0 - push {r4-r6,lr} - sub sp, 0x20 - adds r6, r0, 0 - ldr r0, =0x03005d8c - ldr r4, [r0] - bl sub_81AFBF0 - ldr r0, =0x00003b70 - adds r5, r4, r0 - adds r0, r5, 0 - bl GetStringLength - lsls r0, 16 - cmp r0, 0 - beq _0811BE34 - ldr r1, =0x00003b85 - adds r0, r4, r1 - ldrb r2, [r0] - mov r0, sp - adds r1, r5, 0 - bl sub_81DB5E8 - movs r0, 0 - mov r1, sp - bl sub_81AFC0C - b _0811BE3C - .pool -_0811BE34: - ldr r1, =gUnknown_085EC6B2 - movs r0, 0 - bl sub_81AFC0C -_0811BE3C: - ldr r1, =gUnknown_085EC6A8 - adds r0, r6, 0 - bl sub_81AFC28 - add sp, 0x20 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811BDF0 - - thumb_func_start sub_811BE54 -sub_811BE54: @ 811BE54 - push {r4,r5,lr} - ldr r0, =0x0203a118 - ldr r0, [r0] - adds r4, r0, 0 - adds r4, 0x3C - ldr r2, =0x02021dc4 - movs r5, 0 - b _0811BE86 - .pool -_0811BE6C: - ldrh r1, [r4] - adds r0, r2, 0 - movs r2, 0 - bl CopyEasyChatWordPadded - adds r2, r0, 0 - movs r0, 0 - strb r0, [r2] - adds r2, 0x1 - adds r4, 0x2 - adds r5, 0x1 - ldr r0, =0x0203a118 - ldr r0, [r0] -_0811BE86: - ldrb r0, [r0, 0x7] - cmp r5, r0 - blt _0811BE6C - subs r2, 0x1 - movs r0, 0xFF - strb r0, [r2] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811BE54 - - thumb_func_start sub_811BE9C -sub_811BE9C: @ 811BE9C - push {r4,r5,lr} - ldr r5, =0x0203a118 - ldr r0, [r5] - ldrb r0, [r0] - cmp r0, 0x9 - beq _0811BEF0 - cmp r0, 0x9 - bgt _0811BEB8 - cmp r0, 0 - beq _0811BEC2 - b _0811BF14 - .pool -_0811BEB8: - cmp r0, 0xD - beq _0811BF0C - cmp r0, 0x14 - beq _0811BED0 - b _0811BF14 -_0811BEC2: - ldr r0, =0x00000865 - bl FlagSet - b _0811BF14 - .pool -_0811BED0: - bl sub_811BF20 - adds r1, r0, 0 - cmp r1, 0 - beq _0811BEE4 - ldr r1, =0x020375e0 - movs r0, 0x2 - b _0811BF12 - .pool -_0811BEE4: - ldr r0, =0x020375e0 - strh r1, [r0] - b _0811BF14 - .pool -_0811BEF0: - bl sub_811BE54 - ldr r4, =0x020375e0 - ldr r0, [r5] - adds r0, 0x3C - bl sub_81226D8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - b _0811BF14 - .pool -_0811BF0C: - bl sub_811BF40 - ldr r1, =0x020375e0 -_0811BF12: - strh r0, [r1] -_0811BF14: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811BE9C - - thumb_func_start sub_811BF20 -sub_811BF20: @ 811BF20 - push {lr} - ldr r0, =gUnknown_08597764 - movs r1, 0x4 - bl sub_811BC7C - movs r1, 0 - lsls r0, 24 - cmp r0, 0 - bne _0811BF34 - movs r1, 0x1 -_0811BF34: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_811BF20 - - thumb_func_start sub_811BF40 -sub_811BF40: @ 811BF40 - push {r4,r5,lr} - movs r4, 0 - movs r5, 0x80 - lsls r5, 9 -_0811BF48: - lsls r0, r4, 2 - ldr r1, =gUnknown_0859776C - adds r0, r1 - movs r1, 0x2 - bl sub_811BC7C - lsls r0, 24 - cmp r0, 0 - bne _0811BF64 - lsrs r0, r5, 16 - b _0811BF72 - .pool -_0811BF64: - movs r0, 0x80 - lsls r0, 9 - adds r5, r0 - adds r4, 0x1 - cmp r4, 0x4 - ble _0811BF48 - movs r0, 0 -_0811BF72: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_811BF40 - - thumb_func_start sub_811BF78 -sub_811BF78: @ 811BF78 - ldr r0, =0x0203a118 - ldr r1, [r0] - movs r0, 0 - strb r0, [r1, 0x13] - bx lr - .pool - thumb_func_end sub_811BF78 - - thumb_func_start sub_811BF88 -sub_811BF88: @ 811BF88 - movs r0, 0 - bx lr - thumb_func_end sub_811BF88 - - thumb_func_start sub_811BF8C -sub_811BF8C: @ 811BF8C - push {lr} - bl sub_811CE94 - lsls r0, 24 - cmp r0, 0 - beq _0811BF9C - movs r0, 0x1 - b _0811BF9E -_0811BF9C: - movs r0, 0 -_0811BF9E: - pop {r1} - bx r1 - thumb_func_end sub_811BF8C - - thumb_func_start sub_811BFA4 -sub_811BFA4: @ 811BFA4 - push {r4,lr} - sub sp, 0x8 - ldr r0, =0x0203a11c - ldr r0, [r0] - ldrh r0, [r0] - cmp r0, 0x5 - bls _0811BFB4 - b _0811C120 -_0811BFB4: - lsls r0, 2 - ldr r1, =_0811BFC8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0811BFC8: - .4byte _0811BFE0 - .4byte _0811C044 - .4byte _0811C090 - .4byte _0811C0AC - .4byte _0811C0BE - .4byte _0811C0D4 -_0811BFE0: - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_08597C54 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r4, =0x0203a11c - ldr r1, [r4] - movs r0, 0xB0 - lsls r0, 4 - adds r1, r0 - movs r0, 0x3 - bl SetBgTilemapBuffer - ldr r1, [r4] - movs r0, 0xC0 - lsls r0, 2 - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r0, =gUnknown_08597C64 - bl InitWindows - bl DeactivateAllTextPrinters - bl sub_811CF64 - bl sub_811CF04 - movs r0, 0 - str r0, [sp, 0x4] - movs r1, 0xE0 - lsls r1, 19 - ldr r2, =0x01000100 - add r0, sp, 0x4 - bl CpuFastSet - b _0811C124 - .pool -_0811C044: - ldr r1, =gUnknown_08DCBDD0 - movs r0, 0 - str r0, [sp] - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_08DCBF10 - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - bl sub_811D60C - ldr r0, =0x0203a11c - ldr r0, [r0] - movs r1, 0xC0 - lsls r1, 2 - adds r0, r1 - bl sub_811D424 - bl sub_811D230 - bl sub_811E948 - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - b _0811C124 - .pool -_0811C090: - ldr r1, =gUnknown_08597B54 - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - b _0811C124 - .pool -_0811C0AC: - bl sub_811CFCC - bl sub_811D0BC - bl sub_811D2C8 - bl sub_811D684 - b _0811C124 -_0811C0BE: - bl sub_811DE90 - bl sub_811BA5C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - beq _0811C124 - bl sub_811DEC4 - b _0811C124 -_0811C0D4: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0811C12E - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_811DE5C - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x3B - bl SetGpuReg - movs r0, 0x3 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0 - bl ShowBg - bl sub_811E5D4 - bl sub_811E720 - bl sub_811E828 - b _0811C124 -_0811C120: - movs r0, 0 - b _0811C130 -_0811C124: - ldr r0, =0x0203a11c - ldr r1, [r0] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0811C12E: - movs r0, 0x1 -_0811C130: - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_811BFA4 - - thumb_func_start sub_811C13C -sub_811C13C: @ 811C13C - push {r4,lr} - ldr r4, =0x0203a11c - ldr r0, [r4] - cmp r0, 0 - beq _0811C14E - bl Free - movs r0, 0 - str r0, [r4] -_0811C14E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811C13C - - thumb_func_start sub_811C158 -sub_811C158: @ 811C158 - push {lr} - ldr r1, =0x0203a11c - ldr r1, [r1] - movs r2, 0 - strh r0, [r1, 0x4] - strh r2, [r1] - bl sub_811C170 - pop {r0} - bx r0 - .pool - thumb_func_end sub_811C158 - - thumb_func_start sub_811C170 -sub_811C170: @ 811C170 - push {lr} - ldr r0, =0x0203a11c - ldr r0, [r0] - ldrh r0, [r0, 0x4] - cmp r0, 0x22 - bls _0811C17E - b _0811C2CE -_0811C17E: - lsls r0, 2 - ldr r1, =_0811C190 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0811C190: - .4byte _0811C2CE - .4byte _0811C21C - .4byte _0811C222 - .4byte _0811C228 - .4byte _0811C22E - .4byte _0811C234 - .4byte _0811C23A - .4byte _0811C240 - .4byte _0811C246 - .4byte _0811C24C - .4byte _0811C252 - .4byte _0811C258 - .4byte _0811C25E - .4byte _0811C264 - .4byte _0811C26A - .4byte _0811C270 - .4byte _0811C276 - .4byte _0811C27C - .4byte _0811C282 - .4byte _0811C288 - .4byte _0811C28E - .4byte _0811C294 - .4byte _0811C29A - .4byte _0811C2A0 - .4byte _0811C2CE - .4byte _0811C2CE - .4byte _0811C2CE - .4byte _0811C2CE - .4byte _0811C2CE - .4byte _0811C2A6 - .4byte _0811C2AC - .4byte _0811C2B2 - .4byte _0811C2B8 - .4byte _0811C2BE - .4byte _0811C2C4 -_0811C21C: - bl sub_811C2D4 - b _0811C2C8 -_0811C222: - bl sub_811C30C - b _0811C2C8 -_0811C228: - bl sub_811C3E4 - b _0811C2C8 -_0811C22E: - bl sub_811C48C - b _0811C2C8 -_0811C234: - bl sub_811C404 - b _0811C2C8 -_0811C23A: - bl sub_811C448 - b _0811C2C8 -_0811C240: - bl sub_811C4D0 - b _0811C2C8 -_0811C246: - bl sub_811C518 - b _0811C2C8 -_0811C24C: - bl sub_811C554 - b _0811C2C8 -_0811C252: - bl sub_811C620 - b _0811C2C8 -_0811C258: - bl sub_811C830 - b _0811C2C8 -_0811C25E: - bl sub_811C8F0 - b _0811C2C8 -_0811C264: - bl sub_811C99C - b _0811C2C8 -_0811C26A: - bl sub_811CA5C - b _0811C2C8 -_0811C270: - bl sub_811C780 - b _0811C2C8 -_0811C276: - bl sub_811C78C - b _0811C2C8 -_0811C27C: - bl sub_811C7D4 - b _0811C2C8 -_0811C282: - bl sub_811CB18 - b _0811C2C8 -_0811C288: - bl sub_811CB98 - b _0811C2C8 -_0811C28E: - bl sub_811CB24 - b _0811C2C8 -_0811C294: - bl sub_811CC90 - b _0811C2C8 -_0811C29A: - bl sub_811CC08 - b _0811C2C8 -_0811C2A0: - bl sub_811C6C0 - b _0811C2C8 -_0811C2A6: - bl sub_811CD14 - b _0811C2C8 -_0811C2AC: - bl sub_811CD54 - b _0811C2C8 -_0811C2B2: - bl sub_811CD94 - b _0811C2C8 -_0811C2B8: - bl sub_811CDD4 - b _0811C2C8 -_0811C2BE: - bl sub_811CE14 - b _0811C2C8 -_0811C2C4: - bl sub_811CE54 -_0811C2C8: - lsls r0, 24 - lsrs r0, 24 - b _0811C2D0 -_0811C2CE: - movs r0, 0 -_0811C2D0: - pop {r1} - bx r1 - thumb_func_end sub_811C170 - - thumb_func_start sub_811C2D4 -sub_811C2D4: @ 811C2D4 - push {r4,lr} - ldr r4, =0x0203a11c - ldr r0, [r4] - ldrh r0, [r0] - cmp r0, 0 - beq _0811C2EC - cmp r0, 0x1 - beq _0811C2FA - b _0811C304 - .pool -_0811C2EC: - bl sub_811D2C8 - ldr r1, [r4] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0811C304 -_0811C2FA: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - b _0811C306 -_0811C304: - movs r0, 0x1 -_0811C306: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811C2D4 - - thumb_func_start sub_811C30C -sub_811C30C: @ 811C30C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x40 - bl sub_811BA94 - adds r4, r0, 0 - bl sub_811BA68 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - bl sub_811BAB8 - lsls r0, 24 - lsrs r7, r0, 24 - bl sub_811BAC4 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - bl sub_811BAAC - lsls r0, 24 - lsrs r0, 24 - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - lsls r0, 1 - adds r4, r0 - ldr r1, =gUnknown_08597C30 - mov r2, r10 - lsls r0, r2, 2 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 27 - lsrs r0, 8 - movs r1, 0xD0 - lsls r1, 12 - adds r0, r1 - lsrs r6, r0, 16 - movs r5, 0 - cmp r5, r7 - bcs _0811C3AA - ldr r2, =0x0000ffff - mov r8, r2 -_0811C36C: - ldrh r0, [r4] - cmp r0, r8 - bne _0811C380 - movs r0, 0x48 - b _0811C392 - .pool -_0811C380: - ldrh r1, [r4] - mov r0, sp - bl CopyEasyChatWord - movs r0, 0x1 - mov r1, sp - movs r2, 0 - bl GetStringWidth -_0811C392: - adds r0, 0x11 - lsls r1, r6, 16 - asrs r1, 16 - adds r1, r0 - lsls r1, 16 - lsrs r6, r1, 16 - adds r4, 0x2 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r7 - bcc _0811C36C -_0811C3AA: - ldr r1, =gUnknown_08597C30 - mov r2, r10 - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - lsrs r1, 5 - mov r2, r9 - lsls r0, r2, 1 - adds r1, r0 - lsls r1, 27 - lsls r0, r6, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 20 - adds r1, r2 - lsrs r1, 24 - bl sub_811DF60 - movs r0, 0 - add sp, 0x40 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_811C30C - - thumb_func_start sub_811C3E4 -sub_811C3E4: @ 811C3E4 - push {lr} - bl sub_811BAB8 - lsls r0, 24 - lsrs r0, 24 - bl sub_811E920 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x60 - bl sub_811DF60 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_811C3E4 - - thumb_func_start sub_811C404 -sub_811C404: @ 811C404 - push {r4,lr} - ldr r4, =0x0203a11c - ldr r0, [r4] - ldrh r0, [r0] - cmp r0, 0 - beq _0811C41C - cmp r0, 0x1 - beq _0811C436 - b _0811C440 - .pool -_0811C41C: - bl sub_811DF90 - movs r0, 0x2 - bl sub_811D104 - movs r0, 0x1 - bl sub_811D214 - ldr r1, [r4] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0811C440 -_0811C436: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - b _0811C442 -_0811C440: - movs r0, 0x1 -_0811C442: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811C404 - - thumb_func_start sub_811C448 -sub_811C448: @ 811C448 - push {r4,lr} - ldr r4, =0x0203a11c - ldr r0, [r4] - ldrh r0, [r0] - cmp r0, 0 - beq _0811C460 - cmp r0, 0x1 - beq _0811C47A - b _0811C484 - .pool -_0811C460: - bl sub_811DF90 - movs r0, 0x3 - bl sub_811D104 - movs r0, 0 - bl sub_811D214 - ldr r1, [r4] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0811C484 -_0811C47A: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - b _0811C486 -_0811C484: - movs r0, 0x1 -_0811C486: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811C448 - - thumb_func_start sub_811C48C -sub_811C48C: @ 811C48C - push {r4,lr} - ldr r4, =0x0203a11c - ldr r0, [r4] - ldrh r0, [r0] - cmp r0, 0 - beq _0811C4A4 - cmp r0, 0x1 - beq _0811C4BE - b _0811C4C8 - .pool -_0811C4A4: - bl sub_811DF90 - movs r0, 0x1 - bl sub_811D104 - movs r0, 0x1 - bl sub_811D214 - ldr r1, [r4] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0811C4C8 -_0811C4BE: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - b _0811C4CA -_0811C4C8: - movs r0, 0x1 -_0811C4CA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811C48C - - thumb_func_start sub_811C4D0 -sub_811C4D0: @ 811C4D0 - push {r4,lr} - ldr r4, =0x0203a11c - ldr r0, [r4] - ldrh r0, [r0] - cmp r0, 0 - beq _0811C4E8 - cmp r0, 0x1 - beq _0811C506 - b _0811C510 - .pool -_0811C4E8: - bl sub_811DFB0 - movs r0, 0 - bl sub_811D104 - bl sub_811D2C8 - movs r0, 0 - bl ShowBg - ldr r1, [r4] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0811C510 -_0811C506: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - b _0811C512 -_0811C510: - movs r0, 0x1 -_0811C512: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811C4D0 - - thumb_func_start sub_811C518 -sub_811C518: @ 811C518 - push {r4,lr} - ldr r4, =0x0203a11c - ldr r0, [r4] - ldrh r0, [r0] - cmp r0, 0 - beq _0811C530 - cmp r0, 0x1 - beq _0811C546 - movs r0, 0x1 - b _0811C54E - .pool -_0811C530: - bl sub_811DFB0 - movs r0, 0 - bl sub_811D104 - bl sub_811D2C8 - ldr r1, [r4] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0811C546: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 -_0811C54E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811C518 - - thumb_func_start sub_811C554 -sub_811C554: @ 811C554 - push {lr} - ldr r0, =0x0203a11c - ldr r0, [r0] - ldrh r0, [r0] - cmp r0, 0x4 - bhi _0811C60E - lsls r0, 2 - ldr r1, =_0811C574 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0811C574: - .4byte _0811C588 - .4byte _0811C5A4 - .4byte _0811C5B6 - .4byte _0811C5CC - .4byte _0811C5EC -_0811C588: - bl sub_811DF90 - movs r0, 0 - bl HideBg - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_811DE5C - bl sub_811D6D4 - b _0811C5DA -_0811C5A4: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0811C618 - movs r0, 0 - bl sub_811D9CC - b _0811C5DA -_0811C5B6: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0811C618 - bl sub_811DAA4 - lsls r0, 24 - cmp r0, 0 - bne _0811C618 - b _0811C5DA -_0811C5CC: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0811C618 - bl sub_811E3AC -_0811C5DA: - ldr r0, =0x0203a11c - ldr r1, [r0] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0811C618 - .pool -_0811C5EC: - bl sub_811E418 - lsls r0, 24 - cmp r0, 0 - bne _0811C618 - bl sub_811DFC8 - movs r0, 0 - bl sub_811E6E0 - bl sub_811E64C - ldr r0, =0x0203a11c - ldr r1, [r0] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0811C60E: - movs r0, 0 - b _0811C61A - .pool -_0811C618: - movs r0, 0x1 -_0811C61A: - pop {r1} - bx r1 - thumb_func_end sub_811C554 - - thumb_func_start sub_811C620 -sub_811C620: @ 811C620 - push {lr} - ldr r0, =0x0203a11c - ldr r0, [r0] - ldrh r0, [r0] - cmp r0, 0x4 - bhi _0811C6B8 - lsls r0, 2 - ldr r1, =_0811C640 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0811C640: - .4byte _0811C654 - .4byte _0811C662 - .4byte _0811C67E - .4byte _0811C690 - .4byte _0811C6B4 -_0811C654: - bl sub_811E050 - bl sub_811E4AC - bl sub_811E6B0 - b _0811C6A4 -_0811C662: - bl sub_811E4D0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0811C6B8 - movs r0, 0x1 - bl sub_811D9CC - ldr r0, =0x0203a11c - ldr r1, [r0] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0811C67E: - bl sub_811DAA4 - lsls r0, 24 - cmp r0, 0 - bne _0811C6B8 - b _0811C6A4 - .pool -_0811C690: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0811C6B8 - bl sub_811DFB0 - movs r0, 0 - bl ShowBg -_0811C6A4: - ldr r0, =0x0203a11c - ldr r1, [r0] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0811C6B8 - .pool -_0811C6B4: - movs r0, 0 - b _0811C6BA -_0811C6B8: - movs r0, 0x1 -_0811C6BA: - pop {r1} - bx r1 - thumb_func_end sub_811C620 - - thumb_func_start sub_811C6C0 -sub_811C6C0: @ 811C6C0 - push {lr} - ldr r0, =0x0203a11c - ldr r0, [r0] - ldrh r0, [r0] - cmp r0, 0x4 - bhi _0811C778 - lsls r0, 2 - ldr r1, =_0811C6E0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0811C6E0: - .4byte _0811C6F4 - .4byte _0811C708 - .4byte _0811C722 - .4byte _0811C748 - .4byte _0811C76E -_0811C6F4: - bl sub_811E050 - bl sub_811E6B0 - bl sub_811E55C - movs r0, 0x5 - bl sub_811D9CC - b _0811C736 -_0811C708: - bl sub_811DAA4 - lsls r0, 24 - cmp r0, 0 - bne _0811C778 - bl sub_811E5B8 - lsls r0, 24 - cmp r0, 0 - bne _0811C778 - bl sub_811D6D4 - b _0811C736 -_0811C722: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0811C778 - movs r0, 0x6 - bl sub_811D9CC - bl sub_811E578 -_0811C736: - ldr r0, =0x0203a11c - ldr r1, [r0] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0811C778 - .pool -_0811C748: - bl sub_811DAA4 - lsls r0, 24 - cmp r0, 0 - bne _0811C778 - bl sub_811E5B8 - lsls r0, 24 - cmp r0, 0 - bne _0811C778 - bl sub_811E64C - bl sub_811DFC8 - ldr r0, =0x0203a11c - ldr r1, [r0] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0811C76E: - movs r0, 0 - b _0811C77A - .pool -_0811C778: - movs r0, 0x1 -_0811C77A: - pop {r1} - bx r1 - thumb_func_end sub_811C6C0 - - thumb_func_start sub_811C780 -sub_811C780: @ 811C780 - push {lr} - bl sub_811E088 - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_811C780 - - thumb_func_start sub_811C78C -sub_811C78C: @ 811C78C - push {r4,lr} - ldr r4, =0x0203a11c - ldr r0, [r4] - ldrh r0, [r0] - cmp r0, 0 - beq _0811C7A4 - cmp r0, 0x1 - beq _0811C7B4 - b _0811C7CA - .pool -_0811C7A4: - movs r0, 0x1 - movs r1, 0x4 - bl sub_811DDAC - ldr r1, [r4] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0811C7B4: - bl sub_811DE10 - lsls r0, 24 - cmp r0, 0 - bne _0811C7CA - bl sub_811E088 - bl sub_811E64C - movs r0, 0 - b _0811C7CC -_0811C7CA: - movs r0, 0x1 -_0811C7CC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811C78C - - thumb_func_start sub_811C7D4 -sub_811C7D4: @ 811C7D4 - push {r4,lr} - ldr r4, =0x0203a11c - ldr r0, [r4] - ldrh r0, [r0] - cmp r0, 0x1 - beq _0811C808 - cmp r0, 0x1 - bgt _0811C7F0 - cmp r0, 0 - beq _0811C7F6 - b _0811C828 - .pool -_0811C7F0: - cmp r0, 0x2 - beq _0811C820 - b _0811C828 -_0811C7F6: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x4 - bl sub_811DDAC - ldr r1, [r4] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0811C808: - bl sub_811DE10 - lsls r0, 24 - cmp r0, 0 - bne _0811C828 - bl sub_811E64C - ldr r0, =0x0203a11c - ldr r1, [r0] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0811C820: - movs r0, 0 - b _0811C82A - .pool -_0811C828: - movs r0, 0x1 -_0811C82A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811C7D4 - - thumb_func_start sub_811C830 -sub_811C830: @ 811C830 - push {lr} - ldr r0, =0x0203a11c - ldr r0, [r0] - ldrh r0, [r0] - cmp r0, 0x5 - bhi _0811C8E8 - lsls r0, 2 - ldr r1, =_0811C850 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0811C850: - .4byte _0811C868 - .4byte _0811C876 - .4byte _0811C886 - .4byte _0811C898 - .4byte _0811C8B8 - .4byte _0811C8DE -_0811C868: - bl sub_811E050 - bl sub_811E4AC - bl sub_811E6B0 - b _0811C8A8 -_0811C876: - bl sub_811E4D0 - lsls r0, 24 - cmp r0, 0 - bne _0811C8E8 - bl sub_811D9B4 - b _0811C8A8 -_0811C886: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0811C8E8 - movs r0, 0x2 - bl sub_811D9CC - b _0811C8A8 -_0811C898: - bl sub_811DAA4 - lsls r0, 24 - cmp r0, 0 - bne _0811C8E8 - movs r0, 0x2 - bl sub_811D698 -_0811C8A8: - ldr r0, =0x0203a11c - ldr r1, [r0] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0811C8E8 - .pool -_0811C8B8: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0811C8E8 - bl sub_811E288 - movs r0, 0x1 - bl sub_811E6E0 - bl sub_811E64C - bl sub_811E794 - ldr r0, =0x0203a11c - ldr r1, [r0] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0811C8DE: - movs r0, 0 - b _0811C8EA - .pool -_0811C8E8: - movs r0, 0x1 -_0811C8EA: - pop {r1} - bx r1 - thumb_func_end sub_811C830 - - thumb_func_start sub_811C8F0 -sub_811C8F0: @ 811C8F0 - push {lr} - ldr r0, =0x0203a11c - ldr r0, [r0] - ldrh r0, [r0] - cmp r0, 0x5 - bhi _0811C994 - lsls r0, 2 - ldr r1, =_0811C910 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0811C910: - .4byte _0811C928 - .4byte _0811C92E - .4byte _0811C940 - .4byte _0811C952 - .4byte _0811C974 - .4byte _0811C98C -_0811C928: - bl sub_811D2C8 - b _0811C962 -_0811C92E: - bl sub_811E380 - bl sub_811E6B0 - bl sub_811E7F8 - bl sub_811D9B4 - b _0811C962 -_0811C940: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0811C994 - movs r0, 0x3 - bl sub_811D9CC - b _0811C962 -_0811C952: - bl sub_811DAA4 - lsls r0, 24 - cmp r0, 0 - bne _0811C994 - movs r0, 0 - bl ShowBg -_0811C962: - ldr r0, =0x0203a11c - ldr r1, [r0] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0811C994 - .pool -_0811C974: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0811C994 - bl sub_811DFB0 - ldr r0, =0x0203a11c - ldr r1, [r0] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0811C98C: - movs r0, 0 - b _0811C996 - .pool -_0811C994: - movs r0, 0x1 -_0811C996: - pop {r1} - bx r1 - thumb_func_end sub_811C8F0 - - thumb_func_start sub_811C99C -sub_811C99C: @ 811C99C - push {lr} - ldr r0, =0x0203a11c - ldr r0, [r0] - ldrh r0, [r0] - cmp r0, 0x6 - bhi _0811CA54 - lsls r0, 2 - ldr r1, =_0811C9BC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0811C9BC: - .4byte _0811C9D8 - .4byte _0811C9DE - .4byte _0811C9F0 - .4byte _0811CA02 - .4byte _0811CA14 - .4byte _0811CA34 - .4byte _0811CA4C -_0811C9D8: - bl sub_811D2C8 - b _0811CA24 -_0811C9DE: - bl sub_811E380 - bl sub_811E6B0 - bl sub_811E7F8 - bl sub_811D9B4 - b _0811CA24 -_0811C9F0: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0811CA54 - movs r0, 0x3 - bl sub_811D9CC - b _0811CA24 -_0811CA02: - bl sub_811DAA4 - lsls r0, 24 - cmp r0, 0 - bne _0811CA54 - movs r0, 0x3 - bl sub_811D104 - b _0811CA24 -_0811CA14: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0811CA54 - movs r0, 0 - bl ShowBg -_0811CA24: - ldr r0, =0x0203a11c - ldr r1, [r0] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0811CA54 - .pool -_0811CA34: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0811CA54 - bl sub_811DFB0 - ldr r0, =0x0203a11c - ldr r1, [r0] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0811CA4C: - movs r0, 0 - b _0811CA56 - .pool -_0811CA54: - movs r0, 0x1 -_0811CA56: - pop {r1} - bx r1 - thumb_func_end sub_811C99C - - thumb_func_start sub_811CA5C -sub_811CA5C: @ 811CA5C - push {lr} - ldr r0, =0x0203a11c - ldr r0, [r0] - ldrh r0, [r0] - cmp r0, 0x4 - bhi _0811CB10 - lsls r0, 2 - ldr r1, =_0811CA7C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0811CA7C: - .4byte _0811CA90 - .4byte _0811CAA2 - .4byte _0811CAB4 - .4byte _0811CAC4 - .4byte _0811CAE4 -_0811CA90: - bl sub_811E380 - bl sub_811E6B0 - bl sub_811E7F8 - bl sub_811D9B4 - b _0811CAD2 -_0811CAA2: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0811CB10 - movs r0, 0x4 - bl sub_811D9CC - b _0811CAD2 -_0811CAB4: - bl sub_811DAA4 - lsls r0, 24 - cmp r0, 0 - bne _0811CB10 - bl sub_811D6D4 - b _0811CAD2 -_0811CAC4: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0811CB10 - bl sub_811E3AC -_0811CAD2: - ldr r0, =0x0203a11c - ldr r1, [r0] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0811CB10 - .pool -_0811CAE4: - bl sub_811E418 - lsls r0, 24 - cmp r0, 0 - bne _0811CB10 - bl sub_811DFC8 - movs r0, 0 - bl sub_811E6E0 - bl sub_811E64C - ldr r0, =0x0203a11c - ldr r1, [r0] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - movs r0, 0 - b _0811CB12 - .pool -_0811CB10: - movs r0, 0x1 -_0811CB12: - pop {r1} - bx r1 - thumb_func_end sub_811CA5C - - thumb_func_start sub_811CB18 -sub_811CB18: @ 811CB18 - push {lr} - bl sub_811E30C - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_811CB18 - - thumb_func_start sub_811CB24 -sub_811CB24: @ 811CB24 - push {r4,lr} - ldr r4, =0x0203a11c - ldr r0, [r4] - ldrh r0, [r0] - cmp r0, 0x1 - beq _0811CB50 - cmp r0, 0x1 - bgt _0811CB40 - cmp r0, 0 - beq _0811CB4A - b _0811CB8E - .pool -_0811CB40: - cmp r0, 0x2 - beq _0811CB6C - cmp r0, 0x3 - beq _0811CB8A - b _0811CB8E -_0811CB4A: - bl sub_811D7A4 - b _0811CB62 -_0811CB50: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0811CB8E - movs r0, 0x1 - movs r1, 0x4 - bl sub_811DDAC -_0811CB62: - ldr r1, [r4] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0811CB8E -_0811CB6C: - bl sub_811DE10 - lsls r0, 24 - cmp r0, 0 - bne _0811CB8E - bl sub_811E30C - bl sub_811E64C - bl sub_811E794 - ldr r1, [r4] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0811CB8A: - movs r0, 0 - b _0811CB90 -_0811CB8E: - movs r0, 0x1 -_0811CB90: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811CB24 - - thumb_func_start sub_811CB98 -sub_811CB98: @ 811CB98 - push {r4,lr} - ldr r4, =0x0203a11c - ldr r0, [r4] - ldrh r0, [r0] - cmp r0, 0x1 - beq _0811CBC4 - cmp r0, 0x1 - bgt _0811CBB4 - cmp r0, 0 - beq _0811CBBE - b _0811CC00 - .pool -_0811CBB4: - cmp r0, 0x2 - beq _0811CBE2 - cmp r0, 0x3 - beq _0811CBFC - b _0811CC00 -_0811CBBE: - bl sub_811D7C8 - b _0811CBD8 -_0811CBC4: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0811CC00 - movs r0, 0x1 - negs r0, r0 - movs r1, 0x4 - bl sub_811DDAC -_0811CBD8: - ldr r1, [r4] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0811CC00 -_0811CBE2: - bl sub_811DE10 - lsls r0, 24 - cmp r0, 0 - bne _0811CC00 - bl sub_811E64C - bl sub_811E794 - ldr r1, [r4] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0811CBFC: - movs r0, 0 - b _0811CC02 -_0811CC00: - movs r0, 0x1 -_0811CC02: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811CB98 - - thumb_func_start sub_811CC08 -sub_811CC08: @ 811CC08 - push {r4,r5,lr} - ldr r5, =0x0203a11c - ldr r0, [r5] - ldrh r0, [r0] - cmp r0, 0x1 - beq _0811CC34 - cmp r0, 0x1 - bgt _0811CC24 - cmp r0, 0 - beq _0811CC2E - b _0811CC86 - .pool -_0811CC24: - cmp r0, 0x2 - beq _0811CC64 - cmp r0, 0x3 - beq _0811CC82 - b _0811CC86 -_0811CC2E: - bl sub_811D7EC - b _0811CC5A -_0811CC34: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0811CC86 - bl sub_811BBDC - adds r4, r0, 0 - bl sub_811DE48 - lsls r4, 24 - lsrs r4, 24 - subs r4, r0 - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 - movs r1, 0x8 - bl sub_811DDAC -_0811CC5A: - ldr r1, [r5] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0811CC86 -_0811CC64: - bl sub_811DE10 - lsls r0, 24 - cmp r0, 0 - bne _0811CC86 - bl sub_811E30C - bl sub_811E64C - bl sub_811E794 - ldr r1, [r5] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0811CC82: - movs r0, 0 - b _0811CC88 -_0811CC86: - movs r0, 0x1 -_0811CC88: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_811CC08 - - thumb_func_start sub_811CC90 -sub_811CC90: @ 811CC90 - push {r4,r5,lr} - ldr r5, =0x0203a11c - ldr r0, [r5] - ldrh r0, [r0] - cmp r0, 0x1 - beq _0811CCBC - cmp r0, 0x1 - bgt _0811CCAC - cmp r0, 0 - beq _0811CCB6 - b _0811CD0A - .pool -_0811CCAC: - cmp r0, 0x2 - beq _0811CCEC - cmp r0, 0x3 - beq _0811CD06 - b _0811CD0A -_0811CCB6: - bl sub_811D830 - b _0811CCE2 -_0811CCBC: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0811CD0A - bl sub_811BBDC - adds r4, r0, 0 - bl sub_811DE48 - lsls r4, 24 - lsrs r4, 24 - subs r4, r0 - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 - movs r1, 0x8 - bl sub_811DDAC -_0811CCE2: - ldr r1, [r5] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0811CD0A -_0811CCEC: - bl sub_811DE10 - lsls r0, 24 - cmp r0, 0 - bne _0811CD0A - bl sub_811E64C - bl sub_811E794 - ldr r1, [r5] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0811CD06: - movs r0, 0 - b _0811CD0C -_0811CD0A: - movs r0, 0x1 -_0811CD0C: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_811CC90 - - thumb_func_start sub_811CD14 -sub_811CD14: @ 811CD14 - push {r4,lr} - ldr r4, =0x0203a11c - ldr r0, [r4] - ldrh r0, [r0] - cmp r0, 0 - beq _0811CD2C - cmp r0, 0x1 - beq _0811CD40 - b _0811CD4A - .pool -_0811CD2C: - bl sub_811DF90 - movs r0, 0x4 - bl sub_811D104 - ldr r1, [r4] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0811CD4A -_0811CD40: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - b _0811CD4C -_0811CD4A: - movs r0, 0x1 -_0811CD4C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811CD14 - - thumb_func_start sub_811CD54 -sub_811CD54: @ 811CD54 - push {r4,lr} - ldr r4, =0x0203a11c - ldr r0, [r4] - ldrh r0, [r0] - cmp r0, 0 - beq _0811CD6C - cmp r0, 0x1 - beq _0811CD80 - b _0811CD8A - .pool -_0811CD6C: - bl sub_811DF90 - movs r0, 0x5 - bl sub_811D104 - ldr r1, [r4] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0811CD8A -_0811CD80: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - b _0811CD8C -_0811CD8A: - movs r0, 0x1 -_0811CD8C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811CD54 - - thumb_func_start sub_811CD94 -sub_811CD94: @ 811CD94 - push {r4,lr} - ldr r4, =0x0203a11c - ldr r0, [r4] - ldrh r0, [r0] - cmp r0, 0 - beq _0811CDAC - cmp r0, 0x1 - beq _0811CDC0 - b _0811CDCA - .pool -_0811CDAC: - bl sub_811DF90 - movs r0, 0x6 - bl sub_811D104 - ldr r1, [r4] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0811CDCA -_0811CDC0: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - b _0811CDCC -_0811CDCA: - movs r0, 0x1 -_0811CDCC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811CD94 - - thumb_func_start sub_811CDD4 -sub_811CDD4: @ 811CDD4 - push {r4,lr} - ldr r4, =0x0203a11c - ldr r0, [r4] - ldrh r0, [r0] - cmp r0, 0 - beq _0811CDEC - cmp r0, 0x1 - beq _0811CE00 - b _0811CE0A - .pool -_0811CDEC: - bl sub_811DF90 - movs r0, 0x7 - bl sub_811D104 - ldr r1, [r4] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0811CE0A -_0811CE00: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - b _0811CE0C -_0811CE0A: - movs r0, 0x1 -_0811CE0C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811CDD4 - - thumb_func_start sub_811CE14 -sub_811CE14: @ 811CE14 - push {r4,lr} - ldr r4, =0x0203a11c - ldr r0, [r4] - ldrh r0, [r0] - cmp r0, 0 - beq _0811CE2C - cmp r0, 0x1 - beq _0811CE40 - b _0811CE4A - .pool -_0811CE2C: - bl sub_811DF90 - movs r0, 0x8 - bl sub_811D104 - ldr r1, [r4] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0811CE4A -_0811CE40: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - b _0811CE4C -_0811CE4A: - movs r0, 0x1 -_0811CE4C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811CE14 - - thumb_func_start sub_811CE54 -sub_811CE54: @ 811CE54 - push {r4,lr} - ldr r4, =0x0203a11c - ldr r0, [r4] - ldrh r0, [r0] - cmp r0, 0 - beq _0811CE6C - cmp r0, 0x1 - beq _0811CE80 - b _0811CE8A - .pool -_0811CE6C: - bl sub_811DF90 - movs r0, 0x9 - bl sub_811D104 - ldr r1, [r4] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _0811CE8A -_0811CE80: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - b _0811CE8C -_0811CE8A: - movs r0, 0x1 -_0811CE8C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811CE54 - - thumb_func_start sub_811CE94 -sub_811CE94: @ 811CE94 - push {r4,lr} - ldr r4, =0x0203a11c - movs r0, 0x98 - lsls r0, 5 - bl Alloc - adds r2, r0, 0 - str r2, [r4] - cmp r2, 0 - beq _0811CEFC - movs r1, 0 - strh r1, [r2] - movs r3, 0xB6 - lsls r3, 2 - adds r0, r2, r3 - str r1, [r0] - adds r3, 0x4 - adds r0, r2, r3 - str r1, [r0] - adds r3, 0x4 - adds r0, r2, r3 - str r1, [r0] - adds r3, 0x4 - adds r0, r2, r3 - str r1, [r0] - adds r3, 0x4 - adds r0, r2, r3 - str r1, [r0] - adds r3, 0x4 - adds r0, r2, r3 - str r1, [r0] - adds r3, 0x4 - adds r0, r2, r3 - str r1, [r0] - adds r3, 0x4 - adds r0, r2, r3 - str r1, [r0] - adds r3, 0x4 - adds r0, r2, r3 - str r1, [r0] - adds r3, 0x4 - adds r0, r2, r3 - str r1, [r0] - bl sub_811BC70 - ldr r1, [r4] - strb r0, [r1, 0xA] - movs r0, 0x1 - b _0811CEFE - .pool -_0811CEFC: - movs r0, 0 -_0811CEFE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811CE94 - - thumb_func_start sub_811CF04 -sub_811CF04: @ 811CF04 - push {lr} - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - 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, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r1, 0xC1 - lsls r1, 6 - movs r0, 0 - bl SetGpuReg - pop {r0} - bx r0 - thumb_func_end sub_811CF04 - - thumb_func_start sub_811CF64 -sub_811CF64: @ 811CF64 - push {r4,lr} - bl sub_80A1A74 - ldr r0, =gUnknown_08DCBDB0 - movs r1, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_08597B14 - movs r1, 0x10 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_08597B34 - movs r1, 0x40 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_08597C1C - movs r1, 0xA0 - movs r2, 0x8 - bl gpu_pal_apply - ldr r4, =gUnknown_08597C24 - adds r0, r4, 0 - movs r1, 0xB0 - movs r2, 0xC - bl gpu_pal_apply - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0xC - bl gpu_pal_apply - adds r0, r4, 0 - movs r1, 0x30 - movs r2, 0xC - bl gpu_pal_apply - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811CF64 - - thumb_func_start sub_811CFCC -sub_811CFCC: @ 811CFCC - push {r4,r5,lr} - sub sp, 0x14 - bl sub_811BA88 - adds r5, r0, 0 - cmp r5, 0 - beq _0811D020 - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x90 - bl GetStringCenterAlignXOffset - adds r4, r0, 0 - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - movs r0, 0x2 - str r0, [sp, 0xC] - movs r0, 0x3 - str r0, [sp, 0x10] - movs r0, 0 - movs r1, 0x1 - adds r2, r5, 0 - adds r3, r4, 0 - bl sub_811D058 - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram -_0811D020: - add sp, 0x14 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_811CFCC - - thumb_func_start sub_811D028 -sub_811D028: @ 811D028 - push {r4-r6,lr} - sub sp, 0xC - ldr r4, [sp, 0x1C] - ldr r5, [sp, 0x20] - ldr r6, [sp, 0x24] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - 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] - str r6, [sp, 0x8] - bl Print - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_811D028 - - thumb_func_start sub_811D058 -sub_811D058: @ 811D058 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - mov r9, r3 - ldr r3, [sp, 0x30] - ldr r4, [sp, 0x34] - mov r8, r4 - ldr r7, [sp, 0x38] - mov r10, r7 - ldr r5, [sp, 0x3C] - ldr r6, [sp, 0x40] - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r4, r9 - lsls r4, 24 - lsrs r4, 24 - mov r9, r4 - lsls r3, 24 - lsrs r3, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - add r4, sp, 0xC - mov r7, r10 - strb r7, [r4] - strb r5, [r4, 0x1] - strb r6, [r4, 0x2] - str r4, [sp] - mov r4, r8 - lsls r4, 24 - asrs r4, 24 - str r4, [sp, 0x4] - str r2, [sp, 0x8] - mov r2, r9 - bl box_print - 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_811D058 - - thumb_func_start sub_811D0BC -sub_811D0BC: @ 811D0BC - push {lr} - sub sp, 0xC - movs r0, 0x20 - str r0, [sp] - movs r0, 0x14 - 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 - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0xE0 - bl sub_809882C - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0xE - bl sub_8098858 - movs r0, 0 - bl sub_811D104 - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0xC - pop {r0} - bx r0 - thumb_func_end sub_811D0BC - - thumb_func_start sub_811D104 -sub_811D104: @ 811D104 - push {lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0 - str r0, [sp, 0x10] - str r0, [sp, 0xC] - cmp r1, 0x9 - bhi _0811D1BC - lsls r0, r1, 2 - ldr r1, =_0811D124 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0811D124: - .4byte _0811D14C - .4byte _0811D16A - .4byte _0811D156 - .4byte _0811D160 - .4byte _0811D174 - .4byte _0811D180 - .4byte _0811D18C - .4byte _0811D19C - .4byte _0811D1A8 - .4byte _0811D1B4 -_0811D14C: - add r1, sp, 0x10 - add r0, sp, 0xC - bl sub_811BAD0 - b _0811D1BC -_0811D156: - add r1, sp, 0x10 - add r0, sp, 0xC - bl sub_811BB40 - b _0811D1BC -_0811D160: - add r1, sp, 0x10 - add r0, sp, 0xC - bl sub_811BB08 - b _0811D1BC -_0811D16A: - add r1, sp, 0x10 - add r0, sp, 0xC - bl sub_811BB88 - b _0811D1BC -_0811D174: - ldr r0, =gUnknown_085EC743 - str r0, [sp, 0xC] - b _0811D1BC - .pool -_0811D180: - ldr r0, =gUnknown_085EC752 - str r0, [sp, 0xC] - b _0811D1BC - .pool -_0811D18C: - ldr r0, =gUnknown_085EC4C9 - str r0, [sp, 0xC] - ldr r0, =gUnknown_085EC4E9 - b _0811D1BA - .pool -_0811D19C: - ldr r0, =gUnknown_085EC765 - str r0, [sp, 0xC] - b _0811D1BC - .pool -_0811D1A8: - ldr r0, =gUnknown_085EC520 - str r0, [sp, 0xC] - b _0811D1BC - .pool -_0811D1B4: - ldr r0, =gUnknown_085EC672 - str r0, [sp, 0xC] - ldr r0, =gUnknown_085EC688 -_0811D1BA: - str r0, [sp, 0x10] -_0811D1BC: - movs r0, 0x1 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, [sp, 0xC] - cmp r2, 0 - beq _0811D1E0 - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0 - bl sub_811D028 -_0811D1E0: - ldr r2, [sp, 0x10] - cmp r2, 0 - beq _0811D1FC - movs r0, 0x11 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0 - bl sub_811D028 -_0811D1FC: - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0x14 - pop {r0} - bx r0 - .pool - thumb_func_end sub_811D104 - - thumb_func_start sub_811D214 -sub_811D214: @ 811D214 - push {lr} - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gUnknown_08597C84 - movs r1, 0x1 - movs r2, 0xE - bl CreateYesNoMenu - pop {r0} - bx r0 - .pool - thumb_func_end sub_811D214 - - thumb_func_start sub_811D230 -sub_811D230: @ 811D230 - push {r4-r6,lr} - sub sp, 0x8 - bl sub_811BA68 - lsls r0, 24 - ldr r6, =0xffffff00 - ldr r4, [sp] - ands r4, r6 - movs r1, 0x3 - orrs r4, r1 - str r4, [sp] - ldr r1, =gUnknown_08597C30 - lsrs r0, 22 - adds r0, r1 - ldrb r3, [r0] - lsls r1, r3, 27 - lsrs r1, 19 - ldr r5, =0xffff00ff - adds r2, r5, 0 - ands r2, r4 - orrs r2, r1 - lsrs r3, 5 - lsls r3, 16 - ldr r1, =0xff00ffff - ands r2, r1 - orrs r2, r3 - str r2, [sp] - ldrb r3, [r0, 0x1] - lsls r3, 24 - ldr r1, =0x00ffffff - ands r1, r2 - orrs r1, r3 - str r1, [sp] - ldrb r1, [r0, 0x2] - ldr r0, [sp, 0x4] - ands r0, r6 - orrs r0, r1 - ands r0, r5 - movs r1, 0xB0 - lsls r1, 4 - orrs r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - movs r1, 0xD8 - lsls r1, 15 - orrs r0, r1 - str r0, [sp, 0x4] - mov r0, sp - bl AddWindow - ldr r1, =0x0203a11c - ldr r1, [r1] - strh r0, [r1, 0x2] - lsls r0, 24 - lsrs r0, 24 - bl PutWindowTilemap - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811D230 - - thumb_func_start sub_811D2C8 -sub_811D2C8: @ 811D2C8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - bl sub_811BA94 - adds r4, r0, 0 - bl sub_811BAAC - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - bl sub_811BAA0 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x14] - bl sub_811BA68 - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0 - mov r8, r0 - cmp r6, 0x7 - bne _0811D302 - movs r1, 0x1 - mov r8, r1 -_0811D302: - ldr r0, =0x0203a11c - ldr r0, [r0] - ldrb r0, [r0, 0x2] - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r7, 0 - ldr r0, [sp, 0x14] - cmp r7, r0 - bge _0811D402 -_0811D316: - add r0, sp, 0xC - ldr r1, =gUnknown_08597C8C - movs r2, 0x4 - bl memcpy - mov r1, r8 - cmp r1, 0 - beq _0811D32C - add r1, sp, 0xC - movs r0, 0x6 - strb r0, [r1, 0x2] -_0811D32C: - ldr r0, =0x0203a11c - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0xB - movs r0, 0xFF - strb r0, [r1, 0xB] - adds r0, r2, 0 - add r1, sp, 0xC - bl AppendString - adds r2, r0, 0 - movs r5, 0 - lsls r0, r7, 4 - mov r9, r0 - adds r1, r7, 0x1 - mov r10, r1 - b _0811D3CE - .pool -_0811D358: - ldrh r0, [r4] - ldr r1, =0x0000ffff - cmp r0, r1 - beq _0811D374 - adds r1, r0, 0 - adds r0, r2, 0 - bl CopyEasyChatWord - adds r2, r0, 0 - adds r4, 0x2 - b _0811D3A2 - .pool -_0811D374: - adds r4, 0x2 - mov r0, r8 - cmp r0, 0 - bne _0811D3A8 - adds r0, r2, 0 - movs r1, 0 - movs r2, 0x4 - bl WriteColorChangeControlCode - adds r2, r0, 0 - movs r1, 0xAE - movs r0, 0xB -_0811D38C: - strb r1, [r2] - adds r2, 0x1 - subs r0, 0x1 - cmp r0, 0 - bge _0811D38C - adds r0, r2, 0 - movs r1, 0 - movs r2, 0x2 - bl WriteColorChangeControlCode - adds r2, r0, 0 -_0811D3A2: - mov r1, r8 - cmp r1, 0 - beq _0811D3AE -_0811D3A8: - add r1, sp, 0xC - movs r0, 0x3 - strb r0, [r1, 0x2] -_0811D3AE: - adds r0, r2, 0 - add r1, sp, 0xC - bl AppendString - adds r2, r0, 0 - cmp r6, 0x2 - beq _0811D3C4 - cmp r6, 0x7 - beq _0811D3C4 - cmp r6, 0x8 - bne _0811D3CC -_0811D3C4: - cmp r5, 0 - bne _0811D3CC - cmp r7, 0x4 - beq _0811D3D4 -_0811D3CC: - adds r5, 0x1 -_0811D3CE: - ldr r0, [sp, 0x10] - cmp r5, r0 - blt _0811D358 -_0811D3D4: - movs r0, 0xFF - strb r0, [r2] - ldr r0, =0x0203a11c - ldr r2, [r0] - ldrb r0, [r2, 0x2] - adds r2, 0xB - mov r1, r9 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl sub_811D028 - mov r7, r10 - ldr r1, [sp, 0x14] - cmp r7, r1 - blt _0811D316 -_0811D402: - ldr r0, =0x0203a11c - ldr r0, [r0] - ldrb r0, [r0, 0x2] - movs r1, 0x3 - bl CopyWindowToVram - 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_811D2C8 - - thumb_func_start sub_811D424 -sub_811D424: @ 811D424 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r0 - bl sub_811BA68 - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0 - str r0, [sp] - ldr r2, =0x01000200 - mov r0, sp - mov r1, r8 - bl CpuFastSet - cmp r6, 0x2 - beq _0811D450 - cmp r6, 0x8 - bne _0811D4D4 -_0811D450: - ldr r0, =gUnknown_08597C30 - lsls r2, r6, 2 - adds r2, r0 - ldrb r1, [r2] - lsls r3, r1, 27 - lsrs r0, r3, 27 - ldrb r4, [r2, 0x1] - adds r5, r0, r4 - lsls r1, 24 - lsrs r0, r1, 29 - ldrb r2, [r2, 0x2] - adds r2, r0 - mov r12, r2 - adds r6, r0, 0 - cmp r6, r12 - blt _0811D472 - b _0811D5D6 -_0811D472: - mov r9, r3 -_0811D474: - mov r0, r9 - lsrs r3, r0, 27 - subs r7, r3, 0x1 - lsls r2, r6, 5 - adds r0, r2, r7 - lsls r0, 1 - add r0, r8 - ldr r4, =0x00001005 - adds r1, r4, 0 - strh r1, [r0] - adds r7, r3, 0 - adds r3, r2, 0 - adds r4, r6, 0x1 - cmp r7, r5 - bge _0811D4AE - movs r0, 0x80 - lsls r0, 5 - adds r2, r0, 0 - lsls r1, r7, 1 - lsls r0, r6, 6 - add r0, r8 - adds r0, r1, r0 - subs r7, r5, r7 -_0811D4A2: - strh r2, [r0] - adds r0, 0x2 - subs r7, 0x1 - cmp r7, 0 - bne _0811D4A2 - adds r7, r5, 0 -_0811D4AE: - adds r0, r3, r7 - lsls r0, 1 - add r0, r8 - ldr r2, =0x00001007 - adds r1, r2, 0 - strh r1, [r0] - adds r6, r4, 0 - cmp r6, r12 - blt _0811D474 - b _0811D5D6 - .pool -_0811D4D4: - ldr r4, =gUnknown_08597C30 - mov r10, r4 - lsls r6, 2 - mov r9, r6 - mov r3, r9 - add r3, r10 - ldrb r0, [r3] - lsls r2, r0, 24 - lsrs r1, r2, 29 - subs r6, r1, 0x1 - lsls r0, 27 - lsrs r4, r0, 27 - subs r7, r4, 0x1 - adds r0, r4, 0 - ldrb r1, [r3, 0x1] - adds r5, r0, r1 - lsrs r2, 29 - ldrb r3, [r3, 0x2] - adds r3, r2 - mov r12, r3 - lsls r0, r6, 5 - adds r0, r7 - lsls r0, 1 - add r0, r8 - ldr r2, =0x00001001 - adds r1, r2, 0 - strh r1, [r0] - adds r7, r4, 0 - cmp r7, r5 - bge _0811D52A - ldr r4, =0x00001002 - adds r2, r4, 0 - lsls r1, r7, 1 - lsls r0, r6, 6 - add r0, r8 - adds r1, r0 - subs r7, r5, r7 -_0811D51E: - strh r2, [r1] - adds r1, 0x2 - subs r7, 0x1 - cmp r7, 0 - bne _0811D51E - adds r7, r5, 0 -_0811D52A: - lsls r0, r6, 5 - adds r0, r7 - lsls r0, 1 - add r0, r8 - ldr r2, =0x00001003 - adds r1, r2, 0 - strh r1, [r0] - adds r6, 0x1 - cmp r6, r12 - bge _0811D590 - ldr r0, =gUnknown_08597C30 - add r0, r9 - ldrb r0, [r0] - lsls r3, r0, 27 -_0811D546: - lsrs r0, r3, 27 - subs r7, r0, 0x1 - lsls r1, r6, 5 - adds r1, r7 - lsls r1, 1 - add r1, r8 - ldr r4, =0x00001005 - adds r2, r4, 0 - strh r2, [r1] - adds r7, r0, 0 - adds r4, r6, 0x1 - cmp r7, r5 - bge _0811D57C - movs r0, 0x80 - lsls r0, 5 - adds r2, r0, 0 - lsls r1, r7, 1 - lsls r0, r6, 6 - add r0, r8 - adds r1, r0 - subs r7, r5, r7 -_0811D570: - strh r2, [r1] - adds r1, 0x2 - subs r7, 0x1 - cmp r7, 0 - bne _0811D570 - adds r7, r5, 0 -_0811D57C: - lsls r0, r6, 5 - adds r0, r7 - lsls r0, 1 - add r0, r8 - ldr r2, =0x00001007 - adds r1, r2, 0 - strh r1, [r0] - adds r6, r4, 0 - cmp r6, r12 - blt _0811D546 -_0811D590: - mov r0, r9 - add r0, r10 - ldrb r2, [r0] - lsls r2, 27 - lsrs r2, 27 - subs r7, r2, 0x1 - lsls r3, r6, 5 - adds r0, r3, r7 - lsls r0, 1 - add r0, r8 - ldr r4, =0x00001009 - adds r1, r4, 0 - strh r1, [r0] - adds r7, r2, 0 - cmp r7, r5 - bge _0811D5CA - ldr r0, =0x0000100a - adds r2, r0, 0 - lsls r1, r7, 1 - lsls r0, r6, 6 - add r0, r8 - adds r0, r1, r0 - subs r7, r5, r7 -_0811D5BE: - strh r2, [r0] - adds r0, 0x2 - subs r7, 0x1 - cmp r7, 0 - bne _0811D5BE - adds r7, r5, 0 -_0811D5CA: - adds r0, r3, r7 - lsls r0, 1 - add r0, r8 - ldr r2, =0x0000100b - adds r1, r2, 0 - strh r1, [r0] -_0811D5D6: - 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_811D424 - - thumb_func_start sub_811D60C -sub_811D60C: @ 811D60C - push {r4,lr} - sub sp, 0x8 - movs r0, 0x3 - bl GetBgTilemapBuffer - adds r4, r0, 0 - bl sub_811BA68 - lsls r0, 24 - ldr r1, =gUnknown_08597C30 - lsrs r0, 22 - adds r0, r1 - ldrb r1, [r0, 0x3] - cmp r1, 0x2 - beq _0811D63E - cmp r1, 0x2 - bgt _0811D638 - cmp r1, 0x1 - beq _0811D64C - b _0811D67C - .pool -_0811D638: - cmp r1, 0x3 - beq _0811D668 - b _0811D67C -_0811D63E: - movs r0, 0xA8 - lsls r0, 3 - adds r4, r0 - movs r0, 0x20 - str r0, [sp] - str r1, [sp, 0x4] - b _0811D65A -_0811D64C: - movs r0, 0xC0 - lsls r0, 3 - adds r4, r0 - movs r0, 0x20 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] -_0811D65A: - movs r0, 0x3 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0xB - bl CopyToBgTilemapBufferRect - b _0811D67C -_0811D668: - movs r0, 0x20 - str r0, [sp] - movs r0, 0x4 - str r0, [sp, 0x4] - movs r0, 0x3 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0xA - bl CopyToBgTilemapBufferRect -_0811D67C: - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_811D60C - - thumb_func_start sub_811D684 -sub_811D684: @ 811D684 - push {lr} - movs r0, 0x2 - bl PutWindowTilemap - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - pop {r0} - bx r0 - thumb_func_end sub_811D684 - - thumb_func_start sub_811D698 -sub_811D698: @ 811D698 - push {r4,lr} - adds r4, r0, 0 - bl sub_811DD84 - movs r0, 0x2 - movs r1, 0x11 - bl FillWindowPixelBuffer - cmp r4, 0x1 - beq _0811D6BC - cmp r4, 0x1 - bcc _0811D6B6 - cmp r4, 0x2 - beq _0811D6C2 - b _0811D6C6 -_0811D6B6: - bl sub_811D6F4 - b _0811D6C6 -_0811D6BC: - bl sub_811D758 - b _0811D6C6 -_0811D6C2: - bl sub_811D794 -_0811D6C6: - movs r0, 0x2 - movs r1, 0x2 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_811D698 - - thumb_func_start sub_811D6D4 -sub_811D6D4: @ 811D6D4 - push {lr} - bl sub_811BBB0 - lsls r0, 24 - cmp r0, 0 - bne _0811D6E8 - movs r0, 0 - bl sub_811D698 - b _0811D6EE -_0811D6E8: - movs r0, 0x1 - bl sub_811D698 -_0811D6EE: - pop {r0} - bx r0 - thumb_func_end sub_811D6D4 - - thumb_func_start sub_811D6F4 -sub_811D6F4: @ 811D6F4 - push {r4-r7,lr} - sub sp, 0xC - movs r5, 0 - movs r7, 0x61 -_0811D6FC: - movs r4, 0 - lsls r0, r7, 24 - lsrs r6, r0, 24 -_0811D702: - lsls r0, r5, 24 - lsrs r0, 24 - adds r5, 0x1 - bl sub_811F3B8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x16 - beq _0811D742 - bl sub_811F424 - adds r2, r0, 0 - movs r0, 0x54 - adds r3, r4, 0 - muls r3, r0 - adds r3, 0xA - lsls r3, 24 - lsrs r3, 24 - str r6, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - bl sub_811D028 - adds r4, 0x1 - cmp r4, 0x1 - ble _0811D702 - adds r7, 0x10 - b _0811D6FC -_0811D742: - bl sub_811BBBC - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_811DDAC - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_811D6F4 - - thumb_func_start sub_811D758 -sub_811D758: @ 811D758 - push {r4-r6,lr} - sub sp, 0xC - movs r5, 0 - movs r4, 0xC2 - lsls r4, 23 - ldr r6, =gUnknown_08597C90 -_0811D764: - ldm r6!, {r2} - lsrs r0, r4, 24 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r3, 0xA - bl sub_811D028 - movs r0, 0x80 - lsls r0, 21 - adds r4, r0 - adds r5, 0x1 - cmp r5, 0x3 - bls _0811D764 - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811D758 - - thumb_func_start sub_811D794 -sub_811D794: @ 811D794 - push {lr} - movs r0, 0 - movs r1, 0x4 - bl sub_811D864 - pop {r0} - bx r0 - thumb_func_end sub_811D794 - - thumb_func_start sub_811D7A4 -sub_811D7A4: @ 811D7A4 - push {r4,lr} - bl sub_811BBDC - adds r4, r0, 0 - adds r4, 0x3 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_811D950 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_811D864 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_811D7A4 - - thumb_func_start sub_811D7C8 -sub_811D7C8: @ 811D7C8 - push {r4,lr} - bl sub_811BBDC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_811D950 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_811D864 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_811D7C8 - - thumb_func_start sub_811D7EC -sub_811D7EC: @ 811D7EC - push {r4,r5,lr} - bl sub_811BBDC - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - adds r0, r5, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_811BBE8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bls _0811D80E - adds r4, r0, 0 -_0811D80E: - cmp r5, r4 - bcs _0811D828 - subs r4, r5 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_811D950 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_811D864 -_0811D828: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_811D7EC - - thumb_func_start sub_811D830 -sub_811D830: @ 811D830 - push {r4,r5,lr} - bl sub_811BBDC - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_811DE48 - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bcs _0811D85C - subs r4, r0, r5 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_811D950 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_811D864 -_0811D85C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_811D830 - - thumb_func_start sub_811D864 -sub_811D864: @ 811D864 - 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 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x14] - lsls r1, r0, 1 - mov r8, r1 - lsls r0, 4 - adds r1, r0, 0 - adds r1, 0x60 - movs r0, 0xFF - ands r1, r0 - adds r1, 0x1 - movs r0, 0 - b _0811D930 -_0811D88E: - movs r6, 0 - movs r2, 0x10 - adds r2, r1 - mov r9, r2 - adds r0, 0x1 - mov r10, r0 - lsls r0, r1, 24 - lsrs r7, r0, 24 -_0811D89E: - mov r1, r8 - lsls r0, r1, 16 - lsrs r0, 16 - movs r2, 0x1 - add r8, r2 - bl sub_811F578 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x0000ffff - cmp r4, r0 - beq _0811D926 - ldr r5, =0x0203a11c - ldr r0, [r5] - adds r0, 0xCC - adds r1, r4, 0 - movs r2, 0 - bl CopyEasyChatWordPadded - adds r0, r4, 0 - bl sub_811BF88 - adds r1, r0, 0 - cmp r1, 0 - bne _0811D8FC - ldr r2, [r5] - adds r2, 0xCC - movs r0, 0xD - adds r3, r6, 0 - muls r3, r0 - adds r3, 0x3 - lsls r3, 27 - lsrs r3, 24 - str r7, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - str r1, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - bl sub_811D028 - b _0811D926 - .pool -_0811D8FC: - ldr r2, [r5] - adds r2, 0xCC - movs r0, 0xD - adds r3, r6, 0 - muls r3, r0 - adds r3, 0x3 - lsls r3, 27 - lsrs r3, 24 - str r7, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x5 - str r0, [sp, 0xC] - movs r0, 0x3 - str r0, [sp, 0x10] - movs r0, 0x2 - movs r1, 0x1 - bl sub_811D058 -_0811D926: - adds r6, 0x1 - cmp r6, 0x1 - ble _0811D89E - mov r1, r9 - mov r0, r10 -_0811D930: - ldr r2, [sp, 0x14] - cmp r0, r2 - blt _0811D88E - movs r0, 0x2 - 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_811D864 - - thumb_func_start sub_811D950 -sub_811D950: @ 811D950 - push {r4,r5,lr} - sub sp, 0x8 - lsls r0, 24 - lsls r1, 24 - lsrs r0, 20 - adds r3, r0, 0 - adds r3, 0x60 - movs r0, 0xFF - ands r3, r0 - lsrs r0, r1, 20 - adds r1, r3, r0 - cmp r1, 0xFF - ble _0811D97C - ldr r0, =0xffffff00 - adds r4, r1, r0 - movs r0, 0x80 - lsls r0, 1 - subs r0, r3 - b _0811D97E - .pool -_0811D97C: - movs r4, 0 -_0811D97E: - movs r5, 0xE0 - str r5, [sp] - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x4] - movs r0, 0x2 - movs r1, 0x11 - movs r2, 0 - bl FillWindowPixelRect - cmp r4, 0 - beq _0811D9AA - str r5, [sp] - lsls r0, r4, 16 - lsrs r0, 16 - str r0, [sp, 0x4] - movs r0, 0x2 - movs r1, 0x11 - movs r2, 0 - movs r3, 0 - bl FillWindowPixelRect -_0811D9AA: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_811D950 - - thumb_func_start sub_811D9B4 -sub_811D9B4: @ 811D9B4 - push {lr} - movs r0, 0x2 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0x2 - movs r1, 0x2 - bl CopyWindowToVram - pop {r0} - bx r0 - thumb_func_end sub_811D9B4 - - thumb_func_start sub_811D9CC -sub_811D9CC: @ 811D9CC - push {lr} - ldr r1, =0x0203a11c - cmp r0, 0x6 - bhi _0811DA86 - lsls r0, 2 - ldr r1, =_0811D9E8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0811D9E8: - .4byte _0811DA04 - .4byte _0811DA18 - .4byte _0811DA28 - .4byte _0811DA3C - .4byte _0811DA50 - .4byte _0811DA64 - .4byte _0811DA78 -_0811DA04: - ldr r1, =0x0203a11c - ldr r2, [r1] - movs r0, 0 - strb r0, [r2, 0x6] - ldr r2, [r1] - movs r0, 0xA - b _0811DA84 - .pool -_0811DA18: - ldr r1, =0x0203a11c - ldr r2, [r1] - movs r3, 0 - movs r0, 0x9 - b _0811DA44 - .pool -_0811DA28: - ldr r1, =0x0203a11c - ldr r2, [r1] - movs r0, 0xB - strb r0, [r2, 0x6] - ldr r2, [r1] - movs r0, 0x11 - b _0811DA84 - .pool -_0811DA3C: - ldr r1, =0x0203a11c - ldr r2, [r1] - movs r3, 0 - movs r0, 0x11 -_0811DA44: - strb r0, [r2, 0x6] - ldr r0, [r1] - strb r3, [r0, 0x7] - b _0811DA86 - .pool -_0811DA50: - ldr r1, =0x0203a11c - ldr r2, [r1] - movs r0, 0x11 - strb r0, [r2, 0x6] - ldr r2, [r1] - movs r0, 0xA - b _0811DA84 - .pool -_0811DA64: - ldr r1, =0x0203a11c - ldr r2, [r1] - movs r0, 0x12 - strb r0, [r2, 0x6] - ldr r2, [r1] - movs r0, 0x16 - b _0811DA84 - .pool -_0811DA78: - ldr r1, =0x0203a11c - ldr r2, [r1] - movs r0, 0x16 - strb r0, [r2, 0x6] - ldr r2, [r1] - movs r0, 0x12 -_0811DA84: - strb r0, [r2, 0x7] -_0811DA86: - ldr r1, [r1] - ldrb r0, [r1, 0x6] - movs r3, 0x1 - negs r3, r3 - adds r2, r3, 0 - ldrb r3, [r1, 0x7] - cmp r0, r3 - bcs _0811DA98 - movs r2, 0x1 -_0811DA98: - strb r2, [r1, 0x8] - pop {r0} - bx r0 - .pool - thumb_func_end sub_811D9CC - - thumb_func_start sub_811DAA4 -sub_811DAA4: @ 811DAA4 - push {r4,lr} - ldr r4, =0x0203a11c - ldr r1, [r4] - ldrb r2, [r1, 0x6] - ldrb r0, [r1, 0x7] - cmp r2, r0 - beq _0811DAD4 - ldrb r0, [r1, 0x8] - adds r0, r2, r0 - strb r0, [r1, 0x6] - ldr r0, [r4] - ldrb r0, [r0, 0x6] - bl sub_811DADC - ldr r0, [r4] - ldrb r1, [r0, 0x6] - ldrb r0, [r0, 0x7] - eors r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - b _0811DAD6 - .pool -_0811DAD4: - movs r0, 0 -_0811DAD6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811DAA4 - - thumb_func_start sub_811DADC -sub_811DADC: @ 811DADC - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x1E - str r0, [sp] - movs r0, 0xA - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0xA - bl FillBgTilemapBufferRect_Palette0 - cmp r4, 0x16 - bls _0811DAFE - b _0811DC1A -_0811DAFE: - lsls r0, r4, 2 - ldr r1, =_0811DB0C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0811DB0C: - .4byte _0811DC1A - .4byte _0811DB68 - .4byte _0811DB70 - .4byte _0811DB78 - .4byte _0811DB80 - .4byte _0811DB88 - .4byte _0811DB90 - .4byte _0811DC00 - .4byte _0811DBF2 - .4byte _0811DBE4 - .4byte _0811DBD6 - .4byte _0811DB9E - .4byte _0811DBA6 - .4byte _0811DBAE - .4byte _0811DBB6 - .4byte _0811DBBE - .4byte _0811DBC6 - .4byte _0811DBCE - .4byte _0811DBD6 - .4byte _0811DBE4 - .4byte _0811DBF2 - .4byte _0811DC00 - .4byte _0811DC0E -_0811DB68: - movs r0, 0xB - movs r1, 0xE - movs r2, 0x3 - b _0811DB96 -_0811DB70: - movs r0, 0x9 - movs r1, 0xE - movs r2, 0x7 - b _0811DB96 -_0811DB78: - movs r0, 0x7 - movs r1, 0xE - movs r2, 0xB - b _0811DB96 -_0811DB80: - movs r0, 0x5 - movs r1, 0xE - movs r2, 0xF - b _0811DB96 -_0811DB88: - movs r0, 0x3 - movs r1, 0xE - movs r2, 0x13 - b _0811DB96 -_0811DB90: - movs r0, 0x1 - movs r1, 0xE - movs r2, 0x17 -_0811DB96: - movs r3, 0x2 - bl sub_811DC28 - b _0811DC1A -_0811DB9E: - movs r0, 0x1 - movs r1, 0xA - movs r2, 0x18 - b _0811DBDC -_0811DBA6: - movs r0, 0x1 - movs r1, 0xA - movs r2, 0x19 - b _0811DBDC -_0811DBAE: - movs r0, 0x1 - movs r1, 0xA - movs r2, 0x1A - b _0811DBDC -_0811DBB6: - movs r0, 0x1 - movs r1, 0xA - movs r2, 0x1B - b _0811DBDC -_0811DBBE: - movs r0, 0x1 - movs r1, 0xA - movs r2, 0x1C - b _0811DBDC -_0811DBC6: - movs r0, 0x1 - movs r1, 0xA - movs r2, 0x1D - b _0811DBDC -_0811DBCE: - movs r0, 0 - movs r1, 0xA - movs r2, 0x1E - b _0811DBDC -_0811DBD6: - movs r0, 0x1 - movs r1, 0xA - movs r2, 0x17 -_0811DBDC: - movs r3, 0xA - bl sub_811DC28 - b _0811DC1A -_0811DBE4: - movs r0, 0x1 - movs r1, 0xB - movs r2, 0x17 - movs r3, 0x8 - bl sub_811DC28 - b _0811DC1A -_0811DBF2: - movs r0, 0x1 - movs r1, 0xC - movs r2, 0x17 - movs r3, 0x6 - bl sub_811DC28 - b _0811DC1A -_0811DC00: - movs r0, 0x1 - movs r1, 0xD - movs r2, 0x17 - movs r3, 0x4 - bl sub_811DC28 - b _0811DC1A -_0811DC0E: - movs r0, 0x1 - movs r1, 0xE - movs r2, 0x17 - movs r3, 0x2 - bl sub_811DC28 -_0811DC1A: - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_811DADC - - thumb_func_start sub_811DC28 -sub_811DC28: @ 811DC28 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - mov r12, r0 - adds r7, r1, 0 - mov r9, r2 - mov r10, r3 - ldr r0, =0x0203a11c - ldr r0, [r0] - movs r1, 0xC0 - lsls r1, 2 - adds r6, r0, r1 - mov r0, r12 - add r0, r9 - subs r5, r0, 0x1 - adds r0, r7, r3 - subs r0, 0x1 - mov r8, r0 - mov r2, r12 - adds r3, r7, 0 - lsls r0, r3, 5 - adds r0, r2 - lsls r0, 1 - adds r0, r6 - ldr r4, =0x00004001 - adds r1, r4, 0 - strh r1, [r0] - adds r2, 0x1 - cmp r2, r5 - bge _0811DC84 - ldr r0, =0x00004002 - adds r4, r0, 0 - lsls r1, r2, 1 - lsls r0, r3, 6 - adds r0, r6 - adds r1, r0 - subs r2, r5, r2 -_0811DC78: - strh r4, [r1] - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bne _0811DC78 - adds r2, r5, 0 -_0811DC84: - lsls r0, r3, 5 - adds r0, r2 - lsls r0, 1 - adds r0, r6 - ldr r2, =0x00004003 - adds r1, r2, 0 - strh r1, [r0] - adds r3, 0x1 - mov r4, r12 - adds r4, 0x1 - adds r0, r7, 0x1 - str r0, [sp, 0x4] - mov r1, r9 - subs r1, 0x2 - str r1, [sp] - movs r2, 0x2 - negs r2, r2 - add r10, r2 - cmp r3, r8 - bge _0811DCF4 - lsls r7, r4, 1 - mov r9, r7 -_0811DCB0: - lsls r0, r3, 5 - add r0, r12 - lsls r0, 1 - adds r0, r6 - ldr r2, =0x00004005 - adds r1, r2, 0 - strh r1, [r0] - adds r2, r4, 0 - adds r7, r3, 0x1 - cmp r4, r5 - bge _0811DCE0 - movs r0, 0x80 - lsls r0, 7 - adds r1, r0, 0 - lsls r0, r3, 6 - adds r0, r6 - add r0, r9 - subs r2, r5, r4 -_0811DCD4: - strh r1, [r0] - adds r0, 0x2 - subs r2, 0x1 - cmp r2, 0 - bne _0811DCD4 - adds r2, r5, 0 -_0811DCE0: - lsls r0, r3, 5 - adds r0, r2 - lsls r0, 1 - adds r0, r6 - ldr r2, =0x00004007 - adds r1, r2, 0 - strh r1, [r0] - adds r3, r7, 0 - cmp r3, r8 - blt _0811DCB0 -_0811DCF4: - lsls r0, r3, 5 - mov r7, r12 - adds r1, r0, r7 - lsls r1, 1 - adds r1, r6 - ldr r7, =0x00004009 - adds r2, r7, 0 - strh r2, [r1] - adds r2, r4, 0 - mov r12, r0 - cmp r4, r5 - bge _0811DD26 - ldr r0, =0x0000400a - adds r7, r0, 0 - lsls r1, r4, 1 - lsls r0, r3, 6 - adds r0, r6 - adds r0, r1, r0 - subs r2, r5, r4 -_0811DD1A: - strh r7, [r0] - adds r0, 0x2 - subs r2, 0x1 - cmp r2, 0 - bne _0811DD1A - adds r2, r5, 0 -_0811DD26: - mov r1, r12 - adds r0, r1, r2 - lsls r0, 1 - adds r0, r6 - ldr r2, =0x0000400b - adds r1, r2, 0 - strh r1, [r0] - lsls r0, r4, 27 - lsrs r0, 24 - ldr r3, [sp, 0x4] - lsls r1, r3, 27 - lsrs r1, 24 - ldr r4, [sp] - lsls r2, r4, 27 - lsrs r2, 24 - mov r7, r10 - lsls r3, r7, 27 - lsrs r3, 24 - bl sub_811DE5C - 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_811DC28 - - thumb_func_start sub_811DD84 -sub_811DD84: @ 811DD84 - push {lr} - movs r1, 0x80 - lsls r1, 4 - movs r0, 0x2 - movs r2, 0 - bl ChangeBgY - ldr r0, =0x0203a11c - ldr r0, [r0] - ldr r1, =0x000002ce - adds r0, r1 - movs r1, 0 - strh r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end sub_811DD84 - - thumb_func_start sub_811DDAC -sub_811DDAC: @ 811DDAC - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r1, 24 - lsrs r5, r1, 24 - movs r0, 0x2 - bl GetBgY - adds r2, r0, 0 - ldr r0, =0x0203a11c - ldr r3, [r0] - ldr r0, =0x000002ce - adds r1, r3, r0 - ldrh r0, [r1] - adds r0, r4 - strh r0, [r1] - lsls r4, 20 - asrs r4, 16 - lsls r0, r4, 8 - adds r2, r0 - cmp r5, 0 - beq _0811DE00 - movs r1, 0xB4 - lsls r1, 2 - adds r0, r3, r1 - str r2, [r0] - movs r0, 0xB5 - lsls r0, 2 - adds r1, r3, r0 - lsls r0, r5, 8 - str r0, [r1] - cmp r4, 0 - bge _0811DE0A - negs r0, r0 - str r0, [r1] - b _0811DE0A - .pool -_0811DE00: - movs r0, 0x2 - adds r1, r2, 0 - movs r2, 0 - bl ChangeBgY -_0811DE0A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_811DDAC - - thumb_func_start sub_811DE10 -sub_811DE10: @ 811DE10 - push {lr} - movs r0, 0x2 - bl GetBgY - ldr r1, =0x0203a11c - ldr r2, [r1] - movs r3, 0xB4 - lsls r3, 2 - adds r1, r2, r3 - ldr r1, [r1] - cmp r0, r1 - beq _0811DE40 - movs r1, 0xB5 - lsls r1, 2 - adds r0, r2, r1 - ldr r1, [r0] - movs r0, 0x2 - movs r2, 0x1 - bl ChangeBgY - movs r0, 0x1 - b _0811DE42 - .pool -_0811DE40: - movs r0, 0 -_0811DE42: - pop {r1} - bx r1 - thumb_func_end sub_811DE10 - - thumb_func_start sub_811DE48 -sub_811DE48: @ 811DE48 - ldr r0, =0x0203a11c - ldr r0, [r0] - ldr r1, =0x000002ce - adds r0, r1 - ldrh r0, [r0] - bx lr - .pool - thumb_func_end sub_811DE48 - - thumb_func_start sub_811DE5C -sub_811DE5C: @ 811DE5C - push {r4,r5,lr} - 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, r0, 8 - adds r0, r2 - orrs r4, r0 - lsls r5, r1, 8 - adds r1, r3 - orrs r5, r1 - movs r0, 0x40 - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x44 - adds r1, r5, 0 - bl SetGpuReg - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_811DE5C - - thumb_func_start sub_811DE90 -sub_811DE90: @ 811DE90 - push {r4,r5,lr} - ldr r0, =gUnknown_08597CA0 - bl LoadObjectPics - ldr r0, =gUnknown_08597CC0 - bl LoadTaggedObjectPalettes - movs r5, 0 - ldr r4, =gUnknown_08597CE8 -_0811DEA2: - adds r0, r4, 0 - bl LoadCompressedObjectPic - adds r4, 0x8 - adds r5, 0x1 - cmp r5, 0x3 - bls _0811DEA2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811DE90 - - thumb_func_start sub_811DEC4 -sub_811DEC4: @ 811DEC4 - push {lr} - bl sub_811BA68 - lsls r0, 24 - ldr r1, =gUnknown_08597C30 - lsrs r0, 22 - adds r0, r1 - ldrb r2, [r0] - lsls r1, r2, 27 - lsrs r1, 8 - lsrs r2, 5 - lsls r2, 19 - ldr r0, =gUnknown_08597D18 - movs r3, 0xD0 - lsls r3, 12 - adds r1, r3 - asrs r1, 16 - movs r3, 0x80 - lsls r3, 12 - adds r2, r3 - asrs r2, 16 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0203a11c - ldr r2, [r1] - movs r1, 0xB6 - lsls r1, 2 - adds r2, r1 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - str r1, [r2] - movs r0, 0x1 - strh r0, [r1, 0x30] - pop {r0} - bx r0 - .pool - thumb_func_end sub_811DEC4 - - thumb_func_start sub_811DF28 -sub_811DF28: @ 811DF28 - push {lr} - adds r1, r0, 0 - movs r2, 0x30 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _0811DF56 - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _0811DF56 - movs r0, 0 - strh r0, [r1, 0x2E] - ldrh r0, [r1, 0x24] - adds r0, 0x1 - strh r0, [r1, 0x24] - lsls r0, 16 - cmp r0, 0 - ble _0811DF56 - ldr r0, =0x0000fffa - strh r0, [r1, 0x24] -_0811DF56: - pop {r0} - bx r0 - .pool - thumb_func_end sub_811DF28 - - thumb_func_start sub_811DF60 -sub_811DF60: @ 811DF60 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x0203a11c - ldr r2, [r2] - movs r3, 0xB6 - lsls r3, 2 - adds r2, r3 - ldr r3, [r2] - movs r4, 0 - strh r0, [r3, 0x20] - ldr r0, [r2] - strh r1, [r0, 0x22] - ldr r0, [r2] - strh r4, [r0, 0x24] - ldr r0, [r2] - strh r4, [r0, 0x2E] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811DF60 - - thumb_func_start sub_811DF90 -sub_811DF90: @ 811DF90 - ldr r0, =0x0203a11c - ldr r1, [r0] - movs r0, 0xB6 - lsls r0, 2 - adds r1, r0 - ldr r0, [r1] - movs r2, 0 - strh r2, [r0, 0x2E] - ldr r0, [r1] - strh r2, [r0, 0x30] - ldr r0, [r1] - strh r2, [r0, 0x24] - bx lr - .pool - thumb_func_end sub_811DF90 - - thumb_func_start sub_811DFB0 -sub_811DFB0: @ 811DFB0 - ldr r0, =0x0203a11c - ldr r0, [r0] - movs r1, 0xB6 - lsls r1, 2 - adds r0, r1 - ldr r1, [r0] - movs r0, 0x1 - strh r0, [r1, 0x30] - bx lr - .pool - thumb_func_end sub_811DFB0 - - thumb_func_start sub_811DFC8 -sub_811DFC8: @ 811DFC8 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r6, =gUnknown_08597D68 - adds r0, r6, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x3 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r5, =0x0203a11c - ldr r2, [r5] - movs r1, 0xB7 - lsls r1, 2 - mov r8, r1 - add r2, r8 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r4, =0x02020630 - adds r1, r4 - str r1, [r2] - movs r0, 0x20 - strh r0, [r1, 0x24] - adds r0, r6, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x3 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r2, [r5] - movs r1, 0xB8 - lsls r1, 2 - adds r3, r2, r1 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - str r1, [r3] - ldr r0, =0x0000ffe0 - strh r0, [r1, 0x24] - add r2, r8 - ldr r1, [r2] - adds r1, 0x3F - ldrb r0, [r1] - movs r2, 0x1 - orrs r0, r2 - strb r0, [r1] - bl sub_811E088 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811DFC8 - - thumb_func_start sub_811E050 -sub_811E050: @ 811E050 - push {r4-r6,lr} - ldr r5, =0x0203a11c - ldr r0, [r5] - movs r4, 0xB7 - lsls r4, 2 - adds r0, r4 - ldr r0, [r0] - bl RemoveObjectAndFreeTiles - ldr r0, [r5] - adds r4, r0, r4 - movs r6, 0 - str r6, [r4] - movs r4, 0xB8 - lsls r4, 2 - adds r0, r4 - ldr r0, [r0] - bl RemoveObjectAndFreeTiles - ldr r0, [r5] - adds r0, r4 - str r6, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811E050 - - thumb_func_start sub_811E088 -sub_811E088: @ 811E088 - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x0203a11c - ldr r1, [r0] - movs r2, 0xB7 - lsls r2, 2 - adds r0, r1, r2 - ldr r0, [r0] - cmp r0, 0 - beq _0811E0E4 - adds r2, 0x4 - adds r0, r1, r2 - ldr r0, [r0] - cmp r0, 0 - beq _0811E0E4 - mov r4, sp - adds r4, 0x1 - mov r0, sp - adds r1, r4, 0 - bl sub_811BB9C - bl sub_811BBB0 - lsls r0, 24 - cmp r0, 0 - bne _0811E0D4 - mov r0, sp - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - movs r1, 0 - ldrsb r1, [r4, r1] - bl sub_811E0EC - b _0811E0E4 - .pool -_0811E0D4: - mov r0, sp - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - movs r1, 0 - ldrsb r1, [r4, r1] - bl sub_811E1A4 -_0811E0E4: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_811E088 - - thumb_func_start sub_811E0EC -sub_811E0EC: @ 811E0EC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r1, 24 - lsrs r7, r1, 24 - lsls r0, 24 - asrs r5, r0, 24 - movs r0, 0x1 - negs r0, r0 - cmp r5, r0 - beq _0811E150 - ldr r0, =0x0203a11c - mov r8, r0 - ldr r0, [r0] - movs r4, 0xB7 - lsls r4, 2 - adds r0, r4 - ldr r0, [r0] - movs r1, 0 - bl StartObjectImageAnim - mov r2, r8 - ldr r1, [r2] - adds r4, r1, r4 - ldr r2, [r4] - movs r0, 0x54 - muls r5, r0 - adds r5, 0x3A - strh r5, [r2, 0x20] - ldr r0, [r4] - lsls r4, r7, 24 - asrs r4, 20 - adds r4, 0x60 - strh r4, [r0, 0x22] - movs r6, 0xB8 - lsls r6, 2 - adds r1, r6 - ldr r0, [r1] - movs r1, 0 - bl StartObjectImageAnim - mov r1, r8 - ldr r0, [r1] - adds r0, r6 - ldr r1, [r0] - strh r5, [r1, 0x20] - b _0811E192 - .pool -_0811E150: - ldr r6, =0x0203a11c - ldr r0, [r6] - movs r4, 0xB7 - lsls r4, 2 - adds r0, r4 - ldr r0, [r0] - movs r1, 0x1 - bl StartObjectImageAnim - ldr r1, [r6] - adds r4, r1, r4 - ldr r0, [r4] - movs r2, 0xD8 - mov r8, r2 - mov r2, r8 - strh r2, [r0, 0x20] - ldr r0, [r4] - lsls r4, r7, 24 - asrs r4, 20 - adds r4, 0x70 - strh r4, [r0, 0x22] - movs r5, 0xB8 - lsls r5, 2 - adds r1, r5 - ldr r0, [r1] - movs r1, 0x1 - bl StartObjectImageAnim - ldr r0, [r6] - adds r0, r5 - ldr r1, [r0] - mov r2, r8 - strh r2, [r1, 0x20] -_0811E192: - ldr r0, [r0] - strh r4, [r0, 0x22] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811E0EC - - thumb_func_start sub_811E1A4 -sub_811E1A4: @ 811E1A4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - lsrs r4, r0, 24 - asrs r2, r0, 24 - movs r0, 0x1 - negs r0, r0 - cmp r2, r0 - beq _0811E234 - lsls r0, r5, 24 - asrs r1, r0, 24 - lsls r0, r1, 4 - adds r0, 0x60 - mov r8, r0 - movs r7, 0x20 - cmp r2, 0x6 - bne _0811E1D6 - cmp r1, 0 - bne _0811E1D6 - movs r7, 0x9E - movs r6, 0x2 - b _0811E1EC -_0811E1D6: - ldr r3, =gUnknown_08597D08 - lsls r1, r4, 24 - lsrs r0, r1, 24 - movs r2, 0 - cmp r0, 0x6 - bhi _0811E1E4 - asrs r2, r1, 24 -_0811E1E4: - adds r0, r2, r3 - ldrb r0, [r0] - adds r7, r0 - movs r6, 0x3 -_0811E1EC: - ldr r5, =0x0203a11c - ldr r0, [r5] - movs r4, 0xB7 - lsls r4, 2 - adds r0, r4 - ldr r0, [r0] - adds r1, r6, 0 - bl StartObjectImageAnim - ldr r1, [r5] - adds r4, r1, r4 - ldr r0, [r4] - strh r7, [r0, 0x20] - ldr r0, [r4] - mov r2, r8 - strh r2, [r0, 0x22] - movs r4, 0xB8 - lsls r4, 2 - adds r1, r4 - ldr r0, [r1] - adds r1, r6, 0 - bl StartObjectImageAnim - ldr r0, [r5] - adds r0, r4 - ldr r1, [r0] - strh r7, [r1, 0x20] - ldr r0, [r0] - mov r1, r8 - strh r1, [r0, 0x22] - b _0811E27A - .pool -_0811E234: - ldr r6, =0x0203a11c - ldr r0, [r6] - movs r4, 0xB7 - lsls r4, 2 - adds r0, r4 - ldr r0, [r0] - movs r1, 0x1 - bl StartObjectImageAnim - ldr r1, [r6] - adds r4, r1, r4 - ldr r0, [r4] - movs r2, 0xD8 - mov r8, r2 - mov r2, r8 - strh r2, [r0, 0x20] - ldr r0, [r4] - lsls r4, r5, 24 - asrs r4, 20 - adds r4, 0x70 - strh r4, [r0, 0x22] - movs r5, 0xB8 - lsls r5, 2 - adds r1, r5 - ldr r0, [r1] - movs r1, 0x1 - bl StartObjectImageAnim - ldr r0, [r6] - adds r0, r5 - ldr r1, [r0] - mov r2, r8 - strh r2, [r1, 0x20] - ldr r0, [r0] - strh r4, [r0, 0x22] -_0811E27A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811E1A4 - - thumb_func_start sub_811E288 -sub_811E288: @ 811E288 - push {lr} - ldr r0, =gUnknown_08597D18 - movs r1, 0 - movs r2, 0 - movs r3, 0x4 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0203a11c - ldr r2, [r1] - movs r1, 0xB9 - lsls r1, 2 - adds r2, r1 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - str r1, [r2] - ldr r0, =sub_811E2DC - str r0, [r1, 0x1C] - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - movs r2, 0x8 - orrs r0, r2 - strb r0, [r1, 0x5] - bl sub_811E30C - pop {r0} - bx r0 - .pool - thumb_func_end sub_811E288 - - thumb_func_start sub_811E2DC -sub_811E2DC: @ 811E2DC - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _0811E302 - movs r0, 0 - strh r0, [r1, 0x2E] - ldrh r0, [r1, 0x24] - adds r0, 0x1 - strh r0, [r1, 0x24] - lsls r0, 16 - cmp r0, 0 - ble _0811E302 - ldr r0, =0x0000fffa - strh r0, [r1, 0x24] -_0811E302: - pop {r0} - bx r0 - .pool - thumb_func_end sub_811E2DC - - thumb_func_start sub_811E30C -sub_811E30C: @ 811E30C - push {r4,lr} - sub sp, 0x4 - mov r4, sp - adds r4, 0x1 - mov r0, sp - adds r1, r4, 0 - bl sub_811BBC8 - mov r0, sp - movs r1, 0 - ldrsb r1, [r0, r1] - movs r0, 0xD - muls r0, r1 - lsls r0, 27 - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r1, 28 - movs r2, 0xE0 - lsls r2, 21 - adds r0, r2 - lsrs r0, 24 - movs r2, 0xC0 - lsls r2, 23 - adds r1, r2 - lsrs r1, 24 - bl sub_811E34C - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_811E30C - - thumb_func_start sub_811E34C -sub_811E34C: @ 811E34C - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - ldr r0, =0x0203a11c - ldr r0, [r0] - movs r1, 0xB9 - lsls r1, 2 - adds r2, r0, r1 - ldr r0, [r2] - cmp r0, 0 - beq _0811E376 - movs r1, 0 - strh r3, [r0, 0x20] - ldr r0, [r2] - strh r4, [r0, 0x22] - ldr r0, [r2] - strh r1, [r0, 0x24] - ldr r0, [r2] - strh r1, [r0, 0x2E] -_0811E376: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811E34C - - thumb_func_start sub_811E380 -sub_811E380: @ 811E380 - push {r4,lr} - ldr r4, =0x0203a11c - ldr r0, [r4] - movs r1, 0xB9 - lsls r1, 2 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - beq _0811E3A2 - bl RemoveObjectAndFreeTiles - ldr r0, [r4] - movs r1, 0xB9 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - str r1, [r0] -_0811E3A2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811E380 - - thumb_func_start sub_811E3AC -sub_811E3AC: @ 811E3AC - push {r4-r6,lr} - ldr r0, =gUnknown_08597DF0 - movs r1, 0xD0 - movs r2, 0x80 - movs r3, 0x6 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r5, =0x0203a11c - ldr r2, [r5] - movs r1, 0xBA - lsls r1, 2 - adds r2, r1 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r4, =0x02020630 - adds r1, r4 - str r1, [r2] - movs r6, 0 - ldr r0, =0x0000ffc0 - strh r0, [r1, 0x24] - ldr r0, =gUnknown_08597DD0 - movs r1, 0xD0 - movs r2, 0x50 - movs r3, 0x5 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r2, [r5] - movs r1, 0xBB - lsls r1, 2 - adds r3, r2, r1 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - str r1, [r3] - strb r6, [r2, 0x9] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811E3AC - - thumb_func_start sub_811E418 -sub_811E418: @ 811E418 - push {r4,lr} - ldr r4, =0x0203a11c - ldr r2, [r4] - ldrb r3, [r2, 0x9] - cmp r3, 0 - beq _0811E430 - cmp r3, 0x1 - beq _0811E488 - movs r0, 0 - b _0811E4A6 - .pool -_0811E430: - movs r0, 0xBA - lsls r0, 2 - adds r2, r0 - ldr r1, [r2] - ldrh r0, [r1, 0x24] - adds r0, 0x8 - strh r0, [r1, 0x24] - ldr r2, [r2] - movs r1, 0x24 - ldrsh r0, [r2, r1] - cmp r0, 0 - blt _0811E4A4 - strh r3, [r2, 0x24] - bl sub_811BBB0 - lsls r0, 24 - cmp r0, 0 - bne _0811E466 - ldr r0, [r4] - movs r1, 0xBB - lsls r1, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x1 - bl StartObjectImageAnim - b _0811E476 -_0811E466: - ldr r0, [r4] - movs r1, 0xBB - lsls r1, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x2 - bl StartObjectImageAnim -_0811E476: - ldr r0, =0x0203a11c - ldr r1, [r0] - ldrb r0, [r1, 0x9] - adds r0, 0x1 - strb r0, [r1, 0x9] - b _0811E4A4 - .pool -_0811E488: - movs r1, 0xBB - lsls r1, 2 - adds r0, r2, r1 - ldr r0, [r0] - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0811E4A4 - movs r0, 0x2 - strb r0, [r2, 0x9] - movs r0, 0 - b _0811E4A6 -_0811E4A4: - movs r0, 0x1 -_0811E4A6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811E418 - - thumb_func_start sub_811E4AC -sub_811E4AC: @ 811E4AC - push {lr} - ldr r2, =0x0203a11c - ldr r1, [r2] - movs r0, 0 - strb r0, [r1, 0x9] - ldr r0, [r2] - movs r1, 0xBB - lsls r1, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x3 - bl StartObjectImageAnim - pop {r0} - bx r0 - .pool - thumb_func_end sub_811E4AC - - thumb_func_start sub_811E4D0 -sub_811E4D0: @ 811E4D0 - push {r4-r6,lr} - ldr r5, =0x0203a11c - ldr r3, [r5] - ldrb r0, [r3, 0x9] - cmp r0, 0 - beq _0811E4E8 - cmp r0, 0x1 - beq _0811E502 - movs r0, 0 - b _0811E554 - .pool -_0811E4E8: - movs r1, 0xBB - lsls r1, 2 - adds r0, r3, r1 - ldr r0, [r0] - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0811E552 - movs r0, 0x1 - strb r0, [r3, 0x9] - b _0811E552 -_0811E502: - movs r0, 0xBA - lsls r0, 2 - adds r2, r3, r0 - ldr r1, [r2] - ldrh r0, [r1, 0x24] - subs r0, 0x8 - movs r6, 0 - strh r0, [r1, 0x24] - ldr r0, [r2] - movs r2, 0x24 - ldrsh r1, [r0, r2] - movs r0, 0x40 - negs r0, r0 - cmp r1, r0 - bgt _0811E552 - movs r4, 0xBB - lsls r4, 2 - adds r0, r3, r4 - ldr r0, [r0] - bl RemoveObjectAndFreeTiles - ldr r0, [r5] - movs r1, 0xBA - lsls r1, 2 - adds r0, r1 - ldr r0, [r0] - bl RemoveObjectAndFreeTiles - ldr r1, [r5] - adds r4, r1, r4 - str r6, [r4] - movs r2, 0xBA - lsls r2, 2 - adds r0, r1, r2 - str r6, [r0] - ldrb r0, [r1, 0x9] - adds r0, 0x1 - strb r0, [r1, 0x9] - movs r0, 0 - b _0811E554 -_0811E552: - movs r0, 0x1 -_0811E554: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_811E4D0 - - thumb_func_start sub_811E55C -sub_811E55C: @ 811E55C - push {lr} - ldr r0, =0x0203a11c - ldr r0, [r0] - movs r1, 0xBB - lsls r1, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x4 - bl StartObjectImageAnim - pop {r0} - bx r0 - .pool - thumb_func_end sub_811E55C - - thumb_func_start sub_811E578 -sub_811E578: @ 811E578 - push {lr} - bl sub_811BBB0 - lsls r0, 24 - cmp r0, 0 - bne _0811E59C - ldr r0, =0x0203a11c - ldr r0, [r0] - movs r1, 0xBB - lsls r1, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x1 - bl StartObjectImageAnim - b _0811E5AE - .pool -_0811E59C: - ldr r0, =0x0203a11c - ldr r0, [r0] - movs r1, 0xBB - lsls r1, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x2 - bl StartObjectImageAnim -_0811E5AE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_811E578 - - thumb_func_start sub_811E5B8 -sub_811E5B8: @ 811E5B8 - ldr r0, =0x0203a11c - ldr r0, [r0] - movs r1, 0xBB - lsls r1, 2 - adds r0, r1 - ldr r0, [r0] - adds r0, 0x3F - ldrb r1, [r0] - lsrs r1, 4 - movs r0, 0x1 - bics r0, r1 - bx lr - .pool - thumb_func_end sub_811E5B8 - - thumb_func_start sub_811E5D4 -sub_811E5D4: @ 811E5D4 - push {r4,lr} - ldr r4, =gUnknown_08597E48 - adds r0, r4, 0 - movs r1, 0x60 - movs r2, 0x50 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _0811E602 - ldr r0, =0x0203a11c - ldr r2, [r0] - movs r0, 0xBC - lsls r0, 2 - adds r2, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - str r0, [r2] -_0811E602: - adds r0, r4, 0 - movs r1, 0x60 - movs r2, 0x9C - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _0811E636 - ldr r0, =0x0203a11c - ldr r2, [r0] - movs r0, 0xBD - lsls r0, 2 - adds r2, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - str r0, [r2] - adds r0, 0x3F - ldrb r1, [r0] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0] -_0811E636: - bl sub_811E6B0 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811E5D4 - - thumb_func_start sub_811E64C -sub_811E64C: @ 811E64C - push {r4-r6,lr} - bl sub_811BBF8 - ldr r6, =0x0203a11c - ldr r1, [r6] - movs r2, 0xBC - lsls r2, 2 - adds r1, r2 - ldr r1, [r1] - movs r2, 0 - cmp r0, 0 - bne _0811E666 - movs r2, 0x1 -_0811E666: - adds r3, r1, 0 - adds r3, 0x3E - movs r4, 0x1 - lsls r2, 2 - ldrb r1, [r3] - movs r5, 0x5 - negs r5, r5 - adds r0, r5, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r3] - bl sub_811BC2C - ldr r1, [r6] - movs r2, 0xBD - lsls r2, 2 - adds r1, r2 - ldr r1, [r1] - movs r2, 0 - cmp r0, 0 - bne _0811E692 - movs r2, 0x1 -_0811E692: - adds r3, r1, 0 - adds r3, 0x3E - adds r1, r4, 0 - ands r1, r2 - lsls r1, 2 - ldrb r2, [r3] - adds r0, r5, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811E64C - - thumb_func_start sub_811E6B0 -sub_811E6B0: @ 811E6B0 - ldr r3, =0x0203a11c - ldr r0, [r3] - movs r1, 0xBC - lsls r1, 2 - adds r0, r1 - ldr r1, [r0] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - ldr r0, [r3] - movs r1, 0xBD - lsls r1, 2 - adds r0, r1 - ldr r1, [r0] - adds r1, 0x3E - ldrb r0, [r1] - orrs r0, r2 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_811E6B0 - - thumb_func_start sub_811E6E0 -sub_811E6E0: @ 811E6E0 - push {lr} - cmp r0, 0 - bne _0811E6FC - ldr r0, =0x0203a11c - ldr r2, [r0] - movs r1, 0xBC - lsls r1, 2 - adds r0, r2, r1 - ldr r0, [r0] - movs r1, 0x60 - b _0811E70A - .pool -_0811E6FC: - ldr r0, =0x0203a11c - ldr r2, [r0] - movs r1, 0xBC - lsls r1, 2 - adds r0, r2, r1 - ldr r0, [r0] - movs r1, 0x78 -_0811E70A: - strh r1, [r0, 0x20] - movs r3, 0xBD - lsls r3, 2 - adds r0, r2, r3 - ldr r0, [r0] - strh r1, [r0, 0x20] - pop {r0} - bx r0 - .pool - thumb_func_end sub_811E6E0 - - thumb_func_start sub_811E720 -sub_811E720: @ 811E720 - push {r4,lr} - ldr r4, =gUnknown_08597E30 - adds r0, r4, 0 - movs r1, 0xDC - movs r2, 0x54 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _0811E74E - ldr r0, =0x0203a11c - ldr r2, [r0] - movs r0, 0xBE - lsls r0, 2 - adds r2, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - str r0, [r2] -_0811E74E: - adds r0, r4, 0 - movs r1, 0xDC - movs r2, 0x9C - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _0811E77E - ldr r0, =0x0203a11c - ldr r2, [r0] - movs r0, 0xBF - lsls r0, 2 - adds r2, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - str r0, [r2] - movs r1, 0x1 - bl StartObjectImageAnim -_0811E77E: - bl sub_811E7F8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811E720 - - thumb_func_start sub_811E794 -sub_811E794: @ 811E794 - push {r4-r6,lr} - bl sub_811BBF8 - ldr r6, =0x0203a11c - ldr r1, [r6] - movs r2, 0xBE - lsls r2, 2 - adds r1, r2 - ldr r1, [r1] - movs r2, 0 - cmp r0, 0 - bne _0811E7AE - movs r2, 0x1 -_0811E7AE: - adds r3, r1, 0 - adds r3, 0x3E - movs r4, 0x1 - lsls r2, 2 - ldrb r1, [r3] - movs r5, 0x5 - negs r5, r5 - adds r0, r5, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r3] - bl sub_811BC2C - ldr r1, [r6] - movs r2, 0xBF - lsls r2, 2 - adds r1, r2 - ldr r1, [r1] - movs r2, 0 - cmp r0, 0 - bne _0811E7DA - movs r2, 0x1 -_0811E7DA: - adds r3, r1, 0 - adds r3, 0x3E - adds r1, r4, 0 - ands r1, r2 - lsls r1, 2 - ldrb r2, [r3] - adds r0, r5, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811E794 - - thumb_func_start sub_811E7F8 -sub_811E7F8: @ 811E7F8 - ldr r3, =0x0203a11c - ldr r0, [r3] - movs r1, 0xBE - lsls r1, 2 - adds r0, r1 - ldr r1, [r0] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - ldr r0, [r3] - movs r1, 0xBF - lsls r1, 2 - adds r0, r1 - ldr r1, [r0] - adds r1, 0x3E - ldrb r0, [r1] - orrs r0, r2 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_811E7F8 - - thumb_func_start sub_811E828 -sub_811E828: @ 811E828 - push {r4,r5,lr} - sub sp, 0x4 - bl sub_811BCBC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0811E84C - cmp r0, 0x1 - bgt _0811E842 - cmp r0, 0 - beq _0811E848 - b _0811E8D0 -_0811E842: - cmp r0, 0x2 - beq _0811E850 - b _0811E8D0 -_0811E848: - movs r4, 0x43 - b _0811E852 -_0811E84C: - movs r4, 0x44 - b _0811E852 -_0811E850: - movs r4, 0x7 -_0811E852: - bl sub_811BA68 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bne _0811E8D0 - adds r0, r4, 0 - ldr r5, =DummyObjectCallback - movs r4, 0 - str r4, [sp] - adds r1, r5, 0 - movs r2, 0x4C - movs r3, 0x28 - bl AddPseudoFieldObject - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - beq _0811E892 - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - strb r1, [r0, 0x5] - movs r1, 0x2 - bl StartObjectImageAnim -_0811E892: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - movs r1, 0x69 - cmp r0, 0 - bne _0811E8A0 - movs r1, 0x64 -_0811E8A0: - str r4, [sp] - adds r0, r1, 0 - adds r1, r5, 0 - movs r2, 0x34 - movs r3, 0x28 - bl AddPseudoFieldObject - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - beq _0811E8D0 - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - strb r1, [r0, 0x5] - movs r1, 0x3 - bl StartObjectImageAnim -_0811E8D0: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811E828 - - thumb_func_start sub_811E8E4 -sub_811E8E4: @ 811E8E4 - push {lr} - bl sub_811BA68 - lsls r0, 24 - ldr r1, =gUnknown_08597C30 - lsrs r0, 22 - adds r0, r1 - ldrb r0, [r0, 0x3] - cmp r0, 0x1 - beq _0811E90E - cmp r0, 0x1 - bgt _0811E908 - cmp r0, 0 - beq _0811E916 - b _0811E91A - .pool -_0811E908: - cmp r0, 0x2 - beq _0811E912 - b _0811E91A -_0811E90E: - movs r0, 0x1 - b _0811E91C -_0811E912: - movs r0, 0x2 - b _0811E91C -_0811E916: - movs r0, 0 - b _0811E91C -_0811E91A: - movs r0, 0x3 -_0811E91C: - pop {r1} - bx r1 - thumb_func_end sub_811E8E4 - - thumb_func_start sub_811E920 -sub_811E920: @ 811E920 - push {r4,lr} - adds r4, r0, 0 - bl sub_811E8E4 - adds r1, r0, 0 - cmp r1, 0x2 - ble _0811E932 - movs r0, 0 - b _0811E93E -_0811E932: - ldr r0, =gUnknown_08597E60 - lsls r1, 2 - adds r1, r4, r1 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x4 -_0811E93E: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_811E920 - - thumb_func_start sub_811E948 -sub_811E948: @ 811E948 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - bl sub_811E8E4 - mov r8, r0 - cmp r0, 0x3 - beq _0811E9FA - ldr r3, =0xffffff00 - ldr r0, [sp, 0xC] - ands r0, r3 - movs r1, 0x3 - orrs r0, r1 - ldr r2, =0xffff00ff - ands r0, r2 - adds r1, 0xFD - orrs r0, r1 - ldr r1, =0xff00ffff - ands r0, r1 - movs r1, 0xB0 - lsls r1, 12 - orrs r0, r1 - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0xE0 - lsls r1, 21 - orrs r0, r1 - str r0, [sp, 0xC] - ldr r0, [sp, 0x10] - ands r0, r3 - movs r1, 0x2 - orrs r0, r1 - ands r0, r2 - movs r1, 0xB0 - lsls r1, 4 - orrs r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - movs r1, 0xD0 - lsls r1, 14 - orrs r0, r1 - str r0, [sp, 0x10] - add r0, sp, 0xC - bl AddWindow - lsls r0, 16 - lsrs r7, r0, 16 - lsls r4, r7, 24 - lsrs r0, r4, 24 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r6, 0 - mov r0, r8 - lsls r1, r0, 4 - ldr r0, =gUnknown_08597E6C - adds r5, r1, r0 - ldr r1, =gUnknown_08597E60 - mov r10, r1 - mov r9, r4 -_0811E9C6: - ldr r2, [r5] - lsls r4, r7, 24 - cmp r2, 0 - beq _0811E9EC - mov r1, r8 - lsls r0, r1, 2 - adds r0, r6, r0 - add r0, r10 - ldrb r3, [r0] - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - mov r1, r9 - lsrs r0, r1, 24 - movs r1, 0x1 - bl sub_811D028 -_0811E9EC: - adds r5, 0x4 - adds r6, 0x1 - cmp r6, 0x3 - ble _0811E9C6 - lsrs r0, r4, 24 - bl PutWindowTilemap -_0811E9FA: - 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_811E948 - - thumb_func_start sub_811EA28 -sub_811EA28: @ 811EA28 - push {lr} - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x14 - beq _0811EA4E - cmp r0, 0x14 - bgt _0811EA48 - cmp r0, 0x11 - blt _0811EA66 - ldr r0, =0x00000864 - bl FlagGet - b _0811EA60 - .pool -_0811EA48: - cmp r1, 0x15 - beq _0811EA5C - b _0811EA66 -_0811EA4E: - ldr r0, =0x00000866 - bl FlagGet - b _0811EA60 - .pool -_0811EA5C: - bl sub_811F0F8 -_0811EA60: - lsls r0, 24 - lsrs r0, 24 - b _0811EA68 -_0811EA66: - movs r0, 0x1 -_0811EA68: - pop {r1} - bx r1 - thumb_func_end sub_811EA28 - - thumb_func_start start_menu_is_selected_item_valid -start_menu_is_selected_item_valid: @ 811EA6C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - cmp r0, 0 - bne _0811EA84 - movs r0, 0 - bl pokedex_count - lsls r0, 16 - lsrs r0, 16 - b _0811EA9A -_0811EA84: - bl sub_811EA28 - lsls r0, 24 - cmp r0, 0 - bne _0811EA92 - movs r0, 0 - b _0811EA9A -_0811EA92: - ldr r0, =gEasyChatGroups - lsls r1, r4, 3 - adds r1, r0 - ldrh r0, [r1, 0x6] -_0811EA9A: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end start_menu_is_selected_item_valid - - thumb_func_start sub_811EAA4 -sub_811EAA4: @ 811EAA4 - push {r4,r5,lr} - lsls r2, r0, 16 - lsrs r1, r2, 16 - ldr r0, =0x0000ffff - cmp r1, r0 - beq _0811EB04 - lsrs r3, r2, 25 - ldr r5, =0x000001ff - ands r5, r1 - cmp r3, 0x15 - bhi _0811EB08 - ldr r0, =gEasyChatGroups - lsls r2, r3, 3 - adds r1, r2, r0 - ldrh r4, [r1, 0x4] - cmp r3, 0x13 - bgt _0811EADC - cmp r3, 0x12 - bge _0811EAE0 - cmp r3, 0 - beq _0811EAE0 - b _0811EB00 - .pool -_0811EADC: - cmp r3, 0x15 - bne _0811EB00 -_0811EAE0: - adds r0, r2, r0 - ldr r2, [r0] - movs r1, 0 - cmp r1, r4 - bcs _0811EB08 -_0811EAEA: - lsls r0, r1, 1 - adds r0, r2 - ldrh r0, [r0] - cmp r5, r0 - beq _0811EB04 - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r4 - bcc _0811EAEA - b _0811EB08 -_0811EB00: - cmp r5, r4 - bcs _0811EB08 -_0811EB04: - movs r0, 0 - b _0811EB0A -_0811EB08: - movs r0, 0x1 -_0811EB0A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_811EAA4 - - thumb_func_start sub_811EB10 -sub_811EB10: @ 811EB10 - push {lr} - lsls r0, 16 - lsrs r2, r0, 25 - lsls r0, 7 - lsrs r3, r0, 23 - cmp r2, 0x15 - bhi _0811EB5C - cmp r2, 0x13 - bgt _0811EB2C - cmp r2, 0x12 - bge _0811EB3C - cmp r2, 0 - beq _0811EB30 - b _0811EB48 -_0811EB2C: - cmp r2, 0x15 - bne _0811EB48 -_0811EB30: - ldr r0, =gUnknown_085F5490 - ldrh r0, [r0] - b _0811EB50 - .pool -_0811EB3C: - ldr r0, =gUnknown_085FA1D4 - ldrh r0, [r0] - b _0811EB50 - .pool -_0811EB48: - ldr r1, =gEasyChatGroups - lsls r0, r2, 3 - adds r0, r1 - ldrh r0, [r0, 0x4] -_0811EB50: - cmp r0, r3 - bls _0811EB5C - movs r0, 0 - b _0811EB5E - .pool -_0811EB5C: - movs r0, 0x1 -_0811EB5E: - pop {r1} - bx r1 - thumb_func_end sub_811EB10 - - thumb_func_start GetEasyChatWord -@ char *GetEasyChatWord(u8 groupId, u16 wordId) -GetEasyChatWord: @ 811EB64 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r2, r1, 16 - cmp r0, 0x13 - bgt _0811EB7C - cmp r0, 0x12 - bge _0811EB90 - cmp r0, 0 - beq _0811EB80 - b _0811EBA0 -_0811EB7C: - cmp r0, 0x15 - bne _0811EBA0 -_0811EB80: - movs r0, 0xB - muls r0, r2 - ldr r1, =gSpeciesNames - adds r0, r1 - b _0811EBB2 - .pool -_0811EB90: - movs r0, 0xD - muls r0, r2 - ldr r1, =gMoveNames - adds r0, r1 - b _0811EBB2 - .pool -_0811EBA0: - ldr r1, =gEasyChatGroups - lsls r0, 3 - adds r0, r1 - ldr r1, [r0] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] -_0811EBB2: - pop {r1} - bx r1 - .pool - thumb_func_end GetEasyChatWord - - thumb_func_start CopyEasyChatWord -@ char *CopyEasyChatWord(char *dest, u16 groupIdWordIdPair) -CopyEasyChatWord: @ 811EBBC - push {r4-r6,lr} - adds r5, r0, 0 - lsls r6, r1, 16 - lsrs r0, r6, 16 - adds r4, r0, 0 - bl sub_811EAA4 - lsls r0, 24 - cmp r0, 0 - beq _0811EBD8 - ldr r1, =gUnknown_085EEA42 - b _0811EBEA - .pool -_0811EBD8: - ldr r0, =0x0000ffff - cmp r4, r0 - beq _0811EBFC - ldr r1, =0x000001ff - ands r1, r4 - lsrs r0, r6, 25 - bl GetEasyChatWord - adds r1, r0, 0 -_0811EBEA: - adds r0, r5, 0 - bl CopyString - b _0811EC02 - .pool -_0811EBFC: - movs r0, 0xFF - strb r0, [r5] - adds r0, r5, 0 -_0811EC02: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end CopyEasyChatWord - - thumb_func_start ConvertEasyChatWordsToString -ConvertEasyChatWordsToString: @ 811EC08 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - lsls r2, 16 - lsls r3, 16 - lsrs r3, 16 - mov r9, r3 - ldr r0, =0xffff0000 - adds r2, r0 - lsrs r7, r2, 16 - movs r0, 0 - cmp r0, r9 - bcs _0811EC78 -_0811EC2A: - movs r6, 0 - adds r0, 0x1 - mov r8, r0 - cmp r6, r7 - bcs _0811EC5C - ldr r2, =0x0000ffff -_0811EC36: - ldrh r1, [r5] - adds r0, r4, 0 - str r2, [sp] - bl CopyEasyChatWord - adds r4, r0, 0 - ldrh r0, [r5] - ldr r2, [sp] - cmp r0, r2 - beq _0811EC50 - movs r0, 0 - strb r0, [r4] - adds r4, 0x1 -_0811EC50: - adds r5, 0x2 - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, r7 - bcc _0811EC36 -_0811EC5C: - ldrh r1, [r5] - adds r5, 0x2 - adds r0, r4, 0 - bl CopyEasyChatWord - adds r4, r0, 0 - movs r0, 0xFE - strb r0, [r4] - adds r4, 0x1 - mov r1, r8 - lsls r0, r1, 16 - lsrs r0, 16 - cmp r0, r9 - bcc _0811EC2A -_0811EC78: - subs r4, 0x1 - movs r0, 0xFF - strb r0, [r4] - adds r0, r4, 0 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end ConvertEasyChatWordsToString - - thumb_func_start sub_811EC98 -sub_811EC98: @ 811EC98 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - adds r4, r0, 0 - adds r5, r1, 0 - lsls r2, 16 - lsrs r2, 16 - mov r8, r2 - lsls r3, 16 - lsrs r3, 16 - str r3, [sp] - mov r7, r8 - movs r0, 0 - str r0, [sp, 0x4] - subs r0, r7, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - movs r0, 0 - cmp r0, r3 - bcs _0811ED62 -_0811ECC8: - adds r3, r5, 0 - movs r2, 0 - movs r1, 0 - adds r0, 0x1 - mov r10, r0 - cmp r2, r7 - bcs _0811ECEE - ldr r6, =0x0000ffff -_0811ECD8: - lsls r0, r1, 1 - adds r0, r3 - ldrh r0, [r0] - cmp r0, r6 - beq _0811ECE4 - movs r2, 0x1 -_0811ECE4: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r7 - bcc _0811ECD8 -_0811ECEE: - cmp r2, 0 - bne _0811ECFC - lsls r0, r7, 1 - adds r5, r0 - b _0811ED56 - .pool -_0811ECFC: - movs r6, 0 - ldr r1, [sp, 0x4] - adds r1, 0x1 - mov r9, r1 - cmp r6, r8 - bcs _0811ED30 - ldr r2, =0x0000ffff -_0811ED0A: - ldrh r1, [r5] - adds r0, r4, 0 - str r2, [sp, 0x8] - bl CopyEasyChatWord - adds r4, r0, 0 - ldrh r0, [r5] - ldr r2, [sp, 0x8] - cmp r0, r2 - beq _0811ED24 - movs r0, 0 - strb r0, [r4] - adds r4, 0x1 -_0811ED24: - adds r5, 0x2 - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, r8 - bcc _0811ED0A -_0811ED30: - ldrh r1, [r5] - adds r5, 0x2 - adds r0, r4, 0 - bl CopyEasyChatWord - adds r4, r0, 0 - ldr r0, [sp, 0x4] - cmp r0, 0 - bne _0811ED4C - movs r0, 0xFE - b _0811ED4E - .pool -_0811ED4C: - movs r0, 0xFA -_0811ED4E: - strb r0, [r4] - adds r4, 0x1 - mov r1, r9 - str r1, [sp, 0x4] -_0811ED56: - mov r1, r10 - lsls r0, r1, 16 - lsrs r0, 16 - ldr r1, [sp] - cmp r0, r1 - bcc _0811ECC8 -_0811ED62: - subs r4, 0x1 - movs r0, 0xFF - strb r0, [r4] - adds r0, r4, 0 - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_811EC98 - - thumb_func_start sub_811ED7C -sub_811ED7C: @ 811ED7C - push {r4,r5,lr} - lsls r5, r0, 16 - lsrs r0, r5, 16 - adds r4, r0, 0 - ldr r0, =0x0000ffff - cmp r4, r0 - bne _0811ED94 - movs r0, 0 - b _0811EDBA - .pool -_0811ED94: - adds r0, r4, 0 - bl sub_811EAA4 - lsls r0, 24 - cmp r0, 0 - bne _0811EDB0 - ldr r1, =0x000001ff - ands r1, r4 - lsrs r0, r5, 25 - bl GetEasyChatWord - b _0811EDB2 - .pool -_0811EDB0: - ldr r0, =gUnknown_085EEA42 -_0811EDB2: - bl GetStringLength - lsls r0, 16 - lsrs r0, 16 -_0811EDBA: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_811ED7C - - thumb_func_start sub_811EDC4 -sub_811EDC4: @ 811EDC4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r6, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - lsls r3, 16 - lsrs r3, 16 - mov r10, r3 - movs r7, 0 - cmp r7, r8 - bcs _0811EE26 - subs r0, r1, 0x1 - lsls r0, 16 - mov r9, r0 -_0811EDEE: - mov r0, r9 - lsrs r4, r0, 16 - movs r5, 0 - cmp r5, r1 - bcs _0811EE14 -_0811EDF8: - ldrh r0, [r6] - adds r6, 0x2 - str r1, [sp] - bl sub_811ED7C - adds r0, r4, r0 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, [sp] - cmp r5, r1 - bcc _0811EDF8 -_0811EE14: - cmp r4, r10 - bls _0811EE1C - movs r0, 0x1 - b _0811EE28 -_0811EE1C: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, r8 - bcc _0811EDEE -_0811EE26: - movs r0, 0 -_0811EE28: - 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_811EDC4 - - thumb_func_start sub_811EE38 -sub_811EE38: @ 811EE38 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - bl GenerateRandomNumber - ldr r2, =gEasyChatGroups - lsls r1, r4, 3 - adds r1, r2 - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r1, 0x4] - bl __umodsi3 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r4, 0 - beq _0811EE66 - cmp r4, 0x15 - beq _0811EE66 - cmp r4, 0x12 - beq _0811EE66 - cmp r4, 0x13 - bne _0811EE74 -_0811EE66: - ldr r1, =gEasyChatGroups - lsls r0, r4, 3 - adds r0, r1 - ldr r1, [r0] - lsls r0, r2, 1 - adds r0, r1 - ldrh r2, [r0] -_0811EE74: - movs r0, 0x7F - ands r0, r4 - lsls r0, 9 - ldr r1, =0x000001ff - ands r2, r1 - orrs r0, r2 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_811EE38 - - thumb_func_start sub_811EE90 -sub_811EE90: @ 811EE90 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - adds r4, r0, 0 - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_811EA28 - lsls r0, 24 - cmp r0, 0 - bne _0811EEB0 - ldr r0, =0x0000ffff - b _0811EEC4 - .pool -_0811EEB0: - cmp r4, 0 - beq _0811EEBC - adds r0, r4, 0 - bl sub_811EE38 - b _0811EEC0 -_0811EEBC: - bl sub_811F108 -_0811EEC0: - lsls r0, 16 - lsrs r0, 16 -_0811EEC4: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811EE90 - - thumb_func_start sub_811EECC -sub_811EECC: @ 811EECC - push {r4,r5,lr} - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0x1 - beq _0811EF04 - cmp r0, 0x1 - bgt _0811EEE4 - cmp r0, 0 - beq _0811EEEE - b _0811EF58 - .pool -_0811EEE4: - cmp r0, 0x2 - beq _0811EF2C - cmp r0, 0x3 - beq _0811EF3C - b _0811EF58 -_0811EEEE: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002bb0 - adds r5, r0, r1 - movs r2, 0x2 - b _0811EF46 - .pool -_0811EF04: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002bbc - adds r5, r0, r1 - adds r0, r5, 0 - movs r1, 0x3 - movs r2, 0x2 - movs r3, 0x12 - bl sub_811EDC4 - lsls r0, 24 - cmp r0, 0 - beq _0811EF44 - movs r2, 0x2 - movs r3, 0x3 - b _0811EF48 - .pool -_0811EF2C: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002bc8 - b _0811EF42 - .pool -_0811EF3C: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002bd4 -_0811EF42: - adds r5, r0, r1 -_0811EF44: - movs r2, 0x3 -_0811EF46: - movs r3, 0x2 -_0811EF48: - ldr r4, =0x02021fc4 - adds r0, r4, 0 - adds r1, r5, 0 - bl ConvertEasyChatWordsToString - adds r0, r4, 0 - bl box_related_two__3 -_0811EF58: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811EECC - - thumb_func_start sub_811EF6C -sub_811EF6C: @ 811EF6C - push {lr} - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - movs r0, 0xC - cmp r1, 0 - beq _0811EF7E - movs r0, 0xD -_0811EF7E: - bl sub_811EE90 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =0x02021dc4 - bl CopyEasyChatWord - pop {r0} - bx r0 - .pool - thumb_func_end sub_811EF6C - - thumb_func_start sub_811EF98 -sub_811EF98: @ 811EF98 - lsls r0, 24 - lsrs r2, r0, 27 - movs r1, 0xE0 - lsls r1, 19 - ands r1, r0 - lsrs r1, 24 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r3, =0x00002e20 - adds r0, r3 - adds r0, r2 - ldrb r0, [r0] - asrs r0, r1 - movs r1, 0x1 - ands r0, r1 - bx lr - .pool - thumb_func_end sub_811EF98 - - thumb_func_start sub_811EFC0 -sub_811EFC0: @ 811EFC0 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x20 - bhi _0811EFE4 - lsrs r3, r0, 27 - movs r2, 0x7 - ands r2, r1 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x00002e20 - adds r1, r0 - adds r1, r3 - movs r0, 0x1 - lsls r0, r2 - ldrb r2, [r1] - orrs r0, r2 - strb r0, [r1] -_0811EFE4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_811EFC0 - - thumb_func_start sub_811EFF0 -sub_811EFF0: @ 811EFF0 - push {r4,r5,lr} - movs r4, 0 - movs r5, 0 -_0811EFF6: - adds r0, r4, 0 - bl sub_811EF98 - lsls r0, 24 - cmp r0, 0 - beq _0811F008 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_0811F008: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x20 - bls _0811EFF6 - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_811EFF0 - - thumb_func_start sub_811F01C -sub_811F01C: @ 811F01C - push {r4-r6,lr} - bl sub_811EFF0 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x21 - bne _0811F048 - b _0811F082 -_0811F02C: - adds r0, r5, 0 - bl sub_811EFC0 - ldr r0, =0x000001ff - ands r4, r0 - movs r1, 0xA0 - lsls r1, 6 - adds r0, r1, 0 - orrs r4, r0 - adds r0, r4, 0 - b _0811F084 - .pool -_0811F048: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x21 - subs r1, r4 - bl __modsi3 - lsls r0, 16 - lsrs r6, r0, 16 - movs r4, 0 -_0811F05E: - lsls r0, r4, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - bl sub_811EF98 - lsls r0, 24 - cmp r0, 0 - bne _0811F078 - cmp r6, 0 - beq _0811F02C - subs r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 -_0811F078: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x20 - bls _0811F05E -_0811F082: - ldr r0, =0x0000ffff -_0811F084: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_811F01C - - thumb_func_start sub_811F090 -sub_811F090: @ 811F090 - push {r4,r5,lr} - bl sub_811EFF0 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0811F0B4 - b _0811F0EA -_0811F0A0: - ldr r0, =0x000001ff - ands r4, r0 - movs r1, 0xA0 - lsls r1, 6 - adds r0, r1, 0 - orrs r4, r0 - adds r0, r4, 0 - b _0811F0EC - .pool -_0811F0B4: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __umodsi3 - lsls r0, 16 - lsrs r5, r0, 16 - movs r4, 0 -_0811F0C8: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_811EF98 - lsls r0, 24 - cmp r0, 0 - beq _0811F0E0 - cmp r5, 0 - beq _0811F0A0 - subs r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_0811F0E0: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x20 - bls _0811F0C8 -_0811F0EA: - ldr r0, =0x0000ffff -_0811F0EC: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_811F090 - - thumb_func_start sub_811F0F8 -sub_811F0F8: @ 811F0F8 - push {lr} - bl sub_809D42C - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_811F0F8 - - thumb_func_start sub_811F108 -sub_811F108: @ 811F108 - push {r4-r7,lr} - movs r0, 0 - bl start_menu_is_selected_item_valid - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - bne _0811F128 - b _0811F172 -_0811F11A: - ldrh r1, [r5] - ldr r0, =0x000001ff - ands r0, r1 - b _0811F174 - .pool -_0811F128: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __umodsi3 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =gEasyChatGroups - ldr r5, [r0] - ldrh r7, [r0, 0x4] - movs r6, 0 - cmp r6, r7 - bcs _0811F172 -_0811F146: - ldrh r0, [r5] - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _0811F166 - cmp r4, 0 - beq _0811F11A - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_0811F166: - adds r5, 0x2 - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, r7 - bcc _0811F146 -_0811F172: - ldr r0, =0x0000ffff -_0811F174: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_811F108 - - thumb_func_start sub_811F184 -sub_811F184: @ 811F184 - push {r4-r7,lr} - movs r2, 0 - ldr r5, =0x03005d8c - ldr r4, =0x00002bb0 - ldr r3, =gUnknown_0859E62C -_0811F18E: - ldr r1, [r5] - lsls r0, r2, 1 - adds r1, r4 - adds r1, r0 - adds r0, r3 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x3 - bls _0811F18E - movs r2, 0 - ldr r5, =0x03005d8c - ldr r4, =0x00002bbc - ldr r3, =gUnknown_0859E634 -_0811F1AE: - ldr r1, [r5] - lsls r0, r2, 1 - adds r1, r4 - adds r1, r0 - adds r0, r3 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x5 - bls _0811F1AE - movs r2, 0 - ldr r5, =0x03005d8c - ldr r4, =0x00002bc8 - ldr r3, =gUnknown_0859E640 -_0811F1CE: - ldr r1, [r5] - lsls r0, r2, 1 - adds r1, r4 - adds r1, r0 - adds r0, r3 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x5 - bls _0811F1CE - movs r2, 0 - ldr r5, =0x03005d8c - ldr r4, =0x00002bd4 - ldr r3, =gUnknown_0859E64C -_0811F1EE: - ldr r1, [r5] - lsls r0, r2, 1 - adds r1, r4 - adds r1, r0 - adds r0, r3 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x5 - bls _0811F1EE - movs r2, 0 - ldr r7, =0x03005d8c - ldr r6, =0x00002be0 - ldr r0, =0x0000ffff - adds r5, r0, 0 -_0811F210: - movs r3, 0 - lsls r0, r2, 3 - adds r0, r2 - lsls r4, r0, 2 -_0811F218: - ldr r1, [r7] - lsls r0, r3, 1 - adds r0, r4 - adds r1, r6 - adds r1, r0 - ldrh r0, [r1] - orrs r0, r5 - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x8 - bls _0811F218 - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0xF - bls _0811F210 - movs r2, 0 - ldr r4, =0x03005d8c - ldr r3, =0x00002e20 - movs r1, 0 -_0811F244: - ldr r0, [r4] - adds r0, r3 - adds r0, r2 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x3F - bls _0811F244 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811F184 - - thumb_func_start sub_811F28C -sub_811F28C: @ 811F28C - push {r4,lr} - ldr r4, =0x0203a120 - ldr r0, =0x00003ba4 - bl Alloc - str r0, [r4] - cmp r0, 0 - beq _0811F2B0 - bl sub_811F2D4 - bl sub_811F46C - movs r0, 0x1 - b _0811F2B2 - .pool -_0811F2B0: - movs r0, 0 -_0811F2B2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811F28C - - thumb_func_start sub_811F2B8 -sub_811F2B8: @ 811F2B8 - push {r4,lr} - ldr r4, =0x0203a120 - ldr r0, [r4] - cmp r0, 0 - beq _0811F2CA - bl Free - movs r0, 0 - str r0, [r4] -_0811F2CA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811F2B8 - - thumb_func_start sub_811F2D4 -sub_811F2D4: @ 811F2D4 - push {r4,r5,lr} - ldr r4, =0x0203a120 - ldr r0, [r4] - movs r5, 0 - strh r5, [r0] - movs r0, 0 - bl pokedex_count - lsls r0, 16 - cmp r0, 0 - beq _0811F2FC - ldr r0, [r4] - ldrh r1, [r0] - adds r2, r1, 0x1 - strh r2, [r0] - lsls r1, 16 - lsrs r1, 15 - adds r0, 0x2 - adds r0, r1 - strh r5, [r0] -_0811F2FC: - movs r3, 0x1 -_0811F2FE: - ldr r0, [r4] - ldrh r2, [r0] - adds r1, r2, 0x1 - strh r1, [r0] - lsls r2, 16 - lsrs r2, 15 - adds r0, 0x2 - adds r0, r2 - strh r3, [r0] - adds r3, 0x1 - cmp r3, 0x10 - ble _0811F2FE - ldr r0, =0x00000864 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0811F358 - ldr r0, =0x0203a120 - ldr r2, [r0] - ldrh r0, [r2] - adds r1, r0, 0x1 - strh r1, [r2] - lsls r0, 16 - lsrs r0, 15 - adds r3, r2, 0x2 - adds r0, r3, r0 - movs r1, 0x11 - strh r1, [r0] - ldrh r0, [r2] - adds r1, r0, 0x1 - strh r1, [r2] - lsls r0, 16 - lsrs r0, 15 - adds r0, r3, r0 - movs r1, 0x12 - strh r1, [r0] - ldrh r0, [r2] - adds r1, r0, 0x1 - strh r1, [r2] - lsls r0, 16 - lsrs r0, 15 - adds r3, r0 - movs r0, 0x13 - strh r0, [r3] -_0811F358: - ldr r0, =0x00000866 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0811F37A - ldr r0, =0x0203a120 - ldr r0, [r0] - ldrh r1, [r0] - adds r2, r1, 0x1 - strh r2, [r0] - lsls r1, 16 - lsrs r1, 15 - adds r0, 0x2 - adds r0, r1 - movs r1, 0x14 - strh r1, [r0] -_0811F37A: - bl sub_809D42C - cmp r0, 0 - beq _0811F398 - ldr r0, =0x0203a120 - ldr r0, [r0] - ldrh r1, [r0] - adds r2, r1, 0x1 - strh r2, [r0] - lsls r1, 16 - lsrs r1, 15 - adds r0, 0x2 - adds r0, r1 - movs r1, 0x15 - strh r1, [r0] -_0811F398: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811F2D4 - - thumb_func_start sub_811F3AC -sub_811F3AC: @ 811F3AC - ldr r0, =0x0203a120 - ldr r0, [r0] - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_811F3AC - - thumb_func_start sub_811F3B8 -sub_811F3B8: @ 811F3B8 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x0203a120 - ldr r1, [r0] - ldrh r0, [r1] - cmp r2, r0 - bcs _0811F3D8 - lsls r0, r2, 1 - adds r1, 0x2 - adds r1, r0 - ldrb r0, [r1] - b _0811F3DA - .pool -_0811F3D8: - movs r0, 0x16 -_0811F3DA: - pop {r1} - bx r1 - thumb_func_end sub_811F3B8 - - thumb_func_start sub_811F3E0 -sub_811F3E0: @ 811F3E0 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r1, 24 - lsls r2, 16 - lsrs r5, r2, 16 - ldr r0, =gEasyChatGroupNamePointers - lsrs r1, 22 - adds r1, r0 - ldr r1, [r1] - adds r0, r4, 0 - bl CopyString - adds r1, r0, 0 - subs r4, r1, r4 - lsls r4, 16 - lsrs r0, r4, 16 - cmp r0, r5 - bcs _0811F414 - movs r2, 0 -_0811F406: - strb r2, [r1] - adds r1, 0x1 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, r5 - bcc _0811F406 -_0811F414: - movs r0, 0xFF - strb r0, [r1] - adds r0, r1, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_811F3E0 - - thumb_func_start sub_811F424 -sub_811F424: @ 811F424 - lsls r0, 24 - ldr r1, =gEasyChatGroupNamePointers - lsrs r0, 22 - adds r0, r1 - ldr r0, [r0] - bx lr - .pool - thumb_func_end sub_811F424 - - thumb_func_start CopyEasyChatWordPadded -@ char *CopyEasyChatWordPadded(char *dest, u16 groupIdWordIdPair, u16 minLength) -CopyEasyChatWordPadded: @ 811F434 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r5, r2, 16 - bl CopyEasyChatWord - adds r1, r0, 0 - subs r4, r1, r4 - lsls r4, 16 - lsrs r0, r4, 16 - cmp r0, r5 - bcs _0811F460 - movs r2, 0 -_0811F452: - strb r2, [r1] - adds r1, 0x1 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, r5 - bcc _0811F452 -_0811F460: - movs r0, 0xFF - strb r0, [r1] - adds r0, r1, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end CopyEasyChatWordPadded - - thumb_func_start sub_811F46C -sub_811F46C: @ 811F46C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - movs r3, 0 -_0811F47A: - ldr r2, =gEasyChatWordsByLetterPointers - lsls r1, r3, 3 - adds r0, r2, 0x4 - adds r0, r1, r0 - ldr r0, [r0] - str r0, [sp] - adds r1, r2 - ldr r7, [r1] - ldr r0, =0x0203a120 - ldr r1, [r0] - lsls r2, r3, 1 - adds r1, 0x2E - adds r1, r2 - movs r0, 0 - strh r0, [r1] - mov r10, r0 - movs r1, 0 - str r2, [sp, 0x4] - adds r0, r3, 0x1 - str r0, [sp, 0x8] - ldr r2, [sp] - cmp r1, r2 - bge _0811F530 -_0811F4A8: - ldrh r0, [r7] - ldr r2, =0x0000ffff - cmp r0, r2 - bne _0811F4FC - adds r7, 0x2 - ldrh r4, [r7] - adds r7, 0x2 - adds r0, r1, 0x1 - adds r1, r0, r4 - b _0811F4FE - .pool -_0811F4C8: - ldr r0, =0x0203a120 - ldr r2, [r0] - mov r0, r10 - lsls r1, r0, 1 - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 3 - subs r0, r3 - lsls r0, 2 - adds r1, r0 - adds r0, r2, 0 - adds r0, 0x64 - adds r0, r1 - ldrh r1, [r5] - strh r1, [r0] - movs r0, 0x1 - add r10, r0 - adds r2, 0x2E - ldr r0, [sp, 0x4] - adds r2, r0 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - b _0811F526 - .pool -_0811F4FC: - movs r4, 0x1 -_0811F4FE: - movs r6, 0 - adds r1, 0x1 - mov r9, r1 - lsls r2, r4, 1 - mov r8, r2 - cmp r6, r4 - bge _0811F526 - adds r5, r7, 0 -_0811F50E: - ldrh r0, [r5] - str r3, [sp, 0xC] - bl sub_811F860 - lsls r0, 24 - ldr r3, [sp, 0xC] - cmp r0, 0 - bne _0811F4C8 - adds r5, 0x2 - adds r6, 0x1 - cmp r6, r4 - blt _0811F50E -_0811F526: - add r7, r8 - mov r1, r9 - ldr r0, [sp] - cmp r1, r0 - blt _0811F4A8 -_0811F530: - ldr r3, [sp, 0x8] - cmp r3, 0x1A - ble _0811F47A - 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_811F46C - - thumb_func_start sub_811F548 -sub_811F548: @ 811F548 - push {lr} - lsls r1, 16 - lsrs r1, 16 - cmp r0, 0 - bne _0811F55A - adds r0, r1, 0 - bl sub_811F5C4 - b _0811F560 -_0811F55A: - adds r0, r1, 0 - bl sub_811F6B8 -_0811F560: - ldr r1, =0x0203a120 - ldr r1, [r1] - ldr r2, =0x00003ba0 - adds r1, r2 - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_811F548 - - thumb_func_start sub_811F578 -sub_811F578: @ 811F578 - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =0x0203a120 - ldr r1, [r0] - ldr r3, =0x00003ba0 - adds r0, r1, r3 - ldrh r0, [r0] - cmp r2, r0 - bcs _0811F5A4 - lsls r0, r2, 1 - ldr r2, =0x00003984 - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - b _0811F5A6 - .pool -_0811F5A4: - ldr r0, =0x0000ffff -_0811F5A6: - pop {r1} - bx r1 - .pool - thumb_func_end sub_811F578 - - thumb_func_start sub_811F5B0 -sub_811F5B0: @ 811F5B0 - ldr r0, =0x0203a120 - ldr r0, [r0] - ldr r1, =0x00003ba0 - adds r0, r1 - ldrh r0, [r0] - bx lr - .pool - thumb_func_end sub_811F5B0 - - thumb_func_start sub_811F5C4 -sub_811F5C4: @ 811F5C4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r2, r0, 16 - ldr r1, =gEasyChatGroups - lsls r0, r2, 3 - adds r0, r1 - ldrh r3, [r0, 0x4] - mov r8, r3 - cmp r2, 0 - beq _0811F5EC - cmp r2, 0x15 - beq _0811F5EC - cmp r2, 0x12 - beq _0811F5EC - cmp r2, 0x13 - bne _0811F64C -_0811F5EC: - lsls r0, r2, 3 - adds r0, r1 - ldr r1, [r0] - movs r7, 0 - movs r5, 0 - cmp r5, r8 - bcs _0811F698 - movs r0, 0x7F - ands r0, r2 - lsls r0, 9 - mov r9, r0 - adds r4, r1, 0 - lsls r6, r2, 24 -_0811F606: - ldrh r0, [r4] - lsrs r1, r6, 24 - bl sub_811F764 - lsls r0, 24 - cmp r0, 0 - beq _0811F630 - ldr r0, =0x0203a120 - ldr r2, [r0] - lsls r0, r5, 1 - ldr r1, =0x00003984 - adds r2, r1 - adds r2, r0 - ldrh r0, [r4] - ldr r3, =0x000001ff - adds r1, r3, 0 - ands r0, r1 - mov r1, r9 - orrs r0, r1 - strh r0, [r2] - adds r5, 0x1 -_0811F630: - adds r4, 0x2 - adds r7, 0x1 - cmp r7, r8 - bcc _0811F606 - b _0811F698 - .pool -_0811F64C: - ldr r1, [r0] - movs r7, 0 - movs r5, 0 - cmp r5, r8 - bcs _0811F698 - movs r0, 0x7F - ands r0, r2 - lsls r0, 9 - mov r10, r0 - adds r6, r1, 0 - lsls r2, 24 - mov r9, r2 -_0811F664: - ldrh r4, [r6, 0x4] - adds r0, r4, 0 - mov r2, r9 - lsrs r1, r2, 24 - bl sub_811F764 - lsls r0, 24 - cmp r0, 0 - beq _0811F690 - ldr r0, =0x0203a120 - ldr r1, [r0] - lsls r0, r5, 1 - ldr r3, =0x00003984 - adds r1, r3 - adds r1, r0 - ldr r2, =0x000001ff - adds r0, r2, 0 - ands r4, r0 - mov r3, r10 - orrs r4, r3 - strh r4, [r1] - adds r5, 0x1 -_0811F690: - adds r6, 0xC - adds r7, 0x1 - cmp r7, r8 - bcc _0811F664 -_0811F698: - lsls r0, r5, 16 - lsrs r0, 16 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_811F5C4 - - thumb_func_start sub_811F6B8 -sub_811F6B8: @ 811F6B8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r1, r0, 16 - movs r4, 0 - movs r6, 0 - ldr r3, =0x0203a120 - ldr r0, [r3] - lsls r5, r1, 1 - adds r0, 0x2E - adds r0, r5 - ldrh r0, [r0] - cmp r6, r0 - bcs _0811F718 - mov r8, r3 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 3 - subs r0, r1 - lsls r7, r0, 2 - ldr r0, =0x00003984 - mov r12, r0 -_0811F6E6: - mov r0, r8 - ldr r3, [r0] - adds r1, r6, 0 - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 1 - mov r0, r12 - adds r2, r3, r0 - adds r2, r1 - lsls r1, r4, 1 - adds r1, r7 - adds r0, r3, 0 - adds r0, 0x64 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - adds r3, 0x2E - adds r3, r5 - ldrh r3, [r3] - cmp r4, r3 - bcc _0811F6E6 -_0811F718: - adds r0, r6, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_811F6B8 - - thumb_func_start sub_811F72C -sub_811F72C: @ 811F72C - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - movs r2, 0 - ldr r0, =0x0203a120 - ldr r0, [r0] - ldrh r1, [r0] - cmp r2, r1 - bge _0811F75C - adds r4, r3, 0 - adds r3, r1, 0 - adds r1, r0, 0x2 -_0811F744: - ldrh r0, [r1] - cmp r0, r4 - bne _0811F754 - movs r0, 0x1 - b _0811F75E - .pool -_0811F754: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, r3 - blt _0811F744 -_0811F75C: - movs r0, 0 -_0811F75E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_811F72C - - thumb_func_start sub_811F764 -sub_811F764: @ 811F764 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 24 - lsrs r2, r1, 24 - cmp r2, 0x15 - bhi _0811F81A - lsls r0, r2, 2 - ldr r1, =_0811F780 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0811F780: - .4byte _0811F7D8 - .4byte _0811F81A - .4byte _0811F81A - .4byte _0811F81A - .4byte _0811F81A - .4byte _0811F81A - .4byte _0811F81A - .4byte _0811F81A - .4byte _0811F81A - .4byte _0811F81A - .4byte _0811F81A - .4byte _0811F81A - .4byte _0811F81A - .4byte _0811F81A - .4byte _0811F81A - .4byte _0811F81A - .4byte _0811F81A - .4byte _0811F81A - .4byte _0811F808 - .4byte _0811F808 - .4byte _0811F80C - .4byte _0811F7EE -_0811F7D8: - adds r0, r4, 0 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - bl pokedex_flag_operation - lsls r0, 24 - lsrs r0, 24 - b _0811F82C -_0811F7EE: - adds r0, r4, 0 - bl sub_811F838 - cmp r0, 0 - beq _0811F808 - adds r0, r4, 0 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - bl pokedex_flag_operation -_0811F808: - movs r0, 0x1 - b _0811F82C -_0811F80C: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_811EF98 - lsls r0, 24 - lsrs r0, 24 - b _0811F82C -_0811F81A: - ldr r1, =gEasyChatGroups - lsls r0, r2, 3 - adds r0, r1 - ldr r1, [r0] - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x8] -_0811F82C: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_811F764 - - thumb_func_start sub_811F838 -sub_811F838: @ 811F838 - push {lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - ldr r1, =gUnknown_0859E658 -_0811F842: - ldrh r0, [r1] - cmp r0, r3 - bne _0811F850 - movs r0, 0x1 - b _0811F85A - .pool -_0811F850: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, 0 - beq _0811F842 - movs r0, 0 -_0811F85A: - pop {r1} - bx r1 - thumb_func_end sub_811F838 - - thumb_func_start sub_811F860 -sub_811F860: @ 811F860 - push {r4,r5,lr} - lsls r0, 16 - lsrs r5, r0, 25 - lsls r0, 7 - lsrs r4, r0, 23 - adds r0, r5, 0 - bl sub_811F72C - lsls r0, 24 - cmp r0, 0 - beq _0811F884 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_811F764 - lsls r0, 24 - lsrs r0, 24 - b _0811F886 -_0811F884: - movs r0, 0 -_0811F886: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_811F860 - - thumb_func_start sub_811F88C -sub_811F88C: @ 811F88C - push {lr} - adds r2, r0, 0 - lsls r1, 16 - ldr r0, =0xffff0000 - adds r1, r0 - lsrs r0, r1, 16 - ldr r1, =0x0000ffff - cmp r0, r1 - beq _0811F8AE - adds r3, r1, 0 -_0811F8A0: - strh r3, [r2] - adds r2, 0x2 - subs r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, r1 - bne _0811F8A0 -_0811F8AE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_811F88C - - thumb_func_start sub_811F8BC -sub_811F8BC: @ 811F8BC - push {lr} - bl sub_801B058 - ldr r1, =0x0000ffff - adds r2, r1, 0 - adds r1, r0, 0x6 -_0811F8C8: - strh r2, [r1] - subs r1, 0x2 - cmp r1, r0 - bge _0811F8C8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_811F8BC - - thumb_func_start sub_811F8D8 -sub_811F8D8: @ 811F8D8 - push {r4,r5,lr} - asrs r4, r0, 9 - movs r1, 0x7F - ldr r5, =0x000001ff - ands r5, r0 - ands r4, r1 - adds r0, r4, 0 - bl sub_811EA28 - lsls r0, 24 - cmp r0, 0 - beq _0811F904 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_811F764 - lsls r0, 24 - lsrs r0, 24 - b _0811F906 - .pool -_0811F904: - movs r0, 0 -_0811F906: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_811F8D8 - - thumb_func_start sub_811F90C -sub_811F90C: @ 811F90C - ldr r1, =0x0203a124 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_811F90C - - thumb_func_start sub_811F918 -sub_811F918: @ 811F918 - push {lr} - sub sp, 0x4 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x14] - lsrs r0, 3 - bl sub_8098758 - ldr r3, =0x0203a124 - ldr r2, [r3] - ldr r1, [r0] - str r1, [r2, 0x2C] - ldr r0, [r0, 0x4] - str r0, [r2, 0x30] - ldr r0, =0x000010b4 - adds r2, r0 - movs r1, 0 - strb r1, [r2] - mov r0, sp - strh r1, [r0] - ldr r1, [r3] - adds r1, 0x34 - ldr r2, =0x01000800 - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_811F918 - - thumb_func_start sub_811F960 -sub_811F960: @ 811F960 - push {r4-r7,lr} - ldr r0, =0x0203a124 - ldr r1, [r0] - ldr r2, =0x000010b4 - adds r0, r1, r2 - ldrb r2, [r0] - lsls r0, r2, 8 - adds r0, 0x34 - adds r5, r1, r0 - cmp r2, 0xD - beq _0811FA30 - cmp r2, 0xD - bgt _0811F988 - cmp r2, 0 - beq _0811F98E - b _0811F9D8 - .pool -_0811F988: - cmp r2, 0xE - beq _0811FA7C - b _0811F9D8 -_0811F98E: - ldr r0, [r1, 0x2C] - adds r1, r5, 0 - movs r2, 0x8 - bl CpuFastSet - movs r4, 0 - adds r7, r5, 0 - adds r7, 0xE0 -_0811F99E: - ldr r6, =0x0203a124 - ldr r0, [r6] - ldr r0, [r0, 0x2C] - adds r0, 0x20 - adds r4, 0x1 - lsls r1, r4, 5 - adds r1, r5, r1 - movs r2, 0x8 - bl CpuFastSet - lsls r4, 16 - lsrs r4, 16 - cmp r4, 0x5 - bls _0811F99E - ldr r0, [r6] - ldr r0, [r0, 0x2C] - adds r0, 0x40 - adds r1, r7, 0 - movs r2, 0x8 - bl CpuFastSet - ldr r1, [r6] - ldr r0, =0x000010b4 - adds r1, r0 - b _0811FA1E - .pool -_0811F9D8: - ldr r0, =0x0203a124 - ldr r0, [r0] - ldr r0, [r0, 0x2C] - adds r0, 0x60 - adds r1, r5, 0 - movs r2, 0x8 - bl CpuFastSet - movs r4, 0 - adds r7, r5, 0 - adds r7, 0xE0 -_0811F9EE: - ldr r6, =0x0203a124 - ldr r0, [r6] - ldr r0, [r0, 0x2C] - adds r0, 0x80 - adds r4, 0x1 - lsls r1, r4, 5 - adds r1, r5, r1 - movs r2, 0x8 - bl CpuFastSet - lsls r4, 16 - lsrs r4, 16 - cmp r4, 0x5 - bls _0811F9EE - ldr r0, [r6] - ldr r0, [r0, 0x2C] - adds r0, 0xA0 - adds r1, r7, 0 - movs r2, 0x8 - bl CpuFastSet - ldr r1, [r6] - ldr r2, =0x000010b4 - adds r1, r2 -_0811FA1E: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0811FA88 - .pool -_0811FA30: - ldr r0, [r1, 0x2C] - adds r0, 0xC0 - adds r1, r5, 0 - movs r2, 0x8 - bl CpuFastSet - movs r4, 0 - adds r7, r5, 0 - adds r7, 0xE0 -_0811FA42: - ldr r6, =0x0203a124 - ldr r0, [r6] - ldr r0, [r0, 0x2C] - adds r0, 0xE0 - adds r4, 0x1 - lsls r1, r4, 5 - adds r1, r5, r1 - movs r2, 0x8 - bl CpuFastSet - lsls r4, 16 - lsrs r4, 16 - cmp r4, 0x5 - bls _0811FA42 - ldr r0, [r6] - ldr r0, [r0, 0x2C] - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - adds r1, r7, 0 - movs r2, 0x8 - bl CpuFastSet - ldr r1, [r6] - ldr r2, =0x000010b4 - adds r1, r2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0811FA7C: - movs r0, 0 - b _0811FA8A - .pool -_0811FA88: - movs r0, 0x1 -_0811FA8A: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_811F960 - - thumb_func_start sub_811FA90 -sub_811FA90: @ 811FA90 - push {lr} - bl sub_811F918 -_0811FA96: - bl sub_811F960 - lsls r0, 24 - cmp r0, 0 - bne _0811FA96 - pop {r0} - bx r0 - thumb_func_end sub_811FA90 - - thumb_func_start sub_811FAA4 -sub_811FAA4: @ 811FAA4 - push {r4-r7,lr} - lsls r1, 16 - lsrs r5, r1, 16 - lsls r2, 16 - lsrs r6, r2, 16 - ldr r2, =0x0203a124 - ldr r3, [r2] - movs r1, 0 - strb r1, [r3, 0x5] - ldr r1, [r2] - strb r0, [r1, 0x4] - movs r3, 0 - adds r7, r2, 0 - adds r4, r7, 0 - movs r2, 0x1 -_0811FAC2: - ldr r0, [r4] - adds r1, r0, 0x6 - adds r1, r3 - ldrb r0, [r0, 0x4] - asrs r0, r3 - ands r0, r2 - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x3 - bls _0811FAC2 - lsls r0, r5, 16 - asrs r0, 16 - lsls r1, r6, 16 - asrs r1, 16 - ldr r3, [r7] - ldrh r2, [r3] - ldrh r3, [r3, 0x2] - bl sub_811FC80 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811FAA4 - - thumb_func_start sub_811FAF8 -sub_811FAF8: @ 811FAF8 - push {r4-r7,lr} - movs r5, 0 - ldr r4, =0x0203a124 -_0811FAFE: - ldr r0, [r4] - ldrh r0, [r0] - adds r0, r5, r0 - lsls r0, 16 - lsrs r0, 16 - bl FreeObjectTilesByTag - ldr r0, [r4] - ldrh r0, [r0, 0x2] - adds r0, r5, r0 - lsls r0, 16 - lsrs r0, 16 - bl FreeObjectPaletteByTag - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x1 - bls _0811FAFE - movs r5, 0 - ldr r6, =0x0203a124 -_0811FB28: - ldr r0, [r6] - lsls r4, r5, 2 - adds r0, 0xC - adds r0, r4 - ldr r0, [r0] - cmp r0, 0 - beq _0811FB9A - bl RemoveObjectAndFreeTiles - ldr r0, [r6] - adds r0, 0xC - adds r0, r4 - movs r1, 0 - str r1, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x1 - bls _0811FB28 - movs r5, 0 - ldr r6, =0x0203a124 -_0811FB52: - ldr r0, [r6] - lsls r4, r5, 2 - adds r0, 0x14 - adds r0, r4 - ldr r0, [r0] - cmp r0, 0 - beq _0811FB9A - bl RemoveObjectAndFreeTiles - ldr r0, [r6] - adds r0, 0x14 - adds r0, r4 - movs r7, 0 - str r7, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x3 - bls _0811FB52 - ldr r4, =0x0203a124 - ldr r0, [r4] - ldr r0, [r0, 0x24] - cmp r0, 0 - beq _0811FB8A - bl RemoveObjectAndFreeTiles - ldr r0, [r4] - str r7, [r0, 0x24] -_0811FB8A: - ldr r0, [r4] - ldr r0, [r0, 0x28] - cmp r0, 0 - beq _0811FB9A - bl RemoveObjectAndFreeTiles - ldr r0, [r4] - str r7, [r0, 0x28] -_0811FB9A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811FAF8 - - thumb_func_start sub_811FBA4 -sub_811FBA4: @ 811FBA4 - push {r4,r5,lr} - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - beq _0811FBDC - movs r0, 0x5 - bl audio_play - ldr r2, =0x0203a124 - ldr r1, [r2] - ldrb r0, [r1, 0x5] - subs r0, 0x1 - strb r0, [r1, 0x5] - lsls r0, 24 - cmp r0, 0 - bge _0811FC64 - ldr r1, [r2] - movs r0, 0x5 - strb r0, [r1, 0x5] - b _0811FC64 - .pool -_0811FBDC: - movs r0, 0x80 - ands r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _0811FC0C - movs r0, 0x5 - bl audio_play - ldr r2, =0x0203a124 - ldr r1, [r2] - ldrb r0, [r1, 0x5] - adds r0, 0x1 - strb r0, [r1, 0x5] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x5 - ble _0811FC64 - ldr r0, [r2] - strb r5, [r0, 0x5] - b _0811FC64 - .pool -_0811FC0C: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0811FC68 - movs r0, 0x5 - bl audio_play - ldr r2, =0x0203a124 - ldr r0, [r2] - movs r1, 0x5 - ldrsb r1, [r0, r1] - cmp r1, 0x4 - beq _0811FC40 - cmp r1, 0x5 - beq _0811FC76 - adds r0, 0x6 - adds r1, r0, r1 - movs r2, 0 - ldrb r0, [r1] - cmp r0, 0 - bne _0811FC62 - movs r2, 0x1 - b _0811FC62 - .pool -_0811FC40: - strb r4, [r0, 0x4] - movs r3, 0 - adds r4, r2, 0 -_0811FC46: - ldr r2, [r4] - adds r0, r2, 0x6 - adds r0, r3 - ldrb r0, [r0] - lsls r0, r3 - ldrb r1, [r2, 0x4] - orrs r0, r1 - strb r0, [r2, 0x4] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x3 - bls _0811FC46 - b _0811FC76 -_0811FC62: - strb r2, [r1] -_0811FC64: - movs r0, 0x1 - b _0811FC78 -_0811FC68: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0811FC64 - movs r0, 0x5 - bl audio_play -_0811FC76: - movs r0, 0 -_0811FC78: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_811FBA4 - - thumb_func_start sub_811FC80 -sub_811FC80: @ 811FC80 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x50 - mov r8, r0 - mov r9, r1 - adds r5, r2, 0 - adds r6, r3, 0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 16 - lsrs r6, 16 - ldr r4, =0x0203a124 - ldr r0, [r4] - adds r0, 0x34 - str r0, [sp, 0x18] - add r1, sp, 0x1C - movs r7, 0 - movs r0, 0x80 - lsls r0, 5 - strh r0, [r1] - mov r0, sp - adds r0, 0x1E - strh r5, [r0] - add r1, sp, 0x20 - ldr r0, =gUnknown_08DC9628 - str r0, [sp, 0x20] - movs r0, 0xC8 - lsls r0, 2 - strh r0, [r1, 0x4] - adds r0, r5, 0x1 - strh r0, [r1, 0x6] - add r0, sp, 0x28 - movs r1, 0 - movs r2, 0x8 - bl memset - add r2, sp, 0x18 - mov r10, r2 - mov r0, sp - mov r1, r10 - movs r2, 0x18 - bl memcpy - ldr r0, [r4] - ldr r0, [r0, 0x30] - str r0, [sp, 0x30] - add r0, sp, 0x34 - strh r6, [r0] - add r1, sp, 0x38 - ldr r0, =gUnknown_08DC9608 - str r0, [sp, 0x38] - adds r0, r6, 0x1 - strh r0, [r1, 0x4] - add r0, sp, 0x40 - movs r1, 0 - movs r2, 0x8 - bl memset - add r4, sp, 0x30 - mov r0, r10 - adds r1, r4, 0 - movs r2, 0x18 - bl memcpy - strh r5, [r4] - strh r6, [r4, 0x2] - ldr r0, =gUnknown_0859EE7C - str r0, [r4, 0x4] - ldr r0, =gUnknown_0859EF14 - str r0, [r4, 0x8] - str r7, [r4, 0xC] - ldr r0, =gDummyObjectRotScalAnimTable - str r0, [r4, 0x10] - ldr r0, =TaskDummy7 - str r0, [r4, 0x14] - mov r0, sp - bl LoadObjectPics - mov r0, r10 - bl LoadTaggedObjectPalettes - movs r5, 0 - mov r3, r8 - lsls r3, 16 - mov r8, r3 - movs r0, 0x80 - lsls r0, 14 - add r0, r8 - mov r10, r0 - mov r1, r8 - str r1, [sp, 0x48] - mov r2, r9 - lsls r2, 16 - mov r9, r2 - movs r7, 0x80 - lsls r7, 14 - add r7, r9 - mov r3, r9 - str r3, [sp, 0x4C] -_0811FD58: - adds r0, r4, 0 - mov r2, r10 - asrs r1, r2, 16 - asrs r2, r7, 16 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - bne _0811FD70 - b _0811FEFC -_0811FD70: - ldr r6, =0x0203a124 - ldr r2, [r6] - lsls r0, r5, 2 - adds r2, 0xC - adds r2, r0 - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - str r0, [r2] - lsls r1, r5, 24 - lsrs r1, 24 - bl StartObjectImageAnim - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x1 - bls _0811FD58 - ldr r0, [r6] - ldr r1, [r0, 0x10] - ldr r3, [sp, 0x4C] - asrs r0, r3, 16 - adds r0, 0x60 - strh r0, [r1, 0x22] - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - ldr r0, =gUnknown_0859EEDC - str r0, [r4, 0x8] - ldr r0, =sub_811FF40 - str r0, [r4, 0x14] - ldr r0, =gUnknown_0859EE84 - str r0, [r4, 0x4] - movs r5, 0 - ldr r0, [sp, 0x48] - movs r1, 0x80 - lsls r1, 14 - adds r0, r1 - mov r9, r0 -_0811FDC8: - lsls r2, r5, 4 - adds r2, 0x10 - ldr r3, [sp, 0x4C] - asrs r3, 16 - mov r8, r3 - add r2, r8 - lsls r2, 16 - asrs r2, 16 - adds r0, r4, 0 - mov r3, r9 - asrs r1, r3, 16 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - bne _0811FDEE - b _0811FF0C -_0811FDEE: - ldr r6, =0x0203a124 - ldr r1, [r6] - lsls r0, r5, 2 - adds r1, 0x14 - adds r1, r0 - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - ldr r7, =0x02020630 - adds r0, r7 - str r0, [r1] - strh r5, [r0, 0x2E] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x3 - bls _0811FDC8 - ldr r0, =DummyObjectCallback - str r0, [r4, 0x14] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - beq _0811FEA8 - ldr r0, [r6] - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - adds r1, r7 - str r1, [r0, 0x28] - ldrb r3, [r1, 0x1] - movs r2, 0x3F - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1, 0x1] - ldr r0, [r6] - ldr r1, [r0, 0x28] - ldrb r0, [r1, 0x3] - ands r2, r0 - movs r0, 0x80 - orrs r2, r0 - strb r2, [r1, 0x3] - ldr r0, [r6] - ldr r0, [r0, 0x28] - movs r1, 0x9 - bl StartObjectImageAnim - ldr r1, [r6] - ldr r2, [r1, 0x28] - ldr r3, [sp, 0x48] - asrs r0, r3, 16 - adds r0, 0x20 - strh r0, [r2, 0x20] - ldr r2, [r1, 0x28] - mov r0, r8 - adds r0, 0x50 - strh r0, [r2, 0x22] - ldr r0, [r1, 0x28] - movs r1, 0x1 - movs r2, 0x2 - movs r3, 0 - bl CalcVecFromObjectCenterToObjectUpperLeft - b _0811FEAE - .pool -_0811FEA8: - ldr r1, [r6] - movs r0, 0 - str r0, [r1, 0x28] -_0811FEAE: - ldr r0, =sub_811FF7C - str r0, [r4, 0x14] - ldr r0, [sp, 0x48] - movs r2, 0xC0 - lsls r2, 12 - adds r1, r0, r2 - asrs r1, 16 - adds r0, r4, 0 - movs r2, 0 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - beq _0811FF20 - ldr r0, =0x0203a124 - ldr r2, [r0] - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - str r1, [r2, 0x24] - ldr r3, [sp, 0x4C] - asrs r0, r3, 16 - adds r0, 0x10 - strh r0, [r1, 0x2E] - ldr r0, [r2, 0x24] - movs r1, 0x8 - bl StartObjectImageAnim - b _0811FF28 - .pool -_0811FEFC: - ldr r0, =0x0203a124 - ldr r0, [r0] - lsls r1, r5, 2 - adds r0, 0xC - b _0811FF14 - .pool -_0811FF0C: - ldr r0, =0x0203a124 - ldr r0, [r0] - lsls r1, r5, 2 - adds r0, 0x14 -_0811FF14: - adds r0, r1 - movs r1, 0 - str r1, [r0] - b _0811FF28 - .pool -_0811FF20: - ldr r0, =0x0203a124 - ldr r1, [r0] - movs r0, 0 - str r0, [r1, 0x24] -_0811FF28: - add sp, 0x50 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811FC80 - - thumb_func_start TaskDummy7 -TaskDummy7: @ 811FF3C - bx lr - thumb_func_end TaskDummy7 - - thumb_func_start sub_811FF40 -sub_811FF40: @ 811FF40 - push {lr} - adds r2, r0, 0 - ldr r0, =0x0203a124 - ldr r0, [r0] - movs r3, 0x2E - ldrsh r1, [r2, r3] - adds r0, 0x6 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _0811FF6C - lsls r1, 1 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - adds r0, r2, 0 - bl StartObjectImageAnim - b _0811FF76 - .pool -_0811FF6C: - lsls r1, 25 - lsrs r1, 24 - adds r0, r2, 0 - bl StartObjectImageAnim -_0811FF76: - pop {r0} - bx r0 - thumb_func_end sub_811FF40 - - thumb_func_start sub_811FF7C -sub_811FF7C: @ 811FF7C - ldr r1, =0x0203a124 - ldr r1, [r1] - ldrb r1, [r1, 0x5] - lsls r1, 24 - asrs r1, 24 - lsls r1, 4 - ldrh r2, [r0, 0x2E] - adds r1, r2 - strh r1, [r0, 0x22] - bx lr - .pool - thumb_func_end sub_811FF7C - - thumb_func_start sub_811FF94 -sub_811FF94: @ 811FF94 - push {lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - lsrs r1, 16 - cmp r2, 0 - bne _0811FFA4 - ldr r2, =gUnknown_0859E65C -_0811FFA4: - movs r3, 0x10 - bl sub_811FFD4 - pop {r1} - bx r1 - .pool - thumb_func_end sub_811FF94 - - thumb_func_start sub_811FFB4 -sub_811FFB4: @ 811FFB4 - push {lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - lsrs r1, 16 - cmp r2, 0 - bne _0811FFC4 - ldr r2, =gUnknown_0859E65C -_0811FFC4: - movs r3, 0x1 - bl sub_811FFD4 - pop {r1} - bx r1 - .pool - thumb_func_end sub_811FFB4 - - thumb_func_start sub_811FFD4 -sub_811FFD4: @ 811FFD4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x28 - lsls r0, 16 - lsls r1, 16 - lsrs r1, 16 - ldr r4, =gUnknown_0859E67C - str r4, [sp, 0x18] - movs r4, 0x80 - add r5, sp, 0x18 - lsrs r6, r0, 16 - orrs r0, r4 - str r0, [r5, 0x4] - str r2, [sp, 0x20] - ldr r0, =0xffff0000 - mov r8, r0 - add r4, sp, 0x20 - ldr r0, [r4, 0x4] - mov r2, r8 - ands r0, r2 - orrs r0, r1 - str r0, [r4, 0x4] - mov r0, sp - movs r2, 0 - strh r6, [r0] - strh r1, [r0, 0x2] - ldr r0, =gUnknown_0859EF1C - str r0, [sp, 0x4] - ldr r0, =gUnknown_0859EFA4 - str r0, [sp, 0x8] - str r2, [sp, 0xC] - ldr r0, =gDummyObjectRotScalAnimTable - str r0, [sp, 0x10] - ldr r0, =TaskDummy7 - str r0, [sp, 0x14] - lsls r3, 23 - lsrs r3, 16 - ldr r0, [r5, 0x4] - mov r1, r8 - ands r0, r1 - orrs r0, r3 - str r0, [r5, 0x4] - adds r0, r5, 0 - bl LoadObjectPic - adds r0, r4, 0 - bl LoadTaggedObjectPalette - mov r0, sp - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - bne _08120068 - movs r0, 0 - b _08120072 - .pool -_08120068: - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 -_08120072: - add sp, 0x28 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_811FFD4 - - thumb_func_start sub_8120084 -sub_8120084: @ 8120084 - push {lr} - lsls r0, 24 - lsrs r0, 17 - ldr r2, =gUnknown_0859E67C - adds r0, r2 - movs r2, 0x80 - movs r3, 0x10 - bl RequestDma3Copy - pop {r0} - bx r0 - .pool - thumb_func_end sub_8120084 - - thumb_func_start sub_81200A0 -sub_81200A0: @ 81200A0 - push {r4,lr} - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r1, =0x00002e28 - adds r0, r2, r1 - movs r1, 0 - strb r1, [r0] - ldr r3, =0x00002e51 - adds r0, r2, r3 - strb r1, [r0] - ldr r0, =gUnknown_82E9531 - ldrb r1, [r0] - adds r3, 0x1 - adds r0, r2, r3 - strb r1, [r0] - movs r3, 0 - ldr r0, =0x00002e2a - adds r2, r0 - ldr r4, =gUnknown_0859EFE4 -_081200C6: - lsls r0, r3, 1 - adds r1, r2, r0 - adds r0, r4 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x5 - bls _081200C6 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81200A0 - - thumb_func_start sub_81200F8 -sub_81200F8: @ 81200F8 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x00002e28 - adds r1, r0 - movs r2, 0 - movs r0, 0x1 - strb r0, [r1] - strb r2, [r1, 0x1] - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strb r0, [r1, 0x2] - bx lr - .pool - thumb_func_end sub_81200F8 - - thumb_func_start sub_812011C -sub_812011C: @ 812011C - push {lr} - bl sub_8120E08 - pop {r0} - bx r0 - thumb_func_end sub_812011C - - thumb_func_start sub_8120128 -sub_8120128: @ 8120128 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x00002e28 - adds r2, r1, r0 - movs r3, 0 - movs r0, 0x4 - strb r0, [r2] - strb r3, [r2, 0x1] - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - ldr r2, =0x00002e48 - adds r1, r2 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8120128 - - thumb_func_start sub_8120154 -sub_8120154: @ 8120154 - push {lr} - bl sub_81339F8 - pop {r0} - bx r0 - thumb_func_end sub_8120154 - - thumb_func_start sub_8120160 -sub_8120160: @ 8120160 - push {lr} - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r1, [r0, 0xB] - lsls r1, 8 - ldrb r0, [r0, 0xA] - orrs r0, r1 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - lsrs r0, 17 - cmp r0, 0x4 - bhi _081201C0 - lsls r0, 2 - ldr r1, =_08120190 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08120190: - .4byte _081201A4 - .4byte _081201AA - .4byte _081201B0 - .4byte _081201B6 - .4byte _081201BC -_081201A4: - bl sub_81200A0 - b _081201C0 -_081201AA: - bl sub_81200F8 - b _081201C0 -_081201B0: - bl sub_8120154 - b _081201C0 -_081201B6: - bl sub_812011C - b _081201C0 -_081201BC: - bl sub_8120128 -_081201C0: - bl sub_8120B5C - pop {r0} - bx r0 - thumb_func_end sub_8120160 - - thumb_func_start sub_81201C8 -sub_81201C8: @ 81201C8 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002e28 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_81201C8 - - thumb_func_start sub_81201DC -sub_81201DC: @ 81201DC - push {r4,lr} - ldr r4, =0x020375f0 - bl sub_81201C8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81201DC - - thumb_func_start sub_81201F4 -sub_81201F4: @ 81201F4 - ldr r1, =0x020375f0 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00002e51 - adds r0, r2 - ldrb r0, [r0] - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81201F4 - - thumb_func_start sub_8120210 -sub_8120210: @ 8120210 - push {r4-r6,lr} - ldr r0, =0x03005d8c - ldr r4, [r0] - ldr r0, =0x00002e28 - adds r6, r4, r0 - ldr r1, =0x00002e42 - adds r0, r4, r1 - ldr r5, =0x03005d90 - ldr r1, [r5] - bl CopyString - movs r2, 0 - ldr r0, =0x00002e4d - adds r4, r0 -_0812022C: - adds r1, r4, r2 - ldr r0, [r5] - adds r0, 0xA - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x3 - bls _0812022C - movs r2, 0 - adds r5, r6, 0 - adds r5, 0x29 - adds r3, r6, 0x2 - adds r4, r6, 0 - adds r4, 0xE -_0812024E: - lsls r0, r2, 1 - adds r1, r3, r0 - adds r0, r4, r0 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x5 - bls _0812024E - movs r0, 0x1 - strb r0, [r5] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8120210 - - thumb_func_start sub_8120280 -sub_8120280: @ 8120280 - push {r4-r7,lr} - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x020375e0 - ldrh r0, [r0] - ldr r2, =0x00002e36 - adds r5, r1, r2 - cmp r0, 0 - bne _08120296 - ldr r0, =0x00002e2a - adds r5, r1, r0 -_08120296: - ldr r2, =0x02021fc4 - adds r4, r2, 0 - movs r6, 0 -_0812029C: - ldrh r1, [r5] - adds r5, 0x2 - adds r0, r2, 0 - bl CopyEasyChatWord - adds r2, r0, 0 - adds r7, r6, 0x1 - cmp r2, r4 - beq _081202BE - movs r1, 0x37 -_081202B0: - ldrb r0, [r4] - cmp r0, 0 - bne _081202B8 - strb r1, [r4] -_081202B8: - adds r4, 0x1 - cmp r2, r4 - bne _081202B0 -_081202BE: - adds r4, 0x1 - movs r0, 0 - strb r0, [r2] - adds r2, 0x1 - ldrh r1, [r5] - adds r5, 0x2 - adds r0, r2, 0 - bl CopyEasyChatWord - adds r2, r0, 0 - cmp r2, r4 - beq _081202E6 - movs r1, 0x37 -_081202D8: - ldrb r0, [r4] - cmp r0, 0 - bne _081202E0 - strb r1, [r4] -_081202E0: - adds r4, 0x1 - cmp r2, r4 - bne _081202D8 -_081202E6: - adds r4, 0x1 - movs r0, 0xFE - strb r0, [r2] - adds r2, 0x1 - ldrh r1, [r5] - adds r5, 0x2 - adds r0, r2, 0 - bl CopyEasyChatWord - adds r2, r0, 0 - cmp r2, r4 - beq _0812030E - movs r1, 0x37 -_08120300: - ldrb r0, [r4] - cmp r0, 0 - bne _08120308 - strb r1, [r4] -_08120308: - adds r4, 0x1 - cmp r2, r4 - bne _08120300 -_0812030E: - cmp r6, 0 - bne _0812031E - movs r0, 0xFC - strb r0, [r2] - adds r2, 0x1 - movs r0, 0xF - strb r0, [r2] - adds r2, 0x1 -_0812031E: - lsls r0, r7, 16 - lsrs r6, r0, 16 - cmp r6, 0x1 - bls _0812029C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8120280 - - thumb_func_start sub_8120340 -sub_8120340: @ 8120340 - push {lr} - ldr r0, =0x020375e0 - ldrb r0, [r0] - bl sub_81206C0 - bl script_env_2_set_ctx_paused - pop {r0} - bx r0 - .pool - thumb_func_end sub_8120340 - - thumb_func_start sub_8120358 -sub_8120358: @ 8120358 - ldr r1, =0x020375f0 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00002e28 - adds r0, r2 - ldrb r0, [r0, 0x1] - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_8120358 - - thumb_func_start sub_8120374 -sub_8120374: @ 8120374 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002e28 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0, 0x1] - bx lr - .pool - thumb_func_end sub_8120374 - - thumb_func_start sub_812038C -sub_812038C: @ 812038C - push {lr} - bl sub_811F01C - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x0000ffff - cmp r1, r0 - bne _081203AC - ldr r1, =0x020375f0 - movs r0, 0 - b _081203B6 - .pool -_081203AC: - ldr r0, =0x02021cc4 - bl CopyEasyChatWord - ldr r1, =0x020375f0 - movs r0, 0x1 -_081203B6: - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_812038C - - thumb_func_start sub_81203C4 -sub_81203C4: @ 81203C4 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002e28 - adds r2, r0, r1 - ldrb r0, [r2, 0x1] - cmp r0, 0xA - bne _081203EC - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - strb r0, [r2, 0x1] - b _081203F2 - .pool -_081203EC: - ldr r1, =0x020375f0 - movs r0, 0x1 - strh r0, [r1] -_081203F2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81203C4 - - thumb_func_start sub_81203FC -sub_81203FC: @ 81203FC - push {r4-r6,lr} - ldr r0, =0x03005d8c - ldr r4, [r0] - ldr r0, =0x00002e28 - adds r5, r4, r0 - ldrb r0, [r5, 0x1] - cmp r0, 0 - bne _08120410 - bl sub_81204DC -_08120410: - ldrb r0, [r5, 0x1] - lsls r0, 1 - ldr r1, =0x00002e2c - adds r6, r4, r1 - adds r0, r6, r0 - ldrh r1, [r0] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _08120480 - bl GenerateRandomNumber - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0x7 - ands r4, r0 - ldr r0, =0x02021fc4 - ldrb r1, [r5, 0x1] - lsls r1, 1 - adds r1, r6, r1 - ldrh r1, [r1] - bl CopyEasyChatWord - adds r2, r0, 0 - ldr r1, =gUnknown_082942FD - bl CopyString - adds r2, r0, 0 - ldr r0, =gUnknown_0859EFF0 - lsls r4, 2 - adds r4, r0 - ldr r1, [r4] - adds r0, r2, 0 - bl CopyString - adds r2, r0, 0 - ldr r1, =gUnknown_08294301 - bl CopyString - b _081204A2 - .pool -_08120480: - ldr r0, =0x02021fc4 - ldr r3, =gUnknown_0859F010 - ldrb r2, [r5, 0x2] - adds r1, r2, 0x1 - strb r1, [r5, 0x2] - lsls r2, 24 - lsrs r2, 24 - movs r6, 0xB9 - lsls r6, 6 - adds r1, r4, r6 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl CopyString -_081204A2: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _081204C4 - movs r0, 0xA - b _081204C8 - .pool -_081204C4: - ldrb r0, [r5, 0x1] - adds r0, 0x1 -_081204C8: - strb r0, [r5, 0x1] - ldr r1, =0x020375f0 - movs r0, 0x1 - strh r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81203FC - - thumb_func_start sub_81204DC -sub_81204DC: @ 81204DC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - ldr r0, =0x03005d8c - ldr r4, [r0] - ldr r0, =0x00002e28 - adds r0, r4, r0 - str r0, [sp, 0x18] - ldr r1, =gUnknown_0859F030 - mov r0, sp - movs r2, 0x18 - bl memcpy - movs r5, 0 - movs r1, 0x2 - add r1, sp - mov r8, r1 - movs r2, 0xB9 - lsls r2, 6 - adds r3, r4, r2 - adds r1, r3, 0 -_0812050C: - adds r0, r3, r5 - strb r5, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x7 - bls _0812050C - movs r5, 0 - ldr r3, [sp, 0x18] - adds r3, 0x4 - mov r9, r3 - adds r6, r1, 0 -_08120524: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r4, r5, 0x1 - adds r1, r4, 0 - bl __modsi3 - lsls r0, 16 - lsrs r1, r0, 16 - adds r2, r6, r5 - ldrb r7, [r2] - adds r1, r6, r1 - ldrb r0, [r1] - strb r0, [r2] - strb r7, [r1] - lsls r4, 16 - lsrs r5, r4, 16 - cmp r5, 0x7 - bls _08120524 - movs r0, 0 - mov r10, r0 - movs r5, 0 -_08120552: - lsls r4, r5, 2 - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] - bl start_menu_is_selected_item_valid - add r4, r8 - strh r0, [r4] - add r0, r10 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x5 - bls _08120552 - movs r0, 0 - ldr r2, [sp, 0x18] - strb r0, [r2, 0x2] - movs r7, 0 - movs r5, 0 -_0812057E: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x2 - bhi _081205BC - cmp r7, 0x7 - bhi _081205BC - lsls r0, r5, 1 - add r0, r9 - ldr r1, =0x0000ffff - strh r1, [r0] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - adds r4, r5, 0x1 - b _0812060E - .pool -_081205BC: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - mov r1, r10 - bl __umodsi3 - lsls r0, 16 - lsrs r2, r0, 16 - movs r1, 0 - adds r4, r5, 0x1 - lsls r6, r5, 1 - cmp r5, 0x5 - bhi _081205F8 - mov r3, r8 - ldrh r0, [r3] - b _081205EE -_081205DE: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r5, 0x5 - bhi _081205F8 - lsls r0, r1, 2 - adds r0, r3, r0 - ldrh r0, [r0] -_081205EE: - subs r0, r2, r0 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r0, 0 - bgt _081205DE -_081205F8: - cmp r1, 0x6 - bne _081205FE - movs r1, 0 -_081205FE: - lsls r0, r1, 2 - add r0, sp - ldrh r0, [r0] - bl sub_811EE90 - mov r2, r9 - adds r1, r2, r6 - strh r0, [r1] -_0812060E: - lsls r0, r4, 16 - lsrs r5, r0, 16 - cmp r5, 0x9 - bls _0812057E - 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_81204DC - - thumb_func_start sub_8120628 -sub_8120628: @ 8120628 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002e51 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_8120628 - - thumb_func_start sub_8120640 -sub_8120640: @ 8120640 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002e28 - adds r0, r1 - movs r1, 0 - strb r1, [r0, 0x1] - bx lr - .pool - thumb_func_end sub_8120640 - - thumb_func_start sub_8120658 -sub_8120658: @ 8120658 - push {lr} - bl sub_8133A60 - pop {r0} - bx r0 - thumb_func_end sub_8120658 - - thumb_func_start sub_8120664 -sub_8120664: @ 8120664 - push {lr} - bl sub_8120E50 - pop {r0} - bx r0 - thumb_func_end sub_8120664 - - thumb_func_start sub_8120670 -sub_8120670: @ 8120670 - push {lr} - bl sub_81201C8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bhi _081206B6 - lsls r0, 2 - ldr r1, =_0812068C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0812068C: - .4byte _081206A0 - .4byte _081206A6 - .4byte _081206B2 - .4byte _081206AC - .4byte _081206B6 -_081206A0: - bl sub_8120628 - b _081206B6 -_081206A6: - bl sub_8120640 - b _081206B6 -_081206AC: - bl sub_8120664 - b _081206B6 -_081206B2: - bl sub_8120658 -_081206B6: - bl sub_8120B5C - pop {r0} - bx r0 - thumb_func_end sub_8120670 - - thumb_func_start sub_81206C0 -sub_81206C0: @ 81206C0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =sub_8120944 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x12] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81206C0 - - thumb_func_start sub_81206F0 -sub_81206F0: @ 81206F0 - ldr r1, =0x03002f84 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_81206F0 - - thumb_func_start sub_81206FC -sub_81206FC: @ 81206FC - ldr r1, =0x03002f84 - movs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_81206FC - - thumb_func_start sub_8120708 -sub_8120708: @ 8120708 - push {r4,r5,lr} - sub sp, 0xC - adds r5, r0, 0 - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - ldr r0, =sub_81206FC - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0 - bl Print - ldr r0, =0x03002f84 - strb r4, [r0] - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8120708 - - thumb_func_start sub_8120748 -sub_8120748: @ 8120748 - push {r4-r6,lr} - adds r6, r1, 0 - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0x5 - bls _08120756 - b _08120938 -_08120756: - lsls r0, 2 - ldr r1, =_08120764 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08120764: - .4byte _0812077C - .4byte _08120938 - .4byte _081207BC - .4byte _081207F8 - .4byte _081207F8 - .4byte _08120938 -_0812077C: - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r0, =0x020375e0 - ldrh r0, [r0] - ldr r3, =0x00002e36 - adds r1, r2, r3 - cmp r0, 0 - bne _08120790 - ldr r0, =0x00002e2a - adds r1, r2, r0 -_08120790: - adds r2, r1, 0 - adds r1, r6, 0 - adds r1, 0xC - movs r3, 0x5 -_08120798: - ldrh r0, [r2] - strh r0, [r1] - adds r2, 0x2 - adds r1, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _08120798 - movs r0, 0 - strb r0, [r6] - b _08120938 - .pool -_081207BC: - ldrb r1, [r6] - lsls r1, 1 - adds r0, r6, 0 - adds r0, 0xC - adds r0, r1 - ldrh r4, [r0] - adds r0, r4, 0 - bl sub_817C7F4 - str r0, [r6, 0x30] - movs r1, 0x3 - ands r1, r4 - lsrs r4, 3 - movs r0, 0x1 - ands r4, r0 - adds r1, r4 - adds r0, r6, 0 - bl sub_817C858 - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] - ldr r0, [r6, 0x30] - ldrb r0, [r0] - cmp r0, 0xFF - beq _081207F4 - movs r0, 0 - b _08120936 -_081207F4: - movs r0, 0x3 - b _0812091A -_081207F8: - ldrb r3, [r6, 0x1] - lsls r1, r3, 3 - ldr r0, [r6, 0x30] - adds r2, r0, r1 - ldrb r1, [r6, 0x3] - cmp r1, 0x1 - beq _081208A0 - cmp r1, 0x1 - bgt _08120810 - cmp r1, 0 - beq _0812081C - b _08120938 -_08120810: - cmp r1, 0x2 - beq _08120850 - cmp r1, 0x3 - bne _0812081A - b _08120922 -_0812081A: - b _08120938 -_0812081C: - lsls r0, r3, 2 - adds r0, r6, r0 - ldrh r0, [r0, 0x18] - strb r0, [r6, 0x2] - ldrb r0, [r2] - cmp r0, 0x32 - bhi _08120844 - movs r1, 0x3 - bl __udivsi3 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 1 - adds r0, r1 - movs r1, 0x8C - lsls r1, 2 - adds r0, r1 - bl m4aSongNumStart -_08120844: - movs r0, 0x2 - strb r0, [r6, 0x3] - ldrb r0, [r6, 0x2] - subs r0, 0x1 - strb r0, [r6, 0x2] - b _08120938 -_08120850: - movs r0, 0x1 - strb r0, [r6, 0x3] - ldrb r0, [r2] - cmp r0, 0x32 - bhi _08120938 - movs r3, 0x4 - ldrsh r0, [r2, r3] - lsls r0, 4 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - strh r0, [r6, 0x6] - ldr r4, =0x03007630 - ldr r5, =0x0000ffff - ldrh r2, [r6, 0x6] - adds r0, r4, 0 - adds r1, r5, 0 - bl MPlayVolumeControl - ldrb r1, [r6, 0x1] - lsls r1, 2 - adds r1, r6, r1 - movs r2, 0x80 - lsls r2, 2 - adds r0, r2, 0 - ldrh r1, [r1, 0x1A] - adds r0, r1 - strh r0, [r6, 0x8] - movs r3, 0x8 - ldrsh r2, [r6, r3] - adds r0, r4, 0 - adds r1, r5, 0 - bl MPlayPitchControl - b _08120938 - .pool -_081208A0: - ldrh r2, [r6, 0xA] - movs r3, 0xA - ldrsh r0, [r6, r3] - cmp r0, 0xA - ble _081208B0 - ldrh r0, [r6, 0x6] - subs r0, 0x2 - strh r0, [r6, 0x6] -_081208B0: - ands r1, r2 - cmp r1, 0 - beq _081208BC - ldrh r0, [r6, 0x8] - adds r0, 0x40 - b _081208C0 -_081208BC: - ldrh r0, [r6, 0x8] - subs r0, 0x40 -_081208C0: - strh r0, [r6, 0x8] - ldr r4, =0x03007630 - ldr r5, =0x0000ffff - ldrh r2, [r6, 0x6] - adds r0, r4, 0 - adds r1, r5, 0 - bl MPlayVolumeControl - movs r0, 0x8 - ldrsh r2, [r6, r0] - adds r0, r4, 0 - adds r1, r5, 0 - bl MPlayPitchControl - ldrh r0, [r6, 0xA] - adds r0, 0x1 - strh r0, [r6, 0xA] - ldrb r0, [r6, 0x2] - subs r0, 0x1 - strb r0, [r6, 0x2] - lsls r0, 24 - cmp r0, 0 - bne _08120938 - ldrb r0, [r6, 0x1] - adds r0, 0x1 - strb r0, [r6, 0x1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6 - beq _08120918 - ldrb r0, [r6, 0x1] - ldr r1, [r6, 0x30] - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0xFF - beq _08120918 - movs r0, 0 - b _08120936 - .pool -_08120918: - movs r0, 0x3 -_0812091A: - strb r0, [r6, 0x3] - movs r0, 0x2 - strb r0, [r6, 0x2] - b _08120938 -_08120922: - ldrb r0, [r6, 0x2] - subs r0, 0x1 - strb r0, [r6, 0x2] - lsls r0, 24 - cmp r0, 0 - bne _08120938 - ldr r0, =0x03007630 - bl MPlayStop_rev01 - movs r0, 0x4 -_08120936: - strb r0, [r6, 0x3] -_08120938: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8120748 - - thumb_func_start sub_8120944 -sub_8120944: @ 8120944 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r5, r0, r1 - ldr r1, =0x03006130 - adds r0, r5, 0 - bl sub_8120748 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x5 - bls _08120966 - b _08120B50 -_08120966: - lsls r0, 2 - ldr r1, =_0812097C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0812097C: - .4byte _08120994 - .4byte _081209B8 - .4byte _081209C8 - .4byte _08120A7E - .4byte _08120B40 - .4byte _08120A6E -_08120994: - bl sub_8120280 - ldr r0, =0x02021fc4 - bl sub_8120708 - movs r0, 0 - strh r0, [r5, 0xA] - strh r0, [r5, 0xC] - strh r0, [r5, 0xE] - strh r0, [r5, 0x10] - movs r0, 0x4 - bl sub_80A31E8 - movs r0, 0x1 - b _08120B4E - .pool -_081209B8: - bl sub_80A3200 - lsls r0, 24 - cmp r0, 0 - bne _081209C4 - b _08120B50 -_081209C4: - movs r0, 0x2 - b _08120B4E -_081209C8: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00002e28 - adds r4, r0, r2 - movs r0, 0xE - ldrsh r1, [r5, r0] - ldr r0, =0x02021fc4 - adds r1, r0 - movs r3, 0 - ldrb r0, [r1] - ldr r7, =0x03006130 - ldrh r2, [r5, 0x12] - ldr r6, =0x0203a128 - b _08120A02 - .pool -_081209F8: - adds r1, 0x1 - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - ldrb r0, [r1] -_08120A02: - cmp r0, 0 - beq _08120A12 - cmp r0, 0xFE - beq _08120A12 - cmp r0, 0xFC - beq _08120A12 - cmp r0, 0xFF - bne _081209F8 -_08120A12: - cmp r2, 0 - bne _08120A20 - movs r2, 0x10 - ldrsh r1, [r5, r2] - lsls r1, 1 - adds r0, r4, 0x2 - b _08120A2A -_08120A20: - movs r0, 0x10 - ldrsh r1, [r5, r0] - lsls r1, 1 - adds r0, r4, 0 - adds r0, 0xE -_08120A2A: - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x3 - ands r1, r0 - lsrs r0, 3 - movs r2, 0x1 - ands r0, r2 - adds r1, r0 - strh r1, [r6] - movs r1, 0x4 - ldrsh r0, [r7, r1] - adds r1, r3, 0 - bl __divsi3 - movs r1, 0 - strh r0, [r7, 0x4] - lsls r0, 16 - cmp r0, 0 - bgt _08120A54 - movs r0, 0x1 - strh r0, [r7, 0x4] -_08120A54: - ldrh r0, [r5, 0x10] - adds r0, 0x1 - strh r0, [r5, 0x10] - movs r2, 0xC - ldrsh r0, [r5, r2] - cmp r0, 0 - bne _08120A66 - movs r0, 0x3 - b _08120A68 -_08120A66: - movs r0, 0x5 -_08120A68: - strh r0, [r5, 0x8] - strh r1, [r5, 0xA] - b _08120B50 -_08120A6E: - ldrh r1, [r5, 0xC] - movs r2, 0xC - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _08120B4C - subs r0, r1, 0x1 - strh r0, [r5, 0xC] - b _08120B50 -_08120A7E: - ldr r1, =0x02021fc4 - movs r2, 0xE - ldrsh r0, [r5, r2] - adds r0, r1 - ldrb r4, [r0] - cmp r4, 0xFF - bne _08120AB0 - movs r0, 0x6 - bl sub_80A3228 - ldr r0, =0x03007630 - movs r1, 0x2 - bl sub_82E0308 - bl script_env_2_enable_and_set_ctx_running - adds r0, r6, 0 - bl DestroyTask - b _08120B50 - .pool -_08120AB0: - cmp r4, 0 - bne _08120AC6 - bl sub_81206F0 - ldrh r0, [r5, 0xE] - adds r0, 0x1 - strh r0, [r5, 0xE] - movs r0, 0x2 - strh r0, [r5, 0x8] - strh r4, [r5, 0xC] - b _08120B50 -_08120AC6: - cmp r4, 0xFE - bne _08120ADA - ldrh r0, [r5, 0xE] - adds r0, 0x1 - movs r1, 0 - strh r0, [r5, 0xE] - movs r0, 0x2 - strh r0, [r5, 0x8] - strh r1, [r5, 0xC] - b _08120B50 -_08120ADA: - cmp r4, 0xFC - bne _08120AEE - ldrh r0, [r5, 0xE] - adds r0, 0x2 - strh r0, [r5, 0xE] - movs r0, 0x2 - strh r0, [r5, 0x8] - movs r0, 0x8 - strh r0, [r5, 0xC] - b _08120B50 -_08120AEE: - cmp r4, 0x37 - bne _08120B04 - movs r4, 0 - strb r4, [r0] - bl sub_81206F0 - ldrh r0, [r5, 0xE] - adds r0, 0x1 - strh r0, [r5, 0xE] - strh r4, [r5, 0xC] - b _08120B50 -_08120B04: - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _08120B20 - cmp r0, 0x1 - bgt _08120B16 - cmp r0, 0 - beq _08120B1C - b _08120B50 -_08120B16: - cmp r0, 0x2 - beq _08120B28 - b _08120B50 -_08120B1C: - bl sub_81206F0 -_08120B20: - ldrh r0, [r5, 0xA] - adds r0, 0x1 - strh r0, [r5, 0xA] - b _08120B50 -_08120B28: - ldrh r0, [r5, 0xE] - adds r0, 0x1 - movs r1, 0 - strh r0, [r5, 0xE] - strh r1, [r5, 0xA] - ldr r0, =0x03006130 - ldrh r0, [r0, 0x4] - strh r0, [r5, 0xC] - movs r0, 0x4 - b _08120B4E - .pool -_08120B40: - ldrh r0, [r5, 0xC] - subs r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _08120B50 -_08120B4C: - movs r0, 0x3 -_08120B4E: - strh r0, [r5, 0x8] -_08120B50: - bl sub_8197224 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8120944 - - thumb_func_start sub_8120B5C -sub_8120B5C: @ 8120B5C - push {lr} - ldr r0, =0x00004010 - movs r1, 0x45 - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_8120B5C - - thumb_func_start sub_8120B70 -sub_8120B70: @ 8120B70 - push {r4-r7,lr} - sub sp, 0x8 - ldrb r1, [r0] - cmp r1, 0x2 - beq _08120B80 - cmp r1, 0x3 - beq _08120BA6 - b _08120C00 -_08120B80: - adds r5, r0, 0 - movs r4, 0 -_08120B84: - adds r0, r5, 0 - adds r0, 0x32 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08120B9E - movs r0, 0xB - muls r0, r4 - adds r0, 0x5 - adds r0, r5, r0 - movs r1, 0x1 - bl StopMusicWhileStringIsPrinted -_08120B9E: - adds r4, 0x1 - cmp r4, 0x3 - ble _08120B84 - b _08120C00 -_08120BA6: - adds r6, r0, 0 - movs r4, 0 - mov r7, sp - adds r5, r6, 0 - adds r5, 0x8 -_08120BB0: - adds r0, r6, 0x4 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _08120BF8 - mov r0, sp - adds r1, r5, 0 - movs r2, 0x7 - bl memcpy - movs r0, 0xFF - strb r0, [r7, 0x7] - mov r0, sp - bl sub_8009228 - cmp r0, 0 - beq _08120BF8 - mov r0, sp - movs r1, 0 - movs r2, 0x8 - bl memset - mov r0, sp - ldr r1, =gUnknown_085EDFB0 - bl CopyString - adds r0, r5, 0 - mov r1, sp - movs r2, 0x7 - bl memcpy - adds r0, r6, 0 - adds r0, 0x34 - adds r0, r4 - movs r1, 0x2 - strb r1, [r0] -_08120BF8: - adds r5, 0x7 - adds r4, 0x1 - cmp r4, 0x3 - ble _08120BB0 -_08120C00: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8120B70 - - thumb_func_start sub_8120C0C -sub_8120C0C: @ 8120C0C - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - mov r8, r1 - adds r7, r2, 0 - ldrb r0, [r5] - cmp r0, 0x4 - bhi _08120CC4 - lsls r0, 2 - ldr r1, =_08120C2C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08120C2C: - .4byte _08120C92 - .4byte _08120CA2 - .4byte _08120C40 - .4byte _08120C6A - .4byte _08120CB0 -_08120C40: - adds r6, r5, 0 - movs r5, 0 - adds r4, r6, 0 - adds r4, 0x32 -_08120C48: - movs r0, 0xB - muls r0, r5 - adds r0, 0x5 - adds r0, r6, r0 - bl sub_8009228 - cmp r0, 0 - beq _08120C5E - mov r0, r8 - strb r0, [r4] - b _08120C60 -_08120C5E: - strb r7, [r4] -_08120C60: - adds r4, 0x1 - adds r5, 0x1 - cmp r5, 0x3 - ble _08120C48 - b _08120CC4 -_08120C6A: - adds r4, r5, 0 - adds r4, 0x34 - adds r6, r5, 0 - adds r6, 0x8 - movs r5, 0x3 -_08120C74: - adds r0, r6, 0 - bl sub_8009228 - cmp r0, 0 - beq _08120C84 - mov r1, r8 - strb r1, [r4] - b _08120C86 -_08120C84: - strb r7, [r4] -_08120C86: - adds r4, 0x1 - adds r6, 0x7 - subs r5, 0x1 - cmp r5, 0 - bge _08120C74 - b _08120CC4 -_08120C92: - cmp r3, 0x1 - bne _08120C9C - adds r0, r5, 0 - adds r0, 0x2A - b _08120CB8 -_08120C9C: - adds r0, r5, 0 - adds r0, 0x2A - b _08120CC2 -_08120CA2: - cmp r3, 0x1 - bne _08120CAC - mov r0, r8 - strb r0, [r5, 0x2] - b _08120CC4 -_08120CAC: - strb r7, [r5, 0x2] - b _08120CC4 -_08120CB0: - cmp r3, 0x1 - bne _08120CBE - adds r0, r5, 0 - adds r0, 0x20 -_08120CB8: - mov r1, r8 - strb r1, [r0] - b _08120CC4 -_08120CBE: - adds r0, r5, 0 - adds r0, 0x20 -_08120CC2: - strb r7, [r0] -_08120CC4: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8120C0C - - thumb_func_start sub_8120CD0 -sub_8120CD0: @ 8120CD0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r1, r0, 0 - ldrb r0, [r1] - cmp r0, 0x3 - bne _08120D28 - cmp r2, 0x1 - bne _08120D28 - adds r7, r1, 0 - movs r6, 0 - mov r8, sp - adds r4, r7, 0 - adds r4, 0x34 - adds r5, r7, 0 - adds r5, 0x8 -_08120CF2: - adds r0, r7, 0x4 - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0 - beq _08120D1E - mov r0, sp - adds r1, r5, 0 - movs r2, 0x7 - bl memcpy - movs r0, 0xFF - mov r1, r8 - strb r0, [r1, 0x7] - mov r0, sp - bl sub_8009228 - cmp r0, 0 - beq _08120D1A - movs r0, 0x1 - b _08120D1C -_08120D1A: - movs r0, 0x2 -_08120D1C: - strb r0, [r4] -_08120D1E: - adds r4, 0x1 - adds r5, 0x7 - adds r6, 0x1 - cmp r6, 0x3 - ble _08120CF2 -_08120D28: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8120CD0 - - thumb_func_start sub_8120D34 -sub_8120D34: @ 8120D34 - push {r4-r7,lr} - adds r3, r0, 0 - adds r6, r2, 0 - movs r2, 0 - subs r1, 0x1 - cmp r1, 0x1 - bhi _08120D44 - movs r2, 0x1 -_08120D44: - ldrb r0, [r3] - cmp r0, 0x4 - bhi _08120E02 - lsls r0, 2 - ldr r1, =_08120D58 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08120D58: - .4byte _08120DE6 - .4byte _08120DF0 - .4byte _08120D6C - .4byte _08120DC6 - .4byte _08120DF8 -_08120D6C: - adds r7, r3, 0 - cmp r2, 0 - beq _08120DA4 - movs r5, 0 - adds r4, r3, 0 - adds r4, 0x32 -_08120D78: - movs r0, 0xB - muls r0, r5 - adds r0, 0x5 - adds r1, r7, r0 - ldrb r0, [r1] - cmp r0, 0xFC - bne _08120D98 - ldrb r0, [r1, 0x1] - cmp r0, 0x15 - bne _08120D98 - adds r0, r1, 0 - bl StripExtendedControlCodes - movs r0, 0x1 - strb r0, [r4] - b _08120D9A -_08120D98: - strb r6, [r4] -_08120D9A: - adds r4, 0x1 - adds r5, 0x1 - cmp r5, 0x3 - ble _08120D78 - b _08120E02 -_08120DA4: - movs r5, 0 - adds r4, r3, 0 - adds r4, 0x32 -_08120DAA: - adds r0, r4, r5 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08120DBE - movs r0, 0xB - muls r0, r5 - adds r0, 0x5 - adds r0, r7, r0 - bl StripExtendedControlCodes -_08120DBE: - adds r5, 0x1 - cmp r5, 0x3 - ble _08120DAA - b _08120E02 -_08120DC6: - cmp r2, 0 - beq _08120E02 - movs r1, 0 - adds r4, r3, 0x4 - adds r2, r3, 0 - adds r2, 0x34 -_08120DD2: - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _08120DDE - adds r0, r2, r1 - strb r6, [r0] -_08120DDE: - adds r1, 0x1 - cmp r1, 0x3 - ble _08120DD2 - b _08120E02 -_08120DE6: - cmp r2, 0 - beq _08120E02 - adds r0, r3, 0 - adds r0, 0x2A - b _08120E00 -_08120DF0: - cmp r2, 0 - beq _08120E02 - strb r6, [r3, 0x2] - b _08120E02 -_08120DF8: - cmp r2, 0 - beq _08120E02 - adds r0, r3, 0 - adds r0, 0x20 -_08120E00: - strb r6, [r0] -_08120E02: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8120D34 - - thumb_func_start sub_8120E08 -sub_8120E08: @ 8120E08 - push {r4,r5,lr} - ldr r2, =0x0203a12c - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002e28 - adds r0, r1 - str r0, [r2] - movs r3, 0 - movs r1, 0x3 - strb r1, [r0] - ldr r0, [r2] - strb r3, [r0, 0x1] - movs r5, 0 - movs r4, 0xFF -_08120E24: - ldr r0, [r2] - adds r0, 0x4 - adds r0, r3 - strb r5, [r0] - ldr r1, [r2] - adds r1, 0x8 - adds r1, r3 - ldrb r0, [r1] - orrs r0, r4 - strb r0, [r1] - adds r3, 0x1 - cmp r3, 0x3 - ble _08120E24 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8120E08 - - thumb_func_start sub_8120E50 -sub_8120E50: @ 8120E50 - ldr r3, =0x0203a12c - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002e28 - adds r0, r1 - str r0, [r3] - movs r2, 0 - movs r1, 0x3 - strb r1, [r0] - ldr r0, [r3] - strb r2, [r0, 0x1] - bx lr - .pool - thumb_func_end sub_8120E50 - - thumb_func_start sub_8120E74 -sub_8120E74: @ 8120E74 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x32 - bne _08120E80 - movs r0, 0 -_08120E80: - bl sub_80847F8 - pop {r1} - bx r1 - thumb_func_end sub_8120E74 - - thumb_func_start sub_8120E88 -sub_8120E88: @ 8120E88 - push {lr} - adds r3, r0, 0 - movs r2, 0 - ldr r1, =gUnknown_0859F048 -_08120E90: - ldrb r0, [r1] - cmp r0, r3 - bne _08120EA0 - adds r0, r1, 0 - b _08120EAA - .pool -_08120EA0: - adds r1, 0x10 - adds r2, 0x1 - cmp r2, 0x23 - ble _08120E90 - ldr r0, =gUnknown_0859F278 -_08120EAA: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8120E88 - - thumb_func_start sub_8120EB4 -sub_8120EB4: @ 8120EB4 - push {lr} - bl sub_8120E88 - ldr r0, [r0, 0x4] - pop {r1} - bx r1 - thumb_func_end sub_8120EB4 - - thumb_func_start sub_8120EC0 -sub_8120EC0: @ 8120EC0 - push {lr} - bl sub_8120E88 - ldr r0, [r0, 0xC] - pop {r1} - bx r1 - thumb_func_end sub_8120EC0 - - thumb_func_start sub_8120ECC -sub_8120ECC: @ 8120ECC - push {lr} - bl sub_8120E88 - ldr r0, [r0, 0x8] - pop {r1} - bx r1 - thumb_func_end sub_8120ECC - - thumb_func_start sub_8120ED8 -sub_8120ED8: @ 8120ED8 - push {lr} - movs r1, 0 - ldr r2, =0x0203a12c - ldr r0, [r2] - ldrb r0, [r0, 0x4] - cmp r0, 0 - beq _08120EFC -_08120EE6: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x3 - bhi _08120EFC - ldr r0, [r2] - adds r0, 0x4 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _08120EE6 -_08120EFC: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8120ED8 - - thumb_func_start sub_8120F08 -sub_8120F08: @ 8120F08 - ldr r1, =0x0203a12c - lsls r0, 2 - adds r0, 0x24 - ldr r2, [r1] - adds r2, r0 - ldrb r0, [r2] - ldrb r1, [r2, 0x1] - lsls r1, 8 - orrs r0, r1 - ldrb r1, [r2, 0x2] - lsls r1, 16 - orrs r0, r1 - ldrb r1, [r2, 0x3] - lsls r1, 24 - orrs r0, r1 - bx lr - .pool - thumb_func_end sub_8120F08 - - thumb_func_start sub_8120F2C -sub_8120F2C: @ 8120F2C - ldr r2, =0x0203a12c - lsls r0, 2 - adds r0, 0x24 - ldr r2, [r2] - adds r2, r0 - strb r1, [r2] - lsrs r0, r1, 8 - strb r0, [r2, 0x1] - lsrs r0, r1, 16 - strb r0, [r2, 0x2] - lsrs r1, 24 - strb r1, [r2, 0x3] - bx lr - .pool - thumb_func_end sub_8120F2C - - thumb_func_start sub_8120F4C -sub_8120F4C: @ 8120F4C - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x0203a12c - ldr r0, [r0] - adds r0, 0x4 - adds r0, r5 - ldrb r0, [r0] - bl sub_8120E74 - adds r4, r0, 0 - adds r0, r5, 0 - bl sub_8120F08 - cmp r4, r0 - bhi _08120F74 - movs r0, 0 - b _08120F76 - .pool -_08120F74: - movs r0, 0x1 -_08120F76: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8120F4C - - thumb_func_start sub_8120F7C -sub_8120F7C: @ 8120F7C - push {r4,r5,lr} - adds r5, r1, 0 - ldr r2, =0x0203a12c - lsls r1, r0, 3 - subs r1, r0 - adds r1, 0x8 - ldr r4, [r2] - adds r4, r1 - adds r0, r5, 0 - movs r1, 0xFF - movs r2, 0x8 - bl memset - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x7 - bl memcpy - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8120F7C - - thumb_func_start sub_8120FAC -sub_8120FAC: @ 8120FAC - push {r4,r5,lr} - adds r5, r1, 0 - ldr r2, =0x0203a12c - lsls r1, r0, 3 - subs r1, r0 - adds r1, 0x8 - ldr r4, [r2] - adds r4, r1 - adds r0, r4, 0 - movs r1, 0xFF - movs r2, 0x7 - bl memset - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x7 - bl memcpy - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8120FAC - - thumb_func_start sub_8120FDC -sub_8120FDC: @ 8120FDC - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - mov r8, r0 - adds r6, r1, 0 - ldr r0, =0x0203a12c - mov r9, r0 - ldr r0, [r0] - adds r0, 0x4 - add r0, r8 - strb r6, [r0] - ldr r0, =0x03005d90 - ldr r1, [r0] - mov r0, r8 - bl sub_8120FAC - lsls r4, r6, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_8120E74 - adds r1, r0, 0 - mov r0, r8 - bl sub_8120F2C - ldr r5, =0x02021cc4 - adds r0, r4, 0 - bl sub_8120E74 - adds r1, r0, 0 - adds r0, r5, 0 - movs r2, 0 - movs r3, 0xA - bl ConvertIntToDecimalString - ldr r4, =0x02021dc4 - adds r0, r6, 0 - bl sub_8120ECC - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - mov r1, r9 - ldr r0, [r1] - adds r0, 0x34 - add r0, r8 - ldr r1, =gUnknown_82E9531 - ldrb r1, [r1] - strb r1, [r0] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8120FDC - - thumb_func_start sub_8121064 -sub_8121064: @ 8121064 - push {r4-r7,lr} - adds r7, r0, 0 - adds r6, r1, 0 - movs r5, 0 - cmp r5, r6 - bge _0812107A -_08121070: - adds r0, r7, r5 - strb r5, [r0] - adds r5, 0x1 - cmp r5, r6 - blt _08121070 -_0812107A: - cmp r6, 0 - ble _081210B0 - adds r5, r6, 0 -_08121080: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - adds r4, r7, r4 - ldrb r2, [r4] - adds r0, r7, r0 - ldrb r1, [r0] - strb r1, [r4] - strb r2, [r0] - subs r5, 0x1 - cmp r5, 0 - bne _08121080 -_081210B0: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8121064 - - thumb_func_start sub_81210B8 -sub_81210B8: @ 81210B8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r7, sp - mov r8, sp - ldr r0, =gUnknown_0859F288 - ldr r0, [r0] - lsls r0, 3 - lsrs r0, 3 - adds r0, 0x3 - lsrs r0, 2 - lsls r0, 2 - mov r1, sp - subs r1, r0 - mov sp, r1 - mov r9, sp - mov r0, sp - movs r1, 0x24 - bl sub_8121064 - movs r5, 0 -_081210E4: - ldr r1, =gUnknown_0859F048 - mov r2, r9 - adds r0, r2, r5 - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r4, [r0] - ldrb r6, [r0, 0x1] - movs r1, 0 - ldr r2, =0x0203a12c - ldr r0, [r2] - ldrb r0, [r0, 0x4] - cmp r0, r4 - beq _08121112 -_08121100: - adds r1, 0x1 - cmp r1, 0x3 - bgt _08121112 - ldr r0, [r2] - adds r0, 0x4 - adds r0, r1 - ldrb r0, [r0] - cmp r0, r4 - bne _08121100 -_08121112: - cmp r1, 0x4 - bne _08121162 - adds r0, r4, 0 - bl sub_8120E74 - cmp r0, r6 - bcc _08121162 - ldr r0, =0x0203a12c - ldr r1, [r0] - movs r0, 0x1 - strb r0, [r1, 0x1] - bl sub_8120ED8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bne _08121150 - ldr r0, =0x03001178 - ldrb r0, [r0] - adds r1, r4, 0 - bl sub_8120FDC - b _0812115E - .pool -_08121150: - bl sub_8120ED8 - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - bl sub_8120FDC -_0812115E: - movs r0, 0x1 - b _0812116A -_08121162: - adds r5, 0x1 - cmp r5, 0x23 - ble _081210E4 - movs r0, 0 -_0812116A: - mov sp, r8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81210B8 - - thumb_func_start sub_8121178 -sub_8121178: @ 8121178 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r5, r0, 0 - ldr r6, =0x0203a12c - ldr r0, [r6] - adds r0, 0x4 - adds r0, r5 - ldrb r0, [r0] - mov r8, r0 - ldr r4, =0x02021cc4 - adds r0, r5, 0 - bl sub_8120F08 - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0 - movs r3, 0xA - bl ConvertIntToDecimalString - ldr r4, =0x02021dc4 - mov r0, r8 - bl sub_8120ECC - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - ldr r4, =0x02021ec4 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8120F7C - ldr r0, [r6] - adds r0, 0x34 - adds r0, r5 - ldrb r1, [r0] - adds r0, r4, 0 - bl StopMusicWhileStringIsPrinted - mov r0, r8 - bl sub_8120EC0 - bl box_related_two__2 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8121178 - - thumb_func_start sub_81211EC -sub_81211EC: @ 81211EC - push {r4,r5,lr} - sub sp, 0xC - ldr r1, =gUnknown_085EB7EA - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - adds r5, r0, 0 - movs r4, 0 - ldr r0, =0x0203a12c - ldr r0, [r0] - ldrb r0, [r0, 0x4] - cmp r0, 0 - beq _08121230 -_08121208: - bl sub_8120EB4 - adds r1, r0, 0 - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - cmp r0, r5 - ble _0812121C - adds r5, r0, 0 -_0812121C: - adds r4, 0x1 - cmp r4, 0x3 - bgt _08121230 - ldr r0, =0x0203a12c - ldr r0, [r0] - adds r0, 0x4 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _08121208 -_08121230: - adds r0, r5, 0 - bl convert_pixel_width_to_tile_width - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8120ED8 - adds r3, r0, 0 - lsls r3, 25 - movs r0, 0x80 - lsls r0, 18 - adds r3, r0 - lsrs r3, 24 - movs r0, 0 - movs r1, 0 - adds r2, r4, 0 - bl CreateWindowFromRect - ldr r1, =0x0203a130 - strb r0, [r1] - ldrb r0, [r1] - movs r1, 0 - bl SetStandardWindowBorderStyle - movs r4, 0 - ldr r0, =0x0203a12c - ldr r0, [r0] - ldrb r0, [r0, 0x4] - cmp r0, 0 - beq _081212AA - movs r5, 0x80 - lsls r5, 17 -_08121272: - bl sub_8120EB4 - adds r2, r0, 0 - ldr r0, =0x0203a130 - ldrb r0, [r0] - lsrs r1, r5, 24 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - movs r0, 0x80 - lsls r0, 21 - adds r5, r0 - adds r4, 0x1 - cmp r4, 0x3 - bgt _081212AA - ldr r0, =0x0203a12c - ldr r0, [r0] - adds r0, 0x4 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _08121272 -_081212AA: - ldr r5, =0x0203a130 - ldrb r0, [r5] - ldr r2, =gUnknown_085EB7EA - lsls r1, r4, 4 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - ldrb r4, [r5] - bl sub_8120ED8 - adds r1, r0, 0 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - movs r2, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - ldrb r0, [r5] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81211EC - - thumb_func_start sub_81212FC -sub_81212FC: @ 81212FC - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r5, [r4, r0] - cmp r5, 0 - beq _08121320 - cmp r5, 0x1 - beq _0812132C - b _08121376 - .pool -_08121320: - bl sub_81211EC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _08121376 -_0812132C: - bl ProcessMenuInput - lsls r0, 24 - asrs r4, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _08121376 - adds r0, 0x1 - cmp r4, r0 - beq _0812134E - bl sub_8120ED8 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _0812135C -_0812134E: - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - b _08121364 - .pool -_0812135C: - ldr r0, =0x020375f0 - strh r5, [r0] - ldr r0, =0x03001178 - strb r4, [r0] -_08121364: - ldr r0, =0x0203a130 - ldrb r0, [r0] - bl sub_80E2A78 - adds r0, r6, 0 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running -_08121376: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81212FC - - thumb_func_start sub_8121388 -sub_8121388: @ 8121388 - push {lr} - ldr r0, =sub_81212FC - movs r1, 0x50 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_8121388 - - thumb_func_start sub_812139C -sub_812139C: @ 812139C - push {lr} - ldr r0, =0x03001178 - ldrb r0, [r0] - bl sub_8121178 - pop {r0} - bx r0 - .pool - thumb_func_end sub_812139C - - thumb_func_start sub_81213B0 -sub_81213B0: @ 81213B0 - push {lr} - ldr r1, =0x0203a12c - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00002e28 - adds r0, r2 - str r0, [r1] - bl sub_8120ED8 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81213B0 - - thumb_func_start sub_81213D8 -sub_81213D8: @ 81213D8 - push {r4,r5,lr} - ldr r2, =0x0203a12c - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r3, =0x00002e28 - adds r0, r1, r3 - str r0, [r2] - ldr r5, =0x03001178 - ldrb r0, [r5] - ldr r2, =0x00002e2c - adds r1, r2 - adds r1, r0 - ldrb r4, [r1] - bl sub_8120F4C - cmp r0, 0x1 - beq _08121414 - movs r0, 0 - b _0812141E - .pool -_08121414: - ldrb r0, [r5] - adds r1, r4, 0 - bl sub_8120FDC - movs r0, 0x1 -_0812141E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81213D8 - - thumb_func_start sub_8121424 -sub_8121424: @ 8121424 - push {lr} - ldr r1, =0x0203a12c - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00002e28 - adds r0, r2 - str r0, [r1] - ldrb r0, [r0, 0x1] - cmp r0, 0 - beq _08121448 - movs r0, 0x1 - b _0812144A - .pool -_08121448: - movs r0, 0 -_0812144A: - pop {r1} - bx r1 - thumb_func_end sub_8121424 - - thumb_func_start sub_8121450 -sub_8121450: @ 8121450 - push {lr} - ldr r1, =0x0203a12c - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00002e28 - adds r0, r2 - str r0, [r1] - bl sub_81210B8 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8121450 - - thumb_func_start sub_8121478 -sub_8121478: @ 8121478 - push {r4-r7,lr} - sub sp, 0x4 - adds r5, r0, 0 - adds r7, r1, 0 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r4, =0x0203a134 - ldr r0, =0x0000222c - bl AllocZeroed - str r0, [r4] - ldr r1, =0x0000021d - adds r0, r1 - movs r1, 0x2 - strb r1, [r0] - ldr r0, [r4] - ldr r2, =0x0000021e - adds r0, r2 - movs r1, 0x1 - strb r1, [r0] - ldr r4, [r4] - movs r3, 0x88 - lsls r3, 2 - adds r1, r4, r3 - ldr r0, =CopyEasyChatWord - str r0, [r1] - movs r0, 0x89 - lsls r0, 2 - adds r1, r4, r0 - ldr r0, =ConvertEasyChatWordsToString - str r0, [r1] - ldrh r1, [r5, 0x20] - adds r0, r1, 0 - subs r0, 0x79 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xB - bhi _081214E8 - subs r1, 0x79 - subs r2, 0x4 - adds r0, r4, r2 - strb r1, [r0] - b _081214F2 - .pool -_081214E8: - ldr r3, =0x0000021a - adds r1, r4, r3 - movs r0, 0 - strb r0, [r1] - movs r6, 0 -_081214F2: - ldr r0, =0x0203a134 - ldr r1, [r0] - ldr r2, =0x0000021e - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _08121504 - cmp r0, 0x1 - beq _0812152C -_08121504: - movs r3, 0x8A - lsls r3, 2 - adds r2, r1, r3 - subs r3, 0xE - adds r0, r1, r3 - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_0859F3B4 - b _08121540 - .pool -_0812152C: - movs r0, 0x8A - lsls r0, 2 - adds r2, r1, r0 - ldr r3, =0x0000021a - adds r0, r1, r3 - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_0859F458 -_08121540: - adds r0, r1 - str r0, [r2] - ldrh r0, [r5, 0x1E] - mov r1, sp - bl sub_80D45E8 - lsls r0, 16 - ldr r1, =0xffff0000 - adds r0, r1 - movs r1, 0xCD - lsls r1, 17 - cmp r0, r1 - bhi _081215AC - ldr r1, =0x0203a134 - ldr r2, [r1] - ldr r3, =0x0000021a - adds r0, r2, r3 - ldrb r0, [r0] - adds r3, r1, 0 - cmp r0, 0x6 - beq _0812158C - cmp r0, 0x9 - beq _0812159C - ldr r0, =0x0000021b - adds r1, r2, r0 - movs r0, 0 - strb r0, [r1] - b _081215BA - .pool -_0812158C: - ldr r0, =0x0000021b - adds r1, r2, r0 - movs r0, 0x1 - strb r0, [r1] - b _081215BA - .pool -_0812159C: - ldr r0, =0x0000021b - adds r1, r2, r0 - movs r0, 0x2 - strb r0, [r1] - b _081215BA - .pool -_081215AC: - ldr r0, =0x0203a134 - ldr r1, [r0] - ldr r2, =0x0000021b - adds r1, r2 - movs r2, 0 - strb r2, [r1] - adds r3, r0, 0 -_081215BA: - ldr r1, [r3] - movs r3, 0x85 - lsls r3, 2 - adds r0, r1, r3 - str r5, [r0] - movs r2, 0x83 - lsls r2, 2 - adds r0, r1, r2 - str r7, [r0] - adds r3, 0x4 - adds r0, r1, r3 - strb r6, [r0] - ldr r0, =sub_81219F0 - bl SetMainCallback2 - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8121478 - - thumb_func_start sub_81215EC -sub_81215EC: @ 81215EC - push {r4-r6,lr} - sub sp, 0xC - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x12 - bls _08121600 - b _081219E2 -_08121600: - lsls r0, 2 - ldr r1, =_08121614 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08121614: - .4byte _08121660 - .4byte _0812166E - .4byte _08121688 - .4byte _0812168E - .4byte _08121694 - .4byte _0812169A - .4byte _081216F4 - .4byte _08121730 - .4byte _08121740 - .4byte _08121774 - .4byte _08121782 - .4byte _081217D8 - .4byte _081217EC - .4byte _081218B0 - .4byte _081218CC - .4byte _081218EC - .4byte _081218F6 - .4byte _08121910 - .4byte _08121980 -_08121660: - movs r0, 0 - bl SetVBlankCallback - bl remove_some_task - movs r0, 0 - b _081216EC -_0812166E: - add r1, sp, 0x8 - movs r0, 0 - strh r0, [r1] - movs r1, 0xE0 - lsls r1, 19 - ldr r2, =0x01000200 - add r0, sp, 0x8 - bl CpuSet - b _081219D4 - .pool -_08121688: - bl sub_80A1A74 - b _081219D4 -_0812168E: - bl ResetTasks - b _081219D4 -_08121694: - bl ResetAllObjectData - b _081219D4 -_0812169A: - bl ResetObjectPaletteAllocator - bl reset_temp_tile_data_buffers - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1C - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 -_081216EC: - movs r1, 0 - bl SetGpuReg - b _081219D4 -_081216F4: - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0859F290 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r4, =0x0203a134 - ldr r1, [r4] - movs r2, 0x8B - lsls r2, 2 - adds r1, r2 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x0000122c - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - b _081219D4 - .pool -_08121730: - ldr r0, =gUnknown_0859F29C - bl InitWindows - bl DeactivateAllTextPrinters - b _081219D4 - .pool -_08121740: - ldr r2, =gUnknown_0859F2B8 - ldr r0, =0x0203a134 - ldr r0, [r0] - ldr r1, =0x0000021a - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x4 - adds r0, r2 - ldr r1, [r0] - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _081219D4 - .pool -_08121774: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _08121780 - b _081219D4 -_08121780: - b _081219E2 -_08121782: - movs r5, 0x1E - str r5, [sp] - movs r4, 0x14 - str r4, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r5, [sp] - str r4, [sp, 0x4] - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - ldr r2, =gUnknown_0859F2B8 - ldr r0, =0x0203a134 - ldr r0, [r0] - ldr r1, =0x0000021a - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x8 - adds r0, r2 - ldr r1, [r0] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - b _081219D4 - .pool -_081217D8: - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - b _081219D4 -_081217EC: - bl sub_8098C64 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r6, =0x02037714 - ldr r4, =gUnknown_0859F2B8 - ldr r0, =0x0203a134 - ldr r3, [r0] - ldr r2, =0x0000021a - adds r3, r2 - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x10] - subs r2, 0x26 - adds r0, r6, r2 - strh r1, [r0] - ldr r5, =0x02037b14 - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x10] - adds r2, r5, r2 - strh r0, [r2] - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x12] - movs r2, 0xFB - lsls r2, 1 - adds r0, r6, r2 - strh r1, [r0] - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x12] - adds r2, r5, r2 - strh r0, [r2] - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - movs r1, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =gUnknown_0859F2B0 - ldr r0, =0x03005d90 - ldr r2, [r0] - ldrb r0, [r2, 0x8] - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r6, 0x14] - ldrb r0, [r2, 0x8] - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r5, 0x14] - ldrb r0, [r2, 0x8] - lsls r0, 2 - adds r1, 0x2 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r6, 0x16] - ldrb r0, [r2, 0x8] - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r5, 0x16] - b _081219D4 - .pool -_081218B0: - ldr r0, =0x0203a134 - ldr r0, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081218C2 - b _081219D4 -_081218C2: - bl sub_8121A1C - b _081219D4 - .pool -_081218CC: - ldr r0, =0x0203a134 - ldr r0, [r0] - movs r2, 0x86 - lsls r2, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _081218DE - b _081219D4 -_081218DE: - bl sub_8121B1C - bl RunTextPrinters - b _081219D4 - .pool -_081218EC: - bl sub_8087598 - cmp r0, 0x1 - bne _081219D4 - b _081219E2 -_081218F6: - ldr r0, =sub_8121C50 - bl SetVBlankCallback - ldr r2, =0x02037fd4 - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - b _081219D4 - .pool -_08121910: - ldr r5, =0x0203a134 - ldr r0, [r5] - movs r1, 0x85 - lsls r1, 2 - adds r0, r1 - ldr r0, [r0] - ldrh r0, [r0, 0x1E] - bl sub_80D2E84 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, [r5] - ldr r2, =0x0000021b - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08121940 - cmp r0, 0x2 - beq _08121958 - b _081219D4 - .pool -_08121940: - adds r0, r4, 0 - bl sub_80D2F68 - ldr r1, =DummyObjectCallback - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r4, 0 - movs r2, 0x60 - b _0812196A - .pool -_08121958: - adds r0, r4, 0 - bl sub_80D2F68 - ldr r1, =DummyObjectCallback - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r4, 0 - movs r2, 0x28 -_0812196A: - movs r3, 0x80 - bl sub_80D2D78 - ldr r1, [r5] - movs r2, 0x87 - lsls r2, 2 - adds r1, r2 - strb r0, [r1] - b _081219D4 - .pool -_08121980: - 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, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] - ldr r0, =0x0203a134 - ldr r0, [r0] - movs r1, 0x84 - lsls r1, 2 - adds r0, r1 - ldr r1, =sub_8121C98 - str r1, [r0] - movs r0, 0x1 - b _081219E4 - .pool -_081219D4: - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_081219E2: - movs r0, 0 -_081219E4: - add sp, 0xC - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81215EC - - thumb_func_start sub_81219F0 -sub_81219F0: @ 81219F0 - push {lr} -_081219F2: - bl sub_81215EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08121A0C - ldr r0, =sub_8121C64 - bl SetMainCallback2 - b _08121A18 - .pool -_08121A0C: - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081219F2 -_08121A18: - pop {r0} - bx r0 - thumb_func_end sub_81219F0 - - thumb_func_start sub_8121A1C -sub_8121A1C: @ 8121A1C - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r6, 0 - movs r5, 0 - ldr r2, =0x0203a134 - ldr r0, [r2] - movs r1, 0x8A - lsls r1, 2 - adds r0, r1 - ldr r0, [r0] - ldrb r0, [r0] - cmp r5, r0 - bcs _08121A8A - mov r8, r2 - adds r7, r1, 0 -_08121A3C: - lsls r0, r5, 6 - mov r1, r8 - ldr r2, [r1] - adds r0, r2, r0 - movs r3, 0x85 - lsls r3, 2 - adds r1, r2, r3 - lsls r3, r6, 1 - ldr r1, [r1] - adds r1, r3 - adds r2, r7 - ldr r2, [r2] - ldr r2, [r2, 0x8] - lsls r4, r5, 2 - adds r2, r4, r2 - ldr r2, [r2] - lsls r2, 30 - lsrs r2, 30 - movs r3, 0x1 - bl ConvertEasyChatWordsToString - mov r1, r8 - ldr r0, [r1] - adds r0, r7 - ldr r1, [r0] - ldr r0, [r1, 0x8] - adds r4, r0 - ldr r0, [r4] - lsls r0, 30 - lsrs r0, 30 - adds r0, r6, r0 - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldrb r1, [r1] - cmp r5, r1 - bcc _08121A3C -_08121A8A: - ldr r4, =0x0203a134 - ldr r1, [r4] - movs r2, 0x80 - lsls r2, 2 - adds r0, r1, r2 - movs r3, 0x85 - lsls r3, 2 - adds r1, r3 - ldr r1, [r1] - adds r1, 0x12 - bl CopyString - adds r2, r0, 0 - ldr r1, [r4] - ldr r3, =0x0000021e - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _08121AF0 - ldr r1, =gUnknown_085EEA78 - adds r0, r2, 0 - bl CopyString - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 2 - adds r0, r1 - bl GetStringLength - ldr r2, [r4] - movs r3, 0x8A - lsls r3, 2 - adds r1, r2, r3 - ldr r1, [r1] - lsls r0, 16 - lsrs r0, 13 - subs r0, 0x60 - ldrb r1, [r1, 0x2] - subs r1, r0 - ldr r0, =0x00000219 - adds r2, r0 - strb r1, [r2] - b _08121B0C - .pool -_08121AF0: - movs r2, 0x80 - lsls r2, 2 - adds r0, r1, r2 - bl sub_81DB52C - ldr r0, [r4] - movs r3, 0x8A - lsls r3, 2 - adds r1, r0, r3 - ldr r1, [r1] - ldrb r1, [r1, 0x2] - ldr r2, =0x00000219 - adds r0, r2 - strb r1, [r0] -_08121B0C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8121A1C - - thumb_func_start sub_8121B1C -sub_8121B1C: @ 8121B1C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - movs r7, 0 - movs r0, 0 - bl PutWindowTilemap - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r6, 0 - ldr r1, =0x0203a134 - ldr r0, [r1] - movs r2, 0x8A - lsls r2, 2 - mov r10, r2 - add r0, r10 - ldr r0, [r0] - ldrb r0, [r0] - cmp r6, r0 - bcs _08121BCC - mov r9, r1 - mov r8, r10 -_08121B60: - mov r0, r9 - ldr r1, [r0] - lsls r0, r6, 6 - adds r5, r1, r0 - ldrb r0, [r5] - cmp r0, 0xFF - beq _08121BB8 - cmp r0, 0 - beq _08121BB8 - mov r2, r8 - adds r0, r1, r2 - ldr r1, [r0] - ldr r0, [r1, 0x8] - lsls r4, r6, 2 - adds r0, r4, r0 - ldr r2, [r0] - lsls r2, 24 - lsrs r2, 26 - ldrb r0, [r1, 0x4] - adds r2, r0 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r1, 0x3] - adds r3, r7, r3 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gUnknown_0859F2AC - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - bl box_print - mov r1, r9 - ldr r0, [r1] - add r0, r8 - ldr r0, [r0] - ldr r0, [r0, 0x8] - adds r4, r0 - ldrb r0, [r4, 0x1] - adds r0, r7, r0 - lsls r0, 24 - lsrs r7, r0, 24 -_08121BB8: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r2, =0x0203a134 - ldr r0, [r2] - add r0, r10 - ldr r0, [r0] - ldrb r0, [r0] - cmp r6, r0 - bcc _08121B60 -_08121BCC: - ldr r1, =gUnknown_085EEA78 - add r0, sp, 0xC - bl CopyString - ldr r4, =0x0203a134 - ldr r1, [r4] - movs r2, 0x80 - lsls r2, 2 - adds r1, r2 - bl CopyString - ldr r0, [r4] - ldr r1, =0x00000219 - adds r0, r1 - ldrb r2, [r0] - movs r0, 0x1 - add r1, sp, 0xC - bl GetStringCenterAlignXOffset - adds r2, r0, 0 - adds r2, 0x68 - ldr r0, [r4] - movs r1, 0x8A - lsls r1, 2 - adds r0, r1 - ldr r0, [r0] - ldrb r3, [r0, 0x1] - adds r3, 0x58 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gUnknown_0859F2AC - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - bl box_print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram - 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_8121B1C - - thumb_func_start sub_8121C50 -sub_8121C50: @ 8121C50 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_8121C50 - - thumb_func_start sub_8121C64 -sub_8121C64: @ 8121C64 - push {r4,lr} - ldr r4, =0x0203a134 - ldr r0, [r4] - ldr r1, =0x0000021b - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _08121C7C - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad -_08121C7C: - ldr r0, [r4] - movs r1, 0x84 - lsls r1, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8121C64 - - thumb_func_start sub_8121C98 -sub_8121C98: @ 8121C98 - push {lr} - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _08121CB2 - ldr r0, =0x0203a134 - ldr r0, [r0] - movs r1, 0x84 - lsls r1, 2 - adds r0, r1 - ldr r1, =sub_8121CC0 - str r1, [r0] -_08121CB2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8121C98 - - thumb_func_start sub_8121CC0 -sub_8121CC0: @ 8121CC0 - push {lr} - sub sp, 0x4 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08121CEE - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x0203a134 - ldr r0, [r0] - movs r1, 0x84 - lsls r1, 2 - adds r0, r1 - ldr r1, =sub_8121D00 - str r1, [r0] -_08121CEE: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8121CC0 - - thumb_func_start sub_8121D00 -sub_8121D00: @ 8121D00 - push {r4,lr} - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _08121D88 - ldr r4, =0x0203a134 - ldr r0, [r4] - movs r1, 0x83 - lsls r1, 2 - adds r0, r1 - ldr r0, [r0] - bl SetMainCallback2 - ldr r1, [r4] - ldr r2, =0x0000021b - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x2 - bgt _08121D58 - cmp r0, 0x1 - blt _08121D58 - subs r2, 0x7 - adds r0, r1, r2 - ldr r0, [r0] - ldrh r0, [r0, 0x1E] - bl sub_80D2E84 - lsls r0, 16 - lsrs r0, 16 - bl sub_80D2FF0 - ldr r0, [r4] - movs r1, 0x87 - lsls r1, 2 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl sub_80D2EF8 -_08121D58: - ldr r4, =0x0203a134 - ldr r0, [r4] - ldr r2, =0x0000222c - movs r1, 0 - bl memset - bl sub_80A1A74 - movs r0, 0 - bl UnsetBgTilemapBuffer - movs r0, 0x1 - bl UnsetBgTilemapBuffer - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - bl FreeAllWindowBuffers - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] -_08121D88: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8121D00 - - thumb_func_start sub_8121DA0 -sub_8121DA0: @ 8121DA0 - push {r4,lr} - sub sp, 0xC - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0xE - movs r1, 0 - bl SetGpuReg - movs r0, 0xC - movs r1, 0 - bl SetGpuReg - movs r0, 0xA - movs r1, 0 - bl SetGpuReg - movs r0, 0x8 - movs r1, 0 - bl SetGpuReg - mov r1, sp - movs r0, 0 - strh r0, [r1] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x0100c000 - mov r0, sp - bl CpuSet - movs r4, 0 - str r4, [sp, 0x4] - add r0, sp, 0x4 - movs r1, 0xE0 - lsls r1, 19 - ldr r2, =0x05000100 - bl CpuSet - add r0, sp, 0x8 - strh r4, [r0] - movs r1, 0xA0 - lsls r1, 19 - ldr r2, =0x01000200 - bl CpuSet - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8121DA0 - - thumb_func_start sub_8121E10 -sub_8121E10: @ 8121E10 - push {lr} - 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 - pop {r0} - bx r0 - thumb_func_end sub_8121E10 - - thumb_func_start SetVBlankHBlankCallbacksToNull -@ void SetVBlankHBlankCallbacksToNull() -SetVBlankHBlankCallbacksToNull: @ 8121E68 - push {lr} - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - bl SetHBlankCallback - pop {r0} - bx r0 - thumb_func_end SetVBlankHBlankCallbacksToNull - - thumb_func_start DisplayMessageAndContinueTask -@ void DisplayMessageAndContinueTask(u8 taskId, u8 windowId, u16 windowBorderFirstTileNum, u8 windowBorderPalette, u8 fontId, u8 speed, u8 *str, void ( *callback)(u8 taskId)) -DisplayMessageAndContinueTask: @ 8121E7C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - ldr r4, [sp, 0x28] - ldr r5, [sp, 0x2C] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r1, 24 - adds r6, r1, 0 - lsls r2, 16 - lsrs r2, 16 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r7, r4, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =0x0203a140 - strb r6, [r0] - adds r0, r6, 0 - movs r1, 0x1 - bl sub_8197B1C - ldr r4, =0x02021fc4 - ldr r0, [sp, 0x30] - cmp r0, r4 - beq _08121EC0 - adds r0, r4, 0 - ldr r1, [sp, 0x30] - bl ExpandStringRefs -_08121EC0: - ldr r2, =0x03003014 - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] - 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] - adds r0, r6, 0 - adds r1, r7, 0 - adds r2, r4, 0 - adds r3, r5, 0 - bl AddTextPrinterParametrized - ldr r1, =0x0300117c - ldr r0, [sp, 0x34] - str r0, [r1] - ldr r1, =0x03005e00 - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldr r1, =Task_ContinueTaskAfterMessagePrints - str r1, [r0] - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DisplayMessageAndContinueTask - - thumb_func_start sub_8121F20 -sub_8121F20: @ 8121F20 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl RunTextPrinters - adds r0, r4, 0 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r0, 16 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8121F20 - - thumb_func_start Task_ContinueTaskAfterMessagePrints -@ void Task_ContinueTaskAfterMessagePrints(u8 taskId) -Task_ContinueTaskAfterMessagePrints: @ 8121F3C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0203a140 - ldrb r0, [r0] - bl sub_8121F20 - lsls r0, 16 - cmp r0, 0 - bne _08121F5A - ldr r0, =0x0300117c - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 -_08121F5A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end Task_ContinueTaskAfterMessagePrints - - thumb_func_start sub_8121F68 -sub_8121F68: @ 8121F68 - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x0203a138 - ldr r2, [r1, 0x4] - ldr r1, [r1] - str r1, [r3] - str r2, [r3, 0x4] - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =Task_CallYesOrNoCallback - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8121F68 - - thumb_func_start CreateYesNoMenuWithCallbacks -@ void CreateYesNoMenuWithCallbacks(u8 taskId, struct WindowTemplate *windowTemplate, int a3, int a4, int a5, u16 borderFirstTileNum, u8 borderPalette, void ( **callbacks)(u8 taskId)) -CreateYesNoMenuWithCallbacks: @ 8121F94 - push {r4,r5,lr} - adds r4, r0, 0 - adds r0, r1, 0 - ldr r1, [sp, 0x10] - ldr r2, [sp, 0x14] - ldr r5, [sp, 0x18] - lsls r4, 24 - lsrs r4, 24 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 24 - lsrs r2, 24 - movs r3, 0 - bl CreateYesNoMenu - ldr r2, =0x0203a138 - ldr r0, [r5] - ldr r1, [r5, 0x4] - str r0, [r2] - str r1, [r2, 0x4] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =Task_CallYesOrNoCallback - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end CreateYesNoMenuWithCallbacks - - thumb_func_start Task_CallYesOrNoCallback -@ void Task_CallYesOrNoCallback(u8 taskId) -Task_CallYesOrNoCallback: @ 8121FDC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _08122002 - cmp r1, 0 - bgt _08121FFC - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08122018 - b _08122028 -_08121FFC: - cmp r1, 0x1 - beq _08122018 - b _08122028 -_08122002: - movs r0, 0x5 - bl audio_play - ldr r0, =0x0203a138 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - b _08122028 - .pool -_08122018: - movs r0, 0x5 - bl audio_play - ldr r0, =0x0203a138 - ldr r1, [r0, 0x4] - adds r0, r4, 0 - bl _call_via_r1 -_08122028: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end Task_CallYesOrNoCallback - - thumb_func_start AdjustQuantityAccordingToDPadInput -@ bool8 AdjustQuantityAccordingToDPadInput(u16 *quantity, u16 maxQuantity) -AdjustQuantityAccordingToDPadInput: @ 8122034 - push {r4-r6,lr} - adds r2, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r5, r1, 0 - ldrh r4, [r2] - adds r6, r4, 0 - ldr r0, =0x030022c0 - ldrh r0, [r0, 0x30] - movs r3, 0xF0 - ands r3, r0 - cmp r3, 0x40 - bne _0812206C - adds r0, r4, 0x1 - strh r0, [r2] - movs r3, 0 - ldrsh r0, [r2, r3] - cmp r0, r1 - ble _0812205E - movs r0, 0x1 - strh r0, [r2] -_0812205E: - movs r0, 0 - ldrsh r1, [r2, r0] -_08122062: - lsls r0, r4, 16 - b _081220B6 - .pool -_0812206C: - cmp r3, 0x80 - bne _08122082 - subs r0, r4, 0x1 - strh r0, [r2] - lsls r0, 16 - cmp r0, 0 - bgt _0812207C - strh r1, [r2] -_0812207C: - movs r3, 0 - ldrsh r1, [r2, r3] - b _08122062 -_08122082: - cmp r3, 0x10 - bne _0812209C - adds r0, r4, 0 - adds r0, 0xA - strh r0, [r2] - movs r1, 0 - ldrsh r0, [r2, r1] - cmp r0, r5 - ble _08122096 - strh r5, [r2] -_08122096: - movs r3, 0 - ldrsh r1, [r2, r3] - b _08122062 -_0812209C: - cmp r3, 0x20 - bne _081220C6 - adds r0, r4, 0 - subs r0, 0xA - strh r0, [r2] - lsls r0, 16 - cmp r0, 0 - bgt _081220B0 - movs r0, 0x1 - strh r0, [r2] -_081220B0: - movs r0, 0 - ldrsh r1, [r2, r0] - lsls r0, r6, 16 -_081220B6: - asrs r0, 16 - cmp r1, r0 - beq _081220C6 - movs r0, 0x5 - bl audio_play - movs r0, 0x1 - b _081220C8 -_081220C6: - movs r0, 0 -_081220C8: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end AdjustQuantityAccordingToDPadInput - - thumb_func_start GetLRKeysState -GetLRKeysState: @ 81220D0 - push {lr} - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0x1 - bne _08122106 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x80 - lsls r0, 2 - ands r0, r1 - cmp r0, 0 - beq _081220F8 - movs r0, 0x1 - b _08122108 - .pool -_081220F8: - movs r0, 0x80 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - beq _08122106 - movs r0, 0x2 - b _08122108 -_08122106: - movs r0, 0 -_08122108: - pop {r1} - bx r1 - thumb_func_end GetLRKeysState - - thumb_func_start sub_812210C -sub_812210C: @ 812210C - push {lr} - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0x1 - bne _08122142 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x30] - movs r0, 0x80 - lsls r0, 2 - ands r0, r1 - cmp r0, 0 - beq _08122134 - movs r0, 0x1 - b _08122144 - .pool -_08122134: - movs r0, 0x80 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - beq _08122142 - movs r0, 0x2 - b _08122144 -_08122142: - movs r0, 0 -_08122144: - pop {r1} - bx r1 - thumb_func_end sub_812210C - - thumb_func_start sub_8122148 -sub_8122148: @ 8122148 - push {lr} - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xAF - bne _08122174 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - ldr r0, =0x00001919 - cmp r1, r0 - beq _08122166 - bl InUnionRoom - cmp r0, 0x1 - bne _08122174 -_08122166: - movs r0, 0 - b _08122176 - .pool -_08122174: - movs r0, 0x1 -_08122176: - pop {r1} - bx r1 - thumb_func_end sub_8122148 - - thumb_func_start itemid_80BF6D8_mail_related -itemid_80BF6D8_mail_related: @ 812217C - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - bl is_c1_link_related_active - cmp r0, 0x1 - beq _08122192 - bl InUnionRoom - cmp r0, 0x1 - bne _081221A4 -_08122192: - adds r0, r4, 0 - bl itemid_is_mail - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081221A4 - movs r0, 0 - b _081221A6 -_081221A4: - movs r0, 0x1 -_081221A6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end itemid_80BF6D8_mail_related - - thumb_func_start sub_81221AC -sub_81221AC: @ 81221AC - push {lr} - bl is_c1_link_related_active - cmp r0, 0x1 - beq _081221BE - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081221C8 -_081221BE: - movs r0, 0x1 - b _081221CA - .pool -_081221C8: - movs r0, 0 -_081221CA: - pop {r1} - bx r1 - thumb_func_end sub_81221AC - - thumb_func_start sub_81221D0 -sub_81221D0: @ 81221D0 - push {lr} - bl sub_81221AC - lsls r0, 24 - cmp r0, 0 - beq _081221E6 - bl sub_8087598 - lsls r0, 24 - lsrs r0, 24 - b _081221E8 -_081221E6: - movs r0, 0 -_081221E8: - pop {r1} - bx r1 - thumb_func_end sub_81221D0 - - thumb_func_start sub_81221EC -sub_81221EC: @ 81221EC - push {lr} - bl sub_81221D0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08122202 - bl sub_800B504 - cmp r0, 0x1 - bne _08122206 -_08122202: - movs r0, 0x1 - b _08122208 -_08122206: - movs r0, 0 -_08122208: - pop {r1} - bx r1 - thumb_func_end sub_81221EC - - thumb_func_start atk2D_jumpifarraynotequal -atk2D_jumpifarraynotequal: @ 812220C - push {r4-r6,lr} - adds r6, r2, 0 - ldr r2, [sp, 0x10] - lsls r1, 24 - lsls r2, 24 - lsrs r5, r2, 24 - adds r4, r0, 0 - movs r0, 0 - strb r0, [r3] - movs r2, 0 - lsrs r1, 24 - cmp r2, r1 - bcs _08122240 -_08122226: - lsls r0, r2, 2 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0 - beq _08122236 - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] -_08122236: - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, r1 - bcc _08122226 -_08122240: - ldrb r0, [r3] - adds r1, r0, 0x1 - strb r1, [r3] - lsls r0, r1, 24 - lsrs r0, 24 - cmp r0, r5 - bls _08122252 - strb r5, [r6] - b _08122254 -_08122252: - strb r1, [r6] -_08122254: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end atk2D_jumpifarraynotequal - - thumb_func_start sub_812225C -sub_812225C: @ 812225C - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - ldrh r0, [r4] - cmp r0, 0 - beq _0812227A - adds r0, r2 - cmp r0, r3 - ble _0812227A - subs r0, r3, r2 - strh r0, [r4] -_0812227A: - ldrh r0, [r4] - ldrh r1, [r5] - adds r0, r1 - cmp r0, r3 - blt _08122290 - cmp r3, 0 - bne _0812228C - strh r3, [r5] - b _08122290 -_0812228C: - subs r0, r3, 0x1 - strh r0, [r5] -_08122290: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_812225C - - thumb_func_start sub_8122298 -sub_8122298: @ 8122298 - push {r4-r7,lr} - adds r5, r0, 0 - adds r4, r1, 0 - ldr r0, [sp, 0x14] - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r6, r3, 24 - lsls r2, r0, 24 - lsrs r0, r2, 24 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081222F0 - lsrs r2, 25 - ldrh r0, [r4] - cmp r0, r2 - bcc _08122322 - movs r1, 0 - subs r0, r2 - cmp r1, r0 - bge _08122322 - ldrh r0, [r5] - adds r0, r7 - cmp r0, r6 - beq _08122322 -_081222CC: - ldrh r0, [r4] - subs r0, 0x1 - strh r0, [r4] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - ldrh r0, [r4] - subs r0, r2 - cmp r1, r0 - bge _08122322 - ldrh r0, [r5] - adds r0, r7 - cmp r0, r6 - bne _081222CC - b _08122322 -_081222F0: - ldrh r3, [r4] - lsrs r2, 25 - adds r0, r2, 0x1 - cmp r3, r0 - blt _08122322 - movs r1, 0 - subs r0, r3, r2 - b _08122316 -_08122300: - ldrh r0, [r4] - subs r0, 0x1 - strh r0, [r4] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - ldrh r0, [r4] - subs r0, r2 -_08122316: - cmp r1, r0 - bgt _08122322 - ldrh r0, [r5] - adds r0, r7 - cmp r0, r6 - bne _08122300 -_08122322: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8122298 - - thumb_func_start sub_8122328 -sub_8122328: @ 8122328 - push {lr} - ldr r0, =gUnknown_0859F514 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0859F51C - bl LoadCompressedObjectPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_8122328 - - thumb_func_start sub_8122344 -sub_8122344: @ 8122344 - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r0 - lsls r1, 24 - lsrs r6, r1, 24 - movs r5, 0 - cmp r5, r6 - bcs _0812239C - ldr r7, =0x02020630 -_08122358: - lsls r1, r5, 4 - ldr r0, =gUnknown_0859F524 - movs r2, 0 - movs r3, 0 - bl AddObjectToFront - mov r1, r8 - adds r4, r1, r5 - strb r0, [r4] - cmp r5, 0 - beq _0812237E - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - movs r1, 0x1 - bl StartObjectImageAnim -_0812237E: - ldrb r1, [r4] - 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] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r6 - bcc _08122358 -_0812239C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8122344 - - thumb_func_start sub_81223B0 -sub_81223B0: @ 81223B0 - push {r4-r7,lr} - adds r6, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - movs r4, 0 - cmp r4, r5 - bcs _081223F6 - ldr r7, =0x02020630 -_081223C0: - subs r0, r5, 0x1 - cmp r4, r0 - bne _081223DC - adds r0, r6, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - bl RemoveObjectAndFreeResources - b _081223EC - .pool -_081223DC: - adds r0, r6, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - bl RemoveObjectAndFreeTiles -_081223EC: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _081223C0 -_081223F6: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81223B0 - - thumb_func_start sub_81223FC -sub_81223FC: @ 81223FC - push {r4-r7,lr} - adds r6, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - lsls r2, 24 - lsrs r0, r2, 24 - movs r3, 0 - cmp r3, r4 - bcs _0812243E - ldr r1, =0x02020630 - mov r12, r1 - movs r1, 0x1 - ands r0, r1 - lsls r5, r0, 2 - movs r7, 0x5 - negs r7, r7 -_0812241C: - adds r0, r6, r3 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r12 - adds r1, 0x3E - ldrb r2, [r1] - adds r0, r7, 0 - ands r0, r2 - orrs r0, r5 - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r4 - bcc _0812241C -_0812243E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81223FC - - thumb_func_start sub_8122448 -@ void sub_8122448(int a1, u8 a2, u16 x, u16 y) -sub_8122448: @ 8122448 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r6, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - lsls r2, 16 - lsrs r7, r2, 16 - lsls r3, 16 - lsrs r3, 16 - mov r9, r3 - movs r0, 0x80 - ands r0, r4 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r0, 0x7F - ands r4, r0 - movs r3, 0 - cmp r3, r4 - bcs _081224C8 - ldr r5, =0x02020630 - lsls r0, r7, 16 - asrs r0, 16 - subs r0, 0x8 - mov r12, r0 -_0812247E: - subs r0, r4, 0x1 - cmp r3, r0 - bne _081224A0 - mov r0, r8 - cmp r0, 0 - beq _081224A0 - adds r2, r6, r3 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r1, r12 - strh r1, [r0, 0x24] - b _081224AE - .pool -_081224A0: - adds r2, r6, r3 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r7, [r0, 0x24] -_081224AE: - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r1, r9 - adds r1, 0x1 - strh r1, [r0, 0x22] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r4 - bcc _0812247E -_081224C8: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8122448 - - thumb_func_start sub_81224D4 -sub_81224D4: @ 81224D4 - push {r4-r7,lr} - movs r6, 0 - ldr r5, =0x03005d8c -_081224DA: - movs r0, 0xA - bl sub_811EE38 - ldr r1, [r5] - lsls r4, r6, 3 - adds r1, r4 - ldr r2, =0x00002e6c - adds r1, r2 - strh r0, [r1] - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _08122514 - movs r0, 0xC - bl sub_811EE38 - ldr r1, [r5] - adds r1, r4 - ldr r7, =0x00002e6e - adds r1, r7 - b _08122522 - .pool -_08122514: - movs r0, 0xD - bl sub_811EE38 - ldr r1, [r5] - adds r1, r4 - ldr r2, =0x00002e6e - adds r1, r2 -_08122522: - strh r0, [r1] - bl GenerateRandomNumber - ldr r3, [r5] - adds r3, r4 - movs r2, 0x1 - ands r2, r0 - ldr r7, =0x00002e69 - adds r3, r7 - lsls r2, 6 - ldrb r0, [r3] - movs r7, 0x41 - negs r7, r7 - adds r1, r7, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r3] - ldr r0, =0x00002e68 - adds r1, r4, r0 - ldr r0, [r5] - adds r0, r1 - bl sub_8122B28 - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x4 - bls _081224DA - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002e68 - adds r0, r1 - movs r1, 0x5 - movs r2, 0 - bl sub_8122804 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81224D4 - - thumb_func_start sub_8122580 -sub_8122580: @ 8122580 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - bne _08122596 - b _081226BE -_08122596: - lsls r0, r1, 2 - adds r0, r1 - str r0, [sp] - movs r0, 0 - mov r10, r0 - movs r1, 0x7F - mov r9, r1 - movs r2, 0x80 - negs r2, r2 - mov r8, r2 -_081225AA: - ldr r2, [sp] - mov r3, r10 - lsls r0, r3, 3 - ldr r4, =0x00002e68 - adds r0, r4 - ldr r3, =0x03005d8c - ldr r1, [r3] - adds r5, r1, r0 - ldrb r6, [r5, 0x1] - movs r0, 0x40 - ands r0, r6 - cmp r0, 0 - bne _08122608 - ldrb r4, [r5] - lsls r3, r4, 25 - lsrs r1, r3, 25 - lsls r0, r2, 16 - lsrs r0, 16 - cmp r1, r0 - bcc _081225F8 - adds r0, r1, 0 - subs r0, r2 - mov r1, r9 - ands r0, r1 - mov r1, r8 - ands r1, r4 - orrs r1, r0 - strb r1, [r5] - movs r0, 0x7F - ands r1, r0 - cmp r1, 0 - bne _0812269E - movs r0, 0x40 - orrs r0, r6 - b _0812269C - .pool -_081225F8: - lsrs r0, r3, 25 - subs r2, r0 - mov r0, r8 - ands r0, r4 - strb r0, [r5] - movs r0, 0x40 - orrs r0, r6 - strb r0, [r5, 0x1] -_08122608: - ldrb r7, [r5] - lsls r0, r7, 25 - lsrs r0, 25 - adds r4, r0, r2 - ldrh r0, [r5] - lsls r6, r0, 18 - lsls r0, r4, 16 - lsrs r0, 16 - lsrs r1, r6, 25 - cmp r0, r1 - bls _08122678 - adds r0, r4, 0 - bl __umodsi3 - adds r3, r0, 0 - lsrs r1, r6, 25 - adds r0, r4, 0 - str r3, [sp, 0x4] - bl __udivsi3 - adds r4, r0, 0 - movs r0, 0x1 - eors r4, r0 - ands r4, r0 - lsls r2, r4, 6 - ldrb r0, [r5, 0x1] - movs r4, 0x41 - negs r4, r4 - adds r1, r4, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0x1] - movs r1, 0x40 - ands r0, r1 - ldr r3, [sp, 0x4] - cmp r0, 0 - beq _08122662 - adds r1, r3, 0 - mov r0, r9 - ands r1, r0 - mov r0, r8 - ands r0, r7 - orrs r0, r1 - strb r0, [r5] - b _0812269E -_08122662: - ldrh r0, [r5] - lsls r0, 18 - lsrs r0, 25 - subs r0, r3 - mov r1, r9 - ands r0, r1 - mov r1, r8 - ands r1, r7 - orrs r1, r0 - strb r1, [r5] - b _0812269E -_08122678: - mov r2, r9 - ands r4, r2 - mov r0, r8 - ands r0, r7 - orrs r0, r4 - strb r0, [r5] - lsls r0, 25 - ldrh r1, [r5] - lsls r1, 18 - lsrs r0, 25 - lsrs r1, 25 - cmp r0, r1 - bne _0812269E - ldrb r0, [r5, 0x1] - movs r3, 0x41 - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 -_0812269C: - strb r0, [r5, 0x1] -_0812269E: - mov r0, r10 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - cmp r0, 0x4 - bhi _081226AE - b _081225AA -_081226AE: - ldr r4, =0x03005d8c - ldr r0, [r4] - ldr r1, =0x00002e68 - adds r0, r1 - movs r1, 0x5 - movs r2, 0 - bl sub_8122804 -_081226BE: - 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_8122580 - - thumb_func_start sub_81226D8 -sub_81226D8: @ 81226D8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - mov r8, r0 - movs r0, 0 - movs r1, 0 - str r0, [sp] - str r1, [sp, 0x4] - mov r0, r8 - bl sub_8122BB0 - lsls r0, 24 - cmp r0, 0 - beq _081226F8 - b _081227F2 -_081226F8: - ldr r4, =0x00000893 - adds r0, r4, 0 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08122744 - adds r0, r4, 0 - bl FlagSet - ldr r0, =0x00000894 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08122744 - ldr r0, =0x03005d8c - ldr r1, [r0] - mov r0, r8 - ldrh r2, [r0] - ldr r3, =0x00002e6c - adds r0, r1, r3 - strh r2, [r0] - mov r2, r8 - ldrh r0, [r2, 0x2] - adds r3, 0x2 - adds r1, r3 - strh r0, [r1] - movs r0, 0x1 - b _081227F4 - .pool -_08122744: - mov r0, r8 - ldrh r1, [r0, 0x2] - lsls r1, 16 - ldrh r0, [r0] - orrs r0, r1 - str r0, [sp, 0x4] - movs r1, 0x80 - lsls r1, 7 - ldr r0, [sp] - orrs r0, r1 - str r0, [sp] - mov r0, sp - bl sub_8122B28 - movs r5, 0 -_08122762: - ldr r6, =0x03005d8c - lsls r4, r5, 3 - ldr r1, =0x00002e68 - adds r0, r4, r1 - ldr r1, [r6] - adds r1, r0 - mov r0, sp - movs r2, 0 - bl atk90_changetypestoenemyattacktype - lsls r0, 24 - adds r7, r4, 0 - cmp r0, 0 - beq _081227D4 - movs r2, 0x4 - mov r12, r6 - cmp r2, r5 - bls _081227A6 - ldr r4, =0x00002e68 -_08122788: - ldr r0, [r6] - lsls r3, r2, 3 - adds r0, r4 - adds r3, r0, r3 - subs r2, 0x1 - lsls r1, r2, 3 - adds r0, r1 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r3] - str r1, [r3, 0x4] - lsls r2, 16 - lsrs r2, 16 - cmp r2, r5 - bhi _08122788 -_081227A6: - mov r3, r12 - ldr r2, [r3] - ldr r0, =0x00002e68 - adds r2, r0 - adds r2, r7 - ldr r0, [sp] - ldr r1, [sp, 0x4] - str r0, [r2] - str r1, [r2, 0x4] - cmp r5, 0x4 - bne _081227C2 - mov r0, r8 - bl sub_80EDC60 -_081227C2: - movs r0, 0 - cmp r5, 0 - bne _081227F4 - movs r0, 0x1 - b _081227F4 - .pool -_081227D4: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x4 - bls _08122762 - ldr r2, [r6] - ldr r1, =0x00002e88 - adds r2, r1 - ldr r0, [sp] - ldr r1, [sp, 0x4] - str r0, [r2] - str r1, [r2, 0x4] - mov r0, r8 - bl sub_80EDC60 -_081227F2: - movs r0, 0 -_081227F4: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81226D8 - - thumb_func_start sub_8122804 -sub_8122804: @ 8122804 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r9, r0 - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - movs r2, 0 - cmp r2, r7 - bcs _0812286C -_08122820: - adds r1, r2, 0x1 - lsls r0, r1, 16 - lsrs r5, r0, 16 - mov r8, r1 - cmp r5, r7 - bcs _08122862 - lsls r0, r2, 3 - mov r1, r9 - adds r6, r1, r0 -_08122832: - lsls r0, r5, 3 - mov r1, r9 - adds r4, r1, r0 - adds r0, r4, 0 - adds r1, r6, 0 - mov r2, r10 - bl atk90_changetypestoenemyattacktype - lsls r0, 24 - cmp r0, 0 - beq _08122858 - ldr r2, [r4] - ldr r3, [r4, 0x4] - ldr r0, [r6] - ldr r1, [r6, 0x4] - str r0, [r4] - str r1, [r4, 0x4] - str r2, [r6] - str r3, [r6, 0x4] -_08122858: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, r7 - bcc _08122832 -_08122862: - mov r1, r8 - lsls r0, r1, 16 - lsrs r2, r0, 16 - cmp r2, r7 - bcc _08122820 -_0812286C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8122804 - - thumb_func_start sub_812287C -sub_812287C: @ 812287C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r0 - adds r6, r1, 0 - movs r4, 0x80 - lsls r4, 1 - adds r0, r4, 0 - bl Alloc - mov r10, r0 - cmp r0, 0 - beq _08122980 - adds r0, r4, 0 - bl Alloc - adds r7, r0, 0 - cmp r7, 0 - bne _081228B0 - mov r0, r10 - bl Free - b _08122980 -_081228B0: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r5, 0 - cmp r5, r9 - bcs _081228DE -_081228C0: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - add r0, r10 - adds r1, r5, 0 - muls r1, r6 - add r1, r8 - movs r2, 0x28 - bl memcpy - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, r9 - bcc _081228C0 -_081228DE: - mov r4, r10 - mov r8, r7 - movs r3, 0 - movs r5, 0 - cmp r5, r9 - bcs _08122946 -_081228EA: - movs r6, 0 -_081228EC: - adds r0, r7, 0 - adds r1, r4, 0 - adds r2, r3, 0 - str r3, [sp] - bl sub_8122C1C - lsls r0, 16 - asrs r0, 16 - ldr r3, [sp] - cmp r0, 0 - bge _08122918 - ldr r0, [r4] - ldr r1, [r4, 0x4] - mov r2, r8 - adds r2, 0x8 - mov r8, r2 - subs r2, 0x8 - stm r2!, {r0,r1} - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - b _08122930 -_08122918: - lsls r0, 3 - adds r2, r7, r0 - ldrb r1, [r2] - lsls r1, 25 - ldrb r0, [r4] - lsls r0, 25 - cmp r1, r0 - bcs _08122930 - ldr r0, [r4] - ldr r1, [r4, 0x4] - str r0, [r2] - str r1, [r2, 0x4] -_08122930: - adds r4, 0x8 - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x4 - bls _081228EC - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, r9 - bcc _081228EA -_08122946: - adds r0, r7, 0 - adds r1, r3, 0 - movs r2, 0x2 - bl sub_8122804 - adds r4, r7, 0 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002e68 - adds r1, r0 - mov r8, r1 - movs r5, 0 -_0812295E: - ldm r4!, {r0,r1} - mov r2, r8 - adds r2, 0x8 - mov r8, r2 - subs r2, 0x8 - stm r2!, {r0,r1} - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x4 - bls _0812295E - mov r0, r10 - bl Free - adds r0, r7, 0 - bl Free -_08122980: - 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_812287C - - thumb_func_start sub_8122998 -sub_8122998: @ 8122998 - push {lr} - ldr r2, =0x03005d8c - ldr r0, =0x020375e0 - ldrh r1, [r0] - lsls r1, 3 - ldr r0, [r2] - adds r1, r0 - ldr r0, =0x02021cc4 - ldr r2, =0x00002e6c - adds r1, r2 - movs r2, 0x2 - movs r3, 0x1 - bl ConvertEasyChatWordsToString - pop {r0} - bx r0 - .pool - thumb_func_end sub_8122998 - - thumb_func_start sub_81229C8 -sub_81229C8: @ 81229C8 - push {r4,lr} - movs r4, 0 - ldr r0, =0x03005d8c - ldr r3, [r0] - ldr r1, =0x00002e68 - adds r0, r3, r1 - ldrb r1, [r0] - lsls r1, 25 - lsrs r1, 25 - ldr r2, =0x00002e70 - adds r0, r3, r2 - ldrb r0, [r0] - lsls r0, 25 - lsrs r0, 25 - subs r1, r0 - cmp r1, 0x1 - bgt _08122A0C - ldr r1, =0x00002e69 - adds r0, r3, r1 - ldrb r1, [r0] - movs r2, 0x40 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _08122A0C - ldr r1, =0x00002e71 - adds r0, r3, r1 - ldrb r1, [r0] - adds r0, r2, 0 - ands r0, r1 - lsls r0, 24 - lsrs r0, 24 - negs r0, r0 - lsrs r4, r0, 31 -_08122A0C: - ldr r0, =0x020375f0 - strh r4, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81229C8 - - thumb_func_start sub_8122A30 -sub_8122A30: @ 8122A30 - ldr r2, =0x020375f0 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r3, =0x00002e6c - adds r1, r0, r3 - adds r3, 0x2 - adds r0, r3 - ldrh r0, [r0] - ldrh r1, [r1] - adds r0, r1 - movs r1, 0x7 - ands r0, r1 - strh r0, [r2] - bx lr - .pool - thumb_func_end sub_8122A30 - - thumb_func_start atk90_changetypestoenemyattacktype -atk90_changetypestoenemyattacktype: @ 8122A58 - push {r4,r5,lr} - adds r3, r0, 0 - adds r5, r1, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r2, 0 - cmp r2, 0x1 - beq _08122A9E - cmp r2, 0x1 - bgt _08122A72 - cmp r2, 0 - beq _08122A78 - b _08122B1A -_08122A72: - cmp r0, 0x2 - beq _08122ACA - b _08122B1A -_08122A78: - ldrb r0, [r3] - lsls r1, r0, 25 - ldrb r0, [r5] - lsls r0, 25 - cmp r1, r0 - bhi _08122B16 - cmp r1, r0 - bcc _08122AC6 - ldrh r0, [r3] - lsls r3, r0, 18 - ldrh r0, [r5] - lsls r2, r0, 18 - lsrs r1, r3, 25 - lsrs r0, r2, 25 - cmp r1, r0 - bhi _08122B16 - lsrs r1, r3, 25 - lsrs r0, r2, 25 - b _08122AC2 -_08122A9E: - ldrh r0, [r3] - lsls r4, r0, 18 - ldrh r0, [r5] - lsls r2, r0, 18 - lsrs r1, r4, 25 - lsrs r0, r2, 25 - cmp r1, r0 - bhi _08122B16 - lsrs r1, r4, 25 - lsrs r0, r2, 25 - cmp r1, r0 - bcc _08122AC6 - ldrb r0, [r3] - lsls r1, r0, 25 - ldrb r0, [r5] - lsls r0, 25 - cmp r1, r0 - bhi _08122B16 -_08122AC2: - cmp r1, r0 - bcs _08122B1A -_08122AC6: - movs r0, 0 - b _08122B22 -_08122ACA: - ldrb r0, [r3] - lsls r1, r0, 25 - ldrb r0, [r5] - lsls r0, 25 - cmp r1, r0 - bhi _08122B16 - cmp r1, r0 - bcc _08122AC6 - ldrh r0, [r3] - lsls r4, r0, 18 - ldrh r0, [r5] - lsls r2, r0, 18 - lsrs r1, r4, 25 - lsrs r0, r2, 25 - cmp r1, r0 - bhi _08122B16 - lsrs r1, r4, 25 - lsrs r0, r2, 25 - cmp r1, r0 - bcc _08122AC6 - ldrh r1, [r3, 0x2] - ldrh r0, [r5, 0x2] - cmp r1, r0 - bhi _08122B16 - cmp r1, r0 - bcc _08122AC6 - ldrh r1, [r3, 0x4] - ldrh r0, [r5, 0x4] - cmp r1, r0 - bhi _08122B16 - cmp r1, r0 - bcc _08122AC6 - ldrh r1, [r3, 0x6] - ldrh r0, [r5, 0x6] - cmp r1, r0 - bhi _08122B16 - cmp r1, r0 - bcc _08122AC6 -_08122B16: - movs r0, 0x1 - b _08122B22 -_08122B1A: - bl GenerateRandomNumber - movs r1, 0x1 - ands r0, r1 -_08122B22: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end atk90_changetypestoenemyattacktype - - thumb_func_start sub_8122B28 -sub_8122B28: @ 8122B28 - push {r4,r5,lr} - adds r5, r0, 0 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x62 - bl __umodsi3 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x32 - bls _08122B6A - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x62 - bl __umodsi3 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x50 - bls _08122B6A - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x62 - bl __umodsi3 - lsls r0, 16 - lsrs r4, r0, 16 -_08122B6A: - adds r1, r4, 0 - adds r1, 0x1E - movs r0, 0x7F - ands r1, r0 - lsls r1, 7 - ldrh r2, [r5] - ldr r0, =0xffffc07f - ands r0, r2 - orrs r0, r1 - strh r0, [r5] - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0x1 - bl __modsi3 - adds r0, 0x1E - movs r1, 0x7F - ands r0, r1 - ldrb r2, [r5] - movs r1, 0x80 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r5] - bl GenerateRandomNumber - strh r0, [r5, 0x2] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8122B28 - - thumb_func_start sub_8122BB0 -sub_8122BB0: @ 8122BB0 - push {r4-r6,lr} - adds r5, r0, 0 - movs r4, 0 - ldr r6, =0x03005d8c -_08122BB8: - lsls r1, r4, 3 - ldr r0, [r6] - adds r1, r0 - ldr r0, =0x00002e6c - adds r1, r0 - adds r0, r5, 0 - bl sub_8122BF0 - lsls r0, 24 - cmp r0, 0 - beq _08122BDC - movs r0, 0x1 - b _08122BE8 - .pool -_08122BDC: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x4 - bls _08122BB8 - movs r0, 0 -_08122BE8: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8122BB0 - - thumb_func_start sub_8122BF0 -sub_8122BF0: @ 8122BF0 - push {r4,lr} - adds r3, r0, 0 - adds r2, r1, 0 - movs r4, 0 -_08122BF8: - ldrh r1, [r3] - ldrh r0, [r2] - adds r2, 0x2 - adds r3, 0x2 - cmp r1, r0 - beq _08122C08 - movs r0, 0 - b _08122C14 -_08122C08: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x1 - bls _08122BF8 - movs r0, 0x1 -_08122C14: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8122BF0 - - thumb_func_start sub_8122C1C -sub_8122C1C: @ 8122C1C - push {r4-r7,lr} - adds r5, r0, 0 - adds r7, r1, 0 - lsls r2, 16 - lsrs r6, r2, 16 - movs r4, 0 - cmp r4, r6 - bge _08122C52 -_08122C2C: - adds r1, r5, 0x4 - adds r0, r7, 0x4 - bl sub_8122BF0 - lsls r0, 24 - cmp r0, 0 - beq _08122C40 - lsls r0, r4, 16 - asrs r0, 16 - b _08122C56 -_08122C40: - adds r5, 0x8 - lsls r0, r4, 16 - movs r1, 0x80 - lsls r1, 9 - adds r0, r1 - lsrs r4, r0, 16 - asrs r0, 16 - cmp r0, r6 - blt _08122C2C -_08122C52: - movs r0, 0x1 - negs r0, r0 -_08122C56: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8122C1C - - thumb_func_start sub_8122C5C -sub_8122C5C: @ 8122C5C - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 16 - lsrs r1, 16 - movs r3, 0 - ldr r2, =gUnknown_0859F53C -_08122C6A: - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r0, r4 - bne _08122C84 - movs r0, 0x1 - ldrsb r0, [r2, r0] - cmp r0, r1 - bne _08122C84 - adds r0, r3, 0x1 - b _08122C8E - .pool -_08122C84: - adds r2, 0x8 - adds r3, 0x1 - cmp r3, 0x15 - bls _08122C6A - movs r0, 0 -_08122C8E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8122C5C - - thumb_func_start sub_8122C94 -sub_8122C94: @ 8122C94 - push {lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - lsrs r1, 16 - bl sub_8122C5C - cmp r0, 0 - beq _08122CB4 - lsls r0, 3 - ldr r1, =gUnknown_0859F534 - adds r0, r1 - b _08122CB6 - .pool -_08122CB4: - movs r0, 0 -_08122CB6: - pop {r1} - bx r1 - thumb_func_end sub_8122C94 - - thumb_func_start sub_8122CBC -@ warpdata *sub_8122CBC(int a1) -sub_8122CBC: @ 8122CBC - push {lr} - cmp r0, 0 - beq _08122CD4 - cmp r0, 0x16 - bhi _08122CD4 - lsls r0, 3 - ldr r1, =gUnknown_0859F534 - adds r0, r1 - b _08122CD6 - .pool -_08122CD4: - movs r0, 0 -_08122CD6: - pop {r1} - bx r1 - thumb_func_end sub_8122CBC - - thumb_func_start sub_8122CDC -sub_8122CDC: @ 8122CDC - push {lr} - lsls r2, r1, 24 - lsrs r2, 24 - movs r1, 0 - bl sub_8122CF8 -_08122CE8: - bl sub_8122DB0 - lsls r0, 24 - cmp r0, 0 - bne _08122CE8 - pop {r0} - bx r0 - thumb_func_end sub_8122CDC - - thumb_func_start sub_8122CF8 -sub_8122CF8: @ 8122CF8 - push {r4,r5,lr} - adds r4, r1, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r3, =0x0203a144 - str r0, [r3] - movs r1, 0x79 - adds r1, r0 - mov r12, r1 - movs r1, 0 - mov r5, r12 - strb r1, [r5] - adds r0, 0x78 - strb r2, [r0] - ldr r1, [r3] - cmp r2, 0x1 - bne _08122D28 - ldr r0, =sub_8123254 - b _08122D2A - .pool -_08122D28: - ldr r0, =sub_81230C4 -_08122D2A: - str r0, [r1, 0x18] - cmp r4, 0 - beq _08122D64 - ldr r1, [r3] - ldr r0, [r4] - lsls r0, 30 - lsrs r0, 30 - adds r1, 0x80 - strb r0, [r1] - ldr r1, [r3] - ldr r0, [r4] - lsls r0, 28 - lsrs r0, 30 - adds r1, 0x81 - strb r0, [r1] - ldr r1, [r3] - ldr r0, [r4] - lsls r0, 23 - lsrs r0, 27 - adds r1, 0x82 - strb r0, [r1] - ldr r0, [r3] - adds r0, 0x83 - movs r1, 0x1 - strb r1, [r0] - b _08122D80 - .pool -_08122D64: - ldr r0, [r3] - adds r0, 0x80 - movs r1, 0x2 - strb r1, [r0] - ldr r0, [r3] - adds r0, 0x81 - strb r1, [r0] - ldr r0, [r3] - adds r0, 0x82 - movs r1, 0x1C - strb r1, [r0] - ldr r0, [r3] - adds r0, 0x83 - strb r4, [r0] -_08122D80: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8122CF8 - - thumb_func_start sub_8122D88 -sub_8122D88: @ 8122D88 - push {r4,lr} - ldr r4, =0x0203a144 - str r0, [r4] - bl sub_81238AC - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0x54 - ldrh r1, [r0] - adds r0, 0x20 - strh r1, [r0] - subs r0, 0x1E - ldrh r1, [r0] - adds r0, 0x20 - strh r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8122D88 - - thumb_func_start sub_8122DB0 -sub_8122DB0: @ 8122DB0 - push {r4,r5,lr} - sub sp, 0xC - ldr r0, =0x0203a144 - ldr r0, [r0] - adds r0, 0x79 - ldrb r0, [r0] - cmp r0, 0x7 - bls _08122DC2 - b _0812300C -_08122DC2: - lsls r0, 2 - ldr r1, =_08122DD4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08122DD4: - .4byte _08122DF4 - .4byte _08122E2C - .4byte _08122E78 - .4byte _08122E94 - .4byte _08122EB0 - .4byte _08122ECC - .4byte _08122F10 - .4byte _08122F8C -_08122DF4: - ldr r0, =0x0203a144 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x83 - ldrb r0, [r0] - cmp r0, 0 - beq _08122E18 - adds r0, r1, 0 - adds r0, 0x80 - ldrb r0, [r0] - ldr r1, =gUnknown_0859F77C - movs r2, 0 - str r2, [sp] - b _08122E52 - .pool -_08122E18: - ldr r0, =gUnknown_0859F77C - ldr r1, =0x06008000 - bl LZ77UnCompVram - b _08123014 - .pool -_08122E2C: - ldr r4, =0x0203a144 - ldr r0, [r4] - adds r0, 0x83 - ldrb r0, [r0] - cmp r0, 0 - beq _08122E64 - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - beq _08122E44 - b _08123014 -_08122E44: - ldr r0, [r4] - adds r0, 0x80 - ldrb r0, [r0] - ldr r1, =gUnknown_085A04E0 - movs r2, 0x1 - str r2, [sp] - movs r2, 0 -_08122E52: - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _08123014 - .pool -_08122E64: - ldr r0, =gUnknown_085A04E0 - ldr r1, =0x0600e000 - bl LZ77UnCompVram - b _08123014 - .pool -_08122E78: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - beq _08122E84 - b _08123014 -_08122E84: - ldr r0, =gUnknown_0859F73C - movs r1, 0x70 - movs r2, 0x60 - bl gpu_pal_apply - b _08123014 - .pool -_08122E94: - ldr r0, =gUnknown_0859F60C - ldr r1, =0x0203a144 - ldr r1, [r1] - movs r2, 0xC2 - lsls r2, 1 - adds r1, r2 - bl LZ77UnCompWram - b _08123014 - .pool -_08122EB0: - ldr r0, =gUnknown_0859F650 - ldr r1, =0x0203a144 - ldr r1, [r1] - movs r5, 0xA1 - lsls r5, 2 - adds r1, r5 - bl LZ77UnCompWram - b _08123014 - .pool -_08122ECC: - bl sub_81238AC - ldr r4, =0x0203a144 - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0x54 - ldrh r1, [r0] - adds r0, 0x20 - strh r1, [r0] - subs r0, 0x1E - ldrh r0, [r0] - adds r1, r2, 0 - adds r1, 0x76 - strh r0, [r1] - ldrh r0, [r2] - bl sub_8123EB4 - ldr r1, [r4] - strh r0, [r1] - ldrh r0, [r1] - bl get_flagnr_blue_points - ldr r1, [r4] - strb r0, [r1, 0x2] - ldr r1, [r4] - adds r0, r1, 0x4 - ldrh r1, [r1] - movs r2, 0x10 - bl GetMapName - b _08123014 - .pool -_08122F10: - ldr r0, =0x0203a144 - ldr r4, [r0] - adds r0, r4, 0 - adds r0, 0x78 - ldrb r1, [r0] - cmp r1, 0 - bne _08122F3C - movs r0, 0x80 - lsls r0, 1 - str r0, [sp] - str r0, [sp, 0x4] - str r1, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_81236C4 - b _08123014 - .pool -_08122F3C: - adds r1, r4, 0 - adds r1, 0x54 - ldrh r0, [r1] - lsls r0, 3 - subs r0, 0x34 - adds r2, r4, 0 - adds r2, 0x5C - movs r3, 0 - strh r0, [r2] - movs r0, 0x56 - adds r0, r4 - mov r12, r0 - ldrh r0, [r0] - lsls r0, 3 - subs r0, 0x44 - adds r5, r4, 0 - adds r5, 0x5E - strh r0, [r5] - ldrh r1, [r1] - adds r0, r4, 0 - adds r0, 0x64 - strh r1, [r0] - mov r0, r12 - ldrh r1, [r0] - adds r0, r4, 0 - adds r0, 0x66 - strh r1, [r0] - movs r1, 0 - ldrsh r0, [r2, r1] - movs r2, 0 - ldrsh r1, [r5, r2] - movs r2, 0x80 - str r2, [sp] - str r2, [sp, 0x4] - str r3, [sp, 0x8] - movs r2, 0x38 - movs r3, 0x48 - bl sub_81236C4 - b _08123014 -_08122F8C: - bl sub_8123FB0 - bl sub_81237B4 - ldr r4, =0x0203a144 - ldr r0, [r4] - movs r1, 0 - str r1, [r0, 0x1C] - str r1, [r0, 0x20] - adds r0, 0x7A - strb r1, [r0] - ldr r0, [r4] - adds r0, 0x7E - strb r1, [r0] - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x83 - ldrb r0, [r0] - cmp r0, 0 - beq _08123002 - adds r0, r1, 0 - adds r0, 0x80 - ldrb r0, [r0] - movs r1, 0x3 - movs r2, 0x2 - bl SetBgAttribute - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x80 - ldrb r0, [r0] - adds r1, 0x81 - ldrb r2, [r1] - movs r1, 0x1 - bl SetBgAttribute - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x80 - ldrb r0, [r0] - adds r1, 0x82 - ldrb r2, [r1] - movs r1, 0x2 - bl SetBgAttribute - ldr r0, [r4] - adds r0, 0x80 - ldrb r0, [r0] - movs r1, 0x6 - movs r2, 0x1 - bl SetBgAttribute - ldr r0, [r4] - adds r0, 0x80 - ldrb r0, [r0] - movs r1, 0x4 - movs r2, 0x1 - bl SetBgAttribute -_08123002: - ldr r1, [r4] - adds r1, 0x79 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0812300C: - movs r0, 0 - b _08123022 - .pool -_08123014: - ldr r0, =0x0203a144 - ldr r1, [r0] - adds r1, 0x79 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0x1 -_08123022: - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8122DB0 - - thumb_func_start sub_8123030 -sub_8123030: @ 8123030 - push {lr} - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - movs r0, 0xE0 - lsls r0, 2 - lsls r1, 24 - lsrs r1, 24 - bl sub_80A2A20 - ldr r0, =0x02037bf4 - ldr r1, =0x020377f4 - movs r2, 0x30 - bl CpuSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_8123030 - - thumb_func_start sub_812305C -sub_812305C: @ 812305C - push {r4,lr} - ldr r4, =0x0203a144 - ldr r0, [r4] - ldr r0, [r0, 0x1C] - cmp r0, 0 - beq _08123080 - bl RemoveObjectAndFreeTiles - ldr r0, [r4] - adds r0, 0x58 - ldrh r0, [r0] - bl FreeObjectTilesByTag - ldr r0, [r4] - adds r0, 0x5A - ldrh r0, [r0] - bl FreeObjectPaletteByTag -_08123080: - ldr r0, [r4] - ldr r0, [r0, 0x20] - cmp r0, 0 - beq _081230A0 - bl RemoveObjectAndFreeTiles - ldr r0, [r4] - adds r0, 0x70 - ldrh r0, [r0] - bl FreeObjectTilesByTag - ldr r0, [r4] - adds r0, 0x72 - ldrh r0, [r0] - bl FreeObjectPaletteByTag -_081230A0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812305C - - thumb_func_start sub_81230AC -sub_81230AC: @ 81230AC - push {lr} - ldr r0, =0x0203a144 - ldr r0, [r0] - ldr r0, [r0, 0x18] - bl _call_via_r0 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81230AC - - thumb_func_start sub_81230C4 -sub_81230C4: @ 81230C4 - push {r4,lr} - movs r4, 0 - ldr r2, =0x0203a144 - ldr r0, [r2] - adds r0, 0x7B - strb r4, [r0] - ldr r0, [r2] - adds r0, 0x7C - strb r4, [r0] - ldr r3, =0x030022c0 - ldrh r1, [r3, 0x2C] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081230F6 - ldr r1, [r2] - adds r0, r1, 0 - adds r0, 0x56 - ldrh r0, [r0] - cmp r0, 0x2 - bls _081230F6 - adds r1, 0x7C - movs r0, 0xFF - strb r0, [r1] - movs r4, 0x1 -_081230F6: - ldrh r1, [r3, 0x2C] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08123114 - ldr r1, [r2] - adds r0, r1, 0 - adds r0, 0x56 - ldrh r0, [r0] - cmp r0, 0xF - bhi _08123114 - adds r1, 0x7C - movs r0, 0x1 - strb r0, [r1] - movs r4, 0x1 -_08123114: - ldrh r1, [r3, 0x2C] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08123132 - ldr r1, [r2] - adds r0, r1, 0 - adds r0, 0x54 - ldrh r0, [r0] - cmp r0, 0x1 - bls _08123132 - adds r1, 0x7B - movs r0, 0xFF - strb r0, [r1] - movs r4, 0x1 -_08123132: - ldrh r1, [r3, 0x2C] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08123150 - ldr r1, [r2] - adds r0, r1, 0 - adds r0, 0x54 - ldrh r0, [r0] - cmp r0, 0x1B - bhi _08123150 - adds r1, 0x7B - movs r0, 0x1 - strb r0, [r1] - movs r4, 0x1 -_08123150: - ldrh r3, [r3, 0x2E] - movs r0, 0x1 - ands r0, r3 - cmp r0, 0 - beq _08123168 - movs r4, 0x4 - b _08123172 - .pool -_08123168: - movs r0, 0x2 - ands r0, r3 - cmp r0, 0 - beq _08123172 - movs r4, 0x5 -_08123172: - cmp r4, 0x1 - bne _08123184 - ldr r0, [r2] - adds r0, 0x7A - movs r1, 0x4 - strb r1, [r0] - ldr r1, [r2] - ldr r0, =_swiopen - str r0, [r1, 0x18] -_08123184: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81230C4 - - thumb_func_start _swiopen -_swiopen: @ 8123190 - push {r4,r5,lr} - ldr r5, =0x0203a144 - ldr r1, [r5] - adds r0, r1, 0 - adds r0, 0x7A - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - beq _081231AC - movs r0, 0x2 - b _08123248 - .pool -_081231AC: - adds r0, r1, 0 - adds r0, 0x7B - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - ble _081231C2 - adds r1, 0x54 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_081231C2: - ldr r1, [r5] - adds r0, r1, 0 - adds r0, 0x7B - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - bge _081231DA - adds r1, 0x54 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] -_081231DA: - ldr r1, [r5] - adds r0, r1, 0 - adds r0, 0x7C - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - ble _081231F2 - adds r1, 0x56 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_081231F2: - ldr r1, [r5] - adds r0, r1, 0 - adds r0, 0x7C - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - bge _0812320A - adds r1, 0x56 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] -_0812320A: - ldr r1, [r5] - adds r0, r1, 0 - adds r0, 0x54 - ldrh r0, [r0] - adds r1, 0x56 - ldrh r1, [r1] - bl sub_812386C - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl get_flagnr_blue_points - ldr r1, [r5] - strb r0, [r1, 0x2] - ldr r1, [r5] - ldrh r0, [r1] - cmp r4, r0 - beq _0812323C - strh r4, [r1] - adds r0, r1, 0x4 - ldrh r1, [r1] - movs r2, 0x10 - bl GetMapName -_0812323C: - bl sub_8123FB0 - ldr r1, [r5] - ldr r0, =sub_81230C4 - str r0, [r1, 0x18] - movs r0, 0x3 -_08123248: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end _swiopen - - thumb_func_start sub_8123254 -sub_8123254: @ 8123254 - push {r4-r6,lr} - movs r4, 0 - ldr r3, =0x0203a144 - ldr r0, [r3] - mov r12, r0 - adds r0, 0x6A - strh r4, [r0] - mov r5, r12 - adds r5, 0x68 - strh r4, [r5] - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2C] - movs r0, 0x40 - ands r0, r1 - adds r6, r3, 0 - adds r3, r2, 0 - cmp r0, 0 - beq _0812328E - mov r0, r12 - adds r0, 0x5E - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0x34 - negs r0, r0 - cmp r1, r0 - ble _0812328E - ldr r0, =0x0000ffff - strh r0, [r5] - movs r4, 0x1 -_0812328E: - ldrh r1, [r3, 0x2C] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081232AE - ldr r1, [r6] - adds r0, r1, 0 - adds r0, 0x5E - movs r5, 0 - ldrsh r0, [r0, r5] - cmp r0, 0x3B - bgt _081232AE - adds r1, 0x68 - movs r0, 0x1 - strh r0, [r1] - movs r4, 0x1 -_081232AE: - ldrh r1, [r3, 0x2C] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _081232D4 - ldr r2, [r6] - adds r0, r2, 0 - adds r0, 0x5C - movs r5, 0 - ldrsh r1, [r0, r5] - movs r0, 0x2C - negs r0, r0 - cmp r1, r0 - ble _081232D4 - adds r1, r2, 0 - adds r1, 0x6A - ldr r0, =0x0000ffff - strh r0, [r1] - movs r4, 0x1 -_081232D4: - ldrh r1, [r3, 0x2C] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _081232F4 - ldr r1, [r6] - adds r0, r1, 0 - adds r0, 0x5C - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0xAB - bgt _081232F4 - adds r1, 0x6A - movs r0, 0x1 - strh r0, [r1] - movs r4, 0x1 -_081232F4: - ldrh r2, [r3, 0x2E] - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - beq _08123300 - movs r4, 0x4 -_08123300: - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - beq _0812330A - movs r4, 0x5 -_0812330A: - cmp r4, 0x1 - bne _0812331A - ldr r0, [r6] - ldr r1, =sub_8123334 - str r1, [r0, 0x18] - adds r0, 0x6C - movs r1, 0 - strh r1, [r0] -_0812331A: - adds r0, r4, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8123254 - - thumb_func_start sub_8123334 -sub_8123334: @ 8123334 - push {r4,r5,lr} - ldr r5, =0x0203a144 - ldr r2, [r5] - adds r3, r2, 0 - adds r3, 0x5E - adds r0, r2, 0 - adds r0, 0x68 - ldrh r0, [r0] - ldrh r1, [r3] - adds r0, r1 - strh r0, [r3] - adds r1, r2, 0 - adds r1, 0x5C - adds r0, r2, 0 - adds r0, 0x6A - ldrh r0, [r0] - ldrh r2, [r1] - adds r0, r2 - strh r0, [r1] - movs r4, 0 - ldrsh r0, [r1, r4] - movs r2, 0 - ldrsh r1, [r3, r2] - bl sub_812378C - ldr r2, [r5] - adds r1, r2, 0 - adds r1, 0x6C - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x8 - bne _08123410 - adds r0, r2, 0 - adds r0, 0x5C - movs r3, 0 - ldrsh r1, [r0, r3] - adds r0, r1, 0 - adds r0, 0x2C - cmp r0, 0 - bge _0812338C - adds r0, 0x7 -_0812338C: - asrs r0, 3 - adds r0, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - adds r0, r2, 0 - adds r0, 0x5E - movs r4, 0 - ldrsh r1, [r0, r4] - adds r0, r1, 0 - adds r0, 0x34 - cmp r0, 0 - bge _081233A6 - adds r0, 0x7 -_081233A6: - asrs r0, 3 - adds r0, 0x2 - lsls r0, 16 - lsrs r1, r0, 16 - adds r4, r2, 0 - adds r4, 0x64 - adds r0, r2, 0 - adds r0, 0x66 - ldrh r2, [r4] - cmp r3, r2 - bne _081233C2 - ldrh r2, [r0] - cmp r1, r2 - beq _081233F2 -_081233C2: - strh r3, [r4] - strh r1, [r0] - adds r0, r3, 0 - bl sub_812386C - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl get_flagnr_blue_points - ldr r1, [r5] - strb r0, [r1, 0x2] - ldr r1, [r5] - ldrh r3, [r1] - cmp r4, r3 - beq _081233EE - strh r4, [r1] - adds r0, r1, 0x4 - ldrh r1, [r1] - movs r2, 0x10 - bl GetMapName -_081233EE: - bl sub_8123FB0 -_081233F2: - ldr r0, =0x0203a144 - ldr r2, [r0] - adds r1, r2, 0 - adds r1, 0x6C - movs r0, 0 - strh r0, [r1] - ldr r0, =sub_8123254 - str r0, [r2, 0x18] - movs r0, 0x3 - b _08123412 - .pool -_08123410: - movs r0, 0x2 -_08123412: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8123334 - - thumb_func_start sub_8123418 -sub_8123418: @ 8123418 - push {r4-r6,lr} - ldr r1, =0x0203a144 - ldr r2, [r1] - adds r0, r2, 0 - adds r0, 0x78 - ldrb r3, [r0] - adds r5, r1, 0 - cmp r3, 0 - bne _0812349C - subs r0, 0x1A - strh r3, [r0] - subs r0, 0x2 - strh r3, [r0] - str r3, [r2, 0x40] - str r3, [r2, 0x3C] - adds r4, r2, 0 - adds r4, 0x54 - ldrh r0, [r4] - lsls r0, 3 - subs r0, 0x34 - adds r1, r2, 0 - adds r1, 0x60 - strh r0, [r1] - movs r0, 0x56 - adds r0, r2 - mov r12, r0 - ldrh r0, [r0] - lsls r0, 3 - subs r0, 0x44 - adds r3, r2, 0 - adds r3, 0x62 - strh r0, [r3] - movs r6, 0 - ldrsh r0, [r1, r6] - lsls r0, 8 - cmp r0, 0 - bge _08123464 - adds r0, 0xF -_08123464: - asrs r0, 4 - str r0, [r2, 0x44] - movs r1, 0 - ldrsh r0, [r3, r1] - lsls r0, 8 - cmp r0, 0 - bge _08123474 - adds r0, 0xF -_08123474: - asrs r0, 4 - str r0, [r2, 0x48] - ldrh r1, [r4] - adds r0, r2, 0 - adds r0, 0x64 - strh r1, [r0] - mov r3, r12 - ldrh r0, [r3] - adds r1, r2, 0 - adds r1, 0x66 - strh r0, [r1] - movs r0, 0x80 - lsls r0, 9 - str r0, [r2, 0x4C] - ldr r0, =0xfffff800 - b _081234FA - .pool -_0812349C: - adds r0, r2, 0 - adds r0, 0x5C - movs r6, 0 - ldrsh r0, [r0, r6] - lsls r0, 8 - str r0, [r2, 0x3C] - adds r0, r2, 0 - adds r0, 0x5E - movs r1, 0 - ldrsh r0, [r0, r1] - lsls r0, 8 - str r0, [r2, 0x40] - adds r0, r2, 0 - adds r0, 0x60 - movs r1, 0 - strh r1, [r0] - adds r0, 0x2 - strh r1, [r0] - ldr r0, [r2, 0x3C] - cmp r0, 0 - bge _081234C8 - adds r0, 0xF -_081234C8: - asrs r0, 4 - negs r0, r0 - str r0, [r2, 0x44] - ldr r0, [r2, 0x40] - cmp r0, 0 - bge _081234D6 - adds r0, 0xF -_081234D6: - asrs r0, 4 - negs r0, r0 - str r0, [r2, 0x48] - adds r0, r2, 0 - adds r0, 0x64 - ldrh r1, [r0] - subs r0, 0x10 - strh r1, [r0] - adds r0, 0x12 - ldrh r0, [r0] - adds r1, r2, 0 - adds r1, 0x56 - strh r0, [r1] - movs r0, 0x80 - lsls r0, 8 - str r0, [r2, 0x4C] - movs r0, 0x80 - lsls r0, 4 -_081234FA: - str r0, [r2, 0x50] - ldr r0, [r5] - adds r0, 0x6E - movs r1, 0 - strh r1, [r0] - bl sub_8124238 - bl sub_81243B0 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8123418 - - thumb_func_start sub_8123514 -sub_8123514: @ 8123514 - push {r4-r6,lr} - sub sp, 0xC - ldr r0, =0x0203a144 - ldr r3, [r0] - adds r2, r3, 0 - adds r2, 0x6E - ldrh r1, [r2] - adds r5, r0, 0 - cmp r1, 0xF - bls _08123530 - movs r0, 0 - b _081236B8 - .pool -_08123530: - adds r0, r1, 0x1 - movs r1, 0 - strh r0, [r2] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x10 - bne _081235A4 - str r1, [r3, 0x44] - str r1, [r3, 0x48] - adds r0, r3, 0 - adds r0, 0x60 - ldrh r1, [r0] - subs r0, 0x4 - strh r1, [r0] - adds r0, 0x6 - ldrh r0, [r0] - adds r1, r3, 0 - adds r1, 0x5E - strh r0, [r1] - adds r1, 0x1A - ldrb r0, [r1] - movs r2, 0x80 - lsls r2, 9 - cmp r0, 0 - bne _08123566 - movs r2, 0x80 - lsls r2, 8 -_08123566: - str r2, [r3, 0x4C] - movs r2, 0 - ldrb r0, [r1] - cmp r0, 0 - bne _08123572 - movs r2, 0x1 -_08123572: - strb r2, [r1] - ldr r1, [r5] - adds r0, r1, 0 - adds r0, 0x78 - ldrb r0, [r0] - ldr r2, =sub_8123254 - cmp r0, 0 - bne _08123584 - ldr r2, =sub_81230C4 -_08123584: - str r2, [r1, 0x18] - adds r0, r1, 0 - adds r0, 0x58 - ldrh r0, [r0] - adds r1, 0x5A - ldrh r1, [r1] - bl sub_81240D4 - bl sub_81243DC - movs r4, 0 - b _08123686 - .pool -_081235A4: - ldr r2, [r3, 0x3C] - ldr r0, [r3, 0x44] - adds r2, r0 - str r2, [r3, 0x3C] - ldr r0, [r3, 0x40] - ldr r1, [r3, 0x48] - adds r0, r1 - str r0, [r3, 0x40] - asrs r2, 8 - adds r4, r3, 0 - adds r4, 0x5C - strh r2, [r4] - ldr r0, [r3, 0x40] - asrs r0, 8 - adds r1, r3, 0 - adds r1, 0x5E - strh r0, [r1] - ldr r0, [r3, 0x4C] - ldr r1, [r3, 0x50] - adds r0, r1 - str r0, [r3, 0x4C] - ldr r2, [r3, 0x44] - cmp r2, 0 - bge _081235E4 - adds r0, r3, 0 - adds r0, 0x60 - movs r6, 0 - ldrsh r1, [r4, r6] - movs r6, 0 - ldrsh r0, [r0, r6] - cmp r1, r0 - blt _081235F8 -_081235E4: - cmp r2, 0 - ble _08123608 - adds r0, r3, 0 - adds r0, 0x60 - movs r2, 0 - ldrsh r1, [r4, r2] - movs r6, 0 - ldrsh r0, [r0, r6] - cmp r1, r0 - ble _08123608 -_081235F8: - ldr r3, [r5] - adds r0, r3, 0 - adds r0, 0x60 - ldrh r2, [r0] - subs r0, 0x4 - movs r1, 0 - strh r2, [r0] - str r1, [r3, 0x44] -_08123608: - ldr r2, [r5] - ldr r4, [r2, 0x48] - cmp r4, 0 - bge _08123624 - adds r0, r2, 0 - adds r0, 0x5E - adds r3, r2, 0 - adds r3, 0x62 - movs r6, 0 - ldrsh r1, [r0, r6] - movs r6, 0 - ldrsh r0, [r3, r6] - cmp r1, r0 - blt _0812363C -_08123624: - cmp r4, 0 - ble _0812364E - adds r1, r2, 0 - adds r1, 0x5E - adds r0, r2, 0 - adds r0, 0x62 - movs r2, 0 - ldrsh r1, [r1, r2] - movs r6, 0 - ldrsh r0, [r0, r6] - cmp r1, r0 - ble _0812364E -_0812363C: - ldr r2, [r5] - adds r0, r2, 0 - adds r0, 0x62 - ldrh r1, [r0] - adds r3, r2, 0 - adds r3, 0x5E - movs r0, 0 - strh r1, [r3] - str r0, [r2, 0x48] -_0812364E: - ldr r0, =0x0203a144 - ldr r2, [r0] - adds r0, r2, 0 - adds r0, 0x78 - ldrb r3, [r0] - cmp r3, 0 - bne _08123674 - ldr r1, [r2, 0x4C] - ldr r0, =0x00007fff - cmp r1, r0 - bgt _08123684 - adds r0, 0x1 - str r0, [r2, 0x4C] - str r3, [r2, 0x50] - b _08123684 - .pool -_08123674: - ldr r0, [r2, 0x4C] - movs r1, 0x80 - lsls r1, 9 - cmp r0, r1 - ble _08123684 - str r1, [r2, 0x4C] - movs r0, 0 - str r0, [r2, 0x50] -_08123684: - movs r4, 0x1 -_08123686: - ldr r0, =0x0203a144 - ldr r3, [r0] - adds r0, r3, 0 - adds r0, 0x5C - movs r1, 0 - ldrsh r0, [r0, r1] - adds r1, r3, 0 - adds r1, 0x5E - movs r2, 0 - ldrsh r1, [r1, r2] - ldr r2, [r3, 0x4C] - lsls r2, 8 - lsrs r2, 16 - str r2, [sp] - ldr r2, [r3, 0x4C] - lsls r2, 8 - lsrs r2, 16 - str r2, [sp, 0x4] - movs r2, 0 - str r2, [sp, 0x8] - movs r2, 0x38 - movs r3, 0x48 - bl sub_81236C4 - adds r0, r4, 0 -_081236B8: - add sp, 0xC - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8123514 - - thumb_func_start sub_81236C4 -sub_81236C4: @ 81236C4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r4, [sp, 0x24] - ldr r7, [sp, 0x28] - ldr r5, [sp, 0x2C] - lsls r4, 16 - lsrs r4, 16 - mov r8, r4 - lsls r7, 16 - adds r4, r7, 0 - lsrs r4, 16 - mov r9, r4 - lsls r5, 24 - lsrs r5, 24 - ldr r4, =0x0203a144 - ldr r6, [r4] - ldr r7, =gUnknown_08329F40 - mov r12, r7 - adds r4, r5, 0 - adds r4, 0x40 - lsls r4, 1 - add r4, r12 - movs r7, 0 - ldrsh r4, [r4, r7] - str r4, [sp] - mov r7, r8 - muls r7, r4 - adds r4, r7, 0 - asrs r4, 8 - mov r10, r4 - str r4, [r6, 0x2C] - lsls r5, 1 - add r5, r12 - movs r7, 0 - ldrsh r5, [r5, r7] - negs r4, r5 - mov r7, r8 - muls r7, r4 - adds r4, r7, 0 - asrs r4, 8 - mov r12, r4 - str r4, [r6, 0x30] - mov r7, r9 - muls r7, r5 - adds r5, r7, 0 - asrs r5, 8 - str r5, [r6, 0x34] - ldr r7, [sp] - mov r4, r9 - muls r4, r7 - asrs r4, 8 - mov r8, r4 - str r4, [r6, 0x38] - lsls r0, 16 - asrs r0, 8 - lsls r2, 16 - asrs r2, 16 - lsls r4, r2, 8 - adds r0, r4 - lsls r3, 16 - asrs r3, 16 - adds r4, r3, 0 - muls r4, r5 - mov r5, r10 - muls r5, r2 - adds r4, r5 - subs r0, r4 - str r0, [r6, 0x24] - lsls r1, 16 - asrs r1, 8 - lsls r0, r3, 8 - adds r1, r0 - mov r0, r8 - muls r0, r3 - mov r3, r12 - muls r3, r2 - adds r2, r3, 0 - adds r0, r2 - subs r1, r0 - str r1, [r6, 0x28] - adds r6, 0x7D - movs r0, 0x1 - strb r0, [r6] - 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_81236C4 - - thumb_func_start sub_812378C -sub_812378C: @ 812378C - ldr r2, =0x0203a144 - ldr r2, [r2] - lsls r0, 16 - asrs r0, 8 - movs r3, 0xE0 - lsls r3, 5 - adds r0, r3 - str r0, [r2, 0x24] - lsls r1, 16 - asrs r1, 8 - movs r0, 0x90 - lsls r0, 6 - adds r1, r0 - str r1, [r2, 0x28] - adds r2, 0x7D - movs r0, 0x1 - strb r0, [r2] - bx lr - .pool - thumb_func_end sub_812378C - - thumb_func_start sub_81237B4 -sub_81237B4: @ 81237B4 - push {r4,lr} - ldr r4, =0x0203a144 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x7D - ldrb r0, [r0] - cmp r0, 0 - beq _0812381A - ldrh r1, [r1, 0x2C] - movs r0, 0x20 - bl SetGpuReg - ldr r0, [r4] - ldrh r1, [r0, 0x34] - movs r0, 0x22 - bl SetGpuReg - ldr r0, [r4] - ldrh r1, [r0, 0x30] - movs r0, 0x24 - bl SetGpuReg - ldr r0, [r4] - ldrh r1, [r0, 0x38] - movs r0, 0x26 - bl SetGpuReg - ldr r0, [r4] - ldrh r1, [r0, 0x24] - movs r0, 0x28 - bl SetGpuReg - ldr r0, [r4] - ldrh r1, [r0, 0x26] - movs r0, 0x2A - bl SetGpuReg - ldr r0, [r4] - ldrh r1, [r0, 0x28] - movs r0, 0x2C - bl SetGpuReg - ldr r0, [r4] - ldrh r1, [r0, 0x2A] - movs r0, 0x2E - bl SetGpuReg - ldr r0, [r4] - adds r0, 0x7D - movs r1, 0 - strb r1, [r0] -_0812381A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81237B4 - - thumb_func_start sub_8123824 -sub_8123824: @ 8123824 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 16 - asrs r4, r0, 16 - lsls r1, 16 - asrs r5, r1, 16 - movs r0, 0x80 - lsls r0, 1 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x38 - movs r3, 0x48 - bl sub_81236C4 - bl sub_81237B4 - ldr r0, =0x0203a144 - ldr r2, [r0] - ldr r1, [r2, 0x20] - cmp r1, 0 - beq _08123860 - negs r0, r4 - strh r0, [r1, 0x24] - ldr r1, [r2, 0x20] - negs r0, r5 - strh r0, [r1, 0x26] -_08123860: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8123824 - - thumb_func_start sub_812386C -sub_812386C: @ 812386C - push {lr} - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, 16 - ldr r0, =0xfffe0000 - adds r1, r0 - lsrs r2, r1, 16 - cmp r2, 0xE - bhi _08123886 - cmp r3, 0 - beq _08123886 - cmp r3, 0x1C - bls _08123890 -_08123886: - movs r0, 0xD5 - b _081238A4 - .pool -_08123890: - subs r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - ldr r1, =gUnknown_085A096C - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r3, r0 - adds r0, r1 - ldrb r0, [r0] -_081238A4: - pop {r1} - bx r1 - .pool - thumb_func_end sub_812386C - - thumb_func_start sub_81238AC -sub_81238AC: @ 81238AC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - ldr r0, =0x03005d8c - ldr r2, [r0] - movs r1, 0x4 - ldrsb r1, [r2, r1] - adds r3, r0, 0 - cmp r1, 0x19 - bne _081238DC - ldrb r0, [r2, 0x5] - subs r0, 0x29 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bhi _081238DC - bl sub_8123C00 - b _08123BEC - .pool -_081238DC: - ldr r1, [r3] - movs r0, 0x4 - ldrsb r0, [r1, r0] - ldrb r1, [r1, 0x5] - lsls r1, 24 - asrs r1, 24 - bl get_map_light_level_by_bank_and_number - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x1 - cmp r0, 0x8 - bhi _08123928 - lsls r0, 2 - ldr r1, =_08123904 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08123904: - .4byte _08123928 - .4byte _08123928 - .4byte _08123928 - .4byte _0812396C - .4byte _08123928 - .4byte _08123928 - .4byte _0812396C - .4byte _08123A28 - .4byte _081239E4 -_08123928: - ldr r4, =0x0203a144 - ldr r0, [r4] - ldr r3, =0x02037318 - ldrb r1, [r3, 0x14] - movs r2, 0 - strh r1, [r0] - adds r0, 0x7F - strb r2, [r0] - ldr r0, [r3] - ldrh r2, [r0] - ldrh r0, [r0, 0x4] - mov r9, r0 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r6, [r0] - ldrh r3, [r0, 0x2] - ldr r1, [r4] - ldrh r0, [r1] - cmp r0, 0x45 - beq _08123956 - cmp r0, 0xCC - beq _08123956 - b _08123ABE -_08123956: - adds r1, 0x7F - movs r0, 0x1 - strb r0, [r1] - b _08123ABE - .pool -_0812396C: - ldr r2, =0x02037318 - ldrb r1, [r2, 0x1A] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081239C8 - ldr r4, =0x03005d8c - ldr r1, [r4] - 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 r5, r0, 0 - ldr r0, =0x0203a144 - ldr r0, [r0] - ldrb r1, [r5, 0x14] - strh r1, [r0] - adds r0, 0x7F - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r5] - ldrh r2, [r0] - ldrh r0, [r0, 0x4] - mov r9, r0 - ldr r0, [r4] - ldrh r6, [r0, 0x28] - ldrh r3, [r0, 0x2A] - b _08123ABE - .pool -_081239C8: - ldr r0, =0x0203a144 - ldr r0, [r0] - ldrb r1, [r2, 0x14] - strh r1, [r0] - adds r0, 0x7F - movs r1, 0x1 - strb r1, [r0] - movs r2, 0x1 - mov r9, r2 - movs r6, 0x1 - movs r3, 0x1 - b _08123ABE - .pool -_081239E4: - ldr r4, =0x03005d8c - ldr r1, [r4] - movs r0, 0x14 - ldrsb r0, [r1, r0] - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x15] - lsls r1, 24 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - adds r5, r0, 0 - ldr r0, =0x0203a144 - ldr r0, [r0] - ldrb r1, [r5, 0x14] - strh r1, [r0] - adds r0, 0x7F - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r5] - ldrh r2, [r0] - ldrh r0, [r0, 0x4] - mov r9, r0 - ldr r0, [r4] - ldrh r6, [r0, 0x18] - ldrh r3, [r0, 0x1A] - b _08123ABE - .pool -_08123A28: - ldr r4, =0x0203a144 - ldr r0, [r4] - ldr r1, =0x02037318 - ldrb r1, [r1, 0x14] - strh r1, [r0] - cmp r1, 0x57 - beq _08123A64 - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r7, r0, 0 - adds r7, 0x24 - movs r0, 0 - ldrsb r0, [r7, r0] - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ldrsb r1, [r7, r1] - lsls r1, 16 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - adds r5, r0, 0 - b _08123A8A - .pool -_08123A64: - ldr r0, =0x03005d8c - ldr r0, [r0] - adds r7, r0, 0 - adds r7, 0x14 - ldrb r0, [r0, 0x14] - lsls r0, 24 - asrs r0, 24 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ldrsb r1, [r7, r1] - lsls r1, 16 - lsrs r1, 16 - bl get_mapheader_by_bank_and_number - adds r5, r0, 0 - ldr r1, [r4] - ldrb r0, [r5, 0x14] - strh r0, [r1] -_08123A8A: - ldr r4, =0x0203a144 - ldr r0, [r4] - ldrb r0, [r0] - bl sub_8123F74 - adds r1, r0, 0 - cmp r1, 0 - beq _08123AAC - ldr r0, [r4] - adds r0, 0x7F - movs r1, 0x1 - b _08123AB0 - .pool -_08123AAC: - ldr r0, [r4] - adds r0, 0x7F -_08123AB0: - strb r1, [r0] - ldr r0, [r5] - ldrh r2, [r0] - ldrh r0, [r0, 0x4] - mov r9, r0 - ldrh r6, [r7, 0x4] - ldrh r3, [r7, 0x6] -_08123ABE: - str r6, [sp] - ldr r5, =gRegionMapEntries - ldr r4, =0x0203a144 - ldr r0, [r4] - mov r10, r0 - ldrh r7, [r0] - lsls r0, r7, 3 - adds r0, r5 - str r0, [sp, 0x4] - ldrb r0, [r0, 0x2] - mov r8, r0 - adds r0, r2, 0 - mov r1, r8 - str r3, [sp, 0x8] - bl __divsi3 - lsls r0, 16 - lsrs r1, r0, 16 - ldr r3, [sp, 0x8] - cmp r1, 0 - bne _08123AEA - movs r1, 0x1 -_08123AEA: - adds r0, r6, 0 - str r3, [sp, 0x8] - bl __udivsi3 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r3, [sp, 0x8] - cmp r6, r8 - bcc _08123B04 - mov r0, r8 - subs r0, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 -_08123B04: - ldr r2, [sp, 0x4] - ldrb r4, [r2, 0x3] - mov r0, r9 - adds r1, r4, 0 - str r3, [sp, 0x8] - bl __divsi3 - lsls r0, 16 - lsrs r1, r0, 16 - ldr r3, [sp, 0x8] - cmp r1, 0 - bne _08123B1E - movs r1, 0x1 -_08123B1E: - adds r0, r3, 0 - bl __udivsi3 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r4 - bcc _08123B32 - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 -_08123B32: - cmp r7, 0x29 - beq _08123B5E - cmp r7, 0x29 - bgt _08123B4C - cmp r7, 0x1D - beq _08123B56 - cmp r7, 0x24 - beq _08123B94 - b _08123BC6 - .pool -_08123B4C: - cmp r7, 0x33 - beq _08123B5E - cmp r7, 0xCC - beq _08123BB8 - b _08123BC6 -_08123B56: - cmp r3, 0 - beq _08123BC6 - movs r6, 0 - b _08123BC6 -_08123B5E: - movs r6, 0 - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r2, 0 - ldrsh r0, [r1, r2] - cmp r0, 0x20 - ble _08123B6E - movs r6, 0x1 -_08123B6E: - cmp r0, 0x33 - ble _08123B78 - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 -_08123B78: - movs r3, 0 - movs r2, 0x2 - ldrsh r0, [r1, r2] - cmp r0, 0x25 - ble _08123B84 - movs r3, 0x1 -_08123B84: - cmp r0, 0x38 - ble _08123BC6 - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - b _08123BC6 - .pool -_08123B94: - movs r6, 0 - ldr r0, [sp] - cmp r0, 0xE - bls _08123B9E - movs r6, 0x1 -_08123B9E: - ldr r2, [sp] - cmp r2, 0x1C - bls _08123BAA - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 -_08123BAA: - ldr r0, [sp] - cmp r0, 0x36 - bls _08123BC6 - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - b _08123BC6 -_08123BB8: - mov r0, r10 - adds r0, 0x54 - mov r1, r10 - adds r1, 0x56 - bl sub_8123F30 - b _08123BEC -_08123BC6: - ldr r0, =0x0203a144 - ldr r2, [r0] - ldrh r0, [r2] - lsls r0, 3 - adds r0, r5 - ldrb r0, [r0] - adds r0, r6, r0 - adds r0, 0x1 - adds r1, r2, 0 - adds r1, 0x54 - strh r0, [r1] - ldrh r0, [r2] - lsls r0, 3 - adds r0, r5 - ldrb r0, [r0, 0x1] - adds r0, r3, r0 - adds r0, 0x2 - adds r2, 0x56 - strh r0, [r2] -_08123BEC: - 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_81238AC - - thumb_func_start sub_8123C00 -sub_8123C00: @ 8123C00 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - movs r7, 0 - movs r0, 0 - mov r8, r0 - mov r4, sp - adds r4, 0x1 - mov r5, sp - adds r5, 0x2 - add r6, sp, 0x4 - mov r0, sp - adds r1, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl sub_8137FFC - lsls r0, 24 - lsrs r0, 24 - mov r10, r5 - cmp r0, 0x4 - bhi _08123C94 - lsls r0, 2 - ldr r1, =_08123C40 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08123C40: - .4byte _08123C94 - .4byte _08123C54 - .4byte _08123C64 - .4byte _08123C74 - .4byte _08123C84 -_08123C54: - ldr r2, =0x0203a144 - ldr r1, [r2] - movs r0, 0x8 - strh r0, [r1] - b _08123D10 - .pool -_08123C64: - ldr r2, =0x0203a144 - ldr r1, [r2] - movs r0, 0xC - strh r0, [r1] - b _08123D10 - .pool -_08123C74: - ldr r2, =0x0203a144 - ldr r1, [r2] - movs r0, 0x27 - strh r0, [r1] - b _08123D10 - .pool -_08123C84: - ldr r2, =0x0203a144 - ldr r1, [r2] - movs r0, 0x2E - strh r0, [r1] - b _08123D10 - .pool -_08123C94: - mov r0, sp - ldrb r0, [r0] - ldrb r1, [r4] - bl get_mapheader_by_bank_and_number - ldr r1, =0x0203a144 - mov r9, r1 - ldr r2, [r1] - ldrb r1, [r0, 0x14] - strh r1, [r2] - ldr r6, [r0] - ldr r1, =gRegionMapEntries - ldrh r0, [r2] - lsls r0, 3 - adds r5, r0, r1 - ldrb r4, [r5, 0x2] - ldr r0, [r6] - adds r1, r4, 0 - bl __divsi3 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - bne _08123CC6 - movs r1, 0x1 -_08123CC6: - mov r2, r10 - movs r3, 0 - ldrsh r0, [r2, r3] - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r8, r4 - bcc _08123CE2 - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 -_08123CE2: - ldrb r4, [r5, 0x3] - ldr r0, [r6, 0x4] - adds r1, r4, 0 - bl __divsi3 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - bne _08123CF6 - movs r1, 0x1 -_08123CF6: - mov r2, sp - movs r3, 0x4 - ldrsh r0, [r2, r3] - bl __divsi3 - lsls r0, 16 - lsrs r7, r0, 16 - mov r2, r9 - cmp r7, r4 - bcc _08123D10 - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 -_08123D10: - ldr r0, [r2] - adds r0, 0x7F - movs r1, 0 - strb r1, [r0] - ldr r2, [r2] - ldr r3, =gRegionMapEntries - ldrh r0, [r2] - lsls r0, 3 - adds r0, r3 - ldrb r0, [r0] - add r0, r8 - adds r0, 0x1 - adds r1, r2, 0 - adds r1, 0x54 - strh r0, [r1] - ldrh r0, [r2] - lsls r0, 3 - adds r0, r3 - ldrb r0, [r0, 0x1] - adds r0, r7, r0 - adds r0, 0x2 - adds r2, 0x56 - strh r0, [r2] - 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_8123C00 - - thumb_func_start get_flagnr_blue_points -get_flagnr_blue_points: @ 8123D58 - push {lr} - lsls r0, 16 - lsrs r0, 16 - adds r1, r0, 0 - cmp r0, 0x9 - beq _08123E18 - cmp r0, 0x9 - bgt _08123D9A - cmp r0, 0x4 - beq _08123DF0 - cmp r0, 0x4 - bgt _08123D88 - cmp r0, 0x1 - beq _08123DD8 - cmp r0, 0x1 - bgt _08123D7E - cmp r0, 0 - beq _08123DD0 - b _08123E94 -_08123D7E: - cmp r0, 0x2 - beq _08123DDE - cmp r0, 0x3 - beq _08123DE8 - b _08123E94 -_08123D88: - cmp r0, 0x6 - beq _08123E00 - cmp r0, 0x6 - blt _08123DF8 - cmp r0, 0x7 - beq _08123E08 - cmp r0, 0x8 - beq _08123E10 - b _08123E94 -_08123D9A: - cmp r0, 0xE - beq _08123E40 - cmp r0, 0xE - bgt _08123DB4 - cmp r0, 0xB - beq _08123E28 - cmp r0, 0xB - blt _08123E20 - cmp r0, 0xC - beq _08123E30 - cmp r0, 0xD - beq _08123E38 - b _08123E94 -_08123DB4: - cmp r0, 0x3A - beq _08123E60 - cmp r0, 0x3A - bgt _08123DC2 - cmp r0, 0xF - beq _08123E48 - b _08123E94 -_08123DC2: - cmp r1, 0x49 - beq _08123E7C - cmp r1, 0xD5 - beq _08123DCC - b _08123E94 -_08123DCC: - movs r0, 0 - b _08123E96 -_08123DD0: - ldr r0, =0x0000086f - b _08123E4A - .pool -_08123DD8: - movs r0, 0x87 - lsls r0, 4 - b _08123E4A -_08123DDE: - ldr r0, =0x00000871 - b _08123E4A - .pool -_08123DE8: - ldr r0, =0x00000872 - b _08123E4A - .pool -_08123DF0: - ldr r0, =0x00000873 - b _08123E4A - .pool -_08123DF8: - ldr r0, =0x00000874 - b _08123E4A - .pool -_08123E00: - ldr r0, =0x00000875 - b _08123E4A - .pool -_08123E08: - ldr r0, =0x00000876 - b _08123E4A - .pool -_08123E10: - ldr r0, =0x00000877 - b _08123E4A - .pool -_08123E18: - ldr r0, =0x00000878 - b _08123E4A - .pool -_08123E20: - ldr r0, =0x00000879 - b _08123E4A - .pool -_08123E28: - ldr r0, =0x0000087a - b _08123E4A - .pool -_08123E30: - ldr r0, =0x0000087b - b _08123E4A - .pool -_08123E38: - ldr r0, =0x0000087c - b _08123E4A - .pool -_08123E40: - ldr r0, =0x0000087d - b _08123E4A - .pool -_08123E48: - ldr r0, =0x0000087e -_08123E4A: - bl FlagGet - lsls r0, 24 - movs r1, 0x3 - cmp r0, 0 - beq _08123E58 - movs r1, 0x2 -_08123E58: - adds r0, r1, 0 - b _08123E96 - .pool -_08123E60: - ldr r0, =0x000008a8 - bl FlagGet - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - negs r0, r1 - orrs r0, r1 - asrs r0, 31 - movs r1, 0x4 - ands r0, r1 - b _08123E96 - .pool -_08123E7C: - ldr r0, =0x000008a9 - bl FlagGet - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - b _08123E96 - .pool -_08123E94: - movs r0, 0x1 -_08123E96: - pop {r1} - bx r1 - thumb_func_end get_flagnr_blue_points - - thumb_func_start sub_8123E9C -sub_8123E9C: @ 8123E9C - push {lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - lsrs r1, 16 - bl sub_812386C - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_8123E9C - - thumb_func_start sub_8123EB4 -sub_8123EB4: @ 8123EB4 - push {lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - ldr r1, =gUnknown_085A1B84 -_08123EBE: - ldrh r0, [r1] - cmp r0, r3 - bne _08123ED4 - bl sub_8123F04 - lsls r0, 16 - lsrs r0, 16 - b _08123F00 - .pool -_08123ED4: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, 0x2 - bls _08123EBE - ldr r1, =gUnknown_085A1B24 - ldrh r0, [r1] - cmp r0, 0xD5 - beq _08123EFE - adds r2, r1, 0 -_08123EE6: - ldrh r0, [r2] - cmp r0, r3 - bne _08123EF4 - ldrh r0, [r1, 0x2] - b _08123F00 - .pool -_08123EF4: - adds r1, 0x4 - adds r2, 0x4 - ldrh r0, [r1] - cmp r0, 0xD5 - bne _08123EE6 -_08123EFE: - adds r0, r3, 0 -_08123F00: - pop {r1} - bx r1 - thumb_func_end sub_8123EB4 - - thumb_func_start sub_8123F04 -sub_8123F04: @ 8123F04 - push {lr} - ldr r0, =0x00004037 - bl VarGet - subs r0, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0xF - bls _08123F18 - movs r1, 0 -_08123F18: - ldr r0, =gUnknown_085A1B8A - lsls r1, 16 - asrs r1, 15 - adds r1, r0 - ldrh r0, [r1] - pop {r1} - bx r1 - .pool - thumb_func_end sub_8123F04 - - thumb_func_start sub_8123F30 -sub_8123F30: @ 8123F30 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, =0x00004037 - bl VarGet - lsls r0, 16 - lsrs r1, r0, 16 - ldr r2, =0xfff70000 - adds r0, r2 - lsrs r0, 16 - cmp r0, 0x7 - bls _08123F4C - movs r1, 0x9 -_08123F4C: - subs r1, 0x9 - lsls r1, 16 - ldr r0, =gUnknown_085A1BAC - lsrs r1, 14 - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r4] - ldrh r0, [r1, 0x2] - adds r0, 0x2 - strh r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8123F30 - - thumb_func_start sub_8123F74 -sub_8123F74: @ 8123F74 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0 - ldr r3, =gUnknown_085A1BCC -_08123F7E: - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _08123F90 - movs r0, 0x1 - b _08123F98 - .pool -_08123F90: - adds r1, 0x1 - cmp r1, 0 - beq _08123F7E - movs r0, 0 -_08123F98: - pop {r1} - bx r1 - thumb_func_end sub_8123F74 - - thumb_func_start sub_8123F9C -sub_8123F9C: @ 8123F9C - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl sub_8123EB4 - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_8123F9C - - thumb_func_start sub_8123FB0 -sub_8123FB0: @ 8123FB0 - push {r4-r6,lr} - ldr r0, =0x0203a144 - ldr r1, [r0] - ldrh r0, [r1] - cmp r0, 0xD5 - bne _08123FC8 - movs r0, 0 - strb r0, [r1, 0x3] - b _0812402E - .pool -_08123FC8: - adds r0, r1, 0 - adds r0, 0x78 - ldrb r0, [r0] - cmp r0, 0 - bne _08123FD8 - adds r0, r1, 0 - adds r0, 0x54 - b _08123FDC -_08123FD8: - adds r0, r1, 0 - adds r0, 0x64 -_08123FDC: - ldrh r4, [r0] - adds r0, 0x2 - ldrh r5, [r0] - movs r6, 0 - b _08124008 -_08123FE6: - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_812386C - ldr r1, =0x0203a144 - ldr r1, [r1] - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r1] - cmp r0, r1 - bne _08124008 - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 -_08124008: - cmp r4, 0x1 - bhi _08123FE6 - adds r0, r5, 0 - bl sub_8124038 - lsls r0, 24 - cmp r0, 0 - beq _08124028 - subs r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - movs r4, 0x1D - b _08124008 - .pool -_08124028: - ldr r0, =0x0203a144 - ldr r0, [r0] - strb r6, [r0, 0x3] -_0812402E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8123FB0 - - thumb_func_start sub_8124038 -sub_8124038: @ 8124038 - push {r4,r5,lr} - lsls r0, 16 - ldr r1, =0xffff0000 - adds r0, r1 - lsrs r5, r0, 16 - ldr r0, =0x0000ffff - cmp r5, r0 - bne _08124058 - b _0812407A - .pool -_08124054: - movs r0, 0x1 - b _0812407C -_08124058: - movs r4, 0x1 -_0812405A: - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_812386C - ldr r1, =0x0203a144 - ldr r1, [r1] - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r1] - cmp r0, r1 - beq _08124054 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x1C - bls _0812405A -_0812407A: - movs r0, 0 -_0812407C: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8124038 - - thumb_func_start sub_8124088 -sub_8124088: @ 8124088 - push {r4,lr} - adds r2, r0, 0 - ldr r0, =0x0203a144 - ldr r1, [r0] - adds r3, r1, 0 - adds r3, 0x7A - movs r0, 0 - ldrsb r0, [r3, r0] - cmp r0, 0 - beq _081240C6 - adds r0, r1, 0 - adds r0, 0x7B - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 1 - ldrh r4, [r2, 0x20] - adds r0, r4 - strh r0, [r2, 0x20] - adds r0, r1, 0 - adds r0, 0x7C - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 1 - ldrh r1, [r2, 0x22] - adds r0, r1 - strh r0, [r2, 0x22] - ldrb r0, [r3] - subs r0, 0x1 - strb r0, [r3] -_081240C6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8124088 - - thumb_func_start TaskDummy8 -TaskDummy8: @ 81240D0 - bx lr - thumb_func_end TaskDummy8 - - thumb_func_start sub_81240D4 -sub_81240D4: @ 81240D4 - push {r4-r7,lr} - sub sp, 0x28 - lsls r0, 16 - lsls r1, 16 - lsrs r6, r1, 16 - ldr r1, =gUnknown_085A1C00 - ldr r2, [r1, 0x4] - ldr r1, [r1] - str r1, [sp, 0x20] - str r2, [sp, 0x24] - mov r2, sp - ldr r1, =gUnknown_085A1C08 - ldm r1!, {r3-r5} - stm r2!, {r3-r5} - ldm r1!, {r3-r5} - stm r2!, {r3-r5} - lsrs r3, r0, 16 - add r2, sp, 0x18 - ldrh r1, [r2, 0x4] - orrs r1, r0 - str r1, [r2, 0x4] - mov r0, sp - strh r3, [r0] - ldr r0, =0x0203a144 - ldr r4, [r0] - adds r0, r4, 0 - adds r0, 0x58 - strh r3, [r0] - ldr r5, =0xffff0000 - add r1, sp, 0x20 - ldr r0, [r1, 0x4] - ands r0, r5 - orrs r0, r6 - str r0, [r1, 0x4] - mov r0, sp - strh r6, [r0, 0x2] - adds r3, r4, 0 - adds r0, r3, 0 - adds r0, 0x5A - strh r6, [r0] - adds r0, 0x1E - ldrb r0, [r0] - adds r7, r1, 0 - cmp r0, 0 - bne _08124158 - movs r1, 0xC2 - lsls r1, 1 - adds r0, r3, r1 - str r0, [sp, 0x18] - ldr r0, [r2, 0x4] - ands r0, r5 - subs r1, 0x84 - orrs r0, r1 - str r0, [r2, 0x4] - ldr r0, =sub_8124088 - b _0812416E - .pool -_08124158: - movs r3, 0xA1 - lsls r3, 2 - adds r0, r4, r3 - str r0, [sp, 0x18] - ldr r0, [r2, 0x4] - ands r0, r5 - movs r1, 0xC0 - lsls r1, 3 - orrs r0, r1 - str r0, [r2, 0x4] - ldr r0, =TaskDummy8 -_0812416E: - str r0, [sp, 0x14] - adds r0, r2, 0 - bl LoadObjectPic - adds r0, r7, 0 - bl LoadTaggedObjectPalette - mov r0, sp - movs r1, 0x38 - movs r2, 0x48 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _08124228 - ldr r4, =0x0203a144 - ldr r2, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r3, r0, r1 - str r3, [r2, 0x1C] - adds r2, 0x78 - ldrb r0, [r2] - cmp r0, 0x1 - bne _081241DC - ldrb r1, [r3, 0x3] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x80 - orrs r0, r1 - strb r0, [r3, 0x3] - ldr r2, [r4] - ldr r1, [r2, 0x1C] - ldrh r0, [r1, 0x20] - subs r0, 0x8 - strh r0, [r1, 0x20] - ldr r1, [r2, 0x1C] - ldrh r0, [r1, 0x22] - subs r0, 0x8 - strh r0, [r1, 0x22] - ldr r0, [r2, 0x1C] - movs r1, 0x1 - bl StartObjectImageAnim - b _08124204 - .pool -_081241DC: - ldrb r1, [r3, 0x3] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x40 - orrs r0, r1 - strb r0, [r3, 0x3] - ldr r1, [r4] - ldr r2, [r1, 0x1C] - adds r0, r1, 0 - adds r0, 0x54 - ldrh r0, [r0] - lsls r0, 3 - adds r0, 0x4 - strh r0, [r2, 0x20] - ldr r2, [r1, 0x1C] - adds r1, 0x56 - ldrh r0, [r1] - lsls r0, 3 - adds r0, 0x4 - strh r0, [r2, 0x22] -_08124204: - ldr r4, =0x0203a144 - ldr r0, [r4] - ldr r1, [r0, 0x1C] - movs r0, 0x2 - strh r0, [r1, 0x30] - adds r0, r6, 0 - bl IndexOfObjectPaletteTag - ldr r1, [r4] - ldr r2, [r1, 0x1C] - lsls r0, 24 - lsrs r0, 20 - ldr r4, =0x00000101 - adds r0, r4 - strh r0, [r2, 0x32] - ldr r1, [r1, 0x1C] - movs r0, 0x1 - strh r0, [r1, 0x34] -_08124228: - add sp, 0x28 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81240D4 - - thumb_func_start sub_8124238 -sub_8124238: @ 8124238 - push {r4,lr} - ldr r4, =0x0203a144 - ldr r0, [r4] - ldr r0, [r0, 0x1C] - cmp r0, 0 - beq _0812425C - bl RemoveObjectAndFreeTiles - ldr r0, [r4] - adds r0, 0x58 - ldrh r0, [r0] - bl FreeObjectTilesByTag - ldr r0, [r4] - adds r0, 0x5A - ldrh r0, [r0] - bl FreeObjectPaletteByTag -_0812425C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8124238 - - thumb_func_start sub_8124268 -sub_8124268: @ 8124268 - ldr r0, =0x0203a144 - ldr r0, [r0] - ldr r1, [r0, 0x1C] - movs r0, 0x1 - strh r0, [r1, 0x34] - bx lr - .pool - thumb_func_end sub_8124268 - - thumb_func_start sub_8124278 -sub_8124278: @ 8124278 - ldr r0, =0x0203a144 - ldr r0, [r0] - ldr r1, [r0, 0x1C] - movs r0, 0 - strh r0, [r1, 0x34] - bx lr - .pool - thumb_func_end sub_8124278 - - thumb_func_start sub_8124288 -sub_8124288: @ 8124288 - push {r4-r6,lr} - sub sp, 0x28 - lsls r0, 16 - lsls r1, 16 - lsrs r1, 16 - ldr r2, =gUnknown_085A084C - str r2, [sp, 0x18] - movs r2, 0x80 - add r6, sp, 0x18 - lsrs r3, r0, 16 - orrs r0, r2 - str r0, [r6, 0x4] - ldr r0, =gUnknown_085A082C - str r0, [sp, 0x20] - ldr r2, =0xffff0000 - add r4, sp, 0x20 - ldr r0, [r4, 0x4] - ands r0, r2 - orrs r0, r1 - str r0, [r4, 0x4] - mov r0, sp - movs r5, 0 - strh r3, [r0] - strh r1, [r0, 0x2] - ldr r0, =gUnknown_085A1C20 - str r0, [sp, 0x4] - ldr r0, =gUnknown_085A1C30 - str r0, [sp, 0x8] - str r5, [sp, 0xC] - ldr r0, =gDummyObjectRotScalAnimTable - str r0, [sp, 0x10] - ldr r0, =DummyObjectCallback - str r0, [sp, 0x14] - ldr r0, =0x02037318 - ldrb r0, [r0, 0x14] - bl sub_8124668 - cmp r0, 0 - beq _08124304 - ldr r0, =0x0203a144 - ldr r0, [r0] - str r5, [r0, 0x20] - b _081243A4 - .pool -_08124304: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0x1 - bne _08124316 - ldr r0, =gUnknown_085A08EC - str r0, [sp, 0x18] - ldr r0, =gUnknown_085A08CC - str r0, [sp, 0x20] -_08124316: - adds r0, r6, 0 - bl LoadObjectPic - adds r0, r4, 0 - bl LoadTaggedObjectPalette - mov r0, sp - movs r1, 0 - movs r2, 0 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0203a144 - ldr r2, [r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - str r1, [r2, 0x20] - adds r0, r2, 0 - adds r0, 0x78 - ldrb r0, [r0] - cmp r0, 0 - bne _08124384 - adds r0, r2, 0 - adds r0, 0x74 - ldrh r0, [r0] - lsls r0, 3 - adds r0, 0x4 - strh r0, [r1, 0x20] - ldr r1, [r2, 0x20] - adds r0, r2, 0 - adds r0, 0x76 - ldrh r0, [r0] - lsls r0, 3 - adds r0, 0x4 - strh r0, [r1, 0x22] - ldr r1, [r2, 0x20] - ldr r0, =sub_81244EC - b _081243A2 - .pool -_08124384: - adds r0, r2, 0 - adds r0, 0x74 - ldrh r0, [r0] - lsls r0, 4 - subs r0, 0x30 - strh r0, [r1, 0x20] - ldr r1, [r2, 0x20] - adds r0, r2, 0 - adds r0, 0x76 - ldrh r0, [r0] - lsls r0, 4 - subs r0, 0x42 - strh r0, [r1, 0x22] - ldr r1, [r2, 0x20] - ldr r0, =sub_812445C -_081243A2: - str r0, [r1, 0x1C] -_081243A4: - add sp, 0x28 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8124288 - - thumb_func_start sub_81243B0 -sub_81243B0: @ 81243B0 - push {lr} - ldr r3, =0x0203a144 - ldr r0, [r3] - ldr r2, [r0, 0x20] - cmp r2, 0 - beq _081243CE - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, [r3] - ldr r1, [r0, 0x20] - ldr r0, =DummyObjectCallback - str r0, [r1, 0x1C] -_081243CE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81243B0 - - thumb_func_start sub_81243DC -sub_81243DC: @ 81243DC - push {lr} - ldr r0, =0x0203a144 - ldr r3, [r0] - ldr r1, [r3, 0x20] - cmp r1, 0 - beq _08124452 - adds r0, r3, 0 - adds r0, 0x78 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0812441C - adds r0, r3, 0 - adds r0, 0x74 - ldrh r0, [r0] - lsls r0, 4 - subs r0, 0x30 - strh r0, [r1, 0x20] - ldr r1, [r3, 0x20] - adds r0, r3, 0 - adds r0, 0x76 - ldrh r0, [r0] - lsls r0, 4 - subs r0, 0x42 - strh r0, [r1, 0x22] - ldr r1, [r3, 0x20] - ldr r0, =sub_812445C - b _08124444 - .pool -_0812441C: - adds r0, r3, 0 - adds r0, 0x74 - ldrh r0, [r0] - lsls r0, 3 - adds r0, 0x4 - movs r2, 0 - strh r0, [r1, 0x20] - ldr r1, [r3, 0x20] - adds r0, r3, 0 - adds r0, 0x76 - ldrh r0, [r0] - lsls r0, 3 - adds r0, 0x4 - strh r0, [r1, 0x22] - ldr r0, [r3, 0x20] - strh r2, [r0, 0x24] - ldr r0, [r3, 0x20] - strh r2, [r0, 0x26] - ldr r1, [r3, 0x20] - ldr r0, =sub_81244EC -_08124444: - str r0, [r1, 0x1C] - adds r1, 0x3E - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] -_08124452: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81243DC - - thumb_func_start sub_812445C -sub_812445C: @ 812445C - push {r4,lr} - adds r3, r0, 0 - ldr r0, =0x0203a144 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x5C - movs r4, 0 - ldrsh r2, [r0, r4] - lsls r2, 1 - negs r2, r2 - strh r2, [r3, 0x24] - adds r1, 0x5E - movs r4, 0 - ldrsh r0, [r1, r4] - lsls r0, 1 - negs r0, r0 - strh r0, [r3, 0x26] - ldrh r1, [r3, 0x22] - adds r1, r0 - adds r0, r3, 0 - adds r0, 0x29 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - adds r0, r1 - strh r0, [r3, 0x2E] - ldrh r1, [r3, 0x20] - adds r1, r2 - adds r2, r3, 0 - adds r2, 0x28 - ldrb r2, [r2] - lsls r2, 24 - asrs r2, 24 - adds r2, r1 - strh r2, [r3, 0x30] - adds r0, 0x8 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xB0 - bhi _081244BC - lsls r0, r2, 16 - asrs r2, r0, 16 - movs r0, 0x8 - negs r0, r0 - cmp r2, r0 - blt _081244BC - cmp r2, 0xF8 - ble _081244C4 -_081244BC: - movs r0, 0 - b _081244C6 - .pool -_081244C4: - movs r0, 0x1 -_081244C6: - strh r0, [r3, 0x32] - movs r1, 0x32 - ldrsh r0, [r3, r1] - cmp r0, 0x1 - bne _081244D8 - adds r0, r3, 0 - bl sub_81244F8 - b _081244E4 -_081244D8: - adds r0, r3, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_081244E4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812445C - - thumb_func_start sub_81244EC -sub_81244EC: @ 81244EC - push {lr} - bl sub_81244F8 - pop {r0} - bx r0 - thumb_func_end sub_81244EC - - thumb_func_start sub_81244F8 -sub_81244F8: @ 81244F8 - push {lr} - adds r2, r0, 0 - ldr r0, =0x0203a144 - ldr r0, [r0] - adds r0, 0x7E - ldrb r0, [r0] - cmp r0, 0 - beq _0812453C - ldrh r0, [r2, 0x3C] - adds r0, 0x1 - strh r0, [r2, 0x3C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - ble _08124548 - movs r0, 0 - strh r0, [r2, 0x3C] - adds r3, r2, 0 - adds r3, 0x3E - ldrb r2, [r3] - lsrs r1, r2, 2 - movs r0, 0x1 - eors r1, r0 - ands r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - b _08124548 - .pool -_0812453C: - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_08124548: - pop {r0} - bx r0 - thumb_func_end sub_81244F8 - - thumb_func_start sub_812454C -sub_812454C: @ 812454C - push {lr} - ldr r0, =0x0203a144 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x7F - ldrb r0, [r0] - cmp r0, 0 - beq _08124562 - adds r1, 0x7E - movs r0, 0x1 - strb r0, [r1] -_08124562: - pop {r0} - bx r0 - .pool - thumb_func_end sub_812454C - - thumb_func_start GetMapName -@ u8 *GetMapName(u8 *dest, u16 regionMapId, u16 padLength) -GetMapName: @ 812456C - push {r4,r5,lr} - adds r5, r0, 0 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r4, r2, 16 - cmp r1, 0x56 - bne _08124584 - bl GetSecretBaseMapName - adds r1, r0, 0 - b _081245B2 -_08124584: - cmp r1, 0xD4 - bhi _081245A0 - ldr r0, =gRegionMapEntries - lsls r1, 3 - adds r0, 0x4 - adds r1, r0 - ldr r1, [r1] - adds r0, r5, 0 - bl CopyString - adds r1, r0, 0 - b _081245B2 - .pool -_081245A0: - cmp r4, 0 - bne _081245A6 - movs r4, 0x12 -_081245A6: - adds r0, r5, 0 - movs r1, 0 - adds r2, r4, 0 - bl RepeatChar - b _081245D6 -_081245B2: - cmp r4, 0 - beq _081245D4 - subs r0, r1, r5 - lsls r0, 16 - lsrs r0, 16 - cmp r0, r4 - bcs _081245D0 - movs r2, 0 -_081245C2: - strb r2, [r1] - adds r1, 0x1 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, r4 - bcc _081245C2 -_081245D0: - movs r0, 0xFF - strb r0, [r1] -_081245D4: - adds r0, r1, 0 -_081245D6: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end GetMapName - - thumb_func_start sub_81245DC -sub_81245DC: @ 81245DC - push {lr} - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0x56 - beq _081245F8 - cmp r1, 0x57 - bne _08124604 - ldr r1, =gUnknown_085EC9D2 - bl CopyString - b _0812460A - .pool -_081245F8: - ldr r1, =gUnknown_085EC9D8 - bl CopyString - b _0812460A - .pool -_08124604: - movs r2, 0 - bl GetMapName -_0812460A: - pop {r1} - bx r1 - thumb_func_end sub_81245DC - - thumb_func_start sub_8124610 -sub_8124610: @ 8124610 - push {lr} - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0x42 - beq _08124620 - bl sub_81245DC - b _08124626 -_08124620: - ldr r1, =gUnknown_085EC9E4 - bl CopyString -_08124626: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8124610 - - thumb_func_start sub_8124630 -sub_8124630: @ 8124630 - push {r4,r5,lr} - ldr r5, [sp, 0xC] - lsls r0, 16 - ldr r4, =gRegionMapEntries - lsrs r0, 13 - adds r0, r4 - ldrb r4, [r0] - strh r4, [r1] - ldrb r1, [r0, 0x1] - strh r1, [r2] - ldrb r1, [r0, 0x2] - strh r1, [r3] - ldrb r0, [r0, 0x3] - strh r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8124630 - - thumb_func_start sub_8124658 -sub_8124658: @ 8124658 - ldr r0, =0x0203a144 - ldr r0, [r0] - adds r0, 0x78 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8124658 - - thumb_func_start sub_8124668 -sub_8124668: @ 8124668 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0 - ldr r3, =gUnknown_085A1C34 -_08124672: - adds r0, r1, r3 - ldrb r0, [r0] - cmp r2, r0 - bne _08124684 - movs r0, 0x1 - b _0812468C - .pool -_08124684: - adds r1, 0x1 - cmp r1, 0x2 - bls _08124672 - movs r0, 0 -_0812468C: - pop {r1} - bx r1 - thumb_func_end sub_8124668 - - thumb_func_start sub_8124690 -sub_8124690: @ 8124690 - push {r4,lr} - sub sp, 0xC - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0xA - bls _081246A4 - b _081248AA -_081246A4: - lsls r0, 2 - ldr r1, =_081246B8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081246B8: - .4byte _081246E4 - .4byte _08124766 - .4byte _0812477C - .4byte _0812478C - .4byte _0812479C - .4byte _081247E4 - .4byte _081247F8 - .4byte _0812480C - .4byte _0812484C - .4byte _08124852 - .4byte _0812486C -_081246E4: - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1C - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - ldr r4, =0x0203a148 - ldr r0, =0x00000a74 - bl Alloc - str r0, [r4] - cmp r0, 0 - bne _08124754 - ldr r0, =sub_8086194 - bl SetMainCallback2 - b _081248AA - .pool -_08124754: - bl sub_80A1A74 - bl ResetAllObjectData - bl FreeAllObjectTiles - bl ResetObjectPaletteAllocator - b _0812489C -_08124766: - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085A1EE4 - movs r0, 0x1 - movs r2, 0x3 - bl InitBgsFromTemplates - b _0812489C - .pool -_0812477C: - ldr r0, =gUnknown_085A1EF0 - bl InitWindows - bl DeactivateAllTextPrinters - b _0812489C - .pool -_0812478C: - movs r0, 0 - movs r1, 0x65 - movs r2, 0xD0 - bl sub_809882C - bl clear_scheduled_bg_copies_to_vram - b _0812489C -_0812479C: - ldr r4, =0x0203a148 - ldr r0, [r4] - adds r0, 0x8 - movs r1, 0 - bl sub_8122CDC - movs r0, 0 - movs r1, 0 - bl sub_81240D4 - movs r0, 0x1 - movs r1, 0x1 - bl sub_8124288 - ldr r0, [r4] - ldrh r1, [r0, 0x8] - strh r1, [r0, 0x6] - ldr r1, =0x00000a4c - adds r0, r1 - movs r1, 0 - movs r2, 0x10 - bl RepeatChar - ldr r1, =0x03001180 - movs r0, 0x1 - str r0, [r1] - bl sub_8124904 - b _0812489C - .pool -_081247E4: - ldr r0, =gUnknown_085A1C58 - ldr r1, =0x0600c000 - bl LZ77UnCompVram - b _0812489C - .pool -_081247F8: - ldr r0, =gUnknown_085A1C90 - ldr r1, =0x0600f000 - bl LZ77UnCompVram - b _0812489C - .pool -_0812480C: - ldr r0, =gUnknown_085A1C38 - movs r1, 0x10 - movs r2, 0x20 - bl gpu_pal_apply - movs r0, 0x2 - bl PutWindowTilemap - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_085E8CB4 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - b _0812489C - .pool -_0812484C: - bl sub_8124A70 - b _0812489C -_08124852: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - ldr r0, =sub_81248C0 - bl SetVBlankCallback - b _0812489C - .pool -_0812486C: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuRegBits - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - ldr r0, =sub_8124D14 - bl sub_81248F4 - ldr r0, =sub_81248D4 - bl SetMainCallback2 -_0812489C: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_081248AA: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8124690 - - thumb_func_start sub_81248C0 -sub_81248C0: @ 81248C0 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_81248C0 - - thumb_func_start sub_81248D4 -sub_81248D4: @ 81248D4 - push {lr} - ldr r0, =0x0203a148 - ldr r0, [r0] - ldr r0, [r0] - bl _call_via_r0 - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl do_scheduled_bg_tilemap_copies_to_vram - pop {r0} - bx r0 - .pool - thumb_func_end sub_81248D4 - - thumb_func_start sub_81248F4 -sub_81248F4: @ 81248F4 - ldr r1, =0x0203a148 - ldr r1, [r1] - str r0, [r1] - movs r0, 0 - strh r0, [r1, 0x4] - bx lr - .pool - thumb_func_end sub_81248F4 - - thumb_func_start sub_8124904 -sub_8124904: @ 8124904 - push {r4-r7,lr} - sub sp, 0xC - ldr r2, =0x0203a148 - ldr r0, [r2] - ldrb r0, [r0, 0xA] - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _0812491A - b _08124A2C -_0812491A: - movs r7, 0 - movs r3, 0 - ldr r0, =gUnknown_085A1EDC - mov r12, r0 - adds r5, r2, 0 - movs r6, 0 -_08124926: - ldr r0, [r5] - lsls r1, r3, 3 - mov r2, r12 - adds r4, r1, r2 - ldrh r0, [r0, 0x8] - ldrh r1, [r4, 0x4] - cmp r0, r1 - bne _081249C4 - ldrh r0, [r4, 0x6] - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _081249CE - ldr r0, [r5] - ldrb r0, [r0, 0xB] - ldr r1, [r4] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl GetStringLength - movs r7, 0x1 - movs r0, 0 - movs r1, 0 - bl sub_8198070 - movs r0, 0x1 - movs r1, 0 - movs r2, 0x65 - movs r3, 0xD - bl SetWindowBorderStyle - ldr r2, [r5] - adds r2, 0xC - str r7, [sp] - str r6, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0 - bl Print - ldr r0, [r5] - ldrb r0, [r0, 0xB] - ldr r1, [r4] - lsls r0, 2 - adds r0, r1 - ldr r4, [r0] - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x60 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x11 - str r0, [sp] - str r6, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r4, 0 - bl Print - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =0x03001180 - str r7, [r0] - b _081249CE - .pool -_081249C4: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0 - beq _08124926 -_081249CE: - cmp r7, 0 - bne _08124A62 - ldr r0, =0x03001180 - ldr r0, [r0] - cmp r0, 0x1 - bne _081249F4 - movs r0, 0x1 - movs r1, 0 - bl sub_8198070 - movs r0, 0 - movs r1, 0 - movs r2, 0x65 - movs r3, 0xD - bl SetWindowBorderStyle - b _081249FC - .pool -_081249F4: - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer -_081249FC: - ldr r0, =0x0203a148 - ldr r2, [r0] - adds r2, 0xC - movs r0, 0x1 - str r0, [sp] - movs r4, 0 - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =0x03001180 - str r4, [r0] - b _08124A62 - .pool -_08124A2C: - ldr r4, =0x03001180 - ldr r0, [r4] - cmp r0, 0x1 - bne _08124A48 - movs r0, 0x1 - movs r1, 0 - bl sub_8198070 - movs r0, 0 - movs r1, 0 - movs r2, 0x65 - movs r3, 0xD - bl SetWindowBorderStyle -_08124A48: - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0 - str r0, [r4] -_08124A62: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8124904 - - thumb_func_start sub_8124A70 -sub_8124A70: @ 8124A70 - push {r4,r5,lr} - sub sp, 0x8 - ldr r0, =gUnknown_085A1D68 - ldr r5, =0x0203a148 - ldr r1, [r5] - ldr r4, =0x0000088c - adds r1, r4 - bl LZ77UnCompWram - ldr r0, [r5] - adds r0, r4 - str r0, [sp] - ldr r1, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r1 - movs r1, 0xE0 - lsls r1, 1 - orrs r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 10 - orrs r0, r1 - str r0, [sp, 0x4] - mov r0, sp - bl LoadObjectPic - ldr r0, =gUnknown_085A1F10 - bl LoadTaggedObjectPalette - bl sub_8124AD4 - bl sub_8124BE4 - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8124A70 - - thumb_func_start sub_8124AD4 -sub_8124AD4: @ 8124AD4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - ldr r0, =0x0000086f - str r0, [sp, 0xC] - movs r1, 0 - mov r9, r1 - mov r2, sp - adds r2, 0x6 - str r2, [sp, 0x14] - mov r3, sp - adds r3, 0xA - str r3, [sp, 0x18] - mov r0, sp - adds r0, 0x8 - str r0, [sp, 0x10] - add r1, sp, 0x4 - mov r10, r1 -_08124AFE: - ldr r2, [sp, 0x18] - str r2, [sp] - mov r0, r9 - add r1, sp, 0x4 - mov r2, sp - adds r2, 0x6 - ldr r3, [sp, 0x10] - bl sub_8124630 - mov r3, r10 - ldrh r0, [r3] - adds r0, 0x1 - lsls r0, 3 - adds r0, 0x4 - strh r0, [r3] - mov r1, sp - ldrh r0, [r1, 0x6] - adds r0, 0x2 - lsls r0, 3 - adds r0, 0x4 - strh r0, [r1, 0x6] - ldr r2, [sp, 0x10] - ldrh r0, [r2] - cmp r0, 0x2 - bne _08124B38 - movs r7, 0x1 - b _08124B44 - .pool -_08124B38: - ldr r3, [sp, 0x18] - ldrh r0, [r3] - movs r7, 0 - cmp r0, 0x2 - bne _08124B44 - movs r7, 0x2 -_08124B44: - mov r0, r10 - movs r2, 0 - ldrsh r1, [r0, r2] - ldr r3, [sp, 0x14] - movs r0, 0 - ldrsh r2, [r3, r0] - ldr r0, =gUnknown_085A1F7C - movs r3, 0xA - bl AddObjectToFront - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x40 - beq _08124BB8 - ldr r1, =0x02020630 - mov r8, r1 - lsls r4, r5, 4 - adds r0, r4, r5 - lsls r6, r0, 2 - adds r2, r6, r1 - lsls r3, r7, 6 - ldrb r1, [r2, 0x1] - movs r0, 0x3F - ands r0, r1 - orrs r0, r3 - strb r0, [r2, 0x1] - ldr r0, [sp, 0xC] - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08124B9C - mov r0, r8 - adds r0, 0x1C - adds r0, r6, r0 - ldr r1, =sub_8124CBC - str r1, [r0] - b _08124BA2 - .pool -_08124B9C: - adds r0, r7, 0x3 - lsls r0, 16 - lsrs r7, r0, 16 -_08124BA2: - adds r4, r5 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - lsls r1, r7, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - mov r2, r9 - strh r2, [r4, 0x2E] -_08124BB8: - ldr r0, [sp, 0xC] - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0xC] - mov r0, r9 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - cmp r0, 0xF - bls _08124AFE - 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_8124AD4 - - thumb_func_start sub_8124BE4 -sub_8124BE4: @ 8124BE4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - movs r0, 0 - mov r8, r0 - ldr r6, =gUnknown_085A1F18 - ldrh r0, [r6, 0x2] - cmp r0, 0xD5 - beq _08124C9C - mov r5, sp - adds r5, 0x6 - add r7, sp, 0x4 - ldr r1, =0x02020630 - mov r9, r1 - movs r0, 0x1C - add r0, r9 - mov r10, r0 -_08124C0C: - mov r1, r8 - lsls r4, r1, 2 - adds r0, r4, r6 - ldrh r0, [r0] - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08124C84 - adds r0, r6, 0x2 - adds r0, r4, r0 - ldrh r6, [r0] - mov r0, sp - adds r0, 0xA - str r0, [sp] - adds r0, r6, 0 - add r1, sp, 0x4 - adds r2, r5, 0 - add r3, sp, 0x8 - bl sub_8124630 - ldrh r0, [r7] - adds r0, 0x1 - lsls r0, 3 - strh r0, [r7] - ldrh r0, [r5] - adds r0, 0x2 - lsls r0, 3 - strh r0, [r5] - movs r0, 0 - ldrsh r1, [r7, r0] - movs r0, 0 - ldrsh r2, [r5, r0] - ldr r0, =gUnknown_085A1F7C - movs r3, 0xA - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _08124C84 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - mov r1, r9 - adds r4, r2, r1 - ldrb r1, [r4, 0x3] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x40 - orrs r0, r1 - strb r0, [r4, 0x3] - add r2, r10 - ldr r0, =sub_8124CBC - str r0, [r2] - adds r0, r4, 0 - movs r1, 0x6 - bl StartObjectImageAnim - strh r6, [r4, 0x2E] -_08124C84: - mov r0, r8 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r6, =gUnknown_085A1F18 - lsls r0, 2 - adds r1, r6, 0x2 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0xD5 - bne _08124C0C -_08124C9C: - 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_8124BE4 - - thumb_func_start sub_8124CBC -sub_8124CBC: @ 8124CBC - push {lr} - adds r2, r0, 0 - ldr r0, =0x0203a148 - ldr r0, [r0] - ldrh r1, [r0, 0x8] - movs r3, 0x2E - ldrsh r0, [r2, r3] - cmp r1, r0 - bne _08124D00 - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - ble _08124D0E - movs r0, 0 - strh r0, [r2, 0x30] - adds r3, r2, 0 - adds r3, 0x3E - ldrb r2, [r3] - lsrs r1, r2, 2 - movs r0, 0x1 - eors r1, r0 - ands r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - b _08124D0E - .pool -_08124D00: - movs r0, 0x10 - strh r0, [r2, 0x30] - adds r2, 0x3E - ldrb r1, [r2] - subs r0, 0x15 - ands r0, r1 - strb r0, [r2] -_08124D0E: - pop {r0} - bx r0 - thumb_func_end sub_8124CBC - - thumb_func_start sub_8124D14 -sub_8124D14: @ 8124D14 - push {r4,lr} - sub sp, 0x4 - ldr r4, =0x0203a148 - ldr r0, [r4] - ldrh r1, [r0, 0x4] - cmp r1, 0 - beq _08124D2C - cmp r1, 0x1 - beq _08124D46 - b _08124D56 - .pool -_08124D2C: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r1, [r4] - ldrh r0, [r1, 0x4] - adds r0, 0x1 - strh r0, [r1, 0x4] - b _08124D56 -_08124D46: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _08124D56 - ldr r0, =sub_8124D64 - bl sub_81248F4 -_08124D56: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8124D14 - - thumb_func_start sub_8124D64 -sub_8124D64: @ 8124D64 - push {r4,lr} - ldr r0, =0x0203a148 - ldr r0, [r0] - ldrh r0, [r0, 0x4] - cmp r0, 0 - bne _08124DF8 - bl sub_81230AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bhi _08124DF8 - lsls r0, 2 - ldr r1, =_08124D90 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08124D90: - .4byte _08124DF8 - .4byte _08124DF8 - .4byte _08124DF8 - .4byte _08124DA8 - .4byte _08124DAE - .4byte _08124DE0 -_08124DA8: - bl sub_8124904 - b _08124DF8 -_08124DAE: - ldr r4, =0x0203a148 - ldr r0, [r4] - ldrb r0, [r0, 0xA] - cmp r0, 0x2 - beq _08124DBC - cmp r0, 0x4 - bne _08124DF8 -_08124DBC: - movs r0, 0x5 - bl m4aSongNumStart - ldr r0, [r4] - ldr r1, =0x00000a72 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - ldr r0, =sub_8124E0C - bl sub_81248F4 - b _08124DF8 - .pool -_08124DE0: - movs r0, 0x5 - bl m4aSongNumStart - ldr r0, =0x0203a148 - ldr r0, [r0] - ldr r1, =0x00000a72 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, =sub_8124E0C - bl sub_81248F4 -_08124DF8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8124D64 - - thumb_func_start sub_8124E0C -sub_8124E0C: @ 8124E0C - push {r4,lr} - sub sp, 0x4 - ldr r4, =0x0203a148 - ldr r0, [r4] - ldrh r1, [r0, 0x4] - cmp r1, 0 - beq _08124E24 - cmp r1, 0x1 - beq _08124E3E - b _08124F1A - .pool -_08124E24: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, [r4] - ldrh r0, [r1, 0x4] - adds r0, 0x1 - strh r0, [r1, 0x4] - b _08124F1A -_08124E3E: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _08124F1A - bl sub_812305C - ldr r1, [r4] - ldr r2, =0x00000a72 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _08124F00 - ldrh r0, [r1, 0x8] - cmp r0, 0xF - beq _08124E98 - cmp r0, 0xF - bgt _08124E6C - cmp r0, 0 - beq _08124E84 - b _08124EBC - .pool -_08124E6C: - cmp r0, 0x3A - beq _08124E7C - cmp r0, 0x49 - bne _08124EBC - movs r0, 0x15 - bl sub_8084CCC - b _08124EFA -_08124E7C: - movs r0, 0x16 - bl sub_8084CCC - b _08124EFA -_08124E84: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - movs r1, 0xD - cmp r0, 0 - bne _08124EB0 - movs r1, 0xC - b _08124EB0 - .pool -_08124E98: - ldr r0, =0x000008b4 - bl FlagGet - lsls r0, 24 - movs r1, 0xB - cmp r0, 0 - beq _08124EB0 - ldr r0, [r4] - ldrb r0, [r0, 0xB] - cmp r0, 0 - bne _08124EB0 - movs r1, 0x14 -_08124EB0: - adds r0, r1, 0 - bl sub_8084CCC - b _08124EFA - .pool -_08124EBC: - ldr r3, =gUnknown_085A1E3C - ldr r0, =0x0203a148 - ldr r0, [r0] - ldrh r1, [r0, 0x8] - lsls r0, r1, 1 - adds r2, r0, r1 - adds r0, r3, 0x2 - adds r1, r2, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _08124EE0 - bl sub_8084CCC - b _08124EFA - .pool -_08124EE0: - adds r0, r2, r3 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - adds r1, r3, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - movs r2, 0x1 - negs r2, r2 - bl warp1_set_2 -_08124EFA: - bl sub_80B69DC - b _08124F06 -_08124F00: - ldr r0, =sub_81B58A8 - bl SetMainCallback2 -_08124F06: - ldr r4, =0x0203a148 - ldr r0, [r4] - cmp r0, 0 - beq _08124F16 - bl Free - movs r0, 0 - str r0, [r4] -_08124F16: - bl FreeAllWindowBuffers -_08124F1A: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8124E0C - - thumb_func_start sub_8124F2C -sub_8124F2C: @ 8124F2C - push {lr} - ldr r2, =0x03006168 - ldr r1, [r0, 0x4] - str r1, [r2] - ldr r2, =0x0300617c - ldrb r1, [r0, 0x1F] - strb r1, [r2] - ldr r2, =0x03006164 - ldrb r1, [r0, 0x19] - strb r1, [r2] - ldr r2, =0x03006178 - ldrb r1, [r0, 0x1A] - strb r1, [r2] - ldr r2, =0x03006174 - ldrb r1, [r0, 0x1B] - strb r1, [r2] - ldr r2, =0x0300616c - ldrb r1, [r0, 0x1C] - strb r1, [r2] - ldr r2, =0x03006180 - ldrb r1, [r0, 0x1D] - strb r1, [r2] - ldr r2, =0x03006170 - ldrb r1, [r0, 0x1E] - strb r1, [r2] - ldrb r0, [r0] - subs r0, 0x2 - cmp r0, 0x22 - bls _08124F68 - b _081250B4 -_08124F68: - lsls r0, 2 - ldr r1, =_08124F98 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08124F98: - .4byte _08125024 - .4byte _081250B4 - .4byte _081250B4 - .4byte _081250B4 - .4byte _08125084 - .4byte _081250B4 - .4byte _0812502A - .4byte _08125030 - .4byte _08125044 - .4byte _08125056 - .4byte _081250B4 - .4byte _0812506C - .4byte _081250B4 - .4byte _081250B4 - .4byte _081250B4 - .4byte _081250B4 - .4byte _081250B4 - .4byte _081250B4 - .4byte _081250B4 - .4byte _081250B4 - .4byte _081250B4 - .4byte _081250B4 - .4byte _081250B4 - .4byte _081250B4 - .4byte _081250B4 - .4byte _081250B4 - .4byte _081250B4 - .4byte _081250B4 - .4byte _08125072 - .4byte _08125050 - .4byte _08125078 - .4byte _0812507E - .4byte _081250B4 - .4byte _081250B4 - .4byte _08125090 -_08125024: - bl sub_8125230 - b _081250B4 -_0812502A: - bl sub_81252E8 - b _081250B4 -_08125030: - bl sub_81254E0 - ldr r0, =0x0300617c - ldrb r0, [r0] - bl sub_81253A4 - b _081250B4 - .pool -_08125044: - bl sub_81254E0 - bl sub_8125630 - bl sub_8125448 -_08125050: - bl sub_8125630 - b _081250B4 -_08125056: - bl sub_81254E0 - bl sub_81257F8 - bl sub_81257F8 - bl sub_81258A0 - bl sub_8125448 - b _081250B4 -_0812506C: - bl sub_81256C8 - b _081250B4 -_08125072: - bl sub_81254E0 - b _081250B4 -_08125078: - bl sub_81257F8 - b _081250B4 -_0812507E: - bl sub_81258A0 - b _081250B4 -_08125084: - bl sub_8125250 - movs r0, 0x3 - bl sub_81250B8 - b _081250B4 -_08125090: - bl sub_81254E0 - bl sub_81257F8 - bl sub_81258A0 - bl sub_8125448 - bl sub_81252E8 - bl sub_81252E8 - movs r0, 0x2 - bl sub_81250B8 - movs r0, 0x4 - bl sub_8125170 -_081250B4: - pop {r0} - bx r0 - thumb_func_end sub_8124F2C - - thumb_func_start sub_81250B8 -sub_81250B8: @ 81250B8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r7, r0, 24 - movs r2, 0 - ldr r0, =0x0300616c - mov r8, r0 - ldrb r0, [r0] - cmp r2, r0 - bcs _0812514A - ldr r1, =0x03006174 - mov r12, r1 - ldr r3, =0x03006180 - mov r10, r3 - ldr r0, =0x03006164 - mov r9, r0 -_081250DE: - ldr r1, =0x03006178 - ldrb r0, [r1] - adds r0, r2 - mov r3, r10 - ldrb r1, [r3] - muls r0, r1 - lsls r0, 1 - ldr r3, =0x03006168 - ldr r1, [r3] - adds r1, r0 - mov r3, r9 - ldrb r0, [r3] - lsls r0, 1 - adds r3, r1, r0 - movs r4, 0 - adds r5, r2, 0x1 - mov r0, r12 - ldrb r0, [r0] - cmp r4, r0 - bcs _0812513E - movs r6, 0x80 - lsls r6, 8 -_0812510A: - ldrh r1, [r3] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _0812512E - movs r0, 0x1F - ands r0, r1 - adds r0, r7 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x1F - bls _08125124 - movs r2, 0x1F -_08125124: - lsls r0, r2, 10 - lsls r1, r2, 5 - orrs r0, r1 - orrs r0, r2 - strh r0, [r3] -_0812512E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - adds r3, 0x2 - mov r1, r12 - ldrb r1, [r1] - cmp r4, r1 - bcc _0812510A -_0812513E: - lsls r0, r5, 24 - lsrs r2, r0, 24 - mov r3, r8 - ldrb r3, [r3] - cmp r2, r3 - bcc _081250DE -_0812514A: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81250B8 - - thumb_func_start sub_8125170 -sub_8125170: @ 8125170 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r2, 0 - ldr r0, =0x0300616c - ldrb r0, [r0] - cmp r2, r0 - bcs _08125208 - ldr r1, =0x03006174 - mov r10, r1 -_0812518E: - ldr r3, =0x03006178 - ldrb r0, [r3] - adds r0, r2 - ldr r3, =0x03006180 - ldrb r1, [r3] - muls r0, r1 - lsls r0, 1 - ldr r3, =0x03006168 - ldr r1, [r3] - adds r1, r0 - ldr r3, =0x03006164 - ldrb r0, [r3] - lsls r0, 1 - adds r3, r1, r0 - movs r5, 0 - adds r7, r2, 0x1 - mov r0, r10 - ldrb r0, [r0] - cmp r5, r0 - bcs _081251FC - movs r1, 0x80 - lsls r1, 8 - mov r9, r1 - movs r0, 0x1F - mov r12, r0 - mov r1, r8 - subs r6, r0, r1 -_081251C4: - ldrh r1, [r3] - mov r0, r9 - ands r0, r1 - cmp r0, 0 - bne _081251EC - movs r4, 0x1F - mov r2, r12 - ands r2, r1 - cmp r2, r6 - ble _081251E2 - mov r1, r8 - lsrs r0, r1, 1 - subs r0, r4, r0 - lsls r0, 24 - lsrs r2, r0, 24 -_081251E2: - lsls r0, r2, 10 - lsls r1, r2, 5 - orrs r0, r1 - orrs r0, r2 - strh r0, [r3] -_081251EC: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r3, 0x2 - mov r0, r10 - ldrb r0, [r0] - cmp r5, r0 - bcc _081251C4 -_081251FC: - lsls r0, r7, 24 - lsrs r2, r0, 24 - ldr r1, =0x0300616c - ldrb r1, [r1] - cmp r2, r1 - bcc _0812518E -_08125208: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8125170 - - thumb_func_start sub_8125230 -sub_8125230: @ 8125230 - push {r4,r5,lr} - movs r4, 0 - ldr r5, =0x00000c7f -_08125236: - lsls r0, r4, 16 - lsrs r0, 16 - bl sub_8125954 - adds r4, 0x1 - cmp r4, r5 - bls _08125236 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8125230 - - thumb_func_start sub_8125250 -sub_8125250: @ 8125250 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - movs r2, 0 - ldr r0, =0x0300616c - ldrb r0, [r0] - cmp r2, r0 - bcs _081252C2 - ldr r0, =0x03006168 - mov r8, r0 - ldr r3, =0x03006174 -_08125268: - ldr r0, =0x03006178 - ldrb r1, [r0] - adds r1, r2 - ldr r0, =0x03006180 - ldrb r0, [r0] - muls r0, r1 - lsls r0, 1 - mov r4, r8 - ldr r1, [r4] - adds r1, r0 - ldr r0, =0x03006164 - ldrb r0, [r0] - lsls r0, 1 - adds r4, r1, r0 - movs r5, 0 - adds r6, r2, 0x1 - ldrb r0, [r3] - cmp r5, r0 - bcs _081252B6 - movs r0, 0x80 - lsls r0, 8 - adds r7, r0, 0 -_08125294: - ldrh r0, [r4] - ands r0, r7 - cmp r0, 0 - bne _081252A8 - adds r0, r4, 0 - str r3, [sp] - bl sub_8125B28 - strh r0, [r4] - ldr r3, [sp] -_081252A8: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r4, 0x2 - ldrb r0, [r3] - cmp r5, r0 - bcc _08125294 -_081252B6: - lsls r0, r6, 24 - lsrs r2, r0, 24 - ldr r0, =0x0300616c - ldrb r0, [r0] - cmp r2, r0 - bcc _08125268 -_081252C2: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8125250 - - thumb_func_start sub_81252E8 -sub_81252E8: @ 81252E8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - movs r2, 0 - ldr r0, =0x03006174 - ldrb r0, [r0] - cmp r2, r0 - bcs _0812537E - ldr r0, =0x03006168 - mov r8, r0 - ldr r3, =0x03006180 -_08125300: - ldr r0, =0x03006178 - ldrb r1, [r0] - ldrb r0, [r3] - muls r0, r1 - lsls r0, 1 - mov r4, r8 - ldr r1, [r4] - adds r1, r0 - ldr r0, =0x03006164 - ldrb r0, [r0] - adds r0, r2 - lsls r0, 1 - adds r4, r1, r0 - ldrh r1, [r4] - mov r0, sp - strh r1, [r0] - movs r5, 0x1 - ldrb r0, [r3] - lsls r0, 1 - adds r4, r0 - ldr r0, =0x0300616c - ldrb r0, [r0] - subs r0, 0x1 - adds r7, r2, 0x1 - cmp r5, r0 - bge _08125372 - ldr r6, =0x03006180 -_08125336: - ldrh r0, [r4] - movs r2, 0x80 - lsls r2, 8 - adds r1, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _0812535C - ldrb r2, [r6] - lsls r2, 1 - adds r2, r4, r2 - mov r0, sp - adds r1, r4, 0 - str r3, [sp, 0x4] - bl sub_8125E18 - strh r0, [r4] - mov r1, sp - strh r0, [r1] - ldr r3, [sp, 0x4] -_0812535C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldrb r0, [r6] - lsls r0, 1 - adds r4, r0 - ldr r0, =0x0300616c - ldrb r0, [r0] - subs r0, 0x1 - cmp r5, r0 - blt _08125336 -_08125372: - lsls r0, r7, 24 - lsrs r2, r0, 24 - ldr r0, =0x03006174 - ldrb r0, [r0] - cmp r2, r0 - bcc _08125300 -_0812537E: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81252E8 - - thumb_func_start sub_81253A4 -sub_81253A4: @ 81253A4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r2, 0 - ldr r0, =0x0300616c - ldrb r0, [r0] - cmp r2, r0 - bcs _08125420 - ldr r0, =0x03006168 - mov r9, r0 - ldr r3, =0x03006174 -_081253C4: - ldr r0, =0x03006178 - ldrb r1, [r0] - adds r1, r2 - ldr r0, =0x03006180 - ldrb r0, [r0] - muls r0, r1 - lsls r0, 1 - mov r4, r9 - ldr r1, [r4] - adds r1, r0 - ldr r0, =0x03006164 - ldrb r0, [r0] - lsls r0, 1 - adds r4, r1, r0 - movs r5, 0 - adds r6, r2, 0x1 - ldrb r0, [r3] - cmp r5, r0 - bcs _08125414 - movs r0, 0x80 - lsls r0, 8 - adds r7, r0, 0 -_081253F0: - ldrh r0, [r4] - ands r0, r7 - cmp r0, 0 - bne _08125406 - adds r0, r4, 0 - mov r1, r8 - str r3, [sp] - bl sub_8125B5C - strh r0, [r4] - ldr r3, [sp] -_08125406: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r4, 0x2 - ldrb r0, [r3] - cmp r5, r0 - bcc _081253F0 -_08125414: - lsls r0, r6, 24 - lsrs r2, r0, 24 - ldr r0, =0x0300616c - ldrb r0, [r0] - cmp r2, r0 - bcc _081253C4 -_08125420: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81253A4 - - thumb_func_start sub_8125448 -sub_8125448: @ 8125448 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - movs r2, 0 - ldr r0, =0x0300616c - ldrb r0, [r0] - cmp r2, r0 - bcs _081254BA - ldr r0, =0x03006168 - mov r8, r0 - ldr r3, =0x03006174 -_08125460: - ldr r0, =0x03006178 - ldrb r1, [r0] - adds r1, r2 - ldr r0, =0x03006180 - ldrb r0, [r0] - muls r0, r1 - lsls r0, 1 - mov r4, r8 - ldr r1, [r4] - adds r1, r0 - ldr r0, =0x03006164 - ldrb r0, [r0] - lsls r0, 1 - adds r4, r1, r0 - movs r5, 0 - adds r6, r2, 0x1 - ldrb r0, [r3] - cmp r5, r0 - bcs _081254AE - movs r0, 0x80 - lsls r0, 8 - adds r7, r0, 0 -_0812548C: - ldrh r0, [r4] - ands r0, r7 - cmp r0, 0 - bne _081254A0 - adds r0, r4, 0 - str r3, [sp] - bl sub_8125C68 - strh r0, [r4] - ldr r3, [sp] -_081254A0: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r4, 0x2 - ldrb r0, [r3] - cmp r5, r0 - bcc _0812548C -_081254AE: - lsls r0, r6, 24 - lsrs r2, r0, 24 - ldr r0, =0x0300616c - ldrb r0, [r0] - cmp r2, r0 - bcc _08125460 -_081254BA: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8125448 - - thumb_func_start sub_81254E0 -sub_81254E0: @ 81254E0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r7, 0 - ldr r0, =0x0300616c - ldrb r0, [r0] - cmp r7, r0 - bcs _0812556C - ldr r0, =0x03006168 - mov r8, r0 -_081254F6: - ldr r0, =0x03006178 - ldrb r1, [r0] - adds r1, r7 - ldr r0, =0x03006180 - ldrb r0, [r0] - muls r0, r1 - lsls r0, 1 - mov r2, r8 - ldr r1, [r2] - adds r1, r0 - ldr r0, =0x03006164 - ldrb r0, [r0] - lsls r0, 1 - adds r5, r1, r0 - adds r4, r5, 0x2 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8125C98 - strh r0, [r5] - movs r6, 0x1 - adds r5, r4, 0 - ldr r0, =0x03006174 - ldrb r0, [r0] - subs r0, 0x1 - adds r7, 0x1 - cmp r6, r0 - bge _08125556 -_0812552E: - adds r4, r5, 0x2 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8125C98 - strh r0, [r5] - subs r1, r5, 0x2 - adds r0, r5, 0 - bl sub_8125C98 - strh r0, [r5] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r5, r4, 0 - ldr r0, =0x03006174 - ldrb r0, [r0] - subs r0, 0x1 - cmp r6, r0 - blt _0812552E -_08125556: - subs r1, r5, 0x2 - adds r0, r5, 0 - bl sub_8125C98 - strh r0, [r5] - lsls r0, r7, 24 - lsrs r7, r0, 24 - ldr r0, =0x0300616c - ldrb r0, [r0] - cmp r7, r0 - bcc _081254F6 -_0812556C: - movs r6, 0 - ldr r0, =0x03006174 - ldrb r0, [r0] - cmp r6, r0 - bcs _0812560C - ldr r3, =0x03006168 - mov r9, r3 - ldr r0, =0x03006180 - mov r8, r0 -_0812557E: - ldr r0, =0x03006178 - ldrb r0, [r0] - mov r2, r8 - ldrb r1, [r2] - muls r0, r1 - lsls r0, 1 - mov r3, r9 - ldr r2, [r3] - adds r2, r0 - ldr r0, =0x03006164 - ldrb r0, [r0] - adds r0, r6 - lsls r0, 1 - adds r5, r2, r0 - lsls r1, 1 - adds r1, r5, r1 - adds r0, r5, 0 - bl sub_8125C98 - strh r0, [r5] - movs r7, 0x1 - mov r1, r8 - ldrb r0, [r1] - lsls r0, 1 - adds r5, r0 - ldr r0, =0x0300616c - ldrb r0, [r0] - subs r0, 0x1 - adds r6, 0x1 - cmp r7, r0 - bge _081255F0 - ldr r4, =0x03006180 -_081255BE: - ldrb r1, [r4] - lsls r1, 1 - adds r1, r5, r1 - adds r0, r5, 0 - bl sub_8125C98 - strh r0, [r5] - ldrb r1, [r4] - lsls r1, 1 - subs r1, r5, r1 - adds r0, r5, 0 - bl sub_8125C98 - strh r0, [r5] - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - ldrb r0, [r4] - lsls r0, 1 - adds r5, r0 - ldr r0, =0x0300616c - ldrb r0, [r0] - subs r0, 0x1 - cmp r7, r0 - blt _081255BE -_081255F0: - mov r2, r8 - ldrb r1, [r2] - lsls r1, 1 - subs r1, r5, r1 - adds r0, r5, 0 - bl sub_8125C98 - strh r0, [r5] - lsls r0, r6, 24 - lsrs r6, r0, 24 - ldr r0, =0x03006174 - ldrb r0, [r0] - cmp r6, r0 - bcc _0812557E -_0812560C: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81254E0 - - thumb_func_start sub_8125630 -sub_8125630: @ 8125630 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - movs r2, 0 - ldr r0, =0x0300616c - ldrb r0, [r0] - cmp r2, r0 - bcs _081256A2 - ldr r0, =0x03006168 - mov r8, r0 - ldr r3, =0x03006174 -_08125648: - ldr r0, =0x03006178 - ldrb r1, [r0] - adds r1, r2 - ldr r0, =0x03006180 - ldrb r0, [r0] - muls r0, r1 - lsls r0, 1 - mov r4, r8 - ldr r1, [r4] - adds r1, r0 - ldr r0, =0x03006164 - ldrb r0, [r0] - lsls r0, 1 - adds r4, r1, r0 - movs r5, 0 - adds r6, r2, 0x1 - ldrb r0, [r3] - cmp r5, r0 - bcs _08125696 - movs r0, 0x80 - lsls r0, 8 - adds r7, r0, 0 -_08125674: - ldrh r0, [r4] - ands r0, r7 - cmp r0, 0 - bne _08125688 - adds r0, r4, 0 - str r3, [sp] - bl sub_8125CC8 - strh r0, [r4] - ldr r3, [sp] -_08125688: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r4, 0x2 - ldrb r0, [r3] - cmp r5, r0 - bcc _08125674 -_08125696: - lsls r0, r6, 24 - lsrs r2, r0, 24 - ldr r0, =0x0300616c - ldrb r0, [r0] - cmp r2, r0 - bcc _08125648 -_081256A2: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8125630 - - thumb_func_start sub_81256C8 -sub_81256C8: @ 81256C8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r0, =0x03006168 - ldr r4, [r0] - movs r6, 0 - movs r0, 0x80 - lsls r0, 8 - adds r5, r0, 0 -_081256E0: - movs r7, 0 -_081256E2: - ldrh r0, [r4] - ands r0, r5 - cmp r0, 0 - bne _081256F2 - adds r0, r4, 0 - bl sub_8125CC8 - strh r0, [r4] -_081256F2: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - adds r4, 0x2 - cmp r7, 0x3F - bls _081256E2 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x3F - bls _081256E0 - movs r7, 0 - ldr r1, =0x03006168 - mov r10, r1 - mov r3, sp - movs r2, 0x80 - lsls r2, 8 - mov r9, r2 -_08125716: - lsls r0, r7, 1 - mov r2, r10 - ldr r1, [r2] - adds r4, r1, r0 - ldrh r1, [r4] - strh r1, [r3] - mov r1, r9 - strh r1, [r4] - movs r6, 0x1 - adds r4, 0x80 - adds r5, r0, 0 -_0812572C: - ldrh r0, [r4] - movs r2, 0x80 - lsls r2, 8 - ands r0, r2 - cmp r0, 0 - bne _0812574C - adds r2, r4, 0 - adds r2, 0x80 - mov r0, sp - adds r1, r4, 0 - str r3, [sp, 0x4] - bl sub_8125F38 - strh r0, [r4] - ldr r3, [sp, 0x4] - strh r0, [r3] -_0812574C: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r4, 0x80 - cmp r6, 0x3E - bls _0812572C - mov r0, r9 - strh r0, [r4] - mov r1, r10 - ldr r0, [r1] - adds r4, r0, r5 - ldrh r0, [r4] - strh r0, [r3] - mov r2, r9 - strh r2, [r4] - movs r6, 0x1 - adds r4, 0x80 - movs r0, 0x80 - lsls r0, 8 - mov r8, r0 -_08125774: - ldrh r0, [r4] - mov r1, r8 - ands r0, r1 - adds r5, r4, 0 - adds r5, 0x80 - cmp r0, 0 - bne _08125794 - mov r0, sp - adds r1, r4, 0 - adds r2, r5, 0 - str r3, [sp, 0x4] - bl sub_8125F38 - strh r0, [r4] - ldr r3, [sp, 0x4] - strh r0, [r3] -_08125794: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r4, r5, 0 - cmp r6, 0x3E - bls _08125774 - mov r2, r9 - strh r2, [r4] - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x3F - bls _08125716 - ldr r0, =0x03006168 - ldr r4, [r0] - movs r6, 0 - movs r0, 0x80 - lsls r0, 8 - mov r8, r0 -_081257BA: - movs r7, 0 - adds r5, r6, 0x1 -_081257BE: - ldrh r0, [r4] - mov r1, r8 - ands r0, r1 - cmp r0, 0 - bne _081257D0 - adds r0, r4, 0 - bl sub_8125CC8 - strh r0, [r4] -_081257D0: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - adds r4, 0x2 - cmp r7, 0x3F - bls _081257BE - lsls r0, r5, 24 - lsrs r6, r0, 24 - cmp r6, 0x3F - bls _081257BA - 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_81256C8 - - thumb_func_start sub_81257F8 -sub_81257F8: @ 81257F8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - movs r2, 0 - ldr r0, =0x0300616c - ldrb r0, [r0] - cmp r2, r0 - bcs _0812587A - ldr r0, =0x03006168 - mov r8, r0 -_0812580E: - ldr r0, =0x03006178 - ldrb r1, [r0] - adds r1, r2 - ldr r0, =0x03006180 - ldrb r0, [r0] - muls r0, r1 - lsls r0, 1 - mov r3, r8 - ldr r1, [r3] - adds r1, r0 - ldr r0, =0x03006164 - ldrb r0, [r0] - lsls r0, 1 - adds r4, r1, r0 - ldrh r1, [r4] - mov r0, sp - strh r1, [r0] - movs r5, 0x1 - adds r4, 0x2 - ldr r0, =0x03006174 - ldrb r0, [r0] - subs r0, 0x1 - adds r6, r2, 0x1 - cmp r5, r0 - bge _0812586E - movs r0, 0x80 - lsls r0, 8 - adds r7, r0, 0 -_08125846: - ldrh r0, [r4] - ands r0, r7 - cmp r0, 0 - bne _0812585C - mov r0, sp - adds r1, r4, 0 - bl sub_8125CF4 - strh r0, [r4] - mov r1, sp - strh r0, [r1] -_0812585C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r4, 0x2 - ldr r0, =0x03006174 - ldrb r0, [r0] - subs r0, 0x1 - cmp r5, r0 - blt _08125846 -_0812586E: - lsls r0, r6, 24 - lsrs r2, r0, 24 - ldr r0, =0x0300616c - ldrb r0, [r0] - cmp r2, r0 - bcc _0812580E -_0812587A: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81257F8 - - thumb_func_start sub_81258A0 -sub_81258A0: @ 81258A0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - movs r2, 0 - ldr r0, =0x03006174 - ldrb r0, [r0] - cmp r2, r0 - bcs _0812592E - ldr r0, =0x03006168 - mov r8, r0 - ldr r7, =0x03006180 -_081258B8: - ldr r0, =0x03006178 - ldrb r1, [r0] - ldrb r0, [r7] - muls r0, r1 - lsls r0, 1 - mov r3, r8 - ldr r1, [r3] - adds r1, r0 - ldr r0, =0x03006164 - ldrb r0, [r0] - adds r0, r2 - lsls r0, 1 - adds r4, r1, r0 - ldrh r1, [r4] - mov r0, sp - strh r1, [r0] - movs r5, 0x1 - ldrb r0, [r7] - lsls r0, 1 - adds r4, r0 - ldr r0, =0x0300616c - ldrb r0, [r0] - subs r0, 0x1 - adds r6, r2, 0x1 - cmp r5, r0 - bge _08125922 - movs r0, 0x80 - lsls r0, 8 - adds r2, r0, 0 -_081258F2: - ldrh r0, [r4] - ands r0, r2 - cmp r0, 0 - bne _0812590C - mov r0, sp - adds r1, r4, 0 - str r2, [sp, 0x4] - bl sub_8125CF4 - strh r0, [r4] - mov r1, sp - strh r0, [r1] - ldr r2, [sp, 0x4] -_0812590C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldrb r0, [r7] - lsls r0, 1 - adds r4, r0 - ldr r0, =0x0300616c - ldrb r0, [r0] - subs r0, 0x1 - cmp r5, r0 - blt _081258F2 -_08125922: - lsls r0, r6, 24 - lsrs r2, r0, 24 - ldr r0, =0x03006174 - ldrb r0, [r0] - cmp r2, r0 - bcc _081258B8 -_0812592E: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81258A0 - - thumb_func_start sub_8125954 -sub_8125954: @ 8125954 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - mov r2, sp - ldr r3, =gUnknown_085A1F94 - lsls r1, r0, 1 - add r1, r10 - adds r0, r1, r3 - ldrb r0, [r0] - strb r0, [r2] - adds r0, r3, 0x1 - adds r0, r1, r0 - ldrb r0, [r0] - strb r0, [r2, 0x1] - mov r5, sp - adds r0, r3, 0x2 - adds r1, r0 - ldrb r4, [r1] - lsls r2, r4, 24 - lsrs r1, r2, 27 - movs r0, 0x7 - ands r1, r0 - strh r1, [r5, 0x2] - lsrs r2, 25 - mov r9, r2 - movs r0, 0x3 - ands r2, r0 - mov r9, r2 - movs r5, 0x1 - ands r5, r4 - movs r4, 0x1 - mov r8, r4 - cmp r8, r1 - bcs _08125A06 - mov r3, sp -_081259A6: - cmp r5, 0 - bne _081259C4 - mov r0, r8 - lsls r2, r0, 2 - mov r4, sp - adds r1, r4, r2 - ldrb r0, [r3] - mov r4, r8 - subs r0, r4 - strb r0, [r1] - ldrb r0, [r3, 0x1] - add r0, r8 - b _081259D6 - .pool -_081259C4: - mov r0, r8 - lsls r2, r0, 2 - mov r4, sp - adds r1, r4, r2 - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r1] - ldrb r0, [r3, 0x1] - subs r0, 0x1 -_081259D6: - strb r0, [r1, 0x1] - add r2, sp - ldrb r0, [r2] - cmp r0, 0x3F - bhi _081259E6 - ldrb r0, [r2, 0x1] - cmp r0, 0x3F - bls _081259EE -_081259E6: - mov r0, r8 - subs r0, 0x1 - strh r0, [r3, 0x2] - b _08125A06 -_081259EE: - ldrh r0, [r3, 0x2] - mov r1, r8 - subs r0, r1 - strh r0, [r2, 0x2] - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrh r0, [r3, 0x2] - cmp r8, r0 - bcc _081259A6 -_08125A06: - movs r2, 0 - mov r8, r2 - mov r0, sp - ldrh r0, [r0, 0x2] - cmp r8, r0 - bcc _08125A14 - b _08125B16 -_08125A14: - movs r3, 0x1F -_08125A16: - ldr r1, =0x03006168 - mov r4, r8 - lsls r0, r4, 2 - mov r2, sp - adds r6, r2, r0 - ldrb r0, [r6, 0x1] - lsls r0, 7 - ldr r1, [r1] - adds r1, r0 - ldrb r0, [r6] - lsls r0, 1 - adds r2, r1, r0 - ldrh r1, [r2] - movs r4, 0x80 - lsls r4, 8 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - bne _08125B02 - movs r7, 0x1F - ands r7, r1 - lsls r0, r1, 16 - lsrs r5, r0, 21 - ands r5, r3 - lsrs r4, r0, 26 - ands r4, r3 - mov r0, r9 - cmp r0, 0 - blt _08125AF8 - cmp r0, 0x1 - ble _08125A78 - cmp r0, 0x3 - bgt _08125AF8 - ldrh r0, [r6, 0x2] - adds r1, r7, r0 - lsls r1, 16 - lsrs r7, r1, 16 - adds r1, r5, r0 - lsls r1, 16 - lsrs r5, r1, 16 - adds r0, r4, r0 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r7, 0x1F - bls _08125AEC - movs r7, 0x1F - b _08125AEC - .pool -_08125A78: - mov r1, r10 - lsls r0, r1, 1 - add r0, r10 - ldr r1, =gUnknown_085A1F94 - adds r1, 0x2 - adds r0, r1 - ldrb r0, [r0] - lsrs r0, 3 - movs r1, 0x7 - ands r0, r1 - movs r1, 0x3 - str r2, [sp, 0x18] - str r3, [sp, 0x1C] - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - ldr r2, [sp, 0x18] - ldr r3, [sp, 0x1C] - cmp r0, 0x1 - beq _08125AC8 - cmp r0, 0x1 - bgt _08125AB0 - cmp r0, 0 - beq _08125AB6 - b _08125AF8 - .pool -_08125AB0: - cmp r0, 0x2 - beq _08125ADA - b _08125AF8 -_08125AB6: - ldrh r0, [r6, 0x2] - cmp r7, r0 - bcc _08125AC4 - subs r0, r7, r0 - lsls r0, 16 - lsrs r7, r0, 16 - b _08125AF8 -_08125AC4: - movs r7, 0 - b _08125AF8 -_08125AC8: - ldrh r0, [r6, 0x2] - cmp r5, r0 - bcc _08125AD6 - subs r0, r5, r0 - lsls r0, 16 - lsrs r5, r0, 16 - b _08125AF8 -_08125AD6: - movs r5, 0 - b _08125AF8 -_08125ADA: - ldrh r0, [r6, 0x2] - cmp r4, r0 - bcc _08125AE8 - subs r0, r4, r0 - lsls r0, 16 - lsrs r4, r0, 16 - b _08125AF8 -_08125AE8: - movs r4, 0 - b _08125AF8 -_08125AEC: - cmp r5, 0x1F - bls _08125AF2 - movs r5, 0x1F -_08125AF2: - cmp r4, 0x1F - bls _08125AF8 - movs r4, 0x1F -_08125AF8: - lsls r0, r4, 10 - lsls r1, r5, 5 - orrs r0, r1 - orrs r7, r0 - strh r7, [r2] -_08125B02: - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - mov r0, sp - ldrh r0, [r0, 0x2] - cmp r8, r0 - bcs _08125B16 - b _08125A16 -_08125B16: - 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_8125954 - - thumb_func_start sub_8125B28 -sub_8125B28: @ 8125B28 - ldrh r2, [r0] - movs r0, 0x1F - adds r1, r2, 0 - ands r1, r0 - asrs r3, r2, 5 - ands r3, r0 - asrs r2, 10 - ands r2, r0 - movs r0, 0x4C - muls r1, r0 - movs r0, 0x97 - muls r0, r3 - adds r1, r0 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r2 - adds r1, r0 - asrs r1, 8 - lsls r0, r1, 10 - lsls r2, r1, 5 - orrs r0, r2 - orrs r0, r1 - lsls r0, 16 - lsrs r0, 16 - bx lr - thumb_func_end sub_8125B28 - - thumb_func_start sub_8125B5C -sub_8125B5C: @ 8125B5C - push {r4,lr} - lsls r1, 24 - lsrs r4, r1, 24 - ldrh r0, [r0] - movs r2, 0x1F - movs r1, 0x1F - ands r1, r0 - lsls r0, 16 - lsrs r3, r0, 21 - ands r3, r2 - lsrs r0, 26 - ands r0, r2 - cmp r1, 0x10 - bhi _08125B8C - cmp r3, 0x10 - bhi _08125B8C - cmp r0, 0x10 - bhi _08125B8C - adds r0, r4, 0 - bl sub_8125B98 - lsls r0, 16 - lsrs r0, 16 - b _08125B8E -_08125B8C: - ldr r0, =0x00007fff -_08125B8E: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8125B5C - - thumb_func_start sub_8125B98 -sub_8125B98: @ 8125B98 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - mov r8, r0 - movs r6, 0 - movs r7, 0 - adds r0, r4, 0 - movs r1, 0x6 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - movs r1, 0x6 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bhi _08125C50 - lsls r0, 2 - ldr r1, =_08125BE0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08125BE0: - .4byte _08125BF8 - .4byte _08125C08 - .4byte _08125C18 - .4byte _08125C26 - .4byte _08125C34 - .4byte _08125C42 -_08125BF8: - movs r0, 0x15 - subs r0, r5 - lsls r0, 16 - lsrs r6, r0, 16 - adds r7, r6, 0 - movs r1, 0 - mov r8, r1 - b _08125C50 -_08125C08: - movs r7, 0 - movs r0, 0x15 - subs r0, r5 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - mov r6, r8 - b _08125C50 -_08125C18: - movs r0, 0x15 - subs r0, r5 - lsls r0, 16 - lsrs r7, r0, 16 - movs r6, 0 - mov r8, r7 - b _08125C50 -_08125C26: - movs r7, 0 - movs r6, 0 - movs r0, 0x17 - subs r0, r5 - lsls r0, 16 - lsrs r0, 16 - b _08125C4E -_08125C34: - movs r0, 0x17 - subs r0, r5 - lsls r0, 16 - lsrs r7, r0, 16 - movs r6, 0 - mov r8, r6 - b _08125C50 -_08125C42: - movs r7, 0 - movs r0, 0x17 - subs r0, r5 - lsls r0, 16 - lsrs r6, r0, 16 - movs r0, 0 -_08125C4E: - mov r8, r0 -_08125C50: - lsls r0, r7, 10 - lsls r1, r6, 5 - orrs r0, r1 - mov r1, r8 - orrs r1, r0 - lsls r0, r1, 16 - lsrs r0, 16 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8125B98 - - thumb_func_start sub_8125C68 -sub_8125C68: @ 8125C68 - push {lr} - ldrh r0, [r0] - movs r2, 0x1F - movs r1, 0x1F - ands r1, r0 - lsls r0, 16 - lsrs r3, r0, 21 - ands r3, r2 - lsrs r0, 26 - ands r0, r2 - cmp r1, 0x10 - bhi _08125C8C - cmp r3, 0x10 - bhi _08125C8C - cmp r0, 0x10 - bhi _08125C8C - movs r0, 0 - b _08125C8E -_08125C8C: - ldr r0, =0x00007fff -_08125C8E: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8125C68 - - thumb_func_start sub_8125C98 -sub_8125C98: @ 8125C98 - push {r4,lr} - adds r4, r0, 0 - ldrh r3, [r4] - cmp r3, 0 - beq _08125CC0 - movs r2, 0x80 - lsls r2, 8 - adds r0, r2, 0 - ands r0, r3 - cmp r0, 0 - beq _08125CB2 - adds r0, r2, 0 - b _08125CC2 -_08125CB2: - ldrh r1, [r1] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _08125CC0 - ldrh r0, [r4] - b _08125CC2 -_08125CC0: - movs r0, 0 -_08125CC2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8125C98 - - thumb_func_start sub_8125CC8 -sub_8125CC8: @ 8125CC8 - push {r4,lr} - ldrh r1, [r0] - movs r0, 0x1F - movs r3, 0x1F - ands r3, r1 - lsls r1, 16 - lsrs r2, r1, 21 - lsrs r1, 26 - subs r3, r0, r3 - adds r4, r0, 0 - bics r4, r2 - adds r2, r4, 0 - bics r0, r1 - lsls r0, 10 - lsls r2, 5 - orrs r0, r2 - orrs r0, r3 - lsls r0, 16 - lsrs r0, 16 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8125CC8 - - thumb_func_start sub_8125CF4 -sub_8125CF4: @ 8125CF4 - push {r4-r7,lr} - sub sp, 0x14 - adds r7, r1, 0 - ldrh r4, [r0] - ldrh r5, [r7] - lsls r6, r4, 16 - lsls r0, r5, 16 - mov r12, r0 - cmp r4, r5 - beq _08125D66 - mov r2, sp - movs r3, 0x1F - movs r1, 0x1F - adds r0, r1, 0 - ands r0, r4 - strh r0, [r2] - lsrs r0, r6, 21 - ands r0, r3 - strh r0, [r2, 0x2] - lsrs r0, r6, 26 - ands r0, r3 - strh r0, [r2, 0x4] - mov r0, sp - ands r1, r5 - strh r1, [r0, 0x6] - mov r1, sp - mov r2, r12 - lsrs r0, r2, 21 - ands r0, r3 - strh r0, [r1, 0x8] - lsrs r0, r2, 26 - ands r0, r3 - strh r0, [r1, 0xA] - mov r0, sp - ldrh r0, [r0] - cmp r0, 0x19 - bls _08125D4E - mov r0, sp - ldrh r0, [r0, 0x2] - cmp r0, 0x19 - bls _08125D4E - mov r0, sp - ldrh r0, [r0, 0x4] - cmp r0, 0x19 - bhi _08125D66 -_08125D4E: - mov r0, sp - ldrh r0, [r0, 0x6] - cmp r0, 0x19 - bls _08125D6A - mov r0, sp - ldrh r0, [r0, 0x8] - cmp r0, 0x19 - bls _08125D6A - mov r0, sp - ldrh r0, [r0, 0xA] - cmp r0, 0x19 - bls _08125D6A -_08125D66: - ldrh r0, [r7] - b _08125E10 -_08125D6A: - movs r4, 0 - add r6, sp, 0xC - mov r7, sp - adds r7, 0x6 - adds r5, r6, 0 -_08125D74: - lsls r2, r4, 1 - mov r1, sp - adds r0, r1, r2 - adds r1, r7, r2 - ldrh r3, [r0] - ldrh r0, [r1] - cmp r3, r0 - bls _08125D8A - adds r1, r5, r2 - subs r0, r3, r0 - b _08125D8E -_08125D8A: - adds r1, r5, r2 - subs r0, r3 -_08125D8E: - strh r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _08125D74 - adds r1, r6, 0 - ldrh r0, [r1, 0x2] - ldrh r3, [r1] - cmp r3, r0 - bcc _08125DB4 - ldrh r2, [r1, 0x4] - cmp r3, r2 - bcc _08125DAE - adds r2, r3, 0 - b _08125DC8 -_08125DAE: - cmp r0, r2 - bcs _08125DBA - b _08125DC2 -_08125DB4: - ldrh r2, [r1, 0x4] - cmp r0, r2 - bcc _08125DBE -_08125DBA: - ldrh r2, [r1, 0x2] - b _08125DC8 -_08125DBE: - cmp r2, r3 - bcc _08125DC6 -_08125DC2: - ldrh r2, [r1, 0x4] - b _08125DC8 -_08125DC6: - ldrh r2, [r6] -_08125DC8: - mov r0, sp - ldrh r1, [r0, 0x6] - lsrs r0, r2, 1 - movs r6, 0x1F - subs r6, r0 - adds r0, r1, 0 - muls r0, r6 - movs r1, 0x1F - bl __divsi3 - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - mov r0, sp - ldrh r0, [r0, 0x8] - muls r0, r6 - movs r1, 0x1F - bl __divsi3 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, sp - ldrh r0, [r0, 0xA] - muls r0, r6 - movs r1, 0x1F - bl __divsi3 - lsls r0, 16 - lsrs r0, 6 - lsls r4, 5 - orrs r0, r4 - orrs r5, r0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r5, 0 -_08125E10: - add sp, 0x14 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8125CF4 - - thumb_func_start sub_8125E18 -sub_8125E18: @ 8125E18 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r3, r0, 0 - mov r10, r1 - str r2, [sp] - ldrh r1, [r3] - mov r0, r10 - ldrh r0, [r0] - cmp r1, r0 - bne _08125E40 - ldrh r0, [r2] - cmp r0, r1 - bne _08125E40 - mov r1, r10 - ldrh r0, [r1] - b _08125F28 -_08125E40: - mov r2, r10 - ldrh r0, [r2] - movs r1, 0x1F - mov r9, r1 - movs r4, 0x1F - adds r5, r4, 0 - ands r5, r0 - lsls r0, 16 - lsrs r2, r0, 21 - mov r1, r9 - ands r1, r2 - mov r8, r1 - lsrs r0, 26 - mov r2, r9 - ands r2, r0 - str r2, [sp, 0x4] - ldrh r2, [r3] - adds r0, r4, 0 - ands r0, r2 - lsls r2, 16 - lsrs r1, r2, 21 - mov r3, r9 - ands r1, r3 - adds r0, r1 - lsrs r2, 26 - ands r2, r3 - adds r0, r2 - movs r1, 0x3 - bl __divsi3 - lsls r0, 16 - lsrs r7, r0, 16 - mov r1, r8 - adds r0, r5, r1 - ldr r2, [sp, 0x4] - adds r0, r2 - movs r1, 0x3 - bl __divsi3 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r3, [sp] - ldrh r1, [r3] - ands r4, r1 - lsls r1, 16 - lsrs r0, r1, 21 - mov r2, r9 - ands r0, r2 - adds r4, r0 - lsrs r1, 26 - ands r1, r2 - adds r4, r1 - adds r0, r4, 0 - movs r1, 0x3 - bl __divsi3 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r7, r6 - bne _08125EC2 - cmp r1, r6 - bne _08125EC2 - mov r3, r10 - ldrh r0, [r3] - b _08125F28 -_08125EC2: - cmp r7, r6 - bls _08125ECA - subs r0, r7, r6 - b _08125ECC -_08125ECA: - subs r0, r6, r7 -_08125ECC: - lsls r0, 16 - lsrs r2, r0, 16 - cmp r1, r6 - bls _08125ED8 - subs r0, r1, r6 - b _08125EDA -_08125ED8: - subs r0, r6, r1 -_08125EDA: - lsls r0, 16 - lsrs r0, 16 - cmp r2, r0 - bcc _08125EE4 - adds r0, r2, 0 -_08125EE4: - lsrs r0, 1 - movs r4, 0x1F - subs r4, r0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - muls r0, r4 - movs r1, 0x1F - bl __divsi3 - lsls r0, 16 - lsrs r5, r0, 16 - mov r0, r8 - muls r0, r4 - movs r1, 0x1F - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r1, [sp, 0x4] - adds r0, r1, 0 - muls r0, r4 - movs r1, 0x1F - bl __divsi3 - lsls r0, 16 - lsrs r0, 6 - mov r2, r8 - lsls r1, r2, 5 - orrs r0, r1 - orrs r5, r0 - lsls r0, r5, 16 - lsrs r0, 16 -_08125F28: - 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_8125E18 - - thumb_func_start sub_8125F38 -sub_8125F38: @ 8125F38 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r3, r0, 0 - mov r10, r1 - str r2, [sp] - ldrh r1, [r3] - mov r0, r10 - ldrh r0, [r0] - cmp r1, r0 - bne _08125F60 - ldrh r0, [r2] - cmp r0, r1 - bne _08125F60 - mov r1, r10 - ldrh r0, [r1] - b _08126046 -_08125F60: - mov r2, r10 - ldrh r0, [r2] - movs r1, 0x1F - mov r9, r1 - movs r4, 0x1F - adds r5, r4, 0 - ands r5, r0 - lsls r0, 16 - lsrs r2, r0, 21 - mov r1, r9 - ands r1, r2 - mov r8, r1 - lsrs r0, 26 - mov r2, r9 - ands r2, r0 - str r2, [sp, 0x4] - ldrh r2, [r3] - adds r0, r4, 0 - ands r0, r2 - lsls r2, 16 - lsrs r1, r2, 21 - mov r3, r9 - ands r1, r3 - adds r0, r1 - lsrs r2, 26 - ands r2, r3 - adds r0, r2 - movs r1, 0x3 - bl __divsi3 - lsls r0, 16 - lsrs r7, r0, 16 - mov r1, r8 - adds r0, r5, r1 - ldr r2, [sp, 0x4] - adds r0, r2 - movs r1, 0x3 - bl __divsi3 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r3, [sp] - ldrh r1, [r3] - ands r4, r1 - lsls r1, 16 - lsrs r0, r1, 21 - mov r2, r9 - ands r0, r2 - adds r4, r0 - lsrs r1, 26 - ands r1, r2 - adds r4, r1 - adds r0, r4, 0 - movs r1, 0x3 - bl __divsi3 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r7, r6 - bne _08125FE2 - cmp r1, r6 - bne _08125FE2 - mov r3, r10 - ldrh r0, [r3] - b _08126046 -_08125FE2: - cmp r7, r6 - bls _08125FEA - subs r0, r7, r6 - b _08125FEC -_08125FEA: - subs r0, r6, r7 -_08125FEC: - lsls r0, 16 - lsrs r2, r0, 16 - cmp r1, r6 - bls _08125FF8 - subs r0, r1, r6 - b _08125FFA -_08125FF8: - subs r0, r6, r1 -_08125FFA: - lsls r0, 16 - lsrs r0, 16 - cmp r2, r0 - bcc _08126004 - adds r0, r2, 0 -_08126004: - movs r4, 0x1F - subs r4, r0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - muls r0, r4 - movs r1, 0x1F - bl __divsi3 - lsls r0, 16 - lsrs r5, r0, 16 - mov r0, r8 - muls r0, r4 - movs r1, 0x1F - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r1, [sp, 0x4] - adds r0, r1, 0 - muls r0, r4 - movs r1, 0x1F - bl __divsi3 - lsls r0, 16 - lsrs r0, 6 - mov r2, r8 - lsls r1, r2, 5 - orrs r0, r1 - orrs r5, r0 - lsls r0, r5, 16 - lsrs r0, 16 -_08126046: - 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_8125F38 - - thumb_func_start sub_8126058 -sub_8126058: @ 8126058 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - ldrb r1, [r0, 0x1D] - lsrs r5, r1, 3 - ldrb r1, [r0, 0x1E] - lsrs r1, 3 - str r1, [sp, 0x8] - ldr r1, [r0, 0x4] - str r1, [sp] - ldr r2, [r0, 0x10] - str r2, [sp, 0x4] - ldrh r0, [r0, 0x16] - cmp r0, 0x2 - bne _08126108 - movs r1, 0 - ldr r0, [sp, 0x8] - cmp r1, r0 - bcc _08126086 - b _08126194 -_08126086: - movs r0, 0 - adds r2, r1, 0x1 - mov r10, r2 - cmp r0, r5 - bcs _081260FA - adds r2, r1, 0 - muls r2, r5 - mov r9, r2 - lsls r1, 3 - mov r8, r1 -_0812609A: - movs r4, 0 - lsls r6, r0, 4 - adds r7, r0, 0x1 - add r0, r9 - lsls r0, 6 - ldr r1, [sp, 0x4] - adds r1, r0 - mov r12, r1 -_081260AA: - lsls r0, r4, 3 - mov r2, r12 - adds r3, r2, r0 - mov r1, r8 - adds r0, r1, r4 - lsls r0, 3 - muls r0, r5 - lsls r0, 1 - ldr r2, [sp] - adds r0, r2, r0 - adds r2, r0, r6 - ldrh r0, [r2, 0x2] - lsls r0, 8 - ldrh r1, [r2] - orrs r0, r1 - strh r0, [r3] - ldrh r0, [r2, 0x6] - lsls r0, 8 - ldrh r1, [r2, 0x4] - orrs r0, r1 - strh r0, [r3, 0x2] - ldrh r0, [r2, 0xA] - lsls r0, 8 - ldrh r1, [r2, 0x8] - orrs r0, r1 - strh r0, [r3, 0x4] - ldrh r0, [r2, 0xE] - lsls r0, 8 - ldrh r1, [r2, 0xC] - orrs r0, r1 - strh r0, [r3, 0x6] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x7 - bls _081260AA - lsls r0, r7, 16 - lsrs r0, 16 - cmp r0, r5 - bcc _0812609A -_081260FA: - mov r1, r10 - lsls r0, r1, 16 - lsrs r1, r0, 16 - ldr r2, [sp, 0x8] - cmp r1, r2 - bcc _08126086 - b _08126194 -_08126108: - movs r1, 0 - ldr r0, [sp, 0x8] - cmp r1, r0 - bcs _08126194 -_08126110: - movs r0, 0 - adds r2, r1, 0x1 - mov r10, r2 - cmp r0, r5 - bcs _08126188 - adds r2, r1, 0 - muls r2, r5 - mov r9, r2 - lsls r1, 3 - mov r8, r1 -_08126124: - movs r4, 0 - lsls r6, r0, 4 - adds r7, r0, 0x1 - add r0, r9 - lsls r0, 5 - ldr r1, [sp, 0x4] - adds r1, r0 - mov r12, r1 -_08126134: - lsls r0, r4, 2 - mov r2, r12 - adds r3, r2, r0 - mov r1, r8 - adds r0, r1, r4 - lsls r0, 3 - muls r0, r5 - lsls r0, 1 - ldr r2, [sp] - adds r0, r2, r0 - adds r2, r0, r6 - ldrh r1, [r2, 0x2] - lsls r1, 4 - ldrh r0, [r2] - orrs r1, r0 - ldrh r0, [r2, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrh r0, [r2, 0x6] - lsls r0, 12 - orrs r1, r0 - strh r1, [r3] - ldrh r1, [r2, 0xA] - lsls r1, 4 - ldrh r0, [r2, 0x8] - orrs r1, r0 - ldrh r0, [r2, 0xC] - lsls r0, 8 - orrs r1, r0 - ldrh r0, [r2, 0xE] - lsls r0, 12 - orrs r1, r0 - strh r1, [r3, 0x2] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x7 - bls _08126134 - lsls r0, r7, 16 - lsrs r0, 16 - cmp r0, r5 - bcc _08126124 -_08126188: - mov r1, r10 - lsls r0, r1, 16 - lsrs r1, r0, 16 - ldr r2, [sp, 0x8] - cmp r1, r2 - bcc _08126110 -_08126194: - 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_8126058 - - thumb_func_start sub_81261A4 -sub_81261A4: @ 81261A4 - push {lr} - ldr r2, =0x03006188 - ldrb r1, [r0, 0x18] - lsls r1, 4 - strh r1, [r2] - ldr r3, =0x03006184 - ldrh r2, [r2] - lsls r2, 1 - ldr r1, [r0, 0x8] - adds r1, r2 - str r1, [r3] - ldr r2, =0x03006168 - ldr r1, [r0, 0x4] - str r1, [r2] - ldr r2, =0x03006164 - ldrb r1, [r0, 0x19] - strb r1, [r2] - ldr r2, =0x03006178 - ldrb r1, [r0, 0x1A] - strb r1, [r2] - ldr r2, =0x03006174 - ldrb r1, [r0, 0x1B] - strb r1, [r2] - ldr r2, =0x0300616c - ldrb r1, [r0, 0x1C] - strb r1, [r2] - ldr r2, =0x03006180 - ldrb r1, [r0, 0x1D] - strb r1, [r2] - ldr r2, =0x03006170 - ldrb r1, [r0, 0x1E] - strb r1, [r2] - ldrh r0, [r0, 0x14] - cmp r0, 0x5 - bhi _0812626A - lsls r0, 2 - ldr r1, =_0812621C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0812621C: - .4byte _08126234 - .4byte _0812623C - .4byte _08126244 - .4byte _0812624E - .4byte _08126258 - .4byte _08126262 -_08126234: - movs r0, 0 - bl sub_81263A4 - b _0812626A -_0812623C: - movs r0, 0x1 - bl sub_81263A4 - b _0812626A -_08126244: - bl sub_8126270 - bl sub_8126714 - b _0812626A -_0812624E: - bl sub_8126370 - bl sub_8126664 - b _0812626A -_08126258: - bl sub_8126334 - bl sub_81265B4 - b _0812626A -_08126262: - bl sub_8126318 - bl sub_81264FC -_0812626A: - pop {r0} - bx r0 - thumb_func_end sub_81261A4 - - thumb_func_start sub_8126270 -sub_8126270: @ 8126270 - ldr r2, =0x03006184 - ldr r1, [r2] - movs r0, 0 - strh r0, [r1] - ldr r0, [r2] - ldr r2, =0x000018c6 - adds r1, r2, 0 - strh r1, [r0, 0x2] - ldr r2, =0x000077bd - adds r1, r2, 0 - strh r1, [r0, 0x4] - ldr r2, =0x00002d6b - adds r1, r2, 0 - strh r1, [r0, 0x6] - ldr r2, =0x000018dd - adds r1, r2, 0 - strh r1, [r0, 0x8] - ldr r2, =0x00001ba6 - adds r1, r2, 0 - strh r1, [r0, 0xA] - ldr r2, =0x000074c6 - adds r1, r2, 0 - strh r1, [r0, 0xC] - ldr r2, =0x00001bbd - adds r1, r2, 0 - strh r1, [r0, 0xE] - ldr r2, =0x000074dd - adds r1, r2, 0 - strh r1, [r0, 0x10] - ldr r2, =0x000077a6 - adds r1, r2, 0 - strh r1, [r0, 0x12] - ldr r2, =0x0000197d - adds r1, r2, 0 - strh r1, [r0, 0x14] - ldr r2, =0x00001bab - adds r1, r2, 0 - strh r1, [r0, 0x16] - ldr r2, =0x00007566 - adds r1, r2, 0 - strh r1, [r0, 0x18] - ldr r2, =0x00002cdd - adds r1, r2, 0 - strh r1, [r0, 0x1A] - ldr r2, =0x00002fa6 - adds r1, r2, 0 - strh r1, [r0, 0x1C] - ldr r2, =0x000074cb - adds r1, r2, 0 - strh r1, [r0, 0x1E] - bx lr - .pool - thumb_func_end sub_8126270 - - thumb_func_start sub_8126318 -sub_8126318: @ 8126318 - ldr r2, =0x03006184 - ldr r0, [r2] - movs r1, 0 - strh r1, [r0] - ldr r2, [r2] - strh r1, [r2, 0x2] - ldr r1, =0x00007fff - adds r0, r1, 0 - strh r0, [r2, 0x4] - bx lr - .pool - thumb_func_end sub_8126318 - - thumb_func_start sub_8126334 -sub_8126334: @ 8126334 - push {r4,r5,lr} - ldr r1, =0x03006184 - ldr r0, [r1] - movs r2, 0 - strh r2, [r0] - ldr r0, [r1] - strh r2, [r0, 0x2] - movs r4, 0 - adds r5, r1, 0 -_08126346: - ldr r0, [r5] - lsls r2, r4, 1 - adds r2, r0 - adds r0, r4, 0x2 - lsls r3, r0, 1 - lsls r1, r0, 11 - lsls r0, 6 - orrs r1, r0 - orrs r1, r3 - strh r1, [r2, 0x4] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xD - bls _08126346 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126334 - - thumb_func_start sub_8126370 -sub_8126370: @ 8126370 - push {r4,lr} - ldr r2, =0x03006184 - ldr r1, [r2] - movs r0, 0 - strh r0, [r1] - movs r3, 0 - adds r4, r2, 0 -_0812637E: - ldr r0, [r4] - lsls r2, r3, 1 - adds r2, r0 - lsls r0, r3, 10 - lsls r1, r3, 5 - orrs r0, r1 - orrs r0, r3 - strh r0, [r2, 0x2] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x1F - bls _0812637E - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126370 - - thumb_func_start sub_81263A4 -sub_81263A4: @ 81263A4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - movs r1, 0xDF - mov r9, r1 - cmp r0, 0 - bne _081263BC - movs r2, 0xFF - mov r9, r2 -_081263BC: - movs r6, 0 - ldr r3, =0x03006184 - mov r12, r3 - mov r0, r9 - lsls r4, r0, 1 - ldr r5, =0x0300616c - cmp r6, r9 - bcs _081263E0 - movs r2, 0 -_081263CE: - ldr r0, [r3] - lsls r1, r6, 1 - adds r1, r0 - strh r2, [r1] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, r9 - bcc _081263CE -_081263E0: - mov r1, r12 - ldr r0, [r1] - adds r0, r4, r0 - ldr r2, =0x00003def - adds r1, r2, 0 - strh r1, [r0] - movs r3, 0 - ldrb r5, [r5] - cmp r3, r5 - bcs _081264E4 -_081263F4: - ldr r2, =0x03006168 - ldr r0, =0x03006178 - ldrb r1, [r0] - adds r1, r3 - ldr r0, =0x03006180 - ldrb r0, [r0] - muls r0, r1 - lsls r0, 1 - ldr r1, [r2] - adds r1, r0 - ldr r0, =0x03006164 - ldrb r0, [r0] - lsls r0, 1 - adds r4, r1, r0 - movs r6, 0 - ldr r0, =0x03006174 - adds r2, r0, 0 - adds r3, 0x1 - mov r10, r3 - ldrb r3, [r2] - cmp r6, r3 - bcs _081264D6 - ldr r0, =0x03006188 - mov r8, r0 -_08126424: - ldrh r0, [r4] - movs r3, 0x80 - lsls r3, 8 - adds r1, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _08126464 - mov r1, r8 - ldrh r0, [r1] - strh r0, [r4] - adds r6, 0x1 - adds r7, r4, 0x2 - b _081264CA - .pool -_08126464: - adds r0, r4, 0 - bl sub_81267C4 - lsls r0, 16 - lsrs r5, r0, 16 - movs r3, 0x1 - adds r6, 0x1 - adds r7, r4, 0x2 - cmp r3, r9 - bcs _081264C0 - ldr r0, =0x03006184 - ldr r2, [r0] - ldrh r1, [r2, 0x2] - mov r12, r0 - cmp r1, 0 - bne _08126494 - strh r5, [r2, 0x2] - mov r2, r8 - ldrh r0, [r2] - adds r0, 0x1 - b _081264BE - .pool -_08126494: - mov r2, r12 - ldr r1, [r2] - lsls r0, r3, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r5 - beq _081264B8 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r9 - bcs _081264C0 - lsls r0, r3, 1 - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, 0 - bne _08126494 - strh r5, [r1] -_081264B8: - mov r1, r8 - ldrh r0, [r1] - adds r0, r3 -_081264BE: - strh r0, [r4] -_081264C0: - ldr r2, =0x03006174 - cmp r3, r9 - bne _081264CA - mov r3, r9 - strh r3, [r4] -_081264CA: - lsls r0, r6, 24 - lsrs r6, r0, 24 - adds r4, r7, 0 - ldrb r0, [r2] - cmp r6, r0 - bcc _08126424 -_081264D6: - mov r1, r10 - lsls r0, r1, 24 - lsrs r3, r0, 24 - ldr r0, =0x0300616c - ldrb r0, [r0] - cmp r3, r0 - bcc _081263F4 -_081264E4: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81263A4 - - thumb_func_start sub_81264FC -sub_81264FC: @ 81264FC - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r2, 0 - ldr r0, =0x0300616c - ldrb r0, [r0] - cmp r2, r0 - bcs _081265A0 - ldr r0, =0x03006168 - mov r8, r0 -_08126510: - ldr r0, =0x03006178 - ldrb r1, [r0] - adds r1, r2 - ldr r0, =0x03006180 - ldrb r0, [r0] - muls r0, r1 - lsls r0, 1 - mov r3, r8 - ldr r1, [r3] - adds r1, r0 - ldr r0, =0x03006164 - ldrb r0, [r0] - lsls r0, 1 - adds r4, r1, r0 - movs r6, 0 - ldr r0, =0x03006174 - adds r3, r0, 0 - adds r7, r2, 0x1 - ldrb r0, [r3] - cmp r6, r0 - bcs _08126594 - ldr r5, =0x03006188 -_0812653C: - ldrh r0, [r4] - movs r2, 0x80 - lsls r2, 8 - adds r1, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _0812656C - ldrh r0, [r5] - strh r0, [r4] - b _08126586 - .pool -_0812656C: - adds r0, r4, 0 - bl sub_8125C68 - lsls r0, 16 - cmp r0, 0 - bne _0812657E - ldrh r0, [r5] - adds r0, 0x1 - b _08126582 -_0812657E: - ldrh r0, [r5] - adds r0, 0x2 -_08126582: - strh r0, [r4] - ldr r3, =0x03006174 -_08126586: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r4, 0x2 - ldrb r0, [r3] - cmp r6, r0 - bcc _0812653C -_08126594: - lsls r0, r7, 24 - lsrs r2, r0, 24 - ldr r0, =0x0300616c - ldrb r0, [r0] - cmp r2, r0 - bcc _08126510 -_081265A0: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81264FC - - thumb_func_start sub_81265B4 -sub_81265B4: @ 81265B4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - movs r2, 0 - ldr r0, =0x0300616c - ldrb r0, [r0] - cmp r2, r0 - bcs _08126650 - ldr r0, =0x03006168 - mov r8, r0 -_081265CA: - ldr r0, =0x03006178 - ldrb r1, [r0] - adds r1, r2 - ldr r0, =0x03006180 - ldrb r0, [r0] - muls r0, r1 - lsls r0, 1 - mov r3, r8 - ldr r1, [r3] - adds r1, r0 - ldr r0, =0x03006164 - ldrb r0, [r0] - lsls r0, 1 - adds r4, r1, r0 - movs r5, 0 - ldr r0, =0x03006174 - adds r7, r2, 0x1 - ldrb r0, [r0] - cmp r5, r0 - bcs _08126644 - ldr r6, =0x03006188 - movs r0, 0x80 - lsls r0, 8 - adds r2, r0, 0 -_081265FA: - ldrh r0, [r4] - ands r0, r2 - cmp r0, 0 - beq _08126624 - ldrh r0, [r6] - strh r0, [r4] - b _08126634 - .pool -_08126624: - adds r0, r4, 0 - str r2, [sp] - bl sub_8126908 - ldrh r1, [r6] - adds r0, r1 - strh r0, [r4] - ldr r2, [sp] -_08126634: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r4, 0x2 - ldr r0, =0x03006174 - ldrb r0, [r0] - cmp r5, r0 - bcc _081265FA -_08126644: - lsls r0, r7, 24 - lsrs r2, r0, 24 - ldr r0, =0x0300616c - ldrb r0, [r0] - cmp r2, r0 - bcc _081265CA -_08126650: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81265B4 - - thumb_func_start sub_8126664 -sub_8126664: @ 8126664 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - movs r2, 0 - ldr r0, =0x0300616c - ldrb r0, [r0] - cmp r2, r0 - bcs _08126700 - ldr r0, =0x03006168 - mov r8, r0 -_0812667A: - ldr r0, =0x03006178 - ldrb r1, [r0] - adds r1, r2 - ldr r0, =0x03006180 - ldrb r0, [r0] - muls r0, r1 - lsls r0, 1 - mov r3, r8 - ldr r1, [r3] - adds r1, r0 - ldr r0, =0x03006164 - ldrb r0, [r0] - lsls r0, 1 - adds r4, r1, r0 - movs r5, 0 - ldr r0, =0x03006174 - adds r7, r2, 0x1 - ldrb r0, [r0] - cmp r5, r0 - bcs _081266F4 - ldr r6, =0x03006188 - movs r0, 0x80 - lsls r0, 8 - adds r2, r0, 0 -_081266AA: - ldrh r0, [r4] - ands r0, r2 - cmp r0, 0 - beq _081266D4 - ldrh r0, [r6] - strh r0, [r4] - b _081266E4 - .pool -_081266D4: - adds r0, r4, 0 - str r2, [sp] - bl sub_812693C - ldrh r1, [r6] - adds r0, r1 - strh r0, [r4] - ldr r2, [sp] -_081266E4: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r4, 0x2 - ldr r0, =0x03006174 - ldrb r0, [r0] - cmp r5, r0 - bcc _081266AA -_081266F4: - lsls r0, r7, 24 - lsrs r2, r0, 24 - ldr r0, =0x0300616c - ldrb r0, [r0] - cmp r2, r0 - bcc _0812667A -_08126700: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126664 - - thumb_func_start sub_8126714 -sub_8126714: @ 8126714 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - movs r2, 0 - ldr r0, =0x0300616c - ldrb r0, [r0] - cmp r2, r0 - bcs _081267B0 - ldr r0, =0x03006168 - mov r8, r0 -_0812672A: - ldr r0, =0x03006178 - ldrb r1, [r0] - adds r1, r2 - ldr r0, =0x03006180 - ldrb r0, [r0] - muls r0, r1 - lsls r0, 1 - mov r3, r8 - ldr r1, [r3] - adds r1, r0 - ldr r0, =0x03006164 - ldrb r0, [r0] - lsls r0, 1 - adds r4, r1, r0 - movs r5, 0 - ldr r0, =0x03006174 - adds r7, r2, 0x1 - ldrb r0, [r0] - cmp r5, r0 - bcs _081267A4 - ldr r6, =0x03006188 - movs r0, 0x80 - lsls r0, 8 - adds r2, r0, 0 -_0812675A: - ldrh r0, [r4] - ands r0, r2 - cmp r0, 0 - beq _08126784 - ldrh r0, [r6] - strh r0, [r4] - b _08126794 - .pool -_08126784: - adds r0, r4, 0 - str r2, [sp] - bl sub_8126838 - ldrh r1, [r6] - adds r0, r1 - strh r0, [r4] - ldr r2, [sp] -_08126794: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r4, 0x2 - ldr r0, =0x03006174 - ldrb r0, [r0] - cmp r5, r0 - bcc _0812675A -_081267A4: - lsls r0, r7, 24 - lsrs r2, r0, 24 - ldr r0, =0x0300616c - ldrb r0, [r0] - cmp r2, r0 - bcc _0812672A -_081267B0: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126714 - - thumb_func_start sub_81267C4 -sub_81267C4: @ 81267C4 - push {r4,lr} - ldrh r0, [r0] - movs r1, 0x1F - movs r4, 0x1F - ands r4, r0 - lsls r0, 16 - lsrs r3, r0, 21 - ands r3, r1 - lsrs r2, r0, 26 - ands r2, r1 - movs r1, 0x3 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _081267E8 - movs r0, 0x1C - ands r0, r4 - adds r4, r0, 0x4 -_081267E8: - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _081267F6 - movs r0, 0x1C - ands r0, r3 - adds r3, r0, 0x4 -_081267F6: - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _08126804 - movs r0, 0x1C - ands r0, r2 - adds r2, r0, 0x4 -_08126804: - cmp r4, 0x5 - bhi _0812680A - movs r4, 0x6 -_0812680A: - cmp r4, 0x1E - bls _08126810 - movs r4, 0x1E -_08126810: - cmp r3, 0x5 - bhi _08126816 - movs r3, 0x6 -_08126816: - cmp r3, 0x1E - bls _0812681C - movs r3, 0x1E -_0812681C: - cmp r2, 0x5 - bhi _08126822 - movs r2, 0x6 -_08126822: - cmp r2, 0x1E - bls _08126828 - movs r2, 0x1E -_08126828: - lsls r0, r2, 10 - lsls r1, r3, 5 - orrs r0, r1 - orrs r4, r0 - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81267C4 - - thumb_func_start sub_8126838 -sub_8126838: @ 8126838 - push {lr} - ldrh r0, [r0] - movs r1, 0x1F - movs r3, 0x1F - ands r3, r0 - lsls r0, 16 - lsrs r2, r0, 21 - ands r2, r1 - lsrs r0, 26 - ands r0, r1 - cmp r3, 0xB - bhi _0812685C - cmp r2, 0xA - bhi _0812685C - cmp r0, 0xA - bhi _0812685C - movs r0, 0x1 - b _08126902 -_0812685C: - cmp r3, 0x13 - bls _08126880 - cmp r2, 0x13 - bls _08126868 - cmp r0, 0x13 - bhi _0812688C -_08126868: - cmp r3, 0x13 - bls _08126880 - cmp r2, 0x13 - bls _08126876 - cmp r0, 0xE - bhi _0812688C - b _081268C4 -_08126876: - cmp r0, 0x13 - bls _08126880 - cmp r2, 0xE - bhi _0812688C - b _081268A0 -_08126880: - cmp r2, 0x13 - bls _08126890 - cmp r0, 0x13 - bls _08126890 - cmp r3, 0xE - bls _081268E8 -_0812688C: - movs r0, 0x2 - b _08126902 -_08126890: - cmp r3, 0x13 - bls _081268B4 - cmp r2, 0xB - bls _081268A8 - cmp r0, 0xB - bls _081268A4 - cmp r2, r0 - bcs _081268C4 -_081268A0: - movs r0, 0x8 - b _08126902 -_081268A4: - movs r0, 0xA - b _08126902 -_081268A8: - cmp r0, 0xB - bls _081268B0 - movs r0, 0xD - b _08126902 -_081268B0: - movs r0, 0x4 - b _08126902 -_081268B4: - cmp r2, 0x13 - bls _081268D8 - cmp r3, 0xB - bls _081268CC - cmp r0, 0xB - bls _081268C8 - cmp r3, r0 - bcc _081268E8 -_081268C4: - movs r0, 0x7 - b _08126902 -_081268C8: - movs r0, 0xB - b _08126902 -_081268CC: - cmp r0, 0xB - bls _081268D4 - movs r0, 0xE - b _08126902 -_081268D4: - movs r0, 0x5 - b _08126902 -_081268D8: - cmp r0, 0x13 - bls _08126900 - cmp r3, 0xB - bls _081268EC - cmp r2, 0xB - bls _081268F4 - cmp r3, r2 - bcs _081268A0 -_081268E8: - movs r0, 0x9 - b _08126902 -_081268EC: - cmp r2, 0xB - bls _081268F4 - movs r0, 0xC - b _08126902 -_081268F4: - cmp r0, 0xB - bls _081268FC - movs r0, 0xF - b _08126902 -_081268FC: - movs r0, 0x6 - b _08126902 -_08126900: - movs r0, 0x3 -_08126902: - pop {r1} - bx r1 - thumb_func_end sub_8126838 - - thumb_func_start sub_8126908 -sub_8126908: @ 8126908 - push {lr} - ldrh r1, [r0] - movs r3, 0x1F - movs r0, 0x1F - ands r0, r1 - lsls r1, 16 - lsrs r2, r1, 21 - ands r2, r3 - lsrs r1, 26 - ands r1, r3 - adds r0, r2 - adds r0, r1 - movs r1, 0x3 - bl __divsi3 - movs r1, 0x1E - ands r0, r1 - lsls r0, 16 - cmp r0, 0 - beq _08126934 - lsrs r0, 17 - b _08126936 -_08126934: - movs r0, 0x1 -_08126936: - pop {r1} - bx r1 - thumb_func_end sub_8126908 - - thumb_func_start sub_812693C -sub_812693C: @ 812693C - push {lr} - ldrh r1, [r0] - movs r3, 0x1F - movs r0, 0x1F - ands r0, r1 - lsls r1, 16 - lsrs r2, r1, 21 - ands r2, r3 - lsrs r1, 26 - ands r1, r3 - adds r0, r2 - adds r0, r1 - movs r1, 0x3 - bl __divsi3 - lsls r0, 16 - movs r1, 0x80 - lsls r1, 9 - adds r0, r1 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_812693C - - thumb_func_start sub_8126968 -sub_8126968: @ 8126968 - push {lr} - ldr r3, =0x0203a173 - ldrb r0, [r3] - cmp r0, 0x7 - bhi _0812697E - ldr r2, =0x0203a14c - ldr r1, =0x0203bc40 - lsls r0, 3 - adds r0, r1 - ldr r0, [r0] - str r0, [r2] -_0812697E: - ldr r2, =0x0203a17c - ldrb r0, [r2, 0x9] - cmp r0, 0 - bne _08126996 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r3, =0x00001aae - adds r1, r0, r3 - str r1, [r2] - ldr r1, =0x00001abe - adds r0, r1 - str r0, [r2, 0x4] -_08126996: - ldrb r0, [r2, 0x9] - cmp r0, 0x1 - bne _081269AC - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r3, =0x0000271c - adds r1, r0, r3 - str r1, [r2] - ldr r1, =0x00002728 - adds r0, r1 - str r0, [r2, 0x4] -_081269AC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126968 - - thumb_func_start sub_81269D4 -sub_81269D4: @ 81269D4 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =0x0203a188 - adds r4, r1, r0 - cmp r1, 0 - bne _08126A28 - ldr r0, =gUnknown_085A6B90 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp] - str r1, [sp, 0x4] - ldr r0, =gUnknown_085A6B48 - movs r1, 0x4 - bl GetMaxWidthInMenuTable - lsls r0, 24 - ldr r2, =0x00ffffff - ldr r1, [sp] - ands r1, r2 - orrs r1, r0 - str r1, [sp] - lsrs r0, r1, 24 - cmp r0, 0x12 - bls _08126A14 - adds r0, r2, 0 - ands r0, r1 - movs r1, 0x90 - lsls r1, 21 - orrs r0, r1 - str r0, [sp] -_08126A14: - mov r0, sp - b _08126A2E - .pool -_08126A28: - lsls r0, r1, 3 - ldr r1, =gUnknown_085A6B90 - adds r0, r1 -_08126A2E: - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r2, 0x85 - lsls r2, 2 - movs r1, 0 - movs r3, 0xE - bl SetWindowBorderStyle - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldrb r0, [r4] - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81269D4 - - thumb_func_start sub_8126A58 -sub_8126A58: @ 8126A58 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x0203a188 - adds r4, r0 - ldrb r0, [r4] - movs r1, 0 - bl sub_8198070 - ldrb r0, [r4] - bl ClearWindowTilemap - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126A58 - - thumb_func_start sub_8126A88 -sub_8126A88: @ 8126A88 - push {r4,lr} - movs r0, 0 - bl sub_81269D4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r2, =gUnknown_085A6B48 - adds r0, r4, 0 - movs r1, 0x4 - bl PrintMenuTable - ldr r0, =0x0203a150 - ldrb r2, [r0] - adds r0, r4, 0 - movs r1, 0x4 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126A88 - - thumb_func_start sub_8126ABC -sub_8126ABC: @ 8126ABC - push {lr} - ldr r1, =0x0203a150 - movs r0, 0 - strb r0, [r1] - bl script_env_2_enable - bl sub_8126A88 - bl sub_8126C08 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126ABC - - thumb_func_start sub_8126AD8 -sub_8126AD8: @ 8126AD8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8126ABC - ldr r2, =0x0203a17c - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r3, =0x00001aae - adds r1, r0, r3 - str r1, [r2] - ldr r1, =0x00001abe - adds r0, r1 - str r0, [r2, 0x4] - movs r1, 0 - movs r0, 0x10 - strb r0, [r2, 0x8] - strb r1, [r2, 0x9] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8126B80 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126AD8 - - thumb_func_start sub_8126B2C -sub_8126B2C: @ 8126B2C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8126ABC - ldr r2, =0x0203a17c - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r3, =0x0000271c - adds r1, r0, r3 - str r1, [r2] - ldr r1, =0x00002728 - adds r0, r1 - str r0, [r2, 0x4] - movs r0, 0xC - strb r0, [r2, 0x8] - movs r0, 0x1 - strb r0, [r2, 0x9] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8126B80 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126B2C - - thumb_func_start sub_8126B80 -sub_8126B80: @ 8126B80 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08126C00 - bl GetMenuCursorPos - lsls r0, 24 - lsrs r4, r0, 24 - bl ProcessMenuInput - lsls r0, 24 - asrs r1, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - beq _08126BD8 - adds r0, 0x1 - cmp r1, r0 - beq _08126BF4 - movs r0, 0x5 - bl audio_play - ldr r1, =gUnknown_085A6B48 - ldr r0, =0x0203a150 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - adds r0, r1 - ldr r1, [r0] - adds r0, r5, 0 - bl _call_via_r1 - b _08126C00 - .pool -_08126BD8: - bl GetMenuCursorPos - ldr r1, =0x0203a150 - strb r0, [r1] - lsls r0, r4, 24 - asrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - beq _08126C00 - bl sub_8126C08 - b _08126C00 - .pool -_08126BF4: - movs r0, 0x5 - bl audio_play - adds r0, r5, 0 - bl sub_8126D6C -_08126C00: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8126B80 - - thumb_func_start sub_8126C08 -sub_8126C08: @ 8126C08 - push {lr} - sub sp, 0x10 - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r1, =gUnknown_085A6B68 - ldr r0, =0x0203a150 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r2, [r0] - 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, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParametrized - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126C08 - - thumb_func_start sub_8126C48 -sub_8126C48: @ 8126C48 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_8161B10 - lsls r0, 24 - cmp r0, 0 - bne _08126C7C - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EA83D - adds r0, r4, 0 - bl ExpandStringRefs - ldr r2, =sub_8126DA4 - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField - b _08126C96 - .pool -_08126C7C: - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - movs r1, 0 - strh r1, [r0, 0x1E] - ldr r0, =0x0203a173 - strb r2, [r0] - adds r0, r5, 0 - bl sub_8126DCC -_08126C96: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126C48 - - thumb_func_start sub_8126CA4 -sub_8126CA4: @ 8126CA4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - bl sub_81299AC - lsls r0, 24 - cmp r0, 0 - bne _08126CD8 - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EAAEC - adds r0, r4, 0 - bl ExpandStringRefs - ldr r2, =sub_8126DA4 - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField - b _08126D00 - .pool -_08126CD8: - movs r0, 0 - bl sub_8126A58 - movs r0, 0 - movs r1, 0 - bl sub_8197434 - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0xC] - ldr r1, =sub_8129ABC - str r1, [r0] -_08126D00: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126CA4 - - thumb_func_start sub_8126D10 -sub_8126D10: @ 8126D10 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_8161B10 - lsls r0, 24 - cmp r0, 0 - bne _08126D44 - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EA83D - adds r0, r4, 0 - bl ExpandStringRefs - ldr r2, =sub_8126DA4 - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField - b _08126D5E - .pool -_08126D44: - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - movs r1, 0x1 - strh r1, [r0, 0x1E] - ldr r0, =0x0203a173 - strb r2, [r0] - adds r0, r5, 0 - bl sub_8126DCC -_08126D5E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126D10 - - thumb_func_start sub_8126D6C -sub_8126D6C: @ 8126D6C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0 - bl sub_8126A58 - ldr r0, =0x0203a17c - ldrb r0, [r0, 0x9] - cmp r0, 0 - bne _08126D98 - ldr r0, =gUnknown_0823B4E8 - bl script_env_1_execute_new_script - adds r0, r4, 0 - bl DestroyTask - b _08126D9E - .pool -_08126D98: - adds r0, r4, 0 - bl sub_816B060 -_08126D9E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8126D6C - - thumb_func_start sub_8126DA4 -sub_8126DA4: @ 8126DA4 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8126C08 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8126B80 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126DA4 - - thumb_func_start sub_8126DCC -sub_8126DCC: @ 8126DCC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_085A6BB0 - movs r1, 0xD0 - movs r2, 0x20 - bl gpu_pal_apply - movs r0, 0 - movs r1, 0 - bl sub_8197434 - movs r0, 0 - bl sub_8126A58 - adds r0, r4, 0 - bl sub_8126DFC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126DCC - - thumb_func_start sub_8126DFC -sub_8126DFC: @ 8126DFC - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0x1 - bl sub_81269D4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - bl sub_8126E8C - ldr r0, =0x0203a173 - ldrb r2, [r0] - adds r0, r4, 0 - movs r1, 0x9 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8127088 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126DFC - - thumb_func_start sub_8126E44 -sub_8126E44: @ 8126E44 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =0x0203a188 - ldrb r0, [r5, 0x1] - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r4, 0 - bl sub_8126E8C - ldrb r0, [r5, 0x1] - ldr r1, =0x0203a173 - ldrb r2, [r1] - movs r1, 0x9 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8127088 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126E44 - - thumb_func_start sub_8126E8C -sub_8126E8C: @ 8126E8C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r1, r0, r1 - ldr r0, =0x0203a188 - ldrb r5, [r0, 0x1] - ldr r0, =0x0203a17c - ldrb r0, [r0, 0x9] - movs r2, 0 - mov r8, r2 - cmp r0, 0x1 - bne _08126EC0 - movs r2, 0x16 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _08126EC0 - movs r0, 0x1 - mov r8, r0 -_08126EC0: - movs r4, 0 - lsls r2, r6, 2 - mov r9, r2 - movs r7, 0xFF -_08126EC8: - mov r0, r8 - cmp r0, 0x1 - bne _08126EF8 - cmp r4, 0x6 - beq _08126EF8 - cmp r4, 0x7 - beq _08126EF8 - lsls r3, r4, 28 - lsrs r3, 24 - str r0, [sp] - str r7, [sp, 0x4] - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x8 - bl sub_8126F68 - b _08126F0C - .pool -_08126EF8: - lsls r3, r4, 28 - lsrs r3, 24 - movs r0, 0 - str r0, [sp] - str r7, [sp, 0x4] - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x8 - bl sub_8126F68 -_08126F0C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _08126EC8 - ldr r0, =0x03005e00 - mov r2, r9 - adds r1, r2, r6 - lsls r1, 3 - adds r1, r0 - movs r2, 0x1E - ldrsh r0, [r1, r2] - ldr r2, =gUnknown_085E8CF0 - cmp r0, 0x2 - bne _08126F2C - ldr r2, =gUnknown_085EB7EA -_08126F2C: - lsls r0, r4, 4 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0x1 - movs r3, 0x8 - bl Print - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8126E8C - - thumb_func_start sub_8126F68 -sub_8126F68: @ 8126F68 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - ldr r4, [sp, 0x38] - ldr r6, [sp, 0x3C] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0xC] - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r2, 24 - lsrs r7, r2, 24 - lsls r3, 24 - lsrs r5, r3, 24 - lsls r4, 24 - lsrs r1, r4, 24 - lsls r6, 24 - lsrs r6, 24 - mov r9, r6 - movs r0, 0x60 - str r0, [sp, 0x14] - cmp r7, 0x8 - bne _08126FA2 - movs r2, 0x68 - str r2, [sp, 0x14] -_08126FA2: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x02021fc4 - adds r0, r4, 0 - bl sub_8127058 - adds r0, r4, 0 - bl GetStringLength - lsls r0, 16 - lsrs r0, 16 - adds r6, r0, r4 - ldr r1, =gUnknown_085A6B28 - mov r2, r8 - lsls r0, r2, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r6, 0 - bl CopyString - str r5, [sp] - mov r0, r9 - str r0, [sp, 0x4] - movs r2, 0 - mov r10, r2 - str r2, [sp, 0x8] - ldr r0, [sp, 0xC] - movs r1, 0x1 - adds r2, r4, 0 - adds r3, r7, 0 - bl Print - mov r0, r8 - bl sub_8161AD0 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - adds r6, r0, 0 - movs r0, 0xBA - strb r0, [r6] - adds r6, 0x1 - ldr r1, =0x0203bc40 - mov r2, r8 - lsls r0, r2, 3 - adds r0, r1 - ldrb r1, [r0, 0x4] - adds r0, r6, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - movs r0, 0x1 - adds r1, r4, 0 - ldr r2, [sp, 0x14] - bl GetStringRightAlignXOffset - lsls r0, 24 - lsrs r7, r0, 24 - str r5, [sp] - mov r0, r9 - str r0, [sp, 0x4] - mov r2, r10 - str r2, [sp, 0x8] - ldr r0, [sp, 0xC] - movs r1, 0x1 - adds r2, r4, 0 - adds r3, r7, 0 - 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_8126F68 - - thumb_func_start sub_8127058 -sub_8127058: @ 8127058 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r4, r1, 24 - lsrs r4, 24 - ldr r1, =gUnknown_085EA7C8 - bl CopyString - cmp r4, 0x1 - bne _08127078 - movs r0, 0x4 - strb r0, [r5, 0x2] - movs r0, 0x5 - b _0812707E - .pool -_08127078: - movs r0, 0x2 - strb r0, [r5, 0x2] - movs r0, 0x3 -_0812707E: - strb r0, [r5, 0x5] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8127058 - - thumb_func_start sub_8127088 -sub_8127088: @ 8127088 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081270DE - bl ProcessMenuInput - lsls r0, 24 - lsrs r4, r0, 24 - asrs r1, r0, 24 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081270C0 - cmp r1, r0 - bgt _081270BC - subs r0, 0x1 - cmp r1, r0 - beq _081270DE - b _081270CE - .pool -_081270BC: - cmp r1, 0x8 - bne _081270CE -_081270C0: - movs r0, 0x5 - bl audio_play - adds r0, r5, 0 - bl sub_812719C - b _081270DE -_081270CE: - movs r0, 0x5 - bl audio_play - ldr r0, =0x0203a173 - strb r4, [r0] - adds r0, r5, 0 - bl sub_81270E8 -_081270DE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127088 - - thumb_func_start sub_81270E8 -sub_81270E8: @ 81270E8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x0203a173 - ldrb r0, [r4] - bl sub_8161AD0 - ldr r1, =0x0203a151 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - beq _08127154 - ldrb r0, [r4] - bl sub_8161A38 - ldr r2, =0x0203a14c - ldr r1, =0x0203bc40 - ldrb r0, [r4] - lsls r0, 3 - adds r0, r1 - ldr r0, [r0] - str r0, [r2] - adds r0, r5, 0 - bl sub_81279B4 - ldr r0, =0x0203a170 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x0203a16e - strh r1, [r0] - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8127620 - str r1, [r0] - b _0812716E - .pool -_08127154: - movs r0, 0x1 - bl sub_8126A58 - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EA83D - adds r0, r4, 0 - bl ExpandStringRefs - ldr r2, =sub_8127180 - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField -_0812716E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81270E8 - - thumb_func_start sub_8127180 -sub_8127180: @ 8127180 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - movs r1, 0 - bl sub_8197434 - adds r0, r4, 0 - bl sub_8126DFC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8127180 - - thumb_func_start sub_812719C -sub_812719C: @ 812719C - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1E - ldrsh r0, [r0, r1] - cmp r0, 0x2 - beq _081271C0 - adds r0, r2, 0 - bl sub_81271CC - b _081271C6 - .pool -_081271C0: - adds r0, r2, 0 - bl sub_8127268 -_081271C6: - pop {r0} - bx r0 - thumb_func_end sub_812719C - - thumb_func_start sub_81271CC -sub_81271CC: @ 81271CC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - bl sub_8126A58 - bl sub_8126A88 - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - bl sub_8126C08 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8126B80 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81271CC - - thumb_func_start sub_8127208 -sub_8127208: @ 8127208 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_085A6BB0 - movs r1, 0xD0 - movs r2, 0x20 - bl gpu_pal_apply - movs r0, 0 - movs r1, 0 - bl sub_8197434 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - movs r1, 0x2 - strh r1, [r0, 0x1E] - ldr r0, =0x0203a173 - strb r2, [r0] - adds r0, r4, 0 - bl sub_8126DFC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127208 - - thumb_func_start sub_8127250 -sub_8127250: @ 8127250 - push {lr} - lsls r1, 24 - ldr r2, =gUnknown_085A6B28 - lsrs r1, 22 - adds r1, r2 - ldr r1, [r1] - bl CopyString - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127250 - - thumb_func_start sub_8127268 -sub_8127268: @ 8127268 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - bl sub_8126A58 - adds r0, r4, 0 - bl sub_8133E1C - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8127268 - - thumb_func_start sub_8127284 -sub_8127284: @ 8127284 - push {lr} - ldr r3, =0x0203a18c - ldr r2, [r3] - ldr r0, =0x0203a151 - ldrb r0, [r0] - adds r0, 0x1 - movs r1, 0xA4 - lsls r1, 3 - adds r2, r1 - strb r0, [r2] - ldr r0, [r3] - adds r1, r0, r1 - ldrb r1, [r1] - cmp r1, 0x8 - bls _081272B8 - ldr r2, =0x00000521 - adds r1, r0, r2 - movs r0, 0x8 - strb r0, [r1] - b _081272BE - .pool -_081272B8: - ldr r2, =0x00000521 - adds r0, r2 - strb r1, [r0] -_081272BE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127284 - - thumb_func_start sub_81272C8 -sub_81272C8: @ 81272C8 - push {r4,lr} - ldr r0, =0x0203a170 - ldr r1, =0x0203a16e - ldr r2, =0x0203a18c - ldr r3, [r2] - ldr r4, =0x00000521 - adds r2, r3, r4 - ldrb r2, [r2] - subs r4, 0x1 - adds r3, r4 - ldrb r3, [r3] - bl sub_812225C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81272C8 - - thumb_func_start sub_81272F8 -sub_81272F8: @ 81272F8 - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x0203a170 - ldr r1, =0x0203a16e - ldr r2, =0x0203a18c - ldr r3, [r2] - ldr r4, =0x00000521 - adds r2, r3, r4 - ldrb r2, [r2] - subs r4, 0x1 - adds r3, r4 - ldrb r3, [r3] - movs r4, 0x8 - str r4, [sp] - bl sub_8122298 - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81272F8 - - thumb_func_start sub_8127330 -sub_8127330: @ 8127330 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r1, r0 - ldr r0, =0x0203a173 - ldrb r0, [r0] - subs r0, 0x6 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _08127378 - ldr r0, =0x0203a17c - ldrb r0, [r0, 0x9] - cmp r0, 0x1 - bne _08127378 - movs r2, 0x16 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _08127378 - ldr r0, =0x02021cc4 - movs r1, 0x1 - bl sub_8127058 - b _08127380 - .pool -_08127378: - ldr r0, =0x02021cc4 - movs r1, 0 - bl sub_8127058 -_08127380: - movs r6, 0 - ldr r1, =0x0203a18c - ldr r0, [r1] - movs r3, 0xA4 - lsls r3, 3 - adds r0, r3 - ldrb r0, [r0] - subs r0, 0x1 - cmp r6, r0 - bge _081273D6 - adds r5, r1, 0 -_08127396: - lsls r4, r6, 1 - adds r4, r6 - lsls r4, 3 - movs r0, 0xA4 - lsls r0, 1 - adds r4, r0 - ldr r0, [r5] - adds r0, r4 - ldr r1, =0x0203a14c - ldr r1, [r1] - adds r1, r6 - ldrb r1, [r1] - bl sub_8127454 - ldr r1, [r5] - lsls r2, r6, 3 - adds r0, r1, r2 - adds r4, r1, r4 - str r4, [r0] - adds r0, r1, 0x4 - adds r0, r2 - str r6, [r0] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - movs r2, 0xA4 - lsls r2, 3 - adds r1, r2 - ldrb r0, [r1] - subs r0, 0x1 - cmp r6, r0 - blt _08127396 -_081273D6: - ldr r5, =0x0203a18c - lsls r4, r6, 1 - adds r4, r6 - lsls r4, 3 - movs r3, 0xA4 - lsls r3, 1 - adds r4, r3 - ldr r0, [r5] - adds r0, r4 - ldr r1, =gUnknown_085E8CF0 - bl CopyString - ldr r0, [r5] - lsls r2, r6, 3 - adds r1, r0, r2 - adds r4, r0, r4 - str r4, [r1] - adds r0, 0x4 - adds r0, r2 - movs r1, 0x2 - negs r1, r1 - str r1, [r0] - ldr r2, =0x03006310 - adds r1, r2, 0 - ldr r0, =gUnknown_085A6BD0 - ldm r0!, {r3,r4,r6} - stm r1!, {r3,r4,r6} - ldm r0!, {r3,r4,r6} - stm r1!, {r3,r4,r6} - ldr r0, =0x0203a188 - ldrb r0, [r0, 0x1] - strb r0, [r2, 0x10] - ldr r0, [r5] - movs r4, 0xA4 - lsls r4, 3 - adds r1, r0, r4 - ldrb r1, [r1] - strh r1, [r2, 0xC] - str r0, [r2] - ldr r6, =0x00000521 - adds r0, r6 - ldrb r0, [r0] - strh r0, [r2, 0xE] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127330 - - thumb_func_start sub_8127454 -sub_8127454: @ 8127454 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r4, r1, 16 - lsrs r4, 16 - ldr r1, =0x02021cc4 - bl CopyString - lsls r4, 5 - ldr r0, =gUnknown_085A5C09 - adds r4, r0 - adds r0, r5, 0 - adds r1, r4, 0 - bl AppendString - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127454 - - thumb_func_start sub_8127480 -sub_8127480: @ 8127480 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x1 - beq _08127492 - movs r0, 0x5 - bl audio_play -_08127492: - adds r0, r4, 0 - bl sub_8127744 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8127480 - - thumb_func_start sub_81274A0 -sub_81274A0: @ 81274A0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - mov r8, r6 - lsls r2, 24 - lsrs r5, r2, 24 - adds r7, r5, 0 - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - beq _081274F6 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_81277BC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081274DC - adds r3, r5, 0x2 - adds r0, r6, 0 - movs r1, 0x18 - movs r2, 0x5C - bl blit_move_info_icon - b _081274F6 -_081274DC: - adds r0, r4, 0 - bl sub_81277E8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081274F6 - adds r3, r7, 0x2 - mov r0, r8 - movs r1, 0x19 - movs r2, 0x5C - bl blit_move_info_icon -_081274F6: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81274A0 - - thumb_func_start sub_8127500 -sub_8127500: @ 8127500 - push {r4,lr} - sub sp, 0x10 - ldr r4, =0x0203a18c - ldr r1, [r4] - ldr r2, =0x00000522 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0xFF - bne _08127540 - subs r2, 0x2 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - subs r0, r1 - str r0, [sp] - movs r0, 0x6E - str r0, [sp, 0x4] - str r0, [sp, 0x8] - ldr r0, =0x0203a170 - str r0, [sp, 0xC] - movs r0, 0x2 - movs r1, 0x3C - movs r2, 0xC - movs r3, 0x94 - bl AddScrollIndicatorArrowPairParametrized - ldr r1, [r4] - ldr r2, =0x00000522 - adds r1, r2 - strb r0, [r1] -_08127540: - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127500 - - thumb_func_start sub_8127554 -sub_8127554: @ 8127554 - push {r4,lr} - ldr r4, =0x0203a18c - ldr r0, [r4] - ldr r2, =0x00000522 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08127572 - bl RemoveScrollIndicatorArrowPair - ldr r0, [r4] - ldr r1, =0x00000522 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] -_08127572: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127554 - - thumb_func_start sub_8127580 -sub_8127580: @ 8127580 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - bl sub_81269D4 - adds r0, r4, 0 - bl sub_812759C - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8127580 - - thumb_func_start sub_812759C -sub_812759C: @ 812759C - push {r4-r6,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, r4, 2 - adds r5, r4 - lsls r5, 3 - ldr r0, =0x03005e08 - adds r5, r0 - movs r0, 0x3 - bl sub_81269D4 - ldr r0, =0x0203a173 - ldrb r0, [r0] - bl sub_8127718 - ldr r6, =0x0203a18c - ldr r0, =0x00000524 - bl AllocZeroed - str r0, [r6] - ldr r1, =0x00000522 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - bl sub_8127284 - bl sub_81272C8 - bl sub_81272F8 - adds r0, r4, 0 - bl sub_8127330 - ldr r0, =0x03006310 - ldr r1, =0x0203a170 - ldrh r1, [r1] - ldr r2, =0x0203a16e - ldrh r2, [r2] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x1A] - bl sub_8127500 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812759C - - thumb_func_start sub_8127620 -sub_8127620: @ 8127620 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_812759C - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_812764C - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127620 - - thumb_func_start sub_812764C -sub_812764C: @ 812764C - 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, =0x03005e08 - adds r5, r0, r1 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08127700 - ldrb r0, [r5, 0x1A] - bl ListMenuHandleInput - adds r4, r0, 0 - ldrb r0, [r5, 0x1A] - ldr r7, =0x0203a170 - ldr r1, =0x0203a16e - mov r8, r1 - adds r1, r7, 0 - mov r2, r8 - bl get_coro_args_x18_x1A - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _081276A4 - adds r0, 0x1 - cmp r4, r0 - bne _081276C4 - b _08127700 - .pool -_081276A4: - movs r0, 0x5 - bl audio_play - ldr r0, =gUnknown_085A6B78 - movs r2, 0x16 - ldrsh r1, [r5, r2] - lsls r1, 3 - adds r0, 0x4 - adds r1, r0 - ldr r1, [r1] - adds r0, r6, 0 - bl _call_via_r1 - b _08127700 - .pool -_081276C4: - movs r0, 0x5 - bl audio_play - ldr r0, =0x0203a172 - strb r4, [r0] - bl sub_8127554 - ldrb r0, [r5, 0x1A] - adds r1, r7, 0 - mov r2, r8 - bl sub_81AE6C8 - movs r0, 0x1 - bl sub_8126A58 - bl sub_81277A8 - ldr r0, =0x0203a18c - ldr r0, [r0] - bl Free - ldr r1, =gUnknown_085A6B78 - movs r2, 0x16 - ldrsh r0, [r5, r2] - lsls r0, 3 - adds r0, r1 - ldr r1, [r0] - adds r0, r6, 0 - bl _call_via_r1 -_08127700: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812764C - - thumb_func_start sub_8127718 -sub_8127718: @ 8127718 - push {r4,lr} - sub sp, 0x8 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x2 - bl sub_81269D4 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl sub_8126F68 - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8127718 - - thumb_func_start sub_8127744 -sub_8127744: @ 8127744 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r0, 0 - ldr r0, =0x0203a188 - ldrb r5, [r0, 0x3] - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =0x0203a151 - ldrb r0, [r0] - cmp r4, r0 - bcc _08127770 - ldr r2, =gUnknown_085E8D62 - b _08127782 - .pool -_08127770: - ldr r1, =gUnknown_085A5C08 - ldr r0, =0x0203a14c - ldr r0, [r0] - adds r0, r4 - ldrb r0, [r0] - lsls r0, 5 - adds r1, 0x18 - adds r0, r1 - ldr r2, [r0] -_08127782: - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - adds r0, r5, 0 - movs r1, 0x1 - movs r3, 0 - bl Print - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127744 - - thumb_func_start sub_81277A8 -sub_81277A8: @ 81277A8 - push {lr} - movs r0, 0x3 - bl sub_8126A58 - movs r0, 0x2 - bl sub_8126A58 - pop {r0} - bx r0 - thumb_func_end sub_81277A8 - - thumb_func_start sub_81277BC -sub_81277BC: @ 81277BC - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0 - ldr r3, =0x0203a152 -_081277C6: - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081277D8 - movs r0, 0x1 - b _081277E4 - .pool -_081277D8: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bls _081277C6 - movs r0, 0 -_081277E4: - pop {r1} - bx r1 - thumb_func_end sub_81277BC - - thumb_func_start sub_81277E8 -sub_81277E8: @ 81277E8 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0 - ldr r3, =0x0203a162 -_081277F2: - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _08127804 - movs r0, 0x1 - b _08127810 - .pool -_08127804: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xB - bls _081277F2 - movs r0, 0 -_08127810: - pop {r1} - bx r1 - thumb_func_end sub_81277E8 - - thumb_func_start sub_8127814 -sub_8127814: @ 8127814 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r5, 0 - ldr r0, =0x0203a152 - movs r1, 0 - movs r2, 0x10 - bl memset - ldr r0, =0x0203a162 - movs r1, 0 - movs r2, 0xC - bl memset - movs r6, 0 - ldr r0, =0x03005d8c - mov r10, r0 - ldr r1, =0x00001aae - mov r9, r1 - ldr r3, =0x0203a173 - mov r8, r3 -_08127842: - mov r1, r10 - ldr r0, [r1] - add r0, r9 - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0 - beq _081278E2 - movs r2, 0 - mov r3, r8 - ldrb r0, [r3] - lsls r0, 3 - ldr r1, =0x0203bc40 - adds r0, r1 - ldrb r0, [r0, 0x4] - cmp r2, r0 - bcs _081278E2 - ldr r7, =0x0203a152 - adds r3, r1, 0 - mov r12, r3 -_08127868: - ldr r0, =0x0203a14c - ldr r1, [r0] - adds r1, r2 - mov r3, r10 - ldr r0, [r3] - add r0, r9 - adds r0, r6 - ldrb r1, [r1] - adds r4, r2, 0x1 - ldrb r0, [r0] - cmp r1, r0 - bne _081278D0 - movs r1, 0 - cmp r1, r5 - bcs _081278A2 - ldrb r0, [r7] - cmp r0, r4 - beq _081278A2 - ldr r3, =0x0203a152 - adds r2, r4, 0 -_08127890: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r5 - bcs _081278A2 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _08127890 -_081278A2: - cmp r1, r5 - bne _081278D0 - adds r0, r5, r7 - strb r4, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - b _081278E2 - .pool -_081278D0: - lsls r0, r4, 16 - lsrs r2, r0, 16 - mov r1, r8 - ldrb r0, [r1] - lsls r0, 3 - add r0, r12 - ldrb r0, [r0, 0x4] - cmp r2, r0 - bcc _08127868 -_081278E2: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0xF - bls _08127842 - movs r5, 0 - movs r6, 0 - ldr r3, =0x0203bc40 - mov r8, r3 -_081278F4: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x0000271c - adds r0, r1 - adds r0, r6 - ldrb r0, [r0] - adds r7, r6, 0x1 - cmp r0, 0 - beq _0812799A - movs r2, 0 - b _0812798C - .pool -_08127918: - ldr r0, =0x0203a14c - ldr r1, [r0] - adds r1, r2 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r3, =0x0000271c - adds r0, r3 - adds r0, r6 - ldrb r1, [r1] - adds r4, r2, 0x1 - ldrb r0, [r0] - cmp r1, r0 - bne _08127988 - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_81277BC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08127988 - movs r1, 0 - cmp r1, r5 - bcs _08127966 - ldr r2, =0x0203a162 - ldrb r0, [r2] - cmp r0, r4 - beq _08127966 - adds r3, r2, 0 - adds r2, r4, 0 -_08127954: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r5 - bcs _08127966 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _08127954 -_08127966: - cmp r1, r5 - bne _08127988 - ldr r0, =0x0203a162 - adds r0, r5, r0 - strb r4, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - b _0812799A - .pool -_08127988: - lsls r0, r4, 16 - lsrs r2, r0, 16 -_0812798C: - ldr r0, =0x0203a173 - ldrb r0, [r0] - lsls r0, 3 - add r0, r8 - ldrb r0, [r0, 0x4] - cmp r2, r0 - bcc _08127918 -_0812799A: - lsls r0, r7, 16 - lsrs r6, r0, 16 - cmp r6, 0xB - bls _081278F4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127814 - - thumb_func_start sub_81279B4 -sub_81279B4: @ 81279B4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_8127814 - pop {r0} - bx r0 - thumb_func_end sub_81279B4 - - thumb_func_start sub_81279C4 -sub_81279C4: @ 81279C4 - push {r4,lr} - movs r2, 0 - ldr r0, =0x0203a170 - ldrh r0, [r0] - ldr r1, =0x0203a16e - ldrh r1, [r1] - adds r0, r1 - adds r1, r0, 0x1 - ldr r4, =0x0203a152 - ldr r3, =0x0203a162 -_081279D8: - adds r0, r2, r4 - ldrb r0, [r0] - cmp r0, r1 - beq _081279EC - cmp r2, 0xB - bhi _08127A00 - adds r0, r2, r3 - ldrb r0, [r0] - cmp r0, r1 - bne _08127A00 -_081279EC: - movs r0, 0 - b _08127A0C - .pool -_08127A00: - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0xF - bls _081279D8 - movs r0, 0x1 -_08127A0C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81279C4 - - thumb_func_start sub_8127A14 -sub_8127A14: @ 8127A14 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - bl sub_81269D4 - adds r0, r4, 0 - bl sub_8127620 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8127A14 - - thumb_func_start sub_8127A30 -sub_8127A30: @ 8127A30 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - movs r1, 0 - bl sub_8197434 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8127A14 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127A30 - - thumb_func_start sub_8127A5C -sub_8127A5C: @ 8127A5C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08127A82 - movs r0, 0 - movs r1, 0 - bl sub_8197434 - movs r0, 0x1 - bl sub_81269D4 - adds r0, r4, 0 - bl sub_8127620 -_08127A82: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127A5C - - thumb_func_start sub_8127A8C -sub_8127A8C: @ 8127A8C - 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, =0x03005e08 - adds r4, r0 - bl sub_8127554 - bl sub_81277A8 - ldrb r0, [r4, 0x1A] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - ldr r0, =0x0203a18c - ldr r0, [r0] - bl Free - adds r0, r5, 0 - bl sub_8126E44 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127A8C - - thumb_func_start sub_8127ACC -sub_8127ACC: @ 8127ACC - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x03005e00 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - adds r4, r2, r3 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldrh r0, [r1] - strh r0, [r4, 0xE] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x10] - adds r3, 0x8 - adds r2, r3 - adds r1, r2, 0x2 - adds r0, r2, 0 - bl PlayerGetDestCoords - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127ACC - - thumb_func_start sub_8127B04 -sub_8127B04: @ 8127B04 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - bl DrawWholeMapView - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r0, 0x4 - ldrsb r0, [r1, r0] - ldrb r1, [r1, 0x5] - lsls r1, 24 - asrs r1, 24 - movs r2, 0x1 - negs r2, r2 - ldr r3, =0x03005e00 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r3 - movs r3, 0xE - ldrsb r3, [r4, r3] - ldrb r4, [r4, 0x10] - lsls r4, 24 - asrs r4, 24 - str r4, [sp] - bl warp1_set - bl warp_in - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127B04 - - thumb_func_start sub_8127B54 -sub_8127B54: @ 8127B54 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0x0000ffff - cmp r2, 0x22 - beq _08127B7C - cmp r2, 0x26 - bne _08127B86 - ldr r0, =gUnknown_085A72E4 - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 28 - lsrs r0, 16 - b _08127B86 - .pool -_08127B7C: - ldr r0, =gUnknown_085A72EC - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 28 - lsrs r0, 16 -_08127B86: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8127B54 - - thumb_func_start sub_8127B90 -sub_8127B90: @ 8127B90 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x34 - ldr r4, [sp, 0x54] - lsls r0, 16 - lsrs r0, 16 - str r0, [sp] - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0x4] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x8] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0xC] - lsls r4, 16 - lsrs r4, 16 - str r4, [sp, 0x10] - movs r2, 0 - lsls r0, r3, 16 - cmp r2, r3 - bcc _08127BC6 - b _08127D28 -_08127BC6: - ldr r1, [sp, 0x8] - str r1, [sp, 0x28] - str r0, [sp, 0x2C] -_08127BCC: - ldr r3, [sp, 0x4] - ldr r4, [sp, 0xC] - subs r1, r3, r4 - lsls r0, r2, 16 - asrs r0, 16 - adds r0, 0x1 - adds r1, r0 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0x14] - movs r0, 0 - mov r10, r0 - adds r1, r2, 0x1 - str r1, [sp, 0x30] - ldr r3, [sp, 0x28] - cmp r10, r3 - bcc _08127BF0 - b _08127D18 -_08127BF0: - ldr r4, [sp, 0x10] - lsls r4, 5 - str r4, [sp, 0x18] - ldr r0, =gUnknown_085A5C24 - adds r0, r4, r0 - str r0, [sp, 0x1C] - ldr r0, =gUnknown_085A5C08 - adds r0, r4, r0 - str r0, [sp, 0x24] - ldr r3, [sp, 0x8] - adds r1, r2, 0 - muls r1, r3 - str r1, [sp, 0x20] -_08127C0A: - ldr r0, [sp] - add r0, r10 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r1, [sp, 0x20] - add r1, r10 - ldr r4, [sp, 0x1C] - ldr r0, [r4] - lsls r1, 1 - adds r1, r0 - movs r2, 0x80 - lsls r2, 2 - adds r0, r2, 0 - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - bl GetBehaviorByMetatileId - lsls r4, r0, 16 - lsls r0, r4, 8 - lsrs r0, 24 - bl sub_80892D8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08127C50 - ldr r3, [sp, 0x24] - ldrb r0, [r3, 0x11] - cmp r0, 0x1 - beq _08127C60 - lsrs r0, r4, 28 - cmp r0, 0 - beq _08127C60 -_08127C50: - movs r4, 0xC0 - lsls r4, 4 - mov r8, r4 - b _08127C64 - .pool -_08127C60: - movs r0, 0 - mov r8, r0 -_08127C64: - ldr r1, [sp, 0x24] - ldrb r0, [r1, 0x11] - lsls r7, r5, 16 - ldr r2, [sp, 0x14] - lsls r2, 16 - mov r9, r2 - cmp r0, 0x3 - beq _08127C8E - asrs r0, r7, 16 - asrs r1, r2, 16 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl sub_8089328 - lsls r0, 24 - lsrs r0, 24 - movs r6, 0x1 - cmp r0, 0x1 - beq _08127C90 -_08127C8E: - movs r6, 0 -_08127C90: - ldr r3, [sp, 0x18] - ldr r4, =gUnknown_085A5C08 - adds r0, r3, r4 - ldrb r0, [r0] - ldr r4, [sp, 0x20] - add r4, r10 - lsls r1, r4, 24 - lsrs r1, 24 - bl sub_8127B54 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x0000ffff - cmp r5, r0 - beq _08127CE0 - asrs r0, r7, 16 - mov r2, r9 - asrs r1, r2, 16 - ldr r3, [sp, 0x1C] - ldr r2, [r3] - lsls r3, r4, 1 - adds r3, r2 - movs r4, 0x80 - lsls r4, 2 - adds r2, r4, 0 - orrs r6, r2 - ldrh r3, [r3] - adds r2, r6, r3 - mov r3, r8 - orrs r3, r2 - orrs r3, r5 - lsls r2, r3, 16 - lsrs r2, 16 - bl MapGridSetMetatileEntryAt - b _08127D06 - .pool -_08127CE0: - asrs r0, r7, 16 - mov r2, r9 - asrs r1, r2, 16 - ldr r3, [sp, 0x1C] - ldr r2, [r3] - lsls r3, r4, 1 - adds r3, r2 - movs r4, 0x80 - lsls r4, 2 - adds r2, r4, 0 - orrs r6, r2 - ldrh r3, [r3] - adds r2, r6, r3 - mov r3, r8 - orrs r3, r2 - lsls r2, r3, 16 - lsrs r2, 16 - bl MapGridSetMetatileIdAt -_08127D06: - mov r0, r10 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - ldr r4, [sp, 0x28] - cmp r10, r4 - bcs _08127D18 - b _08127C0A -_08127D18: - ldr r1, [sp, 0x30] - lsls r0, r1, 16 - lsrs r2, r0, 16 - ldr r3, [sp, 0x2C] - lsrs r0, r3, 16 - cmp r2, r0 - bcs _08127D28 - b _08127BCC -_08127D28: - 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_8127B90 - - thumb_func_start sub_8127D38 -sub_8127D38: @ 8127D38 - push {r4,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 16 - lsrs r2, 16 - ldr r1, =gUnknown_085A5C08 - lsls r0, r2, 5 - adds r0, r1 - ldrb r0, [r0, 0x12] - cmp r0, 0x9 - bhi _08127E10 - lsls r0, 2 - ldr r1, =_08127D68 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08127D68: - .4byte _08127D90 - .4byte _08127D9A - .4byte _08127DA4 - .4byte _08127DB4 - .4byte _08127DBE - .4byte _08127DC8 - .4byte _08127DD8 - .4byte _08127DE2 - .4byte _08127DF2 - .4byte _08127E02 -_08127D90: - str r2, [sp] - adds r0, r3, 0 - adds r1, r4, 0 - movs r2, 0x1 - b _08127DAC -_08127D9A: - str r2, [sp] - adds r0, r3, 0 - adds r1, r4, 0 - movs r2, 0x2 - b _08127DAC -_08127DA4: - str r2, [sp] - adds r0, r3, 0 - adds r1, r4, 0 - movs r2, 0x3 -_08127DAC: - movs r3, 0x1 - bl sub_8127B90 - b _08127E10 -_08127DB4: - str r2, [sp] - adds r0, r3, 0 - adds r1, r4, 0 - movs r2, 0x4 - b _08127DD0 -_08127DBE: - str r2, [sp] - adds r0, r3, 0 - adds r1, r4, 0 - movs r2, 0x2 - b _08127DD0 -_08127DC8: - str r2, [sp] - adds r0, r3, 0 - adds r1, r4, 0 - movs r2, 0x1 -_08127DD0: - movs r3, 0x2 - bl sub_8127B90 - b _08127E10 -_08127DD8: - str r2, [sp] - adds r0, r3, 0 - adds r1, r4, 0 - movs r2, 0x1 - b _08127DFA -_08127DE2: - str r2, [sp] - adds r0, r3, 0 - adds r1, r4, 0 - movs r2, 0x2 - movs r3, 0x4 - bl sub_8127B90 - b _08127E10 -_08127DF2: - str r2, [sp] - adds r0, r3, 0 - adds r1, r4, 0 - movs r2, 0x3 -_08127DFA: - movs r3, 0x3 - bl sub_8127B90 - b _08127E10 -_08127E02: - str r2, [sp] - adds r0, r3, 0 - adds r1, r4, 0 - movs r2, 0x3 - movs r3, 0x2 - bl sub_8127B90 -_08127E10: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8127D38 - - thumb_func_start sub_8127E18 -sub_8127E18: @ 8127E18 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r6, 0 - ldr r7, =0x02037318 - ldr r0, =0x020375e2 - mov r8, r0 - ldr r1, =0x020375e4 - mov r10, r1 - ldr r2, =0x03005d8c - mov r9, r2 -_08127E34: - adds r5, r6, 0 - adds r5, 0xAE - adds r4, r5, 0 - adds r0, r4, 0 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08127F1C - adds r0, r4, 0 - bl FlagReset - movs r2, 0 - ldr r0, [r7, 0x4] - ldrb r4, [r0] - cmp r2, r4 - bcs _08127E82 - ldr r0, [r0, 0x4] - ldrh r0, [r0, 0x14] - cmp r0, r5 - beq _08127E82 - ldr r0, =0x02037318 - ldr r3, [r0, 0x4] - ldrb r6, [r3] - adds r4, r5, 0 -_08127E68: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r6 - bcs _08127E82 - ldr r0, [r3, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x14] - cmp r0, r4 - bne _08127E68 -_08127E82: - ldr r0, [r7, 0x4] - ldr r1, [r0, 0x4] - lsls r4, r2, 1 - adds r4, r2 - lsls r4, 3 - adds r1, r4, r1 - ldr r5, =0x00003f20 - adds r0, r5, 0 - ldrb r1, [r1, 0x1] - adds r0, r1 - ldr r1, =0x0203a190 - ldr r1, [r1] - ldr r1, [r1, 0x1C] - ldrh r1, [r1] - bl VarSet - ldr r0, [r7, 0x4] - ldr r0, [r0, 0x4] - adds r4, r0 - ldrb r0, [r4] - mov r6, r8 - strh r0, [r6] - ldr r1, =0x0203aa34 - ldrh r1, [r1] - mov r2, r10 - strh r1, [r2] - ldr r1, =0x0203aa36 - ldrh r1, [r1] - ldr r4, =0x020375e6 - strh r1, [r4] - mov r5, r9 - ldr r2, [r5] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl show_sprite - ldrb r0, [r6] - ldr r2, [r5] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - mov r6, r10 - movs r4, 0 - ldrsh r3, [r6, r4] - ldr r5, =0x020375e6 - movs r6, 0 - ldrsh r4, [r5, r6] - str r4, [sp] - bl sub_808EBA8 - mov r1, r8 - ldrb r0, [r1] - mov r4, r9 - ldr r2, [r4] - ldrb r1, [r2, 0x5] - ldrb r2, [r2, 0x4] - bl sub_808F254 - b _08127F26 - .pool -_08127F1C: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0xD - bls _08127E34 -_08127F26: - 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_8127E18 - - thumb_func_start sub_8127F38 -sub_8127F38: @ 8127F38 - push {lr} - movs r1, 0 - ldr r0, =0x0203a17c - ldrb r2, [r0, 0x8] - cmp r1, r2 - bcs _08127F62 - ldr r3, [r0] -_08127F46: - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _08127F58 - movs r0, 0x1 - b _08127F64 - .pool -_08127F58: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r2 - bcc _08127F46 -_08127F62: - movs r0, 0 -_08127F64: - pop {r1} - bx r1 - thumb_func_end sub_8127F38 - - thumb_func_start sub_8127F68 -sub_8127F68: @ 8127F68 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x0203a17c - ldrb r0, [r0, 0x9] - cmp r0, 0x1 - bne _08127FAC - ldr r0, =0x0203a173 - ldrb r0, [r0] - cmp r0, 0x6 - beq _08127FAC - cmp r0, 0x7 - beq _08127FAC - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EA9AE - adds r0, r4, 0 - bl ExpandStringRefs - ldr r2, =sub_8127A5C - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField - b _0812804C - .pool -_08127FAC: - bl sub_81279C4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08128038 - bl sub_8127F38 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08127FE8 - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0xC] - ldr r1, =sub_8128060 - str r1, [r0] - b _0812804C - .pool -_08127FE8: - ldr r0, =0x02021cc4 - ldr r4, =0x0203a17c - ldrb r1, [r4, 0x8] - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldrb r0, [r4, 0x9] - cmp r0, 0 - bne _08128018 - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085EA8EA - bl ExpandStringRefs - b _08128020 - .pool -_08128018: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085EA931 - bl ExpandStringRefs -_08128020: - ldr r1, =0x02021fc4 - ldr r2, =sub_8127A5C - adds r0, r5, 0 - bl DisplayItemMessageOnField - b _0812804C - .pool -_08128038: - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EA8D2 - adds r0, r4, 0 - bl ExpandStringRefs - ldr r2, =sub_8127A5C - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField -_0812804C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8127F68 - - thumb_func_start sub_8128060 -sub_8128060: @ 8128060 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r7, r0, r1 - movs r1, 0xC - ldrsh r0, [r7, r1] - cmp r0, 0x1 - beq _081280AC - cmp r0, 0x1 - bgt _08128088 - cmp r0, 0 - beq _0812808E - b _08128112 - .pool -_08128088: - cmp r0, 0x2 - beq _081280FC - b _08128112 -_0812808E: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08128112 - adds r0, r6, 0 - bl sub_8127ACC - movs r0, 0x1 - strh r0, [r7, 0xC] - b _08128112 - .pool -_081280AC: - ldr r4, =0x02037fd4 - ldrb r0, [r4, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r4, 0x8] - ldr r5, =0x0203a190 - ldr r0, =0x0203a172 - ldrb r1, [r0] - ldr r0, =0x0203a14c - ldr r0, [r0] - adds r0, r1 - ldrb r1, [r0] - adds r0, r5, 0 - bl ConfigureCameraObjectForPlacingDecoration - adds r0, r6, 0 - bl sub_812826C - adds r0, r6, 0 - adds r1, r5, 0 - bl SetUpPlacingDecorationPlayerAvatar - bl pal_fill_black - ldrb r1, [r4, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r4, 0x8] - movs r0, 0x2 - strh r0, [r7, 0xC] - b _08128112 - .pool -_081280FC: - bl sub_80ABDFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08128112 - movs r0, 0 - strh r0, [r7, 0x20] - adds r0, r6, 0 - bl sub_8128FD8 -_08128112: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8128060 - - thumb_func_start ConfigureCameraObjectForPlacingDecoration -ConfigureCameraObjectForPlacingDecoration: @ 8128118 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =0x0203aa38 - ldr r4, =0x02020630 - ldr r5, =0x03005dd0 - ldr r2, [r5, 0x4] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x2E] - strb r0, [r3] - adds r0, r6, 0 - bl gpu_pal_decompress_alloc_tag_and_upload - lsls r0, 24 - lsrs r0, 24 - str r0, [r5, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1, 0x5] - ldr r0, [r5, 0x4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r0, r4, 0 - adds r0, 0x1C - adds r0, r2, r0 - ldr r1, =sub_81292D0 - str r1, [r0] - adds r2, r4 - ldr r3, =gUnknown_085A7250 - ldr r0, [r6] - ldrb r0, [r0, 0x12] - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x2] - strh r0, [r2, 0x20] - ldr r0, [r5, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldr r0, [r6] - ldrb r0, [r0, 0x12] - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x3] - strh r0, [r1, 0x22] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ConfigureCameraObjectForPlacingDecoration - - thumb_func_start SetUpPlacingDecorationPlayerAvatar -SetUpPlacingDecorationPlayerAvatar: @ 81281A8 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x03005e00 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - adds r2, r3 - ldrb r2, [r2, 0x12] - ldr r3, =gUnknown_085A7250 - ldr r0, [r1] - ldrb r4, [r0, 0x12] - lsls r1, r4, 2 - adds r1, r3 - lsls r0, r2, 4 - ldrb r1, [r1, 0x2] - adds r0, r1 - subs r2, 0x1 - lsls r2, 3 - subs r0, r2 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r4, 0x2 - beq _081281E2 - cmp r4, 0x8 - beq _081281E2 - cmp r4, 0x9 - bne _081281EA -_081281E2: - adds r0, r2, 0 - subs r0, 0x8 - lsls r0, 24 - lsrs r2, r0, 24 -_081281EA: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _0812820C - ldr r1, =DummyObjectCallback - str r0, [sp] - movs r0, 0xC1 - b _08128214 - .pool -_0812820C: - ldr r1, =DummyObjectCallback - movs r0, 0 - str r0, [sp] - movs r0, 0xC2 -_08128214: - movs r3, 0x48 - bl AddPseudoFieldObject - ldr r1, =0x0203aa39 - strb r0, [r1] - ldr r3, =0x02020630 - ldr r0, =0x0203aa39 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0, 0x5] - ldr r4, =0x0203aa38 - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - bl RemoveObjectAndFreeTiles - ldr r0, =0x03005dd0 - ldr r0, [r0, 0x4] - strb r0, [r4] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end SetUpPlacingDecorationPlayerAvatar - - thumb_func_start sub_812826C -sub_812826C: @ 812826C - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =gUnknown_085A5C08 - ldr r0, =0x0203a172 - ldrb r1, [r0] - ldr r0, =0x0203a14c - ldr r0, [r0] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 5 - adds r0, r2 - ldrb r0, [r0, 0x12] - cmp r0, 0x9 - bls _0812828C - b _081283B2 -_0812828C: - lsls r0, 2 - ldr r1, =_081282A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081282A8: - .4byte _081282D0 - .4byte _081282E4 - .4byte _081282FC - .4byte _08128314 - .4byte _08128328 - .4byte _0812833C - .4byte _08128350 - .4byte _08128370 - .4byte _08128388 - .4byte _081283A0 -_081282D0: - ldr r0, =0x03005e00 - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 3 - adds r1, r0 - movs r0, 0x1 - b _08128394 - .pool -_081282E4: - ldr r1, =0x03005e00 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r0, r1 - movs r1, 0x2 - strh r1, [r0, 0x12] - movs r1, 0x1 - b _081283B0 - .pool -_081282FC: - ldr r1, =0x03005e00 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r0, r1 - movs r1, 0x3 - strh r1, [r0, 0x12] - movs r1, 0x1 - b _081283B0 - .pool -_08128314: - ldr r1, =0x03005e00 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r0, r1 - movs r1, 0x4 - b _081283AC - .pool -_08128328: - ldr r0, =0x03005e00 - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 3 - adds r1, r0 - movs r0, 0x2 - b _08128394 - .pool -_0812833C: - ldr r1, =0x03005e00 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1 - b _081283AC - .pool -_08128350: - ldr r0, =0x03005e00 - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 3 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x12] - movs r0, 0x3 - strh r0, [r1, 0x14] - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - b _081283B2 - .pool -_08128370: - ldr r1, =0x03005e00 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r0, r1 - movs r1, 0x2 - strh r1, [r0, 0x12] - movs r1, 0x4 - b _081283B0 - .pool -_08128388: - ldr r0, =0x03005e00 - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 3 - adds r1, r0 - movs r0, 0x3 -_08128394: - strh r0, [r1, 0x12] - strh r0, [r1, 0x14] - b _081283B2 - .pool -_081283A0: - ldr r1, =0x03005e00 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r0, r1 - movs r1, 0x3 -_081283AC: - strh r1, [r0, 0x12] - movs r1, 0x2 -_081283B0: - strh r1, [r0, 0x14] -_081283B2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_812826C - - thumb_func_start sub_81283BC -sub_81283BC: @ 81283BC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x1C] - ldr r3, =0x02020630 - ldr r0, =0x0203aa38 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r2, 0x1 - strh r2, [r0, 0x3C] - ldr r0, =0x0203aa39 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r2, [r0, 0x3C] - bl sub_8128DE0 - adds r0, r4, 0 - bl sub_8128950 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81283BC - - thumb_func_start sub_8128414 -sub_8128414: @ 8128414 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x1C] - ldr r3, =0x02020630 - ldr r0, =0x0203aa38 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r2, 0x1 - strh r2, [r0, 0x3C] - ldr r0, =0x0203aa39 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r2, [r0, 0x3C] - bl sub_8128DE0 - ldr r5, =0x02021fc4 - ldr r1, =gUnknown_085EA8BF - adds r0, r5, 0 - bl ExpandStringRefs - ldr r2, =sub_8128B80 - adds r0, r4, 0 - adds r1, r5, 0 - bl DisplayItemMessageOnField - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8128414 - - thumb_func_start sub_8128484 -sub_8128484: @ 8128484 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r4, r1, 16 - bl sub_80892C4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0812849E - cmp r4, 0 - beq _081284A2 -_0812849E: - movs r0, 0 - b _081284A4 -_081284A2: - movs r0, 0x1 -_081284A4: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8128484 - - thumb_func_start sub_81284AC -sub_81284AC: @ 81284AC - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r2, 16 - lsrs r4, r2, 16 - lsls r3, 16 - lsrs r5, r3, 16 - lsls r1, 16 - asrs r1, 16 - ldr r3, =0x03005e00 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - adds r2, r3 - movs r3, 0xE - ldrsh r0, [r2, r3] - adds r0, 0x7 - cmp r1, r0 - bne _081284EC - lsls r1, r4, 16 - asrs r1, 16 - movs r3, 0x10 - ldrsh r0, [r2, r3] - adds r0, 0x7 - cmp r1, r0 - bne _081284EC - cmp r5, 0 - beq _081284EC - movs r0, 0 - b _081284EE - .pool -_081284EC: - movs r0, 0x1 -_081284EE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81284AC - - thumb_func_start sub_81284F4 -sub_81284F4: @ 81284F4 - push {r4-r6,lr} - adds r5, r1, 0 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r0, r6, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_80892C4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08128534 - ldrb r0, [r5] - cmp r0, 0x21 - bne _08128522 - adds r0, r4, 0 - bl sub_8089378 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08128530 -_08128522: - lsls r0, r6, 24 - lsrs r0, 24 - bl sub_8089314 - lsls r0, 24 - cmp r0, 0 - beq _08128534 -_08128530: - movs r0, 0x1 - b _08128536 -_08128534: - movs r0, 0 -_08128536: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81284F4 - - thumb_func_start sub_812853C -sub_812853C: @ 812853C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - str r1, [sp] - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r1, =0x03005e00 - lsls r0, 2 - add r0, r10 - lsls r0, 3 - adds r0, r1 - ldrb r2, [r0, 0x14] - str r2, [sp, 0x4] - ldrb r0, [r0, 0x12] - str r0, [sp, 0x8] - ldr r3, [sp] - ldrb r0, [r3, 0x11] - adds r2, r1, 0 - cmp r0, 0x4 - bls _0812856E - b _0812893C -_0812856E: - lsls r0, 2 - ldr r1, =_08128580 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08128580: - .4byte _08128594 - .4byte _08128594 - .4byte _08128680 - .4byte _08128834 - .4byte _081288B8 -_08128594: - movs r6, 0 - ldr r0, [sp, 0x4] - cmp r6, r0 - bcc _0812859E - b _0812893C -_0812859E: - mov r1, r10 - lsls r1, 2 - str r1, [sp, 0x1C] -_081285A4: - mov r2, r10 - lsls r0, r2, 2 - add r0, r10 - lsls r0, 3 - ldr r3, =0x03005e00 - adds r0, r3 - ldrh r0, [r0, 0xA] - subs r0, r6 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - movs r7, 0 - adds r6, 0x1 - str r6, [sp, 0x14] - ldr r0, [sp, 0x8] - cmp r7, r0 - bcs _0812866E - mov r1, r9 - lsls r1, 16 - str r1, [sp, 0xC] - asrs r1, 16 - mov r9, r1 -_081285D0: - ldr r0, [sp, 0x1C] - add r0, r10 - lsls r0, 3 - ldr r2, =0x03005e00 - adds r0, r2 - ldrh r0, [r0, 0x8] - adds r0, r7 - lsls r0, 16 - mov r8, r0 - asrs r6, r0, 16 - adds r0, r6, 0 - mov r1, r9 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - ldr r3, [sp, 0x4] - ldr r1, [sp, 0x14] - subs r0, r3, r1 - ldr r2, [sp, 0x8] - adds r1, r0, 0 - muls r1, r2 - adds r1, r7 - ldr r3, [sp] - ldr r0, [r3, 0x1C] - lsls r1, 1 - adds r1, r0 - movs r2, 0x80 - lsls r2, 2 - adds r0, r2, 0 - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - bl GetBehaviorByMetatileId - movs r3, 0xF0 - lsls r3, 8 - adds r1, r3, 0 - adds r5, r1, 0 - ands r5, r0 - adds r0, r4, 0 - ldr r1, [sp] - bl sub_81284F4 - lsls r0, 24 - cmp r0, 0 - bne _08128632 - b _0812890C -_08128632: - mov r0, r10 - adds r1, r6, 0 - mov r2, r9 - adds r3, r5, 0 - bl sub_81284AC - lsls r0, 24 - cmp r0, 0 - bne _08128646 - b _0812890C -_08128646: - mov r1, r8 - lsrs r0, r1, 16 - ldr r2, [sp, 0xC] - lsrs r1, r2, 16 - movs r2, 0 - bl GetFieldObjectIdByXYZ - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _08128662 - cmp r4, 0x10 - beq _08128662 - b _0812890C -_08128662: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r3, [sp, 0x8] - cmp r7, r3 - bcc _081285D0 -_0812866E: - ldr r1, [sp, 0x14] - lsls r0, r1, 24 - lsrs r6, r0, 24 - ldr r2, [sp, 0x4] - cmp r6, r2 - bcc _081285A4 - b _0812893C - .pool -_08128680: - movs r6, 0 - mov r3, r10 - lsls r3, 2 - str r3, [sp, 0x1C] - ldr r0, [sp, 0x4] - subs r0, 0x1 - str r0, [sp, 0x18] - cmp r6, r0 - bge _0812876C - adds r0, r3, 0 - add r0, r10 - lsls r0, 3 - str r0, [sp, 0x10] -_0812869A: - ldr r1, [sp, 0x10] - adds r0, r1, r2 - ldrh r0, [r0, 0xA] - subs r0, r6 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - movs r7, 0 - adds r6, 0x1 - str r6, [sp, 0x14] - ldr r3, [sp, 0x8] - cmp r7, r3 - bcs _08128760 - lsls r0, 16 - str r0, [sp, 0x20] -_081286B8: - ldr r1, [sp, 0x10] - adds r0, r1, r2 - ldrh r0, [r0, 0x8] - adds r0, r7 - lsls r0, 16 - mov r8, r0 - asrs r6, r0, 16 - mov r2, r9 - lsls r1, r2, 16 - adds r0, r6, 0 - asrs r1, 16 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - ldr r3, [sp, 0x4] - ldr r1, [sp, 0x14] - subs r0, r3, r1 - ldr r2, [sp, 0x8] - adds r1, r0, 0 - muls r1, r2 - adds r1, r7 - ldr r3, [sp] - ldr r0, [r3, 0x1C] - lsls r1, 1 - adds r1, r0 - movs r2, 0x80 - lsls r2, 2 - adds r0, r2, 0 - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - bl GetBehaviorByMetatileId - movs r3, 0xF0 - lsls r3, 8 - adds r1, r3, 0 - adds r5, r1, 0 - ands r5, r0 - adds r0, r4, 0 - bl sub_8089314 - lsls r0, 24 - cmp r0, 0 - bne _08128724 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8128484 - lsls r0, 24 - cmp r0, 0 - bne _08128724 - b _0812890C -_08128724: - mov r0, r10 - adds r1, r6, 0 - ldr r3, [sp, 0x20] - asrs r2, r3, 16 - adds r3, r5, 0 - bl sub_81284AC - lsls r0, 24 - cmp r0, 0 - bne _0812873A - b _0812890C -_0812873A: - mov r1, r8 - lsrs r0, r1, 16 - ldr r2, [sp, 0x20] - lsrs r1, r2, 16 - movs r2, 0 - bl GetFieldObjectIdByXYZ - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - beq _08128752 - b _0812890C -_08128752: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r2, =0x03005e00 - ldr r3, [sp, 0x8] - cmp r7, r3 - bcc _081286B8 -_08128760: - ldr r1, [sp, 0x14] - lsls r0, r1, 24 - lsrs r6, r0, 24 - ldr r3, [sp, 0x18] - cmp r6, r3 - blt _0812869A -_0812876C: - ldr r0, [sp, 0x1C] - add r0, r10 - lsls r0, 3 - adds r0, r2 - ldrh r0, [r0, 0xA] - ldr r1, [sp, 0x4] - subs r0, r1 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - movs r7, 0 - ldr r3, [sp, 0x8] - cmp r7, r3 - bcc _0812878C - b _0812893C -_0812878C: - lsls r0, 16 - str r0, [sp, 0x20] -_08128790: - ldr r0, [sp, 0x1C] - add r0, r10 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r0, r1 - ldrh r0, [r0, 0x8] - adds r0, r7 - lsls r0, 16 - mov r8, r0 - asrs r6, r0, 16 - mov r2, r9 - lsls r1, r2, 16 - adds r0, r6, 0 - asrs r1, 16 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - ldr r3, [sp] - ldr r0, [r3, 0x1C] - lsls r1, r7, 1 - adds r1, r0 - movs r2, 0x80 - lsls r2, 2 - adds r0, r2, 0 - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - bl GetBehaviorByMetatileId - movs r3, 0xF0 - lsls r3, 8 - adds r1, r3, 0 - adds r5, r1, 0 - ands r5, r0 - adds r0, r4, 0 - bl sub_8089314 - lsls r0, 24 - cmp r0, 0 - bne _081287F2 - adds r0, r4, 0 - bl sub_8089328 - lsls r0, 24 - cmp r0, 0 - bne _081287F2 - b _0812890C -_081287F2: - mov r0, r10 - adds r1, r6, 0 - ldr r3, [sp, 0x20] - asrs r2, r3, 16 - adds r3, r5, 0 - bl sub_81284AC - lsls r0, 24 - cmp r0, 0 - bne _08128808 - b _0812890C -_08128808: - mov r1, r8 - lsrs r0, r1, 16 - ldr r2, [sp, 0x20] - lsrs r1, r2, 16 - movs r2, 0 - bl GetFieldObjectIdByXYZ - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _08128822 - cmp r4, 0x10 - bne _0812890C -_08128822: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r3, [sp, 0x8] - cmp r7, r3 - bcc _08128790 - b _0812893C - .pool -_08128834: - movs r6, 0 - ldr r0, [sp, 0x4] - cmp r6, r0 - bcc _0812883E - b _0812893C -_0812883E: - mov r1, r10 - lsls r0, r1, 2 - add r0, r10 - lsls r1, r0, 3 - ldr r2, =0x03005e00 - adds r0, r1, r2 - ldrh r0, [r0, 0xA] - subs r0, r6 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - movs r7, 0 - ldr r3, [sp, 0x8] - cmp r7, r3 - bcs _081288A4 - adds r0, r2, 0 - adds r1, r0 - mov r8, r1 - mov r1, r9 - lsls r0, r1, 16 - asrs r5, r0, 16 -_08128868: - mov r2, r8 - ldrh r0, [r2, 0x8] - adds r0, r7 - lsls r0, 16 - asrs r4, r0, 16 - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r0, 24 - bl sub_8089328 - lsls r0, 24 - cmp r0, 0 - beq _0812890C - adds r0, r4, 0 - adds r1, r5, 0x1 - bl MapGridGetMetatileIdAt - movs r1, 0xA3 - lsls r1, 2 - cmp r0, r1 - beq _0812890C - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r3, [sp, 0x8] - cmp r7, r3 - bcc _08128868 -_081288A4: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, [sp, 0x4] - cmp r6, r0 - bcc _0812883E - b _0812893C - .pool -_081288B8: - mov r3, r10 - lsls r1, r3, 2 - adds r0, r1, r3 - lsls r0, 3 - adds r0, r2 - ldrh r0, [r0, 0xA] - mov r9, r0 - movs r7, 0 - str r1, [sp, 0x1C] - ldr r0, [sp, 0x8] - cmp r7, r0 - bcs _0812893C - adds r6, r2, 0 - mov r1, r9 - lsls r1, 16 - str r1, [sp, 0x20] -_081288D8: - ldr r0, [sp, 0x1C] - add r0, r10 - lsls r0, 3 - adds r0, r6 - ldrh r0, [r0, 0x8] - adds r0, r7 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - mov r2, r9 - lsls r1, r2, 16 - asrs r1, 16 - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - ldr r3, [sp] - ldrb r0, [r3, 0x12] - cmp r0, 0x5 - bne _08128910 -_08128900: - adds r0, r4, 0 - bl sub_8089364 - lsls r0, 24 - cmp r0, 0 - bne _0812891C -_0812890C: - movs r0, 0 - b _0812893E -_08128910: - adds r0, r4, 0 - bl sub_8089350 - lsls r0, 24 - cmp r0, 0 - beq _08128900 -_0812891C: - adds r0, r5, 0 - ldr r2, [sp, 0x20] - lsrs r1, r2, 16 - movs r2, 0 - bl GetFieldObjectIdByXYZ - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - bne _0812890C - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r3, [sp, 0x8] - cmp r7, r3 - bcc _081288D8 -_0812893C: - movs r0, 0x1 -_0812893E: - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_812853C - - thumb_func_start sub_8128950 -sub_8128950: @ 8128950 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x0203a172 - ldrb r1, [r0] - ldr r0, =0x0203a14c - ldr r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r1, 5 - ldr r0, =gUnknown_085A5C08 - adds r1, r0 - adds r0, r5, 0 - bl sub_812853C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081289A4 - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EA897 - adds r0, r4, 0 - bl ExpandStringRefs - ldr r2, =sub_81289D0 - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField - b _081289BE - .pool -_081289A4: - movs r0, 0x20 - bl audio_play - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EA8A6 - adds r0, r4, 0 - bl ExpandStringRefs - ldr r2, =sub_8129020 - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField -_081289BE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8128950 - - thumb_func_start sub_81289D0 -sub_81289D0: @ 81289D0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8197930 - ldr r1, =gUnknown_085A72C4 - adds r0, r4, 0 - bl sub_8121F68 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81289D0 - - thumb_func_start sub_81289F0 -sub_81289F0: @ 81289F0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0 - movs r1, 0 - bl sub_8197434 - adds r0, r4, 0 - bl sub_8128AAC - ldr r2, =gUnknown_085A5C08 - ldr r0, =0x0203a172 - ldrb r1, [r0] - ldr r0, =0x0203a14c - ldr r0, [r0] - adds r0, r1 - ldrb r3, [r0] - lsls r0, r3, 5 - adds r0, r2 - ldrb r0, [r0, 0x11] - cmp r0, 0x4 - beq _08128A44 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - ldrh r1, [r1, 0xA] - adds r2, r3, 0 - bl sub_8127D38 - b _08128A64 - .pool -_08128A44: - ldr r2, =0x0203aa34 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - subs r0, 0x7 - strh r0, [r2] - ldr r2, =0x0203aa36 - ldrh r0, [r1, 0xA] - subs r0, 0x7 - strh r0, [r2] - ldr r0, =gUnknown_08275D1F - bl script_env_1_execute_new_script -_08128A64: - ldr r2, =0x02020630 - ldr r0, =0x0203aa38 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - adds r1, 0x2 - strh r1, [r0, 0x22] - ldr r0, =0x02037318 - ldrb r0, [r0, 0x14] - cmp r0, 0x56 - bne _08128A84 - bl sub_80EE104 -_08128A84: - adds r0, r4, 0 - bl sub_8128BBC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81289F0 - - thumb_func_start sub_8128AAC -sub_8128AAC: @ 8128AAC - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r3, 0 - ldr r0, =0x0203a17c - ldrb r1, [r0, 0x8] - adds r5, r0, 0 - cmp r3, r1 - bcs _08128AD2 - ldr r4, [r5] -_08128AC0: - adds r2, r4, r3 - ldrb r0, [r2] - cmp r0, 0 - beq _08128AF0 - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r1 - bcc _08128AC0 -_08128AD2: - ldrb r0, [r5, 0x9] - cmp r0, 0 - bne _08128B3C - movs r3, 0 - ldr r0, =0x0203a152 - ldrb r1, [r0] - adds r2, r0, 0 - cmp r1, 0 - bne _08128B28 - b _08128B48 - .pool -_08128AF0: - ldr r0, =0x0203a172 - ldrb r1, [r0] - ldr r0, =0x0203a14c - ldr r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r2, [r5, 0x4] - adds r2, r3 - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldrb r0, [r1, 0x8] - subs r0, 0x7 - lsls r0, 4 - ldrb r1, [r1, 0xA] - subs r1, 0x7 - adds r0, r1 - strb r0, [r2] - b _08128AD2 - .pool -_08128B28: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0xF - bhi _08128B76 - adds r1, r3, r2 - ldrb r0, [r1] - cmp r0, 0 - bne _08128B28 - b _08128B6E -_08128B3C: - movs r3, 0 - ldr r0, =0x0203a162 - ldrb r1, [r0] - adds r2, r0, 0 - cmp r1, 0 - bne _08128B5C -_08128B48: - ldr r0, =0x0203a172 - ldrb r0, [r0] - adds r0, 0x1 - strb r0, [r2] - b _08128B76 - .pool -_08128B5C: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0xB - bhi _08128B76 - adds r1, r3, r2 - ldrb r0, [r1] - cmp r0, 0 - bne _08128B5C -_08128B6E: - ldr r0, =0x0203a172 - ldrb r0, [r0] - adds r0, 0x1 - strb r0, [r1] -_08128B76: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8128AAC - - thumb_func_start sub_8128B80 -sub_8128B80: @ 8128B80 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8197930 - ldr r1, =gUnknown_085A72CC - adds r0, r4, 0 - bl sub_8121F68 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8128B80 - - thumb_func_start sub_8128BA0 -sub_8128BA0: @ 8128BA0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - movs r1, 0 - bl sub_8197434 - adds r0, r4, 0 - bl sub_8128BBC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8128BA0 - - thumb_func_start sub_8128BBC -sub_8128BBC: @ 8128BBC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0xC] - ldr r1, =c1_overworld_prev_quest - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8128BBC - - thumb_func_start c1_overworld_prev_quest -c1_overworld_prev_quest: @ 8128BEC - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r5, r0, r1 - movs r1, 0xC - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08128C10 - cmp r0, 0x1 - beq _08128C30 - b _08128C4C - .pool -_08128C10: - bl script_env_2_enable - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08128C4C - adds r0, r4, 0 - bl sub_8127B04 - movs r0, 0x1 - strh r0, [r5, 0xC] - b _08128C4C - .pool -_08128C30: - bl sub_812A3C8 - ldr r0, =0x00000be5 - bl FreeObjectPaletteByTag - ldr r1, =0x03005dac - ldr r0, =sub_8128CD4 - str r0, [r1] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - adds r0, r4, 0 - bl DestroyTask -_08128C4C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end c1_overworld_prev_quest - - thumb_func_start sub_8128C64 -sub_8128C64: @ 8128C64 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r5, r1, 3 - ldr r6, =0x03005e08 - adds r4, r5, r6 - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _08128C9C - cmp r0, 0x1 - bgt _08128C8C - cmp r0, 0 - beq _08128C96 - b _08128CCA - .pool -_08128C8C: - cmp r0, 0x2 - beq _08128CA8 - cmp r0, 0x3 - beq _08128CB4 - b _08128CCA -_08128C96: - bl sub_80E9578 - b _08128CAC -_08128C9C: - ldr r0, =gUnknown_08275D0C - bl script_env_1_execute_new_script - b _08128CAC - .pool -_08128CA8: - bl script_env_2_enable -_08128CAC: - ldrh r0, [r4, 0x4] - adds r0, 0x1 - strh r0, [r4, 0x4] - b _08128CCA -_08128CB4: - bl sub_80ABDFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08128CCA - adds r0, r6, 0 - subs r0, 0x8 - adds r0, r5, r0 - ldr r1, =sub_812764C - str r1, [r0] -_08128CCA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8128C64 - - thumb_func_start sub_8128CD4 -sub_8128CD4: @ 8128CD4 - push {r4,lr} - bl script_env_2_enable - bl pal_fill_black - ldr r0, =sub_8128C64 - movs r1, 0x8 - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_8127580 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0xC] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8128CD4 - - thumb_func_start sub_8128D10 -sub_8128D10: @ 8128D10 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r2, r1, r0 - ldr r0, =0x0203aa3a - ldrb r1, [r0] - adds r3, r0, 0 - cmp r1, 0x1 - bne _08128D48 - movs r1, 0x2 - ldrsh r0, [r2, r1] - movs r4, 0xC - ldrsh r1, [r2, r4] - subs r0, r1 - subs r0, 0x6 - cmp r0, 0 - bge _08128D48 - ldrh r0, [r2, 0x2] - adds r0, 0x1 - b _08128D62 - .pool -_08128D48: - ldrb r0, [r3] - cmp r0, 0x2 - bne _08128D6C - movs r0, 0x2 - ldrsh r1, [r2, r0] - subs r1, 0x7 - ldr r0, =0x02037318 - ldr r0, [r0] - ldr r0, [r0, 0x4] - cmp r1, r0 - blt _08128D6C - ldrh r0, [r2, 0x2] - subs r0, 0x1 -_08128D62: - strh r0, [r2, 0x2] - movs r0, 0 - b _08128DAE - .pool -_08128D6C: - ldrb r0, [r3] - cmp r0, 0x3 - bne _08128D82 - movs r1, 0 - ldrsh r0, [r2, r1] - subs r0, 0x7 - cmp r0, 0 - bge _08128D82 - ldrh r0, [r2] - adds r0, 0x1 - b _08128DA2 -_08128D82: - ldrb r0, [r3] - cmp r0, 0x4 - bne _08128DAC - movs r3, 0 - ldrsh r1, [r2, r3] - movs r4, 0xA - ldrsh r0, [r2, r4] - adds r1, r0 - subs r1, 0x8 - ldr r0, =0x02037318 - ldr r0, [r0] - ldr r0, [r0] - cmp r1, r0 - blt _08128DAC - ldrh r0, [r2] - subs r0, 0x1 -_08128DA2: - strh r0, [r2] - movs r0, 0 - b _08128DAE - .pool -_08128DAC: - movs r0, 0x1 -_08128DAE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8128D10 - - thumb_func_start sub_8128DB4 -sub_8128DB4: @ 8128DB4 - push {lr} - ldr r0, =0x030022c0 - ldrh r0, [r0, 0x2C] - movs r1, 0xF0 - ands r1, r0 - cmp r1, 0x40 - beq _08128DD8 - cmp r1, 0x80 - beq _08128DD8 - cmp r1, 0x20 - beq _08128DD8 - cmp r1, 0x10 - beq _08128DD8 - movs r0, 0 - b _08128DDA - .pool -_08128DD8: - movs r0, 0x1 -_08128DDA: - pop {r1} - bx r1 - thumb_func_end sub_8128DB4 - - thumb_func_start sub_8128DE0 -sub_8128DE0: @ 8128DE0 - push {r4,lr} - ldr r1, =0x0203aa3a - movs r0, 0 - strb r0, [r1] - ldr r4, =0x02020630 - ldr r3, =0x0203aa38 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r2, 0 - strh r2, [r0, 0x32] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r2, [r0, 0x34] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8128DE0 - - thumb_func_start sub_8128E18 -sub_8128E18: @ 8128E18 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r2, r0, 24 - mov r8, r2 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldr r5, =0x02020630 - ldr r3, =0x0203aa38 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x36 - ldrsh r6, [r0, r1] - cmp r6, 0 - beq _08128E46 - b _08128F66 -_08128E46: - movs r1, 0x14 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _08128E68 - ldr r0, =gUnknown_085A72D4 - movs r3, 0x18 - ldrsh r1, [r4, r3] - lsls r1, 3 - b _08128E76 - .pool -_08128E68: - cmp r0, 0x2 - bne _08128E88 - ldr r0, =gUnknown_085A72D4 - movs r3, 0x18 - ldrsh r1, [r4, r3] - lsls r1, 3 - adds r0, 0x4 -_08128E76: - adds r1, r0 - ldr r1, [r1] - adds r0, r2, 0 - bl _call_via_r1 - b _08128FBA - .pool -_08128E88: - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2C] - movs r7, 0xF0 - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0x40 - bne _08128EBC - ldr r1, =0x0203aa3a - movs r0, 0x1 - strb r0, [r1] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x32] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x0000fffe - strh r1, [r0, 0x34] - ldrh r0, [r4, 0x2] - subs r0, 0x1 - strh r0, [r4, 0x2] -_08128EBC: - ldrh r1, [r2, 0x2C] - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0x80 - bne _08128EEC - ldr r1, =0x0203aa3a - movs r0, 0x2 - strb r0, [r1] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x32] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x2 - strh r1, [r0, 0x34] - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] -_08128EEC: - ldrh r1, [r2, 0x2C] - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0x20 - bne _08128F1C - ldr r1, =0x0203aa3a - movs r0, 0x3 - strb r0, [r1] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x0000fffe - strh r1, [r0, 0x32] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x34] - ldrh r0, [r4] - subs r0, 0x1 - strh r0, [r4] -_08128F1C: - ldrh r1, [r2, 0x2C] - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0x10 - bne _08128F4C - ldr r1, =0x0203aa3a - movs r0, 0x4 - strb r0, [r1] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x2 - strh r1, [r0, 0x32] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r6, [r0, 0x34] - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_08128F4C: - bl sub_8128DB4 - lsls r0, 24 - cmp r0, 0 - beq _08128F62 - mov r0, r8 - bl sub_8128D10 - lsls r0, 24 - cmp r0, 0 - bne _08128F66 -_08128F62: - bl sub_8128DE0 -_08128F66: - ldr r0, =0x0203aa3a - ldrb r0, [r0] - cmp r0, 0 - beq _08128F94 - ldr r3, =0x02020630 - ldr r2, =0x0203aa38 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x36] - adds r1, 0x1 - strh r1, [r0, 0x36] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r2, [r1, 0x36] - movs r0, 0x7 - ands r0, r2 - strh r0, [r1, 0x36] -_08128F94: - movs r1, 0x14 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08128FBA - ldr r3, =0x030022c0 - ldrh r1, [r3, 0x2E] - movs r2, 0x1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _08128FAC - strh r2, [r4, 0x14] -_08128FAC: - ldrh r1, [r3, 0x2E] - movs r2, 0x2 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _08128FBA - strh r2, [r4, 0x14] -_08128FBA: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8128E18 - - thumb_func_start sub_8128FD8 -sub_8128FD8: @ 8128FD8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - ldr r2, =0x02020630 - ldr r0, =0x0203aa38 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r2, 0 - strh r2, [r0, 0x3C] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - strh r2, [r0, 0x1C] - ldr r1, =sub_8128E18 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8128FD8 - - thumb_func_start sub_8129020 -sub_8129020: @ 8129020 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0812903A - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08129040 -_0812903A: - adds r0, r2, 0 - bl sub_8128FD8 -_08129040: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8129020 - - thumb_func_start sub_8129048 -sub_8129048: @ 8129048 - push {lr} - sub sp, 0x4 - adds r1, r0, 0 - mov r2, sp - movs r0, 0 - strh r0, [r2] - ldr r2, =0x01000452 - mov r0, sp - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8129048 - - thumb_func_start sub_8129068 -sub_8129068: @ 8129068 - push {lr} - adds r2, r0, 0 - lsls r1, 16 - ldr r0, =gTilesetPointer_SecretBase - ldr r0, [r0] - lsrs r1, 11 - ldr r0, [r0, 0x8] - adds r0, r1 - adds r1, r2, 0 - movs r2, 0x8 - bl CpuFastSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_8129068 - - thumb_func_start sub_8129088 -sub_8129088: @ 8129088 - push {r4-r7,lr} - sub sp, 0x20 - adds r7, r0, 0 - lsls r1, 16 - lsrs r2, r1, 16 - lsrs r4, r1, 26 - adds r5, r4, 0 - cmp r2, 0 - beq _0812909E - ldr r0, =0x000003ff - ands r2, r0 -_0812909E: - ldr r0, =gTilesetPointer_SecretBase - ldr r0, [r0] - lsls r1, r2, 5 - ldr r0, [r0, 0x4] - adds r0, r1 - mov r1, sp - movs r2, 0x8 - bl CpuFastSet - cmp r4, 0x1 - beq _081290DE - cmp r4, 0x1 - bgt _081290C8 - cmp r4, 0 - beq _081290D2 - b _0812919A - .pool -_081290C8: - cmp r5, 0x2 - beq _0812913E - cmp r5, 0x3 - beq _08129176 - b _0812919A -_081290D2: - mov r0, sp - adds r1, r7, 0 - movs r2, 0x8 - bl CpuFastSet - b _0812919A -_081290DE: - movs r5, 0 - movs r6, 0xF -_081290E2: - lsls r4, r5, 2 - adds r4, r7 - adds r5, 0x1 - lsls r3, r5, 2 - subs r0, r3, 0x1 - add r0, sp - ldrb r2, [r0] - lsrs r1, r2, 4 - adds r0, r6, 0 - ands r0, r2 - lsls r0, 4 - adds r1, r0 - strb r1, [r4] - subs r0, r3, 0x2 - add r0, sp - ldrb r2, [r0] - lsrs r1, r2, 4 - adds r0, r6, 0 - ands r0, r2 - lsls r0, 4 - adds r1, r0 - strb r1, [r4, 0x1] - subs r0, r3, 0x3 - add r0, sp - ldrb r2, [r0] - lsrs r1, r2, 4 - adds r0, r6, 0 - ands r0, r2 - lsls r0, 4 - adds r1, r0 - strb r1, [r4, 0x2] - subs r3, 0x4 - mov r1, sp - adds r0, r1, r3 - ldrb r2, [r0] - lsrs r1, r2, 4 - adds r0, r6, 0 - ands r0, r2 - lsls r0, 4 - adds r1, r0 - strb r1, [r4, 0x3] - lsls r5, 16 - lsrs r5, 16 - cmp r5, 0x7 - bls _081290E2 - b _0812919A -_0812913E: - movs r5, 0 - movs r3, 0x7 -_08129142: - lsls r2, r5, 2 - adds r2, r7 - subs r1, r3, r5 - lsls r1, 2 - mov r4, sp - adds r0, r4, r1 - ldrb r0, [r0] - strb r0, [r2] - adds r0, r1, 0x1 - add r0, sp - ldrb r0, [r0] - strb r0, [r2, 0x1] - adds r0, r1, 0x2 - add r0, sp - ldrb r0, [r0] - strb r0, [r2, 0x2] - adds r1, 0x3 - adds r0, r4, r1 - ldrb r0, [r0] - strb r0, [r2, 0x3] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x7 - bls _08129142 - b _0812919A -_08129176: - movs r5, 0 - movs r4, 0x1F - movs r6, 0xF -_0812917C: - adds r3, r7, r5 - subs r0, r4, r5 - add r0, sp - ldrb r2, [r0] - lsrs r1, r2, 4 - adds r0, r6, 0 - ands r0, r2 - lsls r0, 4 - adds r1, r0 - strb r1, [r3] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x1F - bls _0812917C -_0812919A: - add sp, 0x20 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8129088 - - thumb_func_start sub_81291A4 -sub_81291A4: @ 81291A4 - push {r4,r5,lr} - adds r5, r0, 0 - movs r4, 0 -_081291AA: - lsls r0, r4, 5 - adds r0, 0x84 - adds r0, r5, r0 - lsls r2, r4, 1 - adds r1, r5, 0x4 - adds r1, r2 - ldrh r1, [r1] - bl sub_8129088 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x3F - bls _081291AA - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81291A4 - - thumb_func_start sub_81291CC -sub_81291CC: @ 81291CC - lsls r0, 16 - ldr r1, =gTilesetPointer_SecretBaseRedCave - ldr r1, [r1] - ldr r1, [r1, 0xC] - lsrs r0, 15 - adds r0, r1 - ldrh r1, [r0] - ldr r0, =0x00000fff - ands r0, r1 - bx lr - .pool - thumb_func_end sub_81291CC - - thumb_func_start sub_81291E8 -sub_81291E8: @ 81291E8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r0 - ldr r0, [r0] - ldrb r0, [r0, 0x12] - movs r6, 0 - ldr r1, =gUnknown_085A71B0 - lsls r5, r0, 4 - adds r0, r5, r1 - ldrb r0, [r0, 0xC] - cmp r6, r0 - bcs _0812924C - adds r7, r1, 0 -_08129204: - mov r4, r8 - ldm r4!, {r1} - adds r0, r7, 0x4 - adds r0, r5, r0 - ldr r0, [r0] - adds r0, r6 - ldrb r0, [r0] - ldr r1, [r1, 0x1C] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - adds r1, r7, 0 - adds r1, 0x8 - adds r1, r5, r1 - ldr r1, [r1] - adds r1, r6 - lsls r0, 3 - ldrb r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - bl sub_81291CC - adds r2, r5, r7 - ldr r1, [r2] - adds r1, r6 - ldrb r1, [r1] - lsls r1, 1 - adds r4, r1 - strh r0, [r4] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r2, [r2, 0xC] - cmp r6, r2 - bcc _08129204 -_0812924C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81291E8 - - thumb_func_start sub_812925C -sub_812925C: @ 812925C - push {r4,r5,lr} - lsls r0, 24 - ldr r3, =0x0203aa3c - movs r1, 0 - strb r1, [r3] - ldrb r2, [r3, 0x1] - subs r1, 0x4 - ands r1, r2 - movs r5, 0xD - negs r5, r5 - ands r1, r5 - movs r2, 0x11 - negs r2, r2 - ands r1, r2 - subs r2, 0x10 - ands r1, r2 - strb r1, [r3, 0x1] - ldr r1, =gUnknown_085A7250 - lsrs r0, 22 - adds r0, r1 - ldrb r1, [r0] - movs r4, 0x3F - lsls r1, 6 - strb r1, [r3, 0x1] - ldrh r2, [r3, 0x2] - ldr r1, =0xfffffe00 - ands r1, r2 - strh r1, [r3, 0x2] - ldrb r2, [r3, 0x3] - movs r1, 0x3F - negs r1, r1 - ands r1, r2 - strb r1, [r3, 0x3] - ldrb r0, [r0, 0x1] - lsls r0, 6 - ands r4, r1 - orrs r4, r0 - strb r4, [r3, 0x3] - ldrh r1, [r3, 0x4] - ldr r0, =0xfffffc00 - ands r0, r1 - strh r0, [r3, 0x4] - ldrb r0, [r3, 0x5] - ands r5, r0 - movs r0, 0xF - ands r5, r0 - strb r5, [r3, 0x5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812925C - - thumb_func_start sub_81292D0 -sub_81292D0: @ 81292D0 - movs r1, 0 - strh r1, [r0, 0x32] - strh r1, [r0, 0x34] - strh r1, [r0, 0x36] - strh r1, [r0, 0x38] - strh r1, [r0, 0x3A] - strh r1, [r0, 0x3C] - ldr r1, =sub_81292E8 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_81292D0 - - thumb_func_start sub_81292E8 -sub_81292E8: @ 81292E8 - push {lr} - adds r2, r0, 0 - movs r1, 0x3C - ldrsh r0, [r2, r1] - cmp r0, 0 - bne _08129322 - movs r1, 0x3A - ldrsh r0, [r2, r1] - cmp r0, 0xE - bgt _0812930A - adds r3, r2, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - b _08129314 -_0812930A: - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 -_08129314: - strb r0, [r3] - ldrh r0, [r2, 0x3A] - adds r0, 0x1 - movs r1, 0x1F - ands r0, r1 - strh r0, [r2, 0x3A] - b _0812932E -_08129322: - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_0812932E: - pop {r0} - bx r0 - thumb_func_end sub_81292E8 - - thumb_func_start gpu_pal_decompress_alloc_tag_and_upload -gpu_pal_decompress_alloc_tag_and_upload: @ 8129334 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - lsls r4, r1, 24 - lsrs r4, 24 - bl sub_8129048 - lsls r4, 5 - ldr r0, =gUnknown_085A5C08 - adds r4, r0 - str r4, [r5] - ldrb r0, [r4, 0x11] - cmp r0, 0x4 - beq _081293B4 - ldr r0, =0x00000be5 - bl FreeObjectPaletteByTag - adds r0, r5, 0 - bl sub_81291E8 - ldr r0, [r5] - ldrb r0, [r0, 0x12] - bl sub_812925C - adds r0, r5, 0 - bl sub_81291A4 - ldr r1, =0x00000884 - adds r0, r5, r1 - ldr r1, =gTilesetPointer_SecretBaseRedCave - ldr r2, [r1] - ldr r1, [r5] - ldr r1, [r1, 0x1C] - ldrh r1, [r1] - ldr r2, [r2, 0xC] - lsls r1, 4 - adds r1, r2 - ldrh r1, [r1, 0xE] - lsrs r1, 12 - bl sub_8129068 - ldr r0, =gUnknown_085A72BC - bl LoadTaggedObjectPalette - ldr r0, =gUnknown_085A728C - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl AddObjectToFront - b _081293C6 - .pool -_081293B4: - ldr r0, [r4, 0x1C] - ldrh r0, [r0] - ldr r1, =DummyObjectCallback - movs r2, 0x1 - str r2, [sp] - movs r2, 0 - movs r3, 0 - bl AddPseudoFieldObject -_081293C6: - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end gpu_pal_decompress_alloc_tag_and_upload - - thumb_func_start AddDecorationIconObjectFromIconTable -@ u8 AddDecorationIconObjectFromIconTable(u16 tilesTag, u16 paletteTag, u8 decorationId) -AddDecorationIconObjectFromIconTable: @ 81293D8 - push {r4-r7,lr} - sub sp, 0x10 - lsls r0, 16 - lsrs r7, r0, 16 - lsls r1, 16 - lsrs r6, r1, 16 - lsls r2, 24 - lsrs r5, r2, 24 - bl AllocItemIconTemporaryBuffers - lsls r0, 24 - cmp r0, 0 - beq _08129490 - adds r0, r5, 0 - movs r1, 0 - bl GetDecorationIconPicOrPalette - ldr r4, =0x0203cebc - ldr r1, [r4] - bl LZDecompressWram - ldr r0, [r4] - ldr r4, =0x0203cec0 - 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 LoadObjectPic - adds r0, r5, 0 - movs r1, 0x1 - bl GetDecorationIconPicOrPalette - 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 - adds r1, r5, 0 - ldr r0, =gUnknown_08614FF4 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - strh r7, [r5] - strh r6, [r5, 0x2] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl AddObjectToFront - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl FreeItemIconTemporaryBuffers - adds r0, r5, 0 - bl Free - adds r0, r4, 0 - b _08129492 - .pool -_08129490: - movs r0, 0x40 -_08129492: - add sp, 0x10 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end AddDecorationIconObjectFromIconTable - - thumb_func_start GetDecorationIconPicOrPalette -@ u32 GetDecorationIconPicOrPalette(u16 decorationId, u8 which) -GetDecorationIconPicOrPalette: @ 812949C - push {lr} - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, 24 - lsrs r0, r1, 24 - cmp r3, 0x78 - bls _081294AC - movs r3, 0 -_081294AC: - ldr r2, =gUnknown_085A6BE8 - lsls r0, 2 - lsls r1, r3, 3 - adds r0, r1 - adds r0, r2 - ldr r0, [r0] - pop {r1} - bx r1 - .pool - thumb_func_end GetDecorationIconPicOrPalette - - thumb_func_start AddDecorationIconObjectFromFieldObject -@ u8 AddDecorationIconObjectFromFieldObject(u16 tilesTag, u16 paletteTag, u8 decorationId) -AddDecorationIconObjectFromFieldObject: @ 81294C0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - adds r4, r2, 0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 16 - lsrs r7, r1, 16 - lsls r4, 24 - lsrs r4, 24 - ldr r6, =0x0203a190 - adds r0, r6, 0 - bl sub_8129048 - lsls r4, 5 - ldr r0, =gUnknown_085A5C08 - adds r4, r0 - str r4, [r6] - ldrb r0, [r4, 0x11] - cmp r0, 0x4 - beq _081295A4 - adds r0, r6, 0 - bl sub_81291E8 - ldr r0, [r6] - ldrb r0, [r0, 0x12] - bl sub_812925C - adds r0, r6, 0 - bl sub_81291A4 - ldr r0, =0x00000884 - adds r5, r6, r0 - ldr r0, =gTilesetPointer_SecretBaseRedCave - ldr r1, [r0] - ldr r0, [r6] - ldr r0, [r0, 0x1C] - ldrh r0, [r0] - ldr r1, [r1, 0xC] - lsls r0, 4 - adds r0, r1 - ldrh r1, [r0, 0xE] - lsrs r1, 12 - adds r0, r5, 0 - bl sub_8129068 - adds r0, r6, 0 - adds r0, 0x84 - str r0, [sp, 0x4] - ldr r1, =gUnknown_085A72F4 - ldr r0, [r6] - ldrb r0, [r0, 0x12] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 21 - ldr r4, =0xffff0000 - mov r2, r8 - lsls r1, r2, 16 - lsrs r0, 16 - orrs r0, r1 - str r0, [sp, 0x8] - add r0, sp, 0x4 - bl LoadObjectPic - str r5, [sp, 0xC] - add r0, sp, 0xC - ldr r1, [r0, 0x4] - ands r1, r4 - orrs r1, r7 - str r1, [r0, 0x4] - bl LoadTaggedObjectPalette - movs r0, 0x18 - bl Alloc - adds r4, r0, 0 - adds r1, r4, 0 - ldr r0, =gUnknown_085A72A4 - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - mov r3, r8 - strh r3, [r4] - strh r7, [r4, 0x2] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - bl Free - b _081295BA - .pool -_081295A4: - ldr r0, [r4, 0x1C] - ldrh r0, [r0] - ldr r1, =DummyObjectCallback - movs r2, 0x1 - str r2, [sp] - movs r2, 0 - movs r3, 0 - bl AddPseudoFieldObject - lsls r0, 24 - lsrs r5, r0, 24 -_081295BA: - adds r0, r5, 0 - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end AddDecorationIconObjectFromFieldObject - - thumb_func_start AddDecorationIconObject -@ u8 AddDecorationIconObject(u8 decorationId, u16 x, u16 y, u8 priority, u16 tilesTag, u16 paletteTag) -AddDecorationIconObject: @ 81295CC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r4, [sp, 0x24] - ldr r5, [sp, 0x28] - lsls r0, 24 - lsrs r6, r0, 24 - mov r12, r6 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - mov r9, r8 - lsls r2, 16 - lsrs r7, r2, 16 - mov r10, r7 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp] - lsls r4, 16 - lsrs r4, 16 - adds r3, r4, 0 - lsls r5, 16 - lsrs r5, 16 - adds r2, r5, 0 - cmp r6, 0x78 - bls _08129634 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0 - bl AddDecorationIconObjectFromIconTable - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x40 - beq _08129696 - ldr r2, =0x02020630 - lsls r3, r4, 4 - adds r1, r3, r4 - lsls r1, 2 - adds r1, r2 - mov r5, r8 - lsls r0, r5, 16 - asrs r0, 16 - adds r0, 0x4 - strh r0, [r1, 0x24] - lsls r0, r7, 16 - b _081296B2 - .pool -_08129634: - ldr r0, =gUnknown_085A6BE8 - lsls r1, r6, 3 - adds r1, r0 - ldr r0, [r1] - cmp r0, 0 - bne _08129684 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - bl AddDecorationIconObjectFromFieldObject - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x40 - beq _08129696 - ldr r1, =0x02020630 - lsls r2, r4, 4 - adds r0, r2, r4 - lsls r0, 2 - adds r5, r0, r1 - mov r0, r8 - strh r0, [r5, 0x24] - adds r0, r6, 0 - subs r0, 0x2A - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _08129680 - lsls r0, r7, 16 - asrs r0, 16 - subs r0, 0x4 - strh r0, [r5, 0x26] - b _081296BC - .pool -_08129680: - strh r7, [r5, 0x26] - b _081296BC -_08129684: - adds r0, r3, 0 - adds r1, r2, 0 - mov r2, r12 - bl AddDecorationIconObjectFromIconTable - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x40 - bne _0812969A -_08129696: - movs r0, 0x40 - b _081296D8 -_0812969A: - ldr r2, =0x02020630 - lsls r3, r4, 4 - adds r1, r3, r4 - lsls r1, 2 - adds r1, r2 - mov r5, r9 - lsls r0, r5, 16 - asrs r0, 16 - adds r0, 0x4 - strh r0, [r1, 0x24] - mov r5, r10 - lsls r0, r5, 16 -_081296B2: - asrs r0, 16 - adds r0, 0x4 - strh r0, [r1, 0x26] - adds r1, r2, 0 - adds r2, r3, 0 -_081296BC: - adds r2, r4 - lsls r2, 2 - adds r2, r1 - movs r0, 0x3 - ldr r1, [sp] - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x5] - adds r0, r4, 0 -_081296D8: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end AddDecorationIconObject - - thumb_func_start sub_81296EC -sub_81296EC: @ 81296EC - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x0203a17c - ldr r1, [r3] - adds r1, r0 - movs r2, 0 - strb r2, [r1] - ldr r1, [r3, 0x4] - adds r1, r0 - strb r2, [r1] - bx lr - .pool - thumb_func_end sub_81296EC - - thumb_func_start sub_8129708 -sub_8129708: @ 8129708 - push {r4-r6,lr} - ldr r6, =0x020375e2 - movs r0, 0 - strh r0, [r6] - ldr r2, =0x020375f0 - strh r0, [r2] - ldr r4, =0x020375e0 - ldr r1, =0x0203aac4 - ldrh r0, [r4] - ldrb r1, [r1] - cmp r0, r1 - bne _08129744 - movs r0, 0x1 - strh r0, [r2] - b _08129796 - .pool -_08129738: - ldr r1, =0x020375e4 - ldrb r0, [r2] - strh r0, [r1] - b _08129796 - .pool -_08129744: - ldr r3, =gUnknown_085A5C08 - ldr r2, =0x0203a17c - ldr r1, =0x0203aa44 - ldrh r0, [r4] - lsls r0, 3 - adds r4, r0, r1 - ldrb r1, [r4] - ldr r0, [r2] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 5 - adds r0, r3 - ldrb r0, [r0, 0x11] - cmp r0, 0x4 - bne _08129796 - ldrh r0, [r4, 0x4] - strh r0, [r6] - ldrb r0, [r4] - bl sub_81296EC - movs r1, 0 - ldr r0, =0x02037318 - ldr r0, [r0, 0x4] - ldrb r2, [r0] - cmp r1, r2 - bcs _08129796 - ldr r5, [r0, 0x4] - ldrh r4, [r6] - adds r3, r2, 0 -_0812977E: - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - adds r2, r0, r5 - ldrh r0, [r2, 0x14] - cmp r0, r4 - beq _08129738 - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r3 - bcc _0812977E -_08129796: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8129708 - - thumb_func_start sub_81297AC -sub_81297AC: @ 81297AC - push {r4-r6,lr} - movs r2, 0 - ldr r0, =0x02037318 - ldr r0, [r0, 0x4] - ldrb r1, [r0] - cmp r2, r1 - bcs _081297F0 - adds r3, r0, 0 - ldr r5, [r3, 0x4] - ldr r0, =0x020375e0 - ldrh r4, [r0] - ldr r6, =0x020375e2 -_081297C4: - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 3 - adds r1, r0, r5 - ldrh r0, [r1, 0x14] - cmp r0, r4 - bne _081297E4 - ldrb r0, [r1] - strh r0, [r6] - b _081297F0 - .pool -_081297E4: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - ldrb r0, [r3] - cmp r2, r0 - bcc _081297C4 -_081297F0: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81297AC - - thumb_func_start sub_81297F8 -sub_81297F8: @ 81297F8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - movs r6, 0 - b _081298BE -_08129808: - ldr r3, =0x0203aa44 - lsls r5, r6, 3 - adds r4, r5, r3 - ldrb r1, [r4] - ldr r2, =0x0203a17c - ldr r0, [r2] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 5 - ldr r7, =gUnknown_085A5C08 - adds r0, r7 - ldrb r2, [r0, 0x11] - ldr r7, =0x0203a17c - ldr r0, [r7, 0x4] - adds r0, r1 - ldrb r0, [r0] - lsrs r1, r0, 4 - mov r8, r1 - movs r7, 0xF - adds r1, r7, 0 - ands r1, r0 - str r1, [sp] - adds r7, r5, 0 - adds r6, 0x1 - str r6, [sp, 0x4] - cmp r2, 0x4 - beq _081298B8 - movs r6, 0 - ldrb r4, [r4, 0x2] - cmp r6, r4 - bcs _081298AE -_08129846: - movs r4, 0 - adds r0, r5, r3 - adds r2, r6, 0x1 - mov r10, r2 - ldrb r0, [r0, 0x1] - cmp r4, r0 - bcs _0812989C - ldr r3, =0x0203aa44 - adds r3, r7 - mov r9, r3 - subs r5, r6, 0x7 - str r5, [sp, 0x8] -_0812985E: - adds r0, r4, 0x7 - add r0, r8 - ldr r1, =0x02037318 - ldr r3, [r1] - ldr r1, [sp] - subs r2, r1, r6 - ldr r1, [r3] - muls r2, r1 - mov r5, r8 - adds r1, r5, r4 - adds r1, r2 - ldr r2, [r3, 0xC] - lsls r1, 1 - adds r1, r2 - ldrh r1, [r1] - movs r3, 0xC0 - lsls r3, 6 - adds r2, r3, 0 - orrs r2, r1 - ldr r5, [sp] - ldr r3, [sp, 0x8] - subs r1, r5, r3 - bl MapGridSetMetatileEntryAt - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - mov r5, r9 - ldrb r5, [r5, 0x1] - cmp r4, r5 - bcc _0812985E -_0812989C: - mov r1, r10 - lsls r0, r1, 24 - lsrs r6, r0, 24 - ldr r3, =0x0203aa44 - adds r5, r7, 0 - adds r0, r7, r3 - ldrb r0, [r0, 0x2] - cmp r6, r0 - bcc _08129846 -_081298AE: - ldr r2, =0x0203aa44 - adds r0, r7, r2 - ldrb r0, [r0] - bl sub_81296EC -_081298B8: - ldr r3, [sp, 0x4] - lsls r0, r3, 24 - lsrs r6, r0, 24 -_081298BE: - ldr r0, =0x0203aac4 - ldrb r0, [r0] - cmp r6, r0 - bcc _08129808 - 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_81297F8 - - thumb_func_start sub_81298EC -sub_81298EC: @ 81298EC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _08129928 - cmp r0, 0x1 - bgt _08129914 - cmp r0, 0 - beq _0812991E - b _08129994 - .pool -_08129914: - cmp r0, 0x2 - beq _08129954 - cmp r0, 0x3 - beq _08129968 - b _08129994 -_0812991E: - bl sub_81297F8 - movs r0, 0x1 - strh r0, [r4, 0xC] - b _08129994 -_08129928: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08129994 - bl DrawWholeMapView - ldr r0, =gUnknown_08275D2E - bl script_env_1_execute_new_script - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - movs r0, 0x2 - strh r0, [r4, 0xC] - b _08129994 - .pool -_08129954: - bl script_env_2_enable - adds r0, r5, 0 - bl sub_8127814 - bl pal_fill_black - movs r0, 0x3 - strh r0, [r4, 0xC] - b _08129994 -_08129968: - bl sub_80ABDFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08129994 - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EAAC5 - adds r0, r4, 0 - bl ExpandStringRefs - ldr r2, =sub_8129D64 - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField - ldr r0, =0x02037318 - ldrb r0, [r0, 0x14] - cmp r0, 0x56 - bne _08129994 - bl sub_80EE104 -_08129994: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81298EC - - thumb_func_start sub_81299AC -sub_81299AC: @ 81299AC - push {lr} - movs r1, 0 - ldr r0, =0x0203a17c - ldrb r2, [r0, 0x8] - cmp r1, r2 - bcs _081299D6 - ldr r3, [r0] -_081299BA: - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _081299CC - movs r0, 0x1 - b _081299D8 - .pool -_081299CC: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r2 - bcc _081299BA -_081299D6: - movs r0, 0 -_081299D8: - pop {r1} - bx r1 - thumb_func_end sub_81299AC - - thumb_func_start SetUpPuttingAwayDecorationPlayerAvatar -SetUpPuttingAwayDecorationPlayerAvatar: @ 81299DC - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - bl player_get_direction_lower_nybble - ldr r3, =0x0203aa38 - ldr r2, =0x02020630 - ldr r4, =0x03005dd0 - ldr r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x2E] - strb r0, [r3] - bl sub_812A39C - ldr r0, =gUnknown_085A7404 - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - str r0, [r4, 0x4] - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _08129A3C - ldr r1, =DummyObjectCallback - str r0, [sp] - movs r0, 0xC1 - b _08129A44 - .pool -_08129A3C: - ldr r1, =DummyObjectCallback - movs r0, 0 - str r0, [sp] - movs r0, 0xC2 -_08129A44: - movs r2, 0x88 - movs r3, 0x48 - bl AddPseudoFieldObject - ldr r1, =0x0203aa39 - strb r0, [r1] - ldr r6, =0x02020630 - ldr r0, =0x0203aa39 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r2, [r1, 0x5] - movs r4, 0xD - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - movs r2, 0x4 - mov r8, r2 - mov r2, r8 - orrs r0, r2 - strb r0, [r1, 0x5] - ldr r5, =0x0203aa38 - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl RemoveObjectAndFreeTiles - ldr r0, =0x03005dd0 - ldr r0, [r0, 0x4] - strb r0, [r5] - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r1, [r0, 0x5] - ands r4, r1 - mov r1, r8 - orrs r4, r1 - strb r4, [r0, 0x5] - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end SetUpPuttingAwayDecorationPlayerAvatar - - thumb_func_start sub_8129ABC -sub_8129ABC: @ 8129ABC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _08129B0C - cmp r0, 0x1 - bgt _08129AE4 - cmp r0, 0 - beq _08129AEA - b _08129B2E - .pool -_08129AE4: - cmp r0, 0x2 - beq _08129B1A - b _08129B2E -_08129AEA: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08129B2E - adds r0, r5, 0 - bl sub_8127ACC - movs r0, 0x1 - strh r0, [r4, 0x4] - strh r0, [r4, 0xC] - strh r0, [r4, 0xA] - b _08129B2E - .pool -_08129B0C: - bl SetUpPuttingAwayDecorationPlayerAvatar - bl pal_fill_black - movs r0, 0x2 - strh r0, [r4, 0x4] - b _08129B2E -_08129B1A: - bl sub_80ABDFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08129B2E - strh r0, [r4, 0x18] - adds r0, r5, 0 - bl sub_8129B34 -_08129B2E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8129ABC - - thumb_func_start sub_8129B34 -sub_8129B34: @ 8129B34 - push {r4-r6,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - ldr r4, =0x02020630 - ldr r3, =0x0203aa38 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r6, 0 - strh r6, [r0, 0x3C] - ldrb r1, [r3] - 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] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_812A36C - str r1, [r0] - ldr r2, =0x0203aa39 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x88 - strh r1, [r0, 0x20] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x48 - strh r1, [r0, 0x22] - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - strh r6, [r0, 0x1C] - ldr r1, =sub_8128E18 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8129B34 - - thumb_func_start sub_8129BCC -sub_8129BCC: @ 8129BCC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x1C] - bl sub_8128DE0 - adds r0, r4, 0 - bl sub_8129C74 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8129BCC - - thumb_func_start sub_8129BF8 -sub_8129BF8: @ 8129BF8 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x1C] - bl sub_8128DE0 - ldr r3, =0x02020630 - ldr r5, =0x0203aa38 - ldrb r1, [r5] - 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, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, 0x1C - adds r0, r3 - ldr r1, =DummyObjectCallback - str r1, [r0] - ldr r5, =0x02021fc4 - ldr r1, =gUnknown_085EAA62 - adds r0, r5, 0 - bl ExpandStringRefs - ldr r2, =sub_812A1F0 - adds r0, r4, 0 - adds r1, r5, 0 - bl DisplayItemMessageOnField - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8129BF8 - - thumb_func_start sub_8129C74 -sub_8129C74: @ 8129C74 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - bl sub_812A0E8 - ldr r0, =0x0203aac4 - ldrb r0, [r0] - cmp r0, 0 - beq _08129CA8 - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EAAA3 - adds r0, r4, 0 - bl ExpandStringRefs - ldr r2, =sub_812A1A0 - b _08129D14 - .pool -_08129CA8: - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r1, r0 - movs r2, 0 - ldrsh r0, [r1, r2] - movs r2, 0x2 - ldrsh r1, [r1, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_8089288 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08129CDE - adds r0, r4, 0 - bl sub_8089404 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08129D3C -_08129CDE: - ldr r3, =0x02020630 - ldr r4, =0x0203aa38 - ldrb r1, [r4] - 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] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, 0x1C - adds r0, r3 - ldr r1, =DummyObjectCallback - str r1, [r0] - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EAA62 - adds r0, r4, 0 - bl ExpandStringRefs - ldr r2, =sub_812A1F0 -_08129D14: - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField - b _08129D50 - .pool -_08129D3C: - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EAA81 - adds r0, r4, 0 - bl ExpandStringRefs - ldr r2, =sub_8129D64 - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField -_08129D50: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8129C74 - - thumb_func_start sub_8129D64 -sub_8129D64: @ 8129D64 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08129D7E - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08129D84 -_08129D7E: - adds r0, r2, 0 - bl sub_8129B34 -_08129D84: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8129D64 - - thumb_func_start sub_8129D8C -sub_8129D8C: @ 8129D8C - push {lr} - adds r2, r1, 0 - lsls r0, 24 - ldr r1, =gUnknown_085A5C08 - lsrs r0, 19 - adds r0, r1 - ldrb r1, [r0, 0x12] - cmp r1, 0 - bne _08129DA8 - movs r0, 0x1 - strb r0, [r2, 0x1] - b _08129E06 - .pool -_08129DA8: - cmp r1, 0x1 - bne _08129DB4 - movs r0, 0x2 - strb r0, [r2, 0x1] - strb r1, [r2, 0x2] - b _08129E08 -_08129DB4: - cmp r1, 0x2 - bne _08129DC0 - movs r0, 0x3 - strb r0, [r2, 0x1] - movs r0, 0x1 - b _08129E06 -_08129DC0: - cmp r1, 0x3 - bne _08129DC8 - movs r0, 0x4 - b _08129E02 -_08129DC8: - cmp r1, 0x4 - bne _08129DD2 - movs r0, 0x2 - strb r0, [r2, 0x1] - b _08129E06 -_08129DD2: - cmp r1, 0x5 - bne _08129DDA - movs r0, 0x1 - b _08129E02 -_08129DDA: - cmp r1, 0x6 - bne _08129DE6 - movs r0, 0x1 - strb r0, [r2, 0x1] - movs r0, 0x3 - b _08129E06 -_08129DE6: - cmp r1, 0x7 - bne _08129DF2 - movs r0, 0x2 - strb r0, [r2, 0x1] - movs r0, 0x4 - b _08129E06 -_08129DF2: - cmp r1, 0x8 - bne _08129DFC - movs r0, 0x3 - strb r0, [r2, 0x1] - b _08129E06 -_08129DFC: - cmp r1, 0x9 - bne _08129E08 - movs r0, 0x3 -_08129E02: - strb r0, [r2, 0x1] - movs r0, 0x2 -_08129E06: - strb r0, [r2, 0x2] -_08129E08: - pop {r0} - bx r0 - thumb_func_end sub_8129D8C - - thumb_func_start sub_8129E0C -sub_8129E0C: @ 8129E0C - push {r4-r6,lr} - lsls r0, 24 - lsls r1, 24 - ldr r5, =0x02020630 - ldr r6, =0x0203aa38 - ldrb r3, [r6] - lsls r2, r3, 4 - adds r2, r3 - lsls r2, 2 - adds r2, r5 - adds r2, 0x3E - ldrb r3, [r2] - movs r4, 0x4 - orrs r3, r4 - strb r3, [r2] - ldrb r3, [r6] - lsls r2, r3, 4 - adds r2, r3 - lsls r2, 2 - adds r3, r5, 0 - adds r3, 0x1C - adds r2, r3 - ldr r3, =DummyObjectCallback - str r3, [r2] - ldr r4, =0x0203aa39 - ldrb r3, [r4] - lsls r2, r3, 4 - adds r2, r3 - lsls r2, 2 - adds r2, r5 - lsrs r0, 20 - adds r0, 0x88 - strh r0, [r2, 0x20] - ldrb r2, [r4] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r5 - lsrs r1, 20 - adds r1, 0x48 - strh r1, [r0, 0x22] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8129E0C - - thumb_func_start sub_8129E74 -sub_8129E74: @ 8129E74 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r9, r2 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =0x03005e00 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - adds r2, r3 - ldrb r0, [r2, 0x8] - subs r0, 0x7 - lsls r0, 24 - lsrs r7, r0, 24 - ldrb r0, [r2, 0xA] - subs r0, 0x7 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r2, =0x0203a17c - ldr r0, [r2, 0x4] - adds r0, r1 - ldrb r0, [r0] - lsrs r5, r0, 4 - movs r6, 0xF - ands r6, r0 - mov r0, r9 - ldrb r4, [r0, 0x2] - ldr r0, [r2] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x29 - bne _08129ED4 - adds r0, r5, 0x7 - adds r1, r6, 0x7 - bl MapGridGetMetatileIdAt - movs r1, 0xA3 - lsls r1, 2 - cmp r0, r1 - bne _08129ED4 - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_08129ED4: - cmp r7, r5 - bcc _08129F10 - mov r0, r9 - ldrb r2, [r0, 0x1] - adds r0, r5, r2 - cmp r7, r0 - bge _08129F10 - subs r0, r6, r4 - cmp r8, r0 - ble _08129F10 - cmp r8, r6 - bhi _08129F10 - subs r0, r7, r5 - adds r0, 0x1 - subs r0, r2, r0 - lsls r0, 24 - lsrs r0, 24 - mov r2, r8 - subs r1, r6, r2 - lsls r1, 24 - lsrs r1, 24 - bl sub_8129E0C - movs r0, 0x1 - b _08129F12 - .pool -_08129F10: - movs r0, 0 -_08129F12: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8129E74 - - thumb_func_start sub_8129F20 -sub_8129F20: @ 8129F20 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r2, =0x0203a17c - ldr r3, =0x0203aa44 - ldr r0, =0x0203aac4 - ldrb r0, [r0] - lsls r0, 3 - adds r0, r3 - ldrb r1, [r0] - ldr r0, [r2, 0x4] - adds r0, r1 - ldrb r0, [r0] - lsrs r1, r0, 4 - mov r8, r1 - movs r6, 0xF - ands r6, r0 - movs r4, 0 - ldr r7, =0x03005d8c - mov r9, r3 -_08129F4A: - ldr r1, [r7] - lsls r0, r4, 1 - adds r0, r4 - lsls r5, r0, 3 - adds r1, r5 - ldr r2, =0x00000c74 - adds r0, r1, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, r8 - bne _08129FB0 - ldr r2, =0x00000c76 - adds r0, r1, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, r6 - bne _08129FB0 - ldr r2, =0x00000c84 - adds r0, r1, r2 - ldrh r0, [r0] - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08129FB0 - ldr r0, =0x0203aac4 - ldrb r1, [r0] - lsls r1, 3 - add r1, r9 - ldr r0, [r7] - adds r0, r5 - ldr r2, =0x00000c84 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1, 0x4] - b _08129FBA - .pool -_08129FB0: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x3F - bls _08129F4A -_08129FBA: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8129F20 - - thumb_func_start sub_8129FC8 -sub_8129FC8: @ 8129FC8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - movs r6, 0 - b _0812A02A -_08129FD2: - ldr r0, [r0] - adds r1, r0, r6 - ldrb r0, [r1] - cmp r0, 0 - beq _0812A024 - ldr r0, =gUnknown_085A5C08 - ldrb r2, [r1] - lsls r1, r2, 5 - adds r1, r0 - ldrb r0, [r1, 0x11] - cmp r0, 0x4 - bne _0812A024 - ldr r5, =0x0203aa44 - adds r0, r2, 0 - adds r1, r5, 0 - bl sub_8129D8C - lsls r1, r6, 24 - lsrs r1, 24 - adds r0, r7, 0 - adds r2, r5, 0 - bl sub_8129E74 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bne _0812A024 - strb r6, [r5] - bl sub_8129F20 - ldr r0, =0x0203aac4 - strb r4, [r0] - movs r0, 0x1 - b _0812A034 - .pool -_0812A024: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 -_0812A02A: - ldr r0, =0x0203a17c - ldrb r1, [r0, 0x8] - cmp r6, r1 - bcc _08129FD2 - movs r0, 0 -_0812A034: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8129FC8 - - thumb_func_start sub_812A040 -sub_812A040: @ 812A040 - 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 r3, 24 - mov r8, r3 - movs r4, 0 - ldr r7, =0x0203a17c - ldrb r0, [r7, 0x8] - cmp r4, r0 - bcs _0812A0C6 - adds r6, r7, 0 - ldr r5, =0x0203aac4 -_0812A072: - ldr r0, [r6] - adds r0, r4 - ldrb r1, [r0] - ldr r0, [r6, 0x4] - adds r0, r4 - ldrb r0, [r0] - lsrs r3, r0, 4 - movs r2, 0xF - ands r2, r0 - cmp r1, 0 - beq _0812A0BA - ldr r0, =gUnknown_085A5C08 - lsls r1, 5 - adds r1, r0 - ldrb r0, [r1, 0x11] - cmp r0, 0x4 - bne _0812A0BA - ldr r0, [sp] - cmp r0, r3 - bhi _0812A0BA - cmp r10, r2 - bhi _0812A0BA - cmp r9, r3 - bcc _0812A0BA - cmp r8, r2 - bcc _0812A0BA - ldr r0, =0x0203aa44 - ldrb r1, [r5] - lsls r1, 3 - adds r1, r0 - strb r4, [r1] - bl sub_8129F20 - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] -_0812A0BA: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldrb r0, [r7, 0x8] - cmp r4, r0 - bcc _0812A072 -_0812A0C6: - 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_812A040 - - thumb_func_start sub_812A0E8 -sub_812A0E8: @ 812A0E8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r4, =0x0203aac4 - movs r0, 0 - strb r0, [r4] - adds r0, r6, 0 - bl sub_8129FC8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0812A18C - movs r5, 0 - ldr r0, =0x0203a17c - ldrb r1, [r0, 0x8] - cmp r5, r1 - bcs _0812A15A - adds r7, r4, 0 -_0812A10E: - ldr r0, [r0] - adds r0, r5 - ldrb r1, [r0] - cmp r1, 0 - beq _0812A14C - ldr r4, =0x0203aa44 - adds r0, r1, 0 - adds r1, r4, 0 - bl sub_8129D8C - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_8129E74 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0812A14C - strb r5, [r4] - ldrb r0, [r7] - adds r0, 0x1 - strb r0, [r7] - b _0812A15A - .pool -_0812A14C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x0203a17c - ldrb r1, [r0, 0x8] - cmp r5, r1 - bcc _0812A10E -_0812A15A: - ldr r0, =0x0203aac4 - ldrb r0, [r0] - cmp r0, 0 - beq _0812A18C - ldr r0, =0x0203a17c - ldr r2, =0x0203aa44 - ldrb r1, [r2] - ldr r0, [r0, 0x4] - adds r0, r1 - ldrb r1, [r0] - lsrs r0, r1, 4 - movs r3, 0xF - ands r3, r1 - ldrb r1, [r2, 0x2] - subs r1, r3, r1 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - ldrb r2, [r2, 0x1] - adds r2, r0 - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - bl sub_812A040 -_0812A18C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A0E8 - - thumb_func_start sub_812A1A0 -sub_812A1A0: @ 812A1A0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8197930 - ldr r1, =gUnknown_085A7348 - adds r0, r4, 0 - bl sub_8121F68 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A1A0 - - thumb_func_start sub_812A1C0 -sub_812A1C0: @ 812A1C0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0xC] - ldr r1, =sub_81298EC - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A1C0 - - thumb_func_start sub_812A1F0 -sub_812A1F0: @ 812A1F0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8197930 - ldr r1, =gUnknown_085A7350 - adds r0, r4, 0 - bl sub_8121F68 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A1F0 - - thumb_func_start sub_812A210 -sub_812A210: @ 812A210 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - movs r1, 0 - bl sub_8197434 - adds r0, r4, 0 - bl sub_812A22C - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812A210 - - thumb_func_start sub_812A22C -sub_812A22C: @ 812A22C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0xC] - ldr r1, =sub_812A25C - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A22C - - thumb_func_start sub_812A25C -sub_812A25C: @ 812A25C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r5, r0, r1 - movs r1, 0xC - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _0812A280 - cmp r0, 0x1 - beq _0812A29C - b _0812A2B2 - .pool -_0812A280: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0812A2B2 - adds r0, r4, 0 - bl sub_8127B04 - movs r0, 0x1 - strh r0, [r5, 0xC] - b _0812A2B2 - .pool -_0812A29C: - bl sub_812A3C8 - ldr r0, =0x03005dac - ldr r1, =sub_812A334 - str r1, [r0] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - adds r0, r4, 0 - bl DestroyTask -_0812A2B2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A25C - - thumb_func_start sub_812A2C4 -sub_812A2C4: @ 812A2C4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r5, r1, 3 - ldr r6, =0x03005e08 - adds r4, r5, r6 - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0812A2FC - cmp r0, 0x1 - bgt _0812A2EC - cmp r0, 0 - beq _0812A2F6 - b _0812A32A - .pool -_0812A2EC: - cmp r0, 0x2 - beq _0812A308 - cmp r0, 0x3 - beq _0812A314 - b _0812A32A -_0812A2F6: - bl sub_80E9578 - b _0812A30C -_0812A2FC: - ldr r0, =gUnknown_08275D0C - bl script_env_1_execute_new_script - b _0812A30C - .pool -_0812A308: - bl script_env_2_enable -_0812A30C: - ldrh r0, [r4, 0x4] - adds r0, 0x1 - strh r0, [r4, 0x4] - b _0812A32A -_0812A314: - bl sub_80ABDFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0812A32A - adds r0, r6, 0 - subs r0, 0x8 - adds r0, r5, r0 - ldr r1, =sub_8126B80 - str r1, [r0] -_0812A32A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A2C4 - - thumb_func_start sub_812A334 -sub_812A334: @ 812A334 - push {lr} - bl pal_fill_black - movs r0, 0 - movs r1, 0x1 - bl sub_81973C4 - bl sub_8126ABC - ldr r0, =sub_812A2C4 - movs r1, 0x8 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0 - strh r0, [r1, 0xC] - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A334 - - thumb_func_start sub_812A36C -sub_812A36C: @ 812A36C - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - movs r1, 0x1F - ands r0, r1 - strh r0, [r2, 0x2E] - cmp r0, 0xF - ble _0812A38C - adds r0, r2, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - b _0812A398 -_0812A38C: - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_0812A398: - pop {r0} - bx r0 - thumb_func_end sub_812A36C - - thumb_func_start sub_812A39C -sub_812A39C: @ 812A39C - push {lr} - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _0812A3B8 - ldr r0, =gUnknown_085A73D8 - bl LoadTaggedObjectPalette - b _0812A3BE - .pool -_0812A3B8: - ldr r0, =gUnknown_085A73E0 - bl LoadTaggedObjectPalette -_0812A3BE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A39C - - thumb_func_start sub_812A3C8 -sub_812A3C8: @ 812A3C8 - push {lr} - movs r0, 0x8 - bl FreeObjectPaletteByTag - pop {r0} - bx r0 - thumb_func_end sub_812A3C8 - - thumb_func_start sub_812A3D4 -sub_812A3D4: @ 812A3D4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_81279C4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0812A430 - ldr r0, =0x02021cc4 - ldr r1, =0x0203a172 - ldrb r2, [r1] - ldr r1, =0x0203a14c - ldr r1, [r1] - adds r1, r2 - ldrb r1, [r1] - lsls r1, 5 - ldr r2, =gUnknown_085A5C09 - adds r1, r2 - bl CopyString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EAA14 - adds r0, r4, 0 - bl ExpandStringRefs - ldr r2, =sub_812A458 - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField - b _0812A444 - .pool -_0812A430: - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EA9E0 - adds r0, r4, 0 - bl ExpandStringRefs - ldr r2, =sub_8127A5C - adds r0, r5, 0 - adds r1, r4, 0 - bl DisplayItemMessageOnField -_0812A444: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A3D4 - - thumb_func_start sub_812A458 -sub_812A458: @ 812A458 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8197930 - ldr r1, =gUnknown_085A741C - adds r0, r4, 0 - bl sub_8121F68 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A458 - - thumb_func_start sub_812A478 -sub_812A478: @ 812A478 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x0203a172 - ldrb r1, [r0] - ldr r0, =0x0203a14c - ldr r0, [r0] - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r5, =0x0203a173 - ldrb r0, [r5] - bl sub_8161AD0 - ldr r1, =0x0203a151 - strb r0, [r1] - ldrb r0, [r5] - bl sub_8161A38 - adds r0, r4, 0 - bl sub_8127814 - ldr r5, =0x02021fc4 - ldr r1, =gUnknown_085EAA3D - adds r0, r5, 0 - bl ExpandStringRefs - ldr r2, =sub_8127A5C - adds r0, r4, 0 - adds r1, r5, 0 - bl DisplayItemMessageOnField - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A478 - - thumb_func_start sub_812A4DC -sub_812A4DC: @ 812A4DC - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0 - beq _0812A500 - cmp r1, 0x1 - beq _0812A518 - b _0812A530 - .pool -_0812A500: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0812A530 -_0812A518: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0812A530 - ldr r0, =sub_812A588 - bl SetMainCallback2 - adds r0, r5, 0 - bl DestroyTask -_0812A530: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A4DC - - thumb_func_start sub_812A540 -sub_812A540: @ 812A540 - push {r4-r6,lr} - adds r4, r0, 0 - adds r6, r1, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =0x0203ab34 - movs r0, 0x68 - bl AllocZeroed - str r0, [r5] - adds r0, r4, 0 - adds r1, r6, 0 - bl sub_812A6D4 - ldr r0, =sub_812A4DC - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0 - strh r0, [r1, 0x8] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A540 - - thumb_func_start sub_812A588 -sub_812A588: @ 812A588 - push {lr} - sub sp, 0x4 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0xB - bhi _0812A666 - lsls r0, 2 - ldr r1, =_0812A5AC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0812A5AC: - .4byte _0812A5DC - .4byte _0812A5E6 - .4byte _0812A5EC - .4byte _0812A5F6 - .4byte _0812A5FC - .4byte _0812A602 - .4byte _0812A608 - .4byte _0812A60E - .4byte _0812A638 - .4byte _0812A63E - .4byte _0812A644 - .4byte _0812A660 -_0812A5DC: - bl sub_812A750 - bl sub_812A8C4 - b _0812A64C -_0812A5E6: - bl sub_812A7BC - b _0812A64C -_0812A5EC: - bl sub_812A810 - bl sub_812A834 - b _0812A64C -_0812A5F6: - bl sub_812A9AC - b _0812A64C -_0812A5FC: - bl sub_812A9CC - b _0812A64C -_0812A602: - bl sub_812AA48 - b _0812A64C -_0812A608: - bl sub_812A79C - b _0812A64C -_0812A60E: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - b _0812A64C -_0812A638: - bl sub_812FBC4 - b _0812A64C -_0812A63E: - bl sub_812FB14 - b _0812A64C -_0812A644: - bl sub_812AA78 - bl sub_812AA90 -_0812A64C: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0812A666 - .pool -_0812A660: - ldr r0, =sub_812A670 - bl SetMainCallback2 -_0812A666: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A588 - - thumb_func_start sub_812A670 -sub_812A670: @ 812A670 - push {lr} - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_812A670 - - thumb_func_start sub_812A688 -sub_812A688: @ 812A688 - push {r4,lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - ldr r4, =0x0203ab34 - ldr r0, [r4] - adds r0, 0x58 - ldrh r1, [r0] - movs r0, 0x40 - bl SetGpuReg - ldr r0, [r4] - adds r0, 0x5A - ldrh r1, [r0] - movs r0, 0x44 - bl SetGpuReg - ldr r0, [r4] - adds r0, 0x5C - ldrh r1, [r0] - movs r0, 0x48 - bl SetGpuReg - ldr r0, [r4] - adds r0, 0x5E - ldrh r1, [r0] - movs r0, 0x4A - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A688 - - thumb_func_start sub_812A6D4 -sub_812A6D4: @ 812A6D4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =TaskDummy9 - movs r1, 0xFF - bl CreateTask - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r0, r1 - strh r4, [r0, 0x8] - adds r0, 0xA - adds r1, r5, 0 - bl sub_806F67C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A6D4 - - thumb_func_start sub_812A710 -sub_812A710: @ 812A710 - push {lr} - ldr r0, =TaskDummy9 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - ldr r0, =0x03005e00 - adds r2, r0 - ldr r3, =0x0203ab34 - ldr r1, [r3] - ldrh r0, [r2, 0x8] - strb r0, [r1, 0x1] - adds r2, 0xA - ldr r1, [r3] - adds r1, 0x64 - adds r0, r2, 0 - bl sub_806F684 - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A710 - - thumb_func_start TaskDummy9 -TaskDummy9: @ 812A74C - bx lr - thumb_func_end TaskDummy9 - - thumb_func_start sub_812A750 -sub_812A750: @ 812A750 - push {lr} - sub sp, 0x4 - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - str r0, [sp] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - mov r0, sp - bl CpuSet - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085A7424 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r0, =gUnknown_085A7434 - bl InitWindows - bl DeactivateAllTextPrinters - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A750 - - thumb_func_start sub_812A79C -sub_812A79C: @ 812A79C - push {lr} - ldr r0, =sub_812A688 - bl SetVBlankCallback - movs r0, 0x1 - bl EnableInterrupts - movs r1, 0xC1 - lsls r1, 6 - movs r0, 0 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A79C - - thumb_func_start sub_812A7BC -sub_812A7BC: @ 812A7BC - push {r4-r7,lr} - sub sp, 0x4 - movs r2, 0xC0 - lsls r2, 19 - movs r3, 0x80 - lsls r3, 9 - mov r4, sp - movs r6, 0 - ldr r1, =0x040000d4 - movs r5, 0x80 - lsls r5, 5 - ldr r7, =0x81000800 - movs r0, 0x81 - lsls r0, 24 - mov r12, r0 -_0812A7DA: - strh r6, [r4] - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - str r7, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r2, r5 - subs r3, r5 - cmp r3, r5 - bhi _0812A7DA - strh r6, [r4] - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - lsrs r0, r3, 1 - mov r2, r12 - orrs r0, r2 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A7BC - - thumb_func_start sub_812A810 -sub_812A810: @ 812A810 - sub sp, 0x4 - movs r2, 0xE0 - lsls r2, 19 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x81000200 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - add sp, 0x4 - bx lr - .pool - thumb_func_end sub_812A810 - - thumb_func_start sub_812A834 -sub_812A834: @ 812A834 - push {lr} - movs r0, 0x8 - movs r1, 0 - bl SetGpuReg - movs r0, 0xA - movs r1, 0 - bl SetGpuReg - movs r0, 0xC - movs r1, 0 - bl SetGpuReg - movs r0, 0xE - movs r1, 0 - bl SetGpuReg - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0x1C - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x3F - bl SetGpuReg - ldr r1, =0x00001048 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x00000809 - movs r0, 0x52 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A834 - - thumb_func_start sub_812A8C4 -sub_812A8C4: @ 812A8C4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - bl sub_812A710 - ldr r5, =0x0203ab34 - ldr r0, [r5] - movs r4, 0 - strb r4, [r0] - ldr r0, [r5] - strb r4, [r0, 0x2] - bl GenerateRandomNumber - ldr r2, [r5] - movs r1, 0x1 - ands r1, r0 - strb r1, [r2, 0x3] - ldr r0, [r5] - strb r4, [r0, 0x4] - ldr r0, [r5] - movs r1, 0 - strh r4, [r0, 0x8] - strb r1, [r0, 0xA] - ldr r0, [r5] - strb r1, [r0, 0xB] - bl GetCoins - ldr r2, [r5] - strh r0, [r2, 0xC] - strh r4, [r2, 0xE] - strh r4, [r2, 0x10] - strh r4, [r2, 0x12] - strh r4, [r2, 0x18] - movs r0, 0x8 - strh r0, [r2, 0x1A] - adds r1, r2, 0 - adds r1, 0x58 - movs r0, 0xF0 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0xA0 - strh r0, [r1] - adds r0, r2, 0 - adds r0, 0x5C - movs r1, 0x3F - strh r1, [r0] - adds r0, 0x2 - strh r1, [r0] - bl current_map_music_get - ldr r1, [r5] - adds r1, 0x60 - strh r0, [r1] - movs r7, 0 - ldr r0, =gUnknown_085A76B4 - mov r8, r0 -_0812A934: - ldr r0, =0x0203ab34 - ldr r4, [r0] - lsls r6, r7, 1 - adds r0, r4, 0 - adds r0, 0x22 - adds r0, r6 - movs r1, 0 - strh r1, [r0] - adds r5, r4, 0 - adds r5, 0x28 - adds r5, r6 - ldrb r0, [r4, 0x3] - lsls r0, 1 - lsls r1, r7, 2 - adds r0, r1 - add r0, r8 - movs r1, 0 - ldrsh r0, [r0, r1] - movs r1, 0x15 - bl __modsi3 - strh r0, [r5] - adds r4, 0x1C - adds r4, r6 - movs r2, 0 - ldrsh r0, [r5, r2] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 3 - movs r2, 0xFC - lsls r2, 1 - adds r0, r2, 0 - subs r0, r1 - strh r0, [r4] - movs r1, 0 - ldrsh r0, [r4, r1] - adds r1, r2, 0 - bl __modsi3 - strh r0, [r4] - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x2 - bls _0812A934 - bl GetCoins - lsls r0, 16 - lsrs r0, 16 - bl sub_80EDE70 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A8C4 - - thumb_func_start sub_812A9AC -sub_812A9AC: @ 812A9AC - push {lr} - bl sub_80A1A74 - bl ResetAllObjectData - ldr r1, =0x02021b38 - movs r0, 0x80 - strb r0, [r1] - bl ResetObjectPaletteAllocator - bl ResetTasks - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A9AC - - thumb_func_start sub_812A9CC -sub_812A9CC: @ 812A9CC - push {r4,r5,lr} - ldr r4, =0x0203aacc - movs r0, 0x8 - bl Alloc - str r0, [r4] - ldr r4, =0x0203aad0 - movs r0, 0xE - bl AllocZeroed - str r0, [r4] - ldr r5, =0x0203aadc - movs r0, 0x8 - bl AllocZeroed - str r0, [r5] - ldr r1, [r4] - ldr r2, =0x00002051 - adds r0, r2, 0 - strh r0, [r1] - ldr r1, [r4] - ldr r2, =0x00002851 - adds r0, r2, 0 - strh r0, [r1, 0x2] - ldr r2, =0x00002061 - adds r0, r2, 0 - strh r0, [r1, 0x4] - ldr r2, =0x00002861 - adds r0, r2, 0 - strh r0, [r1, 0x6] - ldr r2, =0x000020be - adds r0, r2, 0 - strh r0, [r1, 0x8] - ldr r2, =0x000028be - adds r0, r2, 0 - strh r0, [r1, 0xA] - ldr r2, =0x000020bf - adds r0, r2, 0 - strh r0, [r1, 0xC] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812A9CC - - thumb_func_start sub_812AA48 -sub_812AA48: @ 812AA48 - push {lr} - bl sub_812F908 - bl sub_812F958 - bl sub_812F7E4 - 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 - movs r0, 0 - bl PutWindowTilemap - pop {r0} - bx r0 - thumb_func_end sub_812AA48 - - thumb_func_start sub_812AA78 -sub_812AA78: @ 812AA78 - push {lr} - bl sub_812E0E4 - bl sub_812E1C8 - bl sub_812CEF4 - bl sub_812E300 - pop {r0} - bx r0 - thumb_func_end sub_812AA78 - - thumb_func_start sub_812AA90 -sub_812AA90: @ 812AA90 - push {lr} - bl sub_812D188 - bl sub_812BE5C - bl sub_812DE94 - bl sub_812AAA8 - pop {r0} - bx r0 - thumb_func_end sub_812AA90 - - thumb_func_start sub_812AAA8 -sub_812AAA8: @ 812AAA8 - push {r4,lr} - ldr r4, =sub_812AAC8 - adds r0, r4, 0 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812AAA8 - - thumb_func_start sub_812AAC8 -sub_812AAC8: @ 812AAC8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r6, =gUnknown_085A7450 - lsls r1, r0, 2 - adds r1, r0 - lsls r4, r1, 3 - ldr r5, =0x03005e00 -_0812AAD8: - ldr r0, =0x0203ab34 - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r6 - ldr r1, [r0] - adds r0, r4, r5 - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - bne _0812AAD8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812AAC8 - - thumb_func_start sub_812AB04 -sub_812AB04: @ 812AB04 - push {r4,lr} - sub sp, 0x4 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r4, =0x0203ab34 - ldr r0, [r4] - ldrb r0, [r0, 0x2] - bl sub_812D3B4 - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812AB04 - - thumb_func_start sub_812AB38 -sub_812AB38: @ 812AB38 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0812AB50 - ldr r0, =0x0203ab34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0812AB50: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_812AB38 - - thumb_func_start sub_812AB60 -sub_812AB60: @ 812AB60 - push {lr} - ldr r3, =0x0203ab34 - ldr r1, [r3] - movs r0, 0 - strh r0, [r1, 0xE] - strh r0, [r1, 0x12] - strh r0, [r1, 0x18] - ldrb r2, [r1, 0x4] - movs r0, 0xC0 - ands r0, r2 - strb r0, [r1, 0x4] - ldr r1, [r3] - movs r0, 0x4 - strb r0, [r1] - ldr r3, [r3] - movs r1, 0xC - ldrsh r0, [r3, r1] - cmp r0, 0 - bgt _0812AB90 - movs r0, 0x19 - strb r0, [r3] - b _0812ABA0 - .pool -_0812AB90: - ldrb r0, [r3, 0xA] - cmp r0, 0 - beq _0812ABA0 - movs r0, 0x3 - strb r0, [r3] - movs r0, 0x4 - bl sub_812DEE4 -_0812ABA0: - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_812AB60 - - thumb_func_start sub_812ABA8 -sub_812ABA8: @ 812ABA8 - push {lr} - bl sub_812E054 - lsls r0, 24 - cmp r0, 0 - beq _0812ABBC - ldr r0, =0x0203ab34 - ldr r1, [r0] - movs r0, 0x4 - strb r0, [r1] -_0812ABBC: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_812ABA8 - - thumb_func_start sub_812ABC8 -sub_812ABC8: @ 812ABC8 - push {lr} - movs r0, 0 - bl sub_812DEE4 - ldr r2, =0x0203ab34 - ldr r1, [r2] - movs r0, 0x5 - strb r0, [r1] - ldr r2, [r2] - movs r0, 0xC - ldrsh r1, [r2, r0] - ldr r0, =0x0000270e - cmp r1, r0 - ble _0812ABE8 - movs r0, 0x17 - strb r0, [r2] -_0812ABE8: - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_812ABC8 - - thumb_func_start sub_812ABF8 -sub_812ABF8: @ 812ABF8 - push {r4,r5,lr} - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0812AC1C - movs r0, 0 - bl sub_812DC80 - ldr r0, =0x0203ab34 - ldr r1, [r0] - movs r0, 0x8 - b _0812ACE2 - .pool -_0812AC1C: - movs r0, 0x80 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - beq _0812AC82 - ldr r0, =0x0203ab34 - ldr r2, [r0] - movs r1, 0xC - ldrsh r0, [r2, r1] - subs r0, 0x3 - movs r3, 0x12 - ldrsh r1, [r2, r3] - adds r0, r1 - cmp r0, 0 - blt _0812AC7C - ldrh r4, [r2, 0x12] - adds r0, r1, 0 - cmp r0, 0x2 - bgt _0812AC5A -_0812AC42: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_812CE7C - lsls r0, r4, 16 - movs r2, 0x80 - lsls r2, 9 - adds r0, r2 - lsrs r4, r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _0812AC42 -_0812AC5A: - ldr r0, =0x0203ab34 - ldr r1, [r0] - ldrh r0, [r1, 0xC] - subs r0, 0x3 - ldrh r3, [r1, 0x12] - adds r0, r3 - strh r0, [r1, 0xC] - movs r0, 0x3 - strh r0, [r1, 0x12] - movs r0, 0x9 - strb r0, [r1] - movs r0, 0x5F - bl audio_play - b _0812ACE4 - .pool -_0812AC7C: - movs r0, 0x6 - strb r0, [r2] - b _0812ACE4 -_0812AC82: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0812ACB2 - ldr r4, =0x0203ab34 - ldr r0, [r4] - movs r1, 0xC - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _0812ACB2 - movs r0, 0x5F - bl audio_play - ldr r0, [r4] - ldrb r0, [r0, 0x12] - bl sub_812CE7C - ldr r1, [r4] - ldrh r0, [r1, 0xC] - subs r0, 0x1 - strh r0, [r1, 0xC] - ldrh r0, [r1, 0x12] - adds r0, 0x1 - strh r0, [r1, 0x12] -_0812ACB2: - ldr r0, =0x0203ab34 - ldr r3, [r0] - movs r1, 0x12 - ldrsh r2, [r3, r1] - ldr r4, =0x030022c0 - adds r5, r0, 0 - cmp r2, 0x2 - bgt _0812ACD0 - cmp r2, 0 - beq _0812ACD4 - ldrh r1, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0812ACD4 -_0812ACD0: - movs r0, 0x9 - strb r0, [r3] -_0812ACD4: - ldrh r1, [r4, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0812ACE4 - ldr r1, [r5] - movs r0, 0x15 -_0812ACE2: - strb r0, [r1] -_0812ACE4: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812ABF8 - - thumb_func_start sub_812ACF4 -sub_812ACF4: @ 812ACF4 - push {lr} - sub sp, 0xC - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - ldr r2, =gUnknown_085EF734 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =0x0203ab34 - ldr r1, [r0] - movs r0, 0x7 - strb r0, [r1] - movs r0, 0 - add sp, 0xC - pop {r1} - bx r1 - .pool - thumb_func_end sub_812ACF4 - - thumb_func_start sub_812AD34 -sub_812AD34: @ 812AD34 - push {lr} - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _0812AD52 - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - ldr r0, =0x0203ab34 - ldr r1, [r0] - movs r0, 0x5 - strb r0, [r1] -_0812AD52: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_812AD34 - - thumb_func_start sub_812AD60 -sub_812AD60: @ 812AD60 - push {lr} - bl sub_812DCB4 - lsls r0, 24 - cmp r0, 0 - beq _0812AD74 - ldr r0, =0x0203ab34 - ldr r1, [r0] - movs r0, 0x5 - strb r0, [r1] -_0812AD74: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_812AD60 - - thumb_func_start sub_812AD80 -sub_812AD80: @ 812AD80 - push {r4,lr} - adds r4, r0, 0 - bl sub_812B4EC - bl sub_812DFDC - movs r0, 0 - bl sub_812BEA4 - movs r0, 0x1 - bl sub_812BEA4 - movs r0, 0x2 - bl sub_812BEA4 - bl sub_80EEC80 - movs r0, 0 - strh r0, [r4, 0x8] - ldr r4, =0x0203ab34 - ldr r0, [r4] - ldrb r1, [r0, 0x4] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0812ADC4 - bl sub_812D4AC - ldr r1, [r4] - movs r0, 0xA - b _0812ADCE - .pool -_0812ADC4: - movs r0, 0x1 - bl sub_812DEE4 - ldr r1, [r4] - movs r0, 0xB -_0812ADCE: - strb r0, [r1] - ldr r4, =0x0203ab34 - ldr r0, [r4] - movs r1, 0x8 - strh r1, [r0, 0x1A] - ldrb r0, [r0, 0xA] - cmp r0, 0 - beq _0812ADE6 - bl dp15_jump_random_unknown - ldr r1, [r4] - strh r0, [r1, 0x1A] -_0812ADE6: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812AD80 - - thumb_func_start sub_812ADF4 -sub_812ADF4: @ 812ADF4 - push {lr} - bl sub_812D4CC - lsls r0, 24 - cmp r0, 0 - beq _0812AE18 - movs r0, 0x1 - bl sub_812DEE4 - ldr r3, =0x0203ab34 - ldr r2, [r3] - ldrb r1, [r2, 0x4] - movs r0, 0xDF - ands r0, r1 - strb r0, [r2, 0x4] - ldr r1, [r3] - movs r0, 0xB - strb r0, [r1] -_0812AE18: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_812ADF4 - - thumb_func_start sub_812AE24 -sub_812AE24: @ 812AE24 - push {lr} - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x1D - ble _0812AE40 - bl sub_812B55C - ldr r0, =0x0203ab34 - ldr r1, [r0] - movs r0, 0xC - strb r0, [r1] -_0812AE40: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_812AE24 - - thumb_func_start sub_812AE4C -sub_812AE4C: @ 812AE4C - push {r4,lr} - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0812AE78 - movs r0, 0x18 - bl audio_play - ldr r4, =0x0203ab34 - ldr r0, [r4] - ldrb r0, [r0, 0x18] - bl sub_812BEDC - ldr r0, [r4] - ldrb r0, [r0, 0x18] - bl sub_812CD40 - ldr r1, [r4] - movs r0, 0xD - strb r0, [r1] -_0812AE78: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812AE4C - - thumb_func_start sub_812AE88 -sub_812AE88: @ 812AE88 - push {r4,lr} - ldr r4, =0x0203ab34 - ldr r0, [r4] - ldrb r0, [r0, 0x18] - bl sub_812BF04 - lsls r0, 24 - cmp r0, 0 - bne _0812AEBC - ldr r1, [r4] - ldrh r0, [r1, 0x18] - adds r0, 0x1 - strh r0, [r1, 0x18] - movs r0, 0xC - strb r0, [r1] - ldr r1, [r4] - movs r2, 0x18 - ldrsh r0, [r1, r2] - cmp r0, 0x2 - ble _0812AEB4 - movs r0, 0xE - strb r0, [r1] -_0812AEB4: - movs r0, 0x1 - b _0812AEBE - .pool -_0812AEBC: - movs r0, 0 -_0812AEBE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_812AE88 - - thumb_func_start sub_812AEC4 -sub_812AEC4: @ 812AEC4 - push {r4,lr} - ldr r4, =0x0203ab34 - ldr r2, [r4] - ldrb r1, [r2, 0x4] - movs r0, 0xC0 - ands r0, r1 - strb r0, [r2, 0x4] - bl sub_812B828 - ldr r1, [r4] - ldrb r0, [r1, 0xA] - cmp r0, 0 - beq _0812AEEA - subs r0, 0x1 - strb r0, [r1, 0xA] - ldr r1, [r4] - ldrb r0, [r1, 0xB] - adds r0, 0x1 - strb r0, [r1, 0xB] -_0812AEEA: - ldr r1, [r4] - ldrh r0, [r1, 0x8] - cmp r0, 0 - beq _0812AFCC - movs r0, 0xF - strb r0, [r1] - bl sub_812BABC - bl sub_812D0B0 - ldr r2, [r4] - ldrh r0, [r2, 0x10] - ldrh r1, [r2, 0xE] - subs r0, r1 - strh r0, [r2, 0x10] - lsls r0, 16 - cmp r0, 0 - bge _0812AF12 - movs r0, 0 - strh r0, [r2, 0x10] -_0812AF12: - ldr r0, [r4] - ldrh r1, [r0, 0x8] - movs r0, 0xC0 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - beq _0812AF38 - ldr r0, =0x00000185 - bl fanfare_play - movs r0, 0x6 - bl sub_812DEE4 - b _0812AF62 - .pool -_0812AF38: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0812AF54 - ldr r0, =0x00000185 - bl fanfare_play - movs r0, 0x5 - bl sub_812DEE4 - b _0812AF62 - .pool -_0812AF54: - movs r0, 0xC3 - lsls r0, 1 - bl fanfare_play - movs r0, 0x2 - bl sub_812DEE4 -_0812AF62: - ldr r2, =0x0203ab34 - ldr r3, [r2] - ldrh r1, [r3, 0x8] - movs r0, 0xE0 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - beq _0812AFA6 - ldrb r1, [r3, 0x4] - movs r0, 0x3F - ands r0, r1 - movs r4, 0 - strb r0, [r3, 0x4] - ldr r3, [r2] - ldrh r1, [r3, 0x8] - movs r0, 0xC0 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - beq _0812AFA6 - strb r4, [r3, 0xA] - ldr r0, [r2] - strb r4, [r0, 0xB] - ldr r0, [r2] - strb r4, [r0, 0x3] - ldr r3, [r2] - ldrh r1, [r3, 0x8] - movs r0, 0x80 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - beq _0812AFA6 - movs r0, 0x1 - strb r0, [r3, 0x3] -_0812AFA6: - ldr r3, [r2] - ldrh r1, [r3, 0x8] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0812AFEE - ldrb r0, [r3, 0x2] - cmp r0, 0xF - bhi _0812AFEE - adds r0, 0x1 - strb r0, [r3, 0x2] - ldr r0, [r2] - ldrb r0, [r0, 0x2] - bl sub_812D1A8 - b _0812AFEE - .pool -_0812AFCC: - movs r0, 0x3 - bl sub_812DEE4 - ldr r1, [r4] - movs r0, 0x14 - strb r0, [r1] - ldr r1, [r4] - ldrh r0, [r1, 0x12] - ldrh r2, [r1, 0x10] - adds r0, r2 - strh r0, [r1, 0x10] - lsls r0, 16 - asrs r0, 16 - ldr r2, =0x0000270f - cmp r0, r2 - ble _0812AFEE - strh r2, [r1, 0x10] -_0812AFEE: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812AEC4 - - thumb_func_start sub_812AFFC -sub_812AFFC: @ 812AFFC - push {lr} - bl sub_812BADC - lsls r0, 24 - cmp r0, 0 - beq _0812B010 - ldr r0, =0x0203ab34 - ldr r1, [r0] - movs r0, 0x10 - strb r0, [r1] -_0812B010: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_812AFFC - - thumb_func_start sub_812B01C -sub_812B01C: @ 812B01C - push {r4,lr} - bl sub_812D0E0 - lsls r0, 24 - cmp r0, 0 - beq _0812B088 - ldr r4, =0x0203ab34 - ldr r1, [r4] - movs r0, 0x13 - strb r0, [r1] - ldr r0, [r4] - ldrh r1, [r0, 0x8] - movs r0, 0xC0 - lsls r0, 1 - ands r0, r1 - cmp r0, 0 - beq _0812B044 - movs r0, 0x1C - bl sav12_xor_increment -_0812B044: - ldr r2, [r4] - ldrh r1, [r2, 0x8] - movs r3, 0x4 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _0812B05A - movs r0, 0 - strh r0, [r2, 0x18] - movs r0, 0x9 - strb r0, [r2] -_0812B05A: - ldr r2, [r4] - ldrh r1, [r2, 0x8] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0812B06A - movs r0, 0x11 - strb r0, [r2] -_0812B06A: - ldr r1, [r4] - ldrb r0, [r1, 0xA] - cmp r0, 0 - beq _0812B088 - ldrh r1, [r1, 0x8] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _0812B088 - movs r0, 0x4 - bl sub_812DEE4 - ldr r1, [r4] - movs r0, 0x12 - strb r0, [r1] -_0812B088: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812B01C - - thumb_func_start sub_812B094 -sub_812B094: @ 812B094 - push {r4,lr} - bl sub_812D20C - lsls r0, 24 - cmp r0, 0 - bne _0812B0CC - ldr r4, =0x0203ab34 - ldr r1, [r4] - movs r0, 0x13 - strb r0, [r1] - ldr r2, [r4] - ldrh r1, [r2, 0x8] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0812B0CC - movs r0, 0x9 - strb r0, [r2] - ldr r0, [r4] - ldrb r0, [r0, 0xA] - cmp r0, 0 - beq _0812B0CC - movs r0, 0x4 - bl sub_812DEE4 - ldr r1, [r4] - movs r0, 0x12 - strb r0, [r1] -_0812B0CC: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812B094 - - thumb_func_start sub_812B0D8 -sub_812B0D8: @ 812B0D8 - push {lr} - bl sub_812E054 - lsls r0, 24 - cmp r0, 0 - beq _0812B0FC - ldr r2, =0x0203ab34 - ldr r1, [r2] - movs r0, 0x13 - strb r0, [r1] - ldr r2, [r2] - ldrh r1, [r2, 0x8] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0812B0FC - movs r0, 0x9 - strb r0, [r2] -_0812B0FC: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_812B0D8 - - thumb_func_start sub_812B108 -sub_812B108: @ 812B108 - push {lr} - movs r0, 0 - bl sub_812CEB8 - movs r0, 0x1 - bl sub_812CEB8 - movs r0, 0x2 - bl sub_812CEB8 - ldr r0, =0x0203ab34 - ldr r1, [r0] - movs r0, 0x2 - strb r0, [r1] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_812B108 - - thumb_func_start sub_812B130 -sub_812B130: @ 812B130 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x40 - ble _0812B14E - movs r0, 0 - strh r0, [r1, 0xA] - ldr r0, =0x0203ab34 - ldr r1, [r0] - movs r0, 0x13 - strb r0, [r1] -_0812B14E: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_812B130 - - thumb_func_start sub_812B158 -sub_812B158: @ 812B158 - push {lr} - sub sp, 0xC - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - ldr r2, =gUnknown_085EF6E9 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - movs r2, 0x85 - lsls r2, 2 - movs r3, 0xC0 - lsls r3, 1 - movs r0, 0xE - str r0, [sp] - movs r0, 0xF - str r0, [sp, 0x4] - movs r0, 0x15 - movs r1, 0x7 - bl sub_80323CC - ldr r0, =0x0203ab34 - ldr r1, [r0] - movs r0, 0x16 - strb r0, [r1] - movs r0, 0 - add sp, 0xC - pop {r1} - bx r1 - .pool - thumb_func_end sub_812B158 - - thumb_func_start sub_812B1B0 -sub_812B1B0: @ 812B1B0 - push {lr} - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - bne _0812B1EC - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - movs r0, 0 - bl sub_812CEB8 - movs r0, 0x1 - bl sub_812CEB8 - movs r0, 0x2 - bl sub_812CEB8 - ldr r0, =0x0203ab34 - ldr r1, [r0] - ldrh r0, [r1, 0x12] - ldrh r2, [r1, 0xC] - adds r0, r2 - strh r0, [r1, 0xC] - movs r0, 0x1B - b _0812B206 - .pool -_0812B1EC: - cmp r1, 0x1 - beq _0812B1F8 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _0812B208 -_0812B1F8: - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - ldr r0, =0x0203ab34 - ldr r1, [r0] - movs r0, 0x5 -_0812B206: - strb r0, [r1] -_0812B208: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_812B1B0 - - thumb_func_start sub_812B214 -sub_812B214: @ 812B214 - push {lr} - sub sp, 0xC - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - ldr r2, =gUnknown_085EF6F8 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =0x0203ab34 - ldr r1, [r0] - movs r0, 0x18 - strb r0, [r1] - movs r0, 0 - add sp, 0xC - pop {r1} - bx r1 - .pool - thumb_func_end sub_812B214 - - thumb_func_start sub_812B254 -sub_812B254: @ 812B254 - push {lr} - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _0812B272 - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - ldr r0, =0x0203ab34 - ldr r1, [r0] - movs r0, 0x5 - strb r0, [r1] -_0812B272: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_812B254 - - thumb_func_start sub_812B280 -sub_812B280: @ 812B280 - push {lr} - sub sp, 0xC - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - ldr r2, =gUnknown_085EF710 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =0x0203ab34 - ldr r1, [r0] - movs r0, 0x1A - strb r0, [r1] - movs r0, 0 - add sp, 0xC - pop {r1} - bx r1 - .pool - thumb_func_end sub_812B280 - - thumb_func_start sub_812B2C0 -sub_812B2C0: @ 812B2C0 - push {lr} - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _0812B2DE - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - ldr r0, =0x0203ab34 - ldr r1, [r0] - movs r0, 0x1B - strb r0, [r1] -_0812B2DE: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_812B2C0 - - thumb_func_start sub_812B2EC -sub_812B2EC: @ 812B2EC - push {r4,lr} - sub sp, 0x4 - ldr r4, =0x0203ab34 - ldr r0, [r4] - ldrh r0, [r0, 0xC] - bl SetCoins - bl GetCoins - lsls r0, 16 - lsrs r0, 16 - bl sub_80EDD78 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812B2EC - - thumb_func_start sub_812B32C -sub_812B32C: @ 812B32C - push {r4-r6,lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - beq _0812B340 - b _0812B470 -_0812B340: - ldr r6, =0x0203ab34 - ldr r0, [r6] - ldr r0, [r0, 0x64] - bl SetMainCallback2 - ldr r4, =0x0203aaf4 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203aaf8 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203aafc - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ab00 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ab04 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ab08 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ab0c - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ab10 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ab14 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ab18 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ab1c - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ab20 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ab24 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ab28 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203aae4 - ldr r0, [r4] - cmp r0, 0 - beq _0812B3E4 - bl Free - str r5, [r4] -_0812B3E4: - ldr r4, =0x0203aae8 - ldr r0, [r4] - cmp r0, 0 - beq _0812B3F2 - bl Free - str r5, [r4] -_0812B3F2: - ldr r4, =0x0203aaec - ldr r0, [r4] - cmp r0, 0 - beq _0812B400 - bl Free - str r5, [r4] -_0812B400: - ldr r4, =0x0203aaf0 - ldr r0, [r4] - cmp r0, 0 - beq _0812B40E - bl Free - str r5, [r4] -_0812B40E: - ldr r4, =0x0203aac8 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203aacc - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203aad0 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203aad4 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203aad8 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203aadc - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203aae0 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ab2c - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ab30 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r0, [r6] - bl Free - str r5, [r6] -_0812B470: - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812B32C - - thumb_func_start sub_812B4EC -sub_812B4EC: @ 812B4EC - push {r4,lr} - ldr r4, =0x0203ab34 - ldr r1, [r4] - ldrb r0, [r1, 0xA] - cmp r0, 0 - bne _0812B54A - ldrb r1, [r1, 0x4] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0 - bne _0812B54A - bl sub_812B5B0 - lsls r0, 24 - cmp r0, 0 - beq _0812B52C - bl sub_812B5EC - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3 - beq _0812B52C - ldr r2, [r4] - ldr r1, =gUnknown_085A77FE - lsls r0, r3, 1 - adds r0, r1 - ldrb r1, [r0] - ldrb r0, [r2, 0x4] - orrs r0, r1 - strb r0, [r2, 0x4] - cmp r3, 0x1 - bne _0812B54A -_0812B52C: - bl sub_812B634 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x5 - beq _0812B54A - ldr r0, =0x0203ab34 - ldr r2, [r0] - ldr r1, =gUnknown_085A7804 - lsls r0, r3, 1 - adds r0, r1 - ldrb r1, [r0] - ldrb r0, [r2, 0x4] - orrs r0, r1 - strb r0, [r2, 0x4] -_0812B54A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812B4EC - - thumb_func_start sub_812B55C -sub_812B55C: @ 812B55C - push {lr} - ldr r2, =0x0203ab34 - ldr r1, [r2] - movs r0, 0 - strb r0, [r1, 0x6] - ldr r2, [r2] - ldrb r0, [r2, 0x4] - cmp r0, 0 - beq _0812B572 - movs r0, 0x1 - strb r0, [r2, 0x6] -_0812B572: - pop {r0} - bx r0 - .pool - thumb_func_end sub_812B55C - - thumb_func_start sub_812B57C -sub_812B57C: @ 812B57C - push {r4,lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0 - movs r3, 0x1 - ldr r4, =gUnknown_085A77F6 -_0812B588: - adds r0, r1, 0 - ands r0, r3 - cmp r0, 0 - beq _0812B59C - adds r0, r2, r4 - ldrb r0, [r0] - b _0812B5AA - .pool -_0812B59C: - lsrs r1, 1 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _0812B588 - movs r0, 0 -_0812B5AA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_812B57C - - thumb_func_start sub_812B5B0 -sub_812B5B0: @ 812B5B0 - push {r4,lr} - bl GenerateRandomNumber - lsls r0, 24 - lsrs r0, 24 - ldr r4, =gUnknown_085A76C0 - ldr r1, =0x0203ab34 - ldr r1, [r1] - movs r3, 0x12 - ldrsh r2, [r1, r3] - ldrb r3, [r1, 0x1] - lsls r1, r3, 1 - adds r1, r3 - subs r1, 0x1 - adds r2, r1 - adds r2, r4 - ldrb r1, [r2] - cmp r1, r0 - bhi _0812B5E4 - movs r0, 0 - b _0812B5E6 - .pool -_0812B5E4: - movs r0, 0x1 -_0812B5E6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_812B5B0 - - thumb_func_start sub_812B5EC -sub_812B5EC: @ 812B5EC - push {r4-r6,lr} - movs r5, 0 - ldr r6, =gUnknown_085A76D2 -_0812B5F2: - bl GenerateRandomNumber - movs r2, 0xFF - ldr r1, =0x0203ab34 - ldr r3, [r1] - lsls r1, r5, 16 - asrs r4, r1, 16 - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 1 - ldrb r3, [r3, 0x1] - adds r1, r3 - adds r1, r6 - ldrb r1, [r1] - ands r2, r0 - cmp r1, r2 - bgt _0812B620 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _0812B5F2 -_0812B620: - lsls r0, r5, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812B5EC - - thumb_func_start sub_812B634 -sub_812B634: @ 812B634 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r6, 0 - ldr r0, =gUnknown_085A76E4 - mov r8, r0 - movs r7, 0x80 - lsls r7, 17 -_0812B644: - bl GenerateRandomNumber - movs r5, 0xFF - ands r5, r0 - ldr r0, =0x0203ab34 - ldr r4, [r0] - lsls r2, r6, 16 - asrs r1, r2, 16 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - ldrb r3, [r4, 0x1] - adds r0, r3 - add r0, r8 - ldrb r3, [r0] - cmp r1, 0 - bne _0812B680 - ldrb r0, [r4, 0x3] - cmp r0, 0x1 - bne _0812B680 - adds r3, 0xA - asrs r0, r7, 16 - cmp r3, r0 - ble _0812B69E - adds r3, r0, 0 - b _0812B69E - .pool -_0812B680: - asrs r0, r2, 16 - cmp r0, 0x4 - bne _0812B69E - ldr r0, =0x0203ab34 - ldr r0, [r0] - ldrb r0, [r0, 0x3] - cmp r0, 0x1 - bne _0812B69E - lsls r0, r3, 16 - ldr r1, =0xfff60000 - adds r0, r1 - lsrs r3, r0, 16 - cmp r0, 0 - bge _0812B69E - movs r3, 0 -_0812B69E: - lsls r0, r3, 16 - asrs r0, 16 - cmp r0, r5 - bgt _0812B6B4 - movs r3, 0x80 - lsls r3, 9 - adds r0, r2, r3 - lsrs r6, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812B644 -_0812B6B4: - lsls r0, r6, 24 - lsrs r0, 24 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812B634 - - thumb_func_start sub_812B6CC -sub_812B6CC: @ 812B6CC - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, =0x0203ab34 - ldr r2, [r0] - ldrb r0, [r2, 0x3] - cmp r0, 0 - beq _0812B6E8 - ldr r0, =gUnknown_085A7768 - b _0812B6EA - .pool -_0812B6E8: - ldr r0, =gUnknown_085A7702 -_0812B6EA: - lsls r1, r3, 4 - adds r1, r3 - ldrb r2, [r2, 0x2] - adds r1, r2 - adds r1, r0 - ldrb r0, [r1] - pop {r1} - bx r1 - .pool - thumb_func_end sub_812B6CC - - thumb_func_start sub_812B700 -sub_812B700: @ 812B700 - push {r4-r6,lr} - ldr r0, =0x0203ab34 - ldr r1, [r0] - movs r0, 0 - strb r0, [r1, 0x5] - bl GenerateRandomNumber - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0 - bl sub_812B6CC - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bcc _0812B754 - movs r6, 0x5 - b _0812B72E - .pool -_0812B728: - subs r0, r5, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 -_0812B72E: - lsls r0, r6, 16 - asrs r5, r0, 16 - cmp r5, 0 - ble _0812B74E - bl GenerateRandomNumber - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r6, 24 - lsrs r0, 24 - bl sub_812B6CC - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bcs _0812B728 -_0812B74E: - ldr r0, =0x0203ab34 - ldr r0, [r0] - strb r6, [r0, 0x5] -_0812B754: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812B700 - - thumb_func_start sub_812B760 -sub_812B760: @ 812B760 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl GenerateRandomNumber - movs r1, 0xFF - ands r1, r0 - ldr r0, =gUnknown_085A77CE - lsls r4, 1 - adds r4, r0 - ldrh r4, [r4] - cmp r1, r4 - bcc _0812B784 - movs r0, 0 - b _0812B786 - .pool -_0812B784: - movs r0, 0x1 -_0812B786: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_812B760 - - thumb_func_start dp15_jump_random_unknown -dp15_jump_random_unknown: @ 812B78C - push {r4,r5,lr} - movs r4, 0 - ldr r0, =0x0203ab34 - ldr r0, [r0] - movs r2, 0x10 - ldrsh r1, [r0, r2] - ldr r0, =0x0000012b - cmp r1, r0 - ble _0812B7AC - movs r4, 0x4 - b _0812B7C2 - .pool -_0812B7AC: - cmp r1, 0xF9 - ble _0812B7B4 - movs r4, 0x3 - b _0812B7C2 -_0812B7B4: - cmp r1, 0xC7 - ble _0812B7BC - movs r4, 0x2 - b _0812B7C2 -_0812B7BC: - cmp r1, 0x95 - ble _0812B7C2 - movs r4, 0x1 -_0812B7C2: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 24 - lsrs r1, r0, 24 - ldr r5, =gUnknown_085A77D8 - lsls r4, 2 - adds r0, r4, r5 - ldrb r0, [r0] - cmp r1, r0 - bcs _0812B7E8 - movs r0, 0x4 - b _0812B822 - .pool -_0812B7E8: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 24 - adds r2, r5, 0x2 - adds r2, r4, r2 - ldr r3, =gUnknown_085A77EC - ldr r1, =0x0203ab34 - ldr r1, [r1] - ldrb r1, [r1, 0xB] - lsls r1, 1 - adds r1, r3 - ldrb r1, [r1] - ldrb r2, [r2] - adds r1, r2 - lsls r1, 24 - cmp r0, r1 - bcc _0812B820 - movs r0, 0x8 - b _0812B822 - .pool -_0812B820: - movs r0, 0x2 -_0812B822: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end dp15_jump_random_unknown - - thumb_func_start sub_812B828 -sub_812B828: @ 812B828 - push {r4,lr} - ldr r4, =0x0203ab34 - ldr r1, [r4] - movs r0, 0 - strh r0, [r1, 0x8] - bl sub_812B85C - ldr r0, [r4] - movs r1, 0x12 - ldrsh r0, [r0, r1] - cmp r0, 0x1 - ble _0812B844 - bl sub_812B8D0 -_0812B844: - ldr r0, [r4] - movs r1, 0x12 - ldrsh r0, [r0, r1] - cmp r0, 0x2 - ble _0812B852 - bl sub_812B9A0 -_0812B852: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812B828 - - thumb_func_start sub_812B85C -sub_812B85C: @ 812B85C - push {r4,r5,lr} - movs r0, 0 - movs r1, 0x2 - bl sub_812BC44 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0x1 - movs r1, 0x2 - bl sub_812BC44 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x2 - movs r1, 0x2 - bl sub_812BC44 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_812BA6C - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x9 - beq _0812B8BC - ldr r0, =0x0203ab34 - ldr r2, [r0] - ldr r0, =gUnknown_085A7828 - lsls r1, 1 - adds r0, r1, r0 - ldrh r0, [r0] - ldrh r3, [r2, 0xE] - adds r0, r3 - strh r0, [r2, 0xE] - ldr r0, =gUnknown_085A7816 - adds r1, r0 - ldrh r0, [r2, 0x8] - ldrh r1, [r1] - orrs r0, r1 - strh r0, [r2, 0x8] - movs r0, 0 - bl sub_812CF34 -_0812B8BC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812B85C - - thumb_func_start sub_812B8D0 -sub_812B8D0: @ 812B8D0 - push {r4,r5,lr} - movs r0, 0 - movs r1, 0x1 - bl sub_812BC44 - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x1 - movs r1, 0x1 - bl sub_812BC44 - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x2 - movs r1, 0x1 - bl sub_812BC44 - lsls r0, 24 - lsrs r2, r0, 24 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_812BA6C - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x9 - beq _0812B930 - cmp r1, 0 - bne _0812B90C - movs r1, 0x1 -_0812B90C: - ldr r0, =0x0203ab34 - ldr r2, [r0] - ldr r0, =gUnknown_085A7828 - lsls r1, 1 - adds r0, r1, r0 - ldrh r0, [r0] - ldrh r3, [r2, 0xE] - adds r0, r3 - strh r0, [r2, 0xE] - ldr r0, =gUnknown_085A7816 - adds r1, r0 - ldrh r0, [r2, 0x8] - ldrh r1, [r1] - orrs r0, r1 - strh r0, [r2, 0x8] - movs r0, 0x1 - bl sub_812CF34 -_0812B930: - movs r0, 0 - movs r1, 0x3 - bl sub_812BC44 - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x1 - movs r1, 0x3 - bl sub_812BC44 - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x2 - movs r1, 0x3 - bl sub_812BC44 - lsls r0, 24 - lsrs r2, r0, 24 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_812BA6C - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x9 - beq _0812B98E - cmp r1, 0 - bne _0812B96A - movs r1, 0x1 -_0812B96A: - ldr r0, =0x0203ab34 - ldr r2, [r0] - ldr r0, =gUnknown_085A7828 - lsls r1, 1 - adds r0, r1, r0 - ldrh r0, [r0] - ldrh r3, [r2, 0xE] - adds r0, r3 - strh r0, [r2, 0xE] - ldr r0, =gUnknown_085A7816 - adds r1, r0 - ldrh r0, [r2, 0x8] - ldrh r1, [r1] - orrs r0, r1 - strh r0, [r2, 0x8] - movs r0, 0x2 - bl sub_812CF34 -_0812B98E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812B8D0 - - thumb_func_start sub_812B9A0 -sub_812B9A0: @ 812B9A0 - push {r4,r5,lr} - movs r0, 0 - movs r1, 0x1 - bl sub_812BC44 - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x1 - movs r1, 0x2 - bl sub_812BC44 - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x2 - movs r1, 0x3 - bl sub_812BC44 - lsls r0, 24 - lsrs r2, r0, 24 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_812BA6C - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x9 - beq _0812B9FE - cmp r1, 0 - beq _0812B9F8 - ldr r0, =0x0203ab34 - ldr r2, [r0] - ldr r0, =gUnknown_085A7828 - lsls r1, 1 - adds r0, r1, r0 - ldrh r0, [r0] - ldrh r3, [r2, 0xE] - adds r0, r3 - strh r0, [r2, 0xE] - ldr r0, =gUnknown_085A7816 - adds r1, r0 - ldrh r0, [r2, 0x8] - ldrh r1, [r1] - orrs r0, r1 - strh r0, [r2, 0x8] -_0812B9F8: - movs r0, 0x3 - bl sub_812CF34 -_0812B9FE: - movs r0, 0 - movs r1, 0x3 - bl sub_812BC44 - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x1 - movs r1, 0x2 - bl sub_812BC44 - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x2 - movs r1, 0x1 - bl sub_812BC44 - lsls r0, 24 - lsrs r2, r0, 24 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_812BA6C - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x9 - beq _0812BA5A - cmp r1, 0 - beq _0812BA54 - ldr r0, =0x0203ab34 - ldr r2, [r0] - ldr r0, =gUnknown_085A7828 - lsls r1, 1 - adds r0, r1, r0 - ldrh r0, [r0] - ldrh r3, [r2, 0xE] - adds r0, r3 - strh r0, [r2, 0xE] - ldr r0, =gUnknown_085A7816 - adds r1, r0 - ldrh r0, [r2, 0x8] - ldrh r1, [r1] - orrs r0, r1 - strh r0, [r2, 0x8] -_0812BA54: - movs r0, 0x4 - bl sub_812CF34 -_0812BA5A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812B9A0 - - thumb_func_start sub_812BA6C -sub_812BA6C: @ 812BA6C - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - cmp r3, r1 - bne _0812BA90 - cmp r3, r2 - bne _0812BA90 - ldr r0, =gUnknown_085A780E - adds r0, r3, r0 - ldrb r0, [r0] - b _0812BAB6 - .pool -_0812BA90: - cmp r3, 0 - bne _0812BA9C - cmp r1, 0 - bne _0812BA9C - cmp r2, 0x1 - beq _0812BAA8 -_0812BA9C: - cmp r3, 0x1 - bne _0812BAAC - cmp r1, 0x1 - bne _0812BAAC - cmp r2, 0 - bne _0812BAAC -_0812BAA8: - movs r0, 0x6 - b _0812BAB6 -_0812BAAC: - cmp r3, 0x4 - beq _0812BAB4 - movs r0, 0x9 - b _0812BAB6 -_0812BAB4: - movs r0, 0 -_0812BAB6: - pop {r1} - bx r1 - thumb_func_end sub_812BA6C - - thumb_func_start sub_812BABC -sub_812BABC: @ 812BABC - push {r4,lr} - ldr r4, =sub_812BAFC - adds r0, r4, 0 - movs r1, 0x4 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812BABC - - thumb_func_start sub_812BADC -sub_812BADC: @ 812BADC - push {lr} - ldr r0, =sub_812BAFC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _0812BAF4 - movs r0, 0 - b _0812BAF6 - .pool -_0812BAF4: - movs r0, 0x1 -_0812BAF6: - pop {r1} - bx r1 - thumb_func_end sub_812BADC - - thumb_func_start sub_812BAFC -sub_812BAFC: @ 812BAFC - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085A74C4 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0812BB0E: - 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 _0812BB0E - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812BAFC - - thumb_func_start sub_812BB34 -sub_812BB34: @ 812BB34 - push {r4,lr} - adds r4, r0, 0 - bl sub_812CF6C - lsls r0, 24 - cmp r0, 0 - beq _0812BB60 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - ldr r0, =0x0203ab34 - ldr r0, [r0] - movs r1, 0xE - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0812BB60 - movs r0, 0x2 - strh r0, [r4, 0x8] - movs r0, 0x1 - b _0812BB62 - .pool -_0812BB60: - movs r0, 0 -_0812BB62: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_812BB34 - - thumb_func_start sub_812BB68 -sub_812BB68: @ 812BB68 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0812BBBC - bl task_is_not_running_overworld_fanfare - lsls r0, 24 - cmp r0, 0 - beq _0812BB8E - movs r0, 0x15 - bl audio_play -_0812BB8E: - ldr r0, =0x0203ab34 - ldr r2, [r0] - ldrh r0, [r2, 0xE] - subs r0, 0x1 - strh r0, [r2, 0xE] - ldrh r3, [r2, 0xC] - movs r0, 0xC - ldrsh r1, [r2, r0] - ldr r0, =0x0000270e - cmp r1, r0 - bgt _0812BBA8 - adds r0, r3, 0x1 - strh r0, [r2, 0xC] -_0812BBA8: - movs r0, 0x8 - strh r0, [r4, 0xA] - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2C] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0812BBBC - movs r0, 0x4 - strh r0, [r4, 0xA] -_0812BBBC: - bl task_is_not_running_overworld_fanfare - lsls r0, 24 - cmp r0, 0 - beq _0812BBF6 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0812BBF6 - movs r0, 0x15 - bl audio_play - ldr r1, =0x0203ab34 - ldr r2, [r1] - ldrh r0, [r2, 0xE] - ldrh r3, [r2, 0xC] - adds r0, r3 - strh r0, [r2, 0xC] - lsls r0, 16 - asrs r0, 16 - ldr r3, =0x0000270f - cmp r0, r3 - ble _0812BBF0 - strh r3, [r2, 0xC] -_0812BBF0: - ldr r1, [r1] - movs r0, 0 - strh r0, [r1, 0xE] -_0812BBF6: - ldr r0, =0x0203ab34 - ldr r0, [r0] - movs r1, 0xE - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0812BC08 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0812BC08: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812BB68 - - thumb_func_start sub_812BC20 -sub_812BC20: @ 812BC20 - push {lr} - bl sub_812CFB8 - lsls r0, 24 - cmp r0, 0 - beq _0812BC3A - ldr r0, =sub_812BAFC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_0812BC3A: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_812BC20 - - thumb_func_start sub_812BC44 -sub_812BC44: @ 812BC44 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - ldr r0, =0x0203ab34 - ldr r0, [r0] - lsls r2, r4, 1 - adds r0, 0x28 - adds r0, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - lsls r1, 16 - asrs r1, 16 - adds r0, r1 - movs r1, 0x15 - bl __modsi3 - lsls r0, 16 - lsrs r1, r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0812BC76 - adds r0, 0x15 - lsls r0, 16 - lsrs r1, r0, 16 -_0812BC76: - ldr r2, =gUnknown_085A766E - lsls r1, 16 - asrs r1, 16 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 2 - adds r0, r4 - adds r1, r0 - adds r1, r2 - ldrb r0, [r1] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812BC44 - - thumb_func_start sub_812BC98 -sub_812BC98: @ 812BC98 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - movs r6, 0 - ldr r0, =0x0203ab34 - ldr r0, [r0] - lsls r1, r4, 1 - adds r0, 0x1C - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - movs r1, 0x18 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - beq _0812BCC2 - ldr r6, =0x0000ffff -_0812BCC2: - lsls r1, r5, 16 - asrs r1, 16 - lsls r0, r6, 16 - asrs r0, 16 - adds r1, r0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl sub_812BC44 - lsls r0, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812BC98 - - thumb_func_start sub_812BCE8 -sub_812BCE8: @ 812BCE8 - push {lr} - ldr r1, =0x0203ab34 - ldr r1, [r1] - movs r2, 0x16 - ldrsh r1, [r1, r2] - lsls r0, 16 - asrs r0, 16 - adds r1, r0 - adds r0, r1, 0 - movs r1, 0x6 - bl __modsi3 - lsls r0, 16 - lsrs r1, r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0812BD10 - adds r0, 0x6 - lsls r0, 16 - lsrs r1, r0, 16 -_0812BD10: - ldr r0, =gUnknown_085A76AD - lsls r1, 16 - asrs r1, 16 - adds r1, r0 - ldrb r0, [r1] - pop {r1} - bx r1 - .pool - thumb_func_end sub_812BCE8 - - thumb_func_start sub_812BD28 -sub_812BD28: @ 812BD28 - push {r4-r6,lr} - adds r5, r0, 0 - lsls r5, 24 - ldr r0, =0x0203ab34 - ldr r6, [r0] - lsrs r5, 23 - adds r4, r6, 0 - adds r4, 0x1C - adds r4, r5 - lsls r1, 16 - asrs r1, 16 - ldrh r0, [r4] - adds r1, r0 - strh r1, [r4] - movs r1, 0 - ldrsh r0, [r4, r1] - movs r1, 0xFC - lsls r1, 1 - bl __modsi3 - strh r0, [r4] - adds r6, 0x28 - adds r6, r5 - movs r1, 0 - ldrsh r0, [r4, r1] - movs r1, 0x18 - bl __divsi3 - movs r1, 0x15 - subs r1, r0 - strh r1, [r6] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812BD28 - - thumb_func_start sub_812BD70 -sub_812BD70: @ 812BD70 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - lsls r1, 16 - lsrs r4, r1, 16 - ldr r7, =0x0203ab34 - ldr r0, [r7] - lsls r6, r5, 1 - adds r0, 0x1C - adds r0, r6 - movs r1, 0 - ldrsh r0, [r0, r1] - movs r1, 0x18 - bl __modsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r2, r0, 16 - asrs r1, r2, 16 - cmp r1, 0 - beq _0812BDC4 - lsls r0, r4, 16 - asrs r0, 16 - cmp r1, r0 - bge _0812BDA6 - lsrs r4, r2, 16 -_0812BDA6: - lsls r1, r4, 16 - asrs r1, 16 - adds r0, r5, 0 - bl sub_812BD28 - ldr r0, [r7] - adds r0, 0x1C - adds r0, r6 - movs r1, 0 - ldrsh r0, [r0, r1] - movs r1, 0x18 - bl __modsi3 - lsls r0, 16 - lsrs r0, 16 -_0812BDC4: - lsls r0, 16 - asrs r0, 16 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812BD70 - - thumb_func_start sub_812BDD4 -sub_812BDD4: @ 812BDD4 - push {r4,lr} - ldr r1, =0x0203ab34 - ldr r4, [r1] - lsls r0, 16 - asrs r0, 16 - ldrh r1, [r4, 0x14] - adds r0, r1 - strh r0, [r4, 0x14] - movs r1, 0x14 - ldrsh r0, [r4, r1] - movs r1, 0x78 - bl __modsi3 - strh r0, [r4, 0x14] - movs r1, 0x14 - ldrsh r0, [r4, r1] - movs r1, 0x14 - bl __divsi3 - movs r1, 0x6 - subs r1, r0 - strh r1, [r4, 0x16] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812BDD4 - - thumb_func_start sub_812BE0C -sub_812BE0C: @ 812BE0C - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - ldr r5, =0x0203ab34 - ldr r0, [r5] - movs r1, 0x14 - ldrsh r0, [r0, r1] - movs r1, 0x14 - bl __modsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r2, r0, 16 - asrs r1, r2, 16 - cmp r1, 0 - beq _0812BE4E - lsls r0, r4, 16 - asrs r0, 16 - cmp r1, r0 - bge _0812BE36 - lsrs r4, r2, 16 -_0812BE36: - lsls r0, r4, 16 - asrs r0, 16 - bl sub_812BDD4 - ldr r0, [r5] - movs r1, 0x14 - ldrsh r0, [r0, r1] - movs r1, 0x14 - bl __modsi3 - lsls r0, 16 - lsrs r0, 16 -_0812BE4E: - lsls r0, 16 - asrs r0, 16 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812BE0C - - thumb_func_start sub_812BE5C -sub_812BE5C: @ 812BE5C - push {r4-r6,lr} - movs r4, 0 - ldr r5, =sub_812BF2C - ldr r6, =0x03005e00 -_0812BE64: - adds r0, r5, 0 - movs r1, 0x2 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r6 - strh r4, [r1, 0x26] - ldr r1, =0x0203ab34 - ldr r1, [r1] - adds r1, 0x3A - adds r1, r4 - strb r0, [r1] - bl _call_via_r5 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _0812BE64 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812BE5C - - thumb_func_start sub_812BEA4 -sub_812BEA4: @ 812BEA4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x03005e00 - ldr r1, =0x0203ab34 - ldr r2, [r1] - adds r2, 0x3A - adds r2, r0 - ldrb r1, [r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r3, 0x1 - strh r3, [r0, 0x8] - ldrb r1, [r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - strh r3, [r0, 0x24] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812BEA4 - - thumb_func_start sub_812BEDC -sub_812BEDC: @ 812BEDC - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - ldr r1, =0x0203ab34 - ldr r1, [r1] - adds r1, 0x3A - adds r1, r0 - ldrb r1, [r1] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x2 - strh r1, [r0, 0x8] - bx lr - .pool - thumb_func_end sub_812BEDC - - thumb_func_start sub_812BF04 -sub_812BF04: @ 812BF04 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - ldr r1, =0x0203ab34 - ldr r1, [r1] - adds r1, 0x3A - adds r1, r0 - ldrb r1, [r1] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r0, [r0, 0x24] - lsls r0, 24 - lsrs r0, 24 - bx lr - .pool - thumb_func_end sub_812BF04 - - thumb_func_start sub_812BF2C -sub_812BF2C: @ 812BF2C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085A74D0 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0812BF3E: - 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 _0812BF3E - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812BF2C - - thumb_func_start sub_812BF64 -sub_812BF64: @ 812BF64 - movs r0, 0 - bx lr - thumb_func_end sub_812BF64 - - thumb_func_start sub_812BF68 -sub_812BF68: @ 812BF68 - push {lr} - ldrh r0, [r0, 0x26] - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0203ab34 - ldr r1, [r1] - movs r2, 0x1A - ldrsh r1, [r1, r2] - bl sub_812BD28 - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_812BF68 - - thumb_func_start sub_812BF88 -sub_812BF88: @ 812BF88 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - movs r2, 0 - strh r0, [r4, 0x8] - ldr r0, =0x0203ab34 - ldr r3, [r0] - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r1, 1 - adds r0, r3, 0 - adds r0, 0x34 - adds r0, r1 - strh r2, [r0] - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r1, 1 - adds r0, r3, 0 - adds r0, 0x2E - adds r0, r1 - strh r2, [r0] - ldrb r0, [r3, 0xA] - cmp r0, 0 - bne _0812BFF4 - ldrb r0, [r3, 0x4] - cmp r0, 0 - beq _0812BFDC - ldrb r0, [r3, 0x6] - cmp r0, 0 - beq _0812BFDC - ldr r1, =gUnknown_085A74E4 - movs r2, 0x26 - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - lsls r0, 24 - cmp r0, 0 - bne _0812BFF4 -_0812BFDC: - ldr r0, =0x0203ab34 - ldr r1, [r0] - movs r0, 0 - strb r0, [r1, 0x6] - ldr r1, =gUnknown_085A74F0 - movs r2, 0x26 - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 -_0812BFF4: - ldr r0, =0x0203ab34 - ldr r1, [r0] - movs r2, 0x26 - ldrsh r0, [r4, r2] - lsls r0, 1 - adds r1, 0x2E - adds r1, r0 - ldrh r0, [r1] - strh r0, [r4, 0xA] - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812BF88 - - thumb_func_start sub_812C01C -sub_812C01C: @ 812C01C - push {r4-r7,lr} - sub sp, 0xC - adds r4, r0, 0 - ldr r1, =gUnknown_085A74FC - mov r0, sp - movs r2, 0xA - bl memcpy - ldr r7, =0x0203ab34 - ldr r5, [r7] - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r6, r0, 1 - adds r0, r5, 0 - adds r0, 0x1C - adds r0, r6 - movs r2, 0 - ldrsh r0, [r0, r2] - movs r1, 0x18 - bl __modsi3 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r0, 0 - beq _0812C068 - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r6, 0x1A - ldrsh r1, [r5, r6] - bl sub_812BD70 - b _0812C0A0 - .pool -_0812C068: - adds r0, r5, 0 - adds r0, 0x2E - adds r1, r0, r6 - ldrh r3, [r1] - movs r6, 0 - ldrsh r0, [r1, r6] - cmp r0, 0 - beq _0812C0A4 - subs r0, r3, 0x1 - strh r0, [r1] - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x1A - ldrsh r1, [r5, r2] - bl sub_812BD28 - ldr r1, [r7] - movs r6, 0x26 - ldrsh r0, [r4, r6] - lsls r0, 1 - adds r1, 0x1C - adds r1, r0 - movs r2, 0 - ldrsh r0, [r1, r2] - movs r1, 0x18 - bl __modsi3 -_0812C0A0: - lsls r0, 16 - lsrs r2, r0, 16 -_0812C0A4: - cmp r2, 0 - bne _0812C0D2 - ldr r0, =0x0203ab34 - ldr r1, [r0] - movs r6, 0x26 - ldrsh r0, [r4, r6] - lsls r0, 1 - adds r1, 0x2E - adds r1, r0 - movs r0, 0 - ldrsh r1, [r1, r0] - cmp r1, 0 - bne _0812C0D2 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r2, 0xA - ldrsh r0, [r4, r2] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - strh r0, [r4, 0xA] - strh r1, [r4, 0xC] -_0812C0D2: - movs r0, 0 - add sp, 0xC - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812C01C - - thumb_func_start sub_812C0E0 -sub_812C0E0: @ 812C0E0 - push {r4,lr} - adds r2, r0, 0 - ldr r4, =0x0203ab34 - ldr r1, [r4] - movs r3, 0x26 - ldrsh r0, [r2, r3] - lsls r0, 1 - adds r1, 0x22 - adds r1, r0 - ldrh r0, [r2, 0xA] - strh r0, [r1] - ldrh r0, [r2, 0xA] - negs r3, r0 - strh r3, [r2, 0xA] - ldrh r0, [r2, 0xC] - adds r0, 0x1 - strh r0, [r2, 0xC] - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _0812C110 - lsls r0, r3, 16 - asrs r0, 17 - strh r0, [r2, 0xA] -_0812C110: - movs r0, 0xA - ldrsh r3, [r2, r0] - cmp r3, 0 - bne _0812C12A - strh r3, [r2, 0x8] - strh r3, [r2, 0x24] - ldr r1, [r4] - movs r4, 0x26 - ldrsh r0, [r2, r4] - lsls r0, 1 - adds r1, 0x22 - adds r1, r0 - strh r3, [r1] -_0812C12A: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812C0E0 - - thumb_func_start sub_812C138 -sub_812C138: @ 812C138 - push {r4,r5,lr} - ldr r4, =0x0203ab34 - ldr r0, [r4] - ldrb r0, [r0, 0x4] - bl sub_812B57C - lsls r0, 24 - lsrs r3, r0, 24 - adds r5, r3, 0 - ldr r4, [r4] - ldrb r1, [r4, 0x4] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0 - beq _0812C15A - movs r5, 0 - movs r3, 0x1 -_0812C15A: - ldr r1, =gUnknown_085A7508 - movs r2, 0x12 - ldrsh r0, [r4, r2] - subs r0, 0x1 - lsls r0, 2 - adds r0, r1 - ldr r2, [r0] - adds r0, r5, 0 - adds r1, r3, 0 - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812C138 - - thumb_func_start sub_812C184 -sub_812C184: @ 812C184 - push {r4,r5,lr} - adds r3, r0, 0 - adds r4, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r2, 24 - lsrs r5, r2, 24 - lsls r3, 16 - asrs r3, 16 - movs r0, 0 - adds r1, r3, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, r4 - beq _0812C1AC - cmp r0, r5 - bne _0812C1BC -_0812C1AC: - ldr r0, =0x0203ab34 - ldr r0, [r0] - strb r1, [r0, 0x7] - movs r0, 0x1 - b _0812C1BE - .pool -_0812C1BC: - movs r0, 0 -_0812C1BE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_812C184 - - thumb_func_start sub_812C1C4 -sub_812C1C4: @ 812C1C4 - push {r4,lr} - movs r1, 0x1 - lsls r0, 16 - asrs r4, r0, 16 - subs r1, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - beq _0812C20C - movs r1, 0x2 - subs r1, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - beq _0812C20C - movs r1, 0x3 - subs r1, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bne _0812C210 -_0812C20C: - movs r0, 0x1 - b _0812C212 -_0812C210: - movs r0, 0 -_0812C212: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_812C1C4 - - thumb_func_start sub_812C218 -sub_812C218: @ 812C218 - push {lr} - ldr r0, =0x0203ab34 - ldr r0, [r0] - ldrb r1, [r0, 0x4] - movs r0, 0xC2 - ands r0, r1 - cmp r0, 0 - bne _0812C230 - movs r0, 0 - b _0812C232 - .pool -_0812C230: - movs r0, 0x1 -_0812C232: - pop {r1} - bx r1 - thumb_func_end sub_812C218 - - thumb_func_start sub_812C238 -sub_812C238: @ 812C238 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - movs r5, 0 - movs r0, 0x2 - mov r8, r0 -_0812C24C: - lsls r0, r5, 16 - asrs r4, r0, 16 - mov r1, r8 - subs r0, r1, r4 - lsls r0, 16 - asrs r0, 16 - adds r1, r7, 0 - adds r2, r6, 0 - bl sub_812C184 - lsls r0, 24 - cmp r0, 0 - beq _0812C278 - ldr r0, =0x0203ab34 - ldr r1, [r0] - movs r0, 0x2 - strh r0, [r1, 0x34] - strh r5, [r1, 0x2E] - movs r0, 0x1 - b _0812C286 - .pool -_0812C278: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812C24C - movs r0, 0 -_0812C286: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_812C238 - - thumb_func_start sub_812C290 -sub_812C290: @ 812C290 - 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 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - bl sub_812C218 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0812C2BE - movs r0, 0 - bl sub_812C1C4 - lsls r0, 24 - cmp r0, 0 - bne _0812C2F4 -_0812C2BE: - movs r7, 0x1 - movs r6, 0 -_0812C2C2: - lsls r0, r7, 16 - asrs r4, r0, 16 - adds r0, r4, 0 - mov r1, r9 - mov r2, r8 - bl sub_812C184 - lsls r0, 24 - cmp r0, 0 - beq _0812C2E8 - ldr r0, =0x0203ab34 - ldr r0, [r0] - strh r7, [r0, 0x34] - strh r6, [r0, 0x2E] - movs r0, 0x1 - b _0812C390 - .pool -_0812C2E8: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _0812C2C2 -_0812C2F4: - movs r7, 0x1 - adds r6, r5, 0 - ldr r0, =0x0203ab34 - mov r10, r0 -_0812C2FC: - lsls r5, r7, 16 - cmp r6, 0 - bne _0812C30E - asrs r0, r5, 16 - bl sub_812C1C4 - lsls r0, 24 - cmp r0, 0 - bne _0812C380 -_0812C30E: - movs r0, 0x1 - asrs r4, r5, 16 - subs r0, r4 - lsls r0, 16 - asrs r0, 16 - mov r1, r9 - mov r2, r8 - bl sub_812C184 - lsls r0, 24 - cmp r0, 0 - beq _0812C380 - cmp r4, 0x1 - bne _0812C34C - cmp r6, 0 - bne _0812C33A - movs r0, 0x3 - bl sub_812C1C4 - lsls r0, 24 - cmp r0, 0 - bne _0812C34C -_0812C33A: - mov r0, r10 - ldr r1, [r0] - movs r0, 0x3 - strh r0, [r1, 0x34] - strh r0, [r1, 0x2E] - movs r0, 0x1 - b _0812C390 - .pool -_0812C34C: - asrs r0, r5, 16 - cmp r0, 0x3 - bgt _0812C374 - adds r4, r0, 0x1 - cmp r6, 0 - bne _0812C366 - lsls r0, r4, 16 - asrs r0, 16 - bl sub_812C1C4 - lsls r0, 24 - cmp r0, 0 - bne _0812C374 -_0812C366: - mov r0, r10 - ldr r1, [r0] - movs r0, 0x2 - strh r0, [r1, 0x34] - strh r4, [r1, 0x2E] - movs r0, 0x1 - b _0812C390 -_0812C374: - mov r0, r10 - ldr r1, [r0] - movs r0, 0x1 - strh r0, [r1, 0x34] - strh r7, [r1, 0x2E] - b _0812C390 -_0812C380: - movs r1, 0x80 - lsls r1, 9 - adds r0, r5, r1 - lsrs r7, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812C2FC - movs r0, 0 -_0812C390: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_812C290 - - thumb_func_start sub_812C3A0 -sub_812C3A0: @ 812C3A0 - push {lr} - ldr r1, =gUnknown_085A7514 - ldr r0, =0x0203ab34 - ldr r0, [r0] - movs r2, 0x12 - ldrsh r0, [r0, r2] - subs r0, 0x1 - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_812C3A0 - - thumb_func_start sub_812C3C8 -sub_812C3C8: @ 812C3C8 - push {r4-r7,lr} - ldr r0, =0x0203ab34 - ldr r0, [r0] - movs r5, 0 - ldrh r7, [r0, 0x34] - movs r1, 0x34 - ldrsh r6, [r0, r1] -_0812C3D6: - lsls r0, r5, 16 - asrs r4, r0, 16 - subs r1, r6, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - bl sub_812BC98 - ldr r1, =0x0203ab34 - ldr r1, [r1] - lsls r0, 24 - lsrs r0, 24 - ldrb r2, [r1, 0x7] - cmp r0, r2 - bne _0812C400 - strh r7, [r1, 0x36] - strh r5, [r1, 0x30] - movs r0, 0x1 - b _0812C40E - .pool -_0812C400: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812C3D6 - movs r0, 0 -_0812C40E: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_812C3C8 - - thumb_func_start sub_812C414 -sub_812C414: @ 812C414 - push {r4-r6,lr} - bl sub_812C3C8 - lsls r0, 24 - cmp r0, 0 - beq _0812C476 - ldr r0, =0x0203ab34 - ldr r1, [r0] - movs r2, 0x34 - ldrsh r0, [r1, r2] - cmp r0, 0x2 - beq _0812C472 - movs r2, 0x30 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - ble _0812C472 - cmp r0, 0x4 - beq _0812C472 - movs r5, 0 - movs r6, 0x2 -_0812C43C: - lsls r0, r5, 16 - asrs r4, r0, 16 - subs r1, r6, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - bl sub_812BC98 - ldr r1, =0x0203ab34 - ldr r1, [r1] - lsls r0, 24 - lsrs r0, 24 - ldrb r2, [r1, 0x7] - cmp r0, r2 - beq _0812C46C - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812C43C - b _0812C472 - .pool -_0812C46C: - movs r0, 0x2 - strh r0, [r1, 0x36] - strh r5, [r1, 0x30] -_0812C472: - movs r0, 0x1 - b _0812C4B2 -_0812C476: - ldr r0, =0x0203ab34 - ldr r0, [r0] - movs r1, 0x34 - ldrsh r0, [r0, r1] - cmp r0, 0x2 - beq _0812C4B0 - movs r5, 0 - movs r6, 0x2 -_0812C486: - lsls r0, r5, 16 - asrs r4, r0, 16 - subs r1, r6, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - bl sub_812BC98 - ldr r1, =0x0203ab34 - ldr r1, [r1] - lsls r0, 24 - lsrs r0, 24 - ldrb r2, [r1, 0x7] - cmp r0, r2 - beq _0812C46C - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812C486 -_0812C4B0: - movs r0, 0 -_0812C4B2: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812C414 - - thumb_func_start sub_812C4BC -sub_812C4BC: @ 812C4BC - push {r4,lr} - ldr r2, =0x0203ab34 - ldr r0, [r2] - ldrb r3, [r0, 0x7] - adds r4, r3, 0 - ldrb r1, [r0, 0x4] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0812C4D8 - movs r3, 0 - cmp r4, 0 - bne _0812C4D8 - movs r3, 0x1 -_0812C4D8: - ldr r1, =gUnknown_085A7520 - ldr r0, [r2] - movs r2, 0x12 - ldrsh r0, [r0, r2] - subs r0, 0x1 - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r3, 0 - bl _call_via_r1 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812C4BC - - thumb_func_start sub_812C500 -sub_812C500: @ 812C500 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x0203ab34 - ldr r0, [r0] - movs r5, 0 - ldrh r1, [r0, 0x36] - mov r8, r1 - movs r1, 0x36 - ldrsh r6, [r0, r1] -_0812C518: - lsls r0, r5, 16 - asrs r4, r0, 16 - subs r1, r6, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x2 - bl sub_812BC98 - lsls r0, 24 - lsrs r0, 24 - cmp r0, r7 - bne _0812C544 - ldr r0, =0x0203ab34 - ldr r0, [r0] - mov r1, r8 - strh r1, [r0, 0x38] - strh r5, [r0, 0x32] - movs r0, 0x1 - b _0812C552 - .pool -_0812C544: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812C518 - movs r0, 0 -_0812C552: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_812C500 - - thumb_func_start sub_812C55C -sub_812C55C: @ 812C55C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x0203ab34 - ldr r0, [r0] - movs r2, 0x34 - ldrsh r1, [r0, r2] - movs r2, 0x36 - ldrsh r0, [r0, r2] - cmp r1, r0 - bne _0812C59C - adds r0, r6, 0 - bl sub_812C500 - lsls r0, 24 - lsrs r0, 24 - b _0812C5D2 - .pool -_0812C588: - ldr r0, =0x0203ab34 - ldr r0, [r0] - strh r5, [r0, 0x32] - mov r1, r8 - strh r1, [r0, 0x38] - movs r0, 0x1 - b _0812C5D2 - .pool -_0812C59C: - movs r2, 0x1 - mov r8, r2 - cmp r1, 0x1 - bne _0812C5A8 - movs r0, 0x3 - mov r8, r0 -_0812C5A8: - movs r5, 0 - mov r7, r8 -_0812C5AC: - lsls r0, r5, 16 - asrs r4, r0, 16 - subs r1, r7, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x2 - bl sub_812BC98 - lsls r0, 24 - lsrs r0, 24 - cmp r0, r6 - beq _0812C588 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812C5AC - movs r0, 0 -_0812C5D2: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_812C55C - - thumb_func_start sub_812C5DC -sub_812C5DC: @ 812C5DC - push {r4,r5,lr} - movs r5, 0 - b _0812C5E8 -_0812C5E2: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_0812C5E8: - lsls r0, r5, 16 - asrs r4, r0, 16 - adds r0, r4, 0 - bl sub_812C1C4 - lsls r0, 24 - cmp r0, 0 - bne _0812C5E2 - ldr r0, =0x0203ab34 - ldr r0, [r0] - strh r5, [r0, 0x2E] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812C5DC - - thumb_func_start sub_812C608 -sub_812C608: @ 812C608 - push {lr} - adds r1, r0, 0 - ldrb r0, [r1] - cmp r0, 0 - bne _0812C616 - movs r0, 0x1 - b _0812C620 -_0812C616: - cmp r0, 0x1 - beq _0812C61E - movs r0, 0 - b _0812C624 -_0812C61E: - movs r0, 0 -_0812C620: - strb r0, [r1] - movs r0, 0x1 -_0812C624: - pop {r1} - bx r1 - thumb_func_end sub_812C608 - - thumb_func_start sub_812C628 -sub_812C628: @ 812C628 - push {lr} - ldr r1, =gUnknown_085A752C - ldr r0, =0x0203ab34 - ldr r0, [r0] - movs r2, 0x12 - ldrsh r0, [r0, r2] - subs r0, 0x1 - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_812C628 - - thumb_func_start sub_812C64C -sub_812C64C: @ 812C64C - push {r4-r7,lr} - sub sp, 0x4 - ldr r0, =0x0203ab34 - ldr r2, [r0] - movs r1, 0x34 - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _0812C6C4 - ldrb r1, [r2, 0x4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0812C6C4 - ldrh r0, [r2, 0x2E] - movs r1, 0x2 - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - mov r1, sp - strb r0, [r1] - mov r0, sp - bl sub_812C608 - lsls r0, 24 - cmp r0, 0 - beq _0812C6C4 - movs r5, 0 - mov r6, sp - movs r7, 0x2 -_0812C68C: - lsls r0, r5, 16 - asrs r4, r0, 16 - subs r1, r7, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - bl sub_812BC98 - ldrb r1, [r6] - lsls r0, 24 - lsrs r0, 24 - cmp r1, r0 - bne _0812C6B8 - ldr r0, =0x0203ab34 - ldr r1, [r0] - movs r0, 0x2 - strh r0, [r1, 0x36] - strh r5, [r1, 0x30] - b _0812C6C4 - .pool -_0812C6B8: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812C68C -_0812C6C4: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_812C64C - - thumb_func_start j5_08111E84 -j5_08111E84: @ 812C6CC - push {r4-r7,lr} - sub sp, 0x4 - ldr r4, =0x0203ab34 - ldr r2, [r4] - ldrh r3, [r2, 0x34] - movs r1, 0x34 - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _0812C744 - ldrb r1, [r2, 0x4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0812C744 - ldrh r1, [r2, 0x2E] - subs r1, r3, r1 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - mov r1, sp - strb r0, [r1] - mov r0, sp - bl sub_812C608 - lsls r0, 24 - cmp r0, 0 - beq _0812C744 - movs r5, 0 - mov r7, sp - adds r6, r4, 0 -_0812C70C: - ldr r0, [r6] - ldrh r1, [r0, 0x34] - lsls r0, r5, 16 - asrs r4, r0, 16 - subs r1, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - bl sub_812BC98 - ldrb r1, [r7] - lsls r0, 24 - lsrs r0, 24 - cmp r1, r0 - bne _0812C738 - ldr r0, [r6] - ldrh r1, [r0, 0x34] - strh r1, [r0, 0x36] - strh r5, [r0, 0x30] - b _0812C744 - .pool -_0812C738: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812C70C -_0812C744: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end j5_08111E84 - - thumb_func_start sub_812C74C -sub_812C74C: @ 812C74C - push {r4-r7,lr} - sub sp, 0x4 - ldr r6, =0x0203ab34 - ldr r2, [r6] - ldrh r4, [r2, 0x34] - movs r0, 0x34 - ldrsh r3, [r2, r0] - cmp r3, 0 - beq _0812C84A - ldrb r1, [r2, 0x4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0812C84A - cmp r3, 0x2 - bne _0812C796 - bl j5_08111E84 - b _0812C84A - .pool -_0812C778: - ldr r0, =0x0203ab34 - ldr r0, [r0] - movs r1, 0 - strh r5, [r0, 0x36] - strh r1, [r0, 0x30] - b _0812C84A - .pool -_0812C788: - movs r0, 0x2 - strh r0, [r1, 0x36] - adds r0, r4, 0x1 - strh r0, [r1, 0x30] - b _0812C84A -_0812C792: - movs r0, 0x3 - b _0812C824 -_0812C796: - ldrh r1, [r2, 0x2E] - subs r1, r4, r1 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - mov r1, sp - strb r0, [r1] - mov r0, sp - bl sub_812C608 - lsls r0, 24 - cmp r0, 0 - beq _0812C84A - movs r5, 0x2 - ldr r0, [r6] - movs r1, 0x34 - ldrsh r0, [r0, r1] - cmp r0, 0x3 - bne _0812C7C2 - movs r5, 0x3 -_0812C7C2: - movs r6, 0 - mov r7, sp -_0812C7C6: - lsls r0, r5, 16 - asrs r4, r0, 16 - movs r0, 0x1 - adds r1, r4, 0 - bl sub_812BC98 - ldrb r1, [r7] - lsls r0, 24 - lsrs r0, 24 - cmp r1, r0 - beq _0812C778 - lsls r1, r6, 16 - movs r2, 0x80 - lsls r2, 9 - adds r1, r2 - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - lsrs r6, r1, 16 - asrs r1, 16 - cmp r1, 0x1 - ble _0812C7C6 - movs r5, 0x1 - mov r7, sp - ldr r6, =0x0203ab34 -_0812C7F8: - ldr r0, [r6] - ldrh r1, [r0, 0x34] - lsls r0, r5, 16 - asrs r4, r0, 16 - subs r1, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - bl sub_812BC98 - ldrb r1, [r7] - lsls r0, 24 - lsrs r0, 24 - cmp r1, r0 - bne _0812C83E - ldr r1, [r6] - movs r2, 0x34 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - bne _0812C830 - cmp r4, 0x2 - ble _0812C788 -_0812C824: - strh r0, [r1, 0x36] - strh r5, [r1, 0x30] - b _0812C84A - .pool -_0812C830: - cmp r4, 0x2 - ble _0812C792 - movs r0, 0x2 - strh r0, [r1, 0x36] - subs r0, r4, 0x1 - strh r0, [r1, 0x30] - b _0812C84A -_0812C83E: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812C7F8 -_0812C84A: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_812C74C - - thumb_func_start sub_812C854 -sub_812C854: @ 812C854 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - adds r2, r1, 0 - cmp r0, 0 - bne _0812C868 - cmp r1, 0x1 - beq _0812C870 -_0812C868: - cmp r0, 0x1 - bne _0812C874 - cmp r2, 0 - bne _0812C874 -_0812C870: - movs r0, 0x1 - b _0812C876 -_0812C874: - movs r0, 0 -_0812C876: - pop {r1} - bx r1 - thumb_func_end sub_812C854 - - thumb_func_start sub_812C87C -sub_812C87C: @ 812C87C - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - cmp r0, 0 - bne _0812C896 - cmp r1, 0x1 - bne _0812C896 - cmp r2, 0 - beq _0812C8A2 -_0812C896: - cmp r0, 0x1 - bne _0812C8A6 - cmp r1, 0 - bne _0812C8A6 - cmp r2, 0x1 - bne _0812C8A6 -_0812C8A2: - movs r0, 0x1 - b _0812C8A8 -_0812C8A6: - movs r0, 0 -_0812C8A8: - pop {r1} - bx r1 - thumb_func_end sub_812C87C - - thumb_func_start sub_812C8AC -sub_812C8AC: @ 812C8AC - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - cmp r0, 0 - bne _0812C8C6 - cmp r1, 0x1 - bne _0812C8C6 - cmp r2, 0 - beq _0812C8F2 -_0812C8C6: - cmp r0, 0x1 - bne _0812C8D2 - cmp r1, 0 - bne _0812C8D2 - cmp r2, 0x1 - beq _0812C8F2 -_0812C8D2: - cmp r0, 0 - bne _0812C8DE - cmp r1, 0 - bne _0812C8DE - cmp r2, 0x1 - beq _0812C8F2 -_0812C8DE: - cmp r0, 0x1 - bne _0812C8EA - cmp r1, 0x1 - bne _0812C8EA - cmp r2, 0 - beq _0812C8F2 -_0812C8EA: - cmp r0, r1 - bne _0812C8F6 - cmp r0, r2 - bne _0812C8F6 -_0812C8F2: - movs r0, 0 - b _0812C8F8 -_0812C8F6: - movs r0, 0x1 -_0812C8F8: - pop {r1} - bx r1 - thumb_func_end sub_812C8AC - - thumb_func_start sub_812C8FC -sub_812C8FC: @ 812C8FC - push {lr} - ldr r1, =gUnknown_085A7538 - ldr r0, =0x0203ab34 - ldr r0, [r0] - movs r2, 0x12 - ldrsh r0, [r0, r2] - subs r0, 0x1 - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_812C8FC - - thumb_func_start sub_812C920 -sub_812C920: @ 812C920 - push {r4-r7,lr} - movs r6, 0 - ldr r7, =0x0203ab34 - ldr r0, [r7] - ldrh r1, [r0, 0x2E] - movs r4, 0x2 - subs r1, r4, r1 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r7] - ldrh r0, [r0, 0x30] - subs r4, r0 - lsls r4, 16 - asrs r4, 16 - movs r0, 0x1 - adds r1, r4, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r5, r1 - bne _0812C994 - movs r4, 0x2 - b _0812C96A - .pool -_0812C960: - lsls r0, r6, 16 - movs r1, 0x80 - lsls r1, 9 - adds r0, r1 - lsrs r6, r0, 16 -_0812C96A: - lsls r1, r6, 16 - asrs r1, 16 - subs r1, r4, r1 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x2 - bl sub_812BC98 - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - beq _0812C960 - cmp r5, 0 - bne _0812C98A - cmp r0, 0x1 - beq _0812C960 -_0812C98A: - cmp r5, 0x1 - bne _0812C9F6 - cmp r0, 0 - beq _0812C960 - b _0812C9F6 -_0812C994: - adds r0, r5, 0 - bl sub_812C854 - lsls r0, 24 - cmp r0, 0 - beq _0812C9F6 - ldr r0, [r7] - ldrb r1, [r0, 0x4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0812C9D2 - movs r7, 0x2 -_0812C9AE: - lsls r0, r6, 16 - asrs r4, r0, 16 - subs r1, r7, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x2 - bl sub_812BC98 - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - beq _0812C9F6 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812C9AE -_0812C9D2: - movs r6, 0 - movs r7, 0x2 - b _0812C9DE -_0812C9D8: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 -_0812C9DE: - lsls r0, r6, 16 - asrs r4, r0, 16 - subs r1, r7, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x2 - bl sub_812BC98 - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - beq _0812C9D8 -_0812C9F6: - ldr r0, =0x0203ab34 - ldr r0, [r0] - strh r6, [r0, 0x32] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812C920 - - thumb_func_start sub_812CA08 -sub_812CA08: @ 812CA08 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r0, 0 - str r0, [sp] - ldr r4, =0x0203ab34 - ldr r2, [r4] - movs r5, 0x36 - ldrsh r1, [r2, r5] - cmp r1, 0 - beq _0812CAA4 - ldrh r3, [r2, 0x34] - movs r5, 0x34 - ldrsh r0, [r2, r5] - cmp r0, r1 - bne _0812CAA4 - ldrb r1, [r2, 0x4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0812CAA4 - ldrh r1, [r2, 0x2E] - subs r1, r3, r1 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, [r4] - ldrh r1, [r0, 0x36] - ldrh r0, [r0, 0x30] - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - bl sub_812BC98 - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r7, 0 - adds r1, r6, 0 - bl sub_812C854 - lsls r0, 24 - cmp r0, 0 - beq _0812CAA4 - movs r5, 0 - b _0812CA7E - .pool -_0812CA78: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_0812CA7E: - lsls r6, r5, 16 - asrs r5, r6, 16 - cmp r5, 0x4 - bgt _0812CAA4 - ldr r0, =0x0203ab34 - ldr r0, [r0] - ldrh r1, [r0, 0x36] - subs r1, r5 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x2 - bl sub_812BC98 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r7, r4 - bne _0812CA78 - lsrs r6, 16 - str r6, [sp] -_0812CAA4: - ldr r0, =0x0203ab34 - mov r9, r0 -_0812CAA8: - movs r5, 0x1 - movs r1, 0 - mov r8, r1 - ldr r2, [sp] - lsls r2, 16 - mov r10, r2 -_0812CAB4: - mov r1, r9 - ldr r0, [r1] - ldrh r1, [r0, 0x2E] - lsls r5, 16 - asrs r4, r5, 16 - subs r1, r4, r1 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r7, r0, 24 - mov r2, r9 - ldr r0, [r2] - ldrh r1, [r0, 0x30] - subs r1, r4, r1 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - bl sub_812BC98 - lsls r0, 24 - lsrs r6, r0, 24 - mov r1, r10 - asrs r0, r1, 16 - subs r4, r0 - lsls r4, 16 - asrs r4, 16 - movs r0, 0x2 - adds r1, r4, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_812C8AC - lsls r0, 24 - cmp r0, 0 - bne _0812CB3C - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_812C87C - lsls r0, 24 - cmp r0, 0 - beq _0812CB28 - mov r2, r9 - ldr r0, [r2] - ldrb r1, [r0, 0x4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0812CB3C -_0812CB28: - mov r5, r8 - lsls r0, r5, 16 - movs r1, 0x80 - lsls r1, 9 - adds r0, r1 - lsrs r0, 16 - mov r8, r0 - b _0812CB4A - .pool -_0812CB3C: - movs r2, 0x80 - lsls r2, 9 - adds r0, r5, r2 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _0812CAB4 -_0812CB4A: - mov r5, r8 - cmp r5, 0 - beq _0812CB60 - ldr r1, [sp] - lsls r0, r1, 16 - movs r2, 0x80 - lsls r2, 9 - adds r0, r2 - lsrs r0, 16 - str r0, [sp] - b _0812CAA8 -_0812CB60: - ldr r0, =0x0203ab34 - ldr r0, [r0] - mov r5, sp - ldrh r5, [r5] - strh r5, [r0, 0x32] - 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_812CA08 - - thumb_func_start sub_812CB80 -sub_812CB80: @ 812CB80 - push {r4-r7,lr} - mov r7, r8 - push {r7} - bl sub_812CA08 - ldr r4, =0x0203ab34 - ldr r2, [r4] - movs r0, 0x36 - ldrsh r1, [r2, r0] - cmp r1, 0 - beq _0812CC34 - ldrh r3, [r2, 0x34] - movs r5, 0x34 - ldrsh r0, [r2, r5] - cmp r0, r1 - beq _0812CC34 - ldrb r1, [r2, 0x4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0812CC34 - ldrh r1, [r2, 0x2E] - subs r1, r3, r1 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, [r4] - ldrh r1, [r0, 0x36] - ldrh r0, [r0, 0x30] - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - bl sub_812BC98 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_812C854 - lsls r0, 24 - cmp r0, 0 - beq _0812CC34 - movs r1, 0x1 - ldr r0, [r4] - movs r2, 0x34 - ldrsh r0, [r0, r2] - cmp r0, 0x1 - bne _0812CBEE - movs r1, 0x3 -_0812CBEE: - movs r3, 0 - lsls r1, 16 - mov r8, r1 - adds r7, r4, 0 -_0812CBF6: - ldr r0, [r7] - ldrh r2, [r0, 0x32] - lsls r0, r3, 16 - asrs r5, r0, 16 - adds r2, r5, r2 - mov r0, r8 - asrs r1, r0, 16 - subs r1, r2 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x2 - bl sub_812BC98 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r6, r4 - bne _0812CC28 - ldr r1, [r7] - ldrh r0, [r1, 0x32] - adds r0, r5, r0 - strh r0, [r1, 0x32] - b _0812CC34 - .pool -_0812CC28: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812CBF6 -_0812CC34: - ldr r7, =0x0203ab34 -_0812CC36: - ldr r0, [r7] - ldrh r0, [r0, 0x2E] - movs r1, 0x1 - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, [r7] - ldrh r0, [r0, 0x30] - movs r1, 0x2 - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - bl sub_812BC98 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r7] - ldrh r0, [r0, 0x32] - movs r1, 0x3 - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x2 - bl sub_812BC98 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_812C8AC - lsls r0, 24 - cmp r0, 0 - bne _0812CCB4 - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_812C87C - lsls r0, 24 - cmp r0, 0 - beq _0812CCA4 - ldr r0, [r7] - ldrb r1, [r0, 0x4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0812CCB4 -_0812CCA4: - ldr r1, [r7] - ldrh r0, [r1, 0x32] - adds r0, 0x1 - strh r0, [r1, 0x32] - b _0812CC36 - .pool -_0812CCB4: - ldr r7, =0x0203ab34 -_0812CCB6: - ldr r0, [r7] - ldrh r0, [r0, 0x2E] - movs r1, 0x3 - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, [r7] - ldrh r0, [r0, 0x30] - movs r1, 0x2 - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - bl sub_812BC98 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r7] - ldrh r0, [r0, 0x32] - movs r1, 0x1 - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x2 - bl sub_812BC98 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_812C8AC - lsls r0, 24 - cmp r0, 0 - bne _0812CD34 - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_812C87C - lsls r0, 24 - cmp r0, 0 - beq _0812CD24 - ldr r0, [r7] - ldrb r1, [r0, 0x4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0812CD34 -_0812CD24: - ldr r1, [r7] - ldrh r0, [r1, 0x32] - adds r0, 0x1 - strh r0, [r1, 0x32] - b _0812CCB6 - .pool -_0812CD34: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_812CB80 - - thumb_func_start sub_812CD40 -sub_812CD40: @ 812CD40 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =sub_812CD74 - adds r0, r5, 0 - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x26] - bl _call_via_r5 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812CD40 - - thumb_func_start sub_812CD74 -sub_812CD74: @ 812CD74 - push {r4,lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_085A7544 - ldr r2, =0x03005e00 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r4, 0x8 - ldrsh r2, [r0, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812CD74 - - thumb_func_start sub_812CDA4 -sub_812CDA4: @ 812CDA4 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldr r1, =gUnknown_085A7550 - movs r2, 0x26 - ldrsh r0, [r4, r2] - lsls r0, 1 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - movs r1, 0x73 - str r1, [sp] - movs r1, 0x62 - movs r2, 0x63 - movs r3, 0x72 - bl sub_812FA78 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812CDA4 - - thumb_func_start sub_812CDD8 -sub_812CDD8: @ 812CDD8 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB - ble _0812CDF0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_0812CDF0: - pop {r0} - bx r0 - thumb_func_end sub_812CDD8 - - thumb_func_start sub_812CDF4 -sub_812CDF4: @ 812CDF4 - push {r4,lr} - sub sp, 0x4 - lsls r4, r1, 24 - lsrs r4, 24 - ldr r1, =gUnknown_085A7550 - movs r2, 0x26 - ldrsh r0, [r0, r2] - lsls r0, 1 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - movs r1, 0x53 - str r1, [sp] - movs r1, 0x42 - movs r2, 0x43 - movs r3, 0x52 - bl sub_812FA78 - adds r0, r4, 0 - bl DestroyTask - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812CDF4 - - thumb_func_start sub_812CE2C -sub_812CE2C: @ 812CE2C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_085A8408 - lsls r1, r0, 2 - adds r1, r2 - ldr r2, [r1] - ldr r1, =gUnknown_085A8430 - adds r0, r1 - ldrb r1, [r0] - adds r0, r2, 0 - movs r2, 0x2 - bl gpu_pal_apply - pop {r0} - bx r0 - .pool - thumb_func_end sub_812CE2C - - thumb_func_start sub_812CE54 -sub_812CE54: @ 812CE54 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_085A841C - lsls r1, r0, 2 - adds r1, r2 - ldr r2, [r1] - ldr r1, =gUnknown_085A8430 - adds r0, r1 - ldrb r1, [r0] - adds r0, r2, 0 - movs r2, 0x2 - bl gpu_pal_apply - pop {r0} - bx r0 - .pool - thumb_func_end sub_812CE54 - - thumb_func_start sub_812CE7C -sub_812CE7C: @ 812CE7C - push {r4-r7,lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r4, 0 - ldr r0, =gUnknown_085A843B - adds r0, r1, r0 - ldrb r0, [r0] - cmp r4, r0 - bcs _0812CEA8 - ldr r7, =gUnknown_085A8435 - adds r6, r0, 0 - lsls r5, r1, 1 -_0812CE94: - adds r0, r4, r5 - adds r0, r7 - ldrb r0, [r0] - bl sub_812CE2C - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r6 - bcc _0812CE94 -_0812CEA8: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812CE7C - - thumb_func_start sub_812CEB8 -sub_812CEB8: @ 812CEB8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r4, 0 - ldr r0, =gUnknown_085A843B - adds r0, r1, r0 - ldrb r0, [r0] - cmp r4, r0 - bcs _0812CEE4 - ldr r7, =gUnknown_085A8435 - adds r6, r0, 0 - lsls r5, r1, 1 -_0812CED0: - adds r0, r4, r5 - adds r0, r7 - ldrb r0, [r0] - bl sub_812CE54 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r6 - bcc _0812CED0 -_0812CEE4: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812CEB8 - - thumb_func_start sub_812CEF4 -sub_812CEF4: @ 812CEF4 - push {r4,r5,lr} - movs r4, 0 - ldr r5, =0x02020630 -_0812CEFA: - ldr r0, =sub_812D024 - bl obj_add_empty_with_callback - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - strh r4, [r1, 0x2E] - ldr r1, =0x0203ab34 - ldr r1, [r1] - adds r1, 0x44 - adds r1, r4 - strb r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _0812CEFA - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812CEF4 - - thumb_func_start sub_812CF34 -sub_812CF34: @ 812CF34 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0203ab34 - ldr r1, [r1] - adds r1, 0x44 - adds r1, r0 - ldrb r1, [r1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r2, 0 - movs r1, 0x1 - strh r1, [r0, 0x30] - movs r1, 0x4 - strh r1, [r0, 0x32] - strh r2, [r0, 0x34] - strh r2, [r0, 0x36] - movs r1, 0x2 - strh r1, [r0, 0x38] - strh r2, [r0, 0x3C] - bx lr - .pool - thumb_func_end sub_812CF34 - - thumb_func_start sub_812CF6C -sub_812CF6C: @ 812CF6C - push {r4,r5,lr} - movs r2, 0 - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r3, r0, 0 - adds r3, 0x44 - ldr r4, =0x02020630 -_0812CF7A: - adds r0, r3, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r4 - movs r5, 0x30 - ldrsh r0, [r1, r5] - cmp r0, 0 - beq _0812CFA4 - movs r5, 0x32 - ldrsh r0, [r1, r5] - cmp r0, 0 - beq _0812CFA4 - movs r0, 0 - b _0812CFB0 - .pool -_0812CFA4: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x4 - bls _0812CF7A - movs r0, 0x1 -_0812CFB0: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_812CF6C - - thumb_func_start sub_812CFB8 -sub_812CFB8: @ 812CFB8 - push {r4,lr} - movs r4, 0 -_0812CFBC: - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x44 - adds r0, r4 - ldrb r0, [r0] - bl sub_812CFEC - lsls r0, 24 - cmp r0, 0 - bne _0812CFD8 - movs r0, 0 - b _0812CFE4 - .pool -_0812CFD8: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _0812CFBC - movs r0, 0x1 -_0812CFE4: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_812CFB8 - - thumb_func_start sub_812CFEC -sub_812CFEC: @ 812CFEC - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - movs r2, 0x30 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _0812D00C - movs r0, 0x1 - b _0812D01E - .pool -_0812D00C: - ldrh r2, [r1, 0x3C] - movs r3, 0x3C - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _0812D01A - movs r0, 0 - strh r0, [r1, 0x30] -_0812D01A: - lsls r0, r2, 24 - lsrs r0, 24 -_0812D01E: - pop {r1} - bx r1 - thumb_func_end sub_812CFEC - - thumb_func_start sub_812D024 -sub_812D024: @ 812D024 - push {r4-r7,lr} - adds r2, r0, 0 - movs r1, 0x30 - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _0812D0A6 - ldrh r0, [r2, 0x34] - subs r0, 0x1 - strh r0, [r2, 0x34] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0812D08E - movs r0, 0 - strh r0, [r2, 0x3C] - movs r6, 0x1 - strh r6, [r2, 0x34] - ldrh r1, [r2, 0x38] - ldrh r3, [r2, 0x36] - adds r0, r1, r3 - strh r0, [r2, 0x36] - movs r4, 0x4 - ldrh r5, [r2, 0x32] - movs r7, 0x32 - ldrsh r3, [r2, r7] - cmp r3, 0 - beq _0812D060 - movs r4, 0x8 -_0812D060: - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bgt _0812D078 - strh r6, [r2, 0x3C] - negs r0, r1 - strh r0, [r2, 0x38] - cmp r3, 0 - beq _0812D08E - subs r0, r5, 0x1 - strh r0, [r2, 0x32] - b _0812D080 -_0812D078: - cmp r0, r4 - blt _0812D080 - negs r0, r1 - strh r0, [r2, 0x38] -_0812D080: - movs r1, 0x32 - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _0812D08E - ldrh r0, [r2, 0x34] - lsls r0, 1 - strh r0, [r2, 0x34] -_0812D08E: - ldr r1, =gUnknown_085A8430 - movs r3, 0x2E - ldrsh r0, [r2, r3] - adds r0, r1 - ldrb r0, [r0] - ldrh r3, [r2, 0x36] - lsls r3, 24 - lsrs r3, 24 - adds r1, r3, 0 - adds r2, r3, 0 - bl sub_80B6128 -_0812D0A6: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D024 - - thumb_func_start sub_812D0B0 -sub_812D0B0: @ 812D0B0 - push {r4,lr} - ldr r4, =sub_812D128 - adds r0, r4, 0 - movs r1, 0x6 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0x1 - strh r2, [r1, 0xE] - bl _call_via_r4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D0B0 - - thumb_func_start sub_812D0E0 -sub_812D0E0: @ 812D0E0 - push {lr} - ldr r0, =sub_812D128 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r1, 0xC - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _0812D10C - movs r0, 0 - b _0812D120 - .pool -_0812D10C: - adds r0, r2, 0 - bl DestroyTask - ldr r0, =gUnknown_085A84AC - ldr r0, [r0] - movs r1, 0x10 - movs r2, 0x20 - bl gpu_pal_apply - movs r0, 0x1 -_0812D120: - pop {r1} - bx r1 - .pool - thumb_func_end sub_812D0E0 - - thumb_func_start sub_812D128 -sub_812D128: @ 812D128 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r2, r1, r0 - ldrh r0, [r2, 0xA] - subs r0, 0x1 - strh r0, [r2, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0812D166 - movs r0, 0x4 - strh r0, [r2, 0xA] - ldrh r1, [r2, 0xE] - ldrh r3, [r2, 0xC] - adds r0, r1, r3 - strh r0, [r2, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - beq _0812D162 - cmp r0, 0x2 - bne _0812D166 -_0812D162: - negs r0, r1 - strh r0, [r2, 0xE] -_0812D166: - ldr r0, =gUnknown_085A84A0 - movs r3, 0xC - ldrsh r1, [r2, r3] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - movs r1, 0x10 - movs r2, 0x20 - bl gpu_pal_apply - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D128 - - thumb_func_start sub_812D188 -sub_812D188: @ 812D188 - push {lr} - ldr r0, =sub_812D230 - movs r1, 0x8 - bl CreateTask - ldr r1, =0x0203ab34 - ldr r1, [r1] - adds r1, 0x3E - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D188 - - thumb_func_start sub_812D1A8 -sub_812D1A8: @ 812D1A8 - push {r4,lr} - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x3E - ldrb r0, [r0] - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - adds r0, r4, 0 - bl sub_812D394 - movs r1, 0x1 - strh r1, [r4, 0x8] - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - strh r1, [r4, 0x26] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D1A8 - - thumb_func_start sub_812D1DC -sub_812D1DC: @ 812D1DC - push {r4,lr} - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x3E - ldrb r0, [r0] - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - adds r0, r4, 0 - bl sub_812D394 - movs r0, 0x3 - strh r0, [r4, 0x8] - movs r0, 0x1 - strh r0, [r4, 0x26] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D1DC - - thumb_func_start sub_812D20C -sub_812D20C: @ 812D20C - ldr r2, =0x03005e00 - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x3E - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r0, [r0, 0x26] - lsls r0, 24 - lsrs r0, 24 - bx lr - .pool - thumb_func_end sub_812D20C - - thumb_func_start sub_812D230 -sub_812D230: @ 812D230 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_085A7558 - ldr r2, =0x03005e00 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D230 - - thumb_func_start nullsub_50 -nullsub_50: @ 812D260 - bx lr - thumb_func_end nullsub_50 - - thumb_func_start sub_812D264 -sub_812D264: @ 812D264 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0xA] - lsls r0, 19 - movs r1, 0xA0 - lsls r1, 13 - adds r0, r1 - asrs r0, 16 - movs r1, 0x14 - bl sub_812EF00 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812D264 - - thumb_func_start sub_812D28C -sub_812D28C: @ 812D28C - push {r4,r5,lr} - adds r4, r0, 0 - ldr r2, =0x02020630 - movs r0, 0xC - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3C - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _0812D2FC - ldrh r1, [r4, 0xA] - adds r0, r1, 0x2 - lsls r0, 16 - lsrs r5, r0, 16 - movs r3, 0 - movs r2, 0 - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x1 - bne _0812D2C4 - movs r3, 0x1 - movs r2, 0x1 - b _0812D2CC - .pool -_0812D2C4: - cmp r1, 0x10 - bne _0812D2CC - movs r3, 0x2 - movs r2, 0x2 -_0812D2CC: - ldr r0, =0x0203aacc - ldr r0, [r0] - lsls r1, r2, 1 - adds r1, r0 - ldr r2, =gUnknown_085A7568 - lsls r0, r3, 2 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - lsls r3, r5, 16 - movs r0, 0x80 - lsls r0, 15 - adds r3, r0 - lsrs r3, 16 - movs r0, 0x2 - movs r2, 0x2 - bl LoadBgTilemap - ldrb r0, [r4, 0xC] - bl sub_812EF6C - movs r0, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0x26] -_0812D2FC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D28C - - thumb_func_start sub_812D30C -sub_812D30C: @ 812D30C - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0xA] - adds r0, r1, 0x2 - lsls r0, 16 - lsrs r5, r0, 16 - movs r3, 0 - movs r2, 0x3 - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x1 - bne _0812D32A - movs r3, 0x1 - movs r2, 0x1 - b _0812D332 -_0812D32A: - cmp r1, 0x10 - bne _0812D332 - movs r3, 0x2 - movs r2, 0x2 -_0812D332: - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0812D366 - ldr r0, =0x0203aacc - ldr r0, [r0] - lsls r1, r2, 1 - adds r1, r0 - ldr r0, =gUnknown_085A7568 - lsls r2, r3, 2 - adds r0, 0x2 - adds r2, r0 - ldrh r0, [r2] - strh r0, [r1] - lsls r3, r5, 16 - movs r0, 0x80 - lsls r0, 15 - adds r3, r0 - lsrs r3, 16 - movs r0, 0x2 - movs r2, 0x2 - bl LoadBgTilemap - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] -_0812D366: - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _0812D378 - movs r0, 0 - strh r0, [r4, 0xC] -_0812D378: - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0812D384 - strh r0, [r4, 0x8] - strh r0, [r4, 0x26] -_0812D384: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D30C - - thumb_func_start sub_812D394 -sub_812D394: @ 812D394 - push {lr} - movs r1, 0x2 - adds r2, r0, 0 - adds r2, 0x8 - movs r3, 0 -_0812D39E: - lsls r0, r1, 1 - adds r0, r2, r0 - strh r3, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bls _0812D39E - pop {r0} - bx r0 - thumb_func_end sub_812D394 - - thumb_func_start sub_812D3B4 -sub_812D3B4: @ 812D3B4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0x3 - movs r5, 0 - cmp r5, r6 - bge _0812D41E - ldr r7, =gUnknown_085A7568 -_0812D3C4: - movs r3, 0 - movs r1, 0 - lsls r0, r5, 16 - asrs r0, 16 - cmp r0, 0 - bne _0812D3DC - movs r3, 0x1 - movs r1, 0x1 - b _0812D3E4 - .pool -_0812D3DC: - cmp r0, 0xF - bne _0812D3E4 - movs r3, 0x2 - movs r1, 0x2 -_0812D3E4: - ldr r0, =0x0203aacc - ldr r0, [r0] - lsls r1, 1 - adds r1, r0 - lsls r0, r3, 2 - adds r0, r7 - ldrh r0, [r0] - strh r0, [r1] - lsls r3, r4, 16 - asrs r4, r3, 16 - movs r0, 0x80 - lsls r0, 15 - adds r3, r0 - lsrs r3, 16 - movs r0, 0x2 - movs r2, 0x2 - bl LoadBgTilemap - lsls r0, r5, 16 - movs r1, 0x80 - lsls r1, 9 - adds r0, r1 - adds r4, 0x1 - lsls r4, 16 - lsrs r4, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, r6 - blt _0812D3C4 -_0812D41E: - lsls r2, r5, 16 - asrs r0, r2, 16 - cmp r0, 0xF - bgt _0812D484 - ldr r7, =gUnknown_085A756A -_0812D428: - movs r3, 0 - movs r1, 0x3 - asrs r0, r2, 16 - cmp r0, 0 - bne _0812D440 - movs r3, 0x1 - movs r1, 0x1 - b _0812D448 - .pool -_0812D440: - cmp r0, 0xF - bne _0812D448 - movs r3, 0x2 - movs r1, 0x2 -_0812D448: - ldr r0, =0x0203aacc - ldr r0, [r0] - lsls r1, 1 - adds r1, r0 - lsls r0, r3, 2 - adds r0, r7 - ldrh r0, [r0] - strh r0, [r1] - lsls r3, r4, 16 - asrs r4, r3, 16 - movs r0, 0x80 - lsls r0, 15 - adds r3, r0 - lsrs r3, 16 - movs r0, 0x2 - movs r2, 0x2 - bl LoadBgTilemap - lsls r0, r5, 16 - movs r1, 0x80 - lsls r1, 9 - adds r0, r1 - lsrs r5, r0, 16 - adds r4, 0x1 - lsls r4, 16 - lsrs r4, 16 - lsls r2, r5, 16 - asrs r0, r2, 16 - cmp r0, 0xF - ble _0812D428 -_0812D484: - ldr r2, =0x03005e00 - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x3E - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - strh r6, [r0, 0xA] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D3B4 - - thumb_func_start sub_812D4AC -sub_812D4AC: @ 812D4AC - push {r4,lr} - ldr r4, =sub_812D4EC - adds r0, r4, 0 - movs r1, 0x7 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D4AC - - thumb_func_start sub_812D4CC -sub_812D4CC: @ 812D4CC - push {lr} - ldr r0, =sub_812D4EC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _0812D4E4 - movs r0, 0 - b _0812D4E6 - .pool -_0812D4E4: - movs r0, 0x1 -_0812D4E6: - pop {r1} - bx r1 - thumb_func_end sub_812D4CC - - thumb_func_start sub_812D4EC -sub_812D4EC: @ 812D4EC - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_085A7574 - ldr r2, =0x03005e00 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D4EC - - thumb_func_start sub_812D51C -sub_812D51C: @ 812D51C - push {lr} - ldr r3, =0x0203ab34 - ldr r1, [r3] - movs r2, 0 - strb r2, [r1, 0xA] - ldr r1, [r3] - strh r2, [r1, 0x14] - strh r2, [r1, 0x16] - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - strh r2, [r0, 0xA] - movs r1, 0x1E - strh r1, [r0, 0xC] - movs r1, 0xA0 - lsls r1, 3 - strh r1, [r0, 0x10] - ldr r0, =0x02021bbc - strh r2, [r0] - ldr r0, =0x02021bbe - strh r2, [r0] - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl sub_812DC08 - bl sub_812E474 - bl sub_812E33C - bl sub_812E650 - bl sub_812E70C - bl sub_812E7CC - bl sub_812B700 - bl sub_80A2F30 - movs r0, 0xC4 - lsls r0, 1 - bl current_map_music_set - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D51C - - thumb_func_start sub_812D594 -sub_812D594: @ 812D594 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r1, =0x02021bbc - ldrh r0, [r1] - subs r0, 0x8 - strh r0, [r1] - ldrh r1, [r4, 0xA] - adds r1, 0x8 - strh r1, [r4, 0xA] - movs r2, 0xA - ldrsh r0, [r4, r2] - adds r0, 0xF0 - movs r2, 0xFF - ands r0, r2 - lsrs r5, r0, 3 - ldr r0, =0x000001ff - ands r1, r0 - movs r0, 0x14 - bl SetGpuReg - adds r2, r5, 0 - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r2, r0 - beq _0812D5E2 - movs r1, 0xE - ldrsh r0, [r4, r1] - cmp r0, 0x12 - bgt _0812D5E2 - strh r5, [r4, 0xC] - ldrh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 19 - strh r0, [r4, 0xE] - movs r0, 0xE - ldrsh r1, [r4, r0] - adds r0, r2, 0 - bl sub_812DC08 -_0812D5E2: - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0xC7 - ble _0812D5F4 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x8] - strh r1, [r4, 0xE] -_0812D5F4: - ldrh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 24 - bl sub_812BDD4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D594 - - thumb_func_start sub_812D60C -sub_812D60C: @ 812D60C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 24 - bl sub_812BDD4 - ldrh r0, [r4, 0x12] - adds r0, 0x1 - strh r0, [r4, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3B - ble _0812D636 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - bl sub_812E934 - bl sub_812EAB0 -_0812D636: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812D60C - - thumb_func_start sub_812D63C -sub_812D63C: @ 812D63C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - adds r7, r0, 0 - ldr r1, =gUnknown_085A75C0 - mov r0, sp - movs r2, 0x4 - bl memcpy - add r0, sp, 0x4 - mov r8, r0 - ldr r1, =gUnknown_085A75C4 - movs r2, 0x8 - bl memcpy - add r6, sp, 0xC - ldr r1, =gUnknown_085A75CC - adds r0, r6, 0 - movs r2, 0x8 - bl memcpy - ldrh r0, [r7, 0x10] - lsls r0, 16 - asrs r0, 24 - bl sub_812BDD4 - ldrh r0, [r7, 0x10] - subs r0, 0x4 - strh r0, [r7, 0x10] - lsls r0, 16 - asrs r0, 24 - movs r5, 0x4 - subs r5, r0 - lsls r4, r5, 1 - add r8, r4 - mov r1, r8 - movs r2, 0 - ldrsh r0, [r1, r2] - bl sub_812EA44 - adds r6, r4 - movs r1, 0 - ldrsh r0, [r6, r1] - bl sub_812EBAC - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x3F - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - mov r2, sp - adds r1, r2, r5 - ldrb r1, [r1] - bl StartObjectImageAnimIfDifferent - movs r1, 0x10 - ldrsh r0, [r7, r1] - movs r1, 0x80 - lsls r1, 1 - cmp r0, r1 - bgt _0812D6CC - ldrh r0, [r7, 0x8] - adds r0, 0x1 - strh r0, [r7, 0x8] - strh r1, [r7, 0x10] - movs r0, 0 - strh r0, [r7, 0x12] -_0812D6CC: - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D63C - - thumb_func_start sub_812D6EC -sub_812D6EC: @ 812D6EC - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 24 - bl sub_812BDD4 - ldrh r0, [r4, 0x12] - adds r0, 0x1 - strh r0, [r4, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4F - ble _0812D730 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - strh r0, [r4, 0x12] - movs r0, 0x2 - bl sub_812EBAC - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x3F - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0x3 - bl StartObjectImageAnimIfDifferent -_0812D730: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D6EC - - thumb_func_start sub_812D740 -sub_812D740: @ 812D740 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 24 - bl sub_812BDD4 - ldrb r0, [r4, 0x10] - adds r0, 0x80 - strh r0, [r4, 0x10] - ldrh r0, [r4, 0x12] - adds r0, 0x1 - strh r0, [r4, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4F - ble _0812D76C - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - strh r0, [r4, 0x12] -_0812D76C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812D740 - - thumb_func_start sub_812D774 -sub_812D774: @ 812D774 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 24 - bl sub_812BDD4 - ldrb r0, [r4, 0x10] - adds r0, 0x40 - strh r0, [r4, 0x10] - ldrh r0, [r4, 0x12] - adds r0, 0x1 - strh r0, [r4, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x27 - ble _0812D7DC - movs r0, 0 - strh r0, [r4, 0x12] - ldr r0, =0x0203ab34 - ldr r1, [r0] - ldrb r0, [r1, 0x5] - cmp r0, 0 - beq _0812D7B8 - ldrb r1, [r1, 0xA] - movs r2, 0x14 - ldrsh r0, [r4, r2] - cmp r1, r0 - bgt _0812D7D6 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - b _0812D7D4 - .pool -_0812D7B8: - movs r1, 0x14 - ldrsh r0, [r4, r1] - cmp r0, 0x3 - ble _0812D7C6 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - b _0812D7D4 -_0812D7C6: - ldrh r0, [r4, 0x14] - bl sub_812B760 - lsls r0, 24 - cmp r0, 0 - beq _0812D7D6 - movs r0, 0xE -_0812D7D4: - strh r0, [r4, 0x8] -_0812D7D6: - ldrh r0, [r4, 0x14] - adds r0, 0x1 - strh r0, [r4, 0x14] -_0812D7DC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812D774 - - thumb_func_start sub_812D7E4 -sub_812D7E4: @ 812D7E4 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r6, =0x0203ab34 - ldr r0, [r6] - movs r1, 0x14 - ldrsh r0, [r0, r1] - movs r1, 0x14 - bl __modsi3 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r0, 0 - beq _0812D810 - ldrh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 24 - bl sub_812BE0C - b _0812D838 - .pool -_0812D810: - movs r0, 0x1 - bl sub_812BCE8 - ldr r1, [r6] - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1, 0x5] - cmp r0, r1 - beq _0812D842 - ldrh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 24 - bl sub_812BDD4 - ldr r0, [r6] - movs r1, 0x14 - ldrsh r0, [r0, r1] - movs r1, 0x14 - bl __modsi3 -_0812D838: - lsls r0, 16 - lsrs r5, r0, 16 - ldrb r0, [r4, 0x10] - adds r0, 0x40 - strh r0, [r4, 0x10] -_0812D842: - lsls r0, r5, 16 - asrs r5, r0, 16 - cmp r5, 0 - bne _0812D866 - movs r0, 0x1 - bl sub_812BCE8 - ldr r1, =0x0203ab34 - ldr r1, [r1] - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1, 0x5] - cmp r0, r1 - bne _0812D866 - strh r5, [r4, 0x10] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0812D866: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D7E4 - - thumb_func_start sub_812D870 -sub_812D870: @ 812D870 - push {r4-r6,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x10] - adds r0, 0x1 - movs r6, 0 - strh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3B - ble _0812D914 - bl sub_80A2F30 - bl sub_812EA7C - bl sub_812EBCC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - ldr r5, =0x0203ab34 - ldr r1, [r5] - ldrb r0, [r1, 0x5] - cmp r0, 0 - bne _0812D8D0 - movs r0, 0xA0 - strh r0, [r4, 0x10] - adds r0, r1, 0 - adds r0, 0x3F - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0x5 - bl StartObjectImageAnimIfDifferent - ldr r0, =0x00000187 - bl fanfare_play - b _0812D914 - .pool -_0812D8D0: - movs r0, 0xC0 - strh r0, [r4, 0x10] - adds r0, r1, 0 - adds r0, 0x3F - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - movs r1, 0x4 - bl StartObjectImageAnimIfDifferent - ldr r0, [r5] - adds r0, 0x3F - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x2B - strb r6, [r0] - ldr r0, [r5] - ldrb r0, [r0, 0x2] - cmp r0, 0 - beq _0812D90C - bl sub_812D1DC - ldr r0, [r5] - strb r6, [r0, 0x2] -_0812D90C: - movs r0, 0xC3 - lsls r0, 1 - bl fanfare_play -_0812D914: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D870 - - thumb_func_start sub_812D920 -sub_812D920: @ 812D920 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x10] - movs r2, 0x10 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0812D938 - subs r0, r1, 0x1 - strh r0, [r4, 0x10] - lsls r0, 16 - cmp r0, 0 - bne _0812D948 -_0812D938: - bl sub_812D20C - lsls r0, 24 - cmp r0, 0 - bne _0812D948 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0812D948: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812D920 - - thumb_func_start sub_812D950 -sub_812D950: @ 812D950 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r1, =0x02021bbc - ldrh r0, [r1] - subs r0, 0x8 - strh r0, [r1] - ldrh r1, [r4, 0xA] - adds r1, 0x8 - strh r1, [r4, 0xA] - ldrh r0, [r4, 0xE] - adds r0, 0x8 - strh r0, [r4, 0xE] - movs r2, 0xA - ldrsh r0, [r4, r2] - subs r0, 0x8 - movs r2, 0xFF - ands r0, r2 - lsrs r5, r0, 3 - ldr r0, =0x000001ff - ands r1, r0 - movs r0, 0x14 - bl SetGpuReg - ldrh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 19 - cmp r0, 0x19 - bgt _0812D998 - adds r0, r5, 0 - bl sub_812DC50 - b _0812D99E - .pool -_0812D998: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0812D99E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_812D950 - - thumb_func_start sub_812D9A4 -sub_812D9A4: @ 812D9A4 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r4, =0x0203ab34 - ldr r0, [r4] - movs r6, 0 - strb r6, [r0, 0xB] - ldr r1, [r4] - ldrb r0, [r1, 0x5] - strb r0, [r1, 0xA] - ldr r0, =0x02021bbc - strh r6, [r0] - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - ldr r1, [r4] - movs r0, 0x8 - strh r0, [r1, 0x1A] - bl sub_812E3E8 - bl sub_812E82C - bl sub_812E8C4 - ldr r0, [r4] - adds r0, 0x60 - ldrh r0, [r0] - bl current_map_music_set - ldr r0, [r4] - ldrb r0, [r0, 0xA] - cmp r0, 0 - bne _0812DA04 - ldr r0, =sub_812D4EC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - b _0812DA1A - .pool -_0812DA04: - movs r0, 0x4 - bl sub_812DEE4 - bl dp15_jump_random_unknown - strh r0, [r5, 0xA] - strh r6, [r5, 0xC] - strh r6, [r5, 0xE] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] -_0812DA1A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_812D9A4 - - thumb_func_start sub_812DA20 -sub_812DA20: @ 812DA20 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, =0x0203ab34 - ldr r5, [r0] - movs r0, 0x1A - ldrsh r1, [r5, r0] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _0812DA40 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0812DA66 - .pool -_0812DA40: - movs r1, 0x1C - ldrsh r0, [r5, r1] - movs r1, 0x18 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _0812DA66 - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0812DA66 - ldrh r0, [r5, 0x1A] - lsls r0, 16 - asrs r0, 17 - strh r0, [r5, 0x1A] -_0812DA66: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_812DA20 - - thumb_func_start sub_812DA6C -sub_812DA6C: @ 812DA6C - push {lr} - bl sub_812E054 - lsls r0, 24 - cmp r0, 0 - beq _0812DA86 - ldr r0, =sub_812D4EC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_0812DA86: - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DA6C - - thumb_func_start sub_812DA90 -sub_812DA90: @ 812DA90 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_812E82C - bl sub_812EA7C - bl sub_812EBCC - bl sub_812EC20 - ldr r5, =0x02020630 - ldr r3, =0x0203ab34 - ldr r0, [r3] - adds r0, 0x4E - ldrb r1, [r0] - 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] - adds r0, 0x3F - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x5 - bl StartObjectImageAnimIfDifferent - ldrh r0, [r4, 0x8] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x8] - movs r0, 0x4 - strh r0, [r4, 0x10] - strh r1, [r4, 0x12] - bl sub_80A2F30 - ldr r0, =0x00000187 - bl fanfare_play - movs r0, 0xB2 - bl audio_play - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DA90 - - thumb_func_start sub_812DB04 -sub_812DB04: @ 812DB04 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r1, =0x02021bbe - ldrh r0, [r4, 0x10] - strh r0, [r1] - ldrh r1, [r4, 0x10] - movs r0, 0x16 - bl SetGpuReg - ldrh r1, [r4, 0x12] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0812DB26 - ldrh r0, [r4, 0x10] - negs r0, r0 - strh r0, [r4, 0x10] -_0812DB26: - ldrh r0, [r4, 0x12] - adds r0, 0x1 - strh r0, [r4, 0x12] - movs r1, 0x1F - ands r0, r1 - cmp r0, 0 - bne _0812DB3C - ldrh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 17 - strh r0, [r4, 0x10] -_0812DB3C: - movs r0, 0x10 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _0812DB7A - bl sub_812EC70 - bl sub_812EC94 - bl sub_812E5A8 - bl sub_812EDC0 - ldr r2, =0x02020630 - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x4E - ldrb r1, [r0] - 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] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - strh r5, [r4, 0x12] -_0812DB7A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DB04 - - thumb_func_start sub_812DB8C -sub_812DB8C: @ 812DB8C - push {r4,lr} - adds r4, r0, 0 - ldr r1, =0x02021bbe - movs r0, 0 - strh r0, [r1] - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - bl sub_812EEA8 - lsls r0, 24 - cmp r0, 0 - beq _0812DBB2 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - bl sub_812EECC -_0812DBB2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DB8C - - thumb_func_start sub_812DBBC -sub_812DBBC: @ 812DBBC - push {lr} - ldr r1, =0x02021bbc - movs r0, 0 - strh r0, [r1] - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x60 - ldrh r0, [r0] - bl current_map_music_set - bl sub_812E3E8 - bl sub_812E8F8 - bl sub_812E8C4 - bl sub_812ED8C - ldr r0, =sub_812D4EC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DBBC - - thumb_func_start sub_812DC08 -sub_812DC08: @ 812DC08 - push {r4-r6,lr} - movs r2, 0x4 - lsls r1, 16 - asrs r6, r1, 16 - lsls r0, 16 - asrs r5, r0, 16 -_0812DC14: - lsls r4, r2, 16 - asrs r4, 16 - subs r0, r4, 0x4 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r6, r1 - lsls r1, 1 - ldr r0, =gUnknown_085A96E0 - adds r1, r0 - lsls r3, r4, 5 - adds r3, r5, r3 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x1 - movs r2, 0x2 - bl LoadBgTilemap - adds r4, 0x1 - lsls r4, 16 - lsrs r2, r4, 16 - asrs r4, 16 - cmp r4, 0xE - ble _0812DC14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DC08 - - thumb_func_start sub_812DC50 -sub_812DC50: @ 812DC50 - push {r4,r5,lr} - movs r4, 0x4 - lsls r0, 16 - asrs r5, r0, 16 -_0812DC58: - lsls r3, r4, 5 - adds r3, r5, r3 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x1 - ldr r1, =gUnknown_085A9898 - movs r2, 0x2 - bl LoadBgTilemap - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xE - bls _0812DC58 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DC50 - - thumb_func_start sub_812DC80 -sub_812DC80: @ 812DC80 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =sub_812DCD4 - adds r0, r5, 0 - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0xA] - bl _call_via_r5 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DC80 - - thumb_func_start sub_812DCB4 -sub_812DCB4: @ 812DCB4 - push {lr} - ldr r0, =sub_812DCD4 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _0812DCCC - movs r0, 0 - b _0812DCCE - .pool -_0812DCCC: - movs r0, 0x1 -_0812DCCE: - pop {r1} - bx r1 - thumb_func_end sub_812DCB4 - - thumb_func_start sub_812DCD4 -sub_812DCD4: @ 812DCD4 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_085A75D4 - ldr r2, =0x03005e00 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DCD4 - - thumb_func_start sub_812DD04 -sub_812DD04: @ 812DD04 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812DD04 - - thumb_func_start sub_812DD28 -sub_812DD28: @ 812DD28 - push {lr} - adds r2, r0, 0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0812DD3E - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] -_0812DD3E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DD28 - - thumb_func_start sub_812DD48 -sub_812DD48: @ 812DD48 - push {r4,lr} - adds r4, r0, 0 - bl sub_812DFDC - bl sub_812FAF4 - ldr r0, =gUnknown_085A7444 - bl AddWindow - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DD48 - - thumb_func_start sub_812DD78 -sub_812DD78: @ 812DD78 - push {r4,r5,lr} - sub sp, 0xC - adds r5, r0, 0 - ldr r0, =gUnknown_085A744C - str r0, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r0, =gUnknown_085EF750 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x2 - movs r3, 0x5 - bl box_print - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DD78 - - thumb_func_start sub_812DDC4 -sub_812DDC4: @ 812DDC4 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x6 - ands r0, r1 - cmp r0, 0 - beq _0812DE08 - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - bl ClearWindowTilemap - movs r0, 0x1 - movs r1, 0x1 - bl CopyWindowToVram - movs r0, 0x1 - bl RemoveWindow - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0812DE08: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DDC4 - - thumb_func_start sub_812DE14 -sub_812DE14: @ 812DE14 - push {r4,lr} - adds r4, r0, 0 - bl sub_812F968 - movs r0, 0x3 - bl ShowBg - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812DE14 - - thumb_func_start sub_812DE30 -sub_812DE30: @ 812DE30 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0xA] - bl sub_812DEE4 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812DE30 - - thumb_func_start sub_812DE48 -sub_812DE48: @ 812DE48 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldr r0, =0x0203ab34 - ldr r0, [r0] - ldrb r0, [r0, 0x2] - bl sub_812D3B4 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DE48 - - thumb_func_start sub_812DE7C -sub_812DE7C: @ 812DE7C - push {lr} - ldr r0, =sub_812DCD4 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DE7C - - thumb_func_start sub_812DE94 -sub_812DE94: @ 812DE94 - push {lr} - ldr r0, =sub_812E0B0 - movs r1, 0x3 - bl CreateTask - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x3D - strb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r0, r1 - ldr r1, =0x0000ffff - strh r1, [r0, 0xA] - movs r1, 0x4 - adds r2, r0, 0 - adds r2, 0x8 - movs r3, 0x40 -_0812DEC0: - lsls r0, r1, 1 - adds r0, r2, r0 - strh r3, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bls _0812DEC0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DE94 - - thumb_func_start sub_812DEE4 -sub_812DEE4: @ 812DEE4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_812DFDC - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x3D - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r7, r0, r1 - strh r4, [r7, 0xA] - movs r6, 0 - ldr r1, =gUnknown_085A7A04 - lsls r5, r4, 2 - adds r0, r5, r1 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0xFF - beq _0812DF52 - mov r8, r1 -_0812DF1A: - mov r0, r8 - adds r4, r5, r0 - ldr r0, [r4] - lsls r2, r6, 2 - adds r2, r0 - ldrb r0, [r2] - ldrb r1, [r2, 0x1] - movs r3, 0x2 - ldrsh r2, [r2, r3] - bl sub_812EF98 - lsls r0, 24 - lsrs r0, 24 - adds r2, r6, 0x4 - lsls r2, 1 - adds r1, r7, 0 - adds r1, 0x8 - adds r1, r2 - strh r0, [r1] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, [r4] - lsls r0, r6, 2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _0812DF1A -_0812DF52: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DEE4 - - thumb_func_start sub_812DF68 -sub_812DF68: @ 812DF68 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - mov r8, r1 - ldr r4, [sp, 0x1C] - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x3D - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r0, r1 - mov r12, r0 - movs r5, 0x4 - lsls r4, 16 - asrs r6, r4, 16 - lsls r2, 16 - lsls r3, 16 -_0812DF96: - lsls r0, r5, 1 - mov r1, r12 - adds r1, 0x8 - adds r4, r1, r0 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x40 - bne _0812DFC4 - str r6, [sp] - adds r0, r7, 0 - mov r1, r8 - asrs r2, 16 - asrs r3, 16 - bl sub_812EFDC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - b _0812DFCE - .pool -_0812DFC4: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0xF - bls _0812DF96 -_0812DFCE: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_812DF68 - - thumb_func_start sub_812DFDC -sub_812DFDC: @ 812DFDC - push {r4-r6,lr} - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x3D - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - ldrh r1, [r4, 0xA] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _0812E008 - ldr r0, =gUnknown_085A7A20 - movs r2, 0xA - ldrsh r1, [r4, r2] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 -_0812E008: - movs r5, 0x4 - adds r6, r4, 0 - adds r6, 0x8 -_0812E00E: - lsls r0, r5, 1 - adds r4, r6, r0 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x40 - beq _0812E02E - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - movs r0, 0x40 - strh r0, [r4] -_0812E02E: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0xF - bls _0812E00E - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DFDC - - thumb_func_start sub_812E054 -sub_812E054: @ 812E054 - push {r4,r5,lr} - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x3D - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r0, r1 - movs r2, 0x4 - adds r3, r0, 0 - adds r3, 0x8 - ldr r4, =0x02020630 -_0812E070: - lsls r0, r2, 1 - adds r1, r3, r0 - movs r5, 0 - ldrsh r0, [r1, r5] - cmp r0, 0x40 - beq _0812E09C - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - movs r5, 0x3C - ldrsh r0, [r1, r5] - cmp r0, 0 - beq _0812E09C - movs r0, 0 - b _0812E0A8 - .pool -_0812E09C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bls _0812E070 - movs r0, 0x1 -_0812E0A8: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_812E054 - - thumb_func_start sub_812E0B0 -sub_812E0B0: @ 812E0B0 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_085A7610 - ldr r2, =0x03005e00 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_812E0B0 - - thumb_func_start nullsub_51 -nullsub_51: @ 812E0E0 - bx lr - thumb_func_end nullsub_51 - - thumb_func_start sub_812E0E4 -sub_812E0E4: @ 812E0E4 - push {r4-r7,lr} - movs r6, 0 - movs r0, 0x30 -_0812E0EA: - movs r4, 0 - lsls r5, r0, 16 - lsls r7, r6, 16 -_0812E0F0: - ldr r0, =gUnknown_085A7CE0 - asrs r1, r5, 16 - movs r2, 0 - movs r3, 0xE - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - ldrb r0, [r1, 0x5] - movs r2, 0xC - orrs r0, r2 - strb r0, [r1, 0x5] - strh r6, [r1, 0x2E] - strh r4, [r1, 0x30] - ldr r0, =0x0000ffff - strh r0, [r1, 0x34] - lsls r0, r4, 16 - movs r1, 0xC0 - lsls r1, 13 - adds r0, r1 - lsrs r4, r0, 16 - asrs r0, 16 - cmp r0, 0x77 - ble _0812E0F0 - movs r2, 0x80 - lsls r2, 9 - adds r1, r7, r2 - movs r2, 0xA0 - lsls r2, 14 - adds r0, r5, r2 - lsrs r0, 16 - lsrs r6, r1, 16 - asrs r1, 16 - cmp r1, 0x2 - ble _0812E0EA - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812E0E4 - - thumb_func_start sub_812E154 -sub_812E154: @ 812E154 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x0203ab34 - ldr r4, [r0] - movs r1, 0x2E - ldrsh r0, [r5, r1] - lsls r0, 1 - adds r1, r4, 0 - adds r1, 0x1C - adds r1, r0 - ldrh r0, [r5, 0x30] - ldrh r1, [r1] - adds r0, r1 - strh r0, [r5, 0x32] - movs r2, 0x32 - ldrsh r0, [r5, r2] - movs r1, 0x78 - bl __modsi3 - strh r0, [r5, 0x32] - movs r2, 0x2E - ldrsh r1, [r5, r2] - lsls r1, 1 - adds r4, 0x22 - adds r4, r1 - ldrh r1, [r4] - adds r1, 0x1C - adds r0, r1 - strh r0, [r5, 0x22] - ldrh r4, [r5, 0x2E] - lsls r4, 24 - lsrs r4, 24 - movs r1, 0x32 - ldrsh r0, [r5, r1] - movs r1, 0x18 - bl __divsi3 - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl sub_812BC44 - lsls r0, 24 - lsrs r0, 24 - bl GetObjectTileRangeStartByTag - adds r1, r5, 0 - adds r1, 0x40 - strh r0, [r1] - adds r0, r5, 0 - bl sub_8008324 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812E154 - - thumb_func_start sub_812E1C8 -sub_812E1C8: @ 812E1C8 - push {r4-r6,lr} - movs r4, 0xCB - movs r5, 0x1 - ldr r6, =0x0000270f -_0812E1D0: - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - adds r0, r4, 0 - movs r1, 0x17 - movs r2, 0 - adds r3, r5, 0 - bl sub_812E230 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 17 - subs r4, 0x7 - lsls r4, 16 - lsrs r4, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, r6 - ble _0812E1D0 - movs r4, 0xEB - movs r5, 0x1 - ldr r6, =0x0000270f -_0812E1FE: - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - adds r0, r4, 0 - movs r1, 0x17 - movs r2, 0x1 - adds r3, r5, 0 - bl sub_812E230 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 17 - subs r4, 0x7 - lsls r4, 16 - lsrs r4, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, r6 - ble _0812E1FE - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812E1C8 - - thumb_func_start sub_812E230 -sub_812E230: @ 812E230 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r5, r0, 0 - adds r6, r1, 0 - mov r8, r2 - adds r4, r3, 0 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =gUnknown_085A7CF8 - lsls r5, 16 - asrs r5, 16 - lsls r6, 16 - asrs r6, 16 - adds r1, r5, 0 - adds r2, r6, 0 - movs r3, 0xD - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x02020630 - adds r2, r0 - ldrb r1, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r2, 0x5] - mov r0, r8 - strh r0, [r2, 0x2E] - strh r4, [r2, 0x30] - lsls r4, 16 - asrs r4, 16 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 1 - strh r0, [r2, 0x32] - ldr r0, =0x0000ffff - strh r0, [r2, 0x34] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812E230 - - thumb_func_start sub_812E2A8 -sub_812E2A8: @ 812E2A8 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0203ab34 - ldr r1, [r0] - ldrh r2, [r1, 0xC] - movs r3, 0x2E - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _0812E2BC - ldrh r2, [r1, 0xE] -_0812E2BC: - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, r2 - beq _0812E2F6 - strh r2, [r4, 0x34] - ldrh r1, [r4, 0x32] - adds r0, r2, 0 - bl __umodsi3 - lsls r0, 16 - lsrs r2, r0, 16 - ldrh r1, [r4, 0x30] - adds r0, r2, 0 - bl __udivsi3 - lsls r0, 16 - movs r3, 0xE0 - lsls r3, 11 - adds r0, r3 - lsrs r2, r0, 16 - adds r0, r2, 0 - bl GetObjectTileRangeStartByTag - adds r1, r4, 0 - adds r1, 0x40 - strh r0, [r1] - adds r0, r4, 0 - bl sub_8008324 -_0812E2F6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812E2A8 - - thumb_func_start sub_812E300 -sub_812E300: @ 812E300 - push {lr} - ldr r0, =gUnknown_085A7D10 - movs r1, 0x58 - movs r2, 0x48 - movs r3, 0xF - bl AddObjectToFront - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x5] - movs r2, 0xC - orrs r1, r2 - strb r1, [r0, 0x5] - ldr r1, =gUnknown_085A7FC0 - bl SetSpriteOamTables_NoPriorityFromTable - pop {r0} - bx r0 - .pool - thumb_func_end sub_812E300 - - thumb_func_start sub_812E33C -sub_812E33C: @ 812E33C - push {r4,r5,lr} - sub sp, 0x18 - ldr r4, =0x0203aae4 - ldr r0, [r4] - cmp r0, 0 - bne _0812E350 - movs r0, 0x28 - bl AllocZeroed - str r0, [r4] -_0812E350: - ldr r2, [r4] - ldr r0, =0x0203aad8 - ldr r1, [r0] - str r1, [r2] - movs r3, 0x80 - lsls r3, 4 - strh r3, [r2, 0x4] - adds r0, r1, r3 - str r0, [r2, 0x8] - strh r3, [r2, 0xC] - movs r4, 0x80 - lsls r4, 5 - adds r0, r1, r4 - str r0, [r2, 0x10] - strh r3, [r2, 0x14] - movs r5, 0xC0 - lsls r5, 5 - adds r0, r1, r5 - str r0, [r2, 0x18] - strh r3, [r2, 0x1C] - movs r0, 0x80 - lsls r0, 6 - adds r1, r0 - str r1, [r2, 0x20] - strh r3, [r2, 0x24] - mov r1, sp - ldr r0, =gUnknown_085A7D28 - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - str r2, [sp, 0xC] - movs r1, 0x8C - lsls r1, 1 - mov r0, sp - movs r2, 0x50 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r1 - ldrb r3, [r2, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r3 - movs r3, 0x4 - orrs r1, r3 - strb r1, [r2, 0x5] - adds r2, 0x3E - ldrb r1, [r2] - movs r3, 0x2 - orrs r1, r3 - strb r1, [r2] - ldr r1, =0x0203ab34 - ldr r1, [r1] - adds r1, 0x3F - strb r0, [r1] - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812E33C - - thumb_func_start sub_812E3E8 -sub_812E3E8: @ 812E3E8 - push {r4,lr} - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x3F - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - ldr r4, =0x0203aae4 - ldr r0, [r4] - cmp r0, 0 - beq _0812E410 - bl Free - movs r0, 0 - str r0, [r4] -_0812E410: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812E3E8 - - thumb_func_start sub_812E424 -sub_812E424: @ 812E424 - push {lr} - adds r2, r0, 0 - movs r0, 0 - strh r0, [r2, 0x24] - strh r0, [r2, 0x26] - adds r0, r2, 0 - adds r0, 0x2A - ldrb r0, [r0] - cmp r0, 0x4 - bne _0812E46A - movs r0, 0x8 - strh r0, [r2, 0x24] - strh r0, [r2, 0x26] - adds r0, r2, 0 - adds r0, 0x2B - ldrb r0, [r0] - cmp r0, 0 - beq _0812E458 - adds r0, r2, 0 - adds r0, 0x2C - ldrb r1, [r0] - movs r0, 0x3F - ands r0, r1 - cmp r0, 0 - bne _0812E466 - b _0812E46A -_0812E458: - adds r0, r2, 0 - adds r0, 0x2C - ldrb r1, [r0] - movs r0, 0x3F - ands r0, r1 - cmp r0, 0 - bne _0812E46A -_0812E466: - ldr r0, =0x0000fff8 - strh r0, [r2, 0x26] -_0812E46A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_812E424 - - thumb_func_start sub_812E474 -sub_812E474: @ 812E474 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - ldr r4, =0x0203aae8 - ldr r0, [r4] - cmp r0, 0 - bne _0812E490 - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] -_0812E490: - ldr r2, [r4] - ldr r0, =0x0203aad8 - mov r10, r0 - ldr r0, [r0] - movs r1, 0xA0 - lsls r1, 6 - adds r0, r1 - str r0, [r2] - movs r0, 0xC0 - lsls r0, 2 - strh r0, [r2, 0x4] - mov r1, sp - ldr r0, =gUnknown_085A7D40 - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldm r0!, {r3,r4,r7} - stm r1!, {r3,r4,r7} - str r2, [sp, 0xC] - mov r0, sp - movs r1, 0xB8 - lsls r1, 1 - movs r2, 0x34 - movs r3, 0x7 - bl AddObjectToFront - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r5, =0x02020630 - mov r9, r5 - adds r2, r0, r5 - ldrb r1, [r2, 0x5] - movs r7, 0xD - negs r7, r7 - mov r8, r7 - mov r0, r8 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0x5] - adds r1, r2, 0 - adds r1, 0x3E - ldrb r0, [r1] - movs r6, 0x2 - orrs r0, r6 - strb r0, [r1] - ldr r1, =gUnknown_085A7FE0 - adds r0, r2, 0 - bl SetSpriteOamTables_NoPriorityFromTable - ldr r5, =0x0203ab34 - ldr r0, [r5] - adds r0, 0x49 - strb r4, [r0] - ldr r4, =0x0203aaec - ldr r0, [r4] - cmp r0, 0 - bne _0812E510 - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] -_0812E510: - ldr r2, [r4] - mov r3, r10 - ldr r0, [r3] - movs r4, 0xAC - lsls r4, 6 - adds r0, r4 - str r0, [r2] - movs r0, 0xA0 - lsls r0, 3 - strh r0, [r2, 0x4] - mov r1, sp - ldr r0, =gUnknown_085A7D58 - ldm r0!, {r3,r4,r7} - stm r1!, {r3,r4,r7} - ldm r0!, {r3,r4,r7} - stm r1!, {r3,r4,r7} - str r2, [sp, 0xC] - mov r0, sp - movs r1, 0xB8 - lsls r1, 1 - movs r2, 0x54 - movs r3, 0x7 - bl AddObjectToFront - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - mov r7, r9 - adds r2, r0, r7 - ldrb r1, [r2, 0x5] - mov r0, r8 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0x5] - adds r1, r2, 0 - adds r1, 0x3E - ldrb r0, [r1] - orrs r0, r6 - strb r0, [r1] - ldr r1, =gUnknown_085A7FF4 - adds r0, r2, 0 - bl SetSpriteOamTables_NoPriorityFromTable - ldr r0, [r5] - adds r0, 0x4A - strb r4, [r0] - 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_812E474 - - thumb_func_start sub_812E5A8 -sub_812E5A8: @ 812E5A8 - push {r4,r5,lr} - sub sp, 0x18 - ldr r4, =0x0203aaf0 - ldr r0, [r4] - cmp r0, 0 - bne _0812E5BC - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] -_0812E5BC: - ldr r2, [r4] - ldr r0, =0x0203aad8 - ldr r0, [r0] - movs r1, 0xC0 - lsls r1, 6 - adds r0, r1 - str r0, [r2] - movs r0, 0xC0 - lsls r0, 3 - strh r0, [r2, 0x4] - mov r1, sp - ldr r0, =gUnknown_085A7D70 - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - str r2, [sp, 0xC] - ldr r0, =0x02021bbc - ldrh r0, [r0] - movs r1, 0xA8 - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - mov r0, sp - movs r2, 0x50 - movs r3, 0x7 - bl AddObjectToFront - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0, 0x5] - adds r3, r0, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r3] - ldr r1, =gUnknown_085A8010 - bl SetSpriteOamTables_NoPriorityFromTable - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x42 - strb r4, [r0] - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812E5A8 - - thumb_func_start sub_812E650 -sub_812E650: @ 812E650 - push {r4-r6,lr} - movs r4, 0 - movs r5, 0 -_0812E656: - ldr r0, =gUnknown_085A7D88 - movs r1, 0xB8 - lsls r1, 1 - movs r2, 0 - movs r3, 0xA - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - ldr r1, =0x02020630 - adds r3, r1 - ldrb r2, [r3, 0x5] - movs r6, 0xD - negs r6, r6 - adds r1, r6, 0 - ands r2, r1 - movs r1, 0x4 - orrs r2, r1 - strb r2, [r3, 0x5] - movs r1, 0x3E - adds r1, r3 - mov r12, r1 - ldrb r1, [r1] - movs r2, 0x2 - orrs r1, r2 - mov r2, r12 - strb r1, [r2] - strh r5, [r3, 0x3C] - ldr r1, =0x0203ab34 - ldr r1, [r1] - adds r1, 0x4B - adds r1, r4 - strb r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r5, 16 - movs r6, 0xA0 - lsls r6, 13 - adds r0, r6 - lsrs r5, r0, 16 - cmp r4, 0x2 - bls _0812E656 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812E650 - - thumb_func_start sub_812E6C4 -sub_812E6C4: @ 812E6C4 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0203ab34 - ldr r1, [r0] - ldrh r0, [r4, 0x3C] - ldrh r1, [r1, 0x14] - adds r0, r1 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x28 - bl __modsi3 - lsls r0, 16 - asrs r0, 16 - adds r1, r0, 0 - adds r1, 0x3B - strh r1, [r4, 0x22] - movs r1, 0x14 - bl __divsi3 - lsls r0, 16 - asrs r0, 16 - bl sub_812BCE8 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnimIfDifferent - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812E6C4 - - thumb_func_start sub_812E70C -sub_812E70C: @ 812E70C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r1, 0xB8 - lsls r1, 1 - ldr r0, =gUnknown_085A7DA0 - movs r2, 0x64 - movs r3, 0x9 - bl AddObjectToFront - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r7, =0x02020630 - adds r2, r0, r7 - adds r1, r2, 0 - adds r1, 0x3E - ldrb r0, [r1] - movs r3, 0x2 - mov r10, r3 - mov r3, r10 - orrs r0, r3 - strb r0, [r1] - ldrb r1, [r2, 0x5] - movs r5, 0xD - negs r5, r5 - adds r0, r5, 0 - ands r0, r1 - movs r1, 0x4 - mov r8, r1 - mov r3, r8 - orrs r0, r3 - strb r0, [r2, 0x5] - ldr r0, =gUnknown_085A8028 - mov r9, r0 - adds r0, r2, 0 - mov r1, r9 - bl SetSpriteOamTables_NoPriorityFromTable - ldr r6, =0x0203ab34 - ldr r0, [r6] - adds r0, 0x4E - strb r4, [r0] - movs r1, 0x90 - lsls r1, 1 - ldr r0, =gUnknown_085A7DA0 - movs r2, 0x68 - movs r3, 0x4 - bl AddObjectToFront - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r2, r0, r7 - adds r1, r2, 0 - adds r1, 0x3E - ldrb r0, [r1] - mov r3, r10 - orrs r0, r3 - strb r0, [r1] - ldrb r0, [r2, 0x5] - ands r5, r0 - mov r0, r8 - orrs r5, r0 - strb r5, [r2, 0x5] - adds r0, r2, 0 - mov r1, r9 - bl SetSpriteOamTables_NoPriorityFromTable - ldr r0, [r6] - adds r0, 0x4F - strb r4, [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_812E70C - - thumb_func_start sub_812E7CC -sub_812E7CC: @ 812E7CC - push {r4,lr} - ldr r0, =gUnknown_085A7DB8 - movs r1, 0xB8 - lsls r1, 1 - movs r2, 0x4C - movs r3, 0xB - bl AddObjectToFront - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - adds r3, r0, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r3] - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0, 0x5] - ldr r1, =gUnknown_085A803C - bl SetSpriteOamTables_NoPriorityFromTable - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x40 - strb r4, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812E7CC - - thumb_func_start sub_812E82C -sub_812E82C: @ 812E82C - push {r4,lr} - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x40 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - movs r4, 0 -_0812E846: - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x49 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0812E846 - ldr r4, =0x0203aae8 - ldr r0, [r4] - cmp r0, 0 - beq _0812E878 - bl Free - movs r0, 0 - str r0, [r4] -_0812E878: - ldr r4, =0x0203aaec - ldr r0, [r4] - cmp r0, 0 - beq _0812E888 - bl Free - movs r0, 0 - str r0, [r4] -_0812E888: - movs r4, 0 -_0812E88A: - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x4B - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _0812E88A - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812E82C - - thumb_func_start sub_812E8C4 -sub_812E8C4: @ 812E8C4 - push {r4,lr} - movs r4, 0 -_0812E8C8: - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x4E - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0812E8C8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812E8C4 - - thumb_func_start sub_812E8F8 -sub_812E8F8: @ 812E8F8 - push {r4,lr} - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x42 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - ldr r4, =0x0203aaf0 - ldr r0, [r4] - cmp r0, 0 - beq _0812E920 - bl Free - movs r0, 0 - str r0, [r4] -_0812E920: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812E8F8 - - thumb_func_start sub_812E934 -sub_812E934: @ 812E934 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - ldr r0, =gUnknown_085A7DD0 - mov r10, r0 - movs r1, 0x98 - movs r2, 0x20 - movs r3, 0x5 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r2, =0x02020630 - mov r9, r2 - adds r3, r1, r2 - ldrb r2, [r3, 0x5] - movs r4, 0xD - negs r4, r4 - adds r1, r4, 0 - ands r1, r2 - movs r2, 0x4 - mov r8, r2 - mov r2, r8 - orrs r1, r2 - strb r1, [r3, 0x5] - adds r5, r3, 0 - adds r5, 0x3F - ldrb r1, [r5] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r5] - ldr r6, =0x0203ab34 - ldr r1, [r6] - adds r1, 0x50 - strb r0, [r1] - movs r0, 0x8 - strh r0, [r3, 0x2E] - ldr r0, =0x0000ffff - strh r0, [r3, 0x30] - movs r0, 0x1 - negs r0, r0 - strh r0, [r3, 0x32] - movs r5, 0x20 - strh r5, [r3, 0x3C] - mov r0, r10 - movs r1, 0xB8 - movs r2, 0x20 - movs r3, 0x5 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - mov r2, r9 - adds r3, r1, r2 - ldrb r1, [r3, 0x5] - ands r4, r1 - mov r1, r8 - orrs r4, r1 - strb r4, [r3, 0x5] - ldr r1, [r6] - adds r1, 0x51 - strb r0, [r1] - movs r0, 0x1 - strh r0, [r3, 0x30] - subs r0, 0x2 - strh r0, [r3, 0x32] - strh r5, [r3, 0x3C] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812E934 - - thumb_func_start sub_812E9E8 -sub_812E9E8: @ 812E9E8 - push {r4,lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - movs r1, 0x2E - ldrsh r4, [r2, r1] - cmp r4, 0 - beq _0812EA0C - subs r0, 0x1 - movs r1, 0 - strh r0, [r2, 0x2E] - strh r1, [r2, 0x24] - strh r1, [r2, 0x26] - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - b _0812EA3E -_0812EA0C: - adds r3, r2, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - ldrh r0, [r2, 0x30] - ldrh r1, [r2, 0x24] - adds r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x32] - ldrh r1, [r2, 0x26] - adds r0, r1 - strh r0, [r2, 0x26] - ldrh r0, [r2, 0x34] - adds r0, 0x1 - strh r0, [r2, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _0812EA3E - ldrh r0, [r2, 0x3C] - strh r0, [r2, 0x2E] - strh r4, [r2, 0x34] -_0812EA3E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812E9E8 - - thumb_func_start sub_812EA44 -sub_812EA44: @ 812EA44 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - ldr r4, =0x02020630 - ldr r1, =0x0203ab34 - ldr r3, [r1] - adds r1, r3, 0 - adds r1, 0x50 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - strh r0, [r1, 0x3C] - adds r3, 0x51 - ldrb r2, [r3] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - strh r0, [r1, 0x3C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812EA44 - - thumb_func_start sub_812EA7C -sub_812EA7C: @ 812EA7C - push {r4,lr} - movs r4, 0 -_0812EA80: - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x50 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0812EA80 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812EA7C - - thumb_func_start sub_812EAB0 -sub_812EAB0: @ 812EAB0 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - ldr r0, =gUnknown_085A7DE8 - mov r8, r0 - movs r1, 0x48 - movs r2, 0x50 - movs r3, 0x3 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02020630 - mov r9, r1 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r9 - ldrb r3, [r2, 0x5] - movs r4, 0xD - negs r4, r4 - adds r1, r4, 0 - ands r1, r3 - movs r6, 0x4 - orrs r1, r6 - strb r1, [r2, 0x5] - movs r3, 0 - movs r1, 0x1 - strh r1, [r2, 0x2E] - strh r3, [r2, 0x38] - movs r1, 0x10 - strh r1, [r2, 0x3A] - movs r1, 0x8 - strh r1, [r2, 0x3C] - ldr r5, =0x0203ab34 - ldr r1, [r5] - adds r1, 0x52 - strb r0, [r1] - mov r0, r8 - movs r1, 0x68 - movs r2, 0x50 - movs r3, 0x3 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r9 - ldrb r2, [r1, 0x5] - ands r4, r2 - orrs r4, r6 - strb r4, [r1, 0x5] - adds r1, 0x3F - ldrb r2, [r1] - movs r3, 0x1 - orrs r2, r3 - strb r2, [r1] - ldr r1, [r5] - adds r1, 0x53 - strb r0, [r1] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812EAB0 - - thumb_func_start sub_812EB48 -sub_812EB48: @ 812EB48 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldr r1, =gUnknown_085A7614 - mov r0, sp - movs r2, 0x2 - bl memcpy - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0812EB9A - ldrh r0, [r4, 0x3A] - subs r0, 0x1 - strh r0, [r4, 0x3A] - lsls r0, 16 - cmp r0, 0 - bgt _0812EB9A - movs r0, 0x7 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 4 - ldr r2, =0x01030000 - adds r0, r2 - lsrs r0, 16 - movs r2, 0x38 - ldrsh r1, [r4, r2] - add r1, sp - ldrb r3, [r1] - adds r1, r3, 0 - adds r2, r3, 0 - bl sub_80B609C - ldrh r0, [r4, 0x38] - adds r0, 0x1 - movs r1, 0x1 - ands r0, r1 - strh r0, [r4, 0x38] - ldrh r0, [r4, 0x3C] - strh r0, [r4, 0x3A] -_0812EB9A: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812EB48 - - thumb_func_start sub_812EBAC -sub_812EBAC: @ 812EBAC - ldr r3, =0x02020630 - ldr r1, =0x0203ab34 - ldr r1, [r1] - adds r1, 0x52 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - strh r0, [r1, 0x3C] - bx lr - .pool - thumb_func_end sub_812EBAC - - thumb_func_start sub_812EBCC -sub_812EBCC: @ 812EBCC - push {r4,lr} - movs r0, 0x7 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 4 - ldr r1, =0x01030000 - adds r0, r1 - lsrs r0, 16 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_80B609C - movs r4, 0 -_0812EBEA: - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x52 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0812EBEA - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812EBCC - - thumb_func_start sub_812EC20 -sub_812EC20: @ 812EC20 - push {lr} - ldr r0, =gUnknown_085A7E00 - movs r1, 0xA8 - movs r2, 0x50 - movs r3, 0x6 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - 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, 0x4 - orrs r2, r3 - strb r2, [r1, 0x5] - ldr r1, =0x0203ab34 - ldr r1, [r1] - adds r1, 0x41 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_812EC20 - - thumb_func_start sub_812EC64 -sub_812EC64: @ 812EC64 - ldr r1, =0x02021bbe - ldrh r1, [r1] - strh r1, [r0, 0x26] - bx lr - .pool - thumb_func_end sub_812EC64 - - thumb_func_start sub_812EC70 -sub_812EC70: @ 812EC70 - push {lr} - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x41 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - pop {r0} - bx r0 - .pool - thumb_func_end sub_812EC70 - - thumb_func_start sub_812EC94 -sub_812EC94: @ 812EC94 - push {r4,r5,lr} - sub sp, 0x8 - ldr r1, =gUnknown_085A7616 - mov r0, sp - movs r2, 0x8 - bl memcpy - movs r4, 0 -_0812ECA4: - ldr r0, =0x02021bbc - ldrh r0, [r0] - movs r1, 0x50 - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - ldr r0, =gUnknown_085A7E18 - movs r2, 0x44 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - ldr r1, =0x02020630 - adds r3, r1 - ldrb r2, [r3, 0x5] - movs r5, 0xD - negs r5, r5 - adds r1, r5, 0 - ands r2, r1 - movs r1, 0x4 - orrs r2, r1 - strb r2, [r3, 0x5] - movs r1, 0x3E - adds r1, r3 - mov r12, r1 - ldrb r1, [r1] - movs r2, 0x2 - orrs r1, r2 - mov r2, r12 - strb r1, [r2] - lsls r1, r4, 1 - add r1, sp - ldrh r1, [r1] - strh r1, [r3, 0x2E] - ldr r1, =0x0203ab34 - ldr r1, [r1] - adds r1, 0x54 - adds r1, r4 - strb r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _0812ECA4 - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812EC94 - - thumb_func_start sub_812ED20 -sub_812ED20: @ 812ED20 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0x2E] - subs r0, 0x2 - movs r4, 0 - movs r1, 0xFF - ands r0, r1 - strh r0, [r5, 0x2E] - movs r1, 0x2E - ldrsh r0, [r5, r1] - movs r1, 0x14 - bl cosine - strh r0, [r5, 0x24] - movs r2, 0x2E - ldrsh r0, [r5, r2] - movs r1, 0x6 - bl sine - strh r0, [r5, 0x26] - adds r1, r5, 0 - adds r1, 0x43 - strb r4, [r1] - movs r2, 0x2E - ldrsh r0, [r5, r2] - cmp r0, 0x7F - ble _0812ED5A - movs r0, 0x2 - strb r0, [r1] -_0812ED5A: - ldrh r0, [r5, 0x30] - adds r0, 0x1 - strh r0, [r5, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - ble _0812ED84 - adds r3, r5, 0 - adds r3, 0x3F - ldrb r2, [r3] - lsls r0, r2, 31 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - movs r0, 0 - strh r0, [r5, 0x30] -_0812ED84: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_812ED20 - - thumb_func_start sub_812ED8C -sub_812ED8C: @ 812ED8C - push {r4,lr} - movs r4, 0 -_0812ED90: - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x54 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _0812ED90 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812ED8C - - thumb_func_start sub_812EDC0 -sub_812EDC0: @ 812EDC0 - push {r4,lr} - ldr r0, =gUnknown_085A7E30 - movs r1, 0xA8 - movs r2, 0x3C - movs r3, 0x8 - bl AddObjectToFront - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0, 0x5] - ldrb r1, [r0, 0x1] - movs r2, 0x3 - orrs r1, r2 - strb r1, [r0, 0x1] - bl obj_alloc_rotscale_entry - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x43 - strb r4, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812EDC0 - - thumb_func_start sub_812EE14 -sub_812EE14: @ 812EE14 - push {lr} - adds r3, r0, 0 - ldrh r2, [r3, 0x2E] - movs r1, 0x2E - ldrsh r0, [r3, r1] - cmp r0, 0 - bne _0812EE36 - adds r0, r3, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0812EE90 - adds r0, r2, 0x1 - strh r0, [r3, 0x2E] - b _0812EE90 -_0812EE36: - cmp r0, 0x1 - bne _0812EE72 - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - 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 - mov r1, r12 - strb r0, [r1] - ldrh r0, [r3, 0x32] - adds r0, 0x1 - strh r0, [r3, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x17 - ble _0812EE90 - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - movs r0, 0 - strh r0, [r3, 0x32] - b _0812EE90 -_0812EE72: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r3, 0x32] - adds r0, 0x1 - strh r0, [r3, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - ble _0812EE90 - movs r0, 0x1 - strh r0, [r3, 0x3C] -_0812EE90: - ldrh r0, [r3, 0x30] - movs r1, 0xFF - ands r1, r0 - adds r1, 0x10 - strh r1, [r3, 0x30] - lsrs r1, 8 - ldrh r0, [r3, 0x26] - subs r0, r1 - strh r0, [r3, 0x26] - pop {r0} - bx r0 - thumb_func_end sub_812EE14 - - thumb_func_start sub_812EEA8 -sub_812EEA8: @ 812EEA8 - ldr r2, =0x02020630 - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x43 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x3C] - lsls r0, 24 - lsrs r0, 24 - bx lr - .pool - thumb_func_end sub_812EEA8 - - thumb_func_start sub_812EECC -sub_812EECC: @ 812EECC - push {r4,lr} - ldr r0, =0x0203ab34 - ldr r0, [r0] - adds r0, 0x43 - ldrb r0, [r0] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812EECC - - thumb_func_start sub_812EF00 -sub_812EF00: @ 812EF00 - push {r4,lr} - adds r3, r0, 0 - adds r2, r1, 0 - ldr r0, =gUnknown_085A7F98 - lsls r3, 16 - asrs r3, 16 - lsls r2, 16 - asrs r2, 16 - adds r1, r3, 0 - movs r3, 0xC - bl AddObjectToFront - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0, 0x5] - ldrb r1, [r0, 0x1] - movs r2, 0x3 - orrs r1, r2 - strb r1, [r0, 0x1] - bl obj_alloc_rotscale_entry - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812EF00 - - thumb_func_start sub_812EF54 -sub_812EF54: @ 812EF54 - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0812EF68 - movs r0, 0x1 - strh r0, [r2, 0x3C] -_0812EF68: - pop {r0} - bx r0 - thumb_func_end sub_812EF54 - - thumb_func_start sub_812EF6C -sub_812EF6C: @ 812EF6C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812EF6C - - thumb_func_start sub_812EF98 -sub_812EF98: @ 812EF98 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - ldr r3, =gUnknown_085A78C8 - lsrs r1, 22 - adds r3, r1, r3 - ldr r5, [r3] - ldr r3, =gUnknown_085A783A - adds r4, r1, r3 - movs r6, 0 - ldrsh r4, [r4, r6] - adds r3, 0x2 - adds r1, r3 - movs r6, 0 - ldrsh r3, [r1, r6] - lsls r2, 16 - asrs r2, 16 - str r2, [sp] - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_812EFDC - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812EF98 - - thumb_func_start sub_812EFDC -sub_812EFDC: @ 812EFDC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - adds r4, r0, 0 - mov r8, r1 - adds r1, r2, 0 - adds r2, r3, 0 - ldr r5, [sp, 0x34] - lsls r4, 24 - lsls r5, 16 - lsrs r5, 16 - mov r9, r5 - ldr r0, =gUnknown_085A8264 - lsrs r4, 22 - adds r0, r4, r0 - mov r3, sp - ldr r0, [r0] - ldm r0!, {r5-r7} - stm r3!, {r5-r7} - ldm r0!, {r5-r7} - stm r3!, {r5-r7} - ldr r0, =0x03001188 - adds r0, r4, r0 - ldr r0, [r0] - str r0, [sp, 0xC] - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - mov r0, sp - movs r3, 0x10 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - ldr r1, =0x02020630 - adds r2, r0, r1 - ldrb r0, [r2, 0x5] - movs r1, 0xC - orrs r0, r1 - strb r0, [r2, 0x5] - mov r0, r8 - str r0, [r2, 0x1C] - mov r5, r9 - strh r5, [r2, 0x3A] - movs r0, 0x1 - strh r0, [r2, 0x3C] - ldr r0, =gUnknown_085A82CC - adds r4, r0 - ldr r1, [r4] - cmp r1, 0 - beq _0812F056 - adds r0, r2, 0 - bl SetSpriteOamTables_NoPriorityFromTable -_0812F056: - adds r0, r7, 0 - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812EFDC - - thumb_func_start sub_812F078 -sub_812F078: @ 812F078 - movs r1, 0 - strh r1, [r0, 0x3C] - bx lr - thumb_func_end sub_812F078 - - thumb_func_start sub_812F080 -sub_812F080: @ 812F080 - push {r4,r5,lr} - sub sp, 0x10 - adds r4, r0, 0 - ldr r1, =gUnknown_085A761E - mov r0, sp - movs r2, 0x8 - bl memcpy - add r5, sp, 0x8 - ldr r1, =gUnknown_085A7626 - adds r0, r5, 0 - movs r2, 0x8 - bl memcpy - ldrh r0, [r4, 0x30] - adds r1, r0, 0x1 - strh r1, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - ble _0812F0C6 - adds r3, r4, 0 - adds r3, 0x42 - ldrb r2, [r3] - lsls r0, r2, 26 - lsrs r0, 26 - movs r1, 0x1 - eors r1, r0 - movs r0, 0x40 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - movs r0, 0 - strh r0, [r4, 0x30] -_0812F0C6: - movs r0, 0 - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - adds r0, r4, 0 - adds r0, 0x42 - ldrb r1, [r0] - movs r0, 0x3F - ands r0, r1 - cmp r0, 0 - beq _0812F0F2 - movs r1, 0x3A - ldrsh r0, [r4, r1] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - strh r0, [r4, 0x24] - movs r1, 0x3A - ldrsh r0, [r4, r1] - lsls r0, 1 - adds r0, r5, r0 - ldrh r0, [r0] - strh r0, [r4, 0x26] -_0812F0F2: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812F080 - - thumb_func_start sub_812F104 -sub_812F104: @ 812F104 - push {lr} - adds r3, r0, 0 - adds r3, 0x3F - ldrb r1, [r3] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r3] - bl sub_812F080 - pop {r0} - bx r0 - thumb_func_end sub_812F104 - - thumb_func_start sub_812F11C -sub_812F11C: @ 812F11C - push {lr} - adds r3, r0, 0 - adds r3, 0x3F - ldrb r1, [r3] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r3] - bl sub_812F080 - pop {r0} - bx r0 - thumb_func_end sub_812F11C - - thumb_func_start sub_812F134 -sub_812F134: @ 812F134 - push {lr} - adds r3, r0, 0 - adds r3, 0x3F - ldrb r1, [r3] - movs r2, 0x1 - orrs r1, r2 - movs r2, 0x2 - orrs r1, r2 - strb r1, [r3] - bl sub_812F080 - pop {r0} - bx r0 - thumb_func_end sub_812F134 - - thumb_func_start sub_812F150 -sub_812F150: @ 812F150 - push {lr} - adds r2, r0, 0 - movs r1, 0x2E - ldrsh r0, [r2, r1] - cmp r0, 0x1 - beq _0812F184 - cmp r0, 0x1 - bgt _0812F166 - cmp r0, 0 - beq _0812F170 - b _0812F1B4 -_0812F166: - cmp r0, 0x2 - beq _0812F194 - cmp r0, 0x3 - beq _0812F1B0 - b _0812F1B4 -_0812F170: - ldrh r0, [r2, 0x20] - adds r0, 0x4 - strh r0, [r2, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xCF - ble _0812F1B4 - movs r0, 0xD0 - strh r0, [r2, 0x20] - b _0812F1A2 -_0812F184: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5A - ble _0812F1B4 - b _0812F1A2 -_0812F194: - ldrh r0, [r2, 0x20] - adds r0, 0x4 - strh r0, [r2, 0x20] - lsls r0, 16 - ldr r1, =0x010f0000 - cmp r0, r1 - ble _0812F1B4 -_0812F1A2: - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - b _0812F1B4 - .pool -_0812F1B0: - movs r0, 0 - strh r0, [r2, 0x3C] -_0812F1B4: - pop {r0} - bx r0 - thumb_func_end sub_812F150 - - thumb_func_start sub_812F1B8 -sub_812F1B8: @ 812F1B8 - push {lr} - adds r1, r0, 0 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0x1 - beq _0812F1EC - cmp r0, 0x1 - bgt _0812F1CE - cmp r0, 0 - beq _0812F1D8 - b _0812F216 -_0812F1CE: - cmp r0, 0x2 - beq _0812F1FC - cmp r0, 0x3 - beq _0812F212 - b _0812F216 -_0812F1D8: - ldrh r0, [r1, 0x20] - subs r0, 0x4 - strh r0, [r1, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xD0 - bgt _0812F216 - movs r0, 0xD0 - strh r0, [r1, 0x20] - b _0812F20A -_0812F1EC: - ldrh r0, [r1, 0x30] - adds r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5A - ble _0812F216 - b _0812F20A -_0812F1FC: - ldrh r0, [r1, 0x20] - subs r0, 0x4 - strh r0, [r1, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x90 - bgt _0812F216 -_0812F20A: - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - b _0812F216 -_0812F212: - movs r0, 0 - strh r0, [r1, 0x3C] -_0812F216: - pop {r0} - bx r0 - thumb_func_end sub_812F1B8 - - thumb_func_start sub_812F21C -sub_812F21C: @ 812F21C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x5 - bhi _0812F2C6 - lsls r0, 2 - ldr r1, =_0812F238 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0812F238: - .4byte _0812F250 - .4byte _0812F268 - .4byte _0812F288 - .4byte _0812F29C - .4byte _0812F2AC - .4byte _0812F2C2 -_0812F250: - ldr r0, =0x0203ab34 - ldr r0, [r0] - ldrb r1, [r0, 0xA] - subs r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_0812F268: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _0812F2C6 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0 - strh r0, [r4, 0x30] - b _0812F2C6 - .pool -_0812F288: - ldrh r0, [r4, 0x20] - adds r0, 0x4 - strh r0, [r4, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xCF - ble _0812F2C6 - movs r0, 0xD0 - strh r0, [r4, 0x20] - b _0812F2BA -_0812F29C: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5A - ble _0812F2C6 - b _0812F2BA -_0812F2AC: - ldrh r0, [r4, 0x20] - adds r0, 0x4 - strh r0, [r4, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF7 - ble _0812F2C6 -_0812F2BA: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0812F2C6 -_0812F2C2: - movs r0, 0 - strh r0, [r4, 0x3C] -_0812F2C6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812F21C - - thumb_func_start sub_812F2CC -sub_812F2CC: @ 812F2CC - push {lr} - adds r3, r0, 0 - movs r1, 0x2E - ldrsh r0, [r3, r1] - cmp r0, 0x1 - beq _0812F2FA - cmp r0, 0x1 - bgt _0812F2E2 - cmp r0, 0 - beq _0812F2E8 - b _0812F368 -_0812F2E2: - cmp r0, 0x2 - beq _0812F318 - b _0812F368 -_0812F2E8: - adds r2, r3, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] -_0812F2FA: - ldrh r0, [r3, 0x22] - adds r0, 0x8 - strh r0, [r3, 0x22] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6F - ble _0812F368 - movs r0, 0x70 - strh r0, [r3, 0x22] - movs r0, 0x10 - strh r0, [r3, 0x30] - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - b _0812F368 -_0812F318: - movs r0, 0x32 - ldrsh r2, [r3, r0] - cmp r2, 0 - bne _0812F35E - ldrh r0, [r3, 0x22] - ldrh r1, [r3, 0x30] - subs r0, r1 - strh r0, [r3, 0x22] - negs r1, r1 - strh r1, [r3, 0x30] - ldrh r0, [r3, 0x34] - adds r0, 0x1 - strh r0, [r3, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0812F35E - lsls r0, r1, 16 - asrs r0, 18 - strh r0, [r3, 0x30] - strh r2, [r3, 0x34] - adds r1, r0, 0 - cmp r1, 0 - bne _0812F35E - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - strh r1, [r3, 0x3C] - adds r2, r3, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_0812F35E: - ldrh r0, [r3, 0x32] - adds r0, 0x1 - movs r1, 0x7 - ands r0, r1 - strh r0, [r3, 0x32] -_0812F368: - pop {r0} - bx r0 - thumb_func_end sub_812F2CC - - thumb_func_start sub_812F36C -sub_812F36C: @ 812F36C - push {lr} - adds r1, r0, 0 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _0812F37E - cmp r0, 0x1 - beq _0812F394 - b _0812F3B0 -_0812F37E: - ldrh r0, [r1, 0x30] - adds r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _0812F3B0 - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - b _0812F3B0 -_0812F394: - ldrh r0, [r1, 0x22] - adds r0, 0x2 - strh r0, [r1, 0x22] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2F - ble _0812F3B0 - movs r0, 0x30 - strh r0, [r1, 0x22] - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - movs r0, 0 - strh r0, [r1, 0x3C] -_0812F3B0: - pop {r0} - bx r0 - thumb_func_end sub_812F36C - - thumb_func_start sub_812F3B4 -sub_812F3B4: @ 812F3B4 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0812F3C6 - cmp r0, 0x1 - beq _0812F416 - b _0812F468 -_0812F3C6: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x20 - ble _0812F468 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0x5 - strh r0, [r4, 0x30] - ldrb r0, [r4, 0x1] - movs r1, 0x10 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnim - ldrh r0, [r4, 0x30] - lsls r1, r0, 4 - orrs r1, r0 - lsls r1, 24 - lsrs r1, 16 - movs r0, 0x4C - bl SetGpuReg - b _0812F468 -_0812F416: - ldrh r1, [r4, 0x32] - lsls r1, 16 - asrs r1, 24 - ldrh r0, [r4, 0x30] - subs r0, r1 - strh r0, [r4, 0x30] - lsls r0, 16 - cmp r0, 0 - bge _0812F42C - movs r0, 0 - strh r0, [r4, 0x30] -_0812F42C: - ldrh r0, [r4, 0x30] - lsls r1, r0, 4 - orrs r1, r0 - lsls r1, 24 - lsrs r1, 16 - movs r0, 0x4C - bl SetGpuReg - ldrh r1, [r4, 0x32] - movs r0, 0xFF - ands r0, r1 - adds r0, 0x80 - strh r0, [r4, 0x32] - movs r0, 0x30 - ldrsh r1, [r4, r0] - cmp r1, 0 - bne _0812F468 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - strh r1, [r4, 0x3C] - ldrb r1, [r4, 0x1] - movs r0, 0x11 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x1] - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnim -_0812F468: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812F3B4 - - thumb_func_start sub_812F470 -sub_812F470: @ 812F470 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x30 - ldrsh r0, [r5, r1] - cmp r0, 0x2 - bgt _0812F4C0 - ldr r1, =gUnknown_085A8510 - lsls r0, 2 - adds r0, r1 - ldr r4, [r0] - movs r0, 0x6 - bl IndexOfObjectPaletteTag - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 4 - movs r0, 0x80 - lsls r0, 17 - adds r1, r0 - lsrs r1, 16 - adds r0, r4, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldrh r0, [r5, 0x32] - adds r0, 0x1 - strh r0, [r5, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _0812F4FC - ldrh r0, [r5, 0x30] - adds r0, 0x1 - strh r0, [r5, 0x30] - movs r0, 0 - strh r0, [r5, 0x32] - b _0812F4FC - .pool -_0812F4C0: - ldr r1, =gUnknown_085A8510 - movs r2, 0x30 - ldrsh r0, [r5, r2] - lsls r0, 2 - adds r0, r1 - ldr r4, [r0] - movs r0, 0x6 - bl IndexOfObjectPaletteTag - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 4 - movs r0, 0x80 - lsls r0, 17 - adds r1, r0 - lsrs r1, 16 - adds r0, r4, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldrh r0, [r5, 0x32] - adds r0, 0x1 - movs r1, 0 - strh r0, [r5, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x18 - ble _0812F4FC - strh r1, [r5, 0x30] - strh r1, [r5, 0x32] -_0812F4FC: - adds r0, r5, 0 - movs r1, 0x1 - bl StartObjectImageAnimIfDifferent - movs r0, 0 - strh r0, [r5, 0x3C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812F470 - - thumb_func_start sub_812F514 -sub_812F514: @ 812F514 - push {r4-r6,lr} - sub sp, 0x30 - adds r4, r0, 0 - ldr r1, =gUnknown_085A762E - mov r0, sp - movs r2, 0x10 - bl memcpy - add r6, sp, 0x10 - ldr r1, =gUnknown_085A763E - adds r0, r6, 0 - movs r2, 0x10 - bl memcpy - add r5, sp, 0x20 - ldr r1, =gUnknown_085A764E - adds r0, r5, 0 - movs r2, 0x10 - bl memcpy - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0812F58C - cmp r0, 0x1 - bgt _0812F55C - cmp r0, 0 - beq _0812F562 - b _0812F5D8 - .pool -_0812F55C: - cmp r0, 0x2 - beq _0812F5A0 - b _0812F5D8 -_0812F562: - movs r2, 0x3A - ldrsh r0, [r4, r2] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - strh r0, [r4, 0x24] - movs r1, 0x3A - ldrsh r0, [r4, r1] - lsls r0, 1 - adds r0, r6, r0 - ldrh r0, [r0] - strh r0, [r4, 0x26] - movs r2, 0x3A - ldrsh r0, [r4, r2] - lsls r0, 1 - adds r0, r5, r0 - ldrh r0, [r0] - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_0812F58C: - ldrh r0, [r4, 0x30] - subs r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0812F5D8 - b _0812F5D2 -_0812F5A0: - ldrh r0, [r4, 0x24] - movs r2, 0x24 - ldrsh r1, [r4, r2] - cmp r1, 0 - ble _0812F5AE - subs r0, 0x4 - b _0812F5B4 -_0812F5AE: - cmp r1, 0 - bge _0812F5B6 - adds r0, 0x4 -_0812F5B4: - strh r0, [r4, 0x24] -_0812F5B6: - ldrh r0, [r4, 0x26] - movs r2, 0x26 - ldrsh r1, [r4, r2] - cmp r1, 0 - ble _0812F5C4 - subs r0, 0x4 - b _0812F5CA -_0812F5C4: - cmp r1, 0 - bge _0812F5CC - adds r0, 0x4 -_0812F5CA: - strh r0, [r4, 0x26] -_0812F5CC: - ldr r0, [r4, 0x24] - cmp r0, 0 - bne _0812F5D8 -_0812F5D2: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_0812F5D8: - add sp, 0x30 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_812F514 - - thumb_func_start sub_812F5E0 -sub_812F5E0: @ 812F5E0 - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - ldr r1, =gUnknown_085A765E - mov r0, sp - movs r2, 0x10 - bl memcpy - ldrh r1, [r4, 0x2E] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0812F602 - adds r0, r1, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0xC - strh r0, [r4, 0x30] -_0812F602: - movs r1, 0x3A - ldrsh r0, [r4, r1] - lsls r0, 1 - add r0, sp - movs r2, 0 - ldrsh r0, [r0, r2] - movs r2, 0x30 - ldrsh r1, [r4, r2] - bl cosine - strh r0, [r4, 0x24] - movs r1, 0x3A - ldrsh r0, [r4, r1] - lsls r0, 1 - add r0, sp - movs r2, 0 - ldrsh r0, [r0, r2] - movs r2, 0x30 - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x26] - ldrh r1, [r4, 0x30] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0812F63C - subs r0, r1, 0x1 - strh r0, [r4, 0x30] -_0812F63C: - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812F5E0 - - thumb_func_start sub_812F648 -sub_812F648: @ 812F648 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _0812F694 - cmp r0, 0x1 - bgt _0812F660 - cmp r0, 0 - beq _0812F66A - b _0812F76C -_0812F660: - cmp r0, 0x2 - beq _0812F6E0 - cmp r0, 0x3 - beq _0812F71C - b _0812F76C -_0812F66A: - ldr r0, =0x0203ab34 - ldr r2, [r0] - adds r1, r2, 0 - adds r1, 0x5C - movs r0, 0x2F - strh r0, [r1] - adds r1, 0x2 - movs r0, 0x3F - strh r0, [r1] - subs r1, 0x4 - ldr r0, =0x00002088 - strh r0, [r1] - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] -_0812F694: - ldrh r0, [r5, 0x30] - adds r2, r0, 0x2 - strh r2, [r5, 0x30] - adds r0, 0xB2 - strh r0, [r5, 0x32] - movs r1, 0xF0 - subs r1, r2 - strh r1, [r5, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xD0 - ble _0812F6B0 - movs r0, 0xD0 - strh r0, [r5, 0x32] -_0812F6B0: - movs r1, 0x34 - ldrsh r0, [r5, r1] - cmp r0, 0xCF - bgt _0812F6BC - movs r0, 0xD0 - strh r0, [r5, 0x34] -_0812F6BC: - ldr r0, =0x0203ab34 - ldr r2, [r0] - ldrh r0, [r5, 0x32] - lsls r0, 8 - ldrh r1, [r5, 0x34] - orrs r0, r1 - adds r1, r2, 0 - adds r1, 0x58 - strh r0, [r1] - movs r1, 0x30 - ldrsh r0, [r5, r1] - cmp r0, 0x33 - ble _0812F76C - b _0812F75E - .pool -_0812F6E0: - ldr r6, =0x0203ab34 - ldr r0, [r6] - movs r1, 0x12 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _0812F76C - ldr r1, =DummyObjectCallback - movs r4, 0 - str r4, [sp] - movs r0, 0x5 - movs r2, 0xD0 - movs r3, 0x74 - bl sub_812DF68 - ldr r2, [r6] - adds r1, r2, 0 - adds r1, 0x58 - ldr r0, =0x0000c0e0 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0xD1 - lsls r0, 7 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0x2F - strh r0, [r1] - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - strh r4, [r5, 0x30] -_0812F71C: - ldrh r0, [r5, 0x30] - adds r2, r0, 0x2 - strh r2, [r5, 0x30] - adds r0, 0xC2 - strh r0, [r5, 0x32] - movs r1, 0xE0 - subs r1, r2 - strh r1, [r5, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xD0 - ble _0812F738 - movs r0, 0xD0 - strh r0, [r5, 0x32] -_0812F738: - movs r1, 0x34 - ldrsh r0, [r5, r1] - cmp r0, 0xCF - bgt _0812F744 - movs r0, 0xD0 - strh r0, [r5, 0x34] -_0812F744: - ldr r0, =0x0203ab34 - ldr r2, [r0] - ldrh r0, [r5, 0x32] - lsls r0, 8 - ldrh r1, [r5, 0x34] - orrs r0, r1 - adds r1, r2, 0 - adds r1, 0x58 - strh r0, [r1] - movs r1, 0x30 - ldrsh r0, [r5, r1] - cmp r0, 0xF - ble _0812F76C -_0812F75E: - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - adds r1, r2, 0 - adds r1, 0x5C - movs r0, 0x3F - strh r0, [r1] -_0812F76C: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812F648 - - thumb_func_start nullsub_101 -nullsub_101: @ 812F780 - bx lr - thumb_func_end nullsub_101 - - thumb_func_start sub_812F784 -sub_812F784: @ 812F784 - push {lr} - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - pop {r0} - bx r0 - thumb_func_end sub_812F784 - - thumb_func_start sub_812F794 -sub_812F794: @ 812F794 - push {r4,lr} - ldr r0, =gUnknown_085A8520 - ldr r4, [r0] - movs r0, 0x6 - bl IndexOfObjectPaletteTag - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 4 - movs r0, 0x80 - lsls r0, 17 - adds r1, r0 - lsrs r1, 16 - adds r0, r4, 0 - movs r2, 0x20 - bl gpu_pal_apply - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812F794 - - thumb_func_start sub_812F7C0 -sub_812F7C0: @ 812F7C0 - ldr r0, =0x0203ab34 - ldr r2, [r0] - adds r1, r2, 0 - adds r1, 0x58 - movs r0, 0xF0 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0xA0 - strh r0, [r1] - adds r0, r2, 0 - adds r0, 0x5C - movs r1, 0x3F - strh r1, [r0] - adds r0, 0x2 - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_812F7C0 - - thumb_func_start sub_812F7E4 -sub_812F7E4: @ 812F7E4 - push {r4-r6,lr} - bl sub_812F8A0 - ldr r4, =0x0203aad4 - movs r0, 0xC8 - lsls r0, 6 - bl Alloc - adds r1, r0, 0 - str r1, [r4] - ldr r0, =gUnknown_08DD0050 - bl LZDecompressWram - ldr r4, =0x0203aad8 - movs r0, 0xD8 - lsls r0, 6 - bl Alloc - adds r1, r0, 0 - str r1, [r4] - ldr r0, =gUnknown_085A858C - bl LZDecompressWram - ldr r4, =0x0203ab30 - movs r0, 0xB0 - bl AllocZeroed - str r0, [r4] - movs r3, 0 - ldr r5, =gUnknown_085A8334 - adds r6, r4, 0 -_0812F822: - ldr r2, [r4] - lsls r1, r3, 3 - adds r2, r1, r2 - adds r1, r5 - ldr r0, [r1] - str r0, [r2] - ldrh r0, [r1, 0x4] - strh r0, [r2, 0x4] - ldrh r0, [r1, 0x6] - strh r0, [r2, 0x6] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x15 - bls _0812F822 - ldr r3, [r6] - adds r2, r3, 0 - adds r2, 0x88 - ldr r0, =0x0203aad4 - ldr r1, [r0] - movs r4, 0xA0 - lsls r4, 4 - adds r0, r1, r4 - str r0, [r2] - adds r2, 0x8 - movs r4, 0xA0 - lsls r4, 5 - adds r0, r1, r4 - str r0, [r2] - adds r2, 0x8 - movs r4, 0xB0 - lsls r4, 5 - adds r0, r1, r4 - str r0, [r2] - adds r0, r3, 0 - adds r0, 0xA0 - movs r2, 0xC8 - lsls r2, 5 - adds r1, r2 - str r1, [r0] - adds r0, r3, 0 - bl LoadObjectPics - ldr r0, =gUnknown_085A8544 - bl LoadTaggedObjectPalettes - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812F7E4 - - thumb_func_start sub_812F8A0 -sub_812F8A0: @ 812F8A0 - push {r4-r6,lr} - ldr r5, =0x0203ab2c - movs r0, 0x8 - bl AllocZeroed - str r0, [r5] - ldr r4, =0x0203aae0 - movs r0, 0x80 - lsls r0, 6 - bl AllocZeroed - str r0, [r4] - adds r3, r0, 0 - movs r1, 0 - adds r6, r4, 0 - ldr r0, =gUnknown_085A83E4 - ldr r4, [r0] -_0812F8C2: - movs r2, 0 - adds r1, 0x1 -_0812F8C6: - adds r0, r4, r2 - ldrb r0, [r0] - strb r0, [r3] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - adds r3, 0x1 - cmp r2, 0x1F - bls _0812F8C6 - lsls r0, r1, 24 - lsrs r1, r0, 24 - cmp r1, 0x3F - bls _0812F8C2 - ldr r0, [r5] - ldr r1, [r6] - str r1, [r0] - movs r1, 0x80 - lsls r1, 4 - strh r1, [r0, 0x4] - movs r1, 0x11 - strh r1, [r0, 0x6] - bl LoadObjectPic - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812F8A0 - - thumb_func_start sub_812F908 -sub_812F908: @ 812F908 - push {r4,r5,lr} - ldr r4, =0x0203aac8 - movs r5, 0x88 - lsls r5, 6 - adds r0, r5, 0 - bl Alloc - adds r1, r0, 0 - str r1, [r4] - ldr r0, =gUnknown_08DCDB30 - bl LZDecompressWram - ldr r1, [r4] - movs r0, 0x2 - adds r2, r5, 0 - movs r3, 0 - bl LoadBgTiles - ldr r0, =gUnknown_08DCDA90 - movs r1, 0 - movs r2, 0xA0 - bl gpu_pal_apply - ldr r0, =gUnknown_085A8524 - movs r1, 0xD0 - movs r2, 0x20 - bl gpu_pal_apply - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812F908 - - thumb_func_start sub_812F958 -sub_812F958: @ 812F958 - push {lr} - bl sub_812F968 - bl sub_812F980 - pop {r0} - bx r0 - thumb_func_end sub_812F958 - - thumb_func_start sub_812F968 -sub_812F968: @ 812F968 - push {lr} - ldr r1, =gUnknown_08DCE770 - movs r2, 0xA0 - lsls r2, 3 - movs r0, 0x2 - movs r3, 0 - bl LoadBgTilemap - pop {r0} - bx r0 - .pool - thumb_func_end sub_812F968 - - thumb_func_start sub_812F980 -sub_812F980: @ 812F980 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r1, 0x4 - ldr r0, =0x0203aad0 - mov r8, r0 -_0812F98E: - movs r0, 0 - lsls r1, 16 - mov r9, r1 -_0812F994: - mov r2, r8 - ldr r1, [r2] - mov r2, r9 - asrs r6, r2, 16 - lsls r4, r0, 16 - asrs r4, 16 - adds r5, r6, r4 - adds r3, r5, 0 - adds r3, 0xA0 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x3 - movs r2, 0x2 - bl LoadBgTilemap - mov r0, r8 - ldr r1, [r0] - adds r1, 0x2 - movs r2, 0xD0 - lsls r2, 1 - adds r3, r5, r2 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x3 - movs r2, 0x2 - bl LoadBgTilemap - mov r0, r8 - ldr r1, [r0] - adds r1, 0x4 - adds r3, r5, 0 - adds r3, 0xC0 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x3 - movs r2, 0x2 - bl LoadBgTilemap - mov r2, r8 - ldr r1, [r2] - adds r1, 0x6 - movs r0, 0xC0 - lsls r0, 1 - adds r7, r0, 0 - adds r3, r5, r7 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x3 - movs r2, 0x2 - bl LoadBgTilemap - adds r4, 0x1 - lsls r4, 16 - lsrs r0, r4, 16 - asrs r4, 16 - cmp r4, 0x3 - ble _0812F994 - mov r2, r8 - ldr r1, [r2] - adds r1, 0x8 - adds r3, r6, 0 - adds r3, 0xC0 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x3 - movs r2, 0x2 - bl LoadBgTilemap - mov r0, r8 - ldr r1, [r0] - adds r1, 0xA - adds r3, r6, r7 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x3 - movs r2, 0x2 - bl LoadBgTilemap - movs r0, 0x7 -_0812FA32: - mov r2, r8 - ldr r1, [r2] - adds r1, 0xC - lsls r4, r0, 16 - asrs r4, 16 - lsls r3, r4, 5 - mov r0, r9 - asrs r5, r0, 16 - adds r3, r5, r3 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x3 - movs r2, 0x2 - bl LoadBgTilemap - adds r4, 0x1 - lsls r4, 16 - lsrs r0, r4, 16 - asrs r4, 16 - cmp r4, 0xB - ble _0812FA32 - adds r0, r5, 0x5 - lsls r0, 16 - lsrs r1, r0, 16 - asrs r0, 16 - cmp r0, 0x11 - ble _0812F98E - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812F980 - - thumb_func_start sub_812FA78 -sub_812FA78: @ 812FA78 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r5, [sp, 0x10] - ldr r6, =0x0203aadc - ldr r0, [r6] - strh r1, [r0] - ldr r1, [r6] - strh r2, [r1, 0x2] - strh r3, [r1, 0x4] - strh r5, [r1, 0x6] - lsls r4, 16 - asrs r5, r4, 16 - movs r0, 0xF0 - lsls r0, 17 - adds r4, r0 - lsrs r4, 16 - movs r0, 0x2 - movs r2, 0x2 - adds r3, r4, 0 - bl LoadBgTilemap - ldr r1, [r6] - adds r1, 0x2 - ldr r0, =0x000001e1 - adds r3, r5, r0 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x2 - movs r2, 0x2 - bl LoadBgTilemap - ldr r1, [r6] - adds r1, 0x4 - movs r0, 0x80 - lsls r0, 2 - adds r3, r5, r0 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x2 - movs r2, 0x2 - bl LoadBgTilemap - ldr r1, [r6] - adds r1, 0x6 - ldr r0, =0x00000201 - adds r5, r0 - lsls r5, 16 - lsrs r5, 16 - movs r0, 0x2 - movs r2, 0x2 - adds r3, r5, 0 - bl LoadBgTilemap - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812FA78 - - thumb_func_start sub_812FAF4 -sub_812FAF4: @ 812FAF4 - push {lr} - ldr r1, =gUnknown_08DCEC70 - movs r2, 0xA0 - lsls r2, 3 - movs r0, 0x2 - movs r3, 0 - bl LoadBgTilemap - movs r0, 0x3 - bl HideBg - pop {r0} - bx r0 - .pool - thumb_func_end sub_812FAF4 - - thumb_func_start sub_812FB14 -sub_812FB14: @ 812FB14 - ldr r1, =0x03001188 - ldr r0, =0x0203aaf4 - ldr r0, [r0] - str r0, [r1] - ldr r0, =0x0203aaf8 - ldr r0, [r0] - str r0, [r1, 0x4] - ldr r0, =0x0203aafc - ldr r0, [r0] - str r0, [r1, 0x8] - ldr r0, =0x0203ab04 - ldr r0, [r0] - str r0, [r1, 0xC] - ldr r0, =0x0203ab08 - ldr r0, [r0] - str r0, [r1, 0x10] - ldr r0, =0x0203ab18 - ldr r0, [r0] - str r0, [r1, 0x14] - ldr r0, =0x0203ab1c - ldr r0, [r0] - str r0, [r1, 0x18] - ldr r0, =0x0203ab20 - ldr r0, [r0] - str r0, [r1, 0x1C] - ldr r0, =0x0203ab24 - ldr r0, [r0] - str r0, [r1, 0x20] - ldr r0, =0x0203ab28 - ldr r0, [r0] - str r0, [r1, 0x24] - ldr r0, =0x0203ab00 - ldr r0, [r0] - str r0, [r1, 0x28] - str r0, [r1, 0x2C] - str r0, [r1, 0x30] - str r0, [r1, 0x34] - ldr r0, =0x0203ab0c - ldr r0, [r0] - str r0, [r1, 0x38] - str r0, [r1, 0x3C] - str r0, [r1, 0x40] - str r0, [r1, 0x44] - str r0, [r1, 0x48] - ldr r0, =0x0203ab10 - ldr r0, [r0] - str r0, [r1, 0x4C] - str r0, [r1, 0x50] - str r0, [r1, 0x54] - ldr r0, =0x0203ab14 - ldr r0, [r0] - str r0, [r1, 0x58] - str r0, [r1, 0x5C] - str r0, [r1, 0x60] - movs r0, 0 - str r0, [r1, 0x64] - bx lr - .pool - thumb_func_end sub_812FB14 - - thumb_func_start sub_812FBC4 -sub_812FBC4: @ 812FBC4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r4, =0x0203aaf4 - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] - ldr r6, =0x0203aad4 - ldr r1, [r6] - str r1, [r0] - movs r5, 0xC0 - lsls r5, 3 - strh r5, [r0, 0x4] - ldr r4, =0x0203aaf8 - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] - ldr r1, [r6] - adds r1, r5 - str r1, [r0] - movs r1, 0x80 - lsls r1, 2 - mov r8, r1 - mov r2, r8 - strh r2, [r0, 0x4] - ldr r4, =0x0203aafc - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] - ldr r1, [r6] - movs r3, 0x80 - lsls r3, 4 - adds r1, r3 - str r1, [r0] - mov r4, r8 - strh r4, [r0, 0x4] - ldr r4, =0x0203ab00 - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] - ldr r1, [r6] - movs r2, 0xA0 - lsls r2, 4 - adds r1, r2 - str r1, [r0] - mov r3, r8 - strh r3, [r0, 0x4] - ldr r4, =0x0203ab04 - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] - ldr r1, [r6] - movs r4, 0xC0 - lsls r4, 4 - adds r1, r4 - str r1, [r0] - movs r5, 0xC0 - lsls r5, 2 - strh r5, [r0, 0x4] - ldr r4, =0x0203ab08 - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] - ldr r1, [r6] - movs r2, 0x80 - lsls r2, 5 - adds r1, r2 - str r1, [r0] - movs r1, 0x80 - lsls r1, 3 - strh r1, [r0, 0x4] - ldr r4, =0x0203ab0c - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] - ldr r1, [r6] - movs r3, 0xA0 - lsls r3, 5 - adds r1, r3 - str r1, [r0] - mov r4, r8 - strh r4, [r0, 0x4] - ldr r4, =0x0203ab10 - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] - ldr r1, [r6] - movs r2, 0xB0 - lsls r2, 5 - adds r1, r2 - str r1, [r0] - strh r5, [r0, 0x4] - ldr r4, =0x0203ab14 - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] - ldr r1, [r6] - movs r3, 0xC8 - lsls r3, 5 - adds r1, r3 - str r1, [r0] - strh r5, [r0, 0x4] - ldr r4, =0x0203ab18 - movs r0, 0x10 - bl AllocZeroed - str r0, [r4] - ldr r1, [r6] - movs r4, 0xE0 - lsls r4, 5 - adds r2, r1, r4 - str r2, [r0] - mov r2, r8 - strh r2, [r0, 0x4] - movs r3, 0xF0 - lsls r3, 5 - adds r1, r3 - str r1, [r0, 0x8] - strh r2, [r0, 0xC] - ldr r4, =0x0203ab1c - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] - ldr r1, [r6] - movs r4, 0x80 - lsls r4, 6 - adds r1, r4 - str r1, [r0] - movs r1, 0xA0 - lsls r1, 2 - strh r1, [r0, 0x4] - ldr r4, =0x0203ab20 - movs r0, 0x28 - bl AllocZeroed - str r0, [r4] - ldr r2, [r6] - movs r3, 0x8A - lsls r3, 6 - adds r1, r2, r3 - str r1, [r0] - movs r3, 0x80 - strh r3, [r0, 0x4] - movs r4, 0x8C - lsls r4, 6 - adds r1, r2, r4 - str r1, [r0, 0x8] - strh r3, [r0, 0xC] - adds r4, 0x80 - adds r1, r2, r4 - str r1, [r0, 0x10] - strh r3, [r0, 0x14] - adds r4, 0x80 - adds r1, r2, r4 - str r1, [r0, 0x18] - strh r3, [r0, 0x1C] - movs r1, 0x92 - lsls r1, 6 - adds r2, r1 - str r2, [r0, 0x20] - strh r3, [r0, 0x24] - ldr r4, =0x0203ab24 - movs r0, 0x10 - bl AllocZeroed - str r0, [r4] - ldr r2, [r6] - movs r3, 0x98 - lsls r3, 6 - adds r1, r2, r3 - str r1, [r0] - movs r1, 0x90 - lsls r1, 3 - strh r1, [r0, 0x4] - movs r4, 0xAA - lsls r4, 6 - adds r2, r4 - str r2, [r0, 0x8] - strh r1, [r0, 0xC] - ldr r4, =0x0203ab28 - movs r0, 0x10 - bl AllocZeroed - str r0, [r4] - ldr r2, [r6] - movs r3, 0xBC - lsls r3, 6 - adds r1, r2, r3 - str r1, [r0] - movs r1, 0xC0 - lsls r1, 1 - strh r1, [r0, 0x4] - movs r4, 0xC2 - lsls r4, 6 - adds r2, r4 - str r2, [r0, 0x8] - strh r1, [r0, 0xC] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812FBC4 - - thumb_func_start sub_812FDA8 -sub_812FDA8: @ 812FDA8 - push {r4-r7,lr} - ldr r3, =0x02039f5d - ldr r4, =0x02039f5c - ldr r1, =0x03005d8c - ldr r2, [r1] - subs r0, 0x1 - lsls r1, r0, 5 - adds r2, r1 - ldr r1, =0x02039f3c - ldr r5, =0x00002e90 - adds r2, r5 - ldm r2!, {r5-r7} - stm r1!, {r5-r7} - ldm r2!, {r5-r7} - stm r1!, {r5-r7} - ldm r2!, {r6,r7} - stm r1!, {r6,r7} - strb r0, [r3] - movs r0, 0 - strb r0, [r4] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812FDA8 - - thumb_func_start sub_812FDEC -sub_812FDEC: @ 812FDEC - push {lr} - bl sub_812FE58 - pop {r0} - bx r0 - thumb_func_end sub_812FDEC - - thumb_func_start sub_812FDF8 -sub_812FDF8: @ 812FDF8 - push {lr} - bl sub_812FFC8 - bl RunTextPrinters - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_812FDF8 - - thumb_func_start sub_812FE0C -sub_812FE0C: @ 812FE0C - push {r4,r5,lr} - ldr r0, =0x030022c0 - ldr r0, [r0, 0x8] - bl SetMainCallback2 - ldr r4, =0x030061c4 - ldr r0, [r4] - bl Free - movs r5, 0 - str r5, [r4] - ldr r4, =0x03006190 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r0, =0x030011f7 - ldrb r0, [r0] - bl RemoveWindow - movs r0, 0x1 - bl GetBgTilemapBuffer - bl Free - bl sub_805F094 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812FE0C - - thumb_func_start sub_812FE58 -sub_812FE58: @ 812FE58 - push {r4-r7,lr} - sub sp, 0x4 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r4, r1, 0 - cmp r0, 0x4 - bls _0812FE6E - b _0812FFA0 -_0812FE6E: - lsls r0, 2 - ldr r1, =_0812FE80 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0812FE80: - .4byte _0812FE94 - .4byte _0812FEC8 - .4byte _0812FF14 - .4byte _0812FF2A - .4byte _0812FF54 -_0812FE94: - bl remove_some_task - movs r0, 0 - bl SetVBlankCallback - bl init_uns_table_pokemon_copy - ldr r1, =0x030061c0 - ldr r0, =0x02039f3c - str r0, [r1] - movs r0, 0x1 - bl sub_8130238 - bl sub_81301EC - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0812FF3E - .pool -_0812FEC8: - bl sub_80A1A74 - movs r2, 0xC0 - lsls r2, 19 - movs r3, 0xC0 - lsls r3, 9 - movs r5, 0 - ldr r1, =0x040000d4 - movs r4, 0x80 - lsls r4, 5 - ldr r6, =0x85000400 - movs r7, 0x85 - lsls r7, 24 -_0812FEE2: - str r5, [sp] - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - str r6, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r2, r4 - subs r3, r4 - cmp r3, r4 - bhi _0812FEE2 - str r5, [sp] - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - lsrs r0, r3, 2 - orrs r0, r7 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - bl ResetAllObjectData - b _0812FF36 - .pool -_0812FF14: - ldrh r0, [r4, 0x20] - bl SeedRng - bl InitKeypadData - bl sub_8130098 - movs r0, 0x87 - lsls r0, 3 - adds r1, r4, r0 - b _0812FF3E -_0812FF2A: - ldr r0, =0x02039f5d - ldrb r0, [r0] - ldr r1, =0x02039f5c - ldrb r1, [r1] - bl sub_8130884 -_0812FF36: - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_0812FF3E: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0812FFA0 - .pool -_0812FF54: - ldr r0, =0x02039f5d - ldrb r0, [r0] - ldr r1, =0x02039f5c - ldrb r1, [r1] - bl sub_813010C - ldr r0, =gUnknown_085B0838 - movs r1, 0 - movs r2, 0x2 - bl gpu_pal_apply - movs r1, 0xA0 - lsls r1, 19 - movs r4, 0 - str r4, [sp] - ldr r0, =0x040000d4 - mov r2, sp - str r2, [r0] - str r1, [r0, 0x4] - ldr r1, =0x85000100 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - movs r0, 0x2 - bl sub_80A2390 - ldr r0, =sub_81302D0 - bl SetVBlankCallback - ldr r0, =0x030011f0 - strb r4, [r0] - movs r1, 0x9A - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r0, =sub_812FDF8 - bl SetMainCallback2 -_0812FFA0: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812FE58 - - thumb_func_start sub_812FFC8 -sub_812FFC8: @ 812FFC8 - push {lr} - sub sp, 0x4 - ldr r3, =0x030011f0 - ldrb r1, [r3] - cmp r1, 0x1 - beq _0813001C - cmp r1, 0x1 - bgt _0812FFE4 - cmp r1, 0 - beq _0812FFEA - b _08130082 - .pool -_0812FFE4: - cmp r1, 0x2 - beq _0813005C - b _08130082 -_0812FFEA: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0812FFFA - movs r0, 0x1 - strb r0, [r3] -_0812FFFA: - ldr r0, =0x030011f6 - ldrb r0, [r0] - cmp r0, 0 - beq _08130082 - ldr r1, =0x030011f4 - ldrh r0, [r1] - cmp r0, 0 - beq _08130082 - subs r0, 0x1 - b _08130080 - .pool -_0813001C: - ldr r0, =0x030022c0 - ldrh r2, [r0, 0x2E] - ands r1, r2 - cmp r1, 0 - bne _0813002E - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - beq _08130040 -_0813002E: - movs r0, 0x2 - strb r0, [r3] - subs r0, 0x3 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe -_08130040: - ldr r0, =0x030011f6 - ldrb r0, [r0] - cmp r0, 0 - beq _08130082 - ldr r1, =0x030011f4 - movs r0, 0 - b _08130080 - .pool -_0813005C: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0813006E - ldr r0, =sub_812FE0C - bl SetMainCallback2 -_0813006E: - ldr r0, =0x030011f6 - ldrb r0, [r0] - cmp r0, 0 - beq _08130082 - ldr r1, =0x030011f4 - ldrh r0, [r1] - cmp r0, 0x1D - bhi _08130082 - adds r0, 0x1 -_08130080: - strh r0, [r1] -_08130082: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_812FFC8 - - thumb_func_start sub_8130098 -sub_8130098: @ 8130098 - push {r4,lr} - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085B07E8 - movs r0, 0 - movs r2, 0x1 - bl InitBgsFromTemplates - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x80 - lsls r0, 4 - bl AllocZeroed - adds r1, r0, 0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r4, =0x030011f7 - ldr r0, =gUnknown_085B07EC - bl AddWindow - strb r0, [r4] - bl DeactivateAllTextPrinters - ldrb r0, [r4] - movs r1, 0 - bl FillWindowPixelBuffer - ldrb r0, [r4] - bl PutWindowTilemap - ldrb r0, [r4] - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0x1 - bl ShowBg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8130098 - - thumb_func_start sub_813010C -sub_813010C: @ 813010C - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x1 - beq _081301D4 - ldr r6, =0x030061c0 - ldr r1, [r6] - ldrb r5, [r1, 0xA] - cmp r0, 0x7 - bhi _08130190 - ldr r4, =0x02021cc4 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_818E868 - ldr r1, =gUnknown_085E8D5E - adds r0, r4, 0 - bl AppendString - ldr r1, =gUnknown_085B07D4 - ldr r0, [r6] - ldrb r0, [r0, 0x1E] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r4, 0 - bl AppendString - ldr r4, =0x02021dc4 - ldr r1, [r6] - adds r1, 0x16 - adds r0, r4, 0 - bl CopyString - adds r0, r4, 0 - bl sub_81DB5AC - ldr r0, =0x02021ec4 - ldr r1, [r6] - adds r1, 0xB - bl CopyString - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_0827EA0C - bl ExpandStringRefs - b _081301A6 - .pool -_08130190: - ldr r0, =0x02021cc4 - adds r1, 0xB - bl CopyString - ldr r0, =0x02021fc4 - ldr r2, =gUnknown_085B07F4 - lsls r1, r5, 2 - adds r1, r2 - ldr r1, [r1] - bl ExpandStringRefs -_081301A6: - ldr r4, =0x02021fc4 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xD0 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - ldr r0, =0x030011f7 - ldrb r0, [r0] - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x1 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - bl Print - movs r0, 0x1 - bl CopyBgTilemapBufferToVram -_081301D4: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813010C - - thumb_func_start sub_81301EC -sub_81301EC: @ 81301EC - push {lr} - movs r0, 0 - movs r1, 0 - bl SetGpuReg - ldr r2, =0x04000200 - ldrh r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strh r0, [r2] - ldr r1, =0x00000c42 - movs r0, 0x8 - bl SetGpuReg - ldr r1, =0x00000a45 - movs r0, 0xA - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end sub_81301EC - - thumb_func_start sub_8130238 -sub_8130238: @ 8130238 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0813025C - ldr r0, =0x030011f6 - strb r1, [r0] - ldr r0, =0x030011f2 - strh r1, [r0] - ldr r0, =0x030011f4 - strh r1, [r0] - b _0813026E - .pool -_0813025C: - ldr r1, =0x030011f6 - movs r0, 0x1 - strb r0, [r1] - ldr r1, =0x030011f2 - movs r0, 0xF - strh r0, [r1] - ldr r1, =0x030011f4 - movs r0, 0x1E - strh r0, [r1] -_0813026E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8130238 - - thumb_func_start sub_8130280 -sub_8130280: @ 8130280 - push {lr} - ldr r0, =0x030011f6 - ldrb r0, [r0] - cmp r0, 0 - bne _08130298 - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - b _081302C0 - .pool -_08130298: - ldr r1, =0x00000a45 - movs r0, 0xA - bl SetGpuReg - ldr r1, =0x030011f2 - ldr r0, =0x030011f4 - ldrh r0, [r0] - lsrs r0, 1 - strh r0, [r1] - lsls r1, r0, 12 - lsls r2, r0, 8 - orrs r1, r2 - lsls r2, r0, 4 - orrs r1, r2 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x4C - bl SetGpuReg -_081302C0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8130280 - - thumb_func_start sub_81302D0 -sub_81302D0: @ 81302D0 - push {lr} - bl sub_8130280 - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_81302D0 - - thumb_func_start sub_81302E8 -sub_81302E8: @ 81302E8 - push {r4-r7,lr} - adds r4, r1, 0 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r4, 24 - lsrs r4, 24 - ldr r6, =0x030061c0 - ldr r0, [r6] - ldr r1, [r0, 0x4] - ldr r2, [r0] - adds r0, r5, 0 - bl species_and_otid_get_pal - ldr r7, =0x030061c4 - ldr r1, [r7] - bl LZDecompressVram - cmp r4, 0 - bne _08130348 - lsls r0, r5, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r4, =0x020244d4 - ldr r1, [r4] - ldr r1, [r1, 0x8] - ldr r2, [r6] - ldr r3, [r2] - adds r2, r5, 0 - bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack - ldr r0, [r4] - ldr r0, [r0, 0x8] - ldr r1, [r7] - ldr r2, =0x03006190 - ldr r2, [r2] - bl sub_8130380 - b _0813036C - .pool -_08130348: - lsls r0, r5, 3 - ldr r1, =gMonBackPicTable - adds r0, r1 - ldr r4, =0x020244d4 - ldr r1, [r4] - ldr r1, [r1, 0x4] - ldr r2, [r6] - ldr r3, [r2] - adds r2, r5, 0 - bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack - ldr r0, [r4] - ldr r0, [r0, 0x4] - ldr r1, [r7] - ldr r2, =0x03006190 - ldr r2, [r2] - bl sub_8130380 -_0813036C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81302E8 - - thumb_func_start sub_8130380 -sub_8130380: @ 8130380 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - mov r10, r0 - mov r9, r1 - str r2, [sp] - movs r0, 0 -_08130394: - movs r3, 0 - adds r1, r0, 0x1 - str r1, [sp, 0x4] - lsls r0, 3 - str r0, [sp, 0x8] -_0813039E: - movs r1, 0 - adds r2, r3, 0x1 - mov r8, r2 - ldr r7, [sp, 0x8] - adds r0, r7, r3 - lsls r0, 5 - mov r12, r0 - lsls r4, r3, 3 -_081303AE: - movs r3, 0 - lsls r0, r1, 2 - adds r6, r1, 0x1 - mov r2, r12 - adds r5, r2, r0 - ldr r7, [sp, 0x8] - adds r0, r7, r1 - lsls r0, 7 - ldr r1, [sp] - adds r2, r0, r1 -_081303C2: - lsrs r0, r3, 1 - adds r0, r5, r0 - add r0, r10 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r3 - cmp r0, 0 - beq _081303D6 - lsrs r1, 4 - b _081303DA -_081303D6: - movs r0, 0xF - ands r1, r0 -_081303DA: - cmp r1, 0 - bne _081303EC - adds r0, r4, r3 - lsls r0, 1 - adds r0, r2 - movs r7, 0x80 - lsls r7, 8 - adds r1, r7, 0 - b _081303F8 -_081303EC: - adds r0, r4, r3 - lsls r0, 1 - adds r0, r2 - lsls r1, 1 - add r1, r9 - ldrh r1, [r1] -_081303F8: - strh r1, [r0] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x7 - bls _081303C2 - lsls r0, r6, 16 - lsrs r1, r0, 16 - cmp r1, 0x7 - bls _081303AE - mov r1, r8 - lsls r0, r1, 16 - lsrs r3, r0, 16 - cmp r3, 0x7 - bls _0813039E - ldr r2, [sp, 0x4] - lsls r0, r2, 16 - lsrs r0, 16 - cmp r0, 0x7 - bls _08130394 - 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_8130380 - - thumb_func_start sub_8130430 -sub_8130430: @ 8130430 - push {r4-r7,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_085A989C - movs r2, 0x80 - lsls r2, 1 - movs r1, 0 - bl gpu_pal_apply - cmp r4, 0x1 - beq _0813044E - b _081305A4 -_0813044E: - ldr r0, =0x030061c0 - ldr r0, [r0] - ldrb r0, [r0, 0xA] - movs r1, 0x3 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bhi _0813050C - lsls r0, 2 - ldr r1, =_08130478 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08130478: - .4byte _0813048C - .4byte _081304A4 - .4byte _081304BC - .4byte _081304D4 - .4byte _081304F8 -_0813048C: - ldr r0, =gUnknown_085A9A9C - movs r1, 0xC0 - lsls r1, 19 - bl RLUnCompVram - ldr r0, =gUnknown_085AE974 - b _081304E0 - .pool -_081304A4: - ldr r0, =gUnknown_085AAB20 - movs r1, 0xC0 - lsls r1, 19 - bl RLUnCompVram - ldr r0, =gUnknown_085AEE80 - b _081304E0 - .pool -_081304BC: - ldr r0, =gUnknown_085AB750 - movs r1, 0xC0 - lsls r1, 19 - bl RLUnCompVram - ldr r0, =gUnknown_085AF38C - b _081304E0 - .pool -_081304D4: - ldr r0, =gUnknown_085AC288 - movs r1, 0xC0 - lsls r1, 19 - bl RLUnCompVram - ldr r0, =gUnknown_085AF898 -_081304E0: - ldr r1, =0x03006190 - ldr r1, [r1] - bl RLUnCompWram - b _0813050C - .pool -_081304F8: - ldr r0, =gUnknown_085AD240 - movs r1, 0xC0 - lsls r1, 19 - bl RLUnCompVram - ldr r0, =gUnknown_085AFDA4 - ldr r1, =0x03006190 - ldr r1, [r1] - bl RLUnCompWram -_0813050C: - movs r1, 0 - ldr r5, =0x06006000 - ldr r0, =0x00001015 - adds r4, r0, 0 -_08130514: - movs r3, 0 - lsls r2, r1, 5 -_08130518: - adds r0, r2, r3 - lsls r0, 1 - adds r0, r5 - strh r4, [r0] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x1F - bls _08130518 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x13 - bls _08130514 - movs r1, 0 - ldr r0, =0x0600608c - mov r12, r0 - ldr r7, =0x03006190 -_0813053C: - movs r3, 0 - adds r6, r1, 0x1 - lsls r5, r1, 5 - lsls r4, r1, 6 -_08130544: - adds r2, r5, r3 - lsls r2, 1 - add r2, r12 - ldr r0, [r7] - adds r0, r4, r0 - lsls r1, r3, 1 - adds r0, r1 - adds r0, 0x8C - ldrh r0, [r0] - strh r0, [r2] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x11 - bls _08130544 - lsls r0, r6, 24 - lsrs r1, r0, 24 - cmp r1, 0x9 - bls _0813053C - movs r3, 0 - ldr r4, =0x0600608e - ldr r2, =0x03006190 -_08130570: - lsls r1, r3, 1 - adds r1, r4 - ldr r0, [r2] - adds r0, 0x8E - ldrh r0, [r0] - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0xF - bls _08130570 - b _08130676 - .pool -_081305A4: - cmp r5, 0x7 - bhi _081305C0 - ldr r0, =gUnknown_085AE370 - movs r1, 0xC0 - lsls r1, 19 - bl RLUnCompVram - ldr r0, =gUnknown_085B02B0 - b _08130650 - .pool -_081305C0: - ldr r0, =0x030061c0 - ldr r0, [r0] - ldrb r0, [r0, 0xA] - movs r1, 0x3 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bhi _08130676 - lsls r0, 2 - ldr r1, =_081305E8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081305E8: - .4byte _081305FC - .4byte _08130614 - .4byte _0813062C - .4byte _08130644 - .4byte _08130664 -_081305FC: - ldr r0, =gUnknown_085A9A9C - movs r1, 0xC0 - lsls r1, 19 - bl RLUnCompVram - ldr r0, =gUnknown_085AE974 - b _08130650 - .pool -_08130614: - ldr r0, =gUnknown_085AAB20 - movs r1, 0xC0 - lsls r1, 19 - bl RLUnCompVram - ldr r0, =gUnknown_085AEE80 - b _08130650 - .pool -_0813062C: - ldr r0, =gUnknown_085AB750 - movs r1, 0xC0 - lsls r1, 19 - bl RLUnCompVram - ldr r0, =gUnknown_085AF38C - b _08130650 - .pool -_08130644: - ldr r0, =gUnknown_085AC288 - movs r1, 0xC0 - lsls r1, 19 - bl RLUnCompVram - ldr r0, =gUnknown_085AF898 -_08130650: - ldr r1, =0x06006000 - bl RLUnCompVram - b _08130676 - .pool -_08130664: - ldr r0, =gUnknown_085AD240 - movs r1, 0xC0 - lsls r1, 19 - bl RLUnCompVram - ldr r0, =gUnknown_085AFDA4 - ldr r1, =0x06006000 - bl RLUnCompVram -_08130676: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8130430 - - thumb_func_start sub_8130688 -sub_8130688: @ 8130688 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x030022c0 - ldr r1, =gUnknown_085B0830 - ldr r2, [r1, 0x4] - ldr r1, [r1] - str r1, [r3, 0x38] - str r2, [r3, 0x3C] - ldrh r2, [r3, 0x3C] - ldr r1, =0xfffffc00 - ands r1, r2 - strh r1, [r3, 0x3C] - ldrh r1, [r3, 0x3A] - ldr r0, =0xfffffe00 - ands r0, r1 - movs r1, 0x58 - orrs r0, r1 - strh r0, [r3, 0x3A] - adds r1, r3, 0 - adds r1, 0x38 - movs r0, 0x18 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8130688 - - thumb_func_start sub_81306CC -sub_81306CC: @ 81306CC - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x7 - bhi _081306E4 - ldr r0, =0x030061c0 - ldr r0, [r0] - ldrb r0, [r0, 0xA] - b _081306F4 - .pool -_081306E4: - ldr r0, =0x030061c0 - ldr r0, [r0] - ldrb r0, [r0, 0xA] - movs r1, 0x3 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 -_081306F4: - cmp r0, 0x4 - bhi _08130732 - lsls r0, 2 - ldr r1, =_0813070C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0813070C: - .4byte _08130720 - .4byte _08130724 - .4byte _08130728 - .4byte _0813072C - .4byte _08130730 -_08130720: - movs r0, 0x9 - b _08130732 -_08130724: - movs r0, 0xD - b _08130732 -_08130728: - movs r0, 0x2 - b _08130732 -_0813072C: - movs r0, 0x24 - b _08130732 -_08130730: - movs r0, 0x6 -_08130732: - pop {r1} - bx r1 - thumb_func_end sub_81306CC - - thumb_func_start sub_8130738 -sub_8130738: @ 8130738 - push {r4,lr} - ldr r4, =0x030061c4 - movs r0, 0x80 - lsls r0, 2 - bl AllocZeroed - str r0, [r4] - ldr r4, =0x03006190 - movs r0, 0x80 - lsls r0, 6 - bl AllocZeroed - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8130738 - - thumb_func_start sub_8130760 -sub_8130760: @ 8130760 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, =0x030061a0 - ldr r0, =0x03006190 - ldr r0, [r0] - str r0, [r1, 0x4] - ldr r0, =0x030061c4 - ldr r0, [r0] - str r0, [r1, 0x8] - movs r2, 0 - strb r2, [r1, 0x18] - ldr r0, =0x030061c0 - ldr r0, [r0] - ldrb r0, [r0] - strb r0, [r1, 0x1F] - strb r2, [r1, 0x19] - strb r2, [r1, 0x1A] - movs r0, 0x40 - strb r0, [r1, 0x1B] - strb r0, [r1, 0x1C] - strb r0, [r1, 0x1D] - strb r0, [r1, 0x1E] - subs r0, r3, 0x2 - adds r4, r1, 0 - cmp r0, 0x22 - bhi _08130844 - lsls r0, 2 - ldr r1, =_081307B4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081307B4: - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130840 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130844 - .4byte _08130840 -_08130840: - movs r0, 0x3 - b _08130846 -_08130844: - movs r0, 0x1 -_08130846: - strh r0, [r4, 0x14] - movs r0, 0x2 - strh r0, [r4, 0x16] - strb r3, [r4] - ldr r0, =0x06010000 - str r0, [r4, 0x10] - adds r0, r4, 0 - bl sub_8124F2C - adds r0, r4, 0 - bl sub_81261A4 - adds r0, r4, 0 - bl sub_8126058 - ldr r0, =0x030061c4 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 1 - movs r2, 0x80 - lsls r2, 2 - bl gpu_pal_apply - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8130760 - - thumb_func_start sub_8130884 -sub_8130884: @ 8130884 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - bl sub_8130738 - ldr r0, =0x030061c0 - ldr r0, [r0] - ldrh r0, [r0, 0x8] - movs r1, 0 - bl sub_81302E8 - adds r0, r4, 0 - bl sub_81306CC - lsls r0, 24 - lsrs r0, 24 - bl sub_8130760 - adds r0, r4, 0 - bl sub_8130688 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8130430 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8130884 - - thumb_func_start sub_81308C8 -sub_81308C8: @ 81308C8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x020244a8 - ldr r0, [r1] - ldr r3, [r0, 0x18] - movs r4, 0 - mov r12, r1 - ldr r2, =0x02022fec - movs r1, 0 -_081308DC: - adds r0, r3, r4 - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x53 - bls _081308DC - ldr r0, [r2] - ldr r1, =0x0a7f098a - ands r0, r1 - cmp r0, 0x8 - bne _0813092E - movs r4, 0 - ldr r6, =0x02038bca - ldr r5, =gTrainers + 0x10 @ items offset -_081308F6: - lsls r2, r4, 1 - ldrh r1, [r6] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r2, r0 - adds r2, r5 - ldrh r3, [r2] - cmp r3, 0 - beq _08130928 - mov r0, r12 - ldr r2, [r0] - ldr r1, [r2, 0x18] - adds r0, r1, 0 - adds r0, 0x50 - ldrb r0, [r0] - lsls r0, 1 - adds r1, 0x48 - adds r1, r0 - strh r3, [r1] - ldr r1, [r2, 0x18] - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_08130928: - adds r4, 0x1 - cmp r4, 0x3 - ble _081308F6 -_0813092E: - adds r0, r7, 0 - bl sub_8130950 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81308C8 - - thumb_func_start sub_8130950 -sub_8130950: @ 8130950 - push {r4-r7,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r4, 0 - ldr r6, =0x02024064 - movs r3, 0 -_08130962: - adds r0, r1, r4 - strb r3, [r0] - adds r4, 0x1 - cmp r4, 0x1B - bls _08130962 - movs r4, 0 - ldr r3, =0x020244a8 - movs r5, 0x1 -_08130972: - adds r1, r2, 0 - ands r1, r5 - cmp r1, 0 - beq _08130990 - ldr r0, [r3] - ldr r0, [r0, 0x14] - adds r0, 0x4 - adds r0, r4 - movs r1, 0x64 - b _08130998 - .pool -_08130990: - ldr r0, [r3] - ldr r0, [r0, 0x14] - adds r0, 0x4 - adds r0, r4 -_08130998: - strb r1, [r0] - lsrs r2, 1 - adds r4, 0x1 - cmp r4, 0x3 - ble _08130972 - ldrb r0, [r6] - movs r1, 0 - movs r2, 0xFF - bl sub_803FECC - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 - ldr r5, =0x020244a8 -_081309B4: - ldr r7, =gUnknown_0832A328 - lsls r0, r4, 2 - adds r0, r7 - ldr r0, [r0] - ands r0, r6 - cmp r0, 0 - beq _081309CE - ldr r0, [r5] - ldr r0, [r0, 0x14] - adds r0, 0x4 - adds r0, r4 - movs r1, 0 - strb r1, [r0] -_081309CE: - bl GenerateRandomNumber - ldr r1, [r5] - ldr r2, [r1, 0x14] - adds r2, 0x18 - adds r2, r4 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF - ands r0, r1 - movs r1, 0x64 - subs r1, r0 - strb r1, [r2] - adds r4, 0x1 - cmp r4, 0x3 - ble _081309B4 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x1C] - adds r0, 0x20 - movs r1, 0 - strb r1, [r0] - ldr r0, =0x0203ab3c - ldr r6, =0x02024064 - ldrb r2, [r6] - strb r2, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08130A60 - ldr r5, =0x0202420c - bl GenerateRandomNumber - adds r4, r0, 0 - ldrb r0, [r6] - bl battle_side_get_owner - movs r3, 0x2 - adds r1, r3, 0 - ands r1, r4 - movs r2, 0x1 - eors r0, r2 - adds r1, r0 - strb r1, [r5] - ldr r0, =0x02024210 - ldrb r1, [r0] - ldrb r2, [r5] - lsls r0, r2, 2 - adds r0, r7 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08130A68 - eors r2, r3 - strb r2, [r5] - b _08130A68 - .pool -_08130A60: - ldr r0, =0x0202420c - movs r1, 0x1 - eors r1, r2 - strb r1, [r0] -_08130A68: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 17 - ands r0, r1 - cmp r0, 0 - beq _08130A84 - bl sub_8186438 - b _08130AE6 - .pool -_08130A84: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08130AA0 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0x80 - lsls r0, 23 - str r0, [r1, 0xC] - b _08130B72 - .pool -_08130AA0: - movs r0, 0x80 - lsls r0, 3 - ands r0, r1 - cmp r0, 0 - beq _08130ABC - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0x80 - lsls r0, 22 - str r0, [r1, 0xC] - b _08130B72 - .pool -_08130ABC: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08130AD8 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0x80 - lsls r0, 24 - str r0, [r1, 0xC] - b _08130B72 - .pool -_08130AD8: - movs r0, 0x80 - lsls r0, 12 - ands r0, r1 - cmp r0, 0 - beq _08130AF4 - bl sub_81A6FB4 -_08130AE6: - ldr r1, =0x020244a8 - ldr r1, [r1] - ldr r1, [r1, 0x14] - str r0, [r1, 0xC] - b _08130B72 - .pool -_08130AF4: - ldr r0, =0x0c3f0900 - ands r0, r1 - cmp r0, 0 - beq _08130B10 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0x7 - str r0, [r1, 0xC] - b _08130B72 - .pool -_08130B10: - movs r0, 0x80 - lsls r0, 8 - ands r1, r0 - cmp r1, 0 - beq _08130B58 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r4, [r0, 0x14] - ldr r3, =gTrainers - ldr r0, =0x02038bca - ldrh r0, [r0] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r3, 0x1C - adds r1, r3 - ldr r0, =0x02038bcc - ldrh r2, [r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r3 - ldr r1, [r1] - ldr r0, [r0] - orrs r1, r0 - str r1, [r4, 0xC] - b _08130B72 - .pool -_08130B58: - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r3, [r0, 0x14] - ldr r2, =gTrainers - ldr r0, =0x02038bca - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r2, 0x1C - adds r0, r2 - ldr r0, [r0] - str r0, [r3, 0xC] -_08130B72: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08130B8C - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldr r0, [r2, 0xC] - movs r1, 0x80 - orrs r0, r1 - str r0, [r2, 0xC] -_08130B8C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8130950 - - thumb_func_start sub_8130BA4 -sub_8130BA4: @ 8130BA4 - push {r4,lr} - ldr r0, =0x020241ea - ldrh r4, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08130BC4 - bl sub_8130BDC - b _08130BC8 - .pool -_08130BC4: - bl sub_8130CF4 -_08130BC8: - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =0x020241ea - strh r4, [r0] - adds r0, r1, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8130BA4 - - thumb_func_start sub_8130BDC -sub_8130BDC: @ 8130BDC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - bl sub_8131074 - ldr r1, =0x020244a8 - ldr r0, [r1] - ldr r0, [r0, 0x14] - ldr r0, [r0, 0xC] - cmp r0, 0 - beq _08130C2C - adds r4, r1, 0 - movs r5, 0 -_08130BF8: - ldr r0, [r4] - ldr r2, [r0, 0x14] - ldr r0, [r2, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08130C0C - strb r5, [r2] - bl tai_run_script -_08130C0C: - ldr r0, [r4] - ldr r1, [r0, 0x14] - ldr r0, [r1, 0xC] - lsrs r0, 1 - str r0, [r1, 0xC] - ldrb r0, [r1, 0x11] - adds r0, 0x1 - strb r0, [r1, 0x11] - ldr r0, [r4] - ldr r0, [r0, 0x14] - strb r5, [r0, 0x1] - ldr r0, [r4] - ldr r0, [r0, 0x14] - ldr r0, [r0, 0xC] - cmp r0, 0 - bne _08130BF8 -_08130C2C: - ldr r1, =0x020244a8 - ldr r0, [r1] - ldr r3, [r0, 0x14] - ldrb r2, [r3, 0x10] - movs r0, 0x2 - ands r0, r2 - mov r12, r1 - cmp r0, 0 - beq _08130C48 - movs r0, 0x4 - b _08130CE0 - .pool -_08130C48: - movs r0, 0x4 - ands r0, r2 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _08130C58 - movs r0, 0x5 - b _08130CE0 -_08130C58: - movs r6, 0x1 - mov r1, sp - ldrb r0, [r3, 0x4] - strb r0, [r1] - add r0, sp, 0x4 - strb r2, [r0] - movs r3, 0x1 - mov r8, r0 - ldr r1, =0x02024084 - ldr r0, =0x0203ab3c - ldrb r2, [r0] - mov r5, sp - mov r7, r8 - movs r0, 0x58 - muls r0, r2 - adds r1, r0 - adds r4, r1, 0 - adds r4, 0xE -_08130C7C: - ldrh r0, [r4] - cmp r0, 0 - beq _08130CC6 - ldrb r1, [r5] - mov r2, r12 - ldr r0, [r2] - ldr r0, [r0, 0x14] - adds r0, 0x4 - adds r2, r0, r3 - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r1, r0 - bne _08130CAA - mov r0, sp - adds r1, r0, r6 - ldrb r0, [r2] - strb r0, [r1] - adds r1, r6, 0 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r1, r7, r1 - strb r3, [r1] -_08130CAA: - ldrb r1, [r5] - mov r2, r12 - ldr r0, [r2] - ldr r0, [r0, 0x14] - adds r0, 0x4 - adds r2, r0, r3 - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r1, r0 - bge _08130CC6 - movs r6, 0x1 - ldrb r0, [r2] - strb r0, [r5] - strb r3, [r7] -_08130CC6: - adds r4, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - ble _08130C7C - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - add r0, r8 - ldrb r0, [r0] -_08130CE0: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8130BDC - - thumb_func_start sub_8130CF4 -sub_8130CF4: @ 8130CF4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - movs r0, 0 - mov r8, r0 - mov r1, sp - adds r1, 0xC - str r1, [sp, 0x1C] - mov r2, sp - adds r2, 0x8 - str r2, [sp, 0x18] - str r1, [sp, 0x20] - mov r10, sp -_08130D14: - ldr r0, =0x0203ab3c - ldrb r0, [r0] - cmp r8, r0 - beq _08130D2E - movs r0, 0x58 - mov r7, r8 - muls r7, r0 - adds r0, r7, 0 - ldr r1, =0x02024084 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08130D48 -_08130D2E: - movs r0, 0xFF - ldr r2, [sp, 0x20] - strb r0, [r2] - ldr r0, =0x0000ffff - mov r7, r10 - strh r0, [r7] - b _08130EAE - .pool -_08130D48: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _08130D70 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x92 - ldrb r0, [r0] - lsrs r0, 4 - bl sub_8130950 - b _08130D76 - .pool -_08130D70: - movs r0, 0xF - bl sub_8130950 -_08130D76: - ldr r0, =0x0202420c - mov r1, r8 - strb r1, [r0] - movs r1, 0x1 - mov r2, r8 - ands r2, r1 - ldr r0, =0x0203ab3c - ldrb r0, [r0] - ands r1, r0 - cmp r2, r1 - beq _08130D90 - bl sub_8131074 -_08130D90: - ldr r2, =0x020244a8 - ldr r0, [r2] - ldr r0, [r0, 0x14] - movs r1, 0 - strb r1, [r0, 0x11] - ldr r0, [r2] - ldr r0, [r0, 0x14] - strb r1, [r0, 0x1] - ldr r0, [r2] - ldr r0, [r0, 0x14] - ldr r4, [r0, 0xC] - mov r9, r2 - cmp r4, 0 - beq _08130DD8 - mov r5, r9 - movs r6, 0 -_08130DB0: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _08130DC2 - ldr r0, [r5] - ldr r0, [r0, 0x14] - strb r6, [r0] - bl tai_run_script -_08130DC2: - asrs r4, 1 - ldr r0, [r5] - ldr r1, [r0, 0x14] - ldrb r0, [r1, 0x11] - adds r0, 0x1 - strb r0, [r1, 0x11] - ldr r0, [r5] - ldr r0, [r0, 0x14] - strb r6, [r0, 0x1] - cmp r4, 0 - bne _08130DB0 -_08130DD8: - mov r2, r9 - ldr r0, [r2] - ldr r3, [r0, 0x14] - ldrb r1, [r3, 0x10] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08130DFC - movs r0, 0x4 - ldr r7, [sp, 0x20] - strb r0, [r7] - b _08130EAE - .pool -_08130DFC: - movs r0, 0x4 - ands r0, r1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _08130E10 - movs r0, 0x5 - ldr r1, [sp, 0x20] - strb r0, [r1] - b _08130EAE -_08130E10: - add r1, sp, 0x10 - ldrb r0, [r3, 0x4] - strb r0, [r1] - add r0, sp, 0x14 - strb r2, [r0] - movs r5, 0x1 - movs r3, 0x1 - adds r6, r1, 0 - ldr r0, =0x0203ab3c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - ldr r2, =0x02024090 - adds r0, r2 - adds r4, r0, 0x2 - add r7, sp, 0x14 -_08130E30: - ldrh r0, [r4] - cmp r0, 0 - beq _08130E72 - ldrb r1, [r6] - mov r2, r9 - ldr r0, [r2] - ldr r0, [r0, 0x14] - adds r0, 0x4 - adds r2, r0, r3 - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r1, r0 - bne _08130E56 - adds r0, r6, r5 - ldrb r1, [r2] - strb r1, [r0] - adds r0, r7, r5 - strb r3, [r0] - adds r5, 0x1 -_08130E56: - ldrb r1, [r6] - mov r2, r9 - ldr r0, [r2] - ldr r0, [r0, 0x14] - adds r0, 0x4 - adds r2, r0, r3 - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r1, r0 - bge _08130E72 - ldrb r0, [r2] - strb r0, [r6] - strb r3, [r7] - movs r5, 0x1 -_08130E72: - adds r4, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - ble _08130E30 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __modsi3 - add r0, sp - adds r0, 0x14 - ldrb r0, [r0] - ldr r7, [sp, 0x20] - strb r0, [r7] - ldrb r2, [r6] - mov r0, r10 - strh r2, [r0] - ldr r0, =0x0203ab3c - ldrb r1, [r0] - movs r0, 0x2 - eors r0, r1 - cmp r8, r0 - bne _08130EAE - cmp r2, 0x63 - bgt _08130EAE - ldr r0, =0x0000ffff - mov r1, r10 - strh r0, [r1] -_08130EAE: - ldr r2, [sp, 0x20] - adds r2, 0x1 - str r2, [sp, 0x20] - movs r7, 0x2 - add r10, r7 - movs r0, 0x1 - add r8, r0 - mov r1, r8 - cmp r1, 0x3 - bgt _08130EC4 - b _08130D14 -_08130EC4: - mov r0, sp - ldrh r5, [r0] - movs r0, 0 - ldr r2, [sp, 0x18] - strb r0, [r2] - movs r4, 0x1 - mov r8, r4 - ldr r6, =0x0202420c - ldr r3, [sp, 0x18] - mov r1, sp - adds r1, 0x2 -_08130EDA: - lsls r0, r5, 16 - asrs r2, r0, 16 - movs r7, 0 - ldrsh r0, [r1, r7] - cmp r2, r0 - bne _08130EEE - adds r0, r3, r4 - mov r7, r8 - strb r7, [r0] - adds r4, 0x1 -_08130EEE: - movs r7, 0 - ldrsh r0, [r1, r7] - cmp r2, r0 - bge _08130EFE - ldrh r5, [r1] - mov r0, r8 - strb r0, [r3] - movs r4, 0x1 -_08130EFE: - adds r1, 0x2 - movs r2, 0x1 - add r8, r2 - mov r7, r8 - cmp r7, 0x3 - ble _08130EDA - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __modsi3 - ldr r1, [sp, 0x18] - adds r0, r1, r0 - ldrb r0, [r0] - strb r0, [r6] - ldrb r0, [r6] - ldr r2, [sp, 0x1C] - adds r0, r2, r0 - ldrb r0, [r0] - 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_8130CF4 - - thumb_func_start tai_run_script -tai_run_script: @ 8130F48 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r7, =0x020244a8 - ldr r0, [r7] - ldr r0, [r0, 0x14] - ldrb r0, [r0] - adds r6, r7, 0 - cmp r0, 0x2 - bne _08130F60 - b _08131066 -_08130F60: - mov r9, r7 - ldr r0, =0x0203ab38 - mov r8, r0 -_08130F66: - mov r1, r9 - ldr r0, [r1] - ldr r2, [r0, 0x14] - ldrb r0, [r2] - cmp r0, 0x1 - beq _08130FD4 - cmp r0, 0x1 - bgt _0813105A - cmp r0, 0 - bne _0813105A - ldr r1, =gUnknown_082DBEF8 - ldrb r0, [r2, 0x11] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - mov r1, r8 - str r0, [r1] - ldr r5, =0x02024084 - ldrb r4, [r2, 0x1] - ldr r0, =0x0203ab3c - ldrb r1, [r0] - movs r0, 0x58 - adds r3, r1, 0 - muls r3, r0 - adds r0, r4, r3 - adds r1, r5, 0 - adds r1, 0x24 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _08130FB0 - lsls r0, r4, 1 - adds r0, r3 - adds r1, r5, 0 - adds r1, 0xC - adds r0, r1 - ldrh r0, [r0] -_08130FB0: - strh r0, [r2, 0x2] - ldr r0, [r6] - ldr r1, [r0, 0x14] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0813105A - .pool -_08130FD4: - ldrh r1, [r2, 0x2] - cmp r1, 0 - beq _08130FF4 - ldr r1, =gUnknown_085B083C - mov r2, r8 - ldr r0, [r2] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - b _0813100A - .pool -_08130FF4: - adds r0, r2, 0x4 - ldrb r2, [r2, 0x1] - adds r0, r2 - strb r1, [r0] - mov r1, r9 - ldr r0, [r1] - ldr r2, [r0, 0x14] - ldrb r1, [r2, 0x10] - movs r0, 0x1 - orrs r0, r1 - strb r0, [r2, 0x10] -_0813100A: - ldr r2, =0x020244a8 - ldr r0, [r2] - ldr r3, [r0, 0x14] - ldrb r1, [r3, 0x10] - movs r0, 0x1 - ands r0, r1 - adds r6, r2, 0 - cmp r0, 0 - beq _0813105A - ldrb r0, [r3, 0x1] - adds r0, 0x1 - strb r0, [r3, 0x1] - ldr r0, [r6] - ldr r2, [r0, 0x14] - ldrb r0, [r2, 0x1] - cmp r0, 0x3 - bhi _08131044 - ldrb r1, [r2, 0x10] - movs r0, 0x8 - ands r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08131044 - strb r0, [r2] - b _0813104E - .pool -_08131044: - ldr r0, [r6] - ldr r1, [r0, 0x14] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0813104E: - ldr r0, [r6] - ldr r2, [r0, 0x14] - ldrb r1, [r2, 0x10] - movs r0, 0xFE - ands r0, r1 - strb r0, [r2, 0x10] -_0813105A: - ldr r0, [r7] - ldr r0, [r0, 0x14] - ldrb r0, [r0] - cmp r0, 0x2 - beq _08131066 - b _08130F66 -_08131066: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end tai_run_script - - thumb_func_start sub_8131074 -sub_8131074: @ 8131074 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r7, 0 - ldr r4, =0x020244a8 - ldr r0, [r4] - ldr r2, [r0, 0x18] - ldr r3, =0x0202420c - ldrb r1, [r3] - lsls r0, r1, 4 - adds r2, r0 - ldr r5, =0x02024248 - lsls r1, 1 - adds r1, r5 - ldrh r0, [r2] - mov r8, r4 - mov r12, r3 - ldrh r1, [r1] - cmp r0, r1 - beq _081310E4 - adds r6, r5, 0 - movs r5, 0 -_081310A0: - mov r1, r8 - ldr r0, [r1] - ldr r4, [r0, 0x18] - mov r0, r12 - ldrb r1, [r0] - lsls r3, r1, 4 - adds r0, r5, r3 - adds r2, r4, r0 - ldrh r0, [r2] - cmp r0, 0 - bne _081310CC - lsls r0, r1, 1 - adds r0, r6 - ldrh r0, [r0] - strh r0, [r2] - b _081310E4 - .pool -_081310CC: - adds r5, 0x2 - adds r7, 0x1 - cmp r7, 0x3 - bgt _081310E4 - adds r0, r5, r3 - adds r0, r4, r0 - lsls r1, 1 - adds r1, r6 - ldrh r0, [r0] - ldrh r1, [r1] - cmp r0, r1 - bne _081310A0 -_081310E4: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8131074 - - thumb_func_start sub_81310F0 -sub_81310F0: @ 81310F0 - push {r4,lr} - lsls r0, 24 - ldr r4, =0x020244a8 - movs r3, 0 - lsrs r1, r0, 20 - movs r2, 0x3 -_081310FC: - ldr r0, [r4] - ldr r0, [r0, 0x18] - adds r0, r1 - strh r3, [r0] - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _081310FC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81310F0 - - thumb_func_start b_history__record_ability_usage_of_player -b_history__record_ability_usage_of_player: @ 8131118 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x020244a8 - ldr r2, [r2] - ldr r2, [r2, 0x18] - adds r2, 0x40 - adds r2, r0 - strb r1, [r2] - bx lr - .pool - thumb_func_end b_history__record_ability_usage_of_player - - thumb_func_start sub_8131130 -sub_8131130: @ 8131130 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020244a8 - ldr r1, [r1] - ldr r1, [r1, 0x18] - adds r1, 0x40 - adds r1, r0 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8131130 - - thumb_func_start b_history__record_item_x12_of_player -b_history__record_item_x12_of_player: @ 8131148 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x020244a8 - ldr r2, [r2] - ldr r2, [r2, 0x18] - adds r2, 0x44 - adds r2, r0 - strb r1, [r2] - bx lr - .pool - thumb_func_end b_history__record_item_x12_of_player - - thumb_func_start sub_8131160 -sub_8131160: @ 8131160 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020244a8 - ldr r1, [r1] - ldr r1, [r1, 0x18] - adds r1, 0x44 - adds r1, r0 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8131160 - - thumb_func_start tai00_unk -tai00_unk: @ 8131178 - push {lr} - bl GenerateRandomNumber - lsls r0, 16 - movs r1, 0xFF - lsls r1, 16 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ands r1, r0 - lsrs r1, 16 - ldrb r0, [r2, 0x1] - cmp r1, r0 - bcs _081311B0 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081311B4 - .pool -_081311B0: - adds r0, r2, 0x6 - str r0, [r3] -_081311B4: - pop {r0} - bx r0 - thumb_func_end tai00_unk - - thumb_func_start tai01_unk -tai01_unk: @ 81311B8 - push {lr} - bl GenerateRandomNumber - lsls r0, 16 - movs r1, 0xFF - lsls r1, 16 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ands r1, r0 - lsrs r1, 16 - ldrb r0, [r2, 0x1] - cmp r1, r0 - bls _081311F0 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081311F4 - .pool -_081311F0: - adds r0, r2, 0x6 - str r0, [r3] -_081311F4: - pop {r0} - bx r0 - thumb_func_end tai01_unk - - thumb_func_start tai02_unk -tai02_unk: @ 81311F8 - push {lr} - bl GenerateRandomNumber - lsls r0, 16 - movs r1, 0xFF - lsls r1, 16 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ands r1, r0 - lsrs r1, 16 - ldrb r0, [r2, 0x1] - cmp r1, r0 - bne _08131230 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08131234 - .pool -_08131230: - adds r0, r2, 0x6 - str r0, [r3] -_08131234: - pop {r0} - bx r0 - thumb_func_end tai02_unk - - thumb_func_start tai03_unk -tai03_unk: @ 8131238 - push {lr} - bl GenerateRandomNumber - lsls r0, 16 - movs r1, 0xFF - lsls r1, 16 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ands r1, r0 - lsrs r1, 16 - ldrb r0, [r2, 0x1] - cmp r1, r0 - beq _08131270 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08131274 - .pool -_08131270: - adds r0, r2, 0x6 - str r0, [r3] -_08131274: - pop {r0} - bx r0 - thumb_func_end tai03_unk - - thumb_func_start tai04_unk -tai04_unk: @ 8131278 - push {r4,lr} - ldr r2, =0x020244a8 - ldr r0, [r2] - ldr r0, [r0, 0x14] - adds r1, r0, 0x4 - ldrb r0, [r0, 0x1] - adds r1, r0 - ldr r3, =0x0203ab38 - ldr r0, [r3] - ldrb r0, [r0, 0x1] - ldrb r4, [r1] - adds r0, r4 - strb r0, [r1] - ldr r0, [r2] - ldr r1, [r0, 0x14] - adds r0, r1, 0x4 - ldrb r1, [r1, 0x1] - adds r1, r0, r1 - movs r0, 0 - ldrsb r0, [r1, r0] - cmp r0, 0 - bge _081312A8 - movs r0, 0 - strb r0, [r1] -_081312A8: - ldr r0, [r3] - adds r0, 0x2 - str r0, [r3] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end tai04_unk - - thumb_func_start tai05_unk -tai05_unk: @ 81312BC - push {r4,lr} - ldr r0, =0x0203ab38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _081312D8 - ldr r0, =0x0203ab3c - b _081312DA - .pool -_081312D8: - ldr r0, =0x0202420c -_081312DA: - ldrb r1, [r0] - ldr r2, =0x02024084 - movs r0, 0x58 - muls r1, r0 - adds r1, r2 - ldrh r2, [r1, 0x28] - movs r0, 0x64 - muls r0, r2 - ldrh r1, [r1, 0x2C] - bl __divsi3 - ldr r2, [r4] - ldrb r1, [r2, 0x2] - cmp r0, r1 - bcs _08131318 - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _0813131C - .pool -_08131318: - adds r0, r2, 0x7 - str r0, [r4] -_0813131C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai05_unk - - thumb_func_start tai06_unk -tai06_unk: @ 8131324 - push {r4,lr} - ldr r0, =0x0203ab38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _08131340 - ldr r0, =0x0203ab3c - b _08131342 - .pool -_08131340: - ldr r0, =0x0202420c -_08131342: - ldrb r1, [r0] - ldr r2, =0x02024084 - movs r0, 0x58 - muls r1, r0 - adds r1, r2 - ldrh r2, [r1, 0x28] - movs r0, 0x64 - muls r0, r2 - ldrh r1, [r1, 0x2C] - bl __divsi3 - ldr r2, [r4] - ldrb r1, [r2, 0x2] - cmp r0, r1 - bls _08131380 - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08131384 - .pool -_08131380: - adds r0, r2, 0x7 - str r0, [r4] -_08131384: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai06_unk - - thumb_func_start tai07_unk -tai07_unk: @ 813138C - push {r4,lr} - ldr r0, =0x0203ab38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _081313A8 - ldr r0, =0x0203ab3c - b _081313AA - .pool -_081313A8: - ldr r0, =0x0202420c -_081313AA: - ldrb r1, [r0] - ldr r2, =0x02024084 - movs r0, 0x58 - muls r1, r0 - adds r1, r2 - ldrh r2, [r1, 0x28] - movs r0, 0x64 - muls r0, r2 - ldrh r1, [r1, 0x2C] - bl __divsi3 - ldr r2, [r4] - ldrb r1, [r2, 0x2] - cmp r0, r1 - bne _081313E8 - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _081313EC - .pool -_081313E8: - adds r0, r2, 0x7 - str r0, [r4] -_081313EC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai07_unk - - thumb_func_start tai08_unk -tai08_unk: @ 81313F4 - push {r4,lr} - ldr r0, =0x0203ab38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _08131410 - ldr r0, =0x0203ab3c - b _08131412 - .pool -_08131410: - ldr r0, =0x0202420c -_08131412: - ldrb r1, [r0] - ldr r2, =0x02024084 - movs r0, 0x58 - muls r1, r0 - adds r1, r2 - ldrh r2, [r1, 0x28] - movs r0, 0x64 - muls r0, r2 - ldrh r1, [r1, 0x2C] - bl __divsi3 - ldr r2, [r4] - ldrb r1, [r2, 0x2] - cmp r0, r1 - beq _08131450 - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08131454 - .pool -_08131450: - adds r0, r2, 0x7 - str r0, [r4] -_08131454: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai08_unk - - thumb_func_start tai09_unk -tai09_unk: @ 813145C - push {r4,r5,lr} - ldr r0, =0x0203ab38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r5, r0, 0 - cmp r1, 0x1 - bne _08131478 - ldr r0, =0x0203ab3c - b _0813147A - .pool -_08131478: - ldr r0, =0x0202420c -_0813147A: - ldrb r4, [r0] - ldr r3, [r5] - ldrb r2, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r2, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r2, r0 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r4 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - ands r0, r2 - cmp r0, 0 - beq _081314C4 - ldrb r1, [r3, 0x6] - ldrb r0, [r3, 0x7] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x8] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x9] - lsls r0, 24 - orrs r1, r0 - str r1, [r5] - b _081314CA - .pool -_081314C4: - adds r0, r3, 0 - adds r0, 0xA - str r0, [r5] -_081314CA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end tai09_unk - - thumb_func_start tai0A_unk -tai0A_unk: @ 81314D0 - push {r4,r5,lr} - ldr r0, =0x0203ab38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r5, r0, 0 - cmp r1, 0x1 - bne _081314EC - ldr r0, =0x0203ab3c - b _081314EE - .pool -_081314EC: - ldr r0, =0x0202420c -_081314EE: - ldrb r4, [r0] - ldr r3, [r5] - ldrb r2, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r2, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r2, r0 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r4 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - ands r0, r2 - cmp r0, 0 - bne _08131538 - ldrb r1, [r3, 0x6] - ldrb r0, [r3, 0x7] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x8] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x9] - lsls r0, 24 - orrs r1, r0 - str r1, [r5] - b _0813153E - .pool -_08131538: - adds r0, r3, 0 - adds r0, 0xA - str r0, [r5] -_0813153E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end tai0A_unk - - thumb_func_start tai0B_unk -tai0B_unk: @ 8131544 - push {r4,r5,lr} - ldr r0, =0x0203ab38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r5, r0, 0 - cmp r1, 0x1 - bne _08131560 - ldr r0, =0x0203ab3c - b _08131562 - .pool -_08131560: - ldr r0, =0x0202420c -_08131562: - ldrb r4, [r0] - ldr r3, [r5] - ldrb r2, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r2, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r2, r0 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r4 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - ands r0, r2 - cmp r0, 0 - beq _081315AC - ldrb r1, [r3, 0x6] - ldrb r0, [r3, 0x7] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x8] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x9] - lsls r0, 24 - orrs r1, r0 - str r1, [r5] - b _081315B2 - .pool -_081315AC: - adds r0, r3, 0 - adds r0, 0xA - str r0, [r5] -_081315B2: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end tai0B_unk - - thumb_func_start tai0C_unk -tai0C_unk: @ 81315B8 - push {r4,r5,lr} - ldr r0, =0x0203ab38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r5, r0, 0 - cmp r1, 0x1 - bne _081315D4 - ldr r0, =0x0203ab3c - b _081315D6 - .pool -_081315D4: - ldr r0, =0x0202420c -_081315D6: - ldrb r4, [r0] - ldr r3, [r5] - ldrb r2, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r2, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r2, r0 - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r4 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - ands r0, r2 - cmp r0, 0 - bne _08131620 - ldrb r1, [r3, 0x6] - ldrb r0, [r3, 0x7] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x8] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x9] - lsls r0, 24 - orrs r1, r0 - str r1, [r5] - b _08131626 - .pool -_08131620: - adds r0, r3, 0 - adds r0, 0xA - str r0, [r5] -_08131626: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end tai0C_unk - - thumb_func_start tai0D_unk -tai0D_unk: @ 813162C - push {r4,r5,lr} - ldr r0, =0x0203ab38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r5, r0, 0 - cmp r1, 0x1 - bne _08131648 - ldr r0, =0x0203ab3c - b _0813164A - .pool -_08131648: - ldr r0, =0x0202420c -_0813164A: - ldrb r4, [r0] - ldr r3, [r5] - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r1, r0 - ldr r2, =0x020242ac - lsls r0, r4, 2 - adds r0, r2 - ldr r0, [r0] - ands r0, r1 - cmp r0, 0 - beq _08131690 - ldrb r1, [r3, 0x6] - ldrb r0, [r3, 0x7] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x8] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x9] - lsls r0, 24 - orrs r1, r0 - str r1, [r5] - b _08131696 - .pool -_08131690: - adds r0, r3, 0 - adds r0, 0xA - str r0, [r5] -_08131696: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end tai0D_unk - - thumb_func_start tai0E_unk -tai0E_unk: @ 813169C - push {r4,r5,lr} - ldr r0, =0x0203ab38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r5, r0, 0 - cmp r1, 0x1 - bne _081316B8 - ldr r0, =0x0203ab3c - b _081316BA - .pool -_081316B8: - ldr r0, =0x0202420c -_081316BA: - ldrb r4, [r0] - ldr r3, [r5] - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r1, r0 - ldr r2, =0x020242ac - lsls r0, r4, 2 - adds r0, r2 - ldr r0, [r0] - ands r0, r1 - cmp r0, 0 - bne _08131700 - ldrb r1, [r3, 0x6] - ldrb r0, [r3, 0x7] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x8] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x9] - lsls r0, 24 - orrs r1, r0 - str r1, [r5] - b _08131706 - .pool -_08131700: - adds r0, r3, 0 - adds r0, 0xA - str r0, [r5] -_08131706: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end tai0E_unk - - thumb_func_start tai0F_unk -tai0F_unk: @ 813170C - push {r4,lr} - ldr r0, =0x0203ab38 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bne _08131724 - ldr r0, =0x0203ab3c - b _08131726 - .pool -_08131724: - ldr r0, =0x0202420c -_08131726: - ldrb r0, [r0] - bl battle_get_per_side_status - movs r2, 0x1 - ands r2, r0 - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r1, r0 - ldr r0, =0x0202428e - lsls r2, 1 - adds r2, r0 - ldrh r0, [r2] - ands r0, r1 - cmp r0, 0 - beq _0813177C - ldrb r1, [r3, 0x6] - ldrb r0, [r3, 0x7] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x8] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x9] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08131782 - .pool -_0813177C: - adds r0, r3, 0 - adds r0, 0xA - str r0, [r4] -_08131782: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai0F_unk - - thumb_func_start tai10_unk -tai10_unk: @ 8131788 - push {r4,lr} - ldr r0, =0x0203ab38 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bne _081317A0 - ldr r0, =0x0203ab3c - b _081317A2 - .pool -_081317A0: - ldr r0, =0x0202420c -_081317A2: - ldrb r0, [r0] - bl battle_get_per_side_status - movs r2, 0x1 - ands r2, r0 - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r1, r0 - ldr r0, =0x0202428e - lsls r2, 1 - adds r2, r0 - ldrh r0, [r2] - ands r0, r1 - cmp r0, 0 - bne _081317F8 - ldrb r1, [r3, 0x6] - ldrb r0, [r3, 0x7] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x8] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x9] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _081317FE - .pool -_081317F8: - adds r0, r3, 0 - adds r0, 0xA - str r0, [r4] -_081317FE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai10_unk - - thumb_func_start tai11_unk -tai11_unk: @ 8131804 - push {lr} - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldr r0, [r0, 0x8] - ldrb r1, [r2, 0x1] - cmp r0, r1 - bcs _08131838 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0813183C - .pool -_08131838: - adds r0, r2, 0x6 - str r0, [r3] -_0813183C: - pop {r0} - bx r0 - thumb_func_end tai11_unk - - thumb_func_start tai12_unk -tai12_unk: @ 8131840 - push {lr} - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldr r0, [r0, 0x8] - ldrb r1, [r2, 0x1] - cmp r0, r1 - bls _08131874 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08131878 - .pool -_08131874: - adds r0, r2, 0x6 - str r0, [r3] -_08131878: - pop {r0} - bx r0 - thumb_func_end tai12_unk - - thumb_func_start tai13_unk -tai13_unk: @ 813187C - push {lr} - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldr r0, [r0, 0x8] - ldrb r1, [r2, 0x1] - cmp r0, r1 - bne _081318B0 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081318B4 - .pool -_081318B0: - adds r0, r2, 0x6 - str r0, [r3] -_081318B4: - pop {r0} - bx r0 - thumb_func_end tai13_unk - - thumb_func_start tai14_unk -tai14_unk: @ 81318B8 - push {lr} - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldr r0, [r0, 0x8] - ldrb r1, [r2, 0x1] - cmp r0, r1 - beq _081318EC - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081318F0 - .pool -_081318EC: - adds r0, r2, 0x6 - str r0, [r3] -_081318F0: - pop {r0} - bx r0 - thumb_func_end tai14_unk - - thumb_func_start tai15_unk -tai15_unk: @ 81318F4 - push {lr} - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r0, [r0, 0x8] - ldrb r1, [r1] - cmp r0, r1 - bcs _0813193C - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08131942 - .pool -_0813193C: - adds r0, r2, 0 - adds r0, 0x9 - str r0, [r3] -_08131942: - pop {r0} - bx r0 - thumb_func_end tai15_unk - - thumb_func_start tai16_unk -tai16_unk: @ 8131948 - push {lr} - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r0, [r0, 0x8] - ldrb r1, [r1] - cmp r0, r1 - bls _08131990 - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08131996 - .pool -_08131990: - adds r0, r2, 0 - adds r0, 0x9 - str r0, [r3] -_08131996: - pop {r0} - bx r0 - thumb_func_end tai16_unk - - thumb_func_start tai17_unk -tai17_unk: @ 813199C - push {lr} - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r0, [r0, 0x8] - ldrb r1, [r1] - cmp r0, r1 - bne _081319E4 - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081319EA - .pool -_081319E4: - adds r0, r2, 0 - adds r0, 0x9 - str r0, [r3] -_081319EA: - pop {r0} - bx r0 - thumb_func_end tai17_unk - - thumb_func_start tai18_unk -tai18_unk: @ 81319F0 - push {lr} - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r0, [r0, 0x8] - ldrb r1, [r1] - cmp r0, r1 - beq _08131A38 - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08131A3E - .pool -_08131A38: - adds r0, r2, 0 - adds r0, 0x9 - str r0, [r3] -_08131A3E: - pop {r0} - bx r0 - thumb_func_end tai18_unk - - thumb_func_start tai19_unk -tai19_unk: @ 8131A44 - push {lr} - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldrh r0, [r0, 0x2] - cmp r0, r1 - bne _08131A80 - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08131A84 - .pool -_08131A80: - adds r0, r2, 0x7 - str r0, [r3] -_08131A84: - pop {r0} - bx r0 - thumb_func_end tai19_unk - - thumb_func_start tai1A_unk -tai1A_unk: @ 8131A88 - push {lr} - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldrh r0, [r0, 0x2] - cmp r0, r1 - beq _08131AC4 - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08131AC8 - .pool -_08131AC4: - adds r0, r2, 0x7 - str r0, [r3] -_08131AC8: - pop {r0} - bx r0 - thumb_func_end tai1A_unk - - thumb_func_start tai1B_unk -tai1B_unk: @ 8131ACC - push {r4,lr} - ldr r2, =0x0203ab38 - ldr r1, [r2] - ldrb r3, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - orrs r3, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - orrs r3, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - orrs r3, r0 - ldrb r0, [r3] - cmp r0, 0xFF - beq _08131B28 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r1, [r0, 0x8] - adds r4, r2, 0 -_08131AF6: - ldrb r0, [r3] - cmp r1, r0 - bne _08131B20 - ldr r2, [r4] - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08131B2E - .pool -_08131B20: - adds r3, 0x1 - ldrb r0, [r3] - cmp r0, 0xFF - bne _08131AF6 -_08131B28: - ldr r0, [r2] - adds r0, 0x9 - str r0, [r2] -_08131B2E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai1B_unk - - thumb_func_start tai1C_unk -tai1C_unk: @ 8131B34 - push {r4,lr} - ldr r2, =0x0203ab38 - ldr r1, [r2] - ldrb r3, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - orrs r3, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - orrs r3, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - orrs r3, r0 - ldrb r0, [r3] - adds r4, r2, 0 - cmp r0, 0xFF - beq _08131B80 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r2, [r0, 0x8] - adds r1, r4, 0 -_08131B60: - ldrb r0, [r3] - cmp r2, r0 - bne _08131B78 - ldr r0, [r1] - adds r0, 0x9 - str r0, [r1] - b _08131B98 - .pool -_08131B78: - adds r3, 0x1 - ldrb r0, [r3] - cmp r0, 0xFF - bne _08131B60 -_08131B80: - ldr r2, [r4] - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] -_08131B98: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai1C_unk - - thumb_func_start tai1D_unk -tai1D_unk: @ 8131BA0 - push {r4,r5,lr} - ldr r2, =0x0203ab38 - ldr r1, [r2] - ldrb r3, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - orrs r3, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - orrs r3, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - orrs r3, r0 - ldrh r0, [r3] - ldr r5, =0x0000ffff - cmp r0, r5 - beq _08131C00 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r1, [r0, 0x8] - adds r4, r2, 0 -_08131BCC: - ldrh r0, [r3] - cmp r1, r0 - bne _08131BF8 - ldr r2, [r4] - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08131C06 - .pool -_08131BF8: - adds r3, 0x2 - ldrh r0, [r3] - cmp r0, r5 - bne _08131BCC -_08131C00: - ldr r0, [r2] - adds r0, 0x9 - str r0, [r2] -_08131C06: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end tai1D_unk - - thumb_func_start tai1E_unk -tai1E_unk: @ 8131C0C - push {r4,r5,lr} - ldr r2, =0x0203ab38 - ldr r1, [r2] - ldrb r3, [r1, 0x1] - ldrb r0, [r1, 0x2] - lsls r0, 8 - orrs r3, r0 - ldrb r0, [r1, 0x3] - lsls r0, 16 - orrs r3, r0 - ldrb r0, [r1, 0x4] - lsls r0, 24 - orrs r3, r0 - ldrh r0, [r3] - ldr r4, =0x0000ffff - adds r5, r2, 0 - cmp r0, r4 - beq _08131C5C - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r2, [r0, 0x8] - adds r1, r5, 0 -_08131C3A: - ldrh r0, [r3] - cmp r2, r0 - bne _08131C54 - ldr r0, [r1] - adds r0, 0x9 - str r0, [r1] - b _08131C74 - .pool -_08131C54: - adds r3, 0x2 - ldrh r0, [r3] - cmp r0, r4 - bne _08131C3A -_08131C5C: - ldr r2, [r5] - ldrb r1, [r2, 0x5] - ldrb r0, [r2, 0x6] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 24 - orrs r1, r0 - str r1, [r5] -_08131C74: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end tai1E_unk - - thumb_func_start tai1F_unk -tai1F_unk: @ 8131C7C - push {r4,r5,lr} - movs r3, 0 - ldr r4, =0x0203ab38 - ldr r1, =0x02024084 - ldr r0, =0x0203ab3c - ldrb r2, [r0] - ldr r5, =gBattleMoves - movs r0, 0x58 - muls r0, r2 - adds r1, 0xC - adds r2, r0, r1 -_08131C92: - ldrh r0, [r2] - cmp r0, 0 - beq _08131CA6 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x1] - cmp r0, 0 - bne _08131CAE -_08131CA6: - adds r2, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - ble _08131C92 -_08131CAE: - cmp r3, 0x4 - bne _08131CCC - ldr r0, [r4] - adds r0, 0x5 - str r0, [r4] - b _08131CE4 - .pool -_08131CCC: - ldr r2, [r4] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] -_08131CE4: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end tai1F_unk - - thumb_func_start tai20_unk -tai20_unk: @ 8131CEC - push {r4,r5,lr} - movs r3, 0 - ldr r4, =0x0203ab38 - ldr r1, =0x02024084 - ldr r0, =0x0203ab3c - ldrb r2, [r0] - ldr r5, =gBattleMoves - movs r0, 0x58 - muls r0, r2 - adds r1, 0xC - adds r2, r0, r1 -_08131D02: - ldrh r0, [r2] - cmp r0, 0 - beq _08131D16 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r0, [r1, 0x1] - cmp r0, 0 - bne _08131D1E -_08131D16: - adds r2, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - ble _08131D02 -_08131D1E: - cmp r3, 0x4 - beq _08131D3C - ldr r0, [r4] - adds r0, 0x5 - str r0, [r4] - b _08131D54 - .pool -_08131D3C: - ldr r2, [r4] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] -_08131D54: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end tai20_unk - - thumb_func_start tai21_unk -tai21_unk: @ 8131D5C - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - ldr r0, =0x03005d10 - ldrb r0, [r0, 0x13] - str r0, [r1, 0x8] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end tai21_unk - - thumb_func_start dp15_get_some_type -dp15_get_some_type: @ 8131D80 - push {r4,lr} - ldr r1, =0x0203ab38 - ldr r0, [r1] - ldrb r0, [r0, 0x1] - adds r4, r1, 0 - cmp r0, 0x4 - bhi _08131E5A - lsls r0, 2 - ldr r1, =_08131DA0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08131DA0: - .4byte _08131DD8 - .4byte _08131DB4 - .4byte _08131E20 - .4byte _08131DFC - .4byte _08131E44 -_08131DB4: - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r3, [r0, 0x14] - ldr r2, =0x02024084 - ldr r0, =0x0203ab3c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x21 - ldrb r0, [r0] - b _08131E58 - .pool -_08131DD8: - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r3, [r0, 0x14] - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x21 - ldrb r0, [r0] - b _08131E58 - .pool -_08131DFC: - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r3, [r0, 0x14] - ldr r2, =0x02024084 - ldr r0, =0x0203ab3c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x22 - ldrb r0, [r0] - b _08131E58 - .pool -_08131E20: - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r3, [r0, 0x14] - ldr r2, =0x02024084 - ldr r0, =0x0202420c - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x22 - ldrb r0, [r0] - b _08131E58 - .pool -_08131E44: - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r3, [r0, 0x14] - ldr r2, =gBattleMoves - ldrh r1, [r3, 0x2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x2] -_08131E58: - str r0, [r3, 0x8] -_08131E5A: - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp15_get_some_type - - thumb_func_start sub_8131E70 -sub_8131E70: @ 8131E70 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08131E84 - ldr r0, =0x0203ab3c - ldrb r0, [r0] - b _08131EAC - .pool -_08131E84: - cmp r0, 0x1 - ble _08131E90 - cmp r0, 0x2 - beq _08131EA4 - cmp r0, 0x3 - beq _08131E9C -_08131E90: - ldr r0, =0x0202420c - ldrb r0, [r0] - b _08131EAC - .pool -_08131E9C: - ldr r0, =0x0203ab3c - b _08131EA6 - .pool -_08131EA4: - ldr r0, =0x0202420c -_08131EA6: - ldrb r1, [r0] - movs r0, 0x2 - eors r0, r1 -_08131EAC: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8131E70 - - thumb_func_start tai5F_unk -tai5F_unk: @ 8131EB4 - push {r4,lr} - ldr r4, =0x0203ab38 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl sub_8131E70 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02024084 - movs r1, 0x58 - muls r0, r1 - adds r3, r0, r2 - adds r1, r3, 0 - adds r1, 0x21 - ldr r0, [r4] - ldrb r1, [r1] - ldrb r2, [r0, 0x2] - cmp r1, r2 - beq _08131EE4 - adds r0, r3, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, r2 - bne _08131EFC -_08131EE4: - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0x1 - b _08131F04 - .pool -_08131EFC: - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0 -_08131F04: - str r0, [r1, 0x8] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x3 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end tai5F_unk - - thumb_func_start dp15_move_get_power__2_8 -dp15_move_get_power__2_8: @ 8131F1C - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r3, [r0, 0x14] - ldr r2, =gBattleMoves - ldrh r1, [r3, 0x2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - str r0, [r3, 0x8] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end dp15_move_get_power__2_8 - - thumb_func_start dp15_is_most_powerful_move__8 -dp15_is_most_powerful_move__8: @ 8131F48 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - movs r3, 0 - ldr r0, =gUnknown_085B09C8 - ldrh r1, [r0] - ldr r5, =0x0000ffff - ldr r6, =gBattleMoves - ldr r2, =0x020244a8 - cmp r1, r5 - beq _08131F86 - ldr r0, [r2] - ldr r0, [r0, 0x14] - ldrh r1, [r0, 0x2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r4, [r0] - ldr r1, =gUnknown_085B09C8 -_08131F76: - ldrh r0, [r1] - cmp r4, r0 - beq _08131F86 - adds r1, 0x2 - adds r3, 0x1 - ldrh r0, [r1] - cmp r0, r5 - bne _08131F76 -_08131F86: - ldr r0, [r2] - ldr r0, [r0, 0x14] - ldrh r1, [r0, 0x2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bhi _08131F9C - b _08132126 -_08131F9C: - lsls r0, r3, 1 - ldr r1, =gUnknown_085B09C8 - adds r0, r1 - ldrh r3, [r0] - ldr r0, =0x0000ffff - cmp r3, r0 - beq _08131FAC - b _08132126 -_08131FAC: - ldr r0, =0x02024400 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x0202449c - ldr r0, [r0] - strb r1, [r0, 0x13] - ldr r0, =0x02024474 - movs r2, 0x1 - strb r2, [r0, 0xE] - ldr r0, =0x0202427c - strb r1, [r0] - ldr r0, =0x02024211 - strb r2, [r0] - movs r6, 0 - mov r9, r3 - ldr r2, =gUnknown_085B09C8 - ldrh r2, [r2] - str r2, [sp, 0x10] -_08131FD0: - movs r3, 0 - ldr r5, =0x02024084 - lsls r4, r6, 1 - ldr r7, =0x0203ab3c - lsls r0, r6, 2 - mov r8, r0 - adds r1, r6, 0x1 - mov r10, r1 - ldr r2, [sp, 0x10] - cmp r2, r9 - beq _08132014 - ldr r2, =gBattleMoves - ldrb r1, [r7] - movs r0, 0x58 - muls r0, r1 - adds r0, r4, r0 - adds r1, r5, 0 - adds r1, 0xC - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r2, [r0] - ldr r1, =gUnknown_085B09C8 -_08132004: - ldrh r0, [r1] - cmp r2, r0 - beq _08132014 - adds r1, 0x2 - adds r3, 0x1 - ldrh r0, [r1] - cmp r0, r9 - bne _08132004 -_08132014: - ldrb r1, [r7] - movs r0, 0x58 - muls r0, r1 - adds r0, r4, r0 - adds r1, r5, 0 - adds r1, 0xC - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, 0 - beq _081320C0 - lsls r0, r3, 1 - ldr r2, =gUnknown_085B09C8 - adds r0, r2 - ldrh r0, [r0] - cmp r0, r9 - bne _081320C0 - ldr r0, =gBattleMoves - ldrh r2, [r1] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0x1 - bls _081320C0 - ldr r5, =0x020241ea - strh r2, [r5] - ldrb r0, [r7] - ldr r4, =0x0202420c - ldrb r1, [r4] - bl sub_8046E7C - ldrh r0, [r5] - ldrb r1, [r7] - ldrb r2, [r4] - bl move_effectiveness_something - mov r4, sp - add r4, r8 - ldr r2, =0x020241f0 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - adds r0, 0x18 - adds r0, r6 - ldrb r1, [r0] - ldr r0, [r2] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - str r0, [r4] - cmp r0, 0 - bne _081320C8 - movs r0, 0x1 - str r0, [r4] - b _081320C8 - .pool -_081320C0: - mov r1, sp - add r1, r8 - movs r0, 0 - str r0, [r1] -_081320C8: - mov r6, r10 - cmp r6, 0x3 - bgt _081320D0 - b _08131FD0 -_081320D0: - movs r6, 0 - ldr r2, =0x020244a8 - ldr r0, [r2] - ldr r0, [r0, 0x14] - ldrb r0, [r0, 0x1] - lsls r0, 2 - add r0, sp - ldr r1, [sp] - ldr r0, [r0] - ldr r5, =0x0203ab38 - cmp r1, r0 - bgt _08132106 - adds r4, r2, 0 - mov r3, sp -_081320EC: - adds r3, 0x4 - adds r6, 0x1 - cmp r6, 0x3 - bgt _08132106 - ldr r0, [r4] - ldr r0, [r0, 0x14] - ldrb r0, [r0, 0x1] - lsls r0, 2 - add r0, sp - ldr r1, [r3] - ldr r0, [r0] - cmp r1, r0 - ble _081320EC -_08132106: - cmp r6, 0x4 - bne _0813211C - ldr r0, [r2] - ldr r1, [r0, 0x14] - movs r0, 0x2 - str r0, [r1, 0x8] - b _08132130 - .pool -_0813211C: - ldr r0, [r2] - ldr r1, [r0, 0x14] - movs r0, 0x1 - str r0, [r1, 0x8] - b _08132130 -_08132126: - ldr r0, [r2] - ldr r1, [r0, 0x14] - movs r0, 0 - str r0, [r1, 0x8] - ldr r5, =0x0203ab38 -_08132130: - ldr r0, [r5] - adds r0, 0x1 - str r0, [r5] - 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 dp15_is_most_powerful_move__8 - - thumb_func_start dp15_get_move_to_execute_B -dp15_get_move_to_execute_B: @ 813214C - push {lr} - ldr r0, =0x0203ab38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r3, r0, 0 - cmp r1, 0x1 - bne _08132178 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldr r1, =0x02024248 - ldr r0, =0x0203ab3c - b _08132182 - .pool -_08132178: - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldr r1, =0x02024248 - ldr r0, =0x0202420c -_08132182: - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - str r0, [r2, 0x8] - ldr r0, [r3] - adds r0, 0x2 - str r0, [r3] - pop {r0} - bx r0 - .pool - thumb_func_end dp15_get_move_to_execute_B - - thumb_func_start tai26_unk -tai26_unk: @ 81321A4 - push {lr} - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r0, [r0, 0x8] - cmp r1, r0 - bne _081321D8 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081321DC - .pool -_081321D8: - adds r0, r2, 0x6 - str r0, [r3] -_081321DC: - pop {r0} - bx r0 - thumb_func_end tai26_unk - - thumb_func_start tai27_unk -tai27_unk: @ 81321E0 - push {lr} - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldr r0, [r0, 0x8] - cmp r1, r0 - beq _08132214 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08132218 - .pool -_08132214: - adds r0, r2, 0x6 - str r0, [r3] -_08132218: - pop {r0} - bx r0 - thumb_func_end tai27_unk - - thumb_func_start tai28_unk -tai28_unk: @ 813221C - push {lr} - ldr r0, =0x0203ab3c - ldrb r0, [r0] - ldr r1, =0x0202420c - ldrb r1, [r1] - movs r2, 0x1 - bl b_first_side - ldr r3, =0x0203ab38 - ldr r2, [r3] - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r2, 0x1] - cmp r0, r1 - bne _08132260 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08132264 - .pool -_08132260: - adds r0, r2, 0x6 - str r0, [r3] -_08132264: - pop {r0} - bx r0 - thumb_func_end tai28_unk - - thumb_func_start tai29_unk -tai29_unk: @ 8132268 - push {lr} - ldr r0, =0x0203ab3c - ldrb r0, [r0] - ldr r1, =0x0202420c - ldrb r1, [r1] - movs r2, 0x1 - bl b_first_side - ldr r3, =0x0203ab38 - ldr r2, [r3] - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r2, 0x1] - cmp r0, r1 - beq _081322AC - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081322B0 - .pool -_081322AC: - adds r0, r2, 0x6 - str r0, [r3] -_081322B0: - pop {r0} - bx r0 - thumb_func_end tai29_unk - - thumb_func_start nullsub_102 -nullsub_102: @ 81322B4 - bx lr - thumb_func_end nullsub_102 - - thumb_func_start nullsub_103 -nullsub_103: @ 81322B8 - bx lr - thumb_func_end nullsub_103 - - thumb_func_start tai2C_unk -tai2C_unk: @ 81322BC - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0 - str r0, [r1, 0x8] - ldr r0, =0x0203ab38 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bne _081322E8 - ldr r0, =0x0203ab3c - b _081322EA - .pool -_081322E8: - ldr r0, =0x0202420c -_081322EA: - ldrb r5, [r0] - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x02024744 - mov r8, r1 - cmp r0, 0 - bne _08132300 - ldr r0, =0x020244ec - mov r8, r0 -_08132300: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08132344 - ldr r4, =0x0202406e - lsls r0, r5, 1 - adds r0, r4 - ldrb r7, [r0] - adds r0, r5, 0 - bl battle_get_per_side_status - movs r1, 0x2 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 23 - adds r0, r4 - ldrb r6, [r0] - b _0813234E - .pool -_08132344: - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r0, r1 - ldrb r6, [r0] - adds r7, r6, 0 -_0813234E: - movs r5, 0 -_08132350: - cmp r5, r7 - beq _08132394 - cmp r5, r6 - beq _08132394 - movs r0, 0x64 - muls r0, r5 - mov r1, r8 - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - beq _08132394 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - cmp r0, 0 - beq _08132394 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _08132394 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - ldr r0, [r1, 0x8] - adds r0, 0x1 - str r0, [r1, 0x8] -_08132394: - adds r5, 0x1 - cmp r5, 0x5 - ble _08132350 - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end tai2C_unk - - thumb_func_start dp15_get_move_id__8 -dp15_get_move_id__8: @ 81323B8 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - ldrh r0, [r1, 0x2] - str r0, [r1, 0x8] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end dp15_get_move_id__8 - - thumb_func_start dp15_move_get_move_script_id -dp15_move_get_move_script_id: @ 81323D4 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r3, [r0, 0x14] - ldr r2, =gBattleMoves - ldrh r1, [r3, 0x2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - str r0, [r3, 0x8] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end dp15_move_get_move_script_id - - thumb_func_start tai2F_unk -tai2F_unk: @ 8132400 - push {r4-r7,lr} - ldr r0, =0x0203ab38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - mov r12, r0 - cmp r1, 0x1 - bne _0813241C - ldr r0, =0x0203ab3c - b _0813241E - .pool -_0813241C: - ldr r0, =0x0202420c -_0813241E: - ldrb r3, [r0] - ldr r0, =0x02024064 - ldrb r0, [r0] - cmp r0, r3 - beq _081324F0 - ldr r7, =0x020244a8 - ldr r5, [r7] - ldr r0, [r5, 0x18] - adds r0, 0x40 - adds r2, r0, r3 - ldrb r0, [r2] - adds r6, r7, 0 - cmp r0, 0 - beq _0813244C - ldr r1, [r5, 0x14] - str r0, [r1, 0x8] - b _08132504 - .pool -_0813244C: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r3 - adds r4, r0, r1 - adds r0, r4, 0 - adds r0, 0x20 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0x17 - beq _08132468 - cmp r0, 0x2A - beq _08132468 - cmp r0, 0x47 - bne _08132480 -_08132468: - ldr r0, [r6] - ldr r1, [r0, 0x14] - movs r0, 0x58 - muls r0, r3 - adds r0, r2 - adds r0, 0x20 - ldrb r0, [r0] - str r0, [r1, 0x8] - b _08132504 - .pool -_08132480: - ldr r6, =gBaseStats - ldrh r0, [r4] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r2, r1, r6 - ldrb r0, [r2, 0x16] - cmp r0, 0 - beq _081324E8 - ldrb r0, [r2, 0x17] - cmp r0, 0 - beq _081324E0 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _081324C4 - ldr r0, [r7] - ldr r2, [r0, 0x14] - ldrh r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x16] - str r0, [r2, 0x8] - ldr r0, =0x0203ab38 - mov r12, r0 - b _08132504 - .pool -_081324C4: - ldr r0, [r7] - ldr r2, [r0, 0x14] - ldrh r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x17] - str r0, [r2, 0x8] - ldr r1, =0x0203ab38 - mov r12, r1 - b _08132504 - .pool -_081324E0: - ldr r1, [r5, 0x14] - ldrb r0, [r2, 0x16] - str r0, [r1, 0x8] - b _08132504 -_081324E8: - ldr r1, [r5, 0x14] - ldrb r0, [r2, 0x17] - str r0, [r1, 0x8] - b _08132504 -_081324F0: - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r3 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - str r0, [r2, 0x8] -_08132504: - mov r1, r12 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end tai2F_unk - - thumb_func_start tai60_unk -tai60_unk: @ 813251C - push {r4-r6,lr} - ldr r4, =0x0203ab38 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl sub_8131E70 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r4] - ldrb r3, [r0, 0x2] - ldrb r0, [r0, 0x1] - cmp r0, 0 - beq _0813253A - cmp r0, 0x2 - bne _081325BC -_0813253A: - ldr r0, =0x020244a8 - ldr r4, [r0] - ldr r1, [r4, 0x18] - adds r1, 0x40 - adds r2, r1, r5 - ldrb r1, [r2] - adds r6, r0, 0 - cmp r1, 0 - beq _0813255C - adds r3, r1, 0 - ldr r0, [r4, 0x14] - str r3, [r0, 0x8] - b _081325CA - .pool -_0813255C: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r5 - adds r4, r0, r1 - adds r0, r4, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x17 - beq _08132576 - cmp r0, 0x2A - beq _08132576 - cmp r0, 0x47 - bne _08132588 -_08132576: - movs r0, 0x58 - muls r0, r5 - adds r0, r1 - adds r0, 0x20 - ldrb r3, [r0] - b _081325CA - .pool -_08132588: - ldr r2, =gBaseStats - ldrh r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r1, r0, r2 - ldrb r4, [r1, 0x16] - cmp r4, 0 - beq _081325B8 - ldrb r2, [r1, 0x17] - cmp r2, 0 - beq _081325B4 - adds r0, r3, 0 - cmp r4, r0 - beq _081325CE - cmp r2, r0 - beq _081325CE - adds r3, r4, 0 - b _081325CA - .pool -_081325B4: - ldrb r3, [r1, 0x16] - b _081325CA -_081325B8: - ldrb r3, [r1, 0x17] - b _081325CA -_081325BC: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r5 - adds r0, r1 - adds r0, 0x20 - ldrb r3, [r0] - ldr r6, =0x020244a8 -_081325CA: - cmp r3, 0 - bne _081325E8 -_081325CE: - ldr r0, [r6] - ldr r1, [r0, 0x14] - movs r0, 0x2 - str r0, [r1, 0x8] - ldr r2, =0x0203ab38 - b _08132608 - .pool -_081325E8: - ldr r0, =0x0203ab38 - ldr r1, [r0] - adds r2, r0, 0 - ldrb r1, [r1, 0x2] - cmp r3, r1 - bne _08132600 - ldr r0, [r6] - ldr r1, [r0, 0x14] - movs r0, 0x1 - b _08132606 - .pool -_08132600: - ldr r0, [r6] - ldr r1, [r0, 0x14] - movs r0, 0 -_08132606: - str r0, [r1, 0x8] -_08132608: - ldr r0, [r2] - adds r0, 0x3 - str r0, [r2] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end tai60_unk - - thumb_func_start tai30_unk -tai30_unk: @ 8132614 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x02024400 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x0202449c - ldr r0, [r0] - strb r1, [r0, 0x13] - ldr r0, =0x02024474 - movs r3, 0 - movs r2, 0x1 - strb r2, [r0, 0xE] - ldr r0, =0x0202427c - strb r1, [r0] - ldr r0, =0x02024211 - strb r2, [r0] - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - str r3, [r0, 0x8] - movs r5, 0 - ldr r4, =0x020241f0 - ldr r7, =0x020241ea - ldr r0, =0x02024090 - mov r8, r0 - ldr r6, =0x0203ab3c -_0813264A: - movs r0, 0x28 - str r0, [r4] - lsls r1, r5, 1 - ldrb r2, [r6] - movs r0, 0x58 - muls r0, r2 - adds r1, r0 - add r1, r8 - ldrh r0, [r1] - strh r0, [r7] - lsls r0, 16 - cmp r0, 0 - beq _081326B8 - ldrh r0, [r7] - ldrb r1, [r6] - ldr r2, =0x0202420c - ldrb r2, [r2] - bl move_effectiveness_something - ldr r0, [r4] - cmp r0, 0x78 - bne _0813267A - movs r0, 0x50 - str r0, [r4] -_0813267A: - ldr r0, [r4] - cmp r0, 0xF0 - bne _08132684 - movs r0, 0xA0 - str r0, [r4] -_08132684: - ldr r0, [r4] - cmp r0, 0x1E - bne _0813268E - movs r0, 0x14 - str r0, [r4] -_0813268E: - ldr r0, [r4] - cmp r0, 0xF - bne _08132698 - movs r0, 0xA - str r0, [r4] -_08132698: - ldr r0, =0x0202427c - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _081326A8 - movs r0, 0 - str r0, [r4] -_081326A8: - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldr r0, [r2, 0x8] - ldr r1, [r4] - cmp r0, r1 - bcs _081326B8 - str r1, [r2, 0x8] -_081326B8: - adds r5, 0x1 - cmp r5, 0x3 - ble _0813264A - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end tai30_unk - - thumb_func_start dp15_simulate_damage_bonus_jump_if_eq -dp15_simulate_damage_bonus_jump_if_eq: @ 8132700 - push {r4,r5,lr} - ldr r0, =0x02024400 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x0202449c - ldr r0, [r0] - strb r1, [r0, 0x13] - ldr r0, =0x02024474 - movs r2, 0x1 - strb r2, [r0, 0xE] - ldr r5, =0x0202427c - strb r1, [r5] - ldr r0, =0x02024211 - strb r2, [r0] - ldr r4, =0x020241f0 - movs r0, 0x28 - str r0, [r4] - ldr r1, =0x020241ea - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldrh r0, [r0, 0x2] - strh r0, [r1] - ldrh r0, [r1] - ldr r1, =0x0203ab3c - ldrb r1, [r1] - ldr r2, =0x0202420c - ldrb r2, [r2] - bl move_effectiveness_something - ldr r0, [r4] - cmp r0, 0x78 - bne _08132746 - movs r0, 0x50 - str r0, [r4] -_08132746: - ldr r0, [r4] - cmp r0, 0xF0 - bne _08132750 - movs r0, 0xA0 - str r0, [r4] -_08132750: - ldr r0, [r4] - cmp r0, 0x1E - bne _0813275A - movs r0, 0x14 - str r0, [r4] -_0813275A: - ldr r0, [r4] - cmp r0, 0xF - bne _08132764 - movs r0, 0xA - str r0, [r4] -_08132764: - ldrb r1, [r5] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _08132772 - movs r0, 0 - str r0, [r4] -_08132772: - ldrb r0, [r4] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - cmp r0, r1 - bne _081327C4 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081327C8 - .pool -_081327C4: - adds r0, r2, 0x6 - str r0, [r3] -_081327C8: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end dp15_simulate_damage_bonus_jump_if_eq - - thumb_func_start nullsub_104 -nullsub_104: @ 81327D0 - bx lr - thumb_func_end nullsub_104 - - thumb_func_start nullsub_105 -nullsub_105: @ 81327D4 - bx lr - thumb_func_end nullsub_105 - - thumb_func_start tai34_unk -tai34_unk: @ 81327D8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x0203ab38 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bne _08132818 - ldr r0, =0x0203ab3c - b _0813281A - .pool -_081327F8: - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2, 0x6] - ldrb r0, [r2, 0x7] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x9] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0813289A - .pool -_08132818: - ldr r0, =0x0202420c -_0813281A: - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x02024744 - mov r9, r1 - cmp r0, 0 - bne _0813282E - ldr r0, =0x020244ec - mov r9, r0 -_0813282E: - ldr r0, =0x0203ab38 - ldr r1, [r0] - ldrb r7, [r1, 0x2] - ldrb r0, [r1, 0x3] - lsls r0, 8 - orrs r7, r0 - ldrb r0, [r1, 0x4] - lsls r0, 16 - orrs r7, r0 - ldrb r0, [r1, 0x5] - lsls r0, 24 - orrs r7, r0 - movs r1, 0 - mov r8, r1 - movs r0, 0xCE - lsls r0, 1 - mov r10, r0 -_08132850: - movs r0, 0x64 - mov r4, r8 - muls r4, r0 - add r4, r9 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - cmp r5, 0 - beq _08132888 - cmp r5, r10 - beq _08132888 - cmp r6, 0 - beq _08132888 - cmp r0, r7 - beq _081327F8 -_08132888: - movs r1, 0x1 - add r8, r1 - mov r0, r8 - cmp r0, 0x5 - ble _08132850 - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0xA - str r0, [r1] -_0813289A: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end tai34_unk - - thumb_func_start tai35_unk -tai35_unk: @ 81328B8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x0203ab38 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bne _081328D8 - ldr r0, =0x0203ab3c - b _081328DA - .pool -_081328D8: - ldr r0, =0x0202420c -_081328DA: - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - ldr r1, =0x02024744 - mov r10, r1 - cmp r0, 0 - bne _081328EE - ldr r0, =0x020244ec - mov r10, r0 -_081328EE: - ldr r2, =0x0203ab38 - ldr r1, [r2] - ldrb r7, [r1, 0x2] - ldrb r0, [r1, 0x3] - lsls r0, 8 - orrs r7, r0 - ldrb r0, [r1, 0x4] - lsls r0, 16 - orrs r7, r0 - ldrb r0, [r1, 0x5] - lsls r0, 24 - orrs r7, r0 - movs r1, 0 - mov r8, r1 - mov r9, r2 -_0813290C: - movs r0, 0x64 - mov r4, r8 - muls r4, r0 - add r4, r10 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - cmp r5, 0 - beq _08132950 - movs r1, 0xCE - lsls r1, 1 - cmp r5, r1 - beq _08132950 - cmp r6, 0 - beq _08132950 - cmp r0, r7 - bne _08132950 - mov r1, r9 - ldr r0, [r1] - adds r0, 0xA - str r0, [r1] -_08132950: - movs r0, 0x1 - add r8, r0 - mov r1, r8 - cmp r1, 0x5 - ble _0813290C - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2, 0x6] - ldrb r0, [r2, 0x7] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x8] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x9] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end tai35_unk - - thumb_func_start dp15_get_weather__8 -dp15_get_weather__8: @ 8132994 - push {lr} - ldr r2, =0x020243cc - ldrh r1, [r2] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - beq _081329AC - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0x1 - str r0, [r1, 0x8] -_081329AC: - ldrh r1, [r2] - movs r0, 0x18 - ands r0, r1 - cmp r0, 0 - beq _081329C0 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0x2 - str r0, [r1, 0x8] -_081329C0: - ldrh r1, [r2] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _081329D4 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0 - str r0, [r1, 0x8] -_081329D4: - ldrh r1, [r2] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081329E8 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x14] - movs r0, 0x3 - str r0, [r1, 0x8] -_081329E8: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end dp15_get_weather__8 - - thumb_func_start tai37_unk -tai37_unk: @ 8132A00 - push {lr} - ldr r2, =gBattleMoves - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldrh r1, [r0, 0x2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r0, [r0] - ldrb r1, [r2, 0x1] - cmp r0, r1 - bne _08132A44 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08132A48 - .pool -_08132A44: - adds r0, r2, 0x6 - str r0, [r3] -_08132A48: - pop {r0} - bx r0 - thumb_func_end tai37_unk - - thumb_func_start tai38_unk -tai38_unk: @ 8132A4C - push {lr} - ldr r2, =gBattleMoves - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldrh r1, [r0, 0x2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r0, [r0] - ldrb r1, [r2, 0x1] - cmp r0, r1 - beq _08132A90 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08132A94 - .pool -_08132A90: - adds r0, r2, 0x6 - str r0, [r3] -_08132A94: - pop {r0} - bx r0 - thumb_func_end tai38_unk - - thumb_func_start tai39_unk -tai39_unk: @ 8132A98 - push {r4,lr} - ldr r0, =0x0203ab38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _08132AB4 - ldr r0, =0x0203ab3c - b _08132AB6 - .pool -_08132AB4: - ldr r0, =0x0202420c -_08132AB6: - ldrb r3, [r0] - ldr r1, =0x02024084 - ldr r2, [r4] - movs r0, 0x58 - muls r0, r3 - ldrb r3, [r2, 0x2] - adds r0, r3 - adds r1, 0x18 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrb r1, [r2, 0x3] - cmp r0, r1 - bge _08132AF4 - ldrb r1, [r2, 0x4] - ldrb r0, [r2, 0x5] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08132AFA - .pool -_08132AF4: - adds r0, r2, 0 - adds r0, 0x8 - str r0, [r4] -_08132AFA: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai39_unk - - thumb_func_start tai3A_unk -tai3A_unk: @ 8132B00 - push {r4,lr} - ldr r0, =0x0203ab38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _08132B1C - ldr r0, =0x0203ab3c - b _08132B1E - .pool -_08132B1C: - ldr r0, =0x0202420c -_08132B1E: - ldrb r3, [r0] - ldr r1, =0x02024084 - ldr r2, [r4] - movs r0, 0x58 - muls r0, r3 - ldrb r3, [r2, 0x2] - adds r0, r3 - adds r1, 0x18 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrb r1, [r2, 0x3] - cmp r0, r1 - ble _08132B5C - ldrb r1, [r2, 0x4] - ldrb r0, [r2, 0x5] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08132B62 - .pool -_08132B5C: - adds r0, r2, 0 - adds r0, 0x8 - str r0, [r4] -_08132B62: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai3A_unk - - thumb_func_start tai3B_unk -tai3B_unk: @ 8132B68 - push {r4,lr} - ldr r0, =0x0203ab38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _08132B84 - ldr r0, =0x0203ab3c - b _08132B86 - .pool -_08132B84: - ldr r0, =0x0202420c -_08132B86: - ldrb r3, [r0] - ldr r1, =0x02024084 - ldr r2, [r4] - movs r0, 0x58 - muls r0, r3 - ldrb r3, [r2, 0x2] - adds r0, r3 - adds r1, 0x18 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrb r1, [r2, 0x3] - cmp r0, r1 - bne _08132BC4 - ldrb r1, [r2, 0x4] - ldrb r0, [r2, 0x5] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08132BCA - .pool -_08132BC4: - adds r0, r2, 0 - adds r0, 0x8 - str r0, [r4] -_08132BCA: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai3B_unk - - thumb_func_start tai3C_unk -tai3C_unk: @ 8132BD0 - push {r4,lr} - ldr r0, =0x0203ab38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _08132BEC - ldr r0, =0x0203ab3c - b _08132BEE - .pool -_08132BEC: - ldr r0, =0x0202420c -_08132BEE: - ldrb r3, [r0] - ldr r1, =0x02024084 - ldr r2, [r4] - movs r0, 0x58 - muls r0, r3 - ldrb r3, [r2, 0x2] - adds r0, r3 - adds r1, 0x18 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrb r1, [r2, 0x3] - cmp r0, r1 - beq _08132C2C - ldrb r1, [r2, 0x4] - ldrb r0, [r2, 0x5] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08132C32 - .pool -_08132C2C: - adds r0, r2, 0 - adds r0, 0x8 - str r0, [r4] -_08132C32: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai3C_unk - - thumb_func_start tai3D_unk -tai3D_unk: @ 8132C38 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r2, =gBattleMoves - ldr r0, =0x020244a8 - mov r8, r0 - ldr r0, [r0] - ldr r0, [r0, 0x14] - ldrh r1, [r0, 0x2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bls _08132D1C - ldr r0, =0x02024400 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x0202449c - ldr r0, [r0] - strb r1, [r0, 0x13] - ldr r0, =0x02024474 - movs r7, 0x1 - strb r7, [r0, 0xE] - ldr r0, =0x0202427c - strb r1, [r0] - ldr r0, =0x02024211 - strb r7, [r0] - ldr r5, =0x020241ea - mov r1, r8 - ldr r0, [r1] - ldr r0, [r0, 0x14] - ldrh r0, [r0, 0x2] - strh r0, [r5] - ldr r4, =0x0203ab3c - ldrb r0, [r4] - ldr r6, =0x0202420c - ldrb r1, [r6] - bl sub_8046E7C - ldrh r0, [r5] - ldrb r1, [r4] - ldrb r2, [r6] - bl move_effectiveness_something - ldr r4, =0x020241f0 - mov r1, r8 - ldr r0, [r1] - ldr r1, [r0, 0x14] - adds r0, r1, 0 - adds r0, 0x18 - ldrb r1, [r1, 0x1] - adds r0, r1 - ldrb r1, [r0] - ldr r0, [r4] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - str r0, [r4] - cmp r0, 0 - bne _08132CB8 - str r7, [r4] -_08132CB8: - ldr r2, =0x02024084 - ldrb r1, [r6] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r1, [r0, 0x28] - ldr r0, [r4] - cmp r1, r0 - bgt _08132D1C - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08132D24 - .pool -_08132D1C: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_08132D24: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end tai3D_unk - - thumb_func_start dp15_determine_move_damage_jump_if_not_fatal -dp15_determine_move_damage_jump_if_not_fatal: @ 8132D34 - push {r4-r7,lr} - ldr r2, =gBattleMoves - ldr r7, =0x020244a8 - ldr r0, [r7] - ldr r0, [r0, 0x14] - ldrh r1, [r0, 0x2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bls _08132E04 - ldr r0, =0x02024400 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x0202449c - ldr r0, [r0] - strb r1, [r0, 0x13] - ldr r0, =0x02024474 - movs r2, 0x1 - strb r2, [r0, 0xE] - ldr r0, =0x0202427c - strb r1, [r0] - ldr r0, =0x02024211 - strb r2, [r0] - ldr r6, =0x020241ea - ldr r0, [r7] - ldr r0, [r0, 0x14] - ldrh r0, [r0, 0x2] - strh r0, [r6] - ldr r4, =0x0203ab3c - ldrb r0, [r4] - ldr r5, =0x0202420c - ldrb r1, [r5] - bl sub_8046E7C - ldrh r0, [r6] - ldrb r1, [r4] - ldrb r2, [r5] - bl move_effectiveness_something - ldr r4, =0x020241f0 - ldr r0, [r7] - ldr r1, [r0, 0x14] - adds r0, r1, 0 - adds r0, 0x18 - ldrb r1, [r1, 0x1] - adds r0, r1 - ldrb r1, [r0] - ldr r0, [r4] - muls r0, r1 - movs r1, 0x64 - bl __divsi3 - str r0, [r4] - ldr r3, =0x02024084 - ldrb r2, [r5] - movs r1, 0x58 - muls r1, r2 - adds r1, r3 - ldrh r1, [r1, 0x28] - cmp r1, r0 - ble _08132E04 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08132E0C - .pool -_08132E04: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_08132E0C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp15_determine_move_damage_jump_if_not_fatal - - thumb_func_start tai3F_unk -tai3F_unk: @ 8132E18 - push {r4-r7,lr} - ldr r0, =0x0203ab38 - ldr r5, [r0] - adds r7, r5, 0x2 - ldrb r1, [r5, 0x1] - adds r6, r0, 0 - cmp r1, 0x1 - beq _08132E42 - cmp r1, 0x1 - bgt _08132E38 - cmp r1, 0 - beq _08132EDC - b _08132F40 - .pool -_08132E38: - cmp r1, 0x2 - beq _08132EDC - cmp r1, 0x3 - beq _08132E84 - b _08132F40 -_08132E42: - movs r4, 0 - ldr r3, =0x02024084 - ldr r2, =0x0203ab3c - ldrb r1, [r2] - movs r0, 0x58 - muls r0, r1 - adds r3, 0xC - adds r0, r3 - ldrh r0, [r0] - ldrh r5, [r5, 0x2] - cmp r0, r5 - beq _08132E74 - movs r5, 0x58 -_08132E5C: - adds r4, 0x1 - cmp r4, 0x3 - bgt _08132E74 - lsls r1, r4, 1 - ldrb r0, [r2] - muls r0, r5 - adds r1, r0 - adds r1, r3 - ldrh r0, [r1] - ldrh r1, [r7] - cmp r0, r1 - bne _08132E5C -_08132E74: - cmp r4, 0x4 - beq _08132F18 - b _08132F28 - .pool -_08132E84: - ldr r3, =0x02024084 - ldr r2, =0x0203ab3c - ldrb r1, [r2] - movs r0, 0x2 - eors r0, r1 - movs r1, 0x58 - muls r1, r0 - adds r0, r1, r3 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08132EA8 - adds r0, r5, 0 - b _08132F1A - .pool -_08132EA8: - movs r4, 0 - adds r3, 0xC - adds r0, r1, r3 - ldrh r0, [r0] - ldrh r5, [r5, 0x2] - cmp r0, r5 - beq _08132E74 - mov r12, r3 - adds r5, r2, 0 - movs r3, 0x2 -_08132EBC: - adds r4, 0x1 - cmp r4, 0x3 - bgt _08132E74 - lsls r1, r4, 1 - ldrb r0, [r5] - adds r2, r3, 0 - eors r2, r0 - movs r0, 0x58 - muls r0, r2 - adds r1, r0 - add r1, r12 - ldrh r0, [r1] - ldrh r1, [r7] - cmp r0, r1 - bne _08132EBC - b _08132E74 -_08132EDC: - movs r4, 0 - ldr r3, =0x020244a8 - ldr r0, [r3] - ldr r1, [r0, 0x18] - ldr r2, =0x0202420c - ldrb r0, [r2] - lsls r0, 4 - adds r1, r0 - ldrh r0, [r1] - ldrh r1, [r7] - cmp r0, r1 - beq _08132F14 - adds r7, r3, 0 - adds r5, r2, 0 - adds r3, r1, 0 -_08132EFA: - adds r4, 0x1 - cmp r4, 0x3 - bgt _08132F14 - ldr r0, [r7] - ldr r2, [r0, 0x18] - lsls r1, r4, 1 - ldrb r0, [r5] - lsls r0, 4 - adds r1, r0 - adds r2, r1 - ldrh r0, [r2] - cmp r0, r3 - bne _08132EFA -_08132F14: - cmp r4, 0x4 - bne _08132F28 -_08132F18: - ldr r0, [r6] -_08132F1A: - adds r0, 0x8 - str r0, [r6] - b _08132F40 - .pool -_08132F28: - ldr r2, [r6] - ldrb r1, [r2, 0x4] - ldrb r0, [r2, 0x5] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 24 - orrs r1, r0 - str r1, [r6] -_08132F40: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end tai3F_unk - - thumb_func_start tai40_unk -tai40_unk: @ 8132F48 - push {r4-r7,lr} - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r6, r0, 0x2 - ldrb r0, [r0, 0x1] - adds r5, r1, 0 - cmp r0, 0x1 - beq _08132F70 - cmp r0, 0x1 - bgt _08132F68 - cmp r0, 0 - beq _08132FB4 - b _08133018 - .pool -_08132F68: - cmp r0, 0x2 - beq _08132FB4 - cmp r0, 0x3 - bne _08133018 -_08132F70: - movs r3, 0 - ldr r2, =0x02024084 - ldr r4, =0x0203ab3c - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - adds r2, 0xC - adds r0, r2 - ldrh r0, [r0] - ldrh r1, [r6] - cmp r0, r1 - beq _08132FA6 - adds r7, r4, 0 - movs r6, 0x58 - adds r4, r2, 0 - adds r2, r1, 0 -_08132F90: - adds r3, 0x1 - cmp r3, 0x3 - bgt _08132FA6 - lsls r1, r3, 1 - ldrb r0, [r7] - muls r0, r6 - adds r1, r0 - adds r1, r4 - ldrh r0, [r1] - cmp r0, r2 - bne _08132F90 -_08132FA6: - cmp r3, 0x4 - bne _08132FF0 - b _08133000 - .pool -_08132FB4: - movs r3, 0 - ldr r4, =0x020244a8 - ldr r0, [r4] - ldr r1, [r0, 0x18] - ldr r2, =0x0202420c - ldrb r0, [r2] - lsls r0, 4 - adds r1, r0 - ldrh r0, [r1] - ldrh r1, [r6] - cmp r0, r1 - beq _08132FEC - adds r7, r4, 0 - adds r6, r2, 0 - adds r4, r1, 0 -_08132FD2: - adds r3, 0x1 - cmp r3, 0x3 - bgt _08132FEC - ldr r0, [r7] - ldr r2, [r0, 0x18] - lsls r1, r3, 1 - ldrb r0, [r6] - lsls r0, 4 - adds r1, r0 - adds r2, r1 - ldrh r0, [r2] - cmp r0, r4 - bne _08132FD2 -_08132FEC: - cmp r3, 0x4 - beq _08133000 -_08132FF0: - ldr r0, [r5] - adds r0, 0x8 - str r0, [r5] - b _08133018 - .pool -_08133000: - ldr r2, [r5] - ldrb r1, [r2, 0x4] - ldrb r0, [r2, 0x5] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 24 - orrs r1, r0 - str r1, [r5] -_08133018: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end tai40_unk - - thumb_func_start tai41_unk -tai41_unk: @ 8133020 - push {r4-r7,lr} - ldr r1, =0x0203ab38 - ldr r0, [r1] - ldrb r0, [r0, 0x1] - adds r5, r1, 0 - cmp r0, 0x1 - beq _08133044 - cmp r0, 0x1 - bgt _0813303C - cmp r0, 0 - beq _08133090 - b _08133110 - .pool -_0813303C: - cmp r0, 0x2 - beq _08133090 - cmp r0, 0x3 - bne _08133110 -_08133044: - movs r3, 0 - ldr r1, =0x02024084 - ldr r0, =0x0203ab3c - ldrb r2, [r0] - ldr r6, =gBattleMoves - movs r0, 0x58 - muls r0, r2 - adds r1, 0xC - adds r2, r0, r1 - ldr r4, =0x0203ab38 -_08133058: - ldrh r0, [r2] - cmp r0, 0 - beq _08133072 - adds r1, r0, 0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldr r1, [r4] - ldrb r0, [r0] - ldrb r1, [r1, 0x2] - cmp r0, r1 - beq _0813307A -_08133072: - adds r2, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - ble _08133058 -_0813307A: - cmp r3, 0x4 - beq _081330DC - b _081330F8 - .pool -_08133090: - movs r3, 0 - ldr r1, =0x02024084 - ldr r0, =0x0203ab3c - ldrb r2, [r0] - ldr r0, =gBattleMoves - mov r12, r0 - ldr r7, =0x020244a8 - ldr r6, =0x0202420c - movs r0, 0x58 - muls r0, r2 - adds r1, 0xC - adds r4, r0, r1 -_081330A8: - lsls r2, r3, 1 - ldrh r0, [r4] - cmp r0, 0 - beq _081330D0 - ldr r0, [r7] - ldr r1, [r0, 0x18] - ldrb r0, [r6] - lsls r0, 4 - adds r0, r2, r0 - adds r1, r0 - ldrh r1, [r1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - add r0, r12 - ldr r1, [r5] - ldrb r0, [r0] - ldrb r1, [r1, 0x2] - cmp r0, r1 - beq _081330D8 -_081330D0: - adds r4, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - ble _081330A8 -_081330D8: - cmp r3, 0x4 - bne _081330F8 -_081330DC: - ldr r0, [r5] - adds r0, 0x7 - str r0, [r5] - b _08133110 - .pool -_081330F8: - ldr r2, [r5] - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r5] -_08133110: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end tai41_unk - - thumb_func_start tai42_unk -tai42_unk: @ 8133118 - push {r4-r6,lr} - ldr r1, =0x0203ab38 - ldr r0, [r1] - ldrb r0, [r0, 0x1] - adds r4, r1, 0 - cmp r0, 0x1 - beq _0813313C - cmp r0, 0x1 - bgt _08133134 - cmp r0, 0 - beq _08133188 - b _081331F4 - .pool -_08133134: - cmp r0, 0x2 - beq _08133188 - cmp r0, 0x3 - bne _081331F4 -_0813313C: - movs r3, 0 - ldr r1, =0x02024084 - ldr r0, =0x0203ab3c - ldrb r2, [r0] - ldr r6, =gBattleMoves - movs r0, 0x58 - muls r0, r2 - adds r1, 0xC - adds r2, r0, r1 - ldr r5, =0x0203ab38 -_08133150: - ldrh r0, [r2] - cmp r0, 0 - beq _0813316A - adds r1, r0, 0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldr r1, [r5] - ldrb r0, [r0] - ldrb r1, [r1, 0x2] - cmp r0, r1 - beq _08133172 -_0813316A: - adds r2, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - ble _08133150 -_08133172: - cmp r3, 0x4 - bne _081331C2 - b _081331DC - .pool -_08133188: - movs r3, 0 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r1, [r0, 0x18] - ldr r0, =0x0202420c - ldrb r0, [r0] - ldr r6, =gBattleMoves - lsls r0, 4 - adds r2, r0, r1 - ldr r5, =0x0203ab38 -_0813319C: - ldrh r0, [r2] - cmp r0, 0 - beq _081331B6 - adds r1, r0, 0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldr r1, [r5] - ldrb r0, [r0] - ldrb r1, [r1, 0x2] - cmp r0, r1 - beq _081331BE -_081331B6: - adds r2, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - ble _0813319C -_081331BE: - cmp r3, 0x4 - beq _081331DC -_081331C2: - ldr r0, [r4] - adds r0, 0x7 - str r0, [r4] - b _081331F4 - .pool -_081331DC: - ldr r2, [r4] - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] -_081331F4: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end tai42_unk - - thumb_func_start tai43_unk -tai43_unk: @ 81331FC - push {r4,r5,lr} - ldr r0, =0x0203ab38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r5, r0, 0 - cmp r1, 0x1 - bne _08133218 - ldr r0, =0x0203ab3c - b _0813321A - .pool -_08133218: - ldr r0, =0x0202420c -_0813321A: - ldrb r3, [r0] - adds r4, r5, 0 - ldr r2, [r4] - ldrb r0, [r2, 0x2] - cmp r0, 0 - bne _08133240 - ldr r0, =0x020242bc - lsls r1, r3, 3 - subs r1, r3 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x4] - cmp r0, 0 - beq _08133244 - b _0813325A - .pool -_08133240: - cmp r0, 0x1 - beq _0813324A -_08133244: - adds r0, r2, 0x7 - str r0, [r4] - b _0813327C -_0813324A: - ldr r0, =0x020242bc - lsls r1, r3, 3 - subs r1, r3 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x6] - cmp r0, 0 - beq _08133278 -_0813325A: - ldrb r1, [r2, 0x3] - ldrb r0, [r2, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _0813327C - .pool -_08133278: - adds r0, r2, 0x7 - str r0, [r5] -_0813327C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end tai43_unk - - thumb_func_start tai44_unk -tai44_unk: @ 8133284 - push {r4,lr} - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r0, [r3, 0x1] - cmp r0, 0 - beq _0813329C - cmp r0, 0x1 - beq _081332C8 - b _08133308 - .pool -_0813329C: - ldr r2, =0x020242bc - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x020244a8 - ldr r1, [r1] - ldr r1, [r1, 0x14] - ldrh r0, [r0, 0x4] - ldrh r1, [r1, 0x2] - cmp r0, r1 - beq _081332E4 - b _08133308 - .pool -_081332C8: - ldr r2, =0x020242bc - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x020244a8 - ldr r1, [r1] - ldr r1, [r1, 0x14] - ldrh r0, [r0, 0x6] - ldrh r1, [r1, 0x2] - cmp r0, r1 - bne _08133308 -_081332E4: - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _0813330C - .pool -_08133308: - adds r0, r3, 0x6 - str r0, [r4] -_0813330C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai44_unk - - thumb_func_start tai45_unk -tai45_unk: @ 8133314 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldrb r1, [r2, 0x10] - movs r0, 0xB - orrs r0, r1 - strb r0, [r2, 0x10] - bx lr - .pool - thumb_func_end tai45_unk - - thumb_func_start tai46_unk -tai46_unk: @ 8133328 - push {r4,lr} - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x7B - ldrb r0, [r0] - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - cmp r0, r4 - bcs _08133374 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0813337C - .pool -_08133374: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_0813337C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end tai46_unk - - thumb_func_start dp15_end_with_move_5 -dp15_end_with_move_5: @ 8133388 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldrb r1, [r2, 0x10] - movs r0, 0xD - orrs r0, r1 - strb r0, [r2, 0x10] - bx lr - .pool - thumb_func_end dp15_end_with_move_5 - - thumb_func_start dp15_get_held_item_x12__8 -dp15_get_held_item_x12__8: @ 813339C - push {r4,lr} - ldr r0, =0x0203ab38 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bne _081333B4 - ldr r0, =0x0203ab3c - b _081333B6 - .pool -_081333B4: - ldr r0, =0x0202420c -_081333B6: - ldrb r2, [r0] - ldr r0, =0x02024064 - ldrb r0, [r0] - cmp r0, r2 - beq _081333E0 - ldr r4, =0x020244a8 - ldr r0, [r4] - ldr r0, [r0, 0x18] - adds r0, 0x44 - adds r0, r2 - ldrb r0, [r0] - bl itemid_get_x12 - ldr r1, [r4] - b _081333F2 - .pool -_081333E0: - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x2E] - bl itemid_get_x12 - ldr r1, =0x020244a8 - ldr r1, [r1] -_081333F2: - ldr r1, [r1, 0x14] - lsls r0, 24 - lsrs r0, 24 - str r0, [r1, 0x8] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp15_get_held_item_x12__8 - - thumb_func_start tai62_unk -tai62_unk: @ 8133414 - push {r4,lr} - ldr r0, =0x0203ab38 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl sub_8131E70 - lsls r0, 24 - lsrs r3, r0, 24 - movs r0, 0x1 - ldr r1, =0x0203ab3c - ldrb r2, [r1] - adds r1, r3, 0 - ands r1, r0 - ands r0, r2 - cmp r1, r0 - bne _0813344C - ldr r1, =0x02024084 - movs r0, 0x58 - muls r0, r3 - adds r0, r1 - ldrh r3, [r0, 0x2E] - b _08133458 - .pool -_0813344C: - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r0, [r0, 0x18] - adds r0, 0x44 - adds r0, r3 - ldrb r3, [r0] -_08133458: - ldr r4, =0x0203ab38 - ldr r2, [r4] - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - orrs r0, r1 - cmp r0, r3 - bne _08133488 - ldrb r1, [r2, 0x4] - ldrb r0, [r2, 0x5] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x6] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x7] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _0813348E - .pool -_08133488: - adds r0, r2, 0 - adds r0, 0x8 - str r0, [r4] -_0813348E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai62_unk - - thumb_func_start tai49_unk -tai49_unk: @ 8133494 - push {lr} - ldr r0, =0x0203ab38 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - cmp r0, 0x1 - bne _081334AC - ldr r0, =0x0203ab3c - b _081334AE - .pool -_081334AC: - ldr r0, =0x0202420c -_081334AE: - ldrb r1, [r0] - ldr r2, =0x02024084 - movs r0, 0x58 - muls r1, r0 - adds r0, r1, r2 - ldrh r0, [r0] - adds r2, 0x48 - adds r1, r2 - ldr r1, [r1] - bl pokemon_species_get_gender_info - ldr r1, =0x020244a8 - ldr r1, [r1] - ldr r1, [r1, 0x14] - lsls r0, 24 - lsrs r0, 24 - str r0, [r1, 0x8] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end tai49_unk - - thumb_func_start dp15_enter_battle_countdown_get_state -dp15_enter_battle_countdown_get_state: @ 81334EC - push {r4,lr} - ldr r0, =0x0203ab38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _08133508 - ldr r0, =0x0203ab3c - b _0813350A - .pool -_08133508: - ldr r0, =0x0202420c -_0813350A: - ldrb r3, [r0] - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldr r1, =0x020242bc - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x16] - str r0, [r2, 0x8] - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp15_enter_battle_countdown_get_state - - thumb_func_start dp15_stockpile_get_num_uses -dp15_stockpile_get_num_uses: @ 8133538 - push {r4,lr} - ldr r0, =0x0203ab38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _08133554 - ldr r0, =0x0203ab3c - b _08133556 - .pool -_08133554: - ldr r0, =0x0202420c -_08133556: - ldrb r3, [r0] - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldr r1, =0x020242bc - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x9] - str r0, [r2, 0x8] - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp15_stockpile_get_num_uses - - thumb_func_start dp15_is_double_battle -dp15_is_double_battle: @ 8133584 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - str r0, [r2, 0x8] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end dp15_is_double_battle - - thumb_func_start dp15_get_dp08_item__8 -dp15_get_dp08_item__8: @ 81335AC - push {r4,lr} - ldr r0, =0x0203ab38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _081335C8 - ldr r0, =0x0203ab3c - b _081335CA - .pool -_081335C8: - ldr r0, =0x0202420c -_081335CA: - ldrb r3, [r0] - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldr r0, =0x0202449c - ldr r1, [r0] - lsls r0, r3, 1 - adds r0, r1 - adds r0, 0xB8 - ldrb r0, [r0] - str r0, [r2, 0x8] - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp15_get_dp08_item__8 - - thumb_func_start dp15_move_get_type__8 -dp15_move_get_type__8: @ 81335F8 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r3, [r0, 0x14] - ldr r2, =gBattleMoves - ldr r1, [r3, 0x8] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x2] - str r0, [r3, 0x8] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end dp15_move_get_type__8 - - thumb_func_start dp15_move_get_power__8_8 -dp15_move_get_power__8_8: @ 8133624 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r3, [r0, 0x14] - ldr r2, =gBattleMoves - ldr r1, [r3, 0x8] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - str r0, [r3, 0x8] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end dp15_move_get_power__8_8 - - thumb_func_start dp15_move_get_move_script_id__8 -dp15_move_get_move_script_id__8: @ 8133650 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r3, [r0, 0x14] - ldr r2, =gBattleMoves - ldr r1, [r3, 0x8] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - str r0, [r3, 0x8] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end dp15_move_get_move_script_id__8 - - thumb_func_start dp15_get_protect_endure_activity -dp15_get_protect_endure_activity: @ 813367C - push {r4,lr} - ldr r0, =0x0203ab38 - ldr r1, [r0] - ldrb r1, [r1, 0x1] - adds r4, r0, 0 - cmp r1, 0x1 - bne _08133698 - ldr r0, =0x0203ab3c - b _0813369A - .pool -_08133698: - ldr r0, =0x0202420c -_0813369A: - ldrb r3, [r0] - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldr r1, =0x020242bc - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x8] - str r0, [r2, 0x8] - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp15_get_protect_endure_activity - - thumb_func_start nullsub_106 -nullsub_106: @ 81336C8 - bx lr - thumb_func_end nullsub_106 - - thumb_func_start nullsub_107 -nullsub_107: @ 81336CC - bx lr - thumb_func_end nullsub_107 - - thumb_func_start nullsub_108 -nullsub_108: @ 81336D0 - bx lr - thumb_func_end nullsub_108 - - thumb_func_start nullsub_109 -nullsub_109: @ 81336D4 - bx lr - thumb_func_end nullsub_109 - - thumb_func_start nullsub_110 -nullsub_110: @ 81336D8 - bx lr - thumb_func_end nullsub_110 - - thumb_func_start nullsub_111 -nullsub_111: @ 81336DC - bx lr - thumb_func_end nullsub_111 - - thumb_func_start tai58_unk -tai58_unk: @ 81336E0 - push {r4,lr} - ldr r4, =0x0203ab38 - ldr r0, [r4] - adds r0, 0x5 - bl b_mc_stack_push - ldr r2, [r4] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end tai58_unk - - thumb_func_start dp15_jump -dp15_jump: @ 8133710 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - bx lr - .pool - thumb_func_end dp15_jump - - thumb_func_start dp15_return -dp15_return: @ 8133730 - push {lr} - bl b_mc_stack_pop_cursor - lsls r0, 24 - cmp r0, 0 - bne _0813374A - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r2, [r0, 0x14] - ldrb r1, [r2, 0x10] - movs r0, 0x1 - orrs r0, r1 - strb r0, [r2, 0x10] -_0813374A: - pop {r0} - bx r0 - .pool - thumb_func_end dp15_return - - thumb_func_start dp15_compare_attacker_defender_levels -dp15_compare_attacker_defender_levels: @ 8133754 - push {r4,r5,lr} - ldr r5, =0x0203ab38 - ldr r4, [r5] - ldrb r0, [r4, 0x1] - cmp r0, 0x1 - beq _081337A8 - cmp r0, 0x1 - bgt _08133770 - cmp r0, 0 - beq _08133776 - b _08133824 - .pool -_08133770: - cmp r0, 0x2 - beq _081337D8 - b _08133824 -_08133776: - ldr r3, =0x02024084 - ldr r0, =0x0203ab3c - ldrb r0, [r0] - movs r2, 0x58 - adds r1, r0, 0 - muls r1, r2 - adds r1, r3 - adds r1, 0x2A - ldr r0, =0x0202420c - ldrb r0, [r0] - muls r0, r2 - adds r0, r3 - adds r0, 0x2A - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - bhi _081337FA - b _08133820 - .pool -_081337A8: - ldr r3, =0x02024084 - ldr r0, =0x0203ab3c - ldrb r0, [r0] - movs r2, 0x58 - adds r1, r0, 0 - muls r1, r2 - adds r1, r3 - adds r1, 0x2A - ldr r0, =0x0202420c - ldrb r0, [r0] - muls r0, r2 - adds r0, r3 - adds r0, 0x2A - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - bcc _081337FA - b _08133820 - .pool -_081337D8: - ldr r3, =0x02024084 - ldr r0, =0x0203ab3c - ldrb r0, [r0] - movs r2, 0x58 - adds r1, r0, 0 - muls r1, r2 - adds r1, r3 - adds r1, 0x2A - ldr r0, =0x0202420c - ldrb r0, [r0] - muls r0, r2 - adds r0, r3 - adds r0, 0x2A - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - bne _08133820 -_081337FA: - ldrb r1, [r4, 0x2] - ldrb r0, [r4, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r4, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r4, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r5] - b _08133824 - .pool -_08133820: - adds r0, r4, 0x6 - str r0, [r5] -_08133824: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end dp15_compare_attacker_defender_levels - - thumb_func_start tai5C_unk -tai5C_unk: @ 813382C - push {lr} - ldr r2, =0x020242bc - ldr r0, =0x0202420c - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x13] - lsls r0, 28 - cmp r0, 0 - beq _0813386C - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08133874 - .pool -_0813386C: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_08133874: - pop {r0} - bx r0 - .pool - thumb_func_end tai5C_unk - - thumb_func_start tai5D_unk -tai5D_unk: @ 813387C - push {lr} - ldr r2, =0x020242bc - ldr r0, =0x0202420c - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x13] - lsls r0, 28 - cmp r0, 0 - bne _081338BC - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081338C4 - .pool -_081338BC: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_081338C4: - pop {r0} - bx r0 - .pool - thumb_func_end tai5D_unk - - thumb_func_start tai5E_unk -tai5E_unk: @ 81338CC - push {lr} - ldr r0, =0x0203ab3c - ldrb r3, [r0] - movs r0, 0x1 - ldr r1, =0x0202420c - ldrb r2, [r1] - adds r1, r0, 0 - ands r1, r3 - ands r0, r2 - cmp r1, r0 - bne _0813390C - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08133914 - .pool -_0813390C: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_08133914: - pop {r0} - bx r0 - .pool - thumb_func_end tai5E_unk - - thumb_func_start tai61_unk -tai61_unk: @ 813391C - push {r4,lr} - ldr r4, =0x0203ab38 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl sub_8131E70 - lsls r0, 24 - ldr r1, =0x020244a8 - ldr r1, [r1] - ldr r1, [r1, 0x4] - lsrs r0, 22 - adds r1, r0 - ldr r0, [r1] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08133960 - ldr r2, [r4] - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08133966 - .pool -_08133960: - ldr r0, [r4] - adds r0, 0x6 - str r0, [r4] -_08133966: - pop {r4} - pop {r0} - bx r0 - thumb_func_end tai61_unk - - thumb_func_start b_mc_stack_push -b_mc_stack_push: @ 813396C - push {r4,lr} - ldr r1, =0x020244a8 - ldr r1, [r1] - ldr r3, [r1, 0x1C] - adds r4, r3, 0 - adds r4, 0x20 - ldrb r1, [r4] - adds r2, r1, 0x1 - strb r2, [r4] - lsls r1, 24 - lsrs r1, 22 - adds r3, r1 - str r0, [r3] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end b_mc_stack_push - - thumb_func_start b_mc_stack_push_cursor -b_mc_stack_push_cursor: @ 8133990 - ldr r0, =0x020244a8 - ldr r0, [r0] - ldr r2, [r0, 0x1C] - adds r3, r2, 0 - adds r3, 0x20 - ldrb r0, [r3] - adds r1, r0, 0x1 - strb r1, [r3] - lsls r0, 24 - lsrs r0, 22 - adds r2, r0 - ldr r0, =0x0203ab38 - ldr r0, [r0] - str r0, [r2] - bx lr - .pool - thumb_func_end b_mc_stack_push_cursor - - thumb_func_start b_mc_stack_pop_cursor -b_mc_stack_pop_cursor: @ 81339B8 - push {lr} - ldr r3, =0x020244a8 - ldr r0, [r3] - ldr r0, [r0, 0x1C] - adds r1, r0, 0 - adds r1, 0x20 - ldrb r0, [r1] - cmp r0, 0 - bne _081339D4 - movs r0, 0 - b _081339EE - .pool -_081339D4: - subs r0, 0x1 - strb r0, [r1] - ldr r2, =0x0203ab38 - ldr r0, [r3] - ldr r1, [r0, 0x1C] - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - lsls r0, 2 - adds r1, r0 - ldr r0, [r1] - str r0, [r2] - movs r0, 0x1 -_081339EE: - pop {r1} - bx r1 - .pool - thumb_func_end b_mc_stack_pop_cursor - - thumb_func_start sub_81339F8 -sub_81339F8: @ 81339F8 - push {r4-r6,lr} - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x00002e28 - adds r5, r1, r0 - movs r2, 0 - movs r0, 0x2 - strb r0, [r5] - ldr r0, =0x00002e59 - adds r1, r0 - strb r2, [r1] - movs r4, 0 - ldr r6, =gUnknown_085B09E4 -_08133A12: - movs r0, 0xB - muls r0, r4 - adds r0, 0x5 - adds r0, r5, r0 - lsls r1, r4, 2 - adds r1, r6 - ldr r1, [r1] - bl CopyString - adds r1, r5, 0x1 - adds r1, r4 - ldr r0, =gUnknown_085B09F4 - adds r0, r4, r0 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r5, 0 - adds r0, 0x32 - adds r0, r4 - movs r1, 0x2 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _08133A12 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81339F8 - - thumb_func_start sub_8133A60 -sub_8133A60: @ 8133A60 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002e59 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_8133A60 - - thumb_func_start sub_8133A78 -sub_8133A78: @ 8133A78 - 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 r1, 3 - ldr r0, =0x03005e08 - adds r7, r1, r0 - ldr r0, =0x03005d8c - ldr r4, [r0] - ldr r0, =0x00002e28 - adds r0, r4 - mov r9, r0 - ldr r0, =gUnknown_085B09F8 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0xC] - str r1, [sp, 0x10] - ldr r1, =gUnknown_085EB7EA - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - adds r6, r0, 0 - ldr r1, =gUnknown_085E8D38 - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - mov r8, r0 - movs r5, 0 - ldr r0, =0x00002e29 - adds r4, r0 -_08133AC2: - mov r0, r9 - adds r0, 0x1 - adds r1, r0, r5 - ldrb r0, [r1] - cmp r0, 0x78 - bls _08133AF0 - mov r0, r8 - b _08133B00 - .pool -_08133AF0: - ldrb r1, [r1] - lsls r1, 5 - ldr r0, =gUnknown_085A5C09 - adds r1, r0 - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth -_08133B00: - cmp r0, r6 - ble _08133B06 - adds r6, r0, 0 -_08133B06: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _08133AC2 - adds r0, r6, 0 - bl convert_pixel_width_to_tile_width - lsls r0, 24 - ldr r2, =0x00ffffff - ldr r1, [sp, 0xC] - ands r1, r2 - orrs r1, r0 - str r1, [sp, 0xC] - add r0, sp, 0xC - bl AddWindow - strh r0, [r7, 0x6] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x85 - lsls r2, 2 - movs r1, 0 - movs r3, 0xE - bl SetWindowBorderStyle - movs r5, 0 -_08133B3C: - adds r1, r4, r5 - ldrb r0, [r1] - cmp r0, 0x78 - bls _08133B70 - ldrb r0, [r7, 0x6] - lsls r1, r5, 4 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - ldr r2, =gUnknown_085E8D38 - movs r3, 0x8 - bl Print - b _08133B94 - .pool -_08133B70: - ldrb r0, [r7, 0x6] - ldrb r2, [r1] - lsls r2, 5 - ldr r1, =gUnknown_085A5C09 - adds r2, r1 - lsls r1, r5, 4 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print -_08133B94: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _08133B3C - ldrb r0, [r7, 0x6] - ldr r2, =gUnknown_085EB7EA - lsls r1, r5, 4 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - ldrb r0, [r7, 0x6] - movs r1, 0x5 - movs r2, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8133A78 - - thumb_func_start sub_8133BE4 -sub_8133BE4: @ 8133BE4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r2, r1, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - cmp r2, 0x78 - bls _08133C14 - ldr r1, =0x020375e0 - ldr r2, =0x0000ffff - adds r0, r2, 0 - strh r0, [r1] - b _08133C18 - .pool -_08133C14: - ldr r0, =0x020375e0 - strh r2, [r0] -_08133C18: - ldrb r0, [r4, 0x6] - movs r1, 0 - bl sub_8198070 - ldrb r0, [r4, 0x6] - bl ClearWindowTilemap - ldrb r0, [r4, 0x6] - bl RemoveWindow - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r5, 0 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8133BE4 - - thumb_func_start sub_8133C48 -sub_8133C48: @ 8133C48 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00002e28 - adds r6, r0, r1 - bl ProcessMenuInput - lsls r0, 24 - lsrs r4, r0, 24 - asrs r1, r0, 24 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08133C80 - cmp r1, r0 - bgt _08133C7C - subs r0, 0x1 - cmp r1, r0 - beq _08133CCA - b _08133C90 - .pool -_08133C7C: - cmp r1, 0x4 - bne _08133C90 -_08133C80: - movs r0, 0x5 - bl audio_play - adds r0, r7, 0 - movs r1, 0 - bl sub_8133BE4 - b _08133CCA -_08133C90: - movs r0, 0x5 - bl audio_play - ldr r0, =0x020375e2 - lsls r4, 24 - asrs r4, 24 - strh r4, [r0] - ldr r5, =0x02021cc4 - movs r0, 0xB - adds r1, r4, 0 - muls r1, r0 - adds r1, 0x5 - adds r1, r6, r1 - adds r0, r5, 0 - bl CopyString - adds r0, r6, 0 - adds r0, 0x32 - adds r0, r4 - ldrb r1, [r0] - adds r0, r5, 0 - bl StopMusicWhileStringIsPrinted - adds r0, r6, 0x1 - adds r0, r4 - ldrb r1, [r0] - adds r0, r7, 0 - bl sub_8133BE4 -_08133CCA: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8133C48 - - thumb_func_start sub_8133CD8 -sub_8133CD8: @ 8133CD8 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x020375f0 - ldr r2, =0x00002e59 - adds r0, r2 - ldrb r0, [r0] - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_8133CD8 - - thumb_func_start sub_8133CF4 -sub_8133CF4: @ 8133CF4 - push {r4,r5,lr} - movs r4, 0 - ldr r5, =0x020375f0 -_08133CFA: - adds r0, r4, 0 - bl sub_8161AD0 - lsls r0, 24 - cmp r0, 0 - beq _08133D10 - movs r0, 0 - strh r0, [r5] - b _08133D20 - .pool -_08133D10: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _08133CFA - ldr r1, =0x020375f0 - movs r0, 0x1 - strh r0, [r1] -_08133D20: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8133CF4 - - thumb_func_start sub_8133D2C -sub_8133D2C: @ 8133D2C - push {r4-r6,lr} - ldr r6, =0x020375f0 - movs r0, 0 - strh r0, [r6] - ldr r4, =gUnknown_085A5C08 - ldr r5, =0x020375e0 - ldrh r0, [r5] - lsls r0, 5 - adds r2, r0, r4 - ldr r0, =0x020375e4 - ldrh r0, [r0] - lsls r0, 5 - adds r0, r4 - ldrb r1, [r2, 0x13] - ldrb r0, [r0, 0x13] - cmp r1, r0 - beq _08133D72 - adds r0, r1, 0 - bl sub_81618D0 - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _08133D72 - ldr r0, =0x02021dc4 - ldrh r1, [r5] - lsls r1, 5 - adds r1, r4 - ldrb r1, [r1, 0x13] - bl sub_8127250 - movs r0, 0x1 - strh r0, [r6] -_08133D72: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8133D2C - - thumb_func_start sub_8133D8C -sub_8133D8C: @ 8133D8C - push {lr} - ldr r0, =sub_8127208 - movs r1, 0 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_8133D8C - - thumb_func_start sub_8133DA0 -sub_8133DA0: @ 8133DA0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - bl sub_81279C4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08133DFC - ldr r5, =0x020375e4 - ldr r0, =0x0203a172 - ldrb r1, [r0] - ldr r0, =0x0203a14c - ldr r0, [r0] - adds r0, r1 - ldrb r0, [r0] - strh r0, [r5] - ldr r0, =0x02021ec4 - ldr r1, =0x020375e0 - ldrh r1, [r1] - lsls r1, 5 - ldr r4, =gUnknown_085A5C09 - adds r1, r4 - bl CopyString - ldr r0, =0x02021dc4 - ldrh r1, [r5] - lsls r1, 5 - adds r1, r4 - bl CopyString - b _08133E04 - .pool -_08133DFC: - ldr r1, =0x020375e4 - ldr r2, =0x0000ffff - adds r0, r2, 0 - strh r0, [r1] -_08133E04: - adds r0, r6, 0 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8133DA0 - - thumb_func_start sub_8133E1C -sub_8133E1C: @ 8133E1C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x020375e4 - movs r1, 0 - strh r1, [r2] - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running - pop {r0} - bx r0 - .pool - thumb_func_end sub_8133E1C - - thumb_func_start sub_8133E38 -sub_8133E38: @ 8133E38 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =0x03005d8c - ldr r6, [r0] - ldr r0, =0x00002e28 - adds r5, r6, r0 - ldr r1, =0x020375e4 - mov r8, r1 - ldrb r0, [r1] - bl sub_81619DC - ldr r0, =0x020375e0 - ldrb r0, [r0] - bl IsThereStorageSpaceForDecoration - ldr r4, =0x020375e2 - ldrh r1, [r4] - movs r0, 0xB - muls r0, r1 - adds r0, 0x5 - adds r5, r0 - ldr r0, =0x03005d90 - ldr r1, [r0] - adds r0, r5, 0 - bl CopyString - ldr r2, =0x00002e29 - adds r0, r6, r2 - ldrh r1, [r4] - adds r0, r1 - mov r2, r8 - ldrh r1, [r2] - strb r1, [r0] - ldr r1, =0x00002e5a - adds r0, r6, r1 - ldrh r4, [r4] - adds r0, r4 - movs r1, 0x2 - strb r1, [r0] - ldr r2, =0x00002e59 - adds r6, r2 - movs r0, 0x1 - strb r0, [r6] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8133E38 - - thumb_func_start sub_8133EC0 -sub_8133EC0: @ 8133EC0 - push {lr} - ldr r0, =sub_8133C48 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - bl sub_8133A78 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8133EC0 - - thumb_func_start sub_8133EDC -sub_8133EDC: @ 8133EDC - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x3 - bls _08133EE8 - movs r1, 0 -_08133EE8: - ldr r0, =gUnknown_085B1DF8 - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - pop {r1} - bx r1 - .pool - thumb_func_end sub_8133EDC - - thumb_func_start sub_8133EF8 -sub_8133EF8: @ 8133EF8 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_8133EF8 - - thumb_func_start set_256color_bg_bg0 -set_256color_bg_bg0: @ 8133F0C - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0xC - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0xE - movs r1, 0 - bl SetGpuReg - movs r0, 0xC - movs r1, 0 - bl SetGpuReg - movs r0, 0xA - movs r1, 0 - bl SetGpuReg - movs r0, 0x8 - movs r1, 0 - bl SetGpuReg - 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 - add r1, sp, 0x4 - movs r0, 0 - strh r0, [r1] - ldr r2, =0x040000d4 - str r1, [r2] - movs r1, 0xC0 - lsls r1, 19 - str r1, [r2, 0x4] - ldr r0, =0x8100c000 - str r0, [r2, 0x8] - ldr r0, [r2, 0x8] - movs r0, 0 - mov r9, r0 - str r0, [sp, 0x8] - add r0, sp, 0x8 - str r0, [r2] - movs r0, 0xE0 - lsls r0, 19 - str r0, [r2, 0x4] - ldr r0, =0x85000100 - str r0, [r2, 0x8] - ldr r0, [r2, 0x8] - add r0, sp, 0x4 - mov r3, r9 - strh r3, [r0] - str r0, [r2] - movs r0, 0xA0 - lsls r0, 19 - str r0, [r2, 0x4] - ldr r0, =0x81000200 - str r0, [r2, 0x8] - ldr r0, [r2, 0x8] - ldr r0, =gUnknown_085B0E04 - bl LZ77UnCompVram - ldr r0, =gUnknown_085B0A80 - ldr r1, =0x06003000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085B0C0C - ldr r1, =0x06003800 - bl LZ77UnCompVram - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085B1E00 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r0, =gUnknown_085B1DCC - bl InitWindows - bl DeactivateAllTextPrinters - movs r1, 0xAA - lsls r1, 2 - movs r0, 0 - movs r2, 0xD0 - bl sub_809882C - bl clear_scheduled_bg_copies_to_vram - bl remove_some_task - bl ResetTasks - bl ResetAllObjectData - bl sub_80A1A74 - bl ResetObjectPaletteAllocator - bl dp13_810BB8C - bl sub_8098C64 - movs r1, 0xE0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_085B0A00 - movs r1, 0 - movs r2, 0x40 - bl gpu_pal_apply - ldr r0, =gUnknown_085B1ED8 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085B1EE8 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085B1EF8 - bl LoadTaggedObjectPalettes - movs r0, 0x1 - negs r0, r0 - mov r1, r9 - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - movs r0, 0x1 - bl EnableInterrupts - ldr r0, =sub_8133EF8 - bl SetVBlankCallback - ldr r0, =sub_81341E0 - bl SetMainCallback2 - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x1F - bl SetGpuReg - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0xFE - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0x7 - bl SetGpuReg - movs r1, 0xC1 - lsls r1, 6 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - ldr r0, =sub_81341FC - movs r1, 0 - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r3, 0x1 - mov r10, r3 - mov r1, r10 - strh r1, [r0, 0x8] - ldr r0, =gUnknown_085B1F10 - movs r1, 0x78 - movs r2, 0x38 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x02020630 - mov r8, r3 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r8 - strh r4, [r1, 0x2E] - ldr r6, =gUnknown_085B1F28 - ldr r5, =gUnknown_085B1DEC - ldrb r1, [r5] - ldrb r2, [r5, 0x1] - adds r0, r6, 0 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r8 - strh r4, [r1, 0x2E] - mov r0, r9 - strh r0, [r1, 0x30] - ldrb r1, [r5, 0x2] - ldrb r2, [r5, 0x3] - adds r0, r6, 0 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r8 - strh r4, [r1, 0x2E] - mov r3, r10 - strh r3, [r1, 0x30] - ldrb r1, [r5, 0x4] - ldrb r2, [r5, 0x5] - adds r0, r6, 0 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r8 - strh r4, [r1, 0x2E] - movs r0, 0x2 - strh r0, [r1, 0x30] - ldr r1, =0x030011f8 - movs r0, 0xFF - strh r0, [r1] - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end set_256color_bg_bg0 - - thumb_func_start sub_81341E0 -sub_81341E0: @ 81341E0 - push {lr} - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_81341E0 - - thumb_func_start sub_81341FC -sub_81341FC: @ 81341FC - push {r4,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - ldrb r0, [r4, 0x8] - bl sub_81344C8 - movs r2, 0xAA - lsls r2, 2 - movs r0, 0 - movs r1, 0 - movs r3, 0xD - bl SetWindowBorderStyle - ldr r2, =gUnknown_085E8C53 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =sub_813425C - str r0, [r4] - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81341FC - - thumb_func_start sub_813425C -sub_813425C: @ 813425C - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r6, r0, r2 - ldrh r7, [r6, 0x8] - ldrb r4, [r6, 0x8] - ldr r1, =0x030022c0 - ldrh r3, [r1, 0x2E] - movs r0, 0x1 - ands r0, r3 - cmp r0, 0 - beq _081342F8 - bl sub_8134604 - ldr r0, =gUnknown_085B1F40 - ldr r1, =gUnknown_085B1DEC - lsls r2, r4, 1 - adds r3, r2, r1 - ldrb r5, [r3] - adds r1, 0x1 - adds r2, r1 - ldrb r4, [r2] - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0xC] - ldrh r0, [r6, 0x8] - bl sub_8133EDC - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_8134690 - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r2, r4, 0 - adds r2, 0x10 - adds r2, r1, r2 - ldr r3, =gUnknown_085B1ED0 - str r3, [r2] - adds r4, 0x1C - adds r1, r4 - ldr r2, =sub_8134774 - str r2, [r1] - strh r0, [r6, 0xA] - ldr r0, =sub_8134340 - str r0, [r6] - b _08134334 - .pool -_081342F8: - movs r0, 0x20 - ands r0, r3 - cmp r0, 0 - beq _08134314 - cmp r4, 0 - beq _08134314 - subs r0, r7, 0x1 - strh r0, [r6, 0x8] - ldr r0, =sub_8134640 - str r0, [r6] - b _08134334 - .pool -_08134314: - ldrh r1, [r1, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08134334 - cmp r4, 0x1 - bhi _08134334 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - ldr r1, =sub_8134640 - str r1, [r0] -_08134334: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813425C - - thumb_func_start sub_8134340 -sub_8134340: @ 8134340 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x02020630 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r2, r1, r2 - movs r0, 0xC - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r3 - adds r0, r1, 0 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _0813437E - movs r3, 0x20 - ldrsh r0, [r1, r3] - cmp r0, 0x78 - bne _0813437E - movs r3, 0x22 - ldrsh r0, [r1, r3] - cmp r0, 0x40 - bne _0813437E - ldr r0, =sub_8134390 - str r0, [r2] -_0813437E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8134340 - - thumb_func_start sub_8134390 -sub_8134390: @ 8134390 - push {r4,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - ldrh r0, [r4, 0x8] - bl sub_8133EDC - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - bl cry_related - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_085E8C90 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =gUnknown_085B1DDC - movs r1, 0xAA - lsls r1, 2 - movs r2, 0xD - movs r3, 0 - bl CreateYesNoMenu - ldr r0, =sub_8134400 - str r0, [r4] - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8134390 - - thumb_func_start sub_8134400 -sub_8134400: @ 8134400 - 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 _08134426 - cmp r1, 0 - bgt _08134420 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08134450 - b _0813449A -_08134420: - cmp r1, 0x1 - beq _08134450 - b _0813449A -_08134426: - ldr r2, =0x020375f0 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x8] - strh r0, [r2] - bl dp13_810BB8C - ldr r0, =0x030022c0 - ldr r0, [r0, 0x8] - bl SetMainCallback2 - b _0813449A - .pool -_08134450: - movs r0, 0x5 - bl audio_play - ldr r0, =0x03005e00 - lsls r5, r4, 2 - adds r5, r4 - lsls r5, 3 - adds r5, r0 - ldrb r4, [r5, 0xA] - ldr r6, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - adds r0, r4, 0 - bl sub_818D820 - ldrb r0, [r5, 0xC] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - adds r4, r6 - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - ldr r0, =sub_81344AC - str r0, [r5] -_0813449A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8134400 - - thumb_func_start sub_81344AC -sub_81344AC: @ 81344AC - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =sub_81341FC - str r0, [r1] - bx lr - .pool - thumb_func_end sub_81344AC - - thumb_func_start sub_81344C8 -sub_81344C8: @ 81344C8 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0x34 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r5, 0 - bl sub_8133EDC - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r4, 0 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - add r1, sp, 0xC - bl sub_81DB468 - movs r0, 0xB - adds r1, r4, 0 - muls r1, r0 - mov r9, r1 - ldr r0, =gSpeciesNames - add r9, r0 - ldr r0, =gUnknown_085B1DE4 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x2C] - str r1, [sp, 0x30] - ldr r3, =gUnknown_085B1DF2 - lsls r5, 1 - adds r2, r5, r3 - mov r10, r2 - ldrb r0, [r2] - lsls r0, 8 - ldr r1, =0xffff00ff - ldr r2, [sp, 0x2C] - ands r2, r1 - orrs r2, r0 - str r2, [sp, 0x2C] - adds r3, 0x1 - adds r5, r3 - ldrb r1, [r5] - lsls r1, 16 - ldr r0, =0xff00ffff - ands r0, r2 - orrs r0, r1 - str r0, [sp, 0x2C] - add r0, sp, 0x2C - bl AddWindow - ldr r4, =0x030011f8 - strh r0, [r4] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x7 - add r1, sp, 0xC - movs r2, 0x68 - bl GetStringCenterAlignXOffset - adds r2, r0, 0 - ldrb r0, [r4] - lsls r2, 24 - lsrs r2, 24 - ldr r1, =gUnknown_085B1E0C - mov r8, r1 - str r1, [sp] - movs r6, 0 - str r6, [sp, 0x4] - add r1, sp, 0xC - str r1, [sp, 0x8] - movs r1, 0x7 - movs r3, 0x1 - bl box_print - movs r0, 0x1 - mov r1, r9 - movs r2, 0x68 - bl GetStringCenterAlignXOffset - adds r2, r0, 0 - ldrb r0, [r4] - lsls r2, 24 - lsrs r2, 24 - mov r1, r8 - str r1, [sp] - str r6, [sp, 0x4] - mov r1, r9 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x11 - bl box_print - ldrb r0, [r4] - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - mov r2, r10 - ldrb r1, [r2] - lsls r0, r1, 27 - movs r2, 0xFC - lsls r2, 24 - adds r0, r2 - adds r1, 0xD - lsls r1, 3 - adds r1, 0x4 - lsls r1, 24 - ldrb r4, [r5] - lsls r5, r4, 27 - lsrs r5, 24 - adds r4, 0x4 - lsls r4, 27 - lsrs r4, 24 - lsrs r1, 8 - orrs r1, r0 - lsrs r1, 16 - movs r0, 0x40 - bl SetGpuReg - lsls r5, 8 - orrs r5, r4 - movs r0, 0x44 - adds r1, r5, 0 - bl SetGpuReg - add sp, 0x34 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81344C8 - - thumb_func_start sub_8134604 -sub_8134604: @ 8134604 - push {r4,lr} - ldr r4, =0x030011f8 - ldrb r0, [r4] - movs r1, 0 - bl FillWindowPixelBuffer - ldrb r0, [r4] - bl ClearWindowTilemap - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0xFF - strh r0, [r4] - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8134604 - - thumb_func_start sub_8134640 -sub_8134640: @ 8134640 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8134604 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8134668 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8134640 - - thumb_func_start sub_8134668 -sub_8134668: @ 8134668 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - ldrb r0, [r4, 0x8] - bl sub_81344C8 - ldr r0, =sub_813425C - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8134668 - - thumb_func_start sub_8134690 -sub_8134690: @ 8134690 - push {lr} - sub sp, 0x10 - lsls r0, 16 - lsrs r0, 16 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - str r1, [sp] - str r2, [sp, 0x4] - movs r1, 0xE - str r1, [sp, 0x8] - ldr r1, =0x0000ffff - str r1, [sp, 0xC] - movs r1, 0x8 - movs r2, 0 - movs r3, 0x1 - bl sub_818D3E4 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r1 - ldrb r3, [r2, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r3 - strb r1, [r2, 0x5] - add sp, 0x10 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8134690 - - thumb_func_start sub_81346DC -sub_81346DC: @ 81346DC - push {r4,lr} - adds r4, r0, 0 - ldr r2, =gUnknown_085B1E28 - ldr r3, =0x03005e00 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r3 - movs r1, 0x8 - ldrsh r0, [r0, r1] - lsls r0, 1 - adds r0, r2 - ldrb r0, [r0] - strh r0, [r4, 0x20] - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r3 - movs r1, 0x8 - ldrsh r0, [r0, r1] - lsls r0, 1 - adds r2, 0x1 - adds r0, r2 - ldrb r0, [r0] - strh r0, [r4, 0x22] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x8 - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x4 - strh r0, [r4, 0x30] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81346DC - - thumb_func_start sub_813473C -sub_813473C: @ 813473C - push {lr} - adds r3, r0, 0 - ldr r2, =0x03005e00 - movs r0, 0x2E - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - movs r2, 0x30 - ldrsh r0, [r3, r2] - cmp r1, r0 - bne _08134768 - adds r0, r3, 0 - movs r1, 0x1 - bl StartObjectImageAnimIfDifferent - b _08134770 - .pool -_08134768: - adds r0, r3, 0 - movs r1, 0 - bl StartObjectImageAnimIfDifferent -_08134770: - pop {r0} - bx r0 - thumb_func_end sub_813473C - - thumb_func_start sub_8134774 -sub_8134774: @ 8134774 - push {lr} - adds r1, r0, 0 - ldrh r2, [r1, 0x20] - movs r3, 0x20 - ldrsh r0, [r1, r3] - cmp r0, 0x78 - ble _08134786 - subs r0, r2, 0x4 - strh r0, [r1, 0x20] -_08134786: - ldrh r2, [r1, 0x20] - movs r3, 0x20 - ldrsh r0, [r1, r3] - cmp r0, 0x77 - bgt _08134794 - adds r0, r2, 0x4 - strh r0, [r1, 0x20] -_08134794: - ldrh r2, [r1, 0x22] - movs r3, 0x22 - ldrsh r0, [r1, r3] - cmp r0, 0x40 - ble _081347A2 - subs r0, r2, 0x2 - strh r0, [r1, 0x22] -_081347A2: - ldrh r2, [r1, 0x22] - movs r3, 0x22 - ldrsh r0, [r1, r3] - cmp r0, 0x3F - bgt _081347B0 - adds r0, r2, 0x2 - strh r0, [r1, 0x22] -_081347B0: - pop {r0} - bx r0 - thumb_func_end sub_8134774 - - thumb_func_start sub_81347B4 -sub_81347B4: @ 81347B4 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_81347B4 - - thumb_func_start LoadWallClockGraphics -LoadWallClockGraphics: @ 81347C8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0xE - movs r1, 0 - bl SetGpuReg - movs r0, 0xC - movs r1, 0 - bl SetGpuReg - movs r0, 0xA - movs r1, 0 - bl SetGpuReg - movs r0, 0x8 - movs r1, 0 - bl SetGpuReg - 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 r3, 0xC0 - lsls r3, 19 - movs r4, 0xC0 - lsls r4, 9 - add r0, sp, 0x4 - mov r8, r0 - mov r2, sp - movs r6, 0 - ldr r1, =0x040000d4 - movs r5, 0x80 - lsls r5, 5 - ldr r7, =0x81000800 - movs r0, 0x81 - lsls r0, 24 - mov r12, r0 -_0813486C: - strh r6, [r2] - mov r0, sp - str r0, [r1] - str r3, [r1, 0x4] - str r7, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r3, r5 - subs r4, r5 - cmp r4, r5 - bhi _0813486C - strh r6, [r2] - mov r2, sp - str r2, [r1] - str r3, [r1, 0x4] - lsrs r0, r4, 1 - mov r2, r12 - orrs r0, r2 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r0, 0xE0 - lsls r0, 19 - movs r3, 0x80 - lsls r3, 3 - movs r4, 0 - str r4, [sp, 0x4] - ldr r2, =0x040000d4 - mov r1, r8 - str r1, [r2] - str r0, [r2, 0x4] - lsrs r0, r3, 2 - movs r1, 0x85 - lsls r1, 24 - orrs r0, r1 - str r0, [r2, 0x8] - ldr r0, [r2, 0x8] - movs r1, 0xA0 - lsls r1, 19 - mov r0, sp - strh r4, [r0] - str r0, [r2] - str r1, [r2, 0x4] - lsrs r3, 1 - movs r0, 0x81 - lsls r0, 24 - orrs r3, r0 - str r3, [r2, 0x8] - ldr r0, [r2, 0x8] - ldr r0, =gUnknown_08DCC05C - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0 - bne _081348FC - ldr r0, =gUnknown_08DCC01C - movs r1, 0 - movs r2, 0x20 - bl gpu_pal_apply - b _08134906 - .pool -_081348FC: - ldr r0, =gUnknown_08DCC03C - movs r1, 0 - movs r2, 0x20 - bl gpu_pal_apply -_08134906: - bl sub_8098C64 - movs r1, 0xE0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_085B21D4 - movs r1, 0xC0 - movs r2, 0x8 - bl gpu_pal_apply - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085B21FC - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r0, =gUnknown_085B21DC - bl InitWindows - bl DeactivateAllTextPrinters - movs r1, 0x94 - lsls r1, 2 - movs r0, 0 - movs r2, 0xD0 - bl sub_809882C - bl clear_scheduled_bg_copies_to_vram - bl remove_some_task - bl ResetTasks - bl ResetAllObjectData - bl sub_80A1A74 - bl ResetObjectPaletteAllocator - ldr r0, =gUnknown_085B2208 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085B2218 - bl LoadTaggedObjectPalettes - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end LoadWallClockGraphics - - thumb_func_start sub_813498C -sub_813498C: @ 813498C - push {lr} - sub sp, 0x4 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - movs r0, 0x1 - bl EnableInterrupts - ldr r0, =sub_81347B4 - bl SetVBlankCallback - ldr r0, =sub_8134C9C - bl SetMainCallback2 - 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 r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_813498C - - thumb_func_start Cb2_StartWallClock -Cb2_StartWallClock: @ 81349F4 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0xC - bl LoadWallClockGraphics - ldr r0, =gUnknown_08DCC648 - ldr r1, =0x06003800 - bl LZ77UnCompVram - ldr r0, =sub_8134CB8 - movs r1, 0 - bl CreateTask - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - mov r8, r1 - movs r1, 0xA - strh r1, [r0, 0xC] - mov r2, r8 - strh r2, [r0, 0xE] - strh r2, [r0, 0x10] - strh r2, [r0, 0x12] - strh r2, [r0, 0x14] - strh r2, [r0, 0x8] - movs r1, 0x96 - lsls r1, 1 - strh r1, [r0, 0xA] - ldr r0, =gUnknown_085B2250 - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02020630 - mov r9, r1 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r9 - strh r6, [r1, 0x2E] - ldrb r2, [r1, 0x1] - movs r5, 0x4 - negs r5, r5 - adds r0, r5, 0 - ands r0, r2 - movs r2, 0x1 - mov r10, r2 - mov r2, r10 - orrs r0, r2 - strb r0, [r1, 0x1] - ldrb r2, [r1, 0x3] - movs r4, 0x3F - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - strb r0, [r1, 0x3] - ldr r0, =gUnknown_085B2268 - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r9 - strh r6, [r1, 0x2E] - ldrb r0, [r1, 0x1] - ands r5, r0 - mov r0, r10 - orrs r5, r0 - strb r5, [r1, 0x1] - ldrb r0, [r1, 0x3] - ands r4, r0 - movs r0, 0x2 - orrs r4, r0 - strb r4, [r1, 0x3] - ldr r0, =gUnknown_085B22A0 - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r9 - strh r6, [r1, 0x2E] - movs r0, 0x2D - strh r0, [r1, 0x30] - ldr r0, =gUnknown_085B22B8 - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r9 - strh r6, [r1, 0x2E] - movs r0, 0x5A - strh r0, [r1, 0x30] - bl sub_813498C - ldr r2, =gUnknown_085EFAE0 - movs r0, 0x1 - str r0, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0x1 - bl PutWindowTilemap - 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-r6} - pop {r0} - bx r0 - .pool - thumb_func_end Cb2_StartWallClock - - thumb_func_start Cb2_ViewWallClock -Cb2_ViewWallClock: @ 8134B44 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - bl LoadWallClockGraphics - ldr r0, =gUnknown_08DCC908 - ldr r1, =0x06003800 - bl LZ77UnCompVram - ldr r0, =sub_8134F10 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r7, 0 - bl sub_8135130 - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r1, 0x12 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08134B9C - movs r2, 0x2D - mov r10, r2 - movs r0, 0x5A - str r0, [sp, 0xC] - b _08134BA4 - .pool -_08134B9C: - movs r1, 0x5A - mov r10, r1 - movs r2, 0x87 - str r2, [sp, 0xC] -_08134BA4: - ldr r0, =gUnknown_085B2250 - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r6, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - movs r0, 0 - mov r9, r0 - strh r7, [r1, 0x2E] - ldrb r2, [r1, 0x1] - movs r5, 0x4 - negs r5, r5 - adds r0, r5, 0 - ands r0, r2 - movs r2, 0x1 - mov r8, r2 - mov r2, r8 - orrs r0, r2 - strb r0, [r1, 0x1] - ldrb r2, [r1, 0x3] - movs r4, 0x3F - negs r4, r4 - adds r0, r4, 0 - ands r0, r2 - strb r0, [r1, 0x3] - ldr r0, =gUnknown_085B2268 - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - strh r7, [r1, 0x2E] - ldrb r0, [r1, 0x1] - ands r5, r0 - mov r0, r8 - orrs r5, r0 - strb r5, [r1, 0x1] - ldrb r0, [r1, 0x3] - ands r4, r0 - movs r0, 0x2 - orrs r4, r0 - strb r4, [r1, 0x3] - ldr r0, =gUnknown_085B22A0 - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - strh r7, [r1, 0x2E] - mov r2, r10 - strh r2, [r1, 0x30] - ldr r0, =gUnknown_085B22B8 - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - strh r7, [r1, 0x2E] - mov r0, sp - ldrh r0, [r0, 0xC] - strh r0, [r1, 0x30] - bl sub_813498C - ldr r2, =gUnknown_085EFAE8 - movs r0, 0x1 - str r0, [sp] - mov r1, r9 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - 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 Cb2_ViewWallClock - - thumb_func_start sub_8134C9C -sub_8134C9C: @ 8134C9C - push {lr} - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_8134C9C - - thumb_func_start sub_8134CB8 -sub_8134CB8: @ 8134CB8 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08134CD8 - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8134CE8 - str r0, [r1] -_08134CD8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8134CB8 - - thumb_func_start sub_8134CE8 -sub_8134CE8: @ 8134CE8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - movs r1, 0x6 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - beq _08134D1C - ldrh r0, [r5, 0x8] - ldrb r1, [r5, 0x10] - ldrb r2, [r5, 0x14] - bl sub_8134FFC - strh r0, [r5, 0x8] - b _08134DBE - .pool -_08134D1C: - movs r2, 0xE - ldrsh r1, [r5, r2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - strh r0, [r5, 0x8] - movs r3, 0xC - ldrsh r0, [r5, r3] - movs r1, 0xC - bl __modsi3 - lsls r0, 16 - asrs r0, 16 - lsls r4, r0, 4 - subs r4, r0 - lsls r4, 1 - movs r1, 0xE - ldrsh r0, [r5, r1] - movs r1, 0xA - bl __divsi3 - lsls r0, 16 - asrs r0, 16 - lsls r1, r0, 2 - adds r1, r0 - adds r4, r1 - strh r4, [r5, 0xA] - ldr r2, =0x030022c0 - ldrh r0, [r2, 0x2E] - movs r3, 0x1 - adds r1, r3, 0 - ands r1, r0 - cmp r1, 0 - beq _08134D70 - ldr r0, =sub_8134DC4 - str r0, [r5] - b _08134DBE - .pool -_08134D70: - strh r1, [r5, 0x10] - ldrh r1, [r2, 0x2C] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08134D7E - strh r3, [r5, 0x10] -_08134D7E: - ldrh r1, [r2, 0x2C] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08134D8C - movs r0, 0x2 - strh r0, [r5, 0x10] -_08134D8C: - ldrh r1, [r5, 0x10] - movs r2, 0x10 - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _08134DBC - ldrh r2, [r5, 0x14] - movs r3, 0x14 - ldrsh r0, [r5, r3] - cmp r0, 0xFE - bgt _08134DA4 - adds r0, r2, 0x1 - strh r0, [r5, 0x14] -_08134DA4: - ldrh r0, [r5, 0x8] - lsls r1, 24 - lsrs r1, 24 - ldrb r2, [r5, 0x14] - bl sub_8134FFC - strh r0, [r5, 0x8] - ldrb r1, [r5, 0x10] - adds r0, r6, 0 - bl sub_813504C - b _08134DBE -_08134DBC: - strh r0, [r5, 0x14] -_08134DBE: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8134CE8 - - thumb_func_start sub_8134DC4 -sub_8134DC4: @ 8134DC4 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r5, 0x94 - lsls r5, 2 - movs r0, 0 - movs r1, 0 - adds r2, r5, 0 - movs r3, 0xD - bl SetWindowBorderStyle - ldr r2, =gUnknown_085EFAC6 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =gUnknown_085B21F4 - adds r1, r5, 0 - movs r2, 0xD - movs r3, 0x1 - bl CreateYesNoMenu - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =c3_80BF560 - str r1, [r0] - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8134DC4 - - thumb_func_start c3_80BF560 -c3_80BF560: @ 8134E30 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _08134E56 - cmp r1, 0 - bgt _08134E50 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08134E74 - b _08134E96 -_08134E50: - cmp r1, 0x1 - beq _08134E74 - b _08134E96 -_08134E56: - movs r0, 0x5 - bl audio_play - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8134EA4 - b _08134E94 - .pool -_08134E74: - movs r0, 0x5 - bl audio_play - movs r0, 0 - movs r1, 0 - bl sub_8198070 - movs r0, 0 - bl ClearWindowTilemap - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8134CE8 -_08134E94: - str r0, [r1] -_08134E96: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end c3_80BF560 - - thumb_func_start sub_8134EA4 -sub_8134EA4: @ 8134EA4 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - movs r1, 0xC - ldrsh r0, [r4, r1] - movs r2, 0xE - ldrsh r1, [r4, r2] - bl GameFreakRTC_CalcRTCToLocalDelta_DayZero - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =c2_080111BC - str r0, [r4] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8134EA4 - - thumb_func_start c2_080111BC -c2_080111BC: @ 8134EE8 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08134F02 - bl FreeAllWindowBuffers - ldr r0, =0x030022c0 - ldr r0, [r0, 0x8] - bl SetMainCallback2 -_08134F02: - pop {r0} - bx r0 - .pool - thumb_func_end c2_080111BC - - thumb_func_start sub_8134F10 -sub_8134F10: @ 8134F10 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08134F30 - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8134F40 - str r0, [r1] -_08134F30: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8134F10 - - thumb_func_start sub_8134F40 -sub_8134F40: @ 8134F40 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_8135130 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08134F66 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8134F78 - str r0, [r1] -_08134F66: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8134F40 - - thumb_func_start sub_8134F78 -sub_8134F78: @ 8134F78 - 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 pal_fade_maybe - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8134FB0 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8134F78 - - thumb_func_start sub_8134FB0 -sub_8134FB0: @ 8134FB0 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08134FC6 - ldr r0, =0x030022c0 - ldr r0, [r0, 0x8] - bl SetMainCallback2 -_08134FC6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8134FB0 - - thumb_func_start sub_8134FD4 -sub_8134FD4: @ 8134FD4 - push {lr} - lsls r0, 16 - lsrs r0, 16 - adds r1, r0, 0 - cmp r0, 0x3C - bls _08134FE4 - movs r0, 0x6 - b _08134FF6 -_08134FE4: - cmp r0, 0x1E - bls _08134FEC - movs r0, 0x3 - b _08134FF6 -_08134FEC: - cmp r1, 0xA - bhi _08134FF4 - movs r0, 0x1 - b _08134FF6 -_08134FF4: - movs r0, 0x2 -_08134FF6: - pop {r1} - bx r1 - thumb_func_end sub_8134FD4 - - thumb_func_start sub_8134FFC -sub_8134FFC: @ 8134FFC - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r2, 24 - adds r0, r2, 0 - bl sub_8134FD4 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r5, 0x1 - beq _0813501E - cmp r5, 0x2 - beq _08135030 - b _08135044 -_0813501E: - cmp r4, 0 - beq _08135026 - subs r0, r4, r1 - b _0813503C -_08135026: - movs r2, 0xB4 - lsls r2, 1 - adds r0, r2, 0 - subs r0, r1 - b _0813503C -_08135030: - movs r0, 0xB4 - lsls r0, 1 - subs r0, r1 - cmp r4, r0 - bge _08135042 - adds r0, r4, r1 -_0813503C: - lsls r0, 16 - lsrs r4, r0, 16 - b _08135044 -_08135042: - movs r4, 0 -_08135044: - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8134FFC - - thumb_func_start sub_813504C -sub_813504C: @ 813504C - push {r4-r6,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - cmp r4, 0x1 - beq _08135060 - cmp r4, 0x2 - beq _081350A0 - b _081350DE -_08135060: - ldr r0, =0x03005e00 - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 3 - adds r1, r0 - ldrh r2, [r1, 0xE] - movs r5, 0xE - ldrsh r0, [r1, r5] - cmp r0, 0 - ble _08135080 - subs r0, r2, 0x1 - strh r0, [r1, 0xE] - b _081350DE - .pool -_08135080: - movs r0, 0x3B - strh r0, [r1, 0xE] - ldrh r2, [r1, 0xC] - movs r6, 0xC - ldrsh r0, [r1, r6] - cmp r0, 0 - ble _08135092 - subs r0, r2, 0x1 - b _08135094 -_08135092: - movs r0, 0x17 -_08135094: - strh r0, [r1, 0xC] - adds r0, r3, 0 - adds r1, r4, 0 - bl sub_81350E8 - b _081350DE -_081350A0: - ldr r0, =0x03005e00 - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 3 - adds r1, r0 - ldrh r2, [r1, 0xE] - movs r5, 0xE - ldrsh r0, [r1, r5] - cmp r0, 0x3A - bgt _081350C0 - adds r0, r2, 0x1 - strh r0, [r1, 0xE] - b _081350DE - .pool -_081350C0: - movs r5, 0 - strh r5, [r1, 0xE] - ldrh r2, [r1, 0xC] - movs r6, 0xC - ldrsh r0, [r1, r6] - cmp r0, 0x16 - bgt _081350D4 - adds r0, r2, 0x1 - strh r0, [r1, 0xC] - b _081350D6 -_081350D4: - strh r5, [r1, 0xC] -_081350D6: - adds r0, r3, 0 - adds r1, r4, 0 - bl sub_81350E8 -_081350DE: - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_813504C - - thumb_func_start sub_81350E8 -sub_81350E8: @ 81350E8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r3, r1, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrb r0, [r1, 0xC] - cmp r3, 0x1 - beq _0813510C - cmp r3, 0x2 - beq _0813511E - b _0813512A - .pool -_0813510C: - cmp r0, 0xB - beq _08135116 - cmp r0, 0x17 - beq _0813511A - b _0813512A -_08135116: - movs r0, 0 - b _08135128 -_0813511A: - strh r3, [r1, 0x12] - b _0813512A -_0813511E: - cmp r0, 0 - beq _08135128 - cmp r0, 0xC - bne _0813512A - movs r0, 0x1 -_08135128: - strh r0, [r1, 0x12] -_0813512A: - pop {r0} - bx r0 - thumb_func_end sub_81350E8 - - thumb_func_start sub_8135130 -sub_8135130: @ 8135130 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl GameFreakRTC_CalcLocalDateTime - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r6, r0, r1 - ldr r5, =0x03005cf8 - movs r0, 0x2 - ldrsb r0, [r5, r0] - strh r0, [r6, 0xC] - movs r0, 0x3 - ldrsb r0, [r5, r0] - strh r0, [r6, 0xE] - movs r0, 0xE - ldrsh r1, [r6, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - strh r0, [r6, 0x8] - movs r1, 0xC - ldrsh r0, [r6, r1] - movs r1, 0xC - bl __modsi3 - lsls r0, 16 - asrs r0, 16 - lsls r4, r0, 4 - subs r4, r0 - lsls r4, 1 - movs r1, 0xE - ldrsh r0, [r6, r1] - movs r1, 0xA - bl __divsi3 - lsls r0, 16 - asrs r0, 16 - lsls r1, r0, 2 - adds r1, r0 - adds r4, r1 - strh r4, [r6, 0xA] - movs r0, 0x2 - ldrsb r0, [r5, r0] - cmp r0, 0xB - bgt _081351A0 - movs r0, 0 - b _081351A2 - .pool -_081351A0: - movs r0, 0x1 -_081351A2: - strh r0, [r6, 0x12] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8135130 - - thumb_func_start sub_81351AC -sub_81351AC: @ 81351AC - push {r4-r7,lr} - sub sp, 0x4 - adds r6, r0, 0 - ldr r2, =0x03005e00 - movs r0, 0x2E - ldrsh r1, [r6, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r4, [r0, 0x8] - adds r7, r4, 0 - adds r0, r4, 0 - bl sine2 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _081351D4 - adds r0, 0xF -_081351D4: - lsls r0, 12 - lsrs r5, r0, 16 - adds r0, r4, 0 - bl cosine2 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _081351E8 - adds r0, 0xF -_081351E8: - lsls r1, r0, 12 - lsrs r1, 16 - lsls r3, r5, 16 - lsrs r2, r3, 16 - negs r3, r3 - lsrs r3, 16 - str r1, [sp] - movs r0, 0 - bl SetSpriteTransformationMatrix - ldr r1, =gUnknown_085B22D0 - lsls r2, r7, 1 - adds r0, r2, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 16 - lsrs r3, r0, 16 - adds r1, 0x1 - adds r2, r1 - movs r0, 0 - ldrsb r0, [r2, r0] - lsls r0, 16 - lsrs r2, r0, 16 - cmp r3, 0x80 - bls _08135224 - movs r1, 0xFF - lsls r1, 8 - adds r0, r1, 0 - orrs r3, r0 -_08135224: - cmp r2, 0x80 - bls _08135230 - movs r1, 0xFF - lsls r1, 8 - adds r0, r1, 0 - orrs r2, r0 -_08135230: - strh r3, [r6, 0x24] - strh r2, [r6, 0x26] - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81351AC - - thumb_func_start sub_8135244 -sub_8135244: @ 8135244 - push {r4-r7,lr} - sub sp, 0x4 - adds r6, r0, 0 - ldr r2, =0x03005e00 - movs r0, 0x2E - ldrsh r1, [r6, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r4, [r0, 0xA] - adds r7, r4, 0 - adds r0, r4, 0 - bl sine2 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0813526C - adds r0, 0xF -_0813526C: - lsls r0, 12 - lsrs r5, r0, 16 - adds r0, r4, 0 - bl cosine2 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08135280 - adds r0, 0xF -_08135280: - lsls r1, r0, 12 - lsrs r1, 16 - lsls r3, r5, 16 - lsrs r2, r3, 16 - negs r3, r3 - lsrs r3, 16 - str r1, [sp] - movs r0, 0x1 - bl SetSpriteTransformationMatrix - ldr r1, =gUnknown_085B22D0 - lsls r2, r7, 1 - adds r0, r2, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 16 - lsrs r3, r0, 16 - adds r1, 0x1 - adds r2, r1 - movs r0, 0 - ldrsb r0, [r2, r0] - lsls r0, 16 - lsrs r2, r0, 16 - cmp r3, 0x80 - bls _081352BC - movs r1, 0xFF - lsls r1, 8 - adds r0, r1, 0 - orrs r3, r0 -_081352BC: - cmp r2, 0x80 - bls _081352C8 - movs r1, 0xFF - lsls r1, 8 - adds r0, r1, 0 - orrs r2, r0 -_081352C8: - strh r3, [r6, 0x24] - strh r2, [r6, 0x26] - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8135244 - - thumb_func_start sub_81352DC -sub_81352DC: @ 81352DC - push {r4,lr} - adds r4, r0, 0 - ldr r2, =0x03005e00 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x12 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _0813531C - ldrh r1, [r4, 0x30] - adds r0, r1, 0 - subs r0, 0x3C - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1D - bhi _08135308 - adds r0, r1, 0x5 - strh r0, [r4, 0x30] -_08135308: - ldrh r1, [r4, 0x30] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0x3B - bgt _0813533C - adds r0, r1, 0x1 - b _0813533A - .pool -_0813531C: - ldrh r1, [r4, 0x30] - adds r0, r1, 0 - subs r0, 0x2E - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1D - bhi _0813532E - subs r0, r1, 0x5 - strh r0, [r4, 0x30] -_0813532E: - ldrh r1, [r4, 0x30] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0x4B - ble _0813533C - subs r0, r1, 0x1 -_0813533A: - strh r0, [r4, 0x30] -_0813533C: - ldrh r0, [r4, 0x30] - bl cosine2 - lsls r0, 16 - asrs r0, 16 - lsls r1, r0, 4 - subs r1, r0 - lsls r0, r1, 1 - cmp r0, 0 - bge _08135354 - ldr r1, =0x00000fff - adds r0, r1 -_08135354: - asrs r0, 12 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x30] - bl sine2 - lsls r0, 16 - asrs r0, 16 - lsls r1, r0, 4 - subs r1, r0 - lsls r0, r1, 1 - cmp r0, 0 - bge _08135370 - ldr r2, =0x00000fff - adds r0, r2 -_08135370: - asrs r0, 12 - strh r0, [r4, 0x26] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81352DC - - thumb_func_start sub_8135380 -sub_8135380: @ 8135380 - push {r4,lr} - adds r4, r0, 0 - ldr r2, =0x03005e00 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x12 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _081353C0 - ldrh r1, [r4, 0x30] - adds r0, r1, 0 - subs r0, 0x69 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1D - bhi _081353AC - adds r0, r1, 0x5 - strh r0, [r4, 0x30] -_081353AC: - ldrh r1, [r4, 0x30] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0x68 - bgt _081353E0 - adds r0, r1, 0x1 - b _081353DE - .pool -_081353C0: - ldrh r1, [r4, 0x30] - adds r0, r1, 0 - subs r0, 0x5B - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1D - bhi _081353D2 - subs r0, r1, 0x5 - strh r0, [r4, 0x30] -_081353D2: - ldrh r1, [r4, 0x30] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0x78 - ble _081353E0 - subs r0, r1, 0x1 -_081353DE: - strh r0, [r4, 0x30] -_081353E0: - ldrh r0, [r4, 0x30] - bl cosine2 - lsls r0, 16 - asrs r0, 16 - lsls r1, r0, 4 - subs r1, r0 - lsls r0, r1, 1 - cmp r0, 0 - bge _081353F8 - ldr r1, =0x00000fff - adds r0, r1 -_081353F8: - asrs r0, 12 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x30] - bl sine2 - lsls r0, 16 - asrs r0, 16 - lsls r1, r0, 4 - subs r1, r0 - lsls r0, r1, 1 - cmp r0, 0 - bge _08135414 - ldr r2, =0x00000fff - adds r0, r2 -_08135414: - asrs r0, 12 - strh r0, [r4, 0x26] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8135380 - - thumb_func_start npc_before_player_of_type -npc_before_player_of_type: @ 8135424 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r4, =0x0203ab40 - adds r1, r4, 0x2 - adds r0, r4, 0 - bl GetXYCoordsOneStepInFrontOfPlayer - bl PlayerGetZCoord - strb r0, [r4, 0x4] - ldrh r0, [r4] - ldrh r1, [r4, 0x2] - ldrb r2, [r4, 0x4] - bl GetFieldObjectIdByXYZ - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02037350 - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r2, r1, r2 - ldrb r0, [r2, 0x5] - cmp r0, r5 - bne _08135470 - ldr r1, =0x020375f2 - ldrb r0, [r2, 0x8] - strh r0, [r1] - movs r0, 0x1 - b _08135472 - .pool -_08135470: - movs r0, 0 -_08135472: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end npc_before_player_of_type - - thumb_func_start oei_task_add -oei_task_add: @ 8135478 - push {lr} - ldr r0, =0x0203ab40 - adds r1, r0, 0x2 - bl GetXYCoordsOneStepInFrontOfPlayer - ldr r0, =task08_080C9820 - movs r1, 0x8 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end oei_task_add - - thumb_func_start task08_080C9820 -task08_080C9820: @ 813549C - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - bl script_env_2_enable - ldr r1, =0x02037590 - movs r0, 0x1 - strb r0, [r1, 0x6] - ldrb r1, [r1, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - adds r0, r4, 0 - bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive - lsls r0, 24 - cmp r0, 0 - beq _081354D2 - adds r0, r4, 0 - bl FieldObjectClearAnimIfSpecialAnimFinished - lsls r0, 24 - cmp r0, 0 - beq _0813551E -_081354D2: - ldr r0, =0x02037318 - ldrb r0, [r0, 0x17] - cmp r0, 0x5 - bne _08135504 - movs r0, 0x3B - bl FieldEffectStart - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8135578 - b _0813551C - .pool -_08135504: - bl sub_808C114 - adds r0, r4, 0 - movs r1, 0x39 - bl FieldObjectSetSpecialAnim - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_813552C -_0813551C: - str r0, [r1] -_0813551E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task08_080C9820 - - thumb_func_start sub_813552C -sub_813552C: @ 813552C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r0, r1 - bl FieldObjectCheckIfSpecialAnimFinishedOrInactive - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08135560 - movs r0, 0x3B - bl FieldEffectStart - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8135578 - str r0, [r1] -_08135560: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813552C - - thumb_func_start sub_8135578 -sub_8135578: @ 8135578 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0x6 - bl FieldEffectActiveListContains - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _081355FC - bl player_get_direction_lower_nybble - ldr r6, =0x02038c08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r6, 0x4] - cmp r0, 0x1 - bne _0813559E - str r4, [r6, 0x8] -_0813559E: - ldr r1, [r6, 0x4] - cmp r1, 0x2 - bne _081355A8 - movs r0, 0x1 - str r0, [r6, 0x8] -_081355A8: - cmp r1, 0x3 - bne _081355B0 - movs r0, 0x2 - str r0, [r6, 0x8] -_081355B0: - cmp r1, 0x4 - bne _081355B8 - movs r0, 0x3 - str r0, [r6, 0x8] -_081355B8: - ldr r5, =0x02037590 - ldrb r0, [r5, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - bl GetPlayerAvatarGraphicsIdByCurrentState - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldObjectSetGraphicsId - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - ldrb r1, [r6, 0x8] - bl StartObjectImageAnim - movs r0, 0x6 - bl FieldEffectActiveListRemove - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_813561C - str r1, [r0] -_081355FC: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8135578 - - thumb_func_start sub_813561C -sub_813561C: @ 813561C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x18] - lsls r1, 16 - ldrh r0, [r0, 0x1A] - orrs r1, r0 - bl _call_via_r1 - ldr r1, =0x02037590 - movs r0, 0 - strb r0, [r1, 0x6] - adds r0, r4, 0 - bl DestroyTask - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813561C - - thumb_func_start sub_8135654 -sub_8135654: @ 8135654 - push {r4,lr} - bl sub_81797DC - lsls r0, 24 - cmp r0, 0 - beq _0813568C - ldr r4, =0x020375f0 - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - ldr r1, =0x03005db0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =0x0203ceec - ldr r0, =sub_8179834 - b _081356A8 - .pool -_0813568C: - movs r0, 0x56 - bl npc_before_player_of_type - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0813569E - movs r0, 0 - b _081356AC -_0813569E: - ldr r1, =0x03005db0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =0x0203ceec - ldr r0, =sub_81356C4 -_081356A8: - str r0, [r1] - movs r0, 0x1 -_081356AC: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8135654 - - thumb_func_start sub_81356C4 -sub_81356C4: @ 81356C4 - push {lr} - bl brm_get_pokemon_selection - ldr r1, =0x02038c08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - ldr r0, =gUnknown_082907F0 - bl script_env_1_execute_new_script - pop {r0} - bx r0 - .pool - thumb_func_end sub_81356C4 - - thumb_func_start oei_rocksmash -oei_rocksmash: @ 81356E4 - push {lr} - bl oei_task_add - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =sub_8135714 - lsrs r0, r2, 16 - strh r0, [r1, 0x18] - strh r2, [r1, 0x1A] - movs r0, 0x13 - bl sav12_xor_increment - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end oei_rocksmash - - thumb_func_start sub_8135714 -sub_8135714: @ 8135714 - push {lr} - movs r0, 0x83 - bl audio_play - movs r0, 0x25 - bl FieldEffectActiveListRemove - bl script_env_2_enable_and_set_ctx_running - pop {r0} - bx r0 - thumb_func_end sub_8135714 - - thumb_func_start sub_813572C -sub_813572C: @ 813572C - push {lr} - bl sub_80FE314 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0813573E - movs r0, 0 - b _0813574C -_0813573E: - ldr r1, =0x03005db0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =0x0203ceec - ldr r0, =hm2_dig - str r0, [r1] - movs r0, 0x1 -_0813574C: - pop {r1} - bx r1 - .pool - thumb_func_end sub_813572C - - thumb_func_start hm2_dig -hm2_dig: @ 8135760 - push {lr} - bl flagmods_08054D70 - movs r0, 0x26 - bl FieldEffectStart - bl brm_get_pokemon_selection - ldr r1, =0x02038c08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end hm2_dig - - thumb_func_start sub_8135780 -sub_8135780: @ 8135780 - push {lr} - bl oei_task_add - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =sub_81357BC - lsrs r0, r2, 16 - strh r0, [r1, 0x18] - strh r2, [r1, 0x1A] - bl sub_81795E8 - lsls r0, 24 - cmp r0, 0 - bne _081357AC - movs r0, 0x1 - bl SetPlayerAvatarTransitionFlags -_081357AC: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8135780 - - thumb_func_start sub_81357BC -sub_81357BC: @ 81357BC - push {r4,lr} - movs r0, 0x26 - bl FieldEffectActiveListRemove - bl sub_81795E8 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _081357D6 - bl sub_817963C - b _081357EE -_081357D6: - ldr r0, =task08_080A1C44 - movs r1, 0x8 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] -_081357EE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81357BC - - thumb_func_start sub_81357FC -sub_81357FC: @ 81357FC - push {r4-r6,lr} - adds r4, r0, 0 - adds r6, r1, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =0x0203ab50 - ldr r0, =0x00000e88 - bl Alloc - str r0, [r5] - ldr r2, =0x00000809 - adds r0, r2 - movs r3, 0 - strb r4, [r0] - ldr r0, [r5] - movs r4, 0x80 - lsls r4, 4 - adds r1, r0, r4 - str r3, [r1] - ldr r1, =0x00000e7c - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r5] - ldr r4, =0x00000e7d - adds r0, r4 - strb r3, [r0] - ldr r0, =0x0203ab48 - str r6, [r0] - ldr r5, [r5] - adds r2, r5, r2 - ldrb r2, [r2] - cmp r2, 0x2 - beq _08135888 - cmp r2, 0x2 - bgt _08135864 - cmp r2, 0x1 - beq _0813586A - b _081358C0 - .pool -_08135864: - cmp r2, 0x3 - beq _081358A4 - b _081358C0 -_0813586A: - ldr r0, =0x00000804 - adds r1, r5, r0 - ldr r0, =gUnknown_085B269B - str r0, [r1] - ldr r4, =0x00000808 - adds r1, r5, r4 - movs r0, 0x2 - b _081358D2 - .pool -_08135888: - ldr r1, =0x00000804 - adds r0, r5, r1 - ldr r1, =gUnknown_085B269D - str r1, [r0] - ldr r4, =0x00000808 - adds r0, r5, r4 - strb r2, [r0] - b _081358D4 - .pool -_081358A4: - ldr r0, =0x00000804 - adds r1, r5, r0 - ldr r0, =gUnknown_085B269F - str r0, [r1] - ldr r4, =0x00000808 - adds r1, r5, r4 - movs r0, 0x2 - b _081358D2 - .pool -_081358C0: - ldr r0, =0x0203ab50 - ldr r1, [r0] - ldr r0, =0x00000804 - adds r2, r1, r0 - ldr r0, =gUnknown_085B2698 - str r0, [r2] - ldr r4, =0x00000808 - adds r1, r4 - movs r0, 0x3 -_081358D2: - strb r0, [r1] -_081358D4: - ldr r0, =sub_813594C - bl SetMainCallback2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81357FC - - thumb_func_start sub_81358F4 -sub_81358F4: @ 81358F4 - push {lr} - ldr r1, =sub_8059D50 - movs r0, 0x1 - bl sub_81357FC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81358F4 - - thumb_func_start sub_8135908 -sub_8135908: @ 8135908 - push {lr} - ldr r1, =c2_exit_to_overworld_2_switch - movs r0, 0x2 - bl sub_81357FC - pop {r0} - bx r0 - .pool - thumb_func_end sub_8135908 - - thumb_func_start sub_813591C -sub_813591C: @ 813591C - push {lr} - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_813591C - - thumb_func_start sub_8135938 -sub_8135938: @ 8135938 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_8135938 - - thumb_func_start sub_813594C -sub_813594C: @ 813594C - push {lr} -_0813594E: - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08135972 - bl sub_8135978 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08135972 - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0813594E -_08135972: - pop {r0} - bx r0 - thumb_func_end sub_813594C - - thumb_func_start sub_8135978 -sub_8135978: @ 8135978 - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x12 - bls _0813598C - b _08135BB8 -_0813598C: - lsls r0, 2 - ldr r1, =_081359A0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081359A0: - .4byte _081359EC - .4byte _081359F6 - .4byte _08135A08 - .4byte _08135A0E - .4byte _08135A30 - .4byte _08135A36 - .4byte _08135A54 - .4byte _08135A70 - .4byte _08135A8C - .4byte _08135A9A - .4byte _08135AC4 - .4byte _08135ADC - .4byte _08135AFC - .4byte _08135B02 - .4byte _08135B14 - .4byte _08135B1A - .4byte _08135B64 - .4byte _08135B6A - .4byte _08135B84 -_081359EC: - bl SetVBlankHBlankCallbacksToNull - bl clear_scheduled_bg_copies_to_vram - b _08135B9E -_081359F6: - bl remove_some_task - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _08135BA6 - .pool -_08135A08: - bl ResetObjectPaletteAllocator - b _08135B9E -_08135A0E: - bl sub_80A1A74 - ldr r2, =0x02037fd4 - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _08135BA6 - .pool -_08135A30: - bl ResetAllObjectData - b _08135B9E -_08135A36: - ldr r0, =0x0203ab50 - ldr r0, [r0] - ldr r1, =0x00000809 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08135A46 - b _08135B9E -_08135A46: - bl ResetTasks - b _08135B9E - .pool -_08135A54: - bl sub_8135BDC - ldr r0, =0x0203ab50 - ldr r0, [r0] - ldr r1, =0x00000e7e - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _08135B9E - .pool -_08135A70: - bl sub_8135C38 - lsls r0, 24 - cmp r0, 0 - bne _08135A7C - b _08135BD0 -_08135A7C: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _08135BA6 - .pool -_08135A8C: - bl sub_813625C - bl sub_81362E0 - bl sub_8136344 - b _08135B9E -_08135A9A: - movs r0, 0x38 - movs r1, 0x40 - movs r2, 0 - bl sub_8136444 - ldr r1, =0x0203ab50 - ldr r1, [r1] - ldr r2, =0x00000e74 - adds r1, r2 - strb r0, [r1] - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _08135BA6 - .pool -_08135AC4: - ldr r0, =0x0203ab50 - ldr r0, [r0] - ldr r1, =0x00000e75 - adds r0, r1 - movs r1, 0x7 - bl sub_8122344 - b _08135B9E - .pool -_08135ADC: - ldr r0, =0x0203ab48 - ldrh r0, [r0, 0x4] - ldr r1, =0x00001005 - bl sub_8136110 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _08135BA6 - .pool -_08135AFC: - bl sub_8135D24 - b _08135B9E -_08135B02: - bl sub_8135E2C - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _08135BA6 - .pool -_08135B14: - bl sub_81363BC - b _08135B9E -_08135B1A: - ldr r0, =sub_81365C8 - movs r1, 0 - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x03006310 - ldr r2, =0x0203ab48 - ldrh r1, [r2, 0x6] - ldrh r2, [r2, 0x4] - bl ListMenuInit - ldr r2, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r2 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x8] - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _08135BA6 - .pool -_08135B64: - bl sub_8135DAC - b _08135B9E -_08135B6A: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _08135BA6 - .pool -_08135B84: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] -_08135B9E: - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_08135BA6: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08135BD0 - .pool -_08135BB8: - ldr r0, =sub_8135938 - bl SetVBlankCallback - ldr r0, =sub_813591C - bl SetMainCallback2 - movs r0, 0x1 - b _08135BD2 - .pool -_08135BD0: - movs r0, 0 -_08135BD2: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8135978 - - thumb_func_start sub_8135BDC -sub_8135BDC: @ 8135BDC - push {lr} - bl sub_8121DA0 - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085B2620 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r0, =0x0203ab50 - ldr r1, [r0] - 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 {r0} - bx r0 - .pool - thumb_func_end sub_8135BDC - - thumb_func_start sub_8135C38 -sub_8135C38: @ 8135C38 - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x0203ab50 - ldr r0, [r0] - ldr r1, =0x00000e7e - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x5 - bhi _08135D18 - lsls r0, 2 - ldr r1, =_08135C64 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08135C64: - .4byte _08135C7C - .4byte _08135C98 - .4byte _08135CBC - .4byte _08135CCC - .4byte _08135CD8 - .4byte _08135CFC -_08135C7C: - bl reset_temp_tile_data_buffers - ldr r1, =gUnknown_08D9B2B4 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _08135CDE - .pool -_08135C98: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08135D18 - ldr r0, =gUnknown_08D9B7C8 - ldr r4, =0x0203ab50 - ldr r1, [r4] - bl LZDecompressWram - ldr r1, [r4] - b _08135CE2 - .pool -_08135CBC: - ldr r0, =gUnknown_08D9B470 - movs r1, 0 - movs r2, 0xC0 - bl decompress_palette - b _08135CDE - .pool -_08135CCC: - ldr r0, =gUnknown_085B26F4 - bl LoadCompressedObjectPic - b _08135CDE - .pool -_08135CD8: - ldr r0, =gUnknown_085B26FC - bl LoadCompressedObjectPalette -_08135CDE: - ldr r0, =0x0203ab50 - ldr r1, [r0] -_08135CE2: - ldr r0, =0x00000e7e - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _08135D18 - .pool -_08135CFC: - bl sub_8122328 - ldr r0, =0x0203ab50 - ldr r0, [r0] - ldr r1, =0x00000e7e - adds r0, r1 - movs r1, 0 - strh r1, [r0] - movs r0, 0x1 - b _08135D1A - .pool -_08135D18: - movs r0, 0 -_08135D1A: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8135C38 - - thumb_func_start sub_8135D24 -sub_8135D24: @ 8135D24 - push {r4,lr} - ldr r0, =gUnknown_085B2748 - 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 - ldr r0, =gUnknown_0860F074 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - movs r4, 0 -_08135D50: - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xA - bls _08135D50 - 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 sub_8135D24 - - thumb_func_start sub_8135D7C -sub_8135D7C: @ 8135D7C - push {r4,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - movs r4, 0 - str r4, [sp] - str r4, [sp, 0x4] - ldr r3, =gUnknown_085B271C - str r3, [sp, 0x8] - str r4, [sp, 0xC] - str r1, [sp, 0x10] - movs r1, 0x1 - movs r3, 0x1 - bl AddTextPrinterParametrized2 - add sp, 0x14 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8135D7C - - thumb_func_start sub_8135DAC -sub_8135DAC: @ 8135DAC - push {r4,lr} - ldr r0, =0x00000111 - bl itemid_get_item - adds r4, r0, 0 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x48 - bl GetStringCenterAlignXOffset - adds r2, r0, 0 - movs r0, 0 - adds r1, r4, 0 - bl sub_8135D7C - ldr r1, =gUnknown_085E931D - movs r0, 0x2 - movs r2, 0 - bl sub_8135D7C - ldr r1, =gUnknown_085E9323 - movs r0, 0x3 - movs r2, 0 - bl sub_8135D7C - ldr r1, =gUnknown_085E9327 - movs r0, 0x4 - movs r2, 0 - bl sub_8135D7C - ldr r1, =gUnknown_085E932D - movs r0, 0x5 - movs r2, 0 - bl sub_8135D7C - ldr r1, =gUnknown_085E9334 - movs r0, 0x6 - movs r2, 0 - bl sub_8135D7C - movs r4, 0 -_08135DFE: - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _08135DFE - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8135DAC - - thumb_func_start sub_8135E2C -sub_8135E2C: @ 8135E2C - push {r4-r7,lr} - movs r6, 0 - ldr r1, =0x0203ab50 - ldr r0, [r1] - ldr r2, =0x0000080a - adds r0, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r6, r0 - bge _08135E7C - adds r5, r1, 0 -_08135E42: - lsls r4, r6, 5 - ldr r3, =0x00000954 - adds r4, r3 - ldr r0, [r5] - adds r0, r4 - adds r1, r6, 0 - bl sub_8135F04 - ldr r1, [r5] - lsls r2, r6, 3 - ldr r7, =0x0000080c - adds r0, r1, r7 - adds r0, r2 - adds r4, r1, r4 - str r4, [r0] - movs r3, 0x81 - lsls r3, 4 - adds r0, r1, r3 - adds r0, r2 - str r6, [r0] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r4, =0x0000080a - adds r1, r4 - ldrb r0, [r1] - subs r0, 0x1 - cmp r6, r0 - blt _08135E42 -_08135E7C: - ldr r5, =0x0203ab50 - lsls r4, r6, 5 - ldr r7, =0x00000954 - adds r4, r7 - ldr r0, [r5] - adds r0, r4 - ldr r1, =gUnknown_085E9344 - bl CopyString - ldr r1, [r5] - lsls r2, r6, 3 - ldr r3, =0x0000080c - adds r0, r1, r3 - adds r0, r2 - adds r4, r1, r4 - str r4, [r0] - movs r0, 0x81 - lsls r0, 4 - adds r1, r0 - adds r1, r2 - movs r0, 0x2 - negs r0, r0 - str r0, [r1] - ldr r2, =0x03006310 - adds r1, r2, 0 - ldr r0, =gUnknown_085B27B0 - ldm r0!, {r4,r6,r7} - stm r1!, {r4,r6,r7} - ldm r0!, {r4,r6,r7} - stm r1!, {r4,r6,r7} - ldrb r1, [r2, 0x17] - movs r0, 0x40 - negs r0, r0 - ands r0, r1 - movs r1, 0x7 - orrs r0, r1 - strb r0, [r2, 0x17] - ldr r1, [r5] - ldr r4, =0x0000080a - adds r0, r1, r4 - ldrb r0, [r0] - strh r0, [r2, 0xC] - adds r3, r1, r3 - str r3, [r2] - ldr r6, =0x0000080b - adds r1, r6 - ldrb r0, [r1] - strh r0, [r2, 0xE] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8135E2C - - thumb_func_start sub_8135F04 -sub_8135F04: @ 8135F04 - push {r4-r6,lr} - lsls r1, 16 - ldr r2, =0x03005d8c - lsrs r1, 13 - ldr r3, =0x00000848 - adds r1, r3 - ldr r5, [r2] - adds r5, r1 - ldr r2, =gUnknown_085B262C - ldrb r1, [r5] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl CopyString - adds r4, r0, 0 - movs r0, 0xFC - strb r0, [r4] - adds r4, 0x1 - movs r0, 0x12 - strb r0, [r4] - adds r4, 0x1 - movs r0, 0x57 - strb r0, [r4] - adds r4, 0x1 - ldr r6, =0x02021cc4 - adds r0, r5, 0 - bl sub_8136EA4 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r1, =gUnknown_085E934F - adds r0, r4, 0 - bl ExpandStringRefs - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8135F04 - - thumb_func_start sub_8135F70 -sub_8135F70: @ 8135F70 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x1 - beq _08135F9C - movs r0, 0x5 - bl audio_play - ldr r2, =0x02020630 - ldr r0, =0x0203ab50 - ldr r0, [r0] - ldr r1, =0x00000e74 - 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_8136470 - str r1, [r0] -_08135F9C: - ldr r0, =0x0203ab50 - ldr r0, [r0] - ldr r1, =0x00000e7d - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _08135FB0 - adds r0, r4, 0 - bl sub_8135FCC -_08135FB0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8135F70 - - thumb_func_start sub_8135FCC -sub_8135FCC: @ 8135FCC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - adds r4, r0, 0 - movs r0, 0x7 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _081360A0 - ldr r1, =0x03005d8c - lsls r0, r4, 3 - ldr r2, =0x00000848 - adds r0, r2 - ldr r1, [r1] - adds r1, r0 - mov r8, r1 - add r1, sp, 0x8 - movs r0, 0x17 - strh r0, [r1] - movs r0, 0x18 - strh r0, [r1, 0x2] - movs r5, 0 - adds r6, r1, 0 -_08136002: - adds r4, r5, 0x1 - lsls r1, r4, 24 - lsrs r1, 24 - mov r0, r8 - bl sub_8136F9C - lsls r0, 16 - adds r7, r4, 0 - cmp r0, 0 - ble _0813602C - lsls r1, r5, 12 - adds r0, r1, 0 - adds r0, 0x17 - strh r0, [r6] - adds r1, 0x18 - strh r1, [r6, 0x2] - b _08136032 - .pool -_0813602C: - movs r0, 0xF - strh r0, [r6] - strh r0, [r6, 0x2] -_08136032: - adds r0, r5, 0 - movs r1, 0x3 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 1 - adds r4, r0 - lsls r4, 1 - adds r4, 0x1 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x3 - bl __umodsi3 - adds r3, r0, 0 - lsls r3, 25 - movs r0, 0xD0 - lsls r0, 20 - adds r3, r0 - lsrs r3, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - add r1, sp, 0x8 - adds r2, r4, 0 - bl CopyToBgTilemapBufferRect - lsls r0, r7, 24 - lsrs r5, r0, 24 - cmp r5, 0x4 - bls _08136002 - ldr r4, =0x02021cc4 - mov r0, r8 - bl sub_8136EDC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - movs r0, 0x7 - adds r1, r4, 0 - movs r2, 0x4 - bl sub_8135D7C - b _081360F8 - .pool -_081360A0: - add r0, sp, 0x8 - movs r1, 0xF - strh r1, [r0] - strh r1, [r0, 0x2] - movs r5, 0 -_081360AA: - adds r0, r5, 0 - movs r1, 0x3 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 1 - adds r4, r0 - lsls r4, 1 - adds r4, 0x1 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x3 - bl __umodsi3 - adds r3, r0, 0 - lsls r3, 25 - movs r2, 0xD0 - lsls r2, 20 - adds r3, r2 - lsrs r3, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - add r1, sp, 0x8 - adds r2, r4, 0 - bl CopyToBgTilemapBufferRect - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x4 - bls _081360AA - movs r0, 0x7 - movs r1, 0x2 - bl CopyWindowToVram -_081360F8: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8135FCC - - thumb_func_start sub_8136110 -sub_8136110: @ 8136110 - push {lr} - sub sp, 0x8 - adds r3, r0, 0 - lsls r3, 16 - lsls r1, 16 - lsrs r1, 16 - lsrs r3, 15 - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0xE - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r2, 0xF - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x8 - pop {r0} - bx r0 - thumb_func_end sub_8136110 - - thumb_func_start sub_8136140 -sub_8136140: @ 8136140 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r2, 0 -_0813614A: - adds r1, r2, 0x1 - lsls r0, r1, 16 - lsrs r6, r0, 16 - mov r12, r1 - cmp r6, 0x27 - bhi _08136192 - ldr r0, =0x03005d8c - mov r9, r0 - lsls r7, r2, 3 - ldr r1, =0x00000848 - mov r8, r1 -_08136160: - mov r0, r9 - ldr r2, [r0] - adds r0, r2, r7 - add r0, r8 - ldrb r0, [r0] - cmp r0, 0 - bne _08136188 - ldr r1, =0x00000848 - adds r2, r1 - adds r3, r2, r7 - ldr r4, [r3] - ldr r5, [r3, 0x4] - lsls r0, r6, 3 - adds r2, r0 - ldr r0, [r2] - ldr r1, [r2, 0x4] - str r0, [r3] - str r1, [r3, 0x4] - str r4, [r2] - str r5, [r2, 0x4] -_08136188: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x27 - bls _08136160 -_08136192: - mov r1, r12 - lsls r0, r1, 16 - lsrs r2, r0, 16 - cmp r2, 0x26 - bls _0813614A - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8136140 - - thumb_func_start sub_81361B0 -sub_81361B0: @ 81361B0 - push {r4-r7,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00000848 - adds r6, r0, r1 - cmp r4, r5 - beq _08136246 - movs r0, 0x8 - bl Alloc - adds r7, r0, 0 - lsls r0, r4, 3 - adds r0, r6 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r7] - str r1, [r7, 0x4] - cmp r5, r4 - bls _0813620C - subs r5, 0x1 - lsls r3, r4, 16 - lsls r0, r5, 16 - asrs r1, r0, 16 - cmp r3, r0 - bge _08136234 - adds r4, r1, 0 -_081361E8: - asrs r3, 16 - lsls r2, r3, 3 - adds r2, r6 - ldr r0, [r2, 0x8] - ldr r1, [r2, 0xC] - str r0, [r2] - str r1, [r2, 0x4] - adds r3, 0x1 - lsls r3, 16 - asrs r0, r3, 16 - cmp r0, r4 - blt _081361E8 - b _08136234 - .pool -_0813620C: - lsls r3, r4, 16 - lsls r0, r5, 16 - asrs r1, r0, 16 - cmp r3, r0 - ble _08136234 - adds r4, r1, 0 -_08136218: - asrs r3, 16 - lsls r2, r3, 3 - adds r2, r6 - adds r0, r2, 0 - subs r0, 0x8 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r2] - str r1, [r2, 0x4] - subs r3, 0x1 - lsls r3, 16 - asrs r0, r3, 16 - cmp r0, r4 - bgt _08136218 -_08136234: - lsls r2, r5, 3 - adds r2, r6 - ldr r0, [r7] - ldr r1, [r7, 0x4] - str r0, [r2] - str r1, [r2, 0x4] - adds r0, r7, 0 - bl Free -_08136246: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81361B0 - - thumb_func_start sub_813624C -sub_813624C: @ 813624C - ldr r1, =0x0203ab48 - movs r0, 0 - strh r0, [r1, 0x4] - strh r0, [r1, 0x6] - bx lr - .pool - thumb_func_end sub_813624C - - thumb_func_start sub_813625C -sub_813625C: @ 813625C - push {r4,r5,lr} - bl sub_8136140 - ldr r0, =0x0203ab50 - ldr r0, [r0] - ldr r1, =0x0000080a - adds r0, r1 - movs r1, 0 - strb r1, [r0] - movs r2, 0 - ldr r5, =0x03005d8c - ldr r4, =0x00000848 -_08136274: - ldr r0, [r5] - lsls r1, r2, 3 - adds r0, r1 - adds r0, r4 - ldrb r0, [r0] - ldr r3, =0x0203ab50 - cmp r0, 0 - beq _08136290 - ldr r1, [r3] - ldr r0, =0x0000080a - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_08136290: - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x27 - bls _08136274 - ldr r0, [r3] - ldr r2, =0x0000080a - adds r0, r2 - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - ldr r0, [r3] - adds r2, r0, r2 - ldrb r2, [r2] - cmp r2, 0x9 - bls _081362D0 - ldr r2, =0x0000080b - adds r1, r0, r2 - movs r0, 0x9 - strb r0, [r1] - b _081362D6 - .pool -_081362D0: - ldr r1, =0x0000080b - adds r0, r1 - strb r2, [r0] -_081362D6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813625C - - thumb_func_start sub_81362E0 -sub_81362E0: @ 81362E0 - push {r4,r5,lr} - ldr r0, =0x0203ab48 - ldrh r1, [r0, 0x6] - adds r3, r0, 0 - ldr r4, =0x0203ab50 - cmp r1, 0 - beq _08136308 - ldrh r0, [r3, 0x6] - ldr r1, [r4] - ldr r5, =0x0000080b - adds r2, r1, r5 - ldrb r2, [r2] - adds r0, r2 - subs r5, 0x1 - adds r1, r5 - ldrb r1, [r1] - cmp r0, r1 - ble _08136308 - subs r0, r1, r2 - strh r0, [r3, 0x6] -_08136308: - adds r2, r3, 0 - ldrh r1, [r2, 0x6] - ldrh r0, [r2, 0x4] - adds r1, r0 - ldr r0, [r4] - ldr r4, =0x0000080a - adds r0, r4 - ldrb r0, [r0] - cmp r1, r0 - blt _0813633C - adds r1, r0, 0 - cmp r1, 0 - bne _08136338 - strh r1, [r2, 0x4] - b _0813633C - .pool -_08136338: - subs r0, 0x1 - strh r0, [r3, 0x4] -_0813633C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81362E0 - - thumb_func_start sub_8136344 -sub_8136344: @ 8136344 - push {r4-r7,lr} - ldr r0, =0x0203ab48 - ldrh r1, [r0, 0x4] - adds r5, r0, 0 - cmp r1, 0x4 - bls _081363A4 - movs r4, 0 - ldrh r0, [r5, 0x4] - subs r0, 0x4 - cmp r4, r0 - bge _081363A4 - ldrh r2, [r5, 0x6] - ldr r6, =0x0203ab50 - ldr r0, [r6] - ldr r3, =0x0000080b - adds r1, r0, r3 - ldrb r1, [r1] - adds r2, r1 - ldr r7, =0x0000080a - adds r0, r7 - ldrb r0, [r0] - cmp r2, r0 - beq _081363A4 - adds r3, r5, 0 -_08136374: - ldrh r0, [r3, 0x4] - subs r0, 0x1 - strh r0, [r3, 0x4] - ldrh r0, [r3, 0x6] - adds r0, 0x1 - strh r0, [r3, 0x6] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldrh r0, [r3, 0x4] - subs r0, 0x4 - cmp r4, r0 - bge _081363A4 - ldrh r2, [r5, 0x6] - ldr r1, [r6] - ldr r7, =0x0000080b - adds r0, r1, r7 - ldrb r0, [r0] - adds r2, r0 - ldr r0, =0x0000080a - adds r1, r0 - ldrb r1, [r1] - cmp r2, r1 - bne _08136374 -_081363A4: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8136344 - - thumb_func_start sub_81363BC -sub_81363BC: @ 81363BC - push {r4,lr} - sub sp, 0x10 - ldr r4, =0x0203ab50 - ldr r1, [r4] - ldr r2, =0x00000e7c - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081363FC - ldr r2, =0x0000080a - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - subs r0, r1 - str r0, [sp] - ldr r0, =0x00000456 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - ldr r0, =0x0203ab4e - str r0, [sp, 0xC] - movs r0, 0x2 - movs r1, 0xB0 - movs r2, 0x8 - movs r3, 0x98 - bl AddScrollIndicatorArrowPairParametrized - ldr r1, [r4] - ldr r2, =0x00000e7c - adds r1, r2 - strb r0, [r1] -_081363FC: - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81363BC - - thumb_func_start sub_8136418 -sub_8136418: @ 8136418 - push {r4,lr} - ldr r4, =0x0203ab50 - ldr r0, [r4] - ldr r2, =0x00000e7c - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08136436 - bl RemoveScrollIndicatorArrowPair - ldr r0, [r4] - ldr r1, =0x00000e7c - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] -_08136436: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8136418 - - thumb_func_start sub_8136444 -sub_8136444: @ 8136444 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r3, r2, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gUnknown_085B2704 - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - adds r1, r4, 0 - adds r2, r5, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8136444 - - thumb_func_start sub_8136470 -sub_8136470: @ 8136470 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - ble _08136480 - movs r0, 0 - strh r0, [r4, 0x2E] -_08136480: - movs r0, 0x2E - ldrsh r5, [r4, r0] - cmp r5, 0 - beq _0813648E - cmp r5, 0x1 - beq _081364B4 - b _081364E0 -_0813648E: - ldrb r1, [r4, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r4, 0x1] - ldr r0, =gUnknown_085B26F0 - str r0, [r4, 0x10] - adds r0, r4, 0 - bl obj_alloc_rotscale_entry - movs r0, 0x1 - strh r0, [r4, 0x2E] - strh r5, [r4, 0x30] - b _081364E0 - .pool -_081364B4: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - movs r2, 0 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB - ble _081364E0 - ldrb r1, [r4, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x1] - strh r2, [r4, 0x2E] - strh r2, [r4, 0x30] - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] -_081364E0: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8136470 - - thumb_func_start sub_81364EC -sub_81364EC: @ 81364EC - 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 pal_fade_maybe - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8136524 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81364EC - - thumb_func_start sub_8136524 -sub_8136524: @ 8136524 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r2, r0, r1 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081365BE - ldr r6, =0x0203ab50 - ldr r0, [r6] - ldr r1, =0x00000809 - adds r0, r1 - ldrb r0, [r0] - subs r0, 0x2 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _0813655A - ldr r1, =0x03005dac - ldr r0, =sub_80AF168 - str r0, [r1] -_0813655A: - ldrb r0, [r2] - ldr r4, =0x0203ab4e - subs r2, r4, 0x2 - adds r1, r4, 0 - bl sub_81AE6C8 - bl sub_8136418 - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - ldr r0, [r6] - movs r1, 0x80 - lsls r1, 4 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - beq _081365A4 - bl SetMainCallback2 - b _081365AC - .pool -_081365A4: - subs r0, r4, 0x6 - ldr r0, [r0] - bl SetMainCallback2 -_081365AC: - bl FreeAllWindowBuffers - ldr r0, =0x0203ab50 - ldr r0, [r0] - bl Free - adds r0, r5, 0 - bl DestroyTask -_081365BE: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8136524 - - thumb_func_start sub_81365C8 -sub_81365C8: @ 81365C8 - 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 - mov r8, r0 - ldr r0, =0x03005e08 - mov r10, r0 - mov r6, r8 - add r6, r10 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081365F4 - b _08136708 -_081365F4: - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08136602 - b _08136708 -_08136602: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x4 - ands r0, r1 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - cmp r0, 0 - beq _08136688 - ldrb r0, [r6] - ldr r4, =0x0203ab4e - subs r2, r4, 0x2 - adds r1, r4, 0 - bl get_coro_args_x18_x1A - subs r4, 0x6 - ldrh r1, [r4, 0x6] - ldrh r0, [r4, 0x4] - adds r1, r0 - ldr r5, =0x0203ab50 - ldr r0, [r5] - ldr r2, =0x0000080a - adds r0, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - beq _08136708 - movs r0, 0x5 - bl audio_play - ldrh r0, [r4, 0x4] - ldr r1, =0x00002005 - bl sub_8136110 - ldrh r0, [r4, 0x4] - ldrh r4, [r4, 0x6] - adds r0, r4 - strh r0, [r6, 0x4] - ldr r0, [r5] - ldr r1, =0x00000e7d - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - mov r0, r10 - subs r0, 0x8 - add r0, r8 - ldr r1, =sub_813671C - str r1, [r0] - b _08136708 - .pool -_08136688: - ldr r5, =0x0203ab48 - ldrh r2, [r5, 0x4] - mov r8, r2 - ldrb r0, [r6] - bl ListMenuHandleInput - adds r4, r0, 0 - ldrb r0, [r6] - adds r1, r5, 0x6 - adds r2, r5, 0x4 - bl get_coro_args_x18_x1A - ldrh r0, [r5, 0x4] - cmp r8, r0 - beq _081366B6 - mov r0, r8 - movs r1, 0x5 - bl sub_8136110 - ldrh r0, [r5, 0x4] - ldr r1, =0x00001005 - bl sub_8136110 -_081366B6: - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _081366D0 - adds r0, 0x1 - cmp r4, r0 - bne _081366F8 - b _08136708 - .pool -_081366D0: - movs r0, 0x5 - bl audio_play - ldr r0, =0x020375f0 - ldr r2, =0x0000ffff - adds r1, r2, 0 - strh r1, [r0] - ldr r0, =0x0203ce7c - mov r1, r9 - strh r1, [r0] - adds r0, r7, 0 - bl sub_81364EC - b _08136708 - .pool -_081366F8: - movs r0, 0x5 - bl audio_play - ldr r0, =0x0203ce7c - strh r4, [r0] - adds r0, r7, 0 - bl sub_8136938 -_08136708: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81365C8 - - thumb_func_start sub_813671C -sub_813671C: @ 813671C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r7, r0, r1 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08136742 - b _08136848 -_08136742: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0813676C - movs r0, 0x5 - bl audio_play - ldrb r0, [r7] - ldr r1, =0x0203ab4e - subs r2, r1, 0x2 - bl get_coro_args_x18_x1A - b _08136822 - .pool -_0813676C: - ldr r6, =0x0203ab48 - ldrh r4, [r6, 0x6] - ldrh r5, [r6, 0x4] - ldrb r0, [r7] - bl ListMenuHandleInput - mov r9, r0 - ldrb r0, [r7] - adds r1, r6, 0x6 - adds r2, r6, 0x4 - bl get_coro_args_x18_x1A - ldrh r0, [r6, 0x6] - cmp r4, r0 - bne _08136790 - ldrh r6, [r6, 0x4] - cmp r5, r6 - beq _081367CA -_08136790: - movs r4, 0 -_08136792: - ldr r0, =0x0203ab48 - ldrh r0, [r0, 0x6] - adds r0, r4, r0 - lsls r0, 16 - lsrs r5, r0, 16 - movs r1, 0x4 - ldrsh r0, [r7, r1] - cmp r5, r0 - bne _081367B8 - adds r0, r4, 0 - ldr r1, =0x00002005 - bl sub_8136110 - b _081367C0 - .pool -_081367B8: - adds r0, r4, 0 - movs r1, 0x5 - bl sub_8136110 -_081367C0: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x8 - bls _08136792 -_081367CA: - ldr r5, =0x0203ab50 - ldr r0, [r5] - ldr r4, =0x00000e75 - adds r0, r4 - movs r1, 0x7 - movs r2, 0 - bl sub_81223FC - ldr r0, [r5] - adds r0, r4 - ldr r1, =0x0203ab48 - ldrh r3, [r1, 0x4] - lsls r3, 4 - adds r3, 0x8 - lsls r3, 16 - lsrs r3, 16 - movs r1, 0x7 - movs r2, 0x80 - bl sub_8122448 - movs r0, 0x2 - negs r0, r0 - cmp r9, r0 - beq _08136810 - adds r0, 0x1 - cmp r9, r0 - bne _0813683A - b _08136848 - .pool -_08136810: - movs r0, 0x5 - bl audio_play - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08136830 -_08136822: - mov r0, r8 - movs r1, 0 - bl sub_8136854 - b _08136848 - .pool -_08136830: - mov r0, r8 - movs r1, 0x1 - bl sub_8136854 - b _08136848 -_0813683A: - movs r0, 0x5 - bl audio_play - mov r0, r8 - movs r1, 0 - bl sub_8136854 -_08136848: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_813671C - - thumb_func_start sub_8136854 -sub_8136854: @ 8136854 - push {r4-r7,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r6, r0, r1 - ldr r2, =0x0203ab48 - ldrh r0, [r2, 0x4] - ldrh r1, [r2, 0x6] - adds r0, r1 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x0203ab50 - ldr r0, [r0] - ldr r1, =0x00000e7d - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldrb r0, [r6] - adds r1, r2, 0x6 - adds r2, 0x4 - bl sub_81AE6C8 - cmp r4, 0 - bne _081368AA - movs r0, 0x4 - ldrsh r1, [r6, r0] - cmp r1, r5 - beq _081368BA - subs r0, r5, 0x1 - cmp r1, r0 - beq _081368AA - adds r0, r1, 0 - adds r1, r5, 0 - bl sub_81361B0 - bl sub_8135E2C -_081368AA: - movs r1, 0x4 - ldrsh r0, [r6, r1] - cmp r0, r5 - bge _081368BA - ldr r1, =0x0203ab48 - ldrh r0, [r1, 0x4] - subs r0, 0x1 - strh r0, [r1, 0x4] -_081368BA: - ldr r0, =0x03006310 - ldr r2, =0x0203ab48 - ldrh r1, [r2, 0x6] - ldrh r2, [r2, 0x4] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6] - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =0x0203ab50 - ldr r0, [r0] - ldr r1, =0x00000e75 - adds r0, r1 - movs r1, 0x7 - movs r2, 0x1 - bl sub_81223FC - movs r4, 0 - lsls r5, r7, 2 -_081368E6: - adds r0, r4, 0 - movs r1, 0x5 - bl sub_8136110 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x8 - bls _081368E6 - ldr r0, =0x0203ab48 - ldrh r0, [r0, 0x4] - ldr r1, =0x00001005 - bl sub_8136110 - ldr r1, =0x03005e00 - adds r0, r5, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81365C8 - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8136854 - - thumb_func_start sub_8136938 -sub_8136938: @ 8136938 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r6, r0, r1 - ldr r0, =0x0203ab50 - ldr r0, [r0] - ldr r1, =0x00000808 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _08136968 - movs r0, 0x8 - b _0813696A - .pool -_08136968: - movs r0, 0x9 -_0813696A: - strh r0, [r6, 0x2] - bl sub_8136418 - ldrb r0, [r6, 0x2] - movs r1, 0 - movs r2, 0x1 - movs r3, 0xE - bl SetWindowBorderStyle - ldrb r0, [r6, 0x2] - ldr r5, =0x0203ab50 - ldr r3, [r5] - ldr r4, =0x00000808 - adds r1, r3, r4 - ldrb r1, [r1] - ldr r2, =gUnknown_085B2668 - mov r12, r2 - ldr r2, =0x00000804 - adds r3, r2 - ldr r3, [r3] - mov r2, r12 - bl sub_81995E4 - ldrb r0, [r6, 0x2] - ldr r1, [r5] - adds r1, r4 - ldrb r1, [r1] - movs r2, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - ldrb r0, [r6, 0x2] - bl PutWindowTilemap - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81369E0 - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8136938 - - thumb_func_start sub_81369E0 -sub_81369E0: @ 81369E0 - 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 _08136A3C - bl ProcessMenuInputNoWrapAround - lsls r0, 24 - asrs r4, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _08136A3C - adds r0, 0x1 - cmp r4, r0 - bne _08136A18 - movs r0, 0x5 - bl audio_play - adds r0, r5, 0 - bl sub_8136DE8 - b _08136A3C -_08136A18: - movs r0, 0x5 - bl audio_play - ldr r1, =gUnknown_085B2668 - ldr r0, =0x0203ab50 - ldr r0, [r0] - ldr r2, =0x00000804 - 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 -_08136A3C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81369E0 - - thumb_func_start sub_8136A50 -sub_8136A50: @ 8136A50 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0203ab50 - ldr r1, [r1] - movs r2, 0x80 - lsls r2, 4 - adds r1, r2 - ldr r2, =sub_8136A74 - str r2, [r1] - bl sub_81364EC - pop {r0} - bx r0 - .pool - thumb_func_end sub_8136A50 - - thumb_func_start sub_8136A74 -sub_8136A74: @ 8136A74 - push {lr} - ldr r2, =0x03005d8c - ldr r0, =0x0203ce7c - ldrh r1, [r0] - lsls r1, 3 - ldr r0, =0x00000848 - adds r1, r0 - ldr r0, [r2] - adds r0, r1 - ldr r1, =sub_8136AA0 - bl sub_8166204 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8136A74 - - thumb_func_start sub_8136AA0 -sub_8136AA0: @ 8136AA0 - push {lr} - ldr r0, =0x0203ab48 - ldr r1, [r0] - movs r0, 0 - bl sub_81357FC - pop {r0} - bx r0 - .pool - thumb_func_end sub_8136AA0 - - thumb_func_start sub_8136AB4 -sub_8136AB4: @ 8136AB4 - push {r4,r5,lr} - sub sp, 0x10 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r0, r1 - ldrb r0, [r0, 0x2] - movs r1, 0 - bl sub_8198070 - ldr r0, =0x02021cc4 - ldr r3, =gUnknown_085B262C - ldr r1, =0x03005d8c - ldr r2, [r1] - ldr r1, =0x0203ce7c - ldrh r1, [r1] - lsls r1, 3 - adds r2, r1 - ldr r1, =0x00000848 - adds r2, r1 - ldrb r1, [r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl CopyString - ldr r5, =0x02021fc4 - ldr r1, =gUnknown_085E9353 - adds r0, r5, 0 - bl ExpandStringRefs - bl sav2_get_text_speed - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - str r1, [sp] - str r0, [sp, 0x4] - str r5, [sp, 0x8] - ldr r0, =sub_8136B48 - str r0, [sp, 0xC] - adds r0, r4, 0 - movs r1, 0xA - movs r2, 0xA - movs r3, 0xD - bl DisplayMessageAndContinueTask - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8136AB4 - - thumb_func_start sub_8136B48 -sub_8136B48: @ 8136B48 - push {lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_085B27A8 - movs r2, 0x2 - str r2, [sp] - movs r2, 0x1 - str r2, [sp, 0x4] - movs r2, 0xE - str r2, [sp, 0x8] - ldr r2, =gUnknown_085B26A4 - str r2, [sp, 0xC] - movs r2, 0x1 - movs r3, 0 - bl CreateYesNoMenuWithCallbacks - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8136B48 - - thumb_func_start sub_8136B78 -sub_8136B78: @ 8136B78 - push {r4,r5,lr} - sub sp, 0x10 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =0x02021fc4 - ldr r1, =gUnknown_085E9367 - adds r0, r5, 0 - bl ExpandStringRefs - bl sav2_get_text_speed - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - str r1, [sp] - str r0, [sp, 0x4] - str r5, [sp, 0x8] - ldr r0, =sub_8136BC0 - str r0, [sp, 0xC] - adds r0, r4, 0 - movs r1, 0xA - movs r2, 0xA - movs r3, 0xD - bl DisplayMessageAndContinueTask - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8136B78 - - thumb_func_start sub_8136BC0 -sub_8136BC0: @ 8136BC0 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08136C36 - ldr r0, =0x0203ce7c - ldrb r0, [r0] - bl sub_8136F68 - movs r0, 0x5 - bl audio_play - ldr r5, =0x0203ab4e - subs r6, r5, 0x2 - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - ldr r0, =0x03005e08 - adds r4, r0 - ldrb r0, [r4] - adds r1, r5, 0 - adds r2, r6, 0 - bl sub_81AE6C8 - ldrh r0, [r6] - movs r1, 0x5 - bl sub_8136110 - bl sub_813625C - bl sub_81362E0 - bl sub_8135E2C - ldr r0, =0x03006310 - ldrh r1, [r5] - ldrh r2, [r6] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - ldrh r0, [r6] - ldr r1, =0x00001005 - bl sub_8136110 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r7, 0 - bl sub_8136C54 -_08136C36: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8136BC0 - - thumb_func_start sub_8136C54 -sub_8136C54: @ 8136C54 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0xA - movs r1, 0 - bl sub_8197DF8 - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - bl sub_81363BC - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81365C8 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8136C54 - - thumb_func_start sub_8136C8C -sub_8136C8C: @ 8136C8C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =0x02024744 - bl GetNature - lsls r0, 24 - lsrs r0, 24 - ldr r5, =0x03005d8c - ldr r7, =0x0203ce7c - ldrh r2, [r7] - lsls r2, 3 - ldr r6, =0x00000848 - adds r2, r6 - ldr r1, [r5] - adds r1, r2 - bl sub_8136FE4 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =0x02022f58 - ldr r3, =gUnknown_085B262C - ldr r2, [r5] - ldrh r1, [r7] - lsls r1, 3 - adds r2, r1 - adds r2, r6 - ldrb r1, [r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl CopyString - ldrb r0, [r7] - bl sub_8136F68 - ldr r1, [r5] - ldrh r0, [r7] - lsls r0, 3 - adds r1, r0 - adds r1, r6 - ldrb r0, [r1] - lsls r0, 8 - strh r0, [r7] - lsls r4, 16 - asrs r4, 16 - cmp r4, 0 - bne _08136D10 - adds r0, 0x1 - b _08136D1A - .pool -_08136D10: - cmp r4, 0 - ble _08136D18 - adds r0, 0x2 - b _08136D1A -_08136D18: - adds r0, 0x3 -_08136D1A: - strh r0, [r7] - mov r0, r8 - bl sub_81364EC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8136C8C - - thumb_func_start sub_8136D2C -sub_8136D2C: @ 8136D2C - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =0x0203ce7c - ldrb r0, [r5] - bl sub_80FC3E8 - ldr r0, =0x02021cc4 - ldr r3, =gUnknown_085B262C - ldr r1, =0x03005d8c - ldr r2, [r1] - ldrh r1, [r5] - lsls r1, 3 - adds r2, r1 - ldr r1, =0x00000848 - adds r2, r1 - ldrb r1, [r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl CopyString - ldr r1, =0x020375f0 - ldrh r0, [r5] - strh r0, [r1] - lsls r0, 24 - lsrs r0, 24 - bl sub_8136F68 - movs r0, 0 - strh r0, [r5] - adds r0, r4, 0 - bl sub_81364EC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8136D2C - - thumb_func_start sub_8136D90 -sub_8136D90: @ 8136D90 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r6, =0x020375e0 - ldr r0, =0x03005d8c - ldr r5, =0x0203ce7c - ldrh r1, [r5] - lsls r1, 3 - ldr r2, =0x00000848 - adds r1, r2 - ldr r0, [r0] - adds r0, r1 - bl sub_818E704 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6] - ldr r1, =0x020375f0 - ldrh r0, [r5] - strh r0, [r1] - lsls r0, 24 - lsrs r0, 24 - bl sub_8136F68 - movs r0, 0 - strh r0, [r5] - adds r0, r4, 0 - bl sub_81364EC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8136D90 - - thumb_func_start sub_8136DE8 -sub_8136DE8: @ 8136DE8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r5, =0x03005e08 - adds r0, r4, r5 - ldrb r0, [r0, 0x2] - movs r1, 0 - bl sub_8198070 - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - bl sub_81363BC - subs r5, 0x8 - adds r4, r5 - ldr r0, =sub_81365C8 - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8136DE8 - - thumb_func_start sub_8136E20 -sub_8136E20: @ 8136E20 - push {r4,lr} - lsls r0, 24 - ldr r3, =0x03005d8c - ldr r1, [r3] - lsrs r0, 21 - adds r1, r0 - ldr r2, =0x00000848 - adds r1, r2 - movs r2, 0 - strb r2, [r1] - ldr r1, [r3] - adds r1, r0 - ldr r4, =0x00000849 - adds r1, r4 - strb r2, [r1] - ldr r1, [r3] - adds r1, r0 - adds r4, 0x1 - adds r1, r4 - strb r2, [r1] - ldr r1, [r3] - adds r1, r0 - adds r4, 0x1 - adds r1, r4 - strb r2, [r1] - ldr r1, [r3] - adds r1, r0 - adds r4, 0x1 - adds r1, r4 - strb r2, [r1] - ldr r1, [r3] - adds r1, r0 - adds r4, 0x1 - adds r1, r4 - strb r2, [r1] - ldr r1, [r3] - adds r1, r0 - ldr r0, =0x0000084e - adds r1, r0 - strb r2, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8136E20 - - thumb_func_start sub_8136E88 -sub_8136E88: @ 8136E88 - push {r4,lr} - movs r4, 0 -_08136E8C: - adds r0, r4, 0 - bl sub_8136E20 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x27 - bls _08136E8C - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8136E88 - - thumb_func_start sub_8136EA4 -sub_8136EA4: @ 8136EA4 - push {r4-r6,lr} - adds r6, r0, 0 - movs r1, 0x1 - bl sub_8136F9C - lsls r0, 24 - lsrs r5, r0, 24 - movs r1, 0x1 -_08136EB4: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_8136F9C - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - bcs _08136ECC - adds r5, r0, 0 -_08136ECC: - adds r1, r4, 0 - cmp r1, 0x4 - bls _08136EB4 - adds r0, r5, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8136EA4 - - thumb_func_start sub_8136EDC -sub_8136EDC: @ 8136EDC - push {lr} - movs r1, 0x6 - bl sub_8136F9C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x63 - bls _08136EEE - movs r0, 0x63 -_08136EEE: - pop {r1} - bx r1 - thumb_func_end sub_8136EDC - - thumb_func_start sub_8136EF4 -sub_8136EF4: @ 8136EF4 - push {lr} - movs r1, 0 - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r3, =0x00000848 -_08136EFE: - lsls r0, r1, 3 - adds r0, r2, r0 - adds r0, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _08136F18 - lsls r0, r1, 24 - asrs r0, 24 - b _08136F26 - .pool -_08136F18: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x27 - bls _08136EFE - movs r0, 0x1 - negs r0, r0 -_08136F26: - pop {r1} - bx r1 - thumb_func_end sub_8136EF4 - - thumb_func_start sub_8136F2C -sub_8136F2C: @ 8136F2C - push {r4,lr} - adds r4, r0, 0 - bl sub_8136EF4 - lsls r0, 24 - asrs r1, r0, 24 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08136F60 - ldr r0, =0x03005d8c - ldr r2, [r0] - lsls r0, r1, 3 - ldr r1, =0x00000848 - adds r2, r1 - adds r2, r0 - ldr r0, [r4] - ldr r1, [r4, 0x4] - str r0, [r2] - str r1, [r2, 0x4] - movs r0, 0x1 - b _08136F62 - .pool -_08136F60: - movs r0, 0 -_08136F62: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8136F2C - - thumb_func_start sub_8136F68 -sub_8136F68: @ 8136F68 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x03005d8c - ldr r0, [r0] - lsls r1, r2, 3 - adds r0, r1 - ldr r1, =0x00000848 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _08136F94 - adds r0, r2, 0 - bl sub_8136E20 - movs r0, 0x1 - b _08136F96 - .pool -_08136F94: - movs r0, 0 -_08136F96: - pop {r1} - bx r1 - thumb_func_end sub_8136F68 - - thumb_func_start sub_8136F9C -sub_8136F9C: @ 8136F9C - push {lr} - lsls r1, 24 - lsrs r1, 24 - adds r2, r1, 0 - cmp r1, 0 - bne _08136FAC - ldrb r0, [r0] - b _08136FDE -_08136FAC: - cmp r1, 0x1 - bne _08136FB4 - ldrb r0, [r0, 0x1] - b _08136FDE -_08136FB4: - cmp r1, 0x2 - bne _08136FBC - ldrb r0, [r0, 0x2] - b _08136FDE -_08136FBC: - cmp r1, 0x3 - bne _08136FC4 - ldrb r0, [r0, 0x3] - b _08136FDE -_08136FC4: - cmp r1, 0x4 - bne _08136FCC - ldrb r0, [r0, 0x4] - b _08136FDE -_08136FCC: - cmp r1, 0x5 - bne _08136FD4 - ldrb r0, [r0, 0x5] - b _08136FDE -_08136FD4: - cmp r2, 0x6 - beq _08136FDC - movs r0, 0 - b _08136FDE -_08136FDC: - ldrb r0, [r0, 0x6] -_08136FDE: - pop {r1} - bx r1 - thumb_func_end sub_8136F9C - - thumb_func_start sub_8136FE4 -sub_8136FE4: @ 8136FE4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r8, r1 - lsls r0, 24 - lsrs r0, 24 - movs r6, 0 - movs r4, 0 - ldr r1, =gUnknown_085B25A0 - mov r9, r1 - lsls r1, r0, 2 - adds r7, r1, r0 -_08136FFE: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - mov r0, r8 - adds r1, r5, 0 - bl sub_8136F9C - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0 - ble _0813702A - adds r0, r7, r4 - add r0, r9 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - muls r1, r0 - lsls r0, r6, 16 - asrs r0, 16 - adds r0, r1 - lsls r0, 16 - lsrs r6, r0, 16 -_0813702A: - adds r4, r5, 0 - cmp r4, 0x4 - bls _08136FFE - lsls r0, r6, 16 - asrs r0, 16 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8136FE4 - - thumb_func_start sub_8137044 -sub_8137044: @ 8137044 - push {r4,lr} - adds r4, r1, 0 - movs r1, 0 - bl sub_8136F9C - lsls r0, 24 - ldr r1, =gUnknown_085B262C - lsrs r0, 22 - adds r0, r1 - ldr r1, [r0] - adds r0, r4, 0 - bl CopyString - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8137044 - - thumb_func_start sub_8137068 -sub_8137068: @ 8137068 - push {r4-r7,lr} - adds r6, r1, 0 - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r7, =gUnknown_085B262C -_08137074: - lsls r1, r4, 3 - ldr r0, =gUnknown_085B2720 - adds r1, r0 - adds r0, r5, 0 - bl sub_8136FE4 - lsls r0, 16 - cmp r0, 0 - ble _081370A0 - adds r0, r4, 0x1 - lsls r0, 2 - adds r0, r7 - ldr r1, [r0] - adds r0, r6, 0 - bl CopyString - movs r0, 0x1 - b _081370AC - .pool -_081370A0: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _08137074 - movs r0, 0 -_081370AC: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8137068 - - thumb_func_start sub_81370B4 -sub_81370B4: @ 81370B4 - push {r4-r7,lr} - adds r5, r0, 0 - movs r7, 0 - movs r6, 0 -_081370BC: - adds r1, r7, 0x1 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl sub_8136F9C - adds r4, r0, 0 - adds r1, r6, 0x1 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl sub_8136F9C - lsls r4, 16 - lsls r0, 16 - lsls r1, r6, 16 - cmp r4, r0 - bge _081370E2 - lsrs r7, r1, 16 -_081370E2: - movs r2, 0x80 - lsls r2, 9 - adds r0, r1, r2 - lsrs r6, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _081370BC - lsls r0, r7, 24 - lsrs r0, 24 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81370B4 - - thumb_func_start sub_81370FC -sub_81370FC: @ 81370FC - push {r4,lr} - bl sub_81798D0 - lsls r0, 24 - cmp r0, 0 - beq _08137134 - ldr r4, =0x020375f0 - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - ldr r1, =0x03005db0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =0x0203ceec - ldr r0, =sub_8179918 - b _08137152 - .pool -_08137134: - ldr r0, =0x02037318 - ldrb r0, [r0, 0x15] - cmp r0, 0x1 - bne _08137170 - ldr r0, =0x00000888 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08137170 - ldr r1, =0x03005db0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =0x0203ceec - ldr r0, =hm2_flash -_08137152: - str r0, [r1] - movs r0, 0x1 - b _08137172 - .pool -_08137170: - movs r0, 0 -_08137172: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81370FC - - thumb_func_start hm2_flash -hm2_flash: @ 8137178 - push {r4,lr} - bl oei_task_add - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl brm_get_pokemon_selection - ldr r1, =0x02038c08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r2, =sub_81371B4 - lsrs r1, r2, 16 - strh r1, [r0, 0x18] - strh r2, [r0, 0x1A] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end hm2_flash - - thumb_func_start sub_81371B4 -sub_81371B4: @ 81371B4 - push {lr} - movs r0, 0xCF - bl audio_play - ldr r0, =0x00000888 - bl FlagSet - ldr r0, =gUnknown_082926F8 - bl script_env_1_execute_new_script - pop {r0} - bx r0 - .pool - thumb_func_end sub_81371B4 - - thumb_func_start sub_81371D4 -sub_81371D4: @ 81371D4 - push {lr} - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_81371D4 - - thumb_func_start sub_81371EC -sub_81371EC: @ 81371EC - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_81371EC - - thumb_func_start c2_change_map -c2_change_map: @ 8137200 - push {r4,lr} - sub sp, 0x8 - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0xC - movs r1, 0 - bl SetGpuReg - movs r0, 0xA - movs r1, 0 - bl SetGpuReg - movs r0, 0x8 - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, =0x040000d4 - mov r0, sp - str r0, [r1] - movs r0, 0xC0 - lsls r0, 19 - str r0, [r1, 0x4] - ldr r0, =0x8100c000 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r4, 0 - str r4, [sp, 0x4] - add r0, sp, 0x4 - str r0, [r1] - movs r0, 0xE0 - lsls r0, 19 - str r0, [r1, 0x4] - ldr r0, =0x85000100 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - mov r0, sp - strh r4, [r0] - str r0, [r1] - ldr r0, =0x05000002 - str r0, [r1, 0x4] - ldr r0, =0x810001ff - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - bl sub_80A1A74 - bl ResetTasks - bl ResetAllObjectData - ldr r3, =0x04000208 - ldrh r2, [r3] - strh r4, [r3] - ldr r4, =0x04000200 - ldrh r0, [r4] - movs r1, 0x1 - orrs r0, r1 - strh r0, [r4] - strh r2, [r3] - ldr r0, =sub_81371EC - bl SetVBlankCallback - ldr r0, =sub_81371D4 - bl SetMainCallback2 - bl sub_8137304 - lsls r0, 24 - cmp r0, 0 - bne _081372D2 - ldr r0, =0x030022c0 - ldr r0, [r0, 0x8] - bl SetMainCallback2 -_081372D2: - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end c2_change_map - - thumb_func_start sub_8137304 -sub_8137304: @ 8137304 - push {r4-r7,lr} - bl get_map_light_from_warp0 - lsls r0, 24 - lsrs r6, r0, 24 - bl sav1_map_get_light_level - lsls r0, 24 - lsrs r5, r0, 24 - movs r3, 0 - ldr r4, =gUnknown_085B27C8 - ldrb r0, [r4] - cmp r0, 0 - beq _08137358 - adds r7, r4, 0 - adds r0, r4, 0x4 - mov r12, r0 -_08137326: - lsls r2, r3, 3 - adds r1, r2, r7 - ldrb r0, [r1] - cmp r0, r6 - bne _08137348 - ldrb r0, [r1, 0x1] - cmp r0, r5 - bne _08137348 - mov r1, r12 - adds r0, r2, r1 - ldr r0, [r0] - bl _call_via_r0 - movs r0, 0x1 - b _0813735A - .pool -_08137348: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 3 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _08137326 -_08137358: - movs r0, 0 -_0813735A: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8137304 - - thumb_func_start sub_8137360 -sub_8137360: @ 8137360 - push {r4-r6,lr} - lsls r0, 24 - lsls r1, 24 - lsrs r5, r0, 24 - lsrs r4, r1, 24 - movs r3, 0 - ldr r1, =gUnknown_085B27C8 - ldrb r0, [r1] - cmp r0, 0 - beq _081373A0 - adds r6, r1, 0 -_08137376: - lsls r0, r3, 3 - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, r5 - bne _08137390 - ldrb r0, [r2, 0x1] - cmp r0, r4 - bne _08137390 - ldrb r0, [r2, 0x2] - b _081373A2 - .pool -_08137390: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _08137376 -_081373A0: - movs r0, 0 -_081373A2: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8137360 - - thumb_func_start fade_type_for_given_maplight_pair -fade_type_for_given_maplight_pair: @ 81373A8 - push {r4-r6,lr} - lsls r0, 24 - lsls r1, 24 - lsrs r5, r0, 24 - lsrs r4, r1, 24 - movs r3, 0 - ldr r1, =gUnknown_085B27C8 - ldrb r0, [r1] - cmp r0, 0 - beq _081373E8 - adds r6, r1, 0 -_081373BE: - lsls r0, r3, 3 - adds r2, r0, r6 - ldrb r0, [r2] - cmp r0, r5 - bne _081373D8 - ldrb r0, [r2, 0x1] - cmp r0, r4 - bne _081373D8 - ldrb r0, [r2, 0x3] - b _081373EA - .pool -_081373D8: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - lsls r0, r3, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081373BE -_081373E8: - movs r0, 0 -_081373EA: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end fade_type_for_given_maplight_pair - - thumb_func_start sub_81373F0 -sub_81373F0: @ 81373F0 - push {lr} - ldr r0, =sub_8137404 - movs r1, 0 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81373F0 - - thumb_func_start sub_8137404 -sub_8137404: @ 8137404 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =sub_8137420 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8137404 - - thumb_func_start sub_8137420 -sub_8137420: @ 8137420 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - movs r1, 0 - bl SetGpuReg - ldr r0, =gUnknown_085B2A90 - ldr r1, =0x0600c000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085B28B0 - ldr r1, =0x0600f800 - bl LZ77UnCompVram - ldr r0, =gUnknown_085B2850 - movs r1, 0xE0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_085B28A0 - movs r1, 0xE0 - movs r2, 0x10 - bl gpu_pal_apply - ldr r1, =0x00003e41 - movs r0, 0x50 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - ldr r1, =0x00001f0c - movs r0, 0x8 - bl SetGpuReg - movs r1, 0x8A - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81374C4 - str r1, [r0] - movs r2, 0 - movs r1, 0x10 - strh r1, [r0, 0x8] - strh r2, [r0, 0xA] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8137420 - - thumb_func_start sub_81374C4 -sub_81374C4: @ 81374C4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r5, r1, r2 - ldrh r4, [r5, 0xA] - movs r0, 0x80 - lsls r0, 5 - adds r1, r4, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - cmp r4, 0x10 - bhi _081374F8 - ldrh r0, [r5, 0xA] - adds r0, 0x1 - strh r0, [r5, 0xA] - b _08137500 - .pool -_081374F8: - movs r0, 0 - strh r0, [r5, 0xC] - ldr r0, =sub_813750C - str r0, [r5] -_08137500: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81374C4 - - thumb_func_start sub_813750C -sub_813750C: @ 813750C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =0x00001010 - movs r0, 0x52 - bl SetGpuReg - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r1 - ldrh r1, [r4, 0xC] - cmp r1, 0x7 - bhi _08137554 - adds r0, r1, 0x1 - strh r0, [r4, 0xC] - lsls r1, 1 - ldr r0, =gUnknown_085B28A0 - adds r0, r1, r0 - movs r2, 0x10 - subs r2, r1 - lsls r2, 16 - lsrs r2, 16 - movs r1, 0xE0 - bl gpu_pal_apply - b _08137566 - .pool -_08137554: - ldr r0, =gUnknown_085B2850 - movs r1, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =sub_8137574 - str r0, [r4] - movs r0, 0x8 - strh r0, [r4, 0xC] -_08137566: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813750C - - thumb_func_start sub_8137574 -sub_8137574: @ 8137574 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrh r2, [r1, 0xC] - movs r3, 0xC - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _08137598 - subs r0, r2, 0x1 - strh r0, [r1, 0xC] - b _081375A0 - .pool -_08137598: - ldr r0, =0x030022c0 - ldr r0, [r0, 0x8] - bl SetMainCallback2 -_081375A0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8137574 - - thumb_func_start sub_81375A8 -sub_81375A8: @ 81375A8 - push {lr} - ldr r0, =sub_81375BC - movs r1, 0 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81375A8 - - thumb_func_start sub_81375BC -sub_81375BC: @ 81375BC - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =sub_81375D8 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_81375BC - - thumb_func_start sub_81375D8 -sub_81375D8: @ 81375D8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - movs r1, 0 - bl SetGpuReg - ldr r0, =gUnknown_085B2A90 - ldr r1, =0x0600c000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085B28B0 - ldr r1, =0x0600f800 - bl LZ77UnCompVram - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - ldr r1, =0x00001f0c - movs r0, 0x8 - bl SetGpuReg - movs r1, 0x8A - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r0, =gUnknown_085B2850 - movs r1, 0xE0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_085B2870 - movs r1, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8137678 - str r1, [r0] - movs r2, 0 - movs r1, 0x10 - strh r1, [r0, 0x8] - strh r2, [r0, 0xA] - strh r2, [r0, 0xC] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81375D8 - - thumb_func_start sub_8137678 -sub_8137678: @ 8137678 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r1, [r4, 0xC] - cmp r1, 0xF - bhi _081376B4 - adds r2, r1, 0x1 - adds r0, r2, 0x1 - strh r0, [r4, 0xC] - movs r0, 0xF - subs r0, r1 - lsls r0, 1 - ldr r1, =gUnknown_085B2890 - adds r0, r1 - lsls r2, 17 - lsrs r2, 16 - movs r1, 0xE0 - bl gpu_pal_apply - b _081376C8 - .pool -_081376B4: - ldr r1, =0x00001010 - movs r0, 0x52 - bl SetGpuReg - ldr r1, =0x00003e41 - movs r0, 0x50 - bl SetGpuReg - ldr r0, =sub_81376DC - str r0, [r4] -_081376C8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8137678 - - thumb_func_start sub_81376DC -sub_81376DC: @ 81376DC - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r5, r1, r2 - ldrh r0, [r5, 0xA] - movs r1, 0x10 - subs r1, r0 - lsls r1, 16 - lsrs r4, r1, 16 - movs r0, 0x80 - lsls r0, 21 - adds r1, r0 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - cmp r4, 0 - beq _08137714 - ldrh r0, [r5, 0xA] - adds r0, 0x1 - strh r0, [r5, 0xA] - b _08137726 - .pool -_08137714: - ldr r0, =gUnknown_085B2870 - movs r1, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =0x030022c0 - ldr r0, [r0, 0x8] - bl SetMainCallback2 -_08137726: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81376DC - - thumb_func_start sub_8137734 -sub_8137734: @ 8137734 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x1C - bl sp000_heal_pokemon - ldr r4, =0x00000864 - adds r0, r4, 0 - bl FlagGet - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1 - bne _08137760 - ldr r0, =0x0203bce4 - strb r1, [r0] - b _0813776C - .pool -_08137760: - ldr r1, =0x0203bce4 - movs r0, 0 - strb r0, [r1] - adds r0, r4, 0 - bl FlagSet -_0813776C: - movs r0, 0x1 - bl sub_80847F8 - cmp r0, 0 - bne _0813778E - ldr r0, =0x03005d90 - ldr r2, [r0] - ldrh r1, [r2, 0xE] - lsls r1, 16 - ldrb r0, [r2, 0x10] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x11] - orrs r1, r0 - movs r0, 0x1 - bl sav12_xor_set -_0813778E: - bl sub_8076D48 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _081377AC - movs r0, 0x1 - bl sub_8084F6C - b _081377B2 - .pool -_081377AC: - movs r0, 0x2 - bl sub_8084F6C -_081377B2: - movs r7, 0 - movs r6, 0 - add r0, sp, 0x18 - mov r8, r0 - mov r5, sp -_081377BC: - movs r0, 0x64 - adds r1, r6, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - movs r0, 0 - strb r6, [r5] - strb r0, [r5, 0x1] - adds r0, r4, 0 - movs r1, 0x5 - bl pokemon_getattr - cmp r0, 0 - beq _0813780A - adds r0, r4, 0 - movs r1, 0x6 - bl pokemon_getattr - cmp r0, 0 - bne _0813780A - adds r0, r4, 0 - movs r1, 0x43 - bl pokemon_getattr - cmp r0, 0 - bne _0813780A - movs r0, 0x1 - mov r1, r8 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x43 - add r2, sp, 0x18 - bl pokemon_setattr - adds r0, r4, 0 - bl sub_80EE5A4 - strb r0, [r5, 0x1] - movs r7, 0x1 -_0813780A: - adds r5, 0x4 - adds r6, 0x1 - cmp r6, 0x5 - ble _081377BC - cmp r7, 0x1 - bne _0813785A - movs r0, 0x2A - bl sav12_xor_increment - ldr r0, =0x0000089b - bl FlagSet - mov r3, sp - add r2, sp, 0x4 - movs r6, 0x4 -_08137828: - ldrb r1, [r3, 0x1] - ldrb r0, [r2, 0x1] - cmp r0, r1 - bls _08137838 - ldr r1, [sp] - ldr r0, [r2] - str r0, [sp] - str r1, [r2] -_08137838: - adds r2, 0x4 - subs r6, 0x1 - cmp r6, 0 - bge _08137828 - mov r0, sp - ldrb r0, [r0, 0x1] - cmp r0, 0x4 - bls _0813785A - mov r0, sp - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x43 - bl sub_80EE4DC -_0813785A: - ldr r0, =sub_8173694 - bl SetMainCallback2 - movs r0, 0 - add sp, 0x1C - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8137734 - - thumb_func_start sp0C8_whiteout_maybe -sp0C8_whiteout_maybe: @ 813787C - push {lr} - ldr r0, =c2_whiteout - bl SetMainCallback2 - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sp0C8_whiteout_maybe - - thumb_func_start sub_8137890 -sub_8137890: @ 8137890 - push {r4,lr} - ldr r0, =0x00004024 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =0x00004025 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - lsls r4, 16 - orrs r4, r0 - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8137890 - - thumb_func_start sub_81378BC -sub_81378BC: @ 81378BC - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x00004024 - lsrs r1, r4, 16 - bl VarSet - ldr r0, =0x00004025 - lsls r4, 16 - lsrs r4, 16 - adds r1, r4, 0 - bl VarSet - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81378BC - - thumb_func_start sub_81378E4 -sub_81378E4: @ 81378E4 - push {r4,lr} - bl GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsls r0, 16 - lsrs r0, 16 - orrs r4, r0 - adds r0, r4, 0 - bl sub_81378BC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81378E4 - - thumb_func_start sub_8137904 -sub_8137904: @ 8137904 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - bl sub_8137890 - adds r1, r0, 0 - cmp r4, 0 - beq _08137928 - ldr r3, =0x41c64e6d - ldr r2, =0x00003039 -_08137918: - adds r0, r1, 0 - muls r0, r3 - adds r1, r0, r2 - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - bne _08137918 -_08137928: - adds r0, r1, 0 - bl sub_81378BC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8137904 - - thumb_func_start sub_813793C -sub_813793C: @ 813793C - push {r4-r6,lr} - bl sub_8137890 - lsrs r6, r0, 16 - movs r5, 0 -_08137946: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _08137978 - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - ldr r1, =0x0000ffff - ands r1, r0 - cmp r1, r6 - bne _08137978 - movs r0, 0x1 - b _08137980 - .pool -_08137978: - adds r5, 0x1 - cmp r5, 0x5 - ble _08137946 - movs r0, 0 -_08137980: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_813793C - - thumb_func_start sub_8137988 -sub_8137988: @ 8137988 - push {lr} - bl get_map_light_from_warp0 - lsls r0, 24 - lsrs r0, 24 - bl is_light_level_1_2_3_5_or_6 - lsls r0, 24 - cmp r0, 0 - beq _081379CE - bl GameFreakRTC_CalcLocalDateTime - ldr r1, =gUnknown_085B2B44 - ldr r0, =0x03005cf8 - ldrb r0, [r0, 0x2] - lsls r0, 24 - asrs r0, 24 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _081379C8 - ldr r0, =0x0000089a - bl FlagSet - b _081379CE - .pool -_081379C8: - ldr r0, =0x0000089a - bl FlagReset -_081379CE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8137988 - - thumb_func_start sub_81379D8 -sub_81379D8: @ 81379D8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80AC3BC - lsls r0, 24 - cmp r0, 0 - beq _081379F2 - bl script_env_2_enable_and_set_ctx_running - adds r0, r4, 0 - bl DestroyTask -_081379F2: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81379D8 - - thumb_func_start sub_81379F8 -sub_81379F8: @ 81379F8 - push {lr} - ldr r0, =sub_81379D8 - movs r1, 0x50 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81379F8 - - thumb_func_start sub_8137A0C -sub_8137A0C: @ 8137A0C - push {lr} - ldr r0, =0x00004049 - bl GetVarPointer - movs r1, 0 - strh r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8137A0C - - thumb_func_start sub_8137A20 -sub_8137A20: @ 8137A20 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =0x00004049 - bl GetVarPointer - adds r5, r0, 0 - ldrh r0, [r5] - adds r4, r0 - strh r4, [r5] - ldrh r0, [r5] - movs r1, 0x7 - bl __umodsi3 - strh r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8137A20 - - thumb_func_start sub_8137A4C -sub_8137A4C: @ 8137A4C - push {lr} - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0 - bne _08137A70 - movs r0, 0 - bl sub_80C0844 - ldr r1, =0x020375e2 - strh r0, [r1] - movs r0, 0x1 - bl sub_80C0844 - b _08137A80 - .pool -_08137A70: - movs r0, 0 - bl pokedex_count - ldr r1, =0x020375e2 - strh r0, [r1] - movs r0, 0x1 - bl pokedex_count -_08137A80: - ldr r1, =0x020375e4 - strh r0, [r1] - bl sub_809D42C - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8137A4C - - thumb_func_start sub_8137A98 -sub_8137A98: @ 8137A98 - push {lr} - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x9 - bhi _08137AA4 - b _08137BFC -_08137AA4: - cmp r0, 0x13 - bhi _08137AB0 - ldr r0, =gUnknown_082A5DAB - b _08137C06 - .pool -_08137AB0: - cmp r0, 0x1D - bhi _08137ABC - ldr r0, =gUnknown_082A5DF1 - b _08137C06 - .pool -_08137ABC: - cmp r0, 0x27 - bhi _08137AC8 - ldr r0, =gUnknown_082A5E34 - b _08137C06 - .pool -_08137AC8: - cmp r0, 0x31 - bhi _08137AD4 - ldr r0, =gUnknown_082A5E83 - b _08137C06 - .pool -_08137AD4: - cmp r0, 0x3B - bhi _08137AE0 - ldr r0, =gUnknown_082A5EB9 - b _08137C06 - .pool -_08137AE0: - cmp r0, 0x45 - bhi _08137AEC - ldr r0, =gUnknown_082A5EF4 - b _08137C06 - .pool -_08137AEC: - cmp r0, 0x4F - bhi _08137AF8 - ldr r0, =gUnknown_082A5F39 - b _08137C06 - .pool -_08137AF8: - cmp r0, 0x59 - bhi _08137B04 - ldr r0, =gUnknown_082A5F82 - b _08137C06 - .pool -_08137B04: - cmp r0, 0x63 - bhi _08137B10 - ldr r0, =gUnknown_082A5FB9 - b _08137C06 - .pool -_08137B10: - cmp r0, 0x6D - bhi _08137B1C - ldr r0, =gUnknown_082A6018 - b _08137C06 - .pool -_08137B1C: - cmp r0, 0x77 - bhi _08137B28 - ldr r0, =gUnknown_082A6061 - b _08137C06 - .pool -_08137B28: - cmp r0, 0x81 - bhi _08137B34 - ldr r0, =gUnknown_082A609C - b _08137C06 - .pool -_08137B34: - cmp r0, 0x8B - bhi _08137B40 - ldr r0, =gUnknown_082A60D5 - b _08137C06 - .pool -_08137B40: - cmp r0, 0x95 - bhi _08137B4C - ldr r0, =gUnknown_082A6124 - b _08137C06 - .pool -_08137B4C: - cmp r0, 0x9F - bhi _08137B58 - ldr r0, =gUnknown_082A616F - b _08137C06 - .pool -_08137B58: - cmp r0, 0xA9 - bhi _08137B64 - ldr r0, =gUnknown_082A61D6 - b _08137C06 - .pool -_08137B64: - cmp r0, 0xB3 - bhi _08137B70 - ldr r0, =gUnknown_082A623A - b _08137C06 - .pool -_08137B70: - cmp r0, 0xBD - bhi _08137B7C - ldr r0, =gUnknown_082A6287 - b _08137C06 - .pool -_08137B7C: - cmp r0, 0xC7 - bls _08137BEA - cmp r0, 0xC8 - bne _08137BB8 - ldr r0, =0x00000199 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - bne _08137BEA - 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 - bne _08137BEA - b _08137C04 - .pool -_08137BB8: - cmp r0, 0xC9 - bne _08137BF8 - 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 _08137C04 - 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 _08137C04 -_08137BEA: - ldr r0, =gUnknown_082A62C9 - b _08137C06 - .pool -_08137BF8: - cmp r0, 0xCA - beq _08137C04 -_08137BFC: - ldr r0, =gUnknown_082A5D6C - b _08137C06 - .pool -_08137C04: - ldr r0, =gUnknown_082A6312 -_08137C06: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8137A98 - - thumb_func_start sub_8137C10 -sub_8137C10: @ 8137C10 - push {lr} - ldr r0, =0x020375e0 - ldrh r0, [r0] - bl sub_8137A98 - bl box_related_two__2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8137C10 - - thumb_func_start sub_8137C28 -sub_8137C28: @ 8137C28 - push {lr} - ldr r0, =sub_8174194 - bl SetMainCallback2 - bl script_env_2_enable - pop {r0} - bx r0 - .pool - thumb_func_end sub_8137C28 - - thumb_func_start sub_8137C3C -sub_8137C3C: @ 8137C3C - push {lr} - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - ldr r1, =0x03005dac - ldr r0, =mapldr_080CA5C0 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8137C3C - - thumb_func_start mapldr_080CA5C0 -mapldr_080CA5C0: @ 8137C5C - push {lr} - sub sp, 0x4 - bl script_env_2_enable - bl sub_8085784 - bl sp109_CreatePCMenu - bl sub_80E2514 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =sub_8137C94 - movs r1, 0xA - bl CreateTask - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end mapldr_080CA5C0 - - thumb_func_start sub_8137C94 -sub_8137C94: @ 8137C94 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08137CAC - adds r0, r2, 0 - bl DestroyTask -_08137CAC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8137C94 - - thumb_func_start sub_8137CB4 -sub_8137CB4: @ 8137CB4 - push {lr} - ldr r0, =sub_8177888 - bl SetMainCallback2 - bl script_env_2_enable - pop {r0} - bx r0 - .pool - thumb_func_end sub_8137CB4 - - thumb_func_start Special_ViewWallClock -Special_ViewWallClock: @ 8137CC8 - push {lr} - ldr r0, =0x030022c0 - ldr r1, =c2_exit_to_overworld_2_switch - str r1, [r0, 0x8] - ldr r0, =Cb2_ViewWallClock - bl SetMainCallback2 - bl script_env_2_enable - pop {r0} - bx r0 - .pool - thumb_func_end Special_ViewWallClock - - thumb_func_start wild_pokemon_reroll -wild_pokemon_reroll: @ 8137CEC - ldr r0, =0x0203ab54 - movs r1, 0 - strb r1, [r0] - ldr r0, =0x0203ab55 - strb r1, [r0] - ldr r1, =0x0203ab58 - movs r0, 0 - str r0, [r1] - bx lr - .pool - thumb_func_end wild_pokemon_reroll - - thumb_func_start sub_8137D0C -sub_8137D0C: @ 8137D0C - ldr r1, =0x0203ab54 - movs r0, 0x1 - strb r0, [r1] - ldr r1, =0x0203ab55 - movs r0, 0 - strb r0, [r1] - ldr r1, =0x0203ab58 - ldr r0, =0x030022c0 - ldr r0, [r0, 0x20] - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8137D0C - - thumb_func_start sp0E3_walkrun_bitfield_interpretation -sp0E3_walkrun_bitfield_interpretation: @ 8137D34 - push {lr} - movs r0, 0x4 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - beq _08137D46 - movs r0, 0x1 - b _08137D58 -_08137D46: - movs r0, 0x2 - bl TestPlayerAvatarFlags - lsls r0, 24 - cmp r0, 0 - bne _08137D56 - movs r0, 0 - b _08137D58 -_08137D56: - movs r0, 0x2 -_08137D58: - pop {r1} - bx r1 - thumb_func_end sp0E3_walkrun_bitfield_interpretation - - thumb_func_start sub_8137D5C -sub_8137D5C: @ 8137D5C - push {r4-r7,lr} - adds r7, r0, 0 - lsls r1, 24 - lsrs r6, r1, 24 - cmp r6, 0x63 - bhi _08137D88 - ldr r4, =0x02021cc4 - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r1, =gUnknown_085EB5EE - adds r0, r4, 0 - bl AppendString - b _08137D90 - .pool -_08137D88: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EB5CF - bl CopyString -_08137D90: - ldr r0, =0x00000e0f - cmp r7, r0 - bhi _08137DF0 - ldr r4, =0x02021dc4 - adds r0, r7, 0 - movs r1, 0x3C - bl __udivsi3 - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - movs r0, 0xAD - strb r0, [r4, 0x2] - adds r5, r4, 0x3 - adds r0, r7, 0 - movs r1, 0x3C - bl __umodsi3 - movs r1, 0x64 - muls r0, r1 - movs r1, 0x3C - bl __udivsi3 - adds r1, r0, 0 - adds r0, r5, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r1, =gUnknown_085EB5E5 - adds r0, r4, 0 - bl AppendString - b _08137DF8 - .pool -_08137DF0: - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085EB5DA - bl CopyString -_08137DF8: - movs r4, 0 - cmp r6, 0 - bne _08137E0C - movs r4, 0x5 - b _08137E2A - .pool -_08137E0C: - cmp r6, 0x3 - bhi _08137E14 - movs r4, 0x4 - b _08137E2A -_08137E14: - cmp r6, 0x9 - bhi _08137E1C - movs r4, 0x3 - b _08137E2A -_08137E1C: - cmp r6, 0x13 - bhi _08137E24 - movs r4, 0x2 - b _08137E2A -_08137E24: - cmp r6, 0x63 - bhi _08137E2A - movs r4, 0x1 -_08137E2A: - adds r0, r7, 0 - movs r1, 0x3C - bl __udivsi3 - cmp r0, 0xA - bhi _08137E3A - adds r0, r4, 0x5 - b _08137E58 -_08137E3A: - cmp r0, 0xF - bhi _08137E42 - adds r0, r4, 0x4 - b _08137E58 -_08137E42: - cmp r0, 0x14 - bhi _08137E4A - adds r0, r4, 0x3 - b _08137E58 -_08137E4A: - cmp r0, 0x28 - bhi _08137E52 - adds r0, r4, 0x2 - b _08137E58 -_08137E52: - cmp r0, 0x3B - bhi _08137E5C - adds r0, r4, 0x1 -_08137E58: - lsls r0, 24 - lsrs r4, r0, 24 -_08137E5C: - ldr r0, =0x020375f0 - strh r4, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8137D5C - - thumb_func_start sub_8137E6C -sub_8137E6C: @ 8137E6C - push {r4,r5,lr} - ldr r0, =0x030022c0 - ldr r1, =0x0203ab58 - ldr r4, [r0, 0x20] - ldr r0, [r1] - subs r4, r0 - ldr r5, =0x0203ab55 - ldrb r1, [r5] - adds r0, r4, 0 - bl sub_8137D5C - ldrb r1, [r5] - adds r0, r4, 0 - bl sub_8137E9C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8137E6C - - thumb_func_start sub_8137E9C -sub_8137E9C: @ 8137E9C - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - ldr r6, =0x00004028 - adds r0, r6, 0 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r7, =0x00004029 - adds r0, r7, 0 - bl VarGet - lsls r0, 16 - adds r4, r0 - cmp r4, r5 - bhi _08137ECC - cmp r4, 0 - bne _08137EE6 -_08137ECC: - lsls r1, r5, 16 - lsrs r1, 16 - adds r0, r6, 0 - bl VarSet - lsrs r1, r5, 16 - adds r0, r7, 0 - bl VarSet - ldr r0, =0x00004027 - mov r1, r8 - bl VarSet -_08137EE6: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8137E9C - - thumb_func_start sub_8137EFC -sub_8137EFC: @ 8137EFC - push {r4,lr} - ldr r0, =0x00004028 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =0x00004029 - bl VarGet - lsls r0, 16 - adds r4, r0 - cmp r4, 0 - beq _08137F3C - ldr r0, =0x00004027 - bl VarGet - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_8137D5C - movs r0, 0x1 - b _08137F3E - .pool -_08137F3C: - movs r0, 0 -_08137F3E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8137EFC - - thumb_func_start sub_8137F44 -sub_8137F44: @ 8137F44 - push {r4,lr} - ldr r0, =0x020322dc - ldrh r1, [r0] - ldr r0, =0x00000c1d - cmp r1, r0 - beq _08137F7C - ldr r4, =0x000040a9 - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - beq _08137F6E - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x3 - bne _08137F7C -_08137F6E: - adds r0, r4, 0 - movs r1, 0 - bl VarSet - movs r0, 0 - bl sav1_set_battle_music_maybe -_08137F7C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8137F44 - - thumb_func_start sub_8137F90 -sub_8137F90: @ 8137F90 - push {lr} - ldr r0, =0x0000088d - bl FlagSet - ldr r0, =0x0000404a - bl GetVarPointer - movs r1, 0 - strh r1, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8137F90 - - thumb_func_start sub_8137FB0 -sub_8137FB0: @ 8137FB0 - push {lr} - ldr r0, =0x0000088d - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end sub_8137FB0 - - thumb_func_start sub_8137FC0 -sub_8137FC0: @ 8137FC0 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x0000088d - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08137FE6 - ldr r0, =0x0000404a - bl GetVarPointer - ldrh r1, [r0] - adds r1, r4, r1 - strh r1, [r0] - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0xCC - bhi _08137FF4 -_08137FE6: - movs r0, 0 - b _08137FF6 - .pool -_08137FF4: - movs r0, 0x1 -_08137FF6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8137FC0 - - thumb_func_start sub_8137FFC -sub_8137FFC: @ 8137FFC - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r0 - adds r5, r1, 0 - adds r6, r2, 0 - adds r7, r3, 0 - ldr r0, =0x0000404a - bl GetVarPointer - adds r4, r0, 0 - ldr r0, =0x000040b4 - bl GetVarPointer - ldrh r0, [r0] - subs r0, 0x1 - cmp r0, 0x9 - bhi _081380C2 - lsls r0, 2 - ldr r1, =_08138038 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08138038: - .4byte _08138060 - .4byte _08138070 - .4byte _08138064 - .4byte _08138068 - .4byte _08138068 - .4byte _0813806C - .4byte _08138098 - .4byte _08138060 - .4byte _08138064 - .4byte _0813806C -_08138060: - movs r0, 0x1 - b _081380CE -_08138064: - movs r0, 0x4 - b _081380CE -_08138068: - movs r0, 0x2 - b _081380CE -_0813806C: - movs r0, 0x3 - b _081380CE -_08138070: - ldrh r0, [r4] - cmp r0, 0x3B - bhi _08138080 - movs r0, 0x31 - strb r0, [r5] - ldrh r0, [r4] - adds r0, 0x13 - b _081380C0 -_08138080: - cmp r0, 0x8B - bhi _0813808E - movs r0, 0x30 - strb r0, [r5] - ldrh r0, [r4] - subs r0, 0x3C - b _081380C0 -_0813808E: - movs r0, 0x2F - strb r0, [r5] - ldrh r0, [r4] - subs r0, 0x8C - b _081380C0 -_08138098: - ldrh r0, [r4] - cmp r0, 0x41 - bhi _081380A8 - movs r0, 0x2F - strb r0, [r5] - ldrh r1, [r4] - movs r0, 0x41 - b _081380BE -_081380A8: - cmp r0, 0x91 - bhi _081380B6 - movs r0, 0x30 - strb r0, [r5] - ldrh r1, [r4] - movs r0, 0x91 - b _081380BE -_081380B6: - movs r0, 0x31 - strb r0, [r5] - ldrh r1, [r4] - movs r0, 0xE0 -_081380BE: - subs r0, r1 -_081380C0: - strh r0, [r6] -_081380C2: - movs r0, 0 - mov r1, r8 - strb r0, [r1] - movs r0, 0x14 - strh r0, [r7] - movs r0, 0 -_081380CE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8137FFC - - thumb_func_start is_tile_that_overrides_player_control -is_tile_that_overrides_player_control: @ 81380D8 - push {lr} - movs r0, 0x88 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0813810A - ldr r0, =0x02037318 - ldrb r0, [r0, 0x17] - cmp r0, 0x1 - blt _0813810A - cmp r0, 0x3 - ble _081380F6 - cmp r0, 0x6 - bne _0813810A -_081380F6: - ldr r0, =0x000040f2 - bl GetVarPointer - ldrh r1, [r0] - adds r1, 0x1 - strh r1, [r0] - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0xF9 - bhi _08138118 -_0813810A: - movs r0, 0 - b _0813811A - .pool -_08138118: - movs r0, 0x1 -_0813811A: - pop {r1} - bx r1 - thumb_func_end is_tile_that_overrides_player_control - - thumb_func_start sub_8138120 -sub_8138120: @ 8138120 - push {lr} - movs r0, 0x8A - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08138152 - ldr r0, =0x02037318 - ldrb r0, [r0, 0x17] - cmp r0, 0x1 - blt _08138152 - cmp r0, 0x3 - ble _0813813E - cmp r0, 0x6 - bne _08138152 -_0813813E: - ldr r0, =0x000040f3 - bl GetVarPointer - ldrh r1, [r0] - adds r1, 0x1 - strh r1, [r0] - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0x9 - bhi _08138160 -_08138152: - movs r0, 0 - b _08138162 - .pool -_08138160: - movs r0, 0x1 -_08138162: - pop {r1} - bx r1 - thumb_func_end sub_8138120 - - thumb_func_start sub_8138168 -sub_8138168: @ 8138168 - push {lr} - movs r0, 0x72 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0813819A - ldr r0, =0x02037318 - ldrb r0, [r0, 0x17] - cmp r0, 0x1 - blt _0813819A - cmp r0, 0x3 - ble _08138186 - cmp r0, 0x6 - bne _0813819A -_08138186: - ldr r0, =0x000040f5 - bl GetVarPointer - ldrh r1, [r0] - adds r1, 0x1 - strh r1, [r0] - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0x9 - bhi _081381A8 -_0813819A: - movs r0, 0 - b _081381AA - .pool -_081381A8: - movs r0, 0x1 -_081381AA: - pop {r1} - bx r1 - thumb_func_end sub_8138168 - - thumb_func_start sub_81381B0 -sub_81381B0: @ 81381B0 - push {lr} - movs r0, 0x80 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _081381E2 - ldr r0, =0x02037318 - ldrb r0, [r0, 0x17] - cmp r0, 0x1 - blt _081381E2 - cmp r0, 0x3 - ble _081381CE - cmp r0, 0x6 - bne _081381E2 -_081381CE: - ldr r0, =0x000040f4 - bl GetVarPointer - ldrh r1, [r0] - adds r1, 0x1 - strh r1, [r0] - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0xF9 - bhi _081381F0 -_081381E2: - movs r0, 0 - b _081381F2 - .pool -_081381F0: - movs r0, 0x1 -_081381F2: - pop {r1} - bx r1 - thumb_func_end sub_81381B0 - - thumb_func_start sub_81381F8 -sub_81381F8: @ 81381F8 - push {lr} - movs r0, 0x75 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0813822A - ldr r0, =0x02037318 - ldrb r0, [r0, 0x17] - cmp r0, 0x1 - blt _0813822A - cmp r0, 0x3 - ble _08138216 - cmp r0, 0x6 - bne _0813822A -_08138216: - ldr r0, =0x000040f6 - bl GetVarPointer - ldrh r1, [r0] - adds r1, 0x1 - strh r1, [r0] - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0xF9 - bhi _08138238 -_0813822A: - movs r0, 0 - b _0813823A - .pool -_08138238: - movs r0, 0x1 -_0813823A: - pop {r1} - bx r1 - thumb_func_end sub_81381F8 - - thumb_func_start sub_8138240 -sub_8138240: @ 8138240 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r6, 0 - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r7, r0, 24 - bl sub_8009FCC - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - cmp r4, r5 - bcs _0813828A - ldr r0, =gUnknown_0858D144 - mov r8, r0 -_08138262: - cmp r7, r4 - beq _08138280 - lsls r0, r6, 2 - add r0, r8 - ldr r0, [r0] - lsls r1, r4, 3 - subs r1, r4 - lsls r1, 2 - ldr r2, =0x020229f0 - adds r1, r2 - bl CopyString - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_08138280: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _08138262 -_0813828A: - adds r0, r5, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8138240 - - thumb_func_start SpawnLinkPartnerFieldObject -SpawnLinkPartnerFieldObject: @ 81382A0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - movs r7, 0 - movs r0, 0 - mov r9, r0 - mov r8, r0 - ldr r1, =gUnknown_085B2B5C - add r0, sp, 0x8 - movs r2, 0x4 - bl memcpy - add r4, sp, 0xC - ldr r1, =gUnknown_085B2B60 - adds r0, r4, 0 - movs r2, 0x8 - bl memcpy - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x2 - beq _08138310 - cmp r0, 0x2 - bgt _081382F4 - cmp r0, 0x1 - beq _0813833C - b _08138350 - .pool -_081382F4: - cmp r1, 0x3 - beq _081382FE - cmp r1, 0x4 - beq _08138324 - b _08138350 -_081382FE: - movs r7, 0x2 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldrh r0, [r1] - subs r0, 0x1 - b _0813832C - .pool -_08138310: - movs r7, 0x1 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0] - mov r9, r1 - ldrh r0, [r0, 0x2] - subs r0, 0x1 - b _0813834A - .pool -_08138324: - ldr r0, =0x03005d8c - ldr r1, [r0] - ldrh r0, [r1] - adds r0, 0x1 -_0813832C: - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - ldrh r1, [r1, 0x2] - mov r8, r1 - b _08138350 - .pool -_0813833C: - movs r7, 0x3 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r3, [r0] - mov r9, r3 - ldrh r0, [r0, 0x2] - adds r0, 0x1 -_0813834A: - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 -_08138350: - movs r6, 0 - b _08138410 - .pool -_08138358: - cmp r10, r6 - beq _0813840A - ldr r0, =0x020229e8 - lsls r2, r6, 3 - subs r1, r2, r6 - lsls r1, 2 - adds r1, r0 - ldrb r3, [r1] - adds r4, r0, 0 - cmp r3, 0x1 - blt _0813838C - cmp r3, 0x2 - ble _0813837C - cmp r3, 0x3 - beq _08138388 - b _0813838C - .pool -_0813837C: - ldrb r0, [r1, 0x13] - movs r5, 0xEC - cmp r0, 0 - bne _0813839C - movs r5, 0xEB - b _0813839C -_08138388: - ldrb r0, [r1, 0x13] - b _08138394 -_0813838C: - subs r0, r2, r6 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x13] -_08138394: - movs r5, 0x69 - cmp r0, 0 - bne _0813839C - movs r5, 0x64 -_0813839C: - mov r0, sp - adds r0, r7 - adds r0, 0x8 - ldrb r1, [r0] - movs r4, 0xF0 - subs r4, r6 - lsls r4, 24 - lsrs r4, 24 - lsls r2, r7, 1 - mov r0, sp - adds r0, r2 - adds r0, 0xC - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - mov r3, r9 - lsls r3, 16 - asrs r3, 16 - mov r12, r3 - add r0, r12 - adds r3, r0, 0x7 - lsls r3, 16 - asrs r3, 16 - mov r12, r3 - mov r0, sp - adds r0, 0xD - adds r0, r2 - movs r2, 0 - ldrsb r2, [r0, r2] - mov r3, r8 - lsls r0, r3, 16 - asrs r0, 16 - adds r0, r2 - adds r0, 0x7 - lsls r0, 16 - asrs r0, 16 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - adds r0, r5, 0 - adds r2, r4, 0 - mov r3, r12 - bl SpawnSpecialFieldObjectParametrized - adds r0, r5, 0 - adds r1, r4, 0 - adds r2, r6, 0 - bl sub_813842C - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x4 - bne _0813840A - movs r7, 0 -_0813840A: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_08138410: - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r6, r0 - bcc _08138358 - 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 SpawnLinkPartnerFieldObject - - thumb_func_start sub_813842C -sub_813842C: @ 813842C - push {r4,r5,lr} - lsls r0, 24 - lsls r1, 24 - lsrs r3, r1, 24 - lsls r2, 24 - movs r1, 0xC0 - lsls r1, 19 - adds r2, r1 - lsrs r5, r2, 24 - lsrs r4, r0, 24 - movs r2, 0xA8 - lsls r2, 21 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0x1 - bls _08138454 - cmp r4, 0x64 - beq _08138454 - cmp r4, 0x69 - bne _081384E6 -_08138454: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrb r1, [r0, 0x5] - ldrb r2, [r0, 0x4] - adds r0, r3, 0 - bl GetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x10 - beq _081384E6 - ldr r1, =0x02037350 - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - lsls r3, r5, 4 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x5] - cmp r4, 0x69 - beq _081384D8 - cmp r4, 0x69 - bgt _081384A8 - cmp r4, 0x64 - beq _081384C4 - b _081384E6 - .pool -_081384A8: - cmp r4, 0xEB - beq _081384B2 - cmp r4, 0xEC - beq _081384BC - b _081384E6 -_081384B2: - ldr r0, =gFieldObjectPalette33 - b _081384C6 - .pool -_081384BC: - ldr r0, =gFieldObjectPalette34 - b _081384C6 - .pool -_081384C4: - ldr r0, =gFieldObjectPalette8 -_081384C6: - movs r2, 0x80 - lsls r2, 1 - adds r1, r3, r2 - movs r2, 0x20 - bl gpu_pal_apply - b _081384E6 - .pool -_081384D8: - ldr r0, =gFieldObjectPalette17 - movs r2, 0x80 - lsls r2, 1 - adds r1, r3, r2 - movs r2, 0x20 - bl gpu_pal_apply -_081384E6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813842C - - thumb_func_start sub_81384F0 -sub_81384F0: @ 81384F0 - push {r4,r5,lr} - movs r4, 0 - ldr r5, =gUnknown_085B2B68 -_081384F6: - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r4, r0 - bne _0813851C - lsls r1, r4, 2 - adds r1, r5 - ldrb r0, [r1] - ldrb r1, [r1, 0x1] - ldr r2, =0x00000206 - bl MapGridSetMetatileIdAt - b _0813852A - .pool -_0813851C: - lsls r1, r4, 2 - adds r1, r5 - ldrb r0, [r1] - ldrb r1, [r1, 0x1] - ldr r2, =0x00000205 - bl MapGridSetMetatileIdAt -_0813852A: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _081384F6 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81384F0 - - thumb_func_start sub_8138540 -sub_8138540: @ 8138540 - push {r4-r6,lr} - movs r5, 0xC -_08138544: - movs r4, 0x7 - adds r6, r5, 0x1 -_08138548: - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridGetMetatileIdAt - ldr r1, =0xfffffde6 - adds r0, r1 - cmp r0, 0x37 - bls _0813855A - b _08138734 -_0813855A: - lsls r0, 2 - ldr r1, =_0813856C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0813856C: - .4byte _081386F2 - .4byte _08138734 - .4byte _08138734 - .4byte _08138734 - .4byte _08138734 - .4byte _08138734 - .4byte _0813864C - .4byte _08138652 - .4byte _0813868C - .4byte _08138694 - .4byte _08138734 - .4byte _08138734 - .4byte _08138734 - .4byte _08138734 - .4byte _0813865C - .4byte _08138662 - .4byte _0813869C - .4byte _081386A4 - .4byte _08138734 - .4byte _08138734 - .4byte _08138734 - .4byte _08138734 - .4byte _0813866C - .4byte _08138672 - .4byte _081386AC - .4byte _081386B4 - .4byte _08138734 - .4byte _08138734 - .4byte _08138734 - .4byte _08138734 - .4byte _0813867C - .4byte _08138684 - .4byte _081386BC - .4byte _081386C4 - .4byte _08138734 - .4byte _08138734 - .4byte _08138734 - .4byte _08138734 - .4byte _081386CC - .4byte _081386DC - .4byte _081386EC - .4byte _08138714 - .4byte _08138734 - .4byte _08138734 - .4byte _08138734 - .4byte _08138734 - .4byte _081386D4 - .4byte _081386E4 - .4byte _08138734 - .4byte _08138734 - .4byte _08138734 - .4byte _08138734 - .4byte _08138734 - .4byte _08138734 - .4byte _0813872A - .4byte _0813871C -_0813864C: - movs r2, 0x8C - lsls r2, 2 - b _08138720 -_08138652: - ldr r2, =0x00000231 - b _08138720 - .pool -_0813865C: - movs r2, 0x8E - lsls r2, 2 - b _08138720 -_08138662: - ldr r2, =0x00000239 - b _08138720 - .pool -_0813866C: - movs r2, 0x88 - lsls r2, 2 - b _08138720 -_08138672: - ldr r2, =0x00000221 - b _08138720 - .pool -_0813867C: - ldr r2, =0x00000e28 - b _08138720 - .pool -_08138684: - ldr r2, =0x00000e29 - b _08138720 - .pool -_0813868C: - ldr r2, =0x00000232 - b _08138720 - .pool -_08138694: - ldr r2, =0x00000233 - b _08138720 - .pool -_0813869C: - ldr r2, =0x0000023a - b _08138720 - .pool -_081386A4: - ldr r2, =0x0000023b - b _08138720 - .pool -_081386AC: - ldr r2, =0x00000222 - b _08138720 - .pool -_081386B4: - ldr r2, =0x00000223 - b _08138720 - .pool -_081386BC: - ldr r2, =0x00000e2a - b _08138720 - .pool -_081386C4: - ldr r2, =0x00000e2b - b _08138720 - .pool -_081386CC: - ldr r2, =0x00000e42 - b _08138720 - .pool -_081386D4: - ldr r2, =0x0000021a - b _08138720 - .pool -_081386DC: - ldr r2, =0x00000e43 - b _08138720 - .pool -_081386E4: - ldr r2, =0x0000021a - b _08138720 - .pool -_081386EC: - movs r2, 0xE4 - lsls r2, 4 - b _08138720 -_081386F2: - subs r1, r5, 0x1 - adds r0, r4, 0 - bl MapGridGetMetatileIdAt - movs r1, 0x90 - lsls r1, 2 - cmp r0, r1 - bne _0813870C - ldr r2, =0x00000e48 - b _08138720 - .pool -_0813870C: - ldr r2, =0x00000e49 - b _08138720 - .pool -_08138714: - ldr r2, =0x00000e41 - b _08138720 - .pool -_0813871C: - movs r2, 0xE5 - lsls r2, 4 -_08138720: - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridSetMetatileIdAt - b _08138734 -_0813872A: - ldr r2, =0x00000251 - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridSetMetatileIdAt -_08138734: - adds r4, 0x1 - cmp r4, 0xF - bgt _0813873C - b _08138548 -_0813873C: - adds r5, r6, 0 - cmp r5, 0x17 - bgt _08138744 - b _08138544 -_08138744: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8138540 - - thumb_func_start sub_8138750 -sub_8138750: @ 8138750 - push {r4-r6,lr} - ldr r4, =gUnknown_085B2B68 - movs r5, 0x3 -_08138756: - ldrb r0, [r4] - ldrb r1, [r4, 0x1] - ldr r2, =0x00000206 - bl MapGridSetMetatileIdAt - adds r4, 0x4 - subs r5, 0x1 - cmp r5, 0 - bge _08138756 - movs r5, 0xC -_0813876A: - movs r4, 0x7 - adds r6, r5, 0x1 -_0813876E: - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridGetMetatileIdAt - ldr r1, =0xfffffde0 - adds r0, r1 - cmp r0, 0x30 - bls _08138780 - b _081388CA -_08138780: - lsls r0, 2 - ldr r1, =_0813879C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0813879C: - .4byte _08138860 - .4byte _08138866 - .4byte _08138880 - .4byte _08138888 - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _08138870 - .4byte _08138876 - .4byte _08138890 - .4byte _08138898 - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388A0 - .4byte _081388A8 - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388B0 - .4byte _081388B0 - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388CA - .4byte _081388C0 -_08138860: - movs r2, 0x8C - lsls r2, 2 - b _081388B2 -_08138866: - ldr r2, =0x00000231 - b _081388B2 - .pool -_08138870: - movs r2, 0x8E - lsls r2, 2 - b _081388B2 -_08138876: - ldr r2, =0x00000239 - b _081388B2 - .pool -_08138880: - ldr r2, =0x00000232 - b _081388B2 - .pool -_08138888: - ldr r2, =0x00000233 - b _081388B2 - .pool -_08138890: - ldr r2, =0x0000023a - b _081388B2 - .pool -_08138898: - ldr r2, =0x0000023b - b _081388B2 - .pool -_081388A0: - ldr r2, =0x00000e42 - b _081388B2 - .pool -_081388A8: - ldr r2, =0x00000e43 - b _081388B2 - .pool -_081388B0: - ldr r2, =0x0000021a -_081388B2: - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridSetMetatileIdAt - b _081388CA - .pool -_081388C0: - ldr r2, =0x00000251 - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridSetMetatileIdAt -_081388CA: - adds r4, 0x1 - cmp r4, 0xF - bgt _081388D2 - b _0813876E -_081388D2: - adds r5, r6, 0 - cmp r5, 0x17 - bgt _081388DA - b _0813876A -_081388DA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8138750 - - thumb_func_start sub_81388E4 -sub_81388E4: @ 81388E4 - push {lr} - ldr r0, =0x0203ab5c - movs r1, 0 - strb r1, [r0] - ldr r0, =0x0203ab5d - strb r1, [r0] - movs r0, 0x2C - bl audio_play - ldr r0, =sub_8138910 - movs r1, 0x8 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81388E4 - - thumb_func_start sub_8138910 -sub_8138910: @ 8138910 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gUnknown_085B2B78 - ldr r5, =0x0203ab5d - ldrb r1, [r5] - adds r0, r1, r0 - ldr r4, =0x0203ab5c - ldrb r2, [r4] - ldrb r0, [r0] - cmp r0, r2 - bne _0813896C - ldr r0, =0x020375e0 - ldrb r0, [r0] - ldr r2, =gUnknown_085B2B7E - lsls r1, 1 - adds r1, r2 - ldrh r1, [r1] - bl sub_8138978 - movs r0, 0 - strb r0, [r4] - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bne _08138970 - adds r0, r6, 0 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running - b _08138970 - .pool -_0813896C: - adds r0, r2, 0x1 - strb r0, [r4] -_08138970: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8138910 - - thumb_func_start sub_8138978 -sub_8138978: @ 8138978 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r2, r1, 16 - movs r7, 0 - subs r0, 0x1 - cmp r0, 0x7 - bhi _08138A40 - lsls r0, 2 - ldr r1, =_081389A0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081389A0: - .4byte _081389C0 - .4byte _081389D2 - .4byte _081389E4 - .4byte _081389F6 - .4byte _08138A04 - .4byte _08138A1A - .4byte _08138A26 - .4byte _08138A34 -_081389C0: - movs r7, 0x2 - mov r1, sp - movs r0, 0x1 - strh r0, [r1] - movs r0, 0x7 - strh r0, [r1, 0x2] - add r1, sp, 0x8 - movs r0, 0x68 - b _08138A14 -_081389D2: - movs r7, 0x2 - mov r1, sp - movs r0, 0x1 - strh r0, [r1] - movs r0, 0x7 - strh r0, [r1, 0x2] - add r1, sp, 0x8 - movs r0, 0x4E - b _08138A14 -_081389E4: - movs r7, 0x2 - mov r1, sp - movs r0, 0x1 - strh r0, [r1] - movs r0, 0x7 - strh r0, [r1, 0x2] - add r1, sp, 0x8 - movs r0, 0x5B - b _08138A14 -_081389F6: - movs r7, 0x1 - mov r1, sp - movs r0, 0x7 - strh r0, [r1] - add r1, sp, 0x8 - movs r0, 0x27 - b _08138A3E -_08138A04: - movs r7, 0x2 - mov r1, sp - movs r0, 0x1 - strh r0, [r1] - movs r0, 0x7 - strh r0, [r1, 0x2] - add r1, sp, 0x8 - movs r0, 0x34 -_08138A14: - strh r0, [r1] - strh r0, [r1, 0x2] - b _08138A40 -_08138A1A: - movs r7, 0x1 - mov r0, sp - strh r7, [r0] - add r1, sp, 0x8 - movs r0, 0x41 - b _08138A3E -_08138A26: - movs r7, 0x1 - mov r1, sp - movs r0, 0x7 - strh r0, [r1] - add r1, sp, 0x8 - movs r0, 0xD - b _08138A3E -_08138A34: - movs r7, 0x1 - mov r0, sp - strh r7, [r0] - add r1, sp, 0x8 - movs r0, 0x1A -_08138A3E: - strh r0, [r1] -_08138A40: - movs r6, 0 - cmp r6, r7 - bcs _08138A92 - movs r1, 0xC0 - lsls r1, 4 - adds r0, r1, 0 - adds r1, r2, 0 - orrs r1, r0 - lsls r1, 16 - mov r9, r1 - adds r1, r2, 0 - adds r1, 0x8 - orrs r1, r0 - lsls r1, 16 - mov r8, r1 -_08138A5E: - lsls r1, r6, 1 - mov r3, sp - adds r5, r3, r1 - ldrh r0, [r5] - adds r0, 0x7 - add r4, sp, 0x8 - adds r4, r1 - ldrh r1, [r4] - adds r1, 0x7 - mov r3, r9 - lsrs r2, r3, 16 - bl MapGridSetMetatileIdAt - ldrh r0, [r5] - adds r0, 0x7 - ldrh r1, [r4] - adds r1, 0x8 - mov r3, r8 - lsrs r2, r3, 16 - bl MapGridSetMetatileIdAt - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, r7 - bcc _08138A5E -_08138A92: - bl DrawWholeMapView - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8138978 - - thumb_func_start sub_8138AA4 -sub_8138AA4: @ 8138AA4 - push {lr} - ldr r0, =0x020375e0 - ldrb r0, [r0] - ldr r1, =gUnknown_085B2B7E - ldrh r1, [r1, 0x8] - bl sub_8138978 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8138AA4 - - thumb_func_start sub_8138AC0 -sub_8138AC0: @ 8138AC0 - push {lr} - ldr r0, =0x02021fc4 - bl box_related_two__2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8138AC0 - - thumb_func_start sub_8138AD0 -sub_8138AD0: @ 8138AD0 - ldr r1, =0x020375e0 - ldr r0, =0x03005d8c - ldr r2, [r0] - ldrh r0, [r2] - strh r0, [r1] - ldr r1, =0x020375e2 - ldrh r0, [r2, 0x2] - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_8138AD0 - - thumb_func_start sub_8138AF0 -sub_8138AF0: @ 8138AF0 - push {lr} - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r1, [r0, 0xB] - lsls r1, 8 - ldrb r0, [r0, 0xA] - orrs r0, r1 - movs r1, 0xA - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8138AF0 - - thumb_func_start sub_8138B10 -sub_8138B10: @ 8138B10 - push {lr} - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _08138B34 - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EB5F9 - bl CopyString - b _08138B3C - .pool -_08138B34: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EB601 - bl CopyString -_08138B3C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8138B10 - - thumb_func_start sub_8138B48 -sub_8138B48: @ 8138B48 - push {lr} - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _08138B6C - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EB60E - bl CopyString - b _08138B74 - .pool -_08138B6C: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EB60A - bl CopyString -_08138B74: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8138B48 - - thumb_func_start sub_8138B80 -sub_8138B80: @ 8138B80 - ldr r0, =0x0202433a - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8138B80 - - thumb_func_start sub_8138B8C -sub_8138B8C: @ 8138B8C - push {lr} - sub sp, 0x4 - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0 - beq _08138BB0 - movs r2, 0x1 - negs r2, r2 - movs r0, 0x4 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r3, 0x6 - bl warp1_set - b _08138BC2 - .pool -_08138BB0: - movs r2, 0x1 - negs r2, r2 - movs r0, 0x4 - str r0, [sp] - movs r0, 0x13 - movs r1, 0x1 - movs r3, 0x6 - bl warp1_set -_08138BC2: - add sp, 0x4 - pop {r0} - bx r0 - thumb_func_end sub_8138B8C - - thumb_func_start sub_8138BC8 -sub_8138BC8: @ 8138BC8 - push {lr} - ldr r0, =0x020375e0 - ldrh r0, [r0] - bl FlagSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_8138BC8 - - thumb_func_start sub_8138BDC -sub_8138BDC: @ 8138BDC - push {lr} - ldr r0, =0x03005cf8 - movs r1, 0 - ldrsh r0, [r0, r1] - movs r1, 0x7 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x0000270f - cmp r0, r1 - bls _08138BF6 - adds r0, r1, 0 -_08138BF6: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8138BDC - - thumb_func_start sub_8138C04 -sub_8138C04: @ 8138C04 - push {r4,lr} - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x20 - bl pokemon_getattr - cmp r0, 0xFF - bne _08138C2C - movs r0, 0x6 - b _08138C7E - .pool -_08138C2C: - adds r0, r4, 0 - movs r1, 0x20 - bl pokemon_getattr - cmp r0, 0xC7 - bls _08138C3C - movs r0, 0x5 - b _08138C7E -_08138C3C: - adds r0, r4, 0 - movs r1, 0x20 - bl pokemon_getattr - cmp r0, 0x95 - bls _08138C4C - movs r0, 0x4 - b _08138C7E -_08138C4C: - adds r0, r4, 0 - movs r1, 0x20 - bl pokemon_getattr - cmp r0, 0x63 - bls _08138C5C - movs r0, 0x3 - b _08138C7E -_08138C5C: - adds r0, r4, 0 - movs r1, 0x20 - bl pokemon_getattr - cmp r0, 0x31 - bls _08138C6C - movs r0, 0x2 - b _08138C7E -_08138C6C: - adds r0, r4, 0 - movs r1, 0x20 - bl pokemon_getattr - cmp r0, 0 - bne _08138C7C - movs r0, 0 - b _08138C7E -_08138C7C: - movs r0, 0x1 -_08138C7E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8138C04 - - thumb_func_start sub_8138C84 -sub_8138C84: @ 8138C84 - push {lr} - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl sub_817018C - pop {r0} - bx r0 - .pool - thumb_func_end sub_8138C84 - - thumb_func_start sub_8138C94 -sub_8138C94: @ 8138C94 - push {lr} - ldr r0, =sub_8138C84 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8138C94 - - thumb_func_start sp0D9_ComputerRelated -sp0D9_ComputerRelated: @ 8138CA4 - push {r4,lr} - ldr r4, =sub_8138CE8 - adds r0, r4, 0 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08138CD8 - adds r0, r4, 0 - movs r1, 0x8 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0 - strh r2, [r1, 0x8] - strh r0, [r1, 0xA] - strh r2, [r1, 0xC] - strh r2, [r1, 0xE] - strh r2, [r1, 0x10] -_08138CD8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sp0D9_ComputerRelated - - thumb_func_start sub_8138CE8 -sub_8138CE8: @ 8138CE8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r1, r0 - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _08138D06 - adds r0, r1, 0 - bl sub_8138D10 -_08138D06: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8138CE8 - - thumb_func_start sub_8138D10 -sub_8138D10: @ 8138D10 - push {r4-r6,lr} - adds r4, r0, 0 - movs r6, 0 - movs r5, 0 - movs r1, 0xE - ldrsh r0, [r4, r1] - cmp r0, 0x6 - bne _08138D7C - strh r5, [r4, 0xE] - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x3 - beq _08138D44 - cmp r0, 0x3 - bgt _08138D3A - cmp r0, 0x2 - beq _08138D40 - b _08138D4C -_08138D3A: - cmp r1, 0x4 - beq _08138D48 - b _08138D4C -_08138D40: - movs r6, 0 - b _08138D4A -_08138D44: - movs r6, 0xFF - b _08138D4A -_08138D48: - movs r6, 0x1 -_08138D4A: - movs r5, 0xFF -_08138D4C: - movs r1, 0x10 - ldrsh r0, [r4, r1] - lsls r1, r6, 24 - asrs r1, 24 - lsls r2, r5, 24 - asrs r2, 24 - bl sub_8138D88 - bl DrawWholeMapView - ldrh r0, [r4, 0x10] - movs r1, 0x1 - eors r0, r1 - strh r0, [r4, 0x10] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _08138D7C - ldrb r0, [r4, 0xA] - bl DestroyTask -_08138D7C: - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8138D10 - - thumb_func_start sub_8138D88 -sub_8138D88: @ 8138D88 - push {r4,r5,lr} - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r4, r2, 24 - movs r3, 0 - lsls r0, 16 - cmp r0, 0 - beq _08138DC4 - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0 - bne _08138DAC - movs r3, 0x4 - b _08138DE6 - .pool -_08138DAC: - cmp r0, 0x1 - bne _08138DB8 - ldr r3, =0x0000025a - b _08138DE6 - .pool -_08138DB8: - cmp r0, 0x2 - bne _08138DE6 - ldr r3, =0x00000259 - b _08138DE6 - .pool -_08138DC4: - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0 - bne _08138DD4 - movs r3, 0x5 - b _08138DE6 - .pool -_08138DD4: - cmp r0, 0x1 - bne _08138DE0 - ldr r3, =0x0000027f - b _08138DE6 - .pool -_08138DE0: - cmp r0, 0x2 - bne _08138DE6 - ldr r3, =0x0000027e -_08138DE6: - ldr r0, =0x03005d8c - ldr r2, [r0] - movs r5, 0 - ldrsh r0, [r2, r5] - lsls r1, 24 - asrs r1, 24 - adds r0, r1 - adds r0, 0x7 - movs r5, 0x2 - ldrsh r1, [r2, r5] - lsls r2, r4, 24 - asrs r2, 24 - adds r1, r2 - adds r1, 0x7 - movs r4, 0xC0 - lsls r4, 4 - adds r2, r4, 0 - orrs r3, r2 - adds r2, r3, 0 - bl MapGridSetMetatileIdAt - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8138D88 - - thumb_func_start sub_8138E20 -sub_8138E20: @ 8138E20 - push {lr} - bl sub_8138E2C - pop {r0} - bx r0 - thumb_func_end sub_8138E20 - - thumb_func_start sub_8138E2C -sub_8138E2C: @ 8138E2C - push {r4-r6,lr} - movs r6, 0 - movs r5, 0 - movs r4, 0 - bl player_get_direction_lower_nybble - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x3 - beq _08138E56 - cmp r0, 0x3 - bgt _08138E4C - cmp r0, 0x2 - beq _08138E52 - b _08138E5E -_08138E4C: - cmp r1, 0x4 - beq _08138E5A - b _08138E5E -_08138E52: - movs r6, 0 - b _08138E5C -_08138E56: - movs r6, 0xFF - b _08138E5C -_08138E5A: - movs r6, 0x1 -_08138E5C: - movs r5, 0xFF -_08138E5E: - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0 - bne _08138E70 - movs r4, 0x4 - b _08138E82 - .pool -_08138E70: - cmp r0, 0x1 - bne _08138E7C - ldr r4, =0x0000025a - b _08138E82 - .pool -_08138E7C: - cmp r0, 0x2 - bne _08138E82 - ldr r4, =0x00000259 -_08138E82: - ldr r0, =0x03005d8c - ldr r2, [r0] - movs r1, 0 - ldrsh r0, [r2, r1] - lsls r1, r6, 24 - asrs r1, 24 - adds r0, r1 - adds r0, 0x7 - movs r3, 0x2 - ldrsh r1, [r2, r3] - lsls r2, r5, 24 - asrs r2, 24 - adds r1, r2 - adds r1, 0x7 - movs r3, 0xC0 - lsls r3, 4 - adds r2, r3, 0 - orrs r4, r2 - adds r2, r4, 0 - bl MapGridSetMetatileIdAt - bl DrawWholeMapView - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8138E2C - - thumb_func_start sub_8138EC0 -sub_8138EC0: @ 8138EC0 - push {r4,lr} - ldr r4, =sub_8138F04 - adds r0, r4, 0 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08138EF4 - adds r0, r4, 0 - movs r1, 0x8 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0 - strh r2, [r1, 0x8] - strh r0, [r1, 0xA] - strh r2, [r1, 0xC] - strh r2, [r1, 0xE] - strh r2, [r1, 0x10] -_08138EF4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8138EC0 - - thumb_func_start sub_8138F04 -sub_8138F04: @ 8138F04 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r1, r0 - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _08138F22 - adds r0, r1, 0 - bl sub_8138F2C -_08138F22: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8138F04 - - thumb_func_start sub_8138F2C -sub_8138F2C: @ 8138F2C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0xE - ldrsh r0, [r4, r1] - cmp r0, 0x6 - bne _08138F9A - movs r0, 0 - strh r0, [r4, 0xE] - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _08138F64 - ldr r2, =0x00000e9d - movs r0, 0x12 - movs r1, 0x8 - bl MapGridSetMetatileIdAt - ldr r2, =0x00000ea5 - movs r0, 0x12 - movs r1, 0x9 - bl MapGridSetMetatileIdAt - b _08138F7A - .pool -_08138F64: - ldr r2, =0x00000e58 - movs r0, 0x12 - movs r1, 0x8 - bl MapGridSetMetatileIdAt - movs r2, 0xE6 - lsls r2, 4 - movs r0, 0x12 - movs r1, 0x9 - bl MapGridSetMetatileIdAt -_08138F7A: - bl DrawWholeMapView - ldrh r0, [r4, 0x10] - movs r1, 0x1 - eors r0, r1 - strh r0, [r4, 0x10] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _08138F9A - ldrb r0, [r4, 0xA] - bl DestroyTask -_08138F9A: - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8138F2C - - thumb_func_start sub_8138FAC -sub_8138FAC: @ 8138FAC - push {lr} - ldr r2, =0x00000e9d - movs r0, 0x12 - movs r1, 0x8 - bl MapGridSetMetatileIdAt - ldr r2, =0x00000ea5 - movs r0, 0x12 - movs r1, 0x9 - bl MapGridSetMetatileIdAt - bl DrawWholeMapView - pop {r0} - bx r0 - .pool - thumb_func_end sub_8138FAC - - thumb_func_start sub_8138FD4 -sub_8138FD4: @ 8138FD4 - push {lr} - ldr r1, =0x020375e0 - ldr r0, =0x000001f5 - strh r0, [r1] - bl FlagSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_8138FD4 - - thumb_func_start sub_8138FEC -sub_8138FEC: @ 8138FEC - push {lr} - ldr r1, =0x020375e0 - ldr r0, =0x000001f5 - strh r0, [r1] - bl FlagReset - pop {r0} - bx r0 - .pool - thumb_func_end sub_8138FEC - - thumb_func_start sub_8139004 -sub_8139004: @ 8139004 - push {lr} - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x16 - bl pokemon_getattr - cmp r0, 0xC7 - bls _08139028 - movs r0, 0x1 - b _0813902A - .pool -_08139028: - movs r0, 0 -_0813902A: - pop {r1} - bx r1 - thumb_func_end sub_8139004 - - thumb_func_start sub_8139030 -sub_8139030: @ 8139030 - push {lr} - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x17 - bl pokemon_getattr - cmp r0, 0xC7 - bls _08139054 - movs r0, 0x1 - b _08139056 - .pool -_08139054: - movs r0, 0 -_08139056: - pop {r1} - bx r1 - thumb_func_end sub_8139030 - - thumb_func_start sub_813905C -sub_813905C: @ 813905C - push {lr} - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x18 - bl pokemon_getattr - cmp r0, 0xC7 - bls _08139080 - movs r0, 0x1 - b _08139082 - .pool -_08139080: - movs r0, 0 -_08139082: - pop {r1} - bx r1 - thumb_func_end sub_813905C - - thumb_func_start sub_8139088 -sub_8139088: @ 8139088 - push {lr} - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x21 - bl pokemon_getattr - cmp r0, 0xC7 - bls _081390AC - movs r0, 0x1 - b _081390AE - .pool -_081390AC: - movs r0, 0 -_081390AE: - pop {r1} - bx r1 - thumb_func_end sub_8139088 - - thumb_func_start sub_81390B4 -sub_81390B4: @ 81390B4 - push {lr} - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2F - bl pokemon_getattr - cmp r0, 0xC7 - bls _081390D8 - movs r0, 0x1 - b _081390DA - .pool -_081390D8: - movs r0, 0 -_081390DA: - pop {r1} - bx r1 - thumb_func_end sub_81390B4 - - thumb_func_start sub_81390E0 -sub_81390E0: @ 81390E0 - push {r4-r6,lr} - movs r5, 0 - ldr r6, =gBaseStats -_081390E6: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x5 - bl pokemon_getattr - cmp r0, 0 - beq _0813913C - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0813913C - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r1, 0x6] - cmp r0, 0xC - beq _08139128 - ldrb r0, [r1, 0x7] - cmp r0, 0xC - bne _0813913C -_08139128: - ldr r1, =0x020375f0 - movs r0, 0x1 - b _0813914A - .pool -_0813913C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _081390E6 - ldr r1, =0x020375f0 - movs r0, 0 -_0813914A: - strh r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81390E0 - - thumb_func_start SpawnScriptFieldObject -SpawnScriptFieldObject: @ 8139158 - push {lr} - sub sp, 0x8 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r3, [r0] - adds r3, 0x7 - lsls r3, 16 - asrs r3, 16 - ldrh r0, [r0, 0x2] - adds r0, 0x7 - lsls r0, 16 - asrs r0, 16 - str r0, [sp] - movs r0, 0x3 - str r0, [sp, 0x4] - movs r0, 0x7 - movs r1, 0x8 - movs r2, 0x7F - bl SpawnSpecialFieldObjectParametrized - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02037350 - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x1] - movs r2, 0x20 - orrs r0, r2 - strb r0, [r1, 0x1] - ldrb r0, [r1, 0x4] - bl CameraObjectSetFollowedObjectId - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end SpawnScriptFieldObject - - thumb_func_start RemoveScriptFieldObject -RemoveScriptFieldObject: @ 81391AC - push {lr} - bl GetPlayerAvatarObjectId - lsls r0, 24 - lsrs r0, 24 - bl CameraObjectSetFollowedObjectId - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrb r1, [r0, 0x5] - ldrb r2, [r0, 0x4] - movs r0, 0x7F - bl RemoveFieldObjectByLocalIdAndMap - pop {r0} - bx r0 - .pool - thumb_func_end RemoveScriptFieldObject - - thumb_func_start sub_81391D0 -sub_81391D0: @ 81391D0 - push {lr} - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - bl GetNature - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02021cc4 - bl sub_8137068 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81391D0 - - thumb_func_start sub_8139200 -sub_8139200: @ 8139200 - push {r4,lr} - ldr r4, =0x02021cc4 - ldr r0, =0x00004026 - bl VarGet - 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 - .pool - thumb_func_end sub_8139200 - - thumb_func_start sub_8139228 -sub_8139228: @ 8139228 - push {lr} - movs r0, 0x20 - bl sub_80847F8 - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_8139228 - - thumb_func_start sub_8139238 -sub_8139238: @ 8139238 - push {lr} - ldr r0, =0x02021cc4 - bl sub_8165284 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8139238 - - thumb_func_start sub_8139248 -sub_8139248: @ 8139248 - push {r4,r5,lr} - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r1, =0x00002e68 - adds r0, r2, r1 - ldrb r1, [r0] - lsls r1, 25 - ldr r0, =0x00002e6a - adds r2, r0 - lsrs r1, 25 - ldrh r2, [r2] - adds r1, r2 - ldr r2, =gUnknown_085B2B88 - ldr r0, =0x020375e0 - ldrh r0, [r0] - adds r0, r2 - ldrb r0, [r0] - adds r5, r1, r0 - movs r0, 0x2 - bl GetPriceReduction - lsls r0, 24 - cmp r0, 0 - bne _08139294 - ldr r4, =gUnknown_085B2B94 - b _08139296 - .pool -_08139294: - ldr r4, =gUnknown_085B2BA0 -_08139296: - adds r0, r5, 0 - movs r1, 0xC - bl __umodsi3 - adds r0, r4 - ldrb r0, [r0] - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8139248 - - thumb_func_start sub_81392AC -sub_81392AC: @ 81392AC - push {lr} - ldr r1, =0x020375e0 - ldr r0, =0x00000213 - strh r0, [r1] - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _081392CC - movs r0, 0x1 - b _081392CE - .pool -_081392CC: - movs r0, 0 -_081392CE: - pop {r1} - bx r1 - thumb_func_end sub_81392AC - - thumb_func_start sub_81392D4 -sub_81392D4: @ 81392D4 - push {lr} - ldr r1, =0x020375e0 - movs r0, 0x85 - lsls r0, 2 - strh r0, [r1] - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _081392F0 - movs r0, 0x1 - b _081392F2 - .pool -_081392F0: - movs r0, 0 -_081392F2: - pop {r1} - bx r1 - thumb_func_end sub_81392D4 - - thumb_func_start sub_81392F8 -sub_81392F8: @ 81392F8 - push {lr} - ldr r1, =0x020375e0 - ldr r0, =0x00000215 - strh r0, [r1] - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08139318 - movs r0, 0x1 - b _0813931A - .pool -_08139318: - movs r0, 0 -_0813931A: - pop {r1} - bx r1 - thumb_func_end sub_81392F8 - - thumb_func_start sub_8139320 -sub_8139320: @ 8139320 - push {lr} - ldr r1, =0x020375e0 - ldr r0, =0x00000216 - strh r0, [r1] - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08139340 - movs r0, 0x1 - b _08139342 - .pool -_08139340: - movs r0, 0 -_08139342: - pop {r1} - bx r1 - thumb_func_end sub_8139320 - - thumb_func_start sub_8139348 -sub_8139348: @ 8139348 - push {lr} - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x47 - movs r2, 0 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8139348 - - thumb_func_start sub_8139370 -sub_8139370: @ 8139370 - push {r4,lr} - sub sp, 0x4 - movs r0, 0x2A - bl sav12_xor_increment - ldr r0, =0x0000089b - bl FlagSet - movs r1, 0x1 - mov r0, sp - strb r1, [r0] - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x47 - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0 - bl sub_80EE5A4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bls _081393B6 - adds r0, r4, 0 - movs r1, 0x47 - bl sub_80EE4DC -_081393B6: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8139370 - - thumb_func_start sub_81393C8 -sub_81393C8: @ 81393C8 - push {lr} - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - bl sub_806DC8C - lsls r0, 16 - ldr r1, =0x01fd0000 - cmp r0, r1 - bhi _081393F4 - movs r0, 0 - b _081393F6 - .pool -_081393F4: - movs r0, 0x1 -_081393F6: - pop {r1} - bx r1 - thumb_func_end sub_81393C8 - - thumb_func_start sub_81393FC -sub_81393FC: @ 81393FC - push {lr} - movs r0, 0xC7 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08139454 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - movs r0, 0x83 - lsls r0, 3 - cmp r1, r0 - bne _08139454 - subs r0, 0x75 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08139434 - ldr r0, =0x0000409a - movs r1, 0x4 - b _08139446 - .pool -_08139434: - movs r0, 0xE9 - lsls r0, 2 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08139454 - ldr r0, =0x0000409a - movs r1, 0x5 -_08139446: - bl VarSet - movs r0, 0x1 - b _08139456 - .pool -_08139454: - movs r0, 0 -_08139456: - pop {r1} - bx r1 - thumb_func_end sub_81393FC - - thumb_func_start sub_813945C -sub_813945C: @ 813945C - push {lr} - ldr r0, =0x000008bf - bl FlagSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_813945C - - thumb_func_start sub_813946C -sub_813946C: @ 813946C - push {r4,r5,lr} - sub sp, 0x14 - ldr r5, =0x020244ec - movs r1, 0x90 - lsls r1, 1 - movs r4, 0 - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - str r4, [sp, 0xC] - adds r0, r5, 0 - movs r2, 0x7 - movs r3, 0x20 - bl create_pokemon_set_level - movs r1, 0x1 - add r0, sp, 0x10 - strh r1, [r0] - adds r0, r5, 0 - movs r1, 0x2E - add r2, sp, 0x10 - bl pokemon_setattr - add r1, sp, 0x10 - movs r0, 0x21 - strh r0, [r1] - adds r0, r5, 0 - movs r1, 0xD - add r2, sp, 0x10 - bl pokemon_setattr - add r0, sp, 0x10 - strh r4, [r0] - adds r0, r5, 0 - movs r1, 0xE - add r2, sp, 0x10 - bl pokemon_setattr - adds r0, r5, 0 - movs r1, 0xF - add r2, sp, 0x10 - bl pokemon_setattr - adds r0, r5, 0 - movs r1, 0x10 - add r2, sp, 0x10 - bl pokemon_setattr - add sp, 0x14 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813946C - - thumb_func_start sub_81394D8 -sub_81394D8: @ 81394D8 - push {r4-r6,lr} - ldr r0, =0x00004023 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - bl sub_8133EDC - lsls r0, 16 - lsrs r6, r0, 16 - bl calc_player_party_count - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - cmp r4, r5 - bcs _08139526 -_081394FA: - movs r0, 0x64 - muls r0, r4 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - cmp r0, r6 - bne _0813951C - movs r0, 0x1 - b _08139528 - .pool -_0813951C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _081394FA -_08139526: - movs r0, 0 -_08139528: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81394D8 - - thumb_func_start sub_8139530 -sub_8139530: @ 8139530 - push {lr} - bl sub_80D2218 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_8139530 - - thumb_func_start sub_8139540 -sub_8139540: @ 8139540 - push {lr} - ldr r0, =0x020244ec - movs r1, 0x3F - bl sub_806DD7C - lsls r0, 24 - cmp r0, 0 - beq _08139558 - movs r0, 0x1 - b _0813955A - .pool -_08139558: - movs r0, 0 -_0813955A: - pop {r1} - bx r1 - thumb_func_end sub_8139540 - - thumb_func_start sub_8139560 -sub_8139560: @ 8139560 - push {lr} - ldr r0, =sub_81395BC - movs r1, 0x9 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =0x020375e2 - ldrh r0, [r0] - movs r2, 0 - strh r0, [r1, 0x8] - strh r2, [r1, 0xA] - ldr r0, =0x020375e4 - ldrh r0, [r0] - strh r0, [r1, 0xC] - ldr r0, =0x020375e6 - ldrh r0, [r0] - strh r0, [r1, 0xE] - ldr r0, =0x020375e0 - ldrh r0, [r0] - strh r0, [r1, 0x10] - movs r0, 0 - bl SetCameraPanningCallback - movs r0, 0xD6 - bl audio_play - pop {r0} - bx r0 - .pool - thumb_func_end sub_8139560 - - thumb_func_start sub_81395BC -sub_81395BC: @ 81395BC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - movs r1, 0x2 - ldrsh r0, [r4, r1] - movs r2, 0x6 - ldrsh r1, [r4, r2] - bl __modsi3 - cmp r0, 0 - bne _08139614 - strh r0, [r4, 0x2] - ldrh r0, [r4, 0x4] - subs r0, 0x1 - strh r0, [r4, 0x4] - ldrh r0, [r4] - negs r0, r0 - strh r0, [r4] - ldrh r0, [r4, 0x8] - negs r0, r0 - strh r0, [r4, 0x8] - movs r1, 0 - ldrsh r0, [r4, r1] - movs r2, 0x8 - ldrsh r1, [r4, r2] - bl SetCameraPanning - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08139614 - adds r0, r5, 0 - bl sub_8139620 - bl InstallCameraPanAheadCallback -_08139614: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81395BC - - thumb_func_start sub_8139620 -sub_8139620: @ 8139620 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running - pop {r0} - bx r0 - thumb_func_end sub_8139620 - - thumb_func_start sub_8139634 -sub_8139634: @ 8139634 - push {lr} - movs r0, 0x95 - lsls r0, 2 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_8139634 - - thumb_func_start sub_8139648 -sub_8139648: @ 8139648 - push {lr} - bl get_map_light_from_warp0 - lsls r0, 24 - lsrs r0, 24 - bl is_light_level_1_2_3_5_or_6 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08139664 - movs r0, 0x14 - bl sub_80AED7C -_08139664: - pop {r0} - bx r0 - thumb_func_end sub_8139648 - - thumb_func_start sub_8139668 -sub_8139668: @ 8139668 - push {lr} - bl get_map_light_from_warp0 - lsls r0, 24 - lsrs r0, 24 - bl is_light_level_1_2_3_5_or_6 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08139684 - movs r0, 0x15 - bl sub_80AED7C -_08139684: - pop {r0} - bx r0 - thumb_func_end sub_8139668 - - thumb_func_start sub_8139688 -sub_8139688: @ 8139688 - push {r4-r6,lr} - bl calc_player_party_count - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - cmp r5, r6 - bcs _081396D6 -_08139698: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _081396CC - adds r0, r4, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - beq _081396CC - adds r0, r5, 0 - b _081396D8 - .pool -_081396CC: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r6 - bcc _08139698 -_081396D6: - movs r0, 0 -_081396D8: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8139688 - - thumb_func_start sub_81396E0 -sub_81396E0: @ 81396E0 - push {lr} - ldr r0, =0x020375e0 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81396E0 - - thumb_func_start nullsub_54 -nullsub_54: @ 8139708 - bx lr - thumb_func_end nullsub_54 - - thumb_func_start sub_813970C -sub_813970C: @ 813970C - push {r4,lr} - ldr r0, =0x000040c2 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - adds r3, r0, 0 - ldr r2, =0x03005cf8 - movs r1, 0 - ldrsh r0, [r2, r1] - subs r0, r3 - cmp r0, 0x6 - ble _08139734 - movs r0, 0 - b _0813974C - .pool -_08139734: - ldrh r1, [r2] - movs r4, 0 - ldrsh r0, [r2, r4] - cmp r0, 0 - blt _0813974A - subs r1, r3 - movs r0, 0x7 - subs r0, r1 - lsls r0, 16 - lsrs r0, 16 - b _0813974C -_0813974A: - movs r0, 0x8 -_0813974C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_813970C - - thumb_func_start sub_8139754 -sub_8139754: @ 8139754 - push {r4,lr} - ldr r0, =0x000040c2 - ldr r4, =0x03005cf8 - ldrh r1, [r4] - bl VarSet - ldrh r0, [r4] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8139754 - - thumb_func_start sub_8139770 -sub_8139770: @ 8139770 - push {r4-r6,lr} - ldr r6, =0x020375e0 - ldrh r0, [r6] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - movs r1, 0x3 - bl pokemon_getattr - cmp r0, 0x2 - bne _081397A6 - ldrh r0, [r6] - muls r0, r5 - adds r0, r4 - ldr r4, =0x02021cc4 - movs r1, 0x7 - adds r2, r4, 0 - bl pokemon_getattr - ldr r0, =0x03005d90 - ldr r0, [r0] - adds r1, r4, 0 - bl CompareString - cmp r0, 0 - beq _081397BC -_081397A6: - movs r0, 0x1 - b _081397BE - .pool -_081397BC: - movs r0, 0 -_081397BE: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8139770 - - thumb_func_start sub_81397C4 -sub_81397C4: @ 81397C4 - push {r4,r5,lr} - ldr r2, =0x020375f0 - ldrh r1, [r2] - ldr r0, =0x0000270f - cmp r1, r0 - bls _081397E0 - movs r0, 0 - bl sub_80EF340 - b _08139862 - .pool -_081397E0: - ldr r0, =0x000003e7 - cmp r1, r0 - bls _081397F8 - ldr r4, =0x02021cc4 - movs r0, 0xA1 - strb r0, [r4] - adds r4, 0x1 - b _0813981C - .pool -_081397F8: - cmp r1, 0x63 - bls _0813980C - ldr r4, =0x02021cc4 - movs r0, 0xA1 - strb r0, [r4] - strb r0, [r4, 0x1] - adds r4, 0x2 - b _0813981C - .pool -_0813980C: - cmp r1, 0x9 - bls _0813983C - ldr r4, =0x02021cc4 - movs r0, 0xA1 - strb r0, [r4] - strb r0, [r4, 0x1] - strb r0, [r4, 0x2] - adds r4, 0x3 -_0813981C: - ldrh r5, [r2] - adds r0, r5, 0 - bl sub_80EF370 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0 - bl ConvertIntToDecimalString - b _08139862 - .pool -_0813983C: - ldr r4, =0x02021cc4 - movs r0, 0xA1 - strb r0, [r4] - strb r0, [r4, 0x1] - strb r0, [r4, 0x2] - strb r0, [r4, 0x3] - adds r4, 0x4 - ldrh r5, [r2] - adds r0, r5, 0 - bl sub_80EF370 - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0 - bl ConvertIntToDecimalString -_08139862: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81397C4 - - thumb_func_start sub_813986C -sub_813986C: @ 813986C - push {lr} - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0x4 - bhi _081398B8 - lsls r0, 2 - ldr r1, =_08139888 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08139888: - .4byte _0813989C - .4byte _081398A0 - .4byte _081398A4 - .4byte _081398A8 - .4byte _081398AC -_0813989C: - movs r0, 0x3 - b _081398AE -_081398A0: - movs r0, 0x4 - b _081398AE -_081398A4: - movs r0, 0 - b _081398AE -_081398A8: - movs r0, 0x1 - b _081398AE -_081398AC: - movs r0, 0x2 -_081398AE: - bl mevent_081445C0 - lsls r0, 16 - lsrs r0, 16 - b _081398BA -_081398B8: - movs r0, 0 -_081398BA: - pop {r1} - bx r1 - thumb_func_end sub_813986C - - thumb_func_start sub_81398C0 -sub_81398C0: @ 81398C0 - push {r4,lr} - ldr r1, =0x020375e0 - ldr r2, =0xfffffedf - adds r0, r2, 0 - ldrh r2, [r1] - adds r0, r2 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x39 - bls _081398E0 - movs r0, 0 - b _081398FC - .pool -_081398E0: - ldr r4, =0x02021dc4 - ldrh r0, [r1] - 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 CopyString - movs r0, 0x1 -_081398FC: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81398C0 - - thumb_func_start sub_813990C -sub_813990C: @ 813990C - push {r4,r5,lr} - bl calc_player_party_count - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - cmp r4, r5 - bcs _08139942 -_0813991C: - movs r0, 0x64 - muls r0, r4 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x4 - bl pokemon_getattr - cmp r0, 0x1 - bne _08139938 - movs r0, 0x1 - b _08139944 - .pool -_08139938: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _0813991C -_08139942: - movs r0, 0 -_08139944: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_813990C - - thumb_func_start in_multi_battle_room_with_var_condition -in_multi_battle_room_with_var_condition: @ 813994C - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - ldr r0, =0x00000f1a - cmp r1, r0 - bne _08139978 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bne _08139978 - movs r0, 0x1 - b _0813997A - .pool -_08139978: - movs r0, 0 -_0813997A: - pop {r1} - bx r1 - thumb_func_end in_multi_battle_room_with_var_condition - - thumb_func_start sub_8139980 -sub_8139980: @ 8139980 - push {lr} - movs r0, 0 - bl SetCameraPanningCallback - movs r0, 0x8 - movs r1, 0 - bl SetCameraPanning - pop {r0} - bx r0 - thumb_func_end sub_8139980 - - thumb_func_start sub_8139994 -sub_8139994: @ 8139994 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrb r0, [r0, 0x15] - subs r0, 0x10 - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x5 - bhi _081399E4 - lsls r0, 2 - ldr r1, =_081399B8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081399B8: - .4byte _081399E4 - .4byte _081399D0 - .4byte _081399D4 - .4byte _081399D8 - .4byte _081399DC - .4byte _081399E0 -_081399D0: - movs r1, 0x5 - b _081399E6 -_081399D4: - movs r1, 0x6 - b _081399E6 -_081399D8: - movs r1, 0x7 - b _081399E6 -_081399DC: - movs r1, 0x8 - b _081399E6 -_081399E0: - movs r1, 0xF - b _081399E6 -_081399E4: - movs r1, 0x4 -_081399E6: - ldr r0, =0x00004043 - bl VarSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_8139994 - - thumb_func_start sub_81399F4 -sub_81399F4: @ 81399F4 - push {r4,lr} - ldr r2, =0x0203ab60 - movs r0, 0 - strh r0, [r2] - ldr r1, =0x0203ab62 - strh r0, [r1] - ldr r0, =0x03005d8c - ldr r3, [r0] - movs r0, 0x14 - ldrsb r0, [r3, r0] - adds r4, r1, 0 - cmp r0, 0xD - bne _08139A6E - ldrb r0, [r3, 0x15] - subs r0, 0x10 - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x4 - bhi _08139A6E - lsls r0, 2 - ldr r1, =_08139A34 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08139A34: - .4byte _08139A66 - .4byte _08139A5E - .4byte _08139A56 - .4byte _08139A4E - .4byte _08139A48 -_08139A48: - movs r0, 0 - strh r0, [r2] - b _08139A6C -_08139A4E: - movs r0, 0 - strh r0, [r2] - movs r0, 0x1 - b _08139A6C -_08139A56: - movs r0, 0 - strh r0, [r2] - movs r0, 0x2 - b _08139A6C -_08139A5E: - movs r0, 0 - strh r0, [r2] - movs r0, 0x3 - b _08139A6C -_08139A66: - movs r0, 0 - strh r0, [r2] - movs r0, 0x4 -_08139A6C: - strh r0, [r4] -_08139A6E: - ldrh r0, [r4] - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81399F4 - - thumb_func_start sub_8139A78 -sub_8139A78: @ 8139A78 - push {r4-r6,lr} - ldr r0, =sub_8139AF4 - movs r1, 0x9 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e08 - adds r4, r1, r0 - movs r3, 0 - strh r3, [r4, 0x2] - strh r3, [r4, 0x4] - movs r6, 0x1 - strh r6, [r4, 0x8] - ldr r0, =0x020375e2 - ldr r1, =0x020375e4 - ldrh r2, [r0] - ldrh r0, [r1] - cmp r2, r0 - bls _08139AC0 - subs r0, r2, r0 - lsls r0, 16 - lsrs r5, r0, 16 - strh r6, [r4, 0xC] - b _08139AC8 - .pool -_08139AC0: - subs r0, r2 - lsls r0, 16 - lsrs r5, r0, 16 - strh r3, [r4, 0xC] -_08139AC8: - cmp r5, 0x8 - bls _08139ACE - movs r5, 0x8 -_08139ACE: - ldr r0, =gUnknown_085B2C18 - adds r0, r5, r0 - ldrb r0, [r0] - strh r0, [r4, 0xA] - movs r0, 0 - bl SetCameraPanningCallback - ldrb r1, [r4, 0xC] - adds r0, r5, 0 - bl sub_8139C2C - movs r0, 0x59 - bl audio_play - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8139A78 - - thumb_func_start sub_8139AF4 -sub_8139AF4: @ 8139AF4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - movs r1, 0x2 - ldrsh r0, [r4, r1] - movs r1, 0x3 - bl __modsi3 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bne _08139B54 - strh r0, [r4, 0x2] - ldrh r0, [r4, 0x4] - adds r0, 0x1 - strh r0, [r4, 0x4] - ldrh r0, [r4, 0x8] - negs r0, r0 - strh r0, [r4, 0x8] - movs r2, 0x8 - ldrsh r1, [r4, r2] - movs r0, 0 - bl SetCameraPanning - movs r0, 0x4 - ldrsh r1, [r4, r0] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _08139B54 - movs r0, 0x49 - bl audio_play - adds r0, r5, 0 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running - bl InstallCameraPanAheadCallback -_08139B54: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8139AF4 - - thumb_func_start sub_8139B60 -sub_8139B60: @ 8139B60 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0xC - ldr r5, =0x0203ab5e - ldr r0, =gUnknown_085B2BAC - bl AddWindow - strb r0, [r5] - ldrb r0, [r5] - movs r1, 0 - bl SetStandardWindowBorderStyle - ldr r4, =gUnknown_085EB6A5 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x40 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - ldrb r0, [r5] - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x1 - str r1, [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, r4, 0 - bl Print - ldr r6, =gUnknown_085B2BB4 - ldr r4, =0x020375e2 - ldrh r0, [r4] - lsls r0, 2 - adds r0, r6 - ldr r1, [r0] - movs r0, 0x1 - movs r2, 0x40 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - ldrb r0, [r5] - ldrh r1, [r4] - lsls r1, 2 - adds r1, r6 - ldr r2, [r1] - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x11 - str r1, [sp] - mov r1, r9 - str r1, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r1, 0x1 - bl Print - ldrb r0, [r5] - bl PutWindowTilemap - ldrb r0, [r5] - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8139B60 - - thumb_func_start sub_8139C10 -sub_8139C10: @ 8139C10 - push {r4,lr} - ldr r4, =0x0203ab5e - 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_8139C10 - - thumb_func_start sub_8139C2C -sub_8139C2C: @ 8139C2C - push {r4-r6,lr} - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 24 - lsrs r5, r1, 24 - ldr r4, =sub_8139C80 - adds r0, r4, 0 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08139C6C - adds r0, r4, 0 - movs r1, 0x8 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0 - strh r0, [r1, 0x8] - strh r0, [r1, 0xA] - strh r5, [r1, 0xC] - ldr r0, =gUnknown_085B2C21 - adds r0, r6, r0 - ldrb r0, [r0] - strh r0, [r1, 0xE] -_08139C6C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8139C2C - - thumb_func_start sub_8139C80 -sub_8139C80: @ 8139C80 - 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 r0, 2 - ldr r1, [sp] - adds r0, r1 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r6, r0, r1 - movs r2, 0x2 - ldrsh r0, [r6, r2] - cmp r0, 0x6 - bne _08139D7C - ldrh r0, [r6] - adds r0, 0x1 - strh r0, [r6] - movs r1, 0x4 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _08139D10 - movs r1, 0 - ldr r2, =gUnknown_085B2BF4 - mov r10, r2 -_08139CBA: - movs r5, 0 - adds r7, r1, 0x7 - lsls r0, r1, 1 - adds r2, r1, 0x1 - mov r8, r2 - adds r0, r1 - lsls r0, 1 - mov r9, r0 -_08139CCA: - adds r4, r5, 0 - adds r4, 0x8 - movs r1, 0 - ldrsh r0, [r6, r1] - movs r1, 0x3 - bl __modsi3 - lsls r0, 16 - asrs r0, 15 - add r0, r9 - add r0, r10 - ldrh r0, [r0] - movs r1, 0xC0 - lsls r1, 4 - adds r2, r1, 0 - orrs r2, r0 - adds r0, r4, 0 - adds r1, r7, 0 - bl MapGridSetMetatileIdAt - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _08139CCA - mov r2, r8 - lsls r0, r2, 24 - lsrs r1, r0, 24 - cmp r1, 0x2 - bls _08139CBA - b _08139D62 - .pool -_08139D10: - movs r1, 0 - ldr r0, =gUnknown_085B2C06 - mov r10, r0 -_08139D16: - movs r5, 0 - adds r7, r1, 0x7 - lsls r0, r1, 1 - adds r2, r1, 0x1 - mov r8, r2 - adds r0, r1 - lsls r0, 1 - mov r9, r0 -_08139D26: - adds r4, r5, 0 - adds r4, 0x8 - movs r1, 0 - ldrsh r0, [r6, r1] - movs r1, 0x3 - bl __modsi3 - lsls r0, 16 - asrs r0, 15 - add r0, r9 - add r0, r10 - ldrh r0, [r0] - movs r1, 0xC0 - lsls r1, 4 - adds r2, r1, 0 - orrs r2, r0 - adds r0, r4, 0 - adds r1, r7, 0 - bl MapGridSetMetatileIdAt - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _08139D26 - mov r2, r8 - lsls r0, r2, 24 - lsrs r1, r0, 24 - cmp r1, 0x2 - bls _08139D16 -_08139D62: - bl DrawWholeMapView - movs r0, 0 - strh r0, [r6, 0x2] - movs r0, 0 - ldrsh r1, [r6, r0] - movs r2, 0x6 - ldrsh r0, [r6, r2] - cmp r1, r0 - bne _08139D7C - ldr r0, [sp] - bl DestroyTask -_08139D7C: - ldrh r0, [r6, 0x2] - adds r0, 0x1 - strh r0, [r6, 0x2] - 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_8139C80 - - thumb_func_start sub_8139D98 -sub_8139D98: @ 8139D98 - push {r4-r7,lr} - sub sp, 0x18 - ldr r6, =0x020375e0 - ldrh r0, [r6] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - movs r1, 0x27 - bl pokemon_getattr - str r0, [sp] - ldrh r0, [r6] - muls r0, r5 - adds r0, r4 - movs r1, 0x28 - bl pokemon_getattr - str r0, [sp, 0x4] - ldrh r0, [r6] - muls r0, r5 - adds r0, r4 - movs r1, 0x29 - bl pokemon_getattr - str r0, [sp, 0x8] - ldrh r0, [r6] - muls r0, r5 - adds r0, r4 - movs r1, 0x2A - bl pokemon_getattr - str r0, [sp, 0xC] - ldrh r0, [r6] - muls r0, r5 - adds r0, r4 - movs r1, 0x2B - bl pokemon_getattr - str r0, [sp, 0x10] - ldrh r0, [r6] - muls r0, r5 - adds r0, r4 - movs r1, 0x2C - bl pokemon_getattr - str r0, [sp, 0x14] - ldr r1, =0x020375e2 - movs r0, 0 - strh r0, [r1] - movs r4, 0 - adds r2, r1, 0 -_08139E00: - lsls r0, r4, 2 - add r0, sp - ldr r1, [r0] - ldrh r0, [r2] - adds r0, r1 - strh r0, [r2] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _08139E00 - ldr r2, =0x020375e4 - movs r0, 0 - strh r0, [r2] - ldr r1, =0x020375e6 - ldr r0, [sp] - strh r0, [r1] - movs r4, 0x1 - adds r6, r2, 0 - adds r7, r1, 0 -_08139E28: - ldrh r0, [r6] - lsls r0, 2 - mov r2, sp - adds r1, r2, r0 - lsls r0, r4, 2 - adds r5, r2, r0 - ldr r1, [r1] - ldr r0, [r5] - cmp r1, r0 - bcs _08139E54 - strh r4, [r6] - b _08139E6C - .pool -_08139E54: - cmp r1, r0 - bne _08139E6E - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08139E6E - strh r4, [r6] - ldr r0, [r5] -_08139E6C: - strh r0, [r7] -_08139E6E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _08139E28 - add sp, 0x18 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8139D98 - - thumb_func_start warp0_in_pokecenter -warp0_in_pokecenter: @ 8139E80 - push {r4,lr} - ldr r0, =0x020322dc - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r1, 8 - ldrb r0, [r0, 0x1] - lsls r0, 24 - asrs r0, 24 - adds r0, r1 - lsls r0, 16 - lsrs r3, r0, 16 - ldr r2, =gUnknown_085B2C2A - ldrh r0, [r2] - ldr r1, =0x0000ffff - cmp r0, r1 - beq _08139EC6 - adds r4, r1, 0 - adds r1, r2, 0 -_08139EA4: - ldrh r0, [r2] - cmp r0, r3 - bne _08139EBC - movs r0, 0x1 - b _08139EC8 - .pool -_08139EBC: - adds r1, 0x2 - adds r2, 0x2 - ldrh r0, [r1] - cmp r0, r4 - bne _08139EA4 -_08139EC6: - movs r0, 0 -_08139EC8: - pop {r4} - pop {r1} - bx r1 - thumb_func_end warp0_in_pokecenter - - thumb_func_start sub_8139ED0 -sub_8139ED0: @ 8139ED0 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - ldr r0, =0x00003c1a - cmp r1, r0 - beq _08139EEC - movs r0, 0x1 - b _08139EEE - .pool -_08139EEC: - movs r0, 0 -_08139EEE: - pop {r1} - bx r1 - thumb_func_end sub_8139ED0 - - thumb_func_start sub_8139EF4 -sub_8139EF4: @ 8139EF4 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =0x0000402f - bl GetVarPointer - adds r5, r0, 0 - ldrh r0, [r5] - adds r4, r0 - strh r4, [r5] - ldrh r0, [r5] - movs r1, 0xA - bl __umodsi3 - strh r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8139EF4 - - thumb_func_start sub_8139F20 -sub_8139F20: @ 8139F20 - push {r4-r7,lr} - movs r4, 0 - ldr r0, =0x0000402f - bl VarGet - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x9 - bls _08139F34 - b _0813A03A -_08139F34: - lsls r0, r6, 2 - ldr r1, =_08139F48 - adds r1, r0, r1 - ldr r1, [r1] - adds r2, r0, 0 - mov pc, r1 - .pool - .align 2, 0 -_08139F48: - .4byte _08139F70 - .4byte _08139F70 - .4byte _08139F70 - .4byte _08139F70 - .4byte _08139F94 - .4byte _08139FB4 - .4byte _08139FCC - .4byte _08139FE4 - .4byte _08139FFC - .4byte _0813A014 -_08139F70: - ldr r0, =0x03005d90 - ldr r0, [r0] - movs r3, 0xCE - lsls r3, 4 - adds r1, r0, r3 - adds r3, r1, r2 - ldr r1, =0x00000ce2 - adds r0, r1 - adds r1, r0, r2 - ldrh r0, [r3] - ldrh r2, [r1] - cmp r0, r2 - bcs _0813A028 - b _0813A038 - .pool -_08139F94: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r3, =0x00000d0c - adds r2, r0, r3 - adds r3, 0x2 -_08139F9E: - adds r1, r0, r3 - ldrh r0, [r2] - ldrh r3, [r1] - cmp r0, r3 - bcs _0813A028 - b _0813A038 - .pool -_08139FB4: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000de2 - adds r2, r0, r1 - ldr r3, =0x00000de4 - b _08139F9E - .pool -_08139FCC: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000dc8 - adds r2, r0, r1 - ldr r3, =0x00000dca - b _08139F9E - .pool -_08139FE4: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000dda - adds r2, r0, r1 - ldr r3, =0x00000ddc - b _08139F9E - .pool -_08139FFC: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000e04 - adds r2, r0, r1 - ldr r3, =0x00000e06 - b _08139F9E - .pool -_0813A014: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000e1a - adds r2, r0, r1 - ldr r3, =0x00000e1c - adds r1, r0, r3 - ldrh r0, [r2] - ldrh r3, [r1] - cmp r0, r3 - bcc _0813A038 -_0813A028: - adds r4, r0, 0 - b _0813A03A - .pool -_0813A038: - ldrh r4, [r1] -_0813A03A: - movs r2, 0 - ldr r5, =gUnknown_085B2CC8 - lsls r0, r6, 1 - adds r1, r0, r5 - ldrb r1, [r1] - adds r3, r0, 0 - ldr r7, =gUnknown_085B2C50 - cmp r1, r4 - bcs _0813A062 - adds r1, r3, 0 -_0813A04E: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x1 - bhi _0813A062 - adds r0, r2, r1 - adds r0, r5 - ldrb r0, [r0] - cmp r0, r4 - bcc _0813A04E -_0813A062: - adds r0, r3, r6 - adds r0, r2 - lsls r0, 2 - adds r0, r7 - ldr r0, [r0] - bl box_related_two__2 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8139F20 - - thumb_func_start sub_813A080 -sub_813A080: @ 813A080 - push {r4-r7,lr} - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r4, r0, 30 - cmp r5, 0x2 - bne _0813A0D8 - movs r0, 0xA9 - lsls r0, 1 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _0813A0D8 - ldr r1, =0x020375e2 - movs r0, 0x5 - strh r0, [r1] - ldr r1, =0x020375e4 - movs r0, 0x4 - strh r0, [r1] - b _0813A110 - .pool -_0813A0D0: - movs r0, 0x4 - strh r0, [r6] - adds r0, r3, 0x5 - b _0813A10E -_0813A0D8: - movs r3, 0 - ldr r6, =0x020375e2 - ldr r7, =0x020375e4 - lsls r1, r4, 1 - lsls r2, r5, 2 - ldr r4, =gUnknown_085B2CDC - ldr r0, =0x03005d90 - ldr r0, [r0] - adds r1, r2 - movs r2, 0xCE - lsls r2, 4 - adds r0, r2 - adds r0, r1 - ldrh r1, [r0] -_0813A0F4: - lsls r0, r3, 1 - adds r0, r4 - ldrh r0, [r0] - cmp r0, r1 - bhi _0813A0D0 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x8 - bls _0813A0F4 - movs r0, 0x4 - strh r0, [r6] - movs r0, 0xC -_0813A10E: - strh r0, [r7] -_0813A110: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813A080 - - thumb_func_start sub_813A128 -sub_813A128: @ 813A128 - push {r4,lr} - ldr r0, =sub_813A2DC - movs r1, 0x8 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r3, r0, r1 - ldr r1, =0x020375e0 - ldrh r0, [r1] - strh r0, [r3, 0x1E] - ldrh r0, [r1] - cmp r0, 0xC - bls _0813A14E - b _0813A2C6 -_0813A14E: - lsls r0, 2 - ldr r1, =_0813A168 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0813A168: - .4byte _0813A19C - .4byte _0813A1AA - .4byte _0813A1C2 - .4byte _0813A1D6 - .4byte _0813A1F0 - .4byte _0813A208 - .4byte _0813A222 - .4byte _0813A23C - .4byte _0813A25A - .4byte _0813A274 - .4byte _0813A274 - .4byte _0813A28E - .4byte _0813A2A8 -_0813A19C: - movs r1, 0 - movs r0, 0x1 - strh r0, [r3, 0x8] - strh r0, [r3, 0xA] - strh r0, [r3, 0xC] - strh r0, [r3, 0xE] - b _0813A2BC -_0813A1AA: - movs r1, 0 - movs r0, 0x5 - strh r0, [r3, 0x8] - movs r0, 0x8 - strh r0, [r3, 0xA] - movs r0, 0x1 - strh r0, [r3, 0xC] - strh r0, [r3, 0xE] - movs r0, 0x9 - strh r0, [r3, 0x10] - movs r0, 0xA - b _0813A2BE -_0813A1C2: - movs r2, 0 - movs r0, 0x6 - strh r0, [r3, 0x8] - movs r1, 0xC - strh r1, [r3, 0xA] - movs r0, 0x1 - strh r0, [r3, 0xC] - strh r0, [r3, 0xE] - movs r0, 0x7 - b _0813A250 -_0813A1D6: - movs r1, 0 - movs r0, 0x6 - strh r0, [r3, 0x8] - movs r0, 0xB - strh r0, [r3, 0xA] - movs r0, 0xE - strh r0, [r3, 0xC] - movs r0, 0x1 - strh r0, [r3, 0xE] - movs r0, 0xF - strh r0, [r3, 0x10] - movs r0, 0xC - b _0813A2BE -_0813A1F0: - movs r1, 0 - movs r0, 0x6 - strh r0, [r3, 0x8] - strh r0, [r3, 0xA] - movs r0, 0xE - strh r0, [r3, 0xC] - movs r0, 0x1 - strh r0, [r3, 0xE] - movs r0, 0xF - strh r0, [r3, 0x10] - movs r0, 0xC - b _0813A2BE -_0813A208: - movs r1, 0 - movs r0, 0x6 - strh r0, [r3, 0x8] - movs r0, 0x7 - strh r0, [r3, 0xA] - movs r0, 0xE - strh r0, [r3, 0xC] - movs r0, 0x1 - strh r0, [r3, 0xE] - movs r0, 0xF - strh r0, [r3, 0x10] - movs r0, 0xC - b _0813A2BE -_0813A222: - movs r1, 0 - movs r0, 0x6 - strh r0, [r3, 0x8] - movs r0, 0xA - strh r0, [r3, 0xA] - movs r0, 0xE - strh r0, [r3, 0xC] - movs r0, 0x1 - strh r0, [r3, 0xE] - movs r0, 0xF - strh r0, [r3, 0x10] - movs r0, 0xC - b _0813A2BE -_0813A23C: - movs r2, 0 - movs r0, 0x6 - strh r0, [r3, 0x8] - movs r1, 0xC - strh r1, [r3, 0xA] - movs r0, 0xF - strh r0, [r3, 0xC] - movs r0, 0x1 - strh r0, [r3, 0xE] - movs r0, 0xE -_0813A250: - strh r0, [r3, 0x10] - strh r1, [r3, 0x12] - strh r2, [r3, 0x14] - strh r4, [r3, 0x26] - b _0813A2D2 -_0813A25A: - movs r1, 0 - movs r0, 0x6 - strh r0, [r3, 0x8] - movs r0, 0xA - strh r0, [r3, 0xA] - movs r0, 0x11 - strh r0, [r3, 0xC] - movs r0, 0x1 - strh r0, [r3, 0xE] - movs r0, 0xB - strh r0, [r3, 0x10] - movs r0, 0xC - b _0813A2BE -_0813A274: - movs r1, 0 - movs r0, 0x6 - strh r0, [r3, 0x8] - movs r0, 0xB - strh r0, [r3, 0xA] - movs r0, 0xF - strh r0, [r3, 0xC] - movs r0, 0x1 - strh r0, [r3, 0xE] - movs r0, 0xE - strh r0, [r3, 0x10] - movs r0, 0xC - b _0813A2BE -_0813A28E: - movs r1, 0 - movs r0, 0x6 - strh r0, [r3, 0x8] - movs r0, 0x7 - strh r0, [r3, 0xA] - movs r0, 0x13 - strh r0, [r3, 0xC] - movs r0, 0x1 - strh r0, [r3, 0xE] - movs r0, 0xA - strh r0, [r3, 0x10] - movs r0, 0xC - b _0813A2BE -_0813A2A8: - movs r1, 0 - movs r0, 0x6 - strh r0, [r3, 0x8] - movs r0, 0x7 - strh r0, [r3, 0xA] - movs r0, 0x11 - strh r0, [r3, 0xC] - movs r0, 0x1 - strh r0, [r3, 0xE] - movs r0, 0xC -_0813A2BC: - strh r0, [r3, 0x10] -_0813A2BE: - strh r0, [r3, 0x12] - strh r1, [r3, 0x14] - strh r4, [r3, 0x26] - b _0813A2D2 -_0813A2C6: - ldr r1, =0x020375f0 - movs r0, 0x7F - strh r0, [r1] - adds r0, r4, 0 - bl DestroyTask -_0813A2D2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813A128 - - thumb_func_start sub_813A2DC -sub_813A2DC: @ 813A2DC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x20 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r6, r0, r1 - bl script_env_2_enable - ldr r0, =0x0203ab68 - movs r5, 0 - strh r5, [r0] - ldr r1, =0x0203ab6c - movs r0, 0x40 - strb r0, [r1] - ldrh r0, [r6, 0x1E] - movs r1, 0 - bl sub_813AA60 - ldrb r0, [r6, 0x1E] - movs r1, 0 - bl sub_813ACE8 - ldr r4, =0x0203ab64 - movs r1, 0xA - ldrsh r0, [r6, r1] - lsls r0, 3 - bl AllocZeroed - str r0, [r4] - ldr r0, =0x0203ab6a - strh r5, [r0] - bl sub_813A42C - movs r3, 0 - movs r4, 0 - movs r2, 0xA - ldrsh r0, [r6, r2] - add r1, sp, 0x18 - mov r8, r1 - cmp r3, r0 - bge _0813A36A - ldr r5, =gUnknown_085B2CF0 -_0813A33A: - lsls r1, r4, 2 - ldr r0, =0x020375e0 - ldrh r0, [r0] - lsls r0, 6 - adds r1, r0 - adds r1, r5 - ldr r0, [r1] - ldr r1, =0x0203ab64 - ldr r2, [r1] - lsls r1, r4, 3 - adds r1, r2 - str r0, [r1] - str r4, [r1, 0x4] - adds r1, r3, 0 - bl display_text_and_get_width - adds r3, r0, 0 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - movs r2, 0xA - ldrsh r0, [r6, r2] - cmp r4, r0 - blt _0813A33A -_0813A36A: - adds r0, r3, 0 - bl convert_pixel_width_to_tile_width - strh r0, [r6, 0x10] - movs r1, 0xC - ldrsh r0, [r6, r1] - movs r2, 0x10 - ldrsh r1, [r6, r2] - adds r0, r1 - cmp r0, 0x1D - ble _0813A38C - movs r0, 0x1D - subs r0, r1 - cmp r0, 0 - bge _0813A38A - movs r0, 0 -_0813A38A: - strh r0, [r6, 0xC] -_0813A38C: - ldrb r2, [r6, 0xC] - ldrb r3, [r6, 0xE] - ldrb r0, [r6, 0x10] - str r0, [sp] - ldrb r0, [r6, 0x12] - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - movs r0, 0x64 - str r0, [sp, 0xC] - add r0, sp, 0x10 - movs r1, 0 - bl sub_8198A50 - ldr r0, [sp, 0x10] - ldr r1, [sp, 0x14] - str r0, [sp, 0x18] - str r1, [sp, 0x1C] - mov r0, r8 - bl AddWindow - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x22] - movs r1, 0 - bl SetStandardWindowBorderStyle - ldr r4, =0x030061d0 - ldrh r0, [r6, 0xA] - strh r0, [r4, 0xC] - ldrh r0, [r6, 0x8] - strh r0, [r4, 0xE] - ldrh r0, [r6, 0x22] - strb r0, [r4, 0x10] - adds r0, r7, 0 - bl sub_813A694 - ldrh r1, [r6, 0x16] - ldrh r2, [r6, 0x18] - adds r0, r4, 0 - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x24] - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_813A4EC - str r1, [r0] - add sp, 0x20 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813A2DC - - thumb_func_start sub_813A42C -sub_813A42C: @ 813A42C - ldr r1, =0x030061d0 - ldr r0, =0x0203ab64 - ldr r0, [r0] - str r0, [r1] - ldr r0, =sub_813A46C - str r0, [r1, 0x4] - movs r0, 0 - str r0, [r1, 0x8] - movs r2, 0 - movs r0, 0x1 - strh r0, [r1, 0xC] - strh r0, [r1, 0xE] - strb r2, [r1, 0x10] - strb r2, [r1, 0x11] - movs r0, 0x8 - strb r0, [r1, 0x12] - strb r2, [r1, 0x13] - movs r0, 0x21 - strb r0, [r1, 0x14] - movs r0, 0x31 - strb r0, [r1, 0x15] - movs r0, 0 - strb r0, [r1, 0x16] - movs r0, 0x1 - strb r0, [r1, 0x17] - bx lr - .pool - thumb_func_end sub_813A42C - - thumb_func_start sub_813A46C -sub_813A46C: @ 813A46C - push {r4,r5,lr} - sub sp, 0x4 - movs r0, 0x5 - bl audio_play - ldr r0, =sub_813A4EC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _0813A4D4 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - ldrh r0, [r4, 0x24] - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - movs r2, 0 - bl get_coro_args_x18_x1A - ldr r1, =0x0203ab68 - mov r0, sp - ldrh r0, [r0] - strh r0, [r1] - ldrh r0, [r4, 0x24] - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - bl sub_81AE838 - ldrh r0, [r4, 0x1E] - ldr r5, =0x0203ab6a - ldrh r1, [r5] - bl sub_813AC44 - ldrh r0, [r4, 0x1E] - mov r1, sp - ldrh r1, [r1] - bl sub_813AA60 - ldrb r0, [r4, 0x1E] - mov r1, sp - ldrh r1, [r1] - bl sub_813AD34 - mov r0, sp - ldrh r0, [r0] - strh r0, [r5] -_0813A4D4: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813A46C - - thumb_func_start sub_813A4EC -sub_813A4EC: @ 813A4EC - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r6, r0, r1 - ldrh r0, [r6, 0x24] - lsls r0, 24 - lsrs r0, 24 - bl ListMenuHandleInput - adds r4, r0, 0 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _0813A51C - adds r0, 0x1 - cmp r4, r0 - bne _0813A530 - b _0813A566 - .pool -_0813A51C: - ldr r1, =0x020375f0 - movs r0, 0x7F - strh r0, [r1] - movs r0, 0x5 - bl audio_play - b _0813A54C - .pool -_0813A530: - ldr r0, =0x020375f0 - strh r4, [r0] - movs r0, 0x5 - bl audio_play - movs r1, 0x14 - ldrsh r0, [r6, r1] - cmp r0, 0 - beq _0813A54C - movs r1, 0xA - ldrsh r0, [r6, r1] - subs r0, 0x1 - cmp r4, r0 - bne _0813A558 -_0813A54C: - adds r0, r5, 0 - bl sub_813A570 - b _0813A566 - .pool -_0813A558: - adds r0, r5, 0 - bl sub_813A738 - ldr r0, =sub_813A600 - str r0, [r6] - bl script_env_2_enable_and_set_ctx_running -_0813A566: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813A4EC - - thumb_func_start sub_813A570 -sub_813A570: @ 813A570 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - ldrh r0, [r4, 0x24] - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - bl sub_81AE838 - ldrh r0, [r4, 0x1E] - mov r1, sp - ldrh r1, [r1] - bl sub_813AC44 - adds r0, r5, 0 - bl sub_813A738 - ldrh r0, [r4, 0x24] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - ldr r0, =0x0203ab64 - ldr r0, [r0] - bl Free - ldrh r0, [r4, 0x22] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_8198070 - ldrh r0, [r4, 0x22] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl FillWindowPixelBuffer - ldrh r0, [r4, 0x22] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl CopyWindowToVram - ldrh r0, [r4, 0x22] - lsls r0, 24 - lsrs r0, 24 - bl RemoveWindow - adds r0, r5, 0 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813A570 - - thumb_func_start sub_813A600 -sub_813A600: @ 813A600 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0x14 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - beq _0813A624 - cmp r0, 0x2 - bne _0813A624 - movs r0, 0x1 - strh r0, [r1, 0x14] - ldr r0, =sub_813A664 - str r0, [r1] -_0813A624: - pop {r0} - bx r0 - .pool - thumb_func_end sub_813A600 - - thumb_func_start sub_813A630 -sub_813A630: @ 813A630 - push {lr} - ldr r0, =sub_813A600 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - bne _0813A64C - bl script_env_2_enable_and_set_ctx_running - b _0813A65C - .pool -_0813A64C: - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x14] - adds r0, 0x1 - strh r0, [r1, 0x14] -_0813A65C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_813A630 - - thumb_func_start sub_813A664 -sub_813A664: @ 813A664 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl script_env_2_enable - adds r0, r4, 0 - bl sub_813A694 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_813A4EC - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813A664 - - thumb_func_start sub_813A694 -sub_813A694: @ 813A694 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r4, r1, r0 - mov r1, sp - ldr r0, =gUnknown_085B3030 - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldr r0, [r0] - str r0, [r1] - movs r0, 0x8 - ldrsh r1, [r4, r0] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r1, r0 - beq _0813A724 - mov r2, sp - movs r3, 0x10 - ldrsh r1, [r4, r3] - lsrs r0, r1, 31 - adds r1, r0 - asrs r1, 1 - lsls r1, 3 - adds r1, 0xC - movs r5, 0xC - ldrsh r0, [r4, r5] - subs r0, 0x1 - lsls r0, 3 - adds r1, r0 - movs r3, 0 - strb r1, [r2, 0x1] - mov r1, sp - movs r0, 0x8 - strb r0, [r1, 0x2] - movs r0, 0x10 - ldrsh r1, [r4, r0] - lsrs r0, r1, 31 - adds r1, r0 - asrs r1, 1 - lsls r1, 3 - adds r1, 0xC - movs r5, 0xC - ldrsh r0, [r4, r5] - subs r0, 0x1 - lsls r0, 3 - adds r1, r0 - strb r1, [r2, 0x4] - mov r1, sp - movs r2, 0x12 - ldrsh r0, [r4, r2] - lsls r0, 3 - adds r0, 0xA - strb r0, [r1, 0x5] - mov r0, sp - strh r3, [r0, 0x6] - mov r2, sp - ldrh r0, [r4, 0xA] - ldrh r1, [r4, 0x8] - subs r0, r1 - strh r0, [r2, 0x8] - ldr r1, =0x0203ab68 - mov r0, sp - bl AddScrollIndicatorArrowPair - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x20] -_0813A724: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813A694 - - thumb_func_start sub_813A738 -sub_813A738: @ 813A738 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r2, r1, r0 - movs r0, 0x8 - ldrsh r1, [r2, r0] - movs r3, 0xA - ldrsh r0, [r2, r3] - cmp r1, r0 - beq _0813A75E - ldrh r0, [r2, 0x20] - lsls r0, 24 - lsrs r0, 24 - bl RemoveScrollIndicatorArrowPair -_0813A75E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_813A738 - - thumb_func_start nullsub_55 -nullsub_55: @ 813A768 - bx lr - thumb_func_end nullsub_55 - - thumb_func_start sub_813A76C -sub_813A76C: @ 813A76C - push {r4-r6,lr} - movs r4, 0 - ldr r6, =0x020229e8 - ldr r0, =0x0000401f - adds r5, r0, 0 -_0813A776: - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x13] - cmp r0, 0 - bne _0813A79C - subs r0, r5, r4 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - bl VarSet - b _0813A7A8 - .pool -_0813A79C: - subs r0, r5, r4 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x69 - bl VarSet -_0813A7A8: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0813A776 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_813A76C - - thumb_func_start sub_813A7B8 -sub_813A7B8: @ 813A7B8 - push {lr} - ldr r1, =0x020375e0 - ldrh r0, [r1] - cmp r0, 0x5 - bls _0813A7C6 - movs r0, 0 - strh r0, [r1] -_0813A7C6: - ldrh r1, [r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - bl GetNature - lsls r0, 24 - ldr r1, =gUnknown_085B3040 - lsrs r0, 22 - adds r0, r1 - ldr r0, [r0] - bl box_related_two__2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_813A7B8 - - thumb_func_start sub_813A7F4 -sub_813A7F4: @ 813A7F4 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =0x00004030 - bl GetVarPointer - adds r5, r0, 0 - ldrh r0, [r5] - adds r4, r0 - strh r4, [r5] - ldrh r0, [r5] - movs r1, 0xC - bl __umodsi3 - strh r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813A7F4 - - thumb_func_start sub_813A820 -sub_813A820: @ 813A820 - push {r4,lr} - ldr r0, =0x00004030 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r1, =gUnknown_085B30A4 - lsls r0, r4, 2 - adds r0, r1 - ldr r0, [r0] - bl box_related_two__2 - ldr r0, =0x00004031 - adds r1, r4, 0 - bl VarSet - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813A820 - - thumb_func_start sub_813A854 -sub_813A854: @ 813A854 - push {r4,lr} - ldr r4, =gUnknown_085B30D4 - ldr r0, =0x00004031 - bl VarGet - lsls r0, 16 - lsrs r0, 14 - adds r0, r4 - ldr r0, [r0] - bl box_related_two__2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813A854 - - thumb_func_start sub_813A878 -sub_813A878: @ 813A878 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, =0x00004031 - bl VarGet - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r5, r0, 16 - ldr r4, =0x00004033 - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _0813A8F0 - ldr r1, =gUnknown_085B3104 - lsls r0, r6, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r0, r5, 8 - adds r0, r7 - cmp r1, r0 - bne _0813A8F0 - mov r0, r8 - cmp r0, 0 - beq _0813A8E8 - adds r0, r4, 0 - movs r1, 0x2 - bl VarSet - b _0813A8F0 - .pool -_0813A8E8: - adds r0, r4, 0 - movs r1, 0x3 - bl VarSet -_0813A8F0: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_813A878 - - thumb_func_start sub_813A8FC -sub_813A8FC: @ 813A8FC - push {lr} - sub sp, 0x2C - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000eb8 - adds r0, r1 - ldrh r1, [r0] - add r0, sp, 0xC - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r1, =gUnknown_085EB6AD - bl CopyString - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0x30 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - ldr r0, =0x0203ab6d - ldrb r0, [r0] - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x1 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - add r2, sp, 0xC - bl Print - add sp, 0x2C - pop {r0} - bx r0 - .pool - thumb_func_end sub_813A8FC - - thumb_func_start sub_813A958 -sub_813A958: @ 813A958 - push {r4,lr} - ldr r4, =0x0203ab6d - ldr r0, =gUnknown_085B311C - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl SetStandardWindowBorderStyle - bl sub_813A8FC - ldrb r0, [r4] - movs r1, 0x2 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813A958 - - thumb_func_start sub_813A988 -sub_813A988: @ 813A988 - push {r4,lr} - ldr r4, =0x0203ab6d - 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_813A988 - - thumb_func_start sub_813A9A4 -sub_813A9A4: @ 813A9A4 - push {lr} - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r2, =0x00000eb8 - adds r1, r0, r2 - ldr r0, =0x020375e0 - ldrh r2, [r1] - ldrh r0, [r0] - cmp r2, r0 - bcs _0813A9C8 - movs r0, 0 - b _0813A9CA - .pool -_0813A9C8: - subs r0, r2, r0 -_0813A9CA: - strh r0, [r1] - pop {r0} - bx r0 - thumb_func_end sub_813A9A4 - - thumb_func_start sub_813A9D0 -sub_813A9D0: @ 813A9D0 - push {lr} - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000eb8 - adds r2, r0, r1 - ldrh r1, [r2] - ldr r0, =0x020375e0 - ldrh r0, [r0] - adds r1, r0 - ldr r0, =0x0000270f - cmp r1, r0 - ble _0813A9FC - strh r0, [r2] - b _0813A9FE - .pool -_0813A9FC: - strh r1, [r2] -_0813A9FE: - pop {r0} - bx r0 - thumb_func_end sub_813A9D0 - - thumb_func_start sub_813AA04 -sub_813AA04: @ 813AA04 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000eb8 - adds r0, r1 - ldrh r0, [r0] - bx lr - .pool - thumb_func_end sub_813AA04 - - thumb_func_start sub_813AA18 -sub_813AA18: @ 813AA18 - push {r4,lr} - ldr r4, =0x0203ab6e - ldr r0, =gUnknown_085B3124 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl SetStandardWindowBorderStyle - ldrb r0, [r4] - movs r1, 0x2 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813AA18 - - thumb_func_start sub_813AA44 -sub_813AA44: @ 813AA44 - push {r4,lr} - ldr r4, =0x0203ab6e - 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_813AA44 - - thumb_func_start sub_813AA60 -sub_813AA60: @ 813AA60 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 16 - lsls r1, 16 - lsrs r5, r1, 16 - lsrs r4, r0, 16 - ldr r1, =0xfffd0000 - adds r0, r1 - lsrs r0, 16 - cmp r0, 0x3 - bls _0813AA78 - b _0813ABC2 -_0813AA78: - movs r0, 0xD8 - str r0, [sp] - movs r0, 0x20 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0x11 - movs r2, 0 - movs r3, 0 - bl FillWindowPixelRect - cmp r4, 0x4 - beq _0813AAE8 - cmp r4, 0x4 - bgt _0813AAA0 - cmp r4, 0x3 - beq _0813AAAA - b _0813ABC2 - .pool -_0813AAA0: - cmp r4, 0x5 - beq _0813AB5C - cmp r4, 0x6 - beq _0813AB94 - b _0813ABC2 -_0813AAAA: - ldr r1, =gUnknown_085B3170 - lsls r0, r5, 2 - adds r0, r1 - ldr r2, [r0] - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - str r4, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParametrized - ldr r1, =gUnknown_085B312C - lsls r0, r5, 1 - adds r1, r0, r1 - ldrh r5, [r1] - ldr r0, =0x0000ffff - cmp r5, r0 - beq _0813AB18 - b _0813AB2C - .pool -_0813AAE8: - ldr r1, =gUnknown_085B319C - lsls r0, r5, 2 - adds r0, r1 - ldr r2, [r0] - 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, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParametrized - ldr r1, =gUnknown_085B3142 - lsls r0, r5, 1 - adds r1, r0, r1 - ldrh r5, [r1] - ldr r0, =0x0000ffff - cmp r5, r0 - bne _0813AB2C -_0813AB18: - ldrh r0, [r1] - bl sub_813ABD4 - b _0813ABC2 - .pool -_0813AB2C: - ldr r4, =0x0000157c - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - lsls r0, r5, 24 - lsrs r0, 24 - str r4, [sp] - str r4, [sp, 0x4] - movs r1, 0x21 - movs r2, 0x58 - movs r3, 0 - bl AddDecorationIconObject - ldr r1, =0x0203ab6c - strb r0, [r1] - b _0813ABC2 - .pool -_0813AB5C: - ldr r1, =gUnknown_085B31B4 - lsls r0, r5, 2 - adds r0, r1 - ldr r2, [r0] - 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, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParametrized - ldr r1, =gUnknown_085B314E - lsls r0, r5, 1 - adds r0, r1 - ldrh r0, [r0] - bl sub_813ABD4 - b _0813ABC2 - .pool -_0813AB94: - ldr r1, =gUnknown_085B31D0 - lsls r0, r5, 2 - adds r0, r1 - ldr r2, [r0] - 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, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParametrized - ldr r1, =gUnknown_085B315C - lsls r0, r5, 1 - adds r0, r1 - ldrh r0, [r0] - bl sub_813ABD4 -_0813ABC2: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813AA60 - - thumb_func_start sub_813ABD4 -sub_813ABD4: @ 813ABD4 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - ldr r4, =0x0000157c - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - adds r0, r4, 0 - adds r1, r4, 0 - adds r2, r5, 0 - bl AddItemIconObject - ldr r4, =0x0203ab6c - strb r0, [r4] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _0813AC32 - ldr r3, =0x02020630 - ldrb r0, [r4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0x24 - strh r1, [r0, 0x20] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0x5C - strh r1, [r0, 0x22] -_0813AC32: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813ABD4 - - thumb_func_start sub_813AC44 -sub_813AC44: @ 813AC44 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - ldr r2, =0x0203ab6c - ldrb r0, [r2] - cmp r0, 0x40 - beq _0813AC70 - cmp r1, 0x6 - bgt _0813AC6A - cmp r1, 0x3 - blt _0813AC6A - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeResources -_0813AC6A: - ldr r1, =0x0203ab6c - movs r0, 0x40 - strb r0, [r1] -_0813AC70: - pop {r0} - bx r0 - .pool - thumb_func_end sub_813AC44 - - thumb_func_start sub_813AC7C -sub_813AC7C: @ 813AC7C - push {lr} - ldr r0, =0x020375e2 - ldrh r0, [r0] - cmp r0, 0 - beq _0813ACB8 - ldr r0, =0x02021cc4 - ldr r2, =gUnknown_085B320C - ldr r1, =0x020375e0 - ldrh r1, [r1] - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - b _0813ACD2 - .pool -_0813ACB8: - ldr r0, =0x02021cc4 - ldr r2, =gUnknown_085B31F8 - ldr r1, =0x020375e0 - ldrh r1, [r1] - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString -_0813ACD2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_813AC7C - - thumb_func_start sub_813ACE8 -sub_813ACE8: @ 813ACE8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - lsls r1, 16 - lsrs r6, r1, 16 - subs r0, 0x9 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _0813AD20 - ldr r0, =0x020375e4 - ldrh r0, [r0] - cmp r0, 0 - bne _0813AD18 - ldr r4, =0x0203ab5e - ldr r0, =gUnknown_085B3220 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl SetStandardWindowBorderStyle -_0813AD18: - adds r0, r5, 0 - adds r1, r6, 0 - bl sub_813AD34 -_0813AD20: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813ACE8 - - thumb_func_start sub_813AD34 -sub_813AD34: @ 813AD34 - push {r4-r7,lr} - sub sp, 0xC - lsls r0, 24 - lsls r1, 16 - lsrs r5, r1, 16 - adds r7, r5, 0 - lsrs r6, r0, 24 - movs r1, 0xF7 - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bhi _0813ADAC - ldr r4, =0x0203ab5e - ldrb r0, [r4] - movs r1, 0x60 - str r1, [sp] - movs r1, 0x30 - str r1, [sp, 0x4] - movs r1, 0x11 - movs r2, 0 - movs r3, 0 - bl FillWindowPixelRect - cmp r6, 0xA - bne _0813AD90 - ldrb r0, [r4] - ldr r2, =gUnknown_085B3254 - lsls r1, r5, 2 - adds r1, r2 - ldr r2, [r1] - movs r1, 0x1 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - b _0813ADAC - .pool -_0813AD90: - ldrb r0, [r4] - ldr r2, =gUnknown_085B3228 - lsls r1, r7, 2 - adds r1, r2 - ldr r2, [r1] - movs r1, 0x1 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print -_0813ADAC: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813AD34 - - thumb_func_start sub_813ADB8 -sub_813ADB8: @ 813ADB8 - push {r4,lr} - ldr r4, =0x0203ab5e - 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_813ADB8 - - thumb_func_start sub_813ADD4 -sub_813ADD4: @ 813ADD4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - ldr r0, =sub_813A600 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xFF - beq _0813AE90 - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r6, r0, r1 - ldrh r0, [r6, 0x24] - lsls r0, 24 - lsrs r0, 24 - mov r4, sp - adds r4, 0x16 - add r1, sp, 0x14 - adds r2, r4, 0 - bl get_coro_args_x18_x1A - ldrh r0, [r6, 0x22] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl SetStandardWindowBorderStyle - movs r5, 0 - mov r9, r4 - ldr r0, =gUnknown_085B2CF0 - mov r8, r0 - movs r4, 0 -_0813AE1E: - ldrh r0, [r6, 0x22] - lsls r0, 24 - lsrs r0, 24 - add r1, sp, 0x14 - ldrh r2, [r1] - adds r2, r5 - lsls r2, 2 - ldr r1, =0x020375e0 - ldrh r1, [r1] - lsls r1, 6 - adds r2, r1 - add r2, r8 - ldr r2, [r2] - lsls r1, r5, 28 - lsrs r1, 24 - str r1, [sp] - movs r7, 0xFF - str r7, [sp, 0x4] - str r4, [sp, 0x8] - str r4, [sp, 0xC] - str r4, [sp, 0x10] - movs r1, 0x1 - movs r3, 0xA - bl sub_8199F74 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _0813AE1E - ldrh r0, [r6, 0x22] - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_085E8B3A - mov r3, r9 - ldrh r1, [r3] - lsls r1, 28 - lsrs r1, 24 - str r1, [sp] - str r7, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - ldrh r0, [r6, 0x22] - lsls r0, 24 - lsrs r0, 24 - bl PutWindowTilemap - ldrh r0, [r6, 0x22] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - bl CopyWindowToVram -_0813AE90: - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813ADD4 - - thumb_func_start sub_813AEB4 -sub_813AEB4: @ 813AEB4 - push {r4,lr} - movs r1, 0 - ldr r0, =0x020375e2 - strh r1, [r0] - ldr r0, =0x0000400e - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =0x0000400d - bl VarGet - lsls r0, 16 - lsrs r1, r0, 16 - cmp r4, 0 - beq _0813AF18 - movs r2, 0 - lsls r1, 1 - ldr r3, =gUnknown_0861500C - ldr r0, =gUnknown_085B320C - adds r0, r1, r0 - ldrh r1, [r0] -_0813AEE2: - lsls r0, r2, 1 - adds r0, r3 - ldrh r0, [r0] - cmp r0, r1 - beq _0813AF0C - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x1D - bls _0813AEE2 - b _0813AF38 - .pool -_0813AF0C: - ldr r0, =0x020375e2 - strh r2, [r0] - b _0813AF38 - .pool -_0813AF18: - movs r2, 0 - lsls r1, 1 - ldr r3, =gUnknown_0861500C - ldr r0, =gUnknown_085B31F8 - adds r0, r1, r0 - ldrh r1, [r0] -_0813AF24: - lsls r0, r2, 1 - adds r0, r3 - ldrh r0, [r0] - cmp r0, r1 - beq _0813AF0C - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x1D - bls _0813AF24 -_0813AF38: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813AEB4 - - thumb_func_start sub_813AF48 -sub_813AF48: @ 813AF48 - push {r4,r5,lr} - ldr r0, =sub_813A600 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0xFF - beq _0813AFB6 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - ldrh r0, [r4, 0x24] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - ldr r0, =0x0203ab64 - ldr r0, [r0] - bl Free - ldrh r0, [r4, 0x22] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_8198070 - ldrh r0, [r4, 0x22] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl FillWindowPixelBuffer - ldrh r0, [r4, 0x22] - lsls r0, 24 - lsrs r0, 24 - bl ClearWindowTilemap - ldrh r0, [r4, 0x22] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl CopyWindowToVram - ldrh r0, [r4, 0x22] - lsls r0, 24 - lsrs r0, 24 - bl RemoveWindow - adds r0, r5, 0 - bl DestroyTask -_0813AFB6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813AF48 - - thumb_func_start sub_813AFC8 -sub_813AFC8: @ 813AFC8 - push {lr} - ldr r0, =task_deoxys_sound - movs r1, 0x8 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_813AFC8 - - thumb_func_start task_deoxys_sound -task_deoxys_sound: @ 813AFDC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x000008d4 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0813B004 - ldr r1, =0x020375f0 - movs r0, 0x3 - b _0813B06A - .pool -_0813B004: - ldr r0, =0x00004035 - mov r8, r0 - bl VarGet - lsls r0, 16 - lsrs r5, r0, 16 - ldr r4, =0x00004034 - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r4, 0 - movs r1, 0 - bl VarSet - cmp r5, 0 - beq _0813B05C - ldr r0, =gUnknown_085B33F6 - subs r1, r5, 0x1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, r6 - bcs _0813B05C - movs r0, 0 - bl sub_813B0B4 - mov r0, r8 - movs r1, 0 - bl VarSet - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - b _0813B070 - .pool -_0813B05C: - cmp r5, 0xA - bne _0813B080 - ldr r0, =0x000008d4 - bl FlagSet - ldr r1, =0x020375f0 - movs r0, 0x2 -_0813B06A: - strh r0, [r1] - bl script_env_2_enable_and_set_ctx_running -_0813B070: - adds r0, r7, 0 - bl DestroyTask - b _0813B0A2 - .pool -_0813B080: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r0, r5, 24 - lsrs r0, 24 - bl sub_813B0B4 - ldr r0, =0x00004035 - adds r1, r5, 0 - bl VarSet - ldr r1, =0x020375f0 - movs r0, 0x1 - strh r0, [r1] - adds r0, r7, 0 - bl DestroyTask -_0813B0A2: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end task_deoxys_sound - - thumb_func_start sub_813B0B4 -sub_813B0B4: @ 813B0B4 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 5 - ldr r1, =gUnknown_085B3280 - adds r0, r1 - movs r1, 0xD0 - lsls r1, 1 - movs r2, 0x8 - bl gpu_pal_apply - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrb r1, [r0, 0x5] - ldrb r2, [r0, 0x4] - movs r0, 0x1 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - cmp r4, 0 - bne _0813B0F0 - movs r0, 0xC4 - bl audio_play - b _0813B0F8 - .pool -_0813B0F0: - movs r0, 0x82 - lsls r0, 1 - bl audio_play -_0813B0F8: - ldr r0, =sub_813B160 - movs r1, 0x8 - bl CreateTask - ldr r3, =0x02038c08 - movs r0, 0x1 - str r0, [r3] - movs r0, 0x3A - str r0, [r3, 0x4] - movs r0, 0x1A - str r0, [r3, 0x8] - ldr r0, =gUnknown_085B33E0 - lsls r2, r4, 1 - adds r1, r2, r0 - ldrb r1, [r1] - str r1, [r3, 0xC] - adds r0, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - str r0, [r3, 0x10] - adds r5, r2, 0 - cmp r4, 0 - bne _0813B138 - movs r0, 0x3C - b _0813B13A - .pool -_0813B138: - movs r0, 0x5 -_0813B13A: - str r0, [r3, 0x14] - movs r0, 0x42 - bl FieldEffectStart - ldr r0, =gUnknown_085B33E0 - adds r1, r5, r0 - ldrb r1, [r1] - adds r0, 0x1 - adds r0, r5, r0 - ldrb r2, [r0] - movs r0, 0x1 - bl update_saveblock1_field_object_coords - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813B0B4 - - thumb_func_start sub_813B160 -sub_813B160: @ 813B160 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x42 - bl FieldEffectActiveListContains - lsls r0, 24 - cmp r0, 0 - bne _0813B17C - bl script_env_2_enable_and_set_ctx_running - adds r0, r4, 0 - bl DestroyTask -_0813B17C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_813B160 - - thumb_func_start increment_var_x4026_on_birth_island_modulo_100 -increment_var_x4026_on_birth_island_modulo_100: @ 813B184 - push {r4,lr} - ldr r4, =0x00004034 - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - ldr r0, =0x00003a1a - cmp r1, r0 - bne _0813B1C8 - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x63 - bls _0813B1C0 - adds r0, r4, 0 - movs r1, 0 - bl VarSet - b _0813B1C8 - .pool -_0813B1C0: - adds r0, r4, 0 - adds r1, r2, 0 - bl VarSet -_0813B1C8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end increment_var_x4026_on_birth_island_modulo_100 - - thumb_func_start sub_813B1D0 -sub_813B1D0: @ 813B1D0 - push {lr} - ldr r0, =0x00004035 - bl VarGet - lsls r0, 24 - lsrs r0, 19 - ldr r1, =gUnknown_085B3280 - adds r0, r1 - movs r1, 0xD0 - lsls r1, 1 - movs r2, 0x8 - bl gpu_pal_apply - movs r0, 0x80 - lsls r0, 19 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - pop {r0} - bx r0 - .pool - thumb_func_end sub_813B1D0 - - thumb_func_start set_unknown_box_id -@ void set_unknown_box_id(char id) -set_unknown_box_id: @ 813B204 - ldr r1, =0x0203ab6f - strb r0, [r1] - bx lr - .pool - thumb_func_end set_unknown_box_id - - thumb_func_start get_unknown_box_id -get_unknown_box_id: @ 813B210 - ldr r0, =0x0203ab6f - ldrb r0, [r0] - bx lr - .pool - thumb_func_end get_unknown_box_id - - thumb_func_start sub_813B21C -sub_813B21C: @ 813B21C - push {r4,r5,lr} - ldr r5, =0x000008d7 - adds r0, r5, 0 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _0813B258 - bl get_preferred_box - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x00004036 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r4, r0 - beq _0813B258 - adds r0, r5, 0 - bl FlagSet - movs r0, 0x1 - b _0813B25A - .pool -_0813B258: - movs r0, 0 -_0813B25A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_813B21C - - thumb_func_start sub_813B260 -sub_813B260: @ 813B260 - push {r4-r7,lr} - ldr r0, =0x00004036 - bl VarGet - lsls r0, 24 - lsrs r0, 24 - bl set_unknown_box_id - bl get_preferred_box - lsls r0, 24 - lsrs r4, r0, 24 -_0813B278: - movs r5, 0 - lsls r6, r4, 24 - lsls r7, r4, 16 -_0813B27E: - lsls r1, r5, 24 - lsrs r1, 24 - lsrs r0, r6, 24 - bl get_pokemon_by_box_and_pos - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr_encrypted - cmp r0, 0 - bne _0813B2C0 - bl get_unknown_box_id - lsls r0, 16 - lsrs r0, 16 - cmp r0, r4 - beq _0813B2A6 - ldr r0, =0x000008d7 - bl FlagReset -_0813B2A6: - ldr r0, =0x00004036 - lsrs r1, r7, 16 - bl VarSet - bl sub_813B21C - lsls r0, 24 - lsrs r0, 24 - b _0813B2DC - .pool -_0813B2C0: - adds r5, 0x1 - cmp r5, 0x1D - ble _0813B27E - adds r4, 0x1 - cmp r4, 0xE - bne _0813B2CE - movs r4, 0 -_0813B2CE: - bl get_preferred_box - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _0813B278 - movs r0, 0 -_0813B2DC: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_813B260 - - thumb_func_start sub_813B2E4 -sub_813B2E4: @ 813B2E4 - push {r4,lr} - bl GenerateRandomNumber - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x00004038 - movs r1, 0 - bl VarSet - movs r0, 0xDF - lsls r0, 1 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0813B340 - ldr r0, =0x000001bf - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0813B330 - ldr r0, =0x00004037 - movs r1, 0x7 - ands r4, r1 - adds r1, r4, 0 - adds r1, 0x9 - bl VarSet - b _0813B36A - .pool -_0813B330: - movs r0, 0x1 - ands r4, r0 - cmp r4, 0 - bne _0813B354 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r4, r0, 16 -_0813B340: - ldr r0, =0x00004037 - movs r1, 0x7 - ands r4, r1 - adds r1, r4, 0x1 - bl VarSet - b _0813B36A - .pool -_0813B354: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x00004037 - movs r1, 0x7 - ands r4, r1 - adds r1, r4, 0 - adds r1, 0x9 - bl VarSet -_0813B36A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813B2E4 - - thumb_func_start sub_813B374 -sub_813B374: @ 813B374 - push {r4,lr} - ldr r0, =0x00004037 - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =0x02021cc4 - ldr r2, =gUnknown_085B3400 - subs r1, r4, 0x1 - adds r1, r2 - ldrb r1, [r1] - movs r2, 0 - bl GetMapName - cmp r4, 0x8 - bls _0813B3A8 - movs r0, 0x1 - b _0813B3AA - .pool -_0813B3A8: - movs r0, 0 -_0813B3AA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_813B374 - - thumb_func_start sub_813B3B0 -sub_813B3B0: @ 813B3B0 - push {r4-r6,lr} - ldr r5, =0x00004038 - adds r0, r5, 0 - bl VarGet - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x00004037 - bl VarGet - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0 - beq _0813B47C - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x000003e7 - cmp r4, r0 - bls _0813B474 - adds r0, r5, 0 - movs r1, 0 - bl VarSet - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r0, 0x4 - ldrsb r0, [r1, r0] - cmp r0, 0x18 - bne _0813B414 - movs r0, 0x5 - ldrsb r0, [r1, r0] - cmp r0, 0x69 - bgt _0813B414 - cmp r0, 0x65 - blt _0813B414 - ldr r0, =0x00004039 - movs r1, 0x1 - b _0813B478 - .pool -_0813B414: - ldr r0, =0x03005d8c - ldr r2, [r0] - movs r1, 0x4 - ldrsb r1, [r2, r1] - adds r3, r0, 0 - cmp r1, 0 - bne _0813B444 - movs r0, 0x5 - ldrsb r0, [r2, r0] - cmp r0, 0x34 - beq _0813B436 - cmp r0, 0x34 - blt _0813B444 - cmp r0, 0x38 - bgt _0813B444 - cmp r0, 0x36 - blt _0813B444 -_0813B436: - ldr r0, =0x00004039 - movs r1, 0x1 - b _0813B478 - .pool -_0813B444: - ldr r3, [r3] - movs r2, 0x5 - ldrsb r2, [r3, r2] - ldr r1, =gUnknown_085B3410 - subs r0, r6, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r2, r0 - bne _0813B468 - movs r0, 0x4 - ldrsb r0, [r3, r0] - cmp r0, 0 - bne _0813B468 - movs r0, 0x1 - b _0813B47E - .pool -_0813B468: - ldr r0, =0x00004037 - movs r1, 0 - b _0813B478 - .pool -_0813B474: - adds r0, r5, 0 - adds r1, r4, 0 -_0813B478: - bl VarSet -_0813B47C: - movs r0, 0 -_0813B47E: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_813B3B0 - - thumb_func_start sub_813B484 -sub_813B484: @ 813B484 - push {lr} - movs r0, 0x2 - bl sub_80AB104 - pop {r0} - bx r0 - thumb_func_end sub_813B484 - - thumb_func_start sub_813B490 -sub_813B490: @ 813B490 - push {r4-r7,lr} - movs r3, 0 - ldr r0, =0x03005d8c - ldr r4, [r0] - movs r6, 0x4 - ldrsb r6, [r4, r6] - ldr r5, =gUnknown_085B3420 - adds r0, r5, 0x2 - mov r12, r0 - adds r7, r5, 0x1 -_0813B4A4: - lsls r0, r3, 1 - adds r2, r0, r3 - adds r0, r2, r5 - ldrb r0, [r0] - cmp r6, r0 - bne _0813B4CC - movs r1, 0x5 - ldrsb r1, [r4, r1] - adds r0, r2, r7 - ldrb r0, [r0] - cmp r1, r0 - bne _0813B4CC - mov r1, r12 - adds r0, r2, r1 - ldrb r0, [r0] - b _0813B4D8 - .pool -_0813B4CC: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0xB - bls _0813B4A4 - movs r0, 0x1 -_0813B4D8: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_813B490 - - thumb_func_start sub_813B4E0 -sub_813B4E0: @ 813B4E0 - push {lr} - ldr r0, =0x020375e0 - ldrh r0, [r0] - bl sub_81D15CC - cmp r0, 0 - blt _0813B50C - movs r1, 0xAE - lsls r1, 1 - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0813B50C - movs r0, 0x1 - b _0813B50E - .pool -_0813B50C: - movs r0, 0 -_0813B50E: - pop {r1} - bx r1 - thumb_func_end sub_813B4E0 - - thumb_func_start sub_813B514 -sub_813B514: @ 813B514 - push {lr} - ldr r0, =0x0000403f - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _0813B52C - movs r0, 0x1 - b _0813B52E - .pool -_0813B52C: - movs r0, 0 -_0813B52E: - pop {r1} - bx r1 - thumb_func_end sub_813B514 - - thumb_func_start sub_813B534 -sub_813B534: @ 813B534 - push {lr} - ldr r2, =0x0203ab70 - ldr r1, =0x02022fec - ldr r0, [r1] - str r0, [r2] - movs r0, 0 - str r0, [r1] - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _0813B552 - ldr r0, =sub_80B3AF8 - movs r1, 0x5 - bl CreateTask -_0813B552: - pop {r0} - bx r0 - .pool - thumb_func_end sub_813B534 - - thumb_func_start sub_813B568 -sub_813B568: @ 813B568 - push {lr} - ldr r0, =sub_813B57C - movs r1, 0x5 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_813B568 - - thumb_func_start sub_813B57C -sub_813B57C: @ 813B57C - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0x9 - bls _0813B596 - b _0813B7C6 -_0813B596: - lsls r0, 2 - ldr r1, =_0813B5A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0813B5A8: - .4byte _0813B5D0 - .4byte _0813B5E4 - .4byte _0813B614 - .4byte _0813B6B4 - .4byte _0813B6E4 - .4byte _0813B728 - .4byte _0813B764 - .4byte _0813B772 - .4byte _0813B784 - .4byte _0813B7A8 -_0813B5D0: - ldr r0, =sub_80B3AF8 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - beq _0813B5DE - b _0813B7C6 -_0813B5DE: - b _0813B790 - .pool -_0813B5E4: - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0813B5F2 - b _0813B7C6 -_0813B5F2: - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _0813B5FE - b _0813B790 -_0813B5FE: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020375e0 - movs r2, 0x2 - bl link_0800A448 - b _0813B708 - .pool -_0813B614: - bl sub_800A550 - movs r1, 0x2 - ands r1, r0 - cmp r1, 0 - bne _0813B622 - b _0813B7C6 -_0813B622: - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - beq _0813B62E - b _0813B790 -_0813B62E: - ldr r5, =0x020375e2 - ldr r0, =0x020223c4 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r5] - movs r0, 0x1 - bl sub_800A5EC - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0x1 - bne _0813B668 - ldrh r1, [r5] - cmp r1, 0x1 - bne _0813B668 - ldr r0, =0x020375f0 - strh r1, [r0] - b _0813B790 - .pool -_0813B668: - ldr r0, =0x020375e0 - ldrh r1, [r0] - adds r2, r0, 0 - cmp r1, 0 - bne _0813B68C - ldr r0, =0x020375e2 - ldrh r0, [r0] - cmp r0, 0x1 - bne _0813B68C - ldr r1, =0x020375f0 - movs r0, 0x2 - b _0813B6AC - .pool -_0813B68C: - ldrh r0, [r2] - cmp r0, 0x1 - bne _0813B6A8 - ldr r0, =0x020375e2 - ldrh r0, [r0] - cmp r0, 0 - bne _0813B6A8 - ldr r1, =0x020375f0 - movs r0, 0x3 - b _0813B6AC - .pool -_0813B6A8: - ldr r1, =0x020375f0 - movs r0, 0 -_0813B6AC: - strh r0, [r1] - b _0813B790 - .pool -_0813B6B4: - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0813B6C2 - b _0813B7C6 -_0813B6C2: - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _0813B790 - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020375f0 - movs r2, 0x2 - bl link_0800A448 - b _0813B708 - .pool -_0813B6E4: - bl sub_800A550 - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0813B7C6 - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - beq _0813B790 - ldr r1, =0x020375f0 - ldr r0, =0x020223c4 - ldrh r0, [r0] - strh r0, [r1] - movs r0, 0 - bl sub_800A5EC -_0813B708: - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - b _0813B7C6 - .pool -_0813B728: - bl link_get_multiplayer_id - lsls r0, 24 - cmp r0, 0 - bne _0813B74C - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0x2 - bne _0813B790 - ldr r0, =gUnknown_0824979B - bl box_related_two__3 - b _0813B790 - .pool -_0813B74C: - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0x3 - bne _0813B790 - ldr r0, =gUnknown_0824979B - bl box_related_two__3 - b _0813B790 - .pool -_0813B764: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _0813B7C6 - b _0813B790 -_0813B772: - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0813B7C6 - bl sub_800ADF8 - b _0813B790 -_0813B784: - bl sub_800A520 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0813B7C6 -_0813B790: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0813B7C6 - .pool -_0813B7A8: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _0813B7B4 - bl sub_800AC34 -_0813B7B4: - ldr r0, =0x02022fec - ldr r1, =0x0203ab70 - ldr r1, [r1] - str r1, [r0] - bl script_env_2_enable_and_set_ctx_running - adds r0, r4, 0 - bl DestroyTask -_0813B7C6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813B57C - - thumb_func_start sub_813B7D8 -sub_813B7D8: @ 813B7D8 - push {lr} - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0 - bne _0813B7F8 - ldr r2, =c2_exit_to_overworld_1_continue_scripts_restart_music - movs r0, 0 - movs r1, 0x1 - bl sub_81D6720 - b _0813B802 - .pool -_0813B7F8: - ldr r2, =c2_exit_to_overworld_1_continue_scripts_restart_music - movs r0, 0x1 - movs r1, 0 - bl sub_81D6720 -_0813B802: - pop {r0} - bx r0 - .pool - thumb_func_end sub_813B7D8 - - thumb_func_start sub_813B80C -sub_813B80C: @ 813B80C - push {lr} - ldr r0, =sub_813B824 - movs r1, 0x8 - bl CreateTask - movs r0, 0x9D - bl audio_play - pop {r0} - bx r0 - .pool - thumb_func_end sub_813B80C - - thumb_func_start sub_813B824 -sub_813B824: @ 813B824 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - movs r0, 0x2 - ldrsh r1, [r4, r0] - ldr r0, =0x020375e2 - ldrh r0, [r0] - cmp r1, r0 - bne _0813B858 - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - movs r0, 0 - strh r0, [r4, 0x2] - movs r0, 0x9D - bl audio_play -_0813B858: - movs r0, 0 - ldrsh r1, [r4, r0] - ldr r0, =0x020375e0 - ldrh r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bne _0813B86C - adds r0, r5, 0 - bl DestroyTask -_0813B86C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813B824 - - thumb_func_start sub_813B880 -sub_813B880: @ 813B880 - push {lr} - ldr r0, =_fwalk - movs r1, 0x8 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0 - movs r0, 0x4 - strh r0, [r1, 0x8] - strh r0, [r1, 0xA] - strh r0, [r1, 0xC] - strh r2, [r1, 0xE] - pop {r0} - bx r0 - .pool - thumb_func_end sub_813B880 - - thumb_func_start _fwalk -_fwalk: @ 813B8B0 - 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 - lsls r0, 2 - add r0, r9 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - movs r0, 0x6 - ldrsh r1, [r5, r0] - lsls r1, 1 - adds r1, r5 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - movs r1, 0x6 - ldrsh r0, [r5, r1] - lsls r0, 1 - adds r0, r5 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0 - bne _0813B94E - movs r6, 0 -_0813B8EA: - movs r4, 0 - lsls r3, r6, 3 - mov r10, r3 - adds r7, r6, 0x1 - mov r8, r7 -_0813B8F4: - ldr r0, =0x03005d8c - ldr r1, [r0] - movs r2, 0 - ldrsh r0, [r1, r2] - adds r0, r4 - adds r0, 0x6 - movs r3, 0x2 - ldrsh r1, [r1, r3] - adds r1, r6 - adds r1, 0x4 - ldr r7, =0x00000201 - adds r2, r4, r7 - add r2, r10 - movs r7, 0x6 - ldrsh r3, [r5, r7] - lsls r3, 5 - adds r2, r3 - lsls r2, 16 - lsrs r2, 16 - bl MapGridSetMetatileIdAt - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _0813B8F4 - mov r1, r8 - lsls r0, r1, 24 - lsrs r6, r0, 24 - cmp r6, 0x3 - bls _0813B8EA - bl DrawWholeMapView - ldrh r0, [r5, 0x6] - adds r0, 0x1 - strh r0, [r5, 0x6] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bne _0813B94E - mov r0, r9 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running -_0813B94E: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end _fwalk - - thumb_func_start sub_813B968 -sub_813B968: @ 813B968 - push {r4,r5,lr} - ldr r5, =0x020375f0 - ldr r0, =0x020375e0 - ldrh r0, [r0] - movs r1, 0x7 - bl __udivsi3 - strh r0, [r5] - ldrh r4, [r5] - adds r0, r4, 0 - movs r1, 0x14 - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - subs r4, r1 - strh r4, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813B968 - - thumb_func_start sub_813B9A0 -sub_813B9A0: @ 813B9A0 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x1C] - movs r0, 0xB0 - lsls r0, 4 - cmp r1, r0 - bne _0813B9B6 - movs r0, 0x3 - bl sub_8084D1C -_0813B9B6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_813B9A0 - - thumb_func_start sub_813B9C0 -sub_813B9C0: @ 813B9C0 - push {r4,lr} - ldr r0, =0x03005d8c - 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 - ldr r2, =gUnknown_085B3444 - ldrh r0, [r2] - ldr r1, =0x0000ffff - cmp r0, r1 - beq _0813BA06 - adds r4, r1, 0 - adds r1, r2, 0 -_0813B9E6: - ldrh r0, [r2] - cmp r0, r3 - bne _0813B9FC - movs r0, 0x1 - b _0813BA08 - .pool -_0813B9FC: - adds r1, 0x2 - adds r2, 0x2 - ldrh r0, [r1] - cmp r0, r4 - bne _0813B9E6 -_0813BA06: - movs r0, 0 -_0813BA08: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_813B9C0 - - thumb_func_start sub_813BA10 -sub_813BA10: @ 813BA10 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x0000141e - adds r1, r0, r2 - movs r2, 0 - strh r2, [r1] - movs r1, 0xA1 - lsls r1, 5 - adds r0, r1 - strh r2, [r0] - bx lr - .pool - thumb_func_end sub_813BA10 - - thumb_func_start sub_813BA30 -sub_813BA30: @ 813BA30 - push {lr} - bl sub_813BF44 - lsls r0, 24 - cmp r0, 0 - beq _0813BA52 - bl sub_813BCE8 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrh r0, [r0, 0xE] - movs r2, 0xA1 - lsls r2, 5 - adds r1, r2 - strh r0, [r1] -_0813BA52: - pop {r0} - bx r0 - .pool - thumb_func_end sub_813BA30 - - thumb_func_start sub_813BA60 -sub_813BA60: @ 813BA60 - push {r4,lr} - ldr r4, =0x03005d8c - ldr r0, [r4] - ldr r1, =0x0000141e - adds r0, r1 - ldrh r0, [r0] - lsrs r0, 7 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0813BAB6 - bl sub_813BF60 - bl sub_813BD84 - ldr r1, [r4] - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrh r0, [r0, 0xE] - movs r2, 0xA1 - lsls r2, 5 - adds r1, r2 - strh r0, [r1] - ldr r0, =0x00000315 - bl FlagReset - ldr r0, =0x00000316 - bl FlagReset - ldr r0, =0x00000317 - bl FlagReset - movs r0, 0xC6 - lsls r0, 2 - bl FlagReset - ldr r0, =0x000002da - bl FlagReset - ldr r0, =0x00004095 - movs r1, 0x1 - bl VarSet -_0813BAB6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813BA60 - - thumb_func_start sub_813BADC -sub_813BADC: @ 813BADC - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x00004095 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bne _0813BB58 - ldr r4, =0x03005d8c - ldr r0, [r4] - ldr r5, =0x0000141e - adds r3, r0, r5 - ldrh r2, [r3] - movs r1, 0x7F - ands r1, r2 - ldr r0, =gUnknown_085B3470 - adds r0, r6, r0 - ldrb r0, [r0] - adds r1, r0 - cmp r1, 0x13 - ble _0813BB54 - bl sub_813BCA8 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bhi _0813BB3C - bl sub_813BB74 - ldr r0, [r4] - adds r0, r5 - ldrh r2, [r0] - ldr r1, =0x0000ff80 - ands r1, r2 - strh r1, [r0] - b _0813BB58 - .pool -_0813BB3C: - ldr r2, [r4] - adds r2, r5 - ldrh r1, [r2] - ldr r0, =0x0000ff80 - ands r0, r1 - movs r1, 0x14 - orrs r0, r1 - strh r0, [r2] - b _0813BB58 - .pool -_0813BB54: - adds r0, r2, r0 - strh r0, [r3] -_0813BB58: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x0000141e - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x7F - ands r0, r1 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_813BADC - - thumb_func_start sub_813BB74 -sub_813BB74: @ 813BB74 - push {r4-r7,lr} - sub sp, 0x8 - movs r3, 0 - movs r5, 0 - ldr r7, =0x03005d8c - ldr r2, =0x0000141e - movs r6, 0x1 -_0813BB82: - ldr r0, [r7] - adds r0, r2 - ldrh r1, [r0] - ldr r0, =gUnknown_085B3474 - adds r0, r5, r0 - ldrb r4, [r0] - asrs r1, r4 - ands r1, r6 - cmp r1, 0 - bne _0813BBC8 - adds r3, r5, 0 - str r2, [sp] - str r3, [sp, 0x4] - bl GenerateRandomNumber - adds r1, r6, 0 - ands r1, r0 - ldr r2, [sp] - ldr r3, [sp, 0x4] - cmp r1, 0 - beq _0813BBC8 - ldr r0, [r7] - adds r0, r2 - adds r1, r6, 0 - lsls r1, r4 - ldrh r2, [r0] - orrs r1, r2 - strh r1, [r0] - b _0813BBEA - .pool -_0813BBC8: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x7 - bls _0813BB82 - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r0, =0x0000141e - adds r2, r0 - ldr r1, =gUnknown_085B3474 - adds r1, r3, r1 - movs r0, 0x1 - ldrb r1, [r1] - lsls r0, r1 - ldrh r1, [r2] - orrs r0, r1 - strh r0, [r2] -_0813BBEA: - adds r0, r3, 0 - add sp, 0x8 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_813BB74 - - thumb_func_start sub_813BC00 -sub_813BC00: @ 813BC00 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r0, 0 - mov r10, r0 - bl sub_813BCA8 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bne _0813BC2E - movs r0, 0 - b _0813BC8E -_0813BC1E: - mov r1, r8 - ldr r0, [r1] - add r0, r9 - lsls r4, r6 - ldrh r1, [r0] - eors r4, r1 - strh r4, [r0] - b _0813BC8C -_0813BC2E: - movs r5, 0 - ldr r2, =0x03005d8c - mov r8, r2 - ldr r0, =0x0000141e - mov r9, r0 - movs r4, 0x1 -_0813BC3A: - mov r1, r8 - ldr r0, [r1] - add r0, r9 - ldrh r1, [r0] - ldr r7, =gUnknown_085B347C - adds r0, r5, r7 - ldrb r6, [r0] - asrs r1, r6 - ands r1, r4 - cmp r1, 0 - beq _0813BC5E - mov r10, r5 - bl GenerateRandomNumber - adds r1, r4, 0 - ands r1, r0 - cmp r1, 0 - bne _0813BC1E -_0813BC5E: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x7 - bls _0813BC3A - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x0000141e - adds r4, r0, r2 - ldrh r1, [r4] - mov r2, r10 - adds r0, r2, r7 - ldrb r2, [r0] - adds r0, r1, 0 - asrs r0, r2 - movs r3, 0x1 - ands r0, r3 - cmp r0, 0 - beq _0813BC8C - adds r0, r3, 0 - lsls r0, r2 - eors r1, r0 - strh r1, [r4] -_0813BC8C: - mov r0, r10 -_0813BC8E: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_813BC00 - - thumb_func_start sub_813BCA8 -sub_813BCA8: @ 813BCA8 - push {r4,r5,lr} - movs r3, 0 - movs r2, 0 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x0000141e - adds r0, r1 - ldrh r4, [r0] - movs r5, 0x1 -_0813BCBA: - adds r1, r2, 0 - adds r1, 0x8 - adds r0, r4, 0 - asrs r0, r1 - ands r0, r5 - cmp r0, 0 - beq _0813BCCE - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 -_0813BCCE: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _0813BCBA - adds r0, r3, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_813BCA8 - - thumb_func_start sub_813BCE8 -sub_813BCE8: @ 813BCE8 - push {r4-r6,lr} - movs r5, 0 - ldr r2, =0x03005d90 - ldr r0, [r2] - ldrh r1, [r0, 0xE] - ldr r0, =0x000003e6 - cmp r1, r0 - bhi _0813BD58 - adds r6, r2, 0 - b _0813BD32 - .pool -_0813BD04: - ldr r0, [r6] - ldrh r1, [r0, 0xE] - ldr r4, =0x03005d8c - ldr r0, [r4] - movs r2, 0xA1 - lsls r2, 5 - adds r0, r2 - ldrh r0, [r0] - subs r1, r0 - cmp r1, 0xB - ble _0813BD58 - bl sub_813BC00 - ldr r0, [r4] - movs r1, 0xA1 - lsls r1, 5 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0xC - strh r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_0813BD32: - bl sub_813BCA8 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x4 - bhi _0813BD54 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, [r6] - ldrh r0, [r0, 0xE] - movs r2, 0xA1 - lsls r2, 5 - adds r1, r2 - strh r0, [r1] - b _0813BD58 - .pool -_0813BD54: - cmp r5, 0x8 - bne _0813BD04 -_0813BD58: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_813BCE8 - - thumb_func_start sub_813BD60 -sub_813BD60: @ 813BD60 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x0000141e - adds r0, r1 - ldrh r0, [r0] - ldr r1, =0x020375e0 - ldrh r1, [r1] - asrs r0, r1 - movs r1, 0x1 - ands r0, r1 - bx lr - .pool - thumb_func_end sub_813BD60 - - thumb_func_start sub_813BD84 -sub_813BD84: @ 813BD84 - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r0, =0x0000141e - adds r2, r0 - ldrh r1, [r2] - movs r3, 0x80 - lsls r3, 6 - adds r0, r3, 0 - orrs r0, r1 - movs r3, 0x80 - lsls r3, 1 - adds r1, r3, 0 - orrs r0, r1 - movs r3, 0x80 - lsls r3, 3 - adds r1, r3, 0 - orrs r0, r1 - strh r0, [r2] - bx lr - .pool - thumb_func_end sub_813BD84 - - thumb_func_start sub_813BDB4 -sub_813BDB4: @ 813BDB4 - push {lr} - movs r3, 0 - movs r2, 0 - ldr r0, =0x020375e0 - ldrh r0, [r0] - subs r0, 0x8 - cmp r0, 0x7 - bhi _0813BE14 - lsls r0, 2 - ldr r1, =_0813BDD8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0813BDD8: - .4byte _0813BE14 - .4byte _0813BE14 - .4byte _0813BDF8 - .4byte _0813BDFE - .4byte _0813BE04 - .4byte _0813BE0A - .4byte _0813BE10 - .4byte _0813BE14 -_0813BDF8: - movs r3, 0 - movs r2, 0x3 - b _0813BE14 -_0813BDFE: - movs r3, 0 - movs r2, 0x1 - b _0813BE14 -_0813BE04: - movs r3, 0x1 - movs r2, 0 - b _0813BE14 -_0813BE0A: - movs r3, 0 - movs r2, 0x4 - b _0813BE14 -_0813BE10: - movs r3, 0x1 - movs r2, 0x5 -_0813BE14: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003150 - adds r0, r1 - adds r1, r3, 0 - bl sub_813BE30 - pop {r0} - bx r0 - .pool - thumb_func_end sub_813BDB4 - - thumb_func_start sub_813BE30 -sub_813BE30: @ 813BE30 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r0, r5, 4 - adds r1, r6, r0 - ldrb r0, [r1] - cmp r0, 0xFF - bne _0813BEE8 - cmp r2, 0x5 - bhi _0813BED4 - lsls r0, r2, 2 - ldr r1, =_0813BE58 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0813BE58: - .4byte _0813BED4 - .4byte _0813BE70 - .4byte _0813BE84 - .4byte _0813BE98 - .4byte _0813BEAC - .4byte _0813BEC0 -_0813BE70: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EAD14 - bl CopyString - b _0813BF04 - .pool -_0813BE84: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EAD1B - bl CopyString - b _0813BF04 - .pool -_0813BE98: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EAD22 - bl CopyString - b _0813BF04 - .pool -_0813BEAC: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EAD29 - bl CopyString - b _0813BF04 - .pool -_0813BEC0: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EAD30 - bl CopyString - b _0813BF04 - .pool -_0813BED4: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EAD0C - bl CopyString - b _0813BF04 - .pool -_0813BEE8: - ldr r4, =0x02021cc4 - adds r0, r4, 0 - movs r2, 0x7 - bl CopyString_LimitN - movs r0, 0xFF - strb r0, [r4, 0x7] - adds r0, r6, 0 - adds r0, 0x50 - adds r0, r5 - ldrb r1, [r0] - adds r0, r4, 0 - bl StopMusicWhileStringIsPrinted -_0813BF04: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813BE30 - - thumb_func_start sub_813BF10 -sub_813BF10: @ 813BF10 - push {lr} - ldr r0, =0x00004095 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bne _0813BF40 - bl sub_813BA30 - ldr r0, =0x0202433a - ldrb r0, [r0] - cmp r0, 0x1 - bne _0813BF3C - bl sub_813BB74 - b _0813BF40 - .pool -_0813BF3C: - bl sub_813BC00 -_0813BF40: - pop {r0} - bx r0 - thumb_func_end sub_813BF10 - - thumb_func_start sub_813BF44 -sub_813BF44: @ 813BF44 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x0000141e - adds r0, r1 - ldrh r0, [r0] - lsrs r0, 7 - movs r1, 0x1 - ands r0, r1 - bx lr - .pool - thumb_func_end sub_813BF44 - - thumb_func_start sub_813BF60 -sub_813BF60: @ 813BF60 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x0000141e - adds r1, r0 - ldrh r2, [r1] - movs r0, 0x80 - orrs r0, r2 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_813BF60 - - thumb_func_start sub_813BF7C -sub_813BF7C: @ 813BF7C - push {lr} - ldr r0, =0x020375e0 - ldrb r0, [r0] - bl sub_813BADC - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_813BF7C - - thumb_func_start sub_813BF94 -sub_813BF94: @ 813BF94 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r2, =0x01000008 - mov r0, sp - adds r1, r4, 0 - bl CpuSet - movs r0, 0xFF - strb r0, [r4] - movs r0, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - strh r0, [r4, 0xE] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813BF94 - - thumb_func_start sub_813BFC4 -sub_813BFC4: @ 813BFC4 - push {r4,r5,lr} - adds r4, r0, 0 - movs r5, 0x4 -_0813BFCA: - adds r0, r4, 0 - bl sub_813BF94 - adds r4, 0x10 - subs r5, 0x1 - cmp r5, 0 - bge _0813BFCA - movs r0, 0x17 - movs r1, 0 - bl sav12_xor_set - movs r0, 0x18 - movs r1, 0 - bl sav12_xor_set - movs r0, 0x19 - movs r1, 0 - bl sav12_xor_set - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_813BFC4 - - thumb_func_start sub_813BFF8 -sub_813BFF8: @ 813BFF8 - adds r1, r0, 0 - ldrh r0, [r1, 0xA] - ldrh r2, [r1, 0xC] - adds r0, r2 - ldrh r1, [r1, 0xE] - adds r0, r1 - bx lr - thumb_func_end sub_813BFF8 - - thumb_func_start sub_813C008 -sub_813C008: @ 813C008 - push {r4-r7,lr} - adds r7, r1, 0 - lsls r2, 16 - lsrs r6, r2, 16 - movs r5, 0 - adds r4, r0, 0 -_0813C014: - adds r0, r4, 0 - adds r1, r7, 0 - movs r2, 0x7 - bl CompareString_LimitN - cmp r0, 0 - bne _0813C02C - ldrh r0, [r4, 0x8] - cmp r0, r6 - bne _0813C02C - adds r0, r5, 0 - b _0813C036 -_0813C02C: - adds r4, 0x10 - adds r5, 0x1 - cmp r5, 0x4 - ble _0813C014 - movs r0, 0x5 -_0813C036: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_813C008 - - thumb_func_start sub_813C03C -sub_813C03C: @ 813C03C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - mov r10, r0 - movs r1, 0x4 -_0813C04C: - subs r3, r1, 0x1 - adds r6, r3, 0 - cmp r3, 0 - blt _0813C0BA - lsls r0, r1, 4 - add r0, r10 - str r0, [sp, 0x14] - lsls r0, r3, 4 - mov r2, r10 - adds r5, r0, r2 - movs r4, 0x50 - add r4, r10 - mov r9, r4 - add r1, r9 - mov r8, r1 -_0813C06A: - ldr r0, [sp, 0x14] - str r3, [sp, 0x10] - bl sub_813BFF8 - adds r4, r0, 0 - adds r0, r5, 0 - bl sub_813BFF8 - ldr r3, [sp, 0x10] - cmp r4, r0 - ble _0813C0B2 - mov r1, sp - ldr r0, [sp, 0x14] - ldm r0!, {r2,r4,r7} - stm r1!, {r2,r4,r7} - ldr r0, [r0] - str r0, [r1] - ldr r1, [sp, 0x14] - adds r0, r5, 0 - ldm r0!, {r2,r4,r7} - stm r1!, {r2,r4,r7} - ldr r0, [r0] - str r0, [r1] - adds r1, r5, 0 - mov r0, sp - ldm r0!, {r2,r4,r7} - stm r1!, {r2,r4,r7} - ldr r0, [r0] - str r0, [r1] - mov r7, r8 - ldrb r2, [r7] - mov r0, r9 - adds r1, r0, r6 - ldrb r0, [r1] - strb r0, [r7] - strb r2, [r1] -_0813C0B2: - subs r5, 0x10 - subs r6, 0x1 - cmp r6, 0 - bge _0813C06A -_0813C0BA: - adds r1, r3, 0 - cmp r1, 0 - bgt _0813C04C - 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_813C03C - - thumb_func_start sub_813C0D0 -sub_813C0D0: @ 813C0D0 - push {lr} - adds r2, r0, 0 - cmp r1, 0x2 - beq _0813C100 - cmp r1, 0x2 - bgt _0813C0E2 - cmp r1, 0x1 - beq _0813C0E8 - b _0813C12A -_0813C0E2: - cmp r1, 0x3 - beq _0813C118 - b _0813C12A -_0813C0E8: - ldrh r0, [r2, 0xA] - adds r0, 0x1 - strh r0, [r2, 0xA] - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x0000270f - cmp r0, r1 - bls _0813C12A - strh r1, [r2, 0xA] - b _0813C12A - .pool -_0813C100: - ldrh r0, [r2, 0xC] - adds r0, 0x1 - strh r0, [r2, 0xC] - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x0000270f - cmp r0, r1 - bls _0813C12A - strh r1, [r2, 0xC] - b _0813C12A - .pool -_0813C118: - ldrh r0, [r2, 0xE] - adds r0, 0x1 - strh r0, [r2, 0xE] - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x0000270f - cmp r0, r1 - bls _0813C12A - strh r1, [r2, 0xE] -_0813C12A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_813C0D0 - - thumb_func_start sub_813C134 -sub_813C134: @ 813C134 - push {r4,lr} - cmp r0, 0x2 - beq _0813C14E - cmp r0, 0x2 - bgt _0813C144 - cmp r0, 0x1 - beq _0813C14A - b _0813C166 -_0813C144: - cmp r0, 0x3 - beq _0813C152 - b _0813C166 -_0813C14A: - movs r4, 0x17 - b _0813C154 -_0813C14E: - movs r4, 0x18 - b _0813C154 -_0813C152: - movs r4, 0x19 -_0813C154: - adds r0, r4, 0 - bl sub_80847F8 - ldr r1, =0x0000270e - cmp r0, r1 - bhi _0813C166 - adds r0, r4, 0 - bl sav12_xor_increment -_0813C166: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813C134 - - thumb_func_start sub_813C170 -sub_813C170: @ 813C170 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r6, r0, 0 - mov r8, r1 - mov r10, r3 - ldr r0, [sp, 0x20] - lsls r2, 16 - lsrs r7, r2, 16 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - mov r0, r10 - bl sub_813C134 - adds r0, r6, 0 - bl sub_813C03C - adds r0, r6, 0 - mov r1, r8 - adds r2, r7, 0 - bl sub_813C008 - adds r5, r0, 0 - cmp r5, 0x5 - bne _0813C1D4 - movs r5, 0x4 - adds r4, r6, 0 - adds r4, 0x40 - adds r0, r4, 0 - bl sub_813BF94 - adds r0, r4, 0 - mov r1, r8 - movs r2, 0x7 - bl CopyString_LimitN - strh r7, [r4, 0x8] - adds r2, r6, 0 - adds r2, 0x54 - ldr r1, =0x020229e8 - mov r3, r9 - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x1A] - strb r0, [r2] -_0813C1D4: - lsls r0, r5, 4 - adds r0, r6, r0 - mov r1, r10 - bl sub_813C0D0 - adds r0, r6, 0 - bl sub_813C03C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813C170 - - thumb_func_start sub_813C1F8 -sub_813C1F8: @ 813C1F8 - push {lr} - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003150 - adds r0, r1 - bl sub_813BFC4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_813C1F8 - - thumb_func_start sub_813C214 -sub_813C214: @ 813C214 - push {lr} - movs r1, 0x64 - muls r1, r0 - ldr r0, =0x02039b6c - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - lsls r0, 16 - lsrs r0, 16 - ldr r2, =0x0000270f - cmp r0, r2 - bls _0813C230 - strh r2, [r1] -_0813C230: - pop {r0} - bx r0 - .pool - thumb_func_end sub_813C214 - - thumb_func_start sub_813C23C -sub_813C23C: @ 813C23C - push {lr} - movs r1, 0x64 - muls r1, r0 - ldr r0, =0x02039b6e - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - lsls r0, 16 - lsrs r0, 16 - ldr r2, =0x0000270f - cmp r0, r2 - bls _0813C258 - strh r2, [r1] -_0813C258: - pop {r0} - bx r0 - .pool - thumb_func_end sub_813C23C - - thumb_func_start sub_813C264 -sub_813C264: @ 813C264 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0202433a - ldrb r0, [r0] - cmp r0, 0x1 - beq _0813C27C - cmp r0, 0x2 - beq _0813C28A - b _0813C298 - .pool -_0813C27C: - eors r0, r4 - bl sub_813C214 - adds r0, r4, 0 - bl sub_813C23C - b _0813C298 -_0813C28A: - movs r0, 0x1 - eors r0, r4 - bl sub_813C23C - adds r0, r4, 0 - bl sub_813C214 -_0813C298: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_813C264 - - thumb_func_start sub_813C2A0 -sub_813C2A0: @ 813C2A0 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - bl InUnionRoom - cmp r0, 0x1 - beq _0813C2DA - adds r0, r4, 0 - bl sub_813C264 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003150 - adds r0, r1 - movs r1, 0x64 - adds r3, r4, 0 - muls r3, r1 - ldr r2, =0x02039b88 - adds r1, r3, r2 - subs r2, 0x30 - adds r3, r2 - ldrh r2, [r3, 0xE] - ldr r3, =0x0202433a - ldrb r3, [r3] - lsls r4, 24 - lsrs r4, 24 - str r4, [sp] - bl sub_813C170 -_0813C2DA: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813C2A0 - - thumb_func_start sub_813C2F4 -sub_813C2F4: @ 813C2F4 - push {r4,lr} - sub sp, 0xC - ldr r4, =0x02021cc4 - movs r0, 0x17 - bl sub_80847F8 - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =0x02021dc4 - movs r0, 0x18 - bl sub_80847F8 - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =0x02021ec4 - movs r0, 0x19 - bl sub_80847F8 - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EF6A1 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xD0 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - ldr r0, =0x0203ab74 - ldrb r0, [r0] - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x11 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - bl Print - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813C2F4 - - thumb_func_start sub_813C384 -sub_813C384: @ 813C384 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - adds r6, r0, 0 - adds r5, r2, 0 - lsls r1, 24 - lsrs r4, r1, 24 - ldrh r0, [r6, 0xA] - cmp r0, 0 - bne _0813C40C - ldr r7, [r6, 0xC] - cmp r7, 0 - bne _0813C40C - ldr r0, =0x0203ab74 - mov r8, r0 - ldrb r0, [r0] - ldr r2, =gUnknown_085B3D84 - lsls r4, 3 - adds r4, 0x1 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp] - str r7, [sp, 0x4] - str r7, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl Print - mov r1, r8 - ldrb r0, [r1] - ldr r5, =gUnknown_085B3D8C - str r4, [sp] - str r7, [sp, 0x4] - str r7, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0x50 - bl Print - mov r1, r8 - ldrb r0, [r1] - str r4, [sp] - str r7, [sp, 0x4] - str r7, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0x80 - bl Print - mov r1, r8 - ldrb r0, [r1] - str r4, [sp] - str r7, [sp, 0x4] - str r7, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0xB0 - bl Print - b _0813C4A8 - .pool -_0813C40C: - ldr r0, =0x02021cc4 - movs r1, 0x8 - bl RepeatStringTerminator - ldr r0, =0x02021cc4 - adds r1, r6, 0 - movs r2, 0x7 - bl CopyString_LimitN - lsls r1, r5, 24 - lsrs r1, 24 - ldr r0, =0x02021cc4 - bl StopMusicWhileStringIsPrinted - ldr r0, =0x0203ab74 - mov r8, r0 - ldrb r0, [r0] - lsls r4, 3 - adds r4, 0x1 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp] - movs r5, 0 - str r5, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - ldr r2, =0x02021cc4 - movs r3, 0x8 - bl Print - ldrh r1, [r6, 0xA] - ldr r0, =0x02021cc4 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalString - mov r1, r8 - ldrb r0, [r1] - str r4, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - ldr r2, =0x02021cc4 - movs r3, 0x50 - bl Print - ldrh r1, [r6, 0xC] - ldr r0, =0x02021cc4 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalString - mov r1, r8 - ldrb r0, [r1] - str r4, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - ldr r2, =0x02021cc4 - movs r3, 0x80 - bl Print - ldrh r1, [r6, 0xE] - ldr r0, =0x02021cc4 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalString - mov r1, r8 - ldrb r0, [r1] - str r4, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - ldr r2, =0x02021cc4 - movs r3, 0xB0 - bl Print -_0813C4A8: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813C384 - - thumb_func_start sub_813C4BC -sub_813C4BC: @ 813C4BC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - ldr r6, =0x0203ab74 - ldr r0, =gUnknown_085B3D7C - bl AddWindow - strb r0, [r6] - ldrb r0, [r6] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r6] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r5, =0x02021fc4 - ldr r1, =gUnknown_085EF68D - adds r0, r5, 0 - bl ExpandStringRefs - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0xD0 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - ldrb r0, [r6] - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x1 - str r1, [sp] - movs r4, 0 - str r4, [sp, 0x4] - str r4, [sp, 0x8] - adds r2, r5, 0 - bl Print - ldr r0, =0x03005d8c - mov r8, r0 - ldr r0, [r0] - ldr r1, =0x00003150 - mov r9, r1 - add r0, r9 - bl sub_813C2F4 - ldr r1, =gUnknown_085EF6BD - adds r0, r5, 0 - bl ExpandStringRefs - ldrb r0, [r6] - movs r1, 0x29 - str r1, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0 - bl Print - mov r7, r8 - movs r6, 0xE0 - lsls r6, 19 - mov r5, r9 -_0813C540: - ldr r2, [r7] - adds r0, r2, r5 - lsrs r1, r6, 24 - ldr r3, =0x000031a0 - adds r2, r3 - adds r2, r4 - ldrb r2, [r2] - bl sub_813C384 - movs r0, 0x80 - lsls r0, 18 - adds r6, r0 - adds r5, 0x10 - adds r4, 0x1 - cmp r4, 0x4 - ble _0813C540 - ldr r4, =0x0203ab74 - ldrb r0, [r4] - bl PutWindowTilemap - ldrb r0, [r4] - 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_813C4BC - - thumb_func_start sub_813C5A0 -sub_813C5A0: @ 813C5A0 - push {r4,lr} - ldr r4, =0x0203ab74 - ldrb r0, [r4] - movs r1, 0 - bl sub_819746C - ldrb r0, [r4] - bl RemoveWindow - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813C5A0 - - thumb_func_start sub_813C5BC -sub_813C5BC: @ 813C5BC - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0813C5DC - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_813C5EC - str r0, [r1] -_0813C5DC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_813C5BC - - thumb_func_start sub_813C5EC -sub_813C5EC: @ 813C5EC - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r4, r1, r0 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0813C610 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0813C61A -_0813C610: - movs r0, 0x5 - bl audio_play - ldr r0, =sub_813C62C - str r0, [r4] -_0813C61A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813C5EC - - thumb_func_start sub_813C62C -sub_813C62C: @ 813C62C - 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 pal_fade_maybe - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_813C664 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813C62C - - thumb_func_start sub_813C664 -sub_813C664: @ 813C664 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0813C694 - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - ldr r0, =0x0203ab78 - ldr r0, [r0] - bl Free - movs r0, 0 - bl sub_813C6A8 - bl FreeAllWindowBuffers - adds r0, r4, 0 - bl DestroyTask -_0813C694: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813C664 - - thumb_func_start sub_813C6A8 -sub_813C6A8: @ 813C6A8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0 - bl ClearWindowTilemap - adds r0, r4, 0 - movs r1, 0x2 - bl CopyWindowToVram - adds r0, r4, 0 - bl RemoveWindow - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_813C6A8 - - thumb_func_start sub_813C6D4 -sub_813C6D4: @ 813C6D4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - movs r3, 0xC0 - lsls r3, 19 - movs r4, 0xC0 - lsls r4, 9 - add r0, sp, 0x4 - mov r8, r0 - mov r2, sp - movs r6, 0 - ldr r1, =0x040000d4 - movs r5, 0x80 - lsls r5, 5 - ldr r7, =0x81000800 - movs r0, 0x81 - lsls r0, 24 - mov r12, r0 -_0813C6FA: - strh r6, [r2] - mov r0, sp - str r0, [r1] - str r3, [r1, 0x4] - str r7, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r3, r5 - subs r4, r5 - cmp r4, r5 - bhi _0813C6FA - strh r6, [r2] - mov r2, sp - str r2, [r1] - str r3, [r1, 0x4] - lsrs r0, r4, 1 - mov r2, r12 - orrs r0, r2 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r0, 0xE0 - lsls r0, 19 - movs r3, 0x80 - lsls r3, 3 - movs r4, 0 - str r4, [sp, 0x4] - ldr r2, =0x040000d4 - mov r1, r8 - str r1, [r2] - str r0, [r2, 0x4] - lsrs r0, r3, 2 - movs r1, 0x85 - lsls r1, 24 - orrs r0, r1 - str r0, [r2, 0x8] - ldr r0, [r2, 0x8] - movs r1, 0xA0 - lsls r1, 19 - mov r0, sp - strh r4, [r0] - str r0, [r2] - str r1, [r2, 0x4] - lsrs r3, 1 - movs r0, 0x81 - lsls r0, 24 - orrs r3, r0 - str r3, [r2, 0x8] - ldr r0, [r2, 0x8] - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0x8 - movs r1, 0 - bl SetGpuReg - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - movs r0, 0xA - movs r1, 0 - bl SetGpuReg - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0xC - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0xE - movs r1, 0 - bl SetGpuReg - movs r0, 0x1C - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813C6D4 - - thumb_func_start sub_813C80C -sub_813C80C: @ 813C80C - push {lr} - bl remove_some_task - bl ResetTasks - bl ResetAllObjectData - bl sub_80A1A74 - bl ResetObjectPaletteAllocator - pop {r0} - bx r0 - thumb_func_end sub_813C80C - - thumb_func_start sub_813C828 -sub_813C828: @ 813C828 - push {lr} - 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 - pop {r0} - bx r0 - thumb_func_end sub_813C828 - - thumb_func_start sub_813C880 -sub_813C880: @ 813C880 - push {lr} - movs r1, 0x94 - lsls r1, 4 - movs r0, 0 - bl SetGpuReg - pop {r0} - bx r0 - thumb_func_end sub_813C880 - - thumb_func_start sub_813C890 -sub_813C890: @ 813C890 - push {r4,lr} - sub sp, 0x8 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gUnknown_085B3484 - adds r0, r4, 0 - movs r2, 0xC0 - movs r3, 0 - bl LoadBgTiles - ldr r1, =gUnknown_085B3564 - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r4, 0 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBufferRect - ldr r0, =gUnknown_085B3544 - movs r1, 0 - movs r2, 0x20 - bl gpu_pal_apply - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813C890 - - thumb_func_start sub_813C8D8 -sub_813C8D8: @ 813C8D8 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_813C8D8 - - thumb_func_start sub_813C8EC -sub_813C8EC: @ 813C8EC - push {lr} - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_813C8EC - - thumb_func_start sub_813C904 -sub_813C904: @ 813C904 - push {lr} - movs r0, 0 - bl SetVBlankCallback - ldr r0, =sub_813C91C - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_813C904 - - thumb_func_start sub_813C91C -sub_813C91C: @ 813C91C - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x7 - bls _0813C930 - b _0813CA3C -_0813C930: - lsls r0, 2 - ldr r1, =_0813C944 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0813C944: - .4byte _0813C964 - .4byte _0813C970 - .4byte _0813C976 - .4byte _0813C9A8 - .4byte _0813C9BE - .4byte _0813C9DE - .4byte _0813C9F0 - .4byte _0813CA14 -_0813C964: - movs r0, 0 - bl SetVBlankCallback - bl sub_813C6D4 - b _0813CA00 -_0813C970: - bl sub_813C80C - b _0813CA00 -_0813C976: - ldr r4, =0x0203ab78 - movs r0, 0x80 - lsls r0, 4 - bl AllocZeroed - str r0, [r4] - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085B3D64 - movs r0, 0 - movs r2, 0x2 - bl InitBgsFromTemplates - ldr r1, [r4] - movs r0, 0x3 - bl SetBgTilemapBuffer - bl sub_813C828 - b _0813CA00 - .pool -_0813C9A8: - movs r0, 0x3 - bl sub_813C890 - movs r0, 0 - bl stdpal_get - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - b _0813CA00 -_0813C9BE: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0813CA3C - movs r0, 0 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - b _0813CA00 -_0813C9DE: - ldr r0, =gUnknown_085B3D6C - bl InitWindows - bl DeactivateAllTextPrinters - b _0813CA00 - .pool -_0813C9F0: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe -_0813CA00: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0813CA3C - .pool -_0813CA14: - bl sub_813C880 - ldr r0, =sub_813C8D8 - bl SetVBlankCallback - bl sub_81D5C8C - ldr r0, =sub_813C5BC - movs r1, 0x8 - bl CreateTask - ldr r0, =sub_813C8EC - bl SetMainCallback2 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0 - strb r1, [r0] -_0813CA3C: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813C91C - - thumb_func_start sub_813CA54 -sub_813CA54: @ 813CA54 - ldr r0, =0x0203ab7c - ldr r0, [r0] - movs r1, 0x8A - lsls r1, 1 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_813CA54 - - thumb_func_start sub_813CA68 -sub_813CA68: @ 813CA68 - push {lr} - sub sp, 0x4 - ldr r0, =0x0203ab7c - ldr r0, [r0] - movs r1, 0x8A - lsls r1, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0x4 - bhi _0813CB20 - lsls r0, 2 - ldr r1, =_0813CA90 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0813CA90: - .4byte _0813CAA4 - .4byte _0813CAB4 - .4byte _0813CABA - .4byte _0813CAEC - .4byte _0813CB10 -_0813CAA4: - ldr r0, =0x0203ab7c - ldr r0, [r0] - ldrh r0, [r0, 0xE] - bl sub_813CB40 - b _0813CB24 - .pool -_0813CAB4: - bl sub_813CF0C - b _0813CB24 -_0813CABA: - ldr r1, =gUnknown_085B3DB4 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r0, =0x0203ab7c - ldr r1, [r0] - movs r0, 0x8B - lsls r0, 1 - adds r1, r0 - movs r2, 0xA0 - lsls r2, 3 - movs r0, 0x2 - movs r3, 0 - bl LoadBgTilemap - b _0813CB24 - .pool -_0813CAEC: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _0813CB34 - ldr r0, =gUnknown_085B3D94 - ldr r1, =0x02037854 - ldr r2, =0x04000008 - bl CpuSet - b _0813CB24 - .pool -_0813CB10: - ldr r1, =0xfffff800 - movs r0, 0x2 - movs r2, 0 - bl ChangeBgY - b _0813CB24 - .pool -_0813CB20: - movs r0, 0 - b _0813CB36 -_0813CB24: - ldr r0, =0x0203ab7c - ldr r1, [r0] - movs r0, 0x8A - lsls r0, 1 - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_0813CB34: - movs r0, 0x1 -_0813CB36: - add sp, 0x4 - pop {r1} - bx r1 - .pool - thumb_func_end sub_813CA68 - - thumb_func_start sub_813CB40 -sub_813CB40: @ 813CB40 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 16 - lsrs r7, r0, 16 - ldr r5, =0x0203ab7c - ldr r0, [r5] - ldr r1, =0x000006e2 - adds r0, r1 - movs r4, 0 - strh r4, [r0] - ldr r0, =0x0000403e - bl VarGet - ldr r1, [r5] - ldr r2, =0x000006e4 - adds r1, r2 - strh r0, [r1] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x8 - bls _0813CB70 - strh r4, [r1] -_0813CB70: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r3, =0x000031dc - adds r0, r3 - ldrh r1, [r0, 0x8] - cmp r7, r1 - bne _0813CB80 - b _0813CCB8 -_0813CB80: - ldr r1, [r5] - movs r2, 0x88 - lsls r2, 1 - adds r0, r1, r2 - strh r4, [r0] - movs r3, 0x89 - lsls r3, 1 - adds r0, r1, r3 - strh r4, [r0] - movs r6, 0 - ldr r1, =gUnknown_085B3EE8 -_0813CB96: - lsls r0, r6, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r7 - bne _0813CBA2 - b _0813CCF8 -_0813CBA2: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0 - beq _0813CB96 - movs r6, 0 - ldr r4, =gUnknown_085B3EF0 - ldrh r0, [r4] - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _0813CC44 - mov r8, r4 - adds r5, r4, 0x4 - mov r9, r1 -_0813CBC0: - lsls r0, r6, 1 - adds r1, r0, r6 - lsls r2, r1, 1 - mov r3, r8 - adds r1, r2, r3 - adds r3, r0, 0 - ldrh r1, [r1] - cmp r7, r1 - bne _0813CC2E - adds r0, r4, 0x2 - adds r0, r2, r0 - ldrh r0, [r0] - cmp r0, 0x18 - beq _0813CC1A - cmp r0, 0x18 - bgt _0813CC08 - cmp r0, 0 - beq _0813CC0E - b _0813CC2E - .pool -_0813CC08: - cmp r0, 0x1A - beq _0813CC1A - b _0813CC2E -_0813CC0E: - adds r0, r2, r5 - ldrh r1, [r0] - movs r0, 0 - bl sub_813CD04 - b _0813CC2E -_0813CC1A: - adds r1, r3, r6 - lsls r1, 1 - mov r0, r8 - adds r0, 0x2 - adds r0, r1, r0 - ldrh r0, [r0] - adds r1, r5 - ldrh r1, [r1] - bl sub_813CD64 -_0813CC2E: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r4, =gUnknown_085B3EF0 - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 1 - adds r0, r4 - ldrh r0, [r0] - cmp r0, r9 - bne _0813CBC0 -_0813CC44: - movs r6, 0 - ldr r1, =gWildMonHeaders - ldrb r0, [r1] - cmp r0, 0xFF - beq _0813CCF8 -_0813CC4E: - lsls r4, r6, 2 - adds r0, r4, r6 - lsls r0, 2 - adds r5, r0, r1 - adds r0, r5, 0 - adds r1, r7, 0 - bl sub_813CE48 - lsls r0, 24 - cmp r0, 0 - beq _0813CC9C - ldrb r0, [r5] - cmp r0, 0x18 - beq _0813CC8C - cmp r0, 0x18 - bgt _0813CC7C - cmp r0, 0 - beq _0813CC82 - b _0813CC9C - .pool -_0813CC7C: - cmp r0, 0x1A - beq _0813CC8C - b _0813CC9C -_0813CC82: - ldrb r1, [r5, 0x1] - movs r0, 0 - bl sub_813CD04 - b _0813CC9C -_0813CC8C: - ldr r0, =gWildMonHeaders - adds r1, r4, r6 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1] - ldrb r1, [r1, 0x1] - bl sub_813CD64 -_0813CC9C: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r1, =gWildMonHeaders - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _0813CC4E - b _0813CCF8 - .pool -_0813CCB8: - ldr r2, [r5] - movs r3, 0x89 - lsls r3, 1 - adds r1, r2, r3 - strh r4, [r1] - ldrb r1, [r0, 0x13] - cmp r1, 0 - beq _0813CCF0 - adds r0, r2, 0 - adds r0, 0x10 - adds r1, r2, 0 - adds r1, 0x11 - bl sub_8161F64 - ldr r1, [r5] - ldrb r0, [r1, 0x10] - ldrb r1, [r1, 0x11] - bl get_mapheader_by_bank_and_number - ldr r1, [r5] - ldrb r0, [r0, 0x14] - strh r0, [r1, 0x12] - movs r0, 0x88 - lsls r0, 1 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1] - b _0813CCF8 -_0813CCF0: - movs r3, 0x88 - lsls r3, 1 - adds r0, r2, r3 - strh r1, [r0] -_0813CCF8: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_813CB40 - - thumb_func_start sub_813CD04 -sub_813CD04: @ 813CD04 - push {r4,r5,lr} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 16 - lsrs r3, r1, 16 - ldr r4, =0x0203ab7c - ldr r2, [r4] - movs r0, 0x88 - lsls r0, 1 - adds r1, r2, r0 - ldrh r0, [r1] - cmp r0, 0x3F - bhi _0813CD58 - lsls r0, 2 - adds r0, r2, r0 - strb r5, [r0, 0x10] - ldr r1, [r4] - movs r2, 0x88 - lsls r2, 1 - adds r0, r1, r2 - ldrh r0, [r0] - lsls r0, 2 - adds r1, r0 - strb r3, [r1, 0x11] - adds r0, r5, 0 - adds r1, r3, 0 - bl get_mapheader_by_bank_and_number - ldrb r0, [r0, 0x14] - bl sub_8123F9C - ldr r2, [r4] - movs r1, 0x88 - lsls r1, 1 - adds r3, r2, r1 - ldrh r1, [r3] - lsls r1, 2 - adds r2, r1 - strh r0, [r2, 0x12] - ldrh r0, [r3] - adds r0, 0x1 - strh r0, [r3] -_0813CD58: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813CD04 - - thumb_func_start sub_813CD64 -sub_813CD64: @ 813CD64 - push {r4-r7,lr} - lsls r0, 16 - lsrs r2, r0, 16 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =0x0203ab7c - ldr r0, [r0] - movs r3, 0x89 - lsls r3, 1 - adds r0, r3 - ldrh r0, [r0] - cmp r0, 0x1F - bhi _0813CE22 - lsls r0, r2, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - bl sub_813CE34 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0xD4 - bhi _0813CE22 - movs r3, 0 - ldr r0, =gUnknown_085B3EEA -_0813CD96: - ldrh r4, [r0] - cmp r5, r4 - beq _0813CE22 - adds r0, 0x2 - adds r3, 0x1 - cmp r3, 0x2 - bls _0813CD96 - ldr r1, =gUnknown_085B3EFC - ldrh r0, [r1] - cmp r0, 0xD5 - beq _0813CDD2 - adds r4, r1, 0 - adds r7, r4, 0 - movs r6, 0 -_0813CDB2: - ldrh r0, [r4] - cmp r5, r0 - bne _0813CDC8 - adds r0, r7, 0x2 - adds r0, r6, r0 - ldrh r0, [r0] - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _0813CE22 -_0813CDC8: - adds r4, 0x4 - adds r6, 0x4 - ldrh r0, [r4] - cmp r0, 0xD5 - bne _0813CDB2 -_0813CDD2: - movs r3, 0 - ldr r0, =0x0203ab7c - ldr r2, [r0] - movs r4, 0x89 - lsls r4, 1 - adds r1, r2, r4 - ldrh r4, [r1] - adds r1, r0, 0 - cmp r3, r4 - bge _0813CE02 - movs r6, 0xC4 - lsls r6, 3 - adds r0, r2, r6 - ldrh r0, [r0] - cmp r0, r5 - beq _0813CE02 - adds r2, r6 -_0813CDF4: - adds r2, 0x2 - adds r3, 0x1 - cmp r3, r4 - bge _0813CE02 - ldrh r0, [r2] - cmp r0, r5 - bne _0813CDF4 -_0813CE02: - ldr r1, [r1] - movs r0, 0x89 - lsls r0, 1 - adds r2, r1, r0 - ldrh r4, [r2] - cmp r3, r4 - bne _0813CE22 - lsls r0, r3, 1 - movs r6, 0xC4 - lsls r6, 3 - adds r1, r6 - adds r1, r0 - strh r5, [r1] - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] -_0813CE22: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813CD64 - - thumb_func_start sub_813CE34 -sub_813CE34: @ 813CE34 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - bl get_mapheader_by_bank_and_number - ldrb r0, [r0, 0x14] - pop {r1} - bx r1 - thumb_func_end sub_813CE34 - - thumb_func_start sub_813CE48 -sub_813CE48: @ 813CE48 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - ldrb r0, [r4] - ldrb r1, [r4, 0x1] - bl sub_813CE34 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xD2 - bne _0813CE7C - ldr r0, =0x0203ab7c - ldr r2, [r0] - ldr r0, =0x000006e2 - adds r1, r2, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - ldrh r1, [r1] - ldr r0, =0x000006e4 - adds r2, r0 - ldrh r0, [r2] - adds r0, 0x1 - cmp r1, r0 - bne _0813CEBC -_0813CE7C: - ldr r0, [r4, 0x4] - adds r1, r5, 0 - movs r2, 0xC - bl sub_813CED4 - lsls r0, 24 - cmp r0, 0 - bne _0813CECC - ldr r0, [r4, 0x8] - adds r1, r5, 0 - movs r2, 0x5 - bl sub_813CED4 - lsls r0, 24 - cmp r0, 0 - bne _0813CECC - ldr r0, [r4, 0x10] - adds r1, r5, 0 - movs r2, 0xC - bl sub_813CED4 - lsls r0, 24 - cmp r0, 0 - bne _0813CECC - ldr r0, [r4, 0xC] - adds r1, r5, 0 - movs r2, 0x5 - bl sub_813CED4 - lsls r0, 24 - cmp r0, 0 - bne _0813CECC -_0813CEBC: - movs r0, 0 - b _0813CECE - .pool -_0813CECC: - movs r0, 0x1 -_0813CECE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_813CE48 - - thumb_func_start sub_813CED4 -sub_813CED4: @ 813CED4 - push {r4,lr} - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 16 - lsrs r2, 16 - cmp r0, 0 - beq _0813CF02 - movs r3, 0 - cmp r3, r2 - bcs _0813CF02 - ldr r1, [r0, 0x4] -_0813CEEA: - lsls r0, r3, 2 - adds r0, r1 - ldrh r0, [r0, 0x2] - cmp r0, r4 - bne _0813CEF8 - movs r0, 0x1 - b _0813CF04 -_0813CEF8: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r2 - bcc _0813CEEA -_0813CF02: - movs r0, 0 -_0813CF04: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_813CED4 - - thumb_func_start sub_813CF0C -sub_813CF0C: @ 813CF0C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r4, 0 - ldr r2, =0x0203ab7c - adds r7, r2, 0 - movs r6, 0x8B - lsls r6, 1 - movs r5, 0 - ldr r3, =0x0000027f -_0813CF26: - ldr r0, [r7] - lsls r1, r4, 1 - adds r0, r6 - adds r0, r1 - strh r5, [r0] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r3 - bls _0813CF26 - movs r4, 0 - ldr r0, [r2] - movs r1, 0x88 - lsls r1, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r4, r0 - bcs _0813CFB2 - adds r3, r2, 0 -_0813CF4C: - movs r5, 0 - movs r6, 0 - adds r2, r4, 0x1 - mov r8, r2 - lsls r4, 2 - mov r9, r4 -_0813CF58: - movs r4, 0 -_0813CF5A: - adds r0, r4, 0 - adds r1, r6, 0 - str r3, [sp] - bl sub_8123E9C - ldr r3, [sp] - ldr r2, [r3] - mov r7, r9 - adds r1, r2, r7 - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r1, 0x12] - cmp r0, r1 - bne _0813CF84 - lsls r0, r5, 1 - movs r7, 0x8B - lsls r7, 1 - adds r1, r2, r7 - adds r1, r0 - ldr r0, =0x0000ffff - strh r0, [r1] -_0813CF84: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x1F - bls _0813CF5A - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x13 - bls _0813CF58 - mov r1, r8 - lsls r0, r1, 16 - lsrs r4, r0, 16 - ldr r0, [r3] - movs r2, 0x88 - lsls r2, 1 - adds r0, r2 - ldrh r0, [r0] - cmp r4, r0 - bcc _0813CF4C -_0813CFB2: - movs r5, 0 - movs r6, 0 - ldr r7, =0x0203ab7c - mov r12, r7 - movs r7, 0x8B - lsls r7, 1 - ldr r3, =0x0000ffff -_0813CFC0: - movs r4, 0 - adds r1, r6, 0x1 - mov r9, r1 -_0813CFC6: - mov r2, r12 - ldr r0, [r2] - lsls r1, r5, 1 - adds r2, r0, r7 - adds r1, r2, r1 - ldrh r0, [r1] - adds r1, r5, 0x1 - mov r8, r1 - cmp r0, r3 - bne _0813D0D2 - cmp r4, 0 - beq _0813CFF0 - subs r0, r5, 0x1 - lsls r0, 1 - adds r1, r2, r0 - ldrh r2, [r1] - cmp r2, r3 - beq _0813CFF0 - movs r0, 0x2 - orrs r0, r2 - strh r0, [r1] -_0813CFF0: - adds r2, r5, 0x1 - mov r8, r2 - cmp r4, 0x1F - beq _0813D00E - mov r1, r12 - ldr r0, [r1] - lsls r1, r2, 1 - adds r0, r7 - adds r2, r0, r1 - ldrh r1, [r2] - cmp r1, r3 - beq _0813D00E - movs r0, 0x1 - orrs r0, r1 - strh r0, [r2] -_0813D00E: - cmp r6, 0 - beq _0813D02C - mov r2, r12 - ldr r1, [r2] - adds r0, r5, 0 - subs r0, 0x20 - lsls r0, 1 - adds r1, r7 - adds r1, r0 - ldrh r2, [r1] - cmp r2, r3 - beq _0813D02C - movs r0, 0x8 - orrs r0, r2 - strh r0, [r1] -_0813D02C: - cmp r6, 0x13 - beq _0813D04A - mov r0, r12 - ldr r1, [r0] - adds r0, r5, 0 - adds r0, 0x20 - lsls r0, 1 - adds r1, r7 - adds r1, r0 - ldrh r2, [r1] - cmp r2, r3 - beq _0813D04A - movs r0, 0x4 - orrs r0, r2 - strh r0, [r1] -_0813D04A: - cmp r4, 0 - beq _0813D06C - cmp r6, 0 - beq _0813D06C - mov r2, r12 - ldr r1, [r2] - adds r0, r5, 0 - subs r0, 0x21 - lsls r0, 1 - adds r1, r7 - adds r1, r0 - ldrh r2, [r1] - cmp r2, r3 - beq _0813D06C - movs r0, 0x10 - orrs r0, r2 - strh r0, [r1] -_0813D06C: - cmp r4, 0x1F - beq _0813D08E - cmp r6, 0 - beq _0813D08E - mov r0, r12 - ldr r1, [r0] - adds r0, r5, 0 - subs r0, 0x1F - lsls r0, 1 - adds r1, r7 - adds r1, r0 - ldrh r2, [r1] - cmp r2, r3 - beq _0813D08E - movs r0, 0x40 - orrs r0, r2 - strh r0, [r1] -_0813D08E: - cmp r4, 0 - beq _0813D0B0 - cmp r6, 0x13 - beq _0813D0B0 - mov r2, r12 - ldr r1, [r2] - adds r0, r5, 0 - adds r0, 0x1F - lsls r0, 1 - adds r1, r7 - adds r1, r0 - ldrh r2, [r1] - cmp r2, r3 - beq _0813D0B0 - movs r0, 0x20 - orrs r0, r2 - strh r0, [r1] -_0813D0B0: - cmp r4, 0x1F - beq _0813D0D2 - cmp r6, 0x13 - beq _0813D0D2 - mov r0, r12 - ldr r1, [r0] - adds r0, r5, 0 - adds r0, 0x21 - lsls r0, 1 - adds r1, r7 - adds r1, r0 - ldrh r2, [r1] - cmp r2, r3 - beq _0813D0D2 - movs r0, 0x80 - orrs r0, r2 - strh r0, [r1] -_0813D0D2: - mov r1, r8 - lsls r0, r1, 16 - lsrs r5, r0, 16 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x1F - bhi _0813D0E4 - b _0813CFC6 -_0813D0E4: - mov r2, r9 - lsls r0, r2, 16 - lsrs r6, r0, 16 - cmp r6, 0x13 - bhi _0813D0F0 - b _0813CFC0 -_0813D0F0: - movs r4, 0 - ldr r6, =0x0203ab7c - movs r5, 0x8B - lsls r5, 1 - ldr r7, =0x0000ffff - mov r12, r7 - movs r0, 0xA0 - lsls r0, 8 - mov r9, r0 - ldr r7, =0x0000a010 - ldr r1, =0x0000ffcf - mov r8, r1 -_0813D108: - ldr r0, [r6] - lsls r3, r4, 1 - adds r0, r5 - adds r2, r0, r3 - ldrh r1, [r2] - adds r0, r1, 0 - cmp r0, r12 - bne _0813D130 - strh r7, [r2] - b _0813D198 - .pool -_0813D130: - cmp r0, 0 - beq _0813D198 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0813D142 - mov r0, r8 - ands r0, r1 - strh r0, [r2] -_0813D142: - ldr r0, [r6] - adds r0, r5 - adds r2, r0, r3 - ldrh r1, [r2] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0813D158 - ldr r0, =0x0000ff3f - ands r0, r1 - strh r0, [r2] -_0813D158: - ldr r0, [r6] - adds r0, r5 - adds r2, r0, r3 - ldrh r1, [r2] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0813D16E - ldr r0, =0x0000ffaf - ands r0, r1 - strh r0, [r2] -_0813D16E: - ldr r0, [r6] - adds r0, r5 - adds r2, r0, r3 - ldrh r1, [r2] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0813D184 - ldr r0, =0x0000ff5f - ands r0, r1 - strh r0, [r2] -_0813D184: - ldr r1, [r6] - adds r1, r5 - adds r1, r3 - ldr r2, =gUnknown_085B3F18 - ldrh r0, [r1] - adds r0, r2 - ldrb r0, [r0] - mov r2, r9 - orrs r0, r2 - strh r0, [r1] -_0813D198: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x0000027f - cmp r4, r0 - bls _0813D108 - 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_813CF0C - - thumb_func_start sub_813D1C8 -sub_813D1C8: @ 813D1C8 - push {lr} - ldr r1, =0x0203ab7c - ldr r2, [r1] - movs r3, 0x89 - lsls r3, 1 - adds r0, r2, r3 - ldrh r0, [r0] - adds r3, r1, 0 - cmp r0, 0 - beq _0813D1FC - movs r1, 0x88 - lsls r1, 1 - adds r0, r2, r1 - ldrh r0, [r0] - cmp r0, 0 - bne _0813D1FC - ldr r0, =0x0000061e - adds r1, r2, r0 - movs r0, 0x1 - strb r0, [r1] - b _0813D206 - .pool -_0813D1FC: - ldr r0, [r3] - ldr r1, =0x0000061e - adds r0, r1 - movs r1, 0 - strb r1, [r0] -_0813D206: - ldr r1, [r3] - ldr r2, =0x00000616 - adds r0, r1, r2 - movs r2, 0 - strh r2, [r0] - movs r3, 0xC3 - lsls r3, 3 - adds r0, r1, r3 - strh r2, [r0] - adds r3, 0x2 - adds r0, r1, r3 - strh r2, [r0] - ldr r0, =0x0000061c - adds r2, r1, r0 - movs r0, 0x40 - strh r0, [r2] - ldr r2, =0x0000061f - adds r1, r2 - movs r0, 0x1 - strb r0, [r1] - ldr r1, =0x00003f44 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - bl sub_813D25C - pop {r0} - bx r0 - .pool - thumb_func_end sub_813D1C8 - - thumb_func_start sub_813D25C -sub_813D25C: @ 813D25C - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x0203ab7c - ldr r2, [r0] - ldr r3, =0x0000061e - adds r1, r2, r3 - ldrb r1, [r1] - adds r7, r0, 0 - cmp r1, 0 - bne _0813D32A - ldr r0, =0x00000616 - adds r1, r2, r0 - ldrh r0, [r1] - cmp r0, 0 - bne _0813D324 - movs r1, 0xC3 - lsls r1, 3 - adds r0, r2, r1 - ldrh r1, [r0] - adds r1, 0x1 - strh r1, [r0] - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0813D2A4 - subs r3, 0x4 - adds r0, r2, r3 - b _0813D2A8 - .pool -_0813D2A4: - ldr r1, =0x0000061c - adds r0, r2, r1 -_0813D2A8: - ldrh r1, [r0] - adds r1, 0x4 - movs r2, 0x7F - ands r1, r2 - strh r1, [r0] - ldr r3, =gUnknown_08329F40 - ldr r1, [r7] - ldr r2, =0x0000061a - adds r0, r1, r2 - ldrh r0, [r0] - lsls r0, 1 - adds r0, r3 - ldrh r2, [r0] - lsls r2, 16 - asrs r2, 20 - lsls r2, 16 - ldr r0, =0x0000061c - adds r1, r0 - ldrh r0, [r1] - lsls r0, 1 - adds r0, r3 - ldrh r1, [r0] - lsls r1, 16 - asrs r1, 20 - lsls r1, 24 - orrs r1, r2 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldr r1, [r7] - ldr r2, =0x00000616 - adds r0, r1, r2 - movs r3, 0 - strh r3, [r0] - movs r0, 0xC3 - lsls r0, 3 - adds r2, r1, r0 - ldrh r0, [r2] - cmp r0, 0x40 - bne _0813D3C6 - strh r3, [r2] - movs r2, 0x89 - lsls r2, 1 - adds r0, r1, r2 - ldrh r0, [r0] - cmp r0, 0 - beq _0813D3C6 - ldr r3, =0x0000061e - adds r1, r3 - movs r0, 0x1 - b _0813D3C4 - .pool -_0813D324: - subs r0, 0x1 - strh r0, [r1] - b _0813D3C6 -_0813D32A: - ldr r0, =0x00000616 - adds r1, r2, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xC - bls _0813D3C6 - movs r0, 0 - strh r0, [r1] - ldr r3, =0x0000061f - adds r1, r2, r3 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r4, 0 - ldr r0, [r7] - movs r6, 0x89 - lsls r6, 1 - adds r0, r6 - ldrh r0, [r0] - cmp r4, r0 - bcs _0813D3A0 - adds r5, r7, 0 - movs r0, 0x1 - mov r12, r0 - movs r1, 0x5 - negs r1, r1 - mov r8, r1 -_0813D366: - ldr r1, [r5] - lsls r2, r4, 2 - movs r3, 0xCC - lsls r3, 3 - adds r0, r1, r3 - adds r0, r2 - ldr r3, [r0] - ldr r0, =0x0000061f - adds r1, r0 - ldrb r0, [r1] - movs r1, 0x1 - adds r3, 0x3E - ands r1, r0 - mov r2, r12 - ands r1, r2 - lsls r1, 2 - ldrb r2, [r3] - mov r0, r8 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, [r5] - adds r0, r6 - ldrh r0, [r0] - cmp r4, r0 - bcc _0813D366 -_0813D3A0: - ldr r0, [r7] - ldr r3, =0x0000061f - adds r1, r0, r3 - ldrb r0, [r1] - cmp r0, 0x4 - bls _0813D3C6 - movs r0, 0x1 - strb r0, [r1] - ldr r1, [r7] - movs r2, 0x88 - lsls r2, 1 - adds r0, r1, r2 - ldrh r0, [r0] - cmp r0, 0 - beq _0813D3C6 - subs r3, 0x1 - adds r1, r3 - movs r0, 0 -_0813D3C4: - strb r0, [r1] -_0813D3C6: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813D25C - - thumb_func_start sub_813D3D8 -sub_813D3D8: @ 813D3D8 - push {r4-r6,lr} - adds r4, r0, 0 - adds r6, r1, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r5, =0x0203ab7c - ldr r0, =0x000015bc - bl AllocZeroed - str r0, [r5] - movs r1, 0 - movs r5, 0 - strh r4, [r0, 0xE] - movs r2, 0xDD - lsls r2, 3 - adds r0, r2 - str r6, [r0] - strb r1, [r6] - ldr r0, =sub_813D42C - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r5, [r1, 0x8] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813D3D8 - - thumb_func_start sub_813D42C -sub_813D42C: @ 813D42C - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - 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, 0xB - bls _0813D44A - b _0813D584 -_0813D44A: - lsls r0, 2 - ldr r1, =_0813D45C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0813D45C: - .4byte _0813D48C - .4byte _0813D4A8 - .4byte _0813D4D4 - .4byte _0813D4E6 - .4byte _0813D4EC - .4byte _0813D4F8 - .4byte _0813D520 - .4byte _0813D526 - .4byte _0813D52C - .4byte _0813D532 - .4byte _0813D544 - .4byte _0813D56C -_0813D48C: - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - movs r0, 0x3 - bl HideBg - movs r0, 0x2 - bl HideBg - movs r0, 0 - bl HideBg - b _0813D584 -_0813D4A8: - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x3 - bl SetBgAttribute - ldr r0, =gUnknown_085B4018 - bl sub_81C4D70 - ldr r0, =0x0203ab7c - ldr r0, [r0] - movs r1, 0xF7 - lsls r1, 4 - adds r0, r1 - movs r1, 0 - movs r2, 0x10 - bl RepeatChar - b _0813D584 - .pool -_0813D4D4: - bl sub_81C4E90 - cmp r0, 0x1 - beq _0813D594 - movs r0, 0x8 - negs r0, r0 - bl sub_81C4ED0 - b _0813D584 -_0813D4E6: - bl sub_813CA54 - b _0813D584 -_0813D4EC: - bl sub_813CA68 - lsls r0, 24 - cmp r0, 0 - bne _0813D594 - b _0813D584 -_0813D4F8: - ldr r0, =0x0203ab7c - ldr r0, [r0] - ldr r2, =0x000006ec - adds r0, r2 - bl sub_8122D88 - movs r0, 0x1 - movs r1, 0x1 - bl sub_8124288 - movs r1, 0x8 - negs r1, r1 - movs r0, 0 - bl sub_8123824 - b _0813D584 - .pool -_0813D520: - bl sub_813D6D0 - b _0813D584 -_0813D526: - bl sub_813D8A8 - b _0813D584 -_0813D52C: - bl sub_813D8E8 - b _0813D584 -_0813D532: - movs r0, 0x15 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - b _0813D584 -_0813D544: - ldr r1, =0x00003f41 - movs r0, 0x50 - bl SetGpuReg - bl sub_813D1C8 - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0 - bl SetGpuRegBits - b _0813D584 - .pool -_0813D56C: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r2 - ldr r1, =sub_813D5A0 - str r1, [r0] - movs r1, 0 - strh r1, [r0, 0x8] - b _0813D594 - .pool -_0813D584: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_0813D594: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813D42C - - thumb_func_start sub_813D5A0 -sub_813D5A0: @ 813D5A0 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_813D25C - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r6, r0, r1 - movs r0, 0x8 - ldrsh r1, [r6, r0] - cmp r1, 0x1 - beq _0813D5F8 - cmp r1, 0x1 - bgt _0813D5CC - cmp r1, 0 - beq _0813D5E2 - b _0813D5D4 - .pool -_0813D5CC: - cmp r1, 0x2 - beq _0813D640 - cmp r1, 0x3 - beq _0813D652 -_0813D5D4: - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r0, 0 - strh r0, [r1, 0x8] -_0813D5E2: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0813D6A8 - b _0813D698 - .pool -_0813D5F8: - ldr r0, =0x030022c0 - ldrh r2, [r0, 0x2E] - movs r3, 0x2 - adds r0, r3, 0 - ands r0, r2 - cmp r0, 0 - beq _0813D614 - strh r1, [r6, 0xA] - movs r0, 0x3 - bl audio_play - b _0813D698 - .pool -_0813D614: - movs r0, 0x10 - ands r0, r2 - cmp r0, 0 - bne _0813D630 - movs r0, 0x80 - lsls r0, 1 - ands r0, r2 - cmp r0, 0 - beq _0813D6A8 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x13] - cmp r0, 0x1 - bne _0813D6A8 -_0813D630: - strh r3, [r6, 0xA] - movs r0, 0x6D - bl audio_play - b _0813D698 - .pool -_0813D640: - movs r0, 0x15 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _0813D698 -_0813D652: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0 - bne _0813D6A8 - bl sub_813D824 - ldr r4, =0x0203ab7c - ldr r0, [r4] - movs r1, 0xDD - lsls r1, 3 - adds r0, r1 - ldr r1, [r0] - ldrh r0, [r6, 0xA] - strb r0, [r1] - bl sub_813D6B4 - adds r0, r5, 0 - bl DestroyTask - bl sub_81C4EB4 - ldr r0, [r4] - bl Free - str r7, [r4] - b _0813D6A8 - .pool -_0813D698: - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_0813D6A8: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813D5A0 - - thumb_func_start sub_813D6B4 -sub_813D6B4: @ 813D6B4 - push {lr} - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0 - bl SetBgAttribute - movs r0, 0x3 - movs r1, 0x4 - movs r2, 0 - bl SetBgAttribute - pop {r0} - bx r0 - thumb_func_end sub_813D6B4 - - thumb_func_start sub_813D6D0 -sub_813D6D0: @ 813D6D0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =gUnknown_085B401C - bl LoadObjectPic - ldr r0, =gUnknown_085B4024 - bl LoadTaggedObjectPalette - ldr r0, =0x03001204 - movs r1, 0 - strh r1, [r0] - ldr r2, =0x03001200 - strh r1, [r2] - ldr r1, =0x0203ab7c - ldr r0, [r1] - movs r3, 0x89 - lsls r3, 1 - adds r0, r3 - ldrh r0, [r0] - cmp r0, 0 - beq _0813D7D8 - ldr r5, =0x03001202 - mov r10, r1 - adds r7, r2, 0 - ldr r0, =0x030011fc - mov r9, r0 - ldr r6, =gRegionMapEntries - ldr r1, =0x030011fe - mov r8, r1 -_0813D710: - mov r2, r10 - ldr r1, [r2] - movs r3, 0 - ldrsh r0, [r7, r3] - lsls r0, 1 - movs r2, 0xC4 - lsls r2, 3 - adds r1, r2 - adds r1, r0 - ldrh r0, [r1] - strh r0, [r5] - movs r3, 0 - ldrsh r0, [r5, r3] - lsls r0, 3 - adds r0, r6 - ldrb r1, [r0] - adds r1, 0x1 - lsls r1, 3 - adds r1, 0x4 - mov r0, r9 - strh r1, [r0] - movs r2, 0 - ldrsh r0, [r5, r2] - lsls r0, 3 - adds r0, r6 - ldrb r2, [r0, 0x1] - lsls r2, 3 - adds r2, 0x1C - mov r3, r8 - strh r2, [r3] - movs r3, 0 - ldrsh r0, [r5, r3] - lsls r0, 3 - adds r0, r6 - ldrb r0, [r0, 0x2] - subs r0, 0x1 - lsls r0, 2 - adds r1, r0 - mov r0, r9 - strh r1, [r0] - movs r1, 0 - ldrsh r0, [r5, r1] - lsls r0, 3 - adds r0, r6 - ldrb r0, [r0, 0x3] - subs r0, 0x1 - lsls r0, 2 - adds r2, r0 - mov r3, r8 - strh r2, [r3] - mov r0, r9 - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0 - ldrsh r2, [r3, r0] - ldr r0, =gUnknown_085B4034 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _0813D7BE - ldr r0, =0x02020630 - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r0 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r3] - mov r1, r10 - ldr r3, [r1] - ldr r4, =0x03001204 - ldrh r1, [r4] - adds r0, r1, 0x1 - strh r0, [r4] - lsls r1, 16 - asrs r1, 14 - movs r0, 0xCC - lsls r0, 3 - adds r3, r0 - adds r3, r1 - str r2, [r3] -_0813D7BE: - ldrh r0, [r7] - adds r0, 0x1 - strh r0, [r7] - movs r2, 0 - ldrsh r1, [r7, r2] - mov r3, r10 - ldr r0, [r3] - movs r2, 0x89 - lsls r2, 1 - adds r0, r2 - ldrh r0, [r0] - cmp r1, r0 - blt _0813D710 -_0813D7D8: - ldr r0, =0x0203ab7c - ldr r0, [r0] - ldr r1, =0x03001204 - ldrh r1, [r1] - movs r3, 0xDC - lsls r3, 3 - adds r0, r3 - strh 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_813D6D0 - - thumb_func_start sub_813D824 -sub_813D824: @ 813D824 - push {r4,r5,lr} - movs r0, 0x2 - bl FreeObjectTilesByTag - movs r0, 0x2 - bl FreeObjectPaletteByTag - movs r4, 0 - ldr r1, =0x0203ab7c - ldr r0, [r1] - movs r2, 0xDC - lsls r2, 3 - adds r0, r2 - ldrh r0, [r0] - cmp r4, r0 - bcs _0813D86C - adds r5, r1, 0 -_0813D846: - ldr r0, [r5] - lsls r1, r4, 2 - movs r2, 0xCC - lsls r2, 3 - adds r0, r2 - adds r0, r1 - ldr r0, [r0] - bl RemoveObjectAndFreeTiles - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, [r5] - movs r1, 0xDC - lsls r1, 3 - adds r0, r1 - ldrh r0, [r0] - cmp r4, r0 - bcc _0813D846 -_0813D86C: - movs r0, 0x3 - bl FreeObjectTilesByTag - movs r0, 0x3 - bl FreeObjectPaletteByTag - movs r4, 0 -_0813D87A: - ldr r0, =0x0203ab7c - ldr r0, [r0] - lsls r1, r4, 2 - movs r2, 0xFB - lsls r2, 4 - adds r0, r2 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - beq _0813D892 - bl RemoveObjectAndFreeTiles -_0813D892: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x2 - bls _0813D87A - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813D824 - - thumb_func_start sub_813D8A8 -sub_813D8A8: @ 813D8A8 - push {lr} - sub sp, 0x8 - ldr r0, =0x0203ab7c - ldr r1, [r0] - ldr r0, =0x00000fbc - adds r1, r0 - str r1, [sp] - ldr r0, =0x00030600 - str r0, [sp, 0x4] - ldr r0, =gUnknown_08DC4140 - bl LZ77UnCompWram - mov r0, sp - bl LoadObjectPic - ldr r0, =gUnknown_085B40EC - bl LoadTaggedObjectPalette - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_813D8A8 - - thumb_func_start sub_813D8E8 -sub_813D8E8: @ 813D8E8 - push {r4-r6,lr} - ldr r1, =0x0203ab7c - ldr r0, [r1] - movs r2, 0x88 - lsls r2, 1 - adds r0, r2 - ldr r0, [r0] - cmp r0, 0 - beq _0813D920 - movs r4, 0 - adds r5, r1, 0 - movs r3, 0xFB - lsls r3, 4 - movs r2, 0 -_0813D904: - ldr r0, [r5] - lsls r1, r4, 2 - adds r0, r3 - adds r0, r1 - str r2, [r0] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x2 - bls _0813D904 - b _0813D9A4 - .pool -_0813D920: - movs r4, 0 - ldr r5, =0x02020630 -_0813D924: - lsls r1, r4, 21 - movs r6, 0xA0 - lsls r6, 16 - adds r1, r6 - asrs r1, 16 - ldr r0, =gUnknown_085B40FC - movs r2, 0x8C - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _0813D988 - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - adds r3, r5 - ldrh r2, [r3, 0x4] - lsls r0, r2, 22 - lsrs r0, 22 - lsls r1, r4, 4 - adds r0, r1 - ldr r6, =0x000003ff - adds r1, r6, 0 - ands r0, r1 - ldr r6, =0xfffffc00 - adds r1, r6, 0 - ands r2, r1 - orrs r2, r0 - strh r2, [r3, 0x4] - ldr r0, =0x0203ab7c - ldr r0, [r0] - lsls r1, r4, 2 - movs r2, 0xFB - lsls r2, 4 - adds r0, r2 - adds r0, r1 - str r3, [r0] - b _0813D99A - .pool -_0813D988: - ldr r0, =0x0203ab7c - ldr r1, [r0] - lsls r0, r4, 2 - movs r6, 0xFB - lsls r6, 4 - adds r1, r6 - adds r1, r0 - movs r0, 0 - str r0, [r1] -_0813D99A: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x2 - bls _0813D924 -_0813D9A4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813D8E8 - - thumb_func_start sub_813D9B0 -sub_813D9B0: @ 813D9B0 - push {lr} - bl fade_and_return_progress_probably - bl RunTasks - pop {r0} - bx r0 - thumb_func_end sub_813D9B0 - - thumb_func_start sub_813D9C0 -sub_813D9C0: @ 813D9C0 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r2, r0, 24 - movs r7, 0 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r6, r0, r1 - movs r1, 0x8 - ldrsh r0, [r6, r1] - cmp r0, 0 - beq _0813D9E8 - cmp r0, 0x1 - beq _0813DA00 - b _0813DA30 - .pool -_0813D9E8: - movs r0, 0x1 - negs r0, r0 - str r7, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - b _0813DA30 -_0813DA00: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0813DA30 - movs r0, 0x1C - ldrsh r1, [r6, r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r7, r1, r0 - ldrh r4, [r6, 0xC] - ldrb r5, [r6, 0xE] - ldrb r6, [r6, 0x1C] - adds r0, r2, 0 - bl DestroyTask - adds r0, r7, 0 - adds r1, r4, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl evolution_cutscene -_0813DA30: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813D9C0 - - thumb_func_start sub_813DA40 -sub_813DA40: @ 813DA40 - push {r4-r6,lr} - 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 r0, =sub_813D9C0 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0 - strh r0, [r1, 0x8] - strh r4, [r1, 0xC] - strh r5, [r1, 0xE] - strh r6, [r1, 0x1C] - ldr r0, =sub_813D9B0 - bl SetMainCallback2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813DA40 - - thumb_func_start evolution_cutscene -evolution_cutscene: @ 813DA8C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - adds r4, r0, 0 - mov r10, r1 - mov r0, r10 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x18] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x1C] - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - movs r1, 0 - str r1, [sp, 0x14] - add r0, sp, 0x14 - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - bl CpuSet - 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 - bl sub_80A1A74 - ldr r0, =0x02022e14 - movs r2, 0 - strh r2, [r0] - ldr r0, =0x02022e16 - strh r2, [r0] - ldr r0, =0x02022e18 - strh r2, [r0] - ldr r0, =0x02022e1a - strh r2, [r0] - ldr r0, =0x02022e1c - strh r2, [r0] - ldr r0, =0x02022e1e - strh r2, [r0] - ldr r1, =0x02022e20 - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r1] - ldr r0, =0x02022e22 - movs r1, 0 - strh r1, [r0] - ldr r1, =0x02022ff0 - movs r0, 0x9 - strb r0, [r1] - bl c2_berry_program_update_menu - bl sub_8035AA4 - bl ResetAllObjectData - bl remove_some_task - bl ResetTasks - bl ResetObjectPaletteAllocator - ldr r0, =0x0300301c - movs r2, 0x4 - strb r2, [r0] - movs r0, 0x64 - bl AllocZeroed - ldr r1, =0x0203ab80 - str r0, [r1] - bl init_uns_table_pokemon_copy - adds r0, r4, 0 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - ldr r0, =0x02021cc4 - mov r1, sp - bl CopyString_Limit10 - ldr r0, =0x02021dc4 - movs r1, 0xB - mov r2, r10 - muls r2, r1 - adds r1, r2, 0 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0x1 - bl pokemon_getattr - str r0, [sp, 0x20] - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - mov r9, r0 - lsls r0, r5, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r2, =0x020244d4 - ldr r1, [r2] - ldr r1, [r1, 0x8] - adds r2, r5, 0 - bl DecompressPicFromTable_2 - adds r0, r5, 0 - ldr r1, [sp, 0x20] - mov r2, r9 - bl sub_806E7CC - ldr r0, [r0] - movs r1, 0x88 - lsls r1, 1 - movs r2, 0x20 - bl decompress_palette - adds r0, r5, 0 - movs r1, 0x1 - bl sub_806A068 - ldr r0, =0x0202499c - mov r8, r0 - ldr r1, =gDummyObjectRotScalAnimTable - str r1, [r0, 0x10] - movs r1, 0x78 - movs r2, 0x40 - movs r3, 0x1E - bl AddObjectToFront - ldr r1, =0x0203ab80 - ldr r2, [r1] - lsls r1, r0, 24 - lsrs r3, r1, 24 - strb r0, [r2] - ldr r7, =0x02020630 - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - adds r6, r7, 0 - adds r6, 0x1C - adds r0, r1, r6 - ldr r2, =nullsub_18 - str r2, [r0] - adds r1, r7 - ldrb r2, [r1, 0x5] - movs r4, 0xF - adds r0, r4, 0 - ands r0, r2 - movs r2, 0x10 - orrs r0, r2 - strb r0, [r1, 0x5] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - mov r1, r10 - lsls r0, r1, 3 - ldr r2, =gMonFrontPicTable - adds r0, r2 - ldr r2, =0x020244d4 - ldr r1, [r2] - ldr r1, [r1, 0x10] - mov r2, r10 - bl DecompressPicFromTable_2 - mov r0, r10 - ldr r1, [sp, 0x20] - mov r2, r9 - bl sub_806E7CC - ldr r0, [r0] - movs r1, 0x90 - lsls r1, 1 - movs r2, 0x20 - bl decompress_palette - mov r0, r10 - movs r1, 0x3 - bl sub_806A068 - ldr r0, =gDummyObjectRotScalAnimTable - mov r1, r8 - str r0, [r1, 0x10] - mov r0, r8 - movs r1, 0x78 - movs r2, 0x40 - movs r3, 0x1E - bl AddObjectToFront - ldr r1, =0x0203ab80 - ldr r2, [r1] - lsls r1, r0, 24 - lsrs r3, r1, 24 - strb r0, [r2, 0x1] - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - adds r6, r1, r6 - ldr r2, =nullsub_18 - str r2, [r6] - adds r1, r7 - ldrb r0, [r1, 0x5] - ands r4, r0 - movs r0, 0x20 - orrs r4, r0 - strb r4, [r1, 0x5] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_817BE78 - ldr r0, =evovle_mon_maybe - movs r1, 0 - bl CreateTask - ldr r1, =0x0203ab80 - ldr r2, [r1] - lsls r1, r0, 24 - lsrs r3, r1, 24 - strb r0, [r2, 0x2] - ldr r1, =0x03005e00 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - strh r2, [r0, 0x8] - strh r5, [r0, 0xA] - mov r1, r10 - strh r1, [r0, 0xC] - mov r2, sp - ldrh r2, [r2, 0x18] - strh r2, [r0, 0xE] - movs r1, 0x1 - strh r1, [r0, 0x10] - movs r1, 0 - strh r1, [r0, 0x1A] - mov r2, sp - ldrh r2, [r2, 0x1C] - strh r2, [r0, 0x1C] - ldr r1, =0x0203ab80 - ldr r0, [r1] - ldr r1, =0x02037754 - adds r0, 0x4 - movs r2, 0x60 - bl memcpy - movs r1, 0xFA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r0, =nullsub_83 - bl SetHBlankCallback - ldr r0, =sub_813FCDC - bl SetVBlankCallback - bl m4aMPlayAllStop - ldr r0, =sub_813E3A4 - bl SetMainCallback2 - 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 evolution_cutscene - - thumb_func_start sub_813DD7C -sub_813DD7C: @ 813DD7C - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x8 - ldr r2, =0x03005e00 - ldr r0, =0x0203ab80 - mov r8, r0 - ldr r0, [r0] - ldrb r1, [r0, 0x2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x1C - ldrsh r2, [r0, r1] - movs r1, 0x64 - adds r4, r2, 0 - muls r4, r1 - ldr r1, =0x020244ec - adds r4, r1 - ldrh r5, [r0, 0xC] - adds r0, r4, 0 - movs r1, 0x1 - bl pokemon_getattr - mov r9, r0 - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - adds r6, r0, 0 - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - movs r4, 0 - str r4, [sp, 0x4] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - add r0, sp, 0x4 - bl CpuSet - 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 - bl sub_80A1A74 - ldr r0, =0x02022e14 - strh r4, [r0] - ldr r0, =0x02022e16 - strh r4, [r0] - ldr r0, =0x02022e18 - strh r4, [r0] - ldr r0, =0x02022e1a - strh r4, [r0] - ldr r0, =0x02022e1c - strh r4, [r0] - ldr r0, =0x02022e1e - strh r4, [r0] - ldr r1, =0x02022e20 - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r1] - ldr r0, =0x02022e22 - strh r4, [r0] - ldr r1, =0x02022ff0 - movs r0, 0x9 - strb r0, [r1] - bl c2_berry_program_update_menu - bl sub_8035AA4 - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - ldr r1, =0x0300301c - movs r0, 0x4 - strb r0, [r1] - lsls r0, r5, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - ldr r1, [r1, 0x10] - adds r2, r5, 0 - bl DecompressPicFromTable_2 - adds r0, r5, 0 - mov r1, r9 - adds r2, r6, 0 - bl sub_806E7CC - ldr r0, [r0] - movs r1, 0x90 - lsls r1, 1 - movs r2, 0x20 - bl decompress_palette - adds r0, r5, 0 - movs r1, 0x3 - bl sub_806A068 - ldr r0, =0x0202499c - ldr r1, =gDummyObjectRotScalAnimTable - str r1, [r0, 0x10] - movs r1, 0x78 - movs r2, 0x40 - movs r3, 0x1E - bl AddObjectToFront - mov r2, r8 - ldr r1, [r2] - lsls r2, r0, 24 - lsrs r2, 24 - strb r0, [r1, 0x1] - ldr r3, =0x02020630 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r0, r3, 0 - adds r0, 0x1C - adds r0, r1, r0 - ldr r2, =nullsub_18 - str r2, [r0] - adds r1, r3 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - movs r2, 0x20 - orrs r0, r2 - strb r0, [r1, 0x5] - movs r1, 0xFA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r0, =nullsub_83 - bl SetHBlankCallback - ldr r0, =sub_813FCDC - bl SetVBlankCallback - ldr r0, =sub_813E3A4 - bl SetMainCallback2 - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813DD7C - - thumb_func_start sub_813DF70 -sub_813DF70: @ 813DF70 - push {r4-r6,lr} - sub sp, 0xC - ldr r2, =0x03005e00 - ldr r0, =0x0203ab80 - ldr r0, [r0] - ldrb r1, [r0, 0x2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x1C - ldrsh r2, [r0, r1] - movs r1, 0x64 - muls r2, r1 - ldr r1, =0x020244ec - adds r4, r2, r1 - ldrh r6, [r0, 0xC] - ldr r0, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r0, r3 - ldrb r0, [r0] - cmp r0, 0x7 - bls _0813DFA2 - b _0813E1C8 -_0813DFA2: - lsls r0, 2 - ldr r1, =_0813DFC0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0813DFC0: - .4byte _0813DFE0 - .4byte _0813E050 - .4byte _0813E078 - .4byte _0813E07E - .4byte _0813E0A8 - .4byte _0813E0F0 - .4byte _0813E160 - .4byte _0813E198 -_0813DFE0: - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - bl SetVBlankCallback - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - ldr r1, =0x0300301c - movs r0, 0x4 - strb r0, [r1] - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r0, =0x02022e18 - strh r1, [r0] - ldr r0, =0x02022e1a - strh r1, [r0] - ldr r0, =0x02022e1c - strh r1, [r0] - ldr r0, =0x02022e1e - strh r1, [r0] - ldr r2, =0x02022e20 - movs r3, 0x80 - lsls r3, 1 - adds r0, r3, 0 - strh r0, [r2] - ldr r0, =0x02022e22 - strh r1, [r0] - b _0813E180 - .pool -_0813E050: - bl sub_80A1A74 - ldr r0, =nullsub_83 - bl SetHBlankCallback - ldr r0, =sub_813FD64 - bl SetVBlankCallback - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _0813E188 - .pool -_0813E078: - bl sub_807F19C - b _0813E180 -_0813E07E: - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _0813E188 - .pool -_0813E0A8: - adds r0, r4, 0 - movs r1, 0x1 - bl pokemon_getattr - adds r5, r0, 0 - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r0, r6, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - ldr r1, [r1, 0x10] - adds r2, r6, 0 - bl DecompressPicFromTable_2 - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_806E7CC - ldr r0, [r0] - movs r1, 0x90 - lsls r1, 1 - movs r2, 0x20 - bl decompress_palette - b _0813E180 - .pool -_0813E0F0: - adds r0, r6, 0 - movs r1, 0x1 - bl sub_806A068 - ldr r0, =0x0202499c - ldr r1, =gDummyObjectRotScalAnimTable - str r1, [r0, 0x10] - movs r1, 0x78 - movs r2, 0x40 - movs r3, 0x1E - bl AddObjectToFront - ldr r1, =0x0203ab80 - ldr r1, [r1] - lsls r2, r0, 24 - lsrs r2, 24 - strb r0, [r1, 0x1] - ldr r3, =0x02020630 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r0, r3, 0 - adds r0, 0x1C - adds r0, r1, r0 - ldr r2, =nullsub_18 - str r2, [r0] - adds r1, r3 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - movs r2, 0x20 - orrs r0, r2 - strb r0, [r1, 0x5] - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - bl sub_807B154 - b _0813E1C8 - .pool -_0813E160: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _0813E174 - bl sub_800E0E8 - movs r0, 0 - movs r1, 0 - bl sub_800DFB4 -_0813E174: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 -_0813E180: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 -_0813E188: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0813E1C8 - .pool -_0813E198: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - bl sub_807B140 - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - ldr r0, =sub_813E3C0 - bl SetMainCallback2 - movs r1, 0x9A - lsls r1, 5 - movs r0, 0 - bl SetGpuReg -_0813E1C8: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813DF70 - - thumb_func_start sub_813E1D4 -sub_813E1D4: @ 813E1D4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 24 - lsrs r6, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x14] - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - ldr r0, =0x02021cc4 - mov r1, sp - bl CopyString_Limit10 - ldr r0, =0x02021dc4 - movs r1, 0xB - muls r1, r5 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - ldr r1, =0x02021cc0 - movs r0, 0x1 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - mov r8, r0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - adds r7, r0, 0 - adds r0, r4, 0 - movs r1, 0x1 - bl pokemon_getattr - mov r10, r0 - ldr r1, =0x0203ab80 - mov r9, r1 - movs r0, 0x64 - bl AllocZeroed - mov r2, r9 - str r0, [r2] - movs r4, 0 - strb r6, [r0] - lsls r0, r5, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - ldr r1, [r1, 0x8] - adds r2, r5, 0 - bl DecompressPicFromTable_2 - adds r0, r5, 0 - mov r1, r10 - adds r2, r7, 0 - bl sub_806E7CC - ldr r0, [r0] - movs r1, 0x90 - lsls r1, 1 - movs r2, 0x20 - bl decompress_palette - adds r0, r5, 0 - movs r1, 0x1 - bl sub_806A068 - ldr r0, =0x0202499c - ldr r1, =gDummyObjectRotScalAnimTable - str r1, [r0, 0x10] - movs r1, 0x78 - movs r2, 0x40 - movs r3, 0x1E - bl AddObjectToFront - mov r1, r9 - ldr r2, [r1] - lsls r1, r0, 24 - lsrs r6, r1, 24 - strb r0, [r2, 0x1] - ldr r3, =0x02020630 - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - adds r0, r3, 0 - adds r0, 0x1C - adds r0, r1, r0 - ldr r2, =nullsub_18 - str r2, [r0] - adds r1, r3 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - movs r2, 0x20 - orrs r0, r2 - strb r0, [r1, 0x5] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bl sub_817BE78 - ldr r0, =sub_813F1B8 - movs r1, 0 - bl CreateTask - mov r1, r9 - ldr r2, [r1] - lsls r1, r0, 24 - lsrs r6, r1, 24 - strb r0, [r2, 0x2] - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - strh r4, [r0, 0x8] - mov r2, r8 - strh r2, [r0, 0xA] - strh r5, [r0, 0xC] - movs r1, 0x1 - strh r1, [r0, 0x10] - strh r4, [r0, 0x1A] - mov r1, sp - ldrh r1, [r1, 0x14] - strh r1, [r0, 0x1C] - ldr r0, =0x02022e14 - strh r4, [r0] - ldr r0, =0x02022e16 - strh r4, [r0] - ldr r0, =0x02022e18 - strh r4, [r0] - ldr r0, =0x02022e1a - strh r4, [r0] - ldr r0, =0x02022e1c - strh r4, [r0] - ldr r0, =0x02022e1e - strh r4, [r0] - ldr r1, =0x02022e20 - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r1] - ldr r0, =0x02022e22 - strh r4, [r0] - ldr r2, =0x03003014 - ldrb r0, [r2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_813FD64 - bl SetVBlankCallback - ldr r0, =sub_813E3C0 - bl SetMainCallback2 - 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_813E1D4 - - thumb_func_start sub_813E3A4 -sub_813E3A4: @ 813E3A4 - push {lr} - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - bl RunTasks - pop {r0} - bx r0 - thumb_func_end sub_813E3A4 - - thumb_func_start sub_813E3C0 -sub_813E3C0: @ 813E3C0 - push {lr} - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - bl RunTasks - pop {r0} - bx r0 - thumb_func_end sub_813E3C0 - - thumb_func_start evovle_mon_internal_maybe -evovle_mon_internal_maybe: @ 813E3DC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - str r1, [sp, 0x4] - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - movs r0, 0 - str r0, [sp] - mov r0, r10 - lsls r0, 2 - str r0, [sp, 0x8] - add r0, r10 - lsls r7, r0, 3 - ldr r1, =gEvolutionTable - adds r1, r7 - mov r8, r1 - ldrh r0, [r1] - cmp r0, 0xD - beq _0813E40C - b _0813E546 -_0813E40C: - ldr r6, =0x020244e9 - ldrb r0, [r6] - cmp r0, 0x5 - bls _0813E416 - b _0813E546 -_0813E416: - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - mov r9, r0 - ldr r1, [sp, 0x4] - movs r2, 0x64 - bl memcpy_pokemon - ldrb r0, [r6] - muls r0, r5 - adds r0, r4 - ldr r1, =gEvolutionTable - adds r2, r1, r7 - adds r2, 0xC - movs r1, 0xB - bl pokemon_setattr - ldrb r0, [r6] - muls r0, r5 - adds r0, r4 - mov r1, r8 - ldrh r2, [r1, 0xC] - movs r1, 0xB - muls r2, r1 - ldr r1, =gSpeciesNames - adds r2, r1 - movs r1, 0x2 - bl pokemon_setattr - ldrb r0, [r6] - muls r0, r5 - adds r0, r4 - movs r1, 0xC - mov r2, sp - bl pokemon_setattr - ldrb r0, [r6] - muls r0, r5 - adds r0, r4 - movs r1, 0x8 - mov r2, sp - bl pokemon_setattr - ldrb r0, [r6] - muls r0, r5 - adds r0, r4 - movs r1, 0xA - mov r2, sp - bl pokemon_setattr - movs r4, 0x32 - ldr r0, [sp, 0x8] - mov r8, r0 - adds r5, r6, 0 -_0813E484: - ldrb r1, [r5] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - adds r1, r4, 0 - mov r2, sp - bl pokemon_setattr - adds r4, 0x1 - cmp r4, 0x36 - ble _0813E484 - movs r4, 0x43 - ldr r7, =0x020244e9 -_0813E4A0: - ldrb r0, [r7] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - adds r1, r4, 0 - mov r2, sp - bl pokemon_setattr - adds r4, 0x1 - cmp r4, 0x4F - ble _0813E4A0 - ldr r4, =0x020244e9 - ldrb r0, [r4] - muls r0, r6 - adds r0, r5 - movs r1, 0x37 - mov r2, sp - bl pokemon_setattr - movs r0, 0xFF - str r0, [sp] - ldrb r0, [r4] - muls r0, r6 - adds r0, r5 - movs r1, 0x40 - mov r2, sp - bl pokemon_setattr - ldrb r0, [r4] - muls r0, r6 - adds r0, r5 - bl pokemon_calc_effective_stats - bl calc_player_party_count - ldr r0, =gEvolutionTable - mov r4, r8 - add r4, r10 - lsls r4, 3 - adds r4, r0 - ldrh r0, [r4, 0xC] - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x2 - bl pokedex_flag_operation - ldrh r0, [r4, 0xC] - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl pokedex_flag_operation - mov r0, r9 - movs r1, 0xB - bl pokemon_getattr - ldr r1, =0x0000012f - cmp r0, r1 - bne _0813E546 - mov r0, r9 - movs r1, 0x3 - bl pokemon_getattr - cmp r0, 0x1 - bne _0813E546 - ldr r0, [sp, 0x4] - movs r1, 0xB - bl pokemon_getattr - movs r1, 0x97 - lsls r1, 1 - cmp r0, r1 - bne _0813E546 - ldr r2, =gUnknown_085B58C4 - mov r0, r9 - movs r1, 0x2 - bl pokemon_setattr -_0813E546: - 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 evovle_mon_internal_maybe - - thumb_func_start evovle_mon_maybe -evovle_mon_maybe: @ 813E570 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r2, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r3, r0, r2 - movs r0, 0x1C - ldrsh r1, [r3, r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r1, r0 - mov r9, r1 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2C] - adds r5, r2, 0 - adds r6, r0, 0 - cmp r1, 0x2 - bne _0813E5F0 - movs r1, 0x8 - ldrsh r0, [r3, r1] - cmp r0, 0x8 - bne _0813E5F0 - ldr r4, =0x02024332 - ldrb r0, [r4, 0x2] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r5 - ldrb r0, [r1, 0x4] - cmp r0, 0 - beq _0813E5F0 - ldrh r1, [r3, 0xE] - movs r2, 0x1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _0813E5F0 - movs r0, 0x11 - strh r0, [r3, 0x8] - ldrb r1, [r4, 0x2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r2, [r0, 0x18] - bl sub_8140134 - bl _0813F1A4 - .pool -_0813E5F0: - lsls r1, r7, 2 - adds r0, r1, r7 - lsls r0, 3 - adds r0, r5 - movs r2, 0x8 - ldrsh r0, [r0, r2] - mov r8, r1 - cmp r0, 0x16 - bls _0813E606 - bl _0813F1A4 -_0813E606: - lsls r0, 2 - ldr r1, =_0813E614 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0813E614: - .4byte _0813E670 - .4byte _0813E6D4 - .4byte _0813E714 - .4byte _0813E740 - .4byte _0813E770 - .4byte _0813E7B0 - .4byte _0813E7E8 - .4byte _0813E828 - .4byte _0813E860 - .4byte _0813E8A4 - .4byte _0813E8C0 - .4byte _0813E8EC - .4byte _0813E918 - .4byte _0813E964 - .4byte _0813E990 - .4byte _0813EA1C - .4byte _0813EAC8 - .4byte _0813EB34 - .4byte _0813EB74 - .4byte _0813EBA8 - .4byte _0813EC10 - .4byte _0813EC6C - .4byte _0813ECA8 -_0813E670: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r2, =0x02020630 - ldr r0, =0x0203ab80 - ldr r0, [r0] - ldrb r1, [r0] - 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] - ldr r0, =0x03005e00 - mov r3, r8 - adds r1, r3, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - bl _0813F1A4 - .pool -_0813E6D4: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0813E6E4 - bl _0813F1A4 -_0813E6E4: - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085CC990 - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0 - bl battle_show_message_maybe - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - b _0813EC52 - .pool -_0813E714: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - beq _0813E724 - bl _0813F1A4 -_0813E724: - ldr r0, =0x0203ab80 - ldr r0, [r0] - ldrb r0, [r0] - ldr r1, =0x03005e00 - mov r3, r8 - adds r4, r3, r7 - lsls r4, 3 - adds r4, r1 - b _0813EB90 - .pool -_0813E740: - ldr r0, =0x0203ab80 - ldr r0, [r0] - ldrb r0, [r0] - bl sub_8140208 - cmp r0, 0 - bne _0813E752 - bl _0813F1A4 -_0813E752: - movs r0, 0xBC - lsls r0, 1 - bl audio_play - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - b _0813EC52 - .pool -_0813E770: - bl mplay_has_finished_maybe - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0813E780 - bl _0813F1A4 -_0813E780: - ldr r0, =0x00000179 - bl current_map_music_set - ldr r0, =0x03005e00 - mov r3, r8 - adds r1, r3, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - str r4, [sp] - movs r0, 0x1C - movs r1, 0x4 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - bl _0813F1A4 - .pool -_0813E7B0: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0813E7C0 - bl _0813F1A4 -_0813E7C0: - movs r0, 0 - bl sub_8140000 - movs r0, 0x11 - bl sub_817BE94 - ldr r1, =0x02024332 - strb r0, [r1, 0x2] - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - b _0813EC52 - .pool -_0813E7E8: - ldr r4, =0x02024332 - ldrb r0, [r4, 0x2] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r5 - ldrb r0, [r1, 0x4] - cmp r0, 0 - beq _0813E7FE - bl _0813F1A4 -_0813E7FE: - mov r3, r8 - adds r1, r3, r7 - lsls r1, 3 - adds r1, r5 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - ldr r0, =0x0203ab80 - ldr r1, [r0] - movs r0, 0x1 - strb r0, [r1, 0x3] - bl sub_817BFB4 - strb r0, [r4, 0x2] - bl _0813F1A4 - .pool -_0813E828: - ldr r4, =0x02024332 - ldrb r0, [r4, 0x2] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r5 - ldrb r0, [r1, 0x4] - cmp r0, 0 - beq _0813E83E - bl _0813F1A4 -_0813E83E: - ldr r0, =0x0203ab80 - ldr r1, [r0] - ldrb r0, [r1] - ldrb r1, [r1, 0x1] - bl sub_817C3A0 - strb r0, [r4, 0x2] - mov r0, r8 - adds r1, r0, r7 - lsls r1, 3 - adds r1, r5 - b _0813EC52 - .pool -_0813E860: - ldr r2, =0x0203ab80 - ldr r1, [r2] - ldrb r0, [r1, 0x3] - subs r0, 0x1 - strb r0, [r1, 0x3] - lsls r0, 24 - cmp r0, 0 - beq _0813E874 - bl _0813F1A4 -_0813E874: - ldr r1, [r2] - movs r0, 0x3 - strb r0, [r1, 0x3] - ldr r0, =0x02024332 - ldrb r1, [r0, 0x2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - ldrb r0, [r0, 0x4] - cmp r0, 0 - beq _0813E890 - bl _0813F1A4 -_0813E890: - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r5 - b _0813EC52 - .pool -_0813E8A4: - bl sub_817C068 - ldr r1, =0x02024332 - strb r0, [r1, 0x2] - ldr r0, =0x03005e00 - mov r3, r8 - adds r1, r3, r7 - lsls r1, 3 - adds r1, r0 - b _0813EC52 - .pool -_0813E8C0: - ldr r6, =0x02024332 - ldrb r0, [r6, 0x2] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r5 - ldrb r0, [r1, 0x4] - cmp r0, 0 - beq _0813E8D6 - bl _0813F1A4 -_0813E8D6: - mov r0, r8 - adds r4, r0, r7 - lsls r4, 3 - adds r4, r5 - ldrh r0, [r4, 0xC] - bl sub_817C144 - strb r0, [r6, 0x2] - b _0813EB96 - .pool -_0813E8EC: - ldr r0, =0x02024332 - ldrb r1, [r0, 0x2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - ldrb r0, [r0, 0x4] - cmp r0, 0 - beq _0813E902 - bl _0813F1A4 -_0813E902: - movs r0, 0x21 - bl audio_play - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r5 - b _0813EC52 - .pool -_0813E918: - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - bne _0813E926 - bl _0813F1A4 -_0813E926: - bl m4aMPlayAllStop - ldr r0, =0x02037754 - ldr r1, =0x0203ab80 - ldr r1, [r1] - adds r1, 0x4 - movs r2, 0x60 - bl memcpy - bl sub_8140174 - movs r0, 0 - str r0, [sp] - movs r0, 0x1C - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =0x03005e00 - mov r3, r8 - adds r1, r3, r7 - lsls r1, 3 - adds r1, r0 - b _0813EC52 - .pool -_0813E964: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0813E974 - bl _0813F1A4 -_0813E974: - ldr r0, =0x0203ab80 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - mov r1, r8 - adds r4, r1, r7 - lsls r4, 3 - adds r4, r5 - ldrh r1, [r4, 0xC] - b _0813EB92 - .pool -_0813E990: - bl sub_80A3678 - lsls r0, 24 - cmp r0, 0 - bne _0813E99E - bl _0813F1A4 -_0813E99E: - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085CC9A6 - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0 - bl battle_show_message_maybe - ldr r0, =0x00000173 - bl song_play_for_text - ldr r2, =0x03005e00 - mov r3, r8 - adds r1, r3, r7 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - adds r2, r1 - adds r2, 0xC - mov r0, r9 - movs r1, 0xB - bl pokemon_setattr - mov r0, r9 - bl pokemon_calc_effective_stats - ldrh r1, [r4, 0xA] - ldrh r2, [r4, 0xC] - mov r0, r9 - bl sub_806D778 - ldrh r0, [r4, 0xC] - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x2 - bl pokedex_flag_operation - ldrh r0, [r4, 0xC] - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl pokedex_flag_operation - movs r0, 0xE - bl sav12_xor_increment - b _0813F1A4 - .pool -_0813EA1C: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - beq _0813EA2A - b _0813F1A4 -_0813EA2A: - ldr r1, =0x03005e00 - mov r2, r8 - adds r0, r2, r7 - lsls r0, 3 - adds r4, r0, r1 - ldrb r1, [r4, 0x10] - mov r0, r9 - bl sub_8069318 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0 - beq _0813EAA8 - movs r3, 0x1A - ldrsh r5, [r4, r3] - cmp r5, 0 - bne _0813EAA8 - ldrh r1, [r4, 0xE] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0813EA5E - bl sub_80A2F30 - bl sub_8085784 -_0813EA5E: - ldrh r0, [r4, 0xE] - movs r1, 0x80 - orrs r0, r1 - strh r0, [r4, 0xE] - strh r5, [r4, 0x10] - strh r5, [r4, 0x14] - mov r0, r9 - movs r1, 0x2 - add r2, sp, 0x4 - bl pokemon_getattr - ldr r0, =0x02022f58 - add r1, sp, 0x4 - bl CopyString_Limit10 - ldr r0, =0x0000ffff - cmp r6, r0 - bne _0813EA94 - movs r0, 0x16 - strh r0, [r4, 0x8] - b _0813F1A4 - .pool -_0813EA94: - ldr r0, =0x0000fffe - cmp r6, r0 - bne _0813EA9C - b _0813F1A4 -_0813EA9C: - movs r0, 0x14 - strh r0, [r4, 0x8] - b _0813F1A4 - .pool -_0813EAA8: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - b _0813EC52 - .pool -_0813EAC8: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r2, 0x80 - adds r0, r2, 0 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - beq _0813EADC - b _0813F1A4 -_0813EADC: - mov r3, r8 - adds r0, r3, r7 - lsls r0, 3 - adds r4, r0, r5 - ldrh r1, [r4, 0xE] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _0813EAF6 - bl sub_80A2F30 - bl sub_8085784 -_0813EAF6: - movs r1, 0x1A - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0813EB06 - ldrh r0, [r4, 0xA] - mov r1, r9 - bl evovle_mon_internal_maybe -_0813EB06: - adds r0, r7, 0 - bl DestroyTask - bl sub_805F094 - ldr r4, =0x0203ab80 - ldr r0, [r4] - bl Free - str r6, [r4] - bl FreeAllWindowBuffers - ldr r0, =0x030061e8 - ldr r0, [r0] - bl SetMainCallback2 - b _0813F1A4 - .pool -_0813EB34: - ldr r0, =0x02024332 - ldrb r1, [r0, 0x2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - ldrb r0, [r0, 0x4] - cmp r0, 0 - beq _0813EB48 - b _0813F1A4 -_0813EB48: - bl m4aMPlayAllStop - ldr r0, =0x0006001c - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r5 - b _0813EC52 - .pool -_0813EB74: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0813EB82 - b _0813F1A4 -_0813EB82: - ldr r0, =0x0203ab80 - ldr r0, [r0] - ldrb r0, [r0] - mov r3, r8 - adds r4, r3, r7 - lsls r4, 3 - adds r4, r5 -_0813EB90: - ldrh r1, [r4, 0xA] -_0813EB92: - bl sub_81401E0 -_0813EB96: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0813F1A4 - .pool -_0813EBA8: - ldr r0, =0x0203ab80 - ldr r0, [r0] - ldrb r0, [r0] - bl sub_8140208 - cmp r0, 0 - bne _0813EBB8 - b _0813F1A4 -_0813EBB8: - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - movs r3, 0x1A - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _0813EBE4 - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085CC9EE - bl ExpandStringRefs - b _0813EBEC - .pool -_0813EBE4: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085CC9D3 - bl ExpandStringRefs -_0813EBEC: - ldr r0, =0x02021fc4 - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =0x03005e00 - mov r2, r8 - adds r0, r2, r7 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1 - strh r1, [r0, 0x1A] - b _0813F16E - .pool -_0813EC10: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - beq _0813EC1E - b _0813F1A4 -_0813EC1E: - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - beq _0813EC2A - b _0813F1A4 -_0813EC2A: - bl sub_804F574 - ldr r0, =0x0000016f - bl fanfare_play - ldr r0, =gUnknown_085CC270 - ldr r0, [r0, 0xC] - bl get_battle_strings_ - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - ldr r0, =0x03005e00 - mov r3, r8 - adds r1, r3, r7 - lsls r1, 3 - adds r1, r0 - movs r0, 0x40 - strh r0, [r1, 0x10] -_0813EC52: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0813F1A4 - .pool -_0813EC6C: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - beq _0813EC7A - b _0813F1A4 -_0813EC7A: - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - beq _0813EC86 - b _0813F1A4 -_0813EC86: - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x10] - subs r0, 0x1 - strh r0, [r1, 0x10] - lsls r0, 16 - cmp r0, 0 - beq _0813EC9E - b _0813F1A4 -_0813EC9E: - movs r0, 0xF - strh r0, [r1, 0x8] - b _0813F1A4 - .pool -_0813ECA8: - mov r3, r8 - adds r0, r3, r7 - lsls r0, 3 - adds r0, r5 - movs r1, 0x14 - ldrsh r0, [r0, r1] - cmp r0, 0xC - bls _0813ECBA - b _0813F1A4 -_0813ECBA: - lsls r0, 2 - ldr r1, =_0813ECC8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0813ECC8: - .4byte _0813ECFC - .4byte _0813ED48 - .4byte _0813ED90 - .4byte _0813EDCE - .4byte _0813EE34 - .4byte _0813EF30 - .4byte _0813EF88 - .4byte _0813F05C - .4byte _0813F090 - .4byte _0813F0D8 - .4byte _0813F120 - .4byte _0813F154 - .4byte _0813F180 -_0813ECFC: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - beq _0813ED0A - b _0813F1A4 -_0813ED0A: - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - beq _0813ED16 - b _0813F1A4 -_0813ED16: - bl sub_804F574 - ldr r0, =gUnknown_085CC270 - ldr r0, [r0, 0x10] - bl get_battle_strings_ - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x14] - adds r0, 0x1 - b _0813F1A2 - .pool -_0813ED48: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - beq _0813ED56 - b _0813F1A4 -_0813ED56: - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - beq _0813ED62 - b _0813F1A4 -_0813ED62: - ldr r0, =gUnknown_085CC270 - ldr r0, [r0, 0x14] - bl get_battle_strings_ - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - ldr r0, =0x03005e00 - mov r3, r8 - adds r1, r3, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x14] - adds r0, 0x1 - b _0813F1A2 - .pool -_0813ED90: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _0813EDCE - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - bne _0813EDCE - ldr r0, =gUnknown_085CC270 - ldr r0, [r0, 0x18] - bl get_battle_strings_ - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - movs r0, 0x5 - strh r0, [r1, 0x16] - movs r0, 0xA - strh r0, [r1, 0x18] - ldrh r0, [r1, 0x14] - adds r0, 0x1 - strh r0, [r1, 0x14] -_0813EDCE: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - beq _0813EDDC - b _0813F1A4 -_0813EDDC: - bl mplay_has_finished_maybe - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _0813EDEA - b _0813F1A4 -_0813EDEA: - str r0, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - ldr r0, =gUnknown_085CCABB - movs r1, 0xC - bl battle_show_message_maybe - ldr r0, =0x03005e00 - mov r3, r8 - adds r1, r3, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x14] - adds r0, 0x1 - movs r2, 0 - strh r0, [r1, 0x14] - ldr r0, =0x02024332 - strb r2, [r0, 0x1] - movs r0, 0 - bl sub_8056B74 - b _0813F1A4 - .pool -_0813EE34: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0813EE5C - ldr r4, =0x02024332 - ldrb r0, [r4, 0x1] - cmp r0, 0 - beq _0813EE5C - movs r0, 0x5 - bl audio_play - ldrb r0, [r4, 0x1] - bl sub_8056BAC - movs r0, 0 - strb r0, [r4, 0x1] - bl sub_8056B74 -_0813EE5C: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0813EE84 - ldr r4, =0x02024332 - ldrb r0, [r4, 0x1] - cmp r0, 0 - bne _0813EE84 - movs r0, 0x5 - bl audio_play - ldrb r0, [r4, 0x1] - bl sub_8056BAC - movs r0, 0x1 - strb r0, [r4, 0x1] - bl sub_8056B74 -_0813EE84: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r2, 0x1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _0813EEF2 - str r2, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - movs r0, 0x5 - bl audio_play - ldr r0, =0x02024332 - ldrb r2, [r0, 0x1] - cmp r2, 0 - beq _0813EECC - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x18] - strh r0, [r1, 0x14] - b _0813EEF2 - .pool -_0813EECC: - ldr r0, =0x03005e00 - mov r3, r8 - adds r1, r3, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x16] - strh r0, [r1, 0x14] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _0813EEF2 - movs r0, 0x1 - negs r0, r0 - str r2, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe -_0813EEF2: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0813EF00 - b _0813F1A4 -_0813EF00: - movs r0, 0x1 - str r0, [sp] - movs r0, 0x18 - movs r1, 0x8 - movs r2, 0x1D - movs r3, 0xD - bl sub_8056A3C - movs r0, 0x5 - bl audio_play - ldr r1, =0x03005e00 - mov r2, r8 - adds r0, r2, r7 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x18] - strh r1, [r0, 0x14] - b _0813F1A4 - .pool -_0813EF30: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0813EF3E - b _0813F1A4 -_0813EF3E: - bl FreeAllWindowBuffers - ldr r0, =0x020244ec - ldr r1, =0x03005e00 - mov r3, r8 - adds r5, r3, r7 - lsls r5, 3 - adds r5, r1 - ldrb r1, [r5, 0x1C] - ldr r2, =0x020244e9 - ldrb r2, [r2] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldr r3, =sub_813DD7C - ldr r4, =0x020244e2 - ldrh r4, [r4] - str r4, [sp] - bl sub_81BFA38 - ldrh r0, [r5, 0x14] - adds r0, 0x1 - strh r0, [r5, 0x14] - b _0813F1A4 - .pool -_0813EF88: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0813EF96 - b _0813F1A4 -_0813EF96: - ldr r1, [r6, 0x4] - ldr r0, =sub_813E3A4 - cmp r1, r0 - beq _0813EFA0 - b _0813F1A4 -_0813EFA0: - bl sub_81C1B94 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x4 - bne _0813EFC8 - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - movs r0, 0xA - b _0813F1A2 - .pool -_0813EFC8: - adds r1, r6, 0 - adds r1, 0xD - mov r0, r9 - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl sub_806E804 - cmp r0, 0 - beq _0813F014 - ldr r0, =gUnknown_085CC270 - ldr r3, =0x000004cc - adds r0, r3 - ldr r0, [r0] - bl get_battle_strings_ - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =0x03005e00 - mov r2, r8 - adds r0, r2, r7 - lsls r0, 3 - adds r0, r1 - movs r1, 0xC - strh r1, [r0, 0x14] - b _0813F1A4 - .pool -_0813F014: - ldr r1, =0x02022f68 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - strb r4, [r1, 0x2] - lsrs r0, r4, 8 - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - lsls r4, r6, 24 - lsrs r4, 24 - mov r0, r9 - adds r1, r4, 0 - bl sub_806B9A8 - ldr r0, =0x020244e2 - ldrh r1, [r0] - mov r0, r9 - adds r2, r4, 0 - bl sub_80691F4 - ldr r0, =0x03005e00 - mov r3, r8 - adds r1, r3, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x14] - adds r0, 0x1 - b _0813F1A2 - .pool -_0813F05C: - ldr r0, =gUnknown_085CC270 - movs r1, 0xCF - lsls r1, 2 - adds r0, r1 - ldr r0, [r0] - bl get_battle_strings_ - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x14] - adds r0, 0x1 - b _0813F1A2 - .pool -_0813F090: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - beq _0813F09E - b _0813F1A4 -_0813F09E: - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - beq _0813F0AA - b _0813F1A4 -_0813F0AA: - ldr r0, =gUnknown_085CC270 - ldr r0, [r0, 0x1C] - bl get_battle_strings_ - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - ldr r0, =0x03005e00 - mov r3, r8 - adds r1, r3, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x14] - adds r0, 0x1 - b _0813F1A2 - .pool -_0813F0D8: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _0813F1A4 - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - bne _0813F1A4 - ldr r0, =gUnknown_085CC270 - movs r1, 0xD0 - lsls r1, 2 - adds r0, r1 - ldr r0, [r0] - bl get_battle_strings_ - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =0x03005e00 - mov r2, r8 - adds r0, r2, r7 - lsls r0, 3 - adds r0, r1 - movs r1, 0x14 - strh r1, [r0, 0x8] - b _0813F1A4 - .pool -_0813F120: - ldr r0, =gUnknown_085CC270 - ldr r0, [r0, 0x20] - bl get_battle_strings_ - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =0x03005e00 - mov r3, r8 - adds r0, r3, r7 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - movs r1, 0xB - strh r1, [r0, 0x16] - strh r2, [r0, 0x18] - movs r1, 0x3 - strh r1, [r0, 0x14] - b _0813F1A4 - .pool -_0813F154: - ldr r0, =gUnknown_085CC270 - ldr r0, [r0, 0x24] - bl get_battle_strings_ - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =0x03005e00 - mov r2, r8 - adds r0, r2, r7 - lsls r0, 3 - adds r0, r1 -_0813F16E: - movs r1, 0xF - strh r1, [r0, 0x8] - b _0813F1A4 - .pool -_0813F180: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _0813F1A4 - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - bne _0813F1A4 - ldr r0, =0x03005e00 - mov r3, r8 - adds r1, r3, r7 - lsls r1, 3 - adds r1, r0 - movs r0, 0x5 -_0813F1A2: - strh r0, [r1, 0x14] -_0813F1A4: - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end evovle_mon_maybe - - thumb_func_start sub_813F1B8 -sub_813F1B8: @ 813F1B8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r3, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r3 - movs r1, 0x1C - ldrsh r2, [r0, r1] - movs r1, 0x64 - muls r2, r1 - ldr r1, =0x020244ec - adds r2, r1 - mov r9, r2 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r5, r3, 0 - cmp r0, 0x14 - bls _0813F1EC - bl _0813FCC4 -_0813F1EC: - lsls r0, 2 - ldr r1, =_0813F204 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0813F204: - .4byte _0813F258 - .4byte _0813F284 - .4byte _0813F2AC - .4byte _0813F2DC - .4byte _0813F314 - .4byte _0813F380 - .4byte _0813F3C0 - .4byte _0813F3F0 - .4byte _0813F42C - .4byte _0813F448 - .4byte _0813F474 - .4byte _0813F498 - .4byte _0813F4E4 - .4byte _0813F570 - .4byte _0813F624 - .4byte _0813F668 - .4byte _0813F6D0 - .4byte _0813F704 - .4byte _0813F748 - .4byte _0813F7A4 - .4byte _0813F7E4 -_0813F258: - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085CC990 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl sub_807F1A8 - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - b _0813F6B4 - .pool -_0813F284: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - beq _0813F294 - bl _0813FCC4 -_0813F294: - ldr r0, =0x03005e00 - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r0 - ldrh r0, [r4, 0xA] - movs r1, 0 - bl cry_related - b _0813F6F2 - .pool -_0813F2AC: - bl sub_80A3678 - lsls r0, 24 - cmp r0, 0 - bne _0813F2BA - bl _0813FCC4 -_0813F2BA: - ldr r0, =0x00000179 - bl m4aSongNumStop - movs r0, 0xBC - lsls r0, 1 - bl audio_play - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - b _0813F6B4 - .pool -_0813F2DC: - bl mplay_has_finished_maybe - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - beq _0813F2EC - bl _0813FCC4 -_0813F2EC: - ldr r0, =0x00000179 - bl song_play_for_text - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - str r5, [sp] - movs r0, 0x1C - movs r1, 0x4 - b _0813F9C8 - .pool -_0813F314: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0813F324 - bl _0813FCC4 -_0813F324: - movs r0, 0x1 - bl sub_8140000 - ldr r2, =0x02020630 - ldr r0, =0x0203ab80 - ldr r0, [r0] - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - adds r6, r0, 0 - adds r6, 0x10 - adds r0, r6, 0 - bl sub_817BE94 - ldr r1, =0x02024332 - strb r0, [r1, 0x2] - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - ldr r1, =0x00000603 - movs r0, 0xE - bl SetGpuReg - bl _0813FCC4 - .pool -_0813F380: - ldr r4, =0x02024332 - ldrb r0, [r4, 0x2] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r5 - ldrb r0, [r1, 0x4] - cmp r0, 0 - beq _0813F396 - bl _0813FCC4 -_0813F396: - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r5 - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - ldr r0, =0x0203ab80 - ldr r1, [r0] - movs r0, 0x1 - strb r0, [r1, 0x3] - bl sub_817BFB4 - strb r0, [r4, 0x2] - bl _0813FCC4 - .pool -_0813F3C0: - ldr r4, =0x02024332 - ldrb r0, [r4, 0x2] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r5 - ldrb r0, [r1, 0x4] - cmp r0, 0 - beq _0813F3D6 - bl _0813FCC4 -_0813F3D6: - ldr r0, =0x0203ab80 - ldr r1, [r0] - ldrb r0, [r1] - ldrb r1, [r1, 0x1] - bl sub_817C3A0 - strb r0, [r4, 0x2] - b _0813F6AC - .pool -_0813F3F0: - ldr r2, =0x0203ab80 - ldr r1, [r2] - ldrb r0, [r1, 0x3] - subs r0, 0x1 - strb r0, [r1, 0x3] - lsls r0, 24 - cmp r0, 0 - beq _0813F404 - bl _0813FCC4 -_0813F404: - ldr r1, [r2] - movs r0, 0x3 - strb r0, [r1, 0x3] - ldr r0, =0x02024332 - ldrb r1, [r0, 0x2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - ldrb r0, [r0, 0x4] - cmp r0, 0 - beq _0813F420 - bl _0813FCC4 -_0813F420: - b _0813F6AC - .pool -_0813F42C: - bl sub_817C068 - ldr r1, =0x02024332 - strb r0, [r1, 0x2] - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - b _0813F6B4 - .pool -_0813F448: - ldr r6, =0x02024332 - ldrb r0, [r6, 0x2] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r5 - ldrb r0, [r1, 0x4] - cmp r0, 0 - beq _0813F45E - bl _0813FCC4 -_0813F45E: - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r5 - ldrh r0, [r4, 0xC] - bl sub_817C280 - strb r0, [r6, 0x2] - b _0813F6F2 - .pool -_0813F474: - ldr r0, =0x02024332 - ldrb r1, [r0, 0x2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - ldrb r0, [r0, 0x4] - cmp r0, 0 - beq _0813F48A - bl _0813FCC4 -_0813F48A: - movs r0, 0x21 - bl audio_play - b _0813F6AC - .pool -_0813F498: - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - bne _0813F4A6 - bl _0813FCC4 -_0813F4A6: - ldr r0, =0x0203ab84 - ldr r0, [r0] - bl Free - ldr r5, =0x0203ab80 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - ldr r1, =0x03005e00 - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r1 - ldrh r1, [r4, 0xC] - bl sub_81401E0 - ldr r0, =0x02037754 - ldr r1, [r5] - adds r1, 0x4 - movs r2, 0x60 - bl memcpy - b _0813F6F2 - .pool -_0813F4E4: - bl sub_80A3678 - lsls r0, 24 - cmp r0, 0 - bne _0813F4F2 - bl _0813FCC4 -_0813F4F2: - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085CC9A6 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl sub_807F1A8 - ldr r0, =0x00000173 - bl fanfare_play - ldr r2, =0x03005e00 - lsls r1, r7, 2 - adds r1, r7 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - adds r2, r1 - adds r2, 0xC - mov r0, r9 - movs r1, 0xB - bl pokemon_setattr - mov r0, r9 - bl pokemon_calc_effective_stats - ldrh r1, [r4, 0xA] - ldrh r2, [r4, 0xC] - mov r0, r9 - bl sub_806D778 - ldrh r0, [r4, 0xC] - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x2 - bl pokedex_flag_operation - ldrh r0, [r4, 0xC] - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl pokedex_flag_operation - movs r0, 0xE - bl sav12_xor_increment - b _0813FCC4 - .pool -_0813F570: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - beq _0813F57E - b _0813FCC4 -_0813F57E: - bl task_is_not_running_overworld_fanfare - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0813F58C - b _0813FCC4 -_0813F58C: - ldr r1, =0x03005e00 - lsls r4, r7, 2 - adds r0, r4, r7 - lsls r0, 3 - adds r5, r0, r1 - ldrb r1, [r5, 0x10] - mov r0, r9 - bl sub_8069318 - lsls r0, 16 - lsrs r6, r0, 16 - mov r8, r4 - cmp r6, 0 - beq _0813F5FC - movs r0, 0x1A - ldrsh r2, [r5, r0] - cmp r2, 0 - bne _0813F5FC - ldrh r1, [r5, 0xE] - movs r0, 0x80 - orrs r0, r1 - strh r0, [r5, 0xE] - strh r2, [r5, 0x10] - strh r2, [r5, 0x14] - mov r0, r9 - movs r1, 0x2 - add r2, sp, 0x4 - bl pokemon_getattr - ldr r0, =0x02022f58 - add r1, sp, 0x4 - bl CopyString_Limit10 - ldr r0, =0x0000ffff - cmp r6, r0 - bne _0813F5E8 - movs r0, 0x14 - strh r0, [r5, 0x8] - b _0813FCC4 - .pool -_0813F5E8: - ldr r0, =0x0000fffe - cmp r6, r0 - bne _0813F5F0 - b _0813FCC4 -_0813F5F0: - movs r0, 0x12 - strh r0, [r5, 0x8] - b _0813FCC4 - .pool -_0813F5FC: - ldr r0, =0x00000179 - bl song_play_for_text - ldr r1, =gUnknown_085EF6D2 - movs r0, 0 - movs r2, 0x1 - bl sub_807F1A8 - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - b _0813F78C - .pool -_0813F624: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - beq _0813F634 - b _0813FCC4 -_0813F634: - adds r0, r7, 0 - bl DestroyTask - ldr r4, =0x0203ab80 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r2, =0x03003014 - ldrb r1, [r2] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r0, =0x030061e8 - ldr r0, [r0] - bl SetMainCallback2 - b _0813FCC4 - .pool -_0813F668: - ldr r0, =0x02024332 - ldrb r1, [r0, 0x2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - ldrb r0, [r0, 0x4] - cmp r0, 0 - beq _0813F67C - b _0813FCC4 -_0813F67C: - bl m4aMPlayAllStop - ldr r2, =0x02020630 - ldr r0, =0x0203ab80 - ldr r0, [r0] - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x5] - lsrs r1, 4 - adds r1, 0x10 - movs r0, 0x1 - lsls r0, r1 - ldr r1, =0x0004001c - orrs r0, r1 - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe -_0813F6AC: - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r5 -_0813F6B4: - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - b _0813FCC4 - .pool -_0813F6D0: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0813F6DE - b _0813FCC4 -_0813F6DE: - ldr r0, =0x0203ab80 - ldr r0, [r0] - ldrb r0, [r0] - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r5 - ldrh r1, [r4, 0xA] - bl sub_81401E0 -_0813F6F2: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0813FCC4 - .pool -_0813F704: - ldr r0, =0x0203ab80 - ldr r0, [r0] - ldrb r0, [r0] - bl sub_8140208 - cmp r0, 0 - bne _0813F714 - b _0813FCC4 -_0813F714: - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085CC9EE - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl sub_807F1A8 - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1 - strh r1, [r0, 0x1A] - b _0813FC8C - .pool -_0813F748: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - beq _0813F756 - b _0813FCC4 -_0813F756: - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - beq _0813F762 - b _0813FCC4 -_0813F762: - bl sub_804F574 - ldr r0, =0x0000016f - bl fanfare_play - ldr r0, =gUnknown_085CC270 - ldr r0, [r0, 0xC] - bl get_battle_strings_ - ldr r1, =0x02022e2c - movs r0, 0 - movs r2, 0x1 - bl sub_807F1A8 - ldr r0, =0x03005e00 - lsls r1, r7, 2 - adds r1, r7 - lsls r1, 3 - adds r1, r0 - movs r0, 0x40 - strh r0, [r1, 0x10] -_0813F78C: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0813FCC4 - .pool -_0813F7A4: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - beq _0813F7B2 - b _0813FCC4 -_0813F7B2: - bl task_is_not_running_overworld_fanfare - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0813F7C0 - b _0813FCC4 -_0813F7C0: - ldr r0, =0x03005e00 - lsls r1, r7, 2 - adds r1, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x10] - subs r0, 0x1 - strh r0, [r1, 0x10] - lsls r0, 16 - cmp r0, 0 - beq _0813F7D8 - b _0813FCC4 -_0813F7D8: - movs r0, 0xD - strh r0, [r1, 0x8] - b _0813FCC4 - .pool -_0813F7E4: - lsls r1, r7, 2 - adds r0, r1, r7 - lsls r0, 3 - adds r0, r5 - movs r2, 0x14 - ldrsh r0, [r0, r2] - mov r8, r1 - cmp r0, 0xB - bls _0813F7F8 - b _0813FCC4 -_0813F7F8: - lsls r0, 2 - ldr r1, =_0813F808 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0813F808: - .4byte _0813F838 - .4byte _0813F884 - .4byte _0813F8CC - .4byte _0813F90C - .4byte _0813F96C - .4byte _0813FA24 - .4byte _0813FAA8 - .4byte _0813FBA4 - .4byte _0813FBEC - .4byte _0813FC38 - .4byte _0813FC70 - .4byte _0813FCA0 -_0813F838: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - beq _0813F846 - b _0813FCC4 -_0813F846: - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - beq _0813F852 - b _0813FCC4 -_0813F852: - bl sub_804F574 - ldr r0, =gUnknown_085CC270 - ldr r0, [r0, 0x10] - bl get_battle_strings_ - ldr r1, =0x02022e2c - movs r0, 0 - movs r2, 0x1 - bl sub_807F1A8 - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x14] - adds r0, 0x1 - b _0813FCC2 - .pool -_0813F884: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - beq _0813F892 - b _0813FCC4 -_0813F892: - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - beq _0813F89E - b _0813FCC4 -_0813F89E: - ldr r0, =gUnknown_085CC270 - ldr r0, [r0, 0x14] - bl get_battle_strings_ - ldr r1, =0x02022e2c - movs r0, 0 - movs r2, 0x1 - bl sub_807F1A8 - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x14] - adds r0, 0x1 - b _0813FCC2 - .pool -_0813F8CC: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _0813F90C - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - bne _0813F90C - ldr r0, =gUnknown_085CC270 - ldr r0, [r0, 0x18] - bl get_battle_strings_ - ldr r1, =0x02022e2c - movs r0, 0 - movs r2, 0x1 - bl sub_807F1A8 - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - movs r0, 0x5 - strh r0, [r1, 0x16] - movs r0, 0x9 - strh r0, [r1, 0x18] - ldrh r0, [r1, 0x14] - adds r0, 0x1 - strh r0, [r1, 0x14] -_0813F90C: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - beq _0813F91A - b _0813FCC4 -_0813F91A: - bl mplay_has_finished_maybe - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _0813F928 - b _0813FCC4 -_0813F928: - movs r0, 0 - movs r1, 0xA8 - movs r2, 0xE0 - bl sub_809882C - ldr r0, =gUnknown_0833900C - movs r1, 0xA8 - movs r2, 0xE - movs r3, 0 - bl CreateYesNoMenu - ldr r3, =0x02024332 - strb r4, [r3, 0x1] - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x14] - adds r0, 0x1 - movs r2, 0 - strh r0, [r1, 0x14] - strb r2, [r3, 0x1] - b _0813FCC4 - .pool -_0813F96C: - bl sub_8198C58 - lsls r0, 24 - asrs r6, r0, 24 - cmp r6, 0 - beq _0813F98C - cmp r6, 0 - bgt _0813F986 - movs r0, 0x1 - negs r0, r0 - cmp r6, r0 - beq _0813F9E4 - b _0813FCC4 -_0813F986: - cmp r6, 0x1 - beq _0813F9E4 - b _0813FCC4 -_0813F98C: - ldr r0, =0x02024332 - strb r6, [r0, 0x1] - ldr r0, =gUnknown_085CC270 - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - ldr r0, [r0] - bl get_battle_strings_ - ldr r1, =0x02022e2c - movs r0, 0 - movs r2, 0x1 - bl sub_807F1A8 - ldr r1, =0x03005e00 - mov r2, r8 - adds r0, r2, r7 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x16] - strh r1, [r0, 0x14] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x5 - beq _0813F9C0 - b _0813FCC4 -_0813F9C0: - movs r0, 0x1 - negs r0, r0 - str r6, [sp] - movs r1, 0 -_0813F9C8: - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _0813FCC4 - .pool -_0813F9E4: - ldr r1, =0x02024332 - movs r0, 0x1 - strb r0, [r1, 0x1] - ldr r0, =gUnknown_085CC270 - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - ldr r0, [r0] - bl get_battle_strings_ - ldr r1, =0x02022e2c - movs r0, 0 - movs r2, 0x1 - bl sub_807F1A8 - ldr r1, =0x03005e00 - mov r2, r8 - adds r0, r2, r7 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x18] - strh r1, [r0, 0x14] - b _0813FCC4 - .pool -_0813FA24: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0813FA32 - b _0813FCC4 -_0813FA32: - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _0813FA3E - bl sub_800E084 -_0813FA3E: - movs r0, 0x3 - bl GetBgTilemapBuffer - bl Free - movs r0, 0x1 - bl GetBgTilemapBuffer - bl Free - movs r0, 0 - bl GetBgTilemapBuffer - bl Free - bl FreeAllWindowBuffers - ldr r0, =0x020244ec - ldr r1, =0x03005e00 - mov r2, r8 - adds r5, r2, r7 - lsls r5, 3 - adds r5, r1 - ldrb r1, [r5, 0x1C] - ldr r2, =0x020244e9 - ldrb r2, [r2] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldr r3, =sub_813DF70 - ldr r4, =0x020244e2 - ldrh r4, [r4] - str r4, [sp] - bl sub_81BFA38 - ldrh r0, [r5, 0x14] - adds r0, 0x1 - strh r0, [r5, 0x14] - b _0813FCC4 - .pool -_0813FAA8: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0813FAB6 - b _0813FCC4 -_0813FAB6: - ldr r0, =0x030022c0 - ldr r1, [r0, 0x4] - ldr r0, =sub_813E3C0 - cmp r1, r0 - beq _0813FAC2 - b _0813FCC4 -_0813FAC2: - bl sub_81C1B94 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x4 - bne _0813FAEC - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - movs r0, 0x9 - b _0813FCC2 - .pool -_0813FAEC: - adds r1, r6, 0 - adds r1, 0xD - mov r0, r9 - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - bl sub_806E804 - cmp r0, 0 - beq _0813FB3C - ldr r0, =gUnknown_085CC270 - ldr r1, =0x000004cc - adds r0, r1 - ldr r0, [r0] - bl get_battle_strings_ - ldr r1, =0x02022e2c - movs r0, 0 - movs r2, 0x1 - bl sub_807F1A8 - ldr r1, =0x03005e00 - mov r2, r8 - adds r0, r2, r7 - lsls r0, 3 - adds r0, r1 - movs r1, 0xB - strh r1, [r0, 0x14] - b _0813FCC4 - .pool -_0813FB3C: - ldr r1, =0x02022f68 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x2 - strb r0, [r1, 0x1] - strb r4, [r1, 0x2] - lsrs r0, r4, 8 - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - lsls r4, r6, 24 - lsrs r4, 24 - mov r0, r9 - adds r1, r4, 0 - bl sub_806B9A8 - ldr r0, =0x020244e2 - ldrh r1, [r0] - mov r0, r9 - adds r2, r4, 0 - bl sub_80691F4 - ldr r0, =gUnknown_085CC270 - movs r1, 0xCF - lsls r1, 2 - adds r0, r1 - ldr r0, [r0] - bl get_battle_strings_ - ldr r1, =0x02022e2c - movs r0, 0 - movs r2, 0x1 - bl sub_807F1A8 - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x14] - adds r0, 0x1 - b _0813FCC2 - .pool -_0813FBA4: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - beq _0813FBB2 - b _0813FCC4 -_0813FBB2: - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - beq _0813FBBE - b _0813FCC4 -_0813FBBE: - ldr r0, =gUnknown_085CC270 - ldr r0, [r0, 0x1C] - bl get_battle_strings_ - ldr r1, =0x02022e2c - movs r0, 0 - movs r2, 0x1 - bl sub_807F1A8 - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x14] - adds r0, 0x1 - b _0813FCC2 - .pool -_0813FBEC: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _0813FCC4 - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - bne _0813FCC4 - ldr r0, =gUnknown_085CC270 - movs r1, 0xD0 - lsls r1, 2 - adds r0, r1 - ldr r0, [r0] - bl get_battle_strings_ - ldr r1, =0x02022e2c - movs r0, 0 - movs r2, 0x1 - bl sub_807F1A8 - ldr r1, =0x03005e00 - mov r2, r8 - adds r0, r2, r7 - lsls r0, 3 - adds r0, r1 - movs r1, 0x12 - strh r1, [r0, 0x8] - b _0813FCC4 - .pool -_0813FC38: - ldr r0, =gUnknown_085CC270 - ldr r0, [r0, 0x20] - bl get_battle_strings_ - ldr r1, =0x02022e2c - movs r0, 0 - movs r2, 0x1 - bl sub_807F1A8 - ldr r1, =0x03005e00 - mov r2, r8 - adds r0, r2, r7 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - movs r1, 0xA - strh r1, [r0, 0x16] - strh r2, [r0, 0x18] - movs r1, 0x3 - strh r1, [r0, 0x14] - b _0813FCC4 - .pool -_0813FC70: - ldr r0, =gUnknown_085CC270 - ldr r0, [r0, 0x24] - bl get_battle_strings_ - ldr r1, =0x02022e2c - movs r0, 0 - movs r2, 0x1 - bl sub_807F1A8 - ldr r1, =0x03005e00 - mov r2, r8 - adds r0, r2, r7 - lsls r0, 3 - adds r0, r1 -_0813FC8C: - movs r1, 0xD - strh r1, [r0, 0x8] - b _0813FCC4 - .pool -_0813FCA0: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _0813FCC4 - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - bne _0813FCC4 - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - movs r0, 0x5 -_0813FCC2: - strh r0, [r1, 0x14] -_0813FCC4: - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813F1B8 - - thumb_func_start nullsub_83 -nullsub_83: @ 813FCD8 - bx lr - thumb_func_end nullsub_83 - - thumb_func_start sub_813FCDC -sub_813FCDC: @ 813FCDC - push {lr} - ldr r0, =0x02022e14 - ldrh r1, [r0] - movs r0, 0x10 - bl SetGpuReg - ldr r0, =0x02022e16 - ldrh r1, [r0] - movs r0, 0x12 - bl SetGpuReg - ldr r0, =0x02022e18 - ldrh r1, [r0] - movs r0, 0x14 - bl SetGpuReg - ldr r0, =0x02022e1a - ldrh r1, [r0] - movs r0, 0x16 - bl SetGpuReg - ldr r0, =0x02022e1c - ldrh r1, [r0] - movs r0, 0x18 - bl SetGpuReg - ldr r0, =0x02022e1e - ldrh r1, [r0] - movs r0, 0x1A - bl SetGpuReg - ldr r0, =0x02022e20 - ldrh r1, [r0] - movs r0, 0x1C - bl SetGpuReg - ldr r0, =0x02022e22 - ldrh r1, [r0] - movs r0, 0x1E - bl SetGpuReg - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - bl sub_80BA0A8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_813FCDC - - thumb_func_start sub_813FD64 -sub_813FD64: @ 813FD64 - push {lr} - ldr r0, =0x02022e14 - ldrh r1, [r0] - movs r0, 0x10 - bl SetGpuReg - ldr r0, =0x02022e16 - ldrh r1, [r0] - movs r0, 0x12 - bl SetGpuReg - ldr r0, =0x02022e18 - ldrh r1, [r0] - movs r0, 0x14 - bl SetGpuReg - ldr r0, =0x02022e1a - ldrh r1, [r0] - movs r0, 0x16 - bl SetGpuReg - ldr r0, =0x02022e1c - ldrh r1, [r0] - movs r0, 0x18 - bl SetGpuReg - ldr r0, =0x02022e1e - ldrh r1, [r0] - movs r0, 0x1A - bl SetGpuReg - ldr r0, =0x02022e20 - ldrh r1, [r0] - movs r0, 0x1C - bl SetGpuReg - ldr r0, =0x02022e22 - ldrh r1, [r0] - movs r0, 0x1E - bl SetGpuReg - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - bl sub_80BA0A8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_813FD64 - - thumb_func_start sub_813FDEC -sub_813FDEC: @ 813FDEC - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - movs r0, 0xC - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _0813FE9A - ldrh r0, [r4, 0xA] - adds r1, r0, 0x1 - strh r1, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _0813FE9A - ldrh r1, [r4] - adds r0, r1, 0x1 - strh r0, [r4] - lsls r1, 16 - asrs r1, 16 - ldr r3, =gUnknown_085B58C9 - movs r2, 0x4 - ldrsh r0, [r4, r2] - lsls r2, r0, 2 - adds r0, r3, 0x3 - adds r0, r2, r0 - ldrb r0, [r0] - cmp r1, r0 - ble _0813FE8C - adds r0, r3, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - movs r2, 0x2 - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _0813FE74 - ldrh r0, [r4, 0x6] - adds r0, 0x1 - strh r0, [r4, 0x6] - movs r0, 0x6 - ldrsh r2, [r4, r0] - movs r1, 0x4 - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r1, r3, 0x2 - adds r0, r1 - ldrb r0, [r0] - cmp r2, r0 - bne _0813FE5E - strh r5, [r4, 0x6] - ldrh r0, [r4, 0x4] - adds r0, 0x1 - strh r0, [r4, 0x4] -_0813FE5E: - movs r2, 0x4 - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0] - b _0813FE8A - .pool -_0813FE74: - ldr r0, =0x0203ab84 - lsls r1, 5 - ldr r0, [r0] - adds r0, r1 - movs r1, 0xA0 - movs r2, 0x20 - bl gpu_pal_apply - strh r5, [r4] - ldrh r0, [r4, 0x2] - adds r0, 0x1 -_0813FE8A: - strh r0, [r4, 0x2] -_0813FE8C: - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bne _0813FE9A - adds r0, r6, 0 - bl DestroyTask -_0813FE9A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813FDEC - - thumb_func_start sub_813FEA4 -sub_813FEA4: @ 813FEA4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =sub_813FEE8 - movs r1, 0x7 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - cmp r4, 0 - bne _0813FED0 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - strh r4, [r0, 0xC] - b _0813FEDE - .pool -_0813FED0: - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0xC] -_0813FEDE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813FEA4 - - thumb_func_start sub_813FEE8 -sub_813FEE8: @ 813FEE8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02022e18 - mov r8, r0 - ldr r1, =0x02022e1a - mov r9, r1 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r2, 0xC - ldrsh r0, [r0, r2] - cmp r0, 0 - bne _0813FF28 - ldr r7, =0x02022e1c - ldr r6, =0x02022e1e - b _0813FF2C - .pool -_0813FF28: - ldr r7, =0x02022e20 - ldr r6, =0x02022e22 -_0813FF2C: - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r1 - ldrh r0, [r4, 0x8] - adds r0, 0x5 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x8] - adds r0, 0x80 - ands r0, r1 - strh r0, [r4, 0xA] - movs r1, 0x8 - ldrsh r0, [r4, r1] - movs r1, 0x4 - bl cosine - adds r0, 0x8 - mov r2, r8 - strh r0, [r2] - movs r1, 0x8 - ldrsh r0, [r4, r1] - movs r1, 0x4 - bl sine - adds r0, 0x10 - mov r2, r9 - strh r0, [r2] - movs r1, 0xA - ldrsh r0, [r4, r1] - movs r1, 0x4 - bl cosine - adds r0, 0x8 - strh r0, [r7] - movs r2, 0xA - ldrsh r0, [r4, r2] - movs r1, 0x4 - bl sine - adds r0, 0x10 - strh r0, [r6] - ldr r0, =sub_813FDEC - bl FuncIsActiveTask - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0813FFA6 - adds r0, r5, 0 - bl DestroyTask - mov r0, r8 - strh r4, [r0] - mov r1, r9 - strh r4, [r1] - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r7] - strh r4, [r6] -_0813FFA6: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813FEE8 - - thumb_func_start sub_813FFC0 -sub_813FFC0: @ 813FFC0 - push {r4-r7,lr} - adds r6, r0, 0 - movs r1, 0 - ldr r5, =gUnknown_085B5884 - ldr r7, =gUnknown_085B58D9 -_0813FFCA: - lsls r0, r1, 4 - adds r4, r1, 0x1 - adds r2, r0, r7 - lsls r0, r1, 5 - adds r1, r0, r6 - movs r3, 0xF -_0813FFD6: - ldrb r0, [r2] - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - strh r0, [r1] - adds r2, 0x1 - adds r1, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _0813FFD6 - adds r1, r4, 0 - cmp r1, 0x31 - ble _0813FFCA - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_813FFC0 - - thumb_func_start sub_8140000 -sub_8140000: @ 8140000 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x0203ab84 - movs r0, 0xC8 - lsls r0, 3 - bl AllocZeroed - str r0, [r4] - bl sub_813FFC0 - cmp r5, 0 - bne _08140028 - movs r6, 0x1 - movs r4, 0x2 - b _0814002C - .pool -_08140028: - movs r6, 0x1 - movs r4, 0x3 -_0814002C: - ldr r0, =gUnknown_085B51E4 - movs r1, 0xA0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =gUnknown_085B4134 - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl copy_decompressed_tile_data_to_vram_autofree - ldr r1, =gUnknown_085B482C - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r1, =gUnknown_085B4D10 - adds r0, r4, 0 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - adds r0, r4, 0 - bl CopyBgTilemapBufferToVram - cmp r5, 0 - bne _081400C4 - ldr r1, =0x00000442 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x00000808 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xBA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - adds r0, r6, 0 - movs r1, 0x7 - movs r2, 0x2 - bl SetBgAttribute - adds r0, r4, 0 - movs r1, 0x7 - movs r2, 0x2 - bl SetBgAttribute - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - b _081400DE - .pool -_081400C4: - ldr r1, =0x00000842 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x00000808 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xDA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg -_081400DE: - ldr r0, =sub_813FDEC - movs r1, 0x5 - bl CreateTask - adds r0, r5, 0 - bl sub_813FEA4 - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8140000 - - thumb_func_start sub_8140100 -sub_8140100: @ 8140100 - push {lr} - ldr r0, =sub_813FDEC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _0814011E - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x14] -_0814011E: - movs r0, 0 - movs r1, 0xA0 - movs r2, 0x20 - bl rboxid_80040B8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8140100 - - thumb_func_start sub_8140134 -sub_8140134: @ 8140134 - push {lr} - ldr r0, =sub_813FDEC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _08140148 - bl DestroyTask -_08140148: - ldr r0, =sub_813FEE8 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _0814015A - bl DestroyTask -_0814015A: - movs r0, 0 - movs r1, 0xA0 - movs r2, 0x20 - bl rboxid_80040B8 - bl sub_8140174 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8140134 - - thumb_func_start sub_8140174 -sub_8140174: @ 8140174 - push {lr} - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - ldr r0, =0x02022e18 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e1a - strh r1, [r0] - ldr r0, =0x02022e1c - strh r1, [r0] - movs r0, 0x1 - movs r1, 0x5 - bl sub_80391E0 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x1 - movs r1, 0x7 - bl SetBgAttribute - movs r0, 0x2 - movs r1, 0x5 - bl sub_80391E0 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x2 - movs r1, 0x7 - bl SetBgAttribute - movs r1, 0xCA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r0, =0x0203ab84 - ldr r0, [r0] - bl Free - pop {r0} - bx r0 - .pool - thumb_func_end sub_8140174 - - thumb_func_start sub_81401E0 -sub_81401E0: @ 81401E0 - push {lr} - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r1, 16 - lsrs r1, 16 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - ldr r2, =0x02020630 - adds r0, r2 - movs r2, 0 - movs r3, 0 - bl sub_806ED40 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81401E0 - - thumb_func_start sub_8140208 -sub_8140208: @ 8140208 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r2, 0x1C - adds r1, r2 - ldr r1, [r1] - ldr r0, =DummyObjectCallback - cmp r1, r0 - beq _08140230 - movs r0, 0 - b _08140232 - .pool -_08140230: - movs r0, 0x1 -_08140232: - pop {r1} - bx r1 - thumb_func_end sub_8140208 - - thumb_func_start sub_8140238 -sub_8140238: @ 8140238 - push {lr} - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - ldr r0, =0x0203ab88 - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0xB8 - ldrb r0, [r1] - cmp r0, 0 - beq _0814025A - adds r0, r1, 0 - bl task_tutorial_controls_fadein -_0814025A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8140238 - - thumb_func_start sub_8140264 -sub_8140264: @ 8140264 - push {r4,lr} - sub sp, 0x4 - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - bl sub_8142814 - ldr r4, =0x0203ab88 - ldr r0, [r4] - ldrh r0, [r0, 0x26] - movs r2, 0x80 - lsls r2, 2 - adds r1, r2, 0 - subs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x14 - bl SetGpuReg - ldr r1, [r4] - ldrb r0, [r1, 0x1] - cmp r0, 0 - beq _081402A0 - ldrh r1, [r1, 0x34] - movs r0, 0x52 - bl SetGpuReg -_081402A0: - ldr r2, [r4] - movs r3, 0x2A - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _081402C0 - ldr r1, =0x040000d4 - ldr r3, =0x0000133c - adds r0, r2, r3 - str r0, [r1] - ldr r0, =0x060021c0 - str r0, [r1, 0x4] - ldr r0, =0x800001a0 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r0, 0 - strh r0, [r2, 0x2A] -_081402C0: - ldr r0, [r4] - movs r2, 0x28 - ldrsh r1, [r0, r2] - cmp r1, 0x1 - beq _081402EC - cmp r1, 0x1 - ble _08140374 - cmp r1, 0x2 - beq _08140324 - cmp r1, 0xFF - beq _08140348 - b _08140374 - .pool -_081402EC: - movs r0, 0 - movs r1, 0x1 - movs r2, 0 - bl SetBgAttribute - movs r0, 0 - bl ShowBg - ldr r1, =0x040000d4 - ldr r2, [r4] - movs r3, 0xCF - lsls r3, 2 - adds r0, r2, r3 - str r0, [r1] - ldr r0, =0x0600f9c0 - str r0, [r1, 0x4] - ldr r0, =0x800001a0 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r0, 0x2 - strh r0, [r2, 0x28] - b _08140374 - .pool -_08140324: - ldr r1, =0x040000d4 - movs r2, 0xCF - lsls r2, 2 - adds r0, r2 - str r0, [r1] - ldr r0, =0x0600f9c0 - str r0, [r1, 0x4] - ldr r0, =0x800001a0 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - b _08140374 - .pool -_08140348: - movs r0, 0 - movs r1, 0x1 - movs r2, 0x2 - bl SetBgAttribute - movs r0, 0 - bl ShowBg - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, =0x040000d4 - mov r3, sp - str r3, [r1] - ldr r0, =0x0600f9c0 - str r0, [r1, 0x4] - ldr r0, =0x810001a0 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - ldr r1, [r4] - movs r0, 0 - strh r0, [r1, 0x28] -_08140374: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8140264 - - thumb_func_start sub_8140388 -sub_8140388: @ 8140388 - push {r4,r5,lr} - sub sp, 0x4 - movs r5, 0 - str r5, [sp] - ldr r4, =0x0203ab88 - movs r0, 0xE6 - lsls r0, 6 - bl AllocZeroed - str r0, [r4] - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085B6140 - movs r0, 0x1 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r1, [r4] - movs r0, 0xBE - lsls r0, 1 - adds r1, r0 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r2, =0x0000117c - adds r1, r2 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x0000317c - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - ldr r0, =gUnknown_085B614C - bl InitWindows - bl sub_8197200 - ldr r0, =0x0203ab8c - strb r5, [r0] - ldr r0, =gUnknown_085B5DFC - mov r1, sp - bl malloc_and_decompress - ldr r1, [r4] - ldr r2, =0x0000397c - adds r1, r2 - str r0, [r1] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8140388 - - thumb_func_start sub_8140418 -sub_8140418: @ 8140418 - push {r4,r5,lr} - ldr r5, =0x0203ab88 - ldr r0, [r5] - ldr r4, =0x0000397c - adds r0, r4 - ldr r0, [r0] - bl Free - ldr r0, [r5] - adds r0, r4 - movs r4, 0 - str r4, [r0] - bl FreeAllWindowBuffers - movs r0, 0 - bl UnsetBgTilemapBuffer - movs r0, 0x1 - bl UnsetBgTilemapBuffer - movs r0, 0x2 - bl UnsetBgTilemapBuffer - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r0, [r5] - movs r2, 0xE6 - lsls r2, 6 - movs r1, 0 - bl memset - ldr r0, [r5] - bl Free - str r4, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8140418 - - thumb_func_start sub_8140470 -sub_8140470: @ 8140470 - push {r4-r6,lr} - sub sp, 0x8 - ldr r1, =gUnknown_085B6418 - mov r0, sp - movs r2, 0x6 - bl memcpy - ldr r5, =0x0203ab88 - ldr r3, [r5] - ldr r4, =0x020375e0 - ldrb r0, [r4] - movs r1, 0x1 - ands r1, r0 - ldrb r2, [r3, 0x4] - movs r0, 0x4 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x4] - ldrh r1, [r4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081404AA - ldr r0, [r5] - ldrb r1, [r0, 0x4] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0, 0x4] -_081404AA: - ldr r1, [r5] - ldr r2, =gUnknown_085B6348 - ldrb r0, [r1, 0x4] - lsls r0, 30 - lsrs r0, 25 - adds r0, r2 - ldrb r0, [r0, 0x3] - adds r1, 0x22 - strb r0, [r1] - ldr r1, [r5] - ldrb r0, [r1, 0x4] - lsls r0, 30 - lsrs r0, 25 - adds r0, r2 - ldrb r0, [r0, 0x4] - adds r1, 0x23 - strb r0, [r1] - ldr r2, [r5] - ldr r3, =gUnknown_085B6344 - ldrb r1, [r2, 0x4] - lsls r0, r1, 30 - lsrs r0, 30 - lsrs r1, 7 - lsls r1, 1 - adds r0, r1 - adds r0, r3 - ldrb r0, [r0] - strb r0, [r2, 0x19] - ldr r2, [r5] - ldrb r1, [r2, 0x1A] - movs r0, 0xF - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r2, 0x1A] - ldr r0, [r5] - ldrb r0, [r0, 0x19] - cmp r0, 0x1 - bne _08140520 - ldr r4, =0x02037714 - ldr r3, =0x02037b14 - mov r0, sp - ldrh r2, [r0] - b _08140528 - .pool -_08140520: - ldr r4, =0x02037714 - ldr r3, =0x02037b14 - mov r0, sp - ldrh r2, [r0, 0x2] -_08140528: - adds r0, r3, 0 - adds r0, 0xA2 - strh r2, [r0] - ldr r1, =0x0000ffff - adds r0, r1, 0 - ands r0, r2 - strh r0, [r3] - ands r0, r1 - adds r2, r4, 0 - adds r2, 0xA2 - strh r0, [r2] - ands r0, r1 - strh r0, [r4] - ldr r0, =0x0203ab88 - ldr r0, [r0] - adds r0, 0xB8 - bl sub_8151678 - movs r4, 0 -_0814054E: - ldr r5, =0x0203ab88 - ldr r0, [r5] - adds r0, 0xB8 - lsls r2, r4, 3 - ldr r1, =gUnknown_085B6388 - adds r2, r1 - adds r1, r4, 0 - bl sub_815168C - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xC - bls _0814054E - movs r4, 0 -_0814056C: - movs r0, 0x64 - muls r0, r4 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x41 - bl pokemon_getattr - adds r1, r0, 0 - movs r0, 0x98 - lsls r0, 1 - cmp r1, r0 - beq _081405AC - adds r0, 0x2 - cmp r1, r0 - bne _081405B6 - ldr r0, [r5] - ldrb r1, [r0, 0x2] - movs r2, 0x1 - b _081405B2 - .pool -_081405AC: - ldr r0, [r5] - ldrb r1, [r0, 0x2] - movs r2, 0x2 -_081405B2: - orrs r1, r2 - strb r1, [r0, 0x2] -_081405B6: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _0814056C - bl GameFreakRTC_CalcLocalDateTime - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8140470 - - thumb_func_start sub_81405CC -sub_81405CC: @ 81405CC - push {r4,r5,lr} - sub sp, 0xC - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x8 - bls _081405E0 - b _081407F8 -_081405E0: - lsls r0, 2 - ldr r1, =_081405F4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081405F4: - .4byte _08140618 - .4byte _08140630 - .4byte _08140650 - .4byte _08140662 - .4byte _0814069C - .4byte _081406C0 - .4byte _081406E0 - .4byte _08140750 - .4byte _0814077A -_08140618: - movs r0, 0 - bl SetVBlankCallback - bl remove_some_task - bl SetVBlankHBlankCallbacksToNull - bl sub_8121DA0 - bl sub_8121E10 - b _081407F8 -_08140630: - bl sub_8140388 - bl DeactivateAllTextPrinters - movs r1, 0x90 - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x0000060a - movs r0, 0x52 - bl SetGpuReg - b _081407F8 - .pool -_08140650: - bl sub_80A1A74 - bl ResetAllObjectData - bl ResetTasks - bl reset_temp_tile_data_buffers - b _081407F8 -_08140662: - ldr r0, =gUnknown_085B5BFC - movs r2, 0xE0 - lsls r2, 1 - movs r1, 0 - bl gpu_pal_apply - ldr r1, =gUnknown_08DBC2E8 - movs r4, 0 - str r4, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_08DBCA14 - str r4, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _081407F8 - .pool -_0814069C: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - beq _081406A8 - b _08140806 -_081406A8: - bl sub_8140470 - ldr r1, =gUnknown_085B5FA0 - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - b _081407F8 - .pool -_081406C0: - movs r0, 0 - bl sub_8142C0C - bl sub_81439C8 - bl sub_814391C - bl sub_8143314 - bl sub_8142CD0 - bl sub_8142F7C - bl sub_81431E4 - b _081407F8 -_081406E0: - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl GetCoins - lsls r0, 16 - lsrs r0, 16 - bl sub_8143514 - movs r0, 0x6 - bl sub_814372C - movs r0, 0 - bl sub_81436D0 - movs r0, 0 - bl sub_81424FC - ldr r4, =0x0203ab8c - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - ldr r2, =gUnknown_082A5B89 - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r5, 0 - str r5, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - ldrb r0, [r4] - movs r1, 0x3 - bl CopyWindowToVram - ldr r1, =0x02021bbc - movs r2, 0x3C - negs r2, r2 - adds r0, r2, 0 - strh r0, [r1] - ldr r0, =0x02021bbe - strh r5, [r0] - b _081407F8 - .pool -_08140750: - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - b _081407F8 -_0814077A: - movs r0, 0x1 - bl EnableInterrupts - ldr r0, =sub_8140264 - bl SetVBlankCallback - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl sub_80A27B0 - ldr r0, =sub_81408A8 - movs r1, 0 - bl CreateTask - ldr r5, =0x0203ab88 - ldr r1, [r5] - adds r1, 0xA4 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - movs r0, 0x6 - strh r0, [r4, 0x14] - bl GetCoins - strh r0, [r4, 0x22] - bl GetCoins - lsls r0, 16 - lsrs r0, 16 - bl sub_80EDE84 - ldr r0, =sub_8140814 - movs r1, 0x1 - bl CreateTask - ldr r1, [r5] - adds r1, 0xA5 - strb r0, [r1] - ldr r0, =sub_8140238 - bl SetMainCallback2 - b _08140806 - .pool -_081407F8: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_08140806: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81405CC - - thumb_func_start sub_8140814 -sub_8140814: @ 8140814 - push {r4-r6,lr} - ldr r3, =0x0203ab88 - ldr r0, [r3] - adds r0, 0x21 - ldrb r2, [r0] - adds r1, r2, 0x1 - strb r1, [r0] - ldr r1, [r3] - adds r0, r1, 0 - adds r0, 0x23 - lsls r2, 24 - lsrs r2, 24 - adds r6, r3, 0 - ldrb r0, [r0] - cmp r2, r0 - bne _0814085A - adds r1, 0x21 - movs r0, 0 - strb r0, [r1] - ldr r2, [r6] - adds r3, r2, 0 - adds r3, 0x22 - ldrb r1, [r3] - ldrh r0, [r2, 0x24] - subs r0, r1 - strh r0, [r2, 0x24] - lsls r0, 16 - cmp r0, 0 - bge _0814085A - ldrb r1, [r3] - movs r3, 0xB4 - lsls r3, 1 - adds r0, r3, 0 - subs r0, r1 - strh r0, [r2, 0x24] -_0814085A: - adds r4, r6, 0 - ldr r0, [r4] - ldrh r0, [r0, 0x24] - bl sine2 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, [r4] - ldrh r0, [r0, 0x24] - bl cosine2 - lsls r0, 16 - lsrs r1, r0, 16 - lsls r0, r5, 16 - asrs r0, 16 - cmp r0, 0 - bge _0814087E - adds r0, 0xF -_0814087E: - lsls r0, 12 - lsrs r5, r0, 16 - ldr r3, [r6] - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0 - bge _0814088E - adds r0, 0xF -_0814088E: - asrs r0, 4 - strh r0, [r3, 0x32] - strh r0, [r3, 0x2C] - strh r5, [r3, 0x2E] - lsls r0, r5, 16 - asrs r0, 16 - negs r0, r0 - strh r0, [r3, 0x30] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8140814 - - thumb_func_start sub_81408A8 -sub_81408A8: @ 81408A8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl fade_and_return_progress_probably - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _081408FE - movs r1, 0x90 - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x00000808 - movs r0, 0x52 - bl SetGpuReg - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0x14] - adds r0, r4, 0 - bl sub_8141FF4 - bl sub_8142070 - bl sub_8143A40 - movs r0, 0 - bl sub_81424FC - movs r0, 0x6 - bl sub_814372C - ldr r1, =sub_8140968 - ldr r2, =0x0000ffff - adds r0, r4, 0 - movs r3, 0x3 - bl sub_8141F7C -_081408FE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81408A8 - - thumb_func_start sub_8140914 -sub_8140914: @ 8140914 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8197930 - ldr r5, =0x0203ab8c - ldrb r0, [r5] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r5] - ldr r2, =gUnknown_082A5C13 - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - ldrb r0, [r5] - movs r1, 0x3 - bl CopyWindowToVram - ldr r1, =gUnknown_085B6410 - adds r0, r4, 0 - bl sub_8121F68 - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8140914 - - thumb_func_start sub_8140968 -sub_8140968: @ 8140968 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - movs r1, 0x1 - bl sub_819746C - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8140BD0 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8140968 - - thumb_func_start sub_8140994 -sub_8140994: @ 8140994 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x0203ab88 - ldr r0, [r0] - adds r0, 0xA5 - ldrb r0, [r0] - bl DestroyTask - adds r0, r4, 0 - bl sub_8141DE4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8140994 - - thumb_func_start sub_81409B8 -sub_81409B8: @ 81409B8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _081409CA - b _08140AE8 -_081409CA: - lsls r0, r4, 2 - ldr r1, =_081409D8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081409D8: - .4byte _08140A18 - .4byte _08140A3C - .4byte _08140A3C - .4byte _08140A3C - .4byte _08140A3C - .4byte _08140A90 - .4byte _08140AE8 - .4byte _08140AE8 - .4byte _08140AE8 - .4byte _08140AE8 - .4byte _08140A90 - .4byte _08140AE8 - .4byte _08140AE8 - .4byte _08140AE8 - .4byte _08140AE8 - .4byte _08140A90 -_08140A18: - ldr r0, =0x0203ab88 - ldr r0, [r0] - movs r1, 0xBE - lsls r1, 1 - adds r0, r1 - movs r1, 0x10 - str r1, [sp] - movs r1, 0xD - str r1, [sp, 0x4] - movs r1, 0 - movs r2, 0xE - movs r3, 0x7 - bl sub_8152008 - b _08140B4E - .pool -_08140A3C: - lsls r0, r4, 1 - adds r0, r4 - adds r0, 0xE - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r5, =0x0203ab88 - ldr r0, [r5] - movs r4, 0xBE - lsls r4, 1 - adds r0, r4 - movs r1, 0x10 - str r1, [sp] - movs r6, 0xD - str r6, [sp, 0x4] - movs r1, 0 - movs r2, 0xE - movs r3, 0x7 - bl sub_8152008 - ldr r0, [r5] - adds r4, r0, r4 - ldr r1, =0x0000397c - adds r0, r1 - ldr r1, [r0] - ldr r0, =0x00000232 - adds r1, r0 - movs r0, 0x3 - str r0, [sp] - str r6, [sp, 0x4] - adds r0, r4, 0 - mov r2, r8 - movs r3, 0x7 - bl sub_8152058 - b _08140B4E - .pool -_08140A90: - subs r0, r4, 0x1 - movs r1, 0x5 - bl __divsi3 - lsls r1, r0, 1 - adds r1, r0 - adds r1, 0xA - lsls r1, 24 - lsrs r7, r1, 24 - ldr r5, =0x0203ab88 - ldr r0, [r5] - movs r4, 0xBE - lsls r4, 1 - adds r0, r4 - movs r6, 0x10 - str r6, [sp] - movs r1, 0xD - str r1, [sp, 0x4] - movs r1, 0 - movs r2, 0xE - movs r3, 0x7 - bl sub_8152008 - ldr r0, [r5] - adds r4, r0, r4 - ldr r1, =0x0000397c - adds r0, r1 - ldr r1, [r0] - movs r0, 0xA0 - lsls r0, 2 - adds r1, r0 - str r6, [sp] - movs r0, 0x3 - str r0, [sp, 0x4] - adds r0, r4, 0 - movs r2, 0xE - adds r3, r7, 0 - bl sub_8152058 - b _08140B4E - .pool -_08140AE8: - adds r0, r4, 0 - movs r1, 0x5 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r0 - adds r1, 0xE - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - subs r0, r4, 0x1 - movs r1, 0x5 - bl __divsi3 - lsls r1, r0, 1 - adds r1, r0 - adds r1, 0x7 - lsls r1, 24 - lsrs r7, r1, 24 - ldr r5, =0x0203ab88 - ldr r0, [r5] - movs r4, 0xBE - lsls r4, 1 - adds r0, r4 - movs r1, 0x10 - str r1, [sp] - movs r1, 0xD - str r1, [sp, 0x4] - movs r1, 0 - movs r2, 0xE - movs r3, 0x7 - bl sub_8152008 - ldr r0, [r5] - adds r4, r0, r4 - ldr r1, =0x0000397c - adds r0, r1 - ldr r1, [r0] - movs r0, 0x88 - lsls r0, 2 - adds r1, r0 - movs r0, 0x3 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r4, 0 - mov r2, r8 - adds r3, r7, 0 - bl sub_8152058 -_08140B4E: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81409B8 - - thumb_func_start sub_8140B64 -sub_8140B64: @ 8140B64 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - ldrb r0, [r4, 0x10] - bl sub_81436D0 - ldrb r0, [r4, 0x10] - bl sub_81409B8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8140B64 - - thumb_func_start sub_8140B8C -sub_8140B8C: @ 8140B8C - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =0x0203ab88 - ldr r2, [r5] - movs r6, 0 - movs r1, 0x1 - strh r1, [r2, 0x28] - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - ldrb r0, [r4, 0x10] - bl sub_81409B8 - ldr r0, [r5] - adds r0, 0x23 - movs r1, 0x2 - strb r1, [r0] - ldr r0, [r5] - adds r0, 0x21 - strb r6, [r0] - ldr r0, =sub_8141040 - str r0, [r4] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8140B8C - - thumb_func_start sub_8140BD0 -sub_8140BD0: @ 8140BD0 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x0203ab88 - ldr r0, [r1] - ldr r2, [r0, 0x8] - movs r0, 0x20 - ands r0, r2 - cmp r0, 0 - beq _08140C30 - movs r3, 0xB - ldr r5, =gUnknown_085B6154 - adds r0, r5, 0 - adds r0, 0xE4 - ldr r0, [r0] - ands r2, r0 - ldr r0, =0x03005e00 - mov r12, r0 - lsls r7, r6, 2 - cmp r2, 0 - beq _08140C6E - adds r4, r1, 0 - adds r5, 0x8 -_08140BFE: - lsls r0, r3, 16 - movs r1, 0x80 - lsls r1, 9 - adds r0, r1 - lsrs r3, r0, 16 - asrs r2, r0, 16 - cmp r2, 0xD - bgt _08140C6E - ldr r1, [r4] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 2 - adds r0, r5 - ldr r1, [r1, 0x8] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08140BFE - b _08140C6E - .pool -_08140C30: - movs r3, 0x6 - ldr r5, =gUnknown_085B6154 - adds r0, r5, 0 - adds r0, 0x80 - ldr r0, [r0] - ands r2, r0 - ldr r0, =0x03005e00 - mov r12, r0 - lsls r7, r6, 2 - cmp r2, 0 - beq _08140C6E - adds r4, r1, 0 - adds r5, 0x8 -_08140C4A: - lsls r0, r3, 16 - movs r1, 0x80 - lsls r1, 9 - adds r0, r1 - lsrs r3, r0, 16 - asrs r2, r0, 16 - cmp r2, 0x9 - bgt _08140C6E - ldr r1, [r4] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 2 - adds r0, r5 - ldr r1, [r1, 0x8] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08140C4A -_08140C6E: - adds r4, r7, r6 - lsls r4, 3 - add r4, r12 - movs r5, 0 - strh r3, [r4, 0x10] - adds r0, r6, 0 - bl sub_8141FF4 - ldrb r0, [r4, 0x10] - bl sub_81424FC - ldrb r0, [r4, 0x10] - bl sub_81436D0 - ldrb r0, [r4, 0x10] - bl sub_8142284 - strh r5, [r4, 0xA] - ldr r0, =sub_8140B8C - str r0, [r4] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8140BD0 - - thumb_func_start sub_8140CA8 -sub_8140CA8: @ 8140CA8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - movs r6, 0 - movs r7, 0 - ldr r1, =gUnknown_085B641E - mov r0, sp - movs r2, 0x4 - bl memcpy - ldrb r0, [r4] - mov r8, r0 - cmp r5, 0 - blt _08140D1C - cmp r5, 0x1 - bgt _08140CF4 - movs r1, 0 - ldrsh r0, [r4, r1] - movs r1, 0x5 - bl __modsi3 - lsls r0, 24 - lsrs r6, r0, 24 - movs r2, 0xF0 - lsls r2, 20 - adds r1, r0, r2 - lsrs r7, r1, 24 - cmp r0, 0 - bne _08140D1C - movs r6, 0x5 - b _08140D1C - .pool -_08140CF4: - cmp r5, 0x3 - bgt _08140D1C - movs r1, 0 - ldrsh r0, [r4, r1] - movs r1, 0x5 - bl __divsi3 - lsls r0, 16 - asrs r0, 16 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 24 - lsrs r6, r1, 24 - movs r2, 0x80 - lsls r2, 19 - adds r0, r1, r2 - lsrs r7, r0, 24 - cmp r1, 0 - bne _08140D1C - movs r6, 0x1 -_08140D1C: - mov r1, sp - adds r0, r1, r5 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrh r2, [r4] - adds r0, r2 - strh r0, [r4] - lsls r1, r6, 24 - asrs r3, r1, 24 - lsls r0, 16 - asrs r0, 16 - lsls r2, r7, 24 - cmp r0, r3 - bge _08140D3E - asrs r0, r2, 24 - strh r0, [r4] -_08140D3E: - movs r0, 0 - ldrsh r1, [r4, r0] - asrs r0, r2, 24 - cmp r1, r0 - ble _08140D4A - strh r3, [r4] -_08140D4A: - mov r1, r8 - lsls r0, r1, 24 - movs r2, 0 - ldrsh r1, [r4, r2] - asrs r0, 24 - cmp r1, r0 - bne _08140D5C - movs r0, 0 - b _08140D5E -_08140D5C: - movs r0, 0x1 -_08140D5E: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8140CA8 - - thumb_func_start sub_8140D6C -sub_8140D6C: @ 8140D6C - 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 r9, r0 - movs r5, 0 - ldr r4, =0x030022c0 - ldrh r1, [r4, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08140DA8 - movs r5, 0x1 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r0, r1 - adds r0, 0x8 - movs r1, 0 - bl sub_8140CA8 - lsls r0, 24 - cmp r0, 0 - bne _08140DA8 - b _08140F3A -_08140DA8: - ldrh r1, [r4, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08140DCE - movs r5, 0x1 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r0, r1 - adds r0, 0x8 - movs r1, 0x1 - bl sub_8140CA8 - lsls r0, 24 - cmp r0, 0 - bne _08140DCE - b _08140F3A -_08140DCE: - ldrh r1, [r4, 0x2E] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08140DF4 - movs r5, 0x1 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r0, r1 - adds r0, 0x8 - movs r1, 0x2 - bl sub_8140CA8 - lsls r0, 24 - cmp r0, 0 - bne _08140DF4 - b _08140F3A -_08140DF4: - ldrh r1, [r4, 0x2E] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08140E1A - movs r5, 0x1 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r0, r1 - adds r0, 0x8 - movs r1, 0x3 - bl sub_8140CA8 - lsls r0, 24 - cmp r0, 0 - bne _08140E1A - b _08140F3A -_08140E1A: - cmp r5, 0 - bne _08140E20 - b _08140F3A -_08140E20: - ldr r0, =0x03005e00 - lsls r6, r7, 2 - adds r4, r6, r7 - lsls r4, 3 - adds r4, r0 - ldrb r0, [r4, 0x10] - bl sub_81424FC - adds r0, r7, 0 - bl sub_8140B64 - mov r1, r9 - strh r1, [r4, 0xA] - movs r0, 0x5 - bl audio_play - ldr r5, =0x0203ab88 - ldr r0, [r5] - adds r0, 0xB8 - ldr r1, =0x0000ffff - bl sub_8151A9C - ldr r5, [r5] - movs r2, 0xB8 - lsls r2, 1 - adds r3, r5, r2 - ldrb r2, [r3] - movs r1, 0x7F - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3] - movs r0, 0xB2 - lsls r0, 1 - adds r3, r5, r0 - ldrb r2, [r3] - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3] - movs r0, 0xAC - lsls r0, 1 - adds r2, r5, r0 - ldrb r0, [r2] - ands r1, r0 - strb r1, [r2] - ldrb r0, [r4, 0x10] - bl sub_8142284 - movs r4, 0 - mov r9, r6 - ldr r1, =0x02020630 - mov r12, r1 - movs r2, 0x8 - add r2, r12 - mov r10, r2 -_08140E8C: - ldr r0, =0x0203ab88 - ldr r5, [r0] - adds r0, r4, 0 - adds r0, 0x29 - adds r6, r5, 0 - adds r6, 0x3C - adds r0, r6, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - mov r1, r12 - adds r3, r0, r1 - adds r2, r3, 0 - adds r2, 0x40 - add r0, r10 - ldr r0, [r0] - ldr r0, [r0] - ldrh r1, [r0] - ldrh r2, [r2] - adds r1, r2 - ldr r2, =0x000003ff - mov r8, r2 - mov r0, r8 - ands r1, r0 - ldrh r2, [r3, 0x4] - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r3, 0x4] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _08140E8C - ldr r0, =0x03005e00 - mov r2, r9 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - ldrh r3, [r1, 0x10] - subs r0, r3, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x3 - bhi _08140F3A - ldr r2, =gUnknown_085B6154 - movs r0, 0x10 - ldrsh r1, [r1, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x8 - adds r0, r2 - ldr r1, [r5, 0x8] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08140F3A - subs r0, r3, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - adds r0, 0x29 - adds r0, r6, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r3, r0, r1 - adds r2, r3, 0 - adds r2, 0x40 - adds r1, 0x8 - adds r0, r1 - ldr r0, [r0] - ldr r0, [r0] - ldrh r1, [r0, 0x4] - ldrh r2, [r2] - adds r1, r2 - mov r2, r8 - ands r1, r2 - ldrh r2, [r3, 0x4] - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r3, 0x4] -_08140F3A: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8140D6C - - thumb_func_start sub_8140F6C -sub_8140F6C: @ 8140F6C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80EECA4 - ldr r0, =0x0203ab88 - ldr r1, [r0] - movs r0, 0xFF - strh r0, [r1, 0x28] - ldrb r2, [r1, 0x19] - cmp r2, 0x1 - bne _08140F90 - adds r0, r1, 0 - adds r0, 0x23 - strb r2, [r0] - b _08140F96 - .pool -_08140F90: - adds r1, 0x23 - movs r0, 0 - strb r0, [r1] -_08140F96: - ldr r0, =0x0203ab88 - ldr r0, [r0] - adds r0, 0x21 - movs r1, 0 - strb r1, [r0] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0x20 - strh r1, [r0, 0xA] - ldr r1, =sub_81410FC - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8140F6C - - thumb_func_start sub_8140FC4 -sub_8140FC4: @ 8140FC4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x0203ab88 - ldr r2, [r4] - ldrb r1, [r2, 0x1A] - lsls r1, 28 - lsrs r1, 28 - adds r2, 0x1B - adds r2, r1 - ldr r3, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r5, r1, r3 - ldrh r0, [r5, 0x10] - strb r0, [r2] - ldr r1, [r4] - ldrb r0, [r1, 0x1A] - lsls r0, 28 - lsrs r0, 28 - adds r1, 0x1B - adds r1, r0 - ldrb r0, [r1] - bl sub_8142758 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0xC] - ldr r1, [r4] - ldrb r0, [r1, 0x1A] - lsls r0, 28 - lsrs r0, 28 - adds r1, 0x1B - adds r1, r0 - ldrb r0, [r1] - bl sub_81436D0 - ldr r0, [r4] - ldrb r1, [r0, 0x19] - ldrh r0, [r5, 0x22] - subs r0, r1 - strh r0, [r5, 0x22] - lsls r0, 16 - cmp r0, 0 - bge _08141024 - movs r0, 0 - strh r0, [r5, 0x22] -_08141024: - ldrh r0, [r5, 0x22] - bl sub_8143514 - ldr r0, =sub_8140F6C - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8140FC4 - - thumb_func_start sub_8141040 -sub_8141040: @ 8141040 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r5, 0 - bl sub_8140D6C - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x1E - beq _08141076 - cmp r0, 0x1E - bgt _0814106C - cmp r0, 0 - beq _08141072 - b _0814108A - .pool -_0814106C: - cmp r0, 0x3B - beq _08141084 - b _0814108A -_08141072: - ldrb r0, [r4, 0x10] - b _08141078 -_08141076: - movs r0, 0 -_08141078: - bl sub_81409B8 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - b _0814109A -_08141084: - movs r0, 0 - strh r0, [r4, 0xA] - b _0814109A -_0814108A: - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] -_0814109A: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081410F2 - ldr r0, =0x0203ab88 - ldr r3, [r0] - ldr r2, =gUnknown_085B6154 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x10 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x8 - adds r0, r2 - ldr r1, [r3, 0x8] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _081410E8 - movs r0, 0x16 - bl audio_play - b _081410F2 - .pool -_081410E8: - movs r0, 0x5F - bl m4aSongNumStart - ldr r0, =sub_8140FC4 - str r0, [r4] -_081410F2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8141040 - - thumb_func_start sub_81410FC -sub_81410FC: @ 81410FC - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0xA] - subs r1, r0, 0x1 - strh r1, [r4, 0xA] - lsls r0, 16 - cmp r0, 0 - ble _08141168 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _08141128 - ldr r1, =0x02021bbc - ldrh r0, [r1] - adds r0, 0x2 - strh r0, [r1] -_08141128: - ldr r0, =0x0203ab88 - ldr r1, [r0] - ldrh r0, [r1, 0x26] - adds r0, 0x4 - strh r0, [r1, 0x26] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x68 - bne _08141180 - ldr r2, =0x02020630 - adds r0, r1, 0 - adds r0, 0x55 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =DummyObjectCallback - str r1, [r0] - b _08141180 - .pool -_08141168: - movs r0, 0x1 - movs r1, 0xFF - bl sub_8142E70 - movs r0, 0x1 - movs r1, 0xFF - bl sub_8143038 - ldr r0, =sub_8141344 - str r0, [r4] - movs r0, 0 - strh r0, [r4, 0xA] -_08141180: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81410FC - - thumb_func_start sub_814118C -sub_814118C: @ 814118C - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =0x0203ab88 - ldr r3, [r0] - ldrb r2, [r3, 0x2] - adds r5, r0, 0 - cmp r2, 0x2 - bgt _081411AC - cmp r2, 0x1 - bge _081411B2 - b _08141280 - .pool -_081411AC: - cmp r2, 0x3 - beq _08141214 - b _08141280 -_081411B2: - ldr r0, =0x03005cf8 - ldrb r0, [r0, 0x2] - subs r0, 0x4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bhi _081411E4 - cmp r4, 0xB - bls _081411CC - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08141296 -_081411CC: - ldr r0, =gUnknown_085B6348 - ldrb r1, [r3, 0x4] - lsls r1, 30 - lsrs r1, 25 - adds r1, r0 - ldrb r0, [r1, 0x2] - lsrs r0, 1 - b _0814133A - .pool -_081411E4: - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _08141200 - ldr r0, =gUnknown_085B6348 - ldrb r1, [r3, 0x4] - lsls r1, 30 - lsrs r1, 25 - adds r1, r0 - ldrb r0, [r1, 0x2] - lsrs r0, 1 - b _0814133A - .pool -_08141200: - ldr r0, =gUnknown_085B6348 - ldrb r1, [r3, 0x4] - lsls r1, 30 - lsrs r1, 25 - adds r1, r0 - ldrb r0, [r1, 0x2] - b _0814133A - .pool -_08141214: - ldr r0, =0x03005cf8 - ldrb r0, [r0, 0x2] - subs r0, 0x4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6 - bhi _08141248 - cmp r4, 0x5 - bls _0814122E - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08141296 -_0814122E: - ldr r0, =gUnknown_085B6348 - ldrb r1, [r3, 0x4] - lsls r1, 30 - lsrs r1, 25 - adds r1, r0 - ldrb r0, [r1, 0x2] - lsrs r0, 1 - b _0814133A - .pool -_08141248: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08141268 - cmp r4, 0x6 - bls _08141268 - ldr r0, =gUnknown_085B6348 - ldrb r1, [r3, 0x4] - lsls r1, 30 - lsrs r1, 25 - adds r1, r0 - ldrb r0, [r1, 0x2] - lsrs r0, 2 - b _0814133A - .pool -_08141268: - ldr r1, =gUnknown_085B6348 - ldr r0, [r5] - ldrb r0, [r0, 0x4] - lsls r0, 30 - lsrs r0, 25 - adds r0, r1 - ldrb r0, [r0, 0x2] - lsrs r0, 1 - b _0814133A - .pool -_08141280: - ldr r0, =0x03005cf8 - ldrb r0, [r0, 0x2] - subs r0, 0x4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bhi _081412B8 - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _081412A0 -_08141296: - movs r0, 0x1 - b _0814133A - .pool -_081412A0: - ldr r1, =gUnknown_085B6348 - ldr r0, [r5] - ldrb r0, [r0, 0x4] - lsls r0, 30 - lsrs r0, 25 - adds r0, r1 - ldrb r0, [r0, 0x2] - lsrs r0, 1 - b _0814133A - .pool -_081412B8: - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _081412F0 - cmp r4, 0xC - bls _081412DC - ldr r1, =gUnknown_085B6348 - ldr r0, [r5] - ldrb r0, [r0, 0x4] - lsls r0, 30 - lsrs r0, 25 - adds r0, r1 - ldrb r0, [r0, 0x2] - lsrs r0, 1 - b _0814133A - .pool -_081412DC: - ldr r1, =gUnknown_085B6348 - ldr r0, [r5] - ldrb r0, [r0, 0x4] - lsls r0, 30 - lsrs r0, 25 - adds r0, r1 - ldrb r0, [r0, 0x2] - b _0814133A - .pool -_081412F0: - movs r0, 0x80 - lsls r0, 8 - ands r0, r1 - cmp r0, 0 - beq _08141328 - cmp r4, 0xC - bls _08141314 - ldr r1, =gUnknown_085B6348 - ldr r0, [r5] - ldrb r0, [r0, 0x4] - lsls r0, 30 - lsrs r0, 25 - adds r0, r1 - ldrb r0, [r0, 0x2] - b _0814133A - .pool -_08141314: - ldr r1, =gUnknown_085B6348 - ldr r0, [r5] - ldrb r0, [r0, 0x4] - lsls r0, 30 - lsrs r0, 25 - adds r0, r1 - ldrb r0, [r0, 0x1] - b _0814133A - .pool -_08141328: - ldr r1, =gUnknown_085B6348 - ldr r0, [r5] - ldrb r0, [r0, 0x4] - lsls r0, 30 - lsrs r0, 25 - adds r0, r1 - ldrb r0, [r0, 0x1] - lsls r0, 25 - lsrs r0, 24 -_0814133A: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814118C - - thumb_func_start sub_8141344 -sub_8141344: @ 8141344 - 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 r10, r0 - movs r4, 0 - ldr r1, =gUnknown_085B6422 - mov r0, sp - movs r2, 0x8 - bl memcpy - bl GenerateRandomNumber - lsls r0, 16 - lsrs r7, r0, 16 - adds r0, r7, 0 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r3, =0x0203ab88 - ldr r0, [r3] - ldr r2, =0x03005e00 - mov r5, r10 - lsls r1, r5, 2 - add r1, r10 - lsls r1, 3 - adds r1, r2 - ldrh r2, [r1, 0x14] - adds r0, 0x7C - strb r2, [r0] - ldr r0, [r3] - adds r2, r0, 0 - adds r2, 0x7F - strb r4, [r2] - subs r2, 0x1 - strb r4, [r2] - adds r0, 0x7D - strb r4, [r0] - ldrh r0, [r1, 0x18] - adds r1, r7, 0 - bl sub_814118C - adds r4, r0, 0 - lsls r4, 24 - lsrs r1, r4, 24 - adds r0, r7, 0 - bl __modsi3 - lsrs r4, 25 - subs r0, r4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x03005cf8 - ldrb r0, [r0, 0x2] - lsls r0, 24 - asrs r0, 24 - movs r5, 0x1 - cmp r0, 0xC - bgt _081413C8 - movs r5, 0 -_081413C8: - cmp r6, 0x4F - bhi _081413E0 - lsls r0, r5, 25 - b _081413EA - .pool -_081413E0: - lsls r1, r5, 24 - asrs r1, 24 - movs r0, 0x1 - subs r0, r1 - lsls r0, 25 -_081413EA: - lsrs r5, r0, 24 - ldr r0, =0x0203ab88 - ldr r6, [r0] - ldrb r0, [r6, 0x4] - lsls r0, 30 - lsrs r0, 25 - ldr r1, =gUnknown_085B6348 - adds r0, r1 - lsls r4, 24 - asrs r4, 24 - ldrh r0, [r0, 0x1A] - adds r4, r0 - adds r0, r6, 0 - adds r0, 0x80 - strh r4, [r0] - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 - bl __floatsisf - cmp r4, 0 - bge _0814141C - ldr r1, =0x47800000 - bl __addsf3 -_0814141C: - ldr r1, =0x40a00000 - bl __divsf3 - bl __fixunssfsi - lsls r0, 16 - lsrs r4, r0, 16 - lsls r0, r4, 1 - adds r0, r4 - movs r2, 0x82 - adds r2, r6 - mov r8, r2 - strh r0, [r2] - adds r0, r6, 0 - adds r0, 0x84 - strh r4, [r0] - adds r0, 0x2 - strh r4, [r0] - movs r0, 0x88 - adds r0, r6 - mov r9, r0 - movs r0, 0x1 - ands r0, r7 - lsls r1, r5, 24 - asrs r1, 24 - adds r0, r1 - lsls r0, 1 - add r0, sp - movs r1, 0 - ldrsh r4, [r0, r1] - adds r0, r4, 0 - bl __floatsisf - cmp r4, 0 - bge _08141468 - ldr r1, =0x47800000 - bl __addsf3 -_08141468: - mov r2, r9 - str r0, [r2] - adds r7, r6, 0 - adds r7, 0x8C - ldrb r0, [r6, 0x4] - lsls r0, 30 - lsrs r0, 25 - ldr r5, =gUnknown_085B6348 - adds r0, r5 - movs r1, 0x18 - ldrsh r4, [r0, r1] - adds r0, r4, 0 - bl __floatsisf - adds r5, r0, 0 - cmp r4, 0 - bge _08141492 - ldr r1, =0x47800000 - bl __addsf3 - adds r5, r0, 0 -_08141492: - str r5, [r7] - adds r7, r6, 0 - adds r7, 0x90 - ldr r1, =0x3f000000 - adds r0, r5, 0 - bl __mulsf3 - adds r1, r5, 0 - bl __subsf3 - adds r5, r0, 0 - mov r2, r8 - movs r0, 0 - ldrsh r4, [r2, r0] - adds r0, r4, 0 - bl __floatsisf - adds r2, r0, 0 - cmp r4, 0 - bge _081414C2 - ldr r1, =0x47800000 - bl __addsf3 - adds r2, r0, 0 -_081414C2: - adds r0, r5, 0 - adds r1, r2, 0 - bl __divsf3 - str r0, [r7] - adds r1, r6, 0 - adds r1, 0x94 - ldr r0, =0x42880000 - str r0, [r1] - adds r1, 0x8 - ldr r0, =0x00000000 - str r0, [r1] - adds r5, r6, 0 - adds r5, 0x98 - mov r1, r8 - movs r2, 0 - ldrsh r4, [r1, r2] - adds r0, r4, 0 - bl __floatsisf - adds r2, r0, 0 - cmp r4, 0 - bge _081414F8 - ldr r1, =0x47800000 - bl __addsf3 - adds r2, r0, 0 -_081414F8: - ldr r0, =0x41000000 - adds r1, r2, 0 - bl __divsf3 - bl __negsf2 - str r0, [r5] - adds r1, r6, 0 - adds r1, 0xA0 - ldr r0, =0x42100000 - str r0, [r1] - ldr r1, =0x03005e00 - mov r5, r10 - lsls r0, r5, 2 - add r0, r10 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_814155C - str r1, [r0] - 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_8141344 - - thumb_func_start sub_814155C -sub_814155C: @ 814155C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x0203ab88 - ldr r3, [r4] - ldrb r1, [r3, 0x3] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r3, 0x3] - ldr r3, [r4] - adds r2, r3, 0 - adds r2, 0x7C - adds r1, r3, 0 - adds r1, 0x3C - ldrb r2, [r2] - adds r1, r2 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - ldr r2, =0x02020630 - adds r1, r2 - str r1, [r3, 0x38] - ldr r2, =sub_81446AC - str r2, [r1, 0x1C] - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - ldrh r1, [r4, 0x14] - adds r1, 0x1 - strh r1, [r4, 0x14] - ldrh r0, [r4, 0x18] - adds r0, 0x1 - strh r0, [r4, 0x18] - movs r0, 0x6 - subs r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl sub_814372C - movs r0, 0x5C - bl m4aSongNumStart - ldr r0, =sub_81415D4 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814155C - - thumb_func_start sub_81415D4 -sub_81415D4: @ 81415D4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r6, =0x0203ab88 - ldr r3, [r6] - adds r0, r3, 0 - adds r0, 0x7D - ldrb r0, [r0] - cmp r0, 0 - beq _081416C6 - ldrb r1, [r3, 0x3] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08141614 - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081416C6 - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r3, 0x3] - ldr r2, [r6] - ldrb r1, [r2, 0x3] - movs r0, 0x21 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x3] - b _081416C6 - .pool -_08141614: - ldr r2, =0x03005e00 - lsls r1, r4, 2 - adds r0, r1, r4 - lsls r0, 3 - adds r5, r0, r2 - movs r2, 0xA - ldrsh r0, [r5, r2] - adds r7, r1, 0 - cmp r0, 0 - bne _08141660 - adds r0, r3, 0 - adds r0, 0x7E - ldrb r1, [r0] - adds r0, r4, 0 - bl sub_81420D0 - lsls r0, 24 - lsrs r0, 24 - ldr r2, [r6] - ldrb r1, [r2, 0x1A] - lsls r1, 28 - lsrs r1, 28 - adds r2, 0x1B - adds r2, r1 - ldrb r1, [r2] - bl sub_81421E8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x12] - cmp r0, 0x1 - bne _08141660 - ldr r0, [r6] - adds r0, 0xB8 - movs r1, 0x80 - lsls r1, 5 - bl sub_8151A48 -_08141660: - ldr r0, =0x03005e00 - adds r1, r7, r4 - lsls r1, 3 - adds r4, r1, r0 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x3C - bgt _08141690 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08141680 - movs r0, 0x3C - strh r0, [r4, 0xA] -_08141680: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - b _081416C6 - .pool -_08141690: - ldr r0, =0x0203ab88 - ldr r1, [r0] - ldrb r0, [r1, 0x1A] - lsls r0, 28 - lsrs r0, 28 - adds r1, 0x1B - adds r1, r0 - ldrb r0, [r1] - bl sub_81424FC - ldrh r1, [r4, 0x20] - lsls r1, 24 - lsrs r1, 24 - movs r0, 0 - bl sub_8142E70 - ldrb r1, [r4, 0x14] - subs r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0 - bl sub_8143038 - movs r0, 0x20 - strh r0, [r4, 0xA] - ldr r0, =sub_81416D4 - str r0, [r4] -_081416C6: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81415D4 - - thumb_func_start sub_81416D4 -sub_81416D4: @ 81416D4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0xA] - subs r1, r0, 0x1 - strh r1, [r4, 0xA] - lsls r0, 16 - cmp r0, 0 - ble _08141740 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _08141700 - ldr r1, =0x02021bbc - ldrh r0, [r1] - subs r0, 0x2 - strh r0, [r1] -_08141700: - ldr r0, =0x0203ab88 - ldr r1, [r0] - ldrh r0, [r1, 0x26] - subs r0, 0x4 - strh r0, [r1, 0x26] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x68 - bne _08141768 - ldr r2, =0x02020630 - adds r0, r1, 0 - adds r0, 0x55 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_814390C - str r1, [r0] - b _08141768 - .pool -_08141740: - ldrh r0, [r4, 0x20] - lsls r0, 24 - lsrs r0, 24 - bl sub_8143150 - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _08141756 - movs r0, 0x79 - b _08141758 -_08141756: - movs r0, 0x3D -_08141758: - strh r0, [r4, 0xA] - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8141778 - str r0, [r1] -_08141768: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81416D4 - - thumb_func_start sub_8141778 -sub_8141778: @ 8141778 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0xA] - subs r1, r0, 0x1 - strh r1, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _081417E8 - movs r0, 0xA - ldrsh r1, [r4, r0] - adds r0, r1, 0 - cmp r1, 0 - bge _081417A2 - adds r0, 0xF -_081417A2: - asrs r0, 4 - lsls r0, 4 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - beq _081417CC - cmp r0, 0x8 - bne _081417F4 - movs r0, 0 - movs r1, 0xFF - bl sub_8142E70 - movs r0, 0 - movs r1, 0xFF - bl sub_8143038 - b _081417F4 - .pool -_081417CC: - ldrh r1, [r4, 0x20] - lsls r1, 24 - lsrs r1, 24 - movs r0, 0 - bl sub_8142E70 - ldrb r1, [r4, 0x14] - subs r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0 - bl sub_8143038 - b _081417F4 -_081417E8: - ldr r1, =sub_814189C - adds r0, r2, 0 - movs r2, 0x1E - movs r3, 0 - bl sub_8141F7C -_081417F4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8141778 - - thumb_func_start sub_8141800 -sub_8141800: @ 8141800 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _08141864 - cmp r0, 0 - blt _08141864 - cmp r0, 0x2 - bgt _08141864 - bl task_is_not_running_overworld_fanfare - lsls r0, 24 - cmp r0, 0 - beq _08141888 - movs r0, 0x1D - bl sub_80847F8 - ldrh r1, [r4, 0x1E] - adds r1, 0x1 - strh r1, [r4, 0x1E] - lsls r1, 16 - asrs r1, 16 - cmp r0, r1 - bcs _08141848 - movs r0, 0x1E - ldrsh r1, [r4, r0] - movs r0, 0x1D - bl sav12_xor_set -_08141848: - ldr r1, =sub_8141A18 - ldr r2, =0x0000ffff - adds r0, r5, 0 - movs r3, 0x3 - bl sub_8141F7C - b _08141888 - .pool -_08141864: - bl mplay_has_finished_maybe - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - bne _08141888 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - strh r2, [r0, 0x1E] - ldr r1, =sub_8141AC0 - ldr r2, =0x0000ffff - adds r0, r5, 0 - movs r3, 0x3 - bl sub_8141F7C -_08141888: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8141800 - - thumb_func_start sub_814189C -sub_814189C: @ 814189C - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r2, 0x12 - ldrsh r1, [r0, r2] - cmp r1, 0 - beq _08141928 - cmp r1, 0 - blt _08141928 - cmp r1, 0x2 - bgt _08141928 - movs r1, 0xC - ldrsh r0, [r0, r1] - cmp r0, 0xC - bne _081418EC - ldr r0, =0x00000185 - bl fanfare_play - ldr r4, =0x0203ab8c - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - ldr r2, =gUnknown_082A5BD7 - b _08141902 - .pool -_081418EC: - movs r0, 0xC3 - lsls r0, 1 - bl fanfare_play - ldr r4, =0x0203ab8c - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - ldr r2, =gUnknown_082A5BCB -_08141902: - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - ldrb r0, [r4] - movs r1, 0x3 - bl CopyWindowToVram - b _08141958 - .pool -_08141928: - movs r0, 0x20 - bl m4aSongNumStart - ldr r4, =0x0203ab8c - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - ldr r2, =gUnknown_082A5BE0 - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - ldrb r0, [r4] - movs r1, 0x3 - bl CopyWindowToVram -_08141958: - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0xA] - ldr r1, =sub_8141800 - str r1, [r0] - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814189C - - thumb_func_start sub_8141984 -sub_8141984: @ 8141984 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x16 - ldrsh r5, [r4, r0] - cmp r5, 0 - beq _081419AC - cmp r5, 0x3 - beq _081419DC - ldrh r0, [r4, 0x16] - adds r0, 0x1 - b _081419E4 - .pool -_081419AC: - ldrh r0, [r4, 0x22] - adds r0, 0x1 - strh r0, [r4, 0x22] - movs r0, 0x15 - bl m4aSongNumStart - ldrh r0, [r4, 0x22] - bl sub_8143514 - movs r2, 0x22 - ldrsh r1, [r4, r2] - ldr r0, =0x0000270e - cmp r1, r0 - ble _081419D0 - strh r5, [r4, 0xA] - b _081419E6 - .pool -_081419D0: - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0x16] - adds r0, 0x1 - b _081419E4 -_081419DC: - movs r0, 0x15 - bl m4aSongNumStop - movs r0, 0 -_081419E4: - strh r0, [r4, 0x16] -_081419E6: - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - movs r2, 0xA - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _08141A04 - ldr r1, =sub_8141AC0 - ldr r2, =0x0000ffff - adds r0, r6, 0 - movs r3, 0x3 - bl sub_8141F7C -_08141A04: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8141984 - - thumb_func_start sub_8141A18 -sub_8141A18: @ 8141A18 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x02021cc4 - ldr r1, =0x0203ab88 - mov r9, r1 - ldr r1, [r1] - ldrb r2, [r1, 0x19] - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - movs r1, 0xC - ldrsh r0, [r4, r1] - adds r1, r2, 0 - muls r1, r0 - adds r0, r3, 0 - movs r2, 0 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r2, =0x02021fc4 - mov r8, r2 - ldr r1, =gUnknown_082A5BEF - mov r0, r8 - bl ExpandStringRefs - ldr r5, =0x0203ab8c - ldrb r0, [r5] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r5] - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r6, 0 - str r6, [sp, 0x8] - movs r1, 0x1 - mov r2, r8 - movs r3, 0 - bl Print - ldrb r0, [r5] - movs r1, 0x3 - bl CopyWindowToVram - mov r1, r9 - ldr r0, [r1] - ldrb r1, [r0, 0x19] - movs r2, 0xC - ldrsh r0, [r4, r2] - muls r0, r1 - strh r0, [r4, 0xA] - strh r6, [r4, 0x16] - ldr r0, =sub_8141984 - str r0, [r4] - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8141A18 - - thumb_func_start sub_8141AC0 -sub_8141AC0: @ 8141AC0 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =0x0203ab88 - ldr r0, [r5] - adds r0, 0xB8 - ldr r1, =0x0000ffff - bl sub_8151A9C - ldr r6, [r5] - movs r0, 0xB8 - lsls r0, 1 - adds r3, r6, r0 - ldrb r2, [r3] - movs r1, 0x7F - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3] - movs r0, 0xB2 - lsls r0, 1 - adds r3, r6, r0 - ldrb r2, [r3] - adds r0, r1, 0 - ands r0, r2 - strb r0, [r3] - movs r0, 0xAC - lsls r0, 1 - adds r2, r6, r0 - ldrb r0, [r2] - ands r1, r0 - strb r1, [r2] - ldr r6, =0x02020630 - ldr r2, [r5] - ldr r5, =gUnknown_085B6154 - ldr r0, =0x03005e00 - lsls r3, r4, 2 - adds r3, r4 - lsls r3, 3 - adds r3, r0 - movs r0, 0x20 - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0] - adds r2, r0 - adds r2, 0x43 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, =sub_8141B58 - str r0, [r3] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8141AC0 - - thumb_func_start sub_8141B58 -sub_8141B58: @ 8141B58 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - strh r5, [r0, 0x10] - ldr r4, =0x0203ab88 - ldr r1, [r4] - ldrb r0, [r1, 0x1A] - lsls r0, 28 - lsrs r0, 28 - adds r1, 0x1B - adds r1, r0 - strb r2, [r1] - movs r0, 0 - bl sub_81424FC - ldr r3, =0x02020630 - ldr r0, [r4] - adds r0, 0x6C - ldrb r1, [r0] - 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] - adds r7, r3, 0 - movs r0, 0x8 - adds r0, r7 - mov r12, r0 - ldr r1, =0xfffffc00 - mov r8, r1 -_08141BB0: - ldr r0, =0x0203ab88 - ldr r4, [r0] - adds r0, r4, r5 - adds r0, 0x65 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, r0, r7 - adds r2, r3, 0 - adds r2, 0x40 - add r0, r12 - ldr r0, [r0] - ldr r0, [r0] - ldrh r1, [r0] - ldrh r2, [r2] - adds r1, r2 - ldr r2, =0x000003ff - adds r0, r2, 0 - ands r1, r0 - ldrh r2, [r3, 0x4] - mov r0, r8 - ands r0, r2 - orrs r0, r1 - strh r0, [r3, 0x4] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _08141BB0 - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r2, r1, r0 - movs r1, 0x22 - ldrsh r0, [r2, r1] - ldrb r4, [r4, 0x19] - cmp r0, r4 - blt _08141CBC - movs r1, 0x14 - ldrsh r0, [r2, r1] - cmp r0, 0x6 - bne _08141C58 - ldr r4, =0x0203ab8c - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - ldr r2, =gUnknown_082A5C21 - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - ldrb r0, [r4] - movs r1, 0x3 - bl CopyWindowToVram - ldr r1, =dp01t_12_3_battle_menu - b _08141C8E - .pool -_08141C58: - movs r0, 0x22 - ldrsh r1, [r2, r0] - ldr r0, =0x0000270f - cmp r1, r0 - bne _08141CB0 - ldr r4, =0x0203ab8c - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - ldr r2, =gUnknown_082A5C61 - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - ldrb r0, [r4] - movs r1, 0x3 - bl CopyWindowToVram - ldr r1, =sub_8140914 -_08141C8E: - ldr r2, =0x0000ffff - adds r0, r6, 0 - movs r3, 0x3 - bl sub_8141F7C - b _08141CF2 - .pool -_08141CB0: - ldr r0, =sub_8140914 - str r0, [r2] - b _08141CF2 - .pool -_08141CBC: - ldr r4, =0x0203ab8c - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - ldr r2, =gUnknown_082A5C04 - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - ldrb r0, [r4] - movs r1, 0x3 - bl CopyWindowToVram - ldr r1, =sub_8140994 - adds r0, r6, 0 - movs r2, 0x3C - movs r3, 0x3 - bl sub_8141F7C -_08141CF2: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8141B58 - - thumb_func_start dp01t_12_3_battle_menu -dp01t_12_3_battle_menu: @ 8141D0C - push {r4-r7,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - strh r4, [r0, 0x14] - adds r0, r5, 0 - bl sub_8141FF4 - bl sub_8142070 - bl sub_8143A40 - movs r0, 0 - bl sub_81424FC - movs r0, 0x6 - bl sub_814372C - ldr r7, =0x02020630 - ldr r3, =0x0203ab88 - movs r6, 0x5 - negs r6, r6 -_08141D44: - ldr r0, [r3] - adds r0, r4 - adds r0, 0x43 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - adds r1, 0x3E - ldrb r2, [r1] - adds r0, r6, 0 - ands r0, r2 - strb r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xB - bls _08141D44 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r2, r0, r1 - movs r0, 0x22 - ldrsh r1, [r2, r0] - ldr r0, =0x0000270f - cmp r1, r0 - bne _08141DD4 - ldr r4, =0x0203ab8c - ldrb r0, [r4] - movs r1, 0 - bl sub_81973FC - ldrb r0, [r4] - ldr r2, =gUnknown_082A5C61 - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - ldrb r0, [r4] - movs r1, 0x3 - bl CopyWindowToVram - ldr r1, =sub_8140914 - ldr r2, =0x0000ffff - adds r0, r5, 0 - movs r3, 0x3 - bl sub_8141F7C - b _08141DD8 - .pool -_08141DD4: - ldr r0, =sub_8140914 - str r0, [r2] -_08141DD8: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_12_3_battle_menu - - thumb_func_start sub_8141DE4 -sub_8141DE4: @ 8141DE4 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x0203ab88 - ldr r0, [r4] - adds r0, 0xB8 - ldr r1, =0x0000ffff - bl sub_8151A9C - ldr r0, [r4] - adds r0, 0xB8 - bl sub_8151678 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x22] - bl SetCoins - bl GetCoins - ldr r1, [r4] - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1, 0x19] - cmp r0, r1 - bcs _08141E38 - ldr r1, =0x020375e0 - movs r0, 0x1 - b _08141E3C - .pool -_08141E38: - ldr r1, =0x020375e0 - movs r0, 0 -_08141E3C: - strh r0, [r1] - bl GetCoins - lsls r0, 16 - lsrs r0, 16 - bl sub_80EDD78 - movs r0, 0 - str r0, [sp] - movs r0, 0xFF - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl sub_80A27B0 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8141E7C - str r1, [r0] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8141DE4 - - thumb_func_start sub_8141E7C -sub_8141E7C: @ 8141E7C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl fade_and_return_progress_probably - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _08141EDE - movs r0, 0 - bl SetVBlankCallback - ldr r1, =0x02021bbc - ldr r0, =0x02021bbe - strh r4, [r0] - strh r4, [r1] - bl sub_8121DA0 - bl sub_8121E10 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - bl ResetObjectPaletteAllocator - bl sub_80A1A74 - bl ResetAllObjectData - bl sub_8140418 - ldr r1, =0x03005dac - ldr r0, =sub_80AF168 - str r0, [r1] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - adds r0, r5, 0 - bl DestroyTask -_08141EDE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8141E7C - - thumb_func_start sub_8141EF8 -sub_8141EF8: @ 8141EF8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x0203ab88 - ldr r3, [r1] - adds r0, r3, 0 - adds r0, 0xA8 - ldrh r0, [r0] - adds r5, r1, 0 - cmp r0, 0 - beq _08141F1E - ldr r0, =0x030022c0 - adds r2, r3, 0 - adds r2, 0xAA - ldrh r1, [r0, 0x2E] - ldrh r0, [r2] - ands r0, r1 - cmp r0, 0 - beq _08141F52 -_08141F1E: - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - adds r1, r3, 0 - adds r1, 0xAC - ldr r1, [r1] - str r1, [r0] - adds r0, r3, 0 - adds r0, 0xAA - ldrh r0, [r0] - cmp r0, 0 - beq _08141F40 - movs r0, 0x5 - bl audio_play -_08141F40: - ldr r2, [r5] - adds r0, r2, 0 - adds r0, 0xAC - movs r1, 0 - str r1, [r0] - subs r0, 0x2 - strh r1, [r0] - subs r0, 0x2 - strh r1, [r0] -_08141F52: - ldr r0, [r5] - adds r1, r0, 0 - adds r1, 0xA8 - ldrh r2, [r1] - ldr r0, =0x0000ffff - cmp r2, r0 - beq _08141F64 - subs r0, r2, 0x1 - strh r0, [r1] -_08141F64: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8141EF8 - - thumb_func_start sub_8141F7C -sub_8141F7C: @ 8141F7C - push {r4-r7,lr} - adds r5, r1, 0 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r2, 16 - lsrs r4, r2, 16 - lsls r3, 16 - lsrs r7, r3, 16 - ldr r2, =0x0203ab88 - ldr r0, [r2] - mov r12, r0 - mov r3, r12 - adds r3, 0xB4 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r0, [r0] - str r0, [r3] - adds r3, r1, 0 - cmp r5, 0 - bne _08141FAC - adds r5, r0, 0 -_08141FAC: - mov r0, r12 - adds r0, 0xAC - str r5, [r0] - subs r0, 0x4 - strh r4, [r0] - ldr r0, =0x0000ffff - cmp r4, r0 - bne _08141FD8 - cmp r7, 0 - bne _08141FD8 - mov r1, r12 - adds r1, 0xAA - ldrh r0, [r1] - orrs r4, r0 - strh r4, [r1] - b _08141FDE - .pool -_08141FD8: - ldr r0, [r2] - adds r0, 0xAA - strh r7, [r0] -_08141FDE: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r3 - ldr r1, =sub_8141EF8 - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8141F7C - - thumb_func_start sub_8141FF4 -sub_8141FF4: @ 8141FF4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r3, =0x0203ab88 - ldr r0, [r3] - strb r4, [r0] - ldr r2, [r3] - ldrb r1, [r2, 0x3] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x3] - ldr r2, [r3] - ldrb r1, [r2, 0x3] - movs r0, 0x21 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x3] - ldr r2, [r3] - ldrb r1, [r2, 0x3] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x3] - ldr r2, [r3] - ldrb r1, [r2, 0x3] - movs r0, 0x20 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x3] - ldr r6, =0x03005e00 - adds r2, r3, 0 - movs r1, 0 -_08142036: - ldr r0, [r2] - adds r0, 0x1B - adds r0, r4 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _08142036 - ldr r2, [r3] - ldrb r1, [r2, 0x1A] - movs r0, 0x10 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x1A] - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r6 - movs r1, 0 - strh r1, [r0, 0xA] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8141FF4 - - thumb_func_start sub_8142070 -sub_8142070: @ 8142070 - push {lr} - ldr r2, =0x0203ab88 - ldr r1, [r2] - movs r0, 0 - str r0, [r1, 0x8] - movs r1, 0 - movs r3, 0 -_0814207E: - ldr r0, [r2] - adds r0, 0xC - adds r0, r1 - strb r3, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x5 - bls _0814207E - movs r1, 0 - ldr r3, =0x0203ab88 - movs r2, 0 -_08142096: - ldr r0, [r3] - adds r0, 0x12 - adds r0, r1 - strb r2, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x3 - bls _08142096 - movs r1, 0 - ldr r3, =0x0203ab88 - movs r2, 0 -_081420AE: - ldr r0, [r3] - adds r0, 0x16 - adds r0, r1 - strb r2, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x2 - bls _081420AE - movs r0, 0x1 - movs r1, 0xFF - bl sub_8143038 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8142070 - - thumb_func_start sub_81420D0 -sub_81420D0: @ 81420D0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x1C - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - mov r1, sp - ldr r0, =gUnknown_085B642C - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldr r0, [r0] - str r0, [r1] - add r2, sp, 0x10 - adds r1, r2, 0 - ldr r0, =gUnknown_085B643C - ldm r0!, {r3,r6,r7} - stm r1!, {r3,r6,r7} - mov r8, r2 - cmp r5, 0xB - bls _0814210C - movs r0, 0 - b _081421C8 - .pool -_0814210C: - ldr r6, =0x0203ab88 - ldr r3, [r6] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r7, 0x14 - ldrsh r1, [r0, r7] - adds r3, r1 - ldr r4, =gUnknown_085B62E4 - lsls r5, 3 - adds r2, r5, r4 - ldrb r1, [r2, 0x2] - strb r1, [r3, 0xB] - ldrb r1, [r2, 0x2] - strh r1, [r0, 0x20] - ldr r2, [r6] - adds r0, r4, 0x4 - adds r0, r5, r0 - ldr r1, [r2, 0x8] - ldr r0, [r0] - orrs r1, r0 - str r1, [r2, 0x8] - movs r3, 0 - mov r9, r4 - mov r12, r5 - adds r5, r0, 0 -_08142144: - lsls r0, r3, 2 - mov r1, sp - adds r4, r1, r0 - ldr r0, [r4] - ands r0, r5 - cmp r0, 0 - beq _0814215E - ldr r1, [r6] - adds r1, 0x12 - adds r1, r3 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0814215E: - ldr r2, [r6] - adds r0, r2, 0 - adds r0, 0x12 - adds r0, r3 - ldrb r0, [r0] - cmp r0, 0x2 - bls _08142174 - ldr r0, [r2, 0x8] - ldr r1, [r4] - orrs r0, r1 - str r0, [r2, 0x8] -_08142174: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3 - bls _08142144 - movs r6, 0 - ldr r0, =gUnknown_085B62E8 - add r0, r12 - ldr r7, [r0] - ldr r4, =0x0203ab88 - mov r5, r8 -_0814218A: - lsls r0, r6, 2 - adds r2, r5, r0 - ldr r0, [r2] - ands r0, r7 - cmp r0, 0 - beq _081421A2 - ldr r1, [r4] - adds r1, 0x16 - adds r1, r6 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_081421A2: - ldr r3, [r4] - adds r0, r3, 0 - adds r0, 0x16 - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0x3 - bls _081421B8 - ldr r0, [r3, 0x8] - ldr r1, [r2] - orrs r0, r1 - str r0, [r3, 0x8] -_081421B8: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bls _0814218A - mov r0, r12 - add r0, r9 - ldrb r0, [r0, 0x2] -_081421C8: - add sp, 0x1C - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81420D0 - - thumb_func_start sub_81421E8 -sub_81421E8: @ 81421E8 - push {lr} - lsls r0, 24 - lsls r1, 24 - lsrs r2, r1, 24 - lsrs r3, r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x12 - bhi _0814227C - cmp r2, 0xF - bhi _08142278 - lsls r0, r2, 2 - ldr r1, =_08142210 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08142210: - .4byte _08142250 - .4byte _08142254 - .4byte _08142254 - .4byte _08142254 - .4byte _08142254 - .4byte _08142268 - .4byte _08142278 - .4byte _08142278 - .4byte _08142278 - .4byte _08142278 - .4byte _08142268 - .4byte _08142278 - .4byte _08142278 - .4byte _08142278 - .4byte _08142278 - .4byte _08142268 -_08142250: - movs r0, 0x3 - b _0814227E -_08142254: - adds r0, r2, 0x5 - cmp r3, r0 - beq _08142274 - adds r0, 0x5 - cmp r3, r0 - beq _08142274 - adds r0, 0x5 - cmp r3, r0 - bne _0814227C - b _08142274 -_08142268: - adds r0, r2, 0x1 - cmp r3, r0 - blt _0814227C - adds r0, r2, 0x4 - cmp r3, r0 - bgt _0814227C -_08142274: - movs r0, 0x1 - b _0814227E -_08142278: - cmp r3, r2 - beq _08142274 -_0814227C: - movs r0, 0 -_0814227E: - pop {r1} - bx r1 - thumb_func_end sub_81421E8 - - thumb_func_start sub_8142284 -sub_8142284: @ 8142284 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0 - str r0, [sp, 0x18] - cmp r7, 0xA - beq _081422AA - cmp r7, 0xA - bgt _081422A6 - cmp r7, 0x5 - beq _081422AA - b _0814230C -_081422A6: - cmp r7, 0xF - bne _0814230C -_081422AA: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - adds r2, r7, 0x5 - ldr r1, =0x0203ab88 - mov r12, r1 - cmp r4, r2 - bge _081422E8 - ldr r0, [r1] - ldr r3, =gUnknown_085B6154 - ldr r5, [r0, 0x8] - adds r6, r3, 0 - adds r6, 0x8 -_081422C4: - lsls r0, r4, 2 - adds r0, r4 - lsls r1, r0, 2 - adds r0, r1, r6 - ldr r0, [r0] - ands r0, r5 - cmp r0, 0 - bne _081422DE - adds r0, r1, r3 - ldrh r0, [r0, 0x10] - ldr r1, [sp, 0x18] - orrs r1, r0 - str r1, [sp, 0x18] -_081422DE: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r2 - blt _081422C4 -_081422E8: - mov r2, r12 - ldr r0, [r2] - adds r0, 0xB8 - ldr r1, =0x0000dfff - ldr r3, [sp, 0x18] - ands r3, r1 - str r3, [sp, 0x18] - adds r1, r3, 0 - bl sub_8151A48 - b _081424E2 - .pool -_0814230C: - mov r0, sp - ldr r1, =gUnknown_085B63F0 - ldm r1!, {r2,r4,r5} - stm r0!, {r2,r4,r5} - ldm r1!, {r3-r5} - stm r0!, {r3-r5} - subs r0, r7, 0x1 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - mov r9, r1 - cmp r0, 0x3 - bhi _0814232A - movs r2, 0x3 - mov r9, r2 -_0814232A: - adds r0, r7, 0 - movs r1, 0x5 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 8 - ldr r3, =0xffff0000 - adds r0, r3 - lsrs r0, 16 - mov r8, r0 - adds r0, r7, 0 - movs r1, 0x5 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - beq _08142390 - cmp r0, 0x2 - bgt _08142368 - cmp r0, 0x1 - beq _0814237C - ldr r4, =0x0203ab88 - mov r12, r4 - b _081423D4 - .pool -_08142368: - cmp r0, 0x3 - beq _081423A4 - cmp r0, 0x4 - beq _081423B8 - ldr r5, =0x0203ab88 - mov r12, r5 - b _081423D4 - .pool -_0814237C: - ldr r3, =0x02020630 - ldr r2, =0x0203ab88 - ldr r0, [r2] - adds r0, 0x43 - b _081423C0 - .pool -_08142390: - ldr r3, =0x02020630 - ldr r2, =0x0203ab88 - ldr r0, [r2] - adds r0, 0x44 - b _081423C0 - .pool -_081423A4: - ldr r3, =0x02020630 - ldr r2, =0x0203ab88 - ldr r0, [r2] - adds r0, 0x45 - b _081423C0 - .pool -_081423B8: - ldr r3, =0x02020630 - ldr r2, =0x0203ab88 - ldr r0, [r2] - adds r0, 0x46 -_081423C0: - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - lsls r0, 4 - mov r8, r0 - mov r12, r2 -_081423D4: - mov r0, r9 - cmp r0, 0x1 - bne _08142430 - mov r1, r12 - ldr r4, [r1] - ldr r1, =gUnknown_085B6154 - lsls r2, r7, 2 - adds r0, r2, r7 - lsls r0, 2 - adds r1, 0x8 - adds r0, r1 - ldr r1, [r4, 0x8] - ldr r0, [r0] - ands r1, r0 - str r2, [sp, 0x1C] - cmp r1, 0 - bne _081424E2 - adds r0, r7, 0 - movs r1, 0x5 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - subs r1, r0, 0x1 - lsls r1, 3 - mov r3, sp - adds r2, r3, r1 - ldrh r1, [r2, 0x2] - add r1, r8 - strh r1, [r2, 0x2] - adds r1, r4, 0 - adds r1, 0xB8 - lsls r0, 3 - subs r0, 0x8 - adds r2, r3, r0 - adds r0, r1, 0 - movs r1, 0xD - bl sub_815168C - b _081424C4 - .pool -_08142430: - movs r4, 0 - lsls r5, r7, 2 - str r5, [sp, 0x1C] - ldr r0, =gUnknown_085B6154 - mov r10, r0 -_0814243A: - lsls r0, r4, 2 - adds r0, r4 - adds r0, r7, r0 - adds r0, 0x5 - lsls r0, 24 - lsrs r3, r0, 24 - mov r1, r12 - ldr r5, [r1] - lsls r0, r3, 2 - adds r0, r3 - lsls r6, r0, 2 - mov r0, r10 - adds r0, 0x8 - adds r0, r6, r0 - ldr r1, [r5, 0x8] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _081424B0 - adds r0, r3, 0 - movs r1, 0x5 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - subs r1, r0, 0x1 - lsls r1, 3 - mov r3, sp - adds r2, r3, r1 - ldrh r1, [r2, 0x2] - add r1, r8 - strh r1, [r2, 0x2] - adds r3, r5, 0 - adds r3, 0xB8 - adds r1, r4, 0 - adds r1, 0xD - lsls r1, 24 - lsrs r1, 24 - lsls r0, 3 - subs r0, 0x8 - mov r5, sp - adds r2, r5, r0 - adds r0, r3, 0 - bl sub_815168C - mov r0, r9 - cmp r0, 0x3 - bne _081424A2 - mov r1, r10 - adds r0, r6, r1 - ldrh r0, [r0, 0x10] - str r0, [sp, 0x18] -_081424A2: - mov r0, r9 - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r2, =0x0203ab88 - mov r12, r2 -_081424B0: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _0814243A - mov r3, r9 - cmp r3, 0x2 - beq _081424C4 - movs r4, 0 - str r4, [sp, 0x18] -_081424C4: - ldr r0, =0x0203ab88 - ldr r0, [r0] - adds r0, 0xB8 - ldr r2, =gUnknown_085B6154 - ldr r5, [sp, 0x1C] - adds r1, r5, r7 - lsls r1, 2 - adds r1, r2 - ldrh r1, [r1, 0x10] - ldr r2, [sp, 0x18] - orrs r2, r1 - str r2, [sp, 0x18] - adds r1, r2, 0 - bl sub_8151A48 -_081424E2: - 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_8142284 - - thumb_func_start sub_81424FC -sub_81424FC: @ 81424FC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x0203ab88 - ldr r1, [r4] - movs r0, 0x1 - strh r0, [r1, 0x2A] - movs r0, 0 - movs r1, 0 - bl sub_8142E70 - ldr r1, [r4] - ldr r2, =0x0000117c - adds r0, r1, r2 - ldr r2, =0x0000397c - adds r1, r2 - ldr r1, [r1] - movs r2, 0x10 - str r2, [sp] - movs r2, 0xD - str r2, [sp, 0x4] - movs r2, 0xE - movs r3, 0x7 - bl sub_8152058 - cmp r5, 0xF - bhi _081425FC - lsls r0, r5, 2 - ldr r1, =_08142558 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08142558: - .4byte _08142738 - .4byte _08142598 - .4byte _08142598 - .4byte _08142598 - .4byte _08142598 - .4byte _081425CC - .4byte _081425FC - .4byte _081425FC - .4byte _081425FC - .4byte _081425FC - .4byte _081425CC - .4byte _081425FC - .4byte _081425FC - .4byte _081425FC - .4byte _081425FC - .4byte _081425CC -_08142598: - movs r0, 0x4 - str r0, [sp, 0x18] - add r1, sp, 0x8 - movs r0, 0 - strb r0, [r1] - adds r0, r1, 0 - ldrb r0, [r0] - cmp r0, 0x3 - bhi _08142604 - add r4, sp, 0x10 - adds r3, r1, 0 -_081425AE: - ldrb r2, [r3] - adds r2, r4 - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - adds r0, r5, r0 - strb r0, [r2] - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - ldrb r0, [r3] - ldr r1, [sp, 0x18] - cmp r0, r1 - bcc _081425AE - b _08142604 -_081425CC: - movs r2, 0x5 - str r2, [sp, 0x18] - add r1, sp, 0x8 - movs r0, 0 - strb r0, [r1] - adds r0, r1, 0 - ldrb r0, [r0] - cmp r0, 0x4 - bhi _08142604 - add r3, sp, 0x10 - adds r2, r1, 0 -_081425E2: - ldrb r1, [r2] - adds r1, r3 - ldrb r0, [r2] - adds r0, r5, r0 - strb r0, [r1] - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - ldrb r0, [r2] - ldr r1, [sp, 0x18] - cmp r0, r1 - bcc _081425E2 - b _08142604 -_081425FC: - movs r2, 0x1 - str r2, [sp, 0x18] - add r0, sp, 0x10 - strb r5, [r0] -_08142604: - add r1, sp, 0x8 - movs r0, 0 - strb r0, [r1] - adds r0, r1, 0 - ldrb r0, [r0] - ldr r1, [sp, 0x18] - cmp r0, r1 - bcc _08142616 - b _08142738 -_08142616: - mov r2, sp - adds r2, 0xE - str r2, [sp, 0x1C] - add r0, sp, 0x10 - mov r10, r0 - add r1, sp, 0x8 - mov r9, r1 - subs r2, 0x4 - str r2, [sp, 0x20] -_08142628: - mov r1, r9 - ldrb r0, [r1] - add r0, r10 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - ldr r2, =gUnknown_085B6154 - adds r0, r2 - ldrb r0, [r0, 0x6] - ldr r1, [sp, 0x1C] - strb r0, [r1] - mov r2, r9 - ldrb r0, [r2] - add r0, r10 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_085B6154 - adds r0, r1 - ldrb r0, [r0, 0x3] - ldr r2, [sp, 0x20] - strh r0, [r2] - mov r7, sp - adds r7, 0x9 - movs r0, 0 - strb r0, [r7] - ldrb r0, [r7] - cmp r0, 0x2 - bhi _08142726 - add r6, sp, 0xC - mov r8, r2 - ldr r0, [sp, 0x1C] - mov r12, r0 - ldr r1, =0x0203ab88 - str r1, [sp, 0x28] -_08142672: - mov r2, r9 - ldrb r0, [r2] - add r0, r10 - ldrb r0, [r0] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - ldr r0, =gUnknown_085B6154 - adds r1, r0 - str r7, [sp, 0x24] - ldrb r0, [r7] - ldrb r1, [r1, 0x4] - adds r0, r1 - lsls r0, 5 - strh r0, [r6] - ldr r1, [sp, 0x28] - ldr r4, [r1] - mov r2, r8 - ldrh r0, [r2] - ldrh r2, [r6] - adds r2, r0 - lsls r2, 1 - ldr r0, =0x0000117c - adds r5, r4, r0 - adds r2, r5, r2 - mov r1, r12 - ldrb r0, [r1] - ldrb r1, [r7] - adds r1, r0 - ldr r0, =0x0000397c - adds r4, r0 - ldr r3, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - adds r0, r3 - movs r1, 0xD0 - lsls r1, 1 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] - mov r2, r8 - ldrh r0, [r2] - ldrh r2, [r6] - adds r2, r0 - adds r2, 0x1 - lsls r2, 1 - adds r2, r5, r2 - mov r1, r12 - ldrb r0, [r1] - ldrb r1, [r7] - adds r1, r0 - ldr r3, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - adds r0, r3 - movs r1, 0xD1 - lsls r1, 1 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] - mov r2, r8 - ldrh r1, [r2] - ldrh r0, [r6] - adds r0, r1 - adds r0, 0x2 - lsls r0, 1 - adds r5, r0 - mov r1, r12 - ldrb r0, [r1] - ldrb r1, [r7] - adds r1, r0 - ldr r2, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - adds r0, r2 - movs r2, 0xD2 - lsls r2, 1 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r5] - ldrb r0, [r7] - adds r0, 0x1 - strb r0, [r7] - ldr r1, [sp, 0x24] - ldrb r0, [r1] - cmp r0, 0x2 - bls _08142672 -_08142726: - mov r2, r9 - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - ldrb r0, [r2] - ldr r1, [sp, 0x18] - cmp r0, r1 - bcs _08142738 - b _08142628 -_08142738: - 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_81424FC - - thumb_func_start sub_8142758 -sub_8142758: @ 8142758 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_085B6448 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x13 - bls _08142770 - movs r4, 0 -_08142770: - ldr r3, =gUnknown_085B6154 - lsls r0, r4, 2 - adds r0, r4 - lsls r2, r0, 2 - adds r0, r2, r3 - ldrb r0, [r0, 0x1] - lsls r0, 28 - lsrs r0, 28 - cmp r0, 0x4 - beq _081427C4 - cmp r0, 0x4 - bgt _08142798 - cmp r0, 0x3 - beq _0814279E - b _08142808 - .pool -_08142798: - cmp r0, 0xC - beq _081427E8 - b _08142808 -_0814279E: - adds r0, r4, 0 - movs r1, 0x5 - bl __udivsi3 - subs r0, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0203ab88 - ldr r0, [r0] - adds r0, 0x16 - adds r1, r0, r4 - ldrb r0, [r1] - cmp r0, 0x3 - bhi _08142808 - ldrb r0, [r1] - adds r0, 0x1 - b _081427DC - .pool -_081427C4: - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0203ab88 - ldr r0, [r0] - adds r0, 0x12 - adds r1, r0, r4 - ldrb r0, [r1] - cmp r0, 0x2 - bhi _08142808 - ldrb r0, [r1] - adds r0, 0x2 -_081427DC: - add r0, sp - ldrb r0, [r0] - b _0814280A - .pool -_081427E8: - ldr r0, =0x0203ab88 - ldr r1, [r0] - adds r0, r3, 0 - adds r0, 0x8 - adds r0, r2, r0 - ldr r1, [r1, 0x8] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08142808 - mov r0, sp - ldrb r0, [r0, 0x4] - b _0814280A - .pool -_08142808: - movs r0, 0 -_0814280A: - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8142758 - - thumb_func_start sub_8142814 -sub_8142814: @ 8142814 - push {r4-r6,lr} - ldr r4, =0x0203ab88 - ldr r0, [r4] - ldrh r1, [r0, 0x2C] - movs r0, 0x20 - bl SetGpuReg - ldr r0, [r4] - ldrh r1, [r0, 0x2E] - movs r0, 0x22 - bl SetGpuReg - ldr r0, [r4] - ldrh r1, [r0, 0x30] - movs r0, 0x24 - bl SetGpuReg - ldr r0, [r4] - ldrh r1, [r0, 0x32] - movs r0, 0x26 - bl SetGpuReg - ldr r3, [r4] - movs r0, 0x2E - ldrsh r1, [r3, r0] - ldr r0, =0x02021bbe - movs r4, 0 - ldrsh r2, [r0, r4] - adds r2, 0x50 - adds r0, r1, 0 - muls r0, r2 - movs r4, 0xE8 - lsls r4, 7 - subs r4, r0 - movs r6, 0x2C - ldrsh r5, [r3, r6] - ldr r0, =0x02021bbc - movs r6, 0 - ldrsh r1, [r0, r6] - adds r1, 0x74 - adds r0, r5, 0 - muls r0, r1 - subs r4, r0 - movs r5, 0x32 - ldrsh r0, [r3, r5] - muls r0, r2 - movs r5, 0xA8 - lsls r5, 7 - subs r5, r0 - movs r6, 0x30 - ldrsh r0, [r3, r6] - muls r0, r1 - subs r5, r0 - lsls r1, r4, 16 - lsrs r1, 16 - movs r0, 0x28 - bl SetGpuReg - ldr r6, =0x0fff0000 - ands r4, r6 - lsrs r4, 16 - movs r0, 0x2A - adds r1, r4, 0 - bl SetGpuReg - lsls r1, r5, 16 - lsrs r1, 16 - movs r0, 0x2C - bl SetGpuReg - ands r5, r6 - lsrs r5, 16 - movs r0, 0x2E - adds r1, r5, 0 - bl SetGpuReg - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8142814 - - thumb_func_start sub_81428C4 -sub_81428C4: @ 81428C4 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8197930 - ldr r1, =gUnknown_085B6408 - adds r0, r4, 0 - bl sub_8121F68 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81428C4 - - thumb_func_start sub_81428E4 -sub_81428E4: @ 81428E4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08142908 - movs r0, 0 - bl SetVBlankCallback - ldr r0, =sub_81405CC - bl SetMainCallback2 - adds r0, r4, 0 - bl DestroyTask -_08142908: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81428E4 - - thumb_func_start sub_8142918 -sub_8142918: @ 8142918 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - movs r1, 0x1 - bl sub_819746C - bl HideCoinsWindow - bl FreeAllWindowBuffers - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - lsls r1, 26 - lsrs r1, 26 - ldrb r3, [r2, 0x4] - movs r0, 0x40 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x4] - bl fade_and_return_progress_probably - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81428E4 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8142918 - - thumb_func_start sub_814297C -sub_814297C: @ 814297C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - movs r1, 0 - bl sub_819746C - bl HideCoinsWindow - bl script_env_2_disable - adds r0, r4, 0 - bl DestroyTask - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_814297C - - thumb_func_start sub_81429A0 -sub_81429A0: @ 81429A0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081429DE - ldr r1, =0x020375e0 - movs r0, 0x1 - strh r0, [r1] - bl HideCoinsWindow - movs r0, 0 - movs r1, 0x1 - bl sub_819746C - bl script_env_2_disable - adds r0, r4, 0 - bl DestroyTask -_081429DE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81429A0 - - thumb_func_start sub_81429F0 -sub_81429F0: @ 81429F0 - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08142A60 - ldr r2, =gUnknown_085B6344 - ldr r0, =0x020375e0 - ldrh r1, [r0] - movs r5, 0x1 - adds r0, r5, 0 - ands r0, r1 - lsrs r1, 7 - lsls r1, 1 - adds r0, r1 - adds r0, r2 - ldrb r1, [r0] - ldr r0, =0x02021cc4 - movs r2, 0x2 - movs r3, 0x1 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_082A5B12 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - movs r1, 0 - bl sub_81973FC - str r5, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0 - bl Print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81428C4 - str r1, [r0] -_08142A60: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81429F0 - - thumb_func_start sub_8142A88 -sub_8142A88: @ 8142A88 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r6, r0, r1 - movs r1, 0x22 - ldrsh r0, [r6, r1] - bl PrintCoinsString - ldr r2, =gUnknown_085B6344 - ldr r0, =0x020375e0 - mov r8, r0 - ldrh r1, [r0] - movs r7, 0x1 - adds r0, r7, 0 - ands r0, r1 - lsrs r1, 7 - lsls r1, 1 - adds r0, r1 - adds r0, r2 - ldrb r4, [r0] - ldr r0, =0x02021cc4 - adds r1, r4, 0 - movs r2, 0x2 - movs r3, 0x1 - bl ConvertIntToDecimalString - movs r1, 0x22 - ldrsh r0, [r6, r1] - cmp r0, r4 - blt _08142B78 - mov r0, r8 - ldrh r1, [r0] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08142B28 - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _08142B28 - movs r0, 0 - movs r1, 0 - bl sub_81973FC - ldr r2, =gUnknown_082A5B6B - str r7, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =sub_81429F0 - str r0, [r6] - b _08142BB0 - .pool -_08142B28: - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_082A5B12 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - movs r1, 0 - bl sub_81973FC - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0 - bl Print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81428C4 - str r1, [r0] - b _08142BB0 - .pool -_08142B78: - ldr r5, =0x02021fc4 - ldr r1, =gUnknown_082A5B4E - adds r0, r5, 0 - bl ExpandStringRefs - movs r0, 0 - movs r1, 0 - bl sub_81973FC - str r7, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - adds r2, r5, 0 - movs r3, 0 - bl Print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =sub_81429A0 - str r0, [r6] - strh r4, [r6, 0x22] - strh r4, [r6, 0x8] -_08142BB0: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8142A88 - - thumb_func_start sub_8142BC8 -sub_8142BC8: @ 8142BC8 - push {r4,lr} - bl script_env_2_enable - bl GetCoins - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - movs r2, 0x1 - bl ShowCoinsWindow - ldr r0, =sub_8142A88 - movs r1, 0 - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl GetCoins - ldr r2, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r2 - strh r0, [r1, 0x22] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8142BC8 - - thumb_func_start sub_8142C0C -sub_8142C0C: @ 8142C0C - push {lr} - lsls r0, 24 - cmp r0, 0 - bne _08142C44 - bl ResetObjectPaletteAllocator - ldr r0, =gUnknown_085B7384 - bl LoadTaggedObjectPalettes - ldr r0, =gUnknown_085B7864 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085B7978 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085B7A40 - bl LoadCompressedObjectPic - b _08142C5A - .pool -_08142C44: - movs r0, 0xE - bl FreeObjectTilesByTag - movs r0, 0xD - bl FreeObjectTilesByTag - movs r0, 0xC - bl FreeObjectTilesByTag - bl ResetObjectPaletteAllocator -_08142C5A: - pop {r0} - bx r0 - thumb_func_end sub_8142C0C - - thumb_func_start sub_8142C60 -sub_8142C60: @ 8142C60 - push {r4-r6,lr} - adds r4, r1, 0 - adds r6, r2, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, [r0, 0x4] - ldrb r3, [r1] - movs r1, 0x74 - movs r2, 0x50 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r0, =0x02020630 - lsls r1, r5, 4 - adds r1, r5 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r6] - strh r0, [r1, 0x2E] - strh r4, [r1, 0x30] - adds r3, r1, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r3] - adds r1, 0x2C - ldrb r0, [r1] - movs r2, 0x40 - orrs r0, r2 - movs r2, 0x80 - orrs r0, r2 - strb r0, [r1] - ldrh r2, [r6] - adds r0, r2, 0 - adds r0, 0x1E - strh r0, [r6] - lsls r0, 16 - ldr r1, =0x01670000 - cmp r0, r1 - bls _08142CBC - ldr r1, =0xfffffeb6 - adds r0, r2, r1 - strh r0, [r6] -_08142CBC: - adds r0, r5, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8142C60 - - thumb_func_start sub_8142CD0 -sub_8142CD0: @ 8142CD0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - ldr r4, =gUnknown_085B7488 - ldr r0, [r4] - ldr r5, =0x0201c000 - adds r1, r5, 0 - bl LZ77UnCompWram - str r5, [sp] - mov r6, sp - ldrh r1, [r4, 0x6] - lsls r1, 16 - ldrh r0, [r4, 0x4] - orrs r0, r1 - str r0, [sp, 0x4] - mov r0, sp - bl LoadObjectPic - ldr r4, =gUnknown_085B7490 - ldr r0, [r4] - adds r1, r5, 0 - bl LZ77UnCompWram - str r5, [sp] - ldrh r0, [r4, 0x4] - strh r0, [r6, 0x4] - ldrh r0, [r4, 0x6] - strh r0, [r6, 0x6] - mov r0, sp - bl LoadObjectPic - movs r6, 0 - ldr r0, =0x02020630 - mov r8, r0 -_08142D18: - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 27 - lsrs r4, r0, 24 - movs r5, 0 - lsls r7, r6, 2 -_08142D24: - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 3 - ldr r0, =gUnknown_085B75B0 - adds r0, r1, r0 - adds r1, 0x94 - adds r2, r4, 0 - adds r2, 0x5C - movs r3, 0x1E - bl AddObjectToFront - ldr r1, =0x0203ab88 - ldr r1, [r1] - adds r2, r5, 0 - adds r2, 0x1D - adds r2, r7, r2 - adds r1, 0x3C - adds r1, r2 - strb r0, [r1] - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - adds r0, r4, 0 - adds r0, 0x18 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x47 - bls _08142D6E - movs r4, 0 -_08142D6E: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _08142D24 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bls _08142D18 - movs r6, 0 - ldr r4, =0x02020630 -_08142D86: - lsls r1, r6, 1 - adds r1, r6 - lsls r1, 3 - ldr r0, =gUnknown_085B7508 - adds r0, r1, r0 - adds r1, 0x94 - lsls r1, 16 - asrs r1, 16 - movs r2, 0x46 - movs r3, 0x1E - bl AddObjectToFront - ldr r1, =0x0203ab88 - ldr r1, [r1] - adds r1, r6 - adds r1, 0x65 - strb r0, [r1] - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x3 - bls _08142D86 - movs r6, 0 - ldr r4, =0x02020630 -_08142DCC: - lsls r2, r6, 1 - adds r2, r6 - lsls r2, 3 - ldr r0, =gUnknown_085B7568 - adds r0, r2, r0 - adds r2, 0x5C - lsls r2, 16 - asrs r2, 16 - movs r1, 0x7E - movs r3, 0x1E - bl AddObjectToFront - ldr r1, =0x0203ab88 - ldr r1, [r1] - adds r1, r6 - adds r1, 0x69 - strb r0, [r1] - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bls _08142DCC - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8142CD0 - - thumb_func_start sub_8142E3C -sub_8142E3C: @ 8142E3C - push {r4,lr} - movs r4, 0 -_08142E40: - ldr r0, =0x0203ab88 - ldr r0, [r0] - adds r0, r4 - adds r0, 0x59 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xB - bls _08142E40 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8142E3C - - thumb_func_start sub_8142E70 -sub_8142E70: @ 8142E70 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r12, r1 - cmp r0, 0 - beq _08142EC0 - cmp r0, 0x1 - bne _08142F66 - movs r4, 0 - ldr r5, =0x02020630 - ldr r3, =0x0203ab88 - movs r2, 0x4 -_08142E92: - ldr r0, [r3] - adds r0, r4 - adds r0, 0x59 - 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, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x12 - bls _08142E92 - b _08142F66 - .pool -_08142EC0: - movs r4, 0 - ldr r0, =0x0203ab88 - mov r9, r0 - ldr r7, =gUnknown_085B62E4 - adds r1, r7, 0x4 - mov r8, r1 - ldr r5, =0x02020630 - movs r6, 0x5 - negs r6, r6 -_08142ED2: - mov r0, r9 - ldr r2, [r0] - lsls r3, r4, 3 - mov r1, r8 - adds r0, r3, r1 - ldr r1, [r2, 0x8] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08142F14 - adds r0, r3, r7 - ldrb r0, [r0, 0x2] - cmp r0, r12 - beq _08142F14 - adds r0, r2, r4 - adds r0, 0x59 - ldrb r1, [r0] - 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] - b _08142F2C - .pool -_08142F14: - adds r0, r2, r4 - adds r0, 0x59 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r1, 0x3E - ldrb r2, [r1] - adds r0, r6, 0 - ands r0, r2 - strb r0, [r1] -_08142F2C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xB - bls _08142ED2 - cmp r4, 0x12 - bhi _08142F66 - ldr r6, =0x02020630 - ldr r3, =0x0203ab88 - movs r5, 0x5 - negs r5, r5 -_08142F42: - ldr r0, [r3] - adds r0, r4 - adds r0, 0x59 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - adds r1, 0x3E - ldrb r2, [r1] - adds r0, r5, 0 - ands r0, r2 - strb r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x12 - bls _08142F42 -_08142F66: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8142E70 - - thumb_func_start sub_8142F7C -sub_8142F7C: @ 8142F7C - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r5, 0 - ldr r6, =0x0203ab88 - ldr r4, =0x02020630 - movs r0, 0x4 - mov r8, r0 -_08142F8C: - ldr r0, =gUnknown_085B7928 - movs r1, 0x74 - movs r2, 0x14 - movs r3, 0xA - bl AddObjectToFront - ldr r1, [r6] - adds r3, r5, 0 - adds r3, 0x31 - adds r1, 0x3C - adds r1, r3 - strb r0, [r1] - ldr r0, [r6] - adds r0, 0x3C - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - mov r2, r8 - orrs r1, r2 - strb r1, [r0] - ldr r2, [r6] - adds r2, 0x3C - adds r2, r3 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - strh r1, [r0, 0x2E] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_814390C - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x5] - movs r7, 0xD - negs r7, r7 - adds r2, r7, 0 - ands r1, r2 - mov r2, r8 - orrs r1, r2 - strb r1, [r0, 0x5] - ldr r0, [r6] - adds r0, 0x3C - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x8 - bl StartObjectImageAnim - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _08142F8C - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8142F7C - - thumb_func_start sub_8143038 -sub_8143038: @ 8143038 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - movs r6, 0 - cmp r0, 0 - beq _08143084 - ldr r4, =0x02020630 - ldr r3, =0x0203ab88 - movs r2, 0x4 -_08143056: - ldr r0, [r3] - adds r0, r6 - adds r0, 0x6D - ldrb r1, [r0] - 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] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x5 - bls _08143056 - b _08143142 - .pool -_08143084: - ldr r0, =0x0203ab88 - mov r8, r0 - ldr r7, =0x02020630 - ldr r0, =gUnknown_085B6154 - mov r12, r0 - movs r0, 0x5 - negs r0, r0 - mov r10, r0 -_08143094: - mov r0, r8 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xC - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0 - beq _081430A8 - cmp r6, r9 - bne _081430D0 -_081430A8: - adds r0, r1, r6 - adds r0, 0x6D - 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] - b _08143138 - .pool -_081430D0: - adds r5, r6, 0 - adds r5, 0x31 - adds r0, r1, 0 - adds r0, 0x3C - adds r0, r5 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - adds r1, 0x3E - ldrb r2, [r1] - mov r0, r10 - ands r0, r2 - strb r0, [r1] - mov r0, r8 - ldr r3, [r0] - adds r4, r3, 0 - adds r4, 0x3C - adds r4, r5 - ldrb r0, [r4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r7 - adds r3, 0xC - adds r3, r6 - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - add r0, r12 - ldrb r0, [r0, 0x3] - adds r0, 0x1 - lsls r0, 3 - adds r0, 0x4 - strh r0, [r2, 0x20] - ldrb r0, [r4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r7 - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - add r0, r12 - ldrb r0, [r0, 0x4] - adds r0, 0x1 - lsls r0, 3 - adds r0, 0x3 - strh r0, [r2, 0x22] -_08143138: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x5 - bls _08143094 -_08143142: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8143038 - - thumb_func_start sub_8143150 -sub_8143150: @ 8143150 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _08143180 - ldr r2, =0x02020630 - ldr r0, =0x0203ab88 - ldr r0, [r0] - adds r0, 0x6C - 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] - b _081431D0 - .pool -_08143180: - ldr r4, =0x02020630 - ldr r3, =0x0203ab88 - ldr r0, [r3] - adds r0, 0x6C - ldrb r1, [r0] - 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] - ldr r3, [r3] - adds r3, 0x6C - ldrb r0, [r3] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldr r0, =gUnknown_085B6154 - lsls r2, r5, 2 - adds r2, r5 - lsls r2, 2 - adds r2, r0 - ldrb r0, [r2, 0x3] - adds r0, 0x2 - lsls r0, 3 - strh r0, [r1, 0x20] - ldrb r0, [r3] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r2, 0x4] - adds r0, 0x2 - lsls r0, 3 - strh r0, [r1, 0x22] -_081431D0: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8143150 - - thumb_func_start sub_81431E4 -sub_81431E4: @ 81431E4 - push {r4-r7,lr} - sub sp, 0xC - ldr r4, =gUnknown_085B741C - ldr r0, [r4] - ldr r5, =0x0201c000 - adds r1, r5, 0 - bl LZ77UnCompWram - str r5, [sp, 0x4] - add r0, sp, 0x4 - ldrh r2, [r4, 0x6] - lsls r2, 16 - ldrh r1, [r4, 0x4] - orrs r1, r2 - str r1, [r0, 0x4] - bl LoadObjectPic - movs r1, 0xF - mov r0, sp - strh r1, [r0] - movs r0, 0 - ldr r7, =0x02020630 -_08143210: - movs r4, 0 - adds r6, r0, 0x1 - lsls r5, r0, 2 -_08143216: - adds r1, r5, r4 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - ldr r1, =gUnknown_085B7610 - adds r0, r1 - movs r1, 0x28 - mov r2, sp - bl sub_8142C60 - ldr r1, =0x0203ab88 - ldr r1, [r1] - adds r2, r4, 0x7 - adds r2, r5, r2 - adds r1, 0x3C - adds r1, r2 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - adds r1, 0x2C - ldrb r0, [r1] - movs r2, 0x40 - orrs r0, r2 - movs r2, 0x80 - orrs r0, r2 - strb r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _08143216 - lsls r0, r6, 24 - lsrs r0, 24 - cmp r0, 0x2 - bls _08143210 - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81431E4 - - thumb_func_start sub_8143280 -sub_8143280: @ 8143280 - push {r4-r6,lr} - adds r6, r0, 0 - ldr r0, =0x0203ab88 - ldr r1, [r0] - ldrh r0, [r6, 0x2E] - ldrh r1, [r1, 0x24] - adds r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 - asrs r1, r0, 16 - ldr r0, =0x00000167 - cmp r1, r0 - ble _081432A2 - ldr r2, =0xfffffe98 - adds r0, r1, r2 - lsls r0, 16 - lsrs r4, r0, 16 -_081432A2: - adds r0, r4, 0 - bl sine2 - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r4, 0 - bl cosine2 - lsls r2, r5, 16 - asrs r2, 16 - movs r3, 0x30 - ldrsh r1, [r6, r3] - muls r1, r2 - asrs r1, 12 - strh r1, [r6, 0x24] - lsls r0, 16 - asrs r4, r0, 16 - negs r1, r4 - movs r3, 0x30 - ldrsh r0, [r6, r3] - muls r0, r1 - asrs r0, 12 - strh r0, [r6, 0x26] - ldrb r0, [r6, 0x3] - lsls r0, 26 - lsrs r3, r0, 27 - cmp r2, 0 - bge _081432DC - adds r2, 0xF -_081432DC: - lsls r0, r2, 12 - lsrs r5, r0, 16 - ldr r1, =0x02021bc0 - lsls r0, r3, 3 - adds r1, r0, r1 - adds r0, r4, 0 - cmp r0, 0 - bge _081432EE - adds r0, 0xF -_081432EE: - asrs r0, 4 - strh r0, [r1, 0x6] - strh r0, [r1] - strh r5, [r1, 0x2] - lsls r0, r5, 16 - asrs r0, 16 - negs r0, r0 - strh r0, [r1, 0x4] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8143280 - - thumb_func_start sub_8143314 -sub_8143314: @ 8143314 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - movs r5, 0 - ldr r7, =0x0201c000 - mov r6, sp -_08143322: - ldr r0, =gUnknown_085B7750 - lsls r4, r5, 3 - adds r4, r0 - ldr r0, [r4] - adds r1, r7, 0 - bl LZ77UnCompWram - str r7, [sp] - ldrh r2, [r4, 0x4] - ldr r0, =0xffff0000 - ldr r1, [r6, 0x4] - ands r1, r0 - orrs r1, r2 - str r1, [r6, 0x4] - ldrh r2, [r4, 0x6] - lsls r2, 16 - ldr r0, =0x0000ffff - ands r0, r1 - orrs r0, r2 - str r0, [r6, 0x4] - mov r0, sp - bl LoadObjectPic - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x4 - bls _08143322 - ldr r0, =gUnknown_085B77E4 - movs r1, 0xD0 - movs r2, 0x10 - movs r3, 0x4 - bl AddObjectToFront - ldr r3, =0x0203ab88 - ldr r1, [r3] - adds r1, 0x50 - strb r0, [r1] - ldr r4, =0x02020630 - ldr r0, [r3] - adds r0, 0x50 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - movs r5, 0 - adds r7, r3, 0 -_0814338C: - lsls r1, r5, 19 - movs r0, 0xC4 - lsls r0, 16 - adds r1, r0 - asrs r1, 16 - ldr r0, =gUnknown_085B77FC - movs r2, 0x18 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - adds r3, r5, 0 - adds r3, 0x15 - adds r1, 0x3C - adds r1, r3 - strb r0, [r1] - ldr r0, [r7] - adds r0, 0x3C - adds r0, r3 - ldrb r1, [r0] - 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, [r7] - adds r0, 0x3C - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x2C - ldrb r1, [r0] - movs r6, 0x40 - orrs r1, r6 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _0814338C - ldr r0, =gUnknown_085B7814 - movs r1, 0x78 - movs r2, 0x44 - movs r3, 0x4 - bl AddObjectToFront - ldr r2, =0x0203ab88 - ldr r1, [r2] - adds r1, 0x55 - strb r0, [r1] - ldr r3, =0x02020630 - ldr r0, [r2] - adds r0, 0x55 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x2C - ldrb r1, [r0] - orrs r1, r6 - strb r1, [r0] - movs r5, 0 - adds r4, r2, 0 - adds r7, r3, 0 -_0814341C: - lsls r1, r5, 20 - movs r2, 0xC0 - lsls r2, 16 - adds r1, r2 - asrs r1, 16 - ldr r0, =gUnknown_085B782C - movs r2, 0x24 - movs r3, 0x4 - bl AddObjectToFront - ldr r1, [r4] - adds r2, r5, 0 - adds r2, 0x1A - adds r1, 0x3C - adds r1, r2 - strb r0, [r1] - ldr r0, [r4] - adds r0, 0x3C - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - adds r0, 0x3E - ldrb r1, [r0] - movs r3, 0x4 - mov r8, r3 - mov r3, r8 - orrs r1, r3 - strb r1, [r0] - ldr r0, [r4] - adds r0, 0x3C - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - adds r0, 0x2C - ldrb r1, [r0] - movs r6, 0x40 - orrs r1, r6 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _0814341C - ldr r0, =gUnknown_085B7844 - movs r1, 0x98 - movs r2, 0x60 - movs r3, 0x9 - bl AddObjectToFront - ldr r3, =0x0203ab88 - ldr r1, [r3] - adds r1, 0x6C - strb r0, [r1] - ldr r4, =0x02020630 - ldr r0, [r3] - adds r0, 0x6C - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - mov r2, r8 - orrs r0, r2 - strb r0, [r1, 0x5] - ldr r0, [r3] - adds r0, 0x6C - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x2C - ldrb r1, [r0] - orrs r1, r6 - strb r1, [r0] - ldr r0, [r3] - adds r0, 0x6C - ldrb r1, [r0] - 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] - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8143314 - - thumb_func_start sub_8143514 -sub_8143514: @ 8143514 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r7, r0, 16 - movs r0, 0xFA - lsls r0, 2 - mov r8, r0 - movs r4, 0 - movs r6, 0 - ldr r1, =0x02020630 - mov r9, r1 - ldr r0, =0x0203ab88 - mov r10, r0 -_08143534: - adds r0, r7, 0 - mov r1, r8 - bl __udivsi3 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x0203ab88 - ldr r0, [r1] - adds r3, r6, 0 - adds r3, 0x15 - adds r0, 0x3C - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - cmp r5, 0 - bne _0814356E - cmp r4, 0 - bne _0814356E - cmp r6, 0x3 - bne _081435CC -_0814356E: - mov r4, r10 - ldr r0, [r4] - adds r0, 0x3C - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - adds r0, 0x3E - ldrb r1, [r0] - movs r4, 0x5 - negs r4, r4 - adds r2, r4, 0 - ands r1, r2 - strb r1, [r0] - mov r1, r10 - ldr r0, [r1] - adds r0, 0x3C - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - mov r4, r9 - adds r3, r0, r4 - adds r4, r3, 0 - adds r4, 0x40 - ldr r1, =0x02020638 - adds r0, r1 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r5, 2 - adds r0, r1 - ldrh r2, [r0] - ldrh r4, [r4] - adds r2, r4 - ldr r4, =0x000003ff - adds r0, r4, 0 - ands r2, r0 - ldrh r0, [r3, 0x4] - ldr r4, =0xfffffc00 - adds r1, r4, 0 - ands r0, r1 - orrs r0, r2 - strh r0, [r3, 0x4] - movs r4, 0x1 -_081435CC: - adds r0, r7, 0 - mov r1, r8 - bl __umodsi3 - lsls r0, 16 - lsrs r7, r0, 16 - mov r0, r8 - movs r1, 0xA - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x3 - bls _08143534 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8143514 - - thumb_func_start sub_8143614 -sub_8143614: @ 8143614 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_085B7B04 - mov r0, sp - movs r2, 0x5 - bl memcpy - cmp r4, 0x13 - bls _0814362C - movs r4, 0 -_0814362C: - ldr r3, =gUnknown_085B6154 - lsls r0, r4, 2 - adds r0, r4 - lsls r2, r0, 2 - adds r0, r2, r3 - ldrb r0, [r0, 0x1] - lsls r0, 28 - lsrs r0, 28 - cmp r0, 0x4 - beq _08143680 - cmp r0, 0x4 - bgt _08143654 - cmp r0, 0x3 - beq _0814365A - b _081436C4 - .pool -_08143654: - cmp r0, 0xC - beq _081436A4 - b _081436C4 -_0814365A: - adds r0, r4, 0 - movs r1, 0x5 - bl __udivsi3 - subs r0, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0203ab88 - ldr r0, [r0] - adds r0, 0x16 - adds r1, r0, r4 - ldrb r0, [r1] - cmp r0, 0x3 - bhi _081436C4 - ldrb r0, [r1] - adds r0, 0x1 - b _08143698 - .pool -_08143680: - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0203ab88 - ldr r0, [r0] - adds r0, 0x12 - adds r1, r0, r4 - ldrb r0, [r1] - cmp r0, 0x2 - bhi _081436C4 - ldrb r0, [r1] - adds r0, 0x2 -_08143698: - add r0, sp - ldrb r0, [r0] - b _081436C6 - .pool -_081436A4: - ldr r0, =0x0203ab88 - ldr r1, [r0] - adds r0, r3, 0 - adds r0, 0x8 - adds r0, r2, r0 - ldr r1, [r1, 0x8] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _081436C4 - mov r0, sp - ldrb r0, [r0, 0x4] - b _081436C6 - .pool -_081436C4: - movs r0, 0 -_081436C6: - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8143614 - - thumb_func_start sub_81436D0 -sub_81436D0: @ 81436D0 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0203ab88 - ldr r1, [r1] - adds r1, 0x55 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - ldr r2, =0x02020630 - adds r4, r1, r2 - bl sub_8143614 - adds r3, r4, 0 - adds r3, 0x2B - strb r0, [r3] - adds r2, r4, 0 - adds r2, 0x40 - ldr r1, [r4, 0x8] - ldrb r0, [r3] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0] - ldrh r2, [r2] - adds r1, r2 - ldr r2, =0x000003ff - adds r0, r2, 0 - ands r1, r0 - ldrh r2, [r4, 0x4] - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81436D0 - - thumb_func_start sub_814372C -sub_814372C: @ 814372C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r2, r0, 24 - movs r6, 0 - ldr r1, =0x0203ab88 - ldr r0, [r1] - ldrb r0, [r0, 0x19] - adds r5, r1, 0 - cmp r0, 0x1 - bne _08143746 - movs r6, 0x2 -_08143746: - cmp r2, 0x6 - bls _0814374C - b _081438A8 -_0814374C: - lsls r0, r2, 2 - ldr r1, =_08143760 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08143760: - .4byte _081438A8 - .4byte _08143864 - .4byte _0814383C - .4byte _08143830 - .4byte _08143808 - .4byte _081437FC - .4byte _0814377C -_0814377C: - movs r4, 0 - ldr r5, =0x02020630 - ldr r6, =0x0203ab88 - movs r0, 0x5 - negs r0, r0 - mov r12, r0 - adds r7, r5, 0 - adds r7, 0x8 - ldr r2, =0xfffffc00 - mov r8, r2 -_08143790: - ldr r0, [r6] - adds r3, r4, 0 - adds r3, 0x1A - adds r0, 0x3C - adds r0, r3 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r1, 0x3E - ldrb r2, [r1] - mov r0, r12 - ands r0, r2 - strb r0, [r1] - ldr r0, [r6] - adds r0, 0x3C - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, r0, r5 - adds r2, r3, 0 - adds r2, 0x40 - adds r0, r7 - ldr r0, [r0] - ldr r0, [r0] - ldrh r1, [r0] - ldrh r2, [r2] - adds r1, r2 - ldr r2, =0x000003ff - adds r0, r2, 0 - ands r1, r0 - ldrh r2, [r3, 0x4] - mov r0, r8 - ands r0, r2 - orrs r0, r1 - strh r0, [r3, 0x4] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _08143790 - b _081438F4 - .pool -_081437FC: - ldr r2, =0x02020630 - ldr r0, [r5] - adds r0, 0x58 - b _0814386A - .pool -_08143808: - ldr r2, =0x02020630 - ldr r0, [r5] - adds r0, 0x58 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, r0, r2 - adds r4, r3, 0 - adds r4, 0x40 - adds r2, 0x8 - adds r0, r2 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r6, 2 - adds r0, r1 - ldrh r1, [r0, 0x8] - b _08143886 - .pool -_08143830: - ldr r2, =0x02020630 - ldr r0, [r5] - adds r0, 0x57 - b _0814386A - .pool -_0814383C: - ldr r2, =0x02020630 - ldr r0, [r5] - adds r0, 0x57 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, r0, r2 - adds r4, r3, 0 - adds r4, 0x40 - adds r2, 0x8 - adds r0, r2 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r6, 2 - adds r0, r1 - ldrh r1, [r0, 0x8] - b _08143886 - .pool -_08143864: - ldr r2, =0x02020630 - ldr r0, [r5] - adds r0, 0x56 -_0814386A: - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, r0, r2 - adds r4, r3, 0 - adds r4, 0x40 - adds r2, 0x8 - adds r0, r2 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r6, 2 - adds r0, r1 - ldrh r1, [r0, 0x4] -_08143886: - ldrh r4, [r4] - adds r1, r4 - ldr r2, =0x000003ff - adds r0, r2, 0 - ands r1, r0 - ldrh r2, [r3, 0x4] - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r3, 0x4] - b _081438F4 - .pool -_081438A8: - movs r4, 0 - lsls r7, r6, 2 - ldr r6, =0x02020630 - movs r0, 0x8 - adds r0, r6 - mov r12, r0 - ldr r2, =0xfffffc00 - mov r8, r2 -_081438B8: - ldr r0, [r5] - adds r0, r4 - adds r0, 0x56 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, r0, r6 - adds r2, r3, 0 - adds r2, 0x40 - add r0, r12 - ldr r0, [r0] - ldr r0, [r0] - adds r0, r7, r0 - ldrh r1, [r0, 0x8] - ldrh r2, [r2] - adds r1, r2 - ldr r2, =0x000003ff - adds r0, r2, 0 - ands r1, r0 - ldrh r2, [r3, 0x4] - mov r0, r8 - ands r0, r2 - orrs r0, r1 - strh r0, [r3, 0x4] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081438B8 -_081438F4: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814372C - - thumb_func_start sub_814390C -sub_814390C: @ 814390C - ldr r1, =0x0203ab88 - ldr r1, [r1] - ldrh r1, [r1, 0x26] - strh r1, [r0, 0x24] - bx lr - .pool - thumb_func_end sub_814390C - - thumb_func_start sub_814391C -sub_814391C: @ 814391C - push {r4,r5,lr} - sub sp, 0x8 - ldr r4, =gUnknown_085B7948 - ldr r0, [r4] - ldr r5, =0x0201c000 - adds r1, r5, 0 - bl LZ77UnCompWram - str r5, [sp] - ldrh r1, [r4, 0x6] - lsls r1, 16 - ldrh r0, [r4, 0x4] - orrs r0, r1 - str r0, [sp, 0x4] - mov r0, sp - bl LoadObjectPic - ldr r0, =gUnknown_085B7950 - movs r1, 0x74 - movs r2, 0x50 - movs r3, 0x51 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldr r0, =0x0203ab88 - ldr r0, [r0] - ldrh r0, [r0, 0x24] - movs r2, 0 - strh r0, [r1, 0x2E] - strh r2, [r1, 0x30] - adds r3, r1, 0 - adds r3, 0x2C - ldrb r0, [r3] - movs r2, 0x40 - orrs r0, r2 - movs r2, 0x80 - orrs r0, r2 - strb r0, [r3] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r1] - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814391C - - thumb_func_start sub_814399C -sub_814399C: @ 814399C - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - ldr r1, =0x02021bc0 - lsls r0, 3 - adds r0, r1 - ldr r1, =0x0203ab88 - ldr r2, [r1] - ldrh r1, [r2, 0x2C] - strh r1, [r0, 0x6] - ldrh r1, [r2, 0x2C] - strh r1, [r0] - ldrh r1, [r2, 0x2E] - strh r1, [r0, 0x2] - ldrh r1, [r2, 0x30] - strh r1, [r0, 0x4] - bx lr - .pool - thumb_func_end sub_814399C - - thumb_func_start sub_81439C8 -sub_81439C8: @ 81439C8 - push {r4-r6,lr} - movs r4, 0 - ldr r5, =0x0203ab88 - ldr r6, =0x02020630 -_081439D0: - movs r3, 0x39 - subs r3, r4 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gUnknown_085B7928 - movs r1, 0x74 - movs r2, 0x50 - bl AddObjectToFront - ldr r1, [r5] - adds r1, 0x3C - adds r1, r4 - strb r0, [r1] - ldr r0, [r5] - adds r0, 0x3C - adds r1, r0, r4 - ldrb r0, [r1] - cmp r0, 0x40 - beq _08143A24 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r5] - adds r0, 0x3C - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0] -_08143A24: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _081439D0 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81439C8 - - thumb_func_start sub_8143A40 -sub_8143A40: @ 8143A40 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x0203ab88 - ldr r0, [r0] - adds r0, 0x3C - ldrb r5, [r0] - movs r6, 0 - ldr r7, =0x02020630 - movs r0, 0x1C - adds r0, r7 - mov r10, r0 - movs r1, 0x2E - adds r1, r7 - mov r9, r1 - mov r8, r6 -_08143A64: - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - adds r0, r4, r7 - adds r3, r0, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r3] - mov r1, r10 - adds r2, r4, r1 - ldr r1, =DummyObjectCallback - str r1, [r2] - movs r1, 0 - bl StartObjectImageAnim - movs r1, 0 - adds r2, r5, 0x1 - adds r3, r6, 0x1 -_08143A8C: - lsls r0, r1, 1 - adds r0, r4 - add r0, r9 - mov r5, r8 - strh r5, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x7 - bls _08143A8C - lsls r0, r2, 24 - lsrs r5, r0, 24 - lsls r0, r3, 24 - lsrs r6, r0, 24 - cmp r6, 0x5 - bls _08143A64 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8143A40 - - thumb_func_start sub_8143AC8 -sub_8143AC8: @ 8143AC8 - push {r4,r5,lr} - adds r3, r0, 0 - ldr r0, =0x0203ab88 - ldr r0, [r0] - ldrh r4, [r0, 0x24] - movs r2, 0x24 - ldrsh r1, [r0, r2] - ldrh r2, [r3, 0x34] - movs r5, 0x34 - ldrsh r0, [r3, r5] - cmp r1, r0 - ble _08143B04 - movs r1, 0xB4 - lsls r1, 1 - adds r0, r2, r1 - subs r2, r0, r4 - strh r2, [r3, 0x3A] - lsls r1, r2, 16 - ldr r0, =0x01670000 - cmp r1, r0 - ble _08143B08 - ldr r5, =0xfffffe98 - adds r0, r2, r5 - b _08143B06 - .pool -_08143B04: - subs r0, r2, r4 -_08143B06: - strh r0, [r3, 0x3A] -_08143B08: - movs r1, 0x3A - ldrsh r0, [r3, r1] - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8143AC8 - - thumb_func_start sub_8143B14 -sub_8143B14: @ 8143B14 - push {r4,r5,lr} - bl sub_8143AC8 - ldr r5, =0x0203ab88 - ldr r4, [r5] - lsls r0, 16 - asrs r0, 16 - bl __floatsisf - ldr r1, =0x41f00000 - bl __divsf3 - bl __fixunssfsi - adds r4, 0x7E - strb r0, [r4] - ldr r0, [r5] - adds r0, 0x7E - ldrb r0, [r0] - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8143B14 - - thumb_func_start sub_8143B48 -sub_8143B48: @ 8143B48 - push {r4,lr} - adds r4, r0, 0 - bl sub_8143AC8 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1E - bl __modsi3 - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0xE - bne _08143B68 - movs r0, 0 - strh r0, [r4, 0x32] - b _08143B7E -_08143B68: - cmp r1, 0xD - bgt _08143B70 - movs r0, 0xE - b _08143B72 -_08143B70: - movs r0, 0x2B -_08143B72: - subs r0, r1 - lsls r0, 16 - lsrs r0, 16 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 -_08143B7E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8143B48 - - thumb_func_start sub_8143B84 -sub_8143B84: @ 8143B84 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r0, 0 - ldr r5, =0x0203ab88 - ldr r6, [r5] - adds r4, r6, 0 - adds r4, 0x8C - adds r1, r6, 0 - adds r1, 0x90 - ldr r0, [r4] - ldr r1, [r1] - bl __addsf3 - adds r1, r0, 0 - str r1, [r4] - subs r4, 0x4 - ldr r0, [r4] - bl __addsf3 - adds r6, r0, 0 - str r6, [r4] - ldr r0, =0x43b40000 - mov r8, r0 - adds r0, r6, 0 - mov r1, r8 - bl __gesf2 - cmp r0, 0 - blt _08143BD4 - adds r0, r6, 0 - mov r1, r8 - bl __subsf3 - b _08143BE8 - .pool -_08143BD4: - ldr r1, =0x00000000 - adds r0, r6, 0 - bl __ltsf2 - cmp r0, 0 - bge _08143BEA - adds r0, r6, 0 - mov r1, r8 - bl __addsf3 -_08143BE8: - str r0, [r4] -_08143BEA: - ldr r5, [r5] - adds r0, r5, 0 - adds r0, 0x88 - ldr r0, [r0] - bl __fixsfsi - strh r0, [r7, 0x34] - adds r4, r5, 0 - adds r4, 0x98 - adds r1, r5, 0 - adds r1, 0x9C - ldr r0, [r4] - ldr r1, [r1] - bl __addsf3 - adds r1, r0, 0 - str r1, [r4] - subs r4, 0x4 - ldr r0, [r4] - bl __addsf3 - str r0, [r4] - bl __fixsfsi - strh r0, [r7, 0x36] - ldrh r0, [r7, 0x34] - bl sine2 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldrh r0, [r7, 0x34] - bl cosine2 - lsls r4, 16 - asrs r4, 16 - movs r2, 0x36 - ldrsh r1, [r7, r2] - muls r1, r4 - asrs r1, 12 - strh r1, [r7, 0x24] - lsls r0, 16 - asrs r0, 16 - negs r0, r0 - movs r2, 0x36 - ldrsh r1, [r7, r2] - muls r0, r1 - asrs r0, 12 - strh r0, [r7, 0x26] - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - beq _08143C74 - ldr r0, =0x030075f0 - ldr r4, =0x0000ffff - ldrh r2, [r7, 0x24] - lsls r2, 24 - asrs r2, 24 - adds r1, r4, 0 - bl MPlayPanpotControl - ldr r0, =0x03007630 - ldrh r2, [r7, 0x24] - lsls r2, 24 - asrs r2, 24 - adds r1, r4, 0 - bl MPlayPanpotControl -_08143C74: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8143B84 - - thumb_func_start sub_8143C90 -sub_8143C90: @ 8143C90 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x0203ab88 - ldr r1, [r0] - ldrh r0, [r5, 0x3A] - ldrh r1, [r1, 0x24] - adds r2, r0, r1 - strh r2, [r5, 0x34] - lsls r1, r2, 16 - ldr r0, =0x01670000 - cmp r1, r0 - ble _08143CAE - ldr r1, =0xfffffe98 - adds r0, r2, r1 - strh r0, [r5, 0x34] -_08143CAE: - ldrh r0, [r5, 0x34] - bl sine2 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldrh r0, [r5, 0x34] - bl cosine2 - lsls r4, 16 - asrs r4, 16 - movs r2, 0x36 - ldrsh r1, [r5, r2] - muls r1, r4 - asrs r1, 12 - strh r1, [r5, 0x24] - lsls r0, 16 - asrs r0, 16 - negs r0, r0 - movs r2, 0x36 - ldrsh r1, [r5, r2] - muls r0, r1 - ldr r1, =0x02021bbe - asrs r0, 12 - ldrh r1, [r1] - adds r0, r1 - strh r0, [r5, 0x26] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8143C90 - - thumb_func_start sub_8143CFC -sub_8143CFC: @ 8143CFC - push {r4-r7,lr} - adds r5, r0, 0 - bl sub_8143B84 - ldrh r0, [r5, 0x32] - adds r0, 0x1 - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x36] - adds r0, 0x84 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xD4 - bls _08143D22 - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - b _08143D2E -_08143D22: - adds r2, r5, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 -_08143D2E: - strb r0, [r2] - movs r1, 0x32 - ldrsh r0, [r5, r1] - cmp r0, 0x1D - ble _08143DF8 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _08143D6C - ldr r7, =0x0203ab88 - ldr r6, [r7] - adds r4, r6, 0 - adds r4, 0x94 - adds r0, r6, 0 - adds r0, 0xA0 - ldr r0, [r0] - ldr r1, =0x40000000 - bl __subsf3 - adds r1, r0, 0 - ldr r0, [r4] - bl __lesf2 - cmp r0, 0 - bgt _08143DF8 - b _08143D8C - .pool -_08143D6C: - ldr r7, =0x0203ab88 - ldr r6, [r7] - adds r4, r6, 0 - adds r4, 0x94 - adds r0, r6, 0 - adds r0, 0xA0 - ldr r0, [r0] - ldr r1, =0x40000000 - bl __subsf3 - adds r1, r0, 0 - ldr r0, [r4] - bl __gesf2 - cmp r0, 0 - blt _08143DF8 -_08143D8C: - adds r1, r6, 0 - adds r1, 0x7D - movs r0, 0xFF - strb r0, [r1] - ldr r2, [r7] - ldrb r1, [r2, 0x3] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x3] - adds r0, r5, 0 - adds r0, 0x2B - ldrb r1, [r0] - adds r1, 0x3 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl StartObjectImageAnim - adds r0, r5, 0 - bl sub_8143B14 - movs r0, 0x1E - strh r0, [r5, 0x36] - adds r0, r5, 0 - bl sub_8143AC8 - movs r1, 0x3A - ldrsh r0, [r5, r1] - movs r1, 0x1E - bl __divsi3 - lsls r0, 16 - asrs r0, 16 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 1 - adds r1, 0xF - strh r1, [r5, 0x3A] - ldr r0, =sub_8143C90 - str r0, [r5, 0x1C] - movs r0, 0x47 - bl m4aSongNumStartOrChange - ldr r3, [r7] - adds r2, r3, 0 - adds r2, 0x9C - adds r1, r3, 0 - adds r1, 0x98 - ldr r0, =0x00000000 - str r0, [r1] - str r0, [r2] - subs r1, 0xC - ldr r0, =0xbf800000 - str r0, [r1] -_08143DF8: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8143CFC - - thumb_func_start sub_8143E14 -sub_8143E14: @ 8143E14 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r7, r0, 0 - bl sub_8143B84 - movs r1, 0x34 - ldrsh r0, [r7, r1] - cmp r0, 0 - beq _08143E32 - cmp r0, 0xB4 - beq _08143E9C - b _08143F80 -_08143E32: - movs r1, 0x2E - ldrsh r0, [r7, r1] - cmp r0, 0x1 - bne _08143E3C - b _08143F80 -_08143E3C: - movs r1, 0x3C - ldrsh r0, [r7, r1] - bl __floatsisf - mov r9, r0 - ldr r0, =gUnknown_085B6348 - mov r10, r0 - ldr r1, =0x0203ab88 - mov r8, r1 - ldr r0, [r1] - ldrb r4, [r0, 0x4] - lsls r4, 30 - lsrs r0, r4, 25 - add r0, r10 - ldrb r0, [r0, 0x1] - bl __floatsisf - adds r1, r0, 0 - mov r0, r9 - bl __mulsf3 - adds r6, r0, 0 - lsrs r0, r4, 25 - add r0, r10 - ldrb r0, [r0, 0x2] - subs r0, 0x1 - bl __floatsisf - adds r1, r0, 0 - adds r0, r6, 0 - bl __addsf3 - adds r5, r0, 0 - lsrs r4, 25 - add r4, r10 - ldrh r0, [r4, 0xC] - bl __floatsisf - adds r1, r0, 0 - mov r0, r9 - bl __divsf3 - b _08143EFC - .pool -_08143E9C: - movs r1, 0x2E - ldrsh r0, [r7, r1] - cmp r0, 0 - beq _08143F80 - movs r1, 0x3C - ldrsh r0, [r7, r1] - bl __floatsisf - mov r9, r0 - ldr r0, =gUnknown_085B6348 - mov r10, r0 - ldr r1, =0x0203ab88 - mov r8, r1 - ldr r0, [r1] - ldrb r4, [r0, 0x4] - lsls r4, 30 - lsrs r0, r4, 25 - add r0, r10 - ldrb r0, [r0, 0x1] - bl __floatsisf - adds r1, r0, 0 - mov r0, r9 - bl __mulsf3 - adds r6, r0, 0 - lsrs r0, r4, 25 - add r0, r10 - ldrb r0, [r0, 0x2] - subs r0, 0x1 - bl __floatsisf - adds r1, r0, 0 - adds r0, r6, 0 - bl __addsf3 - adds r5, r0, 0 - lsrs r4, 25 - add r4, r10 - ldrh r0, [r4, 0xC] - bl __floatsisf - adds r1, r0, 0 - mov r0, r9 - bl __divsf3 - bl __negsf2 -_08143EFC: - adds r2, r0, 0 - mov r0, r8 - ldr r6, [r0] - adds r1, r6, 0 - adds r1, 0xA0 - adds r0, r6, 0 - adds r0, 0x94 - ldr r0, [r0] - str r0, [r1] - adds r0, r6, 0 - adds r0, 0x98 - str r2, [r0] - movs r0, 0x9C - adds r0, r6 - mov r8, r0 - adds r0, r2, 0 - adds r1, r2, 0 - bl __addsf3 - adds r1, r5, 0 - bl __divsf3 - adds r4, r0, 0 - adds r0, r5, 0 - adds r1, r5, 0 - bl __mulsf3 - adds r1, r0, 0 - ldr r0, =0x40000000 - bl __divsf3 - adds r1, r0, 0 - adds r0, r4, 0 - bl __addsf3 - bl __negsf2 - mov r1, r8 - str r0, [r1] - adds r1, r6, 0 - adds r1, 0x8C - ldr r0, =0x00000000 - str r0, [r1] - adds r2, r7, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r0, r7, 0 - adds r0, 0x2A - movs r2, 0 - strb r2, [r0] - adds r3, r7, 0 - adds r3, 0x3F - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - strb r0, [r3] - ldr r0, =sub_8143CFC - str r0, [r7, 0x1C] - strh r2, [r7, 0x32] -_08143F80: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8143E14 - - thumb_func_start sub_8143FA4 -sub_8143FA4: @ 8143FA4 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x32 - ldrsh r0, [r5, r1] - bl __floatsisf - adds r4, r0, 0 - ldr r1, =0x3d4ccccd - bl __mulsf3 - adds r1, r4, 0 - bl __mulsf3 - bl __fixsfsi - adds r1, r0, 0 - subs r1, 0x2D - strh r1, [r5, 0x26] - ldrh r0, [r5, 0x32] - adds r0, 0x1 - strh r0, [r5, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1D - ble _0814403E - lsls r0, r1, 16 - cmp r0, 0 - blt _0814403E - ldr r4, =0x0203ab88 - ldr r0, [r4] - adds r0, 0x7D - movs r1, 0xFF - strb r1, [r0] - ldr r2, [r4] - ldrb r1, [r2, 0x3] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x3] - adds r0, r5, 0 - adds r0, 0x2B - ldrb r1, [r0] - adds r1, 0x3 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl StartObjectImageAnim - adds r0, r5, 0 - bl sub_8143B14 - movs r0, 0x1E - strh r0, [r5, 0x36] - adds r0, r5, 0 - bl sub_8143AC8 - movs r1, 0x3A - ldrsh r0, [r5, r1] - movs r1, 0x1E - bl __divsi3 - lsls r0, 16 - asrs r0, 16 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 1 - adds r1, 0xF - strh r1, [r5, 0x3A] - ldr r0, =sub_8143C90 - str r0, [r5, 0x1C] - movs r0, 0x47 - bl m4aSongNumStartOrChange - ldr r2, [r4] - ldrb r0, [r2, 0x3] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2, 0x3] -_0814403E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8143FA4 - - thumb_func_start sub_8144050 -sub_8144050: @ 8144050 - push {r4,lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x32] - adds r1, r0, 0x1 - strh r1, [r3, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2C - bgt _08144098 - ldrh r4, [r3, 0x26] - subs r0, r4, 0x1 - strh r0, [r3, 0x26] - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x2D - bne _0814411E - ldr r2, =0x02020630 - ldr r0, =0x0203ab88 - ldr r0, [r0] - adds r0, 0x73 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x2B - ldrb r0, [r0] - cmp r0, 0x1 - bne _0814411E - strh r4, [r3, 0x26] - b _0814411E - .pool -_08144098: - lsls r0, r1, 16 - asrs r0, 16 - movs r2, 0x3C - ldrsh r1, [r3, r2] - cmp r0, r1 - bge _081440E4 - ldr r2, =0x02020630 - ldr r0, =0x0203ab88 - ldr r0, [r0] - adds r0, 0x73 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - adds r0, r1, 0 - adds r0, 0x2C - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bne _0814411E - adds r0, r1, 0 - adds r0, 0x2B - ldrb r0, [r0] - cmp r0, 0x1 - bne _081440DC - ldrh r0, [r3, 0x26] - adds r0, 0x1 - strh r0, [r3, 0x26] - b _0814411E - .pool -_081440DC: - ldrh r0, [r3, 0x26] - subs r0, 0x1 - strh r0, [r3, 0x26] - b _0814411E -_081440E4: - adds r2, r3, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r1, r3, 0 - adds r1, 0x2A - movs r2, 0 - movs r0, 0x1 - strb r0, [r1] - movs r0, 0x3F - adds r0, r3 - mov r12, r0 - ldrb r0, [r0] - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - mov r1, r12 - strb r0, [r1] - strh r2, [r3, 0x32] - ldr r0, =sub_8143FA4 - str r0, [r3, 0x1C] - movs r0, 0x3D - bl m4aSongNumStart -_0814411E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8144050 - - thumb_func_start sub_8144128 -sub_8144128: @ 8144128 - push {r4,lr} - adds r4, r0, 0 - bl sub_8143B84 - movs r0, 0x34 - ldrsh r1, [r4, r0] - cmp r1, 0x5A - beq _08144142 - movs r0, 0x87 - lsls r0, 1 - cmp r1, r0 - beq _0814414C - b _0814415C -_08144142: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0814415C - b _08144154 -_0814414C: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0814415C -_08144154: - ldr r0, =sub_8144050 - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x32] -_0814415C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8144128 - - thumb_func_start sub_8144168 -sub_8144168: @ 8144168 - push {r4,lr} - adds r4, r0, 0 - bl sub_8143B84 - ldr r0, =0x0203ab88 - ldr r0, [r0] - ldrb r0, [r0, 0x3] - lsls r0, 27 - lsrs r0, 27 - cmp r0, 0 - beq _08144182 - cmp r0, 0x1 - beq _08144194 -_08144182: - adds r0, r4, 0 - bl sub_81446DC - ldr r0, =sub_8143E14 - b _0814419C - .pool -_08144194: - adds r0, r4, 0 - bl sub_81448B8 - ldr r0, =sub_8144128 -_0814419C: - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8144168 - - thumb_func_start prev_quest_read_x24_hm_usage -prev_quest_read_x24_hm_usage: @ 81441A8 - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_8143B84 - ldrh r0, [r5, 0x32] - subs r0, 0x1 - strh r0, [r5, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - bne _081441CE - ldr r0, =0x0203ab88 - ldr r4, [r0] - adds r4, 0x98 - ldr r0, [r4] - ldr r1, =0xbf800000 - bl __mulsf3 - str r0, [r4] -_081441CE: - movs r1, 0x32 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0814425C - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _08144244 - ldr r2, =0x0203ab88 - ldr r0, [r2] - adds r0, 0x7D - movs r1, 0xFF - strb r1, [r0] - ldr r2, [r2] - ldrb r1, [r2, 0x3] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x3] - adds r0, r5, 0 - adds r0, 0x2B - ldrb r1, [r0] - adds r1, 0x3 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl StartObjectImageAnim - adds r0, r5, 0 - bl sub_8143B14 - movs r0, 0x1E - strh r0, [r5, 0x36] - adds r0, r5, 0 - bl sub_8143AC8 - movs r1, 0x3A - ldrsh r0, [r5, r1] - movs r1, 0x1E - bl __divsi3 - lsls r0, 16 - asrs r0, 16 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 1 - adds r1, 0xF - strh r1, [r5, 0x3A] - ldr r0, =sub_8143C90 - str r0, [r5, 0x1C] - movs r0, 0x47 - bl m4aSongNumStartOrChange - b _0814425C - .pool -_08144244: - adds r0, r5, 0 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - movs r0, 0x38 - bl m4aSongNumStart - adds r0, r5, 0 - bl sub_8144A24 -_0814425C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end prev_quest_read_x24_hm_usage - - thumb_func_start sub_8144264 -sub_8144264: @ 8144264 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - bl sub_8143B84 - movs r0, 0 - strh r0, [r6, 0x32] - adds r0, r6, 0 - bl sub_8143B14 - ldr r1, =gUnknown_085B62E4 - ldr r4, =0x0203ab88 - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0x7E - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - adds r0, r1 - ldr r0, [r0] - ldr r1, [r2, 0x8] - ands r0, r1 - cmp r0, 0 - bne _081442FC - adds r1, r2, 0 - adds r1, 0x7D - movs r0, 0xFF - strb r0, [r1] - ldr r2, [r4] - ldrb r1, [r2, 0x3] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x3] - adds r0, r6, 0 - adds r0, 0x2B - ldrb r1, [r0] - adds r1, 0x3 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl StartObjectImageAnim - adds r0, r6, 0 - bl sub_8143B14 - movs r0, 0x1E - strh r0, [r6, 0x36] - adds r0, r6, 0 - bl sub_8143AC8 - movs r1, 0x3A - ldrsh r0, [r6, r1] - movs r1, 0x1E - bl __divsi3 - lsls r0, 16 - asrs r0, 16 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 1 - adds r1, 0xF - strh r1, [r6, 0x3A] - ldr r0, =sub_8143C90 - str r0, [r6, 0x1C] - movs r0, 0x47 - bl m4aSongNumStartOrChange - b _081443F8 - .pool -_081442FC: - movs r0, 0x38 - bl m4aSongNumStart - bl GenerateRandomNumber - movs r1, 0x1 - mov r8, r1 - ands r1, r0 - mov r8, r1 - cmp r1, 0 - beq _08144340 - ldr r4, [r4] - adds r1, r4, 0 - adds r1, 0x8C - ldr r0, =0x00000000 - str r0, [r1] - adds r0, r4, 0 - adds r0, 0x7E - ldrb r0, [r0] - adds r0, 0x1 - movs r1, 0xC - bl __modsi3 - lsls r1, r0, 24 - lsrs r2, r1, 24 - adds r1, r4, 0 - adds r1, 0x7F - strb r0, [r1] - ldr r5, =gUnknown_085B6348 - b _08144378 - .pool -_08144340: - ldr r7, [r4] - adds r4, r7, 0 - adds r4, 0x8C - ldr r5, =gUnknown_085B6348 - ldrb r0, [r7, 0x4] - lsls r0, 30 - lsrs r0, 25 - adds r1, r5, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, [r0] - adds r0, r1, 0 - bl __addsf3 - str r0, [r4] - adds r0, r7, 0 - adds r0, 0x7E - ldrb r4, [r0] - adds r0, r4, 0 - adds r0, 0xB - movs r1, 0xC - bl __modsi3 - lsls r0, 24 - lsrs r2, r0, 24 - adds r0, r7, 0 - adds r0, 0x7F - strb r4, [r0] -_08144378: - ldr r0, =gUnknown_085B62E4 - lsls r1, r2, 3 - adds r0, 0x4 - adds r1, r0 - ldr r2, =0x0203ab88 - ldr r3, [r2] - ldr r1, [r1] - ldr r0, [r3, 0x8] - ands r1, r0 - cmp r1, 0 - beq _081443AC - movs r0, 0x1 - strh r0, [r6, 0x2E] - ldrb r0, [r3, 0x4] - lsls r0, 30 - lsrs r0, 25 - adds r0, r5 - ldrb r0, [r0, 0x2] - strh r0, [r6, 0x32] - b _081443E8 - .pool -_081443AC: - strh r1, [r6, 0x2E] - ldrb r1, [r3, 0x4] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081443C4 - lsls r0, r1, 30 - lsrs r0, 25 - adds r0, r5 - ldrb r0, [r0, 0x1] - strh r0, [r6, 0x32] - b _081443E8 -_081443C4: - lsls r0, r1, 30 - lsrs r0, 25 - adds r0, r5 - ldrb r0, [r0, 0x2] - strh r0, [r6, 0x32] - mov r0, r8 - cmp r0, 0 - beq _081443E0 - adds r1, r3, 0 - adds r1, 0x8C - ldr r0, =0x3f000000 - b _081443E6 - .pool -_081443E0: - adds r1, r3, 0 - adds r1, 0x8C - ldr r0, =0xbfc00000 -_081443E6: - str r0, [r1] -_081443E8: - ldr r0, [r2] - adds r0, 0x98 - ldr r1, =0x3dae147b - str r1, [r0] - ldr r0, =prev_quest_read_x24_hm_usage - str r0, [r6, 0x1C] - movs r0, 0x5 - strh r0, [r6, 0x30] -_081443F8: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8144264 - - thumb_func_start sub_8144410 -sub_8144410: @ 8144410 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r6, r0, 0 - bl sub_8143B84 - ldr r4, =0x0203ab88 - ldr r0, [r4] - adds r0, 0x8C - ldr r0, [r0] - ldr r1, =0x3f000000 - bl __gtsf2 - cmp r0, 0 - bgt _081444FA - adds r0, r6, 0 - bl sub_8143B14 - adds r0, r6, 0 - bl sub_8143B48 - lsls r0, 16 - cmp r0, 0 - bne _081444BC - ldr r2, [r4] - adds r1, r2, 0 - adds r1, 0x90 - ldr r0, =0x00000000 - str r0, [r1] - movs r0, 0x8C - adds r0, r2 - mov r8, r0 - ldr r1, =gUnknown_085B6348 - mov r9, r1 - ldrb r0, [r2, 0x4] - lsls r7, r0, 30 - lsrs r0, r7, 25 - add r0, r9 - movs r4, 0x3 - ldrsb r4, [r0, r4] - adds r0, r4, 0 - bl __floatsisf - adds r5, r0, 0 - cmp r4, 0 - bge _08144476 - ldr r1, =0x43800000 - bl __addsf3 - adds r5, r0, 0 -_08144476: - lsrs r0, r7, 25 - add r0, r9 - ldrb r0, [r0, 0x4] - adds r0, 0x1 - bl __floatsisf - adds r1, r0, 0 - adds r0, r5, 0 - bl __divsf3 - adds r1, r0, 0 - mov r2, r8 - ldr r0, [r2] - bl __subsf3 - mov r1, r8 - str r0, [r1] - movs r0, 0x4 - strh r0, [r6, 0x30] - ldr r0, =sub_8144264 - str r0, [r6, 0x1C] - b _081444FA - .pool -_081444BC: - ldr r4, [r4] - adds r7, r4, 0 - adds r7, 0x90 - ldr r0, [r7] - ldr r6, =0x00000000 - adds r1, r6, 0 - bl __nesf2 - cmp r0, 0 - beq _081444FA - adds r5, r4, 0 - adds r5, 0x8C - ldr r0, [r5] - adds r1, r6, 0 - bl __ltsf2 - cmp r0, 0 - bge _081444FA - str r6, [r7] - str r6, [r5] - adds r4, 0x98 - ldr r0, [r4] - bl __extendsfdf2 - ldr r2, =0x3ff33333 - ldr r3, =0x33333333 - bl __divdf3 - bl __truncdfsf2 - str r0, [r4] -_081444FA: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8144410 - - thumb_func_start sub_8144514 -sub_8144514: @ 8144514 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - bl sub_8143B84 - ldr r0, =0x0203ab88 - ldr r5, [r0] - adds r0, r5, 0 - adds r0, 0x94 - ldr r0, [r0] - ldr r1, =0x42200000 - bl __gtsf2 - cmp r0, 0 - bgt _081445B8 - movs r0, 0x98 - adds r0, r5 - mov r8, r0 - adds r7, r5, 0 - adds r7, 0x86 - movs r1, 0 - ldrsh r4, [r7, r1] - adds r0, r4, 0 - bl __floatsisf - adds r2, r0, 0 - cmp r4, 0 - bge _08144556 - ldr r1, =0x47800000 - bl __addsf3 - adds r2, r0, 0 -_08144556: - ldr r0, =0x40800000 - adds r1, r2, 0 - bl __divsf3 - bl __negsf2 - mov r1, r8 - str r0, [r1] - movs r0, 0x90 - adds r0, r5 - mov r8, r0 - adds r5, 0x8C - movs r1, 0 - ldrsh r4, [r7, r1] - adds r0, r4, 0 - bl __floatsisf - adds r2, r0, 0 - cmp r4, 0 - bge _08144586 - ldr r1, =0x47800000 - bl __addsf3 - adds r2, r0, 0 -_08144586: - ldr r0, [r5] - adds r1, r2, 0 - bl __divsf3 - bl __negsf2 - mov r1, r8 - str r0, [r1] - adds r1, r6, 0 - adds r1, 0x2A - movs r0, 0x2 - strb r0, [r1] - adds r2, r6, 0 - adds r2, 0x3F - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - strb r0, [r2] - movs r0, 0x3 - strh r0, [r6, 0x30] - ldr r0, =sub_8144410 - str r0, [r6, 0x1C] -_081445B8: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8144514 - - thumb_func_start sub_81445D8 -sub_81445D8: @ 81445D8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - bl sub_8143B84 - ldr r4, =0x0203ab88 - ldr r0, [r4] - adds r0, 0x94 - ldr r0, [r0] - ldr r1, =0x42700000 - bl __gtsf2 - cmp r0, 0 - bgt _0814468A - movs r0, 0x5D - bl m4aSongNumStartOrChange - ldr r5, [r4] - movs r0, 0x98 - adds r0, r5 - mov r8, r0 - adds r7, r5, 0 - adds r7, 0x84 - movs r1, 0 - ldrsh r4, [r7, r1] - adds r0, r4, 0 - bl __floatsisf - adds r2, r0, 0 - cmp r4, 0 - bge _08144620 - ldr r1, =0x47800000 - bl __addsf3 - adds r2, r0, 0 -_08144620: - ldr r0, =0x41a00000 - adds r1, r2, 0 - bl __divsf3 - bl __negsf2 - mov r1, r8 - str r0, [r1] - movs r0, 0x90 - adds r0, r5 - mov r8, r0 - adds r0, r5, 0 - adds r0, 0x8C - ldr r1, [r0] - ldr r0, =0x3f800000 - bl __subsf3 - adds r5, r0, 0 - movs r1, 0 - ldrsh r4, [r7, r1] - adds r0, r4, 0 - bl __floatsisf - adds r2, r0, 0 - cmp r4, 0 - bge _0814465C - ldr r1, =0x47800000 - bl __addsf3 - adds r2, r0, 0 -_0814465C: - adds r0, r5, 0 - adds r1, r2, 0 - bl __divsf3 - mov r1, r8 - str r0, [r1] - adds r1, r6, 0 - adds r1, 0x2A - movs r0, 0x1 - strb r0, [r1] - adds r2, r6, 0 - adds r2, 0x3F - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - strb r0, [r2] - movs r0, 0x2 - strh r0, [r6, 0x30] - ldr r0, =sub_8144514 - str r0, [r6, 0x1C] -_0814468A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81445D8 - - thumb_func_start sub_81446AC -sub_81446AC: @ 81446AC - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - movs r0, 0x1 - strh r0, [r4, 0x30] - strh r1, [r4, 0x32] - adds r0, r4, 0 - bl sub_8143B84 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r0, =sub_81445D8 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81446AC - - thumb_func_start sub_81446DC -sub_81446DC: @ 81446DC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - mov r8, r0 - ldr r1, =gUnknown_085B7B0A - mov r0, sp - movs r2, 0x8 - bl memcpy - mov r1, r8 - ldrh r0, [r1, 0x3C] - subs r0, 0x2 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - ldr r5, =0x0203ab88 - ldr r0, =gUnknown_085B79F8 - movs r2, 0xC - negs r2, r2 - movs r1, 0x24 - movs r3, 0x32 - bl AddObjectToFront - ldr r1, [r5] - adds r1, 0x73 - strb r0, [r1] - ldr r4, =gUnknown_085B7ABC - mov r3, r8 - movs r0, 0x2E - ldrsh r2, [r3, r0] - lsls r2, 2 - mov r1, sp - adds r0, r1, r2 - movs r3, 0 - ldrsh r1, [r0, r3] - mov r0, sp - adds r0, 0x2 - adds r0, r2 - movs r3, 0 - ldrsh r2, [r0, r3] - adds r0, r4, 0 - movs r3, 0x3B - bl AddObjectToFront - ldr r1, [r5] - adds r1, 0x74 - strb r0, [r1] - adds r4, 0x18 - adds r0, r4, 0 - movs r1, 0x24 - movs r2, 0x8C - movs r3, 0x33 - bl AddObjectToFront - ldr r1, [r5] - adds r1, 0x75 - strb r0, [r1] - ldr r3, =0x02020630 - ldr r0, [r5] - adds r0, 0x75 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r2, [r0, 0x1] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0, 0x1] - movs r7, 0 - adds r6, r3, 0 - ldr r0, =gUnknown_085B6348 - mov r12, r0 - mov r10, r5 -_0814477C: - ldr r0, [r5] - adds r3, r7, 0 - adds r3, 0x37 - adds r0, 0x3C - adds r0, r3 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - adds r1, 0x3E - ldrb r2, [r1] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r0, [r5] - adds r0, 0x3C - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r5] - adds r0, 0x3C - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r5] - adds r0, 0x3C - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] - ldr r4, [r5] - adds r2, r4, 0 - adds r2, 0x3C - adds r2, r3 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r1, r4, 0 - adds r1, 0x73 - ldrb r1, [r1] - strh r1, [r0, 0x36] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r1, r4, 0 - adds r1, 0x74 - ldrb r1, [r1] - strh r1, [r0, 0x38] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r1, r4, 0 - adds r1, 0x75 - ldrb r1, [r1] - strh r1, [r0, 0x3A] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r1, r9 - strh r1, [r0, 0x32] - ldrb r0, [r2] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r6 - mov r0, r8 - movs r1, 0x3C - ldrsh r3, [r0, r1] - ldrb r1, [r4, 0x4] - lsls r1, 30 - lsrs r0, r1, 25 - add r0, r12 - ldrb r0, [r0, 0x1] - muls r3, r0 - lsrs r1, 25 - add r1, r12 - ldrb r0, [r1, 0x2] - ldr r1, =0x0000ffff - adds r0, r1 - adds r3, r0 - strh r3, [r2, 0x34] - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r2, =0x02020630 - cmp r7, 0x2 - bls _0814477C - mov r3, r10 - ldr r0, [r3] - adds r0, 0x74 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r3] - mov r1, r8 - str r1, [r0, 0x38] - 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_81446DC - - thumb_func_start sub_81448B8 -sub_81448B8: @ 81448B8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - adds r7, r0, 0 - movs r0, 0 - mov r8, r0 - ldr r1, =gUnknown_085B7B12 - mov r0, sp - movs r2, 0x8 - bl memcpy - ldrh r0, [r7, 0x3C] - subs r0, 0x2 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - ldr r0, =gUnknown_085B7A10 - movs r1, 0x2E - ldrsh r2, [r7, r1] - lsls r2, 2 - mov r3, sp - adds r1, r3, r2 - movs r3, 0 - ldrsh r1, [r1, r3] - mov r4, sp - adds r4, 0x2 - adds r2, r4, r2 - movs r3, 0 - ldrsh r2, [r2, r3] - movs r3, 0x32 - bl AddObjectToFront - ldr r5, =0x0203ab88 - ldr r1, [r5] - adds r1, 0x73 - strb r0, [r1] - ldr r0, [r5] - adds r0, 0x73 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r6, =0x02020630 - adds r0, r6 - ldrh r1, [r7, 0x2E] - lsls r1, 24 - lsrs r1, 24 - bl StartObjectImageAnim - ldr r0, =gUnknown_085B7AEC - movs r1, 0x2E - ldrsh r2, [r7, r1] - lsls r2, 2 - mov r3, sp - adds r1, r3, r2 - movs r3, 0 - ldrsh r1, [r1, r3] - adds r4, r2 - movs r3, 0 - ldrsh r2, [r4, r3] - movs r3, 0x33 - bl AddObjectToFront - ldr r1, [r5] - adds r1, 0x74 - strb r0, [r1] - ldr r0, [r5] - adds r0, 0x74 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r5] - adds r0, 0x74 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - mov r0, r9 - lsls r2, r0, 16 - asrs r2, 16 - ldr r3, =gUnknown_085B6348 - ldr r0, [r5] - ldrb r1, [r0, 0x4] - lsls r1, 30 - lsrs r0, r1, 25 - adds r0, r3 - ldrb r0, [r0, 0x1] - muls r2, r0 - lsrs r1, 25 - adds r1, r3 - ldrh r0, [r1, 0x10] - adds r0, 0x2D - adds r2, r0 - strh r2, [r7, 0x3C] -_08144992: - ldr r0, =0x0203ab88 - ldr r4, [r0] - mov r1, r8 - adds r2, r4, r1 - adds r2, 0x73 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r1, r4, 0 - adds r1, 0x73 - ldrb r1, [r1] - strh r1, [r0, 0x36] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r3, r4, 0 - adds r3, 0x74 - ldrb r1, [r3] - strh r1, [r0, 0x38] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r1, [r3] - strh r1, [r0, 0x3A] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r3, r9 - strh r3, [r0, 0x32] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrh r0, [r7, 0x3C] - subs r0, 0x2D - strh r0, [r1, 0x34] - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x1 - bls _08144992 - str r7, [r4, 0x38] - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81448B8 - - thumb_func_start sub_8144A24 -sub_8144A24: @ 8144A24 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - adds r7, r0, 0 - movs r0, 0 - mov r9, r0 - movs r1, 0x5 - mov r8, r1 - str r0, [sp, 0xC] - mov r0, sp - movs r1, 0 - movs r2, 0xA - bl memset - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x10] - ldr r3, =0x0203ab88 - ldr r0, [r3] - adds r0, 0x7D - movs r5, 0x1 - strb r5, [r0] - ldr r2, [r3] - ldrb r0, [r2, 0x3] - movs r1, 0x20 - orrs r0, r1 - strb r0, [r2, 0x3] - ldr r2, [r3] - ldrb r1, [r2, 0x3] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x3] - ldr r0, [r3] - adds r0, 0x7E - movs r1, 0xFF - strb r1, [r0] - ldr r6, [r3] - adds r4, r6, 0 - adds r4, 0x88 - movs r1, 0x34 - ldrsh r0, [r7, r1] - bl __floatsisf - str r0, [r4] - adds r1, r6, 0 - adds r1, 0x98 - ldr r0, =0x00000000 - str r0, [r1] - adds r2, r6, 0 - adds r2, 0x8C - ldr r1, =gUnknown_085B6348 - ldrb r0, [r6, 0x4] - lsls r0, 30 - lsrs r0, 25 - adds r1, 0x1C - adds r0, r1 - ldr r0, [r0] - str r0, [r2] - ldrb r0, [r6, 0x4] - lsls r0, 30 - lsrs r0, 30 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 1 - adds r1, 0x21 - ldrb r0, [r6, 0x3] - lsls r0, 27 - lsrs r0, 27 - subs r5, r0 - lsls r0, r5, 4 - subs r0, r5 - adds r1, r0 - lsls r1, 16 - lsrs r1, 16 - mov r5, r9 - movs r0, 0x34 - ldrsh r2, [r7, r0] -_08144ACA: - cmp r1, r2 - bge _08144AD6 - adds r0, r1, 0 - adds r0, 0x5A - cmp r2, r0 - ble _08144B38 -_08144AD6: - cmp r5, 0x3 - beq _08144B1C - adds r0, r1, 0 - adds r0, 0x5A - lsls r0, 16 - lsrs r1, r0, 16 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _08144ACA -_08144AEC: - ldr r0, =0x0203ab88 - ldr r0, [r0] - ldrb r1, [r0, 0x3] - movs r0, 0x1F - ands r0, r1 - cmp r0, 0 - beq _08144B64 - movs r1, 0x2E - ldrsh r0, [r7, r1] - cmp r0, 0 - beq _08144B58 - movs r0, 0x98 - lsls r0, 1 - movs r1, 0x3F - negs r1, r1 - bl cry_related - b _08144B70 - .pool -_08144B1C: - movs r0, 0x1 - strh r0, [r7, 0x2E] - ldr r0, =0x0203ab88 - ldr r2, [r0] - ldrb r1, [r2, 0x3] - movs r0, 0x20 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x3] - b _08144AEC - .pool -_08144B38: - lsrs r0, r5, 1 - strh r0, [r7, 0x2E] - ldr r0, =0x0203ab88 - ldr r3, [r0] - movs r1, 0x1 - ands r1, r5 - ldrb r2, [r3, 0x3] - movs r0, 0x20 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x3] - b _08144AEC - .pool -_08144B58: - movs r0, 0x98 - lsls r0, 1 - movs r1, 0x3F - bl cry_related - b _08144B70 -_08144B64: - movs r0, 0x99 - lsls r0, 1 - movs r1, 0x3F - negs r1, r1 - bl cry_related -_08144B70: - movs r0, 0x2 - mov r10, r0 - ldr r4, =0x0203ab88 - ldr r5, [r4] - adds r0, r5, 0 - adds r0, 0x7F - ldrb r0, [r0] - adds r0, 0x2 - movs r1, 0xC - bl __modsi3 - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r1, [r5, 0x3] - movs r0, 0x1F - ands r0, r1 - cmp r0, 0x1 - bne _08144BA8 - ldrb r1, [r5, 0x4] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x1 - bne _08144BA8 - mov r0, r8 - adds r0, 0x6 - b _08144BAC - .pool -_08144BA8: - mov r0, r8 - add r0, r10 -_08144BAC: - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - mov r5, r10 - cmp r5, r8 - bcs _08144C18 - ldr r1, =gUnknown_085B6160 - mov r10, r1 -_08144BBC: - ldr r3, [r4] - lsls r0, r6, 3 - ldr r1, =gUnknown_085B62E8 - adds r0, r1 - ldr r1, [r3, 0x8] - ldr r2, [r0] - ands r1, r2 - cmp r1, 0 - bne _08144C02 - mov r0, r9 - adds r1, r0, 0x1 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - add r0, sp - strb r5, [r0] - ldr r0, [sp, 0xC] - cmp r0, 0 - bne _08144C02 - ldrb r1, [r3, 0x1A] - lsls r1, 28 - lsrs r1, 28 - adds r0, r3, 0 - adds r0, 0x1B - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - add r0, r10 - ldr r0, [r0] - ands r2, r0 - cmp r2, 0 - beq _08144C02 - str r5, [sp, 0xC] -_08144C02: - adds r0, r6, 0x1 - movs r1, 0xC - bl __modsi3 - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r8 - bcc _08144BBC -_08144C18: - ldr r0, [r4] - ldrb r1, [r0, 0x3] - lsls r1, 27 - lsrs r1, 27 - adds r1, 0x1 - ldrb r0, [r0, 0x2] - ands r1, r0 - cmp r1, 0 - beq _08144C48 - ldr r1, [sp, 0xC] - cmp r1, 0 - beq _08144C48 - movs r0, 0xFF - ldr r1, [sp, 0x10] - ands r0, r1 - cmp r0, 0xBF - bhi _08144C48 - mov r0, sp - ldrh r0, [r0, 0xC] - b _08144C54 - .pool -_08144C48: - ldr r0, [sp, 0x10] - mov r1, r9 - bl __modsi3 - add r0, sp - ldrb r0, [r0] -_08144C54: - strh r0, [r7, 0x3C] - ldr r1, =sub_8144168 - str r1, [r7, 0x1C] - 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_8144A24 - - thumb_func_start sub_8144C70 -sub_8144C70: @ 8144C70 - push {r4,lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x30] - adds r1, r0, 0x1 - strh r1, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x34 - ldrsh r1, [r2, r3] - cmp r0, r1 - blt _08144CC0 - ldrh r0, [r2, 0x20] - subs r0, 0x2 - strh r0, [r2, 0x20] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bge _08144CC0 - ldr r4, =0x0203ab88 - ldr r3, [r4] - ldrb r1, [r3, 0x3] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08144CAC - movs r0, 0x40 - orrs r0, r1 - strb r0, [r3, 0x3] -_08144CAC: - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles - ldr r1, [r4] - movs r0, 0 - strb r0, [r1, 0x1] - ldr r1, [r4] - ldr r0, =gUnknown_085B7B1A - ldrh r0, [r0] - strh r0, [r1, 0x34] -_08144CC0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8144C70 - - thumb_func_start sub_8144CD0 -sub_8144CD0: @ 8144CD0 - push {r4,lr} - sub sp, 0x18 - adds r4, r0, 0 - ldr r1, =gUnknown_085B7B2E - mov r0, sp - movs r2, 0x18 - bl memcpy - ldrh r0, [r4, 0x30] - adds r2, r0, 0x1 - strh r2, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x34 - ldrsh r1, [r4, r3] - cmp r0, r1 - bge _08144D54 - movs r0, 0x1 - ands r2, r0 - cmp r2, 0 - beq _08144D2E - ldr r3, =0x02021bbe - movs r0, 0x3C - ldrsh r2, [r4, r0] - lsls r2, 1 - movs r1, 0x32 - ldrsh r0, [r4, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - lsls r0, 3 - adds r2, r0 - mov r1, sp - adds r0, r1, r2 - ldrh r0, [r0] - strh r0, [r3] - movs r3, 0x3C - ldrsh r2, [r4, r3] - adds r1, r2, 0x1 - adds r0, r1, 0 - cmp r1, 0 - bge _08144D26 - adds r0, r2, 0x4 -_08144D26: - asrs r0, 2 - lsls r0, 2 - subs r0, r1, r0 - strh r0, [r4, 0x3C] -_08144D2E: - 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] - b _08144D7E - .pool -_08144D54: - ldr r1, =0x02021bbe - movs r0, 0 - strh r0, [r1] - ldr r2, =0x02020630 - ldr r0, =0x0203ab88 - ldr r0, [r0] - adds r0, 0x73 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x2C - ldrb r2, [r0] - movs r1, 0x41 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_08144D7E: - add sp, 0x18 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8144CD0 - - thumb_func_start sub_8144D94 -sub_8144D94: @ 8144D94 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0x30] - adds r0, 0x1 - strh r0, [r5, 0x30] - movs r1, 0x30 - ldrsh r0, [r5, r1] - bl __floatsisf - adds r4, r0, 0 - ldr r1, =0x3d1fbe77 - bl __mulsf3 - adds r1, r4, 0 - bl __mulsf3 - bl __fixsfsi - strh r0, [r5, 0x26] - ldr r0, =0x0203ab88 - ldr r3, [r0] - ldr r2, =gUnknown_085B7B1A - ldrb r0, [r3, 0x1] - subs r0, 0x1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r3, 0x34] - ldrb r0, [r3, 0x1] - cmp r0, 0x12 - bhi _08144DDC - adds r0, 0x1 - strb r0, [r3, 0x1] -_08144DDC: - movs r1, 0x30 - ldrsh r0, [r5, r1] - cmp r0, 0x3C - ble _08144E3E - movs r0, 0 - strh r0, [r5, 0x30] - ldr r3, =sub_8144C70 - str r3, [r5, 0x1C] - ldr r2, =0x02020630 - movs r0, 0x3A - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r2, 0 - adds r4, 0x1C - adds r0, r4 - str r3, [r0] - movs r0, 0x3A - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000fffe - strh r1, [r0, 0x30] - movs r0, 0x38 - ldrsh r1, [r5, r0] - 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] - movs r0, 0x38 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =sub_8144CD0 - str r1, [r0] - movs r0, 0xD6 - bl m4aSongNumStart -_08144E3E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8144D94 - - thumb_func_start sub_8144E60 -sub_8144E60: @ 8144E60 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08144EE4 - ldr r0, =0x0203ab88 - ldr r3, [r0] - ldr r1, [r3, 0x38] - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _08144E94 - movs r0, 0x34 - ldrsh r2, [r1, r0] - ldr r1, =gUnknown_085B6348 - ldrb r0, [r3, 0x4] - lsls r0, 30 - lsrs r0, 25 - adds r0, r1 - ldrh r0, [r0, 0x8] - b _08144EA6 - .pool -_08144E94: - movs r0, 0x34 - ldrsh r2, [r1, r0] - ldr r1, =gUnknown_085B6348 - ldrb r0, [r3, 0x4] - lsls r0, 30 - lsrs r0, 25 - adds r0, r1 - ldrh r0, [r0, 0x8] - adds r0, 0xB4 -_08144EA6: - cmp r2, r0 - bne _08144F7C - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - movs r0, 0x2B - bl m4aSongNumStart - ldr r2, =0x0203ab88 - ldr r1, [r2] - movs r0, 0x1 - strb r0, [r1, 0x1] - ldr r1, [r2] - ldr r0, =gUnknown_085B7B1A - ldrh r0, [r0] - strh r0, [r1, 0x34] - b _08144F7C - .pool -_08144EE4: - ldr r5, =0x0203ab88 - ldr r3, [r5] - ldr r2, =gUnknown_085B7B1A - ldrb r0, [r3, 0x1] - subs r0, 0x1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r3, 0x34] - ldrb r0, [r3, 0x1] - cmp r0, 0x12 - bhi _08144F06 - adds r0, 0x1 - strb r0, [r3, 0x1] -_08144F06: - ldr r3, [r5] - ldr r1, [r3, 0x38] - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _08144F30 - movs r0, 0x34 - ldrsh r2, [r1, r0] - ldr r1, =gUnknown_085B6348 - ldrb r0, [r3, 0x4] - lsls r0, 30 - lsrs r0, 25 - adds r0, r1 - ldrh r0, [r0, 0xA] - b _08144F42 - .pool -_08144F30: - movs r0, 0x34 - ldrsh r2, [r1, r0] - ldr r1, =gUnknown_085B6348 - ldrb r0, [r3, 0x4] - lsls r0, 30 - lsrs r0, 25 - adds r0, r1 - ldrh r0, [r0, 0xA] - adds r0, 0xB4 -_08144F42: - cmp r2, r0 - bne _08144F7C - ldr r2, =0x02020630 - movs r0, 0x36 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r2, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_8144D94 - str r1, [r0] - movs r0, 0x36 - ldrsh r1, [r4, r0] - 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] - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x3C] -_08144F7C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8144E60 - - thumb_func_start sub_8144F94 -sub_8144F94: @ 8144F94 - adds r0, 0x3E - ldrb r3, [r0] - lsls r1, r3, 29 - lsrs r1, 31 - movs r2, 0x1 - eors r2, r1 - lsls r2, 2 - movs r1, 0x5 - negs r1, r1 - ands r1, r3 - orrs r1, r2 - strb r1, [r0] - bx lr - thumb_func_end sub_8144F94 - - thumb_func_start sub_8144FB0 -sub_8144FB0: @ 8144FB0 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r2, [r4, 0x22] - movs r0, 0x22 - ldrsh r1, [r4, r0] - movs r0, 0x10 - negs r0, r0 - cmp r1, r0 - ble _08144FC8 - subs r0, r2, 0x1 - strh r0, [r4, 0x22] - b _0814501C -_08144FC8: - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - subs r2, 0x12 - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x5E - bl m4aSongNumStop - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - ldr r5, =0x02020630 - ldr r4, =0x0203ab88 - ldr r0, [r4] - adds r0, 0x74 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - ldr r0, [r4] - adds r0, 0x74 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles -_0814501C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8144FB0 - - thumb_func_start sub_8145030 -sub_8145030: @ 8145030 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x30] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0 - blt _0814505A - subs r1, 0x1 - strh r1, [r4, 0x30] - ldrh r0, [r4, 0x22] - subs r0, 0x1 - strh r0, [r4, 0x22] - lsls r1, 16 - cmp r1, 0 - bne _081450C6 - adds r0, r4, 0 - adds r0, 0x2B - ldrb r0, [r0] - cmp r0, 0x1 - bne _081450C6 - b _08145080 -_0814505A: - ldrh r1, [r4, 0x34] - movs r2, 0x34 - ldrsh r0, [r4, r2] - cmp r0, 0 - blt _08145090 - subs r0, r1, 0x1 - strh r0, [r4, 0x34] - adds r0, r4, 0 - adds r0, 0x2C - ldrb r1, [r0] - movs r0, 0x3F - ands r0, r1 - cmp r0, 0 - bne _081450C6 - adds r0, r4, 0 - adds r0, 0x2B - ldrb r0, [r0] - cmp r0, 0x1 - bne _08145088 -_08145080: - ldrh r0, [r4, 0x26] - adds r0, 0x1 - strh r0, [r4, 0x26] - b _081450C6 -_08145088: - ldrh r0, [r4, 0x26] - subs r0, 0x1 - strh r0, [r4, 0x26] - b _081450C6 -_08145090: - movs r0, 0x2B - bl m4aSongNumStart - ldr r0, =0x0203ab88 - ldr r0, [r0] - ldr r0, [r0, 0x38] - ldrh r1, [r0, 0x2E] - adds r1, 0x4 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - ldr r0, =sub_8144FB0 - str r0, [r4, 0x1C] - ldr r2, =0x02020630 - movs r0, 0x3A - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x2C - ldrb r2, [r0] - movs r1, 0x7F - ands r1, r2 - strb r1, [r0] -_081450C6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8145030 - - thumb_func_start sub_81450D8 -sub_81450D8: @ 81450D8 - push {r4,r5,lr} - sub sp, 0x14 - adds r4, r0, 0 - ldr r1, =gUnknown_085B7B46 - mov r0, sp - movs r2, 0x2 - bl memcpy - add r5, sp, 0x4 - ldr r1, =gUnknown_085B7B48 - adds r0, r5, 0 - movs r2, 0x10 - bl memcpy - ldrh r0, [r4, 0x30] - subs r1, r0, 0x1 - strh r1, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _0814516C - ldr r0, =0x0203ab88 - ldr r0, [r0] - ldr r0, [r0, 0x38] - movs r1, 0x2E - ldrsh r0, [r0, r1] - add r0, sp - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 1 - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - beq _08145208 - movs r1, 0x20 - ldrsh r0, [r4, r1] - movs r4, 0x74 - subs r4, r0 - lsrs r0, r4, 31 - adds r4, r0 - asrs r4, 1 - negs r4, r4 - ldr r0, =0x030075f0 - ldr r5, =0x0000ffff - lsls r4, 24 - asrs r4, 24 - adds r1, r5, 0 - adds r2, r4, 0 - bl MPlayPanpotControl - ldr r0, =0x03007630 - adds r1, r5, 0 - adds r2, r4, 0 - bl MPlayPanpotControl - b _08145208 - .pool -_0814516C: - lsls r0, r1, 16 - cmp r0, 0 - blt _081451BC - ldr r0, =0x0203ab88 - ldr r0, [r0] - ldr r0, [r0, 0x38] - movs r2, 0x2E - ldrsh r0, [r0, r2] - add r0, sp - movs r2, 0 - ldrsb r2, [r0, r2] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x7 - subs r0, r1, r0 - lsls r0, 1 - adds r0, r5, r0 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - muls r0, r2 - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - movs r2, 0x30 - ldrsh r0, [r4, r2] - subs r1, r0 - lsls r1, 1 - mov r0, sp - adds r0, 0x5 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - b _08145208 - .pool -_081451BC: - movs r0, 0x5E - bl m4aSongNumStartOrChange - ldr r0, =0x0203ab88 - ldr r0, [r0] - ldr r0, [r0, 0x38] - movs r2, 0x2E - ldrsh r0, [r0, r2] - cmp r0, 0 - bne _081451E0 - movs r0, 0x98 - lsls r0, 1 - movs r1, 0x3F - bl cry_related - b _081451EC - .pool -_081451E0: - movs r0, 0x98 - lsls r0, 1 - movs r1, 0x3F - negs r1, r1 - bl cry_related -_081451EC: - ldr r0, =0x0203ab88 - ldr r0, [r0] - ldr r0, [r0, 0x38] - ldrh r1, [r0, 0x2E] - adds r1, 0x2 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - movs r0, 0x2D - strh r0, [r4, 0x30] - ldr r0, =sub_8145030 - str r0, [r4, 0x1C] -_08145208: - add sp, 0x14 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81450D8 - - thumb_func_start sub_8145218 -sub_8145218: @ 8145218 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldr r1, =gUnknown_085B7B46 - mov r0, sp - movs r2, 0x2 - bl memcpy - ldrh r0, [r4, 0x30] - subs r1, r0, 0x1 - strh r1, [r4, 0x30] - lsls r0, 16 - cmp r0, 0 - blt _08145284 - ldr r0, =0x0203ab88 - ldr r0, [r0] - ldr r0, [r0, 0x38] - movs r1, 0x2E - ldrsh r0, [r0, r1] - add r0, sp - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 1 - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - ldr r1, =0x02020630 - movs r2, 0x3A - ldrsh r0, [r4, r2] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r1 - adds r2, 0x3E - ldrb r3, [r2] - lsls r0, r3, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - b _08145288 - .pool -_08145284: - ldr r0, =sub_8144F94 - str r0, [r4, 0x1C] -_08145288: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8145218 - - thumb_func_start sub_8145294 -sub_8145294: @ 8145294 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0203ab88 - ldr r3, [r0] - ldr r1, [r3, 0x38] - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _081452DC - movs r0, 0x34 - ldrsh r2, [r1, r0] - ldr r1, =gUnknown_085B6348 - ldrb r0, [r3, 0x4] - lsls r0, 30 - lsrs r0, 25 - adds r0, r1 - ldrh r0, [r0, 0x12] - adds r0, 0x5A - cmp r2, r0 - bne _0814533E - ldr r2, =0x02020630 - movs r0, 0x3A - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r3, 0x34 - b _08145306 - .pool -_081452DC: - movs r0, 0x34 - ldrsh r2, [r1, r0] - ldr r1, =gUnknown_085B6348 - ldrb r0, [r3, 0x4] - lsls r0, 30 - lsrs r0, 25 - adds r0, r1 - ldrh r0, [r0, 0x14] - movs r1, 0x87 - lsls r1, 1 - adds r0, r1 - cmp r2, r0 - bne _0814533E - ldr r2, =0x02020630 - movs r0, 0x3A - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r3, 0x2E -_08145306: - strh r3, [r0, 0x30] - movs r0, 0x36 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x30] - movs r0, 0x3A - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_8145218 - str r1, [r0] - movs r0, 0x36 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =sub_81450D8 - str r1, [r0] - movs r0, 0x2B - bl m4aSongNumStart -_0814533E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8145294 - - thumb_func_start sub_8145354 -sub_8145354: @ 8145354 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - lsls r1, 24 - lsrs r7, r1, 24 - movs r0, 0 - mov r8, r0 - ldr r0, =0x030061ec - ldrb r0, [r0] - cmp r0, 0x1 - beq _081453F8 - cmp r0, 0x1 - bgt _0814537C - cmp r0, 0 - beq _08145382 - b _0814544A - .pool -_0814537C: - cmp r0, 0x2 - beq _08145434 - b _0814544A -_08145382: - ldr r5, =0x0203ab90 - ldr r0, [r5] - cmp r0, 0 - bne _0814539E - movs r0, 0x1C - bl AllocZeroed - str r0, [r5] - ldr r4, =0x0203ab94 - adds r0, r7, 0 - movs r1, 0x7 - bl GetWindowAttribute - str r0, [r4] -_0814539E: - ldr r1, [r5] - ldrh r0, [r6] - movs r2, 0 - strh r0, [r1, 0x14] - ldrb r0, [r6, 0x5] - strb r0, [r1, 0x16] - ldr r0, [r5] - strb r2, [r0, 0x1A] - ldr r0, [r5] - strb r2, [r0, 0x1B] - ldr r0, [r5] - strb r2, [r0, 0x10] - ldr r1, [r5] - movs r0, 0x1C - strb r0, [r1, 0x12] - ldr r0, [r5] - strb r2, [r0, 0x11] - ldrb r1, [r6, 0x4] - lsls r1, 19 - negs r1, r1 - asrs r1, 16 - adds r0, r7, 0 - movs r2, 0x1 - bl sub_8145824 - movs r4, 0 -_081453D2: - adds r0, r7, 0 - ldr r1, =gUnknown_085B8C10 - movs r2, 0x20 - adds r3, r4, 0 - bl CopyToWindowPixelBuffer - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xDF - bls _081453D2 - b _08145420 - .pool -_081453F8: - movs r4, 0 - ldr r1, =0x0203ab90 - ldr r0, [r1] - ldrb r0, [r0, 0x16] - lsls r0, 3 - cmp r8, r0 - bge _08145420 - adds r5, r1, 0 -_08145408: - adds r0, r4, 0 - movs r1, 0 - bl sub_81456A8 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, [r5] - ldrb r0, [r0, 0x16] - lsls r0, 3 - cmp r4, r0 - blt _08145408 -_08145420: - ldr r1, =0x030061ec - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0814544A - .pool -_08145434: - adds r0, r7, 0 - bl sub_8145814 - ldr r0, =gUnknown_085B8BF0 - ldrb r1, [r6, 0x3] - lsls r1, 4 - movs r2, 0x20 - bl gpu_pal_apply - movs r0, 0x1 - mov r8, r0 -_0814544A: - mov r0, r8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8145354 - - thumb_func_start sub_814545C -sub_814545C: @ 814545C - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_8145814 - adds r0, r4, 0 - bl sub_8145648 - ldr r2, =0x0203ab90 - ldr r1, [r2] - ldrb r0, [r1, 0x1B] - cmp r0, 0 - beq _0814547E - subs r0, 0x1 - strb r0, [r1, 0x1B] -_0814547E: - ldr r1, [r2] - ldrb r0, [r1, 0x1A] - cmp r0, 0 - beq _081454A4 - subs r0, 0x1 - strb r0, [r1, 0x1A] - ldr r1, [r2] - ldrb r0, [r1, 0x1A] - cmp r0, 0 - bne _081454A4 - ldrh r0, [r1, 0x18] - bl sub_8145588 - bl sub_814560C - b _0814552A - .pool -_081454A4: - ldr r5, =0x0203ab90 - ldr r0, [r5] - ldrb r0, [r0, 0x10] - cmp r0, 0 - bne _081454B8 - bl sub_814560C - b _0814552A - .pool -_081454B8: - cmp r0, 0x1 - bne _081454C2 - bl sub_81455A8 - b _081454E6 -_081454C2: - cmp r0, 0x8 - bls _081454E6 - bl sub_80A36EC - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _081454DC - bl sub_814560C - ldr r0, [r5] - strb r4, [r0, 0x10] - b _0814552A -_081454DC: - bl sub_81455A8 - ldr r1, [r5] - movs r0, 0x1 - strb r0, [r1, 0x10] -_081454E6: - ldr r5, =0x0203ab90 - ldr r1, [r5] - ldrb r4, [r1, 0x10] - subs r4, 0x1 - lsls r4, 25 - lsrs r4, 24 - ldrb r0, [r1, 0x16] - lsls r0, 3 - ldrb r2, [r1, 0x11] - adds r0, r2 - subs r0, 0x2 - lsls r0, 24 - lsrs r0, 24 - adds r1, r4 - ldrb r1, [r1] - bl sub_81456A8 - ldr r1, [r5] - ldrb r0, [r1, 0x16] - lsls r0, 3 - ldrb r2, [r1, 0x11] - adds r0, r2 - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - adds r4, 0x1 - adds r1, r4 - ldrb r1, [r1] - bl sub_81456A8 - ldr r1, [r5] - ldrb r0, [r1, 0x10] - adds r0, 0x1 - strb r0, [r1, 0x10] -_0814552A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814545C - - thumb_func_start sub_8145534 -sub_8145534: @ 8145534 - push {r4-r6,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - ldr r0, =0x03007420 - ldr r0, [r0, 0x4] - cmp r0, 0 - bge _08145582 - ldr r6, =0x0203ab90 - ldr r1, [r6] - ldrb r0, [r1, 0x1A] - cmp r0, 0 - bne _08145582 - ldrb r0, [r1, 0x1B] - cmp r0, 0 - bne _08145582 - movs r0, 0x4 - strb r0, [r1, 0x1B] - bl sub_80A36EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0814557C - bl sub_80A36B4 - ldr r1, [r6] - strh r4, [r1, 0x18] - movs r0, 0x2 - strb r0, [r1, 0x1A] - b _08145582 - .pool -_0814557C: - adds r0, r5, 0 - bl sub_8145588 -_08145582: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8145534 - - thumb_func_start sub_8145588 -sub_8145588: @ 8145588 - push {lr} - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - movs r2, 0x7D - movs r3, 0xA - bl sub_80A32C0 - ldr r0, =0x0203ab90 - ldr r1, [r0] - movs r0, 0x1 - strb r0, [r1, 0x10] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8145588 - - thumb_func_start sub_81455A8 -sub_81455A8: @ 81455A8 - push {r4,lr} - ldr r3, =0x03002f50 - movs r0, 0 - ldrsb r0, [r3, r0] - cmp r0, 0x1 - bgt _081455C0 - ldr r0, =0x030066d0 - b _081455D8 - .pool -_081455C0: - ldr r2, =0x03006380 - ldrb r1, [r2, 0xB] - movs r0, 0 - ldrsb r0, [r3, r0] - subs r0, 0x1 - subs r1, r0 - ldr r0, [r2, 0x10] - muls r0, r1 - movs r1, 0xD4 - lsls r1, 2 - adds r2, r1 - adds r0, r2 -_081455D8: - movs r1, 0xC6 - lsls r1, 3 - adds r3, r0, r1 - movs r2, 0 - ldr r4, =0x0203ab90 -_081455E2: - ldr r1, [r4] - adds r1, r2 - lsls r0, r2, 1 - adds r0, r3 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 1 - strb r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bls _081455E2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81455A8 - - thumb_func_start sub_814560C -sub_814560C: @ 814560C - push {r4,lr} - ldr r4, =0x0203ab90 - ldr r1, [r4] - ldrb r0, [r1, 0x16] - lsls r0, 3 - ldrb r1, [r1, 0x11] - adds r0, r1 - subs r0, 0x2 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_81456A8 - ldr r1, [r4] - ldrb r0, [r1, 0x16] - lsls r0, 3 - ldrb r1, [r1, 0x11] - adds r0, r1 - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_81456A8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814560C - - thumb_func_start sub_8145648 -sub_8145648: @ 8145648 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r4, =0x0203ab90 - ldr r0, [r4] - ldrb r1, [r0, 0x11] - adds r0, r6, 0 - movs r2, 0 - bl sub_8145824 - ldr r1, [r4] - ldrb r0, [r1, 0x11] - adds r0, 0x2 - strb r0, [r1, 0x11] - ldr r1, [r4] - ldrb r0, [r1, 0x11] - lsrs r0, 3 - ldrb r1, [r1, 0x16] - adds r1, r0, r1 - adds r2, r1, 0x1 - adds r0, r2, 0 - asrs r0, 5 - lsls r0, 5 - subs r0, r2, r0 - lsls r0, 16 - lsrs r5, r0, 16 - movs r4, 0 -_0814567E: - lsls r3, r4, 5 - adds r3, r5, r3 - lsls r3, 16 - lsrs r3, 16 - adds r0, r6, 0 - ldr r1, =gUnknown_085B8C10 - movs r2, 0x20 - bl CopyToWindowPixelBuffer - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bls _0814567E - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8145648 - - thumb_func_start sub_81456A8 -sub_81456A8: @ 81456A8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - lsls r7, r0, 24 - lsrs r4, r7, 24 - lsls r1, 24 - movs r0, 0xFE - lsls r0, 23 - adds r1, r0 - lsrs r1, 16 - adds r0, r1, 0 - bl __floatsidf - ldr r3, _08145768 - ldr r2, _08145764 - bl __divdf3 - bl __fixunsdfsi - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x37 - bls _081456DE - movs r5, 0x37 -_081456DE: - str r5, [sp] - movs r6, 0x1 - ands r6, r4 - ldr r0, _0814576C - ldr r1, [r0] - lsrs r7, 27 - mov r8, r7 - ldr r0, _08145770 - ldrb r1, [r1, 0x12] - cmp r5, r1 - bls _08145780 - ldr r3, _08145774 - adds r0, r6, r0 - ldrb r0, [r0] - mov r9, r0 - movs r7, 0x7 - ands r7, r4 -_08145700: - lsls r1, r5, 1 - lsls r0, r7, 3 - adds r0, r7 - lsls r0, 4 - adds r1, r0 - ldr r2, _08145778 - adds r1, r2 - mov r4, r8 - lsls r0, r4, 5 - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r2, r0, 16 - ldr r1, [r3] - adds r1, r2 - ldrb r0, [r1] - mov r4, r9 - ands r0, r4 - strb r0, [r1] - ldr r4, [r3] - adds r4, r2 - adds r0, r5, 0 - movs r1, 0x3 - str r3, [sp, 0x4] - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x1 - movs r1, 0xF - ands r0, r1 - lsls r1, r6, 4 - adds r0, r1 - ldr r1, _0814577C - adds r0, r1 - ldrb r1, [r4] - ldrb r0, [r0] - orrs r1, r0 - strb r1, [r4] - subs r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, _0814576C - ldr r0, [r2] - ldr r3, [sp, 0x4] - ldrb r0, [r0, 0x12] - cmp r5, r0 - bhi _08145700 - b _081457EA - .align 2, 0 -_08145764: .4byte 0x40920000 -_08145768: .4byte 0x00000000 -_0814576C: .4byte 0x0203ab90 -_08145770: .4byte gUnknown_085B8C30 -_08145774: .4byte 0x0203ab94 -_08145778: .4byte gUnknown_085B8770 -_0814577C: .4byte gUnknown_085B8C32 -_08145780: - lsls r3, r6, 4 - mov r10, r3 - ldr r7, _08145804 - adds r0, r6, r0 - ldrb r0, [r0] - mov r9, r0 - movs r6, 0x7 - ands r6, r4 -_08145790: - lsls r1, r5, 1 - lsls r0, r6, 3 - adds r0, r6 - lsls r0, 4 - adds r1, r0 - ldr r4, _08145808 - adds r1, r4 - mov r2, r8 - lsls r0, r2, 5 - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r2, r0, 16 - ldr r1, [r7] - adds r1, r2 - ldrb r0, [r1] - mov r3, r9 - ands r0, r3 - strb r0, [r1] - ldr r4, [r7] - adds r4, r2 - adds r0, r5, 0 - movs r1, 0x3 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x1 - movs r1, 0xF - ands r0, r1 - add r0, r10 - ldr r1, _0814580C - adds r0, r1 - ldrb r1, [r4] - ldrb r0, [r0] - orrs r1, r0 - strb r1, [r4] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, _08145810 - ldr r0, [r2] - ldrb r0, [r0, 0x12] - cmp r5, r0 - bcc _08145790 -_081457EA: - ldr r3, _08145810 - ldr r0, [r3] - mov r4, sp - ldrb r4, [r4] - strb r4, [r0, 0x12] - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_08145804: .4byte 0x0203ab94 -_08145808: .4byte gUnknown_085B8770 -_0814580C: .4byte gUnknown_085B8C32 -_08145810: .4byte 0x0203ab90 - thumb_func_end sub_81456A8 - - thumb_func_start sub_8145814 -sub_8145814: @ 8145814 - push {lr} - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl CopyWindowToVram - pop {r0} - bx r0 - thumb_func_end sub_8145814 - - thumb_func_start sub_8145824 -sub_8145824: @ 8145824 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 24 - cmp r2, 0 - bne _08145848 - movs r1, 0 - bl GetWindowAttribute - lsls r0, 24 - lsrs r0, 24 - lsls r1, r4, 16 - asrs r1, 8 - movs r2, 0 - bl ChangeBgX -_08145848: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8145824 - - thumb_func_start sub_8145850 -sub_8145850: @ 8145850 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - lsls r1, 24 - lsrs r7, r1, 24 - movs r0, 0 - mov r8, r0 - ldr r6, =0x030061ec - ldrb r0, [r6] - cmp r0, 0 - beq _08145874 - cmp r0, 0x1 - beq _081458B0 - b _081458F8 - .pool -_08145874: - ldr r5, =0x0203ab98 - ldr r0, [r5] - cmp r0, 0 - bne _08145884 - movs r0, 0x8 - bl AllocZeroed - str r0, [r5] -_08145884: - ldr r1, =gUnknown_085B8438 - adds r0, r7, 0 - movs r2, 0 - movs r3, 0 - bl CopyToWindowPixelBuffer - ldr r0, =gUnknown_085B8418 - ldrb r1, [r4, 0x3] - lsls r1, 4 - movs r2, 0x20 - bl gpu_pal_apply - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] - b _081458F8 - .pool -_081458B0: - ldr r0, =gUnknown_085B8C80 - bl LoadObjectPics - ldr r0, =gUnknown_085B8C90 - bl LoadTaggedObjectPalettes - ldr r0, =gUnknown_085B8C68 - ldrb r1, [r4, 0x4] - lsls r1, 19 - movs r2, 0xA0 - lsls r2, 14 - adds r1, r2 - asrs r1, 16 - ldrb r2, [r4, 0x5] - lsls r2, 19 - movs r3, 0xE0 - lsls r3, 14 - adds r2, r3 - asrs r2, 16 - movs r3, 0x1 - bl AddObjectToFront - ldr r2, =0x0203ab98 - ldr r3, [r2] - lsls r0, 24 - lsrs r0, 24 - movs r4, 0 - strh r0, [r3, 0x4] - movs r1, 0x20 - strb r1, [r3] - ldr r0, [r2] - strb r1, [r0, 0x1] - ldr r0, [r2] - strb r4, [r0, 0x2] - movs r0, 0x1 - mov r8, r0 -_081458F8: - mov r0, r8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8145850 - - thumb_func_start sub_8145914 -sub_8145914: @ 8145914 - push {r4-r6,lr} - ldr r4, =0x02020630 - ldr r6, =0x0203ab98 - ldr r0, [r6] - ldrh r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - bl GetObjectPaletteTagBySlot - lsls r0, 16 - lsrs r0, 16 - bl FreeObjectPaletteByTag - ldr r0, [r6] - ldrh r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r4, =0x0203ab90 - ldr r0, [r4] - bl Free - movs r5, 0 - str r5, [r4] - ldr r0, [r6] - bl Free - str r5, [r6] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8145914 - - thumb_func_start sub_814596C -sub_814596C: @ 814596C - push {r4-r7,lr} - sub sp, 0x14 - adds r7, r0, 0 - ldr r3, =0x02020630 - ldr r4, =0x0203ab98 - ldr r0, [r4] - ldrh r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r2, [r0, 0x1] - movs r1, 0x4 - negs r1, r1 - ands r1, r2 - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0, 0x1] - ldr r2, [r4] - ldrh r1, [r2, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0 - strh r1, [r0, 0x6] - ldr r0, =0x0203ab90 - ldr r0, [r0] - ldrb r1, [r0, 0x10] - cmp r1, 0x2 - beq _081459E8 - cmp r1, 0x2 - bgt _081459C0 - cmp r1, 0 - beq _081459C6 - b _08145A2E - .pool -_081459C0: - cmp r1, 0x6 - beq _08145A20 - b _08145A2E -_081459C6: - movs r0, 0x20 - strb r0, [r2, 0x1] - ldr r1, [r4] - movs r0, 0 - ldrsb r0, [r1, r0] - cmp r0, 0 - ble _081459E2 - ldrb r0, [r1, 0x2] - add r4, sp, 0xC - cmp r0, 0x1 - beq _08145A30 - subs r0, 0x1 - strb r0, [r1, 0x2] - b _08145A30 -_081459E2: - movs r0, 0x5 - strb r0, [r1, 0x2] - b _08145A2E -_081459E8: - movs r3, 0 - movs r2, 0 - add r4, sp, 0xC - adds r5, r0, 0 -_081459F0: - lsls r1, r3, 24 - asrs r1, 24 - adds r0, r5, r2 - ldrb r0, [r0] - cmp r1, r0 - bge _081459FE - adds r3, r0, 0 -_081459FE: - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0xF - bls _081459F0 - lsls r0, r3, 24 - asrs r0, 24 - movs r1, 0xD0 - muls r0, r1 - cmp r0, 0 - bge _08145A16 - adds r0, 0xFF -_08145A16: - lsls r0, 16 - asrs r0, 24 - bl sub_8145B24 - b _08145A30 -_08145A20: - ldrb r1, [r0, 0xA] - movs r0, 0xD0 - muls r0, r1 - lsls r0, 16 - asrs r0, 24 - bl sub_8145B24 -_08145A2E: - add r4, sp, 0xC -_08145A30: - ldr r0, =0x0203ab98 - ldr r2, [r0] - ldrb r5, [r2] - movs r1, 0 - ldrsb r1, [r2, r1] - movs r3, 0x1 - ldrsb r3, [r2, r3] - adds r6, r0, 0 - cmp r1, r3 - beq _08145A82 - cmp r1, r3 - bge _08145A64 - ldrb r0, [r2, 0x2] - adds r0, r5, r0 - strb r0, [r2] - ldr r2, [r6] - movs r1, 0 - ldrsb r1, [r2, r1] - ldrb r3, [r2, 0x1] - movs r0, 0x1 - ldrsb r0, [r2, r0] - cmp r1, r0 - ble _08145A82 - b _08145A7A - .pool -_08145A64: - ldrb r0, [r2, 0x2] - subs r0, r5, r0 - strb r0, [r2] - ldr r2, [r6] - movs r1, 0 - ldrsb r1, [r2, r1] - ldrb r3, [r2, 0x1] - movs r0, 0x1 - ldrsb r0, [r2, r0] - cmp r1, r0 - bge _08145A82 -_08145A7A: - strb r3, [r2] - ldr r1, [r6] - movs r0, 0 - strb r0, [r1, 0x1] -_08145A82: - ldr r2, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r2 - movs r1, 0x80 - lsls r1, 1 - orrs r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 17 - orrs r0, r1 - str r0, [sp, 0x4] - ldr r0, [r6] - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r1, 24 - lsrs r1, 16 - ldr r0, [sp, 0x8] - ands r0, r2 - orrs r0, r1 - str r0, [sp, 0x8] - add r0, sp, 0x4 - adds r1, r4, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ObjAffineSet - add r0, sp, 0xC - ldrh r1, [r0] - ldrh r2, [r4, 0x2] - ldrh r3, [r4, 0x4] - ldrh r0, [r4, 0x6] - str r0, [sp] - movs r0, 0 - bl SetSpriteTransformationMatrix - ldr r2, =gUnknown_08329F40 - ldr r0, [r6] - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - adds r0, 0x7F - movs r1, 0xFF - ands r0, r1 - lsls r1, r0, 1 - adds r1, r2 - adds r0, 0x40 - lsls r0, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0 - ldrsh r1, [r1, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - cmp r0, 0 - bge _08145AF6 - adds r0, 0xFF -_08145AF6: - asrs r0, 8 - strh r0, [r7, 0x24] - lsls r1, r2, 16 - asrs r1, 16 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - cmp r0, 0 - bge _08145B0A - adds r0, 0xFF -_08145B0A: - asrs r0, 8 - strh r0, [r7, 0x26] - add sp, 0x14 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814596C - - thumb_func_start sub_8145B24 -sub_8145B24: @ 8145B24 - push {lr} - lsls r0, 24 - asrs r0, 24 - movs r1, 0x20 - subs r2, r1, r0 - movs r0, 0xFF - ands r2, r0 - adds r0, r2, 0 - subs r0, 0x21 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xBE - bhi _08145B40 - movs r2, 0xE0 -_08145B40: - ldr r1, =0x0203ab98 - ldr r0, [r1] - strb r2, [r0, 0x1] - ldr r1, [r1] - movs r0, 0x5 - strb r0, [r1, 0x2] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8145B24 - - thumb_func_start PrintCoinsString -@ void PrintCoinsString(s32 coinAmount) -PrintCoinsString: @ 8145B54 - push {r4,lr} - sub sp, 0xC - adds r1, r0, 0 - ldr r0, =0x02021cc4 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E8DAB - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x40 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - ldr r0, =0x0203ab9c - ldrb r0, [r0] - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x1 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - bl Print - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end PrintCoinsString - - thumb_func_start ShowCoinsWindow -@ void ShowCoinsWindow(s32 coinAmount, u8 x, u8 y) -ShowCoinsWindow: @ 8145BAC - push {r4,r5,lr} - sub sp, 0x18 - adds r5, r0, 0 - adds r4, r1, 0 - adds r3, r2, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x8 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - ldr r0, =0x00000141 - str r0, [sp, 0xC] - add r0, sp, 0x10 - movs r1, 0 - adds r2, r4, 0 - bl rbox_template_set - ldr r4, =0x0203ab9c - add r0, sp, 0x10 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl FillWindowPixelBuffer - ldrb r0, [r4] - bl PutWindowTilemap - ldrb r0, [r4] - movs r2, 0x85 - lsls r2, 2 - movs r1, 0 - movs r3, 0xE - bl SetWindowBorderStyle - adds r0, r5, 0 - bl PrintCoinsString - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ShowCoinsWindow - - thumb_func_start HideCoinsWindow -@ void HideCoinsWindow() -HideCoinsWindow: @ 8145C14 - push {r4,lr} - ldr r4, =0x0203ab9c - ldrb r0, [r4] - movs r1, 0x1 - bl sub_819746C - ldrb r0, [r4] - bl RemoveWindow - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end HideCoinsWindow - - thumb_func_start GetCoins -@ u16 GetCoins() -GetCoins: @ 8145C30 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x00000494 - adds r1, r0 - ldr r0, =0x03005d90 - ldr r0, [r0] - adds r0, 0xAC - ldr r0, [r0] - ldrh r1, [r1] - eors r0, r1 - lsls r0, 16 - lsrs r0, 16 - bx lr - .pool - thumb_func_end GetCoins - - thumb_func_start SetCoins -@ void SetCoins(u16 amount) -SetCoins: @ 8145C58 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x03005d8c - ldr r2, [r1] - ldr r1, =0x03005d90 - ldr r1, [r1] - adds r1, 0xAC - ldr r1, [r1] - eors r0, r1 - ldr r1, =0x00000494 - adds r2, r1 - strh r0, [r2] - bx lr - .pool - thumb_func_end SetCoins - - thumb_func_start AddCoins -@ bool8 AddCoins(u16 amount) -AddCoins: @ 8145C80 - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - bl GetCoins - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x0000270e - cmp r1, r0 - bls _08145C9C - movs r0, 0 - b _08145CC0 - .pool -_08145C9C: - adds r0, r1, r4 - cmp r1, r0 - ble _08145CAC - ldr r0, =0x0000270f - b _08145CBA - .pool -_08145CAC: - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x0000270f - cmp r1, r0 - bls _08145CB8 - adds r1, r0, 0 -_08145CB8: - adds r0, r1, 0 -_08145CBA: - bl SetCoins - movs r0, 0x1 -_08145CC0: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end AddCoins - - thumb_func_start SubtractCoins -@ bool8 SubtractCoins(u16 amount) -SubtractCoins: @ 8145CCC - push {r4,lr} - lsls r0, 16 - lsrs r4, r0, 16 - bl GetCoins - lsls r0, 16 - lsrs r0, 16 - cmp r0, r4 - bcs _08145CE2 - movs r0, 0 - b _08145CEE -_08145CE2: - subs r0, r4 - lsls r0, 16 - lsrs r0, 16 - bl SetCoins - movs r0, 0x1 -_08145CEE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end SubtractCoins - - thumb_func_start sub_8145CF4 -sub_8145CF4: @ 8145CF4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r5, r2, 24 - bl sub_8145D48 - adds r4, r0, 0 - cmp r4, 0 - bne _08145D10 -_08145D0C: - movs r0, 0 - b _08145D42 -_08145D10: - ldr r6, =0x0000ffff - b _08145D26 - .pool -_08145D18: - subs r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_08145D1E: - adds r4, 0x4 - ldr r0, [r4] - cmp r0, 0 - beq _08145D0C -_08145D26: - ldr r1, [r4] - ldrh r0, [r1, 0x4] - cmp r0, r6 - beq _08145D3A - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08145D1E -_08145D3A: - cmp r5, 0 - bne _08145D18 - ldr r0, [r4] - ldr r0, [r0] -_08145D42: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8145CF4 - - thumb_func_start sub_8145D48 -sub_8145D48: @ 8145D48 - push {r4-r6,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - movs r2, 0 - ldr r0, =gUnknown_085B91B8 - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0xD5 - beq _08145DB8 - adds r1, r4, 0 -_08145D60: - lsls r0, r2, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, r3 - bhi _08145DB8 - cmp r0, r3 - beq _08145D7E - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - lsls r0, r2, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0xD5 - bne _08145D60 -_08145D7E: - lsls r0, r2, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0xD5 - bne _08145D98 - b _08145DB8 - .pool -_08145D90: - adds r0, r4, 0x4 - adds r0, r1, r0 - ldr r0, [r0] - b _08145DBA -_08145D98: - cmp r0, r3 - bne _08145DB8 - ldr r5, =gUnknown_085B91B8 -_08145D9E: - lsls r1, r2, 3 - adds r0, r1, r5 - ldrb r0, [r0, 0x1] - cmp r0, r6 - beq _08145D90 - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - lsls r0, r2, 3 - adds r0, r4 - ldrb r0, [r0] - cmp r0, r3 - beq _08145D9E -_08145DB8: - movs r0, 0 -_08145DBA: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8145D48 - - thumb_func_start hm_prepare_rocksmash -hm_prepare_rocksmash: @ 8145DC4 - push {r4,lr} - movs r0, 0x57 - bl npc_before_player_of_type - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08145DD8 - movs r0, 0 - b _08145DF2 -_08145DD8: - ldr r4, =0x020375f0 - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - ldr r1, =0x03005db0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =0x0203ceec - ldr r0, =sub_8145E0C - str r0, [r1] - movs r0, 0x1 -_08145DF2: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end hm_prepare_rocksmash - - thumb_func_start sub_8145E0C -sub_8145E0C: @ 8145E0C - push {lr} - bl brm_get_pokemon_selection - ldr r1, =0x02038c08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - ldr r0, =gUnknown_082908FD - bl script_env_1_execute_new_script - pop {r0} - bx r0 - .pool - thumb_func_end sub_8145E0C - - thumb_func_start sub_8145E2C -sub_8145E2C: @ 8145E2C - push {lr} - bl oei_task_add - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =sub_8145E74 - lsrs r0, r2, 16 - strh r0, [r1, 0x18] - strh r2, [r1, 0x1A] - ldr r0, =0x02038c08 - ldr r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02021cc4 - bl GetMonNickname - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8145E2C - - thumb_func_start sub_8145E74 -sub_8145E74: @ 8145E74 - push {lr} - movs r0, 0x28 - bl FieldEffectActiveListRemove - bl script_env_2_enable_and_set_ctx_running - pop {r0} - bx r0 - thumb_func_end sub_8145E74 - - thumb_func_start sub_8145E84 -sub_8145E84: @ 8145E84 - push {r4,lr} - ldr r4, =0x0300120b - ldrb r0, [r4] - cmp r0, 0 - beq _08145E98 - cmp r0, 0x1 - beq _08145EAC - b _08145EC0 - .pool -_08145E98: - ldr r0, =0x0300120a - ldrb r0, [r0] - bl sub_8145F6C - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _08145EC0 - .pool -_08145EAC: - bl sub_8145F20 - lsls r0, 24 - cmp r0, 0 - beq _08145EC0 - movs r0, 0 - strb r0, [r4] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 -_08145EC0: - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8145E84 - - thumb_func_start sub_8145EDC -sub_8145EDC: @ 8145EDC - push {lr} - ldr r1, =0x0300120a - strb r0, [r1] - ldr r0, =sub_8145E84 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8145EDC - - thumb_func_start sub_8145EF4 -sub_8145EF4: @ 8145EF4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x030022c0 - ldr r1, =sub_8085E50 - str r1, [r2, 0x4] - bl sub_8145F6C - pop {r0} - bx r0 - .pool - thumb_func_end sub_8145EF4 - - thumb_func_start sub_8145F10 -sub_8145F10: @ 8145F10 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_8145F6C - pop {r0} - bx r0 - thumb_func_end sub_8145F10 - - thumb_func_start sub_8145F20 -sub_8145F20: @ 8145F20 - push {r4,lr} - ldr r0, =sub_8145FA8 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r1, 0x26 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08145F4C - movs r0, 0 - b _08145F60 - .pool -_08145F4C: - adds r0, r2, 0 - bl DestroyTask - ldr r4, =0x0203aba0 - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - movs r0, 0x1 -_08145F60: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8145F20 - - thumb_func_start sub_8145F6C -sub_8145F6C: @ 8145F6C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =sub_8145FA8 - movs r1, 0x2 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0xA] - ldr r4, =0x0203aba0 - movs r0, 0x3C - bl AllocZeroed - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8145F6C - - thumb_func_start sub_8145FA8 -sub_8145FA8: @ 8145FA8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8A98 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_08145FBA: - 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 _08145FBA - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8145FA8 - - thumb_func_start sub_8145FE0 -sub_8145FE0: @ 8145FE0 - push {r4,lr} - adds r4, r0, 0 - bl sub_80AC3D0 - ldr r0, =0x02037b14 - ldr r1, =0x02037714 - ldr r2, =0x04000100 - bl CpuSet - ldr r1, =gUnknown_085C8948 - movs r2, 0xA - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - bne _0814601C - movs r0, 0x2 - strh r0, [r4, 0x8] - movs r0, 0x1 - b _0814602A - .pool -_0814601C: - movs r1, 0x4 - bl CreateTask - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 -_0814602A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8145FE0 - - thumb_func_start sub_8146030 -sub_8146030: @ 8146030 - push {r4,lr} - adds r4, r0, 0 - ldr r1, =gUnknown_085C8948 - movs r2, 0xA - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _08146054 - movs r0, 0 - b _0814605C - .pool -_08146054: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x1 -_0814605C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8146030 - - thumb_func_start sub_8146064 -sub_8146064: @ 8146064 - push {r4,lr} - adds r4, r0, 0 - ldr r1, =gUnknown_085C89F0 - movs r2, 0xA - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0 - bl CreateTask - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8146064 - - thumb_func_start sub_814608C -sub_814608C: @ 814608C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0 - strh r0, [r4, 0x26] - ldr r1, =gUnknown_085C89F0 - movs r2, 0xA - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _081460B0 - movs r0, 0x1 - strh r0, [r4, 0x26] -_081460B0: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814608C - - thumb_func_start sub_81460BC -sub_81460BC: @ 81460BC - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - ldr r1, =0x03005e00 - 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 _081460F4 - 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_8149D78 - b _08146104 - .pool -_081460F4: - bl sub_8149DDC - lsls r0, 24 - cmp r0, 0 - beq _08146104 - adds r0, r4, 0 - bl DestroyTask -_08146104: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81460BC - - thumb_func_start sub_814610C -sub_814610C: @ 814610C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8AA8 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0814611E: - 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 _0814611E - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814610C - - thumb_func_start sub_8146144 -sub_8146144: @ 8146144 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - movs r0, 0xA - movs r1, 0x40 - bl SetGpuRegBits - movs r0, 0xC - movs r1, 0x40 - bl SetGpuRegBits - movs r0, 0xE - movs r1, 0x40 - bl SetGpuRegBits - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8146144 - - thumb_func_start sub_8146178 -sub_8146178: @ 8146178 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldrh r0, [r4, 0xA] - movs r1, 0xA - ldrsh r2, [r4, r1] - cmp r2, 0 - beq _0814618E - subs r0, 0x1 - strh r0, [r4, 0xA] - b _081461CE -_0814618E: - movs r0, 0x4 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bne _081461B0 - movs r1, 0x1 - negs r1, r1 - str r2, [sp] - adds r0, r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe -_081461B0: - ldrh r1, [r4, 0xC] - movs r0, 0xF - ands r0, r1 - lsls r1, r0, 4 - orrs r1, r0 - movs r0, 0x4C - bl SetGpuReg - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0xE - ble _081461CE - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_081461CE: - movs r0, 0 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8146178 - - thumb_func_start sub_81461D8 -sub_81461D8: @ 81461D8 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081461F4 - ldr r0, =sub_814610C - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_081461F4: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81461D8 - - thumb_func_start sub_8146204 -sub_8146204: @ 8146204 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8AB4 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_08146216: - 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 _08146216 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8146204 - - thumb_func_start sub_814623C -sub_814623C: @ 814623C - push {r4,r5,lr} - sub sp, 0x8 - adds r5, r0, 0 - bl sub_8149F08 - bl dp12_8087EA4 - movs r0, 0x1 - negs r0, r0 - movs r4, 0 - str r4, [sp] - movs r1, 0x4 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x020393a8 - ldr r1, =0x0203aba0 - ldr r1, [r1] - movs r2, 0x14 - ldrsh r1, [r1, r2] - str r4, [sp] - movs r2, 0xA0 - str r2, [sp, 0x4] - movs r2, 0 - movs r3, 0x2 - bl sub_8149F98 - ldr r0, =sub_8146320 - bl SetVBlankCallback - ldr r0, =sub_8146358 - bl SetHBlankCallback - movs r0, 0x3 - bl EnableInterrupts - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814623C - - thumb_func_start sub_81462A8 -sub_81462A8: @ 81462A8 - push {r4,r5,lr} - sub sp, 0x8 - ldr r4, =0x0203aba0 - ldr r2, [r4] - ldrb r1, [r2] - movs r1, 0 - strb r1, [r2] - ldrh r1, [r0, 0xA] - adds r1, 0x4 - strh r1, [r0, 0xA] - ldrh r1, [r0, 0xC] - adds r1, 0x8 - strh r1, [r0, 0xC] - ldr r3, =0x02038c28 - ldr r1, [r4] - movs r2, 0x14 - ldrsh r1, [r1, r2] - movs r5, 0xA - ldrsh r2, [r0, r5] - movs r5, 0xC - ldrsh r0, [r0, r5] - str r0, [sp] - movs r0, 0xA0 - str r0, [sp, 0x4] - adds r0, r3, 0 - movs r3, 0x2 - bl sub_8149F98 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081462FA - ldr r0, =sub_8146204 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_081462FA: - ldr r0, [r4] - ldrb r1, [r0] - adds r1, 0x1 - ldrb r2, [r0] - strb r1, [r0] - movs r0, 0 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81462A8 - - thumb_func_start sub_8146320 -sub_8146320: @ 8146320 - push {lr} - bl sub_8149F2C - ldr r0, =0x0203aba0 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0 - beq _08146344 - ldr r1, =0x040000d4 - ldr r0, =0x02038c28 - str r0, [r1] - movs r2, 0xF0 - lsls r2, 3 - adds r0, r2 - str r0, [r1, 0x4] - ldr r0, =0x800000a0 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] -_08146344: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8146320 - - thumb_func_start sub_8146358 -sub_8146358: @ 8146358 - ldr r1, =0x02038c28 - ldr r0, =0x04000006 - ldrh r0, [r0] - lsls r0, 1 - movs r2, 0xF0 - lsls r2, 3 - adds r1, r2 - adds r0, r1 - ldrh r1, [r0] - ldr r0, =0x04000014 - strh r1, [r0] - adds r0, 0x4 - strh r1, [r0] - adds r0, 0x4 - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_8146358 - - thumb_func_start sub_8146384 -sub_8146384: @ 8146384 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8ABC - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_08146396: - 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 _08146396 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8146384 - - thumb_func_start sub_81463BC -sub_81463BC: @ 81463BC - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - bl sub_8149F08 - bl dp12_8087EA4 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r1, 0x4 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x0203aba0 - ldr r1, [r0] - ldr r0, =0x020393a8 - movs r2, 0x16 - ldrsh r1, [r1, r2] - movs r2, 0xA0 - lsls r2, 1 - bl memset - ldr r0, =sub_81464B0 - bl SetVBlankCallback - ldr r0, =sub_81464E8 - bl SetHBlankCallback - movs r0, 0x3 - bl EnableInterrupts - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81463BC - - thumb_func_start sub_8146420 -sub_8146420: @ 8146420 - push {r4-r7,lr} - ldr r1, =0x0203aba0 - ldr r2, [r1] - ldrb r1, [r2] - movs r1, 0 - strb r1, [r2] - ldrh r4, [r0, 0xA] - ldrh r2, [r0, 0xC] - lsls r3, r2, 16 - asrs r3, 24 - movs r5, 0x84 - lsls r5, 5 - adds r1, r4, r5 - strh r1, [r0, 0xA] - movs r1, 0xC0 - lsls r1, 1 - adds r2, r1 - strh r2, [r0, 0xC] - movs r5, 0 - lsls r7, r3, 16 -_08146448: - lsrs r0, r4, 8 - asrs r1, r7, 16 - bl sine - ldr r1, =0x02038c28 - lsls r2, r5, 1 - adds r2, r1 - ldr r6, =0x0203aba0 - ldr r1, [r6] - ldrh r1, [r1, 0x16] - adds r0, r1 - strh r0, [r2] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - movs r1, 0x84 - lsls r1, 5 - adds r0, r4, r1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r5, 0x9F - bls _08146448 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0814648E - ldr r0, =sub_8146384 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_0814648E: - ldr r0, [r6] - ldrb r1, [r0] - adds r1, 0x1 - ldrb r2, [r0] - strb r1, [r0] - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8146420 - - thumb_func_start sub_81464B0 -sub_81464B0: @ 81464B0 - push {lr} - bl sub_8149F2C - ldr r0, =0x0203aba0 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0 - beq _081464D4 - ldr r1, =0x040000d4 - ldr r0, =0x02038c28 - str r0, [r1] - movs r2, 0xF0 - lsls r2, 3 - adds r0, r2 - str r0, [r1, 0x4] - ldr r0, =0x800000a0 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] -_081464D4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81464B0 - - thumb_func_start sub_81464E8 -sub_81464E8: @ 81464E8 - ldr r1, =0x02038c28 - ldr r0, =0x04000006 - ldrh r0, [r0] - lsls r0, 1 - movs r2, 0xF0 - lsls r2, 3 - adds r1, r2 - adds r0, r1 - ldrh r1, [r0] - ldr r0, =0x04000016 - strh r1, [r0] - adds r0, 0x4 - strh r1, [r0] - adds r0, 0x4 - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_81464E8 - - thumb_func_start sub_8146514 -sub_8146514: @ 8146514 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8AFC - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_08146526: - 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 _08146526 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8146514 - - thumb_func_start sub_814654C -sub_814654C: @ 814654C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8AC4 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0814655E: - 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 _0814655E - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814654C - - thumb_func_start sub_8146584 -sub_8146584: @ 8146584 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8AE0 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_08146596: - 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 _08146596 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8146584 - - thumb_func_start sub_81465BC -sub_81465BC: @ 81465BC - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8B14 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_081465CE: - 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 _081465CE - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81465BC - - thumb_func_start sub_81465F4 -sub_81465F4: @ 81465F4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8B2C - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_08146606: - 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 _08146606 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81465F4 - - thumb_func_start sub_814662C -sub_814662C: @ 814662C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8B44 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0814663E: - 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 _0814663E - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814662C - - thumb_func_start sub_8146664 -sub_8146664: @ 8146664 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8B5C - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_08146676: - 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 _08146676 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8146664 - - thumb_func_start sub_814669C -sub_814669C: @ 814669C - push {r4,lr} - adds r4, r0, 0 - bl sub_8149F08 - bl dp12_8087EA4 - movs r1, 0 - movs r0, 0x10 - strh r0, [r4, 0xA] - strh r1, [r4, 0xC] - strh r1, [r4, 0x10] - movs r0, 0x80 - lsls r0, 7 - strh r0, [r4, 0x12] - ldr r0, =0x0203aba0 - ldr r2, [r0] - movs r0, 0x3F - strh r0, [r2, 0x2] - strh r1, [r2, 0x4] - movs r0, 0xF0 - strh r0, [r2, 0x6] - movs r0, 0xA0 - strh r0, [r2, 0x8] - ldr r0, =0x00003f41 - strh r0, [r2, 0xE] - ldrh r0, [r4, 0xA] - lsls r0, 8 - ldrh r1, [r4, 0xC] - orrs r0, r1 - strh r0, [r2, 0x10] - ldr r0, =0x02038c28 - movs r2, 0xF0 - movs r1, 0x9F - ldr r3, =0x000008be - adds r0, r3 -_081466E2: - strh r2, [r0] - subs r0, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _081466E2 - ldr r0, =sub_8146F3C - bl SetVBlankCallback - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814669C - - thumb_func_start sub_814670C -sub_814670C: @ 814670C - push {r4,r5,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r5, 0 - movs r0, 0x3C - strh r0, [r4, 0x18] - adds r0, r4, 0 - bl sub_814669C - add r0, sp, 0x4 - add r1, sp, 0x8 - bl sub_8149F58 - mov r0, sp - strh r5, [r0] - ldr r1, [sp, 0x4] - ldr r2, =0x01000400 - bl CpuSet - ldr r0, =gUnknown_085BAED0 - ldr r1, [sp, 0x8] - bl LZ77UnCompVram - ldr r0, =gUnknown_085BAEB0 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814670C - - thumb_func_start sub_8146760 -sub_8146760: @ 8146760 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r5, 0 - movs r0, 0x3C - strh r0, [r4, 0x18] - adds r0, r4, 0 - bl sub_814669C - add r0, sp, 0x4 - add r1, sp, 0x8 - bl sub_8149F58 - mov r0, sp - strh r5, [r0] - ldr r1, [sp, 0x4] - ldr r2, =0x01000400 - bl CpuSet - ldr r0, =gUnknown_085BB4A4 - ldr r1, [sp, 0x8] - bl LZ77UnCompVram - ldr r0, =gUnknown_085BAEB0 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8146760 - - thumb_func_start sub_81467B4 -sub_81467B4: @ 81467B4 - push {r4,r5,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r5, 0 - movs r0, 0x3C - strh r0, [r4, 0x18] - adds r0, r4, 0 - bl sub_814669C - add r0, sp, 0x4 - add r1, sp, 0x8 - bl sub_8149F58 - mov r0, sp - strh r5, [r0] - ldr r1, [sp, 0x4] - ldr r2, =0x01000400 - bl CpuSet - ldr r0, =gUnknown_085BBC14 - ldr r1, [sp, 0x8] - movs r2, 0x80 - lsls r2, 5 - bl CpuSet - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81467B4 - - thumb_func_start sub_8146800 -sub_8146800: @ 8146800 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - bl sub_814669C - add r0, sp, 0x4 - add r1, sp, 0x8 - bl sub_8149F58 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, [sp, 0x4] - ldr r2, =0x01000400 - mov r0, sp - bl CpuSet - ldr r0, =gUnknown_085B9330 - ldr r1, [sp, 0x8] - movs r2, 0xB0 - lsls r2, 2 - bl CpuSet - ldr r0, =gFieldEffectObjectPalette10 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8146800 - - thumb_func_start sub_8146854 -sub_8146854: @ 8146854 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - adds r7, r0, 0 - add r1, sp, 0xC - add r0, sp, 0x8 - bl sub_8149F58 - ldr r5, =gUnknown_085C9020 - movs r1, 0 - ldr r0, [sp, 0x8] - mov r9, r0 - ldr r6, =0x02038c28 - mov r8, r6 - movs r0, 0xF0 - lsls r0, 8 - mov r12, r0 -_0814687A: - movs r0, 0 - lsls r3, r1, 16 - asrs r4, r3, 11 -_08146880: - lsls r2, r0, 16 - asrs r2, 16 - adds r1, r4, r2 - lsls r1, 1 - add r1, r9 - ldrh r0, [r5] - mov r6, r12 - orrs r0, r6 - strh r0, [r1] - adds r2, 0x1 - lsls r2, 16 - adds r5, 0x2 - lsrs r0, r2, 16 - asrs r2, 16 - cmp r2, 0x1D - ble _08146880 - movs r1, 0x80 - lsls r1, 9 - adds r0, r3, r1 - lsrs r1, r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _0814687A - movs r6, 0x10 - ldrsh r2, [r7, r6] - movs r1, 0x12 - ldrsh r0, [r7, r1] - str r0, [sp] - movs r0, 0xA0 - str r0, [sp, 0x4] - mov r0, r8 - movs r1, 0 - movs r3, 0x84 - bl sub_8149F98 - ldrh r0, [r7, 0x8] - adds r0, 0x1 - strh r0, [r7, 0x8] - movs r0, 0x1 - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8146854 - - thumb_func_start sub_81468E4 -sub_81468E4: @ 81468E4 - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - add r1, sp, 0xC - add r0, sp, 0x8 - bl sub_8149F58 - ldr r0, =gUnknown_085BB248 - ldr r1, [sp, 0x8] - bl LZ77UnCompVram - ldr r0, =0x02038c28 - movs r1, 0x10 - ldrsh r2, [r4, r1] - movs r3, 0x12 - ldrsh r1, [r4, r3] - str r1, [sp] - movs r1, 0xA0 - str r1, [sp, 0x4] - movs r1, 0 - movs r3, 0x84 - bl sub_8149F98 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - add sp, 0x10 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81468E4 - - thumb_func_start sub_814692C -sub_814692C: @ 814692C - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - add r1, sp, 0xC - add r0, sp, 0x8 - bl sub_8149F58 - ldr r0, =gUnknown_085BB930 - ldr r1, [sp, 0x8] - bl LZ77UnCompVram - ldr r0, =0x02038c28 - movs r1, 0x10 - ldrsh r2, [r4, r1] - movs r3, 0x12 - ldrsh r1, [r4, r3] - str r1, [sp] - movs r1, 0xA0 - str r1, [sp, 0x4] - movs r1, 0 - movs r3, 0x84 - bl sub_8149F98 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - add sp, 0x10 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814692C - - thumb_func_start sub_8146974 -sub_8146974: @ 8146974 - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - add r1, sp, 0xC - add r0, sp, 0x8 - bl sub_8149F58 - ldr r0, =gUnknown_085BC2B4 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_085BC314 - ldr r1, [sp, 0x8] - movs r2, 0xA0 - lsls r2, 2 - bl CpuSet - ldr r0, =0x02038c28 - movs r1, 0x10 - ldrsh r2, [r4, r1] - movs r3, 0x12 - ldrsh r1, [r4, r3] - str r1, [sp] - movs r1, 0xA0 - str r1, [sp, 0x4] - movs r1, 0 - movs r3, 0x84 - bl sub_8149F98 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - add sp, 0x10 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8146974 - - thumb_func_start sub_81469CC -sub_81469CC: @ 81469CC - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - add r1, sp, 0xC - add r0, sp, 0x8 - bl sub_8149F58 - ldr r0, =gUnknown_085BC2D4 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_085BCB14 - ldr r1, [sp, 0x8] - movs r2, 0xA0 - lsls r2, 2 - bl CpuSet - ldr r0, =0x02038c28 - movs r1, 0x10 - ldrsh r2, [r4, r1] - movs r3, 0x12 - ldrsh r1, [r4, r3] - str r1, [sp] - movs r1, 0xA0 - str r1, [sp, 0x4] - movs r1, 0 - movs r3, 0x84 - bl sub_8149F98 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - add sp, 0x10 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81469CC - - thumb_func_start sub_8146A24 -sub_8146A24: @ 8146A24 - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - add r1, sp, 0xC - add r0, sp, 0x8 - bl sub_8149F58 - ldr r0, =gUnknown_085BC2F4 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_085BD314 - ldr r1, [sp, 0x8] - movs r2, 0xA0 - lsls r2, 2 - bl CpuSet - ldr r0, =0x02038c28 - movs r1, 0x10 - ldrsh r2, [r4, r1] - movs r3, 0x12 - ldrsh r1, [r4, r3] - str r1, [sp] - movs r1, 0xA0 - str r1, [sp, 0x4] - movs r1, 0 - movs r3, 0x84 - bl sub_8149F98 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - add sp, 0x10 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8146A24 - - thumb_func_start sub_8146A7C -sub_8146A7C: @ 8146A7C - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - add r0, sp, 0x4 - add r1, sp, 0x8 - bl sub_8149F58 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, [sp, 0x4] - ldr r2, =0x01000400 - mov r0, sp - bl CpuSet - ldr r0, =gUnknown_085BDB34 - ldr r1, [sp, 0x8] - bl LZ77UnCompVram - ldr r0, =gUnknown_085BE1E8 - ldr r1, [sp, 0x4] - bl LZ77UnCompVram - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8146A7C - - thumb_func_start sub_8146AC8 -sub_8146AC8: @ 8146AC8 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xA - ldrsh r5, [r4, r0] - adds r0, r5, 0 - movs r1, 0x3 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _08146B00 - adds r0, r5, 0 - movs r1, 0x1E - bl __modsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __udivsi3 - lsls r0, 16 - lsrs r0, 11 - ldr r1, =gUnknown_085BEDA0 - adds r0, r1 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply -_08146B00: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3A - ble _08146B18 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - strh r0, [r4, 0xA] -_08146B18: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8146AC8 - - thumb_func_start sub_8146B24 -sub_8146B24: @ 8146B24 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xA - ldrsh r5, [r4, r0] - adds r0, r5, 0 - movs r1, 0x5 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _08146B52 - adds r0, r5, 0 - movs r1, 0x5 - bl __divsi3 - lsls r0, 16 - asrs r0, 11 - ldr r1, =gUnknown_085BEEE0 - adds r0, r1 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply -_08146B52: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x44 - ble _08146B6E - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - strh r0, [r4, 0xA] - movs r0, 0x1E - strh r0, [r4, 0x18] -_08146B6E: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8146B24 - - thumb_func_start sub_8146B7C -sub_8146B7C: @ 8146B7C - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldr r0, =0xffff8000 - movs r1, 0 - str r1, [sp] - movs r1, 0x1 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8146B7C - - thumb_func_start sub_8146BA8 -sub_8146BA8: @ 8146BA8 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08146BDE - ldr r1, =0x040000b0 - ldrh r2, [r1, 0xA] - ldr r0, =0x0000c5ff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r2, [r1, 0xA] - ldr r0, =0x00007fff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r0, [r1, 0xA] - bl sub_8149F84 - ldr r0, [r4] - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_08146BDE: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8146BA8 - - thumb_func_start sub_8146BF8 -sub_8146BF8: @ 8146BF8 - push {r4,r5,lr} - sub sp, 0x8 - adds r3, r0, 0 - ldr r2, =0x0203aba0 - ldr r1, [r2] - ldrb r0, [r1] - movs r0, 0 - strb r0, [r1] - ldrh r1, [r3, 0xE] - movs r4, 0xE - ldrsh r0, [r3, r4] - adds r4, r2, 0 - cmp r0, 0 - beq _08146C1E - subs r0, r1, 0x1 - strh r0, [r3, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _08146C28 -_08146C1E: - ldrh r0, [r3, 0xC] - adds r0, 0x1 - strh r0, [r3, 0xC] - movs r0, 0x2 - strh r0, [r3, 0xE] -_08146C28: - ldr r2, [r4] - ldrh r0, [r3, 0xA] - lsls r0, 8 - ldrh r1, [r3, 0xC] - orrs r0, r1 - strh r0, [r2, 0x10] - movs r5, 0xC - ldrsh r0, [r3, r5] - cmp r0, 0xF - ble _08146C42 - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] -_08146C42: - ldrh r0, [r3, 0x10] - adds r0, 0x8 - strh r0, [r3, 0x10] - ldr r0, =0xffffff00 - adds r1, r0, 0 - ldrh r5, [r3, 0x12] - adds r1, r5 - strh r1, [r3, 0x12] - ldr r0, =0x02038c28 - movs r5, 0x10 - ldrsh r2, [r3, r5] - lsls r1, 16 - asrs r1, 24 - str r1, [sp] - movs r1, 0xA0 - str r1, [sp, 0x4] - movs r1, 0 - movs r3, 0x84 - bl sub_8149F98 - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - ldrb r2, [r1] - strb r0, [r1] - movs r0, 0 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8146BF8 - - thumb_func_start sub_8146C8C -sub_8146C8C: @ 8146C8C - push {r4,r5,lr} - sub sp, 0x8 - adds r3, r0, 0 - ldr r2, =0x0203aba0 - ldr r1, [r2] - ldrb r0, [r1] - movs r0, 0 - strb r0, [r1] - ldrh r1, [r3, 0xE] - movs r4, 0xE - ldrsh r0, [r3, r4] - adds r4, r2, 0 - cmp r0, 0 - beq _08146CB2 - subs r0, r1, 0x1 - strh r0, [r3, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _08146CBC -_08146CB2: - ldrh r0, [r3, 0xA] - subs r0, 0x1 - strh r0, [r3, 0xA] - movs r0, 0x2 - strh r0, [r3, 0xE] -_08146CBC: - ldr r2, [r4] - ldrh r0, [r3, 0xA] - lsls r0, 8 - ldrh r1, [r3, 0xC] - orrs r0, r1 - strh r0, [r2, 0x10] - movs r5, 0xA - ldrsh r0, [r3, r5] - cmp r0, 0 - bne _08146CD6 - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] -_08146CD6: - ldrh r0, [r3, 0x10] - adds r0, 0x8 - strh r0, [r3, 0x10] - ldr r0, =0xffffff00 - adds r1, r0, 0 - ldrh r5, [r3, 0x12] - adds r1, r5 - strh r1, [r3, 0x12] - ldr r0, =0x02038c28 - movs r5, 0x10 - ldrsh r2, [r3, r5] - lsls r1, 16 - asrs r1, 24 - str r1, [sp] - movs r1, 0xA0 - str r1, [sp, 0x4] - movs r1, 0 - movs r3, 0x84 - bl sub_8149F98 - ldr r1, [r4] - ldrb r0, [r1] - adds r0, 0x1 - ldrb r2, [r1] - strb r0, [r1] - movs r0, 0 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8146C8C - - thumb_func_start sub_8146D20 -sub_8146D20: @ 8146D20 - push {r4-r7,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r7, =0x0203aba0 - ldr r0, [r7] - ldrb r1, [r0] - movs r6, 0 - strb r6, [r0] - ldrh r0, [r4, 0x10] - adds r0, 0x8 - strh r0, [r4, 0x10] - ldr r0, =0xffffff00 - adds r1, r0, 0 - ldrh r3, [r4, 0x12] - adds r1, r3 - strh r1, [r4, 0x12] - ldr r0, =0x02038c28 - movs r3, 0x10 - ldrsh r2, [r4, r3] - lsls r1, 16 - asrs r1, 24 - str r1, [sp] - movs r5, 0xA0 - str r5, [sp, 0x4] - movs r1, 0 - movs r3, 0x84 - bl sub_8149F98 - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0 - bgt _08146D70 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - strh r5, [r4, 0xA] - movs r0, 0x80 - lsls r0, 1 - strh r0, [r4, 0xC] - strh r6, [r4, 0xE] -_08146D70: - ldr r0, [r7] - ldrb r1, [r0] - adds r1, 0x1 - ldrb r2, [r0] - strb r1, [r0] - movs r0, 0 - add sp, 0x8 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8146D20 - - thumb_func_start sub_8146D90 -sub_8146D90: @ 8146D90 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x18] - subs r0, 0x1 - strh r0, [r1, 0x18] - lsls r0, 16 - cmp r0, 0 - bne _08146DA6 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_08146DA6: - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_8146D90 - - thumb_func_start sub_8146DAC -sub_8146DAC: @ 8146DAC - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldr r0, =0x0000ffff - movs r1, 0 - str r1, [sp] - movs r1, 0x1 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8146DAC - - thumb_func_start sub_8146DD8 -sub_8146DD8: @ 8146DD8 - push {lr} - adds r2, r0, 0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08146DEE - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] -_08146DEE: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8146DD8 - - thumb_func_start sub_8146DF8 -sub_8146DF8: @ 8146DF8 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0203aba0 - ldr r0, [r0] - ldrb r1, [r0] - movs r3, 0 - strb r3, [r0] - ldrh r2, [r4, 0xC] - movs r0, 0xC - ldrsh r1, [r4, r0] - ldr r0, =0x000003ff - cmp r1, r0 - bgt _08146E18 - adds r0, r2, 0 - adds r0, 0x80 - strh r0, [r4, 0xC] -_08146E18: - ldrh r1, [r4, 0xA] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08146E34 - ldrh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 24 - subs r0, r1, r0 - strh r0, [r4, 0xA] - lsls r0, 16 - cmp r0, 0 - bge _08146E34 - strh r3, [r4, 0xA] -_08146E34: - ldr r0, =0x02038c28 - movs r1, 0xA - ldrsh r3, [r4, r1] - movs r1, 0x78 - movs r2, 0x50 - bl sub_814A014 - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _08146E90 - movs r0, 0 - bl SetVBlankCallback - ldr r1, =0x040000b0 - ldrh r2, [r1, 0xA] - ldr r0, =0x0000c5ff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r2, [r1, 0xA] - ldr r0, =0x00007fff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r0, [r1, 0xA] - bl sub_8149F84 - ldr r0, [r4] - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - b _08146EB0 - .pool -_08146E90: - ldrh r1, [r4, 0xE] - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _08146EA4 - adds r0, r1, 0x1 - strh r0, [r4, 0xE] - ldr r0, =sub_8146F68 - bl SetVBlankCallback -_08146EA4: - ldr r0, =0x0203aba0 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - ldrb r2, [r1] - strb r0, [r1] -_08146EB0: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8146DF8 - - thumb_func_start sub_8146EC0 -sub_8146EC0: @ 8146EC0 - push {lr} - ldr r1, =0x040000b0 - ldrh r2, [r1, 0xA] - ldr r0, =0x0000c5ff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r2, [r1, 0xA] - ldr r0, =0x00007fff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r0, [r1, 0xA] - bl sub_8149F2C - ldr r2, =0x0203aba0 - ldr r0, [r2] - ldrb r0, [r0] - cmp r0, 0 - beq _08146EF8 - ldr r1, =0x040000d4 - ldr r0, =0x02038c28 - str r0, [r1] - movs r3, 0xF0 - lsls r3, 3 - adds r0, r3 - str r0, [r1, 0x4] - ldr r0, =0x800000a0 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] -_08146EF8: - ldr r1, =0x04000048 - ldr r2, [r2] - ldrh r0, [r2, 0x2] - strh r0, [r1] - adds r1, 0x2 - ldrh r0, [r2, 0x4] - strh r0, [r1] - subs r1, 0x6 - ldrh r0, [r2, 0x8] - strh r0, [r1] - adds r1, 0xC - ldrh r0, [r2, 0xE] - strh r0, [r1] - adds r1, 0x2 - ldrh r0, [r2, 0x10] - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8146EC0 - - thumb_func_start sub_8146F3C -sub_8146F3C: @ 8146F3C - push {lr} - bl sub_8146EC0 - ldr r1, =0x040000b0 - ldr r0, =0x020393a8 - str r0, [r1] - ldr r0, =0x04000010 - str r0, [r1, 0x4] - ldr r0, =0xa2400001 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8146F3C - - thumb_func_start sub_8146F68 -sub_8146F68: @ 8146F68 - push {lr} - bl sub_8146EC0 - ldr r1, =0x040000b0 - ldr r0, =0x020393a8 - str r0, [r1] - ldr r0, =0x04000040 - str r0, [r1, 0x4] - ldr r0, =0xa2400001 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8146F68 - - thumb_func_start sub_8146F94 -sub_8146F94: @ 8146F94 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8B7C - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_08146FA6: - 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 _08146FA6 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8146F94 - - thumb_func_start sub_8146FCC -sub_8146FCC: @ 8146FCC - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - add r0, sp, 0x4 - add r1, sp, 0x8 - bl sub_8149F58 - ldr r0, =gUnknown_085B98B0 - ldr r1, [sp, 0x8] - movs r2, 0x20 - bl CpuSet - movs r0, 0 - str r0, [sp] - ldr r1, [sp, 0x4] - ldr r2, =0x05000200 - mov r0, sp - bl CpuSet - ldr r0, =gFieldEffectObjectPalette10 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8146FCC - - thumb_func_start sub_8147018 -sub_8147018: @ 8147018 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - adds r7, r0, 0 - ldr r1, =gUnknown_085C8B88 - mov r0, sp - movs r2, 0x4 - bl memcpy - add r4, sp, 0x4 - ldr r1, =gUnknown_085C8B8C - adds r0, r4, 0 - movs r2, 0xA - bl memcpy - bl GenerateRandomNumber - movs r5, 0x1 - ands r5, r0 - movs r1, 0 - mov r8, r4 - ldr r6, =0x02038c08 -_08147046: - lsls r5, 16 - asrs r5, 16 - lsls r0, r5, 1 - add r0, sp - movs r2, 0 - ldrsh r0, [r0, r2] - str r0, [r6] - lsls r4, r1, 16 - asrs r4, 16 - lsls r0, r4, 5 - adds r0, 0x10 - str r0, [r6, 0x4] - str r5, [r6, 0x8] - lsls r0, r4, 1 - add r0, r8 - movs r1, 0 - ldrsh r0, [r0, r1] - str r0, [r6, 0xC] - movs r0, 0x2D - bl FieldEffectStart - adds r4, 0x1 - lsls r4, 16 - movs r0, 0x1 - eors r5, r0 - lsls r5, 16 - lsrs r5, 16 - lsrs r1, r4, 16 - asrs r4, 16 - cmp r4, 0x4 - ble _08147046 - ldrh r0, [r7, 0x8] - adds r0, 0x1 - strh r0, [r7, 0x8] - movs r0, 0 - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8147018 - - thumb_func_start sub_81470A4 -sub_81470A4: @ 81470A4 - push {lr} - movs r0, 0x2D - bl FieldEffectActiveListContains - lsls r0, 24 - cmp r0, 0 - bne _081470C4 - bl sub_8149F84 - ldr r0, =sub_8146F94 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_081470C4: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81470A4 - - thumb_func_start sub_81470D0 -sub_81470D0: @ 81470D0 - push {r4,r5,lr} - ldr r0, =gUnknown_085C8E68 - ldr r5, =0x02038c08 - movs r2, 0 - ldrsh r1, [r5, r2] - movs r3, 0x4 - ldrsh r2, [r5, r3] - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02020630 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - adds r4, r1 - ldrb r1, [r4, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x5] - ldrb r1, [r4, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r4, 0x1] - ldr r0, [r5, 0x8] - strh r0, [r4, 0x2E] - ldr r0, [r5, 0xC] - strh r0, [r4, 0x30] - ldr r0, =0x0000ffff - strh r0, [r4, 0x32] - adds r0, r4, 0 - bl obj_alloc_rotscale_entry - ldrb r1, [r5, 0x8] - adds r0, r4, 0 - bl StartObjectRotScalAnim - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81470D0 - - thumb_func_start sub_814713C -sub_814713C: @ 814713C - push {r4-r6,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldr r1, =gUnknown_085C8B96 - mov r0, sp - movs r2, 0x4 - bl memcpy - ldrh r1, [r4, 0x30] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08147160 - subs r0, r1, 0x1 - strh r0, [r4, 0x30] - b _081471F2 - .pool -_08147160: - ldrh r0, [r4, 0x20] - lsls r1, r0, 16 - lsrs r0, r1, 16 - cmp r0, 0xF0 - bhi _081471CE - asrs r0, r1, 19 - lsls r0, 16 - ldrh r1, [r4, 0x22] - lsls r1, 16 - asrs r1, 19 - lsls r1, 16 - lsrs r1, 16 - lsrs r2, r0, 16 - asrs r5, r0, 16 - movs r3, 0x32 - ldrsh r0, [r4, r3] - cmp r5, r0 - beq _081471CE - strh r2, [r4, 0x32] - ldr r0, =0x04000008 - ldrh r2, [r0] - lsrs r2, 8 - movs r0, 0x1F - ands r2, r0 - lsls r2, 11 - movs r0, 0xC0 - lsls r0, 19 - adds r2, r0 - lsls r1, 16 - asrs r1, 16 - subs r0, r1, 0x2 - lsls r0, 5 - adds r0, r5 - lsls r0, 1 - adds r0, r2 - ldr r6, =0x0000f001 - adds r3, r6, 0 - strh r3, [r0] - subs r0, r1, 0x1 - lsls r0, 5 - adds r0, r5 - lsls r0, 1 - adds r0, r2 - strh r3, [r0] - lsls r0, r1, 5 - adds r0, r5 - lsls r0, 1 - adds r0, r2 - strh r3, [r0] - adds r1, 0x1 - lsls r1, 5 - adds r1, r5 - lsls r1, 1 - adds r1, r2 - strh r3, [r1] -_081471CE: - movs r1, 0x2E - ldrsh r0, [r4, r1] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - adds r0, 0xF - lsls r0, 16 - movs r1, 0x87 - lsls r1, 17 - cmp r0, r1 - bls _081471F2 - adds r0, r4, 0 - movs r1, 0x2D - bl FieldEffectStop -_081471F2: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814713C - - thumb_func_start sub_8147204 -sub_8147204: @ 8147204 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8B9C - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_08147216: - 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 _08147216 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8147204 - - thumb_func_start sub_814723C -sub_814723C: @ 814723C - push {r4,lr} - adds r4, r0, 0 - bl sub_8149F08 - bl dp12_8087EA4 - ldr r0, =0x0203aba0 - ldr r1, [r0] - movs r0, 0 - strh r0, [r1, 0x2] - movs r0, 0x3F - strh r0, [r1, 0x4] - ldr r0, =0x0000f0f1 - strh r0, [r1, 0x6] - movs r0, 0xA0 - strh r0, [r1, 0x8] - movs r1, 0 - ldr r3, =0x020393a8 - ldr r2, =0x0000f3f4 -_08147262: - lsls r0, r1, 1 - adds r0, r3 - strh r2, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x9F - bls _08147262 - ldr r0, =sub_8147688 - bl SetVBlankCallback - ldr r0, =0x0203aba0 - ldr r1, [r0] - movs r0, 0x78 - strh r0, [r1, 0x2C] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814723C - - thumb_func_start sub_81472A4 -sub_81472A4: @ 81472A4 - push {r4-r7,lr} - sub sp, 0xC - adds r6, r0, 0 - ldr r2, =0x0203aba0 - ldr r1, [r2] - ldrb r0, [r1] - movs r0, 0 - strb r0, [r1] - ldr r1, [r2] - adds r0, r1, 0 - adds r0, 0x24 - movs r2, 0x2C - ldrsh r3, [r1, r2] - movs r1, 0x1 - negs r1, r1 - str r1, [sp] - movs r1, 0x1 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x78 - movs r2, 0x50 - bl sub_814A1AC - ldr r5, =0x02038c28 -_081472D4: - ldr r4, =0x0203aba0 - ldr r0, [r4] - movs r7, 0x2A - ldrsh r3, [r0, r7] - lsls r3, 1 - adds r3, r5 - ldrh r1, [r0, 0x28] - adds r1, 0x1 - movs r7, 0xF0 - lsls r7, 7 - adds r2, r7, 0 - orrs r1, r2 - strh r1, [r3] - adds r0, 0x24 - movs r1, 0x1 - movs r2, 0x1 - bl sub_814A228 - lsls r0, 24 - cmp r0, 0 - beq _081472D4 - ldr r1, [r4] - ldrh r0, [r1, 0x2C] - adds r0, 0x10 - strh r0, [r1, 0x2C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xEF - ble _08147318 - movs r0, 0 - strh r0, [r1, 0x2E] - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] -_08147318: - ldr r0, [r4] - ldrb r1, [r0] - adds r1, 0x1 - ldrb r2, [r0] - strb r1, [r0] - movs r0, 0 - add sp, 0xC - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81472A4 - - thumb_func_start sub_8147334 -sub_8147334: @ 8147334 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - mov r8, r0 - add r1, sp, 0xC - movs r0, 0 - strb r0, [r1] - ldr r4, =0x0203aba0 - ldr r1, [r4] - ldrb r0, [r1] - movs r0, 0 - strb r0, [r1] - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x24 - movs r2, 0x2E - ldrsh r1, [r1, r2] - str r1, [sp] - movs r1, 0x1 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0xF0 - bl sub_814A1AC - mov r9, r4 - mov r7, r9 - add r5, sp, 0xC -_08147372: - movs r1, 0x78 - ldr r3, [r7] - ldrh r0, [r3, 0x28] - adds r0, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - movs r2, 0x2E - ldrsh r0, [r3, r2] - cmp r0, 0x4F - ble _0814738A - ldrh r1, [r3, 0x28] - movs r4, 0xF0 -_0814738A: - ldr r6, =0x02038c28 - movs r0, 0x2A - ldrsh r2, [r3, r0] - lsls r2, 1 - adds r2, r6 - lsls r1, 16 - asrs r1, 8 - lsls r0, r4, 16 - asrs r4, r0, 16 - orrs r4, r1 - strh r4, [r2] - ldrb r0, [r5] - cmp r0, 0 - bne _081473C0 - adds r0, r3, 0 - adds r0, 0x24 - movs r1, 0x1 - movs r2, 0x1 - bl sub_814A228 - strb r0, [r5] - b _08147372 - .pool -_081473C0: - ldr r1, [r7] - ldrh r0, [r1, 0x2E] - adds r0, 0x8 - strh r0, [r1, 0x2E] - lsls r0, 16 - asrs r2, r0, 16 - cmp r2, 0x9F - ble _081473DE - movs r0, 0xF0 - strh r0, [r1, 0x2C] - mov r1, r8 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _08147406 -_081473DE: - movs r3, 0x2A - ldrsh r0, [r1, r3] - cmp r0, r2 - bge _08147406 - adds r3, r4, 0 - ldr r5, =0x0203aba0 -_081473EA: - ldr r2, [r5] - ldrh r0, [r2, 0x2A] - adds r0, 0x1 - strh r0, [r2, 0x2A] - lsls r0, 16 - asrs r0, 15 - adds r0, r6 - strh r3, [r0] - movs r4, 0x2A - ldrsh r1, [r2, r4] - movs r4, 0x2E - ldrsh r0, [r2, r4] - cmp r1, r0 - blt _081473EA -_08147406: - mov r1, r9 - ldr r0, [r1] - ldrb r1, [r0] - adds r1, 0x1 - ldrb r2, [r0] - strb r1, [r0] - movs r0, 0 - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8147334 - - thumb_func_start sub_8147428 -sub_8147428: @ 8147428 - push {r4-r6,lr} - sub sp, 0xC - adds r6, r0, 0 - ldr r2, =0x0203aba0 - ldr r1, [r2] - ldrb r0, [r1] - movs r0, 0 - strb r0, [r1] - ldr r1, [r2] - adds r0, r1, 0 - adds r0, 0x24 - movs r2, 0x2C - ldrsh r3, [r1, r2] - movs r1, 0xA0 - str r1, [sp] - movs r1, 0x1 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x78 - movs r2, 0x50 - bl sub_814A1AC - ldr r5, =0x02038c28 -_08147456: - ldr r4, =0x0203aba0 - ldr r0, [r4] - movs r1, 0x2A - ldrsh r3, [r0, r1] - lsls r3, 1 - adds r3, r5 - ldrh r1, [r0, 0x28] - lsls r1, 8 - movs r2, 0xF0 - orrs r1, r2 - strh r1, [r3] - adds r0, 0x24 - movs r1, 0x1 - movs r2, 0x1 - bl sub_814A228 - lsls r0, 24 - cmp r0, 0 - beq _08147456 - ldr r1, [r4] - ldrh r0, [r1, 0x2C] - subs r0, 0x10 - strh r0, [r1, 0x2C] - lsls r0, 16 - cmp r0, 0 - bgt _08147494 - movs r0, 0xA0 - strh r0, [r1, 0x2E] - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] -_08147494: - ldr r0, [r4] - ldrb r1, [r0] - adds r1, 0x1 - ldrb r2, [r0] - strb r1, [r0] - movs r0, 0 - add sp, 0xC - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8147428 - - thumb_func_start sub_81474B0 -sub_81474B0: @ 81474B0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - mov r9, r0 - add r1, sp, 0xC - movs r0, 0 - strb r0, [r1] - ldr r4, =0x0203aba0 - ldr r1, [r4] - ldrb r0, [r1] - movs r0, 0 - strb r0, [r1] - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x24 - movs r2, 0x2E - ldrsh r1, [r1, r2] - str r1, [sp] - movs r1, 0x1 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x78 - movs r2, 0x50 - movs r3, 0 - bl sub_814A1AC - ldr r7, =0x02038c28 - mov r10, r7 - ldr r0, =0x0203aba0 - mov r8, r0 - add r6, sp, 0xC -_081474F4: - mov r1, r8 - ldr r4, [r1] - movs r2, 0x2A - ldrsh r0, [r4, r2] - lsls r0, 1 - mov r7, r10 - adds r5, r0, r7 - ldrb r1, [r5] - ldrh r2, [r4, 0x28] - adds r3, r2, 0 - movs r7, 0x2E - ldrsh r0, [r4, r7] - cmp r0, 0x50 - bgt _08147514 - movs r2, 0x78 - adds r1, r3, 0 -_08147514: - lsls r0, r2, 16 - asrs r0, 8 - lsls r1, 16 - asrs r1, 16 - orrs r1, r0 - movs r7, 0 - strh r1, [r5] - ldrb r0, [r6] - cmp r0, 0 - bne _08147540 - adds r0, r4, 0 - adds r0, 0x24 - movs r1, 0x1 - movs r2, 0x1 - bl sub_814A228 - strb r0, [r6] - b _081474F4 - .pool -_08147540: - mov r0, r8 - ldr r2, [r0] - ldrh r0, [r2, 0x2E] - subs r0, 0x8 - strh r0, [r2, 0x2E] - lsls r0, 16 - asrs r3, r0, 16 - cmp r3, 0 - bgt _0814755E - strh r7, [r2, 0x2C] - mov r1, r9 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _08147588 -_0814755E: - movs r4, 0x2A - ldrsh r0, [r2, r4] - cmp r0, r3 - ble _08147588 - ldr r6, =0x02038c28 - adds r3, r1, 0 - ldr r5, =0x0203aba0 -_0814756C: - ldr r2, [r5] - ldrh r0, [r2, 0x2A] - subs r0, 0x1 - strh r0, [r2, 0x2A] - lsls r0, 16 - asrs r0, 15 - adds r0, r6 - strh r3, [r0] - movs r7, 0x2A - ldrsh r1, [r2, r7] - movs r4, 0x2E - ldrsh r0, [r2, r4] - cmp r1, r0 - bgt _0814756C -_08147588: - ldr r7, =0x0203aba0 - ldr r0, [r7] - ldrb r1, [r0] - adds r1, 0x1 - ldrb r2, [r0] - strb r1, [r0] - movs r0, 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_81474B0 - - thumb_func_start sub_81475B0 -sub_81475B0: @ 81475B0 - push {r4-r7,lr} - sub sp, 0xC - adds r7, r0, 0 - ldr r1, =0x0203aba0 - ldr r0, [r1] - ldrb r2, [r0] - movs r2, 0 - strb r2, [r0] - ldr r1, [r1] - adds r0, r1, 0 - adds r0, 0x24 - movs r4, 0x2C - ldrsh r3, [r1, r4] - str r2, [sp] - movs r1, 0x1 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x78 - movs r2, 0x50 - bl sub_814A1AC - ldr r6, =0x02038c28 -_081475DC: - movs r2, 0x78 - ldr r5, =0x0203aba0 - ldr r3, [r5] - ldrh r4, [r3, 0x28] - movs r1, 0x28 - ldrsh r0, [r3, r1] - cmp r0, 0x77 - ble _081475F0 - movs r2, 0 - movs r4, 0xF0 -_081475F0: - movs r0, 0x2A - ldrsh r1, [r3, r0] - lsls r1, 1 - adds r1, r6 - lsls r2, 8 - lsls r0, r4, 16 - asrs r0, 16 - orrs r0, r2 - strh r0, [r1] - adds r0, r3, 0 - adds r0, 0x24 - movs r1, 0x1 - movs r2, 0x1 - bl sub_814A228 - lsls r0, 24 - cmp r0, 0 - beq _081475DC - ldr r0, [r5] - ldrh r1, [r0, 0x2C] - adds r1, 0x10 - strh r1, [r0, 0x2C] - movs r1, 0x28 - ldrsh r0, [r0, r1] - cmp r0, 0x78 - ble _0814762A - ldrh r0, [r7, 0x8] - adds r0, 0x1 - strh r0, [r7, 0x8] -_0814762A: - ldr r0, [r5] - ldrb r1, [r0] - adds r1, 0x1 - ldrb r2, [r0] - strb r1, [r0] - movs r0, 0 - add sp, 0xC - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81475B0 - - thumb_func_start sub_8147648 -sub_8147648: @ 8147648 - push {lr} - ldr r1, =0x040000b0 - ldrh r2, [r1, 0xA] - ldr r0, =0x0000c5ff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r2, [r1, 0xA] - ldr r0, =0x00007fff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r0, [r1, 0xA] - bl sub_8149F84 - ldr r0, =sub_8147204 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8147648 - - thumb_func_start sub_8147688 -sub_8147688: @ 8147688 - push {r4,lr} - ldr r4, =0x040000b0 - ldrh r1, [r4, 0xA] - ldr r0, =0x0000c5ff - ands r0, r1 - strh r0, [r4, 0xA] - ldrh r1, [r4, 0xA] - ldr r0, =0x00007fff - ands r0, r1 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xA] - bl sub_8149F2C - ldr r3, =0x0203aba0 - ldr r0, [r3] - ldrb r0, [r0] - cmp r0, 0 - beq _081476C0 - ldr r1, =0x040000d4 - ldr r0, =0x02038c28 - str r0, [r1] - movs r2, 0xF0 - lsls r2, 3 - adds r0, r2 - str r0, [r1, 0x4] - ldr r0, =0x800000a0 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] -_081476C0: - ldr r2, =0x04000048 - ldr r1, [r3] - ldrh r0, [r1, 0x2] - strh r0, [r2] - adds r2, 0x2 - ldrh r0, [r1, 0x4] - strh r0, [r2] - subs r2, 0x6 - ldrh r0, [r1, 0x8] - strh r0, [r2] - subs r2, 0x4 - ldr r0, =0x02038c28 - movs r1, 0xF0 - lsls r1, 3 - adds r0, r1 - ldrh r1, [r0] - strh r1, [r2] - str r0, [r4] - str r2, [r4, 0x4] - ldr r0, =0xa2400001 - str r0, [r4, 0x8] - ldr r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8147688 - - thumb_func_start sub_8147718 -sub_8147718: @ 8147718 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8BB8 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0814772A: - 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 _0814772A - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8147718 - - thumb_func_start sub_8147750 -sub_8147750: @ 8147750 - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_8149F08 - bl dp12_8087EA4 - movs r2, 0 - ldr r4, =0x020393a8 - ldr r3, =0x0203aba0 -_08147762: - lsls r1, r2, 1 - adds r1, r4 - ldr r0, [r3] - ldrh r0, [r0, 0x16] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x9F - bls _08147762 - ldr r0, =sub_8147888 - bl SetVBlankCallback - ldr r0, =sub_81478C0 - bl SetHBlankCallback - movs r0, 0x2 - bl EnableInterrupts - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8147750 - - thumb_func_start sub_81477A8 -sub_81477A8: @ 81477A8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r6, r0, 0 - ldr r0, =0x0203aba0 - ldr r1, [r0] - ldrb r0, [r1] - movs r0, 0 - strb r0, [r1] - ldrh r2, [r6, 0xC] - lsls r1, r2, 16 - asrs r0, r1, 24 - lsls r0, 16 - lsrs r3, r0, 16 - ldrh r4, [r6, 0xA] - movs r0, 0xC0 - lsls r0, 1 - mov r8, r0 - movs r5, 0x80 - lsls r5, 3 - adds r0, r4, r5 - strh r0, [r6, 0xA] - ldr r0, =0x1fff0000 - cmp r1, r0 - bgt _081477E4 - movs r1, 0xC0 - lsls r1, 1 - adds r0, r2, r1 - strh r0, [r6, 0xC] -_081477E4: - movs r5, 0 - lsls r7, r3, 16 -_081477E8: - lsrs r0, r4, 8 - asrs r1, r7, 16 - bl sine - ldr r1, =0x02038c28 - lsls r2, r5, 1 - adds r2, r1 - ldr r1, =0x0203aba0 - ldr r1, [r1] - ldrh r1, [r1, 0x16] - adds r0, r1 - strh r0, [r2] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - mov r1, r8 - adds r0, r4, r1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r5, 0x9F - bls _081477E8 - ldrh r0, [r6, 0xE] - adds r0, 0x1 - strh r0, [r6, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x51 - bne _08147838 - ldrh r0, [r6, 0x10] - adds r0, 0x1 - strh r0, [r6, 0x10] - movs r0, 0x1 - negs r0, r0 - movs r1, 0x2 - negs r1, r1 - movs r2, 0 - str r2, [sp] - movs r3, 0x10 - bl pal_fade_maybe -_08147838: - movs r5, 0x10 - ldrsh r0, [r6, r5] - cmp r0, 0 - beq _0814785A - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0814785A - ldr r0, =sub_8147718 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_0814785A: - ldr r0, =0x0203aba0 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - ldrb r2, [r1] - strb r0, [r1] - movs r0, 0 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81477A8 - - thumb_func_start sub_8147888 -sub_8147888: @ 8147888 - push {lr} - bl sub_8149F2C - ldr r0, =0x0203aba0 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0 - beq _081478AC - ldr r1, =0x040000d4 - ldr r0, =0x02038c28 - str r0, [r1] - movs r2, 0xF0 - lsls r2, 3 - adds r0, r2 - str r0, [r1, 0x4] - ldr r0, =0x800000a0 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] -_081478AC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8147888 - - thumb_func_start sub_81478C0 -sub_81478C0: @ 81478C0 - ldr r1, =0x02038c28 - ldr r0, =0x04000006 - ldrh r0, [r0] - lsls r0, 1 - movs r2, 0xF0 - lsls r2, 3 - adds r1, r2 - adds r0, r1 - ldrh r1, [r0] - ldr r0, =0x04000016 - strh r1, [r0] - adds r0, 0x4 - strh r1, [r0] - adds r0, 0x4 - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_81478C0 - - thumb_func_start sub_81478EC -sub_81478EC: @ 81478EC - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8BC0 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_081478FE: - 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 _081478FE - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81478EC - - thumb_func_start sub_8147924 -sub_8147924: @ 8147924 - push {r4,lr} - adds r4, r0, 0 - bl sub_8149F08 - bl dp12_8087EA4 - ldr r0, =0x0203aba0 - ldr r1, [r0] - movs r2, 0 - movs r0, 0x3F - strh r0, [r1, 0x2] - strh r2, [r1, 0x4] - movs r0, 0xF0 - strh r0, [r1, 0x6] - movs r0, 0xA0 - strh r0, [r1, 0x8] - movs r1, 0 - ldr r3, =0x020393a8 - movs r2, 0xF2 -_0814794A: - lsls r0, r1, 1 - adds r0, r3 - strh r2, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x9F - bls _0814794A - ldr r0, =sub_8147A58 - bl SetVBlankCallback - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8147924 - - thumb_func_start sub_814797C -sub_814797C: @ 814797C - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - ldr r0, =0x0203aba0 - ldr r1, [r0] - ldrb r0, [r1] - movs r0, 0 - strb r0, [r1] - ldr r7, =0x02038c28 - ldrh r0, [r4, 0xC] - ldrb r5, [r4, 0xC] - adds r0, 0x10 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0xA] - adds r0, 0x8 - strh r0, [r4, 0xA] - movs r6, 0 - movs r0, 0x1 - mov r8, r0 -_081479A4: - adds r0, r5, 0 - movs r1, 0x28 - bl sine - ldrh r1, [r4, 0xA] - adds r0, r1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r0, 0 - bge _081479BA - movs r1, 0 -_081479BA: - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xF0 - ble _081479C4 - movs r1, 0xF0 -_081479C4: - lsls r0, r1, 16 - asrs r0, 16 - lsls r1, r0, 8 - movs r2, 0xF1 - orrs r1, r2 - strh r1, [r7] - cmp r0, 0xEF - bgt _081479D8 - movs r0, 0 - mov r8, r0 -_081479D8: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r5, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - adds r7, 0x2 - cmp r6, 0x9F - bls _081479A4 - mov r1, r8 - cmp r1, 0 - beq _081479F6 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_081479F6: - ldr r0, =0x0203aba0 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - ldrb r2, [r1] - strb r0, [r1] - movs r0, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814797C - - thumb_func_start sub_8147A18 -sub_8147A18: @ 8147A18 - push {lr} - ldr r1, =0x040000b0 - ldrh r2, [r1, 0xA] - ldr r0, =0x0000c5ff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r2, [r1, 0xA] - ldr r0, =0x00007fff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r0, [r1, 0xA] - bl sub_8149F84 - ldr r0, =sub_81478EC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8147A18 - - thumb_func_start sub_8147A58 -sub_8147A58: @ 8147A58 - push {r4,lr} - ldr r4, =0x040000b0 - ldrh r1, [r4, 0xA] - ldr r0, =0x0000c5ff - ands r0, r1 - strh r0, [r4, 0xA] - ldrh r1, [r4, 0xA] - ldr r0, =0x00007fff - ands r0, r1 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xA] - bl sub_8149F2C - ldr r3, =0x0203aba0 - ldr r0, [r3] - ldrb r0, [r0] - cmp r0, 0 - beq _08147A90 - ldr r1, =0x040000d4 - ldr r0, =0x02038c28 - str r0, [r1] - movs r2, 0xF0 - lsls r2, 3 - adds r0, r2 - str r0, [r1, 0x4] - ldr r0, =0x800000a0 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] -_08147A90: - ldr r2, =0x04000048 - ldr r1, [r3] - ldrh r0, [r1, 0x2] - strh r0, [r2] - adds r2, 0x2 - ldrh r0, [r1, 0x4] - strh r0, [r2] - subs r2, 0x6 - ldrh r0, [r1, 0x8] - strh r0, [r2] - ldr r0, =0x020393a8 - str r0, [r4] - ldr r0, =0x04000040 - str r0, [r4, 0x4] - ldr r0, =0xa2400001 - str r0, [r4, 0x8] - ldr r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8147A58 - - thumb_func_start sub_8147AE4 -sub_8147AE4: @ 8147AE4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0 - strh r2, [r1, 0x26] - bl sub_8147B84 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8147AE4 - - thumb_func_start sub_8147B04 -sub_8147B04: @ 8147B04 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0x1 - strh r2, [r1, 0x26] - bl sub_8147B84 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8147B04 - - thumb_func_start sub_8147B24 -sub_8147B24: @ 8147B24 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0x2 - strh r2, [r1, 0x26] - bl sub_8147B84 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8147B24 - - thumb_func_start sub_8147B44 -sub_8147B44: @ 8147B44 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0x3 - strh r2, [r1, 0x26] - bl sub_8147B84 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8147B44 - - thumb_func_start sub_8147B64 -sub_8147B64: @ 8147B64 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0x4 - strh r2, [r1, 0x26] - bl sub_8147B84 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8147B64 - - thumb_func_start sub_8147B84 -sub_8147B84: @ 8147B84 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8BCC - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_08147B96: - 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 _08147B96 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8147B84 - - thumb_func_start sub_8147BBC -sub_8147BBC: @ 8147BBC - push {r4,lr} - adds r4, r0, 0 - bl sub_8149F08 - bl dp12_8087EA4 - adds r0, r4, 0 - bl sub_8148218 - movs r0, 0 - strh r0, [r4, 0xA] - movs r0, 0x1 - strh r0, [r4, 0xC] - movs r0, 0xEF - strh r0, [r4, 0xE] - ldr r0, =0x0203aba0 - ldr r1, [r0] - movs r0, 0x3F - strh r0, [r1, 0x2] - movs r0, 0x3E - strh r0, [r1, 0x4] - movs r0, 0xA0 - strh r0, [r1, 0x8] - movs r1, 0 - ldr r3, =0x020393a8 - ldr r2, =0x0000f0f1 -_08147BF0: - lsls r0, r1, 1 - adds r0, r3 - strh r2, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x9F - bls _08147BF0 - ldr r0, =sub_81480CC - bl SetVBlankCallback - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8147BBC - - thumb_func_start sub_8147C24 -sub_8147C24: @ 8147C24 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - mov r8, r0 - ldr r6, =gUnknown_085C94D0 - add r1, sp, 0x4 - mov r0, sp - bl sub_8149F58 - ldr r0, =gUnknown_085B9AF0 - ldr r1, [sp, 0x4] - movs r2, 0xF0 - bl CpuSet - ldr r1, =gUnknown_085C8FDC - mov r2, r8 - movs r3, 0x26 - ldrsh r0, [r2, r3] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =gUnknown_085C8FF0 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0xFA - movs r2, 0xC - bl gpu_pal_apply - movs r1, 0 - ldr r5, [sp] - movs r0, 0xF0 - lsls r0, 8 - adds r7, r0, 0 -_08147C78: - movs r0, 0 - lsls r3, r1, 16 - asrs r4, r3, 11 -_08147C7E: - lsls r2, r0, 16 - asrs r2, 16 - adds r1, r4, r2 - lsls r1, 1 - adds r1, r5 - ldrh r0, [r6] - orrs r0, r7 - strh r0, [r1] - adds r2, 0x1 - lsls r2, 16 - adds r6, 0x2 - lsrs r0, r2, 16 - asrs r2, 16 - cmp r2, 0x1F - ble _08147C7E - movs r1, 0x80 - lsls r1, 9 - adds r0, r3, r1 - lsrs r1, r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _08147C78 - movs r0, 0x2 - bl EnableInterrupts - ldr r0, =sub_81481E0 - bl SetHBlankCallback - mov r2, r8 - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - movs r0, 0 - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8147C24 - - thumb_func_start sub_8147CE4 -sub_8147CE4: @ 8147CE4 - push {r4-r7,lr} - adds r4, r0, 0 - ldr r0, =0x0203aba0 - ldr r1, [r0] - ldrb r0, [r1] - movs r0, 0 - strb r0, [r1] - ldr r7, =0x02038c28 - ldrh r0, [r4, 0xA] - ldrb r5, [r4, 0xA] - adds r0, 0x10 - strh r0, [r4, 0xA] - movs r6, 0 -_08147CFE: - adds r0, r5, 0 - movs r1, 0x10 - bl sine - ldrh r1, [r4, 0xC] - adds r0, r1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r0, 0 - bge _08147D14 - movs r2, 0x1 -_08147D14: - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, 0xF0 - ble _08147D1E - movs r2, 0xF0 -_08147D1E: - strh r2, [r7] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r7, 0x2 - adds r0, r5, 0 - adds r0, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r6, 0x4F - bls _08147CFE - cmp r6, 0x9F - bhi _08147D76 -_08147D38: - adds r0, r5, 0 - movs r1, 0x10 - bl sine - ldrh r1, [r4, 0xE] - subs r1, r0 - lsls r1, 16 - lsrs r2, r1, 16 - cmp r1, 0 - bge _08147D4E - movs r2, 0 -_08147D4E: - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, 0xEF - ble _08147D58 - movs r2, 0xEF -_08147D58: - lsls r0, r2, 16 - asrs r0, 8 - movs r1, 0xF0 - orrs r0, r1 - strh r0, [r7] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r7, 0x2 - adds r0, r5, 0 - adds r0, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r6, 0x9F - bls _08147D38 -_08147D76: - ldrh r1, [r4, 0xC] - adds r1, 0x8 - strh r1, [r4, 0xC] - ldrh r0, [r4, 0xE] - subs r0, 0x8 - strh r0, [r4, 0xE] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0xF0 - ble _08147D8E - movs r0, 0xF0 - strh r0, [r4, 0xC] -_08147D8E: - movs r1, 0xE - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _08147D9A - movs r0, 0 - strh r0, [r4, 0xE] -_08147D9A: - ldr r0, [r4, 0xC] - cmp r0, 0xF0 - bne _08147DA6 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_08147DA6: - ldr r0, =0x0203aba0 - ldr r1, [r0] - ldrh r0, [r1, 0x18] - subs r0, 0x8 - strh r0, [r1, 0x18] - ldrh r0, [r1, 0x1A] - adds r0, 0x8 - strh r0, [r1, 0x1A] - ldrb r0, [r1] - adds r0, 0x1 - ldrb r2, [r1] - strb r0, [r1] - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8147CE4 - - thumb_func_start sub_8147DD0 -sub_8147DD0: @ 8147DD0 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r2, =0x0203aba0 - ldr r1, [r2] - ldrb r0, [r1] - movs r0, 0 - strb r0, [r1] - ldr r1, =0x02038c28 - adds r5, r2, 0 - movs r2, 0xF0 -_08147DE4: - strh r2, [r1] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - adds r1, 0x2 - cmp r0, 0x9F - bls _08147DE4 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x8] - strh r1, [r4, 0xA] - strh r1, [r4, 0xC] - strh r1, [r4, 0xE] - ldr r1, [r5] - ldrh r0, [r1, 0x18] - subs r0, 0x8 - strh r0, [r1, 0x18] - ldrh r0, [r1, 0x1A] - adds r0, 0x8 - strh r0, [r1, 0x1A] - movs r1, 0x22 - ldrsh r0, [r4, r1] - movs r1, 0 - bl sub_8148484 - movs r1, 0x24 - ldrsh r0, [r4, r1] - movs r1, 0x1 - bl sub_8148484 - movs r1, 0x22 - ldrsh r0, [r4, r1] - bl sub_814849C - movs r0, 0x68 - bl audio_play - ldr r1, [r5] - ldrb r0, [r1] - adds r0, 0x1 - ldrb r2, [r1] - strb r0, [r1] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8147DD0 - - thumb_func_start sub_8147E4C -sub_8147E4C: @ 8147E4C - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0203aba0 - ldr r1, [r0] - ldrh r0, [r1, 0x18] - subs r0, 0x8 - strh r0, [r1, 0x18] - ldrh r0, [r1, 0x1A] - adds r0, 0x8 - strh r0, [r1, 0x1A] - movs r1, 0x22 - ldrsh r0, [r4, r1] - bl sub_81484B8 - lsls r0, 16 - cmp r0, 0 - beq _08147E7C - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r1, 0x24 - ldrsh r0, [r4, r1] - bl sub_814849C -_08147E7C: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8147E4C - - thumb_func_start sub_8147E88 -sub_8147E88: @ 8147E88 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - ldr r7, =0x0203aba0 - ldr r1, [r7] - ldrh r0, [r1, 0x18] - subs r0, 0x8 - movs r2, 0 - mov r8, r2 - strh r0, [r1, 0x18] - ldrh r0, [r1, 0x1A] - adds r0, 0x8 - strh r0, [r1, 0x1A] - movs r1, 0x24 - ldrsh r0, [r6, r1] - bl sub_81484B8 - lsls r0, 16 - cmp r0, 0 - beq _08147F1C - ldr r1, [r7] - ldrb r0, [r1] - movs r0, 0 - strb r0, [r1] - movs r0, 0 - bl SetVBlankCallback - ldr r1, =0x040000b0 - ldrh r2, [r1, 0xA] - ldr r0, =0x0000c5ff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r2, [r1, 0xA] - ldr r0, =0x00007fff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r0, [r1, 0xA] - ldr r4, =0x02038c28 - movs r5, 0xA0 - lsls r5, 1 - adds r0, r4, 0 - movs r1, 0 - adds r2, r5, 0 - bl memset - movs r2, 0xF0 - lsls r2, 3 - adds r4, r2 - adds r0, r4, 0 - movs r1, 0 - adds r2, r5, 0 - bl memset - movs r0, 0x40 - movs r1, 0xF0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - mov r0, r8 - strh r0, [r6, 0xE] - strh r0, [r6, 0x10] - ldr r1, [r7] - movs r0, 0xBF - strh r0, [r1, 0xE] - ldr r0, =sub_8148160 - bl SetVBlankCallback -_08147F1C: - movs r0, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8147E88 - - thumb_func_start sub_8147F40 -sub_8147F40: @ 8147F40 - push {r4-r7,lr} - adds r4, r0, 0 - ldr r2, =0x0203aba0 - ldr r1, [r2] - ldrb r0, [r1] - movs r0, 0 - strb r0, [r1] - movs r6, 0x1 - ldr r1, [r2] - ldrh r0, [r1, 0x18] - subs r0, 0x8 - strh r0, [r1, 0x18] - ldrh r0, [r1, 0x1A] - adds r0, 0x8 - strh r0, [r1, 0x1A] - ldrh r1, [r4, 0x10] - movs r3, 0x10 - ldrsh r0, [r4, r3] - mov r12, r2 - cmp r0, 0x4F - bgt _08147F6E - adds r0, r1, 0x2 - strh r0, [r4, 0x10] -_08147F6E: - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r0, 0x50 - ble _08147F7A - movs r0, 0x50 - strh r0, [r4, 0x10] -_08147F7A: - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] - movs r1, 0x1 - ands r0, r1 - ldrh r3, [r4, 0x10] - cmp r0, 0 - beq _08147FDC - movs r2, 0 - lsls r0, r3, 16 - movs r6, 0 - cmp r0, 0 - blt _08147FDC - movs r7, 0x50 - ldr r5, =0x02038c28 -_08147F98: - lsls r0, r2, 16 - asrs r3, r0, 16 - subs r1, r7, r3 - adds r0, r3, 0 - adds r0, 0x50 - lsls r0, 16 - lsrs r2, r0, 16 - lsls r1, 16 - asrs r1, 15 - adds r1, r5 - ldrh r0, [r1] - cmp r0, 0xF - bhi _08147FB8 - movs r6, 0x1 - adds r0, 0x1 - strh r0, [r1] -_08147FB8: - lsls r0, r2, 16 - asrs r0, 15 - adds r1, r0, r5 - ldrh r0, [r1] - cmp r0, 0xF - bhi _08147FCA - movs r6, 0x1 - adds r0, 0x1 - strh r0, [r1] -_08147FCA: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - asrs r0, 16 - movs r3, 0x10 - ldrsh r1, [r4, r3] - ldrh r3, [r4, 0x10] - cmp r0, r1 - ble _08147F98 -_08147FDC: - cmp r3, 0x50 - bne _08147FEA - cmp r6, 0 - bne _08147FEA - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_08147FEA: - mov r1, r12 - ldr r0, [r1] - ldrb r1, [r0] - adds r1, 0x1 - ldrb r2, [r0] - strb r1, [r0] - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8147F40 - - thumb_func_start sub_8148008 -sub_8148008: @ 8148008 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r5, =0x0203aba0 - ldr r0, [r5] - ldrb r1, [r0] - movs r6, 0 - strb r6, [r0] - movs r0, 0x1 - negs r0, r0 - ldr r2, =0x00007fff - movs r1, 0x10 - bl sub_80A2A20 - ldr r1, [r5] - movs r0, 0xFF - strh r0, [r1, 0xE] - strh r6, [r4, 0xE] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x1 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8148008 - - thumb_func_start sub_8148040 -sub_8148040: @ 8148040 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x0203aba0 - ldr r1, [r5] - ldrb r0, [r1] - movs r0, 0 - strb r0, [r1] - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] - ldr r0, =0x02038c28 - movs r2, 0xE - ldrsh r1, [r4, r2] - movs r2, 0xA0 - lsls r2, 1 - bl memset - movs r1, 0xE - ldrsh r0, [r4, r1] - cmp r0, 0xF - ble _08148070 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_08148070: - ldr r0, [r5] - ldrb r1, [r0] - adds r1, 0x1 - ldrb r2, [r0] - strb r1, [r0] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8148040 - - thumb_func_start sub_814808C -sub_814808C: @ 814808C - push {r4,lr} - adds r4, r0, 0 - ldr r1, =0x040000b0 - ldrh r2, [r1, 0xA] - ldr r0, =0x0000c5ff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r2, [r1, 0xA] - ldr r0, =0x00007fff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r0, [r1, 0xA] - bl sub_8149F84 - ldr r0, [r4] - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814808C - - thumb_func_start sub_81480CC -sub_81480CC: @ 81480CC - push {r4,lr} - ldr r4, =0x040000b0 - ldrh r1, [r4, 0xA] - ldr r0, =0x0000c5ff - ands r0, r1 - strh r0, [r4, 0xA] - ldrh r1, [r4, 0xA] - ldr r0, =0x00007fff - ands r0, r1 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xA] - bl sub_8149F2C - ldr r3, =0x0203aba0 - ldr r0, [r3] - ldrb r0, [r0] - cmp r0, 0 - beq _08148104 - ldr r1, =0x040000d4 - ldr r0, =0x02038c28 - str r0, [r1] - movs r2, 0xF0 - lsls r2, 3 - adds r0, r2 - str r0, [r1, 0x4] - ldr r0, =0x800000a0 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] -_08148104: - ldr r2, =0x04000012 - ldr r1, [r3] - ldrh r0, [r1, 0x1C] - strh r0, [r2] - adds r2, 0x36 - ldrh r0, [r1, 0x2] - strh r0, [r2] - adds r2, 0x2 - ldrh r0, [r1, 0x4] - strh r0, [r2] - subs r2, 0x6 - ldrh r0, [r1, 0x8] - strh r0, [r2] - ldr r0, =0x020393a8 - str r0, [r4] - ldr r0, =0x04000040 - str r0, [r4, 0x4] - ldr r0, =0xa2400001 - str r0, [r4, 0x8] - ldr r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81480CC - - thumb_func_start sub_8148160 -sub_8148160: @ 8148160 - push {r4,lr} - ldr r4, =0x040000b0 - ldrh r1, [r4, 0xA] - ldr r0, =0x0000c5ff - ands r0, r1 - strh r0, [r4, 0xA] - ldrh r1, [r4, 0xA] - ldr r0, =0x00007fff - ands r0, r1 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xA] - bl sub_8149F2C - ldr r2, =0x0203aba0 - ldr r0, [r2] - ldrb r0, [r0] - cmp r0, 0 - beq _08148198 - ldr r1, =0x040000d4 - ldr r0, =0x02038c28 - str r0, [r1] - movs r3, 0xF0 - lsls r3, 3 - adds r0, r3 - str r0, [r1, 0x4] - ldr r0, =0x800000a0 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] -_08148198: - ldr r1, =0x04000050 - ldr r0, [r2] - ldrh r0, [r0, 0xE] - strh r0, [r1] - ldr r0, =0x020393a8 - str r0, [r4] - ldr r0, =0x04000054 - str r0, [r4, 0x4] - ldr r0, =0xa2400001 - str r0, [r4, 0x8] - ldr r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8148160 - - thumb_func_start sub_81481E0 -sub_81481E0: @ 81481E0 - push {lr} - ldr r0, =0x04000006 - ldrh r0, [r0] - cmp r0, 0x4F - bhi _08148200 - ldr r1, =0x04000010 - ldr r0, =0x0203aba0 - ldr r0, [r0] - ldrh r0, [r0, 0x18] - b _08148208 - .pool -_08148200: - ldr r1, =0x04000010 - ldr r0, =0x0203aba0 - ldr r0, [r0] - ldrh r0, [r0, 0x1A] -_08148208: - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81481E0 - - thumb_func_start sub_8148218 -sub_8148218: @ 8148218 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r4, r0, 0 - ldr r0, =gUnknown_085C8BF4 - movs r2, 0x26 - ldrsh r1, [r4, r2] - mov r8, r1 - add r0, r8 - ldrb r0, [r0] - ldr r2, =gUnknown_085C8C0E - lsls r1, 2 - mov r8, r1 - adds r1, r2 - ldrh r1, [r1] - subs r1, 0x20 - lsls r1, 16 - asrs r1, 16 - adds r2, 0x2 - add r2, r8 - ldrh r2, [r2] - adds r2, 0x2A - lsls r2, 16 - asrs r2, 16 - ldr r5, =0x0201c000 - str r5, [sp] - movs r3, 0 - bl sub_80B5E6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - bl sub_806F000 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x88 - lsls r1, 1 - str r5, [sp] - movs r2, 0x6A - movs r3, 0 - bl sub_80B5E6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x24] - movs r3, 0x22 - ldrsh r0, [r4, r3] - lsls r5, r0, 4 - adds r5, r0 - lsls r5, 2 - ldr r1, =0x02020630 - adds r5, r1 - movs r2, 0x24 - ldrsh r0, [r4, r2] - lsls r6, r0, 4 - adds r6, r0 - lsls r6, 2 - adds r6, r1 - ldr r0, =sub_8148380 - str r0, [r5, 0x1C] - str r0, [r6, 0x1C] - ldrb r0, [r5, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r5, 0x1] - ldrb r0, [r6, 0x1] - orrs r0, r1 - strb r0, [r6, 0x1] - bl rotscale_alloc_entry - lsls r0, 24 - lsrs r0, 24 - movs r3, 0x1F - mov r9, r3 - mov r4, r9 - ands r0, r4 - lsls r0, 1 - ldrb r2, [r5, 0x3] - movs r4, 0x3F - negs r4, r4 - adds r1, r4, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r5, 0x3] - bl rotscale_alloc_entry - lsls r0, 24 - lsrs r0, 24 - mov r1, r9 - ands r0, r1 - lsls r0, 1 - ldrb r1, [r6, 0x3] - ands r4, r1 - orrs r4, r0 - strb r4, [r6, 0x3] - ldrb r2, [r5, 0x1] - movs r1, 0x3F - adds r0, r1, 0 - ands r0, r2 - movs r2, 0x40 - orrs r0, r2 - strb r0, [r5, 0x1] - ldrb r0, [r6, 0x1] - ands r1, r0 - orrs r1, r2 - strb r1, [r6, 0x1] - ldrb r0, [r5, 0x3] - movs r1, 0xC0 - orrs r0, r1 - strb r0, [r5, 0x3] - ldrb r0, [r6, 0x3] - orrs r0, r1 - strb r0, [r6, 0x3] - adds r0, r5, 0 - movs r1, 0x1 - movs r2, 0x3 - movs r3, 0x3 - bl CalcVecFromObjectCenterToObjectUpperLeft - adds r0, r6, 0 - movs r1, 0x1 - movs r2, 0x3 - movs r3, 0x3 - bl CalcVecFromObjectCenterToObjectUpperLeft - ldrb r0, [r5, 0x3] - lsls r0, 26 - lsrs r0, 27 - ldr r2, =gUnknown_085C8BFA - mov r3, r8 - adds r1, r3, r2 - movs r4, 0 - ldrsh r1, [r1, r4] - adds r2, 0x2 - add r8, r2 - mov r3, r8 - movs r4, 0 - ldrsh r2, [r3, r4] - movs r3, 0 - bl sub_8008478 - ldrb r0, [r6, 0x3] - lsls r0, 26 - lsrs r0, 27 - ldr r1, =0xfffffe00 - movs r2, 0x80 - lsls r2, 2 - movs r3, 0 - bl sub_8008478 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8148218 - - thumb_func_start sub_8148380 -sub_8148380: @ 8148380 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =gUnknown_085C8C24 -_08148386: - movs r1, 0x2E - 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 _08148386 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8148380 - - thumb_func_start sub_81483A8 -sub_81483A8: @ 81483A8 - movs r0, 0 - bx lr - thumb_func_end sub_81483A8 - - thumb_func_start sub_81483AC -sub_81483AC: @ 81483AC - push {r4,r5,lr} - sub sp, 0x8 - adds r5, r0, 0 - ldr r1, =gUnknown_085C8C40 - mov r0, sp - movs r2, 0x4 - bl memcpy - add r4, sp, 0x4 - ldr r1, =gUnknown_085C8C44 - adds r0, r4, 0 - movs r2, 0x4 - bl memcpy - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - movs r1, 0x3C - ldrsh r0, [r5, r1] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - strh r0, [r5, 0x30] - movs r1, 0x3C - ldrsh r0, [r5, r1] - lsls r0, 1 - adds r4, r0 - ldrh r0, [r4] - strh r0, [r5, 0x32] - movs r0, 0x1 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81483AC - - thumb_func_start sub_81483F8 -sub_81483F8: @ 81483F8 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x30] - ldrh r3, [r1, 0x20] - adds r2, r0, r3 - strh r2, [r1, 0x20] - movs r3, 0x3C - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _08148416 - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, 0x84 - bgt _08148424 - b _0814841E -_08148416: - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, 0x67 - ble _08148424 -_0814841E: - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] -_08148424: - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_81483F8 - - thumb_func_start sub_814842C -sub_814842C: @ 814842C - push {lr} - adds r2, r0, 0 - ldrh r3, [r2, 0x32] - ldrh r0, [r2, 0x30] - adds r1, r3, r0 - strh r1, [r2, 0x30] - ldrh r0, [r2, 0x20] - adds r0, r1 - strh r0, [r2, 0x20] - lsls r1, 16 - cmp r1, 0 - bne _08148452 - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - negs r0, r3 - strh r0, [r2, 0x32] - movs r0, 0x1 - strh r0, [r2, 0x3A] -_08148452: - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_814842C - - thumb_func_start sub_8148458 -sub_8148458: @ 8148458 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x32] - ldrh r1, [r2, 0x30] - adds r0, r1 - strh r0, [r2, 0x30] - ldrh r1, [r2, 0x20] - adds r1, r0 - strh r1, [r2, 0x20] - adds r1, 0x1F - lsls r1, 16 - movs r0, 0x97 - lsls r0, 17 - cmp r1, r0 - bls _0814847C - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] -_0814847C: - movs r0, 0 - pop {r1} - bx r1 - thumb_func_end sub_8148458 - - thumb_func_start sub_8148484 -sub_8148484: @ 8148484 - ldr r3, =0x02020630 - lsls r0, 16 - asrs r0, 16 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - strh r1, [r2, 0x3C] - bx lr - .pool - thumb_func_end sub_8148484 - - thumb_func_start sub_814849C -sub_814849C: @ 814849C - ldr r2, =0x02020630 - lsls r0, 16 - asrs r0, 16 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - bx lr - .pool - thumb_func_end sub_814849C - - thumb_func_start sub_81484B8 -sub_81484B8: @ 81484B8 - ldr r2, =0x02020630 - lsls r0, 16 - asrs r0, 16 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r2, 0x3A - ldrsh r0, [r1, r2] - bx lr - .pool - thumb_func_end sub_81484B8 - - thumb_func_start sub_81484D0 -sub_81484D0: @ 81484D0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8C48 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_081484E2: - 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 _081484E2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81484D0 - - thumb_func_start sub_8148508 -sub_8148508: @ 8148508 - push {r4-r6,lr} - adds r5, r0, 0 - bl sub_8149F08 - bl dp12_8087EA4 - movs r4, 0 - movs r3, 0 - movs r0, 0x80 - lsls r0, 1 - strh r0, [r5, 0xC] - movs r0, 0x1 - strh r0, [r5, 0xE] - ldr r2, =0x0203aba0 - ldr r1, [r2] - movs r0, 0x3F - strh r0, [r1, 0x2] - strh r3, [r1, 0x4] - movs r0, 0xA0 - strh r0, [r1, 0x8] - ldrb r0, [r1] - strb r4, [r1] - ldr r4, =0x020393a8 - adds r6, r2, 0 - movs r2, 0xF0 -_0814853A: - lsls r1, r3, 1 - adds r1, r4 - ldr r0, [r6] - ldrh r0, [r0, 0x14] - strh r0, [r1] - adds r0, r3, 0 - adds r0, 0xA0 - lsls r0, 1 - adds r0, r4 - strh r2, [r0] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x9F - bls _0814853A - movs r0, 0x2 - bl EnableInterrupts - movs r0, 0x4 - movs r1, 0x10 - bl SetGpuRegBits - ldr r0, =sub_814869C - bl SetVBlankCallback - ldr r0, =sub_8148728 - bl SetHBlankCallback - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0x1 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8148508 - - thumb_func_start sub_8148590 -sub_8148590: @ 8148590 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r3, r0, 0 - ldr r2, =0x0203aba0 - ldr r1, [r2] - ldrb r0, [r1] - movs r0, 0 - strb r0, [r1] - ldrh r0, [r3, 0xC] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r3, 0xA] - adds r0, r1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - mov r8, r2 - cmp r0, 0xF0 - ble _081485BC - movs r0, 0xF0 - strh r0, [r3, 0xA] -_081485BC: - ldrh r4, [r3, 0xC] - movs r0, 0xC - ldrsh r1, [r3, r0] - ldr r0, =0x00000fff - ldrh r2, [r3, 0xE] - cmp r1, r0 - bgt _081485CE - adds r0, r4, r2 - strh r0, [r3, 0xC] -_081485CE: - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, 0x7F - bgt _081485DA - lsls r0, r2, 1 - strh r0, [r3, 0xE] -_081485DA: - movs r5, 0 - ldr r7, =0x02038c28 - movs r1, 0xA0 - lsls r1, 1 - adds r1, r7 - mov r12, r1 - mov r6, r8 -_081485E8: - lsls r0, r5, 1 - adds r2, r0, r7 - mov r1, r12 - adds r4, r0, r1 - movs r0, 0x1 - ands r0, r5 - cmp r0, 0 - beq _08148618 - ldr r1, [r6] - ldrh r0, [r3, 0xA] - ldrh r1, [r1, 0x14] - adds r0, r1 - strh r0, [r2] - ldrh r1, [r3, 0xA] - movs r0, 0xF0 - subs r0, r1 - b _0814862A - .pool -_08148618: - ldr r0, [r6] - ldrh r0, [r0, 0x14] - ldrh r1, [r3, 0xA] - subs r0, r1 - strh r0, [r2] - ldrh r0, [r3, 0xA] - lsls r0, 8 - movs r1, 0xF1 - orrs r0, r1 -_0814862A: - strh r0, [r4] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x9F - bls _081485E8 - movs r1, 0xA - ldrsh r0, [r3, r1] - cmp r0, 0xEF - ble _08148644 - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] -_08148644: - mov r1, r8 - ldr r0, [r1] - ldrb r1, [r0] - adds r1, 0x1 - ldrb r2, [r0] - strb r1, [r0] - movs r0, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8148590 - - thumb_func_start sub_814865C -sub_814865C: @ 814865C - push {lr} - ldr r1, =0x040000b0 - ldrh r2, [r1, 0xA] - ldr r0, =0x0000c5ff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r2, [r1, 0xA] - ldr r0, =0x00007fff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r0, [r1, 0xA] - bl sub_8149F84 - ldr r0, =sub_81484D0 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_814865C - - thumb_func_start sub_814869C -sub_814869C: @ 814869C - push {r4,lr} - ldr r4, =0x040000b0 - ldrh r1, [r4, 0xA] - ldr r0, =0x0000c5ff - ands r0, r1 - strh r0, [r4, 0xA] - ldrh r1, [r4, 0xA] - ldr r0, =0x00007fff - ands r0, r1 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xA] - bl sub_8149F2C - ldr r2, =0x04000048 - ldr r0, =0x0203aba0 - ldr r1, [r0] - ldrh r0, [r1, 0x2] - strh r0, [r2] - adds r2, 0x2 - ldrh r0, [r1, 0x4] - strh r0, [r2] - subs r2, 0x6 - ldrh r0, [r1, 0x8] - strh r0, [r2] - ldrb r0, [r1] - cmp r0, 0 - beq _081486E6 - ldr r1, =0x040000d4 - ldr r0, =0x02038c28 - str r0, [r1] - movs r2, 0xF0 - lsls r2, 3 - adds r0, r2 - str r0, [r1, 0x4] - ldr r0, =0x80000140 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] -_081486E6: - ldr r0, =0x020394e8 - str r0, [r4] - ldr r0, =0x04000040 - str r0, [r4, 0x4] - ldr r0, =0xa2400001 - str r0, [r4, 0x8] - ldr r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814869C - - thumb_func_start sub_8148728 -sub_8148728: @ 8148728 - push {lr} - ldr r2, =0x04000006 - ldrh r0, [r2] - cmp r0, 0x9F - bhi _0814874E - ldr r1, =0x02038c28 - ldrh r0, [r2] - lsls r0, 1 - movs r2, 0xF0 - lsls r2, 3 - adds r1, r2 - adds r0, r1 - ldrh r1, [r0] - ldr r0, =0x04000014 - strh r1, [r0] - adds r0, 0x4 - strh r1, [r0] - adds r0, 0x4 - strh r1, [r0] -_0814874E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8148728 - - thumb_func_start sub_8148760 -sub_8148760: @ 8148760 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8C54 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_08148772: - 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 _08148772 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8148760 - - thumb_func_start sub_8148798 -sub_8148798: @ 8148798 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r6, r0, 0 - bl sub_8149F08 - bl dp12_8087EA4 - ldr r0, =0x0203aba0 - ldr r1, [r0] - movs r2, 0 - movs r0, 0x3F - strh r0, [r1, 0x2] - strh r2, [r1, 0x4] - movs r0, 0xA0 - strh r0, [r1, 0x8] - movs r4, 0 - ldr r5, =0x02038c28 - movs r0, 0xF0 - lsls r0, 3 - adds r0, r5 - mov r12, r0 - mov r8, r4 - movs r1, 0xF0 - mov r9, r1 -_081487CC: - lsls r2, r4, 1 - mov r7, r12 - adds r1, r2, r7 - ldr r0, =0x0203aba0 - ldr r3, [r0] - ldrh r0, [r3, 0x14] - strh r0, [r1] - adds r1, r4, 0 - adds r1, 0xA0 - lsls r1, 1 - adds r0, r1, r7 - mov r7, r9 - strh r7, [r0] - adds r2, r5 - ldrh r0, [r3, 0x14] - strh r0, [r2] - adds r1, r5 - mov r0, r9 - strh r0, [r1] - movs r1, 0xA0 - lsls r1, 1 - adds r0, r4, r1 - lsls r0, 1 - adds r0, r5 - mov r7, r8 - strh r7, [r0] - adds r1, 0xA0 - adds r0, r4, r1 - lsls r0, 1 - adds r0, r5 - subs r1, 0xE0 - strh r1, [r0] - movs r7, 0xA0 - lsls r7, 2 - adds r0, r4, r7 - lsls r0, 1 - adds r0, r5 - movs r1, 0x1 - strh r1, [r0] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x9F - bls _081487CC - movs r0, 0 - strh r0, [r6, 0x10] - strh r0, [r6, 0x12] - movs r0, 0x7 - strh r0, [r6, 0x14] - movs r0, 0x2 - bl EnableInterrupts - ldr r0, =sub_814869C - bl SetVBlankCallback - ldr r0, =sub_8148728 - bl SetHBlankCallback - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - movs r0, 0x1 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8148798 - - thumb_func_start sub_8148864 -sub_8148864: @ 8148864 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - mov r9, r0 - ldr r1, =gUnknown_085C8C64 - mov r0, sp - movs r2, 0x2 - bl memcpy - add r4, sp, 0x4 - ldr r1, =gUnknown_085C8C66 - adds r0, r4, 0 - movs r2, 0x4 - bl memcpy - ldr r2, =0x0203aba0 - ldr r1, [r2] - ldrb r0, [r1] - movs r0, 0 - strb r0, [r1] - str r0, [sp, 0x8] - mov r10, r0 - mov r1, r9 - movs r3, 0x12 - ldrsh r0, [r1, r3] - ldr r1, [sp, 0x8] - cmp r1, r0 - ble _081488A4 - b _08148A68 -_081488A4: - movs r7, 0 - mov r2, r10 - negs r2, r2 - str r2, [sp, 0xC] - mov r3, r10 - adds r3, 0x1 - str r3, [sp, 0x10] -_081488B2: - movs r6, 0 - mov r0, sp - adds r0, r7 - mov r12, r0 -_081488BA: - lsls r0, r6, 1 - add r0, sp - adds r0, 0x4 - movs r1, 0 - ldrsh r0, [r0, r1] - ldr r2, [sp, 0xC] - muls r0, r2 - lsls r0, 1 - mov r3, r12 - ldrb r3, [r3] - adds r0, r3 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, 0 - blt _08148966 - cmp r0, 0x4F - bne _081488E2 - cmp r7, 0x1 - beq _08148966 -_081488E2: - lsls r1, r0, 1 - ldr r0, =0x02038ea8 - adds r4, r1, r0 - movs r2, 0xA0 - lsls r2, 1 - adds r0, r2 - adds r3, r1, r0 - ldr r0, =0x02039128 - adds r1, r0 - ldrh r2, [r4] - cmp r2, 0xEF - bls _08148920 - movs r1, 0xF0 - strh r1, [r4] - ldr r0, [sp, 0x8] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - b _08148940 - .pool -_08148920: - ldrh r0, [r3] - lsrs r0, 8 - adds r0, r2, r0 - strh r0, [r4] - ldrh r0, [r1] - cmp r0, 0x7F - bhi _08148932 - lsls r0, 1 - strh r0, [r1] -_08148932: - ldrh r2, [r3] - ldr r0, =0x00000fff - cmp r2, r0 - bhi _08148940 - ldrh r0, [r1] - adds r0, r2, r0 - strh r0, [r3] -_08148940: - lsls r0, r5, 16 - asrs r0, 15 - ldr r1, =0x02038c28 - adds r2, r0, r1 - ldr r1, =0x02038d68 - adds r3, r0, r1 - ldr r0, =0x0203aba0 - ldr r1, [r0] - ldrh r0, [r4] - ldrh r1, [r1, 0x14] - adds r0, r1 - strh r0, [r2] - ldrh r0, [r4] - movs r1, 0xF0 - subs r0, r1, r0 - strh r0, [r3] - mov r2, r10 - cmp r2, 0 - beq _08148970 -_08148966: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x1 - bls _081488BA -_08148970: - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, 0x1 - bls _081488B2 - movs r7, 0 - ldr r3, =0x02038ea8 - mov r8, r3 -_08148980: - movs r6, 0 - mov r0, sp - adds r0, r7 - mov r12, r0 - adds r1, r7, 0x1 - str r1, [sp, 0x14] -_0814898C: - mov r2, r12 - ldrb r1, [r2] - adds r1, 0x1 - lsls r0, r6, 1 - add r0, sp - adds r0, 0x4 - movs r3, 0 - ldrsh r0, [r0, r3] - ldr r2, [sp, 0xC] - muls r0, r2 - lsls r0, 1 - adds r1, r0 - lsls r1, 16 - lsrs r5, r1, 16 - asrs r1, 16 - cmp r1, 0xA0 - bgt _08148A40 - cmp r1, 0x50 - bne _081489B6 - cmp r7, 0x1 - beq _08148A40 -_081489B6: - lsls r1, 1 - mov r3, r8 - adds r4, r1, r3 - movs r0, 0xA0 - lsls r0, 1 - add r0, r8 - adds r3, r1, r0 - ldr r0, =0x02039128 - adds r1, r0 - ldrh r2, [r4] - cmp r2, 0xEF - bls _081489F8 - movs r1, 0xF0 - strh r1, [r4] - ldr r0, [sp, 0x8] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - b _08148A18 - .pool -_081489F8: - ldrh r0, [r3] - lsrs r0, 8 - adds r0, r2, r0 - strh r0, [r4] - ldrh r0, [r1] - cmp r0, 0x7F - bhi _08148A0A - lsls r0, 1 - strh r0, [r1] -_08148A0A: - ldrh r2, [r3] - ldr r0, =0x00000fff - cmp r2, r0 - bhi _08148A18 - ldrh r0, [r1] - adds r0, r2, r0 - strh r0, [r3] -_08148A18: - lsls r0, r5, 16 - asrs r0, 15 - ldr r1, =0x02038c28 - adds r2, r0, r1 - ldr r1, =0x02038d68 - adds r3, r0, r1 - ldr r1, =0x0203aba0 - ldr r0, [r1] - ldrh r1, [r0, 0x14] - ldrh r0, [r4] - subs r1, r0 - strh r1, [r2] - ldrh r0, [r4] - lsls r0, 8 - movs r1, 0xF1 - orrs r0, r1 - strh r0, [r3] - mov r2, r10 - cmp r2, 0 - beq _08148A4A -_08148A40: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x1 - bls _0814898C -_08148A4A: - ldr r3, [sp, 0x14] - lsls r0, r3, 16 - lsrs r7, r0, 16 - cmp r7, 0x1 - bls _08148980 - ldr r1, [sp, 0x10] - lsls r0, r1, 16 - lsrs r0, 16 - mov r10, r0 - mov r2, r9 - movs r3, 0x12 - ldrsh r0, [r2, r3] - cmp r10, r0 - bgt _08148A68 - b _081488A4 -_08148A68: - mov r1, r9 - ldrh r0, [r1, 0x10] - subs r0, 0x1 - strh r0, [r1, 0x10] - lsls r0, 16 - cmp r0, 0 - bge _08148A7A - movs r0, 0 - strh r0, [r1, 0x10] -_08148A7A: - mov r2, r9 - movs r3, 0x10 - ldrsh r0, [r2, r3] - cmp r0, 0 - bgt _08148A98 - movs r1, 0x12 - ldrsh r0, [r2, r1] - adds r0, 0x1 - cmp r0, 0x14 - bgt _08148A98 - ldrh r0, [r2, 0x14] - strh r0, [r2, 0x10] - ldrh r0, [r2, 0x12] - adds r0, 0x1 - strh r0, [r2, 0x12] -_08148A98: - ldr r2, [sp, 0x8] - cmp r2, 0x9F - bls _08148AA6 - mov r3, r9 - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] -_08148AA6: - ldr r0, =0x0203aba0 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - ldrb r2, [r1] - strb r0, [r1] - movs r0, 0 - 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_8148864 - - thumb_func_start sub_8148AD4 -sub_8148AD4: @ 8148AD4 - push {r4,r5,lr} - adds r3, r0, 0 - movs r2, 0x1 - ldr r5, =0x0000ff10 - movs r1, 0 - ldr r4, =0x020393a8 -_08148AE0: - lsls r0, r1, 1 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0xF0 - beq _08148AF0 - cmp r0, r5 - beq _08148AF0 - movs r2, 0 -_08148AF0: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x9F - bls _08148AE0 - cmp r2, 0x1 - bne _08148B04 - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] -_08148B04: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8148AD4 - - thumb_func_start sub_8148B14 -sub_8148B14: @ 8148B14 - push {lr} - ldr r1, =0x040000b0 - ldrh r2, [r1, 0xA] - ldr r0, =0x0000c5ff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r2, [r1, 0xA] - ldr r0, =0x00007fff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r0, [r1, 0xA] - bl sub_8149F84 - ldr r0, =sub_8148760 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8148B14 - - thumb_func_start sub_8148B54 -sub_8148B54: @ 8148B54 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8C6C - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_08148B66: - 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 _08148B66 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8148B54 - - thumb_func_start sub_8148B8C -sub_8148B8C: @ 8148B8C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8C78 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_08148B9E: - 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 _08148B9E - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8148B8C - - thumb_func_start sub_8148BC4 -sub_8148BC4: @ 8148BC4 - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_8149F08 - bl dp12_8087EA4 - ldr r0, =0x0203aba0 - ldr r1, [r0] - movs r0, 0 - strh r0, [r1, 0x2] - movs r0, 0x3F - strh r0, [r1, 0x4] - movs r0, 0xF0 - strh r0, [r1, 0x6] - movs r0, 0xA0 - strh r0, [r1, 0x8] - ldr r0, =0x02038c28 - movs r2, 0 - movs r1, 0x9F - ldr r3, =0x000008be - adds r0, r3 -_08148BEE: - strh r2, [r0] - subs r0, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _08148BEE - movs r4, 0 - ldr r0, =sub_8146F68 - bl SetVBlankCallback - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0x1 - strh r0, [r5, 0xA] - adds r0, 0xFF - strh r0, [r5, 0xC] - strh r4, [r5, 0x16] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8148BC4 - - thumb_func_start sub_8148C28 -sub_8148C28: @ 8148C28 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x16 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _08148C6C - ldr r1, =0x040000b0 - ldrh r2, [r1, 0xA] - ldr r0, =0x0000c5ff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r2, [r1, 0xA] - ldr r0, =0x00007fff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r0, [r1, 0xA] - movs r0, 0 - bl SetVBlankCallback - ldr r0, [r4] - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - b _08148CDE - .pool -_08148C6C: - ldr r5, =0x0203aba0 - ldr r1, [r5] - ldrb r0, [r1] - movs r0, 0 - strb r0, [r1] - ldrh r2, [r4, 0xC] - movs r0, 0xC - ldrsh r1, [r4, r0] - ldr r0, =0x000003ff - cmp r1, r0 - bgt _08148C88 - adds r0, r2, 0 - adds r0, 0x80 - strh r0, [r4, 0xC] -_08148C88: - ldrh r1, [r4, 0xA] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0x9F - bgt _08148C9C - ldrh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 24 - adds r0, r1, r0 - strh r0, [r4, 0xA] -_08148C9C: - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0xA0 - ble _08148CA8 - movs r0, 0xA0 - strh r0, [r4, 0xA] -_08148CA8: - ldr r0, =0x02038c28 - movs r2, 0xA - ldrsh r3, [r4, r2] - movs r1, 0x78 - movs r2, 0x50 - bl sub_814A014 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0xA0 - bne _08148CD4 - movs r0, 0x1 - strh r0, [r4, 0x16] - bl sub_8149F84 - b _08148CDE - .pool -_08148CD4: - ldr r0, [r5] - ldrb r1, [r0] - adds r1, 0x1 - ldrb r2, [r0] - strb r1, [r0] -_08148CDE: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8148C28 - - thumb_func_start sub_8148CE8 -sub_8148CE8: @ 8148CE8 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r6, =0x0203aba0 - ldr r0, [r6] - ldrb r1, [r0] - movs r5, 0 - strb r5, [r0] - ldrh r1, [r4, 0x16] - movs r2, 0x16 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _08148D0A - adds r0, r1, 0x1 - strh r0, [r4, 0x16] - movs r0, 0x30 - strh r0, [r4, 0xA] - strh r5, [r4, 0x14] -_08148D0A: - ldr r1, =gUnknown_085C8C80 - movs r2, 0x14 - ldrsh r0, [r4, r2] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - ldrh r1, [r4, 0xA] - adds r0, r1 - strh r0, [r4, 0xA] - movs r2, 0x14 - ldrsh r1, [r4, r2] - adds r1, 0x1 - lsrs r0, r1, 31 - adds r0, r1, r0 - asrs r0, 1 - lsls r0, 1 - subs r1, r0 - strh r1, [r4, 0x14] - ldr r0, =0x02038c28 - movs r1, 0xA - ldrsh r3, [r4, r1] - movs r1, 0x78 - movs r2, 0x50 - bl sub_814A014 - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0x8 - bgt _08148D4C - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - strh r5, [r4, 0x16] -_08148D4C: - ldr r0, [r6] - ldrb r1, [r0] - adds r1, 0x1 - ldrb r2, [r0] - strb r1, [r0] - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8148CE8 - - thumb_func_start sub_8148D6C -sub_8148D6C: @ 8148D6C - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0203aba0 - ldr r1, [r0] - ldrb r0, [r1] - movs r0, 0 - strb r0, [r1] - ldrh r1, [r4, 0x16] - movs r2, 0x16 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _08148D8E - adds r0, r1, 0x1 - strh r0, [r4, 0x16] - movs r0, 0x2 - strh r0, [r4, 0x12] - strh r0, [r4, 0x14] -_08148D8E: - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0xA0 - ble _08148D9A - movs r0, 0xA0 - strh r0, [r4, 0xA] -_08148D9A: - ldr r0, =0x02038c28 - movs r2, 0xA - ldrsh r3, [r4, r2] - movs r1, 0x78 - movs r2, 0x50 - bl sub_814A014 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0xA0 - bne _08148DD6 - ldr r1, =0x040000b0 - ldrh r2, [r1, 0xA] - ldr r0, =0x0000c5ff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r2, [r1, 0xA] - ldr r0, =0x00007fff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r0, [r1, 0xA] - bl sub_8149F84 - ldr r0, [r4] - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_08148DD6: - ldrh r2, [r4, 0x12] - ldrb r0, [r4, 0x12] - cmp r0, 0x80 - bgt _08148DFC - ldrh r1, [r4, 0x14] - adds r0, r2, 0 - adds r0, 0x8 - b _08148E08 - .pool -_08148DFC: - ldrh r0, [r4, 0x14] - subs r0, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - adds r0, r2, 0 - adds r0, 0x10 -_08148E08: - strh r0, [r4, 0x12] - movs r0, 0xFF - ands r2, r0 - lsls r1, 16 - asrs r1, 16 - adds r0, r2, 0 - bl sine - ldrh r2, [r4, 0xA] - adds r0, r2 - strh r0, [r4, 0xA] - lsls r0, 16 - cmp r0, 0 - bgt _08148E28 - movs r0, 0x1 - strh r0, [r4, 0xA] -_08148E28: - ldrh r0, [r4, 0x12] - lsls r1, r0, 16 - asrs r0, r1, 16 - cmp r0, 0xFE - ble _08148E3C - asrs r0, r1, 24 - strh r0, [r4, 0x12] - ldrh r0, [r4, 0x14] - adds r0, 0x1 - strh r0, [r4, 0x14] -_08148E3C: - ldr r0, =0x0203aba0 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - ldrb r2, [r1] - strb r0, [r1] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8148D6C - - thumb_func_start sub_8148E54 -sub_8148E54: @ 8148E54 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8C84 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_08148E66: - 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 _08148E66 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8148E54 - - thumb_func_start sub_8148E8C -sub_8148E8C: @ 8148E8C - push {r4,r5,lr} - sub sp, 0xC - adds r5, r0, 0 - add r0, sp, 0x4 - add r1, sp, 0x8 - bl sub_8149F58 - ldr r4, =gUnknown_085BACD0 - ldr r1, [sp, 0x8] - adds r0, r4, 0 - movs r2, 0x10 - bl CpuSet - movs r0, 0xE0 - lsls r0, 1 - adds r4, r0 - ldr r1, [sp, 0x8] - adds r1, 0x40 - adds r0, r4, 0 - movs r2, 0x10 - bl CpuSet - mov r1, sp - movs r2, 0xF0 - lsls r2, 8 - adds r0, r2, 0 - strh r0, [r1] - ldr r1, [sp, 0x4] - ldr r2, =0x01000400 - mov r0, sp - bl CpuSet - ldr r0, =gFieldEffectObjectPalette10 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - movs r1, 0 - movs r4, 0x1 - movs r0, 0x1 - strh r0, [r5, 0xE] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - ldr r5, =0x03001210 - strb r1, [r5] - ldr r0, =0x0000ffff - strh r0, [r5, 0x2] - strb r4, [r5, 0x4] - movs r2, 0x9A - lsls r2, 1 - strh r2, [r5, 0x6] - strb r1, [r5, 0x8] - strb r1, [r5, 0xC] - movs r0, 0x1 - negs r0, r0 - strh r0, [r5, 0xE] - strb r4, [r5, 0x10] - strh r2, [r5, 0x12] - strb r1, [r5, 0x14] - strb r1, [r5, 0x18] - ldr r2, =0x0000fffd - strh r2, [r5, 0x1A] - strb r4, [r5, 0x1C] - ldr r3, =0x00000133 - strh r3, [r5, 0x1E] - adds r0, r5, 0 - adds r0, 0x20 - strb r1, [r0] - adds r0, 0x4 - strb r1, [r0] - strh r2, [r5, 0x26] - adds r0, 0x4 - strb r4, [r0] - strh r3, [r5, 0x2A] - adds r0, 0x4 - strb r1, [r0] - movs r0, 0 - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8148E8C - - thumb_func_start sub_8148F4C -sub_8148F4C: @ 8148F4C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - mov r8, r0 - movs r7, 0x1 - add r1, sp, 0x4 - mov r0, sp - bl sub_8149F58 - movs r0, 0 -_08148F62: - movs r5, 0 - adds r6, r0, 0x1 -_08148F66: - ldr r1, =gUnknown_085C8D38 - lsrs r0, r5, 1 - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - ldr r2, =0x03001210 - adds r4, r1, r2 - adds r1, r4, 0 - bl sub_8149048 - lsls r0, 16 - cmp r0, 0 - beq _08148FCA - movs r7, 0 - ldrh r2, [r4, 0x2] - movs r0, 0x1 - ands r0, r5 - cmp r0, 0x1 - bne _08148FA0 - ldr r0, =0x0000027d - adds r1, r0, 0 - lsls r0, r2, 16 - asrs r0, 16 - subs r1, r0 - lsls r1, 16 - lsrs r2, r1, 16 -_08148FA0: - lsls r0, r2, 16 - asrs r1, r0, 16 - adds r0, r1, 0 - cmp r1, 0 - bge _08148FAC - adds r0, 0x1F -_08148FAC: - asrs r2, r0, 5 - lsls r0, r2, 5 - subs r0, r1, r0 - lsls r0, 16 - lsrs r0, 16 - lsls r1, r2, 5 - lsls r0, 16 - asrs r0, 16 - adds r1, r0 - ldr r0, [sp] - lsls r1, 1 - adds r1, r0 - ldr r2, =0x0000f002 - adds r0, r2, 0 - strh r0, [r1] -_08148FCA: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x3 - bls _08148F66 - lsls r0, r6, 24 - lsrs r0, 24 - cmp r0, 0x1 - bls _08148F62 - cmp r7, 0x1 - bne _08148FE8 - mov r1, r8 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_08148FE8: - movs r0, 0 - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8148F4C - - thumb_func_start sub_8149008 -sub_8149008: @ 8149008 - push {r4,lr} - adds r4, r0, 0 - ldr r1, =0x040000b0 - ldrh r2, [r1, 0xA] - ldr r0, =0x0000c5ff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r2, [r1, 0xA] - ldr r0, =0x00007fff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r0, [r1, 0xA] - bl sub_8149F84 - ldr r0, [r4] - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8149008 - - thumb_func_start sub_8149048 -sub_8149048: @ 8149048 - push {r4,lr} - adds r2, r1, 0 - ldrb r1, [r2] - lsls r1, 2 - adds r1, r0 - ldr r3, [r1] - ldrb r0, [r2, 0x4] - lsls r0, 1 - adds r0, r3 - movs r4, 0 - ldrsh r1, [r0, r4] - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _081490CE - ldr r1, =0x03001208 - ldrh r0, [r3] - strh r0, [r1] - ldrh r0, [r3, 0x2] - strh r0, [r1] - ldrh r0, [r3, 0x4] - strh r0, [r1] - ldrh r0, [r3, 0x6] - strh r0, [r1] - movs r1, 0 - ldrsh r0, [r3, r1] - cmp r0, 0x2 - beq _081490A0 - cmp r0, 0x2 - bgt _08149090 - cmp r0, 0x1 - beq _0814909A - b _081490B2 - .pool -_08149090: - cmp r0, 0x3 - beq _081490A6 - cmp r0, 0x4 - beq _081490AC - b _081490B2 -_0814909A: - ldrh r0, [r2, 0x2] - adds r0, 0x1 - b _081490B0 -_081490A0: - ldrh r0, [r2, 0x2] - subs r0, 0x1 - b _081490B0 -_081490A6: - ldrh r0, [r2, 0x2] - subs r0, 0x20 - b _081490B0 -_081490AC: - ldrh r0, [r2, 0x2] - adds r0, 0x20 -_081490B0: - strh r0, [r2, 0x2] -_081490B2: - movs r4, 0x2 - ldrsh r1, [r2, r4] - ldr r0, =0x0000027f - cmp r1, r0 - bgt _081490CE - ldrb r0, [r2, 0x4] - lsls r0, 1 - adds r0, r3 - movs r4, 0 - ldrsh r1, [r0, r4] - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _081490D8 -_081490CE: - movs r0, 0 - b _08149138 - .pool -_081490D8: - ldrb r0, [r2, 0x8] - cmp r0, 0 - bne _081490F4 - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - bne _081490F4 - movs r0, 0x1 - strb r0, [r2, 0x8] - strb r0, [r2, 0x4] - ldrh r0, [r2, 0x6] - strh r0, [r2, 0x2] - movs r0, 0x4 - strb r0, [r2] -_081490F4: - ldrb r0, [r2, 0x4] - lsls r0, 1 - adds r0, r3 - movs r3, 0x2 - ldrsh r1, [r2, r3] - movs r4, 0 - ldrsh r0, [r0, r4] - cmp r1, r0 - bne _08149136 - ldrb r0, [r2] - adds r1, r0, 0x1 - strb r1, [r2] - ldrb r0, [r2, 0x8] - cmp r0, 0x1 - bne _08149124 - lsls r0, r1, 24 - lsrs r0, 24 - cmp r0, 0x7 - bls _08149136 - ldrb r0, [r2, 0x4] - adds r0, 0x1 - strb r0, [r2, 0x4] - movs r0, 0x4 - b _08149134 -_08149124: - lsls r0, r1, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _08149136 - ldrb r0, [r2, 0x4] - adds r0, 0x1 - strb r0, [r2, 0x4] - movs r0, 0 -_08149134: - strb r0, [r2] -_08149136: - movs r0, 0x1 -_08149138: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8149048 - - thumb_func_start sub_8149140 -sub_8149140: @ 8149140 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8D40 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_08149152: - 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 _08149152 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8149140 - - thumb_func_start sub_8149178 -sub_8149178: @ 8149178 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - add r0, sp, 0x4 - add r1, sp, 0x8 - bl sub_8149F58 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, [sp, 0x4] - ldr r2, =0x01000400 - mov r0, sp - bl CpuSet - ldr r0, =gUnknown_085BE51C - ldr r1, [sp, 0x8] - bl LZ77UnCompVram - ldr r0, =gUnknown_085BEA88 - ldr r1, [sp, 0x4] - bl LZ77UnCompVram - ldrh r0, [r4, 0x8] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x8] - strh r1, [r4, 0xA] - movs r0, 0 - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8149178 - - thumb_func_start sub_81491C8 -sub_81491C8: @ 81491C8 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xA - ldrsh r5, [r4, r0] - adds r0, r5, 0 - movs r1, 0x3 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _08149200 - adds r0, r5, 0 - movs r1, 0x1E - bl __modsi3 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x3 - bl __divsi3 - lsls r0, 16 - lsrs r0, 11 - ldr r1, =gUnknown_085BF0A0 - adds r0, r1 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply -_08149200: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3A - ble _08149218 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - strh r0, [r4, 0xA] -_08149218: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81491C8 - - thumb_func_start sub_8149224 -sub_8149224: @ 8149224 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xA - ldrsh r5, [r4, r0] - adds r0, r5, 0 - movs r1, 0x5 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _08149252 - adds r0, r5, 0 - movs r1, 0x5 - bl __divsi3 - lsls r0, 16 - asrs r0, 11 - ldr r1, =gUnknown_085BF2A0 - adds r0, r1 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply -_08149252: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x44 - ble _0814926E - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - strh r0, [r4, 0xA] - movs r0, 0x1E - strh r0, [r4, 0x18] -_0814926E: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8149224 - - thumb_func_start sub_814927C -sub_814927C: @ 814927C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8D60 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0814928E: - 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 _0814928E - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814927C - - thumb_func_start sub_81492B4 -sub_81492B4: @ 81492B4 - push {r4-r6,lr} - sub sp, 0xC - adds r4, r0, 0 - bl sub_8149F08 - bl dp12_8087EA4 - ldr r1, =0x00009a08 - movs r0, 0x8 - bl SetGpuReg - add r0, sp, 0x4 - add r1, sp, 0x8 - bl sub_8149F58 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, [sp, 0x4] - ldr r2, =0x01000400 - mov r0, sp - bl CpuSet - ldr r0, =gUnknown_085BF6A0 - ldr r1, [sp, 0x8] - movs r2, 0x80 - lsls r2, 5 - bl CpuSet - ldr r0, =0x0203aba0 - ldr r1, [r0] - movs r0, 0 - strh r0, [r1, 0x20] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - ldr r0, =gUnknown_085BF540 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - movs r2, 0 - ldr r3, =0x02038c28 - movs r6, 0 - movs r0, 0xF0 - lsls r0, 3 - adds r5, r3, r0 - movs r4, 0x80 - lsls r4, 1 -_08149316: - lsls r1, r2, 1 - adds r0, r1, r3 - strh r6, [r0] - adds r1, r5 - strh r4, [r1] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x9F - bls _08149316 - ldr r0, =sub_8149508 - bl SetVBlankCallback - movs r0, 0 - add sp, 0xC - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81492B4 - - thumb_func_start sub_8149358 -sub_8149358: @ 8149358 - push {r4,lr} - sub sp, 0x8 - adds r4, r0, 0 - add r1, sp, 0x4 - mov r0, sp - bl sub_8149F58 - ldr r0, =gUnknown_085C6BE0 - ldr r1, [sp] - movs r2, 0x80 - lsls r2, 4 - bl CpuSet - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8149358 - - thumb_func_start sub_8149388 -sub_8149388: @ 8149388 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0xA] - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _081493B4 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _081493A0 - adds r0, 0x3 -_081493A0: - lsls r0, 14 - lsrs r0, 16 - adds r0, 0x5 - lsls r0, 5 - ldr r1, =gUnknown_085BF4A0 - adds r0, r1 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply -_081493B4: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x28 - ble _081493CC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - strh r0, [r4, 0xA] -_081493CC: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8149388 - - thumb_func_start sub_81493D8 -sub_81493D8: @ 81493D8 - push {lr} - sub sp, 0x4 - adds r1, r0, 0 - ldrh r0, [r1, 0xA] - adds r0, 0x1 - movs r2, 0 - strh r0, [r1, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _08149402 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - strh r2, [r1, 0xA] - ldr r0, =0xffff8000 - str r2, [sp] - movs r1, 0x2 - movs r3, 0x10 - bl pal_fade_maybe -_08149402: - movs r0, 0 - add sp, 0x4 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81493D8 - - thumb_func_start sub_8149410 -sub_8149410: @ 8149410 - push {lr} - adds r2, r0, 0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0814942E - ldr r0, =0x0203aba0 - ldr r1, [r0] - movs r0, 0x1 - strh r0, [r1, 0x20] - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] -_0814942E: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8149410 - - thumb_func_start sub_814943C -sub_814943C: @ 814943C - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x00007fff - movs r1, 0x8 - movs r2, 0 - bl sub_80A2A20 - ldr r0, =0xffff8000 - movs r1, 0 - movs r2, 0 - bl sub_80A2A20 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814943C - - thumb_func_start sub_814946C -sub_814946C: @ 814946C - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xA - ldrsh r5, [r4, r0] - adds r0, r5, 0 - movs r1, 0x3 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _0814949A - adds r0, r5, 0 - movs r1, 0x3 - bl __divsi3 - lsls r0, 16 - lsrs r0, 11 - ldr r1, =gUnknown_085BF4A0 - adds r0, r1 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply -_0814949A: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x27 - ble _081494F0 - ldr r0, =0x0203aba0 - ldr r1, [r0] - movs r0, 0 - strh r0, [r1, 0x2] - movs r0, 0x3F - strh r0, [r1, 0x4] - movs r0, 0xF0 - strh r0, [r1, 0x6] - movs r0, 0xA0 - strh r0, [r1, 0x8] - movs r1, 0 - ldr r5, =sub_8146F68 - ldr r3, =0x020393a8 - movs r2, 0 -_081494C4: - lsls r0, r1, 1 - adds r0, r3 - strh r2, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x9F - bls _081494C4 - adds r0, r5, 0 - bl SetVBlankCallback - ldrh r0, [r4, 0x8] - adds r0, 0x1 - movs r2, 0 - strh r0, [r4, 0x8] - movs r1, 0x80 - lsls r1, 1 - strh r1, [r4, 0xC] - strh r2, [r4, 0x16] - movs r0, 0 - bl ClearGpuRegBits -_081494F0: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814946C - - thumb_func_start sub_8149508 -sub_8149508: @ 8149508 - push {lr} - ldr r1, =0x040000b0 - ldrh r2, [r1, 0xA] - ldr r0, =0x0000c5ff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r2, [r1, 0xA] - ldr r0, =0x00007fff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r0, [r1, 0xA] - bl sub_8149F2C - ldr r0, =0x0203aba0 - ldr r0, [r0] - movs r1, 0x20 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08149548 - ldr r2, =0x02038c28 - b _08149554 - .pool -_08149548: - ldr r2, =0x02038c28 - cmp r0, 0x1 - bne _08149554 - movs r0, 0xF0 - lsls r0, 3 - adds r2, r0 -_08149554: - ldr r1, =0x040000b0 - str r2, [r1] - ldr r0, =0x04000012 - str r0, [r1, 0x4] - ldr r0, =0xa2400001 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8149508 - - thumb_func_start sub_8149578 -sub_8149578: @ 8149578 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8D8C - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0814958A: - 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 _0814958A - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8149578 - - thumb_func_start sub_81495B0 -sub_81495B0: @ 81495B0 - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_8149F08 - bl dp12_8087EA4 - ldr r0, =0x0203aba0 - ldr r1, [r0] - movs r2, 0 - movs r0, 0xBF - strh r0, [r1, 0xE] - strh r2, [r1, 0x12] - movs r0, 0x1E - strh r0, [r1, 0x2] - movs r0, 0x3F - strh r0, [r1, 0x4] - movs r0, 0xA0 - strh r0, [r1, 0x8] - movs r1, 0 - ldr r2, =0x020393a8 - movs r4, 0 - movs r3, 0xF0 -_081495DC: - lsls r0, r1, 1 - adds r0, r2 - strh r4, [r0] - adds r0, r1, 0 - adds r0, 0xA0 - lsls r0, 1 - adds r0, r2 - strh r3, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x9F - bls _081495DC - movs r0, 0x2 - bl EnableInterrupts - ldr r0, =sub_8149840 - bl SetHBlankCallback - ldr r0, =sub_8149774 - bl SetVBlankCallback - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81495B0 - - thumb_func_start sub_8149628 -sub_8149628: @ 8149628 - push {r4-r6,lr} - sub sp, 0x10 - adds r6, r0, 0 - ldr r1, =gUnknown_085C8DA0 - mov r0, sp - movs r2, 0x10 - bl memcpy - movs r5, 0 - movs r4, 0 -_0814963C: - ldr r0, =sub_8149864 - bl obj_add_empty_with_callback - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r2, r1, r0 - movs r0, 0xF0 - strh r0, [r2, 0x20] - strh r4, [r2, 0x22] - lsls r1, r5, 16 - asrs r1, 16 - lsls r0, r1, 1 - add r0, sp - ldrh r0, [r0] - strh r0, [r2, 0x38] - adds r1, 0x1 - lsls r1, 16 - lsls r0, r4, 16 - movs r3, 0xA0 - lsls r3, 13 - adds r0, r3 - lsrs r4, r0, 16 - lsrs r5, r1, 16 - asrs r1, 16 - cmp r1, 0x7 - ble _0814963C - ldrh r0, [r2, 0x3A] - adds r0, 0x1 - strh r0, [r2, 0x3A] - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - movs r0, 0 - add sp, 0x10 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8149628 - - thumb_func_start sub_814969C -sub_814969C: @ 814969C - push {r4,lr} - adds r4, r0, 0 - ldr r2, =0x0203aba0 - ldr r1, [r2] - ldrb r0, [r1] - movs r0, 0 - strb r0, [r1] - ldr r0, [r2] - movs r1, 0x20 - ldrsh r0, [r0, r1] - cmp r0, 0x7 - ble _081496C6 - movs r0, 0x1 - negs r0, r0 - ldr r2, =0x00007fff - movs r1, 0x10 - bl sub_80A2A20 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_081496C6: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814969C - - thumb_func_start sub_81496D8 -sub_81496D8: @ 81496D8 - push {r4-r6,lr} - adds r6, r0, 0 - ldr r4, =0x0203aba0 - ldr r0, [r4] - ldrb r1, [r0] - movs r5, 0 - strb r5, [r0] - ldr r1, =0x040000b0 - ldrh r2, [r1, 0xA] - ldr r0, =0x0000c5ff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r2, [r1, 0xA] - ldr r0, =0x00007fff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r0, [r1, 0xA] - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - bl SetHBlankCallback - ldr r1, [r4] - movs r0, 0xF0 - strh r0, [r1, 0x6] - strh r5, [r1, 0x12] - movs r0, 0xFF - strh r0, [r1, 0xE] - movs r0, 0x3F - strh r0, [r1, 0x2] - ldr r0, =sub_8149804 - bl SetVBlankCallback - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81496D8 - - thumb_func_start sub_8149740 -sub_8149740: @ 8149740 - push {lr} - ldr r0, =0x0203aba0 - ldr r1, [r0] - ldrh r0, [r1, 0x12] - adds r0, 0x1 - strh r0, [r1, 0x12] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x10 - bls _08149766 - bl sub_8149F84 - ldr r0, =sub_8149578 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_08149766: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8149740 - - thumb_func_start sub_8149774 -sub_8149774: @ 8149774 - push {r4,lr} - ldr r4, =0x040000b0 - ldrh r1, [r4, 0xA] - ldr r0, =0x0000c5ff - ands r0, r1 - strh r0, [r4, 0xA] - ldrh r1, [r4, 0xA] - ldr r0, =0x00007fff - ands r0, r1 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xA] - bl sub_8149F2C - ldr r2, =0x04000050 - ldr r0, =0x0203aba0 - ldr r1, [r0] - ldrh r0, [r1, 0xE] - strh r0, [r2] - subs r2, 0x8 - ldrh r0, [r1, 0x2] - strh r0, [r2] - adds r2, 0x2 - ldrh r0, [r1, 0x4] - strh r0, [r2] - subs r2, 0x6 - ldrh r0, [r1, 0x8] - strh r0, [r2] - ldrb r0, [r1] - cmp r0, 0 - beq _081497C4 - ldr r1, =0x040000d4 - ldr r0, =0x02038c28 - str r0, [r1] - movs r2, 0xF0 - lsls r2, 3 - adds r0, r2 - str r0, [r1, 0x4] - ldr r0, =0x80000140 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] -_081497C4: - ldr r0, =0x020394e8 - str r0, [r4] - ldr r0, =0x04000040 - str r0, [r4, 0x4] - ldr r0, =0xa2400001 - str r0, [r4, 0x8] - ldr r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8149774 - - thumb_func_start sub_8149804 -sub_8149804: @ 8149804 - push {lr} - bl sub_8149F2C - ldr r1, =0x04000054 - ldr r0, =0x0203aba0 - ldr r2, [r0] - ldrh r0, [r2, 0x12] - strh r0, [r1] - subs r1, 0x4 - ldrh r0, [r2, 0xE] - strh r0, [r1] - subs r1, 0x8 - ldrh r0, [r2, 0x2] - strh r0, [r1] - adds r1, 0x2 - ldrh r0, [r2, 0x4] - strh r0, [r1] - subs r1, 0xA - ldrh r0, [r2, 0x6] - strh r0, [r1] - adds r1, 0x4 - ldrh r0, [r2, 0x8] - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8149804 - - thumb_func_start sub_8149840 -sub_8149840: @ 8149840 - ldr r2, =0x04000054 - ldr r1, =0x02038c28 - ldr r0, =0x04000006 - ldrh r0, [r0] - lsls r0, 1 - movs r3, 0xF0 - lsls r3, 3 - adds r1, r3 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] - bx lr - .pool - thumb_func_end sub_8149840 - - thumb_func_start sub_8149864 -sub_8149864: @ 8149864 - push {r4-r6,lr} - adds r3, r0, 0 - ldrh r1, [r3, 0x38] - movs r2, 0x38 - ldrsh r0, [r3, r2] - cmp r0, 0 - beq _08149890 - subs r0, r1, 0x1 - strh r0, [r3, 0x38] - movs r1, 0x3A - ldrsh r0, [r3, r1] - cmp r0, 0 - beq _0814994C - ldr r0, =0x0203aba0 - ldr r1, [r0] - ldrb r0, [r1] - movs r0, 0x1 - strb r0, [r1] - b _0814994C - .pool -_08149890: - movs r2, 0x22 - ldrsh r1, [r3, r2] - lsls r1, 1 - ldr r0, =0x02038c28 - adds r6, r1, r0 - movs r2, 0xA0 - lsls r2, 1 - adds r0, r2 - adds r5, r1, r0 - movs r4, 0 -_081498A4: - lsls r1, r4, 1 - adds r2, r1, r6 - ldrh r0, [r3, 0x2E] - lsls r0, 16 - asrs r0, 24 - strh r0, [r2] - adds r1, r5 - ldrh r0, [r3, 0x20] - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x13 - bls _081498A4 - movs r1, 0x20 - ldrsh r0, [r3, r1] - ldrh r2, [r3, 0x20] - cmp r0, 0 - bne _081498DE - movs r0, 0x2E - ldrsh r1, [r3, r0] - movs r0, 0x80 - lsls r0, 5 - cmp r1, r0 - bne _081498DE - movs r0, 0x1 - strh r0, [r3, 0x30] -_081498DE: - adds r1, r2, 0 - subs r1, 0x10 - strh r1, [r3, 0x20] - ldrh r0, [r3, 0x2E] - adds r0, 0x80 - strh r0, [r3, 0x2E] - lsls r1, 16 - cmp r1, 0 - bge _081498F4 - movs r0, 0 - strh r0, [r3, 0x20] -_081498F4: - movs r1, 0x2E - ldrsh r0, [r3, r1] - movs r1, 0x80 - lsls r1, 5 - cmp r0, r1 - ble _08149902 - strh r1, [r3, 0x2E] -_08149902: - movs r2, 0x3A - ldrsh r0, [r3, r2] - cmp r0, 0 - beq _08149914 - ldr r0, =0x0203aba0 - ldr r1, [r0] - ldrb r0, [r1] - movs r0, 0x1 - strb r0, [r1] -_08149914: - movs r1, 0x30 - ldrsh r0, [r3, r1] - cmp r0, 0 - beq _0814994C - movs r2, 0x3A - ldrsh r0, [r3, r2] - ldr r2, =0x0203aba0 - cmp r0, 0 - beq _0814993E - ldr r0, [r2] - movs r1, 0x20 - ldrsh r0, [r0, r1] - cmp r0, 0x6 - ble _0814994C - ldrh r0, [r3, 0x32] - adds r1, r0, 0x1 - strh r1, [r3, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _0814994C -_0814993E: - ldr r1, [r2] - ldrh r0, [r1, 0x20] - adds r0, 0x1 - strh r0, [r1, 0x20] - adds r0, r3, 0 - bl RemoveObjectAndFreeTiles -_0814994C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8149864 - - thumb_func_start sub_814995C -sub_814995C: @ 814995C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8DB0 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0814996E: - 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 _0814996E - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814995C - - thumb_func_start sub_8149994 -sub_8149994: @ 8149994 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - add r0, sp, 0x4 - add r1, sp, 0x8 - bl sub_8149F58 - ldr r0, =gUnknown_085BACD0 - ldr r1, [sp, 0x8] - movs r2, 0x10 - bl CpuSet - mov r1, sp - movs r2, 0xF0 - lsls r2, 8 - adds r0, r2, 0 - strh r0, [r1] - ldr r1, [sp, 0x4] - ldr r2, =0x01000400 - mov r0, sp - bl CpuSet - ldr r0, =gFieldEffectObjectPalette10 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8149994 - - thumb_func_start sub_81499E8 -sub_81499E8: @ 81499E8 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08149A2A - mov r0, sp - bl sub_8149F40 - movs r0, 0x3 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - movs r1, 0xC - ldrsh r0, [r4, r1] - lsls r0, 5 - ldr r1, =gUnknown_085BACD0 - adds r0, r1 - ldr r1, [sp] - movs r2, 0x10 - bl CpuSet - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0xD - ble _08149A2A - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x10 - strh r0, [r4, 0xA] -_08149A2A: - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - movs r0, 0 - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81499E8 - - thumb_func_start sub_8149A40 -sub_8149A40: @ 8149A40 - push {lr} - ldrh r1, [r0, 0xA] - subs r1, 0x1 - strh r1, [r0, 0xA] - lsls r1, 16 - cmp r1, 0 - bne _08149A60 - bl sub_8149F84 - ldr r0, =sub_814995C - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_08149A60: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8149A40 - - thumb_func_start sub_8149A6C -sub_8149A6C: @ 8149A6C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8DBC - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_08149A7E: - 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 _08149A7E - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8149A6C - - thumb_func_start sub_8149AA4 -sub_8149AA4: @ 8149AA4 - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_8149F08 - bl dp12_8087EA4 - ldr r0, =0x0203aba0 - ldr r1, [r0] - movs r2, 0 - movs r0, 0x3F - strh r0, [r1, 0x2] - strh r2, [r1, 0x4] - movs r0, 0xA0 - strh r0, [r1, 0x8] - movs r1, 0 - ldr r2, =0x02038c28 - movs r3, 0xF0 - adds r4, r2, 0 -_08149AC8: - lsls r0, r1, 1 - adds r0, r2 - strh r3, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x9F - bls _08149AC8 - movs r0, 0xF0 - lsls r0, 3 - adds r1, r4, r0 - adds r0, r4, 0 - movs r2, 0xA0 - bl CpuSet - ldr r0, =sub_8149CE8 - bl SetVBlankCallback - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8149AA4 - - thumb_func_start sub_8149B08 -sub_8149B08: @ 8149B08 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0xC - mov r8, r0 - ldr r0, =0x0203aba0 - ldr r0, [r0] - adds r0, 0x24 - ldr r6, =gUnknown_085C8DD0 - mov r2, r8 - movs r3, 0xA - ldrsh r1, [r2, r3] - lsls r4, r1, 2 - adds r4, r1 - lsls r4, 1 - adds r1, r4, r6 - movs r5, 0 - ldrsh r1, [r1, r5] - adds r2, r6, 0x2 - adds r2, r4, r2 - movs r3, 0 - ldrsh r2, [r2, r3] - adds r3, r6, 0x4 - adds r3, r4, r3 - movs r5, 0 - ldrsh r3, [r3, r5] - adds r5, r6, 0x6 - adds r4, r5 - movs r5, 0 - ldrsh r4, [r4, r5] - str r4, [sp] - movs r4, 0x1 - str r4, [sp, 0x4] - str r4, [sp, 0x8] - bl sub_814A1AC - mov r0, r8 - movs r2, 0xA - ldrsh r1, [r0, r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - adds r6, 0x8 - adds r0, r6 - ldrh r0, [r0] - mov r3, r8 - strh r0, [r3, 0xC] - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] - movs r0, 0x1 - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8149B08 - - thumb_func_start sub_8149B84 -sub_8149B84: @ 8149B84 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r6, r0, 0 - ldr r0, =0x0203aba0 - ldr r1, [r0] - ldrb r0, [r1] - movs r0, 0 - strb r0, [r1] - mov r8, r0 - movs r7, 0 - ldr r0, =0x02038c28 - mov r9, r0 -_08149BA0: - ldr r1, =0x02038c28 - ldr r0, =0x0203aba0 - ldr r2, [r0] - movs r3, 0x2A - ldrsh r0, [r2, r3] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - lsrs r3, r0, 8 - movs r5, 0xFF - ands r5, r0 - movs r4, 0xC - ldrsh r0, [r6, r4] - cmp r0, 0 - bne _08149BDC - movs r1, 0x28 - ldrsh r0, [r2, r1] - cmp r3, r0 - bge _08149BC8 - ldrh r3, [r2, 0x28] -_08149BC8: - lsls r0, r3, 16 - lsls r1, r5, 16 - cmp r0, r1 - ble _08149BF4 - lsrs r3, r1, 16 - b _08149BF4 - .pool -_08149BDC: - lsls r0, r5, 16 - asrs r0, 16 - movs r4, 0x28 - ldrsh r1, [r2, r4] - cmp r0, r1 - ble _08149BEA - ldrh r5, [r2, 0x28] -_08149BEA: - lsls r0, r5, 16 - lsls r1, r3, 16 - cmp r0, r1 - bgt _08149BF4 - lsrs r5, r1, 16 -_08149BF4: - ldr r0, =0x0203aba0 - ldr r4, [r0] - movs r0, 0x2A - ldrsh r2, [r4, r0] - lsls r2, 1 - add r2, r9 - lsls r1, r3, 16 - asrs r1, 8 - lsls r0, r5, 16 - asrs r0, 16 - orrs r0, r1 - strh r0, [r2] - cmp r7, 0 - beq _08149C1C - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - b _08149C40 - .pool -_08149C1C: - adds r0, r4, 0 - adds r0, 0x24 - movs r1, 0x1 - movs r2, 0x1 - bl sub_814A228 - lsls r0, 24 - lsrs r7, r0, 24 - mov r1, r8 - lsls r0, r1, 16 - movs r3, 0x80 - lsls r3, 9 - adds r0, r3 - lsrs r4, r0, 16 - mov r8, r4 - asrs r0, 16 - cmp r0, 0xF - ble _08149BA0 -_08149C40: - ldr r0, =0x0203aba0 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - ldrb r2, [r1] - strb r0, [r1] - movs r0, 0 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8149B84 - - thumb_func_start sub_8149C60 -sub_8149C60: @ 8149C60 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0xA] - adds r0, 0x1 - strh r0, [r2, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - ble _08149CAC - ldr r1, =0x040000b0 - ldrh r2, [r1, 0xA] - ldr r0, =0x0000c5ff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r2, [r1, 0xA] - ldr r0, =0x00007fff - ands r0, r2 - strh r0, [r1, 0xA] - ldrh r0, [r1, 0xA] - bl sub_8149F84 - ldr r0, =sub_8149A6C - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - b _08149CC4 - .pool -_08149CAC: - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - ldr r1, =gUnknown_085C8E16 - movs r3, 0xA - ldrsh r0, [r2, r3] - subs r0, 0x1 - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2, 0xE] - movs r0, 0x1 -_08149CC4: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8149C60 - - thumb_func_start sub_8149CCC -sub_8149CCC: @ 8149CCC - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0xE] - subs r0, 0x1 - strh r0, [r1, 0xE] - lsls r0, 16 - cmp r0, 0 - beq _08149CE0 - movs r0, 0 - b _08149CE4 -_08149CE0: - movs r0, 0x1 - strh r0, [r1, 0x8] -_08149CE4: - pop {r1} - bx r1 - thumb_func_end sub_8149CCC - - thumb_func_start sub_8149CE8 -sub_8149CE8: @ 8149CE8 - push {r4,lr} - ldr r4, =0x040000b0 - ldrh r1, [r4, 0xA] - ldr r0, =0x0000c5ff - ands r0, r1 - strh r0, [r4, 0xA] - ldrh r1, [r4, 0xA] - ldr r0, =0x00007fff - ands r0, r1 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xA] - bl sub_8149F2C - ldr r3, =0x0203aba0 - ldr r0, [r3] - ldrb r0, [r0] - cmp r0, 0 - beq _08149D20 - ldr r1, =0x040000d4 - ldr r0, =0x02038c28 - str r0, [r1] - movs r2, 0xF0 - lsls r2, 3 - adds r0, r2 - str r0, [r1, 0x4] - ldr r0, =0x800000a0 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] -_08149D20: - ldr r2, =0x04000048 - ldr r1, [r3] - ldrh r0, [r1, 0x2] - strh r0, [r2] - adds r2, 0x2 - ldrh r0, [r1, 0x4] - strh r0, [r2] - subs r2, 0x6 - ldrh r0, [r1, 0x8] - strh r0, [r2] - subs r2, 0x4 - ldr r0, =0x02038c28 - movs r1, 0xF0 - lsls r1, 3 - adds r0, r1 - ldrh r1, [r0] - strh r1, [r2] - str r0, [r4] - str r2, [r4, 0x4] - ldr r0, =0xa2400001 - str r0, [r4, 0x8] - ldr r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8149CE8 - - thumb_func_start sub_8149D78 -sub_8149D78: @ 8149D78 - 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_8149DFC - movs r1, 0x3 - str r3, [sp] - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - 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_8149D78 - - thumb_func_start sub_8149DDC -sub_8149DDC: @ 8149DDC - push {lr} - ldr r0, =sub_8149DFC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _08149DF4 - movs r0, 0 - b _08149DF6 - .pool -_08149DF4: - movs r0, 0x1 -_08149DF6: - pop {r1} - bx r1 - thumb_func_end sub_8149DDC - - thumb_func_start sub_8149DFC -sub_8149DFC: @ 8149DFC - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C8E24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_08149E0E: - 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 _08149E0E - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8149DFC - - thumb_func_start sub_8149E34 -sub_8149E34: @ 8149E34 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x14] - movs r2, 0x14 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08149E4C - subs r0, r1, 0x1 - strh r0, [r4, 0x14] - lsls r0, 16 - cmp r0, 0 - bne _08149E70 -_08149E4C: - 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 _08149E64 - movs r0, 0x10 - strh r0, [r4, 0x16] -_08149E64: - movs r0, 0x1 - negs r0, r0 - ldrb r1, [r4, 0x16] - ldr r2, =0x00002d6b - bl sub_80A2A20 -_08149E70: - movs r2, 0x16 - ldrsh r0, [r4, r2] - cmp r0, 0xF - ble _08149E82 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - ldrh r0, [r4, 0xC] - strh r0, [r4, 0x14] -_08149E82: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8149E34 - - thumb_func_start sub_8149E90 -sub_8149E90: @ 8149E90 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x14] - movs r2, 0x14 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08149EA8 - subs r0, r1, 0x1 - strh r0, [r4, 0x14] - lsls r0, 16 - cmp r0, 0 - bne _08149ECA -_08149EA8: - 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 _08149EBE - movs r0, 0 - strh r0, [r4, 0x16] -_08149EBE: - movs r0, 0x1 - negs r0, r0 - ldrb r1, [r4, 0x16] - ldr r2, =0x00002d6b - bl sub_80A2A20 -_08149ECA: - movs r0, 0x16 - ldrsh r1, [r4, r0] - cmp r1, 0 - bne _08149EFE - ldrh r0, [r4, 0xE] - subs r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _08149EF8 - ldr r0, =sub_8149DFC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - b _08149EFE - .pool -_08149EF8: - ldrh r0, [r4, 0xA] - strh r0, [r4, 0x14] - strh r1, [r4, 0x8] -_08149EFE: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8149E90 - - thumb_func_start sub_8149F08 -sub_8149F08: @ 8149F08 - push {r4,lr} - ldr r4, =0x0203aba0 - ldr r0, [r4] - movs r1, 0 - movs r2, 0x3C - bl memset - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x14 - adds r1, 0x16 - bl sub_8089C08 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8149F08 - - thumb_func_start sub_8149F2C -sub_8149F2C: @ 8149F2C - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_8149F2C - - thumb_func_start sub_8149F40 -sub_8149F40: @ 8149F40 - ldr r1, =0x04000008 - ldrh r1, [r1] - lsrs r1, 2 - lsls r1, 30 - lsrs r1, 16 - movs r2, 0xC0 - lsls r2, 19 - adds r1, r2 - str r1, [r0] - bx lr - .pool - thumb_func_end sub_8149F40 - - thumb_func_start sub_8149F58 -sub_8149F58: @ 8149F58 - push {r4,lr} - ldr r3, =0x04000008 - ldrh r2, [r3] - lsrs r2, 8 - ldrh r3, [r3] - lsrs r3, 2 - lsls r2, 27 - lsrs r2, 16 - lsls r3, 30 - lsrs r3, 16 - movs r4, 0xC0 - lsls r4, 19 - adds r2, r4 - str r2, [r0] - adds r3, r4 - str r3, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8149F58 - - thumb_func_start sub_8149F84 -sub_8149F84: @ 8149F84 - push {lr} - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - pop {r0} - bx r0 - thumb_func_end sub_8149F84 - - thumb_func_start sub_8149F98 -sub_8149F98: @ 8149F98 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r10, r0 - ldr r0, [sp, 0x20] - ldr r4, [sp, 0x24] - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 16 - lsrs r2, 16 - lsls r3, 16 - lsrs r3, 16 - lsls r0, 16 - lsrs r1, r0, 16 - lsls r4, 16 - movs r6, 0 - lsrs r5, r4, 16 - cmp r4, 0 - ble _0814A000 - lsls r0, r7, 16 - asrs r0, 16 - mov r9, r0 - lsls r1, 16 - mov r8, r1 - lsls r0, r3, 16 - asrs r7, r0, 16 -_08149FD0: - lsls r4, r2, 16 - asrs r4, 16 - movs r0, 0xFF - ands r0, r4 - mov r2, r8 - asrs r1, r2, 16 - bl sine - lsls r1, r6, 1 - add r1, r10 - add r0, r9 - strh r0, [r1] - lsls r1, r5, 16 - ldr r0, =0xffff0000 - adds r1, r0 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r4, r7 - lsls r4, 16 - lsrs r2, r4, 16 - lsrs r5, r1, 16 - cmp r1, 0 - bgt _08149FD0 -_0814A000: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8149F98 - - thumb_func_start sub_814A014 -sub_814A014: @ 814A014 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - mov r9, r0 - adds r5, r2, 0 - adds r4, r3, 0 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - lsls r5, 16 - lsrs r5, 16 - lsls r4, 16 - lsrs r4, 16 - movs r2, 0xA0 - lsls r2, 1 - movs r1, 0xA - bl memset - movs r1, 0 - lsls r4, 16 - asrs r4, 16 - str r4, [sp, 0x4] - lsls r5, 16 - asrs r5, 16 - str r5, [sp, 0x8] -_0814A04C: - lsls r5, r1, 16 - asrs r0, r5, 16 - mov r10, r0 - ldr r1, [sp, 0x4] - bl sine - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - mov r0, r10 - ldr r1, [sp, 0x4] - bl cosine - ldr r2, [sp] - lsls r1, r2, 16 - asrs r1, 16 - lsls r4, 16 - asrs r4, 16 - subs r2, r1, r4 - lsls r2, 16 - adds r1, r4 - lsls r1, 16 - lsrs r6, r1, 16 - lsls r0, 16 - asrs r0, 16 - ldr r3, [sp, 0x8] - subs r1, r3, r0 - lsls r1, 16 - lsrs r7, r1, 16 - adds r0, r3, r0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsrs r1, r2, 16 - str r5, [sp, 0x10] - cmp r2, 0 - bge _0814A098 - movs r1, 0 -_0814A098: - lsls r0, r6, 16 - asrs r0, 16 - cmp r0, 0xF0 - ble _0814A0A2 - movs r6, 0xF0 -_0814A0A2: - lsls r0, r7, 16 - cmp r0, 0 - bge _0814A0AA - movs r7, 0 -_0814A0AA: - mov r2, r8 - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, 0x9F - ble _0814A0B8 - movs r3, 0x9F - mov r8, r3 -_0814A0B8: - lsls r0, r1, 24 - lsrs r0, 16 - orrs r6, r0 - lsls r0, r7, 16 - asrs r0, 16 - str r0, [sp, 0xC] - lsls r0, 1 - add r0, r9 - strh r6, [r0] - mov r0, r8 - lsls r4, r0, 16 - asrs r0, r4, 15 - add r0, r9 - strh r6, [r0] - mov r0, r10 - adds r0, 0x1 - lsls r0, 16 - asrs r0, 16 - ldr r1, [sp, 0x4] - bl cosine - lsls r0, 16 - asrs r0, 16 - ldr r2, [sp, 0x8] - subs r1, r2, r0 - lsls r1, 16 - adds r0, r2, r0 - lsls r0, 16 - lsrs r2, r0, 16 - lsrs r3, r1, 16 - cmp r1, 0 - bge _0814A0FA - movs r3, 0 -_0814A0FA: - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, 0x9F - ble _0814A104 - movs r2, 0x9F -_0814A104: - lsls r0, r3, 16 - asrs r1, r0, 16 - adds r3, r0, 0 - lsls r5, r2, 16 - ldr r0, [sp, 0xC] - cmp r0, r1 - ble _0814A128 - adds r2, r1, 0 -_0814A114: - lsls r1, r7, 16 - ldr r0, =0xffff0000 - adds r1, r0 - asrs r0, r1, 15 - add r0, r9 - strh r6, [r0] - lsrs r7, r1, 16 - asrs r1, 16 - cmp r1, r2 - bgt _0814A114 -_0814A128: - lsls r1, r7, 16 - asrs r0, r3, 16 - cmp r1, r3 - bge _0814A146 - adds r2, r0, 0 -_0814A132: - movs r3, 0x80 - lsls r3, 9 - adds r0, r1, r3 - asrs r1, r0, 15 - add r1, r9 - strh r6, [r1] - adds r1, r0, 0 - asrs r0, r1, 16 - cmp r0, r2 - blt _0814A132 -_0814A146: - asrs r0, r5, 16 - cmp r4, r5 - ble _0814A164 - adds r1, r0, 0 -_0814A14E: - ldr r2, =0xffff0000 - adds r0, r4, r2 - lsrs r3, r0, 16 - mov r8, r3 - asrs r0, 15 - add r0, r9 - strh r6, [r0] - lsls r4, r3, 16 - asrs r0, r4, 16 - cmp r0, r1 - bgt _0814A14E -_0814A164: - mov r0, r8 - lsls r4, r0, 16 - asrs r0, r5, 16 - cmp r4, r5 - bge _0814A184 - adds r2, r0, 0 -_0814A170: - movs r1, 0x80 - lsls r1, 9 - adds r0, r4, r1 - asrs r1, r0, 15 - add r1, r9 - strh r6, [r1] - adds r4, r0, 0 - asrs r0, r4, 16 - cmp r0, r2 - blt _0814A170 -_0814A184: - ldr r2, [sp, 0x10] - movs r3, 0x80 - lsls r3, 9 - adds r0, r2, r3 - lsrs r1, r0, 16 - asrs r0, 16 - cmp r0, 0x3F - bgt _0814A196 - b _0814A04C -_0814A196: - 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_814A014 - - thumb_func_start sub_814A1AC -sub_814A1AC: @ 814A1AC - push {r4-r7,lr} - adds r6, r0, 0 - ldr r0, [sp, 0x14] - ldr r5, [sp, 0x18] - ldr r4, [sp, 0x1C] - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - lsls r3, 16 - lsrs r3, 16 - lsls r0, 16 - lsrs r0, 16 - adds r7, r0, 0 - lsls r5, 16 - lsrs r5, 16 - lsls r4, 16 - lsrs r4, 16 - strh r1, [r6] - strh r2, [r6, 0x2] - strh r1, [r6, 0x4] - strh r2, [r6, 0x6] - strh r3, [r6, 0x8] - strh r7, [r6, 0xA] - strh r5, [r6, 0xC] - strh r4, [r6, 0xE] - lsls r3, 16 - asrs r3, 16 - lsls r1, 16 - asrs r1, 16 - subs r3, r1 - strh r3, [r6, 0x10] - lsls r0, r3, 16 - cmp r0, 0 - bge _0814A1FE - negs r0, r3 - strh r0, [r6, 0x10] - lsls r0, r5, 16 - asrs r0, 16 - negs r0, r0 - strh r0, [r6, 0xC] -_0814A1FE: - lsls r0, r7, 16 - asrs r0, 16 - lsls r1, r2, 16 - asrs r1, 16 - subs r1, r0, r1 - strh r1, [r6, 0x12] - lsls r0, r1, 16 - cmp r0, 0 - bge _0814A21C - negs r0, r1 - strh r0, [r6, 0x12] - lsls r0, r4, 16 - asrs r0, 16 - negs r0, r0 - strh r0, [r6, 0xE] -_0814A21C: - movs r0, 0 - strh r0, [r6, 0x14] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_814A1AC - - thumb_func_start sub_814A228 -sub_814A228: @ 814A228 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r3, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - ldrh r0, [r3, 0x10] - mov r8, r0 - movs r1, 0x10 - ldrsh r6, [r3, r1] - ldrh r2, [r3, 0x12] - mov r12, r2 - movs r4, 0x12 - ldrsh r5, [r3, r4] - cmp r6, r5 - ble _0814A278 - ldrh r0, [r3, 0xC] - ldrh r2, [r3, 0x4] - adds r1, r0, r2 - strh r1, [r3, 0x4] - ldrh r2, [r3, 0x14] - add r2, r12 - strh r2, [r3, 0x14] - lsls r1, r2, 16 - asrs r1, 16 - adds r4, r0, 0 - ldrh r7, [r3, 0xE] - cmp r1, r6 - ble _0814A29E - ldrh r1, [r3, 0x6] - adds r0, r7, r1 - strh r0, [r3, 0x6] - mov r1, r8 - b _0814A29A -_0814A278: - ldrh r0, [r3, 0xE] - ldrh r2, [r3, 0x6] - adds r1, r0, r2 - strh r1, [r3, 0x6] - ldrh r2, [r3, 0x14] - add r2, r8 - strh r2, [r3, 0x14] - lsls r1, r2, 16 - asrs r1, 16 - ldrh r4, [r3, 0xC] - adds r7, r0, 0 - cmp r1, r5 - ble _0814A29E - ldrh r1, [r3, 0x4] - adds r0, r4, r1 - strh r0, [r3, 0x4] - mov r1, r12 -_0814A29A: - subs r0, r2, r1 - strh r0, [r3, 0x14] -_0814A29E: - movs r5, 0 - lsls r0, r4, 16 - asrs r2, r0, 16 - cmp r2, 0 - ble _0814A2B6 - movs r4, 0x4 - ldrsh r1, [r3, r4] - movs r4, 0x8 - ldrsh r0, [r3, r4] - ldrh r4, [r3, 0x8] - cmp r1, r0 - bge _0814A2C8 -_0814A2B6: - cmp r2, 0 - bge _0814A2D6 - movs r0, 0x4 - ldrsh r1, [r3, r0] - movs r2, 0x8 - ldrsh r0, [r3, r2] - ldrh r4, [r3, 0x8] - cmp r1, r0 - bgt _0814A2D6 -_0814A2C8: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - mov r0, r9 - cmp r0, 0 - beq _0814A2D6 - strh r4, [r3, 0x4] -_0814A2D6: - lsls r0, r7, 16 - asrs r2, r0, 16 - cmp r2, 0 - ble _0814A2EC - movs r4, 0x6 - ldrsh r1, [r3, r4] - movs r4, 0xA - ldrsh r0, [r3, r4] - ldrh r4, [r3, 0xA] - cmp r1, r0 - bge _0814A2FE -_0814A2EC: - cmp r2, 0 - bge _0814A30C - movs r0, 0x6 - ldrsh r1, [r3, r0] - movs r2, 0xA - ldrsh r0, [r3, r2] - ldrh r4, [r3, 0xA] - cmp r1, r0 - bgt _0814A30C -_0814A2FE: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - mov r0, r10 - cmp r0, 0 - beq _0814A30C - strh r4, [r3, 0x6] -_0814A30C: - cmp r5, 0x2 - beq _0814A314 - movs r0, 0 - b _0814A316 -_0814A314: - movs r0, 0x1 -_0814A316: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_814A228 - - thumb_func_start sub_814A324 -sub_814A324: @ 814A324 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - bl sub_814669C - add r0, sp, 0x4 - add r1, sp, 0x8 - bl sub_8149F58 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, [sp, 0x4] - ldr r2, =0x01000400 - mov r0, sp - bl CpuSet - ldr r0, =gUnknown_085C7C00 - ldr r1, [sp, 0x8] - bl LZ77UnCompVram - ldr r0, =gUnknown_085C7BE0 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814A324 - - thumb_func_start sub_814A374 -sub_814A374: @ 814A374 - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - add r1, sp, 0xC - add r0, sp, 0x8 - bl sub_8149F58 - ldr r0, =gUnknown_085C828C - ldr r1, [sp, 0x8] - bl LZ77UnCompVram - ldr r0, =0x02038c28 - movs r1, 0x10 - ldrsh r2, [r4, r1] - movs r3, 0x12 - ldrsh r1, [r4, r3] - str r1, [sp] - movs r1, 0xA0 - str r1, [sp, 0x4] - movs r1, 0 - movs r3, 0x84 - bl sub_8149F98 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x1 - add sp, 0x10 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814A374 - - thumb_func_start sub_814A3BC -sub_814A3BC: @ 814A3BC - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C99D0 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0814A3CE: - 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 _0814A3CE - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814A3BC - - thumb_func_start sub_814A3F4 -sub_814A3F4: @ 814A3F4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C99E8 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0814A406: - 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 _0814A406 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814A3F4 - - thumb_func_start sub_814A42C -sub_814A42C: @ 814A42C - push {r4-r6,lr} - sub sp, 0xC - adds r4, r0, 0 - bl sub_8149F08 - bl dp12_8087EA4 - movs r1, 0xC0 - lsls r1, 7 - movs r0, 0 - bl ClearGpuRegBits - movs r5, 0 - movs r0, 0x80 - lsls r0, 6 - strh r0, [r4, 0xC] - ldr r0, =0x00007fff - strh r0, [r4, 0xA] - strh r5, [r4, 0x12] - movs r0, 0x10 - strh r0, [r4, 0x14] - movs r0, 0xA0 - lsls r0, 4 - strh r0, [r4, 0x16] - ldr r6, =0x0203aba0 - ldr r2, [r6] - ldr r3, =0x00003f41 - strh r3, [r2, 0xE] - ldrh r0, [r4, 0x14] - lsls r0, 8 - ldrh r1, [r4, 0x12] - orrs r0, r1 - strh r0, [r2, 0x10] - ldr r0, =0x04000050 - strh r3, [r0] - ldr r1, =0x04000052 - ldrh r0, [r2, 0x10] - strh r0, [r1] - add r0, sp, 0x4 - add r1, sp, 0x8 - bl sub_8149F58 - mov r0, sp - strh r5, [r0] - ldr r1, [sp, 0x4] - ldr r2, =0x01000400 - bl CpuSet - ldr r0, =gUnknown_085C7C00 - ldr r1, [sp, 0x8] - bl LZ77UnCompVram - ldr r0, =gUnknown_085C7BE0 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, [r6] - strh r5, [r0, 0x16] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - add sp, 0xC - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814A42C - - thumb_func_start sub_814A4D4 -sub_814A4D4: @ 814A4D4 - push {r4,lr} - sub sp, 0x8 - adds r4, r0, 0 - add r1, sp, 0x4 - mov r0, sp - bl sub_8149F58 - ldr r0, =gUnknown_085C828C - ldr r1, [sp] - bl LZ77UnCompVram - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0x1 - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814A4D4 - - thumb_func_start sub_814A500 -sub_814A500: @ 814A500 - push {r4-r6,lr} - adds r5, r0, 0 - movs r2, 0 - ldr r6, =sub_814A684 - ldr r4, =0x020393a8 - ldr r3, =0x0203aba0 -_0814A50C: - lsls r1, r2, 1 - adds r1, r4 - ldr r0, [r3] - ldrh r0, [r0, 0x16] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x9F - bls _0814A50C - adds r0, r6, 0 - bl SetVBlankCallback - ldr r0, =sub_814A6CC - bl SetHBlankCallback - movs r0, 0x2 - bl EnableInterrupts - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0x1 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814A500 - - thumb_func_start sub_814A550 -sub_814A550: @ 814A550 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - ldr r1, =0x0203aba0 - ldr r0, [r1] - ldrb r2, [r0] - movs r3, 0 - strb r3, [r0] - ldrh r2, [r4, 0xC] - lsls r0, r2, 16 - asrs r0, 24 - lsls r0, 16 - lsrs r7, r0, 16 - ldrh r6, [r4, 0xA] - movs r0, 0xC0 - lsls r0, 1 - mov r8, r0 - ldrh r0, [r4, 0x16] - subs r0, r6, r0 - strh r0, [r4, 0xA] - movs r5, 0xE - ldrsh r0, [r4, r5] - adds r5, r1, 0 - cmp r0, 0x45 - ble _0814A5A2 - movs r1, 0xC - ldrsh r0, [r4, r1] - ldr r1, =0xfffffe80 - adds r0, r1 - cmp r0, 0 - blt _0814A5A0 - adds r0, r2, r1 - strh r0, [r4, 0xC] - b _0814A5A2 - .pool -_0814A5A0: - strh r3, [r4, 0xC] -_0814A5A2: - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r0, 0 - blt _0814A5E0 - movs r1, 0x3 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _0814A5E0 - ldrh r1, [r4, 0x12] - movs r2, 0x12 - ldrsh r0, [r4, r2] - cmp r0, 0xF - bgt _0814A5C6 - adds r0, r1, 0x1 - strh r0, [r4, 0x12] - b _0814A5D4 -_0814A5C6: - ldrh r1, [r4, 0x14] - movs r2, 0x14 - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _0814A5D4 - subs r0, r1, 0x1 - strh r0, [r4, 0x14] -_0814A5D4: - ldr r0, [r5] - ldrh r1, [r4, 0x14] - lsls r1, 8 - ldrh r2, [r4, 0x12] - orrs r1, r2 - strh r1, [r0, 0x10] -_0814A5E0: - movs r5, 0 - lsls r7, 16 -_0814A5E4: - lsrs r0, r6, 8 - asrs r1, r7, 16 - bl sine - ldr r1, =0x02038c28 - lsls r2, r5, 1 - adds r2, r1 - ldr r1, =0x0203aba0 - ldr r1, [r1] - ldrh r1, [r1, 0x16] - adds r0, r1 - strh r0, [r2] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - mov r1, r8 - adds r0, r6, r1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r5, 0x9F - bls _0814A5E4 - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x65 - bne _0814A632 - ldrh r0, [r4, 0x10] - adds r0, 0x1 - strh r0, [r4, 0x10] - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe -_0814A632: - movs r2, 0x10 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0814A654 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0814A654 - ldr r0, =sub_814A3F4 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_0814A654: - ldrh r0, [r4, 0x16] - subs r0, 0x11 - strh r0, [r4, 0x16] - ldr r0, =0x0203aba0 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - ldrb r2, [r1] - strb r0, [r1] - movs r0, 0 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814A550 - - thumb_func_start sub_814A684 -sub_814A684: @ 814A684 - push {lr} - bl sub_8149F2C - ldr r2, =0x04000050 - ldr r0, =0x0203aba0 - ldr r1, [r0] - ldrh r0, [r1, 0xE] - strh r0, [r2] - adds r2, 0x2 - ldrh r0, [r1, 0x10] - strh r0, [r2] - ldrb r0, [r1] - cmp r0, 0 - beq _0814A6B4 - ldr r1, =0x040000d4 - ldr r0, =0x02038c28 - str r0, [r1] - movs r2, 0xF0 - lsls r2, 3 - adds r0, r2 - str r0, [r1, 0x4] - ldr r0, =0x800000a0 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] -_0814A6B4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_814A684 - - thumb_func_start sub_814A6CC -sub_814A6CC: @ 814A6CC - ldr r1, =0x02038c28 - ldr r0, =0x04000006 - ldrh r0, [r0] - lsls r0, 1 - movs r2, 0xF0 - lsls r2, 3 - adds r1, r2 - adds r0, r1 - ldrh r1, [r0] - ldr r0, =0x04000012 - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_814A6CC - - thumb_func_start sub_814A6F0 -sub_814A6F0: @ 814A6F0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C99F8 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0814A702: - 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 _0814A702 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814A6F0 - - thumb_func_start sub_814A728 -sub_814A728: @ 814A728 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C9A08 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0814A73A: - 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 _0814A73A - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814A728 - - thumb_func_start sub_814A760 -sub_814A760: @ 814A760 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085C9A1C - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0814A772: - 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 _0814A772 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814A760 - - thumb_func_start sub_814A798 -sub_814A798: @ 814A798 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x14 - mov r8, r0 - add r1, sp, 0x10 - add r0, sp, 0xC - bl sub_8149F58 - ldr r0, =gUnknown_085C8598 - ldr r1, [sp, 0x10] - bl LZ77UnCompVram - movs r4, 0x20 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r6, 0x1 - str r6, [sp] - str r4, [sp, 0x4] - movs r5, 0xF - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect - str r6, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r2, 0x1D - movs r3, 0 - bl FillBgTilemapBufferRect - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, =gUnknown_085C8578 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - movs r0, 0 - mov r1, r8 - strh r6, [r1, 0xC] - strh r0, [r1, 0xE] - strh r0, [r1, 0x10] - movs r0, 0xA - strh r0, [r1, 0x16] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - movs r0, 0 - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814A798 - - thumb_func_start sub_814A828 -sub_814A828: @ 814A828 - push {r4,r5,lr} - sub sp, 0x24 - adds r4, r0, 0 - ldr r1, =gUnknown_085C8928 - movs r2, 0x4 - str r2, [sp] - str r2, [sp, 0x4] - ldrb r0, [r4, 0xC] - str r0, [sp, 0x8] - ldrb r0, [r4, 0xE] - str r0, [sp, 0xC] - str r2, [sp, 0x10] - str r2, [sp, 0x14] - movs r0, 0xF - str r0, [sp, 0x18] - movs r5, 0 - str r5, [sp, 0x1C] - str r5, [sp, 0x20] - movs r0, 0 - movs r2, 0 - movs r3, 0 - bl CopyRectToBgTilemapBufferRect - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldrh r0, [r4, 0xC] - adds r0, 0x4 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x10] - adds r0, 0x1 - strh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - bne _0814A88A - movs r0, 0x1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0xE] - adds r0, 0x4 - strh r0, [r4, 0xE] - strh r5, [r4, 0x10] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _0814A88A - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0814A88A: - movs r0, 0 - add sp, 0x24 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814A828 - - thumb_func_start sub_814A898 -sub_814A898: @ 814A898 - push {r4-r6,lr} - sub sp, 0x10 - adds r4, r0, 0 - add r1, sp, 0xC - add r0, sp, 0x8 - bl sub_8149F58 - ldrh r0, [r4, 0x14] - adds r1, r0, 0x1 - strh r1, [r4, 0x14] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x16 - ldrsh r1, [r4, r2] - cmp r0, r1 - blt _0814A956 - movs r1, 0x12 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0814A8FC - cmp r0, 0x1 - bgt _0814A8CA - cmp r0, 0 - beq _0814A8D4 - b _0814A92C -_0814A8CA: - cmp r0, 0x2 - beq _0814A914 - cmp r0, 0x3 - beq _0814A91C - b _0814A92C -_0814A8D4: - movs r2, 0xFA - ldr r6, =0x02037714 - movs r3, 0 - ldr r5, =0x02037b14 -_0814A8DC: - lsls r1, r2, 1 - adds r0, r1, r6 - strh r3, [r0] - adds r1, r5 - strh r3, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFE - bls _0814A8DC - b _0814A94C - .pool -_0814A8FC: - ldr r0, =0xffff7fff - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - ldr r0, =gUnknown_085C86F4 - b _0814A91E - .pool -_0814A914: - ldr r0, =gUnknown_085C87F4 - b _0814A91E - .pool -_0814A91C: - ldr r0, =gUnknown_085C88A4 -_0814A91E: - ldr r1, [sp, 0xC] - bl LZ77UnCompVram - b _0814A94C - .pool -_0814A92C: - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0x1 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0814A956 -_0814A94C: - movs r0, 0 - strh r0, [r4, 0x14] - ldrh r0, [r4, 0x12] - adds r0, 0x1 - strh r0, [r4, 0x12] -_0814A956: - movs r0, 0 - add sp, 0x10 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_814A898 - - thumb_func_start sub_814A960 -sub_814A960: @ 814A960 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x14 - mov r8, r0 - add r1, sp, 0x10 - add r0, sp, 0xC - bl sub_8149F58 - ldr r0, =gUnknown_085C8598 - ldr r1, [sp, 0x10] - bl LZ77UnCompVram - movs r4, 0x20 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r6, 0x1 - str r6, [sp] - str r4, [sp, 0x4] - movs r5, 0xF - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect - str r6, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r2, 0x1D - movs r3, 0 - bl FillBgTilemapBufferRect - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r4, =gUnknown_085C8578 - adds r0, r4, 0 - movs r1, 0xE0 - movs r2, 0x20 - bl gpu_pal_apply - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - movs r0, 0xE0 - movs r1, 0x10 - movs r2, 0x8 - movs r3, 0 - bl pal_fade_1 - movs r1, 0 - movs r0, 0x22 - mov r2, r8 - strh r0, [r2, 0xC] - strh r1, [r2, 0xE] - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - movs r0, 0 - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814A960 - - thumb_func_start sub_814AA04 -sub_814AA04: @ 814AA04 - push {r4-r6,lr} - sub sp, 0x24 - adds r6, r0, 0 - ldr r1, =gUnknown_085C9A30 - movs r2, 0xC - ldrsh r0, [r6, r2] - adds r0, r1 - ldrb r5, [r0] - adds r0, r5, 0 - movs r1, 0x7 - bl __umodsi3 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x7 - bl __udivsi3 - ldr r1, =gUnknown_085C8928 - movs r2, 0x4 - str r2, [sp] - str r2, [sp, 0x4] - lsls r4, 2 - adds r4, 0x1 - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0x8] - lsls r0, 26 - lsrs r0, 24 - str r0, [sp, 0xC] - str r2, [sp, 0x10] - str r2, [sp, 0x14] - movs r0, 0xF - str r0, [sp, 0x18] - movs r0, 0 - str r0, [sp, 0x1C] - str r0, [sp, 0x20] - movs r2, 0 - movs r3, 0 - bl CopyRectToBgTilemapBufferRect - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldrh r0, [r6, 0xC] - subs r0, 0x1 - strh r0, [r6, 0xC] - lsls r0, 16 - cmp r0, 0 - bge _0814AA70 - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] -_0814AA70: - movs r0, 0 - add sp, 0x24 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814AA04 - - thumb_func_start sub_814AA84 -sub_814AA84: @ 814AA84 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0xE0 - movs r1, 0x10 - movs r2, 0x3 - movs r3, 0 - bl pal_fade_1 - ldr r0, =0xffff3fff - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - movs r0, 0 - strh r0, [r4, 0xC] - strh r0, [r4, 0xE] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814AA84 - - thumb_func_start sub_814AAB8 -sub_814AAB8: @ 814AAB8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x24 - adds r7, r0, 0 - ldrh r0, [r7, 0xE] - movs r1, 0x1 - eors r0, r1 - movs r6, 0 - strh r0, [r7, 0xE] - cmp r0, 0 - beq _0814AB2C - ldr r0, =gUnknown_085C8928 - mov r8, r0 - movs r4, 0x4 - str r4, [sp] - str r4, [sp, 0x4] - ldr r5, =gUnknown_085C9A30 - movs r1, 0xC - ldrsh r0, [r7, r1] - adds r0, r5 - ldrb r0, [r0] - movs r1, 0x7 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 22 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - movs r2, 0xC - ldrsh r0, [r7, r2] - adds r0, r5 - ldrb r0, [r0] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 26 - lsrs r0, 24 - str r0, [sp, 0xC] - str r4, [sp, 0x10] - str r4, [sp, 0x14] - movs r0, 0xE - str r0, [sp, 0x18] - str r6, [sp, 0x1C] - str r6, [sp, 0x20] - movs r0, 0 - mov r1, r8 - movs r2, 0 - movs r3, 0 - bl CopyRectToBgTilemapBufferRect - b _0814AB78 - .pool -_0814AB2C: - movs r1, 0xC - ldrsh r0, [r7, r1] - cmp r0, 0 - ble _0814AB72 - ldr r1, =gUnknown_085C9A30 - subs r0, 0x1 - adds r0, r1 - ldrb r5, [r0] - adds r0, r5, 0 - movs r1, 0x7 - bl __umodsi3 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 22 - adds r4, 0x1 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x7 - bl __udivsi3 - adds r3, r0, 0 - lsls r3, 26 - lsrs r3, 24 - movs r0, 0x4 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl FillBgTilemapBufferRect -_0814AB72: - ldrh r0, [r7, 0xC] - adds r0, 0x1 - strh r0, [r7, 0xC] -_0814AB78: - movs r1, 0xC - ldrsh r0, [r7, r1] - cmp r0, 0x22 - ble _0814AB86 - ldrh r0, [r7, 0x8] - adds r0, 0x1 - strh r0, [r7, 0x8] -_0814AB86: - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0 - add sp, 0x24 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814AAB8 - - thumb_func_start sub_814ABA0 -sub_814ABA0: @ 814ABA0 - push {r4,lr} - sub sp, 0x8 - adds r4, r0, 0 - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0x1 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - ldr r0, [r4] - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_814ABA0 - - thumb_func_start sub_814ABE4 -sub_814ABE4: @ 814ABE4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r6, r1, r2 - ldrh r0, [r6, 0xC] - movs r1, 0x1 - eors r0, r1 - strh r0, [r6, 0xC] - cmp r0, 0 - bne _0814AC24 - ldr r5, =0x02022e14 - ldrh r1, [r5] - movs r0, 0x12 - bl SetGpuReg - ldr r4, =0x02022e16 - ldrh r1, [r4] - movs r0, 0x10 - bl SetGpuReg - ldrh r0, [r6, 0x8] - ldrh r1, [r5] - adds r0, r1 - strh r0, [r5] - ldrh r0, [r6, 0xA] - ldrh r1, [r4] - adds r0, r1 - strh r0, [r4] -_0814AC24: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814ABE4 - - thumb_func_start sub_814AC38 -sub_814AC38: @ 814AC38 - push {r4-r6,lr} - sub sp, 0x10 - adds r6, r0, 0 - movs r5, 0 - add r1, sp, 0xC - add r0, sp, 0x8 - bl sub_8149F58 - ldr r0, =gUnknown_085C8598 - ldr r1, [sp, 0xC] - bl LZ77UnCompVram - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, =gUnknown_085C8578 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =0x02022e14 - strh r5, [r0] - ldr r4, =0x02022e16 - strh r5, [r4] - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x10 - bl SetGpuReg - strh r5, [r6, 0xC] - ldr r0, =sub_814ABE4 - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r5, r0, 24 - bl GenerateRandomNumber - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - lsrs r1, 16 - cmp r1, 0x1 - beq _0814ACE4 - cmp r1, 0x1 - bgt _0814ACC8 - cmp r1, 0 - beq _0814ACCE - b _0814AD1C - .pool -_0814ACC8: - cmp r1, 0x2 - beq _0814AD00 - b _0814AD1C -_0814ACCE: - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x8] - strh r0, [r1, 0xA] - b _0814AD2E - .pool -_0814ACE4: - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =0x0000ffff - strh r1, [r0, 0x8] - movs r1, 0x1 - negs r1, r1 - b _0814AD2C - .pool -_0814AD00: - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x1 - strh r1, [r0, 0x8] - ldr r1, =0x0000ffff - b _0814AD2C - .pool -_0814AD1C: - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =0x0000ffff - strh r1, [r0, 0x8] - movs r1, 0x1 -_0814AD2C: - strh r1, [r0, 0xA] -_0814AD2E: - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - movs r0, 0 - add sp, 0x10 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814AC38 - - thumb_func_start sub_814AD48 -sub_814AD48: @ 814AD48 - push {r4,lr} - sub sp, 0x24 - adds r4, r0, 0 - ldr r1, =gUnknown_085C9A53 - movs r2, 0xC - ldrsh r0, [r4, r2] - adds r0, r1 - ldrb r3, [r0] - lsrs r2, r3, 3 - movs r0, 0x7 - ands r3, r0 - ldr r1, =gUnknown_085C8928 - movs r0, 0x4 - str r0, [sp] - str r0, [sp, 0x4] - lsls r2, 2 - adds r2, 0x1 - str r2, [sp, 0x8] - lsls r3, 2 - str r3, [sp, 0xC] - str r0, [sp, 0x10] - str r0, [sp, 0x14] - movs r0, 0xF - str r0, [sp, 0x18] - movs r0, 0 - str r0, [sp, 0x1C] - str r0, [sp, 0x20] - movs r2, 0 - movs r3, 0 - bl CopyRectToBgTilemapBufferRect - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3F - ble _0814ADA0 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0814ADA0: - movs r0, 0 - add sp, 0x24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814AD48 - - thumb_func_start sub_814ADB4 -sub_814ADB4: @ 814ADB4 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0xffff7fff - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - movs r0, 0 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814ADB4 - - thumb_func_start sub_814ADD8 -sub_814ADD8: @ 814ADD8 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - ldr r1, =gUnknown_085C9A53 - movs r2, 0xC - ldrsh r0, [r4, r2] - adds r0, r1 - ldrb r3, [r0] - lsrs r2, r3, 3 - movs r0, 0x7 - ands r3, r0 - lsls r2, 2 - adds r2, 0x1 - lsls r3, 2 - movs r0, 0x4 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - bl FillBgTilemapBufferRect - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3F - ble _0814AE2E - ldr r0, =sub_814ABE4 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0814AE2E: - movs r0, 0 - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814ADD8 - - thumb_func_start sub_814AE40 -sub_814AE40: @ 814AE40 - push {r4,r5,lr} - sub sp, 0x8 - adds r5, r0, 0 - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r4, =0x02022e16 - strh r1, [r4] - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x10 - bl SetGpuReg - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0x1 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - ldr r0, [r5] - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - movs r0, 0 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_814AE40 - - thumb_func_start nullsub_112 -nullsub_112: @ 814AEAC - bx lr - thumb_func_end nullsub_112 - - thumb_func_start sub_814AEB0 -sub_814AEB0: @ 814AEB0 - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_exec_buffer_A_ch0_tbl4 - str r1, [r0] - bx lr - .pool - thumb_func_end sub_814AEB0 - - thumb_func_start bx_exec_buffer_A_ch0_tbl4 -bx_exec_buffer_A_ch0_tbl4: @ 814AECC - push {lr} - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldr r0, =0x02024064 - ldrb r3, [r0] - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _0814AF18 - ldr r0, =0x02023064 - lsls r1, r3, 9 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x38 - bhi _0814AF14 - ldr r0, =gUnknown_085C9A94 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 - b _0814AF18 - .pool -_0814AF14: - bl dp01_tbl4_exec_completed -_0814AF18: - pop {r0} - bx r0 - thumb_func_end bx_exec_buffer_A_ch0_tbl4 - - thumb_func_start sub_814AF1C -sub_814AF1C: @ 814AF1C - push {lr} - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - 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, =DummyObjectCallback - cmp r1, r0 - bne _0814AF40 - bl dp01_tbl4_exec_completed -_0814AF40: - pop {r0} - bx r0 - .pool - thumb_func_end sub_814AF1C - - thumb_func_start sub_814AF54 -sub_814AF54: @ 814AF54 - push {r4-r6,lr} - ldr r6, =0x02020630 - ldr r5, =0x020241e4 - ldr r4, =0x02024064 - 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, =DummyObjectCallback - cmp r1, r0 - bne _0814AFA4 - 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 obj_free_rotscale_entry - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl RemoveObjectAndFreeTiles - bl dp01_tbl4_exec_completed -_0814AFA4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814AF54 - - thumb_func_start sub_814AFBC -sub_814AFBC: @ 814AFBC - push {r4,lr} - ldr r4, =0x020244d0 - ldr r1, [r4] - ldr r3, =0x02024064 - 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 _0814AFF4 - 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 dp01_tbl4_exec_completed -_0814AFF4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814AFBC - - thumb_func_start sub_814B004 -sub_814B004: @ 814B004 - push {r4-r6,lr} - movs r6, 0 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0814B028 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0814B05C - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0814B05C -_0814B028: - ldr r2, =0x02020630 - ldr r1, =0x03005d70 - ldr r0, =0x02024064 - 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, =DummyObjectCallback - cmp r1, r0 - bne _0814B094 - b _0814B092 - .pool -_0814B05C: - ldr r2, =0x02020630 - ldr r5, =0x03005d70 - ldr r0, =0x02024064 - ldrb r3, [r0] - adds r0, r3, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r4, r2, 0 - adds r4, 0x1C - adds r0, r4 - ldr r2, [r0] - ldr r0, =DummyObjectCallback - cmp r2, r0 - bne _0814B094 - 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, r4 - ldr r0, [r0] - cmp r0, r2 - bne _0814B094 -_0814B092: - movs r6, 0x1 -_0814B094: - bl sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - beq _0814B0A0 - movs r6, 0 -_0814B0A0: - cmp r6, 0 - beq _0814B0C6 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r3, =0x02024064 - 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, =0x03005d60 - ldrb r0, [r3] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_814AFBC - str r1, [r0] -_0814B0C6: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814B004 - - thumb_func_start sub_814B0E8 -sub_814B0E8: @ 814B0E8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x020244d0 - mov r12, r0 - ldr r0, [r0] - ldr r7, =0x02024064 - 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 - beq _0814B114 - b _0814B252 -_0814B114: - movs r1, 0x2 - mov r8, r1 - adds r1, r2, 0 - mov r0, r8 - eors r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0] - adds r0, r5, 0 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - beq _0814B136 - b _0814B252 -_0814B136: - ldr r1, =0x02020630 - mov r10, r1 - ldr r0, =0x03005d7c - mov r9, r0 - adds r0, r2, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - mov r5, r10 - adds r5, 0x1C - adds r0, r5 - ldr r3, [r0] - ldr r0, =DummyObjectCallback - cmp r3, r0 - bne _0814B252 - ldr r0, =0x020241e4 - adds r0, r2, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r0, [r0] - cmp r0, r3 - bne _0814B252 - ldrb r0, [r4, 0x9] - adds r0, 0x1 - strb r0, [r4, 0x9] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0814B252 - mov r1, r12 - ldr r0, [r1] - ldrb r1, [r7] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r6, [r0, 0x9] - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0814B1F0 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0814B1F0 - ldrb r0, [r7] - mov r1, r8 - eors r0, r1 - add r0, r9 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r10 - bl RemoveObjectAndFreeTiles - ldr r4, =0x03005d70 - ldrb r0, [r7] - mov r1, r8 - eors r1, r0 - adds r0, r1, r4 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe - ldrb r0, [r7] - mov r1, r8 - eors r0, r1 - bl sub_8076918 - ldrb r0, [r7] - mov r1, r8 - eors r0, r1 - adds r0, r4 - ldrb r0, [r0] - bl sub_80729D0 -_0814B1F0: - ldr r1, =0x03005d7c - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - ldr r5, =0x03005d70 - ldrb r1, [r4] - adds r0, r1, r5 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - 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 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r2, [r0, 0x8] - ldrb r1, [r2, 0x9] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x9] - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_814B004 - str r1, [r0] -_0814B252: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814B0E8 - - thumb_func_start sub_814B290 -sub_814B290: @ 814B290 - push {lr} - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - 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 _0814B2BE - movs r2, 0x24 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _0814B2BE - bl dp01_tbl4_exec_completed -_0814B2BE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_814B290 - - thumb_func_start bx_t4_healthbar_update -bx_t4_healthbar_update: @ 814B2D0 - push {r4-r6,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - ldr r6, =0x03005d70 - 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 _0814B318 - ldrb r0, [r5] - adds r0, r6 - ldrb r0, [r0] - movs r2, 0 - bl heathbar_draw_hp - b _0814B332 - .pool -_0814B318: - ldr r2, =0x0202406e - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - adds r0, r2 - bl sub_805E990 - bl dp01_tbl4_exec_completed -_0814B332: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end bx_t4_healthbar_update - - thumb_func_start sub_814B340 -sub_814B340: @ 814B340 - push {r4-r6,lr} - ldr r6, =0x02020630 - ldr r5, =0x020241e4 - ldr r4, =0x02024064 - 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 _0814B3BC - ldr r1, =0x0202406e - lsls r0, r2, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - 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 rotscale_free_entry - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl RemoveObjectAndFreeTiles - ldr r1, =0x03005d70 - ldrb r0, [r4] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl dp01_tbl4_exec_completed -_0814B3BC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814B340 - - thumb_func_start sub_814B3DC -sub_814B3DC: @ 814B3DC - push {r4-r6,lr} - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r6, =0x02024064 - 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 _0814B430 - ldr r5, =0x020241e4 - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r1, =0x03005d70 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl dp01_tbl4_exec_completed -_0814B430: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814B3DC - - thumb_func_start bx_t4_button_a -bx_t4_button_a: @ 814B44C - push {lr} - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _0814B45E - bl dp01_tbl4_exec_completed -_0814B45E: - pop {r0} - bx r0 - thumb_func_end bx_t4_button_a - - thumb_func_start dp01t_0F_4_move_anim -dp01t_0F_4_move_anim: @ 814B464 - push {r4,lr} - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - ldr r2, =0x02020630 - 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 _0814B4B0 - 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, =0x020244b9 - strb r3, [r0] - bl dp01_tbl4_exec_completed - b _0814B4DA - .pool -_0814B4B0: - ldrh r0, [r4, 0x30] - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _0814B4D4 - 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] -_0814B4D4: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] -_0814B4DA: - pop {r4} - pop {r0} - bx r0 - thumb_func_end dp01t_0F_4_move_anim - - thumb_func_start sub_814B4E0 -sub_814B4E0: @ 814B4E0 - push {r4,lr} - ldr r2, =0x02020630 - ldr r0, =0x03005d70 - ldr r4, =0x02024064 - 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, =DummyObjectCallback - cmp r1, r0 - bne _0814B532 - adds r0, r3, 0 - bl sub_805E408 - ldr r0, =0x020244d0 - 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 _0814B526 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x6 - bl move_anim_start_t4 -_0814B526: - ldr r0, =0x03005d60 - ldrb r1, [r4] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_814B554 - str r0, [r1] -_0814B532: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814B4E0 - - thumb_func_start sub_814B554 -sub_814B554: @ 814B554 - push {lr} - ldr r0, =0x020244d0 - ldr r1, [r0] - ldr r0, =0x02024064 - 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 _0814B590 - ldr r2, =0x02020630 - ldr r0, =0x020241e4 - 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, =DummyObjectCallback - cmp r1, r0 - bne _0814B590 - bl dp01_tbl4_exec_completed -_0814B590: - pop {r0} - bx r0 - .pool - thumb_func_end sub_814B554 - - thumb_func_start sub_814B5A8 -sub_814B5A8: @ 814B5A8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r3, =0x020244d0 - ldr r0, [r3] - ldr r7, =0x02024064 - 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 _0814B664 - 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 FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - ldr r0, =c3_0802FDF4 - movs r1, 0xA - bl CreateTask - ldr r0, =0x0202406e - mov r8, r0 - ldrb r1, [r7] - lsls r0, r1, 1 - add r0, r8 - ldrh r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - bl sub_805E990 - ldr r1, =0x020241e4 - ldrb r0, [r7] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0 - bl StartObjectImageAnim - ldr r4, =0x03005d70 - 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, =0x03005d60 - ldrb r0, [r7] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_814B4E0 - str r1, [r0] -_0814B664: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814B5A8 - - thumb_func_start sub_814B69C -sub_814B69C: @ 814B69C - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r0, [r6] - ldr r4, =0x02024064 - 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 _0814B6CE - ldr r0, =0x0202406e - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_0814B6CE: - ldr r5, =0x02020630 - ldr r0, =0x03005d7c - 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, =DummyObjectCallback - cmp r1, r0 - bne _0814B714 - 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 _0814B714 - adds r0, r3, r5 - bl RemoveObjectAndFreeTiles - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_814B5A8 - str r1, [r0] -_0814B714: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814B69C - - thumb_func_start dp01_tbl4_exec_completed -dp01_tbl4_exec_completed: @ 814B740 - push {r4,lr} - sub sp, 0x4 - ldr r1, =0x03005d60 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_exec_buffer_A_ch0_tbl4 - str r1, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0814B794 - bl link_get_multiplayer_id - mov r1, sp - strb r0, [r1] - movs r0, 0x2 - movs r1, 0x4 - mov r2, sp - bl dp01_prepare_buffer_wireless_probably - ldr r1, =0x02023064 - ldrb r0, [r4] - lsls r0, 9 - adds r0, r1 - movs r1, 0x38 - strb r1, [r0] - b _0814B7A6 - .pool -_0814B794: - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldr r0, [r2] - bics r0, r1 - str r0, [r2] -_0814B7A6: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_tbl4_exec_completed - - thumb_func_start sub_814B7B8 -sub_814B7B8: @ 814B7B8 - push {lr} - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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 _0814B7DA - bl dp01_tbl4_exec_completed -_0814B7DA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_814B7B8 - - thumb_func_start sub_814B7E8 -sub_814B7E8: @ 814B7E8 - push {lr} - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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 _0814B80A - bl dp01_tbl4_exec_completed -_0814B80A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_814B7E8 - - thumb_func_start dp01t_00_4_getattr -dp01t_00_4_getattr: @ 814B818 - push {r4-r6,lr} - sub sp, 0x100 - movs r6, 0 - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _0814B850 - ldr r0, =0x0202406e - lsls r1, r2, 1 - adds r1, r0 - ldrb r0, [r1] - mov r1, sp - bl dp01_getattr_by_ch1_for_player_pokemon__ - adds r6, r0, 0 - b _0814B872 - .pool -_0814B850: - ldrb r4, [r1] - movs r5, 0 -_0814B854: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0814B86A - lsls r0, r5, 24 - lsrs r0, 24 - mov r2, sp - adds r1, r2, r6 - bl dp01_getattr_by_ch1_for_player_pokemon__ - adds r6, r0 -_0814B86A: - lsrs r4, 1 - adds r5, 0x1 - cmp r5, 0x5 - ble _0814B854 -_0814B872: - lsls r1, r6, 16 - lsrs r1, 16 - movs r0, 0x1 - mov r2, sp - bl dp01_build_cmdbuf_x1D_1D_numargs_varargs - bl dp01_tbl4_exec_completed - add sp, 0x100 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end dp01t_00_4_getattr - - thumb_func_start dp01_getattr_by_ch1_for_player_pokemon__ -dp01_getattr_by_ch1_for_player_pokemon__: @ 814B88C - 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, =0x02023064 - ldr r3, =0x02024064 - ldrb r0, [r3] - lsls r0, 9 - adds r1, r2, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3B - bls _0814B8B6 - bl _0814C022 -_0814B8B6: - lsls r0, 2 - ldr r1, =_0814B8CC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0814B8CC: - .4byte _0814B9BC - .4byte _0814BBE0 - .4byte _0814BBF0 - .4byte _0814BC00 - .4byte _0814BC68 - .4byte _0814BC68 - .4byte _0814BC68 - .4byte _0814BC68 - .4byte _0814BC84 - .4byte _0814BCC0 - .4byte _0814BCC0 - .4byte _0814BCC0 - .4byte _0814BCC0 - .4byte _0814C022 - .4byte _0814C022 - .4byte _0814C022 - .4byte _0814C022 - .4byte _0814BCDC - .4byte _0814BCEC - .4byte _0814BD1C - .4byte _0814BD2C - .4byte _0814BD3C - .4byte _0814BD4C - .4byte _0814BD5C - .4byte _0814BD6C - .4byte _0814BD7C - .4byte _0814BD8C - .4byte _0814BD9C - .4byte _0814BDAC - .4byte _0814BDBC - .4byte _0814BDCC - .4byte _0814BDDC - .4byte _0814BE2C - .4byte _0814BE3C - .4byte _0814BE4C - .4byte _0814BE5C - .4byte _0814BE6C - .4byte _0814BE7C - .4byte _0814BE8C - .4byte _0814BE9C - .4byte _0814BEAC - .4byte _0814BEE0 - .4byte _0814BEF0 - .4byte _0814BF00 - .4byte _0814BF10 - .4byte _0814BF20 - .4byte _0814BF30 - .4byte _0814BF40 - .4byte _0814BF50 - .4byte _0814BF70 - .4byte _0814BF80 - .4byte _0814BF90 - .4byte _0814BFA0 - .4byte _0814BFB0 - .4byte _0814BFC0 - .4byte _0814BFD0 - .4byte _0814BFE0 - .4byte _0814BFF0 - .4byte _0814C000 - .4byte _0814C010 -_0814B9BC: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - mov r1, sp - strh r0, [r1] - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr - 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 -_0814BA08: - adds r1, r6, 0 - adds r1, 0xD - mov r0, r8 - bl pokemon_getattr - strh r0, [r4] - adds r1, r6, 0 - adds r1, 0x11 - mov r0, r8 - bl pokemon_getattr - mov r2, r9 - adds r1, r2, r6 - strb r0, [r1] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _0814BA08 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - bl pokemon_getattr - mov r1, r10 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x20 - bl pokemon_getattr - ldr r2, [sp, 0x80] - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x19 - bl pokemon_getattr - str r0, [sp, 0x44] - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - str r0, [sp, 0x48] - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - str r0, [sp, 0x4C] - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - ldr r1, [sp, 0x7C] - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x28] - adds r0, r4, 0 - movs r1, 0x3A - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2C] - adds r0, r4, 0 - movs r1, 0x3B - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2] - adds r0, r4, 0 - movs r1, 0x3C - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x4] - adds r0, r4, 0 - movs r1, 0x3D - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x6] - adds r0, r4, 0 - movs r1, 0x3E - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x8] - adds r0, r4, 0 - movs r1, 0x3F - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0xA] - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - str r0, [sp, 0x54] - adds r0, r4, 0 - movs r1, 0x2 - ldr r2, [sp, 0x8C] - bl pokemon_getattr - ldr r0, [sp, 0x84] - ldr r1, [sp, 0x8C] - bl CopyString_Limit10 - adds r0, r4, 0 - movs r1, 0x7 - ldr r2, [sp, 0x88] - bl pokemon_getattr - mov r2, sp - movs r6, 0 -_0814BBC0: - adds r0, r7, r6 - adds r1, r2, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0x57 - bls _0814BBC0 - b _0814C022 - .pool -_0814BBE0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - b _0814BF5A - .pool -_0814BBF0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xC - b _0814BF5A - .pool -_0814BC00: - 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, =0x020244ec - adds r4, r1, r0 - mov r8, r9 -_0814BC16: - adds r1, r6, 0 - adds r1, 0xD - adds r0, r4, 0 - bl pokemon_getattr - mov r1, r8 - strh r0, [r1] - adds r1, r6, 0 - adds r1, 0x11 - adds r0, r4, 0 - bl pokemon_getattr - mov r2, r10 - adds r1, r2, r6 - strb r0, [r1] - movs r0, 0x2 - add r8, r0 - adds r6, 0x1 - cmp r6, 0x3 - ble _0814BC16 - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - mov r1, r9 - strb r0, [r1, 0xC] - mov r2, r9 - movs r6, 0 -_0814BC54: - adds r0, r7, r6 - adds r1, r2, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0xF - bls _0814BC54 - b _0814C022 - .pool -_0814BC68: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldrb r1, [r3] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - adds r1, 0x9 - b _0814BF5A - .pool -_0814BC84: - movs r6, 0 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r2, =0x020244ec - mov r8, r2 -_0814BC90: - adds r1, r6, 0 - adds r1, 0x11 - mov r2, r8 - adds r0, r4, r2 - bl pokemon_getattr - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - cmp r6, 0x3 - ble _0814BC90 - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - b _0814C022 - .pool -_0814BCC0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldrb r1, [r3] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - adds r1, 0x8 - b _0814C01A - .pool -_0814BCDC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1 - b _0814BCF6 - .pool -_0814BCEC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x19 -_0814BCF6: - bl pokemon_getattr - 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 _0814C022 - .pool -_0814BD1C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1A - b _0814C01A - .pool -_0814BD2C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1B - b _0814C01A - .pool -_0814BD3C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1C - b _0814C01A - .pool -_0814BD4C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1D - b _0814C01A - .pool -_0814BD5C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1E - b _0814C01A - .pool -_0814BD6C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1F - b _0814C01A - .pool -_0814BD7C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x20 - b _0814C01A - .pool -_0814BD8C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x22 - b _0814C01A - .pool -_0814BD9C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x23 - b _0814C01A - .pool -_0814BDAC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x24 - b _0814C01A - .pool -_0814BDBC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x25 - b _0814C01A - .pool -_0814BDCC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x26 - b _0814C01A - .pool -_0814BDDC: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_getattr - strb r0, [r7] - adds r0, r4, 0 - movs r1, 0x28 - bl pokemon_getattr - strb r0, [r7, 0x1] - adds r0, r4, 0 - movs r1, 0x29 - bl pokemon_getattr - strb r0, [r7, 0x2] - adds r0, r4, 0 - movs r1, 0x2A - bl pokemon_getattr - strb r0, [r7, 0x3] - adds r0, r4, 0 - movs r1, 0x2B - bl pokemon_getattr - strb r0, [r7, 0x4] - adds r0, r4, 0 - movs r1, 0x2C - bl pokemon_getattr - strb r0, [r7, 0x5] - movs r6, 0x6 - b _0814C022 - .pool -_0814BE2C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x27 - b _0814C01A - .pool -_0814BE3C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x28 - b _0814C01A - .pool -_0814BE4C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x29 - b _0814C01A - .pool -_0814BE5C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2A - b _0814C01A - .pool -_0814BE6C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2B - b _0814C01A - .pool -_0814BE7C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2C - b _0814C01A - .pool -_0814BE8C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0 - b _0814BEB6 - .pool -_0814BE9C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x9 - b _0814BF5A - .pool -_0814BEAC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x37 -_0814BEB6: - bl pokemon_getattr - 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 _0814C022 - .pool -_0814BEE0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x38 - b _0814C01A - .pool -_0814BEF0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x39 - b _0814BF5A - .pool -_0814BF00: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3A - b _0814BF5A - .pool -_0814BF10: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3B - b _0814BF5A - .pool -_0814BF20: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3C - b _0814BF5A - .pool -_0814BF30: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3D - b _0814BF5A - .pool -_0814BF40: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3E - b _0814BF5A - .pool -_0814BF50: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3F -_0814BF5A: - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - strb r0, [r7] - lsrs r0, 8 - strb r0, [r7, 0x1] - movs r6, 0x2 - b _0814C022 - .pool -_0814BF70: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x16 - b _0814C01A - .pool -_0814BF80: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x17 - b _0814C01A - .pool -_0814BF90: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x18 - b _0814C01A - .pool -_0814BFA0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x21 - b _0814C01A - .pool -_0814BFB0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2F - b _0814C01A - .pool -_0814BFC0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x30 - b _0814C01A - .pool -_0814BFD0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x32 - b _0814C01A - .pool -_0814BFE0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x33 - b _0814C01A - .pool -_0814BFF0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x34 - b _0814C01A - .pool -_0814C000: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x35 - b _0814C01A - .pool -_0814C010: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x36 -_0814C01A: - bl pokemon_getattr - strb r0, [r7] - movs r6, 0x1 -_0814C022: - 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 dp01_getattr_by_ch1_for_player_pokemon__ - - thumb_func_start sub_814C038 -sub_814C038: @ 814C038 - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814C038 - - thumb_func_start sub_814C044 -sub_814C044: @ 814C044 - push {r4,r5,lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _0814C074 - ldr r0, =0x0202406e - lsls r1, r2, 1 - adds r1, r0 - ldrb r0, [r1] - bl sub_814C09C - b _0814C092 - .pool -_0814C074: - ldrb r4, [r1] - movs r5, 0 -_0814C078: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0814C086 - adds r0, r5, 0 - bl sub_814C09C -_0814C086: - lsrs r4, 1 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _0814C078 -_0814C092: - bl dp01_tbl4_exec_completed - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_814C044 - - thumb_func_start sub_814C09C -sub_814C09C: @ 814C09C - 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, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - ldr r2, =0x02023067 - 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 _0814C0C8 - bl _0814CA62 -_0814C0C8: - lsls r0, 2 - ldr r1, =_0814C0E0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0814C0E0: - .4byte _0814C1D0 - .4byte _0814C368 - .4byte _0814C388 - .4byte _0814C3A8 - .4byte _0814C400 - .4byte _0814C400 - .4byte _0814C400 - .4byte _0814C400 - .4byte _0814C428 - .4byte _0814C48C - .4byte _0814C48C - .4byte _0814C48C - .4byte _0814C48C - .4byte _0814CA62 - .4byte _0814CA62 - .4byte _0814CA62 - .4byte _0814CA62 - .4byte _0814C4BC - .4byte _0814C4DC - .4byte _0814C4FC - .4byte _0814C51C - .4byte _0814C53C - .4byte _0814C55C - .4byte _0814C57C - .4byte _0814C59C - .4byte _0814C5BC - .4byte _0814C5DC - .4byte _0814C5FC - .4byte _0814C61C - .4byte _0814C63C - .4byte _0814C65C - .4byte _0814C67C - .4byte _0814C6EC - .4byte _0814C70C - .4byte _0814C72C - .4byte _0814C74C - .4byte _0814C76C - .4byte _0814C78C - .4byte _0814C7AC - .4byte _0814C7CC - .4byte _0814C7EC - .4byte _0814C80C - .4byte _0814C82C - .4byte _0814C84C - .4byte _0814C86C - .4byte _0814C88C - .4byte _0814C8AC - .4byte _0814C8CC - .4byte _0814C8EC - .4byte _0814C90C - .4byte _0814C92C - .4byte _0814C94C - .4byte _0814C96C - .4byte _0814C98C - .4byte _0814C9AC - .4byte _0814C9CC - .4byte _0814C9EC - .4byte _0814CA0C - .4byte _0814CA2C - .4byte _0814CA4C -_0814C1D0: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - adds r2, r6, 0 - bl pokemon_setattr - adds r2, r6, 0 - adds r2, 0x2E - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_setattr - 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 -_0814C236: - mov r1, r8 - adds r1, 0xD - mov r0, r9 - adds r2, r4, 0 - bl pokemon_setattr - mov r1, r8 - adds r1, 0x11 - mov r0, r9 - adds r2, r7, 0 - bl pokemon_setattr - adds r7, 0x1 - adds r4, 0x2 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x3 - ble _0814C236 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - mov r2, r10 - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x20 - ldr r2, [sp, 0x20] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x19 - ldr r2, [sp, 0x28] - bl pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - adds r0, r4, 0 - movs r1, 0 - ldr r2, [sp, 0x2C] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x37 - ldr r2, [sp, 0x30] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x38 - ldr r2, [sp, 0x1C] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x39 - ldr r2, [sp, 0x18] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3A - ldr r2, [sp, 0x24] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3B - ldr r2, [sp, 0x4] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3C - ldr r2, [sp, 0x8] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3D - ldr r2, [sp, 0xC] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3E - ldr r2, [sp, 0x10] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3F - ldr r2, [sp, 0x14] - bl pokemon_setattr - b _0814CA62 - .pool -_0814C368: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0xB - bl pokemon_setattr - b _0814CA62 - .pool -_0814C388: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0xC - bl pokemon_setattr - b _0814CA62 - .pool -_0814C3A8: - 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, =0x020244ec - adds r7, r1, r0 - adds r6, r3, 0 - adds r6, 0x8 - adds r4, r3, 0 -_0814C3C2: - mov r1, r8 - adds r1, 0xD - adds r0, r7, 0 - adds r2, r4, 0 - bl pokemon_setattr - mov r1, r8 - adds r1, 0x11 - adds r0, r7, 0 - adds r2, r6, 0 - bl pokemon_setattr - adds r6, 0x1 - adds r4, 0x2 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x3 - ble _0814C3C2 - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x15 - mov r2, r9 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C400: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r3, =0x02023064 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r1, r3, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r1, 0x9 - b _0814C4A4 - .pool -_0814C428: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - ldr r5, =0x02024064 - ldrb r2, [r5] - lsls r2, 9 - adds r2, r7 - adds r0, r4, 0 - movs r1, 0x11 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x1 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x12 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x2 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x13 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x3 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x14 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x4 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x15 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C48C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r3, =0x02023064 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r1, r3, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r1, 0x8 -_0814C4A4: - adds r3, 0x3 - adds r2, r3 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C4BC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C4DC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x19 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C4FC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1A - bl pokemon_setattr - b _0814CA62 - .pool -_0814C51C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1B - bl pokemon_setattr - b _0814CA62 - .pool -_0814C53C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1C - bl pokemon_setattr - b _0814CA62 - .pool -_0814C55C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1D - bl pokemon_setattr - b _0814CA62 - .pool -_0814C57C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1E - bl pokemon_setattr - b _0814CA62 - .pool -_0814C59C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1F - bl pokemon_setattr - b _0814CA62 - .pool -_0814C5BC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x20 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C5DC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x22 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C5FC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x23 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C61C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x24 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C63C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x25 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C65C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x26 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C67C: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - ldr r5, =0x02024064 - ldrb r2, [r5] - lsls r2, 9 - adds r2, r7 - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x1 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x28 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x2 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x29 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x3 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2A - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x4 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2B - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x5 - adds r2, r0 - adds r0, r4, 0 - b _0814C79C - .pool -_0814C6EC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x27 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C70C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x28 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C72C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x29 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C74C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x2A - bl pokemon_setattr - b _0814CA62 - .pool -_0814C76C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x2B - bl pokemon_setattr - b _0814CA62 - .pool -_0814C78C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 -_0814C79C: - movs r1, 0x2C - bl pokemon_setattr - b _0814CA62 - .pool -_0814C7AC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C7CC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x9 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C7EC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x37 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C80C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x38 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C82C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x39 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C84C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3A - bl pokemon_setattr - b _0814CA62 - .pool -_0814C86C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3B - bl pokemon_setattr - b _0814CA62 - .pool -_0814C88C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3C - bl pokemon_setattr - b _0814CA62 - .pool -_0814C8AC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3D - bl pokemon_setattr - b _0814CA62 - .pool -_0814C8CC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3E - bl pokemon_setattr - b _0814CA62 - .pool -_0814C8EC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3F - bl pokemon_setattr - b _0814CA62 - .pool -_0814C90C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x16 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C92C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x17 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C94C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x18 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C96C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x21 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C98C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x2F - bl pokemon_setattr - b _0814CA62 - .pool -_0814C9AC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x30 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C9CC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x32 - bl pokemon_setattr - b _0814CA62 - .pool -_0814C9EC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x33 - bl pokemon_setattr - b _0814CA62 - .pool -_0814CA0C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x34 - bl pokemon_setattr - b _0814CA62 - .pool -_0814CA2C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x35 - bl pokemon_setattr - b _0814CA62 - .pool -_0814CA4C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x36 - bl pokemon_setattr -_0814CA62: - ldr r2, =0x0202406e - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - 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_814C09C - - thumb_func_start sub_814CA98 -sub_814CA98: @ 814CA98 - push {r4-r7,lr} - ldr r1, =0x0202406e - ldr r7, =0x02024064 - 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, =0x02023064 - lsls r2, 9 - adds r0, r4, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - ldr r1, =0x020244ec - adds r0, r1 - adds r5, r3, r0 - movs r3, 0 - adds r0, r4, 0x2 - adds r2, r0 - ldrb r2, [r2] - cmp r3, r2 - bcs _0814CAF0 - adds r6, r4, 0 - adds r2, r7, 0 - adds r4, r0, 0 -_0814CACE: - 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 _0814CACE -_0814CAF0: - bl dp01_tbl4_exec_completed - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814CA98 - - thumb_func_start sub_814CB0C -sub_814CB0C: @ 814CB0C - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =0x0202406e - mov r8, r0 - ldr r6, =0x02024064 - ldrb r1, [r6] - lsls r0, r1, 1 - add r0, r8 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - 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 pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r6] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_806A068 - ldr r0, =0x0202499c - 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 AddObjectToFront - ldr r4, =0x020241e4 - ldrb r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r5, =0x02020630 - 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, =0x020244e4 - adds r2, r1 - ldrb r1, [r2] - bl StartObjectImageAnim - ldr r1, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_814B290 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814CB0C - - thumb_func_start sub_814CC28 -sub_814CC28: @ 814CC28 - push {r4-r6,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - ldr r4, =0x02023064 - lsls r1, r0, 9 - adds r6, r4, 0x2 - adds r1, r6 - ldrb r1, [r1] - bl sub_805EF84 - ldr r2, =0x0202406e - 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, =0x020244ec - adds r0, r2 - bl sub_805DD7C - ldrb r0, [r5] - lsls r1, r0, 9 - adds r1, r6 - ldrb r1, [r1] - bl sub_814CC98 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_814B69C - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814CC28 - - thumb_func_start sub_814CC98 -sub_814CC98: @ 814CC98 - 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, =0x0202406e - lsls r2, r6, 1 - adds r2, r0 - ldr r0, =0x02023064 - 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, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - mov r8, r0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r0, =sub_805D714 - bl object_new_hidden_with_callback - ldr r1, =0x03005d7c - mov r9, r1 - add r9, r6 - mov r1, r9 - strb r0, [r1] - adds r0, r6, 0 - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl sub_806A068 - ldr r0, =0x0202499c - 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 AddObjectToFront - ldr r4, =0x020241e4 - adds r4, r6, r4 - strb r0, [r4] - ldr r5, =0x02020630 - 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, =0x020244e4 - adds r6, r1 - ldrb r1, [r6] - bl StartObjectImageAnim - 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, =DummyObjectCallback - 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_814CC98 - - thumb_func_start sub_814CE14 -sub_814CE14: @ 814CE14 - push {r4-r6,lr} - ldr r1, =0x02023064 - ldr r6, =0x02024064 - ldrb r2, [r6] - lsls r0, r2, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r3, [r0] - cmp r3, 0 - bne _0814CE5C - ldr r0, =0x020244d0 - 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, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_814CEA4 - str r1, [r0] - b _0814CE92 - .pool -_0814CE5C: - ldr r5, =0x020241e4 - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r1, =0x03005d70 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl dp01_tbl4_exec_completed -_0814CE92: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814CE14 - - thumb_func_start sub_814CEA4 -sub_814CEA4: @ 814CEA4 - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r4, [r6] - ldr r5, =0x02024064 - 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 _0814CECC - cmp r0, 0x1 - beq _0814CEFA - b _0814CF22 - .pool -_0814CECC: - ldr r1, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0814CEE6 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_0814CEE6: - 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 _0814CF22 -_0814CEFA: - ldrb r1, [r3] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0814CF22 - 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, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_814B3DC - str r1, [r0] -_0814CF22: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814CEA4 - - thumb_func_start sub_814CF30 -sub_814CF30: @ 814CF30 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0814CF60 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_get_per_side_status - movs r1, 0x2 - ands r1, r0 - movs r7, 0x20 - cmp r1, 0 - beq _0814CF62 - movs r7, 0x5A - b _0814CF62 - .pool -_0814CF60: - movs r7, 0x50 -_0814CF62: - ldr r5, =0x02024064 - ldrb r0, [r5] - bl sub_806D864 - ldr r6, =0x020229e8 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - movs r4, 0xFF - ldrb r0, [r1] - cmp r0, 0x4 - beq _0814CF94 - ldrb r0, [r5] - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrh r1, [r1] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x5 - bne _0814CFB0 -_0814CF94: - ldrb r0, [r5] - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r1, 0x13] - adds r4, r0, 0x2 - b _0814D002 - .pool -_0814CFB0: - ldrb r0, [r5] - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrh r1, [r1] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x2 - beq _0814CFDE - ldrb r0, [r5] - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrh r0, [r1] - ands r4, r0 - cmp r4, 0x1 - bne _0814CFF2 -_0814CFDE: - ldrb r0, [r5] - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r0, [r1, 0x13] - adds r4, r0, 0x4 - b _0814D002 -_0814CFF2: - ldrb r0, [r5] - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r4, [r1, 0x13] -_0814D002: - ldr r5, =0x02024064 - ldrb r1, [r5] - adds r0, r4, 0 - bl sub_805DF84 - ldrb r0, [r5] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl template_build_for_pokemon_or_trainer - ldr r6, =0x0202499c - mov r8, r7 - ldr r0, =gUnknown_08305D2C - lsls r4, 2 - adds r4, r0 - ldrb r0, [r4] - movs r4, 0x8 - subs r4, r0 - lsls r4, 18 - movs r0, 0xA0 - lsls r0, 15 - 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, r8 - adds r2, r4, 0 - bl AddObjectToFront - ldr r6, =0x020241e4 - ldrb r1, [r5] - adds r1, r6 - strb r0, [r1] - ldr r4, =0x02020630 - 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] - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_814AF1C - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814CF30 - - thumb_func_start sub_814D0E4 -sub_814D0E4: @ 814D0E4 - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814D0E4 - - thumb_func_start sub_814D0F0 -sub_814D0F0: @ 814D0F0 - push {r4-r6,lr} - ldr r6, =0x020241e4 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =0x02020630 - 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, =DummyObjectCallback - bl oamt_set_x3A_32 - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_814AF54 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814D0F0 - - thumb_func_start sub_814D19C -sub_814D19C: @ 814D19C - push {r4-r6,lr} - ldr r6, =0x020244d0 - ldr r4, [r6] - ldr r5, =0x02024064 - 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 _0814D1F0 - ldr r1, [r4] - lsls r0, r2, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0814D1D0 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_0814D1D0: - 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 _0814D266 - .pool -_0814D1F0: - ldrb r1, [r3] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0814D266 - strb r4, [r3, 0x4] - ldr r2, =0x0202406e - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - adds r0, r2 - bl sub_805E990 - movs r1, 0x40 - negs r1, r1 - movs r0, 0x10 - bl audio_play_and_stuff - ldr r2, =0x02020630 - ldr r3, =0x020241e4 - 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, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_814B340 - str r1, [r0] -_0814D266: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814D19C - - thumb_func_start sub_814D288 -sub_814D288: @ 814D288 - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814D288 - - thumb_func_start sub_814D294 -sub_814D294: @ 814D294 - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814D294 - - thumb_func_start sub_814D2A0 -sub_814D2A0: @ 814D2A0 - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814D2A0 - - thumb_func_start sub_814D2AC -sub_814D2AC: @ 814D2AC - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814D2AC - - thumb_func_start sub_814D2B8 -sub_814D2B8: @ 814D2B8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r5, =0x02024064 - ldrb r0, [r5] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - beq _0814D2CE - b _0814D3F4 -_0814D2CE: - ldr r0, =0x02023064 - mov r12, r0 - ldrb r1, [r5] - lsls r1, 9 - adds r0, 0x1 - adds r0, r1, r0 - ldrb r6, [r0] - mov r0, r12 - adds r0, 0x2 - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 8 - orrs r6, r0 - ldr r0, =0x02038432 - mov r8, r0 - mov r0, r12 - adds r0, 0x3 - adds r1, r0 - ldrb r0, [r1] - mov r1, r8 - strb r0, [r1] - ldr r3, =0x02038408 - ldrb r1, [r5] - lsls r1, 9 - mov r0, r12 - adds r0, 0x4 - adds r0, r1, r0 - ldrb r2, [r0] - mov r0, r12 - adds r0, 0x5 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 8 - orrs r2, r0 - strh r2, [r3] - ldr r3, =0x02038404 - ldrb r1, [r5] - lsls r1, 9 - mov r0, r12 - adds r0, 0x6 - adds r0, r1, r0 - ldrb r2, [r0] - mov r0, r12 - adds r0, 0x7 - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 8 - orrs r2, r0 - mov r0, r12 - adds r0, 0x8 - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 16 - orrs r2, r0 - mov r0, r12 - adds r0, 0x9 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 24 - orrs r2, r0 - str r2, [r3] - ldr r2, =0x0203841a - ldrb r0, [r5] - lsls r0, 9 - mov r1, r12 - adds r1, 0xA - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r4, =0x0203841c - ldrb r1, [r5] - lsls r1, 9 - mov r0, r12 - adds r0, 0xC - adds r0, r1, r0 - ldrb r2, [r0] - mov r0, r12 - adds r0, 0xD - adds r1, r0 - ldrb r0, [r1] - lsls r0, 8 - orrs r2, r0 - strh r2, [r4] - ldr r7, =0x02038400 - ldrb r1, [r5] - lsls r1, 9 - mov r0, r12 - adds r0, 0x10 - adds r1, r0 - str r1, [r7] - ldr r2, =0x020244bc - ldrb r0, [r5] - lsls r0, 2 - adds r0, r2 - ldr r1, [r1] - str r1, [r0] - mov r0, r8 - ldrb r1, [r0] - adds r0, r6, 0 - bl sub_805DB8C - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - beq _0814D3CC - bl dp01_tbl4_exec_completed - b _0814D3F4 - .pool -_0814D3CC: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldrb r1, [r5] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strb r3, [r0, 0x4] - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_move_anim_4 - str r1, [r0] - ldrh r1, [r4] - ldr r2, [r7] - adds r0, r6, 0 - bl sub_817E0FC -_0814D3F4: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814D2B8 - - thumb_func_start bx_move_anim_4 -bx_move_anim_4: @ 814D40C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r2, =0x02023064 - ldr r6, =0x02024064 - 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, =0x020244d0 - 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 _0814D4A4 - cmp r2, 0x1 - bgt _0814D464 - cmp r2, 0 - beq _0814D46E - b _0814D580 - .pool -_0814D464: - cmp r2, 0x2 - beq _0814D4CE - cmp r2, 0x3 - beq _0814D544 - b _0814D580 -_0814D46E: - ldr r1, [r5] - lsls r0, r3, 2 - adds r1, r0, r1 - ldrb r2, [r1] - movs r0, 0xC - ands r0, r2 - cmp r0, 0x4 - bne _0814D490 - 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 -_0814D490: - 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 _0814D580 -_0814D4A4: - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0814D580 - 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 _0814D580 -_0814D4CE: - ldr r0, =0x020383f8 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =0x020383fd - ldrb r0, [r0] - cmp r0, 0 - bne _0814D580 - 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 _0814D51C - mov r0, r8 - cmp r0, 0x1 - bhi _0814D51C - 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] -_0814D51C: - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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 _0814D580 - .pool -_0814D544: - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0814D580 - 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 dp01_tbl4_exec_completed -_0814D580: - 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_4 - - thumb_func_start sub_814D590 -sub_814D590: @ 814D590 - push {r4,r5,lr} - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r5, =0x02024064 - ldrb r4, [r5] - lsls r4, 9 - ldr r0, =0x02023066 - adds r4, r0 - ldrh r0, [r4] - bl battle_pick_message - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_t4_button_a - str r1, [r0] - ldrh r0, [r4] - bl sub_817C95C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814D590 - - thumb_func_start sub_814D5E8 -sub_814D5E8: @ 814D5E8 - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814D5E8 - - thumb_func_start sub_814D5F4 -sub_814D5F4: @ 814D5F4 - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814D5F4 - - thumb_func_start sub_814D600 -sub_814D600: @ 814D600 - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814D600 - - thumb_func_start sub_814D60C -sub_814D60C: @ 814D60C - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814D60C - - thumb_func_start sub_814D618 -sub_814D618: @ 814D618 - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814D618 - - thumb_func_start sub_814D624 -sub_814D624: @ 814D624 - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814D624 - - thumb_func_start sub_814D630 -sub_814D630: @ 814D630 - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814D630 - - thumb_func_start sub_814D63C -sub_814D63C: @ 814D63C - 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, =0x02023064 - ldr r0, =0x02024064 - 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 _0814D6CC - ldr r6, =0x0202406e - lsls r0, r4, 1 - adds r0, r6 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - movs r1, 0x3A - bl pokemon_getattr - 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 pokemon_getattr - adds r3, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r1, =0x03005d70 - adds r1, r0, r1 - ldrb r1, [r1] - str r7, [sp] - mov r2, r8 - bl sub_807294C - b _0814D6F6 - .pool -_0814D6CC: - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3A - bl pokemon_getattr - adds r2, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r1, =0x03005d70 - adds r1, r0, r1 - ldrb r1, [r1] - str r7, [sp] - movs r3, 0 - bl sub_807294C -_0814D6F6: - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_t4_healthbar_update - 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_814D63C - - thumb_func_start sub_814D72C -sub_814D72C: @ 814D72C - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814D72C - - thumb_func_start sub_814D738 -sub_814D738: @ 814D738 - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _0814D78C - ldr r0, =0x03005d70 - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0x9 - bl healthbar_draw_field_maybe - ldrb r2, [r4] - ldr r0, =0x020244d0 - 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, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_814B7B8 - str r1, [r0] -_0814D78C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814D738 - - thumb_func_start sub_814D7B0 -sub_814D7B0: @ 814D7B0 - push {r4,r5,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _0814D800 - ldr r4, =0x02023064 - 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, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_814B7B8 - str r1, [r0] -_0814D800: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814D7B0 - - thumb_func_start sub_814D818 -sub_814D818: @ 814D818 - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814D818 - - thumb_func_start sub_814D824 -sub_814D824: @ 814D824 - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814D824 - - thumb_func_start sub_814D830 -sub_814D830: @ 814D830 - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814D830 - - thumb_func_start sub_814D83C -sub_814D83C: @ 814D83C - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814D83C - - thumb_func_start sub_814D848 -sub_814D848: @ 814D848 - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814D848 - - thumb_func_start sub_814D854 -sub_814D854: @ 814D854 - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814D854 - - thumb_func_start sub_814D860 -sub_814D860: @ 814D860 - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814D860 - - thumb_func_start sub_814D86C -sub_814D86C: @ 814D86C - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814D86C - - thumb_func_start sub_814D878 -sub_814D878: @ 814D878 - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814D878 - - thumb_func_start sub_814D884 -sub_814D884: @ 814D884 - push {lr} - ldr r2, =0x02022d0c - ldrb r1, [r2] - movs r0, 0x80 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_814D884 - - thumb_func_start sub_814D8A0 -sub_814D8A0: @ 814D8A0 - push {lr} - ldr r3, =0x02022d0c - ldr r1, =0x02023064 - ldr r0, =0x02024064 - 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 dp01_tbl4_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_814D8A0 - - thumb_func_start sub_814D8D8 -sub_814D8D8: @ 814D8D8 - push {lr} - ldr r2, =0x02022d0c - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_814D8D8 - - thumb_func_start sub_814D8F0 -sub_814D8F0: @ 814D8F0 - push {lr} - ldr r3, =0x02022d0c - 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 dp01_tbl4_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_814D8F0 - - thumb_func_start dp01t_29_4_blink -dp01t_29_4_blink: @ 814D918 - push {r4,lr} - ldr r3, =0x02020630 - ldr r2, =0x020241e4 - ldr r4, =0x02024064 - 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 _0814D94C - bl dp01_tbl4_exec_completed - b _0814D976 - .pool -_0814D94C: - ldr r1, =0x020244b9 - 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, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =dp01t_0F_4_move_anim - str r1, [r0] -_0814D976: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_29_4_blink - - thumb_func_start sub_814D988 -sub_814D988: @ 814D988 - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814D988 - - thumb_func_start sub_814D994 -sub_814D994: @ 814D994 - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - movs r3, 0x3F - cmp r0, 0 - bne _0814D9A8 - movs r3, 0xC0 -_0814D9A8: - ldr r2, =0x02023064 - 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 audio_play_and_stuff - bl dp01_tbl4_exec_completed - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814D994 - - thumb_func_start sub_814D9D8 -sub_814D9D8: @ 814D9D8 - push {r4,r5,lr} - ldr r4, =0x02023064 - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r3, r0, 9 - adds r0, r4, 0x3 - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0 - beq _0814DA14 - 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 song_play_for_text - b _0814DA28 - .pool -_0814DA14: - 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 fanfare_play -_0814DA28: - bl dp01_tbl4_exec_completed - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_814D9D8 - - thumb_func_start sub_814DA34 -sub_814DA34: @ 814DA34 - push {lr} - ldr r1, =0x0202406e - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x19 - negs r1, r1 - movs r2, 0x5 - bl sub_80A32E4 - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_814DA34 - - thumb_func_start dp01t_2E_4_battle_intro -dp01t_2E_4_battle_intro: @ 814DA74 - push {lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - bl battle_intro_launch - ldr r2, =0x020243fc - ldrh r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strh r0, [r2] - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_2E_4_battle_intro - - thumb_func_start sub_814DAA8 -sub_814DAA8: @ 814DAA8 - push {r4-r7,lr} - ldr r5, =0x020241e4 - ldr r6, =0x02024064 - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - 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 StartObjectImageAnim - ldr r0, =0x0000d6f9 - bl AllocObjectPalette - lsls r0, 24 - lsrs r7, r0, 24 - ldrb r0, [r6] - bl sub_806D864 - ldr r4, =0x020229e8 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - movs r5, 0xFF - ldrb r0, [r1] - cmp r0, 0x4 - beq _0814DB80 - ldrb r0, [r6] - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0x5 - bne _0814DBB4 -_0814DB80: - ldrb r0, [r6] - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r1, 0x13] - adds r0, 0x2 - b _0814DC06 - .pool -_0814DBB4: - ldrb r0, [r6] - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0x2 - beq _0814DBE2 - ldrb r0, [r6] - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r1] - ands r5, r0 - cmp r5, 0x1 - bne _0814DBF6 -_0814DBE2: - ldrb r0, [r6] - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r1, 0x13] - adds r0, 0x4 - b _0814DC06 -_0814DBF6: - ldrb r0, [r6] - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r1, 0x13] -_0814DC06: - ldr r1, =gTrainerBackPicPaletteTable - lsls r0, 3 - adds r0, r1 - ldr r0, [r0] - lsls r4, r7, 4 - movs r2, 0x80 - lsls r2, 1 - adds r1, r4, r2 - movs r2, 0x20 - bl decompress_palette - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r5, =0x02024064 - 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_814DCCC - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r4 - ldrb r0, [r5] - strh r0, [r1, 0x8] - ldr r3, =0x020244d0 - 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 _0814DC80 - ldr r0, =0x020244b4 - 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] -_0814DC80: - ldr r0, [r3] - ldr r2, [r0, 0x8] - ldrb r0, [r2, 0x9] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x9] - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =nullsub_112 - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814DAA8 - - thumb_func_start sub_814DCCC -sub_814DCCC: @ 814DCCC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =0x03005e00 - 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 _0814DCF8 - adds r0, r2, 0x1 - strh r0, [r1, 0xA] - b _0814DDB4 - .pool -_0814DCF8: - ldr r7, =0x02024064 - 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 _0814DD18 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0814DD48 -_0814DD18: - ldr r0, =0x02023064 - ldrb r1, [r7] - lsls r2, r1, 9 - adds r0, 0x1 - adds r2, r0 - ldr r0, =0x0202406e - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - strb r0, [r2] - ldrb r0, [r7] - movs r1, 0 - bl sub_814CC98 - b _0814DD9C - .pool -_0814DD48: - ldr r4, =0x02023064 - ldrb r0, [r7] - lsls r1, r0, 9 - adds r4, 0x1 - adds r1, r4 - ldr r5, =0x0202406e - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - strb r0, [r1] - ldrb r0, [r7] - movs r1, 0 - bl sub_814CC98 - 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, =0x020244ec - adds r0, r2 - bl sub_805DD7C - ldrb r0, [r7] - movs r1, 0 - bl sub_814CC98 - ldrb r0, [r7] - eors r0, r6 - strb r0, [r7] -_0814DD9C: - ldr r1, =0x03005d60 - ldr r2, =0x02024064 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_814B0E8 - str r1, [r0] - mov r3, r9 - strb r3, [r2] - mov r0, r8 - bl DestroyTask -_0814DDB4: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814DCCC - - thumb_func_start sub_814DDD8 -sub_814DDD8: @ 814DDD8 - push {r4-r6,lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _0814DE08 - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0814DE08 - bl dp01_tbl4_exec_completed - b _0814DE7C - .pool -_0814DE08: - ldr r6, =0x020244d0 - ldr r0, [r6] - ldr r5, =0x02024064 - 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, =0x02023068 - 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, =0x020244b4 - 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 _0814DE70 - 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] -_0814DE70: - ldr r0, =0x03005d60 - ldrb r1, [r5] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_814DE9C - str r0, [r1] -_0814DE7C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814DDD8 - - thumb_func_start sub_814DE9C -sub_814DE9C: @ 814DE9C - push {r4,lr} - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r3, =0x02024064 - 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 _0814DED4 - 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 dp01_tbl4_exec_completed -_0814DED4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814DE9C - - thumb_func_start sub_814DEE4 -sub_814DEE4: @ 814DEE4 - push {lr} - ldr r0, =0x020244d0 - ldr r1, [r0] - ldr r0, =0x02024064 - 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 _0814DF16 - ldr r2, =0x03005e00 - ldr r0, =0x020244b4 - 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] -_0814DF16: - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_814DEE4 - - thumb_func_start sub_814DF34 -sub_814DF34: @ 814DF34 - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814DF34 - - thumb_func_start sub_814DF40 -sub_814DF40: @ 814DF40 - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl sub_80A6A90 - lsls r0, 24 - cmp r0, 0 - beq _0814DF86 - ldr r3, =0x02020630 - ldr r0, =0x020241e4 - 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, =0x02023064 - 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 -_0814DF86: - bl dp01_tbl4_exec_completed - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814DF40 - - thumb_func_start sub_814DFA0 -sub_814DFA0: @ 814DFA0 - push {r4-r6,lr} - sub sp, 0x4 - ldr r5, =0x02024064 - ldrb r0, [r5] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _0814E002 - ldr r4, =0x02023064 - ldrb r2, [r5] - lsls r1, r2, 9 - adds r0, r4, 0x1 - adds r0, r1, r0 - ldrb r6, [r0] - adds r0, r4, 0x2 - adds r0, r1, r0 - ldrb r3, [r0] - adds r4, 0x3 - adds r1, r4 - ldrb r0, [r1] - lsls r0, 8 - orrs r3, r0 - str r3, [sp] - adds r0, r2, 0 - adds r1, r2, 0 - adds r3, r6, 0 - bl move_anim_start_t3 - lsls r0, 24 - cmp r0, 0 - beq _0814DFF0 - bl dp01_tbl4_exec_completed - b _0814DFFC - .pool -_0814DFF0: - ldr r0, =0x03005d60 - ldrb r1, [r5] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_814B7E8 - str r0, [r1] -_0814DFFC: - adds r0, r6, 0 - bl sub_817E32C -_0814E002: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814DFA0 - - thumb_func_start sub_814E014 -sub_814E014: @ 814E014 - push {lr} - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - ldr r1, =0x02023066 - adds r0, r1 - bl sub_81851A8 - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_814E014 - - thumb_func_start sub_814E034 -sub_814E034: @ 814E034 - push {lr} - bl dp01_tbl4_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_814E034 - - thumb_func_start sub_814E040 -sub_814E040: @ 814E040 - push {r4,r5,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r0, 9 - ldr r4, =0x02023068 - adds r0, r4 - bl sub_81851A8 - ldr r2, =0x0202433a - ldrb r0, [r5] - lsls r0, 9 - subs r1, r4, 0x3 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r0, =0x03005d90 - ldr r3, [r0] - ldrb r0, [r5] - lsls r0, 9 - subs r4, 0x2 - adds r0, r4 - ldrb r0, [r0] - ldr r1, =0x00000ca9 - adds r3, r1 - movs r1, 0x1 - ands r1, r0 - lsls r1, 3 - ldrb r2, [r3] - movs r0, 0x9 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - movs r0, 0x5 - bl sub_80A2F50 - movs r0, 0x3 - bl sub_80A2390 - bl dp01_tbl4_exec_completed - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_80587B0 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814E040 - - thumb_func_start nullsub_113 -nullsub_113: @ 814E0C0 - bx lr - thumb_func_end nullsub_113 - - thumb_func_start battle_pick_message -battle_pick_message: @ 814E0C4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r6, r0, 16 - movs r7, 0 - ldr r4, =0x0203aba8 - ldr r0, =0x02024064 - mov r8, r0 - ldrb r1, [r0] - lsls r1, 9 - ldr r0, =0x02023068 - adds r1, r0 - str r1, [r4] - ldr r2, =0x02024208 - ldrh r0, [r1, 0x4] - strh r0, [r2] - ldr r2, =0x0202420a - ldrb r0, [r1, 0x6] - strb r0, [r2] - ldr r5, =0x02024474 - ldrb r0, [r1, 0x7] - strb r0, [r5, 0x17] - ldr r3, =0x0202449c - ldr r0, [r3] - adds r0, 0x52 - ldrb r1, [r1, 0x8] - strb r1, [r0] - ldr r0, [r3] - adds r0, 0xB1 - ldr r1, [r4] - ldrb r1, [r1, 0x9] - strb r1, [r0] - ldr r1, =0x0202420f - ldr r2, [r4] - ldrb r0, [r2, 0xA] - strb r0, [r1] - ldr r0, [r3] - adds r0, 0x8E - ldrb r1, [r2, 0xB] - strb r1, [r0] - movs r2, 0 - mov r12, r8 - mov r9, r5 - ldr r1, =0x02022f58 - mov r10, r1 - ldr r3, =0x0203aba4 -_0814E126: - adds r0, r2, r3 - ldr r1, [r4] - adds r1, 0xC - adds r1, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x3 - ble _0814E126 - movs r2, 0 - ldr r0, =0x02022f58 - mov r8, r0 - ldr r3, =0x0203aba8 - ldr r5, =0x02022f68 - ldr r4, =0x02022f78 -_0814E144: - mov r0, r8 - adds r1, r2, r0 - ldr r0, [r3] - adds r0, 0x10 - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r1, r2, r5 - ldr r0, [r3] - adds r0, 0x20 - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r1, r2, r4 - ldr r0, [r3] - adds r0, 0x30 - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r2, 0x1 - cmp r2, 0xF - ble _0814E144 - cmp r6, 0x5 - bls _0814E176 - b _0814E6B8 -_0814E176: - lsls r0, r6, 2 - ldr r1, =_0814E1B4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0814E1B4: - .4byte _0814E1CC - .4byte _0814E2AC - .4byte _0814E394 - .4byte _0814E430 - .4byte _0814E4F8 - .4byte _0814E55C -_0814E1CC: - ldr r0, =0x02022fec - ldr r2, [r0] - movs r0, 0x8 - ands r0, r2 - cmp r0, 0 - beq _0814E26C - ldr r0, =0x02000002 - ands r0, r2 - cmp r0, 0 - beq _0814E248 - movs r0, 0x80 - lsls r0, 16 - ands r0, r2 - cmp r0, 0 - bne _0814E260 - movs r0, 0x40 - ands r0, r2 - cmp r0, 0 - beq _0814E214 - movs r0, 0x80 - lsls r0, 17 - ands r2, r0 - ldr r7, =gUnknown_085CBBCD - cmp r2, 0 - bne _0814E200 - b _0814E6D8 -_0814E200: - ldr r7, =gUnknown_085CD318 - b _0814E6D8 - .pool -_0814E214: - ldr r0, =0x02038bca - ldrh r1, [r0] - movs r0, 0xC0 - lsls r0, 4 - cmp r1, r0 - bne _0814E22C - ldr r7, =gUnknown_085CBB9C - b _0814E6D8 - .pool -_0814E22C: - movs r0, 0x80 - lsls r0, 17 - ands r2, r0 - ldr r7, =gUnknown_085CBBB9 - cmp r2, 0 - bne _0814E23A - b _0814E6D8 -_0814E23A: - ldr r7, =gUnknown_085CD301 - b _0814E6D8 - .pool -_0814E248: - movs r0, 0x80 - lsls r0, 15 - ands r0, r2 - cmp r0, 0 - bne _0814E260 - movs r0, 0x80 - lsls r0, 8 - ands r2, r0 - ldr r7, =gUnknown_085CBB9C - cmp r2, 0 - bne _0814E260 - b _0814E6D8 -_0814E260: - ldr r7, =gUnknown_085CCE17 - b _0814E6D8 - .pool -_0814E26C: - movs r0, 0x80 - lsls r0, 6 - ands r0, r2 - cmp r0, 0 - beq _0814E280 - ldr r7, =gUnknown_085CBB5A - b _0814E6D8 - .pool -_0814E280: - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - beq _0814E290 - ldr r7, =gUnknown_085CBB82 - b _0814E6D8 - .pool -_0814E290: - movs r0, 0x80 - lsls r0, 2 - ands r2, r0 - ldr r7, =gUnknown_085CBB47 - cmp r2, 0 - bne _0814E29E - b _0814E6D8 -_0814E29E: - ldr r7, =gUnknown_085CBB6D - b _0814E6D8 - .pool -_0814E2AC: - mov r1, r12 - ldrb r0, [r1] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0814E310 - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0814E308 - movs r0, 0x80 - lsls r0, 15 - ands r0, r1 - cmp r0, 0 - beq _0814E2DC - ldr r7, =gUnknown_085CCE38 - b _0814E6D8 - .pool -_0814E2DC: - movs r0, 0x80 - lsls r0, 8 - ands r0, r1 - cmp r0, 0 - beq _0814E2F0 - ldr r7, =gUnknown_085CBC96 - b _0814E6D8 - .pool -_0814E2F0: - movs r0, 0x40 - ands r1, r0 - ldr r7, =gUnknown_085CBC96 - cmp r1, 0 - bne _0814E2FC - b _0814E6D8 -_0814E2FC: - ldr r7, =gUnknown_085CBCE5 - b _0814E6D8 - .pool -_0814E308: - ldr r7, =gUnknown_085CBC8E - b _0814E6D8 - .pool -_0814E310: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0814E368 - movs r0, 0x80 - lsls r0, 8 - ands r0, r1 - cmp r0, 0 - bne _0814E330 - movs r0, 0x80 - lsls r0, 16 - ands r0, r1 - cmp r0, 0 - beq _0814E33C -_0814E330: - ldr r7, =gUnknown_085CCDDE - b _0814E6D8 - .pool -_0814E33C: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0814E34C - ldr r7, =gUnknown_085CBC4E - b _0814E6D8 - .pool -_0814E34C: - ldr r0, =0x02000002 - ands r1, r0 - ldr r7, =gUnknown_085CBBFA - cmp r1, 0 - bne _0814E358 - b _0814E6D8 -_0814E358: - ldr r7, =gUnknown_085CBC37 - b _0814E6D8 - .pool -_0814E368: - ldr r0, =0x02000002 - ands r1, r0 - cmp r1, 0 - beq _0814E380 - ldr r0, =0x02038bca - ldrh r1, [r0] - movs r0, 0xC0 - lsls r0, 4 - ldr r7, =gUnknown_085CBC27 - cmp r1, r0 - beq _0814E380 - b _0814E6D8 -_0814E380: - ldr r7, =gUnknown_085CBBE7 - b _0814E6D8 - .pool -_0814E394: - mov r1, r12 - ldrb r0, [r1] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0814E3EC - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0xB1 - ldrb r2, [r0] - cmp r2, 0 - bne _0814E3BC - ldr r7, =gUnknown_085CBCFD - b _0814E6D8 - .pool -_0814E3BC: - cmp r2, 0x1 - beq _0814E3CC - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0814E3D8 -_0814E3CC: - ldr r7, =gUnknown_085CBD1B - b _0814E6D8 - .pool -_0814E3D8: - ldr r7, =gUnknown_085CBD3D - cmp r2, 0x2 - beq _0814E3E0 - b _0814E6D8 -_0814E3E0: - ldr r7, =gUnknown_085CBD2A - b _0814E6D8 - .pool -_0814E3EC: - ldr r0, =0x02038bca - ldrh r1, [r0] - movs r0, 0x80 - lsls r0, 4 - ldr r2, =0x02022fec - cmp r1, r0 - beq _0814E406 - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 18 - ands r0, r1 - cmp r0, 0 - beq _0814E428 -_0814E406: - ldr r0, [r2] - movs r1, 0x40 - ands r0, r1 - ldr r7, =gUnknown_085CBD65 - cmp r0, 0 - bne _0814E414 - b _0814E6D8 -_0814E414: - ldr r7, =gUnknown_085CBD75 - b _0814E6D8 - .pool -_0814E428: - ldr r7, =gUnknown_085CBD52 - b _0814E6D8 - .pool -_0814E430: - mov r4, r9 - ldrb r0, [r4, 0x17] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0814E488 - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0xB1 - ldrb r2, [r0] - cmp r2, 0 - beq _0814E456 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0814E468 -_0814E456: - ldr r7, =gUnknown_085CBCA5 - b _0814E6D8 - .pool -_0814E468: - cmp r2, 0x1 - bne _0814E474 - ldr r7, =gUnknown_085CBCAD - b _0814E6D8 - .pool -_0814E474: - ldr r7, =gUnknown_085CBCC7 - cmp r2, 0x2 - beq _0814E47C - b _0814E6D8 -_0814E47C: - ldr r7, =gUnknown_085CBCB8 - b _0814E6D8 - .pool -_0814E488: - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r0, =0x02000002 - ands r0, r1 - cmp r0, 0 - beq _0814E4DC - movs r0, 0x80 - lsls r0, 16 - ands r0, r1 - cmp r0, 0 - beq _0814E4AC - ldrb r0, [r4, 0x17] - b _0814E4EA - .pool -_0814E4AC: - movs r0, 0x40 - ands r1, r0 - cmp r1, 0 - beq _0814E4BC - ldr r7, =gUnknown_085CBC7E - b _0814E6D8 - .pool -_0814E4BC: - ldr r0, =0x02038bca - ldrh r1, [r0] - movs r0, 0xC0 - lsls r0, 4 - ldr r7, =gUnknown_085CBC6E - cmp r1, r0 - beq _0814E4CC - b _0814E6D8 -_0814E4CC: - ldr r7, =gUnknown_085CBC14 - b _0814E6D8 - .pool -_0814E4DC: - movs r0, 0x80 - lsls r0, 8 - ands r1, r0 - cmp r1, 0 - beq _0814E4CC - mov r1, r9 - ldrb r0, [r1, 0x17] -_0814E4EA: - ldr r7, =gUnknown_085CCE04 - cmp r0, 0x1 - beq _0814E4F2 - b _0814E6D8 -_0814E4F2: - b _0814E4CC - .pool -_0814E4F8: - mov r0, r10 - bl sub_814F8F8 - ldr r0, =0x0203aba8 - ldr r2, [r0] - ldrh r1, [r2] - movs r0, 0xB1 - lsls r0, 1 - cmp r1, r0 - bls _0814E534 - ldr r0, =0x02022f68 - ldr r1, =0x0202449c - ldr r1, [r1] - adds r1, 0x8E - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - ldr r2, =gUnknown_085CCBBC - adds r1, r2 - bl CopyString - b _0814E544 - .pool -_0814E534: - ldr r0, =0x02022f68 - ldrh r2, [r2] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString -_0814E544: - ldr r0, =0x02022f68 - bl sub_814F950 - ldr r7, =gUnknown_085CBDAC - b _0814E6D8 - .pool -_0814E55C: - ldr r4, =0x02022f58 - ldrb r1, [r4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0814E5C4 - movs r0, 0x7F - ands r0, r1 - strb r0, [r4] - mov r1, r12 - ldrb r0, [r1] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0814E58A - ldrb r1, [r4] - cmp r1, 0x3 - beq _0814E58A - movs r0, 0x3 - eors r0, r1 - strb r0, [r4] -_0814E58A: - ldr r0, =0x02022f58 - ldrb r0, [r0] - subs r0, 0x2 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _0814E5A4 - ldr r7, =gUnknown_085CB4CA - b _0814E6D8 - .pool -_0814E5A4: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - ldr r7, =gUnknown_085CB5D2 - cmp r0, 0 - bne _0814E5B4 - b _0814E6D8 -_0814E5B4: - ldr r7, =gUnknown_085CB5DF - b _0814E6D8 - .pool -_0814E5C4: - mov r1, r12 - ldrb r0, [r1] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0814E5E0 - ldrb r1, [r4] - cmp r1, 0x3 - beq _0814E5E0 - movs r0, 0x3 - eors r0, r1 - strb r0, [r4] -_0814E5E0: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0814E638 - ldr r0, =0x02022f58 - ldrb r0, [r0] - cmp r0, 0x2 - beq _0814E628 - cmp r0, 0x2 - bgt _0814E608 - cmp r0, 0x1 - beq _0814E60E - b _0814E6D8 - .pool -_0814E608: - cmp r0, 0x3 - beq _0814E630 - b _0814E6D8 -_0814E60E: - movs r0, 0x80 - lsls r0, 16 - ands r1, r0 - ldr r7, =gUnknown_085CB538 - cmp r1, 0 - beq _0814E6D8 - ldr r7, =gUnknown_085CCE53 - b _0814E6D8 - .pool -_0814E628: - ldr r7, =gUnknown_085CB567 - b _0814E6D8 - .pool -_0814E630: - ldr r7, =gUnknown_085CB5A6 - b _0814E6D8 - .pool -_0814E638: - ldr r0, =0x02038bca - ldrh r1, [r0] - movs r0, 0xC0 - lsls r0, 4 - cmp r1, r0 - bne _0814E680 - ldr r0, =0x02022f58 - ldrb r0, [r0] - cmp r0, 0x2 - beq _0814E670 - cmp r0, 0x2 - bgt _0814E660 - cmp r0, 0x1 - beq _0814E666 - b _0814E6D8 - .pool -_0814E660: - cmp r0, 0x3 - beq _0814E678 - b _0814E6D8 -_0814E666: - ldr r7, =gUnknown_085CBA2E - b _0814E6D8 - .pool -_0814E670: - ldr r7, =gUnknown_085CD24C - b _0814E6D8 - .pool -_0814E678: - ldr r7, =gUnknown_085CD267 - b _0814E6D8 - .pool -_0814E680: - ldr r0, =0x02022f58 - ldrb r0, [r0] - cmp r0, 0x2 - beq _0814E6A8 - cmp r0, 0x2 - bgt _0814E698 - cmp r0, 0x1 - beq _0814E69E - b _0814E6D8 - .pool -_0814E698: - cmp r0, 0x3 - beq _0814E6B0 - b _0814E6D8 -_0814E69E: - ldr r7, =gUnknown_085CB524 - b _0814E6D8 - .pool -_0814E6A8: - ldr r7, =gUnknown_085CB54F - b _0814E6D8 - .pool -_0814E6B0: - ldr r7, =gUnknown_085CB581 - b _0814E6D8 - .pool -_0814E6B8: - movs r0, 0xBE - lsls r0, 1 - cmp r6, r0 - bls _0814E6CC - ldr r1, =0x02022e2c - movs r0, 0xFF - strb r0, [r1] - b _0814E6DE - .pool -_0814E6CC: - ldr r1, =gUnknown_085CC270 - adds r0, r6, 0 - subs r0, 0xC - lsls r0, 2 - adds r0, r1 - ldr r7, [r0] -_0814E6D8: - adds r0, r7, 0 - bl get_battle_strings_ -_0814E6DE: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end battle_pick_message - - thumb_func_start get_battle_strings_ -get_battle_strings_: @ 814E6F0 - push {lr} - ldr r1, =0x02022e2c - bl get_battle_strings - pop {r1} - bx r1 - .pool - thumb_func_end get_battle_strings_ - - thumb_func_start sub_814E700 -sub_814E700: @ 814E700 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r1, =gUnknown_085CD422 - mov r0, sp - movs r2, 0x8 - bl memcpy - mov r2, sp - movs r3, 0 - b _0814E728 - .pool -_0814E71C: - strb r1, [r2] - adds r4, 0x1 - adds r2, 0x1 - adds r3, 0x1 - cmp r3, 0x7 - bhi _0814E730 -_0814E728: - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - bne _0814E71C -_0814E730: - ldr r5, [sp] - ldr r4, [sp, 0x4] - movs r3, 0 - ldr r2, =gUnknown_0831BCA8 -_0814E738: - ldr r1, [r2] - ldr r0, [r1] - cmp r5, r0 - bne _0814E750 - ldr r0, [r1, 0x4] - cmp r4, r0 - bne _0814E750 - ldr r0, [r2, 0x4] - b _0814E75A - .pool -_0814E750: - adds r2, 0x8 - adds r3, 0x1 - cmp r3, 0x6 - bls _0814E738 - movs r0, 0 -_0814E75A: - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_814E700 - - thumb_func_start get_battle_strings -get_battle_strings: @ 814E764 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x20 - mov r9, r0 - mov r8, r1 - movs r6, 0 - movs r4, 0 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 18 - ands r0, r1 - cmp r0, 0 - beq _0814E794 - ldr r0, =0x0203c7b4 - ldrb r7, [r0] - b _0814E79C - .pool -_0814E794: - bl link_get_multiplayer_id - lsls r0, 24 - lsrs r7, r0, 24 -_0814E79C: - mov r0, r9 - ldrb r1, [r0] - bl _0814F620 -_0814E7A4: - cmp r1, 0xFD - beq _0814E7AC - bl _0814F610 -_0814E7AC: - movs r1, 0x1 - add r9, r1 - mov r2, r9 - ldrb r0, [r2] - cmp r0, 0x34 - bls _0814E7BC - bl _0814F5C0 -_0814E7BC: - lsls r0, 2 - ldr r1, =_0814E7CC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0814E7CC: - .4byte _0814E8A0 - .4byte _0814E8CE - .4byte _0814E90A - .4byte _0814E914 - .4byte _0814E920 - .4byte _0814E92C - .4byte _0814E960 - .4byte _0814E994 - .4byte _0814E9C8 - .4byte _0814E9FC - .4byte _0814EA38 - .4byte _0814EA78 - .4byte _0814EAB8 - .4byte _0814EAF8 - .4byte _0814EBB0 - .4byte _0814EC38 - .4byte _0814ECD4 - .4byte _0814ED70 - .4byte _0814EE0C - .4byte _0814EEA8 - .4byte _0814EF44 - .4byte _0814EF5C - .4byte _0814EF98 - .4byte _0814F080 - .4byte _0814F088 - .4byte _0814F098 - .4byte _0814F0A8 - .4byte _0814F0B8 - .4byte _0814F0D8 - .4byte _0814F164 - .4byte _0814F220 - .4byte _0814F230 - .4byte _0814F244 - .4byte _0814F258 - .4byte _0814F27C - .4byte _0814F298 - .4byte _0814F2C0 - .4byte _0814F300 - .4byte _0814F330 - .4byte _0814F3C4 - .4byte _0814F410 - .4byte _0814F418 - .4byte _0814F3E4 - .4byte _0814F3EC - .4byte _0814F43C - .4byte _0814F444 - .4byte _0814F468 - .4byte _0814F4B8 - .4byte _0814F508 - .4byte _0814F548 - .4byte _0814F594 - .4byte _0814F5B4 - .4byte _0814E8E4 -_0814E8A0: - ldr r5, =0x02022f58 - ldrb r0, [r5] - cmp r0, 0xFD - bne _0814E8B8 - ldr r4, =0x02021cc4 - adds r0, r5, 0 - b _0814E8F0 - .pool -_0814E8B8: - adds r0, r5, 0 - bl sub_814E700 - adds r4, r0, 0 - cmp r4, 0 - beq _0814E8C8 - bl _0814F5C0 -_0814E8C8: - adds r4, r5, 0 - bl _0814F5C0 -_0814E8CE: - ldr r1, =0x02022f68 - ldrb r0, [r1] - cmp r0, 0xFD - bne _0814E904 - ldr r4, =0x02021dc4 - b _0814E8EE - .pool -_0814E8E4: - ldr r1, =0x02022f78 - ldrb r0, [r1] - cmp r0, 0xFD - bne _0814E904 - ldr r4, =0x02021ec4 -_0814E8EE: - adds r0, r1, 0 -_0814E8F0: - adds r1, r4, 0 - bl sub_814F648 - bl _0814F5C0 - .pool -_0814E904: - adds r4, r1, 0 - bl _0814F5C0 -_0814E90A: - ldr r4, =0x02021cc4 - bl _0814F5C0 - .pool -_0814E914: - ldr r4, =0x02021dc4 - bl _0814F5C0 - .pool -_0814E920: - ldr r4, =0x02021ec4 - bl _0814F5C0 - .pool -_0814E92C: - movs r0, 0 - bl battle_get_side_with_given_state - ldr r1, =0x0202406e - lsls r0, 24 - lsrs r0, 23 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - mov r0, sp - bl GetStringEnd_Limit7 - bl _0814F5BE - .pool -_0814E960: - movs r0, 0x1 - bl battle_get_side_with_given_state - ldr r1, =0x0202406e - lsls r0, 24 - lsrs r0, 23 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - mov r0, sp - bl GetStringEnd_Limit7 - bl _0814F5BE - .pool -_0814E994: - movs r0, 0x2 - bl battle_get_side_with_given_state - ldr r1, =0x0202406e - lsls r0, 24 - lsrs r0, 23 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - mov r0, sp - bl GetStringEnd_Limit7 - bl _0814F5BE - .pool -_0814E9C8: - movs r0, 0x3 - bl battle_get_side_with_given_state - ldr r1, =0x0202406e - lsls r0, 24 - lsrs r0, 23 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - mov r0, sp - bl GetStringEnd_Limit7 - bl _0814F5BE - .pool -_0814E9FC: - ldr r2, =0x0202406e - ldr r1, =0x020229e8 - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x18] - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - mov r0, sp - bl GetStringEnd_Limit7 - bl _0814F5BE - .pool -_0814EA38: - ldr r2, =0x0202406e - ldr r1, =0x020229e8 - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0, 0x18] - movs r0, 0x1 - eors r0, r1 - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - mov r0, sp - bl GetStringEnd_Limit7 - bl _0814F5BE - .pool -_0814EA78: - ldr r2, =0x0202406e - ldr r1, =0x020229e8 - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0, 0x18] - movs r0, 0x2 - eors r0, r1 - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - mov r0, sp - bl GetStringEnd_Limit7 - bl _0814F5BE - .pool -_0814EAB8: - ldr r2, =0x0202406e - ldr r1, =0x020229e8 - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0, 0x18] - movs r0, 0x3 - eors r0, r1 - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - mov r0, sp - bl GetStringEnd_Limit7 - bl _0814F5BE - .pool -_0814EAF8: - ldr r4, =0x0202420b - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - adds r2, r4, 0 - cmp r0, 0 - beq _0814EB74 - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x8 - ands r1, r0 - ldr r4, =gUnknown_085CBD85 - cmp r1, 0 - beq _0814EB36 - ldr r4, =gUnknown_085CBD8B - b _0814EB36 - .pool -_0814EB2C: - mov r3, r8 - adds r0, r3, r6 - strb r1, [r0] - adds r6, 0x1 - adds r4, 0x1 -_0814EB36: - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - bne _0814EB2C - ldrb r0, [r2] - bl battle_get_per_side_status - adds r1, r0, 0 - movs r0, 0x1 - ands r0, r1 - bl battle_get_side_with_given_state - ldr r1, =0x0202406e - lsls r0, 24 - lsrs r0, 23 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - b _0814EB9E - .pool -_0814EB74: - ldrb r0, [r2] - bl battle_get_per_side_status - adds r1, r0, 0 - movs r0, 0x1 - ands r0, r1 - bl battle_get_side_with_given_state - ldr r1, =0x0202406e - lsls r0, 24 - lsrs r0, 23 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr -_0814EB9E: - mov r0, sp - bl GetStringEnd_Limit7 - bl _0814F5BE - .pool -_0814EBB0: - ldr r4, =0x0202420b - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0814EBF8 - ldrb r0, [r4] - bl battle_get_per_side_status - adds r1, r0, 0 - movs r0, 0x1 - ands r0, r1 - bl battle_get_side_with_given_state - ldr r1, =0x0202406e - lsls r0, 24 - lsrs r0, 23 - adds r0, 0x4 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - b _0814EC24 - .pool -_0814EBF8: - ldrb r0, [r4] - bl battle_get_per_side_status - adds r1, r0, 0 - movs r0, 0x1 - ands r0, r1 - bl battle_get_side_with_given_state - ldr r1, =0x0202406e - lsls r0, 24 - lsrs r0, 23 - adds r0, 0x4 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr -_0814EC24: - mov r0, sp - bl GetStringEnd_Limit7 - bl _0814F5BE - .pool -_0814EC38: - ldr r5, =0x0202420b - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0814ECA8 - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x8 - ands r1, r0 - ldr r4, =gUnknown_085CBD85 - cmp r1, 0 - beq _0814EC56 - ldr r4, =gUnknown_085CBD8B -_0814EC56: - ldrb r1, [r4] - adds r0, r1, 0 - ldr r3, =0x0202406e - ldr r2, =0x02024744 - mov r12, r2 - adds r2, r5, 0 - cmp r0, 0xFF - beq _0814EC78 -_0814EC66: - mov r5, r8 - adds r0, r5, r6 - strb r1, [r0] - adds r6, 0x1 - adds r4, 0x1 - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - bne _0814EC66 -_0814EC78: - ldrb r0, [r2] - lsls r0, 1 - adds r0, r3 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - add r0, r12 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - b _0814ECC2 - .pool -_0814ECA8: - ldr r1, =0x0202406e - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr -_0814ECC2: - mov r0, sp - bl GetStringEnd_Limit7 - bl _0814F5BE - .pool -_0814ECD4: - ldr r5, =0x0202420c - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0814ED44 - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x8 - ands r1, r0 - ldr r4, =gUnknown_085CBD85 - cmp r1, 0 - beq _0814ECF2 - ldr r4, =gUnknown_085CBD8B -_0814ECF2: - ldrb r1, [r4] - adds r0, r1, 0 - ldr r3, =0x0202406e - ldr r2, =0x02024744 - mov r12, r2 - adds r2, r5, 0 - cmp r0, 0xFF - beq _0814ED14 -_0814ED02: - mov r5, r8 - adds r0, r5, r6 - strb r1, [r0] - adds r6, 0x1 - adds r4, 0x1 - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - bne _0814ED02 -_0814ED14: - ldrb r0, [r2] - lsls r0, 1 - adds r0, r3 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - add r0, r12 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - b _0814ED5E - .pool -_0814ED44: - ldr r1, =0x0202406e - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr -_0814ED5E: - mov r0, sp - bl GetStringEnd_Limit7 - bl _0814F5BE - .pool -_0814ED70: - ldr r5, =0x0202420e - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0814EDE0 - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x8 - ands r1, r0 - ldr r4, =gUnknown_085CBD85 - cmp r1, 0 - beq _0814ED8E - ldr r4, =gUnknown_085CBD8B -_0814ED8E: - ldrb r1, [r4] - adds r0, r1, 0 - ldr r3, =0x0202406e - ldr r2, =0x02024744 - mov r12, r2 - adds r2, r5, 0 - cmp r0, 0xFF - beq _0814EDB0 -_0814ED9E: - mov r5, r8 - adds r0, r5, r6 - strb r1, [r0] - adds r6, 0x1 - adds r4, 0x1 - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - bne _0814ED9E -_0814EDB0: - ldrb r0, [r2] - lsls r0, 1 - adds r0, r3 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - add r0, r12 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - b _0814EDFA - .pool -_0814EDE0: - ldr r1, =0x0202406e - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr -_0814EDFA: - mov r0, sp - bl GetStringEnd_Limit7 - bl _0814F5BE - .pool -_0814EE0C: - ldr r5, =0x02024064 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0814EE7C - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x8 - ands r1, r0 - ldr r4, =gUnknown_085CBD85 - cmp r1, 0 - beq _0814EE2A - ldr r4, =gUnknown_085CBD8B -_0814EE2A: - ldrb r1, [r4] - adds r0, r1, 0 - ldr r3, =0x0202406e - ldr r2, =0x02024744 - mov r12, r2 - adds r2, r5, 0 - cmp r0, 0xFF - beq _0814EE4C -_0814EE3A: - mov r5, r8 - adds r0, r5, r6 - strb r1, [r0] - adds r6, 0x1 - adds r4, 0x1 - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - bne _0814EE3A -_0814EE4C: - ldrb r0, [r2] - lsls r0, 1 - adds r0, r3 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - add r0, r12 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - b _0814EE96 - .pool -_0814EE7C: - ldr r1, =0x0202406e - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr -_0814EE96: - mov r0, sp - bl GetStringEnd_Limit7 - b _0814F5BE - .pool -_0814EEA8: - ldr r5, =0x02024474 - ldrb r0, [r5, 0x17] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0814EF18 - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x8 - ands r1, r0 - ldr r4, =gUnknown_085CBD85 - cmp r1, 0 - beq _0814EEC6 - ldr r4, =gUnknown_085CBD8B -_0814EEC6: - ldrb r1, [r4] - adds r0, r1, 0 - ldr r3, =0x0202406e - ldr r2, =0x02024744 - mov r12, r2 - adds r2, r5, 0 - cmp r0, 0xFF - beq _0814EEE8 -_0814EED6: - mov r5, r8 - adds r0, r5, r6 - strb r1, [r0] - adds r6, 0x1 - adds r4, 0x1 - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - bne _0814EED6 -_0814EEE8: - ldrb r0, [r2, 0x17] - lsls r0, 1 - adds r0, r3 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - add r0, r12 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - b _0814EF32 - .pool -_0814EF18: - ldr r1, =0x0202406e - ldrb r0, [r5, 0x17] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr -_0814EF32: - mov r0, sp - bl GetStringEnd_Limit7 - b _0814F5BE - .pool -_0814EF44: - ldr r0, =0x0203aba8 - ldr r2, [r0] - ldrh r1, [r2] - movs r0, 0xB1 - lsls r0, 1 - cmp r1, r0 - bhi _0814EF6A - ldrh r1, [r2] - b _0814EF8A - .pool -_0814EF5C: - ldr r0, =0x0203aba8 - ldr r2, [r0] - ldrh r1, [r2, 0x2] - movs r0, 0xB1 - lsls r0, 1 - cmp r1, r0 - bls _0814EF88 -_0814EF6A: - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - ldr r1, =gUnknown_085CCBBC - adds r4, r0, r1 - b _0814F5C0 - .pool -_0814EF88: - ldrh r1, [r2, 0x2] -_0814EF8A: - movs r0, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r4, r1, r0 - b _0814F5C0 - .pool -_0814EF98: - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r0, =0x02000002 - ands r0, r1 - cmp r0, 0 - beq _0814F06E - ldr r2, =0x02024208 - ldrh r0, [r2] - cmp r0, 0xAF - bne _0814F064 - movs r0, 0x40 - ands r1, r0 - cmp r1, 0 - bne _0814F014 - ldr r0, =0x02024474 - adds r0, 0x25 - ldrb r0, [r0] - cmp r0, 0 - beq _0814EFE0 - ldr r2, =0x0202420f - ldrb r1, [r2] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0814EFEC - b _0814F05C - .pool -_0814EFE0: - ldr r2, =0x0202420f - ldrb r1, [r2] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0814F05C -_0814EFEC: - ldrb r0, [r2] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r0, =0x02024404 - adds r1, r0 - mov r0, sp - bl CopyString - ldr r1, =gUnknown_085CC0AD - mov r0, sp - bl AppendString - b _0814F5BE - .pool -_0814F014: - ldr r2, =0x020229e8 - ldr r0, =0x02024474 - adds r0, 0x25 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0202420f - ldrb r2, [r1] - ldrh r0, [r0, 0x18] - cmp r0, r2 - bne _0814F05C - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - ldr r0, =0x02024404 - adds r1, r0 - mov r0, sp - bl CopyString - ldr r1, =gUnknown_085CC0AD - mov r0, sp - bl AppendString - b _0814F5BE - .pool -_0814F05C: - ldr r4, =gUnknown_085CC0A0 - b _0814F5C0 - .pool -_0814F064: - ldrh r0, [r2] - mov r1, sp - bl itemid_get_name - b _0814F5BE -_0814F06E: - ldr r0, =0x02024208 - ldrh r0, [r0] - mov r1, sp - bl itemid_get_name - b _0814F5BE - .pool -_0814F080: - ldr r0, =0x0202420a - b _0814F0C0 - .pool -_0814F088: - ldr r1, =0x0203aba4 - ldr r0, =0x0202420b - b _0814F0BC - .pool -_0814F098: - ldr r1, =0x0203aba4 - ldr r0, =0x0202420c - b _0814F0BC - .pool -_0814F0A8: - ldr r1, =0x0203aba4 - ldr r0, =0x02024474 - ldrb r0, [r0, 0x17] - b _0814F0BE - .pool -_0814F0B8: - ldr r1, =0x0203aba4 - ldr r0, =0x0202420e -_0814F0BC: - ldrb r0, [r0] -_0814F0BE: - adds r0, r1 -_0814F0C0: - ldrb r1, [r0] - movs r0, 0xD - muls r1, r0 - ldr r0, =gAbilityNames - adds r4, r1, r0 - b _0814F5C0 - .pool -_0814F0D8: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 20 - ands r0, r1 - cmp r0, 0 - beq _0814F0F0 - bl sub_806B870 - b _0814F59C - .pool -_0814F0F0: - ldr r3, =0x02038bca - ldrh r2, [r3] - movs r0, 0xC0 - lsls r0, 4 - cmp r2, r0 - bne _0814F10C - bl sub_8068BB0 - lsls r0, 16 - lsrs r0, 16 - b _0814F5A0 - .pool -_0814F10C: - ldr r0, =0x000003fe - cmp r2, r0 - bne _0814F11C - bl sub_81A4D00 - b _0814F59C - .pool -_0814F11C: - ldr r0, =0x003f0100 - ands r0, r1 - cmp r0, 0 - beq _0814F12C - ldrh r0, [r3] - b _0814F598 - .pool -_0814F12C: - movs r0, 0x80 - lsls r0, 19 - ands r0, r1 - cmp r0, 0 - beq _0814F13E - ldrh r0, [r3] - bl sub_81D5530 - b _0814F59C -_0814F13E: - movs r0, 0x80 - lsls r0, 4 - ands r1, r0 - cmp r1, 0 - beq _0814F14E - bl sub_8165264 - b _0814F59C -_0814F14E: - ldr r2, =gTrainers - ldrh r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r0, 0xD - b _0814F5A2 - .pool -_0814F164: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 20 - ands r0, r1 - cmp r0, 0 - beq _0814F1AC - movs r2, 0 - ldr r4, =0x020244a8 - ldr r3, [r4] -_0814F178: - mov r1, sp - adds r0, r1, r2 - ldr r1, [r3] - adds r1, 0x2 - adds r1, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x6 - ble _0814F178 - mov r3, sp - adds r1, r3, r2 - movs r0, 0xFF - strb r0, [r1] - ldr r0, [r4] - ldr r0, [r0] - ldrb r1, [r0, 0xD] - mov r0, sp - bl StopMusicWhileStringIsPrinted - b _0814F5BE - .pool -_0814F1AC: - ldr r3, =0x02038bca - ldrh r2, [r3] - movs r0, 0xC0 - lsls r0, 4 - cmp r2, r0 - bne _0814F1C4 - movs r1, 0x1 - adds r0, r7, 0 - eors r0, r1 - b _0814F284 - .pool -_0814F1C4: - ldr r0, =0x000003fe - cmp r2, r0 - bne _0814F1D8 - mov r0, sp - bl sub_81A4D50 - b _0814F5BE - .pool -_0814F1D8: - ldr r0, =0x003f0100 - ands r0, r1 - cmp r0, 0 - beq _0814F1E8 - ldrh r1, [r3] - b _0814F5B8 - .pool -_0814F1E8: - movs r0, 0x80 - lsls r0, 19 - ands r0, r1 - cmp r0, 0 - beq _0814F1FC - ldrh r1, [r3] - mov r0, sp - bl sub_81D5554 - b _0814F5BE -_0814F1FC: - movs r0, 0x80 - lsls r0, 4 - ands r1, r0 - cmp r1, 0 - beq _0814F20E - mov r0, sp - bl sub_8165284 - b _0814F5BE -_0814F20E: - ldrh r0, [r3] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTrainers + 0x4 @ name offset - adds r4, r1, r0 - b _0814F5C0 - .pool -_0814F220: - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - ldr r1, =0x020229f0 - adds r4, r0, r1 - b _0814F5C0 - .pool -_0814F230: - ldr r4, =0x020229e8 - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x18] - movs r0, 0x2 - b _0814F266 - .pool -_0814F244: - ldr r4, =0x020229e8 - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x18] - movs r0, 0x1 - b _0814F266 - .pool -_0814F258: - ldr r4, =0x020229e8 - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x18] - movs r0, 0x3 -_0814F266: - eors r0, r1 - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r4, 0x8 - adds r4, r1, r4 - b _0814F5C0 - .pool -_0814F27C: - ldr r0, =0x02024474 - ldrb r0, [r0, 0x17] - bl sub_806D864 -_0814F284: - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r0, =0x020229f0 - adds r4, r1, r0 - b _0814F5C0 - .pool -_0814F298: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _0814F2B4 - ldr r4, =0x020229f0 - b _0814F5C0 - .pool -_0814F2B4: - ldr r0, =0x03005d90 - ldr r4, [r0] - b _0814F5C0 - .pool -_0814F2C0: - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r0, =0x003f0100 - ands r0, r1 - cmp r0, 0 - beq _0814F2E0 - ldr r0, =0x02038bca - ldrh r1, [r0] - movs r0, 0x2 - b _0814F55A - .pool -_0814F2E0: - movs r0, 0x80 - lsls r0, 19 - ands r1, r0 - cmp r1, 0 - beq _0814F2F8 - ldr r0, =0x02038bca - ldrh r1, [r0] - movs r0, 0x4 - b _0814F584 - .pool -_0814F2F8: - bl sub_80B1CA4 - adds r4, r0, 0 - b _0814F5C0 -_0814F300: - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r0, =0x003f0100 - ands r0, r1 - cmp r0, 0 - beq _0814F31C - ldr r0, =0x02038bca - b _0814F556 - .pool -_0814F31C: - movs r0, 0x80 - lsls r0, 19 - ands r1, r0 - cmp r1, 0 - bne _0814F328 - b _0814F5C0 -_0814F328: - ldr r0, =0x02038bca - b _0814F580 - .pool -_0814F330: - ldr r0, =0x02024474 - ldrb r0, [r0, 0x17] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0814F39C - ldr r0, =0x02022fec - ldr r1, [r0] - movs r0, 0x8 - ands r1, r0 - ldr r4, =gUnknown_085CBD85 - cmp r1, 0 - beq _0814F34E - ldr r4, =gUnknown_085CBD8B -_0814F34E: - ldrb r1, [r4] - adds r0, r1, 0 - ldr r5, =0x02024744 - mov r12, r5 - ldr r2, =0x0202449c - cmp r0, 0xFF - beq _0814F36E -_0814F35C: - mov r3, r8 - adds r0, r3, r6 - strb r1, [r0] - adds r6, 0x1 - adds r4, 0x1 - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - bne _0814F35C -_0814F36E: - ldr r0, [r2] - adds r0, 0x52 - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - add r0, r12 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - b _0814F3B4 - .pool -_0814F39C: - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0x52 - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr -_0814F3B4: - mov r0, sp - bl GetStringEnd_Limit7 - b _0814F5BE - .pool -_0814F3C4: - ldr r0, =0x000008ab - bl FlagGet - lsls r0, 24 - ldr r4, =gUnknown_085CC015 - cmp r0, 0 - bne _0814F3D4 - b _0814F5C0 -_0814F3D4: - ldr r4, =gUnknown_085CC01F - b _0814F5C0 - .pool -_0814F3E4: - ldr r0, =0x0202420b - b _0814F3EE - .pool -_0814F3EC: - ldr r0, =0x0202420c -_0814F3EE: - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - ldr r4, =gUnknown_085CBD9A - cmp r0, 0 - beq _0814F3FE - b _0814F5C0 -_0814F3FE: - ldr r4, =gUnknown_085CBD9E - b _0814F5C0 - .pool -_0814F410: - ldr r0, =0x0202420b - b _0814F41A - .pool -_0814F418: - ldr r0, =0x0202420c -_0814F41A: - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - ldr r4, =gUnknown_085CBD91 - cmp r0, 0 - beq _0814F42A - b _0814F5C0 -_0814F42A: - ldr r4, =gUnknown_085CBD95 - b _0814F5C0 - .pool -_0814F43C: - ldr r0, =0x0202420b - b _0814F446 - .pool -_0814F444: - ldr r0, =0x0202420c -_0814F446: - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - ldr r4, =gUnknown_085CBDA3 - cmp r0, 0 - beq _0814F456 - b _0814F5C0 -_0814F456: - ldr r4, =gUnknown_085CBDA7 - b _0814F5C0 - .pool -_0814F468: - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r0, =0x003f0100 - ands r0, r1 - cmp r0, 0 - beq _0814F484 - ldr r0, =0x02038bcc - b _0814F596 - .pool -_0814F484: - movs r0, 0x80 - lsls r0, 19 - ands r1, r0 - cmp r1, 0 - beq _0814F49C - ldr r0, =0x02038bcc - ldrh r0, [r0] - bl sub_81D5530 - b _0814F59C - .pool -_0814F49C: - ldr r2, =gTrainers - ldr r0, =0x02038bcc - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r0, 0xD - b _0814F5A2 - .pool -_0814F4B8: - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r0, =0x003f0100 - ands r0, r1 - cmp r0, 0 - beq _0814F4D4 - ldr r0, =0x02038bcc - b _0814F5B6 - .pool -_0814F4D4: - movs r0, 0x80 - lsls r0, 19 - ands r1, r0 - cmp r1, 0 - beq _0814F4F0 - ldr r0, =0x02038bcc - ldrh r1, [r0] - mov r0, sp - bl sub_81D5554 - b _0814F5BE - .pool -_0814F4F0: - ldr r0, =0x02038bcc - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =gTrainers + 0x4 @ name offset - adds r4, r0, r1 - b _0814F5C0 - .pool -_0814F508: - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r0, =0x003f0100 - ands r0, r1 - cmp r0, 0 - beq _0814F528 - ldr r0, =0x02038bcc - ldrh r1, [r0] - movs r0, 0x2 - b _0814F55A - .pool -_0814F528: - movs r0, 0x80 - lsls r0, 19 - ands r1, r0 - cmp r1, 0 - beq _0814F540 - ldr r0, =0x02038bcc - ldrh r1, [r0] - movs r0, 0x4 - b _0814F584 - .pool -_0814F540: - bl sub_80B1CE0 - adds r4, r0, 0 - b _0814F5C0 -_0814F548: - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r0, =0x003f0100 - ands r0, r1 - cmp r0, 0 - beq _0814F574 - ldr r0, =0x02038bcc -_0814F556: - ldrh r1, [r0] - movs r0, 0x1 -_0814F55A: - bl sub_81A36D0 - ldr r4, =0x02021fc4 - b _0814F5C0 - .pool -_0814F574: - movs r0, 0x80 - lsls r0, 19 - ands r1, r0 - cmp r1, 0 - beq _0814F5C0 - ldr r0, =0x02038bcc -_0814F580: - ldrh r1, [r0] - movs r0, 0x3 -_0814F584: - bl sub_81D572C - ldr r4, =0x02021fc4 - b _0814F5C0 - .pool -_0814F594: - ldr r0, =0x02038bce -_0814F596: - ldrh r0, [r0] -_0814F598: - bl sub_8162BD8 -_0814F59C: - lsls r0, 24 - lsrs r0, 24 -_0814F5A0: - movs r1, 0xD -_0814F5A2: - muls r1, r0 - ldr r0, =gTrainerClassNames - adds r4, r1, r0 - b _0814F5C0 - .pool -_0814F5B4: - ldr r0, =0x02038bce -_0814F5B6: - ldrh r1, [r0] -_0814F5B8: - mov r0, sp - bl sub_8162E20 -_0814F5BE: - mov r4, sp -_0814F5C0: - ldrb r1, [r4] - adds r0, r1, 0 - mov r5, r9 - ldrb r2, [r5] - mov r3, r9 - adds r3, 0x1 - cmp r0, 0xFF - beq _0814F5E2 -_0814F5D0: - mov r5, r8 - adds r0, r5, r6 - strb r1, [r0] - adds r6, 0x1 - adds r4, 0x1 - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - bne _0814F5D0 -_0814F5E2: - lsls r0, r2, 24 - lsrs r0, 24 - cmp r0, 0x24 - beq _0814F5F6 - cmp r0, 0x30 - beq _0814F5F6 - cmp r0, 0x25 - beq _0814F5F6 - cmp r0, 0x31 - bne _0814F61C -_0814F5F6: - mov r0, r8 - adds r1, r0, r6 - movs r0, 0xFC - strb r0, [r1] - adds r6, 0x1 - mov r2, r8 - adds r1, r2, r6 - movs r0, 0x9 - strb r0, [r1] - adds r6, 0x1 - b _0814F61C - .pool -_0814F610: - mov r3, r8 - adds r0, r3, r6 - strb r1, [r0] - adds r6, 0x1 - mov r3, r9 - adds r3, 0x1 -_0814F61C: - mov r9, r3 - ldrb r1, [r3] -_0814F620: - adds r0, r1, 0 - cmp r0, 0xFF - beq _0814F62A - bl _0814E7A4 -_0814F62A: - mov r5, r8 - adds r1, r5, r6 - mov r2, r9 - ldrb r0, [r2] - strb r0, [r1] - adds r6, 0x1 - adds r0, r6, 0 - add sp, 0x20 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end get_battle_strings - - thumb_func_start sub_814F648 -sub_814F648: @ 814F648 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - adds r7, r0, 0 - adds r6, r1, 0 - movs r5, 0x1 - movs r0, 0 - mov r8, r0 - movs r0, 0xFF - strb r0, [r6] - ldrb r0, [r7, 0x1] - cmp r0, 0xFF - bne _0814F666 - b _0814F8EA -_0814F666: - adds r0, r7, r5 - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0xA - bls _0814F672 - b _0814F8E0 -_0814F672: - lsls r0, r1, 2 - ldr r1, =_0814F680 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0814F680: - .4byte _0814F6AC - .4byte _0814F6C8 - .4byte _0814F71C - .4byte _0814F734 - .4byte _0814F744 - .4byte _0814F7BC - .4byte _0814F7D0 - .4byte _0814F7E2 - .4byte _0814F828 - .4byte _0814F83C - .4byte _0814F858 -_0814F6AC: - adds r0, r5, r7 - ldrb r1, [r0, 0x1] - ldrb r0, [r0, 0x2] - lsls r0, 8 - orrs r1, r0 - ldr r0, =gUnknown_085CC270 - subs r1, 0xC - lsls r1, 2 - adds r1, r0 - ldr r1, [r1] - b _0814F8BE - .pool -_0814F6C8: - ldrb r0, [r4, 0x1] - cmp r0, 0x2 - beq _0814F6E4 - cmp r0, 0x2 - bgt _0814F6D8 - cmp r0, 0x1 - beq _0814F6DE - b _0814F706 -_0814F6D8: - cmp r0, 0x4 - beq _0814F6EC - b _0814F706 -_0814F6DE: - ldrb r4, [r4, 0x3] - mov r8, r4 - b _0814F706 -_0814F6E4: - ldrb r1, [r4, 0x3] - ldrb r0, [r4, 0x4] - lsls r0, 8 - b _0814F702 -_0814F6EC: - ldrb r0, [r4, 0x3] - mov r8, r0 - ldrb r0, [r4, 0x4] - lsls r0, 8 - mov r1, r8 - orrs r1, r0 - ldrb r0, [r4, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r4, 0x6] - lsls r0, 24 -_0814F702: - orrs r1, r0 - mov r8, r1 -_0814F706: - adds r4, r5, r7 - ldrb r3, [r4, 0x2] - adds r0, r6, 0 - mov r1, r8 - movs r2, 0 - bl ConvertIntToDecimalString - adds r0, r5, 0x3 - ldrb r4, [r4, 0x1] - adds r5, r0, r4 - b _0814F8E0 -_0814F71C: - adds r0, r5, r7 - ldrb r1, [r0, 0x1] - ldrb r0, [r0, 0x2] - lsls r0, 8 - orrs r1, r0 - movs r0, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - b _0814F8BE - .pool -_0814F734: - adds r0, r5, r7 - ldrb r0, [r0, 0x1] - lsls r1, r0, 3 - subs r1, r0 - ldr r0, =gTypeNames - b _0814F846 - .pool -_0814F744: - ldrb r0, [r4, 0x1] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0814F768 - ldrb r1, [r4, 0x2] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - b _0814F7A4 - .pool -_0814F768: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0814F788 - ldr r1, =gUnknown_085CBD8B - adds r0, r6, 0 - bl AppendString - b _0814F790 - .pool -_0814F788: - ldr r1, =gUnknown_085CBD85 - adds r0, r6, 0 - bl AppendString -_0814F790: - adds r0, r5, r7 - ldrb r1, [r0, 0x2] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr -_0814F7A4: - mov r0, sp - bl GetStringEnd_Limit7 - adds r0, r6, 0 - mov r1, sp - bl AppendString - b _0814F8DE - .pool -_0814F7BC: - ldr r1, =gUnknown_085CBE00 - adds r0, r5, r7 - ldrb r0, [r0, 0x1] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - b _0814F848 - .pool -_0814F7D0: - adds r0, r5, r7 - ldrb r1, [r0, 0x1] - ldrb r0, [r0, 0x2] - lsls r0, 8 - orrs r1, r0 - adds r0, r6, 0 - bl GetSpeciesName - b _0814F8DE -_0814F7E2: - adds r4, r5, r7 - ldrb r0, [r4, 0x1] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0814F808 - ldrb r1, [r4, 0x2] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - adds r2, r6, 0 - bl pokemon_getattr - b _0814F81A - .pool -_0814F808: - ldrb r1, [r4, 0x2] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2 - adds r2, r6, 0 - bl pokemon_getattr -_0814F81A: - adds r0, r6, 0 - bl GetStringEnd_Limit7 - b _0814F8DE - .pool -_0814F828: - ldr r1, =gUnknown_085CBE6C - adds r0, r5, r7 - ldrb r0, [r0, 0x1] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - b _0814F848 - .pool -_0814F83C: - adds r0, r5, r7 - ldrb r1, [r0, 0x1] - movs r0, 0xD - muls r1, r0 - ldr r0, =gAbilityNames -_0814F846: - adds r1, r0 -_0814F848: - adds r0, r6, 0 - bl AppendString - adds r5, 0x2 - b _0814F8E0 - .pool -_0814F858: - adds r0, r5, r7 - ldrb r2, [r0, 0x1] - ldrb r0, [r0, 0x2] - lsls r0, 8 - orrs r2, r0 - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x02000002 - ands r0, r1 - cmp r0, 0 - beq _0814F8D6 - cmp r2, 0xAF - bne _0814F8CC - ldr r2, =0x020229e8 - ldr r0, =0x02024474 - adds r0, 0x25 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0202420f - ldrb r2, [r1] - ldrh r0, [r0, 0x18] - cmp r0, r2 - bne _0814F8BC - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - ldr r0, =0x02024404 - adds r1, r0 - adds r0, r6, 0 - bl CopyString - ldr r1, =gUnknown_085CC0AD - b _0814F8BE - .pool -_0814F8BC: - ldr r1, =gUnknown_085CC0A0 -_0814F8BE: - adds r0, r6, 0 - bl AppendString - b _0814F8DE - .pool -_0814F8CC: - adds r0, r2, 0 - adds r1, r6, 0 - bl itemid_get_name - b _0814F8DE -_0814F8D6: - adds r0, r2, 0 - adds r1, r6, 0 - bl itemid_get_name -_0814F8DE: - adds r5, 0x3 -_0814F8E0: - adds r0, r7, r5 - ldrb r0, [r0] - cmp r0, 0xFF - beq _0814F8EA - b _0814F666 -_0814F8EA: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_814F648 - - thumb_func_start sub_814F8F8 -sub_814F8F8: @ 814F8F8 - push {r4,r5,lr} - adds r4, r0, 0 - movs r2, 0 - ldr r5, =0x0203aba8 - ldr r3, =gUnknown_085CD336 -_0814F902: - cmp r2, 0x4 - beq _0814F918 - ldrh r1, [r3] - cmp r1, 0 - bne _0814F90E - adds r2, 0x1 -_0814F90E: - ldr r0, [r5] - adds r3, 0x2 - ldrh r0, [r0] - cmp r1, r0 - bne _0814F902 -_0814F918: - cmp r2, 0 - blt _0814F944 - cmp r2, 0x2 - bgt _0814F938 - ldr r1, =gUnknown_085CCBB5 - adds r0, r4, 0 - bl CopyString - b _0814F944 - .pool -_0814F938: - cmp r2, 0x4 - bgt _0814F944 - ldr r1, =gUnknown_085CCBB9 - adds r0, r4, 0 - bl CopyString -_0814F944: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814F8F8 - - thumb_func_start sub_814F950 -sub_814F950: @ 814F950 - push {r4,r5,lr} - adds r3, r0, 0 - movs r4, 0 - b _0814F95A -_0814F958: - adds r3, 0x1 -_0814F95A: - ldrb r0, [r3] - cmp r0, 0xFF - bne _0814F958 - ldr r1, =gUnknown_085CD336 - ldr r5, =0x0203aba8 - movs r0, 0 - lsls r0, 1 - adds r2, r0, r1 -_0814F96A: - cmp r4, 0x4 - beq _0814F984 - ldrh r1, [r2] - cmp r1, 0 - bne _0814F976 - adds r4, 0x1 -_0814F976: - ldr r0, [r5] - adds r2, 0x2 - ldrh r0, [r0] - cmp r1, r0 - bne _0814F96A - cmp r4, 0x4 - bhi _0814F9E0 -_0814F984: - lsls r0, r4, 2 - ldr r1, =_0814F99C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0814F99C: - .4byte _0814F9B0 - .4byte _0814F9B8 - .4byte _0814F9C0 - .4byte _0814F9C8 - .4byte _0814F9D8 -_0814F9B0: - ldr r1, =gUnknown_085CBDB7 - b _0814F9CA - .pool -_0814F9B8: - ldr r1, =gUnknown_085CBDB9 - b _0814F9CA - .pool -_0814F9C0: - ldr r1, =gUnknown_085CBDBB - b _0814F9CA - .pool -_0814F9C8: - ldr r1, =gUnknown_085CBDBD -_0814F9CA: - adds r0, r3, 0 - bl CopyString - b _0814F9E0 - .pool -_0814F9D8: - ldr r1, =gUnknown_085CBDBF - adds r0, r3, 0 - bl CopyString -_0814F9E0: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814F950 - - thumb_func_start battle_show_message_maybe -battle_show_message_maybe: @ 814F9EC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - adds r4, r0, 0 - lsls r1, 24 - lsrs r7, r1, 24 - ldr r1, =gUnknown_085CD660 - ldr r0, =0x02024474 - adds r0, 0x24 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - mov r8, r0 - movs r0, 0x80 - ands r0, r7 - cmp r0, 0 - beq _0814FA24 - movs r0, 0x7F - ands r7, r0 - movs r0, 0 - b _0814FA36 - .pool -_0814FA24: - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 2 - add r0, r8 - ldrb r1, [r0] - adds r0, r7, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 -_0814FA36: - mov r9, r0 - str r4, [sp] - mov r0, sp - strb r7, [r0, 0x4] - mov r1, sp - lsls r6, r7, 1 - adds r3, r6, r7 - lsls r3, 2 - add r3, r8 - ldrb r0, [r3, 0x1] - strb r0, [r1, 0x5] - ldrb r0, [r3, 0x2] - strb r0, [r1, 0x6] - ldrb r0, [r3, 0x3] - strb r0, [r1, 0x7] - mov r0, sp - ldrb r0, [r0, 0x6] - strb r0, [r1, 0x8] - mov r0, sp - ldrb r0, [r0, 0x7] - strb r0, [r1, 0x9] - ldrb r0, [r3, 0x4] - strb r0, [r1, 0xA] - ldrb r0, [r3, 0x5] - strb r0, [r1, 0xB] - mov r4, sp - ldrb r2, [r4, 0xC] - movs r1, 0x10 - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r4, 0xC] - mov r2, sp - ldrb r0, [r3, 0x7] - lsls r0, 4 - movs r5, 0xF - strb r0, [r2, 0xC] - ldrb r2, [r3, 0x8] - adds r0, r5, 0 - ands r0, r2 - ldrb r2, [r4, 0xD] - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0xD] - mov r2, sp - ldrb r0, [r3, 0x9] - lsls r0, 4 - ands r1, r5 - orrs r1, r0 - strb r1, [r2, 0xD] - mov r0, sp - ldrb r0, [r0, 0x6] - cmp r0, 0xFF - bne _0814FAC6 - ldr r0, =0x02024474 - adds r0, 0x24 - ldrb r0, [r0] - adds r1, r7, 0 - bl sub_80397C4 - adds r2, r0, 0 - mov r0, sp - ldrb r0, [r0, 0x5] - ldr r1, [sp] - mov r3, sp - ldrb r3, [r3, 0xA] - bl GetStringCenterAlignXOffsetWithLetterSpacing - mov r2, sp - mov r1, sp - strb r0, [r1, 0x8] - strb r0, [r2, 0x6] -_0814FAC6: - cmp r7, 0x16 - bne _0814FAE0 - ldr r0, =0x03003014 - ldrb r2, [r0] - movs r1, 0x3 - negs r1, r1 - ands r1, r2 - b _0814FAE8 - .pool -_0814FAE0: - ldr r0, =0x03003014 - ldrb r1, [r0] - movs r2, 0x2 - orrs r1, r2 -_0814FAE8: - strb r1, [r0] - adds r3, r0, 0 - ldr r0, =0x02022fec - ldr r1, [r0] - ldr r2, =0x01000002 - ands r1, r2 - adds r2, r0, 0 - cmp r1, 0 - beq _0814FB10 - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - b _0814FB18 - .pool -_0814FB10: - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 -_0814FB18: - strb r0, [r3] - cmp r7, 0 - beq _0814FB22 - cmp r7, 0x16 - bne _0814FB6C -_0814FB22: - ldr r1, [r2] - ldr r0, =0x02000002 - ands r0, r1 - cmp r0, 0 - beq _0814FB34 - movs r6, 0x1 - b _0814FB5C - .pool -_0814FB34: - movs r0, 0x80 - lsls r0, 17 - ands r1, r0 - cmp r1, 0 - beq _0814FB54 - ldr r4, =gUnknown_085CD668 - bl sub_8185FC4 - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r6, [r0] - b _0814FB5C - .pool -_0814FB54: - bl sav2_get_text_speed - lsls r0, 24 - lsrs r6, r0, 24 -_0814FB5C: - ldr r0, =0x03003014 - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - b _0814FB7E - .pool -_0814FB6C: - adds r0, r6, r7 - lsls r0, 2 - add r0, r8 - ldrb r6, [r0, 0x6] - ldrb r1, [r3] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r3] -_0814FB7E: - mov r0, sp - adds r1, r6, 0 - movs r2, 0 - bl AddTextPrinter - mov r0, r9 - cmp r0, 0 - beq _0814FB9C - adds r0, r7, 0 - bl PutWindowTilemap - adds r0, r7, 0 - movs r1, 0x3 - bl CopyWindowToVram -_0814FB9C: - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end battle_show_message_maybe - - thumb_func_start sub_814FBAC -sub_814FBAC: @ 814FBAC - push {r4,r5,lr} - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r1, r2, 9 - ldr r0, =0x02023068 - adds r1, r0 - ldr r4, =gUnknown_08D85620 - ldr r0, =0x020244b0 - adds r2, r0 - ldrb r2, [r2] - adds r0, r1, 0 - adds r0, 0x8 - adds r0, r2 - ldrb r0, [r0] - adds r1, 0xC - adds r1, r2 - ldrb r1, [r1] - bl sub_814FC20 - lsls r0, 24 - ldr r5, =0x02037714 - lsrs r0, 22 - adds r0, r4 - ldrh r1, [r0] - adds r2, r5, 0 - adds r2, 0xB8 - strh r1, [r2] - ldrh r0, [r0, 0x2] - adds r5, 0xB6 - strh r0, [r5] - ldr r4, =0x02037bcc - adds r0, r2, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl CpuSet - subs r4, 0x2 - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x1 - bl CpuSet - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814FBAC - - thumb_func_start sub_814FC20 -sub_814FC20: @ 814FC20 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - adds r3, r2, 0 - lsls r1, 24 - lsrs r0, r1, 24 - cmp r0, r2 - beq _0814FC68 - cmp r0, 0x2 - bhi _0814FC3A - cmp r2, 0x1 - bhi _0814FC68 - b _0814FC42 -_0814FC3A: - cmp r0, 0x7 - bhi _0814FC4C - cmp r2, 0x2 - bhi _0814FC68 -_0814FC42: - movs r0, 0x2 - subs r0, r2 - lsls r0, 24 - lsrs r0, 24 - b _0814FC6A -_0814FC4C: - cmp r2, 0 - bne _0814FC54 - movs r0, 0x2 - b _0814FC6A -_0814FC54: - lsrs r0, r1, 26 - cmp r2, r0 - bhi _0814FC5E - movs r0, 0x1 - b _0814FC6A -_0814FC5E: - lsrs r0, r1, 25 - cmp r3, r0 - bhi _0814FC68 - movs r0, 0 - b _0814FC6A -_0814FC68: - movs r0, 0x3 -_0814FC6A: - pop {r1} - bx r1 - thumb_func_end sub_814FC20 - - thumb_func_start sub_814FC70 -sub_814FC70: @ 814FC70 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0814FC8E - ldr r0, =sub_814FCC8 - bl SetMainCallback2 - adds r0, r4, 0 - bl DestroyTask -_0814FC8E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814FC70 - - thumb_func_start sub_814FC9C -sub_814FC9C: @ 814FC9C - push {lr} - sub sp, 0x4 - bl script_env_2_enable - ldr r0, =sub_814FC70 - movs r1, 0x1 - bl CreateTask - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_814FC9C - - thumb_func_start sub_814FCC8 -sub_814FCC8: @ 814FCC8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - movs r4, 0 - str r4, [sp, 0x14] - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r6, r1, 0 - cmp r0, 0x9 - bhi _0814FD20 - lsls r0, 2 - ldr r1, =_0814FCF8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0814FCF8: - .4byte _0814FD20 - .4byte _0814FDD8 - .4byte _0814FE90 - .4byte _0814FF50 - .4byte _0814FF7C - .4byte _0814FF98 - .4byte _0814FFF8 - .4byte _08150090 - .4byte _08150190 - .4byte _081501C8 -_0814FD20: - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - bl sub_8150B6C - bl remove_some_task - movs r3, 0xC0 - lsls r3, 19 - movs r4, 0xC0 - lsls r4, 9 - add r0, sp, 0x10 - mov r9, r0 - add r2, sp, 0xC - movs r6, 0 - ldr r1, =0x040000d4 - movs r5, 0x80 - lsls r5, 5 - ldr r7, =0x81000800 - movs r0, 0x81 - lsls r0, 24 - mov r8, r0 -_0814FD4E: - strh r6, [r2] - add r0, sp, 0xC - str r0, [r1] - str r3, [r1, 0x4] - str r7, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r3, r5 - subs r4, r5 - cmp r4, r5 - bhi _0814FD4E - strh r6, [r2] - add r2, sp, 0xC - str r2, [r1] - str r3, [r1, 0x4] - lsrs r0, r4, 1 - mov r3, r8 - orrs r0, r3 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r0, 0xE0 - lsls r0, 19 - movs r3, 0x80 - lsls r3, 3 - movs r4, 0 - str r4, [sp, 0x10] - ldr r2, =0x040000d4 - mov r1, r9 - str r1, [r2] - str r0, [r2, 0x4] - lsrs r0, r3, 2 - movs r1, 0x85 - lsls r1, 24 - orrs r0, r1 - str r0, [r2, 0x8] - ldr r0, [r2, 0x8] - movs r1, 0xA0 - lsls r1, 19 - add r0, sp, 0xC - strh r4, [r0] - str r0, [r2] - str r1, [r2, 0x4] - lsrs r3, 1 - movs r0, 0x81 - lsls r0, 24 - orrs r3, r0 - str r3, [r2, 0x8] - ldr r0, [r2, 0x8] - ldr r4, =0x0203abac - ldr r0, =0x00004110 - bl AllocZeroed - str r0, [r4] - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - ldrb r0, [r1] - adds r0, 0x1 - b _08150224 - .pool -_0814FDD8: - bl ResetAllObjectData - bl ResetTasks - bl ResetObjectPaletteAllocator - bl sub_80A1A74 - bl reset_temp_tile_data_buffers - bl sub_80AAFA4 - movs r4, 0 - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0xF0 - movs r2, 0 -_0814FDFC: - lsls r0, r4, 2 - adds r0, r1, r0 - str r2, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x13 - bls _0814FDFC - bl sound_sources_off - bl map_music_set_to_zero - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085CD66C - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r4, =0x0203abac - ldr r1, [r4] - adds r1, 0xFC - movs r0, 0 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r3, =0x000010fc - adds r1, r3 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x000020fc - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r2, =0x000030fc - adds r1, r2 - movs r0, 0x3 - bl SetBgTilemapBuffer - ldr r2, =0x02021bbc - ldr r1, =0x02021bbe - movs r0, 0 - strh r0, [r1] - strh r0, [r2] - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - ldrb r0, [r1] - adds r0, 0x1 - b _08150224 - .pool -_0814FE90: - movs r4, 0 - add r5, sp, 0x14 - ldr r6, =gUnknown_085CDB54 -_0814FE96: - lsls r0, r4, 3 - adds r0, r6 - bl LoadCompressedObjectPic - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _0814FE96 - ldr r0, =gUnknown_085CDB74 - bl LoadTaggedObjectPalettes - ldr r0, =gUnknown_085CD67C - adds r1, r5, 0 - bl malloc_and_decompress - ldr r4, =0x0203abac - ldr r1, [r4] - ldr r2, =0x000040fc - adds r1, r2 - str r0, [r1] - ldr r0, =gUnknown_085CD7D4 - adds r1, r5, 0 - bl malloc_and_decompress - ldr r1, [r4] - movs r3, 0x82 - lsls r3, 7 - adds r1, r3 - str r0, [r1] - ldr r0, =gUnknown_085CD958 - adds r1, r5, 0 - bl malloc_and_decompress - ldr r1, [r4] - ldr r2, =0x00004104 - adds r1, r2 - str r0, [r1] - ldr r0, =gUnknown_085CDB30 - adds r1, r5, 0 - bl malloc_and_decompress - ldr r1, [r4] - ldr r3, =0x0000410c - adds r2, r1, r3 - str r0, [r2] - ldr r0, =0x00004108 - adds r1, r0 - ldr r0, =gUnknown_085CDB1C - str r0, [r1] - ldr r1, =gUnknown_08DBA5B8 - movs r0, 0 - str r0, [sp] - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - ldrb r0, [r1] - adds r0, 0x1 - b _08150224 - .pool -_0814FF50: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - beq _0814FF5C - b _08150226 -_0814FF5C: - ldr r0, =gUnknown_08DBA518 - movs r1, 0 - movs r2, 0x80 - bl gpu_pal_apply - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - ldrb r0, [r1] - adds r0, 0x1 - b _08150224 - .pool -_0814FF7C: - bl sub_8150D28 - bl RunTasks - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - b _08150224 - .pool -_0814FF98: - ldr r0, =0x0203abac - ldr r0, [r0] - ldrb r0, [r0, 0x2] - cmp r0, 0x7 - bne _0814FFB4 - movs r2, 0x87 - lsls r2, 3 - adds r1, r6, r2 - ldrb r0, [r1] - adds r0, 0x1 - b _08150224 - .pool -_0814FFB4: - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0xF0 - ldr r0, [r1] - cmp r0, 0 - bne _0814FFC4 - b _08150226 -_0814FFC4: - movs r4, 0 - adds r3, r1, 0 - movs r5, 0xD - negs r5, r5 -_0814FFCC: - lsls r0, r4, 2 - adds r0, r3, r0 - ldr r2, [r0] - cmp r2, 0 - beq _0814FFDE - ldrb r1, [r2, 0x5] - adds r0, r5, 0 - ands r0, r1 - strb r0, [r2, 0x5] -_0814FFDE: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x13 - bls _0814FFCC - movs r3, 0x87 - lsls r3, 3 - adds r1, r6, r3 - ldrb r0, [r1] - adds r0, 0x1 - b _08150224 - .pool -_0814FFF8: - ldr r6, =0x0203abac - ldr r0, [r6] - movs r1, 0x82 - lsls r1, 7 - adds r0, r1 - ldr r1, [r0] - movs r0, 0x20 - str r0, [sp] - movs r0, 0xF - str r0, [sp, 0x4] - movs r5, 0x11 - str r5, [sp, 0x8] - movs r0, 0x1 - movs r2, 0 - movs r3, 0x11 - bl CopyToBgTilemapBufferRect_ChangePalette - ldr r0, [r6] - ldr r2, =0x00004104 - adds r0, r2 - ldr r1, [r0] - movs r0, 0x1E - str r0, [sp] - movs r3, 0x14 - mov r8, r3 - str r3, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - ldr r0, [r6] - ldr r1, =0x00004108 - adds r0, r1 - ldr r1, [r0] - movs r0, 0x5 - str r0, [sp] - movs r4, 0x2 - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - ldr r0, [r6] - ldr r2, =0x0000410c - adds r0, r2 - ldr r1, [r0] - str r4, [sp] - mov r3, r8 - str r3, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r2, 0 - movs r3, 0x2 - bl CopyToBgTilemapBufferRect_ChangePalette - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - b _08150224 - .pool -_08150090: - ldr r0, =0x020375e0 - ldrb r0, [r0] - bl sub_81514C8 - ldr r1, =0x0203abac - mov r9, r1 - ldr r0, [r1] - ldr r2, =0x000040fc - mov r8, r2 - add r0, r8 - ldr r1, [r0] - adds r1, 0x90 - movs r6, 0xC - str r6, [sp] - movs r5, 0x3 - str r5, [sp, 0x4] - movs r4, 0x11 - str r4, [sp, 0x8] - movs r0, 0 - movs r2, 0 - movs r3, 0xE - bl CopyToBgTilemapBufferRect_ChangePalette - mov r3, r9 - ldr r0, [r3] - add r0, r8 - ldr r1, [r0] - adds r1, 0xD8 - str r6, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r2, 0xC - movs r3, 0x11 - bl CopyToBgTilemapBufferRect_ChangePalette - mov r1, r9 - ldr r0, [r1] - add r0, r8 - ldr r1, [r0] - movs r2, 0x90 - lsls r2, 1 - adds r1, r2 - str r6, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r2, 0x18 - movs r3, 0x14 - bl CopyToBgTilemapBufferRect_ChangePalette - mov r3, r9 - ldr r0, [r3] - add r0, r8 - ldr r1, [r0] - str r6, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r2, 0 - movs r3, 0x11 - bl CopyToBgTilemapBufferRect_ChangePalette - mov r1, r9 - ldr r0, [r1] - add r0, r8 - ldr r1, [r0] - adds r1, 0x48 - str r6, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r2, 0 - movs r3, 0x14 - bl CopyToBgTilemapBufferRect_ChangePalette - mov r2, r9 - ldr r0, [r2] - add r0, r8 - ldr r1, [r0] - str r6, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r2, 0xC - movs r3, 0x14 - bl CopyToBgTilemapBufferRect_ChangePalette - mov r3, r9 - ldr r0, [r3] - add r0, r8 - ldr r1, [r0] - adds r1, 0x48 - str r6, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r2, 0xC - movs r3, 0x17 - bl CopyToBgTilemapBufferRect_ChangePalette - mov r1, r9 - ldr r0, [r1] - add r0, r8 - ldr r1, [r0] - str r6, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r2, 0x18 - movs r3, 0x17 - bl CopyToBgTilemapBufferRect_ChangePalette - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - ldrb r0, [r1] - adds r0, 0x1 - b _08150224 - .pool -_08150190: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r1, 0x3 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =0x000001a9 - movs r1, 0x1 - bl sub_80A3194 - movs r0, 0x1 - bl sub_8150B6C - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - ldrb r0, [r1] - adds r0, 0x1 - b _08150224 - .pool -_081501C8: - ldr r3, =0x04000208 - ldrh r2, [r3] - movs r0, 0 - strh r0, [r3] - ldr r4, =0x04000200 - ldrh r0, [r4] - movs r1, 0x1 - orrs r0, r1 - strh r0, [r4] - strh r2, [r3] - ldr r0, =sub_8150800 - bl SetVBlankCallback - ldr r0, =mainloop - bl SetMainCallback2 - ldr r0, =sub_81503E4 - movs r1, 0 - bl CreateTask - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0 - bne _08150218 - ldr r0, =sub_8150550 - b _0815021A - .pool -_08150218: - ldr r0, =sub_8150664 -_0815021A: - movs r1, 0x1 - bl CreateTask - ldr r1, =0x0203abac - ldr r1, [r1] -_08150224: - strb r0, [r1] -_08150226: - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_814FCC8 - - thumb_func_start mainloop -mainloop: @ 815023C - push {lr} - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - bl sound_something - pop {r0} - bx r0 - thumb_func_end mainloop - - thumb_func_start c2_8011A1C -c2_8011A1C: @ 8150258 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - movs r4, 0 - movs r0, 0 - bl HideBg - movs r0, 0x1 - bl HideBg - movs r0, 0x2 - bl HideBg - movs r0, 0x3 - bl HideBg - movs r0, 0 - bl sub_8150B6C - ldr r0, =0x02021bbc - strh r4, [r0] - movs r0, 0 - bl sub_80AB130 - add r0, sp, 0x4 - mov r8, r0 - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0xF0 - movs r2, 0 -_08150298: - lsls r0, r4, 2 - adds r0, r1, r0 - str r2, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x13 - bls _08150298 - bl ResetTasks - bl ResetAllObjectData - bl sub_80A1A74 - movs r0, 0 - bl UnsetBgTilemapBuffer - movs r0, 0x1 - bl UnsetBgTilemapBuffer - movs r0, 0x2 - bl UnsetBgTilemapBuffer - movs r0, 0x3 - bl UnsetBgTilemapBuffer - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r6, =0x0203abac - ldr r0, [r6] - ldr r2, =0x00004108 - adds r1, r0, r2 - movs r5, 0 - str r5, [r1] - ldr r4, =0x0000410c - adds r0, r4 - ldr r0, [r0] - bl Free - ldr r0, [r6] - adds r4, r0, r4 - str r5, [r4] - ldr r4, =0x00004104 - adds r0, r4 - ldr r0, [r0] - bl Free - ldr r0, [r6] - adds r4, r0, r4 - str r5, [r4] - movs r4, 0x82 - lsls r4, 7 - adds r0, r4 - ldr r0, [r0] - bl Free - ldr r0, [r6] - adds r4, r0, r4 - str r5, [r4] - ldr r4, =0x000040fc - adds r0, r4 - ldr r0, [r0] - bl Free - ldr r0, [r6] - adds r4, r0, r4 - str r5, [r4] - bl Free - str r5, [r6] - movs r2, 0xC0 - lsls r2, 19 - movs r3, 0xC0 - lsls r3, 9 - mov r4, sp - movs r6, 0 - ldr r1, =0x040000d4 - movs r5, 0x80 - lsls r5, 5 - ldr r7, =0x81000800 - movs r0, 0x81 - lsls r0, 24 - mov r12, r0 -_08150340: - strh r6, [r4] - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - str r7, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r2, r5 - subs r3, r5 - cmp r3, r5 - bhi _08150340 - strh r6, [r4] - mov r0, sp - str r0, [r1] - str r2, [r1, 0x4] - lsrs r0, r3, 1 - mov r2, r12 - orrs r0, r2 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r0, 0xE0 - lsls r0, 19 - movs r3, 0x80 - lsls r3, 3 - movs r4, 0 - str r4, [sp, 0x4] - ldr r2, =0x040000d4 - mov r1, r8 - str r1, [r2] - str r0, [r2, 0x4] - lsrs r0, r3, 2 - movs r1, 0x85 - lsls r1, 24 - orrs r0, r1 - str r0, [r2, 0x8] - ldr r0, [r2, 0x8] - movs r1, 0xA0 - lsls r1, 19 - mov r0, sp - strh r4, [r0] - str r0, [r2] - str r1, [r2, 0x4] - lsrs r3, 1 - movs r0, 0x81 - lsls r0, 24 - orrs r3, r0 - str r3, [r2, 0x8] - ldr r0, [r2, 0x8] - bl warp_in - ldr r0, =0x03005dac - str r4, [r0] - ldr r0, =c2_load_new_map - bl SetMainCallback2 - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end c2_8011A1C - - thumb_func_start sub_81503E4 -sub_81503E4: @ 81503E4 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 - ldr r5, =0x0203abac - ldr r3, [r5] - ldrh r0, [r3, 0x6] - adds r0, 0x1 - strh r0, [r3, 0x6] - ldrb r2, [r3, 0x1] - adds r7, r5, 0 - cmp r2, 0x2 - beq _081504EA - cmp r2, 0x2 - bgt _08150414 - cmp r2, 0 - beq _08150422 - cmp r2, 0x1 - beq _0815043C - b _08150542 - .pool -_08150414: - cmp r2, 0x3 - bne _0815041A - b _08150510 -_0815041A: - cmp r2, 0xFF - bne _08150420 - b _08150528 -_08150420: - b _08150542 -_08150422: - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r3, 0x4] - cmp r0, r1 - beq _0815042E - b _08150542 -_0815042E: - ldrb r0, [r3, 0x2] - bl weather_set - ldr r1, [r5] - movs r0, 0x1 - strb r0, [r1, 0x1] - b _08150542 -_0815043C: - ldrb r0, [r3, 0x2] - cmp r0, 0x2 - beq _08150490 - cmp r0, 0x7 - beq _08150448 - b _08150542 -_08150448: - ldr r0, =gUnknown_0854C14C - ldr r0, [r0] - adds r2, r0, 0 - adds r2, 0xF0 - ldr r0, [r2] - cmp r0, 0 - beq _08150542 - ldrb r1, [r0, 0x5] - movs r0, 0xC - ands r0, r1 - cmp r0, 0 - beq _08150542 - adds r3, r2, 0 - movs r5, 0xD - negs r5, r5 -_08150466: - lsls r0, r4, 2 - adds r0, r3, r0 - ldr r2, [r0] - cmp r2, 0 - beq _08150478 - ldrb r1, [r2, 0x5] - adds r0, r5, 0 - ands r0, r1 - strb r0, [r2, 0x5] -_08150478: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x13 - bls _08150466 - ldr r1, [r7] - movs r0, 0x2 - strb r0, [r1, 0x1] - b _08150542 - .pool -_08150490: - ldr r0, =gUnknown_0854C14C - ldr r2, [r0] - movs r1, 0xDA - lsls r1, 3 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x2 - bne _081504A8 - strb r0, [r3, 0x1] - b _08150542 - .pool -_081504A8: - ldrh r1, [r3, 0x6] - ldrh r0, [r3, 0x4] - adds r0, 0x8 - cmp r1, r0 - blt _08150542 - adds r6, r2, 0 - adds r6, 0xF0 - movs r5, 0x1 - movs r7, 0x5 - negs r7, r7 -_081504BC: - lsls r0, r4, 2 - adds r0, r6, r0 - ldr r0, [r0] - cmp r0, 0 - beq _081504DE - adds r3, r0, 0 - adds r3, 0x3E - ldrb r2, [r3] - lsls r1, r2, 29 - lsrs r1, 31 - eors r1, r5 - ands r1, r5 - lsls r1, 2 - adds r0, r7, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_081504DE: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x13 - bls _081504BC - b _08150542 -_081504EA: - lsls r1, r0, 16 - ldr r0, =0x023a0000 - cmp r1, r0 - bne _08150542 - movs r0, 0x3 - strb r0, [r3, 0x1] - subs r0, 0x4 - str r4, [sp] - movs r1, 0x3 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - movs r0, 0x4 - bl play_sound_effect - b _08150542 - .pool -_08150510: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08150542 - movs r0, 0xFF - strb r0, [r3, 0x1] - b _08150542 - .pool -_08150528: - movs r0, 0 - bl SetVBlankCallback - adds r0, r6, 0 - bl DestroyTask - ldr r0, [r5] - ldrb r0, [r0] - bl DestroyTask - ldr r0, =c2_8011A1C - bl SetMainCallback2 -_08150542: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81503E4 - - thumb_func_start sub_8150550 -sub_8150550: @ 8150550 - push {r4-r6,lr} - sub sp, 0xC - ldr r6, =0x0203abac - ldr r1, [r6] - ldrb r0, [r1, 0x1] - cmp r0, 0xFF - beq _08150630 - ldrb r0, [r1, 0x14] - subs r0, 0x1 - strb r0, [r1, 0x14] - ldr r1, [r6] - ldrh r0, [r1, 0x6] - movs r3, 0x1 - ands r0, r3 - cmp r0, 0 - bne _08150576 - ldrb r0, [r1, 0x15] - subs r0, 0x1 - strb r0, [r1, 0x15] -_08150576: - ldr r2, [r6] - ldrh r0, [r2, 0x6] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _08150590 - ldrb r0, [r2, 0xC] - subs r0, 0x1 - strb r0, [r2, 0xC] - ldr r1, [r6] - ldrb r0, [r1, 0xD] - subs r0, 0x1 - strb r0, [r1, 0xD] -_08150590: - ldr r0, [r6] - ldrb r1, [r0, 0x14] - cmp r1, 0x20 - beq _081505DC - cmp r1, 0x20 - bgt _081505A8 - cmp r1, 0x10 - beq _081505F4 - b _08150630 - .pool -_081505A8: - cmp r1, 0x28 - beq _081505CA - cmp r1, 0xAF - bne _08150630 - movs r0, 0x2 - str r0, [sp] - movs r0, 0xA - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - movs r3, 0x16 - bl FillBgTilemapBufferRect - b _08150630 -_081505CA: - movs r0, 0x2 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0 - movs r2, 0x3 - b _081505EC -_081505DC: - str r3, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0 - movs r2, 0x2 -_081505EC: - movs r3, 0 - bl FillBgTilemapBufferRect - b _08150630 -_081505F4: - ldr r1, =0x00004108 - adds r0, r1 - ldr r1, [r0] - movs r0, 0x5 - str r0, [sp] - movs r4, 0x2 - str r4, [sp, 0x4] - movs r5, 0x11 - str r5, [sp, 0x8] - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - ldr r0, [r6] - ldr r1, =0x0000410c - adds r0, r1 - ldr r1, [r0] - str r4, [sp] - movs r0, 0x1E - str r0, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r2, 0 - movs r3, 0x2 - bl CopyToBgTilemapBufferRect_ChangePalette - ldr r1, [r6] - movs r0, 0x40 - strb r0, [r1, 0x15] -_08150630: - bl sub_815115C - ldr r3, =0x02021bbc - movs r0, 0 - ldrsh r2, [r3, r0] - adds r1, r2, 0x1 - adds r0, r1, 0 - cmp r1, 0 - bge _08150646 - adds r0, r2, 0 - adds r0, 0x80 -_08150646: - asrs r0, 7 - lsls r0, 7 - subs r0, r1, r0 - strh r0, [r3] - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8150550 - - thumb_func_start sub_8150664 -sub_8150664: @ 8150664 - push {r4-r7,lr} - sub sp, 0xC - ldr r7, =0x0203abac - ldr r1, [r7] - ldrb r0, [r1, 0x1] - cmp r0, 0xFF - bne _08150674 - b _081507B6 -_08150674: - ldrb r0, [r1, 0x14] - adds r0, 0x1 - strb r0, [r1, 0x14] - ldr r1, [r7] - ldrh r0, [r1, 0x6] - movs r6, 0x1 - ands r0, r6 - cmp r0, 0 - bne _0815068C - ldrb r0, [r1, 0x15] - adds r0, 0x1 - strb r0, [r1, 0x15] -_0815068C: - ldr r2, [r7] - ldrh r0, [r2, 0x6] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _081506A6 - ldrb r0, [r2, 0xC] - adds r0, 0x1 - strb r0, [r2, 0xC] - ldr r1, [r7] - ldrb r0, [r1, 0xD] - adds r0, 0x1 - strb r0, [r1, 0xD] -_081506A6: - ldr r0, [r7] - ldrb r1, [r0, 0x14] - cmp r1, 0x20 - beq _0815071A - cmp r1, 0x20 - bgt _081506BC - cmp r1, 0x10 - beq _081506E8 - b _081507B6 - .pool -_081506BC: - cmp r1, 0x28 - beq _08150784 - cmp r1, 0xB0 - bne _081507B6 - ldr r1, =0x0000410c - adds r0, r1 - ldr r1, [r0] - movs r0, 0x2 - str r0, [sp] - movs r0, 0x1E - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r2, 0 - movs r3, 0x2 - bl CopyToBgTilemapBufferRect_ChangePalette - b _081507B6 - .pool -_081506E8: - movs r0, 0x3 - str r0, [sp] - movs r4, 0x2 - str r4, [sp, 0x4] - movs r5, 0x11 - str r5, [sp, 0x8] - movs r1, 0 - movs r2, 0x2 - movs r3, 0 - bl FillBgTilemapBufferRect - str r4, [sp] - movs r0, 0xA - str r0, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - movs r3, 0x16 - bl FillBgTilemapBufferRect - ldr r1, [r7] - movs r0, 0xC0 - strb r0, [r1, 0x15] - b _081507B6 -_0815071A: - ldr r5, =0x00004108 - adds r0, r5 - ldr r0, [r0] - ldrh r1, [r0, 0x4] - str r6, [sp] - str r6, [sp, 0x4] - movs r4, 0x11 - str r4, [sp, 0x8] - movs r0, 0x3 - movs r2, 0x2 - movs r3, 0 - bl FillBgTilemapBufferRect - ldr r0, [r7] - adds r0, r5 - ldr r0, [r0] - ldrh r1, [r0, 0x6] - str r6, [sp] - str r6, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - movs r2, 0x3 - movs r3, 0 - bl FillBgTilemapBufferRect - ldr r0, [r7] - adds r0, r5 - ldr r0, [r0] - ldrh r1, [r0, 0xE] - str r6, [sp] - str r6, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - movs r2, 0x2 - movs r3, 0x1 - bl FillBgTilemapBufferRect - ldr r0, [r7] - adds r0, r5 - ldr r0, [r0] - ldrh r1, [r0, 0x10] - str r6, [sp] - str r6, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - movs r2, 0x3 - movs r3, 0x1 - bl FillBgTilemapBufferRect - b _081507B6 - .pool -_08150784: - ldr r5, =0x00004108 - adds r0, r5 - ldr r0, [r0] - ldrh r1, [r0, 0x8] - str r6, [sp] - str r6, [sp, 0x4] - movs r4, 0x11 - str r4, [sp, 0x8] - movs r0, 0x3 - movs r2, 0x4 - movs r3, 0 - bl FillBgTilemapBufferRect - ldr r0, [r7] - adds r0, r5 - ldr r0, [r0] - ldrh r1, [r0, 0x12] - str r6, [sp] - str r6, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - movs r2, 0x4 - movs r3, 0x1 - bl FillBgTilemapBufferRect -_081507B6: - bl sub_81511B8 - ldr r0, =0x0203abac - ldr r1, [r0] - ldrh r0, [r1, 0x6] - ldrh r1, [r1, 0x4] - cmp r0, r1 - bcs _081507DC - ldr r4, =0x02021bbc - movs r1, 0 - ldrsh r0, [r4, r1] - b _081507E6 - .pool -_081507DC: - ldr r0, =gUnknown_0854C14C - ldr r4, [r0] - ldr r0, =0x000006fc - adds r4, r0 - ldrh r0, [r4] -_081507E6: - adds r0, 0xF7 - movs r1, 0xF8 - bl __modsi3 - strh r0, [r4] - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8150664 - - thumb_func_start sub_8150800 -sub_8150800: @ 8150800 - push {r4,lr} - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - ldr r4, =0x0203abac - ldr r0, [r4] - ldrb r1, [r0, 0x14] - movs r0, 0x1C - bl SetGpuReg - ldr r0, [r4] - ldrb r1, [r0, 0x15] - movs r0, 0x1E - bl SetGpuReg - ldr r0, [r4] - ldrb r1, [r0, 0xC] - movs r0, 0x14 - bl SetGpuReg - ldr r0, [r4] - ldrb r1, [r0, 0xD] - movs r0, 0x16 - bl SetGpuReg - ldr r0, [r4] - ldrb r1, [r0, 0x8] - movs r0, 0x10 - bl SetGpuReg - ldr r0, [r4] - ldrb r1, [r0, 0x9] - movs r0, 0x12 - bl SetGpuReg - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8150800 - - thumb_func_start nullsub_58 -nullsub_58: @ 8150864 - bx lr - thumb_func_end nullsub_58 - - thumb_func_start sub_8150868 -sub_8150868: @ 8150868 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r0, =0x0203abac - ldr r6, [r0] - ldrb r0, [r6, 0x1] - cmp r0, 0xFF - beq _08150934 - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0 - bne _081508E4 - movs r0, 0x6 - ldrsh r4, [r6, r0] - adds r0, r4, 0 - bl __floatsisf - cmp r4, 0 - bge _08150892 - ldr r1, =0x47800000 - bl __addsf3 -_08150892: - ldr r1, =0x3e0f5c29 - bl __mulsf3 - bl __fixunssfsi - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r5, 0x2E] - subs r1, r0 - strh r1, [r5, 0x20] - movs r1, 0x6 - ldrsh r4, [r6, r1] - adds r0, r4, 0 - bl __floatsisf - cmp r4, 0 - bge _081508BA - ldr r1, =0x47800000 - bl __addsf3 -_081508BA: - ldr r1, =0x3d89374c - bl __mulsf3 - bl __fixunssfsi - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r5, 0x30] - subs r1, r0 - strh r1, [r5, 0x22] - b _08150934 - .pool -_081508E4: - movs r0, 0x6 - ldrsh r4, [r6, r0] - adds r0, r4, 0 - bl __floatsisf - cmp r4, 0 - bge _081508F8 - ldr r1, =0x47800000 - bl __addsf3 -_081508F8: - ldr r1, =0x3e0f5c29 - bl __mulsf3 - bl __fixunssfsi - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r5, 0x2E] - adds r0, r1 - strh r0, [r5, 0x20] - movs r0, 0x6 - ldrsh r4, [r6, r0] - adds r0, r4, 0 - bl __floatsisf - cmp r4, 0 - bge _08150920 - ldr r1, =0x47800000 - bl __addsf3 -_08150920: - ldr r1, =0x3d89374c - bl __mulsf3 - bl __fixunssfsi - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r5, 0x30] - adds r0, r1 - strh r0, [r5, 0x22] -_08150934: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8150868 - - thumb_func_start sub_8150948 -sub_8150948: @ 8150948 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r0, =0x0203abac - ldr r6, [r0] - ldrb r0, [r6, 0x1] - cmp r0, 0xFF - bne _08150958 - b _08150A60 -_08150958: - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r0, 0 - bne _081509C8 - movs r0, 0x6 - ldrsh r4, [r6, r0] - adds r0, r4, 0 - bl __floatsisf - cmp r4, 0 - bge _08150974 - ldr r1, =0x47800000 - bl __addsf3 -_08150974: - ldr r1, =0x3e0f5c29 - bl __mulsf3 - bl __fixunssfsi - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r5, 0x2E] - subs r1, r0 - strh r1, [r5, 0x20] - movs r1, 0x6 - ldrsh r4, [r6, r1] - adds r0, r4, 0 - bl __floatsisf - cmp r4, 0 - bge _0815099C - ldr r1, =0x47800000 - bl __addsf3 -_0815099C: - ldr r1, =0x3d89374c - bl __mulsf3 - bl __fixunssfsi - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r5, 0x30] - subs r1, r0 - strh r1, [r5, 0x22] - b _08150A18 - .pool -_081509C8: - movs r0, 0x6 - ldrsh r4, [r6, r0] - adds r0, r4, 0 - bl __floatsisf - cmp r4, 0 - bge _081509DC - ldr r1, =0x47800000 - bl __addsf3 -_081509DC: - ldr r1, =0x3e0f5c29 - bl __mulsf3 - bl __fixunssfsi - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r5, 0x2E] - adds r0, r1 - strh r0, [r5, 0x20] - movs r0, 0x6 - ldrsh r4, [r6, r0] - adds r0, r4, 0 - bl __floatsisf - cmp r4, 0 - bge _08150A04 - ldr r1, =0x47800000 - bl __addsf3 -_08150A04: - ldr r1, =0x3d89374c - bl __mulsf3 - bl __fixunssfsi - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r5, 0x30] - adds r0, r1 - strh r0, [r5, 0x22] -_08150A18: - movs r0, 0x32 - ldrsh r2, [r5, r0] - cmp r2, 0 - bne _08150A48 - movs r0, 0x11 - strh r0, [r5, 0x26] - ldrh r0, [r5, 0x34] - adds r1, r0, 0x1 - strh r1, [r5, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - ble _08150A60 - strh r2, [r5, 0x34] - ldrh r0, [r5, 0x32] - adds r0, 0x1 - strh r0, [r5, 0x32] - b _08150A60 - .pool -_08150A48: - movs r2, 0 - movs r0, 0x10 - strh r0, [r5, 0x26] - ldrh r0, [r5, 0x34] - adds r1, r0, 0x1 - strh r1, [r5, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - ble _08150A60 - strh r2, [r5, 0x34] - strh r2, [r5, 0x32] -_08150A60: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8150948 - - thumb_func_start sub_8150A68 -sub_8150A68: @ 8150A68 - push {lr} - adds r2, r0, 0 - movs r1, 0x2E - ldrsh r0, [r2, r1] - cmp r0, 0 - bne _08150A98 - adds r0, r2, 0 - adds r0, 0x28 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 1 - ldrh r3, [r2, 0x20] - adds r0, r3 - strh r0, [r2, 0x20] - ldrh r1, [r2, 0x22] - adds r1, 0x10 - adds r0, r2, 0 - adds r0, 0x29 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - adds r0, r1 - strh r0, [r2, 0x22] -_08150A98: - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x32 - ldrsh r1, [r2, r3] - cmp r0, r1 - blt _08150AEE - movs r0, 0x30 - ldrsh r1, [r2, r0] - cmp r1, 0 - beq _08150AB8 - cmp r1, 0x1 - beq _08150AC2 - b _08150AE0 -_08150AB8: - ldrh r0, [r2, 0x20] - adds r0, 0x1 - strh r0, [r2, 0x20] - ldrh r0, [r2, 0x2E] - b _08150AD2 -_08150AC2: - ldrh r0, [r2, 0x2E] - ands r0, r1 - cmp r0, 0 - beq _08150AE0 - ldrh r0, [r2, 0x20] - adds r0, 0x1 - strh r0, [r2, 0x20] - ldrh r0, [r2, 0x20] -_08150AD2: - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _08150AE0 - ldrh r0, [r2, 0x22] - adds r0, 0x1 - strh r0, [r2, 0x22] -_08150AE0: - movs r1, 0x22 - ldrsh r0, [r2, r1] - cmp r0, 0xA0 - ble _08150AEE - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles -_08150AEE: - pop {r0} - bx r0 - thumb_func_end sub_8150A68 - - thumb_func_start sub_8150AF4 -sub_8150AF4: @ 8150AF4 - push {lr} - adds r2, r0, 0 - movs r1, 0x2E - ldrsh r0, [r2, r1] - cmp r0, 0 - bne _08150B12 - ldrh r1, [r2, 0x22] - adds r1, 0x10 - adds r0, r2, 0 - adds r0, 0x29 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - adds r0, r1 - strh r0, [r2, 0x22] -_08150B12: - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x32 - ldrsh r1, [r2, r3] - cmp r0, r1 - blt _08150B68 - movs r0, 0x30 - ldrsh r1, [r2, r0] - cmp r1, 0 - beq _08150B32 - cmp r1, 0x1 - beq _08150B3C - b _08150B5A -_08150B32: - ldrh r0, [r2, 0x20] - subs r0, 0x1 - strh r0, [r2, 0x20] - ldrh r0, [r2, 0x2E] - b _08150B4C -_08150B3C: - ldrh r0, [r2, 0x2E] - ands r0, r1 - cmp r0, 0 - beq _08150B5A - ldrh r0, [r2, 0x20] - subs r0, 0x1 - strh r0, [r2, 0x20] - ldrh r0, [r2, 0x20] -_08150B4C: - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _08150B5A - ldrh r0, [r2, 0x22] - subs r0, 0x1 - strh r0, [r2, 0x22] -_08150B5A: - movs r1, 0x22 - ldrsh r0, [r2, r1] - cmp r0, 0x4F - bgt _08150B68 - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles -_08150B68: - pop {r0} - bx r0 - thumb_func_end sub_8150AF4 - - thumb_func_start sub_8150B6C -sub_8150B6C: @ 8150B6C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _08150B7A - cmp r0, 0x1 - beq _08150C1C -_08150B7A: - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - movs r0, 0x42 - movs r1, 0 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0 - bl SetGpuReg - movs r0, 0x46 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0xE - movs r1, 0 - bl SetGpuReg - movs r0, 0xC - movs r1, 0 - bl SetGpuReg - movs r0, 0xA - movs r1, 0 - bl SetGpuReg - movs r0, 0x8 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1C - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - b _08150D1C -_08150C1C: - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - movs r0, 0x42 - movs r1, 0 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0 - bl SetGpuReg - movs r0, 0x46 - movs r1, 0 - bl SetGpuReg - ldr r0, =0x020375e0 - ldrh r3, [r0] - cmp r3, 0 - bne _08150C74 - ldr r1, =0x0203abac - ldr r2, [r1] - movs r0, 0xB0 - strb r0, [r2, 0x14] - ldr r2, [r1] - movs r0, 0x10 - strb r0, [r2, 0x15] - ldr r0, [r1] - strb r3, [r0, 0xC] - ldr r2, [r1] - movs r0, 0x50 - b _08150C8C - .pool -_08150C74: - ldr r1, =0x0203abac - ldr r2, [r1] - movs r3, 0 - movs r0, 0x60 - strb r0, [r2, 0x14] - ldr r2, [r1] - movs r0, 0xE8 - strb r0, [r2, 0x15] - ldr r0, [r1] - strb r3, [r0, 0xC] - ldr r2, [r1] - movs r0, 0x4 -_08150C8C: - strb r0, [r2, 0xD] - ldr r0, [r1] - strb r3, [r0, 0x9] - ldr r0, [r1] - strb r3, [r0, 0x9] - adds r4, r1, 0 - ldr r0, [r4] - ldrb r1, [r0, 0x14] - movs r0, 0x1C - bl SetGpuReg - ldr r0, [r4] - ldrb r1, [r0, 0x15] - movs r0, 0x1E - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - ldr r0, [r4] - ldrb r1, [r0, 0xC] - movs r0, 0x14 - bl SetGpuReg - ldr r0, [r4] - ldrb r1, [r0, 0xD] - movs r0, 0x16 - bl SetGpuReg - ldr r0, [r4] - ldrb r1, [r0, 0x8] - movs r0, 0x10 - bl SetGpuReg - ldr r0, [r4] - ldrb r1, [r0, 0x9] - movs r0, 0x12 - bl SetGpuReg - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r1, 0xFC - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg -_08150D1C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8150B6C - - thumb_func_start sub_8150D28 -sub_8150D28: @ 8150D28 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - ldr r1, =gUnknown_085CDBE4 - add r0, sp, 0xC - movs r2, 0x2 - bl memcpy - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - add r6, sp, 0x10 - ldr r1, =gUnknown_085CDBE6 - adds r0, r6, 0 - movs r2, 0x4 - bl memcpy - add r5, sp, 0x14 - ldr r1, =gUnknown_085CDBEA - adds r0, r5, 0 - movs r2, 0x8 - bl memcpy - add r4, sp, 0x1C - ldr r1, =gUnknown_085CDBF2 - adds r0, r4, 0 - movs r2, 0x4 - bl memcpy - ldr r0, =gUnknown_085CDBF8 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x20] - str r1, [sp, 0x24] - ldr r0, =0x020375e0 - ldrh r0, [r0] - mov r8, r6 - mov r10, r5 - cmp r0, 0 - beq _08150D86 - cmp r0, 0x1 - beq _08150E68 -_08150D86: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - add r0, sp - adds r0, 0xC - ldrb r0, [r0] - ldr r1, =sub_8150948 - movs r2, 0x66 - str r2, [sp] - movs r2, 0xC8 - movs r3, 0x49 - bl AddPseudoFieldObject - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x40 - beq _08150DD0 - ldr r0, =0x02020630 - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - movs r2, 0x8 - orrs r0, r2 - strb r0, [r1, 0x5] - movs r0, 0x8 - strh r0, [r1, 0x24] - movs r0, 0x10 - strh r0, [r1, 0x26] - movs r0, 0xC8 - strh r0, [r1, 0x2E] - movs r0, 0x49 - strh r0, [r1, 0x30] -_08150DD0: - ldr r4, =gUnknown_085CDB9C - adds r0, r4, 0 - movs r1, 0xB0 - movs r2, 0x2B - movs r3, 0x67 - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - ldr r5, =0x02020630 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r0, r5 - movs r1, 0x20 - strh r1, [r0, 0x26] - strh r1, [r0, 0x24] - movs r1, 0xB0 - strh r1, [r0, 0x2E] - movs r1, 0x2B - strh r1, [r0, 0x30] - adds r4, 0x18 - adds r0, r4, 0 - movs r1, 0xC8 - movs r2, 0x63 - movs r3, 0x65 - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r0, r5 - movs r1, 0x8 - strh r1, [r0, 0x24] - movs r1, 0x4 - strh r1, [r0, 0x26] - movs r1, 0xC8 - strh r1, [r0, 0x2E] - movs r1, 0x63 - strh r1, [r0, 0x30] - ldr r2, =0x0203abac - ldr r1, [r2] - movs r0, 0x7 - strb r0, [r1, 0x2] - ldr r1, [r2] - movs r0, 0xAF - lsls r0, 1 - strh r0, [r1, 0x4] - movs r0, 0x2 - bl sub_80AB130 - b _08150F3A - .pool -_08150E68: - ldr r7, =0x0203abac - ldr r0, [r7] - ldr r1, =0x000040fc - adds r0, r1 - ldr r1, [r0] - adds r1, 0x48 - movs r0, 0xC - str r0, [sp] - movs r0, 0x3 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - movs r2, 0x18 - movs r3, 0x1A - bl CopyToBgTilemapBufferRect_ChangePalette - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - add r0, sp - adds r0, 0xC - ldrb r0, [r0] - ldr r1, =sub_8150948 - movs r2, 0x66 - str r2, [sp] - movs r2, 0x80 - movs r3, 0x27 - bl AddPseudoFieldObject - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x40 - beq _08150ED4 - ldr r0, =0x02020630 - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - movs r2, 0x8 - orrs r0, r2 - strb r0, [r1, 0x5] - movs r0, 0x8 - strh r0, [r1, 0x24] - movs r0, 0x10 - strh r0, [r1, 0x26] - movs r0, 0x80 - strh r0, [r1, 0x2E] - movs r0, 0x27 - strh r0, [r1, 0x30] -_08150ED4: - ldr r4, =gUnknown_085CDB9C - adds r0, r4, 0 - movs r1, 0x68 - movs r2, 0x9 - movs r3, 0x67 - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - ldr r5, =0x02020630 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r0, r5 - movs r1, 0x20 - strh r1, [r0, 0x26] - strh r1, [r0, 0x24] - movs r1, 0x68 - strh r1, [r0, 0x2E] - movs r1, 0x9 - strh r1, [r0, 0x30] - adds r4, 0x18 - adds r0, r4, 0 - movs r1, 0x80 - movs r2, 0x41 - movs r3, 0x65 - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r0, r5 - movs r1, 0x8 - strh r1, [r0, 0x24] - movs r1, 0x4 - strh r1, [r0, 0x26] - movs r1, 0x80 - strh r1, [r0, 0x2E] - movs r1, 0x41 - strh r1, [r0, 0x30] - ldr r1, [r7] - movs r0, 0x2 - strb r0, [r1, 0x2] - ldr r1, [r7] - ldr r0, =0x00000109 - strh r0, [r1, 0x4] - movs r0, 0x7 - bl sub_80AB130 -_08150F3A: - movs r4, 0 - ldr r5, =0x02020630 -_08150F3E: - lsls r1, r4, 20 - movs r2, 0xC0 - lsls r2, 15 - adds r1, r2 - asrs r1, 16 - lsls r2, r4, 19 - ldr r3, =0xfff80000 - adds r2, r3 - asrs r2, 16 - ldr r0, =gUnknown_085CDBCC - movs r3, 0x68 - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r0, r5 - movs r1, 0x8 - strh r1, [r0, 0x24] - strh r1, [r0, 0x26] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x8 - bls _08150F3E - movs r0, 0x3F - mov r4, r9 - ands r0, r4 - cmp r0, 0 - bne _08151074 - mov r0, r9 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - add r0, r8 - ldrb r0, [r0] - ldr r5, =0x020375e0 - ldrh r4, [r5] - lsls r4, 2 - add r1, sp, 0x20 - adds r1, r4, r1 - ldr r1, [r1] - mov r3, r10 - adds r2, r3, r4 - movs r3, 0 - ldrsh r2, [r2, r3] - mov r3, sp - adds r3, 0x16 - adds r3, r4 - movs r4, 0 - ldrsh r3, [r3, r4] - movs r4, 0x6A - str r4, [sp] - bl AddPseudoFieldObject - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x40 - beq _08151074 - ldr r1, =0x02020630 - lsls r2, r6, 4 - adds r0, r2, r6 - lsls r0, 2 - adds r4, r0, r1 - ldrb r1, [r4, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r4, 0x5] - adds r0, r4, 0 - adds r0, 0x28 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - negs r0, r0 - strh r0, [r4, 0x24] - adds r0, r4, 0 - adds r0, 0x29 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - negs r0, r0 - strh r0, [r4, 0x26] - ldrh r0, [r5] - mov r8, r2 - cmp r0, 0 - bne _08151036 - movs r7, 0x1 - mov r5, r9 - ands r5, r7 - cmp r5, 0 - beq _08151030 - adds r0, r4, 0 - movs r1, 0x6 - b _08151044 - .pool -_08151030: - adds r0, r4, 0 - movs r1, 0x7 - b _08151056 -_08151036: - movs r7, 0x1 - mov r5, r9 - ands r5, r7 - cmp r5, 0 - beq _08151052 - adds r0, r4, 0 - movs r1, 0x7 -_08151044: - bl StartObjectImageAnim - strh r7, [r4, 0x30] - ldrh r0, [r4, 0x22] - adds r0, 0x2 - strh r0, [r4, 0x22] - b _0815105C -_08151052: - adds r0, r4, 0 - movs r1, 0x6 -_08151056: - bl StartObjectImageAnim - strh r5, [r4, 0x30] -_0815105C: - ldr r0, =0x02020630 - mov r2, r8 - adds r1, r2, r6 - lsls r1, 2 - adds r1, r0 - movs r0, 0x3 - mov r3, r9 - ands r0, r3 - add r0, sp - adds r0, 0x1C - ldrb r0, [r0] - strh r0, [r1, 0x32] -_08151074: - 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_8150D28 - - thumb_func_start sub_8151088 -sub_8151088: @ 8151088 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - movs r3, 0 - mov r9, r3 - ldr r2, =0x0203abac - ldr r0, [r2] - ldrb r1, [r0, 0x1B] - adds r1, 0x2 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 26 - lsrs r0, 24 - mov r12, r0 -_081510AA: - movs r7, 0 - lsls r0, r3, 1 - adds r1, r3, 0x3 - adds r2, r3, 0x6 - adds r4, r3, 0x1 - str r4, [sp, 0x4] - adds r0, r3 - lsls r0, 3 - str r0, [sp] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - mov r10, r0 - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 3 - mov r8, r0 -_081510CC: - ldr r0, =0x0203abac - ldr r6, [r0] - lsls r3, r7, 1 - ldr r1, [sp] - adds r2, r3, r1 - adds r4, r6, 0 - adds r4, 0x22 - adds r2, r4, r2 - mov r1, r12 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r12, r0 - ldr r0, =0x000040fc - adds r5, r6, r0 - ldr r0, [r5] - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - strh r0, [r2] - mov r1, r10 - adds r2, r3, r1 - adds r2, r4, r2 - str r2, [sp, 0x8] - ldr r0, [r5] - mov r2, r9 - lsls r1, r2, 1 - adds r0, r1, r0 - ldrh r0, [r0] - ldr r2, [sp, 0x8] - strh r0, [r2] - add r3, r8 - adds r4, r3 - ldr r0, [r5] - adds r1, r0 - adds r1, 0x48 - ldrh r0, [r1] - strh r0, [r4] - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0xB - bls _081510CC - ldr r4, [sp, 0x4] - lsls r0, r4, 24 - lsrs r3, r0, 24 - cmp r3, 0x2 - bls _081510AA - ldrb r0, [r6, 0x1B] - adds r0, 0x1 - movs r1, 0x3 - bl __modsi3 - strb r0, [r6, 0x1B] - 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_8151088 - - thumb_func_start sub_815115C -sub_815115C: @ 815115C - push {r4,r5,lr} - ldr r5, =0x0203abac - ldr r4, [r5] - ldrb r0, [r4, 0x1C] - adds r0, 0x1 - movs r1, 0x60 - bl __modsi3 - strb r0, [r4, 0x1C] - ldr r1, [r5] - ldrb r0, [r1, 0x1F] - ldrb r2, [r1, 0x1D] - subs r0, r2 - strb r0, [r1, 0x8] - ldr r2, [r5] - adds r0, r2, 0 - adds r0, 0x20 - ldrb r0, [r0] - ldrb r1, [r2, 0x1E] - subs r0, r1 - strb r0, [r2, 0x9] - ldr r1, [r5] - ldrb r0, [r1, 0x1D] - adds r0, 0x1 - strb r0, [r1, 0x1D] - ldr r2, [r5] - ldrb r0, [r2, 0x1D] - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _081511A0 - ldrb r0, [r2, 0x1E] - adds r0, 0x1 - strb r0, [r2, 0x1E] -_081511A0: - ldr r0, [r5] - ldrb r0, [r0, 0x1D] - cmp r0, 0x10 - bls _081511AC - bl sub_8151214 -_081511AC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815115C - - thumb_func_start sub_81511B8 -sub_81511B8: @ 81511B8 - push {r4,r5,lr} - ldr r5, =0x0203abac - ldr r4, [r5] - ldrb r0, [r4, 0x1C] - adds r0, 0x1 - movs r1, 0x60 - bl __modsi3 - strb r0, [r4, 0x1C] - ldr r1, [r5] - ldrb r0, [r1, 0x1D] - ldrb r2, [r1, 0x1F] - adds r0, r2 - strb r0, [r1, 0x8] - ldr r1, [r5] - adds r2, r1, 0 - adds r2, 0x20 - ldrb r0, [r1, 0x1E] - ldrb r2, [r2] - adds r0, r2 - strb r0, [r1, 0x9] - ldr r1, [r5] - ldrb r0, [r1, 0x1D] - adds r0, 0x1 - strb r0, [r1, 0x1D] - ldr r2, [r5] - ldrb r0, [r2, 0x1D] - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _081511FC - ldrb r0, [r2, 0x1E] - adds r0, 0x1 - strb r0, [r2, 0x1E] -_081511FC: - ldr r0, [r5] - ldrb r0, [r0, 0x1D] - cmp r0, 0x10 - bls _08151208 - bl sub_8151388 -_08151208: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81511B8 - - thumb_func_start sub_8151214 -sub_8151214: @ 8151214 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - movs r7, 0 - ldr r3, =0x0203abac - ldr r0, [r3] - strb r7, [r0, 0x1E] - strb r7, [r0, 0x1D] - ldr r1, [r3] - ldrb r0, [r1, 0x8] - strb r0, [r1, 0x1F] - ldr r0, [r3] - ldrb r1, [r0, 0x9] - adds r0, 0x20 - strb r1, [r0] - ldr r4, [r3] - ldrb r1, [r4, 0x19] - adds r2, r1, 0 - adds r2, 0x1E - adds r0, r2, 0 - asrs r0, 5 - lsls r0, 5 - subs r0, r2, r0 - strb r0, [r4, 0x19] - ldr r1, [r3] - ldrb r0, [r1, 0x18] - subs r0, 0x2 - strb r0, [r1, 0x18] - ldr r4, =0x0203abb2 - ldr r0, [r3] - ldrb r1, [r0, 0x1A] - adds r2, r1, 0 - adds r2, 0x17 - adds r0, r2, 0 - asrs r0, 5 - lsls r0, 5 - subs r0, r2, r0 - strb r0, [r4] - ldr r6, =0x0203abb0 - mov r9, r3 - ldr r0, =0x0203abb1 - mov r8, r0 -_0815126E: - mov r1, r9 - ldr r2, [r1] - ldrb r0, [r2, 0x19] - strb r0, [r6] - ldr r0, =0x0203abb2 - ldrb r0, [r0] - adds r1, r0, r7 - adds r0, r1, 0 - asrs r0, 5 - lsls r0, 5 - subs r0, r1, r0 - mov r1, r8 - strb r0, [r1] - ldrb r1, [r2, 0x18] - lsls r1, 1 - lsls r0, r7, 1 - adds r0, r7 - lsls r5, r0, 3 - adds r1, r5 - adds r0, r2, 0 - adds r0, 0x22 - adds r0, r1 - ldrh r1, [r0] - ldrb r2, [r6] - mov r0, r8 - ldrb r3, [r0] - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x11 - mov r10, r0 - str r0, [sp, 0x8] - movs r0, 0 - bl FillBgTilemapBufferRect - ldrb r1, [r6] - adds r2, r1, 0x1 - adds r0, r2, 0 - asrs r0, 5 - lsls r0, 5 - subs r0, r2, r0 - strb r0, [r6] - mov r0, r9 - ldr r1, [r0] - ldrb r0, [r1, 0x18] - adds r0, 0x1 - lsls r0, 1 - adds r0, r5 - adds r1, 0x22 - adds r1, r0 - ldrh r1, [r1] - ldrb r2, [r6] - mov r0, r8 - ldrb r3, [r0] - str r4, [sp] - str r4, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - movs r0, 0 - bl FillBgTilemapBufferRect - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x8 - bls _0815126E - ldr r5, =0x0203abb0 - ldr r4, =0x0203abac - ldr r0, [r4] - ldrb r1, [r0, 0x19] - adds r2, r1, 0 - adds r2, 0x1E - adds r0, r2, 0 - asrs r0, 5 - lsls r0, 5 - subs r0, r2, r0 - strb r0, [r5] - ldrb r2, [r5] - movs r0, 0x2 - str r0, [sp] - movs r6, 0x20 - str r6, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r3, 0 - bl FillBgTilemapBufferRect - ldr r1, [r4] - ldrb r0, [r1, 0x18] - cmp r0, 0 - bne _08151368 - ldrb r2, [r1, 0x1A] - adds r3, r2, 0 - adds r3, 0x1D - adds r0, r3, 0 - asrs r0, 5 - lsls r0, 5 - subs r0, r3, r0 - strb r0, [r1, 0x1A] - ldr r1, [r4] - movs r0, 0xC - strb r0, [r1, 0x18] - bl sub_8151088 - ldr r0, [r4] - ldrb r1, [r0, 0x1A] - adds r2, r1, 0x1 - adds r0, r2, 0 - asrs r0, 5 - lsls r0, 5 - subs r0, r2, r0 - strb r0, [r5] - ldrb r3, [r5] - str r6, [sp] - movs r0, 0x9 - str r0, [sp, 0x4] - mov r1, r10 - str r1, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl FillBgTilemapBufferRect -_08151368: - 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_8151214 - - thumb_func_start sub_8151388 -sub_8151388: @ 8151388 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - movs r7, 0 - ldr r2, =0x0203abac - ldr r0, [r2] - strb r7, [r0, 0x1E] - strb r7, [r0, 0x1D] - ldr r1, [r2] - ldrb r0, [r1, 0x8] - strb r0, [r1, 0x1F] - ldr r0, [r2] - ldrb r1, [r0, 0x9] - adds r0, 0x20 - strb r1, [r0] - ldr r4, [r2] - ldrb r1, [r4, 0x19] - adds r3, r1, 0x2 - adds r0, r3, 0 - asrs r0, 5 - lsls r0, 5 - subs r0, r3, r0 - strb r0, [r4, 0x19] - ldr r1, [r2] - ldrb r0, [r1, 0x18] - adds r0, 0x2 - strb r0, [r1, 0x18] - ldr r1, =0x0203abb5 - ldr r0, [r2] - ldrb r0, [r0, 0x1A] - strb r0, [r1] - ldr r6, =0x0203abb3 - mov r10, r2 - ldr r0, =0x0203abb4 - mov r9, r0 -_081513D4: - mov r1, r10 - ldr r2, [r1] - ldrb r0, [r2, 0x19] - strb r0, [r6] - ldr r0, =0x0203abb5 - ldrb r0, [r0] - adds r1, r0, r7 - adds r0, r1, 0 - asrs r0, 5 - lsls r0, 5 - subs r0, r1, r0 - mov r1, r9 - strb r0, [r1] - ldrb r1, [r2, 0x18] - lsls r1, 1 - lsls r0, r7, 1 - adds r0, r7 - lsls r5, r0, 3 - adds r1, r5 - adds r0, r2, 0 - adds r0, 0x22 - adds r0, r1 - ldrh r1, [r0] - ldrb r2, [r6] - mov r0, r9 - ldrb r3, [r0] - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x11 - mov r8, r0 - str r0, [sp, 0x8] - movs r0, 0 - bl FillBgTilemapBufferRect - ldrb r1, [r6] - adds r2, r1, 0x1 - adds r0, r2, 0 - asrs r0, 5 - lsls r0, 5 - subs r0, r2, r0 - strb r0, [r6] - mov r0, r10 - ldr r1, [r0] - ldrb r0, [r1, 0x18] - adds r0, 0x1 - lsls r0, 1 - adds r0, r5 - adds r1, 0x22 - adds r1, r0 - ldrh r1, [r1] - ldrb r2, [r6] - mov r0, r9 - ldrb r3, [r0] - str r4, [sp] - str r4, [sp, 0x4] - mov r0, r8 - str r0, [sp, 0x8] - movs r0, 0 - bl FillBgTilemapBufferRect - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x8 - bls _081513D4 - ldr r4, =0x0203abb4 - ldr r5, =0x0203abac - ldr r3, [r5] - ldrb r1, [r3, 0x1A] - adds r2, r1, 0 - adds r2, 0x17 - adds r0, r2, 0 - asrs r0, 5 - lsls r0, 5 - subs r0, r2, r0 - strb r0, [r4] - ldrb r2, [r3, 0x19] - ldrb r3, [r4] - movs r0, 0x2 - str r0, [sp] - movs r0, 0x9 - str r0, [sp, 0x4] - mov r1, r8 - str r1, [sp, 0x8] - movs r0, 0 - movs r1, 0 - bl FillBgTilemapBufferRect - ldr r1, [r5] - ldrb r0, [r1, 0x18] - cmp r0, 0xA - bne _081514A6 - ldrb r2, [r1, 0x1A] - adds r3, r2, 0x3 - adds r0, r3, 0 - asrs r0, 5 - lsls r0, 5 - subs r0, r3, r0 - strb r0, [r1, 0x1A] - ldr r1, [r5] - movs r0, 0xFE - strb r0, [r1, 0x18] - bl sub_8151088 -_081514A6: - 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_8151388 - - thumb_func_start sub_81514C8 -sub_81514C8: @ 81514C8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081514D6 - cmp r0, 0x1 - beq _08151500 -_081514D6: - ldr r1, =0x0203abac - ldr r2, [r1] - movs r3, 0 - movs r0, 0x2 - strb r0, [r2, 0x1B] - ldr r0, [r1] - strb r3, [r0, 0x19] - ldr r2, [r1] - movs r0, 0x14 - strb r0, [r2, 0x1A] - ldr r1, [r1] - movs r0, 0xC - strb r0, [r1, 0x18] - bl sub_8151088 - bl sub_8151214 - b _08151522 - .pool -_08151500: - ldr r1, =0x0203abac - ldr r2, [r1] - movs r0, 0x2 - strb r0, [r2, 0x1B] - ldr r2, [r1] - movs r0, 0x1C - strb r0, [r2, 0x19] - ldr r2, [r1] - movs r0, 0x14 - strb r0, [r2, 0x1A] - ldr r1, [r1] - movs r0, 0x4 - strb r0, [r1, 0x18] - bl sub_8151088 - bl sub_8151388 -_08151522: - ldr r0, =0x0203abac - ldr r1, [r0] - movs r0, 0 - strb r0, [r1, 0x1C] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81514C8 - - thumb_func_start sub_8151534 -sub_8151534: @ 8151534 - push {lr} - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - muls r0, r1 - adds r1, r0, 0 - cmp r0, 0 - bge _08151548 - adds r1, 0xFF -_08151548: - lsls r0, r1, 8 - asrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_8151534 - - thumb_func_start sub_8151550 -sub_8151550: @ 8151550 - push {lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r3, 16 - asrs r3, 16 - lsls r2, 16 - asrs r2, 16 - muls r3, r2 - movs r1, 0x1 - lsls r1, r0 - adds r0, r3, 0 - bl __divsi3 - lsls r0, 16 - asrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_8151550 - - thumb_func_start sub_8151574 -sub_8151574: @ 8151574 - push {r4-r7,lr} - adds r2, r1, 0 - adds r4, r0, 0 - asrs r5, r0, 31 - asrs r3, r2, 31 - adds r1, r5, 0 - adds r0, r4, 0 - bl __muldi3 - adds r5, r1, 0 - adds r4, r0, 0 - adds r7, r5, 0 - adds r6, r4, 0 - cmp r5, 0 - bge _0815159A - movs r6, 0xFF - movs r7, 0 - adds r6, r4 - adcs r7, r5 -_0815159A: - lsls r3, r7, 24 - lsrs r2, r6, 8 - adds r0, r3, 0 - orrs r0, r2 - asrs r1, r7, 8 - adds r5, r1, 0 - adds r4, r0, 0 - adds r0, r4, 0 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8151574 - - thumb_func_start sub_81515B0 -sub_81515B0: @ 81515B0 - push {lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 16 - asrs r1, 16 - cmp r1, 0 - beq _081515CC - lsls r0, 16 - asrs r0, 8 - bl __divsi3 - lsls r0, 16 - asrs r0, 16 - b _081515CE -_081515CC: - movs r0, 0 -_081515CE: - pop {r1} - bx r1 - thumb_func_end sub_81515B0 - - thumb_func_start sub_81515D4 -sub_81515D4: @ 81515D4 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 16 - lsrs r0, r1, 16 - lsls r2, 16 - asrs r1, r2, 16 - cmp r1, 0 - beq _081515F6 - lsls r0, 16 - asrs r0, 16 - lsls r0, r3 - bl __divsi3 - lsls r0, 16 - asrs r0, 16 - b _081515F8 -_081515F6: - movs r0, 0 -_081515F8: - pop {r1} - bx r1 - thumb_func_end sub_81515D4 - - thumb_func_start sub_81515FC -sub_81515FC: @ 81515FC - push {r4-r6,lr} - adds r6, r1, 0 - cmp r6, 0 - beq _0815161C - adds r2, r0, 0 - asrs r3, r0, 31 - lsrs r5, r2, 24 - lsls r4, r3, 8 - adds r1, r5, 0 - orrs r1, r4 - lsls r0, r2, 8 - adds r2, r6, 0 - asrs r3, r6, 31 - bl __divdi3 - b _0815161E -_0815161C: - movs r0, 0 -_0815161E: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81515FC - - thumb_func_start sub_8151624 -sub_8151624: @ 8151624 - push {lr} - adds r1, r0, 0 - movs r0, 0x80 - lsls r0, 9 - lsls r1, 16 - asrs r1, 16 - bl __divsi3 - lsls r0, 16 - asrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_8151624 - - thumb_func_start sub_815163C -sub_815163C: @ 815163C - push {lr} - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - lsls r2, r0 - lsls r1, 16 - asrs r1, 16 - adds r0, r2, 0 - bl __divsi3 - lsls r0, 16 - asrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_815163C - - thumb_func_start sub_815165C -sub_815165C: @ 815165C - push {lr} - adds r2, r0, 0 - ldr r1, _08151674 - ldr r0, _08151670 - asrs r3, r2, 31 - bl __divdi3 - pop {r1} - bx r1 - .align 2, 0 -_08151670: .4byte 0x00010000 -_08151674: .4byte 0x00000000 - thumb_func_end sub_815165C - - thumb_func_start sub_8151678 -sub_8151678: @ 8151678 - push {lr} - movs r1, 0 - strb r1, [r0] - strh r1, [r0, 0x2] - adds r0, 0x4 - movs r2, 0xC0 - bl memset - pop {r0} - bx r0 - thumb_func_end sub_8151678 - - thumb_func_start sub_815168C -sub_815168C: @ 815168C - push {r4-r7,lr} - adds r3, r0, 0 - lsls r1, 24 - lsrs r6, r1, 24 - cmp r6, 0xF - bhi _081516A8 - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 2 - adds r5, r3, r0 - ldrb r7, [r5, 0x4] - lsrs r0, r7, 7 - cmp r0, 0 - beq _081516AC -_081516A8: - movs r0, 0xFF - b _0815170A -_081516AC: - ldrh r0, [r2] - movs r4, 0 - strh r0, [r5, 0x8] - ldrh r0, [r2, 0x2] - strh r0, [r5, 0xA] - ldrb r0, [r2, 0x4] - strb r0, [r5, 0xC] - ldrb r0, [r2, 0x5] - strb r0, [r5, 0xD] - ldrb r0, [r2, 0x6] - strb r0, [r5, 0xE] - ldrb r3, [r2, 0x7] - lsls r0, r3, 27 - lsrs r0, 27 - ldrb r2, [r5, 0xF] - movs r1, 0x20 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - movs r0, 0x60 - ands r0, r3 - movs r2, 0x61 - negs r2, r2 - ands r1, r2 - orrs r1, r0 - lsls r3, 24 - asrs r3, 31 - lsls r3, 7 - movs r0, 0x7F - ands r1, r0 - orrs r1, r3 - strb r1, [r5, 0xF] - subs r0, 0xFF - ands r0, r7 - movs r2, 0x80 - orrs r0, r2 - strb r0, [r5, 0x4] - strb r4, [r5, 0x6] - strb r4, [r5, 0x5] - lsls r1, 24 - cmp r1, 0 - bge _08151704 - movs r0, 0xFF - b _08151706 -_08151704: - movs r0, 0x1 -_08151706: - strb r0, [r5, 0x7] - adds r0, r6, 0 -_0815170A: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_815168C - - thumb_func_start sub_8151710 -sub_8151710: @ 8151710 - push {r4,lr} - adds r2, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r4, r1, 0 - cmp r4, 0xF - bhi _0815173C - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r1, r2, r0 - ldrb r0, [r1, 0x4] - lsrs r0, 7 - cmp r0, 0 - beq _0815173C - adds r0, r1, 0x4 - movs r1, 0 - movs r2, 0xC - bl memset - adds r0, r4, 0 - b _0815173E -_0815173C: - movs r0, 0xFF -_0815173E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8151710 - - thumb_func_start sub_8151744 -sub_8151744: @ 8151744 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r5, r0, 0 - movs r0, 0 - mov r12, r0 - ldrb r1, [r5, 0x8] - cmp r12, r1 - bcc _0815175C - b _081518F4 -_0815175C: - movs r7, 0x1F - ldr r0, =0xfffffc1f - mov r10, r0 - movs r1, 0x7D - negs r1, r1 - mov r9, r1 - movs r0, 0x1F - mov r8, r0 -_0815176C: - ldrh r0, [r5, 0x6] - add r0, r12 - lsls r0, 1 - ldr r1, =0x02037b14 - adds r3, r0, r1 - ldr r1, =0x02037714 - adds r6, r0, r1 - ldrb r0, [r5] - lsls r0, 25 - lsrs r0, 25 - cmp r0, 0x1 - beq _08151798 - cmp r0, 0x2 - beq _081517F6 - b _081518E2 - .pool -_08151798: - ldr r0, [r3] - lsls r2, r0, 27 - lsrs r0, r2, 27 - movs r1, 0x3 - ldrsb r1, [r5, r1] - adds r0, r1 - cmp r0, 0x1F - bhi _081517BA - lsrs r0, r2, 27 - adds r0, r1 - ands r0, r7 - ldrb r2, [r3] - movs r1, 0x20 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3] -_081517BA: - ldr r0, [r3] - lsls r2, r0, 22 - lsrs r0, r2, 27 - movs r1, 0x3 - ldrsb r1, [r5, r1] - adds r0, r1 - cmp r0, 0x1F - bhi _081517DE - lsrs r0, r2, 27 - adds r0, r1 - mov r1, r8 - ands r0, r1 - lsls r0, 5 - ldrh r2, [r3] - mov r1, r10 - ands r1, r2 - orrs r1, r0 - strh r1, [r3] -_081517DE: - ldr r0, [r3] - lsls r2, r0, 17 - lsrs r0, r2, 27 - movs r1, 0x3 - ldrsb r1, [r5, r1] - adds r0, r1 - cmp r0, 0x1F - bls _081517F0 - b _081518E2 -_081517F0: - lsrs r0, r2, 27 - adds r0, r1 - b _081518D4 -_081517F6: - movs r0, 0x3 - ldrsb r0, [r5, r0] - cmp r0, 0 - bge _08151868 - ldr r0, [r3] - lsls r4, r0, 27 - lsrs r1, r4, 27 - movs r2, 0x3 - ldrsb r2, [r5, r2] - adds r1, r2 - ldr r0, [r6] - lsls r0, 27 - lsrs r0, 27 - cmp r1, r0 - blt _08151826 - lsrs r0, r4, 27 - adds r0, r2 - ands r0, r7 - ldrb r2, [r3] - movs r1, 0x20 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3] -_08151826: - ldr r0, [r3] - lsls r4, r0, 22 - lsrs r1, r4, 27 - movs r2, 0x3 - ldrsb r2, [r5, r2] - adds r1, r2 - ldr r0, [r6] - lsls r0, 22 - lsrs r0, 27 - cmp r1, r0 - blt _08151850 - lsrs r0, r4, 27 - adds r0, r2 - mov r1, r8 - ands r0, r1 - lsls r0, 5 - ldrh r2, [r3] - mov r1, r10 - ands r1, r2 - orrs r1, r0 - strh r1, [r3] -_08151850: - ldr r0, [r3] - lsls r4, r0, 17 - lsrs r1, r4, 27 - movs r2, 0x3 - ldrsb r2, [r5, r2] - adds r1, r2 - ldr r0, [r6] - lsls r0, 17 - lsrs r0, 27 - cmp r1, r0 - blt _081518E2 - b _081518D0 -_08151868: - ldr r0, [r3] - lsls r4, r0, 27 - lsrs r1, r4, 27 - movs r2, 0x3 - ldrsb r2, [r5, r2] - adds r1, r2 - ldr r0, [r6] - lsls r0, 27 - lsrs r0, 27 - cmp r1, r0 - bgt _08151890 - lsrs r0, r4, 27 - adds r0, r2 - ands r0, r7 - ldrb r2, [r3] - movs r1, 0x20 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3] -_08151890: - ldr r0, [r3] - lsls r4, r0, 22 - lsrs r1, r4, 27 - movs r2, 0x3 - ldrsb r2, [r5, r2] - adds r1, r2 - ldr r0, [r6] - lsls r0, 22 - lsrs r0, 27 - cmp r1, r0 - bgt _081518BA - lsrs r0, r4, 27 - adds r0, r2 - mov r1, r8 - ands r0, r1 - lsls r0, 5 - ldrh r2, [r3] - mov r1, r10 - ands r1, r2 - orrs r1, r0 - strh r1, [r3] -_081518BA: - ldr r0, [r3] - lsls r4, r0, 17 - lsrs r1, r4, 27 - movs r2, 0x3 - ldrsb r2, [r5, r2] - adds r1, r2 - ldr r0, [r6] - lsls r0, 17 - lsrs r0, 27 - cmp r1, r0 - bgt _081518E2 -_081518D0: - lsrs r0, r4, 27 - adds r0, r2 -_081518D4: - ands r0, r7 - lsls r0, 2 - ldrb r2, [r3, 0x1] - mov r1, r9 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x1] -_081518E2: - mov r0, r12 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r12, r0 - ldrb r0, [r5, 0x8] - cmp r12, r0 - bcs _081518F4 - b _0815176C -_081518F4: - ldrb r1, [r5, 0x2] - adds r0, r1, 0x1 - strb r0, [r5, 0x2] - ldrb r0, [r5, 0xB] - lsls r0, 27 - lsls r1, 24 - asrs r0, 3 - cmp r1, r0 - beq _0815190A - movs r0, 0 - b _0815193E -_0815190A: - movs r0, 0 - strb r0, [r5, 0x2] - movs r0, 0x3 - ldrsb r0, [r5, r0] - negs r0, r0 - strb r0, [r5, 0x3] - ldrb r2, [r5] - movs r1, 0x7F - movs r0, 0x7F - ands r0, r2 - cmp r0, 0x1 - bne _0815192A - lsls r0, r2, 25 - lsrs r0, 25 - adds r0, 0x1 - b _08151930 -_0815192A: - lsls r0, r2, 25 - lsrs r0, 25 - subs r0, 0x1 -_08151930: - ands r0, r1 - movs r1, 0x80 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r5] - movs r0, 0x1 -_0815193E: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8151744 - - thumb_func_start sub_815194C -sub_815194C: @ 815194C - push {r4,r5,lr} - adds r3, r0, 0 - movs r2, 0 - ldrb r0, [r3] - lsls r0, 25 - lsrs r0, 25 - cmp r0, 0x1 - beq _08151962 - cmp r0, 0x2 - beq _08151990 - b _081519CA -_08151962: - ldrb r0, [r3, 0x8] - cmp r2, r0 - bcs _08151982 - ldr r4, =0x02037b14 -_0815196A: - ldrh r0, [r3, 0x6] - adds r0, r2 - lsls r0, 1 - adds r0, r4 - ldrh r1, [r3, 0x4] - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - ldrb r0, [r3, 0x8] - cmp r2, r0 - bcc _0815196A -_08151982: - ldrb r2, [r3] - lsls r1, r2, 25 - lsrs r1, 25 - adds r1, 0x1 - b _081519BC - .pool -_08151990: - ldrb r0, [r3, 0x8] - cmp r2, r0 - bcs _081519B4 - ldr r5, =0x02037b14 - ldr r4, =0x02037714 -_0815199A: - ldrh r0, [r3, 0x6] - adds r0, r2 - lsls r0, 1 - adds r1, r0, r5 - adds r0, r4 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - ldrb r0, [r3, 0x8] - cmp r2, r0 - bcc _0815199A -_081519B4: - ldrb r2, [r3] - lsls r1, r2, 25 - lsrs r1, 25 - subs r1, 0x1 -_081519BC: - movs r0, 0x7F - ands r1, r0 - movs r0, 0x80 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_081519CA: - movs r0, 0x1 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_815194C - - thumb_func_start task_tutorial_controls_fadein -task_tutorial_controls_fadein: @ 81519DC - push {r4-r6,lr} - adds r4, r0, 0 - movs r5, 0 - ldrb r0, [r4] - cmp r0, 0 - beq _08151A40 -_081519E8: - ldrh r0, [r4, 0x2] - asrs r0, r5 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08151A36 - lsls r1, r5, 1 - adds r0, r1, r5 - lsls r3, r0, 2 - adds r2, r4, r3 - ldrb r0, [r2, 0x5] - subs r0, 0x1 - strb r0, [r2, 0x5] - lsls r0, 24 - lsrs r0, 24 - adds r6, r1, 0 - cmp r0, 0xFF - bne _08151A36 - ldrh r0, [r2, 0x8] - movs r2, 0x80 - lsls r2, 8 - adds r1, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _08151A24 - adds r0, r3, 0x4 - adds r0, r4, r0 - bl sub_8151744 - b _08151A2C -_08151A24: - adds r0, r3, 0x4 - adds r0, r4, r0 - bl sub_815194C -_08151A2C: - adds r0, r6, r5 - lsls r0, 2 - adds r0, r4, r0 - ldrb r1, [r0, 0xD] - strb r1, [r0, 0x5] -_08151A36: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0xF - bls _081519E8 -_08151A40: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end task_tutorial_controls_fadein - - thumb_func_start sub_8151A48 -sub_8151A48: @ 8151A48 - push {r4-r7,lr} - adds r3, r0, 0 - lsls r1, 16 - lsrs r6, r1, 16 - movs r4, 0 - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - movs r5, 0x1 - movs r7, 0x80 - negs r7, r7 -_08151A5E: - adds r0, r6, 0 - asrs r0, r4 - ands r0, r5 - cmp r0, 0 - beq _08151A8C - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r2, r3, r0 - ldrb r0, [r2, 0x4] - lsrs r0, 7 - cmp r0, 0 - beq _08151A8C - adds r0, r5, 0 - lsls r0, r4 - ldrh r1, [r3, 0x2] - orrs r0, r1 - strh r0, [r3, 0x2] - ldrb r1, [r2, 0x4] - adds r0, r7, 0 - ands r0, r1 - orrs r0, r5 - strb r0, [r2, 0x4] -_08151A8C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _08151A5E - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8151A48 - - thumb_func_start sub_8151A9C -sub_8151A9C: @ 8151A9C - push {r4-r7,lr} - sub sp, 0x4 - adds r6, r0, 0 - lsls r1, 16 - lsrs r7, r1, 16 - movs r5, 0 - movs r3, 0x1 -_08151AAA: - ldrh r0, [r6, 0x2] - asrs r0, r5 - ands r0, r3 - cmp r0, 0 - beq _08151B12 - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r4, r6, r0 - ldrb r0, [r4, 0x4] - lsrs r0, 7 - cmp r0, 0 - beq _08151B12 - adds r0, r7, 0 - asrs r0, r5 - ands r0, r3 - cmp r0, 0 - beq _08151B12 - ldrh r1, [r4, 0xA] - lsls r1, 1 - ldr r0, =0x02037b14 - adds r0, r1, r0 - ldr r2, =0x02037714 - adds r1, r2 - ldrb r2, [r4, 0xC] - lsls r2, 1 - str r3, [sp] - bl memcpy - ldrb r0, [r4, 0x4] - movs r2, 0x80 - negs r2, r2 - adds r1, r2, 0 - ands r0, r1 - strb r0, [r4, 0x4] - movs r0, 0 - strb r0, [r4, 0x6] - strb r0, [r4, 0x5] - ldrb r0, [r4, 0xF] - lsls r0, 24 - ldr r3, [sp] - cmp r0, 0 - bge _08151B10 - movs r0, 0xFF - strb r0, [r4, 0x7] - b _08151B12 - .pool -_08151B10: - strb r3, [r4, 0x7] -_08151B12: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0xF - bls _08151AAA - ldr r0, =0x0000ffff - cmp r7, r0 - bne _08151B2C - movs r0, 0 - strb r0, [r6] - b _08151B30 - .pool -_08151B2C: - ldrh r0, [r6, 0x2] - bics r0, r7 -_08151B30: - strh r0, [r6, 0x2] - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8151A9C - - thumb_func_start sub_8151B3C -sub_8151B3C: @ 8151B3C - push {r4,r5,lr} - adds r5, r0, 0 - movs r4, 0 - strh r4, [r5] - adds r0, r5, 0x4 - movs r1, 0 - movs r2, 0xC0 - bl memset -_08151B4E: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r5, r0 - strb r4, [r0, 0x4] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _08151B4E - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8151B3C - - thumb_func_start sub_8151B68 -sub_8151B68: @ 8151B68 - push {r4,r5,lr} - adds r2, r0, 0 - adds r5, r1, 0 - movs r3, 0 - movs r4, 0 - ldrb r0, [r2, 0x5] - lsrs r0, 7 - cmp r0, 0 - bne _08151B7E - adds r4, r2, 0x4 - b _08151B9C -_08151B7E: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0xF - bhi _08151B9C - lsls r0, r3, 1 - adds r0, r3 - lsls r1, r0, 2 - adds r0, r2, r1 - ldrb r0, [r0, 0x5] - lsrs r0, 7 - cmp r0, 0 - bne _08151B7E - adds r0, r1, 0x4 - adds r4, r2, r0 -_08151B9C: - cmp r4, 0 - beq _08151BCA - ldrb r1, [r4, 0x1] - movs r0, 0x10 - negs r0, r0 - ands r0, r1 - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - movs r1, 0x40 - orrs r0, r1 - movs r1, 0x80 - orrs r0, r1 - strb r0, [r4, 0x1] - movs r0, 0 - strb r0, [r4, 0x2] - strb r0, [r4, 0x3] - adds r1, r4, 0x4 - adds r0, r5, 0 - ldm r0!, {r2,r4} - stm r1!, {r2,r4} - adds r0, r3, 0 - b _08151BCC -_08151BCA: - movs r0, 0xFF -_08151BCC: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8151B68 - - thumb_func_start sub_8151BD4 -sub_8151BD4: @ 8151BD4 - push {r4,r5,lr} - adds r4, r0, 0 - ldrb r1, [r4, 0x1] - movs r2, 0x40 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _08151C16 - ldrb r1, [r4, 0xB] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _08151C16 - ldrh r2, [r4, 0x6] - ldrb r0, [r4, 0x8] - adds r0, r2, r0 - cmp r2, r0 - bge _08151C16 - ldr r5, =0x02037b14 - ldr r3, =0x02037714 -_08151BFC: - lsls r0, r2, 1 - adds r1, r0, r5 - adds r0, r3 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - ldrh r0, [r4, 0x6] - ldrb r1, [r4, 0x8] - adds r0, r1 - cmp r2, r0 - blt _08151BFC -_08151C16: - adds r0, r4, 0x4 - movs r1, 0 - movs r2, 0x8 - bl memset - ldrb r1, [r4, 0x1] - movs r0, 0x10 - negs r0, r0 - ands r0, r1 - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - subs r1, 0x10 - ands r0, r1 - movs r1, 0x40 - orrs r0, r1 - movs r1, 0x7F - ands r0, r1 - strb r0, [r4, 0x1] - movs r0, 0 - strb r0, [r4, 0x3] - strb r0, [r4, 0x2] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8151BD4 - - thumb_func_start sub_8151C50 -sub_8151C50: @ 8151C50 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 24 - movs r5, 0 - cmp r2, 0 - bne _08151C74 - movs r1, 0xF - ands r1, r4 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, 0x4 - adds r0, r6, r0 - bl sub_8151BD4 - b _08151CA0 -_08151C74: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _08151C94 - lsls r0, r5, 1 - adds r0, r5 - lsls r1, r0, 2 - adds r0, r6, r1 - ldrb r0, [r0, 0x5] - lsrs r0, 7 - cmp r0, 0 - beq _08151C94 - adds r0, r1, 0x4 - adds r0, r6, r0 - bl sub_8151BD4 -_08151C94: - lsrs r4, 1 - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0xF - bls _08151C74 -_08151CA0: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8151C50 - - thumb_func_start sub_8151CA8 -sub_8151CA8: @ 8151CA8 - push {r4-r7,lr} - adds r5, r0, 0 - lsls r1, 16 - lsrs r4, r1, 16 - lsls r2, 24 - movs r3, 0 - cmp r2, 0 - bne _08151CDC - movs r0, 0xF - adds r3, r0, 0 - ands r3, r4 - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 2 - adds r1, r5, r1 - ldrb r2, [r1, 0x5] - movs r0, 0x41 - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] - movs r0, 0x1 - lsls r0, r3 - ldrh r1, [r5] - orrs r0, r1 - strh r0, [r5] - b _08151D20 -_08151CDC: - movs r6, 0x1 - movs r7, 0x41 - negs r7, r7 -_08151CE2: - adds r0, r4, 0 - ands r0, r6 - cmp r0, 0 - beq _08151D00 - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r2, r5, r0 - ldrb r1, [r2, 0x5] - lsrs r0, r1, 7 - cmp r0, 0 - beq _08151D00 - lsls r0, r1, 25 - cmp r0, 0 - blt _08151D06 -_08151D00: - lsls r0, r4, 17 - lsrs r4, r0, 16 - b _08151D16 -_08151D06: - adds r0, r7, 0 - ands r0, r1 - strb r0, [r2, 0x5] - adds r0, r6, 0 - lsls r0, r3 - ldrh r1, [r5] - orrs r0, r1 - strh r0, [r5] -_08151D16: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0xF - bls _08151CE2 -_08151D20: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8151CA8 - - thumb_func_start sub_8151D28 -sub_8151D28: @ 8151D28 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r8, r0 - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 24 - movs r0, 0 - mov r12, r0 - cmp r2, 0 - bne _08151DB0 - movs r1, 0xF - ands r1, r7 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, 0x4 - mov r1, r8 - adds r3, r1, r0 - ldrb r1, [r3, 0x1] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0x80 - bne _08151E3A - ldrb r1, [r3, 0xB] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08151D8E - ldrh r2, [r3, 0x6] - ldrb r0, [r3, 0x8] - adds r0, r2, r0 - cmp r2, r0 - bge _08151D8E - ldr r5, =0x02037b14 - ldr r4, =0x02037714 -_08151D74: - lsls r0, r2, 1 - adds r1, r0, r5 - adds r0, r4 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - ldrh r0, [r3, 0x6] - ldrb r1, [r3, 0x8] - adds r0, r1 - cmp r2, r0 - blt _08151D74 -_08151D8E: - ldrb r0, [r3, 0x1] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r3, 0x1] - movs r1, 0x1 - mov r2, r12 - lsls r1, r2 - mov r2, r8 - ldrh r0, [r2] - bics r0, r1 - strh r0, [r2] - b _08151E3A - .pool -_08151DB0: - movs r0, 0x1 - mov r9, r0 - movs r1, 0x40 - mov r10, r1 -_08151DB8: - mov r2, r12 - lsls r0, r2, 1 - add r0, r12 - lsls r0, 2 - adds r0, 0x4 - mov r1, r8 - adds r3, r1, r0 - adds r0, r7, 0 - mov r2, r9 - ands r0, r2 - cmp r0, 0 - beq _08151DDA - ldrb r1, [r3, 0x1] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0x80 - beq _08151DE4 -_08151DDA: - lsls r0, r7, 17 - lsrs r7, r0, 16 - mov r5, r12 - adds r5, 0x1 - b _08151E30 -_08151DE4: - ldrb r1, [r3, 0xB] - mov r0, r10 - ands r0, r1 - mov r5, r12 - adds r5, 0x1 - cmp r0, 0 - beq _08151E1A - ldrh r2, [r3, 0x6] - ldrb r0, [r3, 0x8] - adds r0, r2, r0 - cmp r2, r0 - bge _08151E1A - ldr r6, =0x02037b14 - ldr r4, =0x02037714 -_08151E00: - lsls r0, r2, 1 - adds r1, r0, r6 - adds r0, r4 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - ldrh r0, [r3, 0x6] - ldrb r1, [r3, 0x8] - adds r0, r1 - cmp r2, r0 - blt _08151E00 -_08151E1A: - ldrb r1, [r3, 0x1] - mov r0, r10 - orrs r0, r1 - strb r0, [r3, 0x1] - mov r1, r9 - mov r0, r12 - lsls r1, r0 - mov r2, r8 - ldrh r0, [r2] - bics r0, r1 - strh r0, [r2] -_08151E30: - lsls r0, r5, 24 - lsrs r0, 24 - mov r12, r0 - cmp r0, 0xF - bls _08151DB8 -_08151E3A: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8151D28 - - thumb_func_start sub_8151E50 -sub_8151E50: @ 8151E50 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - str r0, [sp] - movs r0, 0 - mov r10, r0 - ldr r1, [sp] - ldrh r0, [r1] - cmp r0, 0 - bne _08151E6C - b _08151FF6 -_08151E6C: - movs r2, 0xF - mov r9, r2 - movs r3, 0x10 - negs r3, r3 - mov r8, r3 - movs r7, 0x1 -_08151E78: - mov r5, r10 - lsls r0, r5, 1 - add r0, r10 - lsls r0, 2 - adds r0, 0x4 - ldr r1, [sp] - adds r4, r1, r0 - ldrb r2, [r4, 0x1] - movs r3, 0xC0 - ands r3, r2 - cmp r3, 0x80 - beq _08151E92 - b _08151FE6 -_08151E92: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _08151EA8 - ldrb r0, [r4, 0xB] - ands r3, r0 - cmp r3, 0 - beq _08151EA8 - b _08151FE6 -_08151EA8: - ldrb r0, [r4, 0x2] - subs r0, 0x1 - strb r0, [r4, 0x2] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _08151EB8 - b _08151FE6 -_08151EB8: - ldrb r0, [r4, 0x9] - strb r0, [r4, 0x2] - ldrh r0, [r4, 0x6] - ldrb r1, [r4, 0x8] - lsls r2, 28 - lsrs r2, 28 - ldrh r3, [r4, 0x4] - bl pal_fade_1 - ldrb r5, [r4, 0xB] - lsls r0, r5, 26 - asrs r0, 30 - cmp r0, 0x1 - beq _08151F16 - cmp r0, 0x1 - bgt _08151EE4 - cmp r0, 0 - beq _08151EEA - b _08151FD0 - .pool -_08151EE4: - cmp r0, 0x2 - beq _08151F92 - b _08151FD0 -_08151EEA: - ldrb r2, [r4, 0x1] - lsls r1, r2, 28 - lsrs r0, r1, 28 - adds r0, 0x1 - mov r3, r9 - ands r0, r3 - mov r6, r8 - adds r3, r6, 0 - ands r3, r2 - orrs r3, r0 - strb r3, [r4, 0x1] - lsrs r1, 28 - lsls r0, r5, 28 - asrs r0, 28 - cmp r1, r0 - bne _08151FD0 - ldrb r0, [r4, 0x3] - adds r0, 0x1 - strb r0, [r4, 0x3] - ands r3, r6 - strb r3, [r4, 0x1] - b _08151FD0 -_08151F16: - ldrb r3, [r4, 0x1] - movs r0, 0x10 - ands r0, r3 - cmp r0, 0 - beq _08151F54 - lsls r0, r3, 28 - lsrs r0, 28 - subs r0, 0x1 - mov r5, r9 - ands r0, r5 - mov r2, r8 - ands r2, r3 - orrs r2, r0 - strb r2, [r4, 0x1] - cmp r0, 0 - bne _08151FD0 - ldrb r0, [r4, 0x3] - adds r0, 0x1 - strb r0, [r4, 0x3] - lsls r0, r2, 27 - lsrs r0, 31 - eors r0, r7 - ands r0, r7 - lsls r0, 4 - movs r3, 0x11 - negs r3, r3 - adds r1, r3, 0 - ands r2, r1 - orrs r2, r0 - strb r2, [r4, 0x1] - b _08151FD0 -_08151F54: - lsls r0, r5, 28 - asrs r0, 28 - subs r0, 0x1 - mov r5, r9 - ands r0, r5 - lsls r2, r3, 28 - lsrs r1, r2, 28 - adds r1, 0x1 - ands r1, r5 - mov r5, r8 - ands r3, r5 - orrs r3, r1 - strb r3, [r4, 0x1] - lsrs r2, 28 - cmp r2, r0 - bne _08151FD0 - ldrb r0, [r4, 0x3] - adds r0, 0x1 - strb r0, [r4, 0x3] - lsls r0, r3, 27 - lsrs r0, 31 - eors r0, r7 - ands r0, r7 - lsls r0, 4 - movs r2, 0x11 - negs r2, r2 - adds r1, r2, 0 - ands r3, r1 - orrs r3, r0 - strb r3, [r4, 0x1] - b _08151FD0 -_08151F92: - ldrb r2, [r4, 0x1] - movs r0, 0x10 - ands r0, r2 - cmp r0, 0 - beq _08151FA2 - mov r0, r8 - ands r0, r2 - b _08151FB0 -_08151FA2: - lsls r1, r5, 28 - asrs r1, 28 - mov r3, r9 - ands r1, r3 - mov r0, r8 - ands r0, r2 - orrs r0, r1 -_08151FB0: - strb r0, [r4, 0x1] - ldrb r2, [r4, 0x1] - lsls r0, r2, 27 - lsrs r0, 31 - eors r0, r7 - ands r0, r7 - lsls r0, 4 - movs r5, 0x11 - negs r5, r5 - adds r1, r5, 0 - ands r2, r1 - orrs r2, r0 - strb r2, [r4, 0x1] - ldrb r0, [r4, 0x3] - adds r0, 0x1 - strb r0, [r4, 0x3] -_08151FD0: - ldrb r1, [r4, 0xA] - cmp r1, 0xFF - beq _08151FE6 - ldrb r0, [r4, 0x3] - cmp r0, r1 - bne _08151FE6 - ldrb r1, [r4] - ldr r0, [sp] - movs r2, 0 - bl sub_8151D28 -_08151FE6: - mov r0, r10 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - cmp r0, 0xF - bhi _08151FF6 - b _08151E78 -_08151FF6: - 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_8151E50 - - thumb_func_start sub_8152008 -sub_8152008: @ 8152008 - push {r4-r7,lr} - adds r6, r0, 0 - ldr r0, [sp, 0x14] - ldr r4, [sp, 0x18] - lsls r1, 16 - lsrs r7, r1, 16 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r4, 24 - movs r1, 0 - lsrs r3, 19 - adds r3, r2 - lsls r3, 1 - adds r6, r3 - cmp r1, r4 - bcs _08152052 -_08152030: - lsls r0, r1, 6 - adds r2, r6, r0 - movs r0, 0 - adds r3, r1, 0x1 - cmp r0, r5 - bcs _0815204A -_0815203C: - strh r7, [r2] - adds r2, 0x2 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, r5 - bcc _0815203C -_0815204A: - lsls r0, r3, 24 - lsrs r1, r0, 24 - cmp r1, r4 - bcc _08152030 -_08152052: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8152008 - - thumb_func_start sub_8152058 -sub_8152058: @ 8152058 - push {r4-r7,lr} - adds r7, r0, 0 - ldr r0, [sp, 0x14] - ldr r4, [sp, 0x18] - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, 24 - lsrs r6, r4, 24 - movs r4, 0 - lsrs r3, 19 - adds r3, r2 - lsls r3, 1 - adds r7, r3 - cmp r4, r6 - bcs _081520A2 -_0815207C: - lsls r0, r4, 6 - adds r2, r7, r0 - movs r3, 0 - adds r4, 0x1 - cmp r3, r5 - bcs _0815209A -_08152088: - ldrh r0, [r1] - strh r0, [r2] - adds r1, 0x2 - adds r2, 0x2 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r5 - bcc _08152088 -_0815209A: - lsls r0, r4, 24 - lsrs r4, r0, 24 - cmp r4, r6 - bcc _0815207C -_081520A2: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8152058 - - thumb_func_start sub_81520A8 -sub_81520A8: @ 81520A8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r10, r0 - ldr r0, [sp, 0x24] - ldr r4, [sp, 0x28] - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp] - lsls r3, 24 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r4, 24 - lsrs r4, 24 - mov r8, r4 - movs r0, 0 - lsrs r4, r3, 24 - cmp r0, r8 - bcs _08152122 -_081520DA: - ldr r2, [sp] - movs r3, 0 - adds r6, r4, 0x1 - adds r0, 0x1 - mov r12, r0 - cmp r3, r7 - bcs _0815210C - lsls r5, r4, 6 -_081520EA: - lsls r0, r2, 1 - adds r0, r5 - add r0, r10 - mov r1, r9 - strh r1, [r0] - adds r1, r2, 0x1 - adds r0, r1, 0 - asrs r0, 5 - lsls r0, 5 - subs r0, r1, r0 - lsls r0, 24 - lsrs r2, r0, 24 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r7 - bcc _081520EA -_0815210C: - adds r0, r6, 0 - asrs r0, 5 - lsls r0, 5 - subs r0, r6, r0 - lsls r0, 24 - lsrs r4, r0, 24 - mov r1, r12 - lsls r0, r1, 24 - lsrs r0, 24 - cmp r0, r8 - bcc _081520DA -_08152122: - 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_81520A8 - - thumb_func_start sub_8152134 -sub_8152134: @ 8152134 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r10, r0 - ldr r0, [sp, 0x24] - ldr r4, [sp, 0x28] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp] - lsls r3, 24 - lsls r0, 24 - lsrs r0, 24 - mov r12, r0 - lsls r4, 24 - lsrs r4, 24 - mov r9, r4 - movs r0, 0 - adds r5, r1, 0 - lsrs r4, r3, 24 - cmp r0, r9 - bcs _081521AE -_08152164: - ldr r2, [sp] - movs r3, 0 - adds r7, r4, 0x1 - adds r0, 0x1 - mov r8, r0 - cmp r3, r12 - bcs _08152198 - lsls r6, r4, 6 -_08152174: - lsls r0, r2, 1 - adds r0, r6 - add r0, r10 - ldrh r1, [r5] - strh r1, [r0] - adds r5, 0x2 - adds r1, r2, 0x1 - adds r0, r1, 0 - asrs r0, 5 - lsls r0, 5 - subs r0, r1, r0 - lsls r0, 24 - lsrs r2, r0, 24 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r12 - bcc _08152174 -_08152198: - adds r0, r7, 0 - asrs r0, 5 - lsls r0, 5 - subs r0, r7, r0 - lsls r0, 24 - lsrs r4, r0, 24 - mov r1, r8 - lsls r0, r1, 24 - lsrs r0, 24 - cmp r0, r9 - bcc _08152164 -_081521AE: - 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_8152134 - - thumb_func_start sub_81521C0 -sub_81521C0: @ 81521C0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r4, r0, 24 - movs r5, 0 - cmp r4, 0 - beq _081521FE - cmp r4, 0x40 - bls _081521D6 - movs r4, 0x40 -_081521D6: - ldr r6, =0x0203abb8 - movs r0, 0x8 - bl AllocZeroed - str r0, [r6] - cmp r0, 0 - beq _081521FE - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 4 - bl AllocZeroed - ldr r1, [r6] - str r0, [r1, 0x4] - cmp r0, 0 - bne _08152208 - adds r0, r1, 0 - bl Free - str r5, [r6] -_081521FE: - movs r0, 0 - b _08152244 - .pool -_08152208: - strb r4, [r1] - cmp r5, r4 - bcs _08152242 - adds r3, r6, 0 - ldr r0, =gDefaultOamAttributes - mov r12, r0 - movs r2, 0x4 - mov r8, r2 -_08152218: - ldr r0, [r3] - ldr r2, [r0, 0x4] - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 4 - adds r2, r1, r2 - mov r0, r12 - ldm r0!, {r6,r7} - stm r2!, {r6,r7} - ldr r0, [r3] - ldr r0, [r0, 0x4] - adds r1, r0 - ldrb r0, [r1, 0x19] - mov r2, r8 - orrs r0, r2 - strb r0, [r1, 0x19] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r4 - bcc _08152218 -_08152242: - movs r0, 0x1 -_08152244: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81521C0 - - thumb_func_start sub_8152254 -sub_8152254: @ 8152254 - push {r4-r7,lr} - movs r3, 0 - ldr r0, =0x0203abb8 - ldr r2, [r0] - adds r5, r0, 0 - cmp r2, 0 - bne _0815226C - movs r0, 0 - b _081522C4 - .pool -_0815226C: - ldrb r2, [r2] - cmp r3, r2 - bcs _08152292 - ldr r0, =0x030024f8 - mov r12, r0 - ldr r4, =gDefaultOamAttributes - adds r2, r5, 0 -_0815227A: - lsls r1, r3, 3 - add r1, r12 - adds r0, r4, 0 - ldm r0!, {r6,r7} - stm r1!, {r6,r7} - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, [r2] - ldrb r0, [r0] - cmp r3, r0 - bcc _0815227A -_08152292: - ldr r1, [r5] - ldrb r0, [r1] - lsls r2, r0, 1 - adds r2, r0 - ldr r0, [r1, 0x4] - lsls r2, 4 - movs r1, 0 - bl memset - ldr r0, [r5] - ldr r0, [r0, 0x4] - bl Free - ldr r0, [r5] - movs r4, 0 - str r4, [r0, 0x4] - movs r1, 0 - movs r2, 0x8 - bl memset - ldr r0, [r5] - bl Free - str r4, [r5] - movs r0, 0x1 -_081522C4: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8152254 - - thumb_func_start sub_81522D4 -sub_81522D4: @ 81522D4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r6, 0 - ldr r0, =0x0203abb8 - ldr r1, [r0] - adds r3, r0, 0 - cmp r1, 0 - beq _081522EC - ldr r0, [r1, 0x4] - cmp r0, 0 - bne _081522F4 -_081522EC: - movs r0, 0 - b _081523D2 - .pool -_081522F4: - ldrb r1, [r1] - cmp r6, r1 - bcs _081523D0 - adds r7, r3, 0 - movs r0, 0x3 - mov r8, r0 -_08152300: - ldr r0, [r7] - ldr r1, [r0, 0x4] - lsls r0, r6, 1 - adds r0, r6 - lsls r5, r0, 4 - adds r2, r5, r1 - ldrb r1, [r2, 0x19] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x3 - bne _081523C2 - ldr r1, [r2, 0x2C] - cmp r1, 0 - beq _08152322 - adds r0, r2, 0 - bl _call_via_r1 -_08152322: - ldr r0, [r7] - ldr r0, [r0, 0x4] - adds r2, r5, r0 - ldrb r1, [r2, 0x19] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08152348 - lsls r0, r6, 3 - ldr r1, =0x030024f8 - adds r0, r1 - ldr r1, =gDefaultOamAttributes - ldm r1!, {r2,r3} - stm r0!, {r2,r3} - b _081523C0 - .pool -_08152348: - ldrb r0, [r2, 0xE] - ldrb r4, [r2, 0xA] - adds r0, r4 - strb r0, [r2] - ldr r4, [r7] - ldr r3, [r4, 0x4] - adds r3, r5, r3 - movs r0, 0x8 - ldrsh r2, [r3, r0] - movs r1, 0xC - ldrsh r0, [r3, r1] - adds r2, r0 - ldr r1, =0x000001ff - adds r0, r1, 0 - ands r2, r0 - ldrh r0, [r3, 0x2] - ldr r1, =0xfffffe00 - mov r12, r1 - mov r1, r12 - ands r0, r1 - orrs r0, r2 - strh r0, [r3, 0x2] - ldr r3, [r4, 0x4] - adds r3, r5, r3 - ldrb r0, [r3, 0x19] - lsls r0, 27 - lsrs r0, 30 - mov r2, r8 - ands r0, r2 - lsls r0, 2 - ldrb r1, [r3, 0x5] - movs r4, 0xD - negs r4, r4 - adds r2, r4, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x5] - ldr r4, [r7] - ldr r2, [r4, 0x4] - adds r2, r5, r2 - ldrh r3, [r2, 0x14] - ldr r1, =0x000003ff - adds r0, r1, 0 - adds r1, r3, 0 - ands r1, r0 - mov r12, r1 - ldrh r0, [r2, 0x4] - ldr r3, =0xfffffc00 - adds r1, r3, 0 - ands r0, r1 - mov r1, r12 - orrs r0, r1 - strh r0, [r2, 0x4] - lsls r1, r6, 3 - ldr r2, =0x030024f8 - ldr r0, [r4, 0x4] - adds r1, r2 - adds r0, r5, r0 - ldm r0!, {r2,r3} - stm r1!, {r2,r3} -_081523C0: - ldr r3, =0x0203abb8 -_081523C2: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, [r3] - ldrb r0, [r0] - cmp r6, r0 - bcc _08152300 -_081523D0: - movs r0, 0x1 -_081523D2: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81522D4 - - thumb_func_start sub_81523F4 -sub_81523F4: @ 81523F4 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r6, r1, 24 - cmp r4, 0 - beq _08152430 - ldrh r0, [r4, 0x10] - bl GetObjectTileRangeStartByTag - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x0000ffff - cmp r5, r0 - beq _08152430 - strb r6, [r4, 0x18] - ldrb r0, [r4, 0x1] - lsrs r0, 6 - ldrb r1, [r4, 0x3] - lsrs r1, 6 - bl sub_80355F8 - lsls r0, 24 - lsrs r0, 24 - muls r0, r6 - adds r0, r5, r0 - strh r0, [r4, 0x14] - movs r0, 0x1 - b _08152432 - .pool -_08152430: - movs r0, 0 -_08152432: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81523F4 - - thumb_func_start sub_8152438 -sub_8152438: @ 8152438 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x0203abb8 - ldr r0, [r0] - cmp r0, 0 - beq _0815246C - ldrb r1, [r0] - cmp r2, r1 - bcs _0815246C - ldr r1, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 4 - adds r3, r0, r1 - ldrb r1, [r3, 0x19] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815246C - str r4, [r3, 0x2C] - adds r0, r2, 0 - b _0815246E - .pool -_0815246C: - movs r0, 0xFF -_0815246E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8152438 - - thumb_func_start sub_8152474 -sub_8152474: @ 8152474 - push {r4,r5,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - lsls r2, 16 - lsrs r5, r2, 16 - ldr r0, =0x0203abb8 - ldr r0, [r0] - cmp r0, 0 - beq _081524A8 - ldrb r1, [r0] - cmp r3, r1 - bcs _081524A8 - ldr r1, [r0, 0x4] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 4 - adds r2, r0, r1 - ldrb r1, [r2, 0x19] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081524A8 - cmp r4, 0x7 - bls _081524B0 -_081524A8: - movs r0, 0xFF - b _081524BC - .pool -_081524B0: - lsls r1, r4, 1 - adds r0, r2, 0 - adds r0, 0x1A - adds r0, r1 - strh r5, [r0] - adds r0, r3, 0 -_081524BC: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8152474 - - thumb_func_start sub_81524C4 -sub_81524C4: @ 81524C4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - mov r9, r0 - ldr r0, [sp, 0x30] - ldr r4, [sp, 0x34] - ldr r5, [sp, 0x38] - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - lsls r2, 16 - lsrs r2, 16 - mov r8, r2 - lsls r3, 16 - lsrs r3, 16 - str r3, [sp, 0x4] - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x8] - lsls r4, 24 - lsrs r4, 24 - str r4, [sp, 0xC] - lsls r5, 24 - lsrs r5, 24 - mov r10, r5 - movs r5, 0 - ldr r0, =0x0203abb8 - ldr r0, [r0] - cmp r0, 0 - beq _0815255E - mov r1, r9 - cmp r1, 0 - bne _08152530 - b _0815255E - .pool -_08152514: - adds r5, r2, 0 - adds r0, r5, 0 - movs r1, 0 - movs r2, 0x30 - bl memset - strb r4, [r5, 0x16] - ldrb r0, [r5, 0x19] - movs r1, 0x1 - orrs r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r5, 0x19] - b _0815255A -_08152530: - movs r4, 0 - ldrb r1, [r0] - cmp r5, r1 - bcs _0815255A - ldr r6, [r0, 0x4] - adds r3, r1, 0 - movs r7, 0x1 -_0815253E: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 4 - adds r2, r0, r6 - ldrb r1, [r2, 0x19] - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _08152514 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r3 - bcc _0815253E -_0815255A: - cmp r5, 0 - bne _08152562 -_0815255E: - movs r0, 0xFF - b _081525C0 -_08152562: - adds r1, r5, 0 - mov r0, r9 - ldm r0!, {r2,r3} - stm r1!, {r2,r3} - mov r0, sp - ldrh r0, [r0] - strh r0, [r5, 0x10] - mov r1, r8 - strh r1, [r5, 0x12] - mov r2, sp - ldrh r2, [r2, 0x4] - strh r2, [r5, 0x8] - mov r3, sp - ldrh r3, [r3, 0x8] - strh r3, [r5, 0xA] - mov r0, r8 - bl IndexOfObjectPaletteTag - lsls r0, 4 - ldrb r1, [r5, 0x5] - movs r4, 0xF - ands r4, r1 - orrs r4, r0 - strb r4, [r5, 0x5] - mov r0, r10 - cmp r0, 0x3 - bhi _081525B6 - movs r1, 0x3 - ands r1, r0 - lsls r3, r1, 3 - ldrb r2, [r5, 0x19] - movs r0, 0x19 - negs r0, r0 - ands r0, r2 - orrs r0, r3 - strb r0, [r5, 0x19] - lsls r1, 2 - movs r0, 0xD - negs r0, r0 - ands r4, r0 - orrs r4, r1 - strb r4, [r5, 0x5] -_081525B6: - adds r0, r5, 0 - ldr r1, [sp, 0xC] - bl sub_81523F4 - ldrb r0, [r5, 0x16] -_081525C0: - 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_81524C4 - - thumb_func_start sub_81525D0 -sub_81525D0: @ 81525D0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r6, =0x0203abb8 - ldr r0, [r6] - cmp r0, 0 - beq _081525F2 - ldr r1, [r0, 0x4] - lsls r0, r5, 1 - adds r0, r5 - lsls r4, r0, 4 - adds r2, r4, r1 - ldrb r1, [r2, 0x19] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081525FC -_081525F2: - movs r0, 0xFF - b _0815263C - .pool -_081525FC: - adds r0, r2, 0 - movs r1, 0 - movs r2, 0x30 - bl memset - ldr r0, [r6] - ldr r0, [r0, 0x4] - adds r0, r4, r0 - movs r1, 0xA0 - strb r1, [r0] - ldr r3, [r6] - ldr r2, [r3, 0x4] - adds r2, r4, r2 - ldrh r1, [r2, 0x2] - ldr r0, =0xfffffe00 - ands r0, r1 - movs r1, 0xF0 - orrs r0, r1 - strh r0, [r2, 0x2] - ldr r1, [r3, 0x4] - adds r1, r4, r1 - ldrb r0, [r1, 0x19] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1, 0x19] - lsls r1, r5, 3 - ldr r0, =0x030024f8 - adds r1, r0 - ldr r0, =gDefaultOamAttributes - ldm r0!, {r2,r3} - stm r1!, {r2,r3} - adds r0, r5, 0 -_0815263C: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81525D0 - - thumb_func_start calls_flash_erase_block -calls_flash_erase_block: @ 8152650 - push {r4,r5,lr} - movs r4, 0 - ldr r5, =0x03007860 -_08152656: - ldr r1, [r5] - adds r0, r4, 0 - bl _call_via_r1 - adds r0, r4, 0 - adds r0, 0x10 - lsls r0, 16 - lsrs r0, 16 - ldr r1, [r5] - bl _call_via_r1 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0xF - bls _08152656 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end calls_flash_erase_block - - thumb_func_start sub_8152680 -sub_8152680: @ 8152680 - ldr r0, =0x03006200 - movs r1, 0 - str r1, [r0] - ldr r0, =0x030061f0 - strh r1, [r0] - ldr r0, =0x030061fc - str r1, [r0] - bx lr - .pool - thumb_func_end sub_8152680 - - thumb_func_start sub_815269C -sub_815269C: @ 815269C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r3, r1, 24 - movs r4, 0 - cmp r0, 0x1 - beq _081526D0 - cmp r0, 0x1 - bgt _081526B6 - cmp r0, 0 - beq _081526BC - b _081526F4 -_081526B6: - cmp r0, 0x2 - beq _081526E4 - b _081526F4 -_081526BC: - ldr r2, =0x030061fc - movs r1, 0x1 - lsls r1, r3 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - b _081526F4 - .pool -_081526D0: - ldr r2, =0x030061fc - adds r1, r0, 0 - lsls r1, r3 - ldr r0, [r2] - bics r0, r1 - str r0, [r2] - b _081526F4 - .pool -_081526E4: - ldr r0, =0x030061fc - movs r1, 0x1 - lsls r1, r3 - ldr r0, [r0] - ands r0, r1 - cmp r0, 0 - beq _081526F4 - movs r4, 0x1 -_081526F4: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_815269C - - thumb_func_start save_write_to_flash -save_write_to_flash: @ 8152700 - push {r4-r7,lr} - adds r7, r1, 0 - lsls r0, 16 - lsrs r2, r0, 16 - ldr r1, =0x03006204 - ldr r0, =0x0203abbc - str r0, [r1] - ldr r0, =0x0000ffff - cmp r2, r0 - beq _08152730 - adds r0, r2, 0 - adds r1, r7, 0 - bl sub_81527A0 - lsls r0, 24 - lsrs r5, r0, 24 - b _08152782 - .pool -_08152730: - ldr r1, =0x030061f8 - ldr r5, =0x030061f0 - ldrh r0, [r5] - strh r0, [r1] - ldr r1, =0x030061f4 - ldr r6, =0x03006200 - ldr r4, [r6] - str r4, [r1] - adds r0, 0x1 - strh r0, [r5] - ldrh r0, [r5] - movs r1, 0xE - bl __umodsi3 - strh r0, [r5] - adds r4, 0x1 - str r4, [r6] - movs r5, 0x1 - movs r4, 0 -_08152756: - adds r0, r4, 0 - adds r1, r7, 0 - bl sub_81527A0 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0xD - bls _08152756 - ldr r0, =0x030061fc - ldr r0, [r0] - cmp r0, 0 - beq _08152782 - movs r5, 0xFF - ldr r1, =0x030061f0 - ldr r0, =0x030061f8 - ldrh r0, [r0] - strh r0, [r1] - ldr r1, =0x03006200 - ldr r0, =0x030061f4 - ldr r0, [r0] - str r0, [r1] -_08152782: - adds r0, r5, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end save_write_to_flash - - thumb_func_start sub_81527A0 -sub_81527A0: @ 81527A0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r4, r1, 0 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =0x030061f0 - ldrh r0, [r0] - adds r0, r6, r0 - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r5, 0 - movs r1, 0xE - bl __umodsi3 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r2, =0x03006200 - ldr r1, [r2] - movs r0, 0x1 - ands r1, r0 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 1 - adds r0, r5, r0 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r0, r6, 3 - adds r0, r4 - ldr r1, [r0] - mov r10, r1 - ldrh r4, [r0, 0x4] - movs r3, 0 - mov r9, r2 - ldr r2, =0x03006204 - mov r12, r2 - mov r8, r12 - movs r2, 0 - ldr r1, =0x00000fff -_081527F2: - mov r7, r8 - ldr r0, [r7] - adds r0, r3 - strb r2, [r0] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r1 - bls _081527F2 - mov r0, r12 - ldr r1, [r0] - ldr r2, =0x00000ff4 - adds r0, r1, r2 - strh r6, [r0] - ldr r3, =0x00000ff8 - adds r2, r1, r3 - ldr r0, =0x08012025 - str r0, [r2] - ldr r6, =0x00000ffc - adds r1, r6 - mov r7, r9 - ldr r0, [r7] - str r0, [r1] - movs r3, 0 - lsls r5, 24 - cmp r3, r4 - bcs _08152840 - mov r2, r12 -_0815282A: - ldr r1, [r2] - adds r1, r3 - mov r6, r10 - adds r0, r6, r3 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r4 - bcc _0815282A -_08152840: - mov r0, r10 - adds r1, r4, 0 - bl sub_8153164 - ldr r1, =0x03006204 - ldr r1, [r1] - ldr r7, =0x00000ff6 - adds r2, r1, r7 - strh r0, [r2] - lsrs r0, r5, 24 - bl sub_8152908 - lsls r0, 24 - lsrs r0, 24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81527A0 - - thumb_func_start sub_8152890 -sub_8152890: @ 8152890 - push {r4-r7,lr} - adds r5, r1, 0 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r2, 16 - lsrs r2, 16 - ldr r4, =0x0203abbc - movs r3, 0 - movs r6, 0 - ldr r1, =0x00000fff -_081528A4: - adds r0, r4, r3 - strb r6, [r0] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r1 - bls _081528A4 - ldr r0, =0x00000ff8 - adds r1, r4, r0 - ldr r0, =0x08012025 - str r0, [r1] - movs r3, 0 - cmp r3, r2 - bcs _081528D2 -_081528C0: - adds r1, r4, r3 - adds r0, r5, r3 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r2 - bcc _081528C0 -_081528D2: - adds r0, r5, 0 - adds r1, r2, 0 - bl sub_8153164 - ldr r2, =0x00000ff4 - adds r1, r4, r2 - strh r0, [r1] - adds r0, r7, 0 - adds r1, r4, 0 - bl sub_8152908 - lsls r0, 24 - lsrs r0, 24 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8152890 - - thumb_func_start sub_8152908 -sub_8152908: @ 8152908 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl ProgramFlashSectorsAndVerify - cmp r0, 0 - bne _08152924 - movs r0, 0x1 - adds r1, r4, 0 - bl sub_815269C - movs r0, 0x1 - b _0815292E -_08152924: - movs r0, 0 - adds r1, r4, 0 - bl sub_815269C - movs r0, 0xFF -_0815292E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8152908 - - thumb_func_start sub_8152934 -sub_8152934: @ 8152934 - push {r4-r6,lr} - ldr r1, =0x03006204 - ldr r0, =0x0203abbc - str r0, [r1] - ldr r1, =0x030061f8 - ldr r5, =0x030061f0 - ldrh r0, [r5] - strh r0, [r1] - ldr r1, =0x030061f4 - ldr r6, =0x03006200 - ldr r4, [r6] - str r4, [r1] - adds r0, 0x1 - strh r0, [r5] - ldrh r0, [r5] - movs r1, 0xE - bl __umodsi3 - strh r0, [r5] - adds r4, 0x1 - str r4, [r6] - ldr r1, =0x03006208 - movs r0, 0 - strh r0, [r1] - ldr r1, =0x030061fc - movs r0, 0 - str r0, [r1] - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8152934 - - thumb_func_start sub_8152990 -sub_8152990: @ 8152990 - ldr r1, =0x03006204 - ldr r0, =0x0203abbc - str r0, [r1] - ldr r1, =0x030061f8 - ldr r0, =0x030061f0 - ldrh r0, [r0] - strh r0, [r1] - ldr r1, =0x030061f4 - ldr r0, =0x03006200 - ldr r0, [r0] - str r0, [r1] - ldr r1, =0x03006208 - movs r0, 0 - strh r0, [r1] - ldr r1, =0x030061fc - movs r0, 0 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8152990 - - thumb_func_start sub_81529D4 -sub_81529D4: @ 81529D4 - push {r4,r5,lr} - lsls r0, 16 - lsrs r0, 16 - ldr r4, =0x03006208 - ldrh r2, [r4] - subs r0, 0x1 - cmp r2, r0 - bge _08152A28 - movs r5, 0x1 - adds r0, r2, 0 - bl sub_81527A0 - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - ldr r0, =0x030061fc - ldr r0, [r0] - cmp r0, 0 - beq _08152A2A - movs r5, 0xFF - ldr r1, =0x030061f0 - ldr r0, =0x030061f8 - ldrh r0, [r0] - strh r0, [r1] - ldr r1, =0x03006200 - ldr r0, =0x030061f4 - ldr r0, [r0] - str r0, [r1] - b _08152A2A - .pool -_08152A28: - movs r5, 0xFF -_08152A2A: - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81529D4 - - thumb_func_start sub_8152A34 -sub_8152A34: @ 8152A34 - push {r4,lr} - lsls r0, 16 - movs r4, 0x1 - ldr r2, =0xffff0000 - adds r0, r2 - lsrs r0, 16 - bl calls_flash_erase_block_2 - ldr r0, =0x030061fc - ldr r0, [r0] - cmp r0, 0 - beq _08152A5E - movs r4, 0xFF - ldr r1, =0x030061f0 - ldr r0, =0x030061f8 - ldrh r0, [r0] - strh r0, [r1] - ldr r1, =0x03006200 - ldr r0, =0x030061f4 - ldr r0, [r0] - str r0, [r1] -_08152A5E: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8152A34 - - thumb_func_start calls_flash_erase_block_2 -calls_flash_erase_block_2: @ 8152A80 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r4, r1, 0 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =0x030061f0 - ldrh r0, [r0] - adds r0, r6, r0 - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r5, 0 - movs r1, 0xE - bl __umodsi3 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r2, =0x03006200 - ldr r1, [r2] - movs r0, 0x1 - ands r1, r0 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 1 - adds r0, r5, r0 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r0, r6, 3 - adds r0, r4 - ldr r1, [r0] - mov r10, r1 - ldrh r3, [r0, 0x4] - movs r4, 0 - mov r9, r2 - ldr r2, =0x03006204 - mov r12, r2 - mov r8, r12 - movs r2, 0 - ldr r1, =0x00000fff -_08152AD2: - mov r7, r8 - ldr r0, [r7] - adds r0, r4 - strb r2, [r0] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r1 - bls _08152AD2 - mov r0, r12 - ldr r1, [r0] - ldr r2, =0x00000ff4 - adds r0, r1, r2 - strh r6, [r0] - ldr r6, =0x00000ff8 - adds r2, r1, r6 - ldr r0, =0x08012025 - str r0, [r2] - ldr r7, =0x00000ffc - adds r1, r7 - mov r2, r9 - ldr r0, [r2] - str r0, [r1] - movs r4, 0 - lsls r6, r5, 24 - mov r8, r6 - cmp r4, r3 - bcs _08152B22 - mov r2, r12 -_08152B0C: - ldr r1, [r2] - adds r1, r4 - mov r7, r10 - adds r0, r7, r4 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r3 - bcc _08152B0C -_08152B22: - mov r0, r10 - adds r1, r3, 0 - bl sub_8153164 - ldr r1, =0x03006204 - ldr r1, [r1] - ldr r2, =0x00000ff6 - adds r1, r2 - strh r0, [r1] - ldr r0, =0x03007860 - ldr r1, [r0] - adds r0, r5, 0 - bl _call_via_r1 - movs r6, 0x1 - movs r4, 0 - ldr r7, =0x00000ff7 - mov r9, r7 - ldr r7, =0x03007854 - b _08152B82 - .pool -_08152B7C: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_08152B82: - cmp r4, r9 - bhi _08152BA0 - ldr r0, =0x03006204 - ldr r0, [r0] - adds r0, r4 - ldrb r2, [r0] - ldr r3, [r7] - adds r0, r5, 0 - adds r1, r4, 0 - bl _call_via_r3 - lsls r0, 16 - cmp r0, 0 - beq _08152B7C - movs r6, 0xFF -_08152BA0: - cmp r6, 0xFF - bne _08152BB0 - mov r0, r8 - lsrs r1, r0, 24 - b _08152C08 - .pool -_08152BB0: - movs r6, 0x1 - movs r4, 0 - ldr r1, =0x03007854 - mov r9, r1 - ldr r7, =0x00000ff9 - b _08152BCA - .pool -_08152BC4: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_08152BCA: - cmp r4, 0x6 - bhi _08152BEC - adds r1, r4, r7 - ldr r0, =0x03006204 - ldr r0, [r0] - adds r0, r4, r0 - adds r0, r7 - ldrb r2, [r0] - mov r0, r9 - ldr r3, [r0] - adds r0, r5, 0 - bl _call_via_r3 - lsls r0, 16 - cmp r0, 0 - beq _08152BC4 - movs r6, 0xFF -_08152BEC: - cmp r6, 0xFF - beq _08152C04 - mov r2, r8 - lsrs r1, r2, 24 - movs r0, 0x1 - bl sub_815269C - movs r0, 0x1 - b _08152C10 - .pool -_08152C04: - mov r6, r8 - lsrs r1, r6, 24 -_08152C08: - movs r0, 0 - bl sub_815269C - movs r0, 0xFF -_08152C10: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end calls_flash_erase_block_2 - - thumb_func_start sav12_xor_get -sav12_xor_get: @ 8152C20 - push {r4-r6,lr} - lsls r0, 16 - ldr r6, =0x030061f0 - lsrs r0, 16 - ldrh r1, [r6] - adds r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - movs r1, 0xE - bl __umodsi3 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r5, =0x03006200 - ldr r1, [r5] - movs r0, 0x1 - ands r1, r0 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 1 - adds r0, r4, r0 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x03007854 - ldr r1, =0x00000ff8 - ldr r3, [r0] - adds r0, r4, 0 - movs r2, 0x25 - bl _call_via_r3 - lsls r0, 16 - cmp r0, 0 - bne _08152C84 - lsls r1, r4, 24 - lsrs r1, 24 - movs r0, 0x1 - bl sub_815269C - movs r0, 0x1 - b _08152C9C - .pool -_08152C84: - lsls r1, r4, 24 - lsrs r1, 24 - movs r0, 0 - bl sub_815269C - ldr r0, =0x030061f8 - ldrh r0, [r0] - strh r0, [r6] - ldr r0, =0x030061f4 - ldr r0, [r0] - str r0, [r5] - movs r0, 0xFF -_08152C9C: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sav12_xor_get - - thumb_func_start sub_8152CAC -sub_8152CAC: @ 8152CAC - push {r4-r6,lr} - lsls r0, 16 - ldr r6, =0x030061f0 - lsrs r0, 16 - ldrh r1, [r6] - adds r0, r1 - subs r0, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - movs r1, 0xE - bl __umodsi3 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r5, =0x03006200 - ldr r1, [r5] - movs r0, 0x1 - ands r1, r0 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 1 - adds r0, r4, r0 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r3, =0x03007854 - ldr r1, =0x00000ff8 - ldr r0, =0x03006204 - ldr r0, [r0] - adds r0, r1 - ldrb r2, [r0] - ldr r3, [r3] - adds r0, r4, 0 - bl _call_via_r3 - lsls r0, 16 - cmp r0, 0 - bne _08152D1C - lsls r1, r4, 24 - lsrs r1, 24 - movs r0, 0x1 - bl sub_815269C - movs r0, 0x1 - b _08152D34 - .pool -_08152D1C: - lsls r1, r4, 24 - lsrs r1, 24 - movs r0, 0 - bl sub_815269C - ldr r0, =0x030061f8 - ldrh r0, [r0] - strh r0, [r6] - ldr r0, =0x030061f4 - ldr r0, [r0] - str r0, [r5] - movs r0, 0xFF -_08152D34: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8152CAC - - thumb_func_start sub_8152D44 -sub_8152D44: @ 8152D44 - push {r4-r6,lr} - lsls r0, 16 - ldr r6, =0x030061f0 - lsrs r0, 16 - ldrh r1, [r6] - adds r0, r1 - subs r0, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - movs r1, 0xE - bl __umodsi3 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r5, =0x03006200 - ldr r1, [r5] - movs r0, 0x1 - ands r1, r0 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 1 - adds r0, r4, r0 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x03007854 - ldr r1, =0x00000ff8 - ldr r3, [r0] - adds r0, r4, 0 - movs r2, 0x25 - bl _call_via_r3 - lsls r0, 16 - cmp r0, 0 - bne _08152DA8 - lsls r1, r4, 24 - lsrs r1, 24 - movs r0, 0x1 - bl sub_815269C - movs r0, 0x1 - b _08152DC0 - .pool -_08152DA8: - lsls r1, r4, 24 - lsrs r1, 24 - movs r0, 0 - bl sub_815269C - ldr r0, =0x030061f8 - ldrh r0, [r0] - strh r0, [r6] - ldr r0, =0x030061f4 - ldr r0, [r0] - str r0, [r5] - movs r0, 0xFF -_08152DC0: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8152D44 - - thumb_func_start sub_8152DD0 -sub_8152DD0: @ 8152DD0 - push {r4-r6,lr} - adds r6, r1, 0 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r1, =0x03006204 - ldr r0, =0x0203abbc - str r0, [r1] - ldr r0, =0x0000ffff - cmp r4, r0 - beq _08152DF4 - movs r5, 0xFF - b _08152E06 - .pool -_08152DF4: - adds r0, r6, 0 - bl sub_8152EC8 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - adds r1, r6, 0 - bl sub_8152E10 -_08152E06: - adds r0, r5, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8152DD0 - - thumb_func_start sub_8152E10 -sub_8152E10: @ 8152E10 - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r1 - ldr r0, =0x03006200 - ldr r1, [r0] - movs r0, 0x1 - ands r1, r0 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 17 - lsrs r7, r0, 16 - movs r5, 0 - ldr r6, =0x03006204 -_08152E2C: - adds r0, r5, r7 - lsls r0, 24 - lsrs r0, 24 - ldr r1, [r6] - bl sub_815314C - ldr r0, [r6] - ldr r1, =0x00000ff4 - adds r0, r1 - ldrh r1, [r0] - cmp r1, 0 - bne _08152E48 - ldr r0, =0x030061f0 - strh r5, [r0] -_08152E48: - ldr r0, [r6] - lsls r1, 3 - mov r2, r8 - adds r4, r1, r2 - ldrh r1, [r4, 0x4] - bl sub_8153164 - lsls r0, 16 - lsrs r3, r0, 16 - ldr r2, [r6] - ldr r1, =0x00000ff8 - adds r0, r2, r1 - ldr r1, [r0] - ldr r0, =0x08012025 - adds r5, 0x1 - cmp r1, r0 - bne _08152E98 - ldr r1, =0x00000ff6 - adds r0, r2, r1 - ldrh r0, [r0] - cmp r0, r3 - bne _08152E98 - movs r2, 0 - ldrh r0, [r4, 0x4] - cmp r2, r0 - bcs _08152E98 - adds r3, r4, 0 - ldr r4, =0x03006204 -_08152E80: - ldr r1, [r3] - adds r1, r2 - ldr r0, [r4] - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - ldrh r1, [r3, 0x4] - cmp r2, r1 - bcc _08152E80 -_08152E98: - lsls r0, r5, 16 - lsrs r5, r0, 16 - cmp r5, 0xD - bls _08152E2C - movs r0, 0x1 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8152E10 - - thumb_func_start sub_8152EC8 -sub_8152EC8: @ 8152EC8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r10, r0 - movs r0, 0 - mov r8, r0 - mov r9, r0 - movs r6, 0 - movs r5, 0 - movs r4, 0 - ldr r7, =0x03006204 -_08152EE4: - lsls r0, r4, 24 - lsrs r0, 24 - ldr r1, [r7] - bl sub_815314C - ldr r2, [r7] - ldr r1, =0x00000ff8 - adds r0, r2, r1 - ldr r1, [r0] - ldr r0, =0x08012025 - cmp r1, r0 - bne _08152F34 - movs r5, 0x1 - ldr r3, =0x00000ff4 - adds r0, r2, r3 - ldrh r0, [r0] - lsls r0, 3 - add r0, r10 - ldrh r1, [r0, 0x4] - adds r0, r2, 0 - bl sub_8153164 - lsls r0, 16 - lsrs r2, r0, 16 - ldr r1, [r7] - ldr r3, =0x00000ff6 - adds r0, r1, r3 - ldrh r0, [r0] - cmp r0, r2 - bne _08152F34 - ldr r2, =0x00000ffc - adds r0, r1, r2 - ldr r0, [r0] - mov r8, r0 - subs r3, 0x2 - adds r1, r3 - adds r0, r5, 0 - ldrh r1, [r1] - lsls r0, r1 - orrs r6, r0 -_08152F34: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0xD - bls _08152EE4 - cmp r5, 0 - beq _08152F70 - ldr r0, =0x00003fff - movs r1, 0xFF - str r1, [sp] - cmp r6, r0 - bne _08152F74 - movs r2, 0x1 - str r2, [sp] - b _08152F74 - .pool -_08152F70: - movs r3, 0 - str r3, [sp] -_08152F74: - movs r6, 0 - movs r5, 0 - movs r4, 0 - ldr r7, =0x03006204 -_08152F7C: - adds r0, r4, 0 - adds r0, 0xE - lsls r0, 24 - lsrs r0, 24 - ldr r1, [r7] - bl sub_815314C - ldr r2, [r7] - ldr r1, =0x00000ff8 - adds r0, r2, r1 - ldr r1, [r0] - ldr r0, =0x08012025 - cmp r1, r0 - bne _08152FD0 - movs r5, 0x1 - ldr r3, =0x00000ff4 - adds r0, r2, r3 - ldrh r0, [r0] - lsls r0, 3 - add r0, r10 - ldrh r1, [r0, 0x4] - adds r0, r2, 0 - bl sub_8153164 - lsls r0, 16 - lsrs r2, r0, 16 - ldr r1, [r7] - ldr r3, =0x00000ff6 - adds r0, r1, r3 - ldrh r0, [r0] - cmp r0, r2 - bne _08152FD0 - ldr r2, =0x00000ffc - adds r0, r1, r2 - ldr r0, [r0] - mov r9, r0 - subs r3, 0x2 - adds r1, r3 - adds r0, r5, 0 - ldrh r1, [r1] - lsls r0, r1 - orrs r6, r0 -_08152FD0: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0xD - bls _08152F7C - cmp r5, 0 - beq _08153008 - ldr r0, =0x00003fff - movs r1, 0xFF - cmp r6, r0 - bne _0815300A - movs r1, 0x1 - b _0815300A - .pool -_08153008: - movs r1, 0 -_0815300A: - ldr r0, [sp] - cmp r0, 0x1 - bne _0815307C - cmp r1, 0x1 - bne _0815306C - movs r0, 0x1 - negs r0, r0 - cmp r8, r0 - bne _08153022 - mov r1, r9 - cmp r1, 0 - beq _0815302C -_08153022: - mov r2, r8 - cmp r2, 0 - bne _08153050 - cmp r9, r0 - bne _08153050 -_0815302C: - mov r1, r8 - adds r1, 0x1 - mov r0, r9 - adds r0, 0x1 - cmp r1, r0 - bcs _08153044 - ldr r0, =0x03006200 - mov r3, r9 - b _08153064 - .pool -_08153044: - ldr r0, =0x03006200 - mov r1, r8 - str r1, [r0] - b _08153094 - .pool -_08153050: - cmp r8, r9 - bcs _08153060 - ldr r0, =0x03006200 - mov r2, r9 - str r2, [r0] - b _08153094 - .pool -_08153060: - ldr r0, =0x03006200 - mov r3, r8 -_08153064: - str r3, [r0] - b _08153094 - .pool -_0815306C: - ldr r0, =0x03006200 - mov r2, r8 - str r2, [r0] - cmp r1, 0xFF - beq _0815308C - b _08153094 - .pool -_0815307C: - cmp r1, 0x1 - bne _08153098 - ldr r0, =0x03006200 - mov r3, r9 - str r3, [r0] - ldr r0, [sp] - cmp r0, 0xFF - bne _08153094 -_0815308C: - movs r0, 0xFF - b _081530C4 - .pool -_08153094: - movs r0, 0x1 - b _081530C4 -_08153098: - ldr r2, [sp] - cmp r2, 0 - bne _081530B8 - cmp r1, 0 - bne _081530B8 - ldr r0, =0x03006200 - str r1, [r0] - ldr r0, =0x030061f0 - strh r1, [r0] - movs r0, 0 - b _081530C4 - .pool -_081530B8: - ldr r0, =0x03006200 - movs r1, 0 - str r1, [r0] - ldr r0, =0x030061f0 - strh r1, [r0] - movs r0, 0x2 -_081530C4: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8152EC8 - - thumb_func_start sub_81530DC -sub_81530DC: @ 81530DC - push {r4-r6,lr} - adds r6, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r2, 16 - lsrs r4, r2, 16 - ldr r5, =0x0203abbc - adds r1, r5, 0 - bl sub_815314C - ldr r1, =0x00000ff8 - adds r0, r5, r1 - ldr r1, [r0] - ldr r0, =0x08012025 - cmp r1, r0 - bne _08153144 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8153164 - lsls r0, 16 - lsrs r0, 16 - ldr r2, =0x00000ff4 - adds r1, r5, r2 - ldrh r1, [r1] - cmp r1, r0 - bne _08153140 - movs r2, 0 - cmp r2, r4 - bcs _0815312A -_08153118: - adds r1, r6, r2 - adds r0, r5, r2 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, r4 - bcc _08153118 -_0815312A: - movs r0, 0x1 - b _08153146 - .pool -_08153140: - movs r0, 0x2 - b _08153146 -_08153144: - movs r0, 0 -_08153146: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81530DC - - thumb_func_start sub_815314C -sub_815314C: @ 815314C - push {lr} - adds r2, r1, 0 - lsls r0, 24 - lsrs r0, 24 - movs r3, 0x80 - lsls r3, 5 - movs r1, 0 - bl ReadFlash - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end sub_815314C - - thumb_func_start sub_8153164 -sub_8153164: @ 8153164 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 16 - movs r2, 0 - movs r3, 0 - lsrs r1, 18 - cmp r2, r1 - bcs _08153182 -_08153174: - ldm r4!, {r0} - adds r2, r0 - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r1 - bcc _08153174 -_08153182: - lsrs r0, r2, 16 - adds r0, r2 - lsls r0, 16 - lsrs r0, 16 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8153164 - - thumb_func_start sub_8153190 -sub_8153190: @ 8153190 - push {r4,r5,lr} - ldr r3, =0x03006220 - ldr r0, =0x03005d90 - ldr r2, =gUnknown_085CDC00 - ldrh r1, [r2] - ldr r0, [r0] - adds r0, r1 - str r0, [r3] - ldrh r0, [r2, 0x2] - strh r0, [r3, 0x4] - ldr r5, =0x03005d8c - adds r3, 0x8 - adds r2, 0x4 - movs r4, 0x3 -_081531AC: - ldrh r0, [r2] - ldr r1, [r5] - adds r1, r0 - str r1, [r3] - ldrh r0, [r2, 0x2] - strh r0, [r3, 0x4] - adds r3, 0x8 - adds r2, 0x4 - subs r4, 0x1 - cmp r4, 0 - bge _081531AC - movs r4, 0x5 - ldr r1, =0x03006220 - ldr r5, =0x03005d94 - ldr r0, =gUnknown_085CDC00 - adds r3, r1, 0 - adds r3, 0x28 - adds r2, r0, 0 - adds r2, 0x14 -_081531D2: - ldrh r0, [r2] - ldr r1, [r5] - adds r1, r0 - str r1, [r3] - ldrh r0, [r2, 0x2] - strh r0, [r3, 0x4] - adds r3, 0x8 - adds r2, 0x4 - adds r4, 0x1 - cmp r4, 0xD - ble _081531D2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8153190 - - thumb_func_start calls_flash_erase_block_3 -calls_flash_erase_block_3: @ 8153204 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x0203cf5c - ldr r6, [r1] - movs r0, 0 - str r0, [r1] - bl sub_8153190 - cmp r4, 0x5 - bhi _081532AC - lsls r0, r4, 2 - ldr r1, =_0815322C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815322C: - .4byte _081532AC - .4byte _081532C4 - .4byte _081532C4 - .4byte _0815325A - .4byte _081532F8 - .4byte _08153244 -_08153244: - movs r4, 0x1C - ldr r5, =0x03007860 -_08153248: - ldr r1, [r5] - adds r0, r4, 0 - bl _call_via_r1 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1F - bls _08153248 -_0815325A: - movs r0, 0xA - bl sub_80847F8 - ldr r1, =0x000003e6 - cmp r0, r1 - bhi _0815326C - movs r0, 0xA - bl sav12_xor_increment -_0815326C: - bl save_serialize_game - ldr r0, =0x0000ffff - ldr r1, =0x03006220 - bl save_write_to_flash - ldr r4, =0x0201c000 - movs r5, 0xF8 - lsls r5, 4 - movs r0, 0x1C - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_8152890 - adds r4, r5 - movs r0, 0x1D - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_8152890 - b _0815331A - .pool -_081532AC: - bl save_serialize_game - ldr r0, =0x0000ffff - ldr r1, =0x03006220 - bl save_write_to_flash - b _0815331A - .pool -_081532C4: - bl save_serialize_game - movs r4, 0 -_081532CA: - adds r0, r4, 0 - ldr r1, =0x03006220 - bl calls_flash_erase_block_2 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _081532CA - movs r4, 0 -_081532DE: - adds r0, r4, 0 - ldr r1, =0x03006220 - bl sav12_xor_get - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _081532DE - b _0815331A - .pool -_081532F8: - movs r4, 0x1C - ldr r5, =0x03007860 -_081532FC: - ldr r1, [r5] - adds r0, r4, 0 - bl _call_via_r1 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1F - bls _081532FC - bl save_serialize_game - ldr r0, =0x0000ffff - ldr r1, =0x03006220 - bl save_write_to_flash -_0815331A: - ldr r0, =0x0203cf5c - str r6, [r0] - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end calls_flash_erase_block_3 - - thumb_func_start save_game_when_memory_present -save_game_when_memory_present: @ 8153338 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x03005d88 - ldr r4, [r0] - cmp r4, 0x1 - bne _0815335A - adds r0, r5, 0 - bl calls_flash_erase_block_3 - ldr r0, =0x030061fc - ldr r0, [r0] - cmp r0, 0 - beq _08153370 - adds r0, r5, 0 - bl fullscreen_save_activate -_0815335A: - ldr r1, =0x03006294 - movs r0, 0xFF - strh r0, [r1] - movs r0, 0xFF - b _08153376 - .pool -_08153370: - ldr r0, =0x03006294 - strh r4, [r0] - movs r0, 0x1 -_08153376: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end save_game_when_memory_present - - thumb_func_start sub_8153380 -sub_8153380: @ 8153380 - push {lr} - ldr r0, =0x03005d88 - ldr r0, [r0] - cmp r0, 0x1 - bne _081533A4 - bl sub_8153190 - bl save_serialize_game - ldr r0, =0x03006220 - bl sub_8152934 - movs r0, 0 - b _081533A6 - .pool -_081533A4: - movs r0, 0x1 -_081533A6: - pop {r1} - bx r1 - thumb_func_end sub_8153380 - - thumb_func_start sub_81533AC -sub_81533AC: @ 81533AC - push {r4,lr} - ldr r1, =0x03006220 - movs r0, 0xE - bl sub_81529D4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x030061fc - ldr r0, [r0] - cmp r0, 0 - beq _081533C8 - movs r0, 0 - bl fullscreen_save_activate -_081533C8: - cmp r4, 0xFF - beq _081533D8 - movs r0, 0 - b _081533DA - .pool -_081533D8: - movs r0, 0x1 -_081533DA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81533AC - - thumb_func_start sub_81533E0 -sub_81533E0: @ 81533E0 - push {lr} - ldr r1, =0x03006220 - movs r0, 0xE - bl sub_8152A34 - ldr r0, =0x030061fc - ldr r0, [r0] - cmp r0, 0 - beq _081533F8 - movs r0, 0 - bl fullscreen_save_activate -_081533F8: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81533E0 - - thumb_func_start sub_8153408 -sub_8153408: @ 8153408 - push {lr} - ldr r1, =0x03006220 - movs r0, 0xE - bl sub_8152CAC - ldr r0, =0x030061fc - ldr r0, [r0] - cmp r0, 0 - beq _08153420 - movs r0, 0 - bl fullscreen_save_activate -_08153420: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8153408 - - thumb_func_start sub_8153430 -sub_8153430: @ 8153430 - push {r4,lr} - ldr r0, =0x03005d88 - ldr r0, [r0] - cmp r0, 0x1 - bne _0815346C - bl sub_8153190 - bl save_serialize_game - ldr r4, =0x03006220 - adds r0, r4, 0 - bl sub_8152990 - ldr r0, =0x03006208 - ldrh r0, [r0] - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl sub_8152A34 - movs r0, 0 - b _0815346E - .pool -_0815346C: - movs r0, 0x1 -_0815346E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8153430 - - thumb_func_start sub_8153474 -sub_8153474: @ 8153474 - push {r4-r6,lr} - movs r6, 0 - ldr r0, =0x03006208 - ldrh r1, [r0] - adds r1, 0x1 - strh r1, [r0] - lsls r0, r1, 16 - lsrs r5, r0, 16 - cmp r5, 0x4 - bhi _081534A8 - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r0, 16 - ldr r4, =0x03006220 - adds r1, r4, 0 - bl sub_8152A34 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8152D44 - b _081534B2 - .pool -_081534A8: - ldr r1, =0x03006220 - adds r0, r5, 0 - bl sub_8152D44 - movs r6, 0x1 -_081534B2: - ldr r0, =0x030061fc - ldr r0, [r0] - cmp r0, 0 - beq _081534C0 - movs r0, 0x1 - bl fullscreen_save_activate -_081534C0: - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8153474 - - thumb_func_start sub_81534D0 -sub_81534D0: @ 81534D0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x03005d88 - ldr r0, [r0] - cmp r0, 0x1 - beq _081534F0 - ldr r1, =0x03006210 - movs r0, 0x4 - strh r0, [r1] - movs r0, 0xFF - b _08153550 - .pool -_081534F0: - bl sub_8153190 - cmp r4, 0 - beq _081534FC - cmp r4, 0x3 - beq _08153528 -_081534FC: - ldr r0, =0x0000ffff - ldr r1, =0x03006220 - bl sub_8152DD0 - lsls r0, 24 - lsrs r4, r0, 24 - bl save_deserialize_game - ldr r0, =0x03006210 - strh r4, [r0] - ldr r1, =0x03006214 - movs r0, 0 - str r0, [r1] - b _0815354E - .pool -_08153528: - ldr r5, =0x0201c000 - movs r6, 0xF8 - lsls r6, 4 - movs r0, 0x1C - adds r1, r5, 0 - adds r2, r6, 0 - bl sub_81530DC - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bne _0815354E - adds r1, r5, r6 - movs r0, 0x1D - adds r2, r6, 0 - bl sub_81530DC - lsls r0, 24 - lsrs r4, r0, 24 -_0815354E: - adds r0, r4, 0 -_08153550: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81534D0 - - thumb_func_start sub_815355C -sub_815355C: @ 815355C - push {r4-r7,lr} - ldr r5, =0x03006204 - ldr r0, =0x0203abbc - str r0, [r5] - adds r7, r0, 0 - ldr r0, =0x03005d88 - ldr r4, [r0] - cmp r4, 0x1 - beq _0815358C - b _081535C8 - .pool -_0815357C: - ldrb r1, [r7, 0xA] - ldrb r0, [r7, 0xB] - adds r1, r0 - ldrb r0, [r7, 0xC] - adds r1, r0 - ldrb r0, [r7, 0xD] - adds r0, r1 - b _081535CA -_0815358C: - bl sub_8153190 - ldr r0, =0x03006220 - bl sub_8152EC8 - ldr r0, =0x03006200 - ldr r1, [r0] - ands r1, r4 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 17 - lsrs r6, r0, 16 - movs r4, 0 -_081535A6: - adds r0, r4, r6 - lsls r0, 24 - lsrs r0, 24 - ldr r1, [r5] - bl sub_815314C - ldr r0, [r5] - ldr r1, =0x00000ff4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _0815357C - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0xD - bls _081535A6 -_081535C8: - movs r0, 0 -_081535CA: - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_815355C - - thumb_func_start sub_81535DC -sub_81535DC: @ 81535DC - push {r4-r6,lr} - adds r6, r1, 0 - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xE2 - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0x1 - bhi _08153608 - ldr r4, =0x0203abbc - movs r3, 0x80 - lsls r3, 5 - adds r0, r1, 0 - movs r1, 0 - adds r2, r4, 0 - bl ReadFlash - ldr r1, [r4] - ldr r0, =0x0000b39d - cmp r1, r0 - beq _08153614 -_08153608: - movs r0, 0xFF - b _0815362A - .pool -_08153614: - movs r3, 0 - ldr r5, =0x00000ffb - adds r2, r4, 0x4 -_0815361A: - adds r0, r6, r3 - adds r1, r2, r3 - ldrb r1, [r1] - strb r1, [r0] - adds r3, 0x1 - cmp r3, r5 - ble _0815361A - movs r0, 0x1 -_0815362A: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81535DC - - thumb_func_start sub_8153634 -sub_8153634: @ 8153634 - push {r4-r7,lr} - adds r5, r1, 0 - lsls r0, 24 - lsrs r6, r0, 24 - movs r1, 0xE2 - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bhi _08153680 - ldr r7, =0x0203abbc - ldr r0, =0x0000b39d - adds r3, r7, 0 - stm r3!, {r0} - movs r2, 0 - ldr r4, =0x00000ffb -_08153654: - adds r0, r3, r2 - adds r1, r5, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, r4 - ble _08153654 - adds r0, r6, 0 - adds r1, r7, 0 - bl ProgramFlashSectorsAndVerify - cmp r0, 0 - bne _08153680 - movs r0, 0x1 - b _08153682 - .pool -_08153680: - movs r0, 0xFF -_08153682: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8153634 - - thumb_func_start sub_8153688 -sub_8153688: @ 8153688 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0xB - bls _081536A2 - b _081537C2 -_081536A2: - lsls r0, 2 - ldr r1, =_081536B4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081536B4: - .4byte _081536E4 - .4byte _081536F4 - .4byte _081536FE - .4byte _0815371A - .4byte _0815372C - .4byte _08153742 - .4byte _08153758 - .4byte _08153762 - .4byte _08153778 - .4byte _0815378C - .4byte _08153796 - .4byte _081537A8 -_081536E4: - ldr r0, =0x03002700 - movs r1, 0x1 - strb r1, [r0] - movs r0, 0x1 - strh r0, [r4] - b _081537C2 - .pool -_081536F4: - bl sub_800ADF8 - movs r0, 0x2 - strh r0, [r4] - b _081537C2 -_081536FE: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _081537C2 - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08153714 - bl save_serialize_map -_08153714: - movs r0, 0x3 - strh r0, [r4] - b _081537C2 -_0815371A: - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08153726 - bl sub_8076D5C -_08153726: - bl sub_8153380 - b _08153752 -_0815372C: - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0x5 - bne _081537C2 - movs r0, 0 - strh r0, [r4, 0x2] - strh r1, [r4] - b _081537C2 -_08153742: - bl sub_81533AC - lsls r0, 24 - cmp r0, 0 - beq _08153752 - movs r0, 0x6 - strh r0, [r4] - b _081537C2 -_08153752: - movs r0, 0x4 - strh r0, [r4] - b _081537C2 -_08153758: - bl sub_81533E0 - movs r0, 0x7 - strh r0, [r4] - b _081537C2 -_08153762: - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815376E - bl sav2_gender2_inplace_and_xFE -_0815376E: - bl sub_800ADF8 - movs r0, 0x8 - strh r0, [r4] - b _081537C2 -_08153778: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _081537C2 - bl sub_8153408 - movs r0, 0x9 - strh r0, [r4] - b _081537C2 -_0815378C: - bl sub_800ADF8 - movs r0, 0xA - strh r0, [r4] - b _081537C2 -_08153796: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _081537C2 - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _081537C2 -_081537A8: - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - ble _081537C2 - ldr r1, =0x03002700 - movs r0, 0 - strb r0, [r1] - adds r0, r2, 0 - bl DestroyTask -_081537C2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8153688 - - thumb_func_start sub_81537CC -sub_81537CC: @ 81537CC - push {r4,lr} - adds r4, r3, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r2, 16 - lsrs r2, 16 - movs r3, 0x1 - ands r0, r3 - cmp r0, 0 - beq _081537FC - ands r1, r3 - cmp r1, 0 - beq _081537FC - movs r0, 0x4 - ands r2, r0 - cmp r2, 0 - beq _081537FC - movs r0, 0x80 - lsls r0, 2 - ands r0, r4 - cmp r0, 0 - beq _081537FC - movs r0, 0x1 - b _081537FE -_081537FC: - movs r0, 0 -_081537FE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81537CC - - thumb_func_start sub_8153804 -sub_8153804: @ 8153804 - push {lr} - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_08674C86 - bl ExpandStringRefs - movs r0, 0x3 - bl sub_81538C4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8153804 - - thumb_func_start sub_8153820 -sub_8153820: @ 8153820 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r1, =gUnknown_082DED2C - ldr r2, =gUnknown_082DED2C + 0x44 - bl script_env_init - adds r0, r4, 0 - adds r1, r5, 0 - bl script_setup_bytecode_script - str r5, [r4, 0x64] - movs r0, 0 - str r0, [r4, 0x68] - str r0, [r4, 0x6C] - str r0, [r4, 0x70] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8153820 - - thumb_func_start sub_8153850 -sub_8153850: @ 8153850 - push {r4,lr} - adds r4, r0, 0 - bl script_main_handler - lsls r0, 24 - cmp r0, 0 - beq _08153868 - ldr r0, [r4, 0x70] - cmp r0, 0 - beq _08153868 - movs r0, 0x1 - b _0815386A -_08153868: - movs r0, 0 -_0815386A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8153850 - - thumb_func_start sub_8153870 -sub_8153870: @ 8153870 - push {lr} - adds r1, r0, 0 - ldr r0, =0x0203bbc0 - bl sub_8153820 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8153870 - - thumb_func_start sub_8153884 -sub_8153884: @ 8153884 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x0203bbc0 - adds r0, r4, 0 - bl sub_8153850 - ldr r1, [r4, 0x6C] - str r1, [r5] - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8153884 - - thumb_func_start sub_81538A0 -sub_81538A0: @ 81538A0 - push {r4,lr} - adds r1, r0, 0 - ldr r4, =0x0203bbc0 - adds r0, r4, 0 - bl sub_8153820 -_081538AC: - adds r0, r4, 0 - bl sub_8153850 - cmp r0, 0 - bne _081538AC - ldr r0, [r4, 0x6C] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81538A0 - - thumb_func_start sub_81538C4 -sub_81538C4: @ 81538C4 - ldr r1, =0x0203bbc0 - str r0, [r1, 0x6C] - bx lr - .pool - thumb_func_end sub_81538C4 - - thumb_func_start sub_81538D0 -sub_81538D0: @ 81538D0 - push {lr} - movs r2, 0 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003b18 - adds r3, r0, r1 - movs r1, 0 -_081538DE: - adds r0, r3, r1 - ldrb r0, [r0] - adds r2, r0 - adds r1, 0x1 - cmp r1, 0xB - bls _081538DE - adds r0, r2, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81538D0 - - thumb_func_start sub_81538F8 -sub_81538F8: @ 81538F8 - push {r4,r5,lr} - ldr r5, =0x03005d8c - ldr r0, [r5] - ldr r1, =0x00003b18 - adds r4, r0, r1 - bl sub_81538D0 - adds r1, r0, 0 - ldrb r0, [r4] - cmp r0, 0 - beq _0815392A - ldrb r0, [r4, 0x1] - cmp r0, 0 - beq _0815392A - ldrh r0, [r4, 0x2] - cmp r0, 0 - beq _0815392A - cmp r1, 0 - beq _0815392A - ldr r0, [r5] - ldr r2, =0x00003b14 - adds r0, r2 - ldr r0, [r0] - cmp r1, r0 - beq _0815393C -_0815392A: - movs r0, 0 - b _0815393E - .pool -_0815393C: - movs r0, 0x1 -_0815393E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81538F8 - - thumb_func_start sub_8153944 -sub_8153944: @ 8153944 - push {lr} - sub sp, 0x4 - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x00003b14 - adds r1, r0 - ldr r2, =0x01000008 - mov r0, sp - bl CpuSet - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8153944 - - thumb_func_start sub_8153970 -sub_8153970: @ 8153970 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r3, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r5, r1, 0 - lsls r2, 16 - lsrs r2, 16 - adds r6, r2, 0 - cmp r3, 0 - beq _08153990 - cmp r1, 0 - beq _08153990 - cmp r2, 0 - bne _08153996 -_08153990: - bl sub_8153944 - b _081539BC -_08153996: - ldr r4, =0x03005d8c - ldr r0, [r4] - ldr r1, =0x00003b18 - adds r0, r1 - strb r3, [r0] - ldr r0, [r4] - ldr r2, =0x00003b19 - adds r0, r2 - strb r5, [r0] - ldr r0, [r4] - adds r1, 0x2 - adds r0, r1 - strh r6, [r0] - bl sub_81538D0 - ldr r1, [r4] - ldr r2, =0x00003b14 - adds r1, r2 - str r0, [r1] -_081539BC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8153970 - - thumb_func_start sub_81539D4 -sub_81539D4: @ 81539D4 - push {r4-r6,lr} - ldr r6, =0x03005d8c - ldr r0, [r6] - ldr r1, =0x00003b18 - adds r4, r0, r1 - bl sub_81538F8 - cmp r0, 0 - bne _081539F8 - bl sub_8153944 - movs r0, 0 - b _08153A1A - .pool -_081539F8: - ldrh r5, [r4, 0x2] - ldrb r0, [r4, 0x1] - subs r0, 0x1 - strb r0, [r4, 0x1] - lsls r0, 24 - cmp r0, 0 - bne _08153A0C - bl sub_8153944 - b _08153A18 -_08153A0C: - bl sub_81538D0 - ldr r1, [r6] - ldr r2, =0x00003b14 - adds r1, r2 - str r0, [r1] -_08153A18: - adds r0, r5, 0 -_08153A1A: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81539D4 - - thumb_func_start script_status_stop_and_ret_1 -script_status_stop_and_ret_1: @ 8153A24 - push {lr} - bl script_stop - movs r0, 0x1 - pop {r1} - bx r1 - thumb_func_end script_status_stop_and_ret_1 - - thumb_func_start sub_8153A30 -sub_8153A30: @ 8153A30 - push {r4-r7,lr} - adds r7, r0, 0 - bl script_read_word - str r0, [r7, 0x68] - adds r0, r7, 0 - bl script_read_halfword - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r7, 0 - bl script_read_word - adds r6, r0, 0 - adds r0, r7, 0 - bl script_read_halfword - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r7, 0 - bl script_read_word - adds r3, r0, 0 - adds r0, r5, 0 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_81537CC - cmp r0, 0x1 - bne _08153A74 - str r0, [r7, 0x70] - b _08153A78 -_08153A74: - bl sub_8153804 -_08153A78: - movs r0, 0x1 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8153A30 - - thumb_func_start sub_8153A80 -sub_8153A80: @ 8153A80 - movs r0, 0 - bx lr - thumb_func_end sub_8153A80 - - thumb_func_start sub_8153A84 -sub_8153A84: @ 8153A84 - ldr r1, [r0, 0x8] - ldrb r2, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - str r2, [r0, 0x6C] - movs r0, 0 - bx lr - thumb_func_end sub_8153A84 - - thumb_func_start sub_8153A94 -sub_8153A94: @ 8153A94 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, [r4, 0x8] - ldrb r5, [r0] - adds r0, 0x1 - str r0, [r4, 0x8] - adds r0, r4, 0 - bl script_read_word - ldr r1, [r4, 0x68] - subs r0, r1 - ldr r1, [r4, 0x64] - adds r1, r0, r1 - cmp r5, 0xFF - beq _08153AB8 - ldr r0, [r4, 0x6C] - cmp r5, r0 - bne _08153ABE -_08153AB8: - ldr r0, =0x02021fc4 - bl ExpandStringRefs -_08153ABE: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8153A94 - - thumb_func_start sub_8153ACC -sub_8153ACC: @ 8153ACC - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - ldr r1, [r4, 0x68] - subs r0, r1 - ldr r1, [r4, 0x64] - adds r0, r1 - bl script_env_2_execute_new_script - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8153ACC - - thumb_func_start sub_8153AE8 -sub_8153AE8: @ 8153AE8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r0, 0 - bl sub_80E162C - mov r8, r0 - adds r0, r7, 0 - bl script_read_word - adds r4, r0, 0 - ldr r0, [r7, 0x68] - subs r4, r0 - ldr r0, [r7, 0x64] - adds r4, r0 - ldr r0, =0x02021cc4 - mov r9, r0 - ldr r6, =0x03005d8c - ldr r1, [r6] - ldr r5, =0x000031f8 - adds r1, r5 - movs r2, 0x7 - bl CopyString_LimitN - adds r0, r4, 0 - bl sub_80E15E4 - ldr r4, =0x02021dc4 - ldr r1, [r6] - adds r1, r5 - adds r0, r4, 0 - movs r2, 0x7 - bl CopyString_LimitN - mov r0, r8 - cmp r0, 0 - bne _08153B54 - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_08674AE4 - b _08153B74 - .pool -_08153B54: - mov r0, r9 - adds r1, r4, 0 - bl CompareString - cmp r0, 0 - beq _08153B70 - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_08674B16 - b _08153B74 - .pool -_08153B70: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_08674B42 -_08153B74: - bl ExpandStringRefs - movs r0, 0x2 - str r0, [r7, 0x6C] - bl sub_80E162C - cmp r0, 0x1 - bne _08153B9C - ldr r0, =0x0000402d - movs r1, 0x1 - bl VarSet - b _08153BA0 - .pool -_08153B9C: - movs r0, 0x1 - str r0, [r7, 0x6C] -_08153BA0: - movs r0, 0 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8153AE8 - - thumb_func_start sub_8153BB0 -sub_8153BB0: @ 8153BB0 - push {r4,lr} - adds r4, r0, 0 - ldr r2, [r4, 0x8] - ldrb r0, [r2] - adds r2, 0x1 - str r2, [r4, 0x8] - ldrb r1, [r2] - adds r2, 0x1 - str r2, [r4, 0x8] - bl sub_80F9B30 - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_08674B6A - bl ExpandStringRefs - movs r0, 0x2 - str r0, [r4, 0x6C] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8153BB0 - - thumb_func_start sub_8153BE4 -sub_8153BE4: @ 8153BE4 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r4, r0, 0 - ldr r0, [r4, 0x8] - ldrb r1, [r0] - mov r9, r1 - adds r0, 0x1 - str r0, [r4, 0x8] - ldrb r1, [r0] - mov r8, r1 - adds r1, r0, 0x1 - str r1, [r4, 0x8] - ldrb r6, [r0, 0x1] - adds r1, 0x1 - str r1, [r4, 0x8] - adds r0, r4, 0 - bl script_read_word - adds r5, r0, 0 - ldr r0, [r4, 0x68] - subs r5, r0 - ldr r0, [r4, 0x64] - adds r5, r0 - adds r0, r4, 0 - bl script_read_word - adds r1, r0, 0 - ldr r0, [r4, 0x68] - subs r1, r0 - ldr r0, [r4, 0x64] - adds r1, r0 - subs r1, r5 - lsls r1, 16 - lsrs r1, 16 - str r6, [sp] - adds r0, r5, 0 - mov r2, r9 - mov r3, r8 - bl sub_80990FC - movs r0, 0 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8153BE4 - - thumb_func_start sub_8153C4C -sub_8153C4C: @ 8153C4C - push {r4,lr} - adds r4, r0, 0 - bl sub_809D3E8 - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_08674B9E - bl ExpandStringRefs - movs r0, 0x2 - str r0, [r4, 0x6C] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8153C4C - - thumb_func_start sub_8153C70 -sub_8153C70: @ 8153C70 - push {r4,lr} - adds r4, r0, 0 - ldr r1, [r4, 0x8] - ldrb r0, [r1] - adds r1, 0x1 - str r1, [r4, 0x8] - bl sub_811EFC0 - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_08674BD4 - bl ExpandStringRefs - movs r0, 0x2 - str r0, [r4, 0x6C] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8153C70 - - thumb_func_start sub_8153C9C -sub_8153C9C: @ 8153C9C - push {r4,r5,lr} - ldr r1, [r0, 0x8] - ldrb r5, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - ldrb r4, [r1] - adds r1, 0x1 - str r1, [r0, 0x8] - bl script_read_halfword - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8153970 - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8153C9C - - thumb_func_start sub_8153CC8 -sub_8153CC8: @ 8153CC8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x88 - adds r6, r0, 0 - bl script_read_word - ldr r1, [r6, 0x68] - subs r0, r1 - ldr r1, [r6, 0x64] - adds r5, r0, r1 - movs r0, 0x64 - adds r0, r5 - mov r8, r0 - add r4, sp, 0x24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x64 - bl memcpy - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - bne _08153D18 - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085E8264 - movs r2, 0xB - bl CopyString_LimitN - b _08153D22 - .pool -_08153D18: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085E8268 - movs r2, 0xB - bl CopyString_LimitN -_08153D22: - ldr r0, =0x020244e9 - ldrb r0, [r0] - cmp r0, 0x6 - bne _08153D4C - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_08674C02 - bl ExpandStringRefs - movs r0, 0x3 - b _08153DB6 - .pool -_08153D4C: - ldr r7, =0x020246e0 - adds r0, r7, 0 - adds r1, r5, 0 - movs r2, 0x64 - bl memcpy - mov r0, sp - mov r1, r8 - movs r2, 0x24 - bl memcpy - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - beq _08153D86 - adds r0, r4, 0 - bl SpeciesToNationalPokedexNum - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r4, 0 - movs r1, 0x2 - bl pokedex_flag_operation - adds r0, r4, 0 - movs r1, 0x3 - bl pokedex_flag_operation -_08153D86: - adds r0, r7, 0 - movs r1, 0xC - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _08153DA4 - adds r0, r7, 0 - mov r1, sp - bl sub_80D460C -_08153DA4: - bl party_compaction - bl calc_player_party_count - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_08674BF0 - bl ExpandStringRefs - movs r0, 0x2 -_08153DB6: - str r0, [r6, 0x6C] - movs r0, 0 - add sp, 0x88 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8153CC8 - - thumb_func_start sub_8153DD4 -sub_8153DD4: @ 8153DD4 - push {r4,lr} - adds r4, r0, 0 - bl script_read_word - adds r1, r0, 0 - ldr r0, [r4, 0x68] - subs r1, r0 - ldr r0, [r4, 0x64] - adds r1, r0 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r2, =0x00000bec - adds r0, r2 - movs r2, 0xBC - bl memcpy - bl sub_81652B4 - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_08674C31 - bl ExpandStringRefs - movs r0, 0x2 - str r0, [r4, 0x6C] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8153DD4 - - thumb_func_start sub_8153E1C -sub_8153E1C: @ 8153E1C - push {r4,lr} - adds r4, r0, 0 - bl sub_809D5F4 - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085ECAD8 - bl ExpandStringRefs - movs r0, 0x2 - str r0, [r4, 0x6C] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8153E1C - - thumb_func_start sub_8153E40 -sub_8153E40: @ 8153E40 - push {r4-r6,lr} - adds r6, r0, 0 - bl script_read_word - adds r5, r0, 0 - adds r0, r6, 0 - bl script_read_word - adds r4, r0, 0 - ldr r0, [r6, 0x68] - subs r4, r0 - ldr r0, [r6, 0x64] - adds r4, r0 - adds r0, r6, 0 - bl script_read_word - adds r1, r0, 0 - ldr r0, [r6, 0x68] - subs r1, r0 - ldr r0, [r6, 0x64] - adds r1, r0 - subs r1, r4 - adds r0, r4, 0 - bl sub_806F96C - cmp r5, r0 - beq _08153E7E - movs r0, 0 - str r0, [r6, 0x70] - movs r0, 0x1 - str r0, [r6, 0x6C] -_08153E7E: - movs r0, 0x1 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8153E40 - - thumb_func_start sub_8153E88 -sub_8153E88: @ 8153E88 - push {r4-r6,lr} - adds r6, r0, 0 - bl script_read_word - adds r5, r0, 0 - adds r0, r6, 0 - bl script_read_word - adds r4, r0, 0 - ldr r0, [r6, 0x68] - subs r4, r0 - ldr r0, [r6, 0x64] - adds r4, r0 - adds r0, r6, 0 - bl script_read_word - adds r1, r0, 0 - ldr r0, [r6, 0x68] - subs r1, r0 - ldr r0, [r6, 0x64] - adds r1, r0 - subs r1, r4 - adds r0, r4, 0 - bl sub_806F8D0 - lsls r0, 16 - lsrs r0, 16 - cmp r5, r0 - beq _08153ECA - movs r0, 0 - str r0, [r6, 0x70] - movs r0, 0x1 - str r0, [r6, 0x6C] -_08153ECA: - movs r0, 0x1 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8153E88 - - thumb_func_start SetUpReflection -SetUpReflection: @ 8153ED4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - adds r4, r1, 0 - lsls r5, r2, 24 - lsrs r5, 24 - movs r0, 0x20 - ldrsh r1, [r4, r0] - movs r0, 0x22 - ldrsh r2, [r4, r0] - adds r0, r4, 0 - movs r3, 0x98 - bl obj_unfreeze - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r7, r1, r0 - ldr r0, =objc_reflection_maybe - str r0, [r7, 0x1C] - ldrb r1, [r7, 0x5] - movs r0, 0xC - orrs r1, r0 - strb r1, [r7, 0x5] - ldr r2, =gUnknown_084975C4 - lsrs r0, r1, 4 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 4 - movs r2, 0xF - ands r1, r2 - orrs r1, r0 - strb r1, [r7, 0x5] - movs r1, 0x3F - adds r1, r7 - mov r8, r1 - ldrb r0, [r1] - movs r1, 0x40 - orrs r0, r1 - mov r1, r8 - strb r0, [r1] - ldr r0, =gDummyObjectImageAnimTable - str r0, [r7, 0x8] - adds r0, r7, 0 - movs r1, 0 - bl StartObjectImageAnim - ldr r0, =gDummyObjectRotScalAnimTable - str r0, [r7, 0x10] - mov r1, r8 - ldrb r0, [r1] - movs r1, 0x8 - orrs r0, r1 - mov r1, r8 - strb r0, [r1] - adds r2, r7, 0 - adds r2, 0x42 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x2E] - strh r0, [r7, 0x2E] - ldrb r0, [r6, 0x8] - strh r0, [r7, 0x30] - strh r5, [r7, 0x3C] - adds r0, r6, 0 - adds r1, r7, 0 - bl npc_pal_op - cmp r5, 0 - bne _08153F7A - ldrb r0, [r7, 0x1] - movs r1, 0x4 - negs r1, r1 - ands r1, r0 - movs r0, 0x1 - orrs r1, r0 - strb r1, [r7, 0x1] -_08153F7A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end SetUpReflection - - thumb_func_start sub_8153F98 -sub_8153F98: @ 8153F98 - push {lr} - ldrb r0, [r0, 0x5] - bl GetFieldObjectGraphicsInfo - ldrh r0, [r0, 0xA] - subs r0, 0x2 - lsls r0, 16 - asrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_8153F98 - - thumb_func_start npc_pal_op -@ void npc_pal_op(struct npc_state *npcState, struct obj *obj) -npc_pal_op: @ 8153FAC - push {r4,r5,lr} - sub sp, 0x8 - adds r5, r0, 0 - adds r4, r1, 0 - ldr r1, =gUnknown_085CDC38 - mov r0, sp - movs r2, 0x6 - bl memcpy - movs r0, 0 - strh r0, [r4, 0x32] - ldrb r0, [r5, 0x5] - bl GetFieldObjectGraphicsInfo - ldrb r1, [r0, 0xC] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08154008 - ldrb r0, [r5, 0x1F] - bl sub_80894D4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08153FEE - ldrb r0, [r5, 0x1E] - bl sub_80894D4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _08154008 -_08153FEE: - subs r0, 0x1 - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - strh r0, [r4, 0x32] - ldrb r1, [r4, 0x5] - lsrs r1, 4 - adds r0, r5, 0 - bl npc_pal_op_A - b _08154012 - .pool -_08154008: - ldrb r1, [r4, 0x5] - lsrs r1, 4 - adds r0, r5, 0 - bl npc_pal_op_B -_08154012: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end npc_pal_op - - thumb_func_start npc_pal_op_B -@ void npc_pal_op_B(void *a1, u8 slot) -npc_pal_op_B: @ 815401C - push {r4,lr} - lsls r1, 24 - lsrs r4, r1, 24 - ldrb r0, [r0, 0x5] - bl GetFieldObjectGraphicsInfo - adds r2, r0, 0 - ldrh r1, [r2, 0x4] - ldr r0, =0x000011ff - cmp r1, r0 - beq _08154070 - ldrb r0, [r2, 0xC] - movs r1, 0xF - ands r1, r0 - cmp r1, 0 - bne _0815404C - ldrh r0, [r2, 0x2] - adds r1, r4, 0 - bl npc_load_two_palettes__no_record - b _0815406A - .pool -_0815404C: - cmp r1, 0xA - bne _0815405A - ldrh r0, [r2, 0x2] - adds r1, r4, 0 - bl npc_load_two_palettes__and_record - b _0815406A -_0815405A: - adds r0, r4, 0 - bl npc_paltag_by_palslot - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl pal_patch_for_npc -_0815406A: - adds r0, r4, 0 - bl sub_80ABE18 -_08154070: - pop {r4} - pop {r0} - bx r0 - thumb_func_end npc_pal_op_B - - thumb_func_start npc_pal_op_A -npc_pal_op_A: @ 8154078 - push {r4,lr} - lsls r1, 24 - lsrs r4, r1, 24 - ldrb r0, [r0, 0x5] - bl GetFieldObjectGraphicsInfo - adds r2, r0, 0 - ldrh r1, [r2, 0x4] - ldr r0, =0x000011ff - cmp r1, r0 - beq _0815409C - adds r0, r1, 0 - adds r1, r4, 0 - bl pal_patch_for_npc - adds r0, r4, 0 - bl sub_80ABE18 -_0815409C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end npc_pal_op_A - - thumb_func_start objc_reflection_maybe -@ void objc_reflection_maybe(struct obj *object) -objc_reflection_maybe: @ 81540A8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r4, r0, 0 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r7, r0, r1 - ldrb r1, [r7, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r5, r0, r1 - ldr r0, [r7] - ldr r1, =0x00020001 - ands r0, r1 - cmp r0, r1 - bne _081540E0 - ldrb r1, [r7, 0x8] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r1, r0 - beq _081540FC -_081540E0: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - b _08154214 - .pool -_081540FC: - ldr r1, =gUnknown_084975C4 - ldrb r0, [r5, 0x5] - lsrs r0, 4 - adds r0, r1 - ldrb r1, [r0] - lsls r1, 4 - ldrb r2, [r4, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x5] - ldrb r1, [r5, 0x1] - lsrs r1, 6 - lsls r1, 6 - ldrb r2, [r4, 0x1] - movs r3, 0x3F - adds r0, r3, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r0, [r5, 0x3] - lsrs r0, 6 - lsls r0, 6 - ldrb r2, [r4, 0x3] - adds r1, r3, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0x3] - ldrb r0, [r5, 0x3] - lsls r0, 26 - lsrs r0, 27 - movs r2, 0x10 - orrs r0, r2 - lsls r0, 1 - subs r2, 0x4F - mov r9, r2 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0x3] - ldrh r1, [r5, 0x4] - lsls r1, 22 - lsrs r1, 22 - ldrh r2, [r4, 0x4] - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - ldr r0, [r5, 0x18] - str r0, [r4, 0x18] - adds r0, r5, 0 - adds r0, 0x42 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 26 - adds r2, r4, 0 - adds r2, 0x42 - ands r3, r0 - ldrb r1, [r2] - movs r0, 0x40 - negs r0, r0 - ands r0, r1 - orrs r0, r3 - strb r0, [r2] - movs r0, 0x3E - adds r0, r5 - mov r8, r0 - ldrb r0, [r0] - adds r6, r4, 0 - adds r6, 0x3E - movs r1, 0x4 - ands r1, r0 - ldrb r2, [r6] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r6] - ldrh r0, [r5, 0x20] - strh r0, [r4, 0x20] - adds r0, r7, 0 - bl sub_8153F98 - ldrh r1, [r5, 0x22] - adds r0, r1 - ldrh r1, [r4, 0x32] - adds r1, r0 - strh r1, [r4, 0x22] - adds r0, r5, 0 - adds r0, 0x28 - ldrb r1, [r0] - adds r0, r4, 0 - adds r0, 0x28 - strb r1, [r0] - adds r0, r5, 0 - adds r0, 0x29 - ldrb r0, [r0] - adds r1, r4, 0 - adds r1, 0x29 - strb r0, [r1] - ldrh r0, [r5, 0x24] - strh r0, [r4, 0x24] - ldrh r0, [r5, 0x26] - negs r0, r0 - strh r0, [r4, 0x26] - mov r2, r8 - ldrb r1, [r2] - movs r0, 0x2 - ands r0, r1 - ldrb r1, [r6] - movs r2, 0x3 - negs r2, r2 - ands r2, r1 - orrs r2, r0 - strb r2, [r6] - ldrb r0, [r7, 0x3] - lsls r0, 28 - cmp r0, 0 - bge _081541EE - movs r0, 0x4 - orrs r2, r0 - strb r2, [r6] -_081541EE: - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08154214 - ldrb r0, [r4, 0x3] - mov r2, r9 - ands r2, r0 - strb r2, [r4, 0x3] - ldrb r0, [r5, 0x3] - lsls r0, 26 - lsrs r0, 27 - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - beq _08154214 - movs r1, 0x2 - adds r0, r2, 0 - orrs r0, r1 - strb r0, [r4, 0x3] -_08154214: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end objc_reflection_maybe - - thumb_func_start sub_8154228 -sub_8154228: @ 8154228 - push {r4,lr} - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x20] - movs r1, 0 - movs r2, 0 - movs r3, 0x52 - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - cmp r0, 0x40 - beq _08154266 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - movs r3, 0x4 - orrs r0, r3 - strb r0, [r1, 0x5] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x2 - orrs r0, r2 - orrs r0, r3 - strb r0, [r1] -_08154266: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8154228 - - thumb_func_start objid_set_invisible -objid_set_invisible: @ 8154278 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - bx lr - .pool - thumb_func_end objid_set_invisible - - thumb_func_start sub_8154298 -sub_8154298: @ 8154298 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r2, 16 - lsrs r7, r2, 16 - lsls r3, 16 - lsrs r6, r3, 16 - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - ldr r1, =0x02020630 - adds r2, r0, r1 - adds r0, r2, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _081542E2 - movs r0, 0x2E - ldrsh r1, [r2, r0] - lsls r0, r7, 16 - asrs r0, 16 - cmp r1, r0 - bne _081542E2 - movs r0, 0x30 - ldrsh r1, [r2, r0] - lsls r0, r6, 16 - asrs r0, 16 - cmp r1, r0 - beq _0815432E -_081542E2: - lsls r0, r7, 16 - asrs r0, 16 - lsls r1, r6, 16 - asrs r1, 16 - mov r4, sp - adds r4, 0x2 - mov r2, sp - adds r3, r4, 0 - bl sub_8093038 - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - ldr r1, =0x02020630 - adds r2, r0, r1 - mov r0, sp - ldrh r0, [r0] - adds r0, 0x8 - strh r0, [r2, 0x20] - ldrh r0, [r4] - adds r0, 0x8 - strh r0, [r2, 0x22] - adds r3, r2, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - strh r7, [r2, 0x2E] - strh r6, [r2, 0x30] - mov r1, r8 - subs r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - adds r0, r2, 0 - bl StartObjectImageAnim -_0815432E: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8154298 - - thumb_func_start oei_shadow -oei_shadow: @ 8154340 - push {r4,r5,lr} - ldr r5, =0x02038c08 - ldrb r0, [r5] - ldrb r1, [r5, 0x4] - ldrb r2, [r5, 0x8] - bl GetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02037350 - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x5] - bl GetFieldObjectGraphicsInfo - adds r4, r0, 0 - ldr r2, =gFieldEffectObjectTemplatePointers - ldr r1, =gUnknown_085CDC3E - ldrb r0, [r4, 0xC] - lsls r0, 26 - lsrs r0, 30 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - movs r1, 0 - movs r2, 0 - movs r3, 0x94 - bl AddObjectToBack - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _081543C4 - ldr r0, =0x02020630 - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r0 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r3] - ldr r0, [r5] - strh r0, [r2, 0x2E] - ldr r0, [r5, 0x4] - strh r0, [r2, 0x30] - ldr r0, [r5, 0x8] - strh r0, [r2, 0x32] - ldrh r1, [r4, 0xA] - lsls r1, 16 - asrs r1, 17 - ldr r3, =gUnknown_085CDC42 - ldrb r0, [r4, 0xC] - lsls r0, 26 - lsrs r0, 30 - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - subs r1, r0 - strh r1, [r2, 0x34] -_081543C4: - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end oei_shadow - - thumb_func_start oamc_shadow -oamc_shadow: @ 81543E4 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - ldrh r0, [r5, 0x2E] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r5, 0x30] - lsls r1, 24 - lsrs r1, 24 - ldrh r2, [r5, 0x32] - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - beq _08154412 - adds r0, r5, 0 - movs r1, 0x3 - bl FieldEffectStop - b _08154498 -_08154412: - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - ldrb r0, [r4, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - ldrb r0, [r1, 0x5] - movs r2, 0xC - ands r2, r0 - ldrb r3, [r5, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r5, 0x5] - ldrh r0, [r1, 0x20] - strh r0, [r5, 0x20] - ldrh r0, [r5, 0x34] - ldrh r1, [r1, 0x22] - adds r0, r1 - strh r0, [r5, 0x22] - ldr r0, [r4] - ldr r1, =0x00400001 - ands r0, r1 - cmp r0, r1 - bne _08154490 - ldrb r0, [r4, 0x1E] - bl sub_8088E64 - lsls r0, 24 - cmp r0, 0 - bne _08154490 - ldrb r0, [r4, 0x1E] - bl MetatileBehavior_IsSurfableWaterOrUnderwater - lsls r0, 24 - cmp r0, 0 - bne _08154490 - ldrb r0, [r4, 0x1F] - bl MetatileBehavior_IsSurfableWaterOrUnderwater - lsls r0, 24 - cmp r0, 0 - bne _08154490 - ldrb r0, [r4, 0x1E] - bl MetatileBehavior_IsReflective - lsls r0, 24 - cmp r0, 0 - bne _08154490 - ldrb r0, [r4, 0x1F] - bl MetatileBehavior_IsReflective - lsls r0, 24 - cmp r0, 0 - beq _08154498 -_08154490: - adds r0, r5, 0 - movs r1, 0x3 - bl FieldEffectStop -_08154498: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end oamc_shadow - - thumb_func_start oei_grass_normal -oei_grass_normal: @ 81544AC - push {r4,r5,lr} - sub sp, 0x4 - ldr r5, =0x02038c08 - ldrh r1, [r5] - mov r0, sp - strh r1, [r0] - ldrh r0, [r5, 0x4] - mov r4, sp - adds r4, 0x2 - strh r0, [r4] - mov r0, sp - adds r1, r4, 0 - movs r2, 0x8 - movs r3, 0x8 - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x10] - mov r1, sp - movs r2, 0 - ldrsh r1, [r1, r2] - movs r3, 0 - ldrsh r2, [r4, r3] - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _08154538 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r3, r0, r1 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x3 - ldrb r1, [r5, 0xC] - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x5] - ldr r0, [r5, 0x8] - strh r0, [r3, 0x2E] - ldr r0, [r5] - strh r0, [r3, 0x30] - ldr r0, [r5, 0x4] - strh r0, [r3, 0x32] - ldr r0, [r5, 0x10] - strh r0, [r3, 0x34] - ldr r0, [r5, 0x14] - strh r0, [r3, 0x36] - ldr r0, [r5, 0x18] - strh r0, [r3, 0x38] - ldr r0, [r5, 0x1C] - cmp r0, 0 - beq _08154538 - adds r0, r3, 0 - movs r1, 0x4 - bl SeekObjectImageAnim -_08154538: - movs r0, 0 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end oei_grass_normal - - thumb_func_start unc_grass_normal -unc_grass_normal: @ 8154550 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r5, r0, 0 - ldrh r0, [r5, 0x38] - lsrs r4, r0, 8 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r3, =0x02037334 - ldrb r1, [r3] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815459C - ldr r0, =0x03005d8c - ldr r2, [r0] - movs r0, 0x5 - ldrsb r0, [r2, r0] - cmp r0, r4 - bne _08154582 - movs r0, 0x4 - ldrsb r0, [r2, r0] - cmp r0, r7 - beq _0815459C -_08154582: - ldr r1, [r3, 0x4] - ldrh r0, [r5, 0x30] - subs r0, r1 - strh r0, [r5, 0x30] - ldr r1, [r3, 0x8] - ldrh r0, [r5, 0x32] - subs r0, r1 - strh r0, [r5, 0x32] - ldrb r1, [r2, 0x5] - lsls r1, 8 - ldrb r0, [r2, 0x4] - orrs r0, r1 - strh r0, [r5, 0x38] -_0815459C: - ldrh r0, [r5, 0x34] - lsrs r1, r0, 8 - mov r8, r1 - lsls r0, 24 - lsrs r4, r0, 24 - ldrh r0, [r5, 0x36] - lsls r0, 24 - lsrs r7, r0, 24 - movs r2, 0x30 - ldrsh r0, [r5, r2] - movs r2, 0x32 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r6, r0, 24 - mov r0, r8 - adds r1, r4, 0 - adds r2, r7, 0 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _081545F0 - adds r0, r6, 0 - bl MetatileBehavior_IsTallGrass - lsls r0, 24 - cmp r0, 0 - beq _081545F0 - movs r1, 0x3C - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08154604 - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08154604 -_081545F0: - adds r0, r5, 0 - movs r1, 0x4 - bl FieldEffectStop - b _08154648 - .pool -_08154604: - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r2, r0, r1 - ldr r0, [r2, 0x10] - ldr r1, [r5, 0x30] - cmp r0, r1 - beq _08154624 - ldr r0, [r2, 0x14] - cmp r0, r1 - beq _08154624 - movs r0, 0x1 - strh r0, [r5, 0x3C] -_08154624: - movs r6, 0 - adds r0, r5, 0 - adds r0, 0x2B - ldrb r0, [r0] - cmp r0, 0 - bne _08154632 - movs r6, 0x4 -_08154632: - adds r0, r5, 0 - movs r1, 0 - bl sub_80979D4 - ldrh r1, [r5, 0x2E] - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - adds r2, r6, 0 - bl sub_81561FC -_08154648: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end unc_grass_normal - - thumb_func_start sub_8154658 -sub_8154658: @ 8154658 - push {r4,lr} - ldr r4, =0x02038c08 - adds r1, r4, 0x4 - adds r0, r4, 0 - movs r2, 0x8 - movs r3, 0xC - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x28] - movs r2, 0 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _081546B4 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x02020630 - adds r2, r0 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r3] - movs r0, 0x3 - ldrb r1, [r4, 0xC] - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x5] - ldr r0, [r4, 0x8] - strh r0, [r2, 0x2E] - movs r0, 0xC - strh r0, [r2, 0x30] -_081546B4: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8154658 - - thumb_func_start sub_81546C8 -sub_81546C8: @ 81546C8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, [sp, 0x18] - lsls r0, 24 - lsrs r0, 24 - mov r12, r0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - movs r5, 0 - ldr r0, =0x02020630 - mov r8, r0 - lsls r3, 16 - asrs r3, 16 - lsls r4, 16 - asrs r4, 16 -_081546EC: - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - mov r1, r8 - adds r2, r0, r1 - adds r0, r2, 0 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 31 - cmp r0, 0 - beq _08154740 - ldr r1, [r2, 0x1C] - ldr r0, =unc_grass_normal - cmp r1, r0 - bne _08154740 - movs r1, 0x30 - ldrsh r0, [r2, r1] - cmp r3, r0 - bne _08154740 - movs r1, 0x32 - ldrsh r0, [r2, r1] - cmp r4, r0 - bne _08154740 - ldrh r1, [r2, 0x34] - lsrs r0, r1, 8 - cmp r12, r0 - bne _08154740 - movs r0, 0xFF - ands r0, r1 - cmp r7, r0 - bne _08154740 - movs r1, 0x36 - ldrsh r0, [r2, r1] - cmp r6, r0 - bne _08154740 - adds r0, r5, 0 - b _0815474C - .pool -_08154740: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3F - bls _081546EC - movs r0, 0x40 -_0815474C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81546C8 - - thumb_func_start sub_8154758 -sub_8154758: @ 8154758 - push {r4,r5,lr} - sub sp, 0x4 - ldr r5, =0x02038c08 - ldrh r1, [r5] - mov r0, sp - strh r1, [r0] - ldrh r0, [r5, 0x4] - mov r4, sp - adds r4, 0x2 - strh r0, [r4] - mov r0, sp - adds r1, r4, 0 - movs r2, 0x8 - movs r3, 0x8 - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x3C] - mov r1, sp - movs r2, 0 - ldrsh r1, [r1, r2] - movs r3, 0 - ldrsh r2, [r4, r3] - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _081547E8 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r4, r0, r1 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] - ldrb r0, [r5, 0x8] - bl ZCoordToPriority - movs r1, 0x3 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r4, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x5] - ldr r0, [r5, 0x8] - strh r0, [r4, 0x2E] - ldr r0, [r5] - strh r0, [r4, 0x30] - ldr r0, [r5, 0x4] - strh r0, [r4, 0x32] - ldr r0, [r5, 0x10] - strh r0, [r4, 0x34] - ldr r0, [r5, 0x14] - strh r0, [r4, 0x36] - ldr r0, [r5, 0x18] - strh r0, [r4, 0x38] - ldr r0, [r5, 0x1C] - cmp r0, 0 - beq _081547E8 - adds r0, r4, 0 - movs r1, 0x6 - bl SeekObjectImageAnim -_081547E8: - movs r0, 0 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8154758 - - thumb_func_start unc_grass_tall -unc_grass_tall: @ 8154800 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r5, r0, 0 - ldrh r0, [r5, 0x38] - lsrs r7, r0, 8 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r3, =0x02037334 - ldrb r1, [r3] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815484C - ldr r0, =0x03005d8c - ldr r2, [r0] - movs r0, 0x5 - ldrsb r0, [r2, r0] - cmp r0, r7 - bne _08154832 - movs r0, 0x4 - ldrsb r0, [r2, r0] - cmp r0, r6 - beq _0815484C -_08154832: - ldr r1, [r3, 0x4] - ldrh r0, [r5, 0x30] - subs r0, r1 - strh r0, [r5, 0x30] - ldr r1, [r3, 0x8] - ldrh r0, [r5, 0x32] - subs r0, r1 - strh r0, [r5, 0x32] - ldrb r1, [r2, 0x5] - lsls r1, 8 - ldrb r0, [r2, 0x4] - orrs r0, r1 - strh r0, [r5, 0x38] -_0815484C: - ldrh r0, [r5, 0x34] - lsrs r1, r0, 8 - mov r8, r1 - lsls r0, 24 - lsrs r7, r0, 24 - ldrh r0, [r5, 0x36] - lsls r0, 24 - lsrs r6, r0, 24 - movs r2, 0x30 - ldrsh r0, [r5, r2] - movs r2, 0x32 - ldrsh r1, [r5, r2] - bl MapGridGetMetatileBehaviorAt - lsls r0, 24 - lsrs r4, r0, 24 - mov r0, r8 - adds r1, r7, 0 - adds r2, r6, 0 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _081548A0 - adds r0, r4, 0 - bl MetatileBehavior_IsLongGrass - lsls r0, 24 - cmp r0, 0 - beq _081548A0 - movs r1, 0x3C - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _081548B4 - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _081548B4 -_081548A0: - adds r0, r5, 0 - movs r1, 0x11 - bl FieldEffectStop - b _081548EA - .pool -_081548B4: - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02037350 - adds r2, r0, r1 - ldr r0, [r2, 0x10] - ldr r1, [r5, 0x30] - cmp r0, r1 - beq _081548D4 - ldr r0, [r2, 0x14] - cmp r0, r1 - beq _081548D4 - movs r0, 0x1 - strh r0, [r5, 0x3C] -_081548D4: - adds r0, r5, 0 - movs r1, 0 - bl sub_80979D4 - ldrh r1, [r5, 0x2E] - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - movs r2, 0 - bl sub_81561FC -_081548EA: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end unc_grass_tall - - thumb_func_start sub_81548FC -sub_81548FC: @ 81548FC - push {r4,lr} - ldr r4, =0x02038c08 - adds r1, r4, 0x4 - adds r0, r4, 0 - movs r2, 0x8 - movs r3, 0x8 - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x40] - movs r2, 0 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _08154958 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x02020630 - adds r2, r0 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r3] - movs r0, 0x3 - ldrb r1, [r4, 0xC] - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x5] - ldr r0, [r4, 0x8] - strh r0, [r2, 0x2E] - movs r0, 0x12 - strh r0, [r2, 0x30] -_08154958: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81548FC - - thumb_func_start sub_815496C -sub_815496C: @ 815496C - push {r4-r6,lr} - ldr r6, =0x02038c08 - ldrb r0, [r6] - ldrb r1, [r6, 0x4] - ldrb r2, [r6, 0x8] - bl GetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02037350 - adds r5, r1, r0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x78] - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _081549F8 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r4, =0x02020630 - adds r2, r4 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r3] - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x5] - movs r1, 0xC - ands r1, r0 - ldrb r3, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x5] - ldr r0, [r6] - strh r0, [r2, 0x2E] - ldr r0, [r6, 0x4] - strh r0, [r2, 0x30] - ldr r0, [r6, 0x8] - strh r0, [r2, 0x32] - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x20] - strh r0, [r2, 0x34] - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x22] - strh r0, [r2, 0x36] -_081549F8: - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_815496C - - thumb_func_start sub_8154A10 -sub_8154A10: @ 8154A10 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x30] - lsls r1, 24 - lsrs r1, 24 - ldrh r2, [r4, 0x32] - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _08154A4E - ldr r5, =0x02037350 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r5 - ldrb r0, [r1, 0x2] - lsls r0, 29 - cmp r0, 0 - blt _08154A5C -_08154A4E: - adds r0, r4, 0 - movs r1, 0x29 - bl FieldEffectStop - b _08154AF2 - .pool -_08154A5C: - ldrb r0, [r1, 0x5] - bl GetFieldObjectGraphicsInfo - mov r8, r0 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r6, r0, r1 - ldrh r5, [r6, 0x22] - ldrh r7, [r6, 0x20] - movs r0, 0x20 - ldrsh r1, [r6, r0] - movs r2, 0x34 - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _08154A98 - lsls r0, r5, 16 - asrs r0, 16 - movs r2, 0x36 - ldrsh r1, [r4, r2] - cmp r0, r1 - beq _08154AB2 -_08154A98: - strh r7, [r4, 0x34] - strh r5, [r4, 0x36] - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08154AB2 - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnim -_08154AB2: - strh r7, [r4, 0x20] - strh r5, [r4, 0x22] - mov r1, r8 - ldrh r0, [r1, 0xA] - lsls r0, 16 - asrs r0, 17 - subs r0, 0x8 - strh r0, [r4, 0x26] - adds r0, r6, 0 - adds r0, 0x43 - ldrb r0, [r0] - subs r0, 0x1 - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - ldrb r0, [r6, 0x5] - movs r1, 0xC - ands r1, r0 - ldrb r2, [r4, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x5] - adds r0, r6, 0 - adds r0, 0x3E - ldrb r1, [r0] - lsls r1, 29 - lsrs r1, 31 - adds r0, r4, 0 - bl sub_80979D4 -_08154AF2: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8154A10 - - thumb_func_start sub_8154B04 -sub_8154B04: @ 8154B04 - push {r4,lr} - ldr r4, =0x02038c08 - adds r1, r4, 0x4 - adds r0, r4, 0 - movs r2, 0x8 - movs r3, 0x8 - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x2C] - movs r2, 0 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - ldrb r3, [r4, 0x8] - bl AddObjectToBack - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _08154B62 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - adds r3, r0, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r3] - movs r1, 0x3 - ldrb r2, [r4, 0xC] - ands r2, r1 - lsls r2, 2 - ldrb r3, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r3 - orrs r1, r2 - strb r1, [r0, 0x5] - movs r1, 0xD - strh r1, [r0, 0x3C] - ldrb r1, [r4, 0x10] - bl StartObjectImageAnim -_08154B62: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8154B04 - - thumb_func_start sub_8154B78 -sub_8154B78: @ 8154B78 - push {r4,r5,lr} - ldr r4, =0x02038c08 - adds r1, r4, 0x4 - adds r0, r4, 0 - movs r2, 0x8 - movs r3, 0x8 - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x5C] - movs r2, 0 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - ldrb r3, [r4, 0x8] - bl AddObjectToBack - lsls r0, 24 - lsrs r1, r0, 24 - adds r5, r1, 0 - cmp r1, 0x40 - beq _08154BD8 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - adds r3, r0, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r3] - movs r1, 0x3 - ldrb r2, [r4, 0xC] - ands r2, r1 - lsls r2, 2 - ldrb r3, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r3 - orrs r1, r2 - strb r1, [r0, 0x5] - movs r1, 0x18 - strh r1, [r0, 0x3C] - ldrb r1, [r4, 0x10] - bl StartObjectImageAnim -_08154BD8: - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8154B78 - - thumb_func_start sub_8154BEC -sub_8154BEC: @ 8154BEC - push {r4,r5,lr} - ldr r4, =0x02038c08 - adds r1, r4, 0x4 - adds r0, r4, 0 - movs r2, 0x8 - movs r3, 0x8 - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x6C] - movs r2, 0 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - ldrb r3, [r4, 0x8] - bl AddObjectToBack - lsls r0, 24 - lsrs r1, r0, 24 - adds r5, r1, 0 - cmp r1, 0x40 - beq _08154C4C - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - adds r3, r0, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r3] - movs r1, 0x3 - ldrb r2, [r4, 0xC] - ands r2, r1 - lsls r2, 2 - ldrb r3, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r3 - orrs r1, r2 - strb r1, [r0, 0x5] - movs r1, 0x23 - strh r1, [r0, 0x3C] - ldrb r1, [r4, 0x10] - bl StartObjectImageAnim -_08154C4C: - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8154BEC - - thumb_func_start sub_8154C60 -sub_8154C60: @ 8154C60 - push {lr} - ldr r2, =gUnknown_085CDC4C - movs r3, 0x2E - ldrsh r1, [r0, r3] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8154C60 - - thumb_func_start sub_8154C7C -sub_8154C7C: @ 8154C7C - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x30] - adds r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x28 - ble _08154C92 - movs r0, 0x1 - strh r0, [r1, 0x2E] -_08154C92: - adds r0, r1, 0 - movs r1, 0 - bl sub_80979D4 - pop {r0} - bx r0 - thumb_func_end sub_8154C7C - - thumb_func_start sub_8154CA0 -sub_8154CA0: @ 8154CA0 - push {r4,lr} - adds r4, r0, 0 - 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] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - ldrb r1, [r3] - lsls r1, 29 - lsrs r1, 31 - adds r0, r4, 0 - bl sub_80979D4 - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0x38 - ble _08154CE4 - ldrh r1, [r4, 0x3C] - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldEffectStop -_08154CE4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8154CA0 - - thumb_func_start sub_8154CEC -sub_8154CEC: @ 8154CEC - push {r4-r6,lr} - ldr r6, =0x02038c08 - ldrb r0, [r6] - ldrb r1, [r6, 0x4] - ldrb r2, [r6, 0x8] - bl GetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02037350 - adds r5, r1, r0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x34] - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x40 - beq _08154D76 - ldrb r0, [r5, 0x5] - bl GetFieldObjectGraphicsInfo - lsls r3, r4, 4 - adds r3, r4 - lsls r3, 2 - ldr r4, =0x02020630 - adds r3, r4 - movs r1, 0x3E - adds r1, r3 - mov r12, r1 - ldrb r1, [r1] - movs r2, 0x2 - orrs r1, r2 - mov r2, r12 - strb r1, [r2] - ldrb r2, [r5, 0x4] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrb r1, [r1, 0x5] - movs r2, 0xC - ands r2, r1 - ldrb r4, [r3, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r4 - orrs r1, r2 - strb r1, [r3, 0x5] - ldr r1, [r6] - strh r1, [r3, 0x2E] - ldr r1, [r6, 0x4] - strh r1, [r3, 0x30] - ldr r1, [r6, 0x8] - strh r1, [r3, 0x32] - ldrh r0, [r0, 0xA] - lsls r0, 16 - asrs r0, 17 - subs r0, 0x4 - strh r0, [r3, 0x26] - movs r0, 0x46 - bl audio_play -_08154D76: - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8154CEC - - thumb_func_start sub_8154D90 -sub_8154D90: @ 8154D90 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - bne _08154DC0 - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x30] - lsls r1, 24 - lsrs r1, 24 - ldrh r2, [r4, 0x32] - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - beq _08154DCA -_08154DC0: - adds r0, r4, 0 - movs r1, 0xF - bl FieldEffectStop - b _08154E0A -_08154DCA: - ldr r3, =0x02020630 - ldr r2, =0x02037350 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0, 0x20] - strh r0, [r4, 0x20] - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0, 0x22] - strh r0, [r4, 0x22] - adds r0, r4, 0 - movs r1, 0 - bl sub_80979D4 -_08154E0A: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8154D90 - - thumb_func_start sub_8154E1C -sub_8154E1C: @ 8154E1C - push {r4,lr} - ldr r4, =0x02038c08 - adds r1, r4, 0x4 - adds r0, r4, 0 - movs r2, 0x8 - movs r3, 0xC - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x38] - movs r2, 0 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _08154E78 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x02020630 - adds r2, r0 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r3] - movs r0, 0x3 - ldrb r1, [r4, 0xC] - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x5] - ldr r0, [r4, 0x8] - strh r0, [r2, 0x2E] - movs r0, 0x10 - strh r0, [r2, 0x30] -_08154E78: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8154E1C - - thumb_func_start oei_water_drop_tall -oei_water_drop_tall: @ 8154E8C - push {r4,lr} - ldr r4, =0x02038c08 - adds r1, r4, 0x4 - adds r0, r4, 0 - movs r2, 0x8 - movs r3, 0x8 - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x30] - movs r2, 0 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _08154EE8 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x02020630 - adds r2, r0 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r3] - movs r0, 0x3 - ldrb r1, [r4, 0xC] - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x5] - ldr r0, [r4, 0x8] - strh r0, [r2, 0x2E] - movs r0, 0xE - strh r0, [r2, 0x30] -_08154EE8: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end oei_water_drop_tall - - thumb_func_start sub_8154EFC -sub_8154EFC: @ 8154EFC - push {r4-r7,lr} - ldr r7, =0x02038c08 - ldrb r0, [r7] - ldrb r1, [r7, 0x4] - ldrb r2, [r7, 0x8] - bl GetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02037350 - adds r6, r1, r0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x34] - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x40 - beq _08154F92 - ldrb r0, [r6, 0x5] - bl GetFieldObjectGraphicsInfo - adds r4, r0, 0 - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - ldr r3, =0x02020630 - adds r0, r3 - ldr r1, =sub_8154FB4 - str r1, [r0, 0x1C] - adds r5, r0, 0 - adds r5, 0x3E - ldrb r1, [r5] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r5] - ldrb r2, [r6, 0x4] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - ldrb r1, [r1, 0x5] - movs r2, 0xC - ands r2, r1 - ldrb r3, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r3 - orrs r1, r2 - strb r1, [r0, 0x5] - ldr r1, [r7] - strh r1, [r0, 0x2E] - ldr r1, [r7, 0x4] - strh r1, [r0, 0x30] - ldr r1, [r7, 0x8] - strh r1, [r0, 0x32] - ldr r1, =0x0000ffff - strh r1, [r0, 0x34] - movs r1, 0x1 - negs r1, r1 - strh r1, [r0, 0x36] - ldrh r1, [r4, 0xA] - lsls r1, 16 - asrs r1, 17 - subs r1, 0x4 - strh r1, [r0, 0x26] - movs r1, 0x1 - bl StartObjectImageAnim -_08154F92: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8154EFC - - thumb_func_start sub_8154FB4 -sub_8154FB4: @ 8154FB4 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x30] - lsls r1, 24 - lsrs r1, 24 - ldrh r2, [r4, 0x32] - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _08154FEE - ldr r2, =0x02037350 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r5, r0, r2 - ldrb r0, [r5, 0x2] - lsls r0, 28 - cmp r0, 0 - blt _08154FFC -_08154FEE: - adds r0, r4, 0 - movs r1, 0x22 - bl FieldEffectStop - b _08155046 - .pool -_08154FFC: - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - ldrh r1, [r0, 0x20] - strh r1, [r4, 0x20] - ldrh r1, [r0, 0x22] - strh r1, [r4, 0x22] - adds r0, 0x43 - ldrb r0, [r0] - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0 - bl sub_80979D4 - ldr r1, [r5, 0x10] - ldr r0, [r4, 0x34] - cmp r1, r0 - beq _08155046 - ldrh r0, [r5, 0x10] - strh r0, [r4, 0x34] - ldrh r0, [r5, 0x12] - strh r0, [r4, 0x36] - adds r0, r4, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _08155046 - movs r0, 0x46 - bl audio_play -_08155046: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8154FB4 - - thumb_func_start oei_ripples -oei_ripples: @ 8155054 - push {r4,lr} - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x14] - ldr r4, =0x02038c08 - movs r2, 0 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - ldrb r3, [r4, 0x8] - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _081550A0 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x02020630 - adds r2, r0 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r3] - movs r0, 0x3 - ldrb r1, [r4, 0xC] - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x5] - movs r0, 0x5 - strh r0, [r2, 0x2E] -_081550A0: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end oei_ripples - - thumb_func_start sub_81550B4 -sub_81550B4: @ 81550B4 - push {r4-r6,lr} - ldr r6, =0x02038c08 - ldrb r0, [r6] - ldrb r1, [r6, 0x4] - ldrb r2, [r6, 0x8] - bl GetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02037350 - adds r5, r1, r0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x7C] - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _08155140 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r4, =0x02020630 - adds r2, r4 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r3] - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x5] - movs r1, 0xC - ands r1, r0 - ldrb r3, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x5] - ldr r0, [r6] - strh r0, [r2, 0x2E] - ldr r0, [r6, 0x4] - strh r0, [r2, 0x30] - ldr r0, [r6, 0x8] - strh r0, [r2, 0x32] - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x20] - strh r0, [r2, 0x34] - ldrb r1, [r5, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x22] - strh r0, [r2, 0x36] -_08155140: - movs r0, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81550B4 - - thumb_func_start sub_8155158 -sub_8155158: @ 8155158 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x30] - lsls r1, 24 - lsrs r1, 24 - ldrh r2, [r4, 0x32] - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _08155192 - ldr r5, =0x02037350 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r5 - ldrb r0, [r1, 0x2] - lsls r0, 26 - cmp r0, 0 - blt _081551A0 -_08155192: - adds r0, r4, 0 - movs r1, 0x2A - bl FieldEffectStop - b _081551E4 - .pool -_081551A0: - ldrb r0, [r1, 0x5] - bl GetFieldObjectGraphicsInfo - mov r1, sp - ldrb r2, [r1] - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - adds r1, r5 - ldrb r2, [r1, 0x4] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - ldr r2, =0x02020630 - adds r1, r2 - ldrh r2, [r1, 0x20] - strh r2, [r4, 0x20] - ldrh r0, [r0, 0xA] - lsls r0, 16 - asrs r0, 17 - ldrh r2, [r1, 0x22] - adds r0, r2 - subs r0, 0x8 - strh r0, [r4, 0x22] - adds r1, 0x43 - ldrb r0, [r1] - subs r0, 0x1 - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0 - bl sub_80979D4 -_081551E4: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8155158 - - thumb_func_start sub_81551F0 -sub_81551F0: @ 81551F0 - push {r4,lr} - ldr r4, =0x02038c08 - adds r1, r4, 0x4 - adds r0, r4, 0 - movs r2, 0x8 - movs r3, 0x8 - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x44] - movs r2, 0 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - ldrb r3, [r4, 0x8] - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _08155248 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x02020630 - adds r2, r0 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r3] - movs r0, 0x3 - ldrb r1, [r4, 0xC] - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x5] - movs r0, 0x13 - strh r0, [r2, 0x2E] -_08155248: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81551F0 - - thumb_func_start sub_815525C -sub_815525C: @ 815525C - push {r4,lr} - ldr r4, =0x02038c08 - adds r1, r4, 0x4 - adds r0, r4, 0 - movs r2, 0x8 - movs r3, 0x8 - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x48] - movs r2, 0 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - ldrb r3, [r4, 0x8] - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _081552B4 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x02020630 - adds r2, r0 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r3] - movs r0, 0x3 - ldrb r1, [r4, 0xC] - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x5] - movs r0, 0x14 - strh r0, [r2, 0x2E] -_081552B4: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_815525C - - thumb_func_start sub_81552C8 -sub_81552C8: @ 81552C8 - push {r4,lr} - ldr r4, =0x02038c08 - adds r1, r4, 0x4 - adds r0, r4, 0 - movs r2, 0x8 - movs r3, 0x8 - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x4C] - movs r2, 0 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - ldrb r3, [r4, 0x8] - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _08155320 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x02020630 - adds r2, r0 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r3] - movs r0, 0x3 - ldrb r1, [r4, 0xC] - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x5] - movs r0, 0x15 - strh r0, [r2, 0x2E] -_08155320: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81552C8 - - thumb_func_start sub_8155334 -sub_8155334: @ 8155334 - push {r4,lr} - ldr r4, =0x02038c08 - adds r1, r4, 0x4 - adds r0, r4, 0 - movs r2, 0x8 - movs r3, 0x8 - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x50] - movs r2, 0 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - ldrb r3, [r4, 0x8] - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _0815538C - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x02020630 - adds r2, r0 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r3] - movs r0, 0x3 - ldrb r1, [r4, 0xC] - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x5] - movs r0, 0x16 - strh r0, [r2, 0x2E] -_0815538C: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8155334 - - thumb_func_start ash -ash: @ 81553A0 - push {r4,lr} - lsls r2, 16 - lsrs r2, 16 - ldr r4, =0x02038c08 - lsls r0, 16 - asrs r0, 16 - str r0, [r4] - lsls r1, 16 - asrs r1, 16 - str r1, [r4, 0x4] - movs r0, 0x52 - str r0, [r4, 0x8] - movs r0, 0x1 - str r0, [r4, 0xC] - str r2, [r4, 0x10] - lsls r3, 16 - asrs r3, 16 - str r3, [r4, 0x14] - movs r0, 0x7 - bl FieldEffectStart - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ash - - thumb_func_start oei_ash -oei_ash: @ 81553D4 - push {r4,r5,lr} - sub sp, 0x4 - ldr r5, =0x02038c08 - ldrh r1, [r5] - mov r0, sp - strh r1, [r0] - ldrh r0, [r5, 0x4] - mov r4, sp - adds r4, 0x2 - strh r0, [r4] - mov r0, sp - adds r1, r4, 0 - movs r2, 0x8 - movs r3, 0x8 - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x18] - mov r1, sp - movs r2, 0 - ldrsh r1, [r1, r2] - movs r3, 0 - ldrsh r2, [r4, r3] - ldrb r3, [r5, 0x8] - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _0815544A - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x02020630 - adds r2, r0 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r3] - movs r0, 0x3 - ldrb r1, [r5, 0xC] - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x5] - ldr r0, [r5] - strh r0, [r2, 0x30] - ldr r0, [r5, 0x4] - strh r0, [r2, 0x32] - ldr r0, [r5, 0x10] - strh r0, [r2, 0x34] - ldr r0, [r5, 0x14] - strh r0, [r2, 0x36] -_0815544A: - movs r0, 0 - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end oei_ash - - thumb_func_start sub_8155460 -sub_8155460: @ 8155460 - push {lr} - ldr r2, =gUnknown_085CDC54 - movs r3, 0x2E - ldrsh r1, [r0, r3] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8155460 - - thumb_func_start sub_815547C -sub_815547C: @ 815547C - push {lr} - adds r3, r0, 0 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - subs r2, 0x12 - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r3, 0x36] - subs r0, 0x1 - strh r0, [r3, 0x36] - lsls r0, 16 - cmp r0, 0 - bne _081554A6 - movs r0, 0x1 - strh r0, [r3, 0x2E] -_081554A6: - pop {r0} - bx r0 - thumb_func_end sub_815547C - - thumb_func_start sub_81554AC -sub_81554AC: @ 81554AC - push {r4,lr} - adds r4, r0, 0 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - subs r2, 0x12 - ldrb r1, [r2] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r2, 0x32 - ldrsh r1, [r4, r2] - ldrh r2, [r4, 0x34] - bl MapGridSetMetatileIdAt - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r2, 0x32 - ldrsh r1, [r4, r2] - bl CurrentMapDrawMetatileAt - ldr r2, =0x02037350 - ldr r0, =0x02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - movs r0, 0x2 - strh r0, [r4, 0x2E] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81554AC - - thumb_func_start sub_815550C -sub_815550C: @ 815550C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - bl sub_80979D4 - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0815552C - adds r0, r4, 0 - movs r1, 0x7 - bl FieldEffectStop -_0815552C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815550C - - thumb_func_start sub_8155534 -sub_8155534: @ 8155534 - push {r4,r5,lr} - ldr r4, =0x02038c08 - adds r1, r4, 0x4 - adds r0, r4, 0 - movs r2, 0x8 - movs r3, 0x8 - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x1C] - movs r2, 0 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - movs r3, 0x96 - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - cmp r0, 0x40 - beq _0815558E - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - adds r3, r1, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r3] - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - strb r0, [r1, 0x5] - ldr r0, [r4, 0x8] - strh r0, [r1, 0x32] - ldr r0, =0x0000ffff - strh r0, [r1, 0x34] - movs r0, 0x1 - negs r0, r0 - strh r0, [r1, 0x3A] - strh r0, [r1, 0x3C] -_0815558E: - movs r0, 0x8 - bl FieldEffectActiveListRemove - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8155534 - - thumb_func_start sub_81555AC -sub_81555AC: @ 81555AC - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - ldr r3, =0x02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - ldrh r0, [r2, 0x2E] - movs r3, 0x10 - negs r3, r3 - ands r3, r0 - movs r0, 0xF0 - lsls r0, 20 - ands r0, r1 - lsrs r0, 24 - orrs r0, r3 - strh r0, [r2, 0x2E] - bx lr - .pool - thumb_func_end sub_81555AC - - thumb_func_start sub_81555D8 -sub_81555D8: @ 81555D8 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - ldr r3, =0x02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - ldrh r0, [r2, 0x2E] - movs r3, 0xF1 - negs r3, r3 - ands r3, r0 - movs r0, 0xF0 - lsls r0, 20 - ands r0, r1 - lsrs r0, 20 - orrs r3, r0 - strh r3, [r2, 0x2E] - bx lr - .pool - thumb_func_end sub_81555D8 - - thumb_func_start sub_8155604 -sub_8155604: @ 8155604 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - ldr r4, =0x02020630 - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - adds r3, r4 - ldrh r0, [r3, 0x2E] - ldr r4, =0xfffff0ff - ands r4, r0 - movs r0, 0xF0 - lsls r0, 20 - ands r0, r1 - lsrs r0, 16 - orrs r4, r0 - strh r4, [r3, 0x2E] - strh r2, [r3, 0x30] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8155604 - - thumb_func_start sub_8155638 -sub_8155638: @ 8155638 - ldrh r1, [r0, 0x2E] - movs r0, 0xF - ands r0, r1 - bx lr - thumb_func_end sub_8155638 - - thumb_func_start sub_8155640 -sub_8155640: @ 8155640 - ldrh r1, [r0, 0x2E] - movs r0, 0xF0 - ands r0, r1 - lsrs r0, 4 - bx lr - thumb_func_end sub_8155640 - - thumb_func_start sub_815564C -sub_815564C: @ 815564C - ldrh r1, [r0, 0x2E] - movs r0, 0xF0 - lsls r0, 4 - ands r0, r1 - lsrs r0, 8 - bx lr - thumb_func_end sub_815564C - - thumb_func_start sub_8155658 -sub_8155658: @ 8155658 - push {r4-r6,lr} - adds r6, r0, 0 - movs r1, 0x32 - ldrsh r0, [r6, r1] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =0x02037350 - adds r4, r0 - ldrb r0, [r4, 0x4] - lsls r5, r0, 4 - adds r5, r0 - lsls r5, 2 - ldr r0, =0x02020630 - adds r5, r0 - adds r0, r4, 0 - adds r1, r6, 0 - bl sub_81556B0 - adds r0, r4, 0 - adds r1, r6, 0 - bl sub_81556E8 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - bl sub_815577C - ldrb r0, [r5, 0x5] - movs r1, 0xC - ands r1, r0 - ldrb r2, [r6, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r6, 0x5] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8155658 - - thumb_func_start sub_81556B0 -sub_81556B0: @ 81556B0 - push {r4,r5,lr} - sub sp, 0xC - adds r5, r0, 0 - adds r4, r1, 0 - ldr r1, =gUnknown_085CDC60 - mov r0, sp - movs r2, 0x9 - bl memcpy - adds r0, r4, 0 - bl sub_8155640 - lsls r0, 24 - cmp r0, 0 - bne _081556DC - ldrb r0, [r5, 0x18] - lsrs r0, 4 - add r0, sp - ldrb r1, [r0] - adds r0, r4, 0 - bl StartObjectImageAnimIfDifferent -_081556DC: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81556B0 - - thumb_func_start sub_81556E8 -sub_81556E8: @ 81556E8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r4, r1, 0 - ldrh r2, [r0, 0x10] - mov r1, sp - strh r2, [r1] - ldrh r1, [r0, 0x12] - mov r0, sp - adds r0, 0x2 - strh r1, [r0] - movs r2, 0x26 - ldrsh r3, [r4, r2] - mov r8, r0 - cmp r3, 0 - bne _08155770 - mov r0, sp - movs r5, 0 - ldrsh r2, [r0, r5] - movs r5, 0x3A - ldrsh r0, [r4, r5] - cmp r2, r0 - bne _08155724 - lsls r0, r1, 16 - asrs r0, 16 - movs r5, 0x3C - ldrsh r1, [r4, r5] - cmp r0, r1 - beq _08155770 -_08155724: - strh r3, [r4, 0x38] - strh r2, [r4, 0x3A] - mov r1, r8 - movs r2, 0 - ldrsh r0, [r1, r2] - strh r0, [r4, 0x3C] - movs r5, 0x1 - mov r7, r8 - mov r6, sp -_08155736: - adds r0, r5, 0 - mov r1, sp - adds r2, r7, 0 - bl MoveCoords - movs r1, 0 - ldrsh r0, [r6, r1] - movs r2, 0 - ldrsh r1, [r7, r2] - bl MapGridGetZCoordAt - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _0815575C - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - b _08155770 -_0815575C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldrh r0, [r4, 0x3A] - strh r0, [r6] - ldrh r0, [r4, 0x3C] - mov r1, r8 - strh r0, [r1] - cmp r5, 0x4 - bls _08155736 -_08155770: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81556E8 - - thumb_func_start sub_815577C -sub_815577C: @ 815577C - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r1, 0 - adds r4, r2, 0 - ldr r1, =gUnknown_085CDC6A - mov r0, sp - movs r2, 0x4 - bl memcpy - adds r0, r4, 0 - bl sub_8155638 - lsls r0, 24 - lsrs r0, 24 - adds r2, r0, 0 - cmp r2, 0 - beq _081557F6 - ldrh r1, [r4, 0x36] - adds r1, 0x1 - strh r1, [r4, 0x36] - movs r3, 0x38 - ldrsh r0, [r4, r3] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _081557BC - ldrh r0, [r4, 0x34] - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] -_081557BC: - ldrh r1, [r4, 0x36] - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - bne _081557CC - ldrh r0, [r4, 0x34] - negs r0, r0 - strh r0, [r4, 0x34] -_081557CC: - cmp r2, 0x2 - beq _081557F6 - adds r0, r4, 0 - bl sub_815564C - lsls r0, 24 - cmp r0, 0 - bne _081557E4 - ldrh r0, [r4, 0x26] - b _081557EA - .pool -_081557E4: - ldrh r0, [r4, 0x26] - ldrh r3, [r4, 0x30] - adds r0, r3 -_081557EA: - strh r0, [r5, 0x26] - ldrh r0, [r5, 0x20] - strh r0, [r4, 0x20] - ldrh r0, [r5, 0x22] - adds r0, 0x8 - strh r0, [r4, 0x22] -_081557F6: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815577C - - thumb_func_start sub_8155800 -sub_8155800: @ 8155800 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_082EC6AC - movs r1, 0 - movs r2, 0 - movs r3, 0xFF - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r1, =0x02020630 - adds r2, r1 - ldr r1, =sub_8155850 - str r1, [r2, 0x1C] - movs r1, 0x3E - adds r1, r2 - mov r12, r1 - ldrb r1, [r1] - movs r3, 0x4 - orrs r1, r3 - mov r3, r12 - strb r1, [r3] - strh r4, [r2, 0x2E] - movs r1, 0x1 - strh r1, [r2, 0x30] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8155800 - - thumb_func_start sub_8155850 -sub_8155850: @ 8155850 - push {lr} - adds r2, r0, 0 - movs r0, 0x2E - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r3, r0, r1 - ldrh r1, [r2, 0x32] - adds r0, r1, 0x1 - strh r0, [r2, 0x32] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _08155878 - ldrh r0, [r2, 0x30] - ldrh r1, [r3, 0x26] - adds r0, r1 - strh r0, [r3, 0x26] -_08155878: - ldrh r1, [r2, 0x32] - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - bne _08155888 - ldrh r0, [r2, 0x30] - negs r0, r0 - strh r0, [r2, 0x30] -_08155888: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8155850 - - thumb_func_start sub_8155890 -sub_8155890: @ 8155890 - push {r4,lr} - ldr r4, =0x02038c08 - adds r1, r4, 0x4 - adds r0, r4, 0 - movs r2, 0x8 - movs r3, 0xC - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x24] - movs r2, 0 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _081558EC - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x02020630 - adds r2, r0 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r3] - movs r0, 0x3 - ldrb r1, [r4, 0xC] - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x5] - ldr r0, [r4, 0x8] - strh r0, [r2, 0x2E] - movs r0, 0xA - strh r0, [r2, 0x30] -_081558EC: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8155890 - - thumb_func_start sub_8155900 -sub_8155900: @ 8155900 - push {r4-r7,lr} - ldr r7, =0x02038c08 - ldrb r0, [r7] - ldrb r1, [r7, 0x4] - ldrb r2, [r7, 0x8] - bl GetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02037350 - adds r6, r1, r0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x74] - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl AddObjectToBack - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x40 - beq _081559A4 - ldrb r0, [r6, 0x5] - bl GetFieldObjectGraphicsInfo - adds r5, r0, 0 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - adds r3, r0, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r3] - ldrb r2, [r6, 0x4] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrb r1, [r1, 0x5] - movs r2, 0xC - ands r2, r1 - ldrb r3, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r3 - orrs r1, r2 - strb r1, [r0, 0x5] - ldr r1, [r7] - strh r1, [r0, 0x2E] - ldr r1, [r7, 0x4] - strh r1, [r0, 0x30] - ldr r1, [r7, 0x8] - strh r1, [r0, 0x32] - ldrb r2, [r6, 0x4] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x20] - strh r1, [r0, 0x34] - ldrb r2, [r6, 0x4] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x22] - strh r1, [r0, 0x36] - ldrh r1, [r5, 0xA] - lsls r1, 16 - asrs r1, 17 - subs r1, 0x2 - strh r1, [r0, 0x26] - movs r1, 0x2 - bl SeekObjectImageAnim -_081559A4: - movs r0, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8155900 - - thumb_func_start sub_81559BC -sub_81559BC: @ 81559BC - push {r4-r6,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x30] - lsls r1, 24 - lsrs r1, 24 - ldrh r2, [r4, 0x32] - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - bne _081559F6 - ldr r2, =0x02037350 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - ldrb r0, [r1, 0x2] - lsls r0, 27 - cmp r0, 0 - blt _08155A04 -_081559F6: - adds r0, r4, 0 - movs r1, 0x27 - bl FieldEffectStop - b _08155A76 - .pool -_08155A04: - ldr r2, =0x02020630 - ldrb r1, [r1, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r5, [r0, 0x22] - ldrh r6, [r0, 0x20] - movs r2, 0x20 - ldrsh r1, [r0, r2] - movs r2, 0x34 - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _08155A2C - lsls r0, r5, 16 - asrs r0, 16 - movs r2, 0x36 - ldrsh r1, [r4, r2] - cmp r0, r1 - beq _08155A46 -_08155A2C: - strh r6, [r4, 0x34] - strh r5, [r4, 0x36] - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08155A46 - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnim -_08155A46: - strh r6, [r4, 0x20] - strh r5, [r4, 0x22] - ldr r3, =0x02020630 - ldr r2, =0x02037350 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x43 - ldrb r0, [r0] - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0 - bl sub_80979D4 -_08155A76: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81559BC - - thumb_func_start sub_8155A88 -sub_8155A88: @ 8155A88 - push {r4,lr} - ldr r4, =0x02038c08 - adds r1, r4, 0x4 - adds r0, r4, 0 - movs r2, 0x8 - movs r3, 0 - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - adds r0, 0x88 - ldr r0, [r0] - movs r2, 0 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - movs r3, 0x52 - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _08155AD8 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - adds r3, r1, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r3] - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1, 0x5] -_08155AD8: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8155A88 - - thumb_func_start sub_8155AEC -sub_8155AEC: @ 8155AEC - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x80 - movs r1, 0x80 - lsls r1, 1 - ands r0, r1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r4, 0x22] - subs r1, r0 - strh r1, [r4, 0x22] - adds r0, r4, 0 - movs r1, 0 - bl sub_80979D4 - ldrh r1, [r4, 0x3E] - ldr r0, =0x00001004 - ands r0, r1 - cmp r0, 0 - beq _08155B20 - adds r0, r4, 0 - movs r1, 0x35 - bl FieldEffectStop -_08155B20: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8155AEC - - thumb_func_start sub_8155B2C -sub_8155B2C: @ 8155B2C - push {r4,lr} - ldr r4, =0x02038c08 - adds r1, r4, 0x4 - adds r0, r4, 0 - movs r2, 0x8 - movs r3, 0x4 - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - ldr r0, [r0, 0x58] - movs r2, 0 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - ldrb r3, [r4, 0x8] - bl AddObjectToBack - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _08155B8C - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x02020630 - adds r2, r0 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r3] - movs r0, 0x3 - ldrb r1, [r4, 0xC] - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - orrs r0, r1 - movs r1, 0xF - ands r0, r1 - movs r1, 0x50 - orrs r0, r1 - strb r0, [r2, 0x5] - movs r0, 0x17 - strh r0, [r2, 0x2E] -_08155B8C: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8155B2C - - thumb_func_start ShowTreeDisguiseFieldEffect -@ u8 ShowTreeDisguiseFieldEffect() -ShowTreeDisguiseFieldEffect: @ 8155BA0 - push {lr} - movs r0, 0x1C - movs r1, 0x18 - movs r2, 0x4 - bl ShowDisguiseFieldEffect - pop {r1} - bx r1 - thumb_func_end ShowTreeDisguiseFieldEffect - - thumb_func_start ShowMountainDisguiseFieldEffect -@ u8 ShowMountainDisguiseFieldEffect() -ShowMountainDisguiseFieldEffect: @ 8155BB0 - push {lr} - movs r0, 0x1D - movs r1, 0x19 - movs r2, 0x3 - bl ShowDisguiseFieldEffect - pop {r1} - bx r1 - thumb_func_end ShowMountainDisguiseFieldEffect - - thumb_func_start ShowSandDisguiseFieldEffect -@ u8 ShowSandDisguiseFieldEffect() -ShowSandDisguiseFieldEffect: @ 8155BC0 - push {lr} - movs r0, 0x24 - movs r1, 0x1C - movs r2, 0x2 - bl ShowDisguiseFieldEffect - pop {r1} - bx r1 - thumb_func_end ShowSandDisguiseFieldEffect - - thumb_func_start ShowDisguiseFieldEffect -@ u8 ShowDisguiseFieldEffect(u8 fieldEffectId, u8 fieldEffectObjectId, u8 paletteSlot) -ShowDisguiseFieldEffect: @ 8155BD0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - mov r8, r4 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r2, 24 - lsrs r7, r2, 24 - ldr r5, =0x02038c08 - ldrb r0, [r5] - ldrb r1, [r5, 0x4] - ldrb r2, [r5, 0x8] - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - beq _08155C08 - adds r0, r4, 0 - bl FieldEffectActiveListRemove - movs r0, 0x40 - b _08155C74 - .pool -_08155C08: - ldr r1, =gFieldEffectObjectTemplatePointers - lsls r0, r6, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl AddObjectToBack - mov r1, sp - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _08155C70 - mov r0, sp - ldrb r0, [r0] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =0x02020630 - adds r2, r0 - movs r0, 0x3E - adds r0, r2 - mov r12, r0 - ldrb r3, [r0] - lsls r1, r3, 30 - lsrs r1, 31 - adds r1, 0x1 - movs r0, 0x1 - ands r1, r0 - lsls r1, 1 - movs r0, 0x3 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - lsls r3, r7, 4 - ldrb r1, [r2, 0x5] - movs r0, 0xF - ands r0, r1 - orrs r0, r3 - strb r0, [r2, 0x5] - mov r0, r8 - strh r0, [r2, 0x30] - ldr r0, [r5] - strh r0, [r2, 0x32] - ldr r0, [r5, 0x4] - strh r0, [r2, 0x34] - ldr r0, [r5, 0x8] - strh r0, [r2, 0x36] -_08155C70: - mov r0, sp - ldrb r0, [r0] -_08155C74: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end ShowDisguiseFieldEffect - - thumb_func_start sub_8155C88 -sub_8155C88: @ 8155C88 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - ldrh r0, [r5, 0x32] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r5, 0x34] - lsls r1, 24 - lsrs r1, 24 - ldrh r2, [r5, 0x36] - lsls r2, 24 - lsrs r2, 24 - mov r3, sp - bl TryGetFieldObjectIdByLocalIdAndMap - lsls r0, 24 - cmp r0, 0 - beq _08155CB8 - ldrh r1, [r5, 0x30] - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl FieldEffectStop -_08155CB8: - ldr r4, =0x02037350 - mov r0, sp - ldrb r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x5] - bl GetFieldObjectGraphicsInfo - mov r1, sp - ldrb r2, [r1] - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrb r1, [r1, 0x4] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - ldr r1, =0x02020630 - adds r2, r1 - adds r1, r2, 0 - adds r1, 0x3E - ldrb r1, [r1] - movs r3, 0x3E - adds r3, r5 - mov r12, r3 - movs r3, 0x4 - ands r3, r1 - mov r1, r12 - ldrb r4, [r1] - movs r1, 0x5 - negs r1, r1 - ands r1, r4 - orrs r1, r3 - mov r3, r12 - strb r1, [r3] - ldrh r1, [r2, 0x20] - strh r1, [r5, 0x20] - ldrh r0, [r0, 0xA] - lsls r0, 16 - asrs r0, 17 - ldrh r1, [r2, 0x22] - adds r0, r1 - subs r0, 0x10 - strh r0, [r5, 0x22] - adds r2, 0x43 - ldrb r0, [r2] - subs r0, 0x1 - adds r1, r5, 0 - adds r1, 0x43 - strb r0, [r1] - ldrh r1, [r5, 0x2E] - movs r2, 0x2E - ldrsh r0, [r5, r2] - cmp r0, 0x1 - bne _08155D38 - adds r0, r1, 0x1 - strh r0, [r5, 0x2E] - adds r0, r5, 0 - movs r1, 0x1 - bl StartObjectImageAnim -_08155D38: - movs r3, 0x2E - ldrsh r0, [r5, r3] - ldrh r2, [r5, 0x2E] - cmp r0, 0x2 - bne _08155D54 - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08155D54 - movs r0, 0x1 - strh r0, [r5, 0x3C] -_08155D54: - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, 0x3 - bne _08155D68 - ldrh r1, [r5, 0x30] - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl FieldEffectStop -_08155D68: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8155C88 - - thumb_func_start sub_8155D78 -sub_8155D78: @ 8155D78 - push {lr} - adds r1, r0, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08155D96 - ldr r2, =0x02020630 - ldrb r1, [r1, 0x1A] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x2E] - adds r1, 0x1 - strh r1, [r0, 0x2E] -_08155D96: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8155D78 - - thumb_func_start sub_8155DA0 -sub_8155DA0: @ 8155DA0 - push {lr} - adds r2, r0, 0 - adds r2, 0x21 - ldrb r1, [r2] - cmp r1, 0x2 - beq _08155DD6 - cmp r1, 0 - beq _08155DD6 - ldrb r1, [r0, 0x1A] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r1, r0, r1 - movs r3, 0x3C - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _08155DCC - movs r0, 0 - b _08155DD8 - .pool -_08155DCC: - movs r0, 0x2 - strb r0, [r2] - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] -_08155DD6: - movs r0, 0x1 -_08155DD8: - pop {r1} - bx r1 - thumb_func_end sub_8155DA0 - - thumb_func_start sub_8155DDC -sub_8155DDC: @ 8155DDC - push {r4,lr} - ldr r4, =0x02038c08 - ldr r0, [r4] - adds r0, 0x7 - str r0, [r4] - ldr r0, [r4, 0x4] - adds r0, 0x7 - str r0, [r4, 0x4] - adds r1, r4, 0x4 - adds r0, r4, 0 - movs r2, 0x8 - movs r3, 0x8 - bl sub_80930E0 - ldr r0, =gFieldEffectObjectTemplatePointers - adds r0, 0x8C - ldr r0, [r0] - movs r2, 0 - ldrsh r1, [r4, r2] - movs r3, 0x4 - ldrsh r2, [r4, r3] - movs r3, 0x52 - bl AddObjectToBack - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - beq _08155E3C - ldr r0, =0x02020630 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - movs r0, 0x3 - ldrb r2, [r4, 0x8] - 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] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x2 - orrs r0, r2 - strb r0, [r1] -_08155E3C: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8155DDC - - thumb_func_start sub_8155E50 -sub_8155E50: @ 8155E50 - push {lr} - adds r2, r0, 0 - movs r1, 0x2E - ldrsh r0, [r2, r1] - cmp r0, 0 - bne _08155E84 - adds r0, r2, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08155E7C - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r3] - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] -_08155E7C: - movs r1, 0x2E - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _08155E9A -_08155E84: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x22 - ble _08155E9A - adds r0, r2, 0 - movs r1, 0x36 - bl FieldEffectStop -_08155E9A: - pop {r0} - bx r0 - thumb_func_end sub_8155E50 - - thumb_func_start sub_8155EA0 -sub_8155EA0: @ 8155EA0 - movs r1, 0 - strh r1, [r0, 0x3A] - strh r1, [r0, 0x3C] - bx lr - thumb_func_end sub_8155EA0 - - thumb_func_start sub_8155EA8 -sub_8155EA8: @ 8155EA8 - push {r4-r6,lr} - adds r5, r0, 0 - movs r6, 0 - movs r1, 0x3C - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _08155EDE - cmp r0, 0x1 - bgt _08155EC0 - cmp r0, 0 - beq _08155ECA - b _08155F42 -_08155EC0: - cmp r0, 0x2 - beq _08155F06 - cmp r0, 0x3 - beq _08155F1A - b _08155F42 -_08155ECA: - movs r2, 0x3A - ldrsh r0, [r5, r2] - bl sub_809773C - ldrh r1, [r5, 0x24] - adds r0, r1 - strh r0, [r5, 0x24] - movs r2, 0x3A - ldrsh r0, [r5, r2] - b _08155F38 -_08155EDE: - ldrh r0, [r5, 0x3A] - movs r4, 0x47 - subs r0, r4, r0 - lsls r0, 16 - asrs r0, 16 - bl sub_809773C - ldrh r1, [r5, 0x24] - subs r1, r0 - strh r1, [r5, 0x24] - ldrh r0, [r5, 0x3A] - subs r4, r0 - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 - bl sub_8097728 - ldrh r2, [r5, 0x26] - adds r0, r2 - b _08155F40 -_08155F06: - movs r1, 0x3A - ldrsh r0, [r5, r1] - bl sub_809773C - ldrh r1, [r5, 0x24] - subs r1, r0 - strh r1, [r5, 0x24] - movs r2, 0x3A - ldrsh r0, [r5, r2] - b _08155F38 -_08155F1A: - ldrh r0, [r5, 0x3A] - movs r4, 0x47 - subs r0, r4, r0 - lsls r0, 16 - asrs r0, 16 - bl sub_809773C - ldrh r2, [r5, 0x24] - adds r0, r2 - strh r0, [r5, 0x24] - ldrh r0, [r5, 0x3A] - subs r4, r0 - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 -_08155F38: - bl sub_8097728 - ldrh r1, [r5, 0x26] - adds r0, r1 -_08155F40: - strh r0, [r5, 0x26] -_08155F42: - ldrh r1, [r5, 0x24] - negs r1, r1 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x10 - bl SetGpuReg - ldrh r0, [r5, 0x3A] - adds r0, 0x1 - movs r1, 0 - strh r0, [r5, 0x3A] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x48 - bne _08155F68 - strh r1, [r5, 0x3A] - ldrh r0, [r5, 0x3C] - adds r0, 0x1 - strh r0, [r5, 0x3C] -_08155F68: - movs r2, 0x3C - ldrsh r0, [r5, r2] - cmp r0, 0x4 - bne _08155F76 - strh r1, [r5, 0x26] - strh r1, [r5, 0x24] - movs r6, 0x1 -_08155F76: - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8155EA8 - - thumb_func_start sub_8155F80 -sub_8155F80: @ 8155F80 - push {r4-r7,lr} - adds r5, r0, 0 - movs r1, 0x32 - ldrsh r0, [r5, r1] - cmp r0, 0x8 - bls _08155F8E - b _08156156 -_08155F8E: - lsls r0, 2 - ldr r1, =_08155F9C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08155F9C: - .4byte _08155FC0 - .4byte _08156034 - .4byte _0815606C - .4byte _08156090 - .4byte _081560C0 - .4byte _081560D4 - .4byte _081560E0 - .4byte _0815610E - .4byte _08156120 -_08155FC0: - movs r2, 0x2E - ldrsh r0, [r5, r2] - movs r1, 0x3 - bl __divsi3 - movs r1, 0x78 - subs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x12 - bl SetGpuReg - movs r3, 0x2E - ldrsh r0, [r5, r3] - cmp r0, 0x60 - bne _08156016 - movs r1, 0 - ldr r4, =0x0600f800 - mov r12, r4 - ldr r0, =0x0000bff4 - adds r7, r0, 0 -_08155FEA: - movs r2, 0xC - lsls r0, r1, 1 - adds r3, r1, 0x1 - lsls r6, r1, 5 - adds r0, r1 - lsls r4, r0, 1 -_08155FF6: - adds r0, r6, r2 - lsls r0, 1 - add r0, r12 - adds r1, r2, r7 - adds r1, r4, r1 - adds r1, 0x1 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x11 - bls _08155FF6 - lsls r0, r3, 24 - lsrs r1, r0, 24 - cmp r1, 0x2 - bls _08155FEA -_08156016: - movs r2, 0x2E - ldrsh r1, [r5, r2] - ldr r0, =0x00000137 - cmp r1, r0 - bgt _08156022 - b _08156156 -_08156022: - movs r1, 0 - movs r0, 0x1 - b _0815611A - .pool -_08156034: - ldr r4, =gUnknown_08329F40 - movs r3, 0x2E - ldrsh r0, [r5, r3] - movs r1, 0x3 - bl __divsi3 - lsls r0, 16 - asrs r0, 15 - adds r0, r4 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 18 - ldrh r4, [r5, 0x36] - adds r0, r4 - movs r1, 0 - strh r0, [r5, 0x22] - movs r2, 0x2E - ldrsh r0, [r5, r2] - cmp r0, 0xBD - bne _08156156 - movs r0, 0x2 - strh r0, [r5, 0x32] - strh r1, [r5, 0x38] - strh r1, [r5, 0x2E] - b _08156156 - .pool -_0815606C: - movs r3, 0x2E - ldrsh r0, [r5, r3] - cmp r0, 0x3C - bne _0815607E - ldrh r0, [r5, 0x38] - adds r0, 0x1 - movs r1, 0 - strh r0, [r5, 0x38] - strh r1, [r5, 0x2E] -_0815607E: - movs r4, 0x38 - ldrsh r0, [r5, r4] - cmp r0, 0x7 - bne _08156156 - movs r0, 0 - strh r0, [r5, 0x38] - movs r0, 0x3 - strh r0, [r5, 0x32] - b _08156156 -_08156090: - ldrh r2, [r5, 0x26] - movs r0, 0x26 - ldrsh r1, [r5, r0] - adds r3, r2, 0 - cmp r1, 0 - bne _081560A4 - strh r1, [r5, 0x2E] - ldrh r0, [r5, 0x32] - adds r0, 0x1 - strh r0, [r5, 0x32] -_081560A4: - movs r4, 0x2E - ldrsh r0, [r5, r4] - cmp r0, 0x5 - bne _08156156 - movs r0, 0 - strh r0, [r5, 0x2E] - cmp r1, 0 - ble _081560BA - subs r0, r3, 0x1 - strh r0, [r5, 0x26] - b _08156156 -_081560BA: - adds r0, r2, 0x1 - strh r0, [r5, 0x26] - b _08156156 -_081560C0: - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0x3C - bne _08156156 - movs r1, 0 - movs r0, 0x5 - strh r0, [r5, 0x32] - strh r1, [r5, 0x2E] - strh r1, [r5, 0x38] - b _08156156 -_081560D4: - adds r0, r5, 0 - bl sub_8155EA0 - movs r1, 0 - movs r0, 0x6 - b _0815611A -_081560E0: - adds r0, r5, 0 - bl sub_8155EA8 - lsls r0, 24 - cmp r0, 0 - beq _08156156 - movs r1, 0 - strh r1, [r5, 0x2E] - ldrh r0, [r5, 0x38] - adds r0, 0x1 - strh r0, [r5, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bgt _08156106 - adds r0, r5, 0 - bl sub_8155EA0 - b _08156156 -_08156106: - strh r1, [r5, 0x38] - movs r0, 0x7 - strh r0, [r5, 0x32] - b _08156156 -_0815610E: - movs r2, 0x2E - ldrsh r0, [r5, r2] - cmp r0, 0x1E - bne _08156156 - movs r1, 0 - movs r0, 0x8 -_0815611A: - strh r0, [r5, 0x32] - strh r1, [r5, 0x2E] - b _08156156 -_08156120: - movs r1, 0 - ldr r6, =0x0600f800 - movs r4, 0 -_08156126: - movs r2, 0xC - adds r3, r1, 0x1 - lsls r1, 5 -_0815612C: - adds r0, r1, r2 - lsls r0, 1 - adds r0, r6 - strh r4, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x11 - bls _0815612C - lsls r0, r3, 24 - lsrs r1, r0, 24 - cmp r1, 0xE - bls _08156126 - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - adds r0, r5, 0 - movs r1, 0x40 - bl FieldEffectStop -_08156156: - movs r3, 0x32 - ldrsh r0, [r5, r3] - cmp r0, 0x1 - bne _08156184 - ldrh r1, [r5, 0x30] - movs r0, 0x7 - ands r0, r1 - adds r2, r1, 0 - cmp r0, 0 - bne _08156172 - ldrh r0, [r5, 0x34] - ldrh r4, [r5, 0x26] - adds r0, r4 - strh r0, [r5, 0x26] -_08156172: - movs r0, 0xF - ands r0, r2 - cmp r0, 0 - bne _08156180 - ldrh r0, [r5, 0x34] - negs r0, r0 - strh r0, [r5, 0x34] -_08156180: - adds r0, r1, 0x1 - strh r0, [r5, 0x30] -_08156184: - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8155F80 - - thumb_func_start sub_8156194 -sub_8156194: @ 8156194 - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _081561B2 - ldrh r1, [r4, 0x30] - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FieldEffectStop - b _081561C8 -_081561B2: - adds r0, r4, 0 - movs r1, 0 - bl sub_80979D4 - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - movs r2, 0 - bl SetObjectSubpriorityByZCoord -_081561C8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8156194 - - thumb_func_start sub_81561D0 -sub_81561D0: @ 81561D0 - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _081561EE - ldrh r1, [r2, 0x2E] - lsls r1, 24 - lsrs r1, 24 - adds r0, r2, 0 - bl FieldEffectStop - b _081561F6 -_081561EE: - adds r0, r2, 0 - movs r1, 0 - bl sub_80979D4 -_081561F6: - pop {r0} - bx r0 - thumb_func_end sub_81561D0 - - thumb_func_start sub_81561FC -sub_81561FC: @ 81561FC - push {r4-r7,lr} - adds r6, r0, 0 - adds r0, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - adds r1, r6, 0 - bl SetObjectSubpriorityByZCoord - movs r7, 0 -_08156212: - lsls r0, r7, 3 - adds r0, r7 - lsls r0, 2 - ldr r1, =0x02037350 - adds r4, r0, r1 - ldrb r0, [r4] - lsls r0, 31 - cmp r0, 0 - beq _081562B4 - ldrb r0, [r4, 0x5] - bl GetFieldObjectGraphicsInfo - ldrb r1, [r4, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r5, r0, r1 - adds r0, r6, 0 - adds r0, 0x28 - movs r2, 0 - ldrsb r2, [r0, r2] - ldrh r0, [r6, 0x20] - adds r1, r0, r2 - subs r0, r2 - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x20 - ldrsh r2, [r5, r0] - cmp r1, r2 - bge _081562B4 - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, r2 - ble _081562B4 - adds r0, r5, 0 - adds r0, 0x29 - movs r3, 0 - ldrsb r3, [r0, r3] - ldrh r2, [r5, 0x22] - adds r2, r3 - ldrh r4, [r5, 0x22] - adds r0, r6, 0 - adds r0, 0x29 - movs r1, 0 - ldrsb r1, [r0, r1] - ldrh r0, [r6, 0x22] - subs r0, r1 - lsls r0, 16 - asrs r0, 16 - adds r3, r0, r3 - lsls r2, 16 - asrs r2, 16 - lsls r3, 16 - asrs r3, 16 - cmp r2, r3 - blt _0815628C - cmp r2, r0 - bge _081562B4 -_0815628C: - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, r3 - ble _081562B4 - adds r2, r6, 0 - adds r2, 0x43 - adds r0, r5, 0 - adds r0, 0x43 - ldrb r1, [r0] - ldrb r0, [r2] - cmp r0, r1 - bhi _081562B4 - adds r0, r1, 0x2 - strb r0, [r2] - b _081562BE - .pool -_081562B4: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0xF - bls _08156212 -_081562BE: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81561FC - - thumb_func_start sub_81562C4 -sub_81562C4: @ 81562C4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r0, [r0, 0xC] - movs r1, 0 - movs r2, 0x44 - bl memset - movs r1, 0 - movs r3, 0x64 - adds r2, r4, 0 -_081562DE: - ldr r0, [r4] - ldr r0, [r0, 0xC] - adds r0, 0x5 - adds r0, r1 - strb r3, [r0] - adds r1, 0x1 - cmp r1, 0x3 - ble _081562DE - ldr r0, [r2] - ldr r0, [r0, 0xC] - adds r0, 0x41 - movs r1, 0 - strb r5, [r0] - ldr r0, [r2] - ldr r0, [r0, 0xC] - adds r0, 0x40 - strb r1, [r0] - ldr r0, [r2] - ldr r2, [r0, 0xC] - ldr r1, =0x02039e00 - adds r0, r2, 0 - adds r0, 0x41 - ldrb r0, [r0] - lsls r0, 6 - adds r1, 0x18 - adds r0, r1 - ldr r0, [r0] - str r0, [r2, 0x14] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81562C4 - - thumb_func_start sub_8156324 -sub_8156324: @ 8156324 - push {r4-r6,lr} - ldr r1, =0x02039f34 - ldr r0, [r1] - ldr r0, [r0, 0xC] - ldr r0, [r0, 0x14] - cmp r0, 0 - beq _0815636A - adds r4, r1, 0 - movs r5, 0 -_08156336: - ldr r0, [r4] - ldr r2, [r0, 0xC] - ldr r0, [r2, 0x14] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815634A - strb r5, [r2] - bl sub_81563B0 -_0815634A: - ldr r0, [r4] - ldr r1, [r0, 0xC] - ldr r0, [r1, 0x14] - lsrs r0, 1 - str r0, [r1, 0x14] - ldrb r0, [r1, 0x10] - adds r0, 0x1 - strb r0, [r1, 0x10] - ldr r0, [r4] - ldr r0, [r0, 0xC] - strb r5, [r0, 0x4] - ldr r0, [r4] - ldr r0, [r0, 0xC] - ldr r0, [r0, 0x14] - cmp r0, 0 - bne _08156336 -_0815636A: - movs r6, 0x3 -_0815636C: - bl GenerateRandomNumber - adds r5, r0, 0 - ands r5, r6 - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r1, [r0, 0xC] - adds r0, r1, 0x5 - adds r0, r5 - ldrb r3, [r0] - movs r2, 0 - ldrb r1, [r1, 0x5] - cmp r3, r1 - bcc _0815639E - adds r1, r4, 0 -_0815638A: - adds r2, 0x1 - cmp r2, 0x3 - bgt _0815639E - ldr r0, [r1] - ldr r0, [r0, 0xC] - adds r0, 0x5 - adds r0, r2 - ldrb r0, [r0] - cmp r3, r0 - bcs _0815638A -_0815639E: - cmp r2, 0x4 - bne _0815636C - adds r0, r5, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8156324 - - thumb_func_start sub_81563B0 -sub_81563B0: @ 81563B0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r5, =0x02039f34 - ldr r0, [r5] - ldr r0, [r0, 0xC] - ldrb r0, [r0] - adds r4, r5, 0 - cmp r0, 0x2 - beq _081564A0 - adds r7, r5, 0 - ldr r6, =0x0203ab38 - ldr r0, =0x02039e1e - mov r8, r0 -_081563CC: - ldr r0, [r7] - ldr r2, [r0, 0xC] - ldrb r0, [r2] - cmp r0, 0x1 - beq _08156426 - cmp r0, 0x1 - bgt _08156496 - cmp r0, 0 - bne _08156496 - ldr r1, =gContestAIs - ldrb r0, [r2, 0x10] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [r6] - ldrb r1, [r2, 0x4] - lsls r1, 1 - adds r0, r2, 0 - adds r0, 0x41 - ldrb r0, [r0] - lsls r0, 6 - adds r1, r0 - add r1, r8 - ldrh r1, [r1] - adds r0, r1, 0 - cmp r0, 0 - bne _08156418 - strh r0, [r2, 0x2] - b _0815641A - .pool -_08156418: - strh r1, [r2, 0x2] -_0815641A: - ldr r0, [r4] - ldr r1, [r0, 0xC] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08156496 -_08156426: - ldrh r1, [r2, 0x2] - cmp r1, 0 - beq _08156444 - ldr r1, =gUnknown_085CDD00 - ldr r0, [r6] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - b _08156458 - .pool -_08156444: - adds r0, r2, 0x5 - ldrb r2, [r2, 0x4] - adds r0, r2 - strb r1, [r0] - ldr r0, [r7] - ldr r2, [r0, 0xC] - ldrb r1, [r2, 0x9] - movs r0, 0x1 - orrs r0, r1 - strb r0, [r2, 0x9] -_08156458: - ldr r2, =0x02039f34 - ldr r0, [r2] - ldr r3, [r0, 0xC] - ldrb r1, [r3, 0x9] - movs r0, 0x1 - ands r0, r1 - adds r4, r2, 0 - cmp r0, 0 - beq _08156496 - ldrb r0, [r3, 0x4] - adds r0, 0x1 - movs r2, 0 - strb r0, [r3, 0x4] - ldr r0, [r4] - ldr r1, [r0, 0xC] - ldrb r0, [r1, 0x4] - cmp r0, 0x3 - bhi _08156484 - strb r2, [r1] - b _0815648A - .pool -_08156484: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0815648A: - ldr r0, [r4] - ldr r2, [r0, 0xC] - ldrb r1, [r2, 0x9] - movs r0, 0xFE - ands r0, r1 - strb r0, [r2, 0x9] -_08156496: - ldr r0, [r5] - ldr r0, [r0, 0xC] - ldrb r0, [r0] - cmp r0, 0x2 - bne _081563CC -_081564A0: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81563B0 - - thumb_func_start sub_81564AC -sub_81564AC: @ 81564AC - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0 - ldr r3, =0x02039f34 - ldr r0, [r3] - ldr r0, [r0, 0x8] - b _081564CC - .pool -_081564C0: - adds r1, 0x1 - cmp r1, 0x3 - bgt _081564D2 - ldr r0, [r3] - ldr r0, [r0, 0x8] - adds r0, r1 -_081564CC: - ldrb r0, [r0] - cmp r0, r2 - bne _081564C0 -_081564D2: - lsls r0, r1, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_81564AC - - thumb_func_start sub_81564DC -sub_81564DC: @ 81564DC - push {r4,lr} - ldr r3, =0x02039f34 - ldr r0, [r3] - ldr r0, [r0, 0xC] - adds r1, r0, 0x5 - ldrb r0, [r0, 0x4] - adds r1, r0 - ldr r2, =0x0203ab38 - ldr r0, [r2] - ldrb r0, [r0, 0x1] - lsls r0, 24 - asrs r0, 24 - ldrb r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _08156510 - movs r4, 0xFF - b _08156516 - .pool -_08156510: - cmp r0, 0 - bge _08156516 - movs r4, 0 -_08156516: - ldr r0, [r3] - ldr r1, [r0, 0xC] - adds r0, r1, 0x5 - ldrb r1, [r1, 0x4] - adds r0, r1 - strb r4, [r0] - ldr r0, [r2] - adds r0, 0x2 - str r0, [r2] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81564DC - - thumb_func_start sub_8156530 -sub_8156530: @ 8156530 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0xC] - ldr r0, [r0] - ldrb r0, [r0, 0x1] - strh r0, [r1, 0x18] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8156530 - - thumb_func_start sub_8156550 -sub_8156550: @ 8156550 - push {lr} - bl sub_8156530 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bge _0815658C - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08156590 - .pool -_0815658C: - adds r0, r2, 0x5 - str r0, [r3] -_08156590: - pop {r0} - bx r0 - thumb_func_end sub_8156550 - - thumb_func_start sub_8156594 -sub_8156594: @ 8156594 - push {lr} - bl sub_8156530 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - ble _081565D0 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081565D4 - .pool -_081565D0: - adds r0, r2, 0x5 - str r0, [r3] -_081565D4: - pop {r0} - bx r0 - thumb_func_end sub_8156594 - - thumb_func_start sub_81565D8 -sub_81565D8: @ 81565D8 - push {lr} - bl sub_8156530 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bne _08156614 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08156618 - .pool -_08156614: - adds r0, r2, 0x5 - str r0, [r3] -_08156618: - pop {r0} - bx r0 - thumb_func_end sub_81565D8 - - thumb_func_start sub_815661C -sub_815661C: @ 815661C - push {lr} - bl sub_8156530 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - beq _08156658 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0815665C - .pool -_08156658: - adds r0, r2, 0x5 - str r0, [r3] -_0815665C: - pop {r0} - bx r0 - thumb_func_end sub_815661C - - thumb_func_start sub_8156660 -sub_8156660: @ 8156660 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0xC] - ldr r0, [r0] - ldrb r0, [r0, 0x13] - lsls r0, 24 - asrs r0, 24 - strh r0, [r1, 0x18] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8156660 - - thumb_func_start sub_8156684 -sub_8156684: @ 8156684 - push {lr} - bl sub_8156660 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bge _081566C0 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081566C4 - .pool -_081566C0: - adds r0, r2, 0x5 - str r0, [r3] -_081566C4: - pop {r0} - bx r0 - thumb_func_end sub_8156684 - - thumb_func_start sub_81566C8 -sub_81566C8: @ 81566C8 - push {lr} - bl sub_8156660 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - ble _08156704 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08156708 - .pool -_08156704: - adds r0, r2, 0x5 - str r0, [r3] -_08156708: - pop {r0} - bx r0 - thumb_func_end sub_81566C8 - - thumb_func_start sub_815670C -sub_815670C: @ 815670C - push {lr} - bl sub_8156660 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bne _08156748 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0815674C - .pool -_08156748: - adds r0, r2, 0x5 - str r0, [r3] -_0815674C: - pop {r0} - bx r0 - thumb_func_end sub_815670C - - thumb_func_start sub_8156750 -sub_8156750: @ 8156750 - push {lr} - bl sub_8156660 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - beq _0815678C - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08156790 - .pool -_0815678C: - adds r0, r2, 0x5 - str r0, [r3] -_08156790: - pop {r0} - bx r0 - thumb_func_end sub_8156750 - - thumb_func_start sub_8156794 -sub_8156794: @ 8156794 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0xC] - ldr r0, [r0, 0x8] - adds r1, r2, 0 - adds r1, 0x41 - ldrb r1, [r1] - adds r0, r1 - ldrb r0, [r0] - strh r0, [r2, 0x18] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8156794 - - thumb_func_start sub_81567BC -sub_81567BC: @ 81567BC - push {lr} - bl sub_8156794 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bge _081567F8 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081567FC - .pool -_081567F8: - adds r0, r2, 0x5 - str r0, [r3] -_081567FC: - pop {r0} - bx r0 - thumb_func_end sub_81567BC - - thumb_func_start sub_8156800 -sub_8156800: @ 8156800 - push {lr} - bl sub_8156794 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - ble _0815683C - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08156840 - .pool -_0815683C: - adds r0, r2, 0x5 - str r0, [r3] -_08156840: - pop {r0} - bx r0 - thumb_func_end sub_8156800 - - thumb_func_start sub_8156844 -sub_8156844: @ 8156844 - push {lr} - bl sub_8156794 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bne _08156880 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08156884 - .pool -_08156880: - adds r0, r2, 0x5 - str r0, [r3] -_08156884: - pop {r0} - bx r0 - thumb_func_end sub_8156844 - - thumb_func_start sub_8156888 -sub_8156888: @ 8156888 - push {lr} - bl sub_8156794 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - beq _081568C4 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081568C8 - .pool -_081568C4: - adds r0, r2, 0x5 - str r0, [r3] -_081568C8: - pop {r0} - bx r0 - thumb_func_end sub_8156888 - - thumb_func_start sub_81568CC -sub_81568CC: @ 81568CC - push {r4,lr} - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r4, [r0, 0xC] - adds r1, r4, 0 - adds r1, 0x41 - ldrb r1, [r1] - ldr r2, [r0, 0x4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0xD] - lsls r0, 24 - asrs r0, 24 - movs r1, 0xA - bl __divsi3 - lsls r0, 24 - asrs r0, 24 - strh r0, [r4, 0x18] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81568CC - - thumb_func_start sub_815690C -sub_815690C: @ 815690C - push {lr} - bl sub_81568CC - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bge _08156948 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0815694C - .pool -_08156948: - adds r0, r2, 0x5 - str r0, [r3] -_0815694C: - pop {r0} - bx r0 - thumb_func_end sub_815690C - - thumb_func_start sub_8156950 -sub_8156950: @ 8156950 - push {lr} - bl sub_81568CC - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - ble _0815698C - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08156990 - .pool -_0815698C: - adds r0, r2, 0x5 - str r0, [r3] -_08156990: - pop {r0} - bx r0 - thumb_func_end sub_8156950 - - thumb_func_start sub_8156994 -sub_8156994: @ 8156994 - push {lr} - bl sub_81568CC - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bne _081569D0 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081569D4 - .pool -_081569D0: - adds r0, r2, 0x5 - str r0, [r3] -_081569D4: - pop {r0} - bx r0 - thumb_func_end sub_8156994 - - thumb_func_start sub_81569D8 -sub_81569D8: @ 81569D8 - push {lr} - bl sub_81568CC - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - beq _08156A14 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08156A18 - .pool -_08156A14: - adds r0, r2, 0x5 - str r0, [r3] -_08156A18: - pop {r0} - bx r0 - thumb_func_end sub_81569D8 - - thumb_func_start sub_8156A1C -sub_8156A1C: @ 8156A1C - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r3, [r0, 0xC] - adds r1, r3, 0 - adds r1, 0x41 - ldrb r1, [r1] - ldr r2, [r0, 0x4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x4] - strh r0, [r3, 0x18] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8156A1C - - thumb_func_start sub_8156A48 -sub_8156A48: @ 8156A48 - push {r4,r5,lr} - bl sub_8156A1C - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0xC] - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r1, [r3] - ldrb r0, [r3, 0x1] - lsls r0, 8 - orrs r1, r0 - movs r5, 0x18 - ldrsh r0, [r2, r5] - lsls r1, 16 - asrs r1, 16 - cmp r0, r1 - bge _08156A8C - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08156A90 - .pool -_08156A8C: - adds r0, r3, 0x6 - str r0, [r4] -_08156A90: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8156A48 - - thumb_func_start sub_8156A98 -sub_8156A98: @ 8156A98 - push {r4,r5,lr} - bl sub_8156A1C - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0xC] - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r1, [r3] - ldrb r0, [r3, 0x1] - lsls r0, 8 - orrs r1, r0 - movs r5, 0x18 - ldrsh r0, [r2, r5] - lsls r1, 16 - asrs r1, 16 - cmp r0, r1 - ble _08156ADC - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08156AE0 - .pool -_08156ADC: - adds r0, r3, 0x6 - str r0, [r4] -_08156AE0: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8156A98 - - thumb_func_start sub_8156AE8 -sub_8156AE8: @ 8156AE8 - push {r4,r5,lr} - bl sub_8156A1C - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0xC] - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r1, [r3] - ldrb r0, [r3, 0x1] - lsls r0, 8 - orrs r1, r0 - movs r5, 0x18 - ldrsh r0, [r2, r5] - lsls r1, 16 - asrs r1, 16 - cmp r0, r1 - bne _08156B2C - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08156B30 - .pool -_08156B2C: - adds r0, r3, 0x6 - str r0, [r4] -_08156B30: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8156AE8 - - thumb_func_start sub_8156B38 -sub_8156B38: @ 8156B38 - push {r4,r5,lr} - bl sub_8156A1C - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0xC] - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r1, [r3] - ldrb r0, [r3, 0x1] - lsls r0, 8 - orrs r1, r0 - movs r5, 0x18 - ldrsh r0, [r2, r5] - lsls r1, 16 - asrs r1, 16 - cmp r0, r1 - beq _08156B7C - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08156B80 - .pool -_08156B7C: - adds r0, r3, 0x6 - str r0, [r4] -_08156B80: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8156B38 - - thumb_func_start sub_8156B88 -sub_8156B88: @ 8156B88 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0xC] - ldr r1, =0x02039f00 - adds r0, r2, 0 - adds r0, 0x41 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2, 0x18] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8156B88 - - thumb_func_start sub_8156BB4 -sub_8156BB4: @ 8156BB4 - push {r4,r5,lr} - bl sub_8156B88 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0xC] - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r1, [r3] - ldrb r0, [r3, 0x1] - lsls r0, 8 - orrs r1, r0 - movs r5, 0x18 - ldrsh r0, [r2, r5] - lsls r1, 16 - asrs r1, 16 - cmp r0, r1 - bge _08156BF8 - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08156BFC - .pool -_08156BF8: - adds r0, r3, 0x6 - str r0, [r4] -_08156BFC: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8156BB4 - - thumb_func_start sub_8156C04 -sub_8156C04: @ 8156C04 - push {r4,r5,lr} - bl sub_8156B88 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0xC] - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r1, [r3] - ldrb r0, [r3, 0x1] - lsls r0, 8 - orrs r1, r0 - movs r5, 0x18 - ldrsh r0, [r2, r5] - lsls r1, 16 - asrs r1, 16 - cmp r0, r1 - ble _08156C48 - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08156C4C - .pool -_08156C48: - adds r0, r3, 0x6 - str r0, [r4] -_08156C4C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8156C04 - - thumb_func_start sub_8156C54 -sub_8156C54: @ 8156C54 - push {r4,r5,lr} - bl sub_8156B88 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0xC] - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r1, [r3] - ldrb r0, [r3, 0x1] - lsls r0, 8 - orrs r1, r0 - movs r5, 0x18 - ldrsh r0, [r2, r5] - lsls r1, 16 - asrs r1, 16 - cmp r0, r1 - bne _08156C98 - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08156C9C - .pool -_08156C98: - adds r0, r3, 0x6 - str r0, [r4] -_08156C9C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8156C54 - - thumb_func_start sub_8156CA4 -sub_8156CA4: @ 8156CA4 - push {r4,r5,lr} - bl sub_8156B88 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0xC] - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r1, [r3] - ldrb r0, [r3, 0x1] - lsls r0, 8 - orrs r1, r0 - movs r5, 0x18 - ldrsh r0, [r2, r5] - lsls r1, 16 - asrs r1, 16 - cmp r0, r1 - beq _08156CE8 - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08156CEC - .pool -_08156CE8: - adds r0, r3, 0x6 - str r0, [r4] -_08156CEC: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8156CA4 - - thumb_func_start sub_8156CF4 -sub_8156CF4: @ 8156CF4 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0xC] - ldr r0, =0x02039f2c - ldrh r0, [r0] - strh r0, [r1, 0x18] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8156CF4 - - thumb_func_start sub_8156D18 -sub_8156D18: @ 8156D18 - push {lr} - bl sub_8156CF4 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bne _08156D54 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08156D58 - .pool -_08156D54: - adds r0, r2, 0x5 - str r0, [r3] -_08156D58: - pop {r0} - bx r0 - thumb_func_end sub_8156D18 - - thumb_func_start sub_8156D5C -sub_8156D5C: @ 8156D5C - push {lr} - bl sub_8156CF4 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - beq _08156D98 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08156D9C - .pool -_08156D98: - adds r0, r2, 0x5 - str r0, [r3] -_08156D9C: - pop {r0} - bx r0 - thumb_func_end sub_8156D5C - - thumb_func_start sub_8156DA0 -sub_8156DA0: @ 8156DA0 - push {r4,lr} - ldr r2, =0x02039e00 - ldr r4, =0x02039f34 - ldr r0, [r4] - ldr r0, [r0, 0xC] - ldrb r1, [r0, 0x4] - lsls r1, 1 - adds r0, 0x41 - ldrb r0, [r0] - lsls r0, 6 - adds r1, r0 - adds r2, 0x1E - adds r1, r2 - ldrh r0, [r1] - bl sub_80DD9F0 - ldr r1, [r4] - ldr r1, [r1, 0xC] - lsls r0, 24 - asrs r0, 24 - strh r0, [r1, 0x18] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8156DA0 - - thumb_func_start sub_8156DE4 -sub_8156DE4: @ 8156DE4 - push {r4,lr} - bl sub_8156DA0 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - ldr r3, =0x0203ab38 - ldr r2, [r3] - movs r4, 0x18 - ldrsh r1, [r0, r4] - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r1, r0 - bge _08156E20 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08156E24 - .pool -_08156E20: - adds r0, r2, 0x5 - str r0, [r3] -_08156E24: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8156DE4 - - thumb_func_start sub_8156E2C -sub_8156E2C: @ 8156E2C - push {r4,lr} - bl sub_8156DA0 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - ldr r3, =0x0203ab38 - ldr r2, [r3] - movs r4, 0x18 - ldrsh r1, [r0, r4] - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r1, r0 - ble _08156E68 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08156E6C - .pool -_08156E68: - adds r0, r2, 0x5 - str r0, [r3] -_08156E6C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8156E2C - - thumb_func_start sub_8156E74 -sub_8156E74: @ 8156E74 - push {r4,lr} - bl sub_8156DA0 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - ldr r3, =0x0203ab38 - ldr r2, [r3] - movs r4, 0x18 - ldrsh r1, [r0, r4] - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r1, r0 - bne _08156EB0 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08156EB4 - .pool -_08156EB0: - adds r0, r2, 0x5 - str r0, [r3] -_08156EB4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8156E74 - - thumb_func_start sub_8156EBC -sub_8156EBC: @ 8156EBC - push {r4,lr} - bl sub_8156DA0 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - ldr r3, =0x0203ab38 - ldr r2, [r3] - movs r4, 0x18 - ldrsh r1, [r0, r4] - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r1, r0 - beq _08156EF8 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08156EFC - .pool -_08156EF8: - adds r0, r2, 0x5 - str r0, [r3] -_08156EFC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8156EBC - - thumb_func_start sub_8156F04 -sub_8156F04: @ 8156F04 - ldr r2, =0x02039e00 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r3, [r0, 0xC] - ldrb r1, [r3, 0x4] - lsls r1, 1 - adds r0, r3, 0 - adds r0, 0x41 - ldrb r0, [r0] - lsls r0, 6 - adds r1, r0 - adds r2, 0x1E - adds r1, r2 - ldrh r0, [r1] - ldr r1, =gContestMoves - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0] - strh r0, [r3, 0x18] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8156F04 - - thumb_func_start sub_8156F44 -sub_8156F44: @ 8156F44 - push {lr} - bl sub_8156F04 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bne _08156F80 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08156F84 - .pool -_08156F80: - adds r0, r2, 0x5 - str r0, [r3] -_08156F84: - pop {r0} - bx r0 - thumb_func_end sub_8156F44 - - thumb_func_start sub_8156F88 -sub_8156F88: @ 8156F88 - push {lr} - bl sub_8156F04 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - beq _08156FC4 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08156FC8 - .pool -_08156FC4: - adds r0, r2, 0x5 - str r0, [r3] -_08156FC8: - pop {r0} - bx r0 - thumb_func_end sub_8156F88 - - thumb_func_start sub_8156FCC -sub_8156FCC: @ 8156FCC - ldr r2, =0x02039e00 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r3, [r0, 0xC] - ldrb r1, [r3, 0x4] - lsls r1, 1 - adds r0, r3, 0 - adds r0, 0x41 - ldrb r0, [r0] - lsls r0, 6 - adds r1, r0 - adds r2, 0x1E - adds r1, r2 - ldrh r0, [r1] - ldr r2, =gContestEffects - ldr r1, =gContestMoves - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - strh r0, [r3, 0x18] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8156FCC - - thumb_func_start sub_8157018 -sub_8157018: @ 8157018 - push {lr} - bl sub_8156FCC - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bne _08157054 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157058 - .pool -_08157054: - adds r0, r2, 0x5 - str r0, [r3] -_08157058: - pop {r0} - bx r0 - thumb_func_end sub_8157018 - - thumb_func_start sub_815705C -sub_815705C: @ 815705C - push {lr} - bl sub_8156FCC - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - beq _08157098 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0815709C - .pool -_08157098: - adds r0, r2, 0x5 - str r0, [r3] -_0815709C: - pop {r0} - bx r0 - thumb_func_end sub_815705C - - thumb_func_start sub_81570A0 -sub_81570A0: @ 81570A0 - push {r4-r7,lr} - ldr r2, =0x02039e00 - ldr r5, =0x02039f34 - ldr r0, [r5] - ldr r1, [r0, 0xC] - ldrb r0, [r1, 0x4] - lsls r0, 1 - adds r1, 0x41 - ldrb r1, [r1] - lsls r1, 6 - adds r0, r1 - adds r2, 0x1E - adds r0, r2 - ldrh r0, [r0] - ldr r3, =gContestEffects - ldr r4, =gContestMoves - lsls r0, 3 - adds r0, r4 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r3 - ldrb r7, [r0, 0x1] - movs r6, 0 - ldr r0, =0x0203ab38 - mov r12, r0 - adds r1, r2 -_081570D4: - ldrh r0, [r1] - cmp r0, 0 - beq _081570EA - lsls r0, 3 - adds r0, r4 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x1] - cmp r7, r0 - bcc _081570F2 -_081570EA: - adds r1, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _081570D4 -_081570F2: - cmp r6, 0x4 - bne _08157114 - ldr r0, [r5] - ldr r1, [r0, 0xC] - movs r0, 0x1 - b _0815711A - .pool -_08157114: - ldr r0, [r5] - ldr r1, [r0, 0xC] - movs r0, 0 -_0815711A: - strh r0, [r1, 0x18] - mov r1, r12 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81570A0 - - thumb_func_start sub_815712C -sub_815712C: @ 815712C - push {lr} - bl sub_81570A0 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08157164 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0815716C - .pool -_08157164: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x4 - str r0, [r1] -_0815716C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_815712C - - thumb_func_start sub_8157174 -sub_8157174: @ 8157174 - push {r4-r7,lr} - ldr r2, =0x02039e00 - ldr r5, =0x02039f34 - ldr r0, [r5] - ldr r1, [r0, 0xC] - ldrb r0, [r1, 0x4] - lsls r0, 1 - adds r1, 0x41 - ldrb r1, [r1] - lsls r1, 6 - adds r0, r1 - adds r2, 0x1E - adds r0, r2 - ldrh r0, [r0] - ldr r3, =gContestEffects - ldr r4, =gContestMoves - lsls r0, 3 - adds r0, r4 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r3 - ldrb r7, [r0, 0x2] - movs r6, 0 - ldr r0, =0x0203ab38 - mov r12, r0 - adds r1, r2 -_081571A8: - ldrh r0, [r1] - cmp r0, 0 - beq _081571BE - lsls r0, 3 - adds r0, r4 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x2] - cmp r7, r0 - bcc _081571C6 -_081571BE: - adds r1, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _081571A8 -_081571C6: - cmp r6, 0x4 - bne _081571E8 - ldr r0, [r5] - ldr r1, [r0, 0xC] - movs r0, 0x1 - b _081571EE - .pool -_081571E8: - ldr r0, [r5] - ldr r1, [r0, 0xC] - movs r0, 0 -_081571EE: - strh r0, [r1, 0x18] - mov r1, r12 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8157174 - - thumb_func_start sub_8157200 -sub_8157200: @ 8157200 - push {lr} - bl sub_8157174 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08157238 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157240 - .pool -_08157238: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x5 - str r0, [r1] -_08157240: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157200 - - thumb_func_start sub_8157248 -sub_8157248: @ 8157248 - push {r4,lr} - ldr r2, =0x02039e00 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r4, [r0, 0xC] - ldrb r1, [r4, 0x4] - lsls r1, 1 - adds r0, r4, 0 - adds r0, 0x41 - ldrb r0, [r0] - lsls r0, 6 - adds r1, r0 - adds r2, 0x1E - adds r1, r2 - ldrh r0, [r1] - ldr r2, =gContestEffects - ldr r1, =gContestMoves - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x18] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157248 - - thumb_func_start sub_81572A4 -sub_81572A4: @ 81572A4 - push {lr} - bl sub_8157248 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bge _081572E0 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081572E4 - .pool -_081572E0: - adds r0, r2, 0x5 - str r0, [r3] -_081572E4: - pop {r0} - bx r0 - thumb_func_end sub_81572A4 - - thumb_func_start sub_81572E8 -sub_81572E8: @ 81572E8 - push {lr} - bl sub_8157248 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - ble _08157324 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157328 - .pool -_08157324: - adds r0, r2, 0x5 - str r0, [r3] -_08157328: - pop {r0} - bx r0 - thumb_func_end sub_81572E8 - - thumb_func_start sub_815732C -sub_815732C: @ 815732C - push {lr} - bl sub_8157248 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bne _08157368 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0815736C - .pool -_08157368: - adds r0, r2, 0x5 - str r0, [r3] -_0815736C: - pop {r0} - bx r0 - thumb_func_end sub_815732C - - thumb_func_start sub_8157370 -sub_8157370: @ 8157370 - push {lr} - bl sub_8157248 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - beq _081573AC - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081573B0 - .pool -_081573AC: - adds r0, r2, 0x5 - str r0, [r3] -_081573B0: - pop {r0} - bx r0 - thumb_func_end sub_8157370 - - thumb_func_start sub_81573B4 -sub_81573B4: @ 81573B4 - push {r4,lr} - ldr r2, =0x02039e00 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r4, [r0, 0xC] - ldrb r1, [r4, 0x4] - lsls r1, 1 - adds r0, r4, 0 - adds r0, 0x41 - ldrb r0, [r0] - lsls r0, 6 - adds r1, r0 - adds r2, 0x1E - adds r1, r2 - ldrh r0, [r1] - ldr r2, =gContestEffects - ldr r1, =gContestMoves - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x2] - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x18] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81573B4 - - thumb_func_start sub_8157410 -sub_8157410: @ 8157410 - push {lr} - bl sub_81573B4 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bge _0815744C - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157450 - .pool -_0815744C: - adds r0, r2, 0x5 - str r0, [r3] -_08157450: - pop {r0} - bx r0 - thumb_func_end sub_8157410 - - thumb_func_start sub_8157454 -sub_8157454: @ 8157454 - push {lr} - bl sub_81573B4 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - ble _08157490 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157494 - .pool -_08157490: - adds r0, r2, 0x5 - str r0, [r3] -_08157494: - pop {r0} - bx r0 - thumb_func_end sub_8157454 - - thumb_func_start sub_8157498 -sub_8157498: @ 8157498 - push {lr} - bl sub_81573B4 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bne _081574D4 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081574D8 - .pool -_081574D4: - adds r0, r2, 0x5 - str r0, [r3] -_081574D8: - pop {r0} - bx r0 - thumb_func_end sub_8157498 - - thumb_func_start sub_81574DC -sub_81574DC: @ 81574DC - push {lr} - bl sub_81573B4 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - beq _08157518 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0815751C - .pool -_08157518: - adds r0, r2, 0x5 - str r0, [r3] -_0815751C: - pop {r0} - bx r0 - thumb_func_end sub_81574DC - - thumb_func_start sub_8157520 -sub_8157520: @ 8157520 - push {r4,r5,lr} - ldr r3, =0x02039e00 - ldr r5, =0x02039f34 - ldr r4, [r5] - ldr r1, [r4, 0xC] - ldrb r0, [r1, 0x4] - lsls r0, 1 - adds r1, 0x41 - ldrb r2, [r1] - lsls r1, r2, 6 - adds r0, r1 - adds r3, 0x1E - adds r0, r3 - ldrh r3, [r0] - ldr r1, [r4, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0, 0x8] - cmp r3, r1 - beq _08157558 - movs r1, 0 - b _08157560 - .pool -_08157558: - ldrb r0, [r0, 0xB] - lsls r0, 25 - lsrs r0, 29 - adds r1, r0, 0x1 -_08157560: - ldr r0, [r5] - ldr r0, [r0, 0xC] - strh r1, [r0, 0x18] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157520 - - thumb_func_start sub_8157578 -sub_8157578: @ 8157578 - push {lr} - bl sub_8157520 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bge _081575B4 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081575B8 - .pool -_081575B4: - adds r0, r2, 0x5 - str r0, [r3] -_081575B8: - pop {r0} - bx r0 - thumb_func_end sub_8157578 - - thumb_func_start sub_81575BC -sub_81575BC: @ 81575BC - push {lr} - bl sub_8157520 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - ble _081575F8 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081575FC - .pool -_081575F8: - adds r0, r2, 0x5 - str r0, [r3] -_081575FC: - pop {r0} - bx r0 - thumb_func_end sub_81575BC - - thumb_func_start sub_8157600 -sub_8157600: @ 8157600 - push {lr} - bl sub_8157520 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bne _0815763C - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157640 - .pool -_0815763C: - adds r0, r2, 0x5 - str r0, [r3] -_08157640: - pop {r0} - bx r0 - thumb_func_end sub_8157600 - - thumb_func_start sub_8157644 -sub_8157644: @ 8157644 - push {lr} - bl sub_8157520 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - beq _08157680 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157684 - .pool -_08157680: - adds r0, r2, 0x5 - str r0, [r3] -_08157684: - pop {r0} - bx r0 - thumb_func_end sub_8157644 - - thumb_func_start sub_8157688 -sub_8157688: @ 8157688 - push {r4-r6,lr} - movs r3, 0 - ldr r2, =0x02039e00 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - ldrb r1, [r0, 0x4] - lsls r1, 1 - adds r0, 0x41 - ldrb r0, [r0] - lsls r0, 6 - adds r1, r0 - adds r2, 0x1E - adds r1, r2 - ldrh r5, [r1] - movs r4, 0 - adds r6, r2, 0 -_081576AA: - lsls r1, r4, 1 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - adds r0, 0x41 - ldrb r0, [r0] - lsls r0, 6 - adds r1, r0 - adds r1, r6 - ldrh r0, [r1] - cmp r0, 0 - beq _081576D2 - adds r1, r0, 0 - adds r0, r5, 0 - bl AreMovesContestCombo - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - bne _081576DC -_081576D2: - adds r4, 0x1 - cmp r4, 0x3 - ble _081576AA - cmp r3, 0 - beq _081576DE -_081576DC: - movs r3, 0x1 -_081576DE: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - strh r3, [r0, 0x18] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157688 - - thumb_func_start sub_8157700 -sub_8157700: @ 8157700 - push {lr} - bl sub_8157688 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08157738 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157740 - .pool -_08157738: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x4 - str r0, [r1] -_08157740: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157700 - - thumb_func_start sub_8157748 -sub_8157748: @ 8157748 - push {lr} - bl sub_8157688 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08157780 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157788 - .pool -_08157780: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x4 - str r0, [r1] -_08157788: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157748 - - thumb_func_start sub_8157790 -sub_8157790: @ 8157790 - push {r4-r6,lr} - movs r3, 0 - ldr r2, =0x02039e00 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - ldrb r1, [r0, 0x4] - lsls r1, 1 - adds r0, 0x41 - ldrb r0, [r0] - lsls r0, 6 - adds r1, r0 - adds r2, 0x1E - adds r1, r2 - ldrh r5, [r1] - movs r4, 0 - adds r6, r2, 0 -_081577B2: - lsls r1, r4, 1 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - adds r0, 0x41 - ldrb r0, [r0] - lsls r0, 6 - adds r1, r0 - adds r1, r6 - ldrh r0, [r1] - cmp r0, 0 - beq _081577D8 - adds r1, r5, 0 - bl AreMovesContestCombo - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - bne _081577E2 -_081577D8: - adds r4, 0x1 - cmp r4, 0x3 - ble _081577B2 - cmp r3, 0 - beq _081577E4 -_081577E2: - movs r3, 0x1 -_081577E4: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - strh r3, [r0, 0x18] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157790 - - thumb_func_start sub_8157808 -sub_8157808: @ 8157808 - push {lr} - bl sub_8157790 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08157840 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157848 - .pool -_08157840: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x4 - str r0, [r1] -_08157848: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157808 - - thumb_func_start sub_8157850 -sub_8157850: @ 8157850 - push {lr} - bl sub_8157790 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08157888 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157890 - .pool -_08157888: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x4 - str r0, [r1] -_08157890: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157850 - - thumb_func_start sub_8157898 -sub_8157898: @ 8157898 - push {r4-r6,lr} - movs r5, 0 - ldr r3, =0x02039e00 - ldr r6, =0x02039f34 - ldr r4, [r6] - ldr r1, [r4, 0xC] - ldrb r0, [r1, 0x4] - lsls r0, 1 - adds r1, 0x41 - ldrb r2, [r1] - lsls r1, r2, 6 - adds r0, r1 - adds r3, 0x1E - adds r0, r3 - ldrh r3, [r0] - ldr r1, [r4, 0x4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x8] - cmp r0, 0 - beq _081578D0 - adds r1, r3, 0 - bl AreMovesContestCombo - lsls r0, 24 - lsrs r5, r0, 24 -_081578D0: - cmp r5, 0 - beq _081578D6 - movs r5, 0x1 -_081578D6: - ldr r0, [r6] - ldr r0, [r0, 0xC] - strh r5, [r0, 0x18] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157898 - - thumb_func_start sub_81578F8 -sub_81578F8: @ 81578F8 - push {lr} - bl sub_8157898 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08157930 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157938 - .pool -_08157930: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x4 - str r0, [r1] -_08157938: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81578F8 - - thumb_func_start sub_8157940 -sub_8157940: @ 8157940 - push {lr} - bl sub_8157898 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08157978 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157980 - .pool -_08157978: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x4 - str r0, [r1] -_08157980: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157940 - - thumb_func_start sub_8157988 -sub_8157988: @ 8157988 - push {r4,r5,lr} - ldr r4, =0x0203ab38 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl sub_81564AC - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02039f34 - ldr r1, [r1] - ldr r5, [r1, 0xC] - ldr r2, [r1, 0x4] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0xD - ldrsb r0, [r1, r0] - movs r1, 0xA - bl __divsi3 - lsls r0, 24 - asrs r0, 24 - strh r0, [r5, 0x18] - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157988 - - thumb_func_start sub_81579CC -sub_81579CC: @ 81579CC - push {lr} - bl sub_8157988 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bge _08157A08 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157A0C - .pool -_08157A08: - adds r0, r2, 0x5 - str r0, [r3] -_08157A0C: - pop {r0} - bx r0 - thumb_func_end sub_81579CC - - thumb_func_start sub_8157A10 -sub_8157A10: @ 8157A10 - push {lr} - bl sub_8157988 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - ble _08157A4C - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157A50 - .pool -_08157A4C: - adds r0, r2, 0x5 - str r0, [r3] -_08157A50: - pop {r0} - bx r0 - thumb_func_end sub_8157A10 - - thumb_func_start sub_8157A54 -sub_8157A54: @ 8157A54 - push {lr} - bl sub_8157988 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bne _08157A90 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157A94 - .pool -_08157A90: - adds r0, r2, 0x5 - str r0, [r3] -_08157A94: - pop {r0} - bx r0 - thumb_func_end sub_8157A54 - - thumb_func_start sub_8157A98 -sub_8157A98: @ 8157A98 - push {lr} - bl sub_8157988 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - beq _08157AD4 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157AD8 - .pool -_08157AD4: - adds r0, r2, 0x5 - str r0, [r3] -_08157AD8: - pop {r0} - bx r0 - thumb_func_end sub_8157A98 - - thumb_func_start sub_8157ADC -sub_8157ADC: @ 8157ADC - push {r4-r6,lr} - movs r6, 0 - ldr r5, =0x0203ab38 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl sub_81564AC - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r4, 0 - bl sub_80DE1E8 - lsls r0, 24 - cmp r0, 0 - beq _08157B18 - ldr r2, =gContestMoves - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x8] - lsls r0, 3 - adds r0, r2 - ldrb r1, [r0, 0x2] - negs r0, r1 - orrs r0, r1 - lsrs r6, r0, 31 -_08157B18: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - strh r6, [r0, 0x18] - ldr r0, [r5] - adds r0, 0x2 - str r0, [r5] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157ADC - - thumb_func_start sub_8157B38 -sub_8157B38: @ 8157B38 - push {lr} - bl sub_8157ADC - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bge _08157B74 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157B78 - .pool -_08157B74: - adds r0, r2, 0x5 - str r0, [r3] -_08157B78: - pop {r0} - bx r0 - thumb_func_end sub_8157B38 - - thumb_func_start sub_8157B7C -sub_8157B7C: @ 8157B7C - push {lr} - bl sub_8157ADC - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - ble _08157BB8 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157BBC - .pool -_08157BB8: - adds r0, r2, 0x5 - str r0, [r3] -_08157BBC: - pop {r0} - bx r0 - thumb_func_end sub_8157B7C - - thumb_func_start sub_8157BC0 -sub_8157BC0: @ 8157BC0 - push {lr} - bl sub_8157ADC - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bne _08157BFC - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157C00 - .pool -_08157BFC: - adds r0, r2, 0x5 - str r0, [r3] -_08157C00: - pop {r0} - bx r0 - thumb_func_end sub_8157BC0 - - thumb_func_start sub_8157C04 -sub_8157C04: @ 8157C04 - push {lr} - bl sub_8157ADC - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - beq _08157C40 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157C44 - .pool -_08157C40: - adds r0, r2, 0x5 - str r0, [r3] -_08157C44: - pop {r0} - bx r0 - thumb_func_end sub_8157C04 - - thumb_func_start sub_8157C48 -sub_8157C48: @ 8157C48 - push {lr} - ldr r0, =0x0203ab38 - ldr r0, [r0] - ldrb r0, [r0, 0x1] - bl sub_81564AC - lsls r0, 24 - lsrs r0, 24 - bl sub_80DBCA8 - lsls r0, 24 - cmp r0, 0 - beq _08157C74 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0xC] - movs r0, 0 - b _08157C7C - .pool -_08157C74: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0xC] - movs r0, 0x1 -_08157C7C: - strh r0, [r1, 0x18] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x2 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157C48 - - thumb_func_start sub_8157C94 -sub_8157C94: @ 8157C94 - push {lr} - bl sub_8157C48 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08157CCC - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157CD4 - .pool -_08157CCC: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x4 - str r0, [r1] -_08157CD4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157C94 - - thumb_func_start sub_8157CDC -sub_8157CDC: @ 8157CDC - push {lr} - bl sub_8157C48 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08157D14 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157D1C - .pool -_08157D14: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x4 - str r0, [r1] -_08157D1C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157CDC - - thumb_func_start sub_8157D24 -sub_8157D24: @ 8157D24 - push {r4,lr} - ldr r4, =0x0203ab38 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl sub_81564AC - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02039f34 - ldr r1, [r1] - ldr r3, [r1, 0xC] - ldr r2, [r1, 0x4] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x15] - lsls r0, 28 - lsrs r0, 31 - strh r0, [r3, 0x18] - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157D24 - - thumb_func_start sub_8157D60 -sub_8157D60: @ 8157D60 - push {lr} - bl sub_8157D24 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08157D98 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157DA0 - .pool -_08157D98: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x4 - str r0, [r1] -_08157DA0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157D60 - - thumb_func_start sub_8157DA8 -sub_8157DA8: @ 8157DA8 - push {lr} - bl sub_8157D24 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08157DE0 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157DE8 - .pool -_08157DE0: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x4 - str r0, [r1] -_08157DE8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157DA8 - - thumb_func_start sub_8157DF0 -sub_8157DF0: @ 8157DF0 - push {r4,r5,lr} - ldr r4, =0x0203ab38 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl sub_81564AC - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02039f34 - ldr r1, [r1] - ldr r5, [r1, 0xC] - ldr r3, [r1, 0x4] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r3 - adds r0, r5, 0 - adds r0, 0x41 - ldrb r2, [r0] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r1, 0x4] - ldrh r0, [r0, 0x4] - subs r1, r0 - strh r1, [r5, 0x18] - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157DF0 - - thumb_func_start sub_8157E3C -sub_8157E3C: @ 8157E3C - push {lr} - bl sub_8157DF0 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _08157E74 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157E7C - .pool -_08157E74: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x4 - str r0, [r1] -_08157E7C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157E3C - - thumb_func_start sub_8157E84 -sub_8157E84: @ 8157E84 - push {lr} - bl sub_8157DF0 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - ble _08157EBC - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157EC4 - .pool -_08157EBC: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x4 - str r0, [r1] -_08157EC4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157E84 - - thumb_func_start sub_8157ECC -sub_8157ECC: @ 8157ECC - push {lr} - bl sub_8157DF0 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08157F04 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157F0C - .pool -_08157F04: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x4 - str r0, [r1] -_08157F0C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157ECC - - thumb_func_start sub_8157F14 -sub_8157F14: @ 8157F14 - push {lr} - bl sub_8157DF0 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08157F4C - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157F54 - .pool -_08157F4C: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x4 - str r0, [r1] -_08157F54: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157F14 - - thumb_func_start sub_8157F5C -sub_8157F5C: @ 8157F5C - push {r4,lr} - ldr r4, =0x0203ab38 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl sub_81564AC - lsls r0, 24 - ldr r1, =0x02039f34 - ldr r1, [r1] - ldr r3, [r1, 0xC] - ldr r2, =0x02039f00 - lsrs r0, 23 - adds r0, r2 - adds r1, r3, 0 - adds r1, 0x41 - ldrb r1, [r1] - lsls r1, 1 - adds r1, r2 - ldrh r0, [r0] - ldrh r1, [r1] - subs r0, r1 - strh r0, [r3, 0x18] - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157F5C - - thumb_func_start sub_8157FA0 -sub_8157FA0: @ 8157FA0 - push {lr} - bl sub_8157F5C - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _08157FD8 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08157FE0 - .pool -_08157FD8: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x4 - str r0, [r1] -_08157FE0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157FA0 - - thumb_func_start sub_8157FE8 -sub_8157FE8: @ 8157FE8 - push {lr} - bl sub_8157F5C - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - ble _08158020 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08158028 - .pool -_08158020: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x4 - str r0, [r1] -_08158028: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8157FE8 - - thumb_func_start sub_8158030 -sub_8158030: @ 8158030 - push {lr} - bl sub_8157F5C - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08158068 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08158070 - .pool -_08158068: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x4 - str r0, [r1] -_08158070: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8158030 - - thumb_func_start sub_8158078 -sub_8158078: @ 8158078 - push {lr} - bl sub_8157F5C - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _081580B0 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081580B8 - .pool -_081580B0: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x4 - str r0, [r1] -_081580B8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8158078 - - thumb_func_start sub_81580C0 -sub_81580C0: @ 81580C0 - push {r4,r5,lr} - ldr r5, =0x0203ab38 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl sub_81564AC - lsls r0, 24 - ldr r3, [r5] - ldrb r2, [r3, 0x2] - ldr r1, =0x02039f34 - ldr r4, [r1] - ldr r1, [r4] - lsrs r0, 23 - lsls r2, 3 - adds r0, r2 - adds r1, 0x1C - adds r1, r0 - ldrh r0, [r1] - ldr r2, [r4, 0xC] - ldr r1, =gContestMoves - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0] - strh r0, [r2, 0x18] - adds r3, 0x3 - str r3, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81580C0 - - thumb_func_start sub_8158108 -sub_8158108: @ 8158108 - push {lr} - bl sub_81580C0 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bge _08158144 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08158148 - .pool -_08158144: - adds r0, r2, 0x5 - str r0, [r3] -_08158148: - pop {r0} - bx r0 - thumb_func_end sub_8158108 - - thumb_func_start sub_815814C -sub_815814C: @ 815814C - push {lr} - bl sub_81580C0 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - ble _08158188 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0815818C - .pool -_08158188: - adds r0, r2, 0x5 - str r0, [r3] -_0815818C: - pop {r0} - bx r0 - thumb_func_end sub_815814C - - thumb_func_start sub_8158190 -sub_8158190: @ 8158190 - push {lr} - bl sub_81580C0 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bne _081581CC - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081581D0 - .pool -_081581CC: - adds r0, r2, 0x5 - str r0, [r3] -_081581D0: - pop {r0} - bx r0 - thumb_func_end sub_8158190 - - thumb_func_start sub_81581D4 -sub_81581D4: @ 81581D4 - push {lr} - bl sub_81580C0 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - beq _08158210 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08158214 - .pool -_08158210: - adds r0, r2, 0x5 - str r0, [r3] -_08158214: - pop {r0} - bx r0 - thumb_func_end sub_81581D4 - - thumb_func_start sub_8158218 -sub_8158218: @ 8158218 - push {r4,r5,lr} - ldr r5, =0x0203ab38 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl sub_81564AC - lsls r0, 24 - lsrs r0, 24 - ldr r3, [r5] - ldrb r2, [r3, 0x2] - ldr r1, =0x02039f34 - ldr r4, [r1] - ldr r1, [r4] - lsls r2, 2 - adds r0, r2 - adds r1, 0x44 - adds r1, r0 - ldr r2, [r4, 0xC] - movs r0, 0 - ldrsb r0, [r1, r0] - strh r0, [r2, 0x18] - adds r3, 0x3 - str r3, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8158218 - - thumb_func_start sub_8158254 -sub_8158254: @ 8158254 - push {lr} - bl sub_8158218 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bge _08158290 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08158294 - .pool -_08158290: - adds r0, r2, 0x5 - str r0, [r3] -_08158294: - pop {r0} - bx r0 - thumb_func_end sub_8158254 - - thumb_func_start sub_8158298 -sub_8158298: @ 8158298 - push {lr} - bl sub_8158218 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - ble _081582D4 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081582D8 - .pool -_081582D4: - adds r0, r2, 0x5 - str r0, [r3] -_081582D8: - pop {r0} - bx r0 - thumb_func_end sub_8158298 - - thumb_func_start sub_81582DC -sub_81582DC: @ 81582DC - push {lr} - bl sub_8158218 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bne _08158318 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0815831C - .pool -_08158318: - adds r0, r2, 0x5 - str r0, [r3] -_0815831C: - pop {r0} - bx r0 - thumb_func_end sub_81582DC - - thumb_func_start sub_8158320 -sub_8158320: @ 8158320 - push {lr} - bl sub_8158218 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - beq _0815835C - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08158360 - .pool -_0815835C: - adds r0, r2, 0x5 - str r0, [r3] -_08158360: - pop {r0} - bx r0 - thumb_func_end sub_8158320 - - thumb_func_start sub_8158364 -sub_8158364: @ 8158364 - push {r4,r5,lr} - ldr r5, =0x0203ab38 - ldr r0, [r5] - ldrb r0, [r0, 0x1] - bl sub_81564AC - lsls r0, 24 - ldr r3, [r5] - ldrb r2, [r3, 0x2] - ldr r1, =0x02039f34 - ldr r4, [r1] - ldr r1, [r4] - lsrs r0, 23 - lsls r2, 3 - adds r0, r2 - adds r1, 0x1C - adds r1, r0 - ldrh r0, [r1] - ldr r4, [r4, 0xC] - ldr r2, =gContestEffects - ldr r1, =gContestMoves - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - strh r0, [r4, 0x18] - adds r3, 0x3 - str r3, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8158364 - - thumb_func_start sub_81583B8 -sub_81583B8: @ 81583B8 - push {lr} - bl sub_8158364 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - bne _081583F4 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081583F8 - .pool -_081583F4: - adds r0, r2, 0x5 - str r0, [r3] -_081583F8: - pop {r0} - bx r0 - thumb_func_end sub_81583B8 - - thumb_func_start sub_81583FC -sub_81583FC: @ 81583FC - push {lr} - bl sub_8158364 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - cmp r0, r1 - beq _08158438 - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _0815843C - .pool -_08158438: - adds r0, r2, 0x5 - str r0, [r3] -_0815843C: - pop {r0} - bx r0 - thumb_func_end sub_81583FC - - thumb_func_start sub_8158440 -sub_8158440: @ 8158440 - push {r4,lr} - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r3, [r0, 0xC] - ldr r4, =0x0203ab38 - ldr r2, [r4] - ldrb r0, [r2, 0x1] - lsls r0, 1 - adds r1, r3, 0 - adds r1, 0x1A - adds r1, r0 - ldrh r0, [r3, 0x18] - strh r0, [r1] - adds r2, 0x2 - str r2, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8158440 - - thumb_func_start sub_815846C -sub_815846C: @ 815846C - push {r4,lr} - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r3, [r0, 0xC] - ldr r4, =0x0203ab38 - ldr r2, [r4] - ldrb r0, [r2, 0x1] - lsls r0, 1 - adds r3, 0x1A - adds r3, r0 - ldrb r1, [r2, 0x2] - ldrb r0, [r2, 0x3] - lsls r0, 8 - orrs r1, r0 - strh r1, [r3] - adds r2, 0x4 - str r2, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815846C - - thumb_func_start sub_815849C -sub_815849C: @ 815849C - push {r4,lr} - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0xC] - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r0, [r3, 0x1] - lsls r0, 1 - adds r2, 0x1A - adds r2, r0 - movs r1, 0x2 - ldrsb r1, [r3, r1] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrh r0, [r2] - adds r1, r0 - strh r1, [r2] - adds r3, 0x4 - str r3, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815849C - - thumb_func_start sub_81584D4 -sub_81584D4: @ 81584D4 - push {r4,lr} - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0xC] - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r1, [r3, 0x1] - lsls r1, 1 - adds r2, 0x1A - adds r1, r2, r1 - ldrb r0, [r3, 0x2] - lsls r0, 1 - adds r2, r0 - ldrh r0, [r2] - ldrh r2, [r1] - adds r0, r2 - strh r0, [r1] - adds r3, 0x3 - str r3, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81584D4 - - thumb_func_start sub_8158508 -sub_8158508: @ 8158508 - push {r4,lr} - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0xC] - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r1, [r3, 0x1] - lsls r1, 1 - adds r2, 0x1A - adds r1, r2, r1 - ldrb r0, [r3, 0x2] - lsls r0, 1 - adds r2, r0 - ldrh r0, [r2] - ldrh r2, [r1] - adds r0, r2 - strh r0, [r1] - adds r3, 0x3 - str r3, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8158508 - - thumb_func_start sub_815853C -sub_815853C: @ 815853C - push {r4,lr} - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0xC] - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r0, [r3, 0x1] - lsls r0, 1 - adds r1, 0x1A - adds r1, r0 - movs r0, 0 - ldrsh r2, [r1, r0] - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - cmp r2, r1 - bge _08158580 - ldrb r1, [r3, 0x4] - ldrb r0, [r3, 0x5] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x6] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x7] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08158586 - .pool -_08158580: - adds r0, r3, 0 - adds r0, 0x8 - str r0, [r4] -_08158586: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815853C - - thumb_func_start sub_815858C -sub_815858C: @ 815858C - push {r4,lr} - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0xC] - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r0, [r3, 0x1] - lsls r0, 1 - adds r1, 0x1A - adds r1, r0 - movs r0, 0 - ldrsh r2, [r1, r0] - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - cmp r2, r1 - ble _081585D0 - ldrb r1, [r3, 0x4] - ldrb r0, [r3, 0x5] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x6] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x7] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _081585D6 - .pool -_081585D0: - adds r0, r3, 0 - adds r0, 0x8 - str r0, [r4] -_081585D6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815858C - - thumb_func_start sub_81585DC -sub_81585DC: @ 81585DC - push {r4,lr} - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0xC] - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r0, [r3, 0x1] - lsls r0, 1 - adds r1, 0x1A - adds r1, r0 - movs r0, 0 - ldrsh r2, [r1, r0] - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - cmp r2, r1 - bne _08158620 - ldrb r1, [r3, 0x4] - ldrb r0, [r3, 0x5] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x6] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x7] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08158626 - .pool -_08158620: - adds r0, r3, 0 - adds r0, 0x8 - str r0, [r4] -_08158626: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81585DC - - thumb_func_start sub_815862C -sub_815862C: @ 815862C - push {r4,lr} - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0xC] - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r0, [r3, 0x1] - lsls r0, 1 - adds r1, 0x1A - adds r1, r0 - movs r0, 0 - ldrsh r2, [r1, r0] - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - cmp r2, r1 - beq _08158670 - ldrb r1, [r3, 0x4] - ldrb r0, [r3, 0x5] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x6] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x7] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08158676 - .pool -_08158670: - adds r0, r3, 0 - adds r0, 0x8 - str r0, [r4] -_08158676: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815862C - - thumb_func_start sub_815867C -sub_815867C: @ 815867C - push {r4,r5,lr} - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0xC] - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r1, [r3, 0x1] - lsls r1, 1 - adds r2, 0x1A - adds r1, r2, r1 - ldrb r0, [r3, 0x2] - lsls r0, 1 - adds r2, r0 - movs r0, 0 - ldrsh r1, [r1, r0] - movs r5, 0 - ldrsh r0, [r2, r5] - cmp r1, r0 - bge _081586C4 - ldrb r1, [r3, 0x3] - ldrb r0, [r3, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _081586C8 - .pool -_081586C4: - adds r0, r3, 0x7 - str r0, [r4] -_081586C8: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815867C - - thumb_func_start sub_81586D0 -sub_81586D0: @ 81586D0 - push {r4,r5,lr} - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0xC] - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r1, [r3, 0x1] - lsls r1, 1 - adds r2, 0x1A - adds r1, r2, r1 - ldrb r0, [r3, 0x2] - lsls r0, 1 - adds r2, r0 - movs r0, 0 - ldrsh r1, [r1, r0] - movs r5, 0 - ldrsh r0, [r2, r5] - cmp r1, r0 - ble _08158718 - ldrb r1, [r3, 0x3] - ldrb r0, [r3, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _0815871C - .pool -_08158718: - adds r0, r3, 0x7 - str r0, [r4] -_0815871C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81586D0 - - thumb_func_start sub_8158724 -sub_8158724: @ 8158724 - push {r4,r5,lr} - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0xC] - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r1, [r3, 0x1] - lsls r1, 1 - adds r2, 0x1A - adds r1, r2, r1 - ldrb r0, [r3, 0x2] - lsls r0, 1 - adds r2, r0 - movs r0, 0 - ldrsh r1, [r1, r0] - movs r5, 0 - ldrsh r0, [r2, r5] - cmp r1, r0 - bne _0815876C - ldrb r1, [r3, 0x3] - ldrb r0, [r3, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08158770 - .pool -_0815876C: - adds r0, r3, 0x7 - str r0, [r4] -_08158770: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8158724 - - thumb_func_start sub_8158778 -sub_8158778: @ 8158778 - push {r4,r5,lr} - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0xC] - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r1, [r3, 0x1] - lsls r1, 1 - adds r2, 0x1A - adds r1, r2, r1 - ldrb r0, [r3, 0x2] - lsls r0, 1 - adds r2, r0 - movs r0, 0 - ldrsh r1, [r1, r0] - movs r5, 0 - ldrsh r0, [r2, r5] - cmp r1, r0 - beq _081587C0 - ldrb r1, [r3, 0x3] - ldrb r0, [r3, 0x4] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x6] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _081587C4 - .pool -_081587C0: - adds r0, r3, 0x7 - str r0, [r4] -_081587C4: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8158778 - - thumb_func_start sub_81587CC -sub_81587CC: @ 81587CC - push {r4,r5,lr} - bl GenerateRandomNumber - movs r2, 0xFF - ands r2, r0 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0xC] - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r0, [r3, 0x1] - lsls r0, 1 - adds r1, 0x1A - adds r1, r0 - movs r5, 0 - ldrsh r0, [r1, r5] - cmp r2, r0 - bge _08158810 - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08158814 - .pool -_08158810: - adds r0, r3, 0x6 - str r0, [r4] -_08158814: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81587CC - - thumb_func_start sub_815881C -sub_815881C: @ 815881C - push {r4,r5,lr} - bl GenerateRandomNumber - movs r2, 0xFF - ands r2, r0 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r1, [r0, 0xC] - ldr r4, =0x0203ab38 - ldr r3, [r4] - ldrb r0, [r3, 0x1] - lsls r0, 1 - adds r1, 0x1A - adds r1, r0 - movs r5, 0 - ldrsh r0, [r1, r5] - cmp r2, r0 - ble _08158860 - ldrb r1, [r3, 0x2] - ldrb r0, [r3, 0x3] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r3, 0x4] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - b _08158864 - .pool -_08158860: - adds r0, r3, 0x6 - str r0, [r4] -_08158864: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815881C - - thumb_func_start sub_815886C -sub_815886C: @ 815886C - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - bx lr - .pool - thumb_func_end sub_815886C - - thumb_func_start dp15_call -dp15_call: @ 815888C - push {r4,lr} - ldr r4, =0x0203ab38 - ldr r0, [r4] - adds r0, 0x5 - bl sub_81588E0 - ldr r2, [r4] - ldrb r1, [r2, 0x1] - ldrb r0, [r2, 0x2] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x4] - lsls r0, 24 - orrs r1, r0 - str r1, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp15_call - - thumb_func_start sub_81588BC -sub_81588BC: @ 81588BC - push {lr} - bl sub_8158908 - lsls r0, 24 - cmp r0, 0 - bne _081588D6 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r2, [r0, 0xC] - ldrb r1, [r2, 0x9] - movs r0, 0x1 - orrs r0, r1 - strb r0, [r2, 0x9] -_081588D6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81588BC - - thumb_func_start sub_81588E0 -sub_81588E0: @ 81588E0 - push {r4,lr} - ldr r1, =0x02039f34 - ldr r1, [r1] - ldr r3, [r1, 0xC] - adds r4, r3, 0 - adds r4, 0x40 - ldrb r1, [r4] - adds r2, r1, 0x1 - strb r2, [r4] - lsls r1, 24 - lsrs r1, 22 - adds r3, 0x20 - adds r3, r1 - str r0, [r3] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81588E0 - - thumb_func_start sub_8158908 -sub_8158908: @ 8158908 - push {lr} - ldr r3, =0x02039f34 - ldr r0, [r3] - ldr r0, [r0, 0xC] - adds r1, r0, 0 - adds r1, 0x40 - ldrb r0, [r1] - cmp r0, 0 - bne _08158924 - movs r0, 0 - b _08158940 - .pool -_08158924: - subs r0, 0x1 - strb r0, [r1] - ldr r2, =0x0203ab38 - ldr r0, [r3] - ldr r1, [r0, 0xC] - adds r0, r1, 0 - adds r0, 0x40 - ldrb r0, [r0] - lsls r0, 2 - adds r1, 0x20 - adds r1, r0 - ldr r0, [r1] - str r0, [r2] - movs r0, 0x1 -_08158940: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8158908 - - thumb_func_start sub_8158948 -sub_8158948: @ 8158948 - push {r4-r6,lr} - movs r5, 0 - movs r4, 0 - ldr r6, =0x02039e1e -_08158950: - lsls r1, r4, 1 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - adds r0, 0x41 - ldrb r0, [r0] - lsls r0, 6 - adds r1, r0 - adds r1, r6 - ldrh r0, [r1] - cmp r0, 0 - beq _08158980 - bl sub_80DD9F0 - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x1 - bne _08158980 - movs r5, 0x1 - b _08158986 - .pool -_08158980: - adds r4, 0x1 - cmp r4, 0x3 - ble _08158950 -_08158986: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - strh r5, [r0, 0x18] - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8158948 - - thumb_func_start sub_81589A4 -sub_81589A4: @ 81589A4 - push {lr} - bl sub_8158948 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _081589DC - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081589E4 - .pool -_081589DC: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x4 - str r0, [r1] -_081589E4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81589A4 - - thumb_func_start sub_81589EC -sub_81589EC: @ 81589EC - push {lr} - bl sub_8158948 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08158A24 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08158A2C - .pool -_08158A24: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x4 - str r0, [r1] -_08158A2C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81589EC - - thumb_func_start sub_8158A34 -sub_8158A34: @ 8158A34 - push {r4-r6,lr} - movs r6, 0 - ldr r3, =0x0203ab38 - ldr r0, [r3] - ldrb r5, [r0, 0x1] - ldrb r0, [r0, 0x2] - lsls r0, 8 - orrs r5, r0 - movs r4, 0 - ldr r0, =0x02039e00 - mov r12, r0 - ldr r2, =0x02039f34 - ldr r0, [r2] - ldr r0, [r0, 0xC] - adds r0, 0x41 - ldrb r0, [r0] - lsls r0, 6 - mov r1, r12 - adds r1, 0x1E - adds r0, r1 - ldrh r0, [r0] - b _08158A88 - .pool -_08158A6C: - adds r4, 0x1 - cmp r4, 0x3 - bgt _08158A8E - lsls r1, r4, 1 - ldr r0, [r2] - ldr r0, [r0, 0xC] - adds r0, 0x41 - ldrb r0, [r0] - lsls r0, 6 - adds r1, r0 - mov r0, r12 - adds r0, 0x1E - adds r1, r0 - ldrh r0, [r1] -_08158A88: - cmp r0, r5 - bne _08158A6C - movs r6, 0x1 -_08158A8E: - ldr r0, [r2] - ldr r0, [r0, 0xC] - strh r6, [r0, 0x18] - ldr r0, [r3] - adds r0, 0x3 - str r0, [r3] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8158A34 - - thumb_func_start sub_8158AA0 -sub_8158AA0: @ 8158AA0 - push {lr} - bl sub_8158A34 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08158AD8 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08158AE0 - .pool -_08158AD8: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x4 - str r0, [r1] -_08158AE0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8158AA0 - - thumb_func_start sub_8158AE8 -sub_8158AE8: @ 8158AE8 - push {lr} - bl sub_8158A34 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0xC] - movs r1, 0x18 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08158B20 - ldr r3, =0x0203ab38 - ldr r2, [r3] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0x2] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0x3] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _08158B28 - .pool -_08158B20: - ldr r1, =0x0203ab38 - ldr r0, [r1] - adds r0, 0x4 - str r0, [r1] -_08158B28: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8158AE8 - - thumb_func_start sub_8158B30 -sub_8158B30: @ 8158B30 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r6, r0, 2 - adds r6, r0 - lsls r6, 3 - adds r6, r1 - ldr r1, =0x0203841e - ldrh r0, [r1] - strh r0, [r6, 0x8] - ldrh r0, [r1, 0x2] - strh r0, [r6, 0xA] - movs r0, 0x40 - negs r0, r0 - bl sub_80A5178 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x3F - bl sub_80A5178 - adds r5, r0, 0 - lsls r4, 24 - asrs r4, 24 - lsls r5, 24 - asrs r5, 24 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - bl sub_80A5314 - strh r4, [r6, 0xC] - strh r5, [r6, 0xE] - lsls r0, 24 - asrs r0, 24 - strh r0, [r6, 0x10] - movs r0, 0xA - strh r0, [r6, 0x1C] - ldr r0, =sub_8158B98 - str r0, [r6] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8158B30 - - thumb_func_start sub_8158B98 -sub_8158B98: @ 8158B98 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r5, [r4, 0xC] - ldrb r6, [r4, 0x10] - ldrh r0, [r4, 0x1E] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6F - bne _08158BD0 - movs r0, 0x5 - strh r0, [r4, 0x1C] - strh r1, [r4, 0x1E] - ldr r0, =sub_8158C04 - str r0, [r4] - b _08158BFE - .pool -_08158BD0: - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - strh r0, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB - bne _08158BEA - strh r1, [r4, 0x1C] - ldrh r0, [r4, 0x8] - lsls r1, r5, 24 - asrs r1, 24 - bl audio_play_and_stuff -_08158BEA: - lsls r1, r6, 24 - asrs r1, 24 - lsls r0, r5, 16 - asrs r0, 16 - adds r0, r1 - lsls r0, 16 - asrs r0, 16 - bl sub_80A52EC - strh r0, [r4, 0xC] -_08158BFE: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8158B98 - - thumb_func_start sub_8158C04 -sub_8158C04: @ 8158C04 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - strh r0, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bne _08158C4C - movs r0, 0 - strh r0, [r4, 0x1C] - movs r0, 0x3F - bl sub_80A5178 - adds r1, r0, 0 - ldrh r0, [r4, 0xA] - lsls r1, 24 - asrs r1, 24 - bl audio_play_and_stuff - ldrh r0, [r4, 0x1E] - adds r0, 0x1 - strh r0, [r4, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _08158C4C - adds r0, r5, 0 - bl move_anim_related_task_del -_08158C4C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8158C04 - - thumb_func_start mas_80DCF38 -mas_80DCF38: @ 8158C58 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =0x0203841e - ldrh r1, [r0] - str r1, [sp] - ldrb r5, [r0, 0x4] - ldrb r6, [r0, 0x6] - ldrb r3, [r0, 0x8] - mov r10, r3 - ldrb r7, [r0, 0xA] - ldrb r1, [r0, 0xC] - mov r9, r1 - ldrb r0, [r0, 0x2] - lsls r0, 24 - asrs r0, 24 - bl sub_80A5178 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - asrs r5, 24 - adds r0, r5, 0 - bl sub_80A5178 - adds r5, r0, 0 - lsls r4, 24 - asrs r4, 24 - lsls r5, 24 - asrs r5, 24 - lsls r6, 24 - asrs r6, 24 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - bl sub_80A5314 - ldr r2, =0x03005e00 - mov r3, r8 - lsls r1, r3, 2 - add r1, r8 - lsls r1, 3 - adds r1, r2 - movs r2, 0 - mov r6, sp - ldrh r6, [r6] - strh r6, [r1, 0x8] - strh r4, [r1, 0xA] - strh r5, [r1, 0xC] - lsls r0, 24 - asrs r0, 24 - strh r0, [r1, 0xE] - mov r0, r10 - strh r0, [r1, 0x10] - strh r7, [r1, 0x12] - mov r3, r9 - strh r3, [r1, 0x14] - strh r2, [r1, 0x1C] - strh r4, [r1, 0x1E] - strh r3, [r1, 0x20] - ldr r2, =sub_8158D08 - str r2, [r1] - mov r0, r8 - bl _call_via_r2 - 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 mas_80DCF38 - - thumb_func_start sub_8158D08 -sub_8158D08: @ 8158D08 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x20] - adds r1, r0, 0x1 - strh r1, [r4, 0x20] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x14 - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _08158D50 - movs r0, 0 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x8] - movs r1, 0x1E - ldrsb r1, [r4, r1] - bl audio_play_and_stuff - ldrh r0, [r4, 0x10] - subs r0, 0x1 - strh r0, [r4, 0x10] - lsls r0, 16 - cmp r0, 0 - bne _08158D50 - adds r0, r5, 0 - bl move_anim_related_task_del - b _08158D82 - .pool -_08158D50: - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x1C] - adds r1, r0, 0x1 - strh r1, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x12 - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _08158D82 - movs r0, 0 - strh r0, [r4, 0x1C] - ldrh r0, [r4, 0xE] - ldrh r1, [r4, 0x1E] - adds r0, r1 - strh r0, [r4, 0x1E] - movs r2, 0x1E - ldrsh r0, [r4, r2] - bl sub_80A52EC - strh r0, [r4, 0x1E] -_08158D82: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8158D08 - - thumb_func_start sub_8158D8C -sub_8158D8C: @ 8158D8C - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - movs r0, 0x40 - negs r0, r0 - bl sub_80A5178 - lsls r0, 24 - lsrs r6, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _08158DD0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08158DC8 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldrh r4, [r0] - b _08158E76 - .pool -_08158DC8: - adds r0, r5, 0 - bl move_anim_task_del - b _08158E76 -_08158DD0: - ldr r0, =0x0203841e - movs r2, 0 - ldrsh r1, [r0, r2] - adds r2, r0, 0 - cmp r1, 0 - bne _08158DEC - ldr r0, =0x02038436 - ldrb r4, [r0] - b _08158E12 - .pool -_08158DEC: - cmp r1, 0x1 - bne _08158DFC - ldr r0, =0x02038437 - ldrb r4, [r0] - b _08158E12 - .pool -_08158DFC: - cmp r1, 0x2 - bne _08158E08 - ldr r0, =0x02038436 - b _08158E0A - .pool -_08158E08: - ldr r0, =0x02038437 -_08158E0A: - ldrb r1, [r0] - movs r0, 0x2 - adds r4, r0, 0 - eors r4, r1 -_08158E12: - movs r1, 0 - ldrsh r0, [r2, r1] - cmp r0, 0x1 - beq _08158E1E - cmp r0, 0x3 - bne _08158E38 -_08158E1E: - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - bne _08158E38 - adds r0, r5, 0 - bl move_anim_task_del - b _08158E8C - .pool -_08158E38: - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08158E5C - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - b _08158E6A - .pool -_08158E5C: - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec -_08158E6A: - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 -_08158E76: - cmp r4, 0 - beq _08158E86 - lsls r1, r6, 24 - asrs r1, 24 - adds r0, r4, 0 - movs r2, 0x3 - bl sub_80A32E4 -_08158E86: - adds r0, r5, 0 - bl move_anim_task_del -_08158E8C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8158D8C - - thumb_func_start sub_8158E9C -sub_8158E9C: @ 8158E9C - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 - movs r0, 0x40 - negs r0, r0 - bl sub_80A5178 - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _08158EE0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08158ED8 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldrh r4, [r0] - b _08158F86 - .pool -_08158ED8: - adds r0, r6, 0 - bl move_anim_task_del - b _08158F86 -_08158EE0: - ldr r0, =0x0203841e - movs r2, 0 - ldrsh r1, [r0, r2] - adds r2, r0, 0 - cmp r1, 0 - bne _08158EFC - ldr r0, =0x02038436 - ldrb r4, [r0] - b _08158F22 - .pool -_08158EFC: - cmp r1, 0x1 - bne _08158F0C - ldr r0, =0x02038437 - ldrb r4, [r0] - b _08158F22 - .pool -_08158F0C: - cmp r1, 0x2 - bne _08158F18 - ldr r0, =0x02038436 - b _08158F1A - .pool -_08158F18: - ldr r0, =0x02038437 -_08158F1A: - ldrb r1, [r0] - movs r0, 0x2 - adds r4, r0, 0 - eors r4, r1 -_08158F22: - movs r1, 0 - ldrsh r0, [r2, r1] - cmp r0, 0x1 - beq _08158F2E - cmp r0, 0x3 - bne _08158F48 -_08158F2E: - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - bne _08158F48 - adds r0, r6, 0 - bl move_anim_task_del - b _08158FEE - .pool -_08158F48: - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08158F6C - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - b _08158F7A - .pool -_08158F6C: - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec -_08158F7A: - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 -_08158F86: - ldr r1, =0x03005e00 - lsls r2, r6, 2 - adds r0, r2, r6 - lsls r0, 3 - adds r0, r1 - ldr r3, =0x0203841e - ldrh r1, [r3, 0x2] - strh r1, [r0, 0x8] - strh r4, [r0, 0xA] - lsls r1, r5, 24 - asrs r1, 24 - strh r1, [r0, 0xC] - adds r5, r2, 0 - cmp r4, 0 - beq _08158FE8 - movs r2, 0x2 - ldrsh r0, [r3, r2] - cmp r0, 0xFF - bne _08158FC8 - adds r0, r4, 0 - movs r2, 0x9 - bl sub_80A32E4 - b _08158FD0 - .pool -_08158FC8: - adds r0, r4, 0 - movs r2, 0x7 - bl sub_80A32E4 -_08158FD0: - ldr r0, =0x03005e00 - adds r1, r5, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8158FF4 - str r0, [r1] - b _08158FEE - .pool -_08158FE8: - adds r0, r6, 0 - bl move_anim_task_del -_08158FEE: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8158E9C - - thumb_func_start sub_8158FF4 -sub_8158FF4: @ 8158FF4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r4, r0, 24 - mov r9, r4 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r1 - ldrh r6, [r1, 0xA] - mov r8, r6 - ldrb r5, [r1, 0xC] - adds r7, r5, 0 - ldrh r2, [r1, 0x1A] - movs r3, 0x1A - ldrsh r0, [r1, r3] - cmp r0, 0x1 - bgt _08159028 - adds r0, r2, 0x1 - strh r0, [r1, 0x1A] - b _0815906A - .pool -_08159028: - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0xFF - bne _0815904E - bl sub_80A36EC - lsls r0, 24 - cmp r0, 0 - bne _0815906A - lsls r1, r5, 24 - asrs r1, 24 - adds r0, r6, 0 - movs r2, 0xA - bl sub_80A32E4 - adds r0, r4, 0 - bl move_anim_task_del - b _0815906A -_0815904E: - bl sub_80A36EC - lsls r0, 24 - cmp r0, 0 - bne _0815906A - lsls r1, r7, 24 - asrs r1, 24 - mov r0, r8 - movs r2, 0x8 - bl sub_80A32E4 - mov r0, r9 - bl move_anim_task_del -_0815906A: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8158FF4 - - thumb_func_start sub_8159078 -sub_8159078: @ 8159078 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r1 - ldrh r2, [r1, 0x1A] - movs r3, 0x1A - ldrsh r0, [r1, r3] - cmp r0, 0x1 - bgt _081590A0 - adds r0, r2, 0x1 - strh r0, [r1, 0x1A] - b _081590B0 - .pool -_081590A0: - bl sub_80A36EC - lsls r0, 24 - cmp r0, 0 - bne _081590B0 - adds r0, r4, 0 - bl move_anim_task_del -_081590B0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8159078 - - thumb_func_start sub_81590B8 -sub_81590B8: @ 81590B8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =0x0203841e - ldrh r1, [r1] - strh r1, [r0, 0x1C] - movs r0, 0x40 - negs r0, r0 - bl sub_80A5178 - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _081590F8 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x18] - b _08159102 - .pool -_081590F8: - ldr r1, =0x02038438 - ldr r0, =0x02038436 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 -_08159102: - ldrh r2, [r0] - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - strh r2, [r1, 0xA] - lsls r0, r5, 24 - asrs r0, 24 - strh r0, [r1, 0xC] - cmp r2, 0 - beq _08159130 - ldr r0, =sub_815913C - str r0, [r1] - b _08159136 - .pool -_08159130: - adds r0, r4, 0 - bl move_anim_task_del -_08159136: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81590B8 - - thumb_func_start sub_815913C -sub_815913C: @ 815913C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrh r6, [r0, 0xA] - mov r8, r6 - ldrb r3, [r0, 0xC] - adds r5, r3, 0 - movs r7, 0x1A - ldrsh r2, [r0, r7] - mov r12, r1 - cmp r2, 0x5 - bhi _081591DC - lsls r0, r2, 2 - ldr r1, =_08159174 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08159174: - .4byte _081591C2 - .4byte _081591A8 - .4byte _0815918C - .4byte _081591A8 - .4byte _081591A8 - .4byte _081591B8 -_0815918C: - lsls r1, r5, 24 - asrs r1, 24 - mov r0, r8 - movs r2, 0x4 - bl play_cry_maybe - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - b _081591B0 - .pool -_081591A8: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - add r0, r12 -_081591B0: - ldrh r1, [r0, 0x1A] - adds r1, 0x1 - strh r1, [r0, 0x1A] - b _08159204 -_081591B8: - bl sub_80A36EC - lsls r0, 24 - cmp r0, 0 - bne _08159204 -_081591C2: - bl sub_80A369C - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x1A] - adds r0, 0x1 - strh r0, [r1, 0x1A] - b _08159204 - .pool -_081591DC: - movs r1, 0x1C - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _081591F2 - lsls r1, r3, 24 - asrs r1, 24 - adds r0, r6, 0 - movs r2, 0x6 - bl play_cry_maybe - b _081591FE -_081591F2: - lsls r1, r5, 24 - asrs r1, 24 - mov r0, r8 - movs r2, 0x6 - bl sub_80A32E4 -_081591FE: - adds r0, r4, 0 - bl move_anim_task_del -_08159204: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815913C - - thumb_func_start sub_8159210 -sub_8159210: @ 8159210 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x0203841e - ldrh r5, [r0] - ldrb r0, [r0, 0x2] - lsls r0, 24 - asrs r0, 24 - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - adds r0, r5, 0 - bl sub_80A3808 - adds r0, r4, 0 - bl move_anim_task_del - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159210 - - thumb_func_start sub_8159244 -sub_8159244: @ 8159244 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x0203841e - ldrh r5, [r0] - ldrb r0, [r0, 0x2] - lsls r0, 24 - asrs r0, 24 - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - adds r0, r5, 0 - bl sub_80A383C - adds r0, r4, 0 - bl move_anim_task_del - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159244 - - thumb_func_start sub_8159278 -sub_8159278: @ 8159278 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - mov r8, r0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =0x0203841e - ldrb r5, [r0, 0x2] - ldrb r6, [r0, 0x4] - ldrh r1, [r0, 0x6] - mov r9, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - bl sub_80A5178 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - asrs r5, 24 - adds r0, r5, 0 - bl sub_80A5178 - adds r5, r0, 0 - lsls r4, 24 - asrs r4, 24 - lsls r5, 24 - asrs r5, 24 - lsls r6, 24 - asrs r6, 24 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - bl sub_80A5314 - ldr r2, =0x03005e00 - mov r3, r8 - lsls r1, r3, 2 - add r1, r8 - lsls r1, 3 - adds r1, r2 - movs r2, 0 - strh r4, [r1, 0xA] - strh r5, [r1, 0xC] - lsls r0, 24 - asrs r0, 24 - strh r0, [r1, 0xE] - mov r0, r9 - strh r0, [r1, 0x12] - strh r2, [r1, 0x1C] - strh r4, [r1, 0x1E] - ldr r2, =sub_8159308 - str r2, [r1] - mov r0, r8 - bl _call_via_r2 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159278 - - thumb_func_start sub_8159308 -sub_8159308: @ 8159308 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r2, [r4, 0xE] - ldrh r0, [r4, 0x1C] - adds r1, r0, 0x1 - strh r1, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x12 - ldrsh r1, [r4, r3] - cmp r0, r1 - bne _08159342 - movs r0, 0 - strh r0, [r4, 0x1C] - ldrh r1, [r4, 0x1E] - adds r0, r2, r1 - strh r0, [r4, 0x1E] - movs r2, 0x1E - ldrsh r0, [r4, r2] - bl sub_80A52EC - strh r0, [r4, 0x1E] -_08159342: - ldr r1, =0x02038440 - ldrh r0, [r4, 0x1E] - strb r0, [r1] - movs r3, 0x1E - ldrsh r1, [r4, r3] - movs r2, 0xC - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _0815935A - adds r0, r5, 0 - bl move_anim_task_del -_0815935A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159308 - - thumb_func_start nullsub_114 -nullsub_114: @ 8159368 - bx lr - thumb_func_end nullsub_114 - - thumb_func_start sub_815936C -sub_815936C: @ 815936C - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_exec_buffer_A_ch0_tbl6 - str r1, [r0] - bx lr - .pool - thumb_func_end sub_815936C - - thumb_func_start bx_exec_buffer_A_ch0_tbl6 -bx_exec_buffer_A_ch0_tbl6: @ 8159388 - push {lr} - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldr r0, =0x02024064 - ldrb r3, [r0] - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _081593D4 - ldr r0, =0x02023064 - lsls r1, r3, 9 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x38 - bhi _081593D0 - ldr r0, =gUnknown_085CDF20 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 - b _081593D4 - .pool -_081593D0: - bl dp01_tbl6_exec_completed -_081593D4: - pop {r0} - bx r0 - thumb_func_end bx_exec_buffer_A_ch0_tbl6 - - thumb_func_start bx_battle_menu_t6_2 -bx_battle_menu_t6_2: @ 81593D8 - push {r4,r5,lr} - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r2, 0x1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _08159446 - movs r0, 0x5 - bl audio_play - ldr r1, =0x020244ac - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08159424 - cmp r0, 0x1 - bgt _08159414 - cmp r0, 0 - beq _0815941E - b _08159440 - .pool -_08159414: - cmp r0, 0x2 - beq _0815942A - cmp r0, 0x3 - beq _08159436 - b _08159440 -_0815941E: - movs r0, 0x1 - movs r1, 0x5 - b _0815942E -_08159424: - movs r0, 0x1 - movs r1, 0x6 - b _0815942E -_0815942A: - movs r0, 0x1 - movs r1, 0x7 -_0815942E: - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - b _08159440 -_08159436: - movs r0, 0x1 - movs r1, 0x8 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb -_08159440: - bl dp01_tbl6_exec_completed - b _0815954E -_08159446: - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08159484 - ldr r5, =0x020244ac - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _0815954E - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl sub_8059CF8 - ldrb r1, [r4] - adds r1, r5 - ldrb r0, [r1] - movs r2, 0x1 - b _081594F2 - .pool -_08159484: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _081594C0 - ldr r5, =0x020244ac - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _0815954E - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl sub_8059CF8 - ldrb r1, [r4] - adds r1, r5 - ldrb r0, [r1] - movs r2, 0x1 - b _081594F2 - .pool -_081594C0: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0815950C - ldr r5, =0x020244ac - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0815954E - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl sub_8059CF8 - ldrb r1, [r4] - adds r1, r5 - ldrb r0, [r1] - movs r2, 0x2 -_081594F2: - eors r0, r2 - strb r0, [r1] - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - movs r1, 0 - bl sub_8059CB4 - b _0815954E - .pool -_0815950C: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0815954E - ldr r5, =0x020244ac - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0815954E - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl sub_8059CF8 - ldrb r1, [r4] - adds r1, r5 - ldrb r0, [r1] - movs r2, 0x2 - eors r0, r2 - strb r0, [r1] - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - movs r1, 0 - bl sub_8059CB4 -_0815954E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end bx_battle_menu_t6_2 - - thumb_func_start sub_815955C -sub_815955C: @ 815955C - push {lr} - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - 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, =DummyObjectCallback - cmp r1, r0 - bne _08159580 - bl dp01_tbl6_exec_completed -_08159580: - pop {r0} - bx r0 - .pool - thumb_func_end sub_815955C - - thumb_func_start bx_t6_button_a -bx_t6_button_a: @ 8159594 - push {lr} - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _081595A6 - bl dp01_tbl6_exec_completed -_081595A6: - pop {r0} - bx r0 - thumb_func_end bx_t6_button_a - - thumb_func_start sub_81595AC -sub_81595AC: @ 81595AC - push {lr} - ldr r2, =0x02020630 - ldr r1, =0x03005d70 - ldr r0, =0x02024064 - 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, =DummyObjectCallback - cmp r1, r0 - bne _081595D0 - bl dp01_tbl6_exec_completed -_081595D0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81595AC - - thumb_func_start sub_81595E4 -sub_81595E4: @ 81595E4 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0815960E - ldr r2, =0x030022c0 - ldr r0, =0x00000439 - adds r3, r2, r0 - ldrb r1, [r3] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - ldr r0, =0x03005d00 - ldr r0, [r0] - str r0, [r2] - ldr r0, [r2, 0x8] - bl SetMainCallback2 -_0815960E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81595E4 - - thumb_func_start bx_wait_t6 -bx_wait_t6: @ 8159624 - push {lr} - ldr r0, =0x020244b9 - ldrb r0, [r0] - cmp r0, 0 - beq _0815964A - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0815964E -_0815964A: - bl dp01_tbl6_exec_completed -_0815964E: - pop {r0} - bx r0 - .pool - thumb_func_end bx_wait_t6 - - thumb_func_start sub_8159660 -sub_8159660: @ 8159660 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08159684 - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8159698 - str r1, [r0] - bl FreeAllWindowBuffers - bl sub_81358F4 -_08159684: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159660 - - thumb_func_start sub_8159698 -sub_8159698: @ 8159698 - push {lr} - ldr r0, =0x030022c0 - ldr r1, [r0, 0x4] - ldr r0, =sub_8038420 - cmp r1, r0 - bne _081596BE - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081596BE - ldr r0, =0x0203ce7c - ldrh r1, [r0] - movs r0, 0x1 - bl dp01_build_cmdbuf_x23_aa_0 - bl dp01_tbl6_exec_completed -_081596BE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159698 - - thumb_func_start sub_81596D4 -sub_81596D4: @ 81596D4 - push {lr} - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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 _081596F6 - bl dp01_tbl6_exec_completed -_081596F6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81596D4 - - thumb_func_start dp01_tbl6_exec_completed -dp01_tbl6_exec_completed: @ 8159704 - push {r4,lr} - sub sp, 0x4 - ldr r1, =0x03005d60 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_exec_buffer_A_ch0_tbl6 - str r1, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08159758 - bl link_get_multiplayer_id - mov r1, sp - strb r0, [r1] - movs r0, 0x2 - movs r1, 0x4 - mov r2, sp - bl dp01_prepare_buffer_wireless_probably - ldr r1, =0x02023064 - ldrb r0, [r4] - lsls r0, 9 - adds r0, r1 - movs r1, 0x38 - strb r1, [r0] - b _0815976A - .pool -_08159758: - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldr r0, [r2] - bics r0, r1 - str r0, [r2] -_0815976A: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_tbl6_exec_completed - - thumb_func_start bx_80364D0 -bx_80364D0: @ 815977C - push {lr} - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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 _0815979E - bl dp01_tbl6_exec_completed -_0815979E: - pop {r0} - bx r0 - .pool - thumb_func_end bx_80364D0 - - thumb_func_start sub_81597AC -sub_81597AC: @ 81597AC - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81597AC - - thumb_func_start sub_81597B8 -sub_81597B8: @ 81597B8 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81597B8 - - thumb_func_start sub_81597C4 -sub_81597C4: @ 81597C4 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81597C4 - - thumb_func_start sub_81597D0 -sub_81597D0: @ 81597D0 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81597D0 - - thumb_func_start sub_81597DC -sub_81597DC: @ 81597DC - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81597DC - - thumb_func_start sub_81597E8 -sub_81597E8: @ 81597E8 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81597E8 - - thumb_func_start sub_81597F4 -sub_81597F4: @ 81597F4 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81597F4 - - thumb_func_start sub_8159800 -sub_8159800: @ 8159800 - push {r4-r6,lr} - ldr r4, =0x03005d90 - ldr r0, [r4] - ldrb r0, [r0, 0x8] - ldr r5, =0x02024064 - ldrb r1, [r5] - bl sub_805DF84 - ldr r0, [r4] - ldrb r6, [r0, 0x8] - ldrb r0, [r5] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl template_build_for_pokemon_or_trainer - ldr r0, =0x0202499c - ldr r2, =gUnknown_08305D2C - ldr r1, [r4] - ldrb r1, [r1, 0x8] - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1] - movs r2, 0x8 - subs r2, r1 - lsls r2, 18 - movs r1, 0xA0 - lsls r1, 15 - adds r2, r1 - asrs r2, 16 - movs r1, 0x50 - movs r3, 0x1E - bl AddObjectToFront - ldr r6, =0x020241e4 - ldrb r1, [r5] - adds r1, r6 - strb r0, [r1] - ldr r4, =0x02020630 - 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] - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_815955C - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159800 - - thumb_func_start sub_81598E0 -sub_81598E0: @ 81598E0 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81598E0 - - thumb_func_start sub_81598EC -sub_81598EC: @ 81598EC - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81598EC - - thumb_func_start sub_81598F8 -sub_81598F8: @ 81598F8 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81598F8 - - thumb_func_start sub_8159904 -sub_8159904: @ 8159904 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159904 - - thumb_func_start sub_8159910 -sub_8159910: @ 8159910 - push {r4,r5,lr} - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0x8] - movs r0, 0x4 - strb r0, [r1, 0x8] - ldr r1, =0x020244b9 - movs r0, 0x1 - strb r0, [r1] - ldr r5, =0x02024064 - ldrb r4, [r5] - movs r0, 0x1 - bl battle_get_side_with_given_state - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r4, 0 - movs r3, 0x4 - bl move_anim_start_t4 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_wait_t6 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159910 - - thumb_func_start sub_8159964 -sub_8159964: @ 8159964 - push {r4,r5,lr} - ldr r1, =0x02023064 - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r1, [r0] - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - strb r1, [r0, 0x8] - ldr r1, =0x020244b9 - movs r0, 0x1 - strb r0, [r1] - ldrb r4, [r5] - movs r0, 0x1 - bl battle_get_side_with_given_state - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r4, 0 - movs r3, 0x4 - bl move_anim_start_t4 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_wait_t6 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159964 - - thumb_func_start sub_81599C4 -sub_81599C4: @ 81599C4 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81599C4 - - thumb_func_start sub_81599D0 -sub_81599D0: @ 81599D0 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_81599D0 - - thumb_func_start dp01t_10_6_message -dp01t_10_6_message: @ 81599DC - push {r4,lr} - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 9 - ldr r1, =0x02023066 - adds r0, r1 - ldrh r0, [r0] - bl battle_pick_message - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_t6_button_a - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_10_6_message - - thumb_func_start dp01t_11_6_message_for_player_only -dp01t_11_6_message_for_player_only: @ 8159A30 - push {lr} - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08159A4C - bl dp01t_10_6_message - b _08159A50 - .pool -_08159A4C: - bl dp01_tbl6_exec_completed -_08159A50: - pop {r0} - bx r0 - thumb_func_end dp01t_11_6_message_for_player_only - - thumb_func_start sub_8159A54 -sub_8159A54: @ 8159A54 - push {lr} - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08159A7A - ldr r0, =0x02022e14 - strh r1, [r0] - ldr r1, =0x02022e16 - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_battle_menu_t6_2 - str r1, [r0] -_08159A7A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159A54 - - thumb_func_start sub_8159A94 -sub_8159A94: @ 8159A94 - push {r4,lr} - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8159A54 - str r1, [r0] - ldr r0, =gUnknown_085CCA54 - movs r1, 0x2 - bl battle_show_message_maybe - movs r4, 0 -_08159AAE: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_8059CF8 - adds r4, 0x1 - cmp r4, 0x3 - ble _08159AAE - ldr r1, =0x020244ac - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - movs r1, 0 - bl sub_8059CB4 - ldr r0, =gUnknown_085CCA04 - bl get_battle_strings_ - ldr r0, =0x02022e2c - movs r1, 0x1 - bl battle_show_message_maybe - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159A94 - - thumb_func_start sub_8159AFC -sub_8159AFC: @ 8159AFC - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159AFC - - thumb_func_start sub_8159B08 -sub_8159B08: @ 8159B08 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159B08 - - thumb_func_start sub_8159B14 -sub_8159B14: @ 8159B14 - push {lr} - sub sp, 0x4 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x03005d60 - ldr r2, =0x02024064 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8159660 - str r1, [r0] - ldr r1, =0x020244b8 - ldrb r0, [r2] - strb r0, [r1] - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159B14 - - thumb_func_start sub_8159B54 -sub_8159B54: @ 8159B54 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159B54 - - thumb_func_start sub_8159B60 -sub_8159B60: @ 8159B60 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159B60 - - thumb_func_start sub_8159B6C -sub_8159B6C: @ 8159B6C - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159B6C - - thumb_func_start sub_8159B78 -sub_8159B78: @ 8159B78 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159B78 - - thumb_func_start sub_8159B84 -sub_8159B84: @ 8159B84 - push {lr} - ldr r0, =0x03005d70 - ldr r1, =0x02024064 - ldrb r1, [r1] - adds r0, r1, r0 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0xB - bl healthbar_draw_field_maybe - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159B84 - - thumb_func_start sub_8159BC0 -sub_8159BC0: @ 8159BC0 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159BC0 - - thumb_func_start sub_8159BCC -sub_8159BCC: @ 8159BCC - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159BCC - - thumb_func_start sub_8159BD8 -sub_8159BD8: @ 8159BD8 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159BD8 - - thumb_func_start sub_8159BE4 -sub_8159BE4: @ 8159BE4 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159BE4 - - thumb_func_start sub_8159BF0 -sub_8159BF0: @ 8159BF0 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159BF0 - - thumb_func_start sub_8159BFC -sub_8159BFC: @ 8159BFC - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159BFC - - thumb_func_start sub_8159C08 -sub_8159C08: @ 8159C08 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159C08 - - thumb_func_start sub_8159C14 -sub_8159C14: @ 8159C14 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159C14 - - thumb_func_start sub_8159C20 -sub_8159C20: @ 8159C20 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159C20 - - thumb_func_start sub_8159C2C -sub_8159C2C: @ 8159C2C - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159C2C - - thumb_func_start sub_8159C38 -sub_8159C38: @ 8159C38 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159C38 - - thumb_func_start sub_8159C44 -sub_8159C44: @ 8159C44 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159C44 - - thumb_func_start sub_8159C50 -sub_8159C50: @ 8159C50 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159C50 - - thumb_func_start sub_8159C5C -sub_8159C5C: @ 8159C5C - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159C5C - - thumb_func_start sub_8159C68 -sub_8159C68: @ 8159C68 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159C68 - - thumb_func_start sub_8159C74 -sub_8159C74: @ 8159C74 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159C74 - - thumb_func_start sub_8159C80 -sub_8159C80: @ 8159C80 - push {r4,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - movs r3, 0x3F - cmp r0, 0 - bne _08159C94 - movs r3, 0xC0 -_08159C94: - ldr r2, =0x02023064 - 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 audio_play_and_stuff - bl dp01_tbl6_exec_completed - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159C80 - - thumb_func_start dp01t_34_6_move_anim_start_t3 -dp01t_34_6_move_anim_start_t3: @ 8159CC4 - push {r4,r5,lr} - ldr r4, =0x02023064 - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r3, r0, 9 - adds r0, r4, 0x3 - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0 - beq _08159D00 - 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 song_play_for_text - b _08159D14 - .pool -_08159D00: - 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 fanfare_play -_08159D14: - bl dp01_tbl6_exec_completed - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end dp01t_34_6_move_anim_start_t3 - - thumb_func_start sub_8159D20 -sub_8159D20: @ 8159D20 - push {lr} - ldr r1, =0x0202406e - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x19 - bl cry_related - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159D20 - - thumb_func_start dp01t_2E_6_battle_intro -dp01t_2E_6_battle_intro: @ 8159D5C - push {lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - bl battle_intro_launch - ldr r2, =0x020243fc - ldrh r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strh r0, [r2] - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_2E_6_battle_intro - - thumb_func_start sub_8159D90 -sub_8159D90: @ 8159D90 - push {r4,r5,lr} - ldr r5, =0x03005d70 - ldr r4, =0x02024064 - ldrb r1, [r4] - adds r0, r1, r5 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0xA - bl healthbar_draw_field_maybe - ldrb r0, [r4] - bl sub_8076918 - ldrb r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl sub_80729D0 - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_81595AC - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159D90 - - thumb_func_start sub_8159DEC -sub_8159DEC: @ 8159DEC - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159DEC - - thumb_func_start sub_8159DF8 -sub_8159DF8: @ 8159DF8 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159DF8 - - thumb_func_start sub_8159E04 -sub_8159E04: @ 8159E04 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159E04 - - thumb_func_start sub_8159E10 -sub_8159E10: @ 8159E10 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159E10 - - thumb_func_start sub_8159E1C -sub_8159E1C: @ 8159E1C - push {r4-r6,lr} - sub sp, 0x4 - ldr r5, =0x02023064 - ldr r6, =0x02024064 - 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 _08159E5C - bl dp01_tbl6_exec_completed - b _08159E68 - .pool -_08159E5C: - ldr r0, =0x03005d60 - ldrb r1, [r6] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_81596D4 - str r0, [r1] -_08159E68: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159E1C - - thumb_func_start sub_8159E78 -sub_8159E78: @ 8159E78 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159E78 - - thumb_func_start sub_8159E84 -sub_8159E84: @ 8159E84 - push {lr} - bl dp01_tbl6_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8159E84 - - thumb_func_start sub_8159E90 -sub_8159E90: @ 8159E90 - push {r4,lr} - ldr r2, =0x0202433a - ldr r1, =0x02023064 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - movs r0, 0x5 - bl sub_80A2F50 - movs r0, 0x3 - bl sub_80A2390 - bl dp01_tbl6_exec_completed - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x6 - ands r0, r1 - cmp r0, 0x2 - bne _08159ECC - ldr r0, =0x03005d60 - ldrb r1, [r4] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_81595E4 - str r0, [r1] -_08159ECC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159E90 - - thumb_func_start nullsub_115 -nullsub_115: @ 8159EEC - bx lr - thumb_func_end nullsub_115 - - thumb_func_start sub_8159EF0 -sub_8159EF0: @ 8159EF0 - ldr r1, =0x03005db0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =0x0203ceec - ldr r0, =hm2_sweet_scent - str r0, [r1] - movs r0, 0x1 - bx lr - .pool - thumb_func_end sub_8159EF0 - - thumb_func_start hm2_sweet_scent -hm2_sweet_scent: @ 8159F10 - push {lr} - movs r0, 0x33 - bl FieldEffectStart - bl brm_get_pokemon_selection - ldr r1, =0x02038c08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end hm2_sweet_scent - - thumb_func_start sub_8159F2C -sub_8159F2C: @ 8159F2C - push {lr} - bl sub_80AC3D0 - bl oei_task_add - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =sub_8159F5C - lsrs r0, r2, 16 - strh r0, [r1, 0x18] - strh r2, [r1, 0x1A] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8159F2C - - thumb_func_start sub_8159F5C -sub_8159F5C: @ 8159F5C - push {r4,r5,lr} - sub sp, 0x4 - movs r0, 0xEC - bl audio_play - ldr r5, =0x02037714 - ldr r1, =0x02037fe8 - movs r4, 0x80 - lsls r4, 1 - adds r0, r5, 0 - adds r2, r4, 0 - bl CpuFastSet - ldr r0, =0x02037b14 - adds r1, r5, 0 - adds r2, r4, 0 - bl CpuFastSet - bl GetPlayerAvatarObjectId - ldr r2, =0x02020630 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1, 0x5] - lsrs r1, 4 - adds r1, 0x10 - movs r0, 0x1 - lsls r0, r1 - mvns r0, r0 - movs r1, 0x1F - str r1, [sp] - movs r1, 0x4 - movs r2, 0 - movs r3, 0x8 - bl pal_fade_maybe - ldr r0, =sub_8159FEC - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0 - strh r0, [r1, 0x8] - movs r0, 0x33 - bl FieldEffectActiveListRemove - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8159F5C - - thumb_func_start sub_8159FEC -sub_8159FEC: @ 8159FEC - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _0815A088 - bl sub_81BE72C - movs r0, 0x40 - movs r1, 0x8 - movs r2, 0x1F - bl sub_80A2A20 - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r4, r1, r0 - ldrh r1, [r4, 0x8] - movs r2, 0x8 - ldrsh r0, [r4, r2] - cmp r0, 0x40 - bne _0815A084 - strh r6, [r4, 0x8] - bl sub_80B5578 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815A044 - adds r0, r5, 0 - bl DestroyTask - b _0815A088 - .pool -_0815A044: - ldr r0, =sub_815A090 - str r0, [r4] - bl GetPlayerAvatarObjectId - ldr r2, =0x02020630 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r1, [r1, 0x5] - lsrs r1, 4 - adds r1, 0x10 - movs r0, 0x1 - lsls r0, r1 - mvns r0, r0 - movs r1, 0x1F - str r1, [sp] - movs r1, 0x4 - movs r2, 0x8 - movs r3, 0 - bl pal_fade_maybe - bl sub_81BE6B8 - b _0815A088 - .pool -_0815A084: - adds r0, r1, 0x1 - strh r0, [r4, 0x8] -_0815A088: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8159FEC - - thumb_func_start sub_815A090 -sub_815A090: @ 815A090 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0815A0BE - ldr r0, =0x02037fe8 - ldr r1, =0x02037714 - movs r2, 0x80 - lsls r2, 1 - bl CpuFastSet - bl sub_80AC3E4 - ldr r0, =gUnknown_08290CAE - bl script_env_1_execute_new_script - adds r0, r4, 0 - bl DestroyTask -_0815A0BE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A090 - - thumb_func_start sub_815A0D4 -sub_815A0D4: @ 815A0D4 - push {lr} - adds r2, r0, 0 - ldr r1, =0x0203841e - ldrh r0, [r1] - ldrh r3, [r2, 0x20] - adds r0, r3 - strh r0, [r2, 0x20] - ldrh r0, [r1, 0x2] - ldrh r3, [r2, 0x22] - adds r0, r3 - strh r0, [r2, 0x22] - movs r3, 0x6 - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _0815A0FC - ldrh r0, [r1, 0x4] - b _0815A100 - .pool -_0815A0FC: - ldrh r0, [r1, 0x4] - negs r0, r0 -_0815A100: - strh r0, [r2, 0x2E] - ldrh r0, [r1, 0x8] - strh r0, [r2, 0x30] - ldr r0, =sub_815A114 - str r0, [r2, 0x1C] - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A0D4 - - thumb_func_start sub_815A114 -sub_815A114: @ 815A114 - push {lr} - adds r3, r0, 0 - movs r1, 0x30 - ldrsh r0, [r3, r1] - cmp r0, 0 - ble _0815A154 - ldrh r1, [r3, 0x32] - lsls r0, r1, 16 - asrs r0, 24 - strh r0, [r3, 0x24] - ldrh r0, [r3, 0x2E] - adds r1, r0 - strh r1, [r3, 0x32] - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - 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 - mov r1, r12 - strb r0, [r1] - ldrh r0, [r3, 0x30] - subs r0, 0x1 - strh r0, [r3, 0x30] - b _0815A15A -_0815A154: - adds r0, r3, 0 - bl move_anim_8072740 -_0815A15A: - pop {r0} - bx r0 - thumb_func_end sub_815A114 - - thumb_func_start sub_815A160 -sub_815A160: @ 815A160 - push {r4-r6,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r6, =0x02038437 - ldrb r0, [r6] - movs r1, 0x2 - bl sub_80A5C6C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 8 - movs r0, 0x80 - lsls r0, 12 - adds r4, r0 - asrs r4, 16 - ldrb r0, [r6] - movs r1, 0x3 - bl sub_80A5C6C - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 8 - movs r0, 0x80 - lsls r0, 12 - adds r1, r0 - asrs r1, 16 - adds r0, r4, 0 - movs r2, 0 - bl sub_807521C - adds r0, r5, 0 - bl move_anim_task_del - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A160 - - thumb_func_start sub_815A1B0 -sub_815A1B0: @ 815A1B0 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x5A - strh r0, [r4, 0x2E] - ldr r0, =sub_80A64B0 - str r0, [r4, 0x1C] - movs r0, 0x7 - strh r0, [r4, 0x30] - ldr r1, =sub_815A1F4 - adds r0, r4, 0 - bl oamt_set_x3A_32 - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldrh r0, [r4, 0x30] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A1B0 - - thumb_func_start sub_815A1F4 -sub_815A1F4: @ 815A1F4 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldrh r0, [r4, 0x30] - subs r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - cmp r0, 0 - bge _0815A228 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815A234 - str r0, [r4, 0x1C] -_0815A228: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A1F4 - - thumb_func_start sub_815A234 -sub_815A234: @ 815A234 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl move_anim_8072740 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815A234 - - thumb_func_start sub_815A254 -sub_815A254: @ 815A254 - push {r4-r7,lr} - sub sp, 0x4 - adds r5, r0, 0 - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A6980 - ldrh r0, [r5, 0x20] - subs r0, r7 - lsls r0, 16 - asrs r0, 16 - ldrh r1, [r5, 0x22] - subs r1, r6 - lsls r1, 16 - asrs r1, 16 - bl sub_80A74F4 - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 23 - adds r0, r1 - lsrs r4, r0, 16 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0815A2B2 - movs r1, 0x80 - lsls r1, 7 - adds r0, r4, r1 - lsls r0, 16 - lsrs r4, r0, 16 -_0815A2B2: - movs r3, 0x80 - lsls r3, 1 - str r4, [sp] - adds r0, r5, 0 - movs r1, 0 - adds r2, r3, 0 - bl sub_80A73E0 - ldr r0, =0x0203841e - ldrh r0, [r0, 0x4] - strh r0, [r5, 0x2E] - strh r7, [r5, 0x32] - strh r6, [r5, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r5, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r5, 0 - bl oamt_set_x3A_32 - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A254 - - thumb_func_start sub_815A2F0 -sub_815A2F0: @ 815A2F0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x4 - strh r0, [r4, 0x2E] - ldr r0, =sub_815A31C - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A2F0 - - thumb_func_start sub_815A31C -sub_815A31C: @ 815A31C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815A342 - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - b _0815A346 -_0815A342: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 -_0815A346: - strh r0, [r4, 0x2E] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0xF - beq _0815A354 - cmp r0, 0x4 - bne _0815A35C -_0815A354: - ldrh r0, [r4, 0x30] - movs r1, 0x1 - eors r0, r1 - strh r0, [r4, 0x30] -_0815A35C: - ldrh r0, [r4, 0x32] - adds r1, r0, 0x1 - strh r1, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x46 - ble _0815A3A0 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - movs r0, 0 - strh r0, [r4, 0x32] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - subs r2, 0x12 - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815A3AC - str r0, [r4, 0x1C] -_0815A3A0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A31C - - thumb_func_start sub_815A3AC -sub_815A3AC: @ 815A3AC - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x32] - adds r1, r0, 0x1 - strh r1, [r3, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - ble _0815A3E8 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - subs r2, 0x12 - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - adds r0, r3, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0815A3E8 - ldr r0, =sub_815A3F0 - str r0, [r3, 0x1C] -_0815A3E8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A3AC - - thumb_func_start sub_815A3F0 -sub_815A3F0: @ 815A3F0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0x6 - bhi _0815A448 - lsls r0, 2 - ldr r1, =_0815A40C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815A40C: - .4byte _0815A428 - .4byte _0815A428 - .4byte _0815A432 - .4byte _0815A432 - .4byte _0815A440 - .4byte _0815A440 - .4byte _0815A448 -_0815A428: - movs r1, 0 - movs r0, 0x1 - strh r0, [r4, 0x24] - strh r1, [r4, 0x26] - b _0815A450 -_0815A432: - ldr r0, =0x0000ffff - strh r0, [r4, 0x24] - movs r0, 0 - b _0815A44E - .pool -_0815A440: - movs r0, 0 - strh r0, [r4, 0x24] - movs r0, 0x1 - b _0815A44E -_0815A448: - movs r0, 0 - strh r0, [r4, 0x24] - ldr r0, =0x0000ffff -_0815A44E: - strh r0, [r4, 0x26] -_0815A450: - ldrh r0, [r4, 0x34] - adds r0, 0x1 - movs r2, 0 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _0815A462 - strh r2, [r4, 0x34] -_0815A462: - ldrh r0, [r4, 0x36] - adds r1, r0, 0x1 - strh r1, [r4, 0x36] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - ble _0815A48C - movs r0, 0x10 - strh r0, [r4, 0x2E] - strh r2, [r4, 0x30] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldrh r1, [r4, 0x2E] - movs r0, 0x52 - bl SetGpuReg - ldr r0, =sub_815A49C - str r0, [r4, 0x1C] -_0815A48C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A3F0 - - thumb_func_start sub_815A49C -sub_815A49C: @ 815A49C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldrh r0, [r4, 0x30] - adds r1, r0, 0x1 - strh r1, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815A4CC - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x2E] - strh r1, [r4, 0x30] -_0815A4CC: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815A4E0 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_0815A4E0: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _0815A4FE - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl move_anim_8072740 -_0815A4FE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815A49C - - thumb_func_start sub_815A504 -sub_815A504: @ 815A504 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =sub_815A52C - str r0, [r1] - ldr r1, =0x020383fe - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_815A504 - - thumb_func_start sub_815A52C -sub_815A52C: @ 815A52C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A6D94 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r7, =0x03005e00 - lsls r5, r4, 2 - adds r1, r5, r4 - lsls r1, 3 - adds r1, r7 - ldrh r0, [r1, 0x12] - adds r0, 0x1 - strh r0, [r1, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0815A59C - ldr r0, =0x02037b14 - lsls r2, r6, 4 - adds r1, r2, 0 - adds r1, 0xB - lsls r1, 1 - adds r1, r0 - ldrh r3, [r1] - mov r8, r3 - movs r3, 0xA - mov r9, r7 - adds r7, r5, 0 - mov r12, r0 - adds r5, r2, 0 - lsls r0, r6, 5 - add r0, r12 - adds r2, r0, 0 - adds r2, 0x14 -_0815A57A: - ldrh r0, [r2] - strh r0, [r1] - subs r2, 0x2 - subs r1, 0x2 - subs r3, 0x1 - cmp r3, 0 - bgt _0815A57A - adds r0, r5, 0x1 - lsls r0, 1 - add r0, r12 - movs r1, 0 - mov r2, r8 - strh r2, [r0] - adds r0, r7, r4 - lsls r0, 3 - add r0, r9 - strh r1, [r0, 0x12] -_0815A59C: - ldr r0, =0x0203841e - ldrh r1, [r0, 0xE] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _0815A5AC - adds r0, r4, 0 - bl DestroyTask -_0815A5AC: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A52C - - thumb_func_start c3_80DE6F0 -c3_80DE6F0: @ 815A5C8 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =sub_815A5F0 - str r0, [r1] - ldr r1, =0x020383fe - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end c3_80DE6F0 - - thumb_func_start sub_815A5F0 -sub_815A5F0: @ 815A5F0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - bl sub_80A6D94 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r5, =0x03005e00 - mov r0, r8 - lsls r3, r0, 2 - adds r1, r3, r0 - lsls r1, 3 - adds r1, r5 - ldrh r0, [r1, 0x12] - adds r0, 0x1 - strh r0, [r1, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0815A692 - ldr r0, =0x02037b14 - lsls r2, r7, 4 - adds r1, r2, 0 - adds r1, 0xB - lsls r1, 1 - adds r1, r0 - ldrh r6, [r1] - movs r4, 0xA - mov r10, r3 - mov r9, r0 - adds r5, r2, 0 - ldr r2, =0x02037714 - mov r12, r2 - lsls r0, r7, 5 - add r0, r9 - adds r3, r0, 0 - adds r3, 0x14 -_0815A644: - ldrh r0, [r3] - strh r0, [r1] - subs r3, 0x2 - subs r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bgt _0815A644 - adds r0, r5, 0x1 - lsls r0, 1 - add r0, r9 - strh r6, [r0] - adds r1, r5, 0 - adds r1, 0xB - lsls r1, 1 - add r1, r12 - ldrh r6, [r1] - movs r4, 0xA - lsls r0, r7, 5 - add r0, r12 - adds r2, r0, 0 - adds r2, 0x14 -_0815A66E: - ldrh r0, [r2] - strh r0, [r1] - subs r2, 0x2 - subs r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bgt _0815A66E - adds r0, r5, 0x1 - lsls r0, 1 - add r0, r12 - movs r1, 0 - strh r6, [r0] - mov r0, r10 - add r0, r8 - lsls r0, 3 - ldr r2, =0x03005e00 - adds r0, r2 - strh r1, [r0, 0x12] -_0815A692: - ldr r0, =0x0203841e - ldrh r1, [r0, 0xE] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _0815A6A2 - mov r0, r8 - bl DestroyTask -_0815A6A2: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A5F0 - - thumb_func_start sub_815A6C4 -sub_815A6C4: @ 815A6C4 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r0, =0x02038437 - ldrb r0, [r0] - mov r5, sp - adds r5, 0x2 - movs r1, 0 - mov r2, sp - adds r3, r5, 0 - bl sub_80A8924 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0815A6F8 - ldr r1, =0x0203841e - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] -_0815A6F8: - ldr r1, =0x0203841e - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x2E] - mov r2, sp - ldrh r0, [r1, 0x4] - ldrh r2, [r2] - adds r0, r2 - strh r0, [r4, 0x32] - ldrh r0, [r1, 0x6] - ldrh r5, [r5] - adds r0, r5 - strh r0, [r4, 0x36] - ldr r0, =0x0000ffce - strh r0, [r4, 0x38] - adds r0, r4, 0 - bl sub_80A68D4 - ldr r0, =sub_815A73C - str r0, [r4, 0x1C] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A6C4 - - thumb_func_start sub_815A73C -sub_815A73C: @ 815A73C - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _0815A75E - movs r1, 0 - movs r0, 0x1E - strh r0, [r4, 0x2E] - strh r1, [r4, 0x30] - ldr r0, =sub_80A64B0 - str r0, [r4, 0x1C] - ldr r1, =sub_815A76C - adds r0, r4, 0 - bl oamt_set_x3A_32 -_0815A75E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A73C - - thumb_func_start sub_815A76C -sub_815A76C: @ 815A76C - push {lr} - adds r3, r0, 0 - ldrh r1, [r3, 0x30] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815A798 - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - 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 - mov r1, r12 - strb r0, [r1] -_0815A798: - ldrh r0, [r3, 0x30] - adds r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - bne _0815A7AC - adds r0, r3, 0 - bl move_anim_8072740 -_0815A7AC: - pop {r0} - bx r0 - thumb_func_end sub_815A76C - - thumb_func_start sub_815A7B0 -sub_815A7B0: @ 815A7B0 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_80A6838 - ldr r5, =0x0203841e - movs r0, 0 - ldrsh r1, [r5, r0] - adds r0, r4, 0 - bl sub_80A6864 - ldrh r0, [r5, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r0, =sub_80A67D8 - str r0, [r4, 0x1C] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A7B0 - - thumb_func_start sub_815A7EC -sub_815A7EC: @ 815A7EC - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815A84C - adds r0, r4, 0 - bl sub_80A6838 - ldr r5, =0x0203841e - movs r2, 0 - ldrsh r1, [r5, r2] - adds r0, r4, 0 - bl sub_80A6864 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0815A840 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0815A830 - ldrh r0, [r5, 0x4] - b _0815A846 - .pool -_0815A830: - movs r1, 0x4 - ldrsh r0, [r5, r1] - negs r0, r0 - strh r0, [r4, 0x30] - movs r2, 0x6 - ldrsh r0, [r5, r2] - negs r0, r0 - b _0815A84A -_0815A840: - movs r1, 0x4 - ldrsh r0, [r5, r1] - negs r0, r0 -_0815A846: - strh r0, [r4, 0x30] - ldrh r0, [r5, 0x6] -_0815A84A: - strh r0, [r4, 0x32] -_0815A84C: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r2, 0x2E - ldrsh r1, [r4, r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - movs r3, 0xFF - ldrh r1, [r4, 0x30] - ldrh r2, [r4, 0x34] - adds r1, r2 - strh r1, [r4, 0x34] - ldrh r1, [r4, 0x32] - ldrh r2, [r4, 0x36] - adds r1, r2 - strh r1, [r4, 0x36] - movs r2, 0x34 - ldrsh r1, [r4, r2] - lsrs r2, r1, 31 - adds r1, r2 - asrs r1, 1 - strh r1, [r4, 0x24] - ands r0, r3 - movs r1, 0x5 - bl sine - movs r2, 0x36 - ldrsh r1, [r4, r2] - lsrs r2, r1, 31 - adds r1, r2 - asrs r1, 1 - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xF0 - bls _0815A8A4 - adds r0, r4, 0 - bl move_anim_8072740 -_0815A8A4: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815A7EC - - thumb_func_start sub_815A8AC -sub_815A8AC: @ 815A8AC - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0815A8C2 - adds r0, r2, 0 - bl move_anim_8072740 -_0815A8C2: - pop {r0} - bx r0 - thumb_func_end sub_815A8AC - - thumb_func_start sub_815A8C8 -sub_815A8C8: @ 815A8C8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815A8EC - ldr r1, =0x0203841e - movs r0, 0 - b _0815A8F0 - .pool -_0815A8EC: - ldr r1, =0x0203841e - movs r0, 0x1 -_0815A8F0: - strh r0, [r1, 0xE] - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A8C8 - - thumb_func_start sub_815A904 -sub_815A904: @ 815A904 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02038404 - ldr r0, [r0] - cmp r0, 0 - ble _0815A920 - ldr r1, =0x0203841e - movs r0, 0 - b _0815A924 - .pool -_0815A920: - ldr r1, =0x0203841e - movs r0, 0x1 -_0815A924: - strh r0, [r1, 0xE] - adds r0, r2, 0 - bl move_anim_task_del - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A904 - - thumb_func_start sub_815A934 -sub_815A934: @ 815A934 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r1, =0x00001f3f - movs r0, 0x4A - bl SetGpuReg - movs r1, 0x80 - lsls r1, 8 - movs r0, 0 - bl SetGpuRegBits - ldr r0, =0x02022e24 - movs r1, 0 - strh r1, [r0] - ldr r4, =0x02022e26 - strh r1, [r4] - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x44 - bl SetGpuReg - adds r0, r5, 0 - movs r1, 0 - bl sub_80A6980 - ldrb r1, [r5, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r5, 0x1] - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815A9A0 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A934 - - thumb_func_start sub_815A9A0 -sub_815A9A0: @ 815A9A0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x5 - bhi _0815AA60 - lsls r0, 2 - ldr r1, =_0815A9BC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815A9BC: - .4byte _0815A9D4 - .4byte _0815A9F2 - .4byte _0815AA12 - .4byte _0815A9F2 - .4byte _0815AA32 - .4byte _0815AA42 -_0815A9D4: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0815AA60 - b _0815AA3A -_0815A9F2: - ldrh r0, [r4, 0x30] - adds r0, 0x75 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x15 - bne _0815AA60 - movs r0, 0 - strh r0, [r4, 0x32] - b _0815AA3A -_0815AA12: - ldrh r0, [r4, 0x30] - subs r0, 0x75 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x29 - bne _0815AA60 - movs r0, 0 - strh r0, [r4, 0x32] - b _0815AA3A -_0815AA32: - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80082B8 -_0815AA3A: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815AA60 -_0815AA42: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0815AA60 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815AA6C - str r0, [r4, 0x1C] -_0815AA60: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A9A0 - - thumb_func_start sub_815AA6C -sub_815AA6C: @ 815AA6C - push {r4,lr} - adds r4, r0, 0 - ldr r1, =0x00003f3f - movs r0, 0x4A - bl SetGpuReg - movs r0, 0 - bl GetGpuReg - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 8 - adds r0, r2, 0 - eors r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0 - bl SetGpuReg - adds r0, r4, 0 - bl move_anim_8072740 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815AA6C - - thumb_func_start sub_815AAA4 -sub_815AAA4: @ 815AAA4 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =0x0203841e - movs r1, 0x6 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815AAD0 - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] -_0815AAD0: - ldrh r0, [r6] - ldrh r2, [r5, 0x20] - adds r0, r2 - movs r3, 0 - strh r0, [r5, 0x20] - ldrh r0, [r6, 0x2] - ldrh r4, [r5, 0x22] - adds r0, r4 - strh r0, [r5, 0x22] - ldrh r2, [r5, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x10 - ldr r4, =0x000003ff - adds r0, r4, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x4] - movs r1, 0x4 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815AB2C - ldrb r1, [r5, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r5, 0x3] - ldr r0, =0x0000fff4 - strh r0, [r5, 0x24] - movs r0, 0x2 - b _0815AB32 - .pool -_0815AB2C: - movs r0, 0xC - strh r0, [r5, 0x24] - ldr r0, =0x0000fffe -_0815AB32: - strh r0, [r5, 0x30] - ldr r1, =0x0203841e - ldrh r0, [r1, 0x8] - strh r0, [r5, 0x2E] - movs r2, 0x34 - ldrsh r0, [r5, r2] - cmp r0, 0xFF - beq _0815AB46 - ldrh r0, [r1, 0x4] - strh r0, [r5, 0x34] -_0815AB46: - ldr r0, =sub_815AB5C - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815AAA4 - - thumb_func_start sub_815AB5C -sub_815AB5C: @ 815AB5C - push {r4,lr} - adds r4, r0, 0 - ldrh r2, [r4, 0x32] - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815AB9A - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - lsls r0, 16 - cmp r0, 0 - bne _0815ABBA - adds r0, r2, 0x1 - strh r0, [r4, 0x32] - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815ABBA - movs r0, 0x40 - negs r0, r0 - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xDE - bl sub_80A3808 - b _0815ABBA -_0815AB9A: - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x30] - subs r0, r1 - strh r0, [r4, 0x24] - movs r1, 0x24 - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _0815ABAC - negs r0, r0 -_0815ABAC: - cmp r0, 0xC - bne _0815ABBA - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - strh r0, [r4, 0x2E] - subs r0, r2, 0x1 - strh r0, [r4, 0x32] -_0815ABBA: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815ABC8 - adds r0, r4, 0 - bl move_anim_8072740 -_0815ABC8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815AB5C - - thumb_func_start sub_815ABD0 -sub_815ABD0: @ 815ABD0 - push {lr} - ldrb r2, [r0, 0x1] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0, 0x1] - movs r1, 0xFF - strh r1, [r0, 0x34] - bl sub_815AAA4 - pop {r0} - bx r0 - thumb_func_end sub_815ABD0 - - thumb_func_start sub_815ABEC -sub_815ABEC: @ 815ABEC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0815AC40 - ldr r1, =0x00001f3f - movs r0, 0x48 - bl SetGpuReg - ldr r1, =0x02022e28 - ldr r2, =0x000098f0 - adds r0, r2, 0 - strh r0, [r1] - ldr r1, =0x02022e2a - movs r0, 0xA0 - strh r0, [r1] - ldr r0, =0x02022e24 - ldrh r1, [r0] - movs r0, 0x42 - bl SetGpuReg - ldr r0, =0x02022e26 - ldrh r1, [r0] - movs r0, 0x46 - bl SetGpuReg - b _0815AC70 - .pool -_0815AC40: - ldr r1, =0x00001f3f - movs r0, 0x48 - bl SetGpuReg - ldr r1, =0x02022e28 - movs r0, 0xF0 - strh r0, [r1] - ldr r4, =0x02022e2a - ldr r1, =0x000078a0 - adds r0, r1, 0 - strh r0, [r4] - movs r0, 0x42 - movs r1, 0xF0 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x46 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 7 - movs r0, 0 - bl SetGpuRegBits -_0815AC70: - adds r0, r5, 0 - bl move_anim_task_del - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815ABEC - - thumb_func_start sub_815AC8C -sub_815AC8C: @ 815AC8C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - ldr r0, =0x02022e28 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e2a - strh r1, [r0] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0815ACB8 - movs r1, 0x80 - lsls r1, 7 - movs r0, 0 - bl ClearGpuRegBits -_0815ACB8: - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815AC8C - - thumb_func_start sub_815ACD0 -sub_815ACD0: @ 815ACD0 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =0x0203841e - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815ACEC - ldr r4, =0x02038436 - b _0815ACEE - .pool -_0815ACEC: - ldr r4, =0x02038437 -_0815ACEE: - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r6, [r6, 0x2] - adds r0, r6 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r2, =0x0203841e - ldrh r0, [r2, 0x4] - strh r0, [r5, 0x26] - movs r3, 0 - lsls r0, 16 - asrs r0, 16 - ldrh r4, [r2, 0x6] - movs r6, 0x6 - ldrsh r1, [r2, r6] - cmp r0, r1 - ble _0815AD26 - movs r3, 0x1 -_0815AD26: - strh r3, [r5, 0x2E] - movs r0, 0 - strh r0, [r5, 0x30] - ldrh r0, [r2, 0x8] - strh r0, [r5, 0x32] - ldrh r0, [r2, 0xA] - strh r0, [r5, 0x34] - strh r4, [r5, 0x36] - ldr r0, =sub_815AD4C - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815ACD0 - - thumb_func_start sub_815AD4C -sub_815AD4C: @ 815AD4C - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x32] - ldrh r1, [r2, 0x30] - adds r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r2, 0x30] - ldr r1, =gUnknown_08329F40 - movs r3, 0x30 - ldrsh r0, [r2, r3] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 20 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x34] - ldrh r3, [r2, 0x26] - adds r1, r0, r3 - strh r1, [r2, 0x26] - movs r3, 0x2E - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _0815AD98 - lsls r0, r1, 16 - asrs r0, 16 - movs r3, 0x36 - ldrsh r1, [r2, r3] - cmp r0, r1 - bge _0815ADAA - adds r0, r2, 0 - bl move_anim_8072740 - b _0815ADAA - .pool -_0815AD98: - lsls r0, r1, 16 - asrs r0, 16 - movs r3, 0x36 - ldrsh r1, [r2, r3] - cmp r0, r1 - ble _0815ADAA - adds r0, r2, 0 - bl move_anim_8072740 -_0815ADAA: - pop {r0} - bx r0 - thumb_func_end sub_815AD4C - - thumb_func_start sub_815ADB0 -sub_815ADB0: @ 815ADB0 - push {r4-r7,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r5, r1, r0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815ADDC - ldr r4, =0x02038436 - b _0815ADDE - .pool -_0815ADDC: - ldr r4, =0x02038437 -_0815ADDE: - ldrb r0, [r4] - bl sub_80A6190 - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r0, [r4] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r6, 0 - adds r1, r0, 0 - adds r1, 0x24 - movs r2, 0 - strh r1, [r5, 0x8] - strh r1, [r5, 0xA] - subs r0, 0x21 - strh r0, [r5, 0xC] - cmp r0, 0 - bge _0815AE08 - strh r2, [r5, 0xC] -_0815AE08: - ldrh r0, [r5, 0x8] - strh r0, [r5, 0xE] - movs r0, 0x8 - strh r0, [r5, 0x10] - ldr r1, =0x0203841e - ldrh r0, [r1, 0x2] - strh r0, [r5, 0x12] - strh r2, [r5, 0x14] - strh r2, [r5, 0x16] - cmp r7, 0x1 - bne _0815AE30 - ldr r0, =0x02022e18 - b _0815AE32 - .pool -_0815AE30: - ldr r0, =0x02022e1c -_0815AE32: - ldrh r2, [r0] - strh r2, [r5, 0x18] - adds r3, r2, 0 - adds r3, 0xF0 - strh r3, [r5, 0x1A] - ldrh r0, [r1, 0x4] - strh r0, [r5, 0x1C] - movs r4, 0x4 - ldrsh r0, [r1, r4] - cmp r0, 0 - bne _0815AE54 - strh r3, [r5, 0x1E] - ldrh r3, [r5, 0x18] - b _0815AE58 - .pool -_0815AE54: - strh r2, [r5, 0x1E] - ldrh r3, [r5, 0x1A] -_0815AE58: - movs r0, 0 - strh r0, [r5, 0x26] - ldrh r1, [r5, 0xC] - lsls r2, r1, 16 - asrs r1, r2, 16 - movs r6, 0xE - ldrsh r0, [r5, r6] - cmp r1, r0 - bgt _0815AE8E - ldr r4, =0x02038c28 - movs r0, 0xF0 - lsls r0, 3 - adds r0, r4 - mov r12, r0 -_0815AE74: - asrs r2, 16 - lsls r1, r2, 1 - adds r0, r1, r4 - strh r3, [r0] - add r1, r12 - strh r3, [r1] - adds r2, 0x1 - lsls r2, 16 - asrs r1, r2, 16 - movs r6, 0xE - ldrsh r0, [r5, r6] - cmp r1, r0 - ble _0815AE74 -_0815AE8E: - cmp r7, 0x1 - bne _0815AEA0 - ldr r0, =0x04000014 - b _0815AEA2 - .pool -_0815AEA0: - ldr r0, =0x04000018 -_0815AEA2: - str r0, [sp] - ldr r0, =0xa2600001 - str r0, [sp, 0x4] - mov r1, sp - movs r2, 0 - movs r0, 0x1 - strb r0, [r1, 0x8] - mov r0, sp - strb r2, [r0, 0x9] - ldr r0, [sp] - ldr r1, [sp, 0x4] - ldr r2, [sp, 0x8] - bl sub_80BA038 - ldr r0, =sub_815AED8 - str r0, [r5] - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815ADB0 - - thumb_func_start sub_815AED8 -sub_815AED8: @ 815AED8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - ldrh r0, [r4, 0x8] - ldrh r1, [r4, 0x12] - subs r0, r1 - strh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - ldrh r2, [r4, 0xC] - movs r3, 0xC - ldrsh r1, [r4, r3] - cmp r0, r1 - bge _0815AF00 - strh r2, [r4, 0x8] -_0815AF00: - ldrh r1, [r4, 0x10] - movs r2, 0x10 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0815AF2C - ldrh r0, [r4, 0xA] - ldrh r1, [r4, 0x12] - subs r0, r1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - ldrh r2, [r4, 0xC] - movs r3, 0xC - ldrsh r1, [r4, r3] - cmp r0, r1 - bge _0815AF30 - strh r2, [r4, 0xA] - movs r0, 0x1 - strh r0, [r4, 0x26] - b _0815AF30 - .pool -_0815AF2C: - subs r0, r1, 0x1 - strh r0, [r4, 0x10] -_0815AF30: - ldrh r0, [r4, 0x14] - adds r0, 0x1 - strh r0, [r4, 0x14] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815AF5C - movs r0, 0 - strh r0, [r4, 0x14] - movs r1, 0 - movs r2, 0x16 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0815AF4E - movs r1, 0x1 -_0815AF4E: - strh r1, [r4, 0x16] - cmp r1, 0 - beq _0815AF58 - ldrh r0, [r4, 0x18] - b _0815AF5A -_0815AF58: - ldrh r0, [r4, 0x1A] -_0815AF5A: - strh r0, [r4, 0x20] -_0815AF5C: - ldrh r1, [r4, 0x8] - lsls r3, r1, 16 - asrs r1, r3, 16 - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r1, r0 - bge _0815AF90 - ldr r5, =0x02038c28 - movs r0, 0xF0 - lsls r0, 3 - adds r6, r5, r0 -_0815AF72: - asrs r3, 16 - lsls r1, r3, 1 - adds r2, r1, r5 - ldrh r0, [r4, 0x20] - strh r0, [r2] - adds r1, r6 - ldrh r0, [r4, 0x20] - strh r0, [r1] - adds r3, 0x1 - lsls r3, 16 - asrs r1, r3, 16 - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r1, r0 - blt _0815AF72 -_0815AF90: - ldrh r1, [r4, 0xA] - lsls r3, r1, 16 - asrs r1, r3, 16 - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r1, r0 - bgt _0815AFC4 - ldr r5, =0x02038c28 - movs r0, 0xF0 - lsls r0, 3 - adds r6, r5, r0 -_0815AFA6: - asrs r3, 16 - lsls r1, r3, 1 - adds r2, r1, r5 - ldrh r0, [r4, 0x1E] - strh r0, [r2] - adds r1, r6 - ldrh r0, [r4, 0x1E] - strh r0, [r1] - adds r3, 0x1 - lsls r3, 16 - asrs r1, r3, 16 - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r1, r0 - ble _0815AFA6 -_0815AFC4: - movs r3, 0x26 - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _0815AFE0 - movs r1, 0x1C - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815AFDA - ldr r1, =0x02039b28 - movs r0, 0x3 - strb r0, [r1, 0x15] -_0815AFDA: - adds r0, r7, 0 - bl move_anim_task_del -_0815AFE0: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815AED8 - - thumb_func_start sub_815AFF0 -sub_815AFF0: @ 815AFF0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - movs r5, 0 - strh r5, [r4, 0x8] - strh r5, [r4, 0xA] - ldr r6, =0x02038436 - ldrb r0, [r6] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xC] - ldrb r0, [r6] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xE] - movs r0, 0x20 - strh r0, [r4, 0x10] - ldr r0, =0x0000ffec - strh r0, [r4, 0x12] - strh r5, [r4, 0x14] - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - ldr r0, =sub_815B054 - str r0, [r4] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815AFF0 - - thumb_func_start sub_815B054 -sub_815B054: @ 815B054 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r6, r0, r1 - movs r1, 0x8 - ldrsh r0, [r6, r1] - cmp r0, 0x5 - bls _0815B074 - b _0815B22E -_0815B074: - lsls r0, 2 - ldr r1, =_0815B088 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815B088: - .4byte _0815B0A0 - .4byte _0815B160 - .4byte _0815B18E - .4byte _0815B1A2 - .4byte _0815B1B8 - .4byte _0815B220 -_0815B0A0: - movs r0, 0xC - ldrsh r2, [r6, r0] - ldrh r1, [r6, 0xA] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815B0B6 - movs r1, 0x10 - ldrsh r0, [r6, r1] - subs r0, r2, r0 - b _0815B0BC -_0815B0B6: - movs r1, 0x10 - ldrsh r0, [r6, r1] - adds r0, r2, r0 -_0815B0BC: - lsls r0, 16 - lsrs r1, r0, 16 - ldrh r2, [r6, 0x12] - ldrh r0, [r6, 0xE] - adds r2, r0 - ldr r0, =gUnknown_08593114 - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - ldrb r4, [r6, 0xA] - movs r3, 0x6 - subs r3, r4 - lsls r3, 24 - lsrs r3, 24 - bl AddObjectToFront - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x40 - negs r0, r0 - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xBA - bl audio_play_and_stuff - cmp r4, 0x40 - beq _0815B120 - ldr r5, =0x02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r3, r1, r5 - ldrh r0, [r6, 0xA] - movs r2, 0x1 - ands r2, r0 - adds r3, 0x3F - ldrb r4, [r3] - movs r0, 0x2 - negs r0, r0 - ands r0, r4 - orrs r0, r2 - strb r0, [r3] - adds r5, 0x1C - adds r1, r5 - ldr r0, =DummyObjectCallback - str r0, [r1] -_0815B120: - ldrh r1, [r6, 0xA] - movs r4, 0x1 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _0815B138 - ldrh r0, [r6, 0x10] - subs r0, 0x6 - strh r0, [r6, 0x10] - ldrh r0, [r6, 0x12] - subs r0, 0x6 - strh r0, [r6, 0x12] -_0815B138: - ldrh r1, [r6, 0x26] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE2A0 - adds r0, r6, 0 - bl sub_80A7CFC - ldrh r0, [r6, 0xA] - adds r0, 0x1 - strh r0, [r6, 0xA] - strh r4, [r6, 0x8] - b _0815B22E - .pool -_0815B160: - adds r0, r6, 0 - bl sub_80A7D34 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0815B22E - movs r2, 0xA - ldrsh r1, [r6, r2] - cmp r1, 0x6 - bne _0815B180 - movs r0, 0x8 - strh r0, [r6, 0x14] - movs r0, 0x3 - strh r0, [r6, 0x8] - b _0815B22E -_0815B180: - cmp r1, 0x2 - bgt _0815B186 - movs r0, 0xA -_0815B186: - strh r0, [r6, 0x14] - movs r0, 0x2 - strh r0, [r6, 0x8] - b _0815B22E -_0815B18E: - ldrh r0, [r6, 0x14] - movs r2, 0x14 - ldrsh r1, [r6, r2] - cmp r1, 0 - beq _0815B19E - subs r0, 0x1 - strh r0, [r6, 0x14] - b _0815B22E -_0815B19E: - strh r1, [r6, 0x8] - b _0815B22E -_0815B1A2: - ldrh r1, [r6, 0x14] - movs r2, 0x14 - ldrsh r0, [r6, r2] - cmp r0, 0 - beq _0815B1B2 - subs r0, r1, 0x1 - strh r0, [r6, 0x14] - b _0815B22E -_0815B1B2: - movs r0, 0x4 - strh r0, [r6, 0x8] - b _0815B22E -_0815B1B8: - movs r5, 0 - movs r7, 0 - ldr r3, =0x02020630 - movs r0, 0x1C - adds r0, r3 - mov r8, r0 -_0815B1C4: - lsls r0, r5, 4 - adds r0, r5 - lsls r4, r0, 2 - adds r0, r3, 0 - adds r0, 0x14 - adds r0, r4, r0 - ldr r1, [r0] - ldr r0, =gUnknown_08593114 - cmp r1, r0 - bne _0815B200 - adds r0, r4, r3 - strh r2, [r0, 0x2E] - movs r1, 0x6 - strh r1, [r0, 0x30] - movs r1, 0x2 - str r2, [sp] - str r3, [sp, 0x4] - bl StartObjectImageAnim - mov r0, r8 - adds r1, r4, r0 - ldr r0, =sub_815B23C - str r0, [r1] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - ldr r2, [sp] - ldr r3, [sp, 0x4] - cmp r7, 0x6 - beq _0815B20A -_0815B200: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x3F - bls _0815B1C4 -_0815B20A: - strh r7, [r6, 0x14] - movs r0, 0x5 - strh r0, [r6, 0x8] - b _0815B22E - .pool -_0815B220: - movs r1, 0x14 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815B22E - adds r0, r2, 0 - bl move_anim_task_del -_0815B22E: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815B054 - - thumb_func_start sub_815B23C -sub_815B23C: @ 815B23C - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0815B270 - ldr r3, =0x03005e00 - movs r0, 0x30 - ldrsh r1, [r4, r0] - lsls r1, 1 - movs r0, 0x2E - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0815B270: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B23C - - thumb_func_start sub_815B27C -sub_815B27C: @ 815B27C - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815B290 - adds r0, r5, 0 - movs r1, 0 - bl sub_80A69CC -_0815B290: - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x27 - bgt _0815B2C2 - ldrh r0, [r5, 0x2E] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0815B2B4 - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - b _0815B2C0 -_0815B2B4: - adds r2, r5, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 -_0815B2C0: - strb r0, [r2] -_0815B2C2: - movs r2, 0x2E - ldrsh r0, [r5, r2] - cmp r0, 0x1E - ble _0815B2D8 - adds r2, r5, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_0815B2D8: - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0x3D - bne _0815B324 - ldr r1, =move_anim_8072740 - adds r0, r5, 0 - bl oamt_set_x3A_32 - ldrh r0, [r5, 0x24] - ldrh r2, [r5, 0x20] - adds r0, r2 - movs r1, 0 - strh r0, [r5, 0x20] - ldrh r0, [r5, 0x26] - ldrh r2, [r5, 0x22] - adds r0, r2 - strh r0, [r5, 0x22] - strh r1, [r5, 0x24] - strh r1, [r5, 0x26] - movs r0, 0x14 - strh r0, [r5, 0x2E] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x32] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r5, 0x1C] -_0815B324: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B27C - - thumb_func_start sub_815B338 -sub_815B338: @ 815B338 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815B35C - cmp r0, 0x1 - beq _0815B37C - b _0815B38E - .pool -_0815B35C: - movs r0, 0 - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE350 - adds r0, r4, 0 - bl sub_80A7CFC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815B38E - .pool -_0815B37C: - adds r0, r4, 0 - bl sub_80A7D34 - lsls r0, 24 - cmp r0, 0 - bne _0815B38E - adds r0, r5, 0 - bl move_anim_task_del -_0815B38E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815B338 - - thumb_func_start sub_815B394 -sub_815B394: @ 815B394 - push {r4-r6,lr} - adds r5, r0, 0 - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r6, r0, 24 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _0815B3F4 - cmp r0, 0x1 - bgt _0815B3B4 - cmp r0, 0 - beq _0815B3BE - b _0815B496 -_0815B3B4: - cmp r0, 0x2 - beq _0815B424 - cmp r0, 0x3 - beq _0815B478 - b _0815B496 -_0815B3BE: - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - adds r0, r6, 0 - movs r1, 0 - bl sub_80A7270 - movs r0, 0x80 - lsls r0, 1 - strh r0, [r5, 0x30] - strh r0, [r5, 0x32] - b _0815B46C - .pool -_0815B3F4: - ldrh r0, [r5, 0x30] - adds r0, 0x60 - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x32] - subs r0, 0x1A - strh r0, [r5, 0x32] - movs r2, 0x30 - ldrsh r1, [r5, r2] - movs r0, 0x32 - ldrsh r2, [r5, r0] - adds r0, r6, 0 - movs r3, 0 - bl obj_id_set_rotscale - ldrh r0, [r5, 0x34] - adds r0, 0x1 - strh r0, [r5, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _0815B424 - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] -_0815B424: - ldrh r0, [r5, 0x30] - adds r0, 0x60 - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x32] - adds r0, 0x30 - strh r0, [r5, 0x32] - movs r2, 0x30 - ldrsh r1, [r5, r2] - movs r0, 0x32 - ldrsh r2, [r5, r0] - adds r0, r6, 0 - movs r3, 0 - bl obj_id_set_rotscale - ldrh r0, [r5, 0x34] - adds r0, 0x1 - strh r0, [r5, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - bne _0815B496 - movs r0, 0 - strh r0, [r5, 0x34] - ldr r1, =0x02020630 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - adds r0, r6, 0 - bl sub_80A7344 -_0815B46C: - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - b _0815B496 - .pool -_0815B478: - ldrh r0, [r5, 0x26] - subs r0, 0x6 - strh r0, [r5, 0x26] - movs r1, 0x22 - ldrsh r0, [r5, r1] - movs r2, 0x26 - ldrsh r1, [r5, r2] - adds r0, r1 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - bge _0815B496 - adds r0, r5, 0 - bl move_anim_8072740 -_0815B496: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_815B394 - - thumb_func_start sub_815B49C -sub_815B49C: @ 815B49C - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0815B4BC - ldr r0, =0x0000fff0 - b _0815B4C0 - .pool -_0815B4BC: - movs r0, 0x80 - lsls r0, 1 -_0815B4C0: - strh r0, [r4, 0x20] - movs r0, 0 - strh r0, [r4, 0x22] - ldr r0, =sub_815B4D4 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B49C - - thumb_func_start sub_815B4D4 -sub_815B4D4: @ 815B4D4 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x48 - strh r0, [r4, 0x2E] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0815B4F8 - ldrh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 20 - b _0815B500 - .pool -_0815B4F8: - ldrh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 20 - negs r0, r0 -_0815B500: - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x30] - adds r0, 0x10 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r4, 0x26] - adds r5, r0, r1 - strh r5, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x3 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _0815B54C - ldr r0, =gUnknown_085CE3A0 - ldrh r1, [r4, 0x24] - ldrh r2, [r4, 0x20] - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - ldrh r2, [r4, 0x22] - adds r2, r5 - lsls r2, 16 - asrs r2, 16 - adds r3, r4, 0 - adds r3, 0x43 - ldrb r3, [r3] - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - bl AddObjectAndAnimateForOneFrame -_0815B54C: - movs r1, 0x20 - ldrsh r0, [r4, r1] - movs r2, 0x24 - ldrsh r1, [r4, r2] - adds r0, r1 - adds r0, 0x20 - movs r1, 0x98 - lsls r1, 1 - cmp r0, r1 - bls _0815B566 - adds r0, r4, 0 - bl move_anim_8072740 -_0815B566: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B4D4 - - thumb_func_start sub_815B570 -sub_815B570: @ 815B570 - push {r4,lr} - adds r4, r0, 0 - bl GenerateRandomNumber2 - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _0815B58A - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x4 - b _0815B592 -_0815B58A: - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x5 -_0815B592: - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - bl GenerateRandomNumber2 - movs r1, 0x7 - ands r0, r1 - adds r1, r0, 0 - cmp r1, 0x3 - ble _0815B5B4 - negs r0, r1 - lsls r0, 24 - lsrs r0, 24 -_0815B5B4: - lsls r0, 24 - asrs r0, 24 - strh r0, [r4, 0x26] - ldr r0, =sub_815B5D0 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B570 - - thumb_func_start sub_815B5D0 -sub_815B5D0: @ 815B5D0 - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1D - bgt _0815B612 - ldrh r0, [r3, 0x30] - adds r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _0815B646 - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - 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 - mov r1, r12 - strb r0, [r1] - movs r0, 0 - b _0815B644 -_0815B612: - movs r1, 0x30 - ldrsh r0, [r3, r1] - cmp r0, 0x2 - bne _0815B628 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_0815B628: - movs r1, 0x30 - ldrsh r0, [r3, r1] - cmp r0, 0x3 - bne _0815B640 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =0x0000ffff - strh r0, [r3, 0x30] -_0815B640: - ldrh r0, [r3, 0x30] - adds r0, 0x1 -_0815B644: - strh r0, [r3, 0x30] -_0815B646: - movs r1, 0x2E - ldrsh r0, [r3, r1] - cmp r0, 0x3C - ble _0815B654 - adds r0, r3, 0 - bl RemoveObjectAndFreeTiles -_0815B654: - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B5D0 - - thumb_func_start sub_815B65C -sub_815B65C: @ 815B65C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815B69C - movs r0, 0 - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE3B8 - adds r0, r4, 0 - bl sub_80A7CFC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815B6AE - .pool -_0815B69C: - adds r0, r4, 0 - bl sub_80A7D34 - lsls r0, 24 - cmp r0, 0 - bne _0815B6AE - adds r0, r5, 0 - bl move_anim_task_del -_0815B6AE: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815B65C - - thumb_func_start sub_815B6B4 -sub_815B6B4: @ 815B6B4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815B6F4 - movs r0, 0 - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE3E0 - adds r0, r4, 0 - bl sub_80A7CFC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815B706 - .pool -_0815B6F4: - adds r0, r4, 0 - bl sub_80A7D34 - lsls r0, 24 - cmp r0, 0 - bne _0815B706 - adds r0, r5, 0 - bl move_anim_task_del -_0815B706: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815B6B4 - - thumb_func_start sub_815B70C -sub_815B70C: @ 815B70C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815B71E - cmp r0, 0x1 - beq _0815B748 - b _0815B770 -_0815B71E: - adds r0, r4, 0 - movs r1, 0 - bl sub_80A69CC - movs r0, 0x90 - lsls r0, 4 - strh r0, [r4, 0x30] - ldr r0, =0x02038436 - ldrb r0, [r0] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815B770 - .pool -_0815B748: - ldrh r2, [r4, 0x30] - lsls r1, r2, 16 - asrs r1, 24 - ldrh r0, [r4, 0x26] - subs r0, r1 - strh r0, [r4, 0x26] - subs r2, 0x60 - strh r2, [r4, 0x30] - movs r2, 0x22 - ldrsh r0, [r4, r2] - movs r2, 0x26 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r2, 0x32 - ldrsh r1, [r4, r2] - cmp r0, r1 - ble _0815B770 - adds r0, r4, 0 - bl move_anim_8072740 -_0815B770: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815B70C - - thumb_func_start sub_815B778 -sub_815B778: @ 815B778 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815B7B8 - movs r0, 0 - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE430 - adds r0, r4, 0 - bl sub_80A7CFC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815B7CA - .pool -_0815B7B8: - adds r0, r4, 0 - bl sub_80A7D34 - lsls r0, 24 - cmp r0, 0 - bne _0815B7CA - adds r0, r5, 0 - bl move_anim_task_del -_0815B7CA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815B778 - - thumb_func_start sub_815B7D0 -sub_815B7D0: @ 815B7D0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =0x03005e00 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r3, r1, 0 - cmp r0, 0x4 - bls _0815B7F6 - b _0815BAFC -_0815B7F6: - lsls r0, 2 - ldr r1, =_0815B808 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815B808: - .4byte _0815B81C - .4byte _0815B86C - .4byte _0815B8A8 - .4byte _0815BA44 - .4byte _0815BA82 -_0815B81C: - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815B844 - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0x1 - bl lcd_bg_operations - b _0815B84E - .pool -_0815B844: - movs r0, 0x2 - movs r1, 0x2 - movs r2, 0x1 - bl lcd_bg_operations -_0815B84E: - ldr r0, =0x03005e00 - mov r6, r8 - lsls r1, r6, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - ldr r0, =0x0203841e - ldrh r0, [r0] - strh r0, [r1, 0x1C] - b _0815BA26 - .pool -_0815B86C: - mov r1, r8 - lsls r0, r1, 2 - add r0, r8 - lsls r0, 3 - adds r4, r0, r3 - ldrh r0, [r4, 0xC] - adds r1, r0, 0x1 - strh r1, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bgt _0815B886 - b _0815BAFC -_0815B886: - movs r0, 0 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - ldrh r5, [r4, 0xA] - lsls r1, r5, 4 - orrs r1, r5 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x4C - bl SetGpuReg - cmp r5, 0xF - beq _0815B8A6 - b _0815BAFC -_0815B8A6: - b _0815BA7A -_0815B8A8: - ldr r5, =0x02038436 - ldrb r0, [r5] - ldr r1, =0x02038437 - ldrb r1, [r1] - mov r2, r8 - lsls r4, r2, 2 - adds r2, r4, r2 - lsls r2, 3 - adds r2, r3 - ldrb r2, [r2, 0x1C] - bl sub_805E448 - ldrb r1, [r5] - mov r0, sp - bl sub_80A6BFC - bl sub_80A4DF0 - lsls r0, 24 - mov r9, r4 - cmp r0, 0 - beq _0815B8E0 - movs r1, 0 - b _0815B8EA - .pool -_0815B8E0: - ldrb r0, [r5] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r1, r0, 24 -_0815B8EA: - ldr r0, =0x020244d4 - ldr r2, [r0] - lsls r0, r1, 2 - adds r2, 0x4 - adds r2, r0 - ldr r1, =0x020244e4 - ldr r0, =0x02038436 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r1, 11 - ldr r0, [r2] - adds r0, r1 - ldr r1, [sp] - ldr r2, =0x04000200 - bl CpuSet - ldr r1, [sp] - movs r2, 0x80 - lsls r2, 4 - mov r0, sp - ldrh r3, [r0, 0xA] - movs r0, 0x1 - bl LoadBgTiles - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0815BA1C - ldr r5, =0x02039f34 - ldr r0, [r5] - ldr r0, [r0, 0x18] - ldrh r0, [r0] - bl sub_80DB2A8 - adds r4, r0, 0 - ldr r0, [r5] - ldr r0, [r0, 0x18] - ldrh r0, [r0, 0x2] - bl sub_80DB2A8 - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _0815B99C - ldr r6, [sp, 0x4] - movs r5, 0 - movs r0, 0x7 - mov r12, r0 - movs r7, 0 -_0815B950: - movs r4, 0 - adds r3, r7, r6 - mov r1, r12 - lsls r0, r1, 1 - adds r2, r0, r6 -_0815B95A: - ldrh r1, [r3] - ldrh r0, [r2] - strh r0, [r3] - strh r1, [r2] - adds r3, 0x2 - subs r2, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _0815B95A - movs r2, 0x20 - add r12, r2 - adds r7, 0x40 - adds r5, 0x1 - cmp r5, 0x7 - ble _0815B950 - movs r5, 0 - movs r0, 0x80 - lsls r0, 3 - adds r3, r0, 0 -_0815B980: - adds r2, r5, 0x1 - lsls r0, r5, 6 - adds r1, r0, r6 - movs r4, 0x7 -_0815B988: - ldrh r0, [r1] - eors r0, r3 - strh r0, [r1] - adds r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _0815B988 - adds r5, r2, 0 - cmp r5, 0x7 - ble _0815B980 -_0815B99C: - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldrh r0, [r0, 0x2] - bl sub_80DB2A8 - lsls r0, 24 - cmp r0, 0 - beq _0815B9EC - ldr r3, =0x02020630 - ldr r4, =0x020241e4 - ldr r2, =0x02038436 - ldrb r0, [r2] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x10 - adds r0, r1 - ldr r1, =gUnknown_082FF6C0 - b _0815BA06 - .pool -_0815B9EC: - ldr r3, =0x02020630 - ldr r4, =0x020241e4 - ldr r2, =0x02038436 - ldrb r0, [r2] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x10 - adds r0, r1 - ldr r1, =gUnknown_082FF694 -_0815BA06: - str r1, [r0] - ldrb r0, [r2] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0 - bl StartObjectRotScalAnim -_0815BA1C: - ldr r0, =0x03005e00 - mov r1, r9 - add r1, r8 - lsls r1, 3 - adds r1, r0 -_0815BA26: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0815BAFC - .pool -_0815BA44: - mov r1, r8 - lsls r0, r1, 2 - add r0, r8 - lsls r0, 3 - adds r4, r0, r3 - ldrh r0, [r4, 0xC] - adds r1, r0, 0x1 - strh r1, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815BAFC - movs r0, 0 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - ldrh r5, [r4, 0xA] - lsls r1, r5, 4 - orrs r1, r5 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x4C - bl SetGpuReg - cmp r5, 0 - bne _0815BAFC -_0815BA7A: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815BAFC -_0815BA82: - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815BAAC - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0 - bl lcd_bg_operations - b _0815BAB6 - .pool -_0815BAAC: - movs r0, 0x2 - movs r1, 0x2 - movs r2, 0 - bl lcd_bg_operations -_0815BAB6: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0815BAF6 - ldr r4, =0x02038436 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815BAF6 - ldr r0, =0x03005e00 - mov r2, r8 - lsls r1, r2, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r6, 0x1C - ldrsh r0, [r1, r6] - cmp r0, 0 - bne _0815BAF6 - ldrb r0, [r4] - ldr r1, =0x020244d0 - ldr r1, [r1] - ldr r2, [r1] - lsls r1, r0, 2 - adds r1, r2 - ldrh r1, [r1, 0x2] - bl sub_805EE54 -_0815BAF6: - mov r0, r8 - bl move_anim_task_del -_0815BAFC: - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B7D0 - - thumb_func_start c3_80DFBE4 -c3_80DFBE4: @ 815BB18 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x0203841e - ldr r3, =0x02020630 - ldr r2, =0x020241e4 - ldr r1, =0x02038436 - ldrb r1, [r1] - adds r1, r2 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - adds r1, 0x3E - ldrb r1, [r1] - lsls r1, 29 - lsrs r1, 31 - strh r1, [r4, 0xE] - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end c3_80DFBE4 - - thumb_func_start sub_815BB58 -sub_815BB58: @ 815BB58 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x02038436 - ldrb r0, [r0] - ldr r1, =0x02038437 - ldrb r1, [r1] - movs r2, 0x1 - bl sub_805E448 - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815BB58 - - thumb_func_start sub_815BB84 -sub_815BB84: @ 815BB84 - push {r4,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - 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 _0815BBA2 - b _0815BDF2 -_0815BBA2: - lsls r0, 2 - ldr r1, =_0815BBB4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815BBB4: - .4byte _0815BBC8 - .4byte _0815BCB8 - .4byte _0815BD08 - .4byte _0815BD72 - .4byte _0815BDA6 -_0815BBC8: - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0815BC02 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl lcd_bg_operations -_0815BC02: - mov r0, sp - bl sub_80A6B30 - ldr r1, =gUnknown_08C2A6EC - mov r0, sp - movs r2, 0 - bl sub_80A6D60 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0815BC34 - ldr r1, =0x02022e18 - ldr r3, =0x0000ffc8 - b _0815BC5C - .pool -_0815BC34: - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0815BC58 - ldr r1, =0x02022e18 - ldr r2, =0x0000ff79 - adds r0, r2, 0 - b _0815BC5E - .pool -_0815BC58: - ldr r1, =0x02022e18 - ldr r3, =0x0000fff6 -_0815BC5C: - adds r0, r3, 0 -_0815BC5E: - strh r0, [r1] - ldr r1, =0x02022e1a - movs r0, 0 - strh r0, [r1] - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08C2A634 - mov r2, sp - ldrh r2, [r2, 0xA] - bl sub_80A6CC0 - ldr r0, =gUnknown_08C2A6D4 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - movs r2, 0x20 - bl decompress_palette - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =0x02022e18 - ldrh r0, [r0] - strh r0, [r1, 0x1C] - ldr r0, =0x02022e1a - ldrh r0, [r0] - strh r0, [r1, 0x1E] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - b _0815BD8E - .pool -_0815BCB8: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0x10] - adds r1, r0, 0x1 - strh r1, [r4, 0x10] - lsls r0, 16 - cmp r0, 0 - bgt _0815BCCE - b _0815BDF2 -_0815BCCE: - movs r0, 0 - strh r0, [r4, 0x10] - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - ble _0815BCE4 - movs r0, 0xC - strh r0, [r4, 0xA] -_0815BCE4: - ldrh r0, [r4, 0xA] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0xC - bne _0815BDF2 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815BDF2 -_0815BD08: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - cmp r0, 0 - bge _0815BD20 - movs r0, 0 - strh r0, [r4, 0xA] -_0815BD20: - ldrh r0, [r4, 0xA] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0815BDF2 - ldr r2, =0x02022e18 - ldr r1, =gUnknown_085CE460 - movs r3, 0xC - ldrsh r0, [r4, r3] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrh r1, [r4, 0x1C] - adds r0, r1 - strh r0, [r2] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0815BD6C - strh r0, [r4, 0x8] - b _0815BDF2 - .pool -_0815BD6C: - movs r0, 0x3 - strh r0, [r4, 0x8] - b _0815BDF2 -_0815BD72: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r2 - ldrh r0, [r1, 0xE] - adds r0, 0x1 - strh r0, [r1, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0815BDF2 - movs r0, 0 - strh r0, [r1, 0xE] - movs r0, 0x1 -_0815BD8E: - strh r0, [r1, 0x8] - movs r0, 0x40 - negs r0, r0 - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xE4 - bl audio_play_and_stuff - b _0815BDF2 -_0815BDA6: - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x9] - bl sub_80A6C68 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0815BDC8 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0 - bl lcd_bg_operations -_0815BDC8: - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - ldr r0, =0x02022e18 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e1a - strh r1, [r0] - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl move_anim_task_del -_0815BDF2: - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815BB84 - - thumb_func_start sub_815BE04 -sub_815BE04: @ 815BE04 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r7, r0, 0 - bl GenerateRandomNumber2 - lsls r0, 16 - movs r1, 0xFC - lsls r1, 14 - ands r1, r0 - lsrs r5, r1, 16 - adds r1, r5, 0 - cmp r1, 0x1F - ble _0815BE2E - movs r0, 0x20 - subs r0, r1 - lsls r0, 16 - lsrs r5, r0, 16 -_0815BE2E: - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, r5 - strh r0, [r7, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x20 - strh r0, [r7, 0x22] - ldr r1, =0x0203841e - ldrh r0, [r1] - strh r0, [r7, 0x30] - ldrh r0, [r1, 0x2] - strh r0, [r7, 0x32] - ldr r4, =gUnknown_085CE48C - movs r0, 0x20 - ldrsh r1, [r7, r0] - movs r0, 0x22 - ldrsh r2, [r7, r0] - adds r5, r7, 0 - adds r5, 0x43 - ldrb r3, [r5] - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - bl AddObjectToFront - mov r9, r0 - mov r1, r9 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - movs r0, 0x20 - ldrsh r1, [r7, r0] - movs r0, 0x22 - ldrsh r2, [r7, r0] - ldrb r3, [r5] - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - bl AddObjectToFront - mov r8, r0 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - mov r0, r9 - lsls r2, r0, 4 - add r2, r9 - lsls r2, 2 - ldr r1, =0x02020630 - mov r10, r1 - adds r5, r2, r1 - adds r0, r5, 0 - movs r1, 0x1 - str r2, [sp] - bl StartObjectImageAnim - mov r0, r8 - lsls r6, r0, 4 - add r6, r8 - lsls r6, 2 - mov r1, r10 - adds r4, r6, r1 - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectImageAnim - ldr r1, =0x0203841e - ldrh r0, [r1] - strh r0, [r5, 0x30] - ldrh r0, [r1, 0x2] - strh r0, [r5, 0x32] - ldrh r0, [r1] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x32] - ldr r0, =0x0000ffff - strh r0, [r5, 0x3C] - movs r0, 0x1 - negs r0, r0 - strh r0, [r4, 0x3C] - adds r5, 0x3E - ldrb r0, [r5] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r5] - adds r4, 0x3E - ldrb r0, [r4] - orrs r0, r1 - strb r0, [r4] - movs r0, 0x1C - add r10, r0 - ldr r2, [sp] - add r2, r10 - ldr r0, =sub_815C050 - str r0, [r2] - add r6, r10 - str r0, [r6] - mov r1, r9 - strh r1, [r7, 0x3A] - mov r0, r8 - strh r0, [r7, 0x3C] - ldr r0, =sub_815BF44 - str r0, [r7, 0x1C] - 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_815BE04 - - thumb_func_start sub_815BF44 -sub_815BF44: @ 815BF44 - push {lr} - adds r3, r0, 0 - ldrh r2, [r3, 0x32] - ldrh r0, [r3, 0x34] - adds r2, r0 - lsls r0, r2, 16 - asrs r0, 24 - ldrh r1, [r3, 0x26] - subs r1, r0 - strh r1, [r3, 0x26] - movs r0, 0xFF - ands r2, r0 - strh r2, [r3, 0x34] - movs r2, 0x36 - ldrsh r0, [r3, r2] - cmp r0, 0 - bne _0815BF92 - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x8 - negs r1, r1 - cmp r0, r1 - bge _0815BF92 - ldr r2, =0x02020630 - movs r0, 0x3A - ldrsh r1, [r3, r0] - 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] - ldrh r0, [r3, 0x36] - adds r0, 0x1 - strh r0, [r3, 0x36] -_0815BF92: - movs r1, 0x36 - ldrsh r0, [r3, r1] - cmp r0, 0x1 - bne _0815BFC6 - movs r2, 0x26 - ldrsh r1, [r3, r2] - movs r0, 0x10 - negs r0, r0 - cmp r1, r0 - bge _0815BFC6 - ldr r2, =0x02020630 - movs r0, 0x3C - ldrsh r1, [r3, r0] - 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] - ldrh r0, [r3, 0x36] - adds r0, 0x1 - strh r0, [r3, 0x36] -_0815BFC6: - ldrh r0, [r3, 0x30] - subs r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0815BFE8 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815BFF4 - str r0, [r3, 0x1C] -_0815BFE8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_815BF44 - - thumb_func_start sub_815BFF4 -sub_815BFF4: @ 815BFF4 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r5, =0x02020630 - movs r0, 0x3A - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r3, r0, 2 - adds r6, r5, 0 - adds r6, 0x1C - adds r0, r3, r6 - ldr r2, [r0] - ldr r0, =DummyObjectCallback - cmp r2, r0 - bne _0815C040 - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldr r0, [r1] - cmp r0, r2 - bne _0815C040 - adds r0, r3, r5 - bl RemoveObjectAndFreeTiles - movs r0, 0x3C - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - adds r0, r4, 0 - bl move_anim_8072740 -_0815C040: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815BFF4 - - thumb_func_start sub_815C050 -sub_815C050: @ 815C050 - push {lr} - adds r3, r0, 0 - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _0815C09C - ldrh r2, [r3, 0x32] - ldrh r1, [r3, 0x34] - adds r2, r1 - lsls r1, r2, 16 - asrs r1, 24 - ldrh r0, [r3, 0x26] - subs r0, r1 - strh r0, [r3, 0x26] - movs r0, 0xFF - ands r2, r0 - strh r2, [r3, 0x34] - ldrh r0, [r3, 0x30] - subs r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0815C09C - mov r1, r12 - ldrb r0, [r1] - movs r1, 0x4 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - ldr r0, =DummyObjectCallback - str r0, [r3, 0x1C] -_0815C09C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_815C050 - - thumb_func_start sub_815C0A4 -sub_815C0A4: @ 815C0A4 - push {r4-r6,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r4, r1, 0 - cmp r0, 0x5 - bls _0815C0C2 - b _0815C396 -_0815C0C2: - lsls r0, 2 - ldr r1, =_0815C0D4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815C0D4: - .4byte _0815C0EC - .4byte _0815C224 - .4byte _0815C2AC - .4byte _0815C2E2 - .4byte _0815C310 - .4byte _0815C34A -_0815C0EC: - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x00000d03 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0815C124 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl lcd_bg_operations -_0815C124: - mov r0, sp - bl sub_80A6B30 - ldr r1, =gUnknown_08C2A6EC - mov r0, sp - movs r2, 0 - bl sub_80A6D60 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0815C15C - ldr r1, =0x02022e18 - ldr r3, =0x0000ffc8 - adds r0, r3, 0 - b _0815C1CA - .pool -_0815C15C: - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r4, r0, 24 - bl battle_type_is_double - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815C1B4 - cmp r4, 0x1 - bne _0815C180 - ldr r1, =0x02022e18 - ldr r2, =0x0000ff65 - adds r0, r2, 0 - strh r0, [r1] -_0815C180: - cmp r4, 0x3 - bne _0815C18C - ldr r1, =0x02022e18 - ldr r3, =0x0000ff8d - adds r0, r3, 0 - strh r0, [r1] -_0815C18C: - cmp r4, 0 - bne _0815C196 - ldr r1, =0x02022e18 - movs r0, 0xE - strh r0, [r1] -_0815C196: - cmp r4, 0x2 - bne _0815C1CC - ldr r1, =0x02022e18 - ldr r2, =0x0000ffec - b _0815C1C8 - .pool -_0815C1B4: - cmp r4, 0x1 - bne _0815C1C0 - ldr r1, =0x02022e18 - ldr r3, =0x0000ff79 - adds r0, r3, 0 - strh r0, [r1] -_0815C1C0: - cmp r4, 0 - bne _0815C1CC - ldr r1, =0x02022e18 - ldr r2, =0x0000fff6 -_0815C1C8: - adds r0, r2, 0 -_0815C1CA: - strh r0, [r1] -_0815C1CC: - ldr r1, =0x02022e1a - movs r0, 0 - strh r0, [r1] - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08C2A634 - mov r2, sp - ldrh r2, [r2, 0xA] - bl sub_80A6CC0 - ldr r0, =gUnknown_08C2A6D4 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - movs r2, 0x20 - bl decompress_palette - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =0x02022e18 - ldrh r0, [r0] - strh r0, [r1, 0x1C] - ldr r0, =0x02022e1a - ldrh r0, [r0] - strh r0, [r1, 0x1E] - b _0815C2A4 - .pool -_0815C224: - ldr r1, =0x03005e00 - lsls r4, r6, 2 - adds r0, r4, r6 - lsls r0, 3 - adds r5, r0, r1 - movs r0, 0 - strh r0, [r5, 0xE] - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815C268 - ldr r2, =0x02022e18 - ldr r1, =gUnknown_085CE4A4 - movs r3, 0xC - ldrsh r0, [r5, r3] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrh r5, [r5, 0x1C] - adds r0, r5 - b _0815C27A - .pool -_0815C268: - ldr r2, =0x02022e18 - ldr r1, =gUnknown_085CE4A4 - movs r3, 0xC - ldrsh r0, [r5, r3] - adds r0, r1 - movs r1, 0 - ldrsb r1, [r0, r1] - ldrh r0, [r5, 0x1C] - subs r0, r1 -_0815C27A: - strh r0, [r2] - ldr r0, =0x03005e00 - adds r1, r4, r6 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0xC] - adds r0, 0x1 - strh r0, [r1, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _0815C2A4 - strh r0, [r1, 0x8] - b _0815C396 - .pool -_0815C2A4: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0815C396 -_0815C2AC: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r4 - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bgt _0815C2C6 - movs r0, 0x5 - strh r0, [r4, 0xA] -_0815C2C6: - ldrh r1, [r4, 0xA] - lsls r1, 8 - movs r0, 0x3 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x5 - bne _0815C396 - b _0815C302 -_0815C2E2: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r4 - ldrh r1, [r4, 0xE] - adds r1, 0x1 - strh r1, [r4, 0xE] - lsls r1, 16 - asrs r1, 16 - ldr r2, =gUnknown_085CE4A8 - movs r3, 0xC - ldrsh r0, [r4, r3] - adds r0, r2 - ldrb r0, [r0] - cmp r1, r0 - ble _0815C396 -_0815C302: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815C396 - .pool -_0815C310: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r4 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xD - ble _0815C32A - movs r0, 0xD - strh r0, [r4, 0xA] -_0815C32A: - ldrh r1, [r4, 0xA] - lsls r1, 8 - movs r0, 0x3 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0xD - bne _0815C396 - movs r0, 0x1 - strh r0, [r4, 0x8] - b _0815C396 -_0815C34A: - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x9] - bl sub_80A6C68 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0815C36C - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0 - bl lcd_bg_operations -_0815C36C: - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - ldr r0, =0x02022e18 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e1a - strh r1, [r0] - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r6, 0 - bl move_anim_task_del -_0815C396: - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815C0A4 - - thumb_func_start sub_815C3A8 -sub_815C3A8: @ 815C3A8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815C3E8 - movs r0, 0 - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE4B0 - adds r0, r4, 0 - bl sub_80A7CFC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815C3FA - .pool -_0815C3E8: - adds r0, r4, 0 - bl sub_80A7D34 - lsls r0, 24 - cmp r0, 0 - bne _0815C3FA - adds r0, r5, 0 - bl move_anim_task_del -_0815C3FA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815C3A8 - - thumb_func_start sub_815C400 -sub_815C400: @ 815C400 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - movs r2, 0x2E - ldrsh r1, [r4, r2] - cmp r1, 0 - bne _0815C41E - adds r0, r4, 0 - movs r1, 0 - bl sub_80A69CC - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815C472 -_0815C41E: - adds r0, 0x1 - strh r0, [r4, 0x2E] - cmp r1, 0x14 - ble _0815C472 - ldrh r0, [r4, 0x30] - adds r0, 0xA0 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x32] - adds r0, 0x80 - strh r0, [r4, 0x32] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0815C450 - ldrh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 - negs r0, r0 - b _0815C456 - .pool -_0815C450: - ldrh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 -_0815C456: - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x40 - ble _0815C472 - adds r0, r4, 0 - bl move_anim_8072740 -_0815C472: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815C400 - - thumb_func_start sub_815C478 -sub_815C478: @ 815C478 - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - ldr r5, =0x0203841e - movs r1, 0x2 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815C4A4 - adds r0, r2, 0 - bl move_anim_task_del - b _0815C538 - .pool -_0815C4A4: - movs r1, 0x4 - ldrsh r0, [r5, r1] - cmp r0, 0 - bge _0815C4B0 - movs r0, 0 - strh r0, [r5, 0x4] -_0815C4B0: - movs r1, 0x4 - ldrsh r0, [r5, r1] - cmp r0, 0x2 - ble _0815C4BC - movs r0, 0x2 - strh r0, [r5, 0x4] -_0815C4BC: - movs r0, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - movs r0, 0x4 - ldrsh r1, [r5, r0] - lsls r1, 1 - movs r0, 0x8 - subs r0, r1 - strh r0, [r4, 0xE] - movs r1, 0x4 - ldrsh r0, [r5, r1] - lsls r0, 7 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - strh r0, [r4, 0x10] - ldrh r0, [r5, 0x4] - adds r0, 0x2 - strh r0, [r4, 0x12] - ldrh r0, [r5, 0x2] - subs r0, 0x1 - strh r0, [r4, 0x14] - ldrb r0, [r5] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815C508 - ldr r0, =0x02038436 - b _0815C50A - .pool -_0815C508: - ldr r0, =0x02038437 -_0815C50A: - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815C528 - movs r1, 0x10 - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0x10] - movs r1, 0x12 - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0x12] -_0815C528: - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_80A7270 - ldr r0, =sub_815C548 - str r0, [r4] -_0815C538: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815C478 - - thumb_func_start sub_815C548 -sub_815C548: @ 815C548 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r6, [r4, r0] - cmp r6, 0x1 - beq _0815C5D0 - cmp r6, 0x1 - bgt _0815C570 - cmp r6, 0 - beq _0815C57C - b _0815C6A8 - .pool -_0815C570: - cmp r6, 0x2 - beq _0815C628 - cmp r6, 0x3 - bne _0815C57A - b _0815C698 -_0815C57A: - b _0815C6A8 -_0815C57C: - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r4, 0x12] - ldrh r2, [r0, 0x24] - adds r1, r2 - strh r1, [r0, 0x24] - ldrh r0, [r4, 0xC] - ldrh r1, [r4, 0x10] - subs r0, r1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0xC] - adds r1, r2, 0 - bl obj_id_set_rotscale - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A73A0 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r2, 0xE - ldrsh r1, [r4, r2] - cmp r0, r1 - blt _0815C6A8 - strh r6, [r4, 0xA] - b _0815C690 - .pool -_0815C5D0: - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x24] - ldrh r2, [r4, 0x12] - subs r1, r2 - strh r1, [r0, 0x24] - ldrh r0, [r4, 0x10] - ldrh r1, [r4, 0xC] - adds r0, r1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0xC] - adds r1, r2, 0 - bl obj_id_set_rotscale - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A73A0 - ldrh r1, [r4, 0xA] - adds r1, 0x1 - strh r1, [r4, 0xA] - lsls r1, 16 - asrs r1, 16 - movs r2, 0xE - ldrsh r0, [r4, r2] - lsls r0, 1 - cmp r1, r0 - blt _0815C6A8 - movs r0, 0 - strh r0, [r4, 0xA] - b _0815C690 - .pool -_0815C628: - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r4, 0x12] - ldrh r2, [r0, 0x24] - adds r1, r2 - movs r5, 0 - strh r1, [r0, 0x24] - ldrh r0, [r4, 0xC] - ldrh r1, [r4, 0x10] - subs r0, r1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0xC] - adds r1, r2, 0 - bl obj_id_set_rotscale - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A73A0 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r2, 0xE - ldrsh r1, [r4, r2] - cmp r0, r1 - blt _0815C6A8 - ldrh r1, [r4, 0x14] - movs r2, 0x14 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0815C690 - subs r0, r1, 0x1 - strh r0, [r4, 0x14] - strh r5, [r4, 0xA] - strh r5, [r4, 0x8] - b _0815C6A8 - .pool -_0815C690: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815C6A8 -_0815C698: - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A7344 - adds r0, r5, 0 - bl move_anim_task_del -_0815C6A8: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_815C548 - - thumb_func_start sub_815C6B0 -sub_815C6B0: @ 815C6B0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0815C6D4 - strh r0, [r4, 0x20] - ldr r1, =0x0203841e - ldrh r0, [r1] - b _0815C6DE - .pool -_0815C6D4: - movs r0, 0xF0 - strh r0, [r4, 0x20] - ldr r1, =0x0203841e - ldrh r0, [r1] - subs r0, 0x1E -_0815C6DE: - strh r0, [r4, 0x22] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x32] - ldrb r1, [r1, 0x2] - adds r0, r4, 0 - bl StartObjectImageAnim - ldr r0, =sub_815C700 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815C6B0 - - thumb_func_start sub_815C700 -sub_815C700: @ 815C700 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x3 - strh r0, [r4, 0x2E] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0815C744 - ldrh r1, [r4, 0x20] - adds r1, 0x5 - strh r1, [r4, 0x20] - ldrh r0, [r4, 0x22] - subs r0, 0x1 - strh r0, [r4, 0x22] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0xF0 - ble _0815C732 - adds r0, r4, 0 - bl move_anim_8072740 -_0815C732: - ldrh r1, [r4, 0x2E] - movs r0, 0xFF - ands r0, r1 - movs r1, 0x10 - bl sine - b _0815C768 - .pool -_0815C744: - ldrh r1, [r4, 0x20] - subs r1, 0x5 - strh r1, [r4, 0x20] - ldrh r0, [r4, 0x22] - adds r0, 0x1 - strh r0, [r4, 0x22] - lsls r1, 16 - cmp r1, 0 - bge _0815C75C - adds r0, r4, 0 - bl move_anim_8072740 -_0815C75C: - ldrh r1, [r4, 0x2E] - movs r0, 0xFF - ands r0, r1 - movs r1, 0x10 - bl cosine -_0815C768: - strh r0, [r4, 0x26] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815C700 - - thumb_func_start sub_815C770 -sub_815C770: @ 815C770 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - movs r0, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - strh r0, [r4, 0xE] - movs r0, 0x20 - strh r0, [r4, 0x20] - movs r0, 0x40 - strh r0, [r4, 0x22] - movs r0, 0x80 - lsls r0, 4 - strh r0, [r4, 0x24] - ldr r0, =0x0203841e - ldrb r0, [r0] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - movs r1, 0 - bl sub_80A7270 - ldr r0, =sub_815C7C4 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815C770 - - thumb_func_start sub_815C7C4 -sub_815C7C4: @ 815C7C4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r7, r0, r1 - movs r1, 0x8 - ldrsh r0, [r7, r1] - mov r8, r0 - cmp r0, 0x1 - beq _0815C860 - cmp r0, 0x1 - bgt _0815C7F4 - cmp r0, 0 - beq _0815C7FC - b _0815C8DA - .pool -_0815C7F4: - mov r2, r8 - cmp r2, 0x2 - beq _0815C8C8 - b _0815C8DA -_0815C7FC: - movs r3, 0x80 - lsls r3, 2 - adds r0, r3, 0 - ldrh r1, [r7, 0xC] - adds r2, r0, r1 - strh r2, [r7, 0xC] - lsls r0, r2, 16 - asrs r0, 16 - ldrh r3, [r7, 0x24] - mov r8, r3 - movs r3, 0x24 - ldrsh r1, [r7, r3] - cmp r0, r1 - blt _0815C8DA - mov r0, r8 - subs r5, r0, r2 - lsls r5, 16 - asrs r5, 16 - adds r6, r1, 0 - lsls r6, 1 - adds r0, r5, 0 - adds r1, r6, 0 - bl __divsi3 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - adds r1, r6, 0 - bl __modsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 16 - asrs r4, 16 - movs r1, 0x1 - ands r4, r1 - cmp r4, 0 - bne _0815C854 - lsls r0, 16 - asrs r0, 16 - mov r2, r8 - subs r0, r2, r0 - b _0815C8B2 -_0815C854: - lsls r0, 16 - asrs r0, 16 - mov r3, r8 - subs r0, r3 - strh r0, [r7, 0xC] - b _0815C8DA -_0815C860: - ldr r1, =0xfffffe00 - adds r0, r1, 0 - ldrh r2, [r7, 0xC] - adds r1, r0, r2 - strh r1, [r7, 0xC] - movs r3, 0xC - ldrsh r0, [r7, r3] - movs r2, 0x24 - ldrsh r6, [r7, r2] - cmn r0, r6 - bgt _0815C8DA - ldrh r3, [r7, 0x24] - mov r9, r3 - mov r0, r9 - subs r4, r0, r1 - lsls r4, 16 - asrs r4, 16 - lsls r6, 1 - adds r0, r4, 0 - adds r1, r6, 0 - bl __divsi3 - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - adds r1, r6, 0 - bl __modsi3 - lsls r0, 16 - lsrs r2, r0, 16 - mov r1, r8 - ands r1, r5 - lsls r0, r1, 16 - asrs r1, r0, 16 - cmp r1, 0 - bne _0815C8BC - lsls r0, r2, 16 - asrs r0, 16 - mov r2, r9 - subs r0, r2 -_0815C8B2: - strh r0, [r7, 0xC] - strh r1, [r7, 0x8] - b _0815C8DA - .pool -_0815C8BC: - lsls r0, r2, 16 - asrs r0, 16 - mov r3, r9 - subs r0, r3, r0 - strh r0, [r7, 0xC] - b _0815C8DA -_0815C8C8: - ldrh r0, [r7, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A7344 - adds r0, r4, 0 - bl move_anim_task_del - b _0815C950 -_0815C8DA: - ldrh r0, [r7, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r7, 0xC] - adds r1, r2, 0 - bl obj_id_set_rotscale - ldrh r0, [r7, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A73A0 - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - movs r2, 0xC - ldrsh r0, [r7, r2] - cmp r0, 0 - bge _0815C90E - adds r0, 0x3F -_0815C90E: - asrs r0, 6 - negs r0, r0 - strh r0, [r1, 0x24] - ldrh r0, [r7, 0xA] - adds r0, 0x1 - strh r0, [r7, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _0815C950 - ldrh r1, [r7, 0x20] - movs r3, 0x20 - ldrsh r0, [r7, r3] - cmp r0, 0 - beq _0815C94C - subs r0, r1, 0x1 - strh r0, [r7, 0x20] - ldrh r0, [r7, 0x24] - ldrh r1, [r7, 0x22] - subs r0, r1 - strh r0, [r7, 0x24] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - bgt _0815C950 - movs r0, 0x10 - strh r0, [r7, 0x24] - b _0815C950 - .pool -_0815C94C: - movs r0, 0x2 - strh r0, [r7, 0x8] -_0815C950: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815C7C4 - - thumb_func_start sub_815C95C -sub_815C95C: @ 815C95C - push {r4-r6,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815C9BC - ldr r6, =0x0203841e - movs r2, 0x4 - ldrsh r0, [r6, r2] - cmp r0, 0 - bne _0815C990 - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] -_0815C990: - ldrh r0, [r6] - ldrh r1, [r5, 0x20] - adds r0, r1 - strh r0, [r5, 0x20] - ldrh r1, [r6, 0x2] - ldrh r2, [r5, 0x22] - adds r0, r1, r2 - strh r0, [r5, 0x22] - movs r0, 0x80 - strh r0, [r5, 0x30] - movs r0, 0xC0 - lsls r0, 2 - strh r0, [r5, 0x32] - strh r1, [r5, 0x34] - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - b _0815CA1A - .pool -_0815C9BC: - ldrh r1, [r5, 0x30] - lsls r0, r1, 16 - asrs r0, 24 - strh r0, [r5, 0x24] - ldrh r0, [r5, 0x32] - lsls r0, 16 - asrs r0, 24 - ldrh r2, [r5, 0x26] - adds r0, r2 - strh r0, [r5, 0x26] - movs r2, 0x36 - ldrsh r0, [r5, r2] - adds r4, r1, 0 - cmp r0, 0 - bne _0815C9FA - movs r0, 0x26 - ldrsh r1, [r5, r0] - movs r2, 0x34 - ldrsh r0, [r5, r2] - cmn r1, r0 - ble _0815C9FA - movs r0, 0x1 - strh r0, [r5, 0x36] - movs r1, 0x32 - ldrsh r0, [r5, r1] - negs r0, r0 - movs r1, 0x3 - bl __divsi3 - lsls r0, 1 - strh r0, [r5, 0x32] -_0815C9FA: - adds r0, r4, 0 - adds r0, 0xC0 - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x32] - adds r0, 0x80 - strh r0, [r5, 0x32] - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0815CA1A - adds r0, r5, 0 - bl move_anim_8072740 -_0815CA1A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_815C95C - - thumb_func_start sub_815CA20 -sub_815CA20: @ 815CA20 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r2, r0, r1 - movs r1, 0x8 - ldrsh r0, [r2, r1] - cmp r0, 0 - bne _0815CB2C - ldr r0, =0x0203841e - movs r3, 0 - ldrsh r1, [r0, r3] - mov r8, r0 - cmp r1, 0 - bne _0815CA5C - ldr r0, =0x02038436 - b _0815CA5E - .pool -_0815CA5C: - ldr r0, =0x02038437 -_0815CA5E: - ldrb r0, [r0] - strh r0, [r2, 0x1E] - mov r1, r8 - ldrb r0, [r1] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r4, r7, 2 - adds r0, r4, r7 - lsls r0, 3 - adds r6, r0, r1 - strh r5, [r6, 0x1C] - adds r0, r5, 0 - movs r1, 0 - bl sub_80A7270 - mov r2, r8 - movs r3, 0x2 - ldrsh r0, [r2, r3] - cmp r0, 0x1 - beq _0815CAC0 - cmp r0, 0x1 - bgt _0815CAA0 - cmp r0, 0 - beq _0815CAA8 - lsls r2, r5, 4 - b _0815CB08 - .pool -_0815CAA0: - cmp r0, 0x2 - beq _0815CACA - lsls r2, r5, 4 - b _0815CB08 -_0815CAA8: - movs r2, 0xA0 - lsls r2, 1 - adds r0, r5, 0 - movs r1, 0xE0 - movs r3, 0 - bl obj_id_set_rotscale - adds r0, r5, 0 - bl sub_80A7E6C - lsls r2, r5, 4 - b _0815CB08 -_0815CAC0: - movs r2, 0x98 - lsls r2, 1 - movs r3, 0xF0 - lsls r3, 4 - b _0815CAD2 -_0815CACA: - movs r2, 0x98 - lsls r2, 1 - movs r3, 0xF1 - lsls r3, 8 -_0815CAD2: - adds r0, r5, 0 - movs r1, 0xD0 - bl obj_id_set_rotscale - adds r0, r5, 0 - bl sub_80A7E6C - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0815CAF8 - ldrb r0, [r6, 0x1E] - bl battle_side_get_owner - lsls r0, 24 - lsls r2, r5, 4 - cmp r0, 0 - bne _0815CB08 -_0815CAF8: - ldr r0, =0x02020630 - lsls r2, r5, 4 - adds r1, r2, r5 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x26] - adds r0, 0x10 - strh r0, [r1, 0x26] -_0815CB08: - ldr r1, =0x02020630 - adds r0, r2, r5 - lsls r0, 2 - adds r0, r1 - movs r1, 0x2 - strh r1, [r0, 0x24] - ldr r0, =0x03005e00 - adds r1, r4, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0815CB78 - .pool -_0815CB2C: - ldrb r5, [r2, 0x1C] - ldrh r0, [r2, 0xC] - adds r0, 0x1 - movs r4, 0 - strh r0, [r2, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bne _0815CB50 - strh r4, [r2, 0xC] - ldr r0, =0x02020630 - lsls r1, r5, 4 - adds r1, r5 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x24] - negs r0, r0 - strh r0, [r1, 0x24] -_0815CB50: - ldrh r0, [r2, 0xA] - adds r0, 0x1 - strh r0, [r2, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xD - bne _0815CB78 - adds r0, r5, 0 - bl sub_80A7344 - ldr r1, =0x02020630 - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - strh r4, [r0, 0x24] - strh r4, [r0, 0x26] - adds r0, r7, 0 - bl move_anim_task_del -_0815CB78: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CA20 - - thumb_func_start sub_815CB88 -sub_815CB88: @ 815CB88 - push {r4,r5,lr} - adds r4, r0, 0 - bl GenerateRandomNumber2 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xC - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, r0 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - bl GenerateRandomNumber2 - ldr r5, =0x000001ff - ands r5, r0 - bl GenerateRandomNumber2 - movs r1, 0xFF - ands r1, r0 - movs r0, 0x1 - ands r0, r5 - cmp r0, 0 - beq _0815CBE0 - movs r2, 0xBC - lsls r2, 3 - adds r0, r5, r2 - b _0815CBE8 - .pool -_0815CBE0: - movs r3, 0xBC - lsls r3, 3 - adds r0, r3, 0 - subs r0, r5 -_0815CBE8: - strh r0, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815CBFA - movs r2, 0x90 - lsls r2, 3 - adds r0, r1, r2 - b _0815CC02 -_0815CBFA: - movs r3, 0x90 - lsls r3, 3 - adds r0, r3, 0 - subs r0, r1 -_0815CC02: - strh r0, [r4, 0x30] - ldr r0, =0x0203841e - ldrh r0, [r0] - strh r0, [r4, 0x32] - lsls r0, 16 - cmp r0, 0 - bne _0815CC1C - ldr r0, =0x0000fff8 - b _0815CC1E - .pool -_0815CC1C: - movs r0, 0xF8 -_0815CC1E: - strh r0, [r4, 0x20] - movs r0, 0x68 - strh r0, [r4, 0x22] - ldr r0, =sub_815CC34 - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CB88 - - thumb_func_start sub_815CC34 -sub_815CC34: @ 815CC34 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815CC4C - ldrh r3, [r4, 0x2E] - lsls r0, r3, 16 - asrs r0, 24 - ldrh r1, [r4, 0x24] - adds r0, r1 - b _0815CC56 -_0815CC4C: - ldrh r3, [r4, 0x2E] - lsls r1, r3, 16 - asrs r1, 24 - ldrh r0, [r4, 0x24] - subs r0, r1 -_0815CC56: - strh r0, [r4, 0x24] - ldrh r2, [r4, 0x30] - lsls r1, r2, 16 - asrs r1, 24 - ldrh r0, [r4, 0x26] - subs r0, r1 - strh r0, [r4, 0x26] - adds r0, r3, 0 - subs r0, 0x16 - strh r0, [r4, 0x2E] - adds r1, r2, 0 - subs r1, 0x30 - strh r1, [r4, 0x30] - lsls r0, 16 - cmp r0, 0 - bge _0815CC7A - movs r0, 0 - strh r0, [r4, 0x2E] -_0815CC7A: - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1F - bne _0815CC8E - adds r0, r4, 0 - bl move_anim_8072740 -_0815CC8E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815CC34 - - thumb_func_start sub_815CC94 -sub_815CC94: @ 815CC94 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r1, =0x00001f3f - movs r0, 0x4A - bl SetGpuReg - movs r1, 0x80 - lsls r1, 8 - movs r0, 0 - bl SetGpuRegBits - ldr r0, =0x02022e24 - movs r1, 0 - strh r1, [r0] - ldr r4, =0x02022e26 - strh r1, [r4] - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x44 - bl SetGpuReg - ldr r0, =0x0203841e - ldrh r0, [r0, 0x4] - strh r0, [r5, 0x2E] - adds r0, r5, 0 - movs r1, 0 - bl sub_80A6980 - ldrb r1, [r5, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r5, 0x1] - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815CD0C - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CC94 - - thumb_func_start sub_815CD0C -sub_815CD0C: @ 815CD0C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0815CD4A - cmp r0, 0x1 - bgt _0815CD22 - cmp r0, 0 - beq _0815CD2C - b _0815CDAA -_0815CD22: - cmp r0, 0x2 - beq _0815CD60 - cmp r0, 0x3 - beq _0815CD82 - b _0815CDAA -_0815CD2C: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0815CDAA - b _0815CD7A -_0815CD4A: - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - cmp r0, 0 - bne _0815CDAA - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80082B8 - b _0815CD7A -_0815CD60: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0815CDAA - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_0815CD7A: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - b _0815CDAA -_0815CD82: - ldr r1, =0x00003f3f - movs r0, 0x4A - bl SetGpuReg - movs r0, 0 - bl GetGpuReg - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 8 - adds r0, r2, 0 - eors r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0 - bl SetGpuReg - adds r0, r4, 0 - bl move_anim_8072740 -_0815CDAA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CD0C - - thumb_func_start sub_815CDB4 -sub_815CDB4: @ 815CDB4 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x02038436 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x20] - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - ldr r1, =0x0203841e - ldrh r0, [r1] - strh r0, [r4, 0x2E] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x30] - ldr r1, =sub_815CDFC - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CDB4 - - thumb_func_start sub_815CDFC -sub_815CDFC: @ 815CDFC - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x30 - ldrsh r0, [r4, r1] - ldrh r1, [r4, 0x32] - lsls r1, 16 - asrs r1, 24 - bl sine - strh r0, [r4, 0x24] - movs r2, 0x30 - ldrsh r0, [r4, r2] - ldrh r1, [r4, 0x34] - lsls r1, 16 - asrs r1, 24 - bl cosine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x9 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - lsls r1, r0, 16 - cmp r0, 0x3F - bls _0815CE36 - asrs r0, r1, 16 - cmp r0, 0xC3 - ble _0815CE48 -_0815CE36: - ldr r0, =0x02038436 - ldrb r0, [r0] - bl sub_80A82E4 - subs r0, 0x1 - b _0815CE52 - .pool -_0815CE48: - ldr r0, =0x02038436 - ldrb r0, [r0] - bl sub_80A82E4 - adds r0, 0x1 -_0815CE52: - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - movs r3, 0x38 - ldrsh r2, [r4, r3] - cmp r2, 0 - bne _0815CE98 - movs r1, 0x80 - lsls r1, 3 - adds r0, r1, 0 - ldrh r3, [r4, 0x32] - adds r0, r3 - strh r0, [r4, 0x32] - movs r1, 0x80 - lsls r1, 1 - adds r0, r1, 0 - ldrh r3, [r4, 0x34] - adds r0, r3 - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x2E - ldrsh r1, [r4, r3] - cmp r0, r1 - bne _0815CEC8 - strh r2, [r4, 0x36] - movs r0, 0x1 - strh r0, [r4, 0x38] - b _0815CEC8 - .pool -_0815CE98: - cmp r2, 0x1 - bne _0815CEC8 - ldr r1, =0xfffffc00 - adds r0, r1, 0 - ldrh r2, [r4, 0x32] - adds r0, r2 - strh r0, [r4, 0x32] - ldr r3, =0xffffff00 - adds r0, r3, 0 - ldrh r1, [r4, 0x34] - adds r0, r1 - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x2E - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _0815CEC8 - adds r0, r4, 0 - bl move_anim_8072740 -_0815CEC8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CDFC - - thumb_func_start sub_815CED8 -sub_815CED8: @ 815CED8 - 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, 0x18] - movs r0, 0 - bl obj_id_for_side_relative_to_move - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0815CF18 - movs r0, 0x1 - str r0, [sp, 0x1C] - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldr r1, [r0, 0x10] - mov r9, r1 - ldr r2, [r0, 0xC] - mov r8, r2 - ldrh r6, [r0, 0x2] - movs r3, 0x14 - b _0815D058 - .pool -_0815CF18: - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0815CFC4 - movs r0, 0 - str r0, [sp, 0x1C] - ldr r6, =0x0202406e - ldr r4, =0x02038437 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r7, =0x020244ec - adds r0, r7 - movs r1, 0 - bl pokemon_getattr - mov r9, r0 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - adds r0, r7 - movs r1, 0x1 - bl pokemon_getattr - mov r8, r0 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldrb r2, [r4] - ldr r1, [r0] - lsls r0, r2, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _0815CFBC - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0815CF9C - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - adds r0, r7 - b _0815CFAA - .pool -_0815CF9C: - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 -_0815CFAA: - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r6, r0, 16 - b _0815CFBE - .pool -_0815CFBC: - ldrh r6, [r1, 0x2] -_0815CFBE: - movs r1, 0x14 - mov r10, r1 - b _0815D05A -_0815CFC4: - movs r2, 0x1 - str r2, [sp, 0x1C] - ldr r6, =0x0202406e - ldr r4, =0x02038437 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r7, =0x02024744 - adds r0, r7 - movs r1, 0 - bl pokemon_getattr - mov r9, r0 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - adds r0, r7 - movs r1, 0x1 - bl pokemon_getattr - mov r8, r0 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldrb r2, [r4] - ldr r1, [r0] - lsls r0, r2, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _0815D054 - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0815D03C - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - b _0815D048 - .pool -_0815D03C: - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - adds r0, r7 -_0815D048: - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r6, r0, 16 - b _0815D056 -_0815D054: - ldrh r6, [r1, 0x2] -_0815D056: - ldr r3, =0x0000ffec -_0815D058: - mov r10, r3 -_0815D05A: - ldr r0, =0x02038436 - ldrb r0, [r0] - bl sub_80A8328 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r5, =0x02038436 - ldrb r0, [r5] - movs r1, 0 - bl sub_80A5C6C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r5] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - mov r2, r10 - lsls r1, r2, 16 - asrs r1, 16 - adds r4, r1 - lsls r4, 16 - asrs r4, 16 - lsrs r0, 24 - str r0, [sp] - movs r0, 0x5 - str r0, [sp, 0x4] - mov r3, r9 - str r3, [sp, 0x8] - mov r0, r8 - str r0, [sp, 0xC] - ldr r0, =0x02038437 - ldrb r0, [r0] - str r0, [sp, 0x10] - movs r0, 0x1 - str r0, [sp, 0x14] - adds r0, r6, 0 - ldr r1, [sp, 0x1C] - movs r2, 0 - adds r3, r4, 0 - bl sub_80A8394 - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =0x02020630 - lsls r5, r6, 4 - adds r5, r6 - lsls r5, 2 - adds r5, r0 - movs r0, 0x3 - ands r7, r0 - lsls r7, 2 - mov r8, r7 - ldrb r0, [r5, 0x5] - movs r4, 0xD - negs r4, r4 - adds r1, r4, 0 - ands r1, r0 - mov r2, r8 - orrs r1, r2 - strb r1, [r5, 0x5] - ldrb r2, [r5, 0x1] - adds r0, r4, 0 - ands r0, r2 - movs r2, 0x4 - orrs r0, r2 - strb r0, [r5, 0x1] - ldr r0, =0x00007fff - lsrs r1, 4 - lsls r1, 4 - movs r3, 0x80 - lsls r3, 1 - adds r2, r3, 0 - orrs r1, r2 - movs r2, 0x20 - bl rboxid_80040B8 - ldrb r0, [r5, 0x5] - ands r4, r0 - mov r0, r8 - orrs r4, r0 - strb r4, [r5, 0x5] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldr r0, =0x03005e00 - ldr r1, [sp, 0x18] - lsls r4, r1, 2 - adds r4, r1 - lsls r4, 3 - adds r4, r0 - ldrh r0, [r4, 0xA] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - strh r6, [r4, 0x8] - ldr r0, =sub_815D160 - 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_815CED8 - - thumb_func_start sub_815D160 -sub_815D160: @ 815D160 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0x1C] - adds r1, r0, 0x1 - strh r1, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815D1AE - movs r0, 0 - strh r0, [r4, 0x1C] - ldrh r1, [r4, 0xA] - adds r1, 0x1 - strh r1, [r4, 0xA] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0xA - bne _0815D1AE - movs r0, 0x80 - lsls r0, 1 - strh r0, [r4, 0x1C] - strh r0, [r4, 0x1E] - ldr r0, =sub_815D1BC - str r0, [r4] -_0815D1AE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D160 - - thumb_func_start sub_815D1BC -sub_815D1BC: @ 815D1BC - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r5, r1, r2 - ldrb r2, [r5, 0x8] - ldrh r0, [r5, 0x1C] - subs r0, 0x10 - movs r4, 0 - strh r0, [r5, 0x1C] - ldrh r0, [r5, 0x1E] - adds r0, 0x80 - strh r0, [r5, 0x1E] - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r6, r0, r1 - ldrb r2, [r6, 0x1] - lsls r1, r2, 30 - lsrs r1, 30 - movs r0, 0x2 - orrs r1, r0 - subs r0, 0x6 - ands r0, r2 - orrs r0, r1 - strb r0, [r6, 0x1] - movs r0, 0x1C - ldrsh r2, [r5, r0] - movs r0, 0x1E - ldrsh r3, [r5, r0] - str r4, [sp] - adds r0, r6, 0 - movs r1, 0x1 - bl sub_80A73E0 - ldrh r0, [r5, 0x20] - adds r0, 0x1 - strh r0, [r5, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - bne _0815D22A - adds r0, r6, 0 - bl sub_80A749C - adds r0, r6, 0 - bl sub_80A8610 - ldr r0, =sub_80A6814 - str r0, [r5] -_0815D22A: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D1BC - - thumb_func_start sub_815D240 -sub_815D240: @ 815D240 - push {r4-r7,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r4, r1, r0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815D26C - ldr r0, =0x02038436 - b _0815D26E - .pool -_0815D26C: - ldr r0, =0x02038437 -_0815D26E: - ldrb r5, [r0] - movs r6, 0 - strh r6, [r4, 0x8] - strh r6, [r4, 0xA] - strh r6, [r4, 0xC] - movs r0, 0x10 - strh r0, [r4, 0xE] - strh r6, [r4, 0x10] - strh r5, [r4, 0x12] - movs r0, 0x20 - strh r0, [r4, 0x14] - strh r6, [r4, 0x16] - movs r0, 0x18 - strh r0, [r4, 0x18] - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815D2A0 - movs r1, 0x18 - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0x18] -_0815D2A0: - adds r0, r5, 0 - bl sub_80A6190 - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x22 - strh r0, [r4, 0x22] - cmp r0, 0 - bge _0815D2B4 - strh r6, [r4, 0x22] -_0815D2B4: - ldrh r0, [r4, 0x22] - adds r0, 0x42 - strh r0, [r4, 0x24] - ldr r0, =0x0203841e - ldrb r0, [r0] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - adds r0, r5, 0 - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815D304 - ldr r0, =0x04000014 - str r0, [sp] - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - ldr r0, =0x02022e18 - ldrh r5, [r0] - ldr r0, =0x02022e1a - b _0815D316 - .pool -_0815D304: - ldr r0, =0x04000018 - str r0, [sp] - ldr r1, =0x00003f44 - movs r0, 0x50 - bl SetGpuReg - ldr r0, =0x02022e1c - ldrh r5, [r0] - ldr r0, =0x02022e1e -_0815D316: - ldrh r3, [r0] - movs r7, 0 - movs r2, 0 - ldr r6, =0x02038c28 - movs r0, 0xF0 - lsls r0, 3 - adds r0, r6 - mov r12, r0 -_0815D326: - lsls r2, 16 - asrs r2, 16 - lsls r1, r2, 1 - adds r0, r1, r6 - strh r5, [r0] - add r1, r12 - strh r5, [r1] - adds r0, r2, 0x1 - lsls r0, 1 - adds r1, r0, r6 - strh r3, [r1] - add r0, r12 - strh r3, [r0] - lsls r0, r7, 16 - movs r1, 0x80 - lsls r1, 9 - adds r0, r1 - adds r2, 0x2 - lsls r2, 16 - lsrs r2, 16 - lsrs r7, r0, 16 - asrs r0, 16 - cmp r0, 0x9F - ble _0815D326 - ldr r0, =0xa6600001 - str r0, [sp, 0x4] - mov r1, sp - movs r2, 0 - movs r0, 0x1 - strb r0, [r1, 0x8] - mov r0, sp - strb r2, [r0, 0x9] - ldr r0, [sp] - ldr r1, [sp, 0x4] - ldr r2, [sp, 0x8] - bl sub_80BA038 - ldr r0, =sub_815D398 - str r0, [r4] - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D240 - - thumb_func_start sub_815D398 -sub_815D398: @ 815D398 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r6, r0, r1 - ldrb r0, [r6, 0x12] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815D3D8 - ldr r0, =0x02022e18 - ldrh r0, [r0] - str r0, [sp, 0x4] - ldr r0, =0x02022e1a - b _0815D3E0 - .pool -_0815D3D8: - ldr r0, =0x02022e1c - ldrh r0, [r0] - str r0, [sp, 0x4] - ldr r0, =0x02022e1e -_0815D3E0: - ldrh r0, [r0] - str r0, [sp, 0x8] - movs r1, 0x8 - ldrsh r0, [r6, r1] - cmp r0, 0x1 - bne _0815D3EE - b _0815D5CC -_0815D3EE: - cmp r0, 0x1 - bgt _0815D400 - cmp r0, 0 - beq _0815D40E - b _0815D63C - .pool -_0815D400: - cmp r0, 0x2 - bne _0815D406 - b _0815D5EC -_0815D406: - cmp r0, 0x3 - bne _0815D40C - b _0815D636 -_0815D40C: - b _0815D63C -_0815D40E: - movs r2, 0x24 - ldrsh r0, [r6, r2] - lsls r0, 17 - lsrs r5, r0, 16 - movs r3, 0 - str r3, [sp] - mov r9, r3 - movs r4, 0 - ldrh r0, [r6, 0xA] - adds r0, 0x2 - movs r1, 0xFF - ands r0, r1 - strh r0, [r6, 0xA] - ldrh r7, [r6, 0xA] - mov r8, r7 - movs r0, 0x14 - ldrsh r1, [r6, r0] - movs r0, 0xFC - lsls r0, 3 - bl __divsi3 - strh r0, [r6, 0x1A] - movs r1, 0x16 - ldrsh r0, [r6, r1] - lsls r0, 1 - movs r2, 0x1A - ldrsh r1, [r6, r2] - bl __divsi3 - negs r0, r0 - strh r0, [r6, 0x1C] - ldrh r0, [r6, 0x16] - strh r0, [r6, 0x1E] - lsls r0, 16 - asrs r0, 21 - lsls r0, 16 - lsrs r7, r0, 16 - strh r7, [r6, 0x20] - ldrh r2, [r6, 0x24] - lsls r3, r2, 16 - mov r12, r3 - asrs r1, r3, 16 - movs r3, 0x22 - ldrsh r0, [r6, r3] - cmp r1, r0 - ble _0815D52E - ldr r0, =0x02039b28 - mov r10, r0 - ldr r1, [sp, 0x4] - lsls r0, r1, 16 - asrs r0, 16 - str r0, [sp, 0x10] - ldr r2, [sp, 0x8] - lsls r0, r2, 16 - asrs r0, 16 - str r0, [sp, 0xC] -_0815D47E: - lsls r5, 16 - asrs r5, 16 - adds r2, r5, 0x1 - lsls r2, 1 - mov r3, r10 - ldrb r1, [r3, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r2, r0 - ldr r0, =0x02038c28 - adds r2, r0 - lsls r4, 16 - asrs r4, 16 - mov r1, r9 - lsls r0, r1, 16 - asrs r0, 16 - subs r0, r4, r0 - ldr r3, [sp, 0xC] - adds r0, r3, r0 - strh r0, [r2] - lsls r3, r5, 1 - mov r0, r10 - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r3, r0 - ldr r1, =0x02038c28 - adds r3, r1 - lsls r1, r7, 16 - asrs r1, 16 - ldr r2, [sp, 0x10] - adds r1, r2, r1 - mov r7, r8 - lsls r2, r7, 16 - asrs r2, 16 - lsls r0, r2, 1 - ldr r7, =gUnknown_08329F40 - adds r0, r7 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 21 - adds r1, r0 - strh r1, [r3] - adds r2, 0xA - mov r8, r2 - movs r0, 0xFF - mov r1, r8 - ands r1, r0 - mov r8, r1 - ldrh r0, [r6, 0x1C] - ldrh r2, [r6, 0x1E] - adds r0, r2 - strh r0, [r6, 0x1E] - lsls r0, 16 - asrs r0, 21 - lsls r0, 16 - lsrs r7, r0, 16 - strh r7, [r6, 0x20] - adds r4, 0x1 - lsls r4, 16 - lsrs r4, 16 - subs r5, 0x2 - lsls r5, 16 - lsrs r5, 16 - ldr r3, [sp] - lsls r0, r3, 16 - asrs r0, 16 - ldrh r1, [r6, 0x14] - adds r0, r1 - lsls r0, 16 - lsrs r2, r0, 16 - str r2, [sp] - asrs r0, 21 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - ldr r0, =0xffff0000 - add r0, r12 - lsrs r2, r0, 16 - lsls r3, r2, 16 - mov r12, r3 - asrs r1, r3, 16 - movs r3, 0x22 - ldrsh r0, [r6, r3] - cmp r1, r0 - bgt _0815D47E -_0815D52E: - lsls r1, r2, 17 - cmp r1, 0 - blt _0815D55A - ldr r4, =0x02038c28 - ldr r7, [sp, 0x4] - lsls r0, r7, 16 - asrs r0, 16 - adds r3, r0, 0 - adds r3, 0xF0 - movs r0, 0xF0 - lsls r0, 3 - adds r5, r4, r0 -_0815D546: - asrs r2, r1, 16 - lsls r1, r2, 1 - adds r0, r1, r4 - strh r3, [r0] - adds r1, r5 - strh r3, [r1] - subs r2, 0x2 - lsls r1, r2, 16 - cmp r1, 0 - bge _0815D546 -_0815D55A: - ldrh r0, [r6, 0x14] - adds r0, 0x1 - strh r0, [r6, 0x14] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3F - ble _0815D5C2 - movs r0, 0x40 - strh r0, [r6, 0x14] - ldrh r0, [r6, 0xC] - adds r0, 0x1 - strh r0, [r6, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815D594 - ldrh r0, [r6, 0xE] - subs r0, 0x1 - strh r0, [r6, 0xE] - b _0815D59A - .pool -_0815D594: - ldrh r0, [r6, 0x10] - adds r0, 0x1 - strh r0, [r6, 0x10] -_0815D59A: - ldrh r1, [r6, 0x10] - lsls r1, 8 - ldrh r0, [r6, 0xE] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r2, 0xE - ldrsh r1, [r6, r2] - cmp r1, 0 - bne _0815D63C - movs r3, 0x10 - ldrsh r0, [r6, r3] - cmp r0, 0x10 - bne _0815D63C - strh r1, [r6, 0xC] - strh r1, [r6, 0xE] - b _0815D62E -_0815D5C2: - ldrh r0, [r6, 0x18] - ldrh r7, [r6, 0x16] - adds r0, r7 - strh r0, [r6, 0x16] - b _0815D63C -_0815D5CC: - ldrh r0, [r6, 0xC] - adds r0, 0x1 - strh r0, [r6, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - ble _0815D63C - ldr r1, =0x02039b28 - movs r0, 0x3 - strb r0, [r1, 0x15] - movs r0, 0 - strh r0, [r6, 0xC] - b _0815D62E - .pool -_0815D5EC: - ldrh r0, [r6, 0xC] - adds r0, 0x1 - strh r0, [r6, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815D602 - ldrh r0, [r6, 0xE] - adds r0, 0x1 - strh r0, [r6, 0xE] - b _0815D608 -_0815D602: - ldrh r0, [r6, 0x10] - subs r0, 0x1 - strh r0, [r6, 0x10] -_0815D608: - ldrh r1, [r6, 0x10] - lsls r1, 8 - ldrh r0, [r6, 0xE] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xE - ldrsh r0, [r6, r1] - cmp r0, 0x10 - bne _0815D63C - movs r2, 0x10 - ldrsh r0, [r6, r2] - cmp r0, 0 - bne _0815D63C - strh r0, [r6, 0xC] - strh r0, [r6, 0xE] -_0815D62E: - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - b _0815D63C -_0815D636: - adds r0, r4, 0 - bl move_anim_task_del -_0815D63C: - 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_815D398 - - thumb_func_start sub_815D64C -sub_815D64C: @ 815D64C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - movs r0, 0 - strh r0, [r4, 0x8] - ldr r0, =0x0203841e - ldrb r0, [r0] - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - strh r1, [r4, 0x26] - ldr r2, =gUnknown_085CE5F0 - adds r0, r4, 0 - bl sub_80A7CFC - ldr r0, =sub_815D694 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D64C - - thumb_func_start sub_815D694 -sub_815D694: @ 815D694 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r2, =0x03005e00 - adds r3, r0, r2 - ldrh r0, [r3, 0x8] - adds r1, r0, 0x1 - movs r5, 0 - strh r1, [r3, 0x8] - subs r0, 0x14 - lsls r0, 16 - lsrs r0, 16 - adds r6, r2, 0 - cmp r0, 0x16 - bhi _0815D6F8 - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815D708 - strh r5, [r3, 0xA] - ldrh r0, [r3, 0xC] - adds r0, 0x1 - strh r0, [r3, 0xC] - movs r5, 0x1 - ands r0, r5 - cmp r0, 0 - bne _0815D6F8 - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000ffff - strh r1, [r0, 0x24] - b _0815D708 - .pool -_0815D6F8: - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r5, [r0, 0x24] -_0815D708: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r6 - bl sub_80A7D34 - lsls r0, 24 - cmp r0, 0 - bne _0815D720 - adds r0, r4, 0 - bl move_anim_task_del -_0815D720: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D694 - - thumb_func_start sub_815D72C -sub_815D72C: @ 815D72C - push {r4-r6,lr} - mov r6, r8 - push {r6} - mov r8, r0 - adds r5, r2, 0 - adds r0, r3, 0 - ldr r4, [sp, 0x14] - ldr r6, [sp, 0x18] - lsls r1, 16 - lsrs r1, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r4, 16 - lsrs r4, 16 - lsls r6, 16 - lsrs r6, 16 - mov r2, r8 - strh r1, [r2, 0x20] - strh r5, [r2, 0x22] - lsls r1, 16 - asrs r1, 16 - lsls r2, r1, 4 - mov r3, r8 - strh r2, [r3, 0x36] - lsls r5, 16 - asrs r5, 16 - lsls r2, r5, 4 - strh r2, [r3, 0x38] - lsls r0, 16 - asrs r0, 16 - subs r0, r1 - lsls r0, 4 - adds r1, r6, 0 - bl __divsi3 - mov r1, r8 - strh r0, [r1, 0x3A] - lsls r4, 16 - asrs r4, 16 - subs r4, r5 - lsls r4, 4 - adds r0, r4, 0 - adds r1, r6, 0 - bl __divsi3 - mov r2, r8 - strh r0, [r2, 0x3C] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_815D72C - - thumb_func_start sub_815D794 -sub_815D794: @ 815D794 - ldrh r1, [r0, 0x3A] - ldrh r2, [r0, 0x36] - adds r1, r2 - strh r1, [r0, 0x36] - ldrh r2, [r0, 0x3C] - ldrh r3, [r0, 0x38] - adds r2, r3 - strh r2, [r0, 0x38] - lsls r1, 16 - asrs r1, 20 - strh r1, [r0, 0x20] - lsls r2, 16 - asrs r2, 20 - strh r2, [r0, 0x22] - bx lr - thumb_func_end sub_815D794 - - thumb_func_start sub_815D7B4 -sub_815D7B4: @ 815D7B4 - push {r4-r6,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldrh r6, [r4, 0x20] - ldrh r5, [r4, 0x22] - bl sub_80A6838 - ldr r0, =0x0203841e - ldrb r1, [r0] - adds r0, r4, 0 - bl StartObjectRotScalAnim - movs r0, 0x20 - ldrsh r1, [r4, r0] - movs r0, 0x22 - ldrsh r2, [r4, r0] - lsls r6, 16 - asrs r6, 16 - lsls r5, 16 - asrs r5, 16 - str r5, [sp] - movs r0, 0x40 - str r0, [sp, 0x4] - adds r0, r4, 0 - adds r3, r6, 0 - bl sub_815D72C - movs r0, 0 - strh r0, [r4, 0x2E] - ldr r0, =sub_815D804 - str r0, [r4, 0x1C] - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D7B4 - - thumb_func_start sub_815D804 -sub_815D804: @ 815D804 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - movs r0, 0x2E - ldrsh r4, [r5, r0] - lsls r4, 3 - movs r0, 0xFF - ands r4, r0 - adds r0, r5, 0 - bl sub_815D794 - adds r0, r4, 0 - movs r1, 0x8 - bl sine - strh r0, [r5, 0x26] - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0x3A - ble _0815D86A - ldrh r0, [r5, 0x30] - adds r0, 0x1 - strh r0, [r5, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815D86A - movs r0, 0 - strh r0, [r5, 0x30] - ldrh r1, [r5, 0x32] - adds r1, 0x1 - strh r1, [r5, 0x32] - movs r0, 0x1 - ands r1, r0 - adds r3, r5, 0 - adds r3, 0x3E - lsls r1, 2 - ldrb r2, [r3] - subs r0, 0x6 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - movs r1, 0x32 - ldrsh r0, [r5, r1] - cmp r0, 0x3 - ble _0815D86A - adds r0, r5, 0 - bl move_anim_8074EE0 -_0815D86A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815D804 - - thumb_func_start sub_815D870 -sub_815D870: @ 815D870 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =0x0203841e - ldrh r0, [r6, 0x6] - strh r0, [r5, 0x2E] - ldrb r1, [r6] - adds r0, r5, 0 - bl StartObjectRotScalAnim - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0815D896 - ldrh r0, [r6, 0x2] - negs r0, r0 - strh r0, [r6, 0x2] -_0815D896: - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x2] - adds r0, r1 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r6, [r6, 0x4] - adds r0, r6 - strh r0, [r5, 0x22] - ldr r0, =sub_810E2C8 - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D870 - - thumb_func_start sub_815D8D8 -sub_815D8D8: @ 815D8D8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - movs r7, 0 - ldr r2, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r3, r0, r2 - ldrh r0, [r3, 0x8] - subs r0, 0x1 - strh r0, [r3, 0x8] - movs r1, 0x14 - ldrsh r0, [r3, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - mov r8, r2 - cmp r0, 0 - beq _0815D95A - ldrh r0, [r3, 0xA] - subs r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0815D95A - movs r2, 0x1A - ldrsh r0, [r3, r2] - cmp r0, 0 - bne _0815D92C - ldrh r0, [r3, 0x10] - strh r0, [r3, 0x1A] - negs r0, r0 - strh r0, [r3, 0x10] - b _0815D92E - .pool -_0815D92C: - strh r7, [r3, 0x1A] -_0815D92E: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - mov r2, r8 - adds r1, r0, r2 - movs r2, 0x1C - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _0815D94A - ldrh r0, [r1, 0x12] - strh r0, [r1, 0x1C] - negs r0, r0 - strh r0, [r1, 0x12] - b _0815D94E -_0815D94A: - movs r0, 0 - strh r0, [r1, 0x1C] -_0815D94E: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - add r0, r8 - ldrh r1, [r0, 0x22] - strh r1, [r0, 0xA] -_0815D95A: - lsls r2, r5, 2 - adds r0, r2, r5 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - ldrh r6, [r4, 0x16] - ldrh r7, [r4, 0x18] - movs r1, 0xC - ldrsh r0, [r4, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - mov r12, r2 - cmp r0, 0 - beq _0815D998 - ldr r3, =0x02020630 - movs r2, 0x26 - ldrsh r0, [r4, r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - lsrs r2, r6, 8 - ldrh r0, [r4, 0x1A] - subs r0, r2 - strh r0, [r1, 0x24] - adds r2, r3, 0 - b _0815D9AE - .pool -_0815D998: - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - lsrs r1, r6, 8 - ldrh r4, [r4, 0x1A] - adds r1, r4 - strh r1, [r0, 0x24] -_0815D9AE: - mov r1, r12 - adds r0, r1, r5 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - movs r1, 0xE - ldrsh r0, [r4, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0815D9E0 - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - lsrs r2, r7, 8 - ldrh r0, [r4, 0x1C] - subs r0, r2 - b _0815D9F2 - .pool -_0815D9E0: - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - lsrs r0, r7, 8 - ldrh r4, [r4, 0x1C] - adds r0, r4 -_0815D9F2: - strh r0, [r1, 0x26] - mov r2, r12 - adds r0, r2, r5 - lsls r0, 3 - add r0, r8 - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0 - bgt _0815DA12 - adds r0, r5, 0 - bl DestroyTask - ldr r1, =0x020383fe - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] -_0815DA12: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D8D8 - - thumb_func_start sub_815DA20 -sub_815DA20: @ 815DA20 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - movs r7, 0 - ldr r2, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r3, r0, r2 - ldrh r0, [r3, 0x8] - subs r0, 0x1 - strh r0, [r3, 0x8] - movs r1, 0x14 - ldrsh r0, [r3, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - mov r8, r2 - cmp r0, 0 - beq _0815DAA6 - ldrh r0, [r3, 0xA] - subs r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0815DAA6 - movs r2, 0x1A - ldrsh r0, [r3, r2] - cmp r0, 0 - bne _0815DA78 - ldrh r0, [r3, 0x10] - strh r0, [r3, 0x1A] - negs r0, r0 - strh r0, [r3, 0x10] - b _0815DA7A - .pool -_0815DA78: - strh r7, [r3, 0x1A] -_0815DA7A: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - mov r2, r8 - adds r1, r0, r2 - movs r2, 0x1C - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _0815DA96 - ldrh r0, [r1, 0x12] - strh r0, [r1, 0x1C] - negs r0, r0 - strh r0, [r1, 0x12] - b _0815DA9A -_0815DA96: - movs r0, 0 - strh r0, [r1, 0x1C] -_0815DA9A: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - add r0, r8 - ldrh r1, [r0, 0x22] - strh r1, [r0, 0xA] -_0815DAA6: - lsls r3, r6, 2 - adds r0, r3, r6 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - ldrh r2, [r4, 0xC] - ldr r1, =0x00007fff - adds r0, r1, 0 - ands r0, r2 - ldrh r2, [r4, 0x16] - adds r0, r2 - lsls r5, r0, 16 - lsrs r0, r5, 16 - mov r9, r0 - ldrh r0, [r4, 0xE] - ands r1, r0 - ldrh r2, [r4, 0x18] - adds r1, r2 - lsls r1, 16 - lsrs r7, r1, 16 - movs r1, 0xC - ldrsh r0, [r4, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - mov r12, r3 - cmp r0, 0 - beq _0815DB00 - ldr r3, =0x02020630 - movs r2, 0x26 - ldrsh r0, [r4, r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - lsrs r2, r5, 24 - ldrh r0, [r4, 0x1A] - subs r0, r2 - strh r0, [r1, 0x24] - adds r2, r3, 0 - b _0815DB16 - .pool -_0815DB00: - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - lsrs r1, r5, 24 - ldrh r4, [r4, 0x1A] - adds r1, r4 - strh r1, [r0, 0x24] -_0815DB16: - mov r1, r12 - adds r0, r1, r6 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - movs r1, 0xE - ldrsh r0, [r4, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0815DB48 - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - lsrs r2, r7, 8 - ldrh r0, [r4, 0x1C] - subs r0, r2 - b _0815DB5A - .pool -_0815DB48: - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - lsrs r0, r7, 8 - ldrh r4, [r4, 0x1C] - adds r0, r4 -_0815DB5A: - strh r0, [r1, 0x26] - mov r2, r12 - adds r0, r2, r6 - lsls r0, 3 - mov r1, r8 - adds r2, r0, r1 - mov r0, r9 - strh r0, [r2, 0x16] - strh r7, [r2, 0x18] - movs r1, 0x8 - ldrsh r0, [r2, r1] - cmp r0, 0 - bgt _0815DB80 - movs r0, 0x1E - strh r0, [r2, 0x8] - movs r0, 0 - strh r0, [r2, 0x22] - ldr r0, =sub_815D8D8 - str r0, [r2] -_0815DB80: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DA20 - - thumb_func_start sub_815DB90 -sub_815DB90: @ 815DB90 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x03005e00 - mov r8, r0 - lsls r7, r6, 2 - adds r0, r7, r6 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - ldr r1, =0x020241e4 - ldr r2, =0x02038436 - ldrb r0, [r2] - adds r0, r1 - ldrb r0, [r0] - strh r0, [r4, 0x26] - ldr r5, =0x0203841e - ldrh r0, [r5] - strh r0, [r4, 0x24] - ldrh r0, [r5] - strh r0, [r4, 0x8] - ldrh r0, [r5, 0xC] - strh r0, [r4, 0x22] - movs r3, 0x6 - ldrsh r0, [r5, r3] - cmp r0, 0 - beq _0815DBD4 - ldrh r0, [r4, 0x14] - ldr r3, =0xffff8000 - adds r1, r3, 0 - orrs r0, r1 - strh r0, [r4, 0x14] -_0815DBD4: - ldrb r0, [r2] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0815DC04 - ldrh r0, [r5, 0x2] - strh r0, [r4, 0xC] - ldrh r0, [r5, 0x4] - strh r0, [r4, 0xE] - mov r3, r8 - adds r4, r7, 0 - b _0815DC74 - .pool -_0815DC04: - movs r7, 0x2 - ldrsh r0, [r5, r7] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0815DC20 - ldrh r1, [r5, 0x2] - ldr r0, =0x00007fff - ands r0, r1 - b _0815DC28 - .pool -_0815DC20: - ldrh r0, [r5, 0x2] - ldr r2, =0xffff8000 - adds r1, r2, 0 - orrs r0, r1 -_0815DC28: - strh r0, [r4, 0xC] - ldr r0, =0x0203841e - movs r3, 0x4 - ldrsh r1, [r0, r3] - movs r2, 0x80 - lsls r2, 8 - ands r1, r2 - adds r5, r0, 0 - cmp r1, 0 - beq _0815DC60 - ldr r3, =0x03005e00 - lsls r4, r6, 2 - adds r1, r4, r6 - lsls r1, 3 - adds r1, r3 - ldrh r2, [r5, 0x4] - ldr r0, =0x00007fff - ands r0, r2 - b _0815DC72 - .pool -_0815DC60: - ldr r3, =0x03005e00 - lsls r4, r6, 2 - adds r1, r4, r6 - lsls r1, 3 - adds r1, r3 - ldrh r2, [r5, 0x4] - ldr r7, =0xffff8000 - adds r0, r7, 0 - orrs r0, r2 -_0815DC72: - strh r0, [r1, 0xE] -_0815DC74: - adds r0, r4, r6 - lsls r0, 3 - adds r0, r3 - movs r1, 0 - strh r1, [r0, 0x18] - strh r1, [r0, 0x16] - ldrh r1, [r5, 0x8] - strh r1, [r0, 0x10] - ldrh r1, [r5, 0xA] - strh r1, [r0, 0x12] - ldr r1, =sub_815DA20 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DB90 - - thumb_func_start sub_815DCA4 -sub_815DCA4: @ 815DCA4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r5, r0, r1 - ldr r4, =0x0203841e - movs r1, 0x2 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815DCC4 - adds r0, r2, 0 - bl move_anim_task_del -_0815DCC4: - movs r0, 0 - strh r0, [r5, 0x8] - strh r0, [r5, 0xA] - strh r0, [r5, 0xC] - ldrh r0, [r4, 0x2] - strh r0, [r5, 0xE] - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815DCE8 - ldr r0, =0x02038436 - b _0815DCEA - .pool -_0815DCE8: - ldr r0, =0x02038437 -_0815DCEA: - ldrb r4, [r0] - adds r0, r4, 0 - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x10] - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x12] - adds r0, r4, 0 - bl sub_80A82E4 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x14] - ldr r0, =0x0203841e - ldrb r0, [r0] - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - strh r1, [r5, 0x26] - ldr r2, =gUnknown_085CE74C - adds r0, r5, 0 - bl sub_80A7CFC - ldr r0, =sub_815DD48 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DCA4 - - thumb_func_start sub_815DD48 -sub_815DD48: @ 815DD48 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815DD6C - cmp r0, 0x1 - beq _0815DDCC - b _0815DDDA - .pool -_0815DD6C: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bne _0815DD82 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_815DDE0 -_0815DD82: - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x12 - bne _0815DD92 - adds r0, r5, 0 - movs r1, 0 - bl sub_815DDE0 -_0815DD92: - adds r0, r4, 0 - bl sub_80A7D34 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0815DDDA - ldrh r0, [r4, 0xE] - subs r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _0815DDB4 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815DDDA -_0815DDB4: - strh r1, [r4, 0xA] - ldrh r1, [r4, 0x26] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE74C - adds r0, r4, 0 - bl sub_80A7CFC - b _0815DDDA - .pool -_0815DDCC: - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815DDDA - adds r0, r5, 0 - bl move_anim_task_del -_0815DDDA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815DD48 - - thumb_func_start sub_815DDE0 -sub_815DDE0: @ 815DDE0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r2, =0x03005e00 - adds r4, r0, r2 - cmp r1, 0 - bne _0815DE08 - movs r1, 0x12 - movs r3, 0xEC - b _0815DE0C - .pool -_0815DE08: - movs r1, 0x1E - movs r3, 0x14 -_0815DE0C: - mov r2, sp - ldrh r0, [r4, 0x10] - subs r0, r1 - strh r0, [r2] - ldrh r0, [r4, 0x10] - subs r0, r1 - subs r0, 0x4 - strh r0, [r2, 0x2] - ldrh r0, [r4, 0x10] - adds r0, r1 - strh r0, [r2, 0x4] - ldrh r0, [r4, 0x10] - adds r0, r1 - adds r0, 0x4 - strh r0, [r2, 0x6] - add r2, sp, 0x8 - lsls r1, r3, 24 - asrs r1, 24 - ldrh r0, [r4, 0x12] - adds r0, r1 - strh r0, [r2] - ldrh r0, [r4, 0x12] - adds r0, r1 - adds r0, 0x6 - strh r0, [r2, 0x2] - movs r5, 0 - mov r8, r2 - ldr r7, =0x02020630 -_0815DE44: - lsls r0, r5, 1 - add r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0x1 - ands r0, r5 - lsls r0, 1 - add r0, r8 - movs r3, 0 - ldrsh r2, [r0, r3] - ldrb r3, [r4, 0x14] - subs r3, 0x5 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gUnknown_085CE76C - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _0815DE98 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r7 - movs r0, 0 - strh r0, [r1, 0x2E] - movs r0, 0x2 - cmp r5, 0x1 - bhi _0815DE86 - movs r2, 0x2 - negs r2, r2 - adds r0, r2, 0 -_0815DE86: - strh r0, [r1, 0x30] - ldr r0, =0x0000ffff - strh r0, [r1, 0x32] - strh r6, [r1, 0x34] - movs r0, 0x2 - strh r0, [r1, 0x36] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] -_0815DE98: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _0815DE44 - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DDE0 - - thumb_func_start sub_815DEBC -sub_815DEBC: @ 815DEBC - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x32] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - ble _0815DF02 - ldr r3, =0x03005e00 - movs r0, 0x36 - ldrsh r1, [r4, r0] - lsls r1, 1 - movs r0, 0x34 - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0815DF02: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DEBC - - thumb_func_start sub_815DF0C -sub_815DF0C: @ 815DF0C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - movs r0, 0 - strh r0, [r4, 0x8] - ldr r1, =0x0203841e - ldrh r0, [r1, 0x2] - strh r0, [r4, 0xA] - ldrb r0, [r1] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - adds r0, r1 - strh r0, [r4, 0xC] - ldr r0, =sub_815DF64 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DF0C - - thumb_func_start sub_815DF64 -sub_815DF64: @ 815DF64 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815DFB4 - ldrh r0, [r4, 0xC] - ldr r2, =gUnknown_085CE784 - movs r3, 0x8 - ldrsh r1, [r4, r3] - lsls r1, 1 - adds r1, r2 - ldrh r3, [r1] - movs r1, 0x10 - movs r2, 0x8 - bl pal_fade_1 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x17 - ble _0815DFA4 - movs r0, 0 - strh r0, [r4, 0x8] -_0815DFA4: - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - b _0815DFC6 - .pool -_0815DFB4: - ldrh r0, [r4, 0xC] - movs r1, 0x10 - movs r2, 0 - movs r3, 0 - bl pal_fade_1 - adds r0, r5, 0 - bl move_anim_task_del -_0815DFC6: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815DF64 - - thumb_func_start sub_815DFCC -sub_815DFCC: @ 815DFCC - push {lr} - sub sp, 0x1C - lsls r0, 24 - lsrs r0, 24 - movs r2, 0xD0 - lsls r2, 1 - ldr r1, =0x02038436 - ldrb r3, [r1] - ldr r1, =0x0203841e - ldrb r1, [r1] - str r1, [sp] - movs r1, 0xA - str r1, [sp, 0x4] - movs r1, 0x2 - str r1, [sp, 0x8] - movs r1, 0x1E - str r1, [sp, 0xC] - ldr r1, =gUnknown_08C2DC68 - str r1, [sp, 0x10] - ldr r1, =gUnknown_08C2DDC4 - str r1, [sp, 0x14] - ldr r1, =gUnknown_08C2DDA4 - str r1, [sp, 0x18] - movs r1, 0 - bl sub_8117854 - add sp, 0x1C - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DFCC - - thumb_func_start sub_815E01C -sub_815E01C: @ 815E01C - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =0x02038436 - ldrb r0, [r6] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815E038 - ldr r1, =0x0203841e - ldrh r0, [r1] - negs r0, r0 - strh r0, [r1] -_0815E038: - ldrb r0, [r6] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - ldr r4, =0x0203841e - lsrs r0, 24 - ldrh r1, [r4] - adds r0, r1 - strh r0, [r5, 0x20] - ldrb r0, [r6] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x2] - adds r0, r1 - strh r0, [r5, 0x22] - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815E080 - movs r0, 0xA0 - lsls r0, 2 - strh r0, [r5, 0x2E] - ldr r0, =0x0000fd80 - strh r0, [r5, 0x30] - b _0815E0A8 - .pool -_0815E080: - cmp r0, 0x1 - bne _0815E09A - adds r2, r5, 0 - adds r2, 0x3F - ldrb r0, [r2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] - movs r0, 0xA0 - lsls r0, 2 - strh r0, [r5, 0x2E] - strh r0, [r5, 0x30] - b _0815E0A8 -_0815E09A: - adds r0, r5, 0 - movs r1, 0x1 - bl StartObjectImageAnim - movs r0, 0xA0 - lsls r0, 2 - strh r0, [r5, 0x2E] -_0815E0A8: - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0815E0C8 - ldrh r0, [r5, 0x2E] - negs r0, r0 - strh r0, [r5, 0x2E] - adds r2, r5, 0 - adds r2, 0x3F - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] -_0815E0C8: - ldr r0, =sub_815E0DC - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E01C - - thumb_func_start sub_815E0DC -sub_815E0DC: @ 815E0DC - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - ldrh r1, [r2, 0x3A] - adds r0, r1 - strh r0, [r2, 0x3A] - ldrh r1, [r2, 0x30] - ldrh r3, [r2, 0x3C] - adds r1, r3 - strh r1, [r2, 0x3C] - lsls r0, 16 - asrs r0, 24 - strh r0, [r2, 0x24] - lsls r1, 16 - asrs r1, 24 - strh r1, [r2, 0x26] - ldrh r0, [r2, 0x38] - adds r0, 0x1 - strh r0, [r2, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xE - bne _0815E110 - adds r0, r2, 0 - bl move_anim_8072740 -_0815E110: - pop {r0} - bx r0 - thumb_func_end sub_815E0DC - - thumb_func_start sub_815E114 -sub_815E114: @ 815E114 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r6, r1, r0 - bl sub_80A4DF0 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _0815E144 - movs r0, 0x8 - strh r0, [r6, 0x12] - movs r0, 0x3 - strh r0, [r6, 0x14] - movs r0, 0x1 - strh r0, [r6, 0x16] - b _0815E14E - .pool -_0815E144: - movs r0, 0xC - strh r0, [r6, 0x12] - movs r0, 0x3 - strh r0, [r6, 0x14] - strh r1, [r6, 0x16] -_0815E14E: - ldr r5, =0x02038436 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0815E188 - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - adds r4, r0, 0 - ldrb r0, [r5] - movs r1, 0 - bl sub_80A861C - lsls r4, 24 - lsrs r4, 24 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0815E17C - adds r0, 0x3 -_0815E17C: - asrs r0, 2 - adds r0, r4, r0 - b _0815E1AC - .pool -_0815E188: - ldrb r0, [r5] - movs r1, 0x2 - bl sub_80A5C6C - adds r4, r0, 0 - ldrb r0, [r5] - movs r1, 0 - bl sub_80A861C - lsls r4, 24 - lsrs r4, 24 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0815E1A8 - adds r0, 0x3 -_0815E1A8: - asrs r0, 2 - subs r0, r4, r0 -_0815E1AC: - strh r0, [r6, 0x1E] - ldr r5, =0x02038436 - ldrb r0, [r5] - movs r1, 0x3 - bl sub_80A5C6C - adds r4, r0, 0 - ldrb r0, [r5] - movs r1, 0 - bl sub_80A861C - lsls r4, 24 - lsrs r4, 24 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0815E1D0 - adds r0, 0x3 -_0815E1D0: - asrs r0, 2 - subs r0, r4, r0 - strh r0, [r6, 0x20] - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x22] - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x24] - ldr r0, =sub_815E20C - str r0, [r6] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E114 - - thumb_func_start sub_815E20C -sub_815E20C: @ 815E20C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r5, r0, r1 - movs r0, 0x8 - ldrsh r1, [r5, r0] - cmp r1, 0 - beq _0815E238 - cmp r1, 0x1 - bne _0815E230 - b _0815E330 -_0815E230: - b _0815E33E - .pool -_0815E238: - ldrh r0, [r5, 0xA] - adds r0, 0x1 - strh r0, [r5, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _0815E33E - strh r1, [r5, 0xA] - movs r1, 0x1E - ldrsh r0, [r5, r1] - movs r2, 0x20 - ldrsh r1, [r5, r2] - movs r3, 0x22 - ldrsh r2, [r5, r3] - movs r4, 0x24 - ldrsh r3, [r5, r4] - ldrb r4, [r5, 0x12] - str r4, [sp] - ldrb r4, [r5, 0xC] - str r4, [sp, 0x4] - add r4, sp, 0x10 - str r4, [sp, 0x8] - adds r4, 0x2 - str r4, [sp, 0xC] - bl sub_815E34C - movs r6, 0 - mov r8, r4 - ldr r4, =0x02020630 -_0815E272: - add r0, sp, 0x10 - movs r2, 0 - ldrsh r1, [r0, r2] - mov r3, r8 - movs r0, 0 - ldrsh r2, [r3, r0] - ldr r0, =gUnknown_085CE7EC - movs r3, 0x23 - bl AddObjectToFront - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - beq _0815E306 - movs r1, 0x16 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815E2C6 - cmp r6, 0 - bne _0815E2B4 - lsls r2, r3, 4 - adds r1, r2, r3 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r5, 0x14] - negs r0, r0 - strh r0, [r1, 0x26] - strh r0, [r1, 0x24] - b _0815E2EE - .pool -_0815E2B4: - lsls r2, r3, 4 - adds r1, r2, r3 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r5, 0x14] - strh r0, [r1, 0x26] - ldrh r0, [r5, 0x14] - strh r0, [r1, 0x24] - b _0815E2EE -_0815E2C6: - cmp r6, 0 - bne _0815E2DC - lsls r2, r3, 4 - adds r1, r2, r3 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r5, 0x14] - negs r0, r0 - strh r0, [r1, 0x24] - ldrh r0, [r5, 0x14] - b _0815E2EC -_0815E2DC: - lsls r2, r3, 4 - adds r1, r2, r3 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r5, 0x14] - strh r0, [r1, 0x24] - ldrh r0, [r5, 0x14] - negs r0, r0 -_0815E2EC: - strh r0, [r1, 0x26] -_0815E2EE: - ldr r1, =0x02020630 - adds r0, r2, r3 - lsls r0, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x2E] - strh r7, [r0, 0x30] - movs r1, 0xA - strh r1, [r0, 0x32] - ldrh r0, [r5, 0x1C] - adds r0, 0x1 - strh r0, [r5, 0x1C] -_0815E306: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x1 - bls _0815E272 - ldrh r2, [r5, 0xC] - movs r3, 0xC - ldrsh r1, [r5, r3] - movs r4, 0x12 - ldrsh r0, [r5, r4] - cmp r1, r0 - bne _0815E324 - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] -_0815E324: - adds r0, r2, 0x1 - strh r0, [r5, 0xC] - b _0815E33E - .pool -_0815E330: - movs r1, 0x1C - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815E33E - adds r0, r7, 0 - bl move_anim_task_del -_0815E33E: - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815E20C - - thumb_func_start sub_815E34C -sub_815E34C: @ 815E34C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r4, [sp, 0x28] - ldr r5, [sp, 0x2C] - ldr r6, [sp, 0x30] - mov r9, r6 - ldr r6, [sp, 0x34] - mov r10, r6 - lsls r0, 16 - lsrs r0, 16 - mov r12, r0 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - lsls r2, 16 - lsrs r2, 16 - adds r7, r2, 0 - lsls r3, 16 - lsrs r3, 16 - str r3, [sp, 0x4] - lsls r4, 24 - lsrs r6, r4, 24 - lsls r5, 24 - lsrs r5, 24 - mov r8, r5 - cmp r5, 0 - bne _0815E394 - mov r2, r9 - strh r0, [r2] - mov r6, r10 - strh r1, [r6] - b _0815E3F2 -_0815E394: - cmp r5, r6 - bcc _0815E3A2 - mov r0, r9 - strh r2, [r0] - mov r1, r10 - strh r3, [r1] - b _0815E3F2 -_0815E3A2: - subs r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - mov r2, r12 - lsls r1, r2, 16 - asrs r1, 16 - lsls r5, r1, 8 - lsls r0, r7, 16 - asrs r0, 16 - subs r0, r1 - lsls r0, 8 - adds r1, r6, 0 - bl __divsi3 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r5, r0 - ldr r2, [sp] - lsls r1, r2, 16 - asrs r1, 16 - lsls r4, r1, 8 - ldr r2, [sp, 0x4] - lsls r0, r2, 16 - asrs r0, 16 - subs r0, r1 - lsls r0, 8 - adds r1, r6, 0 - bl __divsi3 - mov r6, r8 - muls r6, r0 - adds r0, r6, 0 - adds r4, r0 - asrs r5, 8 - mov r0, r9 - strh r5, [r0] - asrs r4, 8 - mov r1, r10 - strh r4, [r1] -_0815E3F2: - 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 sub_815E34C - - thumb_func_start sub_815E404 -sub_815E404: @ 815E404 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x24 - ble _0815E43A - ldr r3, =0x03005e00 - movs r0, 0x32 - ldrsh r1, [r4, r0] - lsls r1, 1 - movs r0, 0x30 - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0815E43A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E404 - - thumb_func_start sub_815E444 -sub_815E444: @ 815E444 - push {r4,lr} - adds r4, r0, 0 - ldr r1, =0x0203841e - ldrh r0, [r1] - strh r0, [r4, 0x20] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x22] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x32] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x36] - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x2E] - ldr r1, =move_anim_8072740 - adds r0, r4, 0 - bl oamt_set_x3A_32 - ldr r0, =sub_80A70C0 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E444 - - thumb_func_start sub_815E47C -sub_815E47C: @ 815E47C - 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 - lsls r0, 2 - add r0, r9 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r7, r0, r1 - ldr r0, =0x02038436 - mov r10, r0 - ldrb r0, [r0] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x1E] - mov r1, r10 - ldrb r0, [r1] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x20] - ldr r0, =0x02038437 - mov r8, r0 - ldrb r0, [r0] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x22] - mov r1, r8 - ldrb r0, [r1] - movs r1, 0x3 - bl sub_80A5C6C - adds r4, r0, 0 - mov r1, r8 - ldrb r0, [r1] - movs r1, 0 - bl sub_80A861C - lsls r4, 24 - lsrs r4, 24 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0815E4EE - adds r0, 0x3 -_0815E4EE: - asrs r0, 2 - adds r0, r4, r0 - strh r0, [r7, 0x24] - ldr r4, =gUnknown_085CE84C - movs r0, 0x1E - ldrsh r5, [r7, r0] - movs r1, 0x20 - ldrsh r6, [r7, r1] - mov r1, r8 - ldrb r0, [r1] - bl sub_80A82E4 - adds r3, r0, 0 - subs r3, 0x5 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x26] - cmp r0, 0x40 - beq _0815E5B8 - ldr r4, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x10 - strh r1, [r0, 0x2E] - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r7, 0x22] - strh r1, [r0, 0x32] - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r7, 0x24] - strh r1, [r0, 0x36] - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000ffe0 - strh r1, [r0, 0x38] - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl sub_80A68D4 - mov r1, r10 - ldrb r0, [r1] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815E596 - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartObjectRotScalAnim -_0815E596: - ldr r0, =sub_815E5CC - str r0, [r7] - b _0815E5BE - .pool -_0815E5B8: - mov r0, r9 - bl move_anim_task_del -_0815E5BE: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815E47C - - thumb_func_start sub_815E5CC -sub_815E5CC: @ 815E5CC - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _0815E634 - cmp r1, 0x1 - bgt _0815E5F4 - cmp r1, 0 - beq _0815E5FE - b _0815E6D2 - .pool -_0815E5F4: - cmp r1, 0x2 - beq _0815E658 - cmp r1, 0x3 - beq _0815E6CC - b _0815E6D2 -_0815E5FE: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815E6D2 - strh r1, [r4, 0xA] - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl sub_80A6900 - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _0815E6D2 - b _0815E6BE - .pool -_0815E634: - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _0815E6D2 - movs r0, 0 - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - b _0815E6BE - .pool -_0815E658: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815E6D2 - movs r0, 0 - strh r0, [r4, 0xA] - ldrh r2, [r4, 0xC] - adds r2, 0x1 - strh r2, [r4, 0xC] - ldr r5, =0x02020630 - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - movs r0, 0x1 - ands r2, r0 - adds r1, 0x3E - lsls r2, 2 - ldrb r3, [r1] - subs r0, 0x6 - ands r0, r3 - orrs r0, r2 - strb r0, [r1] - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0x10 - bne _0815E6D2 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles -_0815E6BE: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815E6D2 - .pool -_0815E6CC: - adds r0, r2, 0 - bl move_anim_task_del -_0815E6D2: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815E5CC - - thumb_func_start sub_815E6D8 -sub_815E6D8: @ 815E6D8 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r0, =0x0203841e - movs r2, 0 - ldrsh r1, [r0, r2] - adds r6, r0, 0 - cmp r1, 0 - bne _0815E6F4 - ldr r0, =0x02038436 - b _0815E6F6 - .pool -_0815E6F4: - ldr r0, =0x02038437 -_0815E6F6: - ldrb r5, [r0] - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x10 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - adds r1, r6, 0 - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x3A] - movs r2, 0x2 - ldrsh r0, [r1, r2] - movs r1, 0x1 - cmp r0, 0 - bne _0815E724 - movs r3, 0x1 - negs r3, r3 - adds r1, r3, 0 -_0815E724: - strh r1, [r4, 0x3C] - adds r0, r5, 0 - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - movs r1, 0x2 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815E768 - ldrb r2, [r4, 0x3] - lsls r1, r2, 26 - lsrs r1, 27 - movs r0, 0x8 - orrs r1, r0 - lsls r1, 1 - subs r0, 0x47 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x3] - adds r0, r5, 0 - movs r1, 0x4 - bl sub_80A861C - subs r0, 0x8 - b _0815E772 - .pool -_0815E768: - adds r0, r5, 0 - movs r1, 0x5 - bl sub_80A861C - adds r0, 0x8 -_0815E772: - strh r0, [r4, 0x20] - ldr r0, =sub_815E784 - str r0, [r4, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E6D8 - - thumb_func_start sub_815E784 -sub_815E784: @ 815E784 - push {lr} - adds r2, r0, 0 - movs r0, 0x2E - ldrsh r1, [r2, r0] - cmp r1, 0x1 - beq _0815E7CC - cmp r1, 0x1 - bgt _0815E79A - cmp r1, 0 - beq _0815E7A4 - b _0815E83C -_0815E79A: - cmp r1, 0x2 - beq _0815E7DC - cmp r1, 0x3 - beq _0815E802 - b _0815E83C -_0815E7A4: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815E83C - strh r1, [r2, 0x30] - ldrh r0, [r2, 0x3C] - ldrh r1, [r2, 0x24] - adds r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x32] - adds r0, 0x1 - strh r0, [r2, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - bne _0815E83C - b _0815E7FA -_0815E7CC: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - bne _0815E83C - b _0815E7F6 -_0815E7DC: - movs r0, 0x3C - ldrsh r1, [r2, r0] - lsls r1, 2 - ldrh r0, [r2, 0x24] - subs r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bne _0815E83C -_0815E7F6: - movs r0, 0 - strh r0, [r2, 0x30] -_0815E7FA: - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - b _0815E83C -_0815E802: - movs r0, 0x3C - ldrsh r1, [r2, r0] - lsls r0, r1, 1 - adds r0, r1 - ldrh r1, [r2, 0x24] - adds r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - bne _0815E83C - ldrh r0, [r2, 0x3A] - subs r0, 0x1 - strh r0, [r2, 0x3A] - lsls r0, 16 - cmp r0, 0 - beq _0815E836 - movs r0, 0 - strh r0, [r2, 0x30] - ldrh r0, [r2, 0x2E] - subs r0, 0x1 - strh r0, [r2, 0x2E] - b _0815E83C -_0815E836: - adds r0, r2, 0 - bl move_anim_8072740 -_0815E83C: - pop {r0} - bx r0 - thumb_func_end sub_815E784 - - thumb_func_start sub_815E840 -sub_815E840: @ 815E840 - push {r4,lr} - lsls r0, 24 - lsrs r1, r0, 24 - ldr r2, =0x0203841e - movs r3, 0 - ldrsh r0, [r2, r3] - cmp r0, 0 - bne _0815E85C - adds r0, r1, 0 - bl move_anim_task_del - b _0815E884 - .pool -_0815E85C: - ldr r0, =0x03005e00 - lsls r4, r1, 2 - adds r4, r1 - lsls r4, 3 - adds r4, r0 - ldrh r0, [r2, 0x2] - strh r0, [r4, 0x8] - ldrb r0, [r2] - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - strh r1, [r4, 0x26] - ldr r2, =gUnknown_085CE87C - adds r0, r4, 0 - bl sub_80A7CFC - ldr r0, =sub_815E898 - str r0, [r4] -_0815E884: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E840 - - thumb_func_start sub_815E898 -sub_815E898: @ 815E898 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815E8F2 - movs r0, 0 - strh r0, [r4, 0xA] - ldrh r1, [r4, 0xC] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0815E8E0 - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2 - b _0815E8F0 - .pool -_0815E8E0: - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000fffe -_0815E8F0: - strh r1, [r0, 0x24] -_0815E8F2: - adds r0, r4, 0 - bl sub_80A7D34 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0815E94E - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r5, [r0, 0x24] - ldrh r0, [r4, 0x8] - subs r0, 0x1 - strh r0, [r4, 0x8] - lsls r0, 16 - cmp r0, 0 - beq _0815E948 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r0, r1 - ldrh r1, [r0, 0x26] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE87C - bl sub_80A7CFC - strh r5, [r4, 0xA] - strh r5, [r4, 0xC] - b _0815E94E - .pool -_0815E948: - adds r0, r6, 0 - bl move_anim_task_del -_0815E94E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_815E898 - - thumb_func_start sub_815E954 -sub_815E954: @ 815E954 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815E970 - ldr r4, =0x02038436 - b _0815E972 - .pool -_0815E970: - ldr r4, =0x02038437 -_0815E972: - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A861C - strh r0, [r5, 0x22] - movs r1, 0x22 - ldrsh r0, [r5, r1] - cmp r0, 0x7 - bgt _0815E996 - movs r0, 0x8 - strh r0, [r5, 0x22] -_0815E996: - movs r2, 0 - strh r2, [r5, 0x2E] - ldr r1, =0x0203841e - ldrh r0, [r1, 0x2] - strh r0, [r5, 0x30] - strh r2, [r5, 0x32] - ldrh r0, [r1, 0x4] - strh r0, [r5, 0x34] - ldr r0, =sub_815E9BC - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E954 - - thumb_func_start sub_815E9BC -sub_815E9BC: @ 815E9BC - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x30 - ldrsh r1, [r3, r2] - cmp r0, r1 - blt _0815EA10 - movs r0, 0 - strh r0, [r3, 0x2E] - ldrh r1, [r3, 0x32] - adds r1, 0x1 - movs r0, 0x1 - ands r1, r0 - strh r1, [r3, 0x32] - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - lsls r1, 2 - ldrb r2, [r0] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - movs r2, 0x32 - ldrsh r0, [r3, r2] - cmp r0, 0 - beq _0815EA10 - ldrh r0, [r3, 0x34] - subs r0, 0x1 - strh r0, [r3, 0x34] - lsls r0, 16 - cmp r0, 0 - bne _0815EA10 - adds r0, r3, 0 - bl move_anim_8072740 -_0815EA10: - pop {r0} - bx r0 - thumb_func_end sub_815E9BC - - thumb_func_start sub_815EA14 -sub_815EA14: @ 815EA14 - push {lr} - adds r3, r0, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815EA44 - ldrb r2, [r3, 0x3] - lsls r1, r2, 26 - lsrs r1, 27 - movs r0, 0x8 - orrs r1, r0 - lsls r1, 1 - subs r0, 0x47 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x3] - movs r0, 0x64 - strh r0, [r3, 0x20] - movs r0, 0x1 - b _0815EA4A - .pool -_0815EA44: - movs r0, 0x8C - strh r0, [r3, 0x20] - ldr r0, =0x0000ffff -_0815EA4A: - strh r0, [r3, 0x3C] - movs r0, 0x38 - strh r0, [r3, 0x22] - ldr r0, =sub_815EA60 - str r0, [r3, 0x1C] - pop {r0} - bx r0 - .pool - thumb_func_end sub_815EA14 - - thumb_func_start sub_815EA60 -sub_815EA60: @ 815EA60 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x8 - bls _0815EA6E - b _0815EC40 -_0815EA6E: - lsls r0, 2 - ldr r1, =_0815EA7C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815EA7C: - .4byte _0815EAA0 - .4byte _0815EAD2 - .4byte _0815EAE4 - .4byte _0815EB24 - .4byte _0815EB36 - .4byte _0815EB74 - .4byte _0815EBD8 - .4byte _0815EBF8 - .4byte _0815EC1E -_0815EAA0: - movs r3, 0x3C - ldrsh r0, [r4, r3] - lsls r0, 1 - ldrh r1, [r4, 0x22] - subs r1, r0 - strh r1, [r4, 0x22] - ldrh r2, [r4, 0x30] - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - beq _0815EAC2 - movs r0, 0x3C - ldrsh r1, [r4, r0] - lsls r1, 1 - ldrh r0, [r4, 0x20] - subs r0, r1 - strh r0, [r4, 0x20] -_0815EAC2: - adds r0, r2, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - beq _0815EAD0 - b _0815EC40 -_0815EAD0: - b _0815EC12 -_0815EAD2: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - beq _0815EAE2 - b _0815EC40 -_0815EAE2: - b _0815EC12 -_0815EAE4: - ldrh r2, [r4, 0x30] - adds r2, 0x1 - strh r2, [r4, 0x30] - movs r3, 0x3C - ldrsh r1, [r4, r3] - lsls r0, r1, 1 - adds r0, r1 - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r3, =gUnknown_08329F40 - movs r0, 0x30 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 19 - ldrh r1, [r4, 0x3C] - muls r0, r1 - strh r0, [r4, 0x24] - lsls r2, 16 - asrs r2, 16 - cmp r2, 0xC - beq _0815EB1C - b _0815EC40 -_0815EB1C: - b _0815EC12 - .pool -_0815EB24: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - beq _0815EB34 - b _0815EC40 -_0815EB34: - b _0815EC12 -_0815EB36: - ldrh r2, [r4, 0x30] - adds r2, 0x1 - strh r2, [r4, 0x30] - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsls r1, r0, 1 - adds r1, r0 - ldrh r0, [r4, 0x22] - subs r0, r1 - strh r0, [r4, 0x22] - ldr r3, =gUnknown_08329F40 - movs r0, 0x30 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 19 - ldrh r1, [r4, 0x3C] - muls r0, r1 - strh r0, [r4, 0x24] - lsls r2, 16 - asrs r2, 16 - cmp r2, 0xC - bne _0815EC40 - b _0815EC16 - .pool -_0815EB74: - ldrh r2, [r4, 0x30] - adds r2, 0x1 - strh r2, [r4, 0x30] - movs r3, 0x3C - ldrsh r1, [r4, r3] - lsls r0, r1, 1 - adds r0, r1 - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r3, =gUnknown_08329F40 - movs r0, 0x30 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 19 - ldrh r1, [r4, 0x3C] - muls r0, r1 - strh r0, [r4, 0x24] - lsls r2, 16 - asrs r2, 16 - cmp r2, 0xF - bne _0815EBC0 - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x10 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] -_0815EBC0: - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0x12 - bne _0815EC40 - b _0815EC12 - .pool -_0815EBD8: - movs r3, 0x3C - ldrsh r0, [r4, r3] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 1 - ldrh r0, [r4, 0x20] - adds r1, r0 - strh r1, [r4, 0x20] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - bne _0815EC40 - b _0815EC12 -_0815EBF8: - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsls r0, 1 - ldrh r3, [r4, 0x20] - adds r0, r3 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _0815EC40 -_0815EC12: - movs r0, 0 - strh r0, [r4, 0x30] -_0815EC16: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815EC40 -_0815EC1E: - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsls r1, r0, 1 - adds r1, r0 - ldrh r0, [r4, 0x20] - subs r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _0815EC40 - adds r0, r4, 0 - bl move_anim_8072740 -_0815EC40: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815EA60 - - thumb_func_start sub_815EC48 -sub_815EC48: @ 815EC48 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r6, r1, r0 - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x26] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0815ECD0 - bl battle_type_is_double - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x1 - bne _0815ECB4 - ldr r5, =0x02038436 - ldrb r0, [r5] - movs r1, 0 - bl sub_80A5C6C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r1, [r5] - movs r0, 0x2 - eors r0, r1 - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - ble _0815ECAC - strh r7, [r6, 0x24] - b _0815ECD4 - .pool -_0815ECAC: - ldr r0, =0x0000ffff - b _0815ECD2 - .pool -_0815ECB4: - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0815ECD0 - ldr r0, =0x0000ffff - b _0815ECD2 - .pool -_0815ECD0: - movs r0, 0x1 -_0815ECD2: - strh r0, [r6, 0x24] -_0815ECD4: - ldr r0, =sub_815ECE4 - str r0, [r6] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815EC48 - - thumb_func_start sub_815ECE4 -sub_815ECE4: @ 815ECE4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r3, r0, r1 - movs r1, 0x8 - ldrsh r0, [r3, r1] - cmp r0, 0x8 - bls _0815ECFE - b _0815EE78 -_0815ECFE: - lsls r0, 2 - ldr r1, =_0815ED10 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815ED10: - .4byte _0815ED34 - .4byte _0815ED46 - .4byte _0815ED78 - .4byte _0815EDA8 - .4byte _0815EDCE - .4byte _0815EDF8 - .4byte _0815EE08 - .4byte _0815EE28 - .4byte _0815EE60 -_0815ED34: - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xD - beq _0815ED44 - b _0815EE78 -_0815ED44: - b _0815EE50 -_0815ED46: - ldr r2, =0x02020630 - movs r1, 0x26 - ldrsh r0, [r3, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r2, 0x24 - ldrsh r0, [r3, r2] - lsls r2, r0, 1 - adds r2, r0 - ldrh r0, [r1, 0x24] - subs r0, r2 - strh r0, [r1, 0x24] - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - beq _0815ED72 - b _0815EE78 -_0815ED72: - b _0815EE50 - .pool -_0815ED78: - ldr r2, =0x02020630 - movs r1, 0x26 - ldrsh r0, [r3, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x24 - ldrsh r2, [r3, r0] - lsls r0, r2, 1 - adds r0, r2 - ldrh r2, [r1, 0x24] - adds r0, r2 - strh r0, [r1, 0x24] - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bne _0815EE78 - b _0815EE50 - .pool -_0815EDA8: - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _0815EE78 - movs r0, 0 - strh r0, [r3, 0xA] - ldrh r1, [r3, 0xC] - movs r2, 0xC - ldrsh r0, [r3, r2] - cmp r0, 0 - bne _0815EE54 - adds r0, r1, 0x1 - strh r0, [r3, 0xC] - movs r0, 0x1 - strh r0, [r3, 0x8] - b _0815EE78 -_0815EDCE: - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r3, 0x24] - ldrh r2, [r0, 0x24] - adds r1, r2 - strh r1, [r0, 0x24] - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bne _0815EE78 - b _0815EE50 - .pool -_0815EDF8: - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bne _0815EE78 - b _0815EE50 -_0815EE08: - ldr r2, =0x02020630 - movs r1, 0x26 - ldrsh r0, [r3, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x24 - ldrsh r2, [r3, r0] - lsls r2, 2 - ldrh r0, [r1, 0x24] - subs r0, r2 - b _0815EE40 - .pool -_0815EE28: - ldr r2, =0x02020630 - movs r1, 0x26 - ldrsh r0, [r3, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r2, 0x24 - ldrsh r0, [r3, r2] - lsls r0, 2 - ldrh r2, [r1, 0x24] - adds r0, r2 -_0815EE40: - strh r0, [r1, 0x24] - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _0815EE78 -_0815EE50: - movs r0, 0 - strh r0, [r3, 0xA] -_0815EE54: - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] - b _0815EE78 - .pool -_0815EE60: - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strh r1, [r0, 0x24] - adds r0, r4, 0 - bl move_anim_task_del -_0815EE78: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815ECE4 - - thumb_func_start sub_815EE84 -sub_815EE84: @ 815EE84 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815EEA8 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80A69CC - ldr r0, =0x02038436 - b _0815EEAA - .pool -_0815EEA8: - ldr r0, =0x02038437 -_0815EEAA: - ldrb r0, [r0] - strh r0, [r4, 0x3C] - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815EECE - ldrb r0, [r4, 0x3] - movs r1, 0x3F - negs r1, r1 - ands r1, r0 - movs r0, 0x10 - orrs r1, r0 - strb r1, [r4, 0x3] -_0815EECE: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A8328 - movs r2, 0x3 - ands r2, r0 - lsls r2, 2 - ldrb r3, [r4, 0x5] - movs r1, 0xD - negs r1, r1 - adds r0, r1, 0 - ands r0, r3 - orrs r0, r2 - strb r0, [r4, 0x5] - ldrb r0, [r4, 0x1] - ands r1, r0 - movs r0, 0x4 - orrs r1, r0 - strb r1, [r4, 0x1] - ldr r0, =sub_815EF08 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815EE84 - - thumb_func_start sub_815EF08 -sub_815EF08: @ 815EF08 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x38 - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bls _0815EF16 - b _0815F106 -_0815EF16: - lsls r0, 2 - ldr r1, =_0815EF24 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815EF24: - .4byte _0815EF38 - .4byte _0815F038 - .4byte _0815F0A0 - .4byte _0815F0B4 - .4byte _0815F100 -_0815EF38: - movs r2, 0x3A - ldrsh r0, [r4, r2] - cmp r0, 0x5 - bhi _0815EF68 - lsls r0, 2 - ldr r1, =_0815EF50 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815EF50: - .4byte _0815EF6C - .4byte _0815EF88 - .4byte _0815EFAA - .4byte _0815EFC6 - .4byte _0815EF6C - .4byte _0815EFEC -_0815EF68: - movs r0, 0 - strh r0, [r4, 0x3A] -_0815EF6C: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x5 - bl sub_80A861C - subs r0, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - b _0815EFE0 -_0815EF88: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x5 - bl sub_80A861C - subs r0, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl sub_80A861C - adds r0, 0x4 - b _0815EFE6 -_0815EFAA: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x4 - bl sub_80A861C - adds r0, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - b _0815EFE0 -_0815EFC6: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x4 - bl sub_80A861C - adds r0, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 -_0815EFE0: - bl sub_80A861C - subs r0, 0x4 -_0815EFE6: - lsls r0, 16 - lsrs r1, r0, 16 - b _0815F00C -_0815EFEC: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r5, r0, 24 - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r1, r0, 24 -_0815F00C: - movs r2, 0x3A - ldrsh r0, [r4, r2] - cmp r0, 0x4 - bne _0815F018 - movs r0, 0x18 - b _0815F022 -_0815F018: - cmp r0, 0x5 - bne _0815F020 - movs r0, 0x6 - b _0815F022 -_0815F020: - movs r0, 0xC -_0815F022: - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x30] - strh r5, [r4, 0x32] - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x34] - strh r1, [r4, 0x36] - adds r0, r4, 0 - bl obj_translate_based_on_private_1_2_3_4 - b _0815F0F8 -_0815F038: - adds r0, r4, 0 - bl sub_80A6F3C - lsls r0, 24 - cmp r0, 0 - beq _0815F106 - movs r1, 0x3A - ldrsh r0, [r4, r1] - cmp r0, 0x4 - beq _0815F070 - cmp r0, 0x5 - beq _0815F090 - ldrh r0, [r4, 0x24] - ldrh r2, [r4, 0x20] - adds r0, r2 - movs r1, 0 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - strh r1, [r4, 0x26] - strh r1, [r4, 0x24] - strh r1, [r4, 0x2E] - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - b _0815F088 -_0815F070: - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - movs r1, 0 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - strh r1, [r4, 0x26] - strh r1, [r4, 0x24] - strh r1, [r4, 0x38] -_0815F088: - ldrh r0, [r4, 0x3A] - adds r0, 0x1 - strh r0, [r4, 0x3A] - b _0815F106 -_0815F090: - movs r0, 0 - strh r0, [r4, 0x2E] - movs r1, 0x10 - strh r1, [r4, 0x30] - strh r0, [r4, 0x32] - movs r0, 0x3 - strh r0, [r4, 0x38] - b _0815F106 -_0815F0A0: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0815F106 - movs r0, 0 - strh r0, [r4, 0x38] - b _0815F106 -_0815F0B4: - ldrh r1, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0815F0C6 - ldrh r0, [r4, 0x30] - subs r0, 0x1 - strh r0, [r4, 0x30] - b _0815F0CC -_0815F0C6: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] -_0815F0CC: - ldrh r1, [r4, 0x32] - lsls r1, 8 - ldrh r0, [r4, 0x30] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x20 - bne _0815F106 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_0815F0F8: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - b _0815F106 -_0815F100: - adds r0, r4, 0 - bl move_anim_8072740 -_0815F106: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815EF08 - - thumb_func_start sub_815F10C -sub_815F10C: @ 815F10C - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r2, 0x2E - ldrsh r1, [r4, r2] - subs r0, r1 - movs r2, 0x38 - ldrsh r1, [r4, r2] - muls r0, r1 - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl __divsi3 - adds r5, r0, 0 - strh r5, [r4, 0x24] - movs r1, 0x34 - ldrsh r0, [r4, r1] - movs r2, 0x30 - ldrsh r1, [r4, r2] - subs r0, r1 - movs r2, 0x38 - ldrsh r1, [r4, r2] - muls r0, r1 - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl __divsi3 - adds r3, r0, 0 - strh r3, [r4, 0x26] - ldrh r1, [r4, 0x38] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0815F16A - ldr r0, =gUnknown_085CE3A0 - ldrh r1, [r4, 0x20] - adds r1, r5 - lsls r1, 16 - asrs r1, 16 - ldrh r2, [r4, 0x22] - adds r2, r3 - lsls r2, 16 - asrs r2, 16 - movs r3, 0x5 - bl AddObjectToFront -_0815F16A: - movs r0, 0x38 - ldrsh r1, [r4, r0] - movs r2, 0x36 - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _0815F17C - adds r0, r4, 0 - bl move_anim_8072740 -_0815F17C: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F10C - - thumb_func_start sub_815F18C -sub_815F18C: @ 815F18C - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x02038437 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - ldrb r0, [r4] - movs r1, 0x3 - bl sub_80A5C6C - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _0815F1B8 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0815F1D0 -_0815F1B8: - ldr r2, =0x0203841e - ldrh r1, [r5, 0x20] - ldrh r0, [r2] - subs r0, r1, r0 - strh r0, [r5, 0x2E] - ldrh r0, [r2, 0x4] - subs r1, r0 - b _0815F1DE - .pool -_0815F1D0: - ldr r2, =0x0203841e - ldrh r1, [r5, 0x20] - ldrh r0, [r2] - adds r0, r1, r0 - strh r0, [r5, 0x2E] - ldrh r0, [r2, 0x4] - adds r1, r0 -_0815F1DE: - strh r1, [r5, 0x32] - adds r3, r2, 0 - ldrh r1, [r5, 0x22] - ldrh r2, [r3, 0x2] - adds r2, r1, r2 - strh r2, [r5, 0x30] - ldrh r0, [r3, 0x6] - adds r1, r0 - strh r1, [r5, 0x34] - ldrh r0, [r3, 0x8] - strh r0, [r5, 0x36] - ldrh r0, [r5, 0x2E] - strh r0, [r5, 0x20] - strh r2, [r5, 0x22] - ldr r0, =sub_815F10C - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F18C - - thumb_func_start sub_815F20C -sub_815F20C: @ 815F20C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r5, r0, 24 - adds r2, r5, 0 - ldr r0, =0x03005e00 - mov r9, r0 - lsls r7, r6, 2 - adds r0, r7, r6 - lsls r0, 3 - mov r8, r0 - mov r4, r8 - add r4, r9 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815F254 - adds r0, r5, 0 - movs r1, 0 - bl sub_80A7270 - movs r0, 0x80 - lsls r0, 1 - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - b _0815F2A0 - .pool -_0815F254: - cmp r0, 0x1 - bne _0815F2AC - ldrh r0, [r4, 0xA] - adds r0, 0x60 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xC] - subs r0, 0xD - strh r0, [r4, 0xC] - movs r2, 0xA - ldrsh r1, [r4, r2] - movs r0, 0xC - ldrsh r2, [r4, r0] - adds r0, r5, 0 - movs r3, 0 - bl obj_id_set_rotscale - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - bne _0815F310 - movs r0, 0 - strh r0, [r4, 0xE] - adds r0, r5, 0 - bl sub_80A7344 - ldr r1, =0x02020630 - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_0815F2A0: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815F310 - .pool -_0815F2AC: - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0 - bl refresh_graphics_maybe - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0815F2EE - ldr r3, =0x02020630 - ldr r2, =0x020241e4 - ldrb r0, [r4] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x10 - adds r0, r1 - ldr r1, =gUnknown_082FF6C0 - str r1, [r0] - 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 - bl StartObjectRotScalAnim -_0815F2EE: - mov r4, r9 - adds r3, r7, 0 - ldr r5, =sub_815F330 - movs r1, 0xF - mov r2, r8 - adds r0, r4, r2 - adds r0, 0x26 - movs r2, 0 -_0815F2FE: - strh r2, [r0] - subs r0, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _0815F2FE - adds r0, r3, r6 - lsls r0, 3 - adds r0, r4 - str r5, [r0] -_0815F310: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F20C - - thumb_func_start sub_815F330 -sub_815F330: @ 815F330 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r5, [r4, r0] - cmp r5, 0x1 - beq _0815F394 - cmp r5, 0x1 - bgt _0815F360 - cmp r5, 0 - beq _0815F36A - b _0815F482 - .pool -_0815F360: - cmp r5, 0x2 - beq _0815F400 - cmp r5, 0x3 - beq _0815F43C - b _0815F482 -_0815F36A: - ldr r0, =0x02020630 - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - adds r1, r0 - ldr r0, =0x0000ff38 - strh r0, [r1, 0x26] - movs r0, 0xC8 - strh r0, [r1, 0x24] - adds r1, 0x3E - ldrb r2, [r1] - subs r0, 0xCD - ands r0, r2 - strb r0, [r1] - strh r5, [r4, 0x1C] - b _0815F42E - .pool -_0815F394: - ldrh r1, [r4, 0x1C] - adds r1, 0x70 - movs r5, 0 - strh r1, [r4, 0x1C] - ldr r2, =0x02020630 - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - adds r2, r0, r2 - lsls r1, 16 - asrs r1, 24 - ldrh r3, [r2, 0x26] - adds r1, r3 - strh r1, [r2, 0x26] - movs r1, 0x22 - ldrsh r0, [r2, r1] - movs r3, 0x26 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - blt _0815F3C4 - strh r5, [r2, 0x24] -_0815F3C4: - movs r1, 0x26 - ldrsh r0, [r2, r1] - cmp r0, 0 - ble _0815F3CE - strh r5, [r2, 0x26] -_0815F3CE: - movs r3, 0x26 - ldrsh r0, [r2, r3] - cmp r0, 0 - bne _0815F482 - movs r0, 0x40 - negs r0, r0 - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0x7D - bl audio_play_and_stuff - ldr r1, =0xfffff800 - adds r0, r1, 0 - ldrh r2, [r4, 0x1C] - adds r0, r2 - strh r0, [r4, 0x1C] - b _0815F42E - .pool -_0815F400: - ldrh r0, [r4, 0x1C] - subs r0, 0x70 - strh r0, [r4, 0x1C] - lsls r0, 16 - cmp r0, 0 - bge _0815F410 - movs r0, 0 - strh r0, [r4, 0x1C] -_0815F410: - ldr r0, =0x02020630 - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - adds r1, r0 - ldrh r2, [r4, 0x1C] - lsls r2, 16 - asrs r2, 24 - ldrh r0, [r1, 0x26] - subs r0, r2 - strh r0, [r1, 0x26] - movs r3, 0x1C - ldrsh r0, [r4, r3] - cmp r0, 0 - bne _0815F482 -_0815F42E: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815F482 - .pool -_0815F43C: - ldrh r0, [r4, 0x1C] - adds r0, 0x70 - strh r0, [r4, 0x1C] - ldr r2, =0x02020630 - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - adds r1, r2 - lsls r0, 16 - asrs r0, 24 - ldrh r2, [r1, 0x26] - adds r0, r2 - strh r0, [r1, 0x26] - lsls r0, 16 - cmp r0, 0 - ble _0815F460 - movs r0, 0 - strh r0, [r1, 0x26] -_0815F460: - movs r3, 0x26 - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _0815F482 - movs r0, 0x40 - negs r0, r0 - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0x7D - bl audio_play_and_stuff - adds r0, r6, 0 - bl move_anim_task_del -_0815F482: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F330 - - thumb_func_start sub_815F48C -sub_815F48C: @ 815F48C - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x02038437 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0815F4B8 - ldrb r0, [r4] - bl sub_80A82E4 - subs r0, 0x2 - adds r1, r5, 0 - adds r1, 0x43 - strb r0, [r1] - ldr r4, =0x0000ff70 - b _0815F4C8 - .pool -_0815F4B8: - ldrb r0, [r4] - bl sub_80A82E4 - adds r0, 0x2 - adds r1, r5, 0 - adds r1, 0x43 - strb r0, [r1] - ldr r4, =0x0000ffa0 -_0815F4C8: - ldr r0, =0x02038437 - ldrb r0, [r0] - movs r1, 0x3 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - strh r4, [r5, 0x26] - ldr r0, =sub_815F4F0 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F48C - - thumb_func_start sub_815F4F0 -sub_815F4F0: @ 815F4F0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bls _0815F4FE - b _0815F61A -_0815F4FE: - lsls r0, 2 - ldr r1, =_0815F50C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815F50C: - .4byte _0815F520 - .4byte _0815F544 - .4byte _0815F584 - .4byte _0815F5B4 - .4byte _0815F5E0 -_0815F520: - ldrh r0, [r4, 0x26] - adds r0, 0xA - strh r0, [r4, 0x26] - lsls r0, 16 - cmp r0, 0 - blt _0815F61A - movs r0, 0x3F - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xCD - bl audio_play_and_stuff - movs r0, 0 - strh r0, [r4, 0x26] - b _0815F5D8 -_0815F544: - ldrh r1, [r4, 0x30] - adds r1, 0x4 - movs r5, 0 - strh r1, [r4, 0x30] - ldr r2, =gUnknown_08329F40 - movs r3, 0x30 - ldrsh r0, [r4, r3] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 19 - negs r0, r0 - strh r0, [r4, 0x26] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x7F - ble _0815F61A - movs r0, 0x3F - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xCD - bl audio_play_and_stuff - strh r5, [r4, 0x30] - strh r5, [r4, 0x26] - b _0815F5D8 - .pool -_0815F584: - ldrh r1, [r4, 0x30] - adds r1, 0x6 - movs r3, 0 - strh r1, [r4, 0x30] - ldr r2, =gUnknown_08329F40 - movs r5, 0x30 - ldrsh r0, [r4, r5] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 20 - negs r0, r0 - strh r0, [r4, 0x26] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x7F - ble _0815F61A - strh r3, [r4, 0x30] - strh r3, [r4, 0x26] - b _0815F5D8 - .pool -_0815F5B4: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _0815F61A - movs r0, 0x3F - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xC0 - bl audio_play_and_stuff - movs r0, 0 - strh r0, [r4, 0x30] -_0815F5D8: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815F61A -_0815F5E0: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _0815F61A - movs r0, 0 - strh r0, [r4, 0x30] - ldrh r1, [r4, 0x32] - adds r1, 0x1 - strh r1, [r4, 0x32] - movs r0, 0x1 - ands r1, r0 - adds r3, r4, 0 - adds r3, 0x3E - lsls r1, 2 - ldrb r2, [r3] - subs r0, 0x6 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x7 - bne _0815F61A - adds r0, r4, 0 - bl move_anim_8072740 -_0815F61A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815F4F0 - - thumb_func_start sub_815F620 -sub_815F620: @ 815F620 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - bl sub_80A4DF0 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0 - bne _0815F66E - movs r0, 0x1 - bl duplicate_obj_of_side_rel2move_in_transparent_mode - lsls r0, 16 - lsrs r1, r0, 16 - mov r10, r1 - asrs r6, r0, 16 - cmp r6, 0 - blt _0815F66E - movs r0, 0x1 - bl duplicate_obj_of_side_rel2move_in_transparent_mode - lsls r0, 16 - lsrs r1, r0, 16 - mov r9, r1 - asrs r1, r0, 16 - cmp r1, 0 - bge _0815F67C - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl obj_delete_but_dont_free_vram -_0815F66E: - mov r0, r8 - bl move_anim_task_del - b _0815F780 - .pool -_0815F67C: - ldr r4, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r5, r0, r4 - ldrh r0, [r5, 0x24] - adds r0, 0x18 - strh r0, [r5, 0x24] - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r6, r0, r4 - ldrh r0, [r6, 0x24] - subs r0, 0x18 - strh r0, [r6, 0x24] - strh r7, [r5, 0x2E] - strh r7, [r6, 0x2E] - strh r7, [r5, 0x30] - strh r7, [r6, 0x30] - strh r7, [r5, 0x32] - strh r7, [r6, 0x32] - movs r0, 0x10 - strh r0, [r5, 0x34] - ldr r0, =0x0000fff0 - strh r0, [r6, 0x34] - strh r7, [r5, 0x36] - movs r0, 0x80 - strh r0, [r6, 0x36] - movs r0, 0x18 - strh r0, [r5, 0x38] - strh r0, [r6, 0x38] - mov r0, r8 - strh r0, [r5, 0x3A] - strh r0, [r6, 0x3A] - strh r7, [r5, 0x3C] - strh r7, [r6, 0x3C] - ldr r2, =0x03005e00 - mov r1, r8 - lsls r3, r1, 2 - adds r0, r3, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x2 - strh r1, [r0, 0x8] - ldr r0, =0x020244d0 - ldr r1, [r0] - ldr r0, =0x02038437 - ldrb r0, [r0] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - adds r7, r4, 0 - mov r12, r3 - cmp r0, 0 - bne _0815F720 - adds r2, r5, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r2, r6, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - b _0815F736 - .pool -_0815F720: - adds r1, r5, 0 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - adds r1, r6, 0 - adds r1, 0x3E - ldrb r0, [r1] - orrs r0, r2 - strb r0, [r1] -_0815F736: - mov r1, r9 - lsls r0, r1, 16 - asrs r0, 16 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r4, r2, r7 - ldrb r1, [r4, 0x1] - movs r3, 0xD - negs r3, r3 - adds r0, r3, 0 - ands r0, r1 - strb r0, [r4, 0x1] - mov r1, r10 - lsls r0, r1, 16 - asrs r0, 16 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r4, r1, r7 - ldrb r0, [r4, 0x1] - ands r3, r0 - strb r3, [r4, 0x1] - adds r3, r7, 0 - adds r3, 0x1C - adds r2, r3 - ldr r0, =sub_815F7C4 - str r0, [r2] - adds r1, r3 - str r0, [r1] - mov r0, r12 - add r0, r8 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r0, r1 - ldr r1, =sub_815F79C - str r1, [r0] -_0815F780: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F620 - - thumb_func_start sub_815F79C -sub_815F79C: @ 815F79C - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815F7BA - adds r0, r2, 0 - bl move_anim_task_del -_0815F7BA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F79C - - thumb_func_start sub_815F7C4 -sub_815F7C4: @ 815F7C4 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815F80E - movs r0, 0 - strh r0, [r4, 0x30] - ldr r0, =0x020244d0 - ldr r1, [r0] - ldr r0, =0x02038437 - ldrb r0, [r0] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0815F80E - adds r3, r4, 0 - adds r3, 0x3E - ldrb r2, [r3] - lsls r1, r2, 29 - lsrs r1, 31 - movs r0, 0x1 - eors r1, r0 - ands r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_0815F80E: - ldrh r0, [r4, 0x34] - ldrh r1, [r4, 0x36] - adds r0, r1 - movs r5, 0 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x36] - movs r2, 0x36 - ldrsh r0, [r4, r2] - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl cosine - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815F840 - cmp r0, 0x1 - beq _0815F858 - b _0815F896 - .pool -_0815F840: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3C - bne _0815F896 - strh r5, [r4, 0x32] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815F896 -_0815F858: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - cmp r0, 0 - ble _0815F896 - strh r5, [r4, 0x32] - ldrh r0, [r4, 0x38] - subs r0, 0x2 - strh r0, [r4, 0x38] - lsls r0, 16 - cmp r0, 0 - bge _0815F896 - ldr r3, =0x03005e00 - movs r2, 0x3C - ldrsh r1, [r4, r2] - lsls r1, 1 - movs r0, 0x3A - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r4, 0 - bl obj_delete_but_dont_free_vram -_0815F896: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F7C4 - - thumb_func_start sub_815F8A0 -sub_815F8A0: @ 815F8A0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r3, =0x0203841e - movs r2, 0 - strh r2, [r3, 0xE] - ldr r1, =0x0203841a - ldrb r0, [r1] - ldrb r1, [r1] - adds r0, r1, 0 - subs r0, 0x3D - lsls r0, 24 - lsrs r0, 24 - adds r2, r1, 0 - cmp r0, 0x1E - bhi _0815F8C4 - movs r0, 0x1 - strh r0, [r3, 0xE] -_0815F8C4: - adds r0, r2, 0 - subs r0, 0x5C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6C - bhi _0815F8D4 - movs r0, 0x2 - strh r0, [r3, 0xE] -_0815F8D4: - lsls r0, r1, 24 - lsrs r0, 24 - cmp r0, 0xC8 - bls _0815F8E0 - movs r0, 0x3 - strh r0, [r3, 0xE] -_0815F8E0: - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F8A0 - - thumb_func_start sub_815F8F4 -sub_815F8F4: @ 815F8F4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =0x03005e00 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0x4 - bls _0815F91A - b _0815FE68 -_0815F91A: - lsls r0, 2 - ldr r1, =_0815F92C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815F92C: - .4byte _0815F940 - .4byte _0815F9F4 - .4byte _0815FBE8 - .4byte _0815FD08 - .4byte _0815FD8C -_0815F940: - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x03005e00 - mov r2, r8 - lsls r4, r2, 2 - adds r0, r4, r2 - lsls r0, 3 - adds r6, r0, r1 - movs r3, 0x80 - lsls r3, 4 - adds r0, r3, 0 - ldrh r1, [r6, 0xA] - adds r0, r1 - strh r0, [r6, 0xA] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - mov r9, r4 - cmp r0, 0 - bne _0815F998 - ldr r2, =0x02020630 - lsls r3, r7, 4 - adds r1, r3, r7 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r6, 0xA] - lsls r0, 16 - asrs r0, 24 - ldrh r4, [r1, 0x24] - adds r0, r4 - strh r0, [r1, 0x24] - b _0815F9B2 - .pool -_0815F998: - ldr r3, =0x02020630 - lsls r4, r7, 4 - adds r2, r4, r7 - lsls r2, 2 - adds r2, r3 - ldrh r1, [r6, 0xA] - lsls r1, 16 - asrs r1, 24 - ldrh r0, [r2, 0x24] - subs r0, r1 - strh r0, [r2, 0x24] - adds r2, r3, 0 - adds r3, r4, 0 -_0815F9B2: - ldr r1, =0x03005e00 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r4, r0, r1 - ldrb r0, [r4, 0xA] - strh r0, [r4, 0xA] - adds r1, r3, r7 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x24] - ldrh r1, [r1, 0x20] - adds r0, r1 - lsls r0, 16 - movs r1, 0x80 - lsls r1, 14 - adds r0, r1 - movs r1, 0x98 - lsls r1, 17 - cmp r0, r1 - bhi _0815F9DE - b _0815FE68 -_0815F9DE: - movs r0, 0 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815FE68 - .pool -_0815F9F4: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _0815FA28 - ldr r0, =0x02039f34 - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldr r2, [r0, 0x8] - mov r10, r2 - ldr r3, [r0, 0xC] - mov r9, r3 - ldrh r6, [r0] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl sub_80A82E4 - lsls r0, 24 - lsrs r4, r0, 24 - movs r7, 0 - b _0815FB4E - .pool -_0815FA28: - ldr r4, =0x02038436 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0815FAC8 - ldr r7, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - movs r1, 0 - bl pokemon_getattr - mov r10, r0 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - muls r0, r6 - adds r0, r5 - movs r1, 0x1 - bl pokemon_getattr - mov r9, r0 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldrb r2, [r4] - ldr r1, [r0] - lsls r0, r2, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _0815FA9C - lsls r0, r2, 1 - adds r0, r7 - ldrh r0, [r0] - muls r0, r6 - adds r0, r5 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r6, r0, 16 - b _0815FA9E - .pool -_0815FA9C: - ldrh r6, [r1, 0x2] -_0815FA9E: - movs r0, 0x1 - bl obj_id_for_side_relative_to_move - ldr r2, =0x02020630 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x43 - ldrb r0, [r1] - adds r0, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - movs r7, 0 - movs r5, 0x88 - lsls r5, 1 - b _0815FB50 - .pool -_0815FAC8: - ldr r7, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x02024744 - adds r0, r5 - movs r1, 0 - bl pokemon_getattr - mov r10, r0 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - muls r0, r6 - adds r0, r5 - movs r1, 0x1 - bl pokemon_getattr - mov r9, r0 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldrb r2, [r4] - ldr r1, [r0] - lsls r0, r2, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _0815FB2C - lsls r0, r2, 1 - adds r0, r7 - ldrh r0, [r0] - muls r0, r6 - adds r0, r5 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r6, r0, 16 - b _0815FB2E - .pool -_0815FB2C: - ldrh r6, [r1, 0x2] -_0815FB2E: - movs r0, 0x1 - bl obj_id_for_side_relative_to_move - ldr r2, =0x02020630 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x43 - ldrb r0, [r1] - subs r0, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - movs r7, 0x1 -_0815FB4E: - ldr r5, =0x0000ffe0 -_0815FB50: - ldr r0, =0x02038437 - ldrb r0, [r0] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - lsls r3, r5, 16 - asrs r3, 16 - str r0, [sp] - str r4, [sp, 0x4] - mov r4, r10 - str r4, [sp, 0x8] - mov r0, r9 - str r0, [sp, 0xC] - ldr r4, =0x02038436 - ldrb r0, [r4] - str r0, [sp, 0x10] - movs r0, 0 - str r0, [sp, 0x14] - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0 - bl sub_80A8394 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x020244d0 - ldr r1, [r0] - ldrb r0, [r4] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x2] - cmp r0, 0 - beq _0815FBBA - ldr r1, =0x02020630 - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - orrs r0, r1 - ldr r3, =0x00007fff - movs r1, 0x10 - movs r2, 0x6 - bl pal_fade_1 -_0815FBBA: - ldr r0, =0x03005e00 - mov r3, r8 - lsls r1, r3, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - strh r5, [r1, 0x26] - b _0815FD7E - .pool -_0815FBE8: - ldr r1, =0x03005e00 - mov r0, r8 - lsls r4, r0, 2 - adds r0, r4, r0 - lsls r0, 3 - adds r6, r0, r1 - ldrh r0, [r6, 0x26] - lsls r0, 24 - lsrs r5, r0, 24 - movs r1, 0x80 - lsls r1, 4 - adds r0, r1, 0 - ldrh r2, [r6, 0xA] - adds r0, r2 - strh r0, [r6, 0xA] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - mov r9, r4 - cmp r0, 0 - bne _0815FC40 - ldr r3, =0x02020630 - lsls r4, r5, 4 - adds r2, r4, r5 - lsls r2, 2 - adds r2, r3 - ldrh r1, [r6, 0xA] - lsls r1, 16 - asrs r1, 24 - ldrh r0, [r2, 0x24] - subs r0, r1 - strh r0, [r2, 0x24] - adds r2, r3, 0 - adds r3, r4, 0 - b _0815FC56 - .pool -_0815FC40: - ldr r2, =0x02020630 - lsls r3, r5, 4 - adds r1, r3, r5 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r6, 0xA] - lsls r0, 16 - asrs r0, 24 - ldrh r4, [r1, 0x24] - adds r0, r4 - strh r0, [r1, 0x24] -_0815FC56: - ldr r1, =0x03005e00 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r6, r0, r1 - ldrb r0, [r6, 0xA] - strh r0, [r6, 0xA] - adds r1, r3, r5 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x24] - ldrh r1, [r1, 0x20] - adds r0, r1 - lsls r0, 16 - lsrs r5, r0, 16 - movs r1, 0x24 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815FCD6 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0815FCB4 - lsls r4, r5, 16 - asrs r4, 16 - ldr r0, =0x02038437 - ldrb r0, [r0] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bge _0815FCD6 - b _0815FCCA - .pool -_0815FCB4: - lsls r4, r5, 16 - asrs r4, 16 - ldr r0, =0x02038437 - ldrb r0, [r0] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - ble _0815FCD6 -_0815FCCA: - ldrh r0, [r6, 0x24] - adds r0, 0x1 - strh r0, [r6, 0x24] - ldr r1, =0x0203841e - ldr r0, =0x0000ffff - strh r0, [r1, 0xE] -_0815FCD6: - lsls r0, r5, 16 - movs r2, 0x80 - lsls r2, 14 - adds r0, r2 - movs r1, 0x98 - lsls r1, 17 - cmp r0, r1 - bhi _0815FCE8 - b _0815FE68 -_0815FCE8: - ldr r0, =0x03005e00 - mov r1, r9 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0 - strh r0, [r1, 0xA] - b _0815FD7E - .pool -_0815FD08: - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x03005e00 - mov r3, r8 - lsls r4, r3, 2 - adds r0, r4, r3 - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x26] - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - ldr r5, =0x02020630 - adds r0, r5 - bl sub_80A8610 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - mov r9, r4 - cmp r0, 0 - bne _0815FD60 - lsls r1, r7, 4 - adds r1, r7 - lsls r1, 2 - adds r1, r5 - ldrh r0, [r1, 0x20] - negs r0, r0 - subs r0, 0x20 - strh r0, [r1, 0x24] - b _0815FD74 - .pool -_0815FD60: - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r0, r5 - ldrh r2, [r0, 0x20] - movs r4, 0x88 - lsls r4, 1 - adds r1, r4, 0 - subs r1, r2 - strh r1, [r0, 0x24] -_0815FD74: - ldr r0, =0x03005e00 - mov r1, r9 - add r1, r8 - lsls r1, 3 - adds r1, r0 -_0815FD7E: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0815FE68 - .pool -_0815FD8C: - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x03005e00 - mov r0, r8 - lsls r4, r0, 2 - adds r0, r4, r0 - lsls r0, 3 - adds r2, r0, r1 - movs r1, 0x80 - lsls r1, 4 - adds r0, r1, 0 - ldrh r3, [r2, 0xA] - adds r0, r3 - strh r0, [r2, 0xA] - ldr r0, =0x02038436 - mov r10, r0 - ldrb r0, [r0] - str r2, [sp, 0x18] - bl battle_side_get_owner - lsls r0, 24 - mov r9, r4 - ldr r2, [sp, 0x18] - cmp r0, 0 - bne _0815FE0C - ldr r1, =0x02020630 - lsls r5, r7, 4 - adds r0, r5, r7 - lsls r0, 2 - adds r6, r0, r1 - ldrh r0, [r2, 0xA] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r6, 0x24] - adds r0, r1 - strh r0, [r6, 0x24] - movs r2, 0x24 - ldrsh r4, [r6, r2] - movs r3, 0x20 - ldrsh r0, [r6, r3] - adds r4, r0 - mov r1, r10 - ldrb r0, [r1] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r3, r5, 0 - cmp r4, r0 - blt _0815FE44 - movs r2, 0 - strh r2, [r6, 0x24] - b _0815FE44 - .pool -_0815FE0C: - ldr r1, =0x02020630 - lsls r5, r7, 4 - adds r0, r5, r7 - lsls r0, 2 - adds r6, r0, r1 - ldrh r1, [r2, 0xA] - lsls r1, 16 - asrs r1, 24 - ldrh r0, [r6, 0x24] - subs r0, r1 - strh r0, [r6, 0x24] - movs r3, 0x24 - ldrsh r4, [r6, r3] - movs r1, 0x20 - ldrsh r0, [r6, r1] - adds r4, r0 - mov r2, r10 - ldrb r0, [r2] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r3, r5, 0 - cmp r4, r0 - bgt _0815FE44 - movs r4, 0 - strh r4, [r6, 0x24] -_0815FE44: - ldr r1, =0x03005e00 - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0xA] - strh r1, [r0, 0xA] - ldr r1, =0x02020630 - adds r0, r3, r7 - lsls r0, 2 - adds r0, r1 - movs r1, 0x24 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815FE68 - mov r0, r8 - bl move_anim_task_del -_0815FE68: - 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_815F8F4 - - thumb_func_start sub_815FE80 -sub_815FE80: @ 815FE80 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815FE92 - cmp r0, 0x1 - beq _0815FF3A - b _0815FFBC -_0815FE92: - ldr r0, =0x0203841e - movs r2, 0xE - ldrsh r1, [r0, r2] - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _0815FF2C - movs r0, 0x3F - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0x7A - bl audio_play_and_stuff - ldr r0, =0x02038437 - ldrb r0, [r0] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x10 - strh r0, [r4, 0x22] - ldr r0, =0x0000ffe0 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815FFBC - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0815FFBC - movs r0, 0x1 - bl obj_id_for_side_relative_to_move - ldr r2, =0x02020630 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x43 - ldrb r0, [r1] - subs r0, 0x1 - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - b _0815FFBC - .pool -_0815FF2C: - adds r0, r4, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - b _0815FFBC -_0815FF3A: - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r2, 0x2E - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x26] - ldrh r2, [r4, 0x30] - adds r0, r2, 0x5 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7F - ble _0815FF6E - movs r1, 0x2E - ldrsh r0, [r4, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - adds r0, r2, 0 - subs r0, 0x7A - strh r0, [r4, 0x30] -_0815FF6E: - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 - ldrh r1, [r4, 0x32] - adds r0, r1 - strh r0, [r4, 0x32] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0815FF9C - ldrh r2, [r4, 0x32] - lsls r1, r2, 16 - asrs r1, 24 - ldrh r0, [r4, 0x24] - subs r0, r1 - strh r0, [r4, 0x24] - adds r1, r2, 0 - b _0815FFA8 - .pool -_0815FF9C: - ldrh r1, [r4, 0x32] - lsls r0, r1, 16 - asrs r0, 24 - ldrh r2, [r4, 0x24] - adds r0, r2 - strh r0, [r4, 0x24] -_0815FFA8: - movs r0, 0xFF - ands r0, r1 - strh r0, [r4, 0x32] - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0x2 - bne _0815FFBC - adds r0, r4, 0 - bl move_anim_8072740 -_0815FFBC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815FE80 - - thumb_func_start sub_815FFC4 -sub_815FFC4: @ 815FFC4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x26 - ldrsh r0, [r0, r2] - adds r3, r1, 0 - cmp r0, 0x4 - bls _0815FFE0 - b _08160132 -_0815FFE0: - lsls r0, 2 - ldr r1, =_0815FFF4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815FFF4: - .4byte _08160008 - .4byte _08160058 - .4byte _081600B4 - .4byte _081600CC - .4byte _08160132 -_08160008: - ldr r0, =0x02038436 - ldrb r0, [r0] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r0, =0x02038437 - ldrb r0, [r0] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - adds r2, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r1 - movs r0, 0x6 - strh r0, [r1, 0x8] - cmp r5, r2 - ble _0816003E - negs r0, r0 - strh r0, [r1, 0x8] -_0816003E: - strh r5, [r1, 0xA] - strh r2, [r1, 0xC] - ldrh r0, [r1, 0x26] - adds r0, 0x1 - strh r0, [r1, 0x26] - b _08160150 - .pool -_08160058: - ldr r1, =0x020241e4 - ldr r0, =0x02038436 - ldrb r0, [r0] - adds r0, r1 - ldrb r2, [r0] - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r1 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r3 - ldrh r0, [r2, 0x8] - ldrh r3, [r1, 0x24] - adds r0, r3 - strh r0, [r1, 0x24] - movs r3, 0x8 - ldrsh r0, [r2, r3] - cmp r0, 0 - ble _081600A0 - movs r3, 0x20 - ldrsh r0, [r1, r3] - movs r3, 0x24 - ldrsh r1, [r1, r3] - adds r0, r1 - movs r3, 0xC - ldrsh r1, [r2, r3] - b _08160126 - .pool -_081600A0: - movs r3, 0x20 - ldrsh r0, [r1, r3] - movs r3, 0x24 - ldrsh r1, [r1, r3] - adds r0, r1 - movs r3, 0xC - ldrsh r1, [r2, r3] - cmp r0, r1 - bgt _08160150 - b _0816012A -_081600B4: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - movs r2, 0x8 - ldrsh r1, [r0, r2] - negs r1, r1 - strh r1, [r0, 0x8] - ldrh r1, [r0, 0x26] - adds r1, 0x1 - strh r1, [r0, 0x26] - b _08160150 -_081600CC: - ldr r1, =0x020241e4 - ldr r0, =0x02038436 - ldrb r0, [r0] - adds r0, r1 - ldrb r2, [r0] - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r1 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r3 - ldrh r0, [r2, 0x8] - ldrh r3, [r1, 0x24] - adds r0, r3 - strh r0, [r1, 0x24] - movs r3, 0x8 - ldrsh r0, [r2, r3] - cmp r0, 0 - bge _08160118 - movs r3, 0x20 - ldrsh r0, [r1, r3] - movs r3, 0x24 - ldrsh r1, [r1, r3] - adds r0, r1 - movs r3, 0xA - ldrsh r1, [r2, r3] - cmp r0, r1 - bgt _08160150 - b _0816012A - .pool -_08160118: - movs r3, 0x20 - ldrsh r0, [r1, r3] - movs r3, 0x24 - ldrsh r1, [r1, r3] - adds r0, r1 - movs r3, 0xA - ldrsh r1, [r2, r3] -_08160126: - cmp r0, r1 - blt _08160150 -_0816012A: - ldrh r0, [r2, 0x26] - adds r0, 0x1 - strh r0, [r2, 0x26] - b _08160150 -_08160132: - ldr r1, =0x020241e4 - ldr r0, =0x02038436 - ldrb r0, [r0] - adds r0, r1 - ldrb r2, [r0] - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x24] - adds r0, r4, 0 - bl move_anim_task_del -_08160150: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815FFC4 - - thumb_func_start sub_8160164 -sub_8160164: @ 8160164 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r4, r1, r0 - movs r0, 0 - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - strh r0, [r4, 0xE] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - movs r2, 0x1 - negs r2, r2 - adds r1, r2, 0 - cmp r0, 0 - bne _08160198 - movs r1, 0x1 -_08160198: - strh r1, [r4, 0x10] - ldr r2, =0x02020630 - movs r0, 0xE - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x22] - strh r0, [r4, 0x14] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x20] - strh r0, [r4, 0x12] - strh r5, [r4, 0x1A] - strh r5, [r4, 0x1E] - movs r0, 0x1 - strh r0, [r4, 0x1C] - strh r5, [r4, 0x20] - ldr r0, =sub_81601DC - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160164 - - thumb_func_start sub_81601DC -sub_81601DC: @ 81601DC - push {r4-r6,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _08160284 - cmp r0, 0x1 - bgt _08160204 - cmp r0, 0 - beq _0816020A - b _081602DA - .pool -_08160204: - cmp r0, 0x2 - beq _081602D4 - b _081602DA -_0816020A: - ldrh r0, [r4, 0x1E] - adds r0, 0x8 - movs r2, 0xFF - ands r0, r2 - strh r0, [r4, 0x1E] - ldr r5, =0x02020630 - movs r6, 0xE - ldrsh r0, [r4, r6] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldr r3, =gUnknown_08329F40 - movs r6, 0x1E - ldrsh r0, [r4, r6] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 21 - strh r0, [r1, 0x24] - ldrh r0, [r4, 0x1A] - adds r0, 0x2 - ands r0, r2 - strh r0, [r4, 0x1A] - movs r1, 0xE - ldrsh r0, [r4, r1] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r5 - movs r6, 0x1A - ldrsh r0, [r4, r6] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 19 - ldrh r1, [r4, 0x10] - muls r0, r1 - ldrh r1, [r4, 0x12] - adds r0, r1 - strh r0, [r2, 0x20] - movs r6, 0x1A - ldrsh r0, [r4, r6] - cmp r0, 0 - bne _081602DA - movs r0, 0xE - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r4, 0x12] - strh r1, [r0, 0x20] - b _081602C4 - .pool -_08160284: - ldrh r0, [r4, 0x1E] - adds r0, 0x8 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x1E] - ldr r3, =0x02020630 - movs r1, 0xE - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldr r2, =gUnknown_08329F40 - movs r5, 0x1E - ldrsh r0, [r4, r5] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 21 - strh r0, [r1, 0x24] - movs r6, 0x1E - ldrsh r2, [r4, r6] - cmp r2, 0 - bne _081602DA - movs r1, 0xE - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - strh r2, [r1, 0x24] -_081602C4: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _081602DA - .pool -_081602D4: - adds r0, r2, 0 - bl move_anim_task_del -_081602DA: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81601DC - - thumb_func_start sub_81602E0 -sub_81602E0: @ 81602E0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - ldrh r0, [r4, 0x2E] - ldrh r1, [r4, 0x30] - adds r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x14 - bl cosine - strh r0, [r4, 0x24] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x14 - bl sine - strh r0, [r4, 0x26] - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08160326 - adds r0, r4, 0 - bl move_anim_8072740 -_08160326: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81602E0 - - thumb_func_start sub_8160338 -sub_8160338: @ 8160338 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0816037C - ldr r2, =0x0203841e - ldrh r0, [r4, 0x20] - ldrh r1, [r2] - subs r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r2, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r0, =0x0000fff5 - strh r0, [r4, 0x2E] - movs r0, 0xC0 - strh r0, [r4, 0x30] - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - b _08160396 - .pool -_0816037C: - movs r0, 0xB - strh r0, [r4, 0x2E] - movs r0, 0xC0 - strh r0, [r4, 0x30] - ldr r1, =0x0203841e - ldrh r0, [r1] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - ldrh r0, [r1, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] -_08160396: - ldr r0, =sub_81602E0 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160338 - - thumb_func_start sub_81603A8 -sub_81603A8: @ 81603A8 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x02038436 - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A861C - strh r0, [r5, 0x22] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - bgt _081603D2 - movs r0, 0x10 - strh r0, [r5, 0x22] -_081603D2: - movs r0, 0 - strh r0, [r5, 0x3A] - movs r1, 0x10 - strh r1, [r5, 0x3C] - ldr r0, =sub_81603F4 - str r0, [r5, 0x1C] - lsls r1, 8 - movs r0, 0x52 - bl SetGpuReg - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81603A8 - - thumb_func_start sub_81603F4 -sub_81603F4: @ 81603F4 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _0816046C - cmp r1, 0x1 - bgt _0816040A - cmp r1, 0 - beq _08160414 - b _081604E8 -_0816040A: - cmp r1, 0x2 - beq _08160482 - cmp r1, 0x3 - beq _081604E2 - b _081604E8 -_08160414: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _081604E8 - strh r1, [r4, 0x2E] - ldrh r1, [r4, 0x30] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0816043E - ldrh r2, [r4, 0x3A] - movs r3, 0x3A - ldrsh r0, [r4, r3] - cmp r0, 0xF - bgt _0816044C - adds r0, r2, 0x1 - strh r0, [r4, 0x3A] - b _0816044C -_0816043E: - ldrh r2, [r4, 0x3C] - movs r3, 0x3C - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _0816044C - subs r0, r2, 0x1 - strh r0, [r4, 0x3C] -_0816044C: - adds r0, r1, 0x1 - strh r0, [r4, 0x30] - ldrh r1, [r4, 0x3C] - lsls r1, 8 - ldrh r0, [r4, 0x3A] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081604E8 - b _081604DA -_0816046C: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bne _081604E8 - strh r1, [r4, 0x2E] - strh r1, [r4, 0x30] - b _081604DA -_08160482: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _081604E8 - movs r0, 0 - strh r0, [r4, 0x2E] - ldrh r1, [r4, 0x30] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081604AE - ldrh r2, [r4, 0x3A] - movs r3, 0x3A - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _081604BC - subs r0, r2, 0x1 - strh r0, [r4, 0x3A] - b _081604BC -_081604AE: - ldrh r2, [r4, 0x3C] - movs r3, 0x3C - ldrsh r0, [r4, r3] - cmp r0, 0xF - bgt _081604BC - adds r0, r2, 0x1 - strh r0, [r4, 0x3C] -_081604BC: - adds r0, r1, 0x1 - strh r0, [r4, 0x30] - ldrh r1, [r4, 0x3C] - lsls r1, 8 - ldrh r0, [r4, 0x3A] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0x10 - bne _081604E8 -_081604DA: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - b _081604E8 -_081604E2: - adds r0, r4, 0 - bl move_anim_8074EE0 -_081604E8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81603F4 - - thumb_func_start sub_81604F0 -sub_81604F0: @ 81604F0 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =0x0203841e - movs r0, 0 - strh r0, [r2, 0xE] - ldr r0, =0x0203841c - ldrh r1, [r0] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _08160514 - movs r0, 0x1 - b _08160536 - .pool -_08160514: - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08160520 - movs r0, 0x2 - b _08160536 -_08160520: - movs r0, 0x18 - ands r0, r1 - cmp r0, 0 - beq _0816052C - movs r0, 0x3 - b _08160536 -_0816052C: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08160538 - movs r0, 0x4 -_08160536: - strh r0, [r2, 0xE] -_08160538: - adds r0, r3, 0 - bl move_anim_task_del - pop {r0} - bx r0 - thumb_func_end sub_81604F0 - - thumb_func_start sub_8160544 -sub_8160544: @ 8160544 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e00 - adds r4, r0 - movs r0, 0 - strh r0, [r4, 0x8] - ldr r0, =0x0203841e - ldrb r0, [r0] - bl obj_id_for_side_relative_to_move - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - strh r1, [r4, 0x26] - ldr r2, =gUnknown_085CE9C8 - adds r0, r4, 0 - bl sub_80A7CFC - ldr r0, =sub_816058C - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160544 - - thumb_func_start sub_816058C -sub_816058C: @ 816058C - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r2, =0x03005e00 - adds r3, r0, r2 - ldrh r0, [r3, 0x8] - adds r1, r0, 0x1 - movs r5, 0 - strh r1, [r3, 0x8] - subs r0, 0x10 - lsls r0, 16 - lsrs r0, 16 - adds r6, r2, 0 - cmp r0, 0x16 - bhi _081605F0 - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _08160600 - strh r5, [r3, 0xA] - ldrh r0, [r3, 0xC] - adds r0, 0x1 - strh r0, [r3, 0xC] - movs r5, 0x1 - ands r0, r5 - cmp r0, 0 - bne _081605F0 - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000ffff - strh r1, [r0, 0x24] - b _08160600 - .pool -_081605F0: - ldr r2, =0x02020630 - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r5, [r0, 0x24] -_08160600: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r6 - bl sub_80A7D34 - lsls r0, 24 - cmp r0, 0 - bne _08160618 - adds r0, r4, 0 - bl move_anim_task_del -_08160618: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816058C - - thumb_func_start sub_8160624 -sub_8160624: @ 8160624 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_8160624 - - thumb_func_start sub_8160638 -sub_8160638: @ 8160638 - push {lr} - sub sp, 0x4 - bl script_env_2_enable - ldr r0, =sub_8160664 - movs r1, 0xA - bl CreateTask - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160638 - - thumb_func_start sub_8160664 -sub_8160664: @ 8160664 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08160688 - ldr r0, =sub_81606A0 - bl SetMainCallback2 - ldr r1, =0x03005dac - ldr r0, =sub_80AF168 - str r0, [r1] - adds r0, r4, 0 - bl DestroyTask -_08160688: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160664 - - thumb_func_start sub_81606A0 -sub_81606A0: @ 81606A0 - push {r4-r6,lr} - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - bl ResetTasks - bl clear_scheduled_bg_copies_to_vram - ldr r6, =0x0203bc34 - movs r0, 0x8C - lsls r0, 1 - bl AllocZeroed - str r0, [r6] - ldr r1, =0x020375e0 - ldrh r1, [r1] - adds r0, 0x44 - movs r5, 0 - strb r1, [r0] - ldr r0, =sub_8160624 - bl SetVBlankCallback - bl sub_81607EC - movs r0, 0 - bl sub_81D2824 - ldr r4, =0x0203bc38 - movs r0, 0 - strh r5, [r4] - strh r5, [r4, 0x2] - strb r0, [r4, 0x4] - bl sub_8161280 - ldr r0, =gUnknown_085CEBB0 - bl LoadObjectPic - ldr r0, =gUnknown_085CEBB8 - bl LoadTaggedObjectPalette - bl sub_81610B8 - ldr r0, =0x03006310 - ldrh r1, [r4] - ldrh r2, [r4, 0x2] - bl ListMenuInit - ldr r1, [r6] - movs r2, 0x89 - lsls r2, 1 - adds r1, r2 - strb r0, [r1] - movs r0, 0 - movs r1, 0 - movs r2, 0x2 - bl rboxid_80040B8 - ldr r0, =sub_816082C - bl SetMainCallback2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81606A0 - - thumb_func_start sub_8160740 -sub_8160740: @ 8160740 - push {r4,r5,lr} - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - bl ResetTasks - bl clear_scheduled_bg_copies_to_vram - ldr r5, =0x0203bc34 - movs r0, 0x8C - lsls r0, 1 - bl AllocZeroed - str r0, [r5] - movs r1, 0x1C - strb r1, [r0] - ldr r0, [r5] - ldr r1, =0x020375e0 - ldrh r1, [r1] - adds r0, 0x44 - strb r1, [r0] - ldr r0, [r5] - ldr r1, =0x020375e2 - ldrh r1, [r1] - adds r0, 0x45 - strb r1, [r0] - ldr r0, =sub_8160624 - bl SetVBlankCallback - bl sub_81607EC - ldr r4, =0x0203bc38 - ldrb r0, [r4, 0x4] - bl sub_81D2824 - bl sub_8161280 - ldr r0, =gUnknown_085CEBB0 - bl LoadObjectPic - ldr r0, =gUnknown_085CEBB8 - bl LoadTaggedObjectPalette - bl sub_81610B8 - ldr r0, =0x03006310 - ldrh r1, [r4] - ldrh r2, [r4, 0x2] - bl ListMenuInit - ldr r1, [r5] - movs r2, 0x89 - lsls r2, 1 - adds r1, r2 - strb r0, [r1] - movs r0, 0 - movs r1, 0 - movs r2, 0x2 - bl rboxid_80040B8 - ldr r0, =sub_816082C - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160740 - - thumb_func_start sub_81607EC -sub_81607EC: @ 81607EC - push {lr} - bl sub_8121DA0 - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085CEC28 - movs r0, 0 - movs r2, 0x2 - bl InitBgsFromTemplates - bl sub_8121E10 - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end sub_81607EC - - thumb_func_start sub_816082C -sub_816082C: @ 816082C - push {lr} - bl sub_8160868 - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_816082C - - thumb_func_start sub_816084C -sub_816084C: @ 816084C - push {r4,lr} - adds r1, r0, 0 - ldr r4, =0x02021fc4 - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - bl sub_81D2BF4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816084C - - thumb_func_start sub_8160868 -sub_8160868: @ 8160868 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - ldr r1, =0x0203bc34 - ldr r0, [r1] - ldrb r0, [r0] - adds r7, r1, 0 - cmp r0, 0x21 - bls _0816087E - b _08160E8A -_0816087E: - lsls r0, 2 - ldr r1, =_08160890 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08160890: - .4byte _08160918 - .4byte _08160932 - .4byte _0816094C - .4byte _08160954 - .4byte _0816095C - .4byte _08160964 - .4byte _08160980 - .4byte _08160E8A - .4byte _08160988 - .4byte _081609A8 - .4byte _08160E8A - .4byte _08160E8A - .4byte _08160A44 - .4byte _08160A64 - .4byte _08160CB8 - .4byte _08160CD8 - .4byte _08160AB8 - .4byte _08160AD0 - .4byte _08160AEC - .4byte _08160C1C - .4byte _08160C48 - .4byte _08160C98 - .4byte _08160CA6 - .4byte _08160E8A - .4byte _08160B2C - .4byte _08160B60 - .4byte _08160B80 - .4byte _08160BDC - .4byte _08160CFC - .4byte _08160D48 - .4byte _08160E0C - .4byte _08160E38 - .4byte _08160E58 - .4byte _08160E70 -_08160918: - ldr r1, [r7] - ldrb r0, [r1] - adds r0, 0x1 - movs r4, 0 - strb r0, [r1] - movs r0, 0 - bl render_previous_quest_text - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - b _08160CAE -_08160932: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08160940 - b _08160E8A -_08160940: - ldr r1, [r7] - movs r0, 0x4 - b _08160E88 - .pool -_0816094C: - ldr r1, [r7] - ldrb r0, [r1] - adds r0, 0x1 - b _08160E88 -_08160954: - movs r0, 0 - bl render_previous_quest_text - b _0816096A -_0816095C: - movs r0, 0 - bl sub_8160F50 - b _08160E8A -_08160964: - movs r0, 0 - bl sub_8161074 -_0816096A: - ldr r0, =0x0203bc34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - bl sub_81611AC - b _08160E8A - .pool -_08160980: - movs r0, 0x1 - bl sub_8160F50 - b _08160E8A -_08160988: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - beq _08160994 - b _08160E8A -_08160994: - bl sub_81D2C50 - ldr r0, =0x0203bc34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - b _08160E88 - .pool -_081609A8: - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - bne _08160A0A - ldr r5, =0x0203bc34 - ldr r0, [r5] - adds r0, 0x44 - ldrb r1, [r0] - movs r0, 0x64 - adds r4, r1, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - bl sub_8161054 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl pokemon_moveset_pad_ - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - beq _08160A04 - ldr r0, =gUnknown_085EF8E4 - bl sub_816084C - ldr r1, =0x020375e0 - movs r0, 0x1 - strh r0, [r1] - ldr r1, [r5] - movs r0, 0x1F - b _08160E88 - .pool -_08160A04: - ldr r1, [r5] - movs r0, 0x10 - b _08160E88 -_08160A0A: - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08160A18 - cmp r1, 0x1 - beq _08160A18 - b _08160E8A -_08160A18: - ldr r0, =0x0203bc38 - ldrb r0, [r0, 0x4] - cmp r0, 0 - bne _08160A30 - ldr r0, =0x0203bc34 - ldr r1, [r0] - movs r0, 0x3 - b _08160E88 - .pool -_08160A30: - cmp r0, 0x1 - beq _08160A36 - b _08160E8A -_08160A36: - ldr r0, =0x0203bc34 - ldr r1, [r0] - movs r0, 0x5 - b _08160E88 - .pool -_08160A44: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - beq _08160A50 - b _08160E8A -_08160A50: - bl sub_81D2C50 - ldr r0, =0x0203bc34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - b _08160E88 - .pool -_08160A64: - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - bne _08160A7C - ldr r0, =0x020375e0 - strh r1, [r0] - b _08160E82 - .pool -_08160A7C: - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08160A8A - cmp r1, 0x1 - beq _08160A8A - b _08160E8A -_08160A8A: - ldr r0, =0x0203bc38 - ldrb r0, [r0, 0x4] - cmp r0, 0 - bne _08160AA4 - ldr r0, =0x0203bc34 - ldr r1, [r0] - movs r0, 0x3 - b _08160E88 - .pool -_08160AA4: - cmp r0, 0x1 - beq _08160AAA - b _08160E8A -_08160AAA: - ldr r0, =0x0203bc34 - ldr r1, [r0] - movs r0, 0x5 - b _08160E88 - .pool -_08160AB8: - ldr r0, =gUnknown_085EF8F3 - bl sub_816084C - ldr r0, =0x0203bc34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - b _08160E88 - .pool -_08160AD0: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - beq _08160ADC - b _08160E8A -_08160ADC: - bl sub_81D2C50 - ldr r0, =0x0203bc34 - ldr r1, [r0] - movs r0, 0x12 - b _08160E88 - .pool -_08160AEC: - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - bne _08160B10 - ldr r0, =gUnknown_085EFA10 - bl sub_816084C - ldr r0, =0x0203bc34 - ldr r1, [r0] - movs r0, 0x13 - b _08160E88 - .pool -_08160B10: - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08160B1E - cmp r1, 0x1 - beq _08160B1E - b _08160E8A -_08160B1E: - ldr r0, =0x0203bc34 - ldr r1, [r0] - movs r0, 0x18 - b _08160E88 - .pool -_08160B2C: - ldr r4, =0x02021dc4 - bl sub_8161054 - movs r1, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - adds r0, r4, 0 - bl CopyString - ldr r0, =gUnknown_085EF960 - bl sub_816084C - ldr r0, =0x0203bc34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - b _08160E88 - .pool -_08160B60: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - beq _08160B6C - b _08160E8A -_08160B6C: - bl sub_81D2C50 - ldr r0, =0x0203bc34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - b _08160E88 - .pool -_08160B80: - bl sub_8198C58 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - bne _08160B98 - ldr r0, =0x0203bc34 - ldr r1, [r0] - movs r0, 0x1B - b _08160E88 - .pool -_08160B98: - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08160BA6 - cmp r1, 0x1 - beq _08160BA6 - b _08160E8A -_08160BA6: - ldr r0, =0x0203bc38 - ldrb r0, [r0, 0x4] - cmp r0, 0 - bne _08160BC4 - ldr r2, =0x0203bc34 - ldr r1, [r2] - movs r0, 0x3 - strb r0, [r1] - adds r7, r2, 0 - b _08160BD0 - .pool -_08160BC4: - ldr r7, =0x0203bc34 - cmp r0, 0x1 - bne _08160BD0 - ldr r1, [r7] - movs r0, 0x5 - strb r0, [r1] -_08160BD0: - ldr r1, [r7] - movs r0, 0x10 - b _08160E88 - .pool -_08160BDC: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - beq _08160BE8 - b _08160E8A -_08160BE8: - movs r0, 0x3 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =0x0203bc38 - ldrb r0, [r0, 0x4] - cmp r0, 0 - bne _08160C08 - ldr r0, =0x0203bc34 - ldr r1, [r0] - movs r0, 0x3 - b _08160E88 - .pool -_08160C08: - cmp r0, 0x1 - beq _08160C0E - b _08160E8A -_08160C0E: - ldr r0, =0x0203bc34 - ldr r1, [r0] - movs r0, 0x5 - b _08160E88 - .pool -_08160C1C: - bl sub_81D2C3C - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0 - beq _08160C2A - b _08160E8A -_08160C2A: - ldr r0, =0x0203bc34 - ldr r1, [r0] - movs r0, 0x14 - strb r0, [r1] - subs r0, 0x15 - str r2, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _08160E8A - .pool -_08160C48: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08160C56 - b _08160E8A -_08160C56: - bl sub_8161054 - lsls r0, 16 - lsrs r0, 16 - ldr r4, =0x020244ec - ldr r1, =0x0203bc34 - ldr r1, [r1] - adds r1, 0x44 - ldrb r1, [r1] - ldr r2, =0x020244e9 - ldrb r2, [r2] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldr r3, =sub_8160740 - str r0, [sp] - adds r0, r4, 0 - bl sub_81BFA38 - bl sub_8160EA0 - b _08160E8A - .pool -_08160C98: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - beq _08160CA4 - b _08160E8A -_08160CA4: - b _08160E82 -_08160CA6: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] -_08160CAE: - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - b _08160E8A -_08160CB8: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =0x0203bc34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - b _08160E88 - .pool -_08160CD8: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08160CE6 - b _08160E8A -_08160CE6: - bl sub_8160EA0 - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - b _08160E8A - .pool -_08160CFC: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =0x0203bc34 - ldr r1, [r0] - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, =0x0203bc38 - ldrb r0, [r0, 0x4] - cmp r0, 0 - bne _08160D30 - movs r0, 0x1 - bl render_previous_quest_text - b _08160D3A - .pool -_08160D30: - cmp r0, 0x1 - bne _08160D3A - movs r0, 0x1 - bl sub_8161074 -_08160D3A: - bl sub_8161234 - movs r0, 0x3 - movs r1, 0x2 - bl CopyWindowToVram - b _08160E8A -_08160D48: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08160D56 - b _08160E8A -_08160D56: - ldr r1, [r7] - adds r2, r1, 0 - adds r2, 0x45 - ldrb r0, [r2] - cmp r0, 0x4 - bne _08160D6C - movs r0, 0x18 - b _08160E88 - .pool -_08160D6C: - adds r0, r1, 0 - adds r0, 0x44 - ldrb r0, [r0] - movs r4, 0x64 - muls r0, r4 - ldr r5, =0x020244ec - adds r0, r5 - ldrb r1, [r2] - adds r1, 0xD - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - ldr r2, =0x02021ec4 - movs r1, 0xD - mov r8, r1 - mov r1, r8 - muls r1, r0 - ldr r6, =gMoveNames - adds r1, r6 - adds r0, r2, 0 - bl CopyString - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0x44 - ldrb r0, [r0] - muls r0, r4 - adds r0, r5 - adds r1, 0x45 - ldrb r1, [r1] - bl sub_806B9A8 - ldr r0, [r7] - adds r0, 0x44 - ldrb r0, [r0] - muls r4, r0 - adds r4, r5 - bl sub_8161054 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r0, [r7] - adds r0, 0x45 - ldrb r2, [r0] - adds r0, r4, 0 - bl sub_80691F4 - ldr r4, =0x02021dc4 - bl sub_8161054 - mov r1, r8 - muls r1, r0 - adds r1, r6 - adds r0, r4, 0 - bl CopyString - ldr r0, =gUnknown_085EF979 - bl sub_816084C - ldr r1, [r7] - movs r0, 0x1E - strb r0, [r1] - ldr r1, =0x020375e0 - movs r0, 0x1 - strh r0, [r1] - b _08160E8A - .pool -_08160E0C: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - bne _08160E8A - ldr r0, =gUnknown_085EF9A6 - bl sub_816084C - ldr r0, =0x0203bc34 - ldr r1, [r0] - movs r0, 0x1F - strb r0, [r1] - ldr r0, =0x0000016f - bl fanfare_play - b _08160E8A - .pool -_08160E38: - bl sub_81D2C3C - lsls r0, 16 - cmp r0, 0 - bne _08160E8A - ldr r0, =0x0000016f - bl fanfare_play - ldr r0, =0x0203bc34 - ldr r1, [r0] - movs r0, 0x20 - b _08160E88 - .pool -_08160E58: - bl task_is_not_running_overworld_fanfare - lsls r0, 24 - cmp r0, 0 - beq _08160E8A - ldr r0, =0x0203bc34 - ldr r1, [r0] - movs r0, 0x21 - b _08160E88 - .pool -_08160E70: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08160E8A - movs r0, 0x5 - bl audio_play -_08160E82: - ldr r0, =0x0203bc34 - ldr r1, [r0] - movs r0, 0xE -_08160E88: - strb r0, [r1] -_08160E8A: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160868 - - thumb_func_start sub_8160EA0 -sub_8160EA0: @ 8160EA0 - push {r4,lr} - bl sub_8161234 - ldr r4, =0x0203bc34 - ldr r0, [r4] - movs r1, 0x89 - lsls r1, 1 - adds r0, r1 - ldrb r0, [r0] - ldr r1, =0x0203bc38 - adds r2, r1, 0x2 - bl sub_81AE6C8 - bl FreeAllWindowBuffers - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160EA0 - - thumb_func_start render_previous_quest_text -render_previous_quest_text: @ 8160EE0 - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - movs r2, 0 - ldr r6, =0x02020630 - ldr r4, =0x0203bc34 - movs r3, 0x4 -_08160EF0: - ldr r0, [r4] - adds r0, 0x1 - 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] - adds r2, 0x1 - cmp r2, 0xF - ble _08160EF0 - cmp r5, 0 - bne _08160F38 - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EF8C2 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0x3 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0 - bl Print -_08160F38: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end render_previous_quest_text - - thumb_func_start sub_8160F50 -sub_8160F50: @ 8160F50 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r6, =0x0203bc34 - ldr r0, [r6] - movs r4, 0x89 - lsls r4, 1 - adds r0, r4 - ldrb r0, [r0] - bl ListMenuHandleInput - adds r5, r0, 0 - ldr r0, [r6] - adds r0, r4 - ldrb r0, [r0] - ldr r4, =0x0203bc38 - adds r2, r4, 0x2 - adds r1, r4, 0 - bl get_coro_args_x18_x1A - movs r0, 0x2 - negs r0, r0 - cmp r5, r0 - beq _08160FE4 - adds r0, 0x1 - cmp r5, r0 - bne _08161010 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x30 - ands r0, r1 - cmp r0, 0 - bne _08160F9C - bl GetLRKeysState - lsls r0, 24 - cmp r0, 0 - beq _0816103E -_08160F9C: - movs r0, 0x5 - bl audio_play - cmp r7, 0 - bne _08160FC4 - movs r0, 0x1 - bl PutWindowTilemap - ldr r0, [r6] - movs r1, 0x5 - strb r1, [r0] - movs r0, 0x1 - strb r0, [r4, 0x4] - b _08160FD4 - .pool -_08160FC4: - movs r0, 0 - bl PutWindowTilemap - ldr r0, [r6] - movs r2, 0 - movs r1, 0x3 - strb r1, [r0] - strb r2, [r4, 0x4] -_08160FD4: - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - bl sub_8161054 - bl sub_816137C - b _0816103E -_08160FE4: - movs r0, 0x5 - bl audio_play - bl sub_8161234 - ldr r1, [r6] - movs r0, 0xC - strb r0, [r1] - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EF9E6 - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - bl sub_81D2BF4 - b _0816103E - .pool -_08161010: - movs r0, 0x5 - bl audio_play - bl sub_8161234 - ldr r1, [r6] - movs r0, 0x8 - strb r0, [r1] - ldr r0, =0x02021dc4 - movs r1, 0xD - muls r1, r5 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EF8DA - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - bl sub_81D2BF4 -_0816103E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160F50 - - thumb_func_start sub_8161054 -sub_8161054: @ 8161054 - ldr r0, =0x0203bc34 - ldr r2, [r0] - ldr r1, =0x0203bc38 - ldrh r0, [r1, 0x2] - ldrh r1, [r1] - adds r0, r1 - lsls r0, 3 - adds r2, 0x4C - adds r2, r0 - ldr r0, [r2] - bx lr - .pool - thumb_func_end sub_8161054 - - thumb_func_start sub_8161074 -sub_8161074: @ 8161074 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _081610A6 - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EF8C2 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0x3 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0x1 - str r0, [sp] - str r5, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0 - bl Print -_081610A6: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161074 - - thumb_func_start sub_81610B8 -sub_81610B8: @ 81610B8 - push {r4-r7,lr} - ldr r2, =0x0203bc34 - ldr r0, [r2] - movs r1, 0x8A - lsls r1, 1 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r2] - ldr r2, =0x00000113 - adds r1, r0, r2 - movs r0, 0x1 - negs r0, r0 - strb r0, [r1] - bl sub_81611AC - movs r4, 0 - ldr r5, =gUnknown_085CEC10 -_081610DC: - adds r2, r4, 0 - cmp r4, 0 - bge _081610E4 - adds r2, r4, 0x3 -_081610E4: - asrs r2, 2 - lsls r1, r2, 2 - subs r1, r4, r1 - lsls r1, 19 - movs r0, 0xD0 - lsls r0, 15 - adds r1, r0 - asrs r1, 16 - lsls r2, 19 - movs r0, 0x90 - lsls r0, 14 - adds r2, r0 - asrs r2, 16 - adds r0, r5, 0 - movs r3, 0 - bl AddObjectToFront - ldr r2, =0x0203bc34 - ldr r1, [r2] - adds r1, 0x1 - adds r1, r4 - strb r0, [r1] - adds r4, 0x1 - cmp r4, 0x7 - ble _081610DC - movs r4, 0 - ldr r7, =gUnknown_085CEC10 - adds r6, r2, 0 -_0816111C: - adds r2, r4, 0 - cmp r4, 0 - bge _08161124 - adds r2, r4, 0x3 -_08161124: - asrs r2, 2 - lsls r1, r2, 2 - subs r1, r4, r1 - lsls r1, 19 - movs r0, 0xD0 - lsls r0, 15 - adds r1, r0 - asrs r1, 16 - lsls r2, 19 - movs r0, 0xD0 - lsls r0, 14 - adds r2, r0 - asrs r2, 16 - adds r0, r7, 0 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r6] - adds r2, r4, 0 - adds r2, 0x8 - adds r1, 0x1 - adds r1, r2 - strb r0, [r1] - ldr r0, [r6] - adds r0, 0x1 - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =0x02020630 - adds r0, r5 - movs r1, 0x2 - bl StartObjectImageAnim - adds r4, 0x1 - cmp r4, 0x7 - ble _0816111C - movs r4, 0 - ldr r3, =0x0203bc34 - movs r2, 0x4 -_08161176: - ldr r0, [r3] - adds r0, 0x1 - adds r0, r4 - 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 r4, 0x1 - cmp r4, 0xF - ble _08161176 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81610B8 - - thumb_func_start sub_81611AC -sub_81611AC: @ 81611AC - push {r4-r6,lr} - ldr r4, =0x0203bc34 - ldr r1, [r4] - movs r2, 0x8A - lsls r2, 1 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081611D4 - ldr r0, =gUnknown_085CEBC0 - movs r3, 0x8B - lsls r3, 1 - adds r1, r3 - bl AddScrollIndicatorArrowPair - ldr r1, [r4] - movs r5, 0x8A - lsls r5, 1 - adds r1, r5 - strb r0, [r1] -_081611D4: - ldr r0, [r4] - ldr r6, =0x00000113 - adds r0, r6 - ldrb r0, [r0] - cmp r0, 0xFF - bne _08161210 - ldr r0, =0x0203ce8c - adds r2, r0, 0 - ldr r1, =gUnknown_085CEBD0 - ldm r1!, {r3,r5,r6} - stm r2!, {r3,r5,r6} - ldr r1, [r1] - str r1, [r2] - ldr r2, [r4] - movs r3, 0x88 - lsls r3, 1 - adds r1, r2, r3 - ldrb r1, [r1] - ldr r5, =0x00000111 - adds r2, r5 - ldrb r2, [r2] - subs r1, r2 - strh r1, [r0, 0x8] - ldr r1, =0x0203bc38 - bl AddScrollIndicatorArrowPair - ldr r1, [r4] - ldr r6, =0x00000113 - adds r1, r6 - strb r0, [r1] -_08161210: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81611AC - - thumb_func_start sub_8161234 -sub_8161234: @ 8161234 - push {r4,lr} - ldr r4, =0x0203bc34 - ldr r0, [r4] - movs r2, 0x8A - lsls r2, 1 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08161256 - bl RemoveScrollIndicatorArrowPair - ldr r0, [r4] - movs r1, 0x8A - lsls r1, 1 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] -_08161256: - ldr r0, [r4] - ldr r2, =0x00000113 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08161270 - bl RemoveScrollIndicatorArrowPair - ldr r0, [r4] - ldr r2, =0x00000113 - adds r1, r0, r2 - movs r0, 0xFF - strb r0, [r1] -_08161270: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161234 - - thumb_func_start sub_8161280 -sub_8161280: @ 8161280 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - ldr r4, =0x0203bc34 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x44 - ldrb r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - adds r0, r2 - adds r1, 0x12 - bl sub_806E0B4 - ldr r1, [r4] - movs r6, 0x88 - lsls r6, 1 - adds r1, r6 - strb r0, [r1] - movs r5, 0 - ldr r0, [r4] - adds r0, r6 - ldrb r0, [r0] - cmp r5, r0 - bge _081612F6 - mov r8, r4 - movs r0, 0xD - mov r12, r0 - ldr r2, =gMoveNames - mov r9, r2 -_081612C2: - mov r7, r8 - ldr r4, [r7] - lsls r3, r5, 3 - adds r2, r4, 0 - adds r2, 0x48 - adds r2, r3 - lsls r0, r5, 1 - adds r1, r4, 0 - adds r1, 0x12 - adds r1, r0 - ldrh r0, [r1] - mov r7, r12 - muls r7, r0 - adds r0, r7, 0 - add r0, r9 - str r0, [r2] - adds r0, r4, 0 - adds r0, 0x4C - adds r0, r3 - ldrh r1, [r1] - str r1, [r0] - adds r5, 0x1 - adds r0, r4, r6 - ldrb r0, [r0] - cmp r5, r0 - blt _081612C2 -_081612F6: - ldr r4, =0x0203bc34 - ldr r0, [r4] - adds r0, 0x44 - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - ldr r0, =0x02021cc4 - mov r1, sp - bl CopyString_Limit10 - ldr r2, [r4] - movs r5, 0x88 - lsls r5, 1 - adds r3, r2, r5 - ldrb r0, [r3] - lsls r0, 3 - adds r1, r2, 0 - adds r1, 0x48 - adds r1, r0 - ldr r0, =gUnknown_085E8CF0 - str r0, [r1] - ldrb r0, [r3] - lsls r0, 3 - adds r2, 0x4C - adds r2, r0 - movs r0, 0x2 - negs r0, r0 - str r0, [r2] - ldrb r0, [r3] - adds r0, 0x1 - strb r0, [r3] - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x48 - adds r1, r5 - ldrb r1, [r1] - bl sub_81D28C8 - ldr r1, [r4] - ldr r2, =0x00000111 - adds r1, r2 - strb r0, [r1] - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161280 - - thumb_func_start sub_816137C -sub_816137C: @ 816137C - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - ldr r0, =0x0203bc38 - ldrb r0, [r0, 0x4] - cmp r0, 0 - beq _08161394 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - bne _081613CC -_08161394: - movs r5, 0 - ldr r4, =0x02020630 - ldr r3, =0x0203bc34 - movs r2, 0x4 -_0816139C: - ldr r0, [r3] - adds r0, 0x1 - adds r0, r5 - ldrb r1, [r0] - 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] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0xF - bls _0816139C - b _081614FE - .pool -_081613CC: - ldr r1, =gContestEffects - ldr r0, =gContestMoves - lsls r4, 3 - adds r0, r4, r0 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x1] - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r6, r0, 24 - mov r8, r4 - cmp r6, 0xFF - bne _081613EE - movs r6, 0 -_081613EE: - movs r5, 0 - ldr r7, =0x0203bc34 - ldr r4, =0x02020630 -_081613F4: - cmp r5, r6 - bcs _08161420 - ldr r0, [r7] - adds r0, 0x1 - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartObjectImageAnim - b _08161436 - .pool -_08161420: - ldr r0, [r7] - adds r0, 0x1 - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0 - bl StartObjectImageAnim -_08161436: - ldr r0, [r7] - adds r0, 0x1 - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - movs r3, 0x5 - negs r3, r3 - adds r2, r3, 0 - ands r1, r2 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x7 - bls _081613F4 - ldr r1, =gContestEffects - ldr r0, =gContestMoves - add r0, r8 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x2] - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0xFF - bne _0816147C - movs r6, 0 -_0816147C: - movs r5, 0 - ldr r0, =0x0203bc34 - mov r8, r0 - ldr r7, =0x02020630 -_08161484: - cmp r5, r6 - bcs _081614B8 - mov r1, r8 - ldr r0, [r1] - adds r4, r5, 0 - adds r4, 0x8 - adds r0, 0x1 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - movs r1, 0x3 - bl StartObjectImageAnim - b _081614D4 - .pool -_081614B8: - mov r3, r8 - ldr r0, [r3] - adds r4, r5, 0 - adds r4, 0x8 - adds r0, 0x1 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - movs r1, 0x2 - bl StartObjectImageAnim -_081614D4: - mov r1, r8 - ldr r0, [r1] - adds r0, 0x1 - 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 r3, 0x5 - negs r3, r3 - adds r2, r3, 0 - ands r1, r2 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x7 - bls _08161484 -_081614FE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_816137C - - thumb_func_start hm_prepare_dive_probably -hm_prepare_dive_probably: @ 8161508 - push {r4-r6,lr} - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - movs r6, 0x64 - muls r0, r6 - ldr r4, =0x020244ec - adds r0, r4 - movs r1, 0x3A - bl pokemon_getattr - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - muls r0, r6 - adds r0, r4 - movs r1, 0x39 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x5 - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r4, r0 - bhi _08161558 - movs r0, 0 - b _0816155A - .pool -_08161558: - movs r0, 0x1 -_0816155A: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end hm_prepare_dive_probably - - thumb_func_start sub_8161560 -sub_8161560: @ 8161560 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x0203cec8 - movs r1, 0xA - strb r1, [r0, 0xB] - ldrb r1, [r0, 0x9] - strb r1, [r0, 0xA] - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_81B0FCC - movs r0, 0x5 - bl display_pokemon_menu_message - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1370 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161560 - - thumb_func_start sub_81615A8 -sub_81615A8: @ 81615A8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - str r4, [sp, 0x4] - ldr r1, =0x0203cec8 - ldrb r7, [r1, 0x9] - mov r8, r7 - ldrb r0, [r1, 0xA] - adds r5, r0, 0 - cmp r5, 0x6 - bls _081615EC - movs r0, 0 - strb r0, [r1, 0xB] - bl display_pokemon_menu_message - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1370 - str r1, [r0] - b _08161658 - .pool -_081615EC: - movs r0, 0x64 - mov r10, r0 - mov r0, r10 - muls r0, r5 - ldr r1, =0x020244ec - mov r9, r1 - adds r6, r0, r1 - adds r0, r6, 0 - movs r1, 0x39 - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _0816161A - cmp r7, r5 - beq _0816161A - adds r0, r6, 0 - movs r1, 0x3A - bl pokemon_getattr - cmp r0, r4 - bne _08161628 -_0816161A: - ldr r0, [sp, 0x4] - bl sub_81617B8 - b _08161658 - .pool -_08161628: - movs r0, 0x1 - bl audio_play - mov r1, r10 - mov r0, r8 - muls r0, r1 - add r0, r9 - movs r1, 0x3A - bl pokemon_getattr - movs r1, 0x5 - bl __udivsi3 - adds r3, r0, 0 - lsls r3, 16 - asrs r3, 16 - movs r2, 0x1 - negs r2, r2 - ldr r0, =sub_816166C - str r0, [sp] - ldr r0, [sp, 0x4] - mov r1, r8 - bl sub_81B1F18 -_08161658: - 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_81615A8 - - thumb_func_start sub_816166C -sub_816166C: @ 816166C - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - bl audio_play - ldr r5, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r5, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3A - bl pokemon_getattr - movs r1, 0x5 - bl __udivsi3 - adds r3, r0, 0 - lsls r3, 16 - asrs r3, 16 - ldrb r1, [r5, 0xA] - ldr r0, =sub_81616C0 - str r0, [sp] - adds r0, r4, 0 - movs r2, 0x1 - bl sub_81B1F18 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816166C - - thumb_func_start sub_81616C0 -sub_81616C0: @ 81616C0 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =0x0203cec8 - movs r1, 0xA - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02021cc4 - bl GetMonNickname - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E9C17 - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8161724 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81616C0 - - thumb_func_start sub_8161724 -sub_8161724: @ 8161724 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08161772 - ldr r4, =0x0203cec8 - 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, 0x6 - movs r1, 0 - bl sub_8198070 - movs r0, 0x6 - bl ClearWindowTilemap - movs r0, 0 - bl display_pokemon_menu_message - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B1370 - str r1, [r0] -_08161772: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161724 - - thumb_func_start sub_8161784 -sub_8161784: @ 8161784 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081617AA - movs r0, 0x5 - bl display_pokemon_menu_message - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81B1370 - str r0, [r1] -_081617AA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161784 - - thumb_func_start sub_81617B8 -sub_81617B8: @ 81617B8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl audio_play - ldr r0, =gUnknown_085E9712 - movs r1, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8161784 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81617B8 - - thumb_func_start sub_81617F4 -sub_81617F4: @ 81617F4 - push {r4,lr} - ldr r0, =0x0203bc40 - mov r12, r0 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r2, =0x00002734 - adds r0, r1, r2 - mov r4, r12 - str r0, [r4] - movs r3, 0xA - strb r3, [r4, 0x4] - adds r2, 0xA - adds r0, r1, r2 - str r0, [r4, 0x8] - strb r3, [r4, 0xC] - ldr r4, =0x00002748 - adds r0, r1, r4 - mov r2, r12 - str r0, [r2, 0x10] - strb r3, [r2, 0x14] - adds r4, 0xA - adds r0, r1, r4 - str r0, [r2, 0x18] - movs r2, 0x1E - mov r0, r12 - strb r2, [r0, 0x1C] - adds r4, 0x1E - adds r0, r1, r4 - mov r4, r12 - str r0, [r4, 0x20] - mov r0, r12 - adds r0, 0x24 - strb r2, [r0] - ldr r2, =0x0000278e - adds r0, r1, r2 - str r0, [r4, 0x28] - mov r0, r12 - adds r0, 0x2C - strb r3, [r0] - ldr r4, =0x00002798 - adds r0, r1, r4 - mov r2, r12 - str r0, [r2, 0x30] - adds r2, 0x34 - movs r0, 0x28 - strb r0, [r2] - adds r4, 0x28 - adds r1, r4 - mov r0, r12 - str r1, [r0, 0x38] - adds r0, 0x3C - strb r3, [r0] - bl sub_8126968 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81617F4 - - thumb_func_start sub_8161880 -sub_8161880: @ 8161880 - push {r4,r5,lr} - lsls r0, 24 - movs r3, 0 - ldr r1, =0x0203bc40 - lsrs r2, r0, 21 - adds r0, r2, r1 - ldrb r0, [r0, 0x4] - cmp r3, r0 - bcs _081618AA - adds r5, r1, 0 - movs r4, 0 -_08161896: - adds r0, r2, r5 - ldr r1, [r0] - adds r1, r3 - strb r4, [r1] - adds r1, r3, 0x1 - lsls r1, 24 - lsrs r3, r1, 24 - ldrb r0, [r0, 0x4] - cmp r3, r0 - bcc _08161896 -_081618AA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161880 - - thumb_func_start sub_81618B4 -sub_81618B4: @ 81618B4 - push {r4,lr} - movs r4, 0 -_081618B8: - adds r0, r4, 0 - bl sub_8161880 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081618B8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81618B4 - - thumb_func_start sub_81618D0 -sub_81618D0: @ 81618D0 - push {r4,lr} - lsls r0, 24 - movs r2, 0 - ldr r1, =0x0203bc40 - lsrs r0, 21 - adds r0, r1 - movs r1, 0x4 - ldrsb r1, [r0, r1] - cmp r2, r1 - bge _0816190C - adds r4, r0, 0 - adds r3, r1, 0 -_081618E8: - lsls r0, r2, 24 - asrs r1, r0, 24 - ldr r0, [r4] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _08161900 - adds r0, r1, 0 - b _08161910 - .pool -_08161900: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - asrs r0, 24 - cmp r0, r3 - blt _081618E8 -_0816190C: - movs r0, 0x1 - negs r0, r0 -_08161910: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81618D0 - - thumb_func_start sub_8161918 -sub_8161918: @ 8161918 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, =gUnknown_085A5C08 - lsls r0, r3, 5 - adds r0, r1 - ldrb r0, [r0, 0x13] - movs r2, 0 - ldr r1, =0x0203bc40 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x4] - cmp r2, r1 - bcs _08161956 - ldr r4, [r0] -_08161936: - adds r0, r4, r2 - ldrb r0, [r0] - cmp r0, r3 - bne _0816194C - movs r0, 0x1 - b _08161958 - .pool -_0816194C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, r1 - bcc _08161936 -_08161956: - movs r0, 0 -_08161958: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8161918 - - thumb_func_start IsThereStorageSpaceForDecoration -IsThereStorageSpaceForDecoration: @ 8161960 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - cmp r4, 0 - beq _081619A0 - ldr r1, =gUnknown_085A5C08 - lsls r0, r4, 5 - adds r0, r1 - ldrb r5, [r0, 0x13] - adds r0, r5, 0 - bl sub_81618D0 - lsls r0, 24 - asrs r2, r0, 24 - movs r0, 0x1 - negs r0, r0 - cmp r2, r0 - beq _081619A0 - ldr r0, =0x0203bc40 - lsls r1, r5, 3 - adds r1, r0 - ldr r0, [r1] - adds r0, r2 - strb r4, [r0] - movs r0, 0x1 - b _081619A2 - .pool -_081619A0: - movs r0, 0 -_081619A2: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end IsThereStorageSpaceForDecoration - - thumb_func_start sub_81619A8 -sub_81619A8: @ 81619A8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081619D4 - ldr r1, =gUnknown_085A5C08 - lsls r0, 5 - adds r0, r1 - ldrb r0, [r0, 0x13] - bl sub_81618D0 - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _081619D4 - movs r0, 0x1 - b _081619D6 - .pool -_081619D4: - movs r0, 0 -_081619D6: - pop {r1} - bx r1 - thumb_func_end sub_81619A8 - - thumb_func_start sub_81619DC -sub_81619DC: @ 81619DC - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r3, 0 - cmp r5, 0 - bne _081619F8 - b _08161A26 -_081619EA: - movs r0, 0 - strb r0, [r1] - adds r0, r6, 0 - bl sub_8161A38 - movs r0, 0x1 - b _08161A28 -_081619F8: - ldr r2, =0x0203bc40 - ldr r1, =gUnknown_085A5C08 - lsls r0, r5, 5 - adds r0, r1 - ldrb r4, [r0, 0x13] - lsls r0, r4, 3 - adds r0, r2 - ldrb r1, [r0, 0x4] - cmp r3, r1 - bcs _08161A26 - adds r6, r4, 0 - adds r4, r0, 0 - adds r2, r1, 0 -_08161A12: - ldr r0, [r4] - adds r1, r0, r3 - ldrb r0, [r1] - cmp r0, r5 - beq _081619EA - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, r2 - bcc _08161A12 -_08161A26: - movs r0, 0 -_08161A28: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81619DC - - thumb_func_start sub_8161A38 -sub_8161A38: @ 8161A38 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - movs r6, 0 - ldr r2, =0x0203bc40 - lsrs r0, 21 - adds r1, r0, r2 - ldrb r3, [r1, 0x4] - cmp r6, r3 - bcs _08161ABC - adds r7, r0, 0 - mov r10, r1 - mov r0, r10 - str r0, [sp] -_08161A5C: - adds r1, r6, 0x1 - lsls r0, r1, 24 - lsrs r3, r0, 24 - adds r2, r7, 0 - mov r12, r1 - mov r1, r10 - ldrb r1, [r1, 0x4] - cmp r3, r1 - bcs _08161AAE - ldr r0, =0x0203bc40 - mov r9, r0 - adds r1, r0, 0 - mov r8, r1 -_08161A76: - mov r0, r9 - adds r5, r2, r0 - ldr r1, [r5] - adds r0, r1, r3 - ldrb r4, [r0] - adds r2, r4, 0 - cmp r2, 0 - beq _08161A9C - adds r0, r1, r6 - ldrb r1, [r0] - cmp r1, 0 - beq _08161A92 - cmp r1, r2 - bls _08161A9C -_08161A92: - ldrb r1, [r0] - strb r4, [r0] - ldr r0, [r5] - adds r0, r3 - strb r1, [r0] -_08161A9C: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - adds r2, r7, 0 - mov r1, r8 - adds r0, r2, r1 - ldrb r0, [r0, 0x4] - cmp r3, r0 - bcc _08161A76 -_08161AAE: - mov r3, r12 - lsls r0, r3, 24 - lsrs r6, r0, 24 - ldr r0, [sp] - ldrb r0, [r0, 0x4] - cmp r6, r0 - bcc _08161A5C -_08161ABC: - 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_8161A38 - - thumb_func_start sub_8161AD0 -sub_8161AD0: @ 8161AD0 - push {r4,r5,lr} - lsls r0, 24 - movs r4, 0 - movs r3, 0 - ldr r2, =0x0203bc40 - lsrs r1, r0, 21 - adds r0, r1, r2 - ldrb r0, [r0, 0x4] - cmp r4, r0 - bcs _08161B04 - adds r5, r2, 0 -_08161AE6: - adds r2, r1, r5 - ldr r0, [r2] - adds r0, r3 - ldrb r0, [r0] - cmp r0, 0 - beq _08161AF8 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_08161AF8: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - ldrb r2, [r2, 0x4] - cmp r3, r2 - bcc _08161AE6 -_08161B04: - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8161AD0 - - thumb_func_start sub_8161B10 -sub_8161B10: @ 8161B10 - push {r4,r5,lr} - movs r5, 0 - movs r4, 0 -_08161B16: - adds r0, r4, 0 - bl sub_8161AD0 - adds r0, r5, r0 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _08161B16 - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8161B10 - - thumb_func_start sub_8161B34 -sub_8161B34: @ 8161B34 - push {r4,r5,lr} - ldr r5, =0x03005d8c - ldr r0, [r5] - ldr r4, =0x000031dc - adds r0, r4 - movs r1, 0 - movs r2, 0x1C - bl memset - ldr r0, [r5] - adds r0, r4 - ldr r1, =0x00000197 - strh r1, [r0, 0x8] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161B34 - - thumb_func_start sub_8161B60 -sub_8161B60: @ 8161B60 - push {r4-r6,lr} - movs r2, 0 - ldr r6, =0x0203bc86 - ldr r4, =0x0203bc80 - movs r3, 0 - adds r5, r4, 0x1 -_08161B6C: - lsls r1, r2, 1 - adds r0, r1, r4 - strb r3, [r0] - adds r1, r5 - strb r3, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x2 - bls _08161B6C - movs r0, 0 - strb r0, [r6] - strb r0, [r6, 0x1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161B60 - - thumb_func_start sub_8161B94 -sub_8161B94: @ 8161B94 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - lsls r0, 16 - cmp r0, 0 - bne _08161BBC - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r2, =0x000031dc - adds r1, r2 - ldr r2, =0x00000197 - b _08161BC8 - .pool -_08161BBC: - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r2, =0x000031dc - adds r1, r2 - movs r2, 0xCC - lsls r2, 1 -_08161BC8: - strh r2, [r1, 0x8] - adds r7, r0, 0 - ldr r6, =0x02024744 - ldr r0, [r7] - ldr r5, =0x000031dc - adds r0, r5 - ldrh r1, [r0, 0x8] - movs r4, 0 - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - str r4, [sp, 0xC] - adds r0, r6, 0 - movs r2, 0x28 - movs r3, 0x20 - bl create_pokemon_set_level - ldr r0, [r7] - adds r0, r5 - movs r1, 0x28 - strb r1, [r0, 0xC] - ldr r0, [r7] - adds r0, r5 - strb r4, [r0, 0xD] - ldr r0, [r7] - adds r0, r5 - movs r1, 0x1 - strb r1, [r0, 0x13] - adds r0, r6, 0 - movs r1, 0x42 - bl pokemon_getattr - ldr r1, [r7] - adds r1, r5 - str r0, [r1] - adds r0, r6, 0 - movs r1, 0 - bl pokemon_getattr - ldr r1, [r7] - adds r1, r5 - str r0, [r1, 0x4] - adds r0, r6, 0 - movs r1, 0x3A - bl pokemon_getattr - ldr r1, [r7] - adds r1, r5 - movs r2, 0 - mov r8, r2 - strh r0, [r1, 0xA] - adds r0, r6, 0 - movs r1, 0x16 - bl pokemon_getattr - ldr r1, [r7] - adds r1, r5 - strb r0, [r1, 0xE] - adds r0, r6, 0 - movs r1, 0x17 - bl pokemon_getattr - ldr r1, [r7] - adds r1, r5 - strb r0, [r1, 0xF] - adds r0, r6, 0 - movs r1, 0x18 - bl pokemon_getattr - ldr r1, [r7] - adds r1, r5 - strb r0, [r1, 0x10] - adds r0, r6, 0 - movs r1, 0x21 - bl pokemon_getattr - ldr r1, [r7] - adds r1, r5 - strb r0, [r1, 0x11] - adds r0, r6, 0 - movs r1, 0x2F - bl pokemon_getattr - ldr r1, [r7] - adds r1, r5 - strb r0, [r1, 0x12] - ldr r4, =0x0203bc86 - mov r0, r8 - strb r0, [r4] - bl GenerateRandomNumber - ldr r5, =gUnknown_085CEC30 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x14 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 1 - adds r1, r5 - ldrb r0, [r1] - strb r0, [r4, 0x1] - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161B94 - - thumb_func_start sub_8161CBC -sub_8161CBC: @ 8161CBC - push {lr} - bl sub_8161B34 - bl sub_8161B60 - ldr r0, =0x020375e0 - ldrh r0, [r0] - bl sub_8161B94 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161CBC - - thumb_func_start mapnumbers_history_shift_sav1_0_2_4_out -mapnumbers_history_shift_sav1_0_2_4_out: @ 8161CD8 - ldr r0, =0x0203bc80 - ldrb r1, [r0, 0x2] - strb r1, [r0, 0x4] - ldrb r1, [r0, 0x3] - strb r1, [r0, 0x5] - ldrb r1, [r0] - strb r1, [r0, 0x2] - ldrb r1, [r0, 0x1] - strb r1, [r0, 0x3] - ldr r1, =0x03005d8c - ldr r2, [r1] - ldrb r1, [r2, 0x4] - strb r1, [r0] - ldrb r1, [r2, 0x5] - strb r1, [r0, 0x1] - bx lr - .pool - thumb_func_end mapnumbers_history_shift_sav1_0_2_4_out - - thumb_func_start sub_8161D00 -sub_8161D00: @ 8161D00 - push {r4,r5,lr} - movs r1, 0 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x000031dc - adds r0, r2 - ldrb r0, [r0, 0x13] - cmp r0, 0 - beq _08161D3E - ldr r0, =0x0203bc86 - strb r1, [r0] - ldr r5, =gUnknown_085CEC30 - adds r4, r0, 0 -_08161D1A: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x14 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 1 - adds r1, r5 - ldrb r1, [r1] - ldrb r0, [r4, 0x1] - cmp r0, r1 - beq _08161D1A - strb r1, [r4, 0x1] -_08161D3E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161D00 - - thumb_func_start sub_8161D54 -sub_8161D54: @ 8161D54 - push {r4-r7,lr} - movs r4, 0 - bl GenerateRandomNumber - lsls r0, 16 - movs r1, 0xF0 - lsls r1, 12 - ands r1, r0 - cmp r1, 0 - bne _08161D6E - bl sub_8161D00 - b _08161DE2 -_08161D6E: - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000031dc - adds r0, r1 - ldrb r0, [r0, 0x13] - cmp r0, 0 - beq _08161DE2 - ldr r7, =0x0203bc86 - ldr r3, =gUnknown_085CEC30 -_08161D80: - lsls r0, r4, 1 - adds r0, r4 - lsls r2, r0, 1 - adds r1, r2, r3 - ldrb r0, [r7, 0x1] - ldrb r1, [r1] - cmp r0, r1 - bne _08161DD8 - ldr r6, =gUnknown_085CEC30 - adds r5, r2, 0x1 - ldr r4, =0x0203bc80 -_08161D96: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x5 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r0, r5 - adds r0, r6 - ldrb r1, [r0] - ldrb r0, [r4, 0x4] - cmp r0, 0 - bne _08161DBA - ldrb r0, [r4, 0x5] - cmp r0, r1 - beq _08161D96 -_08161DBA: - cmp r1, 0xFF - beq _08161D96 - strb r1, [r7, 0x1] - b _08161DE2 - .pool -_08161DD8: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x13 - bls _08161D80 -_08161DE2: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8161D54 - - thumb_func_start sub_8161DE8 -sub_8161DE8: @ 8161DE8 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r3, =0x000031dc - adds r0, r3 - ldrb r0, [r0, 0x13] - cmp r0, 0 - beq _08161E20 - ldr r0, =0x0203bc86 - ldrb r3, [r0] - cmp r2, r3 - bne _08161E20 - ldrb r0, [r0, 0x1] - cmp r1, r0 - bne _08161E20 - movs r0, 0x1 - b _08161E22 - .pool -_08161E20: - movs r0, 0 -_08161E22: - pop {r1} - bx r1 - thumb_func_end sub_8161DE8 - - thumb_func_start sub_8161E28 -sub_8161E28: @ 8161E28 - push {r4,r5,lr} - sub sp, 0x4 - ldr r5, =0x02024744 - bl zero_enemy_party_data - ldr r4, =0x03005d8c - ldr r0, [r4] - ldr r1, =0x000031dc - adds r0, r1 - ldrh r1, [r0, 0x8] - ldrb r2, [r0, 0xC] - ldr r3, [r0] - ldr r0, [r0, 0x4] - str r0, [sp] - adds r0, r5, 0 - bl sub_8068060 - ldr r2, [r4] - ldr r0, =0x000031e9 - adds r2, r0 - adds r0, r5, 0 - movs r1, 0x37 - bl pokemon_setattr - ldr r2, [r4] - ldr r1, =0x000031e6 - adds r2, r1 - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_setattr - ldr r2, [r4] - ldr r0, =0x000031ea - adds r2, r0 - adds r0, r5, 0 - movs r1, 0x16 - bl pokemon_setattr - ldr r2, [r4] - ldr r1, =0x000031eb - adds r2, r1 - adds r0, r5, 0 - movs r1, 0x17 - bl pokemon_setattr - ldr r2, [r4] - ldr r0, =0x000031ec - adds r2, r0 - adds r0, r5, 0 - movs r1, 0x18 - bl pokemon_setattr - ldr r2, [r4] - ldr r1, =0x000031ed - adds r2, r1 - adds r0, r5, 0 - movs r1, 0x21 - bl pokemon_setattr - ldr r2, [r4] - ldr r0, =0x000031ee - adds r2, r0 - adds r0, r5, 0 - movs r1, 0x2F - bl pokemon_setattr - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161E28 - - thumb_func_start sub_8161EDC -sub_8161EDC: @ 8161EDC - push {lr} - ldr r0, =0x03005d8c - ldr r1, [r0] - ldrb r0, [r1, 0x4] - ldrb r1, [r1, 0x5] - bl sub_8161DE8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08161F10 - bl GenerateRandomNumber - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - cmp r1, 0 - bne _08161F10 - bl sub_8161E28 - movs r0, 0x1 - b _08161F12 - .pool -_08161F10: - movs r0, 0 -_08161F12: - pop {r1} - bx r1 - thumb_func_end sub_8161EDC - - thumb_func_start sub_8161F18 -sub_8161F18: @ 8161F18 - push {r4-r6,lr} - adds r6, r0, 0 - movs r1, 0x39 - bl pokemon_getattr - ldr r5, =0x03005d8c - ldr r1, [r5] - ldr r4, =0x000031dc - adds r1, r4 - strh r0, [r1, 0xA] - adds r0, r6, 0 - movs r1, 0x37 - bl pokemon_getattr - ldr r1, [r5] - adds r1, r4 - strb r0, [r1, 0xD] - bl sub_8161D00 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161F18 - - thumb_func_start sub_8161F4C -sub_8161F4C: @ 8161F4C - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x000031dc - adds r0, r1 - movs r1, 0 - strb r1, [r0, 0x13] - bx lr - .pool - thumb_func_end sub_8161F4C - - thumb_func_start sub_8161F64 -sub_8161F64: @ 8161F64 - ldr r3, =0x0203bc86 - ldrb r2, [r3] - strb r2, [r0] - ldrb r0, [r3, 0x1] - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8161F64 - - thumb_func_start sub_8161F74 -sub_8161F74: @ 8161F74 - push {lr} - ldr r1, =gUnknown_085DF96C - ldr r0, =0x020375e0 - 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_8161F74 - - thumb_func_start sub_8161F94 -sub_8161F94: @ 8161F94 - push {r4-r7,lr} - ldr r4, =0x03005d90 - 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 r6, r0, 16 - ldr r0, [r4] - ldr r2, =0x00000ca8 - adds r0, r2 - movs r7, 0 - movs r1, 0x1 - strb r1, [r0] - ldr r1, [r4] - adds r2, 0xA - adds r0, r1, r2 - strh r7, [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] - bl sub_81A3ACC - ldr r4, [r4] - ldr r0, =0x00000cdc - adds r3, r4, r0 - ldr r2, =gUnknown_085DF9AC - lsls r1, r5, 2 - lsls r0, r6, 3 - adds r1, r0 - adds r1, r2 - ldr r0, [r3] - ldr r1, [r1] - ands r0, r1 - cmp r0, 0 - bne _0816200E - lsls r0, r5, 1 - lsls r1, r6, 2 - adds r0, r1 - movs r2, 0xCE - lsls r2, 4 - adds r1, r4, r2 - adds r1, r0 - strh r7, [r1] -_0816200E: - bl sub_8164ED8 - ldr r0, =0x03005d8c - 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, =0x02038bca - strh r7, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8161F94 - - thumb_func_start sub_8162054 -sub_8162054: @ 8162054 - push {r4-r6,lr} - ldr r5, =0x03005d90 - ldr r0, [r5] - ldr r4, =0x00000ca9 - adds r0, r4 - ldrb r0, [r0] - lsls r0, 30 - lsrs r6, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x020375e2 - ldrh r0, [r0] - cmp r0, 0x1 - beq _08162094 - cmp r0, 0x1 - ble _081620E8 - cmp r0, 0x2 - beq _081620A8 - cmp r0, 0x3 - beq _081620D8 - b _081620E8 - .pool -_08162094: - adds r0, r6, 0 - lsls r1, 24 - lsrs r1, 24 - bl sub_8164FCC - ldr r1, =0x020375f0 - strh r0, [r1] - b _081620E8 - .pool -_081620A8: - ldr r4, =0x020375f0 - ldr r2, [r5] - ldr r0, =0x00000cdc - adds r2, r0 - ldr r3, =gUnknown_085DF9AC - lsls r0, r6, 2 - lsls r1, 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 _081620E8 - .pool -_081620D8: - ldr r1, [r5] - adds r0, r1, r4 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - ldr r2, =0x00000d07 - adds r1, r2 - strb r0, [r1] -_081620E8: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8162054 - - thumb_func_start sub_81620F4 -sub_81620F4: @ 81620F4 - push {r4-r7,lr} - ldr r6, =0x03005d90 - ldr r0, [r6] - ldr r7, =0x00000ca9 - adds r0, r7 - ldrb r0, [r0] - lsls r0, 30 - lsrs r5, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x020375e2 - ldrh r0, [r0] - cmp r0, 0x1 - beq _08162134 - cmp r0, 0x1 - ble _081621B4 - cmp r0, 0x2 - beq _08162150 - cmp r0, 0x3 - beq _081621A4 - b _081621B4 - .pool -_08162134: - ldr r2, [r6] - lsls r0, r5, 1 - lsls r1, r4, 2 - adds r0, r1 - movs r1, 0xCE - lsls r1, 4 - adds r2, r1 - adds r2, r0 - ldr r0, =0x020375e4 - ldrh r0, [r0] - strh r0, [r2] - b _081621B4 - .pool -_08162150: - ldr r0, =0x020375e4 - ldrh r0, [r0] - cmp r0, 0 - beq _08162180 - ldr r2, [r6] - ldr r0, =0x00000cdc - adds r2, r0 - ldr r3, =gUnknown_085DF9AC - 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 _081621B4 - .pool -_08162180: - ldr r2, [r6] - ldr r1, =0x00000cdc - adds r2, r1 - ldr r3, =gUnknown_085DF9CC - 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 _081621B4 - .pool -_081621A4: - ldr r1, [r6] - adds r0, r1, r7 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - ldr r2, =0x00000d07 - adds r1, r2 - strb r0, [r1] -_081621B4: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81620F4 - - thumb_func_start sub_81621C0 -sub_81621C0: @ 81621C0 - push {r4,r5,lr} - ldr r0, =0x02038bca - ldrh r1, [r0] - movs r0, 0xFA - lsls r0, 1 - cmp r1, r0 - bne _081621DA - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000bec - adds r0, r1 - bl sub_816534C -_081621DA: - ldr r5, =0x03005d90 - ldr r0, [r5] - ldr r1, =0x00000d04 - adds r2, r0, r1 - ldrh r1, [r2] - ldr r0, =0x0000270e - cmp r1, r0 - bhi _081621EE - adds r0, r1, 0x1 - strh r0, [r2] -_081621EE: - ldr r1, [r5] - ldr r4, =0x00000cb2 - adds r1, r4 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - bl sub_8163E90 - ldr r1, =0x020375f0 - ldr r0, [r5] - adds r0, r4 - ldrh r0, [r0] - strh r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81621C0 - - thumb_func_start sub_816222C -sub_816222C: @ 816222C - 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, 0x24] - ldr r4, =0x03005d90 - ldr r0, [r4] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - mov r10, r0 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x2C] - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - cmp r0, 0 - beq _08162266 - b _0816239C -_08162266: - mov r0, r10 - ldr r1, [sp, 0x2C] - bl sub_8164FCC - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x28] - movs r7, 0 - mov r2, sp - str r2, [sp, 0x34] -_0816227A: - movs r3, 0xEC - adds r0, r7, 0 - muls r0, r3 - movs r4, 0xE7 - lsls r4, 3 - adds r0, r4 - ldr r5, =0x03005d90 - ldr r1, [r5] - movs r2, 0 - mov r8, r2 - mov r9, r2 - movs r5, 0 - adds r3, r7, 0x1 - str r3, [sp, 0x30] - adds r1, r0 -_08162298: - ldm r1!, {r0} - mov r4, r8 - orrs r4, r0 - mov r8, r4 - add r9, r0 - adds r5, 0x1 - cmp r5, 0x39 - bls _08162298 - movs r6, 0 - movs r5, 0 - movs r0, 0xEC - adds r2, r7, 0 - muls r2, r0 -_081622B2: - ldr r3, =0x03005d90 - ldr r1, [r3] - movs r0, 0x2C - muls r0, r5 - adds r0, r2 - adds r1, r0 - ldr r4, =0x0000076c - adds r0, r1, r4 - ldrh r0, [r0] - cmp r0, 0 - beq _081622E4 - movs r0, 0xEF - lsls r0, 3 - adds r4, r1, r0 - mov r0, r10 - str r2, [sp, 0x38] - bl sub_8165C90 - ldrb r1, [r4] - lsls r0, 24 - lsrs r0, 24 - ldr r2, [sp, 0x38] - cmp r1, r0 - bhi _081622E4 - adds r6, 0x1 -_081622E4: - adds r5, 0x1 - cmp r5, 0x3 - ble _081622B2 - ldr r0, =gUnknown_085DF9F6 - ldr r1, [sp, 0x2C] - adds r0, r1, r0 - ldrb r0, [r0] - cmp r6, r0 - blt _0816233E - ldr r3, =0x03005d90 - ldr r2, [r3] - movs r4, 0xEC - adds r3, r7, 0 - muls r3, r4 - adds r1, r2, r3 - ldr r5, =0x0000073a - adds r0, r1, r5 - ldrh r0, [r0] - ldr r4, [sp, 0x28] - cmp r0, r4 - bne _0816233E - subs r5, 0x2 - adds r0, r1, r5 - ldrb r0, [r0] - cmp r0, r10 - bne _0816233E - mov r0, r8 - cmp r0, 0 - beq _0816233E - movs r1, 0x82 - lsls r1, 4 - adds r0, r2, r1 - adds r0, r3 - ldr r0, [r0] - cmp r0, r9 - bne _0816233E - movs r2, 0x96 - lsls r2, 1 - adds r0, r7, r2 - ldr r3, [sp, 0x34] - stm r3!, {r0} - str r3, [sp, 0x34] - ldr r4, [sp, 0x24] - adds r4, 0x1 - str r4, [sp, 0x24] -_0816233E: - ldr r7, [sp, 0x30] - cmp r7, 0x4 - ble _0816227A - ldr r5, [sp, 0x2C] - cmp r5, 0 - bne _08162396 - bl sub_8165B20 - movs r7, 0 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r4, =gUnknown_085DF9EC - adds r2, r0, 0 - adds r2, 0xDC - ldr r1, [sp, 0x24] - lsls r0, r1, 2 - mov r5, sp - adds r3, r0, r5 -_08162362: - ldrb r0, [r2] - lsls r1, r0, 25 - lsrs r0, r1, 30 - cmp r0, 0 - beq _0816238E - ldrb r0, [r2, 0x1] - adds r0, r4 - ldrb r0, [r0] - ldr r5, [sp, 0x28] - cmp r0, r5 - bne _0816238E - lsrs r0, r1, 30 - subs r0, 0x1 - cmp r0, r10 - bne _0816238E - movs r1, 0xC8 - lsls r1, 1 - adds r0, r7, r1 - stm r3!, {r0} - ldr r5, [sp, 0x24] - adds r5, 0x1 - str r5, [sp, 0x24] -_0816238E: - adds r2, 0x44 - adds r7, 0x1 - cmp r7, 0x3 - ble _08162362 -_08162396: - ldr r0, [sp, 0x24] - cmp r0, 0 - bne _081623C0 -_0816239C: - movs r0, 0 - b _081623DA - .pool -_081623C0: - ldr r4, =0x02038bca - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - ldr r1, [sp, 0x24] - bl __modsi3 - lsls r0, 2 - add r0, sp - ldr r0, [r0] - strh r0, [r4] - movs r0, 0x1 -_081623DA: - add sp, 0x3C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_816222C - - thumb_func_start sub_81623F0 -sub_81623F0: @ 81623F0 - push {r4-r7,lr} - ldr r6, =0x03005d90 - ldr r0, [r6] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - cmp r0, 0x2 - bne _08162414 - bl sub_8165E18 - b _08162530 - .pool -_08162414: - ldr r0, =0x000040ce - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sub_81A39C4 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r5, r0, 16 - bl sub_8165C40 - subs r4, 0x2 - cmp r4, 0x1 - bhi _08162488 - ldr r1, [r6] - ldr r2, =0x00000cb2 - adds r0, r1, r2 - ldrh r3, [r0] - ldr r2, =0x02038bca - lsls r0, r3, 2 - ldr r4, =0x00000cb4 - adds r1, r4 - adds r0, r1, r0 - ldrh r0, [r0] - strh r0, [r2] - ldr r4, =0x02038bcc - lsls r0, r3, 1 - adds r0, 0x1 - lsls r0, 1 - adds r1, r0 - ldrh r0, [r1] - strh r0, [r4] - ldrh r0, [r2] - movs r1, 0 - bl sub_8162614 - ldrh r0, [r4] - movs r1, 0x1 - bl sub_8162614 - b _08162530 - .pool -_08162488: - bl sub_816222C - lsls r0, 24 - cmp r0, 0 - beq _081624B4 - ldr r4, =0x02038bca - ldrh r0, [r4] - movs r1, 0 - bl sub_8162614 - ldr r1, [r6] - ldr r2, =0x00000cb2 - adds r0, r1, r2 - ldrh r0, [r0] - lsls r0, 1 - adds r2, 0x2 - b _08162528 - .pool -_081624B4: - lsls r7, r5, 24 - adds r5, r6, 0 - ldr r6, =0x00000cb2 -_081624BA: - ldr r0, [r5] - adds r0, r6 - ldrb r1, [r0] - lsrs r0, r7, 24 - bl sub_8162548 - lsls r0, 16 - lsrs r3, r0, 16 - movs r4, 0 - ldr r1, [r5] - adds r0, r1, r6 - ldrh r0, [r0] - cmp r4, r0 - bge _081624FC - ldr r2, =0x00000cb4 - adds r0, r1, r2 - ldrh r0, [r0] - cmp r0, r3 - beq _081624FC - ldr r0, =0x03005d90 - ldr r1, [r0] - subs r2, 0x2 - adds r0, r1, r2 - ldrh r2, [r0] - ldr r0, =0x00000cb4 - adds r1, r0 -_081624EE: - adds r1, 0x2 - adds r4, 0x1 - cmp r4, r2 - bge _081624FC - ldrh r0, [r1] - cmp r0, r3 - bne _081624EE -_081624FC: - ldr r0, [r5] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - cmp r4, r0 - bne _081624BA - ldr r4, =0x02038bca - strh r3, [r4] - ldrh r0, [r4] - movs r1, 0 - bl sub_8162614 - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r2, =0x00000cb2 - adds r0, r1, r2 - ldrh r2, [r0] - adds r0, r2, 0x1 - cmp r0, 0x6 - bgt _08162530 - lsls r0, r2, 1 - ldr r2, =0x00000cb4 -_08162528: - adds r1, r2 - adds r1, r0 - ldrh r0, [r4] - strh r0, [r1] -_08162530: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81623F0 - - thumb_func_start sub_8162548 -sub_8162548: @ 8162548 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r3, r0, 0 - lsls r1, 24 - lsrs r1, 24 - cmp r0, 0x7 - bhi _08162584 - cmp r1, 0x6 - bne _08162570 - ldr r2, =gUnknown_085DFA1A - lsls r1, r0, 2 - adds r0, r2, 0x2 - adds r0, r1, r0 - adds r1, r2 - ldrh r0, [r0] - ldrh r4, [r1] - b _0816258A - .pool -_08162570: - ldr r2, =gUnknown_085DF9FA - lsls r1, r3, 2 - adds r0, r2, 0x2 - adds r0, r1, r0 - adds r1, r2 - ldrh r0, [r0] - ldrh r4, [r1] - b _0816258A - .pool -_08162584: - ldr r1, =gUnknown_085DF9FA - ldrh r0, [r1, 0x1E] - ldrh r4, [r1, 0x1C] -_0816258A: - subs r0, r4 - adds r0, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __umodsi3 - adds r4, r0 - lsls r4, 16 - lsrs r5, r4, 16 - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8162548 - - thumb_func_start sub_81625B4 -sub_81625B4: @ 81625B4 - push {r4,lr} - adds r4, r2, 0 - lsls r0, 24 - lsrs r0, 24 - adds r2, r0, 0 - lsls r1, 24 - lsrs r1, 24 - cmp r0, 0x7 - bhi _081625F4 - cmp r1, 0x6 - bne _081625D4 - ldr r1, =gUnknown_085DFA1A - lsls r2, r0, 2 - b _081625D8 - .pool -_081625D4: - ldr r1, =gUnknown_085DF9FA - lsls r2, 2 -_081625D8: - adds r0, r1, 0x2 - adds r0, r2, r0 - adds r2, r1 - ldrh r0, [r0] - ldrh r1, [r2] - subs r0, r1 - adds r0, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - ldrh r0, [r2] - b _08162604 - .pool -_081625F4: - ldr r0, =gUnknown_085DF9FA - ldrh r1, [r0, 0x1E] - ldrh r2, [r0, 0x1C] - subs r1, r2 - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - ldrh r0, [r0, 0x1C] -_08162604: - strh r0, [r4] - strb r1, [r3] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81625B4 - - thumb_func_start sub_8162614 -sub_8162614: @ 8162614 - push {r4-r6,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r6, r4, 0 - lsls r1, 24 - lsrs r5, r1, 24 - bl sub_8165C40 - movs r0, 0xFA - lsls r0, 1 - cmp r4, r0 - bne _08162640 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000bed - adds r0, r1 - b _081626BA - .pool -_08162640: - ldr r0, =0x000003fe - cmp r4, r0 - bne _08162650 - bl sub_81A4DD8 - b _08162788 - .pool -_08162650: - ldr r0, =0x0000012b - cmp r4, r0 - bhi _0816266C - ldr r0, =0x0203bc88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r4 - adds r0, r1 - b _081626BA - .pool -_0816266C: - ldr r0, =0x0000018f - cmp r4, r0 - bhi _08162698 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0xfffffed4 - adds r2, r4, r1 - movs r1, 0xEC - muls r1, r2 - adds r0, r1 - ldr r1, =0x00000739 - adds r0, r1 - b _081626BA - .pool -_08162698: - ldr r3, =gUnknown_08610970 - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r0, =0xfffffe70 - adds r2, r6, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0 - adds r1, 0xDC - ldrb r0, [r1] - lsls r0, 27 - lsrs r0, 27 - movs r1, 0x58 - muls r0, r1 - adds r0, r3 - adds r0, 0x32 -_081626BA: - ldrb r2, [r0] - movs r1, 0 - ldr r3, =gUnknown_085DCEDC - ldrb r0, [r3] - cmp r0, r2 - beq _081626D4 -_081626C6: - adds r1, 0x1 - cmp r1, 0x1D - bhi _081626D4 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081626C6 -_081626D4: - cmp r1, 0x1E - beq _08162700 - ldr r0, =gUnknown_085DCF0E - adds r0, r1, r0 - ldrb r1, [r0] - cmp r5, 0x1 - beq _08162744 - cmp r5, 0x1 - ble _0816272E - cmp r5, 0xF - bne _0816272E - b _08162750 - .pool -_08162700: - movs r1, 0 - ldr r3, =gUnknown_085DCEFA - ldrb r0, [r3] - cmp r0, r2 - beq _08162718 -_0816270A: - adds r1, 0x1 - cmp r1, 0x13 - bhi _08162718 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _0816270A -_08162718: - cmp r1, 0x14 - beq _0816275C - ldr r0, =gUnknown_085DCF2C - adds r0, r1, r0 - ldrb r1, [r0] - cmp r5, 0x1 - beq _08162744 - cmp r5, 0x1 - ble _0816272E - cmp r5, 0xF - beq _08162750 -_0816272E: - ldr r0, =0x00004010 - bl VarSet - b _08162788 - .pool -_08162744: - ldr r0, =0x00004011 - bl VarSet - b _08162788 - .pool -_08162750: - ldr r0, =0x0000401e - bl VarSet - b _08162788 - .pool -_0816275C: - cmp r5, 0x1 - beq _08162770 - cmp r5, 0x1 - ble _08162768 - cmp r5, 0xF - beq _08162780 -_08162768: - ldr r0, =0x00004010 - b _08162772 - .pool -_08162770: - ldr r0, =0x00004011 -_08162772: - movs r1, 0x7 - bl VarSet - b _08162788 - .pool -_08162780: - ldr r0, =0x0000401e - movs r1, 0x7 - bl VarSet -_08162788: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8162614 - - thumb_func_start sub_8162794 -sub_8162794: @ 8162794 - push {lr} - movs r0, 0xFA - lsls r0, 1 - movs r1, 0 - bl sub_8162614 - pop {r0} - bx r0 - thumb_func_end sub_8162794 - - thumb_func_start sub_81627A4 -sub_81627A4: @ 81627A4 - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - bl sub_8165C40 - movs r0, 0xFA - lsls r0, 1 - cmp r4, r0 - bne _081627CC - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000bed - adds r0, r1 - b _08162836 - .pool -_081627CC: - ldr r0, =0x0000012b - cmp r4, r0 - bhi _081627E8 - ldr r0, =0x0203bc88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r4 - adds r0, r1 - b _08162836 - .pool -_081627E8: - ldr r0, =0x0000018f - cmp r4, r0 - bhi _08162814 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0xfffffed4 - adds r2, r4, r1 - movs r1, 0xEC - muls r1, r2 - adds r0, r1 - ldr r1, =0x00000739 - adds r0, r1 - b _08162836 - .pool -_08162814: - ldr r3, =gUnknown_08610970 - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r0, =0xfffffe70 - adds r2, r5, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0 - adds r1, 0xDC - ldrb r0, [r1] - lsls r0, 27 - lsrs r0, 27 - movs r1, 0x58 - muls r0, r1 - adds r0, r3 - adds r0, 0x32 -_08162836: - ldrb r2, [r0] - movs r1, 0 - ldr r3, =gUnknown_085DCEDC - ldrb r0, [r3] - cmp r0, r2 - beq _08162850 -_08162842: - adds r1, 0x1 - cmp r1, 0x1D - bhi _08162850 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _08162842 -_08162850: - cmp r1, 0x1E - beq _0816286C - ldr r0, =gUnknown_085DCF0E - b _08162892 - .pool -_0816286C: - movs r1, 0 - ldr r3, =gUnknown_085DCEFA - ldrb r0, [r3] - cmp r0, r2 - beq _08162884 -_08162876: - adds r1, 0x1 - cmp r1, 0x13 - bhi _08162884 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _08162876 -_08162884: - cmp r1, 0x14 - bne _08162890 - movs r0, 0x7 - b _08162896 - .pool -_08162890: - ldr r0, =gUnknown_085DCF2C -_08162892: - adds r0, r1, r0 - ldrb r0, [r0] -_08162896: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81627A4 - - thumb_func_start sub_81628A0 -sub_81628A0: @ 81628A0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - movs r1, 0 - mov r8, r1 - mov r10, r0 - movs r5, 0 - ldr r2, =0x03005d90 - ldr r0, [r2] - mov r4, r10 - ldrb r4, [r4, 0xC] - str r4, [sp, 0x18] - mov r9, r5 - movs r7, 0x4 - str r7, [sp, 0x1C] - ldr r1, =0x00000744 - adds r1, r0 - mov r12, r1 -_081628CA: - movs r6, 0 - movs r3, 0 - mov r2, r12 - ldrb r0, [r2] - ldr r4, [sp, 0x18] - cmp r0, r4 - bne _081628FA - mov r4, r9 - mov r2, r10 - adds r2, 0xC -_081628DE: - adds r3, 0x1 - cmp r3, 0x3 - bgt _081628FA - ldr r7, =0x03005d90 - ldr r0, [r7] - adds r1, r3, r4 - ldr r7, =0x00000744 - adds r0, r7 - adds r0, r1 - adds r1, r2, r3 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - beq _081628DE -_081628FA: - cmp r3, 0x4 - bne _08162944 - movs r6, 0 - ldr r1, =0x03005d90 - ldr r0, [r1] - ldr r3, =0x0000073c - adds r0, r3 - ldr r2, [sp, 0x1C] - adds r0, r2 - ldrb r0, [r0] - mov r4, r10 - ldrb r4, [r4, 0x8] - cmp r0, r4 - bne _08162944 - adds r1, r0, 0 - mov r2, r9 - adds r2, 0x4 -_0816291C: - cmp r1, 0xFF - bne _08162930 - movs r6, 0x7 - b _08162944 - .pool -_08162930: - adds r6, 0x1 - cmp r6, 0x6 - bgt _08162944 - ldr r7, =0x03005d90 - ldr r0, [r7] - adds r0, r3 - adds r0, r2 - ldrb r0, [r0] - cmp r0, r1 - beq _0816291C -_08162944: - cmp r6, 0x7 - beq _0816295A - movs r0, 0xEC - add r9, r0 - ldr r1, [sp, 0x1C] - adds r1, 0xEC - str r1, [sp, 0x1C] - add r12, r0 - adds r5, 0x1 - cmp r5, 0x4 - ble _081628CA -_0816295A: - cmp r5, 0x4 - bgt _08162974 - ldr r2, =0x03005d90 - ldr r0, [r2] - movs r1, 0xEC - muls r1, r5 - adds r0, r1 - movs r4, 0xE7 - lsls r4, 3 - adds r0, r4 - b _081629B2 - .pool -_08162974: - movs r5, 0 - ldr r7, =0x03005d90 - ldr r0, [r7] - ldr r1, =0x0000073a - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _0816299E - adds r3, r7, 0 - adds r2, r1, 0 - movs r1, 0 -_0816298A: - adds r1, 0xEC - adds r5, 0x1 - cmp r5, 0x4 - bgt _081629C4 - ldr r0, [r3] - adds r0, r1 - adds r0, r2 - ldrh r0, [r0] - cmp r0, 0 - bne _0816298A -_0816299E: - cmp r5, 0x4 - bgt _081629C4 - ldr r1, =0x03005d90 - ldr r0, [r1] - movs r1, 0xEC - muls r1, r5 - adds r0, r1 - movs r2, 0xE7 - lsls r2, 3 - adds r0, r2 -_081629B2: - mov r1, r10 - movs r2, 0xEC - bl memcpy - b _08162A8A - .pool -_081629C4: - mov r2, sp - ldr r4, =0x03005d90 - ldr r0, [r4] - ldr r3, =0x0000073a - adds r0, r3 - ldrh r0, [r0] - movs r1, 0 - strh r0, [r2] - add r0, sp, 0xC - strh r1, [r0] - movs r7, 0x1 - add r8, r7 - movs r5, 0x1 - add r0, sp, 0xC - mov r9, r0 - mov r12, r3 -_081629E4: - movs r3, 0 - adds r7, r5, 0x1 - cmp r3, r8 - bge _08162A2E - ldr r1, =0x03005d90 - ldr r0, [r1] - movs r2, 0xEC - adds r1, r5, 0 - muls r1, r2 - adds r0, r1 - mov r1, r12 - adds r4, r0, r1 - mov r6, sp -_081629FE: - lsls r0, r3, 1 - add r0, sp - ldrh r2, [r4] - adds r1, r2, 0 - ldrh r0, [r0] - cmp r1, r0 - bcs _08162A24 - movs r3, 0 - movs r4, 0x1 - mov r8, r4 - strh r2, [r6] - mov r0, r9 - strh r5, [r0] - b _08162A2E - .pool -_08162A24: - cmp r1, r0 - bhi _08162A2E - adds r3, 0x1 - cmp r3, r8 - blt _081629FE -_08162A2E: - cmp r3, r8 - bne _08162A54 - mov r1, r8 - lsls r2, r1, 1 - mov r4, sp - adds r3, r4, r2 - ldr r1, =0x03005d90 - ldr r0, [r1] - movs r4, 0xEC - adds r1, r5, 0 - muls r1, r4 - adds r0, r1 - add r0, r12 - ldrh r0, [r0] - strh r0, [r3] - add r2, r9 - strh r5, [r2] - movs r0, 0x1 - add r8, r0 -_08162A54: - adds r5, r7, 0 - cmp r5, 0x4 - ble _081629E4 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - mov r1, r8 - bl __modsi3 - adds r5, r0, 0 - ldr r0, =0x03005d90 - ldr r0, [r0] - lsls r1, r5, 1 - add r1, sp - adds r1, 0xC - ldrh r2, [r1] - movs r1, 0xEC - muls r1, r2 - adds r0, r1 - movs r1, 0xE7 - lsls r1, 3 - adds r0, r1 - mov r1, r10 - movs r2, 0xEC - bl memcpy -_08162A8A: - 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_81628A0 - - thumb_func_start sub_8162AA0 -sub_8162AA0: @ 8162AA0 - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - bl sub_8165C40 - movs r0, 0xFA - lsls r0, 1 - cmp r4, r0 - bne _08162AD0 - ldr r1, =gTrainerPicIndices - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r2, =0x00000bed - adds r0, r2 - ldrb r0, [r0] - adds r0, r1 - b _08162BC8 - .pool -_08162AD0: - ldr r0, =0x000003fe - cmp r4, r0 - bne _08162AE4 - bl sub_81A4CB0 - lsls r0, 24 - lsrs r0, 24 - b _08162BCA - .pool -_08162AE4: - ldr r0, =0x0000012b - cmp r4, r0 - bhi _08162B08 - ldr r2, =gTrainerPicIndices - ldr r0, =0x0203bc88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r4 - adds r0, r1 - ldrb r0, [r0] - adds r0, r2 - b _08162BC8 - .pool -_08162B08: - ldr r0, =0x0000018f - cmp r4, r0 - bhi _08162B64 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08162B38 - ldr r4, =gTrainerPicIndices - bl sub_818649C - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - b _08162BC8 - .pool -_08162B38: - ldr r3, =gTrainerPicIndices - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0xfffffed4 - adds r2, r4, r1 - movs r1, 0xEC - muls r1, r2 - adds r0, r1 - ldr r2, =0x00000739 - adds r0, r2 - ldrb r0, [r0] - adds r0, r3 - b _08162BC8 - .pool -_08162B64: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - bne _08162BB0 - ldr r4, =gTrainerPicIndices - ldr r3, =gUnknown_08610970 - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r0, =0xfffffe70 - adds r2, r5, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0 - adds r1, 0xDC - ldrb r0, [r1] - lsls r0, 27 - lsrs r0, 27 - movs r1, 0x58 - muls r0, r1 - adds r0, r3 - adds r0, 0x32 - ldrb r0, [r0] - adds r0, r4 - b _08162BC8 - .pool -_08162BB0: - ldr r5, =gTrainerPicIndices - ldr r4, =gUnknown_08610970 - bl sub_81864A8 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x58 - muls r0, r1 - adds r0, r4 - adds r0, 0x32 - ldrb r0, [r0] - adds r0, r5 -_08162BC8: - ldrb r0, [r0] -_08162BCA: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8162AA0 - - thumb_func_start sub_8162BD8 -sub_8162BD8: @ 8162BD8 - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - bl sub_8165C40 - movs r0, 0xFA - lsls r0, 1 - cmp r4, r0 - bne _08162C08 - ldr r1, =gTrainerClassNameIndices - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r2, =0x00000bed - adds r0, r2 - ldrb r0, [r0] - b _08162C26 - .pool -_08162C08: - ldr r0, =0x000003fe - cmp r4, r0 - bne _08162C1C - bl sub_81A4D00 - lsls r0, 24 - lsrs r0, 24 - b _08162D1E - .pool -_08162C1C: - ldr r0, =0x00000c03 - cmp r4, r0 - bne _08162C38 - ldr r0, =gTrainers - ldr r1, =0x00007da1 -_08162C26: - adds r0, r1 - ldrb r0, [r0] - b _08162D1E - .pool -_08162C38: - ldr r0, =0x0000012b - cmp r4, r0 - bhi _08162C60 - ldr r2, =gTrainerClassNameIndices - ldr r0, =0x0203bc88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r4 - adds r0, r1 - ldrb r0, [r0] - adds r0, r2 - ldrb r0, [r0] - b _08162D1E - .pool -_08162C60: - ldr r0, =0x0000018f - cmp r4, r0 - bhi _08162CBC - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08162C90 - ldr r4, =gTrainerClassNameIndices - bl sub_818649C - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r0, [r0] - b _08162D1E - .pool -_08162C90: - ldr r3, =gTrainerClassNameIndices - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0xfffffed4 - adds r2, r4, r1 - movs r1, 0xEC - muls r1, r2 - adds r0, r1 - ldr r2, =0x00000739 - adds r0, r2 - ldrb r0, [r0] - adds r0, r3 - ldrb r0, [r0] - b _08162D1E - .pool -_08162CBC: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08162CF4 - ldr r5, =gTrainerClassNameIndices - ldr r4, =gUnknown_08610970 - bl sub_81864A8 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x58 - muls r0, r1 - adds r0, r4 - adds r0, 0x32 - ldrb r0, [r0] - adds r0, r5 - ldrb r0, [r0] - b _08162D1E - .pool -_08162CF4: - ldr r4, =gTrainerClassNameIndices - ldr r3, =gUnknown_08610970 - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r0, =0xfffffe70 - adds r2, r5, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0 - adds r1, 0xDC - ldrb r0, [r1] - lsls r0, 27 - lsrs r0, 27 - movs r1, 0x58 - muls r0, r1 - adds r0, r3 - adds r0, 0x32 - ldrb r0, [r0] - adds r0, r4 - ldrb r0, [r0] -_08162D1E: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8162BD8 - - thumb_func_start sub_8162D34 -sub_8162D34: @ 8162D34 - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - bl sub_8165C40 - movs r0, 0xFA - lsls r0, 1 - cmp r4, r0 - bne _08162D5C - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000bed - adds r0, r1 - b _08162E0A - .pool -_08162D5C: - ldr r0, =0x0000012b - cmp r4, r0 - bhi _08162D78 - ldr r0, =0x0203bc88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r4 - adds r0, r1 - b _08162E0A - .pool -_08162D78: - ldr r0, =0x0000018f - cmp r4, r0 - bhi _08162DC0 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08162DA0 - bl sub_818649C - lsls r0, 24 - lsrs r0, 24 - b _08162E0C - .pool -_08162DA0: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0xfffffed4 - adds r2, r4, r1 - movs r1, 0xEC - muls r1, r2 - adds r0, r1 - ldr r1, =0x00000739 - adds r0, r1 - b _08162E0A - .pool -_08162DC0: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08162DE8 - ldr r4, =gUnknown_08610970 - bl sub_81864A8 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x58 - muls r0, r1 - adds r0, r4 - b _08162E08 - .pool -_08162DE8: - ldr r3, =gUnknown_08610970 - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r0, =0xfffffe70 - adds r2, r5, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0 - adds r1, 0xDC - ldrb r0, [r1] - lsls r0, 27 - lsrs r0, 27 - movs r1, 0x58 - muls r0, r1 - adds r0, r3 -_08162E08: - adds r0, 0x32 -_08162E0A: - ldrb r0, [r0] -_08162E0C: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8162D34 - - thumb_func_start sub_8162E20 -sub_8162E20: @ 8162E20 - push {r4-r6,lr} - adds r6, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - movs r4, 0 - bl sub_8165C40 - movs r0, 0xFA - lsls r0, 1 - cmp r5, r0 - bne _08162E54 - ldr r0, =0x03005d90 - ldr r0, [r0] - movs r1, 0xBF - lsls r1, 4 - adds r2, r0, r1 -_08162E40: - adds r0, r6, r4 - adds r1, r2, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x6 - ble _08162E40 - b _08162F5C - .pool -_08162E54: - ldr r0, =0x000003fe - cmp r5, r0 - bne _08162E68 - adds r0, r6, 0 - bl sub_81A4D50 - b _08162F62 - .pool -_08162E68: - ldr r0, =0x00000c03 - cmp r5, r0 - bne _08162E88 - ldr r2, =gTrainers + TRAINER_STEVEN * 0x28 + 0x4 @ Steven's name -_08162E70: - adds r0, r6, r4 - adds r1, r4, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x6 - ble _08162E70 - b _08162F5C - .pool -_08162E88: - ldr r0, =0x0000012b - cmp r5, r0 - bhi _08162EB4 - ldr r0, =0x0203bc88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r5 - adds r0, r1 - adds r2, r0, 0x4 -_08162E9A: - adds r0, r6, r4 - adds r1, r2, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r4, 0x1 - cmp r4, 0x6 - ble _08162E9A - b _08162F5C - .pool -_08162EB4: - ldr r0, =0x0000018f - cmp r5, r0 - bhi _08162F00 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08162ED8 - adds r0, r6, 0 - bl sub_8186468 - b _08162F62 - .pool -_08162ED8: - ldr r2, =0x03005d90 - movs r0, 0xEC - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0xfffef2a8 - adds r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r1, r0, 0x4 - adds r0, 0xE4 - ldrb r2, [r0] - adds r0, r6, 0 - bl sub_81DB5E8 - b _08162F62 - .pool -_08162F00: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08162F24 - bl sub_81864A8 - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_81864C0 - lsls r0, 24 - lsrs r4, r0, 24 - b _08162F3E - .pool -_08162F24: - ldr r1, =0x03005d90 - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - ldr r2, =0xffff969c - adds r0, r2 - ldr r1, [r1] - adds r1, r0 - ldrb r0, [r1] - lsls r0, 27 - lsrs r5, r0, 27 - adds r1, 0x3F - ldrb r4, [r1] -_08162F3E: - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_81A1650 - adds r1, r0, 0 - adds r0, r6, 0 - adds r2, r4, 0 - bl sub_81DB5E8 - b _08162F62 - .pool -_08162F5C: - adds r1, r6, r4 - movs r0, 0xFF - strb r0, [r1] -_08162F62: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8162E20 - - thumb_func_start sub_8162F68 -sub_8162F68: @ 8162F68 - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - bl sub_8165C40 - movs r0, 0xFA - lsls r0, 1 - cmp r4, r0 - bne _08162F90 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000bed - adds r0, r1 - b _0816300E - .pool -_08162F90: - ldr r0, =0x000003fe - cmp r4, r0 - bne _08162FA4 - bl sub_81A4DB8 - lsls r0, 24 - lsrs r0, 24 - b _08163042 - .pool -_08162FA4: - ldr r0, =0x0000012b - cmp r4, r0 - bhi _08162FC0 - ldr r0, =0x0203bc88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r4 - adds r0, r1 - b _0816300E - .pool -_08162FC0: - ldr r0, =0x0000018f - cmp r4, r0 - bhi _08162FEC - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0xfffffed4 - adds r2, r4, r1 - movs r1, 0xEC - muls r1, r2 - adds r0, r1 - ldr r1, =0x00000739 - adds r0, r1 - b _0816300E - .pool -_08162FEC: - ldr r3, =gUnknown_08610970 - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r0, =0xfffffe70 - adds r2, r5, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0 - adds r1, 0xDC - ldrb r0, [r1] - lsls r0, 27 - lsrs r0, 27 - movs r1, 0x58 - muls r0, r1 - adds r0, r3 - adds r0, 0x32 -_0816300E: - ldrb r2, [r0] - movs r1, 0 - ldr r3, =gUnknown_085DCEFA - ldrb r0, [r3] - cmp r0, r2 - beq _08163028 -_0816301A: - adds r1, 0x1 - cmp r1, 0x13 - bhi _08163028 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _0816301A -_08163028: - cmp r1, 0x14 - bne _08163040 - movs r0, 0 - b _08163042 - .pool -_08163040: - movs r0, 0x1 -_08163042: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8162F68 - - thumb_func_start sub_8163048 -sub_8163048: @ 8163048 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl zero_enemy_party_data - ldr r0, =0x02038bca - ldrh r0, [r0] - movs r1, 0 - adds r2, r4, 0 - bl sub_81630C4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8163048 - - thumb_func_start sub_816306C -sub_816306C: @ 816306C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl zero_enemy_party_data - ldr r0, =0x02038bca - ldrh r0, [r0] - movs r1, 0 - adds r2, r4, 0 - bl sub_81630C4 - ldr r0, =0x02038bcc - ldrh r0, [r0] - movs r1, 0x3 - adds r2, r4, 0 - bl sub_81630C4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816306C - - thumb_func_start sub_81630A0 -sub_81630A0: @ 81630A0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl zero_enemy_party_data - ldr r0, =0x02038bca - ldrh r0, [r0] - movs r1, 0 - adds r2, r4, 0 - bl sub_8165EA4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81630A0 - - thumb_func_start sub_81630C4 -sub_81630C4: @ 81630C4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x40 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x18] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x1C] - add r4, sp, 0x14 - movs r0, 0xFF - strb r0, [r4] - bl sub_8165C40 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x20] - ldr r0, =0x0000012b - cmp r5, r0 - bhi _08163138 - adds r0, r5, 0 - bl sub_8165D08 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x24] - ldr r0, =0x02038bca - ldrh r2, [r0] - ldr r0, =0x0203bc88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r2 - adds r0, r1 - ldr r0, [r0, 0x30] - str r0, [sp, 0x2C] - movs r0, 0 - str r0, [sp, 0x28] - ldr r2, [sp, 0x2C] - ldrh r1, [r2] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08163124 - b _08163278 -_08163124: - b _08163260 - .pool -_08163138: - movs r0, 0xFA - lsls r0, 1 - cmp r5, r0 - bne _08163180 - ldr r7, [sp, 0x18] - adds r0, r7, 0x3 - cmp r7, r0 - blt _0816314A - b _08163426 -_0816314A: - ldr r4, =0x03005d90 -_0816314C: - movs r0, 0x64 - muls r0, r7 - ldr r1, =0x02024744 - adds r0, r1 - ldr r5, [sp, 0x18] - subs r2, r7, r5 - movs r1, 0x2C - muls r2, r1 - movs r6, 0xC2 - lsls r6, 4 - adds r2, r6 - ldr r1, [r4] - adds r1, r2 - bl sub_806819C - adds r7, 0x1 - adds r0, r5, 0 - adds r0, 0x3 - cmp r7, r0 - blt _0816314C - b _08163426 - .pool -_08163180: - ldr r0, =0x000003fe - cmp r5, r0 - bne _08163190 - bl sub_81A4E04 - b _08163426 - .pool -_08163190: - ldr r0, =0x0000018f - cmp r5, r0 - bhi _08163218 - movs r6, 0 - ldr r7, [sp, 0x18] - ldr r1, [sp, 0x1C] - adds r0, r7, r1 - cmp r7, r0 - blt _081631A4 - b _08163426 -_081631A4: - ldr r2, =0xfffffed4 - adds r1, r5, r2 - movs r0, 0xEC - adds r2, r1, 0 - muls r2, r0 - mov r8, r2 - muls r0, r5 - ldr r5, =0xfffef2a8 - adds r4, r0, r5 -_081631B6: - ldr r0, =0x03005d90 - ldr r3, [r0] - movs r0, 0x2C - adds r2, r6, 0 - muls r2, r0 - mov r1, r8 - adds r0, r2, r1 - adds r1, r3, r0 - ldr r5, =0x0000076c - adds r0, r1, r5 - ldrh r0, [r0] - cmp r0, 0 - beq _081631F0 - adds r5, 0xC - adds r0, r1, r5 - ldrb r0, [r0] - ldr r1, [sp, 0x20] - cmp r0, r1 - bhi _081631F0 - movs r0, 0x64 - muls r0, r7 - ldr r1, =0x02024744 - adds r0, r1 - adds r1, r3, r4 - adds r2, 0x34 - adds r1, r2 - movs r2, 0 - bl sub_8068338 -_081631F0: - adds r6, 0x1 - adds r7, 0x1 - ldr r2, [sp, 0x18] - ldr r5, [sp, 0x1C] - adds r0, r2, r5 - cmp r7, r0 - blt _081631B6 - b _08163426 - .pool -_08163218: - ldr r7, [sp, 0x18] - adds r0, r7, 0x3 - cmp r7, r0 - blt _08163222 - b _08163426 -_08163222: - ldr r6, =0x03005d90 - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - ldr r1, =0xffff969c - adds r5, r0, r1 - movs r4, 0 -_08163230: - movs r0, 0x64 - muls r0, r7 - ldr r1, =0x02024744 - adds r0, r1 - ldr r1, [r6] - adds r1, r5 - lsrs r2, r4, 24 - bl sub_8068528 - movs r2, 0x80 - lsls r2, 17 - adds r4, r2 - adds r7, 0x1 - ldr r0, [sp, 0x18] - adds r0, 0x3 - cmp r7, r0 - blt _08163230 - b _08163426 - .pool -_08163260: - ldr r0, [sp, 0x28] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x28] - lsls r0, 1 - ldr r5, [sp, 0x2C] - adds r0, r5 - ldrh r1, [r0] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08163260 -_08163278: - movs r7, 0 - bl GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - str r4, [sp, 0x30] - ldr r6, [sp, 0x1C] - cmp r7, r6 - bne _08163296 - b _08163426 -_08163296: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - ldr r1, [sp, 0x28] - bl __modsi3 - lsls r0, 1 - ldr r1, [sp, 0x2C] - adds r0, r1 - ldrh r4, [r0] - ldr r2, [sp, 0x20] - cmp r2, 0x32 - beq _081632B6 - cmp r2, 0x14 - bne _081632BE -_081632B6: - ldr r0, =0x00000351 - cmp r4, r0 - bls _081632BE - b _0816341E -_081632BE: - movs r6, 0 - ldr r5, [sp, 0x18] - adds r5, r7 - mov r8, r5 - b _081632D2 - .pool -_081632D0: - adds r6, 0x1 -_081632D2: - cmp r6, r8 - bge _081632F6 - movs r1, 0x64 - adds r0, r6, 0 - muls r0, r1 - ldr r2, =0x02024744 - adds r0, r2 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - ldr r1, =0x0203bc8c - ldr r2, [r1] - lsls r1, r4, 4 - adds r1, r2 - ldrh r1, [r1] - cmp r0, r1 - bne _081632D0 -_081632F6: - cmp r6, r8 - beq _081632FC - b _0816341E -_081632FC: - movs r6, 0 - cmp r6, r8 - bge _08163346 - ldr r5, =gBattleFrontierHeldItems - mov r9, r5 - movs r3, 0 -_08163308: - ldr r0, =0x02024744 - adds r5, r3, r0 - adds r0, r5, 0 - movs r1, 0xC - movs r2, 0 - str r3, [sp, 0x38] - bl pokemon_getattr - ldr r3, [sp, 0x38] - cmp r0, 0 - beq _0816333E - adds r0, r5, 0 - movs r1, 0xC - movs r2, 0 - bl pokemon_getattr - ldr r1, =0x0203bc8c - ldr r2, [r1] - lsls r1, r4, 4 - adds r1, r2 - ldrb r1, [r1, 0xA] - lsls r1, 1 - add r1, r9 - ldr r3, [sp, 0x38] - ldrh r1, [r1] - cmp r0, r1 - beq _08163346 -_0816333E: - adds r3, 0x64 - adds r6, 0x1 - cmp r6, r8 - blt _08163308 -_08163346: - cmp r6, r8 - bne _0816341E - movs r6, 0 - cmp r6, r7 - bge _08163368 - add r0, sp, 0xC - ldrh r0, [r0] - cmp r0, r4 - beq _08163368 - add r1, sp, 0xC -_0816335A: - adds r1, 0x2 - adds r6, 0x1 - cmp r6, r7 - bge _08163368 - ldrh r0, [r1] - cmp r0, r4 - bne _0816335A -_08163368: - cmp r6, r7 - bne _0816341E - lsls r0, r7, 1 - add r0, sp - adds r0, 0xC - strh r4, [r0] - movs r1, 0x64 - mov r0, r8 - muls r0, r1 - ldr r2, =0x02024744 - adds r0, r2 - ldr r5, =0x0203bc8c - ldr r2, [r5] - lsls r4, 4 - adds r2, r4, r2 - ldrh r1, [r2] - ldrb r3, [r2, 0xC] - ldr r6, [sp, 0x24] - str r6, [sp] - ldrb r2, [r2, 0xB] - str r2, [sp, 0x4] - ldr r2, [sp, 0x30] - str r2, [sp, 0x8] - ldr r2, [sp, 0x20] - bl sub_8068634 - movs r0, 0xFF - mov r6, sp - strb r0, [r6, 0x14] - movs r6, 0 - adds r0, r7, 0x1 - str r0, [sp, 0x34] - mov r9, r4 - movs r0, 0x64 - mov r3, r8 - muls r3, r0 - mov r1, r9 - str r1, [sp, 0x3C] - ldr r2, =0x02024744 - mov r10, r2 -_081633B8: - ldr r0, [r5] - ldr r7, [sp, 0x3C] - adds r0, r7, r0 - lsls r4, r6, 1 - adds r0, 0x2 - adds r0, r4 - ldrh r1, [r0] - lsls r2, r6, 24 - lsrs r2, 24 - mov r7, r10 - adds r0, r3, r7 - str r3, [sp, 0x38] - bl sub_80691F4 - ldr r0, [r5] - ldr r1, [sp, 0x3C] - adds r0, r1, r0 - adds r0, 0x2 - adds r0, r4 - ldrh r0, [r0] - ldr r3, [sp, 0x38] - cmp r0, 0xDA - bne _081633EC - movs r0, 0 - mov r2, sp - strb r0, [r2, 0x14] -_081633EC: - adds r6, 0x1 - cmp r6, 0x3 - ble _081633B8 - movs r5, 0x64 - mov r4, r8 - muls r4, r5 - ldr r6, =0x02024744 - adds r4, r6 - adds r0, r4, 0 - movs r1, 0x20 - add r2, sp, 0x14 - bl pokemon_setattr - ldr r0, =0x0203bc8c - ldr r0, [r0] - add r0, r9 - ldrb r2, [r0, 0xA] - lsls r2, 1 - ldr r0, =gBattleFrontierHeldItems - adds r2, r0 - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_setattr - ldr r7, [sp, 0x34] -_0816341E: - ldr r0, [sp, 0x1C] - cmp r7, r0 - beq _08163426 - b _08163296 -_08163426: - 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_81630C4 - - thumb_func_start sub_8163444 -sub_8163444: @ 8163444 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x8] - movs r1, 0xFF - add r0, sp, 0x4 - strb r1, [r0] - ldr r0, =0x03005d90 - ldr r2, [r0] - movs r0, 0xDC - adds r0, r2 - mov r10, r0 - ldrb r0, [r0, 0x1] - movs r1, 0x9 - str r1, [sp, 0x10] - cmp r0, 0x4 - bhi _08163474 - movs r0, 0x6 - str r0, [sp, 0x10] -_08163474: - ldr r1, =0x00000ca9 - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - movs r1, 0x32 - str r1, [sp, 0xC] - cmp r0, 0 - beq _0816348A - movs r0, 0x64 - str r0, [sp, 0xC] -_0816348A: - movs r7, 0 - adds r2, 0xE2 - str r2, [sp, 0x14] - add r1, sp, 0x4 - mov r9, r1 -_08163494: - ldr r2, [sp, 0x8] - adds r6, r2, r7 - movs r0, 0x64 - muls r0, r6 - ldr r1, =0x02024744 - adds r0, r1 - lsls r5, r7, 1 - adds r4, r5, r7 - lsls r4, 2 - mov r2, r10 - adds r1, r2, r4 - ldrh r1, [r1, 0x4] - movs r2, 0x8 - str r2, [sp] - ldr r2, [sp, 0xC] - ldr r3, [sp, 0x10] - bl pokemon_make_ev_something - movs r0, 0xFF - mov r1, r9 - strb r0, [r1] - adds r2, r7, 0x1 - mov r8, r2 - movs r1, 0x3 -_081634C4: - ldr r2, [sp, 0x14] - adds r0, r2, r4 - ldrh r0, [r0] - cmp r0, 0xDA - bne _081634D4 - movs r2, 0 - mov r0, r9 - strb r2, [r0] -_081634D4: - adds r4, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _081634C4 - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x20 - add r2, sp, 0x4 - bl pokemon_setattr - adds r2, r5, r7 - lsls r2, 2 - add r2, r10 - adds r2, 0xE - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_setattr - mov r7, r8 - cmp r7, 0x3 - bne _08163494 - 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_8163444 - - thumb_func_start sub_8163524 -sub_8163524: @ 8163524 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sub_8165C40 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x0203bc88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r4 - adds r0, r1 - ldr r5, [r0, 0x30] - movs r4, 0 - ldrh r1, [r5] - b _08163558 - .pool -_0816354C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 1 - adds r0, r5 - ldrh r1, [r0] -_08163558: - ldr r0, =0x0000ffff - cmp r1, r0 - bne _0816354C -_0816355E: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __modsi3 - lsls r0, 1 - adds r0, r5 - ldrh r1, [r0] - cmp r6, 0x32 - beq _0816357A - cmp r6, 0x14 - bne _08163580 -_0816357A: - ldr r0, =0x00000351 - cmp r1, r0 - bhi _0816355E -_08163580: - adds r0, r1, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8163524 - - thumb_func_start sub_8163590 -sub_8163590: @ 8163590 - push {lr} - bl zero_enemy_party_data - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - beq _081635C0 - ldr r0, =0x02038bca - ldrh r0, [r0] - movs r1, 0 - bl sub_81635D4 - b _081635CA - .pool -_081635C0: - ldr r0, =0x02038bca - ldrh r0, [r0] - movs r1, 0 - bl sub_816379C -_081635CA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8163590 - - thumb_func_start sub_81635D4 -sub_81635D4: @ 81635D4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - lsls r0, 16 - lsrs r2, r0, 16 - adds r3, r2, 0 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x10] - ldr r0, =0x0000012b - cmp r2, r0 - bhi _0816364A - ldr r4, =0x03005d90 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 24 - ldr r4, [r4] - lsrs r0, 22 - movs r2, 0xCE - lsls r2, 4 - adds r1, r4, r2 - adds r1, r0 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 24 - lsrs r1, r0, 24 - ldr r3, =0x00000cb2 - adds r4, r3 - ldrh r0, [r4] - cmp r0, 0x5 - bhi _0816363C - adds r0, r1, 0 - movs r1, 0 - bl sub_81A6CA8 - lsls r0, 24 - lsrs r0, 24 - b _081636A6 - .pool -_0816363C: - adds r0, r1, 0 - movs r1, 0x1 - bl sub_81A6CA8 - lsls r0, 24 - lsrs r0, 24 - b _081636A6 -_0816364A: - movs r0, 0xFA - lsls r0, 1 - cmp r2, r0 - bne _08163694 - ldr r7, [sp, 0x10] - adds r0, r7, 0x3 - cmp r7, r0 - blt _0816365C - b _08163776 -_0816365C: - ldr r4, =0x03005d90 -_0816365E: - movs r0, 0x64 - muls r0, r7 - ldr r1, =0x02024744 - adds r0, r1 - ldr r1, [sp, 0x10] - subs r2, r7, r1 - movs r1, 0x2C - muls r2, r1 - movs r3, 0xC2 - lsls r3, 4 - adds r2, r3 - ldr r1, [r4] - adds r1, r2 - bl sub_806819C - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, [sp, 0x10] - adds r0, 0x3 - cmp r7, r0 - blt _0816365E - b _08163776 - .pool -_08163694: - ldr r0, =0x000003fe - cmp r3, r0 - bne _081636A4 - bl sub_81A6CD0 - b _08163776 - .pool -_081636A4: - movs r0, 0x1F -_081636A6: - str r0, [sp, 0x18] - bl sub_8165C40 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x14] - ldr r0, =0x03005d90 - ldr r1, [r0] - ldrb r2, [r1, 0xA] - ldrb r0, [r1, 0xB] - lsls r0, 8 - orrs r2, r0 - ldrb r0, [r1, 0xC] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r1, 0xD] - lsls r0, 24 - orrs r2, r0 - mov r8, r2 - movs r7, 0 -_081636CE: - ldr r1, =0x03006298 - lsls r0, r7, 1 - adds r0, r1 - ldrh r0, [r0] - mov r9, r0 - ldr r3, [sp, 0x10] - adds r5, r3, r7 - movs r0, 0x64 - adds r6, r5, 0 - muls r6, r0 - ldr r1, =0x02024744 - adds r0, r6, r1 - ldr r3, =0x0203bc8c - ldr r2, [r3] - mov r1, r9 - lsls r4, r1, 4 - adds r2, r4, r2 - ldrh r1, [r2] - ldrb r3, [r2, 0xC] - mov r10, r3 - ldr r3, [sp, 0x18] - str r3, [sp] - ldrb r2, [r2, 0xB] - str r2, [sp, 0x4] - mov r2, r8 - str r2, [sp, 0x8] - ldr r2, [sp, 0x14] - mov r3, r10 - bl sub_8068634 - movs r1, 0 - add r0, sp, 0xC - strb r1, [r0] - movs r3, 0 - adds r7, 0x1 - mov r10, r7 - adds r7, r4, 0 -_08163718: - ldr r0, =0x0203bc8c - ldr r1, [r0] - mov r2, r9 - lsls r0, r2, 4 - adds r0, r1 - lsls r1, r3, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r1, [r0] - ldr r2, =0x02024744 - adds r0, r6, r2 - adds r2, r3, 0 - str r3, [sp, 0x1C] - bl sub_81A7024 - ldr r3, [sp, 0x1C] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3 - bls _08163718 - movs r3, 0x64 - adds r4, r5, 0 - muls r4, r3 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x20 - add r2, sp, 0xC - bl pokemon_setattr - ldr r1, =0x0203bc8c - 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 pokemon_setattr - mov r2, r10 - lsls r0, r2, 24 - lsrs r7, r0, 24 - cmp r7, 0x2 - bls _081636CE -_08163776: - 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_81635D4 - - thumb_func_start sub_816379C -sub_816379C: @ 816379C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x10] - ldr r0, =0x03005d90 - ldr r1, [r0] - 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 r7, 0 - mov r8, r7 -_081637D0: - ldr r1, =0x03006298 - mov r2, r8 - lsls r0, r2, 1 - adds r0, r1 - ldrh r4, [r0] - ldr r5, [sp, 0x10] - add r5, r8 - movs r7, 0x64 - adds r6, r5, 0 - muls r6, r7 - ldr r1, =0x02024744 - adds r0, r6, r1 - ldr r7, =0x0203bc8c - ldr r2, [r7] - lsls r4, 4 - adds r2, r4, r2 - ldrh r1, [r2] - ldrb r3, [r2, 0xC] - movs r7, 0 - str r7, [sp] - ldrb r2, [r2, 0xB] - str r2, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - movs r2, 0x1E - bl sub_8068634 - movs r1, 0 - add r0, sp, 0xC - strb r1, [r0] - mov r10, r5 - mov r0, r8 - adds r0, 0x1 - str r0, [sp, 0x14] - mov r8, r4 - mov r5, r8 -_08163818: - ldr r1, =0x0203bc8c - ldr r0, [r1] - adds r0, r5, r0 - lsls r4, r7, 1 - adds r0, 0x2 - adds r0, r4 - ldrh r1, [r0] - ldr r2, =0x02024744 - adds r0, r6, r2 - adds r2, r7, 0 - bl sub_81A7024 - ldr r1, =0x0203bc8c - ldr r0, [r1] - adds r0, r5, r0 - adds r0, 0x2 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0xDA - bne _08163846 - movs r1, 0 - add r0, sp, 0xC - strb r1, [r0] -_08163846: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x3 - bls _08163818 - movs r2, 0x64 - mov r4, r10 - muls r4, r2 - ldr r7, =0x02024744 - adds r4, r7 - adds r0, r4, 0 - movs r1, 0x20 - add r2, sp, 0xC - bl pokemon_setattr - ldr r1, =0x0203bc8c - ldr r0, [r1] - add r0, r8 - ldrb r2, [r0, 0xA] - lsls r2, 1 - ldr r0, =gBattleFrontierHeldItems - adds r2, r0 - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_setattr - ldr r2, [sp, 0x14] - lsls r0, r2, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x2 - bls _081637D0 - 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_816379C - - thumb_func_start ConvertBattleFrontierTrainerSpeechToString -ConvertBattleFrontierTrainerSpeechToString: @ 81638AC - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =0x02021fc4 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x3 - movs r3, 0x2 - bl ConvertEasyChatWordsToString - movs r2, 0x1 - negs r2, r2 - movs r0, 0x1 - adds r1, r4, 0 - bl GetStringWidth - cmp r0, 0xCC - bls _0816390A - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - movs r3, 0x3 - bl ConvertEasyChatWordsToString - ldrb r0, [r4] - movs r1, 0x1 - cmp r0, 0xFE - beq _081638EE - adds r2, r4, 0 -_081638E4: - adds r0, r1, r2 - ldrb r0, [r0] - adds r1, 0x1 - cmp r0, 0xFE - bne _081638E4 -_081638EE: - ldr r2, =0x02021fc4 - adds r0, r1, r2 - ldrb r0, [r0] - adds r3, r2, 0 - cmp r0, 0xFE - beq _08163904 -_081638FA: - adds r1, 0x1 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0xFE - bne _081638FA -_08163904: - adds r1, r3 - movs r0, 0xFA - strb r0, [r1] -_0816390A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ConvertBattleFrontierTrainerSpeechToString - - thumb_func_start sub_8163914 -sub_8163914: @ 8163914 - push {lr} - bl sub_8165C40 - ldr r0, =0x020375e2 - ldrh r0, [r0] - cmp r0, 0 - beq _08163930 - ldr r0, =0x02038bcc - b _08163932 - .pool -_08163930: - ldr r0, =0x02038bca -_08163932: - ldrh r3, [r0] - movs r0, 0xFA - lsls r0, 1 - cmp r3, r0 - bne _08163950 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000bfc - b _08163986 - .pool -_08163950: - ldr r0, =0x0000012b - cmp r3, r0 - bhi _08163974 - ldr r2, =0x0203bc88 - movs r0, 0x34 - adds r1, r3, 0 - muls r1, r0 - ldr r0, [r2] - adds r0, r1 - adds r0, 0xC - bl ConvertBattleFrontierTrainerSpeechToString - b _081639A8 - .pool -_08163974: - ldr r0, =0x0000018f - cmp r3, r0 - bhi _0816399C - ldr r1, =0x03005d90 - movs r0, 0xEC - muls r0, r3 - ldr r1, [r1] - adds r0, r1 - ldr r1, =0xfffef2b8 -_08163986: - adds r0, r1 - bl ConvertBattleFrontierTrainerSpeechToString - b _081639A8 - .pool -_0816399C: - adds r0, r3, 0 - adds r0, 0x70 - lsls r0, 24 - lsrs r0, 24 - bl sub_819F99C -_081639A8: - pop {r0} - bx r0 - thumb_func_end sub_8163914 - - thumb_func_start sub_81639AC -sub_81639AC: @ 81639AC - push {r4-r6,lr} - sub sp, 0x4 - bl sub_81864CC - ldr r0, =0x02024474 - adds r0, 0x26 - ldrb r0, [r0] - cmp r0, 0xA - bhi _08163A78 - lsls r0, 2 - ldr r1, =_081639D0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081639D0: - .4byte _081639FC - .4byte _08163A38 - .4byte _08163A74 - .4byte _081639FC - .4byte _081639FC - .4byte _081639FC - .4byte _081639FC - .4byte _081639FC - .4byte _08163A78 - .4byte _081639FC - .4byte _081639FC -_081639FC: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r2, =0x00000ebc - adds r1, r0, r2 - ldr r2, [r1] - ldr r0, =0x00fffffe - cmp r2, r0 - bhi _08163A2C - adds r0, r2, 0x1 - str r0, [r1] - movs r1, 0x14 - bl __umodsi3 - cmp r0, 0 - bne _08163A78 - bl sub_81DA57C - b _08163A78 - .pool -_08163A2C: - ldr r0, =0x00ffffff - str r0, [r1] - b _08163A78 - .pool -_08163A38: - movs r5, 0 - ldr r6, =0x03005d8c -_08163A3C: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - movs r0, 0x8E - lsls r0, 2 - adds r1, r4, r0 - ldr r0, [r6] - adds r0, r1 - movs r1, 0xC - bl pokemon_getattr - mov r1, sp - strh r0, [r1] - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xC - mov r2, sp - bl pokemon_setattr - adds r5, 0x1 - cmp r5, 0x5 - ble _08163A3C - b _08163A78 - .pool -_08163A74: - bl sub_816537C -_08163A78: - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81639AC - - thumb_func_start sub_8163A8C -sub_8163A8C: @ 8163A8C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8145F20 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08163AB0 - ldr r0, =0x030022c0 - ldr r1, =sub_81639AC - str r1, [r0, 0x8] - ldr r0, =sub_8036760 - bl SetMainCallback2 - adds r0, r4, 0 - bl DestroyTask -_08163AB0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8163A8C - - thumb_func_start sub_8163AC4 -sub_8163AC4: @ 8163AC4 - push {r4-r6,lr} - sub sp, 0x4 - ldr r0, =0x02024474 - ldr r2, =0x020375e0 - ldrh r1, [r2] - adds r0, 0x26 - strb r1, [r0] - ldrh r0, [r2] - cmp r0, 0xA - bls _08163ADA - b _08163E68 -_08163ADA: - lsls r0, 2 - ldr r1, =_08163AF0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08163AF0: - .4byte _08163B1C - .4byte _08163BC0 - .4byte _08163C10 - .4byte _08163C70 - .4byte _08163CC4 - .4byte _08163D28 - .4byte _08163D74 - .4byte _08163DB4 - .4byte _08163E2C - .4byte _08163DF4 - .4byte _08163DC8 -_08163B1C: - ldr r5, =0x02022fec - movs r0, 0x84 - lsls r0, 1 - str r0, [r5] - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x1 - beq _08163B56 - cmp r4, 0x1 - bgt _08163B44 - cmp r4, 0 - beq _08163B4E - b _08163BA6 - .pool -_08163B44: - cmp r4, 0x2 - beq _08163B64 - cmp r4, 0x3 - beq _08163B98 - b _08163BA6 -_08163B4E: - movs r0, 0x3 - bl sub_8163048 - b _08163BA6 -_08163B56: - movs r0, 0x4 - bl sub_8163048 - ldr r0, [r5] - orrs r0, r4 - str r0, [r5] - b _08163BA6 -_08163B64: - movs r0, 0x2 - bl sub_816306C - ldr r1, =0x02038bce - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r2, =0x00000cd6 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - ldrh r0, [r1] - bl sub_8165404 - ldr r0, [r5] - ldr r1, =0x00408041 - orrs r0, r1 - str r0, [r5] - b _08163BA6 - .pool -_08163B98: - ldr r0, [r5] - ldr r1, =0x00800043 - orrs r0, r1 - str r0, [r5] - movs r0, 0x2 - bl sub_816306C -_08163BA6: - ldr r0, =sub_8163A8C - movs r1, 0x1 - bl CreateTask - movs r0, 0 - bl current_map_music_set__default_for_battle - movs r0, 0 - b _08163E10 - .pool -_08163BC0: - movs r5, 0 - ldr r6, =0x03005d8c -_08163BC4: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r0, r4, r0 - movs r1, 0xC - bl pokemon_getattr - mov r1, sp - strh r0, [r1] - movs r0, 0x8E - lsls r0, 2 - adds r4, r0 - ldr r0, [r6] - adds r0, r4 - movs r1, 0xC - mov r2, sp - bl pokemon_setattr - adds r5, 0x1 - cmp r5, 0x5 - ble _08163BC4 - ldr r0, =sub_8163A8C - movs r1, 0x1 - bl CreateTask - movs r0, 0 - bl current_map_music_set__default_for_battle - movs r0, 0xC - b _08163E10 - .pool -_08163C10: - bl zero_enemy_party_data - movs r5, 0 - ldr r4, =0x03005d90 -_08163C18: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2C - adds r2, r5, 0 - muls r2, r1 - movs r1, 0xC2 - lsls r1, 4 - adds r2, r1 - ldr r1, [r4] - adds r1, r2 - bl sub_806819C - adds r5, 0x1 - cmp r5, 0x2 - ble _08163C18 - ldr r1, =0x02022fec - ldr r0, =0x00000808 - str r0, [r1] - ldr r1, =0x02038bca - movs r0, 0 - strh r0, [r1] - ldr r0, =sub_8163A8C - movs r1, 0x1 - bl CreateTask - movs r0, 0 - bl current_map_music_set__default_for_battle - movs r0, 0xD - b _08163E10 - .pool -_08163C70: - ldr r4, =0x02022fec - ldr r0, =0x00010008 - str r0, [r4] - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x1 - bne _08163C8A - ldr r0, [r4] - orrs r0, r1 - str r0, [r4] -_08163C8A: - ldr r0, =0x02038bca - ldrh r1, [r0] - ldr r0, =0x000003fe - cmp r1, r0 - bne _08163C9A - movs r0, 0x2 - bl sub_8163048 -_08163C9A: - ldr r0, =sub_8163A8C - movs r1, 0x1 - bl CreateTask - movs r0, 0 - bl sub_806E694 - movs r0, 0x3 - b _08163E10 - .pool -_08163CC4: - ldr r4, =0x02022fec - ldr r0, =0x00020008 - str r0, [r4] - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x1 - bne _08163CDE - ldr r0, [r4] - orrs r0, r1 - str r0, [r4] -_08163CDE: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - beq _08163D0C - movs r0, 0x3 - bl sub_8163048 - b _08163D12 - .pool -_08163D0C: - movs r0, 0x3 - bl sub_81630A0 -_08163D12: - ldr r0, =sub_8163A8C - movs r1, 0x1 - bl CreateTask - movs r0, 0 - bl current_map_music_set__default_for_battle - movs r0, 0x4 - b _08163E10 - .pool -_08163D28: - ldr r1, =0x02022fec - ldr r0, =0x00040008 - str r0, [r1] - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - beq _08163D58 - movs r0, 0x3 - bl sub_8163048 - b _08163D5E - .pool -_08163D58: - movs r0, 0x3 - bl sub_81630A0 -_08163D5E: - ldr r0, =sub_8163A8C - movs r1, 0x1 - bl CreateTask - movs r0, 0 - bl current_map_music_set__default_for_battle - movs r0, 0x5 - b _08163E10 - .pool -_08163D74: - ldr r4, =0x02022fec - ldr r0, =0x00080008 - str r0, [r4] - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x1 - bne _08163D8E - ldr r0, [r4] - orrs r0, r1 - str r0, [r4] -_08163D8E: - bl sub_8163590 - ldr r0, =sub_8163A8C - movs r1, 0x1 - bl CreateTask - movs r0, 0 - bl current_map_music_set__default_for_battle - movs r0, 0x6 - b _08163E10 - .pool -_08163DB4: - ldr r1, =0x02022fec - movs r0, 0x84 - lsls r0, 1 - str r0, [r1] - movs r0, 0x3 - bl sub_8163048 - b _08163E00 - .pool -_08163DC8: - ldr r1, =0x02022fec - ldr r0, =0x00200008 - str r0, [r1] - movs r0, 0x3 - bl sub_8163048 - ldr r0, =sub_8163A8C - movs r1, 0x1 - bl CreateTask - movs r0, 0 - bl current_map_music_set__default_for_battle - movs r0, 0xA - b _08163E10 - .pool -_08163DF4: - ldr r1, =0x02022fec - ldr r0, =0x00008109 - str r0, [r1] - movs r0, 0x1 - bl sub_816306C -_08163E00: - ldr r0, =sub_8163A8C - movs r1, 0x1 - bl CreateTask - movs r0, 0 - bl current_map_music_set__default_for_battle - movs r0, 0x7 -_08163E10: - bl sub_80B100C - lsls r0, 24 - lsrs r0, 24 - bl sub_8145EF4 - b _08163E68 - .pool -_08163E2C: - ldr r1, =0x02022fec - ldr r0, =0x00408049 - str r0, [r1] - ldr r5, =0x00000c03 - adds r0, r5, 0 - bl sub_8165404 - ldr r4, =0x02038bfc - movs r0, 0 - strb r0, [r4] - ldr r0, =gUnknown_08224158 - bl TrainerBattleConfigure - movs r0, 0x1 - strb r0, [r4] - ldr r0, =gUnknown_08224167 - bl TrainerBattleConfigure - ldr r0, =0x02038bce - strh r5, [r0] - ldr r0, =sub_8163A8C - movs r1, 0x1 - bl CreateTask - movs r0, 0 - bl current_map_music_set__default_for_battle - movs r0, 0x12 - bl sub_8145EF4 -_08163E68: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8163AC4 - - thumb_func_start sub_8163E90 -sub_8163E90: @ 8163E90 - push {r4-r6,lr} - ldr r6, =0x03005d90 - ldr r0, [r6] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r5, [r0] - lsls r5, 30 - lsrs r5, 30 - ldr r0, =0x000040ce - bl VarGet - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8164FCC - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, [r6] - lsls r5, 1 - lsls r4, 2 - adds r5, r4 - movs r1, 0xCE - lsls r1, 4 - adds r0, r1 - adds r1, r0, r5 - ldrh r0, [r1] - cmp r0, r2 - bcs _08163ED0 - strh r2, [r1] -_08163ED0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8163E90 - - thumb_func_start sub_8163EE4 -sub_8163EE4: @ 8163EE4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r4, =0x03005d90 - ldr r0, [r4] - ldr r1, =0x0000064c - adds r5, r0, r1 - adds r0, r5, 0 - bl sub_8164FB8 - ldr r0, [r4] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r6, r0, 30 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 24 - lsrs r7, r0, 24 - ldr r2, [r4] - ldrb r0, [r2, 0x8] - cmp r0, 0 - beq _08163F40 - ldr r4, =gUnknown_085DCEFA - ldrb r0, [r2, 0xA] - ldrb r1, [r2, 0xB] - adds r0, r1 - ldrb r1, [r2, 0xC] - adds r0, r1 - ldrb r1, [r2, 0xD] - adds r0, r1 - movs r1, 0x14 - b _08163F52 - .pool -_08163F40: - ldr r4, =gUnknown_085DCEDC - ldrb r0, [r2, 0xA] - ldrb r1, [r2, 0xB] - adds r0, r1 - ldrb r1, [r2, 0xC] - adds r0, r1 - ldrb r1, [r2, 0xD] - adds r0, r1 - movs r1, 0x1E -_08163F52: - bl __umodsi3 - adds r0, r4 - ldrb r0, [r0] - strb r6, [r5] - strb r0, [r5, 0x1] - adds r0, r5, 0 - adds r0, 0xC - ldr r4, =0x03005d90 - ldr r1, [r4] - adds r1, 0xA - bl sub_80842F4 - adds r0, r5, 0x4 - ldr r1, [r4] - bl CopyString_Limit7 - adds r0, r6, 0 - adds r1, r7, 0 - bl sub_8164FCC - strh r0, [r5, 0x2] - movs r4, 0 - movs r2, 0x10 - adds r2, r5 - mov r12, r2 - movs r7, 0x1C - adds r7, r5 - mov r9, r7 - adds r6, r5, 0 - adds r6, 0x28 - movs r0, 0xE4 - adds r0, r5 - mov r8, r0 -_08163F96: - lsls r2, r4, 1 - mov r1, r12 - adds r3, r1, r2 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r7, =0x00002bbc - adds r0, r1, r7 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r3] - mov r0, r9 - adds r3, r0, r2 - adds r7, 0xC - adds r0, r1, r7 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r3] - adds r3, r6, r2 - ldr r0, =0x00002bd4 - adds r1, r0 - adds r1, r2 - ldrh r0, [r1] - strh r0, [r3] - adds r4, 0x1 - cmp r4, 0x5 - ble _08163F96 - movs r4, 0 -_08163FCC: - ldr r6, =0x03005d90 - ldr r0, [r6] - lsls r1, r4, 1 - ldr r2, =0x00000caa - adds r0, r2 - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, 0 - beq _08163FF4 - adds r1, r0, 0 - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024488 - adds r0, r1 - movs r1, 0x2C - muls r1, r4 - adds r1, 0x34 - adds r1, r5, r1 - bl sub_80686FC -_08163FF4: - adds r4, 0x1 - cmp r4, 0x3 - ble _08163FCC - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - mov r7, r8 - strb r0, [r7] - ldr r0, [r6] - ldr r1, =0x0000064c - adds r0, r1 - bl sub_8164F70 - bl sub_8163E90 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8163EE4 - - thumb_func_start sub_8164040 -sub_8164040: @ 8164040 - push {r4,r5,lr} - ldr r5, =0x03005d90 - 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, 16 - ldr r5, [r5] - lsls r4, 1 - lsrs r0, 14 - adds r4, r0 - movs r2, 0xCE - lsls r2, 4 - adds r0, r5, r2 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r1, r0, 16 - ldr r0, =0x020375e2 - ldrh r0, [r0] - cmp r0, 0 - bne _0816408E - cmp r1, 0x1 - bgt _0816408A - ldr r1, =0x00000cb2 - adds r0, r5, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _0816408E -_0816408A: - bl sub_8163EE4 -_0816408E: - ldr r4, =0x03005d90 - ldr r0, [r4] - ldr r1, =0x020375e2 - 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,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8164040 - - thumb_func_start nullsub_61 -nullsub_61: @ 81640D8 - bx lr - thumb_func_end nullsub_61 - - thumb_func_start nullsub_116 -nullsub_116: @ 81640DC - bx lr - thumb_func_end nullsub_116 - - thumb_func_start sub_81640E0 -sub_81640E0: @ 81640E0 - push {r4-r7,lr} - sub sp, 0xC - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - ldr r4, =0x020244ec - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r7, r0, 16 - adds r4, 0x64 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - movs r6, 0 - movs r2, 0 - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r0, =0xfffffe70 - adds r5, r0 - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r1, 0xE0 - adds r0, r1 - mov r3, sp -_08164122: - ldrh r1, [r0] - cmp r1, r7 - beq _08164130 - cmp r1, r4 - beq _08164130 - stm r3!, {r2} - adds r6, 0x1 -_08164130: - adds r0, 0xC - adds r2, 0x1 - cmp r2, 0x2 - ble _08164122 - bl GenerateRandomNumber - ldr r4, =0x03006298 - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - lsls r0, 2 - add r0, sp - ldr r0, [r0] - strh r0, [r4] -_08164150: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - lsls r0, 2 - add r0, sp - ldr r0, [r0] - strh r0, [r4, 0x2] - ldrh r1, [r4] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - beq _08164150 - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81640E0 - - thumb_func_start sub_8164188 -sub_8164188: @ 8164188 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - ldr r6, =0x03005d90 - ldr r0, [r6] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - str r0, [sp, 0xC] - ldr r4, =0x020244ec - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x10] - adds r4, 0x64 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x14] - movs r3, 0 - mov r8, r3 - movs r7, 0 - adds r2, r6, 0 - ldr r0, =0xfffffed4 - adds r5, r0 - ldr r6, =0x0000076c - mov r10, sp - movs r0, 0xEC - adds r1, r5, 0 - muls r1, r0 - mov r9, r1 -_081641E6: - ldr r1, [r2] - movs r0, 0x2C - muls r0, r7 - mov r3, r9 - adds r5, r0, r3 - adds r1, r5 - adds r0, r1, r6 - ldrh r0, [r0] - ldr r3, [sp, 0x10] - cmp r0, r3 - beq _0816423A - ldr r3, [sp, 0x14] - cmp r0, r3 - beq _0816423A - movs r0, 0xEF - lsls r0, 3 - adds r4, r1, r0 - ldr r1, [sp, 0xC] - lsls r0, r1, 24 - lsrs r0, 24 - str r2, [sp, 0x18] - bl sub_8165C90 - ldrb r1, [r4] - lsls r0, 24 - lsrs r0, 24 - ldr r2, [sp, 0x18] - cmp r1, r0 - bhi _0816423A - ldr r0, [r2] - adds r0, r5 - adds r0, r6 - ldrh r0, [r0] - cmp r0, 0 - beq _0816423A - mov r3, r10 - adds r3, 0x4 - mov r10, r3 - subs r3, 0x4 - stm r3!, {r7} - movs r0, 0x1 - add r8, r0 -_0816423A: - adds r7, 0x1 - cmp r7, 0x3 - ble _081641E6 - bl GenerateRandomNumber - ldr r4, =0x03006298 - lsls r0, 16 - lsrs r0, 16 - mov r1, r8 - bl __modsi3 - lsls r0, 2 - add r0, sp - ldr r0, [r0] - strh r0, [r4, 0x4] -_08164258: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - mov r1, r8 - bl __modsi3 - lsls r0, 2 - add r0, sp - ldr r0, [r0] - strh r0, [r4, 0x6] - ldrh r1, [r4, 0x4] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - beq _08164258 - 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_8164188 - - thumb_func_start sub_81642A0 -sub_81642A0: @ 81642A0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4C - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 4 - adds r1, r0, r1 - str r1, [sp, 0x24] - ldr r5, =0x03005d90 - ldr r0, [r5] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - str r0, [sp, 0x14] - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - ldr r1, [r5] - ldr r3, [sp, 0x14] - lsls r2, r3, 1 - lsrs r0, 14 - adds r2, r0 - movs r4, 0xCE - lsls r4, 4 - adds r1, r4 - adds r1, r2 - ldrh r0, [r1] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x18] - ldr r4, =0x020244ec - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - str r0, [sp, 0x1C] - adds r4, 0x64 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - str r0, [sp, 0x20] - bl sub_8165C40 - movs r7, 0 - ldr r0, [sp, 0x18] - lsls r0, 24 - mov r10, r0 -_08164318: - lsls r6, r7, 1 -_0816431A: - mov r1, r10 - lsrs r0, r1, 24 - movs r1, 0 - bl sub_8162548 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - movs r2, 0 - mov r9, r2 - cmp r9, r7 - bge _08164368 - ldr r0, [r5] - ldr r3, =0x00000cb4 - adds r1, r0, r3 - ldrh r0, [r1] - cmp r0, r8 - beq _08164368 - ldr r0, =0x0203bc88 - ldr r2, [r0] - movs r4, 0x34 - mov r0, r8 - muls r0, r4 - adds r0, r2 - ldrb r3, [r0] -_0816434C: - ldrh r0, [r1] - muls r0, r4 - adds r0, r2 - ldrb r0, [r0] - cmp r0, r3 - beq _08164368 - adds r1, 0x2 - movs r0, 0x1 - add r9, r0 - cmp r9, r7 - bge _08164368 - ldrh r0, [r1] - cmp r0, r8 - bne _0816434C -_08164368: - cmp r9, r7 - bne _0816431A - ldr r0, [r5] - ldr r1, =0x00000cb4 - adds r0, r1 - adds r0, r6 - mov r2, r8 - strh r2, [r0] - mov r7, r9 - adds r7, 0x1 - cmp r7, 0x5 - ble _08164318 - movs r3, 0x8 - mov r10, r3 - movs r4, 0 - mov r9, r4 - ldr r0, [sp, 0x24] - str r0, [sp, 0x40] -_0816438C: - ldr r1, =0x03005d90 - ldr r0, [r1] - mov r2, r9 - lsls r1, r2, 1 - ldr r3, =0x00000cb4 - adds r0, r3 - adds r0, r1 - ldrh r0, [r0] - mov r8, r0 - bl sub_81627A4 - ldr r4, [sp, 0x40] - strb r0, [r4, 0x19] - movs r7, 0 -_081643A8: - adds r0, r7, 0x1 - str r0, [sp, 0x30] - mov r1, r10 - lsls r1, 1 - str r1, [sp, 0x38] - mov r2, r10 - adds r2, 0x1 - str r2, [sp, 0x34] - mov r0, r10 - subs r0, 0x1 - lsls r0, 1 - str r0, [sp, 0x28] -_081643C0: - mov r0, r8 - bl sub_8163524 - lsls r0, 16 - lsrs r6, r0, 16 - movs r0, 0x1 - ands r0, r7 - cmp r0, 0 - beq _081643F4 - ldr r3, =0x03005d90 - ldr r0, [r3] - ldr r4, =0x00000cb4 - adds r0, r4 - ldr r1, [sp, 0x28] - adds r0, r1 - ldrh r2, [r0] - ldr r0, =0x0203bc8c - ldr r0, [r0] - lsls r2, 4 - adds r2, r0 - lsls r1, r6, 4 - adds r1, r0 - ldrb r0, [r2, 0xA] - ldrb r1, [r1, 0xA] - cmp r0, r1 - beq _081643C0 -_081643F4: - movs r5, 0x8 - cmp r5, r10 - bge _08164430 - ldr r2, =0x03005d90 - ldr r0, [r2] - ldr r1, =0x0203bc8c - ldr r3, [r1] - lsls r1, r6, 4 - adds r1, r3 - ldr r4, =0x00000cc4 - adds r2, r0, r4 - ldrh r0, [r1] - mov r12, r0 -_0816440E: - ldrh r0, [r2] - lsls r0, 4 - adds r0, r3 - ldrh r0, [r0] - cmp r0, r12 - beq _08164430 - ldrh r0, [r1] - ldr r4, [sp, 0x1C] - cmp r4, r0 - beq _08164430 - ldr r4, [sp, 0x20] - cmp r4, r0 - beq _08164430 - adds r2, 0x2 - adds r5, 0x1 - cmp r5, r10 - blt _0816440E -_08164430: - cmp r5, r10 - bne _081643C0 - ldr r1, =0x03005d90 - ldr r0, [r1] - ldr r2, =0x00000cb4 - adds r0, r2 - ldr r3, [sp, 0x38] - adds r0, r3 - strh r6, [r0] - ldr r4, [sp, 0x34] - mov r10, r4 - ldr r7, [sp, 0x30] - cmp r7, 0x1 - ble _081643A8 - ldr r0, [sp, 0x40] - adds r0, 0x18 - str r0, [sp, 0x40] - movs r1, 0x1 - add r9, r1 - mov r2, r9 - cmp r2, 0x5 - ble _0816438C - movs r3, 0 - mov r10, r3 - bl sub_8165B20 - movs r4, 0 - mov r9, r4 - ldr r0, =0x03005d90 - ldr r0, [r0] - movs r2, 0 - adds r6, r0, 0 - adds r6, 0xDC - mov r8, sp -_08164474: - ldrb r0, [r6] - lsls r4, r0, 25 - lsrs r0, r4, 30 - cmp r0, 0 - beq _081644E0 - ldr r1, =gUnknown_085DF9EC - ldrb r0, [r6, 0x1] - adds r0, r1 - ldrb r0, [r0] - movs r1, 0x7 - str r2, [sp, 0x44] - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - ldr r2, [sp, 0x44] - ldr r1, [sp, 0x18] - cmp r0, r1 - bgt _081644E0 - lsrs r0, r4, 30 - subs r0, 0x1 - ldr r3, [sp, 0x14] - cmp r0, r3 - bne _081644E0 - movs r5, 0 - ldr r0, =0x03005d90 - ldr r0, [r0] - adds r0, 0xE0 - adds r1, r2, r0 - movs r7, 0x2 -_081644B0: - ldrh r0, [r1] - ldr r4, [sp, 0x1C] - cmp r4, r0 - beq _081644C0 - ldr r3, [sp, 0x20] - cmp r3, r0 - beq _081644C0 - adds r5, 0x1 -_081644C0: - adds r1, 0xC - subs r7, 0x1 - cmp r7, 0 - bge _081644B0 - cmp r5, 0x2 - ble _081644E0 - movs r0, 0xC8 - lsls r0, 1 - add r0, r9 - mov r4, r8 - adds r4, 0x4 - mov r8, r4 - subs r4, 0x4 - stm r4!, {r0} - movs r0, 0x1 - add r10, r0 -_081644E0: - adds r2, 0x44 - adds r6, 0x44 - movs r1, 0x1 - add r9, r1 - mov r3, r9 - cmp r3, 0x3 - ble _08164474 - mov r4, r10 - cmp r4, 0 - beq _08164532 - bl GenerateRandomNumber - ldr r6, =0x03005d90 - ldr r4, [r6] - lsls r0, 16 - lsrs r0, 16 - mov r1, r10 - bl __modsi3 - lsls r0, 2 - add r0, sp - ldr r0, [r0] - movs r5, 0xCC - lsls r5, 4 - adds r4, r5 - strh r0, [r4] - ldrh r0, [r4] - bl sub_81627A4 - ldr r1, [sp, 0x24] - adds r1, 0xA8 - strb r0, [r1, 0x1] - movs r0, 0xD8 - lsls r0, 2 - bl FlagReset - ldr r0, [r6] - adds r0, r5 - ldrh r0, [r0] - bl sub_81640E0 -_08164532: - movs r0, 0 - mov r10, r0 - mov r9, r0 - mov r1, sp - str r1, [sp, 0x3C] -_0816453C: - ldr r0, =0x03005d90 - movs r2, 0xEC - mov r1, r9 - muls r1, r2 - movs r3, 0xE7 - lsls r3, 3 - adds r1, r3 - ldr r0, [r0] - movs r2, 0 - movs r3, 0 - movs r7, 0 - mov r4, r9 - adds r4, 0x1 - str r4, [sp, 0x2C] - adds r1, r0, r1 -_0816455A: - ldm r1!, {r0} - orrs r2, r0 - adds r3, r0 - adds r7, 0x1 - cmp r7, 0x39 - bls _0816455A - ldr r0, =0x03005d90 - ldr r5, [r0] - movs r1, 0xEC - mov r6, r9 - muls r6, r1 - adds r4, r5, r6 - ldr r1, =0x0000073a - adds r0, r4, r1 - ldrh r0, [r0] - movs r1, 0x7 - str r2, [sp, 0x44] - str r3, [sp, 0x48] - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - ldr r2, [sp, 0x44] - ldr r3, [sp, 0x48] - ldr r1, [sp, 0x18] - cmp r0, r1 - bgt _08164656 - movs r1, 0xE7 - lsls r1, 3 - adds r0, r4, r1 - ldrb r0, [r0] - ldr r4, [sp, 0x14] - cmp r0, r4 - bne _08164656 - cmp r2, 0 - beq _08164656 - adds r1, 0xE8 - adds r0, r5, r1 - adds r0, r6 - ldr r0, [r0] - cmp r0, r3 - bne _08164656 - movs r5, 0 - movs r7, 0 - ldr r2, =0x03005d90 - mov r8, r2 - ldr r3, =0x0000076c -_081645B8: - mov r4, r8 - ldr r2, [r4] - movs r0, 0x2C - adds r1, r7, 0 - muls r1, r0 - movs r4, 0xEC - mov r0, r9 - muls r0, r4 - adds r6, r1, r0 - adds r2, r6 - adds r0, r2, r3 - ldrh r0, [r0] - ldr r1, [sp, 0x1C] - cmp r1, r0 - beq _0816463C - ldr r4, [sp, 0x20] - cmp r4, r0 - beq _0816463C - movs r0, 0xEF - lsls r0, 3 - adds r4, r2, r0 - ldr r1, [sp, 0x14] - lsls r0, r1, 24 - lsrs r0, 24 - str r3, [sp, 0x48] - bl sub_8165C90 - ldrb r1, [r4] - lsls r0, 24 - lsrs r0, 24 - ldr r3, [sp, 0x48] - cmp r1, r0 - bhi _0816463C - mov r2, r8 - ldr r0, [r2] - adds r0, r6 - adds r0, r3 - ldrh r0, [r0] - cmp r0, 0 - b _08164638 - .pool -_08164638: - beq _0816463C - adds r5, 0x1 -_0816463C: - adds r7, 0x1 - cmp r7, 0x3 - ble _081645B8 - cmp r5, 0x1 - ble _08164656 - movs r0, 0x96 - lsls r0, 1 - add r0, r9 - ldr r3, [sp, 0x3C] - stm r3!, {r0} - str r3, [sp, 0x3C] - movs r4, 0x1 - add r10, r4 -_08164656: - ldr r0, [sp, 0x2C] - mov r9, r0 - cmp r0, 0x4 - bgt _08164660 - b _0816453C -_08164660: - mov r1, r10 - cmp r1, 0 - beq _081646A0 - bl GenerateRandomNumber - ldr r6, =0x03005d90 - ldr r4, [r6] - lsls r0, 16 - lsrs r0, 16 - mov r1, r10 - bl __modsi3 - lsls r0, 2 - add r0, sp - ldr r0, [r0] - ldr r5, =0x00000cc2 - adds r4, r5 - strh r0, [r4] - ldrh r0, [r4] - bl sub_81627A4 - ldr r1, [sp, 0x24] - adds r1, 0xC0 - strb r0, [r1, 0x1] - ldr r0, =0x00000361 - bl FlagReset - ldr r0, [r6] - adds r0, r5 - ldrh r0, [r0] - bl sub_8164188 -_081646A0: - 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_81642A0 - - thumb_func_start sub_81646BC -sub_81646BC: @ 81646BC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 16 - lsrs r4, r1, 16 - movs r0, 0 - mov r9, r0 - mov r10, r0 - bl sub_8165C40 - movs r0, 0xFA - lsls r0, 1 - cmp r5, r0 - beq _081647CE - subs r0, 0xC9 - cmp r5, r0 - bhi _081646FC - ldr r0, =0x0203bc8c - ldr r1, [r0] - lsls r0, r4, 4 - adds r0, r1 - ldrh r1, [r0, 0x2] - mov r9, r1 - ldrh r0, [r0] - mov r10, r0 - b _081647CE - .pool -_081646FC: - ldr r0, =0x0000018f - cmp r5, r0 - bhi _08164750 - ldr r0, =0x03005d90 - ldr r3, [r0] - ldr r1, =0x03006298 - ldr r0, =0x020375e2 - ldrh r0, [r0] - adds r0, 0x1 - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x2C - muls r1, r0 - ldr r0, =0xfffffed4 - adds r2, r5, r0 - movs r0, 0xEC - muls r0, r2 - adds r1, r0 - adds r3, r1 - movs r1, 0xEE - lsls r1, 3 - adds r0, r3, r1 - ldrh r0, [r0] - mov r9, r0 - ldr r2, =0x0000076c - adds r3, r2 - ldrh r3, [r3] - mov r10, r3 - b _081647CE - .pool -_08164750: - ldr r4, =0x03005d90 - ldr r3, [r4] - ldr r1, =0x03006298 - ldr r0, =0x020375e2 - ldrh r0, [r0] - subs r0, 0x1 - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - ldr r2, =0xfffffe70 - adds r1, r5, r2 - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r0, r2 - adds r3, r0 - adds r0, r3, 0 - adds r0, 0xE2 - ldrh r0, [r0] - mov r9, r0 - adds r3, 0xE0 - ldrh r3, [r3] - mov r10, r3 - movs r3, 0 - ldr r7, =0x02021ec4 - mov r8, r7 - adds r0, r4, 0 - mov r12, r0 - adds r4, r2, 0 - movs r6, 0x8A - lsls r6, 1 -_08164794: - mov r1, r8 - adds r2, r3, r1 - mov r1, r12 - ldr r0, [r1] - adds r1, r3, r4 - adds r0, r6 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - adds r3, 0x1 - cmp r3, 0x6 - ble _08164794 - adds r1, r3, r7 - movs r0, 0xFF - strb r0, [r1] - ldr r0, =0x03005d90 - ldr r2, [r0] - ldr r0, =0xfffffe70 - adds r1, r5, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, r0 - ldr r1, =0x0000011b - adds r0, r2, r1 - ldrb r1, [r0] - adds r0, r7, 0 - bl StopMusicWhileStringIsPrinted -_081647CE: - ldr r0, =0x02021cc4 - movs r1, 0xD - mov r2, r9 - muls r2, r1 - adds r1, r2, 0 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - ldr r0, =0x02021dc4 - movs r1, 0xB - mov r2, r10 - muls r2, r1 - adds r1, r2, 0 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81646BC - - thumb_func_start sub_8164828 -sub_8164828: @ 8164828 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - bl sub_8165C40 - bl sub_81A39C4 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r0, =0x020375f2 - ldrh r0, [r0] - subs r5, r0, 0x2 - ldr r0, =0x03005d90 - ldr r0, [r0] - lsls r1, r5, 1 - ldr r2, =0x00000cb4 - adds r0, r2 - adds r0, r1 - ldrh r7, [r0] - movs r3, 0 - str r3, [sp] - ldr r4, =gUnknown_085DD500 - lsls r6, r7, 16 - b _08164884 - .pool -_0816487C: - adds r4, 0x8 - ldr r0, [sp] - adds r0, 0x1 - str r0, [sp] -_08164884: - ldr r1, [sp] - cmp r1, 0x31 - bhi _0816489A - lsrs r0, r6, 16 - bl sub_8162D34 - lsls r0, 24 - lsrs r0, 24 - ldr r1, [r4] - cmp r1, r0 - bne _0816487C -_0816489A: - ldr r0, =0x020375e2 - ldrh r0, [r0] - cmp r0, 0x4 - bls _081648A4 - b _08164AC2 -_081648A4: - lsls r0, 2 - ldr r1, =_081648B8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081648B8: - .4byte _081648CC - .4byte _08164984 - .4byte _0816499C - .4byte _081649BC - .4byte _08164AC2 -_081648CC: - movs r0, 0xFA - lsls r0, 1 - cmp r7, r0 - bne _081648D6 - b _08164B54 -_081648D6: - subs r0, 0xC9 - cmp r7, r0 - ble _081648E2 - ldr r0, =0x0000018f - cmp r7, r0 - bgt _081648F4 -_081648E2: - ldr r0, =0x02021cc4 - adds r1, r7, 0 - bl sub_8162E20 - b _08164AC2 - .pool -_081648F4: - movs r3, 0 - lsls r2, r7, 16 - mov r10, r2 - ldr r6, =0x02021cc4 - mov r9, r6 - ldr r4, =0x03005d90 - mov r8, r4 - ldr r5, =0xfffffe70 - adds r1, r7, r5 - lsls r0, r1, 4 - adds r0, r1 - lsls r4, r0, 2 - movs r5, 0x8A - lsls r5, 1 -_08164910: - mov r0, r9 - adds r2, r3, r0 - mov r1, r8 - ldr r0, [r1] - adds r1, r3, r4 - adds r0, r5 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - adds r3, 0x1 - cmp r3, 0x6 - ble _08164910 - adds r1, r3, r6 - movs r0, 0xFF - strb r0, [r1] - ldr r2, =0x03005d90 - ldr r1, [r2] - ldr r3, =0xfffffe70 - adds r0, r7, r3 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - adds r1, r4 - ldr r5, =0x0000011b - adds r0, r1, r5 - ldrb r1, [r0] - adds r0, r6, 0 - bl StopMusicWhileStringIsPrinted - ldr r0, =0x02021dc4 - ldr r2, =0x03005d90 - ldr r1, [r2] - adds r1, r4 - adds r1, 0xDE - ldrb r1, [r1] - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r0, =0x02021ec4 - mov r3, r10 - lsrs r1, r3, 16 - bl sub_8162E20 - b _08164AC2 - .pool -_08164984: - ldr r0, =0x03005d90 - ldr r1, [r0] - lsls r0, r5, 2 - adds r1, r0 - ldr r4, =0x00000cc4 - adds r1, r4 - b _081649A8 - .pool -_0816499C: - ldr r0, =0x03005d90 - ldr r1, [r0] - lsls r0, r5, 2 - adds r1, r0 - ldr r5, =0x00000cc6 - adds r1, r5 -_081649A8: - adds r0, r7, 0 - ldrh r1, [r1] - bl sub_81646BC - b _08164AC2 - .pool -_081649BC: - ldr r0, =0x02038bce - strh r7, [r0] - ldr r0, =0x0000012b - cmp r7, r0 - bgt _08164A08 - ldr r0, =0x03005d90 - ldr r4, [r0] - lsls r1, r5, 1 - adds r0, r1, 0 - adds r0, 0x8 - lsls r0, 1 - ldr r3, =0x00000cb4 - adds r2, r4, r3 - adds r0, r2, r0 - ldrh r3, [r0] - ldr r5, =0x00000cd8 - adds r0, r4, r5 - strh r3, [r0] - adds r1, 0x9 - lsls r1, 1 - adds r2, r1 - ldrh r0, [r2] - ldr r1, =0x00000cda - adds r4, r1 - strh r0, [r4] - b _08164A46 - .pool -_08164A08: - ldr r0, =0x0000018f - cmp r7, r0 - bgt _08164A30 - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r3, =0x03006298 - ldrh r2, [r3, 0x4] - ldr r4, =0x00000cd8 - adds r0, r1, r4 - strh r2, [r0] - ldrh r0, [r3, 0x6] - b _08164A40 - .pool -_08164A30: - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r3, =0x03006298 - ldrh r2, [r3] - ldr r4, =0x00000cd8 - adds r0, r1, r4 - strh r2, [r0] - ldrh r0, [r3, 0x2] -_08164A40: - ldr r5, =0x00000cda - adds r1, r5 - strh r0, [r1] -_08164A46: - movs r5, 0 - mov r0, r8 - lsls r0, 24 - str r0, [sp, 0x4] -_08164A4E: - lsls r1, r5, 1 - mov r10, r1 - adds r2, r5, 0x1 - mov r9, r2 - lsrs r0, r5, 31 - adds r0, r5, r0 - asrs r0, 1 - lsls r0, 24 - mov r8, r0 -_08164A60: - ldr r3, [sp, 0x4] - lsrs r0, r3, 24 - mov r4, r8 - lsrs r1, r4, 24 - bl sub_8162548 - lsls r0, 16 - lsrs r3, r0, 16 - ldr r0, =0x02038bce - ldrh r0, [r0] - cmp r0, r3 - beq _08164A60 - movs r2, 0 - cmp r2, r5 - bge _08164AA2 - ldr r1, =0x03005d90 - ldr r0, [r1] - ldr r4, =0x00000cb4 - adds r0, r4 - ldrh r0, [r0] - cmp r0, r3 - beq _08164AA2 - adds r6, r1, 0 -_08164A8E: - adds r2, 0x1 - cmp r2, r5 - bge _08164AA2 - ldr r0, [r6] - lsls r1, r2, 1 - adds r0, r4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r3 - bne _08164A8E -_08164AA2: - cmp r2, r5 - bne _08164A60 - ldr r5, =0x03005d90 - ldr r0, [r5] - ldr r1, =0x00000cb4 - adds r0, r1 - add r0, r10 - strh r3, [r0] - mov r5, r9 - cmp r5, 0xD - ble _08164A4E - ldr r2, =0x03005d90 - ldr r0, [r2] - ldr r3, =0x00000cd6 - adds r0, r3 - strh r7, [r0] -_08164AC2: - movs r0, 0xFA - lsls r0, 1 - cmp r7, r0 - beq _08164B54 - subs r0, 0xC9 - cmp r7, r0 - bgt _08164AF8 - ldr r0, =gUnknown_085DD500 - ldr r4, [sp] - lsls r1, r4, 3 - b _08164B04 - .pool -_08164AF8: - ldr r0, =0x0000018f - cmp r7, r0 - bgt _08164B28 - ldr r0, =gUnknown_085DD500 - ldr r5, [sp] - lsls r1, r5, 3 -_08164B04: - adds r0, 0x4 - adds r1, r0 - ldr r0, =0x020375e2 - ldrh r0, [r0] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl box_related_two__2 - b _08164B54 - .pool -_08164B28: - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r0, =0xfffffe70 - adds r2, r7, r0 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0 - adds r1, 0xDC - ldrb r0, [r1] - lsls r0, 27 - ldr r1, =gUnknown_085DD690 - lsrs r0, 25 - adds r0, r1 - ldr r1, =0x020375e2 - ldrh r1, [r1] - ldr r0, [r0] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 -_08164B54: - 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_8164828 - - thumb_func_start sub_8164B74 -sub_8164B74: @ 8164B74 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - ldr r4, =0x03005d90 - 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, 16 - lsrs r5, r0, 16 - ldr r0, [r4] - ldr r2, =0x00000cb2 - adds r0, r2 - ldrh r6, [r0] - bl link_get_multiplayer_id - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0x6 - bls _08164BAC - b _08164DB6 -_08164BAC: - lsls r0, 2 - ldr r1, =_08164BD0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08164BD0: - .4byte _08164BEC - .4byte _08164C3C - .4byte _08164CE0 - .4byte _08164D14 - .4byte _08164D98 - .4byte _08164DA8 - .4byte _08164DB6 -_08164BEC: - cmp r5, 0x3 - beq _08164BF2 - b _08164DB0 -_08164BF2: - ldr r0, =0x03005d90 - ldr r0, [r0] - lsls r1, r7, 1 - adds r0, r1 - ldr r3, =0x00000cec - adds r0, r3 - ldrh r0, [r0] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp] - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - bne _08164C18 - b _08164DB6 -_08164C18: - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - mov r1, sp - movs r2, 0x4 - bl link_0800A448 - ldr r1, =0x020375f0 - movs r0, 0x1 - b _08164DB4 - .pool -_08164C3C: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - beq _08164C4A - b _08164DB6 -_08164C4A: - bl sub_800A5B4 - ldr r1, =0x020223c4 - movs r0, 0x80 - lsls r0, 1 - adds r2, r1, r0 - ldrh r0, [r1] - ldrh r3, [r2] - cmp r0, r3 - bhi _08164C60 - ldrh r0, [r2] -_08164C60: - str r0, [sp] - movs r4, 0 - ldr r0, =0x03005d90 - mov r9, r0 -_08164C68: - adds r1, r4, 0x1 - mov r8, r1 - lsrs r0, r4, 31 - adds r0, r4, r0 - asrs r0, 1 - lsls r7, r0, 24 -_08164C74: - ldr r0, [sp] - lsls r0, 24 - lsrs r0, 24 - lsrs r1, r7, 24 - bl sub_8162548 - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - cmp r2, r4 - bge _08164CB0 - mov r1, r9 - ldr r0, [r1] - ldr r1, =0x00000cb4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r3 - beq _08164CB0 - ldr r6, =0x03005d90 - adds r5, r1, 0 -_08164C9C: - adds r2, 0x1 - cmp r2, r4 - bge _08164CB0 - ldr r0, [r6] - lsls r1, r2, 1 - adds r0, r5 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r3 - bne _08164C9C -_08164CB0: - cmp r4, r2 - bne _08164C74 - mov r2, r9 - ldr r0, [r2] - lsls r1, r4, 1 - ldr r2, =0x00000cb4 - adds r0, r2 - adds r0, r1 - strh r3, [r0] - mov r4, r8 - cmp r4, 0xD - ble _08164C68 - ldr r1, =0x020375f0 - movs r0, 0x2 - b _08164DB4 - .pool -_08164CE0: - bl sub_800A520 - lsls r0, 24 - cmp r0, 0 - beq _08164DB6 - bl bitmask_all_link_players_but_self - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005d90 - ldr r1, [r1] - ldr r3, =0x00000cb4 - adds r1, r3 - movs r2, 0x28 - bl link_0800A448 - ldr r1, =0x020375f0 - movs r0, 0x3 - b _08164DB4 - .pool -_08164D14: - bl sub_800A550 - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x3 - bne _08164DB6 - bl sub_800A5B4 - ldr r4, =0x03005d90 - ldr r0, [r4] - ldr r5, =0x00000cb4 - adds r0, r5 - ldr r1, =0x020223c4 - movs r2, 0x28 - bl memcpy - ldr r2, =0x02038bca - ldr r1, [r4] - lsls r0, r6, 2 - adds r1, r5 - adds r0, r1, r0 - ldrh r0, [r0] - strh r0, [r2] - ldr r4, =0x02038bcc - lsls r0, r6, 1 - adds r0, 0x1 - lsls r0, 1 - adds r1, r0 - ldrh r0, [r1] - strh r0, [r4] - ldrh r0, [r2] - movs r1, 0 - bl sub_8162614 - ldrh r0, [r4] - movs r1, 0x1 - bl sub_8162614 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - beq _08164DB0 - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - bne _08164DB0 - ldr r1, =0x020375f0 - movs r0, 0x4 - b _08164DB4 - .pool -_08164D98: - bl sub_800AC34 - ldr r1, =0x020375f0 - movs r0, 0x5 - b _08164DB4 - .pool -_08164DA8: - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08164DB6 -_08164DB0: - ldr r1, =0x020375f0 - movs r0, 0x6 -_08164DB4: - strh r0, [r1] -_08164DB6: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8164B74 - - thumb_func_start sub_8164DCC -sub_8164DCC: @ 8164DCC - push {lr} - ldr r0, =0x030030fc - ldrb r0, [r0] - cmp r0, 0 - beq _08164DDA - bl sub_800AC34 -_08164DDA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8164DCC - - thumb_func_start sub_8164DE4 -sub_8164DE4: @ 8164DE4 - push {lr} - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000cd6 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0xF - bl sub_8162614 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8164DE4 - - thumb_func_start sub_8164E04 -sub_8164E04: @ 8164E04 - push {r4-r6,lr} - sub sp, 0x20 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 16 - cmp r0, 0 - bne _08164E9A - ldr r5, =0x02038bca - ldrh r1, [r5] - mov r0, sp - bl sub_8162E20 - mov r0, sp - bl StripExtendedControlCodes - ldr r4, =0x03005d90 - ldr r0, [r4] - ldr r1, =0x00000bd8 - adds r0, r1 - mov r1, sp - bl CopyString - ldr r0, [r4] - ldr r2, =0x00000beb - adds r0, r2 - ldrh r1, [r5] - bl sub_8165B88 - ldr r6, =0x0202406e - ldrh r0, [r6, 0x2] - movs r5, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - ldr r1, [r4] - ldr r2, =0x00000bd6 - adds r1, r2 - strh r0, [r1] - ldrh r0, [r6] - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - ldr r1, [r4] - ldr r2, =0x00000bd4 - adds r1, r2 - strh r0, [r1] - movs r2, 0 - movs r5, 0xBE - lsls r5, 4 - ldr r3, =0x020240b4 - adds r6, r4, 0 -_08164E7C: - ldr r0, [r4] - adds r0, r5 - adds r0, r2 - adds r1, r2, r3 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0xA - ble _08164E7C - ldr r0, [r6] - ldr r1, =0x0202433a - ldrb r1, [r1] - ldr r2, =0x00000d06 - adds r0, r2 - strb r1, [r0] -_08164E9A: - add sp, 0x20 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8164E04 - - thumb_func_start sub_8164ED8 -sub_8164ED8: @ 8164ED8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x03005d90 - ldr r0, [r0] - movs r3, 0 - movs r2, 0 - ldr r4, =0x0000064c - adds r1, r0, r4 -_08164EEA: - ldm r1!, {r0} - adds r3, r0 - adds r2, 0x1 - cmp r2, 0x39 - bls _08164EEA - ldr r5, =0x03005d90 - ldr r1, [r5] - ldr r2, =0x00000734 - adds r0, r1, r2 - ldr r0, [r0] - cmp r0, r3 - beq _08164F0A - ldr r3, =0x0000064c - adds r0, r1, r3 - bl sub_8164FB8 -_08164F0A: - movs r4, 0 - adds r7, r5, 0 - movs r6, 0xEC - mov r8, r7 -_08164F12: - adds r0, r4, 0 - muls r0, r6 - movs r1, 0xE7 - lsls r1, 3 - adds r0, r1 - ldr r1, [r7] - movs r3, 0 - movs r2, 0 - adds r5, r4, 0x1 - adds r1, r0 -_08164F26: - ldm r1!, {r0} - adds r3, r0 - adds r2, 0x1 - cmp r2, 0x39 - bls _08164F26 - mov r0, r8 - ldr r2, [r0] - adds r1, r4, 0 - muls r1, r6 - movs r4, 0x82 - lsls r4, 4 - adds r0, r2, r4 - adds r0, r1 - ldr r0, [r0] - cmp r0, r3 - beq _08164F52 - movs r3, 0xE7 - lsls r3, 3 - adds r0, r1, r3 - adds r0, r2, r0 - bl sub_8164FB8 -_08164F52: - adds r4, r5, 0 - cmp r4, 0x4 - ble _08164F12 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8164ED8 - - thumb_func_start sub_8164F70 -sub_8164F70: @ 8164F70 - push {r4,lr} - adds r2, r0, 0 - adds r2, 0xE8 - movs r1, 0 - str r1, [r2] - movs r3, 0 - adds r4, r0, 0 -_08164F7E: - ldr r0, [r2] - ldm r4!, {r1} - adds r0, r1 - str r0, [r2] - adds r3, 0x1 - cmp r3, 0x39 - bls _08164F7E - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8164F70 - - thumb_func_start sub_8164F94 -sub_8164F94: @ 8164F94 - push {r4,lr} - adds r2, r0, 0 - adds r2, 0xA0 - movs r1, 0 - str r1, [r2] - movs r3, 0 - adds r4, r0, 0 -_08164FA2: - ldr r0, [r2] - ldm r4!, {r1} - adds r0, r1 - str r0, [r2] - adds r3, 0x1 - cmp r3, 0x27 - bls _08164FA2 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8164F94 - - thumb_func_start sub_8164FB8 -sub_8164FB8: @ 8164FB8 - push {lr} - movs r1, 0 - movs r2, 0 -_08164FBE: - stm r0!, {r2} - adds r1, 0x1 - cmp r1, 0x3A - bls _08164FBE - pop {r0} - bx r0 - thumb_func_end sub_8164FB8 - - thumb_func_start sub_8164FCC -sub_8164FCC: @ 8164FCC - push {lr} - lsls r0, 24 - lsls r1, 24 - ldr r2, =0x03005d90 - ldr r2, [r2] - lsrs r0, 23 - lsrs r1, 22 - adds r0, r1 - movs r1, 0xCE - lsls r1, 4 - adds r2, r1 - adds r2, r0 - ldrh r0, [r2] - ldr r1, =0x0000270f - cmp r0, r1 - bls _08164FEE - adds r0, r1, 0 -_08164FEE: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8164FCC - - thumb_func_start sub_8164FFC -sub_8164FFC: @ 8164FFC - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_085DFA42 - mov r0, sp - movs r2, 0x4 - bl memcpy - cmp r4, 0x3 - bls _0816501C - movs r0, 0x3 - b _08165022 - .pool -_0816501C: - mov r1, sp - adds r0, r1, r4 - ldrb r0, [r0] -_08165022: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8164FFC - - thumb_func_start sub_816502C -sub_816502C: @ 816502C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - adds r5, r0, 0 - ldr r0, =0x000040ce - bl VarGet - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - bl sub_8164FFC - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r2, 0x44 - mov r10, r2 - cmp r5, 0 - beq _0816506A - movs r0, 0x45 - mov r10, r0 -_0816506A: - ldr r1, =0x020375f0 - mov r9, r1 - movs r0, 0 - strh r0, [r1] - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8164FCC - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x37 - bls _081650DC - movs r6, 0 - cmp r6, r8 - bge _081650DC - ldr r7, =0x03005d8c - mov r5, sp -_0816508C: - ldr r0, =0x03005d90 - ldr r0, [r0] - lsls r1, r6, 1 - ldr r2, =0x00000caa - adds r0, r2 - adds r0, r1 - ldrh r1, [r0] - subs r1, 0x1 - movs r0, 0 - strb r1, [r5] - strb r0, [r5, 0x1] - movs r0, 0x64 - muls r0, r1 - movs r1, 0x8E - lsls r1, 2 - adds r4, r0, r1 - ldr r0, [r7] - adds r0, r4 - mov r1, r10 - bl pokemon_getattr - cmp r0, 0 - bne _081650D4 - movs r0, 0x1 - mov r2, r9 - strh r0, [r2] - ldr r0, [r7] - adds r0, r4 - mov r1, r10 - bl pokemon_setattr - ldr r0, [r7] - adds r0, r4 - bl sub_80EE5A4 - strb r0, [r5, 0x1] -_081650D4: - adds r5, 0x4 - adds r6, 0x1 - cmp r6, r8 - blt _0816508C -_081650DC: - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0 - beq _08165132 - movs r0, 0x2A - bl sav12_xor_increment - mov r0, r8 - cmp r0, 0x1 - ble _08165110 - mov r3, sp - add r2, sp, 0x4 - mov r6, r8 - subs r6, 0x1 -_081650F8: - ldrb r1, [r3, 0x1] - ldrb r0, [r2, 0x1] - cmp r0, r1 - bls _08165108 - ldr r1, [sp] - ldr r0, [r2] - str r0, [sp] - str r1, [r2] -_08165108: - adds r2, 0x4 - subs r6, 0x1 - cmp r6, 0 - bne _081650F8 -_08165110: - mov r0, sp - ldrb r0, [r0, 0x1] - cmp r0, 0x4 - bls _08165132 - ldr r2, =0x03005d8c - mov r0, sp - ldrb r1, [r0] - movs r0, 0x64 - muls r1, r0 - movs r0, 0x8E - lsls r0, 2 - adds r1, r0 - ldr r0, [r2] - adds r0, r1 - mov r1, r10 - bl sub_80EE4DC -_08165132: - 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_816502C - - thumb_func_start sub_816515C -sub_816515C: @ 816515C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r1, =0x03005d90 - ldr r2, [r1] - ldr r0, =0x00000bec - adds r7, r2, r0 - ldrb r0, [r2, 0x8] - adds r5, r1, 0 - cmp r0, 0 - beq _08165194 - ldr r4, =gUnknown_085DCEFA - ldrb r0, [r2, 0xA] - ldrb r1, [r2, 0xB] - adds r0, r1 - ldrb r1, [r2, 0xC] - adds r0, r1 - ldrb r1, [r2, 0xD] - adds r0, r1 - movs r1, 0x14 - b _081651A6 - .pool -_08165194: - ldr r4, =gUnknown_085DCEDC - ldrb r0, [r2, 0xA] - ldrb r1, [r2, 0xB] - adds r0, r1 - ldrb r1, [r2, 0xC] - adds r0, r1 - ldrb r1, [r2, 0xD] - adds r0, r1 - movs r1, 0x1E -_081651A6: - bl __umodsi3 - adds r0, r4 - ldrb r0, [r0] - strb r0, [r7, 0x1] - adds r0, r7, 0 - adds r0, 0xC - ldr r1, [r5] - adds r1, 0xA - bl sub_80842F4 - adds r0, r7, 0x4 - ldr r1, [r5] - bl CopyString_Limit7 - movs r0, 0x1 - strh r0, [r7, 0x2] - movs r6, 0x7 - movs r4, 0 - ldr r0, =0x03005d8c - mov r8, r0 - adds r5, r7, 0 - adds r5, 0x10 - ldr r1, =0x00002bbc - mov r12, r1 - adds r3, r7, 0 - adds r3, 0x28 - adds r2, r7, 0 - adds r2, 0x1C -_081651E0: - lsls r0, r4, 1 - mov r9, r0 - mov r1, r8 - ldr r0, [r1] - add r0, r12 - add r0, r9 - ldrh r0, [r0] - strh r0, [r5] - strh r6, [r2] - adds r0, r6, 0x6 - strh r0, [r3] - adds r6, 0x1 - adds r5, 0x2 - adds r3, 0x2 - adds r2, 0x2 - adds r4, 0x1 - cmp r4, 0x5 - ble _081651E0 - movs r4, 0 -_08165206: - movs r0, 0x64 - muls r0, r4 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2C - muls r1, r4 - adds r1, 0x34 - adds r1, r7, r1 - bl sub_80686FC - adds r4, 0x1 - cmp r4, 0x2 - ble _08165206 - adds r0, r7, 0 - bl sub_8165328 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816515C - - thumb_func_start sub_8165244 -sub_8165244: @ 8165244 - ldr r1, =gTrainerPicIndices - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r2, =0x00000bed - adds r0, r2 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8165244 - - thumb_func_start sub_8165264 -sub_8165264: @ 8165264 - ldr r1, =gTrainerClassNameIndices - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r2, =0x00000bed - adds r0, r2 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8165264 - - thumb_func_start sub_8165284 -sub_8165284: @ 8165284 - push {r4,lr} - adds r3, r0, 0 - movs r2, 0 - ldr r0, =0x03005d90 - ldr r0, [r0] - movs r1, 0xBF - lsls r1, 4 - adds r4, r0, r1 -_08165294: - adds r0, r3, r2 - adds r1, r4, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x4 - ble _08165294 - adds r1, r3, r2 - movs r0, 0xFF - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8165284 - - thumb_func_start sub_81652B4 -sub_81652B4: @ 81652B4 - push {r4-r6,lr} - ldr r2, =0x020375f0 - movs r0, 0 - strh r0, [r2] - ldr r1, =0x03005d90 - ldr r0, [r1] - ldr r3, =0x00000bec - adds r5, r0, r3 - movs r4, 0 - movs r3, 0 - adds r6, r1, 0 - adds r1, r5, 0 -_081652CC: - ldm r1!, {r0} - orrs r4, r0 - adds r3, 0x1 - cmp r3, 0x2D - bls _081652CC - cmp r4, 0 - bne _081652EC - movs r0, 0x1 - strh r0, [r2] - b _08165316 - .pool -_081652EC: - movs r4, 0 - movs r3, 0 - adds r2, r5, 0 -_081652F2: - ldm r2!, {r0} - adds r4, r0 - adds r3, 0x1 - cmp r3, 0x2D - bls _081652F2 - ldr r1, [r6] - ldr r2, =0x00000ca4 - adds r0, r1, r2 - ldr r0, [r0] - cmp r0, r4 - beq _08165316 - ldr r3, =0x00000bec - adds r0, r1, r3 - bl sub_816534C - ldr r1, =0x020375f0 - movs r0, 0x1 - strh r0, [r1] -_08165316: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81652B4 - - thumb_func_start sub_8165328 -sub_8165328: @ 8165328 - push {r4,lr} - adds r2, r0, 0 - adds r2, 0xB8 - movs r1, 0 - str r1, [r2] - movs r3, 0 - adds r4, r0, 0 -_08165336: - ldr r0, [r2] - ldm r4!, {r1} - adds r0, r1 - str r0, [r2] - adds r3, 0x1 - cmp r3, 0x2D - bls _08165336 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8165328 - - thumb_func_start sub_816534C -sub_816534C: @ 816534C - push {lr} - movs r1, 0 - movs r2, 0 -_08165352: - stm r0!, {r2} - adds r1, 0x1 - cmp r1, 0x2E - bls _08165352 - pop {r0} - bx r0 - thumb_func_end sub_816534C - - thumb_func_start sub_8165360 -sub_8165360: @ 8165360 - push {lr} - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000bfc - adds r0, r1 - bl ConvertBattleFrontierTrainerSpeechToString - pop {r0} - bx r0 - .pool - thumb_func_end sub_8165360 - - thumb_func_start sub_816537C -sub_816537C: @ 816537C - push {lr} - ldr r0, =0x0202433a - ldrb r0, [r0] - cmp r0, 0x3 - bne _08165398 - ldr r1, =0x02021fc4 - movs r0, 0xFF - strb r0, [r1] - b _081653C0 - .pool -_08165398: - cmp r0, 0x1 - bne _081653B4 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000c14 - adds r0, r1 - bl ConvertBattleFrontierTrainerSpeechToString - b _081653C0 - .pool -_081653B4: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000c08 - adds r0, r1 - bl ConvertBattleFrontierTrainerSpeechToString -_081653C0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_816537C - - thumb_func_start sub_81653CC -sub_81653CC: @ 81653CC - push {lr} - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000ca8 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081653E0 - bl sub_80F01B8 -_081653E0: - movs r0, 0x77 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081653F8 - bl sub_80F01B8 - movs r0, 0x77 - bl FlagReset -_081653F8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81653CC - - thumb_func_start sub_8165404 -sub_8165404: @ 8165404 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x70 - lsls r0, 16 - lsrs r7, r0, 16 - bl sub_8165C40 - ldr r0, =0x00000c03 - cmp r7, r0 - beq _08165420 - b _0816554C -_08165420: - movs r0, 0 - mov r10, r0 - mov r1, sp - adds r1, 0x44 - str r1, [sp, 0x64] -_0816542A: - mov r2, r10 - lsls r2, 2 - mov r9, r2 - mov r3, r10 - adds r3, 0x1 - str r3, [sp, 0x60] - mov r0, r9 - add r0, r10 - lsls r0, 2 - ldr r6, =gUnknown_085DD6D0 - adds r5, r0, r6 -_08165440: - bl GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - str r4, [sp, 0x44] - ldr r0, =0x0000ef2a - adds r1, r4, 0 - bl sub_806EBD0 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0 - bne _08165440 - ldr r0, [sp, 0x44] - bl GetNatureFromPersonality - ldrb r1, [r5, 0x4] - lsls r0, 24 - lsrs r0, 24 - cmp r1, r0 - bne _08165440 - movs r0, 0x64 - mov r6, r10 - muls r6, r0 - ldr r1, =0x02024618 - mov r8, r1 - adds r0, r6, r1 - mov r5, r9 - add r5, r10 - lsls r5, 2 - ldr r2, =gUnknown_085DD6D0 - adds r3, r5, r2 - ldrh r1, [r3] - ldrb r2, [r3, 0x3] - ldrb r3, [r3, 0x2] - mov r12, r3 - movs r4, 0x1 - str r4, [sp] - mov r3, r10 - str r3, [sp, 0x4] - str r4, [sp, 0x8] - ldr r4, =0x0000ef2a - str r4, [sp, 0xC] - mov r3, r12 - bl create_pokemon_set_level - str r7, [sp, 0x44] - movs r3, 0 - mov r4, r8 - ldr r0, =gUnknown_085DD6D5 - adds r5, r0 -_081654B0: - adds r1, r3, 0 - adds r1, 0x1A - adds r2, r5, r3 - adds r0, r6, r4 - bl pokemon_setattr - ldr r0, [sp, 0x44] - adds r0, 0x1 - str r0, [sp, 0x44] - adds r3, r0, 0 - cmp r3, 0x5 - ble _081654B0 - movs r0, 0 - str r0, [sp, 0x44] - movs r1, 0 - movs r6, 0x64 - mov r4, r10 - muls r4, r6 - ldr r7, =gUnknown_085DD6DC - ldr r6, =0x02024618 - mov r0, r9 - add r0, r10 - lsls r5, r0, 2 -_081654DE: - lsls r0, r1, 1 - adds r0, r5 - adds r0, r7 - ldrh r1, [r0] - ldr r0, [sp, 0x64] - ldrb r2, [r0] - adds r0, r4, r6 - bl sub_80691F4 - ldr r0, [sp, 0x44] - adds r0, 0x1 - str r0, [sp, 0x44] - adds r1, r0, 0 - cmp r1, 0x3 - ble _081654DE - movs r1, 0x64 - mov r4, r10 - muls r4, r1 - ldr r0, =0x02024618 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x7 - ldr r2, =gTrainers + TRAINER_STEVEN * 0x28 + 0x4 @ Steven's name - bl pokemon_setattr - movs r0, 0 - str r0, [sp, 0x44] - adds r0, r4, 0 - movs r1, 0x31 - ldr r2, [sp, 0x64] - bl pokemon_setattr - adds r0, r4, 0 - bl pokemon_calc_effective_stats - ldr r2, [sp, 0x60] - mov r10, r2 - cmp r2, 0x2 - bgt _0816552E - b _0816542A -_0816552E: - b _0816585A - .pool -_0816554C: - movs r0, 0xFA - lsls r0, 1 - cmp r7, r0 - bne _08165564 - add r0, sp, 0x10 - ldr r1, =gUnknown_82E9531 - ldrb r1, [r1] - strb r1, [r0] - b _0816585A - .pool -_08165564: - ldr r0, =0x0000012b - cmp r7, r0 - bls _0816556C - b _081656E8 -_0816556C: - bl sub_8165C40 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x50] - adds r0, r7, 0 - bl sub_8165D08 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4C] - bl GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - str r4, [sp, 0x58] - movs r3, 0 - mov r10, r3 - mov r6, sp - adds r6, 0x44 - str r6, [sp, 0x64] - mov r0, sp - adds r0, 0x48 - str r0, [sp, 0x5C] -_081655A6: - ldr r0, =0x03005d90 - ldr r1, [r0] - mov r0, r10 - adds r0, 0x12 - lsls r0, 1 - ldr r2, =0x00000cb4 - adds r1, r2 - adds r1, r0 - ldrh r1, [r1] - str r1, [sp, 0x54] - movs r6, 0x64 - mov r3, r10 - muls r3, r6 - mov r8, r3 - ldr r0, =0x02024618 - mov r9, r0 - mov r0, r8 - add r0, r9 - ldr r6, =0x0203bc8c - ldr r4, [r6] - lsls r5, r1, 4 - adds r4, r5, r4 - ldrh r1, [r4] - ldr r3, [sp, 0x50] - lsls r2, r3, 24 - ldrb r3, [r4, 0xC] - mov r12, r3 - ldr r3, [sp, 0x4C] - str r3, [sp] - ldrb r4, [r4, 0xB] - str r4, [sp, 0x4] - ldr r3, [sp, 0x58] - str r3, [sp, 0x8] - lsrs r2, 24 - mov r3, r12 - bl sub_8068634 - movs r0, 0xFF - str r0, [sp, 0x48] - movs r0, 0 - str r0, [sp, 0x44] - movs r2, 0 - mov r0, r10 - adds r0, 0x1 - str r0, [sp, 0x60] - mov r4, r8 - mov r3, r9 -_08165604: - ldr r0, [r6] - adds r0, r5, r0 - lsls r1, r2, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r1, [r0] - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, r3 - str r3, [sp, 0x68] - bl sub_80691F4 - ldr r0, [r6] - adds r0, r5, r0 - ldr r2, [sp, 0x44] - lsls r1, r2, 1 - adds r0, 0x2 - adds r0, r1 - ldrh r0, [r0] - ldr r3, [sp, 0x68] - cmp r0, 0xDA - bne _08165634 - movs r0, 0 - str r0, [sp, 0x48] -_08165634: - adds r0, r2, 0x1 - str r0, [sp, 0x44] - adds r2, r0, 0 - cmp r2, 0x3 - ble _08165604 - movs r1, 0x64 - mov r4, r10 - muls r4, r1 - ldr r0, =0x02024618 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x20 - ldr r2, [sp, 0x5C] - bl pokemon_setattr - ldr r0, =0x0203bc8c - ldr r1, [r0] - ldr r2, [sp, 0x54] - lsls r0, r2, 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 pokemon_setattr - movs r0, 0 - str r0, [sp, 0x44] - movs r2, 0 - ldr r0, =0x0203bc88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r7 - adds r0, r1 - adds r3, r0, 0x4 -_0816567E: - mov r1, sp - adds r1, r2 - adds r1, 0x10 - adds r0, r3, r2 - ldrb r0, [r0] - strb r0, [r1] - ldr r0, [sp, 0x44] - adds r0, 0x1 - str r0, [sp, 0x44] - adds r2, r0, 0 - cmp r2, 0x7 - ble _0816567E - movs r3, 0x64 - mov r4, r10 - muls r4, r3 - ldr r0, =0x02024618 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x7 - add r2, sp, 0x10 - bl pokemon_setattr - adds r0, r7, 0 - bl sub_8162F68 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x44] - adds r0, r4, 0 - movs r1, 0x31 - ldr r2, [sp, 0x64] - bl pokemon_setattr - ldr r6, [sp, 0x60] - mov r10, r6 - cmp r6, 0x1 - bgt _081656CA - b _081655A6 -_081656CA: - b _0816585A - .pool -_081656E8: - ldr r0, =0x0000018f - cmp r7, r0 - bls _081656F0 - b _081657F0 -_081656F0: - ldr r1, =0xfffffed4 - adds r0, r7, r1 - lsls r0, 16 - lsrs r7, r0, 16 - movs r2, 0 - mov r10, r2 - mov r3, sp - adds r3, 0x44 - str r3, [sp, 0x64] - add r5, sp, 0x18 - ldr r6, =0x000015fc - mov r9, r6 - ldr r0, =0x0000ffff - mov r8, r0 - movs r1, 0x24 - str r1, [sp, 0x6C] -_08165710: - ldr r1, =0x03005d90 - movs r0, 0xEC - adds r4, r7, 0 - muls r4, r0 - movs r2, 0xE7 - lsls r2, 3 - adds r4, r2 - ldr r0, [r1] - adds r4, r0, r4 - ldr r3, =0x00000cb4 - adds r0, r3 - ldr r6, [sp, 0x6C] - adds r0, r6 - ldrh r1, [r0] - movs r0, 0x2C - muls r1, r0 - adds r1, r4, r1 - adds r0, r5, 0 - adds r1, 0x34 - ldm r1!, {r2,r3,r6} - stm r0!, {r2,r3,r6} - ldm r1!, {r2,r3,r6} - stm r0!, {r2,r3,r6} - ldm r1!, {r2,r3,r6} - stm r0!, {r2,r3,r6} - ldm r1!, {r2,r3} - stm r0!, {r2,r3} - adds r1, r4, 0x4 - add r0, sp, 0x10 - bl CopyString - adds r4, 0xE4 - ldrb r0, [r4] - cmp r0, 0x1 - bne _0816578C - ldrh r0, [r5, 0x20] - mov r6, r8 - ands r0, r6 - cmp r0, r9 - beq _0816579C - mov r1, sp - adds r1, 0x3D - movs r0, 0xFF - strb r0, [r1] - add r0, sp, 0x38 - movs r1, 0x1 - bl StopMusicWhileStringIsPrinted - b _0816579C - .pool -_0816578C: - ldrh r0, [r5, 0x20] - mov r1, r8 - ands r0, r1 - cmp r0, r9 - bne _0816579C - add r1, sp, 0x10 - movs r0, 0xFF - strb r0, [r1, 0x5] -_0816579C: - movs r0, 0x64 - mov r4, r10 - muls r4, r0 - ldr r0, =0x02024618 - adds r4, r0 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl sub_8068338 - adds r0, r4, 0 - movs r1, 0x7 - add r2, sp, 0x10 - bl pokemon_setattr - movs r2, 0x96 - lsls r2, 1 - adds r0, r7, r2 - lsls r0, 16 - lsrs r0, 16 - bl sub_8162F68 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x44] - adds r0, r4, 0 - movs r1, 0x31 - ldr r2, [sp, 0x64] - bl pokemon_setattr - ldr r3, [sp, 0x6C] - adds r3, 0x2 - str r3, [sp, 0x6C] - movs r6, 0x1 - add r10, r6 - mov r0, r10 - cmp r0, 0x1 - ble _08165710 - b _0816585A - .pool -_081657F0: - ldr r1, =0xfffffe70 - adds r0, r7, r1 - lsls r0, 16 - lsrs r7, r0, 16 - movs r2, 0 - mov r10, r2 - mov r3, sp - adds r3, 0x44 - str r3, [sp, 0x64] - ldr r6, =0x03005d90 - mov r8, r6 - movs r5, 0x24 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r6, r0, 0 - adds r6, 0xDC -_08165812: - movs r0, 0x64 - mov r4, r10 - muls r4, r0 - ldr r0, =0x02024618 - adds r4, r0 - mov r1, r8 - ldr r0, [r1] - adds r1, r0, r6 - ldr r2, =0x00000cb4 - adds r0, r2 - adds r0, r5 - ldrb r2, [r0] - adds r0, r4, 0 - bl sub_8068528 - movs r3, 0xC8 - lsls r3, 1 - adds r0, r7, r3 - lsls r0, 16 - lsrs r0, 16 - bl sub_8162F68 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x44] - adds r0, r4, 0 - movs r1, 0x31 - ldr r2, [sp, 0x64] - bl pokemon_setattr - adds r5, 0x2 - movs r0, 0x1 - add r10, r0 - mov r1, r10 - cmp r1, 0x1 - ble _08165812 -_0816585A: - add sp, 0x70 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8165404 - - thumb_func_start sub_816587C -sub_816587C: @ 816587C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - adds r6, r0, 0 - adds r5, r1, 0 - movs r2, 0 - adds r1, r6, 0 - adds r3, r6, 0 - adds r3, 0x58 -_08165894: - ldrh r0, [r1, 0x1C] - cmp r0, 0 - beq _0816589C - adds r2, 0x1 -_0816589C: - adds r1, 0x2C - cmp r1, r3 - ble _08165894 - cmp r2, 0x3 - beq _081658B4 - adds r0, r5, 0 - movs r1, 0 - movs r2, 0xEC - bl memset - movs r0, 0 - b _081659BE -_081658B4: - ldrb r0, [r6] - strb r0, [r5] - ldrh r0, [r6, 0x2] - strh r0, [r5, 0x2] - movs r2, 0 - ldr r0, =gUnknown_085DCF40 - ldrb r1, [r0] - ldrb r3, [r6, 0x1] - mov r12, r0 - adds r4, r5, 0x4 - adds r7, r6, 0x4 - movs r0, 0xC - adds r0, r5 - mov r9, r0 - movs r0, 0xC - adds r0, r6 - mov r8, r0 - adds r0, r5, 0 - adds r0, 0x10 - str r0, [sp, 0x4] - movs r0, 0x10 - adds r0, r6 - mov r10, r0 - adds r0, r5, 0 - adds r0, 0x1C - str r0, [sp, 0x8] - adds r0, 0xC - str r0, [sp, 0xC] - adds r0, 0x90 - str r0, [sp, 0x10] - cmp r1, r3 - beq _08165904 - mov r1, r12 -_081658F6: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, 0x51 - bgt _08165904 - ldrb r0, [r1] - cmp r0, r3 - bne _081658F6 -_08165904: - cmp r2, 0x52 - beq _08165918 - lsls r0, r2, 1 - mov r1, r12 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - b _0816591A - .pool -_08165918: - movs r0, 0x2B -_0816591A: - strb r0, [r5, 0x1] - movs r2, 0 - adds r3, r7, 0 -_08165920: - adds r0, r4, r2 - adds r1, r3, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x7 - ble _08165920 - movs r2, 0 - mov r4, r9 - mov r3, r8 -_08165934: - adds r0, r4, r2 - adds r1, r3, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x3 - ble _08165934 - mov r3, r10 - ldr r1, [sp, 0x4] - movs r2, 0x5 -_08165948: - ldrh r0, [r3] - strh r0, [r1] - adds r3, 0x2 - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _08165948 - ldr r3, =gUnknown_085DFA46 - ldr r1, [sp, 0x8] - movs r2, 0x5 -_0816595C: - ldrh r0, [r3] - strh r0, [r1] - adds r3, 0x2 - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _0816595C - ldr r3, =gUnknown_085DFA52 - ldr r1, [sp, 0xC] - movs r2, 0x5 -_08165970: - ldrh r0, [r3] - strh r0, [r1] - adds r3, 0x2 - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _08165970 - adds r2, r6, 0 - adds r3, r5, 0 - movs r4, 0x58 - adds r4, r2 - mov r8, r4 -_08165988: - adds r1, r3, 0 - adds r1, 0x34 - adds r0, r2, 0 - adds r0, 0x1C - ldm r0!, {r4,r6,r7} - stm r1!, {r4,r6,r7} - ldm r0!, {r4,r6,r7} - stm r1!, {r4,r6,r7} - ldm r0!, {r4,r6,r7} - stm r1!, {r4,r6,r7} - ldm r0!, {r6,r7} - stm r1!, {r6,r7} - adds r2, 0x2C - adds r3, 0x2C - cmp r2, r8 - ble _08165988 - movs r0, 0 - str r0, [sp] - ldr r2, =0x0500000b - mov r0, sp - ldr r1, [sp, 0x10] - bl CpuSet - adds r0, r5, 0 - bl sub_8164F70 - movs r0, 0x1 -_081659BE: - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_816587C - - thumb_func_start sub_81659DC -sub_81659DC: @ 81659DC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r4, r0, 0 - adds r6, r1, 0 - movs r2, 0 - adds r1, r4, 0 - adds r3, r4, 0 - adds r3, 0x58 -_081659F4: - ldrh r0, [r1, 0x34] - cmp r0, 0 - beq _081659FC - adds r2, 0x1 -_081659FC: - adds r1, 0x2C - cmp r1, r3 - ble _081659F4 - cmp r2, 0x3 - beq _08165A14 - adds r0, r6, 0 - movs r1, 0 - movs r2, 0xA4 - bl memset - movs r0, 0 - b _08165AD8 -_08165A14: - ldrb r0, [r4] - strb r0, [r6] - ldrh r0, [r4, 0x2] - strh r0, [r6, 0x2] - movs r2, 0 - ldr r0, =gUnknown_085DCF40 - ldrb r1, [r0, 0x1] - ldrb r3, [r4, 0x1] - mov r12, r0 - adds r5, r6, 0x4 - adds r7, r4, 0x4 - movs r0, 0xC - adds r0, r6 - mov r9, r0 - movs r0, 0xC - adds r0, r4 - mov r8, r0 - adds r0, r6, 0 - adds r0, 0x10 - str r0, [sp] - movs r0, 0x10 - adds r0, r4 - mov r10, r0 - cmp r1, r3 - beq _08165A58 - mov r1, r12 - adds r1, 0x1 -_08165A4A: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, 0x51 - bgt _08165A58 - ldrb r0, [r1] - cmp r0, r3 - bne _08165A4A -_08165A58: - cmp r2, 0x52 - beq _08165A68 - lsls r0, r2, 1 - add r0, r12 - ldrb r0, [r0] - b _08165A6A - .pool -_08165A68: - movs r0, 0x24 -_08165A6A: - strb r0, [r6, 0x1] - movs r2, 0 - adds r3, r7, 0 -_08165A70: - adds r0, r5, r2 - adds r1, r3, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x7 - ble _08165A70 - movs r2, 0 - mov r5, r9 - mov r3, r8 -_08165A84: - adds r0, r5, r2 - adds r1, r3, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x3 - ble _08165A84 - mov r3, r10 - ldr r1, [sp] - movs r2, 0x5 -_08165A98: - ldrh r0, [r3] - strh r0, [r1] - adds r3, 0x2 - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _08165A98 - adds r2, r4, 0 - adds r3, r6, 0 - movs r4, 0x58 - adds r4, r2 - mov r8, r4 -_08165AB0: - adds r1, r3, 0 - adds r1, 0x1C - adds r0, r2, 0 - adds r0, 0x34 - ldm r0!, {r4,r5,r7} - stm r1!, {r4,r5,r7} - ldm r0!, {r4,r5,r7} - stm r1!, {r4,r5,r7} - ldm r0!, {r4,r5,r7} - stm r1!, {r4,r5,r7} - ldm r0!, {r5,r7} - stm r1!, {r5,r7} - adds r2, 0x2C - adds r3, 0x2C - cmp r2, r8 - ble _08165AB0 - adds r0, r6, 0 - bl sub_8164F94 - movs r0, 0x1 -_08165AD8: - 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_81659DC - - thumb_func_start sub_8165AE8 -sub_8165AE8: @ 8165AE8 - push {r4,lr} - adds r2, r0, 0 - movs r0, 0 - str r0, [r2, 0x40] - movs r3, 0 - adds r4, r2, 0 -_08165AF4: - ldr r0, [r2, 0x40] - ldm r4!, {r1} - adds r0, r1 - str r0, [r2, 0x40] - adds r3, 0x1 - cmp r3, 0xF - bls _08165AF4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8165AE8 - - thumb_func_start sub_8165B08 -sub_8165B08: @ 8165B08 - push {lr} - movs r1, 0 - movs r3, 0 - adds r2, r0, 0 -_08165B10: - stm r2!, {r3} - adds r1, 0x1 - cmp r1, 0x10 - bls _08165B10 - bl sub_819FA5C - pop {r0} - bx r0 - thumb_func_end sub_8165B08 - - thumb_func_start sub_8165B20 -sub_8165B20: @ 8165B20 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r5, 0 - ldr r0, =0x03005d90 - mov r8, r0 - mov r9, r8 -_08165B30: - lsls r0, r5, 4 - adds r1, r0, r5 - lsls r1, 2 - adds r1, 0xDC - mov r3, r9 - ldr r2, [r3] - movs r4, 0 - movs r3, 0 - adds r6, r0, 0 - adds r7, r5, 0x1 - adds r2, r1 -_08165B46: - ldm r2!, {r0} - adds r4, r0 - adds r3, 0x1 - cmp r3, 0xF - bls _08165B46 - mov r0, r8 - ldr r2, [r0] - adds r0, r6, r5 - lsls r1, r0, 2 - movs r3, 0x8E - lsls r3, 1 - adds r0, r2, r3 - adds r0, r1 - ldr r0, [r0] - cmp r0, r4 - beq _08165B70 - adds r0, r1, 0 - adds r0, 0xDC - adds r0, r2, r0 - bl sub_8165B08 -_08165B70: - adds r5, r7, 0 - cmp r5, 0x3 - ble _08165B30 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8165B20 - - thumb_func_start sub_8165B88 -sub_8165B88: @ 8165B88 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r2, r1, 16 - adds r3, r2, 0 - movs r0, 0xFA - lsls r0, 1 - cmp r2, r0 - bne _08165BA4 - ldr r0, =gUnknown_82E9531 - b _08165C28 - .pool -_08165BA4: - ldr r0, =0x0000012b - cmp r2, r0 - bhi _08165BB8 - ldr r0, =gUnknown_82E9531 - b _08165C28 - .pool -_08165BB8: - ldr r0, =0x0000018f - cmp r2, r0 - bhi _08165BFC - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08165BDC - bl sub_81864B4 - b _08165C2A - .pool -_08165BDC: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0xfffffed4 - adds r2, r1 - movs r1, 0xEC - muls r1, r2 - adds r0, r1 - ldr r1, =0x0000081c - adds r0, r1 - b _08165C28 - .pool -_08165BFC: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _08165C14 - bl sub_81864C0 - b _08165C2A - .pool -_08165C14: - ldr r0, =0x03005d90 - ldr r2, [r0] - ldr r0, =0xfffffe70 - adds r1, r3, r0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, r0 - ldr r1, =0x0000011b - adds r0, r2, r1 -_08165C28: - ldrb r0, [r0] -_08165C2A: - strb r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8165B88 - - thumb_func_start sub_8165C40 -sub_8165C40: @ 8165C40 - push {lr} - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000ca9 - adds r2, r0, r1 - ldrb r1, [r2] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0x2 - beq _08165C84 - ldr r1, =0x0203bc88 - ldr r0, =gBattleFrontierTrainers - str r0, [r1] - ldr r1, =0x0203bc8c - ldr r0, =gBattleFrontierMons - str r0, [r1] - ldrb r0, [r2] - lsls r0, 30 - lsrs r0, 30 - bl sub_8165C90 - b _08165C88 - .pool -_08165C84: - bl sub_8165D78 -_08165C88: - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_8165C40 - - thumb_func_start sub_8165C90 -sub_8165C90: @ 8165C90 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _08165C9E - cmp r0, 0x1 - beq _08165CA2 -_08165C9E: - movs r0, 0x32 - b _08165CB0 -_08165CA2: - bl sub_8165CB4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3B - bhi _08165CB0 - movs r0, 0x3C -_08165CB0: - pop {r1} - bx r1 - thumb_func_end sub_8165C90 - - thumb_func_start sub_8165CB4 -sub_8165CB4: @ 8165CB4 - push {r4-r6,lr} - movs r6, 0 - movs r5, 0 -_08165CBA: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - beq _08165CF4 - adds r0, r4, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _08165CF4 - adds r0, r4, 0 - movs r1, 0x38 - movs r2, 0 - bl pokemon_getattr - cmp r0, r6 - ble _08165CF4 - adds r6, r0, 0 -_08165CF4: - adds r5, 0x1 - cmp r5, 0x5 - ble _08165CBA - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8165CB4 - - thumb_func_start sub_8165D08 -sub_8165D08: @ 8165D08 - push {lr} - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - cmp r0, 0x63 - bls _08165D3A - movs r1, 0x6 - cmp r0, 0x77 - bls _08165D3A - movs r1, 0x9 - cmp r0, 0x8B - bls _08165D3A - movs r1, 0xC - cmp r0, 0x9F - bls _08165D3A - movs r1, 0xF - cmp r0, 0xB3 - bls _08165D3A - movs r1, 0x12 - cmp r0, 0xC7 - bls _08165D3A - movs r1, 0x1F - cmp r0, 0xDB - bhi _08165D3A - movs r1, 0x15 -_08165D3A: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end sub_8165D08 - - thumb_func_start sub_8165D40 -sub_8165D40: @ 8165D40 - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - beq _08165D58 - cmp r0, 0x3 - beq _08165D58 - cmp r0, 0x4 - bne _08165D70 -_08165D58: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1E - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - b _08165D72 - .pool -_08165D70: - movs r0, 0 -_08165D72: - pop {r1} - bx r1 - thumb_func_end sub_8165D40 - - thumb_func_start sub_8165D78 -sub_8165D78: @ 8165D78 - push {lr} - ldr r0, =0x000040cf - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x4 - bne _08165DA8 - ldr r1, =0x0203bc88 - ldr r0, =gSlateportBattleTentTrainers - str r0, [r1] - ldr r1, =0x0203bc8c - ldr r0, =gSlateportBattleTentMons - b _08165DF2 - .pool -_08165DA8: - cmp r0, 0x2 - bne _08165DC8 - ldr r1, =0x0203bc88 - ldr r0, =gVerdanturfBattleTentTrainers - str r0, [r1] - ldr r1, =0x0203bc8c - ldr r0, =gVerdanturfBattleTentMons - b _08165DF2 - .pool -_08165DC8: - cmp r0, 0x3 - bne _08165DE8 - ldr r1, =0x0203bc88 - ldr r0, =gFallarborBattleTentTrainers - str r0, [r1] - ldr r1, =0x0203bc8c - ldr r0, =gFallarborBattleTentMons - b _08165DF2 - .pool -_08165DE8: - ldr r1, =0x0203bc88 - ldr r0, =gBattleFrontierTrainers - str r0, [r1] - ldr r1, =0x0203bc8c - ldr r0, =gBattleFrontierMons -_08165DF2: - str r0, [r1] - bl sub_8165CB4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1D - bhi _08165E02 - movs r0, 0x1E -_08165E02: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8165D78 - - thumb_func_start sub_8165E18 -sub_8165E18: @ 8165E18 - push {r4,r5,lr} - ldr r5, =0x03005d90 -_08165E1C: - bl sub_8165D40 - 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 _08165E58 - adds r2, 0x2 - adds r0, r1, r2 - ldrh r0, [r0] - cmp r0, r4 - beq _08165E58 - ldr r0, =0x03005d90 - ldr r1, [r0] - subs r2, 0x2 - adds r0, r1, r2 - ldrh r2, [r0] - ldr r0, =0x00000cb4 - adds r1, r0 -_08165E4A: - adds r1, 0x2 - adds r3, 0x1 - cmp r3, r2 - bge _08165E58 - ldrh r0, [r1] - cmp r0, r4 - bne _08165E4A -_08165E58: - ldr r0, [r5] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - cmp r3, r0 - bne _08165E1C - ldr r5, =0x02038bca - strh r4, [r5] - ldrh r0, [r5] - movs r1, 0 - bl sub_8162614 - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r2, =0x00000cb2 - adds r0, r1, r2 - ldrh r2, [r0] - adds r0, r2, 0x1 - cmp r0, 0x2 - bgt _08165E8C - lsls r0, r2, 1 - ldr r2, =0x00000cb4 - adds r1, r2 - adds r1, r0 - ldrh r0, [r5] - strh r0, [r1] -_08165E8C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8165E18 - - thumb_func_start sub_8165EA4 -sub_8165EA4: @ 8165EA4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x38 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x18] - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x1C] - bl sub_8165D78 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x20] - ldr r0, =0x02038bca - ldrh r2, [r0] - ldr r0, =0x0203bc88 - ldr r1, [r0] - movs r0, 0x34 - muls r0, r2 - adds r0, r1 - ldr r0, [r0, 0x30] - str r0, [sp, 0x28] - movs r0, 0 - str r0, [sp, 0x24] - ldr r2, [sp, 0x28] - ldrh r1, [r2] - b _08165EFE - .pool -_08165EEC: - ldr r0, [sp, 0x24] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x24] - lsls r0, 1 - ldr r6, [sp, 0x28] - adds r0, r6 - ldrh r1, [r0] -_08165EFE: - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08165EEC - movs r0, 0 - mov r8, r0 - bl GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - orrs r4, r0 - str r4, [sp, 0x2C] - b _08166092 - .pool -_08165F24: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - ldr r1, [sp, 0x24] - bl __modsi3 - lsls r0, 1 - ldr r2, [sp, 0x28] - adds r0, r2 - ldrh r4, [r0] - movs r6, 0 - ldr r7, [sp, 0x18] - add r7, r8 - b _08165F44 -_08165F42: - adds r6, 0x1 -_08165F44: - cmp r6, r7 - bge _08165F68 - movs r1, 0x64 - adds r0, r6, 0 - muls r0, r1 - ldr r2, =0x02024744 - adds r0, r2 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - ldr r1, =0x0203bc8c - ldr r2, [r1] - lsls r1, r4, 4 - adds r1, r2 - ldrh r1, [r1] - cmp r0, r1 - bne _08165F42 -_08165F68: - cmp r6, r7 - beq _08165F6E - b _08166092 -_08165F6E: - movs r6, 0 - cmp r6, r7 - bge _08165FB8 - ldr r0, =gBattleFrontierHeldItems - mov r9, r0 - movs r3, 0 -_08165F7A: - ldr r1, =0x02024744 - adds r5, r3, r1 - adds r0, r5, 0 - movs r1, 0xC - movs r2, 0 - str r3, [sp, 0x34] - bl pokemon_getattr - ldr r3, [sp, 0x34] - cmp r0, 0 - beq _08165FB0 - adds r0, r5, 0 - movs r1, 0xC - movs r2, 0 - bl pokemon_getattr - ldr r1, =0x0203bc8c - ldr r2, [r1] - lsls r1, r4, 4 - adds r1, r2 - ldrb r1, [r1, 0xA] - lsls r1, 1 - add r1, r9 - ldr r3, [sp, 0x34] - ldrh r1, [r1] - cmp r0, r1 - beq _08165FB8 -_08165FB0: - adds r3, 0x64 - adds r6, 0x1 - cmp r6, r7 - blt _08165F7A -_08165FB8: - cmp r6, r7 - bne _08166092 - movs r6, 0 - cmp r6, r8 - bge _08165FDA - add r0, sp, 0xC - ldrh r0, [r0] - cmp r0, r4 - beq _08165FDA - add r1, sp, 0xC -_08165FCC: - adds r1, 0x2 - adds r6, 0x1 - cmp r6, r8 - bge _08165FDA - ldrh r0, [r1] - cmp r0, r4 - bne _08165FCC -_08165FDA: - cmp r6, r8 - bne _08166092 - mov r2, r8 - lsls r0, r2, 1 - add r0, sp - adds r0, 0xC - strh r4, [r0] - movs r6, 0x64 - adds r0, r7, 0 - muls r0, r6 - ldr r1, =0x02024744 - adds r0, r1 - ldr r5, =0x0203bc8c - ldr r2, [r5] - lsls r4, 4 - adds r2, r4, r2 - ldrh r1, [r2] - ldrb r3, [r2, 0xC] - movs r6, 0 - str r6, [sp] - ldrb r2, [r2, 0xB] - str r2, [sp, 0x4] - ldr r2, [sp, 0x2C] - str r2, [sp, 0x8] - ldr r2, [sp, 0x20] - bl sub_8068634 - add r1, sp, 0x14 - movs r0, 0xFF - strb r0, [r1] - mov r9, r4 - mov r0, r8 - adds r0, 0x1 - str r0, [sp, 0x30] - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - mov r8, r1 - adds r3, r5, 0 - mov r5, r9 - ldr r2, =0x02024744 - mov r10, r2 -_0816602E: - ldr r0, [r3] - adds r0, r5, r0 - lsls r4, r6, 1 - adds r0, 0x2 - adds r0, r4 - ldrh r1, [r0] - lsls r2, r6, 24 - lsrs r2, 24 - mov r0, r8 - add r0, r10 - str r3, [sp, 0x34] - bl sub_80691F4 - ldr r3, [sp, 0x34] - ldr r0, [r3] - adds r0, r5, r0 - adds r0, 0x2 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0xDA - bne _0816605E - movs r0, 0 - mov r1, sp - strb r0, [r1, 0x14] -_0816605E: - adds r6, 0x1 - cmp r6, 0x3 - ble _0816602E - movs r2, 0x64 - adds r4, r7, 0 - muls r4, r2 - ldr r6, =0x02024744 - adds r4, r6 - adds r0, r4, 0 - movs r1, 0x20 - add r2, sp, 0x14 - bl pokemon_setattr - ldr r0, =0x0203bc8c - ldr r0, [r0] - add r0, r9 - ldrb r2, [r0, 0xA] - lsls r2, 1 - ldr r0, =gBattleFrontierHeldItems - adds r2, r0 - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_setattr - ldr r0, [sp, 0x30] - mov r8, r0 -_08166092: - ldr r1, [sp, 0x1C] - cmp r8, r1 - beq _0816609A - b _08165F24 -_0816609A: - 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 sub_8165EA4 - - thumb_func_start sub_81660B8 -sub_81660B8: @ 81660B8 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0 - ldr r3, =gUnknown_085DCEDC - ldrb r0, [r3] - cmp r0, r2 - beq _081660DA -_081660C8: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1D - bhi _081660DA - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081660C8 -_081660DA: - cmp r1, 0x1E - beq _081660EC - ldr r0, =gUnknown_085DCF0E - b _08166116 - .pool -_081660EC: - movs r1, 0 - ldr r3, =gUnknown_085DCEFA - ldrb r0, [r3] - cmp r0, r2 - beq _08166108 -_081660F6: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x13 - bhi _08166108 - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, r2 - bne _081660F6 -_08166108: - cmp r1, 0x14 - bne _08166114 - movs r0, 0x7 - b _0816611A - .pool -_08166114: - ldr r0, =gUnknown_085DCF2C -_08166116: - adds r0, r1, r0 - ldrb r0, [r0] -_0816611A: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81660B8 - - thumb_func_start sub_8166124 -sub_8166124: @ 8166124 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, =0x03005d90 - movs r0, 0xEC - muls r0, r6 - movs r1, 0xE7 - lsls r1, 3 - adds r0, r1 - ldr r1, [r2] - movs r5, 0 - movs r4, 0 - movs r3, 0 - adds r1, r0 -_08166140: - ldm r1!, {r0} - adds r5, r0 - orrs r4, r0 - adds r3, 0x1 - cmp r3, 0x39 - bls _08166140 - cmp r5, 0 - bne _08166154 - cmp r4, 0 - beq _08166180 -_08166154: - ldr r2, [r2] - movs r0, 0xEC - adds r1, r6, 0 - muls r1, r0 - movs r3, 0x82 - lsls r3, 4 - adds r0, r2, r3 - adds r0, r1 - ldr r0, [r0] - cmp r0, r5 - bne _08166174 - movs r0, 0x1 - b _08166182 - .pool -_08166174: - movs r3, 0xE7 - lsls r3, 3 - adds r0, r1, r3 - adds r0, r2, r0 - bl sub_8164FB8 -_08166180: - movs r0, 0 -_08166182: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8166124 - - thumb_func_start sub_8166188 -sub_8166188: @ 8166188 - push {r4-r7,lr} - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x02000002 - ands r0, r1 - cmp r0, 0 - beq _081661E8 - bl sub_8165C40 - lsls r0, 24 - movs r5, 0 - ldr r7, =gBaseStats - lsrs r0, 22 - ldr r1, =gExperienceTables - adds r6, r0, r1 -_081661A6: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x02024744 - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - cmp r1, 0 - beq _081661E2 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r7 - ldrb r1, [r0, 0x13] - movs r0, 0xCA - lsls r0, 1 - adds r2, r1, 0 - muls r2, r0 - adds r2, r6 - adds r0, r4, 0 - movs r1, 0x19 - bl pokemon_setattr - adds r0, r4, 0 - bl pokemon_calc_effective_stats -_081661E2: - adds r5, 0x1 - cmp r5, 0x5 - ble _081661A6 -_081661E8: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166188 - - thumb_func_start sub_8166204 -sub_8166204: @ 8166204 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - ldr r4, =0x0203bcac - ldr r0, =0x0000806c - bl AllocZeroed - str r0, [r4] - ldr r1, =0x0203bc90 - ldr r2, =0x00007fd0 - adds r0, r2 - str r0, [r1] - str r5, [r0, 0x8] - str r6, [r0, 0x4] - ldr r0, =sub_8166380 - bl launch_c3_walk_stairs_and_run_once - ldr r0, =sub_816631C - bl SetMainCallback2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166204 - - thumb_func_start sub_816624C -sub_816624C: @ 816624C - push {r4,r5,lr} - ldr r4, =0x0203bcac - ldr r0, =0x0000806c - bl AllocZeroed - str r0, [r4] - ldr r5, =0x0203bc90 - ldr r1, =0x00007fd0 - adds r0, r1 - str r0, [r5] - ldr r1, =0x0203bc98 - ldr r1, [r1] - str r1, [r0, 0x8] - ldr r1, =0x0203bc94 - ldr r1, [r1] - str r1, [r0, 0x4] - ldr r4, =0x0203bc9c - ldrb r0, [r4] - bl sub_81672E4 - strb r0, [r4] - ldr r5, [r5] - movs r1, 0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bls _08166284 - movs r1, 0x1 -_08166284: - adds r0, r5, 0 - adds r0, 0x56 - strb r1, [r0] - ldr r0, =sub_8166380 - bl launch_c3_walk_stairs_and_run_once - ldr r0, =sub_81662C0 - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816624C - - thumb_func_start sub_81662C0 -sub_81662C0: @ 81662C0 - push {r4,lr} - ldr r4, =0x0203bc90 - ldr r0, [r4] - ldr r0, [r0] - bl _call_via_r0 - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - ldr r4, [r4] - ldr r1, [r4] - ldr r0, =map_warp_consider_1_to_outside_or_stair_or_dive - cmp r1, r0 - bne _081662F0 - adds r0, r4, 0 - adds r0, 0x50 - movs r1, 0 - strb r1, [r0] - ldr r0, =sub_8166304 - bl SetMainCallback2 -_081662F0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81662C0 - - thumb_func_start sub_8166304 -sub_8166304: @ 8166304 - push {lr} - bl sub_81668F8 - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_8166304 - - thumb_func_start sub_816631C -sub_816631C: @ 816631C - push {lr} - ldr r0, =0x0203bc90 - ldr r0, [r0] - ldr r0, [r0] - bl _call_via_r0 - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - pop {r0} - bx r0 - .pool - thumb_func_end sub_816631C - - thumb_func_start sub_8166340 -sub_8166340: @ 8166340 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r1, =0x00007c58 - adds r0, r1 - bl sub_81D2108 - bl sub_80BA0A8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166340 - - thumb_func_start launch_c3_walk_stairs_and_run_once -launch_c3_walk_stairs_and_run_once: @ 816636C - ldr r1, =0x0203bc90 - ldr r1, [r1] - str r0, [r1] - adds r1, 0x50 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end launch_c3_walk_stairs_and_run_once - - thumb_func_start sub_8166380 -sub_8166380: @ 8166380 - push {r4,r5,lr} - sub sp, 0x4 - ldr r1, =0x0203bc90 - ldr r0, [r1] - adds r0, 0x50 - ldrb r0, [r0] - adds r2, r1, 0 - cmp r0, 0xF - bls _08166394 - b _08166556 -_08166394: - lsls r0, 2 - ldr r1, =_081663A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081663A8: - .4byte _081663E8 - .4byte _0816640C - .4byte _08166416 - .4byte _08166434 - .4byte _08166464 - .4byte _08166468 - .4byte _08166474 - .4byte _08166484 - .4byte _08166490 - .4byte _0816649C - .4byte _081664B8 - .4byte _081664BC - .4byte _081664E4 - .4byte _08166510 - .4byte _08166528 - .4byte _08166550 -_081663E8: - ldr r2, =0x0203bcac - ldr r0, [r2] - ldr r1, =0x00007b10 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r2] - ldr r2, =0x00007c58 - adds r0, r2 - bl sub_81D1ED4 - b _0816653C - .pool -_0816640C: - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - b _0816653C -_08166416: - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - str r0, [sp] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - mov r0, sp - bl CpuSet - b _0816653C - .pool -_08166434: - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085DFCCC - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r0, =gUnknown_085DFCDC - bl InitWindows - bl DeactivateAllTextPrinters - movs r0, 0 - movs r1, 0x97 - movs r2, 0xE0 - bl sub_809882C - b _0816653C - .pool -_08166464: - ldr r1, [r2] - b _08166540 -_08166468: - bl sub_8168328 - lsls r0, 24 - cmp r0, 0 - bne _08166556 - b _0816653C -_08166474: - ldr r1, =0x030022b0 - movs r0, 0x14 - strh r0, [r1] - bl sub_8167420 - b _0816653C - .pool -_08166484: - bl sub_8167930 - lsls r0, 24 - cmp r0, 0 - bne _08166556 - b _0816653C -_08166490: - movs r0, 0 - bl sub_8167608 - bl sub_8167760 - b _0816653C -_0816649C: - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r1, =0x00007b0e - adds r0, r1 - bl sub_81D312C - lsls r0, 24 - cmp r0, 0 - bne _08166556 - b _0816653C - .pool -_081664B8: - ldr r1, [r2] - b _08166540 -_081664BC: - ldr r5, =0x0203bcac - ldr r1, [r5] - ldr r4, =0x00007c58 - adds r0, r1, r4 - ldr r2, =0x00007c6c - adds r1, r2 - bl sub_81D2754 - ldr r0, [r5] - adds r0, r4 - bl sub_81D20AC - b _0816653C - .pool -_081664E4: - ldr r4, =0x0203bcac - ldr r0, [r4] - ldr r1, =0x00007c58 - adds r0, r1 - bl sub_81D20BC - lsls r0, 24 - cmp r0, 0 - bne _08166556 - ldr r2, [r4] - ldr r1, =0x00007c58 - adds r0, r2, r1 - adds r1, 0x14 - adds r2, r1 - adds r1, r2, 0 - bl sub_81D1F84 - b _0816653C - .pool -_08166510: - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r2, =0x00007c58 - adds r0, r2 - bl sub_81D2230 - b _0816653C - .pool -_08166528: - movs r0, 0 - bl PutWindowTilemap - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x1 - bl sub_8167BA0 -_0816653C: - ldr r0, =0x0203bc90 - ldr r1, [r0] -_08166540: - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08166556 - .pool -_08166550: - ldr r0, =map_warp_consider_1_to_outside_or_stair_or_dive - bl launch_c3_walk_stairs_and_run_once -_08166556: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166380 - - thumb_func_start map_warp_consider_1_to_outside_or_stair_or_dive -map_warp_consider_1_to_outside_or_stair_or_dive: @ 8166564 - push {r4,lr} - sub sp, 0x4 - ldr r4, =0x0203bc90 - ldr r0, [r4] - adds r0, 0x50 - ldrb r1, [r0] - cmp r1, 0 - beq _08166580 - cmp r1, 0x1 - beq _081665C0 - b _08166610 - .pool -_08166580: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =sub_8166340 - bl SetVBlankCallback - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r0, 0x2 - bl ShowBg - ldr r1, [r4] - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08166610 - .pool -_081665C0: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08166610 - ldr r4, =0x0203bcac - ldr r0, [r4] - ldr r1, =0x00007b1c - adds r0, r1 - bl sub_81D3464 - ldr r4, [r4] - ldr r2, =0x00008041 - adds r0, r4, r2 - ldrb r1, [r0] - ldr r3, =0x00008040 - adds r0, r4, r3 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - beq _0816660A - ldr r1, =0x00007fb3 - adds r0, r4, r1 - movs r1, 0 - ldrsb r1, [r0, r1] - subs r2, 0x91 - adds r0, r4, r2 - adds r0, r1 - ldrb r2, [r0] - ldr r3, =0x00007b1c - adds r0, r4, r3 - subs r3, 0xC - adds r1, r4, r3 - ldrb r1, [r1] - bl sub_81D3480 -_0816660A: - ldr r0, =sub_8166634 - bl launch_c3_walk_stairs_and_run_once -_08166610: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end map_warp_consider_1_to_outside_or_stair_or_dive - - thumb_func_start sub_8166634 -sub_8166634: @ 8166634 - push {lr} - ldr r0, =0x0203bc90 - ldr r0, [r0] - adds r0, 0x50 - ldrb r0, [r0] - cmp r0, 0x7 - bls _08166644 - b _0816680E -_08166644: - lsls r0, 2 - ldr r1, =_08166658 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08166658: - .4byte _08166678 - .4byte _0816675C - .4byte _0816680E - .4byte _08166788 - .4byte _0816680E - .4byte _08166794 - .4byte _081667AC - .4byte _081667F4 -_08166678: - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2C] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081666B8 - movs r0, 0x5 - bl audio_play - movs r0, 0x1 - bl sub_8167CA0 - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r1, =0x00007b1c - adds r0, r1 - bl sub_81D3520 - ldr r0, =0x0203bc90 - ldr r0, [r0] - adds r0, 0x50 - movs r1, 0x1 - b _0816680C - .pool -_081666B8: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081666F0 - movs r0, 0x5 - bl audio_play - movs r0, 0 - bl sub_8167CA0 - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r2, =0x00007b1c - adds r0, r2 - bl sub_81D3520 - ldr r0, =0x0203bc90 - ldr r0, [r0] - adds r0, 0x50 - movs r1, 0x1 - b _0816680C - .pool -_081666F0: - ldrh r1, [r2, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08166710 - movs r0, 0x5 - bl audio_play - ldr r0, =0x0203bc90 - ldr r0, [r0] - adds r0, 0x50 - movs r1, 0x3 - b _0816680C - .pool -_08166710: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0816671A - b _0816680E -_0816671A: - movs r0, 0x5 - bl audio_play - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r2, =0x00008041 - adds r1, r0, r2 - ldrb r1, [r1] - subs r2, 0x1 - adds r0, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bne _0816674C - ldr r0, =0x0203bc90 - ldr r0, [r0] - adds r0, 0x50 - movs r1, 0x3 - b _0816680C - .pool -_0816674C: - ldr r0, =0x0203bc90 - ldr r0, [r0] - adds r0, 0x50 - movs r1, 0x5 - b _0816680C - .pool -_0816675C: - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r1, =0x00008044 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0816680E - ldr r0, =0x0203bc90 - ldr r0, [r0] - adds r0, 0x50 - b _0816680C - .pool -_08166788: - ldr r0, =sub_8166BEC - bl launch_c3_walk_stairs_and_run_once - b _0816680E - .pool -_08166794: - bl sub_8166D44 - ldr r0, =0x0203bc90 - ldr r1, [r0] - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0816680E - .pool -_081667AC: - bl sub_8166DE4 - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _081667CC - cmp r1, 0 - bgt _081667C6 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08166804 - b _0816680E -_081667C6: - cmp r1, 0x1 - bne _0816680E - b _08166804 -_081667CC: - bl sub_8167268 - lsls r0, 24 - cmp r0, 0 - beq _081667E8 - bl sub_8166F50 - ldr r0, =0x0203bc90 - ldr r0, [r0] - adds r0, 0x50 - movs r1, 0x7 - b _0816680C - .pool -_081667E8: - ldr r0, =sub_816681C - bl launch_c3_walk_stairs_and_run_once - b _0816680E - .pool -_081667F4: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _0816680E - bl sub_8166F94 -_08166804: - ldr r0, =0x0203bc90 - ldr r0, [r0] - adds r0, 0x50 - movs r1, 0 -_0816680C: - strb r1, [r0] -_0816680E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166634 - - thumb_func_start sub_816681C -sub_816681C: @ 816681C - push {r4,r5,lr} - sub sp, 0x4 - ldr r5, =0x0203bc90 - ldr r0, [r5] - adds r0, 0x50 - ldrb r4, [r0] - cmp r4, 0 - beq _08166838 - cmp r4, 0x1 - beq _08166888 - b _081668D4 - .pool -_08166838: - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r1, =0x00008041 - adds r0, r1 - ldrb r0, [r0] - bl sub_81672A4 - ldr r1, =0x0203bc9c - strb r0, [r1] - ldr r1, =0x0203bc94 - ldr r2, [r5] - ldr r0, [r2, 0x4] - str r0, [r1] - ldr r1, =0x0203bc98 - ldr r0, [r2, 0x8] - str r0, [r1] - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, [r5] - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _081668D4 - .pool -_08166888: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _081668D4 - movs r0, 0 - bl SetVBlankCallback - ldr r4, =0x0203bca0 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203bca4 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203bca8 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203bcac - ldr r0, [r4] - bl Free - str r5, [r4] - bl FreeAllWindowBuffers - ldr r1, =0x030022c0 - ldr r0, =sub_816624C - str r0, [r1, 0x8] - bl sub_8179D70 -_081668D4: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816681C - - thumb_func_start sub_81668F8 -sub_81668F8: @ 81668F8 - push {r4,lr} - sub sp, 0x4 - ldr r1, =0x0203bc90 - ldr r0, [r1] - adds r0, 0x50 - ldrb r0, [r0] - adds r4, r1, 0 - cmp r0, 0x6 - bls _0816690C - b _08166A18 -_0816690C: - lsls r0, 2 - ldr r1, =_08166920 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08166920: - .4byte _0816693C - .4byte _08166972 - .4byte _08166A18 - .4byte _081669A0 - .4byte _081669AE - .4byte _081669C8 - .4byte _081669F4 -_0816693C: - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r1, =0x00008041 - adds r0, r1 - ldr r1, =0x0203bc9c - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - beq _08166968 - ldr r0, [r4] - adds r0, 0x56 - ldrb r0, [r0] - bl sub_8167CA0 - ldr r1, [r4] - b _081669E2 - .pool -_08166968: - ldr r0, [r4] - adds r0, 0x50 - movs r1, 0x3 - strb r1, [r0] - b _08166A18 -_08166972: - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r1, =0x00008044 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _08166A18 - ldr r0, =0x0203bc90 - ldr r0, [r0] - adds r0, 0x50 - strb r1, [r0] - b _08166A18 - .pool -_081669A0: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - b _081669DE -_081669AE: - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r0, 0x2 - bl ShowBg - b _081669DE -_081669C8: - ldr r0, =sub_8166340 - bl SetVBlankCallback - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe -_081669DE: - ldr r0, =0x0203bc90 - ldr r1, [r0] -_081669E2: - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08166A18 - .pool -_081669F4: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08166A18 - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r1, =0x00007b1c - adds r0, r1 - bl sub_81D3464 - ldr r0, =sub_8166A34 - bl launch_c3_walk_stairs_and_run_once - ldr r0, =sub_816631C - bl SetMainCallback2 -_08166A18: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81668F8 - - thumb_func_start sub_8166A34 -sub_8166A34: @ 8166A34 - push {r4-r6,lr} - ldr r1, =0x0203bc90 - ldr r0, [r1] - adds r0, 0x50 - ldrb r0, [r0] - adds r5, r1, 0 - cmp r0, 0x5 - bls _08166A46 - b _08166BDA -_08166A46: - lsls r0, 2 - ldr r1, =_08166A58 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08166A58: - .4byte _08166A70 - .4byte _08166AAC - .4byte _08166AC0 - .4byte _08166B14 - .4byte _08166B94 - .4byte _08166BB6 -_08166A70: - ldr r4, [r5] - ldr r3, =0x020244ec - str r3, [r4, 0xC] - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r2, =0x00008041 - adds r1, r0, r2 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0, r1 - subs r2, 0x88 - adds r1, r2 - ldrb r2, [r1] - movs r1, 0x64 - muls r1, r2 - adds r1, r3 - str r1, [r4, 0xC] - ldr r3, =0x00007b1c - adds r0, r3 - bl sub_81D3520 - b _08166BAA - .pool -_08166AAC: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _08166ABA - b _08166BDA -_08166ABA: - b _08166BAA - .pool -_08166AC0: - bl sub_8167104 - ldr r6, =0x0203bc90 - ldr r0, [r6] - adds r0, 0x5C - ldr r4, =0x0203bcac - ldr r1, [r4] - ldr r5, =0x00007ca8 - adds r1, r5 - bl sub_81D2754 - ldr r2, [r4] - ldr r4, =0x00007c58 - adds r0, r2, r4 - ldr r3, =0x00007fb3 - adds r1, r2, r3 - movs r3, 0 - ldrsb r3, [r1, r3] - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 2 - adds r4, 0x14 - adds r1, r4 - adds r1, r2, r1 - adds r2, r5 - bl sub_81D1F84 - bl sub_8167338 - ldr r1, [r6] - b _08166BAC - .pool -_08166B14: - ldr r5, =0x0203bcac - ldr r0, [r5] - ldr r1, =0x00007c58 - adds r0, r1 - bl sub_81D2074 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _08166BDA - ldr r0, [r5] - ldr r4, =0x00008041 - adds r0, r4 - ldrb r0, [r0] - bl sub_81672A4 - lsls r0, 24 - lsrs r0, 24 - bl sub_81681F4 - ldr r3, [r5] - adds r4, r3, r4 - ldrb r1, [r4] - ldr r2, =0x00008040 - adds r0, r3, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - beq _08166B6C - ldr r4, =0x00007fb3 - adds r0, r3, r4 - movs r1, 0 - ldrsb r1, [r0, r1] - subs r2, 0x90 - adds r0, r3, r2 - adds r0, r1 - ldrb r2, [r0] - ldr r4, =0x00007b1c - adds r0, r3, r4 - subs r4, 0xC - adds r1, r3, r4 - ldrb r1, [r1] - bl sub_81D3480 -_08166B6C: - ldr r1, =0x0203bc90 - ldr r0, [r1] - adds r0, 0x52 - strb r6, [r0] - ldr r1, [r1] - b _08166BAC - .pool -_08166B94: - ldr r1, [r5] - adds r1, 0x52 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x10 - bls _08166BDA - bl sub_8166E24 -_08166BAA: - ldr r1, [r5] -_08166BAC: - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08166BDA -_08166BB6: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08166BDA - bl sub_8166EDC - lsls r0, 24 - cmp r0, 0 - bne _08166BDA - ldr r0, =0x0203ce7c - ldrb r0, [r0] - bl sub_8136F68 - ldr r0, =sub_8166BEC - bl launch_c3_walk_stairs_and_run_once -_08166BDA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166A34 - - thumb_func_start sub_8166BEC -sub_8166BEC: @ 8166BEC - push {r4-r6,lr} - sub sp, 0x4 - ldr r4, =0x0203bc90 - ldr r0, [r4] - adds r2, r0, 0 - adds r2, 0x50 - ldrb r1, [r2] - cmp r1, 0x1 - beq _08166C28 - cmp r1, 0x1 - bgt _08166C0C - cmp r1, 0 - beq _08166C16 - b _08166D18 - .pool -_08166C0C: - cmp r1, 0x2 - beq _08166C40 - cmp r1, 0x3 - beq _08166C5C - b _08166D18 -_08166C16: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _08166C4A -_08166C28: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08166D18 - movs r0, 0x2 - strb r0, [r2] - b _08166D18 - .pool -_08166C40: - ldr r1, =0x02039b28 - movs r0, 0x3 - strb r0, [r1, 0x15] - bl sub_80BA0A8 -_08166C4A: - ldr r1, [r4] - adds r1, 0x50 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08166D18 - .pool -_08166C5C: - ldr r0, [r0, 0x4] - bl SetMainCallback2 - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r1, =0x00007b1c - adds r0, r1 - bl sub_81D354C - movs r4, 0 -_08166C70: - ldr r5, =0x0203bcac - ldr r0, [r5] - ldr r2, =0x00007b06 - adds r0, r2 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bls _08166C70 - movs r0, 0 - bl FreeObjectTilesByTag - movs r0, 0x1 - bl FreeObjectTilesByTag - movs r0, 0 - bl FreeObjectPaletteByTag - movs r0, 0x1 - bl FreeObjectPaletteByTag - movs r4, 0 -_08166CAE: - ldr r0, [r5] - lsls r1, r4, 2 - ldr r2, =0x00007b44 - adds r0, r2 - adds r0, r1 - ldr r0, [r0] - bl RemoveObjectAndFreeTiles - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _08166CAE - ldr r6, =0x0203bcac - ldr r0, [r6] - ldr r2, =0x00007b10 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xFF - beq _08166CE6 - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles -_08166CE6: - movs r0, 0 - bl SetVBlankCallback - ldr r4, =0x0203bca0 - ldr r0, [r4] - bl Free - movs r5, 0 - str r5, [r4] - ldr r4, =0x0203bca4 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203bca8 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r0, [r6] - bl Free - str r5, [r6] - bl FreeAllWindowBuffers -_08166D18: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166BEC - - thumb_func_start sub_8166D44 -sub_8166D44: @ 8166D44 - push {r4,lr} - sub sp, 0x4C - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r1, =0x00008041 - adds r0, r1 - ldrb r0, [r0] - bl sub_81672A4 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2 - add r2, sp, 0xC - bl pokemon_getattr - add r0, sp, 0xC - bl GetStringEnd_Limit7 - ldr r1, =gUnknown_085EC7A0 - add r0, sp, 0xC - bl AppendString - ldr r4, =0x02021fc4 - adds r0, r4, 0 - add r1, sp, 0xC - bl CopyString - movs r0, 0x2 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0x2 - movs r1, 0x97 - movs r2, 0xE - bl sub_8098858 - movs r0, 0x1 - 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, 0 - bl Print - movs r0, 0x2 - bl PutWindowTilemap - movs r0, 0x2 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =gUnknown_085DFCFC - movs r1, 0x97 - movs r2, 0xE - movs r3, 0 - bl CreateYesNoMenu - add sp, 0x4C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166D44 - - thumb_func_start sub_8166DE4 -sub_8166DE4: @ 8166DE4 - push {r4,lr} - bl sub_8198C58 - lsls r0, 24 - lsrs r4, r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _08166E18 - cmp r1, 0 - bgt _08166E02 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _08166E06 - b _08166E18 -_08166E02: - cmp r1, 0x1 - bne _08166E18 -_08166E06: - movs r0, 0x5 - bl audio_play - movs r0, 0x2 - bl rbox_fill_rectangle - movs r0, 0x2 - bl ClearWindowTilemap -_08166E18: - lsls r0, r4, 24 - asrs r0, 24 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8166DE4 - - thumb_func_start sub_8166E24 -sub_8166E24: @ 8166E24 - push {r4,lr} - movs r0, 0x2 - movs r1, 0x97 - movs r2, 0xE - bl sub_8098858 - movs r0, 0x2 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r3, =0x0203bc90 - ldr r0, [r3] - adds r0, 0x53 - movs r1, 0 - strb r1, [r0] - ldr r2, [r3] - adds r1, r2, 0 - adds r1, 0x53 - ldrb r0, [r1] - cmp r0, 0x4 - bhi _08166EA8 - adds r0, r2, 0 - adds r0, 0x61 - ldrb r1, [r1] - adds r0, r1 - ldrb r0, [r0] - adds r4, r3, 0 - cmp r0, 0 - bne _08166E84 - adds r2, r4, 0 -_08166E60: - ldr r0, [r2] - adds r0, 0x53 - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - ldr r3, [r2] - adds r1, r3, 0 - adds r1, 0x53 - ldrb r0, [r1] - cmp r0, 0x4 - bhi _08166EA8 - adds r0, r3, 0 - adds r0, 0x61 - ldrb r1, [r1] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _08166E60 -_08166E84: - ldr r2, [r4] - adds r1, r2, 0 - adds r1, 0x53 - ldrb r0, [r1] - cmp r0, 0x4 - bhi _08166EA8 - ldr r0, =0x02021fc4 - ldrb r1, [r1] - adds r2, 0x61 - adds r2, r1 - ldrb r2, [r2] - bl sub_8166FD4 - b _08166EB8 - .pool -_08166EA8: - ldr r0, =0x02021fc4 - ldr r1, =0x0203bc90 - ldr r1, [r1] - adds r1, 0x53 - ldrb r1, [r1] - movs r2, 0 - bl sub_8166FD4 -_08166EB8: - ldr r0, =0x02021fc4 - bl sub_8166FB0 - movs r0, 0x2 - bl PutWindowTilemap - movs r0, 0x2 - movs r1, 0x3 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166E24 - - thumb_func_start sub_8166EDC -sub_8166EDC: @ 8166EDC - push {r4,r5,lr} - movs r0, 0x2 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r5, =0x0203bc90 - adds r3, r5, 0 - movs r4, 0x5 -_08166EEC: - ldr r0, [r3] - adds r0, 0x53 - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - ldr r2, [r3] - adds r1, r2, 0 - adds r1, 0x53 - ldrb r0, [r1] - cmp r0, 0x4 - bhi _08166F18 - adds r0, r2, 0 - adds r0, 0x61 - ldrb r1, [r1] - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _08166F1E - b _08166EEC - .pool -_08166F18: - strb r4, [r1] - movs r0, 0 - b _08166F44 -_08166F1E: - ldr r4, =0x02021fc4 - ldr r0, [r5] - adds r1, r0, 0 - adds r1, 0x53 - ldrb r1, [r1] - adds r0, 0x61 - adds r0, r1 - ldrb r2, [r0] - adds r0, r4, 0 - bl sub_8166FD4 - adds r0, r4, 0 - bl sub_8166FB0 - movs r0, 0x2 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x1 -_08166F44: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8166EDC - - thumb_func_start sub_8166F50 -sub_8166F50: @ 8166F50 - push {lr} - sub sp, 0xC - movs r0, 0x2 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0x2 - movs r1, 0x97 - movs r2, 0xE - bl sub_8098858 - ldr r2, =gUnknown_085EC800 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0x2 - bl PutWindowTilemap - movs r0, 0x2 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166F50 - - thumb_func_start sub_8166F94 -sub_8166F94: @ 8166F94 - push {lr} - movs r0, 0x2 - bl rbox_fill_rectangle - movs r0, 0x2 - bl ClearWindowTilemap - movs r0, 0x2 - movs r1, 0x3 - bl CopyWindowToVram - pop {r0} - bx r0 - thumb_func_end sub_8166F94 - - thumb_func_start sub_8166FB0 -sub_8166FB0: @ 8166FB0 - push {lr} - sub sp, 0xC - ldr r2, =0x02021fc4 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r3, 0 - bl Print - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166FB0 - - thumb_func_start sub_8166FD4 -sub_8166FD4: @ 8166FD4 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r3, r1, 24 - lsls r2, 16 - lsrs r0, r2, 16 - asrs r2, 16 - cmp r2, 0 - beq _08167010 - cmp r2, 0 - ble _08166FEC - movs r0, 0 -_08166FEC: - lsls r0, 16 - ldr r1, =gUnknown_085DFD04 - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r4, 0 - bl CopyString - ldr r1, =gUnknown_085EC7E1 - adds r0, r4, 0 - bl AppendString - b _08167018 - .pool -_08167010: - ldr r1, =gUnknown_085EC7EF - adds r0, r4, 0 - bl CopyString -_08167018: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8166FD4 - - thumb_func_start sub_8167024 -sub_8167024: @ 8167024 - push {r4-r7,lr} - adds r6, r0, 0 - adds r5, r1, 0 - movs r4, 0 - ldr r7, =gUnknown_085DFCB0 -_0816702E: - lsls r0, r4, 2 - adds r0, r7 - ldr r1, [r0] - adds r0, r6, 0 - bl pokemon_getattr - adds r1, r5, r4 - strb r0, [r1] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x4 - bls _0816702E - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167024 - - thumb_func_start sub_8167054 -sub_8167054: @ 8167054 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - mov r8, r0 - adds r5, r1, 0 - adds r0, r5, 0 - movs r1, 0x30 - bl pokemon_getattr - cmp r0, 0xFF - beq _081670F0 - mov r0, r8 - adds r1, r5, 0 - bl sub_8167184 - movs r4, 0 - mov r7, sp -_08167078: - ldr r1, =gUnknown_085DFCB0 - lsls r0, r4, 2 - adds r0, r1 - ldr r6, [r0] - adds r0, r5, 0 - adds r1, r6, 0 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - strb r0, [r7] - ldr r1, =0x0203bc90 - ldr r1, [r1] - lsls r2, r4, 1 - adds r1, 0x66 - adds r1, r2 - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r0, 0 - bge _081670A6 - movs r1, 0 -_081670A6: - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _081670B0 - movs r1, 0xFF -_081670B0: - strb r1, [r7] - adds r0, r5, 0 - adds r1, r6, 0 - mov r2, sp - bl pokemon_setattr - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x4 - bls _08167078 - adds r0, r5, 0 - movs r1, 0x30 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - mov r2, r8 - ldrb r2, [r2, 0x6] - adds r1, r0, r2 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _081670E2 - movs r1, 0xFF -_081670E2: - mov r0, sp - strb r1, [r0] - adds r0, r5, 0 - movs r1, 0x30 - mov r2, sp - bl pokemon_setattr -_081670F0: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167054 - - thumb_func_start sub_8167104 -sub_8167104: @ 8167104 - push {r4,r5,lr} - ldr r5, =0x020244ec - ldr r0, =0x0203bcac - ldr r1, [r0] - ldr r2, =0x00008041 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r1, r0 - ldr r0, =0x00007fb9 - adds r1, r0 - ldrb r1, [r1] - movs r0, 0x64 - muls r0, r1 - adds r5, r0, r5 - ldr r4, =0x0203bc90 - ldr r1, [r4] - adds r1, 0x57 - adds r0, r5, 0 - bl sub_8167024 - ldr r0, [r4] - ldr r0, [r0, 0x8] - adds r1, r5, 0 - bl sub_8167054 - ldr r1, [r4] - adds r1, 0x5C - adds r0, r5, 0 - bl sub_8167024 - movs r3, 0 -_08167144: - ldr r0, [r4] - adds r2, r0, 0 - adds r2, 0x61 - adds r2, r3 - adds r1, r0, 0 - adds r1, 0x5C - adds r1, r3 - adds r0, 0x57 - adds r0, r3 - ldrb r1, [r1] - ldrb r0, [r0] - subs r1, r0 - strb r1, [r2] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x4 - bls _08167144 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167104 - - thumb_func_start sub_8167184 -sub_8167184: @ 8167184 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r10, r1 - ldr r1, =0x0203bc90 - ldr r3, [r1] - ldrb r1, [r0, 0x1] - adds r2, r3, 0 - adds r2, 0x66 - strh r1, [r2] - ldrb r2, [r0, 0x5] - adds r1, r3, 0 - adds r1, 0x68 - strh r2, [r1] - ldrb r1, [r0, 0x4] - adds r2, r3, 0 - adds r2, 0x6A - strh r1, [r2] - ldrb r2, [r0, 0x3] - adds r1, r3, 0 - adds r1, 0x6C - strh r2, [r1] - ldrb r1, [r0, 0x2] - adds r0, r3, 0 - adds r0, 0x6E - strh r1, [r0] - ldr r0, =0x0203bc9e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - ble _081671D4 - movs r0, 0x1 - b _081671DA - .pool -_081671D4: - cmp r0, 0 - bge _08167250 - movs r0, 0xFF -_081671DA: - movs r2, 0 - lsls r0, 24 - mov r9, r0 - ldr r0, =0x0203bc90 - mov r8, r0 -_081671E4: - mov r0, r8 - ldr r1, [r0] - lsls r0, r2, 24 - asrs r6, r0, 24 - lsls r7, r6, 1 - adds r1, 0x66 - adds r1, r7 - movs r2, 0 - ldrsh r4, [r1, r2] - adds r0, r4, 0 - movs r1, 0xA - bl __divsi3 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - movs r1, 0xA - bl __modsi3 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0816721C - lsls r0, r5, 24 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r5, r0, 24 -_0816721C: - ldr r0, =gUnknown_085DFCC4 - adds r0, r6, r0 - ldrb r1, [r0] - mov r0, r10 - bl sub_806E858 - lsls r0, 24 - asrs r2, r0, 24 - cmp r0, r9 - bne _08167244 - mov r1, r8 - ldr r0, [r1] - adds r0, 0x66 - adds r0, r7 - lsls r1, r5, 24 - asrs r1, 24 - muls r1, r2 - ldrh r2, [r0] - adds r1, r2 - strh r1, [r0] -_08167244: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - asrs r0, 24 - cmp r0, 0x4 - ble _081671E4 -_08167250: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167184 - - thumb_func_start sub_8167268 -sub_8167268: @ 8167268 - push {lr} - ldr r0, =0x0203bcac - ldr r1, [r0] - ldr r2, =0x00008041 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r1, r0 - subs r2, 0x89 - adds r0, r1, r2 - ldrb r0, [r0] - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - movs r2, 0x30 - movs r3, 0 - bl sub_81D2C68 - cmp r0, 0xFF - beq _0816729C - movs r0, 0 - b _0816729E - .pool -_0816729C: - movs r0, 0x1 -_0816729E: - pop {r1} - bx r1 - thumb_func_end sub_8167268 - - thumb_func_start sub_81672A4 -sub_81672A4: @ 81672A4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 -_081672AC: - movs r0, 0x64 - muls r0, r4 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _081672D2 - cmp r5, 0 - bne _081672CC - adds r0, r4, 0 - b _081672DE - .pool -_081672CC: - subs r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_081672D2: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _081672AC - movs r0, 0 -_081672DE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81672A4 - - thumb_func_start sub_81672E4 -sub_81672E4: @ 81672E4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - movs r6, 0 - cmp r6, r5 - bcs _08167314 -_081672F2: - movs r0, 0x64 - muls r0, r4 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - beq _0816730A - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0816730A: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _081672F2 -_08167314: - subs r0, r5, r6 - lsls r0, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81672E4 - - thumb_func_start sub_8167324 -sub_8167324: @ 8167324 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_81672A4 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_8167324 - - thumb_func_start sub_8167338 -sub_8167338: @ 8167338 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =gUnknown_085DFD18 - bl LoadObjectPic - ldr r0, =gUnknown_085DFD20 - bl LoadTaggedObjectPalette - ldr r2, =0x0203bc90 - ldr r0, [r2] - adds r0, 0x54 - movs r1, 0 - strb r1, [r0] - movs r4, 0 - adds r5, r2, 0 - ldr r6, =gUnknown_085DFD28 - adds r0, r6, 0x2 - mov r8, r0 - ldr r7, =0x0202064c -_08167360: - ldr r0, [r5] - adds r0, 0x61 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _081673AC - lsls r2, r4, 2 - adds r0, r2, r6 - movs r3, 0 - ldrsh r1, [r0, r3] - add r2, r8 - movs r0, 0 - ldrsh r2, [r2, r0] - ldr r0, =gUnknown_085DFD5C - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _081673AC - ldr r0, [r5] - adds r0, 0x61 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _081673A2 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, =sub_81673DC - str r1, [r0] -_081673A2: - ldr r1, [r5] - adds r1, 0x54 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_081673AC: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x4 - bls _08167360 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167338 - - thumb_func_start sub_81673DC -sub_81673DC: @ 81673DC - push {lr} - adds r1, r0, 0 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0x5 - bgt _081673EE - ldrh r0, [r1, 0x26] - subs r0, 0x2 - b _081673F6 -_081673EE: - cmp r0, 0xB - bgt _081673F8 - ldrh r0, [r1, 0x26] - adds r0, 0x2 -_081673F6: - strh r0, [r1, 0x26] -_081673F8: - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3C - ble _08167418 - adds r0, r1, 0 - bl RemoveObjectAndFreeTiles - ldr r0, =0x0203bc90 - ldr r1, [r0] - adds r1, 0x54 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] -_08167418: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81673DC - - thumb_func_start sub_8167420 -sub_8167420: @ 8167420 - push {r4-r6,lr} - movs r4, 0 - movs r5, 0 - ldr r6, =0x0203bcac - b _08167472 - .pool -_08167430: - movs r0, 0x64 - muls r0, r4 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2D - bl pokemon_getattr - adds r3, r0, 0 - cmp r3, 0 - bne _0816746C - ldr r1, [r6] - lsls r2, r5, 2 - adds r1, r2 - ldr r0, =0x00007fb8 - adds r1, r0 - movs r0, 0xE - strb r0, [r1] - ldr r0, [r6] - adds r0, r2 - ldr r1, =0x00007fb9 - adds r0, r1 - strb r4, [r0] - ldr r0, [r6] - adds r0, r2 - ldr r2, =0x00007fba - adds r0, r2 - strh r3, [r0] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_0816746C: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_08167472: - bl calc_player_party_count - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bcc _08167430 - ldr r2, =0x0203bcac - ldr r0, [r2] - ldr r1, =0x00008041 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - adds r1, r5, 0x1 - ldr r2, =0x00008040 - adds r0, r2 - strb r1, [r0] - bl sub_81674BC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167420 - - thumb_func_start sub_81674BC -sub_81674BC: @ 81674BC - push {r4,r5,lr} - ldr r4, =0x0203bcac - ldr r0, [r4] - ldr r5, =0x00008041 - adds r0, r5 - ldrb r0, [r0] - movs r1, 0 - bl sub_816753C - ldr r0, [r4] - ldr r1, =0x00007fb3 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r0, [r4] - ldr r2, =0x00007fb4 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r4] - ldr r1, =0x00007fb5 - adds r0, r1 - movs r1, 0x2 - strb r1, [r0] - ldr r0, [r4] - adds r5, r0, r5 - ldrb r3, [r5] - adds r1, r3, 0x1 - adds r2, 0x8C - adds r0, r2 - ldrb r2, [r0] - cmp r1, r2 - blt _08167500 - movs r1, 0 -_08167500: - subs r0, r3, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r0, 0 - bge _08167510 - subs r0, r2, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_08167510: - adds r0, r1, 0 - movs r1, 0x1 - bl sub_816753C - lsls r0, r4, 16 - asrs r0, 16 - movs r1, 0x2 - bl sub_816753C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81674BC - - thumb_func_start sub_816753C -sub_816753C: @ 816753C - 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, r1, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x0203bcac - mov r9, r0 - ldr r1, [r0] - lsls r5, 16 - asrs r0, r5, 14 - adds r0, r1, r0 - ldr r3, =0x00007fb8 - adds r2, r0, r3 - ldrb r7, [r2] - ldr r2, =0x00007fb9 - adds r0, r2 - ldrb r0, [r0] - mov r10, r0 - adds r3, 0x88 - adds r0, r1, r3 - ldrb r6, [r0] - movs r0, 0 - mov r8, r0 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - ldr r2, =0x00007b4d - adds r0, r2 - adds r0, r1, r0 - lsls r2, r4, 6 - ldr r3, =0x00007b95 - adds r2, r3 - adds r1, r2 - lsrs r5, 16 - str r5, [sp] - str r6, [sp, 0x4] - mov r2, r8 - str r2, [sp, 0x8] - adds r2, r7, 0 - mov r3, r10 - bl sub_81D2ED4 - mov r3, r9 - ldr r1, [r3] - ldr r2, =0x00007c58 - adds r0, r1, r2 - ldr r3, =0x00007fb0 - adds r1, r3 - str r5, [sp] - str r4, [sp, 0x4] - str r6, [sp, 0x8] - mov r2, r8 - str r2, [sp, 0xC] - adds r2, r7, 0 - mov r3, r10 - bl sub_81D2F78 - lsls r0, r4, 13 - movs r1, 0xC1 - lsls r1, 2 - adds r0, r1 - mov r3, r9 - ldr r1, [r3] - adds r0, r1, r0 - lsls r4, 7 - adds r4, 0x4 - adds r1, r4 - str r5, [sp] - str r6, [sp, 0x4] - mov r2, r8 - str r2, [sp, 0x8] - adds r2, r7, 0 - mov r3, r10 - bl sub_81D3094 - 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_816753C - - thumb_func_start sub_8167608 -sub_8167608: @ 8167608 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x28 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x0203bcac - ldr r3, [r1] - ldr r0, =0x00007b10 - mov r8, r0 - adds r0, r3, r0 - ldrb r0, [r0] - adds r7, r1, 0 - cmp r0, 0xFF - bne _08167714 - add r5, sp, 0x18 - add r4, sp, 0x20 - adds r0, r5, 0 - mov r1, sp - adds r2, r4, 0 - bl sub_81D31D0 - lsls r0, r6, 13 - movs r1, 0xC1 - lsls r1, 2 - adds r0, r1 - ldr r1, [r7] - adds r0, r1, r0 - str r0, [sp, 0x18] - lsls r0, r6, 7 - adds r0, 0x4 - adds r1, r0 - str r1, [sp, 0x20] - adds r0, r4, 0 - bl LoadTaggedObjectPalette - ldr r1, [r7] - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x00007b12 - adds r1, r2 - strh r0, [r1] - adds r0, r5, 0 - bl LoadObjectPic - ldr r1, [r7] - ldr r3, =0x00007b14 - adds r1, r3 - strh r0, [r1] - mov r0, sp - movs r1, 0x26 - movs r2, 0x68 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, [r7] - ldr r2, =0x00007b10 - adds r0, r2 - strb r1, [r0] - cmp r1, 0x40 - bne _081676AC - movs r0, 0x64 - bl FreeObjectTilesByTag - movs r0, 0x64 - bl FreeObjectPaletteByTag - ldr r0, [r7] - add r0, r8 - movs r1, 0xFF - strb r1, [r0] - b _08167742 - .pool -_081676AC: - ldr r0, [r7] - add r0, r8 - strb r1, [r0] - ldr r4, =0x02020630 - ldr r2, [r7] - mov r0, r8 - adds r3, r2, r0 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_8168168 - str r1, [r0] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x26] - subs r1, 0x22 - strh r1, [r0, 0x26] - ldr r3, =0x00007b18 - adds r1, r2, r3 - subs r3, 0x4 - adds r0, r2, r3 - ldrh r0, [r0] - lsls r0, 5 - ldr r3, =0x06010000 - adds r0, r3 - str r0, [r1] - ldr r0, =0x00007b12 - adds r2, r0 - ldrh r0, [r2] - lsls r0, 4 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - strh r0, [r2] - b _08167742 - .pool -_08167714: - lsls r1, r6, 13 - movs r0, 0xC1 - lsls r0, 2 - adds r1, r0 - adds r1, r3, r1 - ldr r2, =0x00007b18 - adds r0, r3, r2 - ldr r2, [r0] - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x80000400 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - lsls r0, r6, 7 - adds r0, 0x4 - adds r0, r3, r0 - ldr r2, =0x00007b12 - adds r1, r3, r2 - ldrh r1, [r1] - movs r2, 0x20 - bl gpu_pal_apply -_08167742: - add sp, 0x28 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167608 - - thumb_func_start sub_8167760 -sub_8167760: @ 8167760 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x60 - add r5, sp, 0x20 - add r4, sp, 0x38 - mov r0, sp - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_81D321C - mov r0, sp - bl LoadObjectPics - adds r0, r4, 0 - bl LoadTaggedObjectPalettes - movs r4, 0 - ldr r1, =0x0203bcac - ldr r0, [r1] - ldr r2, =0x00008040 - adds r0, r2 - ldrb r0, [r0] - subs r0, 0x1 - adds r6, r5, 0 - add r2, sp, 0x50 - mov r9, r2 - add r2, sp, 0x58 - mov r10, r2 - cmp r4, r0 - bge _0816781C - adds r5, r1, 0 - ldr r7, =0x02020630 - movs r0, 0x1C - adds r0, r7 - mov r8, r0 -_081677AC: - lsls r2, r4, 2 - adds r2, r4 - lsls r2, 18 - movs r1, 0x80 - lsls r1, 12 - adds r2, r1 - asrs r2, 16 - adds r0, r6, 0 - movs r1, 0xE2 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - beq _081677FC - ldr r0, [r5] - ldr r2, =0x00007b06 - adds r0, r2 - adds r0, r4 - strb r3, [r0] - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - adds r1, r0, r7 - strh r4, [r1, 0x2E] - add r0, r8 - ldr r1, =sub_8168180 - str r1, [r0] - b _08167808 - .pool -_081677FC: - ldr r0, [r5] - ldr r1, =0x00007b06 - adds r0, r1 - adds r0, r4 - movs r1, 0xFF - strb r1, [r0] -_08167808: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, [r5] - ldr r2, =0x00008040 - adds r0, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r4, r0 - blt _081677AC -_0816781C: - movs r0, 0x67 - strh r0, [r6] - cmp r4, 0x5 - bhi _0816788A - ldr r5, =0x0203bcac - ldr r7, =0x02020630 -_08167828: - lsls r2, r4, 2 - adds r2, r4 - lsls r2, 18 - movs r0, 0x80 - lsls r0, 12 - adds r2, r0 - asrs r2, 16 - adds r0, r6, 0 - movs r1, 0xE6 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - beq _08167874 - ldr r0, [r5] - ldr r1, =0x00007b06 - adds r0, r1 - adds r0, r4 - strb r3, [r0] - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - adds r1, r7 - ldrb r2, [r1, 0x3] - movs r0, 0x3F - ands r0, r2 - strb r0, [r1, 0x3] - b _08167880 - .pool -_08167874: - ldr r0, [r5] - ldr r2, =0x00007b06 - adds r0, r2 - adds r0, r4 - movs r1, 0xFF - strb r1, [r0] -_08167880: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x5 - bls _08167828 -_0816788A: - movs r0, 0x66 - strh r0, [r6] - ldr r0, =sub_81681B4 - str r0, [r6, 0x14] - lsls r2, r4, 2 - adds r2, r4 - lsls r2, 18 - movs r0, 0x80 - lsls r0, 12 - adds r2, r0 - asrs r2, 16 - adds r0, r6, 0 - movs r1, 0xDE - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - beq _081678F4 - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r1, =0x00007b06 - adds r0, r1 - adds r0, r4 - strb r3, [r0] - ldr r0, =0x02020630 - lsls r2, r3, 4 - adds r2, r3 - lsls r2, 2 - adds r2, r0 - ldrb r3, [r2, 0x1] - movs r1, 0x3F - adds r0, r1, 0 - ands r0, r3 - movs r3, 0x40 - orrs r0, r3 - strb r0, [r2, 0x1] - ldrb r0, [r2, 0x3] - ands r1, r0 - movs r0, 0x80 - orrs r1, r0 - strb r1, [r2, 0x3] - b _08167902 - .pool -_081678F4: - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r2, =0x00007b06 - adds r0, r2 - adds r0, r4 - movs r1, 0xFF - strb r1, [r0] -_08167902: - mov r0, r9 - mov r1, r10 - bl sub_81D32B0 - mov r0, r9 - bl LoadObjectPic - mov r0, r10 - bl LoadTaggedObjectPalette - add sp, 0x60 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167760 - - thumb_func_start sub_8167930 -sub_8167930: @ 8167930 - push {r4,r5,lr} - sub sp, 0x8 - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r2, =0x00008048 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0xB - bls _08167944 - b _08167B78 -_08167944: - lsls r0, 2 - ldr r1, =_0816795C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0816795C: - .4byte _0816798C - .4byte _08167A04 - .4byte _08167A38 - .4byte _08167A48 - .4byte _08167A5C - .4byte _08167A74 - .4byte _08167A9C - .4byte _08167AB0 - .4byte _08167AD4 - .4byte _08167AEC - .4byte _08167B1C - .4byte _08167B38 -_0816798C: - 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 r1, 0x88 - lsls r1, 6 - movs r0, 0x3 - movs r2, 0 - bl ChangeBgY - ldr r1, =0x00007040 - movs r0, 0 - bl SetGpuReg - movs r1, 0x91 - lsls r1, 2 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x0000040b - movs r0, 0x52 - bl SetGpuReg - b _08167B7E - .pool -_08167A04: - ldr r4, =0x0203bca4 - movs r0, 0xD0 - lsls r0, 5 - bl Alloc - str r0, [r4] - ldr r5, =0x0203bca0 - movs r4, 0xA0 - lsls r4, 3 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - ldr r5, =0x0203bca8 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - b _08167B7E - .pool -_08167A38: - ldr r0, =gUnknown_085DFB60 - ldr r1, =0x0203bca8 - b _08167AA0 - .pool -_08167A48: - ldr r1, =gUnknown_085DFA80 - movs r0, 0x3 - movs r2, 0xE0 - movs r3, 0 - bl LoadBgTiles - b _08167B7E - .pool -_08167A5C: - ldr r0, =0x0203bca8 - ldr r1, [r0] - movs r2, 0xA0 - lsls r2, 3 - movs r0, 0x3 - movs r3, 0 - bl LoadBgTilemap - b _08167B7E - .pool -_08167A74: - ldr r0, =gUnknown_085DFA60 - movs r1, 0xD0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r1, =0x00007b0e - adds r0, r1 - ldr r1, =0x0000ffb0 - strh r1, [r0] - b _08167B7E - .pool -_08167A9C: - ldr r0, =gUnknown_08DCCF7C - ldr r1, =0x0203bca4 -_08167AA0: - ldr r1, [r1] - bl LZ77UnCompVram - b _08167B7E - .pool -_08167AB0: - ldr r0, =gUnknown_08DCD81C - ldr r1, =0x0203bca0 - ldr r1, [r1] - bl LZ77UnCompVram - ldr r0, =gUnknown_08DCCF5C - movs r1, 0x20 - movs r2, 0x20 - bl gpu_pal_apply - b _08167B7E - .pool -_08167AD4: - ldr r0, =0x0203bca4 - ldr r1, [r0] - movs r2, 0xD0 - lsls r2, 5 - movs r3, 0xA0 - lsls r3, 2 - movs r0, 0x1 - bl LoadBgTiles - b _08167B7E - .pool -_08167AEC: - ldr r0, =0x0203bca0 - ldr r1, [r0] - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, =gUnknown_08DCDA30 - movs r0, 0xC - str r0, [sp] - movs r0, 0x4 - str r0, [sp, 0x4] - movs r0, 0x1 - movs r2, 0 - movs r3, 0xD - bl CopyToBgTilemapBufferRect - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - b _08167B7E - .pool -_08167B1C: - ldr r0, =gUnknown_085DFC0C - ldr r1, =0x0203bcac - ldr r1, [r1] - ldr r2, =0x00007304 - adds r1, r2 - bl LZ77UnCompVram - b _08167B7E - .pool -_08167B38: - ldr r0, =0x0203bcac - ldr r1, [r0] - ldr r0, =0x00007304 - adds r1, r0 - movs r2, 0xA0 - lsls r2, 3 - movs r0, 0x2 - movs r3, 0 - bl LoadBgTilemap - ldr r0, =gUnknown_086231E8 - movs r1, 0x30 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_08623208 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - movs r0, 0x2 - bl sub_81D21DC - b _08167B7E - .pool -_08167B78: - movs r0, 0 - strb r0, [r1] - b _08167B8E -_08167B7E: - ldr r0, =0x0203bcac - ldr r1, [r0] - ldr r2, =0x00008048 - adds r1, r2 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0x1 -_08167B8E: - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8167930 - - thumb_func_start sub_8167BA0 -sub_8167BA0: @ 8167BA0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 16 - lsrs r4, r0, 16 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r7, =0x0203bcac - ldr r3, [r7] - ldr r1, =0x00008041 - adds r0, r3, r1 - ldrb r1, [r0] - ldr r2, =0x00008040 - adds r0, r3, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - beq _08167C46 - lsls r2, r4, 6 - ldr r0, =0x00007b95 - adds r2, r0 - adds r2, r3, r2 - movs r0, 0x1 - str r0, [sp] - movs r5, 0 - str r5, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl Print - ldr r0, [r7] - ldr r1, =0x00008041 - adds r0, r1 - ldrb r0, [r0] - bl sub_81672A4 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - bl GetNature - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, [r7] - ldr r6, =0x0000804a - adds r0, r6 - ldr r1, =gUnknown_085EBF8D - bl CopyString - ldr r1, =gNatureNamePointers - lsls r4, 2 - adds r4, r1 - ldr r1, [r4] - bl CopyString - ldr r0, =gUnknown_085DFCC9 - str r0, [sp] - str r5, [sp, 0x4] - ldr r0, [r7] - adds r0, r6 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x2 - movs r3, 0x1 - bl box_print -_08167C46: - mov r2, r8 - cmp r2, 0 - beq _08167C84 - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram - b _08167C94 - .pool -_08167C84: - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram -_08167C94: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8167BA0 - - thumb_func_start sub_8167CA0 -sub_8167CA0: @ 8167CA0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0 - beq _08167CC0 - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r1, =0x00007fb5 - adds r0, r1 - b _08167CC8 - .pool -_08167CC0: - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r2, =0x00007fb4 - adds r0, r2 -_08167CC8: - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r5, =0x0203bcac - ldr r2, [r5] - ldr r3, =0x00007c58 - adds r0, r2, r3 - ldr r4, =0x00007fb3 - adds r1, r2, r4 - movs r3, 0 - ldrsb r3, [r1, r3] - lsls r1, r3, 2 - adds r1, r3 - lsls r1, 2 - ldr r4, =0x00007c6c - adds r1, r4 - adds r1, r2, r1 - lsls r3, r6, 2 - adds r3, r6 - lsls r3, 2 - adds r3, r4 - adds r2, r3 - bl sub_81D1F84 - ldr r4, [r5] - ldr r1, =0x00008041 - adds r0, r4, r1 - ldrb r1, [r0] - ldr r2, =0x00008040 - mov r12, r2 - adds r0, r4, r2 - ldrb r0, [r0] - subs r0, 0x1 - eors r1, r0 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - mov r8, r0 - cmp r7, 0 - beq _08167D98 - ldr r3, =0x00007fb4 - adds r0, r4, r3 - ldrb r1, [r0] - subs r2, 0x8B - adds r0, r4, r2 - strb r1, [r0] - ldr r0, [r5] - ldr r4, =0x00007fb3 - adds r1, r0, r4 - ldrb r1, [r1] - adds r0, r3 - strb r1, [r0] - ldr r0, [r5] - adds r0, r4 - strb r6, [r0] - ldr r0, [r5] - adds r2, r0, r2 - ldrb r1, [r2] - ldr r2, =0x00007fb6 - adds r0, r2 - strb r1, [r0] - ldr r1, [r5] - adds r3, 0x8D - adds r0, r1, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _08167D58 - mov r4, r12 - adds r0, r1, r4 - ldrb r0, [r0] -_08167D58: - subs r2, r0, 0x1 - ldr r0, =0x00008041 - adds r1, r0 - strb r2, [r1] - ldr r1, =0x0203bcac - ldr r3, [r1] - adds r0, r3, r0 - ldrb r0, [r0] - adds r6, r1, 0 - cmp r0, 0 - bne _08167D74 - ldr r1, =0x00008040 - adds r0, r3, r1 - ldrb r0, [r0] -_08167D74: - subs r1, r0, 0x1 - b _08167E1E - .pool -_08167D98: - ldr r3, =0x00007fb5 - adds r0, r4, r3 - ldrb r1, [r0] - ldr r2, =0x00007fb4 - adds r0, r4, r2 - strb r1, [r0] - ldr r0, [r5] - ldr r4, =0x00007fb3 - adds r1, r0, r4 - ldrb r1, [r1] - adds r0, r3 - strb r1, [r0] - ldr r0, [r5] - adds r0, r4 - strb r6, [r0] - ldr r0, [r5] - adds r2, r0, r2 - ldrb r1, [r2] - ldr r2, =0x00007fb6 - adds r0, r2 - strb r1, [r0] - ldr r2, [r5] - adds r3, 0x8C - adds r0, r2, r3 - ldrb r1, [r0] - adds r4, 0x8D - adds r0, r2, r4 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bge _08167DEC - adds r3, r1, 0x1 - b _08167DEE - .pool -_08167DEC: - movs r3, 0 -_08167DEE: - ldr r1, =0x00008041 - adds r0, r2, r1 - strb r3, [r0] - ldr r2, =0x0203bcac - ldr r3, [r2] - adds r1, r3, r1 - ldrb r1, [r1] - ldr r4, =0x00008040 - adds r0, r3, r4 - ldrb r0, [r0] - subs r0, 0x1 - adds r6, r2, 0 - cmp r1, r0 - bge _08167E1C - adds r1, 0x1 - b _08167E1E - .pool -_08167E1C: - movs r1, 0 -_08167E1E: - ldr r2, =0x00007b4c - adds r0, r3, r2 - strb r1, [r0] - adds r5, r6, 0 - ldr r0, [r5] - ldr r3, =0x00008041 - adds r1, r0, r3 - ldrb r2, [r1] - ldr r4, =0x00008040 - adds r1, r0, r4 - ldrb r1, [r1] - subs r1, 0x1 - eors r2, r1 - negs r1, r2 - orrs r1, r2 - lsrs r4, r1, 31 - ldr r1, =0x00007b1c - adds r0, r1 - bl sub_81D3520 - mov r2, r8 - cmp r2, 0 - bne _08167E70 - ldr r0, [r5] - ldr r3, =0x00008044 - adds r0, r3 - ldr r1, =sub_8167EA4 - b _08167E90 - .pool -_08167E70: - cmp r4, 0 - bne _08167E88 - ldr r0, [r5] - ldr r4, =0x00008044 - adds r0, r4 - ldr r1, =sub_8167FA4 - b _08167E90 - .pool -_08167E88: - ldr r0, [r6] - ldr r1, =0x00008044 - adds r0, r1 - ldr r1, =sub_8168048 -_08167E90: - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8167CA0 - - thumb_func_start sub_8167EA4 -sub_8167EA4: @ 8167EA4 - push {r4-r6,lr} - ldr r4, =0x0203bcac - ldr r1, [r4] - ldr r5, =0x00008048 - adds r0, r1, r5 - ldrb r0, [r0] - cmp r0, 0x1 - beq _08167EE4 - cmp r0, 0x1 - bgt _08167EC8 - cmp r0, 0 - beq _08167ED2 - b _08167F9C - .pool -_08167EC8: - cmp r0, 0x2 - beq _08167F08 - cmp r0, 0x3 - beq _08167F48 - b _08167F9C -_08167ED2: - ldr r2, =0x00007fb3 - adds r0, r1, r2 - ldrb r0, [r0] - bl sub_8167608 - b _08167F2C - .pool -_08167EE4: - ldr r6, =0x00007fb3 - adds r0, r1, r6 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - bl sub_8167BA0 - ldr r1, [r4] - ldr r0, =0x00008048 - adds r1, r0 - b _08167F30 - .pool -_08167F08: - ldr r2, =0x00007c58 - adds r0, r1, r2 - ldr r6, =0x00007b0e - adds r1, r6 - bl sub_81D3178 - lsls r0, 24 - cmp r0, 0 - bne _08167F9C - ldr r1, [r4] - ldr r2, =0x00007b4c - adds r0, r1, r2 - ldrb r0, [r0] - ldr r6, =0x00007fb6 - adds r1, r6 - ldrb r1, [r1] - bl sub_816753C -_08167F2C: - ldr r1, [r4] - adds r1, r5 -_08167F30: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08167F9C - .pool -_08167F48: - ldr r2, =0x00007b1c - adds r0, r1, r2 - bl sub_81D3464 - ldr r3, [r4] - ldr r6, =0x00008041 - adds r0, r3, r6 - ldrb r1, [r0] - ldr r2, =0x00008040 - adds r0, r3, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - beq _08167F82 - subs r6, 0x8E - adds r0, r3, r6 - movs r1, 0 - ldrsb r1, [r0, r1] - subs r2, 0x90 - adds r0, r3, r2 - adds r0, r1 - ldrb r2, [r0] - ldr r6, =0x00007b1c - adds r0, r3, r6 - subs r6, 0xC - adds r1, r3, r6 - ldrb r1, [r1] - bl sub_81D3480 -_08167F82: - ldr r0, [r4] - adds r0, r5 - movs r1, 0 - strb r1, [r0] - movs r0, 0 - b _08167F9E - .pool -_08167F9C: - movs r0, 0x1 -_08167F9E: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8167EA4 - - thumb_func_start sub_8167FA4 -sub_8167FA4: @ 8167FA4 - push {r4,r5,lr} - ldr r4, =0x0203bcac - ldr r1, [r4] - ldr r5, =0x00008048 - adds r2, r1, r5 - ldrb r0, [r2] - cmp r0, 0x1 - beq _08167FF0 - cmp r0, 0x1 - bgt _08167FC8 - cmp r0, 0 - beq _08167FD2 - b _0816803E - .pool -_08167FC8: - cmp r0, 0x2 - beq _08168014 - cmp r0, 0x3 - beq _08168038 - b _0816803E -_08167FD2: - ldr r2, =0x00007c58 - adds r0, r1, r2 - ldr r2, =0x00007b0e - adds r1, r2 - bl sub_81D31A4 - lsls r0, 24 - cmp r0, 0 - bne _0816803E - b _08168024 - .pool -_08167FF0: - ldr r2, =0x00007fb3 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - bl sub_8167BA0 - ldr r1, [r4] - ldr r0, =0x00008048 - adds r1, r0 - b _08168028 - .pool -_08168014: - ldr r2, =0x00007b4c - adds r0, r1, r2 - ldrb r0, [r0] - ldr r2, =0x00007fb6 - adds r1, r2 - ldrb r1, [r1] - bl sub_816753C -_08168024: - ldr r1, [r4] - adds r1, r5 -_08168028: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0816803E - .pool -_08168038: - movs r0, 0 - strb r0, [r2] - b _08168040 -_0816803E: - movs r0, 0x1 -_08168040: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8167FA4 - - thumb_func_start sub_8168048 -sub_8168048: @ 8168048 - push {r4-r6,lr} - ldr r4, =0x0203bcac - ldr r1, [r4] - ldr r5, =0x00008048 - adds r0, r1, r5 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081680A8 - cmp r0, 0x1 - bgt _0816806C - cmp r0, 0 - beq _08168076 - b _08168160 - .pool -_0816806C: - cmp r0, 0x2 - beq _081680CC - cmp r0, 0x3 - beq _0816810C - b _08168160 -_08168076: - ldr r2, =0x00007c58 - adds r0, r1, r2 - bl sub_81D2074 - ldr r0, [r4] - ldr r6, =0x00007b0e - adds r0, r6 - bl sub_81D3150 - lsls r0, 24 - cmp r0, 0 - bne _08168160 - ldr r0, [r4] - ldr r1, =0x00007fb3 - adds r0, r1 - ldrb r0, [r0] - bl sub_8167608 - b _081680F0 - .pool -_081680A8: - ldr r2, =0x00007fb3 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - bl sub_8167BA0 - ldr r1, [r4] - ldr r6, =0x00008048 - adds r1, r6 - b _081680F4 - .pool -_081680CC: - ldr r2, =0x00007c58 - adds r0, r1, r2 - ldr r6, =0x00007b0e - adds r1, r6 - bl sub_81D3178 - lsls r0, 24 - cmp r0, 0 - bne _08168160 - ldr r1, [r4] - ldr r2, =0x00007b4c - adds r0, r1, r2 - ldrb r0, [r0] - ldr r6, =0x00007fb6 - adds r1, r6 - ldrb r1, [r1] - bl sub_816753C -_081680F0: - ldr r1, [r4] - adds r1, r5 -_081680F4: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08168160 - .pool -_0816810C: - ldr r2, =0x00007b1c - adds r0, r1, r2 - bl sub_81D3464 - ldr r3, [r4] - ldr r6, =0x00008041 - adds r0, r3, r6 - ldrb r1, [r0] - ldr r2, =0x00008040 - adds r0, r3, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - beq _08168146 - subs r6, 0x8E - adds r0, r3, r6 - movs r1, 0 - ldrsb r1, [r0, r1] - subs r2, 0x90 - adds r0, r3, r2 - adds r0, r1 - ldrb r2, [r0] - ldr r6, =0x00007b1c - adds r0, r3, r6 - subs r6, 0xC - adds r1, r3, r6 - ldrb r1, [r1] - bl sub_81D3480 -_08168146: - ldr r0, [r4] - adds r0, r5 - movs r1, 0 - strb r1, [r0] - movs r0, 0 - b _08168162 - .pool -_08168160: - movs r0, 0x1 -_08168162: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8168048 - - thumb_func_start sub_8168168 -sub_8168168: @ 8168168 - ldr r1, =0x0203bcac - ldr r1, [r1] - ldr r2, =0x00007b0e - adds r1, r2 - ldrh r1, [r1] - adds r1, 0x26 - strh r1, [r0, 0x20] - bx lr - .pool - thumb_func_end sub_8168168 - - thumb_func_start sub_8168180 -sub_8168180: @ 8168180 - push {lr} - adds r2, r0, 0 - movs r0, 0x2E - ldrsh r1, [r2, r0] - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r3, =0x00008041 - adds r0, r3 - ldrb r0, [r0] - cmp r1, r0 - bne _081681A8 - adds r0, r2, 0 - movs r1, 0 - bl StartObjectImageAnim - b _081681B0 - .pool -_081681A8: - adds r0, r2, 0 - movs r1, 0x1 - bl StartObjectImageAnim -_081681B0: - pop {r0} - bx r0 - thumb_func_end sub_8168180 - - thumb_func_start sub_81681B4 -sub_81681B4: @ 81681B4 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r2, =0x00008041 - adds r1, r0, r2 - ldrb r1, [r1] - subs r2, 0x1 - adds r0, r2 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bne _081681DC - movs r0, 0x65 - b _081681DE - .pool -_081681DC: - movs r0, 0x66 -_081681DE: - bl IndexOfObjectPaletteTag - lsls r0, 4 - ldrb r2, [r4, 0x5] - movs r1, 0xF - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0x5] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81681B4 - - thumb_func_start sub_81681F4 -sub_81681F4: @ 81681F4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x30 - bl pokemon_getattr - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r3, =0x00007fb3 - adds r1, r0, r3 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - subs r3, 0x3 - adds r0, r3 - adds r4, r0, r1 - cmp r2, 0xFF - beq _0816823C - adds r0, r2, 0 - movs r1, 0x1D - bl __udivsi3 - b _0816823E - .pool -_0816823C: - movs r0, 0x9 -_0816823E: - strb r0, [r4] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81681F4 - - thumb_func_start sub_8168248 -sub_8168248: @ 8168248 - push {lr} - sub sp, 0x10 - ldr r0, =gUnknown_085DFDB8 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x8] - str r1, [sp, 0xC] - ldr r0, =gUnknown_08DCCBB8 - str r0, [sp] - ldr r1, =0xffff0000 - ldr r0, [sp, 0x4] - ands r0, r1 - movs r1, 0x80 - lsls r1, 4 - orrs r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - adds r1, 0x1 - orrs r0, r1 - str r0, [sp, 0x4] - mov r0, sp - bl LoadCompressedObjectPic - add r0, sp, 0x8 - bl LoadTaggedObjectPalette - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8168248 - - thumb_func_start sub_8168294 -sub_8168294: @ 8168294 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x0203bcac - ldr r0, [r0] - ldr r1, =0x00007b44 - adds r7, r0, r1 - ldr r0, =gUnknown_085DFDA0 - mov r10, r0 - movs r6, 0 - movs r1, 0x40 - mov r9, r1 - movs r0, 0x60 - negs r0, r0 - mov r8, r0 -_081682B6: - mov r5, r9 - muls r5, r6 - mov r0, r8 - adds r1, r0, r5 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x11 - lsls r2, r0, 16 - mov r0, r10 - asrs r2, 16 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _081682FE - ldr r0, =0x02020630 - lsls r4, r1, 4 - adds r4, r1 - lsls r4, 2 - adds r4, r0 - movs r1, 0x8 - strh r1, [r4, 0x2E] - movs r0, 0x20 - orrs r5, r0 - strh r5, [r4, 0x30] - strh r6, [r4, 0x32] - lsls r1, r6, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - lsls r0, r6, 2 - adds r0, r7 - str r4, [r0] -_081682FE: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x1 - bls _081682B6 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8168294 - - thumb_func_start sub_8168328 -sub_8168328: @ 8168328 - push {r4,r5,lr} - ldr r4, =0x0203bcac - ldr r0, [r4] - ldr r5, =0x00008048 - adds r0, r5 - ldrb r0, [r0] - cmp r0, 0 - beq _08168348 - cmp r0, 0x1 - beq _08168360 - b _0816836C - .pool -_08168348: - bl sub_8168248 - ldr r1, [r4] - ldr r0, =0x00008048 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0x1 - b _0816836E - .pool -_08168360: - bl sub_8168294 - ldr r0, [r4] - adds r0, r5 - movs r1, 0 - strb r1, [r0] -_0816836C: - movs r0, 0 -_0816836E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8168328 - - thumb_func_start sub_8168374 -sub_8168374: @ 8168374 - push {r4,lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x20] - ldrh r1, [r2, 0x2E] - adds r3, r0, r1 - strh r3, [r2, 0x20] - lsls r0, 16 - asrs r4, r0, 16 - movs r0, 0x30 - ldrsh r1, [r2, r0] - cmp r4, r1 - bgt _08168398 - lsls r0, r3, 16 - asrs r0, 16 - cmp r0, r1 - bge _081683A0 - cmp r4, r1 - blt _081683A8 -_08168398: - lsls r0, r3, 16 - asrs r0, 16 - cmp r0, r1 - bgt _081683A8 -_081683A0: - ldrh r0, [r2, 0x30] - strh r0, [r2, 0x20] - ldr r0, =DummyObjectCallback - str r0, [r2, 0x1C] -_081683A8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8168374 - - thumb_func_start nullsub_117 -nullsub_117: @ 81683B4 - bx lr - thumb_func_end nullsub_117 - - thumb_func_start bx_goto_buffer_A_ch0_tbl3 -bx_goto_buffer_A_ch0_tbl3: @ 81683B8 - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_exec_buffer_A_ch0_tbl2 - str r1, [r0] - ldr r2, =0x0202449c - ldr r0, [r2] - adds r0, 0x94 - movs r1, 0 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0x95 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0x96 - strb r1, [r0] - ldr r0, [r2] - adds r0, 0x97 - strb r1, [r0] - bx lr - .pool - thumb_func_end bx_goto_buffer_A_ch0_tbl3 - - thumb_func_start bx_exec_buffer_A_ch0_tbl2 -bx_exec_buffer_A_ch0_tbl2: @ 81683F4 - push {lr} - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldr r0, =0x02024064 - ldrb r3, [r0] - lsls r0, r3, 2 - adds r0, r1 - ldr r1, [r2] - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08168440 - ldr r0, =0x02023064 - lsls r1, r3, 9 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0x38 - bhi _0816843C - ldr r0, =gUnknown_085DFDC0 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 - b _08168440 - .pool -_0816843C: - bl dp01_tbl5_exec_completed -_08168440: - pop {r0} - bx r0 - thumb_func_end bx_exec_buffer_A_ch0_tbl2 - - thumb_func_start sub_8168444 -sub_8168444: @ 8168444 - push {r4,r5,lr} - ldr r1, =0x0202449c - ldr r0, [r1] - adds r0, 0x94 - ldrb r0, [r0] - adds r4, r1, 0 - cmp r0, 0x5 - bls _08168456 - b _08168564 -_08168456: - lsls r0, 2 - ldr r1, =_08168468 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08168468: - .4byte _08168480 - .4byte _08168492 - .4byte _081684B0 - .4byte _081684CE - .4byte _08168508 - .4byte _08168540 -_08168480: - ldr r0, [r4] - adds r0, 0x96 - movs r1, 0x40 - strb r1, [r0] - ldr r1, [r4] - adds r1, 0x94 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_08168492: - ldr r1, [r4] - adds r1, 0x96 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _08168564 - movs r0, 0x5 - bl audio_play - movs r0, 0x1 - movs r1, 0 - b _081684E4 -_081684B0: - ldr r1, [r4] - adds r1, 0x96 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _08168564 - movs r0, 0x5 - bl audio_play - movs r0, 0x1 - movs r1, 0 - b _081684E4 -_081684CE: - ldr r1, [r4] - adds r1, 0x96 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _08168564 - movs r0, 0x1 - movs r1, 0x9 -_081684E4: - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - bl dp01_tbl5_exec_completed - ldr r1, [r4] - adds r1, 0x94 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r4] - adds r0, 0x95 - strb r5, [r0] - ldr r0, [r4] - adds r0, 0x96 - movs r1, 0x40 - strb r1, [r0] - b _08168564 -_08168508: - ldr r1, [r4] - adds r1, 0x96 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - bne _08168564 - movs r0, 0x5 - bl audio_play - movs r0, 0 - bl sub_8059CF8 - movs r0, 0x1 - movs r1, 0 - bl sub_8059CB4 - ldr r0, [r4] - adds r0, 0x96 - movs r1, 0x40 - strb r1, [r0] - ldr r1, [r4] - adds r1, 0x94 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08168564 -_08168540: - ldr r1, [r4] - adds r1, 0x96 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - bne _08168564 - movs r0, 0x5 - bl audio_play - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - bl dp01_tbl5_exec_completed -_08168564: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8168444 - - thumb_func_start sub_816856C -sub_816856C: @ 816856C - push {lr} - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - 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, =DummyObjectCallback - cmp r1, r0 - bne _08168590 - bl dp01_tbl5_exec_completed -_08168590: - pop {r0} - bx r0 - .pool - thumb_func_end sub_816856C - - thumb_func_start sub_81685A4 -sub_81685A4: @ 81685A4 - push {lr} - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - bne _081685B6 - bl dp01_tbl5_exec_completed -_081685B6: - pop {r0} - bx r0 - thumb_func_end sub_81685A4 - - thumb_func_start bx_wait_t5 -bx_wait_t5: @ 81685BC - push {lr} - ldr r0, =0x020244b9 - ldrb r0, [r0] - cmp r0, 0 - bne _081685CA - bl dp01_tbl5_exec_completed -_081685CA: - pop {r0} - bx r0 - .pool - thumb_func_end bx_wait_t5 - - thumb_func_start sub_81685D4 -sub_81685D4: @ 81685D4 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081685FC - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8168610 - str r1, [r0] - bl nullsub_35 - bl FreeAllWindowBuffers - bl DoWallyTutorialBagMenu -_081685FC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81685D4 - - thumb_func_start sub_8168610 -sub_8168610: @ 8168610 - push {lr} - ldr r0, =0x030022c0 - ldr r1, [r0, 0x4] - ldr r0, =sub_8038420 - cmp r1, r0 - bne _08168636 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08168636 - ldr r0, =0x0203ce7c - ldrh r1, [r0] - movs r0, 0x1 - bl dp01_build_cmdbuf_x23_aa_0 - bl dp01_tbl5_exec_completed -_08168636: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8168610 - - thumb_func_start sub_816864C -sub_816864C: @ 816864C - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r5, =0x02024064 - 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 r7, 0x88 - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - bne _08168684 - ldr r0, =0x0202406e - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_08168684: - ldr r1, [r4] - ldrb r0, [r5] - 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, r7, 0 - ands r0, r1 - cmp r0, 0 - bne _081686B6 - ldr r0, =0x0202406e - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_081686B6: - ldr r0, [r4] - ldrb r2, [r5] - ldr r3, [r0, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0] - movs r4, 0x8 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _081686D2 - b _081687DC -_081686D2: - adds r1, r2, 0 - eors r1, r6 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r1, [r0] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - bne _081687DC - ldr r0, =0x02020630 - mov r8, r0 - ldr r7, =0x03005d7c - adds r0, r2, r7 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - mov r4, r8 - adds r4, 0x1C - adds r0, r4 - ldr r3, [r0] - ldr r0, =DummyObjectCallback - cmp r3, r0 - bne _081687DC - ldr r0, =0x020241e4 - adds r0, r2, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - cmp r0, r3 - bne _081687DC - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _0816877A - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0816877A - ldrb r0, [r5] - eors r0, r6 - adds r0, r7 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - bl RemoveObjectAndFreeTiles - ldr r4, =0x03005d70 - ldrb r0, [r5] - adds r1, r6, 0 - eors r1, r0 - adds r0, r1, r4 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0 - bl healthbar_draw_field_maybe - ldrb r0, [r5] - eors r0, r6 - bl sub_8076918 - ldrb r0, [r5] - eors r0, r6 - adds r0, r4 - ldrb r0, [r0] - bl sub_80729D0 -_0816877A: - ldr r1, =0x03005d7c - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - ldr r5, =0x03005d70 - ldrb r1, [r4] - adds r0, r1, r5 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - 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 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r2, [r0, 0x8] - ldrb r1, [r2, 0x9] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x9] - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8168818 - str r1, [r0] -_081687DC: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816864C - - thumb_func_start sub_8168818 -sub_8168818: @ 8168818 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r4, 0 - ldr r2, =0x02020630 - ldr r0, =0x03005d70 - ldr r1, =0x02024064 - mov r8, r1 - ldrb r3, [r1] - 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, =DummyObjectCallback - cmp r1, r0 - bne _08168842 - movs r4, 0x1 -_08168842: - cmp r4, 0 - beq _08168904 - ldr r7, =0x020244d0 - ldr r0, [r7] - ldr r4, [r0, 0x4] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r2, r0, r4 - ldrb r1, [r2, 0x1] - movs r5, 0x1 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _08168904 - movs r6, 0x2 - adds r1, r6, 0 - eors r1, r3 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x1] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _08168904 - ldrb r1, [r2] - movs r3, 0x7F - adds r0, r3, 0 - ands r0, r1 - strb r0, [r2] - ldr r0, [r7] - mov r1, r8 - ldrb r2, [r1] - 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] - ldr r2, [r7] - mov r1, r8 - ldrb r0, [r1] - adds r1, r6, 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] - ldr r2, [r7] - mov r1, r8 - ldrb r0, [r1] - adds r1, r6, 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 FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - ldr r0, =c3_0802FDF4 - movs r1, 0xA - bl CreateTask - ldr r2, =0x0202406e - mov r0, r8 - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - adds r0, r2 - bl sub_805E990 - bl dp01_tbl5_exec_completed -_08168904: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8168818 - - thumb_func_start sub_8168934 -sub_8168934: @ 8168934 - push {r4-r6,lr} - ldr r5, =0x02024064 - ldrb r0, [r5] - ldr r6, =0x03005d70 - 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 _0816897C - ldrb r0, [r5] - adds r0, r6 - ldrb r0, [r0] - movs r2, 0 - bl heathbar_draw_hp - b _08168996 - .pool -_0816897C: - ldr r2, =0x0202406e - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - adds r0, r2 - bl sub_805E990 - bl dp01_tbl5_exec_completed -_08168996: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8168934 - - thumb_func_start bx_blink_t5 -bx_blink_t5: @ 81689A4 - push {r4,lr} - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - ldr r2, =0x02020630 - 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 _081689F0 - 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, =0x020244b9 - strb r3, [r0] - bl dp01_tbl5_exec_completed - b _08168A1A - .pool -_081689F0: - ldrh r0, [r4, 0x30] - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _08168A14 - 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] -_08168A14: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] -_08168A1A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end bx_blink_t5 - - thumb_func_start sub_8168A20 -sub_8168A20: @ 8168A20 - push {r4-r6,lr} - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r6, =0x02024064 - 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 _08168A74 - ldr r5, =0x020241e4 - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r1, =0x03005d70 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl dp01_tbl5_exec_completed -_08168A74: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8168A20 - - thumb_func_start sub_8168A90 -sub_8168A90: @ 8168A90 - push {lr} - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - 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, =DummyObjectCallback - cmp r1, r0 - bne _08168AB4 - bl dp01_tbl5_exec_completed -_08168AB4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8168A90 - - thumb_func_start sub_8168AC8 -sub_8168AC8: @ 8168AC8 - push {lr} - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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 _08168AEA - bl dp01_tbl5_exec_completed -_08168AEA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8168AC8 - - thumb_func_start dp01_tbl5_exec_completed -dp01_tbl5_exec_completed: @ 8168AF8 - push {r4,lr} - sub sp, 0x4 - ldr r1, =0x03005d60 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_exec_buffer_A_ch0_tbl2 - str r1, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08168B4C - bl link_get_multiplayer_id - mov r1, sp - strb r0, [r1] - movs r0, 0x2 - movs r1, 0x4 - mov r2, sp - bl dp01_prepare_buffer_wireless_probably - ldr r1, =0x02023064 - ldrb r0, [r4] - lsls r0, 9 - adds r0, r1 - movs r1, 0x38 - strb r1, [r0] - b _08168B5E - .pool -_08168B4C: - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - ldr r0, [r2] - bics r0, r1 - str r0, [r2] -_08168B5E: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01_tbl5_exec_completed - - thumb_func_start sub_8168B70 -sub_8168B70: @ 8168B70 - push {lr} - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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 _08168B92 - bl dp01_tbl5_exec_completed -_08168B92: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8168B70 - - thumb_func_start dp01t_00_5_getattr -dp01t_00_5_getattr: @ 8168BA0 - push {r4-r6,lr} - sub sp, 0x100 - movs r6, 0 - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _08168BD8 - ldr r0, =0x0202406e - lsls r1, r2, 1 - adds r1, r0 - ldrb r0, [r1] - mov r1, sp - bl sub_8168C14 - adds r6, r0, 0 - b _08168BFA - .pool -_08168BD8: - ldrb r4, [r1] - movs r5, 0 -_08168BDC: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _08168BF2 - lsls r0, r5, 24 - lsrs r0, 24 - mov r2, sp - adds r1, r2, r6 - bl sub_8168C14 - adds r6, r0 -_08168BF2: - lsrs r4, 1 - adds r5, 0x1 - cmp r5, 0x5 - ble _08168BDC -_08168BFA: - lsls r1, r6, 16 - lsrs r1, 16 - movs r0, 0x1 - mov r2, sp - bl dp01_build_cmdbuf_x1D_1D_numargs_varargs - bl dp01_tbl5_exec_completed - add sp, 0x100 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end dp01t_00_5_getattr - - thumb_func_start sub_8168C14 -sub_8168C14: @ 8168C14 - 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, =0x02023064 - ldr r3, =0x02024064 - ldrb r0, [r3] - lsls r0, 9 - adds r1, r2, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3B - bls _08168C3E - bl _081693AA -_08168C3E: - lsls r0, 2 - ldr r1, =_08168C54 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08168C54: - .4byte _08168D44 - .4byte _08168F68 - .4byte _08168F78 - .4byte _08168F88 - .4byte _08168FF0 - .4byte _08168FF0 - .4byte _08168FF0 - .4byte _08168FF0 - .4byte _0816900C - .4byte _08169048 - .4byte _08169048 - .4byte _08169048 - .4byte _08169048 - .4byte _081693AA - .4byte _081693AA - .4byte _081693AA - .4byte _081693AA - .4byte _08169064 - .4byte _08169074 - .4byte _081690A4 - .4byte _081690B4 - .4byte _081690C4 - .4byte _081690D4 - .4byte _081690E4 - .4byte _081690F4 - .4byte _08169104 - .4byte _08169114 - .4byte _08169124 - .4byte _08169134 - .4byte _08169144 - .4byte _08169154 - .4byte _08169164 - .4byte _081691B4 - .4byte _081691C4 - .4byte _081691D4 - .4byte _081691E4 - .4byte _081691F4 - .4byte _08169204 - .4byte _08169214 - .4byte _08169224 - .4byte _08169234 - .4byte _08169268 - .4byte _08169278 - .4byte _08169288 - .4byte _08169298 - .4byte _081692A8 - .4byte _081692B8 - .4byte _081692C8 - .4byte _081692D8 - .4byte _081692F8 - .4byte _08169308 - .4byte _08169318 - .4byte _08169328 - .4byte _08169338 - .4byte _08169348 - .4byte _08169358 - .4byte _08169368 - .4byte _08169378 - .4byte _08169388 - .4byte _08169398 -_08168D44: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - mov r1, sp - strh r0, [r1] - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr - 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 -_08168D90: - adds r1, r6, 0 - adds r1, 0xD - mov r0, r8 - bl pokemon_getattr - strh r0, [r4] - adds r1, r6, 0 - adds r1, 0x11 - mov r0, r8 - bl pokemon_getattr - mov r2, r9 - adds r1, r2, r6 - strb r0, [r1] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x3 - ble _08168D90 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - bl pokemon_getattr - mov r1, r10 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x20 - bl pokemon_getattr - ldr r2, [sp, 0x80] - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x19 - bl pokemon_getattr - str r0, [sp, 0x44] - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - str r0, [sp, 0x48] - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - str r0, [sp, 0x4C] - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - ldr r1, [sp, 0x7C] - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x28] - adds r0, r4, 0 - movs r1, 0x3A - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2C] - adds r0, r4, 0 - movs r1, 0x3B - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2] - adds r0, r4, 0 - movs r1, 0x3C - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x4] - adds r0, r4, 0 - movs r1, 0x3D - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x6] - adds r0, r4, 0 - movs r1, 0x3E - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x8] - adds r0, r4, 0 - movs r1, 0x3F - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0xA] - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - str r0, [sp, 0x54] - adds r0, r4, 0 - movs r1, 0x2 - ldr r2, [sp, 0x8C] - bl pokemon_getattr - ldr r0, [sp, 0x84] - ldr r1, [sp, 0x8C] - bl CopyString_Limit10 - adds r0, r4, 0 - movs r1, 0x7 - ldr r2, [sp, 0x88] - bl pokemon_getattr - mov r2, sp - movs r6, 0 -_08168F48: - adds r0, r7, r6 - adds r1, r2, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0x57 - bls _08168F48 - b _081693AA - .pool -_08168F68: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - b _081692E2 - .pool -_08168F78: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xC - b _081692E2 - .pool -_08168F88: - 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, =0x020244ec - adds r4, r1, r0 - mov r8, r9 -_08168F9E: - adds r1, r6, 0 - adds r1, 0xD - adds r0, r4, 0 - bl pokemon_getattr - mov r1, r8 - strh r0, [r1] - adds r1, r6, 0 - adds r1, 0x11 - adds r0, r4, 0 - bl pokemon_getattr - mov r2, r10 - adds r1, r2, r6 - strb r0, [r1] - movs r0, 0x2 - add r8, r0 - adds r6, 0x1 - cmp r6, 0x3 - ble _08168F9E - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - mov r1, r9 - strb r0, [r1, 0xC] - mov r2, r9 - movs r6, 0 -_08168FDC: - adds r0, r7, r6 - adds r1, r2, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0xF - bls _08168FDC - b _081693AA - .pool -_08168FF0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldrb r1, [r3] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - adds r1, 0x9 - b _081692E2 - .pool -_0816900C: - movs r6, 0 - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r2, =0x020244ec - mov r8, r2 -_08169018: - adds r1, r6, 0 - adds r1, 0x11 - mov r2, r8 - adds r0, r4, r2 - bl pokemon_getattr - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - cmp r6, 0x3 - ble _08169018 - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - b _081693AA - .pool -_08169048: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldrb r1, [r3] - lsls r1, 9 - adds r2, 0x1 - adds r1, r2 - ldrb r1, [r1] - adds r1, 0x8 - b _081693A2 - .pool -_08169064: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1 - b _0816907E - .pool -_08169074: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x19 -_0816907E: - bl pokemon_getattr - 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 _081693AA - .pool -_081690A4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1A - b _081693A2 - .pool -_081690B4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1B - b _081693A2 - .pool -_081690C4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1C - b _081693A2 - .pool -_081690D4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1D - b _081693A2 - .pool -_081690E4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1E - b _081693A2 - .pool -_081690F4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1F - b _081693A2 - .pool -_08169104: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x20 - b _081693A2 - .pool -_08169114: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x22 - b _081693A2 - .pool -_08169124: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x23 - b _081693A2 - .pool -_08169134: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x24 - b _081693A2 - .pool -_08169144: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x25 - b _081693A2 - .pool -_08169154: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x26 - b _081693A2 - .pool -_08169164: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_getattr - strb r0, [r7] - adds r0, r4, 0 - movs r1, 0x28 - bl pokemon_getattr - strb r0, [r7, 0x1] - adds r0, r4, 0 - movs r1, 0x29 - bl pokemon_getattr - strb r0, [r7, 0x2] - adds r0, r4, 0 - movs r1, 0x2A - bl pokemon_getattr - strb r0, [r7, 0x3] - adds r0, r4, 0 - movs r1, 0x2B - bl pokemon_getattr - strb r0, [r7, 0x4] - adds r0, r4, 0 - movs r1, 0x2C - bl pokemon_getattr - strb r0, [r7, 0x5] - movs r6, 0x6 - b _081693AA - .pool -_081691B4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x27 - b _081693A2 - .pool -_081691C4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x28 - b _081693A2 - .pool -_081691D4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x29 - b _081693A2 - .pool -_081691E4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2A - b _081693A2 - .pool -_081691F4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2B - b _081693A2 - .pool -_08169204: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2C - b _081693A2 - .pool -_08169214: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0 - b _0816923E - .pool -_08169224: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x9 - b _081692E2 - .pool -_08169234: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x37 -_0816923E: - bl pokemon_getattr - 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 _081693AA - .pool -_08169268: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x38 - b _081693A2 - .pool -_08169278: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x39 - b _081692E2 - .pool -_08169288: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3A - b _081692E2 - .pool -_08169298: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3B - b _081692E2 - .pool -_081692A8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3C - b _081692E2 - .pool -_081692B8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3D - b _081692E2 - .pool -_081692C8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3E - b _081692E2 - .pool -_081692D8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3F -_081692E2: - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - strb r0, [r7] - lsrs r0, 8 - strb r0, [r7, 0x1] - movs r6, 0x2 - b _081693AA - .pool -_081692F8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x16 - b _081693A2 - .pool -_08169308: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x17 - b _081693A2 - .pool -_08169318: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x18 - b _081693A2 - .pool -_08169328: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x21 - b _081693A2 - .pool -_08169338: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2F - b _081693A2 - .pool -_08169348: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x30 - b _081693A2 - .pool -_08169358: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x32 - b _081693A2 - .pool -_08169368: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x33 - b _081693A2 - .pool -_08169378: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x34 - b _081693A2 - .pool -_08169388: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x35 - b _081693A2 - .pool -_08169398: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x36 -_081693A2: - bl pokemon_getattr - strb r0, [r7] - movs r6, 0x1 -_081693AA: - 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_8168C14 - - thumb_func_start sub_81693C0 -sub_81693C0: @ 81693C0 - push {lr} - bl sub_805A614 - pop {r0} - bx r0 - thumb_func_end sub_81693C0 - - thumb_func_start sub_81693CC -sub_81693CC: @ 81693CC - push {r4,r5,lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _081693FC - ldr r0, =0x0202406e - lsls r1, r2, 1 - adds r1, r0 - ldrb r0, [r1] - bl sub_8169424 - b _0816941A - .pool -_081693FC: - ldrb r4, [r1] - movs r5, 0 -_08169400: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0816940E - adds r0, r5, 0 - bl sub_8169424 -_0816940E: - lsrs r4, 1 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _08169400 -_0816941A: - bl dp01_tbl5_exec_completed - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81693CC - - thumb_func_start sub_8169424 -sub_8169424: @ 8169424 - 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, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - ldr r2, =0x02023067 - 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 _08169450 - bl _08169DEA -_08169450: - lsls r0, 2 - ldr r1, =_08169468 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08169468: - .4byte _08169558 - .4byte _081696F0 - .4byte _08169710 - .4byte _08169730 - .4byte _08169788 - .4byte _08169788 - .4byte _08169788 - .4byte _08169788 - .4byte _081697B0 - .4byte _08169814 - .4byte _08169814 - .4byte _08169814 - .4byte _08169814 - .4byte _08169DEA - .4byte _08169DEA - .4byte _08169DEA - .4byte _08169DEA - .4byte _08169844 - .4byte _08169864 - .4byte _08169884 - .4byte _081698A4 - .4byte _081698C4 - .4byte _081698E4 - .4byte _08169904 - .4byte _08169924 - .4byte _08169944 - .4byte _08169964 - .4byte _08169984 - .4byte _081699A4 - .4byte _081699C4 - .4byte _081699E4 - .4byte _08169A04 - .4byte _08169A74 - .4byte _08169A94 - .4byte _08169AB4 - .4byte _08169AD4 - .4byte _08169AF4 - .4byte _08169B14 - .4byte _08169B34 - .4byte _08169B54 - .4byte _08169B74 - .4byte _08169B94 - .4byte _08169BB4 - .4byte _08169BD4 - .4byte _08169BF4 - .4byte _08169C14 - .4byte _08169C34 - .4byte _08169C54 - .4byte _08169C74 - .4byte _08169C94 - .4byte _08169CB4 - .4byte _08169CD4 - .4byte _08169CF4 - .4byte _08169D14 - .4byte _08169D34 - .4byte _08169D54 - .4byte _08169D74 - .4byte _08169D94 - .4byte _08169DB4 - .4byte _08169DD4 -_08169558: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - adds r2, r6, 0 - bl pokemon_setattr - adds r2, r6, 0 - adds r2, 0x2E - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_setattr - 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 -_081695BE: - mov r1, r8 - adds r1, 0xD - mov r0, r9 - adds r2, r4, 0 - bl pokemon_setattr - mov r1, r8 - adds r1, 0x11 - mov r0, r9 - adds r2, r7, 0 - bl pokemon_setattr - adds r7, 0x1 - adds r4, 0x2 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x3 - ble _081695BE - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - mov r2, r10 - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x20 - ldr r2, [sp, 0x20] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x19 - ldr r2, [sp, 0x28] - bl pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - adds r0, r4, 0 - movs r1, 0 - ldr r2, [sp, 0x2C] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x37 - ldr r2, [sp, 0x30] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x38 - ldr r2, [sp, 0x1C] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x39 - ldr r2, [sp, 0x18] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3A - ldr r2, [sp, 0x24] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3B - ldr r2, [sp, 0x4] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3C - ldr r2, [sp, 0x8] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3D - ldr r2, [sp, 0xC] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3E - ldr r2, [sp, 0x10] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3F - ldr r2, [sp, 0x14] - bl pokemon_setattr - b _08169DEA - .pool -_081696F0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0xB - bl pokemon_setattr - b _08169DEA - .pool -_08169710: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0xC - bl pokemon_setattr - b _08169DEA - .pool -_08169730: - 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, =0x020244ec - adds r7, r1, r0 - adds r6, r3, 0 - adds r6, 0x8 - adds r4, r3, 0 -_0816974A: - mov r1, r8 - adds r1, 0xD - adds r0, r7, 0 - adds r2, r4, 0 - bl pokemon_setattr - mov r1, r8 - adds r1, 0x11 - adds r0, r7, 0 - adds r2, r6, 0 - bl pokemon_setattr - adds r6, 0x1 - adds r4, 0x2 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x3 - ble _0816974A - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x15 - mov r2, r9 - bl pokemon_setattr - b _08169DEA - .pool -_08169788: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r3, =0x02023064 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r1, r3, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r1, 0x9 - b _0816982C - .pool -_081697B0: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - ldr r5, =0x02024064 - ldrb r2, [r5] - lsls r2, 9 - adds r2, r7 - adds r0, r4, 0 - movs r1, 0x11 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x1 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x12 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x2 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x13 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x3 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x14 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x4 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x15 - bl pokemon_setattr - b _08169DEA - .pool -_08169814: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r3, =0x02023064 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r1, r3, 0x1 - adds r1, r2, r1 - ldrb r1, [r1] - adds r1, 0x8 -_0816982C: - adds r3, 0x3 - adds r2, r3 - bl pokemon_setattr - b _08169DEA - .pool -_08169844: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1 - bl pokemon_setattr - b _08169DEA - .pool -_08169864: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x19 - bl pokemon_setattr - b _08169DEA - .pool -_08169884: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1A - bl pokemon_setattr - b _08169DEA - .pool -_081698A4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1B - bl pokemon_setattr - b _08169DEA - .pool -_081698C4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1C - bl pokemon_setattr - b _08169DEA - .pool -_081698E4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1D - bl pokemon_setattr - b _08169DEA - .pool -_08169904: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1E - bl pokemon_setattr - b _08169DEA - .pool -_08169924: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1F - bl pokemon_setattr - b _08169DEA - .pool -_08169944: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x20 - bl pokemon_setattr - b _08169DEA - .pool -_08169964: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x22 - bl pokemon_setattr - b _08169DEA - .pool -_08169984: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x23 - bl pokemon_setattr - b _08169DEA - .pool -_081699A4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x24 - bl pokemon_setattr - b _08169DEA - .pool -_081699C4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x25 - bl pokemon_setattr - b _08169DEA - .pool -_081699E4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x26 - bl pokemon_setattr - b _08169DEA - .pool -_08169A04: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - ldr r5, =0x02024064 - ldrb r2, [r5] - lsls r2, 9 - adds r2, r7 - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x1 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x28 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x2 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x29 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x3 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2A - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x4 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2B - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x5 - adds r2, r0 - adds r0, r4, 0 - b _08169B24 - .pool -_08169A74: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x27 - bl pokemon_setattr - b _08169DEA - .pool -_08169A94: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x28 - bl pokemon_setattr - b _08169DEA - .pool -_08169AB4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x29 - bl pokemon_setattr - b _08169DEA - .pool -_08169AD4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x2A - bl pokemon_setattr - b _08169DEA - .pool -_08169AF4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x2B - bl pokemon_setattr - b _08169DEA - .pool -_08169B14: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 -_08169B24: - movs r1, 0x2C - bl pokemon_setattr - b _08169DEA - .pool -_08169B34: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0 - bl pokemon_setattr - b _08169DEA - .pool -_08169B54: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x9 - bl pokemon_setattr - b _08169DEA - .pool -_08169B74: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x37 - bl pokemon_setattr - b _08169DEA - .pool -_08169B94: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x38 - bl pokemon_setattr - b _08169DEA - .pool -_08169BB4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x39 - bl pokemon_setattr - b _08169DEA - .pool -_08169BD4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3A - bl pokemon_setattr - b _08169DEA - .pool -_08169BF4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3B - bl pokemon_setattr - b _08169DEA - .pool -_08169C14: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3C - bl pokemon_setattr - b _08169DEA - .pool -_08169C34: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3D - bl pokemon_setattr - b _08169DEA - .pool -_08169C54: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3E - bl pokemon_setattr - b _08169DEA - .pool -_08169C74: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3F - bl pokemon_setattr - b _08169DEA - .pool -_08169C94: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x16 - bl pokemon_setattr - b _08169DEA - .pool -_08169CB4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x17 - bl pokemon_setattr - b _08169DEA - .pool -_08169CD4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x18 - bl pokemon_setattr - b _08169DEA - .pool -_08169CF4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x21 - bl pokemon_setattr - b _08169DEA - .pool -_08169D14: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x2F - bl pokemon_setattr - b _08169DEA - .pool -_08169D34: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x30 - bl pokemon_setattr - b _08169DEA - .pool -_08169D54: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x32 - bl pokemon_setattr - b _08169DEA - .pool -_08169D74: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x33 - bl pokemon_setattr - b _08169DEA - .pool -_08169D94: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x34 - bl pokemon_setattr - b _08169DEA - .pool -_08169DB4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x35 - bl pokemon_setattr - b _08169DEA - .pool -_08169DD4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x36 - bl pokemon_setattr -_08169DEA: - ldr r2, =0x0202406e - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - 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_8169424 - - thumb_func_start sub_8169E20 -sub_8169E20: @ 8169E20 - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8169E20 - - thumb_func_start sub_8169E2C -sub_8169E2C: @ 8169E2C - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8169E2C - - thumb_func_start sub_8169E38 -sub_8169E38: @ 8169E38 - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_8169E38 - - thumb_func_start sub_8169E44 -sub_8169E44: @ 8169E44 - push {r4-r6,lr} - ldr r0, =0x02023064 - ldr r6, =0x02024064 - ldrb r2, [r6] - lsls r1, r2, 9 - adds r0, 0x1 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - bne _08169E80 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x1 - bl move_anim_start_t4 - ldr r0, =0x03005d60 - ldrb r1, [r6] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_8168A20 - str r0, [r1] - b _08169EB6 - .pool -_08169E80: - ldr r5, =0x020241e4 - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r1, =0x03005d70 - ldrb r0, [r6] - adds r0, r1 - ldrb r0, [r0] - bl sub_8072984 - bl dp01_tbl5_exec_completed -_08169EB6: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8169E44 - - thumb_func_start sub_8169EC8 -sub_8169EC8: @ 8169EC8 - push {r4-r6,lr} - ldr r4, =0x02024064 - ldrb r1, [r4] - movs r0, 0x6 - bl sub_805DF84 - ldrb r0, [r4] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x6 - bl template_build_for_pokemon_or_trainer - ldr r0, =0x0202499c - ldr r1, =gUnknown_08305D2C - ldrb r1, [r1, 0x18] - movs r2, 0x8 - subs r2, r1 - lsls r2, 18 - movs r1, 0xA0 - lsls r1, 15 - adds r2, r1 - asrs r2, 16 - movs r1, 0x50 - movs r3, 0x1E - bl AddObjectToFront - ldr r6, =0x020241e4 - ldrb r1, [r4] - adds r1, r6 - strb r0, [r1] - ldr r5, =0x02020630 - ldrb r3, [r4] - adds r0, r3, r6 - 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 r0, [r4] - adds r0, r6 - 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, [r4] - adds r0, r6 - 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, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r5, 0x1C - adds r0, r5 - ldr r1, =sub_805D7AC - str r1, [r0] - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_816856C - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8169EC8 - - thumb_func_start dp01t_07_6_ -dp01t_07_6_: @ 8169F94 - push {r4-r6,lr} - ldr r4, =0x02024064 - ldrb r1, [r4] - movs r0, 0x6 - bl sub_805DF84 - ldrb r0, [r4] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x6 - bl template_build_for_pokemon_or_trainer - ldr r0, =0x0202499c - ldr r1, =gUnknown_08305D2C - ldrb r1, [r1, 0x18] - movs r2, 0x8 - subs r2, r1 - lsls r2, 18 - movs r1, 0xA0 - lsls r1, 15 - adds r2, r1 - asrs r2, 16 - movs r1, 0x50 - movs r3, 0x1E - bl AddObjectToFront - ldr r6, =0x020241e4 - ldrb r1, [r4] - adds r1, r6 - strb r0, [r1] - ldr r5, =0x02020630 - ldrb r3, [r4] - adds r0, r3, r6 - 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 r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x0000ffa0 - strh r1, [r0, 0x24] - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x2 - strh r1, [r0, 0x2E] - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r5, 0x1C - adds r0, r5 - ldr r1, =sub_805D7AC - str r1, [r0] - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8168A90 - str r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_07_6_ - - thumb_func_start sub_816A060 -sub_816A060: @ 816A060 - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A060 - - thumb_func_start sub_816A06C -sub_816A06C: @ 816A06C - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A06C - - thumb_func_start sub_816A078 -sub_816A078: @ 816A078 - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A078 - - thumb_func_start sub_816A084 -sub_816A084: @ 816A084 - push {r4,r5,lr} - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0x8] - movs r0, 0x4 - strb r0, [r1, 0x8] - ldr r1, =0x020244b9 - movs r0, 0x1 - strb r0, [r1] - ldr r5, =0x02024064 - ldrb r4, [r5] - movs r0, 0x1 - bl battle_get_side_with_given_state - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r4, 0 - movs r3, 0x4 - bl move_anim_start_t4 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_wait_t5 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816A084 - - thumb_func_start sub_816A0D8 -sub_816A0D8: @ 816A0D8 - push {r4,r5,lr} - ldr r1, =0x02023064 - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r1, [r0] - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - strb r1, [r0, 0x8] - ldr r1, =0x020244b9 - movs r0, 0x1 - strb r0, [r1] - ldrb r4, [r5] - movs r0, 0x1 - bl battle_get_side_with_given_state - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r4, 0 - movs r3, 0x4 - bl move_anim_start_t4 - ldr r1, =0x03005d60 - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_wait_t5 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816A0D8 - - thumb_func_start sub_816A138 -sub_816A138: @ 816A138 - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A138 - - thumb_func_start sub_816A144 -sub_816A144: @ 816A144 - push {r4-r6,lr} - ldr r0, =0x02023064 - mov r12, r0 - ldr r6, =0x02024064 - 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, =0x02038432 - mov r1, r12 - adds r1, 0x3 - adds r2, r1 - ldrb r1, [r2] - strb r1, [r5] - ldr r4, =0x02038408 - 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, =0x02038404 - 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, =0x0203841a - ldrb r1, [r6] - lsls r1, 9 - mov r2, r12 - adds r2, 0xA - adds r1, r2 - ldrb r1, [r1] - strb r1, [r3] - ldr r4, =0x0203841c - 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, =0x02038400 - ldrb r2, [r6] - lsls r2, 9 - mov r1, r12 - adds r1, 0x10 - adds r2, r1 - str r2, [r3] - ldr r3, =0x020244bc - 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 _0816A23C - bl dp01_tbl5_exec_completed - b _0816A25A - .pool -_0816A23C: - ldr r0, =0x020244d0 - 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, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_move_anim_5 - str r1, [r0] -_0816A25A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816A144 - - thumb_func_start bx_move_anim_5 -bx_move_anim_5: @ 816A26C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r2, =0x02023064 - ldr r6, =0x02024064 - ldrb r3, [r6] - lsls r1, r3, 9 - adds r0, r2, 0x1 - mov r9, r0 - adds r0, r1, r0 - ldrb r4, [r0] - adds r2, 0x2 - mov r8, r2 - add r1, r8 - ldrb r0, [r1] - lsls r0, 8 - orrs r4, r0 - ldr r7, =0x020244d0 - 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 _0816A2F6 - cmp r2, 0x1 - bgt _0816A2BC - cmp r2, 0 - beq _0816A2C6 - b _0816A3AC - .pool -_0816A2BC: - cmp r2, 0x2 - beq _0816A320 - cmp r2, 0x3 - beq _0816A370 - b _0816A3AC -_0816A2C6: - ldr r1, [r5] - lsls r0, r3, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0816A2E2 - adds r0, r3, 0 - adds r1, r3, 0 - adds r2, r3, 0 - movs r3, 0x5 - bl move_anim_start_t4 -_0816A2E2: - 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 _0816A3AC -_0816A2F6: - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _0816A3AC - 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 _0816A3AC -_0816A320: - ldr r0, =0x020383f8 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =0x020383fd - ldrb r0, [r0] - cmp r0, 0 - bne _0816A3AC - 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 _0816A354 - adds r0, r2, 0 - adds r1, r2, 0 - movs r3, 0x6 - bl move_anim_start_t4 -_0816A354: - 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, 0x3 - strb r1, [r0, 0x4] - b _0816A3AC - .pool -_0816A370: - ldrb r1, [r0] - movs r0, 0x40 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0816A3AC - bl sub_805E394 - ldrb r0, [r6] - lsls r2, r0, 9 - mov r3, r9 - adds r1, r2, r3 - ldrb r1, [r1] - add r2, r8 - 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 dp01_tbl5_exec_completed -_0816A3AC: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end bx_move_anim_5 - - thumb_func_start sub_816A3B8 -sub_816A3B8: @ 816A3B8 - push {r4,lr} - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 9 - ldr r1, =0x02023066 - adds r0, r1 - ldrh r0, [r0] - bl battle_pick_message - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_81685A4 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816A3B8 - - thumb_func_start dp01t_11_5_message_for_player_only -dp01t_11_5_message_for_player_only: @ 816A40C - push {lr} - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0816A428 - bl sub_816A3B8 - b _0816A42C - .pool -_0816A428: - bl dp01_tbl5_exec_completed -_0816A42C: - pop {r0} - bx r0 - thumb_func_end dp01t_11_5_message_for_player_only - - thumb_func_start sub_816A430 -sub_816A430: @ 816A430 - push {lr} - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0816A456 - ldr r0, =0x02022e14 - strh r1, [r0] - ldr r1, =0x02022e16 - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8168444 - str r1, [r0] -_0816A456: - pop {r0} - bx r0 - .pool - thumb_func_end sub_816A430 - - thumb_func_start dp01t_12_1_battle_menu -dp01t_12_1_battle_menu: @ 816A470 - push {r4,lr} - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_816A430 - str r1, [r0] - ldr r0, =gUnknown_085CCA3A - movs r1, 0x2 - bl battle_show_message_maybe - movs r4, 0 -_0816A48A: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_8059CF8 - adds r4, 0x1 - cmp r4, 0x3 - ble _0816A48A - ldr r1, =0x020244ac - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - movs r1, 0 - bl sub_8059CB4 - ldr r0, =gUnknown_085CCA15 - bl get_battle_strings_ - ldr r0, =0x02022e2c - movs r1, 0x1 - bl battle_show_message_maybe - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_12_1_battle_menu - - thumb_func_start sub_816A4D8 -sub_816A4D8: @ 816A4D8 - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A4D8 - - thumb_func_start sub_816A4E4 -sub_816A4E4: @ 816A4E4 - push {r4,lr} - ldr r4, =0x0202449c - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x95 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0816A522 - cmp r0, 0x1 - bgt _0816A504 - cmp r0, 0 - beq _0816A50A - b _0816A574 - .pool -_0816A504: - cmp r0, 0x2 - beq _0816A550 - b _0816A574 -_0816A50A: - bl sub_805C210 - ldr r1, [r4] - adds r1, 0x95 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r4] - adds r0, 0x97 - movs r1, 0x50 - strb r1, [r0] - b _0816A574 -_0816A522: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0816A574 - ldr r0, =0x02022e14 - strh r1, [r0] - ldr r1, =0x02022e16 - movs r2, 0xA0 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r1] - ldr r1, [r4] - adds r1, 0x95 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0816A574 - .pool -_0816A550: - adds r1, 0x97 - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - lsls r0, 24 - cmp r0, 0 - bne _0816A574 - movs r0, 0x5 - bl audio_play - movs r2, 0x80 - lsls r2, 1 - movs r0, 0x1 - movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb - bl dp01_tbl5_exec_completed -_0816A574: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_816A4E4 - - thumb_func_start sub_816A57C -sub_816A57C: @ 816A57C - push {lr} - sub sp, 0x4 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x03005d60 - ldr r2, =0x02024064 - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_81685D4 - str r1, [r0] - ldr r1, =0x020244b8 - ldrb r0, [r2] - strb r0, [r1] - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_816A57C - - thumb_func_start sub_816A5BC -sub_816A5BC: @ 816A5BC - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A5BC - - thumb_func_start sub_816A5C8 -sub_816A5C8: @ 816A5C8 - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A5C8 - - thumb_func_start sub_816A5D4 -sub_816A5D4: @ 816A5D4 - 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, =0x02023064 - ldr r0, =0x02024064 - 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 _0816A664 - ldr r6, =0x0202406e - lsls r0, r4, 1 - adds r0, r6 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - movs r1, 0x3A - bl pokemon_getattr - 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 pokemon_getattr - adds r3, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r1, =0x03005d70 - adds r1, r0, r1 - ldrb r1, [r1] - str r7, [sp] - mov r2, r8 - bl sub_807294C - b _0816A69E - .pool -_0816A664: - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3A - bl pokemon_getattr - adds r2, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r4, =0x03005d70 - 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 -_0816A69E: - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8168934 - 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_816A5D4 - - thumb_func_start sub_816A6D4 -sub_816A6D4: @ 816A6D4 - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A6D4 - - thumb_func_start sub_816A6E0 -sub_816A6E0: @ 816A6E0 - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A6E0 - - thumb_func_start sub_816A6EC -sub_816A6EC: @ 816A6EC - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A6EC - - thumb_func_start sub_816A6F8 -sub_816A6F8: @ 816A6F8 - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A6F8 - - thumb_func_start sub_816A704 -sub_816A704: @ 816A704 - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A704 - - thumb_func_start sub_816A710 -sub_816A710: @ 816A710 - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A710 - - thumb_func_start sub_816A71C -sub_816A71C: @ 816A71C - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A71C - - thumb_func_start sub_816A728 -sub_816A728: @ 816A728 - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A728 - - thumb_func_start sub_816A734 -sub_816A734: @ 816A734 - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A734 - - thumb_func_start sub_816A740 -sub_816A740: @ 816A740 - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A740 - - thumb_func_start sub_816A74C -sub_816A74C: @ 816A74C - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A74C - - thumb_func_start sub_816A758 -sub_816A758: @ 816A758 - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A758 - - thumb_func_start sub_816A764 -sub_816A764: @ 816A764 - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A764 - - thumb_func_start sub_816A770 -sub_816A770: @ 816A770 - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A770 - - thumb_func_start sub_816A77C -sub_816A77C: @ 816A77C - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A77C - - thumb_func_start sub_816A788 -sub_816A788: @ 816A788 - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A788 - - thumb_func_start sub_816A794 -sub_816A794: @ 816A794 - push {r4,lr} - ldr r3, =0x02020630 - ldr r2, =0x020241e4 - ldr r4, =0x02024064 - 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 _0816A7C8 - bl dp01_tbl5_exec_completed - b _0816A7F2 - .pool -_0816A7C8: - ldr r1, =0x020244b9 - 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, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =bx_blink_t5 - str r1, [r0] -_0816A7F2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816A794 - - thumb_func_start sub_816A804 -sub_816A804: @ 816A804 - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816A804 - - thumb_func_start sub_816A810 -sub_816A810: @ 816A810 - push {lr} - ldr r2, =0x02023064 - ldr r0, =0x02024064 - ldrb r1, [r0] - 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 - bl audio_play - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_816A810 - - thumb_func_start sub_816A840 -sub_816A840: @ 816A840 - push {r4,r5,lr} - ldr r4, =0x02023064 - ldr r5, =0x02024064 - ldrb r0, [r5] - lsls r3, r0, 9 - adds r0, r4, 0x3 - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0 - beq _0816A87C - 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 song_play_for_text - b _0816A890 - .pool -_0816A87C: - 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 fanfare_play -_0816A890: - bl dp01_tbl5_exec_completed - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_816A840 - - thumb_func_start sub_816A89C -sub_816A89C: @ 816A89C - push {lr} - ldr r1, =0x0202406e - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x19 - bl cry_related - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end sub_816A89C - - thumb_func_start dp01t_2E_5_battle_intro -dp01t_2E_5_battle_intro: @ 816A8D8 - push {lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - bl battle_intro_launch - ldr r2, =0x020243fc - ldrh r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strh r0, [r2] - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - .pool - thumb_func_end dp01t_2E_5_battle_intro - - thumb_func_start sub_816A90C -sub_816A90C: @ 816A90C - push {r4-r7,lr} - ldr r6, =0x020241e4 - ldr r7, =0x02024064 - ldrb r0, [r7] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =0x02020630 - adds r0, r5 - bl oamt_add_pos2_onto_pos1 - ldrb r0, [r7] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x32 - strh r1, [r0, 0x2E] - ldrb r0, [r7] - 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, [r7] - 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, [r7] - 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 r2, [r7] - adds r0, r2, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x38] - ldrb r0, [r7] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =sub_805CC00 - bl oamt_set_x3A_32 - ldrb r0, [r7] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x1 - bl StartObjectImageAnim - ldr r0, =0x0000d6f8 - bl AllocObjectPalette - adds r4, r0, 0 - lsls r4, 24 - ldr r0, =gTrainerBackPicPaletteTable - ldr r0, [r0, 0x30] - lsrs r4, 20 - movs r2, 0x80 - lsls r2, 1 - adds r1, r4, r2 - movs r2, 0x20 - bl decompress_palette - ldrb r0, [r7] - adds r0, r6 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrb r2, [r1, 0x5] - movs r0, 0xF - ands r0, r2 - orrs r0, r4 - strb r0, [r1, 0x5] - ldr r0, =sub_816AC04 - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r4 - ldrb r0, [r7] - strh r0, [r1, 0x8] - ldr r3, =0x020244d0 - ldr r0, [r3] - ldrb r2, [r7] - 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 _0816AA24 - ldr r0, =0x020244b4 - 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] -_0816AA24: - ldr r0, [r3] - ldr r2, [r0, 0x8] - ldrb r0, [r2, 0x9] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x9] - ldr r1, =0x03005d60 - ldrb r0, [r7] - lsls r0, 2 - adds r0, r1 - ldr r1, =nullsub_21 - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816A90C - - thumb_func_start sub_816AA80 -sub_816AA80: @ 816AA80 - 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 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r6, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x2] - ldr r0, =0x0202406e - lsls r2, r6, 1 - adds r2, r0 - ldr r0, =0x02023064 - 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, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - mov r8, r0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r0, =sub_805D714 - bl object_new_hidden_with_callback - ldr r1, =0x03005d7c - mov r9, r1 - add r9, r6 - mov r1, r9 - strb r0, [r1] - adds r0, r6, 0 - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl sub_806A068 - ldr r0, =0x0202499c - 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 AddObjectToFront - ldr r4, =0x020241e4 - adds r4, r6, r4 - strb r0, [r4] - ldr r5, =0x02020630 - 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, =0x020244e4 - adds r6, r1 - ldrb r1, [r6] - bl StartObjectImageAnim - 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, =DummyObjectCallback - 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_816AA80 - - thumb_func_start sub_816AC04 -sub_816AC04: @ 816AC04 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r1, r0, r1 - ldrh r2, [r1, 0xA] - movs r3, 0xA - ldrsh r0, [r1, r3] - cmp r0, 0x1E - bgt _0816AC28 - adds r0, r2, 0x1 - strh r0, [r1, 0xA] - b _0816AC5E - .pool -_0816AC28: - ldr r4, =0x02024064 - ldrb r5, [r4] - ldrh r0, [r1, 0x8] - strb r0, [r4] - ldr r0, =0x02023064 - ldrb r1, [r4] - lsls r2, r1, 9 - adds r0, 0x1 - adds r2, r0 - ldr r0, =0x0202406e - lsls r1, 1 - adds r1, r0 - ldrh r0, [r1] - strb r0, [r2] - ldrb r0, [r4] - bl sub_816AA80 - ldr r1, =0x03005d60 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_816864C - str r1, [r0] - strb r5, [r4] - adds r0, r6, 0 - bl DestroyTask -_0816AC5E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816AC04 - - thumb_func_start sub_816AC78 -sub_816AC78: @ 816AC78 - push {r4,r5,lr} - ldr r1, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _0816ACA8 - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0816ACA8 - bl dp01_tbl5_exec_completed - b _0816ACE6 - .pool -_0816ACA8: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r5, =0x02024064 - 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 r4, r0, 9 - ldr r3, =0x02023068 - adds r1, r4, r3 - subs r2, r3, 0x3 - adds r2, r4, r2 - ldrb r2, [r2] - subs r3, 0x2 - adds r4, r3 - ldrb r3, [r4] - bl sub_80735DC - ldr r2, =0x020244b4 - ldrb r1, [r5] - adds r1, r2 - strb r0, [r1] - bl dp01_tbl5_exec_completed -_0816ACE6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816AC78 - - thumb_func_start sub_816ACFC -sub_816ACFC: @ 816ACFC - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816ACFC - - thumb_func_start sub_816AD08 -sub_816AD08: @ 816AD08 - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816AD08 - - thumb_func_start sub_816AD14 -sub_816AD14: @ 816AD14 - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816AD14 - - thumb_func_start sub_816AD20 -sub_816AD20: @ 816AD20 - push {r4-r6,lr} - sub sp, 0x4 - ldr r5, =0x02023064 - ldr r6, =0x02024064 - 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 _0816AD60 - bl dp01_tbl5_exec_completed - b _0816AD6C - .pool -_0816AD60: - ldr r0, =0x03005d60 - ldrb r1, [r6] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_8168AC8 - str r0, [r1] -_0816AD6C: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816AD20 - - thumb_func_start sub_816AD7C -sub_816AD7C: @ 816AD7C - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816AD7C - - thumb_func_start sub_816AD88 -sub_816AD88: @ 816AD88 - push {lr} - bl dp01_tbl5_exec_completed - pop {r0} - bx r0 - thumb_func_end sub_816AD88 - - thumb_func_start sub_816AD94 -sub_816AD94: @ 816AD94 - push {r4,lr} - ldr r2, =0x0202433a - ldr r1, =0x02023064 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - movs r0, 0x5 - bl sub_80A2F50 - movs r0, 0x3 - bl sub_80A2390 - bl dp01_tbl5_exec_completed - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x6 - ands r0, r1 - cmp r0, 0x2 - bne _0816ADD0 - ldr r0, =0x03005d60 - ldrb r1, [r4] - lsls r1, 2 - adds r1, r0 - ldr r0, =sub_80587B0 - str r0, [r1] -_0816ADD0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816AD94 - - thumb_func_start nullsub_118 -nullsub_118: @ 816ADF0 - bx lr - thumb_func_end nullsub_118 - - thumb_func_start sub_816ADF4 -sub_816ADF4: @ 816ADF4 - push {r4-r6,lr} - movs r4, 0 - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x93 - lsls r1, 3 - adds r0, r1 - movs r1, 0x32 - bl sub_80D6C7C - ldr r1, =gUnknown_085DFEFC - ldrh r0, [r1] - cmp r0, 0 - beq _0816AE48 - ldrh r0, [r1, 0x2] - cmp r0, 0 - beq _0816AE48 - adds r5, r1, 0 - adds r6, r5, 0x2 -_0816AE1A: - lsls r1, r4, 2 - adds r0, r1, r5 - ldrh r0, [r0] - adds r1, r6 - ldrh r1, [r1] - bl sub_80D6D70 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0816AE48 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, r4, 2 - adds r0, r1, r5 - ldrh r0, [r0] - cmp r0, 0 - beq _0816AE48 - adds r0, r1, r6 - ldrh r0, [r0] - cmp r0, 0 - bne _0816AE1A -_0816AE48: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816ADF4 - - thumb_func_start sub_816AE58 -sub_816AE58: @ 816AE58 - push {lr} - ldr r1, =0x0203bcb0 - ldr r0, =gUnknown_085DFED4 - str r0, [r1] - ldr r1, =0x0203bcb4 - movs r0, 0x4 - strb r0, [r1] - ldr r0, =TaskDummy - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_085E8D80 - ldr r2, =sub_816AED8 - bl DisplayItemMessageOnField - pop {r0} - bx r0 - .pool - thumb_func_end sub_816AE58 - - thumb_func_start sub_816AE98 -sub_816AE98: @ 816AE98 - push {lr} - ldr r1, =0x0203bcb0 - ldr r0, =gUnknown_085DFED8 - str r0, [r1] - ldr r1, =0x0203bcb4 - movs r0, 0x3 - strb r0, [r1] - ldr r0, =TaskDummy - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_085E8D80 - ldr r2, =sub_816AED8 - bl DisplayItemMessageOnField - pop {r0} - bx r0 - .pool - thumb_func_end sub_816AE98 - - thumb_func_start sub_816AED8 -sub_816AED8: @ 816AED8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r6, r0, r1 - ldr r0, =0x0203bcb4 - ldrb r1, [r0] - mov r8, r0 - cmp r1, 0x3 - bne _0816AF0C - ldr r0, =gUnknown_085DFF24 - ldr r1, [r0, 0x4] - ldr r0, [r0] - b _0816AF12 - .pool -_0816AF0C: - ldr r0, =gUnknown_085DFF24 - ldr r1, [r0, 0xC] - ldr r0, [r0, 0x8] -_0816AF12: - str r0, [sp] - str r1, [sp, 0x4] - ldr r5, =gUnknown_085DFEB4 - ldr r4, =0x0203bcb0 - ldr r1, [r4] - mov r0, r8 - ldrb r2, [r0] - adds r0, r5, 0 - bl sub_81DB3D8 - lsls r0, 24 - ldr r2, =0x00ffffff - ldr r1, [sp] - ands r1, r2 - orrs r1, r0 - str r1, [sp] - mov r0, sp - bl AddWindow - strh r0, [r6, 0x8] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl SetStandardWindowBorderStyle - ldrb r0, [r6, 0x8] - mov r2, r8 - ldrb r1, [r2] - ldr r3, [r4] - adds r2, r5, 0 - bl sub_81995E4 - ldrb r0, [r6, 0x8] - mov r2, r8 - ldrb r1, [r2] - movs r2, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_816AF98 - str r1, [r0] - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816AED8 - - thumb_func_start sub_816AF98 -sub_816AF98: @ 816AF98 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldr r0, =0x0203bcb4 - ldrb r0, [r0] - cmp r0, 0x3 - bls _0816AFC0 - bl ProcessMenuInput - b _0816AFC4 - .pool -_0816AFC0: - bl ProcessMenuInputNoWrapAround -_0816AFC4: - lsls r0, 24 - lsrs r0, 24 - lsls r0, 24 - asrs r5, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r5, r0 - beq _0816B04C - adds r0, 0x1 - cmp r5, r0 - bne _0816B014 - movs r0, 0x5 - bl audio_play - ldrb r0, [r4, 0x8] - movs r1, 0 - bl sub_8198070 - ldrb r0, [r4, 0x8] - bl ClearWindowTilemap - ldrb r0, [r4, 0x8] - bl RemoveWindow - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_816B148 - str r1, [r0] - b _0816B04C - .pool -_0816B014: - ldrb r0, [r4, 0x8] - movs r1, 0 - bl sub_8198070 - ldrb r0, [r4, 0x8] - bl ClearWindowTilemap - ldrb r0, [r4, 0x8] - bl RemoveWindow - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r2, =gUnknown_085DFEB4 - ldr r0, =0x0203bcb0 - ldr r0, [r0] - adds r0, r5 - ldrb r0, [r0] - lsls r0, 3 - adds r2, 0x4 - adds r0, r2 - ldr r0, [r0] - str r0, [r1] -_0816B04C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816AF98 - - thumb_func_start sub_816B060 -sub_816B060: @ 816B060 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_085E8D80 - ldr r2, =sub_816AED8 - bl DisplayItemMessageOnField - pop {r0} - bx r0 - .pool - thumb_func_end sub_816B060 - - thumb_func_start task_pc_itemstorage -task_pc_itemstorage: @ 816B07C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0 - bl sub_816B190 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_816B248 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_pc_itemstorage - - thumb_func_start sub_816B0A8 -sub_816B0A8: @ 816B0A8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - bl sub_816B510 - ldr r5, =0x0203bcb8 - movs r1, 0 - strb r0, [r5, 0x5] - lsls r0, 24 - cmp r0, 0 - bne _0816B0D8 - ldr r1, =gUnknown_085EAC4B - ldr r2, =sub_816B060 - adds r0, r4, 0 - bl DisplayItemMessageOnField - b _0816B12A - .pool -_0816B0D8: - strh r1, [r5] - strh r1, [r5, 0x2] - movs r0, 0xFF - strb r0, [r5, 0x9] - bl sub_816B54C - adds r0, r4, 0 - bl sub_816B4C0 - ldrb r0, [r5, 0x5] - bl sub_81D1C44 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0816B120 - movs r0, 0 - movs r1, 0 - bl sub_8197434 - adds r0, r4, 0 - bl sub_816B5F8 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_816B674 - str r0, [r1] - b _0816B12A - .pool -_0816B120: - ldr r1, =gUnknown_085EAC4B - ldr r2, =sub_816B060 - adds r0, r6, 0 - bl DisplayItemMessageOnField -_0816B12A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816B0A8 - - thumb_func_start sub_816B138 -sub_816B138: @ 816B138 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_8126B2C - pop {r0} - bx r0 - thumb_func_end sub_816B138 - - thumb_func_start sub_816B148 -sub_816B148: @ 816B148 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0203bcb4 - ldrb r0, [r0] - cmp r0, 0x4 - bne _0816B180 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _0816B174 - ldr r0, =gUnknown_081F863F - bl script_env_1_execute_new_script - b _0816B184 - .pool -_0816B174: - ldr r0, =gUnknown_081F958F - bl script_env_1_execute_new_script - b _0816B184 - .pool -_0816B180: - bl script_env_2_enable_and_set_ctx_running -_0816B184: - adds r0, r4, 0 - bl DestroyTask - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_816B148 - - thumb_func_start sub_816B190 -sub_816B190: @ 816B190 - push {r4-r6,lr} - sub sp, 0x8 - adds r5, r1, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e08 - adds r4, r0 - ldr r0, =gUnknown_085DFF24 - ldr r1, [r0, 0x14] - ldr r0, [r0, 0x10] - str r0, [sp] - str r1, [sp, 0x4] - ldr r6, =gUnknown_085DFEDC - adds r0, r6, 0 - movs r1, 0x4 - bl GetMaxWidthInMenuTable - lsls r0, 24 - ldr r2, =0x00ffffff - ldr r1, [sp] - ands r1, r2 - orrs r1, r0 - str r1, [sp] - mov r0, sp - bl AddWindow - strh r0, [r4, 0x8] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl SetStandardWindowBorderStyle - ldrb r0, [r4, 0x8] - movs r1, 0x4 - adds r2, r6, 0 - bl PrintMenuTable - ldrb r0, [r4, 0x8] - movs r1, 0x4 - adds r2, r5, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =gUnknown_085DFEA4 - lsls r5, 2 - adds r5, r0 - ldr r0, [r5] - bl sub_816B21C - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816B190 - - thumb_func_start sub_816B21C -sub_816B21C: @ 816B21C - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0 - bl Print - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_816B21C - - thumb_func_start sub_816B248 -sub_816B248: @ 816B248 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - bl GetMenuCursorPos - lsls r0, 24 - lsrs r5, r0, 24 - bl ProcessMenuInput - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl GetMenuCursorPos - lsls r0, 24 - lsrs r2, r0, 24 - lsls r4, 24 - asrs r4, 24 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _0816B298 - adds r0, 0x1 - cmp r4, r0 - beq _0816B2B4 - movs r0, 0x5 - bl audio_play - ldr r0, =gUnknown_085DFEDC - lsls r1, r4, 3 - adds r0, 0x4 - adds r1, r0 - ldr r1, [r1] - adds r0, r6, 0 - bl _call_via_r1 - b _0816B2C0 - .pool -_0816B298: - lsls r1, r5, 24 - lsls r0, r2, 24 - asrs r2, r0, 24 - cmp r1, r0 - beq _0816B2C0 - ldr r0, =gUnknown_085DFEA4 - lsls r1, r2, 2 - adds r1, r0 - ldr r0, [r1] - bl sub_816B21C - b _0816B2C0 - .pool -_0816B2B4: - movs r0, 0x5 - bl audio_play - adds r0, r6, 0 - bl sub_816B4A4 -_0816B2C0: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_816B248 - - thumb_func_start sub_816B2C8 -sub_816B2C8: @ 816B2C8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =sub_816B2F0 - str r0, [r1] - movs r0, 0x1 - movs r1, 0 - bl fade_screen - pop {r0} - bx r0 - .pool - thumb_func_end sub_816B2C8 - - thumb_func_start sub_816B2F0 -sub_816B2F0: @ 816B2F0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0816B310 - bl overworld_free_bg_tilemaps - bl sub_81AAC14 - adds r0, r4, 0 - bl DestroyTask -_0816B310: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816B2F0 - - thumb_func_start sub_816B31C -sub_816B31C: @ 816B31C - push {lr} - ldr r0, =0x03005dac - ldr r1, =mapldr_080EBC0C - str r1, [r0] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_816B31C - - thumb_func_start mapldr_080EBC0C -mapldr_080EBC0C: @ 816B33C - push {lr} - bl sub_81973A4 - movs r0, 0 - movs r1, 0x1 - bl sub_81973C4 - ldr r0, =sub_816B368 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_816B190 - bl pal_fill_black - pop {r0} - bx r0 - .pool - thumb_func_end mapldr_080EBC0C - - thumb_func_start sub_816B368 -sub_816B368: @ 816B368 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80ABDFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0816B388 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_816B248 - str r0, [r1] -_0816B388: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816B368 - - thumb_func_start sub_816B398 -sub_816B398: @ 816B398 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =0x03005e08 - adds r4, r0 - bl sub_80D6CE4 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2] - cmp r0, 0 - beq _0816B3C4 - adds r0, r5, 0 - movs r1, 0 - bl sub_816B430 - b _0816B3D4 - .pool -_0816B3C4: - adds r0, r5, 0 - bl sub_816B4DC - ldr r1, =gUnknown_085EABD1 - ldr r2, =task_pc_itemstorage - adds r0, r5, 0 - bl DisplayItemMessageOnField -_0816B3D4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816B398 - - thumb_func_start sub_816B3E4 -sub_816B3E4: @ 816B3E4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =0x03005e08 - adds r4, r0 - bl sub_80D6CE4 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2] - cmp r0, 0 - beq _0816B410 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_816B430 - b _0816B420 - .pool -_0816B410: - adds r0, r5, 0 - bl sub_816B4DC - ldr r1, =gUnknown_085EABD1 - ldr r2, =task_pc_itemstorage - adds r0, r5, 0 - bl DisplayItemMessageOnField -_0816B420: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816B3E4 - - thumb_func_start sub_816B430 -sub_816B430: @ 816B430 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r5, r4, 2 - adds r5, r4 - lsls r5, 3 - ldr r6, =0x03005e08 - adds r0, r5, r6 - strh r1, [r0, 0x6] - adds r0, r4, 0 - bl sub_816B4DC - ldr r1, =0x0203bcb8 - movs r0, 0 - strh r0, [r1] - strh r0, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x9] - adds r0, r4, 0 - bl sub_816B4C0 - bl sub_816BC14 - bl gpu_pal_allocator_reset__manage_upper_four - bl sub_8122328 - ldr r0, =0x0203bcc4 - ldr r0, [r0] - movs r1, 0xCD - lsls r1, 3 - adds r0, r1 - movs r1, 0x7 - bl sub_8122344 - movs r0, 0 - movs r1, 0 - bl sub_8197434 - subs r6, 0x8 - adds r5, r6 - ldr r0, =sub_816C158 - str r0, [r5] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816B430 - - thumb_func_start sub_816B4A4 -sub_816B4A4: @ 816B4A4 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_816B4DC - adds r0, r4, 0 - bl sub_816B060 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_816B4A4 - - thumb_func_start sub_816B4C0 -sub_816B4C0: @ 816B4C0 - push {lr} - ldr r1, =0x0203bcb8 - ldrb r0, [r1, 0x5] - cmp r0, 0x7 - bls _0816B4D4 - movs r0, 0x8 - b _0816B4D6 - .pool -_0816B4D4: - adds r0, 0x1 -_0816B4D6: - strb r0, [r1, 0x4] - pop {r0} - bx r0 - thumb_func_end sub_816B4C0 - - thumb_func_start sub_816B4DC -sub_816B4DC: @ 816B4DC - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e08 - adds r4, r0 - ldrb r0, [r4, 0x8] - movs r1, 0 - bl sub_8198070 - ldrb r0, [r4, 0x8] - bl ClearWindowTilemap - ldrb r0, [r4, 0x8] - bl RemoveWindow - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816B4DC - - thumb_func_start sub_816B510 -sub_816B510: @ 816B510 - push {r4,lr} - movs r2, 0 - movs r1, 0x6 - ldr r0, =0x03005d8c - ldr r3, [r0] - movs r4, 0xB0 - lsls r4, 6 -_0816B51E: - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r3, r0 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0 - beq _0816B534 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_0816B534: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bls _0816B51E - adds r0, r2, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_816B510 - - thumb_func_start sub_816B54C -sub_816B54C: @ 816B54C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - movs r2, 0x6 -_0816B55A: - adds r1, r2, 0x1 - lsls r0, r1, 24 - lsrs r4, r0, 24 - mov r8, r1 - cmp r4, 0xF - bhi _0816B5D4 - ldr r0, =0x03005d8c - mov r10, r0 - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - mov r12, r0 - ldr r6, =0x00002be0 -_0816B574: - mov r1, r10 - ldr r1, [r1] - mov r9, r1 - mov r2, r9 - add r2, r12 - movs r3, 0xB0 - lsls r3, 6 - adds r0, r2, r3 - ldrh r0, [r0] - cmp r0, 0 - bne _0816B5CA - adds r2, r6 - mov r1, sp - adds r0, r2, 0 - ldm r0!, {r3,r5,r7} - stm r1!, {r3,r5,r7} - ldm r0!, {r3,r5,r7} - stm r1!, {r3,r5,r7} - ldm r0!, {r3,r5,r7} - stm r1!, {r3,r5,r7} - lsls r3, r4, 3 - adds r3, r4 - lsls r3, 2 - mov r5, r9 - adds r0, r5, r3 - adds r0, r6 - ldm r0!, {r1,r5,r7} - stm r2!, {r1,r5,r7} - ldm r0!, {r1,r5,r7} - stm r2!, {r1,r5,r7} - ldm r0!, {r1,r5,r7} - stm r2!, {r1,r5,r7} - mov r7, r10 - ldr r1, [r7] - adds r1, r3 - adds r1, r6 - mov r0, sp - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r3,r7} - stm r1!, {r2,r3,r7} - ldm r0!, {r2,r5,r7} - stm r1!, {r2,r5,r7} -_0816B5CA: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _0816B574 -_0816B5D4: - mov r3, r8 - lsls r0, r3, 24 - lsrs r2, r0, 24 - cmp r2, 0xE - bls _0816B55A - 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_816B54C - - thumb_func_start sub_816B5F8 -sub_816B5F8: @ 816B5F8 - push {r4-r6,lr} - sub sp, 0xC - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0 - bl sub_81D1C84 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - bl sub_81D1C84 - ldr r6, =gUnknown_085EAB4E - movs r0, 0x1 - adds r1, r6, 0 - movs r2, 0x40 - bl GetStringCenterAlignXOffset - 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] - adds r0, r4, 0 - movs r1, 0x1 - adds r2, r6, 0 - bl Print - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r4, =0x0203bcb8 - adds r0, r4, 0 - bl sub_81D1DC0 - ldr r2, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r2 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x12] - adds r0, r4, 0 - bl sub_81D1E90 - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816B5F8 - - thumb_func_start sub_816B674 -sub_816B674: @ 816B674 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - mov r9, r0 - ldr r0, =0x03005e08 - mov r10, r0 - mov r4, r9 - add r4, r10 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0816B71E - ldrb r0, [r4, 0xA] - bl ListMenuHandleInput - adds r6, r0, 0 - ldrb r0, [r4, 0xA] - ldr r7, =0x0203bcba - subs r1, r7, 0x2 - mov r8, r1 - adds r1, r7, 0 - mov r2, r8 - bl get_coro_args_x18_x1A - movs r0, 0x2 - negs r0, r0 - cmp r6, r0 - beq _0816B6D4 - adds r0, 0x1 - cmp r6, r0 - bne _0816B6EA - b _0816B71E - .pool -_0816B6D4: - movs r0, 0x5 - bl audio_play - mov r1, r8 - ldrb r0, [r1, 0x9] - bl RemoveScrollIndicatorArrowPair - adds r0, r5, 0 - bl sub_816B798 - b _0816B71E -_0816B6EA: - movs r0, 0x5 - bl audio_play - movs r0, 0 - bl sub_81D1D04 - movs r0, 0x1 - bl sub_81D1D04 - ldrb r0, [r4, 0xA] - adds r1, r7, 0 - mov r2, r8 - bl sub_81AE6C8 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - mov r1, r8 - ldrb r0, [r1, 0x9] - bl RemoveScrollIndicatorArrowPair - mov r0, r10 - subs r0, 0x8 - add r0, r9 - ldr r1, =sub_816B730 - str r1, [r0] -_0816B71E: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816B674 - - thumb_func_start sub_816B730 -sub_816B730: @ 816B730 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =0x02021cc4 - ldr r2, =0x03005d8c - ldr r1, =0x0203bcb8 - ldrh r0, [r1] - adds r0, 0x6 - ldrh r1, [r1, 0x2] - adds r0, r1 - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, [r2] - adds r1, r0 - ldr r0, =0x00002bf2 - adds r1, r0 - adds r0, r5, 0 - bl CopyString - adds r0, r5, 0 - movs r1, 0 - bl sub_81DB554 - ldr r5, =0x02021fc4 - ldr r1, =gUnknown_085EAC63 - adds r0, r5, 0 - bl ExpandStringRefs - ldr r2, =sub_816B7DC - adds r0, r4, 0 - adds r1, r5, 0 - bl DisplayItemMessageOnField - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816B730 - - thumb_func_start sub_816B798 -sub_816B798: @ 816B798 - 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, =0x03005e08 - adds r4, r0 - movs r0, 0 - bl sub_81D1D04 - movs r0, 0x1 - bl sub_81D1D04 - ldrb r0, [r4, 0xA] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - bl sub_81D1EC0 - adds r0, r5, 0 - bl sub_816B060 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816B798 - - thumb_func_start sub_816B7DC -sub_816B7DC: @ 816B7DC - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0x2 - bl sub_81D1C84 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r2, =gUnknown_085DFF04 - adds r0, r4, 0 - movs r1, 0x4 - bl PrintMenuTable - adds r0, r4, 0 - movs r1, 0x4 - movs r2, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_816B82C - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816B7DC - - thumb_func_start sub_816B82C -sub_816B82C: @ 816B82C - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - bl ProcessMenuInput_other - lsls r0, 24 - asrs r4, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _0816B86E - adds r0, 0x1 - cmp r4, r0 - bne _0816B858 - movs r0, 0x5 - bl audio_play - adds r0, r5, 0 - bl sub_816BBD4 - b _0816B86E -_0816B858: - movs r0, 0x5 - bl audio_play - ldr r0, =gUnknown_085DFF04 - lsls r1, r4, 3 - adds r0, 0x4 - adds r1, r0 - ldr r1, [r1] - adds r0, r6, 0 - bl _call_via_r1 -_0816B86E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816B82C - - thumb_func_start sub_816B878 -sub_816B878: @ 816B878 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_816B8A4 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816B878 - - thumb_func_start sub_816B8A4 -sub_816B8A4: @ 816B8A4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0816B8E6 - bl sub_81D1EC0 - bl overworld_free_bg_tilemaps - ldr r2, =0x03005d8c - ldr r1, =0x0203bcb8 - ldrh r0, [r1] - adds r0, 0x6 - ldrh r1, [r1, 0x2] - adds r0, r1 - 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_816B900 - movs r2, 0x1 - bl sub_8121478 - adds r0, r4, 0 - bl DestroyTask -_0816B8E6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816B8A4 - - thumb_func_start sub_816B900 -sub_816B900: @ 816B900 - push {lr} - ldr r0, =0x03005dac - ldr r1, =pal_fill_for_maplights_or_black - str r1, [r0] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_816B900 - - thumb_func_start pal_fill_for_maplights_or_black -pal_fill_for_maplights_or_black: @ 816B920 - push {r4,lr} - bl sub_81973A4 - ldr r0, =task00_080EBBDC - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0203bcb8 - ldrb r0, [r0, 0x5] - bl sub_81D1C44 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0816B954 - adds r0, r4, 0 - bl sub_816B5F8 - b _0816B95A - .pool -_0816B954: - adds r0, r4, 0 - bl DestroyTask -_0816B95A: - bl pal_fill_black - pop {r4} - pop {r0} - bx r0 - thumb_func_end pal_fill_for_maplights_or_black - - thumb_func_start task00_080EBBDC -task00_080EBBDC: @ 816B964 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80ABDFC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0816B984 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_816B674 - str r0, [r1] -_0816B984: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task00_080EBBDC - - thumb_func_start sub_816B994 -sub_816B994: @ 816B994 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_085EAC8D - ldr r2, =sub_816B9B0 - bl DisplayItemMessageOnField - pop {r0} - bx r0 - .pool - thumb_func_end sub_816B994 - - thumb_func_start sub_816B9B0 -sub_816B9B0: @ 816B9B0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8197930 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_816B9D8 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816B9B0 - - thumb_func_start sub_816B9D8 -sub_816B9D8: @ 816B9D8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _0816BA04 - cmp r0, r1 - ble _0816BA10 - cmp r0, 0 - beq _0816B9FC - cmp r0, 0x1 - beq _0816BA0A - b _0816BA10 -_0816B9FC: - adds r0, r4, 0 - bl sub_816BA18 - b _0816BA10 -_0816BA04: - movs r0, 0x5 - bl audio_play -_0816BA0A: - adds r0, r4, 0 - bl sub_816BAAC -_0816BA10: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_816B9D8 - - thumb_func_start sub_816BA18 -sub_816BA18: @ 816BA18 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, =0x03005d8c - ldr r4, =0x0203bcb8 - ldrh r1, [r4] - adds r1, 0x6 - ldrh r0, [r4, 0x2] - adds r1, r0 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x00002be0 - adds r0, r1 - ldr r1, [r2] - adds r5, r1, r0 - ldrh r0, [r5, 0x20] - movs r1, 0x1 - bl bag_add_item - lsls r0, 24 - cmp r0, 0 - bne _0816BA68 - ldr r1, =gUnknown_085EACB5 - ldr r2, =sub_816BBD4 - adds r0, r6, 0 - bl DisplayItemMessageOnField - b _0816BA9C - .pool -_0816BA68: - ldr r1, =gUnknown_085EACC8 - ldr r2, =sub_816BBD4 - adds r0, r6, 0 - bl DisplayItemMessageOnField - adds r0, r5, 0 - bl sub_80D439C - bl sub_816B54C - ldrb r0, [r4, 0x5] - subs r0, 0x1 - strb r0, [r4, 0x5] - ldrb r1, [r4, 0x5] - ldrb r0, [r4, 0x4] - ldrh r2, [r4, 0x2] - adds r0, r2 - cmp r1, r0 - bge _0816BA96 - cmp r2, 0 - beq _0816BA96 - subs r0, r2, 0x1 - strh r0, [r4, 0x2] -_0816BA96: - adds r0, r6, 0 - bl sub_816B4C0 -_0816BA9C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816BA18 - - thumb_func_start sub_816BAAC -sub_816BAAC: @ 816BAAC - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl sub_816BBD4 - pop {r0} - bx r0 - thumb_func_end sub_816BAAC - - thumb_func_start sub_816BABC -sub_816BABC: @ 816BABC - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl calc_player_party_count - lsls r0, 24 - cmp r0, 0 - bne _0816BAD4 - adds r0, r4, 0 - bl sub_816BBB8 - b _0816BAEA -_0816BAD4: - movs r0, 0x1 - movs r1, 0 - bl fade_screen - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_816BAF8 - str r0, [r1] -_0816BAEA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816BABC - - thumb_func_start sub_816BAF8 -sub_816BAF8: @ 816BAF8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0816BB1C - bl sub_81D1EC0 - bl overworld_free_bg_tilemaps - bl sub_81B8448 - adds r0, r4, 0 - bl DestroyTask -_0816BB1C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816BAF8 - - thumb_func_start sub_816BB28 -sub_816BB28: @ 816BB28 - push {lr} - ldr r0, =0x03005dac - ldr r1, =sub_816BB48 - str r1, [r0] - ldr r0, =c2_exit_to_overworld_2_switch - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_816BB28 - - thumb_func_start sub_816BB48 -sub_816BB48: @ 816BB48 - push {r4-r6,lr} - ldr r0, =task00_080EBBDC - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r6, r0, 24 - ldr r5, =0x0203bcb8 - ldrb r4, [r5, 0x5] - bl sub_816B510 - strb r0, [r5, 0x5] - bl sub_816B54C - ldrb r0, [r5, 0x5] - cmp r4, r0 - beq _0816BB7E - ldrb r1, [r5, 0x5] - ldrb r0, [r5, 0x4] - ldrh r2, [r5, 0x2] - adds r0, r2 - cmp r1, r0 - bge _0816BB7E - cmp r2, 0 - beq _0816BB7E - subs r0, r2, 0x1 - strh r0, [r5, 0x2] -_0816BB7E: - adds r0, r6, 0 - bl sub_816B4C0 - bl sub_81973A4 - ldr r0, =0x0203bcb8 - ldrb r0, [r0, 0x5] - bl sub_81D1C44 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0816BBA8 - adds r0, r6, 0 - bl sub_816B5F8 - b _0816BBAE - .pool -_0816BBA8: - adds r0, r6, 0 - bl DestroyTask -_0816BBAE: - bl pal_fill_black - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_816BB48 - - thumb_func_start sub_816BBB8 -sub_816BBB8: @ 816BBB8 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_085E8DE9 - ldr r2, =sub_816BBD4 - bl DisplayItemMessageOnField - pop {r0} - bx r0 - .pool - thumb_func_end sub_816BBB8 - - thumb_func_start sub_816BBD4 -sub_816BBD4: @ 816BBD4 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x2 - bl sub_81D1D04 - movs r0, 0 - movs r1, 0 - bl sub_8197434 - adds r0, r4, 0 - bl sub_816B5F8 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_816B674 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816BBD4 - - thumb_func_start sub_816BC14 -sub_816BC14: @ 816BC14 - push {r4,lr} - ldr r4, =0x0203bcc4 - movs r0, 0xCE - lsls r0, 3 - bl AllocZeroed - str r0, [r4] - movs r1, 0xCC - lsls r1, 3 - adds r0, r1 - movs r1, 0xFF - movs r2, 0x6 - bl memset - ldr r0, [r4] - ldr r1, =0x00000666 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r4] - ldr r1, =0x00000667 - adds r0, r1 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816BC14 - - thumb_func_start sub_816BC58 -sub_816BC58: @ 816BC58 - push {r4,lr} - movs r4, 0 -_0816BC5C: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_816BCC4 - adds r4, 0x1 - cmp r4, 0x5 - bls _0816BC5C - ldr r0, =0x0203bcc4 - ldr r0, [r0] - bl Free - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816BC58 - - thumb_func_start sub_816BC7C -sub_816BC7C: @ 816BC7C - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x0203bcc4 - movs r3, 0xCC - lsls r3, 3 - adds r1, r2, r3 - ldr r0, [r0] - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0xFF - bne _0816BCB4 - lsls r0, r2, 3 - ldr r1, =gUnknown_085DFF5C - adds r0, r1 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r2, 0x85 - lsls r2, 2 - movs r1, 0 - movs r3, 0xE - bl SetWindowBorderStyle - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram -_0816BCB4: - ldrb r0, [r4] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_816BC7C - - thumb_func_start sub_816BCC4 -sub_816BCC4: @ 816BCC4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0203bcc4 - movs r2, 0xCC - lsls r2, 3 - adds r0, r2 - ldr r1, [r1] - adds r4, r1, r0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _0816BCF8 - movs r1, 0 - bl sub_8198070 - ldrb r0, [r4] - bl ClearWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0xFF - strb r0, [r4] -_0816BCF8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816BCC4 - - thumb_func_start sub_816BD04 -sub_816BD04: @ 816BD04 - push {r4-r6,lr} - movs r6, 0 - ldr r0, =0x0203bcb8 - ldrb r0, [r0, 0x5] - subs r0, 0x1 - cmp r6, r0 - bge _0816BD58 - ldr r5, =0x0203bcc4 -_0816BD14: - lsls r4, r6, 1 - adds r4, r6 - lsls r4, 3 - movs r0, 0xCC - lsls r0, 1 - adds r4, r0 - ldr r0, [r5] - adds r0, r4 - ldr r1, =0x03005d8c - ldr r1, [r1] - lsls r2, r6, 2 - adds r1, r2 - movs r2, 0x93 - lsls r2, 3 - adds r1, r2 - ldrh r1, [r1] - bl sub_816BDC8 - ldr r0, [r5] - lsls r2, r6, 3 - adds r1, r0, r2 - adds r4, r0, r4 - str r4, [r1] - adds r0, 0x4 - adds r0, r2 - str r6, [r0] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =0x0203bcb8 - ldrb r0, [r0, 0x5] - subs r0, 0x1 - cmp r6, r0 - blt _0816BD14 -_0816BD58: - ldr r5, =0x0203bcc4 - lsls r4, r6, 1 - adds r4, r6 - lsls r4, 3 - movs r3, 0xCC - lsls r3, 1 - adds r4, r3 - ldr r0, [r5] - adds r0, r4 - ldr r1, =gUnknown_085E8CF7 - bl CopyString - ldr r0, [r5] - lsls r2, r6, 3 - adds r1, r0, r2 - adds r4, r0, r4 - str r4, [r1] - adds r0, 0x4 - adds r0, r2 - movs r1, 0x2 - negs r1, r1 - str r1, [r0] - ldr r4, =0x03006310 - adds r1, r4, 0 - ldr r0, =gUnknown_085DFF44 - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - movs r0, 0 - bl sub_816BC7C - strb r0, [r4, 0x10] - ldr r1, =0x0203bcb8 - ldrb r0, [r1, 0x5] - strh r0, [r4, 0xC] - ldr r0, [r5] - str r0, [r4] - ldrb r0, [r1, 0x4] - strh r0, [r4, 0xE] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816BD04 - - thumb_func_start sub_816BDC8 -sub_816BDC8: @ 816BDC8 - push {lr} - adds r2, r0, 0 - lsls r0, r1, 16 - lsrs r0, 16 - adds r1, r2, 0 - bl itemid_get_name - pop {r0} - bx r0 - thumb_func_end sub_816BDC8 - - thumb_func_start sub_816BDDC -sub_816BDDC: @ 816BDDC - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0x1 - beq _0816BDEE - movs r0, 0x5 - bl audio_play -_0816BDEE: - ldr r0, =0x0203bcc4 - ldr r0, [r0] - ldr r1, =0x00000666 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _0816BE38 - bl sub_816C0C8 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _0816BE2C - ldr r0, =0x03005d8c - ldr r0, [r0] - lsls r1, r4, 2 - adds r0, r1 - movs r1, 0x93 - lsls r1, 3 - adds r0, r1 - ldrh r0, [r0] - bl sub_816C060 - b _0816BE32 - .pool -_0816BE2C: - ldr r0, =0x0000ffff - bl sub_816C060 -_0816BE32: - adds r0, r4, 0 - bl sub_816BEF0 -_0816BE38: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816BDDC - - thumb_func_start fish4_goto_x5_or_x6 -fish4_goto_x5_or_x6: @ 816BE44 - push {r4-r6,lr} - sub sp, 0xC - adds r4, r1, 0 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r2, 24 - lsrs r5, r2, 24 - movs r0, 0x2 - negs r0, r0 - cmp r4, r0 - beq _0816BED4 - ldr r0, =0x0203bcc4 - ldr r0, [r0] - ldr r1, =0x00000666 - adds r0, r1 - ldrb r1, [r0] - cmp r1, 0xFF - beq _0816BE8E - lsls r0, r4, 24 - lsrs r0, 24 - cmp r1, r0 - bne _0816BE84 - adds r0, r5, 0 - movs r1, 0 - movs r2, 0xFF - bl sub_816BFE0 - b _0816BE8E - .pool -_0816BE84: - adds r0, r5, 0 - movs r1, 0xFF - movs r2, 0xFF - bl sub_816BFE0 -_0816BE8E: - ldr r0, =0x02021cc4 - ldr r1, =0x03005d8c - ldr r1, [r1] - lsls r2, r4, 2 - adds r1, r2 - ldr r2, =0x0000049a - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E8DA0 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0x7 - adds r1, r4, 0 - movs r2, 0x68 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - str r5, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r6, 0 - movs r1, 0x7 - adds r2, r4, 0 - bl Print -_0816BED4: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end fish4_goto_x5_or_x6 - - thumb_func_start sub_816BEF0 -sub_816BEF0: @ 816BEF0 - push {r4,r5,lr} - sub sp, 0xC - adds r1, r0, 0 - ldr r0, =0x0203bcc4 - ldr r0, [r0] - ldr r2, =0x00000661 - adds r0, r2 - ldrb r5, [r0] - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - beq _0816BF2C - ldr r0, =0x03005d8c - ldr r0, [r0] - lsls r1, 2 - adds r0, r1 - movs r1, 0x93 - lsls r1, 3 - adds r0, r1 - ldrh r0, [r0] - bl itemid_get_description - b _0816BF32 - .pool -_0816BF2C: - ldr r0, =0x0000ffff - bl sub_816C228 -_0816BF32: - adds r4, r0, 0 - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0x1 - 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 - movs r3, 0 - bl Print - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816BEF0 - - thumb_func_start sub_816BF60 -sub_816BF60: @ 816BF60 - push {r4,lr} - sub sp, 0x10 - ldr r4, =0x0203bcb8 - ldrb r0, [r4, 0x9] - cmp r0, 0xFF - bne _0816BF8C - ldrb r0, [r4, 0x5] - ldrb r1, [r4, 0x4] - subs r0, r1 - str r0, [sp] - ldr r0, =0x000013f8 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - adds r0, r4, 0x2 - str r0, [sp, 0xC] - movs r0, 0x2 - movs r1, 0xB0 - movs r2, 0xC - movs r3, 0x94 - bl AddScrollIndicatorArrowPairParametrized - strb r0, [r4, 0x9] -_0816BF8C: - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816BF60 - - thumb_func_start sub_816BF9C -sub_816BF9C: @ 816BF9C - push {r4,lr} - ldr r4, =0x0203bcb8 - ldrb r0, [r4, 0x9] - cmp r0, 0xFF - beq _0816BFAE - bl RemoveScrollIndicatorArrowPair - movs r0, 0xFF - strb r0, [r4, 0x9] -_0816BFAE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816BF9C - - thumb_func_start sub_816BFB8 -sub_816BFB8: @ 816BFB8 - push {r4,r5,lr} - adds r4, r1, 0 - adds r5, r2, 0 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - bl ListMenuGetYCoordForPrintingArrowCursor - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_816BFE0 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_816BFB8 - - thumb_func_start sub_816BFE0 -sub_816BFE0: @ 816BFE0 - push {r4-r6,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =0x0203bcc4 - ldr r0, [r0] - movs r3, 0xCC - lsls r3, 3 - adds r0, r3 - ldrb r5, [r0] - cmp r1, 0xFF - bne _0816C030 - 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] - adds r0, r5, 0 - movs r1, 0x11 - movs r2, 0 - adds r3, r6, 0 - bl FillWindowPixelRect - b _0816C050 - .pool -_0816C030: - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - ldr r0, =gUnknown_085DFF8C - str r0, [sp, 0x8] - lsls r0, r2, 24 - asrs r0, 24 - str r0, [sp, 0xC] - ldr r0, =gUnknown_085E8D60 - str r0, [sp, 0x10] - adds r0, r5, 0 - movs r1, 0x1 - movs r2, 0 - adds r3, r6, 0 - bl AddTextPrinterParametrized2 -_0816C050: - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816BFE0 - - thumb_func_start sub_816C060 -sub_816C060: @ 816C060 - push {r4-r6,lr} - lsls r0, 16 - lsrs r6, r0, 16 - ldr r0, =0x0203bcc4 - ldr r0, [r0] - ldr r1, =0x00000667 - adds r5, r0, r1 - ldrb r0, [r5] - cmp r0, 0xFF - bne _0816C0B2 - ldr r4, =0x000013f6 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - adds r0, r4, 0 - adds r1, r4, 0 - adds r2, r6, 0 - bl AddItemIconObject - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - beq _0816C0B2 - strb r2, [r5] - ldr r0, =0x02020630 - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] - movs r0, 0x18 - strh r0, [r1, 0x24] - movs r0, 0x50 - strh r0, [r1, 0x26] -_0816C0B2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816C060 - - thumb_func_start sub_816C0C8 -sub_816C0C8: @ 816C0C8 - push {r4,r5,lr} - ldr r0, =0x0203bcc4 - ldr r0, [r0] - ldr r1, =0x00000667 - adds r5, r0, r1 - ldrb r0, [r5] - cmp r0, 0xFF - beq _0816C0FA - ldr r4, =0x000013f6 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - movs r0, 0xFF - strb r0, [r5] -_0816C0FA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816C0C8 - - thumb_func_start sub_816C110 -sub_816C110: @ 816C110 - push {lr} - sub sp, 0x4 - bl sub_80D6E84 - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x93 - lsls r1, 3 - adds r0, r1 - ldr r2, =0x0203bcbc - adds r3, r2, 0x1 - movs r1, 0x8 - str r1, [sp] - movs r1, 0x32 - bl atk2D_jumpifarraynotequal - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_816C110 - - thumb_func_start sub_816C140 -sub_816C140: @ 816C140 - push {lr} - ldr r0, =0x0203bcba - subs r1, r0, 0x2 - ldrb r2, [r1, 0x4] - ldrb r3, [r1, 0x5] - bl sub_812225C - pop {r0} - bx r0 - .pool - thumb_func_end sub_816C140 - - thumb_func_start sub_816C158 -sub_816C158: @ 816C158 - push {r4-r7,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r7, r0, r1 - movs r4, 0 -_0816C16C: - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_816BC7C - adds r4, 0x1 - cmp r4, 0x3 - bls _0816C16C - movs r1, 0x6 - ldrsh r0, [r7, r1] - ldr r5, =gUnknown_085EAB71 - cmp r0, 0 - bne _0816C186 - ldr r5, =gUnknown_085EAB63 -_0816C186: - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x68 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - ldr r4, =0x0203bcc4 - ldr r0, [r4] - ldr r1, =0x00000663 - adds r0, r1 - ldrb r0, [r0] - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x1 - str r1, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - bl Print - ldr r0, [r4] - ldr r1, =0x00000662 - adds r0, r1 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - bl sub_816C110 - bl sub_816C140 - bl sub_816BD04 - ldr r0, =0x03006310 - ldr r2, =0x0203bcb8 - ldrh r1, [r2, 0x2] - ldrh r2, [r2] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0xA] - bl sub_816BF60 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_816C30C - str r1, [r0] - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816C158 - - thumb_func_start sub_816C228 -sub_816C228: @ 816C228 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - ldr r2, =0xffff0009 - adds r0, r1, r2 - cmp r0, 0x8 - bhi _0816C2B4 - lsls r0, 2 - ldr r1, =_0816C248 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0816C248: - .4byte _0816C2AC - .4byte _0816C2A4 - .4byte _0816C29C - .4byte _0816C294 - .4byte _0816C28C - .4byte _0816C284 - .4byte _0816C27C - .4byte _0816C274 - .4byte _0816C26C -_0816C26C: - ldr r0, =gUnknown_085E8D62 - b _0816C2BA - .pool -_0816C274: - ldr r0, =gUnknown_085EAC09 - b _0816C2BA - .pool -_0816C27C: - ldr r0, =gUnknown_085EAC22 - b _0816C2BA - .pool -_0816C284: - ldr r0, =gUnknown_085E8EE0 - b _0816C2BA - .pool -_0816C28C: - ldr r0, =gUnknown_085E8EF9 - b _0816C2BA - .pool -_0816C294: - ldr r0, =gUnknown_085EABE7 - b _0816C2BA - .pool -_0816C29C: - ldr r0, =gUnknown_085E8EB9 - b _0816C2BA - .pool -_0816C2A4: - ldr r0, =gUnknown_085E8F0E - b _0816C2BA - .pool -_0816C2AC: - ldr r0, =gUnknown_085E8DFE - b _0816C2BA - .pool -_0816C2B4: - adds r0, r1, 0 - bl itemid_get_description -_0816C2BA: - pop {r1} - bx r1 - thumb_func_end sub_816C228 - - thumb_func_start sub_816C2C0 -sub_816C2C0: @ 816C2C0 - push {r4-r6,lr} - sub sp, 0xC - adds r6, r0, 0 - ldr r0, =0x0203bcc4 - ldr r0, [r0] - ldr r1, =0x00000661 - adds r0, r1 - ldrb r5, [r0] - adds r0, r5, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r4, =0x02021fc4 - adds r0, r4, 0 - adds r1, r6, 0 - bl ExpandStringRefs - movs r0, 0x1 - 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 - movs r3, 0 - bl Print - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816C2C0 - - thumb_func_start sub_816C30C -sub_816C30C: @ 816C30C - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0816C35C - ldrb r0, [r4, 0xA] - ldr r1, =0x0203bcba - subs r4, r1, 0x2 - adds r2, r4, 0 - bl get_coro_args_x18_x1A - ldrh r1, [r4, 0x2] - ldrh r0, [r4] - adds r1, r0 - ldrb r0, [r4, 0x5] - subs r0, 0x1 - cmp r1, r0 - beq _0816C39E - movs r0, 0x5 - bl audio_play - adds r0, r5, 0 - bl sub_816C450 - b _0816C39E - .pool -_0816C35C: - ldrb r0, [r4, 0xA] - bl ListMenuHandleInput - adds r6, r0, 0 - ldrb r0, [r4, 0xA] - ldr r1, =0x0203bcba - subs r2, r1, 0x2 - bl get_coro_args_x18_x1A - movs r0, 0x2 - negs r0, r0 - cmp r6, r0 - beq _0816C384 - adds r0, 0x1 - cmp r6, r0 - bne _0816C392 - b _0816C39E - .pool -_0816C384: - movs r0, 0x5 - bl audio_play - adds r0, r5, 0 - bl sub_816C400 - b _0816C39E -_0816C392: - movs r0, 0x5 - bl audio_play - adds r0, r5, 0 - bl sub_816C71C -_0816C39E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_816C30C - - thumb_func_start bx_battle_menu_t3 -bx_battle_menu_t3: @ 816C3A4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0816C3F2 - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - movs r1, 0x6 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0816C3DC - adds r0, r4, 0 - movs r1, 0 - bl sub_816B190 - b _0816C3E4 - .pool -_0816C3DC: - adds r0, r4, 0 - movs r1, 0x2 - bl sub_816B190 -_0816C3E4: - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_816B248 - str r0, [r1] -_0816C3F2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end bx_battle_menu_t3 - - thumb_func_start sub_816C400 -sub_816C400: @ 816C400 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r6, =0x03005e08 - adds r5, r4, r6 - bl sub_816C0C8 - bl sub_816BF9C - ldrb r0, [r5, 0xA] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - ldr r0, =0x0203bcc4 - ldr r0, [r0] - movs r1, 0xCD - lsls r1, 3 - adds r0, r1 - movs r1, 0x7 - bl sub_81223B0 - bl sub_816BC58 - subs r6, 0x8 - adds r4, r6 - ldr r0, =bx_battle_menu_t3 - str r0, [r4] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816C400 - - thumb_func_start sub_816C450 -sub_816C450: @ 816C450 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =0x03005e08 - mov r8, r0 - adds r1, r4, 0 - add r1, r8 - mov r9, r1 - ldrb r0, [r1, 0xA] - movs r1, 0x10 - movs r2, 0x1 - bl sub_81AF15C - ldr r6, =0x0203bcc4 - ldr r2, [r6] - ldr r1, =0x0203bcb8 - ldrb r0, [r1] - ldrb r1, [r1, 0x2] - adds r0, r1 - ldr r5, =0x00000666 - adds r2, r5 - strb r0, [r2] - mov r1, r9 - ldrb r0, [r1, 0xA] - movs r1, 0 - movs r2, 0 - bl sub_816BFB8 - ldr r0, [r6] - adds r0, r5 - ldrb r0, [r0] - bl sub_816C690 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, [r6] - adds r0, r5 - ldrb r0, [r0] - lsls r0, 2 - adds r1, r0 - movs r0, 0x93 - lsls r0, 3 - adds r1, r0 - ldrh r0, [r1] - ldr r1, =0x02021cc4 - bl itemid_get_name - ldr r0, =0x0000fff7 - bl sub_816C228 - bl sub_816C2C0 - movs r1, 0x8 - negs r1, r1 - add r8, r1 - add r4, r8 - ldr r0, =sub_816C4FC - str r0, [r4] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816C450 - - thumb_func_start sub_816C4FC -sub_816C4FC: @ 816C4FC - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldr r7, =0x030022c0 - ldrh r1, [r7, 0x2E] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0816C530 - ldrb r0, [r4, 0xA] - ldr r1, =0x0203bcba - subs r2, r1, 0x2 - bl get_coro_args_x18_x1A - b _0816C57E - .pool -_0816C530: - ldrb r0, [r4, 0xA] - bl ListMenuHandleInput - adds r6, r0, 0 - ldrb r0, [r4, 0xA] - ldr r1, =0x0203bcba - subs r4, r1, 0x2 - adds r2, r4, 0 - bl get_coro_args_x18_x1A - ldr r0, =0x0203bcc4 - ldr r0, [r0] - movs r1, 0xCD - lsls r1, 3 - adds r0, r1 - movs r1, 0x7 - movs r2, 0 - bl sub_81223FC - ldrb r0, [r4] - bl sub_816C690 - movs r0, 0x2 - negs r0, r0 - cmp r6, r0 - beq _0816C574 - adds r0, 0x1 - cmp r6, r0 - bne _0816C592 - b _0816C59A - .pool -_0816C574: - ldrh r1, [r7, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0816C588 -_0816C57E: - adds r0, r5, 0 - movs r1, 0 - bl sub_816C5A0 - b _0816C59A -_0816C588: - adds r0, r5, 0 - movs r1, 0x1 - bl sub_816C5A0 - b _0816C59A -_0816C592: - adds r0, r5, 0 - movs r1, 0 - bl sub_816C5A0 -_0816C59A: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_816C4FC - - thumb_func_start sub_816C5A0 -sub_816C5A0: @ 816C5A0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r1, 0 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r0, r1 - mov r8, r0 - ldr r4, =0x0203bcb8 - ldrh r0, [r4] - ldrh r1, [r4, 0x2] - adds r0, r1 - lsls r0, 16 - lsrs r6, r0, 16 - movs r0, 0x5 - bl audio_play - mov r2, r8 - ldrb r0, [r2, 0xA] - adds r1, r4, 0x2 - adds r2, r4, 0 - bl sub_81AE6C8 - cmp r5, 0 - bne _0816C60A - ldr r1, =0x0203bcc4 - ldr r0, [r1] - ldr r2, =0x00000666 - adds r0, r2 - ldrb r2, [r0] - adds r4, r1, 0 - cmp r2, r6 - beq _0816C622 - subs r0, r6, 0x1 - cmp r2, r0 - beq _0816C60A - ldr r0, =0x03005d8c - ldr r0, [r0] - movs r1, 0x93 - lsls r1, 3 - adds r0, r1 - adds r1, r2, 0 - adds r2, r6, 0 - bl sub_80D702C - bl sub_816BD04 -_0816C60A: - ldr r0, =0x0203bcc4 - ldr r1, [r0] - ldr r2, =0x00000666 - adds r1, r2 - ldrb r1, [r1] - adds r4, r0, 0 - cmp r1, r6 - bcs _0816C622 - ldr r1, =0x0203bcb8 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] -_0816C622: - ldr r0, [r4] - movs r1, 0xCD - lsls r1, 3 - adds r0, r1 - movs r1, 0x7 - movs r2, 0x1 - bl sub_81223FC - ldr r0, [r4] - ldr r2, =0x00000666 - adds r0, r2 - movs r1, 0xFF - strb r1, [r0] - ldr r0, =0x03006310 - ldr r2, =0x0203bcb8 - ldrh r1, [r2, 0x2] - ldrh r2, [r2] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - strh r0, [r1, 0xA] - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_816C30C - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816C5A0 - - thumb_func_start sub_816C690 -sub_816C690: @ 816C690 - push {lr} - adds r3, r0, 0 - lsls r3, 24 - ldr r0, =0x0203bcc4 - ldr r0, [r0] - movs r1, 0xCD - lsls r1, 3 - adds r0, r1 - lsrs r3, 4 - movs r1, 0x80 - lsls r1, 13 - adds r3, r1 - lsrs r3, 16 - movs r1, 0x7 - movs r2, 0x80 - bl sub_8122448 - pop {r0} - bx r0 - .pool - thumb_func_end sub_816C690 - - thumb_func_start sub_816C6BC -sub_816C6BC: @ 816C6BC - push {r4-r6,lr} - sub sp, 0xC - adds r6, r0, 0 - ldr r5, [sp, 0x1C] - ldr r3, [sp, 0x20] - lsls r6, 24 - lsrs r6, 24 - lsls r1, 16 - lsrs r1, 16 - lsls r5, 24 - lsrs r5, 24 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =0x02021cc4 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E8DA0 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x30 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - str r5, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - adds r0, r6, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl Print - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816C6BC - - thumb_func_start sub_816C71C -sub_816C71C: @ 816C71C - push {r4-r6,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r6, r0, r1 - ldr r1, =0x0203bcb8 - ldrh r0, [r1, 0x2] - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 - bl sub_816BF9C - movs r0, 0x1 - strh r0, [r6, 0x4] - movs r1, 0x6 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0816C798 - ldr r0, =0x03005d8c - ldr r1, [r0] - lsls r0, r4, 2 - adds r1, r0 - ldr r2, =0x0000049a - adds r0, r1, r2 - ldrh r0, [r0] - cmp r0, 0x1 - bne _0816C774 - adds r0, r5, 0 - bl sub_816C8FC - b _0816C7FE - .pool -_0816C774: - movs r2, 0x93 - lsls r2, 3 - adds r0, r1, r2 - ldrh r0, [r0] - ldr r1, =0x02021cc4 - bl itemid_get_name - ldr r0, =0x0000fffe - bl sub_816C228 - bl sub_816C2C0 - b _0816C7D4 - .pool -_0816C798: - ldr r0, =0x03005d8c - ldr r1, [r0] - lsls r0, r4, 2 - adds r1, r0 - ldr r2, =0x0000049a - adds r0, r1, r2 - ldrh r0, [r0] - cmp r0, 0x1 - bne _0816C7BC - adds r0, r5, 0 - bl sub_816C9B8 - b _0816C7FE - .pool -_0816C7BC: - movs r2, 0x93 - lsls r2, 3 - adds r0, r1, r2 - ldrh r0, [r0] - ldr r1, =0x02021cc4 - bl itemid_get_name - ldr r0, =0x0000fffc - bl sub_816C228 - bl sub_816C2C0 -_0816C7D4: - movs r0, 0x4 - bl sub_816BC7C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x4] - movs r2, 0x1 - str r2, [sp] - movs r2, 0x3 - str r2, [sp, 0x4] - movs r2, 0x2 - movs r3, 0x8 - bl sub_816C6BC - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_816C818 - str r1, [r0] -_0816C7FE: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816C71C - - thumb_func_start sub_816C818 -sub_816C818: @ 816C818 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r5, r0, 24 - mov r9, r5 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r6, r0, r1 - ldr r0, =0x0203bcb8 - ldrh r2, [r0, 0x2] - ldrh r0, [r0] - adds r2, r0 - lsls r2, 16 - adds r0, r6, 0x4 - ldr r1, =0x03005d8c - mov r8, r1 - ldr r1, [r1] - lsrs r7, r2, 14 - adds r1, r7 - ldr r2, =0x0000049a - adds r1, r2 - ldrh r1, [r1] - bl AdjustQuantityAccordingToDPadInput - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bne _0816C888 - movs r0, 0x4 - bl sub_816BC7C - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x4] - str r4, [sp] - movs r2, 0x3 - str r2, [sp, 0x4] - movs r2, 0x2 - movs r3, 0x8 - bl sub_816C6BC - b _0816C8EC - .pool -_0816C888: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0816C8BC - movs r0, 0x5 - bl audio_play - movs r0, 0x4 - bl sub_816BCC4 - movs r3, 0x6 - ldrsh r0, [r6, r3] - cmp r0, 0 - bne _0816C8B4 - adds r0, r5, 0 - bl sub_816C8FC - b _0816C8EC - .pool -_0816C8B4: - adds r0, r5, 0 - bl sub_816C9B8 - b _0816C8EC -_0816C8BC: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0816C8EC - movs r0, 0x5 - bl audio_play - movs r0, 0x4 - bl sub_816BCC4 - mov r1, r8 - ldr r0, [r1] - adds r0, r7 - movs r2, 0x93 - lsls r2, 3 - adds r0, r2 - ldrh r0, [r0] - bl sub_816C228 - bl sub_816C2C0 - mov r0, r9 - bl sub_816CBC0 -_0816C8EC: - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_816C818 - - thumb_func_start sub_816C8FC -sub_816C8FC: @ 816C8FC - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r6, r1, 3 - ldr r0, =0x03005e08 - mov r8, r0 - adds r4, r6, r0 - ldr r0, =0x0203bcb8 - ldrh r1, [r0, 0x2] - ldrh r0, [r0] - adds r1, r0 - lsls r1, 16 - ldr r7, =0x03005d8c - ldr r0, [r7] - lsrs r5, r1, 14 - adds r0, r5 - movs r1, 0x93 - lsls r1, 3 - adds r0, r1 - ldrh r0, [r0] - ldrh r1, [r4, 0x4] - bl bag_add_item - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0816C98C - ldr r0, [r7] - adds r0, r5 - movs r2, 0x93 - lsls r2, 3 - adds r0, r2 - ldrh r0, [r0] - ldr r1, =0x02021cc4 - bl itemid_get_name - ldr r0, =0x02021dc4 - movs r2, 0x4 - ldrsh r1, [r4, r2] - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r0, =0x0000fffd - bl sub_816C228 - bl sub_816C2C0 - mov r0, r8 - subs r0, 0x8 - adds r0, r6, r0 - ldr r1, =sub_816CB04 - b _0816C9A2 - .pool -_0816C98C: - movs r0, 0 - strh r0, [r4, 0x4] - ldr r0, =0x0000fffa - bl sub_816C228 - bl sub_816C2C0 - mov r0, r8 - subs r0, 0x8 - adds r0, r6, r0 - ldr r1, =sub_816CB74 -_0816C9A2: - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816C8FC - - thumb_func_start sub_816C9B8 -sub_816C9B8: @ 816C9B8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - mov r8, r0 - ldr r0, =0x03005e08 - mov r9, r0 - mov r7, r8 - add r7, r9 - ldr r0, =0x0203bcb8 - ldrh r1, [r0, 0x2] - ldrh r0, [r0] - adds r1, r0 - lsls r1, 16 - ldr r6, =0x03005d8c - ldr r0, [r6] - lsrs r4, r1, 14 - adds r0, r4 - movs r1, 0x93 - lsls r1, 3 - adds r0, r1 - ldrh r0, [r0] - bl itemid_is_unique - lsls r0, 24 - cmp r0, 0 - bne _0816CA64 - ldr r0, [r6] - adds r0, r4 - movs r2, 0x93 - lsls r2, 3 - adds r0, r2 - ldrh r0, [r0] - ldr r1, =0x02021cc4 - bl itemid_get_name - ldr r0, =0x02021dc4 - movs r2, 0x4 - ldrsh r1, [r7, r2] - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r0, =0x0000fff8 - bl sub_816C228 - bl sub_816C2C0 - ldr r1, =gUnknown_085DFF84 - movs r0, 0x1 - str r0, [sp] - movs r0, 0x85 - lsls r0, 2 - str r0, [sp, 0x4] - movs r0, 0xE - str r0, [sp, 0x8] - ldr r0, =gUnknown_085DFF3C - str r0, [sp, 0xC] - adds r0, r5, 0 - movs r2, 0x1 - movs r3, 0 - bl CreateYesNoMenuWithCallbacks - b _0816CA7C - .pool -_0816CA64: - movs r0, 0 - strh r0, [r7, 0x4] - ldr r0, =0x0000fff9 - bl sub_816C228 - bl sub_816C2C0 - mov r0, r9 - subs r0, 0x8 - add r0, r8 - ldr r1, =sub_816CB74 - str r1, [r0] -_0816CA7C: - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816C9B8 - - thumb_func_start sub_816CA94 -sub_816CA94: @ 816CA94 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x0000fffb - bl sub_816C228 - bl sub_816C2C0 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_816CB04 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816CA94 - - thumb_func_start sub_816CAC8 -sub_816CAC8: @ 816CAC8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r1, =0x0203bcb8 - ldrh r0, [r1, 0x2] - ldrh r1, [r1] - adds r0, r1 - lsls r0, 2 - adds r2, r0 - movs r0, 0x93 - lsls r0, 3 - adds r2, r0 - ldrh r0, [r2] - bl sub_816C228 - bl sub_816C2C0 - adds r0, r4, 0 - bl sub_816CBC0 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816CAC8 - - thumb_func_start sub_816CB04 -sub_816CB04: @ 816CB04 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _0816CB5E - ldr r4, =0x0203bcb8 - ldrb r0, [r4, 0x2] - ldrb r1, [r4] - adds r0, r1 - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r5, 0x4] - bl sub_80D6E48 - ldrb r0, [r5, 0xA] - adds r1, r4, 0x2 - adds r2, r4, 0 - bl sub_81AE6C8 - bl sub_816C110 - bl sub_816C140 - bl sub_816BD04 - ldr r0, =0x03006310 - ldrh r1, [r4, 0x2] - ldrh r2, [r4] - bl ListMenuInit - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0xA] - adds r0, r6, 0 - bl sub_816CBC0 -_0816CB5E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816CB04 - - thumb_func_start sub_816CB74 -sub_816CB74: @ 816CB74 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _0816CBAC - ldr r0, =0x03005d8c - ldr r2, [r0] - ldr r1, =0x0203bcb8 - ldrh r0, [r1, 0x2] - ldrh r1, [r1] - adds r0, r1 - lsls r0, 2 - adds r2, r0 - movs r0, 0x93 - lsls r0, 3 - adds r2, r0 - ldrh r0, [r2] - bl sub_816C228 - bl sub_816C2C0 - adds r0, r4, 0 - bl sub_816CBC0 -_0816CBAC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816CB74 - - thumb_func_start sub_816CBC0 -sub_816CBC0: @ 816CBC0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_816BF60 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_816C30C - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816CBC0 - - thumb_func_start sub_816CBE8 -sub_816CBE8: @ 816CBE8 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - bl sub_80BA0A8 - pop {r0} - bx r0 - thumb_func_end sub_816CBE8 - - thumb_func_start sub_816CC00 -sub_816CC00: @ 816CC00 - push {lr} - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - ldr r0, =0x030022c0 - ldrh r0, [r0, 0x2E] - cmp r0, 0 - beq _0816CC3C - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0816CC3C - ldr r0, =sub_816CC54 - bl SetMainCallback2 - b _0816CC4C - .pool -_0816CC3C: - ldr r2, =0x030062a0 - ldr r1, [r2] - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _0816CC4C - adds r0, r1, 0x1 - str r0, [r2] -_0816CC4C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_816CC00 - - thumb_func_start sub_816CC54 -sub_816CC54: @ 816CC54 - push {lr} - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _0816CC66 - ldr r0, =c2_title_screen_1 - bl SetMainCallback2 -_0816CC66: - pop {r0} - bx r0 - .pool - thumb_func_end sub_816CC54 - - thumb_func_start load_copyright_graphics -@ void load_copyright_graphics(u16 tile_patterns_dest, u16 tilemap_dest, u16 unknown_dest) -load_copyright_graphics: @ 816CC70 - push {r4-r6,lr} - adds r3, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - lsls r3, 16 - lsrs r3, 16 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - ldr r0, =gIntroCopyright_Gfx - movs r6, 0xC0 - lsls r6, 19 - adds r3, r6 - adds r1, r3, 0 - bl LZ77UnCompVram - ldr r0, =gIntroCopyright_Tilemap - adds r4, r6 - adds r1, r4, 0 - bl LZ77UnCompVram - ldr r0, =gIntroCopyright_Pal - adds r1, r5, 0 - movs r2, 0x20 - bl gpu_pal_apply - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end load_copyright_graphics - - thumb_func_start SerialCb_CopyrightScreen -SerialCb_CopyrightScreen: @ 816CCB8 - push {lr} - ldr r0, =0x030062b0 - bl GameCubeMultiBoot_HandleSerialInterrupt - pop {r0} - bx r0 - .pool - thumb_func_end SerialCb_CopyrightScreen - - thumb_func_start do_copyright_screen -do_copyright_screen: @ 816CCC8 - push {r4-r6,lr} - sub sp, 0x10 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r5, r0, r1 - ldrb r4, [r5] - cmp r4, 0x8C - bne _0816CCDC - b _0816CE00 -_0816CCDC: - cmp r4, 0x8C - bgt _0816CCEC - cmp r4, 0 - beq _0816CCF4 - b _0816CDBC - .pool -_0816CCEC: - cmp r4, 0x8D - bne _0816CCF2 - b _0816CE2C -_0816CCF2: - b _0816CDBC -_0816CCF4: - movs r0, 0 - bl SetVBlankCallback - 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 r1, 0xA0 - lsls r1, 19 - ldr r2, =0x00007fff - adds r0, r2, 0 - strh r0, [r1] - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - str r4, [sp, 0x4] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x05006000 - add r0, sp, 0x4 - bl CpuSet - str r4, [sp, 0x8] - add r0, sp, 0x8 - movs r1, 0xE0 - lsls r1, 19 - ldr r2, =0x05000100 - bl CpuSet - add r0, sp, 0xC - strh r4, [r0] - ldr r1, =0x05000002 - ldr r2, =0x010001ff - bl CpuSet - bl sub_80A1A74 - movs r1, 0xE0 - lsls r1, 6 - movs r0, 0 - movs r2, 0 - bl load_copyright_graphics - bl remove_some_task - bl ResetTasks - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - movs r1, 0xE0 - lsls r1, 3 - movs r0, 0x8 - bl SetGpuReg - movs r0, 0x1 - bl EnableInterrupts - ldr r0, =sub_816CBE8 - bl SetVBlankCallback - movs r1, 0x80 - lsls r1, 19 - movs r2, 0xA0 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r1] - ldr r0, =SerialCb_CopyrightScreen - bl SetSerialCallback - ldr r0, =0x030062b0 - bl GameCubeMultiBoot_Init -_0816CDBC: - bl fade_and_return_progress_probably - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - ldr r0, =0x030062b0 - bl GameCubeMultiBoot_Main - b _0816CEA0 - .pool -_0816CE00: - ldr r4, =0x030062b0 - adds r0, r4, 0 - bl GameCubeMultiBoot_Main - ldrb r0, [r4, 0x2] - cmp r0, 0x1 - beq _0816CEA0 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - b _0816CEA0 - .pool -_0816CE2C: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _0816CEA0 - ldr r0, =task_intro_1 - movs r1, 0 - bl CreateTask - ldr r0, =sub_816CC00 - bl SetMainCallback2 - ldr r5, =0x030062b0 - ldrb r0, [r5, 0x2] - cmp r0, 0 - beq _0816CE8C - ldrb r0, [r5, 0x2] - cmp r0, 0x2 - bne _0816CE96 - ldr r6, =0x020000ac - ldr r4, [r6] - ldr r0, =0x65366347 - cmp r4, r0 - bne _0816CE6C - ldr r0, =gMultiBootProgram_PokemonColosseum_Start - movs r1, 0x80 - lsls r1, 18 - movs r2, 0xA0 - lsls r2, 9 - bl CpuSet - str r4, [r6] -_0816CE6C: - adds r0, r5, 0 - bl GameCubeMultiBoot_ExecuteProgram - b _0816CE96 - .pool -_0816CE8C: - bl GameCubeMultiBoot_Quit - ldr r0, =sub_800BA38 - bl SetSerialCallback -_0816CE96: - movs r0, 0 - b _0816CEA2 - .pool -_0816CEA0: - movs r0, 0x1 -_0816CEA2: - add sp, 0x10 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end do_copyright_screen - - thumb_func_start c2_copyright_1 -c2_copyright_1: @ 816CEAC - push {lr} - bl do_copyright_screen - lsls r0, 24 - cmp r0, 0 - bne _0816CEFA - bl sub_815355C - lsls r0, 16 - lsrs r0, 16 - bl InitSaveBlockPointersWithRandomOffset - bl sub_808447C - bl sub_8152680 - movs r0, 0 - bl sub_81534D0 - ldr r0, =0x03006210 - ldrh r0, [r0] - cmp r0, 0 - beq _0816CEDE - cmp r0, 0x2 - bne _0816CEE2 -_0816CEDE: - bl init_sav2 -_0816CEE2: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x15] - lsls r0, 31 - lsrs r0, 31 - bl sub_82E1810 - ldr r0, =0x02000000 - movs r1, 0xE0 - lsls r1, 9 - bl InitHeap -_0816CEFA: - pop {r0} - bx r0 - .pool - thumb_func_end c2_copyright_1 - - thumb_func_start c2_show_copyright_and_intro_again_2 -c2_show_copyright_and_intro_again_2: @ 816CF0C - push {lr} - bl do_copyright_screen - pop {r0} - bx r0 - thumb_func_end c2_show_copyright_and_intro_again_2 - - thumb_func_start task_intro_1 -@ void task_intro_1(int task_id) -task_intro_1: @ 816CF18 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0xC - mov r8, r0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r0, 0 - bl SetVBlankCallback - ldr r4, =0x0203bcc8 - bl GenerateRandomNumber - movs r1, 0x1 - ands r1, r0 - strh r1, [r4] - bl intro_reset_and_hide_bgs - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0x50 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0x18 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0x28 - bl SetGpuReg - ldr r0, =gUnknown_085E13B4 - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gUnknown_085E07C4 - ldr r1, =0x06008000 - bl LZ77UnCompVram - ldr r1, =0x06008800 - add r0, sp, 0x8 - movs r6, 0 - strh r6, [r0] - ldr r4, =0x040000d4 - str r0, [r4] - str r1, [r4, 0x4] - ldr r5, =0x81000400 - str r5, [r4, 0x8] - ldr r0, [r4, 0x8] - ldr r0, =gUnknown_085E0B78 - ldr r1, =0x06009000 - bl LZ77UnCompVram - ldr r1, =0x06009800 - add r0, sp, 0x8 - strh r6, [r0] - str r0, [r4] - str r1, [r4, 0x4] - str r5, [r4, 0x8] - ldr r0, [r4, 0x8] - ldr r0, =gUnknown_085E0EAC - ldr r1, =0x0600a000 - bl LZ77UnCompVram - ldr r1, =0x0600a800 - add r0, sp, 0x8 - strh r6, [r0] - str r0, [r4] - str r1, [r4, 0x4] - str r5, [r4, 0x8] - ldr r0, [r4, 0x8] - ldr r0, =gUnknown_085E119C - ldr r1, =0x0600b000 - bl LZ77UnCompVram - ldr r1, =0x0600b800 - add r0, sp, 0x8 - strh r6, [r0] - str r0, [r4] - str r1, [r4, 0x4] - str r5, [r4, 0x8] - ldr r0, [r4, 0x8] - ldr r0, =gUnknown_085E05C4 - movs r5, 0x80 - lsls r5, 2 - movs r1, 0 - adds r2, r5, 0 - bl gpu_pal_apply - ldr r1, =0x00009603 - movs r0, 0xE - bl SetGpuReg - ldr r1, =0x00009402 - movs r0, 0xC - bl SetGpuReg - ldr r1, =0x00009201 - movs r0, 0xA - bl SetGpuReg - movs r1, 0x90 - lsls r1, 8 - movs r0, 0x8 - bl SetGpuReg - ldr r0, =gUnknown_085E4FDC - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085E4FEC - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085E4FFC - bl LoadTaggedObjectPalettes - ldr r0, =gUnknown_085E4A74 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085E4A84 - bl LoadTaggedObjectPalettes - ldr r4, =0x02037914 - movs r3, 0xF0 - lsls r3, 1 - adds r1, r4, r3 - adds r0, r4, 0 - movs r2, 0x10 - bl CpuSet - movs r0, 0xE1 - lsls r0, 1 - adds r1, r4, r0 - adds r0, r4, 0 - movs r2, 0xF - bl CpuSet - movs r3, 0xD2 - lsls r3, 1 - adds r1, r4, r3 - adds r0, r4, 0 - movs r2, 0xE - bl CpuSet - movs r0, 0xC3 - lsls r0, 1 - adds r1, r4, r0 - adds r0, r4, 0 - movs r2, 0xD - bl CpuSet - movs r3, 0xB4 - lsls r3, 1 - adds r1, r4, r3 - adds r0, r4, 0 - movs r2, 0xC - bl CpuSet - movs r0, 0xA5 - lsls r0, 1 - adds r1, r4, r0 - adds r0, r4, 0 - movs r2, 0xB - bl CpuSet - movs r3, 0x96 - lsls r3, 1 - adds r1, r4, r3 - adds r0, r4, 0 - movs r2, 0xA - bl CpuSet - movs r0, 0x78 - movs r1, 0x50 - movs r2, 0 - bl sub_816FDB8 - movs r1, 0xE - negs r1, r1 - movs r0, 0x78 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - movs r0, 0xEC - adds r2, r5, 0 - movs r3, 0x1 - bl sub_816F7D0 - ldr r2, =0x03005e00 - mov r3, r8 - lsls r1, r3, 2 - add r1, r8 - lsls r1, 3 - adds r1, r2 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x8] - ldr r0, =task_intro_2 - str r0, [r1] - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_1 - - thumb_func_start task_intro_2 -task_intro_2: @ 816D12C - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - negs r0, r0 - movs r5, 0 - str r5, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =sub_816CBE8 - bl SetVBlankCallback - movs r1, 0xFA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_3 - str r1, [r0] - ldr r0, =0x030062a0 - str r5, [r0] - movs r0, 0xCF - lsls r0, 1 - bl m4aSongNumStart - bl sub_800B628 - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_2 - - thumb_func_start task_intro_3 -task_intro_3: @ 816D190 - push {r4-r6,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - ldr r5, =0x030062a0 - ldr r0, [r5] - cmp r0, 0x4C - bne _0816D1BE - ldr r2, =0x02020630 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r3, 0x8 - ldrsh r1, [r0, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strh r1, [r0, 0x2E] -_0816D1BE: - ldr r0, [r5] - cmp r0, 0x80 - bne _0816D1CC - ldr r0, =task_intro_3_1 - movs r1, 0 - bl CreateTask -_0816D1CC: - ldr r0, [r5] - cmp r0, 0xFB - bne _0816D1EE - ldr r2, =0x02020630 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r3, 0x8 - ldrsh r1, [r0, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2 - strh r1, [r0, 0x2E] -_0816D1EE: - ldr r1, [r5] - movs r0, 0x80 - lsls r0, 1 - cmp r1, r0 - bne _0816D200 - ldr r0, =task_intro_3_2 - movs r1, 0 - bl CreateTask -_0816D200: - ldr r1, [r5] - movs r0, 0xB8 - lsls r0, 1 - cmp r1, r0 - bne _0816D220 - movs r2, 0x80 - lsls r2, 3 - movs r0, 0x70 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x30 - movs r1, 0 - movs r3, 0x5 - bl sub_816F7D0 -_0816D220: - ldr r1, [r5] - movs r0, 0xC0 - lsls r0, 1 - cmp r1, r0 - bne _0816D240 - movs r2, 0x80 - lsls r2, 3 - movs r0, 0x80 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0xC8 - movs r1, 0x3C - movs r3, 0x9 - bl sub_816F7D0 -_0816D240: - ldr r0, [r5] - movs r4, 0x8C - lsls r4, 2 - cmp r0, r4 - bne _0816D252 - ldr r0, =task_intro_3_3 - movs r1, 0 - bl CreateTask -_0816D252: - ldr r0, [r5] - cmp r0, r4 - bls _0816D27A - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - movs r1, 0x50 - strh r1, [r0, 0xA] - strh r2, [r0, 0xC] - movs r1, 0x18 - strh r1, [r0, 0xE] - strh r2, [r0, 0x10] - movs r1, 0x28 - strh r1, [r0, 0x12] - strh r2, [r0, 0x14] - ldr r1, =task_intro_4 - str r1, [r0] -_0816D27A: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_3 - - thumb_func_start task_intro_3_3 -task_intro_3_3: @ 816D2A0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldrh r0, [r4, 0x4] - adds r0, 0x1 - strh r0, [r4, 0x4] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0816D2C4 - ldrh r0, [r4, 0x6] - adds r0, 0x1 - strh r0, [r4, 0x6] -_0816D2C4: - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0816D2D8 - cmp r0, 0x1 - beq _0816D314 - b _0816D324 - .pool -_0816D2D8: - ldr r0, =gUnknown_085E4AB8 - ldr r2, =gUnknown_085E4AD0 - movs r1, 0x8 - ldrsh r3, [r4, r1] - lsls r3, 1 - adds r1, r3, r2 - ldrb r1, [r1] - adds r2, 0x1 - adds r3, r2 - ldrh r2, [r4, 0x6] - ldrb r3, [r3] - adds r2, r3 - lsls r2, 16 - asrs r2, 16 - movs r3, 0 - bl AddObjectToFront - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - movs r0, 0xC - strh r0, [r4, 0x2] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0816D324 - .pool -_0816D314: - ldrh r0, [r4, 0x2] - subs r0, 0x1 - strh r0, [r4, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bne _0816D324 - strh r0, [r4] -_0816D324: - movs r1, 0x6 - ldrsh r0, [r4, r1] - cmp r0, 0x3C - ble _0816D332 - adds r0, r5, 0 - bl DestroyTask -_0816D332: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end task_intro_3_3 - - thumb_func_start sub_816D338 -sub_816D338: @ 816D338 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - bne _0816D350 - adds r0, r1, 0 - bl RemoveObjectAndFreeTiles -_0816D350: - pop {r0} - bx r0 - thumb_func_end sub_816D338 - - thumb_func_start task_intro_4 -task_intro_4: @ 816D354 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r1, r0, 24 - adds r4, r1, 0 - ldr r5, =0x030062a0 - ldr r2, [r5] - ldr r0, =0x00000387 - cmp r2, r0 - bhi _0816D418 - ldr r0, =0x03005e00 - lsls r4, r1, 2 - adds r4, r1 - lsls r4, 3 - adds r4, r0 - movs r1, 0xA - ldrsh r0, [r4, r1] - lsls r0, 16 - ldrh r1, [r4, 0xC] - adds r1, r0, r1 - ldr r0, =0xffffa000 - adds r1, r0 - asrs r0, r1, 16 - strh r0, [r4, 0xA] - strh r1, [r4, 0xC] - ldrh r1, [r4, 0xA] - movs r0, 0x1A - bl SetGpuReg - movs r1, 0xE - ldrsh r0, [r4, r1] - lsls r0, 16 - ldrh r1, [r4, 0x10] - adds r1, r0, r1 - ldr r0, =0xffff8000 - adds r1, r0 - asrs r0, r1, 16 - strh r0, [r4, 0xE] - strh r1, [r4, 0x10] - ldrh r1, [r4, 0xE] - movs r0, 0x16 - bl SetGpuReg - movs r1, 0x12 - ldrsh r0, [r4, r1] - lsls r0, 16 - ldrh r1, [r4, 0x14] - adds r1, r0, r1 - ldr r0, =0xffff4000 - adds r1, r0 - asrs r0, r1, 16 - strh r0, [r4, 0x12] - strh r1, [r4, 0x14] - ldrh r1, [r4, 0x12] - movs r0, 0x12 - bl SetGpuReg - ldr r1, [r5] - movs r0, 0xD0 - lsls r0, 2 - cmp r1, r0 - bne _0816D43E - ldr r0, =gUnknown_085E4FC4 - movs r1, 0x78 - movs r2, 0xA0 - movs r3, 0xA - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - b _0816D43E - .pool -_0816D418: - ldr r0, =0x000003ef - cmp r2, r0 - bls _0816D43E - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_5 - str r1, [r0] -_0816D43E: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_4 - - thumb_func_start task_intro_5 -task_intro_5: @ 816D458 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x030062a0 - ldr r1, [r0] - ldr r0, =0x00000402 - cmp r1, r0 - bls _0816D476 - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =task_intro_6 - str r0, [r1] -_0816D476: - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_5 - - thumb_func_start task_intro_6 -task_intro_6: @ 816D48C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl intro_reset_and_hide_bgs - movs r0, 0 - bl SetVBlankCallback - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - ldr r0, =0x0203bd24 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x0203bd26 - strh r1, [r0] - ldr r0, =0x0203bccc - strh r1, [r0] - movs r0, 0x1 - bl load_intro_part2_graphics - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_7 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_6 - - thumb_func_start task_intro_7 -task_intro_7: @ 816D4E4 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0203bcc8 - ldrh r0, [r0] - cmp r0, 0 - bne _0816D504 - ldr r0, =gUnknown_085F52BC - bl LoadCompressedObjectPic - b _0816D50A - .pool -_0816D504: - ldr r0, =gUnknown_085F52CC - bl LoadCompressedObjectPic -_0816D50A: - ldr r0, =gUnknown_085F52DC - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F52FC - bl LoadCompressedObjectPic - movs r6, 0 - lsls r7, r4, 2 - ldr r5, =gUnknown_085E4AE8 -_0816D51C: - lsls r0, r6, 3 - adds r0, r5 - bl LoadCompressedObjectPic - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bls _0816D51C - ldr r0, =gUnknown_085F530C - bl LoadTaggedObjectPalettes - ldr r0, =gUnknown_085E4B08 - bl LoadTaggedObjectPalettes - ldr r0, =gUnknown_085E4BDC - movs r5, 0x88 - lsls r5, 1 - adds r1, r5, 0 - movs r2, 0x80 - movs r3, 0 - bl AddObjectToFront - ldr r0, =gUnknown_085E4BA4 - movs r1, 0x90 - lsls r1, 1 - movs r2, 0x6E - movs r3, 0x1 - bl AddObjectToFront - ldr r0, =0x0203bcc8 - ldrh r0, [r0] - cmp r0, 0 - bne _0816D590 - adds r0, r5, 0 - movs r1, 0x64 - bl sub_817B834 - b _0816D598 - .pool -_0816D590: - adds r0, r5, 0 - movs r1, 0x64 - bl sub_817B88C -_0816D598: - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, =0x02020630 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r5, r2, 0 - adds r5, 0x1C - adds r3, r0, r5 - ldr r1, =sub_816F9D4 - str r1, [r3] - adds r2, 0x8 - adds r0, r2 - ldr r1, =gUnknown_085E4DC4 - str r1, [r0] - ldr r0, =0x03005e00 - adds r4, r7, r4 - lsls r4, 3 - adds r4, r0 - strh r6, [r4, 0xA] - ldr r0, =gUnknown_085E4B40 - movs r1, 0x88 - lsls r1, 1 - movs r2, 0x50 - movs r3, 0x4 - bl AddObjectToFront - movs r0, 0x40 - negs r0, r0 - movs r1, 0x3C - bl sub_817B9C4 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r0, r5 - ldr r1, =sub_816FAB0 - str r1, [r0] - strh r6, [r4, 0xC] - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =sub_816CBE8 - bl SetVBlankCallback - movs r1, 0x80 - lsls r1, 7 - movs r2, 0x80 - lsls r2, 3 - movs r0, 0x1 - movs r3, 0x10 - bl sub_817B3DC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x8] - movs r0, 0x1 - bl sub_817B150 - ldr r0, =task_intro_8 - str r0, [r4] - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_7 - - thumb_func_start task_intro_8 -@ void task_intro_8(int task_id) -task_intro_8: @ 816D650 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - ldr r5, =0x030062a0 - ldr r1, [r5] - movs r0, 0xE8 - lsls r0, 3 - cmp r1, r0 - bne _0816D67C - ldr r1, =0x0203bd28 - movs r0, 0x2 - strh r0, [r1] - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrb r0, [r0, 0x8] - bl DestroyTask -_0816D67C: - ldr r1, [r5] - ldr r0, =0x0000079a - cmp r1, r0 - bls _0816D6A4 - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0x8 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_9 - str r1, [r0] -_0816D6A4: - ldr r1, [r5] - ldr r0, =0x00000455 - ldr r3, =0x03005e00 - cmp r1, r0 - bne _0816D6C8 - ldr r2, =0x02020630 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - movs r7, 0xA - ldrsh r1, [r0, r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strh r1, [r0, 0x2E] -_0816D6C8: - ldr r1, [r5] - ldr r0, =0x000004be - cmp r1, r0 - bne _0816D6EA - ldr r2, =0x02020630 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - movs r7, 0xA - ldrsh r1, [r0, r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strh r1, [r0, 0x2E] -_0816D6EA: - ldr r1, [r5] - ldr r0, =0x00000572 - cmp r1, r0 - bne _0816D70C - ldr r2, =0x02020630 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - movs r7, 0xC - ldrsh r1, [r0, r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strh r1, [r0, 0x2E] -_0816D70C: - ldr r1, [r5] - ldr r0, =0x00000576 - cmp r1, r0 - bne _0816D72E - ldr r2, =0x02020630 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - movs r7, 0xA - ldrsh r1, [r0, r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2 - strh r1, [r0, 0x2E] -_0816D72E: - ldr r1, [r5] - movs r0, 0xC5 - lsls r0, 3 - cmp r1, r0 - bne _0816D752 - ldr r2, =0x02020630 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - movs r7, 0xA - ldrsh r1, [r0, r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3 - strh r1, [r0, 0x2E] -_0816D752: - ldr r1, [r5] - ldr r0, =0x000006bf - cmp r1, r0 - bne _0816D774 - ldr r2, =0x02020630 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - movs r4, 0xA - ldrsh r1, [r0, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x4 - strh r1, [r0, 0x2E] -_0816D774: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r3 - ldrh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 18 - movs r1, 0x7F - ands r0, r1 - movs r1, 0x30 - bl sine - ldr r1, =0x0203bccc - strh r0, [r1] - ldrh r2, [r4, 0xE] - movs r7, 0xE - ldrsh r1, [r4, r7] - ldr r0, =0x000001ff - cmp r1, r0 - bgt _0816D7A0 - adds r0, r2, 0x1 - strh r0, [r4, 0xE] -_0816D7A0: - movs r0, 0 - bl sub_817B540 - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_8 - - thumb_func_start task_intro_9 -task_intro_9: @ 816D7E8 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x030062a0 - ldr r1, [r0] - ldr r0, =0x00000814 - cmp r1, r0 - bls _0816D806 - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =task_intro_10 - str r0, [r1] -_0816D806: - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_9 - - thumb_func_start sub_816D81C -sub_816D81C: @ 816D81C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x34] - adds r0, 0x4 - strh r0, [r4, 0x34] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x8 - bls _0816D830 - b _0816D9BA -_0816D830: - lsls r0, 2 - ldr r1, =_0816D840 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0816D840: - .4byte _0816D864 - .4byte _0816D87A - .4byte _0816D898 - .4byte _0816D8BC - .4byte _0816D8D8 - .4byte _0816D8FA - .4byte _0816D912 - .4byte _0816D96E - .4byte _0816D99C -_0816D864: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB3 - bgt _0816D874 - b _0816D9BA -_0816D874: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_0816D87A: - ldrh r0, [r4, 0x20] - subs r0, 0x4 - strh r0, [r4, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3C - beq _0816D88A - b _0816D9BA -_0816D88A: - movs r0, 0x8 - strh r0, [r4, 0x2E] - movs r0, 0x14 - strh r0, [r4, 0x30] - movs r0, 0x2 - strh r0, [r4, 0x32] - b _0816D9BA -_0816D898: - ldrh r1, [r4, 0x20] - adds r1, 0x8 - strh r1, [r4, 0x20] - ldrh r0, [r4, 0x22] - subs r0, 0x2 - strh r0, [r4, 0x22] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x7C - beq _0816D8AE - b _0816D9BA -_0816D8AE: - movs r0, 0x8 - strh r0, [r4, 0x2E] - movs r0, 0x14 - strh r0, [r4, 0x30] - movs r0, 0x3 - strh r0, [r4, 0x32] - b _0816D9BA -_0816D8BC: - ldrh r0, [r4, 0x22] - adds r0, 0x4 - strh r0, [r4, 0x22] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x50 - bne _0816D9BA - movs r0, 0x8 - strh r0, [r4, 0x2E] - movs r0, 0xA - strh r0, [r4, 0x30] - movs r0, 0x4 - strh r0, [r4, 0x32] - b _0816D9BA -_0816D8D8: - ldrh r1, [r4, 0x20] - subs r1, 0x8 - strh r1, [r4, 0x20] - ldrh r0, [r4, 0x22] - subs r0, 0x2 - strh r0, [r4, 0x22] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x3C - bne _0816D9BA - movs r0, 0x8 - strh r0, [r4, 0x2E] - movs r0, 0xA - strh r0, [r4, 0x30] - movs r0, 0x5 - strh r0, [r4, 0x32] - b _0816D9BA -_0816D8FA: - ldrh r0, [r4, 0x20] - adds r0, 0x3C - strh r0, [r4, 0x20] - movs r0, 0xC0 - strh r0, [r4, 0x36] - movs r0, 0x80 - strh r0, [r4, 0x38] - movs r0, 0x3 - strh r0, [r4, 0x3A] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_0816D912: - ldrh r0, [r4, 0x36] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3C - bl sine - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x38] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x14 - bl sine - strh r0, [r4, 0x26] - ldrh r1, [r4, 0x36] - adds r1, 0x2 - strh r1, [r4, 0x36] - ldrh r0, [r4, 0x38] - adds r0, 0x4 - strh r0, [r4, 0x38] - movs r0, 0xFF - ands r1, r0 - cmp r1, 0x40 - bne _0816D9BA - adds r2, r4, 0 - adds r2, 0x3F - ldrb r0, [r2] - movs r1, 0x2 - negs r1, r1 - ands r1, r0 - strb r1, [r2] - ldrh r0, [r4, 0x3A] - subs r0, 0x1 - strh r0, [r4, 0x3A] - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0 - bne _0816D9BA - ldrh r0, [r4, 0x24] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - strh r1, [r4, 0x24] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - b _0816D9B8 -_0816D96E: - ldrh r0, [r4, 0x20] - subs r0, 0x2 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x38] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x14 - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x38] - adds r0, 0x4 - strh r0, [r4, 0x38] - movs r0, 0x20 - ldrsh r1, [r4, r0] - movs r0, 0x10 - negs r0, r0 - cmp r1, r0 - bge _0816D9BA - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - b _0816D9BA -_0816D99C: - ldrh r0, [r4, 0x34] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl cosine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - subs r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - cmp r0, 0 - bne _0816D9BA - ldrh r0, [r4, 0x32] -_0816D9B8: - strh r0, [r4, 0x2E] -_0816D9BA: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_816D81C - - thumb_func_start sub_816D9C0 -sub_816D9C0: @ 816D9C0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x5 - bls _0816D9CE - b _0816DADA -_0816D9CE: - lsls r0, 2 - ldr r1, =_0816D9DC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0816D9DC: - .4byte _0816D9F4 - .4byte _0816DA08 - .4byte _0816DA20 - .4byte _0816DA64 - .4byte _0816DA9A - .4byte _0816DACA -_0816D9F4: - ldr r0, =0x030062a0 - ldr r1, [r0] - movs r0, 0x99 - lsls r0, 3 - cmp r1, r0 - bne _0816DADA - b _0816DABA - .pool -_0816DA08: - ldr r0, =0x030062a0 - ldr r1, [r0] - movs r0, 0xC5 - lsls r0, 3 - cmp r1, r0 - bne _0816DA70 - adds r0, r4, 0 - movs r1, 0 - b _0816DABE - .pool -_0816DA20: - ldr r0, =0x030062a0 - ldr r1, [r0] - ldr r0, =0x000006c7 - cmp r1, r0 - beq _0816DA50 - ldrh r0, [r4, 0x30] - adds r2, r0, 0 - adds r2, 0x20 - strh r2, [r4, 0x30] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0xFF - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0816DADA - ldrh r0, [r4, 0x20] - adds r0, 0x1 - b _0816DA8A - .pool -_0816DA50: - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnim - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0x50 - strh r0, [r4, 0x32] - b _0816DADA -_0816DA64: - ldrh r0, [r4, 0x32] - subs r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - cmp r0, 0 - beq _0816DA94 -_0816DA70: - ldrh r0, [r4, 0x30] - adds r2, r0, 0 - adds r2, 0x40 - strh r2, [r4, 0x30] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0xFF - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0816DADA - ldrh r0, [r4, 0x20] - subs r0, 0x1 -_0816DA8A: - strh r0, [r4, 0x20] - movs r0, 0xFF - ands r2, r0 - strh r2, [r4, 0x30] - b _0816DADA -_0816DA94: - adds r0, r4, 0 - movs r1, 0x2 - b _0816DABE -_0816DA9A: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0816DAAE - ldrh r0, [r4, 0x20] - adds r0, 0x4 - strh r0, [r4, 0x20] -_0816DAAE: - movs r0, 0x20 - ldrsh r1, [r4, r0] - movs r0, 0xA8 - lsls r0, 1 - cmp r1, r0 - ble _0816DADA -_0816DABA: - adds r0, r4, 0 - movs r1, 0x1 -_0816DABE: - bl StartObjectImageAnim - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0816DADA -_0816DACA: - ldr r0, =0x030062a0 - ldr r1, [r0] - ldr r0, =0x0000073f - cmp r1, r0 - bls _0816DADA - ldrh r0, [r4, 0x20] - subs r0, 0x2 - strh r0, [r4, 0x20] -_0816DADA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816D9C0 - - thumb_func_start sub_816DAE8 -sub_816DAE8: @ 816DAE8 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0816DB1C - cmp r0, 0x1 - bgt _0816DAFE - cmp r0, 0 - beq _0816DB04 - b _0816DBA4 -_0816DAFE: - cmp r0, 0x2 - beq _0816DB42 - b _0816DBA4 -_0816DB04: - ldr r0, =0x030062a0 - ldr r1, [r0] - movs r0, 0x88 - lsls r0, 3 - cmp r1, r0 - bne _0816DBA4 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0816DBA4 - .pool -_0816DB1C: - ldrh r0, [r4, 0x20] - subs r0, 0x2 - strh r0, [r4, 0x20] - ldr r0, =0x030062a0 - ldr r1, [r0] - movs r0, 0x92 - lsls r0, 3 - cmp r1, r0 - bne _0816DBA4 - ldrh r0, [r4, 0x22] - subs r0, 0xC - strh r0, [r4, 0x22] - movs r0, 0x80 - strh r0, [r4, 0x30] - movs r0, 0 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_0816DB42: - movs r2, 0x20 - ldrsh r0, [r4, r2] - movs r2, 0x24 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - bgt _0816DB60 - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - b _0816DBA4 - .pool -_0816DB60: - ldrh r0, [r4, 0x30] - movs r1, 0xFF - ands r1, r0 - cmp r1, 0x3F - bgt _0816DB72 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x10 - b _0816DB84 -_0816DB72: - cmp r1, 0x40 - bne _0816DB7C - ldrh r0, [r4, 0x20] - subs r0, 0x30 - strh r0, [r4, 0x20] -_0816DB7C: - ldrh r0, [r4, 0x30] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x40 -_0816DB84: - bl sine - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x32] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0xC - bl cosine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] -_0816DBA4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_816DAE8 - - thumb_func_start task_intro_10 -task_intro_10: @ 816DBAC - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - bl intro_reset_and_hide_bgs - ldr r0, =gUnknown_085E3854 - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gUnknown_085E3724 - ldr r1, =0x06004000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085E3524 - movs r2, 0x80 - lsls r2, 2 - movs r1, 0 - bl gpu_pal_apply - ldr r0, =0x03005e00 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - movs r5, 0 - strh r5, [r4, 0x8] - strh r5, [r4, 0xA] - strh r5, [r4, 0xC] - strh r5, [r4, 0xE] - movs r0, 0x78 - movs r1, 0x50 - movs r2, 0 - movs r3, 0 - bl sub_816F2A8 - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r1, =0x00004883 - movs r0, 0xC - bl SetGpuReg - ldr r1, =0x00001441 - movs r0, 0 - bl SetGpuReg - ldr r0, =task_intro_11 - str r0, [r4] - ldr r0, =0x030062a0 - str r5, [r0] - movs r0, 0xDD - lsls r0, 1 - bl m4aSongNumStart - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_10 - - thumb_func_start task_intro_11 -task_intro_11: @ 816DC64 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r3, r0, r2 - movs r1, 0x80 - lsls r1, 3 - adds r0, r1, 0 - ldrh r1, [r3, 0x8] - adds r0, r1 - strh r0, [r3, 0x8] - ldrh r4, [r3, 0xA] - movs r0, 0xA - ldrsh r1, [r3, r0] - ldr r0, =0x000006bf - cmp r1, r0 - bgt _0816DCA4 - ldrh r0, [r3, 0xC] - adds r1, r4, r0 - strh r1, [r3, 0xA] - adds r0, 0x2 - strh r0, [r3, 0xC] - b _0816DCA8 - .pool -_0816DCA4: - ldr r0, =task_intro_12 - str r0, [r3] -_0816DCA8: - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r2 - movs r0, 0xA - ldrsh r1, [r4, r0] - movs r0, 0x80 - lsls r0, 9 - bl __divsi3 - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - ldrh r3, [r4, 0x8] - movs r0, 0x78 - movs r1, 0x50 - bl sub_816F2A8 - ldr r0, =0x030062a0 - ldr r0, [r0] - cmp r0, 0x1C - bne _0816DCE6 - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe -_0816DCE6: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_11 - - thumb_func_start task_intro_12 -task_intro_12: @ 816DCFC - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x030062a0 - ldr r0, [r0] - cmp r0, 0x2B - bls _0816DD18 - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =task_intro_13 - str r0, [r1] -_0816DD18: - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_12 - - thumb_func_start task_intro_13 -task_intro_13: @ 816DD28 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0816DD94 - bl intro_reset_and_hide_bgs - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - ldr r1, =0x0300301c - movs r0, 0x8 - strb r0, [r1] - ldr r0, =gUnknown_08D88494 - movs r1, 0xC0 - lsls r1, 19 - bl LZDecompressVram - ldr r0, =gUnknown_08D88D40 - ldr r1, =0x0600c000 - bl LZDecompressVram - ldr r0, =gUnknown_08D89F7C - ldr r1, =0x06004000 - bl LZDecompressVram - ldr r0, =gUnknown_08D8A818 - ldr r1, =0x0600e000 - bl LZDecompressVram - ldr r0, =gUnknown_08524D14 - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_0852561C - bl LoadCompressedObjectPaletteUsingHeap - ldr r0, =gUnknown_08D85CD0 - ldr r1, =0x02037714 - movs r2, 0x80 - lsls r2, 1 - bl CpuSet - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_14 - str r1, [r0] -_0816DD94: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_13 - - thumb_func_start task_intro_14 -task_intro_14: @ 816DDD8 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0x40 - movs r1, 0xF0 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0xA0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - ldr r1, =0x0000b880 - movs r0, 0xC - bl SetGpuReg - ldr r1, =0x00001c05 - movs r0, 0xA - bl SetGpuReg - ldr r1, =0x00003641 - movs r0, 0 - bl SetGpuReg - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =0x03005e00 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - movs r0, 0 - strh r0, [r4, 0x8] - ldr r0, =0x0000ffa0 - strh r0, [r4, 0xA] - ldr r1, =0x0000ff51 - strh r1, [r4, 0xC] - movs r2, 0x80 - lsls r2, 1 - strh r2, [r4, 0xE] - movs r3, 0 - bl sub_816F2A8 - ldr r0, =task_intro_15 - str r0, [r4] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_14 - - thumb_func_start task_intro_15 -task_intro_15: @ 816DE7C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r2, [r4, 0x8] - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x20 - beq _0816DEB8 - adds r0, r2, 0x4 - strh r0, [r4, 0x8] - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r1, 8 - adds r0, r2, 0 - subs r0, 0x9C - subs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - b _0816DEC6 - .pool -_0816DEB8: - movs r1, 0x82 - lsls r1, 6 - movs r0, 0x44 - bl SetGpuReg - ldr r0, =task_intro_16 - str r0, [r4] -_0816DEC6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_15 - - thumb_func_start task_intro_16 -task_intro_16: @ 816DED0 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =task_intro_17 - str r0, [r1] - bx lr - .pool - thumb_func_end task_intro_16 - - thumb_func_start task_intro_17 -task_intro_17: @ 816DEEC - push {lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0 - strh r2, [r1, 0x8] - ldr r0, =task_intro_18 - str r0, [r1] - movs r0, 0x1 - str r0, [sp] - movs r0, 0x4 - str r0, [sp, 0x4] - str r2, [sp, 0x8] - movs r0, 0 - movs r1, 0xA0 - movs r2, 0x4 - movs r3, 0x4 - bl sub_80BA384 - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_17 - - thumb_func_start task_intro_18 -task_intro_18: @ 816DF2C - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r4, r0, r1 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - ldrh r0, [r4] - subs r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x6 - bhi _0816DF62 - ldrh r0, [r4, 0xA] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0816DF62 - ldrh r0, [r4, 0x8] - movs r1, 0x3 - eors r0, r1 - strh r0, [r4, 0x8] -_0816DF62: - ldrh r0, [r4, 0x2] - ldrh r1, [r4, 0x8] - ldrh r2, [r4, 0x4] - adds r1, r2 - lsls r1, 16 - lsrs r1, 16 - ldrh r2, [r4, 0x6] - movs r3, 0 - bl sub_816F2A8 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x9 - bls _0816DF80 - b _0816E176 -_0816DF80: - lsls r0, 2 - ldr r1, =_0816DF94 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0816DF94: - .4byte _0816DFBC - .4byte _0816DFE6 - .4byte _0816E024 - .4byte _0816E038 - .4byte _0816E07C - .4byte _0816E09A - .4byte _0816E0C8 - .4byte _0816E0DE - .4byte _0816E13C - .4byte _0816E156 -_0816DFBC: - ldrh r0, [r4, 0x2] - adds r0, 0x10 - strh r0, [r4, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA0 - beq _0816DFCC - b _0816E176 -_0816DFCC: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - movs r0, 0x2 - strh r0, [r4, 0xC] - movs r2, 0xF1 - lsls r2, 1 - adds r0, r2, 0 - strh r0, [r4, 0xE] - adds r0, r5, 0 - bl sub_816E190 - b _0816E176 -_0816DFE6: - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _0816DFF4 - b _0816E176 -_0816DFF4: - movs r0, 0x2 - strh r0, [r4, 0xC] - movs r1, 0xE - ldrsh r0, [r4, r1] - ldr r1, =gUnknown_08D85CD0 - adds r0, r1 - ldr r1, =0x02037b52 - movs r2, 0x1 - bl CpuSet - ldrh r0, [r4, 0xE] - adds r0, 0x2 - strh r0, [r4, 0xE] - lsls r0, 16 - movs r1, 0xF6 - lsls r1, 17 - cmp r0, r1 - beq _0816E01A - b _0816E176 -_0816E01A: - b _0816E14E - .pool -_0816E024: - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _0816E032 - b _0816E176 -_0816E032: - movs r0, 0x2 - strh r0, [r4, 0xC] - b _0816E14E -_0816E038: - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _0816E046 - b _0816E176 -_0816E046: - movs r0, 0x2 - strh r0, [r4, 0xC] - movs r2, 0xE - ldrsh r0, [r4, r2] - ldr r1, =gUnknown_08D85CD0 - adds r0, r1 - ldr r1, =0x02037b52 - movs r2, 0x1 - bl CpuSet - ldrh r0, [r4, 0xE] - subs r0, 0x2 - strh r0, [r4, 0xE] - lsls r0, 16 - movs r1, 0xF0 - lsls r1, 17 - cmp r0, r1 - beq _0816E06C - b _0816E176 -_0816E06C: - movs r0, 0x8 - strh r0, [r4, 0xC] - b _0816E14E - .pool -_0816E07C: - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _0816E176 - movs r1, 0x60 - negs r1, r1 - adds r0, r1, 0 - strh r0, [r4, 0x2] - movs r0, 0xA9 - strh r0, [r4, 0x4] - movs r0, 0x3 - strh r0, [r4, 0xC] - b _0816E14E -_0816E09A: - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0 - bne _0816E176 - movs r0, 0x50 - strh r0, [r4, 0x2] - movs r0, 0x29 - strh r0, [r4, 0x4] - movs r0, 0x10 - strh r0, [r4, 0xC] - ldr r0, =0x00000195 - str r1, [sp] - movs r1, 0 - movs r2, 0x64 - movs r3, 0xA - bl sub_80A344C - b _0816E14E - .pool -_0816E0C8: - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _0816E176 - movs r0, 0x50 - strh r0, [r4, 0x2] - movs r0, 0x28 - strh r0, [r4, 0x4] - b _0816E14E -_0816E0DE: - ldrh r0, [r4, 0x2] - adds r0, 0x4 - strh r0, [r4, 0x2] - ldrh r0, [r4, 0x4] - adds r0, 0x4 - strh r0, [r4, 0x4] - ldr r2, =0x00000666 - adds r0, r2, 0 - ldrh r1, [r4, 0xC] - adds r0, r1 - strh r0, [r4, 0xC] - movs r2, 0xC - ldrsh r0, [r4, r2] - movs r1, 0xFF - lsls r1, 8 - ands r0, r1 - lsrs r0, 8 - movs r1, 0x40 - bl sine - movs r1, 0x80 - lsls r1, 1 - adds r5, r1, 0 - adds r0, r5 - strh r0, [r4, 0x6] - movs r2, 0x2 - ldrsh r0, [r4, r2] - cmp r0, 0x78 - bne _0816E176 - movs r0, 0x2 - negs r0, r0 - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0x3 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - strh r5, [r4, 0x6] - movs r0, 0 - strh r0, [r4, 0x8] - b _0816E14E - .pool -_0816E13C: - ldrh r1, [r4, 0x6] - movs r2, 0x6 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0816E14E - adds r0, r1, 0 - subs r0, 0x8 - strh r0, [r4, 0x6] - b _0816E176 -_0816E14E: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _0816E176 -_0816E156: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0816E176 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_19 - str r1, [r0] - ldr r1, =0x02039b28 - movs r0, 0x3 - strb r0, [r1, 0x15] -_0816E176: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_18 - - thumb_func_start sub_816E190 -sub_816E190: @ 816E190 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - movs r4, 0 - ldr r6, =0x02020630 - ldr r5, =gUnknown_085E4C64 -_0816E19C: - movs r0, 0 - ldrsh r1, [r5, r0] - lsls r3, r4, 24 - lsrs r3, 24 - ldr r0, =gUnknown_08596C10 - movs r2, 0xA0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r0, r6, 0 - adds r0, 0x1C - adds r0, r2, r0 - ldr r1, =sub_816E1F8 - str r1, [r0] - adds r2, r6 - ldrb r0, [r2, 0x5] - movs r3, 0xD - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 - strb r0, [r2, 0x5] - strh r4, [r2, 0x30] - strh r7, [r2, 0x36] - ldrb r1, [r5, 0x2] - adds r0, r2, 0 - bl StartObjectImageAnim - adds r5, 0x6 - adds r4, 0x1 - cmp r4, 0x5 - ble _0816E19C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816E190 - - thumb_func_start sub_816E1F8 -sub_816E1F8: @ 816E1F8 - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x34] - adds r0, 0x1 - strh r0, [r3, 0x34] - ldrh r0, [r3, 0x34] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0816E214 - ldrh r0, [r3, 0x26] - movs r1, 0x3 - eors r0, r1 - strh r0, [r3, 0x26] -_0816E214: - movs r1, 0x2E - ldrsh r0, [r3, r1] - cmp r0, 0 - beq _0816E222 - cmp r0, 0x1 - beq _0816E278 - b _0816E29C -_0816E222: - ldr r2, =gUnknown_085E4C64 - movs r0, 0x30 - ldrsh r1, [r3, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - adds r2, 0x4 - adds r0, r2 - ldrh r2, [r0] - ldrh r1, [r3, 0x32] - adds r2, r1 - strh r2, [r3, 0x32] - movs r0, 0x32 - ldrsh r1, [r3, r0] - movs r0, 0xFF - lsls r0, 8 - ands r1, r0 - asrs r1, 8 - ldrh r0, [r3, 0x22] - subs r0, r1 - strh r0, [r3, 0x22] - movs r0, 0xFF - ands r2, r0 - strh r2, [r3, 0x32] - ldr r2, =0x03005e00 - movs r0, 0x36 - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0x7 - ble _0816E29C - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - b _0816E29C - .pool -_0816E278: - ldrh r1, [r3, 0x20] - movs r2, 0x20 - ldrsh r0, [r3, r2] - cmp r0, 0x77 - bgt _0816E286 - subs r0, r1, 0x2 - b _0816E288 -_0816E286: - adds r0, r1, 0x2 -_0816E288: - strh r0, [r3, 0x20] - ldrh r1, [r3, 0x22] - movs r2, 0x22 - ldrsh r0, [r3, r2] - cmp r0, 0x4F - bgt _0816E298 - subs r0, r1, 0x2 - b _0816E29A -_0816E298: - adds r0, r1, 0x2 -_0816E29A: - strh r0, [r3, 0x22] -_0816E29C: - pop {r0} - bx r0 - thumb_func_end sub_816E1F8 - - thumb_func_start task_intro_19 -task_intro_19: @ 816E2A0 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl ResetAllObjectData - ldr r0, =gUnknown_08D89224 - movs r1, 0xC0 - lsls r1, 19 - bl LZDecompressVram - ldr r0, =gUnknown_08D89ABC - ldr r1, =0x0600c000 - bl LZDecompressVram - ldr r0, =gUnknown_08D8A934 - ldr r1, =0x0600e000 - bl LZDecompressVram - ldr r0, =gUnknown_085E4C88 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085E4C98 - bl LoadTaggedObjectPalette - movs r0, 0x2 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =task_intro_20 - str r0, [r1] - movs r4, 0 - strh r4, [r1, 0x8] - movs r0, 0xA8 - lsls r0, 1 - strh r0, [r1, 0xA] - movs r2, 0x50 - strh r2, [r1, 0xC] - movs r2, 0x10 - strh r2, [r1, 0x14] - adds r2, 0xF0 - strh r2, [r1, 0xE] - movs r1, 0x50 - movs r3, 0 - bl sub_816F2A8 - movs r0, 0x1 - str r0, [sp] - movs r0, 0x6 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r1, 0xA0 - movs r2, 0x4 - movs r3, 0x4 - bl sub_80BA384 - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_19 - - thumb_func_start task_intro_20 -task_intro_20: @ 816E358 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - ldrh r0, [r5, 0x2] - ldrh r1, [r5, 0x4] - ldrh r2, [r5, 0x6] - movs r3, 0 - bl sub_816F2A8 - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0xD - bls _0816E380 - b _0816E6BC -_0816E380: - lsls r0, 2 - ldr r1, =_0816E394 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0816E394: - .4byte _0816E3CC - .4byte _0816E3E0 - .4byte _0816E43C - .4byte _0816E488 - .4byte _0816E4C4 - .4byte _0816E4EC - .4byte _0816E544 - .4byte _0816E560 - .4byte _0816E5A0 - .4byte _0816E5BC - .4byte _0816E5FC - .4byte _0816E61A - .4byte _0816E664 - .4byte _0816E69C -_0816E3CC: - ldrh r0, [r5, 0xC] - subs r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _0816E3DA - b _0816E6BC -_0816E3DA: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] -_0816E3E0: - ldrh r0, [r5, 0xC] - adds r0, 0x4 - strh r0, [r5, 0xC] - movs r2, 0xC - ldrsh r0, [r5, r2] - movs r1, 0x80 - lsls r1, 1 - bl sine - ldr r1, =0x03005e00 - lsls r4, r6, 2 - adds r4, r6 - lsls r4, 3 - adds r4, r1 - movs r2, 0xAC - lsls r2, 1 - adds r1, r2, 0 - subs r1, r0 - strh r1, [r4, 0xA] - movs r1, 0xC - ldrsh r0, [r5, r1] - movs r1, 0x40 - bl cosine - movs r1, 0x54 - subs r1, r0 - strh r1, [r4, 0xC] - movs r2, 0xC - ldrsh r0, [r5, r2] - cmp r0, 0x40 - beq _0816E420 - b _0816E6BC -_0816E420: - movs r0, 0x19 - strh r0, [r5, 0xC] - movs r0, 0x1 - strh r0, [r5, 0xE] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - movs r0, 0 - bl sub_816E6D4 - b _0816E6BC - .pool -_0816E43C: - ldrh r0, [r5, 0xC] - subs r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _0816E44A - b _0816E6BC -_0816E44A: - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 - ldrh r2, [r1, 0xA] - adds r0, r2 - strh r0, [r1, 0xA] - ldr r2, =0xfffffefe - adds r0, r2, 0 - ldrh r2, [r1, 0xC] - adds r0, r2 - strh r0, [r1, 0xC] - movs r0, 0x8 - strh r0, [r5, 0xC] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - movs r0, 0 - bl sub_816E6D4 - bl sub_816E74C - b _0816E6BC - .pool -_0816E488: - ldrh r0, [r5, 0xC] - subs r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _0816E496 - b _0816E6BC -_0816E496: - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r2, =0xffffff00 - adds r0, r2, 0 - ldrh r2, [r1, 0xA] - adds r0, r2 - strh r0, [r1, 0xA] - movs r2, 0x81 - lsls r2, 1 - adds r0, r2, 0 - ldrh r2, [r1, 0xC] - adds r0, r2 - strh r0, [r1, 0xC] - movs r0, 0x8 - strh r0, [r5, 0xC] - b _0816E690 - .pool -_0816E4C4: - ldrh r0, [r5, 0xC] - subs r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _0816E4D2 - b _0816E6BC -_0816E4D2: - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0xC] - subs r1, 0xFC - strh r1, [r0, 0xC] - movs r0, 0x8 - strh r0, [r5, 0xC] - b _0816E690 - .pool -_0816E4EC: - ldrh r0, [r5, 0xC] - subs r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _0816E4FA - b _0816E6BC -_0816E4FA: - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0xC] - adds r0, 0xFC - strh r0, [r1, 0xC] - ldrh r2, [r5, 0xE] - movs r0, 0xE - ldrsh r1, [r5, r0] - cmp r1, 0 - beq _0816E528 - movs r0, 0xC - strh r0, [r5, 0xC] - subs r0, r2, 0x1 - strh r0, [r5, 0xE] - movs r0, 0x2 - strh r0, [r5] - b _0816E6BC - .pool -_0816E528: - movs r0, 0x1 - strh r0, [r5, 0xC] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - movs r0, 0xCA - lsls r0, 1 - str r1, [sp] - movs r1, 0 - movs r2, 0x78 - movs r3, 0xA - bl sub_80A344C - b _0816E6BC -_0816E544: - ldrh r0, [r5, 0xC] - subs r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _0816E552 - b _0816E6BC -_0816E552: - movs r0, 0x4 - strh r0, [r5, 0xC] - movs r1, 0xF5 - lsls r1, 1 - adds r0, r1, 0 - strh r0, [r5, 0xE] - b _0816E690 -_0816E560: - ldrh r0, [r5, 0xC] - subs r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _0816E56E - b _0816E6BC -_0816E56E: - movs r0, 0x4 - strh r0, [r5, 0xC] - movs r2, 0xE - ldrsh r0, [r5, r2] - ldr r1, =gUnknown_08D85CD0 - adds r0, r1 - ldr r1, =0x02037b72 - movs r2, 0x1 - bl CpuSet - ldrh r0, [r5, 0xE] - subs r0, 0x2 - strh r0, [r5, 0xE] - lsls r0, 16 - movs r1, 0xF0 - lsls r1, 17 - cmp r0, r1 - beq _0816E594 - b _0816E6BC -_0816E594: - b _0816E690 - .pool -_0816E5A0: - ldrh r0, [r5, 0xC] - subs r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - cmp r0, 0 - beq _0816E5AE - b _0816E6BC -_0816E5AE: - movs r0, 0x4 - strh r0, [r5, 0xC] - movs r1, 0xF1 - lsls r1, 1 - adds r0, r1, 0 - strh r0, [r5, 0xE] - b _0816E690 -_0816E5BC: - ldrh r0, [r5, 0xC] - subs r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _0816E6BC - movs r0, 0x4 - strh r0, [r5, 0xC] - movs r2, 0xE - ldrsh r0, [r5, r2] - ldr r1, =gUnknown_08D85CD0 - adds r0, r1 - ldr r1, =0x02037b72 - movs r2, 0x1 - bl CpuSet - ldrh r0, [r5, 0xE] - adds r0, 0x2 - strh r0, [r5, 0xE] - lsls r0, 16 - movs r1, 0xF7 - lsls r1, 17 - cmp r0, r1 - bne _0816E6BC - movs r0, 0x10 - strh r0, [r5, 0xC] - b _0816E690 - .pool -_0816E5FC: - ldrh r0, [r5, 0xC] - subs r0, 0x1 - strh r0, [r5, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bne _0816E6BC - strh r0, [r5, 0xC] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - adds r0, r6, 0 - bl sub_816E6D4 - b _0816E6BC -_0816E61A: - ldrh r0, [r5, 0xC] - adds r0, 0x4 - strh r0, [r5, 0xC] - ldrh r0, [r5, 0x6] - subs r0, 0x8 - strh r0, [r5, 0x6] - movs r1, 0xC - ldrsh r0, [r5, r1] - movs r1, 0x3C - bl sine - ldr r2, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r2 - adds r0, 0x58 - strh r0, [r1, 0xA] - movs r2, 0xC - ldrsh r0, [r5, r2] - cmp r0, 0x40 - bne _0816E6BC - movs r0, 0x2 - negs r0, r0 - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0x3 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _0816E690 - .pool -_0816E664: - ldrh r0, [r5, 0xC] - adds r0, 0x4 - strh r0, [r5, 0xC] - ldrh r0, [r5, 0x6] - subs r0, 0x8 - strh r0, [r5, 0x6] - movs r1, 0xC - ldrsh r0, [r5, r1] - movs r1, 0x14 - bl sine - ldr r2, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r2 - adds r0, 0x80 - strh r0, [r1, 0xA] - movs r2, 0xC - ldrsh r0, [r5, r2] - cmp r0, 0x80 - bne _0816E6BC -_0816E690: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - b _0816E6BC - .pool -_0816E69C: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0816E6BC - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_21 - str r1, [r0] - ldr r1, =0x02039b28 - movs r0, 0x3 - strb r0, [r1, 0x15] -_0816E6BC: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_20 - - thumb_func_start sub_816E6D4 -sub_816E6D4: @ 816E6D4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0 - ldr r7, =gUnknown_085E4CA8 - ldr r0, =0x02020630 - mov r9, r0 - adds r4, r7, 0 - movs r6, 0 -_0816E6EE: - movs r3, 0 - ldrsh r1, [r4, r3] - adds r0, r7, 0x2 - adds r0, r6, r0 - movs r3, 0 - ldrsh r2, [r0, r3] - lsls r3, r5, 24 - lsrs r3, 24 - ldr r0, =gUnknown_085E4D14 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r9 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r3] - mov r0, r8 - strh r0, [r2, 0x38] - ldrh r0, [r4, 0x4] - strh r0, [r2, 0x3A] - movs r0, 0x40 - strh r0, [r2, 0x3C] - adds r4, 0x6 - adds r6, 0x6 - adds r5, 0x1 - cmp r5, 0x5 - ble _0816E6EE - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816E6D4 - - thumb_func_start sub_816E74C -sub_816E74C: @ 816E74C - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r5, 0 - ldr r7, =gUnknown_085E4CA8 - adds r4, r7, 0x4 - movs r6, 0x24 - ldr r0, =0x02020630 - mov r8, r0 -_0816E75E: - movs r3, 0x20 - ldrsh r1, [r4, r3] - adds r0, r7, 0x2 - adds r0, r6, r0 - movs r3, 0 - ldrsh r2, [r0, r3] - lsls r3, r5, 24 - lsrs r3, 24 - ldr r0, =gUnknown_085E4D14 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r8 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r3] - ldrh r0, [r4] - strh r0, [r2, 0x3A] - movs r0, 0x40 - strh r0, [r2, 0x3C] - adds r4, 0x6 - adds r6, 0x6 - adds r5, 0x1 - cmp r5, 0x5 - ble _0816E75E - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816E74C - - thumb_func_start sub_816E7B4 -sub_816E7B4: @ 816E7B4 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0816E7C6 - cmp r0, 0x1 - beq _0816E84C - b _0816E882 -_0816E7C6: - ldrh r1, [r4, 0x3A] - movs r2, 0x3A - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0816E80A - ldrh r0, [r4, 0x30] - adds r0, 0xB - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x4 - bl sine - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - adds r0, 0x30 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 24 - negs r0, r0 - strh r0, [r4, 0x26] - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0816E82A - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - b _0816E82A -_0816E80A: - subs r0, r1, 0x1 - strh r0, [r4, 0x3A] - lsls r0, 16 - cmp r0, 0 - bne _0816E82A - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnim - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_0816E82A: - ldr r2, =0x03005e00 - movs r0, 0x38 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0xB - ble _0816E882 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0816E882 - .pool -_0816E84C: - ldrh r1, [r4, 0x20] - movs r2, 0x20 - ldrsh r0, [r4, r2] - cmp r0, 0x77 - bgt _0816E85A - subs r0, r1, 0x3 - b _0816E85C -_0816E85A: - adds r0, r1, 0x3 -_0816E85C: - strh r0, [r4, 0x20] - ldrh r1, [r4, 0x22] - movs r2, 0x22 - ldrsh r0, [r4, r2] - cmp r0, 0x4F - bgt _0816E86C - subs r0, r1, 0x3 - b _0816E86E -_0816E86C: - adds r0, r1, 0x3 -_0816E86E: - strh r0, [r4, 0x22] - ldrh r0, [r4, 0x22] - subs r0, 0x14 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x8C - bls _0816E882 - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0816E882: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_816E7B4 - - thumb_func_start task_intro_21 -task_intro_21: @ 816E888 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0x50 - movs r1, 0x87 - bl SetGpuReg - ldr r1, =0x00001f1f - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0x1F - bl SetGpuReg - movs r1, 0xB0 - lsls r1, 7 - movs r0, 0x8 - bl SetGpuReg - ldr r1, =0x00005a04 - movs r0, 0xA - bl SetGpuReg - ldr r1, =0x00001c06 - movs r0, 0xC - bl SetGpuReg - movs r1, 0xDD - lsls r1, 6 - movs r0, 0 - bl SetGpuReg - movs r0, 0x10 - movs r1, 0x50 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - ldr r1, =0x0000ffb0 - movs r0, 0x14 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - ldr r4, =gUnknown_08D8AA54 - movs r1, 0xC0 - lsls r1, 19 - adds r0, r4, 0 - bl LZDecompressVram - ldr r1, =0x06004000 - adds r0, r4, 0 - bl LZDecompressVram - ldr r0, =gUnknown_08D8B6E8 - ldr r1, =0x0600e000 - bl LZDecompressVram - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_22 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_21 - - thumb_func_start task_intro_22 -task_intro_22: @ 816E954 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_08D8B180 - ldr r1, =0x0600c000 - bl LZDecompressVram - ldr r0, =gUnknown_08D8B440 - ldr r1, =0x0600d000 - bl LZDecompressVram - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_23 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_22 - - thumb_func_start task_intro_23 -task_intro_23: @ 816E998 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_24 - str r1, [r0] - movs r1, 0 - strh r1, [r0, 0x8] - movs r1, 0x10 - strh r1, [r0, 0x14] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_23 - - thumb_func_start task_intro_24 -task_intro_24: @ 816E9DC - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r5, r1, 3 - ldr r6, =0x03005e08 - adds r4, r5, r6 - ldrh r1, [r4, 0xC] - lsls r1, 16 - asrs r1, 24 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x10 - bl SetGpuReg - ldrh r1, [r4, 0xC] - lsls r1, 16 - asrs r1, 24 - negs r1, r1 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x14 - bl SetGpuReg - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0816EA24 - cmp r0, 0x1 - beq _0816EA58 - b _0816EAA6 - .pool -_0816EA24: - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _0816EAA6 - movs r0, 0x2 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - movs r2, 0xA0 - lsls r2, 7 - adds r0, r2, 0 - strh r0, [r4, 0xC] - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _0816EAA6 - .pool -_0816EA58: - movs r0, 0xC - ldrsh r1, [r4, r0] - movs r0, 0xA0 - lsls r0, 6 - cmp r1, r0 - bne _0816EA74 - ldr r0, =0x0000fffe - ldr r1, =0x00002949 - str r1, [sp] - movs r1, 0x3 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe -_0816EA74: - ldrh r1, [r4, 0xC] - movs r2, 0xC - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0816EA90 - adds r0, r1, 0 - subs r0, 0x80 - strh r0, [r4, 0xC] - b _0816EAA6 - .pool -_0816EA90: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0816EAA6 - adds r0, r6, 0 - subs r0, 0x8 - adds r0, r5, r0 - ldr r1, =task_intro_25 - str r1, [r0] -_0816EAA6: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_24 - - thumb_func_start task_intro_25 -task_intro_25: @ 816EAB8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_08D8C16C - ldr r1, =0x0600e000 - bl LZDecompressVram - ldr r0, =gUnknown_08D8CCC8 - ldr r1, =0x0600c000 - bl LZDecompressVram - ldr r0, =gUnknown_08D8BA74 - ldr r1, =0x06004000 - bl LZDecompressVram - ldr r0, =gUnknown_08D8C838 - movs r1, 0xC0 - lsls r1, 19 - bl LZDecompressVram - movs r1, 0xD5 - lsls r1, 6 - movs r0, 0 - bl SetGpuReg - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =task_intro_26 - str r1, [r0] - movs r2, 0 - strh r2, [r0, 0x8] - movs r1, 0x1 - strh r1, [r0, 0x14] - strh r2, [r0, 0x16] - ldr r0, =gUnknown_085E4BF4 - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_085E4C04 - bl LoadTaggedObjectPalettes - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_25 - - thumb_func_start task_intro_26 -task_intro_26: @ 816EB44 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r2, =0x03005e08 - adds r6, r1, r2 - movs r3, 0 - ldrsh r0, [r6, r3] - cmp r0, 0x1 - beq _0816EBE0 - cmp r0, 0x1 - bgt _0816EB6C - cmp r0, 0 - beq _0816EB72 - b _0816EC62 - .pool -_0816EB6C: - cmp r0, 0x2 - beq _0816EC4C - b _0816EC62 -_0816EB72: - ldrh r0, [r6, 0xC] - subs r0, 0x1 - strh r0, [r6, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _0816EC62 - ldr r4, =gUnknown_085E4C4C - adds r0, r4, 0 - movs r1, 0xC8 - movs r2, 0x30 - movs r3, 0 - bl AddObjectToFront - adds r0, r4, 0 - movs r1, 0xC8 - movs r2, 0x50 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =0x02020630 - adds r0, r5 - movs r1, 0x1 - bl StartObjectImageAnim - adds r0, r4, 0 - movs r1, 0xC8 - movs r2, 0x70 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x2 - bl StartObjectImageAnim - ldrh r0, [r6] - adds r0, 0x1 - strh r0, [r6] - movs r0, 0x48 - strh r0, [r6, 0xC] - b _0816EC62 - .pool -_0816EBE0: - ldrh r0, [r6, 0xC] - subs r0, 0x1 - strh r0, [r6, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _0816EC62 - ldr r4, =gUnknown_085E4C4C - adds r0, r4, 0 - movs r1, 0x28 - movs r2, 0x30 - movs r3, 0 - bl AddObjectToFront - adds r0, r4, 0 - movs r1, 0x28 - movs r2, 0x50 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =0x02020630 - adds r0, r5 - movs r1, 0x1 - bl StartObjectImageAnim - adds r0, r4, 0 - movs r1, 0x28 - movs r2, 0x70 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x2 - bl StartObjectImageAnim - ldrh r0, [r6] - adds r0, 0x1 - strh r0, [r6] - movs r0, 0x30 - strh r0, [r6, 0xC] - b _0816EC62 - .pool -_0816EC4C: - ldrh r0, [r6, 0xC] - subs r0, 0x1 - strh r0, [r6, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _0816EC62 - adds r0, r2, 0 - subs r0, 0x8 - adds r0, r1, r0 - ldr r1, =task_intro_27 - str r1, [r0] -_0816EC62: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_26 - - thumb_func_start sub_816EC6C -sub_816EC6C: @ 816EC6C - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0816EC88 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_0816EC88: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0816ECAC - cmp r0, 0x1 - bgt _0816EC9A - cmp r0, 0 - beq _0816ECA0 - b _0816ED12 -_0816EC9A: - cmp r0, 0x2 - beq _0816ECDC - b _0816ED12 -_0816ECA0: - movs r0, 0xE1 - lsls r0, 1 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_0816ECAC: - movs r1, 0x30 - ldrsh r0, [r4, r1] - ldr r1, =gUnknown_08D85CD0 - adds r0, r1 - ldr r1, =0x02037bce - movs r2, 0x1 - bl CpuSet - ldrh r0, [r4, 0x30] - adds r0, 0x2 - strh r0, [r4, 0x30] - lsls r0, 16 - movs r1, 0xE7 - lsls r1, 17 - cmp r0, r1 - bne _0816ED12 - movs r0, 0xE6 - lsls r0, 1 - strh r0, [r4, 0x30] - movs r0, 0x4 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_0816ECDC: - ldrh r0, [r4, 0x32] - subs r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - cmp r0, 0 - bne _0816ED12 - movs r0, 0x4 - strh r0, [r4, 0x32] - movs r1, 0x30 - ldrsh r0, [r4, r1] - ldr r1, =gUnknown_08D85CD0 - adds r0, r1 - ldr r1, =0x02037bce - movs r2, 0x1 - bl CpuSet - ldrh r0, [r4, 0x30] - subs r0, 0x2 - strh r0, [r4, 0x30] - lsls r0, 16 - movs r1, 0xE0 - lsls r1, 17 - cmp r0, r1 - bne _0816ED12 - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0816ED12: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816EC6C - - thumb_func_start task_intro_27 -task_intro_27: @ 816ED20 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_085E5048 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085E5058 - bl LoadTaggedObjectPalettes - movs r1, 0xD5 - lsls r1, 6 - movs r0, 0 - bl SetGpuReg - ldr r6, =0x03005e00 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r6 - ldr r0, =task_intro_28 - str r0, [r4] - ldr r0, =0x0000ffde - ldr r1, =0x00002949 - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - movs r0, 0 - strh r0, [r4, 0x8] - movs r0, 0xA8 - strh r0, [r4, 0xA] - ldr r1, =0x0000fff0 - strh r1, [r4, 0xC] - ldr r0, =0x0000ff78 - strh r0, [r4, 0xE] - strh r1, [r4, 0x10] - ldr r0, =sub_816EEA8 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r6 - strh r5, [r1, 0x10] - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_27 - - thumb_func_start task_intro_28 -task_intro_28: @ 816EDB4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r4, r1, 3 - ldr r5, =0x03005e08 - adds r2, r4, r5 - ldrh r0, [r2, 0xE] - movs r3, 0x1 - ands r0, r3 - cmp r0, 0 - bne _0816EDD6 - ldrh r0, [r2, 0xC] - movs r1, 0x2 - eors r0, r1 - strh r0, [r2, 0xC] -_0816EDD6: - ldrh r0, [r2, 0xE] - adds r0, 0x1 - strh r0, [r2, 0xE] - movs r6, 0 - ldrsh r1, [r2, r6] - cmp r1, 0x1 - beq _0816EE2E - cmp r1, 0x1 - bgt _0816EDF4 - cmp r1, 0 - beq _0816EDFE - b _0816EE86 - .pool -_0816EDF4: - cmp r1, 0x2 - beq _0816EE3A - cmp r1, 0x3 - beq _0816EE70 - b _0816EE86 -_0816EDFE: - ands r0, r3 - cmp r0, 0 - beq _0816EE1C - ldrh r0, [r2, 0x2] - subs r0, 0x2 - strh r0, [r2, 0x2] - ldrh r0, [r2, 0x4] - adds r0, 0x1 - strh r0, [r2, 0x4] - ldrh r0, [r2, 0x6] - adds r0, 0x2 - strh r0, [r2, 0x6] - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] -_0816EE1C: - movs r1, 0x2 - ldrsh r0, [r2, r1] - cmp r0, 0x68 - bne _0816EE86 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - strh r3, [r2, 0xA] - b _0816EE86 -_0816EE2E: - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - movs r0, 0x4 - strh r0, [r2, 0xA] - b _0816EE86 -_0816EE3A: - ldrh r0, [r2, 0x2] - adds r0, 0x4 - strh r0, [r2, 0x2] - ldrh r0, [r2, 0x4] - subs r0, 0x2 - strh r0, [r2, 0x4] - ldrh r0, [r2, 0x6] - subs r0, 0x4 - strh r0, [r2, 0x6] - ldrh r0, [r2, 0x8] - subs r0, 0x2 - strh r0, [r2, 0x8] - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0816EE86 - movs r0, 0x8C - strh r0, [r2, 0xA] - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - b _0816EE86 - .pool -_0816EE70: - ldrh r0, [r2, 0xA] - subs r0, 0x1 - strh r0, [r2, 0xA] - lsls r0, 16 - cmp r0, 0 - bne _0816EE86 - adds r0, r5, 0 - subs r0, 0x8 - adds r0, r4, r0 - ldr r1, =task_intro_29 - str r1, [r0] -_0816EE86: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_28 - - thumb_func_start task_intro_29 -task_intro_29: @ 816EE90 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - ldr r0, =sub_816CC54 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end task_intro_29 - - thumb_func_start sub_816EEA8 -sub_816EEA8: @ 816EEA8 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r5, r0, r1 - ldrh r0, [r5, 0x4] - adds r0, 0x1 - strh r0, [r5, 0x4] - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0x5 - bls _0816EECA - b _0816F0B2 -_0816EECA: - lsls r0, 2 - ldr r1, =_0816EEDC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0816EEDC: - .4byte _0816EEF4 - .4byte _0816EF34 - .4byte _0816EF80 - .4byte _0816F00A - .4byte _0816F074 - .4byte _0816F0A0 -_0816EEF4: - ldrh r1, [r5, 0x4] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0816EF16 - movs r2, 0x2 - ldrsh r0, [r5, r2] - lsls r0, 1 - ldr r1, =gUnknown_08D85E72 - adds r0, r1 - ldr r1, =0x02037bd0 - movs r2, 0x1 - bl CpuSet - ldrh r0, [r5, 0x2] - adds r0, 0x1 - strh r0, [r5, 0x2] -_0816EF16: - movs r1, 0x2 - ldrsh r0, [r5, r1] - cmp r0, 0x6 - beq _0816EF20 - b _0816F0B2 -_0816EF20: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - movs r0, 0 - strh r0, [r5, 0x2] - b _0816EF70 - .pool -_0816EF34: - ldrh r1, [r5, 0x6] - movs r2, 0x6 - ldrsh r0, [r5, r2] - cmp r0, 0 - bne _0816F004 - ldrh r1, [r5, 0x4] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0816EF60 - movs r1, 0x2 - ldrsh r0, [r5, r1] - lsls r0, 1 - ldr r1, =gUnknown_08D85E72 - adds r0, r1 - ldr r1, =0x02037bc4 - movs r2, 0x1 - bl CpuSet - ldrh r0, [r5, 0x2] - adds r0, 0x1 - strh r0, [r5, 0x2] -_0816EF60: - movs r2, 0x2 - ldrsh r0, [r5, r2] - cmp r0, 0x6 - beq _0816EF6A - b _0816F0B2 -_0816EF6A: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] -_0816EF70: - movs r0, 0xA - strh r0, [r5, 0x6] - b _0816F0B2 - .pool -_0816EF80: - ldrh r1, [r5, 0x6] - movs r2, 0x6 - ldrsh r0, [r5, r2] - cmp r0, 0 - bne _0816F004 - ldrh r1, [r5, 0x4] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0816EFAC - movs r1, 0x2 - ldrsh r0, [r5, r1] - lsls r0, 1 - ldr r1, =gUnknown_08D85E52 - adds r0, r1 - ldr r1, =0x02037bcc - movs r2, 0x1 - bl CpuSet - ldrh r0, [r5, 0x2] - adds r0, 0x1 - strh r0, [r5, 0x2] -_0816EFAC: - movs r2, 0x2 - ldrsh r0, [r5, r2] - cmp r0, 0x6 - beq _0816EFB6 - b _0816F0B2 -_0816EFB6: - ldr r0, =gUnknown_085E5030 - movs r1, 0x78 - movs r2, 0x58 - movs r3, 0xF - bl AddObjectToFront - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x67 - bl audio_play - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - adds r3, r0, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r3] - ldrh r1, [r5, 0x8] - strh r1, [r0, 0x34] - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - movs r0, 0x10 - strh r0, [r5, 0x6] - b _0816F0B2 - .pool -_0816F004: - subs r0, r1, 0x1 - strh r0, [r5, 0x6] - b _0816F0B2 -_0816F00A: - ldrh r1, [r5, 0x4] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0816F0B2 - ldrh r0, [r5, 0x6] - subs r0, 0x1 - adds r2, r0, 0 - strh r0, [r5, 0x6] - lsls r0, 16 - cmp r0, 0 - beq _0816F068 - lsls r2, 24 - lsrs r2, 24 - ldr r3, =0x00002949 - movs r0, 0x50 - movs r1, 0x10 - bl pal_fade_1 - ldr r4, =gUnknown_08D85E7C - ldr r5, =0x02037bd0 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl CpuSet - adds r1, r5, 0 - subs r1, 0xC - adds r0, r4, 0 - movs r2, 0x1 - bl CpuSet - subs r4, 0x20 - subs r5, 0x4 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x1 - bl CpuSet - b _0816F0B2 - .pool -_0816F068: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - movs r0, 0x35 - strh r0, [r5, 0x6] - b _0816F0B2 -_0816F074: - ldrh r0, [r5, 0x6] - subs r0, 0x1 - strh r0, [r5, 0x6] - lsls r0, 16 - cmp r0, 0 - bne _0816F0B2 - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - b _0816F0B2 - .pool -_0816F0A0: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0816F0B2 - adds r0, r2, 0 - bl DestroyTask -_0816F0B2: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816EEA8 - - thumb_func_start intro_reset_and_hide_bgs -@ void intro_reset_and_hide_bgs() -intro_reset_and_hide_bgs: @ 816F0C0 - push {lr} - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1C - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - pop {r0} - bx r0 - thumb_func_end intro_reset_and_hide_bgs - - thumb_func_start task_intro_3_1 -task_intro_3_1: @ 816F128 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0816F170 - cmp r0, 0x1 - ble _0816F148 - cmp r0, 0x2 - beq _0816F1BC -_0816F148: - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldr r0, =gUnknown_0853FF70 - ldrh r1, [r0, 0x3E] - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - b _0816F1AC - .pool -_0816F170: - ldrh r1, [r4, 0xA] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0816F1A0 - subs r0, r1, 0x1 - strh r0, [r4, 0xA] - movs r1, 0xA - ldrsh r0, [r4, r1] - lsrs r1, r0, 31 - adds r0, r1 - movs r1, 0xFF - lsls r1, 1 - ldr r2, =gUnknown_0853FF70 - ands r0, r1 - adds r0, r2 - ldrh r1, [r0] - movs r0, 0x52 - bl SetGpuReg - b _0816F1DA - .pool -_0816F1A0: - ldr r0, =gUnknown_0853FF70 - ldrh r1, [r0] - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x10 -_0816F1AC: - strh r0, [r4, 0xA] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0816F1DA - .pool -_0816F1BC: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - adds r0, r5, 0 - bl DestroyTask -_0816F1DA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end task_intro_3_1 - - thumb_func_start task_intro_3_2 -task_intro_3_2: @ 816F1E0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0816F228 - cmp r0, 0x1 - ble _0816F200 - cmp r0, 0x2 - beq _0816F274 -_0816F200: - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldr r0, =gUnknown_0853FF70 - ldrh r1, [r0] - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - b _0816F264 - .pool -_0816F228: - ldrh r1, [r4, 0xA] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0x3D - bgt _0816F258 - adds r0, r1, 0x1 - strh r0, [r4, 0xA] - movs r1, 0xA - ldrsh r0, [r4, r1] - lsrs r1, r0, 31 - adds r0, r1 - movs r1, 0xFF - lsls r1, 1 - ldr r2, =gUnknown_0853FF70 - ands r0, r1 - adds r0, r2 - ldrh r1, [r0] - movs r0, 0x52 - bl SetGpuReg - b _0816F2A2 - .pool -_0816F258: - ldr r0, =gUnknown_0853FF70 - ldrh r1, [r0, 0x3E] - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x10 -_0816F264: - strh r0, [r4, 0xA] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0816F2A2 - .pool -_0816F274: - ldrh r1, [r4, 0xA] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0816F284 - subs r0, r1, 0x1 - strh r0, [r4, 0xA] - b _0816F2A2 -_0816F284: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - adds r0, r5, 0 - bl DestroyTask -_0816F2A2: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end task_intro_3_2 - - thumb_func_start sub_816F2A8 -sub_816F2A8: @ 816F2A8 - push {r4,lr} - sub sp, 0x24 - lsls r2, 16 - lsrs r2, 16 - movs r4, 0x80 - lsls r4, 8 - str r4, [sp] - str r4, [sp, 0x4] - mov r4, sp - strh r0, [r4, 0x8] - mov r0, sp - strh r1, [r0, 0xA] - strh r2, [r0, 0xC] - strh r2, [r0, 0xE] - strh r3, [r0, 0x10] - add r4, sp, 0x14 - adds r1, r4, 0 - movs r2, 0x1 - bl BgAffineSet - ldrh r1, [r4] - movs r0, 0x20 - bl SetGpuReg - ldrh r1, [r4, 0x2] - movs r0, 0x22 - bl SetGpuReg - ldrh r1, [r4, 0x4] - movs r0, 0x24 - bl SetGpuReg - ldrh r1, [r4, 0x6] - movs r0, 0x26 - bl SetGpuReg - ldrh r1, [r4, 0x8] - movs r0, 0x28 - bl SetGpuReg - ldrh r1, [r4, 0xA] - movs r0, 0x2A - bl SetGpuReg - ldrh r1, [r4, 0xC] - movs r0, 0x2C - bl SetGpuReg - ldrh r1, [r4, 0xE] - movs r0, 0x2E - bl SetGpuReg - add sp, 0x24 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_816F2A8 - - thumb_func_start sub_816F318 -sub_816F318: @ 816F318 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0xBF - ble _0816F394 - ldrh r1, [r4, 0x34] - movs r2, 0x34 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0816F336 - subs r0, r1, 0x1 - strh r0, [r4, 0x34] - b _0816F39A -_0816F336: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x30] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x32] - str r1, [sp] - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - movs r0, 0x32 - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 5 - subs r0, r1 - movs r1, 0x64 - bl __divsi3 - strh r0, [r4, 0x32] - movs r2, 0x32 - ldrsh r1, [r4, r2] - adds r0, r1, 0 - subs r0, 0xC0 - cmp r0, 0 - bge _0816F378 - adds r0, 0x7F -_0816F378: - asrs r0, 7 - adds r0, 0x9 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xF - bls _0816F386 - movs r0, 0xF -_0816F386: - lsls r2, r0, 4 - ldrb r1, [r4, 0x5] - movs r0, 0xF - ands r0, r1 - orrs r0, r2 - strb r0, [r4, 0x5] - b _0816F39A -_0816F394: - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0816F39A: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_816F318 - - thumb_func_start sub_816F3A4 -sub_816F3A4: @ 816F3A4 - push {r4,lr} - adds r4, r0, 0 - ldr r2, =0x02020630 - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r3, 0x3C - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _0816F420 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r3, [r4, 0x22] - adds r0, r3 - strh r0, [r4, 0x22] - adds r0, r4, 0 - movs r1, 0x3 - bl StartObjectImageAnim - movs r0, 0x80 - lsls r0, 3 - strh r0, [r4, 0x32] - ldrh r1, [r4, 0x30] - movs r0, 0x3 - ands r0, r1 - lsls r0, 3 - strh r0, [r4, 0x34] - ldr r0, =sub_816F318 - str r0, [r4, 0x1C] - ldrb r1, [r4, 0x1] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x40 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r0, [r4, 0x3] - movs r1, 0xC0 - orrs r0, r1 - strb r0, [r4, 0x3] - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0x3 - movs r3, 0x2 - bl CalcVecFromObjectCenterToObjectUpperLeft - b _0816F44C - .pool -_0816F420: - ldrh r0, [r1, 0x24] - strh r0, [r4, 0x24] - movs r0, 0x3C - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x26] - strh r0, [r4, 0x26] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x20] - strh r0, [r4, 0x20] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x22] - strh r0, [r4, 0x22] -_0816F44C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_816F3A4 - - thumb_func_start sub_816F454 -sub_816F454: @ 816F454 - push {lr} - adds r1, r0, 0 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _0816F464 - ldr r0, =sub_816F46C - str r0, [r1, 0x1C] -_0816F464: - pop {r0} - bx r0 - .pool - thumb_func_end sub_816F454 - - thumb_func_start sub_816F46C -sub_816F46C: @ 816F46C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r7, r0, 0 - ldrh r4, [r7, 0x20] - movs r1, 0x20 - ldrsh r0, [r7, r1] - cmp r0, 0x74 - bgt _0816F4AC - ldrh r0, [r7, 0x26] - ldrh r1, [r7, 0x22] - adds r0, r1 - movs r1, 0 - strh r0, [r7, 0x22] - strh r1, [r7, 0x26] - adds r0, r4, 0x4 - strh r0, [r7, 0x20] - ldr r0, =0x0000fffc - strh r0, [r7, 0x24] - movs r0, 0x80 - strh r0, [r7, 0x36] - ldr r0, =sub_816F5B4 - str r0, [r7, 0x1C] - b _0816F59E - .pool -_0816F4AC: - ldrh r1, [r7, 0x36] - ldr r5, =gUnknown_08329F40 - lsls r0, r1, 24 - lsrs r0, 23 - adds r0, r5 - ldrh r2, [r0] - adds r0, r1, 0 - adds r0, 0x40 - lsls r0, 24 - lsrs r0, 23 - adds r0, r5 - ldrh r3, [r0] - adds r1, 0x2 - strh r1, [r7, 0x36] - lsls r2, 16 - asrs r0, r2, 16 - cmp r0, 0 - bge _0816F4D2 - adds r0, 0x1F -_0816F4D2: - asrs r0, 5 - strh r0, [r7, 0x26] - subs r0, r4, 0x1 - strh r0, [r7, 0x20] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0816F4E8 - ldrh r0, [r7, 0x22] - adds r0, 0x1 - strh r0, [r7, 0x22] -_0816F4E8: - lsls r0, r3, 16 - asrs r0, 16 - negs r0, r0 - cmp r0, 0 - bge _0816F4F4 - adds r0, 0xF -_0816F4F4: - lsls r1, r0, 12 - lsrs r1, 16 - ldrh r4, [r7, 0x32] - ldrh r3, [r7, 0x34] - adds r0, r1, 0 - subs r0, 0x10 - lsls r0, 24 - lsrs r0, 23 - adds r0, r5 - ldrh r2, [r0] - adds r1, 0x30 - lsls r1, 24 - lsrs r1, 23 - adds r1, r5 - movs r0, 0 - ldrsh r1, [r1, r0] - adds r0, r1, 0 - muls r0, r4 - cmp r0, 0 - bge _0816F51E - adds r0, 0xFF -_0816F51E: - lsls r0, 8 - lsrs r0, 16 - mov r8, r0 - lsls r0, r2, 16 - asrs r2, r0, 16 - negs r0, r2 - muls r0, r3 - cmp r0, 0 - bge _0816F532 - adds r0, 0xFF -_0816F532: - lsls r0, 8 - lsrs r0, 16 - mov r10, r0 - adds r0, r2, 0 - muls r0, r4 - cmp r0, 0 - bge _0816F542 - adds r0, 0xFF -_0816F542: - lsls r0, 8 - lsrs r5, r0, 16 - adds r0, r1, 0 - muls r0, r3 - cmp r0, 0 - bge _0816F550 - adds r0, 0xFF -_0816F550: - lsls r6, r0, 8 - lsrs r6, 16 - ldrh r0, [r7, 0x30] - lsls r0, 24 - lsrs r0, 24 - str r3, [sp] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - ldrh r0, [r7, 0x30] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r5 - mov r1, r10 - lsls r5, r1, 16 - lsrs r3, r5, 16 - lsls r4, r6, 16 - str r6, [sp] - mov r1, r8 - mov r2, r9 - bl SetSpriteTransformationMatrix - ldrh r0, [r7, 0x30] - adds r0, 0x2 - lsls r0, 24 - lsrs r0, 24 - lsls r5, 1 - lsrs r5, 16 - lsls r4, 1 - lsrs r4, 16 - str r4, [sp] - mov r1, r8 - mov r2, r9 - adds r3, r5, 0 - bl SetSpriteTransformationMatrix -_0816F59E: - 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_816F46C - - thumb_func_start sub_816F5B4 -sub_816F5B4: @ 816F5B4 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x3A] - adds r1, 0x40 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - ldrh r0, [r4, 0x30] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x3A] - adds r1, 0x40 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - ldrh r0, [r4, 0x30] - adds r0, 0x2 - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x3A] - adds r1, 0x40 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - ldrh r1, [r4, 0x36] - movs r2, 0x36 - ldrsh r0, [r4, r2] - cmp r0, 0x40 - beq _0816F64C - adds r0, r1, 0 - subs r0, 0x8 - strh r0, [r4, 0x36] - ldrh r0, [r4, 0x36] - adds r1, r0, 0 - ldr r2, =gUnknown_08329F40 - adds r0, 0x40 - lsls r0, 24 - lsrs r0, 23 - adds r0, r2 - movs r3, 0 - ldrsh r0, [r0, r3] - cmp r0, 0 - bge _0816F62E - adds r0, 0x3F -_0816F62E: - asrs r0, 6 - strh r0, [r4, 0x24] - lsls r0, r1, 24 - lsrs r0, 23 - adds r0, r2 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bge _0816F642 - adds r0, 0x3F -_0816F642: - asrs r0, 6 - strh r0, [r4, 0x26] - b _0816F654 - .pool -_0816F64C: - movs r0, 0 - strh r0, [r4, 0x36] - ldr r0, =sub_816F660 - str r0, [r4, 0x1C] -_0816F654: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816F5B4 - - thumb_func_start sub_816F660 -sub_816F660: @ 816F660 - push {r4,lr} - adds r1, r0, 0 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0x2 - beq _0816F6C0 - ldrh r0, [r1, 0x36] - adds r0, 0x8 - strh r0, [r1, 0x36] - ldr r3, =gUnknown_08329F40 - lsls r0, 24 - lsrs r0, 23 - adds r0, r3 - movs r4, 0 - ldrsh r0, [r0, r4] - cmp r0, 0 - bge _0816F684 - adds r0, 0xF -_0816F684: - asrs r0, 4 - adds r0, 0x40 - lsls r0, 16 - lsrs r2, r0, 16 - adds r0, r2, 0 - adds r0, 0x40 - lsls r0, 24 - lsrs r0, 23 - adds r0, r3 - movs r4, 0 - ldrsh r0, [r0, r4] - cmp r0, 0 - bge _0816F6A0 - adds r0, 0x3F -_0816F6A0: - asrs r0, 6 - strh r0, [r1, 0x24] - lsls r0, r2, 24 - lsrs r0, 23 - adds r0, r3 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0 - bge _0816F6B4 - adds r0, 0x3F -_0816F6B4: - asrs r0, 6 - strh r0, [r1, 0x26] - b _0816F6C4 - .pool -_0816F6C0: - ldr r0, =sub_816F6D0 - str r0, [r1, 0x1C] -_0816F6C4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816F660 - - thumb_func_start sub_816F6D0 -sub_816F6D0: @ 816F6D0 - push {r4,lr} - adds r4, r0, 0 - ldrh r2, [r4, 0x22] - movs r0, 0x22 - ldrsh r1, [r4, r0] - movs r3, 0x38 - ldrsh r0, [r4, r3] - cmp r1, r0 - bge _0816F6E8 - adds r0, r2, 0x4 - strh r0, [r4, 0x22] - b _0816F744 -_0816F6E8: - movs r0, 0x1 - strh r0, [r4, 0x3C] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r3, [r4, 0x22] - adds r0, r3 - strh r0, [r4, 0x22] - adds r0, r4, 0 - movs r1, 0x3 - bl StartObjectImageAnim - movs r0, 0x80 - lsls r0, 3 - strh r0, [r4, 0x32] - ldrh r1, [r4, 0x30] - movs r0, 0x3 - ands r0, r1 - lsls r0, 3 - strh r0, [r4, 0x34] - ldr r0, =sub_816F318 - str r0, [r4, 0x1C] - ldrb r1, [r4, 0x1] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x40 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r0, [r4, 0x3] - movs r1, 0xC0 - orrs r0, r1 - strb r0, [r4, 0x3] - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0x3 - movs r3, 0x2 - bl CalcVecFromObjectCenterToObjectUpperLeft -_0816F744: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816F6D0 - - thumb_func_start sub_816F750 -sub_816F750: @ 816F750 - push {r4,lr} - adds r4, r0, 0 - ldrh r2, [r4, 0x22] - movs r0, 0x22 - ldrsh r1, [r4, r0] - movs r3, 0x38 - ldrsh r0, [r4, r3] - cmp r1, r0 - bge _0816F768 - adds r0, r2, 0x4 - strh r0, [r4, 0x22] - b _0816F7C4 -_0816F768: - movs r0, 0x1 - strh r0, [r4, 0x3C] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r3, [r4, 0x22] - adds r0, r3 - strh r0, [r4, 0x22] - adds r0, r4, 0 - movs r1, 0x3 - bl StartObjectImageAnim - movs r0, 0x80 - lsls r0, 3 - strh r0, [r4, 0x32] - ldrh r1, [r4, 0x30] - movs r0, 0x3 - ands r0, r1 - lsls r0, 3 - strh r0, [r4, 0x34] - ldr r0, =sub_816F318 - str r0, [r4, 0x1C] - ldrb r1, [r4, 0x1] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x40 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r0, [r4, 0x3] - movs r1, 0xC0 - orrs r0, r1 - strb r0, [r4, 0x3] - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0x3 - movs r3, 0x2 - bl CalcVecFromObjectCenterToObjectUpperLeft -_0816F7C4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816F750 - - thumb_func_start sub_816F7D0 -sub_816F7D0: @ 816F7D0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - adds r4, r0, 0 - adds r5, r1, 0 - ldr r6, [sp, 0x34] - ldr r0, [sp, 0x38] - mov r8, r0 - lsls r4, 16 - lsls r5, 16 - lsls r2, 16 - lsrs r2, 16 - str r2, [sp, 0x8] - lsls r3, 16 - lsrs r3, 16 - str r3, [sp, 0xC] - lsls r6, 16 - lsrs r6, 16 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - ldr r0, =gUnknown_085E4D64 - lsrs r2, r4, 16 - mov r10, r2 - asrs r4, 16 - lsrs r1, r5, 16 - str r1, [sp, 0x4] - asrs r5, 16 - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - ldr r2, =0x02020630 - mov r9, r2 - lsls r0, r7, 4 - adds r0, r7 - lsls r5, r0, 2 - adds r4, r5, r2 - movs r0, 0 - strh r0, [r4, 0x2E] - strh r0, [r4, 0x3C] - mov r0, sp - ldrh r0, [r0, 0xC] - strh r0, [r4, 0x30] - mov r1, sp - ldrh r1, [r1, 0x8] - strh r1, [r4, 0x32] - mov r2, sp - ldrh r2, [r2, 0x8] - strh r2, [r4, 0x34] - strh r6, [r4, 0x38] - mov r0, sp - ldrh r0, [r0, 0x8] - strh r0, [r4, 0x3A] - ldrb r0, [r4, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r4, 0x1] - movs r0, 0x1F - ldr r1, [sp, 0xC] - ands r1, r0 - lsls r1, 1 - ldrb r2, [r4, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x3] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x2 - movs r3, 0x2 - bl CalcVecFromObjectCenterToObjectUpperLeft - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectImageAnim - mov r1, r8 - cmp r1, 0 - bne _0816F898 - mov r0, r9 - adds r0, 0x1C - adds r0, r5, r0 - ldr r1, =sub_816F454 - b _0816F8A0 - .pool -_0816F898: - mov r0, r9 - adds r0, 0x1C - adds r0, r5, r0 - ldr r1, =sub_816F750 -_0816F8A0: - str r1, [r0] - str r7, [sp, 0x10] - mov r2, r10 - lsls r2, 16 - asrs r2, 16 - mov r10, r2 - ldr r0, [sp, 0x4] - lsls r0, 16 - asrs r0, 16 - mov r8, r0 - ldr r0, =gUnknown_085E4D64 - mov r1, r10 - mov r2, r8 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - ldr r5, =0x02020630 - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - adds r0, r4, r5 - mov r1, sp - ldrh r1, [r1, 0x10] - strh r1, [r0, 0x3C] - ldr r2, [sp, 0xC] - adds r2, 0x1 - mov r9, r2 - strh r2, [r0, 0x30] - ldrb r1, [r0, 0x1] - movs r2, 0x3 - orrs r1, r2 - strb r1, [r0, 0x1] - mov r2, r9 - movs r1, 0x1F - ands r2, r1 - lsls r2, 1 - ldrb r3, [r0, 0x3] - movs r6, 0x3F - negs r6, r6 - adds r1, r6, 0 - ands r1, r3 - orrs r1, r2 - strb r1, [r0, 0x3] - movs r1, 0 - movs r2, 0x2 - movs r3, 0x2 - bl CalcVecFromObjectCenterToObjectUpperLeft - ldr r2, =0x0202064c - adds r4, r2 - ldr r0, =sub_816F3A4 - str r0, [r4] - ldr r0, =gUnknown_085E4D64 - mov r1, r10 - mov r2, r8 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - adds r5, r4, r5 - mov r1, sp - ldrh r1, [r1, 0x10] - strh r1, [r5, 0x3C] - ldr r2, [sp, 0xC] - adds r2, 0x2 - mov r8, r2 - strh r2, [r5, 0x30] - adds r0, r5, 0 - movs r1, 0x1 - bl StartObjectImageAnim - ldrb r0, [r5, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r5, 0x1] - mov r0, r8 - movs r2, 0x1F - ands r0, r2 - lsls r0, 1 - ldrb r1, [r5, 0x3] - ands r6, r1 - orrs r6, r0 - strb r6, [r5, 0x3] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0x2 - movs r3, 0x2 - bl CalcVecFromObjectCenterToObjectUpperLeft - ldr r0, =0x0202064c - adds r4, r0 - ldr r1, =sub_816F3A4 - str r1, [r4] - ldr r2, [sp, 0xC] - lsls r0, r2, 24 - lsrs r0, 24 - ldr r5, [sp, 0x8] - adds r5, 0x20 - lsls r4, r5, 16 - lsrs r4, 16 - str r4, [sp] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - mov r0, r9 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - str r4, [sp] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r5, 17 - lsrs r5, 16 - str r5, [sp] - mov r0, r8 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - ldr r0, [sp, 0x10] - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_816F7D0 - - thumb_func_start sub_816F9D4 -sub_816F9D4: @ 816F9D4 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bhi _0816FA62 - lsls r0, 2 - ldr r1, =_0816F9F0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0816F9F0: - .4byte _0816FA04 - .4byte _0816FA12 - .4byte _0816FA30 - .4byte _0816FA62 - .4byte _0816FA50 -_0816FA04: - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnimIfDifferent - ldrh r0, [r4, 0x20] - subs r0, 0x1 - b _0816FA60 -_0816FA12: - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnimIfDifferent - ldr r0, =0x030062a0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0816FAAA - ldrh r0, [r4, 0x20] - adds r0, 0x1 - b _0816FA60 - .pool -_0816FA30: - ldrh r2, [r4, 0x20] - movs r1, 0x20 - ldrsh r0, [r4, r1] - cmp r0, 0x78 - ble _0816FA46 - ldr r0, =0x030062a0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _0816FA6E -_0816FA46: - adds r0, r2, 0x1 - b _0816FA60 - .pool -_0816FA50: - ldrh r2, [r4, 0x20] - movs r0, 0x20 - ldrsh r1, [r4, r0] - movs r0, 0x20 - negs r0, r0 - cmp r1, r0 - ble _0816FA62 - subs r0, r2, 0x2 -_0816FA60: - strh r0, [r4, 0x20] -_0816FA62: - ldr r0, =0x030062a0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0816FAAA -_0816FA6E: - movs r1, 0x26 - ldrsh r5, [r4, r1] - cmp r5, 0 - beq _0816FA80 - movs r0, 0 - strh r0, [r4, 0x26] - b _0816FAAA - .pool -_0816FA80: - bl GenerateRandomNumber - movs r1, 0x3 - ands r1, r0 - cmp r1, 0x1 - beq _0816FAA8 - cmp r1, 0x1 - bgt _0816FA96 - cmp r1, 0 - beq _0816FA9E - b _0816FAAA -_0816FA96: - cmp r1, 0x3 - bgt _0816FAAA - strh r5, [r4, 0x26] - b _0816FAAA -_0816FA9E: - ldr r0, =0x0000ffff - strh r0, [r4, 0x26] - b _0816FAAA - .pool -_0816FAA8: - strh r1, [r4, 0x26] -_0816FAAA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_816F9D4 - - thumb_func_start sub_816FAB0 -sub_816FAB0: @ 816FAB0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0816FACA - cmp r0, 0x1 - ble _0816FB12 - cmp r0, 0x2 - beq _0816FAEA - cmp r0, 0x3 - beq _0816FB04 - b _0816FB12 -_0816FACA: - movs r2, 0x24 - ldrsh r0, [r4, r2] - movs r2, 0x20 - ldrsh r1, [r4, r2] - adds r0, r1 - ldr r1, =0x0000012f - cmp r0, r1 - bgt _0816FAE4 - ldrh r0, [r4, 0x24] - adds r0, 0x8 - b _0816FB10 - .pool -_0816FAE4: - movs r0, 0x2 - strh r0, [r4, 0x2E] - b _0816FB12 -_0816FAEA: - movs r1, 0x24 - ldrsh r0, [r4, r1] - movs r2, 0x20 - ldrsh r1, [r4, r2] - adds r0, r1 - cmp r0, 0x78 - ble _0816FAFE - ldrh r0, [r4, 0x24] - subs r0, 0x1 - b _0816FB10 -_0816FAFE: - movs r0, 0x3 - strh r0, [r4, 0x2E] - b _0816FB12 -_0816FB04: - ldrh r1, [r4, 0x24] - movs r2, 0x24 - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _0816FB12 - subs r0, r1, 0x2 -_0816FB10: - strh r0, [r4, 0x24] -_0816FB12: - ldrh r0, [r4, 0x30] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x8 - bl sine - ldr r1, =0x0203bccc - ldrh r1, [r1] - subs r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x4 - strh r0, [r4, 0x30] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816FAB0 - - thumb_func_start sub_816FB38 -sub_816FB38: @ 816FB38 - push {r4-r6,lr} - adds r6, r0, 0 - movs r1, 0x2E - ldrsh r0, [r6, r1] - cmp r0, 0x5 - bls _0816FB46 - b _0816FD38 -_0816FB46: - lsls r0, 2 - ldr r1, =_0816FB54 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0816FB54: - .4byte _0816FB6C - .4byte _0816FB94 - .4byte _0816FBB4 - .4byte _0816FC5C - .4byte _0816FCC4 - .4byte _0816FCF4 -_0816FB6C: - ldrh r1, [r6, 0x30] - movs r2, 0x30 - ldrsh r0, [r6, r2] - cmp r0, 0 - beq _0816FB7C - subs r0, r1, 0x1 - strh r0, [r6, 0x30] - b _0816FD38 -_0816FB7C: - adds r2, r6, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x5 - negs r1, r1 - ands r1, r0 - strb r1, [r2] - adds r0, r6, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - b _0816FCE6 -_0816FB94: - ldr r0, =0x030062a0 - ldr r0, [r0] - cmp r0, 0x90 - beq _0816FB9E - b _0816FD38 -_0816FB9E: - ldrh r0, [r6, 0x2E] - adds r0, 0x1 - strh r0, [r6, 0x2E] - movs r0, 0x9 - strh r0, [r6, 0x30] - movs r0, 0x2 - strh r0, [r6, 0x34] - b _0816FD38 - .pool -_0816FBB4: - ldrh r1, [r6, 0x34] - movs r2, 0x34 - ldrsh r0, [r6, r2] - cmp r0, 0 - bne _0816FC66 - movs r0, 0x2 - strh r0, [r6, 0x34] - movs r1, 0x30 - ldrsh r0, [r6, r1] - cmp r0, 0 - beq _0816FC14 - lsls r0, 1 - ldr r4, =gUnknown_08D85C50 - adds r0, r4 - ldr r5, =0x02037d52 - adds r1, r5, 0 - movs r2, 0x1 - bl CpuSet - movs r1, 0x30 - ldrsh r0, [r6, r1] - lsls r0, 1 - adds r1, r4, 0 - adds r1, 0x20 - adds r0, r1 - adds r1, r5, 0 - subs r1, 0x16 - movs r2, 0x1 - bl CpuSet - movs r2, 0x30 - ldrsh r0, [r6, r2] - lsls r0, 1 - adds r4, 0x40 - adds r0, r4 - subs r5, 0xA - adds r1, r5, 0 - movs r2, 0x1 - bl CpuSet - ldrh r0, [r6, 0x30] - subs r0, 0x1 - strh r0, [r6, 0x30] - b _0816FD38 - .pool -_0816FC14: - movs r1, 0x30 - ldrsh r0, [r6, r1] - lsls r0, 1 - ldr r4, =gUnknown_08D85C50 - adds r0, r4 - ldr r5, =0x02037d52 - adds r1, r5, 0 - movs r2, 0x1 - bl CpuSet - movs r2, 0x30 - ldrsh r0, [r6, r2] - lsls r0, 1 - adds r1, r4, 0 - adds r1, 0x20 - adds r0, r1 - adds r1, r5, 0 - subs r1, 0x16 - movs r2, 0x1 - bl CpuSet - movs r1, 0x30 - ldrsh r0, [r6, r1] - lsls r0, 1 - adds r4, 0x40 - adds r0, r4 - subs r5, 0xA - adds r1, r5, 0 - movs r2, 0x1 - bl CpuSet - b _0816FCE6 - .pool -_0816FC5C: - ldrh r1, [r6, 0x34] - movs r2, 0x34 - ldrsh r0, [r6, r2] - cmp r0, 0 - beq _0816FC6C -_0816FC66: - subs r0, r1, 0x1 - strh r0, [r6, 0x34] - b _0816FD38 -_0816FC6C: - movs r0, 0x2 - strh r0, [r6, 0x34] - movs r1, 0x30 - ldrsh r0, [r6, r1] - cmp r0, 0x9 - bgt _0816FCE6 - lsls r0, 1 - ldr r4, =gUnknown_08D85C50 - adds r0, r4 - ldr r5, =0x02037d52 - adds r1, r5, 0 - movs r2, 0x1 - bl CpuSet - movs r1, 0x30 - ldrsh r0, [r6, r1] - lsls r0, 1 - adds r1, r4, 0 - adds r1, 0x20 - adds r0, r1 - adds r1, r5, 0 - subs r1, 0x16 - movs r2, 0x1 - bl CpuSet - movs r2, 0x30 - ldrsh r0, [r6, r2] - lsls r0, 1 - adds r4, 0x40 - adds r0, r4 - subs r5, 0xA - adds r1, r5, 0 - movs r2, 0x1 - bl CpuSet - ldrh r0, [r6, 0x30] - adds r0, 0x1 - strh r0, [r6, 0x30] - b _0816FD38 - .pool -_0816FCC4: - ldr r0, =0x030062a0 - ldr r1, [r0] - movs r0, 0x88 - lsls r0, 1 - cmp r1, r0 - bne _0816FD38 - adds r0, r6, 0 - movs r1, 0x2 - bl StartObjectRotScalAnim - ldrb r1, [r6, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r6, 0x1] -_0816FCE6: - ldrh r0, [r6, 0x2E] - adds r0, 0x1 - strh r0, [r6, 0x2E] - b _0816FD38 - .pool -_0816FCF4: - ldr r1, =gUnknown_085E4F48 - movs r2, 0x32 - ldrsh r0, [r6, r2] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - ldrh r1, [r6, 0x34] - adds r0, r1 - strh r0, [r6, 0x34] - movs r2, 0x34 - ldrsh r0, [r6, r2] - movs r1, 0xFF - lsls r1, 8 - ands r0, r1 - asrs r0, 8 - strh r0, [r6, 0x24] - movs r1, 0x32 - ldrsh r0, [r6, r1] - cmp r0, 0x3 - bgt _0816FD24 - movs r2, 0x24 - ldrsh r0, [r6, r2] - negs r0, r0 - strh r0, [r6, 0x24] -_0816FD24: - adds r0, r6, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0816FD38 - adds r0, r6, 0 - bl RemoveObjectAndFreeTiles -_0816FD38: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816FB38 - - thumb_func_start sub_816FD44 -sub_816FD44: @ 816FD44 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0816FD7C - cmp r0, 0x1 - bgt _0816FD5A - cmp r0, 0 - beq _0816FD60 - b _0816FDB0 -_0816FD5A: - cmp r0, 0x2 - beq _0816FD9C - b _0816FDB0 -_0816FD60: - ldr r0, =0x030062a0 - ldr r0, [r0] - cmp r0, 0x80 - bne _0816FDB0 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x5 - negs r1, r1 - ands r1, r0 - strb r1, [r2] - b _0816FD90 - .pool -_0816FD7C: - ldr r0, =0x030062a0 - ldr r1, [r0] - movs r0, 0x88 - lsls r0, 1 - cmp r1, r0 - bne _0816FDB0 - adds r0, r4, 0 - movs r1, 0x3 - bl StartObjectRotScalAnim -_0816FD90: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0816FDB0 - .pool -_0816FD9C: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0816FDB0 - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0816FDB0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_816FD44 - - thumb_func_start sub_816FDB8 -sub_816FDB8: @ 816FDB8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 16 - lsrs r0, 16 - str r0, [sp] - lsls r1, 16 - lsrs r1, 16 - str r1, [sp, 0x4] - movs r7, 0 -_0816FDD2: - lsls r5, r7, 2 - ldr r0, =gUnknown_085E4E94 - adds r0, 0x2 - adds r0, r5, r0 - ldr r2, [sp] - lsls r1, r2, 16 - asrs r1, 16 - ldrh r0, [r0] - adds r1, r0 - lsls r1, 16 - asrs r1, 16 - ldr r3, [sp, 0x4] - lsls r2, r3, 16 - asrs r0, r2, 16 - str r0, [sp, 0x8] - ldr r3, =0xfffc0000 - adds r2, r3 - ldr r0, =gUnknown_085E4F5C - asrs r2, 16 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - ldr r0, =0x02020630 - adds r4, r0 - movs r1, 0 - strh r1, [r4, 0x2E] - ldr r0, =gUnknown_085E4FA4 - adds r0, r7, r0 - ldrb r0, [r0] - strh r0, [r4, 0x30] - strh r7, [r4, 0x32] - adds r1, r4, 0 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - mov r10, r2 - mov r3, r10 - orrs r0, r3 - strb r0, [r1] - adds r1, r7, 0 - adds r1, 0xC - movs r0, 0x1F - mov r9, r0 - mov r2, r9 - ands r1, r2 - lsls r1, 1 - ldrb r0, [r4, 0x3] - movs r3, 0x3F - negs r3, r3 - mov r8, r3 - mov r2, r8 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x3] - ldr r3, =gUnknown_085E4E94 - adds r5, r3 - ldrb r1, [r5] - adds r0, r4, 0 - bl StartObjectImageAnim - adds r0, r4, 0 - movs r1, 0 - bl StartObjectRotScalAnim - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, 0x8 - bls _0816FDD2 - ldr r0, =gUnknown_085E4F8C - ldr r2, [sp, 0x8] - subs r2, 0x6 - lsls r2, 16 - asrs r2, 16 - movs r1, 0x78 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r2, 0 - strh r2, [r0, 0x2E] - adds r2, r0, 0 - adds r2, 0x3E - ldrb r1, [r2] - mov r3, r10 - orrs r1, r3 - strb r1, [r2] - adds r2, r7, 0 - adds r2, 0xC - mov r1, r9 - ands r2, r1 - lsls r2, 1 - ldrb r1, [r0, 0x3] - mov r3, r8 - ands r1, r3 - orrs r1, r2 - strb r1, [r0, 0x3] - movs r1, 0x1 - bl StartObjectRotScalAnim - adds r0, r6, 0 - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_816FDB8 - - thumb_func_start sub_816FEDC -sub_816FEDC: @ 816FEDC - push {r4-r6,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0816FF48 - ldr r2, =gUnknown_08329F40 - ldrh r1, [r4, 0x32] - lsls r0, r1, 24 - lsrs r0, 23 - adds r0, r2 - ldrh r3, [r0] - adds r1, 0x40 - lsls r1, 24 - lsrs r1, 23 - adds r1, r2 - movs r2, 0 - ldrsh r0, [r1, r2] - movs r1, 0x30 - ldrsh r2, [r4, r1] - adds r1, r0, 0 - muls r1, r2 - adds r0, r1, 0 - cmp r1, 0 - bge _0816FF18 - adds r0, 0xFF -_0816FF18: - lsls r0, 8 - lsrs r6, r0, 16 - lsls r0, r3, 16 - asrs r3, r0, 16 - negs r0, r3 - muls r0, r2 - cmp r0, 0 - bge _0816FF2A - adds r0, 0xFF -_0816FF2A: - lsls r0, 8 - lsrs r5, r0, 16 - adds r0, r3, 0 - muls r0, r2 - cmp r0, 0 - bge _0816FF38 - adds r0, 0xFF -_0816FF38: - lsls r0, 8 - lsrs r2, r0, 16 - adds r1, r6, 0 - adds r3, r5, 0 - str r1, [sp] - movs r0, 0x1 - bl SetSpriteTransformationMatrix -_0816FF48: - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0x1 - beq _0816FF9C - cmp r0, 0x1 - ble _0816FF58 - cmp r0, 0x2 - beq _0816FFFE -_0816FF58: - ldrb r0, [r4, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r1, [r4, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4, 0x3] - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0x3 - movs r3, 0x3 - bl CalcVecFromObjectCenterToObjectUpperLeft - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - movs r1, 0 - movs r0, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0x80 - strh r0, [r4, 0x30] - strh r1, [r4, 0x32] - strh r1, [r4, 0x34] - b _08170038 - .pool -_0816FF9C: - ldrh r0, [r4, 0x34] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x8C - bl sine - negs r0, r0 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x34] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x78 - bl sine - negs r0, r0 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x7 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x34] - adds r0, 0x3 - strh r0, [r4, 0x34] - movs r1, 0x20 - ldrsh r0, [r4, r1] - movs r2, 0x24 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bgt _08170038 - ldrb r0, [r4, 0x5] - movs r1, 0xC - orrs r0, r1 - strb r0, [r4, 0x5] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0x14 - strh r0, [r4, 0x20] - movs r0, 0x28 - strh r0, [r4, 0x22] - movs r0, 0x80 - lsls r0, 2 - strh r0, [r4, 0x30] - movs r0, 0 - strh r0, [r4, 0x32] - movs r0, 0x10 - b _08170036 -_0816FFFE: - ldrh r0, [r4, 0x34] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x22 - bl sine - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x34] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3C - bl cosine - negs r0, r0 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x2 - strh r0, [r4, 0x30] - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r1, 0x5 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _08170038 - ldrh r0, [r4, 0x34] - adds r0, 0x1 -_08170036: - strh r0, [r4, 0x34] -_08170038: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_816FEDC - - thumb_func_start sub_8170040 -sub_8170040: @ 8170040 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08170056 - adds r4, r5, 0 - adds r4, 0x3E - cmp r0, 0x1 - beq _0817008E -_08170056: - adds r4, r5, 0 - adds r4, 0x3E - ldrb r1, [r4] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r4] - ldrb r0, [r5, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r5, 0x1] - ldrb r1, [r5, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - movs r1, 0x24 - orrs r0, r1 - strb r0, [r5, 0x3] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0x3 - movs r3, 0x3 - bl CalcVecFromObjectCenterToObjectUpperLeft - movs r0, 0 - strh r0, [r5, 0x30] - movs r0, 0x1 - strh r0, [r5, 0x2E] -_0817008E: - ldrh r0, [r5, 0x3C] - adds r0, 0x1 - strh r0, [r5, 0x3C] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081700A6 - ldrb r0, [r4] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4] - b _081700BE -_081700A6: - ldrb r0, [r4] - movs r1, 0x5 - negs r1, r1 - ands r1, r0 - strb r1, [r4] - ldrh r1, [r5, 0x30] - movs r2, 0x30 - ldrsh r0, [r5, r2] - cmp r0, 0x3F - bgt _081700BE - adds r0, r1, 0x1 - strh r0, [r5, 0x30] -_081700BE: - ldr r1, =gUnknown_08329F40 - ldrh r0, [r5, 0x30] - lsls r0, 24 - lsrs r0, 23 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - subs r1, r0 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - movs r0, 0x12 - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170040 - - thumb_func_start sub_81700F8 -sub_81700F8: @ 81700F8 - push {r4,r5,lr} - ldr r5, =0x04000208 - ldrh r4, [r5] - movs r0, 0 - strh r0, [r5] - movs r0, 0x1 - bl RegisterRamReset - movs r0, 0 - movs r1, 0x80 - bl ClearGpuRegBits - strh r4, [r5] - ldr r1, =0x030022c0 - ldr r0, =0x00000439 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - bl sub_815355C - lsls r0, 16 - lsrs r0, 16 - bl InitSaveBlockPointersWithRandomOffset - bl sub_808447C - bl sub_8152680 - movs r0, 0 - bl sub_81534D0 - ldr r0, =0x03006210 - ldrh r0, [r0] - cmp r0, 0 - beq _08170148 - cmp r0, 0x2 - bne _0817014C -_08170148: - bl init_sav2 -_0817014C: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x15] - lsls r0, 31 - lsrs r0, 31 - bl sub_82E1810 - ldr r0, =0x02000000 - movs r1, 0xE0 - lsls r1, 9 - bl InitHeap - ldr r0, =sub_8086230 - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81700F8 - - thumb_func_start sub_817018C -sub_817018C: @ 817018C - push {r4,r5,lr} - adds r5, r0, 0 - movs r0, 0 - bl SetVBlankCallback - ldr r4, =0x0203bcd0 - movs r0, 0x89 - lsls r0, 4 - bl Alloc - str r0, [r4] - ldr r1, =0x0000088c - adds r2, r0, r1 - movs r1, 0 - strh r1, [r2] - str r5, [r0] - ldr r0, =sub_81701C4 - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817018C - - thumb_func_start sub_81701C4 -sub_81701C4: @ 81701C4 - push {lr} - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0x1C - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085E5068 - movs r0, 0x1 - movs r2, 0x2 - bl InitBgsFromTemplates - ldr r0, =gUnknown_085E5070 - bl InitWindows - bl DeactivateAllTextPrinters - movs r0, 0 - movs r1, 0x27 - movs r2, 0xD0 - bl sub_809882C - bl clear_scheduled_bg_copies_to_vram - ldr r0, =sub_8170274 - bl SetMainCallback2 - ldr r0, =sub_8170260 - bl SetVBlankCallback - pop {r0} - bx r0 - .pool - thumb_func_end sub_81701C4 - - thumb_func_start sub_8170260 -sub_8170260: @ 8170260 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_8170260 - - thumb_func_start sub_8170274 -sub_8170274: @ 8170274 - push {lr} - bl sub_8170290 - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - bl do_scheduled_bg_tilemap_copies_to_vram - pop {r0} - bx r0 - thumb_func_end sub_8170274 - - thumb_func_start sub_8170290 -sub_8170290: @ 8170290 - push {r4,r5,lr} - sub sp, 0xC - ldr r1, =0x0203bcd0 - ldr r0, [r1] - ldr r2, =0x0000088c - adds r0, r2 - ldrh r0, [r0] - adds r4, r1, 0 - cmp r0, 0x6 - bls _081702A6 - b _08170416 -_081702A6: - lsls r0, 2 - ldr r1, =_081702BC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081702BC: - .4byte _081702D8 - .4byte _08170300 - .4byte _08170358 - .4byte _08170380 - .4byte _08170394 - .4byte _081703C0 - .4byte _081703E8 -_081702D8: - ldr r0, [r4] - adds r0, 0x8 - movs r1, 0 - bl sub_8122CDC - movs r0, 0 - movs r1, 0 - bl sub_8124288 - movs r0, 0x1 - movs r1, 0x1 - bl sub_81240D4 - ldr r1, [r4] - ldr r0, =0x0000088c - adds r1, r0 - b _081703D8 - .pool -_08170300: - movs r0, 0x1 - movs r1, 0 - movs r2, 0x27 - movs r3, 0xD - bl SetWindowBorderStyle - ldr r5, =gUnknown_085EE8F1 - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x38 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x1 - str r0, [sp] - movs r4, 0 - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - bl Print - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0 - movs r1, 0 - movs r2, 0x27 - movs r3, 0xD - bl SetWindowBorderStyle - bl sub_8170428 - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - b _081703CC - .pool -_08170358: - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuRegBits - movs r0, 0 - bl ShowBg - movs r0, 0x2 - bl ShowBg - ldr r0, =0x0203bcd0 - ldr r1, [r0] - ldr r0, =0x0000088c - adds r1, r0 - b _081703D8 - .pool -_08170380: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08170416 - ldr r1, [r4] - b _081703D4 - .pool -_08170394: - bl sub_81230AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _081703A6 - bl sub_8170428 - b _08170416 -_081703A6: - cmp r0, 0x3 - blt _08170416 - cmp r0, 0x5 - bgt _08170416 - ldr r0, =0x0203bcd0 - ldr r1, [r0] - ldr r0, =0x0000088c - adds r1, r0 - b _081703D8 - .pool -_081703C0: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 -_081703CC: - bl pal_fade_maybe - ldr r0, =0x0203bcd0 - ldr r1, [r0] -_081703D4: - ldr r2, =0x0000088c - adds r1, r2 -_081703D8: - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _08170416 - .pool -_081703E8: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _08170416 - bl sub_812305C - ldr r4, =0x0203bcd0 - ldr r0, [r4] - ldr r0, [r0] - bl SetMainCallback2 - ldr r0, [r4] - cmp r0, 0 - beq _08170412 - bl Free - str r5, [r4] -_08170412: - bl FreeAllWindowBuffers -_08170416: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170290 - - thumb_func_start sub_8170428 -sub_8170428: @ 8170428 - push {r4,lr} - sub sp, 0xC - ldr r4, =0x0203bcd0 - ldr r0, [r4] - ldrb r0, [r0, 0xA] - cmp r0, 0 - beq _08170460 - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, [r4] - adds r2, 0xC - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - b _08170470 - .pool -_08170460: - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram -_08170470: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8170428 - - thumb_func_start sub_8170478 -sub_8170478: @ 8170478 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - ldr r0, =0x02038436 - ldrb r4, [r0] - ldr r0, =0x02022e24 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e26 - strh r1, [r0] - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - ldr r1, =0x00003f3d - movs r0, 0x4A - bl SetGpuReg - movs r1, 0x80 - lsls r1, 8 - movs r0, 0 - bl SetGpuRegBits - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x1 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl lcd_bg_operations - ldr r0, =0x03005d70 - adds r4, r0 - ldrb r0, [r4] - ldr r1, =0x02020630 - mov r9, r1 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - add r4, r9 - ldrb r7, [r4, 0x6] - ldrh r6, [r4, 0x38] - lsls r6, 24 - lsrs r6, 24 - ldr r0, =DummyObjectCallback - bl object_new_hidden_with_callback - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x14] - ldr r0, =DummyObjectCallback - bl object_new_hidden_with_callback - mov r10, r0 - mov r2, r10 - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - ldrb r1, [r4, 0x5] - movs r3, 0xD - negs r3, r3 - adds r0, r3, 0 - ands r0, r1 - movs r1, 0x4 - mov r8, r1 - mov r2, r8 - orrs r0, r2 - strb r0, [r4, 0x5] - lsls r5, r7, 4 - adds r5, r7 - lsls r5, 2 - add r5, r9 - ldrb r1, [r5, 0x5] - adds r0, r3, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0x5] - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - add r1, r9 - ldrb r2, [r1, 0x5] - adds r0, r3, 0 - ands r0, r2 - mov r2, r8 - orrs r0, r2 - strb r0, [r1, 0x5] - ldr r0, [sp, 0x14] - lsls r6, r0, 4 - adds r6, r0 - lsls r6, 2 - mov r1, r9 - adds r7, r6, r1 - adds r0, r7, 0 - adds r1, r4, 0 - movs r2, 0x44 - str r3, [sp, 0x18] - bl memcpy - mov r2, r10 - lsls r4, r2, 4 - add r4, r10 - lsls r4, 2 - adds r0, r4, 0 - add r0, r9 - mov r8, r0 - adds r1, r5, 0 - movs r2, 0x44 - bl memcpy - ldrb r1, [r7, 0x1] - ldr r3, [sp, 0x18] - adds r0, r3, 0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r7, 0x1] - mov r2, r8 - ldrb r0, [r2, 0x1] - ands r3, r0 - orrs r3, r1 - strb r3, [r2, 0x1] - movs r0, 0x1C - add r9, r0 - add r6, r9 - ldr r1, =DummyObjectCallback - str r1, [r6] - add r4, r9 - str r1, [r4] - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08C2EA9C - bl sub_80A6D48 - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08C2EA50 - mov r2, sp - ldrh r2, [r2, 0xA] - bl sub_80A6CC0 - ldr r0, =gUnknown_08C2DDA4 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - movs r2, 0x20 - bl decompress_palette - ldr r1, =0x02022e18 - ldrh r0, [r7, 0x20] - negs r0, r0 - adds r0, 0x20 - strh r0, [r1] - ldr r1, =0x02022e1a - ldrh r0, [r7, 0x22] - negs r0, r0 - subs r0, 0x20 - strh r0, [r1] - ldr r1, =0x03005e00 - ldr r2, [sp, 0x10] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r1, 0xA0 - lsls r1, 2 - strh r1, [r0, 0xA] - mov r1, sp - ldrh r1, [r1, 0x14] - strh r1, [r0, 0x8] - mov r2, r10 - strh r2, [r0, 0xC] - ldr r1, =sub_8170660 - str r1, [r0] - 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_8170478 - - thumb_func_start sub_8170660 -sub_8170660: @ 8170660 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02038436 - ldrb r0, [r0] - mov r8, r0 - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r5, r0, r1 - ldrh r1, [r5, 0xA] - ldrh r0, [r5, 0x22] - adds r1, r0 - movs r3, 0 - strh r1, [r5, 0x22] - ldr r2, =0x02022e1a - lsls r0, r1, 16 - lsrs r0, 24 - ldrh r4, [r2] - adds r0, r4 - strh r0, [r2] - movs r0, 0xFF - ands r1, r0 - strh r1, [r5, 0x22] - movs r1, 0x26 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _081706F0 - cmp r0, 0x1 - bgt _081706B4 - cmp r0, 0 - beq _081706BA - b _08170814 - .pool -_081706B4: - cmp r0, 0x2 - beq _08170708 - b _08170814 -_081706BA: - ldrh r0, [r5, 0x1E] - adds r1, r0, 0x1 - strh r1, [r5, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bgt _081706CA - b _08170814 -_081706CA: - strh r3, [r5, 0x1E] - ldrh r1, [r5, 0x20] - adds r1, 0x1 - strh r1, [r5, 0x20] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r2, 0x20 - ldrsh r0, [r5, r2] - cmp r0, 0x8 - beq _081706EE - b _08170814 -_081706EE: - b _08170700 -_081706F0: - ldrh r0, [r5, 0x1C] - adds r0, 0x1 - strh r0, [r5, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1E - beq _08170700 - b _08170814 -_08170700: - ldrh r0, [r5, 0x26] - adds r0, 0x1 - strh r0, [r5, 0x26] - b _08170814 -_08170708: - ldrh r0, [r5, 0x1E] - adds r1, r0, 0x1 - strh r1, [r5, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _08170814 - strh r3, [r5, 0x1E] - ldrh r1, [r5, 0x20] - subs r1, 0x1 - strh r1, [r5, 0x20] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x20 - ldrsh r4, [r5, r0] - cmp r4, 0 - bne _08170814 - movs r0, 0 - bl sub_80A477C - ldr r0, =0x02022e24 - strh r4, [r0] - ldr r0, =0x02022e26 - strh r4, [r0] - ldr r4, =0x00003f3f - movs r0, 0x48 - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x4A - adds r1, r4, 0 - bl SetGpuReg - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _0817076C - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0 - bl lcd_bg_operations -_0817076C: - movs r0, 0 - bl GetGpuReg - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 8 - adds r0, r2, 0 - eors r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r4, 0x8 - ldrsh r1, [r5, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r6, =0x02020630 - adds r0, r6 - bl RemoveObjectAndFreeTiles - movs r0, 0xC - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl RemoveObjectAndFreeTiles - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - bl lcd_bg_operations - ldr r0, =0x03005d70 - add r0, r8 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r2, [r1, 0x6] - mov r8, r2 - ldrh r4, [r1, 0x38] - lsls r4, 24 - lsrs r4, 24 - ldrb r3, [r1, 0x5] - movs r2, 0xD - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - movs r5, 0x4 - orrs r0, r5 - strb r0, [r1, 0x5] - mov r0, r8 - lsls r1, r0, 4 - add r1, r8 - lsls r1, 2 - adds r1, r6 - ldrb r3, [r1, 0x5] - adds r0, r2, 0 - ands r0, r3 - orrs r0, r5 - strb r0, [r1, 0x5] - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r6 - ldrb r1, [r0, 0x5] - ands r2, r1 - orrs r2, r5 - strb r2, [r0, 0x5] - adds r0, r7, 0 - bl move_anim_task_del -_08170814: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170660 - - thumb_func_start sub_8170834 -sub_8170834: @ 8170834 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r9, r0 - adds r7, r1, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =0x03005d70 - adds r2, r0 - ldrb r0, [r2] - lsls r5, r0, 4 - adds r5, r0 - lsls r5, 2 - ldr r0, =0x02020630 - adds r5, r0 - ldrb r1, [r5, 0x6] - mov r10, r1 - ldrh r4, [r5, 0x38] - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x0000d709 - bl AllocObjectPalette - mov r2, r9 - strb r0, [r2] - ldr r0, =0x0000d70a - bl AllocObjectPalette - strb r0, [r7] - ldrb r0, [r5, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r1, 0x80 - lsls r1, 1 - adds r3, r1, 0 - orrs r0, r3 - lsls r6, r4, 4 - adds r6, r4 - lsls r6, 2 - ldr r2, =0x02020630 - adds r6, r2 - ldrb r4, [r6, 0x5] - lsrs r4, 4 - lsls r4, 4 - orrs r4, r3 - lsls r0, 1 - ldr r1, =0x02037714 - mov r8, r1 - add r0, r8 - mov r2, r9 - ldrb r1, [r2] - lsls r1, 4 - adds r1, r3, r1 - movs r2, 0x20 - str r3, [sp] - bl gpu_pal_apply - lsls r4, 1 - add r4, r8 - ldrb r0, [r7] - lsls r0, 4 - ldr r3, [sp] - adds r3, r0 - adds r0, r4, 0 - adds r1, r3, 0 - movs r2, 0x20 - bl gpu_pal_apply - mov r0, r9 - ldrb r1, [r0] - lsls r1, 4 - ldrb r2, [r5, 0x5] - movs r3, 0xF - adds r0, r3, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - mov r2, r10 - lsls r1, r2, 4 - add r1, r10 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - mov r0, r9 - ldrb r2, [r0] - lsls r2, 4 - ldrb r4, [r1, 0x5] - adds r0, r3, 0 - ands r0, r4 - orrs r0, r2 - strb r0, [r1, 0x5] - ldrb r0, [r7] - lsls r0, 4 - ldrb r1, [r6, 0x5] - ands r3, r1 - orrs r3, r0 - strb r3, [r6, 0x5] - 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_8170834 - - thumb_func_start sub_8170920 -sub_8170920: @ 8170920 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - mov r1, sp - adds r1, 0x1 - ldr r0, =0x02038436 - ldrb r2, [r0] - mov r0, sp - bl sub_8170834 - adds r0, r4, 0 - bl move_anim_task_del - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170920 - - thumb_func_start sub_817094C -sub_817094C: @ 817094C - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005d70 - adds r0, r1 - ldrb r0, [r0] - ldr r1, =0x02020630 - mov r8, r1 - lsls r5, r0, 4 - adds r5, r0 - lsls r5, 2 - add r5, r8 - ldrb r0, [r5, 0x6] - mov r9, r0 - ldrh r6, [r5, 0x38] - lsls r6, 24 - lsrs r6, 24 - ldr r0, =0x0000d709 - bl FreeObjectPaletteByTag - ldr r0, =0x0000d70a - bl FreeObjectPaletteByTag - ldr r0, =0x0000d6ff - bl IndexOfObjectPaletteTag - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x0000d704 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsls r4, 4 - ldrb r2, [r5, 0x5] - movs r3, 0xF - adds r1, r3, 0 - ands r1, r2 - orrs r1, r4 - strb r1, [r5, 0x5] - mov r1, r9 - lsls r2, r1, 4 - add r2, r9 - lsls r2, 2 - add r2, r8 - ldrb r5, [r2, 0x5] - adds r1, r3, 0 - ands r1, r5 - orrs r1, r4 - strb r1, [r2, 0x5] - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - add r1, r8 - lsrs r0, 20 - ldrb r2, [r1, 0x5] - ands r3, r2 - orrs r3, r0 - strb r3, [r1, 0x5] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817094C - - thumb_func_start sub_81709EC -sub_81709EC: @ 81709EC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x02038436 - ldrb r0, [r0] - bl sub_817094C - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81709EC - - thumb_func_start sub_8170A0C -sub_8170A0C: @ 8170A0C - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =0x0203841e - ldrh r0, [r2] - strh r0, [r1, 0x1C] - ldrh r0, [r2, 0x2] - strh r0, [r1, 0x1E] - ldr r0, =sub_8170A38 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8170A0C - - thumb_func_start sub_8170A38 -sub_8170A38: @ 8170A38 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - movs r6, 0 - adds r1, r0, 0x1 - strh r1, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x1E - ldrsh r1, [r4, r2] - cmp r0, r1 - blt _08170AF8 - strh r6, [r4, 0x8] - ldr r0, =0x0000d709 - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r2, r0, 24 - movs r3, 0x1C - ldrsh r0, [r4, r3] - movs r1, 0x2 - cmp r0, 0 - bne _08170A76 - movs r1, 0x6 -_08170A76: - movs r3, 0xA - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _08170A8C - cmp r0, 0x1 - beq _08170AC8 - b _08170AF8 - .pool -_08170A8C: - ldrh r0, [r4, 0xC] - adds r0, 0x2 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - ble _08170A9E - movs r0, 0x10 - strh r0, [r4, 0xC] -_08170A9E: - lsls r0, r2, 4 - movs r2, 0x80 - lsls r2, 1 - adds r0, r2 - orrs r0, r1 - ldrb r2, [r4, 0xC] - ldr r3, =0x00007f74 - movs r1, 0x1 - bl pal_fade_1 - movs r3, 0xC - ldrsh r0, [r4, r3] - cmp r0, 0x10 - bne _08170AF8 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - b _08170AF8 - .pool -_08170AC8: - ldrh r0, [r4, 0xC] - subs r0, 0x2 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - bge _08170AD6 - strh r6, [r4, 0xC] -_08170AD6: - lsls r0, r2, 4 - movs r2, 0x80 - lsls r2, 1 - adds r0, r2 - orrs r0, r1 - ldrb r2, [r4, 0xC] - ldr r3, =0x00007f74 - movs r1, 0x1 - bl pal_fade_1 - movs r3, 0xC - ldrsh r0, [r4, r3] - cmp r0, 0 - bne _08170AF8 - adds r0, r5, 0 - bl move_anim_task_del -_08170AF8: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170A38 - - thumb_func_start sub_8170B04 -sub_8170B04: @ 8170B04 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x020241e4 - ldr r0, =0x02038436 - ldrb r0, [r0] - adds r0, r1 - ldrb r5, [r0] - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _08170B52 - cmp r0, 0x1 - bgt _08170B3C - cmp r0, 0 - beq _08170B42 - b _08170BA4 - .pool -_08170B3C: - cmp r0, 0x2 - beq _08170B84 - b _08170BA4 -_08170B42: - adds r0, r5, 0 - movs r1, 0 - bl sub_80A7270 - movs r0, 0x80 - lsls r0, 1 - strh r0, [r4, 0x1C] - b _08170B76 -_08170B52: - ldrh r0, [r4, 0x1C] - adds r0, 0x30 - strh r0, [r4, 0x1C] - movs r0, 0x1C - ldrsh r2, [r4, r0] - adds r0, r5, 0 - adds r1, r2, 0 - movs r3, 0 - bl obj_id_set_rotscale - adds r0, r5, 0 - bl sub_80A7E6C - movs r0, 0x1C - ldrsh r1, [r4, r0] - ldr r0, =0x000002cf - cmp r1, r0 - ble _08170BA4 -_08170B76: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _08170BA4 - .pool -_08170B84: - adds r0, r5, 0 - bl sub_80A7344 - ldr r1, =0x02020630 - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - adds r0, r6, 0 - bl move_anim_task_del -_08170BA4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170B04 - - thumb_func_start sub_8170BB0 -sub_8170BB0: @ 8170BB0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x020241e4 - ldr r4, =0x02038436 - ldrb r0, [r4] - adds r1, r0, r1 - ldrb r1, [r1] - mov r9, r1 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08170BF8 - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - b _08170C08 - .pool -_08170BF8: - ldr r1, =0x0202406e - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 -_08170C08: - adds r0, r1 - movs r1, 0x26 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - bl ball_number_to_ball_processing_index - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r2, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r6, r0, r2 - movs r0, 0x8 - ldrsh r7, [r6, r0] - cmp r7, 0 - beq _08170C44 - cmp r7, 0x1 - beq _08170CC4 - b _08170CEE - .pool -_08170C44: - ldr r5, =0x02038436 - ldrb r0, [r5] - movs r1, 0 - bl sub_80A5C6C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r5] - movs r1, 0x1 - bl sub_80A5C6C - adds r1, r0, 0 - lsls r1, 24 - ldr r2, =0x02020630 - mov r3, r9 - lsls r0, r3, 4 - add r0, r9 - lsls r0, 2 - adds r0, r2 - ldrb r2, [r0, 0x5] - lsls r2, 28 - lsrs r2, 30 - adds r0, 0x43 - ldrb r3, [r0] - movs r0, 0x80 - lsls r0, 22 - adds r1, r0 - lsrs r1, 24 - mov r0, r8 - str r0, [sp] - adds r0, r4, 0 - bl sub_8171D98 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x1C] - str r7, [sp] - str r7, [sp, 0x4] - str r7, [sp, 0x8] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_80A75AC - adds r2, r0, 0 - ldrb r1, [r5] - movs r0, 0 - mov r3, r8 - bl sub_81729E8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x1E] - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - b _08170CEE - .pool -_08170CC4: - movs r1, 0x1C - ldrsh r0, [r6, r1] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrb r0, [r1, 0x4] - cmp r0, 0 - bne _08170CEE - movs r3, 0x1E - ldrsh r0, [r6, r3] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrb r0, [r1, 0x4] - cmp r0, 0 - bne _08170CEE - adds r0, r5, 0 - bl move_anim_task_del -_08170CEE: - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8170BB0 - - thumb_func_start sub_8170CFC -sub_8170CFC: @ 8170CFC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x02024208 - ldrh r0, [r0] - bl ball_number_to_ball_processing_index - lsls r0, 24 - lsrs r0, 24 - bl sub_8076A78 - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170CFC - - thumb_func_start sub_8170D24 -sub_8170D24: @ 8170D24 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x02024208 - ldrh r0, [r0] - bl ball_number_to_ball_processing_index - lsls r0, 24 - lsrs r0, 24 - bl sub_8076AE8 - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170D24 - - thumb_func_start sub_8170D4C -sub_8170D4C: @ 8170D4C - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x8] - cmp r0, 0x5 - bne _08170D70 - ldr r1, =0x0203841e - ldr r0, =0x0000ffff - b _08170D74 - .pool -_08170D70: - ldr r1, =0x0203841e - movs r0, 0 -_08170D74: - strh r0, [r1, 0xE] - adds r0, r2, 0 - bl move_anim_task_del - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170D4C - - thumb_func_start ball_number_to_ball_processing_index -ball_number_to_ball_processing_index: @ 8170D84 - push {lr} - lsls r0, 16 - lsrs r0, 16 - subs r0, 0x1 - cmp r0, 0xB - bhi _08170DFC - lsls r0, 2 - ldr r1, =_08170DA0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08170DA0: - .4byte _08170DD0 - .4byte _08170DD4 - .4byte _08170DD8 - .4byte _08170DFC - .4byte _08170DDC - .4byte _08170DE0 - .4byte _08170DE4 - .4byte _08170DE8 - .4byte _08170DEC - .4byte _08170DF0 - .4byte _08170DF4 - .4byte _08170DF8 -_08170DD0: - movs r0, 0x4 - b _08170DFE -_08170DD4: - movs r0, 0x3 - b _08170DFE -_08170DD8: - movs r0, 0x1 - b _08170DFE -_08170DDC: - movs r0, 0x2 - b _08170DFE -_08170DE0: - movs r0, 0x5 - b _08170DFE -_08170DE4: - movs r0, 0x6 - b _08170DFE -_08170DE8: - movs r0, 0x7 - b _08170DFE -_08170DEC: - movs r0, 0x8 - b _08170DFE -_08170DF0: - movs r0, 0x9 - b _08170DFE -_08170DF4: - movs r0, 0xA - b _08170DFE -_08170DF8: - movs r0, 0xB - b _08170DFE -_08170DFC: - movs r0, 0 -_08170DFE: - pop {r1} - bx r1 - thumb_func_end ball_number_to_ball_processing_index - - thumb_func_start sub_8170E04 -sub_8170E04: @ 8170E04 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - mov r10, r0 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r0, =0x02024208 - ldrh r0, [r0] - bl ball_number_to_ball_processing_index - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - ldr r1, =gUnknown_0832C588 - adds r0, r1 - movs r1, 0x20 - movs r2, 0x50 - movs r3, 0x1D - bl AddObjectToFront - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =0x02020630 - mov r9, r1 - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - adds r6, r4, r1 - movs r0, 0x22 - strh r0, [r6, 0x2E] - ldr r2, =0x02038437 - mov r8, r2 - ldrb r0, [r2] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x30] - mov r1, r8 - ldrb r0, [r1] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x10 - strh r0, [r6, 0x32] - mov r0, r9 - adds r0, 0x1C - adds r4, r0 - ldr r0, =sub_8171104 - str r0, [r4] - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r3, [r0, 0x8] - ldr r1, =0x020241e4 - mov r2, r8 - ldrb r0, [r2] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - adds r0, 0x3E - ldrb r1, [r0] - lsls r1, 29 - lsrs r1, 31 - lsls r1, 1 - ldrb r2, [r3, 0x9] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x9] - ldr r1, =0x03005e00 - mov r2, r10 - lsls r0, r2, 2 - add r0, r10 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0x8] - ldr r1, =sub_8170EF0 - str r1, [r0] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170E04 - - thumb_func_start sub_8170EF0 -sub_8170EF0: @ 8170EF0 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x8] - ldr r2, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x2E] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08170F1A - adds r0, r3, 0 - bl move_anim_task_del -_08170F1A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170EF0 - - thumb_func_start sub_8170F2C -sub_8170F2C: @ 8170F2C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 2 - ands r0, r1 - cmp r0, 0 - beq _08170F50 - movs r6, 0x20 - movs r5, 0xB - b _08170F54 - .pool -_08170F50: - movs r6, 0x17 - movs r5, 0x5 -_08170F54: - ldr r0, =0x02024208 - ldrh r0, [r0] - bl ball_number_to_ball_processing_index - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - bl sub_80A82E4 - adds r3, r0, 0 - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - ldr r1, =gUnknown_0832C588 - adds r0, r1 - adds r1, r6, 0 - adds r1, 0x20 - movs r2, 0x50 - orrs r5, r2 - adds r2, r5, 0 - bl AddObjectToFront - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =0x02020630 - mov r9, r0 - lsls r4, r5, 4 - adds r4, r5 - lsls r4, 2 - adds r6, r4, r0 - movs r0, 0x22 - strh r0, [r6, 0x2E] - ldr r1, =0x02038437 - mov r8, r1 - ldrb r0, [r1] - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x30] - mov r1, r8 - ldrb r0, [r1] - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x10 - strh r0, [r6, 0x32] - movs r0, 0x1C - add r9, r0 - add r4, r9 - ldr r0, =DummyObjectCallback - str r0, [r4] - movs r0, 0 - bl battle_get_side_with_given_state - ldr r1, =0x020241e4 - lsls r0, 24 - lsrs r0, 24 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - ldr r1, =sub_8039E84 - str r1, [r0] - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0x8] - ldr r1, =sub_8171030 - str r1, [r0] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8170F2C - - thumb_func_start sub_8171030 -sub_8171030: @ 8171030 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r6, =0x02020630 - movs r0, 0 - bl battle_get_side_with_given_state - ldr r1, =0x020241e4 - lsls r0, 24 - lsrs r0, 24 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x2B - ldrb r0, [r0] - cmp r0, 0x1 - bne _0817108A - movs r0, 0x3D - movs r1, 0 - bl audio_play_and_stuff - ldr r0, =0x03005e00 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r6, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_8171104 - str r1, [r0] - ldr r0, =sub_81710A8 - movs r1, 0xA - bl CreateTask - ldr r0, =sub_8170EF0 - str r0, [r4] -_0817108A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8171030 - - thumb_func_start sub_81710A8 -sub_81710A8: @ 81710A8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r6, =0x02020630 - movs r0, 0 - bl battle_get_side_with_given_state - ldr r4, =0x020241e4 - lsls r0, 24 - lsrs r0, 24 - adds r0, 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 _081710F4 - movs r0, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0 - bl StartObjectImageAnim - adds r0, r5, 0 - bl DestroyTask -_081710F4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81710A8 - - thumb_func_start sub_8171104 -sub_8171104: @ 8171104 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x30] - ldrh r2, [r4, 0x32] - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x30] - strh r1, [r4, 0x32] - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x34] - strh r2, [r4, 0x36] - ldr r0, =0x0000ffd8 - strh r0, [r4, 0x38] - adds r0, r4, 0 - bl sub_80A68D4 - ldr r0, =sub_8171134 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8171104 - - thumb_func_start sub_8171134 -sub_8171134: @ 8171134 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _081711D2 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x8] - cmp r0, 0x5 - bne _08171160 - ldr r0, =sub_8171CAC - str r0, [r4, 0x1C] - b _081711D2 - .pool -_08171160: - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnim - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - movs r1, 0 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - strh r1, [r4, 0x24] - strh r1, [r4, 0x26] - adds r1, r4, 0 - adds r1, 0x2E - movs r2, 0 - adds r0, r4, 0 - adds r0, 0x3C -_08171188: - strh r2, [r0] - subs r0, 0x2 - cmp r0, r1 - bge _08171188 - movs r0, 0 - strh r0, [r4, 0x38] - ldr r0, =sub_81711E8 - str r0, [r4, 0x1C] - ldr r0, =0x02024208 - ldrh r0, [r0] - bl ball_number_to_ball_processing_index - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0xB - bgt _081711D2 - cmp r5, 0 - blt _081711D2 - ldrh r0, [r4, 0x20] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x22] - subs r1, 0x5 - lsls r1, 24 - lsrs r1, 24 - str r5, [sp] - movs r2, 0x1 - movs r3, 0x1C - bl sub_8171D98 - ldr r0, =0x02038437 - ldrb r1, [r0] - movs r0, 0 - movs r2, 0xE - adds r3, r5, 0 - bl sub_81729E8 -_081711D2: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8171134 - - thumb_func_start sub_81711E8 -sub_81711E8: @ 81711E8 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bne _08171224 - ldr r0, =TaskDummy - movs r1, 0x32 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x38] - ldr r0, =sub_8171240 - str r0, [r4, 0x1C] - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02038437 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strh r1, [r0, 0x30] -_08171224: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81711E8 - - thumb_func_start sub_8171240 -sub_8171240: @ 8171240 - push {r4-r7,lr} - adds r7, r0, 0 - ldr r1, =0x020241e4 - ldr r0, =0x02038437 - ldrb r0, [r0] - adds r0, r1 - ldrb r4, [r0] - ldrh r0, [r7, 0x38] - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r1 - ldrh r0, [r5, 0xA] - adds r0, 0x1 - strh r0, [r5, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB - bne _08171272 - movs r0, 0x3C - bl audio_play -_08171272: - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _081712E8 - cmp r0, 0x1 - bgt _08171290 - cmp r0, 0 - beq _08171296 - b _08171354 - .pool -_08171290: - cmp r0, 0x2 - beq _0817132C - b _08171354 -_08171296: - adds r0, r4, 0 - movs r1, 0 - bl sub_80A7270 - movs r0, 0x80 - lsls r0, 1 - strh r0, [r5, 0x1C] - ldr r1, =0x030062dc - movs r0, 0x1C - str r0, [r1] - ldr r2, =0x030062e4 - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0, 0x26] - ldrh r0, [r0, 0x22] - adds r1, r0 - ldrh r0, [r7, 0x26] - ldrh r7, [r7, 0x22] - adds r0, r7 - subs r1, r0 - strh r1, [r2] - ldr r4, =0x030062e0 - ldrh r0, [r2] - lsls r0, 8 - movs r1, 0x1C - bl __udivsi3 - strh r0, [r4] - strh r0, [r5, 0xC] - b _08171346 - .pool -_081712E8: - ldrh r0, [r5, 0x1C] - adds r0, 0x20 - strh r0, [r5, 0x1C] - movs r0, 0x1C - ldrsh r2, [r5, r0] - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl obj_id_set_rotscale - ldrh r0, [r5, 0xC] - ldrh r1, [r5, 0xE] - adds r0, r1 - strh r0, [r5, 0xE] - ldr r0, =0x02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - movs r2, 0xE - ldrsh r0, [r5, r2] - negs r0, r0 - asrs r0, 8 - strh r0, [r1, 0x26] - movs r0, 0x1C - ldrsh r1, [r5, r0] - ldr r0, =0x0000047f - cmp r1, r0 - ble _0817137C - b _08171346 - .pool -_0817132C: - adds r0, r4, 0 - bl sub_80A7344 - ldr r1, =0x02020630 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_08171346: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - b _0817137C - .pool -_08171354: - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - movs r2, 0xA - ldrsh r0, [r1, r2] - cmp r0, 0xA - ble _0817137C - adds r0, r6, 0 - bl DestroyTask - adds r0, r7, 0 - movs r1, 0x2 - bl StartObjectImageAnim - movs r0, 0 - strh r0, [r7, 0x38] - ldr r0, =sub_817138C - str r0, [r7, 0x1C] -_0817137C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8171240 - - thumb_func_start sub_817138C -sub_817138C: @ 817138C - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _081713C6 - movs r1, 0 - strh r1, [r4, 0x34] - movs r0, 0x28 - strh r0, [r4, 0x36] - strh r1, [r4, 0x38] - movs r0, 0 - movs r1, 0x28 - bl cosine - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - movs r0, 0x36 - ldrsh r1, [r4, r0] - movs r0, 0 - bl cosine - negs r0, r0 - strh r0, [r4, 0x26] - ldr r0, =sub_81713D0 - str r0, [r4, 0x1C] -_081713C6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817138C - - thumb_func_start sub_81713D0 -sub_81713D0: @ 81713D0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r5, 0 - ldrh r0, [r4, 0x34] - movs r1, 0xFF - ands r1, r0 - cmp r1, 0 - beq _081713E6 - cmp r1, 0x1 - beq _0817145A - b _08171486 -_081713E6: - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl cosine - negs r0, r0 - strh r0, [r4, 0x26] - ldrh r1, [r4, 0x38] - adds r1, 0x4 - ldrh r2, [r4, 0x34] - lsls r0, r2, 16 - asrs r0, 24 - adds r1, r0 - strh r1, [r4, 0x38] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x3F - ble _08171486 - ldrh r0, [r4, 0x36] - subs r0, 0xA - strh r0, [r4, 0x36] - ldr r1, =0x00000101 - adds r0, r2, r1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 24 - cmp r0, 0x4 - bne _08171422 - movs r5, 0x1 -_08171422: - cmp r0, 0x2 - beq _08171442 - cmp r0, 0x2 - bgt _08171434 - cmp r0, 0x1 - beq _0817143A - b _08171452 - .pool -_08171434: - cmp r0, 0x3 - beq _0817144A - b _08171452 -_0817143A: - movs r0, 0x38 - bl audio_play - b _08171486 -_08171442: - movs r0, 0x39 - bl audio_play - b _08171486 -_0817144A: - movs r0, 0x3A - bl audio_play - b _08171486 -_08171452: - movs r0, 0x3B - bl audio_play - b _08171486 -_0817145A: - movs r2, 0x38 - ldrsh r0, [r4, r2] - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl cosine - negs r0, r0 - strh r0, [r4, 0x26] - ldrh r1, [r4, 0x38] - subs r1, 0x4 - ldrh r2, [r4, 0x34] - lsls r0, r2, 16 - asrs r0, 24 - subs r1, r0 - strh r1, [r4, 0x38] - lsls r1, 16 - cmp r1, 0 - bgt _08171486 - strh r5, [r4, 0x38] - ldr r0, =0xffffff00 - ands r0, r2 - strh r0, [r4, 0x34] -_08171486: - cmp r5, 0 - beq _081714CA - movs r5, 0 - strh r5, [r4, 0x34] - movs r0, 0x40 - movs r1, 0x28 - bl cosine - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - strh r5, [r4, 0x26] - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _081714C0 - strh r5, [r4, 0x38] - ldr r0, =sub_81717B4 - str r0, [r4, 0x1C] - b _081714CA - .pool -_081714C0: - ldr r0, =sub_81714D4 - str r0, [r4, 0x1C] - movs r0, 0x1 - strh r0, [r4, 0x36] - strh r5, [r4, 0x38] -_081714CA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81713D0 - - thumb_func_start sub_81714D4 -sub_81714D4: @ 81714D4 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x34] - adds r0, 0x1 - movs r5, 0 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1F - bne _08171510 - strh r5, [r4, 0x34] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - strh r5, [r0, 0xC] - ldr r0, =sub_8171520 - str r0, [r4, 0x1C] - movs r0, 0x17 - bl audio_play -_08171510: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81714D4 - - thumb_func_start sub_8171520 -sub_8171520: @ 8171520 - push {r4-r6,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x34] - movs r1, 0xFF - ands r1, r0 - cmp r1, 0x6 - bls _08171530 - b _08171768 -_08171530: - lsls r0, r1, 2 - ldr r1, =_08171540 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08171540: - .4byte _0817155C - .4byte _081715AE - .4byte _081715F4 - .4byte _08171654 - .4byte _081716A4 - .4byte _08171708 - .4byte _08171768 -_0817155C: - ldr r1, =0x020244d0 - ldr r5, [r1] - ldr r2, [r5, 0x8] - ldrh r3, [r2, 0xC] - movs r6, 0xC - ldrsh r0, [r2, r6] - adds r6, r1, 0 - cmp r0, 0xFF - ble _08171584 - ldrh r0, [r4, 0x36] - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - ldr r1, [r5, 0x8] - ldrb r0, [r1, 0xC] - strh r0, [r1, 0xC] - b _0817158A - .pool -_08171584: - adds r0, r3, 0 - adds r0, 0xB0 - strh r0, [r2, 0xC] -_0817158A: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - movs r3, 0 - strh r0, [r4, 0x38] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x38] - adds r0, 0x7 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xE - bhi _081715AC - b _081717AE -_081715AC: - b _08171644 -_081715AE: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _08171660 - movs r0, 0 - strh r0, [r4, 0x38] - ldrh r0, [r4, 0x36] - negs r0, r0 - strh r0, [r4, 0x36] - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - movs r6, 0x36 - ldrsh r0, [r4, r6] - cmp r0, 0 - bge _081715EA - adds r0, r4, 0 - movs r1, 0x2 - bl sub_80082B8 - b _081717AE -_081715EA: - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80082B8 - b _081717AE -_081715F4: - ldr r1, =0x020244d0 - ldr r5, [r1] - ldr r2, [r5, 0x8] - ldrh r3, [r2, 0xC] - movs r6, 0xC - ldrsh r0, [r2, r6] - adds r6, r1, 0 - cmp r0, 0xFF - ble _0817161C - ldrh r0, [r4, 0x36] - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - ldr r1, [r5, 0x8] - ldrb r0, [r1, 0xC] - strh r0, [r1, 0xC] - b _08171622 - .pool -_0817161C: - adds r0, r3, 0 - adds r0, 0xB0 - strh r0, [r2, 0xC] -_08171622: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - movs r3, 0 - strh r0, [r4, 0x38] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x38] - adds r0, 0xC - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x18 - bhi _08171644 - b _081717AE -_08171644: - ldr r0, [r6] - ldr r0, [r0, 0x8] - strh r3, [r0, 0xC] - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - strh r3, [r4, 0x38] - b _081717AE -_08171654: - ldrh r0, [r4, 0x38] - adds r1, r0, 0x1 - strh r1, [r4, 0x38] - lsls r0, 16 - cmp r0, 0 - bge _0817166E -_08171660: - adds r0, r4, 0 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] - b _081717AE -_0817166E: - movs r0, 0 - strh r0, [r4, 0x38] - ldrh r0, [r4, 0x36] - negs r0, r0 - strh r0, [r4, 0x36] - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - movs r6, 0x36 - ldrsh r0, [r4, r6] - cmp r0, 0 - bge _0817169C - adds r0, r4, 0 - movs r1, 0x2 - bl sub_80082B8 - b _081716A4 -_0817169C: - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80082B8 -_081716A4: - ldr r1, =0x020244d0 - ldr r5, [r1] - ldr r2, [r5, 0x8] - ldrh r3, [r2, 0xC] - movs r6, 0xC - ldrsh r0, [r2, r6] - adds r6, r1, 0 - cmp r0, 0xFF - ble _081716CC - ldrh r0, [r4, 0x36] - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - ldr r1, [r5, 0x8] - ldrb r0, [r1, 0xC] - strh r0, [r1, 0xC] - b _081716D2 - .pool -_081716CC: - adds r0, r3, 0 - adds r0, 0xB0 - strh r0, [r2, 0xC] -_081716D2: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - movs r3, 0 - strh r0, [r4, 0x38] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x38] - adds r0, 0x4 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x8 - bls _081717AE - ldr r0, [r6] - ldr r0, [r0, 0x8] - strh r3, [r0, 0xC] - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - strh r3, [r4, 0x38] - ldrh r0, [r4, 0x36] - negs r0, r0 - strh r0, [r4, 0x36] - b _081717AE -_08171708: - movs r6, 0x80 - lsls r6, 1 - adds r0, r6, 0 - ldrh r1, [r4, 0x34] - adds r0, r1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r1, r0, 24 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x8] - cmp r1, r0 - bne _08171740 - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_81717B4 - str r0, [r4, 0x1C] - b _081717AE - .pool -_08171740: - cmp r0, 0x4 - bne _08171754 - cmp r1, 0x3 - bne _08171754 - ldr r0, =sub_81717D8 - str r0, [r4, 0x1C] - b _0817175A - .pool -_08171754: - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] -_0817175A: - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - b _081717AE -_08171768: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1F - bne _081717AE - movs r0, 0 - strh r0, [r4, 0x38] - ldrh r1, [r4, 0x34] - ldr r0, =0xffffff00 - ands r0, r1 - strh r0, [r4, 0x34] - adds r0, r4, 0 - movs r1, 0x3 - bl StartObjectRotScalAnim - movs r6, 0x36 - ldrsh r0, [r4, r6] - cmp r0, 0 - bge _081717A0 - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectRotScalAnim - b _081717A8 - .pool -_081717A0: - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim -_081717A8: - movs r0, 0x17 - bl audio_play -_081717AE: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8171520 - - thumb_func_start sub_81717B4 -sub_81717B4: @ 81717B4 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x38] - adds r0, 0x1 - strh r0, [r1, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1F - bne _081717CE - movs r0, 0 - strh r0, [r1, 0x38] - ldr r0, =sub_8171AE4 - str r0, [r1, 0x1C] -_081717CE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81717B4 - - thumb_func_start sub_81717D8 -sub_81717D8: @ 81717D8 - adds r3, r0, 0 - adds r3, 0x2C - ldrb r1, [r3] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r3] - ldr r1, =sub_81717F8 - str r1, [r0, 0x1C] - movs r1, 0 - strh r1, [r0, 0x34] - strh r1, [r0, 0x36] - strh r1, [r0, 0x38] - bx lr - .pool - thumb_func_end sub_81717D8 - - thumb_func_start sub_81717F8 -sub_81717F8: @ 81717F8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r6, r0, 0 - ldr r7, =0x02038437 - ldrh r0, [r6, 0x36] - adds r0, 0x1 - movs r1, 0 - mov r8, r1 - strh r0, [r6, 0x36] - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0x28 - bne _0817183C - movs r0, 0xFE - bl audio_play - ldrb r1, [r6, 0x5] - lsrs r1, 4 - movs r0, 0x80 - lsls r0, 9 - lsls r0, r1 - movs r1, 0x6 - movs r2, 0 - bl sub_80A2A20 - adds r0, r6, 0 - bl sub_81719EC - b _081718BC - .pool -_0817183C: - cmp r1, 0x3C - bne _0817185A - ldrb r1, [r6, 0x5] - lsrs r1, 4 - movs r0, 0x80 - lsls r0, 9 - lsls r0, r1 - mov r1, r8 - str r1, [sp] - movs r1, 0x2 - movs r2, 0x6 - movs r3, 0 - bl pal_fade_maybe - b _081718BC -_0817185A: - cmp r1, 0x5F - bne _08171880 - ldr r0, =0x020244b9 - movs r1, 0 - strb r1, [r0] - movs r0, 0x1 - bl sub_8072A88 - bl m4aMPlayAllStop - ldr r0, =0x00000213 - bl audio_play - b _081718BC - .pool -_08171880: - ldr r0, =0x0000013b - cmp r1, r0 - bne _081718BC - ldr r5, =0x02020630 - ldr r4, =0x020241e4 - ldrb r0, [r7] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - ldrb r0, [r7] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - mov r0, r8 - strh r0, [r6, 0x2E] - ldr r0, =sub_81718D8 - str r0, [r6, 0x1C] -_081718BC: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81717F8 - - thumb_func_start sub_81718D8 -sub_81718D8: @ 81718D8 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _08171944 - cmp r0, 0x1 - bgt _081718F0 - cmp r0, 0 - beq _081718F6 - b _0817198A -_081718F0: - cmp r0, 0x2 - beq _08171976 - b _0817198A -_081718F6: - strh r0, [r4, 0x30] - strh r0, [r4, 0x32] - ldrb r1, [r4, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4, 0x1] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0x10 - bl SetGpuReg - ldr r0, [r4, 0x14] - ldrh r0, [r0, 0x2] - bl IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x10 - movs r1, 0x1 - lsls r1, r0 - ldr r0, =0x00007fff - str r0, [sp] - adds r0, r1, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _08171982 - .pool -_08171944: - ldrh r0, [r4, 0x30] - adds r1, r0, 0x1 - strh r1, [r4, 0x30] - lsls r0, 16 - cmp r0, 0 - ble _081719B0 - movs r0, 0 - strh r0, [r4, 0x30] - ldrh r2, [r4, 0x32] - adds r2, 0x1 - strh r2, [r4, 0x32] - lsls r1, r2, 8 - movs r0, 0x10 - subs r0, r2 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x10 - bne _081719B0 - b _08171982 -_08171976: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_08171982: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _081719B0 -_0817198A: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _081719B0 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - strh r5, [r4, 0x2E] - ldr r0, =sub_81719C0 - str r0, [r4, 0x1C] -_081719B0: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81718D8 - - thumb_func_start sub_81719C0 -sub_81719C0: @ 81719C0 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x2E] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _081719D8 - ldr r0, =0x0000ffff - strh r0, [r4, 0x2E] - b _081719E4 - .pool -_081719D8: - adds r0, r4, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_081719E4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81719C0 - - thumb_func_start sub_81719EC -sub_81719EC: @ 81719EC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r6, r0, 0 - adds r1, r6, 0 - adds r1, 0x43 - ldrb r0, [r1] - cmp r0, 0 - beq _08171A0C - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - b _08171A14 -_08171A0C: - movs r0, 0 - mov r8, r0 - movs r0, 0x1 - strb r0, [r1] -_08171A14: - movs r0, 0x4 - bl sub_8171D60 - movs r7, 0 - ldr r2, =0x02020630 - mov r9, r2 - movs r0, 0x1C - add r0, r9 - mov r10, r0 -_08171A26: - movs r2, 0x20 - ldrsh r1, [r6, r2] - movs r0, 0x22 - ldrsh r2, [r6, r0] - ldr r0, =gUnknown_085E5250 - mov r3, r8 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _08171A82 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - mov r2, r9 - adds r5, r4, r2 - movs r0, 0x18 - strh r0, [r5, 0x2E] - ldr r0, =gUnknown_085E5088 - lsls r1, r7, 2 - adds r1, r0 - movs r0, 0 - ldrsb r0, [r1, r0] - ldrh r2, [r6, 0x20] - adds r0, r2 - strh r0, [r5, 0x32] - movs r0, 0x1 - ldrsb r0, [r1, r0] - ldrh r2, [r6, 0x22] - adds r0, r2 - strh r0, [r5, 0x36] - movs r0, 0x2 - ldrsb r0, [r1, r0] - strh r0, [r5, 0x38] - adds r0, r5, 0 - bl sub_80A68D4 - add r4, r10 - ldr r0, =sub_8171AAC - str r0, [r4] - ldr r0, =gUnknown_085E51B4 - ldrb r1, [r0, 0x4] - adds r0, r5, 0 - bl StartObjectImageAnim -_08171A82: - adds r7, 0x1 - cmp r7, 0x2 - bls _08171A26 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81719EC - - thumb_func_start sub_8171AAC -sub_8171AAC: @ 8171AAC - push {r4,lr} - adds r4, r0, 0 - adds r3, r4, 0 - adds r3, 0x3E - ldrb r2, [r3] - lsrs r1, r2, 2 - movs r0, 0x1 - eors r1, r0 - ands r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - adds r0, r4, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _08171ADC - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_08171ADC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8171AAC - - thumb_func_start sub_8171AE4 -sub_8171AE4: @ 8171AE4 - push {r4-r6,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r1, 0x1 - bl StartObjectImageAnim - adds r0, r4, 0 - movs r1, 0 - bl StartObjectRotScalAnim - ldr r0, =sub_8171BAC - str r0, [r4, 0x1C] - ldr r0, =0x02024208 - ldrh r0, [r0] - bl ball_number_to_ball_processing_index - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0xB - bgt _08171B36 - cmp r5, 0 - blt _08171B36 - ldrh r0, [r4, 0x20] - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x22] - subs r1, 0x5 - lsls r1, 24 - lsrs r1, 24 - str r5, [sp] - movs r2, 0x1 - movs r3, 0x1C - bl sub_8171D98 - ldr r0, =0x02038437 - ldrb r1, [r0] - movs r0, 0x1 - movs r2, 0xE - adds r3, r5, 0 - bl sub_81729E8 -_08171B36: - ldr r6, =0x02020630 - ldr r5, =0x020241e4 - ldr r4, =0x02038437 - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x1 - bl StartObjectRotScalAnim - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl AnimateObject - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x80 - lsls r1, 5 - strh r1, [r0, 0x30] - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8171AE4 - - thumb_func_start sub_8171BAC -sub_8171BAC: @ 8171BAC - push {r4-r7,lr} - adds r7, r0, 0 - movs r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08171BCA - adds r2, r7, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_08171BCA: - ldr r4, =0x02020630 - ldr r3, =0x020241e4 - ldr r2, =0x02038437 - ldrb r0, [r2] - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r4 - adds r0, r1, 0 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 26 - cmp r0, 0 - bge _08171C04 - adds r0, r1, 0 - movs r1, 0 - bl StartObjectRotScalAnim - movs r5, 0x1 - b _08171C24 - .pool -_08171C04: - ldr r6, =0xfffffee0 - adds r0, r6, 0 - ldrh r6, [r1, 0x30] - adds r0, r6 - strh r0, [r1, 0x30] - ldrb r0, [r2] - adds r0, r3 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r1, 0x30] - lsls r0, 16 - asrs r0, 24 - strh r0, [r1, 0x26] -_08171C24: - adds r0, r7, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08171C8A - cmp r5, 0 - beq _08171C8A - ldr r4, =0x02020630 - ldr r3, =0x020241e4 - ldr r2, =0x02038437 - ldrb r0, [r2] - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r6, 0 - movs r5, 0 - strh r5, [r0, 0x26] - ldrb r0, [r2] - adds r0, r3 - ldrb r0, [r0] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r4 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r1, [r0, 0x9] - lsls r1, 30 - adds r2, 0x3E - lsrs r1, 31 - lsls r1, 2 - ldrb r3, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - strh r5, [r7, 0x2E] - ldr r0, =sub_81719C0 - str r0, [r7, 0x1C] - ldr r0, =0x020244b9 - strb r6, [r0] - movs r0, 0x1 - bl sub_8072A88 -_08171C8A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8171BAC - - thumb_func_start sub_8171CAC -sub_8171CAC: @ 8171CAC - push {r4,lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x24] - ldrh r1, [r2, 0x20] - adds r0, r1 - movs r1, 0 - strh r0, [r2, 0x20] - ldrh r0, [r2, 0x26] - ldrh r3, [r2, 0x22] - adds r0, r3 - strh r0, [r2, 0x22] - strh r1, [r2, 0x26] - strh r1, [r2, 0x24] - ldr r4, =sub_8171CE8 - movs r3, 0 - movs r1, 0x5 - adds r0, r2, 0 - adds r0, 0x38 -_08171CD0: - strh r3, [r0] - subs r0, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _08171CD0 - str r4, [r2, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8171CAC - - thumb_func_start sub_8171CE8 -sub_8171CE8: @ 8171CE8 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x80 - lsls r0, 4 - adds r2, r0, 0 - ldrh r1, [r4, 0x2E] - adds r2, r1 - movs r0, 0xD0 - lsls r0, 3 - adds r3, r0, 0 - ldrh r1, [r4, 0x30] - adds r3, r1 - lsls r1, r3, 16 - asrs r1, 24 - ldrh r0, [r4, 0x24] - subs r0, r1 - strh r0, [r4, 0x24] - lsls r0, r2, 16 - asrs r0, 24 - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - movs r0, 0xFF - ands r2, r0 - strh r2, [r4, 0x2E] - ands r3, r0 - strh r3, [r4, 0x30] - movs r2, 0x22 - ldrsh r0, [r4, r2] - movs r2, 0x26 - ldrsh r1, [r4, r2] - adds r0, r1 - cmp r0, 0xA0 - bgt _08171D3E - movs r1, 0x20 - ldrsh r0, [r4, r1] - movs r2, 0x24 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0x8 - negs r1, r1 - cmp r0, r1 - bge _08171D52 -_08171D3E: - movs r0, 0 - strh r0, [r4, 0x2E] - ldr r0, =sub_81719C0 - str r0, [r4, 0x1C] - ldr r1, =0x020244b9 - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - bl sub_8072A88 -_08171D52: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8171CE8 - - thumb_func_start sub_8171D60 -sub_8171D60: @ 8171D60 - push {r4,r5,lr} - lsls r0, 24 - ldr r1, =gUnknown_085E5094 - lsrs r5, r0, 21 - adds r4, r5, r1 - ldrh r0, [r4, 0x6] - bl GetObjectTileRangeStartByTag - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - bne _08171D86 - adds r0, r4, 0 - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_085E50F4 - adds r0, r5, r0 - bl LoadCompressedObjectPaletteUsingHeap -_08171D86: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8171D60 - - thumb_func_start sub_8171D98 -sub_8171D98: @ 8171D98 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - adds r6, r0, 0 - mov r8, r1 - mov r9, r2 - mov r10, r3 - ldr r5, [sp, 0x1C] - lsls r6, 24 - lsrs r6, 24 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - mov r1, r9 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - mov r0, r10 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r5, 0 - bl sub_8171D60 - ldr r1, =gUnknown_085E51C0 - lsls r0, r5, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x5 - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - strh r6, [r0, 0xA] - mov r1, r8 - strh r1, [r0, 0xC] - mov r1, r9 - strh r1, [r0, 0xE] - mov r1, r10 - strh r1, [r0, 0x10] - strh r5, [r0, 0x26] - movs r0, 0xF - bl audio_play - adds r0, r4, 0 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8171D98 - - thumb_func_start sub_8171E20 -sub_8171E20: @ 8171E20 - push {lr} - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08171E3E - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0x8] - ldrb r0, [r1, 0xA] - adds r0, 0x1 - strb r0, [r1, 0xA] -_08171E3E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8171E20 - - thumb_func_start sub_8171E50 -sub_8171E50: @ 8171E50 - 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, =0x03005e00 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r6, r0, r1 - ldrh r0, [r6, 0x26] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r2, 0x8 - ldrsh r0, [r6, r2] - adds r2, r1, 0 - cmp r0, 0xF - bgt _08171F48 - ldrb r1, [r6, 0xA] - ldrb r2, [r6, 0xC] - ldrb r4, [r6, 0xE] - mov r9, r4 - ldrb r3, [r6, 0x10] - ldr r4, [sp] - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - ldr r4, =gUnknown_085E51F0 - adds r0, r4 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - cmp r0, 0x40 - beq _08171EEC - bl sub_8171E20 - mov r0, r10 - lsls r4, r0, 4 - add r4, r10 - lsls r4, 2 - ldr r5, =0x02020630 - adds r7, r4, r5 - ldr r0, =gUnknown_085E51B4 - ldr r1, [sp] - adds r0, r1, r0 - ldrb r1, [r0] - adds r0, r7, 0 - bl StartObjectImageAnim - adds r5, 0x1C - adds r4, r5 - ldr r0, =sub_8171F68 - str r0, [r4] - movs r0, 0x3 - mov r2, r9 - ands r2, r0 - lsls r2, 2 - ldrb r1, [r7, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - orrs r0, r2 - strb r0, [r7, 0x5] - ldrb r0, [r6, 0x8] - cmp r0, 0x7 - bls _08171EE8 - subs r0, 0x8 - lsls r0, 24 - lsrs r0, 24 -_08171EE8: - lsls r0, 5 - strh r0, [r7, 0x2E] -_08171EEC: - ldr r0, =0x03005e00 - mov r4, r8 - lsls r1, r4, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r2, 0x8 - ldrsh r1, [r1, r2] - adds r2, r0, 0 - cmp r1, 0xF - bne _08171F48 - ldr r0, =0x030022c0 - ldr r4, =0x00000439 - adds r0, r4 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08171F22 - ldr r0, =0x02020630 - mov r2, r10 - lsls r1, r2, 4 - add r1, r10 - lsls r1, 2 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x3C] -_08171F22: - mov r0, r8 - bl DestroyTask - b _08171F58 - .pool -_08171F48: - mov r4, r8 - lsls r0, r4, 2 - add r0, r8 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] -_08171F58: - 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_8171E50 - - thumb_func_start sub_8171F68 -sub_8171F68: @ 8171F68 - push {lr} - adds r1, r0, 0 - ldrh r2, [r1, 0x30] - movs r3, 0x30 - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _08171F80 - ldr r0, =sub_8171F88 - str r0, [r1, 0x1C] - b _08171F84 - .pool -_08171F80: - subs r0, r2, 0x1 - strh r0, [r1, 0x30] -_08171F84: - pop {r0} - bx r0 - thumb_func_end sub_8171F68 - - thumb_func_start sub_8171F88 -sub_8171F88: @ 8171F88 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r2, 0x30 - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r2, 0x30 - ldrsh r1, [r4, r2] - bl cosine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x2 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x32 - bne _08171FBC - adds r0, r4, 0 - bl sub_8172944 -_08171FBC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8171F88 - - thumb_func_start sub_8171FC4 -sub_8171FC4: @ 8171FC4 - 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 r9, r0 - ldr r0, =0x03005e00 - mov r2, r9 - lsls r1, r2, 2 - add r1, r9 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x26] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrb r3, [r1, 0xA] - str r3, [sp] - ldrb r0, [r1, 0xC] - str r0, [sp, 0x4] - ldrb r2, [r1, 0xE] - str r2, [sp, 0x8] - ldrb r1, [r1, 0x10] - str r1, [sp, 0xC] - movs r7, 0 - ldr r3, =0x02020630 - mov r10, r3 - mov r1, r8 - lsls r0, r1, 1 - add r0, r8 - lsls r0, 3 - str r0, [sp, 0x10] -_0817200A: - ldr r0, =gUnknown_085E51F0 - ldr r2, [sp, 0x10] - adds r0, r2, r0 - ldr r1, [sp] - ldr r2, [sp, 0x4] - ldr r3, [sp, 0xC] - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x40 - beq _0817206A - bl sub_8171E20 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - mov r3, r10 - adds r5, r4, r3 - ldr r0, =gUnknown_085E51B4 - add r0, r8 - ldrb r1, [r0] - adds r0, r5, 0 - bl StartObjectImageAnim - ldr r0, =0x0202064c - adds r4, r0 - ldr r0, =sub_8172508 - str r0, [r4] - movs r0, 0x3 - ldr r2, [sp, 0x8] - ands r2, r0 - lsls r2, 2 - ldrb r0, [r5, 0x5] - movs r3, 0xD - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0x5] - lsls r0, r7, 5 - strh r0, [r5, 0x2E] - movs r0, 0xA - strh r0, [r5, 0x36] - movs r0, 0x2 - strh r0, [r5, 0x38] - movs r0, 0x1 - strh r0, [r5, 0x3A] -_0817206A: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x7 - bls _0817200A - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08172092 - ldr r0, =0x02020630 - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x3C] -_08172092: - mov r0, r9 - bl DestroyTask - 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_8171FC4 - - thumb_func_start sub_81720C8 -sub_81720C8: @ 81720C8 - 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 r9, r0 - ldr r0, =0x03005e00 - mov r2, r9 - lsls r1, r2, 2 - add r1, r9 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x26] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrb r3, [r1, 0xA] - str r3, [sp] - ldrb r0, [r1, 0xC] - str r0, [sp, 0x4] - ldrb r2, [r1, 0xE] - str r2, [sp, 0x8] - ldrb r1, [r1, 0x10] - str r1, [sp, 0xC] - movs r7, 0 - ldr r3, =0x02020630 - mov r10, r3 - mov r1, r8 - lsls r0, r1, 1 - add r0, r8 - lsls r0, 3 - str r0, [sp, 0x10] -_0817210E: - ldr r0, =gUnknown_085E51F0 - ldr r2, [sp, 0x10] - adds r0, r2, r0 - ldr r1, [sp] - ldr r2, [sp, 0x4] - ldr r3, [sp, 0xC] - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x40 - beq _0817216E - bl sub_8171E20 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - mov r3, r10 - adds r5, r4, r3 - ldr r0, =gUnknown_085E51B4 - add r0, r8 - ldrb r1, [r0] - adds r0, r5, 0 - bl StartObjectImageAnim - ldr r0, =0x0202064c - adds r4, r0 - ldr r0, =sub_8172508 - str r0, [r4] - movs r0, 0x3 - ldr r2, [sp, 0x8] - ands r2, r0 - lsls r2, 2 - ldrb r0, [r5, 0x5] - movs r3, 0xD - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0x5] - lsls r0, r7, 5 - strh r0, [r5, 0x2E] - movs r0, 0xA - strh r0, [r5, 0x36] - movs r0, 0x1 - strh r0, [r5, 0x38] - movs r0, 0x2 - strh r0, [r5, 0x3A] -_0817216E: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x7 - bls _0817210E - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08172196 - ldr r0, =0x02020630 - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x3C] -_08172196: - mov r0, r9 - bl DestroyTask - 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_81720C8 - - thumb_func_start sub_81721CC -sub_81721CC: @ 81721CC - 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 r9, r0 - ldr r1, =0x03005e00 - lsls r0, 2 - add r0, r9 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x26] - lsls r1, 24 - lsrs r1, 24 - ldrb r2, [r0, 0xA] - str r2, [sp] - ldrb r3, [r0, 0xC] - str r3, [sp, 0x4] - ldrb r2, [r0, 0xE] - str r2, [sp, 0x8] - ldrb r0, [r0, 0x10] - str r0, [sp, 0xC] - movs r7, 0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - str r0, [sp, 0x10] - ldr r3, =0x02020630 - mov r8, r3 - ldr r0, =gUnknown_085E51B4 - adds r1, r0 - mov r10, r1 -_08172212: - ldr r0, =gUnknown_085E51F0 - ldr r1, [sp, 0x10] - adds r0, r1, r0 - ldr r1, [sp] - ldr r2, [sp, 0x4] - ldr r3, [sp, 0xC] - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x40 - beq _0817226E - bl sub_8171E20 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - mov r2, r8 - adds r5, r4, r2 - mov r3, r10 - ldrb r1, [r3] - adds r0, r5, 0 - bl StartObjectImageAnim - ldr r0, =0x0202064c - adds r4, r0 - ldr r0, =sub_8172508 - str r0, [r4] - movs r0, 0x3 - ldr r2, [sp, 0x8] - ands r2, r0 - lsls r2, 2 - ldrb r0, [r5, 0x5] - movs r3, 0xD - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0x5] - lsls r0, r7, 5 - strh r0, [r5, 0x2E] - movs r0, 0x4 - strh r0, [r5, 0x36] - movs r0, 0x1 - strh r0, [r5, 0x38] - strh r0, [r5, 0x3A] -_0817226E: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x7 - bls _08172212 - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08172296 - ldr r0, =0x02020630 - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x3C] -_08172296: - mov r0, r9 - bl DestroyTask - 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_81721CC - - thumb_func_start sub_81722CC -sub_81722CC: @ 81722CC - 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 r9, r0 - ldr r0, =0x03005e00 - mov r2, r9 - lsls r1, r2, 2 - add r1, r9 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x26] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrb r3, [r1, 0xA] - str r3, [sp] - ldrb r0, [r1, 0xC] - str r0, [sp, 0x4] - ldrb r2, [r1, 0xE] - str r2, [sp, 0x8] - ldrb r1, [r1, 0x10] - str r1, [sp, 0xC] - movs r7, 0 - ldr r3, =0x02020630 - mov r10, r3 - mov r1, r8 - lsls r0, r1, 1 - add r0, r8 - lsls r0, 3 - str r0, [sp, 0x10] -_08172312: - ldr r0, =gUnknown_085E51F0 - ldr r2, [sp, 0x10] - adds r0, r2, r0 - ldr r1, [sp] - ldr r2, [sp, 0x4] - ldr r3, [sp, 0xC] - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x40 - beq _08172376 - bl sub_8171E20 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - mov r3, r10 - adds r5, r4, r3 - ldr r0, =gUnknown_085E51B4 - add r0, r8 - ldrb r1, [r0] - adds r0, r5, 0 - bl StartObjectImageAnim - ldr r0, =0x0202064c - adds r4, r0 - ldr r0, =sub_8172508 - str r0, [r4] - movs r0, 0x3 - ldr r2, [sp, 0x8] - ands r2, r0 - lsls r2, 2 - ldrb r0, [r5, 0x5] - movs r3, 0xD - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0x5] - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 3 - adds r0, r7 - strh r0, [r5, 0x2E] - movs r0, 0x5 - strh r0, [r5, 0x36] - movs r0, 0x1 - strh r0, [r5, 0x38] - strh r0, [r5, 0x3A] -_08172376: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x9 - bls _08172312 - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0817239E - ldr r0, =0x02020630 - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x3C] -_0817239E: - mov r0, r9 - bl DestroyTask - 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_81722CC - - thumb_func_start sub_81723D4 -sub_81723D4: @ 81723D4 - 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 - mov r8, r0 - ldr r1, =0x03005e00 - lsls r2, r0, 2 - adds r0, r2, r0 - lsls r0, 3 - adds r3, r0, r1 - ldrh r1, [r3, 0x16] - movs r4, 0x16 - ldrsh r0, [r3, r4] - cmp r0, 0 - beq _08172404 - subs r0, r1, 0x1 - strh r0, [r3, 0x16] - b _081724D6 - .pool -_08172404: - ldrh r0, [r3, 0x26] - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r3, 0xA] - str r1, [sp] - ldrb r4, [r3, 0xC] - str r4, [sp, 0x4] - ldrb r1, [r3, 0xE] - str r1, [sp, 0x8] - ldrb r3, [r3, 0x10] - str r3, [sp, 0xC] - movs r7, 0 - str r2, [sp, 0x14] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 3 - str r1, [sp, 0x10] - ldr r3, =0x02020630 - mov r9, r3 - ldr r1, =gUnknown_085E51B4 - adds r0, r1 - mov r10, r0 -_08172430: - ldr r0, =gUnknown_085E51F0 - ldr r4, [sp, 0x10] - adds r0, r4, r0 - ldr r1, [sp] - ldr r2, [sp, 0x4] - ldr r3, [sp, 0xC] - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x40 - beq _0817248C - bl sub_8171E20 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - mov r0, r9 - adds r5, r4, r0 - mov r3, r10 - ldrb r1, [r3] - adds r0, r5, 0 - bl StartObjectImageAnim - ldr r0, =0x0202064c - adds r4, r0 - ldr r0, =sub_8172508 - str r0, [r4] - movs r0, 0x3 - ldr r2, [sp, 0x8] - ands r2, r0 - lsls r2, 2 - ldrb r0, [r5, 0x5] - movs r3, 0xD - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0x5] - lsls r0, r7, 5 - strh r0, [r5, 0x2E] - movs r0, 0x8 - strh r0, [r5, 0x36] - movs r0, 0x2 - strh r0, [r5, 0x38] - strh r0, [r5, 0x3A] -_0817248C: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x7 - bls _08172430 - ldr r0, =0x03005e00 - ldr r1, [sp, 0x14] - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0x8 - strh r0, [r1, 0x16] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - lsls r0, 16 - asrs r2, r0, 16 - cmp r2, 0x2 - bne _081724D6 - ldr r0, =0x030022c0 - ldr r4, =0x00000439 - adds r0, r4 - ldrb r1, [r0] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _081724D0 - ldr r0, =0x02020630 - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x3C] -_081724D0: - mov r0, r8 - bl DestroyTask -_081724D6: - 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_81723D4 - - thumb_func_start sub_8172508 -sub_8172508: @ 8172508 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r2, 0x30 - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r2, 0x32 - ldrsh r1, [r4, r2] - bl cosine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x36] - ldrh r1, [r4, 0x2E] - adds r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x38] - ldrh r2, [r4, 0x30] - adds r0, r2 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x3A] - ldrh r1, [r4, 0x32] - adds r0, r1 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x33 - bne _08172558 - adds r0, r4, 0 - bl sub_8172944 -_08172558: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8172508 - - thumb_func_start sub_8172560 -sub_8172560: @ 8172560 - 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 r9, r0 - ldr r1, =0x03005e00 - lsls r0, 2 - add r0, r9 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x26] - lsls r1, 24 - lsrs r1, 24 - ldrb r2, [r0, 0xA] - str r2, [sp] - ldrb r3, [r0, 0xC] - str r3, [sp, 0x4] - ldrb r2, [r0, 0xE] - str r2, [sp, 0x8] - ldrb r0, [r0, 0x10] - str r0, [sp, 0xC] - movs r7, 0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - str r0, [sp, 0x10] - ldr r3, =0x02020630 - mov r8, r3 - ldr r0, =gUnknown_085E51B4 - adds r1, r0 - mov r10, r1 -_081725A6: - ldr r0, =gUnknown_085E51F0 - ldr r1, [sp, 0x10] - adds r0, r1, r0 - ldr r1, [sp] - ldr r2, [sp, 0x4] - ldr r3, [sp, 0xC] - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x40 - beq _081725FE - bl sub_8171E20 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - mov r2, r8 - adds r5, r4, r2 - mov r3, r10 - ldrb r1, [r3] - adds r0, r5, 0 - bl StartObjectImageAnim - ldr r0, =0x0202064c - adds r4, r0 - ldr r0, =sub_817265C - str r0, [r4] - movs r0, 0x3 - ldr r2, [sp, 0x8] - ands r2, r0 - lsls r2, 2 - ldrb r0, [r5, 0x5] - movs r3, 0xD - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0x5] - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 2 - adds r0, r7 - strh r0, [r5, 0x2E] -_081725FE: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0xB - bls _081725A6 - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08172626 - ldr r0, =0x02020630 - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x3C] -_08172626: - mov r0, r9 - bl DestroyTask - 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_8172560 - - thumb_func_start sub_817265C -sub_817265C: @ 817265C - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - movs r2, 0x30 - ldrsh r1, [r5, r2] - bl sine - strh r0, [r5, 0x24] - movs r0, 0x2E - ldrsh r4, [r5, r0] - movs r2, 0x32 - ldrsh r1, [r5, r2] - adds r0, r4, 0 - bl sine - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl cosine - strh r0, [r5, 0x26] - ldrh r0, [r5, 0x2E] - adds r0, 0x6 - movs r1, 0xFF - ands r0, r1 - strh r0, [r5, 0x2E] - ldrh r0, [r5, 0x30] - adds r0, 0x1 - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x32] - adds r0, 0x1 - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x34] - adds r0, 0x1 - strh r0, [r5, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x33 - bne _081726B4 - adds r0, r5, 0 - bl sub_8172944 -_081726B4: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_817265C - - thumb_func_start sub_81726BC -sub_81726BC: @ 81726BC - 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] - ldr r0, =0x03005e00 - ldr r2, [sp] - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x26] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldrb r3, [r1, 0xA] - str r3, [sp, 0x4] - ldrb r0, [r1, 0xC] - str r0, [sp, 0x8] - ldrb r2, [r1, 0xE] - str r2, [sp, 0xC] - ldrb r1, [r1, 0x10] - str r1, [sp, 0x10] - movs r3, 0 - mov r8, r3 - mov r1, r9 - lsls r0, r1, 1 - add r0, r9 - lsls r0, 3 - str r0, [sp, 0x14] -_08172700: - movs r7, 0 - movs r2, 0x1 - add r2, r8 - mov r10, r2 -_08172708: - ldr r0, =gUnknown_085E51F0 - ldr r3, [sp, 0x14] - adds r0, r3, r0 - ldr r1, [sp, 0x4] - ldr r2, [sp, 0x8] - ldr r3, [sp, 0x10] - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x40 - beq _08172790 - bl sub_8171E20 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - ldr r0, =0x02020630 - adds r5, r4, r0 - ldr r0, =gUnknown_085E51B4 - add r0, r9 - ldrb r1, [r0] - adds r0, r5, 0 - bl StartObjectImageAnim - ldr r1, =0x0202064c - adds r4, r1 - ldr r0, =sub_8172508 - str r0, [r4] - movs r0, 0x3 - ldr r1, [sp, 0xC] - ands r1, r0 - lsls r1, 2 - ldrb r0, [r5, 0x5] - movs r3, 0xD - negs r3, r3 - adds r2, r3, 0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - lsls r0, r7, 5 - strh r0, [r5, 0x2E] - movs r0, 0x8 - strh r0, [r5, 0x36] - mov r0, r8 - cmp r0, 0 - bne _08172788 - movs r0, 0x2 - strh r0, [r5, 0x38] - movs r0, 0x1 - b _0817278E - .pool -_08172788: - movs r0, 0x1 - strh r0, [r5, 0x38] - movs r0, 0x2 -_0817278E: - strh r0, [r5, 0x3A] -_08172790: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x7 - bls _08172708 - mov r1, r10 - lsls r0, r1, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x1 - bls _08172700 - ldr r0, =0x030022c0 - ldr r2, =0x00000439 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _081727C4 - ldr r0, =0x02020630 - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x3C] -_081727C4: - ldr r0, [sp] - bl DestroyTask - 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_81726BC - - thumb_func_start sub_81727E8 -sub_81727E8: @ 81727E8 - 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 r9, r0 - ldr r1, =0x03005e00 - lsls r0, 2 - add r0, r9 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x26] - lsls r1, 24 - lsrs r1, 24 - ldrb r2, [r0, 0xA] - str r2, [sp] - ldrb r3, [r0, 0xC] - str r3, [sp, 0x4] - ldrb r2, [r0, 0xE] - str r2, [sp, 0x8] - ldrb r0, [r0, 0x10] - str r0, [sp, 0xC] - movs r7, 0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - str r0, [sp, 0x10] - ldr r3, =0x02020630 - mov r8, r3 - ldr r0, =gUnknown_085E51B4 - adds r1, r0 - mov r10, r1 -_0817282E: - ldr r0, =gUnknown_085E51F0 - ldr r1, [sp, 0x10] - adds r0, r1, r0 - ldr r1, [sp] - ldr r2, [sp, 0x4] - ldr r3, [sp, 0xC] - bl AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x40 - beq _08172880 - bl sub_8171E20 - lsls r4, r6, 4 - adds r4, r6 - lsls r4, 2 - mov r2, r8 - adds r5, r4, r2 - mov r3, r10 - ldrb r1, [r3] - adds r0, r5, 0 - bl StartObjectImageAnim - ldr r0, =0x0202064c - adds r4, r0 - ldr r0, =sub_81728E0 - str r0, [r4] - movs r0, 0x3 - ldr r2, [sp, 0x8] - ands r2, r0 - lsls r2, 2 - ldrb r0, [r5, 0x5] - movs r3, 0xD - negs r3, r3 - adds r1, r3, 0 - ands r0, r1 - orrs r0, r2 - strb r0, [r5, 0x5] - lsls r0, r7, 5 - strh r0, [r5, 0x2E] -_08172880: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x7 - bls _0817282E - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _081728A8 - ldr r0, =0x02020630 - lsls r1, r6, 4 - adds r1, r6 - lsls r1, 2 - adds r1, r0 - movs r0, 0x1 - strh r0, [r1, 0x3C] -_081728A8: - mov r0, r9 - bl DestroyTask - 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_81727E8 - - thumb_func_start sub_81728E0 -sub_81728E0: @ 81728E0 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - movs r2, 0x30 - ldrsh r1, [r5, r2] - bl sine - strh r0, [r5, 0x24] - movs r0, 0x2E - ldrsh r4, [r5, r0] - ldrh r1, [r5, 0x2E] - movs r0, 0x3F - ands r0, r1 - movs r2, 0x32 - ldrsh r1, [r5, r2] - bl sine - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl cosine - strh r0, [r5, 0x26] - ldrh r0, [r5, 0x2E] - adds r0, 0xA - movs r1, 0xFF - ands r0, r1 - strh r0, [r5, 0x2E] - ldrh r0, [r5, 0x30] - adds r0, 0x1 - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x32] - adds r0, 0x1 - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x34] - adds r0, 0x1 - strh r0, [r5, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x33 - bne _0817293C - adds r0, r5, 0 - bl sub_8172944 -_0817293C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81728E0 - - thumb_func_start sub_8172944 -sub_8172944: @ 8172944 - push {r4-r7,lr} - adds r7, r0, 0 - ldr r0, =0x030022c0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08172970 - movs r1, 0x3C - ldrsh r0, [r7, r1] - cmp r0, 0x1 - bne _081729CA - adds r0, r7, 0 - bl RemoveObjectAndFreeResources - b _081729E2 - .pool -_08172970: - ldr r2, =0x020244d0 - ldr r0, [r2] - ldr r1, [r0, 0x8] - ldrb r0, [r1, 0xA] - subs r0, 0x1 - strb r0, [r1, 0xA] - ldr r0, [r2] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0xA] - cmp r0, 0 - bne _081729DC - movs r4, 0 - ldr r5, =gUnknown_085E51C0 - b _08172998 - .pool -_08172994: - adds r5, 0x4 - adds r4, 0x1 -_08172998: - cmp r4, 0xB - bgt _081729AA - ldr r0, [r5] - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08172994 -_081729AA: - cmp r4, 0xC - bne _081729CA - movs r6, 0 - ldr r5, =gUnknown_085E5094 - ldr r4, =gUnknown_085E50F4 -_081729B4: - ldrh r0, [r5, 0x6] - bl FreeObjectTilesByTag - ldrh r0, [r4, 0x4] - bl FreeObjectPaletteByTag - adds r5, 0x8 - adds r4, 0x8 - adds r6, 0x1 - cmp r6, 0xB - ble _081729B4 -_081729CA: - adds r0, r7, 0 - bl RemoveObjectAndFreeTiles - b _081729E2 - .pool -_081729DC: - adds r0, r7, 0 - bl RemoveObjectAndFreeTiles -_081729E2: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8172944 - - thumb_func_start sub_81729E8 -sub_81729E8: @ 81729E8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - adds r4, r0, 0 - mov r9, r2 - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - lsrs r6, r1, 24 - lsls r3, 24 - lsrs r7, r3, 24 - ldr r0, =sub_8172AB0 - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =0x03005e00 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r5, r0, r1 - strh r7, [r5, 0x26] - strh r6, [r5, 0xE] - mov r0, r9 - strh r0, [r5, 0x1C] - mov r1, r9 - lsrs r0, r1, 16 - strh r0, [r5, 0x1E] - cmp r4, 0 - bne _08172A58 - lsls r0, r6, 20 - movs r2, 0x80 - lsls r2, 17 - adds r0, r2 - lsrs r0, 16 - ldr r2, =gUnknown_085E5310 - lsls r1, r7, 1 - adds r1, r2 - ldrh r3, [r1] - movs r1, 0x10 - movs r2, 0 - bl pal_fade_1 - movs r0, 0x1 - strh r0, [r5, 0xA] - b _08172A7E - .pool -_08172A58: - lsls r0, r6, 20 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r0, 16 - ldr r2, =gUnknown_085E5310 - lsls r1, r7, 1 - adds r1, r2 - ldrh r3, [r1] - movs r1, 0x10 - movs r2, 0x10 - bl pal_fade_1 - movs r0, 0x10 - strh r0, [r5, 0x8] - ldr r0, =0x0000ffff - strh r0, [r5, 0xA] - ldr r0, =sub_8172B40 - str r0, [r5] -_08172A7E: - ldr r0, =0x00007fff - str r0, [sp] - mov r0, r9 - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - mov r0, r8 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81729E8 - - thumb_func_start sub_8172AB0 -sub_8172AB0: @ 8172AB0 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xC - ldrsh r0, [r4, r2] - cmp r0, 0x10 - bgt _08172B08 - movs r2, 0xE - ldrsh r0, [r4, r2] - lsls r0, 20 - movs r2, 0x80 - lsls r2, 17 - adds r0, r2 - lsrs r0, 16 - ldrb r2, [r4, 0x8] - ldr r3, =gUnknown_085E5310 - lsls r1, 1 - adds r1, r3 - ldrh r3, [r1] - movs r1, 0x10 - bl pal_fade_1 - ldrh r0, [r4, 0xA] - ldrh r1, [r4, 0x8] - adds r0, r1 - strh r0, [r4, 0x8] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - b _08172B30 - .pool -_08172B08: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08172B30 - ldrh r0, [r4, 0x1C] - ldrh r1, [r4, 0x1E] - lsls r1, 16 - orrs r0, r1 - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - adds r0, r5, 0 - bl DestroyTask -_08172B30: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8172AB0 - - thumb_func_start sub_8172B40 -sub_8172B40: @ 8172B40 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08172B78 - ldr r0, =0x03005e00 - lsls r4, r2, 2 - adds r4, r2 - lsls r4, 3 - adds r4, r0 - ldrh r0, [r4, 0x1C] - ldrh r1, [r4, 0x1E] - lsls r1, 16 - orrs r0, r1 - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r0, =sub_8172B90 - str r0, [r4] -_08172B78: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8172B40 - - thumb_func_start sub_8172B90 -sub_8172B90: @ 8172B90 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r1, r0, 24 - movs r3, 0xC - ldrsh r0, [r4, r3] - cmp r0, 0x10 - bgt _08172BE4 - movs r2, 0xE - ldrsh r0, [r4, r2] - lsls r0, 20 - movs r3, 0x80 - lsls r3, 17 - adds r0, r3 - lsrs r0, 16 - ldrb r2, [r4, 0x8] - ldr r3, =gUnknown_085E5310 - lsls r1, 1 - adds r1, r3 - ldrh r3, [r1] - movs r1, 0x10 - bl pal_fade_1 - ldrh r0, [r4, 0xA] - ldrh r1, [r4, 0x8] - adds r0, r1 - strh r0, [r4, 0x8] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - b _08172BEA - .pool -_08172BE4: - adds r0, r2, 0 - bl DestroyTask -_08172BEA: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8172B90 - - thumb_func_start sub_8172BF0 -sub_8172BF0: @ 8172BF0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0 - mov r8, r0 - ldr r0, =0x020241e4 - ldr r3, =0x02038436 - ldrb r2, [r3] - adds r0, r2, r0 - ldrb r6, [r0] - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r5, r0, r1 - movs r1, 0x1C - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _08172CC8 - cmp r0, 0x1 - bgt _08172C30 - cmp r0, 0 - beq _08172C36 - b _08172D8A - .pool -_08172C30: - cmp r0, 0x2 - beq _08172CDA - b _08172D8A -_08172C36: - ldr r0, =0x0203841e - ldrh r0, [r0] - strh r0, [r5, 0x1E] - movs r2, 0xA0 - lsls r2, 3 - adds r0, r2, 0 - ldrh r4, [r5, 0x8] - adds r0, r4 - strh r0, [r5, 0x8] - ldrb r0, [r3] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08172C78 - ldr r2, =0x02020630 - lsls r3, r6, 4 - adds r1, r3, r6 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r5, 0x8] - lsls r0, 16 - asrs r0, 24 - ldrh r4, [r1, 0x24] - adds r0, r4 - strh r0, [r1, 0x24] - adds r4, r3, 0 - b _08172C90 - .pool -_08172C78: - ldr r3, =0x02020630 - lsls r4, r6, 4 - adds r2, r4, r6 - lsls r2, 2 - adds r2, r3 - ldrh r1, [r5, 0x8] - lsls r1, 16 - asrs r1, 24 - ldrh r0, [r2, 0x24] - subs r0, r1 - strh r0, [r2, 0x24] - adds r2, r3, 0 -_08172C90: - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r3, r0, r1 - ldrb r0, [r3, 0x8] - strh r0, [r3, 0x8] - adds r0, r4, r6 - lsls r0, 2 - adds r0, r2 - movs r2, 0x20 - ldrsh r1, [r0, r2] - movs r4, 0x24 - ldrsh r0, [r0, r4] - adds r1, r0 - adds r1, 0x20 - movs r0, 0x98 - lsls r0, 1 - cmp r1, r0 - bls _08172D8A - ldrh r0, [r3, 0x1C] - adds r0, 0x1 - strh r0, [r3, 0x1C] - b _08172D8A - .pool -_08172CC8: - ldrb r1, [r5, 0x1E] - adds r0, r2, 0 - adds r2, r6, 0 - bl refresh_graphics_maybe - ldrh r0, [r5, 0x1C] - adds r0, 0x1 - strh r0, [r5, 0x1C] - b _08172D8A -_08172CDA: - movs r1, 0xA0 - lsls r1, 3 - adds r0, r1, 0 - ldrh r2, [r5, 0x8] - adds r0, r2 - strh r0, [r5, 0x8] - ldrb r0, [r3] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _08172D10 - ldr r0, =0x02020630 - lsls r3, r6, 4 - adds r2, r3, r6 - lsls r2, 2 - adds r2, r0 - ldrh r1, [r5, 0x8] - lsls r1, 16 - asrs r1, 24 - ldrh r0, [r2, 0x24] - subs r0, r1 - strh r0, [r2, 0x24] - adds r4, r3, 0 - b _08172D28 - .pool -_08172D10: - ldr r0, =0x02020630 - lsls r2, r6, 4 - adds r1, r2, r6 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r5, 0x8] - lsls r0, 16 - asrs r0, 24 - ldrh r3, [r1, 0x24] - adds r0, r3 - strh r0, [r1, 0x24] - adds r4, r2, 0 -_08172D28: - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x8] - strh r1, [r0, 0x8] - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _08172D68 - ldr r0, =0x02020630 - adds r1, r4, r6 - lsls r1, 2 - adds r1, r0 - movs r4, 0x24 - ldrsh r0, [r1, r4] - cmp r0, 0 - bgt _08172D7E - movs r0, 0 - strh r0, [r1, 0x24] - b _08172D84 - .pool -_08172D68: - ldr r0, =0x02020630 - adds r1, r4, r6 - lsls r1, 2 - adds r1, r0 - movs r3, 0x24 - ldrsh r0, [r1, r3] - cmp r0, 0 - blt _08172D7E - strh r2, [r1, 0x24] - movs r4, 0x1 - mov r8, r4 -_08172D7E: - mov r0, r8 - cmp r0, 0 - beq _08172D8A -_08172D84: - adds r0, r7, 0 - bl move_anim_task_del -_08172D8A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8172BF0 - - thumb_func_start sub_8172D98 -sub_8172D98: @ 8172D98 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x26 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _08172E14 - cmp r0, 0x1 - bgt _08172DC0 - cmp r0, 0 - beq _08172DC6 - b _08172E84 - .pool -_08172DC0: - cmp r0, 0x2 - beq _08172E4E - b _08172E84 -_08172DC6: - ldr r0, =0x02038436 - ldrb r0, [r0] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08172DE8 - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - b _08172DF0 - .pool -_08172DE8: - ldr r1, =0x00003f44 - movs r0, 0x50 - bl SetGpuReg -_08172DF0: - movs r0, 0x52 - movs r1, 0x10 - bl SetGpuReg - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x26] - adds r0, 0x1 - strh r0, [r1, 0x26] - b _08172E84 - .pool -_08172E14: - ldrh r0, [r4, 0xA] - adds r1, r0, 0x1 - strh r1, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _08172E84 - movs r0, 0 - strh r0, [r4, 0xA] - ldrh r2, [r4, 0x8] - adds r2, 0x1 - strh r2, [r4, 0x8] - lsls r1, r2, 8 - movs r0, 0x10 - subs r0, r2 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x10 - bne _08172E84 - ldrh r0, [r4, 0x26] - adds r0, 0x1 - strh r0, [r4, 0x26] - b _08172E84 -_08172E4E: - ldr r1, =0x020241e4 - ldr r4, =0x02038436 - ldrb r0, [r4] - adds r0, r1 - ldrb r1, [r0] - ldr r2, =0x02020630 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x4] - lsls r1, 22 - lsrs r1, 17 - ldr r0, =0x06010000 - adds r1, r0 - movs r2, 0x80 - lsls r2, 4 - movs r0, 0 - movs r3, 0x1 - bl RequestDma3Fill - ldrb r0, [r4] - bl sub_805E974 - adds r0, r5, 0 - bl move_anim_task_del -_08172E84: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8172D98 - - thumb_func_start sub_8172E9C -sub_8172E9C: @ 8172E9C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x0203841e - ldr r1, =0x020244d0 - ldr r2, [r1] - ldr r1, =0x02038436 - ldrb r1, [r1] - ldr r2, [r2] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - lsls r1, 29 - lsrs r1, 31 - strh r1, [r3, 0xE] - bl move_anim_task_del - pop {r0} - bx r0 - .pool - thumb_func_end sub_8172E9C - - thumb_func_start sub_8172ED0 -sub_8172ED0: @ 8172ED0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02038437 - ldr r1, =0x0202420e - ldrb r1, [r1] - strb r1, [r2] - bl move_anim_task_del - pop {r0} - bx r0 - .pool - thumb_func_end sub_8172ED0 - - thumb_func_start sub_8172EF0 -sub_8172EF0: @ 8172EF0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r1, 0 - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0 - mov r8, r0 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] - adds r0, r4, 0 - movs r1, 0x1 - bl pokemon_getattr - adds r5, r0, 0 - adds r0, r4, 0 - movs r1, 0 - bl pokemon_getattr - adds r4, r0, 0 - adds r0, r6, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _08172FC8 - lsrs r0, r5, 16 - ldr r7, =0x0000ffff - ands r5, r7 - eors r0, r5 - lsrs r1, r4, 16 - eors r0, r1 - ands r4, r7 - eors r0, r4 - cmp r0, 0x7 - bhi _08172F4E - movs r0, 0x1 - mov r8, r0 -_08172F4E: - mov r0, r8 - cmp r0, 0 - beq _08172FC8 - ldr r0, =0x000027f9 - bl GetObjectTileRangeStartByTag - lsls r0, 16 - lsrs r0, 16 - cmp r0, r7 - bne _08172F6E - ldr r0, =gUnknown_0852528C - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_08525B94 - bl LoadCompressedObjectPaletteUsingHeap -_08172F6E: - ldr r5, =sub_8172FEC - adds r0, r5, 0 - movs r1, 0xA - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x03005e00 - lsls r2, r4, 2 - adds r2, r4 - lsls r2, 3 - adds r2, r3 - movs r4, 0 - strh r6, [r2, 0x8] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r3 - strh r6, [r1, 0x8] - strh r4, [r2, 0xA] - movs r0, 0x1 - strh r0, [r1, 0xA] - b _08172FDE - .pool -_08172FC8: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x1] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0, 0x1] -_08172FDE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8172EF0 - - thumb_func_start sub_8172FEC -sub_8172FEC: @ 8172FEC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r4, r0, r1 - ldrh r1, [r4, 0x22] - movs r2, 0x22 - ldrsh r0, [r4, r2] - cmp r0, 0x3B - bgt _08173018 - adds r0, r1, 0x1 - strh r0, [r4, 0x22] - b _08173190 - .pool -_08173018: - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0xA] - cmp r0, 0 - beq _08173026 - b _08173190 -_08173026: - ldrh r0, [r4, 0x1C] - adds r1, r0, 0x1 - strh r1, [r4, 0x1C] - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - cmp r1, 0 - beq _0817303A - b _08173190 -_0817303A: - ldrb r0, [r4, 0x8] - mov r8, r0 - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - lsrs r5, r0, 24 - mov r0, r8 - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r2, r0, 24 - movs r1, 0x1E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08173074 - ldr r0, =gUnknown_085CE388 - adds r1, r5, 0 - movs r3, 0x5 - bl AddObjectToFront - lsls r0, 24 - lsrs r5, r0, 24 - b _081730D6 - .pool -_08173074: - cmp r0, 0 - blt _081730A8 - cmp r0, 0x3 - bgt _081730A8 - ldr r0, =gUnknown_085CE3A0 - adds r1, r5, 0 - movs r3, 0x5 - bl AddObjectToFront - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02020630 - lsls r2, r5, 4 - adds r2, r5 - lsls r2, 2 - adds r2, r0 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x4 - b _081730C8 - .pool -_081730A8: - ldr r0, =gUnknown_085CE3A0 - adds r1, r5, 0 - movs r3, 0x5 - bl AddObjectToFront - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02020630 - lsls r2, r5, 4 - adds r2, r5 - lsls r2, 2 - adds r2, r0 - ldrh r3, [r2, 0x4] - lsls r1, r3, 22 - lsrs r1, 22 - adds r1, 0x5 -_081730C8: - ldr r4, =0x000003ff - adds r0, r4, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x4] -_081730D6: - ldr r2, =0x03005e00 - lsls r1, r7, 2 - adds r0, r1, r7 - lsls r0, 3 - adds r6, r0, r2 - movs r2, 0xA - ldrsh r0, [r6, r2] - mov r9, r1 - cmp r0, 0 - bne _08173118 - ldr r1, =0x02020630 - lsls r2, r5, 4 - adds r0, r2, r5 - lsls r0, 2 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_81731FC - str r1, [r0] - adds r4, r2, 0 - b _08173160 - .pool -_08173118: - ldr r3, =0x02020630 - lsls r4, r5, 4 - adds r1, r4, r5 - lsls r1, 2 - adds r0, r3, 0 - adds r0, 0x1C - adds r0, r1, r0 - ldr r2, =sub_8173250 - str r2, [r0] - adds r1, r3 - ldr r0, =0x0000ffe0 - strh r0, [r1, 0x24] - movs r0, 0x20 - strh r0, [r1, 0x26] - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - movs r1, 0x1E - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _08173160 - mov r0, r8 - bl battle_side_get_owner - lsls r0, 24 - movs r1, 0x3F - cmp r0, 0 - bne _08173156 - movs r1, 0xC0 -_08173156: - lsls r1, 24 - asrs r1, 24 - movs r0, 0x66 - bl audio_play_and_stuff -_08173160: - ldr r1, =0x02020630 - adds r0, r4, r5 - lsls r0, 2 - adds r0, r1 - strh r7, [r0, 0x2E] - ldr r1, =0x03005e00 - mov r2, r9 - adds r0, r2, r7 - lsls r0, 3 - adds r1, r0, r1 - ldrh r0, [r1, 0x1E] - adds r0, 0x1 - strh r0, [r1, 0x1E] - cmp r5, 0x40 - beq _08173184 - ldrh r0, [r1, 0x20] - adds r0, 0x1 - strh r0, [r1, 0x20] -_08173184: - movs r4, 0x1E - ldrsh r0, [r1, r4] - cmp r0, 0x5 - bne _08173190 - ldr r0, =sub_81731B0 - str r0, [r1] -_08173190: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8172FEC - - thumb_func_start sub_81731B0 -sub_81731B0: @ 81731B0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - adds r3, r0, 0 - ldr r1, =0x03005e00 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r1, r0, r1 - movs r2, 0x20 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _081731F0 - movs r2, 0xA - ldrsh r0, [r1, r2] - cmp r0, 0x1 - bne _081731EA - ldrb r1, [r1, 0x8] - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0, 0x1] -_081731EA: - adds r0, r3, 0 - bl DestroyTask -_081731F0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81731B0 - - thumb_func_start sub_81731FC -sub_81731FC: @ 81731FC - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x18 - bl sine - strh r0, [r4, 0x24] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x18 - bl cosine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0xC - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _08173246 - ldr r2, =0x03005e00 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r0, 0x20] - subs r1, 0x1 - strh r1, [r0, 0x20] - adds r0, r4, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_08173246: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81731FC - - thumb_func_start sub_8173250 -sub_8173250: @ 8173250 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x30] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0x3 - bgt _08173264 - adds r0, r1, 0x1 - strh r0, [r4, 0x30] - b _081732A6 -_08173264: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldrh r1, [r4, 0x24] - adds r1, 0x5 - strh r1, [r4, 0x24] - ldrh r0, [r4, 0x26] - subs r0, 0x5 - strh r0, [r4, 0x26] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x20 - ble _081732A6 - ldr r2, =0x03005e00 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r0, 0x20] - subs r1, 0x1 - strh r1, [r0, 0x20] - adds r0, r4, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_081732A6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173250 - - thumb_func_start sub_81732B0 -sub_81732B0: @ 81732B0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_085253AC - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_08525CB4 - bl LoadCompressedObjectPaletteUsingHeap - ldr r0, =0x0000281d - bl IndexOfObjectPaletteTag - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81732B0 - - thumb_func_start sub_81732E4 -sub_81732E4: @ 81732E4 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =0x0000281d - adds r0, r5, 0 - bl FreeObjectTilesByTag - adds r0, r5, 0 - bl FreeObjectPaletteByTag - adds r0, r4, 0 - bl move_anim_task_del - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81732E4 - - thumb_func_start sub_817330C -sub_817330C: @ 817330C - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0 - bl sub_80A69CC - movs r0, 0x1E - strh r0, [r4, 0x2E] - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_80A5C6C - lsls r0, 24 - ldr r5, =0x0203841e - lsrs r0, 24 - ldrh r1, [r5, 0x4] - adds r0, r1 - strh r0, [r4, 0x32] - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x1 - bl sub_80A5C6C - lsls r0, 24 - lsrs r0, 24 - ldrh r5, [r5, 0x6] - adds r0, r5 - strh r0, [r4, 0x36] - ldr r0, =0x0000ffe0 - strh r0, [r4, 0x38] - adds r0, r4, 0 - bl sub_80A68D4 - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02038436 - 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, =sub_8039E84 - str r1, [r0] - ldr r0, =sub_817339C - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817330C - - thumb_func_start sub_817339C -sub_817339C: @ 817339C - push {lr} - adds r3, r0, 0 - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02038436 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x2B - ldrb r0, [r0] - cmp r0, 0x1 - bne _081733C0 - ldr r0, =sub_81733D4 - str r0, [r3, 0x1C] -_081733C0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_817339C - - thumb_func_start sub_81733D4 -sub_81733D4: @ 81733D4 - push {r4,lr} - adds r4, r0, 0 - bl sub_80A6900 - lsls r0, 24 - cmp r0, 0 - beq _081733F6 - movs r0, 0 - strh r0, [r4, 0x2E] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_8173400 - str r0, [r4, 0x1C] -_081733F6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81733D4 - - thumb_func_start sub_8173400 -sub_8173400: @ 8173400 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =0x02020630 - ldr r3, =0x020241e4 - ldr r2, =0x02038436 - ldrb r0, [r2] - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3F - ldrb r0, [r0] - lsls r0, 27 - cmp r0, 0 - bge _08173448 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - cmp r0, 0 - ble _08173448 - ldrb r0, [r2] - adds r0, r3 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0 - bl StartObjectImageAnim - adds r0, r4, 0 - bl move_anim_8072740 -_08173448: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173400 - - thumb_func_start sub_817345C -sub_817345C: @ 817345C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0203841e - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08173478 - cmp r0, 0x1 - beq _0817348C - b _081734A0 - .pool -_08173478: - movs r0, 0 - bl battle_get_side_with_given_state - ldr r1, =0x02038436 - strb r0, [r1] - movs r0, 0x1 - b _08173498 - .pool -_0817348C: - movs r0, 0x1 - bl battle_get_side_with_given_state - ldr r1, =0x02038436 - strb r0, [r1] - movs r0, 0 -_08173498: - bl battle_get_side_with_given_state - ldr r1, =0x02038437 - strb r0, [r1] -_081734A0: - adds r0, r4, 0 - bl move_anim_task_del - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817345C - - thumb_func_start sub_81734B4 -sub_81734B4: @ 81734B4 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrh r1, [r0] - cmp r1, 0x53 - bne _081734D4 - ldr r1, =0x0203841e - movs r0, 0x1 - b _0817350C - .pool -_081734D4: - cmp r1, 0xFA - bne _081734E4 - ldr r1, =0x0203841e - movs r0, 0x2 - b _0817350C - .pool -_081734E4: - cmp r1, 0x80 - bne _081734F4 - ldr r1, =0x0203841e - movs r0, 0x3 - b _0817350C - .pool -_081734F4: - movs r0, 0xA4 - lsls r0, 1 - cmp r1, r0 - bne _08173508 - ldr r1, =0x0203841e - movs r0, 0x4 - b _0817350C - .pool -_08173508: - ldr r1, =0x0203841e - movs r0, 0 -_0817350C: - strh r0, [r1] - adds r0, r2, 0 - bl move_anim_task_del - pop {r0} - bx r0 - .pool - thumb_func_end sub_81734B4 - - thumb_func_start sub_817351C -sub_817351C: @ 817351C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x02038436 - ldr r1, =0x020244d0 - ldr r2, [r1] - ldr r1, [r2, 0x8] - ldrh r1, [r1] - strb r1, [r3] - ldr r3, =0x02038437 - ldr r1, [r2, 0x8] - ldrh r1, [r1] - lsrs r1, 8 - strb r1, [r3] - bl move_anim_task_del - pop {r0} - bx r0 - .pool - thumb_func_end sub_817351C - - thumb_func_start sub_817354C -sub_817354C: @ 817354C - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_817354C - - thumb_func_start sub_8173560 -sub_8173560: @ 8173560 - push {lr} - bl RunTasks - bl RunTextPrinters - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_8173560 - - thumb_func_start sub_817357C -sub_817357C: @ 817357C - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x4 - bls _08173590 - b _08173688 -_08173590: - lsls r0, 2 - ldr r1, =_081735A4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081735A4: - .4byte _081735B8 - .4byte _081735E8 - .4byte _081735EE - .4byte _08173620 - .4byte _0817365C -_081735B8: - movs r0, 0 - bl SetVBlankCallback - bl sub_8174EC4 - ldr r4, =0x0203bcdc - ldr r0, =0x00002014 - bl AllocZeroed - str r0, [r4] - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - b _08173688 - .pool -_081735E8: - bl sub_8174F70 - b _08173642 -_081735EE: - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0xE2 - lsls r1, 3 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - bl sub_8174FAC - ldr r0, =0x0203bcdc - ldr r1, [r0] - movs r0, 0 - strh r0, [r1] - b _08173642 - .pool -_08173620: - bl sub_8175024 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _08173688 - ldr r0, =sub_817354C - bl SetVBlankCallback - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe -_08173642: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08173688 - .pool -_0817365C: - bl fade_and_return_progress_probably - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08173688 - ldr r0, =sub_8173560 - bl SetMainCallback2 - movs r0, 0xDA - lsls r0, 1 - bl song_play_for_text - movs r0, 0 - b _0817368A - .pool -_08173688: - movs r0, 0x1 -_0817368A: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_817357C - - thumb_func_start sub_8173694 -sub_8173694: @ 8173694 - push {r4,lr} - bl sub_817357C - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _081736C4 - ldr r0, =sub_817371C - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - ldr r4, =0x0203bcd8 - movs r0, 0x78 - bl AllocZeroed - str r0, [r4] -_081736C4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173694 - - thumb_func_start sub_81736D8 -sub_81736D8: @ 81736D8 - push {r4,lr} - bl sub_817357C - lsls r0, 24 - cmp r0, 0 - bne _08173708 - ldr r0, =sub_817371C - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0x1 - strh r0, [r1, 0x8] - ldr r4, =0x0203bcd8 - movs r0, 0x78 - bl AllocZeroed - str r0, [r4] -_08173708: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81736D8 - - thumb_func_start sub_817371C -sub_817371C: @ 817371C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =0x03005e00 - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0xC] - movs r7, 0 - ldr r0, =0x0203bcd8 - mov r9, r0 -_08173740: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r6, r1, r0 - adds r0, r6, 0 - movs r1, 0xB - bl pokemon_getattr - adds r5, r0, 0 - cmp r5, 0 - beq _0817380C - adds r0, r6, 0 - movs r1, 0x41 - bl pokemon_getattr - mov r1, r9 - ldr r3, [r1] - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 2 - adds r3, r4 - ldr r2, =0x000001ff - adds r1, r2, 0 - ands r0, r1 - ldrh r1, [r3, 0x8] - ldr r5, =0xfffffe00 - adds r2, r5, 0 - ands r1, r2 - orrs r1, r0 - strh r1, [r3, 0x8] - adds r0, r6, 0 - movs r1, 0x1 - bl pokemon_getattr - mov r2, r9 - ldr r1, [r2] - adds r1, r4 - str r0, [r1] - adds r0, r6, 0 - movs r1, 0 - bl pokemon_getattr - mov r5, r9 - ldr r1, [r5] - adds r1, 0x4 - adds r1, r4 - str r0, [r1] - adds r0, r6, 0 - movs r1, 0x38 - bl pokemon_getattr - ldr r2, [r5] - adds r2, r4 - lsls r0, 1 - ldrb r3, [r2, 0x9] - movs r1, 0x1 - ands r1, r3 - orrs r1, r0 - strb r1, [r2, 0x9] - adds r0, r6, 0 - movs r1, 0x2 - mov r2, sp - bl pokemon_getattr - movs r2, 0 - mov r6, r8 - lsls r5, r6, 2 - ldr r3, =0x0203bcd8 -_081737CA: - ldr r0, [r3] - adds r1, r2, r4 - adds r0, 0xA - adds r0, r1 - mov r6, sp - adds r1, r6, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x9 - bls _081737CA - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r5, r2 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0xC] - adds r0, 0x1 - strh r0, [r1, 0xC] - b _08173840 - .pool -_0817380C: - mov r6, r9 - ldr r3, [r6] - lsls r2, r7, 2 - adds r2, r7 - lsls r2, 2 - adds r4, r3, r2 - ldrh r0, [r4, 0x8] - ldr r6, =0xfffffe00 - adds r1, r6, 0 - ands r0, r1 - strh r0, [r4, 0x8] - str r5, [r4] - adds r3, 0x4 - adds r3, r2 - str r5, [r3] - ldrb r1, [r4, 0x9] - movs r0, 0x1 - ands r0, r1 - strb r0, [r4, 0x9] - mov r1, r9 - ldr r0, [r1] - adds r0, r2 - movs r1, 0xFF - strb r1, [r0, 0xA] - mov r2, r8 - lsls r5, r2, 2 -_08173840: - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, 0x5 - bhi _0817384C - b _08173740 -_0817384C: - ldr r0, =0x0203bcd4 - movs r3, 0 - str r3, [r0] - ldr r4, =0x03005e00 - mov r6, r8 - adds r1, r5, r6 - lsls r1, 3 - adds r2, r1, r4 - strh r3, [r2, 0xA] - movs r0, 0xFF - strh r0, [r2, 0x10] - movs r7, 0 - adds r3, r4, 0 - adds r3, 0x8 - movs r2, 0xFF -_0817386A: - adds r0, r7, 0x5 - lsls r0, 1 - adds r0, r1 - adds r0, r3 - strh r2, [r0] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, 0x5 - bls _0817386A - mov r1, r8 - adds r0, r5, r1 - lsls r0, 3 - adds r1, r0, r4 - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _081738A4 - ldr r0, =sub_8173A8C - b _081738A6 - .pool -_081738A4: - ldr r0, =sub_81738BC -_081738A6: - str r0, [r1] - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817371C - - thumb_func_start sub_81738BC -sub_81738BC: @ 81738BC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r7, =0x0201c000 - ldr r0, =0x0203bce4 - ldrb r0, [r0] - cmp r0, 0 - bne _081738EC - movs r2, 0x80 - lsls r2, 6 - adds r0, r7, 0 - movs r1, 0 - bl memset - b _08173906 - .pool -_081738EC: - movs r0, 0x3 - bl sub_81534D0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08173906 - movs r2, 0x80 - lsls r2, 6 - adds r0, r7, 0 - movs r1, 0 - bl memset -_08173906: - movs r5, 0 - ldrh r1, [r7, 0x8] - ldr r2, =0x000001ff - adds r0, r2, 0 - ands r0, r1 - mov r1, r9 - lsls r1, 2 - mov r8, r1 - cmp r0, 0 - beq _08173930 -_0817391A: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r7, 0x78 - cmp r5, 0x31 - bhi _08173934 - ldrh r1, [r7, 0x8] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _0817391A -_08173930: - cmp r5, 0x31 - bls _08173956 -_08173934: - ldr r4, =0x0201c000 - adds r6, r4, 0 - adds r4, 0x78 - movs r5, 0 - subs r7, 0x78 -_0817393E: - adds r0, r6, 0 - adds r1, r4, 0 - movs r2, 0x78 - bl memcpy - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r6, 0x78 - adds r4, 0x78 - cmp r5, 0x30 - bls _0817393E -_08173956: - ldr r0, =0x0203bcd8 - ldr r1, [r0] - adds r0, r7, 0 - movs r2, 0x78 - bl memcpy - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - ldr r2, =gUnknown_082C8959 - 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, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParametrized - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r1, =0x03005e00 - mov r0, r8 - add r0, r9 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81739C4 - str r1, [r0] - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81738BC - - thumb_func_start sub_81739C4 -sub_81739C4: @ 81739C4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03006214 - ldr r0, =sub_81736D8 - str r0, [r1] - movs r0, 0x3 - bl save_game_when_memory_present - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _08173A34 - ldr r0, =0x030061fc - ldr r0, [r0] - cmp r0, 0 - beq _08173A34 - movs r0, 0x1 - bl UnsetBgTilemapBuffer - movs r0, 0x3 - bl UnsetBgTilemapBuffer - bl FreeAllWindowBuffers - ldr r5, =0x0203bcdc - ldr r0, [r5] - cmp r0, 0 - beq _08173A06 - bl Free - movs r0, 0 - str r0, [r5] -_08173A06: - ldr r5, =0x0203bcd8 - ldr r0, [r5] - cmp r0, 0 - beq _08173A16 - bl Free - movs r0, 0 - str r0, [r5] -_08173A16: - adds r0, r4, 0 - bl DestroyTask - b _08173A4C - .pool -_08173A34: - movs r0, 0x37 - bl audio_play - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8173A5C - str r1, [r0] - movs r1, 0x20 - strh r1, [r0, 0xE] -_08173A4C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81739C4 - - thumb_func_start sub_8173A5C -sub_8173A5C: @ 8173A5C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrh r2, [r1, 0xE] - movs r3, 0xE - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _08173A80 - subs r0, r2, 0x1 - strh r0, [r1, 0xE] - b _08173A84 - .pool -_08173A80: - ldr r0, =sub_8173A8C - str r0, [r1] -_08173A84: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173A5C - - thumb_func_start sub_8173A8C -sub_8173A8C: @ 8173A8C - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =sub_8173AA8 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8173A8C - - thumb_func_start sub_8173AA8 -sub_8173AA8: @ 8173AA8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =0x03005e00 - mov r2, r8 - lsls r1, r2, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - ldrh r6, [r1, 0xA] - ldr r2, =0x0203bcd8 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 2 - ldr r2, [r2] - adds r7, r2, r0 - movs r2, 0xC - ldrsh r0, [r1, r2] - cmp r0, 0x3 - ble _08173AEC - ldr r1, =gUnknown_085E53B4 - b _08173AEE - .pool -_08173AEC: - ldr r1, =gUnknown_085E53E4 -_08173AEE: - lsls r2, r6, 3 - adds r0, r2, r1 - ldrh r3, [r0] - adds r0, r1, 0x2 - adds r0, r2, r0 - ldrh r4, [r0] - adds r0, r1, 0x4 - adds r0, r2, r0 - ldrh r0, [r0] - mov r9, r0 - adds r1, 0x6 - adds r2, r1 - ldrh r5, [r2] - ldrh r2, [r7, 0x8] - ldr r0, =0x000001ff - ands r0, r2 - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _08173B20 - lsls r0, r5, 16 - movs r1, 0xA0 - lsls r1, 12 - adds r0, r1 - lsrs r5, r0, 16 -_08173B20: - lsls r0, r2, 23 - lsrs r0, 23 - ldr r1, [r7] - ldr r2, [r7, 0x4] - lsls r3, 16 - asrs r3, 16 - str r3, [sp] - lsls r3, r4, 16 - asrs r3, 16 - str r3, [sp, 0x4] - lsls r3, r6, 24 - lsrs r3, 24 - str r3, [sp, 0x8] - ldr r3, =0x0000ffff - str r3, [sp, 0xC] - movs r3, 0x1 - bl sub_818D3E4 - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x02020630 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r3, r2, r4 - movs r1, 0 - mov r12, r1 - mov r1, r9 - strh r1, [r3, 0x30] - strh r5, [r3, 0x32] - mov r1, r12 - strh r1, [r3, 0x2E] - ldrh r1, [r7, 0x8] - lsls r1, 23 - lsrs r1, 23 - strh r1, [r3, 0x3C] - adds r4, 0x1C - adds r2, r4 - ldr r1, =sub_8175120 - str r1, [r2] - ldr r5, =0x03005e00 - adds r1, r6, 0x5 - lsls r1, 1 - mov r2, r8 - lsls r4, r2, 2 - add r4, r8 - lsls r4, 3 - adds r1, r4 - adds r2, r5, 0 - adds r2, 0x8 - adds r1, r2 - strh r0, [r1] - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - adds r4, r5 - ldr r0, =sub_8173BC0 - str r0, [r4] - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173AA8 - - thumb_func_start sub_8173BC0 -sub_8173BC0: @ 8173BC0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x03005e00 - lsls r3, r0, 2 - adds r3, r0 - lsls r3, 3 - adds r5, r3, r4 - ldrh r0, [r5, 0xA] - ldr r2, =0x0203bcd8 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - ldr r2, [r2] - adds r2, r1 - adds r0, 0x5 - lsls r0, 1 - adds r0, r3 - adds r4, 0x8 - adds r0, r4 - movs r3, 0 - ldrsh r1, [r0, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r3, r0, r1 - ldr r1, [r3, 0x1C] - ldr r0, =DummyObjectCallback - cmp r1, r0 - bne _08173C1A - ldrb r1, [r3, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - strb r0, [r3, 0x1] - adds r0, r2, 0 - movs r1, 0 - movs r2, 0xE - bl sub_8174A88 - movs r0, 0x78 - strh r0, [r5, 0xE] - ldr r0, =sub_8173C34 - str r0, [r5] -_08173C1A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173BC0 - - thumb_func_start sub_8173C34 -sub_8173C34: @ 8173C34 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r6, r0, 3 - adds r4, r6, r2 - ldrh r3, [r4, 0xA] - ldr r1, =0x0203bcd8 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 2 - ldr r1, [r1] - adds r1, r0 - mov r9, r1 - ldrh r1, [r4, 0xE] - movs r7, 0xE - ldrsh r0, [r4, r7] - mov r12, r2 - cmp r0, 0 - beq _08173C78 - subs r0, r1, 0x1 - strh r0, [r4, 0xE] - b _08173D10 - .pool -_08173C78: - ldr r2, =0x0203bcd4 - ldr r0, =0x02020630 - mov r8, r0 - adds r0, r3, 0x5 - lsls r0, 1 - adds r0, r6 - mov r1, r12 - adds r1, 0x8 - adds r6, r0, r1 - movs r7, 0 - ldrsh r1, [r6, r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - movs r1, 0x80 - lsls r1, 9 - lsls r1, r0 - ldr r3, [r2] - orrs r3, r1 - str r3, [r2] - ldrh r2, [r4, 0xA] - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bgt _08173D04 - mov r7, r9 - ldrh r1, [r7, 0x1C] - ldr r0, =0x000001ff - ands r0, r1 - cmp r0, 0 - beq _08173D04 - adds r0, r2, 0x1 - strh r0, [r4, 0xA] - ldr r0, =0x000063b0 - str r0, [sp] - adds r0, r3, 0 - movs r1, 0 - movs r2, 0xC - movs r3, 0xC - bl pal_fade_maybe - movs r0, 0 - ldrsh r1, [r6, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0, 0x5] - ldr r0, =sub_8173AA8 - str r0, [r4] - b _08173D10 - .pool -_08173D04: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - add r0, r12 - ldr r1, =sub_8173D24 - str r1, [r0] -_08173D10: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173C34 - - thumb_func_start sub_8173D24 -sub_8173D24: @ 8173D24 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0xffff0000 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0 - bl pal_fade_maybe - movs r3, 0 - lsls r1, r4, 2 - adds r0, r1, r4 - lsls r5, r0, 3 - ldr r0, =0x03005e08 - mov r12, r0 - mov r8, r1 - ldr r6, =0x02020630 - movs r7, 0xD - negs r7, r7 -_08173D52: - adds r0, r3, 0x5 - lsls r0, 1 - adds r0, r5 - mov r2, r12 - adds r1, r0, r2 - movs r2, 0 - ldrsh r0, [r1, r2] - cmp r0, 0xFF - beq _08173D74 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r2, [r1, 0x5] - adds r0, r7, 0 - ands r0, r2 - strb r0, [r1, 0x5] -_08173D74: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x5 - bls _08173D52 - movs r0, 0 - movs r1, 0xF - bl sub_8174A38 - movs r0, 0x69 - bl audio_play - ldr r1, =0x03005e00 - mov r2, r8 - adds r0, r2, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0xC8 - lsls r1, 1 - strh r1, [r0, 0xE] - ldr r1, =sub_8173DC0 - str r1, [r0] - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173D24 - - thumb_func_start sub_8173DC0 -sub_8173DC0: @ 8173DC0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r7, =0x03005e00 - lsls r4, r6, 2 - adds r0, r4, r6 - lsls r5, r0, 3 - adds r1, r5, r7 - ldrh r2, [r1, 0xE] - movs r3, 0xE - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _08173E04 - subs r2, 0x1 - strh r2, [r1, 0xE] - movs r0, 0x3 - ands r0, r2 - cmp r0, 0 - bne _08173E7E - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, 0x6E - ble _08173E7E - bl sub_81751FC - b _08173E7E - .pool -_08173E04: - movs r3, 0 - mov r9, r4 - ldr r0, =0x0203bcd4 - mov r10, r0 - adds r4, r5, 0 - adds r7, 0x8 - mov r8, r7 - ldr r7, =0x02020630 - movs r1, 0xD - negs r1, r1 - mov r12, r1 - movs r5, 0x4 -_08173E1C: - adds r0, r3, 0x5 - lsls r0, 1 - adds r0, r4 - mov r2, r8 - adds r1, r0, r2 - movs r2, 0 - ldrsh r0, [r1, r2] - cmp r0, 0xFF - beq _08173E40 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - ldrb r2, [r1, 0x5] - mov r0, r12 - ands r0, r2 - orrs r0, r5 - strb r0, [r1, 0x5] -_08173E40: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x5 - bls _08173E1C - mov r3, r10 - ldr r0, [r3] - ldr r1, =0x000063b0 - str r1, [sp] - movs r1, 0 - movs r2, 0xC - movs r3, 0xC - bl pal_fade_maybe - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r1, =0x03005e00 - mov r2, r9 - adds r0, r2, r6 - lsls r0, 3 - adds r0, r1 - movs r1, 0x7 - strh r1, [r0, 0xE] - ldr r1, =sub_8173EA4 - str r1, [r0] -_08173E7E: - 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_8173DC0 - - thumb_func_start sub_8173EA4 -sub_8173EA4: @ 8173EA4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrh r2, [r1, 0xE] - movs r3, 0xE - ldrsh r0, [r1, r3] - cmp r0, 0xF - ble _08173ECC - ldr r0, =sub_8173EE4 - str r0, [r1] - b _08173EDE - .pool -_08173ECC: - adds r0, r2, 0x1 - strh r0, [r1, 0xE] - movs r0, 0xE - ldrsh r1, [r1, r0] - lsls r1, 24 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg -_08173EDE: - pop {r0} - bx r0 - thumb_func_end sub_8173EA4 - - thumb_func_start sub_8173EE4 -sub_8173EE4: @ 8173EE4 - push {r4-r6,lr} - sub sp, 0x8 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x3 - bl ShowBg - ldr r6, =0x03005d90 - ldr r0, [r6] - ldrb r0, [r0, 0x8] - movs r1, 0x1 - bl sub_818D97C - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - str r1, [sp] - ldr r1, =0x0000ffff - str r1, [sp, 0x4] - movs r1, 0x1 - movs r2, 0x78 - movs r3, 0x48 - bl sub_818D8AC - ldr r1, =0x03005e00 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r1 - strh r0, [r4, 0x10] - ldr r0, =gUnknown_085E5380 - bl AddWindow - ldr r0, [r6] - ldrb r1, [r0, 0x14] - lsrs r1, 3 - ldr r2, =0x0000021d - movs r0, 0x1 - movs r3, 0xD0 - bl sub_80987D4 - movs r0, 0x1 - bl stdpal_get - movs r1, 0xE0 - movs r2, 0x20 - bl gpu_pal_apply - movs r0, 0x78 - strh r0, [r4, 0xE] - ldr r0, =sub_8173F84 - str r0, [r4] - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173EE4 - - thumb_func_start sub_8173F84 -sub_8173F84: @ 8173F84 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0xE] - movs r1, 0xE - ldrsh r5, [r4, r1] - cmp r5, 0 - beq _08173FAC - subs r0, 0x1 - strh r0, [r4, 0xE] - b _08174018 - .pool -_08173FAC: - ldr r2, =0x02020630 - movs r3, 0x10 - ldrsh r1, [r4, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - ldrh r2, [r1, 0x20] - movs r3, 0x20 - ldrsh r0, [r1, r3] - cmp r0, 0xC0 - beq _08173FD0 - adds r0, r2, 0x1 - strh r0, [r1, 0x20] - b _08174018 - .pool -_08173FD0: - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0x1 - movs r1, 0x2 - bl sub_8174C98 - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - ldr r2, =gUnknown_085E8C14 - str r5, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParametrized - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =sub_8174028 - str r0, [r4] -_08174018: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173F84 - - thumb_func_start sub_8174028 -sub_8174028: @ 8174028 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0817404E - movs r0, 0x4 - bl play_sound_effect - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8174060 - str r0, [r1] -_0817404E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174028 - - thumb_func_start sub_8174060 -sub_8174060: @ 8174060 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x02037b14 - ldr r1, =0x02037714 - movs r2, 0x80 - lsls r2, 2 - bl CpuSet - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r1, 0x8 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81740B0 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174060 - - thumb_func_start sub_81740B0 -sub_81740B0: @ 81740B0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08174164 - lsls r0, r7, 2 - mov r8, r0 - ldr r1, =0x03005e00 - adds r0, r7 - lsls r0, 3 - adds r1, 0x12 - adds r5, r0, r1 - ldr r2, =0x02020630 - mov r9, r2 - movs r6, 0x5 -_081740DC: - ldrb r4, [r5] - cmp r4, 0xFF - beq _081740FA - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - add r0, r9 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - adds r0, r4, 0 - bl sub_818D820 -_081740FA: - adds r5, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _081740DC - ldr r0, =0x03005e00 - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x10] - bl sub_818D8F0 - movs r0, 0 - bl HideBg - movs r0, 0x1 - bl HideBg - movs r0, 0x3 - bl HideBg - bl FreeAllWindowBuffers - movs r0, 0x1 - bl UnsetBgTilemapBuffer - movs r0, 0x3 - bl UnsetBgTilemapBuffer - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - adds r0, r7, 0 - bl DestroyTask - ldr r4, =0x0203bcdc - ldr r0, [r4] - cmp r0, 0 - beq _08174150 - bl Free - movs r0, 0 - str r0, [r4] -_08174150: - ldr r4, =0x0203bcd8 - ldr r0, [r4] - cmp r0, 0 - beq _08174160 - bl Free - movs r0, 0 - str r0, [r4] -_08174160: - bl sub_8174184 -_08174164: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81740B0 - - thumb_func_start sub_8174184 -sub_8174184: @ 8174184 - push {lr} - ldr r0, =sub_8175620 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174184 - - thumb_func_start sub_8174194 -sub_8174194: @ 8174194 - push {r4,lr} - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x5 - bhi _081741D0 - lsls r0, 2 - ldr r1, =_081741B8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081741B8: - .4byte _081741D0 - .4byte _08174200 - .4byte _08174214 - .4byte _08174240 - .4byte _08174280 - .4byte _081742B0 -_081741D0: - movs r0, 0 - bl SetVBlankCallback - bl sub_8174EC4 - ldr r4, =0x0203bcdc - ldr r0, =0x00002014 - bl AllocZeroed - str r0, [r4] - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0] - b _08174308 - .pool -_08174200: - bl sub_8174F70 - ldr r1, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _081742A2 - .pool -_08174214: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - bl sub_8174FAC - ldr r1, =0x030022c0 - movs r4, 0x87 - lsls r4, 3 - adds r1, r4 - b _081742A2 - .pool -_08174240: - bl sub_8175024 - lsls r0, 24 - cmp r0, 0 - bne _08174308 - ldr r1, =0x0201c000 - ldr r0, =gUnknown_085E56D4 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2,r3} - stm r1!, {r2,r3} - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl sub_80F9BCC - ldr r0, =sub_817354C - bl SetVBlankCallback - ldr r1, =0x030022c0 - movs r4, 0x87 - lsls r4, 3 - adds r1, r4 - b _081742A2 - .pool -_08174280: - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - bl sub_80F9C1C - lsls r0, 24 - cmp r0, 0 - bne _08174308 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 -_081742A2: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08174308 - .pool -_081742B0: - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0xE2 - lsls r1, 3 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - ldr r0, =sub_8174324 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - movs r2, 0 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r4, =0x03005e08 - movs r3, 0xFF -_081742E2: - adds r0, r2, 0x5 - lsls r0, 1 - adds r0, r1 - adds r0, r4 - strh r3, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _081742E2 - ldr r4, =0x0203bcd8 - movs r0, 0x80 - lsls r0, 6 - bl AllocZeroed - str r0, [r4] - ldr r0, =sub_8173560 - bl SetMainCallback2 -_08174308: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174194 - - thumb_func_start sub_8174324 -sub_8174324: @ 8174324 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x00000226 - str r0, [sp] - movs r0, 0 - movs r1, 0x1E - movs r2, 0 - movs r3, 0xC - bl sub_81980F0 - movs r0, 0x3 - bl sub_81534D0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08174364 - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81749A0 - b _081743DA - .pool -_08174364: - ldr r0, =0x0201c000 - ldr r4, =0x0203bcd8 - ldr r1, [r4] - movs r2, 0x80 - lsls r2, 5 - bl CpuSet - ldr r4, [r4] - movs r2, 0 - ldrh r1, [r4, 0x8] - ldr r3, =0x000001ff - adds r0, r3, 0 - ands r0, r1 - lsls r5, r6, 2 - cmp r0, 0 - beq _0817439A -_08174384: - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - adds r4, 0x78 - cmp r2, 0x31 - bhi _081743BC - ldrh r1, [r4, 0x8] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _08174384 -_0817439A: - cmp r2, 0x31 - bhi _081743BC - ldr r0, =0x03005e00 - adds r1, r5, r6 - lsls r1, 3 - adds r1, r0 - subs r0, r2, 0x1 - b _081743C6 - .pool -_081743BC: - ldr r0, =0x03005e00 - adds r1, r5, r6 - lsls r1, 3 - adds r1, r0 - movs r0, 0x31 -_081743C6: - strh r0, [r1, 0x8] - movs r0, 0xA - bl sub_80847F8 - ldr r2, =0x03005e00 - adds r1, r5, r6 - lsls r1, 3 - adds r1, r2 - strh r0, [r1, 0xA] - ldr r0, =sub_81743EC -_081743DA: - str r0, [r1] - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174324 - - thumb_func_start sub_81743EC -sub_81743EC: @ 81743EC - 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 - mov r8, r0 - ldr r0, =0x0203bcd8 - ldr r3, [r0] - movs r5, 0 - ldr r1, =0x03005e00 - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r4, 0x8 - ldrsh r0, [r0, r4] - adds r4, r1, 0 - ldr r2, =0x0203bcd4 - cmp r5, r0 - bge _0817442A - adds r1, r0, 0 -_0817441E: - adds r3, 0x78 - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, r1 - blt _0817441E -_0817442A: - adds r6, r3, 0 - movs r0, 0 - str r0, [r2] - mov r5, r8 - lsls r2, r5, 2 - adds r1, r2, r5 - lsls r1, 3 - adds r1, r4 - strh r0, [r1, 0xC] - strh r0, [r1, 0x10] - movs r5, 0 - str r2, [sp, 0x14] - ldr r4, =0x000001ff - adds r2, r1, 0 -_08174446: - ldrh r1, [r6, 0x8] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _08174456 - ldrh r0, [r2, 0x10] - adds r0, 0x1 - strh r0, [r2, 0x10] -_08174456: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r6, 0x14 - cmp r5, 0x5 - bls _08174446 - adds r6, r3, 0 - movs r5, 0 - ldr r1, =0x03005e00 - ldr r0, [sp, 0x14] - add r0, r8 - lsls r0, 3 - mov r9, r0 - adds r0, r1 - str r0, [sp, 0x10] - ldr r1, =0x000001ff - mov r10, r1 -_08174478: - ldrh r0, [r6, 0x8] - mov r1, r10 - ands r1, r0 - adds r7, r0, 0 - cmp r1, 0 - beq _08174540 - ldr r2, [sp, 0x10] - movs r4, 0x10 - ldrsh r0, [r2, r4] - cmp r0, 0x3 - ble _081744B8 - lsls r1, r5, 3 - ldr r0, =gUnknown_085E53B4 - adds r0, 0x4 - adds r0, r1, r0 - ldrh r3, [r0] - ldr r0, =gUnknown_085E53BA - adds r1, r0 - ldrh r4, [r1] - b _081744C8 - .pool -_081744B8: - ldr r0, =gUnknown_085E53E4 - lsls r2, r5, 3 - adds r1, r0, 0x4 - adds r1, r2, r1 - ldrh r3, [r1] - adds r0, 0x6 - adds r2, r0 - ldrh r4, [r2] -_081744C8: - mov r1, r10 - ands r1, r7 - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - bne _081744DE - lsls r0, r4, 16 - movs r1, 0xA0 - lsls r1, 12 - adds r0, r1 - lsrs r4, r0, 16 -_081744DE: - lsls r0, r7, 23 - lsrs r0, 23 - ldr r1, [r6] - ldr r2, [r6, 0x4] - lsls r3, 16 - asrs r3, 16 - str r3, [sp] - lsls r3, r4, 16 - asrs r3, 16 - str r3, [sp, 0x4] - lsls r3, r5, 24 - lsrs r3, 24 - str r3, [sp, 0x8] - ldr r3, =0x0000ffff - str r3, [sp, 0xC] - movs r3, 0x1 - bl sub_818D7D8 - lsls r0, 16 - lsrs r0, 16 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r3, [r1, 0x5] - movs r4, 0xD - negs r4, r4 - adds r2, r4, 0 - ands r3, r2 - movs r2, 0x4 - orrs r3, r2 - strb r3, [r1, 0x5] - adds r1, r5, 0x5 - lsls r1, 1 - add r1, r9 - ldr r2, =0x03005e08 - adds r1, r2 - strh r0, [r1] - b _0817454E - .pool -_08174540: - adds r0, r5, 0x5 - lsls r0, 1 - add r0, r9 - ldr r4, =0x03005e08 - adds r0, r4 - movs r1, 0xFF - strh r1, [r0] -_0817454E: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r6, 0x14 - cmp r5, 0x5 - bls _08174478 - ldr r0, =0xffff0000 - ldr r2, =0x000063b0 - movs r1, 0xC - bl sub_80A2A20 - ldr r0, =0x02021cc4 - ldr r1, =0x03005e00 - ldr r4, [sp, 0x14] - add r4, r8 - lsls r4, 3 - adds r4, r1 - movs r5, 0xA - ldrsh r1, [r4, r5] - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r5, =0x02021fc4 - ldr r1, =gUnknown_085E8C00 - adds r0, r5, 0 - bl ExpandStringRefs - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bgt _081745C0 - ldr r1, =gUnknown_085E8574 - movs r0, 0x1 - str r0, [sp] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0 - bl sub_8198204 - b _081745D0 - .pool -_081745C0: - ldr r1, =gUnknown_085E855C - movs r0, 0x1 - str r0, [sp] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0 - bl sub_8198204 -_081745D0: - ldr r0, =0x03005e00 - ldr r1, [sp, 0x14] - add r1, r8 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81745FC - str r0, [r1] - 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_81743EC - - thumb_func_start sub_81745FC -sub_81745FC: @ 81745FC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0203bcd8 - ldr r5, [r0] - movs r3, 0 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - cmp r3, r0 - bge _08174630 - adds r1, r0, 0 -_08174624: - adds r5, 0x78 - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r1 - blt _08174624 -_08174630: - movs r3, 0 - lsls r7, r4, 2 - adds r0, r7, r4 - lsls r6, r0, 3 - ldr r0, =0x03005e08 - mov r10, r0 - ldr r1, =0x02020630 - mov r8, r1 - movs r2, 0xD - negs r2, r2 - mov r9, r2 - movs r0, 0x4 - mov r12, r0 -_0817464A: - adds r0, r3, 0x5 - lsls r0, 1 - adds r0, r6 - add r0, r10 - ldrh r1, [r0] - cmp r1, 0xFF - beq _0817466C - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldrb r2, [r0, 0x5] - mov r1, r9 - ands r1, r2 - mov r2, r12 - orrs r1, r2 - strb r1, [r0, 0x5] -_0817466C: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x5 - bls _0817464A - adds r1, r7, r4 - lsls r1, 3 - ldr r0, =0x03005e00 - adds r6, r1, r0 - movs r2, 0xC - ldrsh r0, [r6, r2] - adds r0, 0x5 - lsls r0, 1 - adds r0, r1 - ldr r1, =0x03005e00 - adds r1, 0x8 - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - strb r1, [r0, 0x5] - lsrs r1, 4 - movs r0, 0x80 - lsls r0, 9 - lsls r0, r1 - ldr r1, =0xffff0000 - eors r0, r1 - ldr r2, =0x0203bcd4 - str r0, [r2] - ldr r2, =0x000063b0 - movs r1, 0xC - bl sub_80A2A5C - movs r0, 0xC - ldrsh r1, [r6, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r4, r5, r0 - ldrh r1, [r4, 0x8] - ldr r0, =0x000001ff - ands r0, r1 - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _081746E6 - bl sub_80A369C - ldrh r0, [r4, 0x8] - lsls r0, 23 - lsrs r0, 23 - movs r1, 0 - bl cry_related -_081746E6: - adds r0, r4, 0 - movs r1, 0 - movs r2, 0xE - bl sub_8174A88 - ldr r0, =sub_8174728 - 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_81745FC - - thumb_func_start sub_8174728 -sub_8174728: @ 8174728 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x030022c0 - ldrh r2, [r1, 0x2E] - movs r0, 0x1 - ands r0, r2 - adds r3, r1, 0 - cmp r0, 0 - beq _081747E4 - ldr r0, =0x03005e00 - mov r12, r0 - lsls r0, r6, 2 - adds r1, r0, r6 - lsls r3, r1, 3 - mov r1, r12 - adds r4, r3, r1 - ldrh r2, [r4, 0x8] - movs r5, 0x8 - ldrsh r1, [r4, r5] - mov r9, r0 - cmp r1, 0 - beq _081747B8 - subs r0, r2, 0x1 - strh r0, [r4, 0x8] - movs r5, 0 - adds r7, r3, 0 - movs r0, 0x8 - add r0, r12 - mov r8, r0 -_0817476A: - adds r0, r5, 0x5 - lsls r0, 1 - adds r0, r7 - mov r1, r8 - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0xFF - beq _08174782 - bl sub_818D820 - movs r0, 0xFF - strh r0, [r4] -_08174782: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x5 - bls _0817476A - ldr r0, =0x03005e00 - mov r2, r9 - adds r1, r2, r6 - lsls r1, 3 - adds r1, r0 - ldrh r2, [r1, 0xA] - movs r3, 0xA - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _081747A4 - subs r0, r2, 0x1 - strh r0, [r1, 0xA] -_081747A4: - ldr r0, =sub_81743EC - str r0, [r1] - b _08174884 - .pool -_081747B8: - bl sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - beq _081747D2 - bl sub_80A369C - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl -_081747D2: - ldr r0, =sub_8174898 - str r0, [r4] - b _08174884 - .pool -_081747E4: - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - beq _08174828 - bl sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - beq _08174806 - bl sub_80A369C - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl -_08174806: - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8174898 - str r0, [r1] - b _08174884 - .pool -_08174828: - movs r0, 0x40 - ands r0, r2 - cmp r0, 0 - beq _08174858 - ldr r0, =0x03005e00 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldrh r2, [r1, 0xC] - movs r4, 0xC - ldrsh r0, [r1, r4] - cmp r0, 0 - beq _08174858 - subs r0, r2, 0x1 - strh r0, [r1, 0xC] - ldr r0, =sub_81745FC - str r0, [r1] - b _08174884 - .pool -_08174858: - ldrh r1, [r3, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08174884 - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r2, r0, r1 - movs r5, 0xC - ldrsh r1, [r2, r5] - movs r3, 0x10 - ldrsh r0, [r2, r3] - subs r0, 0x1 - cmp r1, r0 - bge _08174884 - ldrh r0, [r2, 0xC] - adds r0, 0x1 - strh r0, [r2, 0xC] - ldr r0, =sub_81745FC - str r0, [r2] -_08174884: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174728 - - thumb_func_start sub_8174898 -sub_8174898: @ 8174898 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =0x02037b14 - ldr r1, =0x02037714 - movs r2, 0x80 - lsls r2, 2 - bl CpuSet - ldr r1, =0x0201c000 - ldr r0, =gUnknown_085E56D4 - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r3} - stm r1!, {r2,r3} - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl sub_80F9BF4 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81748F0 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174898 - - thumb_func_start sub_81748F0 -sub_81748F0: @ 81748F0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - bl sub_80F9C30 - lsls r0, 24 - cmp r0, 0 - bne _08174988 - movs r5, 0 - lsls r0, r6, 2 - adds r0, r6 - lsls r7, r0, 3 - ldr r0, =0x03005e08 - mov r8, r0 -_08174910: - adds r0, r5, 0x5 - lsls r0, 1 - adds r0, r7 - mov r1, r8 - adds r4, r0, r1 - ldrh r0, [r4] - cmp r0, 0xFF - beq _08174928 - bl sub_818D820 - movs r0, 0xFF - strh r0, [r4] -_08174928: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _08174910 - movs r0, 0 - bl HideBg - movs r0, 0x1 - bl HideBg - movs r0, 0x3 - bl HideBg - bl sub_8198314 - bl FreeAllWindowBuffers - movs r0, 0x1 - bl UnsetBgTilemapBuffer - movs r0, 0x3 - bl UnsetBgTilemapBuffer - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - adds r0, r6, 0 - bl DestroyTask - ldr r4, =0x0203bcdc - ldr r0, [r4] - cmp r0, 0 - beq _08174974 - bl Free - movs r0, 0 - str r0, [r4] -_08174974: - ldr r4, =0x0203bcd8 - ldr r0, [r4] - cmp r0, 0 - beq _08174984 - bl Free - movs r0, 0 - str r0, [r4] -_08174984: - bl sub_8137C3C -_08174988: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81748F0 - - thumb_func_start sub_81749A0 -sub_81749A0: @ 81749A0 - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_085E8588 - movs r1, 0x8 - movs r2, 0x1 - bl sub_8198180 - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - ldr r2, =gUnknown_085E8BDC - 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, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParametrized - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8174A08 - str r1, [r0] - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81749A0 - - thumb_func_start sub_8174A08 -sub_8174A08: @ 8174A08 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08174A28 - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8174898 - str r0, [r1] -_08174A28: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174A08 - - thumb_func_start sub_8174A38 -sub_8174A38: @ 8174A38 - push {r4,lr} - sub sp, 0xC - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - bl PutWindowTilemap - ldr r4, =gUnknown_085E8B3E - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xD0 - bl GetStringCenterAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_085E5388 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x1 - bl box_print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174A38 - - thumb_func_start sub_8174A88 -sub_8174A88: @ 8174A88 - push {r4-r7,lr} - sub sp, 0x2C - adds r7, r0, 0 - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - bl PutWindowTilemap - ldrh r0, [r7, 0x8] - ldr r1, =0x000001ff - ands r1, r0 - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - beq _08174B30 - ldr r1, =gUnknown_085E8C36 - add r0, sp, 0xC - bl CopyString - adds r6, r0, 0 - ldrh r0, [r7, 0x8] - lsls r0, 23 - lsrs r0, 23 - bl sub_806E3C0 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x0000ffff - cmp r4, r0 - beq _08174B04 - adds r0, r4, 0 - movs r1, 0x64 - bl __divsi3 - subs r0, 0x5F - strb r0, [r6] - adds r6, 0x1 - adds r0, r4, 0 - movs r1, 0x64 - bl __modsi3 - adds r4, r0, 0 - movs r1, 0xA - bl __divsi3 - subs r0, 0x5F - strb r0, [r6] - adds r6, 0x1 - adds r0, r4, 0 - movs r1, 0xA - bl __modsi3 - subs r0, 0x5F - b _08174B0E - .pool -_08174B04: - movs r0, 0xAC - strb r0, [r6] - adds r6, 0x1 - strb r0, [r6] - adds r6, 0x1 -_08174B0E: - strb r0, [r6] - adds r6, 0x1 - movs r0, 0xFF - strb r0, [r6] - ldr r0, =gUnknown_085E5388 - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0x1 - bl box_print -_08174B30: - adds r1, r7, 0 - adds r1, 0xA - add r0, sp, 0xC - movs r2, 0xA - bl memcpy - add r1, sp, 0xC - movs r0, 0xFF - strb r0, [r1, 0xA] - ldrh r1, [r7, 0x8] - ldr r4, =0x000001ff - adds r0, r4, 0 - ands r0, r1 - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _08174B8C - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0xD0 - bl GetStringCenterAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - ldr r0, =gUnknown_085E5388 - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - b _08174C82 - .pool -_08174B8C: - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0x80 - bl GetStringRightAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - ldr r0, =gUnknown_085E5388 - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - add r1, sp, 0xC - movs r0, 0xBA - strb r0, [r1] - mov r0, sp - adds r0, 0xD - ldrh r1, [r7, 0x8] - lsls r1, 23 - lsrs r1, 23 - movs r2, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl CopyString - adds r6, r0, 0 - ldrh r1, [r7, 0x8] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x20 - beq _08174C0A - cmp r0, 0x1D - beq _08174C0A - lsls r0, r1, 23 - lsrs r0, 23 - ldr r1, [r7, 0x4] - bl pokemon_species_get_gender_info - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _08174C00 - cmp r0, 0xFE - beq _08174C04 - b _08174C0A - .pool -_08174C00: - movs r0, 0xB5 - b _08174C06 -_08174C04: - movs r0, 0xB6 -_08174C06: - strb r0, [r6] - adds r6, 0x1 -_08174C0A: - movs r0, 0xFF - strb r0, [r6] - ldr r5, =gUnknown_085E5388 - str r5, [sp] - movs r4, 0x1 - negs r4, r4 - str r4, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r2, 0x80 - movs r3, 0x1 - bl box_print - ldr r1, =gUnknown_085E8C3B - add r0, sp, 0xC - bl CopyString - adds r6, r0, 0 - ldrb r1, [r7, 0x9] - lsrs r1, 1 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - str r5, [sp] - str r4, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r2, 0x24 - movs r3, 0x11 - bl box_print - ldr r1, =gUnknown_085E8C4D - add r0, sp, 0xC - bl CopyString - adds r6, r0, 0 - ldrh r1, [r7] - movs r2, 0x2 - movs r3, 0x5 - bl ConvertIntToDecimalString - str r5, [sp] - str r4, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r2, 0x68 - movs r3, 0x11 - bl box_print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram -_08174C82: - add sp, 0x2C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174A88 - - thumb_func_start sub_8174C98 -sub_8174C98: @ 8174C98 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - movs r0, 0x1 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0x1 - bl PutWindowTilemap - ldr r2, =0x0000021d - movs r0, 0x1 - movs r1, 0 - movs r3, 0xD - bl SetWindowBorderStyle - ldr r0, =gUnknown_085E538C - mov r8, r0 - str r0, [sp] - movs r1, 0x1 - negs r1, r1 - mov r9, r1 - str r1, [sp, 0x4] - ldr r0, =gUnknown_085E8C48 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - movs r3, 0x1 - bl box_print - ldr r0, =0x03005d90 - mov r10, r0 - ldr r1, [r0] - movs r0, 0x1 - movs r2, 0x70 - bl GetStringRightAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - mov r1, r8 - str r1, [sp] - mov r0, r9 - str r0, [sp, 0x4] - mov r1, r10 - ldr r0, [r1] - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - mov r1, r10 - ldr r0, [r1] - ldrb r4, [r0, 0xA] - ldrb r0, [r0, 0xB] - lsls r0, 8 - orrs r4, r0 - mov r0, r8 - str r0, [sp] - movs r7, 0 - str r7, [sp, 0x4] - ldr r0, =gUnknown_085E8C4D - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - movs r3, 0x11 - bl box_print - add r6, sp, 0xC - ldr r1, =0x000186a0 - adds r0, r4, 0 - bl __modsi3 - ldr r5, =0x00002710 - adds r1, r5, 0 - bl __divsi3 - subs r0, 0x5F - strb r0, [r6] - add r6, sp, 0xC - adds r0, r4, 0 - adds r1, r5, 0 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r5, 0xFA - lsls r5, 2 - adds r1, r5, 0 - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r6, 0x1] - add r6, sp, 0xC - adds r0, r4, 0 - adds r1, r5, 0 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r6, 0x2] - add r5, sp, 0xC - adds r0, r4, 0 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r5, 0x3] - add r5, sp, 0xC - adds r0, r4, 0 - movs r1, 0xA - bl __umodsi3 - adds r0, 0xA1 - strb r0, [r5, 0x4] - add r1, sp, 0xC - movs r0, 0xFF - strb r0, [r1, 0x5] - movs r0, 0x1 - movs r2, 0x70 - bl GetStringRightAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - mov r1, r8 - str r1, [sp] - mov r0, r9 - str r0, [sp, 0x4] - add r1, sp, 0xC - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x11 - bl box_print - mov r0, r8 - str r0, [sp] - mov r1, r9 - str r1, [sp, 0x4] - ldr r0, =gUnknown_085E84CE - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - movs r3, 0x21 - bl box_print - add r5, sp, 0xC - mov r0, r10 - ldr r4, [r0] - ldrh r0, [r4, 0xE] - movs r1, 0x64 - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r5] - add r5, sp, 0xC - ldrh r0, [r4, 0xE] - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r5, 0x1] - add r5, sp, 0xC - ldrh r0, [r4, 0xE] - movs r1, 0xA - bl __umodsi3 - adds r0, 0xA1 - strb r0, [r5, 0x2] - add r0, sp, 0xC - ldrb r0, [r0] - cmp r0, 0xA1 - bne _08174E1E - add r0, sp, 0xC - strb r7, [r0] -_08174E1E: - add r0, sp, 0xC - ldrb r1, [r0] - cmp r1, 0 - bne _08174E30 - ldrb r0, [r0, 0x1] - cmp r0, 0xA1 - bne _08174E30 - add r0, sp, 0xC - strb r1, [r0, 0x8] -_08174E30: - add r1, sp, 0xC - movs r0, 0xF0 - strb r0, [r1, 0x3] - adds r4, r1, 0 - ldr r0, =0x03005d90 - ldr r5, [r0] - ldrb r0, [r5, 0x10] - movs r1, 0x64 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0xA - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r4, 0x4] - add r4, sp, 0xC - ldrb r0, [r5, 0x10] - movs r1, 0xA - bl __umodsi3 - adds r0, 0xA1 - strb r0, [r4, 0x5] - add r1, sp, 0xC - movs r0, 0xFF - strb r0, [r1, 0x6] - movs r0, 0x1 - movs r2, 0x70 - bl GetStringRightAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - ldr r0, =gUnknown_085E538C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - add r1, sp, 0xC - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x21 - bl box_print - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram - 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_8174C98 - - thumb_func_start sub_8174EC4 -sub_8174EC4: @ 8174EC4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - movs r3, 0xC0 - lsls r3, 19 - movs r4, 0xC0 - lsls r4, 9 - add r0, sp, 0x4 - mov r8, r0 - mov r2, sp - movs r6, 0 - ldr r1, =0x040000d4 - movs r5, 0x80 - lsls r5, 5 - ldr r7, =0x81000800 - movs r0, 0x81 - lsls r0, 24 - mov r12, r0 -_08174EEA: - strh r6, [r2] - mov r0, sp - str r0, [r1] - str r3, [r1, 0x4] - str r7, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r3, r5 - subs r4, r5 - cmp r4, r5 - bhi _08174EEA - strh r6, [r2] - mov r2, sp - str r2, [r1] - str r3, [r1, 0x4] - lsrs r0, r4, 1 - mov r2, r12 - orrs r0, r2 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r0, 0xE0 - lsls r0, 19 - movs r3, 0x80 - lsls r3, 3 - movs r4, 0 - str r4, [sp, 0x4] - ldr r2, =0x040000d4 - mov r1, r8 - str r1, [r2] - str r0, [r2, 0x4] - lsrs r0, r3, 2 - movs r1, 0x85 - lsls r1, 24 - orrs r0, r1 - str r0, [r2, 0x8] - ldr r0, [r2, 0x8] - movs r1, 0xA0 - lsls r1, 19 - mov r0, sp - strh r4, [r0] - str r0, [r2] - str r1, [r2, 0x4] - lsrs r3, 1 - movs r0, 0x81 - lsls r0, 24 - orrs r3, r0 - str r3, [r2, 0x8] - ldr r0, [r2, 0x8] - bl sub_80A1A74 - ldr r0, =gUnknown_085E54E8 - movs r1, 0 - movs r2, 0x20 - bl gpu_pal_apply - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174EC4 - - thumb_func_start sub_8174F70 -sub_8174F70: @ 8174F70 - push {lr} - bl remove_some_task - bl ResetTasks - bl ResetAllObjectData - bl reset_temp_tile_data_buffers - bl dp13_810BB8C - bl ResetObjectPaletteAllocator - ldr r1, =0x0300301c - movs r0, 0x8 - strb r0, [r1] - ldr r0, =gUnknown_085E5394 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085E53A4 - bl LoadCompressedObjectPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174F70 - - thumb_func_start sub_8174FAC -sub_8174FAC: @ 8174FAC - push {r4,lr} - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085E5374 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r4, =0x0203bcdc - ldr r1, [r4] - adds r1, 0x12 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001012 - adds r1, r0 - movs r0, 0x3 - bl SetBgTilemapBuffer - 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 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174FAC - - thumb_func_start sub_8175024 -sub_8175024: @ 8175024 - push {r4,lr} - sub sp, 0x8 - ldr r0, =0x0203bcdc - ldr r0, [r0] - ldrh r0, [r0] - cmp r0, 0x4 - bhi _08175108 - lsls r0, 2 - ldr r1, =_08175044 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08175044: - .4byte _08175058 - .4byte _08175070 - .4byte _0817507C - .4byte _081750D2 - .4byte _081750DC -_08175058: - ldr r1, =gUnknown_085E5508 - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _08175108 - .pool -_08175070: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - beq _08175108 - b _08175112 -_0817507C: - movs r4, 0x20 - str r4, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - movs r0, 0xB - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0x3 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - movs r0, 0x6 - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - movs r3, 0xE - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x3 - movs r1, 0x2 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - b _08175108 -_081750D2: - bl sub_81971D0 - bl sub_8197200 - b _08175108 -_081750DC: - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x3 - bl ShowBg - ldr r0, =0x0203bcdc - ldr r1, [r0] - movs r0, 0 - strh r0, [r1] - b _08175114 - .pool -_08175108: - ldr r0, =0x0203bcdc - ldr r1, [r0] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_08175112: - movs r0, 0x1 -_08175114: - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8175024 - - thumb_func_start sub_8175120 -sub_8175120: @ 8175120 - push {r4,lr} - adds r2, r0, 0 - ldr r1, [r2, 0x20] - ldr r0, [r2, 0x30] - cmp r1, r0 - beq _08175176 - ldrh r3, [r2, 0x20] - movs r1, 0x20 - ldrsh r0, [r2, r1] - movs r4, 0x30 - ldrsh r1, [r2, r4] - cmp r0, r1 - bge _08175140 - adds r0, r3, 0 - adds r0, 0xF - strh r0, [r2, 0x20] -_08175140: - ldrh r3, [r2, 0x20] - movs r4, 0x20 - ldrsh r0, [r2, r4] - cmp r0, r1 - ble _08175150 - adds r0, r3, 0 - subs r0, 0xF - strh r0, [r2, 0x20] -_08175150: - ldrh r3, [r2, 0x22] - movs r1, 0x22 - ldrsh r0, [r2, r1] - movs r4, 0x32 - ldrsh r1, [r2, r4] - cmp r0, r1 - bge _08175164 - adds r0, r3, 0 - adds r0, 0xA - strh r0, [r2, 0x22] -_08175164: - ldrh r3, [r2, 0x22] - movs r4, 0x22 - ldrsh r0, [r2, r4] - cmp r0, r1 - ble _0817519C - adds r0, r3, 0 - subs r0, 0xA - strh r0, [r2, 0x22] - b _0817519C -_08175176: - ldrh r0, [r2, 0x3C] - lsls r1, r0, 16 - movs r0, 0xCE - lsls r0, 17 - cmp r1, r0 - bne _08175190 - lsrs r1, 16 - adds r0, r2, 0 - movs r2, 0x1 - movs r3, 0x3 - bl sub_806ED40 - b _0817519C -_08175190: - lsrs r1, 16 - adds r0, r2, 0 - movs r2, 0 - movs r3, 0x3 - bl sub_806ED40 -_0817519C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8175120 - - thumb_func_start sub_81751A4 -sub_81751A4: @ 81751A4 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r1, [r5, 0x26] - movs r2, 0x26 - ldrsh r0, [r5, r2] - cmp r0, 0x78 - ble _081751BA - adds r0, r5, 0 - bl RemoveObjectAndFreeTiles - b _081751F2 -_081751BA: - adds r0, r1, 0x1 - ldrh r1, [r5, 0x30] - adds r0, r1 - strh r0, [r5, 0x26] - ldrh r4, [r5, 0x2E] - lsls r4, 24 - lsrs r4, 24 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - ands r0, r1 - adds r0, 0x8 - ldr r1, =gUnknown_08329F40 - lsls r4, 1 - adds r4, r1 - movs r2, 0 - ldrsh r1, [r4, r2] - muls r0, r1 - cmp r0, 0 - bge _081751E8 - adds r0, 0xFF -_081751E8: - asrs r0, 8 - strh r0, [r5, 0x24] - ldrh r0, [r5, 0x2E] - adds r0, 0x4 - strh r0, [r5, 0x2E] -_081751F2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81751A4 - - thumb_func_start sub_81751FC -sub_81751FC: @ 81751FC - push {r4,lr} - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF0 - bl __umodsi3 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl GenerateRandomNumber - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x7 - ands r2, r0 - negs r2, r2 - ldr r0, =gUnknown_085E54D0 - lsls r4, 16 - asrs r4, 16 - lsls r2, 16 - asrs r2, 16 - adds r1, r4, 0 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r4, r1, r0 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x11 - bl __umodsi3 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartObjectImageAnim - bl GenerateRandomNumber - movs r1, 0x3 - ands r1, r0 - cmp r1, 0 - beq _08175274 - movs r0, 0 - b _08175276 - .pool -_08175274: - movs r0, 0x1 -_08175276: - strh r0, [r4, 0x30] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81751FC - - thumb_func_start sub_8175280 -sub_8175280: @ 8175280 - push {r4,lr} - ldr r4, =0x020375e0 - movs r0, 0xB4 - strh r0, [r4] - ldr r0, =sub_8175364 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _081752AA - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r4] - strh r1, [r0, 0xA] - ldr r0, =0x020375e2 - strh r2, [r0] -_081752AA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175280 - - thumb_func_start sub_81752C0 -sub_81752C0: @ 81752C0 - push {r4,lr} - ldr r0, =sub_8175364 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _081752D4 - bl DestroyTask -_081752D4: - bl sub_8152254 - ldr r4, =0x000003e9 - adds r0, r4, 0 - bl FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81752C0 - - thumb_func_start sub_81752F4 -sub_81752F4: @ 81752F4 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r1, [r5, 0xE] - movs r2, 0xE - ldrsh r0, [r5, r2] - cmp r0, 0x6E - ble _08175324 - ldr r2, =0x03005e00 - movs r0, 0x28 - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r0, 0x26] - subs r1, 0x1 - strh r1, [r0, 0x26] - ldrb r0, [r5, 0x16] - bl sub_81525D0 - b _08175358 - .pool -_08175324: - adds r0, r1, 0x1 - ldrh r1, [r5, 0x1C] - adds r0, r1 - strh r0, [r5, 0xE] - ldrb r4, [r5, 0x1A] - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - ands r0, r1 - adds r0, 0x8 - ldr r1, =gUnknown_08329F40 - lsls r4, 1 - adds r4, r1 - movs r2, 0 - ldrsh r1, [r4, r2] - muls r0, r1 - cmp r0, 0 - bge _0817534E - adds r0, 0xFF -_0817534E: - asrs r0, 8 - strh r0, [r5, 0xC] - ldrh r0, [r5, 0x1A] - adds r0, 0x4 - strh r0, [r5, 0x1A] -_08175358: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81752F4 - - thumb_func_start sub_8175364 -sub_8175364: @ 8175364 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r4, r0, 24 - mov r8, r4 - movs r7, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =0x03005e08 - adds r6, r0, r1 - ldrh r0, [r6] - cmp r0, 0x1 - beq _081753E0 - cmp r0, 0x1 - bgt _08175394 - cmp r0, 0 - beq _0817539C - b _081754B0 - .pool -_08175394: - cmp r0, 0xFF - bne _0817539A - b _081754A0 -_0817539A: - b _081754B0 -_0817539C: - movs r0, 0x40 - bl sub_81521C0 - cmp r0, 0 - bne _081753B8 - adds r0, r4, 0 - bl DestroyTask - ldr r0, =0x020375e0 - strh r7, [r0] - ldr r1, =0x020375e2 - ldr r2, =0x0000ffff - adds r0, r2, 0 - strh r0, [r1] -_081753B8: - ldr r0, =gUnknown_085E5394 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085E53A4 - bl LoadCompressedObjectPalette - ldrh r0, [r6] - adds r0, 0x1 - strh r0, [r6] - b _081754B0 - .pool -_081753E0: - ldrh r0, [r6, 0x2] - cmp r0, 0 - beq _08175478 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _08175478 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF0 - bl __umodsi3 - adds r5, r0, 0 - lsls r5, 16 - asrs r5, 16 - bl GenerateRandomNumber - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0x7 - ands r4, r0 - negs r4, r4 - lsls r4, 16 - asrs r4, 16 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x11 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_085E53FC - ldr r2, =0x000003e9 - str r4, [sp] - str r0, [sp, 0x4] - str r7, [sp, 0x8] - adds r0, r1, 0 - adds r1, r2, 0 - adds r3, r5, 0 - bl sub_81524C4 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0xFF - beq _08175478 - adds r4, r7, 0 - ldr r1, =sub_81752F4 - adds r0, r4, 0 - bl sub_8152438 - bl GenerateRandomNumber - movs r1, 0x3 - ands r1, r0 - cmp r1, 0 - bne _08175468 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0x1 - bl sub_8152474 -_08175468: - adds r0, r4, 0 - movs r1, 0x7 - mov r2, r8 - bl sub_8152474 - ldrh r0, [r6, 0x1E] - adds r0, 0x1 - strh r0, [r6, 0x1E] -_08175478: - bl sub_81522D4 - ldrh r0, [r6, 0x2] - cmp r0, 0 - beq _08175494 - subs r0, 0x1 - strh r0, [r6, 0x2] - b _081754B0 - .pool -_08175494: - ldrh r0, [r6, 0x1E] - cmp r0, 0 - bne _081754B0 - movs r0, 0xFF - strh r0, [r6] - b _081754B0 -_081754A0: - bl sub_81752C0 - ldr r0, =0x020375e0 - strh r7, [r0] - ldr r1, =0x020375e2 - ldr r2, =0x0000ffff - adds r0, r2, 0 - strh r0, [r1] -_081754B0: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175364 - - thumb_func_start sub_81754C8 -sub_81754C8: @ 81754C8 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_81754C8 - - thumb_func_start sub_81754DC -sub_81754DC: @ 81754DC - push {lr} - bl RunTasks - bl CallObjectCallbacks - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2C] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08175522 - ldr r0, =0x0203bce4 - ldrb r0, [r0] - cmp r0, 0 - beq _08175522 - ldr r2, =0x03005e00 - ldr r0, =0x0203bce2 - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldr r1, [r0] - ldr r0, =sub_8175774 - cmp r1, r0 - bne _08175522 - bl sub_81754C8 - bl RunTasks - bl CallObjectCallbacks - ldr r1, =0x0203bce5 - movs r0, 0x1 - strb r0, [r1] -_08175522: - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r0} - bx r0 - .pool - thumb_func_end sub_81754DC - - thumb_func_start sub_8175548 -sub_8175548: @ 8175548 - push {lr} - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085E6F68 - movs r0, 0 - movs r2, 0x1 - bl InitBgsFromTemplates - movs r0, 0x80 - lsls r0, 4 - bl AllocZeroed - adds r1, r0, 0 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r0, =gUnknown_085E56F0 - movs r1, 0x80 - movs r2, 0x40 - bl gpu_pal_apply - ldr r0, =gUnknown_085E6F6C - bl InitWindows - bl DeactivateAllTextPrinters - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0 - bl ShowBg - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175548 - - thumb_func_start sub_81755A4 -sub_81755A4: @ 81755A4 - push {lr} - bl FreeAllWindowBuffers - movs r0, 0 - bl GetBgTilemapBuffer - cmp r0, 0 - beq _081755B8 - bl Free -_081755B8: - pop {r0} - bx r0 - thumb_func_end sub_81755A4 - - thumb_func_start sub_81755BC -sub_81755BC: @ 81755BC - push {r4,r5,lr} - sub sp, 0x18 - adds r4, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r2, 24 - add r1, sp, 0x14 - movs r0, 0 - strb r0, [r1] - cmp r2, 0x1 - bne _081755DC - movs r0, 0x3 - strb r0, [r1, 0x1] - movs r0, 0x4 - b _081755E4 -_081755DC: - add r1, sp, 0x14 - movs r0, 0x1 - strb r0, [r1, 0x1] - movs r0, 0x2 -_081755E4: - strb r0, [r1, 0x2] - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xF0 - movs r3, 0x1 - bl GetStringCenterAlignXOffsetWithLetterSpacing - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - add r0, sp, 0x14 - str r0, [sp, 0x8] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0xC] - str r4, [sp, 0x10] - movs r0, 0 - movs r1, 0x1 - adds r3, r5, 0 - bl AddTextPrinterParametrized2 - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81755BC - - thumb_func_start sub_8175620 -sub_8175620: @ 8175620 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - bl sub_8175CE4 - movs r0, 0 - bl SetVBlankCallback - ldr r0, =0x02000000 - movs r1, 0xE0 - lsls r1, 9 - bl InitHeap - bl sub_80A1A74 - bl ResetTasks - bl sub_8175548 - ldr r0, =sub_8175744 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x10] - strh r1, [r0, 0x16] - strh r1, [r0, 0x1E] - movs r1, 0x1 - strh r1, [r0, 0x22] -_0817566A: - movs r0, 0 - adds r1, r7, 0 - bl sub_8176AB0 - lsls r0, 24 - cmp r0, 0 - beq _0817566A - ldr r5, =0x03005e00 - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r5 - movs r0, 0xA - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r1, 0 - mov r8, r1 - movs r6, 0 - movs r1, 0x28 - strh r1, [r0, 0x8] - ldr r1, =0x0000fffc - movs r0, 0x12 - bl SetGpuReg - ldr r0, =sub_8175DA0 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r5 - strh r7, [r1, 0xA] - strh r0, [r4, 0x26] - movs r0, 0x1 - negs r0, r0 - str r6, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - movs r0, 0x1 - bl EnableInterrupts - ldr r0, =sub_81754C8 - bl SetVBlankCallback - ldr r0, =0x000001c7 - bl m4aSongNumStart - ldr r0, =sub_81754DC - bl SetMainCallback2 - ldr r0, =0x0203bce5 - mov r1, r8 - strb r1, [r0] - ldr r4, =0x0203bce8 - movs r0, 0xEB - lsls r0, 2 - bl AllocZeroed - str r0, [r4] - bl sub_8177388 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x8E - strh r6, [r0] - adds r0, 0x2 - strh r6, [r0] - adds r0, 0x2 - strh r6, [r0] - ldr r0, =0x0203bce2 - strh r7, [r0] - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175620 - - thumb_func_start sub_8175744 -sub_8175744: @ 8175744 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08175764 - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8175774 - str r0, [r1] -_08175764: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175744 - - thumb_func_start sub_8175774 -sub_8175774: @ 8175774 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - movs r0, 0x10 - ldrsh r1, [r4, r0] - cmp r1, 0 - beq _081757B0 - movs r3, 0xA - ldrsh r1, [r4, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x1E - strh r1, [r0, 0x8] - movs r0, 0x80 - lsls r0, 1 - strh r0, [r4, 0x20] - ldr r0, =sub_8175A9C - b _081757FA - .pool -_081757B0: - ldr r0, =0x0203bce0 - strh r1, [r0] - ldrh r2, [r4, 0x1E] - movs r3, 0x1E - ldrsh r0, [r4, r3] - cmp r0, 0x1 - bne _081757E0 - strh r2, [r4, 0x22] - strh r1, [r4, 0x1E] - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =sub_8175808 - b _081757FA - .pool -_081757E0: - cmp r0, 0x2 - bne _081757FC - strh r2, [r4, 0x22] - strh r1, [r4, 0x1E] - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =sub_81758A4 -_081757FA: - str r0, [r4] -_081757FC: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175774 - - thumb_func_start sub_8175808 -sub_8175808: @ 8175808 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08175836 - movs r0, 0 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl sub_8176CA0 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =c2_080C9BFC - str r0, [r1] -_08175836: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175808 - - thumb_func_start c2_080C9BFC -c2_080C9BFC: @ 8175848 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - bl SetVBlankCallback - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r5, r0, r1 - ldrb r0, [r5, 0x16] - adds r1, r4, 0 - bl sub_8176AB0 - lsls r0, 24 - cmp r0, 0 - beq _08175890 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - movs r0, 0x1 - bl EnableInterrupts - ldr r0, =sub_81754C8 - bl SetVBlankCallback - ldr r0, =sub_8175744 - str r0, [r5] -_08175890: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end c2_080C9BFC - - thumb_func_start sub_81758A4 -sub_81758A4: @ 81758A4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081758D2 - movs r0, 0 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl sub_8176CA0 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81758E4 - str r0, [r1] -_081758D2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81758A4 - - thumb_func_start sub_81758E4 -sub_81758E4: @ 81758E4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r1, r0 - mov r8, r1 - ldrb r7, [r1] - cmp r7, 0 - beq _08175906 - cmp r7, 0x1 - beq _081759F0 -_08175906: - bl ResetAllObjectData - bl dp13_810BB8C - bl ResetObjectPaletteAllocator - ldr r1, =0x0300301c - movs r0, 0x8 - strb r0, [r1] - ldr r0, =gUnknown_085B0E04 - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gUnknown_085B0C0C - ldr r1, =0x06003800 - bl LZ77UnCompVram - ldr r0, =gUnknown_085B0A02 - movs r1, 0x1 - movs r2, 0x3E - bl gpu_pal_apply - movs r1, 0 - ldr r4, =0x0201c000 - movs r3, 0x11 - ldr r2, =0x000007ff -_0817593C: - adds r0, r1, r4 - strb r3, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r2 - bls _0817593C - movs r1, 0 - ldr r2, =0x0201d800 - ldr r6, =gUnknown_085E701C - ldr r0, =0xfffff000 - adds r5, r2, r0 - movs r4, 0x22 - ldr r3, =0x000007ff -_08175958: - adds r0, r1, r5 - strb r4, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r3 - bls _08175958 - movs r1, 0 - ldr r5, =0x0201d000 - movs r4, 0x33 - ldr r3, =0x000007ff -_0817596E: - adds r0, r1, r5 - strb r4, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r3 - bls _0817596E - movs r0, 0 - strh r0, [r2] - ldr r1, =0x000053ff - adds r0, r1, 0 - strh r0, [r2, 0x2] - ldr r1, =0x0000529f - adds r0, r1, 0 - strh r0, [r2, 0x4] - ldr r1, =0x00007e94 - adds r0, r1, 0 - strh r0, [r2, 0x6] - adds r0, r6, 0 - bl LoadObjectPic - ldr r0, =gUnknown_085E702C - bl LoadTaggedObjectPalette - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08175A7A - .pool -_081759F0: - ldr r0, =sub_81760FC - movs r1, 0 - bl CreateTask - ldr r2, =0x03005e00 - lsls r4, r6, 2 - adds r4, r6 - lsls r4, 3 - adds r4, r2 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - mov r9, r1 - movs r5, 0 - strh r0, [r4, 0xE] - movs r0, 0xE - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - strh r7, [r0, 0x8] - movs r0, 0xE - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - strh r6, [r0, 0xA] - movs r0, 0xE - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r4, 0x16] - strh r1, [r0, 0xC] - movs r0, 0x1 - negs r0, r0 - str r5, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - movs r0, 0x1C - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0x20 - bl SetGpuReg - ldr r1, =0x00000703 - movs r0, 0xE - bl SetGpuReg - movs r1, 0xCA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - mov r0, r9 - mov r1, r8 - strb r0, [r1] - ldr r0, =0x0203bd28 - strh r5, [r0] - ldr r0, =sub_8175744 - str r0, [r4] -_08175A7A: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81758E4 - - thumb_func_start sub_8175A9C -sub_8175A9C: @ 8175A9C - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0x20] - movs r2, 0x20 - ldrsh r1, [r4, r2] - cmp r1, 0 - beq _08175AC4 - subs r0, 0x1 - strh r0, [r4, 0x20] - b _08175AD8 - .pool -_08175AC4: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0xC - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =sub_8175AE4 - str r0, [r4] -_08175AD8: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175A9C - - thumb_func_start sub_8175AE4 -sub_8175AE4: @ 8175AE4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08175B0A - adds r0, r4, 0 - bl sub_8176CA0 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8175B1C - str r0, [r1] -_08175B0A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175AE4 - - thumb_func_start sub_8175B1C -sub_8175B1C: @ 8175B1C - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8175CE4 - bl sub_80A1A74 - movs r1, 0xE0 - lsls r1, 6 - movs r0, 0 - movs r2, 0 - bl sub_8176D1C - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r1, 0x8 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - movs r1, 0xE0 - lsls r1, 3 - movs r0, 0x8 - bl SetGpuReg - movs r0, 0x1 - bl EnableInterrupts - movs r1, 0xA0 - lsls r1, 1 - movs r0, 0 - bl SetGpuReg - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0xEB - strh r1, [r0, 0x8] - ldr r1, =sub_8175B90 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175B1C - - thumb_func_start sub_8175B90 -sub_8175B90: @ 8175B90 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0x8] - movs r2, 0x8 - ldrsh r1, [r4, r2] - cmp r1, 0 - beq _08175BB8 - subs r0, 0x1 - strh r0, [r4, 0x8] - b _08175BCC - .pool -_08175BB8: - movs r0, 0x1 - negs r0, r0 - str r1, [sp] - movs r1, 0x6 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =sub_8175BD8 - str r0, [r4] -_08175BCC: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175B90 - - thumb_func_start sub_8175BD8 -sub_8175BD8: @ 8175BD8 - push {r4,r5,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _08175C1E - movs r0, 0xE0 - lsls r0, 6 - movs r1, 0 - bl sub_8176E40 - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl pal_fade_maybe - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0xE1 - lsls r1, 5 - strh r1, [r0, 0x8] - ldr r1, =sub_8175C34 - str r1, [r0] -_08175C1E: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175BD8 - - thumb_func_start sub_8175C34 -sub_8175C34: @ 8175C34 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08175CB8 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0 - beq _08175C62 - ldr r0, =0x030022c0 - ldrh r0, [r0, 0x2E] - cmp r0, 0 - beq _08175C94 -_08175C62: - movs r0, 0x4 - bl play_sound_effect - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x0000ffff - str r1, [sp] - movs r1, 0x8 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =sub_8175CC8 - str r0, [r4] - b _08175CB8 - .pool -_08175C94: - ldr r0, =0x00001be8 - cmp r1, r0 - bne _08175CA0 - movs r0, 0x8 - bl play_sound_effect -_08175CA0: - movs r0, 0x8 - ldrsh r1, [r4, r0] - ldr r0, =0x00001ab8 - cmp r1, r0 - bne _08175CB2 - movs r0, 0xE4 - lsls r0, 1 - bl m4aSongNumStart -_08175CB2: - ldrh r0, [r4, 0x8] - subs r0, 0x1 - strh r0, [r4, 0x8] -_08175CB8: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175C34 - - thumb_func_start sub_8175CC8 -sub_8175CC8: @ 8175CC8 - push {lr} - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08175CDC - movs r0, 0xFF - bl SoftReset -_08175CDC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175CC8 - - thumb_func_start sub_8175CE4 -sub_8175CE4: @ 8175CE4 - push {lr} - sub sp, 0x8 - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1C - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - mov r1, sp - movs r0, 0 - strh r0, [r1] - ldr r1, =0x040000d4 - mov r0, sp - str r0, [r1] - movs r0, 0xC0 - lsls r0, 19 - str r0, [r1, 0x4] - ldr r0, =0x8100c000 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r2, 0 - str r2, [sp, 0x4] - add r0, sp, 0x4 - str r0, [r1] - movs r0, 0xE0 - lsls r0, 19 - str r0, [r1, 0x4] - ldr r0, =0x85000100 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - mov r0, sp - strh r2, [r0] - str r0, [r1] - ldr r0, =0x05000002 - str r0, [r1, 0x4] - ldr r0, =0x810001ff - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175CE4 - - thumb_func_start sub_8175DA0 -sub_8175DA0: @ 8175DA0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r5, r1, 0 - cmp r0, 0xA - bhi _08175E00 - lsls r0, 2 - ldr r1, =_08175DD4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08175DD4: - .4byte _08175E00 - .4byte _08175E40 - .4byte _08175E60 - .4byte _08175F38 - .4byte _08175F5C - .4byte _08175FC8 - .4byte _08175E00 - .4byte _08175E00 - .4byte _08175E00 - .4byte _08175E00 - .4byte _08175FFC -_08175E00: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _08175E12 - b _0817602A -_08175E12: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r5 - movs r1, 0x1 - strh r1, [r0, 0x8] - movs r1, 0x48 - strh r1, [r0, 0xE] - movs r3, 0xA - ldrsh r1, [r0, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - strh r2, [r0, 0x24] - ldr r0, =0x0203bce0 - strh r2, [r0] - b _0817602A - .pool -_08175E40: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r5 - ldrh r2, [r1, 0xE] - movs r3, 0xE - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _08175E58 - subs r0, r2, 0x1 - strh r0, [r1, 0xE] - b _0817602A -_08175E58: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0817602A -_08175E60: - lsls r2, r4, 2 - adds r0, r2, r4 - lsls r0, 3 - adds r3, r0, r5 - movs r0, 0xA - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r5, r0, r5 - ldr r1, [r5] - ldr r0, =sub_8175774 - mov r9, r2 - cmp r1, r0 - bne _08175F32 - movs r1, 0xC - ldrsh r0, [r3, r1] - cmp r0, 0x38 - bgt _08175F2C - movs r5, 0 - ldr r2, =gUnknown_085E6AF4 - mov r8, r2 - adds r7, r3, 0 - movs r6, 0xA0 - lsls r6, 19 -_08175E92: - movs r3, 0xC - ldrsh r1, [r7, r3] - lsls r0, r1, 2 - adds r0, r1 - adds r0, r5 - lsls r0, 2 - add r0, r8 - ldr r2, [r0] - ldr r0, [r2, 0x4] - lsrs r1, r6, 24 - ldrb r2, [r2, 0x1] - bl sub_81755BC - movs r0, 0x80 - lsls r0, 21 - adds r6, r0 - adds r5, 0x1 - cmp r5, 0x4 - ble _08175E92 - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - ldr r3, =0x03005e00 - mov r2, r9 - adds r1, r2, r4 - lsls r1, 3 - adds r1, r3 - ldrh r0, [r1, 0xC] - adds r0, 0x1 - strh r0, [r1, 0xC] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - movs r0, 0xA - ldrsh r2, [r1, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r3 - movs r2, 0x1 - strh r2, [r0, 0x24] - movs r2, 0xA - ldrsh r1, [r1, r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r3 - movs r3, 0x22 - ldrsh r0, [r0, r3] - cmp r0, 0x1 - bne _08175F14 - movs r0, 0xC0 - lsls r0, 2 - ldr r1, =0x0000328d - b _08175F1A - .pool -_08175F14: - movs r0, 0xC0 - lsls r0, 2 - ldr r1, =0x00001967 -_08175F1A: - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - b _0817602A - .pool -_08175F2C: - movs r0, 0xA - strh r0, [r3, 0x8] - b _0817602A -_08175F32: - movs r0, 0 - strh r0, [r5, 0x24] - b _0817602A -_08175F38: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0817602A - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r5 - movs r1, 0x73 - strh r1, [r0, 0xE] - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - b _0817602A - .pool -_08175F5C: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r5 - ldrh r1, [r4, 0xE] - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08175F74 - subs r0, r1, 0x1 - strh r0, [r4, 0xE] - b _0817602A -_08175F74: - ldrb r0, [r4, 0xC] - ldrb r1, [r4, 0xA] - bl sub_817603C - lsls r0, 24 - cmp r0, 0 - beq _08175F8A - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0817602A -_08175F8A: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r3, 0xA - ldrsh r1, [r4, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r1, 0x22 - ldrsh r0, [r0, r1] - cmp r0, 0x1 - bne _08175FB0 - movs r0, 0xC0 - lsls r0, 2 - ldr r1, =0x0000328d - b _08175FB6 - .pool -_08175FB0: - movs r0, 0xC0 - lsls r0, 2 - ldr r1, =0x00001967 -_08175FB6: - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - b _0817602A - .pool -_08175FC8: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0817602A - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0x2 - strh r0, [r1, 0x8] - b _0817602A - .pool -_08175FFC: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r5 - movs r2, 0xA - ldrsh r1, [r0, r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r5 - movs r5, 0 - movs r1, 0x1 - strh r1, [r0, 0x10] - adds r0, r4, 0 - bl DestroyTask - bl sub_81755A4 - ldr r4, =0x0203bce8 - ldr r0, [r4] - bl Free - str r5, [r4] -_0817602A: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175DA0 - - thumb_func_start sub_817603C -sub_817603C: @ 817603C - push {r4-r6,lr} - lsls r0, 24 - lsrs r3, r0, 24 - adds r6, r3, 0 - lsls r1, 24 - lsrs r2, r1, 24 - adds r5, r2, 0 - ldr r4, =0x03005e00 - cmp r3, 0x6 - bne _0817605C - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x2 - strh r1, [r0, 0x1E] -_0817605C: - cmp r3, 0xC - bne _0817606E - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x1 - strh r1, [r0, 0x16] - strh r1, [r0, 0x1E] -_0817606E: - cmp r3, 0x12 - bne _0817607E - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x2 - strh r1, [r0, 0x1E] -_0817607E: - cmp r3, 0x18 - bne _08176092 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x2 - strh r1, [r0, 0x16] - movs r1, 0x1 - strh r1, [r0, 0x1E] -_08176092: - cmp r3, 0x1E - bne _081760A2 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x2 - strh r1, [r0, 0x1E] -_081760A2: - cmp r3, 0x24 - bne _081760B6 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x3 - strh r1, [r0, 0x16] - movs r1, 0x1 - strh r1, [r0, 0x1E] -_081760B6: - cmp r3, 0x2A - bne _081760C6 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x2 - strh r1, [r0, 0x1E] -_081760C6: - cmp r6, 0x30 - bne _081760DA - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r4 - movs r1, 0x4 - strh r1, [r0, 0x16] - movs r1, 0x1 - strh r1, [r0, 0x1E] -_081760DA: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r4 - movs r1, 0x1E - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _081760F4 - movs r0, 0 - b _081760F6 - .pool -_081760F4: - movs r0, 0x1 -_081760F6: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_817603C - - thumb_func_start sub_81760FC -sub_81760FC: @ 81760FC - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r2, r0, r4 - movs r1, 0x8 - ldrsh r0, [r2, r1] - cmp r0, 0x1 - beq _0817612C - cmp r0, 0x1 - bgt _0817611A - b _08176244 -_0817611A: - cmp r0, 0x2 - beq _08176158 - cmp r0, 0x3 - bne _08176124 - b _08176230 -_08176124: - b _08176244 - .pool -_0817612C: - ldr r0, =0x0203bce8 - ldr r0, [r0] - adds r0, 0x90 - ldrh r0, [r0] - cmp r0, 0 - bne _0817614E - movs r3, 0xA - ldrsh r0, [r2, r3] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r4 - movs r3, 0x24 - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _0817614E - b _08176244 -_0817614E: - ldrh r0, [r2, 0x8] - adds r0, 0x1 - b _08176242 - .pool -_08176158: - ldr r6, =0x0203bce8 - ldr r3, [r6] - adds r0, r3, 0 - adds r0, 0x8E - ldrh r0, [r0] - cmp r0, 0x47 - beq _08176244 - movs r0, 0xA - ldrsh r1, [r2, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - ldr r1, [r0] - ldr r0, =sub_8175774 - cmp r1, r0 - bne _08176244 - adds r0, r3, 0 - adds r0, 0x92 - ldrh r0, [r0] - lsls r0, 1 - adds r0, r3, r0 - ldrh r0, [r0] - ldr r4, =gUnknown_085E6F7C - adds r1, r3, 0 - adds r1, 0x90 - ldrh r3, [r1] - lsls r2, r3, 1 - adds r1, r2, r4 - ldrb r1, [r1] - adds r4, 0x1 - adds r2, r4 - ldrb r2, [r2] - bl sub_8177224 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, [r6] - adds r1, r0, 0 - adds r1, 0x92 - ldrh r3, [r1] - adds r0, 0x94 - ldrh r0, [r0] - subs r0, 0x1 - cmp r3, r0 - bge _081761D8 - adds r0, r3, 0x1 - strh r0, [r1] - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0x32 - b _081761EA - .pool -_081761D8: - movs r0, 0 - strh r0, [r1] - ldr r1, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0x80 - lsls r1, 2 -_081761EA: - strh r1, [r0, 0x34] - ldr r0, =0x0203bce8 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x8E - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x90 - ldrh r0, [r1] - cmp r0, 0x2 - bne _08176210 - movs r0, 0 - b _08176212 - .pool -_08176210: - adds r0, 0x1 -_08176212: - strh r0, [r1] - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r0, 0x32 - strh r0, [r1, 0xE] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _08176244 - .pool -_08176230: - ldrh r1, [r2, 0xE] - movs r3, 0xE - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _08176240 - subs r0, r1, 0x1 - strh r0, [r2, 0xE] - b _08176244 -_08176240: - movs r0, 0x1 -_08176242: - strh r0, [r2, 0x8] -_08176244: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81760FC - - thumb_func_start sub_817624C -sub_817624C: @ 817624C - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r6, r1, 0 - cmp r0, 0x32 - bls _08176268 - b _08176514 -_08176268: - lsls r0, 2 - ldr r1, =_0817627C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0817627C: - .4byte _08176348 - .4byte _0817636C - .4byte _081763C0 - .4byte _081763D8 - .4byte _08176414 - .4byte _08176438 - .4byte _08176484 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176490 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _081764B0 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _081764D4 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176514 - .4byte _08176508 -_08176348: - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r6 - ldrh r0, [r4, 0x12] - lsls r0, 16 - asrs r0, 17 - movs r1, 0x7F - ands r0, r1 - movs r1, 0xC - bl sine - ldr r1, =0x0203bd26 - strh r0, [r1] - b _08176390 - .pool -_0817636C: - ldr r7, =0x0203bd26 - movs r3, 0 - ldrsh r4, [r7, r3] - cmp r4, 0 - beq _0817639C - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r6 - ldrh r0, [r4, 0x12] - lsls r0, 16 - asrs r0, 17 - movs r1, 0x7F - ands r0, r1 - movs r1, 0xC - bl sine - strh r0, [r7] -_08176390: - ldrh r0, [r4, 0x12] - adds r0, 0x1 - strh r0, [r4, 0x12] - b _08176514 - .pool -_0817639C: - ldr r3, =0x02020630 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r6 - movs r0, 0xC - ldrsh r2, [r1, r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - movs r2, 0x2 - strh r2, [r0, 0x2E] - strh r4, [r1, 0x12] - b _08176430 - .pool -_081763C0: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r1, r0, r6 - ldrh r2, [r1, 0x12] - movs r3, 0x12 - ldrsh r0, [r1, r3] - cmp r0, 0x3F - bgt _08176430 - adds r0, r2, 0x1 - strh r0, [r1, 0x12] - b _0817644E -_081763D8: - ldr r3, =0x02020630 - lsls r2, r5, 2 - adds r2, r5 - lsls r2, 3 - adds r2, r6 - movs r0, 0xC - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0x3 - strh r1, [r0, 0x2E] - movs r0, 0xE - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0x1 - strh r1, [r0, 0x2E] - movs r0, 0x78 - strh r0, [r2, 0x10] - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] - b _08176514 - .pool -_08176414: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r1, r0, r6 - ldrh r2, [r1, 0x10] - movs r3, 0x10 - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _0817642C - subs r0, r2, 0x1 - strh r0, [r1, 0x10] - b _08176514 -_0817642C: - movs r0, 0x40 - strh r0, [r1, 0x12] -_08176430: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _08176514 -_08176438: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r6 - ldrh r1, [r4, 0x12] - movs r2, 0x12 - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _08176464 - subs r0, r1, 0x1 - strh r0, [r4, 0x12] -_0817644E: - movs r1, 0x7F - ands r0, r1 - movs r1, 0x14 - bl sine - ldr r1, =0x0203bd26 - strh r0, [r1] - b _08176514 - .pool -_08176464: - ldr r2, =0x02020630 - movs r3, 0xC - ldrsh r1, [r4, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - strh r1, [r0, 0x2E] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _08176514 - .pool -_08176484: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r6 - movs r1, 0x32 - b _08176512 -_08176490: - ldr r3, =0x02020630 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r6 - movs r0, 0xE - ldrsh r2, [r1, r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - movs r2, 0x2 - b _081764C8 - .pool -_081764B0: - ldr r3, =0x02020630 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r6 - movs r0, 0xC - ldrsh r2, [r1, r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - movs r2, 0x4 -_081764C8: - strh r2, [r0, 0x2E] - movs r0, 0x32 - strh r0, [r1, 0x8] - b _08176514 - .pool -_081764D4: - ldr r3, =0x02020630 - lsls r2, r5, 2 - adds r2, r5 - lsls r2, 3 - adds r2, r6 - movs r0, 0xC - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0x5 - strh r1, [r0, 0x2E] - movs r0, 0xE - ldrsh r1, [r2, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0x3 - strh r1, [r0, 0x2E] - movs r0, 0x32 - strh r0, [r2, 0x8] - b _08176514 - .pool -_08176508: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r6 - movs r1, 0 -_08176512: - strh r1, [r0, 0x8] -_08176514: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_817624C - - thumb_func_start sub_817651C -sub_817651C: @ 817651C - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r3, 0x8 - ldrsh r0, [r0, r3] - adds r4, r1, 0 - cmp r0, 0x4 - bhi _0817655C - lsls r0, 2 - ldr r1, =_08176548 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08176548: - .4byte _0817655C - .4byte _081765A0 - .4byte _081765AC - .4byte _081765F4 - .4byte _08176640 -_0817655C: - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r2, r0, r4 - movs r1, 0xA - ldrsh r0, [r2, r1] - ldr r5, =0x00007fff - cmp r0, r5 - beq _081765A0 - movs r3, 0xC - ldrsh r1, [r2, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r3, r0, r4 - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r1, 0xC - ldrsh r0, [r0, r1] - cmp r0, 0x2 - bne _081765A0 - movs r1, 0xA - ldrsh r0, [r3, r1] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r4 - movs r0, 0x14 - strh r0, [r1, 0x8] - strh r5, [r2, 0xA] -_081765A0: - movs r0, 0 - bl sub_817B540 - b _08176646 - .pool -_081765AC: - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r2, r0, r4 - movs r3, 0xA - ldrsh r0, [r2, r3] - ldr r5, =0x00007fff - cmp r0, r5 - beq _08176638 - movs r0, 0xC - ldrsh r1, [r2, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r3, 0xA - ldrsh r1, [r0, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r3, r0, r4 - ldrh r1, [r3, 0x12] - movs r0, 0x80 - negs r0, r0 - ands r0, r1 - movs r1, 0xA0 - lsls r1, 2 - cmp r0, r1 - bne _08176638 - movs r0, 0x1 - strh r0, [r3, 0x8] - strh r5, [r2, 0xA] - b _08176638 - .pool -_081765F4: - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r2, r0, r4 - ldrh r3, [r2, 0xA] - movs r0, 0xA - ldrsh r1, [r2, r0] - ldr r5, =0x00007fff - cmp r1, r5 - beq _08176638 - movs r0, 0x92 - lsls r0, 2 - cmp r1, r0 - bne _08176634 - movs r3, 0xC - ldrsh r1, [r2, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r3, 0xA - ldrsh r1, [r0, r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r1, 0xA - strh r1, [r0, 0x8] - strh r5, [r2, 0xA] - b _08176638 - .pool -_08176634: - adds r0, r3, 0x1 - strh r0, [r2, 0xA] -_08176638: - movs r0, 0x1 - bl sub_817B540 - b _08176646 -_08176640: - movs r0, 0x2 - bl sub_817B540 -_08176646: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_817651C - - thumb_func_start sub_817664C -sub_817664C: @ 817664C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r7, r1, 24 - cmp r0, 0x4 - bls _08176662 - b _081769E0 -_08176662: - lsls r0, 2 - ldr r1, =_08176670 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08176670: - .4byte _08176684 - .4byte _0817672C - .4byte _081767D8 - .4byte _08176884 - .4byte _08176934 -_08176684: - ldr r5, =0x02020630 - ldr r0, =0x03005e00 - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r0 - movs r1, 0x12 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r3, 0 - movs r2, 0x88 - lsls r2, 1 - strh r2, [r0, 0x20] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x20] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r2, 0x2E - strh r2, [r0, 0x22] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x22] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - movs r2, 0x20 - b _081769D4 - .pool -_0817672C: - ldr r5, =0x02020630 - ldr r0, =0x03005e00 - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r0 - movs r1, 0x12 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r3, 0 - movs r1, 0x78 - strh r1, [r0, 0x20] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x88 - lsls r1, 1 - strh r1, [r0, 0x20] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r2, 0x2E - strh r2, [r0, 0x22] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x22] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r1, 0x80 - lsls r1, 6 - movs r0, 0 - movs r2, 0x20 - b _081769D4 - .pool -_081767D8: - ldr r5, =0x02020630 - ldr r0, =0x03005e00 - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r0 - movs r1, 0x12 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r3, 0 - movs r1, 0x78 - strh r1, [r0, 0x20] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x88 - lsls r1, 1 - strh r1, [r0, 0x20] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r2, 0x2E - strh r2, [r0, 0x22] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x22] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r1, 0x80 - lsls r1, 6 - movs r2, 0x80 - lsls r2, 2 - movs r0, 0x1 - b _081769D4 - .pool -_08176884: - ldr r5, =0x02020630 - ldr r0, =0x03005e00 - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r0 - movs r1, 0x12 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r3, 0 - movs r1, 0x78 - strh r1, [r0, 0x20] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x0000ffe0 - strh r1, [r0, 0x20] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r2, 0x2E - strh r2, [r0, 0x22] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x22] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r1, 0x80 - lsls r1, 6 - movs r2, 0x80 - lsls r2, 2 - movs r0, 0x1 - b _081769D4 - .pool -_08176934: - ldr r5, =0x02020630 - ldr r0, =0x03005e00 - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 3 - adds r4, r0 - movs r1, 0x12 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r3, 0 - movs r1, 0x58 - strh r1, [r0, 0x20] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x98 - strh r1, [r0, 0x20] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r2, 0x2E - strh r2, [r0, 0x22] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r2, [r0, 0x22] - movs r0, 0x12 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r0, 0x14 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - strh r3, [r0, 0x2E] - movs r1, 0x80 - lsls r1, 6 - movs r2, 0x80 - lsls r2, 2 - movs r0, 0x2 -_081769D4: - movs r3, 0x8 - bl sub_817B3DC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x8] -_081769E0: - ldr r0, =sub_817651C - movs r1, 0 - bl CreateTask - ldr r6, =0x03005e00 - lsls r1, r7, 2 - adds r1, r7 - lsls r1, 3 - adds r5, r1, r6 - lsls r0, 24 - lsrs r0, 24 - movs r4, 0 - strh r0, [r5, 0xC] - movs r0, 0xC - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - mov r1, r8 - strh r1, [r0, 0x8] - movs r0, 0xC - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - strh r4, [r0, 0xA] - movs r0, 0xC - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - strh r7, [r0, 0xC] - ldr r0, =sub_817624C - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0xA] - movs r0, 0xA - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - strh r4, [r0, 0x8] - movs r0, 0xA - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - strh r7, [r0, 0xA] - movs r0, 0xA - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - ldrh r1, [r5, 0x12] - strh r1, [r0, 0xC] - movs r0, 0xA - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - ldrh r1, [r5, 0x14] - strh r1, [r0, 0xE] - movs r0, 0xA - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r6 - strh r4, [r0, 0x10] - mov r1, r8 - cmp r1, 0x2 - bne _08176A94 - movs r1, 0xA - ldrsh r0, [r5, r1] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r6 - movs r0, 0x45 - strh r0, [r1, 0x12] -_08176A94: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817664C - - thumb_func_start sub_8176AB0 -sub_8176AB0: @ 8176AB0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r6, r0, r1 - ldrb r0, [r6] - cmp r0, 0x1 - beq _08176B30 - cmp r0, 0x1 - ble _08176AD6 - cmp r0, 0x2 - beq _08176B54 - cmp r0, 0x3 - bne _08176AD6 - b _08176C80 -_08176AD6: - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1C - movs r1, 0x8 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - movs r0, 0x1 - strb r0, [r6] - b _08176C96 - .pool -_08176B30: - ldr r1, =0x0203bd24 - movs r0, 0x22 - strh r0, [r1] - ldr r1, =0x0203bd26 - movs r0, 0 - strh r0, [r1] - adds r0, r4, 0 - bl sub_817B1C8 - ldrb r0, [r6] - adds r0, 0x1 - strb r0, [r6] - b _08176C96 - .pool -_08176B54: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _08176BD8 - ldr r0, =gUnknown_085F5334 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F53BC - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F5354 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F5384 - bl LoadTaggedObjectPalettes - movs r0, 0x78 - movs r1, 0x2E - bl sub_817B834 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x03005e00 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - strh r2, [r4, 0x12] - ldr r6, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r5, r6, 0 - adds r5, 0x1C - adds r2, r0, r5 - ldr r1, =sub_8176EE8 - str r1, [r2] - adds r6, 0x8 - adds r0, r6 - ldr r1, =gUnknown_085E6FD0 - str r1, [r0] - movs r0, 0x88 - lsls r0, 1 - movs r1, 0x2E - bl sub_817B88C - b _08176C2C - .pool -_08176BD8: - ldr r0, =gUnknown_085F5344 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F53AC - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F5354 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F5384 - bl LoadTaggedObjectPalettes - movs r0, 0x78 - movs r1, 0x2E - bl sub_817B88C - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x03005e00 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - strh r2, [r4, 0x12] - ldr r6, =0x02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r5, r6, 0 - adds r5, 0x1C - adds r2, r0, r5 - ldr r1, =sub_8176EE8 - str r1, [r2] - adds r6, 0x8 - adds r0, r6 - ldr r1, =gUnknown_085E6FD0 - str r1, [r0] - movs r0, 0x88 - lsls r0, 1 - movs r1, 0x2E - bl sub_817B834 -_08176C2C: - lsls r0, 24 - lsrs r2, r0, 24 - strh r2, [r4, 0x14] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r5, r0, r5 - ldr r1, =sub_8176F90 - str r1, [r5] - adds r0, r6 - ldr r1, =gUnknown_085E7010 - str r1, [r0] - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08176C96 - .pool -_08176C80: - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_817664C - adds r0, r4, 0 - bl sub_817B3A8 - movs r0, 0 - strb r0, [r6] - movs r0, 0x1 - b _08176C98 -_08176C96: - movs r0, 0 -_08176C98: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8176AB0 - - thumb_func_start sub_8176CA0 -sub_8176CA0: @ 8176CA0 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r1, [r4, 0x8] - movs r2, 0x8 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08176CC6 - lsls r0, r1, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - strh r0, [r4, 0x8] -_08176CC6: - ldrh r1, [r4, 0xA] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08176CDC - lsls r0, r1, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - strh r0, [r4, 0xA] -_08176CDC: - ldrh r1, [r4, 0xC] - movs r2, 0xC - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08176CF2 - lsls r0, r1, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - strh r0, [r4, 0xC] -_08176CF2: - ldrh r1, [r4, 0xE] - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08176D08 - lsls r0, r1, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - strh r0, [r4, 0xE] -_08176D08: - ldr r1, =0x0203bd28 - movs r0, 0x1 - strh r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8176CA0 - - thumb_func_start sub_8176D1C -sub_8176D1C: @ 8176D1C - push {r4-r7,lr} - adds r3, r0, 0 - adds r4, r2, 0 - lsls r3, 16 - lsrs r3, 16 - lsls r1, 16 - lsrs r7, r1, 16 - lsls r4, 16 - lsrs r5, r4, 16 - ldr r0, =gUnknown_085E5770 - movs r6, 0xC0 - lsls r6, 19 - adds r3, r6 - adds r1, r3, 0 - bl LZ77UnCompVram - ldr r0, =gIntroCopyright_Pal - adds r1, r5, 0 - movs r2, 0x20 - bl gpu_pal_apply - lsrs r4, 20 - lsls r4, 28 - lsrs r4, 16 - movs r1, 0 - adds r4, 0x1 - ldr r2, =0x000003ff -_08176D52: - lsls r0, r1, 1 - adds r0, r7 - adds r0, r6 - strh r4, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r2 - bls _08176D52 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8176D1C - - thumb_func_start sub_8176D78 -sub_8176D78: @ 8176D78 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - adds r3, r2, 0 - movs r0, 0x3F - ands r0, r2 - adds r1, r0, 0 - adds r1, 0x50 - cmp r2, 0xFF - bne _08176D90 - movs r0, 0x1 - b _08176DB6 -_08176D90: - movs r0, 0x80 - ands r0, r2 - cmp r0, 0 - beq _08176DA0 - movs r2, 0x80 - lsls r2, 4 - adds r0, r2, 0 - orrs r1, r0 -_08176DA0: - movs r0, 0x40 - ands r3, r0 - cmp r3, 0 - beq _08176DB4 - movs r2, 0x80 - lsls r2, 3 - adds r0, r2, 0 - orrs r1, r0 - lsls r0, r1, 16 - lsrs r1, r0, 16 -_08176DB4: - adds r0, r1, 0 -_08176DB6: - pop {r1} - bx r1 - thumb_func_end sub_8176D78 - - thumb_func_start sub_8176DBC -sub_8176DBC: @ 8176DBC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - str r0, [sp] - ldr r0, [sp, 0x2C] - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x4] - lsls r3, 16 - lsrs r3, 16 - str r3, [sp, 0x8] - lsls r0, 16 - lsrs r0, 20 - lsls r0, 28 - lsrs r0, 16 - mov r9, r0 - movs r5, 0 -_08176DEA: - movs r4, 0 - lsls r7, r5, 1 - ldr r1, [sp, 0x4] - adds r0, r1, r5 - adds r2, r5, 0x1 - mov r8, r2 - lsls r0, 6 - ldr r1, [sp, 0x8] - adds r6, r0, r1 -_08176DFC: - adds r0, r7, r5 - adds r0, r4 - ldr r2, [sp] - adds r0, r2, r0 - ldrb r0, [r0] - bl sub_8176D78 - mov r2, r10 - adds r1, r2, r4 - lsls r1, 1 - adds r1, r6 - movs r2, 0xC0 - lsls r2, 19 - adds r1, r2 - add r0, r9 - strh r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _08176DFC - mov r1, r8 - lsls r0, r1, 24 - lsrs r5, r0, 24 - cmp r5, 0x4 - bls _08176DEA - 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_8176DBC - - thumb_func_start sub_8176E40 -sub_8176E40: @ 8176E40 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r1, 16 - lsrs r6, r1, 16 - lsrs r1, 20 - lsls r1, 28 - lsrs r1, 16 - movs r2, 0 - ldr r7, =gUnknown_085E5BAC - movs r4, 0xC0 - lsls r4, 19 - adds r1, 0x1 - ldr r3, =0x000003ff -_08176E5E: - lsls r0, r2, 1 - adds r0, r5 - adds r0, r4 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, r3 - bls _08176E5E - str r6, [sp] - adds r0, r7, 0 - movs r1, 0x3 - movs r2, 0x7 - adds r3, r5, 0 - bl sub_8176DBC - ldr r0, =gUnknown_085E5BBB - str r6, [sp] - movs r1, 0x7 - movs r2, 0x7 - adds r3, r5, 0 - bl sub_8176DBC - ldr r4, =gUnknown_085E5BCA - str r6, [sp] - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0x7 - adds r3, r5, 0 - bl sub_8176DBC - str r6, [sp] - adds r0, r4, 0 - movs r1, 0x10 - movs r2, 0x7 - adds r3, r5, 0 - bl sub_8176DBC - ldr r0, =gUnknown_085E5BD9 - str r6, [sp] - movs r1, 0x14 - movs r2, 0x7 - adds r3, r5, 0 - bl sub_8176DBC - ldr r0, =gUnknown_085E5BE8 - str r6, [sp] - movs r1, 0x18 - movs r2, 0x7 - adds r3, r5, 0 - bl sub_8176DBC - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8176E40 - - thumb_func_start sub_8176EE8 -sub_8176EE8: @ 8176EE8 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0203bd28 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08176F04 - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - b _08176F88 - .pool -_08176F04: - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0x5 - bhi _08176F88 - lsls r0, 2 - ldr r1, =_08176F1C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08176F1C: - .4byte _08176F34 - .4byte _08176F3E - .4byte _08176F44 - .4byte _08176F4E - .4byte _08176F58 - .4byte _08176F6E -_08176F34: - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnimIfDifferent - b _08176F88 -_08176F3E: - adds r0, r4, 0 - movs r1, 0x1 - b _08176F72 -_08176F44: - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectImageAnimIfDifferent - b _08176F88 -_08176F4E: - adds r0, r4, 0 - movs r1, 0x3 - bl StartObjectImageAnimIfDifferent - b _08176F88 -_08176F58: - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnimIfDifferent - ldrh r1, [r4, 0x20] - movs r2, 0x20 - ldrsh r0, [r4, r2] - cmp r0, 0x78 - ble _08176F88 - subs r0, r1, 0x1 - b _08176F86 -_08176F6E: - adds r0, r4, 0 - movs r1, 0 -_08176F72: - bl StartObjectImageAnimIfDifferent - ldrh r2, [r4, 0x20] - movs r0, 0x20 - ldrsh r1, [r4, r0] - movs r0, 0x20 - negs r0, r0 - cmp r1, r0 - ble _08176F88 - subs r0, r2, 0x1 -_08176F86: - strh r0, [r4, 0x20] -_08176F88: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8176EE8 - - thumb_func_start sub_8176F90 -sub_8176F90: @ 8176F90 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x0203bd28 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08176FAC - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - b _08177048 - .pool -_08176FAC: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _08176FD4 - cmp r0, 0x1 - bgt _08176FBE - cmp r0, 0 - beq _08176FC8 - b _08177048 -_08176FBE: - cmp r0, 0x2 - beq _08177010 - cmp r0, 0x3 - beq _0817702E - b _08177048 -_08176FC8: - strh r0, [r4, 0x26] - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnimIfDifferent - b _08177048 -_08176FD4: - movs r1, 0x20 - ldrsh r0, [r4, r1] - cmp r0, 0xC8 - ble _08176FE6 - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectImageAnimIfDifferent - b _08176FEE -_08176FE6: - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectImageAnimIfDifferent -_08176FEE: - ldrh r2, [r4, 0x20] - movs r0, 0x20 - ldrsh r1, [r4, r0] - movs r0, 0x20 - negs r0, r0 - cmp r1, r0 - ble _08177000 - subs r0, r2, 0x2 - strh r0, [r4, 0x20] -_08177000: - ldr r0, =0x0203bd26 - ldrh r0, [r0] - negs r0, r0 - strh r0, [r4, 0x26] - b _08177048 - .pool -_08177010: - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnimIfDifferent - ldrh r1, [r4, 0x3C] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _08177048 - ldrh r0, [r4, 0x20] - adds r0, 0x1 - b _08177046 -_0817702E: - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnimIfDifferent - ldrh r2, [r4, 0x20] - movs r0, 0x20 - ldrsh r1, [r4, r0] - movs r0, 0x20 - negs r0, r0 - cmp r1, r0 - ble _08177048 - subs r0, r2, 0x1 -_08177046: - strh r0, [r4, 0x20] -_08177048: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8176F90 - - thumb_func_start sub_8177050 -sub_8177050: @ 8177050 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - ldr r0, =0x0203bd28 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _0817706C - ldrh r0, [r5, 0x3A] - bl sub_818D820 - b _0817721C - .pool -_0817706C: - ldrh r0, [r5, 0x3C] - adds r0, 0x1 - strh r0, [r5, 0x3C] - movs r2, 0x2E - ldrsh r0, [r5, r2] - cmp r0, 0xA - bhi _081770B4 - lsls r0, 2 - ldr r1, =_08177088 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08177088: - .4byte _081770B4 - .4byte _0817710E - .4byte _08177190 - .4byte _081771C6 - .4byte _081770B4 - .4byte _081770B4 - .4byte _081770B4 - .4byte _081770B4 - .4byte _081770B4 - .4byte _081771FE - .4byte _08177206 -_081770B4: - ldrb r1, [r5, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r5, 0x1] - movs r0, 0x30 - ldrsh r1, [r5, r0] - movs r0, 0x1F - ands r1, r0 - lsls r1, 1 - ldrb r2, [r5, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x3] - movs r0, 0x10 - strh r0, [r5, 0x32] - ldrh r4, [r5, 0x30] - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x80 - lsls r0, 9 - movs r1, 0x10 - bl __divsi3 - adds r1, r0, 0 - str r1, [sp] - adds r0, r4, 0 - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - adds r2, r5, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - movs r0, 0x1 - strh r0, [r5, 0x2E] - b _0817721C -_0817710E: - ldrh r1, [r5, 0x32] - movs r2, 0x32 - ldrsh r0, [r5, r2] - cmp r0, 0xFF - bgt _08177144 - adds r0, r1, 0 - adds r0, 0x8 - strh r0, [r5, 0x32] - ldrh r4, [r5, 0x30] - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x32 - ldrsh r1, [r5, r0] - movs r0, 0x80 - lsls r0, 9 - bl __divsi3 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - adds r0, r4, 0 - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - b _0817714A -_08177144: - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] -_0817714A: - movs r2, 0x30 - ldrsh r1, [r5, r2] - cmp r1, 0x2 - beq _0817721C - cmp r1, 0x2 - bgt _0817715C - cmp r1, 0x1 - beq _08177162 - b _0817721C -_0817715C: - cmp r1, 0x3 - beq _0817717A - b _0817721C -_08177162: - ldrh r1, [r5, 0x3C] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _08177172 - ldrh r0, [r5, 0x22] - adds r0, 0x1 - strh r0, [r5, 0x22] -_08177172: - ldrh r0, [r5, 0x20] - subs r0, 0x2 - strh r0, [r5, 0x20] - b _0817721C -_0817717A: - ldrh r0, [r5, 0x3C] - ands r1, r0 - cmp r1, 0 - bne _08177188 - ldrh r0, [r5, 0x22] - adds r0, 0x1 - strh r0, [r5, 0x22] -_08177188: - ldrh r0, [r5, 0x20] - adds r0, 0x2 - strh r0, [r5, 0x20] - b _0817721C -_08177190: - ldrh r1, [r5, 0x34] - movs r2, 0x34 - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _081771A0 - subs r0, r1, 0x1 - strh r0, [r5, 0x34] - b _0817721C -_081771A0: - movs r1, 0xF4 - lsls r1, 4 - movs r0, 0x50 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0x10 - bl SetGpuReg - ldrb r1, [r5, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r5, 0x1] - movs r0, 0x10 - strh r0, [r5, 0x34] - b _081771FE -_081771C6: - ldrh r1, [r5, 0x34] - movs r2, 0x34 - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _081771EC - subs r1, 0x1 - strh r1, [r5, 0x34] - movs r0, 0x34 - ldrsh r2, [r5, r0] - movs r0, 0x10 - subs r0, r2 - lsls r0, 8 - adds r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - b _0817721C -_081771EC: - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x9 - strh r0, [r5, 0x2E] - b _0817721C -_081771FE: - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - b _0817721C -_08177206: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - ldrh r0, [r5, 0x3A] - bl sub_818D820 -_0817721C: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8177050 - - thumb_func_start sub_8177224 -sub_8177224: @ 8177224 - push {r4-r7,lr} - adds r5, r3, 0 - lsls r0, 16 - lsrs r0, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - adds r3, r5, 0 - bl sub_80C0E9C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r6, =0x02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r2, r1, r6 - ldrb r3, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r3 - movs r3, 0x4 - orrs r0, r3 - strb r0, [r2, 0x5] - adds r0, r5, 0x1 - strh r0, [r2, 0x30] - movs r0, 0x3E - adds r0, r2 - mov r12, r0 - ldrb r0, [r0] - orrs r0, r3 - mov r3, r12 - strb r0, [r3] - adds r0, r6, 0 - adds r0, 0x1C - adds r1, r0 - ldr r0, =sub_8177050 - str r0, [r1] - strh r4, [r2, 0x3A] - ldr r0, =gUnknown_085E7068 - movs r7, 0x20 - ldrsh r1, [r2, r7] - movs r3, 0x22 - ldrsh r2, [r2, r3] - movs r3, 0x1 - bl AddObjectToFront - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - strh r4, [r0, 0x2E] - lsls r5, 24 - lsrs r5, 24 - adds r1, r5, 0 - bl StartObjectImageAnimIfDifferent - adds r0, r4, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8177224 - - thumb_func_start sub_81772B8 -sub_81772B8: @ 81772B8 - push {r4,lr} - adds r3, r0, 0 - ldr r4, =0x02020630 - movs r1, 0x2E - ldrsh r0, [r3, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0xA - beq _081772DC - ldr r0, =0x0203bd28 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0 - beq _081772EC -_081772DC: - adds r0, r3, 0 - bl RemoveObjectAndFreeTiles - b _08177380 - .pool -_081772EC: - adds r0, r1, 0 - adds r0, 0x3E - ldrb r0, [r0] - movs r1, 0x3E - adds r1, r3 - mov r12, r1 - movs r1, 0x4 - ands r1, r0 - mov r0, r12 - ldrb r2, [r0] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - movs r2, 0x2E - ldrsh r1, [r3, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x1] - movs r0, 0xC - ands r0, r1 - ldrb r2, [r3, 0x1] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x1] - movs r0, 0x2E - ldrsh r2, [r3, r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x1] - lsls r0, 30 - lsrs r0, 30 - movs r2, 0x4 - negs r2, r2 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0x1] - movs r2, 0x2E - ldrsh r1, [r3, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x3] - movs r1, 0x3E - ands r1, r0 - ldrb r2, [r3, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x3] - movs r0, 0x2E - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x20] - strh r0, [r3, 0x20] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r0, [r0, 0x22] - strh r0, [r3, 0x22] -_08177380: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81772B8 - - thumb_func_start sub_8177388 -sub_8177388: @ 8177388 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =0x00004023 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - bl sub_8133EDC - lsls r0, 16 - lsrs r0, 16 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - movs r4, 0x1 - movs r6, 0 - ldr r5, =0x00000181 -_081773B4: - adds r0, r4, 0 - movs r1, 0x1 - bl pokedex_flag_operation - lsls r0, 24 - cmp r0, 0 - beq _081773D4 - ldr r0, =0x0203bce8 - ldr r0, [r0] - lsls r1, r6, 1 - adds r0, 0x96 - adds r0, r1 - strh r4, [r0] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 -_081773D4: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r5 - bls _081773B4 - adds r4, r6, 0 - ldr r0, =0x00000181 - ldr r1, =0x0203bce8 - mov r8, r1 - lsls r7, r4, 16 - cmp r4, r0 - bhi _08177406 - mov r5, r8 - movs r3, 0 - adds r2, r0, 0 -_081773F2: - ldr r0, [r5] - lsls r1, r4, 1 - adds r0, 0x96 - adds r0, r1 - strh r3, [r0] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r2 - bls _081773F2 -_08177406: - mov r2, r8 - ldr r1, [r2] - ldr r2, =0x0000039a - adds r0, r1, r2 - strh r6, [r0] - lsrs r0, r7, 16 - cmp r0, 0x46 - bhi _08177430 - adds r0, r1, 0 - adds r0, 0x94 - strh r6, [r0] - b _08177436 - .pool -_08177430: - adds r1, 0x94 - movs r0, 0x47 - strh r0, [r1] -_08177436: - movs r6, 0 - ldr r0, =0x0203bce8 - mov r9, r0 - ldr r1, =0x0000039a - mov r8, r1 - movs r7, 0 - b _08177450 - .pool -_0817744C: - cmp r6, 0x46 - bhi _081774AC -_08177450: - bl GenerateRandomNumber - mov r2, r9 - ldr r4, [r2] - mov r1, r8 - adds r5, r4, r1 - lsls r0, 16 - lsrs r0, 16 - ldrh r1, [r5] - bl __umodsi3 - lsls r0, 16 - lsrs r3, r0, 16 - lsls r1, r6, 1 - adds r1, r4, r1 - lsls r0, r3, 1 - adds r4, 0x96 - adds r2, r4, r0 - ldrh r0, [r2] - strh r0, [r1] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - strh r7, [r2] - ldrh r0, [r5] - subs r0, 0x1 - strh r0, [r5] - lsls r0, 16 - lsrs r0, 16 - cmp r3, r0 - beq _081774A0 - ldrh r0, [r5] - lsls r0, 1 - adds r0, r4, r0 - ldrh r0, [r0] - strh r0, [r2] - ldrh r0, [r5] - lsls r0, 1 - adds r0, r4, r0 - strh r7, [r0] -_081774A0: - mov r2, r9 - ldr r0, [r2] - add r0, r8 - ldrh r0, [r0] - cmp r0, 0 - bne _0817744C -_081774AC: - ldr r1, =0x0203bce8 - ldr r2, [r1] - adds r3, r2, 0 - adds r3, 0x94 - ldrh r0, [r3] - mov r8, r1 - cmp r0, 0x46 - bhi _081774F8 - adds r6, r0, 0 - movs r3, 0 - cmp r6, 0x46 - bhi _081774EE - mov r4, r8 -_081774C6: - ldr r2, [r4] - lsls r1, r6, 1 - adds r1, r2, r1 - lsls r0, r3, 1 - adds r0, r2, r0 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - adds r2, 0x94 - ldrh r2, [r2] - cmp r3, r2 - bne _081774E4 - movs r3, 0 -_081774E4: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x46 - bls _081774C6 -_081774EE: - mov r1, r8 - ldr r0, [r1] - b _08177538 - .pool -_081774F8: - movs r4, 0 - ldrh r0, [r2] - cmp r0, r10 - beq _08177516 - adds r1, r2, 0 -_08177502: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - lsls r0, r4, 1 - adds r0, r1, r0 - ldrh r0, [r0] - cmp r0, r10 - beq _08177516 - cmp r4, 0x46 - bls _08177502 -_08177516: - mov r0, r8 - ldr r2, [r0] - adds r0, r2, 0 - adds r0, 0x94 - ldrh r0, [r0] - subs r0, 0x1 - cmp r4, r0 - bge _08177536 - lsls r0, r4, 1 - adds r0, r2, r0 - adds r2, 0x8C - ldrh r1, [r2] - strh r1, [r0] - mov r1, r10 - strh r1, [r2] - b _0817753E -_08177536: - adds r0, r2, 0 -_08177538: - adds r0, 0x8C - mov r2, r10 - strh r2, [r0] -_0817753E: - mov r1, r8 - ldr r0, [r1] - adds r0, 0x94 - movs r1, 0x47 - strh r1, [r0] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8177388 - - thumb_func_start sub_8177558 -sub_8177558: @ 8177558 - push {r4,lr} - bl GenerateRandomNumber - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl GenerateRandomNumber - lsls r0, 16 - orrs r0, r4 - bl sub_8177814 - ldr r0, =0x00004045 - movs r1, 0 - bl VarSet - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8177558 - - thumb_func_start sub_8177584 -sub_8177584: @ 8177584 - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - bl GenerateRandomNumber - lsls r0, 16 - lsrs r1, r0, 16 - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x0000ffff - cmp r4, r0 - beq _081775B4 - ldr r5, =0x41c64e6d - ldr r3, =0x00003039 - adds r2, r0, 0 -_081775A4: - adds r0, r1, 0 - muls r0, r5 - adds r1, r0, r3 - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r2 - bne _081775A4 -_081775B4: - adds r0, r1, 0 - bl sub_8177814 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8177584 - - thumb_func_start sub_81775CC -sub_81775CC: @ 81775CC - push {lr} - bl sub_817783C - ldr r1, =0x020375f0 - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81775CC - - thumb_func_start sub_81775E0 -sub_81775E0: @ 81775E0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r1, =0x020375e0 - movs r0, 0 - strh r0, [r1] - movs r0, 0 - str r0, [sp, 0x4] - movs r1, 0 - str r1, [sp] - movs r7, 0 -_081775FC: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _08177658 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _0817764E - adds r0, r4, 0 - movs r1, 0x1 - bl pokemon_getattr - adds r1, r0, 0 - ldr r0, =0x020375f0 - ldrh r0, [r0] - lsls r1, 16 - lsrs r1, 16 - bl sub_817778C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020375e0 - ldrh r2, [r1] - cmp r0, r2 - bls _0817764E - cmp r0, 0x1 - bls _0817764E - subs r0, 0x1 - strh r0, [r1] - movs r0, 0xE - str r0, [sp] - str r7, [sp, 0x4] -_0817764E: - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, 0x5 - bls _081775FC -_08177658: - movs r7, 0 - ldr r1, =0x03005d94 - mov r9, r1 -_0817765E: - movs r6, 0 - adds r2, r7, 0x1 - mov r10, r2 - lsls r0, r7, 2 - adds r0, r7 - mov r8, r0 -_0817766A: - mov r1, r8 - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 5 - adds r5, r0, 0x4 - mov r2, r9 - ldr r0, [r2] - adds r0, r5 - lsls r1, r6, 2 - adds r1, r6 - lsls r4, r1, 4 - adds r0, r4 - movs r1, 0xB - bl pokemon_getattr_encrypted - cmp r0, 0 - beq _081776D2 - mov r1, r9 - ldr r0, [r1] - adds r0, r5 - adds r0, r4 - movs r1, 0x2D - bl pokemon_getattr_encrypted - cmp r0, 0 - bne _081776D2 - mov r2, r9 - ldr r0, [r2] - adds r0, r5 - adds r0, r4 - movs r1, 0x1 - bl pokemon_getattr_encrypted - adds r1, r0, 0 - ldr r0, =0x020375f0 - ldrh r0, [r0] - lsls r1, 16 - lsrs r1, 16 - bl sub_817778C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x020375e0 - ldrh r2, [r1] - cmp r0, r2 - bls _081776D2 - cmp r0, 0x1 - bls _081776D2 - subs r0, 0x1 - strh r0, [r1] - str r7, [sp] - str r6, [sp, 0x4] -_081776D2: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x1D - bls _0817766A - mov r1, r10 - lsls r0, r1, 16 - lsrs r7, r0, 16 - cmp r7, 0xD - bls _0817765E - ldr r3, =0x020375e0 - ldrh r0, [r3] - cmp r0, 0 - beq _0817776E - ldr r2, =0x020375e2 - ldr r1, =gUnknown_085E7080 - subs r0, 0x1 - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] - ldr r2, [sp] - cmp r2, 0xE - bne _0817773C - ldr r1, =0x020375e4 - movs r0, 0 - strh r0, [r1] - movs r0, 0x64 - ldr r1, [sp, 0x4] - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r2, =0x02021cc4 - movs r1, 0x2 - bl pokemon_getattr - b _08177768 - .pool -_0817773C: - ldr r1, =0x020375e4 - movs r0, 0x1 - strh r0, [r1] - ldr r2, =0x03005d94 - ldr r1, [sp] - lsls r0, r1, 2 - adds r0, r1 - lsls r1, r0, 4 - subs r1, r0 - lsls r1, 5 - adds r1, 0x4 - ldr r0, [r2] - adds r0, r1 - ldr r2, [sp, 0x4] - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 4 - adds r0, r1 - ldr r2, =0x02021cc4 - movs r1, 0x2 - bl pokemon_getattr_encrypted -_08177768: - ldr r0, =0x02021cc4 - bl GetStringEnd_Limit7 -_0817776E: - 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_81775E0 - - thumb_func_start sub_817778C -sub_817778C: @ 817778C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 16 - lsrs r5, r1, 16 - movs r0, 0 - mov r8, r0 - movs r7, 0 - ldr r1, =0x0203bcec - mov r10, r1 - ldr r0, =0x0203bcee - mov r9, r0 -_081777AC: - adds r0, r6, 0 - movs r1, 0xA - bl __umodsi3 - adds r4, r0, 0 - mov r1, r10 - strh r4, [r1] - adds r0, r5, 0 - movs r1, 0xA - bl __umodsi3 - mov r1, r9 - strh r0, [r1] - lsls r4, 16 - lsls r0, 16 - cmp r4, r0 - bne _081777FA - adds r0, r6, 0 - movs r1, 0xA - bl __udivsi3 - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r5, 0 - movs r1, 0xA - bl __udivsi3 - lsls r0, 16 - lsrs r5, r0, 16 - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x4 - bls _081777AC -_081777FA: - mov r0, r8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817778C - - thumb_func_start sub_8177814 -sub_8177814: @ 8177814 - push {r4,lr} - adds r1, r0, 0 - lsrs r4, r1, 16 - lsls r1, 16 - lsrs r1, 16 - ldr r0, =0x0000404b - bl VarSet - ldr r0, =0x0000404c - adds r1, r4, 0 - bl VarSet - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8177814 - - thumb_func_start sub_817783C -sub_817783C: @ 817783C - push {r4,lr} - ldr r0, =0x0000404b - bl VarGet - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =0x0000404c - bl VarGet - lsls r0, 16 - orrs r0, r4 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817783C - - thumb_func_start sub_8177864 -sub_8177864: @ 8177864 - push {lr} - lsls r0, 16 - lsrs r0, 16 - bl sub_8177814 - pop {r0} - bx r0 - thumb_func_end sub_8177864 - - thumb_func_start sub_8177874 -sub_8177874: @ 8177874 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_8177874 - - thumb_func_start sub_8177888 -sub_8177888: @ 8177888 - push {r4,r5,lr} - sub sp, 0xC - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0xE - movs r1, 0 - bl SetGpuReg - movs r0, 0xC - movs r1, 0 - bl SetGpuReg - movs r0, 0xA - movs r1, 0 - bl SetGpuReg - movs r0, 0x8 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1C - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - add r1, sp, 0x4 - movs r0, 0 - strh r0, [r1] - ldr r1, =0x040000d4 - add r0, sp, 0x4 - str r0, [r1] - movs r0, 0xC0 - lsls r0, 19 - str r0, [r1, 0x4] - ldr r0, =0x8100c000 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r5, 0 - str r5, [sp, 0x8] - add r0, sp, 0x8 - str r0, [r1] - movs r0, 0xE0 - lsls r0, 19 - str r0, [r1, 0x4] - ldr r0, =0x85000100 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - add r0, sp, 0x4 - strh r5, [r0] - str r0, [r1] - movs r0, 0xA0 - lsls r0, 19 - str r0, [r1, 0x4] - ldr r0, =0x81000200 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - bl remove_some_task - bl ResetTasks - bl ResetAllObjectData - bl sub_80A1A74 - bl ResetObjectPaletteAllocator - ldr r0, =gUnknown_085E7088 - movs r1, 0 - movs r2, 0x40 - bl gpu_pal_apply - ldr r4, =0x0203bcf0 - movs r0, 0x80 - lsls r0, 5 - bl Alloc - str r0, [r4] - bl sub_8177B44 - bl sub_8177B9C - bl reset_temp_tile_data_buffers - ldr r1, =gUnknown_085E7804 - str r5, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram -_0817797C: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0817797C - ldr r0, =gUnknown_085E70C8 - ldr r1, =0x0203bcf0 - ldr r1, [r1] - bl LZDecompressWram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - bl pokedex_diploma_something - movs r4, 0x1 - negs r4, r4 - adds r0, r4, 0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - str r5, [sp] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - movs r0, 0x1 - bl EnableInterrupts - ldr r0, =sub_8177874 - bl SetVBlankCallback - ldr r0, =sub_8177A08 - bl SetMainCallback2 - ldr r0, =sub_8177A20 - movs r1, 0 - bl CreateTask - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8177888 - - thumb_func_start sub_8177A08 -sub_8177A08: @ 8177A08 - push {lr} - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_8177A08 - - thumb_func_start sub_8177A20 -sub_8177A20: @ 8177A20 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08177A40 - ldr r0, =0x03005e00 - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8177A50 - str r0, [r1] -_08177A40: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8177A20 - - thumb_func_start sub_8177A50 -sub_8177A50: @ 8177A50 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08177A82 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8177A98 - str r1, [r0] -_08177A82: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8177A50 - - thumb_func_start sub_8177A98 -sub_8177A98: @ 8177A98 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08177AC2 - ldr r0, =0x0203bcf0 - ldr r0, [r0] - bl Free - bl FreeAllWindowBuffers - adds r0, r4, 0 - bl DestroyTask - ldr r0, =sub_80861E8 - bl SetMainCallback2 -_08177AC2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8177A98 - - thumb_func_start pokedex_diploma_something -pokedex_diploma_something: @ 8177AD4 - push {r4,lr} - bl sub_80C0944 - lsls r0, 16 - cmp r0, 0 - beq _08177AFC - movs r1, 0x80 - lsls r1, 1 - movs r0, 0x14 - bl SetGpuReg - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EE855 - bl CopyString - b _08177B0C - .pool -_08177AFC: - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EE84F - bl CopyString -_08177B0C: - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EE85E - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x1 - bl sub_8177BCC - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokedex_diploma_something - - thumb_func_start sub_8177B44 -sub_8177B44: @ 8177B44 - push {lr} - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085E81FC - movs r0, 0 - movs r2, 0x2 - bl InitBgsFromTemplates - ldr r0, =0x0203bcf0 - ldr r1, [r0] - movs r0, 0x1 - bl SetBgTilemapBuffer - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end sub_8177B44 - - thumb_func_start sub_8177B9C -sub_8177B9C: @ 8177B9C - push {lr} - ldr r0, =gUnknown_085E8204 - bl InitWindows - bl DeactivateAllTextPrinters - ldr r0, =gUnknown_0860F074 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - bl PutWindowTilemap - pop {r0} - bx r0 - .pool - thumb_func_end sub_8177B9C - - thumb_func_start sub_8177BCC -sub_8177BCC: @ 8177BCC - push {r4-r6,lr} - sub sp, 0x18 - adds r6, r0, 0 - adds r4, r1, 0 - adds r5, r2, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =gUnknown_085E8214 - add r0, sp, 0x14 - movs r2, 0x3 - bl memcpy - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - add r0, sp, 0x14 - str r0, [sp, 0x8] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0xC] - str r6, [sp, 0x10] - movs r0, 0 - movs r1, 0x1 - adds r2, r4, 0 - adds r3, r5, 0 - bl AddTextPrinterParametrized2 - add sp, 0x18 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8177BCC - - thumb_func_start sub_8177C14 -sub_8177C14: @ 8177C14 - push {r4,lr} - ldr r4, =0x0203bcf4 - ldr r0, =0x0000180c - bl AllocZeroed - str r0, [r4] - ldr r0, =0x0203ce7c - ldrh r0, [r0] - bl ItemIdToBerryType - ldr r1, [r4] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0xC0 - lsls r2, 5 - adds r1, r2 - strh r0, [r1] - ldr r0, =sub_8177C84 - bl SetMainCallback2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8177C14 - - thumb_func_start sub_8177C54 -sub_8177C54: @ 8177C54 - push {lr} - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_8177C54 - - thumb_func_start sub_8177C70 -sub_8177C70: @ 8177C70 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_8177C70 - - thumb_func_start sub_8177C84 -sub_8177C84: @ 8177C84 - push {lr} -_08177C86: - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08177CAA - bl sub_8177CB0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08177CAA - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08177C86 -_08177CAA: - pop {r0} - bx r0 - thumb_func_end sub_8177C84 - - thumb_func_start sub_8177CB0 -sub_8177CB0: @ 8177CB0 - push {lr} - sub sp, 0x4 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0xF - bls _08177CC4 - b _08177DF4 -_08177CC4: - lsls r0, 2 - ldr r1, =_08177CD8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08177CD8: - .4byte _08177D18 - .4byte _08177D26 - .4byte _08177D2C - .4byte _08177D40 - .4byte _08177D46 - .4byte _08177D4C - .4byte _08177D5C - .4byte _08177D78 - .4byte _08177D84 - .4byte _08177D8A - .4byte _08177D90 - .4byte _08177D96 - .4byte _08177D9C - .4byte _08177DA6 - .4byte _08177DB4 - .4byte _08177DC2 -_08177D18: - bl SetVBlankHBlankCallbacksToNull - bl sub_8121DA0 - bl clear_scheduled_bg_copies_to_vram - b _08177DDC -_08177D26: - bl remove_some_task - b _08177DDC -_08177D2C: - bl sub_80A1A74 - ldr r2, =0x02037fd4 - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - b _08177DDA - .pool -_08177D40: - bl ResetAllObjectData - b _08177DDC -_08177D46: - bl ResetObjectPaletteAllocator - b _08177DDC -_08177D4C: - bl sub_81221AC - lsls r0, 24 - cmp r0, 0 - bne _08177DDC - bl ResetTasks - b _08177DDC -_08177D5C: - bl sub_8177E14 - ldr r0, =0x0203bcf4 - ldr r0, [r0] - ldr r1, =0x00001808 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _08177DDC - .pool -_08177D78: - bl sub_8177E88 - lsls r0, 24 - cmp r0, 0 - beq _08177E0C - b _08177DDC -_08177D84: - bl sub_8178008 - b _08177DDC -_08177D8A: - bl sub_8178090 - b _08177DDC -_08177D90: - bl sub_81780F4 - b _08177DDC -_08177D96: - bl sub_8178338 - b _08177DDC -_08177D9C: - bl sub_817839C - bl sub_8178404 - b _08177DDC -_08177DA6: - ldr r0, =sub_8178654 - movs r1, 0 - bl CreateTask - b _08177DDC - .pool -_08177DB4: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - b _08177DDC -_08177DC2: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 -_08177DDA: - strb r0, [r2, 0x8] -_08177DDC: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08177E0C - .pool -_08177DF4: - ldr r0, =sub_8177C70 - bl SetVBlankCallback - ldr r0, =sub_8177C54 - bl SetMainCallback2 - movs r0, 0x1 - b _08177E0E - .pool -_08177E0C: - movs r0, 0 -_08177E0E: - add sp, 0x4 - pop {r1} - bx r1 - thumb_func_end sub_8177CB0 - - thumb_func_start sub_8177E14 -sub_8177E14: @ 8177E14 - push {r4,lr} - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085EFCF0 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - ldr r4, =0x0203bcf4 - ldr r1, [r4] - movs r0, 0x2 - bl SetBgTilemapBuffer - ldr r1, [r4] - movs r0, 0x80 - lsls r0, 4 - adds r1, r0 - movs r0, 0x3 - bl SetBgTilemapBuffer - bl sub_8121E10 - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x3 - 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, 0x3 - bl ShowBg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8177E14 - - thumb_func_start sub_8177E88 -sub_8177E88: @ 8177E88 - push {r4-r7,lr} - sub sp, 0x4 - ldr r1, =0x0203bcf4 - ldr r0, [r1] - ldr r2, =0x00001808 - adds r0, r2 - ldrh r0, [r0] - adds r7, r1, 0 - cmp r0, 0x5 - bls _08177E9E - b _08177FEC -_08177E9E: - lsls r0, 2 - ldr r1, =_08177EB4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08177EB4: - .4byte _08177ECC - .4byte _08177EF8 - .4byte _08177F1C - .4byte _08177F3C - .4byte _08177FA8 - .4byte _08177FC8 -_08177ECC: - bl reset_temp_tile_data_buffers - ldr r1, =gUnknown_08D9BB44 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r0, =0x0203bcf4 - ldr r1, [r0] - ldr r0, =0x00001808 - adds r1, r0 - b _08177FD6 - .pool -_08177EF8: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08177F06 - b _08177FFC -_08177F06: - ldr r0, =gUnknown_08D9BF98 - ldr r4, =0x0203bcf4 - ldr r1, [r4] - bl LZDecompressWram - ldr r1, [r4] - b _08177FD2 - .pool -_08177F1C: - ldr r0, =gUnknown_08D9C13C - ldr r1, [r7] - movs r2, 0x80 - lsls r2, 5 - adds r1, r2 - bl LZDecompressWram - ldr r1, [r7] - ldr r0, =0x00001808 - adds r1, r0 - b _08177FD6 - .pool -_08177F3C: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _08177F78 - movs r2, 0 - ldr r6, =0x0203bcf4 - movs r5, 0x80 - lsls r5, 4 - ldr r4, =0x00004042 - ldr r3, =0x000003ff -_08177F52: - ldr r0, [r6] - lsls r1, r2, 1 - adds r0, r5 - adds r0, r1 - strh r4, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, r3 - bls _08177F52 - b _08177F98 - .pool -_08177F78: - movs r2, 0 - ldr r6, =0x0203bcf4 - movs r5, 0x80 - lsls r5, 4 - ldr r4, =0x00005042 - ldr r3, =0x000003ff -_08177F84: - ldr r0, [r6] - lsls r1, r2, 1 - adds r0, r5 - adds r0, r1 - strh r4, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, r3 - bls _08177F84 -_08177F98: - ldr r1, [r7] - b _08177FD2 - .pool -_08177FA8: - ldr r0, =gUnknown_08D9BEF0 - movs r1, 0 - movs r2, 0xC0 - bl decompress_palette - ldr r0, =0x0203bcf4 - ldr r1, [r0] - ldr r0, =0x00001808 - adds r1, r0 - b _08177FD6 - .pool -_08177FC8: - ldr r0, =gUnknown_0857FDEC - bl LoadCompressedObjectPic - ldr r0, =0x0203bcf4 - ldr r1, [r0] -_08177FD2: - ldr r2, =0x00001808 - adds r1, r2 -_08177FD6: - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _08177FFC - .pool -_08177FEC: - ldr r0, =gUnknown_0857FDF4 - bl LoadCompressedObjectPalette - movs r0, 0x1 - b _08177FFE - .pool -_08177FFC: - movs r0, 0 -_08177FFE: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8177E88 - - thumb_func_start sub_8178008 -sub_8178008: @ 8178008 - push {r4,lr} - ldr r0, =gUnknown_085EFD28 - bl InitWindows - bl DeactivateAllTextPrinters - ldr r0, =gUnknown_085EFD00 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - movs r4, 0 -_08178020: - lsls r0, r4, 24 - lsrs r0, 24 - bl PutWindowTilemap - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x3 - bls _08178020 - 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 sub_8178008 - - thumb_func_start sub_817804C -sub_817804C: @ 817804C - push {r4-r6,lr} - sub sp, 0x14 - ldr r6, [sp, 0x24] - ldr r5, [sp, 0x28] - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r5, 24 - lsrs r5, 24 - movs r4, 0 - str r4, [sp] - str r4, [sp, 0x4] - lsls r4, r5, 1 - adds r4, r5 - ldr r5, =gUnknown_085EFD20 - adds r4, r5 - str r4, [sp, 0x8] - lsls r6, 24 - asrs r6, 24 - str r6, [sp, 0xC] - str r1, [sp, 0x10] - movs r1, 0x1 - bl AddTextPrinterParametrized2 - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817804C - - thumb_func_start sub_8178090 -sub_8178090: @ 8178090 - push {r4,lr} - sub sp, 0x8 - movs r0, 0 - bl GetBgTilemapBuffer - ldr r1, =0x0203bcf4 - ldr r1, [r1] - movs r2, 0x80 - lsls r2, 5 - adds r1, r2 - movs r2, 0x80 - lsls r2, 4 - bl memcpy - movs r0, 0x3 - movs r1, 0xFF - bl FillWindowPixelBuffer - ldr r4, =gUnknown_085E926B - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x40 - bl GetStringCenterAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x3 - adds r1, r4, 0 - movs r3, 0x1 - bl sub_817804C - movs r0, 0x3 - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8178090 - - thumb_func_start sub_81780F4 -sub_81780F4: @ 81780F4 - push {lr} - bl sub_8178110 - bl sub_8178174 - bl itemid_copy_name - bl sub_81782D0 - bl sub_8178304 - pop {r0} - bx r0 - thumb_func_end sub_81780F4 - - thumb_func_start sub_8178110 -sub_8178110: @ 8178110 - push {r4-r6,lr} - sub sp, 0x8 - ldr r5, =0x0203bcf4 - ldr r0, [r5] - movs r4, 0xC0 - lsls r4, 5 - adds r0, r4 - ldrb r0, [r0] - bl GetBerryInfo - adds r6, r0, 0 - ldr r0, =0x02021cc4 - ldr r1, [r5] - adds r1, r4 - ldrh r1, [r1] - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, =0x02021dc4 - adds r1, r6, 0 - bl CopyString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E9263 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_817804C - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8178110 - - thumb_func_start sub_8178174 -sub_8178174: @ 8178174 - push {r4-r7,lr} - sub sp, 0xC - ldr r0, =0x0203bcf4 - ldr r0, [r0] - movs r1, 0xC0 - lsls r1, 5 - adds r0, r1 - ldrb r0, [r0] - bl GetBerryInfo - adds r4, r0, 0 - ldr r2, =gUnknown_085E9225 - movs r7, 0x1 - str r7, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r6, 0 - str r6, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0 - bl Print - ldrh r0, [r4, 0x8] - cmp r0, 0 - beq _08178230 - adds r1, r0, 0 - lsls r0, r1, 5 - subs r0, r1 - lsls r0, 2 - adds r0, r1 - lsls r0, 3 - movs r1, 0xFE - bl __divsi3 - adds r5, r0, 0 - movs r1, 0xA - bl __umodsi3 - cmp r0, 0x4 - bls _081781C8 - adds r5, 0xA -_081781C8: - adds r0, r5, 0 - movs r1, 0x64 - bl __umodsi3 - movs r1, 0xA - bl __udivsi3 - adds r4, r0, 0 - adds r0, r5, 0 - movs r1, 0x64 - bl __udivsi3 - adds r5, r0, 0 - ldr r0, =0x02021cc4 - adds r1, r5, 0 - movs r2, 0 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r0, =0x02021dc4 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E9233 - adds r0, r4, 0 - bl ExpandStringRefs - str r7, [sp] - str r6, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x28 - bl Print - b _08178242 - .pool -_08178230: - ldr r2, =gUnknown_085E8D34 - str r7, [sp] - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x28 - bl Print -_08178242: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8178174 - - thumb_func_start itemid_copy_name -itemid_copy_name: @ 8178250 - push {r4-r6,lr} - sub sp, 0xC - ldr r0, =0x0203bcf4 - ldr r0, [r0] - movs r1, 0xC0 - lsls r1, 5 - adds r0, r1 - ldrb r0, [r0] - bl GetBerryInfo - adds r6, r0, 0 - ldr r2, =gUnknown_085E922C - movs r5, 0x11 - str r5, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0 - bl Print - ldrb r0, [r6, 0x7] - cmp r0, 0 - beq _081782B0 - ldr r0, =gBerryFirmnessStringPointers - ldrb r1, [r6, 0x7] - subs r1, 0x1 - lsls r1, 2 - adds r1, r0 - ldr r2, [r1] - str r5, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x28 - bl Print - b _081782C2 - .pool -_081782B0: - ldr r2, =gUnknown_085E8D34 - str r5, [sp] - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x28 - bl Print -_081782C2: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end itemid_copy_name - - thumb_func_start sub_81782D0 -sub_81782D0: @ 81782D0 - push {lr} - sub sp, 0xC - ldr r0, =0x0203bcf4 - ldr r0, [r0] - movs r1, 0xC0 - lsls r1, 5 - adds r0, r1 - ldrb r0, [r0] - bl GetBerryInfo - ldr r2, [r0, 0xC] - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r3, 0 - bl Print - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_81782D0 - - thumb_func_start sub_8178304 -sub_8178304: @ 8178304 - push {lr} - sub sp, 0xC - ldr r0, =0x0203bcf4 - ldr r0, [r0] - movs r1, 0xC0 - lsls r1, 5 - adds r0, r1 - ldrb r0, [r0] - bl GetBerryInfo - ldr r2, [r0, 0x10] - movs r0, 0x11 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r3, 0 - bl Print - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_8178304 - - thumb_func_start sub_8178338 -sub_8178338: @ 8178338 - push {r4,lr} - ldr r4, =0x0203bcf4 - ldr r0, [r4] - movs r1, 0xC0 - lsls r1, 5 - adds r0, r1 - ldrb r0, [r0] - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x38 - movs r2, 0x40 - bl sub_80D50D4 - ldr r1, [r4] - ldr r2, =0x00001802 - adds r1, r2 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8178338 - - thumb_func_start sub_817836C -sub_817836C: @ 817836C - push {lr} - ldr r0, =0x0203bcf4 - ldr r0, [r0] - ldr r1, =0x00001802 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - bl sub_80D510C - pop {r0} - bx r0 - .pool - thumb_func_end sub_817836C - - thumb_func_start sub_817839C -sub_817839C: @ 817839C - push {r4,lr} - movs r0, 0x40 - bl sub_80D518C - ldr r4, =0x0203bcf4 - ldr r1, [r4] - ldr r2, =0x00001803 - adds r1, r2 - strb r0, [r1] - movs r0, 0x68 - bl sub_80D518C - ldr r1, [r4] - ldr r2, =0x00001804 - adds r1, r2 - strb r0, [r1] - movs r0, 0x90 - bl sub_80D518C - ldr r1, [r4] - ldr r2, =0x00001805 - adds r1, r2 - strb r0, [r1] - movs r0, 0xB8 - bl sub_80D518C - ldr r1, [r4] - ldr r2, =0x00001806 - adds r1, r2 - strb r0, [r1] - movs r0, 0xE0 - bl sub_80D518C - ldr r1, [r4] - ldr r2, =0x00001807 - adds r1, r2 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817839C - - thumb_func_start sub_8178404 -sub_8178404: @ 8178404 - push {r4,r5,lr} - ldr r4, =0x0203bcf4 - ldr r0, [r4] - movs r1, 0xC0 - lsls r1, 5 - adds r0, r1 - ldrb r0, [r0] - bl GetBerryInfo - adds r5, r0, 0 - ldrb r0, [r5, 0x15] - cmp r0, 0 - beq _08178448 - ldr r3, =0x02020630 - ldr r0, [r4] - ldr r1, =0x00001803 - adds r0, r1 - ldrb r1, [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 - b _08178462 - .pool -_08178448: - ldr r3, =0x02020630 - ldr r0, [r4] - ldr r1, =0x00001803 - 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] - movs r2, 0x4 - orrs r1, r2 -_08178462: - strb r1, [r0] - adds r4, r3, 0 - ldrb r0, [r5, 0x16] - cmp r0, 0 - beq _0817849C - ldr r3, =0x0203bcf4 - ldr r0, [r3] - ldr r1, =0x00001804 - adds r0, r1 - ldrb r1, [r0] - 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 - b _081784B6 - .pool -_0817849C: - ldr r3, =0x0203bcf4 - ldr r0, [r3] - ldr r1, =0x00001804 - adds r0, r1 - ldrb r1, [r0] - 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 -_081784B6: - strb r1, [r0] - ldrb r0, [r5, 0x17] - cmp r0, 0 - beq _081784E8 - ldr r0, [r3] - ldr r1, =0x00001805 - adds r0, r1 - ldrb r1, [r0] - 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 - b _08178500 - .pool -_081784E8: - ldr r0, [r3] - ldr r1, =0x00001805 - adds r0, r1 - ldrb r1, [r0] - 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 -_08178500: - strb r1, [r0] - ldrb r0, [r5, 0x18] - cmp r0, 0 - beq _0817852C - ldr r0, [r3] - ldr r1, =0x00001806 - adds r0, r1 - ldrb r1, [r0] - 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 - b _08178544 - .pool -_0817852C: - ldr r0, [r3] - ldr r1, =0x00001806 - adds r0, r1 - ldrb r1, [r0] - 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 -_08178544: - strb r1, [r0] - ldrb r0, [r5, 0x19] - cmp r0, 0 - beq _08178570 - ldr r0, [r3] - ldr r1, =0x00001807 - adds r0, r1 - ldrb r1, [r0] - 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 - b _08178588 - .pool -_08178570: - ldr r0, [r3] - ldr r1, =0x00001807 - adds r0, r1 - ldrb r1, [r0] - 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 -_08178588: - strb r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8178404 - - thumb_func_start sub_8178594 -sub_8178594: @ 8178594 - push {r4,lr} - movs r4, 0 -_08178598: - ldr r0, =0x0203bcf4 - ldr r0, [r0] - ldr r1, =0x00001803 - adds r0, r1 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x4 - bls _08178598 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8178594 - - thumb_func_start sub_81785D0 -sub_81785D0: @ 81785D0 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl audio_play - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8178610 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81785D0 - - thumb_func_start sub_8178610 -sub_8178610: @ 8178610 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08178642 - bl sub_817836C - bl sub_8178594 - ldr r0, =0x0203bcf4 - ldr r0, [r0] - bl Free - bl FreeAllWindowBuffers - ldr r0, =bag_menu_mail_related - bl SetMainCallback2 - adds r0, r4, 0 - bl DestroyTask -_08178642: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8178610 - - thumb_func_start sub_8178654 -sub_8178654: @ 8178654 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - adds r4, r2, 0 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081786A6 - ldr r3, =0x030022c0 - ldrh r0, [r3, 0x30] - movs r1, 0xF0 - ands r1, r0 - cmp r1, 0x40 - bne _08178688 - movs r1, 0x1 - negs r1, r1 - adds r0, r2, 0 - bl sub_81786AC - b _081786A6 - .pool -_08178688: - cmp r1, 0x80 - bne _08178696 - adds r0, r2, 0 - movs r1, 0x1 - bl sub_81786AC - b _081786A6 -_08178696: - ldrh r1, [r3, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081786A6 - adds r0, r4, 0 - bl sub_81785D0 -_081786A6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8178654 - - thumb_func_start sub_81786AC -sub_81786AC: @ 81786AC - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r2, =0x03005e08 - adds r4, r0, r2 - ldr r2, =0x0203ce58 - ldrh r0, [r2, 0xE] - ldrh r2, [r2, 0x18] - adds r0, r2 - lsls r0, 16 - asrs r0, 16 - lsrs r7, r1, 24 - asrs r6, r1, 24 - adds r0, r6 - cmp r0, 0x2D - bhi _08178718 - lsls r1, r0, 16 - lsrs r1, 16 - movs r0, 0x4 - bl bag_pocket_get_itemid - lsls r0, 16 - cmp r0, 0 - beq _08178718 - cmp r6, 0 - bge _081786F4 - movs r0, 0x2 - b _081786F6 - .pool -_081786F4: - movs r0, 0x1 -_081786F6: - strh r0, [r4, 0x2] - movs r0, 0 - strh r0, [r4] - movs r0, 0x5 - bl audio_play - lsls r0, r7, 24 - asrs r0, 24 - bl sub_8178728 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81787AC - str r1, [r0] -_08178718: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81786AC - - thumb_func_start sub_8178728 -sub_8178728: @ 8178728 - push {r4-r6,lr} - ldr r5, =0x0203ce70 - adds r6, r5, 0 - subs r6, 0xA - lsls r0, 24 - asrs r4, r0, 24 - cmp r4, 0 - ble _08178764 - ldrh r0, [r6] - cmp r0, 0x3 - bls _08178752 - ldrh r1, [r5] - adds r1, 0x8 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x4 - bl bag_pocket_get_itemid - lsls r0, 16 - cmp r0, 0 - bne _08178760 -_08178752: - ldrh r0, [r6] - adds r0, r4 - strh r0, [r6] - b _0817877A - .pool -_08178760: - ldrh r0, [r5] - b _08178776 -_08178764: - ldrh r1, [r6] - cmp r1, 0x3 - bhi _08178770 - ldrh r0, [r5] - cmp r0, 0 - bne _08178776 -_08178770: - adds r0, r1, r4 - strh r0, [r6] - b _0817877A -_08178776: - adds r0, r4 - strh r0, [r5] -_0817877A: - ldrh r1, [r6] - ldrh r5, [r5] - adds r1, r5 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x4 - bl bag_pocket_get_itemid - lsls r0, 16 - lsrs r0, 16 - bl ItemIdToBerryType - ldr r1, =0x0203bcf4 - ldr r1, [r1] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0xC0 - lsls r2, 5 - adds r1, r2 - strh r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8178728 - - thumb_func_start sub_81787AC -sub_81787AC: @ 81787AC - 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, =0x03005e08 - adds r6, r0, r1 - ldrh r0, [r6] - adds r0, 0x10 - movs r1, 0xFF - ands r0, r1 - strh r0, [r6] - movs r1, 0x2 - ldrsh r0, [r6, r1] - cmp r0, 0x1 - bne _08178828 - movs r2, 0 - ldrsh r0, [r6, r2] - cmp r0, 0x70 - beq _08178888 - cmp r0, 0x70 - bgt _081787FE - cmp r0, 0x40 - beq _0817881A - cmp r0, 0x40 - bgt _081787F4 - cmp r0, 0x30 - beq _08178898 - b _081788A6 - .pool -_081787F4: - cmp r0, 0x50 - beq _0817888E - cmp r0, 0x60 - beq _08178820 - b _081788A6 -_081787FE: - cmp r0, 0xA0 - beq _08178824 - cmp r0, 0xA0 - bgt _08178810 - cmp r0, 0x80 - beq _08178882 - cmp r0, 0x90 - beq _08178878 - b _081788A6 -_08178810: - cmp r0, 0xB0 - beq _08178872 - cmp r0, 0xC0 - beq _0817886C - b _081788A6 -_0817881A: - bl sub_8178110 - b _081788A6 -_08178820: - movs r0, 0x1 - b _0817889A -_08178824: - movs r0, 0x2 - b _0817889A -_08178828: - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0x70 - beq _0817887E - cmp r0, 0x70 - bgt _0817884C - cmp r0, 0x40 - beq _0817886C - cmp r0, 0x40 - bgt _08178842 - cmp r0, 0x30 - beq _08178868 - b _081788A6 -_08178842: - cmp r0, 0x50 - beq _08178872 - cmp r0, 0x60 - beq _08178878 - b _081788A6 -_0817884C: - cmp r0, 0xA0 - beq _0817888E - cmp r0, 0xA0 - bgt _0817885E - cmp r0, 0x80 - beq _08178882 - cmp r0, 0x90 - beq _08178888 - b _081788A6 -_0817885E: - cmp r0, 0xB0 - beq _08178898 - cmp r0, 0xC0 - beq _081788A2 - b _081788A6 -_08178868: - movs r0, 0x2 - b _0817889A -_0817886C: - bl sub_8178304 - b _081788A6 -_08178872: - bl sub_81782D0 - b _081788A6 -_08178878: - bl sub_8178404 - b _081788A6 -_0817887E: - movs r0, 0x1 - b _0817889A -_08178882: - bl itemid_copy_name - b _081788A6 -_08178888: - bl sub_8178174 - b _081788A6 -_0817888E: - bl sub_817836C - bl sub_8178338 - b _081788A6 -_08178898: - movs r0, 0 -_0817889A: - movs r1, 0 - bl FillWindowPixelBuffer - b _081788A6 -_081788A2: - bl sub_8178110 -_081788A6: - movs r2, 0x2 - ldrsh r0, [r6, r2] - cmp r0, 0x1 - bne _081788B8 - ldrh r0, [r6] - negs r0, r0 - lsls r0, 16 - lsrs r5, r0, 16 - b _081788BA -_081788B8: - ldrh r5, [r6] -_081788BA: - ldr r2, =0x02020630 - ldr r3, =0x0203bcf4 - ldr r0, [r3] - ldr r1, =0x00001802 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r5, [r0, 0x26] - movs r4, 0 - adds r7, r2, 0 - ldr r2, =0x00001803 -_081788D6: - ldr r0, [r3] - adds r0, r2 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r5, [r0, 0x26] - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x4 - bls _081788D6 - movs r4, 0x80 - lsls r4, 5 - ldrb r2, [r6, 0x2] - movs r0, 0x1 - adds r1, r4, 0 - bl ChangeBgY - ldrb r2, [r6, 0x2] - movs r0, 0x2 - adds r1, r4, 0 - bl ChangeBgY - movs r2, 0 - ldrsh r0, [r6, r2] - cmp r0, 0 - bne _08178922 - ldr r0, =0x03005e00 - mov r2, r8 - lsls r1, r2, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8178654 - str r0, [r1] -_08178922: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81787AC - - thumb_func_start sub_8178944 -sub_8178944: @ 8178944 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_8178944 - - thumb_func_start sub_8178958 -sub_8178958: @ 8178958 - push {lr} - movs r2, 0 - ldr r1, =0x020229e8 - ldrh r0, [r1, 0x1A] - ldrh r1, [r1, 0x36] - cmp r0, r1 - bne _08178968 - movs r2, 0x1 -_08178968: - adds r0, r2, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8178958 - - thumb_func_start sub_8178974 -sub_8178974: @ 8178974 - push {r4,lr} - sub sp, 0x8 - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - bl ResetTasks - ldr r0, =sub_8178944 - bl SetVBlankCallback - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085EFD64 - movs r0, 0 - movs r2, 0x1 - bl InitBgsFromTemplates - ldr r0, =gUnknown_085EFD68 - bl InitWindows - lsls r0, 16 - cmp r0, 0 - beq _08178A22 - bl DeactivateAllTextPrinters - movs r4, 0 -_081789AC: - lsls r0, r4, 24 - lsrs r0, 24 - movs r1, 0 - bl FillWindowPixelBuffer - adds r4, 0x1 - cmp r4, 0x1 - ble _081789AC - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - movs r1, 0x1 - movs r2, 0xD0 - bl sub_809882C - movs r0, 0xE0 - bl sub_81978B0 - movs r1, 0xA0 - lsls r1, 1 - movs r0, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - ldr r0, =sub_8009404 - movs r1, 0 - bl CreateTask - bl sub_80A2F30 - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - movs r0, 0 - movs r1, 0 - movs r2, 0x2 - bl rboxid_80040B8 - ldr r0, =sub_8178A78 - bl SetMainCallback2 -_08178A22: - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8178974 - - thumb_func_start sub_8178A40 -sub_8178A40: @ 8178A40 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - movs r5, 0x1 - cmp r4, 0 - bne _08178A54 - ldr r1, =gUnknown_085EE80A - bl CopyString - movs r5, 0 -_08178A54: - cmp r4, 0x2 - bne _08178A5A - movs r5, 0 -_08178A5A: - cmp r4, 0x1 - bne _08178A66 - ldr r1, =gUnknown_085EE827 - adds r0, r6, 0 - bl CopyString -_08178A66: - adds r0, r5, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8178A40 - - thumb_func_start sub_8178A78 -sub_8178A78: @ 8178A78 - push {r4-r6,lr} - sub sp, 0x8 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r4, r1, 0 - cmp r0, 0x10 - bls _08178A8E - b _08178E58 -_08178A8E: - lsls r0, 2 - ldr r1, =_08178AA0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08178AA0: - .4byte _08178AE4 - .4byte _08178B12 - .4byte _08178B48 - .4byte _08178B80 - .4byte _08178BCC - .4byte _08178BDC - .4byte _08178C54 - .4byte _08178D28 - .4byte _08178D38 - .4byte _08178D58 - .4byte _08178D60 - .4byte _08178D74 - .4byte _08178DBC - .4byte _08178DE0 - .4byte _08178E0C - .4byte _08178E24 - .4byte _08178E48 -_08178AE4: - movs r0, 0 - movs r1, 0x1 - movs r2, 0x1 - movs r3, 0xD - bl SetWindowBorderStyle - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0 - bl ShowBg - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - b _08178E30 -_08178B12: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08178B20 - b _08178E58 -_08178B20: - ldr r1, =gUnknown_085EE765 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - movs r2, 0x1 - movs r3, 0x2 - bl sub_8178EC4 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _08178E3C - .pool -_08178B48: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - beq _08178B56 - b _08178E58 -_08178B56: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r1, =0x020229c6 - ldr r2, =0x00005501 - adds r0, r2, 0 - strh r0, [r1] - bl sub_8009734 - b _08178E58 - .pool -_08178B80: - ldr r0, =0x030030e0 - ldr r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - bne _08178B8E - b _08178D00 -_08178B8E: - movs r0, 0x1C - ands r1, r0 - cmp r1, 0x4 - bhi _08178B98 - b _08178D00 -_08178B98: - movs r0, 0x15 - bl audio_play - ldr r1, =gUnknown_085EE788 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - movs r2, 0x1 - movs r3, 0x2 - bl sub_8178EC4 - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08178D00 - .pool -_08178BCC: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - beq _08178BDA - b _08178E58 -_08178BDA: - b _08178E34 -_08178BDC: - bl sub_800ABAC - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x2 - bne _08178CD0 - ldr r4, =0x030022c0 - ldrh r1, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08178C38 - movs r0, 0x5 - bl audio_play - bl sub_800A620 - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x1 - movs r3, 0xD - bl SetWindowBorderStyle - ldr r1, =gUnknown_085EE7BF - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - movs r2, 0x1 - movs r3, 0x2 - bl sub_8178EC4 - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram - movs r2, 0x87 - lsls r2, 3 - adds r1, r4, r2 - b _08178E3C - .pool -_08178C38: - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _08178C42 - b _08178E58 -_08178C42: - movs r0, 0x5 - bl audio_play - bl sub_80097E8 - movs r0, 0x87 - lsls r0, 3 - adds r1, r4, r0 - b _08178D1E -_08178C54: - bl sub_800B320 - lsls r0, 24 - cmp r0, 0 - beq _08178D00 - ldr r0, =0x03003124 - ldrb r0, [r0] - cmp r0, 0 - bne _08178C68 - b _08178E58 -_08178C68: - movs r0, 0x2 - movs r1, 0x2 - bl sub_800A0C8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bne _08178CAC - bl sub_800AC34 - ldr r4, =0x02021fc4 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_8178A40 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x1 - movs r3, 0x2 - bl sub_8178EC4 - ldr r0, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - b _08178CF2 - .pool -_08178CAC: - bl sub_8178958 - lsls r0, 24 - cmp r0, 0 - beq _08178CCC - ldr r1, =gUnknown_085EE7CE - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - movs r2, 0x1 - movs r3, 0x2 - bl sub_8178EC4 - b _08178E34 - .pool -_08178CCC: - bl sub_80097E8 -_08178CD0: - ldr r4, =0x02021fc4 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_8178A40 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x1 - movs r3, 0x2 - bl sub_8178EC4 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 -_08178CF2: - movs r1, 0xD - strb r1, [r0] - b _08178E58 - .pool -_08178D00: - ldr r4, =0x030022c0 - ldrh r1, [r4, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08178D0E - b _08178E58 -_08178D0E: - movs r0, 0x5 - bl audio_play - bl sub_80097E8 - movs r2, 0x87 - lsls r2, 3 - adds r1, r4, r2 -_08178D1E: - movs r0, 0xF - strb r0, [r1] - b _08178E58 - .pool -_08178D28: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - cmp r0, 0 - beq _08178D36 - b _08178E58 -_08178D36: - b _08178E34 -_08178D38: - bl sub_800A550 - lsls r0, 24 - cmp r0, 0 - bne _08178D44 - b _08178E58 -_08178D44: - bl sub_800A5B4 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _08178E3C - .pool -_08178D58: - movs r0, 0x87 - lsls r0, 3 - adds r1, r4, r0 - b _08178E3C -_08178D60: - bl sub_800AC34 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _08178E3C - .pool -_08178D74: - ldr r0, =0x03003124 - ldrb r6, [r0] - cmp r6, 0 - bne _08178E58 - ldr r5, =0x0201c000 - adds r0, r5, 0 - bl sub_81538A0 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - str r6, [sp, 0x4] - ldr r2, =0x050001f5 - add r0, sp, 0x4 - adds r1, r5, 0 - bl CpuSet - ldr r0, =0x02021fc4 - adds r1, r4, 0 - bl sub_8178A40 - lsls r0, 24 - cmp r0, 0 - bne _08178E34 - movs r0, 0 - bl save_game_when_memory_present - b _08178E34 - .pool -_08178DBC: - ldr r1, =0x02021fc4 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - movs r2, 0x1 - movs r3, 0x2 - bl sub_8178EC4 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _08178E3C - .pool -_08178DE0: - movs r0, 0 - bl IsTextPrinterActive - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0 - bne _08178E58 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r1, [r0] - adds r1, 0x1 - strb r1, [r0] - ldr r0, =0x0203bcf8 - strb r2, [r0] - b _08178E58 - .pool -_08178E0C: - ldrh r1, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08178E58 - movs r0, 0x5 - bl audio_play - movs r2, 0x87 - lsls r2, 3 - adds r1, r4, r2 - b _08178E3C -_08178E24: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 -_08178E30: - bl pal_fade_maybe -_08178E34: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 -_08178E3C: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08178E58 - .pool -_08178E48: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08178E58 - bl Reset -_08178E58: - ldr r0, =0x030030e0 - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08178E98 - bl sub_800ABBC - lsls r0, 24 - cmp r0, 0 - bne _08178E98 - bl sub_80097E8 - ldr r4, =0x02021fc4 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_8178A40 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - adds r1, r4, 0 - movs r2, 0x1 - movs r3, 0x2 - bl sub_8178EC4 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0xD - strb r1, [r0] -_08178E98: - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8178A78 - - thumb_func_start sub_8178EC4 -sub_8178EC4: @ 8178EC4 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0x1C - adds r5, r0, 0 - mov r10, r1 - adds r6, r2, 0 - ldr r4, [sp, 0x38] - lsls r5, 24 - lsrs r5, 24 - lsls r6, 24 - lsrs r6, 24 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0 - mov r9, r0 - movs r1, 0x1 - mov r8, r1 - add r0, sp, 0x14 - mov r1, r8 - strb r1, [r0] - adds r1, r0, 0 - movs r0, 0x2 - strb r0, [r1, 0x1] - movs r0, 0x3 - strb r0, [r1, 0x2] - adds r0, r1, 0 - ldrb r0, [r0] - lsls r1, r0, 4 - orrs r1, r0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - str r3, [sp, 0x18] - bl FillWindowPixelBuffer - mov r0, r9 - str r0, [sp] - mov r1, r8 - str r1, [sp, 0x4] - add r0, sp, 0x14 - str r0, [sp, 0x8] - lsls r4, 24 - asrs r4, 24 - str r4, [sp, 0xC] - mov r1, r10 - str r1, [sp, 0x10] - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r6, 0 - ldr r3, [sp, 0x18] - bl AddTextPrinterParametrized2 - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8178EC4 - - thumb_func_start sub_8178F44 -sub_8178F44: @ 8178F44 - push {r4,r5,lr} - sub sp, 0x18 - adds r5, r0, 0 - adds r4, r1, 0 - adds r3, r2, 0 - lsls r3, 24 - add r0, sp, 0x14 - movs r2, 0 - strb r2, [r0] - adds r1, r0, 0 - movs r0, 0xF - strb r0, [r1, 0x1] - movs r0, 0x3 - strb r0, [r1, 0x2] - ldr r0, =0x0203bd0e - ldrb r0, [r0] - lsls r4, 27 - lsrs r4, 24 - lsrs r3, 21 - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - str r2, [sp] - str r2, [sp, 0x4] - str r1, [sp, 0x8] - str r2, [sp, 0xC] - str r5, [sp, 0x10] - movs r1, 0x1 - adds r2, r4, 0 - bl AddTextPrinterParametrized2 - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8178F44 - - thumb_func_start fullscreen_save_activate -fullscreen_save_activate: @ 8178F90 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =sub_8178FDC - bl SetMainCallback2 - ldr r0, =0x0203bcfc - strh r4, [r0] - ldr r1, =0x0203bcfe - movs r2, 0 - movs r0, 0 - strh r0, [r1] - strh r0, [r1, 0x2] - ldr r0, =0x0203bd0e - strb r2, [r0] - strb r2, [r0, 0x1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end fullscreen_save_activate - - thumb_func_start sub_8178FC8 -sub_8178FC8: @ 8178FC8 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_8178FC8 - - thumb_func_start sub_8178FDC -sub_8178FDC: @ 8178FDC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r7, r0, r1 - ldrb r0, [r7] - cmp r0, 0 - beq _08178FF8 - cmp r0, 0x1 - bne _08178FF8 - b _0817925C -_08178FF8: - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0xE - movs r1, 0 - bl SetGpuReg - movs r0, 0xC - movs r1, 0 - bl SetGpuReg - movs r0, 0xA - movs r1, 0 - bl SetGpuReg - movs r0, 0x8 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1C - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - movs r0, 0x18 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1A - movs r1, 0 - bl SetGpuReg - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - add r1, sp, 0x4 - movs r0, 0 - strh r0, [r1] - ldr r2, =0x040000d4 - str r1, [r2] - movs r1, 0xC0 - lsls r1, 19 - str r1, [r2, 0x4] - ldr r0, =0x8100c000 - str r0, [r2, 0x8] - ldr r0, [r2, 0x8] - movs r3, 0 - mov r8, r3 - str r3, [sp, 0x8] - add r4, sp, 0x8 - str r4, [r2] - movs r0, 0xE0 - lsls r0, 19 - str r0, [r2, 0x4] - ldr r0, =0x85000100 - str r0, [r2, 0x8] - ldr r0, [r2, 0x8] - add r0, sp, 0x4 - mov r3, r8 - strh r3, [r0] - str r0, [r2] - movs r0, 0xA0 - lsls r0, 19 - str r0, [r2, 0x4] - ldr r0, =0x81000200 - str r0, [r2, 0x8] - ldr r0, [r2, 0x8] - ldr r0, =gUnknown_085B0E04 - bl LZ77UnCompVram - ldr r0, =gUnknown_085B0A80 - ldr r1, =0x06007000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085B0C0C - ldr r1, =0x06007800 - bl LZ77UnCompVram - ldr r0, =gUnknown_085EFDE4 - ldr r1, =0x06010020 - bl LZ77UnCompVram - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085EFD88 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r5, =0x0201e000 - movs r0, 0 - adds r1, r5, 0 - bl SetBgTilemapBuffer - mov r0, r8 - str r0, [sp, 0x8] - ldr r2, =0x05000200 - adds r0, r4, 0 - adds r1, r5, 0 - bl CpuSet - ldr r1, =gUnknown_0850E87C - movs r2, 0x90 - lsls r2, 1 - movs r6, 0x85 - lsls r6, 2 - movs r0, 0 - adds r3, r6, 0 - bl LoadBgTiles - ldr r0, =gUnknown_085EFD94 - bl InitWindows - ldr r0, =gUnknown_085EFD9C - bl AddWindowWithoutTileMap - ldr r4, =0x0203bd0e - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0x80 - lsls r1, 4 - adds r2, r5, r1 - movs r1, 0x7 - bl SetWindowAttribute - ldr r0, =gUnknown_085EFDA4 - bl AddWindowWithoutTileMap - strb r0, [r4, 0x1] - ldrb r0, [r4, 0x1] - movs r3, 0xE8 - lsls r3, 5 - adds r5, r3 - movs r1, 0x7 - adds r2, r5, 0 - bl SetWindowAttribute - bl DeactivateAllTextPrinters - bl ResetAllObjectData - bl ResetTasks - bl sub_80A1A74 - ldr r0, =gUnknown_085B0A00 - movs r1, 0 - movs r2, 0x40 - bl gpu_pal_apply - ldr r0, =gUnknown_085EFDC4 - movs r1, 0x80 - lsls r1, 1 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_0850FEFC - movs r1, 0xE0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_0860F074 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - ldrb r0, [r4] - movs r1, 0 - adds r2, r6, 0 - movs r3, 0xE - bl SetWindowBorderStyle - ldrb r0, [r4, 0x1] - movs r1, 0 - adds r2, r6, 0 - movs r3, 0xE - bl SetWindowBorderStyle - ldrb r0, [r4, 0x1] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldrb r0, [r4, 0x1] - movs r1, 0x2 - bl CopyWindowToVram - ldrb r0, [r4] - movs r1, 0x1 - bl CopyWindowToVram - ldr r0, =gUnknown_085EC816 - movs r1, 0x1 - movs r2, 0 - bl sub_8178F44 - movs r0, 0x1 - negs r0, r0 - mov r1, r8 - str r1, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - movs r0, 0x1 - bl EnableInterrupts - ldr r0, =sub_8178FC8 - bl SetVBlankCallback - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - ldrb r0, [r7] - adds r0, 0x1 - strb r0, [r7] - b _08179272 - .pool -_0817925C: - bl fade_and_return_progress_probably - lsls r0, 24 - cmp r0, 0 - bne _08179272 - ldr r0, =sub_8179288 - bl SetMainCallback2 - ldr r0, =sub_8179454 - bl SetVBlankCallback -_08179272: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8178FDC - - thumb_func_start sub_8179288 -sub_8179288: @ 8179288 - push {r4-r6,lr} - movs r5, 0 - ldr r0, =0x0203bcfe - movs r1, 0x1 - strh r1, [r0] - ldr r1, =0x030061fc - ldr r0, [r1] - cmp r0, 0 - beq _081792EC - adds r6, r1, 0 -_0817929C: - ldr r0, [r6] - bl sub_81795AC - lsls r0, 24 - cmp r0, 0 - bne _08179348 - ldr r4, =0x0203bd0e - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_085EC917 - movs r1, 0x1 - movs r2, 0 - bl sub_8178F44 - ldr r0, =0x0203bcfc - ldrb r0, [r0] - bl calls_flash_erase_block_3 - ldr r0, [r6] - cmp r0, 0 - beq _081792DC - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_085EC816 - movs r1, 0x1 - movs r2, 0 - bl sub_8178F44 -_081792DC: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r6] - cmp r0, 0 - beq _081792EC - cmp r5, 0x2 - bls _0817929C -_081792EC: - cmp r5, 0x3 - bne _0817931C - ldr r0, =0x0203bd0e - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_085EC86F - b _08179330 - .pool -_0817931C: - ldr r0, =0x0203bd0e - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =0x03006214 - ldr r0, [r0] - cmp r0, 0 - bne _08179370 - ldr r0, =gUnknown_085EC94F -_08179330: - movs r1, 0x1 - movs r2, 0 - bl sub_8178F44 - b _0817937A - .pool -_08179348: - ldr r0, =0x0203bd0e - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_085EC86F - movs r1, 0x1 - movs r2, 0 - bl sub_8178F44 - ldr r0, =sub_8179390 - bl SetMainCallback2 - b _08179380 - .pool -_08179370: - ldr r0, =gUnknown_085EC9A2 - movs r1, 0x1 - movs r2, 0 - bl sub_8178F44 -_0817937A: - ldr r0, =sub_81793E0 - bl SetMainCallback2 -_08179380: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8179288 - - thumb_func_start sub_8179390 -sub_8179390: @ 8179390 - push {lr} - ldr r1, =0x0203bcfe - movs r0, 0 - strh r0, [r1] - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081793C4 - ldr r0, =0x0203bd0e - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_085EC8D4 - movs r1, 0x1 - movs r2, 0 - bl sub_8178F44 - ldr r0, =sub_8178FC8 - bl SetVBlankCallback - ldr r0, =sub_81793E0 - bl SetMainCallback2 -_081793C4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8179390 - - thumb_func_start sub_81793E0 -sub_81793E0: @ 81793E0 - push {lr} - sub sp, 0x4 - ldr r0, =0x0203bcfe - movs r2, 0 - strh r2, [r0] - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08179410 - movs r0, 0x1 - negs r0, r0 - str r2, [sp] - movs r1, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =sub_8178FC8 - bl SetVBlankCallback - ldr r0, =sub_8179428 - bl SetMainCallback2 -_08179410: - add sp, 0x4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81793E0 - - thumb_func_start sub_8179428 -sub_8179428: @ 8179428 - push {r4,r5,lr} - bl fade_and_return_progress_probably - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _0817944E - ldr r5, =0x03006214 - ldr r0, [r5] - cmp r0, 0 - bne _08179448 - bl Reset - b _0817944E - .pool -_08179448: - bl SetMainCallback2 - str r4, [r5] -_0817944E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8179428 - - thumb_func_start sub_8179454 -sub_8179454: @ 8179454 - push {r4,r5,lr} - ldr r5, =0x030022c0 - ldr r0, [r5, 0x24] - lsrs r4, r0, 3 - movs r0, 0x7 - ands r4, r0 - ldr r0, =gUnknown_085EFD80 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [r5, 0x38] - str r1, [r5, 0x3C] - ldrh r1, [r5, 0x3A] - ldr r0, =0xfffffe00 - ands r0, r1 - movs r1, 0x70 - orrs r0, r1 - strh r0, [r5, 0x3A] - adds r1, r5, 0 - adds r1, 0x38 - movs r0, 0x48 - strb r0, [r1] - ldr r0, =0x0203bcfe - ldrh r0, [r0] - cmp r0, 0 - beq _081794DC - ldr r3, =gUnknown_085EFDAC - lsls r2, r4, 1 - adds r2, r4 - adds r0, r2, r3 - ldrb r4, [r0] - ldrh r1, [r5, 0x3C] - ldr r0, =0xfffffc00 - ands r0, r1 - orrs r0, r4 - strh r0, [r5, 0x3C] - adds r0, r3, 0x2 - adds r0, r2, r0 - ldrb r1, [r0] - lsls r1, 4 - adds r3, 0x1 - adds r2, r3 - ldrb r0, [r2] - lsls r0, 3 - orrs r1, r0 - adds r3, r5, 0 - adds r3, 0x3B - movs r0, 0x1F - ands r1, r0 - lsls r1, 1 - ldrb r2, [r3] - movs r0, 0x3F - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - b _081794E8 - .pool -_081794DC: - ldrh r0, [r5, 0x3C] - ldr r1, =0xfffffc00 - ands r1, r0 - movs r0, 0x1 - orrs r1, r0 - strh r1, [r5, 0x3C] -_081794E8: - ldr r0, =0x030022f8 - movs r1, 0xE0 - lsls r1, 19 - movs r2, 0x1 - bl CpuFastSet - ldr r1, =0x0203bcfe - ldrh r0, [r1, 0x2] - cmp r0, 0 - beq _08179500 - subs r0, 0x1 - strh r0, [r1, 0x2] -_08179500: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8179454 - - thumb_func_start sub_8179514 -sub_8179514: @ 8179514 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - ldr r4, =0x0203abbc - movs r3, 0x80 - lsls r3, 5 - movs r1, 0 - adds r2, r4, 0 - bl ReadFlash - movs r1, 0 - ldr r2, =0x000003ff -_0817952C: - ldr r0, [r4] - cmp r0, 0 - beq _08179540 - movs r0, 0x1 - b _0817954E - .pool -_08179540: - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - adds r4, 0x4 - cmp r1, r2 - bls _0817952C - movs r0, 0 -_0817954E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8179514 - - thumb_func_start sub_8179554 -sub_8179554: @ 8179554 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r6, r0, 16 - movs r0, 0 - ldr r1, =0x00000fff - mov r8, r1 - ldr r7, =0x03007854 -_08179566: - movs r4, 0 - adds r5, r0, 0x1 -_0817956A: - ldr r3, [r7] - adds r0, r6, 0 - adds r1, r4, 0 - movs r2, 0 - bl _call_via_r3 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r8 - bls _0817956A - adds r0, r6, 0 - bl sub_8179514 - lsls r0, 24 - lsrs r1, r0, 24 - lsls r0, r5, 16 - lsrs r0, 16 - cmp r1, 0 - beq _08179596 - cmp r0, 0x81 - bls _08179566 -_08179596: - adds r0, r1, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8179554 - - thumb_func_start sub_81795AC -sub_81795AC: @ 81795AC - push {r4-r6,lr} - adds r5, r0, 0 - movs r6, 0 -_081795B2: - movs r4, 0x1 - lsls r4, r6 - adds r0, r5, 0 - ands r0, r4 - cmp r0, 0 - beq _081795CC - adds r0, r6, 0 - bl sub_8179554 - lsls r0, 24 - cmp r0, 0 - bne _081795CC - bics r5, r4 -_081795CC: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x1F - bls _081795B2 - cmp r5, 0 - beq _081795DE - movs r0, 0x1 - b _081795E0 -_081795DE: - movs r0, 0 -_081795E0: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81795AC - - thumb_func_start sub_81795E8 -sub_81795E8: @ 81795E8 - push {lr} - ldr r0, =0x000008af - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08179634 - ldr r0, =0x03005d8c - ldr r2, [r0] - ldrh r1, [r2, 0x4] - ldr r0, =0x00004718 - cmp r1, r0 - bne _08179634 - ldr r1, [r2] - ldr r0, =0x0003000a - cmp r1, r0 - beq _08179616 - ldr r0, =0x00030009 - cmp r1, r0 - beq _08179616 - ldr r0, =0x0003000b - cmp r1, r0 - bne _08179634 -_08179616: - movs r0, 0x1 - b _08179636 - .pool -_08179634: - movs r0, 0 -_08179636: - pop {r1} - bx r1 - thumb_func_end sub_81795E8 - - thumb_func_start sub_817963C -sub_817963C: @ 817963C - push {lr} - ldr r2, =0x0000022a - movs r0, 0x10 - movs r1, 0x8 - bl MapGridSetMetatileIdAt - ldr r2, =0x0000022b - movs r0, 0x11 - movs r1, 0x8 - bl MapGridSetMetatileIdAt - movs r2, 0x8B - lsls r2, 2 - movs r0, 0x12 - movs r1, 0x8 - bl MapGridSetMetatileIdAt - ldr r2, =0x00000e32 - movs r0, 0x10 - movs r1, 0x9 - bl MapGridSetMetatileIdAt - ldr r2, =0x00000233 - movs r0, 0x11 - movs r1, 0x9 - bl MapGridSetMetatileIdAt - ldr r2, =0x00000e34 - movs r0, 0x12 - movs r1, 0x9 - bl MapGridSetMetatileIdAt - bl DrawWholeMapView - movs r0, 0x14 - bl audio_play - ldr r0, =0x000008af - bl FlagSet - bl script_env_2_disable - pop {r0} - bx r0 - .pool - thumb_func_end sub_817963C - - thumb_func_start sub_81796AC -sub_81796AC: @ 81796AC - push {r4,lr} - ldr r4, =0x020244ec - adds r0, r4, 0 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - movs r1, 0x9D - lsls r1, 1 - cmp r0, r1 - bne _081796F4 - bl calc_player_party_count - ldr r0, =0x020244e9 - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - adds r1, r4, 0 - subs r1, 0x64 - adds r0, r1 - movs r1, 0x41 - movs r2, 0 - bl pokemon_getattr - ldr r1, =0x0000017d - cmp r0, r1 - bne _081796F4 - movs r0, 0x1 - b _081796F6 - .pool -_081796F4: - movs r0, 0 -_081796F6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81796AC - - thumb_func_start nullsub_84 -nullsub_84: @ 81796FC - bx lr - thumb_func_end nullsub_84 - - thumb_func_start sub_8179700 -sub_8179700: @ 8179700 - push {lr} - ldr r0, =sub_8179778 - movs r1, 0x9 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0 - strh r0, [r1, 0xA] - strh r0, [r1, 0xC] - movs r0, 0x2 - strh r0, [r1, 0x10] - movs r0, 0x5 - strh r0, [r1, 0x12] - movs r0, 0x32 - strh r0, [r1, 0x14] - movs r0, 0 - bl SetCameraPanningCallback - pop {r0} - bx r0 - .pool - thumb_func_end sub_8179700 - - thumb_func_start sub_817973C -sub_817973C: @ 817973C - push {lr} - ldr r0, =sub_8179778 - movs r1, 0x9 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0 - strh r0, [r1, 0xA] - strh r0, [r1, 0xC] - movs r0, 0x3 - strh r0, [r1, 0x10] - movs r0, 0x5 - strh r0, [r1, 0x12] - movs r0, 0x2 - strh r0, [r1, 0x14] - movs r0, 0 - bl SetCameraPanningCallback - pop {r0} - bx r0 - .pool - thumb_func_end sub_817973C - - thumb_func_start sub_8179778 -sub_8179778: @ 8179778 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =0x03005e00 - adds r4, r0, r1 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - movs r1, 0xA - ldrsh r0, [r4, r1] - movs r2, 0x12 - ldrsh r1, [r4, r2] - bl __modsi3 - cmp r0, 0 - bne _081797D0 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x10] - negs r0, r0 - strh r0, [r4, 0x10] - movs r0, 0x10 - ldrsh r1, [r4, r0] - movs r0, 0 - bl SetCameraPanning - movs r2, 0xC - ldrsh r1, [r4, r2] - movs r2, 0x14 - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _081797D0 - adds r0, r5, 0 - bl DestroyTask - bl script_env_2_enable_and_set_ctx_running - bl InstallCameraPanAheadCallback -_081797D0: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8179778 - - thumb_func_start sub_81797DC -sub_81797DC: @ 81797DC - push {lr} - movs r0, 0x8B - lsls r0, 4 - bl FlagGet - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - bne _0817982C - ldr r0, =0x03005d8c - ldr r3, [r0] - ldrh r1, [r3, 0x4] - movs r0, 0xC3 - lsls r0, 3 - cmp r1, r0 - bne _0817982C - ldr r1, [r3] - ldr r0, =0x00170006 - cmp r1, r0 - beq _08179810 - ldr r0, =0x00170005 - cmp r1, r0 - beq _08179810 - ldr r0, =0x00170007 - cmp r1, r0 - bne _0817982C -_08179810: - ldr r0, =0x0203bd14 - strb r2, [r0] - movs r0, 0x1 - b _0817982E - .pool -_0817982C: - movs r0, 0 -_0817982E: - pop {r1} - bx r1 - thumb_func_end sub_81797DC - - thumb_func_start sub_8179834 -sub_8179834: @ 8179834 - push {lr} - bl brm_get_pokemon_selection - ldr r1, =0x02038c08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - movs r0, 0x3C - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end sub_8179834 - - thumb_func_start sub_8179850 -sub_8179850: @ 8179850 - push {lr} - movs r0, 0x3C - bl FieldEffectActiveListRemove - bl sub_8179860 - pop {r0} - bx r0 - thumb_func_end sub_8179850 - - thumb_func_start sub_8179860 -sub_8179860: @ 8179860 - push {lr} - ldr r2, =0x0000022a - movs r0, 0xE - movs r1, 0x1A - bl MapGridSetMetatileIdAt - ldr r2, =0x0000022b - movs r0, 0xF - movs r1, 0x1A - bl MapGridSetMetatileIdAt - movs r2, 0x8B - lsls r2, 2 - movs r0, 0x10 - movs r1, 0x1A - bl MapGridSetMetatileIdAt - ldr r2, =0x00000e32 - movs r0, 0xE - movs r1, 0x1B - bl MapGridSetMetatileIdAt - ldr r2, =0x00000233 - movs r0, 0xF - movs r1, 0x1B - bl MapGridSetMetatileIdAt - ldr r2, =0x00000e34 - movs r0, 0x10 - movs r1, 0x1B - bl MapGridSetMetatileIdAt - bl DrawWholeMapView - movs r0, 0x14 - bl audio_play - movs r0, 0x8B - lsls r0, 4 - bl FlagSet - bl script_env_2_disable - pop {r0} - bx r0 - .pool - thumb_func_end sub_8179860 - - thumb_func_start sub_81798D0 -sub_81798D0: @ 81798D0 - push {lr} - ldr r0, =0x000008b2 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08179910 - ldr r0, =0x03005d8c - ldr r2, [r0] - ldrh r1, [r2, 0x4] - ldr r0, =0x00004418 - cmp r1, r0 - bne _08179910 - ldr r1, [r2] - ldr r0, =0x00190008 - cmp r1, r0 - bne _08179910 - ldr r1, =0x0203bd14 - movs r0, 0x1 - strb r0, [r1] - movs r0, 0x1 - b _08179912 - .pool -_08179910: - movs r0, 0 -_08179912: - pop {r1} - bx r1 - thumb_func_end sub_81798D0 - - thumb_func_start sub_8179918 -sub_8179918: @ 8179918 - push {lr} - bl brm_get_pokemon_selection - ldr r1, =0x02038c08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - movs r0, 0x3C - bl FieldEffectStart - pop {r0} - bx r0 - .pool - thumb_func_end sub_8179918 - - thumb_func_start sub_8179934 -sub_8179934: @ 8179934 - push {lr} - movs r0, 0x3C - bl FieldEffectActiveListRemove - bl sub_8179944 - pop {r0} - bx r0 - thumb_func_end sub_8179934 - - thumb_func_start sub_8179944 -sub_8179944: @ 8179944 - push {lr} - ldr r2, =0x0000022a - movs r0, 0xE - movs r1, 0x1A - bl MapGridSetMetatileIdAt - ldr r2, =0x0000022b - movs r0, 0xF - movs r1, 0x1A - bl MapGridSetMetatileIdAt - movs r2, 0x8B - lsls r2, 2 - movs r0, 0x10 - movs r1, 0x1A - bl MapGridSetMetatileIdAt - ldr r2, =0x00000e32 - movs r0, 0xE - movs r1, 0x1B - bl MapGridSetMetatileIdAt - ldr r2, =0x00000233 - movs r0, 0xF - movs r1, 0x1B - bl MapGridSetMetatileIdAt - ldr r2, =0x00000e34 - movs r0, 0x10 - movs r1, 0x1B - bl MapGridSetMetatileIdAt - bl DrawWholeMapView - movs r0, 0x14 - bl audio_play - ldr r0, =0x000008b2 - bl FlagSet - bl script_env_2_disable - pop {r0} - bx r0 - .pool - thumb_func_end sub_8179944 - - thumb_func_start nullsub_64 -nullsub_64: @ 81799B4 - bx lr - thumb_func_end nullsub_64 - - thumb_func_start sub_81799B8 -sub_81799B8: @ 81799B8 - push {lr} - bl oei_task_add - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x0203bd14 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081799E4 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - ldr r2, =sub_8179934 - b _081799F0 - .pool -_081799E4: - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - ldr r2, =sub_8179850 -_081799F0: - lsrs r1, r2, 16 - strh r1, [r0, 0x18] - strh r2, [r0, 0x1A] - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81799B8 - - thumb_func_start sub_8179A04 -sub_8179A04: @ 8179A04 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r4, =0x03005d8c - ldr r0, [r4] - ldrh r1, [r0, 0x4] - ldr r0, =0x00004318 - cmp r1, r0 - beq _08179A1A - b _08179B5A -_08179A1A: - ldr r0, =0x000008b1 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _08179A28 - b _08179B5A -_08179A28: - movs r0, 0x2 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _08179A36 - b _08179B5A -_08179A36: - movs r0, 0x3 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08179A58 - b _08179B5A - .pool -_08179A54: - movs r0, 0x1 - b _08179B5C -_08179A58: - movs r5, 0 - mov r8, r4 - ldr r4, =gUnknown_085EFE74 - adds r0, r4, 0x1 - mov r12, r0 - ldr r6, =0x0000403b - ldr r1, =0x0000403c - mov r9, r1 -_08179A68: - lsls r0, r5, 1 - adds r1, r0, r4 - add r0, r12 - ldrb r3, [r0] - mov r7, r8 - ldr r2, [r7] - movs r7, 0 - ldrsh r0, [r2, r7] - ldrb r1, [r1] - cmp r0, r1 - bne _08179B44 - movs r1, 0x2 - ldrsh r0, [r2, r1] - cmp r0, r3 - bne _08179B44 - cmp r5, 0xF - bhi _08179AB0 - adds r0, r6, 0 - bl VarGet - lsls r0, 16 - movs r1, 0x80 - lsls r1, 9 - lsls r1, r5 - orrs r1, r0 - lsrs r1, 16 - adds r0, r6, 0 - bl VarSet - b _08179AF0 - .pool -_08179AB0: - cmp r5, 0x1F - bhi _08179AD2 - mov r0, r9 - bl VarGet - lsls r0, 16 - adds r2, r5, 0 - subs r2, 0x10 - movs r1, 0x80 - lsls r1, 9 - lsls r1, r2 - orrs r1, r0 - lsrs r1, 16 - mov r0, r9 - bl VarSet - b _08179AF0 -_08179AD2: - ldr r4, =0x0000403d - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - adds r2, r5, 0 - subs r2, 0x20 - movs r1, 0x80 - lsls r1, 9 - lsls r1, r2 - orrs r1, r0 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet -_08179AF0: - ldr r0, =0x0000403b - bl VarGet - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x0000ffff - cmp r4, r0 - bne _08179B5A - ldr r0, =0x0000403c - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, r4 - bne _08179B5A - ldr r0, =0x0000403d - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xF - bne _08179B5A - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, [r0] - ldr r0, =0x00150008 - cmp r1, r0 - beq _08179A54 - b _08179B5A - .pool -_08179B44: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x23 - bls _08179A68 - movs r0, 0x3 - bl FlagSet - movs r0, 0x2 - bl FlagReset -_08179B5A: - movs r0, 0 -_08179B5C: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8179A04 - - thumb_func_start sub_8179B68 -sub_8179B68: @ 8179B68 - push {lr} - bl RunTasks - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_8179B68 - - thumb_func_start sub_8179B84 -sub_8179B84: @ 8179B84 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_8179B84 - - thumb_func_start sub_8179B98 -sub_8179B98: @ 8179B98 - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0xD - bls _08179BAC - b _08179D4C -_08179BAC: - lsls r0, 2 - ldr r1, =_08179BC0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08179BC0: - .4byte _08179BF8 - .4byte _08179C20 - .4byte _08179C34 - .4byte _08179C48 - .4byte _08179C4E - .4byte _08179C60 - .4byte _08179C66 - .4byte _08179C78 - .4byte _08179C98 - .4byte _08179CB0 - .4byte _08179CDC - .4byte _08179CF8 - .4byte _08179CFE - .4byte _08179D18 -_08179BF8: - ldr r4, =0x0203bd18 - ldr r0, =0x00001084 - bl AllocZeroed - str r0, [r4] - bl SetVBlankHBlankCallbacksToNull - bl clear_scheduled_bg_copies_to_vram - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _08179D3A - .pool -_08179C20: - bl sub_80A1A74 - ldr r2, =0x02037fd4 - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - b _08179D30 - .pool -_08179C34: - bl ResetAllObjectData - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _08179D3A - .pool -_08179C48: - bl ResetObjectPaletteAllocator - b _08179D32 -_08179C4E: - bl init_uns_table_pokemon_copy - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _08179D3A - .pool -_08179C60: - bl sub_8179D9C - b _08179D32 -_08179C66: - bl sub_8179FAC - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _08179D3A - .pool -_08179C78: - ldr r0, =0x0203bc9c - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - bl sub_8179DF4 - lsls r0, 24 - cmp r0, 0 - beq _08179D64 - b _08179D32 - .pool -_08179C98: - bl sub_817A4A4 - ldr r1, =0x0203bd18 - ldr r1, [r1] - ldr r2, =0x0000105e - adds r1, r2 - strb r0, [r1] - b _08179D32 - .pool -_08179CB0: - ldr r0, =0x0203bc9c - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - bl sub_817A358 - ldr r1, =0x0203bd18 - ldr r1, [r1] - ldr r2, =0x0000105d - adds r1, r2 - strb r0, [r1] - b _08179D32 - .pool -_08179CDC: - movs r0, 0 - movs r1, 0x1 - movs r2, 0x1 - movs r3, 0xE - bl SetWindowBorderStyle - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _08179D3A - .pool -_08179CF8: - bl sub_817A168 - b _08179D32 -_08179CFE: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl sub_80A2A20 - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _08179D3A - .pool -_08179D18: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 -_08179D30: - strb r0, [r2, 0x8] -_08179D32: - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 -_08179D3A: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08179D64 - .pool -_08179D4C: - ldr r0, =sub_8179B84 - bl SetVBlankCallback - ldr r0, =sub_8179B68 - bl SetMainCallback2 - movs r0, 0x1 - b _08179D66 - .pool -_08179D64: - movs r0, 0 -_08179D66: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8179B98 - - thumb_func_start sub_8179D70 -sub_8179D70: @ 8179D70 - push {lr} -_08179D72: - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08179D96 - bl sub_8179B98 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08179D96 - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08179D72 -_08179D96: - pop {r0} - bx r0 - thumb_func_end sub_8179D70 - - thumb_func_start sub_8179D9C -sub_8179D9C: @ 8179D9C - push {lr} - bl sub_8121DA0 - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085F0550 - movs r0, 0 - movs r2, 0x2 - bl InitBgsFromTemplates - ldr r0, =0x0203bd18 - ldr r1, [r0] - adds r1, 0x48 - 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, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end sub_8179D9C - - thumb_func_start sub_8179DF4 -sub_8179DF4: @ 8179DF4 - push {r4-r6,lr} - sub sp, 0x4 - adds r6, r0, 0 - ldr r0, =0x0203bd18 - ldr r0, [r0] - ldr r1, =0x0000107e - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x8 - bls _08179E0C - b _08179FA0 -_08179E0C: - lsls r0, 2 - ldr r1, =_08179E24 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08179E24: - .4byte _08179E48 - .4byte _08179E84 - .4byte _08179EC4 - .4byte _08179ED8 - .4byte _08179EEC - .4byte _08179F00 - .4byte _08179F20 - .4byte _08179F44 - .4byte _08179F78 -_08179E48: - adds r0, r6, 0 - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r6, 0 - movs r1, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r0, r5, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =0x020244d4 - ldr r1, [r1] - ldr r1, [r1, 0x8] - adds r2, r5, 0 - adds r3, r4, 0 - bl DecompressMonPic_DetectFrontOrBack_2 - ldr r0, =0x0203bd18 - ldr r1, [r0] - b _08179F5E - .pool -_08179E84: - adds r0, r6, 0 - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r6, 0 - movs r1, 0 - bl pokemon_getattr - adds r4, r0, 0 - adds r0, r6, 0 - movs r1, 0x1 - bl pokemon_getattr - adds r1, r0, 0 - adds r0, r5, 0 - adds r2, r4, 0 - bl sub_806E7CC - adds r4, r0, 0 - bl LoadCompressedObjectPalette - ldrh r0, [r4, 0x4] - movs r1, 0x1 - bl sub_806A068 - ldr r0, =0x0203bd18 - ldr r1, [r0] - b _08179F5E - .pool -_08179EC4: - ldr r0, =gUnknown_085B26F4 - bl LoadCompressedObjectPic - ldr r0, =0x0203bd18 - ldr r1, [r0] - b _08179F5E - .pool -_08179ED8: - ldr r0, =gUnknown_085B26FC - bl LoadCompressedObjectPalette - ldr r0, =0x0203bd18 - ldr r1, [r0] - b _08179F5E - .pool -_08179EEC: - ldr r0, =gUnknown_085F06A0 - bl LoadCompressedObjectPic - ldr r0, =0x0203bd18 - ldr r1, [r0] - b _08179F5E - .pool -_08179F00: - ldr r0, =0x0203ce7c - ldrb r0, [r0] - bl sub_8179FEC - ldr r0, =0x0203bd1c - bl LoadCompressedObjectPalette - ldr r0, =0x0203bd18 - ldr r1, [r0] - b _08179F5E - .pool -_08179F20: - bl reset_temp_tile_data_buffers - ldr r1, =gUnknown_08D7C440 - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r0, =0x0203bd18 - ldr r1, [r0] - b _08179F5E - .pool -_08179F44: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08179FA0 - ldr r0, =gUnknown_08D9BA44 - ldr r4, =0x0203bd18 - ldr r1, [r4] - adds r1, 0x48 - bl LZDecompressWram - ldr r1, [r4] -_08179F5E: - ldr r0, =0x0000107e - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _08179FA0 - .pool -_08179F78: - ldr r0, =gUnknown_08D7C9EC - movs r1, 0x20 - movs r2, 0x60 - bl decompress_palette - ldr r0, =0x0203bd18 - ldr r0, [r0] - ldr r1, =0x0000107e - adds r0, r1 - movs r1, 0 - strh r1, [r0] - movs r0, 0x1 - b _08179FA2 - .pool -_08179FA0: - movs r0, 0 -_08179FA2: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8179DF4 - - thumb_func_start sub_8179FAC -sub_8179FAC: @ 8179FAC - push {lr} - ldr r0, =gUnknown_085F0558 - bl InitWindows - bl DeactivateAllTextPrinters - movs r0, 0 - movs r1, 0x1 - movs r2, 0xE0 - bl sub_809882C - ldr r0, =gUnknown_0860F074 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - bl PutWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r0} - bx r0 - .pool - thumb_func_end sub_8179FAC - - thumb_func_start sub_8179FEC -sub_8179FEC: @ 8179FEC - push {lr} - lsls r0, 24 - ldr r1, =0x03005d8c - lsrs r0, 21 - ldr r2, =0x00000848 - adds r0, r2 - ldr r1, [r1] - adds r1, r0 - adds r0, r1, 0 - movs r1, 0 - bl sub_8136F9C - lsls r0, 24 - ldr r2, =0x0203bd1c - ldr r1, =gUnknown_085F0568 - lsrs r0, 22 - subs r0, 0x4 - adds r0, r1 - ldr r0, [r0] - str r0, [r2] - ldr r0, =0x000039e2 - strh r0, [r2, 0x4] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8179FEC - - thumb_func_start sub_817A030 -sub_817A030: @ 817A030 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0817A044 - b _0817A154 -_0817A044: - ldr r0, =0x03005e00 - lsls r2, r4, 2 - adds r1, r2, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0x8 - ldrsh r3, [r1, r0] - ldr r0, =0x0000010d - adds r5, r2, 0 - cmp r3, r0 - beq _0817A0C8 - cmp r3, r0 - bgt _0817A074 - cmp r3, 0 - beq _0817A088 - cmp r3, 0xFF - beq _0817A0AC - b _0817A104 - .pool -_0817A074: - ldr r0, =0x00000119 - cmp r3, r0 - beq _0817A0E0 - adds r0, 0x10 - cmp r3, r0 - beq _0817A0F8 - b _0817A104 - .pool -_0817A088: - ldr r0, =0x0203bd18 - ldr r1, [r0] - ldr r2, =0x00001050 - adds r1, r2 - strb r3, [r1] - ldr r0, [r0] - ldr r1, =0x00001058 - adds r0, r1 - strh r3, [r0] - bl sub_817A5CC - b _0817A104 - .pool -_0817A0AC: - ldr r0, =0x0203bd18 - ldr r0, [r0] - ldr r2, =0x0000105e - adds r0, r2 - ldrb r0, [r0] - ldrb r1, [r1, 0xA] - bl sub_817A4F8 - b _0817A104 - .pool -_0817A0C8: - bl sub_817A56C - ldr r1, =0x0203bd18 - ldr r1, [r1] - ldr r2, =0x0000105f - adds r1, r2 - strb r0, [r1] - b _0817A104 - .pool -_0817A0E0: - ldr r0, =0x0203bd18 - ldr r0, [r0] - ldr r1, =0x0000105d - adds r0, r1 - ldrb r0, [r0] - bl sub_817A434 - b _0817A104 - .pool -_0817A0F8: - ldr r0, =sub_817A1C4 - str r0, [r1] - b _0817A154 - .pool -_0817A104: - ldr r0, =0x0203bd18 - ldr r0, [r0] - ldr r2, =0x00001058 - adds r1, r0, r2 - subs r2, 0x2 - adds r0, r2 - ldrh r1, [r1] - ldrh r0, [r0] - cmp r1, r0 - bcs _0817A128 - bl sub_817A634 - b _0817A138 - .pool -_0817A128: - cmp r1, r0 - bne _0817A138 - ldr r0, =0x03005e00 - adds r1, r5, r4 - lsls r1, 3 - adds r1, r0 - movs r0, 0xFE - strh r0, [r1, 0x8] -_0817A138: - ldr r0, =0x0203bd18 - ldr r1, [r0] - ldr r0, =0x00001058 - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - ldr r0, =0x03005e00 - adds r1, r5, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_0817A154: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817A030 - - thumb_func_start sub_817A168 -sub_817A168: @ 817A168 - push {lr} - ldr r0, =sub_817A030 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0 - strh r0, [r1, 0x8] - movs r0, 0x1 - strh r0, [r1, 0xA] - pop {r0} - bx r0 - .pool - thumb_func_end sub_817A168 - - thumb_func_start sub_817A194 -sub_817A194: @ 817A194 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0 - bl sub_8121F20 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - beq _0817A1B6 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_817A320 - str r0, [r1] -_0817A1B6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817A194 - - thumb_func_start sub_817A1C4 -sub_817A1C4: @ 817A1C4 - push {r4-r7,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x0203bc9c - ldrb r1, [r0] - movs r0, 0x64 - adds r5, r1, 0 - muls r5, r0 - ldr r0, =0x020244ec - adds r5, r0 - ldr r1, =0x03005d8c - ldr r0, =0x0203ce7c - ldrh r0, [r0] - lsls r0, 3 - ldr r2, =0x00000848 - adds r0, r2 - ldr r4, [r1] - adds r4, r0 - adds r0, r5, 0 - bl GetNature - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - bl sub_8136FE4 - ldr r6, =0x0203bc9e - strh r0, [r6] - ldr r1, =0x02021cc4 - adds r0, r5, 0 - bl GetMonNickname - ldr r1, =0x02021dc4 - adds r0, r4, 0 - bl sub_8137044 - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0817A248 - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E937F - bl ExpandStringRefs - b _0817A268 - .pool -_0817A248: - cmp r0, 0 - ble _0817A260 - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E9390 - bl ExpandStringRefs - b _0817A268 - .pool -_0817A260: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E93A9 - bl ExpandStringRefs -_0817A268: - ldr r2, =0x03003014 - 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 - ldr r2, =0x02021fc4 - 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, 0 - movs r1, 0x1 - bl AddTextPrinterParametrized - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_817A194 - str r1, [r0] - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817A1C4 - - thumb_func_start sub_817A2C0 -sub_817A2C0: @ 817A2C0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0817A304 - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl - ldr r0, =0x030022c0 - ldr r0, [r0, 0x8] - bl SetMainCallback2 - adds r0, r4, 0 - bl DestroyTask - bl FreeAllWindowBuffers - ldr r0, =0x0203bd18 - ldr r0, [r0] - bl Free - bl sub_805F094 -_0817A304: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817A2C0 - - thumb_func_start sub_817A320 -sub_817A320: @ 817A320 - 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 pal_fade_maybe - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_817A2C0 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817A320 - - thumb_func_start sub_817A358 -sub_817A358: @ 817A358 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r5, r0, 0 - movs r1, 0x41 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =0x0202499c - movs r1, 0x30 - movs r2, 0x50 - movs r3, 0x2 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =0x0203bd18 - mov r9, r0 - ldr r0, [r0] - ldr r2, =0x00001054 - adds r1, r0, r2 - strh r4, [r1] - ldr r1, =0x0000105b - adds r0, r1 - mov r2, r8 - strb r2, [r0] - adds r0, r5, 0 - bl GetNature - mov r2, r9 - ldr r1, [r2] - ldr r2, =0x0000105a - adds r1, r2 - strb r0, [r1] - ldr r7, =0x02020630 - mov r1, r8 - lsls r0, r1, 4 - add r0, r8 - lsls r5, r0, 2 - adds r6, r5, r7 - strh r4, [r6, 0x32] - adds r0, r7, 0 - adds r0, 0x1C - adds r0, r5, r0 - ldr r1, =DummyObjectCallback - str r1, [r0] - mov r2, r9 - ldr r0, [r2] - ldr r1, =0x00001053 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - adds r0, r4, 0 - bl sub_806E840 - lsls r0, 24 - cmp r0, 0 - bne _0817A402 - adds r0, r7, 0 - adds r0, 0x10 - adds r0, r5, r0 - ldr r1, =gUnknown_085F05B0 - str r1, [r0] - ldrb r3, [r6, 0x1] - movs r0, 0x3 - orrs r3, r0 - strb r3, [r6, 0x1] - lsrs r1, r3, 6 - ldrb r2, [r6, 0x3] - lsrs r2, 6 - lsls r3, 30 - lsrs r3, 30 - adds r0, r6, 0 - bl CalcVecFromObjectCenterToObjectUpperLeft - mov r2, r9 - ldr r0, [r2] - ldr r1, =0x00001053 - adds r0, r1 - movs r1, 0 - strb r1, [r0] -_0817A402: - mov r0, r8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817A358 - - thumb_func_start sub_817A434 -sub_817A434: @ 817A434 - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r2, r1, r3 - movs r0, 0x30 - strh r0, [r2, 0x20] - movs r0, 0x50 - strh r0, [r2, 0x22] - ldr r0, =0x0000fff8 - strh r0, [r2, 0x2E] - movs r0, 0x1 - strh r0, [r2, 0x30] - adds r3, 0x1C - adds r1, r3 - ldr r0, =sub_817A468 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_817A434 - - thumb_func_start sub_817A468 -sub_817A468: @ 817A468 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x20] - adds r0, 0x4 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x2E] - ldrh r2, [r4, 0x22] - adds r1, r0, r2 - strh r1, [r4, 0x22] - ldrh r1, [r4, 0x30] - adds r0, r1 - strh r0, [r4, 0x2E] - lsls r0, 16 - cmp r0, 0 - bne _0817A48E - ldrh r0, [r4, 0x32] - movs r1, 0 - bl cry_related -_0817A48E: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x9 - bne _0817A49A - ldr r0, =DummyObjectCallback - str r0, [r4, 0x1C] -_0817A49A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817A468 - - thumb_func_start sub_817A4A4 -sub_817A4A4: @ 817A4A4 - push {r4,r5,lr} - movs r0, 0xBC - movs r1, 0x64 - movs r2, 0x2 - bl sub_8136444 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =0x02020630 - lsls r3, r4, 4 - adds r3, r4 - lsls r3, 2 - adds r0, r3, r5 - ldrb r2, [r0, 0x1] - movs r1, 0x4 - negs r1, r1 - ands r1, r2 - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0, 0x1] - adds r1, r5, 0 - adds r1, 0x10 - adds r1, r3, r1 - ldr r2, =gUnknown_085F0664 - str r2, [r1] - adds r5, 0x1C - adds r3, r5 - ldr r1, =DummyObjectCallback - str r1, [r3] - bl obj_alloc_rotscale_entry - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817A4A4 - - thumb_func_start sub_817A4F8 -sub_817A4F8: @ 817A4F8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r1, 0 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =0x02020630 - mov r8, r0 - lsls r0, r7, 4 - adds r0, r7 - lsls r6, r0, 2 - mov r0, r8 - adds r4, r6, r0 - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - ldrb r0, [r4, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r4, 0x1] - cmp r5, 0 - bne _0817A540 - mov r0, r8 - adds r0, 0x10 - adds r0, r6, r0 - ldr r1, =gUnknown_085F0668 - b _0817A548 - .pool -_0817A540: - mov r0, r8 - adds r0, 0x10 - adds r0, r6, r0 - ldr r1, =gUnknown_085F066C -_0817A548: - str r1, [r0] - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl obj_alloc_rotscale_entry - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817A4F8 - - thumb_func_start sub_817A56C -sub_817A56C: @ 817A56C - push {lr} - ldr r0, =gUnknown_085F06A8 - movs r1, 0xAE - movs r2, 0x54 - movs r3, 0x1 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldr r2, =0x0000fff4 - strh r2, [r1, 0x2E] - movs r2, 0x1 - strh r2, [r1, 0x30] - pop {r1} - bx r1 - .pool - thumb_func_end sub_817A56C - - thumb_func_start sub_817A5A0 -sub_817A5A0: @ 817A5A0 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x20] - subs r0, 0x4 - strh r0, [r2, 0x20] - ldrh r0, [r2, 0x2E] - ldrh r3, [r2, 0x22] - adds r1, r0, r3 - strh r1, [r2, 0x22] - ldrh r1, [r2, 0x30] - adds r0, r1 - strh r0, [r2, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bne _0817A5C6 - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles -_0817A5C6: - pop {r0} - bx r0 - thumb_func_end sub_817A5A0 - - thumb_func_start sub_817A5CC -sub_817A5CC: @ 817A5CC - push {r4-r7,lr} - ldr r0, =0x0203bd18 - ldr r1, [r0] - ldr r0, =0x00001056 - adds r3, r1, r0 - movs r0, 0x1 - strh r0, [r3] - ldr r2, =gUnknown_085EFEBC - ldr r7, =0x0000105a - adds r1, r7 - ldrb r0, [r1] - lsls r0, 1 - adds r0, r2 - ldrb r2, [r0] - movs r4, 0 - ldr r5, =gUnknown_085EFF00 - adds r6, r5, 0 - subs r6, 0xA -_0817A5F0: - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 2 - adds r0, r1, r6 - ldrh r0, [r0] - ldrh r7, [r3] - adds r0, r7 - strh r0, [r3] - adds r1, r5 - movs r7, 0 - ldrsh r0, [r1, r7] - cmp r0, 0x1 - beq _0817A61A - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r4, 0x7 - bls _0817A5F0 -_0817A61A: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817A5CC - - thumb_func_start sub_817A634 -sub_817A634: @ 817A634 - push {r4,lr} - ldr r0, =0x0203bd18 - ldr r4, [r0] - ldr r1, =0x00001050 - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0x5A - bls _0817A646 - b _0817A90E -_0817A646: - lsls r0, 2 - ldr r1, =_0817A65C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0817A65C: - .4byte _0817A7C8 - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A818 - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A858 - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A8A2 - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A8FC - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E - .4byte _0817A90E -_0817A7C8: - ldr r1, =gUnknown_085EFEBC - ldr r2, =0x0000105a - adds r0, r4, r2 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrb r1, [r0] - ldr r3, =0x00001051 - adds r0, r4, r3 - strb r1, [r0] - ldr r1, =0x0000105b - adds r0, r4, r1 - ldrb r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x02020630 - adds r1, r0 - adds r0, r4, 0 - stm r0!, {r1} - movs r2, 0x44 - bl memcpy - ldr r2, =0x00001050 - adds r1, r4, r2 - movs r0, 0xA - strb r0, [r1] - b _0817A90E - .pool -_0817A818: - bl sub_817A91C - ldr r1, =gUnknown_085EFEBC - ldr r3, =0x0000105a - adds r0, r4, r3 - ldrb r0, [r0] - lsls r0, 1 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _0817A850 - ldr r2, [r4] - ldrb r0, [r2, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r2, 0x1] - ldr r2, [r4] - ldrb r1, [r2, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0x3] - ldr r0, [r4] - ldr r1, =gUnknown_085F04FC - str r1, [r0, 0x10] - bl obj_alloc_rotscale_entry -_0817A850: - ldr r0, =0x00001050 - adds r1, r4, r0 - movs r0, 0x32 - strb r0, [r1] -_0817A858: - ldr r1, =gUnknown_085EFEBC - ldr r2, =0x0000105a - adds r0, r4, r2 - ldrb r0, [r0] - lsls r0, 1 - adds r1, 0x1 - adds r2, r0, r1 - ldrb r1, [r2] - cmp r1, 0 - beq _0817A8C8 - ldr r3, =0x00001053 - adds r0, r4, r3 - ldrb r0, [r0] - cmp r0, 0 - bne _0817A898 - ldr r0, [r4] - adds r1, 0xA - lsls r1, 24 - lsrs r1, 24 - bl StartObjectRotScalAnim - b _0817A8C8 - .pool -_0817A898: - ldr r0, [r4] - ldrb r1, [r2] - bl StartObjectRotScalAnim - b _0817A8C8 -_0817A8A2: - bl sub_817A9E4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0817A90E - ldr r1, =0x00001072 - adds r0, r4, r1 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0 - bne _0817A8E0 - ldr r3, =0x00001051 - adds r1, r4, r3 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - bl sub_817A91C -_0817A8C8: - ldr r0, =0x00001050 - adds r1, r4, r0 - movs r0, 0x3C - strb r0, [r1] - b _0817A90E - .pool -_0817A8E0: - ldr r0, [r4] - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - ldr r2, =0x00001050 - adds r1, r4, r2 - movs r0, 0x46 - strb r0, [r1] - b _0817A90E - .pool -_0817A8FC: - bl sub_817AA3C - ldr r3, =0x00001051 - adds r0, r4, r3 - movs r1, 0 - strb r1, [r0] - ldr r2, =0x00001050 - adds r0, r4, r2 - strb r1, [r0] -_0817A90E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817A634 - - thumb_func_start sub_817A91C -sub_817A91C: @ 817A91C - push {r4-r7,lr} - ldr r0, =0x0203bd18 - ldr r5, [r0] - movs r4, 0 - movs r0, 0x83 - lsls r0, 5 - adds r7, r5, r0 - ldr r1, =gUnknown_085EFEEE - mov r12, r1 - ldr r2, =0x00001051 - adds r6, r5, r2 -_0817A932: - lsls r2, r4, 1 - adds r3, r7, r2 - ldrb r1, [r6] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, r0 - add r2, r12 - ldrh r0, [r2] - strh r0, [r3] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x9 - bls _0817A932 - ldr r0, =0x00001068 - adds r6, r5, r0 - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - beq _0817A9DC - movs r2, 0x83 - lsls r2, 5 - adds r4, r5, r2 - movs r1, 0 - ldrsh r0, [r4, r1] - adds r2, 0x4 - adds r1, r5, r2 - movs r2, 0 - ldrsh r1, [r1, r2] - bl sine - ldr r2, =0x00001074 - adds r1, r5, r2 - strh r0, [r1] - movs r1, 0 - ldrsh r0, [r4, r1] - subs r2, 0xE - adds r1, r5, r2 - movs r2, 0 - ldrsh r1, [r1, r2] - bl cosine - ldr r2, =0x00001076 - adds r1, r5, r2 - strh r0, [r1] - ldrh r0, [r6] - ldr r1, =0x00001078 - adds r4, r5, r1 - strh r0, [r4] - ldr r0, [r5] - ldrh r1, [r0, 0x24] - adds r2, 0x4 - adds r0, r5, r2 - strh r1, [r0] - ldr r0, [r5] - ldrh r1, [r0, 0x26] - adds r2, 0x2 - adds r0, r5, r2 - strh r1, [r0] - bl sub_817AB68 - ldrh r0, [r4] - strh r0, [r6] - bl sub_817AA54 - ldrh r0, [r4] - strh r0, [r6] - movs r0, 0 - b _0817A9DE - .pool -_0817A9DC: - movs r0, 0x1 -_0817A9DE: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_817A91C - - thumb_func_start sub_817A9E4 -sub_817A9E4: @ 817A9E4 - push {r4,r5,lr} - ldr r0, =0x0203bd18 - ldr r2, [r0] - ldr r1, =0x00001078 - adds r0, r2, r1 - ldr r5, =0x00001068 - adds r4, r2, r5 - ldrh r1, [r0] - ldrh r0, [r4] - subs r1, r0 - lsls r1, 16 - ldr r3, [r2] - lsrs r1, 15 - movs r5, 0x85 - lsls r5, 4 - adds r0, r2, r5 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r3, 0x24] - ldr r3, [r2] - movs r0, 0xC5 - lsls r0, 4 - adds r2, r0 - adds r2, r1 - ldrh r0, [r2] - strh r0, [r3, 0x26] - ldrh r0, [r4] - subs r0, 0x1 - strh r0, [r4] - lsls r0, 16 - cmp r0, 0 - beq _0817AA34 - movs r0, 0 - b _0817AA36 - .pool -_0817AA34: - movs r0, 0x1 -_0817AA36: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_817A9E4 - - thumb_func_start sub_817AA3C -sub_817AA3C: @ 817AA3C - push {lr} - ldr r0, =0x0203bd18 - ldr r0, [r0] - ldr r0, [r0] - bl obj_free_rotscale_entry - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_817AA3C - - thumb_func_start sub_817AA54 -sub_817AA54: @ 817AA54 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - ldr r0, =0x0203bd18 - ldr r7, [r0] - ldr r1, =0x00001070 - adds r0, r7, r1 - ldrh r0, [r0] - mov r9, r0 - ldr r2, =0x00001078 - adds r0, r7, r2 - ldrh r0, [r0] - mov r3, r9 - subs r0, r3 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r4, =0x0000107a - adds r1, r7, r4 - subs r2, 0xC - adds r0, r7, r2 - ldrh r0, [r0] - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp] - ldr r3, =0x0000107c - adds r1, r7, r3 - subs r4, 0xC - adds r0, r7, r4 - ldrh r0, [r0] - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x4] - movs r5, 0 - mov r0, r8 - subs r0, 0x1 - cmp r5, r0 - bge _0817AB20 - ldr r1, [sp] - lsls r0, r1, 16 - asrs r0, 16 - str r0, [sp, 0x8] - ldr r2, [sp, 0x4] - lsls r0, r2, 16 - asrs r0, 16 - mov r10, r0 -_0817AABE: - mov r3, r9 - adds r0, r3, r5 - lsls r0, 1 - movs r4, 0x85 - lsls r4, 4 - adds r2, r7, r4 - adds r2, r0 - ldrh r6, [r2] - ldr r3, [sp, 0x8] - subs r1, r6, r3 - movs r4, 0xC5 - lsls r4, 4 - adds r3, r7, r4 - adds r3, r0 - ldrh r4, [r3] - mov r0, r10 - subs r4, r0 - lsls r4, 16 - lsrs r4, 16 - lsls r1, 16 - asrs r1, 16 - adds r5, 0x1 - adds r0, r1, 0 - muls r0, r5 - mov r1, r8 - str r2, [sp, 0xC] - str r3, [sp, 0x10] - bl __divsi3 - subs r6, r0 - ldr r2, [sp, 0xC] - strh r6, [r2] - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 - muls r0, r5 - mov r1, r8 - bl __divsi3 - ldr r3, [sp, 0x10] - ldrh r1, [r3] - subs r1, r0 - strh r1, [r3] - lsls r5, 16 - lsrs r5, 16 - mov r0, r8 - subs r0, 0x1 - cmp r5, r0 - blt _0817AABE -_0817AB20: - mov r0, r9 - add r0, r8 - subs r0, 0x1 - lsls r0, 1 - movs r2, 0x85 - lsls r2, 4 - adds r1, r7, r2 - adds r1, r0 - mov r3, sp - ldrh r3, [r3] - strh r3, [r1] - movs r4, 0xC5 - lsls r4, 4 - adds r1, r7, r4 - adds r1, r0 - mov r0, sp - ldrh r0, [r0, 0x4] - strh r0, [r1] - 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_817AA54 - - thumb_func_start sub_817AB68 -sub_817AB68: @ 817AB68 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r0, =0x0203bd18 - ldr r6, [r0] - movs r0, 0 - str r0, [sp] - ldr r1, =0x0000107a - adds r0, r6, r1 - ldr r2, =0x00001074 - adds r1, r6, r2 - ldrh r2, [r0] - ldrh r0, [r1] - subs r2, r0 - ldr r3, =0x0000107c - adds r0, r6, r3 - ldr r1, =0x00001076 - adds r3, r6, r1 - ldrh r1, [r0] - ldrh r0, [r3] - subs r1, r0 - ldr r3, =0x00001068 - adds r3, r6 - mov r9, r3 - movs r0, 0x83 - lsls r0, 5 - adds r0, r6 - mov r8, r0 - lsls r2, 16 - asrs r2, 16 - str r2, [sp, 0x4] - lsls r1, 16 - asrs r1, 16 - mov r10, r1 -_0817ABB2: - ldr r1, =0x0000106a - adds r0, r6, r1 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0 - bge _0817ABC0 - negs r0, r0 -_0817ABC0: - lsls r0, 16 - ldr r3, =0x00001066 - adds r7, r6, r3 - lsrs r0, 16 - ldrh r1, [r7] - adds r0, r1 - lsls r4, r0, 16 - strh r0, [r7] - ldr r2, =0x00001064 - adds r0, r6, r2 - ldrh r2, [r0] - movs r3, 0 - ldrsh r0, [r0, r3] - cmp r0, 0 - bge _0817ABE2 - movs r0, 0x1 - str r0, [sp] -_0817ABE2: - ldr r1, =0x00001078 - adds r0, r6, r1 - ldrh r0, [r0] - mov r3, r9 - ldrh r1, [r3] - subs r0, r1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r1, 0 - beq _0817ACB8 - ldr r0, [sp] - cmp r0, 0 - bne _0817AC54 - mov r1, r8 - movs r3, 0 - ldrsh r0, [r1, r3] - lsrs r4, 24 - adds r1, r2, r4 - lsls r1, 16 - asrs r1, 16 - bl sine - lsls r5, 1 - movs r2, 0x85 - lsls r2, 4 - adds r1, r6, r2 - adds r1, r5 - ldr r3, [sp, 0x4] - adds r0, r3, r0 - strh r0, [r1] - mov r1, r8 - movs r2, 0 - ldrsh r0, [r1, r2] - ldrh r1, [r7] - adds r1, r4 - b _0817AC80 - .pool -_0817AC54: - mov r1, r8 - movs r3, 0 - ldrsh r0, [r1, r3] - lsrs r4, 24 - subs r1, r2, r4 - lsls r1, 16 - asrs r1, 16 - bl sine - lsls r5, 1 - movs r2, 0x85 - lsls r2, 4 - adds r1, r6, r2 - adds r1, r5 - ldr r3, [sp, 0x4] - adds r0, r3, r0 - strh r0, [r1] - mov r1, r8 - movs r2, 0 - ldrsh r0, [r1, r2] - ldrh r1, [r7] - subs r1, r4 -_0817AC80: - lsls r1, 16 - asrs r1, 16 - bl cosine - movs r3, 0xC5 - lsls r3, 4 - adds r1, r6, r3 - adds r1, r5 - add r0, r10 - strh r0, [r1] - ldr r1, =0x00001062 - adds r0, r6, r1 - ldrh r0, [r0] - mov r2, r8 - ldrh r2, [r2] - adds r0, r2 - movs r1, 0xFF - ands r0, r1 - mov r3, r8 - strh r0, [r3] - mov r1, r9 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - b _0817ABB2 - .pool -_0817ACB8: - 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 sub_817AB68 - - thumb_func_start c2_clear_save_data_screen_2 -c2_clear_save_data_screen_2: @ 817ACC8 - push {lr} - bl sub_817AE00 - lsls r0, 24 - cmp r0, 0 - beq _0817ACDC - ldr r0, =sub_817ACE4 - movs r1, 0 - bl CreateTask -_0817ACDC: - pop {r0} - bx r0 - .pool - thumb_func_end c2_clear_save_data_screen_2 - - thumb_func_start sub_817ACE4 -sub_817ACE4: @ 817ACE4 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0 - movs r1, 0 - movs r2, 0x2 - movs r3, 0xE - bl SetWindowBorderStyle - ldr r2, =gUnknown_085EFA8F - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl Print - ldr r0, =gUnknown_085F06D8 - movs r1, 0x2 - movs r2, 0xE - movs r3, 0x1 - bl CreateYesNoMenu - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_817AD40 - str r1, [r0] - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817ACE4 - - thumb_func_start sub_817AD40 -sub_817AD40: @ 817AD40 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - bl sub_8198C58 - lsls r0, 24 - asrs r4, r0, 24 - cmp r4, 0 - beq _0817AD68 - cmp r4, 0 - bgt _0817AD62 - movs r0, 0x1 - negs r0, r0 - cmp r4, r0 - beq _0817ADA0 - b _0817ADB2 -_0817AD62: - cmp r4, 0x1 - beq _0817ADA0 - b _0817ADB2 -_0817AD68: - movs r0, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, =gUnknown_085EFAAA - movs r0, 0x1 - str r0, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl Print - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_817ADC0 - str r1, [r0] - b _0817ADB2 - .pool -_0817ADA0: - movs r0, 0x5 - bl audio_play - adds r0, r5, 0 - bl DestroyTask - ldr r0, =sub_817AFD4 - bl SetMainCallback2 -_0817ADB2: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817AD40 - - thumb_func_start sub_817ADC0 -sub_817ADC0: @ 817ADC0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl calls_flash_erase_block - adds r0, r4, 0 - bl DestroyTask - ldr r0, =sub_817AFD4 - bl SetMainCallback2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817ADC0 - - thumb_func_start sub_817ADE4 -sub_817ADE4: @ 817ADE4 - push {lr} - bl RunTasks - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_817ADE4 - - thumb_func_start sub_817ADF4 -sub_817ADF4: @ 817ADF4 - push {lr} - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_817ADF4 - - thumb_func_start sub_817AE00 -sub_817AE00: @ 817AE00 - push {r4,lr} - sub sp, 0xC - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _0817AE18 - cmp r0, 0x1 - bne _0817AE18 - b _0817AFA4 -_0817AE18: - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0x10 - movs r1, 0 - bl SetGpuReg - movs r0, 0x12 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1C - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - add r0, sp, 0x4 - movs r4, 0 - strh r4, [r0] - ldr r1, =0x040000d4 - str r0, [r1] - movs r0, 0xC0 - lsls r0, 19 - str r0, [r1, 0x4] - ldr r0, =0x8100c000 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r2, 0 - str r2, [sp, 0x8] - add r0, sp, 0x8 - str r0, [r1] - movs r0, 0xE0 - lsls r0, 19 - str r0, [r1, 0x4] - ldr r0, =0x85000100 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - add r0, sp, 0x4 - strh r2, [r0] - str r0, [r1] - ldr r0, =0x05000002 - str r0, [r1, 0x4] - ldr r0, =0x810001ff - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - bl sub_80A1A74 - ldr r2, =0x02037714 - ldr r0, =0x00007fff - strh r0, [r2] - ldr r1, =0x02037b14 - strh r0, [r1] - ldr r0, =0x00003945 - strh r0, [r2, 0x2] - strh r0, [r1, 0x2] - movs r1, 0 - ldr r3, =0x06000020 - ldr r0, =0x00001111 - adds r2, r0, 0 -_0817AED4: - lsls r0, r1, 1 - adds r0, r3 - strh r2, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0xF - bls _0817AED4 - movs r1, 0 - ldr r4, =0x0600f000 - movs r3, 0x1 - ldr r2, =0x000003ff -_0817AEEC: - lsls r0, r1, 1 - adds r0, r4 - strh r3, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, r2 - bls _0817AEEC - bl ResetTasks - bl ResetAllObjectData - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085F06C0 - movs r0, 0 - movs r2, 0x2 - bl InitBgsFromTemplates - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - bl sub_817B02C - ldr r0, =0x0000ffff - str r0, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe - movs r0, 0x1 - bl EnableInterrupts - ldr r0, =sub_817ADF4 - bl SetVBlankCallback - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - b _0817AFC8 - .pool -_0817AFA4: - bl fade_and_return_progress_probably - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0817AFC8 - ldr r0, =sub_817ADE4 - bl SetMainCallback2 - movs r0, 0x1 - b _0817AFCA - .pool -_0817AFC8: - movs r0, 0 -_0817AFCA: - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_817AE00 - - thumb_func_start sub_817AFD4 -sub_817AFD4: @ 817AFD4 - push {r4,lr} - sub sp, 0x4 - ldr r0, =0x030022c0 - movs r1, 0x87 - lsls r1, 3 - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0 - beq _0817AFEA - cmp r0, 0x1 - beq _0817B008 -_0817AFEA: - ldr r0, =0x0000ffff - str r0, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - movs r0, 0x1 - strb r0, [r4] - b _0817B020 - .pool -_0817B008: - bl fade_and_return_progress_probably - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0817B020 - bl FreeAllWindowBuffers - bl Reset -_0817B020: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817AFD4 - - thumb_func_start sub_817B02C -sub_817B02C: @ 817B02C - push {lr} - ldr r0, =gUnknown_085F06C8 - bl InitWindows - bl DeactivateAllTextPrinters - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - movs r1, 0 - movs r2, 0x2 - movs r3, 0xE0 - bl sub_80987D4 - ldr r0, =gUnknown_0860F074 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B02C - - thumb_func_start load_intro_part2_graphics -load_intro_part2_graphics: @ 817B064 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_085F0740 - ldr r1, =0x06004000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F0BC0 - ldr r1, =0x06007800 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F06E0 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - cmp r4, 0 - beq _0817B08C - cmp r4, 0x1 - beq _0817B0EC -_0817B08C: - ldr r0, =gUnknown_085F0DBC - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F1398 - ldr r1, =0x06003000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F0CFC - movs r1, 0 - movs r2, 0x60 - bl gpu_pal_apply - ldr r0, =gUnknown_085F5064 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F1668 - movs r1, 0x80 - lsls r1, 1 - movs r2, 0x20 - bl gpu_pal_apply - bl sub_817B76C - b _0817B11E - .pool -_0817B0EC: - ldr r0, =gUnknown_085F1824 - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F1EAC - ldr r1, =0x06003000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F17E4 - movs r1, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_085F50EC - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F21B0 - movs r1, 0x80 - lsls r1, 1 - movs r2, 0x20 - bl gpu_pal_apply - bl sub_817B788 -_0817B11E: - ldr r1, =0x0203bd28 - movs r0, 0 - strh r0, [r1] - ldr r1, =0x0300301c - movs r0, 0x8 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end load_intro_part2_graphics - - thumb_func_start sub_817B150 -sub_817B150: @ 817B150 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0817B162 - cmp r0, 0x1 - ble _0817B162 - cmp r0, 0x2 - beq _0817B194 -_0817B162: - ldr r1, =0x00000603 - movs r0, 0xE - bl SetGpuReg - ldr r1, =0x00000702 - movs r0, 0xC - bl SetGpuReg - ldr r1, =0x00000f05 - movs r0, 0xA - bl SetGpuReg - movs r1, 0xF2 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - b _0817B1B6 - .pool -_0817B194: - ldr r1, =0x00000603 - movs r0, 0xE - bl SetGpuReg - ldr r1, =0x00000702 - movs r0, 0xC - bl SetGpuReg - ldr r1, =0x00000f05 - movs r0, 0xA - bl SetGpuReg - movs r1, 0xF2 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg -_0817B1B6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B150 - - thumb_func_start sub_817B1C8 -sub_817B1C8: @ 817B1C8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_085F0740 - ldr r1, =0x06004000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F0BC0 - ldr r1, =0x06007800 - bl LZ77UnCompVram - cmp r4, 0x4 - bhi _0817B214 - lsls r0, r4, 2 - ldr r1, =_0817B200 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0817B200: - .4byte _0817B214 - .4byte _0817B270 - .4byte _0817B2DC - .4byte _0817B2DC - .4byte _0817B334 -_0817B214: - ldr r0, =gUnknown_085F06E0 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_085F0DBC - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F1398 - ldr r1, =0x06003000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F0CFC - movs r1, 0 - movs r2, 0x60 - bl gpu_pal_apply - ldr r0, =gUnknown_085F5064 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F16A8 - ldr r1, =0x06010000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F1668 - b _0817B2A6 - .pool -_0817B270: - ldr r0, =gUnknown_085F0700 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_085F0DBC - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F1398 - ldr r1, =0x06003000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F0D5C - movs r1, 0 - movs r2, 0x60 - bl gpu_pal_apply - ldr r0, =gUnknown_085F5064 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F16A8 - ldr r1, =0x06010000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F1688 -_0817B2A6: - movs r1, 0x80 - lsls r1, 1 - movs r2, 0x20 - bl gpu_pal_apply - bl sub_817B76C - b _0817B370 - .pool -_0817B2DC: - ldr r0, =gUnknown_085F0700 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_085F1824 - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F1EAC - ldr r1, =0x06003000 - bl LZ77UnCompVram - ldr r4, =gUnknown_085F1804 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_085F50EC - bl LoadCompressedObjectPic - movs r1, 0x80 - lsls r1, 1 - adds r0, r4, 0 - movs r2, 0x20 - bl gpu_pal_apply - bl sub_817B788 - b _0817B370 - .pool -_0817B334: - ldr r0, =gUnknown_085F0720 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - ldr r0, =gUnknown_085F235C - movs r1, 0xC0 - lsls r1, 19 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F2568 - ldr r1, =0x06003000 - bl LZ77UnCompVram - ldr r0, =gUnknown_085F231C - movs r1, 0 - movs r2, 0x40 - bl gpu_pal_apply - ldr r0, =gUnknown_085F5180 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085F2548 - movs r1, 0x80 - lsls r1, 1 - movs r2, 0x20 - bl gpu_pal_apply - bl sub_817B7A4 -_0817B370: - ldr r1, =0x0300301c - movs r0, 0x8 - strb r0, [r1] - ldr r1, =0x0203bd28 - movs r0, 0 - strh r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B1C8 - - thumb_func_start sub_817B3A8 -sub_817B3A8: @ 817B3A8 - push {lr} - ldr r1, =0x00000603 - movs r0, 0xE - bl SetGpuReg - ldr r1, =0x00000702 - movs r0, 0xC - bl SetGpuReg - ldr r1, =0x00000f05 - movs r0, 0xA - bl SetGpuReg - movs r1, 0xFA - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B3A8 - - thumb_func_start sub_817B3DC -sub_817B3DC: @ 817B3DC - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - adds r5, r0, 0 - adds r6, r1, 0 - mov r8, r2 - lsls r5, 24 - lsrs r5, 24 - lsls r6, 16 - lsrs r6, 16 - mov r0, r8 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r3, 16 - lsrs r3, 16 - ldr r1, =sub_817B458 - mov r9, r1 - mov r0, r9 - movs r1, 0 - str r3, [sp] - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - strh r5, [r0, 0x8] - strh r6, [r0, 0xA] - strh r2, [r0, 0xC] - strh r2, [r0, 0xE] - mov r1, r8 - strh r1, [r0, 0x10] - strh r2, [r0, 0x12] - strh r2, [r0, 0x14] - ldr r3, [sp] - strh r3, [r0, 0x16] - movs r1, 0x8 - strh r1, [r0, 0x18] - strh r2, [r0, 0x1A] - adds r0, r4, 0 - bl _call_via_r9 - adds r0, r4, 0 - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817B3DC - - thumb_func_start sub_817B458 -sub_817B458: @ 817B458 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r0, [r4, 0xA] - lsls r2, r0, 16 - cmp r2, 0 - beq _0817B4A0 - movs r1, 0xC - ldrsh r0, [r4, r1] - lsls r0, 16 - ldrh r1, [r4, 0xE] - adds r1, r0, r1 - lsrs r0, r2, 12 - subs r1, r0 - asrs r0, r1, 16 - strh r0, [r4, 0xC] - strh r1, [r4, 0xE] - ldrh r1, [r4, 0xC] - movs r0, 0x14 - bl SetGpuReg - ldr r2, =0x0203bd24 - ldr r0, =0x0203bd26 - ldrh r1, [r0] - ldrh r2, [r2] - adds r1, r2 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x16 - bl SetGpuReg -_0817B4A0: - ldrh r0, [r4, 0x10] - lsls r2, r0, 16 - cmp r2, 0 - beq _0817B4FA - movs r1, 0x12 - ldrsh r0, [r4, r1] - lsls r0, 16 - ldrh r1, [r4, 0x14] - adds r1, r0, r1 - lsrs r0, r2, 12 - subs r1, r0 - asrs r0, r1, 16 - strh r0, [r4, 0x12] - strh r1, [r4, 0x14] - ldrh r1, [r4, 0x12] - movs r0, 0x18 - bl SetGpuReg - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0817B4F0 - ldr r2, =0x0203bd24 - ldr r0, =0x0203bd26 - ldrh r1, [r0] - ldrh r2, [r2] - adds r1, r2 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x1A - bl SetGpuReg - b _0817B4FA - .pool -_0817B4F0: - ldr r0, =0x0203bd24 - ldrh r1, [r0] - movs r0, 0x1A - bl SetGpuReg -_0817B4FA: - ldr r0, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r2, r1, r0 - ldrh r0, [r2, 0x16] - lsls r3, r0, 16 - cmp r3, 0 - beq _0817B532 - movs r1, 0x18 - ldrsh r0, [r2, r1] - lsls r0, 16 - ldrh r1, [r2, 0x1A] - adds r1, r0, r1 - lsrs r0, r3, 12 - subs r1, r0 - asrs r0, r1, 16 - strh r0, [r2, 0x18] - strh r1, [r2, 0x1A] - ldrh r1, [r2, 0x18] - movs r0, 0x1C - bl SetGpuReg - ldr r0, =0x0203bd24 - ldrh r1, [r0] - movs r0, 0x1E - bl SetGpuReg -_0817B532: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B458 - - thumb_func_start sub_817B540 -sub_817B540: @ 817B540 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0817B620 - cmp r0, 0x1 - ble _0817B554 - cmp r0, 0x2 - beq _0817B5B8 -_0817B554: - ldr r0, =0x030022c0 - ldr r2, [r0, 0x20] - movs r0, 0x3 - ands r0, r2 - cmp r0, 0 - bne _0817B620 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0817B620 - movs r0, 0x4 - ands r2, r0 - cmp r2, 0 - beq _0817B58C - ldr r2, =0x02037714 - ldrh r1, [r2, 0x12] - mov r0, sp - strh r1, [r0] - ldrh r1, [r2, 0x14] - b _0817B596 - .pool -_0817B58C: - ldr r2, =0x02037714 - ldrh r1, [r2, 0x14] - mov r0, sp - strh r1, [r0] - ldrh r1, [r2, 0x12] -_0817B596: - adds r0, 0x2 - strh r1, [r0] - adds r4, r0, 0 - mov r0, sp - movs r1, 0x9 - movs r2, 0x2 - bl gpu_pal_apply - adds r0, r4, 0 - movs r1, 0xA - movs r2, 0x2 - bl gpu_pal_apply - b _0817B620 - .pool -_0817B5B8: - ldr r0, =0x030022c0 - ldr r2, [r0, 0x20] - movs r0, 0x3 - ands r0, r2 - cmp r0, 0 - bne _0817B620 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0817B620 - movs r0, 0x4 - ands r2, r0 - cmp r2, 0 - beq _0817B5F8 - mov r1, sp - ldr r2, =0x00003d27 - adds r0, r2, 0 - strh r0, [r1] - adds r1, 0x2 - ldr r2, =0x00000295 - b _0817B606 - .pool -_0817B5F8: - mov r1, sp - movs r2, 0xC7 - lsls r2, 2 - adds r0, r2, 0 - strh r0, [r1] - adds r1, 0x2 - ldr r2, =0x00003d27 -_0817B606: - adds r0, r2, 0 - strh r0, [r1] - adds r4, r1, 0 - mov r0, sp - movs r1, 0xC - movs r2, 0x2 - bl gpu_pal_apply - adds r0, r4, 0 - movs r1, 0xD - movs r2, 0x2 - bl gpu_pal_apply -_0817B620: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B540 - - thumb_func_start sub_817B62C -sub_817B62C: @ 817B62C - push {lr} - adds r2, r0, 0 - ldr r0, =0x0203bd28 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x2 - beq _0817B690 - cmp r0, 0 - beq _0817B64C - adds r0, r2, 0 - bl RemoveObjectAndFreeTiles - b _0817B690 - .pool -_0817B64C: - movs r1, 0x20 - ldrsh r0, [r2, r1] - lsls r0, 16 - ldrh r1, [r2, 0x32] - orrs r0, r1 - ldrh r1, [r2, 0x30] - adds r0, r1 - asrs r1, r0, 16 - strh r1, [r2, 0x20] - strh r0, [r2, 0x32] - cmp r1, 0xFF - ble _0817B668 - ldr r0, =0x0000ffe0 - strh r0, [r2, 0x20] -_0817B668: - movs r1, 0x2E - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _0817B688 - ldr r1, =0x0203bd24 - ldr r0, =0x0203bd26 - ldrh r0, [r0] - ldrh r1, [r1] - adds r0, r1 - b _0817B68C - .pool -_0817B688: - ldr r0, =0x0203bd24 - ldrh r0, [r0] -_0817B68C: - negs r0, r0 - strh r0, [r2, 0x26] -_0817B690: - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B62C - - thumb_func_start sub_817B698 -sub_817B698: @ 817B698 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - str r1, [sp, 0x4] - str r2, [sp, 0x8] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - movs r7, 0 - cmp r7, r8 - bcs _0817B74E - ldr r0, =0x02020630 - mov r10, r0 - movs r2, 0x3F - mov r9, r2 -_0817B6C2: - lsls r6, r7, 3 - ldr r0, [sp, 0x4] - adds r6, r0 - ldrb r1, [r6, 0x1] - ldrb r2, [r6, 0x2] - ldrb r3, [r6, 0x3] - ldr r0, =gUnknown_085F504C - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - lsls r5, r0, 4 - adds r5, r0 - lsls r5, 2 - mov r2, r10 - adds r4, r5, r2 - ldrb r2, [r6] - lsls r1, r2, 26 - lsrs r1, 30 - lsrs r2, 6 - adds r0, r4, 0 - movs r3, 0 - bl CalcVecFromObjectCenterToObjectUpperLeft - ldrb r3, [r4, 0x5] - movs r0, 0xC - orrs r3, r0 - strb r3, [r4, 0x5] - ldrb r1, [r6] - lsls r1, 26 - lsrs r1, 30 - lsls r1, 6 - ldrb r2, [r4, 0x1] - mov r0, r9 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r1, [r6] - lsrs r1, 6 - lsls r1, 6 - ldrb r2, [r4, 0x3] - mov r0, r9 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x3] - movs r0, 0xF - ands r3, r0 - strb r3, [r4, 0x5] - ldr r0, =0x02020638 - adds r5, r0 - ldr r2, [sp, 0x8] - str r2, [r5] - ldrb r1, [r6] - lsls r1, 28 - lsrs r1, 28 - adds r0, r4, 0 - bl StartObjectImageAnim - movs r1, 0 - mov r0, sp - ldrh r0, [r0] - strh r0, [r4, 0x2E] - ldrh r0, [r6, 0x4] - strh r0, [r4, 0x30] - strh r1, [r4, 0x32] - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, r8 - bcc _0817B6C2 -_0817B74E: - 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_817B698 - - thumb_func_start sub_817B76C -sub_817B76C: @ 817B76C - push {lr} - ldr r1, =gUnknown_085F50A4 - ldr r2, =gUnknown_085F5094 - movs r0, 0 - movs r3, 0x9 - bl sub_817B698 - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B76C - - thumb_func_start sub_817B788 -sub_817B788: @ 817B788 - push {lr} - ldr r1, =gUnknown_085F5120 - ldr r2, =gUnknown_085F5114 - movs r0, 0x1 - movs r3, 0xC - bl sub_817B698 - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B788 - - thumb_func_start sub_817B7A4 -sub_817B7A4: @ 817B7A4 - push {lr} - ldr r1, =gUnknown_085F519C - ldr r2, =gUnknown_085F5198 - movs r0, 0x1 - movs r3, 0x6 - bl sub_817B698 - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B7A4 - - thumb_func_start nullsub_65 -nullsub_65: @ 817B7C0 - bx lr - thumb_func_end nullsub_65 - - thumb_func_start sub_817B7C4 -sub_817B7C4: @ 817B7C4 - push {r4,lr} - ldr r4, =0x02020630 - movs r1, 0x2E - ldrsh r2, [r0, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r1, [r1] - movs r2, 0x3E - adds r2, r0 - mov r12, r2 - movs r2, 0x4 - ands r2, r1 - mov r1, r12 - ldrb r3, [r1] - movs r1, 0x5 - negs r1, r1 - ands r1, r3 - orrs r1, r2 - mov r2, r12 - strb r1, [r2] - movs r1, 0x2E - ldrsh r2, [r0, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x20] - strh r1, [r0, 0x20] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x24] - strh r1, [r0, 0x24] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x26] - strh r1, [r0, 0x26] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B7C4 - - thumb_func_start sub_817B834 -sub_817B834: @ 817B834 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r1, 0 - ldr r0, =gUnknown_085F51EC - lsls r5, 16 - asrs r5, 16 - lsls r4, 16 - asrs r4, 16 - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x2 - bl AddObjectToFront - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =gUnknown_085F523C - adds r4, 0x8 - lsls r4, 16 - asrs r4, 16 - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x3 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - strh r6, [r1, 0x2E] - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817B834 - - thumb_func_start sub_817B88C -sub_817B88C: @ 817B88C - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r1, 0 - ldr r0, =gUnknown_085F5204 - lsls r5, 16 - asrs r5, 16 - lsls r4, 16 - asrs r4, 16 - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x2 - bl AddObjectToFront - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =gUnknown_085F5254 - adds r4, 0x8 - lsls r4, 16 - asrs r4, 16 - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x3 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - strh r6, [r1, 0x2E] - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817B88C - - thumb_func_start nullsub_66 -nullsub_66: @ 817B8E4 - bx lr - thumb_func_end nullsub_66 - - thumb_func_start sub_817B8E8 -sub_817B8E8: @ 817B8E8 - push {r4,lr} - ldr r4, =0x02020630 - movs r1, 0x2E - ldrsh r2, [r0, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r1, [r1] - movs r2, 0x3E - adds r2, r0 - mov r12, r2 - movs r2, 0x4 - ands r2, r1 - mov r1, r12 - ldrb r3, [r1] - movs r1, 0x5 - negs r1, r1 - ands r1, r3 - orrs r1, r2 - mov r2, r12 - strb r1, [r2] - movs r1, 0x2E - ldrsh r2, [r0, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x22] - strh r1, [r0, 0x22] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x24] - strh r1, [r0, 0x24] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - ldrh r1, [r1, 0x26] - strh r1, [r0, 0x26] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817B8E8 - - thumb_func_start sub_817B948 -sub_817B948: @ 817B948 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r2, r0, 0 - adds r5, r1, 0 - ldr r0, =gUnknown_085F528C - mov r8, r0 - lsls r2, 16 - asrs r4, r2, 16 - ldr r0, =0xffe00000 - adds r2, r0 - asrs r2, 16 - lsls r5, 16 - asrs r5, 16 - mov r0, r8 - adds r1, r2, 0 - adds r2, r5, 0 - movs r3, 0x5 - bl AddObjectToFront - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - adds r4, 0x20 - lsls r4, 16 - asrs r4, 16 - mov r0, r8 - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0x6 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r5, =0x02020630 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - adds r0, r4, r5 - strh r6, [r0, 0x2E] - movs r1, 0x1 - bl StartObjectImageAnim - adds r5, 0x1C - adds r4, r5 - ldr r0, =sub_817B8E8 - str r0, [r4] - adds r0, r6, 0 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817B948 - - thumb_func_start sub_817B9C4 -sub_817B9C4: @ 817B9C4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r2, r0, 0 - adds r5, r1, 0 - ldr r0, =gUnknown_085F52A4 - mov r8, r0 - lsls r2, 16 - asrs r4, r2, 16 - ldr r0, =0xffe00000 - adds r2, r0 - asrs r2, 16 - lsls r5, 16 - asrs r5, 16 - mov r0, r8 - adds r1, r2, 0 - adds r2, r5, 0 - movs r3, 0x5 - bl AddObjectToFront - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - adds r4, 0x20 - lsls r4, 16 - asrs r4, 16 - mov r0, r8 - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0x6 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r5, =0x02020630 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - adds r0, r4, r5 - strh r6, [r0, 0x2E] - movs r1, 0x1 - bl StartObjectImageAnim - adds r5, 0x1C - adds r4, r5 - ldr r0, =sub_817B8E8 - str r0, [r4] - adds r0, r6, 0 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817B9C4 - - thumb_func_start nullsub_67 -nullsub_67: @ 817BA40 - bx lr - thumb_func_end nullsub_67 - - thumb_func_start sub_817BA44 -sub_817BA44: @ 817BA44 - push {r4,r5,lr} - sub sp, 0x4 - movs r4, 0 - ldr r5, =gUnknown_085F5458 -_0817BA4C: - adds r0, r4, 0 - adds r0, 0x14 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r4, 1 - adds r1, r5 - ldrh r1, [r1] - str r1, [sp] - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0xB - bls _0817BA4C - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817BA44 - - thumb_func_start sub_817BA7C -sub_817BA7C: @ 817BA7C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x22 - ldrsh r0, [r4, r1] - cmp r0, 0x8 - ble _0817BB2A - movs r2, 0x3C - ldrsh r0, [r4, r2] - adds r1, r0, 0 - muls r1, r0 - adds r0, r1, 0 - movs r1, 0x50 - bl __divsi3 - movs r1, 0x58 - subs r1, r0 - strh r1, [r4, 0x22] - ldrh r0, [r4, 0x3A] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl sine - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0817BAB6 - adds r0, 0x3 -_0817BAB6: - asrs r0, 2 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x3A] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl cosine - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x3A] - adds r0, 0x4 - strh r0, [r4, 0x3A] - ldrh r1, [r4, 0x3C] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0817BAE0 - ldrh r0, [r4, 0x38] - subs r0, 0x1 - strh r0, [r4, 0x38] -_0817BAE0: - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - movs r1, 0x26 - ldrsh r0, [r4, r1] - cmp r0, 0 - ble _0817BAF6 - adds r1, r4, 0 - adds r1, 0x43 - movs r0, 0x1 - b _0817BAFC -_0817BAF6: - adds r1, r4, 0 - adds r1, 0x43 - movs r0, 0x14 -_0817BAFC: - strb r0, [r1] - movs r2, 0x38 - ldrsh r0, [r4, r2] - cmp r0, 0 - bge _0817BB08 - adds r0, 0x3 -_0817BB08: - asrs r0, 2 - adds r0, 0x14 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x1F - bls _0817BB16 - movs r2, 0x1F -_0817BB16: - movs r0, 0x1F - ands r2, r0 - lsls r2, 1 - ldrb r1, [r4, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - orrs r0, r2 - strb r0, [r4, 0x3] - b _0817BB30 -_0817BB2A: - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0817BB30: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_817BA7C - - thumb_func_start sub_817BB38 -sub_817BB38: @ 817BB38 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gUnknown_085F5440 - movs r1, 0x78 - movs r2, 0x58 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _0817BB82 - ldr r4, =0x02020630 - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - adds r2, r3, r4 - movs r1, 0 - movs r0, 0x30 - strh r0, [r2, 0x38] - strh r5, [r2, 0x3A] - strh r1, [r2, 0x3C] - ldrb r1, [r2, 0x1] - subs r0, 0x34 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x1] - ldrb r0, [r2, 0x3] - movs r1, 0x3E - orrs r0, r1 - strb r0, [r2, 0x3] - adds r4, 0x1C - adds r3, r4 - ldr r0, =sub_817BA7C - str r0, [r3] -_0817BB82: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817BB38 - - thumb_func_start sub_817BB94 -sub_817BB94: @ 817BB94 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x22 - ldrsh r0, [r4, r1] - cmp r0, 0x57 - bgt _0817BBFA - movs r2, 0x3C - ldrsh r0, [r4, r2] - adds r1, r0, 0 - muls r1, r0 - adds r0, r1, 0 - movs r1, 0x5 - bl __divsi3 - adds r0, 0x8 - strh r0, [r4, 0x22] - ldrh r0, [r4, 0x3A] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl sine - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0817BBCC - adds r0, 0x3 -_0817BBCC: - asrs r0, 2 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x3A] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl cosine - strh r0, [r4, 0x24] - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsls r0, 26 - lsrs r0, 24 - movs r1, 0x28 - bl sine - adds r0, 0x8 - strh r0, [r4, 0x38] - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - b _0817BC00 -_0817BBFA: - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0817BC00: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_817BB94 - - thumb_func_start sub_817BC08 -sub_817BC08: @ 817BC08 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gUnknown_085F5440 - movs r1, 0x78 - movs r2, 0x8 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _0817BC5E - ldr r4, =0x02020630 - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - adds r2, r3, r4 - movs r1, 0 - movs r0, 0x8 - strh r0, [r2, 0x38] - strh r5, [r2, 0x3A] - strh r1, [r2, 0x3C] - ldrb r1, [r2, 0x1] - subs r0, 0xC - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x1] - ldrb r1, [r2, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - movs r1, 0x32 - orrs r0, r1 - strb r0, [r2, 0x3] - adds r2, 0x43 - movs r0, 0x1 - strb r0, [r2] - adds r4, 0x1C - adds r3, r4 - ldr r0, =sub_817BB94 - str r0, [r3] -_0817BC5E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817BC08 - - thumb_func_start sub_817BC70 -sub_817BC70: @ 817BC70 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x38 - ldrsh r0, [r4, r1] - cmp r0, 0x8 - ble _0817BCAC - ldrh r0, [r4, 0x3A] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x3A] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl cosine - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x38] - ldrh r1, [r4, 0x34] - subs r0, r1 - strh r0, [r4, 0x38] - ldrh r0, [r4, 0x3A] - adds r0, 0x4 - strh r0, [r4, 0x3A] - b _0817BCB2 -_0817BCAC: - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0817BCB2: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_817BC70 - - thumb_func_start sub_817BCB8 -sub_817BCB8: @ 817BCB8 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - ldr r0, =gUnknown_085F5440 - movs r1, 0x78 - movs r2, 0x38 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x40 - beq _0817BD0E - ldr r4, =0x02020630 - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - adds r2, r3, r4 - movs r1, 0 - strh r5, [r2, 0x34] - movs r0, 0x78 - strh r0, [r2, 0x38] - strh r6, [r2, 0x3A] - strh r1, [r2, 0x3C] - ldrb r1, [r2, 0x1] - subs r0, 0x7C - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x1] - ldrb r0, [r2, 0x3] - movs r1, 0x3E - orrs r0, r1 - strb r0, [r2, 0x3] - adds r2, 0x43 - movs r0, 0x1 - strb r0, [r2] - adds r4, 0x1C - adds r3, r4 - ldr r0, =sub_817BC70 - str r0, [r3] -_0817BD0E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817BCB8 - - thumb_func_start sub_817BD20 -sub_817BD20: @ 817BD20 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x3C] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _0817BD34 - ldrh r0, [r4, 0x22] - adds r0, 0x1 - strh r0, [r4, 0x22] -_0817BD34: - ldrh r1, [r4, 0x3A] - movs r2, 0x3A - ldrsh r0, [r4, r2] - cmp r0, 0x7F - bgt _0817BDE4 - lsls r0, r1, 24 - lsrs r0, 24 - movs r5, 0x38 - ldrsh r1, [r4, r5] - bl sine - negs r0, r0 - strh r0, [r4, 0x26] - movs r0, 0x34 - ldrsh r1, [r4, r0] - movs r2, 0x3C - ldrsh r0, [r4, r2] - muls r0, r1 - movs r1, 0x3 - bl __divsi3 - adds r0, 0x78 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x3A] - adds r3, r0, 0x1 - strh r3, [r4, 0x3A] - movs r5, 0x3A - ldrsh r1, [r4, r5] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - cmp r0, 0 - bge _0817BD78 - adds r0, 0x7F -_0817BD78: - asrs r0, 7 - movs r1, 0x1F - subs r1, r0 - lsls r1, 24 - lsrs r2, r1, 24 - lsls r0, r3, 16 - asrs r0, 16 - cmp r0, 0x40 - ble _0817BD94 - adds r1, r4, 0 - adds r1, 0x43 - movs r0, 0x1 - strb r0, [r1] - b _0817BDC4 -_0817BD94: - adds r3, r4, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - adds r1, r4, 0 - adds r1, 0x43 - movs r0, 0x14 - strb r0, [r1] - ldrh r1, [r4, 0x3A] - movs r5, 0x3A - ldrsh r0, [r4, r5] - cmp r0, 0x70 - ble _0817BDC4 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0817BDC4 - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r3] -_0817BDC4: - cmp r2, 0x13 - bhi _0817BDCA - movs r2, 0x14 -_0817BDCA: - movs r0, 0x1F - ands r2, r0 - lsls r2, 1 - ldrb r1, [r4, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - orrs r0, r2 - strb r0, [r4, 0x3] - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - b _0817BDEA -_0817BDE4: - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles -_0817BDEA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_817BD20 - - thumb_func_start sub_817BDF0 -sub_817BDF0: @ 817BDF0 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =gUnknown_085F5440 - movs r1, 0x78 - movs r2, 0x38 - movs r3, 0 - bl AddObjectToFront - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x40 - beq _0817BE60 - bl GenerateRandomNumber - ldr r6, =0x02020630 - lsls r5, r4, 4 - adds r5, r4 - lsls r5, 2 - adds r4, r5, r6 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x7 - bl __umodsi3 - movs r1, 0x3 - subs r1, r0 - movs r0, 0 - mov r8, r0 - strh r1, [r4, 0x34] - bl GenerateRandomNumber - movs r1, 0x3F - ands r1, r0 - adds r1, 0x30 - strh r1, [r4, 0x38] - mov r0, r8 - strh r0, [r4, 0x3C] - ldrb r1, [r4, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r0, [r4, 0x3] - movs r1, 0x3E - orrs r0, r1 - strb r0, [r4, 0x3] - adds r4, 0x43 - movs r0, 0x14 - strb r0, [r4] - adds r6, 0x1C - adds r5, r6 - ldr r0, =sub_817BD20 - str r0, [r5] -_0817BE60: - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817BDF0 - - thumb_func_start sub_817BE78 -sub_817BE78: @ 817BE78 - push {lr} - ldr r0, =gUnknown_085F540C - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_085F541C - bl LoadTaggedObjectPalettes - pop {r0} - bx r0 - .pool - thumb_func_end sub_817BE78 - - thumb_func_start sub_817BE94 -sub_817BE94: @ 817BE94 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =sub_817BEC4 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0xA] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817BE94 - - thumb_func_start sub_817BEC4 -sub_817BEC4: @ 817BEC4 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_817BA44 - ldr r0, =0x03005e00 - lsls r5, r4, 2 - adds r5, r4 - lsls r5, 3 - adds r5, r0 - movs r0, 0 - strh r0, [r5, 0x26] - movs r0, 0xA - ldrsh r1, [r5, r0] - movs r0, 0x3 - lsls r0, r1 - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0xA - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =sub_817BF14 - str r0, [r5] - movs r0, 0x8C - bl audio_play - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817BEC4 - - thumb_func_start sub_817BF14 -sub_817BF14: @ 817BF14 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r3, r5, 2 - adds r0, r3, r5 - lsls r0, 3 - adds r1, r0, r1 - ldrh r2, [r1, 0x26] - movs r4, 0x26 - ldrsh r0, [r1, r4] - cmp r0, 0x3F - bgt _0817BF70 - movs r0, 0x7 - ands r0, r2 - adds r7, r3, 0 - cmp r0, 0 - bne _0817BF5A - movs r4, 0 - adds r6, r1, 0 -_0817BF3C: - ldrh r1, [r6, 0x26] - movs r0, 0x78 - ands r0, r1 - lsls r0, 1 - lsls r1, r4, 6 - adds r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl sub_817BB38 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _0817BF3C -_0817BF5A: - ldr r0, =0x03005e00 - adds r1, r7, r5 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x26] - adds r0, 0x1 - strh r0, [r1, 0x26] - b _0817BF78 - .pool -_0817BF70: - movs r0, 0x60 - strh r0, [r1, 0x26] - ldr r0, =sub_817BF84 - str r0, [r1] -_0817BF78: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817BF14 - - thumb_func_start sub_817BF84 -sub_817BF84: @ 817BF84 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0, r1 - ldrh r3, [r1, 0x26] - movs r4, 0x26 - ldrsh r0, [r1, r4] - cmp r0, 0 - beq _0817BFA8 - subs r0, r3, 0x1 - strh r0, [r1, 0x26] - b _0817BFAE - .pool -_0817BFA8: - adds r0, r2, 0 - bl DestroyTask -_0817BFAE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_817BF84 - - thumb_func_start sub_817BFB4 -sub_817BFB4: @ 817BFB4 - push {lr} - ldr r0, =sub_817BFCC - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_817BFB4 - - thumb_func_start sub_817BFCC -sub_817BFCC: @ 817BFCC - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_817BA44 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x26] - ldr r1, =sub_817C000 - str r1, [r0] - movs r0, 0xB7 - bl audio_play - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817BFCC - - thumb_func_start sub_817C000 -sub_817C000: @ 817C000 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r2, r5, 2 - adds r0, r2, r5 - lsls r0, 3 - adds r1, r0, r1 - movs r3, 0x26 - ldrsh r0, [r1, r3] - cmp r0, 0x5F - bgt _0817C048 - adds r6, r2, 0 - cmp r0, 0x5 - bgt _0817C032 - movs r4, 0 -_0817C020: - lsls r0, r4, 28 - lsrs r0, 24 - bl sub_817BC08 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x8 - bls _0817C020 -_0817C032: - ldr r0, =0x03005e00 - adds r1, r6, r5 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x26] - adds r0, 0x1 - strh r0, [r1, 0x26] - b _0817C04C - .pool -_0817C048: - ldr r0, =sub_817C058 - str r0, [r1] -_0817C04C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C000 - - thumb_func_start sub_817C058 -sub_817C058: @ 817C058 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - pop {r0} - bx r0 - thumb_func_end sub_817C058 - - thumb_func_start sub_817C068 -sub_817C068: @ 817C068 - push {lr} - ldr r0, =sub_817C080 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_817C068 - - thumb_func_start sub_817C080 -sub_817C080: @ 817C080 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_817BA44 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x26] - ldr r1, =sub_817C0B4 - str r1, [r0] - movs r0, 0x66 - bl audio_play - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C080 - - thumb_func_start sub_817C0B4 -sub_817C0B4: @ 817C0B4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r2, r5, 2 - adds r0, r2, r5 - lsls r0, 3 - adds r1, r0, r1 - movs r3, 0x26 - ldrsh r0, [r1, r3] - cmp r0, 0x2F - bgt _0817C124 - adds r6, r2, 0 - cmp r0, 0 - bne _0817C0E8 - movs r4, 0 -_0817C0D4: - lsls r0, r4, 28 - lsrs r0, 24 - movs r1, 0x4 - bl sub_817BCB8 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _0817C0D4 -_0817C0E8: - ldr r0, =0x03005e00 - adds r1, r6, r5 - lsls r1, 3 - adds r1, r0 - movs r2, 0x26 - ldrsh r0, [r1, r2] - cmp r0, 0x20 - bne _0817C10E - movs r4, 0 -_0817C0FA: - lsls r0, r4, 28 - lsrs r0, 24 - movs r1, 0x8 - bl sub_817BCB8 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _0817C0FA -_0817C10E: - ldr r0, =0x03005e00 - adds r1, r6, r5 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x26] - adds r0, 0x1 - strh r0, [r1, 0x26] - b _0817C128 - .pool -_0817C124: - ldr r0, =sub_817C134 - str r0, [r1] -_0817C128: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C0B4 - - thumb_func_start sub_817C134 -sub_817C134: @ 817C134 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - pop {r0} - bx r0 - thumb_func_end sub_817C134 - - thumb_func_start sub_817C144 -sub_817C144: @ 817C144 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =sub_817C174 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0xC] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817C144 - - thumb_func_start sub_817C174 -sub_817C174: @ 817C174 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_817BA44 - ldr r0, =0x03005e00 - lsls r5, r4, 2 - adds r5, r4 - lsls r5, 3 - adds r5, r0 - movs r0, 0 - strh r0, [r5, 0x26] - ldr r0, =0x02037b54 - ldr r1, =0x02037754 - movs r2, 0x30 - bl CpuSet - ldr r0, =0xfff9041c - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =sub_817C1D4 - str r0, [r5] - movs r0, 0xCA - bl audio_play - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C174 - - thumb_func_start sub_817C1D4 -sub_817C1D4: @ 817C1D4 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x03005e00 - lsls r5, r6, 2 - adds r0, r5, r6 - lsls r0, 3 - adds r1, r0, r1 - movs r0, 0x26 - ldrsh r2, [r1, r0] - cmp r2, 0x7F - bgt _0817C250 - adds r0, r2, 0 - cmp r0, 0 - beq _0817C210 - cmp r0, 0x20 - beq _0817C224 - cmp r2, 0x31 - bgt _0817C234 - bl GenerateRandomNumber - movs r1, 0x7 - ands r0, r1 - bl sub_817BDF0 - b _0817C234 - .pool -_0817C210: - movs r4, 0 -_0817C212: - adds r0, r4, 0 - bl sub_817BDF0 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _0817C212 - b _0817C234 -_0817C224: - ldr r0, =0xffff041c - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0x10 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe -_0817C234: - ldr r0, =0x03005e00 - adds r1, r5, r6 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x26] - adds r0, 0x1 - strh r0, [r1, 0x26] - b _0817C254 - .pool -_0817C250: - ldr r0, =sub_817C260 - str r0, [r1] -_0817C254: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C1D4 - - thumb_func_start sub_817C260 -sub_817C260: @ 817C260 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0817C278 - adds r0, r2, 0 - bl DestroyTask -_0817C278: - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C260 - - thumb_func_start sub_817C280 -sub_817C280: @ 817C280 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =sub_817C2B0 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0xC] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817C280 - - thumb_func_start sub_817C2B0 -sub_817C2B0: @ 817C2B0 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_817BA44 - ldr r0, =0x03005e00 - lsls r5, r4, 2 - adds r5, r4 - lsls r5, 3 - adds r5, r0 - movs r0, 0 - strh r0, [r5, 0x26] - ldr r0, =0x02037b54 - ldr r1, =0x02037754 - movs r2, 0x30 - bl CpuSet - ldr r0, =0xfff90400 - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =sub_817C310 - str r0, [r5] - movs r0, 0xCA - bl audio_play - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C2B0 - - thumb_func_start sub_817C310 -sub_817C310: @ 817C310 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =0x03005e00 - lsls r5, r6, 2 - adds r0, r5, r6 - lsls r0, 3 - adds r1, r0, r1 - movs r0, 0x26 - ldrsh r2, [r1, r0] - cmp r2, 0x7F - bgt _0817C38C - adds r0, r2, 0 - cmp r0, 0 - beq _0817C34C - cmp r0, 0x20 - beq _0817C360 - cmp r2, 0x31 - bgt _0817C370 - bl GenerateRandomNumber - movs r1, 0x7 - ands r0, r1 - bl sub_817BDF0 - b _0817C370 - .pool -_0817C34C: - movs r4, 0 -_0817C34E: - adds r0, r4, 0 - bl sub_817BDF0 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _0817C34E - b _0817C370 -_0817C360: - ldr r0, =0xffff0400 - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0x10 - movs r2, 0x10 - movs r3, 0 - bl pal_fade_maybe -_0817C370: - ldr r0, =0x03005e00 - adds r1, r5, r6 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x26] - adds r0, 0x1 - strh r0, [r1, 0x26] - b _0817C390 - .pool -_0817C38C: - ldr r0, =sub_817C260 - str r0, [r1] -_0817C390: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C310 - - thumb_func_start nullsub_68 -nullsub_68: @ 817C39C - bx lr - thumb_func_end nullsub_68 - - thumb_func_start sub_817C3A0 -sub_817C3A0: @ 817C3A0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - movs r1, 0 - ldr r3, =sub_817C4EC - ldr r2, =0x00007fff -_0817C3BA: - lsls r0, r1, 1 - add r0, sp - adds r0, 0x4 - strh r2, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0xF - bls _0817C3BA - adds r0, r3, 0 - movs r1, 0 - bl CreateTask - mov r8, r0 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =0x03005e00 - mov r1, r8 - lsls r6, r1, 2 - add r6, r8 - lsls r6, 3 - adds r6, r0 - strh r5, [r6, 0xA] - strh r7, [r6, 0xC] - movs r1, 0x80 - lsls r1, 1 - strh r1, [r6, 0xE] - movs r0, 0x10 - strh r0, [r6, 0x10] - movs r4, 0x80 - lsls r4, 9 - str r1, [sp] - movs r0, 0x1E - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - movs r0, 0x10 - ldrsh r1, [r6, r0] - adds r0, r4, 0 - bl __divsi3 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - movs r0, 0x1F - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - ldr r1, =0x02020630 - mov r9, r1 - lsls r2, r5, 4 - adds r2, r5 - lsls r2, 2 - mov r3, r9 - adds r3, 0x1C - adds r0, r2, r3 - ldr r1, =nullsub_68 - str r1, [r0] - add r2, r9 - ldrb r1, [r2, 0x1] - movs r4, 0x4 - negs r4, r4 - adds r0, r4, 0 - ands r0, r1 - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2, 0x1] - ldrb r1, [r2, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - movs r1, 0x3C - orrs r0, r1 - strb r0, [r2, 0x3] - movs r0, 0x3E - adds r0, r2 - mov r10, r0 - ldrb r1, [r0] - movs r5, 0x5 - negs r5, r5 - adds r0, r5, 0 - ands r0, r1 - mov r1, r10 - strb r0, [r1] - ldrb r1, [r2, 0x5] - lsrs r1, 4 - lsls r1, 5 - ldr r0, =0x02037d14 - mov r10, r0 - add r1, r10 - add r0, sp, 0x4 - movs r2, 0x10 - str r3, [sp, 0x24] - bl CpuSet - lsls r1, r7, 4 - adds r1, r7 - lsls r1, 2 - ldr r3, [sp, 0x24] - adds r3, r1, r3 - ldr r0, =nullsub_68 - str r0, [r3] - add r1, r9 - ldrb r0, [r1, 0x1] - ands r4, r0 - movs r0, 0x1 - orrs r4, r0 - strb r4, [r1, 0x1] - ldrb r0, [r1, 0x3] - movs r2, 0x3E - orrs r0, r2 - strb r0, [r1, 0x3] - adds r2, r1, 0 - adds r2, 0x3E - ldrb r0, [r2] - ands r5, r0 - strb r5, [r2] - ldrb r1, [r1, 0x5] - lsrs r1, 4 - lsls r1, 5 - add r1, r10 - add r0, sp, 0x4 - movs r2, 0x10 - bl CpuSet - movs r1, 0 - strh r1, [r6, 0x18] - mov r0, r8 - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817C3A0 - - thumb_func_start sub_817C4EC -sub_817C4EC: @ 817C4EC - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0 - strh r0, [r1, 0x12] - movs r0, 0x8 - strh r0, [r1, 0x14] - ldr r0, =sub_817C510 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_817C4EC - - thumb_func_start sub_817C510 -sub_817C510: @ 817C510 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r2, r0, r1 - movs r1, 0x18 - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _0817C534 - adds r0, r3, 0 - bl sub_817C72C - b _0817C556 - .pool -_0817C534: - ldrh r1, [r2, 0x14] - movs r4, 0x14 - ldrsh r0, [r2, r4] - cmp r0, 0x80 - bne _0817C546 - adds r0, r3, 0 - bl sub_817C67C - b _0817C556 -_0817C546: - adds r0, r1, 0x2 - strh r0, [r2, 0x14] - ldrh r0, [r2, 0x12] - movs r1, 0x1 - eors r0, r1 - strh r0, [r2, 0x12] - ldr r0, =sub_817C560 - str r0, [r2] -_0817C556: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C510 - - thumb_func_start sub_817C560 -sub_817C560: @ 817C560 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r1 - movs r3, 0x18 - ldrsh r0, [r2, r3] - adds r5, r1, 0 - cmp r0, 0 - beq _0817C58C - ldr r0, =sub_817C72C - str r0, [r2] - b _0817C670 - .pool -_0817C58C: - movs r6, 0 - movs r7, 0x12 - ldrsh r0, [r2, r7] - cmp r0, 0 - bne _0817C5DC - movs r0, 0xE - ldrsh r1, [r2, r0] - movs r3, 0x14 - ldrsh r0, [r2, r3] - movs r3, 0x80 - lsls r3, 1 - subs r0, r3, r0 - cmp r1, r0 - bge _0817C5B2 - ldrh r0, [r2, 0x14] - ldrh r7, [r2, 0xE] - adds r0, r7 - strh r0, [r2, 0xE] - b _0817C5B6 -_0817C5B2: - strh r3, [r2, 0xE] - movs r6, 0x1 -_0817C5B6: - lsls r2, r4, 2 - adds r0, r2, r4 - lsls r0, 3 - adds r3, r0, r5 - movs r0, 0x10 - ldrsh r1, [r3, r0] - movs r7, 0x14 - ldrsh r0, [r3, r7] - adds r0, 0x10 - cmp r1, r0 - ble _0817C5D6 - ldrh r0, [r3, 0x10] - ldrh r1, [r3, 0x14] - subs r0, r1 - strh r0, [r3, 0x10] - b _0817C626 -_0817C5D6: - movs r0, 0x10 - strh r0, [r3, 0x10] - b _0817C620 -_0817C5DC: - movs r0, 0x10 - ldrsh r1, [r2, r0] - movs r3, 0x14 - ldrsh r0, [r2, r3] - movs r3, 0x80 - lsls r3, 1 - subs r0, r3, r0 - cmp r1, r0 - bge _0817C5F8 - ldrh r0, [r2, 0x14] - ldrh r7, [r2, 0x10] - adds r0, r7 - strh r0, [r2, 0x10] - b _0817C5FC -_0817C5F8: - strh r3, [r2, 0x10] - movs r6, 0x1 -_0817C5FC: - lsls r2, r4, 2 - adds r0, r2, r4 - lsls r0, 3 - adds r3, r0, r5 - movs r0, 0xE - ldrsh r1, [r3, r0] - movs r7, 0x14 - ldrsh r0, [r3, r7] - adds r0, 0x10 - cmp r1, r0 - ble _0817C61C - ldrh r0, [r3, 0xE] - ldrh r1, [r3, 0x14] - subs r0, r1 - strh r0, [r3, 0xE] - b _0817C626 -_0817C61C: - movs r0, 0x10 - strh r0, [r3, 0xE] -_0817C620: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0817C626: - adds r0, r2, r4 - lsls r0, 3 - adds r5, r0, r5 - movs r0, 0xE - ldrsh r1, [r5, r0] - movs r4, 0x80 - lsls r4, 9 - adds r0, r4, 0 - bl __divsi3 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - movs r0, 0x1E - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - movs r3, 0x10 - ldrsh r1, [r5, r3] - adds r0, r4, 0 - bl __divsi3 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - movs r0, 0x1F - movs r2, 0 - movs r3, 0 - bl SetSpriteTransformationMatrix - cmp r6, 0x2 - bne _0817C670 - ldr r0, =sub_817C510 - str r0, [r5] -_0817C670: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C560 - - thumb_func_start sub_817C67C -sub_817C67C: @ 817C67C - push {r4-r6,lr} - mov r6, r8 - push {r6} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02020630 - mov r8, r1 - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - movs r2, 0xA - ldrsh r1, [r4, r2] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - add r2, r8 - ldrb r3, [r2, 0x1] - movs r6, 0x4 - negs r6, r6 - adds r1, r6, 0 - ands r1, r3 - strb r1, [r2, 0x1] - movs r2, 0xA - ldrsh r1, [r4, r2] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - add r2, r8 - ldrb r3, [r2, 0x3] - movs r5, 0x3F - negs r5, r5 - adds r1, r5, 0 - ands r1, r3 - strb r1, [r2, 0x3] - movs r1, 0xA - ldrsh r2, [r4, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r8 - adds r1, 0x3E - ldrb r2, [r1] - movs r3, 0x4 - orrs r2, r3 - strb r2, [r1] - movs r1, 0xC - ldrsh r2, [r4, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x1] - ands r6, r2 - strb r6, [r1, 0x1] - movs r1, 0xC - ldrsh r2, [r4, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x3] - ands r5, r2 - strb r5, [r1, 0x3] - movs r1, 0xC - ldrsh r2, [r4, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r8 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - ands r2, r3 - strb r2, [r1] - bl DestroyTask - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C67C - - thumb_func_start sub_817C72C -sub_817C72C: @ 817C72C - push {r4-r6,lr} - mov r6, r8 - push {r6} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02020630 - mov r8, r1 - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - movs r2, 0xA - ldrsh r1, [r4, r2] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - add r2, r8 - ldrb r3, [r2, 0x1] - movs r6, 0x4 - negs r6, r6 - adds r1, r6, 0 - ands r1, r3 - strb r1, [r2, 0x1] - movs r2, 0xA - ldrsh r1, [r4, r2] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - add r2, r8 - ldrb r3, [r2, 0x3] - movs r5, 0x3F - negs r5, r5 - adds r1, r5, 0 - ands r1, r3 - strb r1, [r2, 0x3] - movs r1, 0xA - ldrsh r2, [r4, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r8 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - ands r2, r3 - strb r2, [r1] - movs r1, 0xC - ldrsh r2, [r4, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x1] - ands r6, r2 - strb r6, [r1, 0x1] - movs r1, 0xC - ldrsh r2, [r4, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r8 - ldrb r2, [r1, 0x3] - ands r5, r2 - strb r5, [r1, 0x3] - movs r1, 0xC - ldrsh r2, [r4, r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r8 - adds r1, 0x3E - ldrb r2, [r1] - movs r3, 0x4 - orrs r2, r3 - strb r2, [r1] - bl DestroyTask - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C72C - - thumb_func_start sub_817C7DC -sub_817C7DC: @ 817C7DC - ldr r2, =gUnknown_0860A320 - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - lsls r1, 1 - adds r1, r0 - movs r2, 0 - ldrsh r0, [r1, r2] - bx lr - .pool - thumb_func_end sub_817C7DC - - thumb_func_start sub_817C7F4 -sub_817C7F4: @ 817C7F4 - push {r4,r5,lr} - lsls r4, r0, 16 - lsrs r5, r4, 16 - adds r0, r5, 0 - bl sub_811EB10 - lsls r0, 24 - cmp r0, 0 - beq _0817C810 - ldr r0, =gUnknown_0860A3AC - b _0817C84E - .pool -_0817C810: - lsrs r0, r4, 25 - ldr r2, =0x000001ff - ands r2, r5 - cmp r0, 0x13 - bhi _0817C828 - cmp r0, 0x12 - bcs _0817C834 - cmp r0, 0 - beq _0817C82C - b _0817C83C - .pool -_0817C828: - cmp r0, 0x15 - bne _0817C83C -_0817C82C: - ldr r1, =gUnknown_085F5494 - b _0817C844 - .pool -_0817C834: - ldr r1, =gUnknown_085FA1D8 - b _0817C844 - .pool -_0817C83C: - ldr r1, =gUnknown_0860A168 - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] -_0817C844: - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 4 - adds r1, r0 - adds r0, r1, 0 -_0817C84E: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817C7F4 - - thumb_func_start sub_817C858 -sub_817C858: @ 817C858 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - lsls r1, 16 - lsrs r7, r1, 16 - movs r0, 0 - strh r0, [r5, 0x4] - movs r6, 0 - ldr r0, =gUnknown_0860A3DC - mov r8, r0 - adds r4, r5, 0 - adds r4, 0x18 -_0817C872: - lsls r0, r6, 3 - ldr r1, [r5, 0x30] - adds r2, r1, r0 - ldrb r0, [r2] - cmp r0, 0xFF - beq _0817C8A0 - movs r1, 0x1 - ldrsb r1, [r2, r1] - lsls r0, 2 - add r0, r8 - ldr r0, [r0] - adds r1, r0 - strh r1, [r4] - adds r0, r7, 0 - adds r0, 0x1E - adds r1, r6, 0 - bl sub_817C7DC - strh r0, [r4, 0x2] - ldrh r0, [r4] - ldrh r1, [r5, 0x4] - adds r0, r1 - strh r0, [r5, 0x4] -_0817C8A0: - adds r4, 0x4 - adds r6, 0x1 - cmp r6, 0x5 - ble _0817C872 - movs r0, 0 - strb r0, [r5, 0x1] - strh r0, [r5, 0xA] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817C858 - - thumb_func_start sub_817C8BC -sub_817C8BC: @ 817C8BC - push {lr} - ldr r0, =0x02037318 - ldrb r0, [r0, 0x17] - bl is_light_level_1_2_3_or_6 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0817C8D8 - movs r0, 0 - b _0817C8E6 - .pool -_0817C8D8: - ldr r1, =0x03005db0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =0x0203ceec - ldr r0, =hm_teleport_run_dp02scr - str r0, [r1] - movs r0, 0x1 -_0817C8E6: - pop {r1} - bx r1 - .pool - thumb_func_end sub_817C8BC - - thumb_func_start hm_teleport_run_dp02scr -hm_teleport_run_dp02scr: @ 817C8FC - push {lr} - bl sub_808469C - movs r0, 0x3F - bl FieldEffectStart - bl brm_get_pokemon_selection - ldr r1, =0x02038c08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end hm_teleport_run_dp02scr - - thumb_func_start sub_817C91C -sub_817C91C: @ 817C91C - push {lr} - bl oei_task_add - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =sub_817C94C - lsrs r0, r2, 16 - strh r0, [r1, 0x18] - strh r2, [r1, 0x1A] - movs r0, 0x1 - bl SetPlayerAvatarTransitionFlags - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_817C91C - - thumb_func_start sub_817C94C -sub_817C94C: @ 817C94C - push {lr} - movs r0, 0x3F - bl FieldEffectActiveListRemove - bl sub_80B7FC8 - pop {r0} - bx r0 - thumb_func_end sub_817C94C - - thumb_func_start sub_817C95C -sub_817C95C: @ 817C95C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0817C988 - ldr r0, [sp] - cmp r0, 0x1B - beq _0817C988 - cmp r0, 0xDD - beq _0817C988 - bl _0817E0A6 -_0817C988: - ldr r0, =0x0202449c - ldr r0, [r0] - movs r1, 0x81 - lsls r1, 2 - adds r7, r0, r1 - ldr r5, =0x0202420b - ldrb r0, [r5] - bl battle_side_get_owner - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0202420c - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x0202420e - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r0, =0x0203aba8 - ldr r0, [r0] - ldrb r0, [r0, 0x7] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - cmp r4, 0 - bne _0817CA00 - ldr r2, =0x0202406e - ldrb r0, [r5] - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - b _0817CA10 - .pool -_0817CA00: - ldr r2, =0x0202406e - ldrb r0, [r5] - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 -_0817CA10: - adds r1, r0 - str r1, [sp, 0x8] - cmp r6, 0 - bne _0817CA3C - ldr r0, =0x0202420c - ldrb r0, [r0] - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - b _0817CA4C - .pool -_0817CA3C: - ldr r0, =0x0202420c - ldrb r0, [r0] - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 -_0817CA4C: - adds r1, r0 - str r1, [sp, 0xC] - ldr r0, =0x0202420b - ldrb r0, [r0] - ldr r1, =0x0203aba8 - ldr r1, [r1] - ldrh r1, [r1] - bl sub_817F33C - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - cmp r0, 0x3 - bls _0817CA9C - ldr r0, [sp] - bl sub_817E0B8 - lsls r0, 24 - cmp r0, 0 - beq _0817CA9C - ldr r2, [sp] - cmp r2, 0xC - bls _0817CA9C - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r7, r0 - adds r0, 0x57 - ldrb r1, [r0] - movs r2, 0x1E - bl _0817E0A2 - .pool -_0817CA9C: - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 25 - mov r8, r0 - ldr r0, =0x0202420c - ldrb r0, [r0] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r5, r0, 25 - ldr r0, =0x0202420e - ldrb r0, [r0] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r3, r0, 25 - ldr r1, [sp] - subs r1, 0x2 - movs r0, 0xB0 - lsls r0, 1 - cmp r1, r0 - bls _0817CAD2 - bl _0817E0A6 -_0817CAD2: - lsls r0, r1, 2 - ldr r1, =_0817CAEC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0817CAEC: - .4byte _0817DD7A - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817D070 - .4byte _0817DD74 - .4byte _0817DD80 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817DA68 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817D7D8 - .4byte _0817E0A6 - .4byte _0817D8A4 - .4byte _0817E0A6 - .4byte _0817D838 - .4byte _0817E0A6 - .4byte _0817D704 - .4byte _0817E0A6 - .4byte _0817D76C - .4byte _0817DB24 - .4byte _0817E0A6 - .4byte _0817DB90 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817D9C2 - .4byte _0817E0A6 - .4byte _0817DA24 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817DBD4 - .4byte _0817E0A6 - .4byte _0817D94C - .4byte _0817E0A6 - .4byte _0817D994 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E040 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817DE10 - .4byte _0817DDC8 - .4byte _0817DEDC - .4byte _0817DF24 - .4byte _0817DF4E - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817D65E - .4byte _0817D65E - .4byte _0817D65E - .4byte _0817D65E - .4byte _0817D698 - .4byte _0817E0A6 - .4byte _0817E08E - .4byte _0817DF70 - .4byte _0817DFBC - .4byte _0817E0A6 - .4byte _0817E08E - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817D53C - .4byte _0817E0A6 - .4byte _0817D584 - .4byte _0817DACC - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817D3A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817D296 - .4byte _0817D2E4 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817D5CE - .4byte _0817D608 - .4byte _0817D498 - .4byte _0817D4E0 - .4byte _0817DC62 - .4byte _0817DC98 - .4byte _0817E0A6 - .4byte _0817D1B8 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817DCDC - .4byte _0817E0A6 - .4byte _0817D0DC - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817D1E0 - .4byte _0817D314 - .4byte _0817D354 - .4byte _0817D372 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817D216 - .4byte _0817D260 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817D3C0 - .4byte _0817D3F2 - .4byte _0817D440 - .4byte _0817D45C - .4byte _0817D3B8 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817D098 - .4byte _0817D0D4 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817DC20 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817D16C - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817DD38 - .4byte _0817DCFC - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817D65E - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817D124 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817E0A6 - .4byte _0817DE58 - .4byte _0817DDC8 - .4byte _0817DE10 - .4byte _0817DFE6 -_0817D070: - movs r0, 0x1 - mov r1, r10 - movs r2, 0x2 - movs r3, 0 - bl sub_817E684 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0817D08C - bl _0817E0A6 -_0817D08C: - bl sub_817EECC - bl _0817E0A6 - .pool -_0817D098: - movs r0, 0x1 - mov r1, r10 - movs r2, 0x1 - movs r3, 0 - bl sub_817E684 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0817D0B4 - bl _0817E0A6 -_0817D0B4: - ldr r0, [sp, 0xC] - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - bne _0817D0C6 - bl _0817E0A6 -_0817D0C6: - bl sub_817EECC - bl _0817E0A6 - .pool -_0817D0D4: - movs r0, 0x1 - mov r1, r10 - movs r2, 0 - b _0817D48E -_0817D0DC: - lsls r3, r4, 1 - adds r3, r4 - lsls r3, 2 - adds r3, r7, r3 - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - adds r0, 0x1 - movs r1, 0x7 - ands r0, r1 - lsls r0, 15 - ldr r1, [r3, 0x50] - ldr r2, =0xfffc7fff - ands r1, r2 - orrs r1, r0 - str r1, [r3, 0x50] - adds r3, 0x55 - movs r0, 0x3 - mov r1, r10 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0xD - negs r0, r0 - bl _0817DC0C - .pool -_0817D124: - lsls r2, r4, 1 - adds r2, r4 - lsls r2, 2 - adds r2, r7, r2 - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x1 - adds r4, r2, 0 - adds r4, 0x52 - movs r0, 0x7 - ands r1, r0 - lsls r1, 2 - ldrb r3, [r4] - movs r0, 0x1D - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r4] - adds r2, 0x55 - movs r0, 0x3 - mov r1, r10 - ands r1, r0 - lsls r1, 4 - ldrb r3, [r2] - movs r0, 0x31 - negs r0, r0 - bl _0817DFAA - .pool -_0817D16C: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r5, r7, r0 - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x1 - adds r3, r5, 0 - adds r3, 0x52 - lsls r1, 5 - ldrb r2, [r3] - movs r0, 0x1F - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - adds r4, r5, 0 - adds r4, 0x55 - mov r0, r10 - lsls r2, r0, 6 - ldrb r1, [r4] - movs r0, 0x3F - ands r0, r1 - orrs r0, r2 - strb r0, [r4] - adds r2, r5, 0 - adds r2, 0x58 - ldrb r0, [r2] - movs r1, 0x40 - bl _0817DFAC - .pool -_0817D1B8: - ldr r1, =0x02022f5c - ldrb r0, [r1] - cmp r0, 0 - beq _0817D1C4 - bl _0817E0A6 -_0817D1C4: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r7, r0 - adds r0, 0x57 - ldrb r2, [r0] - movs r1, 0x1F - negs r1, r1 - ands r1, r2 - movs r2, 0x14 - bl _0817E0A2 - .pool -_0817D1E0: - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 2 - adds r3, r7, r0 - adds r0, r3, 0 - adds r0, 0x53 - ldrb r0, [r0] - lsls r0, 29 - lsrs r0, 29 - cmp r0, 0 - bne _0817D1FA - bl _0817E0A6 -_0817D1FA: - adds r2, r6, 0 - subs r1, r0, 0x1 - lsls r1, 2 - adds r0, r3, 0 - adds r0, 0x56 - ldrb r3, [r0] - lsls r3, 30 - lsrs r3, 30 - adds r3, r1 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x2 - bl _0817DB10 -_0817D216: - lsls r2, r4, 1 - adds r2, r4 - lsls r2, 2 - adds r2, r7, r2 - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x1 - adds r4, r2, 0 - adds r4, 0x53 - movs r0, 0x7 - ands r1, r0 - lsls r1, 3 - ldrb r3, [r4] - movs r0, 0x39 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r4] - adds r2, 0x56 - movs r0, 0x3 - mov r1, r10 - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2] - movs r0, 0xD - negs r0, r0 - bl _0817DFAA - .pool -_0817D260: - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 2 - adds r3, r7, r0 - adds r0, r3, 0 - adds r0, 0x53 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 29 - cmp r0, 0 - bne _0817D27A - bl _0817E0A6 -_0817D27A: - adds r2, r6, 0 - subs r1, r0, 0x1 - lsls r1, 2 - adds r0, r3, 0 - adds r0, 0x56 - ldrb r3, [r0] - lsls r3, 28 - lsrs r3, 30 - adds r3, r1 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x2 - bl _0817DBC2 -_0817D296: - lsls r2, r4, 1 - adds r2, r4 - lsls r2, 2 - adds r2, r7, r2 - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x1 - adds r2, 0x56 - movs r0, 0x7 - ands r1, r0 - lsls r1, 4 - ldrb r3, [r2] - movs r0, 0x71 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x3 - mov r1, r10 - ands r1, r0 - lsls r1, 7 - ldrh r3, [r2] - ldr r0, =0xfffffe7f - ands r0, r3 - orrs r0, r1 - strh r0, [r2] - bl _0817E0A6 - .pool -_0817D2E4: - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 2 - adds r0, r7, r0 - adds r0, 0x56 - ldrb r0, [r0] - lsls r0, 25 - lsrs r0, 29 - cmp r0, 0 - bne _0817D2FC - bl _0817E0A6 -_0817D2FC: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r7, r0 - adds r0, 0x57 - ldrb r2, [r0] - movs r1, 0x1F - negs r1, r1 - ands r1, r2 - movs r2, 0x16 - bl _0817E0A2 -_0817D314: - mov r2, r8 - lsls r3, r2, 3 - lsls r0, r4, 4 - adds r3, r0 - adds r3, r7, r3 - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x1 - adds r3, 0x35 - movs r0, 0x7 - ands r1, r0 - ldrb r2, [r3] - movs r0, 0x8 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - movs r2, 0x3 - mov r1, r10 - ands r1, r2 - lsls r1, 3 - movs r2, 0x19 - negs r2, r2 - bl _0817DC0C - .pool -_0817D354: - mov r1, r8 - lsls r0, r1, 3 - lsls r1, r4, 4 - adds r0, r1 - adds r0, r7, r0 - adds r0, 0x35 - ldrb r1, [r0] - lsls r0, r1, 29 - lsrs r0, 29 - cmp r0, 0 - bne _0817D36E - bl _0817E0A6 -_0817D36E: - adds r2, r4, 0 - b _0817D38C -_0817D372: - lsls r0, r5, 3 - lsls r1, r6, 4 - adds r0, r1 - adds r0, r7, r0 - adds r0, 0x35 - ldrb r1, [r0] - lsls r0, r1, 29 - lsrs r0, 29 - cmp r0, 0 - bne _0817D38A - bl _0817E0A6 -_0817D38A: - adds r2, r6, 0 -_0817D38C: - subs r0, 0x1 - lsls r0, 2 - lsls r3, r1, 27 - lsrs r3, 30 - adds r3, r0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x2 - movs r1, 0x6 - bl sub_817E684 - bl _0817E0A6 -_0817D3A6: - ldr r0, =0x0202449c - ldr r0, [r0] - adds r0, 0xB3 - movs r1, 0x1 - bl _0817E0A4 - .pool -_0817D3B8: - movs r0, 0x12 - mov r1, r10 - movs r2, 0 - b _0817D48E -_0817D3C0: - ldr r0, =0x02022f58 - ldrb r2, [r0, 0x2] - cmp r2, 0 - bne _0817D3CC - bl _0817E0A6 -_0817D3CC: - ldr r1, =0x02022f6a - ldrh r0, [r1] - cmp r0, 0xD1 - bne _0817D3E8 - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x17 - b _0817D48C - .pool -_0817D3E8: - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x16 - b _0817D48C -_0817D3F2: - ldr r0, =0x02022f58 - ldrb r2, [r0, 0x2] - cmp r2, 0 - bne _0817D3FE - bl _0817E0A6 -_0817D3FE: - ldr r0, =0x0202420b - ldr r1, =0x0202420c - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bne _0817D436 - ldr r1, =0x02022f6a - ldrh r0, [r1] - cmp r0, 0xD1 - bne _0817D42C - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x17 - b _0817D48C - .pool -_0817D42C: - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x16 - b _0817D48C -_0817D436: - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x1B - b _0817D48C -_0817D440: - ldr r0, =0x02022f58 - ldrb r2, [r0, 0x2] - cmp r2, 0 - bne _0817D44C - bl _0817E0A6 -_0817D44C: - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x18 - b _0817D48C - .pool -_0817D45C: - ldr r0, =0x02022f58 - ldrb r2, [r0, 0x2] - cmp r2, 0 - bne _0817D468 - bl _0817E0A6 -_0817D468: - ldr r1, =0x02022f6a - ldrh r0, [r1] - cmp r0, 0xD3 - bne _0817D484 - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x1A - b _0817D48C - .pool -_0817D484: - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x19 -_0817D48C: - mov r1, r10 -_0817D48E: - movs r3, 0 - bl sub_817E684 - bl _0817E0A6 -_0817D498: - lsls r2, r5, 3 - lsls r0, r6, 4 - adds r2, r0 - adds r2, r7, r2 - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x1 - adds r4, r2, 0 - adds r4, 0x30 - movs r0, 0x7 - ands r1, r0 - ldrb r3, [r4] - movs r0, 0x8 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r4] - adds r2, 0x32 - movs r0, 0x3 - mov r1, r10 - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2] - movs r0, 0xD - negs r0, r0 - bl _0817DFAA - .pool -_0817D4E0: - ldr r0, [sp, 0x8] - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - bne _0817D4F2 - bl _0817E0A6 -_0817D4F2: - mov r2, r8 - lsls r0, r2, 3 - lsls r1, r4, 4 - adds r0, r1 - adds r1, r7, r0 - adds r0, r1, 0 - adds r0, 0x30 - ldrb r0, [r0] - lsls r0, 29 - lsrs r0, 29 - cmp r0, 0 - bne _0817D50E - bl _0817E0A6 -_0817D50E: - subs r2, r0, 0x1 - lsls r2, 24 - lsrs r2, 24 - adds r0, r1, 0 - adds r0, 0x32 - ldrb r3, [r0] - lsls r3, 28 - lsrs r3, 30 - movs r0, 0x8 - movs r1, 0 - bl sub_817E684 - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 2 - adds r1, r7, r1 - adds r1, 0x57 - ldrb r2, [r1] - movs r0, 0x1F - negs r0, r0 - ands r0, r2 - movs r2, 0x2 - b _0817D6F2 -_0817D53C: - lsls r2, r5, 3 - lsls r0, r6, 4 - adds r2, r0 - adds r2, r7, r2 - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x1 - adds r4, r2, 0 - adds r4, 0x30 - movs r0, 0x7 - ands r1, r0 - lsls r1, 3 - ldrb r3, [r4] - movs r0, 0x39 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r4] - adds r2, 0x32 - movs r0, 0x3 - mov r1, r10 - ands r1, r0 - lsls r1, 4 - ldrb r3, [r2] - movs r0, 0x31 - negs r0, r0 - bl _0817DFAA - .pool -_0817D584: - mov r1, r8 - lsls r0, r1, 3 - lsls r1, r4, 4 - adds r0, r1 - adds r1, r7, r0 - adds r0, r1, 0 - adds r0, 0x30 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 29 - cmp r0, 0 - bne _0817D5A0 - bl _0817E0A6 -_0817D5A0: - subs r2, r0, 0x1 - lsls r2, 24 - lsrs r2, 24 - adds r0, r1, 0 - adds r0, 0x32 - ldrb r3, [r0] - lsls r3, 26 - lsrs r3, 30 - movs r0, 0x8 - movs r1, 0x1 - bl sub_817E684 - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 2 - adds r1, r7, r1 - adds r1, 0x57 - ldrb r2, [r1] - movs r0, 0x1F - negs r0, r0 - ands r0, r2 - movs r2, 0x4 - b _0817D6F2 -_0817D5CE: - lsls r2, r5, 3 - lsls r0, r6, 4 - adds r2, r0 - adds r2, r7, r2 - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x1 - movs r0, 0x7 - ands r1, r0 - lsls r1, 6 - ldrh r3, [r2, 0x30] - ldr r0, =0xfffffe3f - ands r0, r3 - orrs r0, r1 - strh r0, [r2, 0x30] - adds r2, 0x32 - bl _0817DF0A - .pool -_0817D608: - ldr r0, [sp, 0x8] - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - bne _0817D61A - bl _0817E0A6 -_0817D61A: - mov r1, r8 - lsls r0, r1, 3 - lsls r1, r4, 4 - adds r0, r1 - adds r1, r7, r0 - ldrh r0, [r1, 0x30] - lsls r0, 23 - lsrs r0, 29 - cmp r0, 0 - bne _0817D632 - bl _0817E0A6 -_0817D632: - subs r2, r0, 0x1 - lsls r2, 24 - lsrs r2, 24 - adds r0, r1, 0 - adds r0, 0x32 - ldrb r3, [r0] - lsrs r3, 6 - movs r0, 0x8 - movs r1, 0x5 - bl sub_817E684 - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 2 - adds r1, r7, r1 - adds r1, 0x57 - ldrb r2, [r1] - movs r0, 0x1F - negs r0, r0 - ands r0, r2 - movs r2, 0xA - b _0817D6F2 -_0817D65E: - lsls r2, r5, 3 - lsls r0, r6, 4 - adds r2, r0 - adds r2, r7, r2 - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x1 - adds r4, r2, 0 - adds r4, 0x31 - movs r0, 0x7 - ands r1, r0 - lsls r1, 1 - ldrb r3, [r4] - movs r0, 0xF - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r4] - adds r2, 0x33 - bl _0817DF9E - .pool -_0817D698: - ldr r0, [sp, 0x8] - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - bne _0817D6AA - bl _0817E0A6 -_0817D6AA: - mov r1, r8 - lsls r0, r1, 3 - lsls r1, r4, 4 - adds r0, r1 - adds r1, r7, r0 - adds r0, r1, 0 - adds r0, 0x31 - ldrb r0, [r0] - lsls r0, 28 - lsrs r0, 29 - cmp r0, 0 - bne _0817D6C6 - bl _0817E0A6 -_0817D6C6: - subs r2, r0, 0x1 - lsls r2, 24 - lsrs r2, 24 - adds r0, r1, 0 - adds r0, 0x33 - ldrb r3, [r0] - lsls r3, 30 - lsrs r3, 30 - movs r0, 0x8 - movs r1, 0x6 - bl sub_817E684 - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 2 - adds r1, r7, r1 - adds r1, 0x57 - ldrb r2, [r1] - movs r0, 0x1F - negs r0, r0 - ands r0, r2 - movs r2, 0xC -_0817D6F2: - orrs r0, r2 - mov r2, r8 - lsls r3, r2, 5 - movs r2, 0x1F - ands r0, r2 - orrs r0, r3 - strb r0, [r1] - bl _0817E0A6 -_0817D704: - ldr r5, =0x0202406e - ldr r6, =0x0202420e - ldrb r0, [r6] - lsls r0, 1 - adds r0, r5 - ldrh r2, [r0] - lsls r2, 2 - mov r0, r9 - lsls r4, r0, 1 - add r4, r9 - lsls r4, 3 - adds r2, r4 - adds r2, r7, r2 - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r5 - ldrh r1, [r0] - adds r1, 0x1 - movs r0, 0x7 - ands r1, r0 - lsls r1, 6 - ldrh r3, [r2] - ldr r0, =0xfffffe3f - ands r0, r3 - orrs r0, r1 - strh r0, [r2] - ldrb r0, [r6] - lsls r0, 1 - adds r0, r5 - ldrh r1, [r0] - lsls r1, 2 - adds r1, r4 - adds r1, r7, r1 - mov r2, r10 - lsls r3, r2, 6 - ldrb r2, [r1, 0x2] - movs r0, 0x3F - ands r0, r2 - orrs r0, r3 - strb r0, [r1, 0x2] - bl _0817E0A6 - .pool -_0817D76C: - ldr r0, [sp, 0x8] - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - bne _0817D77E - bl _0817E0A6 -_0817D77E: - ldr r6, =0x0202406e - ldr r5, =0x0202420b - ldrb r0, [r5] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - lsls r0, 2 - lsls r1, r4, 1 - adds r4, r1, r4 - lsls r1, r4, 3 - adds r0, r1 - adds r1, r7, r0 - ldrh r0, [r1] - lsls r0, 23 - lsrs r0, 29 - cmp r0, 0 - beq _0817D7B2 - subs r2, r0, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r1, 0x2] - lsrs r3, 6 - movs r0, 0x8 - movs r1, 0x4 - bl sub_817E684 -_0817D7B2: - lsls r3, r4, 2 - adds r3, r7, r3 - adds r3, 0x57 - ldrb r0, [r3] - movs r1, 0x1F - negs r1, r1 - ands r1, r0 - movs r0, 0x8 - orrs r1, r0 - strb r1, [r3] - ldrb r0, [r5] - lsls r0, 1 - adds r0, r6 - b _0817D934 - .pool -_0817D7D8: - ldr r5, =0x0202406e - ldr r6, =0x0202420e - ldrb r0, [r6] - lsls r0, 1 - adds r0, r5 - ldrh r2, [r0] - lsls r2, 2 - mov r0, r9 - lsls r4, r0, 1 - add r4, r9 - lsls r4, 3 - adds r2, r4 - adds r2, r7, r2 - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r5 - ldrh r1, [r0] - adds r1, 0x1 - movs r0, 0x7 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x8 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldrb r0, [r6] - lsls r0, 1 - adds r0, r5 - ldrh r1, [r0] - lsls r1, 2 - adds r1, r4 - adds r1, r7, r1 - movs r0, 0x3 - mov r2, r10 - ands r2, r0 - lsls r2, 2 - ldrb r3, [r1, 0x2] - movs r0, 0xD - negs r0, r0 - b _0817D88C - .pool -_0817D838: - ldr r5, =0x0202406e - ldr r6, =0x0202420e - ldrb r0, [r6] - lsls r0, 1 - adds r0, r5 - ldrh r2, [r0] - lsls r2, 2 - mov r1, r9 - lsls r4, r1, 1 - add r4, r9 - lsls r4, 3 - adds r2, r4 - adds r2, r7, r2 - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r5 - ldrh r1, [r0] - adds r1, 0x1 - movs r0, 0x7 - ands r1, r0 - lsls r1, 3 - ldrb r3, [r2] - movs r0, 0x39 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldrb r0, [r6] - lsls r0, 1 - adds r0, r5 - ldrh r1, [r0] - lsls r1, 2 - adds r1, r4 - adds r1, r7, r1 - movs r0, 0x3 - mov r2, r10 - ands r2, r0 - lsls r2, 4 - ldrb r3, [r1, 0x2] - movs r0, 0x31 - negs r0, r0 -_0817D88C: - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x2] - bl _0817E0A6 - .pool -_0817D8A4: - ldr r0, [sp, 0x8] - movs r1, 0x39 - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - bne _0817D8B6 - bl _0817E0A6 -_0817D8B6: - ldr r2, =0x0202406e - mov r8, r2 - ldr r6, =0x0202420b - ldrb r0, [r6] - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - lsls r0, 2 - lsls r1, r4, 1 - adds r5, r1, r4 - lsls r4, r5, 3 - adds r0, r4 - adds r1, r7, r0 - ldrb r0, [r1] - lsls r0, 29 - lsrs r0, 29 - cmp r0, 0 - beq _0817D8EE - subs r2, r0, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r1, 0x2] - lsls r3, 28 - lsrs r3, 30 - movs r0, 0x8 - movs r1, 0x2 - bl sub_817E684 -_0817D8EE: - ldrb r0, [r6] - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r4 - adds r1, r7, r0 - ldrb r0, [r1] - lsls r0, 26 - lsrs r0, 29 - cmp r0, 0 - beq _0817D91A - subs r2, r0, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r1, 0x2] - lsls r3, 26 - lsrs r3, 30 - movs r0, 0x8 - movs r1, 0x3 - bl sub_817E684 -_0817D91A: - lsls r3, r5, 2 - adds r3, r7, r3 - adds r3, 0x57 - ldrb r0, [r3] - movs r1, 0x1F - negs r1, r1 - ands r1, r0 - movs r0, 0x6 - orrs r1, r0 - strb r1, [r3] - ldrb r0, [r6] - lsls r0, 1 - add r0, r8 -_0817D934: - ldrh r0, [r0] - lsls r0, 5 - movs r2, 0x1F - ands r1, r2 - orrs r1, r0 - strb r1, [r3] - b _0817E0A6 - .pool -_0817D94C: - lsls r2, r5, 3 - lsls r0, r6, 4 - adds r2, r0 - adds r2, r7, r2 - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x1 - adds r4, r2, 0 - adds r4, 0x31 - movs r0, 0x7 - ands r1, r0 - lsls r1, 4 - ldrb r3, [r4] - movs r0, 0x71 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r4] - adds r2, 0x33 - movs r0, 0x3 - mov r1, r10 - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2] - movs r0, 0xD - negs r0, r0 - b _0817DFAA - .pool -_0817D994: - mov r1, r8 - lsls r0, r1, 3 - lsls r1, r4, 4 - adds r0, r1 - adds r1, r7, r0 - adds r0, r1, 0 - adds r0, 0x31 - ldrb r0, [r0] - lsls r0, 25 - lsrs r0, 29 - cmp r0, 0 - bne _0817D9AE - b _0817E0A6 -_0817D9AE: - subs r2, r0, 0x1 - lsls r2, 24 - lsrs r2, 24 - adds r0, r1, 0 - adds r0, 0x33 - ldrb r3, [r0] - lsls r3, 28 - lsrs r3, 30 - movs r0, 0x9 - b _0817E086 -_0817D9C2: - ldr r5, =0x0202406e - ldr r6, =0x0202420e - ldrb r0, [r6] - lsls r0, 1 - adds r0, r5 - ldrh r2, [r0] - lsls r2, 2 - mov r0, r9 - lsls r4, r0, 1 - add r4, r9 - lsls r4, 3 - adds r2, r4 - adds r2, r7, r2 - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r5 - ldrh r1, [r0] - adds r1, 0x1 - movs r0, 0x7 - ands r1, r0 - lsls r1, 1 - ldrb r3, [r2, 0x1] - movs r0, 0xF - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x1] - ldrb r0, [r6] - lsls r0, 1 - adds r0, r5 - ldrh r1, [r0] - lsls r1, 2 - adds r1, r4 - adds r1, r7, r1 - movs r0, 0x3 - mov r2, r10 - ands r2, r0 - ldrb r3, [r1, 0x3] - movs r0, 0x4 - negs r0, r0 - b _0817DB76 - .pool -_0817DA24: - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r1, 2 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - adds r1, r0 - adds r1, r7, r1 - ldrb r0, [r1, 0x1] - lsls r0, 28 - lsrs r0, 29 - cmp r0, 0 - bne _0817DA48 - b _0817E0A6 -_0817DA48: - subs r2, r0, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r1, 0x3] - lsls r3, 30 - lsrs r3, 30 - movs r0, 0x9 - movs r1, 0x2 - bl sub_817E684 - b _0817E0A6 - .pool -_0817DA68: - ldr r5, =0x0202406e - ldr r6, =0x0202420e - ldrb r0, [r6] - lsls r0, 1 - adds r0, r5 - ldrh r2, [r0] - lsls r2, 2 - mov r1, r9 - lsls r4, r1, 1 - add r4, r9 - lsls r4, 3 - adds r2, r4 - adds r2, r7, r2 - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r5 - ldrh r1, [r0] - adds r1, 0x1 - movs r0, 0x7 - ands r1, r0 - lsls r1, 4 - ldrb r3, [r2, 0x1] - movs r0, 0x71 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x1] - ldrb r0, [r6] - lsls r0, 1 - adds r0, r5 - ldrh r1, [r0] - lsls r1, 2 - adds r1, r4 - adds r1, r7, r1 - movs r0, 0x3 - mov r2, r10 - ands r2, r0 - lsls r2, 2 - ldrb r3, [r1, 0x3] - movs r0, 0xD - negs r0, r0 - b _0817DB76 - .pool -_0817DACC: - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r1, 2 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - adds r1, r0 - adds r1, r7, r1 - ldrb r0, [r1, 0x1] - lsls r0, 25 - lsrs r2, r0, 29 - cmp r2, 0 - bne _0817DAF0 - b _0817E0A6 -_0817DAF0: - ldr r0, =0x0203aba8 - ldr r0, [r0] - ldrh r0, [r0] - cmp r0, 0xAD - bne _0817DAFC - b _0817E0A6 -_0817DAFC: - cmp r0, 0xD6 - bne _0817DB02 - b _0817E0A6 -_0817DB02: - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r1, 0x3] - lsls r3, 28 - lsrs r3, 30 - movs r0, 0x9 -_0817DB10: - movs r1, 0x3 - bl sub_817E684 - b _0817E0A6 - .pool -_0817DB24: - ldr r5, =0x0202406e - ldr r6, =0x0202420e - ldrb r0, [r6] - lsls r0, 1 - adds r0, r5 - ldrh r3, [r0] - lsls r3, 2 - mov r2, r9 - lsls r4, r2, 1 - add r4, r9 - lsls r4, 3 - adds r3, r4 - adds r3, r7, r3 - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - adds r0, 0x1 - movs r1, 0x7 - ands r0, r1 - lsls r0, 15 - ldr r1, [r3] - ldr r2, =0xfffc7fff - ands r1, r2 - orrs r1, r0 - str r1, [r3] - ldrb r0, [r6] - lsls r0, 1 - adds r0, r5 - ldrh r1, [r0] - lsls r1, 2 - adds r1, r4 - adds r1, r7, r1 - movs r0, 0x3 - mov r2, r10 - ands r2, r0 - lsls r2, 4 - ldrb r3, [r1, 0x3] - movs r0, 0x31 - negs r0, r0 -_0817DB76: - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x3] - b _0817E0A6 - .pool -_0817DB90: - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r1, 2 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - adds r1, r0 - adds r1, r7, r1 - ldr r0, [r1] - lsls r0, 14 - lsrs r0, 29 - cmp r0, 0 - bne _0817DBB4 - b _0817E0A6 -_0817DBB4: - subs r2, r0, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r1, 0x3] - lsls r3, 26 - lsrs r3, 30 - movs r0, 0x9 -_0817DBC2: - movs r1, 0x4 - bl sub_817E684 - b _0817E0A6 - .pool -_0817DBD4: - lsls r3, 3 - mov r1, r9 - lsls r0, r1, 4 - adds r3, r0 - adds r3, r7, r3 - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - adds r0, 0x1 - movs r1, 0x7 - ands r0, r1 - lsls r0, 15 - ldr r1, [r3, 0x30] - ldr r2, =0xfffc7fff - ands r1, r2 - orrs r1, r0 - str r1, [r3, 0x30] - adds r3, 0x33 - movs r0, 0x3 - mov r1, r10 - ands r1, r0 - lsls r1, 4 - ldrb r2, [r3] - movs r0, 0x31 - negs r0, r0 -_0817DC0C: - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - b _0817E0A6 - .pool -_0817DC20: - mov r2, r8 - lsls r0, r2, 3 - lsls r1, r4, 4 - adds r0, r1 - adds r3, r7, r0 - ldr r0, [r3, 0x30] - lsls r0, 14 - lsrs r0, 29 - cmp r0, 0 - beq _0817DC4C - subs r2, r0, 0x1 - lsls r2, 24 - lsrs r2, 24 - adds r0, r3, 0 - adds r0, 0x33 - ldrb r3, [r0] - lsls r3, 26 - lsrs r3, 30 - movs r0, 0x9 - movs r1, 0x1 - bl sub_817E684 -_0817DC4C: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r7, r0 - adds r0, 0x57 - ldrb r2, [r0] - movs r1, 0x1F - negs r1, r1 - ands r1, r2 - movs r2, 0x18 - b _0817E0A2 -_0817DC62: - lsls r2, r6, 1 - adds r2, r6 - lsls r2, 2 - adds r2, r7, r2 - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x1 - adds r4, r2, 0 - adds r4, 0x50 - movs r0, 0x7 - ands r1, r0 - ldrb r3, [r4] - movs r0, 0x8 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r4] - adds r2, 0x54 - b _0817DF9E - .pool -_0817DC98: - ldr r1, [sp, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r4, r7, r0 - adds r0, r4, 0 - adds r0, 0x50 - ldrb r0, [r0] - lsls r0, 29 - lsrs r2, r0, 29 - cmp r2, 0 - bne _0817DCB2 - b _0817E0A6 -_0817DCB2: - movs r0, 0x1 - eors r1, r0 - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r0, 0x54 - ldrb r3, [r0] - lsls r3, 30 - lsrs r3, 30 - movs r0, 0xA - bl sub_817E684 - adds r2, r4, 0 - adds r2, 0x57 - ldrb r1, [r2] - movs r0, 0x1F - negs r0, r0 - ands r0, r1 - movs r1, 0xE - b _0817DFAC -_0817DCDC: - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 2 - adds r1, r7, r1 - adds r3, r1, 0 - adds r3, 0x50 - ldrb r2, [r3] - movs r0, 0x8 - negs r0, r0 - ands r0, r2 - strb r0, [r3] - adds r1, 0x54 - ldrb r2, [r1] - movs r0, 0x4 - negs r0, r0 - b _0817DF6A -_0817DCFC: - mov r0, r8 - lsls r2, r0, 3 - lsls r0, r4, 4 - adds r2, r0 - adds r2, r7, r2 - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x1 - adds r4, r2, 0 - adds r4, 0x34 - movs r0, 0x7 - ands r1, r0 - ldrb r3, [r4] - movs r0, 0x8 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r4] - adds r2, 0x33 - mov r1, r10 - lsls r3, r1, 6 - b _0817DF0E - .pool -_0817DD38: - mov r0, r8 - lsls r2, r0, 3 - lsls r0, r4, 4 - adds r2, r0 - adds r2, r7, r2 - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x1 - adds r2, 0x34 - movs r0, 0x7 - ands r1, r0 - lsls r1, 3 - ldrb r3, [r2] - movs r0, 0x39 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - mov r1, r10 - lsls r3, r1, 6 - movs r1, 0x3F - b _0817DF12 - .pool -_0817DD74: - movs r0, 0 - bl sub_817EA80 -_0817DD7A: - mov r2, r8 - lsls r0, r2, 3 - b _0817DD88 -_0817DD80: - movs r0, 0x1 - bl sub_817EA80 - lsls r0, r5, 3 -_0817DD88: - lsls r1, r4, 4 - adds r0, r1 - adds r1, r7, r0 - adds r4, r1, 0 - adds r4, 0x34 - ldrb r5, [r4] - lsls r0, r5, 29 - cmp r0, 0 - beq _0817DDAE - movs r0, 0x8 - negs r0, r0 - ands r0, r5 - strb r0, [r4] - adds r2, r1, 0 - adds r2, 0x33 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - strb r0, [r2] -_0817DDAE: - ldrb r1, [r4] - lsls r0, r1, 26 - lsrs r0, 29 - cmp r0, 0 - bne _0817DDBA - b _0817E0A6 -_0817DDBA: - movs r0, 0x39 - negs r0, r0 - ands r0, r1 - movs r1, 0x3F - ands r0, r1 - strb r0, [r4] - b _0817E0A6 -_0817DDC8: - lsls r2, r4, 1 - adds r2, r4 - lsls r2, 2 - adds r2, r7, r2 - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x1 - adds r4, r2, 0 - adds r4, 0x50 - movs r0, 0x7 - ands r1, r0 - lsls r1, 3 - ldrb r3, [r4] - movs r0, 0x39 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r4] - adds r2, 0x54 - movs r0, 0x3 - mov r1, r10 - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2] - movs r0, 0xD - negs r0, r0 - b _0817DFAA - .pool -_0817DE10: - lsls r2, r4, 1 - adds r2, r4 - lsls r2, 2 - adds r2, r7, r2 - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x1 - adds r4, r2, 0 - adds r4, 0x50 - movs r0, 0x7 - ands r1, r0 - lsls r1, 6 - ldrh r3, [r4] - ldr r0, =0xfffffe3f - ands r0, r3 - orrs r0, r1 - strh r0, [r4] - adds r2, 0x54 - movs r0, 0x3 - mov r1, r10 - ands r1, r0 - lsls r1, 4 - ldrb r3, [r2] - movs r0, 0x31 - negs r0, r0 - b _0817DFAA - .pool -_0817DE58: - ldr r1, =0x02022f5a - ldrh r0, [r1] - cmp r0, 0x73 - bne _0817DE82 - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 2 - adds r1, r7, r1 - adds r3, r1, 0 - adds r3, 0x50 - ldrb r2, [r3] - movs r0, 0x39 - negs r0, r0 - ands r0, r2 - strb r0, [r3] - adds r1, 0x54 - ldrb r2, [r1] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1] -_0817DE82: - ldr r2, =0x02022f5a - ldrh r0, [r2] - cmp r0, 0x71 - bne _0817DEAA - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 2 - adds r1, r7, r1 - adds r3, r1, 0 - adds r3, 0x50 - ldrh r2, [r3] - ldr r0, =0xfffffe3f - ands r0, r2 - strh r0, [r3] - adds r1, 0x54 - ldrb r2, [r1] - movs r0, 0x31 - negs r0, r0 - ands r0, r2 - strb r0, [r1] -_0817DEAA: - ldr r1, =0x02022f5a - ldrh r0, [r1] - cmp r0, 0x36 - beq _0817DEB4 - b _0817E0A6 -_0817DEB4: - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 2 - adds r1, r7, r1 - adds r4, r1, 0 - adds r4, 0x51 - ldrb r2, [r4] - movs r0, 0x71 - negs r0, r0 - ands r0, r2 - strb r0, [r4] - adds r1, 0x55 - ldrb r2, [r1] - movs r0, 0x4 - negs r0, r0 - b _0817DF6A - .pool -_0817DEDC: - lsls r2, r4, 1 - adds r2, r4 - lsls r2, 2 - adds r2, r7, r2 - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x1 - adds r4, r2, 0 - adds r4, 0x51 - movs r0, 0x7 - ands r1, r0 - lsls r1, 1 - ldrb r3, [r4] - movs r0, 0xF - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r4] - adds r2, 0x54 -_0817DF0A: - mov r0, r10 - lsls r3, r0, 6 -_0817DF0E: - ldrb r1, [r2] - movs r0, 0x3F -_0817DF12: - ands r0, r1 - orrs r0, r3 - strb r0, [r2] - b _0817E0A6 - .pool -_0817DF24: - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 2 - adds r1, r7, r0 - adds r0, r1, 0 - adds r0, 0x51 - ldrb r0, [r0] - lsls r0, 28 - lsrs r0, 29 - cmp r0, 0 - bne _0817DF3C - b _0817E0A6 -_0817DF3C: - subs r2, r0, 0x1 - lsls r2, 24 - lsrs r2, 24 - adds r0, r1, 0 - adds r0, 0x54 - ldrb r3, [r0] - lsrs r3, 6 - movs r0, 0xF - b _0817E086 -_0817DF4E: - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 2 - adds r1, r7, r1 - adds r4, r1, 0 - adds r4, 0x51 - ldrb r2, [r4] - movs r0, 0xF - negs r0, r0 - ands r0, r2 - strb r0, [r4] - adds r1, 0x54 - ldrb r2, [r1] - movs r0, 0x3F -_0817DF6A: - ands r0, r2 - strb r0, [r1] - b _0817E0A6 -_0817DF70: - lsls r2, r4, 1 - adds r2, r4 - lsls r2, 2 - adds r2, r7, r2 - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x1 - adds r4, r2, 0 - adds r4, 0x51 - movs r0, 0x7 - ands r1, r0 - lsls r1, 4 - ldrb r3, [r4] - movs r0, 0x71 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r4] - adds r2, 0x55 -_0817DF9E: - movs r0, 0x3 - mov r1, r10 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x4 - negs r0, r0 -_0817DFAA: - ands r0, r3 -_0817DFAC: - orrs r0, r1 - strb r0, [r2] - b _0817E0A6 - .pool -_0817DFBC: - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 2 - adds r1, r7, r0 - adds r0, r1, 0 - adds r0, 0x51 - ldrb r0, [r0] - lsls r0, 25 - lsrs r0, 29 - cmp r0, 0 - beq _0817E0A6 - subs r2, r0, 0x1 - lsls r2, 24 - lsrs r2, 24 - adds r0, r1, 0 - adds r0, 0x55 - ldrb r3, [r0] - lsls r3, 30 - lsrs r3, 30 - movs r0, 0x10 - b _0817E086 -_0817DFE6: - lsls r1, r6, 1 - adds r1, r6 - lsls r1, 2 - adds r1, r7, r1 - adds r3, r1, 0 - adds r3, 0x50 - ldrb r2, [r3] - movs r0, 0x39 - negs r0, r0 - ands r0, r2 - strb r0, [r3] - adds r1, 0x54 - ldrb r2, [r1] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldrh r2, [r3] - ldr r0, =0xfffffe3f - ands r0, r2 - strh r0, [r3] - ldrb r2, [r1] - movs r0, 0x31 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrb r2, [r0] - movs r0, 0x11 - movs r1, 0 - mov r3, r10 - bl sub_817E684 - b _0817E0A6 - .pool -_0817E040: - lsls r0, r4, 4 - adds r4, r7, r0 - adds r0, r4, 0 - adds r0, 0x35 - ldrb r0, [r0] - lsrs r0, 5 - cmp r0, 0 - beq _0817E068 - subs r2, r0, 0x1 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r0, 0x36 - ldrb r3, [r0] - lsls r3, 30 - lsrs r3, 30 - movs r0, 0x15 - movs r1, 0 - bl sub_817E684 -_0817E068: - adds r0, r4, 0 - adds r0, 0x3D - ldrb r0, [r0] - lsrs r0, 5 - cmp r0, 0 - beq _0817E0A6 - subs r2, r0, 0x1 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r0, 0x3E - ldrb r3, [r0] - lsls r3, 30 - lsrs r3, 30 - movs r0, 0x15 -_0817E086: - movs r1, 0 - bl sub_817E684 - b _0817E0A6 -_0817E08E: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r7, r0 - adds r0, 0x57 - ldrb r2, [r0] - movs r1, 0x1F - negs r1, r1 - ands r1, r2 - movs r2, 0x1C -_0817E0A2: - orrs r1, r2 -_0817E0A4: - strb r1, [r0] -_0817E0A6: - 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_817C95C - - thumb_func_start sub_817E0B8 -sub_817E0B8: @ 817E0B8 - push {r4-r6,lr} - lsls r0, 16 - lsrs r5, r0, 16 - movs r3, 0 - ldr r4, =gUnknown_0860A8A4 - ldr r6, =0x0000ffff - adds r2, r4, 0 - adds r1, r4, 0 -_0817E0C8: - ldrh r0, [r1] - cmp r0, r5 - beq _0817E0DA - adds r2, 0x2 - adds r1, 0x2 - adds r3, 0x1 - ldrh r0, [r2] - cmp r0, r6 - bne _0817E0C8 -_0817E0DA: - lsls r0, r3, 1 - adds r0, r4 - ldrh r1, [r0] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _0817E0F4 - movs r0, 0 - b _0817E0F6 - .pool -_0817E0F4: - movs r0, 0x1 -_0817E0F6: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_817E0B8 - - thumb_func_start sub_817E0FC -sub_817E0FC: @ 817E0FC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - str r2, [sp, 0x4] - lsls r0, 16 - lsrs r7, r0, 16 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0817E122 - b _0817E310 -_0817E122: - ldr r0, =0x0202449c - ldr r0, [r0] - movs r1, 0x81 - lsls r1, 2 - adds r1, r0, r1 - str r1, [sp, 0x8] - ldr r2, =0x0202420b - mov r10, r2 - ldrb r0, [r2] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r0, =0x0202420c - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r4, r0, 24 - mov r1, r10 - ldrb r0, [r1] - adds r1, r7, 0 - bl sub_817F33C - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x3 - bls _0817E184 - mov r2, r9 - lsls r0, r2, 1 - add r0, r9 - lsls r0, 2 - ldr r1, [sp, 0x8] - adds r0, r1, r0 - adds r0, 0x57 - ldrb r1, [r0] - movs r2, 0x1E - orrs r1, r2 - strb r1, [r0] - b _0817E310 - .pool -_0817E184: - mov r2, r10 - ldrb r0, [r2] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 25 - lsls r0, 3 - lsls r4, 4 - adds r0, r4 - ldr r1, [sp, 0x8] - adds r0, r1, r0 - mov r2, r10 - ldrb r1, [r2] - lsls r1, 1 - ldr r2, =0x0202406e - adds r1, r2 - ldrh r2, [r1] - adds r2, 0x1 - adds r0, 0x35 - lsls r2, 5 - ldrb r3, [r0] - movs r1, 0x1F - ands r1, r3 - orrs r1, r2 - strb r1, [r0] - mov r1, r10 - ldrb r0, [r1] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 25 - lsls r0, 3 - adds r0, r4 - ldr r2, [sp, 0x8] - adds r0, r2, r0 - adds r0, 0x36 - movs r1, 0x3 - mov r8, r6 - mov r2, r8 - ands r2, r1 - mov r8, r2 - ldrb r2, [r0] - movs r1, 0x4 - negs r1, r1 - ands r1, r2 - mov r2, r8 - orrs r1, r2 - strb r1, [r0] - mov r1, r9 - lsls r0, r1, 1 - add r0, r9 - lsls r0, 2 - ldr r2, [sp, 0x8] - adds r0, r2, r0 - str r0, [sp, 0xC] - adds r5, r0, 0 - adds r5, 0x53 - lsls r2, r6, 6 - ldrb r1, [r5] - movs r0, 0x3F - ands r0, r1 - orrs r0, r2 - strb r0, [r5] - ldr r1, =gBattleMoves - lsls r4, r7, 1 - adds r0, r4, r7 - lsls r0, 2 - adds r0, r1 - ldrb r2, [r0] - movs r0, 0 - adds r1, r6, 0 - movs r3, 0 - bl sub_817E684 - ldr r0, [sp] - adds r1, r7, 0 - adds r2, r6, 0 - bl sub_817F394 - ldr r0, [sp, 0x4] - ldrb r1, [r0, 0x12] - movs r0, 0xF - ands r0, r1 - str r4, [sp, 0x10] - cmp r0, 0 - beq _0817E23C - movs r0, 0x7 - adds r1, r7, 0 - adds r2, r6, 0 - movs r3, 0 - bl sub_817E684 -_0817E23C: - ldr r0, =0x00000111 - cmp r7, r0 - bne _0817E272 - mov r1, r10 - ldrb r0, [r1] - lsls r0, 1 - ldr r2, =0x0202406e - adds r0, r2 - ldrh r1, [r0] - adds r1, 0x1 - movs r0, 0x7 - ands r1, r0 - ldrb r2, [r5] - movs r0, 0x8 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5] - ldr r2, [sp, 0xC] - adds r2, 0x56 - ldrb r1, [r2] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - mov r1, r8 - orrs r0, r1 - strb r0, [r2] -_0817E272: - cmp r7, 0x78 - beq _0817E27A - cmp r7, 0x99 - bne _0817E2D2 -_0817E27A: - movs r0, 0x1 - mov r2, r9 - eors r0, r2 - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - ldr r0, [sp, 0x8] - adds r2, r0, r2 - mov r1, r10 - ldrb r0, [r1] - lsls r0, 1 - ldr r1, =0x0202406e - adds r0, r1 - ldrh r1, [r0] - adds r1, 0x1 - adds r4, r2, 0 - adds r4, 0x58 - movs r0, 0x7 - ands r1, r0 - lsls r1, 3 - ldrb r3, [r4] - movs r0, 0x39 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - mov r1, r8 - lsls r3, r1, 1 - movs r1, 0x7 - negs r1, r1 - ands r0, r1 - orrs r0, r3 - strb r0, [r4] - adds r2, 0x57 - ldrb r1, [r2] - movs r0, 0x1F - negs r0, r0 - ands r0, r1 - movs r1, 0x1A - orrs r0, r1 - strb r0, [r2] - ldrb r0, [r4] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r4] -_0817E2D2: - ldr r1, =gBattleMoves - ldr r2, [sp, 0x10] - adds r0, r2, r7 - lsls r0, 2 - adds r0, r1 - ldrb r4, [r0, 0x2] - ldrb r5, [r0, 0x1] - movs r0, 0xD - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0 - bl sub_817E684 - movs r0, 0xE - adds r1, r4, 0 - adds r2, r5, 0 - movs r3, 0 - bl sub_817E684 - movs r0, 0xB - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl sub_817E684 - movs r0, 0xC - adds r1, r4, 0 - movs r2, 0 - movs r3, 0 - bl sub_817E684 -_0817E310: - 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_817E0FC - - thumb_func_start sub_817E32C -sub_817E32C: @ 817E32C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0817E3EE - ldr r0, =0x0202449c - ldr r0, [r0] - movs r1, 0x81 - lsls r1, 2 - adds r4, r0, r1 - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r2, r0, 24 - cmp r5, 0x12 - beq _0817E36C - cmp r5, 0x13 - beq _0817E3AA - b _0817E3EE - .pool -_0817E36C: - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r4, r0 - ldr r0, [r4, 0x50] - lsls r0, 14 - lsrs r0, 29 - cmp r0, 0 - beq _0817E3EE - subs r0, 0x1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x55 - ldrb r3, [r1] - lsls r3, 28 - lsrs r3, 30 - adds r3, r0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x2 - movs r1, 0 - bl sub_817E684 - adds r2, r4, 0 - adds r2, 0x57 - ldrb r1, [r2] - movs r0, 0x1F - negs r0, r0 - ands r0, r1 - movs r1, 0x10 - b _0817E3EA -_0817E3AA: - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r4, r0 - adds r0, r4, 0 - adds r0, 0x52 - ldrb r0, [r0] - lsls r0, 27 - lsrs r0, 29 - cmp r0, 0 - beq _0817E3EE - subs r0, 0x1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x55 - ldrb r3, [r1] - lsls r3, 26 - lsrs r3, 30 - adds r3, r0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x2 - movs r1, 0x1 - bl sub_817E684 - adds r2, r4, 0 - adds r2, 0x57 - ldrb r1, [r2] - movs r0, 0x1F - negs r0, r0 - ands r0, r1 - movs r1, 0x12 -_0817E3EA: - orrs r0, r1 - strb r0, [r2] -_0817E3EE: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_817E32C - - thumb_func_start sub_817E3F4 -sub_817E3F4: @ 817E3F4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - movs r0, 0 - str r0, [sp] - movs r1, 0 - str r1, [sp, 0x4] - movs r2, 0 - str r2, [sp, 0x8] - ldr r3, =0x00007fff - str r3, [sp, 0xC] - movs r4, 0 - str r4, [sp, 0x10] - movs r7, 0 - str r7, [sp, 0x14] - mov r8, r0 - ldr r0, =0x0202449c - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xB3 - ldrb r0, [r0] - cmp r0, 0 - beq _0817E42A - b _0817E670 -_0817E42A: - movs r2, 0xD2 - lsls r2, 1 - adds r2, r1 - mov r10, r2 - movs r6, 0 -_0817E434: - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r0, r4, r0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - beq _0817E454 - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 -_0817E454: - ldr r5, =0x02024744 - adds r0, r4, r5 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - beq _0817E46A - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 -_0817E46A: - adds r6, 0x1 - cmp r6, 0x5 - ble _0817E434 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0817E47E - b _0817E670 -_0817E47E: - cmp r8, r7 - beq _0817E484 - b _0817E670 -_0817E484: - movs r6, 0 - lsls r3, r6, 1 - str r3, [sp, 0x18] - movs r4, 0x64 - mov r8, r4 -_0817E48E: - mov r1, r8 - muls r1, r6 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r7, r0, 16 - adds r0, r6, 0x1 - mov r9, r0 - cmp r7, 0 - beq _0817E4EE - adds r0, r4, 0 - movs r1, 0x2D - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - bne _0817E4EE - movs r4, 0 - lsls r0, r6, 3 - mov r2, r10 - adds r1, r0, r2 - movs r3, 0x3 -_0817E4C4: - lsls r0, r4, 16 - asrs r0, 16 - ldrh r4, [r1] - adds r0, r4 - lsls r0, 16 - lsrs r4, r0, 16 - adds r1, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _0817E4C4 - ldr r1, [sp, 0x8] - lsls r0, r1, 16 - lsls r1, r4, 16 - cmp r0, r1 - bge _0817E4EE - lsls r0, r6, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - lsrs r1, 16 - str r1, [sp, 0x8] - str r7, [sp] -_0817E4EE: - mov r0, r8 - muls r0, r6 - ldr r2, =0x02024744 - adds r4, r0, r2 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r7, r0, 16 - ldr r3, [sp, 0x8] - lsls r3, 16 - str r3, [sp, 0x1C] - cmp r7, 0 - beq _0817E5A0 - adds r0, r4, 0 - movs r1, 0x2D - movs r2, 0 - bl pokemon_getattr - cmp r0, 0 - bne _0817E5A0 - movs r4, 0 - ldr r0, [sp, 0xC] - lsls r2, r0, 16 - movs r3, 0x1 - lsls r1, r3, 1 - adds r1, 0x1 - lsls r1, 4 - lsls r0, r6, 3 - adds r0, r1 - mov r3, r10 - adds r1, r0, r3 - movs r3, 0x3 -_0817E534: - lsls r0, r4, 16 - asrs r0, 16 - ldrh r4, [r1] - adds r0, r4 - lsls r0, 16 - lsrs r4, r0, 16 - adds r1, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _0817E534 - asrs r1, r2, 16 - lsls r5, r4, 16 - asrs r0, r5, 16 - cmp r1, r0 - bne _0817E590 - mov r0, r8 - muls r0, r6 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x19 - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - ldr r2, [sp, 0x14] - mov r0, r8 - muls r0, r2 - ldr r3, =0x02024744 - adds r0, r3 - movs r1, 0x19 - movs r2, 0 - bl pokemon_getattr - cmp r4, r0 - bls _0817E5A0 - b _0817E594 - .pool -_0817E590: - cmp r1, r0 - ble _0817E5A0 -_0817E594: - lsls r0, r6, 24 - lsrs r0, 24 - str r0, [sp, 0x14] - lsrs r5, 16 - str r5, [sp, 0xC] - str r7, [sp, 0x4] -_0817E5A0: - mov r6, r9 - cmp r6, 0x5 - bgt _0817E5A8 - b _0817E48E -_0817E5A8: - movs r4, 0 - movs r6, 0 - movs r3, 0 - ldr r5, =0x020244ec - ldr r7, [sp, 0x10] - lsls r0, r7, 3 - mov r1, r10 - adds r2, r0, r1 -_0817E5B8: - lsls r0, r4, 16 - asrs r0, 16 - movs r7, 0 - ldrsh r1, [r2, r7] - cmp r0, r1 - bge _0817E5C8 - ldrh r4, [r2] - adds r6, r3, 0 -_0817E5C8: - adds r2, 0x2 - adds r3, 0x1 - cmp r3, 0x3 - ble _0817E5B8 - movs r0, 0x64 - ldr r1, [sp, 0x10] - muls r0, r1 - adds r0, r5 - adds r1, r6, 0 - adds r1, 0xD - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - ldr r2, [sp, 0x1C] - cmp r2, 0 - beq _0817E670 - cmp r4, 0 - beq _0817E670 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0817E65C - ldr r3, [sp, 0x10] - cmp r3, 0x2 - bhi _0817E620 - ldr r0, =0x02024474 - adds r0, 0x25 - ldrb r0, [r0] - bl sub_806D82C - lsls r0, 16 - cmp r0, 0 - beq _0817E630 - b _0817E670 - .pool -_0817E620: - ldr r0, =0x02024474 - adds r0, 0x25 - ldrb r0, [r0] - bl sub_806D82C - lsls r0, 16 - cmp r0, 0 - beq _0817E670 -_0817E630: - movs r3, 0 - ldr r7, [sp, 0x14] - cmp r7, 0x2 - bls _0817E63A - movs r3, 0x1 -_0817E63A: - lsls r0, r3, 24 - lsrs r0, 24 - ldr r1, =0x02024474 - adds r1, 0x25 - ldrb r1, [r1] - bl sub_806EF84 - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - ldr r2, [sp] - ldr r3, [sp, 0x4] - bl sub_80ECB00 - b _0817E670 - .pool -_0817E65C: - ldr r0, =0x02024474 - adds r0, 0x25 - ldrb r1, [r0] - movs r0, 0x1 - eors r0, r1 - adds r1, r4, 0 - ldr r2, [sp] - ldr r3, [sp, 0x4] - bl sub_80ECB00 -_0817E670: - 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_817E3F4 - - thumb_func_start sub_817E684 -sub_817E684: @ 817E684 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r1, 16 - lsrs r6, r1, 16 - lsls r2, 24 - lsrs r5, r2, 24 - lsls r3, 24 - lsrs r3, 24 - mov r9, r3 - ldr r0, =0x0202449c - ldr r0, [r0] - movs r1, 0xD2 - lsls r1, 1 - adds r1, r0 - mov r8, r1 - movs r2, 0x81 - lsls r2, 2 - adds r7, r0, r2 - ldr r0, =0x0202420b - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0202420c - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r3, r0, 24 - mov r0, r10 - cmp r0, 0x1B - bls _0817E6D4 - b _0817EA6C -_0817E6D4: - lsls r0, 2 - ldr r1, =_0817E6F0 - adds r1, r0, r1 - ldr r1, [r1] - mov r12, r0 - mov pc, r1 - .pool - .align 2, 0 -_0817E6F0: - .4byte _0817E760 - .4byte _0817E760 - .4byte _0817E85C - .4byte _0817E79C - .4byte _0817E79C - .4byte _0817E79C - .4byte _0817E79C - .4byte _0817E79C - .4byte _0817E8A0 - .4byte _0817E8A0 - .4byte _0817E8CC - .4byte _0817E8F0 - .4byte _0817E978 - .4byte _0817E9E0 - .4byte _0817EA28 - .4byte _0817E8A0 - .4byte _0817E8A0 - .4byte _0817E880 - .4byte _0817E760 - .4byte _0817E80A - .4byte _0817E848 - .4byte _0817E8A0 - .4byte _0817E760 - .4byte _0817E760 - .4byte _0817E760 - .4byte _0817E760 - .4byte _0817E760 - .4byte _0817E760 -_0817E760: - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r1, 2 - adds r1, r6 - lsls r1, 1 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 4 - adds r1, r0 - add r1, r8 - ldr r0, =gUnknown_0860A834 - add r0, r12 - ldr r2, [r0] - lsls r0, r5, 1 - adds r0, r2 - ldrh r0, [r0] - ldrh r2, [r1] - adds r0, r2 - b _0817EA6A - .pool -_0817E79C: - ldr r1, =gUnknown_0860A834 - add r1, r12 - ldr r7, =0x0202406e - lsls r0, r4, 1 - adds r0, r4 - lsls r2, r0, 4 - ldr r4, =0x0000ffff - ldr r1, [r1] - ldr r3, =0x0202420b - ldrh r0, [r1] - cmp r6, r0 - bne _0817E7E0 - ldrb r0, [r3] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r5 - lsls r0, 1 - adds r0, r2 - add r0, r8 - ldrh r1, [r1, 0x2] - ldrh r2, [r0] - adds r1, r2 - strh r1, [r0] - b _0817EA6C - .pool -_0817E7E0: - adds r1, 0x4 - ldrh r0, [r1] - cmp r0, r4 - bne _0817E7EA - b _0817EA6C -_0817E7EA: - cmp r6, r0 - bne _0817E7E0 - ldrb r0, [r3] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r5 - lsls r0, 1 - adds r0, r2 - add r0, r8 - ldrh r1, [r1, 0x2] - ldrh r5, [r0] - adds r1, r5 - strh r1, [r0] - b _0817EA6C -_0817E80A: - movs r0, 0x1 - adds r1, r5, 0 - eors r1, r0 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r7, r0 - adds r0, 0x57 - ldrb r2, [r0] - movs r1, 0x1F - negs r1, r1 - ands r1, r2 - strb r1, [r0] - mov r0, r9 - lsls r1, r0, 1 - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 4 - adds r1, r0 - add r1, r8 - ldr r0, =gUnknown_0860A834 - add r0, r12 - ldr r2, [r0] - lsls r0, r6, 1 - adds r0, r2 - ldrh r0, [r0] - ldrh r2, [r1] - adds r0, r2 - b _0817EA6A - .pool -_0817E848: - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r7, r0 - adds r0, 0x57 - ldrb r2, [r0] - movs r1, 0x1F - negs r1, r1 - ands r1, r2 - strb r1, [r0] -_0817E85C: - mov r0, r9 - lsls r1, r0, 1 - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 4 - adds r1, r0 - add r1, r8 - ldr r0, =gUnknown_0860A834 - add r0, r12 - ldr r2, [r0] - lsls r0, r6, 1 - adds r0, r2 - ldrh r0, [r0] - ldrh r2, [r1] - adds r0, r2 - b _0817EA6A - .pool -_0817E880: - lsls r1, r5, 2 - add r1, r9 - lsls r1, 1 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 4 - adds r1, r0 - add r1, r8 - ldr r0, =gUnknown_0860A834 - add r0, r12 - ldr r2, [r0] - lsls r0, r6, 1 - adds r0, r2 - b _0817EA64 - .pool -_0817E8A0: - lsls r2, r5, 2 - add r2, r9 - lsls r2, 1 - movs r1, 0x1 - eors r1, r4 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 4 - adds r2, r0 - add r2, r8 - ldr r0, =gUnknown_0860A834 - add r0, r12 - ldr r1, [r0] - lsls r0, r6, 1 - adds r0, r1 - ldrh r0, [r0] - ldrh r1, [r2] - adds r0, r1 - strh r0, [r2] - b _0817EA6C - .pool -_0817E8CC: - lsls r1, r5, 2 - add r1, r9 - lsls r1, 1 - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 4 - adds r1, r0 - add r1, r8 - ldr r0, =gUnknown_0860A834 - add r0, r12 - ldr r0, [r0] - ldrh r0, [r0] - ldrh r2, [r1] - adds r0, r2 - b _0817EA6A - .pool -_0817E8F0: - lsls r0, r3, 4 - adds r2, r7, r0 - adds r0, r2, 0 - adds r0, 0x34 - ldrb r0, [r0] - lsls r0, 29 - lsrs r1, r0, 29 - adds r4, r2, 0 - adds r4, 0x3C - ldrb r0, [r4] - lsls r0, 29 - lsrs r0, 29 - cmn r1, r0 - bne _0817E90E - b _0817EA6C -_0817E90E: - cmp r6, 0xA - beq _0817E914 - b _0817EA6C -_0817E914: - cmp r1, 0 - beq _0817E940 - subs r1, 0x1 - lsls r1, 2 - adds r0, r2, 0 - adds r0, 0x33 - ldrb r0, [r0] - lsrs r0, 6 - adds r1, r0 - lsls r1, 1 - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 4 - adds r1, r0 - add r1, r8 - ldr r0, =gUnknown_0860A834 - add r0, r12 - ldr r0, [r0] - ldrh r0, [r0] - ldrh r5, [r1] - adds r0, r5 - strh r0, [r1] -_0817E940: - ldrb r0, [r4] - lsls r0, 29 - lsrs r0, 29 - cmp r0, 0 - bne _0817E94C - b _0817EA6C -_0817E94C: - subs r1, r0, 0x1 - lsls r1, 2 - adds r0, r2, 0 - adds r0, 0x3B - ldrb r0, [r0] - lsrs r0, 6 - adds r1, r0 - lsls r1, 1 - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 4 - adds r1, r0 - add r1, r8 - ldr r0, =gUnknown_0860A834 - add r0, r12 - ldr r0, [r0] - ldrh r0, [r0] - ldrh r2, [r1] - adds r0, r2 - b _0817EA6A - .pool -_0817E978: - lsls r1, r3, 4 - adds r1, r7, r1 - adds r0, r1, 0 - adds r0, 0x34 - ldrb r4, [r0] - lsls r0, r4, 26 - lsrs r2, r0, 29 - adds r5, r1, 0 - adds r5, 0x3C - ldrb r0, [r5] - lsls r0, 26 - lsrs r0, 29 - cmn r2, r0 - beq _0817EA6C - cmp r6, 0xD - bne _0817EA6C - cmp r2, 0 - beq _0817E9BE - subs r1, r2, 0x1 - lsls r1, 2 - lsrs r0, r4, 6 - adds r1, r0 - lsls r1, 1 - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 4 - adds r1, r0 - add r1, r8 - ldr r0, =gUnknown_0860A834 - add r0, r12 - ldr r0, [r0] - ldrh r0, [r0] - ldrh r2, [r1] - adds r0, r2 - strh r0, [r1] -_0817E9BE: - ldrb r2, [r5] - lsls r0, r2, 26 - lsrs r0, 29 - cmp r0, 0 - beq _0817EA6C - subs r1, r0, 0x1 - lsls r1, 2 - lsrs r0, r2, 6 - adds r1, r0 - lsls r1, 1 - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 4 - b _0817EA5A - .pool -_0817E9E0: - cmp r6, 0x8 - bhi _0817EA6C - cmp r5, 0 - beq _0817EA6C - lsls r0, r3, 1 - adds r3, r0, r3 - lsls r0, r3, 2 - adds r2, r7, r0 - adds r0, r2, 0 - adds r0, 0x50 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 29 - cmp r0, 0 - beq _0817EA6C - subs r1, r0, 0x1 - lsls r1, 2 - adds r0, r2, 0 - adds r0, 0x54 - ldrb r0, [r0] - lsls r0, 28 - lsrs r0, 30 - adds r1, r0 - lsls r1, 1 - lsls r0, r3, 4 - adds r1, r0 - add r1, r8 - ldr r0, =gUnknown_0860A834 - add r0, r12 - ldr r0, [r0] - ldrh r0, [r0] - ldrh r2, [r1] - adds r0, r2 - b _0817EA6A - .pool -_0817EA28: - cmp r6, 0x8 - bls _0817EA6C - cmp r5, 0 - beq _0817EA6C - lsls r0, r3, 1 - adds r3, r0, r3 - lsls r0, r3, 2 - adds r2, r7, r0 - adds r0, r2, 0 - adds r0, 0x50 - ldrh r0, [r0] - lsls r0, 23 - lsrs r0, 29 - cmp r0, 0 - beq _0817EA6C - subs r1, r0, 0x1 - lsls r1, 2 - adds r0, r2, 0 - adds r0, 0x54 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 30 - adds r1, r0 - lsls r1, 1 - lsls r0, r3, 4 -_0817EA5A: - adds r1, r0 - add r1, r8 - ldr r0, =gUnknown_0860A834 - add r0, r12 - ldr r0, [r0] -_0817EA64: - ldrh r0, [r0] - ldrh r5, [r1] - adds r0, r5 -_0817EA6A: - strh r0, [r1] -_0817EA6C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817E684 - - thumb_func_start sub_817EA80 -sub_817EA80: @ 817EA80 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =0x0202449c - ldr r0, [r0] - movs r1, 0x81 - lsls r1, 2 - adds r5, r0, r1 - ldr r3, =0x0202420b - mov r8, r3 - ldrb r0, [r3] - bl battle_side_get_owner - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0x0202420c - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r6, r5, r0 - adds r0, r6, 0 - adds r0, 0x57 - ldrb r0, [r0] - lsrs r3, r0, 5 - lsls r0, 27 - lsrs r0, 28 - cmp r0, 0 - bne _0817EAC8 - b _0817EE50 -_0817EAC8: - subs r0, 0x1 - cmp r0, 0xE - bls _0817EAD0 - b _0817EEBC -_0817EAD0: - lsls r0, 2 - ldr r1, =_0817EAEC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0817EAEC: - .4byte _0817EB28 - .4byte _0817EB54 - .4byte _0817EB80 - .4byte _0817EBD4 - .4byte _0817EBFE - .4byte _0817EC26 - .4byte _0817EC4E - .4byte _0817EC6C - .4byte _0817EC9A - .4byte _0817ECCC - .4byte _0817ED54 - .4byte _0817ED82 - .4byte _0817EDC2 - .4byte _0817EE1C - .4byte _0817EEBC -_0817EB28: - lsls r0, r3, 3 - lsls r1, r4, 4 - adds r0, r1 - adds r3, r5, r0 - adds r0, r3, 0 - adds r0, 0x30 - ldrb r0, [r0] - lsls r0, 29 - lsrs r1, r0, 29 - cmp r1, 0 - bne _0817EB40 - b _0817EEBC -_0817EB40: - movs r0, 0x1 - adds r2, r4, 0 - eors r2, r0 - subs r1, 0x1 - lsls r1, 2 - adds r0, r3, 0 - adds r0, 0x32 - ldrb r3, [r0] - lsls r3, 28 - b _0817EE84 -_0817EB54: - lsls r0, r3, 3 - lsls r1, r4, 4 - adds r0, r1 - adds r3, r5, r0 - adds r0, r3, 0 - adds r0, 0x30 - ldrb r0, [r0] - lsls r0, 26 - lsrs r1, r0, 29 - cmp r1, 0 - bne _0817EB6C - b _0817EEBC -_0817EB6C: - movs r0, 0x1 - adds r2, r4, 0 - eors r2, r0 - subs r1, 0x1 - lsls r1, 2 - adds r0, r3, 0 - adds r0, 0x32 - ldrb r3, [r0] - lsls r3, 26 - b _0817EE84 -_0817EB80: - lsls r0, r3, 2 - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 3 - adds r0, r1 - adds r5, r0 - ldrb r0, [r5] - lsls r0, 29 - lsrs r1, r0, 29 - cmp r1, 0 - beq _0817EBB4 - movs r0, 0x1 - adds r2, r4, 0 - eors r2, r0 - subs r0, r1, 0x1 - lsls r0, 2 - ldrb r3, [r5, 0x2] - lsls r3, 28 - lsrs r3, 30 - adds r3, r0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x13 - movs r1, 0 - bl sub_817E684 -_0817EBB4: - ldrb r0, [r5] - lsls r0, 26 - lsrs r1, r0, 29 - cmp r1, 0 - bne _0817EBC0 - b _0817EEBC -_0817EBC0: - movs r0, 0x1 - adds r2, r4, 0 - eors r2, r0 - subs r0, r1, 0x1 - lsls r0, 2 - ldrb r3, [r5, 0x2] - lsls r3, 26 - lsrs r3, 30 - adds r3, r0 - b _0817EE88 -_0817EBD4: - lsls r0, r3, 2 - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 3 - adds r0, r1 - adds r1, r5, r0 - ldrh r0, [r1] - lsls r0, 23 - lsrs r3, r0, 29 - cmp r3, 0 - bne _0817EBEC - b _0817EEBC -_0817EBEC: - movs r0, 0x1 - adds r2, r4, 0 - eors r2, r0 - subs r0, r3, 0x1 - lsls r0, 2 - ldrb r3, [r1, 0x2] - lsrs r3, 6 - adds r3, r0 - b _0817EE88 -_0817EBFE: - lsls r0, r3, 3 - lsls r1, r4, 4 - adds r0, r1 - adds r3, r5, r0 - ldrh r0, [r3, 0x30] - lsls r0, 23 - lsrs r1, r0, 29 - cmp r1, 0 - bne _0817EC12 - b _0817EEBC -_0817EC12: - movs r0, 0x1 - adds r2, r4, 0 - eors r2, r0 - subs r1, 0x1 - lsls r1, 2 - adds r0, r3, 0 - adds r0, 0x32 - ldrb r3, [r0] - lsrs r3, 6 - b _0817EE86 -_0817EC26: - lsls r0, r3, 3 - lsls r1, r4, 4 - adds r0, r1 - adds r3, r5, r0 - adds r0, r3, 0 - adds r0, 0x31 - ldrb r0, [r0] - lsls r0, 28 - lsrs r1, r0, 29 - cmp r1, 0 - bne _0817EC3E - b _0817EEBC -_0817EC3E: - movs r0, 0x1 - adds r2, r4, 0 - eors r2, r0 - subs r1, 0x1 - lsls r1, 2 - adds r0, r3, 0 - adds r0, 0x33 - b _0817EE80 -_0817EC4E: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r3, r5, r0 - adds r0, r3, 0 - adds r0, 0x50 - ldrb r0, [r0] - lsls r0, 29 - lsrs r1, r0, 29 - cmp r1, 0 - bne _0817EC66 - b _0817EEBC -_0817EC66: - movs r0, 0x1 - adds r2, r4, 0 - b _0817EE76 -_0817EC6C: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r3, r5, r0 - ldr r0, [r3, 0x50] - lsls r0, 14 - lsrs r0, 29 - cmp r0, 0 - bne _0817EC80 - b _0817EEBC -_0817EC80: - adds r2, r4, 0 - subs r1, r0, 0x1 - lsls r1, 2 - adds r0, r3, 0 - adds r0, 0x55 - ldrb r3, [r0] - lsls r3, 28 - lsrs r3, 30 - adds r3, r1 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x14 - b _0817EE8E -_0817EC9A: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r3, r5, r0 - adds r0, r3, 0 - adds r0, 0x52 - ldrb r0, [r0] - lsls r0, 27 - lsrs r0, 29 - cmp r0, 0 - bne _0817ECB2 - b _0817EEBC -_0817ECB2: - adds r2, r4, 0 - subs r1, r0, 0x1 - lsls r1, 2 - adds r0, r3, 0 - adds r0, 0x55 - ldrb r3, [r0] - lsls r3, 26 - lsrs r3, 30 - adds r3, r1 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x14 - b _0817EE8E -_0817ECCC: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r3, r5, r0 - adds r0, r3, 0 - adds r0, 0x58 - ldrb r0, [r0] - lsls r0, 25 - cmp r0, 0 - bge _0817ED14 - adds r0, r3, 0 - adds r0, 0x52 - ldrb r0, [r0] - lsrs r0, 5 - subs r6, r0, 0x1 - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r6, r0 - beq _0817ED14 - adds r2, r4, 0 - lsls r1, r6, 2 - adds r0, r3, 0 - adds r0, 0x55 - ldrb r3, [r0] - lsrs r3, 6 - adds r3, r1 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x13 - movs r1, 0 - bl sub_817E684 -_0817ED14: - movs r1, 0x1 - eors r1, r4 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r1, r5, r0 - adds r0, r1, 0 - adds r0, 0x58 - ldrb r0, [r0] - lsls r0, 25 - cmp r0, 0 - blt _0817ED2E - b _0817EEBC -_0817ED2E: - movs r0, 0x1 - adds r2, r4, 0 - eors r2, r0 - adds r0, r1, 0 - adds r0, 0x52 - ldrb r0, [r0] - lsrs r0, 5 - subs r0, 0x1 - lsls r0, 2 - adds r1, 0x55 - ldrb r3, [r1] - lsrs r3, 6 - adds r3, r0 - b _0817EE88 - .pool -_0817ED54: - movs r0, 0x1 - eors r0, r4 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r5, r1 - adds r1, 0x56 - ldrb r0, [r1] - lsls r0, 25 - lsrs r5, r0, 29 - cmp r5, 0 - bne _0817ED6E - b _0817EEBC -_0817ED6E: - movs r0, 0x1 - adds r2, r4, 0 - eors r2, r0 - subs r0, r5, 0x1 - lsls r0, 2 - ldrh r3, [r1] - lsls r3, 23 - lsrs r3, 30 - adds r3, r0 - b _0817EE88 -_0817ED82: - lsls r2, r4, 4 - movs r1, 0x1 - adds r0, r4, 0 - eors r0, r1 - lsls r6, r0, 24 - adds r0, r5, 0 - adds r0, 0x30 - adds r4, r2, r0 - movs r5, 0x1 -_0817ED94: - ldr r0, [r4] - lsls r0, 14 - lsrs r0, 29 - cmp r0, 0 - beq _0817EDB8 - subs r0, 0x1 - lsls r0, 2 - ldrb r3, [r4, 0x3] - lsls r3, 26 - lsrs r3, 30 - adds r3, r0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x13 - movs r1, 0 - lsrs r2, r6, 24 - bl sub_817E684 -_0817EDB8: - adds r4, 0x8 - subs r5, 0x1 - cmp r5, 0 - bge _0817ED94 - b _0817EEBC -_0817EDC2: - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r5, r0 - adds r0, 0x58 - ldrb r3, [r0] - lsls r0, r3, 31 - cmp r0, 0 - beq _0817EDF0 - adds r2, r4, 0 - lsls r0, r3, 26 - lsrs r0, 29 - subs r0, 0x1 - lsls r0, 2 - lsls r3, 29 - lsrs r3, 30 - adds r3, r0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x13 - movs r1, 0 - bl sub_817E684 -_0817EDF0: - movs r0, 0x1 - eors r0, r4 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r5, r1 - adds r1, 0x58 - ldrb r1, [r1] - lsls r0, r1, 31 - cmp r0, 0 - beq _0817EEBC - movs r0, 0x1 - adds r2, r4, 0 - eors r2, r0 - lsls r0, r1, 26 - lsrs r0, 29 - subs r0, 0x1 - lsls r0, 2 - lsls r3, r1, 29 - lsrs r3, 30 - adds r3, r0 - b _0817EE88 -_0817EE1C: - cmp r7, 0x1 - bne _0817EEBC - adds r2, r4, 0 - ldr r1, =0x0202406e - ldr r0, =0x0202420b - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r1, 2 - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r5, r0 - adds r0, 0x53 - ldrb r3, [r0] - lsrs r3, 6 - adds r3, r1 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x14 - b _0817EE8E - .pool -_0817EE50: - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r3, r5, r0 - adds r0, r3, 0 - adds r0, 0x57 - ldrb r0, [r0] - lsls r0, 27 - lsrs r0, 28 - cmp r0, 0x7 - bne _0817EE96 - adds r0, r3, 0 - adds r0, 0x50 - ldrb r0, [r0] - lsls r0, 29 - lsrs r1, r0, 29 - cmp r1, 0 - beq _0817EEBC - movs r0, 0x1 -_0817EE76: - eors r2, r0 - subs r1, 0x1 - lsls r1, 2 - adds r0, r3, 0 - adds r0, 0x54 -_0817EE80: - ldrb r3, [r0] - lsls r3, 30 -_0817EE84: - lsrs r3, 30 -_0817EE86: - adds r3, r1 -_0817EE88: - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x13 -_0817EE8E: - movs r1, 0 - bl sub_817E684 - b _0817EEBC -_0817EE96: - adds r2, r4, 0 - ldr r1, =0x0202406e - mov r3, r8 - ldrb r0, [r3] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r1, 2 - adds r0, r6, 0 - adds r0, 0x53 - ldrb r3, [r0] - lsrs r3, 6 - adds r3, r1 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x14 - movs r1, 0 - bl sub_817E684 -_0817EEBC: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817EA80 - - thumb_func_start sub_817EECC -sub_817EECC: @ 817EECC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - ldr r7, =0x02022fec - ldr r0, [r7] - ldr r1, =0x02000003 - ands r0, r1 - cmp r0, 0 - beq _0817EEE6 - b _0817F1FA -_0817EEE6: - ldr r4, =0x0202420b - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0817EEF8 - b _0817F1FA -_0817EEF8: - ldr r5, =0x02024084 - ldrb r4, [r4] - movs r1, 0x58 - adds r6, r4, 0 - muls r6, r1 - adds r0, r6, r5 - ldrb r0, [r0, 0x1E] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x5 - bgt _0817EF10 - b _0817F1FA -_0817EF10: - ldr r0, =0x0202420c - ldrb r0, [r0] - muls r0, r1 - adds r0, r5 - ldrb r0, [r0, 0x1F] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x6 - ble _0817EF24 - b _0817F1FA -_0817EF24: - ldr r0, =0x020241ea - ldrh r1, [r0] - cmp r1, 0xED - bne _0817EF2E - b _0817F1FA -_0817EF2E: - ldr r0, =0x00000137 - cmp r1, r0 - bne _0817EF36 - b _0817F1FA -_0817EF36: - ldr r0, [r7] - movs r1, 0xC8 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - beq _0817EF44 - b _0817F1FA -_0817EF44: - ldr r3, =gBattleMoves - ldr r2, =0x020244b0 - adds r0, r4, r2 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r6 - adds r1, r5, 0 - adds r1, 0xC - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x1] - adds r6, r2, 0 - cmp r0, 0 - bne _0817EF6A - b _0817F1FA -_0817EF6A: - movs r5, 0 - str r1, [sp, 0x24] - ldr r1, =gUnknown_0860A4AC - ldr r4, =0x0000ffff - adds r3, r1, 0 - adds r2, r1, 0 -_0817EF76: - ldr r0, [sp, 0x24] - ldrh r7, [r2] - cmp r0, r7 - beq _0817EF8A - adds r3, 0x2 - adds r2, 0x2 - adds r5, 0x1 - ldrh r0, [r3] - cmp r0, r4 - bne _0817EF76 -_0817EF8A: - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _0817EF98 - b _0817F1FA -_0817EF98: - ldr r2, =0x0202420b - ldrb r0, [r2] - adds r0, r6 - ldrb r0, [r0] - lsls r0, 2 - mov r1, sp - adds r1, r0 - adds r1, 0x10 - ldr r0, =0x020241f0 - ldr r0, [r0] - str r0, [r1] - ldr r0, =0x020241ea - ldrh r1, [r0] - str r1, [sp, 0x24] - movs r5, 0 - add r3, sp, 0x20 - mov r10, r3 - mov r8, r0 - add r7, sp, 0x10 - ldr r4, =0x0202420c - mov r9, r4 -_0817EFC2: - lsls r1, r5, 1 - ldr r6, =0x0202420b - ldrb r0, [r6] - movs r2, 0x58 - muls r0, r2 - adds r1, r0 - ldr r0, =0x02024084 - adds r0, 0xC - adds r1, r0 - ldrh r0, [r1] - mov r3, r8 - strh r0, [r3] - movs r6, 0 - mov r4, r10 - strh r6, [r4] - ldrh r0, [r3] - adds r1, r7, 0 - mov r2, r10 - bl sub_817F21C - lsls r0, 24 - cmp r0, 0 - beq _0817F0B4 - ldr r4, =0x0202428e - mov r1, r9 - ldrb r0, [r1] - bl battle_get_per_side_status - movs r1, 0x1 - ands r1, r0 - lsls r1, 1 - adds r1, r4 - ldrh r3, [r1] - ldr r2, =0x0202420b - ldrb r0, [r2] - movs r4, 0x58 - muls r0, r4 - ldr r6, =0x02024084 - adds r0, r6 - mov r2, r9 - ldrb r1, [r2] - muls r1, r4 - adds r1, r6 - mov r4, r8 - ldrh r2, [r4] - mov r6, r10 - ldrh r4, [r6] - str r4, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r6, =0x0202420b - ldrb r4, [r6] - str r4, [sp, 0x8] - mov r6, r9 - ldrb r4, [r6] - str r4, [sp, 0xC] - bl sub_806957C - adds r3, r0, 0 - ldr r4, =0x020241f0 - str r3, [r4] - ldr r1, =0x020242ac - ldr r2, =0x0202420b - ldrb r0, [r2] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 2 - ands r0, r1 - cmp r0, 0 - beq _0817F06A - ldr r2, =gBattleMoves - mov r6, r8 - ldrh r1, [r6] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x2] - cmp r0, 0xD - bne _0817F06A - lsls r0, r3, 1 - str r0, [r4] -_0817F06A: - ldr r0, =0x0202433c - ldr r6, =0x0202420b - ldrb r1, [r6] - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1] - lsls r0, 28 - cmp r0, 0 - bge _0817F08C - ldr r4, =0x020241f0 - ldr r1, [r4] - lsls r0, r1, 4 - subs r0, r1 - movs r1, 0xA - bl __divsi3 - str r0, [r4] -_0817F08C: - mov r1, r8 - ldrh r0, [r1] - ldrb r1, [r6] - mov r3, r9 - ldrb r2, [r3] - bl move_effectiveness_something - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =0x020241f0 - ldr r0, [r0] - str r0, [r7] - cmp r0, 0 - bne _0817F0B4 - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - bne _0817F0B4 - movs r0, 0x1 - str r0, [r7] -_0817F0B4: - adds r7, 0x4 - adds r5, 0x1 - cmp r5, 0x3 - ble _0817EFC2 - movs r5, 0 - ldr r3, =0x0202420b - ldr r6, =0x020244b0 - ldr r4, =0x0202406e - mov r8, r4 - movs r7, 0x64 - mov r9, r7 - mov r10, r6 -_0817F0CC: - ldrb r0, [r3] - adds r0, r6 - ldrb r2, [r0] - cmp r5, r2 - bne _0817F0D8 - b _0817F1D4 -_0817F0D8: - lsls r0, r5, 2 - mov r1, sp - adds r1, r0 - adds r1, 0x10 - lsls r0, r2, 2 - add r0, sp - adds r0, 0x10 - ldr r1, [r1] - ldr r0, [r0] - cmp r1, r0 - ble _0817F1D4 - movs r7, 0x1 - cmp r2, 0 - beq _0817F0F6 - movs r7, 0 -_0817F0F6: - movs r5, 0 - ldr r4, =0x0202420c - ldr r6, =0x02024744 - ldr r0, =0x0202420b - ldrb r0, [r0] - add r0, r10 - ldrb r3, [r0] - add r2, sp, 0x10 -_0817F106: - cmp r5, r3 - beq _0817F11A - lsls r0, r7, 2 - add r0, sp - adds r0, 0x10 - ldr r1, [r2] - ldr r0, [r0] - cmp r1, r0 - ble _0817F11A - adds r7, r5, 0 -_0817F11A: - adds r2, 0x4 - adds r5, 0x1 - cmp r5, 0x3 - ble _0817F106 - ldrb r0, [r4] - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - adds r0, r6 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - adds r6, r0, 0 - lsls r6, 16 - lsrs r6, 16 - ldr r2, =0x0202420b - ldrb r0, [r2] - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - mov r3, r9 - muls r3, r0 - adds r0, r3, 0 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r4, =0x0202420b - ldrb r3, [r4] - mov r2, r10 - adds r0, r3, r2 - ldrb r2, [r0] - movs r0, 0x58 - adds r4, r3, 0 - muls r4, r0 - ldr r5, =0x02024090 - adds r3, r4, r5 - lsls r0, r7, 1 - adds r0, r4 - adds r0, r5 - ldrh r0, [r0] - str r0, [sp] - adds r0, r6, 0 - bl sub_80EE35C - b _0817F1DC - .pool -_0817F1D4: - adds r5, 0x1 - cmp r5, 0x3 - bgt _0817F1DC - b _0817F0CC -_0817F1DC: - ldr r2, =0x020241f0 - ldr r1, =0x020244b0 - ldr r0, =0x0202420b - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 2 - add r0, sp - adds r0, 0x10 - ldr r0, [r0] - str r0, [r2] - ldr r0, =0x020241ea - mov r3, sp - ldrh r3, [r3, 0x24] - strh r3, [r0] -_0817F1FA: - 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_817EECC - - thumb_func_start sub_817F21C -sub_817F21C: @ 817F21C - push {r4-r7,lr} - adds r6, r1, 0 - mov r12, r2 - lsls r0, 16 - lsrs r2, r0, 16 - ldr r1, =gBattleMoves - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x1] - cmp r0, 0 - beq _0817F286 - movs r4, 0 - ldr r5, =gUnknown_0860A4AC - ldr r7, =0x0000ffff - adds r3, r5, 0 - adds r1, r5, 0 -_0817F240: - ldrh r0, [r1] - cmp r2, r0 - beq _0817F252 - adds r3, 0x2 - adds r1, 0x2 - adds r4, 0x1 - ldrh r0, [r3] - cmp r0, r7 - bne _0817F240 -_0817F252: - lsls r0, r4, 1 - adds r0, r5 - ldrh r1, [r0] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _0817F270 - movs r0, 0 - str r0, [r6] - b _0817F2A0 - .pool -_0817F270: - cmp r2, 0x95 - bne _0817F294 - ldr r2, =0x02024084 - ldr r0, =0x0202420b - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - adds r0, 0x2A - ldrb r0, [r0] - asrs r0, 1 -_0817F286: - str r0, [r6] - movs r0, 0 - b _0817F2A0 - .pool -_0817F294: - cmp r2, 0xDE - bne _0817F29E - movs r0, 0xA - mov r1, r12 - strh r0, [r1] -_0817F29E: - movs r0, 0x1 -_0817F2A0: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_817F21C - - thumb_func_start sub_817F2A8 -sub_817F2A8: @ 817F2A8 - push {r4,r5,lr} - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0817F324 - ldr r0, =0x0202449c - ldr r3, [r0] - ldr r0, =0x0000025b - adds r4, r3, r0 - ldrb r2, [r4] - subs r1, 0x21 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r4] - ldr r0, =0x00000267 - adds r2, r3, r0 - ldrb r0, [r2] - ands r1, r0 - strb r1, [r2] - ldrb r5, [r4] - movs r1, 0x1F - adds r0, r1, 0 - ands r0, r5 - strb r0, [r4] - ldrb r0, [r2] - ands r1, r0 - strb r1, [r2] - movs r0, 0x97 - lsls r0, 2 - adds r4, r3, r0 - ldrb r2, [r4] - movs r1, 0x39 - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r4] - movs r0, 0x9A - lsls r0, 2 - adds r3, r0 - ldrb r0, [r3] - ands r1, r0 - strb r1, [r3] - ldrb r2, [r4] - movs r1, 0x7 - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r4] - ldrb r0, [r3] - ands r1, r0 - strb r1, [r3] - ldrb r2, [r4] - movs r1, 0x2 - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - strb r0, [r4] - ldrb r0, [r3] - ands r1, r0 - strb r1, [r3] -_0817F324: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817F2A8 - - thumb_func_start sub_817F33C -sub_817F33C: @ 817F33C - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 16 - lsrs r7, r1, 16 - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - ldr r6, =0x02024744 - cmp r0, 0 - bne _0817F356 - ldr r6, =0x020244ec -_0817F356: - movs r4, 0 - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r5, r0, r1 - b _0817F36E - .pool -_0817F36C: - adds r4, 0x1 -_0817F36E: - cmp r4, 0x3 - bgt _0817F388 - ldrh r1, [r5] - movs r0, 0x64 - muls r0, r1 - adds r0, r6, r0 - adds r1, r4, 0 - adds r1, 0xD - movs r2, 0 - bl pokemon_getattr - cmp r0, r7 - bne _0817F36C -_0817F388: - lsls r0, r4, 24 - lsrs r0, 24 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_817F33C - - thumb_func_start sub_817F394 -sub_817F394: @ 817F394 - push {r4-r6,lr} - lsls r0, 16 - lsrs r3, r0, 16 - adds r4, r3, 0 - lsls r1, 16 - lsrs r1, 16 - adds r6, r1, 0 - lsls r2, 24 - lsrs r2, 24 - adds r5, r2, 0 - movs r0, 0x7 - ands r0, r3 - cmp r0, 0 - beq _0817F3B4 - movs r0, 0x3 - b _0817F3CA -_0817F3B4: - movs r0, 0x60 - ands r0, r3 - cmp r0, 0 - beq _0817F3C0 - movs r0, 0x4 - b _0817F3CA -_0817F3C0: - movs r0, 0x18 - ands r0, r3 - cmp r0, 0 - beq _0817F3D2 - movs r0, 0x5 -_0817F3CA: - movs r3, 0 - bl sub_817E684 - b _0817F3E6 -_0817F3D2: - movs r0, 0x80 - ands r4, r0 - cmp r4, 0 - beq _0817F3E6 - movs r0, 0x6 - adds r1, r6, 0 - adds r2, r5, 0 - movs r3, 0 - bl sub_817E684 -_0817F3E6: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_817F394 - - thumb_func_start nullsub_69 -nullsub_69: @ 817F3EC - bx lr - thumb_func_end nullsub_69 - - thumb_func_start sub_817F3F0 -sub_817F3F0: @ 817F3F0 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - mov r9, r0 - mov r8, r1 - adds r5, r2, 0 - adds r4, r3, 0 - lsls r5, 16 - negs r5, r5 - lsls r4, 16 - negs r4, r4 - lsrs r4, 16 - mov r0, r8 - lsls r0, 16 - asrs r0, 16 - mov r8, r0 - asrs r5, 16 - adds r1, r5, 0 - bl cosine - adds r6, r0, 0 - lsls r4, 16 - asrs r4, 16 - mov r0, r8 - adds r1, r4, 0 - bl sine - subs r6, r0 - lsls r6, 16 - lsrs r6, 16 - mov r0, r8 - adds r1, r4, 0 - bl cosine - adds r2, r0, 0 - mov r0, r8 - adds r1, r5, 0 - str r2, [sp] - bl sine - ldr r2, [sp] - adds r2, r0 - negs r5, r5 - negs r4, r4 - lsls r6, 16 - asrs r6, 16 - lsls r5, 16 - asrs r5, 16 - adds r6, r5 - mov r0, r9 - strh r6, [r0, 0x24] - lsls r2, 16 - asrs r2, 16 - lsls r4, 16 - asrs r4, 16 - adds r2, r4 - strh r2, [r0, 0x26] - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_817F3F0 - - thumb_func_start sub_817F474 -sub_817F474: @ 817F474 - push {lr} - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gUnknown_0860A8C8 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _0817F48C - movs r0, 0 - b _0817F492 - .pool -_0817F48C: - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 -_0817F492: - pop {r1} - bx r1 - thumb_func_end sub_817F474 - - thumb_func_start sub_817F498 -sub_817F498: @ 817F498 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x03005e00 - lsls r6, r5, 2 - adds r0, r6, r5 - lsls r0, 3 - adds r2, r0, r1 - movs r3, 0xA - ldrsh r0, [r2, r3] - lsls r3, r0, 16 - movs r4, 0xC - ldrsh r0, [r2, r4] - orrs r3, r0 - movs r0, 0x8 - ldrsh r4, [r2, r0] - mov r8, r1 - ldr r0, =DummyObjectCallback - mov r12, r0 - cmp r4, 0 - bne _0817F508 - ldrh r0, [r3, 0x2E] - strh r0, [r2, 0x10] - ldrh r0, [r3, 0x32] - strh r0, [r2, 0x12] - movs r0, 0x1 - strh r0, [r3, 0x30] - strh r4, [r3, 0x2E] - movs r0, 0x2 - adds r1, r6, 0 - ldr r6, =gUnknown_0860AA88 - ldr r7, =0x03001274 - movs r4, 0 - adds r2, r3, 0 - adds r2, 0x32 -_0817F4E2: - strh r4, [r2] - adds r2, 0x2 - adds r0, 0x1 - cmp r0, 0x7 - bls _0817F4E2 - adds r1, r5 - lsls r1, 3 - add r1, r8 - movs r2, 0xE - ldrsh r0, [r1, r2] - lsls r0, 2 - adds r0, r6 - ldr r0, [r0] - str r0, [r3, 0x1C] - movs r0, 0 - str r0, [r7] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_0817F508: - ldr r0, [r3, 0x1C] - cmp r0, r12 - bne _0817F528 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - add r0, r8 - ldrh r1, [r0, 0x10] - movs r2, 0 - strh r1, [r3, 0x2E] - ldrh r0, [r0, 0x12] - strh r0, [r3, 0x32] - strh r2, [r3, 0x30] - adds r0, r5, 0 - bl DestroyTask -_0817F528: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817F498 - - thumb_func_start sub_817F544 -sub_817F544: @ 817F544 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r4, r1, 24 - lsrs r4, 24 - ldr r0, =sub_817F498 - movs r1, 0x80 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - lsrs r0, r5, 16 - strh r0, [r1, 0xA] - strh r5, [r1, 0xC] - strh r4, [r1, 0xE] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817F544 - - thumb_func_start sub_817F578 -sub_817F578: @ 817F578 - lsls r1, 24 - ldr r3, =0x03001274 - movs r2, 0x1 - str r2, [r3] - ldr r2, =gUnknown_0860AA88 - lsrs r1, 22 - adds r1, r2 - ldr r1, [r1] - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_817F578 - - thumb_func_start sub_817F594 -sub_817F594: @ 817F594 - push {r4-r6,lr} - adds r5, r0, 0 - lsls r6, r1, 24 - lsrs r6, 24 - ldr r0, =sub_817F498 - movs r1, 0x80 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005e00 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - lsrs r0, r5, 16 - strh r0, [r4, 0xA] - strh r5, [r4, 0xC] - ldrh r0, [r5, 0x2E] - lsls r0, 24 - ldr r1, =0x0202406e - lsrs r0, 23 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - bl GetNature - lsls r0, 24 - lsrs r0, 24 - lsls r1, r6, 1 - ldr r2, =gUnknown_0860AD2F - adds r0, r2 - adds r1, r6 - ldrb r0, [r0] - adds r1, r0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =gUnknown_0860ACE4 - adds r1, r0 - ldrb r0, [r1] - strh r0, [r4, 0xE] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817F594 - - thumb_func_start sub_817F60C -sub_817F60C: @ 817F60C - ldr r1, =nullsub_69 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_817F60C - - thumb_func_start sub_817F618 -sub_817F618: @ 817F618 - push {r4,r5,lr} - sub sp, 0x10 - lsls r1, 16 - lsls r3, 16 - lsrs r3, 16 - ldr r4, =0xffff0000 - lsls r2, 16 - lsrs r1, 16 - orrs r1, r2 - str r1, [sp] - ldr r1, [sp, 0x4] - ands r1, r4 - orrs r1, r3 - str r1, [sp, 0x4] - ldrb r4, [r0, 0x3] - lsls r4, 26 - lsrs r4, 27 - add r5, sp, 0x8 - mov r0, sp - adds r1, r5, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ObjAffineSet - ldr r0, =0x02021bc0 - lsls r4, 3 - adds r4, r0 - ldrh r0, [r5] - strh r0, [r4] - ldrh r0, [r5, 0x2] - strh r0, [r4, 0x2] - ldrh r0, [r5, 0x4] - strh r0, [r4, 0x4] - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x6] - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817F618 - - thumb_func_start sub_817F670 -sub_817F670: @ 817F670 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0x1] - movs r1, 0x3 - orrs r0, r1 - strb r0, [r4, 0x1] - ldr r0, =gUnknown_0860AD68 - str r0, [r4, 0x10] - ldr r0, =0x03001274 - ldr r0, [r0] - cmp r0, 0x1 - bne _0817F68E - adds r0, r4, 0 - bl obj_alloc_rotscale_entry -_0817F68E: - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0817F6A8 - adds r0, r4, 0 - movs r1, 0x1 - bl StartObjectRotScalAnim - b _0817F6B0 - .pool -_0817F6A8: - adds r0, r4, 0 - movs r1, 0 - bl StartObjectRotScalAnim -_0817F6B0: - ldrb r3, [r4, 0x1] - lsrs r1, r3, 6 - ldrb r2, [r4, 0x3] - lsrs r2, 6 - lsls r3, 30 - lsrs r3, 30 - adds r0, r4, 0 - bl CalcVecFromObjectCenterToObjectUpperLeft - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_817F670 - - thumb_func_start sub_817F6D4 -sub_817F6D4: @ 817F6D4 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r1, 16 - lsls r2, 16 - lsrs r2, 16 - lsls r3, 16 - lsrs r3, 16 - movs r5, 0x30 - ldrsh r0, [r4, r5] - cmp r0, 0 - bne _0817F6F8 - lsls r0, r1, 16 - negs r0, r0 - lsrs r1, r0, 16 - negs r0, r3 - lsls r0, 16 - lsrs r3, r0, 16 -_0817F6F8: - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - adds r0, r4, 0 - bl sub_817F618 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_817F6D4 - - thumb_func_start sub_817F70C -sub_817F70C: @ 817F70C - push {lr} - adds r1, r0, 0 - movs r2, 0x30 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _0817F720 - movs r2, 0x24 - ldrsh r0, [r1, r2] - negs r0, r0 - strh r0, [r1, 0x24] -_0817F720: - pop {r0} - bx r0 - thumb_func_end sub_817F70C - - thumb_func_start sub_817F724 -sub_817F724: @ 817F724 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bhi _0817F750 - ldr r1, =0x03001240 - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r2, 0 - strh r2, [r0, 0x6] - strh r2, [r0] - movs r1, 0x1 - strh r1, [r0, 0x4] - strh r2, [r0, 0x2] - strh r2, [r0, 0x8] - movs r0, 0x1 - b _0817F752 - .pool -_0817F750: - movs r0, 0 -_0817F752: - pop {r1} - bx r1 - thumb_func_end sub_817F724 - - thumb_func_start sub_817F758 -sub_817F758: @ 817F758 - push {r4,lr} - ldr r4, =0x03001270 - ldrb r1, [r4] - adds r2, r1, 0x1 - adds r0, r2, 0 - asrs r0, 2 - lsls r0, 2 - subs r0, r2, r0 - strb r0, [r4] - ldrb r0, [r4] - bl sub_817F724 - ldrb r0, [r4] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_817F758 - - thumb_func_start sub_817F77C -sub_817F77C: @ 817F77C - push {r4,r5,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0x1] - movs r3, 0x4 - negs r3, r3 - ands r3, r0 - movs r5, 0x1 - orrs r3, r5 - strb r3, [r4, 0x1] - lsrs r1, r3, 6 - ldrb r2, [r4, 0x3] - lsrs r2, 6 - lsls r3, 30 - lsrs r3, 30 - adds r0, r4, 0 - bl CalcVecFromObjectCenterToObjectUpperLeft - ldr r0, =0x03001274 - ldr r0, [r0] - cmp r0, 0x1 - bne _0817F800 - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0817F7C0 - adds r1, r4, 0 - adds r1, 0x3F - ldrb r0, [r1] - orrs r0, r5 - strb r0, [r1] - adds r5, r1, 0 - b _0817F7D0 - .pool -_0817F7C0: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r2, [r0] - movs r1, 0x2 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - adds r5, r0, 0 -_0817F7D0: - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl rotscale_free_entry - ldrb r2, [r4, 0x3] - lsls r1, r2, 26 - lsrs r1, 27 - ldrb r0, [r5] - lsls r0, 31 - lsrs r0, 31 - lsls r0, 3 - orrs r1, r0 - lsls r1, 1 - movs r0, 0x3F - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x3] - ldrb r1, [r4, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x1] -_0817F800: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_817F77C - - thumb_func_start pokemonanimfunc_01 -pokemonanimfunc_01: @ 817F808 - push {r4-r6,lr} - adds r6, r0, 0 - movs r1, 0x32 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0817F81A - adds r0, r6, 0 - bl sub_817F670 -_0817F81A: - movs r1, 0x32 - ldrsh r0, [r6, r1] - cmp r0, 0x28 - ble _0817F840 - movs r2, 0x80 - lsls r2, 1 - adds r0, r6, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - adds r0, r6, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r6, 0x1C] - b _0817F88C - .pool -_0817F840: - movs r1, 0x32 - ldrsh r0, [r6, r1] - lsls r0, 9 - movs r1, 0x28 - bl __divsi3 - adds r4, r0, 0 - cmp r0, 0 - bge _0817F854 - adds r4, 0xFF -_0817F854: - asrs r4, 8 - lsls r4, 8 - subs r4, r0, r4 - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 - movs r1, 0x20 - bl sine - movs r1, 0x80 - lsls r1, 1 - adds r5, r1, 0 - adds r0, r5 - strh r0, [r6, 0x36] - adds r0, r4, 0 - movs r1, 0x20 - bl cosine - adds r0, r5 - strh r0, [r6, 0x38] - movs r0, 0x36 - ldrsh r1, [r6, r0] - movs r0, 0x38 - ldrsh r2, [r6, r0] - adds r0, r6, 0 - movs r3, 0 - bl sub_817F6D4 -_0817F88C: - ldrh r0, [r6, 0x32] - adds r0, 0x1 - strh r0, [r6, 0x32] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_01 - - thumb_func_start pokemonanimfunc_02 -pokemonanimfunc_02: @ 817F898 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x32] - movs r2, 0x32 - ldrsh r0, [r4, r2] - cmp r0, 0x28 - ble _0817F8B4 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - movs r0, 0 - b _0817F8EE - .pool -_0817F8B4: - movs r0, 0x1 - ands r0, r1 - movs r5, 0xFF - cmp r0, 0 - bne _0817F8C0 - movs r5, 0x1 -_0817F8C0: - movs r1, 0x32 - ldrsh r0, [r4, r1] - lsls r0, 7 - movs r1, 0x28 - bl __divsi3 - adds r1, r0, 0 - cmp r1, 0 - bge _0817F8D4 - adds r0, 0xFF -_0817F8D4: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x6 - bl sine - lsls r1, r5, 24 - asrs r1, 24 - adds r2, r0, 0 - muls r2, r1 - adds r0, r2, 0 -_0817F8EE: - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_02 - - thumb_func_start sub_817F8FC -sub_817F8FC: @ 817F8FC - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r0, 0x32 - ldrsh r1, [r4, r0] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r1, r0 - ble _0817F91C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - movs r0, 0 - b _0817F946 - .pool -_0817F91C: - movs r0, 0x32 - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 7 - movs r2, 0x2E - ldrsh r1, [r4, r2] - bl __divsi3 - adds r1, r0, 0 - cmp r1, 0 - bge _0817F936 - adds r0, 0xFF -_0817F936: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x6 - bl sine -_0817F946: - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_817F8FC - - thumb_func_start pokemonanimfunc_03 -pokemonanimfunc_03: @ 817F95C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x28 - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl sub_817F8FC - ldr r0, =sub_817F8FC - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_03 - - thumb_func_start sub_817F978 -sub_817F978: @ 817F978 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r0, 0x32 - ldrsh r1, [r4, r0] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r1, r0 - ble _0817F998 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - movs r0, 0 - b _0817F9C4 - .pool -_0817F998: - movs r0, 0x32 - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 7 - movs r2, 0x2E - ldrsh r1, [r4, r2] - bl __divsi3 - adds r1, r0, 0 - cmp r1, 0 - bge _0817F9B2 - adds r0, 0xFF -_0817F9B2: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x6 - bl sine - negs r0, r0 -_0817F9C4: - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_817F978 - - thumb_func_start pokemonanimfunc_04 -pokemonanimfunc_04: @ 817F9D8 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x28 - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl sub_817F978 - ldr r0, =sub_817F978 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_04 - - thumb_func_start sub_817F9F4 -sub_817F9F4: @ 817F9F4 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r1, [r4, r0] - movs r0, 0xC0 - lsls r0, 1 - cmp r1, r0 - ble _0817FA14 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x24] - b _0817FA5E - .pool -_0817FA14: - adds r0, r1, 0 - cmp r1, 0 - bge _0817FA1C - adds r0, 0x7F -_0817FA1C: - asrs r2, r0, 7 - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, 0 - blt _0817FA60 - cmp r0, 0x1 - ble _0817FA48 - cmp r0, 0x3 - bgt _0817FA60 - ldr r2, =0xffffff00 - adds r1, r2 - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x2E - ldrsh r2, [r4, r1] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 16 - b _0817FA56 - .pool -_0817FA48: - lsls r0, r2, 7 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r2, 0x2E - ldrsh r1, [r4, r2] - lsls r1, 17 -_0817FA56: - asrs r1, 16 - bl sine - negs r0, r0 -_0817FA5E: - strh r0, [r4, 0x26] -_0817FA60: - ldrh r0, [r4, 0x32] - adds r0, 0xC - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_817F9F4 - - thumb_func_start pokemonanimfunc_1E -pokemonanimfunc_1E: @ 817FA6C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x4 - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl sub_817F9F4 - ldr r0, =sub_817F9F4 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_1E - - thumb_func_start pokemonanimfunc_06 -pokemonanimfunc_06: @ 817FA88 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r2, [r4, r0] - movs r0, 0xC0 - lsls r0, 2 - cmp r2, r0 - ble _0817FAA8 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x24] - b _0817FB56 - .pool -_0817FAA8: - adds r0, r2, 0 - cmp r2, 0 - bge _0817FAB0 - adds r0, 0x7F -_0817FAB0: - lsls r0, 9 - asrs r0, 16 - cmp r0, 0x5 - bhi _0817FB3C - lsls r0, 2 - ldr r1, =_0817FAC8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0817FAC8: - .4byte _0817FAE0 - .4byte _0817FAE0 - .4byte _0817FAE4 - .4byte _0817FAE8 - .4byte _0817FB04 - .4byte _0817FB1E -_0817FAE0: - movs r0, 0 - b _0817FB3A -_0817FAE4: - movs r2, 0 - b _0817FB3C -_0817FAE8: - adds r0, r2, 0 - cmp r2, 0 - bge _0817FAF0 - adds r0, 0x7F -_0817FAF0: - asrs r0, 7 - lsls r0, 7 - subs r0, r2, r0 - lsls r0, 3 - negs r0, r0 - cmp r0, 0 - bge _0817FB00 - adds r0, 0x7F -_0817FB00: - asrs r0, 7 - b _0817FB3A -_0817FB04: - adds r0, r2, 0 - cmp r2, 0 - bge _0817FB0C - adds r0, 0x7F -_0817FB0C: - asrs r0, 7 - lsls r0, 7 - subs r0, r2, r0 - cmp r0, 0 - bge _0817FB18 - adds r0, 0x7 -_0817FB18: - asrs r0, 3 - subs r0, 0x8 - b _0817FB3A -_0817FB1E: - adds r0, r2, 0 - cmp r2, 0 - bge _0817FB26 - adds r0, 0x7F -_0817FB26: - asrs r0, 7 - lsls r0, 7 - subs r0, r2, r0 - lsls r0, 3 - negs r0, r0 - cmp r0, 0 - bge _0817FB36 - adds r0, 0x7F -_0817FB36: - asrs r0, 7 - adds r0, 0x8 -_0817FB3A: - strh r0, [r4, 0x24] -_0817FB3C: - adds r0, r2, 0 - cmp r2, 0 - bge _0817FB44 - adds r0, 0x7F -_0817FB44: - asrs r0, 7 - lsls r0, 7 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x8 - bl sine - negs r0, r0 -_0817FB56: - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0xC - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_06 - - thumb_func_start pokemonanimfunc_09 -pokemonanimfunc_09: @ 817FB64 - push {r4-r6,lr} - adds r6, r0, 0 - movs r1, 0x32 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0817FB76 - adds r0, r6, 0 - bl sub_817F670 -_0817FB76: - movs r1, 0x32 - ldrsh r0, [r6, r1] - cmp r0, 0x28 - ble _0817FB9C - movs r2, 0x80 - lsls r2, 1 - adds r0, r6, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - adds r0, r6, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r6, 0x1C] - b _0817FC12 - .pool -_0817FB9C: - movs r1, 0x32 - ldrsh r0, [r6, r1] - lsls r0, 8 - movs r1, 0x28 - bl __divsi3 - adds r1, r0, 0 - cmp r1, 0 - bge _0817FBB0 - adds r0, 0xFF -_0817FBB0: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - lsrs r4, r0, 16 - ldrh r0, [r6, 0x32] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0817FBE0 - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 - movs r1, 0x20 - bl sine - movs r1, 0x80 - lsls r1, 1 - adds r5, r1, 0 - adds r0, r5 - strh r0, [r6, 0x36] - adds r0, r4, 0 - movs r1, 0x20 - b _0817FBFA -_0817FBE0: - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 - movs r1, 0x8 - bl sine - movs r1, 0x80 - lsls r1, 1 - adds r5, r1, 0 - adds r0, r5 - strh r0, [r6, 0x36] - adds r0, r4, 0 - movs r1, 0x8 -_0817FBFA: - bl sine - adds r0, r5 - strh r0, [r6, 0x38] - movs r0, 0x36 - ldrsh r1, [r6, r0] - movs r0, 0x38 - ldrsh r2, [r6, r0] - adds r0, r6, 0 - movs r3, 0 - bl sub_817F6D4 -_0817FC12: - ldrh r0, [r6, 0x32] - adds r0, 0x1 - strh r0, [r6, 0x32] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_09 - - thumb_func_start sub_817FC20 -sub_817FC20: @ 817FC20 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0817FC32 - strh r0, [r4, 0x34] -_0817FC32: - ldr r2, =gUnknown_0860AD70 - movs r5, 0x34 - ldrsh r1, [r4, r5] - lsls r0, r1, 1 - adds r0, r1 - adds r1, r2, 0x2 - adds r3, r0, r1 - movs r1, 0 - ldrsb r1, [r3, r1] - movs r5, 0x32 - ldrsh r0, [r4, r5] - cmp r1, r0 - bne _0817FC6A - adds r0, r1, 0 - cmp r0, 0 - bne _0817FC60 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _0817FC6A - .pool -_0817FC60: - ldrh r0, [r4, 0x34] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x34] - strh r1, [r4, 0x32] -_0817FC6A: - movs r0, 0x34 - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r1, r0, r1 - adds r0, r2, 0x2 - adds r0, r1, r0 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - bne _0817FC8C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _0817FCBE - .pool -_0817FC8C: - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - movs r5, 0x34 - ldrsh r1, [r4, r5] - lsls r0, r1, 1 - adds r0, r1 - adds r1, r2, 0x1 - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - adds r0, r4, 0 - bl sub_817F70C -_0817FCBE: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_817FC20 - - thumb_func_start pokemonanimfunc_0A -pokemonanimfunc_0A: @ 817FCC4 - push {r4,lr} - adds r4, r0, 0 - bl sub_817FC20 - ldr r0, =sub_817FC20 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_0A - - thumb_func_start sub_817FCDC -sub_817FCDC: @ 817FCDC - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r1, [r4, r0] - movs r0, 0x90 - lsls r0, 4 - cmp r1, r0 - ble _0817FCF8 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - movs r0, 0 - b _0817FD12 - .pool -_0817FCF8: - adds r0, r1, 0 - cmp r1, 0 - bge _0817FD00 - adds r0, 0xFF -_0817FD00: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r2, 0x3C - ldrsh r1, [r4, r2] - bl sine -_0817FD12: - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x2E] - ldrh r1, [r4, 0x32] - adds r0, r1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_817FCDC - - thumb_func_start pokemonanimfunc_0F -pokemonanimfunc_0F: @ 817FD24 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x3C - strh r0, [r4, 0x2E] - movs r0, 0x3 - strh r0, [r4, 0x3C] - adds r0, r4, 0 - bl sub_817FCDC - ldr r0, =sub_817FCDC - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_0F - - thumb_func_start sub_817FD44 -sub_817FD44: @ 817FD44 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r1, [r4, r0] - movs r0, 0x90 - lsls r0, 4 - cmp r1, r0 - ble _0817FD60 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - movs r0, 0 - b _0817FD78 - .pool -_0817FD60: - adds r0, r1, 0 - cmp r1, 0 - bge _0817FD68 - adds r0, 0xFF -_0817FD68: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x3 - bl sine -_0817FD78: - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x2E] - ldrh r1, [r4, 0x32] - adds r0, r1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_817FD44 - - thumb_func_start pokemonanimfunc_10 -pokemonanimfunc_10: @ 817FD88 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x3C - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl sub_817FD44 - ldr r0, =sub_817FD44 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_10 - - thumb_func_start pokemonanimfunc_11 -pokemonanimfunc_11: @ 817FDA4 - push {r4-r7,lr} - adds r7, r0, 0 - ldrh r2, [r7, 0x32] - movs r0, 0x32 - ldrsh r1, [r7, r0] - movs r0, 0x80 - lsls r0, 2 - cmp r1, r0 - ble _0817FDC8 - ldr r0, =sub_8184D88 - str r0, [r7, 0x1C] - movs r0, 0 - strh r0, [r7, 0x24] - strh r0, [r7, 0x26] - b _0817FE24 - .pool -_0817FDC8: - movs r0, 0x1 - ands r0, r2 - movs r5, 0xFF - cmp r0, 0 - bne _0817FDD4 - movs r5, 0x1 -_0817FDD4: - movs r1, 0x32 - ldrsh r0, [r7, r1] - cmp r0, 0 - bge _0817FDDE - adds r0, 0x3 -_0817FDDE: - asrs r0, 2 - movs r1, 0x8 - bl sine - lsls r0, 16 - asrs r6, r0, 16 - movs r0, 0x32 - ldrsh r1, [r7, r0] - adds r4, r1, 0 - cmp r1, 0 - bge _0817FDF6 - adds r4, 0xFF -_0817FDF6: - asrs r4, 8 - lsls r4, 8 - subs r4, r1, r4 - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 - adds r1, r6, 0 - bl sine - lsls r5, 24 - asrs r5, 24 - adds r1, r0, 0 - muls r1, r5 - adds r0, r1, 0 - strh r0, [r7, 0x26] - adds r0, r4, 0 - adds r1, r6, 0 - bl cosine - adds r1, r0, 0 - muls r1, r5 - adds r0, r1, 0 - strh r0, [r7, 0x24] -_0817FE24: - ldrh r0, [r7, 0x32] - adds r0, 0x9 - strh r0, [r7, 0x32] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_11 - - thumb_func_start sub_817FE30 -sub_817FE30: @ 817FE30 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r2, =0x03001240 - ldrh r6, [r4, 0x2E] - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r5, r0, r2 - ldrh r0, [r5] - cmp r0, 0 - beq _0817FE54 - subs r0, 0x1 - strh r0, [r5] - b _0817FEF8 - .pool -_0817FE54: - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0817FE70 - movs r2, 0x8 - ldrsh r0, [r5, r2] - cmp r0, 0 - bne _0817FE70 - adds r0, r4, 0 - bl sub_817F670 - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] -_0817FE70: - ldr r2, =0x03001240 - lsls r1, r6, 16 - asrs r1, 16 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r5, r0, r2 - movs r0, 0x32 - ldrsh r1, [r4, r0] - movs r2, 0x6 - ldrsh r0, [r5, r2] - cmp r1, r0 - ble _0817FEC4 - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - ldrh r1, [r5, 0x4] - movs r2, 0x4 - ldrsh r0, [r5, r2] - cmp r0, 0x1 - ble _0817FEB4 - subs r0, r1, 0x1 - movs r1, 0 - strh r0, [r5, 0x4] - movs r0, 0xA - strh r0, [r5] - strh r1, [r4, 0x32] - b _0817FEF2 - .pool -_0817FEB4: - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _0817FEF2 - .pool -_0817FEC4: - movs r0, 0x32 - ldrsh r1, [r4, r0] - adds r0, r1, 0 - cmp r1, 0 - bge _0817FED0 - adds r0, 0xFF -_0817FED0: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x80 - lsls r1, 5 - bl sine - strh r0, [r4, 0x3A] - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0x3A] - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_817F6D4 -_0817FEF2: - ldrh r0, [r4, 0x32] - adds r0, 0x10 - strh r0, [r4, 0x32] -_0817FEF8: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_817FE30 - - thumb_func_start pokemonanimfunc_12 -pokemonanimfunc_12: @ 817FF00 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - movs r3, 0 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x80 - lsls r0, 2 - strh r0, [r1, 0x6] - strh r3, [r1] - adds r0, r4, 0 - bl sub_817FE30 - ldr r0, =sub_817FE30 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_12 - - thumb_func_start sub_817FF3C -sub_817FF3C: @ 817FF3C - push {r4-r6,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - lsls r0, 24 - lsrs r5, r0, 24 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0817FF54 - adds r0, r4, 0 - bl sub_817F670 -_0817FF54: - movs r2, 0x32 - ldrsh r6, [r4, r2] - ldr r1, =0x03001240 - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0] - cmp r6, r1 - ble _0817FF8C - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _0817FFAA - .pool -_0817FF8C: - movs r2, 0x8 - ldrsh r1, [r0, r2] - movs r0, 0x80 - lsls r0, 9 - bl __divsi3 - muls r0, r6 - strh r0, [r4, 0x3A] - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0x3A] - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_817F6D4 -_0817FFAA: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_817FF3C - - thumb_func_start pokemonanimfunc_1F -pokemonanimfunc_1F: @ 817FFB8 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x3C - strh r0, [r1] - movs r0, 0x14 - strh r0, [r1, 0x8] - adds r0, r4, 0 - bl sub_817FF3C - ldr r0, =sub_817FF3C - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_1F - - thumb_func_start sub_817FFF0 -sub_817FFF0: @ 817FFF0 - push {r4-r7,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0x2E] - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r5, 0 - bl sub_817F70C - ldr r1, =0x03001240 - lsls r0, r7, 1 - adds r0, r7 - lsls r0, 2 - adds r6, r0, r1 - movs r0, 0x32 - ldrsh r1, [r5, r0] - movs r2, 0x6 - ldrsh r0, [r6, r2] - cmp r1, r0 - ble _0818002C - movs r0, 0 - strh r0, [r5, 0x24] - strh r0, [r5, 0x26] - ldr r0, =sub_8184D88 - str r0, [r5, 0x1C] - b _0818006A - .pool -_0818002C: - movs r0, 0x32 - ldrsh r1, [r5, r0] - adds r0, r1, 0 - adds r0, 0xC0 - adds r4, r0, 0 - cmp r0, 0 - bge _0818003E - ldr r2, =0x000001bf - adds r4, r1, r2 -_0818003E: - asrs r4, 8 - lsls r4, 8 - subs r4, r0, r4 - lsls r4, 16 - asrs r4, 16 - movs r0, 0x8 - ldrsh r1, [r6, r0] - lsls r1, 17 - asrs r1, 16 - adds r0, r4, 0 - bl cosine - negs r0, r0 - strh r0, [r5, 0x24] - movs r2, 0x8 - ldrsh r1, [r6, r2] - adds r0, r4, 0 - bl sine - ldrh r1, [r6, 0x8] - adds r0, r1 - strh r0, [r5, 0x26] -_0818006A: - ldr r0, =0x03001240 - lsls r1, r7, 1 - adds r1, r7 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x2] - ldrh r1, [r5, 0x32] - adds r0, r1 - strh r0, [r5, 0x32] - adds r0, r5, 0 - bl sub_817F70C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817FFF0 - - thumb_func_start pokemonanimfunc_14 -pokemonanimfunc_14: @ 8180090 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x80 - lsls r0, 2 - strh r0, [r1, 0x6] - movs r0, 0x6 - strh r0, [r1, 0x8] - movs r0, 0x18 - strh r0, [r1, 0x2] - adds r0, r4, 0 - bl sub_817FFF0 - ldr r0, =sub_817FFF0 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_14 - - thumb_func_start pokemonanimfunc_15 -pokemonanimfunc_15: @ 81800D0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081800EC - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - adds r0, r1 - strh r0, [r4, 0x3C] -_081800EC: - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x80 - ble _0818010C - ldrh r0, [r4, 0x3C] - movs r1, 0x10 - movs r2, 0 - movs r3, 0 - bl pal_fade_1 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _08180128 - .pool -_0818010C: - movs r2, 0x32 - ldrsh r0, [r4, r2] - movs r1, 0x10 - bl sine - adds r2, r0, 0 - strh r2, [r4, 0x3A] - ldrh r0, [r4, 0x3C] - lsls r2, 24 - lsrs r2, 24 - movs r1, 0x10 - movs r3, 0 - bl pal_fade_1 -_08180128: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_15 - - thumb_func_start pokemonanimfunc_16 -pokemonanimfunc_16: @ 8180134 - push {r4-r7,lr} - adds r6, r0, 0 - movs r7, 0 - movs r1, 0x32 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _08180148 - adds r0, r6, 0 - bl sub_817F670 -_08180148: - ldrh r5, [r6, 0x32] - movs r2, 0x32 - ldrsh r0, [r6, r2] - cmp r0, 0x28 - ble _08180170 - movs r2, 0x80 - lsls r2, 1 - adds r0, r6, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - adds r0, r6, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r6, 0x1C] - b _08180204 - .pool -_08180170: - movs r1, 0x32 - ldrsh r0, [r6, r1] - lsls r0, 7 - movs r1, 0x28 - bl __divsi3 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r5, 0 - subs r0, 0xA - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x13 - bhi _08180196 - ldrh r0, [r6, 0x3C] - adds r0, 0x33 - strh r0, [r6, 0x3C] - movs r7, 0xFF - ands r7, r0 -_08180196: - movs r2, 0x30 - ldrsh r0, [r6, r2] - cmp r0, 0 - bne _081801C4 - lsls r5, r4, 16 - asrs r0, r5, 16 - movs r1, 0x28 - bl sine - adds r4, r0, 0 - adds r0, r7, 0 - movs r1, 0x10 - bl sine - ldr r1, =0xffffff00 - adds r0, r1 - adds r4, r0 - strh r4, [r6, 0x36] - adds r4, r5, 0 - b _081801E4 - .pool -_081801C4: - adds r0, r7, 0 - movs r1, 0x10 - bl sine - adds r5, r0, 0 - lsls r4, 16 - asrs r0, r4, 16 - movs r1, 0x28 - bl sine - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - subs r1, r5 - subs r1, r0 - strh r1, [r6, 0x36] -_081801E4: - asrs r0, r4, 16 - movs r1, 0x10 - bl sine - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - strh r0, [r6, 0x38] - movs r2, 0x36 - ldrsh r1, [r6, r2] - movs r0, 0x38 - ldrsh r2, [r6, r0] - adds r0, r6, 0 - movs r3, 0 - bl sub_817F618 -_08180204: - ldrh r0, [r6, 0x32] - adds r0, 0x1 - strh r0, [r6, 0x32] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_16 - - thumb_func_start pokemonanimfunc_17 -pokemonanimfunc_17: @ 8180210 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - movs r0, 0 - mov r8, r0 - movs r7, 0 - movs r1, 0x32 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0818022C - adds r0, r5, 0 - bl sub_817F670 -_0818022C: - ldrh r6, [r5, 0x32] - movs r2, 0x32 - ldrsh r0, [r5, r2] - cmp r0, 0x28 - ble _08180258 - movs r2, 0x80 - lsls r2, 1 - adds r0, r5, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - adds r0, r5, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r5, 0x1C] - mov r0, r8 - strh r0, [r5, 0x26] - b _0818030A - .pool -_08180258: - movs r1, 0x32 - ldrsh r0, [r5, r1] - lsls r0, 7 - movs r1, 0x28 - bl __divsi3 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r6, 0 - subs r0, 0xA - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x13 - bhi _0818027E - ldrh r0, [r5, 0x3C] - adds r0, 0x33 - strh r0, [r5, 0x3C] - movs r7, 0xFF - ands r7, r0 -_0818027E: - movs r2, 0x30 - ldrsh r0, [r5, r2] - cmp r0, 0 - bne _081802A0 - lsls r4, 16 - asrs r0, r4, 16 - movs r1, 0x10 - bl sine - ldr r2, =0xffffff00 - adds r1, r2, 0 - subs r1, r0 - strh r1, [r5, 0x36] - b _081802B2 - .pool -_081802A0: - lsls r4, 16 - asrs r0, r4, 16 - movs r1, 0x10 - bl sine - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - strh r0, [r5, 0x36] -_081802B2: - adds r6, r4, 0 - adds r0, r7, 0 - movs r1, 0x8 - bl sine - adds r4, r0, 0 - asrs r0, r6, 16 - movs r1, 0x28 - bl sine - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - subs r4, r1, r4 - subs r4, r0 - strh r4, [r5, 0x38] - lsls r4, 16 - asrs r4, 16 - lsls r1, 16 - asrs r1, 16 - cmp r4, r1 - beq _081802F0 - movs r2, 0x38 - ldrsh r0, [r5, r2] - subs r0, r1, r0 - cmp r0, 0 - bge _081802EA - adds r0, 0x7 -_081802EA: - lsls r0, 13 - lsrs r0, 16 - mov r8, r0 -_081802F0: - mov r1, r8 - lsls r0, r1, 16 - asrs r0, 16 - negs r0, r0 - strh r0, [r5, 0x26] - movs r2, 0x36 - ldrsh r1, [r5, r2] - movs r0, 0x38 - ldrsh r2, [r5, r0] - adds r0, r5, 0 - movs r3, 0 - bl sub_817F618 -_0818030A: - ldrh r0, [r5, 0x32] - adds r0, 0x1 - strh r0, [r5, 0x32] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_17 - - thumb_func_start sub_818031C -sub_818031C: @ 818031C - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - ldrh r0, [r4, 0x32] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrh r0, [r4, 0x3A] - lsls r0, 24 - lsrs r7, r0, 24 - ldr r2, =gUnknown_0860AA80 - movs r1, 0x38 - ldrsh r0, [r4, r1] - lsls r0, 1 - adds r1, r0, r2 - ldrb r5, [r1] - adds r2, 0x1 - adds r0, r2 - ldrb r6, [r0] - movs r1, 0 - cmp r5, 0xFE - beq _08180358 - subs r0, r6, r7 - muls r0, r5 - adds r1, r6, 0 - bl __divsi3 - lsls r0, 24 - lsrs r1, r0, 24 -_08180358: - cmp r5, 0xFF - bne _08180370 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x26] - b _08180394 - .pool -_08180370: - mov r0, r8 - bl sine - strh r0, [r4, 0x26] - cmp r7, r6 - bne _08180386 - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - movs r0, 0 - b _08180392 -_08180386: - ldrh r0, [r4, 0x2E] - ldrh r1, [r4, 0x32] - adds r0, r1 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x3A] - adds r0, 0x1 -_08180392: - strh r0, [r4, 0x3A] -_08180394: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_818031C - - thumb_func_start pokemonanimfunc_19 -pokemonanimfunc_19: @ 81803A0 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x30 - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl sub_818031C - ldr r0, =sub_818031C - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_19 - - thumb_func_start pokemonanimfunc_1A -pokemonanimfunc_1A: @ 81803BC - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - bl sub_817F70C - ldrh r0, [r4, 0x32] - lsls r7, r0, 24 - lsrs r5, r7, 24 - mov r8, r5 - cmp r0, 0 - bne _081803DA - adds r0, r4, 0 - bl sub_817F670 -_081803DA: - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x23 - ble _08180404 - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x24] - b _0818045E - .pool -_08180404: - adds r6, r5, 0 - subs r6, 0xA - lsls r0, r6, 7 - movs r1, 0x14 - bl __divsi3 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r5, 0x9 - bhi _0818042A - movs r2, 0x80 - lsls r2, 1 - lsrs r3, r7, 25 - lsls r3, 9 - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_817F6D4 - b _0818045E -_0818042A: - lsls r0, r6, 24 - lsrs r0, 24 - cmp r0, 0x13 - bhi _08180442 - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x5 - bl sine - negs r0, r0 - strh r0, [r4, 0x24] - b _0818045E -_08180442: - movs r2, 0x80 - lsls r2, 1 - movs r3, 0x23 - mov r0, r8 - subs r3, r0 - lsrs r0, r3, 31 - adds r3, r0 - asrs r3, 1 - lsls r3, 26 - lsrs r3, 16 - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_817F6D4 -_0818045E: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - adds r0, r4, 0 - bl sub_817F70C - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_1A - - thumb_func_start pokemonanimfunc_1B -pokemonanimfunc_1B: @ 8180474 - push {r4-r6,lr} - adds r6, r0, 0 - movs r1, 0x32 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _08180486 - adds r0, r6, 0 - bl sub_817F670 -_08180486: - movs r1, 0x32 - ldrsh r0, [r6, r1] - cmp r0, 0x64 - ble _081804B0 - movs r2, 0x80 - lsls r2, 1 - adds r0, r6, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - movs r0, 0 - strh r0, [r6, 0x26] - adds r0, r6, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r6, 0x1C] - b _081804E8 - .pool -_081804B0: - movs r1, 0x32 - ldrsh r0, [r6, r1] - lsls r0, 8 - movs r1, 0x64 - bl __divsi3 - adds r4, r0, 0 - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 - movs r1, 0xA - bl sine - strh r0, [r6, 0x26] - movs r5, 0x80 - lsls r5, 1 - ldr r1, =0x00000ccc - adds r0, r4, 0 - bl sine - adds r3, r0, 0 - lsls r3, 16 - lsrs r3, 16 - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r5, 0 - bl sub_817F6D4 -_081804E8: - ldrh r0, [r6, 0x32] - adds r0, 0x1 - strh r0, [r6, 0x32] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_1B - - thumb_func_start sub_81804F8 -sub_81804F8: @ 81804F8 - push {r4-r6,lr} - adds r6, r0, 0 - movs r5, 0 - movs r1, 0x32 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0818050C - adds r0, r6, 0 - bl sub_817F670 -_0818050C: - movs r1, 0x32 - ldrsh r0, [r6, r1] - cmp r0, 0x64 - ble _08180534 - movs r2, 0x80 - lsls r2, 1 - adds r0, r6, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - strh r5, [r6, 0x26] - adds r0, r6, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r6, 0x1C] - b _08180582 - .pool -_08180534: - movs r0, 0x32 - ldrsh r5, [r6, r0] - lsls r0, r5, 8 - movs r1, 0x64 - bl __divsi3 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 9 - adds r0, r5, 0 - movs r1, 0x64 - bl __divsi3 - adds r5, r0, 0 - movs r0, 0xFF - ands r5, r0 - lsls r4, 16 - asrs r4, 16 - movs r0, 0x2E - ldrsh r1, [r6, r0] - adds r0, r4, 0 - bl sine - strh r0, [r6, 0x26] - movs r4, 0x80 - lsls r4, 1 - adds r0, r5, 0 - ldr r1, =0x00000ccc - bl sine - adds r3, r0, 0 - lsls r3, 16 - lsrs r3, 16 - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r4, 0 - bl sub_817F6D4 -_08180582: - ldrh r0, [r6, 0x32] - adds r0, 0x1 - strh r0, [r6, 0x32] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81804F8 - - thumb_func_start pokemonanimfunc_1C -pokemonanimfunc_1C: @ 8180594 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0xA - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl sub_81804F8 - ldr r0, =sub_81804F8 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_1C - - thumb_func_start sub_81805B0 -sub_81805B0: @ 81805B0 - push {r4-r6,lr} - adds r6, r0, 0 - movs r5, 0 - movs r1, 0x32 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _081805C4 - adds r0, r6, 0 - bl sub_817F670 -_081805C4: - movs r2, 0x32 - ldrsh r0, [r6, r2] - cmp r0, 0x64 - ble _081805EC - movs r2, 0x80 - lsls r2, 1 - adds r0, r6, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - strh r5, [r6, 0x26] - adds r0, r6, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r6, 0x1C] - b _08180644 - .pool -_081805EC: - movs r0, 0x32 - ldrsh r5, [r6, r0] - lsls r0, r5, 8 - movs r1, 0x64 - bl __divsi3 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 9 - adds r0, r5, 0 - movs r1, 0x64 - bl __divsi3 - adds r5, r0, 0 - movs r0, 0xFF - ands r5, r0 - lsls r4, 16 - asrs r0, r4, 16 - lsrs r4, 31 - adds r0, r4 - asrs r0, 1 - movs r2, 0x2E - ldrsh r1, [r6, r2] - lsls r1, 17 - asrs r1, 16 - bl sine - negs r0, r0 - strh r0, [r6, 0x26] - movs r4, 0x80 - lsls r4, 1 - adds r0, r5, 0 - ldr r1, =0x00000ccc - bl sine - adds r3, r0, 0 - lsls r3, 16 - lsrs r3, 16 - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r4, 0 - bl sub_817F6D4 -_08180644: - ldrh r0, [r6, 0x32] - adds r0, 0x1 - strh r0, [r6, 0x32] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81805B0 - - thumb_func_start pokemonanimfunc_18 -pokemonanimfunc_18: @ 8180654 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x5 - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl sub_81805B0 - ldr r0, =sub_81805B0 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_18 - - thumb_func_start pokemonanimfunc_1D -pokemonanimfunc_1D: @ 8180670 - push {r4-r6,lr} - adds r6, r0, 0 - bl sub_817F70C - movs r5, 0 - movs r1, 0x32 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _08180688 - adds r0, r6, 0 - bl sub_817F670 -_08180688: - movs r1, 0x32 - ldrsh r0, [r6, r1] - cmp r0, 0x64 - ble _081806B0 - movs r2, 0x80 - lsls r2, 1 - adds r0, r6, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - strh r5, [r6, 0x24] - adds r0, r6, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r6, 0x1C] - b _081806FC - .pool -_081806B0: - movs r0, 0x32 - ldrsh r5, [r6, r0] - lsls r0, r5, 8 - movs r1, 0x64 - bl __divsi3 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r5, 9 - adds r0, r5, 0 - movs r1, 0x64 - bl __divsi3 - adds r5, r0, 0 - movs r0, 0xFF - ands r5, r0 - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 - movs r1, 0x8 - bl sine - strh r0, [r6, 0x24] - movs r4, 0x80 - lsls r4, 1 - adds r0, r5, 0 - ldr r1, =0x00000ccc - bl sine - adds r3, r0, 0 - lsls r3, 16 - lsrs r3, 16 - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r4, 0 - bl sub_817F6D4 -_081806FC: - ldrh r0, [r6, 0x32] - adds r0, 0x1 - strh r0, [r6, 0x32] - adds r0, r6, 0 - bl sub_817F70C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_1D - - thumb_func_start sub_8180714 -sub_8180714: @ 8180714 - push {r4-r6,lr} - adds r4, r0, 0 - movs r6, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0818072A - adds r0, r4, 0 - bl sub_817F670 - strh r6, [r4, 0x34] -_0818072A: - adds r0, r4, 0 - bl sub_817F70C - movs r0, 0x32 - ldrsh r2, [r4, r0] - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r0, r1 - cmp r2, r0 - ble _08180760 - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - strh r6, [r4, 0x26] - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _081807FE - .pool -_08180760: - movs r1, 0x36 - ldrsh r0, [r4, r1] - movs r1, 0x20 - bl sine - movs r2, 0x80 - lsls r2, 1 - adds r0, r2 - lsls r0, 16 - lsrs r5, r0, 16 - movs r0, 0x32 - ldrsh r1, [r4, r0] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r1, r0 - ble _08180796 - adds r2, r0, 0 - lsls r0, r2, 1 - cmp r1, r0 - bge _08180796 - movs r0, 0x80 - adds r1, r2, 0 - bl __divsi3 - ldrh r1, [r4, 0x34] - adds r1, r0 - strh r1, [r4, 0x34] -_08180796: - lsls r0, r5, 16 - asrs r1, r0, 16 - movs r2, 0x80 - lsls r2, 1 - adds r5, r0, 0 - cmp r1, r2 - ble _081807B0 - subs r0, r2, r1 - cmp r0, 0 - bge _081807AC - adds r0, 0x7 -_081807AC: - lsls r0, 13 - lsrs r6, r0, 16 -_081807B0: - movs r1, 0x34 - ldrsh r0, [r4, r1] - movs r1, 0xA - bl sine - negs r0, r0 - lsls r1, r6, 16 - asrs r1, 16 - subs r0, r1 - strh r0, [r4, 0x26] - movs r2, 0x36 - ldrsh r0, [r4, r2] - movs r1, 0x20 - bl sine - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - asrs r2, r5, 16 - adds r0, r4, 0 - movs r3, 0 - bl sub_817F6D4 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - movs r0, 0x2E - ldrsh r1, [r4, r0] - movs r0, 0x80 - bl __divsi3 - ldrh r1, [r4, 0x36] - adds r1, r0 - movs r0, 0xFF - ands r1, r0 - strh r1, [r4, 0x36] -_081807FE: - adds r0, r4, 0 - bl sub_817F70C - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8180714 - - thumb_func_start pokemonanimfunc_00 -pokemonanimfunc_00: @ 818080C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x10 - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl sub_8180714 - ldr r0, =sub_8180714 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_00 - - thumb_func_start sub_8180828 -sub_8180828: @ 8180828 - push {r4-r6,lr} - adds r5, r0, 0 - movs r6, 0 - movs r0, 0x32 - ldrsh r4, [r5, r0] - movs r2, 0x3A - ldrsh r1, [r5, r2] - movs r0, 0x80 - bl __divsi3 - movs r2, 0x3C - ldrsh r1, [r5, r2] - muls r0, r1 - cmp r4, r0 - ble _08180868 - movs r2, 0x80 - lsls r2, 1 - adds r0, r5, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - strh r6, [r5, 0x26] - adds r0, r5, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r5, 0x1C] - b _081808D0 - .pool -_08180868: - movs r1, 0x36 - ldrsh r0, [r5, r1] - movs r1, 0x20 - bl sine - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - adds r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - cmp r0, r1 - ble _08180894 - subs r0, r1, r0 - cmp r0, 0 - bge _08180890 - adds r0, 0x7 -_08180890: - lsls r0, 13 - lsrs r6, r0, 16 -_08180894: - lsls r0, r6, 16 - asrs r0, 16 - negs r0, r0 - strh r0, [r5, 0x26] - movs r1, 0x36 - ldrsh r0, [r5, r1] - movs r1, 0x30 - bl sine - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 1 - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - lsls r2, r4, 16 - asrs r2, 16 - adds r0, r5, 0 - movs r3, 0 - bl sub_817F6D4 - ldrh r0, [r5, 0x32] - adds r0, 0x1 - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x3A] - ldrh r1, [r5, 0x36] - adds r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r5, 0x36] -_081808D0: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8180828 - - thumb_func_start pokemonanimfunc_13 -pokemonanimfunc_13: @ 81808D8 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081808F2 - adds r0, r4, 0 - bl sub_817F670 - movs r0, 0x3 - strh r0, [r4, 0x3C] - movs r0, 0x8 - strh r0, [r4, 0x3A] -_081808F2: - adds r0, r4, 0 - bl sub_8180828 - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_13 - - thumb_func_start sub_8180900 -sub_8180900: @ 8180900 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r4, r0, 0 - bl sub_817F70C - ldrh r1, [r4, 0x2E] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =0x03001240 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x6] - str r1, [sp] - ldr r5, =gUnknown_0860AD8E - movs r3, 0x36 - ldrsh r2, [r4, r3] - lsls r1, r2, 1 - adds r1, r2 - movs r3, 0x8 - ldrsh r2, [r0, r3] - lsls r0, r2, 1 - adds r0, r2 - lsls r6, r0, 3 - adds r1, r6 - adds r2, r1, r5 - adds r0, r5, 0x1 - adds r1, r0 - movs r0, 0 - ldrsb r0, [r1, r0] - ldrb r2, [r2] - lsls r2, 24 - asrs r2, 24 - mov r9, r2 - subs r0, r2 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - ldrh r7, [r4, 0x34] - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0818096C - adds r0, r4, 0 - bl sub_817F670 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] -_0818096C: - movs r2, 0x36 - ldrsh r1, [r4, r2] - lsls r0, r1, 1 - adds r0, r1 - adds r0, r6 - adds r5, 0x2 - mov r8, r5 - adds r1, r0, r5 - movs r5, 0 - ldrsb r5, [r1, r5] - cmp r5, 0 - bne _081809B0 - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - strh r5, [r4, 0x24] - strh r5, [r4, 0x26] - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _08180A3A - .pool -_081809B0: - lsls r0, r7, 16 - asrs r5, r0, 16 - lsls r0, r5, 7 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - bl __divsi3 - lsls r0, 16 - asrs r0, 16 - movs r1, 0xA - bl sine - negs r0, r0 - strh r0, [r4, 0x26] - mov r3, r10 - lsls r0, r3, 16 - asrs r0, 16 - muls r0, r5 - movs r1, 0x36 - ldrsh r2, [r4, r1] - lsls r1, r2, 1 - adds r1, r2 - adds r1, r6 - add r1, r8 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - bl __divsi3 - add r0, r9 - strh r0, [r4, 0x24] - ldr r2, [sp] - lsls r0, r2, 16 - asrs r0, 16 - movs r3, 0x24 - ldrsh r1, [r4, r3] - muls r0, r1 - negs r0, r0 - cmp r0, 0 - bge _08180A04 - adds r0, 0x7 -_08180A04: - lsls r3, r0, 13 - lsrs r3, 16 - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_817F6D4 - movs r0, 0x36 - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r0, r1 - adds r0, r6 - add r0, r8 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r5, r0 - bne _08180A34 - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] - movs r0, 0 - b _08180A38 -_08180A34: - ldrh r0, [r4, 0x34] - adds r0, 0x1 -_08180A38: - strh r0, [r4, 0x34] -_08180A3A: - adds r0, r4, 0 - bl sub_817F70C - 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_8180900 - - thumb_func_start pokemonanimfunc_05 -pokemonanimfunc_05: @ 8180A50 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x80 - lsls r0, 5 - strh r0, [r1, 0x6] - ldrh r0, [r4, 0x3A] - strh r0, [r1, 0x8] - adds r0, r4, 0 - bl sub_8180900 - ldr r0, =sub_8180900 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_05 - - thumb_func_start pokemonanimfunc_20 -pokemonanimfunc_20: @ 8180A8C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08180AA8 - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - adds r0, r1 - strh r0, [r4, 0x3C] -_08180AA8: - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x80 - ble _08180ACC - ldrh r0, [r4, 0x3C] - ldr r3, =0x000002df - movs r1, 0x10 - movs r2, 0 - bl pal_fade_1 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _08180AE8 - .pool -_08180ACC: - movs r2, 0x32 - ldrsh r0, [r4, r2] - movs r1, 0xC - bl sine - adds r2, r0, 0 - strh r2, [r4, 0x3A] - ldrh r0, [r4, 0x3C] - lsls r2, 24 - lsrs r2, 24 - ldr r3, =0x000002df - movs r1, 0x10 - bl pal_fade_1 -_08180AE8: - ldrh r0, [r4, 0x32] - adds r0, 0x2 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_20 - - thumb_func_start pokemonanimfunc_21 -pokemonanimfunc_21: @ 8180AF8 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08180B14 - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - adds r0, r1 - strh r0, [r4, 0x3C] -_08180B14: - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x80 - ble _08180B34 - ldrh r0, [r4, 0x3C] - movs r1, 0x10 - movs r2, 0 - movs r3, 0x1F - bl pal_fade_1 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _08180B50 - .pool -_08180B34: - movs r2, 0x32 - ldrsh r0, [r4, r2] - movs r1, 0xC - bl sine - adds r2, r0, 0 - strh r2, [r4, 0x3A] - ldrh r0, [r4, 0x3C] - lsls r2, 24 - lsrs r2, 24 - movs r1, 0x10 - movs r3, 0x1F - bl pal_fade_1 -_08180B50: - ldrh r0, [r4, 0x32] - adds r0, 0x2 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_21 - - thumb_func_start pokemonanimfunc_22 -pokemonanimfunc_22: @ 8180B5C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08180B78 - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - adds r0, r1 - strh r0, [r4, 0x3C] -_08180B78: - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x80 - ble _08180B98 - ldrh r0, [r4, 0x3C] - movs r3, 0xF8 - lsls r3, 7 - movs r1, 0x10 - movs r2, 0 - bl pal_fade_1 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _08180BB6 - .pool -_08180B98: - movs r2, 0x32 - ldrsh r0, [r4, r2] - movs r1, 0xC - bl sine - adds r2, r0, 0 - strh r2, [r4, 0x3A] - ldrh r0, [r4, 0x3C] - lsls r2, 24 - lsrs r2, 24 - movs r3, 0xF8 - lsls r3, 7 - movs r1, 0x10 - bl pal_fade_1 -_08180BB6: - ldrh r0, [r4, 0x32] - adds r0, 0x2 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_22 - - thumb_func_start pokemonanimfunc_23 -pokemonanimfunc_23: @ 8180BC4 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08180BE0 - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - adds r0, r1 - strh r0, [r4, 0x3C] -_08180BE0: - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x80 - ble _08180C04 - ldrh r0, [r4, 0x3C] - ldr r3, =0x000003ff - movs r1, 0x10 - movs r2, 0 - bl pal_fade_1 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _08180C20 - .pool -_08180C04: - movs r2, 0x32 - ldrsh r0, [r4, r2] - movs r1, 0xC - bl sine - adds r2, r0, 0 - strh r2, [r4, 0x3A] - ldrh r0, [r4, 0x3C] - lsls r2, 24 - lsrs r2, 24 - ldr r3, =0x000003ff - movs r1, 0x10 - bl pal_fade_1 -_08180C20: - ldrh r0, [r4, 0x32] - adds r0, 0x2 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_23 - - thumb_func_start pokemonanimfunc_24 -pokemonanimfunc_24: @ 8180C30 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08180C4C - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - adds r0, r1 - strh r0, [r4, 0x3C] -_08180C4C: - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x80 - ble _08180C70 - ldrh r0, [r4, 0x3C] - ldr r3, =0x00006018 - movs r1, 0x10 - movs r2, 0 - bl pal_fade_1 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _08180C8C - .pool -_08180C70: - movs r2, 0x32 - ldrsh r0, [r4, r2] - movs r1, 0xC - bl sine - adds r2, r0, 0 - strh r2, [r4, 0x3A] - ldrh r0, [r4, 0x3C] - lsls r2, 24 - lsrs r2, 24 - ldr r3, =0x00006018 - movs r1, 0x10 - bl pal_fade_1 -_08180C8C: - ldrh r0, [r4, 0x32] - adds r0, 0x2 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_24 - - thumb_func_start pokemonanimfunc_25 -pokemonanimfunc_25: @ 8180C9C - push {r4,lr} - adds r4, r0, 0 - bl sub_817F670 - ldr r0, =sub_8180CB4 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_25 - - thumb_func_start sub_8180CB4 -sub_8180CB4: @ 8180CB4 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r0, [r4, 0x24] - adds r0, 0x1 - strh r0, [r4, 0x24] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _08180CD6 - movs r0, 0x8 - strh r0, [r4, 0x24] - movs r0, 0x2 - strh r0, [r4, 0x3C] - ldr r0, =sub_8180CE8 - str r0, [r4, 0x1C] -_08180CD6: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8180CB4 - - thumb_func_start sub_8180CE8 -sub_8180CE8: @ 8180CE8 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r1, [r4, 0x24] - ldrh r0, [r4, 0x3C] - subs r1, r0 - strh r1, [r4, 0x24] - adds r0, 0x1 - adds r2, r0, 0 - strh r0, [r4, 0x3C] - lsls r1, 16 - cmp r1, 0 - bgt _08180D32 - lsls r0, r2, 24 - lsrs r2, r0, 24 - movs r0, 0 - strh r0, [r4, 0x3A] - ldrh r1, [r4, 0x24] - ldr r5, =sub_8180D44 - movs r3, 0x8 - negs r3, r3 -_08180D14: - subs r0, r1, r2 - lsls r0, 16 - ldrh r1, [r4, 0x3A] - adds r1, 0x1 - strh r1, [r4, 0x3A] - adds r1, r2, 0x1 - lsls r1, 24 - lsrs r2, r1, 24 - lsrs r1, r0, 16 - asrs r0, 16 - cmp r0, r3 - bgt _08180D14 - movs r0, 0x1 - strh r0, [r4, 0x38] - str r5, [r4, 0x1C] -_08180D32: - adds r0, r4, 0 - bl sub_817F70C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8180CE8 - - thumb_func_start sub_8180D44 -sub_8180D44: @ 8180D44 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x3C] - subs r0, r1 - strh r0, [r4, 0x24] - adds r1, 0x1 - strh r1, [r4, 0x3C] - movs r0, 0x38 - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 1 - movs r2, 0x3A - ldrsh r1, [r4, r2] - bl __divsi3 - lsls r0, 24 - lsrs r5, r0, 24 - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - lsls r0, 16 - asrs r0, 16 - ldrh r2, [r4, 0x3A] - movs r3, 0x3A - ldrsh r1, [r4, r3] - cmp r0, r1 - ble _08180D84 - strh r2, [r4, 0x38] -_08180D84: - movs r2, 0x80 - lsls r2, 1 - lsls r3, r5, 8 - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_817F6D4 - movs r1, 0x24 - ldrsh r0, [r4, r1] - movs r1, 0x8 - negs r1, r1 - cmp r0, r1 - bge _08180DAE - strh r1, [r4, 0x24] - movs r0, 0x2 - strh r0, [r4, 0x36] - movs r0, 0 - strh r0, [r4, 0x34] - strh r5, [r4, 0x32] - ldr r0, =sub_8180DC0 - str r0, [r4, 0x1C] -_08180DAE: - adds r0, r4, 0 - bl sub_817F70C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8180D44 - - thumb_func_start sub_8180DC0 -sub_8180DC0: @ 8180DC0 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r1, [r4, 0x34] - movs r2, 0x34 - ldrsh r0, [r4, r2] - cmp r0, 0xB - ble _08180E08 - ldrh r0, [r4, 0x32] - subs r0, 0x2 - strh r0, [r4, 0x32] - lsls r0, 16 - cmp r0, 0 - bge _08180DE2 - movs r0, 0 - strh r0, [r4, 0x32] -_08180DE2: - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0x32] - lsls r3, 24 - lsrs r3, 16 - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_817F6D4 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08180E1C - ldr r0, =sub_8180E28 - str r0, [r4, 0x1C] - b _08180E1C - .pool -_08180E08: - ldrh r0, [r4, 0x36] - ldrh r2, [r4, 0x24] - adds r0, r2 - strh r0, [r4, 0x24] - movs r2, 0x36 - ldrsh r0, [r4, r2] - negs r0, r0 - strh r0, [r4, 0x36] - adds r0, r1, 0x1 - strh r0, [r4, 0x34] -_08180E1C: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8180DC0 - - thumb_func_start sub_8180E28 -sub_8180E28: @ 8180E28 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r0, [r4, 0x24] - adds r0, 0x2 - strh r0, [r4, 0x24] - lsls r0, 16 - cmp r0, 0 - ble _08180E4A - movs r0, 0 - strh r0, [r4, 0x24] - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] -_08180E4A: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8180E28 - - thumb_func_start pokemonanimfunc_26 -pokemonanimfunc_26: @ 8180E5C - push {r4,lr} - adds r4, r0, 0 - bl sub_817F670 - movs r0, 0 - strh r0, [r4, 0x34] - ldr r0, =sub_8180E78 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_26 - - thumb_func_start sub_8180E78 -sub_8180E78: @ 8180E78 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r0, [r4, 0x24] - adds r0, 0x1 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x26] - subs r0, 0x1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x24] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08180EA2 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - bgt _08180EA2 - movs r0, 0xA - strh r0, [r4, 0x34] -_08180EA2: - movs r1, 0x24 - ldrsh r0, [r4, r1] - cmp r0, 0x7 - ble _08180EBA - movs r1, 0 - movs r0, 0x8 - strh r0, [r4, 0x24] - ldr r0, =0x0000fff8 - strh r0, [r4, 0x26] - strh r1, [r4, 0x36] - ldr r0, =sub_8180ED0 - str r0, [r4, 0x1C] -_08180EBA: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8180E78 - - thumb_func_start sub_8180ED0 -sub_8180ED0: @ 8180ED0 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r1, 0x36 - ldrsh r0, [r4, r1] - movs r1, 0x10 - bl cosine - subs r0, 0x8 - strh r0, [r4, 0x24] - movs r1, 0x36 - ldrsh r0, [r4, r1] - movs r1, 0x10 - bl sine - subs r0, 0x8 - strh r0, [r4, 0x26] - movs r1, 0x36 - ldrsh r0, [r4, r1] - cmp r0, 0x3F - ble _08180F08 - movs r0, 0xA0 - strh r0, [r4, 0x32] - movs r0, 0xA - strh r0, [r4, 0x34] - ldr r0, =sub_8180F2C - str r0, [r4, 0x1C] -_08180F08: - ldrh r0, [r4, 0x36] - adds r0, 0x8 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x40 - ble _08180F1A - movs r0, 0x40 - strh r0, [r4, 0x36] -_08180F1A: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8180ED0 - - thumb_func_start sub_8180F2C -sub_8180F2C: @ 8180F2C - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r1, [r4, 0x34] - movs r2, 0x34 - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _08180F44 - subs r0, r1, 0x1 - strh r0, [r4, 0x34] - b _08180F96 -_08180F44: - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r1, 0x5 - bl cosine - subs r0, 0x4 - movs r5, 0 - strh r0, [r4, 0x24] - movs r2, 0x32 - ldrsh r0, [r4, r2] - movs r1, 0x5 - bl sine - negs r0, r0 - adds r0, 0x4 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - subs r0, 0x4 - strh r0, [r4, 0x32] - movs r0, 0x32 - ldrsh r3, [r4, r0] - subs r3, 0x20 - movs r2, 0x80 - lsls r2, 1 - lsls r3, 25 - lsrs r3, 16 - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_817F6D4 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x20 - bgt _08180F96 - strh r5, [r4, 0x24] - strh r5, [r4, 0x26] - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] -_08180F96: - adds r0, r4, 0 - bl sub_817F70C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8180F2C - - thumb_func_start pokemonanimfunc_27 -pokemonanimfunc_27: @ 8180FA8 - push {r4,lr} - adds r3, r0, 0 - ldrh r1, [r3, 0x34] - movs r2, 0x34 - ldrsh r0, [r3, r2] - cmp r0, 0 - ble _08180FBA - subs r0, r1, 0x1 - b _08180FFE -_08180FBA: - movs r2, 0 - movs r1, 0x36 - ldrsh r0, [r3, r1] - cmp r0, 0 - bne _08180FC6 - movs r2, 0x1 -_08180FC6: - strh r2, [r3, 0x36] - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - lsls r2, 2 - ldrb r1, [r0] - movs r4, 0x5 - negs r4, r4 - adds r0, r4, 0 - ands r0, r1 - orrs r0, r2 - mov r1, r12 - strb r0, [r1] - ldrh r0, [r3, 0x32] - adds r0, 0x1 - strh r0, [r3, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _08180FFC - ldrb r0, [r1] - adds r1, r4, 0 - ands r1, r0 - mov r2, r12 - strb r1, [r2] - ldr r0, =sub_8184D88 - str r0, [r3, 0x1C] -_08180FFC: - movs r0, 0x2 -_08180FFE: - strh r0, [r3, 0x34] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_27 - - thumb_func_start pokemonanimfunc_28 -pokemonanimfunc_28: @ 818100C - push {r4,lr} - adds r4, r0, 0 - bl sub_817F670 - ldr r0, =sub_8181024 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_28 - - thumb_func_start sub_8181024 -sub_8181024: @ 8181024 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r0, [r4, 0x24] - subs r0, 0x1 - strh r0, [r4, 0x24] - ldrh r1, [r4, 0x26] - adds r1, 0x1 - strh r1, [r4, 0x26] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x10 - negs r1, r1 - cmp r0, r1 - bgt _08181054 - ldr r0, =0x0000fff0 - strh r0, [r4, 0x24] - movs r0, 0x10 - strh r0, [r4, 0x26] - ldr r0, =sub_8181068 - str r0, [r4, 0x1C] - movs r0, 0xA0 - strh r0, [r4, 0x32] -_08181054: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8181024 - - thumb_func_start sub_8181068 -sub_8181068: @ 8181068 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r0, [r4, 0x32] - subs r0, 0x4 - strh r0, [r4, 0x32] - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r1, 0x16 - bl cosine - strh r0, [r4, 0x24] - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r1, 0x16 - bl sine - negs r0, r0 - strh r0, [r4, 0x26] - movs r0, 0x32 - ldrsh r3, [r4, r0] - subs r3, 0x20 - movs r2, 0x80 - lsls r2, 1 - lsls r3, 25 - lsrs r3, 16 - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_817F6D4 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x20 - bgt _081810B2 - ldr r0, =sub_81810C4 - str r0, [r4, 0x1C] -_081810B2: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8181068 - - thumb_func_start sub_81810C4 -sub_81810C4: @ 81810C4 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r1, [r4, 0x24] - subs r1, 0x1 - strh r1, [r4, 0x24] - ldrh r0, [r4, 0x26] - adds r0, 0x1 - strh r0, [r4, 0x26] - lsls r1, 16 - cmp r1, 0 - bgt _081810E8 - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] -_081810E8: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81810C4 - - thumb_func_start pokemonanimfunc_29 -pokemonanimfunc_29: @ 81810F8 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F670 - ldr r0, =sub_8181110 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_29 - - thumb_func_start sub_8181110 -sub_8181110: @ 8181110 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r1, [r4, 0x24] - adds r1, 0x1 - strh r1, [r4, 0x24] - ldrh r0, [r4, 0x26] - subs r0, 0x1 - strh r0, [r4, 0x26] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0xF - ble _08181134 - movs r0, 0 - strh r0, [r4, 0x32] - ldr r0, =sub_8181144 - str r0, [r4, 0x1C] -_08181134: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8181110 - - thumb_func_start sub_8181144 -sub_8181144: @ 8181144 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r0, [r4, 0x32] - adds r0, 0x10 - strh r0, [r4, 0x32] - ldrh r2, [r4, 0x24] - movs r0, 0x24 - ldrsh r1, [r4, r0] - movs r0, 0x10 - negs r0, r0 - cmp r1, r0 - bgt _0818117C - ldr r0, =0x0000fff0 - strh r0, [r4, 0x24] - movs r0, 0x10 - strh r0, [r4, 0x26] - movs r0, 0 - strh r0, [r4, 0x32] - ldr r0, =sub_81811A4 - str r0, [r4, 0x1C] - b _08181186 - .pool -_0818117C: - subs r0, r2, 0x2 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x26] - adds r0, 0x2 - strh r0, [r4, 0x26] -_08181186: - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0x32] - lsls r3, 24 - lsrs r3, 16 - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_817F6D4 - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8181144 - - thumb_func_start sub_81811A4 -sub_81811A4: @ 81811A4 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r1, [r4, 0x24] - adds r1, 0x1 - movs r2, 0 - strh r1, [r4, 0x24] - ldrh r0, [r4, 0x26] - subs r0, 0x1 - strh r0, [r4, 0x26] - lsls r1, 16 - cmp r1, 0 - blt _081811CE - strh r2, [r4, 0x24] - strh r2, [r4, 0x26] - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] -_081811CE: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81811A4 - - thumb_func_start pokemonanimfunc_2A -pokemonanimfunc_2A: @ 81811E0 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x2 - strh r0, [r1, 0x2] - adds r0, r4, 0 - bl sub_8181214 - ldr r0, =sub_8181214 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_2A - - thumb_func_start sub_8181214 -sub_8181214: @ 8181214 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r6, =0x03001240 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r6 - ldrh r0, [r1] - cmp r0, 0 - beq _08181238 - subs r0, 0x1 - strh r0, [r1] - b _0818134A - .pool -_08181238: - adds r0, r4, 0 - bl sub_817F70C - ldrh r0, [r4, 0x32] - movs r1, 0x32 - ldrsh r5, [r4, r1] - cmp r5, 0 - bne _08181270 - adds r0, 0x1 - strh r0, [r4, 0x32] - adds r0, r4, 0 - bl sub_817F670 - movs r2, 0x2E - ldrsh r1, [r4, r2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrh r0, [r0, 0x2] - strh r0, [r4, 0x3C] - ldr r0, =0x0000ffff - strh r0, [r4, 0x34] - movs r0, 0x1 - negs r0, r0 - strh r0, [r4, 0x36] - strh r5, [r4, 0x38] - strh r5, [r4, 0x3A] -_08181270: - movs r3, 0x3C - ldrsh r1, [r4, r3] - movs r6, 0x34 - ldrsh r0, [r4, r6] - lsls r0, 1 - muls r1, r0 - ldrh r0, [r4, 0x24] - adds r1, r0 - strh r1, [r4, 0x24] - ldrh r2, [r4, 0x3C] - ldrh r0, [r4, 0x36] - adds r3, r0, 0 - muls r3, r2 - adds r0, r3, 0 - ldrh r6, [r4, 0x26] - adds r2, r0, r6 - strh r2, [r4, 0x26] - ldrh r0, [r4, 0x3A] - adds r0, 0x8 - strh r0, [r4, 0x3A] - adds r1, 0xF - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0x1E - bls _081812B8 - movs r1, 0x34 - ldrsh r0, [r4, r1] - lsls r0, 4 - strh r0, [r4, 0x24] - movs r2, 0x34 - ldrsh r0, [r4, r2] - negs r0, r0 - strh r0, [r4, 0x34] - b _081812D4 - .pool -_081812B8: - adds r0, r2, 0 - adds r0, 0xF - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1E - bls _081812DA - movs r3, 0x36 - ldrsh r0, [r4, r3] - lsls r0, 4 - strh r0, [r4, 0x26] - movs r6, 0x36 - ldrsh r0, [r4, r6] - negs r0, r0 - strh r0, [r4, 0x36] -_081812D4: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] -_081812DA: - movs r1, 0x38 - ldrsh r0, [r4, r1] - cmp r0, 0x5 - ble _08181332 - movs r2, 0x24 - ldrsh r0, [r4, r2] - cmp r0, 0 - bgt _08181332 - movs r3, 0 - strh r3, [r4, 0x24] - strh r3, [r4, 0x26] - ldr r5, =0x03001240 - movs r6, 0x2E - ldrsh r0, [r4, r6] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldrh r2, [r1, 0x4] - movs r6, 0x4 - ldrsh r0, [r1, r6] - cmp r0, 0x1 - ble _08181328 - subs r0, r2, 0x1 - strh r0, [r1, 0x4] - strh r3, [r4, 0x38] - strh r3, [r4, 0x3A] - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0xA - strh r1, [r0] - b _08181332 - .pool -_08181328: - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] -_08181332: - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0x3A] - lsls r3, 24 - lsrs r3, 16 - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_817F6D4 - adds r0, r4, 0 - bl sub_817F70C -_0818134A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8181214 - - thumb_func_start pokemonanimfunc_2B -pokemonanimfunc_2B: @ 8181354 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F670 - movs r0, 0 - strh r0, [r4, 0x3A] - strh r0, [r4, 0x3C] - ldr r0, =sub_8181370 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_2B - - thumb_func_start sub_8181370 -sub_8181370: @ 8181370 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r0, [r4, 0x3A] - adds r0, 0x4 - strh r0, [r4, 0x3A] - movs r1, 0x3A - ldrsh r0, [r4, r1] - movs r1, 0x10 - bl sine - negs r0, r0 - strh r0, [r4, 0x24] - movs r1, 0x3A - ldrsh r0, [r4, r1] - lsls r0, 1 - movs r1, 0xFF - ands r0, r1 - movs r1, 0x8 - bl sine - negs r0, r0 - strh r0, [r4, 0x26] - movs r1, 0x3A - ldrsh r0, [r4, r1] - cmp r0, 0xC0 - ble _081813BA - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _081813BA - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - b _081813D2 -_081813BA: - movs r1, 0x3A - ldrsh r0, [r4, r1] - cmp r0, 0x40 - ble _081813DE - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081813DE - ldr r1, =0xffffff00 - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 -_081813D2: - movs r3, 0 - bl sub_817F6D4 - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] -_081813DE: - movs r1, 0x3A - ldrsh r0, [r4, r1] - cmp r0, 0xFF - ble _08181404 - movs r0, 0 - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] -_08181404: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8181370 - - thumb_func_start pokemonanimfunc_2C -pokemonanimfunc_2C: @ 8181418 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - movs r2, 0 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _08181442 - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r3, 0x80 - lsls r3, 1 - adds r1, r3, 0 - adds r0, r1 - strh r0, [r4, 0x3C] - strh r2, [r4, 0x3A] - strh r2, [r4, 0x38] - strh r2, [r4, 0x36] -_08181442: - ldr r1, =gUnknown_0860AA64 - movs r2, 0x3A - ldrsh r0, [r4, r2] - lsls r2, r0, 1 - adds r0, r1, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - cmp r0, 0xFF - bne _08181464 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _081814CE - .pool -_08181464: - movs r3, 0x36 - ldrsh r0, [r4, r3] - cmp r0, 0x1 - bne _0818149A - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _08181488 - ldrh r0, [r4, 0x3C] - ldr r3, =0x000003ff - movs r1, 0x10 - movs r2, 0x10 - bl pal_fade_1 - b _08181494 - .pool -_08181488: - ldrh r0, [r4, 0x3C] - ldr r3, =0x000003ff - movs r1, 0x10 - movs r2, 0 - bl pal_fade_1 -_08181494: - movs r0, 0 - strh r0, [r4, 0x36] - ldr r1, =gUnknown_0860AA64 -_0818149A: - movs r2, 0x3A - ldrsh r0, [r4, r2] - lsls r0, 1 - adds r1, 0x1 - adds r0, r1 - ldrb r1, [r0] - movs r3, 0x38 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _081814C8 - movs r1, 0 - movs r0, 0x1 - strh r0, [r4, 0x36] - strh r1, [r4, 0x38] - ldrh r0, [r4, 0x3A] - adds r0, 0x1 - strh r0, [r4, 0x3A] - b _081814CE - .pool -_081814C8: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] -_081814CE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_2C - - thumb_func_start sub_81814D4 -sub_81814D4: @ 81814D4 - push {r4-r6,lr} - adds r6, r0, 0 - movs r1, 0x32 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _081814E6 - adds r0, r6, 0 - bl sub_817F670 -_081814E6: - adds r0, r6, 0 - bl sub_817F70C - ldr r4, =0x03001240 - movs r3, 0x2E - ldrsh r1, [r6, r3] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r2, r0, r4 - movs r0, 0x32 - ldrsh r1, [r6, r0] - movs r3, 0x8 - ldrsh r0, [r2, r3] - cmp r1, r0 - ble _0818154C - movs r2, 0x80 - lsls r2, 1 - adds r0, r6, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - movs r3, 0 - strh r3, [r6, 0x24] - movs r0, 0x2E - ldrsh r1, [r6, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r4 - ldrh r2, [r1, 0x4] - movs r4, 0x4 - ldrsh r0, [r1, r4] - cmp r0, 0x1 - ble _0818153C - subs r0, r2, 0x1 - strh r0, [r1, 0x4] - strh r3, [r6, 0x32] - b _08181588 - .pool -_0818153C: - adds r0, r6, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r6, 0x1C] - b _08181588 - .pool -_0818154C: - movs r1, 0x32 - ldrsh r0, [r6, r1] - lsls r0, 8 - movs r3, 0x8 - ldrsh r1, [r2, r3] - bl __divsi3 - adds r4, r0, 0 - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 - movs r1, 0xA - bl sine - negs r0, r0 - strh r0, [r6, 0x24] - movs r5, 0x80 - lsls r5, 1 - ldr r1, =0x00000ccc - adds r0, r4, 0 - bl sine - adds r3, r0, 0 - lsls r3, 16 - lsrs r3, 16 - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r5, 0 - bl sub_817F6D4 -_08181588: - ldrh r0, [r6, 0x32] - adds r0, 0x1 - strh r0, [r6, 0x32] - adds r0, r6, 0 - bl sub_817F70C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81814D4 - - thumb_func_start pokemonanimfunc_2D -pokemonanimfunc_2D: @ 81815A0 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x32 - strh r0, [r1, 0x8] - adds r0, r4, 0 - bl sub_81814D4 - ldr r0, =sub_81814D4 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_2D - - thumb_func_start sub_81815D4 -sub_81815D4: @ 81815D4 - push {r4-r6,lr} - adds r6, r0, 0 - movs r1, 0x32 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _081815E6 - adds r0, r6, 0 - bl sub_817F670 -_081815E6: - adds r0, r6, 0 - bl sub_817F70C - ldr r4, =0x03001240 - movs r3, 0x2E - ldrsh r1, [r6, r3] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r2, r0, r4 - movs r0, 0x32 - ldrsh r1, [r6, r0] - movs r3, 0x8 - ldrsh r0, [r2, r3] - cmp r1, r0 - ble _0818164C - movs r2, 0x80 - lsls r2, 1 - adds r0, r6, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - movs r3, 0 - strh r3, [r6, 0x24] - movs r0, 0x2E - ldrsh r1, [r6, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r4 - ldrh r2, [r1, 0x4] - movs r4, 0x4 - ldrsh r0, [r1, r4] - cmp r0, 0x1 - ble _0818163C - subs r0, r2, 0x1 - strh r0, [r1, 0x4] - strh r3, [r6, 0x32] - b _0818168A - .pool -_0818163C: - adds r0, r6, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r6, 0x1C] - b _0818168A - .pool -_0818164C: - movs r1, 0x32 - ldrsh r0, [r6, r1] - lsls r0, 8 - movs r3, 0x8 - ldrsh r1, [r2, r3] - bl __divsi3 - adds r4, r0, 0 - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 - movs r1, 0xA - bl sine - negs r0, r0 - strh r0, [r6, 0x24] - movs r5, 0x80 - lsls r5, 1 - ldr r1, =0x00000ccc - adds r0, r4, 0 - bl sine - adds r3, r0, 0 - negs r3, r3 - lsls r3, 16 - lsrs r3, 16 - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r5, 0 - bl sub_817F6D4 -_0818168A: - ldrh r0, [r6, 0x32] - adds r0, 0x1 - strh r0, [r6, 0x32] - adds r0, r6, 0 - bl sub_817F70C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81815D4 - - thumb_func_start pokemonanimfunc_2E -pokemonanimfunc_2E: @ 81816A0 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x32 - strh r0, [r1, 0x8] - adds r0, r4, 0 - bl sub_81815D4 - ldr r0, =sub_81815D4 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_2E - - thumb_func_start pokemonanimfunc_2F -pokemonanimfunc_2F: @ 81816D4 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F670 - adds r0, r4, 0 - adds r0, 0x28 - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 1 - movs r1, 0xA - bl __divsi3 - negs r0, r0 - strh r0, [r4, 0x3A] - movs r0, 0x80 - strh r0, [r4, 0x3C] - ldr r0, =sub_8181708 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_2F - - thumb_func_start sub_8181708 -sub_8181708: @ 8181708 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r0, [r4, 0x3C] - subs r0, 0x1 - strh r0, [r4, 0x3C] - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r2, 0x3A - ldrsh r1, [r4, r2] - bl cosine - ldrh r1, [r4, 0x3A] - adds r0, r1 - strh r0, [r4, 0x24] - movs r2, 0x3C - ldrsh r0, [r4, r2] - movs r2, 0x3A - ldrsh r1, [r4, r2] - bl sine - negs r0, r0 - strh r0, [r4, 0x26] - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0x3C] - subs r3, 0x80 - lsls r3, 24 - lsrs r3, 16 - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_817F6D4 - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0x78 - bgt _08181760 - movs r0, 0x78 - strh r0, [r4, 0x3C] - movs r0, 0 - strh r0, [r4, 0x34] - ldr r0, =sub_8181770 - str r0, [r4, 0x1C] -_08181760: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8181708 - - thumb_func_start sub_8181770 -sub_8181770: @ 8181770 - push {lr} - adds r1, r0, 0 - movs r2, 0x34 - ldrsh r0, [r1, r2] - cmp r0, 0x14 - bne _08181784 - ldr r0, =sub_8181794 - str r0, [r1, 0x1C] - movs r0, 0 - strh r0, [r1, 0x34] -_08181784: - ldrh r0, [r1, 0x34] - adds r0, 0x1 - strh r0, [r1, 0x34] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8181770 - - thumb_func_start sub_8181794 -sub_8181794: @ 8181794 - push {r4-r6,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r0, [r4, 0x3C] - adds r0, 0x2 - movs r6, 0 - strh r0, [r4, 0x3C] - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r2, 0x3A - ldrsh r1, [r4, r2] - bl cosine - ldrh r1, [r4, 0x3A] - adds r0, r1 - strh r0, [r4, 0x24] - movs r2, 0x3C - ldrsh r0, [r4, r2] - movs r2, 0x3A - ldrsh r1, [r4, r2] - bl sine - negs r0, r0 - strh r0, [r4, 0x26] - movs r5, 0x80 - lsls r5, 1 - ldrh r3, [r4, 0x3C] - subs r3, 0x80 - lsls r3, 24 - lsrs r3, 16 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r5, 0 - bl sub_817F6D4 - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0x7F - ble _08181800 - strh r6, [r4, 0x24] - strh r6, [r4, 0x26] - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r5, 0 - movs r3, 0 - bl sub_817F6D4 - strh r6, [r4, 0x32] - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =pokemonanimfunc_10 - str r0, [r4, 0x1C] -_08181800: - adds r0, r4, 0 - bl sub_817F70C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8181794 - - thumb_func_start sub_8181810 -sub_8181810: @ 8181810 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r4, =0x03001240 - movs r0, 0x2E - ldrsh r1, [r5, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r4 - ldrh r0, [r1] - adds r6, r0, 0 - cmp r6, 0 - beq _08181834 - subs r0, 0x1 - strh r0, [r1] - b _08181950 - .pool -_08181834: - movs r1, 0x32 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0818184A - adds r0, r5, 0 - bl sub_817F670 - strh r6, [r5, 0x36] - strh r6, [r5, 0x38] - movs r0, 0x1 - strh r0, [r5, 0x32] -_0818184A: - movs r3, 0x38 - ldrsh r0, [r5, r3] - cmp r0, 0 - bne _081818A2 - movs r1, 0x36 - ldrsh r0, [r5, r1] - movs r4, 0x80 - lsls r4, 1 - adds r1, r4, 0 - bl sine - strh r0, [r5, 0x3C] - movs r3, 0x36 - ldrsh r0, [r5, r3] - movs r1, 0x10 - bl sine - strh r0, [r5, 0x26] - movs r1, 0x36 - ldrsh r0, [r5, r1] - movs r1, 0x20 - bl sine - adds r1, r0, 0 - strh r1, [r5, 0x3A] - subs r1, r4, r1 - lsls r1, 16 - asrs r1, 16 - ldrh r2, [r5, 0x3C] - adds r2, r4 - lsls r2, 16 - asrs r2, 16 - adds r0, r5, 0 - movs r3, 0 - bl sub_817F6D4 - movs r3, 0x36 - ldrsh r0, [r5, r3] - cmp r0, 0x80 - bne _0818193A - strh r6, [r5, 0x36] - movs r0, 0x1 - strh r0, [r5, 0x38] - b _0818193A -_081818A2: - cmp r0, 0x1 - bne _0818193A - movs r1, 0x36 - ldrsh r0, [r5, r1] - movs r1, 0x20 - bl sine - strh r0, [r5, 0x3C] - movs r3, 0x36 - ldrsh r0, [r5, r3] - movs r1, 0x8 - bl sine - negs r0, r0 - strh r0, [r5, 0x26] - movs r1, 0x36 - ldrsh r0, [r5, r1] - movs r1, 0x80 - bl sine - adds r1, r0, 0 - strh r1, [r5, 0x3A] - movs r3, 0x80 - lsls r3, 1 - adds r2, r3, 0 - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - ldrh r0, [r5, 0x3C] - subs r2, r0 - lsls r2, 16 - asrs r2, 16 - adds r0, r5, 0 - movs r3, 0 - bl sub_817F6D4 - movs r1, 0x36 - ldrsh r0, [r5, r1] - cmp r0, 0x80 - bne _0818193A - movs r3, 0x2E - ldrsh r0, [r5, r3] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrh r2, [r1, 0x4] - movs r3, 0x4 - ldrsh r0, [r1, r3] - cmp r0, 0x1 - ble _08181922 - subs r0, r2, 0x1 - strh r0, [r1, 0x4] - movs r0, 0x2E - ldrsh r1, [r5, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xA - strh r1, [r0] - strh r6, [r5, 0x36] - strh r6, [r5, 0x38] - b _0818193A -_08181922: - movs r2, 0x80 - lsls r2, 1 - adds r0, r5, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - adds r0, r5, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r5, 0x1C] -_0818193A: - ldr r2, =0x03001240 - movs r3, 0x2E - ldrsh r1, [r5, r3] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x6] - ldrh r1, [r5, 0x36] - adds r0, r1 - strh r0, [r5, 0x36] -_08181950: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8181810 - - thumb_func_start pokemonanimfunc_30 -pokemonanimfunc_30: @ 8181960 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x4 - strh r0, [r1, 0x6] - adds r0, r4, 0 - bl sub_8181810 - ldr r0, =sub_8181810 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_30 - - thumb_func_start pokemonanimfunc_31 -pokemonanimfunc_31: @ 8181994 - push {r4,r5,lr} - adds r5, r0, 0 - movs r0, 0x32 - ldrsh r4, [r5, r0] - adds r0, r5, 0 - bl sub_817F70C - movs r0, 0x80 - lsls r0, 2 - cmp r4, r0 - ble _081819B8 - ldr r0, =sub_8184D88 - str r0, [r5, 0x1C] - movs r0, 0 - strh r0, [r5, 0x24] - b _08181A62 - .pool -_081819B8: - movs r1, 0x32 - ldrsh r0, [r5, r1] - cmp r0, 0 - bge _081819C2 - adds r0, 0x7F -_081819C2: - asrs r0, 7 - cmp r0, 0x1 - beq _081819F8 - cmp r0, 0x1 - bgt _081819D2 - cmp r0, 0 - beq _081819DC - b _08181A48 -_081819D2: - cmp r0, 0x2 - beq _08181A12 - cmp r0, 0x3 - beq _08181A2A - b _08181A48 -_081819DC: - adds r0, r4, 0 - cmp r4, 0 - bge _081819E4 - adds r0, 0x7F -_081819E4: - asrs r0, 7 - lsls r0, 7 - subs r0, r4, r0 - lsls r0, 3 - negs r0, r0 - cmp r0, 0 - bge _081819F4 - adds r0, 0x7F -_081819F4: - asrs r0, 7 - b _08181A46 -_081819F8: - adds r0, r4, 0 - cmp r4, 0 - bge _08181A00 - adds r0, 0x7F -_08181A00: - asrs r0, 7 - lsls r0, 7 - subs r0, r4, r0 - cmp r0, 0 - bge _08181A0C - adds r0, 0xF -_08181A0C: - asrs r0, 4 - subs r0, 0x8 - b _08181A46 -_08181A12: - adds r0, r4, 0 - cmp r4, 0 - bge _08181A1A - adds r0, 0x7F -_08181A1A: - asrs r0, 7 - lsls r0, 7 - subs r0, r4, r0 - cmp r0, 0 - bge _08181A26 - adds r0, 0xF -_08181A26: - asrs r0, 4 - b _08181A46 -_08181A2A: - adds r0, r4, 0 - cmp r4, 0 - bge _08181A32 - adds r0, 0x7F -_08181A32: - asrs r0, 7 - lsls r0, 7 - subs r0, r4, r0 - lsls r0, 3 - negs r0, r0 - cmp r0, 0 - bge _08181A42 - adds r0, 0x7F -_08181A42: - asrs r0, 7 - adds r0, 0x8 -_08181A46: - strh r0, [r5, 0x24] -_08181A48: - adds r0, r4, 0 - cmp r4, 0 - bge _08181A50 - adds r0, 0x7F -_08181A50: - asrs r0, 7 - lsls r0, 7 - subs r0, r4, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x8 - bl sine - negs r0, r0 -_08181A62: - strh r0, [r5, 0x26] - ldrh r0, [r5, 0x32] - adds r0, 0xC - strh r0, [r5, 0x32] - adds r0, r5, 0 - bl sub_817F70C - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_31 - - thumb_func_start pokemonanimfunc_32 -pokemonanimfunc_32: @ 8181A78 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldr r0, =0x0000ffff - strh r0, [r1, 0x8] - adds r0, r4, 0 - bl sub_817F670 - strh r5, [r4, 0x34] - adds r0, r4, 0 - bl sub_8181ABC - ldr r0, =sub_8181ABC - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_32 - - thumb_func_start sub_8181ABC -sub_8181ABC: @ 8181ABC - push {r4-r6,lr} - adds r4, r0, 0 - ldr r6, =0x03001240 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r6 - ldrh r0, [r1] - adds r5, r0, 0 - cmp r5, 0 - beq _08181AE0 - subs r0, 0x1 - strh r0, [r1] - b _08181B44 - .pool -_08181AE0: - adds r0, r4, 0 - bl sub_817F70C - movs r1, 0x32 - ldrsh r2, [r4, r1] - adds r0, r2, 0 - cmp r0, 0x80 - ble _08181AFC - strh r5, [r4, 0x32] - ldr r0, =sub_8181B4C - str r0, [r4, 0x1C] - b _08181B3E - .pool -_08181AFC: - movs r1, 0x2E - ldrsh r0, [r4, r1] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - movs r3, 0x8 - ldrsh r0, [r1, r3] - lsls r3, r0, 3 - adds r0, r2, 0 - cmp r2, 0 - bge _08181B16 - adds r0, 0x7F -_08181B16: - asrs r0, 7 - lsls r0, 7 - subs r1, r2, r0 - adds r0, r3, 0 - muls r0, r1 - cmp r0, 0 - bge _08181B26 - adds r0, 0x7F -_08181B26: - asrs r0, 7 - strh r0, [r4, 0x24] - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x8 - bl sine - negs r0, r0 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0xC - strh r0, [r4, 0x32] -_08181B3E: - adds r0, r4, 0 - bl sub_817F70C -_08181B44: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8181ABC - - thumb_func_start sub_8181B4C -sub_8181B4C: @ 8181B4C - push {r4-r6,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x30 - ble _08181B7C - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - movs r0, 0 - strh r0, [r4, 0x26] - strh r0, [r4, 0x32] - ldr r0, =sub_8181C2C - str r0, [r4, 0x1C] - b _08181C1A - .pool -_08181B7C: - movs r2, 0x36 - ldrsh r0, [r4, r2] - movs r1, 0x40 - bl sine - movs r1, 0x80 - lsls r1, 1 - adds r6, r1, 0 - adds r0, r6 - lsls r0, 16 - lsrs r3, r0, 16 - ldrh r0, [r4, 0x32] - subs r0, 0x10 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xF - bhi _08181BBA - ldrh r0, [r4, 0x34] - adds r0, 0x8 - strh r0, [r4, 0x34] - ldr r2, =0x03001240 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r4, 0x24] - ldrh r0, [r0, 0x8] - subs r1, r0 - strh r1, [r4, 0x24] -_08181BBA: - movs r5, 0 - lsls r1, r3, 16 - asrs r2, r1, 16 - lsls r0, r6, 16 - asrs r0, 16 - adds r6, r1, 0 - cmp r2, r0 - ble _08181BD6 - subs r0, r2 - cmp r0, 0 - bge _08181BD2 - adds r0, 0x7 -_08181BD2: - lsls r0, 13 - lsrs r5, r0, 16 -_08181BD6: - movs r1, 0x34 - ldrsh r0, [r4, r1] - movs r1, 0x14 - bl sine - negs r0, r0 - lsls r1, r5, 16 - asrs r1, 16 - subs r0, r1 - strh r0, [r4, 0x26] - movs r2, 0x36 - ldrsh r0, [r4, r2] - movs r1, 0x20 - bl sine - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - asrs r2, r6, 16 - adds r0, r4, 0 - movs r3, 0 - bl sub_817F6D4 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x36] - adds r0, 0x8 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x36] -_08181C1A: - adds r0, r4, 0 - bl sub_817F70C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8181B4C - - thumb_func_start sub_8181C2C -sub_8181C2C: @ 8181C2C - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r0, 0x32 - ldrsh r3, [r4, r0] - cmp r3, 0x80 - ble _08181C90 - ldr r3, =0x03001240 - movs r1, 0x2E - ldrsh r0, [r4, r1] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r2, [r1, 0x4] - movs r5, 0x4 - ldrsh r0, [r1, r5] - cmp r0, 0x1 - ble _08181C7C - subs r0, r2, 0x1 - movs r2, 0 - strh r0, [r1, 0x4] - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0xA - strh r1, [r0] - strh r2, [r4, 0x34] - strh r2, [r4, 0x32] - strh r2, [r4, 0x36] - ldr r0, =sub_8181ABC - b _08181C84 - .pool -_08181C7C: - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 -_08181C84: - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x24] - b _08181CD0 - .pool -_08181C90: - ldr r2, =0x03001240 - movs r5, 0x2E - ldrsh r1, [r4, r5] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x8 - ldrsh r5, [r0, r1] - lsls r1, r5, 3 - adds r0, r3, 0 - cmp r3, 0 - bge _08181CAC - adds r0, 0x7F -_08181CAC: - asrs r0, 7 - lsls r0, 7 - subs r2, r3, r0 - adds r0, r1, 0 - muls r0, r2 - cmp r0, 0 - bge _08181CBC - adds r0, 0x7F -_08181CBC: - asrs r0, 7 - lsls r1, r5, 3 - subs r0, r1 - strh r0, [r4, 0x24] - lsls r0, r2, 16 - asrs r0, 16 - movs r1, 0x8 - bl sine - negs r0, r0 -_08181CD0: - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0xC - strh r0, [r4, 0x32] - adds r0, r4, 0 - bl sub_817F70C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8181C2C - - thumb_func_start sub_8181CE8 -sub_8181CE8: @ 8181CE8 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08181D00 - adds r0, r4, 0 - bl sub_817F670 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] -_08181D00: - adds r0, r4, 0 - bl sub_817F70C - movs r3, 0x3C - ldrsh r0, [r4, r3] - cmp r0, 0xFE - ble _08181D60 - movs r5, 0 - strh r5, [r4, 0x24] - strh r5, [r4, 0x26] - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - ldr r2, =0x03001240 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - ldrh r2, [r1, 0x4] - movs r3, 0x4 - ldrsh r0, [r1, r3] - cmp r0, 0x1 - ble _08181D48 - subs r0, r2, 0x1 - strh r0, [r1, 0x4] - strh r5, [r4, 0x32] - strh r5, [r4, 0x3C] - b _08181D52 - .pool -_08181D48: - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] -_08181D52: - adds r0, r4, 0 - bl sub_817F70C - b _08181DA6 - .pool -_08181D60: - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r1, 0x10 - bl sine - negs r0, r0 - strh r0, [r4, 0x24] - movs r3, 0x3C - ldrsh r0, [r4, r3] - movs r1, 0x20 - bl sine - adds r3, r0, 0 - movs r2, 0x80 - lsls r2, 1 - lsls r3, 24 - lsrs r3, 16 - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_817F6D4 - ldr r2, =0x03001240 - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x6] - ldrh r1, [r4, 0x3C] - adds r0, r1 - strh r0, [r4, 0x3C] - adds r0, r4, 0 - bl sub_817F70C -_08181DA6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8181CE8 - - thumb_func_start pokemonanimfunc_33 -pokemonanimfunc_33: @ 8181DB0 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x4 - strh r0, [r1, 0x6] - adds r0, r4, 0 - bl sub_8181CE8 - ldr r0, =sub_8181CE8 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_33 - - thumb_func_start pokemonanimfunc_34 -pokemonanimfunc_34: @ 8181DE4 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08181DFC - adds r0, r4, 0 - bl sub_817F670 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] -_08181DFC: - adds r0, r4, 0 - bl sub_817F70C - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0xFE - ble _08181E34 - movs r0, 0 - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - adds r0, r4, 0 - bl sub_817F70C - b _08181E8A - .pool -_08181E34: - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r1, 0x10 - bl sine - negs r0, r0 - strh r0, [r4, 0x24] - movs r0, 0x3C - ldrsh r1, [r4, r0] - adds r0, r1, 0 - cmp r1, 0 - bge _08181E4E - adds r0, 0x7F -_08181E4E: - asrs r0, 7 - lsls r0, 7 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x10 - bl sine - negs r0, r0 - strh r0, [r4, 0x26] - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r1, 0x20 - bl sine - adds r3, r0, 0 - movs r2, 0x80 - lsls r2, 1 - lsls r3, 24 - lsrs r3, 16 - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_817F6D4 - ldrh r0, [r4, 0x3C] - adds r0, 0x8 - strh r0, [r4, 0x3C] - adds r0, r4, 0 - bl sub_817F70C -_08181E8A: - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_34 - - thumb_func_start pokemonanimfunc_35 -pokemonanimfunc_35: @ 8181E90 - push {r4,r5,lr} - adds r3, r0, 0 - movs r1, 0x32 - ldrsh r0, [r3, r1] - cmp r0, 0 - bne _08181E9E - strh r0, [r3, 0x3C] -_08181E9E: - ldrh r4, [r3, 0x32] - movs r5, 0x32 - ldrsh r1, [r3, r5] - ldrh r2, [r3, 0x3C] - movs r5, 0x3C - ldrsh r0, [r3, r5] - cmp r1, r0 - bne _08181EC8 - movs r0, 0 - strh r0, [r3, 0x3C] - adds r0, r4, 0x1 - strh r0, [r3, 0x32] - adds r1, r3, 0 - adds r1, 0x3E - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - adds r2, r1, 0 - b _08181ED8 -_08181EC8: - adds r0, r2, 0x1 - strh r0, [r3, 0x3C] - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_08181ED8: - movs r1, 0x32 - ldrsh r0, [r3, r1] - cmp r0, 0xA - ble _08181EEE - ldrb r0, [r2] - movs r1, 0x5 - negs r1, r1 - ands r1, r0 - strb r1, [r2] - ldr r0, =sub_8184D88 - str r0, [r3, 0x1C] -_08181EEE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_35 - - thumb_func_start pokemonanimfunc_36 -pokemonanimfunc_36: @ 8181EF8 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F670 - movs r0, 0 - strh r0, [r4, 0x3C] - ldr r0, =sub_8181F14 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_36 - - thumb_func_start sub_8181F14 -sub_8181F14: @ 8181F14 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x3C] - movs r2, 0x3C - ldrsh r0, [r4, r2] - cmp r0, 0x1F - ble _08181F34 - movs r0, 0 - movs r1, 0x20 - strh r1, [r4, 0x3C] - strh r0, [r4, 0x32] - ldr r0, =sub_8181F50 - str r0, [r4, 0x1C] - b _08181F38 - .pool -_08181F34: - adds r0, r1, 0x4 - strh r0, [r4, 0x3C] -_08181F38: - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0x3C] - lsls r3, 24 - lsrs r3, 16 - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_817F6D4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8181F14 - - thumb_func_start sub_8181F50 -sub_8181F50: @ 8181F50 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r0, 0x32 - ldrsh r1, [r4, r0] - movs r0, 0x80 - lsls r0, 2 - cmp r1, r0 - ble _08181F74 - ldr r0, =sub_8181FC0 - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x3A] - b _08181FAE - .pool -_08181F74: - movs r1, 0x32 - ldrsh r0, [r4, r1] - lsls r0, 4 - negs r0, r0 - cmp r0, 0 - bge _08181F84 - ldr r1, =0x000001ff - adds r0, r1 -_08181F84: - asrs r0, 9 - strh r0, [r4, 0x24] - movs r0, 0x32 - ldrsh r1, [r4, r0] - adds r0, r1, 0 - cmp r1, 0 - bge _08181F94 - adds r0, 0x7F -_08181F94: - asrs r0, 7 - lsls r0, 7 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x4 - bl sine - negs r0, r0 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0xC - strh r0, [r4, 0x32] -_08181FAE: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8181F50 - - thumb_func_start sub_8181FC0 -sub_8181FC0: @ 8181FC0 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r0, [r4, 0x3C] - subs r0, 0x2 - movs r1, 0 - strh r0, [r4, 0x3C] - lsls r0, 16 - cmp r0, 0 - bge _08181FEC - strh r1, [r4, 0x3C] - strh r1, [r4, 0x24] - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _08181FFE - .pool -_08181FEC: - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsls r0, 17 - asrs r0, 16 - movs r1, 0x10 - bl sine - negs r0, r0 - strh r0, [r4, 0x24] -_08181FFE: - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0x3C] - lsls r3, 24 - lsrs r3, 16 - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_817F6D4 - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8181FC0 - - thumb_func_start pokemonanimfunc_37 -pokemonanimfunc_37: @ 818201C - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08182036 - adds r0, r4, 0 - bl sub_817F670 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - strh r5, [r4, 0x3C] -_08182036: - adds r0, r4, 0 - bl sub_817F70C - ldrh r1, [r4, 0x3C] - movs r2, 0x3C - ldrsh r0, [r4, r2] - cmp r0, 0xFF - ble _08182060 - movs r0, 0 - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - strh r0, [r4, 0x3C] - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _081820A6 - .pool -_08182060: - adds r0, r1, 0 - adds r0, 0x10 - strh r0, [r4, 0x3C] - movs r0, 0x3C - ldrsh r1, [r4, r0] - adds r0, r1, 0 - cmp r1, 0 - bge _08182072 - adds r0, 0x7F -_08182072: - asrs r0, 7 - lsls r0, 7 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x8 - bl sine - negs r0, r0 - strh r0, [r4, 0x24] - movs r2, 0x3C - ldrsh r1, [r4, r2] - adds r0, r1, 0 - cmp r1, 0 - bge _08182092 - adds r0, 0x7F -_08182092: - asrs r0, 7 - lsls r0, 7 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x8 - bl sine - negs r0, r0 - strh r0, [r4, 0x26] -_081820A6: - movs r0, 0x3C - ldrsh r1, [r4, r0] - adds r0, r1, 0 - cmp r1, 0 - bge _081820B2 - adds r0, 0x7F -_081820B2: - asrs r0, 7 - lsls r0, 7 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x10 - bl sine - adds r3, r0, 0 - movs r2, 0x80 - lsls r2, 1 - lsls r3, 24 - lsrs r3, 16 - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_817F6D4 - adds r0, r4, 0 - bl sub_817F70C - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_37 - - thumb_func_start pokemonanimfunc_38 -pokemonanimfunc_38: @ 81820E0 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F670 - movs r0, 0 - strh r0, [r4, 0x3C] - strh r0, [r4, 0x36] - ldr r0, =sub_81820FC - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_38 - - thumb_func_start sub_81820FC -sub_81820FC: @ 81820FC - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r1, [r4, 0x3C] - movs r2, 0x3C - ldrsh r0, [r4, r2] - cmp r0, 0x18 - ble _0818212C - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0818214A - movs r0, 0 - strh r0, [r4, 0x36] - ldr r0, =sub_818216C - str r0, [r4, 0x1C] - b _0818214A - .pool -_0818212C: - adds r0, r1, 0x2 - strh r0, [r4, 0x3C] - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r1, 0x8 - bl sine - strh r0, [r4, 0x24] - movs r2, 0x3C - ldrsh r0, [r4, r2] - movs r1, 0x8 - bl sine - negs r0, r0 - strh r0, [r4, 0x26] -_0818214A: - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0x3C] - negs r3, r3 - lsls r3, 24 - lsrs r3, 16 - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_817F6D4 - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81820FC - - thumb_func_start sub_818216C -sub_818216C: @ 818216C - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r1, [r4, 0x3C] - movs r2, 0x3C - ldrsh r0, [r4, r2] - cmp r0, 0x20 - ble _0818218C - movs r0, 0x1 - strh r0, [r4, 0x3A] - ldr r0, =sub_81821CC - str r0, [r4, 0x1C] - b _081821AA - .pool -_0818218C: - adds r0, r1, 0x2 - strh r0, [r4, 0x3C] - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r1, 0x8 - bl sine - strh r0, [r4, 0x24] - movs r2, 0x3C - ldrsh r0, [r4, r2] - movs r1, 0x8 - bl sine - negs r0, r0 - strh r0, [r4, 0x26] -_081821AA: - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0x3C] - negs r3, r3 - lsls r3, 24 - lsrs r3, 16 - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_817F6D4 - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_818216C - - thumb_func_start sub_81821CC -sub_81821CC: @ 81821CC - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r1, 0x3A - ldrsh r0, [r4, r1] - lsls r0, 2 - ldrh r1, [r4, 0x3C] - adds r0, r1 - strh r0, [r4, 0x3C] - movs r1, 0x38 - ldrsh r0, [r4, r1] - cmp r0, 0x9 - ble _081821F0 - movs r0, 0x20 - strh r0, [r4, 0x3C] - ldr r0, =sub_8182248 - str r0, [r4, 0x1C] -_081821F0: - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r1, 0x8 - bl sine - strh r0, [r4, 0x24] - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r1, 0x8 - bl sine - negs r0, r0 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x3C] - subs r0, 0x1D - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x6 - bls _08182224 - movs r1, 0x3A - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0x3A] - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] -_08182224: - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0x3C] - negs r3, r3 - lsls r3, 24 - lsrs r3, 16 - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_817F6D4 - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81821CC - - thumb_func_start sub_8182248 -sub_8182248: @ 8182248 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r1, [r4, 0x3C] - movs r2, 0x3C - ldrsh r0, [r4, r2] - cmp r0, 0 - bgt _08182270 - movs r0, 0 - strh r0, [r4, 0x3C] - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _0818228E - .pool -_08182270: - subs r0, r1, 0x2 - strh r0, [r4, 0x3C] - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r1, 0x8 - bl sine - strh r0, [r4, 0x24] - movs r2, 0x3C - ldrsh r0, [r4, r2] - movs r1, 0x8 - bl sine - negs r0, r0 - strh r0, [r4, 0x26] -_0818228E: - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0x3C] - negs r3, r3 - lsls r3, 24 - lsrs r3, 16 - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_817F6D4 - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8182248 - - thumb_func_start pokemonanimfunc_39 -pokemonanimfunc_39: @ 81822B0 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r1, [r4, 0x32] - movs r2, 0x32 - ldrsh r0, [r4, r2] - cmp r0, 0x28 - ble _081822D0 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x24] - b _0818235C - .pool -_081822D0: - movs r0, 0x1 - ands r0, r1 - movs r5, 0xFF - cmp r0, 0 - bne _081822DC - movs r5, 0x1 -_081822DC: - movs r0, 0x32 - ldrsh r2, [r4, r0] - adds r0, r2, 0 - cmp r2, 0 - bge _081822E8 - adds r0, r2, 0x3 -_081822E8: - asrs r0, 2 - lsls r0, 2 - subs r0, r2, r0 - lsls r0, 16 - asrs r1, r0, 16 - lsrs r0, 31 - adds r1, r0 - asrs r1, 1 - cmp r1, 0 - bne _0818232C - lsls r0, r2, 7 - movs r1, 0x28 - bl __divsi3 - adds r1, r0, 0 - cmp r1, 0 - bge _0818230C - adds r0, 0xFF -_0818230C: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x10 - bl sine - lsls r1, r5, 24 - asrs r1, 24 - adds r2, r0, 0 - muls r2, r1 - adds r0, r2, 0 - strh r0, [r4, 0x24] - negs r0, r0 - b _0818235A -_0818232C: - lsls r0, r2, 7 - movs r1, 0x28 - bl __divsi3 - adds r1, r0, 0 - cmp r1, 0 - bge _0818233C - adds r0, 0xFF -_0818233C: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x10 - bl sine - lsls r0, 16 - asrs r0, 16 - negs r0, r0 - lsls r1, r5, 24 - asrs r1, 24 - muls r0, r1 - strh r0, [r4, 0x24] -_0818235A: - strh r0, [r4, 0x26] -_0818235C: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - adds r0, r4, 0 - bl sub_817F70C - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_39 - - thumb_func_start pokemonanimfunc_3A -pokemonanimfunc_3A: @ 8182370 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08182392 - adds r0, r4, 0 - bl sub_817F670 - strh r5, [r4, 0x38] - strh r5, [r4, 0x3A] - strh r5, [r4, 0x3C] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] -_08182392: - ldrh r1, [r4, 0x3A] - movs r2, 0x3A - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _081823E4 - subs r0, r1, 0x1 - strh r0, [r4, 0x3A] - movs r1, 0x38 - ldrsh r0, [r4, r1] - cmp r0, 0x3 - beq _08182494 - movs r2, 0x3A - ldrsh r0, [r4, r2] - lsls r0, 3 - movs r1, 0x14 - bl __divsi3 - adds r1, r0, 0 - ldrh r0, [r4, 0x3C] - lsls r1, 16 - asrs r1, 16 - subs r0, r1 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x40 - bl sine - movs r1, 0x80 - lsls r1, 1 - adds r2, r1, 0 - lsls r0, 16 - asrs r0, 16 - subs r2, r0 - lsls r2, 16 - asrs r2, 16 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - b _08182494 -_081823E4: - movs r2, 0x38 - ldrsh r0, [r4, r2] - cmp r0, 0x3 - bne _08182424 - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0x3F - ble _08182410 - movs r0, 0x40 - strh r0, [r4, 0x3C] - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] -_08182410: - movs r2, 0x3C - ldrsh r0, [r4, r2] - movs r1, 0x40 - bl cosine - lsls r0, 16 - lsrs r3, r0, 16 - b _08182474 - .pool -_08182424: - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r1, 0x40 - bl sine - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0x3C - ldrsh r0, [r4, r2] - cmp r0, 0x3F - ble _08182448 - movs r0, 0 - movs r1, 0x3 - strh r1, [r4, 0x38] - movs r1, 0xA - strh r1, [r4, 0x3A] - strh r0, [r4, 0x3C] - b _08182474 -_08182448: - lsls r0, r3, 16 - asrs r0, 16 - cmp r0, 0x30 - ble _0818245C - movs r1, 0x38 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _0818245C - movs r0, 0x2 - b _0818246E -_0818245C: - lsls r0, r3, 16 - asrs r0, 16 - cmp r0, 0x10 - ble _08182474 - movs r2, 0x38 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _08182474 - movs r0, 0x1 -_0818246E: - strh r0, [r4, 0x38] - movs r0, 0x14 - strh r0, [r4, 0x3A] -_08182474: - ldrh r0, [r4, 0x3C] - adds r0, 0x2 - strh r0, [r4, 0x3C] - movs r0, 0x80 - lsls r0, 1 - adds r2, r0, 0 - lsls r0, r3, 16 - asrs r0, 16 - subs r2, r0 - lsls r2, 16 - asrs r2, 16 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 -_08182494: - adds r0, r4, 0 - bl sub_817F70C - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_3A - - thumb_func_start pokemonanimfunc_3B -pokemonanimfunc_3B: @ 81824A0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _081824BA - adds r0, r4, 0 - bl sub_817F670 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - strh r5, [r4, 0x3C] -_081824BA: - movs r0, 0x3C - ldrsh r1, [r4, r0] - movs r0, 0x80 - lsls r0, 2 - cmp r1, r0 - ble _081824E8 - movs r0, 0 - strh r0, [r4, 0x26] - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _08182540 - .pool -_081824E8: - movs r0, 0x3C - ldrsh r1, [r4, r0] - adds r0, r1, 0 - cmp r1, 0 - bge _081824F4 - adds r0, 0xFF -_081824F4: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x8 - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x3C] - adds r0, 0x8 - strh r0, [r4, 0x3C] - movs r0, 0x3C - ldrsh r1, [r4, r0] - adds r0, r1, 0 - cmp r1, 0 - bge _08182518 - adds r0, 0x7F -_08182518: - asrs r0, 7 - lsls r0, 7 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x60 - bl sine - adds r2, r0, 0 - movs r1, 0x80 - lsls r1, 1 - lsls r2, 16 - asrs r2, 16 - adds r2, r1 - lsls r2, 16 - asrs r2, 16 - adds r0, r4, 0 - movs r3, 0 - bl sub_817F6D4 -_08182540: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_3B - - thumb_func_start pokemonanimfunc_3C -pokemonanimfunc_3C: @ 8182548 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08182562 - adds r0, r4, 0 - bl sub_817F670 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - strh r5, [r4, 0x3C] -_08182562: - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r5, 0x80 - lsls r5, 1 - cmp r0, r5 - ble _08182590 - movs r0, 0 - strh r0, [r4, 0x26] - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r5, 0 - movs r3, 0 - bl sub_817F6D4 - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _081825D4 - .pool -_08182590: - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r1, 0x10 - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x3C] - adds r0, 0x4 - strh r0, [r4, 0x3C] - movs r0, 0x3C - ldrsh r1, [r4, r0] - adds r0, r1, 0 - cmp r1, 0 - bge _081825AE - adds r0, 0x3F -_081825AE: - asrs r0, 6 - lsls r0, 6 - subs r0, r1, r0 - lsls r0, 17 - asrs r0, 16 - movs r1, 0x80 - bl sine - adds r2, r0, 0 - lsls r2, 16 - asrs r2, 16 - adds r2, r5 - lsls r2, 16 - asrs r2, 16 - adds r0, r4, 0 - adds r1, r5, 0 - movs r3, 0 - bl sub_817F6D4 -_081825D4: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_3C - - thumb_func_start pokemonanimfunc_3D -pokemonanimfunc_3D: @ 81825DC - push {r4,lr} - adds r4, r0, 0 - bl sub_817F670 - ldr r0, =sub_81825F8 - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x3C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_3D - - thumb_func_start sub_81825F8 -sub_81825F8: @ 81825F8 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x3C] - adds r0, 0x8 - movs r1, 0 - strh r0, [r4, 0x3C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3F - ble _0818261C - strh r1, [r4, 0x3C] - strh r1, [r4, 0x3A] - ldr r0, =sub_8182648 - str r0, [r4, 0x1C] - movs r0, 0x40 - b _08182620 - .pool -_0818261C: - movs r1, 0x3C - ldrsh r0, [r4, r1] -_08182620: - movs r1, 0x80 - bl sine - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x80 - lsls r1, 1 - lsls r2, r0, 16 - asrs r2, 16 - adds r2, r1 - lsls r2, 16 - asrs r2, 16 - adds r0, r4, 0 - movs r3, 0 - bl sub_817F6D4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81825F8 - - thumb_func_start sub_8182648 -sub_8182648: @ 8182648 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x3C] - adds r0, 0x4 - strh r0, [r4, 0x3C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5F - ble _08182672 - movs r0, 0 - movs r1, 0x80 - bl cosine - lsls r0, 16 - lsrs r2, r0, 16 - movs r0, 0 - strh r0, [r4, 0x3C] - ldrh r0, [r4, 0x3A] - adds r0, 0x1 - strh r0, [r4, 0x3A] - b _081826C8 -_08182672: - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r1, 0x8 - bl sine - movs r2, 0x3A - ldrsh r1, [r4, r2] - lsls r1, 2 - negs r1, r1 - subs r1, r0 - strh r1, [r4, 0x26] - ldrh r1, [r4, 0x3C] - movs r2, 0x3C - ldrsh r0, [r4, r2] - cmp r0, 0x3F - ble _081826A4 - ldr r5, =0x0000ffff - adds r0, r1, 0 - subs r0, 0x40 - lsls r0, 16 - lsrs r0, 16 - b _081826A8 - .pool -_081826A4: - movs r5, 0x1 - movs r0, 0 -_081826A8: - lsls r0, 16 - asrs r0, 15 - ldrh r1, [r4, 0x3C] - adds r0, r1 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x80 - bl cosine - lsls r1, r5, 16 - asrs r1, 16 - adds r2, r1, 0 - muls r2, r0 - adds r0, r2, 0 - lsls r0, 16 - lsrs r2, r0, 16 -_081826C8: - movs r1, 0x80 - lsls r1, 1 - lsls r2, 16 - asrs r2, 16 - adds r2, r1 - lsls r2, 16 - asrs r2, 16 - adds r0, r4, 0 - movs r3, 0 - bl sub_817F6D4 - movs r1, 0x3A - ldrsh r0, [r4, r1] - cmp r0, 0x3 - bne _081826EE - movs r0, 0 - strh r0, [r4, 0x3C] - ldr r0, =sub_81826F8 - str r0, [r4, 0x1C] -_081826EE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8182648 - - thumb_func_start sub_81826F8 -sub_81826F8: @ 81826F8 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x3C] - adds r0, 0x8 - strh r0, [r4, 0x3C] - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r1, 0x80 - bl cosine - lsls r0, 16 - lsrs r5, r0, 16 - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r1, 0xC - bl cosine - negs r0, r0 - strh r0, [r4, 0x26] - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0x3F - ble _08182742 - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x26] - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 -_08182742: - movs r1, 0x80 - lsls r1, 1 - lsls r2, r5, 16 - asrs r2, 16 - adds r2, r1 - lsls r2, 16 - asrs r2, 16 - adds r0, r4, 0 - movs r3, 0 - bl sub_817F6D4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81826F8 - - thumb_func_start sub_8182764 -sub_8182764: @ 8182764 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x3C - ldrsh r1, [r4, r0] - movs r2, 0x38 - ldrsh r0, [r4, r2] - cmp r1, r0 - ble _08182798 - movs r0, 0 - strh r0, [r4, 0x24] - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - b _081827F4 - .pool -_08182798: - movs r0, 0x3C - ldrsh r1, [r4, r0] - adds r0, r1, 0 - cmp r1, 0 - bge _081827A4 - adds r0, 0xFF -_081827A4: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x3A] - ldrh r1, [r4, 0x3C] - adds r0, r1 - strh r0, [r4, 0x3C] - movs r2, 0x3C - ldrsh r1, [r4, r2] - adds r0, r1, 0 - cmp r1, 0 - bge _081827CC - adds r0, 0x7F -_081827CC: - asrs r0, 7 - lsls r0, 7 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x60 - bl sine - adds r1, r0, 0 - lsls r1, 16 - movs r0, 0x80 - lsls r0, 17 - adds r1, r0 - asrs r1, 16 - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - movs r3, 0 - bl sub_817F6D4 -_081827F4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8182764 - - thumb_func_start pokemonanimfunc_3E -pokemonanimfunc_3E: @ 81827FC - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08182822 - adds r0, r4, 0 - bl sub_817F670 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - strh r5, [r4, 0x3C] - movs r1, 0x8 - strh r1, [r4, 0x3A] - movs r0, 0x80 - lsls r0, 2 - strh r0, [r4, 0x38] - strh r1, [r4, 0x36] -_08182822: - adds r0, r4, 0 - bl sub_8182764 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_3E - - thumb_func_start sub_8182830 -sub_8182830: @ 8182830 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x3C - ldrsh r1, [r4, r0] - movs r2, 0x38 - ldrsh r0, [r4, r2] - cmp r1, r0 - ble _08182864 - movs r0, 0 - strh r0, [r4, 0x24] - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - b _081828C0 - .pool -_08182864: - movs r0, 0x3C - ldrsh r1, [r4, r0] - adds r0, r1, 0 - cmp r1, 0 - bge _08182870 - adds r0, 0xFF -_08182870: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x3A] - ldrh r1, [r4, 0x3C] - adds r0, r1 - strh r0, [r4, 0x3C] - movs r2, 0x3C - ldrsh r1, [r4, r2] - adds r0, r1, 0 - cmp r1, 0 - bge _08182898 - adds r0, 0x3F -_08182898: - asrs r0, 6 - lsls r0, 6 - subs r0, r1, r0 - lsls r0, 17 - asrs r0, 16 - movs r1, 0x80 - bl sine - adds r1, r0, 0 - lsls r1, 16 - movs r0, 0x80 - lsls r0, 17 - adds r1, r0 - asrs r1, 16 - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - movs r3, 0 - bl sub_817F6D4 -_081828C0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8182830 - - thumb_func_start pokemonanimfunc_3F -pokemonanimfunc_3F: @ 81828C8 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _081828EE - adds r0, r4, 0 - bl sub_817F670 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - strh r5, [r4, 0x3C] - movs r0, 0x4 - strh r0, [r4, 0x3A] - adds r0, 0xFC - strh r0, [r4, 0x38] - movs r0, 0x10 - strh r0, [r4, 0x36] -_081828EE: - adds r0, r4, 0 - bl sub_8182830 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_3F - - thumb_func_start pokemonanimfunc_40 -pokemonanimfunc_40: @ 81828FC - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _0818291A - adds r0, r4, 0 - bl sub_817F670 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - strh r5, [r4, 0x3C] -_0818291A: - movs r0, 0x3C - ldrsh r1, [r4, r0] - movs r0, 0x80 - lsls r0, 2 - cmp r1, r0 - ble _08182948 - movs r0, 0 - strh r0, [r4, 0x24] - adds r0, r4, 0 - bl sub_817F77C - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _0818299E - .pool -_08182948: - movs r0, 0x3C - ldrsh r1, [r4, r0] - adds r0, r1, 0 - cmp r1, 0 - bge _08182954 - adds r0, 0xFF -_08182954: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x8 - bl sine - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x3C] - adds r0, 0x8 - strh r0, [r4, 0x3C] - movs r0, 0x3C - ldrsh r1, [r4, r0] - adds r0, r1, 0 - cmp r1, 0 - bge _08182978 - adds r0, 0x7F -_08182978: - asrs r0, 7 - lsls r0, 7 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x60 - bl sine - adds r2, r0, 0 - lsls r2, 16 - movs r0, 0x80 - lsls r0, 17 - adds r2, r0 - asrs r2, 16 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 -_0818299E: - adds r0, r4, 0 - bl sub_817F70C - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_40 - - thumb_func_start pokemonanimfunc_41 -pokemonanimfunc_41: @ 81829AC - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _081829CA - adds r0, r4, 0 - bl sub_817F670 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - strh r5, [r4, 0x3C] -_081829CA: - movs r0, 0x3C - ldrsh r1, [r4, r0] - movs r0, 0x80 - lsls r0, 2 - cmp r1, r0 - ble _081829F8 - movs r0, 0 - strh r0, [r4, 0x24] - adds r0, r4, 0 - bl sub_817F77C - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _08182A5E - .pool -_081829F8: - movs r1, 0x3C - ldrsh r0, [r4, r1] - adds r1, r0, 0 - cmp r0, 0 - bge _08182A04 - adds r1, 0xFF -_08182A04: - asrs r1, 8 - lsls r1, 8 - subs r1, r0, r1 - lsls r1, 16 - asrs r0, r1, 16 - lsrs r1, 31 - adds r0, r1 - asrs r0, 1 - movs r1, 0x10 - bl sine - negs r0, r0 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x3C] - adds r0, 0x8 - strh r0, [r4, 0x3C] - movs r1, 0x3C - ldrsh r0, [r4, r1] - adds r1, r0, 0 - cmp r0, 0 - bge _08182A30 - adds r1, 0xFF -_08182A30: - asrs r1, 8 - lsls r1, 8 - subs r1, r0, r1 - lsls r1, 16 - asrs r0, r1, 16 - lsrs r1, 31 - adds r0, r1 - asrs r0, 1 - movs r1, 0x40 - bl sine - adds r2, r0, 0 - negs r2, r2 - lsls r2, 16 - movs r0, 0x80 - lsls r0, 17 - adds r2, r0 - asrs r2, 16 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 -_08182A5E: - adds r0, r4, 0 - bl sub_817F70C - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_41 - - thumb_func_start pokemonanimfunc_42 -pokemonanimfunc_42: @ 8182A6C - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08182A8A - adds r0, r4, 0 - bl sub_817F670 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - strh r5, [r4, 0x3C] -_08182A8A: - movs r0, 0x3C - ldrsh r1, [r4, r0] - movs r0, 0x80 - lsls r0, 2 - cmp r1, r0 - ble _08182AB8 - movs r0, 0 - strh r0, [r4, 0x24] - adds r0, r4, 0 - bl sub_817F77C - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _08182B16 - .pool -_08182AB8: - movs r0, 0x3C - ldrsh r1, [r4, r0] - adds r0, r1, 0 - cmp r1, 0 - bge _08182AC4 - adds r0, 0xFF -_08182AC4: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x8 - bl sine - negs r0, r0 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x3C] - adds r0, 0x8 - strh r0, [r4, 0x3C] - movs r1, 0x3C - ldrsh r0, [r4, r1] - adds r1, r0, 0 - cmp r0, 0 - bge _08182AEA - adds r1, 0xFF -_08182AEA: - asrs r1, 8 - lsls r1, 8 - subs r1, r0, r1 - lsls r1, 16 - asrs r0, r1, 16 - lsrs r1, 31 - adds r0, r1 - asrs r0, 1 - movs r1, 0x60 - bl sine - adds r2, r0, 0 - lsls r2, 16 - movs r0, 0x80 - lsls r0, 17 - adds r2, r0 - asrs r2, 16 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 -_08182B16: - adds r0, r4, 0 - bl sub_817F70C - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_42 - - thumb_func_start pokemonanimfunc_43 -pokemonanimfunc_43: @ 8182B24 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r0, 0x32 - ldrsh r1, [r4, r0] - movs r0, 0x80 - lsls r0, 4 - cmp r1, r0 - ble _08182B48 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x3A] - b _08182C08 - .pool -_08182B48: - movs r1, 0x32 - ldrsh r2, [r4, r1] - adds r0, r2, 0 - cmp r2, 0 - bge _08182B56 - ldr r1, =0x000001ff - adds r0, r2, r1 -_08182B56: - asrs r3, r0, 9 - adds r1, r3, 0 - adds r0, r1, 0 - cmp r1, 0 - bge _08182B62 - adds r0, r1, 0x3 -_08182B62: - asrs r0, 2 - lsls r0, 2 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - beq _08182BA4 - cmp r0, 0x1 - bgt _08182B80 - cmp r0, 0 - beq _08182B8A - b _08182BE2 - .pool -_08182B80: - cmp r0, 0x2 - beq _08182BB8 - cmp r0, 0x3 - beq _08182BCA - b _08182BE2 -_08182B8A: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 12 - negs r0, r0 - cmp r0, 0 - bge _08182B9C - ldr r1, =0x000001ff - adds r0, r1 -_08182B9C: - asrs r0, 9 - b _08182BE0 - .pool -_08182BA4: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08182BB2 - adds r0, 0x1F -_08182BB2: - asrs r0, 5 - subs r0, 0x10 - b _08182BE0 -_08182BB8: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08182BC6 - adds r0, 0x1F -_08182BC6: - asrs r0, 5 - b _08182BE0 -_08182BCA: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 12 - negs r0, r0 - cmp r0, 0 - bge _08182BDC - ldr r1, =0x000001ff - adds r0, r1 -_08182BDC: - asrs r0, 9 - adds r0, 0x10 -_08182BE0: - strh r0, [r4, 0x24] -_08182BE2: - movs r0, 0x32 - ldrsh r1, [r4, r0] - adds r0, r1, 0 - cmp r1, 0 - bge _08182BEE - adds r0, 0x7F -_08182BEE: - asrs r0, 7 - lsls r0, 7 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x4 - bl sine - negs r0, r0 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x18 - strh r0, [r4, 0x32] -_08182C08: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_43 - - thumb_func_start pokemonanimfunc_44 -pokemonanimfunc_44: @ 8182C18 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r1, [r4, 0x32] - movs r2, 0x32 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _08182C34 - strh r0, [r4, 0x3A] - movs r0, 0x40 - strh r0, [r4, 0x3C] - adds r0, r1, 0x1 - strh r0, [r4, 0x32] -_08182C34: - ldrh r0, [r4, 0x3C] - adds r1, r0, 0 - adds r1, 0x8 - movs r3, 0 - strh r1, [r4, 0x3C] - ldrh r2, [r4, 0x3A] - movs r5, 0x3A - ldrsh r0, [r4, r5] - cmp r0, 0x4 - bne _08182C52 - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x3F - ble _08182C60 - b _08182C5A -_08182C52: - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x7F - ble _08182C60 -_08182C5A: - strh r3, [r4, 0x3C] - adds r0, r2, 0x1 - strh r0, [r4, 0x3A] -_08182C60: - movs r1, 0x3A - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bhi _08182D08 - lsls r0, 2 - ldr r1, =_08182C78 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08182C78: - .4byte _08182CEC - .4byte _08182C8C - .4byte _08182CAA - .4byte _08182CCC - .4byte _08182CEC -_08182C8C: - movs r2, 0x3C - ldrsh r0, [r4, r2] - movs r1, 0x8 - bl cosine - negs r0, r0 - strh r0, [r4, 0x24] - movs r5, 0x3C - ldrsh r0, [r4, r5] - movs r1, 0x8 - bl sine - subs r0, 0x8 - strh r0, [r4, 0x26] - b _08182D12 -_08182CAA: - ldrh r0, [r4, 0x3C] - adds r0, 0x80 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x8 - bl sine - adds r0, 0x8 - strh r0, [r4, 0x24] - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r1, 0x8 - bl cosine - negs r0, r0 - strh r0, [r4, 0x26] - b _08182D12 -_08182CCC: - movs r2, 0x3C - ldrsh r0, [r4, r2] - movs r1, 0x8 - bl cosine - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x3C] - adds r0, 0x80 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x8 - bl sine - adds r0, 0x8 - strh r0, [r4, 0x26] - b _08182D12 -_08182CEC: - movs r5, 0x3C - ldrsh r0, [r4, r5] - movs r1, 0x8 - bl sine - subs r0, 0x8 - strh r0, [r4, 0x24] - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r1, 0x8 - bl cosine - strh r0, [r4, 0x26] - b _08182D12 -_08182D08: - movs r0, 0 - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] -_08182D12: - adds r0, r4, 0 - bl sub_817F70C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_44 - - thumb_func_start pokemonanimfunc_45 -pokemonanimfunc_45: @ 8182D24 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x20 - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl sub_8180714 - ldr r0, =sub_8180714 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_45 - - thumb_func_start pokemonanimfunc_46 -pokemonanimfunc_46: @ 8182D40 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x50 - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl sub_817F8FC - ldr r0, =sub_817F8FC - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_46 - - thumb_func_start pokemonanimfunc_47 -pokemonanimfunc_47: @ 8182D5C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x50 - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl sub_817F978 - ldr r0, =sub_817F978 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_47 - - thumb_func_start pokemonanimfunc_48 -pokemonanimfunc_48: @ 8182D78 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x80 - lsls r0, 4 - strh r0, [r1, 0x6] - ldrh r0, [r4, 0x3A] - strh r0, [r1, 0x8] - adds r0, r4, 0 - bl sub_8180900 - ldr r0, =sub_8180900 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_48 - - thumb_func_start pokemonanimfunc_49 -pokemonanimfunc_49: @ 8182DB4 - push {lr} - movs r1, 0x1 - strh r1, [r0, 0x3A] - bl pokemonanimfunc_05 - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_49 - - thumb_func_start pokemonanimfunc_4A -pokemonanimfunc_4A: @ 8182DC4 - push {lr} - movs r1, 0x1 - strh r1, [r0, 0x3A] - bl pokemonanimfunc_48 - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_4A - - thumb_func_start pokemonanimfunc_4B -pokemonanimfunc_4B: @ 8182DD4 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08182DE2 - strh r0, [r4, 0x2E] -_08182DE2: - ldrh r1, [r4, 0x2E] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - bgt _08182DF6 - adds r0, r4, 0 - bl sub_817FC20 - movs r0, 0x1 - b _08182DF8 -_08182DF6: - subs r0, r1, 0x1 -_08182DF8: - strh r0, [r4, 0x2E] - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_4B - - thumb_func_start pokemonanimfunc_4C -pokemonanimfunc_4C: @ 8182E00 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x1E - strh r0, [r4, 0x2E] - movs r0, 0x3 - strh r0, [r4, 0x3C] - adds r0, r4, 0 - bl sub_817FCDC - ldr r0, =sub_817FCDC - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_4C - - thumb_func_start pokemonanimfunc_4D -pokemonanimfunc_4D: @ 8182E20 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x1E - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl sub_817FD44 - ldr r0, =sub_817FD44 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_4D - - thumb_func_start pokemonanimfunc_4E -pokemonanimfunc_4E: @ 8182E3C - push {r4,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - movs r3, 0 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x80 - lsls r0, 3 - strh r0, [r1, 0x6] - strh r3, [r1] - movs r0, 0x2 - strh r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_817FE30 - ldr r0, =sub_817FE30 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_4E - - thumb_func_start pokemonanimfunc_4F -pokemonanimfunc_4F: @ 8182E7C - push {r4,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x80 - lsls r0, 2 - strh r0, [r1, 0x6] - movs r0, 0x3 - strh r0, [r1, 0x8] - movs r0, 0xC - strh r0, [r1, 0x2] - adds r0, r4, 0 - bl sub_817FFF0 - ldr r0, =sub_817FFF0 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_4F - - thumb_func_start pokemonanimfunc_50 -pokemonanimfunc_50: @ 8182EBC - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x18 - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl sub_818031C - ldr r0, =sub_818031C - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_50 - - thumb_func_start pokemonanimfunc_51 -pokemonanimfunc_51: @ 8182ED8 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x5 - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl sub_81804F8 - ldr r0, =sub_81804F8 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_51 - - thumb_func_start pokemonanimfunc_52 -pokemonanimfunc_52: @ 8182EF4 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x3 - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl sub_817F9F4 - ldr r0, =sub_817F9F4 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_52 - - thumb_func_start pokemonanimfunc_53 -pokemonanimfunc_53: @ 8182F10 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x3C - strh r0, [r1] - movs r0, 0x1E - strh r0, [r1, 0x8] - adds r0, r4, 0 - bl sub_817FF3C - ldr r0, =sub_817FF3C - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_53 - - thumb_func_start pokemonanimfunc_54 -pokemonanimfunc_54: @ 8182F48 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x1 - strh r0, [r1, 0x2] - movs r0, 0x2 - strh r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_8181214 - ldr r0, =sub_8181214 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_54 - - thumb_func_start pokemonanimfunc_55 -pokemonanimfunc_55: @ 8182F80 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x4 - strh r0, [r1, 0x6] - movs r0, 0x2 - strh r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_8181810 - ldr r0, =sub_8181810 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_55 - - thumb_func_start pokemonanimfunc_56 -pokemonanimfunc_56: @ 8182FB8 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x1 - strh r0, [r1, 0x8] - movs r0, 0x2 - strh r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_817F670 - strh r5, [r4, 0x34] - adds r0, r4, 0 - bl sub_8181ABC - ldr r0, =sub_8181ABC - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_56 - - thumb_func_start pokemonanimfunc_07 -pokemonanimfunc_07: @ 8182FFC - push {r4,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x2 - strh r0, [r1, 0x6] - adds r0, r4, 0 - bl sub_8181CE8 - ldr r0, =sub_8181CE8 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_07 - - thumb_func_start pokemonanimfunc_08 -pokemonanimfunc_08: @ 8183030 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x4 - strh r0, [r1, 0x6] - movs r0, 0x2 - strh r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_8181CE8 - ldr r0, =sub_8181CE8 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_08 - - thumb_func_start pokemonanimfunc_0B -pokemonanimfunc_0B: @ 8183068 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x64 - strh r0, [r1, 0x8] - adds r0, r4, 0 - bl sub_81814D4 - ldr r0, =sub_81814D4 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_0B - - thumb_func_start pokemonanimfunc_0C -pokemonanimfunc_0C: @ 818309C - push {r4,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x32 - strh r0, [r1, 0x8] - movs r0, 0x2 - strh r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_81814D4 - ldr r0, =sub_81814D4 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_0C - - thumb_func_start pokemonanimfunc_0D -pokemonanimfunc_0D: @ 81830D4 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x64 - strh r0, [r1, 0x8] - adds r0, r4, 0 - bl sub_81815D4 - ldr r0, =sub_81815D4 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_0D - - thumb_func_start pokemonanimfunc_0E -pokemonanimfunc_0E: @ 8183108 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x32 - strh r0, [r1, 0x8] - movs r0, 0x2 - strh r0, [r1, 0x4] - adds r0, r4, 0 - bl sub_81815D4 - ldr r0, =sub_81815D4 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_0E - - thumb_func_start sub_8183140 -sub_8183140: @ 8183140 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r2, [r4, r0] - movs r0, 0x90 - lsls r0, 4 - cmp r2, r0 - ble _0818315C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - movs r0, 0 - b _08183180 - .pool -_0818315C: - adds r1, r2, 0 - adds r1, 0xC0 - adds r0, r1, 0 - cmp r1, 0 - bge _0818316A - ldr r3, =0x000001bf - adds r0, r2, r3 -_0818316A: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r2, 0x3C - ldrsh r1, [r4, r2] - bl sine - ldrh r1, [r4, 0x3C] - adds r0, r1 -_08183180: - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x2E] - ldrh r3, [r4, 0x32] - adds r0, r3 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8183140 - - thumb_func_start pokemonanimfunc_57 -pokemonanimfunc_57: @ 8183194 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x3C - strh r0, [r4, 0x2E] - movs r0, 0x3 - strh r0, [r4, 0x3C] - adds r0, r4, 0 - bl sub_8183140 - ldr r0, =sub_8183140 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_57 - - thumb_func_start pokemonanimfunc_58 -pokemonanimfunc_58: @ 81831B4 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x1E - strh r0, [r4, 0x2E] - movs r0, 0x3 - strh r0, [r4, 0x3C] - adds r0, r4, 0 - bl sub_8183140 - ldr r0, =sub_8183140 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_58 - - thumb_func_start pokemonanimfunc_59 -pokemonanimfunc_59: @ 81831D4 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r0, 0x32 - ldrsh r1, [r4, r0] - movs r0, 0x80 - lsls r0, 4 - cmp r1, r0 - ble _081831F8 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x3A] - b _081832BC - .pool -_081831F8: - movs r1, 0x32 - ldrsh r2, [r4, r1] - adds r0, r2, 0 - cmp r2, 0 - bge _08183206 - ldr r1, =0x000001ff - adds r0, r2, r1 -_08183206: - asrs r3, r0, 9 - adds r1, r3, 0 - adds r0, r1, 0 - cmp r1, 0 - bge _08183212 - adds r0, r1, 0x3 -_08183212: - asrs r0, 2 - lsls r0, 2 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - beq _08183268 - cmp r0, 0x1 - bgt _08183230 - cmp r0, 0 - beq _0818323A - b _08183298 - .pool -_08183230: - cmp r0, 0x2 - beq _0818324C - cmp r0, 0x3 - beq _08183284 - b _08183298 -_0818323A: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08183248 - adds r0, 0x1F -_08183248: - asrs r0, 5 - b _08183296 -_0818324C: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 12 - negs r0, r0 - cmp r0, 0 - bge _0818325E - ldr r1, =0x000001ff - adds r0, r1 -_0818325E: - asrs r0, 9 - b _08183296 - .pool -_08183268: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 12 - negs r0, r0 - cmp r0, 0 - bge _0818327A - ldr r1, =0x000001ff - adds r0, r1 -_0818327A: - asrs r0, 9 - adds r0, 0x10 - b _08183296 - .pool -_08183284: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08183292 - adds r0, 0x1F -_08183292: - asrs r0, 5 - subs r0, 0x10 -_08183296: - strh r0, [r4, 0x24] -_08183298: - movs r0, 0x32 - ldrsh r1, [r4, r0] - adds r0, r1, 0 - cmp r1, 0 - bge _081832A4 - adds r0, 0x7F -_081832A4: - asrs r0, 7 - lsls r0, 7 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x4 - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x18 - strh r0, [r4, 0x32] -_081832BC: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_59 - - thumb_func_start sub_81832C8 -sub_81832C8: @ 81832C8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r6, r0, 0 - movs r0, 0 - mov r8, r0 - movs r2, 0x38 - ldrsh r1, [r6, r2] - movs r2, 0x3A - ldrsh r0, [r6, r2] - cmp r1, r0 - ble _0818331A - mov r0, r8 - strh r0, [r6, 0x26] - strh r0, [r6, 0x38] - movs r2, 0x80 - lsls r2, 1 - adds r0, r6, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - ldrh r1, [r6, 0x36] - movs r2, 0x36 - ldrsh r0, [r6, r2] - cmp r0, 0x1 - bgt _08183310 - adds r0, r6, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r6, 0x1C] - b _081833DC - .pool -_08183310: - subs r0, r1, 0x1 - strh r0, [r6, 0x36] - mov r0, r8 - strh r0, [r6, 0x3C] - b _081833DC -_0818331A: - movs r1, 0x38 - ldrsh r5, [r6, r1] - lsls r0, r5, 7 - movs r2, 0x3A - ldrsh r4, [r6, r2] - adds r1, r4, 0 - bl __divsi3 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r4, 0 - bge _08183334 - adds r4, 0x3 -_08183334: - asrs r1, r4, 2 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r5, r1 - blt _08183358 - cmp r5, r0 - bge _08183358 - ldrh r0, [r6, 0x3C] - adds r0, 0x33 - strh r0, [r6, 0x3C] - movs r1, 0xFF - mov r8, r1 - ands r1, r0 - mov r8, r1 -_08183358: - movs r1, 0x30 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0818337C - lsls r4, r2, 16 - asrs r0, r4, 16 - movs r1, 0x10 - bl sine - ldr r2, =0xffffff00 - adds r1, r2, 0 - subs r1, r0 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - b _08183392 - .pool -_0818337C: - lsls r4, r2, 16 - asrs r0, r4, 16 - movs r1, 0x10 - bl sine - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 -_08183392: - adds r7, r4, 0 - ldrh r4, [r6, 0x34] - lsls r4, 24 - lsrs r4, 24 - mov r5, r8 - adds r0, r4, 0 - movs r1, 0x5 - bl __udivsi3 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl sine - adds r5, r0, 0 - asrs r0, r7, 16 - adds r1, r4, 0 - bl sine - movs r1, 0x80 - lsls r1, 1 - adds r2, r1, 0 - subs r2, r5 - subs r2, r0 - mov r0, r9 - lsls r1, r0, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - adds r0, r6, 0 - movs r3, 0 - bl sub_817F618 - ldrh r0, [r6, 0x38] - adds r0, 0x1 - strh r0, [r6, 0x38] -_081833DC: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81832C8 - - thumb_func_start pokemonanimfunc_5A -pokemonanimfunc_5A: @ 81833E8 - push {r4-r6,lr} - adds r5, r0, 0 - movs r0, 0x32 - ldrsh r6, [r5, r0] - cmp r6, 0 - bne _0818340A - movs r4, 0x1 - strh r4, [r5, 0x32] - adds r0, r5, 0 - bl sub_817F670 - strh r4, [r5, 0x36] - movs r0, 0x28 - strh r0, [r5, 0x3A] - strh r0, [r5, 0x34] - strh r6, [r5, 0x38] - strh r6, [r5, 0x3C] -_0818340A: - adds r0, r5, 0 - bl sub_81832C8 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_5A - - thumb_func_start sub_8183418 -sub_8183418: @ 8183418 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r6, r0, 0 - movs r0, 0 - mov r8, r0 - movs r2, 0x38 - ldrsh r1, [r6, r2] - movs r2, 0x3A - ldrsh r0, [r6, r2] - cmp r1, r0 - ble _0818346A - mov r0, r8 - strh r0, [r6, 0x38] - movs r2, 0x80 - lsls r2, 1 - adds r0, r6, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - ldrh r1, [r6, 0x36] - movs r2, 0x36 - ldrsh r0, [r6, r2] - cmp r0, 0x1 - bgt _08183460 - adds r0, r6, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r6, 0x1C] - b _08183538 - .pool -_08183460: - subs r0, r1, 0x1 - strh r0, [r6, 0x36] - mov r0, r8 - strh r0, [r6, 0x3C] - b _08183538 -_0818346A: - movs r1, 0x38 - ldrsh r5, [r6, r1] - lsls r0, r5, 7 - movs r2, 0x3A - ldrsh r4, [r6, r2] - adds r1, r4, 0 - bl __divsi3 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - cmp r4, 0 - bge _08183486 - adds r4, 0x3 -_08183486: - asrs r1, r4, 2 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r5, r1 - blt _081834AC - cmp r5, r0 - bge _081834AC - ldrh r0, [r6, 0x3C] - adds r0, 0x33 - strh r0, [r6, 0x3C] - movs r1, 0xFF - mov r8, r1 - mov r2, r8 - ands r2, r0 - mov r8, r2 -_081834AC: - ldrh r0, [r6, 0x34] - lsls r0, 24 - lsrs r7, r0, 24 - movs r1, 0x30 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _081834F0 - mov r2, r9 - lsls r0, r2, 16 - asrs r0, 16 - adds r1, r7, 0 - bl sine - adds r4, r0, 0 - mov r5, r8 - adds r0, r7, 0 - movs r1, 0x5 - bl __udivsi3 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 23 - adds r0, r5, 0 - bl sine - ldr r1, =0xffffff00 - adds r0, r1 - adds r4, r0 - lsls r4, 16 - lsrs r1, r4, 16 - b _08183522 - .pool -_081834F0: - mov r4, r8 - adds r0, r7, 0 - movs r1, 0x5 - bl __udivsi3 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 23 - adds r0, r4, 0 - bl sine - adds r4, r0, 0 - mov r2, r9 - lsls r0, r2, 16 - asrs r0, 16 - adds r1, r7, 0 - bl sine - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - subs r1, r4 - subs r1, r0 - lsls r1, 16 - lsrs r1, 16 -_08183522: - lsls r1, 16 - asrs r1, 16 - movs r2, 0x80 - lsls r2, 1 - adds r0, r6, 0 - movs r3, 0 - bl sub_817F618 - ldrh r0, [r6, 0x38] - adds r0, 0x1 - strh r0, [r6, 0x38] -_08183538: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8183418 - - thumb_func_start pokemonanimfunc_5B -pokemonanimfunc_5B: @ 8183544 - push {r4-r6,lr} - adds r5, r0, 0 - movs r0, 0x32 - ldrsh r6, [r5, r0] - cmp r6, 0 - bne _08183566 - movs r4, 0x1 - strh r4, [r5, 0x32] - adds r0, r5, 0 - bl sub_817F670 - strh r4, [r5, 0x36] - movs r0, 0x28 - strh r0, [r5, 0x3A] - strh r0, [r5, 0x34] - strh r6, [r5, 0x38] - strh r6, [r5, 0x3C] -_08183566: - adds r0, r5, 0 - bl sub_8183418 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_5B - - thumb_func_start sub_8183574 -sub_8183574: @ 8183574 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r4, r0, 0 - ldrh r0, [r4, 0x32] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldrh r0, [r4, 0x3A] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r3, =gUnknown_0860AA80 - movs r1, 0x38 - ldrsh r0, [r4, r1] - lsls r1, r0, 1 - adds r0, r1, r3 - ldrb r5, [r0] - adds r2, r5, 0 - cmp r5, 0xFF - beq _081835A6 - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r5, r0, 24 -_081835A6: - adds r0, r3, 0x1 - adds r0, r1, r0 - ldrb r6, [r0] - movs r7, 0 - cmp r2, 0xFE - beq _081835C2 - mov r1, r9 - subs r0, r6, r1 - muls r0, r5 - adds r1, r6, 0 - bl __divsi3 - lsls r0, 24 - lsrs r7, r0, 24 -_081835C2: - cmp r5, 0xFF - bne _081835D8 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x26] - b _0818360A - .pool -_081835D8: - mov r1, r8 - adds r1, 0xC0 - adds r0, r1, 0 - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - adds r1, r7, 0 - bl sine - adds r0, r7 - strh r0, [r4, 0x26] - cmp r9, r6 - bne _081835FC - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - movs r0, 0 - b _08183608 -_081835FC: - ldrh r0, [r4, 0x2E] - ldrh r1, [r4, 0x32] - adds r0, r1 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x3A] - adds r0, 0x1 -_08183608: - strh r0, [r4, 0x3A] -_0818360A: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8183574 - - thumb_func_start pokemonanimfunc_5C -pokemonanimfunc_5C: @ 8183618 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x28 - strh r0, [r4, 0x2E] - movs r0, 0x6 - strh r0, [r4, 0x3C] - adds r0, r4, 0 - bl sub_8183574 - ldr r0, =sub_8183574 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_5C - - thumb_func_start pokemonanimfunc_5D -pokemonanimfunc_5D: @ 8183638 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x46 - strh r0, [r4, 0x2E] - movs r0, 0x6 - strh r0, [r4, 0x3C] - adds r0, r4, 0 - bl sub_817FCDC - ldr r0, =sub_817FCDC - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_5D - - thumb_func_start pokemonanimfunc_5E -pokemonanimfunc_5E: @ 8183658 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x14 - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl sub_817F8FC - ldr r0, =sub_817F8FC - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_5E - - thumb_func_start pokemonanimfunc_5F -pokemonanimfunc_5F: @ 8183674 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x32] - movs r2, 0x32 - ldrsh r0, [r4, r2] - cmp r0, 0x28 - ble _08183690 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - movs r0, 0 - b _081836CA - .pool -_08183690: - movs r0, 0x1 - ands r0, r1 - movs r5, 0xFF - cmp r0, 0 - bne _0818369C - movs r5, 0x1 -_0818369C: - movs r1, 0x32 - ldrsh r0, [r4, r1] - lsls r0, 7 - movs r1, 0x28 - bl __divsi3 - adds r1, r0, 0 - cmp r1, 0 - bge _081836B0 - adds r0, 0xFF -_081836B0: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x9 - bl sine - lsls r1, r5, 24 - asrs r1, 24 - adds r2, r0, 0 - muls r2, r1 - adds r0, r2, 0 -_081836CA: - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_5F - - thumb_func_start pokemonanimfunc_60 -pokemonanimfunc_60: @ 81836D8 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x32] - movs r2, 0x32 - ldrsh r0, [r4, r2] - cmp r0, 0x28 - ble _081836F4 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - movs r0, 0 - b _0818372E - .pool -_081836F4: - movs r0, 0x1 - ands r0, r1 - movs r5, 0xFF - cmp r0, 0 - bne _08183700 - movs r5, 0x1 -_08183700: - movs r1, 0x32 - ldrsh r0, [r4, r1] - lsls r0, 7 - movs r1, 0x28 - bl __divsi3 - adds r1, r0, 0 - cmp r1, 0 - bge _08183714 - adds r0, 0xFF -_08183714: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0xC - bl sine - lsls r1, r5, 24 - asrs r1, 24 - adds r2, r0, 0 - muls r2, r1 - adds r0, r2, 0 -_0818372E: - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_60 - - thumb_func_start pokemonanimfunc_61 -pokemonanimfunc_61: @ 818373C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x46 - strh r0, [r4, 0x2E] - movs r0, 0x6 - strh r0, [r4, 0x3C] - adds r0, r4, 0 - bl sub_8183140 - ldr r0, =sub_8183140 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_61 - - thumb_func_start pokemonanimfunc_62 -pokemonanimfunc_62: @ 818375C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x18 - strh r0, [r4, 0x2E] - movs r0, 0x6 - strh r0, [r4, 0x3C] - adds r0, r4, 0 - bl sub_8183574 - ldr r0, =sub_8183574 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_62 - - thumb_func_start pokemonanimfunc_63 -pokemonanimfunc_63: @ 818377C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x38 - strh r0, [r4, 0x2E] - movs r0, 0x9 - strh r0, [r4, 0x3C] - adds r0, r4, 0 - bl sub_8183574 - ldr r0, =sub_8183574 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_63 - - thumb_func_start pokemonanimfunc_64 -pokemonanimfunc_64: @ 818379C - push {r4,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2E] - ldr r2, =0x03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x80 - lsls r0, 3 - strh r0, [r1, 0x6] - movs r0, 0x6 - strh r0, [r1, 0x8] - movs r0, 0x18 - strh r0, [r1, 0x2] - adds r0, r4, 0 - bl sub_817FFF0 - ldr r0, =sub_817FFF0 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_64 - - thumb_func_start sub_81837DC -sub_81837DC: @ 81837DC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r7, r0, 0 - movs r5, 0 - movs r0, 0x38 - ldrsh r1, [r7, r0] - movs r2, 0x3A - ldrsh r0, [r7, r2] - cmp r1, r0 - ble _0818382C - strh r5, [r7, 0x26] - strh r5, [r7, 0x38] - movs r2, 0x80 - lsls r2, 1 - adds r0, r7, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - ldrh r1, [r7, 0x36] - movs r2, 0x36 - ldrsh r0, [r7, r2] - cmp r0, 0x1 - bgt _08183824 - adds r0, r7, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r7, 0x1C] - b _0818392C - .pool -_08183824: - subs r0, r1, 0x1 - strh r0, [r7, 0x36] - strh r5, [r7, 0x3C] - b _0818392C -_0818382C: - movs r0, 0x38 - ldrsh r6, [r7, r0] - lsls r0, r6, 7 - movs r1, 0x3A - ldrsh r4, [r7, r1] - adds r1, r4, 0 - bl __divsi3 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r4, 0 - bge _08183846 - adds r4, 0x3 -_08183846: - asrs r1, r4, 2 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r6, r1 - blt _08183866 - cmp r6, r0 - bge _08183866 - ldrh r0, [r7, 0x3C] - adds r0, 0x33 - strh r0, [r7, 0x3C] - movs r5, 0xFF - ands r5, r0 -_08183866: - ldrh r0, [r7, 0x34] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r1, 0x30 - ldrsh r0, [r7, r1] - cmp r0, 0 - bne _081838B0 - lsls r2, 16 - mov r8, r2 - asrs r0, r2, 16 - mov r1, r9 - bl sine - adds r4, r0, 0 - lsls r6, r5, 16 - asrs r5, r6, 16 - mov r0, r9 - movs r1, 0x5 - bl __udivsi3 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 23 - adds r0, r5, 0 - bl sine - ldr r2, =0xffffff00 - adds r4, r2 - adds r0, r4 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - mov r0, r8 - b _081838EA - .pool -_081838B0: - lsls r2, 16 - mov r8, r2 - asrs r0, r2, 16 - mov r1, r9 - bl sine - adds r6, r0, 0 - lsls r5, 16 - asrs r4, r5, 16 - mov r0, r9 - movs r1, 0x5 - bl __udivsi3 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 23 - adds r0, r4, 0 - bl sine - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - subs r1, r6 - subs r1, r0 - lsls r1, 16 - lsrs r1, 16 - mov r10, r1 - mov r0, r8 - adds r6, r5, 0 -_081838EA: - asrs r0, 16 - mov r1, r9 - bl sine - adds r5, r0, 0 - asrs r4, r6, 16 - mov r0, r9 - movs r1, 0x5 - bl __udivsi3 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sine - movs r1, 0x80 - lsls r1, 1 - adds r2, r1, 0 - subs r2, r5 - subs r2, r0 - mov r0, r10 - lsls r1, r0, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - adds r0, r7, 0 - movs r3, 0 - bl sub_817F618 - ldrh r0, [r7, 0x38] - adds r0, 0x1 - strh r0, [r7, 0x38] -_0818392C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81837DC - - thumb_func_start pokemonanimfunc_65 -pokemonanimfunc_65: @ 818393C - push {r4-r6,lr} - adds r5, r0, 0 - movs r0, 0x32 - ldrsh r6, [r5, r0] - cmp r6, 0 - bne _0818395E - movs r4, 0x1 - strh r4, [r5, 0x32] - adds r0, r5, 0 - bl sub_817F670 - strh r4, [r5, 0x36] - movs r0, 0x28 - strh r0, [r5, 0x3A] - strh r0, [r5, 0x34] - strh r6, [r5, 0x38] - strh r6, [r5, 0x3C] -_0818395E: - adds r0, r5, 0 - bl sub_81837DC - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_65 - - thumb_func_start pokemonanimfunc_66 -pokemonanimfunc_66: @ 818396C - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r0, 0x32 - ldrsh r1, [r4, r0] - movs r0, 0x80 - lsls r0, 4 - cmp r1, r0 - ble _08183990 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x3A] - b _08183A54 - .pool -_08183990: - movs r1, 0x32 - ldrsh r2, [r4, r1] - adds r0, r2, 0 - cmp r2, 0 - bge _0818399E - ldr r1, =0x000001ff - adds r0, r2, r1 -_0818399E: - asrs r3, r0, 9 - adds r1, r3, 0 - adds r0, r1, 0 - cmp r1, 0 - bge _081839AA - adds r0, r1, 0x3 -_081839AA: - asrs r0, 2 - lsls r0, 2 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - beq _08183A00 - cmp r0, 0x1 - bgt _081839C8 - cmp r0, 0 - beq _081839D2 - b _08183A30 - .pool -_081839C8: - cmp r0, 0x2 - beq _081839E4 - cmp r0, 0x3 - beq _08183A1C - b _08183A30 -_081839D2: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _081839E0 - adds r0, 0x1F -_081839E0: - asrs r0, 5 - b _08183A2E -_081839E4: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 12 - negs r0, r0 - cmp r0, 0 - bge _081839F6 - ldr r1, =0x000001ff - adds r0, r1 -_081839F6: - asrs r0, 9 - b _08183A2E - .pool -_08183A00: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 12 - negs r0, r0 - cmp r0, 0 - bge _08183A12 - ldr r1, =0x000001ff - adds r0, r1 -_08183A12: - asrs r0, 9 - adds r0, 0x10 - b _08183A2E - .pool -_08183A1C: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08183A2A - adds r0, 0x1F -_08183A2A: - asrs r0, 5 - subs r0, 0x10 -_08183A2E: - strh r0, [r4, 0x24] -_08183A30: - movs r0, 0x32 - ldrsh r1, [r4, r0] - adds r0, r1, 0 - cmp r1, 0 - bge _08183A3C - adds r0, 0x7F -_08183A3C: - asrs r0, 7 - lsls r0, 7 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x4 - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x30 - strh r0, [r4, 0x32] -_08183A54: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_66 - - thumb_func_start pokemonanimfunc_67 -pokemonanimfunc_67: @ 8183A60 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r0, 0x32 - ldrsh r1, [r4, r0] - movs r0, 0x80 - lsls r0, 4 - cmp r1, r0 - ble _08183A84 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x3A] - b _08183B40 - .pool -_08183A84: - movs r1, 0x32 - ldrsh r2, [r4, r1] - adds r0, r2, 0 - cmp r2, 0 - bge _08183A92 - ldr r1, =0x000001ff - adds r0, r2, r1 -_08183A92: - asrs r3, r0, 9 - adds r1, r3, 0 - adds r0, r1, 0 - cmp r1, 0 - bge _08183A9E - adds r0, r1, 0x3 -_08183A9E: - asrs r0, 2 - lsls r0, 2 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - beq _08183AF4 - cmp r0, 0x1 - bgt _08183ABC - cmp r0, 0 - beq _08183AC6 - b _08183B24 - .pool -_08183ABC: - cmp r0, 0x2 - beq _08183AD8 - cmp r0, 0x3 - beq _08183B10 - b _08183B24 -_08183AC6: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08183AD4 - adds r0, 0x1F -_08183AD4: - asrs r0, 5 - b _08183B22 -_08183AD8: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 12 - negs r0, r0 - cmp r0, 0 - bge _08183AEA - ldr r1, =0x000001ff - adds r0, r1 -_08183AEA: - asrs r0, 9 - b _08183B22 - .pool -_08183AF4: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 12 - negs r0, r0 - cmp r0, 0 - bge _08183B06 - ldr r1, =0x000001ff - adds r0, r1 -_08183B06: - asrs r0, 9 - adds r0, 0x10 - b _08183B22 - .pool -_08183B10: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08183B1E - adds r0, 0x1F -_08183B1E: - asrs r0, 5 - subs r0, 0x10 -_08183B22: - strh r0, [r4, 0x24] -_08183B24: - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r1, 0x60 - bl __modsi3 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x4 - bl sine - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x40 - strh r0, [r4, 0x32] -_08183B40: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_67 - - thumb_func_start sub_8183B4C -sub_8183B4C: @ 8183B4C - push {r4-r7,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08183B5E - strh r0, [r4, 0x34] -_08183B5E: - ldr r7, =gUnknown_0860ADBE - movs r2, 0x34 - ldrsh r1, [r4, r2] - lsls r0, r1, 1 - adds r0, r1 - adds r5, r7, 0x2 - adds r0, r5 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl __divsi3 - movs r2, 0x32 - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _08183B8C - ldrh r0, [r4, 0x34] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x34] - strh r1, [r4, 0x32] -_08183B8C: - movs r0, 0x34 - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r6, r0, r1 - adds r0, r6, r5 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x38 - ldrsh r5, [r4, r1] - adds r1, r5, 0 - bl __divsi3 - adds r1, r0, 0 - cmp r1, 0 - bne _08183BCC - ldrh r0, [r4, 0x3A] - subs r0, 0x1 - strh r0, [r4, 0x3A] - lsls r0, 16 - cmp r0, 0 - bne _08183BC8 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _08183C06 - .pool -_08183BC8: - strh r1, [r4, 0x32] - b _08183C06 -_08183BCC: - adds r0, r6, r7 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - muls r0, r5 - ldrh r2, [r4, 0x24] - adds r0, r2 - strh r0, [r4, 0x24] - movs r0, 0x34 - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r0, r1 - adds r1, r7, 0x1 - adds r0, r1 - movs r1, 0 - ldrsb r1, [r0, r1] - ldrh r0, [r4, 0x38] - adds r2, r0, 0 - muls r2, r1 - adds r0, r2, 0 - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - adds r0, r4, 0 - bl sub_817F70C -_08183C06: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8183B4C - - thumb_func_start pokemonanimfunc_68 -pokemonanimfunc_68: @ 8183C0C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x1 - strh r0, [r4, 0x38] - strh r0, [r4, 0x3A] - adds r0, r4, 0 - bl sub_8183B4C - ldr r0, =sub_8183B4C - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_68 - - thumb_func_start pokemonanimfunc_69 -pokemonanimfunc_69: @ 8183C2C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x2 - strh r0, [r4, 0x38] - movs r0, 0x1 - strh r0, [r4, 0x3A] - adds r0, r4, 0 - bl sub_8183B4C - ldr r0, =sub_8183B4C - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_69 - - thumb_func_start pokemonanimfunc_6A -pokemonanimfunc_6A: @ 8183C4C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x2 - strh r0, [r4, 0x38] - strh r0, [r4, 0x3A] - adds r0, r4, 0 - bl sub_8183B4C - ldr r0, =sub_8183B4C - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_6A - - thumb_func_start sub_8183C6C -sub_8183C6C: @ 8183C6C - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x3C] - movs r2, 0x3C - ldrsh r0, [r4, r2] - cmp r0, 0xFF - ble _08183CAE - ldrh r1, [r4, 0x38] - movs r2, 0x38 - ldrsh r0, [r4, r2] - cmp r0, 0x1 - bgt _08183CA4 - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - b _08183CE8 - .pool -_08183CA4: - subs r0, r1, 0x1 - movs r1, 0 - strh r0, [r4, 0x38] - strh r1, [r4, 0x3C] - b _08183CE8 -_08183CAE: - ldrh r0, [r4, 0x3A] - adds r0, r1, r0 - strh r0, [r4, 0x3C] - lsls r0, 16 - asrs r0, 16 - movs r5, 0x80 - lsls r5, 1 - cmp r0, r5 - ble _08183CC2 - strh r5, [r4, 0x3C] -_08183CC2: - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - movs r1, 0x40 - bl sine - adds r2, r0, 0 - lsls r2, 16 - asrs r2, 16 - subs r2, r5, r2 - lsls r2, 16 - asrs r2, 16 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 -_08183CE8: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8183C6C - - thumb_func_start pokemonanimfunc_6B -pokemonanimfunc_6B: @ 8183CF0 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08183D16 - adds r0, r4, 0 - bl sub_817F670 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - strh r5, [r4, 0x3C] - movs r0, 0x4 - strh r0, [r4, 0x3A] - movs r0, 0x1 - strh r0, [r4, 0x38] -_08183D16: - adds r0, r4, 0 - bl sub_8183C6C - adds r0, r4, 0 - bl sub_817F70C - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_6B - - thumb_func_start pokemonanimfunc_6C -pokemonanimfunc_6C: @ 8183D28 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08183D4E - adds r0, r4, 0 - bl sub_817F670 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - strh r5, [r4, 0x3C] - movs r0, 0x8 - strh r0, [r4, 0x3A] - movs r0, 0x2 - strh r0, [r4, 0x38] -_08183D4E: - adds r0, r4, 0 - bl sub_8183C6C - adds r0, r4, 0 - bl sub_817F70C - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_6C - - thumb_func_start pokemonanimfunc_6D -pokemonanimfunc_6D: @ 8183D60 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08183D88 - adds r0, r4, 0 - bl sub_817F670 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - strh r5, [r4, 0x3C] - movs r0, 0x8 - strh r0, [r4, 0x3A] - movs r0, 0x80 - lsls r0, 2 - strh r0, [r4, 0x38] - movs r0, 0x10 - strh r0, [r4, 0x36] -_08183D88: - adds r0, r4, 0 - bl sub_8182764 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_6D - - thumb_func_start pokemonanimfunc_6E -pokemonanimfunc_6E: @ 8183D94 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08183DBA - adds r0, r4, 0 - bl sub_817F670 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - strh r5, [r4, 0x3C] - movs r0, 0x4 - strh r0, [r4, 0x3A] - adds r0, 0xFC - strh r0, [r4, 0x38] - movs r0, 0x10 - strh r0, [r4, 0x36] -_08183DBA: - adds r0, r4, 0 - bl sub_8182764 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_6E - - thumb_func_start pokemonanimfunc_6F -pokemonanimfunc_6F: @ 8183DC8 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08183DF0 - adds r0, r4, 0 - bl sub_817F670 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - strh r5, [r4, 0x3C] - movs r0, 0x8 - strh r0, [r4, 0x3A] - movs r0, 0x80 - lsls r0, 2 - strh r0, [r4, 0x38] - movs r0, 0x10 - strh r0, [r4, 0x36] -_08183DF0: - adds r0, r4, 0 - bl sub_8182830 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_6F - - thumb_func_start pokemonanimfunc_70 -pokemonanimfunc_70: @ 8183DFC - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08183E22 - adds r0, r4, 0 - bl sub_817F670 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - strh r5, [r4, 0x3C] - movs r1, 0x8 - strh r1, [r4, 0x3A] - movs r0, 0x80 - lsls r0, 2 - strh r0, [r4, 0x38] - strh r1, [r4, 0x36] -_08183E22: - adds r0, r4, 0 - bl sub_8182830 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_70 - - thumb_func_start pokemonanimfunc_71 -pokemonanimfunc_71: @ 8183E30 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08183E4A - adds r0, r4, 0 - bl sub_817F670 - movs r0, 0x5 - strh r0, [r4, 0x3C] - movs r0, 0x8 - strh r0, [r4, 0x3A] -_08183E4A: - adds r0, r4, 0 - bl sub_8180828 - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_71 - - thumb_func_start pokemonanimfunc_72 -pokemonanimfunc_72: @ 8183E58 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08183E72 - adds r0, r4, 0 - bl sub_817F670 - movs r0, 0x3 - strh r0, [r4, 0x3C] - movs r0, 0x4 - strh r0, [r4, 0x3A] -_08183E72: - adds r0, r4, 0 - bl sub_8180828 - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_72 - - thumb_func_start pokemonanimfunc_73 -pokemonanimfunc_73: @ 8183E80 - push {r4-r6,lr} - adds r5, r0, 0 - movs r0, 0x32 - ldrsh r6, [r5, r0] - cmp r6, 0 - bne _08183EA2 - movs r4, 0x1 - strh r4, [r5, 0x32] - adds r0, r5, 0 - bl sub_817F670 - strh r4, [r5, 0x36] - movs r0, 0x1E - strh r0, [r5, 0x3A] - movs r0, 0x3C - strh r0, [r5, 0x34] - strh r6, [r5, 0x3C] -_08183EA2: - adds r0, r5, 0 - bl sub_81832C8 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_73 - - thumb_func_start pokemonanimfunc_74 -pokemonanimfunc_74: @ 8183EB0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08183ED4 - movs r0, 0x1 - strh r0, [r4, 0x32] - adds r0, r4, 0 - bl sub_817F670 - movs r0, 0x2 - strh r0, [r4, 0x36] - movs r0, 0x14 - strh r0, [r4, 0x3A] - movs r0, 0x46 - strh r0, [r4, 0x34] - strh r5, [r4, 0x3C] -_08183ED4: - adds r0, r4, 0 - bl sub_81832C8 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_74 - - thumb_func_start pokemonanimfunc_75 -pokemonanimfunc_75: @ 8183EE0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08183F06 - movs r0, 0x1 - strh r0, [r4, 0x32] - adds r0, r4, 0 - bl sub_817F670 - movs r0, 0x2 - strh r0, [r4, 0x36] - movs r0, 0x14 - strh r0, [r4, 0x3A] - movs r0, 0x46 - strh r0, [r4, 0x34] - strh r5, [r4, 0x38] - strh r5, [r4, 0x3C] -_08183F06: - adds r0, r4, 0 - bl sub_8183418 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_75 - - thumb_func_start pokemonanimfunc_76 -pokemonanimfunc_76: @ 8183F14 - push {r4-r6,lr} - adds r5, r0, 0 - movs r0, 0x32 - ldrsh r6, [r5, r0] - cmp r6, 0 - bne _08183F38 - movs r4, 0x1 - strh r4, [r5, 0x32] - adds r0, r5, 0 - bl sub_817F670 - strh r4, [r5, 0x36] - movs r0, 0x1E - strh r0, [r5, 0x3A] - movs r0, 0x3C - strh r0, [r5, 0x34] - strh r6, [r5, 0x38] - strh r6, [r5, 0x3C] -_08183F38: - adds r0, r5, 0 - bl sub_8183418 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_76 - - thumb_func_start pokemonanimfunc_77 -pokemonanimfunc_77: @ 8183F44 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08183F6A - movs r0, 0x1 - strh r0, [r4, 0x32] - adds r0, r4, 0 - bl sub_817F670 - movs r0, 0x2 - strh r0, [r4, 0x36] - movs r0, 0x14 - strh r0, [r4, 0x3A] - movs r0, 0x46 - strh r0, [r4, 0x34] - strh r5, [r4, 0x38] - strh r5, [r4, 0x3C] -_08183F6A: - adds r0, r4, 0 - bl sub_81837DC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_77 - - thumb_func_start pokemonanimfunc_78 -pokemonanimfunc_78: @ 8183F78 - push {r4-r6,lr} - adds r5, r0, 0 - movs r0, 0x32 - ldrsh r6, [r5, r0] - cmp r6, 0 - bne _08183F9C - movs r4, 0x1 - strh r4, [r5, 0x32] - adds r0, r5, 0 - bl sub_817F670 - strh r4, [r5, 0x36] - movs r0, 0x1E - strh r0, [r5, 0x3A] - movs r0, 0x3C - strh r0, [r5, 0x34] - strh r6, [r5, 0x38] - strh r6, [r5, 0x3C] -_08183F9C: - adds r0, r5, 0 - bl sub_81837DC - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_78 - - thumb_func_start sub_8183FA8 -sub_8183FA8: @ 8183FA8 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0xFF - ble _08183FEA - ldrh r2, [r4, 0x3A] - movs r3, 0x3A - ldrsh r0, [r4, r3] - cmp r0, 0x1 - bgt _08183FD0 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - b _0818403E - .pool -_08183FD0: - movs r0, 0x3C - ldrsh r1, [r4, r0] - adds r0, r1, 0 - cmp r1, 0 - bge _08183FDC - adds r0, 0xFF -_08183FDC: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - strh r0, [r4, 0x3C] - subs r0, r2, 0x1 - strh r0, [r4, 0x3A] - b _0818403E -_08183FEA: - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl sine - negs r0, r0 - strh r0, [r4, 0x24] - movs r3, 0x3C - ldrsh r2, [r4, r3] - adds r1, r2, 0 - adds r1, 0xC0 - adds r0, r1, 0 - cmp r1, 0 - bge _0818400C - ldr r3, =0x000001bf - adds r0, r2, r3 -_0818400C: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl sine - strh r0, [r4, 0x26] - lsls r0, 16 - cmp r0, 0 - ble _0818402E - movs r3, 0x26 - ldrsh r0, [r4, r3] - negs r0, r0 - strh r0, [r4, 0x26] -_0818402E: - ldrh r0, [r4, 0x36] - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x34] - ldrh r2, [r4, 0x3C] - adds r0, r2 - strh r0, [r4, 0x3C] -_0818403E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8183FA8 - - thumb_func_start pokemonanimfunc_79 -pokemonanimfunc_79: @ 8184048 - push {lr} - adds r1, r0, 0 - movs r0, 0x32 - ldrsh r2, [r1, r0] - cmp r2, 0 - bne _08184066 - movs r0, 0x1 - strh r0, [r1, 0x32] - strh r0, [r1, 0x3A] - strh r2, [r1, 0x3C] - movs r0, 0xC - strh r0, [r1, 0x38] - strh r0, [r1, 0x36] - movs r0, 0x4 - strh r0, [r1, 0x34] -_08184066: - adds r0, r1, 0 - bl sub_8183FA8 - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_79 - - thumb_func_start pokemonanimfunc_7A -pokemonanimfunc_7A: @ 8184070 - push {lr} - adds r1, r0, 0 - movs r0, 0x32 - ldrsh r2, [r1, r0] - cmp r2, 0 - bne _0818408E - movs r0, 0x1 - strh r0, [r1, 0x32] - strh r0, [r1, 0x3A] - strh r2, [r1, 0x3C] - movs r0, 0xC - strh r0, [r1, 0x38] - strh r0, [r1, 0x36] - movs r0, 0x6 - strh r0, [r1, 0x34] -_0818408E: - adds r0, r1, 0 - bl sub_8183FA8 - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_7A - - thumb_func_start pokemonanimfunc_7B -pokemonanimfunc_7B: @ 8184098 - push {lr} - adds r1, r0, 0 - movs r0, 0x32 - ldrsh r2, [r1, r0] - cmp r2, 0 - bne _081840B8 - movs r0, 0x1 - strh r0, [r1, 0x32] - movs r0, 0x2 - strh r0, [r1, 0x3A] - strh r2, [r1, 0x3C] - movs r0, 0xC - strh r0, [r1, 0x38] - strh r0, [r1, 0x36] - movs r0, 0x8 - strh r0, [r1, 0x34] -_081840B8: - adds r0, r1, 0 - bl sub_8183FA8 - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_7B - - thumb_func_start sub_81840C4 -sub_81840C4: @ 81840C4 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x3C - ldrsh r0, [r5, r1] - movs r1, 0x80 - lsls r1, 1 - cmp r0, r1 - ble _081840FC - movs r2, 0x3A - ldrsh r1, [r5, r2] - ldrh r2, [r5, 0x36] - movs r3, 0x36 - ldrsh r0, [r5, r3] - cmp r1, r0 - bgt _081840EC - ldr r0, =sub_8184D88 - str r0, [r5, 0x1C] - b _081840F4 - .pool -_081840EC: - adds r0, r2, 0x1 - movs r1, 0 - strh r0, [r5, 0x36] - strh r1, [r5, 0x3C] -_081840F4: - movs r0, 0 - strh r0, [r5, 0x24] - strh r0, [r5, 0x26] - b _08184188 -_081840FC: - cmp r0, 0x9F - ble _08184126 - cmp r0, r1 - ble _08184106 - strh r1, [r5, 0x3C] -_08184106: - movs r0, 0x3C - ldrsh r1, [r5, r0] - adds r0, r1, 0 - cmp r1, 0 - bge _08184112 - adds r0, 0xFF -_08184112: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x8 - bl sine - negs r0, r0 - b _08184154 -_08184126: - cmp r0, 0x5F - ble _0818414A - movs r0, 0x60 - movs r1, 0x6 - bl sine - adds r4, r0, 0 - movs r1, 0x3C - ldrsh r0, [r5, r1] - subs r0, 0x60 - lsls r0, 17 - asrs r0, 16 - movs r1, 0x4 - bl sine - subs r4, r0 - strh r4, [r5, 0x26] - b _08184156 -_0818414A: - movs r2, 0x3C - ldrsh r0, [r5, r2] - movs r1, 0x6 - bl sine -_08184154: - strh r0, [r5, 0x26] -_08184156: - movs r3, 0x3C - ldrsh r0, [r5, r3] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - movs r2, 0x38 - ldrsh r1, [r5, r2] - bl sine - negs r0, r0 - lsls r0, 16 - lsrs r2, r0, 16 - ldrh r0, [r5, 0x36] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0818417E - lsls r0, r2, 16 - negs r0, r0 - lsrs r2, r0, 16 -_0818417E: - strh r2, [r5, 0x24] - ldrh r0, [r5, 0x34] - ldrh r3, [r5, 0x3C] - adds r0, r3 - strh r0, [r5, 0x3C] -_08184188: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81840C4 - - thumb_func_start pokemonanimfunc_7C -pokemonanimfunc_7C: @ 8184190 - push {lr} - adds r2, r0, 0 - movs r0, 0x32 - ldrsh r3, [r2, r0] - cmp r3, 0 - bne _081841B0 - movs r1, 0x1 - strh r1, [r2, 0x32] - movs r0, 0x2 - strh r0, [r2, 0x3A] - strh r3, [r2, 0x3C] - movs r0, 0x10 - strh r0, [r2, 0x38] - strh r1, [r2, 0x36] - movs r0, 0x4 - strh r0, [r2, 0x34] -_081841B0: - adds r0, r2, 0 - bl sub_81840C4 - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_7C - - thumb_func_start pokemonanimfunc_7D -pokemonanimfunc_7D: @ 81841BC - push {lr} - adds r2, r0, 0 - movs r0, 0x32 - ldrsh r3, [r2, r0] - cmp r3, 0 - bne _081841DC - movs r1, 0x1 - strh r1, [r2, 0x32] - movs r0, 0x2 - strh r0, [r2, 0x3A] - strh r3, [r2, 0x3C] - movs r0, 0x10 - strh r0, [r2, 0x38] - strh r1, [r2, 0x36] - movs r0, 0x6 - strh r0, [r2, 0x34] -_081841DC: - adds r0, r2, 0 - bl sub_81840C4 - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_7D - - thumb_func_start pokemonanimfunc_7E -pokemonanimfunc_7E: @ 81841E8 - push {lr} - adds r2, r0, 0 - movs r0, 0x32 - ldrsh r3, [r2, r0] - cmp r3, 0 - bne _08184208 - movs r1, 0x1 - strh r1, [r2, 0x32] - movs r0, 0x3 - strh r0, [r2, 0x3A] - strh r3, [r2, 0x3C] - movs r0, 0x10 - strh r0, [r2, 0x38] - strh r1, [r2, 0x36] - movs r0, 0x8 - strh r0, [r2, 0x34] -_08184208: - adds r0, r2, 0 - bl sub_81840C4 - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_7E - - thumb_func_start pokemonanimfunc_7F -pokemonanimfunc_7F: @ 8184214 - push {lr} - adds r2, r0, 0 - movs r0, 0x32 - ldrsh r1, [r2, r0] - cmp r1, 0 - bne _08184232 - movs r0, 0x1 - strh r0, [r2, 0x32] - strh r0, [r2, 0x3A] - strh r1, [r2, 0x3C] - movs r1, 0x4 - strh r1, [r2, 0x38] - movs r0, 0x6 - strh r0, [r2, 0x36] - strh r1, [r2, 0x34] -_08184232: - adds r0, r2, 0 - bl sub_8183FA8 - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_7F - - thumb_func_start pokemonanimfunc_80 -pokemonanimfunc_80: @ 818423C - push {lr} - adds r1, r0, 0 - movs r0, 0x32 - ldrsh r2, [r1, r0] - cmp r2, 0 - bne _0818425A - movs r0, 0x1 - strh r0, [r1, 0x32] - strh r0, [r1, 0x3A] - strh r2, [r1, 0x3C] - movs r0, 0x4 - strh r0, [r1, 0x38] - movs r0, 0x6 - strh r0, [r1, 0x36] - strh r0, [r1, 0x34] -_0818425A: - adds r0, r1, 0 - bl sub_8183FA8 - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_80 - - thumb_func_start pokemonanimfunc_81 -pokemonanimfunc_81: @ 8184264 - push {lr} - adds r1, r0, 0 - movs r0, 0x32 - ldrsh r2, [r1, r0] - cmp r2, 0 - bne _08184286 - movs r0, 0x1 - strh r0, [r1, 0x32] - movs r0, 0x2 - strh r0, [r1, 0x3A] - strh r2, [r1, 0x3C] - movs r0, 0x4 - strh r0, [r1, 0x38] - movs r0, 0x6 - strh r0, [r1, 0x36] - movs r0, 0x8 - strh r0, [r1, 0x34] -_08184286: - adds r0, r1, 0 - bl sub_8183FA8 - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_81 - - thumb_func_start sub_8184290 -sub_8184290: @ 8184290 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - lsls r0, 7 - movs r2, 0x3C - ldrsh r1, [r4, r2] - bl __divsi3 - lsls r0, 16 - asrs r0, 16 - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl sine - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - lsls r0, r1, 8 - negs r0, r0 - strh r0, [r4, 0x3A] - movs r0, 0x36 - ldrsh r2, [r4, r0] - adds r0, r4, 0 - movs r3, 0 - bl sub_817F3F0 - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0x3A] - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_817F6D4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8184290 - - thumb_func_start pokemonanimfunc_82 -pokemonanimfunc_82: @ 81842DC - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08184300 - adds r0, r4, 0 - bl sub_817F670 - movs r0, 0x3C - strh r0, [r4, 0x3C] - movs r0, 0x8 - strh r0, [r4, 0x38] - ldr r0, =0x0000ffe0 - strh r0, [r4, 0x36] - movs r0, 0x1 - strh r0, [r4, 0x34] - strh r5, [r4, 0x2E] -_08184300: - movs r2, 0x32 - ldrsh r1, [r4, r2] - movs r3, 0x3C - ldrsh r0, [r4, r3] - cmp r1, r0 - ble _0818434C - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - movs r2, 0 - strh r2, [r4, 0x24] - strh r2, [r4, 0x26] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r3, 0x34 - ldrsh r1, [r4, r3] - lsls r0, 16 - asrs r0, 16 - cmp r1, r0 - bgt _08184348 - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _08184358 - .pool -_08184348: - strh r2, [r4, 0x32] - b _08184352 -_0818434C: - adds r0, r4, 0 - bl sub_8184290 -_08184352: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] -_08184358: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_82 - - thumb_func_start pokemonanimfunc_83 -pokemonanimfunc_83: @ 8184360 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08184384 - adds r0, r4, 0 - bl sub_817F670 - movs r0, 0x5A - strh r0, [r4, 0x3C] - movs r0, 0x8 - strh r0, [r4, 0x38] - ldr r0, =0x0000ffe0 - strh r0, [r4, 0x36] - movs r0, 0x1 - strh r0, [r4, 0x34] - strh r5, [r4, 0x2E] -_08184384: - movs r2, 0x32 - ldrsh r1, [r4, r2] - movs r3, 0x3C - ldrsh r0, [r4, r3] - cmp r1, r0 - ble _081843D0 - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - movs r2, 0 - strh r2, [r4, 0x24] - strh r2, [r4, 0x26] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r3, 0x34 - ldrsh r1, [r4, r3] - lsls r0, 16 - asrs r0, 16 - cmp r1, r0 - bgt _081843CC - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _081843DC - .pool -_081843CC: - strh r2, [r4, 0x32] - b _081843D6 -_081843D0: - adds r0, r4, 0 - bl sub_8184290 -_081843D6: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] -_081843DC: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_83 - - thumb_func_start pokemonanimfunc_84 -pokemonanimfunc_84: @ 81843E4 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08184408 - adds r0, r4, 0 - bl sub_817F670 - movs r0, 0x1E - strh r0, [r4, 0x3C] - movs r0, 0x8 - strh r0, [r4, 0x38] - ldr r0, =0x0000ffe0 - strh r0, [r4, 0x36] - movs r0, 0x2 - strh r0, [r4, 0x34] - strh r5, [r4, 0x2E] -_08184408: - movs r2, 0x32 - ldrsh r1, [r4, r2] - movs r3, 0x3C - ldrsh r0, [r4, r3] - cmp r1, r0 - ble _08184454 - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - movs r2, 0 - strh r2, [r4, 0x24] - strh r2, [r4, 0x26] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r3, 0x34 - ldrsh r1, [r4, r3] - lsls r0, 16 - asrs r0, 16 - cmp r1, r0 - bgt _08184450 - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _08184460 - .pool -_08184450: - strh r2, [r4, 0x32] - b _0818445A -_08184454: - adds r0, r4, 0 - bl sub_8184290 -_0818445A: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] -_08184460: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_84 - - thumb_func_start sub_8184468 -sub_8184468: @ 8184468 - push {r4-r6,lr} - adds r6, r0, 0 - movs r0, 0x32 - ldrsh r1, [r6, r0] - movs r2, 0x3C - ldrsh r0, [r6, r2] - cmp r1, r0 - ble _0818449C - movs r0, 0 - strh r0, [r6, 0x26] - movs r2, 0x80 - lsls r2, 1 - adds r0, r6, 0 - adds r1, r2, 0 - movs r3, 0 - bl sub_817F6D4 - adds r0, r6, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r6, 0x1C] - b _08184544 - .pool -_0818449C: - movs r1, 0x32 - ldrsh r0, [r6, r1] - movs r2, 0x3A - ldrsh r4, [r6, r2] - adds r1, r4, 0 - bl __modsi3 - lsls r0, 24 - lsrs r0, 16 - adds r1, r4, 0 - bl __divsi3 - adds r1, r0, 0 - cmp r1, 0 - bge _081844BC - adds r0, 0xFF -_081844BC: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - lsrs r4, r0, 16 - ldrh r0, [r6, 0x32] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081844F8 - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 - movs r1, 0x20 - bl sine - movs r1, 0x80 - lsls r1, 1 - adds r5, r1, 0 - adds r0, r5 - strh r0, [r6, 0x36] - adds r0, r4, 0 - movs r1, 0x20 - bl sine - adds r0, r5 - strh r0, [r6, 0x38] - adds r0, r4, 0 - movs r1, 0x20 - b _0818451E -_081844F8: - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 - movs r1, 0x8 - bl sine - movs r2, 0x80 - lsls r2, 1 - adds r5, r2, 0 - adds r0, r5 - strh r0, [r6, 0x36] - adds r0, r4, 0 - movs r1, 0x8 - bl sine - adds r0, r5 - strh r0, [r6, 0x38] - adds r0, r4, 0 - movs r1, 0x8 -_0818451E: - bl sine - lsls r0, 24 - lsrs r0, 24 - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - bge _08184530 - adds r0, 0x7 -_08184530: - lsrs r0, 3 - strh r0, [r6, 0x26] - movs r0, 0x36 - ldrsh r1, [r6, r0] - movs r0, 0x38 - ldrsh r2, [r6, r0] - adds r0, r6, 0 - movs r3, 0 - bl sub_817F6D4 -_08184544: - ldrh r0, [r6, 0x32] - adds r0, 0x1 - strh r0, [r6, 0x32] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8184468 - - thumb_func_start pokemonanimfunc_85 -pokemonanimfunc_85: @ 8184550 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08184570 - adds r0, r4, 0 - bl sub_817F670 - ldrh r0, [r4, 0x26] - adds r0, 0x2 - strh r0, [r4, 0x26] - movs r0, 0x28 - strh r0, [r4, 0x3A] - movs r0, 0x50 - strh r0, [r4, 0x3C] -_08184570: - adds r0, r4, 0 - bl sub_8184468 - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_85 - - thumb_func_start pokemonanimfunc_86 -pokemonanimfunc_86: @ 818457C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0818459A - adds r0, r4, 0 - bl sub_817F670 - ldrh r0, [r4, 0x26] - adds r0, 0x2 - strh r0, [r4, 0x26] - movs r0, 0x28 - strh r0, [r4, 0x3A] - strh r0, [r4, 0x3C] -_0818459A: - adds r0, r4, 0 - bl sub_8184468 - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_86 - - thumb_func_start pokemonanimfunc_87 -pokemonanimfunc_87: @ 81845A8 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081845C6 - adds r0, r4, 0 - bl sub_817F670 - ldrh r0, [r4, 0x26] - adds r0, 0x2 - strh r0, [r4, 0x26] - movs r0, 0x50 - strh r0, [r4, 0x3A] - strh r0, [r4, 0x3C] -_081845C6: - adds r0, r4, 0 - bl sub_8184468 - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_87 - - thumb_func_start sub_81845D4 -sub_81845D4: @ 81845D4 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x32] - subs r0, r1 - strh r0, [r4, 0x24] - movs r0, 0x24 - ldrsh r1, [r4, r0] - movs r2, 0x3A - ldrsh r0, [r4, r2] - cmn r1, r0 - bgt _081845FE - ldrh r0, [r4, 0x3A] - negs r0, r0 - strh r0, [r4, 0x24] - movs r0, 0x2 - strh r0, [r4, 0x3C] - ldr r0, =sub_8184610 - str r0, [r4, 0x1C] -_081845FE: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81845D4 - - thumb_func_start sub_8184610 -sub_8184610: @ 8184610 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r0, [r4, 0x3C] - ldrh r2, [r4, 0x24] - adds r1, r0, r2 - strh r1, [r4, 0x24] - adds r0, 0x1 - strh r0, [r4, 0x3C] - lsls r1, 16 - cmp r1, 0 - blt _0818462E - ldr r0, =sub_8184640 - str r0, [r4, 0x1C] -_0818462E: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8184610 - - thumb_func_start sub_8184640 -sub_8184640: @ 8184640 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r0, [r4, 0x3C] - ldrh r2, [r4, 0x24] - adds r1, r0, r2 - strh r1, [r4, 0x24] - adds r0, 0x1 - strh r0, [r4, 0x3C] - lsls r1, 16 - asrs r1, 16 - ldrh r2, [r4, 0x3A] - movs r3, 0x3A - ldrsh r0, [r4, r3] - cmp r1, r0 - ble _08184668 - strh r2, [r4, 0x24] - ldr r0, =sub_8184678 - str r0, [r4, 0x1C] -_08184668: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8184640 - - thumb_func_start sub_8184678 -sub_8184678: @ 8184678 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r2, [r4, 0x34] - movs r0, 0x34 - ldrsh r1, [r4, r0] - movs r3, 0x38 - ldrsh r0, [r4, r3] - cmp r1, r0 - blt _08184698 - ldr r0, =sub_81846B8 - str r0, [r4, 0x1C] - b _081846AC - .pool -_08184698: - ldrh r0, [r4, 0x36] - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - movs r3, 0x36 - ldrsh r0, [r4, r3] - negs r0, r0 - strh r0, [r4, 0x36] - adds r0, r2, 0x1 - strh r0, [r4, 0x34] -_081846AC: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8184678 - - thumb_func_start sub_81846B8 -sub_81846B8: @ 81846B8 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r0, [r4, 0x24] - subs r0, 0x2 - strh r0, [r4, 0x24] - lsls r0, 16 - cmp r0, 0 - bgt _081846DA - movs r0, 0 - strh r0, [r4, 0x24] - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] -_081846DA: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81846B8 - - thumb_func_start pokemonanimfunc_88 -pokemonanimfunc_88: @ 81846EC - push {r4,lr} - adds r4, r0, 0 - bl sub_817F670 - movs r2, 0 - movs r1, 0x4 - strh r1, [r4, 0x3C] - movs r0, 0xC - strh r0, [r4, 0x3A] - movs r0, 0x10 - strh r0, [r4, 0x38] - strh r1, [r4, 0x36] - strh r2, [r4, 0x34] - movs r0, 0x2 - strh r0, [r4, 0x32] - ldr r0, =sub_81845D4 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_88 - - thumb_func_start pokemonanimfunc_89 -pokemonanimfunc_89: @ 8184718 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F670 - movs r2, 0 - movs r1, 0x2 - strh r1, [r4, 0x3C] - movs r0, 0x8 - strh r0, [r4, 0x3A] - movs r0, 0xC - strh r0, [r4, 0x38] - strh r1, [r4, 0x36] - strh r2, [r4, 0x34] - movs r0, 0x1 - strh r0, [r4, 0x32] - ldr r0, =sub_81845D4 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_89 - - thumb_func_start pokemonanimfunc_8A -pokemonanimfunc_8A: @ 8184744 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F670 - movs r1, 0 - strh r1, [r4, 0x3C] - movs r0, 0x6 - strh r0, [r4, 0x3A] - strh r0, [r4, 0x38] - movs r0, 0x2 - strh r0, [r4, 0x36] - strh r1, [r4, 0x34] - movs r0, 0x1 - strh r0, [r4, 0x32] - ldr r0, =sub_81845D4 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_8A - - thumb_func_start sub_8184770 -sub_8184770: @ 8184770 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x30] - strh r0, [r1, 0x24] - ldrh r2, [r1, 0x2E] - movs r3, 0x2E - ldrsh r0, [r1, r3] - cmp r0, 0x1 - ble _0818478E - movs r2, 0x30 - ldrsh r0, [r1, r2] - negs r0, r0 - strh r0, [r1, 0x30] - movs r0, 0 - b _08184790 -_0818478E: - adds r0, r2, 0x1 -_08184790: - strh r0, [r1, 0x2E] - pop {r0} - bx r0 - thumb_func_end sub_8184770 - - thumb_func_start sub_8184798 -sub_8184798: @ 8184798 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r1, =gUnknown_0860AE7C - movs r2, 0x34 - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r0, r1 - ldr r5, [r0] - adds r0, r4, 0 - bl sub_8184770 - movs r1, 0x3A - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r1, r0, r5 - ldrb r0, [r1, 0x1] - cmp r0, 0xFF - bne _081847D0 - movs r0, 0 - strh r0, [r4, 0x24] - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _0818482E - .pool -_081847D0: - movs r2, 0x36 - ldrsh r0, [r4, r2] - cmp r0, 0x1 - bne _08184800 - ldrb r0, [r1] - cmp r0, 0 - beq _081847F0 - ldrh r0, [r4, 0x3C] - ldr r3, =0x000003ff - movs r1, 0x10 - movs r2, 0x10 - bl pal_fade_1 - b _081847FC - .pool -_081847F0: - ldrh r0, [r4, 0x3C] - ldr r3, =0x000003ff - movs r1, 0x10 - movs r2, 0 - bl pal_fade_1 -_081847FC: - movs r0, 0 - strh r0, [r4, 0x36] -_08184800: - movs r1, 0x3A - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r5 - ldrb r1, [r0, 0x1] - movs r2, 0x38 - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _08184828 - movs r1, 0 - movs r0, 0x1 - strh r0, [r4, 0x36] - strh r1, [r4, 0x38] - ldrh r0, [r4, 0x3A] - adds r0, 0x1 - strh r0, [r4, 0x3A] - b _0818482E - .pool -_08184828: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] -_0818482E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8184798 - - thumb_func_start pokemonanimfunc_8B -pokemonanimfunc_8B: @ 8184834 - push {r4,lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x32] - adds r0, 0x1 - movs r3, 0 - strh r0, [r2, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _08184860 - ldrb r0, [r2, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r4, 0x80 - lsls r4, 1 - adds r1, r4, 0 - adds r0, r1 - strh r0, [r2, 0x3C] - strh r3, [r2, 0x3A] - strh r3, [r2, 0x38] - strh r3, [r2, 0x36] - strh r3, [r2, 0x34] -_08184860: - adds r0, r2, 0 - bl sub_8184798 - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_8B - - thumb_func_start pokemonanimfunc_8C -pokemonanimfunc_8C: @ 818486C - push {r4,r5,lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x32] - adds r0, 0x1 - movs r3, 0 - strh r0, [r2, 0x32] - lsls r0, 16 - asrs r4, r0, 16 - cmp r4, 0x1 - bne _08184898 - ldrb r0, [r2, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r5, 0x80 - lsls r5, 1 - adds r1, r5, 0 - adds r0, r1 - strh r0, [r2, 0x3C] - strh r3, [r2, 0x3A] - strh r3, [r2, 0x38] - strh r3, [r2, 0x36] - strh r4, [r2, 0x34] -_08184898: - adds r0, r2, 0 - bl sub_8184798 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_8C - - thumb_func_start pokemonanimfunc_8D -pokemonanimfunc_8D: @ 81848A4 - push {r4,lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x32] - adds r0, 0x1 - movs r3, 0 - strh r0, [r2, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _081848D2 - ldrb r0, [r2, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r4, 0x80 - lsls r4, 1 - adds r1, r4, 0 - adds r0, r1 - strh r0, [r2, 0x3C] - strh r3, [r2, 0x3A] - strh r3, [r2, 0x38] - strh r3, [r2, 0x36] - movs r0, 0x2 - strh r0, [r2, 0x34] -_081848D2: - adds r0, r2, 0 - bl sub_8184798 - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_8D - - thumb_func_start sub_81848E0 -sub_81848E0: @ 81848E0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x7F - ble _08184904 - ldrh r0, [r4, 0x3C] - movs r1, 0x10 - movs r2, 0 - movs r3, 0x1F - bl pal_fade_1 - ldr r0, =sub_8184D88 - str r0, [r4, 0x1C] - b _0818492A - .pool -_08184904: - movs r5, 0x32 - ldrsh r0, [r4, r5] - movs r1, 0xC - bl sine - adds r2, r0, 0 - strh r2, [r4, 0x3A] - ldrh r0, [r4, 0x3C] - lsls r2, 24 - lsrs r2, 24 - ldr r3, =gUnknown_0860AE88 - movs r5, 0x30 - ldrsh r1, [r4, r5] - lsls r1, 1 - adds r1, r3 - ldrh r3, [r1] - movs r1, 0x10 - bl pal_fade_1 -_0818492A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81848E0 - - thumb_func_start sub_8184934 -sub_8184934: @ 8184934 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x34 - ldrsh r1, [r4, r0] - movs r2, 0x36 - ldrsh r0, [r4, r2] - cmp r1, r0 - bge _081849CC - adds r0, r4, 0 - bl sub_817F70C - movs r3, 0x38 - ldrsh r1, [r4, r3] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r1, r0 - ble _08184970 - ldrh r0, [r4, 0x34] - adds r0, 0x1 - movs r2, 0 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x36 - ldrsh r1, [r4, r3] - cmp r0, r1 - bge _0818496C - strh r2, [r4, 0x38] -_0818496C: - strh r2, [r4, 0x24] - b _081849C6 -_08184970: - movs r0, 0x34 - ldrsh r1, [r4, r0] - lsrs r0, r1, 31 - adds r0, r1, r0 - asrs r0, 1 - lsls r0, 1 - subs r1, r0 - lsls r1, 16 - asrs r1, 15 - movs r0, 0x1 - subs r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - movs r2, 0x38 - ldrsh r1, [r4, r2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 7 - movs r3, 0x2E - ldrsh r1, [r4, r3] - bl __divsi3 - adds r1, r0, 0 - cmp r1, 0 - bge _081849A4 - adds r0, 0xFF -_081849A4: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x6 - bl sine - lsls r1, r5, 24 - asrs r1, 24 - adds r2, r1, 0 - muls r2, r0 - adds r0, r2, 0 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] -_081849C6: - adds r0, r4, 0 - bl sub_817F70C -_081849CC: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8184934 - - thumb_func_start pokemonanimfunc_8E -pokemonanimfunc_8E: @ 81849D4 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r2, [r4, r0] - cmp r2, 0 - bne _081849FE - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r3, 0x80 - lsls r3, 1 - adds r1, r3, 0 - adds r0, r1 - strh r0, [r4, 0x3C] - movs r0, 0xA - strh r0, [r4, 0x2E] - strh r2, [r4, 0x38] - movs r0, 0x2 - strh r0, [r4, 0x36] - strh r2, [r4, 0x34] - strh r2, [r4, 0x30] -_081849FE: - ldrh r0, [r4, 0x32] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08184A0E - adds r0, r4, 0 - bl sub_81848E0 -_08184A0E: - movs r0, 0x32 - ldrsh r2, [r4, r0] - movs r3, 0x2E - ldrsh r1, [r4, r3] - movs r3, 0x36 - ldrsh r0, [r4, r3] - muls r1, r0 - movs r0, 0x80 - subs r0, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - cmp r2, r0 - blt _08184A30 - adds r0, r4, 0 - bl sub_8184934 -_08184A30: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_8E - - thumb_func_start pokemonanimfunc_8F -pokemonanimfunc_8F: @ 8184A3C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r2, [r4, r0] - cmp r2, 0 - bne _08184A66 - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r3, 0x80 - lsls r3, 1 - adds r1, r3, 0 - adds r0, r1 - strh r0, [r4, 0x3C] - movs r0, 0x14 - strh r0, [r4, 0x2E] - strh r2, [r4, 0x38] - movs r0, 0x1 - strh r0, [r4, 0x36] - strh r2, [r4, 0x34] - strh r2, [r4, 0x30] -_08184A66: - ldrh r0, [r4, 0x32] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08184A76 - adds r0, r4, 0 - bl sub_81848E0 -_08184A76: - movs r0, 0x32 - ldrsh r2, [r4, r0] - movs r3, 0x2E - ldrsh r1, [r4, r3] - movs r3, 0x36 - ldrsh r0, [r4, r3] - muls r1, r0 - movs r0, 0x80 - subs r0, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - cmp r2, r0 - blt _08184A98 - adds r0, r4, 0 - bl sub_8184934 -_08184A98: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_8F - - thumb_func_start pokemonanimfunc_90 -pokemonanimfunc_90: @ 8184AA4 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r2, [r4, r0] - cmp r2, 0 - bne _08184ACE - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r3, 0x80 - lsls r3, 1 - adds r1, r3, 0 - adds r0, r1 - strh r0, [r4, 0x3C] - movs r0, 0x50 - strh r0, [r4, 0x2E] - strh r2, [r4, 0x38] - movs r0, 0x1 - strh r0, [r4, 0x36] - strh r2, [r4, 0x34] - strh r2, [r4, 0x30] -_08184ACE: - ldrh r0, [r4, 0x32] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08184ADE - adds r0, r4, 0 - bl sub_81848E0 -_08184ADE: - movs r0, 0x32 - ldrsh r2, [r4, r0] - movs r3, 0x2E - ldrsh r1, [r4, r3] - movs r3, 0x36 - ldrsh r0, [r4, r3] - muls r1, r0 - movs r0, 0x80 - subs r0, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - cmp r2, r0 - blt _08184B00 - adds r0, r4, 0 - bl sub_8184934 -_08184B00: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_90 - - thumb_func_start pokemonanimfunc_91 -pokemonanimfunc_91: @ 8184B0C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r2, [r4, r0] - cmp r2, 0 - bne _08184B38 - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r3, 0x80 - lsls r3, 1 - adds r1, r3, 0 - adds r0, r1 - strh r0, [r4, 0x3C] - movs r0, 0xA - strh r0, [r4, 0x2E] - strh r2, [r4, 0x38] - movs r0, 0x2 - strh r0, [r4, 0x36] - strh r2, [r4, 0x34] - movs r0, 0x1 - strh r0, [r4, 0x30] -_08184B38: - ldrh r0, [r4, 0x32] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08184B48 - adds r0, r4, 0 - bl sub_81848E0 -_08184B48: - movs r0, 0x32 - ldrsh r2, [r4, r0] - movs r3, 0x2E - ldrsh r1, [r4, r3] - movs r3, 0x36 - ldrsh r0, [r4, r3] - muls r1, r0 - movs r0, 0x80 - subs r0, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - cmp r2, r0 - blt _08184B6A - adds r0, r4, 0 - bl sub_8184934 -_08184B6A: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_91 - - thumb_func_start pokemonanimfunc_92 -pokemonanimfunc_92: @ 8184B78 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r2, [r4, r0] - cmp r2, 0 - bne _08184BA2 - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r3, 0x80 - lsls r3, 1 - adds r1, r3, 0 - adds r0, r1 - strh r0, [r4, 0x3C] - movs r0, 0x14 - strh r0, [r4, 0x2E] - strh r2, [r4, 0x38] - movs r0, 0x1 - strh r0, [r4, 0x36] - strh r2, [r4, 0x34] - strh r0, [r4, 0x30] -_08184BA2: - ldrh r0, [r4, 0x32] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08184BB2 - adds r0, r4, 0 - bl sub_81848E0 -_08184BB2: - movs r0, 0x32 - ldrsh r2, [r4, r0] - movs r3, 0x2E - ldrsh r1, [r4, r3] - movs r3, 0x36 - ldrsh r0, [r4, r3] - muls r1, r0 - movs r0, 0x80 - subs r0, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - cmp r2, r0 - blt _08184BD4 - adds r0, r4, 0 - bl sub_8184934 -_08184BD4: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_92 - - thumb_func_start pokemonanimfunc_93 -pokemonanimfunc_93: @ 8184BE0 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r2, [r4, r0] - cmp r2, 0 - bne _08184C0A - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r3, 0x80 - lsls r3, 1 - adds r1, r3, 0 - adds r0, r1 - strh r0, [r4, 0x3C] - movs r0, 0x50 - strh r0, [r4, 0x2E] - strh r2, [r4, 0x38] - movs r0, 0x1 - strh r0, [r4, 0x36] - strh r2, [r4, 0x34] - strh r0, [r4, 0x30] -_08184C0A: - ldrh r0, [r4, 0x32] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08184C1A - adds r0, r4, 0 - bl sub_81848E0 -_08184C1A: - movs r0, 0x32 - ldrsh r2, [r4, r0] - movs r3, 0x2E - ldrsh r1, [r4, r3] - movs r3, 0x36 - ldrsh r0, [r4, r3] - muls r1, r0 - movs r0, 0x80 - subs r0, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - cmp r2, r0 - blt _08184C3C - adds r0, r4, 0 - bl sub_8184934 -_08184C3C: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_93 - - thumb_func_start pokemonanimfunc_94 -pokemonanimfunc_94: @ 8184C48 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r2, [r4, r0] - cmp r2, 0 - bne _08184C72 - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r3, 0x80 - lsls r3, 1 - adds r1, r3, 0 - adds r0, r1 - strh r0, [r4, 0x3C] - movs r0, 0xA - strh r0, [r4, 0x2E] - strh r2, [r4, 0x38] - movs r0, 0x2 - strh r0, [r4, 0x36] - strh r2, [r4, 0x34] - strh r0, [r4, 0x30] -_08184C72: - ldrh r0, [r4, 0x32] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08184C82 - adds r0, r4, 0 - bl sub_81848E0 -_08184C82: - movs r0, 0x32 - ldrsh r2, [r4, r0] - movs r3, 0x2E - ldrsh r1, [r4, r3] - movs r3, 0x36 - ldrsh r0, [r4, r3] - muls r1, r0 - movs r0, 0x80 - subs r0, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - cmp r2, r0 - blt _08184CA4 - adds r0, r4, 0 - bl sub_8184934 -_08184CA4: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_94 - - thumb_func_start pokemonanimfunc_95 -pokemonanimfunc_95: @ 8184CB0 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r2, [r4, r0] - cmp r2, 0 - bne _08184CDC - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r3, 0x80 - lsls r3, 1 - adds r1, r3, 0 - adds r0, r1 - strh r0, [r4, 0x3C] - movs r0, 0x14 - strh r0, [r4, 0x2E] - strh r2, [r4, 0x38] - movs r0, 0x1 - strh r0, [r4, 0x36] - strh r2, [r4, 0x34] - movs r0, 0x2 - strh r0, [r4, 0x30] -_08184CDC: - ldrh r0, [r4, 0x32] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08184CEC - adds r0, r4, 0 - bl sub_81848E0 -_08184CEC: - movs r0, 0x32 - ldrsh r2, [r4, r0] - movs r3, 0x2E - ldrsh r1, [r4, r3] - movs r3, 0x36 - ldrsh r0, [r4, r3] - muls r1, r0 - movs r0, 0x80 - subs r0, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - cmp r2, r0 - blt _08184D0E - adds r0, r4, 0 - bl sub_8184934 -_08184D0E: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_95 - - thumb_func_start pokemonanimfunc_96 -pokemonanimfunc_96: @ 8184D1C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r2, [r4, r0] - cmp r2, 0 - bne _08184D48 - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r3, 0x80 - lsls r3, 1 - adds r1, r3, 0 - adds r0, r1 - strh r0, [r4, 0x3C] - movs r0, 0x50 - strh r0, [r4, 0x2E] - strh r2, [r4, 0x38] - movs r0, 0x1 - strh r0, [r4, 0x36] - strh r2, [r4, 0x34] - movs r0, 0x2 - strh r0, [r4, 0x30] -_08184D48: - ldrh r0, [r4, 0x32] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08184D58 - adds r0, r4, 0 - bl sub_81848E0 -_08184D58: - movs r0, 0x32 - ldrsh r2, [r4, r0] - movs r3, 0x2E - ldrsh r1, [r4, r3] - movs r3, 0x36 - ldrsh r0, [r4, r3] - muls r1, r0 - movs r0, 0x80 - subs r0, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - cmp r2, r0 - blt _08184D7A - adds r0, r4, 0 - bl sub_8184934 -_08184D7A: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_96 - - thumb_func_start sub_8184D88 -sub_8184D88: @ 8184D88 - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08184D9C - ldr r0, =DummyObjectCallback - str r0, [r2, 0x1C] -_08184D9C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8184D88 - - thumb_func_start sub_8184DA4 -sub_8184DA4: @ 8184DA4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r12, r0 - ldr r0, =0x0203c7ac - mov r1, r12 - strb r1, [r0] - ldr r1, =0x0203ccd0 - movs r0, 0 - strb r0, [r1] - movs r2, 0 - movs r7, 0 - ldr r3, =0x0203c7bc - mov r10, r3 - ldr r6, =0x0203c794 - mov r9, r6 - ldr r0, =0x0203bd34 - mov r8, r0 -_08184DD0: - lsls r0, r2, 1 - mov r3, r9 - adds r1, r0, r3 - strh r7, [r1] - ldr r6, =0x0203c79c - adds r1, r0, r6 - strh r7, [r1] - ldr r1, =0x0203c7a4 - adds r0, r1 - strh r7, [r0] - adds r4, r2, 0x1 - mov r3, r12 - cmp r3, 0x1 - bne _08184E1C - ldr r5, =0x02022fec - movs r3, 0xFF - movs r1, 0xA6 - lsls r1, 2 - adds r0, r2, 0 - muls r0, r1 - mov r6, r8 - adds r2, r0, r6 -_08184DFC: - ldrb r0, [r2] - orrs r0, r3 - strb r0, [r2] - adds r2, 0x1 - subs r1, 0x1 - cmp r1, 0 - bne _08184DFC - ldr r0, [r5] - ldr r1, =0x0203c7b8 - str r0, [r1] - ldr r3, =0x020244a8 - ldr r0, [r3] - ldr r0, [r0, 0x14] - ldr r0, [r0, 0xC] - mov r6, r10 - str r0, [r6] -_08184E1C: - adds r2, r4, 0 - cmp r2, 0x3 - ble _08184DD0 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8184DA4 - - thumb_func_start sub_8184E58 -sub_8184E58: @ 8184E58 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - ldr r0, =0x0203c7ac - ldrb r0, [r0] - cmp r0, 0x1 - bne _08184EA0 - ldr r1, =0x0203bd2c - ldr r0, =0x03005d80 - ldr r0, [r0] - str r0, [r1] - ldr r4, =0x0203c7ae - ldr r0, =0x000040cf - bl VarGet - strb r0, [r4] - ldr r4, =0x0203c7af - bl sub_81A513C - strb r0, [r4] - b _08184EAC - .pool -_08184EA0: - cmp r0, 0x2 - bne _08184EAC - ldr r0, =0x03005d80 - ldr r1, =0x0203bd2c - ldr r1, [r1] - str r1, [r0] -_08184EAC: - ldr r0, =0x02022fec - ldr r5, [r0] - movs r0, 0x2 - ands r5, r0 - cmp r5, 0 - beq _08184F64 - bl link_get_multiplayer_id - ldr r1, =0x0203c7b4 - strb r0, [r1] - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - movs r5, 0 - ldr r0, =0x0203cc80 - mov r9, r0 - ldr r6, =0x020229e8 - movs r0, 0x8 - adds r0, r6 - mov r8, r0 - mov r7, r9 - adds r7, 0x4 -_08184EDC: - lsls r0, r5, 2 - adds r0, r5 - lsls r4, r0, 2 - mov r0, r9 - adds r2, r4, r0 - lsls r0, r5, 3 - subs r0, r5 - lsls r3, r0, 2 - adds r0, r6, 0x4 - adds r0, r3, r0 - ldr r0, [r0] - str r0, [r2] - adds r1, r3, r6 - ldrb r0, [r1, 0x13] - strb r0, [r2, 0xC] - ldrh r0, [r1, 0x18] - strh r0, [r2, 0xE] - ldrh r0, [r1, 0x1A] - strh r0, [r2, 0x10] - cmp r5, r10 - bge _08184F3C - mov r0, r8 - adds r1, r3, r0 - mov r0, sp - bl CopyString - mov r0, sp - bl StripExtendedControlCodes - adds r0, r4, r7 - mov r1, sp - bl CopyString - adds r5, 0x1 - b _08184F56 - .pool -_08184F3C: - adds r5, 0x1 - ldr r0, =0x020229f0 - adds r1, r3, r0 - ldr r0, =0x0203cc84 - adds r2, r4, r0 - movs r3, 0x7 -_08184F48: - ldrb r0, [r1] - strb r0, [r2] - adds r1, 0x1 - adds r2, 0x1 - subs r3, 0x1 - cmp r3, 0 - bge _08184F48 -_08184F56: - cmp r5, 0x3 - ble _08184EDC - b _08184FA0 - .pool -_08184F64: - ldr r3, =0x0203cc80 - ldr r4, =0x03005d90 - ldr r2, [r4] - ldrb r1, [r2, 0xA] - ldrb r0, [r2, 0xB] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0xC] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0xD] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - ldrb r0, [r2, 0x8] - strb r0, [r3, 0xC] - strh r5, [r3, 0xE] - ldr r0, =gUnknown_82E9531 - ldrb r0, [r0] - strh r0, [r3, 0x10] - movs r5, 0 - adds r3, 0x4 -_08184F90: - adds r0, r5, r3 - ldr r1, [r4] - adds r1, r5 - ldrb r1, [r1] - strb r1, [r0] - adds r5, 0x1 - cmp r5, 0x7 - ble _08184F90 -_08184FA0: - 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_8184E58 - - thumb_func_start sub_8184FBC -sub_8184FBC: @ 8184FBC - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - ldr r1, =0x0203c794 - lsls r0, r5, 1 - adds r4, r0, r1 - ldrh r2, [r4] - adds r3, r2, 0 - ldr r0, =0x00000297 - cmp r3, r0 - bhi _08184FF0 - ldr r0, =0x0203c7ac - ldrb r0, [r0] - cmp r0, 0x2 - beq _08184FF0 - ldr r1, =0x0203bd34 - adds r0, r2, 0x1 - strh r0, [r4] - movs r0, 0xA6 - lsls r0, 2 - muls r0, r5 - adds r0, r3, r0 - adds r0, r1 - strb r6, [r0] -_08184FF0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8184FBC - - thumb_func_start sub_8185008 -sub_8185008: @ 8185008 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - movs r3, 0 - cmp r3, r4 - bge _08185046 - ldr r0, =0x0203c794 - lsls r1, r5, 1 - adds r2, r1, r0 - ldr r7, =0x0203bd34 - movs r0, 0xA6 - lsls r0, 2 - muls r5, r0 - movs r6, 0xFF -_08185028: - ldrh r0, [r2] - subs r0, 0x1 - strh r0, [r2] - ldrh r1, [r2] - adds r1, r5 - adds r1, r7 - ldrb r0, [r1] - orrs r0, r6 - strb r0, [r1] - ldrh r0, [r2] - cmp r0, 0 - beq _08185046 - adds r3, 0x1 - cmp r3, r4 - blt _08185028 -_08185046: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8185008 - - thumb_func_start sub_8185054 -sub_8185054: @ 8185054 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, =0x0203c794 - lsls r0, r3, 1 - adds r2, r0, r1 - ldrh r1, [r2] - ldr r0, =0x00000297 - cmp r1, r0 - bhi _0818507A - ldr r4, =0x0203bd34 - adds r0, 0x1 - muls r3, r0 - adds r0, r1, r3 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081850BC -_0818507A: - ldr r2, =0x020375f0 - ldr r1, =0x0202433a - movs r0, 0x5 - strb r0, [r1] - movs r0, 0x5 - strh r0, [r2] - bl pal_fade_control_reset_maybe - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl pal_fade_maybe - ldr r0, =sub_80384E4 - bl SetMainCallback2 - movs r0, 0xFF - b _081850C6 - .pool -_081850BC: - adds r0, r1, 0x1 - strh r0, [r2] - adds r0, r1, r3 - adds r0, r4 - ldrb r0, [r0] -_081850C6: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8185054 - - thumb_func_start sub_81850D0 -sub_81850D0: @ 81850D0 - ldr r0, =0x0203c7ac - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_81850D0 - - thumb_func_start sub_81850DC -sub_81850DC: @ 81850DC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r0 - movs r7, 0 - movs r0, 0 - mov r12, r0 -_081850F0: - mov r1, r12 - lsls r3, r1, 1 - ldr r0, =0x0203c794 - adds r5, r3, r0 - ldr r1, =0x0203c79c - adds r6, r3, r1 - ldrh r0, [r5] - mov r9, r3 - mov r1, r12 - adds r1, 0x1 - str r1, [sp] - ldrh r1, [r6] - cmp r0, r1 - beq _0818517E - adds r1, r7, 0 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - adds r2, r7, 0 - add r1, r8 - mov r0, r12 - strb r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - add r2, r8 - ldrb r0, [r5] - ldrb r1, [r6] - subs r0, r1 - strb r0, [r2] - movs r4, 0 - ldrh r0, [r5] - ldrh r1, [r6] - subs r0, r1 - cmp r4, r0 - bge _08185172 - ldr r1, =0x0203bd34 - mov r10, r1 - ldr r6, =0x0203c79c - movs r0, 0xA6 - lsls r0, 2 - mov r5, r12 - muls r5, r0 -_08185146: - adds r1, r7, 0 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - add r1, r8 - adds r2, r3, r6 - ldrh r0, [r2] - adds r0, r4 - adds r0, r5 - add r0, r10 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x0203c794 - adds r0, r3, r1 - ldrh r1, [r0] - ldrh r0, [r2] - subs r1, r0 - cmp r4, r1 - blt _08185146 -_08185172: - ldr r0, =0x0203c79c - add r0, r9 - ldr r1, =0x0203c794 - add r1, r9 - ldrh r1, [r1] - strh r1, [r0] -_0818517E: - ldr r1, [sp] - lsls r0, r1, 24 - lsrs r0, 24 - mov r12, r0 - cmp r0, 0x3 - bls _081850F0 - adds r0, r7, 0 - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81850DC - - thumb_func_start sub_81851A8 -sub_81851A8: @ 81851A8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r7, r0, 0 - movs r1, 0x2 - mov r0, sp - strb r1, [r0] - ldr r0, =0x02022fec - ldr r0, [r0] - ands r0, r1 - cmp r0, 0 - beq _0818525E - movs r5, 0 - ldr r4, =0x020229e8 - b _081851DA - .pool -_081851D0: - ldrb r0, [r4] - cmp r0, 0x3 - bne _0818525E - adds r4, 0x1C - adds r5, 0x1 -_081851DA: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - blt _081851D0 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x4 - ands r0, r1 - cmp r0, 0 - bne _0818525E - ldrb r0, [r7] - mov r4, sp - adds r4, 0x1 - strb r0, [r4] - ldrb r0, [r4] - mov r8, r4 - cmp r0, 0 - beq _0818525E -_08185202: - adds r0, r7, 0 - mov r1, sp - adds r2, r4, 0 - bl sub_8185278 - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r7, 0 - mov r1, sp - adds r2, r4, 0 - bl sub_8185278 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _08185256 - ldr r3, =0x0203bd34 - ldr r0, =0x0203c7a4 - lsls r1, r6, 1 - adds r4, r1, r0 - adds r5, r2, 0 - movs r0, 0xA6 - lsls r0, 2 - muls r6, r0 -_08185232: - adds r0, r7, 0 - mov r1, sp - mov r2, r8 - str r3, [sp, 0x4] - bl sub_8185278 - ldrh r1, [r4] - adds r2, r1, 0x1 - strh r2, [r4] - lsls r1, 16 - lsrs r1, 16 - adds r1, r6 - ldr r3, [sp, 0x4] - adds r1, r3 - strb r0, [r1] - subs r5, 0x1 - cmp r5, 0 - bne _08185232 -_08185256: - mov r4, r8 - ldrb r0, [r4] - cmp r0, 0 - bne _08185202 -_0818525E: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81851A8 - - thumb_func_start sub_8185278 -sub_8185278: @ 8185278 - ldrb r3, [r2] - subs r3, 0x1 - strb r3, [r2] - ldrb r2, [r1] - adds r3, r2, 0x1 - strb r3, [r1] - lsls r2, 24 - lsrs r2, 24 - adds r0, r2 - ldrb r0, [r0] - bx lr - thumb_func_end sub_8185278 - - thumb_func_start sub_8185290 -sub_8185290: @ 8185290 - push {r4,r5,lr} - movs r0, 0xF8 - lsls r0, 4 - bl AllocZeroed - adds r4, r0, 0 - bl start_ov_to_battle_anim - adds r5, r0, 0 - adds r0, r4, 0 - bl Free - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8185290 - - thumb_func_start sub_81852B0 -sub_81852B0: @ 81852B0 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r1, =0x000004ec - adds r0, r5, r1 - ldr r1, [r0] - cmp r1, 0 - beq _081852E8 - ldr r0, =0x7d007e92 - ands r1, r0 - cmp r1, 0 - bne _081852E8 - ldr r4, =0x00000f7c - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_806F96C - adds r4, r5, r4 - ldr r1, [r4] - cmp r0, r1 - bne _081852E8 - movs r0, 0x1 - b _081852EA - .pool -_081852E8: - movs r0, 0 -_081852EA: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81852B0 - - thumb_func_start sub_81852F0 -sub_81852F0: @ 81852F0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x80 - lsls r2, 5 - adds r0, r5, 0 - movs r1, 0 - bl memset - movs r2, 0xF8 - lsls r2, 4 - adds r0, r5, 0 - adds r1, r4, 0 - bl memcpy - ldr r4, =0x00000f7c - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_806F96C - adds r4, r5, r4 - str r0, [r4] - movs r0, 0x1F - adds r1, r5, 0 - bl sub_8153634 - cmp r0, 0x1 - bne _08185330 - movs r0, 0x1 - b _08185332 - .pool -_08185330: - movs r0, 0 -_08185332: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81852F0 - - thumb_func_start sub_8185338 -sub_8185338: @ 8185338 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - movs r0, 0 - str r0, [sp, 0x4] - movs r0, 0xF8 - lsls r0, 4 - bl AllocZeroed - adds r7, r0, 0 - movs r0, 0x80 - lsls r0, 5 - bl AllocZeroed - str r0, [sp] - movs r6, 0 -_0818535E: - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - adds r5, r7, r4 - ldr r1, =0x0203c7c0 - adds r1, r4, r1 - adds r0, r5, 0 - movs r2, 0x64 - bl memcpy - movs r1, 0x96 - lsls r1, 2 - adds r5, r1 - ldr r0, =0x0203ca18 - adds r4, r0 - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x64 - bl memcpy - adds r6, 0x1 - cmp r6, 0x5 - ble _0818535E - movs r6, 0 - ldr r2, =0x03005d90 - mov r9, r2 - movs r3, 0x9A - lsls r3, 3 - adds r3, r7, r3 - str r3, [sp, 0x8] - ldr r5, =0x0203cc80 - mov r8, r6 - mov r12, r6 - movs r4, 0x96 - lsls r4, 3 - adds r4, r7 - mov r10, r4 - ldr r0, =0x000004e4 - adds r4, r7, r0 -_081853AC: - lsls r1, r6, 3 - ldr r0, =0x0203cc80 - adds r0, 0x4 - mov r3, r8 - adds r2, r3, r0 - add r1, r10 - movs r3, 0x7 -_081853BA: - ldrb r0, [r2] - strb r0, [r1] - adds r2, 0x1 - adds r1, 0x1 - subs r3, 0x1 - cmp r3, 0 - bge _081853BA - ldr r0, [sp, 0x8] - adds r1, r0, r6 - ldrb r0, [r5, 0xC] - strb r0, [r1] - ldrh r0, [r5, 0x10] - strb r0, [r4] - ldrh r0, [r5, 0xE] - strb r0, [r4, 0xC] - ldr r1, =0x000004d4 - adds r0, r7, r1 - add r0, r12 - ldr r1, [r5] - str r1, [r0] - adds r5, 0x14 - movs r2, 0x14 - add r8, r2 - movs r3, 0x4 - add r12, r3 - adds r4, 0x1 - adds r6, 0x1 - cmp r6, 0x3 - ble _081853AC - movs r4, 0x9D - lsls r4, 3 - adds r1, r7, r4 - ldr r5, =0x0203bd2c - ldr r0, [r5] - str r0, [r1] - ldr r0, =0x0203c7b8 - ldr r2, [r0] - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - beq _081854DC - ldr r1, =0x000004ec - adds r3, r7, r1 - movs r1, 0x23 - negs r1, r1 - ands r1, r2 - movs r0, 0x80 - lsls r0, 18 - orrs r1, r0 - str r1, [r3] - movs r0, 0x4 - ands r0, r2 - cmp r0, 0 - beq _08185454 - movs r0, 0x80 - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081854E2 - .pool -_08185454: - movs r0, 0x40 - ands r2, r0 - cmp r2, 0 - beq _081854E2 - ldr r2, =0x0203cc80 - ldrh r0, [r2, 0xE] - cmp r0, 0x1 - beq _081854A8 - cmp r0, 0x1 - bgt _08185474 - cmp r0, 0 - beq _0818547E - b _081854E2 - .pool -_08185474: - cmp r0, 0x2 - beq _0818547E - cmp r0, 0x3 - beq _081854A8 - b _081854E2 -_0818547E: - ldr r3, =0x0203c7b4 - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x0203cc80 - adds r0, r4 - ldrh r1, [r0, 0xE] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081854E2 - ldr r5, =0x000004ec - adds r0, r7, r5 - b _081854C4 - .pool -_081854A8: - ldr r0, =0x0203c7b4 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x0203cc80 - adds r0, r1 - ldrh r1, [r0, 0xE] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081854E2 - ldr r2, =0x000004ec - adds r0, r7, r2 -_081854C4: - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 24 - orrs r1, r2 - str r1, [r0] - b _081854E2 - .pool -_081854DC: - ldr r3, =0x000004ec - adds r0, r7, r3 - str r2, [r0] -_081854E2: - ldr r4, =0x02038bca - ldrh r1, [r4] - ldr r5, =0x000004f4 - adds r0, r7, r5 - strh r1, [r0] - ldr r0, =0x02038bcc - ldrh r1, [r0] - ldr r2, =0x000004f6 - adds r0, r7, r2 - strh r1, [r0] - ldr r3, =0x02038bce - ldrh r1, [r3] - movs r4, 0x9F - lsls r4, 3 - adds r0, r7, r4 - strh r1, [r0] - ldr r5, =0x0203c7b4 - ldrb r1, [r5] - adds r2, 0x4 - adds r0, r7, r2 - strh r1, [r0] - mov r3, r9 - ldr r0, [r3] - ldr r4, =0x00000ca9 - adds r0, r4 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - ldr r5, =0x000004fc - adds r1, r7, r5 - strb r0, [r1] - ldr r0, =0x0203c7ae - ldrb r1, [r0] - adds r2, 0x3 - adds r0, r7, r2 - strb r1, [r0] - ldr r3, =0x0203c7af - ldrb r1, [r3] - ldr r4, =0x000004fe - adds r0, r7, r4 - strb r1, [r0] - mov r5, r9 - ldr r0, [r5] - ldrb r1, [r0, 0x15] - lsls r1, 29 - ldr r0, =0x000004ff - adds r3, r7, r0 - lsrs r1, 31 - ldrb r2, [r3] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - ldr r1, [r5] - ldrb r1, [r1, 0x14] - lsls r1, 29 - lsrs r1, 28 - movs r2, 0xF - negs r2, r2 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - movs r2, 0xA0 - lsls r2, 3 - adds r1, r7, r2 - ldr r3, =0x0203c7bc - ldr r0, [r3] - str r0, [r1] - ldr r4, =0xfffffed4 - adds r1, r4, 0 - ldr r5, =0x02038bca - ldrh r5, [r5] - adds r0, r1, r5 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x63 - bls _08185580 - b _081856C4 -_08185580: - movs r6, 0 - ldr r0, =0x00000504 - adds r3, r7, r0 - mov r10, r9 - ldr r1, =0x02038bca - mov r12, r1 - adds r2, r4, 0 - mov r8, r2 - ldr r4, =0x0000073c -_08185592: - adds r2, r3, r6 - mov r5, r10 - ldr r1, [r5] - mov r5, r12 - ldrh r0, [r5] - add r0, r8 - movs r5, 0xEC - muls r0, r5 - adds r0, r6, r0 - adds r1, r4 - adds r1, r0 - ldrb r0, [r1] - strb r0, [r2] - adds r6, 0x1 - cmp r6, 0x7 - ble _08185592 - mov r0, r9 - ldr r2, [r0] - ldr r1, =0x02038bca - ldrh r0, [r1] - ldr r3, =0xfffffed4 - adds r0, r3 - movs r1, 0xEC - muls r0, r1 - adds r2, r0 - ldr r4, =0x00000739 - adds r2, r4 - ldrb r1, [r2] - ldr r5, =0x0000050c - adds r0, r7, r5 - strb r1, [r0] - ldr r1, =0x0203cce8 - ldrb r0, [r1] - cmp r0, 0x1 - bne _08185664 - movs r6, 0 - ldr r2, =0x0000050e - adds r4, r7, r2 - mov r10, r9 - ldr r5, =0x02038bca - mov r8, r5 - adds r5, r3, 0 -_081855E6: - lsls r3, r6, 1 - mov r0, r10 - ldr r2, [r0] - mov r1, r8 - ldrh r0, [r1] - adds r0, r5 - movs r1, 0xEC - muls r0, r1 - adds r3, r0 - movs r0, 0xEC - lsls r0, 3 - adds r2, r0 - adds r2, r3 - ldrh r0, [r2] - strh r0, [r4] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x5 - ble _081855E6 - b _08185696 - .pool -_08185664: - movs r6, 0 - ldr r1, =0x0000050e - adds r4, r7, r1 - mov r10, r9 - ldr r2, =0x02038bca - mov r8, r2 - adds r5, r3, 0 -_08185672: - lsls r3, r6, 1 - mov r0, r10 - ldr r2, [r0] - mov r1, r8 - ldrh r0, [r1] - adds r0, r5 - movs r1, 0xEC - muls r0, r1 - adds r3, r0 - ldr r0, =0x00000754 - adds r2, r0 - adds r2, r3 - ldrh r0, [r2] - strh r0, [r4] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x5 - ble _08185672 -_08185696: - mov r1, r9 - ldr r2, [r1] - ldr r3, =0x02038bca - ldrh r0, [r3] - ldr r4, =0xfffffed4 - adds r0, r4 - movs r1, 0xEC - muls r0, r1 - adds r2, r0 - ldr r5, =0x0000081c - adds r2, r5 - ldrb r1, [r2] - b _08185856 - .pool -_081856C4: - ldr r3, =0x02038bcc - ldrh r3, [r3] - adds r0, r1, r3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x63 - bls _081856D4 - b _081857E4 -_081856D4: - movs r6, 0 - ldr r4, =0x00000504 - adds r3, r7, r4 - mov r10, r9 - ldr r5, =0x02038bcc - mov r12, r5 - ldr r0, =0xfffffed4 - mov r8, r0 - ldr r4, =0x0000073c -_081856E6: - adds r2, r3, r6 - mov r5, r10 - ldr r1, [r5] - mov r5, r12 - ldrh r0, [r5] - add r0, r8 - movs r5, 0xEC - muls r0, r5 - adds r0, r6, r0 - adds r1, r4 - adds r1, r0 - ldrb r0, [r1] - strb r0, [r2] - adds r6, 0x1 - cmp r6, 0x7 - ble _081856E6 - mov r0, r9 - ldr r2, [r0] - ldr r1, =0x02038bcc - ldrh r0, [r1] - ldr r3, =0xfffffed4 - adds r0, r3 - movs r1, 0xEC - muls r0, r1 - adds r2, r0 - ldr r4, =0x00000739 - adds r2, r4 - ldrb r1, [r2] - ldr r5, =0x0000050c - adds r0, r7, r5 - strb r1, [r0] - ldr r1, =0x0203cce8 - ldrb r0, [r1] - cmp r0, 0x1 - bne _08185784 - movs r6, 0 - ldr r2, =0x0000050e - adds r4, r7, r2 - mov r10, r9 - ldr r5, =0x02038bcc - mov r8, r5 - adds r5, r3, 0 -_0818573A: - lsls r3, r6, 1 - mov r0, r10 - ldr r2, [r0] - mov r1, r8 - ldrh r0, [r1] - adds r0, r5 - movs r1, 0xEC - muls r0, r1 - adds r3, r0 - movs r0, 0xEC - lsls r0, 3 - adds r2, r0 - adds r2, r3 - ldrh r0, [r2] - strh r0, [r4] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x5 - ble _0818573A - b _081857B6 - .pool -_08185784: - movs r6, 0 - ldr r1, =0x0000050e - adds r4, r7, r1 - mov r10, r9 - ldr r2, =0x02038bcc - mov r8, r2 - adds r5, r3, 0 -_08185792: - lsls r3, r6, 1 - mov r0, r10 - ldr r2, [r0] - mov r1, r8 - ldrh r0, [r1] - adds r0, r5 - movs r1, 0xEC - muls r0, r1 - adds r3, r0 - ldr r0, =0x00000754 - adds r2, r0 - adds r2, r3 - ldrh r0, [r2] - strh r0, [r4] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x5 - ble _08185792 -_081857B6: - mov r1, r9 - ldr r2, [r1] - ldr r3, =0x02038bcc - ldrh r0, [r3] - ldr r4, =0xfffffed4 - adds r0, r4 - movs r1, 0xEC - muls r0, r1 - adds r2, r0 - ldr r5, =0x0000081c - adds r2, r5 - ldrb r1, [r2] - b _08185856 - .pool -_081857E4: - ldr r3, =0x02038bce - ldrh r3, [r3] - adds r0, r1, r3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x63 - bhi _0818585C - movs r6, 0 - ldr r4, =0x00000504 - adds r3, r7, r4 - mov r10, r9 - ldr r5, =0x02038bce - mov r12, r5 - ldr r0, =0xfffffed4 - mov r8, r0 - ldr r4, =0x0000073c -_08185804: - adds r2, r3, r6 - mov r5, r10 - ldr r1, [r5] - mov r5, r12 - ldrh r0, [r5] - add r0, r8 - movs r5, 0xEC - muls r0, r5 - adds r0, r6, r0 - adds r1, r4 - adds r1, r0 - ldrb r0, [r1] - strb r0, [r2] - adds r6, 0x1 - cmp r6, 0x7 - ble _08185804 - mov r0, r9 - ldr r1, [r0] - ldr r2, =0x02038bce - ldrh r0, [r2] - ldr r3, =0xfffffed4 - adds r0, r3 - movs r2, 0xEC - muls r0, r2 - adds r1, r0 - ldr r4, =0x00000739 - adds r1, r4 - ldrb r1, [r1] - ldr r5, =0x0000050c - adds r0, r7, r5 - strb r1, [r0] - mov r0, r9 - ldr r1, [r0] - ldr r4, =0x02038bce - ldrh r0, [r4] - adds r0, r3 - muls r0, r2 - adds r1, r0 - ldr r5, =0x0000081c - adds r1, r5 - ldrb r1, [r1] -_08185856: - ldr r2, =0x0000051a - adds r0, r7, r2 - strb r1, [r0] -_0818585C: - ldr r3, =0x02038bca - ldrh r0, [r3] - ldr r1, =0x0000018f - cmp r0, r1 - bls _08185900 - mov r4, r9 - ldr r2, [r4] - adds r1, r0, 0 - ldr r3, =0xfffffe70 - adds r1, r3 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, r0 - adds r2, 0xDC - ldrb r0, [r2] - lsls r0, 27 - lsrs r0, 27 - ldr r5, =0x0000050d - adds r1, r7, r5 - strb r0, [r1] - movs r6, 0 - ldr r0, =0x0000050e - adds r4, r7, r0 - mov r10, r9 - ldr r1, =0x02038bca - mov r8, r1 - adds r5, r3, 0 -_08185894: - lsls r3, r6, 1 - mov r0, r10 - ldr r2, [r0] - mov r0, r8 - ldrh r1, [r0] - adds r1, r5 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, r0 - movs r1, 0x82 - lsls r1, 1 - adds r2, r1 - adds r2, r3 - ldrh r0, [r2] - strh r0, [r4] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x5 - ble _08185894 - mov r3, r9 - ldr r2, [r3] - ldr r4, =0x02038bca - ldrh r1, [r4] - ldr r5, =0xfffffe70 - adds r1, r5 - b _081859AC - .pool -_08185900: - ldr r3, =0x02038bcc - ldrh r0, [r3] - cmp r0, r1 - bls _0818597C - mov r4, r9 - ldr r2, [r4] - adds r1, r0, 0 - ldr r3, =0xfffffe70 - adds r1, r3 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, r0 - adds r2, 0xDC - ldrb r0, [r2] - lsls r0, 27 - lsrs r0, 27 - ldr r5, =0x0000050d - adds r1, r7, r5 - strb r0, [r1] - movs r6, 0 - ldr r0, =0x0000050e - adds r4, r7, r0 - mov r10, r9 - ldr r1, =0x02038bcc - mov r8, r1 - adds r5, r3, 0 -_08185936: - lsls r3, r6, 1 - mov r0, r10 - ldr r2, [r0] - mov r0, r8 - ldrh r1, [r0] - adds r1, r5 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, r0 - movs r1, 0x82 - lsls r1, 1 - adds r2, r1 - adds r2, r3 - ldrh r0, [r2] - strh r0, [r4] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x5 - ble _08185936 - mov r3, r9 - ldr r2, [r3] - ldr r4, =0x02038bcc - ldrh r1, [r4] - ldr r5, =0xfffffe70 - adds r1, r5 - b _081859AC - .pool -_0818597C: - ldr r3, =0x02038bce - ldrh r0, [r3] - cmp r0, r1 - bls _081859C0 - mov r4, r9 - ldr r2, [r4] - adds r1, r0, 0 - ldr r3, =0xfffffe70 - adds r1, r3 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, r0 - adds r2, 0xDC - ldrb r0, [r2] - lsls r0, 27 - lsrs r0, 27 - ldr r5, =0x0000050d - adds r1, r7, r5 - strb r0, [r1] - ldr r2, [r4] - ldr r0, =0x02038bce - ldrh r1, [r0] - adds r1, r3 -_081859AC: - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, r0 - ldr r1, =0x0000011b - adds r0, r2, r1 - ldrb r1, [r0] - ldr r2, =0x0000051b - adds r0, r7, r2 - strb r1, [r0] -_081859C0: - movs r6, 0 - ldr r3, =0x00000297 - mov r10, r3 - ldr r4, =0x0203bd34 - mov r9, r4 - movs r5, 0xA6 - lsls r5, 2 - mov r8, r5 - ldr r0, =0x0000051c - adds r5, r7, r0 -_081859D4: - adds r4, r6, 0x1 - mov r0, r8 - muls r0, r6 - mov r1, r9 - adds r2, r0, r1 - adds r1, r0, r5 - mov r3, r10 - adds r3, 0x1 -_081859E4: - ldrb r0, [r2] - strb r0, [r1] - adds r2, 0x1 - adds r1, 0x1 - subs r3, 0x1 - cmp r3, 0 - bne _081859E4 - adds r6, r4, 0 - cmp r6, 0x3 - ble _081859D4 -_081859F8: - adds r0, r7, 0 - ldr r1, [sp] - bl sub_81852F0 - adds r4, r0, 0 - cmp r4, 0x1 - beq _08185A14 - ldr r0, [sp, 0x4] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - cmp r0, 0x2 - bls _081859F8 -_08185A14: - adds r0, r7, 0 - bl Free - ldr r0, [sp] - bl Free - adds r0, r4, 0 - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8185338 - - thumb_func_start sub_8185A54 -sub_8185A54: @ 8185A54 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r0, 0x1F - bl sub_81535DC - cmp r0, 0x1 - bne _08185A7E - movs r2, 0xF8 - lsls r2, 4 - adds r0, r5, 0 - adds r1, r4, 0 - bl memcpy - adds r0, r5, 0 - bl sub_81852B0 - cmp r0, 0 - beq _08185A7E - movs r0, 0x1 - b _08185A80 -_08185A7E: - movs r0, 0 -_08185A80: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8185A54 - - thumb_func_start start_ov_to_battle_anim -start_ov_to_battle_anim: @ 8185A88 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x80 - lsls r0, 5 - bl AllocZeroed - adds r5, r0, 0 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8185A54 - adds r4, r0, 0 - adds r0, r5, 0 - bl Free - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end start_ov_to_battle_anim - - thumb_func_start sub_8185AB0 -sub_8185AB0: @ 8185AB0 - push {lr} - ldr r0, =0x03005d90 - ldr r2, [r0] - ldr r0, =0x0203c7ad - 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] - ldr r1, =0x0202433a - movs r0, 0 - strb r0, [r1] - ldr r0, =0x02022fec - movs r1, 0 - str r1, [r0] - ldr r0, =0x02038bca - strh r1, [r0] - ldr r0, =0x02038bcc - strh r1, [r0] - ldr r0, =0x02038bce - strh r1, [r0] - bl sub_8185EFC - ldr r0, =0x0203c7b0 - ldr r0, [r0] - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8185AB0 - - thumb_func_start sub_8185B1C -sub_8185B1C: @ 8185B1C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x8] - subs r1, 0x1 - strh r1, [r0, 0x8] - lsls r1, 16 - cmp r1, 0 - bne _08185B4A - ldr r0, =0x030022c0 - ldr r1, =sub_8185AB0 - str r1, [r0, 0x8] - ldr r0, =sub_8036760 - bl SetMainCallback2 - adds r0, r4, 0 - bl DestroyTask -_08185B4A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8185B1C - - thumb_func_start sub_8185B60 -sub_8185B60: @ 8185B60 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r7, r0, 0 - bl zero_player_party_data - bl zero_enemy_party_data - movs r6, 0 - ldr r0, =0x020244ec - mov r8, r0 -_08185B7C: - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - mov r1, r8 - adds r0, r4, r1 - adds r5, r7, r4 - adds r1, r5, 0 - movs r2, 0x64 - bl memcpy - ldr r0, =0x02024744 - adds r4, r0 - movs r2, 0x96 - lsls r2, 2 - adds r5, r2 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x64 - bl memcpy - adds r6, 0x1 - cmp r6, 0x5 - ble _08185B7C - movs r6, 0 - ldr r3, =0x020229e8 - mov r8, r3 - mov r0, r8 - adds r0, 0x8 - str r0, [sp] - mov r4, r8 - adds r4, 0x4 - mov r10, r6 - mov r9, r6 -_08185BBE: - movs r1, 0 - mov r12, r1 - lsls r5, r6, 2 - movs r2, 0x96 - lsls r2, 3 - adds r0, r7, r2 - mov r3, r9 - adds r2, r3, r0 - mov r0, r10 - lsls r1, r0, 2 - mov r0, r8 - adds r0, 0x8 - adds r1, r0 - movs r3, 0x7 -_08185BDA: - ldrb r0, [r2] - strb r0, [r1] - ldrb r0, [r2] - cmp r0, 0xFF - bne _08185BE8 - movs r0, 0x1 - mov r12, r0 -_08185BE8: - adds r2, 0x1 - adds r1, 0x1 - subs r3, 0x1 - cmp r3, 0 - bge _08185BDA - movs r1, 0x9A - lsls r1, 3 - adds r0, r7, r1 - adds r0, r6 - ldrb r0, [r0] - strb r0, [r4, 0xF] - ldr r2, =0x000004e4 - adds r0, r7, r2 - adds r0, r6 - ldrb r1, [r0] - strh r1, [r4, 0x16] - movs r3, 0x9E - lsls r3, 3 - adds r0, r7, r3 - adds r0, r6 - ldrb r0, [r0] - strh r0, [r4, 0x14] - subs r2, 0x10 - adds r0, r7, r2 - adds r0, r5 - ldr r0, [r0] - str r0, [r4] - mov r3, r12 - cmp r3, 0 - beq _08185C2A - ldr r0, [sp] - bl StopMusicWhileStringIsPrinted -_08185C2A: - ldr r0, [sp] - adds r0, 0x1C - str r0, [sp] - adds r4, 0x1C - movs r1, 0x7 - add r10, r1 - movs r2, 0x8 - add r9, r2 - adds r6, 0x1 - cmp r6, 0x3 - ble _08185BBE - ldr r1, =0x0203bd2c - movs r3, 0x9D - lsls r3, 3 - adds r0, r7, r3 - ldr r0, [r0] - str r0, [r1] - ldr r2, =0x02022fec - ldr r1, =0x000004ec - adds r0, r7, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - orrs r0, r1 - str r0, [r2] - ldr r1, =0x02038bca - ldr r2, =0x000004f4 - adds r0, r7, r2 - ldrh r0, [r0] - strh r0, [r1] - ldr r1, =0x02038bcc - adds r3, 0xE - adds r0, r7, r3 - ldrh r0, [r0] - strh r0, [r1] - ldr r1, =0x02038bce - adds r2, 0x4 - adds r0, r7, r2 - ldrh r0, [r0] - strh r0, [r1] - ldr r1, =0x0203c7b4 - adds r3, 0x4 - adds r0, r7, r3 - ldrh r0, [r0] - strb r0, [r1] - ldr r1, =0x0203c7ad - ldr r3, =0x03005d90 - ldr r0, [r3] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - strb r0, [r1] - ldr r1, =0x0203c7ae - ldr r2, =0x000004fd - adds r0, r7, r2 - ldrb r0, [r0] - strb r0, [r1] - ldr r1, =0x0203c7af - adds r2, 0x1 - adds r0, r7, r2 - ldrb r0, [r0] - strb r0, [r1] - ldr r2, =0x0203c7b6 - ldr r1, =0x000004ff - adds r0, r7, r1 - ldrb r1, [r0] - lsls r0, r1, 31 - lsrs r0, 31 - strb r0, [r2] - ldr r0, =0x0203c7b7 - lsls r1, 28 - lsrs r1, 29 - strb r1, [r0] - ldr r1, =0x0203c7bc - movs r2, 0xA0 - lsls r2, 3 - adds r0, r7, r2 - ldr r0, [r0] - str r0, [r1] - movs r6, 0 - mov r10, r3 - ldr r2, =0x0203ccd9 - ldr r3, =0x0203ccda - ldr r0, =0x03001278 - mov r8, r0 - ldr r1, =0x03001279 - mov r9, r1 - ldr r5, =0x0203ccd1 - ldr r0, =0x00000504 - adds r4, r7, r0 -_08185CE2: - adds r0, r6, r5 - adds r1, r4, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0x7 - ble _08185CE2 - ldr r1, =0x0000050c - adds r0, r7, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r2, =0x0000050d - adds r0, r7, r2 - ldrb r0, [r0] - strb r0, [r3] - ldr r3, =0x0000051a - adds r0, r7, r3 - ldrb r0, [r0] - mov r1, r8 - strb r0, [r1] - adds r2, 0xE - adds r0, r7, r2 - ldrb r0, [r0] - mov r3, r9 - strb r0, [r3] - ldr r0, =0x0000050e - adds r1, r7, r0 - ldr r4, =0x0203ccdc - movs r6, 0x5 -_08185D1C: - ldrh r0, [r1] - strh r0, [r4] - adds r1, 0x2 - adds r4, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _08185D1C - mov r1, r10 - ldr r2, [r1] - ldr r3, =0x000004fc - adds r0, r7, r3 - 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] - movs r6, 0 - ldr r2, =0x00000297 - mov r10, r2 - ldr r3, =0x0203bd34 - mov r9, r3 - movs r0, 0xA6 - lsls r0, 2 - mov r8, r0 - ldr r1, =0x0000051c - adds r5, r7, r1 -_08185D5C: - adds r2, r6, 0x1 - mov r0, r8 - muls r0, r6 - adds r1, r0, r5 - mov r3, r9 - adds r4, r0, r3 - mov r3, r10 - adds r3, 0x1 -_08185D6C: - ldrb r0, [r1] - strb r0, [r4] - adds r1, 0x1 - adds r4, 0x1 - subs r3, 0x1 - cmp r3, 0 - bne _08185D6C - adds r6, r2, 0 - cmp r6, 0x3 - ble _08185D5C - 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_8185B60 - - thumb_func_start sub_8185E24 -sub_8185E24: @ 8185E24 - push {r4,r5,lr} - adds r5, r0, 0 - movs r0, 0xF8 - lsls r0, 4 - bl AllocZeroed - adds r4, r0, 0 - bl start_ov_to_battle_anim - cmp r0, 0x1 - bne _08185E6E - bl sub_8185EB8 - adds r0, r4, 0 - bl sub_8185B60 - ldr r0, =sub_8185B1C - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0x80 - strh r0, [r1, 0x8] - ldr r0, =0x0203c7b0 - str r5, [r0] - movs r0, 0 - bl current_map_music_set__default_for_battle - ldr r0, =sub_8185E8C - bl SetMainCallback2 -_08185E6E: - adds r0, r4, 0 - bl Free - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8185E24 - - thumb_func_start sub_8185E8C -sub_8185E8C: @ 8185E8C - push {lr} - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTasks - pop {r0} - bx r0 - thumb_func_end sub_8185E8C - - thumb_func_start sub_8185EA0 -sub_8185EA0: @ 8185EA0 - ldr r0, =0x0203c7ae - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8185EA0 - - thumb_func_start sub_8185EAC -sub_8185EAC: @ 8185EAC - ldr r0, =0x0203c7af - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8185EAC - - thumb_func_start sub_8185EB8 -sub_8185EB8: @ 8185EB8 - push {r4-r6,lr} - movs r5, 0 - ldr r6, =0x0203c7c0 -_08185EBE: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - adds r0, r4, r6 - ldr r1, =0x020244ec - adds r1, r4, r1 - movs r2, 0x64 - bl memcpy - ldr r0, =0x0203ca18 - adds r0, r4, r0 - ldr r1, =0x02024744 - adds r4, r1 - adds r1, r4, 0 - movs r2, 0x64 - bl memcpy - adds r5, 0x1 - cmp r5, 0x5 - ble _08185EBE - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8185EB8 - - thumb_func_start sub_8185EFC -sub_8185EFC: @ 8185EFC - push {r4-r6,lr} - movs r5, 0 - ldr r6, =0x020244ec -_08185F02: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - adds r0, r4, r6 - ldr r1, =0x0203c7c0 - adds r1, r4, r1 - movs r2, 0x64 - bl memcpy - ldr r0, =0x02024744 - adds r0, r4, r0 - ldr r1, =0x0203ca18 - adds r4, r1 - adds r1, r4, 0 - movs r2, 0x64 - bl memcpy - adds r5, 0x1 - cmp r5, 0x5 - ble _08185F02 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8185EFC - - thumb_func_start sub_8185F40 -sub_8185F40: @ 8185F40 - push {r4,r5,lr} - movs r2, 0 - ldr r0, =0x020229e8 - ldr r3, =0x02024064 - ldrh r1, [r0, 0x18] - adds r4, r0, 0 - ldrb r0, [r3] - cmp r1, r0 - beq _08185F64 - adds r1, r4, 0 -_08185F54: - adds r1, 0x1C - adds r2, 0x1 - cmp r2, 0x3 - bgt _08185F64 - ldrh r0, [r1, 0x18] - ldrb r5, [r3] - cmp r0, r5 - bne _08185F54 -_08185F64: - cmp r2, 0x4 - bne _08185F74 - movs r0, 0 - b _08185F7E - .pool -_08185F74: - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x13] -_08185F7E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8185F40 - - thumb_func_start sub_8185F84 -sub_8185F84: @ 8185F84 - ldr r1, =0x0203c7b5 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8185F84 - - thumb_func_start sub_8185F90 -sub_8185F90: @ 8185F90 - lsls r0, 16 - lsrs r0, 16 - ldr r2, =0x0203c7b5 - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - lsls r0, 16 - lsrs r0, 31 - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - bx lr - .pool - thumb_func_end sub_8185F90 - - thumb_func_start sub_8185FAC -sub_8185FAC: @ 8185FAC - ldr r0, =0x0203c7b5 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8185FAC - - thumb_func_start sub_8185FB8 -sub_8185FB8: @ 8185FB8 - ldr r0, =0x0203c7b6 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8185FB8 - - thumb_func_start sub_8185FC4 -sub_8185FC4: @ 8185FC4 - ldr r0, =0x0203c7b7 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8185FC4 - - thumb_func_start sub_8185FD0 -sub_8185FD0: @ 8185FD0 - push {r4-r7,lr} - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0818601C - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x02000002 - ands r0, r1 - cmp r0, 0 - bne _0818601C - ldr r0, =0x0203c7ac - ldrb r0, [r0] - cmp r0, 0x2 - beq _0818601C - movs r3, 0 - ldr r7, =0x0203cc70 - adds r6, r4, 0 - ldr r5, =0x02024090 - movs r4, 0x58 -_08186000: - lsls r2, r3, 1 - ldrb r1, [r6] - lsrs r0, r1, 1 - lsls r0, 3 - adds r0, r2, r0 - adds r0, r7 - muls r1, r4 - adds r2, r1 - adds r2, r5 - ldrh r1, [r2] - strh r1, [r0] - adds r3, 0x1 - cmp r3, 0x3 - ble _08186000 -_0818601C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8185FD0 - - thumb_func_start sub_818603C -sub_818603C: @ 818603C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x50 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x24] - ldr r0, =0x02022fec - ldr r0, [r0] - ldr r1, =0x02000002 - ands r0, r1 - cmp r0, 0 - beq _0818605C - b _081863FC -_0818605C: - movs r0, 0 - mov r10, r0 - b _081863F2 - .pool -_0818606C: - mov r1, r10 - lsls r4, r1, 24 - lsrs r5, r4, 24 - adds r0, r5, 0 - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - str r4, [sp, 0x4C] - mov r2, r10 - adds r2, 0x1 - str r2, [sp, 0x38] - cmp r0, 0x1 - bne _0818608A - b _081863EE -_0818608A: - ldr r3, [sp, 0x24] - cmp r3, 0x1 - bne _0818611E - movs r5, 0 - ldr r4, =0x0203cc70 - mov r0, r10 - asrs r6, r0, 31 - subs r0, r6 - asrs r0, 1 - lsls r0, 3 - adds r2, r0, r4 - movs r1, 0x58 - mov r0, r10 - muls r0, r1 - ldr r3, =0x02024090 - adds r1, r0, r3 -_081860AA: - ldrh r0, [r1] - ldrh r4, [r2] - cmp r0, r4 - bne _081860BC - adds r2, 0x2 - adds r1, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _081860AA -_081860BC: - cmp r5, 0x4 - bne _081860C2 - b _081863EE -_081860C2: - ldr r1, [sp, 0x4C] - lsrs r0, r1, 24 - movs r1, 0x6 - bl sub_8184FBC - movs r5, 0 - ldr r2, =0x0203cc70 - mov r8, r2 - movs r3, 0x58 - mov r7, r10 - muls r7, r3 - mov r4, r10 - subs r0, r4, r6 - asrs r4, r0, 1 -_081860DE: - movs r2, 0 - lsls r0, r5, 1 - adds r5, 0x1 - adds r0, r7 - ldr r1, =0x02024090 - adds r3, r0, r1 - lsls r0, r4, 3 - mov r6, r8 - adds r1, r0, r6 -_081860F0: - ldrh r0, [r3] - ldrh r6, [r1] - cmp r0, r6 - bne _08186110 - lsls r1, r2, 24 - lsrs r1, 24 - ldr r2, [sp, 0x4C] - lsrs r0, r2, 24 - bl sub_8184FBC - b _08186118 - .pool -_08186110: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, 0x3 - ble _081860F0 -_08186118: - cmp r5, 0x3 - ble _081860DE - b _081863EE -_0818611E: - ldr r3, =0x0203bd34 - ldr r1, =0x0203c794 - mov r4, r10 - lsls r2, r4, 1 - adds r1, r2, r1 - movs r0, 0xA6 - lsls r0, 2 - mov r6, r10 - muls r6, r0 - adds r0, r6, 0 - ldrh r1, [r1] - adds r0, r1 - adds r0, r3 - ldrb r0, [r0] - str r2, [sp, 0x44] - cmp r0, 0x6 - beq _08186142 - b _081863EE -_08186142: - adds r0, r5, 0 - bl sub_8185054 - movs r5, 0 - mov r0, sp - adds r0, 0x4 - str r0, [sp, 0x28] - mov r1, sp - adds r1, 0xC - str r1, [sp, 0x30] - mov r2, sp - adds r2, 0x14 - str r2, [sp, 0x34] - mov r3, sp - adds r3, 0x18 - str r3, [sp, 0x3C] - mov r4, sp - adds r4, 0x8 - str r4, [sp, 0x2C] - mov r6, r10 - lsls r6, 3 - str r6, [sp, 0x48] - movs r1, 0x58 - mov r0, r10 - muls r0, r1 - ldr r2, =0x02024084 - adds r0, r2 - adds r6, r0, 0 - adds r6, 0x3B - movs r4, 0x3 -_0818617E: - mov r0, sp - adds r3, r0, r5 - ldrb r1, [r6] - lsls r2, r5, 1 - adds r0, r4, 0 - lsls r0, r2 - ands r1, r0 - asrs r1, r2 - strb r1, [r3] - adds r5, 0x1 - cmp r5, 0x3 - ble _0818617E - movs r5, 0 - ldr r1, =0x02024084 - mov r9, r1 - movs r2, 0x58 - mov r7, r10 - muls r7, r2 - ldr r4, [sp, 0x28] - ldr r6, [sp, 0x30] -_081861A6: - ldr r3, [sp, 0x4C] - lsrs r0, r3, 24 - bl sub_8185054 - strb r0, [r4] - ldrb r0, [r4] - lsls r0, 1 - adds r0, r7 - movs r1, 0xC - add r1, r9 - mov r8, r1 - add r0, r8 - ldrh r0, [r0] - strh r0, [r6] - ldr r2, [sp, 0x34] - adds r1, r2, r5 - ldrb r0, [r4] - adds r0, r7 - ldr r3, =0x020240a8 - adds r0, r3 - ldrb r0, [r0] - strb r0, [r1] - ldr r0, [sp, 0x3C] - adds r1, r0, r5 - ldrb r0, [r4] - add r0, sp - ldrb r0, [r0] - strb r0, [r1] - ldr r1, [sp, 0x2C] - adds r3, r1, r5 - ldr r2, [sp, 0x48] - mov r1, r10 - subs r0, r2, r1 - lsls r0, 2 - ldr r2, =0x020242bc - adds r0, r2 - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gUnknown_0832A328 - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - lsrs r1, r5 - strb r1, [r3] - adds r4, 0x1 - adds r6, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _081861A6 - movs r5, 0 - movs r3, 0xC - negs r3, r3 - add r3, r8 - mov r12, r3 - ldr r4, =0x020242bc - mov r9, r4 - movs r6, 0x58 - mov r1, r10 - muls r1, r6 - mov r0, r8 - adds r0, 0x18 - adds r4, r1, r0 - adds r3, r1, 0 - mov r7, r8 - ldr r6, [sp, 0x34] - ldr r2, [sp, 0x30] -_0818622C: - adds r1, r3, r7 - ldrh r0, [r2] - strh r0, [r1] - adds r0, r6, r5 - ldrb r0, [r0] - strb r0, [r4] - adds r4, 0x1 - adds r3, 0x2 - adds r2, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _0818622C - movs r0, 0x58 - mov r4, r10 - muls r4, r0 - mov r1, r12 - adds r0, r4, r1 - adds r0, 0x3B - movs r1, 0 - strb r1, [r0] - ldr r2, [sp, 0x48] - mov r6, r10 - subs r3, r2, r6 - lsls r3, 2 - mov r0, r9 - adds r2, r3, r0 - ldrb r1, [r2, 0x18] - movs r0, 0xF - ands r0, r1 - strb r0, [r2, 0x18] - movs r5, 0 - ldr r1, =0x02024084 - adds r4, r1 - adds r4, 0x3B - ldr r0, =0x020242bc - adds r6, r3, r0 -_08186274: - ldr r2, [sp, 0x3C] - adds r0, r2, r5 - ldrb r0, [r0] - lsls r1, r5, 1 - lsls r0, r1 - ldrb r1, [r4] - orrs r0, r1 - strb r0, [r4] - ldrb r2, [r6, 0x18] - lsrs r3, r2, 4 - ldr r1, [sp, 0x2C] - adds r0, r1, r5 - ldrb r1, [r0] - lsls r1, r5 - orrs r1, r3 - lsls r1, 4 - movs r0, 0xF - ands r0, r2 - orrs r0, r1 - strb r0, [r6, 0x18] - adds r5, 0x1 - cmp r5, 0x3 - ble _08186274 - movs r2, 0x58 - mov r0, r10 - muls r0, r2 - mov r1, r12 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - beq _081862BC - b _081863CA -_081862BC: - movs r5, 0 - mov r3, sp - adds r3, 0x20 - str r3, [sp, 0x40] - ldr r0, =0x0202406e - ldr r4, [sp, 0x44] - adds r6, r4, r0 -_081862CA: - ldrh r1, [r6] - movs r0, 0x64 - muls r0, r1 - ldr r4, =0x020244ec - adds r0, r4 - movs r1, 0x15 - movs r2, 0 - bl pokemon_getattr - mov r1, sp - adds r3, r1, r5 - lsls r2, r5, 1 - movs r1, 0x3 - lsls r1, r2 - ands r0, r1 - lsrs r0, r2 - strb r0, [r3] - adds r5, 0x1 - cmp r5, 0x3 - ble _081862CA - movs r5, 0 - ldr r0, =0x0202406e - ldr r2, [sp, 0x44] - adds r7, r2, r0 - movs r3, 0x64 - mov r9, r3 - mov r8, r4 - ldr r4, [sp, 0x28] - ldr r6, [sp, 0x30] -_08186304: - ldrh r0, [r7] - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - add r0, r8 - ldrb r1, [r4] - adds r1, 0xD - movs r2, 0 - bl pokemon_getattr - strh r0, [r6] - ldrh r0, [r7] - mov r2, r9 - muls r2, r0 - adds r0, r2, 0 - add r0, r8 - ldrb r1, [r4] - adds r1, 0x11 - movs r2, 0 - bl pokemon_getattr - ldr r3, [sp, 0x34] - adds r1, r3, r5 - strb r0, [r1] - ldr r0, [sp, 0x3C] - adds r1, r0, r5 - ldrb r0, [r4] - add r0, sp - ldrb r0, [r0] - strb r0, [r1] - adds r4, 0x1 - adds r6, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _08186304 - movs r5, 0 - ldr r0, =0x0202406e - ldr r1, [sp, 0x44] - adds r7, r1, r0 - movs r2, 0x64 - mov r9, r2 - ldr r3, =0x020244ec - mov r8, r3 - ldr r6, [sp, 0x30] - adds r6, 0x8 - ldr r4, [sp, 0x30] -_08186360: - ldrh r0, [r7] - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - add r0, r8 - adds r1, r5, 0 - adds r1, 0xD - adds r2, r4, 0 - bl pokemon_setattr - ldrh r0, [r7] - mov r2, r9 - muls r2, r0 - adds r0, r2, 0 - add r0, r8 - adds r1, r5, 0 - adds r1, 0x11 - adds r2, r6, 0 - bl pokemon_setattr - adds r6, 0x1 - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _08186360 - movs r0, 0 - ldr r3, [sp, 0x40] - strb r0, [r3] - movs r5, 0 - ldr r4, =0x0202406e - ldr r6, =0x020244ec - ldr r3, [sp, 0x3C] - ldr r2, [sp, 0x40] -_081863A2: - adds r0, r3, r5 - ldrb r1, [r0] - lsls r0, r5, 1 - lsls r1, r0 - ldrb r0, [r2] - orrs r0, r1 - strb r0, [r2] - adds r5, 0x1 - cmp r5, 0x3 - ble _081863A2 - ldr r1, [sp, 0x44] - adds r0, r1, r4 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - adds r0, r6 - movs r1, 0x15 - ldr r2, [sp, 0x40] - bl pokemon_setattr -_081863CA: - ldr r2, =0x02024274 - ldr r3, [sp, 0x44] - adds r2, r3, r2 - ldr r0, =0x0202449c - ldr r0, [r0] - add r0, r10 - adds r0, 0x80 - ldrb r0, [r0] - lsls r0, 1 - movs r4, 0x58 - mov r1, r10 - muls r1, r4 - adds r0, r1 - ldr r1, =0x02024084 - adds r1, 0xC - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] -_081863EE: - ldr r6, [sp, 0x38] - mov r10, r6 -_081863F2: - ldr r0, =0x0202406c - ldrb r0, [r0] - cmp r10, r0 - bge _081863FC - b _0818606C -_081863FC: - add sp, 0x50 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818603C - - thumb_func_start sub_8186438 -sub_8186438: @ 8186438 - ldr r0, =0x0203c7bc - ldr r0, [r0] - bx lr - .pool - thumb_func_end sub_8186438 - - thumb_func_start sub_8186444 -sub_8186444: @ 8186444 - ldr r1, =0x0203ccd0 - movs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8186444 - - thumb_func_start rfu_lacks_rfufunc -rfu_lacks_rfufunc: @ 8186450 - push {lr} - movs r1, 0 - ldr r0, =0x0203ccd0 - ldrb r0, [r0] - cmp r0, 0 - bne _0818645E - movs r1, 0x1 -_0818645E: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end rfu_lacks_rfufunc - - thumb_func_start sub_8186468 -sub_8186468: @ 8186468 - push {r4,r5,lr} - adds r3, r0, 0 - movs r2, 0 - ldr r5, =0x03001278 - ldr r4, =0x0203ccd1 -_08186472: - adds r0, r3, r2 - adds r1, r2, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x7 - ble _08186472 - movs r0, 0xFF - strb r0, [r3, 0x7] - ldrb r1, [r5] - adds r0, r3, 0 - bl StopMusicWhileStringIsPrinted - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8186468 - - thumb_func_start sub_818649C -sub_818649C: @ 818649C - ldr r0, =0x0203ccd9 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_818649C - - thumb_func_start sub_81864A8 -sub_81864A8: @ 81864A8 - ldr r0, =0x0203ccda - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_81864A8 - - thumb_func_start sub_81864B4 -sub_81864B4: @ 81864B4 - ldr r0, =0x03001278 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_81864B4 - - thumb_func_start sub_81864C0 -sub_81864C0: @ 81864C0 - ldr r0, =0x03001279 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_81864C0 - - thumb_func_start sub_81864CC -sub_81864CC: @ 81864CC - ldr r0, =0x0203cce8 - ldr r1, =0x0202433a - ldrb r1, [r1] - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_81864CC - - thumb_func_start sub_81864E0 -sub_81864E0: @ 81864E0 - ldr r0, =0x0203ccdc - bx lr - .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, =0x03005d60 - ldr r0, =0x02024064 - 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, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldr r0, =0x02024064 - 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, =0x02023064 - 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, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - 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, =DummyObjectCallback - 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, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - 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, =DummyObjectCallback - 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, =0x02020630 - ldr r6, =0x020241e4 - ldr r4, =0x02024064 - 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, =DummyObjectCallback - 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 obj_free_rotscale_entry - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - 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, =0x020244d0 - ldr r1, [r4] - ldr r3, =0x02024064 - 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, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081866F8 -_081866A4: - ldr r4, =0x02020630 - ldr r0, =0x03005d70 - ldr r2, =0x02024064 - 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, =DummyObjectCallback - mov r8, r2 - cmp r1, r0 - bne _08186764 - ldr r0, =0x020241e4 - 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, =0x02020630 - ldr r7, =0x03005d70 - ldr r2, =0x02024064 - 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, =DummyObjectCallback - 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, =0x020241e4 - 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 battle_get_per_side_status - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x1 - bne _08186816 - ldr r0, =0x020244d0 - 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 FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag -_08186816: - ldr r0, =0x020244d0 - 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, =0x03005d60 - 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, =0x020244d0 - ldr r0, [r4] - ldr r7, =0x02024064 - 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, =0x0202406e - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - 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, =0x0202406e - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - 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, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08186964 - ldr r4, =0x03005d70 - ldrb r0, [r7] - adds r1, r6, 0 - eors r1, r0 - adds r0, r1, r4 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - 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, =0x03005d70 - ldr r4, =0x02024064 - ldrb r1, [r4] - adds r0, r1, r5 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - 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, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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, =0x020244d0 - ldr r0, [r5] - ldr r4, =0x02024064 - 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 sub_80A36C8 - 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, =0x02022fec - ldr r0, [r0] - movs r1, 0x42 - ands r0, r1 - cmp r0, 0x42 - bne _08186A40 - adds r0, r2, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08186A4C - ldr r0, =0x03007420 - bl m4aMPlayContinue - b _08186A4C - .pool -_08186A40: - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl -_08186A4C: - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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, =0x02020630 - ldr r0, =0x03005d7c - ldr r1, =0x02024064 - 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, =DummyObjectCallback - cmp r3, r0 - bne _08186B26 - ldr r0, =0x020241e4 - 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, =0x02020630 - ldr r7, =0x03005d7c - ldr r0, =0x02024064 - 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, =DummyObjectCallback - cmp r4, r0 - bne _08186B26 - ldr r6, =0x020241e4 - 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, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08186B8A - ldr r1, =0x03005d7c - ldr r5, =0x02024064 - 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, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - ldrb r0, [r5] - eors r4, r0 - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_805EE54 -_08186B8A: - ldr r1, =0x03005d7c - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - ldrb r5, [r4] - ldr r1, =0x0202406e - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - bl sub_805EE54 - ldr r3, =0x020244d0 - 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, =0x03005d60 - 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, =0x02020630 - ldr r0, =0x020241e4 - ldr r7, =0x02024064 - 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, =DummyObjectCallback - cmp r1, r0 - bne _08186CFA - adds r0, r2, r4 - movs r1, 0x24 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08186CFA - ldr r6, =0x020244d0 - 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, =0x0202406e - adds r0, r4, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - 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 FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - 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, =0x02024064 - ldrb r0, [r6] - ldr r5, =0x03005d70 - 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, =0x02020630 - ldr r0, =0x020241e4 - ldr r1, =0x02024064 - 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, =0x03005d70 - 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, =0x020244d0 - ldr r0, [r0] - ldr r6, =0x02024064 - 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, =0x020241e4 - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldrb r0, [r6] - bl sub_805EEE0 - ldr r1, =0x03005d70 - 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, =0x020241e4 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - ldr r2, =0x02020630 - 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, =0x020244b9 - 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, =0x02020630 - ldr r0, =0x03005d70 - ldr r4, =0x02024064 - 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, =DummyObjectCallback - cmp r1, r0 - bne _08186EF0 - ldr r0, =0x020244d0 - 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, =0x03005d60 - 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, =0x020244d0 - ldr r0, [r0] - ldr r4, =0x02024064 - 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 sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - bne _08186F6E - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - 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, =DummyObjectCallback - cmp r1, r0 - beq _08186F5E - ldr r0, =nullsub_18 - cmp r1, r0 - bne _08186F6E -_08186F5E: - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl - 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, =0x020244d0 - ldr r0, [r4] - ldr r5, =0x02024064 - 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, =0x02020630 - ldr r6, =0x020241e4 - 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, =DummyObjectCallback - 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 FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - 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 StartObjectImageAnim - ldr r4, =0x03005d70 - ldrb r1, [r5] - adds r0, r1, r4 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - 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, =0x03005d60 - 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, =0x020244d0 - ldr r0, [r6] - ldr r5, =0x02024064 - 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, =0x0202406e - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_081870B6: - ldr r4, =0x02020630 - ldr r0, =0x03005d7c - 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, =DummyObjectCallback - 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 RemoveObjectAndFreeTiles - ldrb r4, [r5] - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_805EE54 - ldr r1, =0x03005d60 - 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, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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, =0x03005d60 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8186508 - str r1, [r0] - ldr r0, =0x02022fec - 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 dp01_prepare_buffer_wireless_probably - ldr r1, =0x02023064 - ldrb r0, [r4] - lsls r0, 9 - adds r0, r1 - movs r1, 0x38 - strb r1, [r0] - b _08187212 - .pool -_08187200: - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - 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, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _0818725C - ldr r0, =0x0202406e - 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, =0x02023064 - ldr r3, =0x02024064 - 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, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - mov r1, sp - strh r0, [r1] - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr - 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 pokemon_getattr - strh r0, [r4] - adds r1, r6, 0 - adds r1, 0x11 - mov r0, r8 - bl pokemon_getattr - 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, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - bl pokemon_getattr - mov r1, r10 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x20 - bl pokemon_getattr - ldr r2, [sp, 0x80] - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x19 - bl pokemon_getattr - str r0, [sp, 0x44] - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - str r0, [sp, 0x48] - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - str r0, [sp, 0x4C] - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - ldr r1, [sp, 0x7C] - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x28] - adds r0, r4, 0 - movs r1, 0x3A - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2C] - adds r0, r4, 0 - movs r1, 0x3B - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2] - adds r0, r4, 0 - movs r1, 0x3C - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x4] - adds r0, r4, 0 - movs r1, 0x3D - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x6] - adds r0, r4, 0 - movs r1, 0x3E - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x8] - adds r0, r4, 0 - movs r1, 0x3F - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0xA] - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - str r0, [sp, 0x54] - adds r0, r4, 0 - movs r1, 0x2 - ldr r2, [sp, 0x8C] - bl pokemon_getattr - ldr r0, [sp, 0x84] - ldr r1, [sp, 0x8C] - bl CopyString_Limit10 - adds r0, r4, 0 - movs r1, 0x7 - ldr r2, [sp, 0x88] - bl pokemon_getattr - 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, =0x02024744 - adds r0, r1 - movs r1, 0xB - b _08187966 - .pool -_081875FC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - 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, =0x02024744 - adds r4, r1, r0 - mov r8, r9 -_08187622: - adds r1, r6, 0 - adds r1, 0xD - adds r0, r4, 0 - bl pokemon_getattr - mov r1, r8 - strh r0, [r1] - adds r1, r6, 0 - adds r1, 0x11 - adds r0, r4, 0 - bl pokemon_getattr - 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, =0x02024744 - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - 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, =0x02024744 - 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, =0x02024744 - mov r8, r2 -_0818769C: - adds r1, r6, 0 - adds r1, 0x11 - mov r2, r8 - adds r0, r4, r2 - bl pokemon_getattr - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - cmp r6, 0x3 - ble _0818769C - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - b _08187A2E - .pool -_081876CC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - 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, =0x02024744 - adds r0, r1 - movs r1, 0x1 - b _08187702 - .pool -_081876F8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x19 -_08187702: - bl pokemon_getattr - 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, =0x02024744 - adds r0, r1 - movs r1, 0x1A - b _08187A26 - .pool -_08187738: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1B - b _08187A26 - .pool -_08187748: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1C - b _08187A26 - .pool -_08187758: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1D - b _08187A26 - .pool -_08187768: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1E - b _08187A26 - .pool -_08187778: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x1F - b _08187A26 - .pool -_08187788: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x20 - b _08187A26 - .pool -_08187798: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x22 - b _08187A26 - .pool -_081877A8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x23 - b _08187A26 - .pool -_081877B8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x24 - b _08187A26 - .pool -_081877C8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x25 - b _08187A26 - .pool -_081877D8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x26 - b _08187A26 - .pool -_081877E8: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_getattr - strb r0, [r7] - adds r0, r4, 0 - movs r1, 0x28 - bl pokemon_getattr - strb r0, [r7, 0x1] - adds r0, r4, 0 - movs r1, 0x29 - bl pokemon_getattr - strb r0, [r7, 0x2] - adds r0, r4, 0 - movs r1, 0x2A - bl pokemon_getattr - strb r0, [r7, 0x3] - adds r0, r4, 0 - movs r1, 0x2B - bl pokemon_getattr - strb r0, [r7, 0x4] - adds r0, r4, 0 - movs r1, 0x2C - bl pokemon_getattr - strb r0, [r7, 0x5] - movs r6, 0x6 - b _08187A2E - .pool -_08187838: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x27 - b _08187A26 - .pool -_08187848: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x28 - b _08187A26 - .pool -_08187858: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x29 - b _08187A26 - .pool -_08187868: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2A - b _08187A26 - .pool -_08187878: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2B - b _08187A26 - .pool -_08187888: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2C - b _08187A26 - .pool -_08187898: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0 - b _081878C2 - .pool -_081878A8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x9 - b _08187966 - .pool -_081878B8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x37 -_081878C2: - bl pokemon_getattr - 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, =0x02024744 - adds r0, r1 - movs r1, 0x38 - b _08187A26 - .pool -_081878FC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x39 - b _08187966 - .pool -_0818790C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3A - b _08187966 - .pool -_0818791C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3B - b _08187966 - .pool -_0818792C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3C - b _08187966 - .pool -_0818793C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3D - b _08187966 - .pool -_0818794C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3E - b _08187966 - .pool -_0818795C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3F -_08187966: - bl pokemon_getattr - 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, =0x02024744 - adds r0, r1 - movs r1, 0x16 - b _08187A26 - .pool -_0818798C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x17 - b _08187A26 - .pool -_0818799C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x18 - b _08187A26 - .pool -_081879AC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x21 - b _08187A26 - .pool -_081879BC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x2F - b _08187A26 - .pool -_081879CC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x30 - b _08187A26 - .pool -_081879DC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x32 - b _08187A26 - .pool -_081879EC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x33 - b _08187A26 - .pool -_081879FC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x34 - b _08187A26 - .pool -_08187A0C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x35 - b _08187A26 - .pool -_08187A1C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x36 -_08187A26: - bl pokemon_getattr - 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, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _08187A80 - ldr r0, =0x0202406e - 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, =0x02024064 - ldrb r0, [r3] - lsls r0, 9 - ldr r2, =0x02023067 - 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, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - adds r2, r7, 0 - bl pokemon_setattr - adds r2, r7, 0 - adds r2, 0x2E - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_setattr - 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 pokemon_setattr - mov r1, r8 - adds r1, 0x11 - mov r0, r9 - adds r2, r6, 0 - bl pokemon_setattr - 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, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - mov r2, r10 - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x20 - ldr r2, [sp, 0x20] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x19 - ldr r2, [sp, 0x28] - bl pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - adds r0, r4, 0 - movs r1, 0 - ldr r2, [sp, 0x2C] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x37 - ldr r2, [sp, 0x30] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x38 - ldr r2, [sp, 0x1C] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x39 - ldr r2, [sp, 0x18] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3A - ldr r2, [sp, 0x24] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3B - ldr r2, [sp, 0x4] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3C - ldr r2, [sp, 0x8] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3D - ldr r2, [sp, 0xC] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3E - ldr r2, [sp, 0x10] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3F - ldr r2, [sp, 0x14] - bl pokemon_setattr - b _081883B4 - .pool -_08187D74: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0xB - bl pokemon_setattr - b _081883B4 - .pool -_08187D90: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0xC - bl pokemon_setattr - 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, =0x02024744 - 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 pokemon_setattr - mov r1, r8 - adds r1, 0x11 - adds r0, r7, 0 - adds r2, r6, 0 - bl pokemon_setattr - 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, =0x02024744 - adds r0, r1 - movs r1, 0x15 - mov r2, r9 - bl pokemon_setattr - b _081883B4 - .pool -_08187E00: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldr r3, =0x02023064 - 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, =0x02024744 - adds r4, r0 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - adds r0, r4, 0 - movs r1, 0x11 - str r3, [sp, 0x34] - bl pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - b _081883B4 - .pool -_08187E88: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldr r3, =0x02023064 - 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 pokemon_setattr - b _081883B4 - .pool -_08187EB0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1 - bl pokemon_setattr - b _081883B4 - .pool -_08187ECC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x19 - bl pokemon_setattr - b _081883B4 - .pool -_08187EE8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1A - bl pokemon_setattr - b _081883B4 - .pool -_08187F04: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1B - bl pokemon_setattr - b _081883B4 - .pool -_08187F20: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1C - bl pokemon_setattr - b _081883B4 - .pool -_08187F3C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1D - bl pokemon_setattr - b _081883B4 - .pool -_08187F58: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1E - bl pokemon_setattr - b _081883B4 - .pool -_08187F74: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x1F - bl pokemon_setattr - b _081883B4 - .pool -_08187F90: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x20 - bl pokemon_setattr - b _081883B4 - .pool -_08187FAC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x22 - bl pokemon_setattr - b _081883B4 - .pool -_08187FC8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x23 - bl pokemon_setattr - b _081883B4 - .pool -_08187FE4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x24 - bl pokemon_setattr - b _081883B4 - .pool -_08188000: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x25 - bl pokemon_setattr - b _081883B4 - .pool -_0818801C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x26 - bl pokemon_setattr - b _081883B4 - .pool -_08188038: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x02024744 - adds r4, r0 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - adds r0, r4, 0 - movs r1, 0x27 - str r3, [sp, 0x34] - bl pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x27 - bl pokemon_setattr - b _081883B4 - .pool -_081880C8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x28 - bl pokemon_setattr - b _081883B4 - .pool -_081880E4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x29 - bl pokemon_setattr - b _081883B4 - .pool -_08188100: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x2A - bl pokemon_setattr - b _081883B4 - .pool -_0818811C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x2B - bl pokemon_setattr - b _081883B4 - .pool -_08188138: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 -_08188146: - movs r1, 0x2C - bl pokemon_setattr - b _081883B4 - .pool -_08188154: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0 - bl pokemon_setattr - b _081883B4 - .pool -_08188170: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x9 - bl pokemon_setattr - b _081883B4 - .pool -_0818818C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x37 - bl pokemon_setattr - b _081883B4 - .pool -_081881A8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x38 - bl pokemon_setattr - b _081883B4 - .pool -_081881C4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x39 - bl pokemon_setattr - b _081883B4 - .pool -_081881E0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3A - bl pokemon_setattr - b _081883B4 - .pool -_081881FC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3B - bl pokemon_setattr - b _081883B4 - .pool -_08188218: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3C - bl pokemon_setattr - b _081883B4 - .pool -_08188234: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3D - bl pokemon_setattr - b _081883B4 - .pool -_08188250: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3E - bl pokemon_setattr - b _081883B4 - .pool -_0818826C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x3F - bl pokemon_setattr - b _081883B4 - .pool -_08188288: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x16 - bl pokemon_setattr - b _081883B4 - .pool -_081882A4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x17 - bl pokemon_setattr - b _081883B4 - .pool -_081882C0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x18 - bl pokemon_setattr - b _081883B4 - .pool -_081882DC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x21 - bl pokemon_setattr - b _081883B4 - .pool -_081882F8: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x2F - bl pokemon_setattr - b _081883B4 - .pool -_08188314: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x30 - bl pokemon_setattr - b _081883B4 - .pool -_08188330: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x32 - bl pokemon_setattr - b _081883B4 - .pool -_0818834C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x33 - bl pokemon_setattr - b _081883B4 - .pool -_08188368: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x34 - bl pokemon_setattr - b _081883B4 - .pool -_08188384: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x35 - bl pokemon_setattr - b _081883B4 - .pool -_081883A0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 - adds r0, r1 - ldrb r2, [r6] - lsls r2, 9 - adds r2, r3 - movs r1, 0x36 - bl pokemon_setattr -_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, =0x0202406e - ldr r7, =0x02024064 - 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, =0x02023064 - lsls r2, 9 - adds r0, r4, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - ldr r1, =0x02024744 - 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, =0x0202406e - ldr r6, =0x02024064 - 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, =0x02024744 - mov r9, r1 - add r0, r9 - movs r1, 0xB - bl pokemon_getattr - 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 battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_806A068 - ldr r0, =0x0202499c - 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 AddObjectToFront - ldr r4, =0x020241e4 - ldrb r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r5, =0x02020630 - 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, =0x020244e4 - adds r2, r1 - ldrb r1, [r2] - bl StartObjectImageAnim - 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 pokemon_getattr - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl sub_805EE54 - ldr r1, =0x03005d60 - 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, =0x0202406e - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r2, r0, 1 - adds r2, r1 - ldr r3, =0x02023064 - 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, =0x03005d60 - 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, =0x0202406e - lsls r4, r6, 1 - adds r4, r0 - ldr r0, =0x02023064 - 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, =0x02024744 - adds r0, r5 - movs r1, 0xB - bl pokemon_getattr - mov r8, r0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r0, =sub_805D714 - bl object_new_hidden_with_callback - ldr r1, =0x03005d7c - 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 battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl sub_806A068 - ldr r0, =0x0202499c - 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 AddObjectToFront - ldr r4, =0x020241e4 - adds r4, r6, r4 - strb r0, [r4] - ldr r5, =0x02020630 - 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, =0x020244e4 - adds r6, r1 - ldrb r1, [r6] - bl StartObjectImageAnim - 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, =DummyObjectCallback - 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, =0x02023064 - ldr r6, =0x02024064 - ldrb r2, [r6] - lsls r0, r2, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r3, [r0] - cmp r3, 0 - bne _081887B0 - ldr r0, =0x020244d0 - 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, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8188800 - str r1, [r0] - b _081887EC - .pool -_081887B0: - ldr r5, =0x020241e4 - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldrb r0, [r6] - bl sub_805EEE0 - ldr r1, =0x03005d70 - 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, =0x020244d0 - ldr r4, [r6] - ldr r5, =0x02024064 - 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, =0x03005d60 - 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, =0x02022fec - ldr r0, [r5] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081888F6 - ldr r4, =0x02024064 - ldrb r0, [r4] - bl battle_get_per_side_status - 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, =0x02038bca - b _081888DA - .pool -_081888D8: - ldr r0, =0x02038bcc -_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, =0x02038bca - ldrh r1, [r0] - movs r0, 0xC0 - lsls r0, 4 - cmp r1, r0 - bne _08188910 - bl sub_8068B48 - b _08188928 - .pool -_08188910: - ldr r2, =0x020229e8 - ldr r0, =0x0203c7b4 - 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, =0x02024064 - ldrb r1, [r5] - bl sub_805DF38 - ldrb r0, [r5] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl template_build_for_pokemon_or_trainer - ldr r6, =0x0202499c - 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 AddObjectToFront - ldr r6, =0x020241e4 - ldrb r1, [r5] - adds r1, r6 - strb r0, [r1] - ldr r4, =0x02020630 - 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 IndexOfObjectPaletteTag - 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, =0x03005d60 - 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, =0x020241e4 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =0x02020630 - 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, =DummyObjectCallback - bl oamt_set_x3A_32 - ldr r1, =0x03005d60 - 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, =0x020244d0 - ldr r4, [r6] - ldr r5, =0x02024064 - 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 audio_play_and_stuff - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - 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, =0x03005d60 - 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, =0x02024064 - ldrb r0, [r6] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - beq _08188BE6 - b _08188CFA -_08188BE6: - ldr r0, =0x02023064 - 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, =0x02038432 - mov r1, r12 - adds r1, 0x3 - adds r2, r1 - ldrb r1, [r2] - strb r1, [r5] - ldr r4, =0x02038408 - 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, =0x02038404 - 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, =0x0203841a - ldrb r1, [r6] - lsls r1, 9 - mov r2, r12 - adds r2, 0xA - adds r1, r2 - ldrb r1, [r1] - strb r1, [r3] - ldr r4, =0x0203841c - 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, =0x02038400 - ldrb r2, [r6] - lsls r2, 9 - mov r1, r12 - adds r1, 0x10 - adds r2, r1 - str r2, [r3] - ldr r3, =0x020244bc - 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, =0x020244d0 - 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, =0x03005d60 - 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, =0x02023064 - ldr r6, =0x02024064 - 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, =0x020244d0 - 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, =0x020383f8 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =0x020383fd - 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, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 9 - ldr r1, =0x02023066 - adds r0, r1 - ldrh r0, [r0] - bl battle_pick_message - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =0x03005d60 - 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, =0x02024064 - 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, =0x02022fec - 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, =0x02024064 - 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, =0x02024064 - ldrb r0, [r4] - bl sub_8185054 - ldrb r1, [r4] - ldr r3, =0x0202449c - 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, =0x02023064 - ldr r0, =0x02024064 - 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, =0x0202406e - lsls r0, r4, 1 - adds r0, r6 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x02024744 - adds r0, r4 - movs r1, 0x3A - bl pokemon_getattr - 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 pokemon_getattr - adds r3, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r1, =0x03005d70 - adds r1, r0, r1 - ldrb r1, [r1] - str r7, [sp] - mov r2, r8 - bl sub_807294C - b _0818908A - .pool -_08189060: - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0x3A - bl pokemon_getattr - adds r2, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r1, =0x03005d70 - adds r1, r0, r1 - ldrb r1, [r1] - str r7, [sp] - movs r3, 0 - bl sub_807294C -_0818908A: - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - 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, =0x02024064 - ldrb r0, [r4] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _08189120 - ldr r0, =0x03005d70 - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x02024744 - adds r1, r2 - movs r2, 0x9 - bl healthbar_draw_field_maybe - ldrb r2, [r4] - ldr r0, =0x020244d0 - 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, =0x03005d60 - 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, =0x02024064 - ldrb r0, [r5] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _08189194 - ldr r4, =0x02023064 - 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, =0x03005d60 - 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, =0x02022d0c - 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, =0x02022d0c - ldr r1, =0x02023064 - ldr r0, =0x02024064 - 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, =0x02022d0c - 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, =0x02022d0c - 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, =0x02020630 - ldr r2, =0x020241e4 - ldr r4, =0x02024064 - 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, =0x020244b9 - 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, =0x03005d60 - 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, =0x02024064 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - movs r3, 0x3F - cmp r0, 0 - bne _0818933C - movs r3, 0xC0 -_0818933C: - ldr r2, =0x02023064 - 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 audio_play_and_stuff - 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, =0x02023064 - ldr r5, =0x02024064 - 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 song_play_for_text - 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 fanfare_play -_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, =0x0202406e - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x02024744 - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x19 - movs r2, 0x5 - bl sub_80A32E4 - 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, =0x02023064 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - bl battle_intro_launch - ldr r2, =0x020243fc - 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, =0x020241e4 - ldr r6, =0x02024064 - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - 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, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r4 - ldrb r0, [r6] - strh r0, [r1, 0x8] - ldr r3, =0x020244d0 - 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, =0x020244b4 - 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, =0x03005d60 - 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, =0x02024064 - ldrb r0, [r7] - mov r9, r0 - ldr r1, =0x03005e00 - 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, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081895B4 -_08189582: - ldr r0, =0x02023064 - ldrb r1, [r7] - lsls r2, r1, 9 - adds r0, 0x1 - adds r2, r0 - ldr r0, =0x0202406e - 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, =0x02023064 - ldrb r0, [r7] - lsls r1, r0, 9 - adds r4, 0x1 - adds r1, r4 - ldr r6, =0x0202406e - 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, =0x03005d60 - ldr r2, =0x02024064 - 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 obj_free_rotscale_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - 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, =0x02023064 - ldr r0, =0x02024064 - 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 battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _08189678 - bl sub_81871AC - b _08189742 - .pool -_08189678: - ldr r4, =0x020244d0 - ldr r0, [r4] - ldr r3, =0x02024064 - 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, =0x02023064 - 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, =0x02023068 - 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, =0x020244b4 - ldrb r1, [r5] - adds r1, r2 - movs r3, 0 - strb r0, [r1] - ldr r6, =0x020244d0 - 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, =0x03005d60 - 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, =0x020244d0 - ldr r0, [r4] - ldr r3, =0x02024064 - 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, =0x020244d0 - ldr r1, [r0] - ldr r0, =0x02024064 - 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, =0x03005e00 - ldr r0, =0x020244b4 - 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, =0x02024064 - ldrb r0, [r4] - bl sub_80A6A90 - lsls r0, 24 - cmp r0, 0 - beq _08189846 - ldr r3, =0x02020630 - ldr r0, =0x020241e4 - 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, =0x02023064 - 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, =0x02024064 - ldrb r0, [r6] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _081898B8 - ldr r5, =0x02023064 - 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, =0x03005d60 - 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, =0x02023064 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r2, [r0] - cmp r2, 0x3 - bne _08189908 - ldr r0, =0x0202433a - strb r2, [r0] - b _08189910 - .pool -_08189908: - ldr r0, =0x0202433a - movs r1, 0x3 - eors r1, r2 - strb r1, [r0] -_08189910: - movs r0, 0x5 - bl sub_80A2F50 - movs r0, 0x3 - bl sub_80A2390 - bl sub_81871AC - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - 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, =0x03005d60 - ldr r0, =0x02024064 - 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, =0x02024068 - ldr r1, =gUnknown_0832A328 - ldr r0, =0x02024064 - 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, =0x02023064 - 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, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - 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, =DummyObjectCallback - 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, =0x02020630 - ldr r5, =0x020241e4 - ldr r4, =0x02024064 - 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, =DummyObjectCallback - 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 obj_free_rotscale_entry - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl RemoveObjectAndFreeTiles - 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, =0x020244d0 - ldr r1, [r4] - ldr r3, =0x02024064 - 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, =0x02024064 - ldrb r0, [r4] - bl battle_get_per_side_status - 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, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08189B0C -_08189ADA: - ldr r2, =0x02020630 - ldr r1, =0x03005d70 - 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, =DummyObjectCallback - cmp r1, r0 - bne _08189B42 - b _08189B48 - .pool -_08189B0C: - ldr r2, =0x02020630 - ldr r5, =0x03005d70 - ldr r0, =0x02024064 - 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, =DummyObjectCallback - 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, =0x020244d0 - mov r9, r0 - ldr r0, [r0] - ldr r5, =0x02024064 - 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 FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - ldr r7, =0x0202406e - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r7 - ldrh r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r4, =0x020244ec - 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, =0x03005d60 - 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, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08189CB0 -_08189C80: - ldr r2, =0x02020630 - ldr r1, =0x03005d70 - 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, =DummyObjectCallback - cmp r1, r0 - bne _08189CE6 - b _08189CE4 - .pool -_08189CB0: - ldr r2, =0x02020630 - ldr r5, =0x03005d70 - ldr r0, =0x02024064 - 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, =DummyObjectCallback - 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 sub_80A36C8 - lsls r0, 24 - cmp r0, 0 - beq _08189CF2 - movs r6, 0 -_08189CF2: - cmp r6, 0 - beq _08189D18 - ldr r0, =0x020244d0 - ldr r0, [r0] - ldr r3, =0x02024064 - 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, =0x03005d60 - 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, =0x02024064 - ldrb r0, [r4] - bl battle_get_per_side_status - lsls r0, 24 - cmp r0, 0 - bne _08189DBE - ldr r5, =0x020244d0 - 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, =0x0202406e - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - 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, =0x0202406e - adds r0, r2, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r1, r0 - adds r0, r3, 0 - bl sub_8172EF0 -_08189DBE: - ldr r3, =0x020244d0 - ldr r0, [r3] - ldr r2, =0x02024064 - 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, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - bne _08189E54 - ldr r4, =0x03005d70 - mov r1, r9 - ldrb r0, [r1] - adds r1, r7, 0 - eors r1, r0 - adds r0, r1, r4 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - 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, =0x03005d70 - ldr r4, =0x02024064 - ldrb r1, [r4] - adds r0, r1, r5 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - 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, =0x020244d0 - ldr r0, [r4] - ldr r3, =0x02024064 - 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 sub_80A36C8 - 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, =0x02022fec - ldr r0, [r0] - movs r1, 0x42 - ands r0, r1 - cmp r0, 0x42 - bne _08189F38 - adds r0, r2, 0 - bl battle_get_per_side_status - lsls r0, 24 - cmp r0, 0 - bne _08189F44 - ldr r0, =0x03007420 - bl m4aMPlayContinue - b _08189F44 - .pool -_08189F38: - ldr r0, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl -_08189F44: - ldr r0, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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, =0x02020630 - ldr r6, =0x03005d7c - ldr r5, =0x02024064 - 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, =DummyObjectCallback - cmp r2, r0 - bne _0818A02A - ldr r0, =0x020241e4 - 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, =0x02022fec - 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 RemoveObjectAndFreeTiles -_08189FC8: - ldr r1, =0x03005d7c - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - ldr r3, =0x020244d0 - 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, =0x03005d60 - 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, =0x02020630 - ldr r1, =0x020241e4 - ldr r0, =0x02024064 - 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, =0x02024064 - ldrb r0, [r5] - ldr r6, =0x03005d70 - 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, =0x0202406e - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - 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, =0x02020630 - ldr r5, =0x020241e4 - ldr r4, =0x02024064 - 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, =0x0202406e - lsls r0, r2, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - 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 rotscale_free_entry - ldrb r0, [r4] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - bl RemoveObjectAndFreeTiles - ldr r1, =0x03005d70 - 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, =0x020244d0 - ldr r0, [r0] - ldr r6, =0x02024064 - 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, =0x020241e4 - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r1, =0x03005d70 - 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, =0x020241e4 - ldr r0, =0x02024064 - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - ldr r2, =0x02020630 - 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, =0x020244b9 - 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, =0x02020630 - ldr r0, =0x03005d70 - ldr r4, =0x02024064 - 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, =DummyObjectCallback - cmp r1, r0 - bne _0818A306 - adds r0, r3, 0 - bl sub_805E408 - ldr r0, =0x020244d0 - 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, =0x03005d60 - 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, =0x020244d0 - ldr r1, [r0] - ldr r0, =0x02024064 - 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, =0x02020630 - ldr r0, =0x020241e4 - 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, =DummyObjectCallback - 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, =0x020244d0 - ldr r0, [r3] - ldr r7, =0x02024064 - 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 FreeObjectTilesByTag - adds r0, r4, 0 - bl FreeObjectPaletteByTag - ldr r0, =c3_0802FDF4 - movs r1, 0xA - bl CreateTask - ldr r0, =0x0202406e - mov r8, r0 - ldrb r1, [r7] - lsls r0, r1, 1 - add r0, r8 - ldrh r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - bl sub_805E990 - ldr r1, =0x020241e4 - ldrb r0, [r7] - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0 - bl StartObjectImageAnim - ldr r4, =0x03005d70 - 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, =0x03005d60 - 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, =0x020244d0 - ldr r0, [r6] - ldr r4, =0x02024064 - 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, =0x0202406e - adds r0, r3, r0 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r1, r0 - adds r0, r2, 0 - bl sub_8172EF0 -_0818A4A2: - ldr r5, =0x02020630 - ldr r0, =0x03005d7c - 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, =DummyObjectCallback - 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 RemoveObjectAndFreeTiles - ldr r1, =0x03005d60 - 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, =0x03005d60 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_8189968 - str r1, [r0] - ldr r0, =0x02022fec - 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 dp01_prepare_buffer_wireless_probably - ldr r1, =0x02023064 - ldrb r0, [r4] - lsls r0, 9 - adds r0, r1 - movs r1, 0x38 - strb r1, [r0] - b _0818A57A - .pool -_0818A568: - ldr r2, =0x02024068 - ldr r1, =gUnknown_0832A328 - 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, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _0818A624 - ldr r0, =0x0202406e - 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, =0x02023064 - ldr r3, =0x02024064 - 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, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - mov r1, sp - strh r0, [r1] - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr - 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 pokemon_getattr - strh r0, [r4] - adds r1, r6, 0 - adds r1, 0x11 - mov r0, r8 - bl pokemon_getattr - 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, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - bl pokemon_getattr - mov r1, r10 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x20 - bl pokemon_getattr - ldr r2, [sp, 0x80] - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x19 - bl pokemon_getattr - str r0, [sp, 0x44] - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - str r0, [sp, 0x48] - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - str r0, [sp, 0x4C] - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - ldr r1, [sp, 0x7C] - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x28] - adds r0, r4, 0 - movs r1, 0x3A - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2C] - adds r0, r4, 0 - movs r1, 0x3B - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x2] - adds r0, r4, 0 - movs r1, 0x3C - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x4] - adds r0, r4, 0 - movs r1, 0x3D - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x6] - adds r0, r4, 0 - movs r1, 0x3E - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0x8] - adds r0, r4, 0 - movs r1, 0x3F - bl pokemon_getattr - mov r1, sp - strh r0, [r1, 0xA] - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - str r0, [sp, 0x54] - adds r0, r4, 0 - movs r1, 0x2 - ldr r2, [sp, 0x8C] - bl pokemon_getattr - ldr r0, [sp, 0x84] - ldr r1, [sp, 0x8C] - bl CopyString_Limit10 - adds r0, r4, 0 - movs r1, 0x7 - ldr r2, [sp, 0x88] - bl pokemon_getattr - 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, =0x020244ec - adds r0, r1 - movs r1, 0xB - b _0818AD2E - .pool -_0818A9C4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - 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, =0x020244ec - adds r4, r1, r0 - mov r8, r9 -_0818A9EA: - adds r1, r6, 0 - adds r1, 0xD - adds r0, r4, 0 - bl pokemon_getattr - mov r1, r8 - strh r0, [r1] - adds r1, r6, 0 - adds r1, 0x11 - adds r0, r4, 0 - bl pokemon_getattr - 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, =0x020244ec - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - 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, =0x020244ec - 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, =0x020244ec - mov r8, r2 -_0818AA64: - adds r1, r6, 0 - adds r1, 0x11 - mov r2, r8 - adds r0, r4, r2 - bl pokemon_getattr - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - cmp r6, 0x3 - ble _0818AA64 - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x15 - bl pokemon_getattr - adds r1, r7, r6 - strb r0, [r1] - adds r6, 0x1 - b _0818ADF6 - .pool -_0818AA94: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - 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, =0x020244ec - adds r0, r1 - movs r1, 0x1 - b _0818AACA - .pool -_0818AAC0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x19 -_0818AACA: - bl pokemon_getattr - 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, =0x020244ec - adds r0, r1 - movs r1, 0x1A - b _0818ADEE - .pool -_0818AB00: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1B - b _0818ADEE - .pool -_0818AB10: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1C - b _0818ADEE - .pool -_0818AB20: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1D - b _0818ADEE - .pool -_0818AB30: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1E - b _0818ADEE - .pool -_0818AB40: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x1F - b _0818ADEE - .pool -_0818AB50: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x20 - b _0818ADEE - .pool -_0818AB60: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x22 - b _0818ADEE - .pool -_0818AB70: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x23 - b _0818ADEE - .pool -_0818AB80: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x24 - b _0818ADEE - .pool -_0818AB90: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x25 - b _0818ADEE - .pool -_0818ABA0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x26 - b _0818ADEE - .pool -_0818ABB0: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_getattr - strb r0, [r7] - adds r0, r4, 0 - movs r1, 0x28 - bl pokemon_getattr - strb r0, [r7, 0x1] - adds r0, r4, 0 - movs r1, 0x29 - bl pokemon_getattr - strb r0, [r7, 0x2] - adds r0, r4, 0 - movs r1, 0x2A - bl pokemon_getattr - strb r0, [r7, 0x3] - adds r0, r4, 0 - movs r1, 0x2B - bl pokemon_getattr - strb r0, [r7, 0x4] - adds r0, r4, 0 - movs r1, 0x2C - bl pokemon_getattr - strb r0, [r7, 0x5] - movs r6, 0x6 - b _0818ADF6 - .pool -_0818AC00: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x27 - b _0818ADEE - .pool -_0818AC10: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x28 - b _0818ADEE - .pool -_0818AC20: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x29 - b _0818ADEE - .pool -_0818AC30: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2A - b _0818ADEE - .pool -_0818AC40: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2B - b _0818ADEE - .pool -_0818AC50: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2C - b _0818ADEE - .pool -_0818AC60: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0 - b _0818AC8A - .pool -_0818AC70: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x9 - b _0818AD2E - .pool -_0818AC80: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x37 -_0818AC8A: - bl pokemon_getattr - 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, =0x020244ec - adds r0, r1 - movs r1, 0x38 - b _0818ADEE - .pool -_0818ACC4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x39 - b _0818AD2E - .pool -_0818ACD4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3A - b _0818AD2E - .pool -_0818ACE4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3B - b _0818AD2E - .pool -_0818ACF4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3C - b _0818AD2E - .pool -_0818AD04: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3D - b _0818AD2E - .pool -_0818AD14: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3E - b _0818AD2E - .pool -_0818AD24: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3F -_0818AD2E: - bl pokemon_getattr - 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, =0x020244ec - adds r0, r1 - movs r1, 0x16 - b _0818ADEE - .pool -_0818AD54: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x17 - b _0818ADEE - .pool -_0818AD64: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x18 - b _0818ADEE - .pool -_0818AD74: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x21 - b _0818ADEE - .pool -_0818AD84: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2F - b _0818ADEE - .pool -_0818AD94: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x30 - b _0818ADEE - .pool -_0818ADA4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x32 - b _0818ADEE - .pool -_0818ADB4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x33 - b _0818ADEE - .pool -_0818ADC4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x34 - b _0818ADEE - .pool -_0818ADD4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x35 - b _0818ADEE - .pool -_0818ADE4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x36 -_0818ADEE: - bl pokemon_getattr - 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, =0x02023064 - ldr r0, =0x02024064 - ldrb r2, [r0] - lsls r0, r2, 9 - adds r1, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0 - bne _0818AE48 - ldr r0, =0x0202406e - 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, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - ldr r2, =0x02023067 - 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, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - adds r2, r6, 0 - bl pokemon_setattr - adds r2, r6, 0 - adds r2, 0x2E - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_setattr - 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 pokemon_setattr - mov r1, r8 - adds r1, 0x11 - mov r0, r9 - adds r2, r7, 0 - bl pokemon_setattr - 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, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x15 - mov r2, r10 - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x20 - ldr r2, [sp, 0x20] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x19 - ldr r2, [sp, 0x28] - bl pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 pokemon_setattr - adds r0, r4, 0 - movs r1, 0 - ldr r2, [sp, 0x2C] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x37 - ldr r2, [sp, 0x30] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x38 - ldr r2, [sp, 0x1C] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x39 - ldr r2, [sp, 0x18] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3A - ldr r2, [sp, 0x24] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3B - ldr r2, [sp, 0x4] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3C - ldr r2, [sp, 0x8] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3D - ldr r2, [sp, 0xC] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3E - ldr r2, [sp, 0x10] - bl pokemon_setattr - adds r0, r4, 0 - movs r1, 0x3F - ldr r2, [sp, 0x14] - bl pokemon_setattr - b _0818B836 - .pool -_0818B13C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0xB - bl pokemon_setattr - b _0818B836 - .pool -_0818B15C: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0xC - bl pokemon_setattr - 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, =0x020244ec - 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 pokemon_setattr - mov r1, r8 - adds r1, 0x11 - adds r0, r7, 0 - adds r2, r6, 0 - bl pokemon_setattr - 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, =0x020244ec - adds r0, r1 - movs r1, 0x15 - mov r2, r9 - bl pokemon_setattr - b _0818B836 - .pool -_0818B1D4: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r3, =0x02023064 - ldr r1, =0x02024064 - 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, =0x020244ec - adds r4, r0 - ldr r5, =0x02024064 - ldrb r2, [r5] - lsls r2, 9 - adds r2, r7 - adds r0, r4, 0 - movs r1, 0x11 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x1 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x12 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x2 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x13 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x3 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x14 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x4 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x15 - bl pokemon_setattr - b _0818B836 - .pool -_0818B260: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r3, =0x02023064 - ldr r1, =0x02024064 - 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 pokemon_setattr - b _0818B836 - .pool -_0818B290: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1 - bl pokemon_setattr - b _0818B836 - .pool -_0818B2B0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x19 - bl pokemon_setattr - b _0818B836 - .pool -_0818B2D0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1A - bl pokemon_setattr - b _0818B836 - .pool -_0818B2F0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1B - bl pokemon_setattr - b _0818B836 - .pool -_0818B310: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1C - bl pokemon_setattr - b _0818B836 - .pool -_0818B330: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1D - bl pokemon_setattr - b _0818B836 - .pool -_0818B350: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1E - bl pokemon_setattr - b _0818B836 - .pool -_0818B370: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x1F - bl pokemon_setattr - b _0818B836 - .pool -_0818B390: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x20 - bl pokemon_setattr - b _0818B836 - .pool -_0818B3B0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x22 - bl pokemon_setattr - b _0818B836 - .pool -_0818B3D0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x23 - bl pokemon_setattr - b _0818B836 - .pool -_0818B3F0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x24 - bl pokemon_setattr - b _0818B836 - .pool -_0818B410: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x25 - bl pokemon_setattr - b _0818B836 - .pool -_0818B430: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x26 - bl pokemon_setattr - b _0818B836 - .pool -_0818B450: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - ldr r5, =0x02024064 - ldrb r2, [r5] - lsls r2, 9 - adds r2, r7 - adds r0, r4, 0 - movs r1, 0x27 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x1 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x28 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x2 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x29 - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x3 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2A - bl pokemon_setattr - ldrb r2, [r5] - lsls r2, 9 - adds r0, r7, 0x4 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2B - bl pokemon_setattr - 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, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x27 - bl pokemon_setattr - b _0818B836 - .pool -_0818B4E0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x28 - bl pokemon_setattr - b _0818B836 - .pool -_0818B500: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x29 - bl pokemon_setattr - b _0818B836 - .pool -_0818B520: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x2A - bl pokemon_setattr - b _0818B836 - .pool -_0818B540: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x2B - bl pokemon_setattr - b _0818B836 - .pool -_0818B560: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 -_0818B570: - movs r1, 0x2C - bl pokemon_setattr - b _0818B836 - .pool -_0818B580: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0 - bl pokemon_setattr - b _0818B836 - .pool -_0818B5A0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x9 - bl pokemon_setattr - b _0818B836 - .pool -_0818B5C0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x37 - bl pokemon_setattr - b _0818B836 - .pool -_0818B5E0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x38 - bl pokemon_setattr - b _0818B836 - .pool -_0818B600: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x39 - bl pokemon_setattr - b _0818B836 - .pool -_0818B620: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3A - bl pokemon_setattr - b _0818B836 - .pool -_0818B640: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3B - bl pokemon_setattr - b _0818B836 - .pool -_0818B660: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3C - bl pokemon_setattr - b _0818B836 - .pool -_0818B680: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3D - bl pokemon_setattr - b _0818B836 - .pool -_0818B6A0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3E - bl pokemon_setattr - b _0818B836 - .pool -_0818B6C0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x3F - bl pokemon_setattr - b _0818B836 - .pool -_0818B6E0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x16 - bl pokemon_setattr - b _0818B836 - .pool -_0818B700: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x17 - bl pokemon_setattr - b _0818B836 - .pool -_0818B720: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x18 - bl pokemon_setattr - b _0818B836 - .pool -_0818B740: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x21 - bl pokemon_setattr - b _0818B836 - .pool -_0818B760: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x2F - bl pokemon_setattr - b _0818B836 - .pool -_0818B780: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x30 - bl pokemon_setattr - b _0818B836 - .pool -_0818B7A0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x32 - bl pokemon_setattr - b _0818B836 - .pool -_0818B7C0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x33 - bl pokemon_setattr - b _0818B836 - .pool -_0818B7E0: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x34 - bl pokemon_setattr - b _0818B836 - .pool -_0818B800: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x35 - bl pokemon_setattr - b _0818B836 - .pool -_0818B820: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02024064 - ldrb r2, [r1] - lsls r2, 9 - adds r2, r7 - movs r1, 0x36 - bl pokemon_setattr -_0818B836: - ldr r2, =0x0202406e - ldr r0, =0x02024064 - ldrb r1, [r0] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - 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, =0x0202406e - ldr r7, =0x02024064 - 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, =0x02023064 - lsls r2, 9 - adds r0, r4, 0x1 - adds r0, r2, r0 - ldrb r0, [r0] - ldr r1, =0x020244ec - 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, =0x0202406e - mov r8, r0 - ldr r6, =0x02024064 - ldrb r1, [r6] - lsls r0, r1, 1 - add r0, r8 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - 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 pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldrb r0, [r6] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_806A068 - ldr r0, =0x0202499c - 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 AddObjectToFront - ldr r4, =0x020241e4 - ldrb r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r5, =0x02020630 - 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, =0x020244e4 - adds r2, r1 - ldrb r1, [r2] - bl StartObjectImageAnim - ldr r1, =0x03005d60 - 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, =0x02024064 - ldrb r0, [r5] - ldr r4, =0x02023064 - lsls r1, r0, 9 - adds r6, r4, 0x2 - adds r1, r6 - ldrb r1, [r1] - bl sub_805EF84 - ldr r2, =0x0202406e - 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, =0x020244ec - adds r0, r2 - bl sub_805DD7C - ldrb r0, [r5] - lsls r1, r0, 9 - adds r1, r6 - ldrb r1, [r1] - bl sub_818BA6C - ldr r1, =0x03005d60 - 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, =0x0202406e - lsls r2, r6, 1 - adds r2, r0 - ldr r0, =0x02023064 - 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, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - mov r8, r0 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r0, =sub_805D714 - bl object_new_hidden_with_callback - ldr r1, =0x03005d7c - mov r9, r1 - add r9, r6 - mov r1, r9 - strb r0, [r1] - adds r0, r6, 0 - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, r8 - bl sub_806A068 - ldr r0, =0x0202499c - 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 AddObjectToFront - ldr r4, =0x020241e4 - adds r4, r6, r4 - strb r0, [r4] - ldr r5, =0x02020630 - 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, =0x020244e4 - adds r6, r1 - ldrb r1, [r6] - bl StartObjectImageAnim - 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, =DummyObjectCallback - 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, =0x02023064 - ldr r6, =0x02024064 - ldrb r2, [r6] - lsls r0, r2, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r3, [r0] - cmp r3, 0 - bne _0818BC30 - ldr r0, =0x020244d0 - 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, =0x03005d60 - ldrb r0, [r6] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_818BC78 - str r1, [r0] - b _0818BC66 - .pool -_0818BC30: - ldr r5, =0x020241e4 - adds r0, r2, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl obj_free_rotscale_entry - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r1, =0x03005d70 - 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, =0x020244d0 - ldr r4, [r6] - ldr r5, =0x02024064 - 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, =0x03005d60 - 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, =0x02022fec - 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, =0x020229e8 - ldr r0, =0x0203c7b4 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - b _0818BD4A - .pool -_0818BD48: - ldr r0, =0x020229e8 -_0818BD4A: - ldrb r4, [r0, 0x13] -_0818BD4C: - ldr r0, =0x02022fec - ldr r1, [r0] - movs r2, 0x40 - ands r1, r2 - adds r5, r0, 0 - cmp r1, 0 - beq _0818BD98 - ldr r0, =0x02024064 - ldrb r0, [r0] - bl battle_get_per_side_status - 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, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - bl sub_806F000 - lsls r0, 16 - lsrs r4, r0, 16 - adds r5, r4, 0 - ldr r6, =0x02024064 - ldrb r1, [r6] - adds r0, r5, 0 - bl sub_805DF38 - ldrb r0, [r6] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl sub_806A1C0 - ldr r0, =0x0202499c - 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 AddObjectToFront - ldr r4, =0x020241e4 - ldrb r1, [r6] - adds r1, r4 - strb r0, [r1] - ldr r0, =gTrainerFrontPicPaletteTable - lsls r5, 3 - adds r5, r0 - ldrh r0, [r5, 0x4] - bl IndexOfObjectPaletteTag - ldr r5, =0x02020630 - 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, =0x02024064 - ldrb r1, [r5] - adds r0, r4, 0 - bl sub_805DF84 - ldrb r0, [r5] - bl battle_get_per_side_status - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl template_build_for_pokemon_or_trainer - ldr r6, =0x0202499c - 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 AddObjectToFront - ldr r6, =0x020241e4 - ldrb r1, [r5] - adds r1, r6 - strb r0, [r1] - ldr r4, =0x02020630 - 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, =0x03005d60 - ldr r0, =0x02024064 - 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, =0x020241e4 - ldr r4, =0x02024064 - ldrb r0, [r4] - adds r0, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =0x02020630 - 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, =DummyObjectCallback - bl oamt_set_x3A_32 - ldr r1, =0x03005d60 - 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, =0x020244d0 - ldr r4, [r6] - ldr r5, =0x02024064 - 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, =0x0202406e - ldrb r1, [r5] - lsls r0, r1, 1 - adds r0, r2 - ldrh r2, [r0] - movs r0, 0x64 - muls r0, r2 - ldr r2, =0x020244ec - adds r0, r2 - bl sub_805E990 - movs r1, 0x40 - negs r1, r1 - movs r0, 0x10 - bl audio_play_and_stuff - ldr r2, =0x02020630 - ldr r3, =0x020241e4 - 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, =0x03005d60 - 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, =0x02024064 - ldrb r0, [r6] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - beq _0818C192 - b _0818C2A6 -_0818C192: - ldr r0, =0x02023064 - 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, =0x02038432 - mov r1, r12 - adds r1, 0x3 - adds r2, r1 - ldrb r1, [r2] - strb r1, [r5] - ldr r4, =0x02038408 - 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, =0x02038404 - 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, =0x0203841a - ldrb r1, [r6] - lsls r1, 9 - mov r2, r12 - adds r2, 0xA - adds r1, r2 - ldrb r1, [r1] - strb r1, [r3] - ldr r4, =0x0203841c - 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, =0x02038400 - ldrb r2, [r6] - lsls r2, 9 - mov r1, r12 - adds r1, 0x10 - adds r2, r1 - str r2, [r3] - ldr r3, =0x020244bc - 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, =0x020244d0 - 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, =0x03005d60 - 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, =0x02023064 - ldr r6, =0x02024064 - 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, =0x020244d0 - 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, =0x020383f8 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =0x020383fd - 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, =0x020244d0 - ldr r2, [r0] - ldr r0, =0x02024064 - 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, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 9 - ldr r1, =0x02023066 - adds r0, r1 - ldrh r0, [r0] - bl battle_pick_message - ldr r0, =0x02022e2c - movs r1, 0 - bl battle_show_message_maybe - ldr r1, =0x03005d60 - 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, =0x02024332 - ldr r0, =0x0202406c - ldrb r0, [r0] - ldrb r1, [r1, 0x4] - lsrs r0, 1 - cmp r1, r0 - bcc _0818C4C6 - ldr r0, =0x02024064 - 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, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 10 - ands r0, r1 - cmp r0, 0 - beq _0818C508 - ldr r1, =0x03005d60 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, =sub_818C49C - str r1, [r0] - b _0818C522 - .pool -_0818C508: - ldr r0, =0x02024064 - 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, =0x02022fec - 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, =0x02024064 - 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, =0x02024064 - ldrb r0, [r4] - bl sub_8185054 - ldrb r1, [r4] - ldr r3, =0x0202449c - 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, =0x02023064 - ldr r0, =0x02024064 - 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, =0x0202406e - lsls r0, r4, 1 - adds r0, r6 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r4, =0x020244ec - adds r0, r4 - movs r1, 0x3A - bl pokemon_getattr - 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 pokemon_getattr - adds r3, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r1, =0x03005d70 - adds r1, r0, r1 - ldrb r1, [r1] - str r7, [sp] - mov r2, r8 - bl sub_807294C - b _0818C6B2 - .pool -_0818C678: - ldr r1, =0x0202406e - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x3A - bl pokemon_getattr - adds r2, r0, 0 - mov r1, r9 - ldrb r0, [r1] - ldr r4, =0x03005d70 - 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, =0x03005d60 - ldr r0, =0x02024064 - 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, =0x02024064 - ldrb r0, [r4] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _0818C748 - ldr r0, =0x03005d70 - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - ldr r2, =0x0202406e - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =0x020244ec - adds r1, r2 - movs r2, 0x9 - bl healthbar_draw_field_maybe - ldrb r2, [r4] - ldr r0, =0x020244d0 - 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, =0x03005d60 - 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, =0x02024064 - ldrb r0, [r5] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _0818C7BC - ldr r4, =0x02023064 - 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, =0x03005d60 - 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, =0x02022d0c - 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, =0x02022d0c - ldr r1, =0x02023064 - ldr r0, =0x02024064 - 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, =0x02022d0c - 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, =0x02022d0c - 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, =0x02020630 - ldr r2, =0x020241e4 - ldr r4, =0x02024064 - 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, =0x020244b9 - 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, =0x03005d60 - 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, =0x02024064 - ldrb r0, [r4] - bl battle_side_get_owner - lsls r0, 24 - movs r3, 0x3F - cmp r0, 0 - bne _0818C964 - movs r3, 0xC0 -_0818C964: - ldr r2, =0x02023064 - 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 audio_play_and_stuff - 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, =0x02023064 - ldr r5, =0x02024064 - 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 song_play_for_text - 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 fanfare_play -_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, =0x0202406e - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x19 - negs r1, r1 - movs r2, 0x5 - bl sub_80A32E4 - 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, =0x02023064 - ldr r0, =0x02024064 - ldrb r0, [r0] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - bl battle_intro_launch - ldr r2, =0x020243fc - 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, =0x020241e4 - ldr r6, =0x02024064 - ldrb r0, [r6] - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - 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 StartObjectImageAnim - ldr r0, =0x0000d6f9 - bl AllocObjectPalette - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 18 - ands r0, r1 - cmp r0, 0 - beq _0818CB54 - ldr r4, =0x020229e8 - 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, =0x03005d90 - 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 decompress_palette - ldr r2, =0x02020630 - ldr r1, =0x020241e4 - ldr r5, =0x02024064 - 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, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r4 - ldrb r0, [r5] - strh r0, [r1, 0x8] - ldr r3, =0x020244d0 - 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, =0x020244b4 - 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, =0x03005d60 - 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, =0x03005e00 - 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, =0x02024064 - 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, =0x02022fec - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0818CCA0 -_0818CC70: - ldr r0, =0x02023064 - ldrb r1, [r7] - lsls r2, r1, 9 - adds r0, 0x1 - adds r2, r0 - ldr r0, =0x0202406e - 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, =0x02023064 - ldrb r0, [r7] - lsls r1, r0, 9 - adds r4, 0x1 - adds r1, r4 - ldr r5, =0x0202406e - 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, =0x020244ec - 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, =0x03005d60 - ldr r2, =0x02024064 - 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, =0x02023064 - ldr r0, =0x02024064 - 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 battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _0818CD60 - bl sub_818A514 - b _0818CDD4 - .pool -_0818CD60: - ldr r6, =0x020244d0 - ldr r0, [r6] - ldr r5, =0x02024064 - 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, =0x02023068 - 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, =0x020244b4 - 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, =0x03005d60 - 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, =0x020244d0 - ldr r0, [r4] - ldr r3, =0x02024064 - 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, =0x020244d0 - ldr r1, [r0] - ldr r0, =0x02024064 - 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, =0x03005e00 - ldr r0, =0x020244b4 - 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, =0x02024064 - ldrb r0, [r4] - bl sub_80A6A90 - lsls r0, 24 - cmp r0, 0 - beq _0818CEDE - ldr r3, =0x02020630 - ldr r0, =0x020241e4 - 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, =0x02023064 - 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, =0x02024064 - ldrb r0, [r6] - bl mplay_80342A4 - lsls r0, 24 - cmp r0, 0 - bne _0818CF50 - ldr r5, =0x02023064 - 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, =0x03005d60 - 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, =0x0202433a - ldr r1, =0x02023064 - ldr r4, =0x02024064 - ldrb r0, [r4] - lsls r0, 9 - adds r1, 0x1 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - movs r0, 0x5 - bl sub_80A2F50 - movs r0, 0x3 - bl sub_80A2390 - bl sub_818A514 - ldr r1, =0x03005d60 - 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, =0x0203cd04 - 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 DecompressMonPic - 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 DecompressMonPicWithoutDuplicatingDeoxysTiles - 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, =0x0203ccec - 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, =0x0203ccec - 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, =0x0203ccec - 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 decompress_palette - b _0818D16E - .pool -_0818D160: - ldr r0, =0x0203ccec - 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 decompress_palette - b _0818D1B4 -_0818D1A4: - ldr r1, =gTrainerFrontPicPaletteTable - lsls r0, 3 - adds r0, r1 - ldr r0, [r0] - lsls r1, r4, 4 - movs r2, 0x20 - bl decompress_palette -_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, =0x0203ccec - ldr r0, =gUnknown_082FF70C - str r0, [r1, 0x8] - b _0818D1E0 - .pool -_0818D1D8: - ldr r0, =0x0203ccec - 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, =0x0203cd04 - 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, =0x0203ccec - 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, =gDummyObjectRotScalAnimTable - 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 AddObjectToFront - lsls r0, 24 - lsrs r2, r0, 24 - adds r6, r2, 0 - ldr r0, =0x0000ffff - cmp r10, r0 - bne _0818D336 - ldr r0, =0x02020630 - 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, =0x0203cd04 - 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, =0x0203cd04 - 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, =0x0203ccec - 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, =gDummyObjectRotScalAnimTable - 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 AddObjectToFront - 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, =0x02020630 - 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, =0x0203cd04 - 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, =0x0203cd04 - 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, =0x02020630 - adds r0, r6, r4 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - bl GetObjectPaletteTagBySlot - lsls r0, 16 - lsrs r0, 16 - bl FreeObjectPaletteByTag -_0818D624: - adds r0, r6, r4 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - 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, =0x03005d8c - 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, =0x03005d8c - 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, =0x020375f0 - movs r0, 0x1 - b _0818DA24 - .pool -_0818DA20: - ldr r1, =0x020375f0 - 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, =0x03005d90 - 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 GenerateRandomNumber - 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, =0x020375f0 - 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 GenerateRandomNumber - ldr r5, =0x0203cd64 - 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 GenerateRandomNumber - 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, =0x0203cd64 - ldr r0, =0x03005d8c - 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, =gUnknown_82E9531 - 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, =0x0203cd64 - ldr r0, =0x03005d8c - 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, =0x0203cd64 - ldr r0, =0x03005d8c - 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, =0x0203cd64 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldr r4, =0x02021cc4 - ldrb r0, [r0, 0xC] - bl sub_818DC1C - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - 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, =0x0203cd64 - ldr r0, =0x03005d8c - 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, =0x02021ec4 - ldr r0, =0x00003b5c - adds r1, r0 - adds r0, r4, 0 - bl CopyString_Limit7 - ldr r0, [r5] - ldrb r1, [r0, 0x12] - adds r0, r4, 0 - bl StopMusicWhileStringIsPrinted - 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_get_item - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_818DCAC - - thumb_func_start sub_818DCC8 -sub_818DCC8: @ 818DCC8 - push {lr} - ldr r2, =0x0203cd64 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x00003b58 - adds r1, r0 - str r1, [r2] - ldr r0, =0x02021dc4 - 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 CopyString_Limit7 - 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, =0x0203cd64 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r1, r0, r2 - str r1, [r5] - ldr r1, =0x00003b5c - adds r0, r1 - ldr r4, =0x02021ec4 - adds r1, r4, 0 - bl sub_818DCF4 - ldr r0, [r5] - ldrb r1, [r0, 0x12] - adds r0, r4, 0 - bl StopMusicWhileStringIsPrinted - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818DD14 - - thumb_func_start sub_818DD54 -sub_818DD54: @ 818DD54 - ldr r1, =0x0203cd64 - ldr r0, =0x03005d8c - 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, =0x0203cd64 - ldr r0, =0x03005d8c - 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, =0x02021dc4 - adds r1, r5, 0 - bl sub_818DCAC - ldr r1, [r4] - strh r5, [r1, 0xE] - ldr r0, =0x03005d90 - ldr r0, [r0] - adds r1, 0x4 - bl sub_818DCF4 - ldr r1, [r4] - ldr r0, =gUnknown_82E9531 - 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, =0x0203ce7c - 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, =0x0203cd64 - ldr r0, =0x03005d8c - 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, =0x02021dc4 - 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, =0x0203cd64 - ldr r0, =0x03005d8c - 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, =0x0203cd64 - 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 GenerateRandomNumber - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0xF - ands r4, r0 - movs r3, 0 - ldr r5, =0x0203cd68 - 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, =0x0203cd68 - ldr r0, =0x03005d8c - 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, =gUnknown_82E9531 - 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, =0x0203cd68 - ldr r0, =0x03005d8c - 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, =0x0203cd68 - ldr r0, =0x03005d8c - 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, =0x03005d8c - 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, =0x0203cd68 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r2, =0x00003b58 - adds r0, r1, r2 - str r0, [r5] - ldrb r0, [r0, 0x18] - cmp r0, 0xFF - bne _0818E174 - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085EEB7E - bl CopyString_Limit7 - movs r7, 0 - b _0818E1DC - .pool -_0818E174: - ldr r4, =0x02021cc4 - ldr r0, =0x00003b70 - adds r1, r0 - adds r0, r4, 0 - bl CopyString_Limit7 - ldr r0, [r5] - adds r0, 0x2D - ldrb r1, [r0] - adds r0, r4, 0 - bl StopMusicWhileStringIsPrinted - ldr r0, [r5] - adds r0, 0x18 - bl sub_818E258 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r6, =0x03005d90 - 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, =0x0203cd68 - ldr r1, [r0] - adds r1, 0x18 - adds r1, r2 - ldr r0, =0x03005d90 - 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, =0x0203cd68 - ldr r0, =0x03005d8c - 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, =0x03005d90 - 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, =0x02021cc4 - ldr r0, =0x0203cd68 - ldr r0, [r0] - ldrh r0, [r0, 0x28] - bl itemid_get_item - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - 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, =0x0203cd68 - ldr r0, =0x03005d8c - 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, =gUnknown_82E9531 - 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, =0x0203cd68 - ldr r0, =0x03005d8c - 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, =0x0203cd68 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r5] - ldr r6, =0x02021cc4 - ldrh r1, [r0, 0x14] - adds r0, r6, 0 - bl CopyEasyChatWord - ldr r4, =0x02021dc4 - ldr r0, [r5] - ldrh r1, [r0, 0x16] - adds r0, r4, 0 - bl CopyEasyChatWord - adds r0, r6, 0 - adds r1, r4, 0 - bl CompareString - 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, =0x0203cd68 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldr r1, =0x020375e2 - 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, =0x0203cd68 - ldr r0, =0x03005d8c - 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, =0x0203cd68 - ldr r0, =0x03005d8c - 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, =0x0203cd68 - ldr r0, =0x03005d8c - 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, =0x0203cd68 - ldr r0, =0x03005d8c - 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, =0x0203cd68 - ldr r0, =0x03005d8c - 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, =0x020375e0 - 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, =0x0203ce7c - ldrh r0, [r0] - movs r1, 0x1 - bl remove_item - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E490 - - thumb_func_start sub_818E4A4 -sub_818E4A4: @ 818E4A4 - push {r4-r6,lr} - ldr r2, =0x0203cd68 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00003b58 - adds r0, r1 - str r0, [r2] - ldr r1, =0x0203ce7c - ldrh r1, [r1] - strh r1, [r0, 0x28] - movs r3, 0 - adds r4, r2, 0 - ldr r6, =0x03005d90 - 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 CopyString_Limit7 - ldr r0, [r4] - ldr r1, =gUnknown_82E9531 - 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, =0x0203cd68 - ldr r0, =0x03005d8c - 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, =0x0203cd68 - ldr r0, =0x03005d8c - ldr r1, [r0] - ldr r0, =0x00003b58 - adds r1, r0 - str r1, [r2] - ldr r0, =0x02021ec4 - 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, =0x0203cd68 - ldr r1, =0x03005d8c - 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 GenerateRandomNumber - 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, =0x0203cd68 - 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, =0x0203cd6c - 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 GenerateRandomNumber - 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, =0x0203cd6c - ldr r0, =0x03005d8c - 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, =gUnknown_82E9531 - 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, =0x0203cd6c - ldr r0, =0x03005d8c - 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, =0x0203cd6c - ldr r0, =0x03005d8c - 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, =0x03005d90 - adds r1, 0x4 - ldr r0, [r0] - ldm r0!, {r2,r3} - stm r1!, {r2,r3} - ldr r1, [r4] - ldr r0, =gUnknown_82E9531 - 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, =0x0203cd6c - ldr r0, =0x03005d8c - 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, =0x0203cd6c - 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, =0x0203cd6c - ldr r1, =0x03005d8c - 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 CopyString - 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 CopyString_Limit10 - 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, =0x0203cd6c - ldr r1, =0x03005d8c - 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 CopyString - 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, =0x0203cd6c - ldr r1, =0x03005d8c - ldr r1, [r1] - ldr r4, =0x00003b58 - adds r2, r1, r4 - str r2, [r3] - ldr r2, =0x00003b5c - adds r1, r2 - bl CopyString - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E81C - - thumb_func_start sub_818E848 -sub_818E848: @ 818E848 - ldr r2, =0x0203cd6c - ldr r1, =0x03005d8c - 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 CopyString - pop {r0} - bx r0 - .pool - thumb_func_end sub_818E868 - - thumb_func_start sub_818E880 -sub_818E880: @ 818E880 - push {lr} - ldr r1, =0x0203cd6c - ldr r0, =0x03005d8c - 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, =0x0203cd6c - ldr r0, =0x03005d8c - 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, =0x0203cd6c - ldr r0, =0x03005d8c - 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, =0x02021dc4 - ldr r1, =0x02021cc4 - 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, =0x0203cd6c - ldr r0, =0x03005d8c - 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, =0x0203cd6c - ldr r0, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00003b58 - adds r0, r2 - str r0, [r1] - ldr r2, =0x020375e2 - 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, =0x0203cd6c - ldr r0, =0x03005d8c - 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, =0x020375e0 - 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, =0x03005d90 - 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, =0x03005d8c - 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, =0x02038bca - 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, =0x03005d90 - 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, =0x020375e2 - 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, =0x020375f0 - ldr r0, =0x03005d90 - 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, =0x020375f0 - ldr r0, =0x03005d90 - 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, =0x020375f0 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 31 - b _0818ECBE - .pool -_0818EB64: - ldr r1, =0x020375f0 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r3, =0x00000d08 - adds r0, r3 - ldrb r0, [r0] - lsls r0, 30 - b _0818ECBE - .pool -_0818EB80: - ldr r1, =0x020375f0 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - b _0818ECBA - .pool -_0818EB98: - ldr r1, =0x020375f0 - ldr r0, =0x03005d90 - 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, =0x020375f0 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 26 - b _0818ECBE - .pool -_0818EBE8: - ldr r1, =0x020375f0 - ldr r0, =0x03005d90 - 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, =0x020375f0 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - b _0818ECBE - .pool -_0818EC24: - ldr r1, =0x020375f0 - ldr r0, =0x03005d90 - 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, =0x020375f0 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - ldrb r0, [r0] - lsrs r0, 7 - strh r0, [r1] - b _0818ED10 - .pool -_0818EC74: - ldr r1, =0x020375f0 - ldr r0, =0x03005d90 - 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, =0x020375f0 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r2, =0x00000d08 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 28 - b _0818ECBE - .pool -_0818ECB0: - ldr r1, =0x020375f0 - ldr r0, =0x03005d90 - 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, =0x0203cef8 - ldr r0, =0x03005d90 - 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, =0x020375f0 - ldr r0, =0x03005d90 - 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, =0x03005d90 - 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, =0x020375e2 - 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, =0x03005d90 - 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, =0x020375e4 - ldrh r0, [r0] - strh r0, [r2] - b _0818F01E - .pool -_0818EDB4: - ldr r0, =0x020375e4 - ldrh r0, [r0] - cmp r0, 0 - beq _0818EDE8 - ldr r0, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - ldr r2, [r0] - ldr r0, =0x020375e4 - 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, =0x03005d90 - ldr r3, [r0] - ldr r0, =0x020375e4 - 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, =0x03005d90 - ldr r3, [r0] - ldr r0, =0x020375e4 - ldrb r0, [r0] - ldr r1, =0x00000d08 - adds r3, r1 - b _0818EFE8 - .pool -_0818EE78: - ldr r0, =0x03005d90 - ldr r3, [r0] - ldr r0, =0x020375e4 - 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, =0x03005d90 - ldr r3, [r0] - ldr r0, =0x020375e4 - 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, =0x03005d90 - ldr r3, [r0] - ldr r0, =0x020375e4 - 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, =0x03005d90 - ldr r3, [r0] - ldr r0, =0x020375e4 - 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, =0x03005d90 - ldr r2, [r0] - ldr r0, =0x020375e4 - 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, =0x03005d90 - ldr r2, [r0] - ldr r0, =0x020375e4 - 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, =0x03005d90 - ldr r3, [r0] - ldr r0, =0x020375e4 - 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, =0x03005d90 - ldr r3, [r0] - ldr r0, =0x020375e4 - 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, =0x03005d90 - ldr r3, [r0] - ldr r0, =0x020375e4 - 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, =0x03005d90 - ldr r2, [r0] - ldr r0, =0x0203cef8 - 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, =0x03005d90 - 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, =0x02024488 - 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 pokemon_getattr - 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 pokemon_getattr - 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, =0x03005d90 -_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 pokemon_getattr - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x0203bc8c - 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, =0x03005d90 - 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, =0x0203bc8c - 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, =0x03005d90 - 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, =gUnknown_0832A328 - ldr r5, =gBaseStats -_0818F38A: - ldr r0, =0x03005d90 - 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, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x3B - movs r2, 0 - bl pokemon_getattr - ldr r2, [sp, 0x18] - ldrh r1, [r2] - adds r1, r0 - strh r1, [r2] - adds r0, r4, 0 - movs r1, 0x3C - movs r2, 0 - bl pokemon_getattr - ldr r3, [sp, 0x18] - ldrh r1, [r3] - adds r1, r0 - strh r1, [r3] - adds r0, r4, 0 - movs r1, 0x3E - movs r2, 0 - bl pokemon_getattr - ldr r2, [sp, 0x18] - ldrh r1, [r2] - adds r1, r0 - strh r1, [r2] - adds r0, r4, 0 - movs r1, 0x3F - movs r2, 0 - bl pokemon_getattr - ldr r3, [sp, 0x18] - ldrh r1, [r3] - adds r1, r0 - strh r1, [r3] - adds r0, r4, 0 - movs r1, 0x3D - movs r2, 0 - bl pokemon_getattr - ldr r2, [sp, 0x18] - ldrh r1, [r2] - adds r1, r0 - strh r1, [r2] - adds r0, r4, 0 - movs r1, 0x3A - movs r2, 0 - bl pokemon_getattr - ldr r3, [sp, 0x18] - ldrh r1, [r3] - adds r1, r0 - strh r1, [r3] - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - 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 pokemon_getattr - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x0203bc8c - 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, =0x03005d90 - ldr r0, [r3] - ldr r1, =0x00000d64 - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - ldr r2, =0x0203bc8c - 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, =gUnknown_0832A328 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x02021cc4 - ldr r2, =gUnknown_085CCD20 - ldr r1, =0x03005d90 - ldr r1, [r1] - ldr r3, =0x00000cb2 - adds r1, r3 - ldrh r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl CopyString - pop {r0} - bx r0 - .pool - thumb_func_end sub_818F9B0 - - thumb_func_start sub_818F9E0 -sub_818F9E0: @ 818F9E0 - push {lr} - ldr r0, =0x02021cc4 - ldr r2, =gUnknown_085CCD20 - ldr r1, =0x03005d90 - ldr r1, [r1] - ldr r3, =0x00000cb2 - adds r1, r3 - ldrh r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl CopyString - ldr r0, =0x02021dc4 - ldr r1, =0x02038bca - 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, =0x0203cd70 - movs r0, 0 - str r0, [r1] - ldr r4, =0x020244ec - adds r0, r4, 0 - movs r1, 0x3A - movs r2, 0 - bl pokemon_getattr - ldr r5, =0x0203cd74 - str r0, [r5] - adds r4, 0x64 - adds r0, r4, 0 - movs r1, 0x3A - movs r2, 0 - bl pokemon_getattr - ldr r1, [r5] - adds r1, r0 - str r1, [r5] - bl calc_player_party_count - ldr r0, =0x02038bca - 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, =0x02024744 - adds r0, r3, r6 - ldr r7, =0x03005d90 - 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, =0x0203bc8c - 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, =0x0203bc8c - mov r4, r10 - str r4, [sp, 0x20] -_0818FB18: - ldr r7, =0x03005d90 - 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, =0x02024744 - adds r0, r7, r2 - mov r2, r12 - str r3, [sp, 0x24] - bl sub_80691F4 - ldr r7, =0x03005d90 - 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, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x20 - add r2, sp, 0xC - bl pokemon_setattr - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, [sp, 0x20] - add r1, r8 - ldr r2, =0x00000d64 - adds r0, r2 - adds r0, r1 - ldrh r0, [r0] - ldr r1, =0x0203bc8c - 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 pokemon_setattr - 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 GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsrs r7, r4, 16 - lsls r0, 16 - orrs r7, r0 - bl GenerateRandomNumber - 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 GenerateRandomNumber - 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, =0x03005d90 - 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, =0x0203bc8c - 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, =0x020244ec - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - 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, =0x03005d90 - 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, =0x0203bc8c - 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, =0x020244ec - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - 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, =gUnknown_0832A328 -_0818FEF0: - str r3, [sp, 0x14] - bl GenerateRandomNumber - 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 GenerateRandomNumber - 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, =gUnknown_0832A328 - 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, =0x03005d90 - 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, =0x02038bca - 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, =0x03005d90 - 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, =0x02038bca - 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, =0x03005d90 - ldr r0, [r4] - ldr r1, =0x020375e2 - 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, =0x03005d90 - 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, =0x03005e00 - 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, =0x03005e00 - 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, =0x02022e14 - strh r4, [r0] - ldr r0, =0x02022e16 - strh r4, [r0] - ldr r0, =0x02022e18 - strh r4, [r0] - ldr r0, =0x02022e1a - strh r4, [r0] - ldr r0, =0x02022e20 - strh r4, [r0] - ldr r0, =0x02022e22 - strh r4, [r0] - mov r2, r9 - cmp r2, 0x2 - bne _081904DC - ldr r0, =0x02022e1c - strh r4, [r0] - ldr r0, =0x02022e1e - strh r4, [r0] - b _081904E6 - .pool -_081904DC: - ldr r0, =0x02022e1c - strh r4, [r0] - ldr r1, =0x02022e1e - movs r0, 0xA0 - strh r0, [r1] -_081904E6: - ldr r0, =0x03005e00 - 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 sub_80A1A74 - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - ldr r1, =0x0300301c - 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 decompress_palette - ldr r0, =gUnknown_08D85444 - movs r1, 0x80 - lsls r1, 1 - adds r2, r4, 0 - bl decompress_palette - ldr r0, =gUnknown_08D85600 - movs r1, 0xF0 - movs r2, 0x20 - bl decompress_palette - mov r0, r9 - cmp r0, 0x2 - bne _081905DE - ldr r0, =gUnknown_08D854C8 - movs r1, 0x50 - movs r2, 0x20 - bl decompress_palette -_081905DE: - str r7, [sp, 0x8] - add r0, sp, 0x8 - ldr r1, =0x02037b14 - 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, =0x0203cd78 - 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, =0x03005e00 - 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, =0x0203cd78 - 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 AddObjectToFront - lsls r0, 24 - lsrs r7, r0, 24 - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - ldr r1, =0x02020630 - mov r8, r1 - add r4, r8 - adds r0, r4, 0 - movs r1, 0 - bl StartObjectImageAnim - strh r6, [r4, 0x2E] - adds r0, r5, 0 - movs r1, 0x78 - movs r2, 0x9C - movs r3, 0 - bl AddObjectToFront - 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 StartObjectImageAnim - strh r6, [r4, 0x2E] - ldr r5, =gUnknown_0860D050 - adds r0, r5, 0 - movs r1, 0x6 - movs r2, 0x50 - movs r3, 0 - bl AddObjectToFront - 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 StartObjectImageAnim - 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 AddObjectToFront - 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 StartObjectImageAnim - 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, =DummyObjectCallback - str r0, [r2, 0x1C] - b _081907F0 - .pool -_081907D4: - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0xBF - ble _081907F0 - ldr r0, =0x0203cd78 - 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, =DummyObjectCallback - 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, =0x0203cd78 - 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, =DummyObjectCallback - str r0, [r2, 0x1C] - b _081908C0 - .pool -_081908A4: - lsls r1, 16 - ldr r0, =0x010f0000 - cmp r1, r0 - ble _081908C0 - ldr r0, =0x0203cd78 - 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, =DummyObjectCallback - 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, =0x0203cd78 - 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, =0x0203cd78 - 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, =0x0203cd78 - 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, =0x0203cd78 - 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, =0x0203cd78 - 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, =0x03005e00 - 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, =0x03005d90 - 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, =0x0203cd78 - 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, =0x0203cd78 - 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, =0x0203cd78 - 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, =0x0203cd78 - 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, =0x0203cd78 - 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, =0x03005e00 - 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, =0x0203cd78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0 - bne _08190CA6 - b _08190CC0 - .pool -_08190C9C: - ldr r0, =0x0203cd78 - 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, =0x03005e00 - 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, =0x02037fd4 - 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 pal_fade_maybe - ldr r1, =0x03005e00 - 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, =0x02037fd4 - 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, =0x03005e00 - 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 pal_fade_maybe - ldr r1, =0x03005e00 - 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, =0x03005e00 - 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, =0x03005e00 - 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, =0x03005e00 - 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, =0x03005e00 - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _08190ED4 - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r0, =0x02022e18 - strh r1, [r0] - ldr r1, =0x02022e1a - movs r0, 0xA0 - strh r0, [r1] - b _08190EE6 - .pool -_08190ED4: - ldr r0, =0x02022e14 - strh r2, [r0] - ldr r1, =0x02022e16 - movs r0, 0xA0 - strh r0, [r1] - ldr r0, =0x02022e18 - strh r2, [r0] - ldr r0, =0x02022e1a - strh r2, [r0] -_08190EE6: - cmp r6, 0x1 - bne _08190F9C - ldr r5, =0x0203cd78 - ldr r0, [r5] - ldrb r1, [r0, 0x10] - cmp r1, 0 - bne _08190F50 - ldr r0, =0x02022e1c - strh r1, [r0] - ldr r1, =0x02022e1e - movs r6, 0xA0 - lsls r6, 1 - adds r0, r6, 0 - strh r0, [r1] - ldr r3, =gUnknown_0860D080 - ldr r2, =0x03005e00 - 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, =0x02022e1c - movs r6, 0x80 - lsls r6, 1 - adds r0, r6, 0 - strh r0, [r1] - ldr r0, =0x02022e1e - movs r4, 0 - strh r4, [r0] - ldr r3, =gUnknown_0860D080 - ldr r2, =0x03005e00 - 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, =0x0203cd78 - ldr r1, [r6] - ldrb r5, [r1, 0x10] - cmp r5, 0 - bne _08190FF8 - ldr r4, =0x03005e00 - 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, =0x02022e1c - strh r5, [r0] - ldr r1, =0x02022e1e - 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, =0x03005e00 - 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, =0x02022e1c - movs r0, 0 - strh r0, [r1] - ldr r1, =0x02022e1e - 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, =0x02022e1c - movs r3, 0x80 - lsls r3, 1 - adds r0, r3, 0 - strh r0, [r1] - ldr r1, =0x02022e1e - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =0x03005e00 - 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, =0x0203cd78 - mov r10, r5 - ldr r3, =0x02020630 - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r1, =0x03005e00 - 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, =0x0203cd78 - mov r12, r2 - ldr r3, =0x02020630 - ldr r1, =0x03005e00 - 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, =0x03005e00 - adds r0, r3 - movs r2, 0 - movs r1, 0x4 - bl _08191FE8 - .pool -_08191234: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r4, =0x03005e00 - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _08191278 - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r0, =0x02022e18 - strh r1, [r0] - ldr r1, =0x02022e1a - ldr r2, =0x0000ff60 - adds r0, r2, 0 - strh r0, [r1] - b _0819128C - .pool -_08191278: - ldr r0, =0x02022e14 - strh r2, [r0] - ldr r1, =0x02022e16 - ldr r3, =0x0000ff60 - adds r0, r3, 0 - strh r0, [r1] - ldr r0, =0x02022e18 - strh r2, [r0] - ldr r0, =0x02022e1a - strh r2, [r0] -_0819128C: - cmp r6, 0x2 - bne _0819133C - ldr r5, =0x0203cd78 - ldr r0, [r5] - ldrb r1, [r0, 0x10] - cmp r1, 0 - bne _081912F4 - ldr r0, =0x02022e1c - strh r1, [r0] - ldr r1, =0x02022e1e - movs r0, 0xA0 - strh r0, [r1] - ldr r3, =gUnknown_0860D080 - ldr r2, =0x03005e00 - 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, =0x02022e1c - movs r4, 0 - strh r4, [r0] - ldr r0, =0x02022e1e - strh r4, [r0] - ldr r3, =gUnknown_0860D080 - ldr r2, =0x03005e00 - 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, =0x0203cd78 - ldr r1, [r6] - ldrb r5, [r1, 0x10] - cmp r5, 0 - bne _08191394 - ldr r4, =0x03005e00 - 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, =0x02022e1c - strh r5, [r0] - ldr r1, =0x02022e1e - 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, =0x03005e00 - 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, =0x02022e1c - movs r0, 0 - strh r0, [r1] - ldr r1, =0x02022e1e - 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, =0x02022e1c - movs r4, 0x80 - lsls r4, 1 - adds r0, r4, 0 - strh r0, [r1] - ldr r1, =0x02022e1e - movs r0, 0 - strh r0, [r1] - ldr r1, =0x03005e00 - 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, =0x0203cd78 - mov r10, r0 - ldr r3, =0x02020630 - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r1, =0x03005e00 - 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, =0x0203cd78 - mov r12, r2 - ldr r3, =0x02020630 - ldr r1, =0x03005e00 - 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, =0x03005e00 - adds r0, r3 - movs r2, 0 - movs r1, 0x5 - bl _08191FE8 - .pool -_081915CC: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r4, =0x03005e00 - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _0819160C - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r2, =0x02022e18 - movs r6, 0x80 - lsls r6, 1 - adds r0, r6, 0 - strh r0, [r2] - ldr r0, =0x02022e1a - strh r1, [r0] - b _08191622 - .pool -_0819160C: - ldr r1, =0x02022e14 - movs r3, 0x80 - lsls r3, 1 - adds r0, r3, 0 - strh r0, [r1] - ldr r0, =0x02022e16 - strh r2, [r0] - ldr r0, =0x02022e18 - strh r2, [r0] - ldr r0, =0x02022e1a - strh r2, [r0] -_08191622: - ldr r0, =0x0203cd78 - ldr r4, [r0] - ldrb r0, [r4, 0x10] - cmp r0, 0 - bne _08191688 - ldr r1, =0x02022e1c - movs r4, 0x80 - lsls r4, 1 - adds r0, r4, 0 - strh r0, [r1] - ldr r1, =0x02022e1e - movs r0, 0xA0 - strh r0, [r1] - ldr r3, =gUnknown_0860D080 - ldr r2, =0x03005e00 - 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, =0x02022e1c - movs r6, 0x80 - lsls r6, 1 - adds r0, r6, 0 - strh r0, [r1] - ldr r1, =0x02022e1e - movs r0, 0 - strh r0, [r1] - ldr r3, =gUnknown_0860D15C - ldr r2, =0x03005e00 - 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, =0x0203cd78 - mov r10, r0 - ldr r3, =0x02020630 - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r1, =0x03005e00 - 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, =0x0203cd78 - mov r12, r2 - ldr r3, =0x02020630 - ldr r1, =0x03005e00 - 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, =0x03005e00 - adds r0, r3 - movs r2, 0 - movs r1, 0x6 - b _08191FE8 - .pool -_0819187C: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r4, =0x03005e00 - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _081918BC - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r2, =0x02022e18 - movs r6, 0x80 - lsls r6, 1 - adds r0, r6, 0 - strh r0, [r2] - ldr r0, =0x02022e1a - strh r1, [r0] - b _081918D2 - .pool -_081918BC: - ldr r1, =0x02022e14 - movs r3, 0x80 - lsls r3, 1 - adds r0, r3, 0 - strh r0, [r1] - ldr r0, =0x02022e16 - strh r2, [r0] - ldr r0, =0x02022e18 - strh r2, [r0] - ldr r0, =0x02022e1a - strh r2, [r0] -_081918D2: - ldr r0, =0x0203cd78 - ldr r2, [r0] - ldrb r0, [r2, 0x10] - cmp r0, 0 - bne _08191924 - ldr r1, =0x02022e1c - movs r4, 0x80 - lsls r4, 1 - adds r0, r4, 0 - strh r0, [r1] - ldr r1, =0x02022e1e - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =0x03005e00 - 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, =0x02022e1c - movs r0, 0 - strh r0, [r1] - ldr r1, =0x02022e1e - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =0x03005e00 - 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, =0x0203cd78 - mov r10, r0 - ldr r3, =0x02020630 - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r1, =0x03005e00 - 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, =0x0203cd78 - mov r12, r2 - ldr r3, =0x02020630 - ldr r1, =0x03005e00 - 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, =0x03005e00 - adds r0, r3 - movs r2, 0 - movs r1, 0x6 - b _08191FE8 - .pool -_08191B08: - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r4, =0x03005e00 - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _08191B48 - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r2, =0x02022e18 - movs r6, 0xFF - lsls r6, 8 - adds r0, r6, 0 - strh r0, [r2] - ldr r0, =0x02022e1a - strh r1, [r0] - b _08191B5E - .pool -_08191B48: - ldr r1, =0x02022e14 - movs r3, 0xFF - lsls r3, 8 - adds r0, r3, 0 - strh r0, [r1] - ldr r0, =0x02022e16 - strh r2, [r0] - ldr r0, =0x02022e18 - strh r2, [r0] - ldr r0, =0x02022e1a - strh r2, [r0] -_08191B5E: - ldr r0, =0x0203cd78 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0x1 - bne _08191B94 - ldr r1, =0x02022e1c - movs r0, 0 - strh r0, [r1] - ldr r1, =0x02022e1e - movs r0, 0xA0 - strh r0, [r1] - b _08191B9E - .pool -_08191B94: - ldr r0, =0x02022e1c - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e1e - strh r1, [r0] -_08191B9E: - ldr r4, =gUnknown_0860D15C - ldr r5, =0x0203cd78 - ldr r3, [r5] - ldr r2, =0x03005e00 - 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, =0x02020630 - 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, =0x0203cd78 - mov r12, r2 - ldr r3, =0x02020630 - ldr r1, =0x03005e00 - 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, =0x03005e00 - adds r0, r4 - movs r5, 0xC - ldrsh r2, [r0, r5] - cmp r2, 0 - beq _08191DA8 - ldr r0, =0x02022e14 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x02022e16 - strh r1, [r0] - ldr r2, =0x02022e18 - movs r6, 0xFF - lsls r6, 8 - adds r0, r6, 0 - strh r0, [r2] - ldr r0, =0x02022e1a - strh r1, [r0] - b _08191DBE - .pool -_08191DA8: - ldr r1, =0x02022e14 - movs r3, 0xFF - lsls r3, 8 - adds r0, r3, 0 - strh r0, [r1] - ldr r0, =0x02022e16 - strh r2, [r0] - ldr r0, =0x02022e18 - strh r2, [r0] - ldr r0, =0x02022e1a - strh r2, [r0] -_08191DBE: - ldr r0, =0x0203cd78 - ldr r2, [r0] - ldrb r0, [r2, 0x10] - cmp r0, 0x2 - bne _08191E10 - ldr r1, =0x02022e1c - movs r4, 0x80 - lsls r4, 1 - adds r0, r4, 0 - strh r0, [r1] - ldr r1, =0x02022e1e - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =0x03005e00 - 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, =0x02022e1c - movs r0, 0 - strh r0, [r1] - ldr r1, =0x02022e1e - movs r0, 0xA0 - strh r0, [r1] - ldr r1, =0x03005e00 - 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, =0x0203cd78 - mov r10, r0 - ldr r3, =0x02020630 - mov r0, r9 - add r0, r8 - lsls r0, 3 - ldr r1, =0x03005e00 - 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, =0x0203cd78 - mov r12, r2 - ldr r3, =0x02020630 - ldr r1, =0x03005e00 - 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, =0x03005e00 - 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, =0x03005e00 - 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, =0x02022e16 - ldrh r0, [r1] - subs r0, 0x4 - strh r0, [r1] - ldr r1, =0x02022e1a - ldrh r0, [r1] - subs r0, 0x4 - strh r0, [r1] - ldr r1, =0x02022e1e - b _081920A4 - .pool -_08192038: - mov r6, r8 - lsls r0, r6, 2 - add r0, r8 - lsls r0, 3 - ldr r2, =0x03005e00 - 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, =0x02022e16 - ldrh r0, [r1] - adds r0, 0x4 - strh r0, [r1] - ldr r1, =0x02022e1a - ldrh r0, [r1] - adds r0, 0x4 - strh r0, [r1] - ldr r1, =0x02022e1e - b _081920E8 - .pool -_08192078: - mov r3, r8 - lsls r0, r3, 2 - add r0, r8 - lsls r0, 3 - ldr r4, =0x03005e00 - 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, =0x02022e14 - ldrh r0, [r1] - subs r0, 0x4 - strh r0, [r1] - ldr r1, =0x02022e18 - ldrh r0, [r1] - subs r0, 0x4 - strh r0, [r1] - ldr r1, =0x02022e1c -_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, =0x03005e00 - 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, =0x02022e14 - ldrh r0, [r1] - adds r0, 0x4 - strh r0, [r1] - ldr r1, =0x02022e18 - ldrh r0, [r1] - adds r0, 0x4 - strh r0, [r1] - ldr r1, =0x02022e1c -_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, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08192202 - movs r6, 0 - ldr r4, =0x0203cd78 -_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, =0x02020630 - adds r0, r1 - bl sub_80D2EF8 -_0819214E: - adds r6, 0x1 - cmp r6, 0x7 - ble _08192116 - movs r6, 0x8 - ldr r4, =0x0203cd78 -_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, =0x02020630 - adds r0, r1 - bl sub_80D2EF8 -_0819218E: - adds r6, 0x1 - cmp r6, 0xF - ble _08192158 - bl sub_80D2F9C - ldr r4, =0x0203cd78 - 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, =0x03005e00 - 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, =0x03005e00 - 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, =0x03005d90 - ldr r0, [r3] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - mov r8, r0 - ldr r1, =0x030022c0 - 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, =0x0203cd78 - 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, =0x0203cd78 - 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, =0x0203cd78 - 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, =0x03005d90 - 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, =0x0203cd78 - 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, =0x03005d90 - 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, =0x0203cd78 - 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, =0x0203cd78 - ldr r3, [r0] - ldrb r0, [r3, 0x10] - cmp r0, 0 - beq _081923A0 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - ldr r2, =0x03005e00 - 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, =0x03005e00 - adds r0, r3 - b _0819249E - .pool -_081923B0: - movs r0, 0x40 - ands r0, r4 - cmp r0, 0 - beq _081923DE - ldr r0, =0x0203cd78 - 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, =0x0203cd78 - 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, =0x0203cd78 - 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, =0x0203cd78 - 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, =0x0203cd78 - ldr r0, [r0] - ldrb r1, [r0, 0x10] - cmp r1, 0 - bne _08192470 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - ldr r2, =0x03005e00 - 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, =0x03005e00 - 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, =0x03005e00 - adds r0, r1 -_0819249E: - strh r5, [r0, 0xA] -_081924A0: - cmp r7, 0 - beq _081924CC - cmp r7, 0x9 - beq _081924CC - movs r0, 0x5 - bl audio_play - ldr r1, =0x03005e00 - 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, =0x03005d90 - 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, =0x0203cd78 - 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, =0x02020630 - ldr r0, =0x0203cd78 - 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, =0x0203cd78 - ldr r2, =0x02020630 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - ldr r0, [r0] - ldr r3, =0x00000d64 - adds r0, r3 - adds r0, r5 - ldrh r1, [r0] - ldr r0, =0x0203bc8c - 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, =0x02021cc4 - 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, =0x02021cc4 - 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, =0x03005d90 - ldr r1, [r0] - adds r0, r5, 0 - bl AppendString - b _08192836 - .pool -_08192800: - ldr r0, =0x000003fe - ldr r3, [sp, 0x24] - cmp r3, r0 - bne _08192824 - ldr r4, =0x02021dc4 - adds r0, r4, 0 - bl sub_8195938 - adds r0, r5, 0 - adds r1, r4, 0 - bl AppendString - b _08192836 - .pool -_08192824: - ldr r4, =0x02021dc4 - ldr r1, [sp, 0x24] - adds r0, r4, 0 - bl sub_8195898 - adds r0, r5, 0 - adds r1, r4, 0 - bl AppendString -_08192836: - add r0, sp, 0xC - ldrb r0, [r0, 0x5] - ldr r4, =0x02021cc4 - 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, =0x03005d90 - 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, =0x03005d90 - ldr r1, [r0] - lsls r0, r7, 1 - add r0, r9 - ldr r2, =0x00000d64 - adds r1, r2 - b _081928FA - .pool -_081928E4: - ldr r4, =0x03005d90 - ldr r1, [r4] - lsls r0, r7, 1 - add r0, r9 - ldr r2, =0x00000d64 - adds r1, r2 - adds r1, r0 - ldrh r1, [r1] - ldr r0, =0x0203bc8c - 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, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000efc - adds r0, r1 - add r0, r9 - b _08192A48 - .pool -_08192A20: - ldr r0, =0x03005d90 - 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, =0x0203bc8c - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x0203bc8c - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x02021cc4 - adds r1, r2, 0 - bl CopyString - b _08192FB8 - .pool -_08192F9C: - lsrs r0, r1, 22 - cmp r0, r9 - bne _08192FB0 - ldr r0, =0x02021cc4 - bl sub_8195938 - b _08192FB8 - .pool -_08192FB0: - lsrs r1, 22 - ldr r0, =0x02021cc4 - 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, =0x03005d90 - 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, =0x02021dc4 - bl CopyString - 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, =0x02021cc4 - adds r1, r3, 0 - bl CopyString - b _08193100 - .pool -_081930E0: - ldr r0, =0xff800000 - cmp r1, r0 - bne _081930F8 - ldr r0, =0x02021cc4 - bl sub_8195938 - b _08193100 - .pool -_081930F8: - lsrs r1, 22 - ldr r0, =0x02021cc4 - 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, =0x0203cd78 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x0203cd78 - 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, =0x02020630 - ldr r0, =0x0203cd78 - 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, =0x02020630 - ldr r0, =0x0203cd78 - 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, =0x03005d90 - 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, =0x0203cd78 - 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, =0x02020630 - ldr r0, =0x0203cd78 - 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, =0x02020630 - ldr r0, =0x0203cd78 - 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, =0x0203cd78 - ldr r7, =0x02020630 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x0203bc8c - 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, =0x0203cd78 - ldr r7, =0x02020630 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x0203bc8c - 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, =0x02021fc4 - ldr r0, =gUnknown_0860D38C - ldr r7, [sp, 0x70] - adds r0, r7, r0 - ldr r1, [r0] - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x02021cc4 - ldr r1, =0x03005d90 - ldr r1, [r1] - bl CopyString - b _0819377E - .pool -_0819375C: - ldr r0, =0x000003fe - cmp r1, r0 - bne _08193774 - ldr r0, =0x02021cc4 - bl sub_8195938 - b _0819377E - .pool -_08193774: - ldr r0, =0x02021cc4 - 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, =0x02021cc4 - 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, =0x03005d90 - ldr r1, [r0] - adds r0, r5, 0 - bl CopyString - 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, =0x02021cc4 - 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, =0x03005e00 - 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, =0x03005d90 - 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, =0x03005e00 - 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, =0x03005e00 - 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, =0x02037fd4 - 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 pal_fade_maybe - ldr r1, =0x03005e00 - 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, =0x02020630 - adds r0, r1 - movs r1, 0x1 - bl StartObjectImageAnim - b _08193BC2 - .pool -_08193A00: - ldr r0, =0x02037fd4 - 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 pal_fade_maybe - ldr r1, =0x03005e00 - 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 pal_fade_maybe - ldr r1, =0x03005e00 - 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 pal_fade_maybe - ldr r1, =0x03005e00 - 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, =0x02037fd4 - 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, =0x0203cd7c - 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, =0x03005e00 - 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, =0x0203cd78 - ldr r0, [r0] - strb r3, [r0, 0x10] - b _08193BC2 - .pool -_08193B20: - ldr r0, =0x02037fd4 - 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, =0x0203cd7c - 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, =0x03005e00 - 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, =0x02037fd4 - 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, =0x0203cd7c - ldr r0, [r4] - bl Free - str r6, [r4] - ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music - bl SetMainCallback2 - ldr r1, =0x03005e00 - 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, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - movs r1, 0xA - ldrsh r5, [r0, r1] - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r6, [r0] - ldr r0, =0x030022c0 - 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 audio_play - movs r0, 0 - mov r9, r0 - b _08193CDE - .pool -_08193C3C: - cmp r5, 0xF - bgt _08193C4C - movs r0, 0x5 - bl audio_play - movs r1, 0x2 - mov r9, r1 - b _08193CDE -_08193C4C: - movs r0, 0x5 - bl audio_play - 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 audio_play - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - movs r1, 0 - bl StartObjectImageAnim - 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 StartObjectImageAnim - ldr r1, =0x03005e00 - 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, =0x03005e00 - 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, =0x020375e2 - ldrh r0, [r7] - cmp r0, 0x1 - bne _08193E10 - ldr r5, =0x02038bca - ldrh r0, [r5] - bl sub_8195358 - ldr r4, =0x03005d90 - 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, =0x03005d10 - 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, =0x03005d90 - 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, =0x03005d10 - ldrh r0, [r0, 0x24] - strh r0, [r1] - ldr r0, =0x0202433a - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x0203bc8c - 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 GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - lsls r4, 16 - lsrs r5, r4, 16 - lsls r0, 16 - orrs r5, r0 - ldr r2, =0x03005d90 - ldr r0, [r2] - ldr r4, =0x00000d64 - adds r0, r4 - add r0, r8 - ldrh r4, [r0] - ldr r3, =0x0203bc8c - 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, =0x03005d90 - 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, =0x03005e00 - 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, =0x02022e14 - strh r4, [r0] - ldr r0, =0x02022e16 - strh r4, [r0] - ldr r0, =0x02022e18 - strh r4, [r0] - ldr r0, =0x02022e1a - 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, =0x03005e00 - 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 sub_80A1A74 - bl ResetAllObjectData - bl ResetObjectPaletteAllocator - ldr r1, =0x03005e00 - mov r3, r8 - lsls r0, r3, 2 - b _0819443C - .pool -_0819438C: - ldr r4, =0x0203cd7c - 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 decompress_palette - ldr r0, =gUnknown_08D85444 - movs r1, 0x80 - lsls r1, 1 - adds r2, r4, 0 - bl decompress_palette - ldr r0, =gUnknown_08D85600 - movs r1, 0xF0 - movs r2, 0x20 - bl decompress_palette - str r6, [sp, 0x18] - add r0, sp, 0x18 - ldr r1, =0x02037b14 - 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, =0x03005e00 - 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 AddObjectToFront - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x1E - bls _08194492 - ldr r0, =0x03005e00 - 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 AddObjectToFront - b _081944E8 - .pool -_081944DC: - ldr r0, =gUnknown_0860CFD8 - movs r1, 0xDA - movs r2, 0xC - movs r3, 0 - bl AddObjectToFront -_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, =0x03005d90 - ldr r0, [r3] - adds r0, r7 - ldr r1, =0x00000d24 - adds r0, r1 - ldrh r1, [r0] - lsls r1, 22 - lsrs r1, 22 - ldr r0, =0x02022e2c - bl sub_8195898 - mov r2, r10 - cmp r2, 0x1 - bne _081945C4 - ldr r3, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005e00 - 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, =0x03005e00 - adds r0, r3 - movs r1, 0x10 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08194660 - ldr r2, =0x03005d90 - ldr r0, [r2] - ldr r3, =0x00000cb2 - adds r0, r3 - ldrh r3, [r0] - adds r6, r2, 0 - b _0819466E - .pool -_08194660: - ldr r1, =0x03005d90 - 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, =0x02022e2c - movs r2, 0x3D - bl GetStringWidthDifference - b _0819476A - .pool -_08194768: - movs r0, 0x3 -_0819476A: - strb r0, [r4, 0x8] - ldr r0, =0x02022e2c - 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, =0x03005e00 - 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, =0x03005e00 - 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, =0x03005e00 - b _0819486C - .pool -_0819485C: - ldr r1, =0x03005e00 - 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, =0x02038c28 - 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, =0x02038c28 - 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, =0x03005e00 - 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 pal_fade_maybe - ldr r1, =0x03005e00 - 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, =0x02037fd4 - 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, =0x02022e2c - mov r9, r0 - ldr r1, =0x03005d90 - 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, =0x030022c0 - 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 pal_fade_maybe - ldr r1, =0x03005e00 - 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, =0x02037fd4 - 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 CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - 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, =0x02022e14 - ldrh r1, [r0] - movs r0, 0x10 - bl SetGpuReg - ldr r0, =0x02022e16 - ldrh r1, [r0] - movs r0, 0x12 - bl SetGpuReg - ldr r0, =0x02022e18 - ldrh r1, [r0] - movs r0, 0x14 - bl SetGpuReg - ldr r0, =0x02022e1a - ldrh r1, [r0] - movs r0, 0x16 - bl SetGpuReg - ldr r0, =0x02022e1c - ldrh r1, [r0] - movs r0, 0x18 - bl SetGpuReg - ldr r0, =0x02022e1e - ldrh r1, [r0] - movs r0, 0x1A - bl SetGpuReg - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - 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, =0x02022e14 - ldrh r1, [r0] - movs r0, 0x10 - bl SetGpuReg - ldr r0, =0x02022e16 - ldrh r1, [r0] - movs r0, 0x12 - bl SetGpuReg - ldr r0, =0x02022e18 - ldrh r1, [r0] - movs r0, 0x14 - bl SetGpuReg - ldr r0, =0x02022e1a - 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 LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - bl sub_80BA0A8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8194CE4 - - thumb_func_start sub_8194D48 -sub_8194D48: @ 8194D48 - ldr r1, =0x0203bc8c - ldr r0, =gBattleFrontierMons - str r0, [r1] - ldr r1, =0x0203bc88 - 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, =0x03005d90 - ldr r1, [r0] - ldr r0, =0x0203cef8 - 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, =0x03005d8c - ldr r0, [r1] - add r0, r9 - adds r1, r5, 0 - adds r1, 0xD - movs r2, 0 - str r3, [sp, 0x4] - bl pokemon_getattr - adds r4, r0, 0 - adds r1, r6, 0 - adds r1, 0xD - ldr r2, =0x020244ec - adds r0, r7, r2 - movs r2, 0 - bl pokemon_getattr - ldr r3, [sp, 0x4] - cmp r4, r0 - bne _08194DBC -_08194DEA: - cmp r5, 0x4 - bne _08194E00 - lsls r2, r6, 24 - lsrs r2, 24 - ldr r1, =0x020244ec - 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, =0x03005d8c - 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, =0x020244ec - 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, =0x03005d8c - movs r6, 0x64 - movs r5, 0 -_08194E50: - ldr r0, =0x03005d90 - ldr r1, [r0] - ldr r0, =0x0203cef8 - 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 pokemon_getattr - mov r1, sp - strh r0, [r1] - ldr r0, =0x020244ec - adds r0, r5, r0 - movs r1, 0xC - mov r2, sp - bl pokemon_setattr - 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, =0x02038bca - ldrh r0, [r0] - bl sub_8195358 - adds r4, r0, 0 - ldr r0, =0x000003ff - bl sub_8195358 - cmp r4, r0 - ble _08194EE8 - ldr r1, =0x020375f0 - movs r0, 0x1 - b _08194EEC - .pool -_08194EE8: - ldr r1, =0x020375f0 - 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, =0x03005d90 - 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, =0x02021cc4 - ldr r1, =0x03005d90 - 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, =0x03005d90 - 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 GenerateRandomNumber - 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 GenerateRandomNumber - 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 GenerateRandomNumber - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x0203bc8c - 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, =0x03005d90 - 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, =0x0203bc8c - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x0203bc8c - 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, =0x03005d90 - ldr r0, [r3] - ldr r1, =0x00000d64 - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - ldr r2, =0x0203bc8c - 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, =gUnknown_0832A328 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - ldr r1, [r2] - ldr r3, =0x00000d64 - adds r1, r3 - ldr r2, [sp, 0x38] - adds r0, r1, r2 - ldrh r0, [r0] - ldr r3, =0x0203bc8c - 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, =0x03005d90 - 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 GenerateRandomNumber - 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, =0x03005d90 - ldr r1, [r5] - ldr r0, =0x00000d64 - adds r1, r0 - mov r2, r8 - adds r0, r1, r2 - ldrh r0, [r0] - ldr r5, =0x0203bc8c - 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, =0x03005d90 - 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 GenerateRandomNumber - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - ldr r1, [r5] - movs r2, 0xEC - lsls r2, 4 - adds r1, r2 - ldr r3, [sp, 0x2C] - b _08195872 - .pool -_08195830: - ldr r5, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x0203bc88 - 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, =0x020375e0 - 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, =0x03005d90 - 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, =0x03005d8c - 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, =0x02038bca - 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, =0x03005d90 - 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, =0x020375e2 - 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, =0x020375f0 - ldr r1, [r5] - ldr r2, =0x00000dc6 - adds r1, r2 - ldrh r1, [r1] - strh r1, [r0] - b _08195AD0 - .pool -_08195A90: - ldr r3, =0x020375f0 - 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, =0x020375f0 - 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, =0x03005d90 - 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, =0x020375e2 - 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, =0x020375e4 - 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, =0x020375e4 - ldrh r0, [r0] - strh r0, [r2] - b _08195BA0 - .pool -_08195B5C: - ldr r0, =0x020375e4 - 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, =0x03005d90 - 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, =0x020375f0 - bl GenerateRandomNumber - 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, =0x020375f0 - movs r0, 0x3 - b _08195C14 - .pool -_08195C10: - ldr r1, =0x020375f0 - 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, =0x02038bca - bl GenerateRandomNumber - 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, =0x02038bca - ldrh r1, [r3] - ldr r0, =0x0000012b - cmp r1, r0 - bhi _08195C6C - ldr r2, =0x0203bc88 - 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, =0x03005d90 - 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, =0x03005d90 - ldr r0, [r4] - ldr r1, =0x020375e2 - 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, =0x03005d90 - 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 GenerateRandomNumber - 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 GenerateRandomNumber - 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, =0x03005d90 - ldr r0, [r4] - ldr r1, =0x00000dc6 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl bag_add_item - 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, =0x02021cc4 - bl itemid_get_name - ldr r0, [r4] - ldr r1, =0x00000dc6 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x020375f0 - strh r5, [r0] - b _08195E06 - .pool -_08195E00: - ldr r1, =0x020375f0 - 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 GameFreakRTC_CalcLocalDateTime - ldr r0, =0x03005cf8 - bl sub_8195E34 - ldr r1, =0x0203cd80 - 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 GameFreakRTC_CalcLocalDateTime - ldr r0, =0x03005cf8 - bl sub_8195E34 - adds r1, r0, 0 - ldr r2, =0x0203cd80 - 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, =0x020244ec - adds r0, r4, 0 - movs r1, 0x6 - bl pokemon_getattr - 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 GenerateRandomNumber - 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, =0x02037318 - 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, =0x02037318 - 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, =0x0203cd80 - 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 GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __umodsi3 - bl sub_8195FF8 - ldr r2, =0x0203cd80 - 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, =0x02037318 - 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, =0x0203cd80 - 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, =0x0203cd80 - 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 audio_play - 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, =0x03005e08 - 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, =0x03005e08 - 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 gpu_pal_apply - ldr r0, =gUnknown_0860EB6C - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - 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, =0x03005e08 - 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, =0x03005e08 - 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, =0x03005e08 - 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, =0x0203cd80 - ldrb r0, [r1, 0x7] - cmp r0, 0 - bne _0819630C - ldrh r0, [r1, 0x4] - ldr r1, =0x02021fc4 - bl sub_81967AC -_0819630C: - movs r1, 0x4 - ldrsh r0, [r4, r1] - ldr r1, =0x02021fc4 - 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, =0x03005e08 - adds r4, r1, r0 - movs r1, 0x4 - ldrsh r0, [r4, r1] - bl sub_8196648 - cmp r0, 0 - bne _08196388 - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - bne _08196388 - ldr r0, =0x030022c0 - 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 audio_play - 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, =0x03005e08 - 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 mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - bne _08196454 - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - ldr r0, =0x0203cd80 - 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, =0x02037350 - 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, =0x03003014 - 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, =0x030022c0 - ldrh r1, [r0, 0x2C] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0819666C - ldr r0, =0x03003014 - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - b _08196678 - .pool -_0819666C: - ldr r2, =0x03003014 - 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, =0x03005e08 - 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, =0x03005d8c - 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, =0x0203cd88 - strh r7, [r0] - adds r0, r5, 0 - bl sub_8196710 - cmp r0, 0 - beq _081967EC - adds r0, r5, 0 - bl sub_819672C - ldr r1, =0x02037318 - 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 GenerateRandomNumber - 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 GenerateRandomNumber - 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 DummyObjectCallback -_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 GenerateRandomNumber - 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 GenerateRandomNumber - 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, =0x0203cd88 - strh r0, [r1, 0x2] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bls _08196960 - cmp r5, 0 - bne _0819695E -_08196980: - ldr r0, =0x0203cd88 - 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 ExpandStringRefs - 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 CopyString - 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 CopyString -_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 GenerateRandomNumber - 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 GenerateRandomNumber - 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 GenerateRandomNumber - 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 CopyString - 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 GenerateRandomNumber - 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 CopyString - 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, =0x0203cd88 - ldrh r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl CopyString - 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, =0x0203cd88 - 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 ConvertIntToDecimalString - 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 GameFreakRTC_GetNumDays - adds r4, r0, 0 - ldr r0, =0x03005d90 - ldr r0, [r0] - adds r0, 0xA - bl sub_80842DC - adds r6, r0, 0 - ldr r0, =0x0000ffff - ands r6, r0 - ldr r0, =0x03005d8c - 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 sub_80847F8 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x02021cc4 - mov r10, r0 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r1, =0x02021dc4 - mov r9, r1 - mov r0, r9 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - 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 CopyString - adds r5, r0, 0 - movs r6, 0xFB - strb r6, [r5] - adds r5, 0x1 - ldr r1, =gUnknown_082A5D2C - adds r0, r5, 0 - bl CopyString - 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 CopyString - mov r0, r8 - adds r1, r7, 0 - bl ExpandStringRefs - adds r5, r0, 0 - bl sub_809D42C - 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 ConvertIntToDecimalString - mov r0, r9 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r1, =gUnknown_082A633D - adds r0, r5, 0 - bl ExpandStringRefs -_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 gpu_pal_apply - 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, =0x0203cd8c - movs r1, 0xFF - strb r1, [r0] - ldr r0, =0x0203cd8d - 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, =0x03003014 - 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, =0x03003014 - 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, =0x02021fc4 - 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, =0x03003014 - 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, =0x02021fc4 - 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, =0x03003014 - 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, =0x02021fc4 - 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 gpu_pal_apply - 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 gpu_pal_apply - 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, =0x03003014 - ldrb r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - bne _08197988 - ldr r0, =0x03005d90 - 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, =0x03005d90 - 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, =0x0203cd8c - 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, =0x0203cd8c - 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, =0x0203cd8c - 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, =0x0203cd8d - 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, =0x0203cd8d - ldrb r0, [r0] - bx lr - .pool - thumb_func_end GetMapNamePopUpWindowId - - thumb_func_start RemoveMapNamePopUpWindow -RemoveMapNamePopUpWindow: @ 8197A80 - push {r4,lr} - ldr r4, =0x0203cd8d - 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, =0x03003014 - 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, =0x02021fc4 - 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, =0x0203cd9c - strh r2, [r0] - ldr r0, =0x0203cd9e - 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, =0x0203cd9c - strh r2, [r0] - ldr r5, =0x0203cd9e - 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, =0x0203cd9c - 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, =0x0203cd9e - 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, =0x0203cd9c - 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, =0x0203cd9c - 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, =0x0203cd9c - 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, =0x0203cd9c - 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, =0x0203cd9c - 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, =0x0203cd9c - 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, =0x0203cd9c - 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, =0x0203cd9c - 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, =0x0203cd9c - 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, =0x0203cd9c - 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, =0x0203cd9c - 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, =0x0203cd9c - 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, =0x0203cd9c - strh r2, [r0] - ldr r0, =0x0203cd9e - 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, =0x0203cd9c - strh r2, [r0] - ldr r5, =0x0203cd9e - 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, =0x0203cd9c - 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, =0x0203cd9e - ldrb r0, [r7] - str r0, [sp, 0x8] - mov r0, r9 - adds r2, r6, 0 - adds r3, r4, 0 - bl FillBgTilemapBufferRect - ldr r2, =0x0203cd9c - 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, =0x0203cd9c - 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, =0x0203cd9c - 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, =0x0203cd9c - 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, =0x0203cd9c - 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, =0x0203cd9c - 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, =0x0203cd9c - 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, =0x0203cda0 - 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 gpu_pal_apply - ldr r0, =0x0203cda0 - 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, =0x0203cda0 - 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, =0x0203cda0 - 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, =0x0203cda0 - 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, =0x0203cda0 - 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, =0x0203cda0 - 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, =0x0203cd90 - 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, =0x0203cd90 - 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, =0x0203cd90 - 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, =0x0203cd90 - 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, =0x0203cd90 - 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, =0x0203cd90 - ldrb r0, [r0, 0x2] - bx lr - .pool - thumb_func_end GetMenuCursorPos - - thumb_func_start ProcessMenuInput -ProcessMenuInput: @ 819856C - push {r4,lr} - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08198598 - ldr r4, =0x0203cd90 - ldrb r0, [r4, 0xB] - cmp r0, 0 - bne _08198588 - movs r0, 0x5 - bl audio_play -_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 audio_play - movs r0, 0x1 - negs r0, r0 - b _081985CA -_081985BA: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081985CE - movs r0, 0x5 - bl audio_play - 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, =0x0203cd90 - ldrb r5, [r4, 0x2] - adds r6, r5, 0 - ldr r0, =0x030022c0 - 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 audio_play -_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 audio_play -_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, =0x030022c0 - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08198684 - ldr r4, =0x0203cd90 - ldrb r0, [r4, 0xB] - cmp r0, 0 - bne _08198674 - movs r0, 0x5 - bl audio_play -_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 audio_play - movs r0, 0x1 - negs r0, r0 - b _081986B4 -_081986A8: - cmp r1, 0x80 - bne _081986B8 - movs r0, 0x5 - bl audio_play - 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, =0x0203cd90 - ldrb r5, [r4, 0x2] - adds r6, r5, 0 - ldr r2, =0x030022c0 - 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 audio_play -_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 audio_play -_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, =0x0203cd9f - 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, =0x0203cd9f - 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, =0x0203cd90 - 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, =0x0203cd90 - 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, =0x0203cd90 - 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, =0x0203cd90 - 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, =0x0203cd90 - 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, =0x030022c0 - ldrh r1, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081992AC - movs r0, 0x5 - bl audio_play - ldr r0, =0x0203cd90 - 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 audio_play - 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 audio_play - 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 audio_play - 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 audio_play - 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, =0x0203cd90 - ldrb r4, [r5, 0x2] - ldr r6, =0x030022c0 - ldrh r1, [r6, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0819935C - movs r0, 0x5 - bl audio_play - 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 audio_play -_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, =0x030022c0 - ldrh r1, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08199400 - movs r0, 0x5 - bl audio_play - ldr r0, =0x0203cd90 - 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 audio_play - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - b _08199474 -_08199428: - cmp r1, 0x80 - bne _08199438 - movs r0, 0x5 - bl audio_play - 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 audio_play - 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 audio_play - 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, =0x0203cd90 - ldrb r4, [r6, 0x2] - ldr r5, =0x030022c0 - ldrh r1, [r5, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081994AC - movs r0, 0x5 - bl audio_play - 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 audio_play -_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, =0x0203cd90 - 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, =0x0203cd9f - 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, =0x0203cd90 - 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, =0x0203cd90 - 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, =0x0203cda4 - 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, =0x0203cda4 - 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, =0x0203cda4 - 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, =0x0203cda8 - ldr r1, =0x0203cdac - 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, =0x0203cda8 - ldrh r0, [r1] - cmp r0, 0 - beq _08199A7C - movs r4, 0 - ldrh r1, [r1] - cmp r4, r1 - bge _08199A76 - ldr r5, =0x0203cdac - movs r6, 0 -_08199A64: - ldr r0, [r5] - bl Free - stm r5!, {r6} - adds r4, 0x1 - ldr r0, =0x0203cda8 - ldrh r0, [r0] - cmp r4, r0 - blt _08199A64 -_08199A76: - ldr r1, =0x0203cda8 - 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, =0x0203cda8 - 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, =0x0203cdac - 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, =0x03005e00 - 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, =0x03005e00 - 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, =0x03005d90 - ldr r3, [r0] - ldrb r0, [r3] - ldr r6, =0x02021fc4 - 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 ExpandStringRefs - 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 gpu_pal_apply - 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 gpu_pal_apply - 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, =0x03005d90 - ldr r1, [r0] - adds r0, r5, 0 - bl CopyString - b _0819A43C - .pool -_0819A3A8: - bl sub_809D42C - 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 ConvertIntToDecimalString - adds r5, r0, 0 - movs r0, 0xFF - strb r0, [r5] - b _0819A43C -_0819A3D6: - ldr r4, =0x03005d90 - ldr r0, [r4] - ldrh r1, [r0, 0xE] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - 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 ConvertIntToDecimalString - b _0819A43C - .pool -_0819A404: - ldr r0, =0x02037318 - 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 IndexOfObjectPaletteTag - 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 GenerateRandomNumber - 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 StartObjectImageAnim - movs r0, 0x20 - strh r0, [r5, 0x2E] - b _0819A4C2 -_0819A4A6: - adds r0, r5, 0 - movs r1, 0x1 - bl StartObjectImageAnim - b _0819A4C2 -_0819A4B0: - adds r0, r5, 0 - movs r1, 0x1 - bl StartObjectImageAnimIfDifferent - b _0819A4C2 -_0819A4BA: - adds r0, r5, 0 - movs r1, 0 - bl StartObjectImageAnimIfDifferent -_0819A4C2: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_819A44C - - thumb_func_start sub_819A4C8 -sub_819A4C8: @ 819A4C8 - push {lr} - bl CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - bl RunTasks - pop {r0} - bx r0 - thumb_func_end sub_819A4C8 - - thumb_func_start sub_819A4E4 -sub_819A4E4: @ 819A4E4 - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - pop {r0} - bx r0 - thumb_func_end sub_819A4E4 - - thumb_func_start sub_819A4F8 -sub_819A4F8: @ 819A4F8 - push {lr} - ldr r0, =0x0300127c - 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, =0x030022c0 - 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, =0x0203ce3c - 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, =0x0203ce2c - movs r4, 0x88 - lsls r4, 3 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - ldr r5, =0x0203ce30 - adds r0, r4, 0 - bl AllocZeroed - str r0, [r5] - ldr r5, =0x0203ce34 - movs r4, 0x80 - lsls r4, 4 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - ldr r5, =0x0203ce38 - 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, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _0819A8EE - .pool -_0819A69C: - bl sub_80A1A74 - bl ResetAllObjectData - bl ResetTasks - bl ResetObjectPaletteAllocator - ldr r0, =gUnknown_08DC0754 - ldr r5, =0x0203ce2c - ldr r1, [r5] - movs r2, 0x88 - lsls r2, 2 - bl CpuSet - ldr r0, =gUnknown_0861033C - ldr r4, =0x0203ce30 - 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, =0x0203ce34 - 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 gpu_pal_apply - ldr r4, =gUnknown_0861046C - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0x8 - bl gpu_pal_apply - adds r0, r4, 0 - movs r1, 0xE0 - movs r2, 0xA - bl gpu_pal_apply - ldr r0, =0x0300127c - ldr r1, [r0] - ldrb r0, [r1, 0x6] - cmp r0, 0x1 - bne _0819A738 - ldr r0, =0x02037714 - 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 gpu_pal_apply - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819A8EE - .pool -_0819A77C: - ldr r0, =0x0203ce38 - 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 LoadTaggedObjectPalettes - ldr r0, =gUnknown_086103BC - bl LoadObjectPics - 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 pal_fade_maybe - movs r1, 0x9A - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r0, =0x0300127c - 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, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _0819A8EE - .pool -_0819A868: - ldr r4, =0x0300127c - ldr r1, [r4] - ldrb r0, [r1, 0x6] - cmp r0, 0x1 - bne _0819A878 - ldr r0, =0x0203cf20 - 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, =0x030022c0 - 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, =0x030022c0 - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _0819A8EE - .pool -_0819A8C4: - bl sub_819B9E8 - movs r0, 0x1 - bl PutWindowTilemap - ldr r1, =0x030022c0 - 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, =0x030022c0 - 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, =0x0300127c - 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, =0x03005e00 - 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, =0x03005e00 - 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, =0x0300127c - 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, =0x03005d90 - 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, =0x02020630 -_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 AddObjectToFront - ldr r6, =0x0300127c - 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, =0x02020630 - 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 AddObjectToFront - ldr r1, [r6] - movs r5, 0 - strb r0, [r1, 0x4] - ldr r0, =gUnknown_08610608 - movs r1, 0xB0 - movs r2, 0x70 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r6] - strb r0, [r1, 0x1] - ldr r0, =gUnknown_08610620 - movs r1, 0xB0 - movs r2, 0x90 - movs r3, 0 - bl AddObjectToFront - 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, =0x0300127c - 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, =0x02020630 - adds r0, r5 - bl RemoveObjectAndFreeTiles - 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 RemoveObjectAndFreeTiles - ldr r0, [r6] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - ldr r0, [r6] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - 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, =0x0300127c - 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, =0x0300127c - 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, =0x02020630 - 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, =0x0300127c - 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, =0x0300127c - 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, =0x02020630 - 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, =0x0300127c - 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, =0x0300127c - 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, =0x02020630 - 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, =0x0300127c - 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 IndexOfObjectPaletteTag - 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, =0x0300127c - ldr r1, [r0] - movs r0, 0x6C - muls r0, r2 - adds r1, r0 - movs r0, 0x1 - strb r0, [r1, 0x10] -_0819AD44: - ldr r2, =0x0300127c - 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 IndexOfObjectPaletteTag - 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, =0x02020630 - ldr r0, =0x0300127c - 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, =0x0300127c - 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 IndexOfObjectPaletteTag - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =0x02020630 - ldr r0, =0x0300127c - 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, =0x03005e00 - 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, =0x02037714 - ldr r0, =0x02037b14 - 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 pal_fade_maybe - movs r0, 0x7 - strh r0, [r6, 0x8] - b _0819AF50 - .pool -_0819AE64: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0819AF50 - ldr r4, =0x0300127c - 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, =0x0203ce2c - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ce30 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ce34 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ce38 - ldr r0, [r4] - bl Free - str r5, [r4] - bl FreeAllWindowBuffers - movs r0, 0x8 - strh r0, [r6, 0x8] - b _0819AF50 - .pool -_0819AEE8: - ldr r4, =0x0300127c - ldr r1, [r4] - ldr r0, =0x02037714 - 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, =0x0203ce3c - movs r0, 0x96 - lsls r0, 2 - bl AllocZeroed - str r0, [r4] - movs r4, 0 -_0819AF1A: - ldr r5, =0x0203ce3c - ldr r1, [r5] - movs r0, 0x64 - muls r0, r4 - adds r0, r1 - ldr r1, =0x0300127c - 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, =0x0300127c - ldr r0, [r7] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819B00E - ldr r1, =0x03005e00 - 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 pal_fade_maybe - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0819B00E -_0819AFB8: - bl fade_and_return_progress_probably - 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, =0x0203ce2c - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ce34 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ce38 - 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, =0x0300127c - ldr r0, [r7] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819B11A - ldr r1, =0x03005e00 - 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, =0x030022c0 - 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 audio_play - 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 audio_play -_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 audio_play - 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 audio_play - 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, =0x03005e00 - 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, =0x0300127c - 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, =0x03005e00 - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r0, 0x9 - b _0819B36C - .pool -_0819B1BC: - ldr r4, =0x0300127c - 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, =0x03005e00 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - b _0819B344 - .pool -_0819B1EC: - ldr r2, =0x030022c0 - 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 audio_play - bl sub_819BC04 - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x1 - bne _0819B228 - ldr r0, =0x0300127c - ldr r0, [r0] - ldr r2, =0x000002a2 - adds r0, r2 - b _0819B2AC - .pool -_0819B228: - cmp r0, 0x2 - bne _0819B248 - ldr r1, =0x03005e00 - 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, =0x03005e00 - 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, =0x03005e00 - 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 audio_play - ldr r4, =0x0300127c - 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, =0x03005e00 - 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 audio_play - 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 audio_play - movs r0, 0x1 - bl sub_819AC10 - b _0819B36E -_0819B300: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - bne _0819B36E - ldr r4, =0x0300127c - ldr r2, [r4] - ldrb r0, [r2, 0x6] - cmp r0, 0x1 - bne _0819B338 - ldr r1, =0x02037b14 - 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, =0x02037714 - 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, =0x03005e00 - 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, =0x0300127c - ldr r3, [r5] - movs r7, 0xA8 - lsls r7, 2 - adds r0, r3, r7 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819B476 - ldr r1, =0x03005e00 - 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, =0x02037fd4 - 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, =0x030022c0 - ldrh r0, [r2, 0x2E] - ands r1, r0 - cmp r1, 0 - beq _0819B40C - movs r0, 0x5 - bl audio_play - 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 audio_play - movs r0, 0x1 - negs r0, r0 - b _0819B432 -_0819B422: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0819B476 - movs r0, 0x5 - bl audio_play - movs r0, 0x1 -_0819B432: - bl sub_819ABA8 - bl sub_819BCF8 - bl sub_819B9E8 - b _0819B476 -_0819B440: - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r6, 0x1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _0819B476 - movs r0, 0x5 - bl audio_play - 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, =0x03005d90 - 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, =0x0203bc8c - 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, =0x03005d90 - 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, =0x0300127c - 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, =0x0300127c - ldr r0, [r2] - adds r0, r4 - adds r0, 0x8 - ldr r1, =0x0203bc8c - 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, =0x0300127c -_0819B5B8: - ldr r0, [r3] - adds r0, r4 - adds r0, 0x8 - ldr r5, =0x0203bc8c - 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, =0x0300127c - ldr r0, [r1] - adds r0, r4 - adds r0, 0x8 - movs r1, 0x20 - add r2, sp, 0xC - bl pokemon_setattr - ldr r2, =0x0300127c - 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 pokemon_setattr - 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, =0x0203bc8c - ldr r0, =gSlateportBattleTentMons - str r0, [r2] - ldr r0, =0x03005d90 - 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, =0x03005d90 - 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, =0x0300127c - 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, =0x0203bc8c - 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, =0x0300127c - ldr r0, [r1] - adds r0, r4 - adds r0, 0x8 - ldr r3, =0x0203bc8c - 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, =0x0300127c - ldr r0, [r1] - adds r0, r4 - adds r0, 0x8 - movs r1, 0x20 - add r2, sp, 0xC - bl pokemon_setattr - ldr r2, =0x0300127c - ldr r0, [r2] - adds r0, r4 - adds r0, 0x8 - ldr r3, =0x0203bc8c - ldr r1, [r3] - adds r1, r5, r1 - ldrb r2, [r1, 0xA] - lsls r2, 1 - ldr r1, =gBattleFrontierHeldItems - adds r2, r1 - movs r1, 0xC - bl pokemon_setattr - 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, =0x0300127c - mov r10, r0 - ldr r1, =0x03005d90 - 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, =0x020244ec - 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 pokemon_getattr - 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, =0x0300127c - ldr r1, [r5] - ldrb r0, [r1, 0x6] - cmp r0, 0 - bne _0819B852 - strb r0, [r1] -_0819B852: - ldr r4, =0x02020630 - 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, =0x0300127c - ldr r1, [r5] - movs r0, 0 - strb r0, [r1, 0x7] - ldr r4, =0x02020630 - 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, =0x02020630 - ldr r3, =0x0300127c - 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, =0x0300127c - 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 pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - ldr r4, =0x02021fc4 - movs r1, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r4, 0 - bl CopyString - 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, =0x0300127c - 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, =0x0300127c - 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, =0x030062e8 - ldr r1, =gUnknown_0861041C - ldr r0, =0x0300127c - 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, =0x0300127c - 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, =0x0300127c - 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, =0x0300127c - 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, =0x0300127c - 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, =0x0300127c - 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 pokemon_getattr - 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, =0x0300127c - 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 pokemon_getattr - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - mov r8, r0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl pokemon_getattr - 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, =0x02020630 - 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, =0x0300127c - 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 AddObjectToFront - ldr r6, =0x0300127c - 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, =0x02020630 - mov r8, r1 - add r0, r8 - movs r1, 0x2 - bl StartObjectRotScalAnim - 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 pokemon_getattr - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - mov r9, r0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl pokemon_getattr - 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, =0x0300127c - 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 pokemon_getattr - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - adds r6, r0, 0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl pokemon_getattr - 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, =0x02020630 - 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, =0x02020630 - 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, =0x0300127c - 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, =0x02020630 - ldr r6, =0x0300127c - 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, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r1, [r1] - bl _call_via_r1 - ldr r0, =DummyObjectCallback - 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, =0x02020630 - ldr r4, =0x0300127c - 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 rotscale_free_entry - 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 rotscale_free_entry - 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 rotscale_free_entry - 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 RemoveObjectAndFreeTiles - 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 RemoveObjectAndFreeTiles - adds r0, r5, 0 - bl RemoveObjectAndFreeTiles -_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, =0x03005e00 - 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, =0x03005e00 - 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, =0x02020630 - ldr r0, =0x0300127c - 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, =DummyObjectCallback - 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 StartObjectRotScalAnim - 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 StartObjectRotScalAnim - 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 StartObjectRotScalAnim - 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 AddObjectToFront - ldr r6, =0x0300127c - 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 AddObjectToFront - 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 AddObjectToFront - ldr r1, [r6] - ldr r4, =0x0000029d - adds r1, r4 - strb r0, [r1] - ldr r3, =0x02020630 - 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, =DummyObjectCallback - 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, =0x0300127c - 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, =0x03005e00 - 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, =0x0203bc8c - ldr r1, [r2] - lsrs r0, 12 - adds r0, r1 - ldrh r6, [r0] - ldr r0, =0x0300127c - 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, =0x03005e00 - 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, =0x0300127c - 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, =0x0300127c - 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 sub_80A2A20 - 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, =0x03005e00 - 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, =0x0300127c - 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 CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl RunTextPrinters - bl fade_and_return_progress_probably - bl RunTasks - pop {r0} - bx r0 - thumb_func_end sub_819C7E0 - - thumb_func_start sub_819C7FC -sub_819C7FC: @ 819C7FC - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - 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, =0x020244ec - ldr r5, =0x03001284 - ldr r1, [r5] - ldrb r0, [r1, 0x12] - movs r6, 0x64 - muls r0, r6 - adds r0, r4 - ldr r2, =0x02024744 - 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 pokemon_setattr - ldr r3, =0x03005d90 - 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 pokemon_getattr - 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, =0x03005e00 - 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 pal_fade_maybe - movs r0, 0x7 - strh r0, [r6, 0x8] - b _0819C9F0 -_0819C950: - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0819C9F0 - ldr r4, =0x03001284 - 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, =0x0203ce40 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ce44 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ce48 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ce4c - 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, =0x03001284 - ldr r1, [r2] - movs r0, 0x1 - strb r0, [r1, 0x15] - ldr r2, [r2] - ldr r0, =0x02037714 - movs r1, 0xF4 - lsls r1, 1 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2, 0x24] - ldr r1, =0x020244ec - 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, =0x03001284 - ldr r2, [r7] - adds r0, r2, 0 - adds r0, 0x30 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819CAFE - ldr r1, =0x03005e00 - 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, =0x020375f0 - strh r1, [r0] - b _0819CAFE - .pool -_0819CA68: - movs r0, 0x2 - strh r0, [r4, 0x8] - ldr r1, =0x020375f0 - 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 pal_fade_maybe -_0819CA9C: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0819CAFE -_0819CAA4: - bl fade_and_return_progress_probably - 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, =0x0203ce40 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ce44 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ce48 - ldr r0, [r4] - bl Free - str r5, [r4] - ldr r4, =0x0203ce4c - 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, =0x03001284 - ldr r0, [r7] - adds r0, 0x30 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819CBD6 - ldr r1, =0x03005e00 - 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, =0x030022c0 - ldrh r1, [r2, 0x2E] - movs r6, 0x1 - adds r5, r6, 0 - ands r5, r1 - cmp r5, 0 - beq _0819CB86 - movs r0, 0x5 - bl audio_play - 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 audio_play - 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 audio_play - 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 audio_play - 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, =0x03005e00 - 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, =0x03005e00 - 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, =0x03001284 - 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, =0x03001284 - ldr r1, [r0] - ldr r0, [r1, 0x2C] - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F3F8 - ldr r1, =0x03005e00 - 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, =0x03005e00 - 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, =0x03001284 - 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, =0x03005e00 - 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, =0x03001284 - 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, =0x03001284 - 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, =0x03001284 - ldr r0, [r7] - adds r0, 0x30 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819CE36 - ldr r2, =0x030022c0 - 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 audio_play - 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 audio_play - 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, =0x03005e00 - 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, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0819CF4C - ldr r0, =0x03001284 - ldr r0, [r0] - adds r0, 0x22 - movs r1, 0x1 - strb r1, [r0] - strh r1, [r4, 0x8] - b _0819CF4C - .pool -_0819CE88: - ldr r2, =0x030022c0 - ldrh r1, [r2, 0x2E] - adds r5, r1, 0 - ands r5, r0 - cmp r5, 0 - beq _0819CEBC - movs r0, 0x5 - bl audio_play - ldr r0, =0x03001284 - 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 audio_play - ldr r0, =0x03001284 - 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, =0x03005e00 - 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, =0x03001284 - 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, =0x03001284 - 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 sub_80A2A20 - 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, =0x03005e00 - 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, =0x03001284 - 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, =0x03005e00 - 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, =0x03001284 - ldr r0, [r0] - adds r0, 0x27 - strb r1, [r0] - strh r1, [r4, 0x10] - b _0819D0AE - .pool -_0819D0A4: - ldr r0, =0x020378f4 - movs r1, 0xE0 - movs r2, 0xA - bl gpu_pal_apply -_0819D0AE: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0819D118 - .pool -_0819D0BC: - ldr r2, =0x03001284 - 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, =0x02037714 - ldr r0, =0x02037b14 - 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 sub_80A2A20 -_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, =0x03005e00 - 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, =0x03005e00 - str r0, [sp, 0xC] -_0819D174: - lsls r0, r1, 24 - asrs r4, r0, 24 - mov r9, r0 - cmp r4, 0x2 - beq _0819D1F2 - ldr r2, =0x02020630 - ldr r3, =0x03001284 - 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, =0x03005e00 - 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, =0x02020630 - ldr r4, =0x03001284 - 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, =0x03005e00 - adds r1, 0x8 - adds r0, r1 - movs r3, 0 - ldrsh r0, [r0, r3] - cmp r0, 0x1 - bne _0819D26A - ldr r1, =0x03001284 - 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, =0x03001284 - 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 IndexOfObjectPaletteTag - 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 IndexOfObjectPaletteTag - ldr r2, =0x03001284 - 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, =0x03005e00 - 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, =0x02020630 - ldr r2, =0x03001284 - 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, =0x02020630 - ldr r6, =0x03001284 - 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, =0x02020630 -_0819D40E: - ldr r1, =0x03001284 - 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, =0x02020630 - ldr r0, =0x03001284 - 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, =0x02020630 - ldr r6, =0x03001284 - 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, =0x02020630 - ldr r0, =0x03001284 - 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, =0x03005e00 - 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 gpu_pal_apply - bl sub_819ED34 - movs r0, 0x5 - bl PutWindowTilemap - b _0819D622 - .pool -_0819D5F0: - movs r0, 0x3 - bl sub_819EA64 - ldr r0, =0x03005e00 - 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 pal_fade_maybe -_0819D622: - ldr r1, =0x03005e00 - 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, =0x02037fd4 - 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, =0x03001284 - 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, =0x03005e00 - 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, =0x03005e00 - 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, =0x03001284 - ldr r0, [r1] - adds r0, 0x30 - ldrb r0, [r0] - adds r3, r1, 0 - cmp r0, 0x1 - bne _0819D78C - b _0819D9D8 -_0819D78C: - ldr r0, =0x03005e00 - 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, =0x03005e00 - 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, =0x03005e00 - 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, =0x02037b14 - 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 pal_fade_maybe - b _0819D990 - .pool -_0819D910: - ldr r0, =0x02037fd4 - 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, =0x03001284 - 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, =0x03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x3] - cmp r0, 0x2 - bhi _0819D98C - ldr r2, =0x02020630 - 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, =0x03005e00 - 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, =0x03001284 - ldr r0, [r0] - adds r0, 0x22 - movs r1, 0x1 - strb r1, [r0] - ldr r1, =0x03005e00 - 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, =0x03001284 - ldr r0, [r0] - adds r0, 0x30 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0819DA00 - b _0819DBCA -_0819DA00: - ldr r0, =0x03005e00 - 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, =0x03005e00 - adds r1, r7, r6 - lsls r1, 3 - adds r1, r0 - b _0819DB96 - .pool -_0819DA58: - bl sub_819EADC - ldr r2, =0x02020630 - ldr r0, =0x03001284 - 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, =0x03005e00 - 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, =0x03005e00 - ldr r0, =0x03001284 - 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, =0x03005e00 - ldr r4, =0x03001284 - 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, =0x02020630 - 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, =0x02020630 - ldr r4, =0x03001284 - 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, =0x03005e00 - 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, =0x03001284 - 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, =0x03001284 - 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, =0x030022c0 - 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, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819E00E - .pool -_0819DCD4: - ldr r5, =0x0203ce40 - movs r4, 0x88 - lsls r4, 3 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - ldr r5, =0x0203ce44 - adds r0, r4, 0 - bl AllocZeroed - str r0, [r5] - ldr r5, =0x0203ce48 - movs r4, 0x80 - lsls r4, 4 - adds r0, r4, 0 - bl Alloc - str r0, [r5] - ldr r5, =0x0203ce4c - 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 sub_80A1A74 - bl ResetAllObjectData - bl ResetTasks - bl ResetObjectPaletteAllocator - bl dp13_810BB8C - ldr r0, =gUnknown_08DC0754 - ldr r5, =0x0203ce40 - ldr r1, [r5] - movs r2, 0x88 - lsls r2, 2 - bl CpuSet - ldr r0, =gUnknown_0861033C - ldr r4, =0x0203ce44 - 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, =0x0203ce48 - 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 gpu_pal_apply - ldr r4, =gUnknown_08610918 - adds r0, r4, 0 - movs r1, 0xF0 - movs r2, 0xA - bl gpu_pal_apply - adds r0, r4, 0 - movs r1, 0xE0 - movs r2, 0xA - bl gpu_pal_apply - ldr r0, =gUnknown_0861039C - movs r1, 0x20 - movs r2, 0x4 - bl gpu_pal_apply - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819E00E - .pool -_0819DE68: - ldr r0, =0x0203ce4c - 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 LoadTaggedObjectPalettes - ldr r0, =gUnknown_08610650 - bl LoadObjectPics - ldr r0, =gUnknown_086106A0 - bl LoadCompressedObjectPic - ldr r0, =sub_819C7FC - bl SetVBlankCallback - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _0819E00E - .pool -_0819DECC: - ldr r0, =0x03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x15] - cmp r0, 0x1 - bne _0819DEDC - ldr r0, =0x0203cf20 - 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, =0x03001284 - 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, =0x030022c0 - 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, =0x03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x15] - cmp r0, 0 - bne _0819DF4A - bl sub_819EB4C -_0819DF4A: - movs r0, 0x1 - bl PutWindowTilemap - ldr r1, =0x030022c0 - 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, =0x03001284 - 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, =0x030022c0 - 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 pal_fade_maybe - 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, =0x03001284 - 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, =0x030022c0 - 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, =0x03001284 - ldr r1, [r6] - adds r1, 0x21 - strb r0, [r1] - ldr r0, [r6] - ldrb r5, [r0, 0x15] - cmp r5, 0 - bne _0819E06C - ldr r4, =0x03005e00 - 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, =0x03005e00 - 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, =0x03001284 - movs r7, 0 - ldr r5, =0x02020630 -_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 AddObjectToFront - 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, =0x03001284 - 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, =0x02020630 - adds r0, r4 - movs r5, 0x20 - ldrsh r1, [r0, r5] - ldr r0, =gUnknown_0861084C - movs r2, 0x58 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - movs r4, 0 - strb r0, [r1, 0x4] - ldr r0, =gUnknown_08610864 - movs r1, 0xB0 - movs r2, 0x70 - movs r3, 0 - bl AddObjectToFront - ldr r1, [r7] - strb r0, [r1, 0x1] - ldr r0, =gUnknown_0861087C - movs r1, 0xB0 - movs r2, 0x90 - movs r3, 0 - bl AddObjectToFront - 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, =0x02020630 - 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 AddObjectToFront - 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 AddObjectToFront - 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 AddObjectToFront - 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 AddObjectToFront - 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 AddObjectToFront - 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 AddObjectToFront - 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 AddObjectToFront - 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 AddObjectToFront - 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 AddObjectToFront - 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 AddObjectToFront - ldr r1, [r7] - strb r0, [r1, 0x11] - movs r6, 0 - ldr r5, =0x02020630 - 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, =0x03001284 - mov r8, r3 - ldr r0, =0x02020630 - 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, =0x03001284 - ldr r0, [r6] - adds r0, 0x5 - adds r0, r5 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl RemoveObjectAndFreeTiles - 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 RemoveObjectAndFreeTiles - ldr r0, [r6] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldr r0, [r6] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - movs r5, 0 -_0819E590: - movs r4, 0 - lsls r6, r5, 1 -_0819E594: - ldr r0, =0x03001284 - 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, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - 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, =0x03001284 - 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, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - 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, =0x02020630 - ldr r5, =0x03001284 - 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, =0x02020630 - ldr r3, =0x03001284 - 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 audio_play - lsls r4, 24 - cmp r4, 0 - ble _0819E6C0 - ldr r1, =0x03001284 - 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, =0x03001284 - 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 audio_play - lsls r4, 24 - cmp r4, 0 - ble _0819E728 - ldr r0, =0x03001284 - 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, =0x03001284 - 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, =0x03001284 - 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, =0x03001284 - 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, =0x02020630 - 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 audio_play - lsls r4, 24 - cmp r4, 0 - ble _0819E7EC - ldr r0, =0x03001284 - 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, =0x03001284 - 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, =0x02020630 - 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, =0x02020630 - mov r12, r0 - ldr r7, =0x03001284 -_0819E856: - cmp r6, 0x2 - bne _0819E898 - ldr r5, =0x02020630 - ldr r3, =0x03001284 - 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, =0x02020630 - ldr r4, =0x03001284 - 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, =0x03001284 - 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, =0x02020630 - 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, =0x03001284 - ldr r1, [r5] - movs r0, 0 - strb r0, [r1, 0x16] - ldr r4, =0x02020630 - 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, =0x02020630 - ldr r3, =0x03001284 - 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, =0x03001284 - 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, =0x020244ec - b _0819EB8A - .pool -_0819EB84: - movs r0, 0x64 - muls r0, r2 - ldr r1, =0x02024744 -_0819EB8A: - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r1, r0, 16 - ldr r4, =0x02021fc4 - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r4, 0 - bl CopyString - 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, =0x03001284 - 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, =0x03001284 - 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, =0x03001284 - 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, =0x03001284 - ldr r2, [r0] - ldrb r0, [r2, 0x15] - cmp r0, 0 - bne _0819EE3C - add r0, sp, 0xC - ldr r1, =0x02037b14 - 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 gpu_pal_apply - movs r0, 0x7 - bl PutWindowTilemap - movs r0, 0x7 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =0x03001284 - 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, =0x020244ec - b _0819EE8E - .pool -_0819EE88: - movs r0, 0x64 - muls r0, r2 - ldr r1, =0x02024744 -_0819EE8E: - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r1, r0, 16 - ldr r4, =0x02021fc4 - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r4, 0 - bl CopyString - 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 gpu_pal_apply - ldr r0, =0x020378f4 - ldr r1, =0x02037cd4 - movs r2, 0x5 - bl CpuSet - ldr r0, =0x03001284 - 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, =0x020244ec - b _0819EF46 - .pool -_0819EF40: - movs r0, 0x64 - muls r0, r2 - ldr r1, =0x02024744 -_0819EF46: - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r1, r0, 16 - ldr r4, =0x02021fc4 - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r4, 0 - bl CopyString - 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, =0x03001284 - 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, =0x020244ec - b _0819EFF2 - .pool -_0819EFEC: - movs r0, 0x64 - muls r0, r5 - ldr r1, =0x02024744 -_0819EFF2: - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - 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, =0x03001284 - 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, =0x03001280 - ldr r2, =gUnknown_086108AC - ldr r1, =0x03001284 - 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, =0x03001284 - 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, =0x03005e00 - 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, =0x03005e00 - 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, =0x03001284 - ldr r1, [r0] - ldr r0, [r1, 0x2C] - adds r1, 0x30 - movs r2, 0x1 - bl sub_819F3F8 - movs r0, 0x3 - bl sub_819EA64 - ldr r1, =0x03005e00 - 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, =0x03001280 - ldr r1, =0x03001284 - 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, =0x03005e00 - 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, =0x03005e00 - 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, =0x03001284 - ldr r1, [r5] - ldrb r0, [r1, 0x14] - cmp r0, 0 - bne _0819F240 - ldr r3, =0x03005e00 - 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, =0x03005e00 - 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, =0x03005e00 - 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 AddObjectToFront - strb r0, [r4] - ldr r2, =0x02020630 - 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 AddObjectToFront - ldr r6, =0x03001284 - 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, =0x02020630 - mov r8, r1 - add r0, r8 - movs r1, 0x2 - bl StartObjectRotScalAnim - ldr r0, [r6] - ldrb r1, [r0, 0x3] - movs r0, 0x64 - adds r4, r1, 0 - muls r4, r0 - ldr r0, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - mov r9, r0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl pokemon_getattr - 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, =0x03005e00 - 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, =0x02020630 - 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 rotscale_free_entry - lsrs r4, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r5 - bl RemoveObjectAndFreeTiles - 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, =0x03001284 - ldr r0, [r1] - adds r0, 0x30 - ldrb r0, [r0] - adds r3, r1, 0 - cmp r0, 0x1 - beq _0819F58A - ldr r2, =0x03005e00 - 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, =0x03001284 - ldr r0, [r0] - adds r0, 0x20 - movs r1, 0 - strb r1, [r0] - b _0819F54E - .pool -_0819F4F8: - ldr r0, =0x030022c0 - 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 audio_play - ldr r0, =0x03001284 - 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, =0x03005e00 - 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, =0x03001284 - ldr r0, [r0] - adds r0, 0x22 - movs r1, 0x1 - strb r1, [r0] - ldr r1, =0x03005e00 - 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, =0x02024744 - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - movs r4, 0 -_0819F5B8: - ldr r0, =0x03001284 - ldr r0, [r0] - ldrb r0, [r0, 0x12] - cmp r4, r0 - beq _0819F5EC - movs r0, 0x64 - muls r0, r4 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - 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, =0x03005e00 - 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, =DummyObjectCallback - 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 rotscale_free_entry - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _0819F688 - ldr r0, =0x03001284 - 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 RemoveObjectAndFreeTiles -_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, =0x03005e00 - 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, =0x03005e00 - 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, =0x03005e00 - 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, =0x02020630 - 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 StartObjectRotScalAnim - 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, =0x03001284 - ldr r1, [r0] - ldrb r0, [r1, 0x14] - cmp r0, 0 - bne _0819F900 - ldrb r1, [r1, 0x3] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - b _0819F908 - .pool -_0819F900: - ldrb r1, [r1, 0x3] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x02024744 -_0819F908: - adds r6, r1, r0 - adds r0, r6, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r6, 0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - adds r5, r0, 0 - adds r0, r6, 0 - movs r1, 0x1 - movs r2, 0 - bl pokemon_getattr - 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, =0x03001284 - ldr r1, [r2] - adds r1, 0x2C - movs r3, 0 - strb r0, [r1] - ldr r4, =0x02020630 - 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, =0x03005d90 - 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, =0x02021cc4 - 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 CopyString_Limit7 - ldr r0, [r7] - adds r0, r4 - ldr r1, =0x0000011b - adds r0, r1 - ldrb r1, [r0] - mov r0, r8 - bl StopMusicWhileStringIsPrinted - ldr r0, =0x02021dc4 - ldr r1, [r7] - adds r1, r4 - adds r1, 0xDE - ldrb r1, [r1] - movs r2, 0x1 - adds r3, r6, 0 - bl ConvertIntToDecimalString - 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, =0x02021fc4 - bl ExpandStringRefs - 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, =0x03005d90 - 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, =0x03005d90 - 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, =gUnknown_82E9531 - 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, =0x03005d90 - 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, =0x03005d90 - ldr r0, [r2] - adds r0, 0xDE - ldrb r0, [r0] - cmp r0, 0 - bne _0819FC10 - adds r4, r2, 0 - ldr r5, =gUnknown_08611548 -_0819FBDA: - bl GenerateRandomNumber - 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 GenerateRandomNumber - 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, =0x03005d90 - 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 GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl GenerateRandomNumber - 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, =0x03005d90 - 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, =0x030062ec -_0819FD06: - bl GenerateRandomNumber - 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 GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r4, r0, 24 - bl GenerateRandomNumber - 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 GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 24 - lsrs r4, r0, 24 - bl GenerateRandomNumber - 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, =0x030062ec - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x030062ec - mov r9, r0 -_0819FED2: - bl GenerateRandomNumber - 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, =0x030062ec - 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, =0x03005d90 - 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, =0x030062ec - 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, =0x03005d90 - 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, =0x03005d90 -_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 GenerateRandomNumber - 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 GenerateRandomNumber - 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 GenerateRandomNumber - 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, =0x030062ec - 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, =0x030062ec - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 -_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, =0x03005d90 - 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, =0x03005d90 - 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, =0x030062f0 - 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, =0x030062f0 - 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, =0x03005e08 - 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 audio_play - ldr r1, =0x020375f0 - movs r0, 0x7F - strh r0, [r1] - b _081A0768 - .pool -_081A0764: - ldr r0, =0x020375f0 - 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, =0x03005e00 - 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, =0x03005e00 - 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, =0x020375e0 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x020375f0 - strh r1, [r0] - b _081A095A - .pool -_081A0954: - ldr r1, =0x020375f0 - 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, =0x020375e2 - 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, =0x03005d90 - 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, =0x020375f0 - ldr r0, =0x03005d90 - 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, =0x03005d90 - 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, =0x020375f0 - movs r0, 0 - strh r0, [r1] - b _081A0A1C - .pool -_081A09F4: - ldr r2, =0x020375f0 - 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, =0x020375e2 - 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, =0x020375e2 - 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, =0x020375e4 - ldrh r0, [r1] - cmp r0, 0x6 - bne _081A0A94 - ldr r1, =gUnknown_08610FF0 - ldr r0, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x02021fc4 - bl ExpandStringRefs - 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, =0x03005d90 - 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, =0x020375f0 - 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, =0x020375f0 - movs r0, 0x4 - b _081A0D34 - .pool -_081A0D18: - ldr r1, =0x020375f0 - movs r0, 0x3 - b _081A0D34 - .pool -_081A0D24: - ldr r1, =0x020375f0 - movs r0, 0x1 - b _081A0D34 - .pool -_081A0D30: - ldr r1, =0x020375f0 - 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, =0x020375e2 - ldrh r0, [r0] - cmp r0, 0 - beq _081A0D6E - ldr r4, =0x020375e4 - ldr r0, =0x03005d90 - 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, =0x03005d90 - 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, =0x020375e2 - 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, =0x03005d90 - ldr r0, [r1] - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - ldr r3, =0x030062f0 - 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, =0x020375e2 - ldrh r0, [r0] - cmp r0, 0x2 - bne _081A0E88 - ldr r0, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x030062f0 - 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, =0x020375e2 - 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, =0x02021cc4 - b _081A1032 - .pool -_081A1028: - ldr r5, =0x02021dc4 - b _081A1032 - .pool -_081A1030: - ldr r5, =0x02021ec4 -_081A1032: - ldr r0, =0x020375e4 - 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, =0x030062f0 - ldr r0, [r0] - ldrh r1, [r0] - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - b _081A1174 - .pool -_081A1094: - ldr r0, =0x030062f0 - 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, =0x030062f0 - ldr r0, [r0] - ldrh r1, [r0] - movs r0, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - b _081A1174 - .pool -_081A10C4: - ldr r0, =0x030062f0 - 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, =0x030062f0 - 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, =0x03005d90 - 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_get_item - adds r1, r0, 0 - b _081A1174 - .pool -_081A1118: - ldr r0, =0x03005d90 - 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 CopyString - b _081A11E6 - .pool -_081A1140: - ldr r0, =0x03005d90 - 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, =0x03005d90 - ldr r0, [r0] - movs r1, 0x82 - lsls r1, 1 - adds r0, r1 - bl ConvertBattleFrontierTrainerSpeechToString - ldr r1, =0x02021fc4 -_081A1174: - adds r0, r5, 0 - bl CopyString - b _081A11E6 - .pool -_081A1184: - ldr r0, =0x03005d90 - 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 CopyString -_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, =0x03005d90 - ldr r2, [r0] - ldr r0, =0x020375e2 - 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, =0x03005d90 - 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, =0x020375e2 - mov r12, r1 - ldr r1, =0x020375f0 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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 CopyString - ldr r1, [r5] - ldr r0, =gUnknown_82E9531 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x020375e0 - movs r0, 0x1 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81A1638 - - thumb_func_start sub_81A1644 -sub_81A1644: @ 81A1644 - ldr r1, =0x020375e0 - 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, =0x030022c0 - 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, =0x030022c0 - 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, =0x030062f4 - ldr r1, =0x03005e00 - 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, =0x03005e00 - 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, =0x020375e0 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x020375e2 - 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, =0x020375f0 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r2, =0x00000ca8 - adds r0, r2 - ldrb r0, [r0] - strh r0, [r1] - b _081A1956 - .pool -_081A18A8: - ldr r1, =0x020375f0 - ldr r0, =0x03005d90 - 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, =0x020375f0 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r2, =0x00000cb2 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - b _081A1956 - .pool -_081A18E4: - ldr r1, =0x020375f0 - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 29 - b _081A1926 - .pool -_081A1900: - ldr r2, =0x020375f0 - ldr r1, =0x0202433a - ldrb r0, [r1] - strh r0, [r2] - movs r0, 0 - strb r0, [r1] - b _081A1956 - .pool -_081A1918: - ldr r1, =0x020375f0 - ldr r0, =0x03005d90 - 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, =0x020375f0 - ldr r0, =0x03005d90 - 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, =0x020375e2 - 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, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x020375e4 - ldrh r1, [r1] - ldr r2, =0x00000ca8 - adds r0, r2 - strb r1, [r0] - b _081A1AC4 - .pool -_081A19E0: - ldr r0, =0x03005d90 - ldr r2, [r0] - ldr r0, =0x020375e4 - 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, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x020375e4 - ldrh r1, [r1] - ldr r2, =0x00000cb2 - adds r0, r2 - strh r1, [r0] - b _081A1AC4 - .pool -_081A1A28: - ldr r0, =0x03005d90 - ldr r3, [r0] - ldr r0, =0x020375e4 - 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, =0x03005d90 - ldr r4, =0x00000caa - ldr r3, =0x0203cef8 -_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, =0x03005d90 - ldr r3, [r0] - ldr r0, =0x020375e4 - 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, =0x03005d90 - 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, =0x020375e2 - ldrh r0, [r4] - cmp r3, r0 - bge _081A1B00 - ldr r7, =0x0203cef8 - ldr r6, =0x03005d90 - 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 Reset - pop {r0} - bx r0 - thumb_func_end sub_81A1B1C - - thumb_func_start sub_81A1B28 -sub_81A1B28: @ 81A1B28 - ldr r1, =0x0203bc88 - 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, =0x03005d90 - 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, =0x03005d8c - 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, =0x020244ec - 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, =0x020375e4 - ldrh r1, [r0] - adds r2, r0, 0 - cmp r1, 0x3 - bls _081A1BA8 - movs r0, 0 - strh r0, [r2] -_081A1BA8: - ldr r0, =0x020375e2 - 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, =0x03005d90 - 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, =0x0203ab74 - 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, =0x0203ab74 - 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, =0x0203ab74 - 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, =0x02021cc4 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EE302 - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x0203ab74 - 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, =0x02021fc4 - ldr r1, =gUnknown_085EE158 - bl ExpandStringRefs - b _081A1F28 - .pool -_081A1EF0: - cmp r7, 0x1 - bne _081A1F08 - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085EE178 - bl ExpandStringRefs - b _081A1F28 - .pool -_081A1F08: - cmp r7, 0x2 - bne _081A1F20 - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085EE198 - bl ExpandStringRefs - b _081A1F28 - .pool -_081A1F20: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085EE1B7 - bl ExpandStringRefs -_081A1F28: - ldr r0, =0x02021fc4 - movs r1, 0x2 - bl sub_81A1C4C - ldr r6, =0x0203ab74 - 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, =0x03005d90 - 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, =0x0203ab74 - 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, =0x02021cc4 - adds r1, r4, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - adds r0, r4, 0 - adds r1, r7, 0 - bl ExpandStringRefs - 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, =0x0203ab74 - 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, =0x02021fc4 - ldr r1, =gUnknown_085EE1DB - bl ExpandStringRefs - b _081A2184 - .pool -_081A217C: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085EE1FE - bl ExpandStringRefs -_081A2184: - ldr r0, =0x02021fc4 - movs r1, 0 - bl sub_81A1C4C - ldr r1, =0x0203ab74 - 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, =0x0203ab74 - 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, =0x03005d90 - 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, =0x0203ab74 - ldrb r0, [r1] - bl PutWindowTilemap - ldr r1, =0x0203ab74 - 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, =0x0203ab74 - 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, =0x02021cc4 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EE302 - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x0203ab74 - 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, =0x02021fc4 - ldr r1, =gUnknown_085EE221 - bl ExpandStringRefs - b _081A24B0 - .pool -_081A24A8: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085EE241 - bl ExpandStringRefs -_081A24B0: - ldr r0, =0x02021fc4 - movs r1, 0x2 - bl sub_81A1C4C - ldr r6, =0x0203ab74 - 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, =0x03005d90 - 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, =0x0203ab74 - 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, =0x02021cc4 - adds r1, r4, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - adds r0, r4, 0 - adds r1, r7, 0 - bl ExpandStringRefs - 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, =0x0203ab74 - 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, =0x02021fc4 - ldr r1, =gUnknown_085EE261 - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x03005d90 - 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, =0x0203ab74 - 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, =0x02021cc4 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EE381 - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x0203ab74 - 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, =0x02021fc4 - ldr r1, =gUnknown_085EE27C - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x0203ab74 - 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, =0x02021cc4 - adds r0, r5, 0 - adds r1, r7, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EE302 - adds r0, r4, 0 - bl ExpandStringRefs - 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 ConvertIntToDecimalString - ldr r1, =gUnknown_085EE392 - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x0203ab74 - 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, =0x02021fc4 - ldr r1, =gUnknown_085EE298 - bl ExpandStringRefs - b _081A2CE0 - .pool -_081A2CD8: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085EE2B8 - bl ExpandStringRefs -_081A2CE0: - ldr r0, =0x02021fc4 - movs r1, 0 - bl sub_81A1C4C - ldr r0, =0x0203ab74 - 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, =0x0203ab74 - 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, =0x02021cc4 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EE39C - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x0203ab74 - 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, =0x02021fc4 - ldr r1, =gUnknown_085EE2D8 - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x0203ab74 - 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, =0x02021fc4 - mov r9, r0 - ldr r1, =gUnknown_085EDF86 - bl ExpandStringRefs - 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, =0x03005d90 - 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 ConvertIntToDecimalString - ldr r6, =0x0203ab74 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x02024474 - adds r6, 0x25 - ldrb r0, [r6] - movs r4, 0x1 - eors r0, r4 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r5, =0x020229f0 - adds r1, r5 - mov r0, sp - bl CopyString - mov r0, sp - bl StripExtendedControlCodes - lsls r1, r7, 3 - ldr r0, =0x00000ee1 - adds r1, r0 - mov r2, r9 - ldr r0, [r2] - adds r0, r1 - mov r1, sp - bl CopyString - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x020375f0 - 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, =0x03005d90 - 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, =0x0203bc88 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x0203bc88 - 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, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - bne _081A387C - ldr r1, =0x03005d90 - movs r0, 0xEC - muls r0, r3 - ldr r1, [r1] - adds r0, r1 - ldr r1, =0xfffef2c4 - b _081A38C4 - .pool -_081A37EC: - ldr r0, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - bne _081A387C - ldr r1, =0x03005d90 - 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, =0x03005d90 - 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, =0x0203bc88 - 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, =0x02022fec - 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, =0x03005d90 - movs r0, 0xEC - muls r0, r3 - ldr r1, [r1] - adds r0, r1 - ldr r1, =0xfffef2d0 - b _081A38C4 - .pool -_081A38A8: - ldr r0, =0x02022fec - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r5, 2 - adds r1, r2 - ldr r2, =0x00000d0c - b _081A3AB4 - .pool -_081A3A54: - ldr r0, =0x03005d90 - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r5, 2 - adds r1, r2 - ldr r2, =0x00000dc8 - b _081A3AB4 - .pool -_081A3A6C: - ldr r0, =0x03005d90 - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000dda - b _081A3AB4 - .pool -_081A3A80: - ldr r0, =0x03005d90 - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r5, 2 - adds r1, r2 - ldr r2, =0x00000de2 - b _081A3AB4 - .pool -_081A3A98: - ldr r0, =0x03005d90 - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000e04 - b _081A3AB4 - .pool -_081A3AAC: - ldr r0, =0x03005d90 - 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, =0x03005d90 - 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, =0x02038bca - ldrh r1, [r0] - ldr r0, =0x000003fe - cmp r1, r0 - bne _081A3B20 - ldr r1, =0x020375f0 - movs r0, 0x1 - b _081A3B24 - .pool -_081A3B20: - ldr r1, =0x020375f0 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r6, 2 - adds r1, r2 - ldr r2, =0x00000dc8 - b _081A3C68 - .pool -_081A3C18: - ldr r0, =0x03005d90 - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000dda - b _081A3C68 - .pool -_081A3C2C: - ldr r0, =0x03005d90 - ldr r0, [r0] - lsls r1, r4, 1 - lsls r2, r6, 2 - adds r1, r2 - ldr r2, =0x00000de2 - b _081A3C68 - .pool -_081A3C44: - ldr r0, =0x03005d90 - 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, =0x03005d90 - 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, =0x02038bca - mov r9, r0 - ldrh r0, [r0] - ldr r1, =0x000003fe - mov r8, r1 - cmp r0, r8 - bne _081A3CA6 - adds r5, 0xA -_081A3CA6: - ldr r6, =0x03005d90 - ldr r1, [r6] - ldr r4, =0x00000eb8 - adds r1, r4 - ldrh r0, [r1] - adds r0, r5 - strh r0, [r1] - ldr r0, =0x02021cc4 - adds r1, r5, 0 - movs r2, 0 - movs r3, 0x2 - bl ConvertIntToDecimalString - 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, =0x020375f0 - 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, =0x02022fec - ldr r1, =0x020375e2 - ldrh r1, [r1] - ldr r2, [r0] - ands r2, r1 - cmp r2, 0 - beq _081A3DC4 - ldr r1, =0x020375f0 - movs r0, 0x1 - strh r0, [r1] - b _081A3DC8 - .pool -_081A3DC4: - ldr r0, =0x020375f0 - 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, =0x02021cc4 - ldr r1, =gUnknown_085CCB79 - bl AppendString - b _081A3EC8 - .pool -_081A3E50: - cmp r5, r4 - ble _081A3EC8 - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085CCB7F - bl AppendString - b _081A3EC8 - .pool -_081A3E68: - cmp r4, r5 - bne _081A3E80 - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085CCB79 - bl AppendString - b _081A3E88 - .pool -_081A3E80: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085CCB7F - bl AppendString -_081A3E88: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085CCB86 - bl AppendString - b _081A3EC8 - .pool -_081A3EA0: - cmp r4, r5 - bne _081A3EB8 - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085CCB79 - bl AppendString - b _081A3EC0 - .pool -_081A3EB8: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085CCB7F - bl AppendString -_081A3EC0: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085CCB84 - bl AppendString -_081A3EC8: - ldr r0, =0x02021cc4 - movs r1, 0xB - muls r1, r6 - ldr r2, =gSpeciesNames - adds r1, r2 - bl AppendString -_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, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x41 - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - adds r0, r4, 0 - movs r1, 0xC - bl pokemon_getattr - lsls r0, 16 - lsrs r7, r0, 16 - adds r0, r4, 0 - movs r1, 0x38 - bl pokemon_getattr - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - 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, =0x020375f0 - 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, =0x020375f0 - 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, =0x02021cc4 - movs r0, 0xFF - strb r0, [r1] - ldr r1, =0x020375e0 - 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, =0x02021cc4 - ldr r1, =gUnknown_085CCB82 - adds r0, r4, 0 - bl AppendString - ldr r1, =gUnknown_085CCB88 - adds r0, r4, 0 - bl AppendString - b _081A4202 - .pool -_081A41A4: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _081A41C0 - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085CCB84 - bl AppendString - b _081A41C8 - .pool -_081A41C0: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085CCB82 - bl AppendString -_081A41C8: - ldr r0, =0x02021cc4 - ldr r1, =gUnknown_085CCB8C - bl AppendString - b _081A4202 - .pool -_081A41E0: - ldr r1, =0x020375e0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x03005d90 - ldr r2, [r0] - ldr r0, =0x020375f0 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000dda - adds r0, r2 - b _081A4386 - .pool -_081A434C: - ldr r0, =0x03005d90 - 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, =0x03005d90 - ldr r0, [r0] - lsls r1, r4, 1 - ldr r2, =0x00000e04 - adds r0, r2 - b _081A4386 - .pool -_081A437C: - ldr r0, =0x03005d90 - 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, =0x03005d8c - movs r5, 0x64 -_081A43B2: - ldr r0, =0x03005d90 - 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 pokemon_getattr - mov r1, sp - strh r0, [r1] - adds r0, r4, 0 - muls r0, r5 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xC - mov r2, sp - bl pokemon_setattr -_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, =0x020375f0 - bl sub_8185338 - strh r0, [r4] - ldr r0, =0x03005d90 - 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, =0x020375e2 - ldrh r0, [r0] - cmp r0, 0 - beq _081A4450 - cmp r0, 0x1 - beq _081A4464 - b _081A446E - .pool -_081A4450: - ldr r0, =0x02021cc4 - ldr r1, =0x02038bca - ldrh r1, [r1] - bl sub_8162E20 - b _081A446E - .pool -_081A4464: - ldr r0, =0x02021dc4 - ldr r1, =0x02038bca - 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, =0x03005d90 - 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, =0x020244ec - 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, =0x03005d90 - 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, =0x03005d8c - ldr r0, [r2] - adds r0, r1 - adds r1, r5, 0 - adds r1, 0xD - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - adds r0, r7, 0 - mov r1, r8 - movs r2, 0 - bl pokemon_getattr - 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, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x03005d90 - 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, =0x020244ec - 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, =0x0203ab74 - 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, =0x0203ab74 - 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, =0x02021dc4 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r5, =0x02021fc4 - 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 ExpandStringRefs - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xC8 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r1, =0x0203ab74 - 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, =0x0203ab74 - 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, =0x0203ab74 - 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 CopyString -_081A473C: - ldr r2, =0x0203ab74 - 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, =0x02021dc4 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalString - ldr r5, =0x02021fc4 - ldr r0, =gUnknown_08611D08 - ldr r4, [r0, 0x24] - adds r0, r5, 0 - adds r1, r4, 0 - bl ExpandStringRefs - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x02021cc4 - ldr r4, =gUnknown_08611CB0 - lsls r5, r7, 3 - adds r1, r5, r4 - ldr r1, [r1] - bl CopyString - ldr r6, =0x02021fc4 - adds r4, 0x4 - adds r5, r4 - ldr r1, [r5] - adds r0, r6, 0 - bl ExpandStringRefs - ldr r0, =0x0203ab74 - 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, =0x03005d90 - 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, =0x0203ab74 - 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, =0x020375e2 - 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, =0x0203ab74 - ldrb r0, [r4] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, =0x020375e2 - 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, =0x03005d90 -_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, =0x03005d90 - 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, =0x020244ec - 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, =0x020244e9 - ldrb r5, [r4] - bl copy_player_party_from_sav1 - bl sub_8076D5C - movs r0, 0x1 - bl save_game_when_memory_present - bl sav2_gender2_inplace_and_xFE - strb r5, [r4] - adds r4, r7, 0 - ldr r5, =0x020244ec - 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, =0x02022fec - 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, =0x02022fec - 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, =0x02022fec - 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 GenerateRandomNumber - adds r4, r0, 0 - bl GenerateRandomNumber - 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, =0x02024744 - 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 pokemon_setattr - movs r7, 0 - mov r6, r8 - ldr r3, =0x02024744 -_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 pokemon_setattr - 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, =0x02024744 - 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, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x20 - add r2, sp, 0x10 - bl pokemon_setattr - 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, =0x02038bca - 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, =0x02022fec - 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, =0x02021fc4 - ldr r2, =gUnknown_08611DB0 - lsls r1, 2 - adds r1, r2 - ldr r2, [r1] - lsls r1, r4, 2 - adds r1, r2 - ldr r1, [r1] - bl CopyString - b _081A5228 - .pool -_081A5214: - ldr r0, =0x02021fc4 - ldr r2, =gUnknown_08611DB8 - lsls r1, 2 - adds r1, r2 - ldr r2, [r1] - lsls r1, r4, 2 - adds r1, r2 - ldr r1, [r1] - bl CopyString -_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, =0x020375e0 - 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 pal_fade_maybe - 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 decompress_palette - ldr r1, =0x02022e24 - movs r0, 0xFF - strh r0, [r1] - ldr r1, =0x02022e26 - movs r0, 0x70 - strh r0, [r1] - b _081A553E - .pool -_081A52F4: - ldr r0, =0x02037fd4 - 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, =0x02022f58 - movs r2, 0xA1 - strb r2, [r1] - movs r0, 0xFF - strb r0, [r1, 0x1] - ldr r1, =0x02022f68 - strb r2, [r1] - movs r0, 0x1 - negs r0, r0 - strb r0, [r1, 0x1] - ldr r0, =gUnknown_085CCDB2 - bl get_battle_strings_ - ldr r4, =0x02022e2c - 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 AddObjectToFront - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0x3 - bl StartObjectImageAnim - 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 audio_play - 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 audio_play - 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 audio_play - 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, =0x02022e2c - 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 audio_play - ldr r0, =0x02022f58 - ldr r1, =0x02022f68 - ldrb r2, [r0] - ldrb r0, [r1] - cmp r2, r0 - bls _081A54BC - movs r6, 0x2 - ldr r1, =0x02024474 - movs r0, 0 - strb r0, [r1, 0x17] - b _081A553E - .pool -_081A54BC: - cmp r2, r0 - bcs _081A54D0 - movs r6, 0x3 - ldr r1, =0x02024474 - 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, =0x03007420 - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl MPlayVolumeControl - ldr r0, =0x7fffff1c - movs r1, 0 - str r1, [sp] - movs r1, 0x4 - movs r2, 0x8 - movs r3, 0 - bl pal_fade_maybe - b _081A553E - .pool -_081A5520: - ldr r0, =0x02037fd4 - 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 FreeObjectTilesByTag -_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, =0x0202449c - 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, =0x02024084 - 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, =0x02022f68 - b _081A562A - .pool -_081A5628: - ldr r1, =0x02022f58 -_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, =0x02022f68 - b _081A564E - .pool -_081A564C: - ldr r1, =0x02022f58 -_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 AddObjectToFront - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - adds r1, r4, 0 - bl StartObjectImageAnim - 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, =0x02024332 - ldrb r0, [r0] - cmp r0, 0x8 - bls _081A56AA - adds r0, r1, 0 - bl RemoveObjectAndFreeTiles -_081A56AA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A5698 - - thumb_func_start sub_81A56B4 -sub_81A56B4: @ 81A56B4 - ldr r0, =0x0202449c - 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, =0x02024084 - 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, =0x0202449c - ldr r1, [r1] - movs r2, 0xA6 - lsls r2, 2 - adds r1, r2 - adds r1, r0 - ldr r2, =gBattleArenaMoveMindRatings - ldr r0, =0x020241ea - 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, =0x0202449c - ldr r2, [r0] - ldr r0, =0x0000029a - adds r5, r2, r0 - ldr r0, =0x02024280 - 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, =gUnknown_0832A328 - 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, =0x0202427c - 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, =0x02024332 - 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, =0x0202433c - 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, =0x0202449c - 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, =0x0202449c - ldr r3, [r1] - movs r1, 0xA7 - lsls r1, 2 - adds r3, r1 - lsls r2, r0, 1 - adds r2, r3 - ldr r5, =0x02024084 - 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, =0x03005d90 - 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, =0x03005d8c - 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, =0x02038bca - 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, =0x03005d90 - ldr r3, [r0] - ldr r1, =0x00000ca9 - adds r0, r3, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r1, r0, 30 - ldr r0, =0x020375e2 - 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, =0x020375f0 - ldr r2, =0x00000dd8 - adds r1, r3, r2 - ldrh r1, [r1] - strh r1, [r0] - b _081A59EE - .pool -_081A59B0: - ldr r2, =0x020375f0 - 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, =0x020375f0 - ldr r1, =0x00000cdc - adds r0, r3, r1 - ldr r0, [r0] - movs r1, 0x80 - b _081A59EA - .pool -_081A59E0: - ldr r2, =0x020375f0 - 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, =0x03005d90 - ldr r2, [r0] - ldr r1, =0x00000ca9 - adds r0, r2, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r1, r0, 30 - ldr r0, =0x020375e2 - 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, =0x020375e4 - 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, =0x020375e4 - ldrh r1, [r1] - strh r1, [r0] - b _081A5ABA - .pool -_081A5A60: - cmp r1, 0 - beq _081A5A90 - ldr r0, =0x020375e4 - 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, =0x020375e4 - 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, =0x03005d90 - ldr r0, [r4] - ldr r1, =0x020375e2 - 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, =0x03005d90 - 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 GenerateRandomNumber - 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 GenerateRandomNumber - 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, =0x03005d90 - ldr r0, [r4] - ldr r1, =0x00000dd8 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl bag_add_item - 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, =0x02021cc4 - bl itemid_get_name - ldr r0, [r4] - ldr r1, =0x00000dd8 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x020375f0 - strh r5, [r0] - b _081A5BD6 - .pool -_081A5BD0: - ldr r1, =0x020375f0 - 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, =0x02021cc4 - ldr r1, =0x02038bca - 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, =0x020375e0 - 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, =0x03005d90 - 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, =0x03001288 - movs r0, 0 - strb r0, [r1] - movs r2, 0 - ldr r6, =0x03005d8c - 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, =0x03006298 - 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, =0x02038bca - 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, =0x03005d90 - 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, =0x020375e2 - 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, =0x020375f0 - ldr r0, [r7] - lsls r1, r6, 1 - lsls r2, r5, 2 - adds r1, r2 - ldr r2, =0x00000de2 - b _081A603C - .pool -_081A6000: - ldr r4, =0x020375f0 - 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, =0x020375f0 - 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, =0x03005d90 - 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, =0x020375e2 - 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, =0x020375e4 - ldrh r0, [r0] - strh r0, [r2] - b _081A6128 - .pool -_081A60B4: - ldr r0, =0x020375e4 - 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, =0x03001288 - 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, =0x020375e4 - 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, =0x03005d90 - ldr r0, [r4] - ldr r1, =0x020375e2 - 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, =0x03001288 - 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, =0x03005d90 - 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, =0x0203bc88 - 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, =0x03005d90 - 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, =0x03005d90 - ldrh r0, [r0] - cmp r7, r0 - bne _081A61FA - ldr r0, =0x02038bca - 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, =0x0203bc8c - ldr r2, [r4] - lsls r1, r0, 4 - adds r0, r1, r2 - ldrh r0, [r0] - cmp r0, 0xC9 - beq _081A636E - movs r3, 0 - ldr r6, =0x03005d90 - 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, =0x0203bc8c - 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, =0x0203bc8c - 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, =0x0203bc8c - 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, =0x03006298 - 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, =0x02038bca - 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, =0x03005d90 - 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, =0x0203bc8c - ldr r0, =gBattleFrontierMons - b _081A6400 - .pool -_081A63FC: - ldr r1, =0x0203bc8c - ldr r0, =gSlateportBattleTentMons -_081A6400: - str r0, [r1] - movs r7, 0 - ldr r2, =0x03005d90 - 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, =0x03006298 - 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, =0x02024744 - 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 pokemon_getattr - 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, =0x0203bc8c - 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 pokemon_setattr - 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, =0x03005d90 - 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, =0x0203bc8c - ldr r0, =gSlateportBattleTentMons - str r0, [r1] - movs r2, 0x1E - str r2, [sp, 0x14] - b _081A6518 - .pool -_081A6500: - ldr r1, =0x0203bc8c - 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, =0x020375e2 - 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, =0x0203bc8c - mov r9, r2 -_081A6534: - ldr r4, =0x03005d90 - 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, =0x020244ec - 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, =0x020244ec -_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 pokemon_setattr - 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, =0x020244ec - 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, =0x020244ec - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x20 - ldr r2, [sp, 0x1C] - bl pokemon_setattr - 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 pokemon_setattr - mov r2, r10 - add r2, r8 - lsls r2, 2 - ldr r5, =0x03005d90 - ldr r0, [r5] - adds r2, r0 - ldr r0, =0x00000e79 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x2E - bl pokemon_setattr - ldr r1, [sp, 0x18] - mov r8, r1 - cmp r1, 0x2 - bgt _081A666C - b _081A6534 -_081A666C: - ldr r0, =0x020375e2 - ldrh r0, [r0] - cmp r0, 0 - beq _081A667A - cmp r0, 0x2 - beq _081A667A - b _081A67AE -_081A667A: - movs r2, 0 - mov r8, r2 - ldr r4, =0x0203bc8c - mov r9, r4 -_081A6682: - ldr r5, =0x03005d90 - 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, =0x02024744 - 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, =0x02024744 -_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 pokemon_setattr - 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, =0x02024744 - 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, =0x02024744 - 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 pokemon_setattr - mov r2, r10 - add r2, r8 - lsls r2, 2 - ldr r1, =0x03005d90 - ldr r0, [r1] - adds r2, r0 - ldr r5, =0x00000e9d - adds r2, r5 - adds r0, r4, 0 - movs r1, 0x2E - bl pokemon_setattr - 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, =0x0203bc88 - 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, =0x03005d90 - 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, =0x0203bc8c - 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, =0x0203bc8c - 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, =0x0203bc8c - 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, =0x03005d90 - 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, =0x0203bc8c - 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, =0x0203bc8c - ldr r0, =gBattleFrontierMons - str r0, [r1] - movs r4, 0 - add r5, sp, 0x14 - ldr r7, =0x020375f0 - 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, =0x03006298 - mov r8, r0 - ldr r0, =0x0203bc8c - 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, =0x0203bc8c - 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, =0x03006298 - lsls r0, r4, 1 - adds r0, r1 - ldrh r6, [r0] - movs r5, 0 -_081A6B18: - ldr r0, =0x0203bc8c - 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, =0x020375f0 - 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, =0x02037318 - 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, =0x03005d90 - 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, =0x0203bc8c - ldr r0, =gBattleFrontierMons - b _081A6C4C - .pool -_081A6C48: - ldr r1, =0x0203bc8c - ldr r0, =gSlateportBattleTentMons -_081A6C4C: - str r0, [r1] - movs r4, 0 -_081A6C50: - movs r0, 0x64 - muls r0, r4 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x03005d90 - 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, =0x0203bc8c - 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 pokemon_setattr - 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, =0x03005d90 - 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, =0x0203bc8c - 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, =0x03005d90 - 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, =0x0203bc8c - 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, =0x0203bc8c - 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, =0x0203bc8c - 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, =0x0203bc8c - 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, =0x02024744 - 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, =0x0203bc8c - 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, =0x02024744 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x20 - mov r2, r10 - bl pokemon_setattr - ldr r2, =0x0203bc8c - 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 pokemon_setattr - 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 GenerateRandomNumber - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x02038bca - 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, =0x020375e0 - 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, =0x0300128c - 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, =0x0300128c - 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, =0x0300128d - 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, =0x03005d90 - ldr r0, [r1] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r2, r0, 30 - ldr r0, =0x020375e2 - 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, =0x020375f0 - ldr r1, [r3] - ldr r3, =0x00000e02 - adds r1, r3 - ldrh r1, [r1] - strh r1, [r0] - b _081A723A - .pool -_081A71A0: - ldr r2, =0x020375f0 - 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, =0x020375f0 - 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, =0x020375f0 - 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, =0x020375f0 - ldr r0, [r3] - ldr r1, =0x00000cdc - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 4 - b _081A7236 - .pool -_081A7228: - ldr r2, =0x020375f0 - 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, =0x03005d90 - ldr r0, [r1] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r3, r0, 30 - ldr r0, =0x020375e2 - 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, =0x020375e4 - ldrh r1, [r1] - ldr r5, =0x00000e02 - adds r0, r5 - strh r1, [r0] - b _081A73AA - .pool -_081A72AC: - ldr r0, =0x020375e4 - 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, =0x020375e4 - 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, =0x020375e4 - 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, =0x020375e4 - 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, =0x020375e4 - 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, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0xE - bls _081A73DC - ldr r1, =0x020375f0 - movs r0, 0x1 - b _081A73E0 - .pool -_081A73DC: - ldr r1, =0x020375f0 - 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, =0x020375f0 - ldr r1, =0x0300128c - ldrb r1, [r1] - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_81A73EC - - thumb_func_start sub_81A7400 -sub_81A7400: @ 81A7400 - ldr r1, =0x0300128e - movs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_81A7400 - - thumb_func_start sub_81A740C -sub_81A740C: @ 81A740C - ldr r1, =0x0300128e - 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, =0x03005d90 - ldr r0, [r4] - ldr r1, =0x020375e2 - 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 save_game_when_memory_present - 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, =0x03001290 - 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, =0x020375f0 - movs r0, 0 - b _081A74C0 - .pool -_081A7498: - ldr r1, =0x020375f0 - movs r0, 0x1 - b _081A74C0 - .pool -_081A74A4: - ldr r1, =0x020375f0 - movs r0, 0x2 - b _081A74C0 - .pool -_081A74B0: - ldr r1, =0x020375f0 - movs r0, 0x3 - b _081A74C0 - .pool -_081A74BC: - ldr r1, =0x020375f0 - 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, =0x020375f0 - ldr r1, =0x0300128d - 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 GenerateRandomNumber - 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, =0x020375f0 - 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, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0x4 - bhi _081A7538 - ldr r1, =gUnknown_0861231C - ldr r0, =0x03001294 - 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, =0x03001294 - ldrb r0, [r0] - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x3] - b _081A7560 - .pool -_081A7554: - ldr r1, =gUnknown_0861231C - ldr r0, =0x03001294 - 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 pokemon_getattr - 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 pokemon_setattr - adds r0, r5, 0 - movs r1, 0x15 - bl pokemon_getattr - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 -_081A75DA: - adds r1, r4, 0 - adds r1, 0xD - adds r0, r5, 0 - bl pokemon_getattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r6, r0, 24 - bl GenerateRandomNumber - 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, =0x03005d90 - 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, =0x03001290 -_081A77AE: - movs r4, 0 - mov r9, r4 - bl GenerateRandomNumber - 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, =0x03001290 - 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, =0x020244ec - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x37 - bl pokemon_getattr - bl pokemon_ailments_get_primary - lsls r0, 24 - cmp r0, 0 - bne _081A7860 - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - 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 pokemon_getattr - 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, =0x03001290 - 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, =0x0300128d - movs r0, 0x1 - b _081A78D4 - .pool -_081A78A4: - bl GenerateRandomNumber - lsls r0, 16 - lsrs r1, r0, 16 - movs r2, 0x1 - ands r1, r2 - cmp r1, 0 - beq _081A78C0 - ldr r0, =0x0300128d - strb r2, [r0] - b _081A78D6 - .pool -_081A78C0: - ldr r0, =0x0300128d - strb r1, [r0] - b _081A78D6 - .pool -_081A78CC: - movs r0, 0 - b _081A7956 -_081A78D0: - ldr r1, =0x0300128d - 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, =0x020244ec - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x37 - bl pokemon_getattr - bl pokemon_ailments_get_primary - lsls r0, 24 - cmp r0, 0 - bne _081A7946 - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - 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 pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - ldr r7, =0x03001290 - 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 pokemon_setattr -_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, =0x03005d90 - 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, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - bl pokemon_ailments_get_primary - lsls r0, 24 - cmp r0, 0 - bne _081A79D4 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - 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, =0x03005d90 - 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, =0x020375e6 - 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, =0x03005d90 - 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 GenerateRandomNumber - 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, =0x03001294 - bl GenerateRandomNumber - 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, =0x0300128e - 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, =0x03005d90 - 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, =0x02024744 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - 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, =0x02024744 - 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 pokemon_setattr - 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 GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 -_081A7CA8: - str r0, [sp] - ldr r0, =0x02024744 - movs r1, 0x2E - mov r2, sp - bl pokemon_setattr - 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, =0x02024744 - bl sub_80691F4 - adds r4, 0x1 - cmp r4, 0x3 - ble _081A7CBA - ldr r0, =0x02024744 - 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, =0x03005d90 - 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, =0x03005e00 - 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 sub_80A2A20 -_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 sub_80A2A20 -_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, =0x03005e00 - 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, =0x03005e00 - 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 GenerateRandomNumber - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - bl GenerateRandomNumber - 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, =0x020244ec - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0x39 - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r7, 0 - movs r1, 0x3A - bl pokemon_getattr - lsls r0, 16 - lsrs r6, r0, 16 - str r4, [sp, 0x8] - cmp r5, r6 - bcc _081A8044 - adds r0, r7, 0 - movs r1, 0x37 - bl pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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, =0x020244ec - 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, =0x020375f0 - 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, =0x02037318 - 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, =0x020375f0 - 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 GenerateRandomNumber - ldr r5, =0x03005d90 - 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 GenerateRandomNumber - ldr r7, =0x03005d90 - 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 GenerateRandomNumber - ldr r7, =0x03005d90 - 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, =0x03005d90 - 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, =0x020375f0 - ldr r0, =0x03005d90 - 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, =0x020375f0 - ldr r1, =gUnknown_0861266C - ldr r0, =0x03005d90 - 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, =0x03005d90 - 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, =0x02038bca - strh r4, [r5] - ldr r1, =0x0203bc88 - ldr r0, =gBattleFrontierTrainers - str r0, [r1] - ldrh r0, [r5] - movs r1, 0 - bl sub_8162614 - ldr r0, =0x03005d90 - 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, =0x03005d90 - 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, =0x0203bc88 - 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, =0x02038bca - strh r4, [r5] - ldrh r0, [r5] - movs r1, 0 - bl sub_8162614 - ldr r3, =0x03005d90 - 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, =0x03005d90 - 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, =0x02038bcc - strh r4, [r5] - ldrh r0, [r5] - movs r1, 0x1 - bl sub_8162614 - ldr r0, =0x03005d90 - 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, =0x03005d90 - 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, =0x020375e2 - ldrh r0, [r0] - cmp r0, 0 - bne _081A8524 - ldr r3, =0x02038bca - ldrh r1, [r3] - ldr r0, =0x0000012b - cmp r1, r0 - bhi _081A8542 - ldr r2, =0x0203bc88 - 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, =0x02038bcc - ldrh r1, [r3] - ldr r0, =0x0000012b - cmp r1, r0 - bhi _081A8542 - ldr r2, =0x0203bc88 - 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, =0x020244ec - movs r6, 0 - movs r4, 0 -_081A855C: - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - 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, =0x03005d90 - 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, =0x020375f0 - 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, =0x020375e6 - ldr r0, =0x03005d90 - 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, =0x020375f0 - 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, =0x03005d90 - ldr r2, [r0] - ldr r0, =0x020375e2 - 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, =0x020375f0 - 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, =0x020244ec - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0x39 - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r7, 0 - movs r1, 0x3A - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - cmp r4, r5 - bcc _081A8762 - adds r0, r7, 0 - movs r1, 0x37 - bl pokemon_getattr - bl pokemon_ailments_get_primary - lsls r0, 24 - cmp r0, 0 - bne _081A8762 - adds r0, r7, 0 - movs r1, 0x15 - bl pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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, =0x020375f0 - 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, =0x03005d8c - ldr r6, =0x03005d90 -_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 pokemon_getattr - 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, =0x03005d90 - 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, =0x02024488 - adds r0, r1 - ldr r1, =0x00000e12 - adds r3, r1 - adds r2, r3 - movs r1, 0xC - bl pokemon_setattr - 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, =0x03005d90 - 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, =0x02038bca - strh r4, [r0] - ldr r1, =0x0202433a - 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, =0x020244ec - adds r0, r4, 0 - movs r1, 0x6 - bl pokemon_getattr - 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 pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bls _081A8904 - subs r0, 0x5 - cmp r5, r0 - bgt _081A8904 - bl GenerateRandomNumber - 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, =0x0203ce50 - 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, =0x0203ce50 - 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, =0x02037350 - 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, =0x03005d8c - 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, =0x0203ce50 - 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, =0x03005d8c - 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, =0x0203ce50 - 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, =0x03005d8c - 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, =0x0203ce50 - 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, =0x03005d8c - 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, =0x02037350 - 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, =0x03005d8c - 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, =0x03005d8c - 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, =0x0203ce50 - 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, =0x03005d8c - 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, =0x0203ce50 - 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, =0x020375e0 - 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, =0x03005d90 - 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, =0x02038bca - movs r1, 0 - strh r1, [r0] - ldr r0, =0x0202433a - 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, =0x03005d90 - ldr r0, [r1] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r4, r0, 30 - ldr r0, =0x020375e2 - 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, =0x020375f0 - ldr r1, [r3] - ldr r3, =0x00000e18 - b _081A8FFE - .pool -_081A8F9C: - ldr r2, =0x020375f0 - 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, =0x020375f0 - ldr r0, [r3] - ldr r1, =0x00000cdc - adds r0, r1 - b _081A9030 - .pool -_081A8FCC: - ldr r2, =0x020375f0 - ldr r0, [r3] - ldr r3, =0x00000cdc - adds r0, r3 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 5 - b _081A9036 - .pool -_081A8FE4: - ldr r0, =0x020375f0 - ldr r1, [r3] - ldr r2, =0x00000e1a - adds r1, r2 - b _081A9000 - .pool -_081A8FF8: - ldr r0, =0x020375f0 - ldr r1, [r3] - ldr r3, =0x00000e1c -_081A8FFE: - adds r1, r3 -_081A9000: - ldrh r1, [r1] - strh r1, [r0] - b _081A903A - .pool -_081A9010: - ldr r2, =0x020375f0 - ldr r0, [r3] - ldr r1, =0x00000cdc - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 5 - b _081A9036 - .pool -_081A9028: - ldr r2, =0x020375f0 - 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, =0x03005d90 - ldr r2, [r0] - ldr r1, =0x00000ca9 - adds r0, r2, r1 - ldrb r0, [r0] - lsls r0, 30 - lsrs r1, r0, 30 - ldr r0, =0x020375e2 - 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, =0x020375e4 - 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, =0x020375e4 - ldrh r1, [r1] - strh r1, [r0] - b _081A9126 - .pool -_081A90B0: - cmp r1, 0 - beq _081A90E4 - ldr r0, =0x020375e4 - 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, =0x020375e4 - 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, =0x020375e4 - 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, =0x03005d90 - ldr r0, [r4] - ldr r1, =0x020375e2 - 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 save_game_when_memory_present - 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, =0x03005d90 - 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 GenerateRandomNumber - 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 GenerateRandomNumber - 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, =0x03005d90 - ldr r0, [r4] - ldr r1, =0x00000e18 - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl bag_add_item - 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, =0x02021cc4 - bl itemid_get_name - ldr r0, [r4] - ldr r1, =0x00000e18 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x020375f0 - strh r5, [r0] - b _081A924A - .pool -_081A9244: - ldr r1, =0x020375f0 - 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, =0x03005d90 -_081A925A: - bl GenerateRandomNumber - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x020375f2 - 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 GenerateRandomNumber2 - 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, =0x020375d8 - ldr r4, =0x020375da - 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, =0x03005d8c - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 4 - adds r3, r0, r1 - movs r2, 0 - ldr r4, =0x020375f2 - 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, =0x0203bc88 - 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, =0x03005d8c - ldr r0, [r0] - movs r1, 0xC7 - lsls r1, 4 - adds r1, r0 - mov r8, r1 - ldr r2, =0x02037350 - ldr r0, =0x03005df0 - 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, =0x0203bc88 - 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, =0x0203bc88 - 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, =0x02037350 - ldr r0, =0x03005df0 - 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, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000e2a - adds r0, r1 - ldrb r2, [r0] - ldr r1, =gUnknown_0832A328 - 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, =0x03005d90 - 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, =0x020375f0 - 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, =0x020375e4 - ldrh r0, [r0] - cmp r0, 0 - beq _081A9698 - cmp r0, 0x1 - beq _081A96B4 - b _081A9754 - .pool -_081A9698: - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x020375e2 - ldrh r1, [r1] - ldr r2, =0x00000e68 - adds r0, r2 - strb r1, [r0] - b _081A9754 - .pool -_081A96B4: - ldr r4, =0x020375f0 - ldrh r0, [r4] - cmp r0, 0x1 - beq _081A9710 - cmp r0, 0x1 - bgt _081A9754 - cmp r0, 0 - bne _081A9754 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081A9754 - ldr r0, =0x03005d90 - 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, =0x020375e6 - ldrh r0, [r0] - bl audio_play -_081A96FC: - ldr r1, =0x020375f0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - b _081A9754 - .pool -_081A9710: - ldr r1, =0x020375e2 - ldrh r0, [r1] - cmp r0, 0 - beq _081A9750 - subs r0, 0x1 - strh r0, [r1] - ldr r3, =0x03005d90 - 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, =0x020244ec - mov r8, r1 -_081A9776: - movs r4, 0 - adds r7, r5, 0x1 - mov r6, r9 - muls r6, r5 -_081A977E: - ldr r0, =0x03005d90 - 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 pokemon_setattr -_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, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081A980C - ldr r0, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000cb2 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 5 - ldr r1, =gUnknown_08D856C8 - adds r0, r1 - ldr r1, =0x020377d4 - 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, =0x03005d90 - 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, =0x03005d8c - ldr r0, [r2] - adds r0, r6 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - ldr r3, =0x020244ec - ldr r1, [sp, 0x10] - adds r0, r1, r3 - movs r1, 0xB - movs r2, 0 - str r3, [sp, 0x14] - bl pokemon_getattr - 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, =0x03005d8c - ldr r0, [r1] - add r0, r9 - adds r1, r5, 0 - adds r1, 0xD - movs r2, 0 - bl pokemon_getattr - adds r4, r0, 0 - adds r1, r6, 0 - adds r1, 0xD - mov r2, r10 - adds r0, r7, r2 - movs r2, 0 - bl pokemon_getattr - 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, =0x03005d8c - ldr r0, [r1] - ldr r2, [sp, 0x8] - adds r0, r2 - movs r5, 0x8E - lsls r5, 2 - adds r0, r5 - ldr r1, =0x020244ec - ldr r2, [sp, 0x10] - adds r1, r2, r1 - movs r2, 0x64 - bl memcpy - ldr r0, =0x0203cef8 - 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, =0x03005d90 - ldr r3, =0x00000caa - ldr r2, =0x0203cef8 -_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, =0x03005dc0 - 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, =0x02037350 - 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, =0x03005df0 - 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, =0x03005d90 - 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, =0x03005d90 - ldr r2, [r1] - ldr r1, =0x00000e2a - adds r2, r1 - ldr r4, =gUnknown_0832A328 - ldr r3, =0x02037350 - 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, =0x02038bca - ldrh r0, [r0] - bl sub_81A9B44 - ldr r0, =0x02022fec - 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, =0x03005df0 - strb r0, [r1] - ldr r0, =0x02038bcc - 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, =0x02037350 - mov r12, r0 - ldr r6, =0x03005df0 - ldr r1, =0x03005d8c - mov r10, r1 - ldr r7, =0x03005d90 - mov r9, r7 - ldr r0, =0x00000cb4 - mov r8, r0 - ldr r4, =gUnknown_0832A328 -_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, =0x020375f2 - 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, =0x03005d90 - 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, =0x02024744 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl pokemon_getattr - 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 pokemon_setattr - 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 pokemon_setattr - 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 GenerateRandomNumber - 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 GenerateRandomNumber - 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, =0x02024744 - 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 pokemon_setattr - 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, =0x02024744 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl pokemon_getattr - movs r1, 0x1 - ands r1, r0 - str r1, [sp, 0xC] - add r2, sp, 0xC -_081A9D7C: - adds r0, r4, 0 - movs r1, 0x2E - bl pokemon_setattr - b _081A9D9C - .pool -_081A9D90: - str r0, [sp, 0xC] - ldr r0, =0x02024744 - add r2, sp, 0xC - movs r1, 0x2E - bl pokemon_setattr -_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, =0x02024744 - 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, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x00000e1a - adds r0, r1 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0x8B - bls _081A9E0C - bl GenerateRandomNumber - 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, =0x02024744 - add r2, sp, 0x10 - bl pokemon_setattr - ldr r0, [sp, 0xC] - adds r0, 0x1 - str r0, [sp, 0xC] - cmp r0, 0x5 - ble _081A9DF6 -_081A9E0C: - ldr r0, =0x02024744 - 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, =0x02037318 - 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, =0x02037318 - 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, =0x03005d90 - 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 Reset -_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, =0x0203bc88 - 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, =0x0203bc88 - 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, =0x0203bc88 - 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, =0x0203bc88 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005dc0 - 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, =0x03005d8c - 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, =0x03005d90 - 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, =0x03005d8c - 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, =0x03005d8c - 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, =0x03005d90 - 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, =0x03005d90 - 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, =gUnknown_0832A328 - mov r12, r0 - ldr r6, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d8c - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d8c - 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, =0x03005d90 - 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 sub_80D7204 - movs r0, 0x22 - movs r1, 0x1 - bl sub_80D7204 - 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, =0x03005d90 - 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 GenerateRandomNumber - 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, =0x0203ce58 - 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, =0x020375e2 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x020375f0 - 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, =0x020375f0 - 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, =0x020375f0 - 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, =0x0203ce54 - 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, =0x0203ce58 - 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 CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably - 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 LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - 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, =0x030022c0 - 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, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAE50: - bl ResetObjectPaletteAllocator - b _081AB012 -_081AAE56: - bl sub_80A1A74 - ldr r2, =0x02037fd4 - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - ldr r1, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAE78: - bl ResetAllObjectData - 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, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAEA4: - bl bag_menu_init_bgs - ldr r0, =0x0203ce54 - ldr r0, [r0] - ldr r1, =0x00000834 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r1, =0x030022c0 - 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, =0x030022c0 - 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, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAF0C: - ldr r0, =0x0203ce58 - ldrb r0, [r0, 0x5] - bl load_bag_item_list_buffers - b _081AB012 - .pool -_081AAF1C: - ldr r1, =gUnknown_085E91FC - ldr r4, =0x0203ce58 - 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, =0x030022c0 - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 - b _081AB01A - .pool -_081AAF54: - ldr r4, =0x0203ce58 - ldrb r0, [r4, 0x4] - bl sub_81AB1F0 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =0x03006310 - 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, =0x03005e00 - 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, =0x0203ce58 - ldrb r0, [r0, 0x5] - bl AddBagVisualObject - ldr r1, =0x030022c0 - 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, =0x030022c0 - 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 sub_80A2A20 - ldr r1, =0x030022c0 - 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 pal_fade_maybe - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] -_081AB012: - ldr r1, =0x030022c0 - 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, =0x0203ce54 - 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, =0x0203ce54 - 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, =0x0203ce54 - 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, =0x03005d90 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - beq _081AB164 - ldr r0, =gUnknown_08D9A5D4 - movs r1, 0 - movs r2, 0x40 - bl decompress_palette - b _081AB1AE - .pool -_081AB164: - ldr r0, =gUnknown_08D9A588 - movs r1, 0 - movs r2, 0x40 - bl decompress_palette - b _081AB1AE - .pool -_081AB174: - bl IsWallysBag - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AB18A - ldr r0, =0x03005d90 - 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, =0x0203ce54 - 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, =0x0203ce74 - movs r0, 0x82 - lsls r0, 2 - bl Alloc - str r0, [r4] - ldr r4, =0x0203ce78 - 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, =0x02039dd8 - adds r1, r0 - mov r8, r1 - ldr r0, =0x0203ce54 - 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, =0x0203ce78 -_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, =0x0203ce74 - 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, =0x0203ce54 - 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, =0x0203ce78 - lsls r4, r6, 1 - adds r4, r6 - lsls r4, 3 - ldr r0, [r5] - adds r0, r4 - ldr r1, =gUnknown_085E8DB4 - bl CopyString - ldr r0, =0x0203ce74 - 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, =0x0203ce78 -_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, =0x0203ce74 - 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, =0x0203ce54 - ldr r0, [r0] - ldr r3, =0x00000829 - adds r0, r3 - adds r0, r7 - ldrb r0, [r0] - cmp r6, r0 - bcc _081AB30C -_081AB34A: - ldr r2, =0x03006310 - 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, =0x0203ce54 - ldr r1, [r0] - ldr r4, =0x00000829 - adds r0, r1, r4 - adds r0, r7 - ldrb r0, [r0] - strh r0, [r2, 0xC] - ldr r0, =0x0203ce74 - 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, =0x0203ce58 - ldrb r0, [r0, 0x5] - cmp r0, 0x2 - beq _081AB3C0 - cmp r0, 0x3 - beq _081AB420 - adds r0, r5, 0 - adds r1, r6, 0 - bl itemid_get_name - b _081AB43E - .pool -_081AB3C0: - ldr r4, =0x02021dc4 - 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 CopyString - movs r0, 0xA9 - lsls r0, 1 - cmp r5, r0 - bls _081AB408 - ldr r0, =0x02021cc4 - ldr r2, =0xfffffeae - adds r1, r5, r2 - movs r2, 0x2 - movs r3, 0x1 - bl ConvertIntToDecimalString - ldr r1, =gUnknown_085E921A - b _081AB438 - .pool -_081AB408: - ldr r0, =0x02021cc4 - ldr r2, =0xfffffee0 - adds r1, r5, r2 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - b _081AB436 - .pool -_081AB420: - ldr r0, =0x02021cc4 - adds r1, r5, 0 - subs r1, 0x84 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r1, =0x02021dc4 - adds r0, r5, 0 - bl itemid_get_name -_081AB436: - ldr r1, =gUnknown_085E9210 -_081AB438: - adds r0, r6, 0 - bl ExpandStringRefs -_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 audio_play - bl ShakeBagVisual -_081AB466: - ldr r4, =0x0203ce54 - 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, =0x0203ce58 - ldrb r0, [r0, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r6, 16 - lsrs r1, 16 - bl bag_pocket_get_itemid - 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, =0x0203ce54 - 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, =0x0203ce54 - 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, =0x0203ce58 - ldrb r0, [r5, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - lsls r4, 16 - lsrs r4, 16 - adds r1, r4, 0 - bl bag_pocket_get_itemid - 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 bag_pocket_get_item_quantity - 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, =0x02021cc4 - adds r1, r4, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E8DA0 - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x02021cc4 - mov r1, r9 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E8DA0 - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x03005d8c - 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, =0x0203ce58 - ldrb r0, [r0, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 16 - lsrs r1, 16 - bl bag_pocket_get_itemid - lsls r0, 16 - lsrs r0, 16 - bl itemid_get_description - adds r4, r0, 0 - b _081AB6FC - .pool -_081AB6E0: - ldr r0, =0x02021cc4 - ldr r2, =gUnknown_085E9180 - ldr r1, =0x0203ce58 - ldrb r1, [r1, 0x4] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl CopyString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E91C0 - adds r0, r4, 0 - bl ExpandStringRefs -_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, =0x0203ce54 - ldr r4, [r5] - ldr r1, =0x0000081e - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081AB80A - ldr r2, =0x0203ce58 - 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, =0x0203ce54 - 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, =0x0203ce54 - 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, =0x0203ce5e - 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, =0x0203ce54 - 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, =0x0203ce78 - ldr r0, [r0] - bl Free - ldr r0, =0x0203ce74 - ldr r0, [r0] - bl Free - bl FreeAllWindowBuffers - ldr r0, =0x0203ce54 - 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 pal_fade_maybe - ldr r1, =0x03005e00 - 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, =0x03005e08 - adds r2, r0, r1 - ldr r0, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081AB9A0 - ldrb r0, [r2] - ldr r4, =0x0203ce58 - 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, =0x0203ce54 - 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 ResetAllObjectData - bl ResetObjectPaletteAllocator - 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, =0x02039dd8 - 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, =0x0203ce54 - 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, =0x0203ce6a - adds r4, r1, r2 - subs r2, 0xA - adds r1, r2 - ldr r2, =0x0203ce54 - 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, =0x0203ce6a - adds r7, r6, 0 - subs r7, 0xA -_081ABAEC: - lsls r1, r5, 1 - adds r0, r1, r6 - adds r1, r7 - ldr r2, =0x0203ce54 - 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, =0x0203ce58 - 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, =0x03005e08 - 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, =0x03005e08 - adds r5, r0 - ldr r7, =0x0203ce58 - 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_remove_item_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, =0x03006310 - 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, =0x0203ce58 - ldrb r0, [r0, 0x5] - movs r3, 0x2 - cmp r0, 0x3 - bne _081ABC6C - movs r3, 0x3 -_081ABC6C: - ldr r0, =0x02021cc4 - lsls r1, 16 - asrs r1, 16 - movs r2, 0x2 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E8DA0 - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x0203ce58 - ldrb r0, [r0, 0x5] - movs r3, 0x2 - cmp r0, 0x3 - bne _081ABCD4 - movs r3, 0x3 -_081ABCD4: - ldr r0, =0x02021cc4 - movs r2, 0x2 - bl ConvertIntToDecimalString - ldr r6, =0x02021fc4 - ldr r1, =gUnknown_085E8DA0 - adds r0, r6, 0 - bl ExpandStringRefs - 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, =0x03005e08 - adds r6, r0, r1 - ldr r5, =0x0203ce58 - 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, =0x02037fd4 - 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, =0x030022c0 - 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, =0x0203ce54 - ldr r0, [r0] - ldr r1, =0x0203ce58 - 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 audio_play - 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 audio_play - b _081ABEB2 -_081ABE40: - movs r0, 0x5 - bl audio_play - ldr r0, =0x0203ce7c - mov r1, r10 - strh r1, [r0] - ldr r0, =0x03005e08 - 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 audio_play - 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 bag_pocket_get_item_quantity - strh r0, [r6, 0x4] - ldrb r0, [r5, 0x5] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - bl bag_pocket_get_itemid - ldr r1, =0x0203ce7c - 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, =0x03005e00 - 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, =0x0203ce54 - 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, =0x030022c0 - 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 audio_play - 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 audio_play - 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, =0x03005e08 - 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, =0x0203ce58 - 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, =0x02020630 - ldr r0, =0x0203ce54 - 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, =0x0203ce58 - 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, =0x0203ce58 - 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, =0x03005e00 - 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, =0x03005e08 - 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, =0x0203ce5d - 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, =0x0203ce5d - 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, =0x0203ce5d - 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, =0x03006310 - 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, =0x0203ce58 - 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, =0x03005e08 - mov r9, r0 - adds r6, r4, r0 - ldrb r0, [r6] - movs r1, 0x10 - movs r2, 0x1 - bl sub_81AF15C - ldr r3, =0x0203ce58 - 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, =0x0203ce54 - 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 bag_pocket_get_itemid - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x02021cc4 - bl itemid_get_name - ldr r0, =0x02021fc4 - mov r8, r0 - ldr r1, =gUnknown_085E8DFE - bl ExpandStringRefs - 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, =0x03005e08 - adds r4, r0, r1 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081AC48E - ldr r0, =0x030022c0 - mov r8, r0 - ldrh r1, [r0, 0x2E] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _081AC418 - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - ldr r3, =0x0203ce58 - 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, =0x0203ce58 - 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 audio_play - 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 audio_play - 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, =0x03005e08 - add r0, r10 - mov r9, r0 - ldr r5, =0x0203ce58 - ldrb r6, [r5, 0x5] - lsls r1, r6, 1 - adds r0, r5, 0 - adds r0, 0x12 - adds r0, r1 - mov r8, r0 - ldr r2, =0x0203ce60 - 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, =0x02039dd8 - lsls r0, r6, 3 - adds r0, r1 - ldr r0, [r0] - adds r1, r2, 0 - adds r2, r4, 0 - bl sub_80D702C - ldr r0, =0x0203ce54 - 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, =0x0203ce60 - 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, =0x03006310 - 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, =0x03005e08 - 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, =0x03005e08 - mov r10, r0 - mov r7, r9 - add r7, r10 - ldr r4, =0x0203ce58 - 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, =0x0203ce54 - 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, =0x03006310 - 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, =0x0203ce58 - 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, =0x0203ce7c - ldrh r0, [r0] - bl itemid_get_usage - lsls r0, 24 - cmp r0, 0 - beq _081AC6C4 - ldr r0, =0x0203ce54 - 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, =0x0203ce54 - 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, =0x0203ce54 - 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, =0x0203ce7c - 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, =0x0203ce54 - 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, =0x0203ce54 - 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, =0x0203ce7c - 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, =0x0203ce54 - 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, =0x0203ce54 - 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, =0x0203ce7c - 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, =0x0203ce54 - 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, =0x0203ce54 - 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, =0x0203ce58 - ldrb r0, [r0, 0x5] - cmp r0, 0x4 - beq _081AC856 - ldr r0, =0x0203ce7c - ldrh r0, [r0] - bl sub_8122148 - lsls r0, 24 - cmp r0, 0 - bne _081AC880 -_081AC856: - ldr r0, =0x0203ce54 - 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, =0x0203ce54 - 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, =0x0203ce58 - 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, =0x0203ce54 - 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, =0x0203ce7c - 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, =0x0203ce54 - 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, =0x03005d8c - ldr r0, [r0] - ldr r1, =0x00000496 - adds r0, r1 - ldr r2, =0x0203ce7c - 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, =0x0203ce54 - 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, =0x0203ce54 - 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, =0x0203ce54 - 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, =0x0203ce58 - ldrb r0, [r0, 0x5] - cmp r0, 0x2 - bne _081ACA50 - movs r0, 0x1 - bl ClearWindowTilemap - ldr r0, =0x0203ce7c - 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, =0x0203ce7c - ldrh r0, [r0] - ldr r1, =0x02021cc4 - bl itemid_get_name - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E8DBE - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x0203ce54 - 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, =0x0203ce54 - 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, =0x0203ce54 - 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, =0x0203ce54 - ldr r0, [r0] - ldr r1, =0x00000828 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x2 - bhi _081ACBE8 - ldr r0, =0x03005e00 - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =Task_HandleInBattleItemMenuInput - b _081ACBF4 - .pool -_081ACBE8: - ldr r0, =0x03005e00 - 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 audio_play - ldr r0, =gUnknown_08613FB4 - ldr r1, [r0, 0x24] - adds r0, r5, 0 - bl _call_via_r1 - b _081ACC6A - .pool -_081ACC44: - movs r0, 0x5 - bl audio_play - ldr r1, =gUnknown_08613FB4 - ldr r0, =0x0203ce54 - 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, =0x030022c0 - 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 audio_play - 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, =0x0203ce54 - 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 audio_play - 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 audio_play - 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 audio_play - 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 audio_play - ldr r2, =gUnknown_08613FB4 - ldr r0, =0x0203ce54 - 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 audio_play - 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, =0x0203ce54 - 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, =0x0203ce54 - 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, =0x0203ce7c - ldrh r0, [r5] - bl itemid_get_overworld_function - 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_get_type - 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, =0x0203ce58 - ldrb r0, [r0, 0x5] - cmp r0, 0x3 - beq _081ACEE8 - ldr r0, =0x0203ce7c - ldrh r0, [r0] - bl itemid_get_overworld_function - 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, =0x03005e08 - 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, =0x0203ce7c - ldrh r0, [r0] - ldr r1, =0x02021cc4 - bl itemid_get_name - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E8EE0 - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x03005e08 - adds r4, r0 - ldr r0, =0x0203ce7c - ldrh r0, [r0] - ldr r1, =0x02021cc4 - bl itemid_get_name - ldr r0, =0x02021dc4 - movs r2, 0x10 - ldrsh r1, [r4, r2] - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E8F0E - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x03005e08 - 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, =0x03005e08 - 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, =0x0203ce54 - 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, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081AD0AC - movs r0, 0x5 - bl audio_play - 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 audio_play - 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, =0x03005e08 - adds r6, r4, r5 - ldr r0, =0x0203ce7c - ldrh r0, [r0] - ldr r1, =0x02021cc4 - bl itemid_get_name - ldr r0, =0x02021dc4 - movs r2, 0x10 - ldrsh r1, [r6, r2] - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r6, =0x02021fc4 - ldr r1, =gUnknown_085E8EF9 - adds r0, r6, 0 - bl ExpandStringRefs - 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, =0x03005e08 - adds r5, r0, r1 - ldr r4, =0x0203ce58 - 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, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081AD1CE - movs r0, 0x5 - bl audio_play - ldr r0, =0x0203ce7c - ldrh r0, [r0] - ldrh r1, [r5, 0x10] - bl remove_item - 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, =0x03006310 - 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, =0x03005e08 - adds r7, r0, r1 - ldr r0, =0x0203ce58 - 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, =0x03005d8c - ldr r0, [r0] - ldr r2, =0x00000496 - adds r1, r0, r2 - ldr r0, =0x0203ce7c - 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, =0x0203ce58 - ldrb r0, [r0, 0x5] - bl load_bag_item_list_buffers - ldr r0, =0x03006310 - 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, =0x0203ce7c - 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, =0x0203ce54 - 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, =0x0203ce7c - ldrh r0, [r0] - ldr r1, =0x02021cc4 - bl itemid_get_name - ldr r5, =0x02021fc4 - ldr r1, =gUnknown_085E8E11 - adds r0, r5, 0 - bl ExpandStringRefs - 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, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081AD36E - movs r0, 0x5 - bl audio_play - 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, =0x0203ce54 - 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, =0x03005e08 - 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, =0x0203ce7c - ldrh r0, [r4] - bl itemid_get_battle_function - cmp r0, 0 - beq _081AD400 - bl bag_menu_remove_some_window - ldrh r0, [r4] - bl itemid_get_battle_function - 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, =0x0203ce7c - 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, =0x02021cc4 - bl itemid_get_name - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E8E27 - adds r0, r4, 0 - bl ExpandStringRefs - ldr r3, =sub_81AD350 - adds r0, r5, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl DisplayItemMessage - b _081AD4AE - .pool -_081AD488: - ldr r0, =0x0203ce58 - 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, =0x0203ce7c - 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, =0x0203ce58 - 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, =0x03005e00 - 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, =0x03005d8c - ldr r0, [r4] - ldr r5, =0x00000496 - adds r1, r0, r5 - ldrh r0, [r1] - cmp r0, 0 - beq _081AD5CA - movs r1, 0x1 - bl sub_80D6724 - 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, =0x0203ce7c - ldr r0, [r4] - adds r0, r5 - ldrh r1, [r0] - strh r1, [r2] - ldrh r0, [r0] - bl itemid_get_overworld_function - movs r1, 0x8 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x03005e00 - 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, =0x03005e08 - adds r4, r0, r1 - ldr r6, =0x0203ce7c - ldrh r0, [r6] - bl itemid_get_market_price - lsls r0, 16 - cmp r0, 0 - bne _081AD634 - ldrh r0, [r6] - ldr r1, =0x02021dc4 - bl itemid_get_name - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E960F - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x02021dc4 - bl itemid_get_name - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E962F - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x03005e08 - adds r4, r0 - ldr r6, =0x02021cc4 - ldr r0, =0x0203ce7c - 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 ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E9654 - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x03005e08 - adds r4, r0 - bl bag_menu_remove_money_window - movs r0, 0x4 - bl bag_menu_remove_item_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, =0x03005e08 - 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, =0x0203ce7c - 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, =0x03005e08 - 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, =0x0203ce54 - ldr r0, [r0] - ldr r1, =0x00000818 - adds r0, r1 - ldrb r4, [r0] - movs r2, 0x10 - ldrsh r5, [r6, r2] - ldr r0, =0x0203ce7c - 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, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081AD818 - movs r0, 0x5 - bl audio_play - 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 audio_play - 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_remove_item_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, =0x03005e08 - adds r4, r0 - ldr r6, =0x0203ce7c - ldrh r0, [r6] - ldr r1, =0x02021dc4 - bl itemid_get_name - ldr r0, =0x02021cc4 - 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 ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E9677 - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x03005e08 - adds r0, r6 - mov r10, r0 - ldr r7, =0x0203ce58 - 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 audio_play - ldr r2, =0x0203ce7c - mov r8, r2 - ldrh r0, [r2] - mov r3, r10 - ldrh r1, [r3, 0x10] - bl remove_item - ldr r0, =0x03005d8c - 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, =0x03006310 - 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, =0x0203ce54 - ldr r0, [r0] - ldr r1, =0x00000819 - adds r0, r1 - ldrb r4, [r0] - ldr r2, =0x03005d8c - 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, =0x03005e08 - 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, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081AD9E2 - movs r0, 0x5 - bl audio_play - 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, =0x03005e08 - 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, =0x0203ce7c - ldrh r0, [r0] - ldr r1, =0x02021cc4 - bl itemid_get_name - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E8E42 - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x03005e08 - 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, =0x0203ce54 - 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, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081ADAE4 - movs r0, 0x5 - bl audio_play - 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 audio_play - 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, =0x03005e08 - mov r9, r0 - adds r2, r7, 0 - add r2, r9 - mov r8, r2 - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r4, =0x0203ce7c - 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, =0x02021cc4 - bl itemid_get_name - ldr r0, =0x02021dc4 - mov r2, r8 - movs r3, 0x10 - ldrsh r1, [r2, r3] - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E8E5A - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x03005e08 - adds r5, r0, r1 - ldr r0, =0x030022c0 - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _081ADC44 - movs r0, 0x5 - bl audio_play - 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, =0x0203ce58 - 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, =0x0203ce80 - movs r0, 0xD0 - bl AllocZeroed - str r0, [r4] - ldr r5, =0x03005d8c - 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, =0x0203ce58 - 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, =0x03005d8c - ldr r0, [r4] - movs r1, 0xAC - lsls r1, 3 - adds r0, r1 - movs r1, 0x1E - bl sub_80D6C7C - ldr r0, [r4] - movs r2, 0xCA - lsls r2, 3 - adds r0, r2 - movs r1, 0x10 - bl sub_80D6C7C - 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, =0x03005d8c - ldr r0, [r5] - movs r1, 0xAC - lsls r1, 3 - adds r0, r1 - ldr r4, =0x0203ce80 - 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, =0x0203ce58 - 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 bag_add_item - movs r0, 0x4 - movs r1, 0x1 - bl bag_add_item - 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, =0x03005e08 - adds r4, r0, r1 - ldr r0, =0x02037fd4 - 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 audio_play - adds r0, r5, 0 - movs r1, 0x1 - movs r2, 0 - bl SwitchBagPocket - b _081ADE2C -_081ADDEC: - movs r0, 0x5 - bl audio_play - ldrb r0, [r4] - movs r1, 0x2 - bl bag_menu_print_cursor_ - ldr r1, =0x0203ce7c - movs r0, 0x4 - strh r0, [r1] - adds r0, r5, 0 - bl sub_81AC644 - b _081ADE2C - .pool -_081ADE0C: - movs r0, 0x5 - bl audio_play - 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, =0x020375e2 - ldr r0, =0x0203ce7c - ldrh r0, [r0] - strh r0, [r1] - ldr r1, =0x020375f0 - 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, =0x03005dac - 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, =0x0203ce7c - ldrh r0, [r0] - movs r1, 0x1 - bl remove_item - ldr r1, =0x020375f0 - 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, =0x03005dac - 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, =0x020375f0 - 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, =0x03005dac - 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, =0x0203ce54 - 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, =0x0203ce54 - 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 gpu_pal_apply - 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, =0x0203ce54 - 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, =0x0203ce54 - 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, =0x0203ce54 - 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, =0x0203ce54 - 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_remove_item_message_window -bag_menu_remove_item_message_window: @ 81AE1F8 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x0203ce54 - 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_remove_item_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, =0x03005d8c - 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, =0x02021cc4 - ldrb r1, [r5, 0x1] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - 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, =0x02021cc4 - ldrb r1, [r2, 0x3] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - 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, =0x02021cc4 - 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 ConvertIntToDecimalString - 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, =0x0203ce84 - 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, =0x03006310 - 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, =0x0203ce84 - 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, =0x030022c0 - 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, =0x0203ce84 - 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, =0x03005e08 - adds r3, r1, r0 - ldr r2, =0x030022c0 - 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, =0x03005e08 - 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, =0x03005e08 - 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, =0x03005e08 - 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, =0x03005e08 - 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, =0x03005e08 - 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, =0x03005e08 - 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, =0x03005e08 - 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, =0x03005e08 - 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, =0x03006300 - 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, =0x03006300 - 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, =0x03006300 - 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 audio_play -_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, =0x03005e08 - 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, =0x03005e08 - 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 StartObjectImageAnim - 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, =gUnknown_08329F40 - 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, =gUnknown_08329F40 - 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 AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x02020630 - 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 gpu_pal_apply - 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 LoadTaggedObjectPalette -_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, =0x03005e08 - 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, =0x02020630 - 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, =0x0203ce8c - 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, =0x0203ce8c - 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, =0x03005e08 - 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, =0x02020630 - 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, =0x02020630 - 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, =0x03005e08 - adds r4, r1, r0 - movs r1, 0x1E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081AF5E8 - ldr r3, =0x02020630 - 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, =0x02020630 - 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, =0x03005e08 - adds r5, r0, r1 - ldrh r0, [r5, 0xE] - ldr r4, =0x0000ffff - cmp r0, r4 - beq _081AF63E - bl FreeObjectTilesByTag -_081AF63E: - ldrh r0, [r5, 0x10] - cmp r0, r4 - beq _081AF648 - bl FreeObjectPaletteByTag -_081AF648: - ldrb r1, [r5, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =0x02020630 - adds r0, r4 - bl RemoveObjectAndFreeTiles - ldrb r1, [r5, 0xD] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl RemoveObjectAndFreeTiles - 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 gpu_pal_apply - 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 LoadTaggedObjectPalette -_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, =0x03005e08 - 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, =gUnknown_082EC6AC - 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 AddObjectToFront - strb r0, [r5, 0xC] - ldrb r1, [r5, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r7, =0x02020630 - adds r0, r7 - adds r1, r5, 0 - bl SetSpriteOamTables_NoPriorityFromTable - 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, =0x03005e08 - adds r3, r0 - ldr r5, =0x02020630 - 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, =0x03005e08 - adds r4, r0, r1 - ldr r0, [r4, 0x8] - bl Free - ldrh r0, [r4, 0xE] - ldr r6, =0x0000ffff - cmp r0, r6 - beq _081AF9FC - bl FreeObjectTilesByTag -_081AF9FC: - ldrh r0, [r4, 0x10] - cmp r0, r6 - beq _081AFA06 - bl FreeObjectPaletteByTag -_081AFA06: - ldrb r1, [r4, 0xC] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - 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, =gUnknown_08329F40 - 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 gpu_pal_apply - 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 LoadTaggedObjectPalette -_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, =0x03005e08 - 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 AddObjectToFront - strb r0, [r4] - ldr r3, =0x02020630 - 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, =0x03005e08 - adds r3, r0 - ldr r5, =0x02020630 - 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, =0x03005e08 - adds r4, r0, r1 - ldrh r0, [r4, 0x2] - ldr r6, =0x0000ffff - cmp r0, r6 - beq _081AFBBE - bl FreeObjectTilesByTag -_081AFBBE: - ldrh r0, [r4, 0x4] - cmp r0, r6 - beq _081AFBC8 - bl FreeObjectPaletteByTag -_081AFBC8: - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - bl RemoveObjectAndFreeTiles - 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, =0x0203ce9c - 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, =0x0203ce9c - 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, =0x0203ce9c -_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 CopyString - 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, =0x0203ce9c - 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, =0x03005d8c - 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, =0x03005d90 - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0xFD - ands r0, r1 - b _081AFD22 - .pool -_081AFD18: - ldr r0, =0x03005d90 - 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, =0x03005d90 - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0xFB - ands r0, r1 - b _081AFD52 - .pool -_081AFD48: - ldr r0, =0x03005d90 - 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, =0x03005d90 - ldr r2, [r0] - ldrb r1, [r2, 0x9] - movs r0, 0xF7 - ands r0, r1 - b _081AFD82 - .pool -_081AFD78: - ldr r0, =0x03005d90 - 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, =0x03005d90 - 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, =0x03005d90 - 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, =0x0203cebc - movs r0, 0x90 - lsls r0, 1 - bl Alloc - str r0, [r5] - cmp r0, 0 - beq _081AFE1A - ldr r4, =0x0203cec0 - 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, =0x0203cebc - ldr r0, [r0] - bl Free - ldr r0, =0x0203cec0 - 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, =0x0203cebc - ldr r1, [r4] - bl LZDecompressWram - ldr r0, [r4] - ldr r4, =0x0203cec0 - 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 LoadObjectPic - 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 AddObjectToFront - 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, =0x0203cebc - ldr r1, [r4] - bl LZDecompressWram - ldr r0, [r4] - ldr r4, =0x0203cec0 - 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 LoadObjectPic - 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 AddObjectToFront - 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, =0x0203cec4 - 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, =0x0203cec8 - 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, =0x0203cec4 - 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, =0x0203cec4 - 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, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - bne _081B017E -_081B017A: - movs r0, 0 - strb r0, [r6, 0x9] -_081B017E: - ldr r2, =0x03003014 - 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 CallObjectCallbacks - bl PrepareSpritesForOamLoad - bl do_scheduled_bg_tilemap_copies_to_vram - bl fade_and_return_progress_probably - pop {r0} - bx r0 - thumb_func_end sub_81B01B0 - - thumb_func_start sub_81B01CC -sub_81B01CC: @ 81B01CC - push {lr} - bl LoadOamFromSprites - bl ProcessObjectCopyRequests - bl copy_pal_bg_faded_to_pal_ram - 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, =0x030022c0 - 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, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B02AC: - bl remove_some_task - b _081B0484 -_081B02B2: - bl sub_80A1A74 - ldr r2, =0x02037fd4 - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - ldr r1, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B02D4: - bl ResetAllObjectData - b _081B0484 -_081B02DA: - bl ResetObjectPaletteAllocator - ldr r1, =0x030022c0 - 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, =0x030022c0 - 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, =0x0203cec4 - 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, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B0354: - ldr r0, =0x0203cec8 - ldrb r0, [r0, 0x8] - lsls r0, 26 - lsrs r0, 30 - bl sub_81B239C - b _081B0484 - .pool -_081B0368: - ldr r0, =0x0203cec8 - ldrb r0, [r0, 0x8] - lsls r0, 26 - lsrs r0, 30 - bl sub_81B0740 - ldr r0, =0x0203cec4 - 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, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B03A0: - bl sub_81B6040 - b _081B0484 -_081B03A6: - bl sub_81B6160 - ldr r1, =0x030022c0 - 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, =0x0203cec4 - 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, =0x0203cec4 - 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, =0x030022c0 - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _081B048C - .pool -_081B0414: - ldr r0, =0x0203cec4 - 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, =0x0203cec4 - 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 sub_80A2A20 - ldr r2, =0x02037fd4 - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2, 0x8] - ldr r1, =0x030022c0 - 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 pal_fade_maybe -_081B0484: - ldr r1, =0x030022c0 - 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 pal_fade_maybe - 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, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B051C - ldr r0, =0x0203cec8 - 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, =0x0203cec4 - movs r1, 0 - str r1, [r0] - ldr r0, =0x0203cee4 - str r1, [r0] - ldr r0, =0x0203cedc - str r1, [r0] - ldr r0, =0x0203cee0 - 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, =0x0203cee4 - 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, =0x0203cec4 - 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, =0x0203cee0 - 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, =0x0203cee4 - ldr r1, [r1] - bl LZDecompressWram - b _081B069A - .pool -_081B0658: - ldr r0, =gUnknown_08D96AB4 - movs r2, 0xB0 - lsls r2, 1 - movs r1, 0 - bl decompress_palette - ldr r0, =0x02037714 - ldr r4, =0x0203cec4 - 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, =0x0203cec4 - 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, =0x02037774 - 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, =0x02037b14 - 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, =0x0203cec4 - ldr r0, [r0] - cmp r0, 0 - beq _081B0702 - bl Free -_081B0702: - ldr r0, =0x0203cee4 - ldr r0, [r0] - cmp r0, 0 - beq _081B070E - bl Free -_081B070E: - ldr r0, =0x0203cee0 - ldr r0, [r0] - cmp r0, 0 - beq _081B071A - bl Free -_081B071A: - ldr r0, =0x0203cedc - 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, =0x0203cedc - 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, =0x0203cec8 - 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, =0x02022ff8 - subs r1, r5, 0x3 - lsls r1, 5 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - bne _081B0828 - ldr r0, =0x0203cedc - lsls r4, r5, 4 - ldr r0, [r0] - adds r0, r4 - movs r1, 0x40 - bl sub_81B2748 - b _081B0836 - .pool -_081B0828: - ldr r0, =0x0203cedc - lsls r4, r5, 4 - ldr r0, [r0] - adds r0, r4 - movs r1, 0x8 - bl sub_81B2748 -_081B0836: - adds r5, r4, 0 - ldr r4, =0x0203cedc - 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, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - bne _081B089C - ldr r4, =0x0203cedc - 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, =0x0203cec8 - 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, =0x0203cec8 - 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, =0x0203cedc - 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, =0x020244ec - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0x2D - bl pokemon_getattr - adds r2, r0, 0 - cmp r2, 0 - beq _081B09A0 - ldr r6, =0x0203cedc - 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, =0x0203cedc - 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, =0x020244ec - adds r6, r2, r1 - ldr r7, =0x0203cedc - 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 pokemon_getattr - 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, =0x020244ec - adds r0, r1 - ldr r6, =0x0203cef8 - 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, =0x020244ec - 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, =0x020244ec - 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, =0x020244ec - adds r0, r1 - movs r1, 0xC - bl pokemon_getattr - 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, =0x020244ec - adds r6, r1, r0 - ldr r0, =0x0203ce7c - ldrh r4, [r0] - ldr r0, =0x0203cec8 - ldrb r0, [r0, 0xB] - cmp r0, 0xC - bne _081B0C40 - ldr r1, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x020375e2 - 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 pokemon_getattr - 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, =0x020244ec - 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, =0x0203cedc - lsls r2, r0, 4 - ldr r1, [r1] - adds r6, r1, r2 - subs r0, 0x3 - lsls r0, 24 - ldr r5, =0x02022ff8 - 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, =0x02021cc4 - adds r5, 0x4 - add r5, r8 - adds r0, r4, 0 - adds r1, r5, 0 - bl CopyString - adds r0, r4, 0 - bl GetStringEnd_Limit7 - 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, =0x0203cec4 - 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, =0x0203cee0 - 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, =0x0203cec8 - 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, =0x02022ff8 - 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, =0x0203cedc - 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, =0x02022ff8 - mov r2, r10 - lsls r0, r2, 5 - adds r0, r1 - ldrh r0, [r0] - ldr r1, =0x0203cedc - 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, =0x020244ec - adds r6, r1, r0 - adds r0, r6, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _081B0EDC - ldr r4, =0x0203cedc - 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, =0x0203cec4 - 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, =0x0203cec8 - 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, =0x0203cec4 - 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, =0x0203cec8 - 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, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _081B10E8 - ldr r6, =0x0203cedc - 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, =0x0203cec4 - ldr r0, [r0] - ldrh r0, [r0, 0x8] - lsls r0, 21 - b _081B10DA - .pool -_081B1074: - ldr r0, =0x0203cec4 - 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, =0x0203cec4 - 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, =0x020244ec - adds r0, r1 - movs r1, 0x39 - bl pokemon_getattr - 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, =0x0203cec8 - 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, =0x0203cec8 - 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, =0x02022fec - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 11 - ands r0, r1 - cmp r0, 0 - beq _081B11F6 - ldr r0, =0x030022c0 - 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, =0x0202449c - 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, =0x02022fec - ldr r0, [r0] - movs r1, 0x49 - ands r0, r1 - cmp r0, 0x49 - bne _081B1280 - ldr r0, =0x030022c0 - 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 pal_fade_maybe - ldr r1, =0x03005e00 - 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, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B134C - ldr r4, =0x0203cec8 - ldrb r1, [r4, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x1 - bne _081B131A - bl sub_81B9080 -_081B131A: - ldr r0, =0x0203cec4 - 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 ResetAllObjectData - 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, =0x0203cec8 - ldrb r0, [r0, 0x9] - bx lr - .pool - thumb_func_end brm_get_pokemon_selection - - thumb_func_start sub_81B1360 -sub_81B1360: @ 81B1360 - ldr r0, =0x0203cec8 - 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, =0x02037fd4 - 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, =0x0203cec4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - beq _081B13E0 - movs r0, 0x5 - bl audio_play - 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, =0x0203cec8 - 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, =0x0203cec8 - ldr r1, [r0, 0x4] - adds r0, r5, 0 - bl _call_via_r1 - b _081B159E - .pool -_081B142C: - ldr r0, =0x0203cec8 - 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, =0x0203cec4 - 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, =0x0203cec8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - ldr r2, =0x0203cec4 - 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, =0x03006328 - 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 audio_play - ldr r0, =0x0203cec4 - 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 audio_play - ldr r0, =0x0203cec4 - 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 audio_play - ldr r0, =0x0203cec4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - adds r0, r5, 0 - bl sub_81B7FAC - b _081B159E - .pool -_081B1560: - movs r0, 0x5 - bl audio_play - adds r0, r5, 0 - bl sub_81B3938 - b _081B159E -_081B156E: - movs r0, 0x5 - bl audio_play - 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 audio_play - 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, =0x020244ec - adds r0, r1 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0x1 - beq _081B15C4 - movs r0, 0x1 - b _081B15CC - .pool -_081B15C4: - movs r0, 0x20 - bl audio_play - 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, =0x0203cec8 - 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 audio_play - b _081B1652 -_081B1602: - movs r0, 0x5 - bl audio_play - adds r0, r4, 0 - bl sub_81B407C - b _081B1652 -_081B1610: - movs r0, 0x5 - bl audio_play - adds r0, r4, 0 - bl sub_81B2210 - b _081B1652 -_081B161E: - movs r0, 0x5 - bl audio_play - 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, =0x020375e0 - movs r0, 0x7 - strh r0, [r1] -_081B1642: - ldr r0, =0x0203cee8 - 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, =0x0203cec8 - 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, =0x0203cec4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - ldr r4, =0x02021fc4 - adds r0, r4, 0 - adds r1, r5, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =0x03005e00 - 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, =0x03005e00 - 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, =0x0203cee8 - strb r1, [r0] - ldr r1, =0x0203cec8 - 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 audio_play -_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, =0x030022c0 - 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, =0x030022c0 -_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, =0x0203cec8 - 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 audio_play - 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, =0x020244e9 - ldrb r0, [r0] - subs r0, 0x1 - b _081B1950 - .pool -_081B1898: - cmp r1, 0x7 - bne _081B18BC - ldr r0, =0x0203cec4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 31 - cmp r0, 0 - beq _081B18B0 - movs r0, 0x6 - b _081B1950 - .pool -_081B18B0: - ldr r0, =0x020244e9 - 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, =0x020244e9 - ldrb r0, [r0] - subs r0, 0x1 - cmp r1, r0 - bne _081B18F4 - ldr r0, =0x0203cec4 - 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, =0x020244e9 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081B1952 - movs r0, 0 - ldrsb r0, [r4, r0] - cmp r0, 0 - bne _081B1952 - ldr r0, =0x0203cec4 - 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, =0x0203cec4 - 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, =0x020244e9 - ldrb r0, [r0] - subs r0, 0x1 - b _081B1AF2 - .pool -_081B19A8: - cmp r0, 0x7 - bne _081B19C4 - ldr r0, =0x0203cec4 - 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, =0x0203cec4 - 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, =0x0203cec4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 28 - lsrs r6, r0, 29 - cmp r6, 0x3 - bne _081B1A54 - ldr r0, =0x02024618 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _081B1AF4 - strb r6, [r4] - b _081B1AF4 - .pool -_081B1A54: - ldr r0, =0x020245b4 - b _081B1A70 - .pool -_081B1A5C: - cmp r0, 0x1 - bne _081B1AF4 - ldr r0, =0x0203cec4 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - lsls r0, 28 - lsrs r5, r0, 29 - cmp r5, 0x5 - bne _081B1A88 - ldr r0, =0x020246e0 -_081B1A70: - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _081B1AF4 - strb r5, [r4] - b _081B1AF4 - .pool -_081B1A88: - ldr r0, =0x0202467c - movs r1, 0xB - bl pokemon_getattr - 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, =0x0203cec4 - 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, =0x0203cec4 - 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, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - 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 pokemon_getattr - adds r0, r4, 0 - bl GetStringEnd_Limit7 - 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, =0x03005e00 - 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, =0x03005e00 - 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, =0x03005e00 - 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, =0x03005e00 - 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, =0x03005e00 - 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, =0x02021cc4 - bl GetMonNickname - ldr r1, =0x02021dc4 - adds r0, r4, 0 - bl itemid_get_name - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E991B - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x02021cc4 - bl GetMonNickname - ldr r1, =0x02021dc4 - adds r0, r4, 0 - bl itemid_get_name - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E999D - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x02021cc4 - bl GetMonNickname - ldr r1, =0x02021dc4 - adds r0, r4, 0 - bl itemid_get_name - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E993A - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x02021cc4 - bl itemid_get_name - ldr r1, =0x02021dc4 - adds r0, r4, 0 - bl itemid_get_name - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E99DB - adds r0, r4, 0 - bl ExpandStringRefs - 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 pokemon_setattr -_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 pokemon_getattr - 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 bag_add_item - 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 pokemon_setattr - 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, =0x02021fc4 - ldr r1, =gUnknown_085E9A69 - bl ExpandStringRefs - 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, =0x03005e08 - 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, =0x020244ec - adds r0, r4 - movs r1, 0x39 - adds r2, r7, 0 - bl pokemon_setattr - movs r3, 0x8 - ldrsh r2, [r7, r3] - adds r0, r2, 0 - muls r0, r5 - adds r0, r4 - ldr r6, =0x0203cedc - 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, =0x02021dc4 - movs r3, 0xA - ldrsh r2, [r7, r3] - subs r1, r2 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString -_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, =0x020244ec - adds r6, r0 - mov r0, r8 - lsls r4, r0, 2 - add r4, r8 - lsls r4, 3 - ldr r0, =0x03005e08 - adds r4, r0 - adds r0, r6, 0 - movs r1, 0x39 - bl pokemon_getattr - strh r0, [r4] - adds r0, r6, 0 - movs r1, 0x3A - bl pokemon_getattr - 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, =0x03005e08 - 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 pokemon_getattr - cmp r0, 0 - bne _081B206E - movs r0, 0x7 - b _081B2096 -_081B206E: - adds r0, r4, 0 - movs r1, 0x37 - bl pokemon_getattr - 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, =0x0203cec8 - 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, =0x020375e2 - ldrh r0, [r0] - cmp r0, 0 - bne _081B20FC - movs r4, 0 - ldr r0, =0x020244e9 - ldrb r0, [r0] - cmp r4, r0 - bcs _081B2126 -_081B20C4: - movs r0, 0x64 - muls r0, r4 - ldr r1, =0x020244ec - 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, =0x020244e9 - 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, =0x020244ec - 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, =0x020244e9 - 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 pokemon_getattr - cmp r0, 0x1 - beq _081B215A - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - 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 pokemon_getattr - cmp r0, 0x1 - beq _081B2182 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - 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, =0x0203cec8 - 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 audio_play - ldr r0, =0x020375e0 - strh r5, [r0] - adds r0, r4, 0 - bl sub_81B12C0 - b _081B21FE - .pool -_081B21DC: - movs r0, 0x20 - bl audio_play - ldr r0, =gUnknown_085EA0EE - movs r1, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =0x03005e00 - 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, =0x03005e00 - 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, =0x03005e00 - 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, =0x020375e0 - movs r0, 0x7 - strh r0, [r1] - adds r0, r4, 0 - bl sub_81B12C0 - b _081B22C8 - .pool -_081B22B4: - movs r0, 0x5 - bl audio_play -_081B22BA: - ldr r0, =0x03005e00 - 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 pokemon_getattr - 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 pokemon_getattr - 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 gpu_pal_apply - ldr r0, =gUnknown_0860F074 - movs r1, 0xF0 - movs r2, 0x20 - bl gpu_pal_apply - 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, =0x0203cec8 - 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, =0x0203cec8 - 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, =0x0203cec4 - 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 gpu_pal_apply - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl gpu_pal_apply - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl gpu_pal_apply - 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 gpu_pal_apply - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl gpu_pal_apply - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl gpu_pal_apply - 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 gpu_pal_apply - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl gpu_pal_apply - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl gpu_pal_apply - 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 gpu_pal_apply - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl gpu_pal_apply - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl gpu_pal_apply - 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 gpu_pal_apply - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl gpu_pal_apply - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl gpu_pal_apply - 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 gpu_pal_apply - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl gpu_pal_apply - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl gpu_pal_apply - 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 gpu_pal_apply - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl gpu_pal_apply - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r6 - movs r2, 0x2 - bl gpu_pal_apply - 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 gpu_pal_apply - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r7 - movs r2, 0x2 - bl gpu_pal_apply - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r7 - movs r2, 0x2 - bl gpu_pal_apply - ldr r5, =gUnknown_08615AE2 - ldrb r0, [r5] - bl sub_81B2564 - ldr r4, =gUnknown_08615ABD - ldrb r1, [r4] - adds r1, r7 - movs r2, 0x2 - bl gpu_pal_apply - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r7 - movs r2, 0x2 - bl gpu_pal_apply - ldrb r0, [r5, 0x2] - bl sub_81B2564 - ldrb r1, [r4, 0x2] - adds r1, r7 - movs r2, 0x2 - bl gpu_pal_apply -_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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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, =0x02021dc4 - adds r0, r5, 0 - adds r1, r2, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r4, =0x02021cc4 - ldr r1, =gUnknown_085E8D4D - adds r0, r4, 0 - bl CopyString - adds r0, r4, 0 - adds r1, r5, 0 - bl AppendString - 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 pokemon_getattr - 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 CompareString - 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 gpu_pal_apply - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl gpu_pal_apply - 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 gpu_pal_apply - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r6 - movs r2, 0x2 - bl gpu_pal_apply - 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 pokemon_getattr - 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 pokemon_getattr - 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, =0x02021cc4 - adds r0, r5, 0 - adds r1, r2, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - 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 pokemon_getattr - 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 pokemon_getattr - 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, =0x02021dc4 - adds r0, r5, 0 - adds r1, r2, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r4, =0x02021cc4 - ldr r1, =gUnknown_085E8D3E - adds r0, r4, 0 - bl CopyString - adds r0, r4, 0 - adds r1, r5, 0 - bl AppendString - 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 pokemon_getattr - cmp r0, 0 - beq _081B2E5C - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x3A - bl pokemon_getattr - 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 gpu_pal_apply - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r7 - movs r2, 0x2 - bl gpu_pal_apply - 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 gpu_pal_apply - ldrb r0, [r5, 0x1] - bl sub_81B2564 - ldrb r1, [r4, 0x1] - adds r1, r7 - movs r2, 0x2 - bl gpu_pal_apply -_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, =0x0203cec4 - 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, =0x0203cec4 - 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, =0x02021fc4 - ldr r1, =gUnknown_08615AF4 - lsls r0, r6, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x020244ec - movs r6, 0 - ldr r0, =0x0203cec8 - 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 pokemon_getattr - cmp r0, 0 - beq _081B319A - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - bne _081B3194 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - 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, =0x0203cec4 - 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, =0x0203cec4 - 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, =0x0203cec4 - 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, =0x03003014 - 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, =0x0203cec4 - 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, =0x0203cec4 - 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, =0x0203cec4 - 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, =0x0203cec4 - 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 pokemon_getattr - lsls r1, r4, 1 - adds r1, r5 - ldrh r1, [r1] - cmp r0, r1 - bne _081B3490 - ldr r0, =0x0203cec4 - 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 pokemon_getattr - cmp r0, 0 - beq _081B34D2 - ldr r0, =0x0203cec4 - 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 pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - bl itemid_is_mail - lsls r0, 24 - cmp r0, 0 - beq _081B3508 - ldr r0, =0x0203cec4 - 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, =0x0203cec4 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xF - adds r1, 0x17 - movs r2, 0x3 - bl append_byte -_081B3518: - ldr r0, =0x0203cec4 - 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, =0x0203cec8 - 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 pokemon_getattr - 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 pokemon_getattr - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r4, r1] - movs r0, 0x64 - muls r0, r1 - ldr r7, =0x020244ec - adds r5, r0, r7 - ldr r1, =0x02021cc4 - adds r0, r5, 0 - bl GetMonNickname - ldr r0, =0x0203cec4 - 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 pokemon_getattr - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0 - bne _081B36C0 - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E9980 - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =0x03005e00 - 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, =0x02021dc4 - adds r0, r6, 0 - bl itemid_get_name - 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, =0x03005e00 - 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, =0x02037fd4 - 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, =0x03005e08 - adds r5, r0, r1 - ldr r0, =0x0203cec4 - 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 audio_play - ldr r4, =0x0203cec4 - 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, =0x0203cec4 - 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 audio_play - ldr r0, =0x0203cec4 - 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, =0x0203cec8 - ldrb r1, [r4, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x1 - bne _081B3868 - bl pokemon_change_order - ldr r1, =0x020244ec - ldrb r2, [r4, 0x9] - ldr r0, =0x020244e9 - 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, =0x020244ec - ldrb r2, [r4, 0x9] - ldr r0, =0x020244e9 - 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, =0x02037fd4 - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - ldr r3, =0x0203cec8 - ldr r0, =0x0203cf20 - 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 audio_play - ldr r5, =0x0203cec8 - movs r0, 0x8 - strb r0, [r5, 0xB] - ldr r4, =0x0203cec4 - 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, =0x03005e00 - 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, =0x03005e08 - adds r6, r0, r1 - ldr r3, =0x0203cec8 - 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, =0x0203cedc - 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, =0x0203cec8 - ldrb r0, [r0, 0xA] - lsls r0, 24 - asrs r0, 24 - ldr r1, =0x0203cedc - 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, =0x0203cef0 - 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, =0x0203cef4 - 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, =0x0203cec8 - 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, =0x03005e00 - 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, =0x02020630 - 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, =0x03005e08 - adds r4, r1, r0 - movs r1, 0x14 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _081B3C8E - ldr r2, =0x0203cedc - ldr r0, =0x0203cec8 - 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, =0x0203cedc - ldr r0, =0x0203cec8 - 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, =0x03005e08 - adds r5, r1, r0 - movs r1, 0x14 - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _081B3D00 - ldr r0, =0x0203cef0 - 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, =0x0203cef4 - 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, =0x03005e08 - 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, =0x0203cec8 - ldrb r0, [r4, 0x9] - bl sub_81B0948 - ldrb r0, [r4, 0xA] - bl sub_81B0948 - movs r0, 0x9 - ldrsb r0, [r4, r0] - ldr r5, =0x0203cedc - 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, =0x0203cef0 - 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, =0x0203cef4 - 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, =0x03005e08 - 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, =0x0203cec8 - movs r0, 0x9 - ldrsb r0, [r5, r0] - ldr r4, =0x0203cedc - 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, =0x0203cef0 - ldr r0, [r0] - bl Free - ldr r0, =0x0203cef4 - 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, =0x02020630 - 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, =0x0203cedc - ldr r2, =0x0203cec8 - 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, =0x020244ec - 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, =0x0203cec4 - ldr r0, [r0] - adds r0, 0xD - bl sub_81B302C - ldr r4, =0x0203cec8 - 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, =0x03005e00 - 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 audio_play - ldr r4, =0x0203cec4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r0, =0x0203cec8 - 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, =0x03005e00 - 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 audio_play - ldr r4, =0x0203cec4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r0, =0x020244ec - ldr r1, =0x0203cec8 - 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, =0x03005e00 - 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 audio_play - ldr r0, =0x0203cec4 - 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, =0x0203ce7c - ldrh r0, [r6] - cmp r0, 0 - bne _081B4224 - ldr r3, =0x0203cec8 - 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, =0x0203cefc - ldr r5, =0x0203cec8 - 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, =0x020244ec - adds r0, r7 - movs r1, 0xC - bl pokemon_getattr - 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 remove_item - 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, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B432C - ldr r0, =0x0203ce7c - ldrh r4, [r0] - ldr r0, =0x0203cec8 - mov r8, r0 - ldrb r0, [r0, 0x9] - lsls r0, 24 - asrs r0, 24 - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - 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 remove_item - ldr r1, =0x03005e00 - 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, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B4388 - ldr r0, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x0203cefc - ldrh r1, [r1] - movs r2, 0x1 - bl sub_81B1D1C - ldr r1, =0x03005e00 - 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, =0x03005e00 - 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, =0x0203ce7c - ldrh r0, [r5] - movs r1, 0x1 - bl remove_item - ldr r6, =0x0203cefc - ldrh r0, [r6] - movs r1, 0x1 - bl bag_add_item - lsls r0, 24 - cmp r0, 0 - bne _081B4458 - ldrh r0, [r5] - movs r1, 0x1 - bl bag_add_item - ldrh r0, [r6] - bl pokemon_item_not_removed - ldr r0, =0x02021fc4 - movs r1, 0 - bl sub_81B1B5C - ldr r1, =0x03005e00 - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldrh r1, [r5] - bl sub_81B1DB8 - ldr r1, =0x03005e00 - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldrh r1, [r5] - bl sub_81B1DB8 - ldrh r0, [r5] - ldrh r1, [r6] - movs r2, 0x1 - bl sub_81B1D68 - ldr r1, =0x03005e00 - 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 audio_play -_081B44DE: - ldr r0, =0x03005e00 - 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, =0x0203cec4 - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x40 - bl pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005d8c - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r6, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0xC - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldr r0, =0x020375f0 - ldrh r7, [r0] - cmp r7, 0 - bne _081B45F8 - adds r0, r5, 0 - bl sub_80D4680 - ldr r4, =0x0203cefc - adds r0, r5, 0 - movs r1, 0xC - adds r2, r4, 0 - bl pokemon_setattr - ldrh r0, [r4] - movs r1, 0x1 - bl remove_item - mov r0, r8 - movs r1, 0x1 - bl bag_add_item - 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, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B468A - ldr r1, =0x0203cefc - ldrh r0, [r1] - cmp r0, 0 - bne _081B4670 - ldr r0, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x0203ce7c - ldrh r1, [r1] - movs r2, 0 - movs r3, 0 - bl sub_81B1C84 - b _081B467C - .pool -_081B4670: - ldr r0, =0x0203ce7c - ldrh r0, [r0] - ldrh r1, [r1] - movs r2, 0 - bl sub_81B1D68 -_081B467C: - ldr r0, =0x03005e00 - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r4, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r6, r1, r0 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B471C - ldr r5, =0x0203cedc - 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 pokemon_getattr - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0xC - bl pokemon_getattr - lsls r0, 16 - lsrs r6, r0, 16 - movs r0, 0x5 - bl audio_play - ldr r4, =0x0203cec4 - 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, =0x02021cc4 - adds r0, r5, 0 - bl GetMonNickname - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E9980 - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - b _081B47B4 - .pool -_081B47AC: - adds r0, r6, 0 - bl pokemon_item_not_removed - ldr r0, =0x02021fc4 -_081B47B4: - movs r1, 0x1 - bl sub_81B1B5C -_081B47BA: - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =0x03005e00 - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r7, r1, r0 - adds r0, r7, 0 - movs r1, 0xC - bl pokemon_getattr - lsls r0, 16 - lsrs r5, r0, 16 - movs r0, 0x5 - bl audio_play - ldr r4, =0x0203cec4 - 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, =0x02021cc4 - adds r0, r7, 0 - bl GetMonNickname - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E9980 - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =0x03005e00 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B469C - b _081B488A - .pool -_081B4864: - ldr r1, =0x02021cc4 - adds r0, r5, 0 - bl itemid_get_name - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E9E00 - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =0x03005e00 - 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, =0x03005e00 - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - 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 pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x02021cc4 - bl itemid_get_name - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E9E14 - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0 - bl sub_81B1B5C - ldr r1, =0x03005e00 - 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 audio_play -_081B496A: - ldr r0, =0x03005e00 - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r6, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - 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 pokemon_setattr - ldr r4, =0x0203cedc - 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, =0x03005e00 - 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 audio_play - ldr r4, =0x0203cec4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r0, =0x020244ec - ldr r1, =0x0203cec8 - 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, =0x03005e00 - 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 audio_play - ldr r0, =0x0203cec4 - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x40 - bl pokemon_getattr - ldr r2, =0x03005d8c - 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, =0x02037fd4 - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2, 0x8] - ldr r3, =0x0203cec8 - 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 audio_play - ldr r5, =0x0203cec4 - 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, =0x03005e00 - 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, =0x03005e00 - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - 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, =0x03005e00 - 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, =0x03005e00 - 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 audio_play -_081B4C36: - ldr r0, =gUnknown_085E98B4 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =0x03005e00 - 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, =0x03005e00 - 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, =0x0203cec8 - mov r8, r0 - ldrb r0, [r0, 0x9] - lsls r0, 24 - asrs r0, 24 - movs r7, 0x64 - muls r0, r7 - ldr r6, =0x020244ec - adds r0, r6 - movs r1, 0xC - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r4, 0 - movs r1, 0x1 - bl bag_add_item - 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, =0x03005e00 - 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, =0x02021fc4 - movs r1, 0 - bl sub_81B1B5C - ldr r1, =0x03005e00 - 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 audio_play -_081B4D56: - ldr r0, =0x03005e00 - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r5, r1] - movs r0, 0x64 - muls r0, r1 - ldr r6, =0x020244ec - adds r7, r0, r6 - movs r0, 0x5 - bl audio_play - ldr r4, =0x0203cec4 - 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 pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x02021dc4 - bl itemid_get_name - movs r0, 0x1A - bl display_pokemon_menu_message -_081B4E02: - ldr r1, =0x03005e00 - 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 audio_play - ldr r5, =0x0203cec4 - 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, =0x02021fc4 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =0x03005e00 - 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, =0x0203cec4 - 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, =0x0203cec8 - ldr r1, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - mov r8, r0 -_081B4EC6: - ldr r0, =0x0203cef8 - adds r4, r5, r0 - ldrb r0, [r4] - cmp r0, 0 - bne _081B4F2C - movs r0, 0x5 - str r2, [sp] - bl audio_play - 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, =0x0203cedc - 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, =0x02021cc4 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E9830 - adds r0, r4, 0 - bl ExpandStringRefs - movs r0, 0x20 - bl audio_play - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =0x03005e00 - 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, =0x0203cec8 - 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 audio_play - ldr r4, =0x0203cec4 - 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, =0x0203cef8 - subs r2, r5, 0x1 - adds r7, r6, 0 - ldr r3, =0x0203cec8 -_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, =0x0203cedc - ldr r0, =0x0203cec8 - 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, =0x0203cef8 - 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, =0x03005e00 - 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 audio_play - 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, =0x0203cec8 - 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, =0x020244ec - adds r0, r4 - movs r1, 0x41 - bl pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 audio_play - adds r0, r7, 0 - bl sub_81B12C0 - b _081B51B0 - .pool -_081B515C: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085EA210 - bl ExpandStringRefs - b _081B5178 - .pool -_081B5170: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085EA234 - bl ExpandStringRefs -_081B5178: - movs r0, 0x20 - bl audio_play - ldr r4, =0x0203cec4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EA1CA - adds r0, r4, 0 - bl AppendString - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =0x03005e00 - 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, =0x0203cec8 - mov r8, r0 - ldrb r0, [r0, 0x9] - lsls r0, 24 - asrs r0, 24 - movs r6, 0x64 - muls r0, r6 - ldr r4, =0x020244ec - adds r0, r4 - movs r1, 0x41 - bl pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_800F7DC - ldr r0, [r0] - ldr r1, =0x02022c38 - ldr r1, [r1] - ldr r2, =0x02022c3c - ldrh r3, [r2] - ldr r2, =0x02022c3e - 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, =0x02021fc4 - ldr r1, =gUnknown_08615E0C - subs r0, 0x1 - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r5, 0 - bl ExpandStringRefs - movs r0, 0x20 - bl audio_play - ldr r4, =0x0203cec4 - 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 AppendString - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =0x03005e00 - 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 audio_play - 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, =0x0203cec4 - ldr r0, [r4] - adds r0, 0xC - bl sub_81B302C - ldr r0, [r4] - adds r0, 0xD - bl sub_81B302C - ldr r0, =0x020244ec - ldr r1, =0x0203cec8 - 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, =0x02021fc4 - ldr r1, =gUnknown_085EA1E8 - bl ExpandStringRefs - b _081B53C0 - .pool -_081B5340: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085EA210 - bl ExpandStringRefs - b _081B53C0 - .pool -_081B5354: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085EA234 - bl ExpandStringRefs - b _081B53C0 - .pool -_081B5368: - movs r0, 0x5 - bl audio_play - ldr r0, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02021cc4 - bl GetMonNickname - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EA1CD - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =0x03005e00 - 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 audio_play - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085EA1CA - adds r0, r4, 0 - bl AppendString - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =0x03005e00 - 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, =0x03005e00 - 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 audio_play -_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, =0x0203cec4 - 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 audio_play - 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, =0x03005e00 - 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, =0x03005d8c - 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, =0x02021cc4 - ldrb r1, [r1, 0x14] - bl sub_81245DC - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085EA196 - b _081B55E8 - .pool -_081B55B8: - ldr r0, =0x03005d8c - 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, =0x02021cc4 - ldrb r1, [r1, 0x14] - bl sub_81245DC - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085EA16B -_081B55E8: - bl ExpandStringRefs - adds r0, r6, 0 - bl sub_81B5674 - ldr r0, =0x0203cec4 - ldr r0, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r0, r1 - strh r4, [r0] - b _081B5664 - .pool -_081B5614: - ldr r1, =0x0203cec8 - ldr r0, =sub_8124690 - b _081B5628 - .pool -_081B5624: - ldr r1, =0x0203cec8 - 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, =0x03005e00 - 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, =0x02021fc4 - movs r1, 0x1 - bl sub_81B1B5C - ldr r1, =0x03005e00 - 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, =0x03005e00 - 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, =0x0203cec8 - 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 audio_play -_081B571A: - ldr r0, =0x03005db0 - movs r1, 0 - str r1, [r0] - ldr r0, =0x0203ceec - 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, =0x02038c08 - lsls r0, 16 - lsrs r0, 16 - str r0, [r1] - ldr r0, =0x0203ceec - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - 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, =0x030022c0 - 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, =0x02038c08 - 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, =0x03005db0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =0x0203ceec - 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, =0x02037318 - 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, =0x02038c08 - 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, =0x03005db0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =0x0203ceec - 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, =0x02038c08 - 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, =0x02038c08 - lsls r0, 24 - lsrs r0, 24 - str r0, [r1, 0x4] - cmp r0, 0 - bne _081B5990 - movs r0, 0 - b _081B599E - .pool -_081B5990: - ldr r1, =0x03005db0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =0x0203ceec - 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, =0x030022c0 - 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 pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0 - bl pokemon_getattr - 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, =0x02020630 - 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, =0x02020630 - 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, =0x02020630 - 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, =0x02020630 - 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, =0x02020630 - 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, =0x02020630 - 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 pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r6, 0 - movs r1, 0x3A - bl pokemon_getattr - 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, =0x02020630 - 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 pokemon_getattr - 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 AddObjectToFront - 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 AddObjectToFront - strb r0, [r4, 0xA] - ldr r2, =0x02020630 - 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 pokemon_getattr - 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, =0x02020630 - 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, =0x02020630 - adds r0, r1 - movs r1, 0x1 - bl StartObjectImageAnim - b _081B5D0E - .pool -_081B5CFC: - ldrb r1, [r4, 0xA] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x02020630 - adds r0, r1 - movs r1, 0 - bl StartObjectImageAnim -_081B5D0E: - ldr r2, =0x02020630 - 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 LoadObjectPic - ldr r0, =gUnknown_08615EB8 - bl LoadTaggedObjectPalette - 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, =0x020244ec - adds r0, r1 - movs r1, 0xC - bl pokemon_getattr - 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, =0x02024744 - adds r0, r1 - movs r1, 0xC - bl pokemon_getattr - 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, =0x02020630 - 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 AddObjectToFront - 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 StartObjectImageAnim - 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, =0x02020630 - 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 pokemon_getattr - 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 AddObjectToFront - 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 AddObjectToFront - strb r0, [r4, 0xB] - ldr r2, =0x02020630 - 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 AddObjectToFront - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x02020630 - 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 AddObjectToFront - 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, =0x02020630 - adds r0, r2 - bl StartObjectImageAnim - 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, =0x02020630 - mov r8, r0 - add r4, r8 - adds r0, r4, 0 - movs r1, 0x2 - bl StartObjectImageAnim - lsls r5, r7, 4 - adds r5, r7 - lsls r5, 2 - add r5, r8 - adds r0, r5, 0 - movs r1, 0x4 - bl StartObjectImageAnim - strh r6, [r4, 0x26] - strh r6, [r5, 0x26] - b _081B602C - .pool -_081B6000: - lsls r5, r0, 4 - adds r5, r0 - lsls r5, 2 - ldr r0, =0x02020630 - mov r8, r0 - add r5, r8 - adds r0, r5, 0 - movs r1, 0x3 - bl StartObjectImageAnim - lsls r4, r7, 4 - adds r4, r7 - lsls r4, 2 - add r4, r8 - adds r0, r4, 0 - movs r1, 0x5 - bl StartObjectImageAnim - 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 pokemon_getattr - 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 AddObjectToFront - 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 AddObjectToFront - strb r0, [r4, 0xC] - adds r0, r5, 0 - adds r1, r4, 0 - bl party_menu_update_status_condition_object - ldr r2, =0x02020630 - 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, =0x02020630 - 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, =0x02020630 - adds r0, r4 - subs r1, r2, 0x1 - lsls r1, 24 - lsrs r1, 24 - bl StartObjectImageAnim - 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, =0x030022c0 - 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, =0x0203cec8 - strb r5, [r0, 0x9] - b _081B6204 - .pool -_081B61BC: - movs r7, 0 - movs r6, 0 -_081B61C0: - ldr r4, =0x0203ce7c - ldrh r0, [r4] - bl GetItemEffectType - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xA - bne _081B621C - ldr r1, =0x0203cec8 - movs r0, 0 - strb r0, [r1, 0x9] - movs r5, 0 -_081B61D8: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _081B61FA - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - 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 sub_80D6C68 - 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, =0x0203cf30 - 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, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B62B2 - ldr r0, =0x0203cec8 - ldrb r1, [r0, 0x8] - movs r0, 0xF - ands r0, r1 - cmp r0, 0x1 - bne _081B62A6 - ldr r0, =0x0203cec4 - ldr r1, [r0] - ldr r0, =sub_81B9140 - str r0, [r1, 0x4] -_081B62A6: - ldr r0, =0x03006328 - 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, =0x03005d8c - 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, =0x02021fc4 - ldr r1, =gUnknown_085E9C3E - bl ExpandStringRefs - b _081B64C4 - .pool -_081B6394: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E9C7C - bl ExpandStringRefs - b _081B64C4 - .pool -_081B63A8: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E9C8A - bl ExpandStringRefs - b _081B64C4 - .pool -_081B63BC: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E9CA2 - bl ExpandStringRefs - b _081B64C4 - .pool -_081B63D0: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E9C5F - bl ExpandStringRefs - b _081B64C4 - .pool -_081B63E4: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E9DBE - bl ExpandStringRefs - b _081B64C4 - .pool -_081B63F8: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E9DE1 - bl ExpandStringRefs - b _081B64C4 - .pool -_081B640C: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E9CE0 - bl ExpandStringRefs - b _081B64C4 - .pool -_081B6420: - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085E96E3 - b _081B6474 - .pool -_081B6430: - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085EA33C - b _081B6474 - .pool -_081B6440: - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085EA343 - b _081B6474 - .pool -_081B6450: - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085EA35B - b _081B6474 - .pool -_081B6460: - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085E96E6 - b _081B6474 - .pool -_081B6470: - ldr r0, =0x02021dc4 - ldr r1, =gUnknown_085E96EE -_081B6474: - bl CopyString - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E9D25 - bl ExpandStringRefs - b _081B64C4 - .pool -_081B6494: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E9CF5 - bl ExpandStringRefs - b _081B64C4 - .pool -_081B64A8: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E9CB7 - bl ExpandStringRefs - b _081B64C4 - .pool -_081B64BC: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E96F6 - bl ExpandStringRefs -_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 pokemon_getattr - 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, =0x030022c0 - 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, =0x020244ec - 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, =0x020244ec - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - ldr r0, =0x0203ce7c - 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 pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - adds r0, r5, 0 - movs r1, 0x3A - bl pokemon_getattr - cmp r10, r0 - bne _081B65EE - movs r1, 0 - mov r8, r1 -_081B65EE: - ldr r4, =0x0203cec8 - ldrb r0, [r4, 0x9] - adds r1, r6, 0 - movs r2, 0 - bl ExecuteTableBasedItemEffect__ - lsls r0, 24 - cmp r0, 0 - beq _081B6624 -_081B6600: - ldr r1, =0x0203cee8 - movs r0, 0 - strb r0, [r1] - movs r0, 0x5 - bl audio_play - ldr r0, =gUnknown_085E96F6 - b _081B66F4 - .pool -_081B6624: - ldr r1, =0x0203cee8 - movs r0, 0x1 - strb r0, [r1] - adds r0, r6, 0 - bl IsBlueYellowRedFlute - lsls r0, 24 - cmp r0, 0 - bne _081B6650 - movs r0, 0x1 - bl audio_play - ldrb r0, [r4, 0xB] - cmp r0, 0xE - beq _081B6656 - adds r0, r6, 0 - movs r1, 0x1 - bl remove_item - b _081B6656 - .pool -_081B6650: - movs r0, 0x75 - bl audio_play -_081B6656: - ldr r4, =0x0203cedc - ldr r7, =0x0203cec8 - 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, =0x02020630 - 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 pokemon_getattr - 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, =0x02021cc4 - adds r0, r5, 0 - bl GetMonNickname - adds r0, r6, 0 - bl GetMedicineItemEffectMessage - ldr r0, =0x02021fc4 -_081B66F4: - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =0x03005e00 - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02021cc4 - bl GetMonNickname - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E9C17 - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x03005e00 - 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, =0x0203cee8 - ldrb r1, [r0] - cmp r1, 0 - bne _081B67B4 - ldr r0, =0x0203cec4 - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r4, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - ldr r0, =0x0203ce7c - ldrh r6, [r0] - adds r0, r6, 0 - bl GetItemEffectType - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r5, 0 - movs r1, 0x20 - bl pokemon_getattr - 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 pokemon_getattr - 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, =0x0203cee8 - movs r0, 0 - strb r0, [r1] - movs r0, 0x5 - bl audio_play - ldr r0, =gUnknown_085E96F6 - b _081B68E2 - .pool -_081B6874: - ldr r1, =0x0203cee8 - movs r0, 0x1 - strb r0, [r1] - movs r0, 0x1 - bl audio_play - adds r0, r6, 0 - movs r1, 0x1 - bl remove_item - ldr r1, =0x02021cc4 - adds r0, r5, 0 - bl GetMonNickname - ldr r1, =0x02021dc4 - 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, =0x02021fc4 - ldr r1, =gUnknown_085E9D45 - bl ExpandStringRefs - b _081B68E0 - .pool -_081B68C4: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E9D90 - bl ExpandStringRefs - b _081B68E0 - .pool -_081B68D8: - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E9D6D - bl ExpandStringRefs -_081B68E0: - ldr r0, =0x02021fc4 -_081B68E2: - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =0x03005e00 - 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 pokemon_getattr - 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 pokemon_getattr - 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 CopyString - b _081B6A08 - .pool -_081B6A00: - ldr r1, =gUnknown_085E96EE - adds r0, r2, 0 - bl CopyString -_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, =0x020244ec - mov r9, r0 -_081B6A40: - adds r1, r5, 0 - adds r1, 0xD - mov r0, r8 - add r0, r9 - bl pokemon_getattr - 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 audio_play - adds r0, r4, 0 - bl sub_81B6BB4 - b _081B6AF0 -_081B6AE0: - ldr r0, =0x0203cec4 - 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, =0x0203ce7c - ldrh r0, [r0] - cmp r0, 0xAF - bne _081B6B20 - ldr r0, =0x03005d8c - 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, =0x0203cec8 - strh r1, [r0, 0xE] - adds r0, r4, 0 - bl ether_effect_related - b _081B6B6E - .pool -_081B6B4C: - movs r0, 0x5 - bl audio_play - movs r0, 0x16 - bl display_pokemon_menu_message - ldr r0, =0x0203cec8 - ldrb r0, [r0, 0x9] - bl sub_81B6A10 - ldr r1, =0x03005e00 - 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, =0x0203cec4 - ldr r0, [r0] - adds r0, 0xC - bl sub_81B302C - bl GetMenuCursorPos - ldr r1, =0x0203cec8 - 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, =0x03005e00 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =sub_81B1370 - str r0, [r1] - ldr r0, =0x0203cec4 - 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, =0x0203ced6 - ldr r0, =0x0203ce7c - 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, =0x0203cee8 - strb r4, [r0] - movs r0, 0x5 - bl audio_play - ldr r0, =gUnknown_085E96F6 - b _081B6C7E - .pool -_081B6C34: - ldr r1, =0x0203cee8 - 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, =0x020244ec - adds r4, r0 - movs r0, 0x1 - bl audio_play - adds r0, r5, 0 - movs r1, 0x1 - bl remove_item - movs r0, 0 - ldrsh r1, [r7, r0] - adds r1, 0xD - adds r0, r4, 0 - bl pokemon_getattr - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x02021cc4 - movs r1, 0xD - muls r1, r4 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - adds r0, r5, 0 - bl GetMedicineItemEffectMessage - ldr r0, =0x02021fc4 -_081B6C7E: - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =0x03005e00 - 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 audio_play - movs r0, 0x17 - bl display_pokemon_menu_message - ldr r0, =0x0203cec8 - ldrb r0, [r0, 0x9] - bl sub_81B6A10 - ldr r1, =0x03005e00 - 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 pokemon_getattr - 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, =0x02021fc4 - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x03005e00 - 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 audio_play - ldr r7, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r7, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - movs r0, 0xE - adds r0, r7 - mov r8, r0 - ldr r0, =0x0203ce7c - ldrh r4, [r0] - ldr r1, =0x02021cc4 - adds r0, r5, 0 - bl GetMonNickname - adds r0, r4, 0 - bl ItemIdToBattleMoveId - strh r0, [r7, 0xE] - ldr r0, =0x02021dc4 - movs r1, 0xE - ldrsh r2, [r7, r1] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - 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, =0x03005e00 - 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, =0x03005e00 - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r2, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - adds r6, r2, 0 - adds r6, 0xE - ldr r0, =0x0203ce7c - 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 remove_item -_081B6EF0: - ldr r1, =0x02021cc4 - adds r0, r5, 0 - bl GetMonNickname - ldr r0, =0x02021dc4 - movs r1, 0 - ldrsh r2, [r6, r1] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E9AA5 - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =0x03005e00 - 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 fanfare_play - ldr r1, =0x03005e00 - 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 task_is_not_running_overworld_fanfare - lsls r0, 24 - cmp r0, 0 - beq _081B6FEA - ldr r0, =0x030022c0 - 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, =0x0203cec8 - 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, =0x020375f0 - 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, =0x03005e00 - 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, =0x03005e00 - 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 audio_play -_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, =0x0203cec4 - 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, =0x020244ec - ldr r4, =0x0203cec8 - ldrb r1, [r4, 0x9] - ldr r2, =0x020244e9 - 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, =0x0203cec8 - 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, =0x02037fd4 - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - adds r5, r1, 0 - muls r5, r0 - ldr r0, =0x020244ec - adds r5, r0 - bl sub_81C1B94 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r1, 0xD - adds r0, r5, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r1, =0x02021cc4 - adds r0, r5, 0 - bl GetMonNickname - ldr r0, =0x02021dc4 - movs r1, 0xD - muls r1, r4 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - ldr r0, =gUnknown_085E9BB8 - bl sub_81B6D74 - ldr r1, =0x03005e00 - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r5, r1] - movs r0, 0x64 - adds r4, r1, 0 - muls r4, r0 - ldr r0, =0x020244ec - 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, =0x02021dc4 - ldr r1, =0x0203cec8 - movs r3, 0xE - ldrsh r2, [r1, r3] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E9B5D - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =0x03005e00 - 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, =0x03005e00 - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r7, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - 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, =0x02021cc4 - adds r0, r4, 0 - bl GetMonNickname - ldr r0, =0x02021dc4 - movs r1, 0xE - ldrsh r2, [r7, r1] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E9B76 - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r3, 0x10 - ldrsh r0, [r7, r3] - cmp r0, 0x1 - bne _081B7368 - ldr r0, =0x03005e00 - 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, =0x020375f0 - strh r5, [r0] -_081B7370: - ldr r0, =0x03005e00 - 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 audio_play -_081B7392: - ldr r1, =0x02021cc4 - adds r0, r4, 0 - bl GetMonNickname - ldr r0, =0x02021dc4 - ldr r1, =0x0203cec8 - movs r3, 0xE - ldrsh r2, [r1, r3] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - ldr r0, =gUnknown_085E9AE9 - bl sub_81B6D74 - ldr r1, =0x03005e00 - 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, =0x0203cec8 - mov r9, r0 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - ldr r0, =0x0203cec4 - ldr r6, [r0] - movs r1, 0x86 - lsls r1, 2 - adds r4, r6, r1 - ldr r2, =0x0203ce7c - mov r8, r2 - adds r0, r5, 0 - movs r1, 0x38 - bl pokemon_getattr - 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 audio_play - cmp r4, 0 - beq _081B74B4 - ldr r1, =0x0203cee8 - 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, =0x03005e00 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - mov r1, r10 - b _081B7516 - .pool -_081B74B4: - ldr r1, =0x0203cee8 - movs r0, 0x1 - strb r0, [r1] - movs r0, 0 - bl pause_music_for_sound_maybe - ldr r0, =0x0203cec8 - ldrb r0, [r0, 0x9] - adds r1, r5, 0 - bl sub_81B754C - ldr r0, =0x0203ce7c - ldrh r0, [r0] - movs r1, 0x1 - bl remove_item - ldr r1, =0x02021cc4 - adds r0, r5, 0 - bl GetMonNickname - ldr r4, =0x02021dc4 - adds r0, r5, 0 - movs r1, 0x38 - bl pokemon_getattr - adds r1, r0, 0 - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E9D0A - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =0x03005e00 - 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, =0x0203cedc - 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, =0x02020630 - 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 ducking_tick - lsls r0, 24 - cmp r0, 0 - beq _081B7620 - bl sub_81B1BD4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081B7620 - ldr r0, =0x030022c0 - 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 audio_play - adds r0, r4, 0 - bl sub_81B767C - ldr r0, =0x03005e00 - 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, =0x030022c0 - 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 audio_play - adds r0, r4, 0 - bl sub_81B76C8 - ldr r0, =0x03005e00 - 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, =0x0203cec4 - 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, =0x0203cec4 - 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 ducking_tick - lsls r0, 24 - cmp r0, 0 - beq _081B77A6 - ldr r0, =0x030022c0 - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r4, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - 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, =0x03005e00 - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r6, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - 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, =0x030061e8 - 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, =0x03005e00 - 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, =0x0203cec8 - mov r8, r0 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02021cc4 - bl GetMonNickname - ldr r0, =0x02021dc4 - ldr r6, =0x020244e2 - ldrh r2, [r6] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E9AE9 - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x03005e00 - 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, =0x0203cec8 - mov r8, r0 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02021cc4 - bl GetMonNickname - ldr r0, =0x02021dc4 - movs r1, 0xD - muls r1, r5 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E9AA5 - adds r0, r4, 0 - bl ExpandStringRefs - 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, =0x03005e00 - 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 pokemon_getattr - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0x3B - bl pokemon_getattr - strh r0, [r5, 0x2] - adds r0, r4, 0 - movs r1, 0x3C - bl pokemon_getattr - strh r0, [r5, 0x4] - adds r0, r4, 0 - movs r1, 0x3E - bl pokemon_getattr - strh r0, [r5, 0x8] - adds r0, r4, 0 - movs r1, 0x3F - bl pokemon_getattr - strh r0, [r5, 0xA] - adds r0, r4, 0 - movs r1, 0x3D - bl pokemon_getattr - 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, =0x0203cec4 - 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, =0x0203cec8 - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r6, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _081B7A6E - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - lsls r0, 16 - lsrs r7, r0, 16 - ldrb r0, [r6, 0x9] - ldr r1, =0x0203ce7c - ldrh r1, [r1] - movs r2, 0 - bl ExecuteTableBasedItemEffect__ - lsls r0, 24 - cmp r0, 0 - beq _081B7A94 -_081B7A6E: - ldr r0, =0x03005e00 - 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 audio_play - ldr r4, =0x0203cedc - 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, =0x02020630 - 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, =0x0203cec4 - 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 pokemon_getattr - 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, =0x0203cec4 - ldr r2, [r5] - movs r0, 0x86 - lsls r0, 2 - adds r1, r2, r0 - movs r3, 0 - ldrsh r0, [r1, r3] - ldr r3, =0x0203cec8 - 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, =0x0203cee8 - 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, =0x0203cee8 - movs r0, 0x1 - strb r0, [r1] - ldr r0, =0x0203ce7c - ldrh r0, [r0] - movs r1, 0x1 - bl remove_item -_081B7BD8: - ldr r1, =0x03005e00 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81B6794 - str r1, [r0] - ldr r1, =0x0203cec8 - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x02021cc4 - bl GetMonNickname - ldr r4, =0x02021fc4 - ldr r1, =gUnknown_085E9C17 - adds r0, r4, 0 - bl ExpandStringRefs - adds r0, r4, 0 - movs r1, 0 - bl sub_81B1B5C - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =0x03005e00 - 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 audio_play - ldr r2, =0x030061e8 - ldr r1, =0x0203cec8 - ldr r0, [r1] - str r0, [r2] - ldrb r0, [r1, 0x9] - ldr r4, =0x0203ce7c - ldrh r1, [r4] - movs r2, 0 - bl ExecuteTableBasedItemEffect__ - lsls r0, 24 - cmp r0, 0 - beq _081B7CD8 - ldr r1, =0x0203cee8 - 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, =0x03005e00 - 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 remove_item - 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, =0x03005d8c - 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, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B7F1C - ldr r7, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r7, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - movs r0, 0xE - adds r0, r7 - mov r8, r0 - ldr r1, =0x02021cc4 - adds r0, r5, 0 - bl GetMonNickname - ldr r4, =0x020375e2 - ldrb r0, [r4] - bl sub_81B2360 - strh r0, [r7, 0xE] - ldr r0, =0x02021dc4 - movs r1, 0xE - ldrsh r2, [r7, r1] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - 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, =0x03005e00 - 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, =0x0203cec8 - ldr r0, =0x0203ce7c - 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, =0x0203cefc - ldr r0, =0x0203cec8 - 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, =0x020244ec - adds r0, r7 - movs r1, 0xC - bl pokemon_getattr - 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, =0x03005e00 - 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, =0x0203cec8 - 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, =0x0203cec4 - 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, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B80E4 - ldr r4, =0x0203cec8 - 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, =0x020244ec - 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, =0x03005e00 - 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, =0x0203cec8 - 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, =0x020244ec - adds r0, r1 - ldr r1, =0x0203cedc - 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, =0x0203cec8 - movs r0, 0x9 - ldrsb r0, [r4, r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - 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 pokemon_getattr - lsls r0, 24 - lsrs r0, 24 - ldr r1, =0x03005d8c - 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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r6, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0xC - bl pokemon_getattr - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, =0x020375f0 - ldrh r0, [r0] - cmp r0, 0 - bne _081B8208 - adds r0, r5, 0 - bl sub_80D4680 - ldr r4, =0x0203cefc - adds r0, r5, 0 - movs r1, 0xC - adds r2, r4, 0 - bl pokemon_setattr - ldrh r0, [r4] - movs r1, 0x1 - bl remove_item - 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, =0x02037fd4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081B828A - ldr r1, =0x0203cefc - ldrh r0, [r1] - cmp r0, 0 - beq _081B8264 - ldr r0, =0x0203cec8 - ldrh r0, [r0, 0xC] - ldrh r1, [r1] - movs r2, 0 - bl sub_81B1D68 - b _081B827C - .pool -_081B8264: - ldr r2, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r2, r1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldrh r1, [r2, 0xC] - movs r2, 0 - movs r3, 0x1 - bl sub_81B1C84 -_081B827C: - ldr r0, =0x03005e00 - 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, =0x03005e00 - 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, =0x0203cec8 - ldrh r4, [r7, 0xC] - adds r0, r4, 0 - bl sub_81B83F0 - ldr r6, =0x0203cefc - ldrh r0, [r6] - movs r1, 0x1 - bl bag_add_item - 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, =0x02021fc4 - 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, =0x0203cec4 - 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, =0x020244ec - 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, =0x03005e00 - 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 audio_play -_081B839A: - ldr r0, =0x03005e00 - 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, =0x03005e00 - 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, =0x0203cec8 - 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 remove_item -_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, =0x0203cec8 - 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 bag_add_item -_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, =0x0203cec8 - movs r1, 0x9 - ldrsb r1, [r0, r1] - movs r0, 0x64 - muls r1, r0 - ldr r0, =0x020244ec - adds r5, r1, r0 - ldr r1, =0x0203cee8 - movs r0, 0 - strb r0, [r1] - ldr r2, =0x03005d8c - ldr r0, =0x0203bcb8 - 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 pokemon_getattr - 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, =0x03005e00 - 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, =0x030022c0 - 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, =0x0203cec8 - 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, =0x0203cef8 - 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, =0x020244ec - 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 pokemon_getattr - cmp r0, 0 - bne _081B8608 - adds r0, r5, 0 - movs r1, 0x38 - bl pokemon_getattr - adds r4, r0, 0 - bl sub_81B8888 - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bhi _081B8608 - ldr r0, =0x03005d8c - ldr r0, [r0] - ldrh r1, [r0, 0x4] - ldr r0, =0x0000191a - cmp r1, r0 - bne _081B85EA - adds r0, r5, 0 - movs r1, 0xC - bl pokemon_getattr - 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 pokemon_getattr - cmp r0, 0 - bne _081B864A -_081B8608: - movs r0, 0 - b _081B864C - .pool -_081B8618: - adds r0, r5, 0 - movs r1, 0xB - bl pokemon_getattr - 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, =0x0203cef8 - 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, =0x02021cc4 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalString - 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, =0x0203cef8 - adds r4, r3, r5 - ldrb r0, [r4] - movs r1, 0x64 - muls r0, r1 - subs r0, 0x64 - ldr r3, =0x020244ec - adds r0, r3, r0 - movs r1, 0xB - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - ldrb r0, [r4] - movs r1, 0x64 - muls r0, r1 - subs r0, 0x64 - ldr r3, =0x020244ec - adds r0, r3, r0 - movs r1, 0xC - bl pokemon_getattr - 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, =0x0203cef8 - adds r5, r0, r4 - ldrb r0, [r5] - muls r0, r7 - subs r0, 0x64 - ldr r1, =0x020244ec - adds r0, r1, r0 - movs r1, 0xB - bl pokemon_getattr - cmp r10, r0 - beq _081B86B8 - cmp r6, 0 - beq _081B873E - ldrb r0, [r5] - muls r0, r7 - subs r0, 0x64 - ldr r3, =0x020244ec - adds r0, r3, r0 - movs r1, 0xC - bl pokemon_getattr - 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, =0x0203cef8 -_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 audio_play - adds r0, r4, 0 - bl display_pokemon_menu_message - ldr r0, =0x03005e00 - 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 audio_play - 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, =0x030022c0 - 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 audio_play - movs r0, 0 - bl display_pokemon_menu_message - ldr r0, =0x03005e00 - 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, =0x020375e2 - 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, =0x020375e2 - 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, =0x020375e0 - 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, =0x020375e2 - 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, =0x02024550 - movs r1, 0xB - bl pokemon_getattr - cmp r0, 0 - beq _081B8A74 - adds r0, r4, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - bne _081B8A74 - ldr r0, =0x0203cec8 - ldrb r0, [r0, 0xB] - cmp r0, 0x1 - bne _081B8A5C - movs r0, 0x3 - b _081B8A76 - .pool -_081B8A5C: - ldr r0, =0x02022fec - 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, =0x02021cc4 - bl sub_806EBF8 - adds r1, r0, 0 - adds r0, r4, 0 - bl CopyString - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E97B2 - b _081B8C42 - .pool -_081B8AC4: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =0x020244ec - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x39 - bl pokemon_getattr - cmp r0, 0 - bne _081B8AF8 - ldr r1, =0x02021cc4 - adds r0, r4, 0 - bl GetMonNickname - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E978F - b _081B8C42 - .pool -_081B8AF8: - movs r4, 0 - b _081B8B24 -_081B8AFC: - adds r0, r4, 0 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _081B8B1E - adds r0, r5, 0 - bl sub_81B8F38 - lsls r0, 24 - ldr r2, =0x0202406e - 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, =0x0202406c - ldrb r0, [r0] - cmp r4, r0 - bcc _081B8AFC - movs r7, 0x64 - adds r0, r5, 0 - muls r0, r7 - ldr r1, =0x020244ec - mov r8, r1 - adds r6, r0, r1 - adds r0, r6, 0 - movs r1, 0x2D - bl pokemon_getattr - cmp r0, 0 - beq _081B8B60 - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E97E5 - b _081B8C42 - .pool -_081B8B60: - adds r0, r5, 0 - bl sub_81B8F38 - ldr r1, =0x0202449c - ldr r1, [r1] - adds r1, 0x8B - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bne _081B8B94 - ldr r1, =0x02021cc4 - adds r0, r6, 0 - bl GetMonNickname - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E976F - b _081B8C42 - .pool -_081B8B94: - ldr r0, =0x0203cec8 - 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, =0x0203cee9 - strb r0, [r1] - ldr r1, =0x0203cee8 - movs r0, 0x1 - strb r0, [r1] - ldr r1, =0x0202406e - ldr r0, =0x020244b8 - 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, =0x020244ec - adds r0, r1 - ldr r1, =0x02021cc4 - bl GetMonNickname - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E9754 - b _081B8C42 - .pool -_081B8C20: - ldr r0, =0x020244b8 - ldrb r0, [r0] - ldr r1, =0x0202406e - 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, =0x02021cc4 - bl GetMonNickname - ldr r0, =0x02021fc4 - ldr r1, =gUnknown_085E9738 -_081B8C42: - bl ExpandStringRefs -_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, =0x0203cf00 - 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 battle_get_side_with_given_state - mov r2, sp - ldr r1, =0x0202406e - 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 battle_get_side_with_given_state - mov r1, sp - ldr r4, =0x0202406e - lsls r0, 24 - lsrs r0, 23 - adds r0, r4 - ldrh r0, [r0] - strb r0, [r1] - movs r0, 0x2 - bl battle_get_side_with_given_state - 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, =0x0202449c - 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 battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _081B8DB0 - movs r0, 0 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x2 - b _081B8DBC -_081B8DB0: - movs r0, 0x1 - bl battle_get_side_with_given_state - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x3 -_081B8DBC: - bl battle_get_side_with_given_state - 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, =0x0202406e - 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, =0x0202406e - 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, =0x0202449c - 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, =0x0203cf00 - adds r0, r2, r0 - ldrb r0, [r0] - movs r1, 0xF - ands r1, r0 - b _081B8F60 - .pool -_081B8F58: - ldr r0, =0x0203cf00 - 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, =0x0203cf00 - 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, =0x0203cf00 - 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, =0x0203cf00 -_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, =0x020244ec - 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, =0x020244ec - 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, =0x020244ec - 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, =0x020244ec - 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, =0x020244ec - 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 pokemon_getattr - cmp r0, 0 - beq _081B912C - adds r0, r5, 0 - movs r1, 0x39 - bl pokemon_getattr - 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, =0x030022c0 - 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, =0x03005e00 - 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, =0x03005e08 - adds r4, r0, r1 - ldr r0, =0x02037fd4 - 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, =0x02022ff8 -_081B91E8: - subs r0, r4, 0x3 - lsls r0, 5 - adds r0, r7 - ldrh r0, [r0] - cmp r0, 0 - beq _081B9204 - ldr r0, =0x0203cedc - 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 audio_play - ldr r0, =0x03005e00 - 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, =0x03005e08 - 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, =0x02020630 - 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, =0x03005e08 - adds r5, r1, r0 - movs r6, 0x3 - ldr r7, =0x0203cedc -_081B92A8: - ldr r0, =0x02022ff8 - 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, =0x03005db0 - 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, =0x020375e0 - 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, =0x03005db0 - 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, =0x02037fd4 - 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, =0x02039f24 - strb r0, [r2] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x5 - bls _081B9486 - movs r0, 0xFF - strb r0, [r2] -_081B9486: - ldr r1, =0x020375e0 - ldrb r0, [r2] - strh r0, [r1] - ldr r1, =0x03005db0 - 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, =0x02037fd4 - 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, =0x02037fd4 - 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, =0x020375e0 - 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, =0x020375e2 - ldrh r1, [r5] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - bl sub_806E25C - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] -_081B95BA: - ldr r0, =0x03005db0 - 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, =0x020375f0 - 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, =0x020244ec - adds r0, r1 - movs r1, 0xC - bl pokemon_getattr - 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, =0x02037fd4 - 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, =0x020244ec - ldr r0, =0x020375e0 - ldrb r2, [r0] - ldr r0, =0x020244e9 - 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, =0x03005dac - 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, =0x020375f0 - movs r0, 0 - strh r0, [r1] - movs r4, 0 - adds r5, r1, 0 -_081B96DC: - ldr r0, =0x020375e0 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - adds r1, r4, 0 - adds r1, 0xD - bl pokemon_getattr - 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, =0x020375e0 - ldrh r1, [r0] - movs r0, 0x64 - adds r5, r1, 0 - muls r5, r0 - ldr r0, =0x020244ec - adds r5, r0 - ldr r0, =0x020375e2 - ldrh r1, [r0] - adds r1, 0xD - adds r0, r5, 0 - bl pokemon_getattr - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r1, =0x02021cc4 - adds r0, r5, 0 - bl GetMonNickname - ldr r0, =0x02021dc4 - movs r1, 0xD - muls r1, r4 - ldr r2, =gMoveNames - adds r1, r2 - bl CopyString - 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, =0x020375e0 - mov r8, r0 - ldrh r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =0x020244ec - adds r0, r5 - ldr r4, =0x020375e2 - 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, =0x020375e0 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - 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 pokemon_getattr - add r7, sp, 0x4 - mov r10, r7 - strb r0, [r7] - mov r0, r8 - movs r1, 0x15 - bl pokemon_getattr - 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 pokemon_setattr - mov r0, r8 - ldr r1, [sp, 0xC] - ldr r2, [sp, 0x14] - bl pokemon_setattr - mov r0, r8 - ldr r1, [sp, 0x10] - mov r2, r10 - bl pokemon_setattr - mov r0, r8 - ldr r1, [sp, 0x1C] - ldr r2, [sp, 0x18] - bl pokemon_setattr - mov r0, r8 - movs r1, 0x15 - adds r2, r6, 0 - bl pokemon_setattr - 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, =0x020375e0 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - movs r1, 0x2D - bl pokemon_getattr - adds r1, r0, 0 - cmp r1, 0 - beq _081B990C - ldr r1, =0x020375f0 - movs r0, 0x1 - strh r0, [r1] - b _081B9910 - .pool -_081B990C: - ldr r0, =0x020375f0 - 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, =0x020375f0 - movs r0, 0 - strh r0, [r1] - ldr r0, =0x020375e0 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =0x020244ec - adds r0, r1 - ldr r1, =0x020375e2 - ldrh r1, [r1] - adds r1, 0xD - bl pokemon_getattr - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - cmp r0, 0x39 - bne _081B999C - movs r6, 0 - b _081B9980 - .pool -_081B9958: - ldr r0, =0x020375e0 - ldrh r0, [r0] - cmp r6, r0 - beq _081B997E - movs r4, 0 - movs r0, 0x64 - adds r5, r6, 0 - muls r5, r0 - ldr r7, =0x020244ec -_081B996A: - adds r1, r4, 0 - adds r1, 0xD - adds r0, r5, r7 - bl pokemon_getattr - 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, =0x020375f0 - 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, =0x020375e0 - 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, =0x03005d90 - 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, =0x03005d8c - 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, =0x020375f0 - ldr r0, =0x03005d90 - 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, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x020375e4 - 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, =0x02038bca - bl GenerateRandomNumber - 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, =0x02038bca - ldrh r1, [r3] - ldr r0, =0x0000012b - cmp r1, r0 - bhi _081B9AAC - ldr r2, =0x0203bc88 - 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, =0x03005d90 - ldr r0, [r4] - ldr r1, =0x020375e2 - 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, =0x03005d90 - ldr r4, [r0] - ldr r5, =gUnknown_086160D4 - bl GenerateRandomNumber - 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, =0x03005d90 - ldr r0, [r4] - ldr r1, =0x00000e6a - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl bag_add_item - 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, =0x02021cc4 - bl itemid_get_name - ldr r0, [r4] - ldr r1, =0x00000e6a - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x020375f0 - strh r5, [r0] - b _081B9B76 - .pool -_081B9B70: - ldr r1, =0x020375f0 - 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, =0x020375e0 - 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, =0x03005d90 - 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, =0x03005d8c - 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, =0x020375f0 - ldr r0, =0x03005d90 - 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, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x020375e4 - 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, =0x03005d90 - ldr r0, [r4] - ldr r1, =0x020375e2 - 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, =0x03005d90 - ldr r4, [r0] - ldr r5, =gUnknown_086160F4 - bl GenerateRandomNumber - 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, =0x03005d90 - ldr r0, [r4] - ldr r1, =0x00000e6c - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl bag_add_item - 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, =0x02021cc4 - bl itemid_get_name - ldr r0, [r4] - ldr r1, =0x00000e6c - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x020375f0 - strh r5, [r0] - b _081B9CE6 - .pool -_081B9CE0: - ldr r1, =0x020375f0 - 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, =0x02021cc4 - ldr r1, =0x02038bca - 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, =0x020375e0 - 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, =0x03005d90 - 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, =0x03005d8c - 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, =0x020375f0 - ldr r0, =0x03005d90 - 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, =0x03005d90 - ldr r0, [r0] - ldr r1, =0x020375e4 - 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, =0x03005d90 - ldr r0, [r4] - ldr r1, =0x020375e2 - 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, =0x03005d90 - ldr r4, [r0] - ldr r5, =gUnknown_08616120 - bl GenerateRandomNumber - 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, =0x03005d90 - ldr r0, [r4] - ldr r1, =0x00000e6e - adds r0, r1 - ldrh r0, [r0] - movs r1, 0x1 - bl bag_add_item - 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, =0x02021cc4 - bl itemid_get_name - ldr r0, [r4] - ldr r1, =0x00000e6e - adds r0, r1 - movs r1, 0 - strh r1, [r0] - ldr r0, =0x020375f0 - strh r5, [r0] - b _081B9E6E - .pool -_081B9E68: - ldr r1, =0x020375f0 - 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, =0x02037318 - 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, =0x0203bc88 - 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, =0x0203bc8c - 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 GenerateRandomNumber - 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, =0x0203bc8c - 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, =0x0203bc8c - 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, =0x03005d90 - 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, =0x0203bc8c - 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, =0x0203bc88 - ldr r0, =gSlateportBattleTentTrainers - str r0, [r1] - ldr r1, =0x0203bc8c - ldr r0, =gSlateportBattleTentMons - str r0, [r1] - ldr r7, =0x03005d90 - ldr r1, =0x0000ffff - mov r8, r1 -_081BA062: - mov r2, r10 - lsls r6, r2, 1 -_081BA066: - bl GenerateRandomNumber - 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, =0x03005d90 - 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, =0x02038bca - strh r3, [r2] - ldrh r3, [r2] - ldr r4, =0x0203bc88 - 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, =0x03005d90 - 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, =0x03001298 - mov r8, sp -_081BA13E: - bl GenerateRandomNumber - 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, =0x0203bc8c - ldr r3, [r4] - lsls r0, 4 - adds r0, r3 - ldr r1, =0x03005d90 - 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, =0x03001298 - ldr r3, =0x0203bc8c - 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, =0x03001298 - ldrh r0, [r1] - ldr r6, =0x0203bc8c - 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, =0x0203bc8c - 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, =0x03006298 - 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, =0x030022c0 - 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, =0x03003014 - 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, =0x03003014 - 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, =0x03002f80 - 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, =0x03002f90 - 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, =0x03002f80 - 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, =0x03005d90 - 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 mplay_has_finished_maybe - 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, =0x03002f90 - 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_80AEFFC.s b/asm/rom_80AEFFC.s new file mode 100644 index 000000000..ebbb7e1e0 --- /dev/null +++ b/asm/rom_80AEFFC.s @@ -0,0 +1,2698 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start palette_bg_faded_fill_white +palette_bg_faded_fill_white: @ 80AEFFC + push {lr} + sub sp, 0x4 + ldr r0, =0x7fff7fff + str r0, [sp] + ldr r1, =0x02037b14 + ldr r2, =0x01000100 + mov r0, sp + bl CpuFastSet + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end palette_bg_faded_fill_white + + thumb_func_start palette_bg_faded_fill_black +palette_bg_faded_fill_black: @ 80AF020 + push {lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + ldr r1, =0x02037b14 + ldr r2, =0x01000100 + mov r0, sp + bl CpuFastSet + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end palette_bg_faded_fill_black + + thumb_func_start pal_fill_for_maplights +pal_fill_for_maplights: @ 80AF040 + push {r4,lr} + bl get_map_light_from_warp0 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sav1_map_get_light_level + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl fade_type_for_given_maplight_pair + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080AF06A + cmp r0, 0x1 + beq _080AF078 + b _080AF084 +_080AF06A: + bl palette_bg_faded_fill_black + movs r0, 0 + movs r1, 0 + bl fade_screen + b _080AF084 +_080AF078: + bl palette_bg_faded_fill_white + movs r0, 0x2 + movs r1, 0 + bl fade_screen +_080AF084: + pop {r4} + pop {r0} + bx r0 + thumb_func_end pal_fill_for_maplights + + thumb_func_start sub_80AF08C +sub_80AF08C: @ 80AF08C + push {lr} + bl palette_bg_faded_fill_white + movs r0, 0x2 + movs r1, 0x8 + bl fade_screen + pop {r0} + bx r0 + thumb_func_end sub_80AF08C + + thumb_func_start pal_fill_black +pal_fill_black: @ 80AF0A0 + push {lr} + bl palette_bg_faded_fill_black + movs r0, 0 + movs r1, 0 + bl fade_screen + pop {r0} + bx r0 + thumb_func_end pal_fill_black + + thumb_func_start sub_80AF0B4 +sub_80AF0B4: @ 80AF0B4 + push {r4,lr} + bl sav1_map_get_light_level + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl warp1_get_mapheader + ldrb r1, [r0, 0x17] + adds r0, r4, 0 + bl sub_8137360 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080AF0DA + cmp r0, 0x1 + beq _080AF0E4 + b _080AF0EC +_080AF0DA: + movs r0, 0x1 + movs r1, 0 + bl fade_screen + b _080AF0EC +_080AF0E4: + movs r0, 0x3 + movs r1, 0 + bl fade_screen +_080AF0EC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80AF0B4 + + thumb_func_start sub_80AF0F4 +sub_80AF0F4: @ 80AF0F4 + push {lr} + lsls r0, 24 + movs r1, 0 + cmp r0, 0 + bne _080AF100 + movs r1, 0x1 +_080AF100: + adds r0, r1, 0 + bl sub_808C0A8 + pop {r0} + bx r0 + thumb_func_end sub_80AF0F4 + + thumb_func_start task0A_nop_for_a_while +task0A_nop_for_a_while: @ 80AF10C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80AF71C + cmp r0, 0x1 + bne _080AF120 + adds r0, r4, 0 + bl DestroyTask +_080AF120: + pop {r4} + pop {r0} + bx r0 + thumb_func_end task0A_nop_for_a_while + + thumb_func_start sub_80AF128 +sub_80AF128: @ 80AF128 + push {lr} + bl script_env_2_enable + bl sub_8085784 + bl pal_fill_black + ldr r0, =task0A_nop_for_a_while + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF128 + + thumb_func_start task0A_asap_script_env_2_enable_and_set_ctx_running +task0A_asap_script_env_2_enable_and_set_ctx_running: @ 80AF148 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80AF71C + cmp r0, 0x1 + bne _080AF160 + adds r0, r4, 0 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running +_080AF160: + pop {r4} + pop {r0} + bx r0 + thumb_func_end task0A_asap_script_env_2_enable_and_set_ctx_running + + thumb_func_start sub_80AF168 +sub_80AF168: @ 80AF168 + push {lr} + bl script_env_2_enable + bl sub_8085784 + bl pal_fill_black + ldr r0, =task0A_asap_script_env_2_enable_and_set_ctx_running + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF168 + + thumb_func_start sub_80AF188 +sub_80AF188: @ 80AF188 + push {lr} + bl script_env_2_enable + bl pal_fill_black + ldr r0, =task0A_asap_script_env_2_enable_and_set_ctx_running + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF188 + + thumb_func_start task_mpl_807DD60 +task_mpl_807DD60: @ 80AF1A4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r2, =0x03005e00 + adds r4, r0, r2 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AF1DE + cmp r0, 0x1 + bgt _080AF1CC + cmp r0, 0 + beq _080AF1D2 + b _080AF20E + .pool +_080AF1CC: + cmp r0, 0x2 + beq _080AF1FC + b _080AF20E +_080AF1D2: + bl sub_80B3050 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xA] + b _080AF1F4 +_080AF1DE: + movs r1, 0xA + ldrsh r0, [r4, r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x4] + cmp r0, 0x1 + beq _080AF20E + bl pal_fill_for_maplights +_080AF1F4: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080AF20E +_080AF1FC: + bl sub_80AF71C + cmp r0, 0x1 + bne _080AF20E + bl script_env_2_disable + adds r0, r5, 0 + bl DestroyTask +_080AF20E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task_mpl_807DD60 + + thumb_func_start sub_80AF214 +sub_80AF214: @ 80AF214 + push {lr} + bl script_env_2_enable + bl sub_8085784 + bl palette_bg_faded_fill_black + ldr r0, =task_mpl_807DD60 + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF214 + + thumb_func_start sub_80AF234 +sub_80AF234: @ 80AF234 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AF268 + cmp r0, 0x1 + bgt _080AF25C + cmp r0, 0 + beq _080AF262 + b _080AF2AE + .pool +_080AF25C: + cmp r0, 0x2 + beq _080AF298 + b _080AF2AE +_080AF262: + bl sub_800ADF8 + b _080AF290 +_080AF268: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _080AF28C + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + movs r1, 0xE1 + lsls r1, 19 + cmp r0, r1 + ble _080AF2AE + movs r0, 0xC0 + lsls r0, 7 + bl sub_8011170 + b _080AF2AE +_080AF28C: + bl pal_fill_for_maplights +_080AF290: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080AF2AE +_080AF298: + bl sub_80AF71C + cmp r0, 0x1 + bne _080AF2AE + bl sub_8009F18 + bl script_env_2_disable + adds r0, r5, 0 + bl DestroyTask +_080AF2AE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80AF234 + + thumb_func_start sub_80AF2B4 +sub_80AF2B4: @ 80AF2B4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AF2E8 + cmp r0, 0x1 + bgt _080AF2DC + cmp r0, 0 + beq _080AF2E2 + b _080AF30C + .pool +_080AF2DC: + cmp r0, 0x2 + beq _080AF2FA + b _080AF30C +_080AF2E2: + bl sub_800ADF8 + b _080AF2F2 +_080AF2E8: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080AF30C +_080AF2F2: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080AF30C +_080AF2FA: + bl sub_8009F18 + bl sub_8086C2C + bl script_env_2_disable + adds r0, r5, 0 + bl DestroyTask +_080AF30C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80AF2B4 + + thumb_func_start sub_80AF314 +sub_80AF314: @ 80AF314 + push {lr} + bl script_env_2_enable + bl sub_8085784 + bl palette_bg_faded_fill_black + ldr r0, =sub_80AF234 + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF314 + + thumb_func_start sub_80AF334 +sub_80AF334: @ 80AF334 + push {r4,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8088EFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080AF36C + ldr r1, =sub_80AF438 + b _080AF37E + .pool +_080AF36C: + adds r0, r4, 0 + bl sub_8088F58 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =task_map_chg_seq_0807E2CC + cmp r0, 0x1 + bne _080AF37E + ldr r1, =task_map_chg_seq_0807E20C +_080AF37E: + adds r0, r1, 0 + movs r1, 0xA + bl CreateTask + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF334 + + thumb_func_start mapldr_default +mapldr_default: @ 80AF398 + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + bl sub_80AF334 + bl script_env_2_enable + pop {r0} + bx r0 + thumb_func_end mapldr_default + + thumb_func_start sub_80AF3B0 +sub_80AF3B0: @ 80AF3B0 + push {lr} + bl sub_8085784 + bl sub_80AF08C + bl sub_80AF334 + bl script_env_2_enable + pop {r0} + bx r0 + thumb_func_end sub_80AF3B0 + + thumb_func_start sub_80AF3C8 +sub_80AF3C8: @ 80AF3C8 + push {lr} + bl sub_81D6534 + cmp r0, 0 + bne _080AF3D6 + bl sub_8085784 +_080AF3D6: + bl pal_fill_black + bl sub_80AF334 + bl script_env_2_enable + pop {r0} + bx r0 + thumb_func_end sub_80AF3C8 + + thumb_func_start sub_80AF3E8 +sub_80AF3E8: @ 80AF3E8 + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + movs r0, 0x2E + bl audio_play + ldr r0, =task0A_mpl_807E31C + movs r1, 0xA + bl CreateTask + bl script_env_2_enable + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF3E8 + + thumb_func_start sub_80AF40C +sub_80AF40C: @ 80AF40C + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + movs r0, 0x2E + bl audio_play + ldr r0, =task_map_chg_seq_0807E2CC + movs r1, 0xA + bl CreateTask + bl script_env_2_enable + movs r0, 0xE + bl sub_8085540 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF40C + + thumb_func_start sub_80AF438 +sub_80AF438: @ 80AF438 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r5, r0, r1 + adds r6, r5, 0 + adds r6, 0xC + adds r7, r5, 0 + adds r7, 0xE + movs r2, 0x8 + ldrsh r0, [r5, r2] + adds r2, r1, 0 + cmp r0, 0x4 + bhi _080AF54A + lsls r0, 2 + ldr r1, =_080AF46C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080AF46C: + .4byte _080AF480 + .4byte _080AF4A4 + .4byte _080AF4DC + .4byte _080AF520 + .4byte _080AF540 +_080AF480: + movs r0, 0 + bl sub_80AF0F4 + bl player_bitmagic + adds r0, r6, 0 + adds r1, r7, 0 + bl PlayerGetDestCoords + movs r1, 0 + ldrsh r0, [r6, r1] + movs r2, 0 + ldrsh r1, [r7, r2] + bl sub_808A854 + movs r0, 0x1 + strh r0, [r5, 0x8] + b _080AF54A +_080AF4A4: + bl sub_80AF71C + cmp r0, 0 + beq _080AF54A + movs r0, 0x1 + bl sub_80AF0F4 + 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, =0x02037350 + adds r0, r1 + movs r1, 0x8 + bl FieldObjectSetSpecialAnim + movs r0, 0x2 + strh r0, [r5, 0x8] + b _080AF54A + .pool +_080AF4DC: + bl walkrun_is_standing_still + lsls r0, 24 + cmp r0, 0 + beq _080AF54A + movs r1, 0 + ldrsh r0, [r6, r1] + movs r2, 0 + ldrsh r1, [r7, r2] + bl sub_808A8AC + lsls r0, 24 + asrs r0, 24 + strh r0, [r5, 0xA] + 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, =0x02037350 + adds r0, r1 + bl FieldObjectClearAnimIfSpecialAnimFinished + movs r0, 0x3 + strh r0, [r5, 0x8] + b _080AF54A + .pool +_080AF520: + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + blt _080AF536 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x4] + cmp r0, 0x1 + beq _080AF54A +_080AF536: + bl sub_809757C + movs r0, 0x4 + strh r0, [r5, 0x8] + b _080AF54A +_080AF540: + bl script_env_2_disable + adds r0, r4, 0 + bl DestroyTask +_080AF54A: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80AF438 + + thumb_func_start task_map_chg_seq_0807E20C +task_map_chg_seq_0807E20C: @ 80AF550 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r5, r0, r1 + adds r6, r5, 0 + adds r6, 0xC + adds r7, r5, 0 + adds r7, 0xE + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _080AF5A2 + cmp r0, 0x1 + bgt _080AF580 + cmp r0, 0 + beq _080AF58A + b _080AF60A + .pool +_080AF580: + cmp r0, 0x2 + beq _080AF5EC + cmp r0, 0x3 + beq _080AF600 + b _080AF60A +_080AF58A: + movs r0, 0 + bl sub_80AF0F4 + bl player_bitmagic + adds r0, r6, 0 + adds r1, r7, 0 + bl PlayerGetDestCoords + movs r0, 0x1 + strh r0, [r5, 0x8] + b _080AF60A +_080AF5A2: + bl sub_80AF71C + cmp r0, 0 + beq _080AF60A + movs r0, 0x1 + bl sub_80AF0F4 + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + bl GetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + bl GetGoSpeed0AnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + movs r0, 0x2 + strh r0, [r5, 0x8] + b _080AF60A + .pool +_080AF5EC: + bl walkrun_is_standing_still + lsls r0, 24 + cmp r0, 0 + beq _080AF60A + bl sub_809757C + movs r0, 0x3 + strh r0, [r5, 0x8] + b _080AF60A +_080AF600: + bl script_env_2_disable + adds r0, r4, 0 + bl DestroyTask +_080AF60A: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end task_map_chg_seq_0807E20C + + thumb_func_start task_map_chg_seq_0807E2CC +task_map_chg_seq_0807E2CC: @ 80AF610 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080AF634 + cmp r0, 0x1 + beq _080AF644 + b _080AF65A + .pool +_080AF634: + bl player_bitmagic + bl script_env_2_enable + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080AF65A +_080AF644: + bl sub_80AF71C + cmp r0, 0 + beq _080AF65A + bl sub_809757C + bl script_env_2_disable + adds r0, r5, 0 + bl DestroyTask +_080AF65A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task_map_chg_seq_0807E2CC + + thumb_func_start sub_80AF660 +sub_80AF660: @ 80AF660 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80AF71C + cmp r0, 0x1 + bne _080AF67C + adds r0, r4, 0 + bl DestroyTask + ldr r0, =sub_809FA34 + movs r1, 0x50 + bl CreateTask +_080AF67C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF660 + + thumb_func_start sub_80AF688 +sub_80AF688: @ 80AF688 + push {lr} + bl pal_fill_black + ldr r0, =sub_80AF660 + movs r1, 0x50 + bl CreateTask + bl script_env_2_enable + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF688 + + thumb_func_start sub_80AF6A4 +sub_80AF6A4: @ 80AF6A4 + push {lr} + bl sub_809FA18 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_80AF6A4 + + thumb_func_start task_mpl_807E3C8 +task_mpl_807E3C8: @ 80AF6B0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80AF71C + cmp r0, 0x1 + bne _080AF6CC + bl script_env_2_disable + adds r0, r4, 0 + bl DestroyTask + bl sub_80984F4 +_080AF6CC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end task_mpl_807E3C8 + + thumb_func_start sub_80AF6D4 +sub_80AF6D4: @ 80AF6D4 + push {lr} + bl script_env_2_enable + bl pal_fill_black + ldr r0, =task_mpl_807E3C8 + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF6D4 + + thumb_func_start sub_80AF6F0 +sub_80AF6F0: @ 80AF6F0 + push {lr} + bl script_env_2_enable + bl sub_8085784 + bl pal_fill_black + ldr r0, =task_mpl_807E3C8 + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF6F0 + + thumb_func_start sub_80AF710 +sub_80AF710: @ 80AF710 + ldr r0, =0x02037fd4 + ldrb r0, [r0, 0x7] + lsrs r0, 7 + bx lr + .pool + thumb_func_end sub_80AF710 + + thumb_func_start sub_80AF71C +sub_80AF71C: @ 80AF71C + push {lr} + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080AF72E + movs r0, 0 + b _080AF730 +_080AF72E: + movs r0, 0x1 +_080AF730: + pop {r1} + bx r1 + thumb_func_end sub_80AF71C + + thumb_func_start sub_80AF734 +sub_80AF734: @ 80AF734 + push {lr} + bl script_env_2_enable + bl music_something + bl sub_80AF0B4 + bl play_some_sound + movs r0, 0x9 + bl audio_play + ldr r0, =0x03005dac + ldr r1, =mapldr_default + str r1, [r0] + ldr r0, =sub_80AFA0C + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF734 + + thumb_func_start sp13E_warp_to_last_warp +sp13E_warp_to_last_warp: @ 80AF76C + push {lr} + bl script_env_2_enable + bl music_something + bl sub_80AF0B4 + bl play_some_sound + ldr r0, =0x03005dac + ldr r1, =mapldr_default + str r1, [r0] + ldr r0, =sub_80AFA0C + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sp13E_warp_to_last_warp + + thumb_func_start sub_80AF79C +sub_80AF79C: @ 80AF79C + push {lr} + bl script_env_2_enable + bl music_something + movs r0, 0x3 + movs r1, 0x8 + bl fade_screen + bl play_some_sound + ldr r0, =0x03005dac + ldr r1, =sub_80AF3B0 + str r1, [r0] + ldr r0, =sub_80AFA0C + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF79C + + thumb_func_start sub_80AF7D0 +sub_80AF7D0: @ 80AF7D0 + push {lr} + bl script_env_2_enable + ldr r0, =0x03005dac + ldr r1, =mapldr_default + str r1, [r0] + ldr r0, =sub_80AFA88 + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF7D0 + + thumb_func_start sp13F_fall_to_last_warp +sp13F_fall_to_last_warp: @ 80AF7F4 + push {lr} + bl sp13E_warp_to_last_warp + ldr r1, =0x03005dac + ldr r0, =sub_80B6B68 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sp13F_fall_to_last_warp + + thumb_func_start sub_80AF80C +sub_80AF80C: @ 80AF80C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl script_env_2_enable + adds r0, r4, 0 + movs r1, 0xA + bl sub_80B6E4C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80AF80C + + thumb_func_start sub_80AF828 +sub_80AF828: @ 80AF828 + push {lr} + bl script_env_2_enable + movs r0, 0xA + bl sub_80B75D8 + pop {r0} + bx r0 + thumb_func_end sub_80AF828 + + thumb_func_start sub_80AF838 +sub_80AF838: @ 80AF838 + push {lr} + bl script_env_2_enable + movs r0, 0xA + bl sub_80B7A74 + pop {r0} + bx r0 + thumb_func_end sub_80AF838 + + thumb_func_start sub_80AF848 +sub_80AF848: @ 80AF848 + push {lr} + bl script_env_2_enable + bl music_something + bl sub_80AF0B4 + movs r0, 0x2D + bl audio_play + ldr r0, =sub_80AFA0C + movs r1, 0xA + bl CreateTask + ldr r1, =0x03005dac + ldr r0, =sub_80AF3E8 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF848 + + thumb_func_start sub_80AF87C +sub_80AF87C: @ 80AF87C + push {lr} + movs r0, 0x1 + bl sub_8085540 + bl script_env_2_enable + bl save_serialize_npcs + bl music_something + bl sub_80AF0B4 + movs r0, 0x2D + bl audio_play + ldr r0, =sub_80AFA0C + movs r1, 0xA + bl CreateTask + ldr r1, =0x03005dac + ldr r0, =sub_80AF40C + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF87C + + thumb_func_start sub_80AF8B8 +sub_80AF8B8: @ 80AF8B8 + push {lr} + bl script_env_2_enable + bl sub_80AF0B4 + ldr r0, =sub_80AFA0C + movs r1, 0xA + bl CreateTask + ldr r1, =0x03005dac + ldr r0, =sub_80FB768 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF8B8 + + thumb_func_start sub_80AF8E0 +sub_80AF8E0: @ 80AF8E0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AF914 + cmp r0, 0x1 + bgt _080AF908 + cmp r0, 0 + beq _080AF90E + b _080AF93E + .pool +_080AF908: + cmp r0, 0x2 + beq _080AF92E + b _080AF93E +_080AF90E: + bl script_env_2_enable + b _080AF926 +_080AF914: + bl sub_80AF710 + cmp r0, 0 + bne _080AF93E + bl sub_80859A0 + lsls r0, 24 + cmp r0, 0 + beq _080AF93E +_080AF926: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080AF93E +_080AF92E: + bl warp_in + ldr r0, =sub_8086074 + bl SetMainCallback2 + adds r0, r5, 0 + bl DestroyTask +_080AF93E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF8E0 + + thumb_func_start sub_80AF948 +sub_80AF948: @ 80AF948 + push {lr} + bl script_env_2_enable + bl music_something + bl sub_80AF0B4 + movs r0, 0x9 + bl audio_play + ldr r0, =sub_80AF8E0 + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF948 + + thumb_func_start sub_80AF96C +sub_80AF96C: @ 80AF96C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AF9B2 + cmp r0, 0x1 + bgt _080AF994 + cmp r0, 0 + beq _080AF99A + b _080AF9E8 + .pool +_080AF994: + cmp r0, 0x2 + beq _080AF9D0 + b _080AF9E8 +_080AF99A: + bl sub_8009FAC + movs r0, 0x1 + movs r1, 0 + bl fade_screen + bl music_something + movs r0, 0x9 + bl audio_play + b _080AF9C8 +_080AF9B2: + bl sub_80AF710 + cmp r0, 0 + bne _080AF9E8 + bl sub_80859A0 + lsls r0, 24 + cmp r0, 0 + beq _080AF9E8 + bl sub_800AC34 +_080AF9C8: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _080AF9E8 +_080AF9D0: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _080AF9E8 + bl warp_in + ldr r0, =c2_load_new_map + bl SetMainCallback2 + adds r0, r5, 0 + bl DestroyTask +_080AF9E8: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF96C + + thumb_func_start sub_80AF9F8 +sub_80AF9F8: @ 80AF9F8 + push {lr} + ldr r0, =sub_80AF96C + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AF9F8 + + thumb_func_start sub_80AFA0C +sub_80AFA0C: @ 80AFA0C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r5, [r4, r0] + cmp r5, 0x1 + beq _080AFA44 + cmp r5, 0x1 + bgt _080AFA34 + cmp r5, 0 + beq _080AFA3A + b _080AFA7C + .pool +_080AFA34: + cmp r5, 0x2 + beq _080AFA6C + b _080AFA7C +_080AFA3A: + bl player_bitmagic + bl script_env_2_enable + b _080AFA64 +_080AFA44: + bl sub_80AF710 + cmp r0, 0 + bne _080AFA7C + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080AFA5A + bl sub_81BE72C + strh r5, [r4, 0xA] +_080AFA5A: + bl sub_80859A0 + lsls r0, 24 + cmp r0, 0 + beq _080AFA7C +_080AFA64: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080AFA7C +_080AFA6C: + bl warp_in + ldr r0, =c2_load_new_map + bl SetMainCallback2 + adds r0, r6, 0 + bl DestroyTask +_080AFA7C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AFA0C + + thumb_func_start sub_80AFA88 +sub_80AFA88: @ 80AFA88 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r5, r1, r0 + adds r4, r5, 0 + adds r4, 0xC + adds r6, r5, 0 + adds r6, 0xE + movs r2, 0x8 + ldrsh r1, [r5, r2] + adds r2, r0, 0 + cmp r1, 0x4 + bls _080AFAAC + b _080AFBE8 +_080AFAAC: + lsls r0, r1, 2 + ldr r1, =_080AFAC0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080AFAC0: + .4byte _080AFAD4 + .4byte _080AFB10 + .4byte _080AFB6C + .4byte _080AFBB8 + .4byte _080AFBD4 +_080AFAD4: + bl player_bitmagic + adds r0, r4, 0 + adds r1, r6, 0 + bl PlayerGetDestCoords + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0 + ldrsh r1, [r6, r2] + subs r1, 0x1 + bl cur_mapdata_get_door_sound_at + lsls r0, 16 + lsrs r0, 16 + bl audio_play + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0 + ldrsh r1, [r6, r2] + subs r1, 0x1 + bl task_overworld_door_add_if_role_69_for_opening_door_at + lsls r0, 24 + asrs r0, 24 + strh r0, [r5, 0xA] + movs r0, 0x1 + strh r0, [r5, 0x8] + b _080AFBE8 +_080AFB10: + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + blt _080AFB26 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x4] + cmp r0, 0x1 + beq _080AFBE8 +_080AFB26: + 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 r4, =0x02037350 + adds r0, r4 + bl FieldObjectClearAnimIfSpecialAnimActive + 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 + adds r0, r4 + movs r1, 0x9 + bl FieldObjectSetSpecialAnim + movs r0, 0x2 + strh r0, [r5, 0x8] + b _080AFBE8 + .pool +_080AFB6C: + bl walkrun_is_standing_still + lsls r0, 24 + cmp r0, 0 + beq _080AFBE8 + movs r2, 0 + ldrsh r0, [r4, r2] + movs r2, 0 + ldrsh r1, [r6, r2] + subs r1, 0x1 + bl sub_808A8AC + lsls r0, 24 + asrs r0, 24 + strh r0, [r5, 0xA] + 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, =0x02037350 + adds r0, r1 + bl FieldObjectClearAnimIfSpecialAnimFinished + movs r0, 0 + bl sub_80AF0F4 + movs r0, 0x3 + strh r0, [r5, 0x8] + b _080AFBE8 + .pool +_080AFBB8: + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + blt _080AFBCE + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x4] + cmp r0, 0x1 + beq _080AFBE8 +_080AFBCE: + movs r0, 0x4 + strh r0, [r5, 0x8] + b _080AFBE8 +_080AFBD4: + bl music_something + bl sub_80AF0B4 + bl play_some_sound + movs r0, 0 + strh r0, [r5, 0x8] + ldr r0, =sub_80AFA0C + str r0, [r5] +_080AFBE8: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AFA88 + + thumb_func_start task0A_fade_n_map_maybe +task0A_fade_n_map_maybe: @ 80AFBF4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AFC2C + cmp r0, 0x1 + bgt _080AFC1C + cmp r0, 0 + beq _080AFC22 + b _080AFC56 + .pool +_080AFC1C: + cmp r0, 0x2 + beq _080AFC46 + b _080AFC56 +_080AFC22: + bl player_bitmagic + bl script_env_2_enable + b _080AFC3E +_080AFC2C: + bl sub_80AF710 + cmp r0, 0 + bne _080AFC56 + bl sub_80859A0 + lsls r0, 24 + cmp r0, 0 + beq _080AFC56 +_080AFC3E: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080AFC56 +_080AFC46: + bl warp_in + ldr r0, =sub_8086024 + bl SetMainCallback2 + adds r0, r5, 0 + bl DestroyTask +_080AFC56: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end task0A_fade_n_map_maybe + + thumb_func_start sub_80AFC60 +sub_80AFC60: @ 80AFC60 + push {lr} + bl script_env_2_enable + bl music_something + bl sub_80AF0B4 + bl play_some_sound + movs r0, 0x9 + bl audio_play + ldr r0, =0x03005dac + ldr r1, =sub_80AF3C8 + str r1, [r0] + ldr r0, =task0A_fade_n_map_maybe + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AFC60 + + thumb_func_start sub_80AFC98 +sub_80AFC98: @ 80AFC98 + push {lr} + cmp r1, 0xA0 + bhi _080AFCC0 + cmp r2, 0 + bge _080AFCA4 + movs r2, 0 +_080AFCA4: + cmp r2, 0xFF + ble _080AFCAA + movs r2, 0xFF +_080AFCAA: + cmp r3, 0 + bge _080AFCB0 + movs r3, 0 +_080AFCB0: + cmp r3, 0xFF + ble _080AFCB6 + movs r3, 0xFF +_080AFCB6: + lsls r1, 1 + adds r1, r0 + lsls r0, r2, 8 + orrs r0, r3 + strh r0, [r1] +_080AFCC0: + pop {r0} + bx r0 + thumb_func_end sub_80AFC98 + + thumb_func_start sub_80AFCC4 +sub_80AFCC4: @ 80AFCC4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + str r0, [sp] + mov r10, r1 + mov r9, r2 + adds r6, r3, 0 + mov r8, r6 + movs r7, 0 + cmp r6, 0 + blt _080AFD40 +_080AFCE0: + mov r0, r9 + subs r1, r0, r7 + mov r0, r10 + subs r4, r0, r6 + adds r5, r0, r6 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFC98 + mov r0, r9 + adds r1, r0, r7 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFC98 + mov r0, r9 + subs r1, r0, r6 + mov r0, r10 + subs r4, r0, r7 + adds r5, r0, r7 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFC98 + mov r0, r9 + adds r1, r0, r6 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFC98 + mov r1, r8 + adds r1, 0x1 + lsls r0, r7, 1 + subs r1, r0 + mov r8, r1 + adds r7, 0x1 + cmp r1, 0 + bge _080AFD3C + subs r1, r6, 0x1 + lsls r0, r1, 1 + add r8, r0 + adds r6, r1, 0 +_080AFD3C: + cmp r6, r7 + bge _080AFCE0 +_080AFD40: + 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_80AFCC4 + + thumb_func_start sub_80AFD50 +sub_80AFD50: @ 80AFD50 + push {lr} + cmp r1, 0xA0 + bhi _080AFD78 + cmp r2, 0 + bge _080AFD5C + movs r2, 0 +_080AFD5C: + cmp r2, 0xF0 + ble _080AFD62 + movs r2, 0xF0 +_080AFD62: + cmp r3, 0 + bge _080AFD68 + movs r3, 0 +_080AFD68: + cmp r3, 0xF0 + ble _080AFD6E + movs r3, 0xF0 +_080AFD6E: + lsls r1, 1 + adds r1, r0 + lsls r0, r2, 8 + orrs r0, r3 + strh r0, [r1] +_080AFD78: + pop {r0} + bx r0 + thumb_func_end sub_80AFD50 + + thumb_func_start sub_80AFD7C +sub_80AFD7C: @ 80AFD7C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + str r0, [sp] + mov r10, r1 + mov r9, r2 + adds r6, r3, 0 + mov r8, r6 + movs r7, 0 + cmp r6, 0 + blt _080AFDF8 +_080AFD98: + mov r0, r9 + subs r1, r0, r7 + mov r0, r10 + subs r4, r0, r6 + adds r5, r0, r6 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFD50 + mov r0, r9 + adds r1, r0, r7 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFD50 + mov r0, r9 + subs r1, r0, r6 + mov r0, r10 + subs r4, r0, r7 + adds r5, r0, r7 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFD50 + mov r0, r9 + adds r1, r0, r6 + ldr r0, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80AFD50 + mov r1, r8 + adds r1, 0x1 + lsls r0, r7, 1 + subs r1, r0 + mov r8, r1 + adds r7, 0x1 + cmp r1, 0 + bge _080AFDF4 + subs r1, r6, 0x1 + lsls r0, r1, 1 + add r8, r0 + adds r6, r1, 0 +_080AFDF4: + cmp r6, r7 + bge _080AFD98 +_080AFDF8: + 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_80AFD7C + + thumb_func_start sub_80AFE08 +sub_80AFE08: @ 80AFE08 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AFE64 + cmp r0, 0x1 + bgt _080AFE30 + cmp r0, 0 + beq _080AFE36 + b _080AFEC6 + .pool +_080AFE30: + cmp r0, 0x2 + beq _080AFEBC + b _080AFEC6 +_080AFE36: + ldr r0, =0x02039b28 + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + ldr r1, =0x02038c28 + adds r0, r1 + movs r2, 0x2 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r5, 0x6 + ldrsh r3, [r4, r5] + bl sub_80AFCC4 + movs r0, 0x1 + strh r0, [r4] + b _080AFEC6 + .pool +_080AFE64: + ldr r0, =0x02039b28 + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + ldr r1, =0x02038c28 + adds r0, r1 + movs r6, 0x2 + ldrsh r1, [r4, r6] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r6, 0x6 + ldrsh r3, [r4, r6] + bl sub_80AFCC4 + movs r0, 0 + strh r0, [r4] + ldrh r0, [r4, 0xA] + ldrh r1, [r4, 0x6] + adds r0, r1 + strh r0, [r4, 0x6] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x8 + ldrsh r1, [r4, r2] + cmp r0, r1 + ble _080AFEC6 + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0x1 + bne _080AFEB4 + bl remove_some_task + movs r0, 0x2 + strh r0, [r4] + b _080AFEC6 + .pool +_080AFEB4: + adds r0, r5, 0 + bl DestroyTask + b _080AFEC6 +_080AFEBC: + bl dp12_8087EA4 + adds r0, r5, 0 + bl DestroyTask +_080AFEC6: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80AFE08 + + thumb_func_start sub_80AFECC +sub_80AFECC: @ 80AFECC + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080AFF28 + cmp r0, 0x1 + bgt _080AFEF4 + cmp r0, 0 + beq _080AFEFA + b _080AFF8A + .pool +_080AFEF4: + cmp r0, 0x2 + beq _080AFF80 + b _080AFF8A +_080AFEFA: + ldr r0, =0x02039b28 + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + ldr r1, =0x02038c28 + adds r0, r1 + movs r2, 0x2 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r5, 0x6 + ldrsh r3, [r4, r5] + bl sub_80AFD7C + movs r0, 0x1 + strh r0, [r4] + b _080AFF8A + .pool +_080AFF28: + ldr r0, =0x02039b28 + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + ldr r1, =0x02038c28 + adds r0, r1 + movs r6, 0x2 + ldrsh r1, [r4, r6] + movs r3, 0x4 + ldrsh r2, [r4, r3] + movs r6, 0x6 + ldrsh r3, [r4, r6] + bl sub_80AFD7C + movs r0, 0 + strh r0, [r4] + ldrh r0, [r4, 0xA] + ldrh r1, [r4, 0x6] + adds r0, r1 + strh r0, [r4, 0x6] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x8 + ldrsh r1, [r4, r2] + cmp r0, r1 + ble _080AFF8A + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0x1 + bne _080AFF78 + bl remove_some_task + movs r0, 0x2 + strh r0, [r4] + b _080AFF8A + .pool +_080AFF78: + adds r0, r5, 0 + bl DestroyTask + b _080AFF8A +_080AFF80: + bl dp12_8087EA4 + adds r0, r5, 0 + bl DestroyTask +_080AFF8A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80AFECC + + thumb_func_start sub_80AFF90 +sub_80AFF90: @ 80AFF90 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =sub_80AFE08 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + bne _080AFFAC + bl script_env_2_enable_and_set_ctx_running + adds r0, r4, 0 + bl DestroyTask +_080AFFAC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AFF90 + + thumb_func_start sub_80AFFB8 +sub_80AFFB8: @ 80AFFB8 + push {r4,lr} + ldr r4, =sub_80AFF90 + adds r0, r4, 0 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + bne _080AFFD0 + adds r0, r4, 0 + movs r1, 0x50 + bl CreateTask +_080AFFD0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AFFB8 + + thumb_func_start sub_80AFFDC +sub_80AFFDC: @ 80AFFDC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r0 + mov r9, r1 + adds r5, r2, 0 + adds r4, r3, 0 + ldr r6, [sp, 0x1C] + ldr r0, [sp, 0x20] + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =sub_80AFE08 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r1, r0, r1 + strh r5, [r1, 0x6] + strh r4, [r1, 0x8] + mov r0, r8 + strh r0, [r1, 0x2] + mov r0, r9 + strh r0, [r1, 0x4] + strh r6, [r1, 0xC] + cmp r5, r4 + bge _080B0028 + strh r7, [r1, 0xA] + b _080B002C + .pool +_080B0028: + negs r0, r7 + strh r0, [r1, 0xA] +_080B002C: + adds r0, r2, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80AFFDC + + thumb_func_start sub_80B003C +sub_80B003C: @ 80B003C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r0 + mov r9, r1 + adds r5, r2, 0 + adds r4, r3, 0 + ldr r6, [sp, 0x1C] + ldr r0, [sp, 0x20] + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =sub_80AFECC + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r1, r0, r1 + strh r5, [r1, 0x6] + strh r4, [r1, 0x8] + mov r0, r8 + strh r0, [r1, 0x2] + mov r0, r9 + strh r0, [r1, 0x4] + strh r6, [r1, 0xC] + cmp r5, r4 + bge _080B0088 + strh r7, [r1, 0xA] + b _080B008C + .pool +_080B0088: + negs r0, r7 + strh r0, [r1, 0xA] +_080B008C: + adds r0, r2, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80B003C + + thumb_func_start sub_80B009C +sub_80B009C: @ 80B009C + push {r4,r5,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + bl sav1_get_flash_used_on_map + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + cmp r4, 0 + bne _080B00B6 + movs r5, 0x1 +_080B00B6: + ldr r1, =gUnknown_0854FE64 + lsls r0, 1 + adds r0, r1 + ldrh r2, [r0] + lsls r0, r4, 1 + adds r0, r1 + ldrh r3, [r0] + str r5, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x78 + movs r1, 0x50 + bl sub_80AFFDC + bl sub_80AFFB8 + bl script_env_2_enable + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B009C + + thumb_func_start sub_80B00E8 +sub_80B00E8: @ 80B00E8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080B0116 + ldr r4, =0x02038c28 + ldr r1, =gUnknown_0854FE64 + lsls r0, 1 + adds r0, r1 + ldrh r3, [r0] + adds r0, r4, 0 + movs r1, 0x78 + movs r2, 0x50 + bl sub_80AFCC4 + movs r0, 0xF0 + lsls r0, 3 + adds r1, r4, r0 + movs r2, 0xF0 + lsls r2, 1 + adds r0, r4, 0 + bl CpuFastSet +_080B0116: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B00E8 + + thumb_func_start door_upload_tiles +door_upload_tiles: @ 80B0124 + push {r4,lr} + ldr r4, =0x02038c28 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000e68 + adds r0, r1 + ldrb r3, [r0] + adds r0, r4, 0 + movs r1, 0x78 + movs r2, 0x50 + bl sub_80AFCC4 + movs r0, 0xF0 + lsls r0, 3 + adds r1, r4, r0 + movs r2, 0xF0 + lsls r2, 1 + adds r0, r4, 0 + bl CpuFastSet + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end door_upload_tiles + + thumb_func_start task0A_mpl_807E31C +task0A_mpl_807E31C: @ 80B0160 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080B0184 + cmp r0, 0x1 + beq _080B0198 + b _080B01B6 + .pool +_080B0184: + bl player_bitmagic + bl script_env_2_enable + bl sub_808D194 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080B01B6 +_080B0198: + bl sub_80AF71C + cmp r0, 0 + beq _080B01B6 + bl sub_808D1B4 + cmp r0, 0x1 + beq _080B01B6 + bl sub_809757C + bl script_env_2_disable + adds r0, r5, 0 + bl DestroyTask +_080B01B6: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task0A_mpl_807E31C + + thumb_func_start sub_80B01BC +sub_80B01BC: @ 80B01BC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080B0202 + cmp r0, 0x1 + bgt _080B01E4 + cmp r0, 0 + beq _080B01EE + b _080B023A + .pool +_080B01E4: + cmp r0, 0x2 + beq _080B0210 + cmp r0, 0x3 + beq _080B022A + b _080B023A +_080B01EE: + bl player_bitmagic + bl script_env_2_enable + movs r0, 0x2D + bl audio_play + bl sub_808D1C8 + b _080B0222 +_080B0202: + bl sub_808D1E8 + cmp r0, 0 + bne _080B023A + bl sub_80AF0B4 + b _080B0222 +_080B0210: + bl sub_80AF710 + cmp r0, 0 + bne _080B023A + bl sub_80859A0 + lsls r0, 24 + cmp r0, 0 + beq _080B023A +_080B0222: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080B023A +_080B022A: + bl warp_in + ldr r0, =c2_load_new_map + bl SetMainCallback2 + adds r0, r5, 0 + bl DestroyTask +_080B023A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B01BC + + thumb_func_start sub_80B0244 +sub_80B0244: @ 80B0244 + push {lr} + bl script_env_2_enable + ldr r0, =sub_80AFA0C + movs r1, 0xA + bl CreateTask + ldr r1, =0x03005dac + ldr r0, =sub_80AF3E8 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B0244 + + thumb_func_start sub_80B0268 +sub_80B0268: @ 80B0268 + push {lr} + bl script_env_2_enable + ldr r0, =0x03005dac + ldr r1, =mapldr_default + str r1, [r0] + ldr r0, =sub_80B01BC + movs r1, 0xA + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B0268 + + thumb_func_start sub_80B028C +sub_80B028C: @ 80B028C + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + cmp r0, 0 + bne _080B029A + movs r1, 0x1F + b _080B02A0 +_080B029A: + movs r0, 0xF8 + lsls r0, 7 + adds r1, r0, 0 +_080B02A0: + mov r0, sp + strh r1, [r0] + movs r5, 0 + movs r4, 0xF0 + lsls r4, 16 +_080B02AA: + lsrs r1, r4, 16 + mov r0, sp + movs r2, 0x2 + bl gpu_pal_apply + movs r0, 0x80 + lsls r0, 9 + adds r4, r0 + adds r5, 0x1 + cmp r5, 0xF + ble _080B02AA + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B028C + + thumb_func_start sub_80B02C8 +sub_80B02C8: @ 80B02C8 + push {r4,r5,lr} + lsls r0, 16 + ldr r2, =0x04000052 + ldrh r1, [r2] + lsls r1, 24 + lsrs r5, r1, 24 + ldrh r1, [r2] + lsrs r4, r1, 8 + cmp r0, 0 + beq _080B02EC + cmp r5, 0 + beq _080B02F6 + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + b _080B02F6 + .pool +_080B02EC: + cmp r4, 0xF + bhi _080B02F6 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_080B02F6: + lsls r1, r4, 8 + orrs r1, r5 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + cmp r5, 0 + bne _080B0310 + cmp r4, 0x10 + bne _080B0310 + movs r0, 0x1 + b _080B0312 +_080B0310: + movs r0, 0 +_080B0312: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B02C8 + + thumb_func_start sub_80B0318 +sub_80B0318: @ 80B0318 + push {r4,r5,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x7 + bls _080B0334 + b _080B052C +_080B0334: + lsls r0, 2 + ldr r1, =_080B0348 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080B0348: + .4byte _080B0368 + .4byte _080B0424 + .4byte _080B0450 + .4byte _080B046C + .4byte _080B0482 + .4byte _080B04F2 + .4byte _080B04AC + .4byte _080B04BA +_080B0368: + movs r0, 0x80 + lsls r0, 19 + ldrh r0, [r0] + strh r0, [r5, 0xC] + ldr r0, =0x04000050 + ldrh r0, [r0] + strh r0, [r5, 0xE] + ldr r0, =0x04000052 + ldrh r0, [r0] + strh r0, [r5, 0x10] + ldr r0, =0x04000048 + ldrh r0, [r0] + strh r0, [r5, 0x12] + ldr r0, =0x0400004a + ldrh r0, [r0] + strh r0, [r5, 0x14] + movs r1, 0x80 + lsls r1, 7 + movs r0, 0 + bl ClearGpuRegBits + ldr r0, =gUnknown_82EC7CC + ldrh r1, [r0] + movs r0, 0x50 + bl SetGpuRegBits + ldr r1, =0x0000070c + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x1E + bl SetGpuReg + movs r0, 0x14 + str r0, [sp] + movs r0, 0xF + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1E + bl sub_8199C30 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r4, =0x02038c28 + movs r2, 0x4 + ldrsh r1, [r5, r2] + movs r0, 0x6 + ldrsh r2, [r5, r0] + adds r0, r4, 0 + movs r3, 0x1 + bl sub_80AFD7C + movs r2, 0xF0 + lsls r2, 3 + adds r1, r4, r2 + movs r2, 0xF0 + lsls r2, 1 + adds r0, r4, 0 + bl CpuFastSet + ldr r2, =gUnknown_0854FE7C + ldr r0, [r2] + ldr r1, [r2, 0x4] + ldr r2, [r2, 0x8] + bl sub_80BA038 + movs r0, 0x1 + strh r0, [r5] + b _080B052C + .pool +_080B0424: + movs r0, 0 + movs r1, 0x11 + movs r2, 0 + movs r3, 0x1 + bl sub_8199DF0 + ldrb r0, [r5, 0x2] + bl sub_80B028C + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + movs r2, 0x1 + str r2, [sp] + movs r4, 0x2 + str r4, [sp, 0x4] + movs r3, 0xA0 + bl sub_80B003C + strh r4, [r5] + b _080B052C +_080B0450: + ldr r0, =sub_80AFECC + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + bne _080B052C + bl script_env_2_enable_and_set_ctx_running + movs r0, 0x3 + strh r0, [r5] + b _080B052C + .pool +_080B046C: + bl InstallCameraPanAheadCallback + movs r0, 0 + bl SetCameraPanningCallback + movs r0, 0 + strh r0, [r5, 0xA] + movs r0, 0x4 + strh r0, [r5, 0x8] + strh r0, [r5] + b _080B052C +_080B0482: + ldrh r0, [r5, 0x8] + subs r0, 0x1 + strh r0, [r5, 0x8] + lsls r0, 16 + cmp r0, 0 + bne _080B052C + movs r0, 0x4 + strh r0, [r5, 0x8] + ldrh r0, [r5, 0xA] + movs r1, 0x1 + eors r0, r1 + strh r0, [r5, 0xA] + movs r1, 0x4 + negs r1, r1 + cmp r0, 0 + beq _080B04A4 + movs r1, 0x4 +_080B04A4: + movs r0, 0 + bl SetCameraPanning + b _080B052C +_080B04AC: + bl InstallCameraPanAheadCallback + movs r0, 0x8 + strh r0, [r5, 0x8] + movs r0, 0x7 + strh r0, [r5] + b _080B052C +_080B04BA: + ldrh r0, [r5, 0x8] + subs r0, 0x1 + strh r0, [r5, 0x8] + lsls r0, 16 + cmp r0, 0 + bne _080B052C + movs r0, 0x8 + strh r0, [r5, 0x8] + ldrh r0, [r5, 0xA] + movs r1, 0x1 + eors r0, r1 + strh r0, [r5, 0xA] + ldrh r0, [r5, 0xA] + bl sub_80B02C8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B052C + movs r0, 0x5 + strh r0, [r5] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8199DF0 + b _080B052C +_080B04F2: + movs r0, 0x40 + movs r1, 0xFF + bl SetGpuReg + ldrh r1, [r5, 0xC] + movs r0, 0 + bl SetGpuReg + ldrh r1, [r5, 0xE] + movs r0, 0x50 + bl SetGpuReg + ldrh r1, [r5, 0x10] + movs r0, 0x52 + bl SetGpuReg + ldrh r1, [r5, 0x12] + movs r0, 0x48 + bl SetGpuReg + ldrh r1, [r5, 0x14] + movs r0, 0x4A + bl SetGpuReg + bl script_env_2_enable_and_set_ctx_running + adds r0, r4, 0 + bl DestroyTask +_080B052C: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B0318 + + thumb_func_start sub_80B0534 +sub_80B0534: @ 80B0534 + push {lr} + ldr r0, =sub_80B0318 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r1, r0 + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0 + bne _080B0568 + strh r0, [r1, 0x2] + movs r0, 0x68 + b _080B0580 + .pool +_080B0568: + cmp r0, 0x1 + bne _080B0572 + strh r0, [r1, 0x2] + movs r0, 0x88 + b _080B0580 +_080B0572: + cmp r0, 0x2 + bne _080B057A + movs r0, 0 + b _080B057C +_080B057A: + movs r0, 0x1 +_080B057C: + strh r0, [r1, 0x2] + movs r0, 0x78 +_080B0580: + strh r0, [r1, 0x4] + movs r0, 0x50 + strh r0, [r1, 0x6] + pop {r0} + bx r0 + thumb_func_end sub_80B0534 + + thumb_func_start sub_80B058C +sub_80B058C: @ 80B058C + push {lr} + ldr r0, =sub_80B0318 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x6 + strh r0, [r1, 0x8] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B058C + + thumb_func_start sub_80B05B4 +sub_80B05B4: @ 80B05B4 + push {lr} + bl sub_80859B0 + ldr r0, =task50_0807F0C8 + movs r1, 0x50 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B05B4 + + thumb_func_start task50_0807F0C8 +task50_0807F0C8: @ 80B05CC + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80859A0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B05E8 + adds r0, r4, 0 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running +_080B05E8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end task50_0807F0C8 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_80B5E6C.s b/asm/rom_80B5E6C.s new file mode 100644 index 000000000..356180a57 --- /dev/null +++ b/asm/rom_80B5E6C.s @@ -0,0 +1,8625 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80B5E6C +sub_80B5E6C: @ 80B5E6C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + mov r9, r3 + ldr r7, [sp, 0x34] + lsls r4, 24 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsrs r4, 21 + ldr r3, =gTrainerFrontPicPaletteTable + mov r8, r3 + add r8, r4 + mov r0, r8 + adds r1, r7, 0 + bl LoadCompressedObjectPaletteOverrideBuffer + ldr r0, =gTrainerFrontPicTable + adds r4, r0 + adds r0, r4, 0 + adds r1, r7, 0 + bl LoadCompressedObjectPicOverrideBuffer + mov r1, sp + ldrh r0, [r4, 0x6] + movs r2, 0 + strh r0, [r1] + mov r3, r8 + ldrh r0, [r3, 0x4] + strh r0, [r1, 0x2] + ldr r0, =gNewGameBirchOamAttributes + str r0, [sp, 0x4] + ldr r0, =gDummyObjectImageAnimTable + str r0, [sp, 0x8] + str r2, [sp, 0xC] + ldr r0, =gDummyObjectRotScalAnimTable + str r0, [sp, 0x10] + ldr r0, =DummyObjectCallback + str r0, [sp, 0x14] + lsls r5, 16 + asrs r5, 16 + lsls r6, 16 + asrs r6, 16 + mov r0, sp + adds r1, r5, 0 + adds r2, r6, 0 + mov r3, r9 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B5E6C + + thumb_func_start sub_80B5F0C +sub_80B5F0C: @ 80B5F0C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r1, r2, 0 + lsls r4, 24 + lsls r5, 16 + lsrs r5, 16 + ldr r0, =gTrainerFrontPicTable + lsrs r4, 21 + adds r0, r4, r0 + ldr r0, [r0] + bl LZDecompressVram + ldr r0, =gTrainerFrontPicPaletteTable + adds r4, r0 + ldr r0, [r4] + adds r1, r5, 0 + movs r2, 0x20 + bl decompress_palette + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B5F0C + + thumb_func_start AddNewGameBirchObject +AddNewGameBirchObject: @ 80B5F44 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =gNewGameBirchObjectPaletteInfo + bl LoadTaggedObjectPalette + ldr r0, =gNewGameBirchObjectTemplate + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end AddNewGameBirchObject + + thumb_func_start sub_80B5F84 +sub_80B5F84: @ 80B5F84 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 16 + lsrs r0, 16 + movs r3, 0x80 + lsls r3, 8 + lsls r1, 16 + asrs r1, 16 + str r1, [sp] + lsls r2, 16 + asrs r2, 16 + str r2, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + ldr r1, =gMonPaletteTable + lsls r4, r0, 3 + adds r4, r1 + ldrh r1, [r4, 0x4] + str r1, [sp, 0xC] + movs r1, 0 + adds r2, r3, 0 + movs r3, 0x1 + bl sub_818D7D8 + lsls r0, 16 + lsrs r5, r0, 16 + ldrh r0, [r4, 0x4] + bl IndexOfObjectPaletteTag + adds r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + bl sub_80AC3F8 + ldr r0, =0x0000ffff + cmp r5, r0 + beq _080B5FDC + lsls r0, r5, 24 + lsrs r0, 24 + b _080B5FDE + .pool +_080B5FDC: + movs r0, 0x40 +_080B5FDE: + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B5F84 + + thumb_func_start sub_80B5FE8 +sub_80B5FE8: @ 80B5FE8 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x10 + adds r6, r0, 0 + mov r9, r1 + mov r10, r2 + adds r4, r3, 0 + ldr r5, [sp, 0x2C] + lsls r6, 16 + lsrs r6, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + adds r0, r6, 0 + bl sub_806E7CC + mov r8, r0 + lsls r4, 16 + asrs r4, 16 + str r4, [sp] + lsls r5, 16 + asrs r5, 16 + str r5, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + mov r1, r8 + ldrh r0, [r1, 0x4] + str r0, [sp, 0xC] + adds r0, r6, 0 + mov r1, r9 + mov r2, r10 + movs r3, 0x1 + bl sub_818D7D8 + lsls r0, 16 + lsrs r4, r0, 16 + mov r1, r8 + ldrh r0, [r1, 0x4] + bl IndexOfObjectPaletteTag + adds r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + bl sub_80AC3F8 + ldr r0, =0x0000ffff + cmp r4, r0 + beq _080B605C + lsls r0, r4, 24 + lsrs r0, 24 + b _080B605E + .pool +_080B605C: + movs r0, 0x40 +_080B605E: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B5FE8 + + thumb_func_start sub_80B6070 +sub_80B6070: @ 80B6070 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + bl sub_80AC428 + ldrb r0, [r4, 0x1] + lsls r0, 30 + cmp r0, 0 + beq _080B608E + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry +_080B608E: + adds r0, r5, 0 + bl sub_818D820 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B6070 + + thumb_func_start sub_80B609C +sub_80B609C: @ 80B609C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 16 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r4, =0x02037714 + lsrs r0, 15 + adds r4, r0, r4 + ldrh r4, [r4] + movs r5, 0x1F + mov r9, r5 + mov r8, r4 + mov r6, r8 + ands r6, r5 + mov r8, r6 + movs r6, 0xF8 + lsls r6, 2 + ands r6, r4 + lsrs r6, 5 + movs r5, 0xF8 + lsls r5, 7 + ands r4, r5 + lsrs r4, 10 + mov r7, r9 + mov r5, r8 + subs r7, r5 + mov r12, r7 + mov r7, r12 + muls r7, r1 + adds r1, r7, 0 + asrs r1, 4 + add r8, r1 + mov r5, r9 + subs r1, r5, r6 + muls r1, r2 + asrs r1, 4 + adds r6, r1 + subs r5, r4 + mov r9, r5 + mov r1, r9 + muls r1, r3 + asrs r1, 4 + adds r4, r1 + mov r7, r8 + lsls r7, 16 + lsls r6, 21 + orrs r6, r7 + lsls r4, 26 + orrs r4, r6 + lsrs r4, 16 + ldr r1, =0x02037b14 + adds r0, r1 + strh r4, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B609C + + thumb_func_start sub_80B6128 +sub_80B6128: @ 80B6128 + push {r4-r6,lr} + mov r6, r8 + push {r6} + lsls r0, 16 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r4, =0x02037714 + lsrs r0, 15 + adds r4, r0, r4 + ldrh r4, [r4] + movs r5, 0x1F + mov r8, r5 + mov r6, r8 + ands r6, r4 + mov r8, r6 + movs r5, 0xF8 + lsls r5, 2 + ands r5, r4 + lsrs r5, 5 + movs r6, 0xF8 + lsls r6, 7 + ands r4, r6 + lsrs r4, 10 + mov r6, r8 + muls r6, r1 + adds r1, r6, 0 + asrs r1, 4 + mov r6, r8 + subs r6, r1 + adds r1, r5, 0 + muls r1, r2 + asrs r1, 4 + subs r5, r1 + adds r1, r4, 0 + muls r1, r3 + asrs r1, 4 + subs r4, r1 + lsls r6, 16 + lsls r5, 21 + orrs r5, r6 + lsls r4, 26 + orrs r4, r5 + lsrs r4, 16 + ldr r1, =0x02037b14 + adds r0, r1 + strh r4, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6128 + + thumb_func_start sub_80B61A0 +sub_80B61A0: @ 80B61A0 + push {r4,lr} + bl calc_player_party_count + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =sub_80B61E4 + movs r1, 0xFF + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r1, r0 + strh r4, [r1, 0xA] + movs r0, 0x5D + strh r0, [r1, 0xC] + movs r0, 0x24 + strh r0, [r1, 0xE] + movs r0, 0x7C + strh r0, [r1, 0x10] + movs r0, 0x18 + strh r0, [r1, 0x12] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B61A0 + + thumb_func_start sub_80B61E4 +sub_80B61E4: @ 80B61E4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r1, r0 + ldr r2, =gUnknown_0855C364 + movs r3, 0x8 + ldrsh r0, [r1, r3] + lsls r0, 2 + adds r0, r2 + ldr r2, [r0] + adds r0, r1, 0 + bl _call_via_r2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B61E4 + + thumb_func_start sub_80B6214 +sub_80B6214: @ 80B6214 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r1, 0xA + ldrsh r0, [r4, r1] + movs r2, 0xC + ldrsh r1, [r4, r2] + movs r3, 0xE + ldrsh r2, [r4, r3] + movs r3, 0x1 + bl sub_80B646C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x14] + movs r1, 0x10 + ldrsh r0, [r4, r1] + movs r2, 0x12 + ldrsh r1, [r4, r2] + bl sub_80B6850 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x16] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B6214 + + thumb_func_start sub_80B6250 +sub_80B6250: @ 80B6250 + push {r4,lr} + adds r2, r0, 0 + ldr r3, =0x02020630 + movs r1, 0x14 + ldrsh r0, [r2, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + movs r4, 0x2E + ldrsh r0, [r1, r4] + cmp r0, 0x1 + ble _080B6282 + movs r0, 0x16 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x2E] + adds r1, 0x1 + strh r1, [r0, 0x2E] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] +_080B6282: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6250 + + thumb_func_start sub_80B628C +sub_80B628C: @ 80B628C + push {lr} + adds r3, r0, 0 + ldr r2, =0x02020630 + movs r0, 0x14 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2E + ldrsh r0, [r0, r1] + cmp r0, 0x4 + ble _080B62AC + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_080B62AC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B628C + + thumb_func_start sub_80B62B4 +sub_80B62B4: @ 80B62B4 + push {lr} + ldr r2, =0x02020630 + movs r3, 0x14 + ldrsh r1, [r0, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0x6 + ble _080B62E6 + adds r0, r1, 0 + bl RemoveObjectAndFreeTiles + movs r0, 0x19 + bl FieldEffectActiveListRemove + ldr r0, =sub_80B61E4 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B62E6: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B62B4 + + thumb_func_start sub_80B62F4 +sub_80B62F4: @ 80B62F4 + push {r4,lr} + bl calc_player_party_count + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =sub_80B6330 + movs r1, 0xFF + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r1, r0 + strh r4, [r1, 0xA] + movs r0, 0x75 + strh r0, [r1, 0xC] + movs r0, 0x34 + strh r0, [r1, 0xE] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B62F4 + + thumb_func_start sub_80B6330 +sub_80B6330: @ 80B6330 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r1, r0 + ldr r2, =gUnknown_0855C374 + movs r3, 0x8 + ldrsh r0, [r1, r3] + lsls r0, 2 + adds r0, r2 + ldr r2, [r0] + adds r0, r1, 0 + bl _call_via_r2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6330 + + thumb_func_start sub_80B6360 +sub_80B6360: @ 80B6360 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r1, 0xA + ldrsh r0, [r4, r1] + movs r2, 0xC + ldrsh r1, [r4, r2] + movs r3, 0xE + ldrsh r2, [r4, r3] + movs r3, 0 + bl sub_80B646C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x14] + ldr r0, =sub_80B6330 + bl FindTaskIdByFunc + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x78 + movs r2, 0x18 + movs r3, 0 + bl sub_80B68EC + adds r0, r4, 0 + movs r1, 0x28 + movs r2, 0x8 + movs r3, 0x1 + bl sub_80B68EC + adds r0, r4, 0 + movs r1, 0x48 + movs r2, 0x8 + movs r3, 0x1 + bl sub_80B68EC + adds r0, r4, 0 + movs r1, 0xA8 + movs r2, 0x8 + movs r3, 0x1 + bl sub_80B68EC + adds r0, r4, 0 + movs r1, 0xC8 + movs r2, 0x8 + movs r3, 0x1 + bl sub_80B68EC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6360 + + thumb_func_start sub_80B63D4 +sub_80B63D4: @ 80B63D4 + push {lr} + adds r3, r0, 0 + ldr r2, =0x02020630 + movs r0, 0x14 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2E + ldrsh r0, [r0, r1] + cmp r0, 0x1 + ble _080B63FA + ldrh r0, [r3, 0x26] + adds r0, 0x1 + strh r0, [r3, 0x26] + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_080B63FA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B63D4 + + thumb_func_start sub_80B6404 +sub_80B6404: @ 80B6404 + push {lr} + adds r3, r0, 0 + ldr r2, =0x02020630 + movs r0, 0x14 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2E + ldrsh r0, [r0, r1] + cmp r0, 0x4 + ble _080B6424 + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_080B6424: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6404 + + thumb_func_start sub_80B642C +sub_80B642C: @ 80B642C + push {lr} + ldr r2, =0x02020630 + movs r3, 0x14 + ldrsh r1, [r0, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0x6 + ble _080B645E + adds r0, r1, 0 + bl RemoveObjectAndFreeTiles + movs r0, 0x3E + bl FieldEffectActiveListRemove + ldr r0, =sub_80B6330 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B645E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B642C + + thumb_func_start sub_80B646C +sub_80B646C: @ 80B646C + push {r4-r6,lr} + mov r6, r8 + push {r6} + mov r8, r0 + adds r4, r1, 0 + adds r5, r2, 0 + adds r6, r3, 0 + 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 + ldr r0, =sub_80B64C0 + bl obj_add_empty_with_callback + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r2, =0x02020630 + adds r1, r2 + strh r4, [r1, 0x24] + strh r5, [r1, 0x26] + strh r6, [r1, 0x38] + mov r2, r8 + strh r2, [r1, 0x3A] + strh r0, [r1, 0x3C] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B646C + + thumb_func_start sub_80B64C0 +sub_80B64C0: @ 80B64C0 + push {lr} + ldr r2, =gUnknown_0855C384 + movs r3, 0x2E + ldrsh r1, [r0, r3] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B64C0 + + thumb_func_start sub_80B64DC +sub_80B64DC: @ 80B64DC + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080B64F4 + subs r0, r1, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _080B6550 +_080B64F4: + movs r0, 0x19 + strh r0, [r4, 0x30] + ldr r0, =gUnknown_0855C304 + ldr r1, =gUnknown_0855C3A4 + movs r2, 0x32 + ldrsh r3, [r4, r2] + lsls r3, 2 + adds r3, r1 + ldrh r1, [r4, 0x24] + ldrh r2, [r3] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r4, 0x26] + ldrh r3, [r3, 0x2] + adds r2, r3 + lsls r2, 16 + asrs r2, 16 + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + 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 + movs r2, 0x8 + orrs r0, r2 + strb r0, [r1, 0x5] + ldrh r0, [r4, 0x3C] + strh r0, [r1, 0x2E] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x3A] + subs r0, 0x1 + strh r0, [r4, 0x3A] + movs r0, 0x17 + bl audio_play +_080B6550: + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B6562 + movs r0, 0x20 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_080B6562: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B64DC + + thumb_func_start sub_80B6574 +sub_80B6574: @ 80B6574 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x30] + subs r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + bne _080B65A4 + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + movs r0, 0x8 + strh r0, [r1, 0x30] + strh r2, [r1, 0x32] + strh r2, [r1, 0x34] + movs r2, 0x38 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _080B65A4 + movs r0, 0xB8 + lsls r0, 1 + bl fanfare_play +_080B65A4: + pop {r0} + bx r0 + thumb_func_end sub_80B6574 + + thumb_func_start sub_80B65A8 +sub_80B65A8: @ 80B65A8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r7, r0, 0 + ldrh r0, [r7, 0x30] + subs r0, 0x1 + strh r0, [r7, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _080B65D8 + movs r0, 0x8 + strh r0, [r7, 0x30] + ldrh r0, [r7, 0x32] + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + strh r0, [r7, 0x32] + cmp r0, 0 + bne _080B65D8 + ldrh r0, [r7, 0x34] + adds r0, 0x1 + strh r0, [r7, 0x34] +_080B65D8: + ldrh r4, [r7, 0x32] + adds r4, 0x3 + movs r0, 0x3 + mov r8, r0 + mov r1, r8 + ands r4, r1 + ldr r3, =0x00001007 + mov r10, r3 + mov r0, r10 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 4 + movs r1, 0x84 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + ldr r6, =gUnknown_0855C3BC + adds r1, r4, r6 + ldrb r1, [r1] + ldr r5, =gUnknown_0855C3C0 + adds r2, r4, r5 + ldrb r2, [r2] + ldr r3, =gUnknown_0855C3C4 + mov r9, r3 + add r4, r9 + ldrb r3, [r4] + bl sub_80B609C + ldrh r4, [r7, 0x32] + adds r4, 0x2 + mov r0, r8 + ands r4, r0 + mov r0, r10 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 4 + movs r1, 0x83 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + adds r1, r4, r6 + ldrb r1, [r1] + adds r2, r4, r5 + ldrb r2, [r2] + add r4, r9 + ldrb r3, [r4] + bl sub_80B609C + ldrh r4, [r7, 0x32] + adds r4, 0x1 + mov r3, r8 + ands r4, r3 + mov r0, r10 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 4 + movs r1, 0x81 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + adds r1, r4, r6 + ldrb r1, [r1] + adds r2, r4, r5 + ldrb r2, [r2] + add r4, r9 + ldrb r3, [r4] + bl sub_80B609C + ldrh r4, [r7, 0x32] + lsls r4, 24 + lsrs r4, 24 + mov r0, r10 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 4 + ldr r3, =0x01050000 + adds r0, r3 + lsrs r0, 16 + adds r6, r4, r6 + ldrb r6, [r6] + adds r5, r4, r5 + ldrb r5, [r5] + add r4, r9 + ldrb r4, [r4] + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80B609C + mov r0, r10 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 4 + ldr r1, =0x01030000 + adds r0, r1 + lsrs r0, 16 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80B609C + movs r3, 0x34 + ldrsh r0, [r7, r3] + cmp r0, 0x2 + ble _080B66C2 + ldrh r0, [r7, 0x2E] + adds r0, 0x1 + movs r1, 0 + strh r0, [r7, 0x2E] + movs r0, 0x8 + strh r0, [r7, 0x30] + strh r1, [r7, 0x32] +_080B66C2: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B65A8 + + thumb_func_start sub_80B66E8 +sub_80B66E8: @ 80B66E8 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r2, r0, 0 + ldrh r0, [r2, 0x30] + subs r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _080B6718 + movs r0, 0x8 + strh r0, [r2, 0x30] + ldrh r0, [r2, 0x32] + adds r0, 0x1 + movs r1, 0x3 + ands r0, r1 + strh r0, [r2, 0x32] + cmp r0, 0x3 + bne _080B6718 + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + movs r0, 0x1E + strh r0, [r2, 0x30] +_080B6718: + ldrh r4, [r2, 0x32] + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x00001007 + mov r8, r0 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 4 + movs r1, 0x84 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + ldr r1, =gUnknown_0855C3BC + adds r1, r4, r1 + ldrb r6, [r1] + ldr r1, =gUnknown_0855C3C0 + adds r1, r4, r1 + ldrb r5, [r1] + ldr r1, =gUnknown_0855C3C4 + adds r4, r1 + ldrb r4, [r4] + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80B609C + mov r0, r8 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 4 + movs r1, 0x83 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80B609C + mov r0, r8 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 4 + movs r1, 0x81 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80B609C + mov r0, r8 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 4 + ldr r1, =0x01050000 + adds r0, r1 + lsrs r0, 16 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80B609C + mov r0, r8 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 4 + ldr r1, =0x01030000 + adds r0, r1 + lsrs r0, 16 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80B609C + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B66E8 + + thumb_func_start sub_80B67DC +sub_80B67DC: @ 80B67DC + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x30] + subs r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _080B67F2 + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] +_080B67F2: + pop {r0} + bx r0 + thumb_func_end sub_80B67DC + + thumb_func_start sub_80B67F8 +sub_80B67F8: @ 80B67F8 + ldrh r1, [r0, 0x2E] + adds r1, 0x1 + strh r1, [r0, 0x2E] + bx lr + thumb_func_end sub_80B67F8 + + thumb_func_start sub_80B6800 +sub_80B6800: @ 80B6800 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080B6816 + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + beq _080B681C +_080B6816: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_080B681C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B6800 + + thumb_func_start nullsub_97 +nullsub_97: @ 80B6824 + bx lr + thumb_func_end nullsub_97 + + thumb_func_start sub_80B6828 +sub_80B6828: @ 80B6828 + push {lr} + adds r3, r0, 0 + ldr r2, =0x02020630 + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2E + ldrsh r0, [r0, r1] + cmp r0, 0x4 + ble _080B6848 + adds r0, r3, 0 + bl FieldEffectFreeGraphicsResources +_080B6848: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6828 + + thumb_func_start sub_80B6850 +sub_80B6850: @ 80B6850 + push {r4,lr} + adds r3, r0, 0 + adds r2, r1, 0 + ldr r0, =gUnknown_0855C31C + lsls r3, 16 + asrs r3, 16 + lsls r2, 16 + asrs r2, 16 + adds r1, r3, 0 + movs r3, 0 + bl AddObjectToBack + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0, 0x5] + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r3] + ldr r1, =gUnknown_0855C2AC + bl SetSpriteOamTables_NoPriorityFromTable + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B6850 + + thumb_func_start sub_80B68AC +sub_80B68AC: @ 80B68AC + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080B68D0 + movs r0, 0 + strh r0, [r4, 0x2E] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + subs r0, 0x5 + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnim +_080B68D0: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080B68E4 + adds r0, r4, 0 + bl FieldEffectFreeGraphicsResources +_080B68E4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B68AC + + thumb_func_start sub_80B68EC +sub_80B68EC: @ 80B68EC + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 24 + cmp r3, 0 + bne _080B6934 + ldr r0, =gUnknown_0855C334 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + ldr r1, =gUnknown_0855C2C4 + bl SetSpriteOamTables_NoPriorityFromTable + b _080B6948 + .pool +_080B6934: + ldr r0, =gUnknown_0855C34C + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r4, r0, 24 +_080B6948: + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r3] + strh r5, [r0, 0x2E] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B68EC + + thumb_func_start sub_80B6970 +sub_80B6970: @ 80B6970 + push {lr} + adds r3, r0, 0 + ldr r2, =0x03005e00 + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x26 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _080B69C6 + ldrh r1, [r3, 0x30] + movs r2, 0x30 + ldrsh r0, [r3, r2] + cmp r0, 0 + beq _080B699E + subs r0, r1, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _080B69C0 +_080B699E: + movs r0, 0x10 + strh r0, [r3, 0x30] + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r2, [r0] + 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 + mov r1, r12 + strb r0, [r1] +_080B69C0: + ldrh r0, [r3, 0x32] + adds r0, 0x1 + strh r0, [r3, 0x32] +_080B69C6: + movs r2, 0x32 + ldrsh r0, [r3, r2] + cmp r0, 0x7F + ble _080B69D4 + adds r0, r3, 0 + bl FieldEffectFreeGraphicsResources +_080B69D4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6970 + + thumb_func_start sub_80B69DC +sub_80B69DC: @ 80B69DC + push {lr} + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + ldr r1, =0x03005dac + ldr r0, =mapldr_080842E8 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B69DC + + thumb_func_start mapldr_080842E8 +mapldr_080842E8: @ 80B69FC + push {lr} + bl pal_fill_black + ldr r0, =task00_8084310 + movs r1, 0 + bl CreateTask + bl script_env_2_enable + bl player_bitmagic + ldr r1, =0x03005dac + movs r0, 0 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end mapldr_080842E8 + + thumb_func_start task00_8084310 +task00_8084310: @ 80B6A24 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r6, [r4, r0] + cmp r6, 0 + bne _080B6A64 + bl sub_80ABDFC + lsls r0, 24 + cmp r0, 0 + beq _080B6A8A + bl brm_get_pokemon_selection + ldr r1, =0x02038c08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + cmp r0, 0x5 + ble _080B6A58 + str r6, [r1] +_080B6A58: + movs r0, 0x1F + bl FieldEffectStart + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B6A64: + movs r0, 0x1F + bl FieldEffectActiveListContains + lsls r0, 24 + cmp r0, 0 + bne _080B6A8A + bl flag_var_implications_of_teleport_ + bl warp_in + ldr r0, =c2_load_new_map + bl SetMainCallback2 + ldr r1, =0x03005dac + ldr r0, =mapldr_08084390 + str r0, [r1] + adds r0, r5, 0 + bl DestroyTask +_080B6A8A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end task00_8084310 + + thumb_func_start mapldr_08084390 +mapldr_08084390: @ 80B6AA4 + push {r4,lr} + bl sub_8085784 + bl pal_fill_black + ldr r0, =c3_080843F8 + movs r1, 0 + bl CreateTask + ldr r4, =0x02037350 + ldr r3, =0x02037590 + ldrb r1, [r3, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x1] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x1] + ldrb r1, [r3] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080B6AE6 + ldrb r1, [r3, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x3 + bl FieldObjectTurn +_080B6AE6: + bl script_env_2_enable + bl player_bitmagic + ldr r1, =0x03005dac + movs r0, 0 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end mapldr_08084390 + + thumb_func_start c3_080843F8 +c3_080843F8: @ 80B6B0C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B6B3E + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B6B58 + movs r0, 0x20 + bl FieldEffectStart + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B6B3E: + movs r0, 0x20 + bl FieldEffectActiveListContains + lsls r0, 24 + cmp r0, 0 + bne _080B6B58 + bl script_env_2_disable + bl sub_809757C + adds r0, r5, 0 + bl DestroyTask +_080B6B58: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end c3_080843F8 + + thumb_func_start sub_80B6B68 +sub_80B6B68: @ 80B6B68 + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + bl script_env_2_enable + bl player_bitmagic + ldr r0, =sub_80B6B94 + movs r1, 0 + bl CreateTask + ldr r1, =0x03005dac + movs r0, 0 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6B68 + + thumb_func_start sub_80B6B94 +sub_80B6B94: @ 80B6B94 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r4, r1, r0 + ldr r5, =gUnknown_0855C3C8 +_080B6BA6: + 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 _080B6BA6 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6B94 + + thumb_func_start sub_80B6BCC +sub_80B6BCC: @ 80B6BCC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + mov r9, r0 + ldr r6, =0x02037590 + ldrb r0, [r6, 0x5] + lsls r5, r0, 3 + adds r5, r0 + lsls r5, 2 + ldr r0, =0x02037350 + mov r8, r0 + add r5, r8 + ldrb r0, [r6, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + bl CameraObjectReset2 + ldrb r1, [r6, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r1, [r0, 0x1] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x1] + movs r0, 0x1 + strb r0, [r6, 0x6] + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl FieldObjectSetSpecialAnim + adds r3, r4, 0 + adds r3, 0x42 + ldrb r0, [r3] + lsrs r0, 6 + mov r1, r9 + strh r0, [r1, 0x10] + ldrb r0, [r5, 0x3] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r5, 0x3] + ldrb r1, [r4, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x5] + ldrb r1, [r3] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r3] + mov r1, r9 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0x1 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B6BCC + + thumb_func_start sub_80B6C74 +sub_80B6C74: @ 80B6C74 + push {r4,lr} + adds r4, r0, 0 + bl sub_80ABDFC + lsls r0, 24 + cmp r0, 0 + beq _080B6C88 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B6C88: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B6C74 + + thumb_func_start sub_80B6C90 +sub_80B6C90: @ 80B6C90 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, =0x02037590 + ldrb r0, [r6, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x02020630 + adds r2, r0 + adds r0, r2, 0 + adds r0, 0x29 + movs r4, 0 + ldrsb r4, [r0, r4] + lsls r0, r4, 17 + negs r0, r0 + ldrh r1, [r2, 0x22] + ldr r3, =0x02021bbe + adds r1, r4 + ldrh r3, [r3] + adds r1, r3 + asrs r0, 16 + adds r0, r1 + negs r0, r0 + movs r1, 0 + strh r0, [r2, 0x26] + movs r0, 0x1 + strh r0, [r5, 0xA] + strh r1, [r5, 0xC] + ldr r2, =0x02037350 + ldrb r0, [r6, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r2, [r1, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x1] + movs r0, 0x2B + bl audio_play + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B6C90 + + thumb_func_start sub_80B6D04 +sub_80B6D04: @ 80B6D04 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r2, =0x02037590 + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r6, r0, r1 + ldrb r1, [r2, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r5, r0, r1 + ldrh r0, [r4, 0xA] + ldrh r1, [r5, 0x26] + adds r0, r1 + strh r0, [r5, 0x26] + ldrh r2, [r4, 0xA] + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x7 + bgt _080B6D46 + ldrh r1, [r4, 0xC] + adds r0, r2, r1 + strh r0, [r4, 0xC] + movs r1, 0xF + ands r0, r1 + cmp r0, 0 + beq _080B6D46 + lsls r0, r2, 1 + strh r0, [r4, 0xA] +_080B6D46: + ldrh r2, [r4, 0xE] + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B6D84 + movs r0, 0x26 + ldrsh r1, [r5, r0] + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + blt _080B6D84 + adds r0, r2, 0x1 + strh r0, [r4, 0xE] + ldrb r1, [r6, 0x3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r6, 0x3] + ldrb r1, [r4, 0x10] + adds r3, r5, 0 + adds r3, 0x42 + lsls r1, 6 + ldrb r2, [r3] + movs r0, 0x3F + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + ldrb r0, [r6] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r6] +_080B6D84: + movs r1, 0x26 + ldrsh r0, [r5, r1] + cmp r0, 0 + blt _080B6DA8 + movs r0, 0xD6 + bl audio_play + ldrb r0, [r6] + movs r1, 0x8 + orrs r0, r1 + movs r1, 0x20 + orrs r0, r1 + strb r0, [r6] + movs r0, 0 + strh r0, [r5, 0x26] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B6DA8: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B6D04 + + thumb_func_start sub_80B6DBC +sub_80B6DBC: @ 80B6DBC + push {lr} + ldrh r1, [r0, 0x8] + adds r1, 0x1 + movs r2, 0 + strh r1, [r0, 0x8] + movs r1, 0x4 + strh r1, [r0, 0xA] + strh r2, [r0, 0xC] + movs r0, 0 + bl SetCameraPanningCallback + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_80B6DBC + + thumb_func_start sub_80B6DD8 +sub_80B6DD8: @ 80B6DD8 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0 + bl SetCameraPanning + ldrh r0, [r4, 0xA] + negs r2, r0 + strh r2, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080B6E00 + lsls r0, r2, 16 + asrs r0, 17 + strh r0, [r4, 0xA] +_080B6E00: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B6E0E + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B6E0E: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B6DD8 + + thumb_func_start sub_80B6E18 +sub_80B6E18: @ 80B6E18 + push {lr} + ldr r1, =0x02037590 + movs r0, 0 + strb r0, [r1, 0x6] + bl script_env_2_disable + bl CameraObjectReset1 + bl sub_809757C + bl InstallCameraPanAheadCallback + ldr r0, =sub_80B6B94 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B6E18 + + thumb_func_start sub_80B6E4C +sub_80B6E4C: @ 80B6E4C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =sub_80B6E88 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0xA] + cmp r4, 0x6A + bne _080B6E78 + movs r0, 0x1 + strh r0, [r1, 0xA] +_080B6E78: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6E4C + + thumb_func_start sub_80B6E88 +sub_80B6E88: @ 80B6E88 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r4, r1, r0 + ldr r5, =gUnknown_0855C3E4 +_080B6E9A: + 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 _080B6E9A + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6E88 + + thumb_func_start sub_80B6EC0 +sub_80B6EC0: @ 80B6EC0 + push {r4,lr} + adds r4, r0, 0 + bl player_bitmagic + bl CameraObjectReset2 + ldrb r0, [r4, 0xA] + bl sub_80E1558 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B6EC0 + + thumb_func_start sub_80B6EE0 +sub_80B6EE0: @ 80B6EE0 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + adds r0, r4, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _080B6F0A + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B6F3E +_080B6F0A: + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + ldrh r0, [r5, 0x8] + adds r0, 0x1 + movs r1, 0 + strh r0, [r5, 0x8] + strh r1, [r5, 0xC] + strh r1, [r5, 0xE] + ldrb r0, [r5, 0xA] + cmp r0, 0 + bne _080B6F38 + movs r0, 0x4 + strh r0, [r5, 0x8] +_080B6F38: + movs r0, 0x50 + bl audio_play +_080B6F3E: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B6EE0 + + thumb_func_start sub_80B6F50 +sub_80B6F50: @ 80B6F50 + push {r4,lr} + adds r4, r0, 0 + bl sub_80B6FB8 + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x3 + ble _080B6F6A + bl sub_80B7050 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B6F6A: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B6F50 + + thumb_func_start sub_80B6F74 +sub_80B6F74: @ 80B6F74 + push {lr} + bl sub_80B6FB8 + bl sub_80B7060 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_80B6F74 + + thumb_func_start sub_80B6F84 +sub_80B6F84: @ 80B6F84 + push {r4,lr} + adds r4, r0, 0 + bl sub_80B7004 + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x3 + ble _080B6F9E + bl sub_80B7050 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B6F9E: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B6F84 + + thumb_func_start sub_80B6FA8 +sub_80B6FA8: @ 80B6FA8 + push {lr} + bl sub_80B7004 + bl sub_80B7060 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_80B6FA8 + + thumb_func_start sub_80B6FB8 +sub_80B6FB8: @ 80B6FB8 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + movs r0, 0xC + ldrsh r1, [r5, r0] + movs r0, 0x84 + bl cosine + strh r0, [r4, 0x24] + movs r0, 0xC + ldrsh r1, [r5, r0] + movs r0, 0x94 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r5, 0xE] + adds r0, 0x1 + strh r0, [r5, 0xE] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B6FF6 + ldrh r0, [r5, 0xC] + adds r0, 0x1 + strh r0, [r5, 0xC] +_080B6FF6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B6FB8 + + thumb_func_start sub_80B7004 +sub_80B7004: @ 80B7004 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + movs r0, 0xC + ldrsh r1, [r5, r0] + movs r0, 0x7C + bl cosine + strh r0, [r4, 0x24] + movs r0, 0xC + ldrsh r1, [r5, r0] + movs r0, 0x76 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r5, 0xE] + adds r0, 0x1 + strh r0, [r5, 0xE] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B7042 + ldrh r0, [r5, 0xC] + adds r0, 0x1 + strh r0, [r5, 0xC] +_080B7042: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B7004 + + thumb_func_start sub_80B7050 +sub_80B7050: @ 80B7050 + push {lr} + bl music_something + bl sub_80AF0B4 + pop {r0} + bx r0 + thumb_func_end sub_80B7050 + + thumb_func_start sub_80B7060 +sub_80B7060: @ 80B7060 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B709C + bl sub_80859A0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B709C + bl sub_80E1570 + bl warp_in + ldr r1, =0x03005dac + ldr r0, =sub_80B70B4 + str r0, [r1] + ldr r0, =c2_load_new_map + bl SetMainCallback2 + ldr r0, =sub_80B6E88 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B709C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B7060 + + thumb_func_start sub_80B70B4 +sub_80B70B4: @ 80B70B4 + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + bl script_env_2_enable + ldr r0, =sub_80B70DC + movs r1, 0 + bl CreateTask + ldr r1, =0x03005dac + movs r0, 0 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B70B4 + + thumb_func_start sub_80B70DC +sub_80B70DC: @ 80B70DC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r4, r1, r0 + ldr r5, =gUnknown_0855C3FC +_080B70EE: + 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 _080B70EE + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B70DC + + thumb_func_start sub_80B7114 +sub_80B7114: @ 80B7114 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + bl CameraObjectReset2 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + movs r0, 0x4 + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r1, r0, 24 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0x10 + strh r0, [r5, 0xA] + cmp r1, 0x6B + bne _080B717C + movs r1, 0x1 + movs r0, 0x3 + strh r0, [r5, 0x8] + b _080B717E + .pool +_080B717C: + movs r1, 0 +_080B717E: + adds r0, r1, 0 + bl sub_80E1558 + movs r0, 0x1 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B7114 + + thumb_func_start sub_80B7190 +sub_80B7190: @ 80B7190 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + movs r0, 0xA + ldrsh r1, [r5, r0] + movs r0, 0x84 + bl cosine + strh r0, [r4, 0x24] + movs r0, 0xA + ldrsh r1, [r5, r0] + movs r0, 0x94 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B7190 + + thumb_func_start sub_80B71D0 +sub_80B71D0: @ 80B71D0 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r5, r0, r1 + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0x84 + bl cosine + strh r0, [r5, 0x24] + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0x94 + bl sine + strh r0, [r5, 0x26] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B720E + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] +_080B720E: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B721E + strh r0, [r5, 0x24] + strh r0, [r5, 0x26] + movs r0, 0x5 + strh r0, [r4, 0x8] +_080B721E: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B71D0 + + thumb_func_start sub_80B7230 +sub_80B7230: @ 80B7230 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + movs r0, 0xA + ldrsh r1, [r5, r0] + movs r0, 0x7C + bl cosine + strh r0, [r4, 0x24] + movs r0, 0xA + ldrsh r1, [r5, r0] + movs r0, 0x76 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B7230 + + thumb_func_start sub_80B7270 +sub_80B7270: @ 80B7270 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r5, r0, r1 + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0x7C + bl cosine + strh r0, [r5, 0x24] + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0x76 + bl sine + strh r0, [r5, 0x26] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B72AE + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] +_080B72AE: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B72C0 + strh r0, [r5, 0x24] + strh r0, [r5, 0x26] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B72C0: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B7270 + + thumb_func_start sub_80B72D0 +sub_80B72D0: @ 80B72D0 + push {r4,lr} + adds r4, r0, 0 + bl sub_80E1584 + lsls r0, 24 + cmp r0, 0 + bne _080B72EC + bl sub_80E1570 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + b _080B72EE +_080B72EC: + movs r0, 0 +_080B72EE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B72D0 + + thumb_func_start sub_80B72F4 +sub_80B72F4: @ 80B72F4 + push {r4,lr} + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B7338 + bl CameraObjectReset1 + bl script_env_2_disable + movs r0, 0x4 + bl GetGoSpeed0AnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + ldr r0, =sub_80B70DC + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B7338: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B72F4 + + thumb_func_start oei_waterfall +oei_waterfall: @ 80B734C + push {r4,lr} + ldr r4, =sub_80B7384 + adds r0, r4, 0 + movs r1, 0xFF + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =0x02038c08 + ldr r2, [r2] + strh r2, [r1, 0xA] + bl _call_via_r4 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end oei_waterfall + + thumb_func_start sub_80B7384 +sub_80B7384: @ 80B7384 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_0855C418 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_080B7396: + movs r0, 0x8 + ldrsh r2, [r4, r0] + lsls r2, 2 + adds r2, r5 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02037350 + adds r1, r0 + ldr r2, [r2] + adds r0, r4, 0 + bl _call_via_r2 + lsls r0, 24 + cmp r0, 0 + bne _080B7396 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B7384 + + thumb_func_start sub_80B73D0 +sub_80B73D0: @ 80B73D0 + push {r4,lr} + adds r4, r0, 0 + bl script_env_2_enable + ldr r1, =0x02037590 + movs r0, 0x1 + strb r0, [r1, 0x6] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B73D0 + + thumb_func_start waterfall_1_do_anim_probably +waterfall_1_do_anim_probably: @ 80B73F0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl script_env_2_enable + adds r0, r5, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + bne _080B7420 + adds r0, r5, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + ldr r1, =0x02038c08 + movs r2, 0xA + ldrsh r0, [r4, r2] + str r0, [r1] + movs r0, 0x3B + bl FieldEffectStart + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B7420: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end waterfall_1_do_anim_probably + + thumb_func_start waterfall_2_wait_anim_finish_probably +waterfall_2_wait_anim_finish_probably: @ 80B742C + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x6 + bl FieldEffectActiveListContains + lsls r0, 24 + cmp r0, 0 + bne _080B7446 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + b _080B7448 +_080B7446: + movs r0, 0 +_080B7448: + pop {r4} + pop {r1} + bx r1 + thumb_func_end waterfall_2_wait_anim_finish_probably + + thumb_func_start sub_80B7450 +sub_80B7450: @ 80B7450 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r0, 0x2 + bl GetSimpleGoAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B7450 + + thumb_func_start sub_80B7478 +sub_80B7478: @ 80B7478 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + bne _080B748E + movs r0, 0 + b _080B74CA +_080B748E: + ldrb r0, [r4, 0x1E] + bl MetatileBehavior_IsWaterfall + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080B74C4 + bl script_env_2_disable + ldr r0, =0x02037590 + strb r4, [r0, 0x6] + ldr r0, =sub_80B7384 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0x2B + bl FieldEffectActiveListRemove + movs r0, 0 + b _080B74CA + .pool +_080B74C4: + movs r0, 0x3 + strh r0, [r5, 0x8] + movs r0, 0x1 +_080B74CA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B7478 + + thumb_func_start sub_80B74D0 +sub_80B74D0: @ 80B74D0 + push {r4,lr} + ldr r4, =sub_80B750C + adds r0, r4, 0 + movs r1, 0xFF + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r3, =0x02038c08 + ldr r2, [r3] + strh r2, [r1, 0x26] + ldr r2, [r3, 0x4] + strh r2, [r1, 0x24] + bl _call_via_r4 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B74D0 + + thumb_func_start sub_80B750C +sub_80B750C: @ 80B750C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_0855C42C + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_080B751E: + 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 _080B751E + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B750C + + thumb_func_start dive_1_lock +dive_1_lock: @ 80B7544 + ldr r2, =0x02037590 + movs r1, 0x1 + strb r1, [r2, 0x6] + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + movs r0, 0 + bx lr + .pool + thumb_func_end dive_1_lock + + thumb_func_start dive_2_unknown +dive_2_unknown: @ 80B7558 + push {r4,lr} + adds r4, r0, 0 + bl script_env_2_enable + ldr r1, =0x02038c08 + movs r2, 0x26 + ldrsh r0, [r4, r2] + str r0, [r1] + movs r0, 0x3B + bl FieldEffectStart + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end dive_2_unknown + + thumb_func_start dive_3_unknown +dive_3_unknown: @ 80B7580 + push {lr} + sub sp, 0x8 + mov r1, sp + adds r1, 0x2 + mov r0, sp + bl PlayerGetDestCoords + movs r0, 0x6 + bl FieldEffectActiveListContains + lsls r0, 24 + cmp r0, 0 + bne _080B75C4 + ldr r2, =0x02037350 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1E] + mov r0, sp + bl dive_warp + ldr r0, =sub_80B750C + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0x2C + bl FieldEffectActiveListRemove +_080B75C4: + movs r0, 0 + add sp, 0x8 + pop {r1} + bx r1 + .pool + thumb_func_end dive_3_unknown + + thumb_func_start sub_80B75D8 +sub_80B75D8: @ 80B75D8 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =sub_80B75F0 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B75D8 + + thumb_func_start sub_80B75F0 +sub_80B75F0: @ 80B75F0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r6, =gUnknown_0855C438 + ldr r2, =0x03005e00 + ldr r5, =0x02037590 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_080B7604: + movs r0, 0x8 + ldrsh r3, [r4, r0] + lsls r3, 2 + adds r3, r6 + ldrb r0, [r5, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02037350 + adds r1, r0 + ldrb r0, [r5, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x02020630 + adds r2, r0 + ldr r3, [r3] + adds r0, r4, 0 + bl _call_via_r3 + lsls r0, 24 + cmp r0, 0 + bne _080B7604 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B75F0 + + thumb_func_start sub_80B764C +sub_80B764C: @ 80B764C + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl player_bitmagic + bl CameraObjectReset2 + movs r0, 0 + bl SetCameraPanningCallback + ldr r0, =0x02037590 + movs r2, 0x1 + strb r2, [r0, 0x6] + ldrb r0, [r5, 0x3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r5, 0x3] + strh r2, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B764C + + thumb_func_start sub_80B7684 +sub_80B7684: @ 80B7684 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0 + bl SetCameraPanning + ldrh r0, [r4, 0xA] + negs r0, r0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _080B76B0 + movs r0, 0 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B76B0: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B7684 + + thumb_func_start sub_80B76B8 +sub_80B76B8: @ 80B76B8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0 + strh r0, [r2, 0x26] + movs r0, 0x1 + strh r0, [r4, 0xE] + ldr r3, =0x02038c08 + movs r5, 0x10 + ldrsh r0, [r1, r5] + str r0, [r3] + movs r5, 0x12 + ldrsh r0, [r1, r5] + str r0, [r3, 0x4] + adds r0, r2, 0 + adds r0, 0x43 + ldrb r0, [r0] + subs r0, 0x1 + str r0, [r3, 0x8] + ldrb r0, [r2, 0x5] + lsls r0, 28 + lsrs r0, 30 + str r0, [r3, 0xC] + movs r0, 0x32 + bl FieldEffectStart + movs r0, 0xB2 + bl audio_play + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B76B8 + + thumb_func_start sub_80B7704 +sub_80B7704: @ 80B7704 + push {r4-r7,lr} + adds r4, r0, 0 + adds r6, r1, 0 + adds r5, r2, 0 + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0 + bl SetCameraPanning + ldrh r0, [r4, 0xA] + negs r2, r0 + strh r2, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r1, r0, 0x1 + strh r1, [r4, 0xC] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x11 + bgt _080B773E + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + bne _080B7750 + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x3 + bgt _080B7750 + lsls r0, r2, 1 + b _080B774E +_080B773E: + movs r0, 0x4 + ands r1, r0 + cmp r1, 0 + bne _080B7750 + lsls r0, r2, 16 + cmp r0, 0 + ble _080B7750 + asrs r0, 17 +_080B774E: + strh r0, [r4, 0xA] +_080B7750: + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x6 + ble _080B779C + adds r0, r5, 0 + adds r0, 0x29 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r2, r1, 17 + negs r2, r2 + movs r7, 0x26 + ldrsh r3, [r5, r7] + movs r7, 0x22 + ldrsh r0, [r5, r7] + adds r0, r1 + ldr r1, =0x02021bbe + movs r7, 0 + ldrsh r1, [r1, r7] + adds r0, r1 + asrs r2, 16 + adds r0, r2 + cmn r3, r0 + ble _080B7798 + ldrh r0, [r5, 0x26] + ldrh r1, [r4, 0xE] + subs r0, r1 + strh r0, [r5, 0x26] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x7 + bgt _080B779C + adds r0, r1, 0x1 + strh r0, [r4, 0xE] + b _080B779C + .pool +_080B7798: + movs r0, 0x1 + strh r0, [r4, 0x10] +_080B779C: + ldrh r2, [r4, 0x12] + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B77DA + movs r7, 0x26 + ldrsh r1, [r5, r7] + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + bge _080B77DA + adds r0, r2, 0x1 + strh r0, [r4, 0x12] + ldrb r0, [r6, 0x3] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r6, 0x3] + ldrb r1, [r5, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + adds r2, r5, 0 + adds r2, 0x42 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] +_080B77DA: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B77F0 + movs r7, 0x10 + ldrsh r0, [r4, r7] + cmp r0, 0 + beq _080B77F0 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B77F0: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80B7704 + + thumb_func_start sub_80B77F8 +sub_80B77F8: @ 80B77F8 + push {r4,lr} + adds r4, r0, 0 + bl music_something + bl sub_80AF0B4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B77F8 + + thumb_func_start sub_80B7814 +sub_80B7814: @ 80B7814 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B784C + bl sub_80859A0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B784C + bl warp_in + ldr r1, =0x03005dac + ldr r0, =mapldr_080851BC + str r0, [r1] + ldr r0, =c2_load_new_map + bl SetMainCallback2 + ldr r0, =sub_80B75F0 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B784C: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B7814 + + thumb_func_start mapldr_080851BC +mapldr_080851BC: @ 80B7868 + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + bl script_env_2_enable + ldr r0, =0x03005dac + movs r1, 0 + str r1, [r0] + ldr r0, =sub_80B7890 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end mapldr_080851BC + + thumb_func_start sub_80B7890 +sub_80B7890: @ 80B7890 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r6, =gUnknown_0855C450 + ldr r2, =0x03005e00 + ldr r5, =0x02037590 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_080B78A4: + movs r0, 0x8 + ldrsh r3, [r4, r0] + lsls r3, 2 + adds r3, r6 + ldrb r0, [r5, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02037350 + adds r1, r0 + ldrb r0, [r5, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x02020630 + adds r2, r0 + ldr r3, [r3] + adds r0, r4, 0 + bl _call_via_r3 + lsls r0, 24 + cmp r0, 0 + bne _080B78A4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B7890 + + thumb_func_start sub_80B78EC +sub_80B78EC: @ 80B78EC + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + bl CameraObjectReset2 + bl player_bitmagic + ldr r1, =0x02037590 + movs r0, 0x1 + strb r0, [r1, 0x6] + ldrb r0, [r4, 0x1] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B78EC + + thumb_func_start sub_80B791C +sub_80B791C: @ 80B791C + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + bl sub_80ABDFC + lsls r0, 24 + cmp r0, 0 + beq _080B795C + ldr r1, =0x02038c08 + movs r2, 0x10 + ldrsh r0, [r5, r2] + str r0, [r1] + movs r2, 0x12 + ldrsh r0, [r5, r2] + str r0, [r1, 0x4] + adds r0, r6, 0 + adds r0, 0x43 + ldrb r0, [r0] + subs r0, 0x1 + str r0, [r1, 0x8] + ldrb r0, [r6, 0x5] + lsls r0, 28 + lsrs r0, 30 + str r0, [r1, 0xC] + movs r0, 0x31 + bl FieldEffectStart + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B795C: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B791C + + thumb_func_start sub_80B7968 +sub_80B7968: @ 80B7968 + push {r4,lr} + adds r2, r0, 0 + adds r4, r1, 0 + movs r0, 0xA + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0x1 + bls _080B79B0 + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + ldrb r1, [r4, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] + bl CameraObjectReset1 + movs r0, 0xAF + bl audio_play + movs r0, 0x4 + bl sub_8093514 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim +_080B79B0: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B7968 + + thumb_func_start sub_80B79BC +sub_80B79BC: @ 80B79BC + push {lr} + adds r0, r1, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B79E6 + ldr r1, =0x02037590 + movs r0, 0 + strb r0, [r1, 0x6] + bl script_env_2_disable + bl sub_809757C + ldr r0, =sub_80B7890 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B79E6: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B79BC + + thumb_func_start sub_80B79F4 +sub_80B79F4: @ 80B79F4 + push {r4,lr} + ldr r4, =0x02038c08 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + adds r0, 0x84 + ldr r0, [r0] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + movs r1, 0x3 + ldrb r3, [r4, 0xC] + ands r3, r1 + lsls r3, 2 + ldrb r4, [r2, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r4 + orrs r1, r3 + strb r1, [r2, 0x5] + adds r2, 0x3E + ldrb r1, [r2] + movs r3, 0x2 + orrs r1, r3 + strb r1, [r2] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B79F4 + + thumb_func_start sub_80B7A58 +sub_80B7A58: @ 80B7A58 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080B7A70 + adds r0, r2, 0 + movs r1, 0x32 + bl FieldEffectStop +_080B7A70: + pop {r0} + bx r0 + thumb_func_end sub_80B7A58 + + thumb_func_start sub_80B7A74 +sub_80B7A74: @ 80B7A74 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =sub_80B7A8C + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B7A74 + + thumb_func_start sub_80B7A8C +sub_80B7A8C: @ 80B7A8C + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r6, =gUnknown_0855C460 + ldr r2, =0x03005e00 + ldr r5, =0x02037590 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_080B7AA0: + movs r0, 0x8 + ldrsh r3, [r4, r0] + lsls r3, 2 + adds r3, r6 + ldrb r0, [r5, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02037350 + adds r1, r0 + ldrb r0, [r5, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x02020630 + adds r2, r0 + ldr r3, [r3] + adds r0, r4, 0 + bl _call_via_r3 + lsls r0, 24 + cmp r0, 0 + bne _080B7AA0 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B7A8C + + thumb_func_start sub_80B7AE8 +sub_80B7AE8: @ 80B7AE8 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + bl player_bitmagic + bl CameraObjectReset2 + ldr r1, =0x02037590 + movs r0, 0x1 + strb r0, [r1, 0x6] + ldrb r0, [r4, 0x3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4, 0x3] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B7AE8 + + thumb_func_start sub_80B7B18 +sub_80B7B18: @ 80B7B18 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r6, r2, 0 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B7B8C + ldrh r1, [r5, 0xA] + movs r2, 0xA + ldrsh r0, [r5, r2] + cmp r0, 0x3 + ble _080B7B6C + ldr r1, =0x02038c08 + movs r2, 0x10 + ldrsh r0, [r4, r2] + str r0, [r1] + movs r2, 0x12 + ldrsh r0, [r4, r2] + str r0, [r1, 0x4] + adds r0, r6, 0 + adds r0, 0x43 + ldrb r0, [r0] + subs r0, 0x1 + str r0, [r1, 0x8] + ldrb r0, [r6, 0x5] + lsls r0, 28 + lsrs r0, 30 + str r0, [r1, 0xC] + movs r0, 0x31 + bl FieldEffectStart + strh r0, [r5, 0xA] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _080B7B8C + .pool +_080B7B6C: + adds r0, r1, 0x1 + strh r0, [r5, 0xA] + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetStepInPlaceDelay4AnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + movs r0, 0x27 + bl audio_play +_080B7B8C: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B7B18 + + thumb_func_start sub_80B7B94 +sub_80B7B94: @ 80B7B94 + push {r4,lr} + adds r3, r0, 0 + adds r4, r1, 0 + ldr r2, =0x02020630 + movs r0, 0xA + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0x2 + bne _080B7BBE + ldrb r0, [r4, 0x1] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_080B7BBE: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B7B94 + + thumb_func_start sub_80B7BCC +sub_80B7BCC: @ 80B7BCC + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x31 + bl FieldEffectActiveListContains + lsls r0, 24 + cmp r0, 0 + bne _080B7BEA + bl music_something + bl sub_80AF0B4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B7BEA: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B7BCC + + thumb_func_start sub_80B7BF4 +sub_80B7BF4: @ 80B7BF4 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B7C2C + bl sub_80859A0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B7C2C + bl warp_in + ldr r1, =0x03005dac + ldr r0, =sub_80B6B68 + str r0, [r1] + ldr r0, =c2_load_new_map + bl SetMainCallback2 + ldr r0, =sub_80B7A8C + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B7C2C: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B7BF4 + + thumb_func_start sub_80B7C48 +sub_80B7C48: @ 80B7C48 + push {r4,lr} + ldr r4, =0x02038c08 + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0x8 + movs r3, 0x8 + bl sub_80930E0 + ldr r0, =gFieldEffectObjectTemplatePointers + adds r0, 0x80 + ldr r0, [r0] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x4 + ldrsh r2, [r4, r3] + ldrb r3, [r4, 0x8] + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + movs r1, 0x3 + ldrb r3, [r4, 0xC] + ands r3, r1 + lsls r3, 2 + ldrb r4, [r2, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r4 + orrs r1, r3 + strb r1, [r2, 0x5] + adds r2, 0x3E + ldrb r1, [r2] + movs r3, 0x2 + orrs r1, r3 + strb r1, [r2] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B7C48 + + thumb_func_start sub_80B7CAC +sub_80B7CAC: @ 80B7CAC + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080B7CC4 + adds r0, r2, 0 + movs r1, 0x31 + bl FieldEffectStop +_080B7CC4: + pop {r0} + bx r0 + thumb_func_end sub_80B7CAC + + thumb_func_start sub_80B7CC8 +sub_80B7CC8: @ 80B7CC8 + push {lr} + bl script_env_2_enable + bl player_bitmagic + ldr r0, =sub_80B7CE4 + movs r1, 0x50 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B7CC8 + + thumb_func_start sub_80B7CE4 +sub_80B7CE4: @ 80B7CE4 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_0855C474 + ldr r2, =0x03005e00 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B7CE4 + + thumb_func_start sub_80B7D14 +sub_80B7D14: @ 80B7D14 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x40 + strh r0, [r4, 0x24] + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B7D14 + + thumb_func_start sub_80B7D34 +sub_80B7D34: @ 80B7D34 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, =gUnknown_0855C47C + mov r0, sp + movs r2, 0x5 + bl memcpy + ldrh r1, [r4, 0x24] + movs r2, 0x24 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080B7D60 + subs r0, r1, 0x1 + strh r0, [r4, 0x24] + lsls r0, 16 + cmp r0, 0 + bne _080B7D60 + bl music_something + bl sub_80AF0B4 +_080B7D60: + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r5, r0, r1 + adds r0, r5, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _080B7D86 + adds r0, r5, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B7E40 +_080B7D86: + movs r1, 0x24 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B7DF8 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B7DF8 + bl sub_80859A0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B7DF8 + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl FieldObjectSetDirection + bl sub_8084E14 + bl warp_in + ldr r1, =0x03005dac + ldr r0, =mapldr_080859D4 + str r0, [r1] + ldr r0, =c2_load_new_map + bl SetMainCallback2 + ldr r0, =sub_80B7CE4 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + b _080B7E40 + .pool +_080B7DF8: + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080B7E0C + subs r0, r1, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bne _080B7E40 +_080B7E0C: + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + add r0, sp + ldrb r0, [r0] + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl FieldObjectSetSpecialAnim + ldrh r1, [r4, 0xC] + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0xB + bgt _080B7E34 + adds r0, r1, 0x1 + strh r0, [r4, 0xC] +_080B7E34: + ldrh r1, [r4, 0xC] + lsls r1, 16 + asrs r1, 18 + movs r0, 0x8 + asrs r0, r1 + strh r0, [r4, 0xA] +_080B7E40: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B7D34 + + thumb_func_start mapldr_080859D4 +mapldr_080859D4: @ 80B7E48 + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + bl script_env_2_enable + bl player_bitmagic + ldr r1, =0x03005dac + movs r0, 0 + str r0, [r1] + ldr r2, =0x02037350 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x1] + ldr r0, =sub_80B7E94 + movs r1, 0 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end mapldr_080859D4 + + thumb_func_start sub_80B7E94 +sub_80B7E94: @ 80B7E94 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_0855C484 + ldr r2, =0x03005e00 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B7E94 + + thumb_func_start sub_80B7EC4 +sub_80B7EC4: @ 80B7EC4 + push {r4,lr} + adds r4, r0, 0 + bl sub_80ABDFC + lsls r0, 24 + cmp r0, 0 + beq _080B7EE2 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] +_080B7EE2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B7EC4 + + thumb_func_start sub_80B7EE8 +sub_80B7EE8: @ 80B7EE8 + push {r4-r6,lr} + sub sp, 0x8 + adds r5, r0, 0 + ldr r1, =gUnknown_0855C47C + mov r0, sp + movs r2, 0x5 + bl memcpy + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r6, r0, r1 + ldrh r1, [r5, 0xA] + movs r2, 0xA + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _080B7F1A + subs r0, r1, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + cmp r0, 0 + bne _080B7FAC +_080B7F1A: + adds r0, r6, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _080B7F32 + adds r0, r6, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B7FC0 +_080B7F32: + movs r1, 0xC + ldrsh r0, [r5, r1] + cmp r0, 0x1F + ble _080B7F7C + movs r2, 0x26 + ldrsh r4, [r5, r2] + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _080B7F7C + ldrb r1, [r6, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r6, 0x1] + bl script_env_2_disable + bl sub_809757C + ldr r0, =sub_80B7E94 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + b _080B7FC0 + .pool +_080B7F7C: + ldrb r0, [r6, 0x18] + lsls r0, 28 + lsrs r0, 28 + add r0, sp + ldrb r0, [r0] + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl FieldObjectSetSpecialAnim + ldrh r1, [r5, 0xC] + movs r2, 0xC + ldrsh r0, [r5, r2] + cmp r0, 0x1F + bgt _080B7FA4 + adds r0, r1, 0x1 + strh r0, [r5, 0xC] +_080B7FA4: + ldrh r0, [r5, 0xC] + lsls r0, 16 + asrs r0, 18 + strh r0, [r5, 0xA] +_080B7FAC: + ldrb r2, [r6, 0x1] + lsls r1, r2, 26 + lsrs r1, 31 + movs r0, 0x1 + eors r1, r0 + lsls r1, 5 + subs r0, 0x22 + ands r0, r2 + orrs r0, r1 + strb r0, [r6, 0x1] +_080B7FC0: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80B7EE8 + + thumb_func_start sub_80B7FC8 +sub_80B7FC8: @ 80B7FC8 + push {lr} + ldr r0, =sub_80B7FDC + movs r1, 0 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B7FC8 + + thumb_func_start sub_80B7FDC +sub_80B7FDC: @ 80B7FDC + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_0855C48C + ldr r2, =0x03005e00 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B7FDC + + thumb_func_start sub_80B800C +sub_80B800C: @ 80B800C + push {r4,lr} + adds r4, r0, 0 + bl script_env_2_enable + bl player_bitmagic + bl CameraObjectReset2 + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B800C + + thumb_func_start sub_80B8034 +sub_80B8034: @ 80B8034 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, =gUnknown_0855C47C + mov r0, sp + movs r2, 0x5 + bl memcpy + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r5, r0, r1 + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080B8066 + subs r0, r1, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bne _080B8080 +_080B8066: + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + add r0, sp + ldrb r1, [r0] + adds r0, r5, 0 + bl FieldObjectTurn + movs r0, 0x8 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] +_080B8080: + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x7 + ble _080B80AE + movs r2, 0x26 + ldrsh r1, [r4, r2] + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + cmp r1, r0 + bne _080B80AE + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x4 + strh r0, [r4, 0xA] + movs r0, 0x8 + strh r0, [r4, 0xC] + movs r0, 0x1 + strh r0, [r4, 0xE] + movs r0, 0x2D + bl audio_play +_080B80AE: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8034 + + thumb_func_start sub_80B80C4 +sub_80B80C4: @ 80B80C4 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, =gUnknown_0855C47C + mov r0, sp + movs r2, 0x5 + bl memcpy + ldr r2, =0x02037590 + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r3, r0, r1 + ldrb r1, [r2, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r5, r0, r1 + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bgt _080B810E + movs r0, 0x4 + strh r0, [r4, 0xA] + ldrb r0, [r3, 0x18] + lsls r0, 28 + lsrs r0, 28 + add r0, sp + ldrb r1, [r0] + adds r0, r3, 0 + bl FieldObjectTurn +_080B810E: + ldrh r0, [r5, 0x22] + ldrh r1, [r4, 0xE] + subs r0, r1 + strh r0, [r5, 0x22] + ldrh r1, [r4, 0xE] + ldrh r2, [r4, 0x10] + adds r0, r1, r2 + strh r0, [r4, 0x10] + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bgt _080B813A + movs r0, 0x4 + strh r0, [r4, 0xC] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x7 + bgt _080B813A + lsls r0, r1, 1 + strh r0, [r4, 0xE] +_080B813A: + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r0, 0x8 + ble _080B8168 + ldrb r1, [r5, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r5, 0x5] + adds r2, r5, 0 + adds r2, 0x42 + ldrb r1, [r2] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0 + beq _080B8168 + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] +_080B8168: + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r0, 0xA7 + ble _080B817E + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + bl music_something + bl sub_80AF0B4 +_080B817E: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B80C4 + + thumb_func_start sub_80B8198 +sub_80B8198: @ 80B8198 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B81E6 + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B81B8 + bl sub_81BE72C + movs r0, 0x1 + strh r0, [r4, 0x12] +_080B81B8: + bl sub_80859A0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B81E6 + bl copy_saved_warp3_bank_and_enter_x_to_warp1 + bl warp_in + ldr r0, =c2_load_new_map + bl SetMainCallback2 + ldr r1, =0x03005dac + ldr r0, =mapldr_08085D88 + str r0, [r1] + ldr r0, =sub_80B7FDC + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B81E6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8198 + + thumb_func_start mapldr_08085D88 +mapldr_08085D88: @ 80B8200 + push {lr} + bl sub_8085784 + bl pal_fill_for_maplights + bl script_env_2_enable + bl player_bitmagic + ldr r1, =0x03005dac + movs r0, 0 + str r0, [r1] + ldr r2, =0x02037350 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r2, 0x20 + orrs r1, r2 + strb r1, [r0, 0x1] + bl CameraObjectReset2 + ldr r0, =sub_80B8250 + movs r1, 0 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end mapldr_08085D88 + + thumb_func_start sub_80B8250 +sub_80B8250: @ 80B8250 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_0855C49C + ldr r2, =0x03005e00 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8250 + + thumb_func_start sub_80B8280 +sub_80B8280: @ 80B8280 + push {r4-r6,lr} + adds r6, r0, 0 + bl sub_80ABDFC + lsls r0, 24 + cmp r0, 0 + beq _080B82F6 + ldr r5, =0x02037590 + ldrb r0, [r5, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x02020630 + adds r2, r0 + adds r0, r2, 0 + adds r0, 0x29 + movs r4, 0 + ldrsb r4, [r0, r4] + lsls r0, r4, 17 + negs r0, r0 + ldrh r1, [r2, 0x22] + ldr r3, =0x02021bbe + adds r1, r4 + ldrh r3, [r3] + adds r1, r3 + asrs r0, 16 + adds r0, r1 + negs r0, r0 + strh r0, [r2, 0x26] + ldr r3, =0x02037350 + ldrb r0, [r5, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldrb r3, [r1, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r3 + strb r0, [r1, 0x1] + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + movs r0, 0x8 + strh r0, [r6, 0xA] + movs r0, 0x1 + strh r0, [r6, 0xC] + adds r2, 0x42 + ldrb r0, [r2] + lsrs r0, 6 + strh r0, [r6, 0x24] + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x26] + movs r0, 0x2D + bl audio_play +_080B82F6: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8280 + + thumb_func_start sub_80B830C +sub_80B830C: @ 80B830C + push {r4-r7,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, =gUnknown_0855C47C + mov r0, sp + movs r2, 0x5 + bl memcpy + ldr r2, =0x02037590 + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r6, r0, r1 + ldrb r1, [r2, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r5, r0, r1 + ldrh r0, [r4, 0xA] + ldrh r1, [r5, 0x26] + adds r0, r1 + strh r0, [r5, 0x26] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x8 + negs r1, r1 + cmp r0, r1 + blt _080B8384 + ldrh r1, [r4, 0x22] + movs r2, 0x22 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _080B83AA + adds r0, r1, 0x1 + strh r0, [r4, 0x22] + ldrb r0, [r6] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r6] + ldrh r1, [r4, 0x24] + adds r3, r5, 0 + adds r3, 0x42 + lsls r1, 6 + ldrb r2, [r3] + movs r0, 0x3F + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + b _080B83AA + .pool +_080B8384: + ldrb r1, [r5, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r5, 0x5] + adds r2, r5, 0 + adds r2, 0x42 + ldrb r1, [r2] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0 + beq _080B83AA + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] +_080B83AA: + ldrh r2, [r5, 0x26] + movs r3, 0x26 + ldrsh r1, [r5, r3] + movs r0, 0x30 + negs r0, r0 + cmp r1, r0 + blt _080B83CE + ldrh r1, [r4, 0xA] + movs r3, 0xA + ldrsh r0, [r4, r3] + cmp r0, 0x1 + ble _080B83CE + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + bne _080B83CE + subs r0, r1, 0x1 + strh r0, [r4, 0xA] +_080B83CE: + ldrh r0, [r4, 0xC] + subs r0, 0x1 + movs r7, 0 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _080B83F0 + movs r0, 0x4 + strh r0, [r4, 0xC] + ldrb r0, [r6, 0x18] + lsls r0, 28 + lsrs r0, 28 + add r0, sp + ldrb r1, [r0] + adds r0, r6, 0 + bl FieldObjectTurn +_080B83F0: + movs r1, 0x26 + ldrsh r0, [r5, r1] + cmp r0, 0 + blt _080B8406 + strh r7, [r5, 0x26] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x1 + strh r0, [r4, 0xA] + strh r7, [r4, 0xC] +_080B8406: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80B830C + + thumb_func_start sub_80B8410 +sub_80B8410: @ 80B8410 + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, =gUnknown_0855C47C + mov r0, sp + movs r2, 0x5 + bl memcpy + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r5, r0, r1 + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bne _080B8484 + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + add r0, sp + ldrb r1, [r0] + adds r0, r5, 0 + bl FieldObjectTurn + movs r0, 0x8 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _080B8484 + movs r0, 0x24 + ldrsh r1, [r4, r0] + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + cmp r1, r0 + bne _080B8484 + bl script_env_2_disable + bl CameraObjectReset1 + bl sub_809757C + ldr r0, =sub_80B8250 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B8484: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8410 + + thumb_func_start sub_80B849C +sub_80B849C: @ 80B849C + push {r4,lr} + bl sav1_map_get_light_level + lsls r0, 24 + lsrs r0, 24 + bl is_light_level_1_2_3_5_or_6 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B84BC + ldr r0, =sub_80B8554 + b _080B84BE + .pool +_080B84BC: + ldr r0, =sub_80B88B4 +_080B84BE: + movs r1, 0xFF + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, =0x02038c08 + ldr r0, [r2] + ldr r1, [r2, 0x4] + ldr r2, [r2, 0x8] + bl sub_80B8C60 + ldr r2, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r1, 0x26] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B849C + + thumb_func_start sub_80B84F8 +sub_80B84F8: @ 80B84F8 + push {r4-r6,lr} + ldr r5, =0x02038c08 + ldr r0, [r5] + movs r6, 0x80 + lsls r6, 24 + ands r6, r0 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + adds r4, r0, 0 + muls r4, r1 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + str r0, [r5] + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr + str r0, [r5, 0x4] + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + str r0, [r5, 0x8] + ldr r0, [r5] + orrs r0, r6 + str r0, [r5] + movs r0, 0x6 + bl FieldEffectStart + movs r0, 0x3B + bl FieldEffectActiveListRemove + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B84F8 + + thumb_func_start sub_80B8554 +sub_80B8554: @ 80B8554 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_0855C4A8 + ldr r2, =0x03005e00 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8554 + + thumb_func_start sub_80B8584 +sub_80B8584: @ 80B8584 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x04000048 + ldrh r0, [r0] + strh r0, [r4, 0x1E] + ldr r0, =0x0400004a + ldrh r0, [r0] + strh r0, [r4, 0x20] + adds r0, r4, 0 + adds r0, 0x22 + ldr r1, =0x030022c0 + ldr r1, [r1, 0xC] + bl sub_806F67C + ldr r1, =0x0000f0f1 + strh r1, [r4, 0xA] + ldr r0, =0x00005051 + strh r0, [r4, 0xC] + movs r0, 0x3F + strh r0, [r4, 0xE] + movs r0, 0x3E + strh r0, [r4, 0x10] + movs r0, 0x40 + bl SetGpuReg + ldrh r1, [r4, 0xC] + movs r0, 0x44 + bl SetGpuReg + ldrh r1, [r4, 0xE] + movs r0, 0x48 + bl SetGpuReg + ldrh r1, [r4, 0x10] + movs r0, 0x4A + bl SetGpuReg + ldr r0, =sub_80B880C + bl SetVBlankCallback + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8584 + + thumb_func_start sub_80B85F8 +sub_80B85F8: @ 80B85F8 + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + ldr r0, =0x04000008 + ldrh r1, [r0] + lsrs r1, 2 + lsls r1, 30 + lsrs r1, 16 + ldrh r4, [r0] + lsrs r4, 8 + lsls r4, 27 + lsrs r4, 16 + ldr r0, =gUnknown_0855AE50 + movs r5, 0xC0 + lsls r5, 19 + adds r1, r5 + movs r2, 0x80 + lsls r2, 1 + bl CpuSet + movs r0, 0 + str r0, [sp] + adds r5, r4, r5 + ldr r2, =0x05000200 + mov r0, sp + adds r1, r5, 0 + bl CpuSet + ldr r0, =gUnknown_0855B050 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + adds r0, r4, 0 + bl sub_80B8874 + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B85F8 + + thumb_func_start sub_80B8660 +sub_80B8660: @ 80B8660 + push {r4-r7,lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x12] + subs r0, 0x10 + strh r0, [r3, 0x12] + ldrh r6, [r3, 0xA] + ldrh r2, [r3, 0xC] + movs r7, 0xFF + lsrs r1, r6, 8 + subs r1, 0x10 + lsls r1, 16 + lsrs r0, r2, 8 + subs r0, 0x2 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r7, 0 + ands r0, r2 + adds r5, r0, 0x2 + lsrs r2, r1, 16 + cmp r1, 0 + bge _080B868C + movs r2, 0 +_080B868C: + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, 0x27 + bgt _080B8696 + movs r4, 0x28 +_080B8696: + cmp r5, 0x78 + ble _080B869C + movs r5, 0x78 +_080B869C: + lsls r2, 16 + asrs r2, 16 + lsls r1, r2, 8 + adds r0, r7, 0 + ands r0, r6 + orrs r1, r0 + strh r1, [r3, 0xA] + lsls r0, r4, 16 + asrs r4, r0, 16 + lsls r0, r4, 8 + adds r1, r5, 0 + orrs r0, r1 + strh r0, [r3, 0xC] + cmp r2, 0 + bne _080B86DC + cmp r4, 0x28 + bne _080B86DC + cmp r1, 0x78 + bne _080B86DC + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_80B8CC0 + str r1, [r0] + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_080B86DC: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8660 + + thumb_func_start sub_80B86EC +sub_80B86EC: @ 80B86EC + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x12] + subs r0, 0x10 + strh r0, [r3, 0x12] + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3C + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _080B8712 + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_080B8712: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B86EC + + thumb_func_start sub_80B871C +sub_80B871C: @ 80B871C + push {r4,lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x12] + subs r0, 0x10 + strh r0, [r3, 0x12] + ldrh r2, [r3, 0xC] + lsls r1, r2, 16 + movs r0, 0xFF + asrs r1, 24 + adds r1, 0x6 + lsls r1, 16 + ands r0, r2 + subs r0, 0x6 + lsls r0, 16 + lsrs r2, r0, 16 + lsrs r4, r1, 16 + asrs r1, 16 + cmp r1, 0x50 + ble _080B8744 + movs r4, 0x50 +_080B8744: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x50 + bgt _080B874E + movs r2, 0x51 +_080B874E: + lsls r0, r4, 16 + asrs r0, 16 + lsls r1, r0, 8 + lsls r2, 16 + asrs r2, 16 + orrs r1, r2 + strh r1, [r3, 0xC] + cmp r0, 0x50 + bne _080B876A + cmp r2, 0x51 + bne _080B876A + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] +_080B876A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B871C + + thumb_func_start sub_80B8770 +sub_80B8770: @ 80B8770 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r0, =0x04000008 + ldrh r1, [r0] + lsrs r1, 8 + lsls r1, 27 + lsrs r1, 16 + movs r0, 0 + str r0, [sp] + movs r0, 0xC0 + lsls r0, 19 + adds r1, r0 + ldr r2, =0x05000200 + mov r0, sp + bl CpuSet + movs r0, 0xF1 + strh r0, [r4, 0xA] + movs r0, 0xA1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x1E] + strh r0, [r4, 0xE] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x10] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8770 + + thumb_func_start overworld_bg_setup_2 +overworld_bg_setup_2: @ 80B87B8 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r0, 0x22 + mov r1, sp + bl sub_806F684 + ldr r0, [sp] + bl SetVBlankCallback + bl sub_8197200 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + bl sub_80B6070 + movs r0, 0x6 + bl FieldEffectActiveListRemove + ldr r0, =sub_80B8554 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end overworld_bg_setup_2 + + thumb_func_start sub_80B880C +sub_80B880C: @ 80B880C + push {r4,lr} + sub sp, 0x4 + ldr r0, =sub_80B8554 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + adds r0, r4, 0 + adds r0, 0x22 + mov r1, sp + bl sub_806F684 + ldr r0, [sp] + bl _call_via_r0 + ldrh r1, [r4, 0xA] + movs r0, 0x40 + bl SetGpuReg + ldrh r1, [r4, 0xC] + movs r0, 0x44 + bl SetGpuReg + ldrh r1, [r4, 0xE] + movs r0, 0x48 + bl SetGpuReg + ldrh r1, [r4, 0x10] + movs r0, 0x4A + bl SetGpuReg + ldrh r1, [r4, 0x12] + movs r0, 0x10 + bl SetGpuReg + ldrh r1, [r4, 0x14] + movs r0, 0x12 + bl SetGpuReg + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B880C + + thumb_func_start sub_80B8874 +sub_80B8874: @ 80B8874 + push {r4,r5,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x06000140 + adds r2, r0, r1 + movs r1, 0 + ldr r5, =gUnknown_0855B070 + movs r0, 0xF0 + lsls r0, 8 + adds r4, r0, 0 + ldr r3, =0x0000013f +_080B888A: + lsls r0, r1, 1 + adds r0, r5 + ldrh r0, [r0] + orrs r0, r4 + strh r0, [r2] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + adds r2, 0x2 + cmp r1, r3 + bls _080B888A + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8874 + + thumb_func_start sub_80B88B4 +sub_80B88B4: @ 80B88B4 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_0855C4C4 + ldr r2, =0x03005e00 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B88B4 + + thumb_func_start sub_80B88E4 +sub_80B88E4: @ 80B88E4 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0xA] + movs r0, 0x10 + bl SetGpuReg + ldrh r1, [r4, 0xC] + movs r0, 0x12 + bl SetGpuReg + adds r0, r4, 0 + adds r0, 0x22 + ldr r1, =0x030022c0 + ldr r1, [r1, 0xC] + bl sub_806F67C + ldr r0, =sub_80B8AE0 + bl SetVBlankCallback + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B88E4 + + thumb_func_start sub_80B8920 +sub_80B8920: @ 80B8920 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + adds r6, r0, 0 + ldr r0, =0x04000008 + ldrh r1, [r0] + lsrs r1, 2 + lsls r1, 30 + lsrs r1, 16 + ldrh r4, [r0] + lsrs r4, 8 + lsls r4, 27 + lsrs r4, 16 + movs r0, 0 + mov r8, r0 + strh r4, [r6, 0x20] + ldr r0, =gUnknown_0855B2F0 + movs r5, 0xC0 + lsls r5, 19 + adds r1, r5 + movs r2, 0x40 + bl CpuSet + mov r0, r8 + str r0, [sp] + adds r4, r5 + ldr r2, =0x05000200 + mov r0, sp + adds r1, r4, 0 + bl CpuSet + ldr r0, =gUnknown_0855B370 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8920 + + thumb_func_start sub_80B898C +sub_80B898C: @ 80B898C + push {r4,lr} + adds r4, r0, 0 + bl sub_80B8B38 + lsls r0, 24 + cmp r0, 0 + beq _080B89C4 + movs r0, 0x42 + movs r1, 0xF0 + bl SetGpuReg + ldr r1, =0x00002878 + movs r0, 0x46 + bl SetGpuReg + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_80B8CC0 + str r1, [r0] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B89C4: + adds r0, r4, 0 + bl sub_80B8B28 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B898C + + thumb_func_start sub_80B89DC +sub_80B89DC: @ 80B89DC + push {r4,lr} + adds r4, r0, 0 + bl sub_80B8B28 + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3C + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _080B8A00 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B8A00: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B89DC + + thumb_func_start sub_80B8A0C +sub_80B8A0C: @ 80B8A0C + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_80B8B28 + ldrh r1, [r4, 0xA] + movs r0, 0x7 + ands r0, r1 + movs r1, 0 + strh r0, [r4, 0xE] + strh r1, [r4, 0x10] + ldr r5, =0x0000ffff + movs r0, 0x42 + adds r1, r5, 0 + bl SetGpuReg + movs r0, 0x46 + adds r1, r5, 0 + bl SetGpuReg + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8A0C + + thumb_func_start sub_80B8A44 +sub_80B8A44: @ 80B8A44 + push {r4,lr} + adds r4, r0, 0 + bl sub_80B8B28 + adds r0, r4, 0 + bl sub_80B8BF0 + lsls r0, 24 + cmp r0, 0 + beq _080B8A5E + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B8A5E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B8A44 + + thumb_func_start sub_80B8A64 +sub_80B8A64: @ 80B8A64 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r0, =0x04000008 + ldrh r1, [r0] + lsrs r1, 8 + lsls r1, 27 + lsrs r1, 16 + movs r0, 0 + str r0, [sp] + movs r0, 0xC0 + lsls r0, 19 + adds r1, r0 + ldr r2, =0x05000200 + mov r0, sp + bl CpuSet + adds r0, r4, 0 + adds r0, 0x22 + add r1, sp, 0x4 + bl sub_806F684 + ldr r0, [sp, 0x4] + bl SetVBlankCallback + bl sub_8197200 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + bl sub_80B6070 + movs r0, 0x6 + bl FieldEffectActiveListRemove + ldr r0, =sub_80B88B4 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8A64 + + thumb_func_start sub_80B8AE0 +sub_80B8AE0: @ 80B8AE0 + push {r4,lr} + sub sp, 0x4 + ldr r0, =sub_80B88B4 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + adds r0, r4, 0 + adds r0, 0x22 + mov r1, sp + bl sub_806F684 + ldr r0, [sp] + bl _call_via_r0 + ldrh r1, [r4, 0xA] + movs r0, 0x10 + bl SetGpuReg + ldrh r1, [r4, 0xC] + movs r0, 0x12 + bl SetGpuReg + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8AE0 + + thumb_func_start sub_80B8B28 +sub_80B8B28: @ 80B8B28 + ldrh r1, [r0, 0xA] + subs r1, 0x10 + strh r1, [r0, 0xA] + ldrh r1, [r0, 0xE] + adds r1, 0x10 + strh r1, [r0, 0xE] + bx lr + thumb_func_end sub_80B8B28 + + thumb_func_start sub_80B8B38 +sub_80B8B38: @ 80B8B38 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r5, r0, 0 + ldrh r2, [r5, 0x10] + movs r1, 0x10 + ldrsh r0, [r5, r1] + cmp r0, 0x1F + ble _080B8B54 + movs r0, 0x1 + b _080B8BD8 +_080B8B54: + ldrh r0, [r5, 0xE] + lsls r0, 16 + asrs r3, r0, 19 + movs r1, 0x1F + ands r3, r1 + movs r4, 0x10 + ldrsh r0, [r5, r4] + cmp r3, r0 + blt _080B8BD6 + movs r0, 0x20 + subs r3, r0, r3 + ands r3, r1 + subs r0, r2 + mov r12, r0 + mov r7, r12 + ands r7, r1 + mov r12, r7 + ldrh r0, [r5, 0x20] + ldr r1, =0x06000140 + adds r1, r0 + mov r8, r1 + movs r4, 0 + ldr r7, =gUnknown_0855B390 + mov r10, r7 + movs r0, 0xF0 + lsls r0, 8 + mov r9, r0 + adds r1, r3, 0x1 + movs r0, 0x1F + ands r1, r0 + str r1, [sp] + mov r6, r12 + adds r6, 0x1 + ands r6, r0 +_080B8B98: + lsls r1, r4, 5 + adds r2, r1, r3 + lsls r2, 1 + add r2, r8 + mov r7, r12 + adds r0, r7, r1 + lsls r0, 1 + add r0, r10 + ldrh r0, [r0] + mov r7, r9 + orrs r0, r7 + strh r0, [r2] + ldr r0, [sp] + adds r2, r1, r0 + lsls r2, 1 + add r2, r8 + adds r1, r6, r1 + lsls r1, 1 + add r1, r10 + ldrh r0, [r1] + mov r1, r9 + orrs r0, r1 + strh r0, [r2] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x9 + bls _080B8B98 + ldrh r0, [r5, 0x10] + adds r0, 0x2 + strh r0, [r5, 0x10] +_080B8BD6: + movs r0, 0 +_080B8BD8: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B8B38 + + thumb_func_start sub_80B8BF0 +sub_80B8BF0: @ 80B8BF0 + push {r4-r7,lr} + adds r5, r0, 0 + movs r1, 0x10 + ldrsh r0, [r5, r1] + cmp r0, 0x1F + ble _080B8C00 + movs r0, 0x1 + b _080B8C54 +_080B8C00: + ldrh r0, [r5, 0xE] + lsls r0, 16 + asrs r0, 19 + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0x10 + ldrsh r0, [r5, r1] + cmp r2, r0 + blt _080B8C52 + ldrh r0, [r5, 0xA] + lsls r0, 16 + asrs r2, r0, 19 + movs r0, 0x1F + ands r2, r0 + ldrh r0, [r5, 0x20] + ldr r1, =0x06000140 + adds r6, r0, r1 + movs r3, 0 + movs r0, 0xF0 + lsls r0, 8 + adds r7, r0, 0 + adds r4, r2, 0x1 + movs r0, 0x1F + ands r4, r0 +_080B8C30: + lsls r0, r3, 5 + adds r1, r0, r2 + lsls r1, 1 + adds r1, r6 + strh r7, [r1] + adds r0, r4 + lsls r0, 1 + adds r0, r6 + strh r7, [r0] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x9 + bls _080B8C30 + ldrh r0, [r5, 0x10] + adds r0, 0x2 + strh r0, [r5, 0x10] +_080B8C52: + movs r0, 0 +_080B8C54: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B8BF0 + + thumb_func_start sub_80B8C60 +sub_80B8C60: @ 80B8C60 + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r0, 0 + movs r5, 0x80 + lsls r5, 24 + ands r5, r6 + lsrs r5, 16 + lsls r5, 16 + lsrs r5, 16 + ldr r0, =0x7fffffff + ands r6, r0 + lsls r0, r6, 16 + lsrs r0, 16 + movs r3, 0xA0 + lsls r3, 1 + movs r4, 0x50 + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + bl sub_80B5FE8 + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r1, =0x02020630 + adds r2, r1 + ldr r1, =DummyObjectCallback + str r1, [r2, 0x1C] + ldrb r3, [r2, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r3 + strb r1, [r2, 0x5] + strh r6, [r2, 0x2E] + strh r5, [r2, 0x3A] + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B8C60 + + thumb_func_start sub_80B8CC0 +sub_80B8CC0: @ 80B8CC0 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x20] + subs r0, 0x14 + strh r0, [r1, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x78 + bgt _080B8D00 + movs r0, 0x78 + strh r0, [r1, 0x20] + movs r0, 0x1E + strh r0, [r1, 0x30] + ldr r0, =sub_80B8D04 + str r0, [r1, 0x1C] + movs r2, 0x3A + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _080B8CF8 + ldrh r0, [r1, 0x2E] + movs r1, 0 + movs r2, 0x7D + movs r3, 0xA + bl sub_80A32C0 + b _080B8D00 + .pool +_080B8CF8: + ldrh r0, [r1, 0x2E] + movs r1, 0 + bl cry_related +_080B8D00: + pop {r0} + bx r0 + thumb_func_end sub_80B8CC0 + + thumb_func_start sub_80B8D04 +sub_80B8D04: @ 80B8D04 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x30] + subs r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _080B8D18 + ldr r0, =sub_80B8D20 + str r0, [r1, 0x1C] +_080B8D18: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8D04 + + thumb_func_start sub_80B8D20 +sub_80B8D20: @ 80B8D20 + push {lr} + adds r2, r0, 0 + ldrh r3, [r2, 0x20] + movs r0, 0x20 + ldrsh r1, [r2, r0] + movs r0, 0x40 + negs r0, r0 + cmp r1, r0 + bge _080B8D38 + movs r0, 0x1 + strh r0, [r2, 0x3C] + b _080B8D3E +_080B8D38: + adds r0, r3, 0 + subs r0, 0x14 + strh r0, [r2, 0x20] +_080B8D3E: + pop {r0} + bx r0 + thumb_func_end sub_80B8D20 + + thumb_func_start sub_80B8D44 +sub_80B8D44: @ 80B8D44 + push {lr} + ldr r0, =sub_80B8D84 + movs r1, 0xFF + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =0x02038c08 + ldr r0, [r0] + strh r0, [r1, 0x26] + bl sav1_reset_battle_music_maybe + ldr r0, =0x0000016d + bl sub_80858C4 + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B8D44 + + thumb_func_start sub_80B8D84 +sub_80B8D84: @ 80B8D84 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_0855C4E0 + ldr r2, =0x03005e00 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8D84 + + thumb_func_start sub_80B8DB4 +sub_80B8DB4: @ 80B8DB4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r4, r0, 0 + bl script_env_2_enable + bl player_bitmagic + ldr r5, =0x02037590 + movs r0, 0x1 + strb r0, [r5, 0x6] + movs r0, 0x8 + bl SetPlayerAvatarStateMask + adds r6, r4, 0 + adds r6, 0xA + movs r0, 0xC + adds r0, r4 + mov r8, r0 + adds r0, r6, 0 + mov r1, r8 + bl PlayerGetDestCoords + ldr r2, =0x02037350 + ldrb r1, [r5, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x18] + lsrs r0, 4 + adds r1, r6, 0 + mov r2, r8 + bl MoveCoords + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8DB4 + + thumb_func_start sub_80B8E14 +sub_80B8E14: @ 80B8E14 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + adds r0, r4, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _080B8E3E + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B8E50 +_080B8E3E: + bl sub_808C114 + adds r0, r4, 0 + movs r1, 0x39 + bl FieldObjectSetSpecialAnim + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_080B8E50: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8E14 + + thumb_func_start sub_80B8E60 +sub_80B8E60: @ 80B8E60 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive + lsls r0, 24 + cmp r0, 0 + beq _080B8E96 + ldr r2, =0x02038c08 + movs r1, 0x26 + ldrsh r0, [r4, r1] + movs r1, 0x80 + lsls r1, 24 + orrs r0, r1 + str r0, [r2] + movs r0, 0x3B + bl FieldEffectStart + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B8E96: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8E60 + + thumb_func_start sub_80B8EA8 +sub_80B8EA8: @ 80B8EA8 + push {r4-r6,lr} + adds r6, r0, 0 + movs r0, 0x6 + bl FieldEffectActiveListContains + lsls r0, 24 + cmp r0, 0 + bne _080B8F12 + ldr r5, =0x02037590 + ldrb r0, [r5, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + movs r0, 0x3 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl sub_8093540 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + ldr r1, =0x02038c08 + movs r2, 0xA + ldrsh r0, [r6, r2] + str r0, [r1] + movs r2, 0xC + ldrsh r0, [r6, r2] + str r0, [r1, 0x4] + ldrb r0, [r5, 0x5] + str r0, [r1, 0x8] + movs r0, 0x8 + bl FieldEffectStart + strb r0, [r4, 0x1A] + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] +_080B8F12: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8EA8 + + thumb_func_start sub_80B8F24 +sub_80B8F24: @ 80B8F24 + push {r4,r5,lr} + ldr r5, =0x02037590 + ldrb r1, [r5, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B8F84 + movs r0, 0 + strb r0, [r5, 0x6] + ldrb r1, [r5] + movs r0, 0xDF + ands r0, r1 + strb r0, [r5] + ldrb r0, [r4, 0x18] + lsrs r0, 4 + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + ldrb r0, [r4, 0x1A] + movs r1, 0x1 + bl sub_81555AC + bl sub_809757C + bl script_env_2_disable + movs r0, 0x9 + bl FieldEffectActiveListRemove + ldr r0, =sub_80B8D84 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B8F84: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B8F24 + + thumb_func_start sub_80B8F98 +sub_80B8F98: @ 80B8F98 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =gFieldEffectObjectTemplatePointers + adds r0, 0x90 + ldr r0, [r0] + movs r2, 0x18 + negs r2, r2 + movs r1, 0x78 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, r0, 4 + add r1, r8 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + movs r2, 0x4 + orrs r0, r2 + movs r2, 0xF + ands r0, r2 + movs r2, 0x40 + orrs r0, r2 + strb r0, [r1, 0x5] + movs r2, 0 + strh r2, [r1, 0x2E] + strh r2, [r1, 0x30] + strh r2, [r1, 0x32] + ldr r0, =0x0000ffff + strh r0, [r1, 0x34] + ldrh r0, [r1, 0x22] + strh r0, [r1, 0x36] + strh r2, [r1, 0x38] + ldr r1, =0x00003e41 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x00000e0e + movs r0, 0x52 + bl SetGpuReg + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + ldr r0, =gUnknown_0855B610 + movs r1, 0xC0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0x12 + movs r1, 0x78 + bl SetGpuReg + movs r4, 0x3 + ldr r7, =0x0600f800 + ldr r0, =0x0000bff4 + adds r6, r0, 0 +_080B901A: + movs r2, 0xC + lsls r0, r4, 1 + lsls r5, r4, 5 + adds r0, r4 + lsls r3, r0, 1 +_080B9024: + adds r0, r5, r2 + lsls r0, 1 + adds r0, r7 + adds r1, r2, r6 + adds r1, r3, r1 + adds r1, 0x1 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x11 + bls _080B9024 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xE + bls _080B901A + movs r0, 0 + ldr r5, =gUnknown_0855B630 +_080B904A: + movs r4, 0 + adds r7, r0, 0x1 + lsls r6, r0, 5 +_080B9050: + lsls r1, r4, 2 + adds r1, r6, r1 + ldr r0, =0x06008020 + adds r3, r1, r0 + adds r0, r1, 0x1 + adds r0, r5 + ldrb r2, [r0] + lsls r2, 8 + adds r0, r1, r5 + ldrb r0, [r0] + adds r0, r2 + strh r0, [r3] + ldr r0, =0x06008022 + adds r3, r1, r0 + adds r0, r1, 0x3 + adds r0, r5 + ldrb r2, [r0] + lsls r2, 8 + adds r1, 0x2 + adds r1, r5 + ldrb r0, [r1] + adds r0, r2 + strh r0, [r3] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _080B9050 + lsls r0, r7, 24 + lsrs r0, 24 + cmp r0, 0x59 + bls _080B904A + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B8F98 + + thumb_func_start sub_80B90CC +sub_80B90CC: @ 80B90CC + push {r4,lr} + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x68] + movs r1, 0x78 + movs r2, 0 + movs r3, 0x1 + bl AddObjectToFront + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r2, r4, 4 + adds r2, r4 + lsls r2, 2 + ldr r0, =0x02020630 + adds r2, r0 + ldrb r1, [r2, 0x5] + movs r0, 0xF + ands r0, r1 + movs r1, 0xD + negs r1, r1 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, =sub_80B9128 + str r0, [r2, 0x1C] + ldr r0, =0x02038c08 + ldr r0, [r0] + strh r0, [r2, 0x30] + movs r0, 0x9E + bl audio_play + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B90CC + + thumb_func_start sub_80B9128 +sub_80B9128: @ 80B9128 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r1, 0x8C + bl cosine + movs r5, 0 + strh r0, [r4, 0x24] + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0x48 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x4 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x32] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080B918A + movs r2, 0x30 + ldrsh r0, [r4, r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + adds r3, r1, 0 + adds r3, 0x3E + ldrb r2, [r3] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r3] + ldrh r0, [r4, 0x24] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r1, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + subs r0, 0x8 + strh r0, [r1, 0x22] + strh r5, [r1, 0x24] + strh r5, [r1, 0x26] +_080B918A: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x7F + ble _080B919A + adds r0, r4, 0 + movs r1, 0x1E + bl FieldEffectStop +_080B919A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9128 + + thumb_func_start sub_80B91A4 +sub_80B91A4: @ 80B91A4 + push {lr} + ldr r0, =sub_80B91D4 + movs r1, 0xFE + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =0x02038c08 + ldr r0, [r0] + strh r0, [r1, 0xA] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B91A4 + + thumb_func_start sub_80B91D4 +sub_80B91D4: @ 80B91D4 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_0855C4F4 + ldr r2, =0x03005e00 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B91D4 + + thumb_func_start sub_80B9204 +sub_80B9204: @ 80B9204 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, =0x02037590 + ldrb r1, [r6, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + adds r0, r4, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _080B922E + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B924C +_080B922E: + ldrb r0, [r6] + strh r0, [r5, 0x26] + movs r0, 0x1 + strb r0, [r6, 0x6] + bl SetPlayerAvatarStateMask + bl sub_808C114 + adds r0, r4, 0 + movs r1, 0x39 + bl FieldObjectSetSpecialAnim + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_080B924C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9204 + + thumb_func_start sub_80B925C +sub_80B925C: @ 80B925C + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B928C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldr r1, =0x02038c08 + movs r2, 0xA + ldrsh r0, [r4, r2] + str r0, [r1] + movs r0, 0x3B + bl FieldEffectStart +_080B928C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B925C + + thumb_func_start sub_80B92A0 +sub_80B92A0: @ 80B92A0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x6 + bl FieldEffectActiveListContains + lsls r0, 24 + cmp r0, 0 + bne _080B92E8 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r5, r0, r1 + ldrh r1, [r4, 0x26] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080B92D8 + ldrb r0, [r5, 0x1A] + movs r1, 0x2 + bl sub_81555AC + ldrb r0, [r5, 0x1A] + movs r1, 0 + bl sub_81555D8 +_080B92D8: + bl sub_80B94C4 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B92E8: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B92A0 + + thumb_func_start sub_80B92F8 +sub_80B92F8: @ 80B92F8 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0xA] + bl sub_80B9508 + lsls r0, 24 + cmp r0, 0 + beq _080B932C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x10 + strh r0, [r4, 0xC] + movs r0, 0x1 + bl SetPlayerAvatarTransitionFlags + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + movs r1, 0x2 + bl FieldObjectSetSpecialAnim +_080B932C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B92F8 + + thumb_func_start sub_80B933C +sub_80B933C: @ 80B933C + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r2, r0, r1 + ldrh r1, [r4, 0xC] + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _080B9362 + subs r0, r1, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _080B9380 +_080B9362: + adds r0, r2, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B9380 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x9E + bl audio_play + ldrb r0, [r4, 0xA] + bl sub_80B9524 +_080B9380: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B933C + + thumb_func_start sub_80B9390 +sub_80B9390: @ 80B9390 + push {r4-r6,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0xC] + adds r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _080B9406 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + movs r0, 0x3 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r6, =0x02020630 + adds r0, r6 + movs r1, 0x16 + bl StartObjectImageAnim + ldrb r0, [r4, 0x1] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r4, 0x1] + adds r0, r4, 0 + movs r1, 0x48 + bl FieldObjectSetSpecialAnim + ldrh r1, [r5, 0x26] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080B93FC + ldrb r1, [r4, 0x1A] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl RemoveObjectAndFreeTiles +_080B93FC: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0 + strh r0, [r5, 0xC] +_080B9406: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9390 + + thumb_func_start sub_80B9418 +sub_80B9418: @ 80B9418 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0xC] + adds r0, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + ble _080B9464 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimActive + ldrb r1, [r4, 0x1] + movs r0, 0x11 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] + ldrb r1, [r4, 0x2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x2] + ldrb r0, [r5, 0xA] + ldrb r1, [r4, 0x4] + bl sub_80B9560 + bl CameraObjectReset2 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_080B9464: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9418 + + thumb_func_start sub_80B9474 +sub_80B9474: @ 80B9474 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0xA] + bl sub_80B9508 + lsls r0, 24 + cmp r0, 0 + beq _080B948E + bl sub_80AF0B4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B948E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80B9474 + + thumb_func_start sub_80B9494 +sub_80B9494: @ 80B9494 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B94B6 + movs r0, 0x1F + bl FieldEffectActiveListRemove + ldr r0, =sub_80B91D4 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B94B6: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9494 + + thumb_func_start sub_80B94C4 +sub_80B94C4: @ 80B94C4 + push {lr} + ldr r0, =gFieldEffectObjectTemplatePointers + ldr r0, [r0, 0x68] + movs r1, 0xFF + movs r2, 0xB4 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r1, =0x02020630 + adds r2, r1 + ldrb r3, [r2, 0x5] + movs r1, 0xF + ands r1, r3 + movs r3, 0xD + negs r3, r3 + ands r1, r3 + movs r3, 0x4 + orrs r1, r3 + strb r1, [r2, 0x5] + ldr r1, =sub_80B957C + str r1, [r2, 0x1C] + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B94C4 + + thumb_func_start sub_80B9508 +sub_80B9508: @ 80B9508 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x3C] + lsls r0, 24 + lsrs r0, 24 + bx lr + .pool + thumb_func_end sub_80B9508 + + thumb_func_start sub_80B9524 +sub_80B9524: @ 80B9524 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + ldr r0, =sub_80B963C + str r0, [r4, 0x1C] + movs r1, 0 + movs r0, 0x78 + strh r0, [r4, 0x20] + strh r1, [r4, 0x22] + strh r1, [r4, 0x24] + strh r1, [r4, 0x26] + adds r0, r4, 0 + adds r0, 0x2E + movs r2, 0x10 + bl memset + movs r0, 0x40 + strh r0, [r4, 0x3A] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9524 + + thumb_func_start sub_80B9560 +sub_80B9560: @ 80B9560 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =0x02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + strh r1, [r2, 0x3A] + bx lr + .pool + thumb_func_end sub_80B9560 + + thumb_func_start sub_80B957C +sub_80B957C: @ 80B957C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B9628 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B95C0 + ldrb r0, [r4, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r4, 0x1] + ldr r0, =gUnknown_0855C548 + str r0, [r4, 0x10] + adds r0, r4, 0 + bl obj_alloc_rotscale_entry + adds r0, r4, 0 + movs r1, 0 + bl StartObjectRotScalAnim + movs r0, 0x76 + strh r0, [r4, 0x20] + ldr r0, =0x0000ffd0 + strh r0, [r4, 0x22] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0x40 + strh r0, [r4, 0x30] + adds r0, 0xC0 + strh r0, [r4, 0x32] +_080B95C0: + ldrh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r4, 0x30] + adds r0, r1 + strh r0, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x78 + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x78 + bl sine + strh r0, [r4, 0x26] + ldrh r2, [r4, 0x32] + movs r0, 0x32 + ldrsh r1, [r4, r0] + ldr r0, =0x000007ff + cmp r1, r0 + bgt _080B95F6 + adds r0, r2, 0 + adds r0, 0x60 + strh r0, [r4, 0x32] +_080B95F6: + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x81 + ble _080B9628 + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldrb r1, [r4, 0x1] + lsrs r1, 6 + ldrb r2, [r4, 0x3] + lsrs r2, 6 + adds r0, r4, 0 + movs r3, 0 + bl CalcVecFromObjectCenterToObjectUpperLeft +_080B9628: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B957C + + thumb_func_start sub_80B963C +sub_80B963C: @ 80B963C + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r1, 0x8C + bl cosine + movs r5, 0 + strh r0, [r4, 0x24] + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0x48 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x4 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x32] + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0x40 + beq _080B969A + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + adds r3, r1, 0 + adds r3, 0x3E + ldrb r2, [r3] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r3] + ldrh r0, [r4, 0x24] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r1, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + subs r0, 0x8 + strh r0, [r1, 0x22] + strh r5, [r1, 0x24] + strh r5, [r1, 0x26] +_080B969A: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x7F + ble _080B96A6 + movs r0, 0x1 + strh r0, [r4, 0x3C] +_080B96A6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B963C + + thumb_func_start sub_80B96B0 +sub_80B96B0: @ 80B96B0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B9784 + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _080B96FA + ldrb r0, [r4, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r4, 0x1] + ldr r0, =gUnknown_0855C548 + str r0, [r4, 0x10] + adds r0, r4, 0 + bl obj_alloc_rotscale_entry + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + movs r0, 0x5E + strh r0, [r4, 0x20] + ldr r0, =0x0000ffe0 + strh r0, [r4, 0x22] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0xF0 + strh r0, [r4, 0x30] + movs r0, 0x80 + lsls r0, 4 + strh r0, [r4, 0x32] + movs r0, 0x80 + strh r0, [r4, 0x36] +_080B96FA: + ldrh r1, [r4, 0x32] + lsls r1, 16 + asrs r1, 24 + ldrh r2, [r4, 0x30] + adds r2, r1 + ldrh r0, [r4, 0x34] + adds r0, r1 + strh r0, [r4, 0x34] + movs r0, 0xFF + ands r2, r0 + strh r2, [r4, 0x30] + movs r3, 0x30 + ldrsh r0, [r4, r3] + movs r1, 0x20 + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x78 + bl sine + strh r0, [r4, 0x26] + ldrh r1, [r4, 0x32] + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r2, 0x80 + lsls r2, 1 + cmp r0, r2 + ble _080B973C + ldrh r0, [r4, 0x36] + subs r0, r1, r0 + strh r0, [r4, 0x32] +_080B973C: + ldrh r1, [r4, 0x36] + movs r3, 0x36 + ldrsh r0, [r4, r3] + cmp r0, 0xFF + bgt _080B974C + adds r0, r1, 0 + adds r0, 0x18 + strh r0, [r4, 0x36] +_080B974C: + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0xFF + bgt _080B9756 + strh r2, [r4, 0x32] +_080B9756: + movs r2, 0x34 + ldrsh r0, [r4, r2] + cmp r0, 0x3B + ble _080B9784 + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_080B9784: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B96B0 + + thumb_func_start sub_80B9794 +sub_80B9794: @ 80B9794 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl sub_80B9524 + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_80B96B0 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9794 + + thumb_func_start sub_80B97C0 +sub_80B97C0: @ 80B97C0 + push {lr} + ldr r0, =sub_80B97D4 + movs r1, 0xFE + bl CreateTask + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B97C0 + + thumb_func_start sub_80B97D4 +sub_80B97D4: @ 80B97D4 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_0855C550 + ldr r2, =0x03005e00 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B97D4 + + thumb_func_start sub_80B9804 +sub_80B9804: @ 80B9804 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, =0x02037590 + ldrb r1, [r6, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + adds r0, r4, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _080B982E + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B98A6 +_080B982E: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0x11 + strh r0, [r5, 0xC] + ldrb r0, [r6] + strh r0, [r5, 0x26] + movs r0, 0x1 + strb r0, [r6, 0x6] + bl SetPlayerAvatarStateMask + ldrh r1, [r5, 0x26] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080B9856 + ldrb r0, [r4, 0x1A] + movs r1, 0 + bl sub_81555AC +_080B9856: + movs r0, 0x3 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + bl CameraObjectReset2 + adds r0, r4, 0 + movs r1, 0x3 + bl FieldObjectTurn + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0x16 + bl StartObjectImageAnim + ldrb r1, [r4, 0x1] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] + bl sub_80B94C4 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xA] + bl sub_80B9524 + ldrb r0, [r5, 0xA] + ldrb r1, [r4, 0x4] + bl sub_80B9560 +_080B98A6: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9804 + + thumb_func_start sub_80B98B8 +sub_80B98B8: @ 80B98B8 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r1, [r5, 0xC] + movs r2, 0xC + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _080B98D0 + subs r0, r1, 0x1 + strh r0, [r5, 0xC] + lsls r0, 16 + cmp r0, 0 + bne _080B9910 +_080B98D0: + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + ldrb r0, [r5, 0xA] + movs r1, 0x40 + bl sub_80B9560 + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + strh r1, [r4, 0x24] + strh r1, [r4, 0x26] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + strh r1, [r5, 0xC] +_080B9910: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B98B8 + + thumb_func_start sub_80B9924 +sub_80B9924: @ 80B9924 + push {r4,lr} + sub sp, 0x24 + adds r4, r0, 0 + ldr r1, =gUnknown_0855C56C + mov r0, sp + movs r2, 0x24 + bl memcpy + ldr r0, =0x02037590 + ldrb r0, [r0, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + movs r2, 0xC + ldrsh r0, [r4, r2] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + strh r0, [r1, 0x26] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x11 + ble _080B9962 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080B9962: + add sp, 0x24 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9924 + + thumb_func_start sub_80B9978 +sub_80B9978: @ 80B9978 + push {r4-r6,lr} + adds r6, r0, 0 + ldrb r0, [r6, 0xA] + bl sub_80B9508 + lsls r0, 24 + cmp r0, 0 + beq _080B99DC + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + lsls r5, r0, 3 + adds r5, r0 + lsls r5, 2 + ldr r0, =0x02037350 + adds r5, r0 + ldrb r0, [r5, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + ldrb r1, [r5, 0x1] + movs r0, 0x11 + negs r0, r0 + ands r0, r1 + strb r0, [r5, 0x1] + movs r0, 0x10 + ldrsh r1, [r5, r0] + movs r0, 0x12 + ldrsh r2, [r5, r0] + adds r0, r5, 0 + bl sub_808EB08 + movs r0, 0 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + adds r4, 0x3E + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + bl sub_808C114 + adds r0, r5, 0 + movs r1, 0x39 + bl FieldObjectSetSpecialAnim + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] +_080B99DC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9978 + + thumb_func_start sub_80B99F0 +sub_80B99F0: @ 80B99F0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B9A18 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldrb r0, [r4, 0xA] + bl sub_80B9794 +_080B9A18: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B99F0 + + thumb_func_start sub_80B9A28 +sub_80B9A28: @ 80B9A28 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0xA] + bl sub_80B9508 + lsls r0, 24 + cmp r0, 0 + beq _080B9A54 + movs r0, 0xA + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0x10 + strh r0, [r4, 0xA] +_080B9A54: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9A28 + + thumb_func_start sub_80B9A60 +sub_80B9A60: @ 80B9A60 + push {r4-r7,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0xA] + subs r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + cmp r0, 0 + bne _080B9ACA + ldr r6, =0x02037590 + ldrb r1, [r6, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + movs r7, 0 + ldrh r1, [r5, 0x26] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080B9A94 + movs r7, 0x3 + ldrb r0, [r4, 0x1A] + movs r1, 0x1 + bl sub_81555AC +_080B9A94: + adds r0, r7, 0 + bl GetPlayerAvatarGraphicsIdByStateId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetGraphicsId + adds r0, r4, 0 + movs r1, 0x1 + bl FieldObjectTurn + ldrh r0, [r5, 0x26] + strb r0, [r6] + movs r0, 0 + strb r0, [r6, 0x6] + movs r0, 0x20 + bl FieldEffectActiveListRemove + ldr r0, =sub_80B97D4 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080B9ACA: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9A60 + + thumb_func_start sub_80B9ADC +sub_80B9ADC: @ 80B9ADC + push {r4,lr} + sub sp, 0x4 + ldr r4, =0x02038c08 + ldrb r0, [r4] + ldrb r1, [r4, 0x4] + ldrb r2, [r4, 0x8] + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _080B9B2C + ldr r0, =sub_80B9BE8 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + mov r0, sp + ldrb r0, [r0] + strh r0, [r1, 0xC] + ldr r0, [r4] + strh r0, [r1, 0x14] + ldr r0, [r4, 0x4] + strh r0, [r1, 0x16] + ldr r0, [r4, 0x8] + strh r0, [r1, 0x18] + b _080B9B32 + .pool +_080B9B2C: + movs r0, 0x41 + bl FieldEffectActiveListRemove +_080B9B32: + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B9ADC + + thumb_func_start sub_80B9B3C +sub_80B9B3C: @ 80B9B3C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080B9B78 + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _080B9B7C + movs r0, 0 + strh r0, [r4, 0xC] + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080B9B7C + subs r0, r1, 0x1 + b _080B9B7A + .pool +_080B9B78: + movs r0, 0x4 +_080B9B7A: + strh r0, [r4, 0xA] +_080B9B7C: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _080B9BB6 + movs r0, 0 + strh r0, [r4] + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B9BAC + ldrh r1, [r4, 0xA] + negs r1, r1 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl SetCameraPanning + b _080B9BB6 +_080B9BAC: + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0 + bl SetCameraPanning +_080B9BB6: + bl UpdateCameraPanning + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B9BC8 + adds r0, r5, 0 + bl DestroyTask +_080B9BC8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B9B3C + + thumb_func_start sub_80B9BD0 +sub_80B9BD0: @ 80B9BD0 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x1 + strh r0, [r1, 0x16] + bx lr + .pool + thumb_func_end sub_80B9BD0 + + thumb_func_start sub_80B9BE8 +sub_80B9BE8: @ 80B9BE8 + 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, =0x03005e08 + adds r4, r0 + bl InstallCameraPanAheadCallback + movs r0, 0 + bl SetCameraPanningCallback + ldr r1, =gUnknown_0855C590 + movs r2, 0x2 + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl _call_via_r2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9BE8 + + thumb_func_start sub_80B9C28 +sub_80B9C28: @ 80B9C28 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =sub_80B9B3C + movs r1, 0x5A + bl CreateTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x58 + bl audio_play + strh r4, [r5, 0xA] + ldrh r0, [r5, 0x2] + adds r0, 0x1 + strh r0, [r5, 0x2] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9C28 + + thumb_func_start sub_80B9C54 +sub_80B9C54: @ 80B9C54 + push {r4-r7,lr} + sub sp, 0x4 + adds r7, r0, 0 + ldrh r0, [r7, 0x6] + adds r0, 0x1 + strh r0, [r7, 0x6] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x78 + ble _080B9CC2 + ldr r2, =0x02037350 + movs r1, 0x4 + ldrsh r0, [r7, r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + ldrb r0, [r1, 0x1] + movs r2, 0x20 + orrs r0, r2 + strb r0, [r1, 0x1] + ldr r6, =0x0000ffff + ldr r5, =0x00007fff + adds r0, r6, 0 + movs r1, 0x10 + adds r2, r5, 0 + bl sub_80A2A20 + str r5, [sp] + adds r0, r6, 0 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + adds r0, r4, 0 + bl sub_80B9D24 + movs r0, 0x57 + bl audio_play + ldrb r0, [r7, 0xA] + bl sub_80B9BD0 + movs r0, 0 + strh r0, [r7, 0x6] + ldrh r0, [r7, 0x2] + adds r0, 0x1 + strh r0, [r7, 0x2] +_080B9CC2: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9C54 + + thumb_func_start sub_80B9CDC +sub_80B9CDC: @ 80B9CDC + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080B9D16 + ldr r0, =sub_80B9B3C + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + bne _080B9D16 + bl InstallCameraPanAheadCallback + ldrb r0, [r4, 0xC] + ldrb r1, [r4, 0xE] + ldrb r2, [r4, 0x10] + bl RemoveFieldObjectByLocalIdAndMap + movs r0, 0x41 + bl FieldEffectActiveListRemove + adds r0, r5, 0 + bl DestroyTask +_080B9D16: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9CDC + + thumb_func_start sub_80B9D24 +sub_80B9D24: @ 80B9D24 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + ldr r0, =0x03005dec + movs r1, 0 + ldrsh r2, [r0, r1] + movs r3, 0x20 + ldrsh r0, [r6, r3] + adds r2, r0 + movs r1, 0x24 + ldrsh r0, [r6, r1] + adds r2, r0 + ldr r0, =0x03005de8 + movs r3, 0 + ldrsh r0, [r0, r3] + movs r3, 0x22 + ldrsh r1, [r6, r3] + adds r0, r1 + movs r3, 0x26 + ldrsh r1, [r6, r3] + adds r0, r1 + subs r0, 0x4 + movs r5, 0 + lsls r2, 16 + mov r8, r2 + lsls r7, r0, 16 +_080B9D5A: + ldr r0, =gUnknown_0855C5EC + mov r2, r8 + asrs r1, r2, 16 + asrs r2, r7, 16 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _080B9D96 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + lsls r1, r5, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + strh r5, [r4, 0x2E] + ldrb r1, [r6, 0x5] + lsrs r1, 4 + lsls r1, 4 + ldrb r2, [r4, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x5] +_080B9D96: + adds r5, 0x1 + cmp r5, 0x3 + ble _080B9D5A + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9D24 + + thumb_func_start sub_80B9DB8 +sub_80B9DB8: @ 80B9DB8 + push {lr} + adds r1, r0, 0 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0x1 + beq _080B9DE4 + cmp r0, 0x1 + bgt _080B9DCE + cmp r0, 0 + beq _080B9DD8 + b _080B9E02 +_080B9DCE: + cmp r0, 0x2 + beq _080B9DF0 + cmp r0, 0x3 + beq _080B9DF6 + b _080B9E02 +_080B9DD8: + ldrh r0, [r1, 0x20] + subs r0, 0x10 + strh r0, [r1, 0x20] + ldrh r0, [r1, 0x22] + subs r0, 0xC + b _080B9E00 +_080B9DE4: + ldrh r0, [r1, 0x20] + adds r0, 0x10 + strh r0, [r1, 0x20] + ldrh r0, [r1, 0x22] + subs r0, 0xC + b _080B9E00 +_080B9DF0: + ldrh r0, [r1, 0x20] + subs r0, 0x10 + b _080B9DFA +_080B9DF6: + ldrh r0, [r1, 0x20] + adds r0, 0x10 +_080B9DFA: + strh r0, [r1, 0x20] + ldrh r0, [r1, 0x22] + adds r0, 0xC +_080B9E00: + strh r0, [r1, 0x22] +_080B9E02: + ldrh r0, [r1, 0x20] + adds r0, 0x4 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xF8 + bhi _080B9E1E + movs r0, 0x22 + ldrsh r2, [r1, r0] + movs r0, 0x4 + negs r0, r0 + cmp r2, r0 + blt _080B9E1E + cmp r2, 0xA4 + ble _080B9E24 +_080B9E1E: + adds r0, r1, 0 + bl RemoveObjectAndFreeTiles +_080B9E24: + pop {r0} + bx r0 + thumb_func_end sub_80B9DB8 + + thumb_func_start sub_80B9E28 +sub_80B9E28: @ 80B9E28 + push {r4-r7,lr} + sub sp, 0x4 + ldr r7, =0x02038c08 + ldrb r0, [r7] + ldrb r1, [r7, 0x4] + ldrb r2, [r7, 0x8] + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _080B9EBE + mov r0, sp + ldrb r0, [r0] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + movs r0, 0x10 + ldrsh r5, [r4, r0] + subs r5, 0x7 + movs r0, 0x12 + ldrsh r6, [r4, r0] + subs r6, 0x7 + ldr r1, [r7, 0xC] + subs r5, r1, r5 + lsls r5, 4 + ldr r2, [r7, 0x10] + subs r6, r2, r6 + lsls r6, 4 + adds r1, 0x7 + lsls r1, 16 + asrs r1, 16 + adds r2, 0x7 + lsls r2, 16 + asrs r2, 16 + adds r0, r4, 0 + bl npc_coords_shift + ldr r0, =sub_80B9EDC + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r1 + ldrb r0, [r4, 0x4] + strh r0, [r2, 0xA] + ldr r3, =0x02020630 + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x20] + adds r0, r5 + strh r0, [r2, 0xC] + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0, 0x22] + adds r0, r6 + strh r0, [r2, 0xE] + ldr r0, [r7, 0x14] + strh r0, [r2, 0x18] + mov r0, sp + ldrb r0, [r0] + strh r0, [r2, 0x1A] +_080B9EBE: + movs r0, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B9E28 + + thumb_func_start sub_80B9EDC +sub_80B9EDC: @ 80B9EDC + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + movs r0, 0x2 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r6, r0, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _080B9F10 + cmp r0, 0x1 + beq _080B9F4E + b _080B9FAC + .pool +_080B9F10: + ldrh r0, [r6, 0x20] + lsls r0, 4 + strh r0, [r5, 0x8] + ldrh r0, [r6, 0x22] + lsls r0, 4 + strh r0, [r5, 0xA] + movs r2, 0x4 + ldrsh r0, [r5, r2] + lsls r0, 4 + movs r2, 0x8 + ldrsh r1, [r5, r2] + subs r0, r1 + movs r2, 0x10 + ldrsh r1, [r5, r2] + bl __divsi3 + strh r0, [r5, 0xC] + movs r1, 0x6 + ldrsh r0, [r5, r1] + lsls r0, 4 + movs r2, 0xA + ldrsh r1, [r5, r2] + subs r0, r1 + movs r2, 0x10 + ldrsh r1, [r5, r2] + bl __divsi3 + strh r0, [r5, 0xE] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_080B9F4E: + ldrh r1, [r5, 0x10] + movs r2, 0x10 + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _080B9F7C + subs r0, r1, 0x1 + strh r0, [r5, 0x10] + ldrh r1, [r5, 0xC] + ldrh r0, [r5, 0x8] + adds r1, r0 + strh r1, [r5, 0x8] + ldrh r0, [r5, 0xE] + ldrh r2, [r5, 0xA] + adds r0, r2 + strh r0, [r5, 0xA] + lsls r1, 16 + asrs r1, 20 + strh r1, [r6, 0x20] + ldrh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 20 + strh r0, [r6, 0x22] + b _080B9FAC +_080B9F7C: + movs r1, 0x12 + ldrsh r0, [r5, r1] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + ldrh r0, [r5, 0x4] + strh r0, [r6, 0x20] + ldrh r0, [r5, 0x6] + strh r0, [r6, 0x22] + adds r0, r4, 0 + bl npc_coords_shift_still + ldrb r0, [r4] + movs r1, 0x8 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x42 + bl FieldEffectActiveListRemove + adds r0, r7, 0 + bl DestroyTask +_080B9FAC: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B9EDC + + thumb_func_start remove_some_task +remove_some_task: @ 80B9FB8 + push {r4,lr} + ldr r4, =0x02039b28 + movs r0, 0 + strb r0, [r4, 0x15] + ldr r1, =0x040000b0 + ldrh r2, [r1, 0xA] + ldr r0, =0x0000c5ff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, =0x00007fff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + ldrb r0, [r4, 0x18] + cmp r0, 0xFF + beq _080B9FE2 + bl DestroyTask + movs r0, 0xFF + strb r0, [r4, 0x18] +_080B9FE2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end remove_some_task + + thumb_func_start dp12_8087EA4 +dp12_8087EA4: @ 80B9FF8 + push {r4,lr} + sub sp, 0x4 + mov r0, sp + movs r4, 0 + strh r4, [r0] + ldr r1, =0x02038c28 + ldr r2, =0x01000780 + bl CpuSet + ldr r0, =0x02039b28 + movs r1, 0 + str r1, [r0] + str r1, [r0, 0x4] + str r1, [r0, 0x8] + str r1, [r0, 0xC] + strb r4, [r0, 0x14] + strb r4, [r0, 0x15] + strb r4, [r0, 0x16] + strb r4, [r0, 0x17] + movs r1, 0xFF + strb r1, [r0, 0x18] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp12_8087EA4 + + thumb_func_start sub_80BA038 +sub_80BA038: @ 80BA038 + push {lr} + sub sp, 0xC + str r0, [sp] + str r1, [sp, 0x4] + str r2, [sp, 0x8] + ldr r0, =0xa2600001 + cmp r1, r0 + bne _080BA06C + ldr r0, =0x02039b28 + ldr r1, =0x02038c2a + str r1, [r0] + movs r2, 0xF0 + lsls r2, 3 + adds r1, r2 + str r1, [r0, 0x4] + ldr r1, =sub_80BA134 + b _080BA07C + .pool +_080BA06C: + ldr r0, =0x02039b28 + ldr r1, =0x02038c2c + str r1, [r0] + movs r2, 0xF0 + lsls r2, 3 + adds r1, r2 + str r1, [r0, 0x4] + ldr r1, =sub_80BA154 +_080BA07C: + str r1, [r0, 0x10] + adds r1, r0, 0 + ldr r0, [sp, 0x4] + str r0, [r1, 0xC] + ldr r0, [sp] + str r0, [r1, 0x8] + mov r0, sp + ldrb r0, [r0, 0x8] + strb r0, [r1, 0x15] + mov r0, sp + ldrb r0, [r0, 0x9] + strb r0, [r1, 0x16] + strb r0, [r1, 0x17] + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BA038 + + thumb_func_start sub_80BA0A8 +sub_80BA0A8: @ 80BA0A8 + push {r4,lr} + ldr r4, =0x02039b28 + ldrb r0, [r4, 0x15] + cmp r0, 0 + beq _080BA122 + cmp r0, 0x3 + bne _080BA0EC + movs r0, 0 + strb r0, [r4, 0x15] + ldr r1, =0x040000b0 + ldrh r2, [r1, 0xA] + ldr r0, =0x0000c5ff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, =0x00007fff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + ldr r1, =0x02039b44 + movs r0, 0x1 + strb r0, [r1] + b _080BA122 + .pool +_080BA0EC: + ldr r1, =0x040000b0 + ldrh r2, [r1, 0xA] + ldr r0, =0x0000c5ff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r0, =0x00007fff + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + ldrb r0, [r4, 0x14] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + str r0, [r1] + ldr r0, [r4, 0x8] + str r0, [r1, 0x4] + ldr r0, [r4, 0xC] + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + ldr r0, [r4, 0x10] + bl _call_via_r0 + ldrb r0, [r4, 0x14] + movs r1, 0x1 + eors r0, r1 + strb r0, [r4, 0x14] +_080BA122: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BA0A8 + + thumb_func_start sub_80BA134 +sub_80BA134: @ 80BA134 + ldr r0, =0x02039b28 + ldr r2, [r0, 0x8] + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + ldr r1, =0x02038c28 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + bx lr + .pool + thumb_func_end sub_80BA134 + + thumb_func_start sub_80BA154 +sub_80BA154: @ 80BA154 + ldr r0, =0x02039b28 + ldr r2, [r0, 0x8] + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + ldr r1, =0x02038c28 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + bx lr + .pool + thumb_func_end sub_80BA154 + + thumb_func_start task00_for_dp12 +task00_for_dp12: @ 80BA174 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + movs r6, 0 + ldr r0, =0x02039b44 + ldrb r0, [r0] + cmp r0, 0 + beq _080BA1A4 + mov r0, r12 + bl DestroyTask + ldr r1, =0x02039b28 + movs r0, 0xFF + strb r0, [r1, 0x18] + b _080BA324 + .pool +_080BA1A4: + ldr r1, =0x03005e00 + mov r0, r12 + lsls r2, r0, 2 + adds r0, r2, r0 + lsls r0, 3 + adds r3, r0, r1 + movs r4, 0x16 + ldrsh r0, [r3, r4] + mov r10, r1 + mov r9, r2 + cmp r0, 0 + beq _080BA250 + movs r1, 0x14 + ldrsh r0, [r3, r1] + cmp r0, 0xE + bhi _080BA250 + lsls r0, 2 + ldr r1, =_080BA1D8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080BA1D8: + .4byte _080BA214 + .4byte _080BA250 + .4byte _080BA21C + .4byte _080BA250 + .4byte _080BA224 + .4byte _080BA250 + .4byte _080BA22C + .4byte _080BA250 + .4byte _080BA234 + .4byte _080BA250 + .4byte _080BA23C + .4byte _080BA250 + .4byte _080BA244 + .4byte _080BA250 + .4byte _080BA24C +_080BA214: + ldr r0, =0x02022e14 + b _080BA24E + .pool +_080BA21C: + ldr r0, =0x02022e16 + b _080BA24E + .pool +_080BA224: + ldr r0, =0x02022e18 + b _080BA24E + .pool +_080BA22C: + ldr r0, =0x02022e1a + b _080BA24E + .pool +_080BA234: + ldr r0, =0x02022e1c + b _080BA24E + .pool +_080BA23C: + ldr r0, =0x02022e1e + b _080BA24E + .pool +_080BA244: + ldr r0, =0x02022e20 + b _080BA24E + .pool +_080BA24C: + ldr r0, =0x02022e22 +_080BA24E: + ldrh r6, [r0] +_080BA250: + mov r0, r9 + add r0, r12 + lsls r0, 3 + mov r2, r10 + adds r1, r0, r2 + ldrh r2, [r1, 0x10] + movs r3, 0x10 + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _080BA2BC + subs r0, r2, 0x1 + strh r0, [r1, 0x10] + movs r4, 0xE + ldrsh r0, [r1, r4] + movs r3, 0xA0 + lsls r3, 1 + adds r2, r0, r3 + movs r4, 0x8 + ldrsh r3, [r1, r4] + movs r4, 0xA + ldrsh r0, [r1, r4] + cmp r3, r0 + bge _080BA324 + ldr r5, =0x02038c28 + ldr r0, =0x02039b28 + mov r8, r0 + adds r7, r1, 0 + lsls r0, r2, 1 + adds r4, r0, r5 +_080BA28A: + lsls r2, r3, 1 + mov r0, r8 + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r5 + ldrh r0, [r4] + adds r0, r6 + strh r0, [r2] + adds r4, 0x2 + adds r3, 0x1 + movs r1, 0xA + ldrsh r0, [r7, r1] + cmp r3, r0 + blt _080BA28A + b _080BA324 + .pool +_080BA2BC: + ldrh r0, [r1, 0x12] + strh r0, [r1, 0x10] + movs r2, 0xE + ldrsh r0, [r1, r2] + movs r3, 0xA0 + lsls r3, 1 + adds r2, r0, r3 + movs r4, 0x8 + ldrsh r3, [r1, r4] + movs r4, 0xA + ldrsh r0, [r1, r4] + cmp r3, r0 + bge _080BA304 + ldr r5, =0x02038c28 + adds r7, r1, 0 + lsls r0, r2, 1 + adds r4, r0, r5 + ldr r0, =0x02039b28 + mov r8, r0 +_080BA2E2: + lsls r2, r3, 1 + mov r0, r8 + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + adds r2, r5 + ldrh r0, [r4] + adds r0, r6 + strh r0, [r2] + adds r4, 0x2 + adds r3, 0x1 + movs r1, 0xA + ldrsh r0, [r7, r1] + cmp r3, r0 + blt _080BA2E2 +_080BA304: + mov r0, r9 + add r0, r12 + lsls r0, 3 + mov r3, r10 + adds r2, r0, r3 + ldrh r0, [r2, 0xE] + adds r0, 0x1 + strh r0, [r2, 0xE] + lsls r0, 16 + asrs r0, 16 + movs r4, 0xC + ldrsh r1, [r2, r4] + cmp r0, r1 + bne _080BA324 + movs r0, 0 + strh r0, [r2, 0xE] +_080BA324: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end task00_for_dp12 + + thumb_func_start sub_80BA33C +sub_80BA33C: @ 80BA33C + push {r4-r7,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r4, r2, 24 + movs r1, 0 + movs r2, 0 + ldr r0, =gUnknown_08329F40 + mov r12, r0 +_080BA350: + lsls r0, r1, 1 + adds r3, r0, r6 + lsls r0, r2, 1 + add r0, r12 + movs r7, 0 + ldrsh r0, [r0, r7] + muls r0, r4 + cmp r0, 0 + bge _080BA364 + adds r0, 0xFF +_080BA364: + asrs r0, 8 + strh r0, [r3] + adds r0, r2, r5 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0xFF + bls _080BA350 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80BA33C + + thumb_func_start sub_80BA384 +sub_80BA384: @ 80BA384 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + adds r5, r0, 0 + str r1, [sp, 0x10] + ldr r0, [sp, 0x40] + mov r8, r0 + ldr r1, [sp, 0x44] + mov r9, r1 + ldr r0, [sp, 0x48] + mov r10, r0 + lsls r5, 24 + lsrs r5, 24 + ldr r1, [sp, 0x10] + lsls r1, 24 + str r1, [sp, 0x14] + lsrs r0, r1, 24 + str r0, [sp, 0xC] + lsls r1, r2, 24 + lsrs r1, 24 + str r1, [sp, 0x18] + lsls r2, r3, 24 + lsrs r2, 24 + str r2, [sp, 0x1C] + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + mov r3, r9 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + bl dp12_8087EA4 + ldr r0, =0x04000010 + add r0, r9 + str r0, [sp] + ldr r0, =0xa2600001 + str r0, [sp, 0x4] + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x8] + mov r0, sp + movs r1, 0 + strb r1, [r0, 0x9] + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + ldr r0, =task00_for_dp12 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x03005e00 + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r0 + strh r5, [r4, 0x8] + mov r3, sp + ldrh r3, [r3, 0xC] + strh r3, [r4, 0xA] + movs r0, 0x80 + lsls r0, 1 + ldr r1, [sp, 0x18] + bl __divsi3 + strh r0, [r4, 0xC] + movs r0, 0 + strh r0, [r4, 0xE] + mov r1, r8 + strh r1, [r4, 0x10] + strh r1, [r4, 0x12] + mov r3, r9 + strh r3, [r4, 0x14] + mov r0, r10 + strh r0, [r4, 0x16] + ldr r0, =0x02039b28 + strb r7, [r0, 0x18] + ldr r0, =0x02039b44 + movs r1, 0 + strb r1, [r0] + ldr r4, =0x02038ea8 + ldr r3, [sp, 0xC] + subs r6, r3, r5 + lsls r3, r6, 24 + lsrs r3, 24 + adds r0, r4, 0 + ldr r1, [sp, 0x18] + ldr r2, [sp, 0x1C] + bl sub_80BA33C + ldr r0, [sp, 0xC] + cmp r5, r0 + bge _080BA47E + ldr r1, =0xfffffd80 + adds r2, r4, r1 + lsls r1, r5, 1 + movs r3, 0xF0 + lsls r3, 3 + adds r0, r1, r3 + adds r3, r0, r2 + adds r1, r2 + adds r2, r4, 0 + adds r5, r6, 0 +_080BA46A: + ldrh r0, [r2] + strh r0, [r1] + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + adds r1, 0x2 + subs r5, 0x1 + cmp r5, 0 + bne _080BA46A +_080BA47E: + adds r0, r7, 0 + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80BA384 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_80C6FA0.s b/asm/rom_80C6FA0.s new file mode 100644 index 000000000..160942702 --- /dev/null +++ b/asm/rom_80C6FA0.s @@ -0,0 +1,29755 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80C6FA0 +sub_80C6FA0: @ 80C6FA0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + movs r5, 0 +_080C6FAA: + lsls r1, r4, 24 + lsrs r1, 24 + adds r0, r6, 0 + movs r2, 0xB + bl get_pokemon_data_from_any_box + cmp r0, 0 + beq _080C6FC0 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_080C6FC0: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1D + bls _080C6FAA + lsls r0, r5, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80C6FA0 + + thumb_func_start sub_80C6FD4 +sub_80C6FD4: @ 80C6FD4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 +_080C6FDC: + lsls r1, r4, 24 + lsrs r1, 24 + adds r0, r5, 0 + movs r2, 0xB + bl get_pokemon_data_from_any_box + cmp r0, 0 + bne _080C6FF2 + lsls r0, r4, 16 + asrs r0, 16 + b _080C7000 +_080C6FF2: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1D + bls _080C6FDC + movs r0, 0x1 + negs r0, r0 +_080C7000: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80C6FD4 + + thumb_func_start sub_80C7008 +sub_80C7008: @ 80C7008 + push {r4-r6,lr} + movs r5, 0 + movs r6, 0 +_080C700E: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _080C7036 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _080C7036 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_080C7036: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x5 + bls _080C700E + lsls r0, r6, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C7008 + + thumb_func_start sub_80C7050 +sub_80C7050: @ 80C7050 + push {r4-r7,lr} + lsls r0, 24 + movs r5, 0 + movs r6, 0 + lsrs r7, r0, 24 +_080C705A: + cmp r5, r7 + beq _080C7092 + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _080C7092 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _080C7092 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _080C7092 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_080C7092: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x5 + bls _080C705A + lsls r0, r6, 24 + lsrs r0, 24 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C7050 + + thumb_func_start sub_80C70AC +sub_80C70AC: @ 80C70AC + push {lr} + ldr r0, =0x020375e0 + ldrb r0, [r0] + bl sub_80C7050 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C70AC + + thumb_func_start sub_80C70C4 +sub_80C70C4: @ 80C70C4 + push {r4,r5,lr} + movs r4, 0 + movs r5, 0 +_080C70CA: + movs r0, 0x64 + muls r0, r4 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _080C70E2 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_080C70E2: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x5 + bls _080C70CA + lsls r0, r5, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C70C4 + + thumb_func_start sub_80C70FC +sub_80C70FC: @ 80C70FC + push {r4,r5,lr} + adds r5, r0, 0 + lsls r4, r2, 16 + lsrs r4, 16 + bl CopyString + adds r1, r0, 0 + adds r5, r4 + cmp r1, r5 + bcs _080C711A + movs r0, 0 +_080C7112: + strb r0, [r1] + adds r1, 0x1 + cmp r1, r5 + bcc _080C7112 +_080C711A: + movs r0, 0xFF + strb r0, [r1] + adds r0, r1, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80C70FC + + thumb_func_start sub_80C7128 +sub_80C7128: @ 80C7128 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + adds r7, r3, 0 + ldr r5, [sp, 0x1C] + ldr r4, [sp, 0x20] + ldr r0, [sp, 0x24] + mov r9, r0 + ldr r0, [sp, 0x28] + ldr r3, [sp, 0x2C] + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r3, 16 + lsrs r3, 16 + mov r0, r9 + lsls r0, 17 + mov r9, r0 + lsrs r2, 11 + adds r2, r1 + lsls r2, 1 + adds r6, r2 + adds r0, r4, 0 + muls r0, r3 + adds r0, r5 + lsls r0, 1 + adds r7, r0 + movs r4, 0 + cmp r4, r8 + bcs _080C7198 + mov r0, r9 + lsrs r0, 1 + mov r9, r0 + lsls r5, r3, 1 +_080C717E: + adds r0, r7, 0 + adds r1, r6, 0 + mov r3, r9 + lsrs r2, r3, 16 + bl CpuSet + adds r6, 0x40 + adds r7, r5 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r8 + bcc _080C717E +_080C7198: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80C7128 + + thumb_func_start sub_80C71A4 +sub_80C71A4: @ 80C71A4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r4, r0, 0 + ldr r0, [sp, 0x28] + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + lsrs r2, 11 + adds r2, r1 + lsls r2, 1 + adds r4, r2 + lsls r3, 17 + lsrs r0, r3, 16 + str r0, [sp, 0x4] + movs r0, 0 + cmp r0, r10 + bcs _080C724E + movs r6, 0x80 + lsls r6, 5 + mov r5, sp + ldr r7, =0x040000d4 + lsrs r3, 17 + mov r9, r3 + mov r1, r9 + movs r2, 0x81 + lsls r2, 24 + orrs r1, r2 + mov r9, r1 +_080C71EA: + adds r3, r4, 0 + ldr r2, [sp, 0x4] + movs r1, 0x40 + adds r1, r4 + mov r8, r1 + adds r0, 0x1 + mov r12, r0 + cmp r2, r6 + bhi _080C7214 + movs r0, 0 + strh r0, [r5] + mov r2, sp + str r2, [r7] + str r4, [r7, 0x4] + mov r0, r9 + str r0, [r7, 0x8] + ldr r0, [r7, 0x8] + b _080C7242 + .pool +_080C7214: + movs r4, 0 + strh r4, [r5] + ldr r1, =0x040000d4 + mov r0, sp + str r0, [r1] + str r3, [r1, 0x4] + ldr r0, =0x81000800 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r3, r6 + subs r2, r6 + cmp r2, r6 + bhi _080C7214 + strh r4, [r5] + mov r0, sp + str r0, [r1] + str r3, [r1, 0x4] + lsrs r0, r2, 1 + movs r2, 0x81 + lsls r2, 24 + orrs r0, r2 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_080C7242: + mov r4, r8 + mov r1, r12 + lsls r0, r1, 16 + lsrs r0, 16 + cmp r0, r10 + bcc _080C71EA +_080C724E: + 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_80C71A4 + + thumb_func_start c3_0808C39C +c3_0808C39C: @ 80C7268 + push {r4-r7,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x4 + bls _080C7284 + b _080C756A +_080C7284: + lsls r0, 2 + ldr r1, =_080C7298 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C7298: + .4byte _080C72AC + .4byte _080C730C + .4byte _080C7320 + .4byte _080C746A + .4byte _080C7544 +_080C72AC: + ldrb r0, [r5, 0xA] + adds r1, r5, 0 + adds r1, 0x26 + bl sub_80C75FC + bl sub_81973A4 + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r1, =gUnknown_085716C0 + movs r2, 0xA + ldrsh r0, [r5, r2] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r2, [r0] + 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, 0 + movs r1, 0x1 + movs r3, 0xFF + bl AddTextPrinterParametrized + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldrh r0, [r5, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + bl CopyWindowToVram + b _080C7318 + .pool +_080C730C: + bl sub_80ABDFC + lsls r0, 24 + cmp r0, 0 + bne _080C7318 + b _080C756A +_080C7318: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _080C756A +_080C7320: + bl ProcessMenuInput + lsls r0, 24 + asrs r0, 24 + strh r0, [r5, 0xC] + movs r3, 0xC + ldrsh r1, [r5, r3] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080C73D0 + cmp r1, r0 + bgt _080C7342 + subs r0, 0x1 + cmp r1, r0 + beq _080C7348 + b _080C73F6 +_080C7342: + cmp r1, 0x4 + beq _080C73D0 + b _080C73F6 +_080C7348: + ldrh r3, [r5, 0xA] + strh r3, [r5, 0xE] + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080C7366 + subs r0, r3, 0x1 + strh r0, [r5, 0xE] + lsls r0, 16 + cmp r0, 0 + bge _080C7366 + movs r0, 0x4 + strh r0, [r5, 0xE] +_080C7366: + ldrh r1, [r2, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080C7382 + ldrh r0, [r5, 0xE] + adds r0, 0x1 + strh r0, [r5, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _080C7382 + movs r0, 0 + strh r0, [r5, 0xE] +_080C7382: + lsls r0, r3, 16 + asrs r0, 16 + ldrh r2, [r5, 0xE] + movs r3, 0xE + ldrsh r1, [r5, r3] + cmp r0, r1 + bne _080C7392 + b _080C756A +_080C7392: + movs r4, 0 + strh r2, [r5, 0xA] + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r1, =gUnknown_085716C0 + movs r2, 0xA + ldrsh r0, [r5, r2] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r2, [r0] + str r4, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl AddTextPrinterParametrized + b _080C756A + .pool +_080C73D0: + ldrh r0, [r5, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_819746C + bl script_env_2_disable + bl script_env_2_enable_and_set_ctx_running + ldrh r0, [r5, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl RemoveWindow + adds r0, r4, 0 + bl DestroyTask + b _080C756A +_080C73F6: + movs r3, 0xC + ldrsh r4, [r5, r3] + cmp r4, 0 + bne _080C7428 + bl sub_80C70C4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + bne _080C7428 + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_085EBCAD + str r4, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r4, 0x3 + str r4, [sp, 0xC] + b _080C7532 + .pool +_080C7428: + movs r1, 0xC + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _080C745C + bl sub_80C70C4 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bne _080C745C + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_085EBC89 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r4, 0x3 + str r4, [sp, 0xC] + b _080C7532 + .pool +_080C745C: + movs r0, 0x1 + movs r1, 0 + bl fade_screen + movs r0, 0x4 + strh r0, [r5, 0x8] + b _080C756A +_080C746A: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r7, 0x3 + adds r4, r7, 0 + ands r4, r1 + cmp r4, 0 + beq _080C749C + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r1, =gUnknown_085716C0 + movs r2, 0xA + ldrsh r0, [r5, r2] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r2, [r0] + movs r0, 0 + str r0, [sp] + b _080C7528 + .pool +_080C749C: + movs r0, 0x40 + ands r0, r1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0 + beq _080C74E8 + ldrh r0, [r5, 0xA] + subs r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + cmp r0, 0 + bge _080C74B8 + movs r0, 0x4 + strh r0, [r5, 0xA] +_080C74B8: + movs r0, 0x1 + negs r0, r0 + bl MoveMenuCursor + bl GetMenuCursorPos + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xA] + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r1, =gUnknown_085716C0 + movs r3, 0xA + ldrsh r0, [r5, r3] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r2, [r0] + str r4, [sp] + b _080C7528 + .pool +_080C74E8: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080C756A + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _080C7500 + strh r6, [r5, 0xA] +_080C7500: + movs r0, 0x1 + bl MoveMenuCursor + bl GetMenuCursorPos + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xA] + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r1, =gUnknown_085716C0 + movs r2, 0xA + ldrsh r0, [r5, r2] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r2, [r0] + str r6, [sp] +_080C7528: + movs r4, 0x2 + str r4, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + str r7, [sp, 0xC] +_080C7532: + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl AddTextPrinterParametrized + strh r4, [r5, 0x8] + b _080C756A + .pool +_080C7544: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080C756A + bl overworld_free_bg_tilemaps + ldrb r0, [r5, 0xC] + bl sub_80C7D74 + ldrh r0, [r5, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl RemoveWindow + adds r0, r4, 0 + bl DestroyTask +_080C756A: + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end c3_0808C39C + + thumb_func_start sub_80C7578 +sub_80C7578: @ 80C7578 + push {lr} + ldr r0, =c3_0808C39C + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x8] + strh r0, [r1, 0xA] + bl script_env_2_enable + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C7578 + + thumb_func_start mapldr_0808C6D8 +mapldr_0808C6D8: @ 80C75A8 + push {r4,r5,lr} + ldr r0, =0x030022c0 + ldr r5, [r0, 0xC] + movs r0, 0 + bl SetVBlankCallback + ldr r4, =c3_0808C39C + adds r0, r4, 0 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + strh r2, [r1, 0x8] + ldr r2, =0x02039d00 + ldrb r2, [r2] + strh r2, [r1, 0xA] + bl _call_via_r4 + adds r0, r5, 0 + bl SetVBlankCallback + bl pal_fill_black + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end mapldr_0808C6D8 + + thumb_func_start sub_80C75FC +sub_80C75FC: @ 80C75FC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x8 + adds r6, r0, 0 + mov r9, r1 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =gUnknown_085716E8 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, =gUnknown_085716C0 + mov r8, r0 + movs r1, 0x5 + bl GetMaxWidthInMenuTable + lsls r0, 24 + ldr r2, =0x00ffffff + ldr r1, [sp] + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + bl AddWindow + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r4, r5, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl sub_81973FC + adds r0, r4, 0 + movs r1, 0x5 + mov r2, r8 + bl PrintMenuTable + adds r0, r4, 0 + movs r1, 0x5 + adds r2, r6, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + mov r0, r9 + strh r5, [r0] + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C75FC + + thumb_func_start sub_80C7678 +sub_80C7678: @ 80C7678 + push {lr} + bl sub_80CAEA0 + ldr r1, =0x02039d00 + strb r0, [r1] + ldr r1, =0x03005dac + ldr r0, =mapldr_0808C6D8 + str r0, [r1] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C7678 + + thumb_func_start sub_80C76A4 +sub_80C76A4: @ 80C76A4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + lsls r1, 24 + lsrs r0, r1, 24 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r3, 24 + adds r4, r3, 0 + ldr r2, =0x0000ffff + cmp r3, 0x1 + bhi _080C76C6 + movs r2, 0x1 + cmp r3, 0x1 + beq _080C76CA +_080C76C6: + cmp r4, 0x3 + bne _080C7714 +_080C76CA: + lsls r0, 24 + asrs r0, 24 + lsls r2, 16 + asrs r1, r2, 16 + adds r1, r0 + lsls r0, r1, 16 + asrs r1, r0, 16 + adds r6, r2, 0 + cmp r1, 0 + blt _080C7760 + cmp r1, r7 + bgt _080C7760 +_080C76E2: + asrs r4, r0, 16 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 4 + add r0, r8 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _080C770C + asrs r0, r6, 16 + adds r0, r4, r0 + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + blt _080C7760 + cmp r2, r7 + ble _080C76E2 + b _080C7760 + .pool +_080C770C: + adds r0, r4, 0 + b _080C7764 +_080C7710: + adds r0, r5, 0 + b _080C7764 +_080C7714: + lsls r0, 24 + asrs r0, 24 + lsls r2, 16 + asrs r1, r2, 16 + adds r1, r0 + lsls r0, r1, 16 + asrs r1, r0, 16 + adds r6, r2, 0 + cmp r1, 0 + blt _080C7760 + cmp r1, r7 + bgt _080C7760 +_080C772C: + asrs r5, r0, 16 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 4 + mov r1, r8 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080C7750 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080C7710 +_080C7750: + asrs r0, r6, 16 + adds r0, r5, r0 + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + blt _080C7760 + cmp r2, r7 + ble _080C772C +_080C7760: + movs r0, 0x1 + negs r0, r0 +_080C7764: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80C76A4 + + thumb_func_start sub_80C7770 +sub_80C7770: @ 80C7770 + push {r4-r6,lr} + movs r0, 0 + bl sub_80D1D18 + movs r5, 0 +_080C777A: + movs r4, 0 + lsls r6, r5, 24 +_080C777E: + lsls r1, r4, 24 + lsrs r1, 24 + lsrs r0, r6, 24 + bl sub_80D2018 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1D + bls _080C777E + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0xD + bls _080C777A + movs r5, 0 +_080C779E: + lsls r0, r5, 24 + lsrs r0, 24 + bl sav3_get_box_name + ldr r1, =gUnknown_085EBCC1 + bl CopyString + adds r4, r5, 0x1 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x2 + bl ConvertIntToDecimalString + lsls r4, 16 + lsrs r5, r4, 16 + cmp r5, 0xD + bls _080C779E + movs r5, 0 +_080C77C2: + lsls r0, r5, 24 + lsrs r0, 24 + movs r1, 0x3 + ands r1, r5 + bl sub_80D2120 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0xD + bls _080C77C2 + bl sub_80D242C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C7770 + + thumb_func_start sub_80C77E8 +sub_80C77E8: @ 80C77E8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x20 + adds r5, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r6, r1, 0 + lsls r2, 16 + lsrs r2, 16 + adds r7, r2, 0 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + ldr r0, =gUnknown_0857173C + str r0, [sp, 0x18] + ldr r1, =0xffff0000 + add r4, sp, 0x18 + ldr r0, [r4, 0x4] + ands r0, r1 + orrs r0, r7 + str r0, [r4, 0x4] + mov r1, sp + ldr r0, =gUnknown_0857175C + str r0, [sp] + movs r0, 0x80 + lsls r0, 4 + strh r0, [r1, 0x4] + strh r6, [r1, 0x6] + ldr r0, =gUnknown_08571F5C + str r0, [sp, 0x8] + movs r0, 0xC0 + lsls r0, 1 + strh r0, [r1, 0xC] + adds r0, r6, 0x1 + strh r0, [r1, 0xE] + add r0, sp, 0x10 + movs r1, 0 + movs r2, 0x8 + bl memset + ldr r0, [sp, 0x38] + cmp r0, 0 + beq _080C7846 + adds r0, r4, 0 + bl LoadTaggedObjectPalette +_080C7846: + mov r0, sp + bl LoadObjectPics + ldr r0, =0x02039d04 + str r5, [r0] + movs r1, 0x90 + lsls r1, 2 + adds r0, r5, r1 + strh r6, [r0] + adds r1, 0x2 + adds r0, r5, r1 + strh r7, [r0] + adds r1, 0x4 + adds r0, r5, r1 + mov r1, r8 + strb r1, [r0] + movs r1, 0x8F + lsls r1, 2 + adds r0, r5, r1 + ldr r1, [sp, 0x38] + str r1, [r0] + add sp, 0x20 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C77E8 + + thumb_func_start sub_80C7890 +sub_80C7890: @ 80C7890 + push {r4,r5,lr} + ldr r5, =0x02039d04 + ldr r1, [r5] + movs r2, 0x8F + lsls r2, 2 + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, 0 + beq _080C78AC + adds r2, 0x6 + adds r0, r1, r2 + ldrh r0, [r0] + bl FreeObjectPaletteByTag +_080C78AC: + ldr r0, [r5] + movs r4, 0x90 + lsls r4, 2 + adds r0, r4 + ldrh r0, [r0] + bl FreeObjectTilesByTag + ldr r0, [r5] + adds r0, r4 + ldrh r0, [r0] + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + bl FreeObjectTilesByTag + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C7890 + + thumb_func_start sub_80C78D4 +sub_80C78D4: @ 80C78D4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_80C7958 + pop {r0} + bx r0 + thumb_func_end sub_80C78D4 + + thumb_func_start sub_80C78E4 +sub_80C78E4: @ 80C78E4 + push {lr} + bl sub_80C7B14 + pop {r0} + bx r0 + thumb_func_end sub_80C78E4 + + thumb_func_start sub_80C78F0 +sub_80C78F0: @ 80C78F0 + push {lr} + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080C790C + movs r0, 0x5 + bl audio_play + movs r0, 0xC9 + b _080C7954 + .pool +_080C790C: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080C792C + movs r0, 0x5 + bl audio_play + ldr r0, =0x02039d04 + ldr r0, [r0] + movs r1, 0x91 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + b _080C7954 + .pool +_080C792C: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080C7940 + movs r0, 0x5 + bl audio_play + bl sub_80C7BB4 + b _080C7952 +_080C7940: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080C7952 + movs r0, 0x5 + bl audio_play + bl sub_80C7B80 +_080C7952: + movs r0, 0xC8 +_080C7954: + pop {r1} + bx r1 + thumb_func_end sub_80C78F0 + + thumb_func_start sub_80C7958 +sub_80C7958: @ 80C7958 + push {r4-r6,lr} + sub sp, 0x3C + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0 + movs r1, 0 + str r0, [sp, 0x34] + str r1, [sp, 0x38] + movs r1, 0xC0 + lsls r1, 24 + ldr r0, [sp, 0x34] + orrs r0, r1 + str r0, [sp, 0x34] + ldr r1, =0xffff0fff + add r4, sp, 0x34 + ldr r0, [r4, 0x4] + ands r0, r1 + movs r1, 0x80 + lsls r1, 5 + orrs r0, r1 + str r0, [r4, 0x4] + add r1, sp, 0x1C + movs r2, 0 + strh r2, [r1] + mov r0, sp + adds r0, 0x1E + strh r2, [r0] + str r4, [sp, 0x20] + ldr r0, =gDummyObjectImageAnimTable + str r0, [sp, 0x24] + str r2, [sp, 0x28] + ldr r0, =gDummyObjectRotScalAnimTable + str r0, [sp, 0x2C] + ldr r0, =DummyObjectCallback + str r0, [sp, 0x30] + add r0, sp, 0x4 + movs r2, 0x18 + bl memcpy + ldr r6, =0x02039d04 + ldr r0, [r6] + movs r1, 0x91 + lsls r1, 2 + adds r0, r1 + strb r5, [r0] + add r2, sp, 0x4 + ldr r1, [r6] + movs r5, 0x90 + lsls r5, 2 + adds r0, r1, r5 + ldrh r0, [r0] + strh r0, [r2] + ldr r3, =0x00000242 + adds r1, r3 + ldrh r0, [r1] + strh r0, [r2, 0x2] + adds r0, r2, 0 + movs r1, 0xA0 + movs r2, 0x60 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + ldr r3, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + str r0, [r3] + ldrb r2, [r4, 0x1] + movs r1, 0x3F + adds r0, r1, 0 + ands r0, r2 + movs r2, 0x80 + orrs r0, r2 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x3] + ands r1, r0 + movs r0, 0x40 + orrs r1, r0 + strb r1, [r4, 0x3] + add r1, sp, 0x4 + adds r3, r5 + ldrh r0, [r3] + adds r0, 0x1 + strh r0, [r1] + ldr r0, =gUnknown_08571710 + str r0, [sp, 0xC] + movs r4, 0 +_080C7A10: + ldr r0, [r6] + ldr r1, =0x00000246 + adds r0, r1 + ldrb r3, [r0] + add r0, sp, 0x4 + movs r1, 0x7C + movs r2, 0x50 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + ldr r2, [r6] + lsls r3, r4, 2 + adds r2, 0x4 + adds r2, r3 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r1, r0, r1 + str r1, [r2] + movs r5, 0 + movs r0, 0x2 + ands r0, r4 + cmp r0, 0 + beq _080C7A4A + movs r0, 0xC4 + strh r0, [r1, 0x20] + movs r5, 0x2 +_080C7A4A: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _080C7A6E + ldr r1, [r6] + adds r1, 0x4 + adds r1, r3 + ldr r2, [r1] + movs r0, 0x70 + strh r0, [r2, 0x22] + ldr r2, [r1] + ldrb r1, [r2, 0x3] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2, 0x3] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_080C7A6E: + ldr r0, [r6] + adds r0, 0x4 + adds r0, r3 + ldr r0, [r0] + lsls r1, r5, 24 + lsrs r1, 24 + bl StartObjectImageAnim + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _080C7A10 + movs r4, 0 + ldr r5, =0x02039d04 +_080C7A8C: + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 19 + movs r3, 0xF8 + lsls r3, 15 + adds r0, r3 + lsrs r0, 16 + lsls r2, r4, 24 + lsrs r2, 24 + ldr r1, [r5] + ldr r3, =0x00000246 + adds r1, r3 + ldrb r1, [r1] + str r1, [sp] + movs r1, 0x58 + movs r3, 0 + bl sub_80CD2E8 + adds r2, r0, 0 + ldr r0, [r5] + lsls r1, r4, 2 + adds r0, 0x20 + adds r0, r1 + str r2, [r0] + cmp r2, 0 + beq _080C7AD4 + movs r1, 0x1 + cmp r4, 0 + bne _080C7ACC + movs r3, 0x1 + negs r3, r3 + adds r1, r3, 0 +_080C7ACC: + strh r1, [r2, 0x2E] + ldr r1, [r0] + ldr r0, =sub_80C7CF4 + str r0, [r1, 0x1C] +_080C7AD4: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1 + bls _080C7A8C + bl sub_80C7BE4 + add sp, 0x3C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C7958 + + thumb_func_start sub_80C7B14 +sub_80C7B14: @ 80C7B14 + push {r4-r6,lr} + ldr r4, =0x02039d04 + ldr r0, [r4] + ldr r0, [r0] + cmp r0, 0 + beq _080C7B2A + bl RemoveObjectAndFreeTiles + ldr r1, [r4] + movs r0, 0 + str r0, [r1] +_080C7B2A: + movs r5, 0 + adds r6, r4, 0 +_080C7B2E: + ldr r0, [r6] + lsls r4, r5, 2 + adds r0, 0x4 + adds r0, r4 + ldr r0, [r0] + cmp r0, 0 + beq _080C7B4A + bl RemoveObjectAndFreeTiles + ldr r0, [r6] + adds r0, 0x4 + adds r0, r4 + movs r1, 0 + str r1, [r0] +_080C7B4A: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x3 + bls _080C7B2E + movs r5, 0 +_080C7B56: + ldr r0, =0x02039d04 + ldr r0, [r0] + lsls r1, r5, 2 + adds r0, 0x20 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _080C7B6A + bl RemoveObjectAndFreeTiles +_080C7B6A: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x1 + bls _080C7B56 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C7B14 + + thumb_func_start sub_80C7B80 +sub_80C7B80: @ 80C7B80 + push {lr} + ldr r2, =0x02039d04 + ldr r1, [r2] + movs r0, 0x91 + lsls r0, 2 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xD + bls _080C7BA6 + ldr r0, [r2] + movs r1, 0x91 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_080C7BA6: + bl sub_80C7BE4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C7B80 + + thumb_func_start sub_80C7BB4 +sub_80C7BB4: @ 80C7BB4 + push {lr} + ldr r0, =0x02039d04 + ldr r2, [r0] + movs r1, 0x91 + lsls r1, 2 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080C7BD0 + subs r1, r0, 0x1 + b _080C7BD2 + .pool +_080C7BD0: + movs r1, 0xD +_080C7BD2: + movs r3, 0x91 + lsls r3, 2 + adds r0, r2, r3 + strb r1, [r0] + bl sub_80C7BE4 + pop {r0} + bx r0 + thumb_func_end sub_80C7BB4 + + thumb_func_start sub_80C7BE4 +sub_80C7BE4: @ 80C7BE4 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x24 + ldr r0, =0x02039d04 + mov r9, r0 + ldr r0, [r0] + movs r4, 0x91 + lsls r4, 2 + adds r0, r4 + ldrb r0, [r0] + bl sav3_get_box_name + mov r10, r0 + mov r1, r9 + ldr r0, [r1] + adds r0, r4 + ldrb r0, [r0] + bl sub_80C6FA0 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + add r4, sp, 0x1C + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x8 + bl memset + movs r0, 0x8 + strb r0, [r4, 0x3] + movs r0, 0x4 + strb r0, [r4, 0x4] + adds r0, r4, 0 + bl AddWindow + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x44 + bl FillWindowPixelBuffer + movs r0, 0x1 + mov r1, r10 + movs r2, 0x40 + bl GetStringCenterAlignXOffset + lsls r2, r0, 24 + lsrs r2, 24 + ldr r0, =gUnknown_08571734 + mov r8, r0 + str r0, [sp] + movs r6, 0x1 + negs r6, r6 + str r6, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + add r0, sp, 0xC + adds r1, r5, 0 + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r1, =gUnknown_08571737 + add r0, sp, 0xC + bl AppendString + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x40 + bl GetStringCenterAlignXOffset + lsls r2, r0, 24 + lsrs r2, 24 + mov r0, r8 + str r0, [sp] + str r6, [sp, 0x4] + add r1, sp, 0xC + str r1, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x11 + bl box_print + adds r0, r4, 0 + movs r1, 0x7 + bl GetWindowAttribute + adds r5, r0, 0 + mov r1, r9 + ldr r0, [r1] + movs r1, 0x90 + lsls r1, 2 + adds r0, r1 + ldrh r0, [r0] + bl GetObjectTileRangeStartByTag + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 11 + ldr r0, =0x06010100 + adds r1, r0 + ldr r2, =0x04000100 + adds r0, r5, 0 + bl CpuSet + adds r0, r4, 0 + bl RemoveWindow + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C7BE4 + + thumb_func_start sub_80C7CF4 +sub_80C7CF4: @ 80C7CF4 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x30] + adds r0, 0x1 + movs r2, 0 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _080C7D24 + strh r2, [r1, 0x30] + ldrh r0, [r1, 0x2E] + ldrh r3, [r1, 0x24] + adds r0, r3 + strh r0, [r1, 0x24] + ldrh r0, [r1, 0x32] + adds r0, 0x1 + strh r0, [r1, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _080C7D24 + strh r2, [r1, 0x32] + strh r2, [r1, 0x24] +_080C7D24: + pop {r0} + bx r0 + thumb_func_end sub_80C7CF4 + + thumb_func_start sub_80C7D28 +sub_80C7D28: @ 80C7D28 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl sub_80D2AA4 + bl copy_pal_bg_faded_to_pal_ram + ldr r0, =0x02039d08 + ldr r0, [r0] + movs r1, 0xB3 + lsls r1, 2 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x18 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C7D28 + + thumb_func_start c2_Box +c2_Box: @ 80C7D54 + push {lr} + bl RunTasks + bl do_scheduled_bg_tilemap_copies_to_vram + bl sub_80CA028 + bl sub_80CAA14 + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + pop {r0} + bx r0 + thumb_func_end c2_Box + + thumb_func_start sub_80C7D74 +sub_80C7D74: @ 80C7D74 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl ResetTasks + ldr r0, =0x02039d0d + strb r5, [r0] + ldr r4, =0x02039d08 + ldr r0, =0x000062c4 + bl Alloc + str r0, [r4] + cmp r0, 0 + bne _080C7DA8 + ldr r0, =sub_80C7678 + bl SetMainCallback2 + b _080C7DD4 + .pool +_080C7DA8: + movs r2, 0 + strb r5, [r0, 0x1] + ldr r0, [r4] + strb r2, [r0, 0x3] + ldr r0, =0x02039d12 + movs r1, 0 + strh r2, [r0] + ldr r0, [r4] + strb r1, [r0] + ldr r0, =task_box_related_3 + movs r1, 0x3 + bl CreateTask + ldr r1, [r4] + strb r0, [r1, 0x4] + bl get_preferred_box + ldr r1, =0x02039d10 + strb r0, [r1] + ldr r0, =c2_Box + bl SetMainCallback2 +_080C7DD4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C7D74 + + thumb_func_start c2_808CE60 +c2_808CE60: @ 80C7DEC + push {r4,lr} + bl ResetTasks + ldr r4, =0x02039d08 + ldr r0, =0x000062c4 + bl Alloc + adds r1, r0, 0 + str r1, [r4] + cmp r1, 0 + bne _080C7E18 + ldr r0, =sub_80C7678 + bl SetMainCallback2 + b _080C7E3C + .pool +_080C7E18: + ldr r0, =0x02039d0d + ldrb r0, [r0] + movs r2, 0 + strb r0, [r1, 0x1] + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x3] + ldr r0, [r4] + strb r2, [r0] + ldr r0, =task_box_related_3 + movs r1, 0x3 + bl CreateTask + ldr r1, [r4] + strb r0, [r1, 0x4] + ldr r0, =c2_Box + bl SetMainCallback2 +_080C7E3C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end c2_808CE60 + + thumb_func_start sub_80C7E50 +sub_80C7E50: @ 80C7E50 + push {lr} + movs r0, 0x10 + movs r1, 0 + bl SetGpuReg + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + movs r0, 0x16 + movs r1, 0 + bl SetGpuReg + movs r0, 0x18 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg + movs r0, 0x1C + movs r1, 0 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0 + bl SetGpuReg + pop {r0} + bx r0 + thumb_func_end sub_80C7E50 + + thumb_func_start sub_80C7E98 +sub_80C7E98: @ 80C7E98 + push {r4,lr} + sub sp, 0x4 + bl sub_80A1A74 + bl ResetAllObjectData + bl FreeAllObjectTiles + bl ResetObjectPaletteAllocator + bl ClearDma3Requests + ldr r1, =0x02021b3a + movs r2, 0xA0 + lsls r2, 2 + adds r0, r2, 0 + strh r0, [r1] + ldr r4, =0x02039d08 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x8 + adds r1, 0x10 + movs r2, 0x8 + bl sub_80D2A90 + ldr r1, =0x030022b0 + movs r0, 0x14 + strh r0, [r1] + bl clear_scheduled_bg_copies_to_vram + movs r0, 0x3 + bl sub_80D259C + ldr r2, =gUnknown_0857239C + movs r0, 0x4 + str r0, [sp] + movs r0, 0 + movs r1, 0x1 + movs r3, 0x8 + bl sub_80D2644 + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + bl sub_80D2770 + ldr r0, [r4] + ldr r1, =0x000002c7 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C7E98 + + thumb_func_start sub_80C7F1C +sub_80C7F1C: @ 80C7F1C + push {lr} + bl sub_80CDC0C + ldr r2, =0x02039d0c + movs r1, 0 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bne _080C7F32 + movs r1, 0x1 +_080C7F32: + strb r1, [r2] + ldr r1, =0x02039d0e + movs r0, 0 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C7F1C + + thumb_func_start sub_80C7F4C +sub_80C7F4C: @ 80C7F4C + push {lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080C7F6A + movs r1, 0xFC + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x00000b07 + movs r0, 0x52 + bl SetGpuReg +_080C7F6A: + movs r1, 0xFA + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C7F4C + + thumb_func_start add_to_c3_somehow +add_to_c3_somehow: @ 80C7F80 + push {r4,lr} + ldr r4, =0x03005e00 + ldr r1, =0x02039d08 + ldr r3, [r1] + ldrb r2, [r3, 0x4] + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r4 + str r0, [r1] + movs r0, 0 + strb r0, [r3] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end add_to_c3_somehow + + thumb_func_start task_box_related_3 +task_box_related_3: @ 80C7FA8 + push {lr} + sub sp, 0x4 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0xA + bls _080C7FB8 + b _080C81A2 +_080C7FB8: + lsls r0, 2 + ldr r1, =_080C7FCC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C7FCC: + .4byte _080C7FF8 + .4byte _080C8050 + .4byte _080C805E + .4byte _080C808C + .4byte _080C80A8 + .4byte _080C80C6 + .4byte _080C80E6 + .4byte _080C80EC + .4byte _080C80F2 + .4byte _080C8100 + .4byte _080C814A +_080C7FF8: + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + movs r1, 0 + bl SetGpuReg + bl sub_80C7E98 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0, 0x3] + cmp r0, 0 + beq _080C8046 + ldr r0, =0x02039d0f + ldrb r0, [r0] + cmp r0, 0x1 + beq _080C8036 + cmp r0, 0x1 + bgt _080C8030 + cmp r0, 0 + beq _080C803C + b _080C8046 + .pool +_080C8030: + cmp r0, 0x2 + beq _080C8042 + b _080C8046 +_080C8036: + bl sub_80CE790 + b _080C8046 +_080C803C: + bl sub_80CE8E4 + b _080C8046 +_080C8042: + bl sub_80C9F6C +_080C8046: + bl sub_80CA044 + bl sub_80CA0C8 + b _080C8198 +_080C8050: + bl sub_80CA0A4 + lsls r0, 24 + cmp r0, 0 + beq _080C805C + b _080C8198 +_080C805C: + b _080C80D0 +_080C805E: + movs r0, 0 + bl PutWindowTilemap + movs r0, 0x1 + bl ClearWindowTilemap + movs r0, 0 + str r0, [sp] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05000080 + mov r0, sp + bl CpuSet + movs r0, 0x1 + movs r1, 0xB + movs r2, 0xE0 + bl sub_809882C + b _080C8198 + .pool +_080C808C: + bl sub_80C7E50 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0, 0x3] + cmp r0, 0 + beq _080C809C + b _080C8198 +_080C809C: + bl sub_80C7F1C + b _080C8198 + .pool +_080C80A8: + bl sub_80CAF04 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0, 0x3] + cmp r0, 0 + bne _080C80C0 + bl sub_80CD36C + b _080C8198 + .pool +_080C80C0: + bl sub_80CD3EC + b _080C8198 +_080C80C6: + bl sub_80D0164 + lsls r0, 24 + cmp r0, 0 + bne _080C80DC +_080C80D0: + ldr r0, =sub_80C9E50 + bl add_to_c3_somehow + b _080C81A2 + .pool +_080C80DC: + bl sub_80C9FEC + bl sub_80CAC1C + b _080C8198 +_080C80E6: + bl sub_80CA0D8 + b _080C8198 +_080C80EC: + bl sub_80CA704 + b _080C8198 +_080C80F2: + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + bl sub_80CC32C + b _080C8198 +_080C8100: + bl sub_80CC35C + lsls r0, 24 + cmp r0, 0 + bne _080C81A2 + ldr r0, =0x02039d08 + ldr r2, [r0] + ldrb r0, [r2, 0x1] + cmp r0, 0x3 + beq _080C8140 + ldr r1, =0x00000da4 + adds r0, r2, r1 + movs r1, 0xD + strh r1, [r0] + ldr r1, =0x00000da6 + adds r2, r1 + ldr r1, =0x0000dace + strh r1, [r2] + bl sub_811F90C + bl sub_811FA90 + b _080C8198 + .pool +_080C8140: + bl sub_80D0C60 + bl sub_80CAEAC + b _080C8198 +_080C814A: + bl sub_80C7F4C + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0, 0x3] + cmp r0, 0 + bne _080C8174 + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r0, =sub_80C81AC + bl add_to_c3_somehow + b _080C8186 + .pool +_080C8174: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r0, =box_related_2 + bl add_to_c3_somehow +_080C8186: + ldr r0, =sub_80C7D28 + bl SetVBlankCallback + b _080C81A2 + .pool +_080C8198: + ldr r0, =0x02039d08 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080C81A2: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end task_box_related_3 + + thumb_func_start sub_80C81AC +sub_80C81AC: @ 80C81AC + push {r4,lr} + ldr r4, =0x02039d08 + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0 + beq _080C81C4 + cmp r0, 0x1 + beq _080C81DE + b _080C81EE + .pool +_080C81C4: + movs r0, 0x2 + bl audio_play + movs r0, 0x14 + movs r1, 0 + movs r2, 0x1 + bl sub_80F9BCC + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C81EE +_080C81DE: + bl sub_80F9C1C + lsls r0, 24 + cmp r0, 0 + bne _080C81EE + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow +_080C81EE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C81AC + + thumb_func_start box_related_2 +box_related_2: @ 80C81F8 + push {r4,lr} + sub sp, 0x4 + ldr r4, =0x02039d08 + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0x1 + beq _080C8230 + cmp r0, 0x1 + bgt _080C8214 + cmp r0, 0 + beq _080C821E + b _080C82A0 + .pool +_080C8214: + cmp r0, 0x2 + beq _080C8268 + cmp r0, 0x3 + beq _080C8290 + b _080C82A0 +_080C821E: + movs r1, 0x1 + negs r1, r1 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + b _080C8282 +_080C8230: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080C82A0 + ldr r0, =0x02039d0f + ldrb r0, [r0] + cmp r0, 0x2 + bne _080C825C + ldr r0, =0x0203ce7c + ldrh r0, [r0] + cmp r0, 0 + beq _080C825C + movs r0, 0x1C + bl sub_80CAC58 + b _080C8282 + .pool +_080C825C: + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow + b _080C82A0 + .pool +_080C8268: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _080C82A0 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _080C82A0 + bl sub_80CADC4 +_080C8282: + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C82A0 + .pool +_080C8290: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _080C82A0 + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow +_080C82A0: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end box_related_2 + + thumb_func_start task_pokemon_box_related +task_pokemon_box_related: @ 80C82AC + push {r4,r5,lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0xB + bls _080C82BA + b _080C879E +_080C82BA: + lsls r0, 2 + ldr r1, =_080C82CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C82CC: + .4byte _080C82FC + .4byte _080C861C + .4byte _080C865C + .4byte _080C86B4 + .4byte _080C86D8 + .4byte _080C86E2 + .4byte _080C86FC + .4byte _080C871C + .4byte _080C8722 + .4byte _080C8738 + .4byte _080C8764 + .4byte _080C878C +_080C82FC: + bl sub_80CF9EC + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + cmp r0, 0x19 + bls _080C830C + b _080C879E +_080C830C: + lsls r0, 2 + ldr r1, =_080C831C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C831C: + .4byte _080C8384 + .4byte _080C879E + .4byte _080C879E + .4byte _080C8414 + .4byte _080C8398 + .4byte _080C83CC + .4byte _080C842C + .4byte _080C8440 + .4byte _080C844C + .4byte _080C8484 + .4byte _080C84C8 + .4byte _080C854C + .4byte _080C850C + .4byte _080C851E + .4byte _080C8560 + .4byte _080C8574 + .4byte _080C8588 + .4byte _080C859C + .4byte _080C8420 + .4byte _080C85B0 + .4byte _080C85D0 + .4byte _080C85BA + .4byte _080C85DA + .4byte _080C8614 + .4byte _080C85DE + .4byte _080C85F8 +_080C8384: + movs r0, 0x5 + bl audio_play + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1] + b _080C879E + .pool +_080C8398: + ldr r4, =0x02039d08 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _080C83BC + movs r0, 0x10 + bl sub_80CAC58 + ldr r1, [r4] + movs r0, 0x3 + strb r0, [r1] + b _080C879E + .pool +_080C83BC: + bl sub_80CDC0C + ldr r0, =sub_80C87A8 + bl add_to_c3_somehow + b _080C879E + .pool +_080C83CC: + ldr r4, =0x02039d08 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + cmp r0, 0x2 + bne _080C8400 + bl sub_80CEAD0 + lsls r0, 24 + cmp r0, 0 + beq _080C8406 + ldr r0, [r4] + ldr r1, =0x00000ce6 + adds r0, r1 + ldrh r0, [r0] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _080C83F4 + b _080C84E6 +_080C83F4: + b _080C8406 + .pool +_080C8400: + cmp r0, 0x3 + beq _080C8406 + b _080C879E +_080C8406: + ldr r0, =sub_80C87E8 + bl add_to_c3_somehow + b _080C879E + .pool +_080C8414: + ldr r0, =sub_80C9BE8 + bl add_to_c3_somehow + b _080C879E + .pool +_080C8420: + ldr r0, =sub_80C9D1C + bl add_to_c3_somehow + b _080C879E + .pool +_080C842C: + movs r0, 0x5 + bl audio_play + ldr r0, =box_related + bl add_to_c3_somehow + b _080C879E + .pool +_080C8440: + ldr r0, =sub_80C8864 + bl add_to_c3_somehow + b _080C879E + .pool +_080C844C: + movs r0, 0x5 + bl audio_play + bl get_preferred_box + ldr r4, =0x02039d08 + ldr r1, [r4] + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x1 + ldr r2, =0x000002ca + adds r1, r2 + strh r0, [r1] + cmp r0, 0xD + ble _080C846E + movs r0, 0 + strh r0, [r1] +_080C846E: + ldr r1, [r4] + ldrb r0, [r1, 0x1] + cmp r0, 0x3 + beq _080C84BC + adds r0, r1, r2 + b _080C8776 + .pool +_080C8484: + movs r0, 0x5 + bl audio_play + bl get_preferred_box + ldr r4, =0x02039d08 + ldr r1, [r4] + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + ldr r2, =0x000002ca + adds r1, r2 + strh r0, [r1] + cmp r0, 0 + bge _080C84A6 + movs r0, 0xD + strh r0, [r1] +_080C84A6: + ldr r1, [r4] + ldrb r0, [r1, 0x1] + cmp r0, 0x3 + beq _080C84BC + adds r0, r1, r2 + b _080C8776 + .pool +_080C84BC: + bl sub_80CFEA8 + ldr r1, [r4] + movs r0, 0xA + strb r0, [r1] + b _080C879E +_080C84C8: + bl sub_80CEA30 + lsls r0, 24 + cmp r0, 0 + bne _080C8528 + ldr r4, =0x02039d08 + ldr r0, [r4] + ldr r1, =0x00000ce6 + adds r0, r1 + ldrh r0, [r0] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _080C84F8 +_080C84E6: + ldr r1, [r4] + movs r0, 0x5 + strb r0, [r1] + b _080C879E + .pool +_080C84F8: + movs r0, 0x5 + bl audio_play + ldr r0, =sub_80C8D78 + bl add_to_c3_somehow + b _080C879E + .pool +_080C850C: + bl sub_80CEA30 + lsls r0, 24 + cmp r0, 0 + bne _080C8528 + movs r0, 0x5 + bl audio_play + b _080C872C +_080C851E: + bl sub_80CEA6C + lsls r0, 24 + cmp r0, 0 + bne _080C8538 +_080C8528: + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x4 + strb r0, [r1] + b _080C879E + .pool +_080C8538: + movs r0, 0x5 + bl audio_play + ldr r0, =c3_0808DC50 + bl add_to_c3_somehow + b _080C879E + .pool +_080C854C: + movs r0, 0x5 + bl audio_play + ldr r0, =sub_80C8C90 + bl add_to_c3_somehow + b _080C879E + .pool +_080C8560: + movs r0, 0x5 + bl audio_play + ldr r0, =sub_80C8BEC + bl add_to_c3_somehow + b _080C879E + .pool +_080C8574: + movs r0, 0x5 + bl audio_play + ldr r0, =sub_80C9128 + bl add_to_c3_somehow + b _080C879E + .pool +_080C8588: + movs r0, 0x5 + bl audio_play + ldr r0, =sub_80C91DC + bl add_to_c3_somehow + b _080C879E + .pool +_080C859C: + movs r0, 0x5 + bl audio_play + ldr r0, =sub_80C93B0 + bl add_to_c3_somehow + b _080C879E + .pool +_080C85B0: + movs r0, 0x5 + bl audio_play + movs r0, 0 + b _080C8600 +_080C85BA: + movs r0, 0x1 + bl sub_80D01D0 + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x8 + strb r0, [r1] + b _080C879E + .pool +_080C85D0: + movs r0, 0x5 + bl audio_play + movs r0, 0x2 + b _080C85E6 +_080C85DA: + movs r0, 0x3 + b _080C8600 +_080C85DE: + movs r0, 0x5 + bl audio_play + movs r0, 0x4 +_080C85E6: + bl sub_80D01D0 + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x9 + strb r0, [r1] + b _080C879E + .pool +_080C85F8: + movs r0, 0x5 + bl audio_play + movs r0, 0x5 +_080C8600: + bl sub_80D01D0 + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x7 + strb r0, [r1] + b _080C879E + .pool +_080C8614: + movs r0, 0x20 + bl audio_play + b _080C879E +_080C861C: + bl sub_80CD554 + lsls r0, 24 + cmp r0, 0 + beq _080C8628 + b _080C879E +_080C8628: + bl sub_80CEAF8 + lsls r0, 24 + cmp r0, 0 + beq _080C8638 + bl sub_80CA9C0 + b _080C863C +_080C8638: + bl sub_80CA9EC +_080C863C: + ldr r4, =0x02039d08 + ldr r0, [r4] + ldr r1, =0x00000cea + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080C864E + bl BoxSetMosaic +_080C864E: + ldr r1, [r4] + b _080C86C8 + .pool +_080C865C: + bl sub_80CC54C + lsls r0, 24 + cmp r0, 0 + beq _080C8668 + b _080C879E +_080C8668: + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x000002ca + adds r0, r1 + ldrb r0, [r0] + bl sub_80D1D18 + ldr r0, =0x02039d0c + ldrb r0, [r0] + cmp r0, 0 + bne _080C8690 + bl sub_80CEAD0 + lsls r0, 24 + cmp r0, 0 + bne _080C8690 + bl sub_80CE00C + bl BoxSetMosaic +_080C8690: + ldr r4, =0x02039d08 + ldr r1, [r4] + ldrb r0, [r1, 0x1] + cmp r0, 0x3 + bne _080C86C8 + bl sub_80CFECC + ldr r1, [r4] + movs r0, 0xB + strb r0, [r1] + b _080C879E + .pool +_080C86B4: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C879E + bl sub_80CADC4 + ldr r0, =0x02039d08 + ldr r1, [r0] +_080C86C8: + movs r0, 0 + strb r0, [r1] + b _080C879E + .pool +_080C86D8: + movs r0, 0x20 + bl audio_play + movs r0, 0xD + b _080C86EA +_080C86E2: + movs r0, 0x20 + bl audio_play + movs r0, 0x16 +_080C86EA: + bl sub_80CAC58 + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x6 + strb r0, [r1] + b _080C879E + .pool +_080C86FC: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C879E + bl sub_80CADC4 + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow + b _080C879E + .pool +_080C871C: + bl sub_80D01E4 + b _080C8790 +_080C8722: + bl sub_80D01E4 + lsls r0, 24 + cmp r0, 0 + bne _080C879E +_080C872C: + ldr r0, =sub_80C8B90 + bl add_to_c3_somehow + b _080C879E + .pool +_080C8738: + bl sub_80D01E4 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080C879E + ldr r5, =0x02039d08 + ldr r0, [r5] + ldr r1, =0x00000cea + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080C8756 + bl BoxSetMosaic +_080C8756: + ldr r0, [r5] + strb r4, [r0] + b _080C879E + .pool +_080C8764: + bl sub_80D1218 + lsls r0, 24 + cmp r0, 0 + bne _080C879E + ldr r4, =0x02039d08 + ldr r0, [r4] + ldr r1, =0x000002ca + adds r0, r1 +_080C8776: + ldrb r0, [r0] + bl sub_80CC464 + ldr r1, [r4] + movs r0, 0x2 + strb r0, [r1] + b _080C879E + .pool +_080C878C: + bl sub_80D1218 +_080C8790: + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080C879E + ldr r0, =0x02039d08 + ldr r0, [r0] + strb r1, [r0] +_080C879E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end task_pokemon_box_related + + thumb_func_start sub_80C87A8 +sub_80C87A8: @ 80C87A8 + push {r4,lr} + ldr r4, =0x02039d08 + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0 + beq _080C87C0 + cmp r0, 0x1 + beq _080C87CE + b _080C87DE + .pool +_080C87C0: + bl sub_80CAB4C + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C87DE +_080C87CE: + bl sub_80CAB70 + lsls r0, 24 + cmp r0, 0 + bne _080C87DE + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow +_080C87DE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C87A8 + + thumb_func_start sub_80C87E8 +sub_80C87E8: @ 80C87E8 + push {r4,lr} + ldr r4, =0x02039d08 + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0x1 + beq _080C8816 + cmp r0, 0x1 + bgt _080C8804 + cmp r0, 0 + beq _080C880A + b _080C8856 + .pool +_080C8804: + cmp r0, 0x2 + beq _080C8836 + b _080C8856 +_080C880A: + movs r0, 0x5 + bl audio_play + bl sub_80CA888 + b _080C882C +_080C8816: + bl sub_80CA8C8 + lsls r0, 24 + cmp r0, 0 + bne _080C8856 + bl sub_80CDC2C + lsls r0, 24 + lsrs r0, 24 + bl sub_80CDBF8 +_080C882C: + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C8856 +_080C8836: + bl sub_80CD554 + lsls r0, 24 + cmp r0, 0 + bne _080C8856 + ldr r0, [r4] + ldr r1, =0x00000cea + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080C8850 + bl BoxSetMosaic +_080C8850: + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow +_080C8856: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C87E8 + + thumb_func_start sub_80C8864 +sub_80C8864: @ 80C8864 + push {r4,lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x6 + bls _080C8872 + b _080C8B82 +_080C8872: + lsls r0, 2 + ldr r1, =_080C8884 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C8884: + .4byte _080C88A0 + .4byte _080C8904 + .4byte _080C8920 + .4byte _080C8B3C + .4byte _080C8B50 + .4byte _080C8B46 + .4byte _080C8B6C +_080C88A0: + bl sub_80CA2B8 + lsls r0, 24 + cmp r0, 0 + beq _080C88AC + b _080C8B82 +_080C88AC: + movs r0, 0x5 + bl audio_play + ldr r4, =0x02039d08 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + beq _080C88C8 + movs r0, 0x4 + bl sub_80CAC58 + b _080C88F2 + .pool +_080C88C8: + bl sub_80D127C + lsls r0, 24 + cmp r0, 0 + bne _080C88DE + ldr r0, [r4] + ldr r1, =0x00000ce6 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _080C88EC +_080C88DE: + movs r0, 0x17 + bl sub_80CAC58 + b _080C88F2 + .pool +_080C88EC: + movs r0, 0x18 + bl sub_80CAC58 +_080C88F2: + bl sub_80CFFD0 + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1] + b _080C8B82 + .pool +_080C8904: + bl sub_80D00A8 + lsls r0, 24 + cmp r0, 0 + beq _080C8910 + b _080C8B82 +_080C8910: + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x2 + strb r0, [r1] + b _080C8B82 + .pool +_080C8920: + bl sub_80D00AC + adds r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x12 + bls _080C8930 + b _080C8B82 +_080C8930: + lsls r0, 2 + ldr r1, =_080C8940 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C8940: + .4byte _080C898C + .4byte _080C898C + .4byte _080C8A0C + .4byte _080C89F4 + .4byte _080C899C + .4byte _080C89D4 + .4byte _080C89BC + .4byte _080C8AAC + .4byte _080C8A48 + .4byte _080C8AC0 + .4byte _080C8B82 + .4byte _080C8B82 + .4byte _080C8B82 + .4byte _080C8AD4 + .4byte _080C8AE8 + .4byte _080C8B1C + .4byte _080C8B08 + .4byte _080C8AFC + .4byte _080C8B30 +_080C898C: + bl sub_80CADC4 + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow + b _080C8B82 + .pool +_080C899C: + bl sub_80CEA30 + lsls r0, 24 + cmp r0, 0 + bne _080C8A52 + movs r0, 0x5 + bl audio_play + bl sub_80CADC4 + ldr r0, =sub_80C8B90 + bl add_to_c3_somehow + b _080C8B82 + .pool +_080C89BC: + movs r0, 0x5 + bl audio_play + bl sub_80CADC4 + ldr r0, =sub_80C8BEC + bl add_to_c3_somehow + b _080C8B82 + .pool +_080C89D4: + bl sub_80CEA6C + lsls r0, 24 + cmp r0, 0 + beq _080C8A52 + movs r0, 0x5 + bl audio_play + bl sub_80CADC4 + ldr r0, =c3_0808DC50 + bl add_to_c3_somehow + b _080C8B82 + .pool +_080C89F4: + movs r0, 0x5 + bl audio_play + bl sub_80CADC4 + ldr r0, =sub_80C8C90 + bl add_to_c3_somehow + b _080C8B82 + .pool +_080C8A0C: + bl sub_80CEA30 + lsls r0, 24 + cmp r0, 0 + bne _080C8A52 + ldr r4, =0x02039d08 + ldr r0, [r4] + ldr r2, =0x00000ce6 + adds r0, r2 + ldrh r0, [r0] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + bne _080C8A8C + movs r0, 0x5 + bl audio_play + bl sub_80CADC4 + ldr r0, =sub_80C8D78 + bl add_to_c3_somehow + b _080C8B82 + .pool +_080C8A48: + bl sub_80CEA30 + lsls r0, 24 + cmp r0, 0 + beq _080C8A60 +_080C8A52: + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x3 + strb r0, [r1] + b _080C8B82 + .pool +_080C8A60: + ldr r4, =0x02039d08 + ldr r1, [r4] + ldr r2, =0x00000ced + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080C8A7C + movs r0, 0x5 + strb r0, [r1] + b _080C8B82 + .pool +_080C8A7C: + ldr r2, =0x00000ce6 + adds r0, r1, r2 + ldrh r0, [r0] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _080C8A98 +_080C8A8C: + ldr r1, [r4] + movs r0, 0x4 + strb r0, [r1] + b _080C8B82 + .pool +_080C8A98: + movs r0, 0x5 + bl audio_play + ldr r0, =sub_80C8EB4 + bl add_to_c3_somehow + b _080C8B82 + .pool +_080C8AAC: + movs r0, 0x5 + bl audio_play + ldr r0, =sub_80C9B28 + bl add_to_c3_somehow + b _080C8B82 + .pool +_080C8AC0: + movs r0, 0x5 + bl audio_play + ldr r0, =sub_80C90A4 + bl add_to_c3_somehow + b _080C8B82 + .pool +_080C8AD4: + movs r0, 0x5 + bl audio_play + ldr r0, =sub_80C9128 + bl add_to_c3_somehow + b _080C8B82 + .pool +_080C8AE8: + movs r0, 0x5 + bl audio_play + ldr r0, =sub_80C91DC + bl add_to_c3_somehow + b _080C8B82 + .pool +_080C8AFC: + ldr r0, =sub_80C9298 + bl add_to_c3_somehow + b _080C8B82 + .pool +_080C8B08: + movs r0, 0x5 + bl audio_play + ldr r0, =sub_80C93B0 + bl add_to_c3_somehow + b _080C8B82 + .pool +_080C8B1C: + movs r0, 0x5 + bl audio_play + ldr r0, =sub_80C9B88 + bl add_to_c3_somehow + b _080C8B82 + .pool +_080C8B30: + ldr r0, =sub_80C9498 + bl add_to_c3_somehow + b _080C8B82 + .pool +_080C8B3C: + movs r0, 0x20 + bl audio_play + movs r0, 0xD + b _080C8B58 +_080C8B46: + movs r0, 0x20 + bl audio_play + movs r0, 0x11 + b _080C8B58 +_080C8B50: + movs r0, 0x20 + bl audio_play + movs r0, 0x16 +_080C8B58: + bl sub_80CAC58 + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x6 + strb r0, [r1] + b _080C8B82 + .pool +_080C8B6C: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C8B82 + bl sub_80CADC4 + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow +_080C8B82: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C8864 + + thumb_func_start sub_80C8B90 +sub_80C8B90: @ 80C8B90 + push {r4,lr} + ldr r4, =0x02039d08 + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0 + beq _080C8BA8 + cmp r0, 0x1 + beq _080C8BB8 + b _080C8BE2 + .pool +_080C8BA8: + movs r0, 0 + bl sub_80CDC38 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C8BE2 +_080C8BB8: + bl sub_80CDCAC + lsls r0, 24 + cmp r0, 0 + bne _080C8BE2 + ldr r0, =0x02039d0c + ldrb r0, [r0] + cmp r0, 0 + beq _080C8BDC + ldr r0, =sub_80C9670 + bl add_to_c3_somehow + b _080C8BE2 + .pool +_080C8BDC: + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow +_080C8BE2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C8B90 + + thumb_func_start sub_80C8BEC +sub_80C8BEC: @ 80C8BEC + push {r4,lr} + ldr r4, =0x02039d08 + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0 + beq _080C8C04 + cmp r0, 0x1 + beq _080C8C14 + b _080C8C3E + .pool +_080C8C04: + movs r0, 0x1 + bl sub_80CDC38 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C8C3E +_080C8C14: + bl sub_80CDCAC + lsls r0, 24 + cmp r0, 0 + bne _080C8C3E + ldr r0, =0x02039d0c + ldrb r0, [r0] + cmp r0, 0 + beq _080C8C38 + ldr r0, =sub_80C9670 + bl add_to_c3_somehow + b _080C8C3E + .pool +_080C8C38: + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow +_080C8C3E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C8BEC + + thumb_func_start c3_0808DC50 +c3_0808DC50: @ 80C8C48 + push {r4,lr} + ldr r4, =0x02039d08 + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0 + beq _080C8C60 + cmp r0, 0x1 + beq _080C8C70 + b _080C8C84 + .pool +_080C8C60: + movs r0, 0x2 + bl sub_80CDC38 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C8C84 +_080C8C70: + bl sub_80CDCAC + lsls r0, 24 + cmp r0, 0 + bne _080C8C84 + bl BoxSetMosaic + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow +_080C8C84: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end c3_0808DC50 + + thumb_func_start sub_80C8C90 +sub_80C8C90: @ 80C8C90 + push {lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x5 + bhi _080C8D6E + lsls r0, 2 + ldr r1, =_080C8CB0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C8CB0: + .4byte _080C8CC8 + .4byte _080C8D00 + .4byte _080C8D20 + .4byte _080C8D36 + .4byte _080C8D48 + .4byte _080C8D68 +_080C8CC8: + bl calc_player_party_count + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + bne _080C8CE8 + movs r0, 0xE + bl sub_80CAC58 + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1] + b _080C8D6E + .pool +_080C8CE8: + bl sub_80CDC18 + movs r0, 0 + bl sub_80CDC38 + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x2 + strb r0, [r1] + b _080C8D6E + .pool +_080C8D00: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C8D6E + bl sub_80CADC4 + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow + b _080C8D6E + .pool +_080C8D20: + bl sub_80CDCAC + lsls r0, 24 + cmp r0, 0 + bne _080C8D6E + movs r0, 0x1 + bl sub_80CC0D4 + bl sub_80CAB4C + b _080C8D56 +_080C8D36: + bl sub_80CAB70 + lsls r0, 24 + cmp r0, 0 + bne _080C8D6E + movs r0, 0x1 + bl sub_80CDC38 + b _080C8D56 +_080C8D48: + bl sub_80CDCAC + lsls r0, 24 + cmp r0, 0 + bne _080C8D6E + bl sub_80CAB20 +_080C8D56: + ldr r0, =0x02039d08 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C8D6E + .pool +_080C8D68: + ldr r0, =sub_80C87E8 + bl add_to_c3_somehow +_080C8D6E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C8C90 + + thumb_func_start sub_80C8D78 +sub_80C8D78: @ 80C8D78 + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x4 + bls _080C8D88 + b _080C8EA2 +_080C8D88: + lsls r0, 2 + ldr r1, =_080C8D9C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C8D9C: + .4byte _080C8DB0 + .4byte _080C8DEC + .4byte _080C8E4C + .4byte _080C8E64 + .4byte _080C8E88 +_080C8DB0: + movs r0, 0x6 + bl sub_80CAC58 + ldr r4, =0x02039d08 + ldr r0, [r4] + ldr r1, =0x00001e5c + adds r0, r1 + ldr r2, =0x0000dac7 + movs r1, 0 + str r1, [sp] + movs r1, 0xA + movs r3, 0x3 + bl sub_80C77E8 + ldr r0, =0x02039d0e + ldrb r0, [r0] + bl sub_80C78D4 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + b _080C8EA0 + .pool +_080C8DEC: + bl sub_80C78F0 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + cmp r0, 0xC8 + beq _080C8EA2 + cmp r0, 0xC9 + bne _080C8E0C + bl sub_80CADC4 + bl sub_80C78E4 + bl sub_80C7890 + b _080C8E7A +_080C8E0C: + adds r0, r4, 0 + bl sub_80CE19C + lsls r0, 24 + cmp r0, 0 + beq _080C8E38 + ldr r0, =0x02039d0e + strb r4, [r0] + bl sub_80CADC4 + bl sub_80C78E4 + bl sub_80C7890 + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x2 + b _080C8EA0 + .pool +_080C8E38: + movs r0, 0x8 + bl sub_80CAC58 + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x4 + b _080C8EA0 + .pool +_080C8E4C: + bl party_compaction + bl sub_80CB950 + ldr r0, =0x02039d08 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _080C8EA0 + .pool +_080C8E64: + bl sub_80CB9BC + lsls r0, 24 + cmp r0, 0 + bne _080C8EA2 + bl sub_80CE22C + bl BoxSetMosaic + bl sub_80CAB20 +_080C8E7A: + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow + b _080C8EA2 + .pool +_080C8E88: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C8EA2 + movs r0, 0x6 + bl sub_80CAC58 + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x1 +_080C8EA0: + strb r0, [r1] +_080C8EA2: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C8D78 + + thumb_func_start sub_80C8EB4 +sub_80C8EB4: @ 80C8EB4 + push {lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0xD + bls _080C8EC2 + b _080C9096 +_080C8EC2: + lsls r0, 2 + ldr r1, =_080C8ED4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C8ED4: + .4byte _080C8F0C + .4byte _080C8F22 + .4byte _080C8F5A + .4byte _080C8F80 + .4byte _080C8F8C + .4byte _080C8FA4 + .4byte _080C8FE0 + .4byte _080C8FF8 + .4byte _080C9004 + .4byte _080C9008 + .4byte _080C901C + .4byte _080C9038 + .4byte _080C904A + .4byte _080C9080 +_080C8F0C: + movs r0, 0x9 + bl sub_80CAC58 + movs r0, 0x1 + bl sub_80CAD9C + ldr r0, =0x02039d08 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080C8F22: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _080C8F4C + cmp r1, 0 + bgt _080C8F40 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080C8F46 + b _080C9096 + .pool +_080C8F40: + cmp r1, 0x1 + beq _080C8F46 + b _080C9096 +_080C8F46: + bl sub_80CADC4 + b _080C8FF8 +_080C8F4C: + bl sub_80CADC4 + bl sub_80CE3A0 + bl sub_80CE250 + b _080C905C +_080C8F5A: + bl sub_80CE580 + bl sub_80CE2A8 + lsls r0, 24 + cmp r0, 0 + beq _080C8F6A + b _080C9096 +_080C8F6A: + b _080C8F72 +_080C8F6C: + cmp r0, 0 + bne _080C8F72 + b _080C9070 +_080C8F72: + bl sub_80CE580 + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + bne _080C8F6C + b _080C905C +_080C8F80: + bl sub_80CE2D8 + bl sub_80CA230 + movs r0, 0xA + b _080C9058 +_080C8F8C: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + bne _080C8F9A + b _080C9096 +_080C8F9A: + movs r0, 0xB + b _080C9058 + .pool +_080C8FA4: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C9096 + bl sub_80CADC4 + ldr r0, =0x02039d0c + ldrb r0, [r0] + cmp r0, 0 + beq _080C8FD0 + bl party_compaction + bl sub_80CB950 + b _080C905C + .pool +_080C8FD0: + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x7 + strb r0, [r1] + b _080C9096 + .pool +_080C8FE0: + bl sub_80CB9BC + lsls r0, 24 + cmp r0, 0 + bne _080C9096 + bl sub_80CE00C + bl BoxSetMosaic + bl sub_80CAB20 + b _080C905C +_080C8FF8: + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow + b _080C9096 + .pool +_080C9004: + movs r0, 0xA + b _080C9058 +_080C9008: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C9096 + movs r0, 0x15 + b _080C9058 + .pool +_080C901C: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C9096 + bl sub_80CADC4 + bl sub_80CC064 + b _080C905C + .pool +_080C9038: + bl sub_80CC0A0 + lsls r0, 24 + cmp r0, 0 + bne _080C9096 + bl sub_80CE324 + movs r0, 0x13 + b _080C9058 +_080C904A: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C9096 + movs r0, 0x14 +_080C9058: + bl sub_80CAC58 +_080C905C: + ldr r0, =0x02039d08 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C9096 + .pool +_080C9070: + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x8 + strb r0, [r1] + b _080C9096 + .pool +_080C9080: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C9096 + bl sub_80CADC4 + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow +_080C9096: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C8EB4 + + thumb_func_start sub_80C90A4 +sub_80C90A4: @ 80C90A4 + push {r4,lr} + ldr r4, =0x02039d08 + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0 + beq _080C90BC + cmp r0, 0x1 + beq _080C90F0 + b _080C9118 + .pool +_080C90BC: + movs r0, 0xC + bl sub_80CAC58 + ldr r0, [r4] + ldr r2, =0x00000ceb + adds r1, r0, r2 + ldrb r1, [r1] + ldr r3, =0x00000da8 + adds r0, r3 + strb r1, [r0] + ldr r0, [r4] + adds r0, r2 + ldrb r0, [r0] + movs r1, 0xB0 + movs r2, 0x10 + bl sub_811FAA4 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C9118 + .pool +_080C90F0: + bl sub_811FBA4 + lsls r0, 24 + cmp r0, 0 + bne _080C9118 + bl sub_811FAF8 + bl sub_80CADC4 + ldr r0, [r4] + ldr r1, =0x00000da8 + adds r0, r1 + ldrb r0, [r0] + bl sub_80CE9A8 + bl sub_80CA230 + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow +_080C9118: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C90A4 + + thumb_func_start sub_80C9128 +sub_80C9128: @ 80C9128 + push {r4,r5,lr} + ldr r5, =0x02039d08 + ldr r0, [r5] + ldrb r1, [r0] + cmp r1, 0x1 + beq _080C9174 + cmp r1, 0x1 + bgt _080C9144 + cmp r1, 0 + beq _080C914E + b _080C91D2 + .pool +_080C9144: + cmp r1, 0x2 + beq _080C919C + cmp r1, 0x3 + beq _080C91C2 + b _080C91D2 +_080C914E: + ldr r1, =0x00000ce6 + adds r0, r1 + ldrh r0, [r0] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + bne _080C9168 + bl sub_80CADC4 + b _080C91B8 + .pool +_080C9168: + ldr r0, =sub_80C96B8 + bl add_to_c3_somehow + b _080C91D2 + .pool +_080C9174: + movs r0, 0x2 + bl sub_80CFE54 + ldr r0, =0x02039d0c + ldrb r0, [r0] + negs r4, r0 + orrs r4, r0 + lsrs r4, 31 + bl sub_80CFE08 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80D0E90 + b _080C91B8 + .pool +_080C919C: + bl sub_80D1218 + lsls r0, 24 + cmp r0, 0 + bne _080C91D2 + movs r0, 0x3 + bl sub_80CFE54 + bl sub_80CADC4 + bl sub_80CE00C + bl sub_80CA4FC +_080C91B8: + ldr r1, [r5] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C91D2 +_080C91C2: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _080C91D2 + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow +_080C91D2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C9128 + + thumb_func_start sub_80C91DC +sub_80C91DC: @ 80C91DC + push {r4,lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x4 + bhi _080C928C + lsls r0, 2 + ldr r1, =_080C91FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C91FC: + .4byte _080C9264 + .4byte _080C9210 + .4byte _080C9238 + .4byte _080C9258 + .4byte _080C927C +_080C9210: + movs r0, 0x2 + bl sub_80CFE54 + ldr r0, =0x02039d0c + ldrb r0, [r0] + negs r4, r0 + orrs r4, r0 + lsrs r4, 31 + bl sub_80CFE08 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80D1080 + b _080C9268 + .pool +_080C9238: + bl sub_80D1218 + lsls r0, 24 + cmp r0, 0 + bne _080C928C + movs r0, 0 + bl sub_80CFE54 + bl sub_80CE00C + bl sub_80CA4FC + movs r0, 0x1C + bl sub_80CAC58 + b _080C9268 +_080C9258: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C928C +_080C9264: + bl sub_80CADC4 +_080C9268: + ldr r0, =0x02039d08 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C928C + .pool +_080C927C: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _080C928C + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow +_080C928C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C91DC + + thumb_func_start sub_80C9298 +sub_80C9298: @ 80C9298 + push {r4,r5,lr} + ldr r1, =0x02039d08 + ldr r0, [r1] + ldrb r0, [r0] + adds r5, r1, 0 + cmp r0, 0x4 + bls _080C92A8 + b _080C93A2 +_080C92A8: + lsls r0, 2 + ldr r1, =_080C92BC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C92BC: + .4byte _080C92D0 + .4byte _080C9328 + .4byte _080C9348 + .4byte _080C938C + .4byte _080C9374 +_080C92D0: + ldr r0, [r5] + ldr r1, =0x00000ce6 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl bag_add_item + lsls r0, 24 + cmp r0, 0 + bne _080C92FC + movs r0, 0x20 + bl audio_play + movs r0, 0x1A + bl sub_80CAC58 + ldr r1, [r5] + movs r0, 0x3 + strb r0, [r1] + b _080C93A2 + .pool +_080C92FC: + movs r0, 0x5 + bl audio_play + ldr r0, =0x02039d0c + ldrb r0, [r0] + negs r4, r0 + orrs r4, r0 + lsrs r4, 31 + bl sub_80CFE08 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80D1114 + ldr r1, [r5] + movs r0, 0x1 + strb r0, [r1] + b _080C93A2 + .pool +_080C9328: + bl sub_80D1218 + lsls r0, 24 + cmp r0, 0 + bne _080C93A2 + movs r0, 0x19 + bl sub_80CAC58 + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x2 + strb r0, [r1] + b _080C93A2 + .pool +_080C9348: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C93A2 + bl sub_80CADC4 + bl sub_80CE00C + bl sub_80CA4FC + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x4 + strb r0, [r1] + b _080C93A2 + .pool +_080C9374: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _080C93A2 + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow + b _080C93A2 + .pool +_080C938C: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C93A2 + bl sub_80CADC4 + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow +_080C93A2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C9298 + + thumb_func_start sub_80C93B0 +sub_80C93B0: @ 80C93B0 + push {r4,lr} + ldr r1, =0x02039d08 + ldr r0, [r1] + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0x4 + bhi _080C948C + lsls r0, 2 + ldr r1, =_080C93D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C93D0: + .4byte _080C93E4 + .4byte _080C9410 + .4byte _080C9438 + .4byte _080C9458 + .4byte _080C947C +_080C93E4: + ldr r0, [r4] + ldr r1, =0x00000ce6 + adds r0, r1 + ldrh r0, [r0] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + bne _080C9404 + bl sub_80CADC4 + ldr r1, [r4] + b _080C946C + .pool +_080C9404: + ldr r0, =sub_80C96B8 + bl add_to_c3_somehow + b _080C948C + .pool +_080C9410: + movs r0, 0x2 + bl sub_80CFE54 + ldr r0, =0x02039d0c + ldrb r0, [r0] + negs r4, r0 + orrs r4, r0 + lsrs r4, 31 + bl sub_80CFE08 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80D0FAC + b _080C9468 + .pool +_080C9438: + bl sub_80D1218 + lsls r0, 24 + cmp r0, 0 + bne _080C948C + movs r0, 0x3 + bl sub_80CFE54 + bl sub_80CE00C + bl sub_80CA4FC + movs r0, 0x1D + bl sub_80CAC58 + b _080C9468 +_080C9458: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C948C + bl sub_80CADC4 +_080C9468: + ldr r0, =0x02039d08 + ldr r1, [r0] +_080C946C: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C948C + .pool +_080C947C: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _080C948C + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow +_080C948C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C93B0 + + thumb_func_start sub_80C9498 +sub_80C9498: @ 80C9498 + push {lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x6 + bhi _080C9544 + lsls r0, 2 + ldr r1, =_080C94B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C94B8: + .4byte _080C94D4 + .4byte _080C94DA + .4byte _080C94F4 + .4byte _080C94FA + .4byte _080C9500 + .4byte _080C9518 + .4byte _080C9534 +_080C94D4: + bl sub_80CADC4 + b _080C9522 +_080C94DA: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _080C9544 + movs r0, 0x6 + bl audio_play + bl sub_80D17B4 + bl sub_80D1818 + b _080C9522 +_080C94F4: + bl sub_80D184C + b _080C951C +_080C94FA: + bl IsDma3ManagerBusyWithBgCopy + b _080C951C +_080C9500: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C9544 + movs r0, 0x6 + bl audio_play + b _080C9522 + .pool +_080C9518: + bl sub_80D18E4 +_080C951C: + lsls r0, 24 + cmp r0, 0 + bne _080C9544 +_080C9522: + ldr r0, =0x02039d08 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C9544 + .pool +_080C9534: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _080C9544 + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow +_080C9544: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C9498 + + thumb_func_start sub_80C954C +sub_80C954C: @ 80C954C + push {r4,lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x5 + bls _080C955A + b _080C9664 +_080C955A: + lsls r0, 2 + ldr r1, =_080C956C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C956C: + .4byte _080C9584 + .4byte _080C95A4 + .4byte _080C9602 + .4byte _080C9624 + .4byte _080C9638 + .4byte _080C9654 +_080C9584: + movs r0, 0x5 + bl audio_play + movs r0, 0x1B + bl sub_80CAC58 + movs r0, 0 + bl sub_80CAD9C + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1] + b _080C9664 + .pool +_080C95A4: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _080C95C8 + cmp r1, 0 + bgt _080C95BE + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080C95C2 + b _080C9664 +_080C95BE: + cmp r1, 0x1 + bne _080C9664 +_080C95C2: + bl sub_80CADC4 + b _080C9648 +_080C95C8: + ldr r4, =0x02039d08 + ldr r0, [r4] + ldr r1, =0x00002234 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl bag_add_item + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080C95F4 + bl sub_80CADC4 + ldr r1, [r4] + movs r0, 0x3 + strb r0, [r1] + b _080C9664 + .pool +_080C95F4: + movs r0, 0x1A + bl sub_80CAC58 + ldr r1, [r4] + movs r0, 0x2 + strb r0, [r1] + b _080C9664 +_080C9602: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C9664 + bl sub_80CADC4 + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x5 + strb r0, [r1] + b _080C9664 + .pool +_080C9624: + bl sub_80D1194 + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x4 + strb r0, [r1] + b _080C9664 + .pool +_080C9638: + bl sub_80D1218 + lsls r0, 24 + cmp r0, 0 + bne _080C9664 + movs r0, 0 + bl sub_80CFE54 +_080C9648: + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow + b _080C9664 + .pool +_080C9654: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _080C9664 + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow +_080C9664: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C954C + + thumb_func_start sub_80C9670 +sub_80C9670: @ 80C9670 + push {r4,lr} + ldr r4, =0x02039d08 + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0 + beq _080C9688 + cmp r0, 0x1 + beq _080C969A + b _080C96AE + .pool +_080C9688: + bl party_compaction + bl sub_80CB950 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C96AE +_080C969A: + bl sub_80CB9BC + lsls r0, 24 + cmp r0, 0 + bne _080C96AE + bl sub_80CAB20 + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow +_080C96AE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C9670 + + thumb_func_start sub_80C96B8 +sub_80C96B8: @ 80C96B8 + push {r4,lr} + ldr r4, =0x02039d08 + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0x1 + beq _080C96E6 + cmp r0, 0x1 + bgt _080C96D4 + cmp r0, 0 + beq _080C96DE + b _080C9720 + .pool +_080C96D4: + cmp r0, 0x2 + beq _080C96F2 + cmp r0, 0x3 + beq _080C9710 + b _080C9720 +_080C96DE: + movs r0, 0x1E + bl sub_80CAC58 + b _080C9702 +_080C96E6: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _080C9720 + b _080C9702 +_080C96F2: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C9720 + bl sub_80CADC4 +_080C9702: + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C9720 + .pool +_080C9710: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _080C9720 + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow +_080C9720: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C96B8 + + thumb_func_start box_related +box_related: @ 80C972C + push {r4,lr} + ldr r4, =0x02039d08 + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0x1 + beq _080C9762 + cmp r0, 0x1 + bgt _080C9748 + cmp r0, 0 + beq _080C974E + b _080C9818 + .pool +_080C9748: + cmp r0, 0x2 + beq _080C9774 + b _080C9818 +_080C974E: + movs r0, 0x1 + bl sub_80CAC58 + bl sub_80CFFD0 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C9818 +_080C9762: + bl sub_80D00A8 + lsls r0, 24 + cmp r0, 0 + bne _080C9818 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080C9774: + bl sub_80D00AC + adds r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + bhi _080C9818 + lsls r0, 2 + ldr r1, =_080C9790 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C9790: + .4byte _080C97C4 + .4byte _080C97C4 + .4byte _080C9818 + .4byte _080C9818 + .4byte _080C9818 + .4byte _080C9818 + .4byte _080C9818 + .4byte _080C9818 + .4byte _080C9818 + .4byte _080C9818 + .4byte _080C9808 + .4byte _080C97F0 + .4byte _080C97DC +_080C97C4: + movs r0, 0x1 + bl sub_80CD1A8 + bl sub_80CADC4 + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow + b _080C9818 + .pool +_080C97DC: + movs r0, 0x5 + bl audio_play + ldr r0, =sub_80C9AC8 + bl add_to_c3_somehow + b _080C9818 + .pool +_080C97F0: + movs r0, 0x5 + bl audio_play + bl sub_80CADC4 + ldr r0, =sub_80C9824 + bl add_to_c3_somehow + b _080C9818 + .pool +_080C9808: + movs r0, 0x5 + bl audio_play + bl sub_80CADC4 + ldr r0, =sub_80C99D8 + bl add_to_c3_somehow +_080C9818: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end box_related + + thumb_func_start sub_80C9824 +sub_80C9824: @ 80C9824 + push {r4,r5,lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x6 + bls _080C9832 + b _080C99CC +_080C9832: + lsls r0, 2 + ldr r1, =_080C9844 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C9844: + .4byte _080C9860 + .4byte _080C9878 + .4byte _080C9894 + .4byte _080C990C + .4byte _080C993C + .4byte _080C9990 + .4byte _080C99AC +_080C9860: + bl sub_80CADD8 + movs r0, 0x2 + bl sub_80CAC58 + ldr r0, =0x02039d08 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _080C99CA + .pool +_080C9878: + bl sub_80D00A8 + lsls r0, 24 + cmp r0, 0 + beq _080C9884 + b _080C99CC +_080C9884: + ldr r0, =0x02039d08 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _080C99CA + .pool +_080C9894: + bl sub_80D00AC + ldr r4, =0x02039d08 + ldr r1, [r4] + ldr r5, =0x0000078e + adds r1, r5 + strh r0, [r1] + movs r0, 0 + ldrsh r1, [r1, r0] + cmp r1, 0x15 + bgt _080C98C0 + cmp r1, 0x12 + bge _080C98D2 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080C98C6 + b _080C99CC + .pool +_080C98C0: + cmp r1, 0x16 + beq _080C98EC + b _080C99CC +_080C98C6: + movs r0, 0x1 + bl sub_80CD1A8 + bl sub_80CADC4 + b _080C99A0 +_080C98D2: + movs r0, 0x5 + bl audio_play + bl sub_80D013C + ldr r1, [r4] + adds r2, r1, r5 + ldrh r0, [r2] + subs r0, 0x12 + strh r0, [r2] + ldrb r0, [r1] + adds r0, 0x1 + b _080C99CA +_080C98EC: + movs r0, 0x5 + bl audio_play + ldr r0, [r4] + movs r1, 0xF2 + lsls r1, 3 + adds r0, r1 + movs r1, 0x10 + strh r1, [r0] + bl sub_80D013C + bl sub_80CADC4 + ldr r1, [r4] + movs r0, 0x6 + b _080C99CA +_080C990C: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _080C99CC + ldr r4, =0x02039d08 + ldr r0, [r4] + ldr r1, =0x0000078e + adds r0, r1 + ldrb r0, [r0] + bl sub_80CAE0C + movs r0, 0x3 + bl sub_80CAC58 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + b _080C99CA + .pool +_080C993C: + bl sub_80D00AC + ldr r4, =0x02039d08 + ldr r1, [r4] + movs r5, 0xF2 + lsls r5, 3 + adds r1, r5 + strh r0, [r1] + movs r0, 0 + ldrsh r1, [r1, r0] + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _080C99CC + adds r0, 0x1 + cmp r1, r0 + bne _080C996C + bl sub_80CADC4 + ldr r1, [r4] + movs r0, 0 + b _080C99CA + .pool +_080C996C: + movs r0, 0x5 + bl audio_play + bl sub_80CADC4 + ldr r1, [r4] + adds r1, r5 + ldrh r0, [r1] + subs r0, 0x17 + strh r0, [r1] + lsls r0, 24 + lsrs r0, 24 + bl sub_80CC680 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + b _080C99CA +_080C9990: + bl sub_80CC6B0 + lsls r0, 24 + cmp r0, 0 + bne _080C99CC + movs r0, 0x1 + bl sub_80CD1A8 +_080C99A0: + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow + b _080C99CC + .pool +_080C99AC: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _080C99CC + ldr r4, =0x02039d08 + ldr r0, [r4] + movs r1, 0xF2 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + bl sub_80CC680 + ldr r1, [r4] + movs r0, 0x5 +_080C99CA: + strb r0, [r1] +_080C99CC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C9824 + + thumb_func_start sub_80C99D8 +sub_80C99D8: @ 80C99D8 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, =0x02039d08 + ldr r0, [r5] + ldrb r4, [r0] + cmp r4, 0x1 + beq _080C9A2C + cmp r4, 0x1 + bgt _080C99F4 + cmp r4, 0 + beq _080C99FE + b _080C9AB8 + .pool +_080C99F4: + cmp r4, 0x2 + beq _080C9A84 + cmp r4, 0x3 + beq _080C9A9C + b _080C9AB8 +_080C99FE: + movs r0, 0x5 + bl sub_80CAC58 + ldr r0, [r5] + ldr r1, =0x00001e5c + adds r0, r1 + ldr r2, =0x0000dac7 + str r4, [sp] + movs r1, 0xA + movs r3, 0x3 + bl sub_80C77E8 + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + bl sub_80C78D4 + b _080C9A8E + .pool +_080C9A2C: + bl sub_80C78F0 + ldr r1, [r5] + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x000002ca + adds r1, r2 + strh r0, [r1] + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0xC8 + beq _080C9AB8 + bl sub_80CADC4 + bl sub_80C78E4 + bl sub_80C7890 + ldr r0, [r5] + ldr r2, =0x000002ca + adds r1, r0, r2 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0xC9 + beq _080C9A6C + adds r4, r0, 0 + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bne _080C9A8E +_080C9A6C: + movs r0, 0x1 + bl sub_80CD1A8 + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow + b _080C9AB8 + .pool +_080C9A84: + ldr r1, =0x000002ca + adds r0, r1 + ldrb r0, [r0] + bl sub_80CC464 +_080C9A8E: + ldr r1, [r5] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C9AB8 + .pool +_080C9A9C: + bl sub_80CC54C + lsls r0, 24 + cmp r0, 0 + bne _080C9AB8 + ldr r0, [r5] + ldr r2, =0x000002ca + adds r0, r2 + ldrb r0, [r0] + bl sub_80D1D18 + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow +_080C9AB8: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C99D8 + + thumb_func_start sub_80C9AC8 +sub_80C9AC8: @ 80C9AC8 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, =0x02039d08 + ldr r0, [r5] + ldrb r4, [r0] + cmp r4, 0 + beq _080C9AE0 + cmp r4, 0x1 + beq _080C9AFE + b _080C9B18 + .pool +_080C9AE0: + bl sub_80CE760 + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, [r5] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C9B18 +_080C9AFE: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080C9B18 + ldr r0, =0x02039d0f + strb r4, [r0] + ldr r1, [r5] + movs r0, 0x2 + strb r0, [r1, 0x2] + ldr r0, =sub_80C9E50 + bl add_to_c3_somehow +_080C9B18: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C9AC8 + + thumb_func_start sub_80C9B28 +sub_80C9B28: @ 80C9B28 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, =0x02039d08 + ldr r0, [r5] + ldrb r4, [r0] + cmp r4, 0 + beq _080C9B40 + cmp r4, 0x1 + beq _080C9B5E + b _080C9B78 + .pool +_080C9B40: + bl sub_80CE7E8 + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, [r5] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C9B78 +_080C9B5E: + bl fade_and_return_progress_probably + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080C9B78 + ldr r0, =0x02039d0f + strb r1, [r0] + ldr r0, [r5] + strb r4, [r0, 0x2] + ldr r0, =sub_80C9E50 + bl add_to_c3_somehow +_080C9B78: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C9B28 + + thumb_func_start sub_80C9B88 +sub_80C9B88: @ 80C9B88 + push {r4,lr} + sub sp, 0x4 + ldr r4, =0x02039d08 + ldr r0, [r4] + ldrb r1, [r0] + cmp r1, 0 + beq _080C9BA0 + cmp r1, 0x1 + beq _080C9BBA + b _080C9BD6 + .pool +_080C9BA0: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C9BD6 +_080C9BBA: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080C9BD6 + ldr r1, =0x02039d0f + movs r0, 0x2 + strb r0, [r1] + ldr r1, [r4] + movs r0, 0x3 + strb r0, [r1, 0x2] + ldr r0, =sub_80C9E50 + bl add_to_c3_somehow +_080C9BD6: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C9B88 + + thumb_func_start sub_80C9BE8 +sub_80C9BE8: @ 80C9BE8 + push {r4,lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x4 + bls _080C9BF6 + b _080C9D08 +_080C9BF6: + lsls r0, 2 + ldr r1, =_080C9C08 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C9C08: + .4byte _080C9C1C + .4byte _080C9C78 + .4byte _080C9C8C + .4byte _080C9CC8 + .4byte _080C9CE4 +_080C9C1C: + bl sub_80CEAD0 + lsls r0, 24 + cmp r0, 0 + beq _080C9C40 + movs r0, 0x20 + bl audio_play + movs r0, 0xF + bl sub_80CAC58 + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1] + b _080C9D08 + .pool +_080C9C40: + bl sub_80D127C + lsls r0, 24 + cmp r0, 0 + beq _080C9C58 + ldr r0, =sub_80C954C + bl add_to_c3_somehow + b _080C9D08 + .pool +_080C9C58: + movs r0, 0x5 + bl audio_play + movs r0, 0 + bl sub_80CAC58 + movs r0, 0 + bl sub_80CAD9C + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x2 + strb r0, [r1] + b _080C9D08 + .pool +_080C9C78: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C9D08 + b _080C9CAA + .pool +_080C9C8C: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _080C9CBC + cmp r1, 0 + bgt _080C9CA6 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080C9CAA + b _080C9D08 +_080C9CA6: + cmp r1, 0x1 + bne _080C9D08 +_080C9CAA: + bl sub_80CADC4 + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow + b _080C9D08 + .pool +_080C9CBC: + movs r0, 0x3 + bl audio_play + bl sub_80CADC4 + b _080C9CD2 +_080C9CC8: + movs r0, 0x14 + movs r1, 0 + movs r2, 0x1 + bl sub_80F9BF4 +_080C9CD2: + ldr r0, =0x02039d08 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C9D08 + .pool +_080C9CE4: + bl sub_80F9C30 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080C9D08 + bl sub_80CABE0 + bl calc_player_party_count + ldr r1, =0x020244e9 + strb r0, [r1] + ldr r0, =0x02039d08 + ldr r0, [r0] + strb r4, [r0, 0x2] + ldr r0, =sub_80C9E50 + bl add_to_c3_somehow +_080C9D08: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C9BE8 + + thumb_func_start sub_80C9D1C +sub_80C9D1C: @ 80C9D1C + push {r4,lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x4 + bls _080C9D2A + b _080C9E3C +_080C9D2A: + lsls r0, 2 + ldr r1, =_080C9D3C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C9D3C: + .4byte _080C9D50 + .4byte _080C9DAC + .4byte _080C9DC0 + .4byte _080C9DFC + .4byte _080C9E18 +_080C9D50: + bl sub_80CEAD0 + lsls r0, 24 + cmp r0, 0 + beq _080C9D74 + movs r0, 0x20 + bl audio_play + movs r0, 0xF + bl sub_80CAC58 + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1] + b _080C9E3C + .pool +_080C9D74: + bl sub_80D127C + lsls r0, 24 + cmp r0, 0 + beq _080C9D8C + ldr r0, =sub_80C954C + bl add_to_c3_somehow + b _080C9E3C + .pool +_080C9D8C: + movs r0, 0x5 + bl audio_play + movs r0, 0x12 + bl sub_80CAC58 + movs r0, 0 + bl sub_80CAD9C + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0x2 + strb r0, [r1] + b _080C9E3C + .pool +_080C9DAC: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF3 + ands r0, r1 + cmp r0, 0 + beq _080C9E3C + b _080C9DE0 + .pool +_080C9DC0: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _080C9DE0 + cmp r1, 0 + bgt _080C9DDA + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080C9DF0 + b _080C9E3C +_080C9DDA: + cmp r1, 0x1 + beq _080C9DF0 + b _080C9E3C +_080C9DE0: + bl sub_80CADC4 + ldr r0, =task_pokemon_box_related + bl add_to_c3_somehow + b _080C9E3C + .pool +_080C9DF0: + movs r0, 0x3 + bl audio_play + bl sub_80CADC4 + b _080C9E06 +_080C9DFC: + movs r0, 0x14 + movs r1, 0 + movs r2, 0 + bl sub_80F9BF4 +_080C9E06: + ldr r0, =0x02039d08 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C9E3C + .pool +_080C9E18: + bl sub_80F9C30 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080C9E3C + bl sub_80CABE0 + bl calc_player_party_count + ldr r1, =0x020244e9 + strb r0, [r1] + ldr r0, =0x02039d08 + ldr r0, [r0] + strb r4, [r0, 0x2] + ldr r0, =sub_80C9E50 + bl add_to_c3_somehow +_080C9E3C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C9D1C + + thumb_func_start sub_80C9E50 +sub_80C9E50: @ 80C9E50 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r4, [r0, 0x2] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080C9E88 + bl sub_80D127C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080C9E88 + bl sub_80D12D4 + ldr r1, =0x02039d12 + b _080C9E8C + .pool +_080C9E88: + ldr r1, =0x02039d12 + movs r0, 0 +_080C9E8C: + strh r0, [r1] + cmp r4, 0x1 + beq _080C9EB4 + cmp r4, 0x1 + ble _080C9E9E + cmp r4, 0x2 + beq _080C9F1C + cmp r4, 0x3 + beq _080C9F48 +_080C9E9E: + bl sub_80C9FC8 + ldr r0, =sub_80C7678 + bl SetMainCallback2 + b _080C9F56 + .pool +_080C9EB4: + ldr r0, =0x02039d08 + ldr r1, [r0] + ldr r2, =0x0000218c + adds r0, r1, r2 + ldr r4, [r0] + subs r2, 0x5 + adds r0, r1, r2 + ldrb r7, [r0] + subs r2, 0x1 + adds r0, r1, r2 + ldrb r6, [r0] + ldr r0, =0x00002188 + adds r1, r0 + ldrb r5, [r1] + bl sub_80C9FC8 + cmp r5, 0 + bne _080C9F04 + ldr r0, =0x02039d14 + cmp r4, r0 + bne _080C9F04 + ldr r0, =c2_808CE60 + str r0, [sp] + movs r0, 0 + adds r1, r4, 0 + adds r2, r7, 0 + adds r3, r6, 0 + bl sub_81BFA80 + b _080C9F56 + .pool +_080C9F04: + ldr r0, =c2_808CE60 + str r0, [sp] + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r7, 0 + adds r3, r6, 0 + bl sub_81BF8EC + b _080C9F56 + .pool +_080C9F1C: + bl sub_80C9FC8 + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + bl sav3_get_box_name + adds r1, r0, 0 + movs r0, 0 + str r0, [sp] + ldr r0, =c2_808CE60 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl do_choose_name_or_words_screen + b _080C9F56 + .pool +_080C9F48: + bl sub_80C9FC8 + ldr r2, =c2_808CE60 + movs r0, 0xB + movs r1, 0 + bl GoToBagMenu +_080C9F56: + mov r0, r8 + bl DestroyTask + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C9E50 + + thumb_func_start sub_80C9F6C +sub_80C9F6C: @ 80C9F6C + push {lr} + sub sp, 0x4 + ldr r0, =0x0203ce7c + ldrh r1, [r0] + mov r0, sp + strh r1, [r0] + cmp r1, 0 + beq _080C9FC0 + bl sub_80CFE08 + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, =0x02039d0c + ldrb r0, [r0] + cmp r0, 0 + beq _080C9FAC + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr + b _080C9FB6 + .pool +_080C9FAC: + adds r0, r1, 0 + movs r1, 0xC + mov r2, sp + bl set_pokemon_data_from_selected_box +_080C9FB6: + mov r0, sp + ldrh r0, [r0] + movs r1, 0x1 + bl remove_item +_080C9FC0: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80C9F6C + + thumb_func_start sub_80C9FC8 +sub_80C9FC8: @ 80C9FC8 + push {r4,lr} + bl sub_80D25F0 + bl sub_80D01B8 + ldr r4, =0x02039d08 + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] + bl FreeAllWindowBuffers + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C9FC8 + + thumb_func_start sub_80C9FEC +sub_80C9FEC: @ 80C9FEC + push {lr} + sub sp, 0x4 + ldr r1, =0x00001f0f + movs r0, 0xE + bl SetGpuReg + ldr r1, =gUnknown_085720DC + movs r0, 0 + str r0, [sp] + movs r0, 0x3 + movs r2, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r0, =gUnknown_08572174 + ldr r1, =0x0600f800 + bl LZ77UnCompVram + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C9FEC + + thumb_func_start sub_80CA028 +sub_80CA028: @ 80CA028 + push {lr} + movs r0, 0x3 + movs r1, 0x80 + movs r2, 0x1 + bl ChangeBgX + movs r0, 0x3 + movs r1, 0x80 + movs r2, 0x2 + bl ChangeBgY + pop {r0} + bx r0 + thumb_func_end sub_80CA028 + + thumb_func_start sub_80CA044 +sub_80CA044: @ 80CA044 + push {r4,r5,lr} + sub sp, 0x4 + ldr r1, =gUnknown_08572734 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r1, =gUnknown_08DD2FE8 + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r0, =gUnknown_085722A0 + ldr r5, =0x02039d08 + ldr r1, [r5] + ldr r4, =0x00005ac4 + adds r1, r4 + bl LZ77UnCompWram + ldr r1, [r5] + adds r1, r4 + movs r0, 0x1 + bl SetBgTilemapBuffer + movs r0, 0x1 + bl ShowBg + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CA044 + + thumb_func_start sub_80CA0A4 +sub_80CA0A4: @ 80CA0A4 + push {lr} + ldr r0, =gUnknown_08572714 + bl InitWindows + lsls r0, 16 + cmp r0, 0 + beq _080CA0C0 + bl DeactivateAllTextPrinters + movs r0, 0x1 + b _080CA0C2 + .pool +_080CA0C0: + movs r0, 0 +_080CA0C2: + pop {r1} + bx r1 + thumb_func_end sub_80CA0A4 + + thumb_func_start sub_80CA0C8 +sub_80CA0C8: @ 80CA0C8 + push {lr} + ldr r0, =gUnknown_08572744 + bl LoadTaggedObjectPalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CA0C8 + + thumb_func_start sub_80CA0D8 +sub_80CA0D8: @ 80CA0D8 + push {lr} + ldr r0, =gUnknown_085723DC + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_085723FC + movs r1, 0x20 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_085726F4 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + beq _080CA124 + ldr r0, =gUnknown_0857241C + movs r1, 0x30 + movs r2, 0x20 + bl gpu_pal_apply + b _080CA12E + .pool +_080CA124: + ldr r0, =gUnknown_0857243C + movs r1, 0x30 + movs r2, 0x20 + bl gpu_pal_apply +_080CA12E: + ldr r1, =0x00001e05 + movs r0, 0xA + bl SetGpuReg + bl sub_80CA318 + bl sub_80CA154 + bl sub_80CA1C4 + bl sub_80CA230 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CA0D8 + + thumb_func_start sub_80CA154 +sub_80CA154: @ 80CA154 + push {r4,lr} + ldr r1, =0x0000dac8 + movs r0, 0x10 + movs r2, 0 + bl sub_811FFB4 + ldr r4, =0x02039d08 + ldr r1, [r4] + ldr r3, =0x00000d94 + adds r1, r3 + str r0, [r1] + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0, 0x5] + ldr r0, [r4] + adds r0, r3 + ldr r0, [r0] + adds r0, 0x43 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r4] + adds r0, r3 + ldr r2, [r0] + movs r1, 0x28 + strh r1, [r2, 0x20] + ldr r1, [r0] + movs r0, 0x96 + strh r0, [r1, 0x22] + movs r0, 0x10 + bl GetObjectTileRangeStartByTag + ldr r1, [r4] + movs r2, 0xDA + lsls r2, 4 + adds r1, r2 + lsls r0, 16 + lsrs r0, 11 + ldr r2, =0x06010000 + adds r0, r2 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CA154 + + thumb_func_start sub_80CA1C4 +sub_80CA1C4: @ 80CA1C4 + push {r4,lr} + sub sp, 0x8 + ldr r0, =gUnknown_0857274C + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + mov r0, sp + bl LoadObjectPic + movs r4, 0 +_080CA1DA: + lsls r1, r4, 6 + subs r1, r4 + adds r1, 0x8 + lsls r1, 16 + asrs r1, 16 + ldr r0, =gUnknown_085728BC + movs r2, 0x9 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02039d08 + ldr r2, [r1] + lsls r1, r4, 2 + ldr r3, =0x00000d98 + adds r2, r3 + adds r2, r1 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + str r1, [r2] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1 + bls _080CA1DA + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CA1C4 + + thumb_func_start sub_80CA230 +sub_80CA230: @ 80CA230 + push {lr} + ldr r0, =0x02039d08 + ldr r1, [r0] + ldr r2, =0x00000ce4 + adds r0, r1, r2 + ldrh r0, [r0] + subs r2, 0x4 + adds r1, r2 + ldr r1, [r1] + bl sub_80CA44C + bl sub_80CA4FC + bl sub_80CA65C + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CA230 + + thumb_func_start BoxSetMosaic +BoxSetMosaic: @ 80CA260 + push {lr} + bl sub_80CA230 + ldr r3, =0x02039d08 + ldr r0, [r3] + movs r1, 0x89 + lsls r1, 6 + adds r0, r1 + ldr r2, [r0] + cmp r2, 0 + beq _080CA2AC + ldrb r0, [r2, 0x1] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2, 0x1] + ldr r1, [r3] + movs r0, 0x89 + lsls r0, 6 + adds r1, r0 + ldr r2, [r1] + movs r0, 0xA + strh r0, [r2, 0x2E] + ldr r2, [r1] + movs r0, 0x1 + strh r0, [r2, 0x30] + ldr r2, [r1] + ldr r0, =BoxSetMosaic2 + str r0, [r2, 0x1C] + ldr r0, [r1] + ldrh r0, [r0, 0x2E] + lsls r1, r0, 12 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x4C + bl SetGpuReg +_080CA2AC: + pop {r0} + bx r0 + .pool + thumb_func_end BoxSetMosaic + + thumb_func_start sub_80CA2B8 +sub_80CA2B8: @ 80CA2B8 + ldr r0, =0x02039d08 + ldr r0, [r0] + movs r1, 0x89 + lsls r1, 6 + adds r0, r1 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + lsls r0, 27 + lsrs r0, 31 + bx lr + .pool + thumb_func_end sub_80CA2B8 + + thumb_func_start BoxSetMosaic2 +BoxSetMosaic2: @ 80CA2D0 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + ldrh r1, [r4, 0x30] + subs r0, r1 + strh r0, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + bge _080CA2E6 + movs r0, 0 + strh r0, [r4, 0x2E] +_080CA2E6: + ldrh r0, [r4, 0x2E] + lsls r1, r0, 12 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x4C + bl SetGpuReg + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080CA30E + ldrb r0, [r4, 0x1] + movs r1, 0x11 + negs r1, r1 + ands r1, r0 + strb r1, [r4, 0x1] + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] +_080CA30E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end BoxSetMosaic2 + + thumb_func_start sub_80CA318 +sub_80CA318: @ 80CA318 + push {r4-r7,lr} + sub sp, 0x28 + ldr r0, =0x02039d08 + mov r12, r0 + ldr r1, [r0] + ldr r4, =0x000022c4 + adds r0, r1, r4 + str r0, [sp, 0x18] + add r3, sp, 0x18 + movs r0, 0x82 + lsls r0, 10 + str r0, [r3, 0x4] + ldr r5, =0x00002244 + adds r1, r5 + str r1, [sp, 0x20] + ldr r0, =0x0000dac6 + add r2, sp, 0x20 + str r0, [r2, 0x4] + mov r1, sp + ldr r0, =gUnknown_08572754 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + movs r6, 0 + adds r7, r2, 0 + mov r5, r12 + movs r2, 0 + ldr r1, =0x000007ff +_080CA352: + ldr r0, [r5] + adds r0, r4 + adds r0, r6 + strb r2, [r0] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, r1 + bls _080CA352 + movs r6, 0 + ldr r5, =0x02039d08 + ldr r4, =0x00002244 + movs r2, 0 +_080CA36C: + ldr r0, [r5] + lsls r1, r6, 1 + adds r0, r4 + adds r0, r1 + strh r2, [r0] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0xF + bls _080CA36C + ldr r0, =0x02039d08 + ldr r0, [r0] + movs r6, 0x89 + lsls r6, 6 + adds r0, r6 + movs r1, 0 + str r1, [r0] + adds r0, r3, 0 + bl LoadObjectPic + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + beq _080CA420 + adds r0, r7, 0 + bl LoadTaggedObjectPalette + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xFF + beq _080CA420 + b _080CA40C + .pool +_080CA3C4: + ldr r0, =0x02039d08 + ldr r2, [r0] + movs r7, 0x89 + lsls r7, 6 + adds r3, r2, r7 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + str r0, [r3] + lsls r0, r4, 4 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + ldr r3, =0x0000223a + adds r1, r2, r3 + strh r0, [r1] + ldr r6, =0x0000223c + adds r2, r6 + lsls r0, r5, 5 + ldr r7, =0x06010000 + adds r0, r7 + str r0, [r2] + b _080CA420 + .pool +_080CA40C: + mov r0, sp + movs r1, 0x28 + movs r2, 0x30 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + bne _080CA3C4 +_080CA420: + ldr r0, =0x02039d08 + ldr r0, [r0] + movs r1, 0x89 + lsls r1, 6 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + bne _080CA43C + movs r0, 0x2 + bl FreeObjectTilesByTag + ldr r0, =0x0000dac6 + bl FreeObjectPaletteByTag +_080CA43C: + add sp, 0x28 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CA318 + + thumb_func_start sub_80CA44C +sub_80CA44C: @ 80CA44C + push {r4-r7,lr} + sub sp, 0x4 + adds r3, r1, 0 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r6, =0x02039d08 + ldr r2, [r6] + movs r7, 0x89 + lsls r7, 6 + adds r0, r2, r7 + ldr r0, [r0] + cmp r0, 0 + beq _080CA4F2 + cmp r4, 0 + beq _080CA4E8 + lsls r0, r4, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r5, =0x000022c4 + adds r1, r2, r5 + movs r2, 0x1 + str r2, [sp] + adds r2, r4, 0 + bl DecompressMonPic + ldr r1, [r6] + ldr r2, =0x00000cdc + adds r0, r1, r2 + ldr r0, [r0] + ldr r4, =0x00002244 + adds r1, r4 + bl LZ77UnCompWram + ldr r0, [r6] + adds r5, r0, r5 + ldr r1, =0x0000223c + adds r0, r1 + ldr r1, [r0] + ldr r2, =0x04000200 + adds r0, r5, 0 + bl CpuSet + ldr r0, [r6] + adds r4, r0, r4 + ldr r2, =0x0000223a + adds r0, r2 + ldrh r1, [r0] + adds r0, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, [r6] + adds r0, r7 + ldr r1, [r0] + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + b _080CA4F2 + .pool +_080CA4E8: + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080CA4F2: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80CA44C + + thumb_func_start sub_80CA4FC +sub_80CA4FC: @ 80CA4FC + push {r4-r6,lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r6, =0x02039d08 + ldr r2, [r6] + ldrb r0, [r2, 0x1] + cmp r0, 0x3 + beq _080CA588 + ldr r0, =0x00000cf9 + adds r2, r0 + movs r4, 0 + str r4, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0x6 + bl Print + ldr r2, [r6] + ldr r1, =0x00000d1d + adds r2, r1 + movs r0, 0xF + str r0, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0x2 + movs r3, 0x6 + bl Print + ldr r2, [r6] + ldr r0, =0x00000d41 + adds r2, r0 + movs r0, 0x1D + str r0, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0x2 + movs r3, 0xA + bl Print + ldr r2, [r6] + ldr r1, =0x00000d65 + adds r2, r1 + movs r0, 0x2B + str r0, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r3, 0x6 + bl Print + b _080CA5E8 + .pool +_080CA588: + ldr r0, =0x00000d65 + adds r2, r0 + movs r4, 0 + str r4, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r3, 0x6 + bl Print + ldr r2, [r6] + ldr r1, =0x00000cf9 + adds r2, r1 + movs r0, 0xD + str r0, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0x6 + bl Print + ldr r2, [r6] + ldr r0, =0x00000d1d + adds r2, r0 + movs r0, 0x1C + str r0, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0x2 + movs r3, 0x6 + bl Print + ldr r2, [r6] + ldr r1, =0x00000d41 + adds r2, r1 + movs r0, 0x2A + str r0, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0x2 + movs r3, 0xA + bl Print +_080CA5E8: + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + ldr r4, =0x02039d08 + ldr r1, [r4] + ldr r2, =0x00000ce4 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, 0 + beq _080CA640 + adds r2, 0x7 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, 0xB5 + adds r1, r2 + ldr r1, [r1] + bl sub_8120084 + ldr r0, [r4] + ldr r1, =0x00000d94 + adds r0, r1 + ldr r1, [r0] + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + b _080CA64E + .pool +_080CA640: + ldr r2, =0x00000d94 + adds r0, r1, r2 + ldr r1, [r0] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 +_080CA64E: + strb r0, [r1] + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CA4FC + + thumb_func_start sub_80CA65C +sub_80CA65C: @ 80CA65C + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x00000ce4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _080CA6B4 + movs r0, 0x2 + str r0, [sp] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x8 + bl sub_80D27AC + movs r4, 0 +_080CA680: + ldr r0, =0x02039d08 + ldr r0, [r0] + lsls r1, r4, 2 + ldr r2, =0x00000d98 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + lsls r1, r4, 1 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + bl StartObjectImageAnimIfDifferent + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1 + bls _080CA680 + b _080CA6E6 + .pool +_080CA6B4: + movs r0, 0x2 + str r0, [sp] + movs r0, 0 + movs r1, 0 + movs r2, 0x2 + movs r3, 0x8 + bl sub_80D27AC + movs r4, 0 +_080CA6C6: + ldr r0, =0x02039d08 + ldr r0, [r0] + lsls r1, r4, 2 + ldr r2, =0x00000d98 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + lsls r1, r4, 25 + lsrs r1, 24 + bl StartObjectImageAnim + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1 + bls _080CA6C6 +_080CA6E6: + movs r0, 0 + bl sub_80D2918 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CA65C + + thumb_func_start sub_80CA704 +sub_80CA704: @ 80CA704 + push {r4,lr} + sub sp, 0x4 + ldr r0, =gUnknown_08DD36C8 + ldr r4, =0x02039d08 + ldr r1, [r4] + adds r1, 0xB0 + bl LZ77UnCompWram + ldr r0, =gUnknown_08DD36A8 + movs r1, 0x10 + movs r2, 0x20 + bl gpu_pal_apply + ldr r2, [r4] + adds r2, 0xB0 + movs r0, 0x16 + str r0, [sp] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0xC + bl sub_80D2644 + ldr r2, =gUnknown_0857245C + movs r0, 0x4 + str r0, [sp] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0x9 + bl sub_80D2644 + movs r0, 0x1 + movs r1, 0xA + movs r2, 0 + bl sub_80D2770 + movs r0, 0x2 + movs r1, 0x15 + movs r2, 0 + bl sub_80D2770 + bl sub_80CAA74 + ldr r0, =0x02039d0c + ldrb r0, [r0] + cmp r0, 0 + beq _080CA790 + movs r0, 0x1 + bl sub_80CA984 + movs r0, 0x1 + bl sub_80CB7E8 + movs r0, 0x2 + bl sub_80D2918 + movs r0, 0x1 + bl sub_80D2918 + b _080CA7B2 + .pool +_080CA790: + movs r0, 0x2 + str r0, [sp] + movs r0, 0x1 + movs r1, 0 + movs r2, 0x14 + movs r3, 0xC + bl sub_80D27AC + movs r0, 0x1 + bl sub_80CA984 + movs r0, 0x1 + bl sub_80D2918 + movs r0, 0x2 + bl sub_80D2918 +_080CA7B2: + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x000002c7 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CA704 + + thumb_func_start sub_80CA7D4 +sub_80CA7D4: @ 80CA7D4 + push {lr} + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r0, 0xB0 + lsls r0, 2 + adds r2, r1, r0 + movs r3, 0 + movs r0, 0x14 + strh r0, [r2] + ldr r0, =0x000002c2 + adds r2, r1, r0 + movs r0, 0x2 + strh r0, [r2] + ldr r0, =0x000002c5 + adds r1, r0 + strb r3, [r1] + movs r0, 0 + bl sub_80CB7E8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CA7D4 + + thumb_func_start sub_80CA80C +sub_80CA80C: @ 80CA80C + push {r4,lr} + ldr r4, =0x02039d08 + ldr r2, [r4] + ldr r1, =0x000002c5 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x14 + beq _080CA87A + movs r0, 0xB0 + lsls r0, 2 + adds r1, r2, r0 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + ldr r0, =0x000002c2 + adds r1, r2, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl sub_80D27F4 + movs r0, 0x1 + bl sub_80D2918 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x8 + bl sub_80CBAF0 + ldr r1, [r4] + ldr r0, =0x000002c5 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x14 + beq _080CA874 + movs r0, 0x1 + b _080CA87C + .pool +_080CA874: + ldr r1, =0x02039d0c + movs r0, 0x1 + strb r0, [r1] +_080CA87A: + movs r0, 0 +_080CA87C: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80CA80C + + thumb_func_start sub_80CA888 +sub_80CA888: @ 80CA888 + push {r4,lr} + ldr r4, =0x02039d08 + ldr r1, [r4] + movs r0, 0xB0 + lsls r0, 2 + adds r2, r1, r0 + movs r3, 0 + movs r0, 0 + strh r0, [r2] + ldr r0, =0x000002c2 + adds r2, r1, r0 + movs r0, 0x16 + strh r0, [r2] + ldr r0, =0x000002c5 + adds r1, r0 + strb r3, [r1] + ldr r0, [r4] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080CA8B4 + bl sub_80D11CC +_080CA8B4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CA888 + + thumb_func_start sub_80CA8C8 +sub_80CA8C8: @ 80CA8C8 + push {r4,r5,lr} + sub sp, 0x8 + ldr r5, =0x02039d08 + ldr r2, [r5] + ldr r1, =0x000002c5 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x14 + beq _080CA974 + movs r0, 0xB0 + lsls r0, 2 + adds r1, r2, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + ldr r4, =0x000002c2 + adds r1, r2, r4 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + movs r2, 0x1 + negs r2, r2 + movs r0, 0x1 + movs r1, 0x3 + bl sub_80D27F4 + movs r0, 0x1 + bl sub_80D2918 + movs r1, 0x80 + lsls r1, 1 + ldr r0, [r5] + adds r0, r4 + ldrb r3, [r0] + movs r0, 0xC + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r2, 0xA + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0x8 + negs r0, r0 + bl sub_80CBAF0 + ldr r1, [r5] + ldr r0, =0x000002c5 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x14 + beq _080CA94C + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + b _080CA976 + .pool +_080CA94C: + ldr r0, =0x02039d0c + movs r1, 0 + strb r1, [r0] + bl sub_80CBB9C + bl party_compaction + movs r0, 0x2 + str r0, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x9 + bl sub_80D27AC + movs r0, 0x2 + bl sub_80D2918 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram +_080CA974: + movs r0, 0 +_080CA976: + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80CA8C8 + + thumb_func_start sub_80CA984 +sub_80CA984: @ 80CA984 + push {lr} + sub sp, 0x4 + lsls r0, 24 + cmp r0, 0 + beq _080CA99E + movs r0, 0x2 + str r0, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x9 + bl sub_80D27AC + b _080CA9AC +_080CA99E: + movs r0, 0x2 + str r0, [sp] + movs r1, 0 + movs r2, 0x2 + movs r3, 0x9 + bl sub_80D27AC +_080CA9AC: + movs r0, 0x2 + bl sub_80D2918 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80CA984 + + thumb_func_start sub_80CA9C0 +sub_80CA9C0: @ 80CA9C0 + ldr r2, =0x02039d08 + ldr r0, [r2] + ldr r1, =0x000002c7 + adds r0, r1 + movs r3, 0x1 + strb r3, [r0] + ldr r0, [r2] + adds r1, 0x1 + adds r0, r1 + movs r1, 0x1E + strb r1, [r0] + ldr r0, [r2] + ldr r1, =0x000002c9 + adds r0, r1 + strb r3, [r0] + bx lr + .pool + thumb_func_end sub_80CA9C0 + + thumb_func_start sub_80CA9EC +sub_80CA9EC: @ 80CA9EC + push {lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r2, =0x000002c7 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _080CAA06 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + bl sub_80CA984 +_080CAA06: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CA9EC + + thumb_func_start sub_80CAA14 +sub_80CAA14: @ 80CAA14 + push {r4,lr} + ldr r3, =0x02039d08 + ldr r1, [r3] + ldr r2, =0x000002c7 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080CAA60 + movs r0, 0xB2 + lsls r0, 2 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1E + bls _080CAA60 + ldr r0, [r3] + movs r1, 0xB2 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r3] + movs r2, 0 + ldr r4, =0x000002c9 + adds r1, r0, r4 + ldrb r0, [r1] + cmp r0, 0 + bne _080CAA54 + movs r2, 0x1 +_080CAA54: + strb r2, [r1] + ldr r0, [r3] + adds r0, r4 + ldrb r0, [r0] + bl sub_80CA984 +_080CAA60: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CAA14 + + thumb_func_start sub_80CAA74 +sub_80CAA74: @ 80CAA74 + push {r4,lr} + movs r4, 0x1 +_080CAA78: + movs r0, 0x64 + muls r0, r4 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + negs r1, r0 + orrs r1, r0 + lsrs r1, 31 + adds r0, r4, 0 + bl sub_80CAAA8 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _080CAA78 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CAA74 + + thumb_func_start sub_80CAAA8 +sub_80CAAA8: @ 80CAAA8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + ldr r7, =gUnknown_085724BC + cmp r1, 0 + beq _080CAAB8 + ldr r7, =gUnknown_085724A4 +_080CAAB8: + subs r0, 0x1 + lsls r1, r0, 1 + adds r1, r0 + adds r1, 0x1 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 18 + movs r1, 0xE0 + lsls r1, 11 + adds r0, r1 + lsrs r3, r0, 16 + movs r0, 0 + ldr r1, =0x02039d08 + mov r12, r1 +_080CAAD4: + movs r2, 0 + adds r4, r7, 0 + adds r4, 0x8 + adds r5, r3, 0 + adds r5, 0xC + adds r6, r0, 0x1 +_080CAAE0: + mov r0, r12 + ldr r1, [r0] + adds r0, r3, r2 + lsls r0, 1 + adds r1, 0xB0 + adds r1, r0 + lsls r0, r2, 1 + adds r0, r7 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x3 + bls _080CAAE0 + adds r7, r4, 0 + lsls r0, r5, 16 + lsrs r3, r0, 16 + lsls r0, r6, 16 + lsrs r0, 16 + cmp r0, 0x2 + bls _080CAAD4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CAAA8 + + thumb_func_start sub_80CAB20 +sub_80CAB20: @ 80CAB20 + push {lr} + sub sp, 0x4 + bl sub_80CAA74 + movs r0, 0x16 + str r0, [sp] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0xC + bl sub_80D27AC + movs r0, 0x1 + bl sub_80D2918 + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80CAB20 + + thumb_func_start sub_80CAB4C +sub_80CAB4C: @ 80CAB4C + push {lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x000002c6 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + movs r0, 0x6 + bl audio_play + bl sub_80CA7D4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CAB4C + + thumb_func_start sub_80CAB70 +sub_80CAB70: @ 80CAB70 + push {r4,r5,lr} + ldr r4, =0x02039d08 + ldr r0, [r4] + ldr r5, =0x000002c6 + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080CABAA + cmp r0, 0x1 + bgt _080CAB94 + cmp r0, 0 + beq _080CAB9A + b _080CABD8 + .pool +_080CAB94: + cmp r0, 0x2 + beq _080CABD4 + b _080CABD8 +_080CAB9A: + bl sub_80CA80C + lsls r0, 24 + cmp r0, 0 + bne _080CABD8 + bl sub_80CDBA0 + b _080CABC4 +_080CABAA: + bl sub_80CD554 + lsls r0, 24 + cmp r0, 0 + bne _080CABD8 + ldr r0, [r4] + ldr r1, =0x00000cea + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080CABC4 + bl BoxSetMosaic +_080CABC4: + ldr r1, [r4] + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080CABD8 + .pool +_080CABD4: + movs r0, 0 + b _080CABDA +_080CABD8: + movs r0, 0x1 +_080CABDA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80CAB70 + + thumb_func_start sub_80CABE0 +sub_80CABE0: @ 80CABE0 + push {r4,lr} + ldr r4, =0x02039d10 + bl get_preferred_box + ldrb r1, [r4] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + beq _080CAC0A + ldr r0, =0x000008d7 + bl FlagReset + ldr r4, =0x00004036 + bl get_preferred_box + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl VarSet +_080CAC0A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CABE0 + + thumb_func_start sub_80CAC1C +sub_80CAC1C: @ 80CAC1C + push {lr} + sub sp, 0xC + movs r1, 0xE8 + lsls r1, 5 + movs r0, 0x8 + bl SetGpuReg + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0xD0 + bl sub_809882C + movs r0, 0x20 + str r0, [sp] + movs r0, 0x14 + 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 + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0xC + pop {r0} + bx r0 + thumb_func_end sub_80CAC1C + + thumb_func_start sub_80CAC58 +sub_80CAC58: @ 80CAC58 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_81AFBF0 + ldr r1, =gUnknown_0857276C + lsls r0, r6, 3 + adds r0, r1 + ldrb r0, [r0, 0x4] + cmp r0, 0x7 + bhi _080CAD30 + lsls r0, 2 + ldr r1, =_080CAC84 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080CAC84: + .4byte _080CAD30 + .4byte _080CACA4 + .4byte _080CACA4 + .4byte _080CACA4 + .4byte _080CACB8 + .4byte _080CACB8 + .4byte _080CACB8 + .4byte _080CACD0 +_080CACA4: + ldr r0, =0x02039d08 + ldr r1, [r0] + ldr r0, =0x00000cee + adds r1, r0 + b _080CACC0 + .pool +_080CACB8: + ldr r0, =0x02039d08 + ldr r1, [r0] + ldr r2, =0x000021e0 + adds r1, r2 +_080CACC0: + movs r0, 0 + bl sub_81AFC0C + b _080CAD30 + .pool +_080CACD0: + bl sub_80D127C + lsls r0, 24 + cmp r0, 0 + beq _080CACF4 + ldr r0, =0x02039d08 + ldr r4, [r0] + ldr r0, =0x000021eb + adds r4, r0 + bl sub_80D12B8 + adds r1, r0, 0 + adds r0, r4, 0 + b _080CAD00 + .pool +_080CACF4: + ldr r0, =0x02039d08 + ldr r1, [r0] + ldr r2, =0x000021eb + adds r0, r1, r2 + ldr r2, =0x00000d65 + adds r1, r2 +_080CAD00: + bl CopyString + adds r2, r0, 0 + b _080CAD16 + .pool +_080CAD14: + adds r2, r1, 0 +_080CAD16: + subs r1, r2, 0x1 + ldrb r0, [r1] + cmp r0, 0 + beq _080CAD14 + movs r0, 0xFF + strb r0, [r2] + ldr r0, =0x02039d08 + ldr r1, [r0] + ldr r0, =0x000021eb + adds r1, r0 + movs r0, 0 + bl sub_81AFC0C +_080CAD30: + ldr r5, =0x02039d08 + ldr r0, [r5] + ldr r4, =0x00002190 + adds r0, r4 + ldr r2, =gUnknown_0857276C + lsls r1, r6, 3 + adds r1, r2 + ldr r1, [r1] + bl sub_81AFC28 + movs r0, 0x1 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, [r5] + adds r2, r4 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0xE + bl sub_8098858 + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CAC58 + + thumb_func_start sub_80CAD9C +sub_80CAD9C: @ 80CAD9C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_08572864 + movs r1, 0xB + movs r2, 0xE + movs r3, 0 + bl CreateYesNoMenu + lsls r4, 24 + asrs r4, 24 + adds r0, r4, 0 + bl MoveMenuCursorNoWrapAround + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CAD9C + + thumb_func_start sub_80CADC4 +sub_80CADC4: @ 80CADC4 + push {lr} + movs r0, 0x1 + movs r1, 0 + bl sub_8198070 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r0} + bx r0 + thumb_func_end sub_80CADC4 + + thumb_func_start sub_80CADD8 +sub_80CADD8: @ 80CADD8 + push {lr} + bl sub_80CFEF0 + movs r0, 0x12 + bl sub_80CFF34 + movs r0, 0x13 + bl sub_80CFF34 + movs r0, 0x14 + bl sub_80CFF34 + movs r0, 0x15 + bl sub_80CFF34 + bl sub_80D2494 + cmp r0, 0 + beq _080CAE04 + movs r0, 0x16 + bl sub_80CFF34 +_080CAE04: + bl sub_80CFFD0 + pop {r0} + bx r0 + thumb_func_end sub_80CADD8 + + thumb_func_start sub_80CAE0C +sub_80CAE0C: @ 80CAE0C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl sub_80CFEF0 + cmp r4, 0x1 + beq _080CAE4A + cmp r4, 0x1 + bgt _080CAE26 + cmp r4, 0 + beq _080CAE30 + b _080CAE96 +_080CAE26: + cmp r5, 0x2 + beq _080CAE64 + cmp r5, 0x3 + beq _080CAE7E + b _080CAE96 +_080CAE30: + movs r0, 0x17 + bl sub_80CFF34 + movs r0, 0x18 + bl sub_80CFF34 + movs r0, 0x19 + bl sub_80CFF34 + movs r0, 0x1A + bl sub_80CFF34 + b _080CAE96 +_080CAE4A: + movs r0, 0x1B + bl sub_80CFF34 + movs r0, 0x1C + bl sub_80CFF34 + movs r0, 0x1D + bl sub_80CFF34 + movs r0, 0x1E + bl sub_80CFF34 + b _080CAE96 +_080CAE64: + movs r0, 0x1F + bl sub_80CFF34 + movs r0, 0x20 + bl sub_80CFF34 + movs r0, 0x21 + bl sub_80CFF34 + movs r0, 0x22 + bl sub_80CFF34 + b _080CAE96 +_080CAE7E: + movs r0, 0x23 + bl sub_80CFF34 + movs r0, 0x24 + bl sub_80CFF34 + movs r0, 0x25 + bl sub_80CFF34 + movs r0, 0x26 + bl sub_80CFF34 +_080CAE96: + bl sub_80CFFD0 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80CAE0C + + thumb_func_start sub_80CAEA0 +sub_80CAEA0: @ 80CAEA0 + ldr r0, =0x02039d0d + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80CAEA0 + + thumb_func_start sub_80CAEAC +sub_80CAEAC: @ 80CAEAC + push {lr} + bl sub_80CEADC + lsls r0, 24 + cmp r0, 0 + bne _080CAEE8 + ldr r0, =0x02039d0c + ldrb r0, [r0] + cmp r0, 0 + beq _080CAED8 + bl sub_80CFE08 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1 + bl sub_80D0D8C + b _080CAEE8 + .pool +_080CAED8: + bl sub_80CFE08 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_80D0D8C +_080CAEE8: + ldr r1, =0x02039d12 + ldrh r0, [r1] + cmp r0, 0 + beq _080CAEFA + bl sub_80D0F38 + movs r0, 0x3 + bl sub_80CFE54 +_080CAEFA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CAEAC + + thumb_func_start sub_80CAF04 +sub_80CAF04: @ 80CAF04 + push {r4-r6,lr} + bl sub_80D2F04 + movs r2, 0 + ldr r3, =0x02039d08 + ldr r5, =0x00000b08 + movs r4, 0 + adds r6, r3, 0 +_080CAF14: + ldr r0, [r3] + lsls r1, r2, 1 + adds r0, r5 + adds r0, r1 + strh r4, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x27 + bls _080CAF14 + movs r2, 0 + ldr r5, =0x02039d08 + ldr r4, =0x00000b58 + movs r3, 0 +_080CAF30: + 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, 0x27 + bls _080CAF30 + movs r2, 0 + ldr r5, =0x02039d08 + movs r4, 0xA7 + lsls r4, 4 + movs r3, 0 +_080CAF4E: + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r4 + adds r0, r1 + str r3, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x5 + bls _080CAF4E + movs r2, 0 + ldr r5, =0x02039d08 + ldr r4, =0x00000a88 + movs r3, 0 +_080CAF6A: + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r4 + adds r0, r1 + str r3, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x1D + bls _080CAF6A + ldr r0, [r6] + ldr r2, =0x00000a6c + adds r1, r0, r2 + movs r2, 0 + str r2, [r1] + ldr r1, =0x0000078c + adds r0, r1 + strh r2, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CAF04 + + thumb_func_start sub_80CAFAC +sub_80CAFAC: @ 80CAFAC + push {lr} + bl sub_80CEB24 + lsls r0, 24 + movs r1, 0x1 + cmp r0, 0 + beq _080CAFBC + movs r1, 0x2 +_080CAFBC: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_80CAFAC + + thumb_func_start sub_80CAFC4 +sub_80CAFC4: @ 80CAFC4 + push {r4-r6,lr} + sub sp, 0x8 + ldr r5, =0x02039d08 + ldr r0, [r5] + ldr r4, =0x000020a4 + adds r0, r4 + movs r1, 0 + bl pokemon_getattr + adds r6, r0, 0 + ldr r0, [r5] + adds r0, r4 + movs r1, 0x41 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_80CAFAC + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0 + bl sub_80CC230 + ldr r1, [r5] + ldr r2, =0x00000a6c + adds r1, r2 + str r0, [r1] + ldr r1, =sub_80CC100 + str r1, [r0, 0x1C] + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CAFC4 + + thumb_func_start sub_80CB028 +sub_80CB028: @ 80CB028 + 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 r9, r0 + movs r0, 0 + mov r8, r0 + movs r6, 0 + movs r7, 0 +_080CB042: + movs r5, 0 + adds r1, r7, 0x1 + mov r10, r1 +_080CB048: + mov r0, r9 + adds r1, r6, 0 + movs r2, 0x41 + bl get_pokemon_data_from_any_box + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _080CB0B0 + mov r0, r9 + adds r1, r6, 0 + movs r2, 0 + bl get_pokemon_data_from_any_box + adds r1, r0, 0 + lsls r2, r5, 1 + adds r2, r5 + lsls r2, 19 + movs r3, 0xC8 + lsls r3, 15 + adds r2, r3 + asrs r2, 16 + lsls r3, r7, 1 + adds r3, r7 + lsls r3, 19 + movs r0, 0xB0 + lsls r0, 14 + adds r3, r0 + movs r0, 0x2 + str r0, [sp] + movs r0, 0x13 + subs r0, r5 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + adds r0, r4, 0 + asrs r3, 16 + bl sub_80CC230 + ldr r1, =0x02039d08 + ldr r1, [r1] + mov r3, r8 + lsls r2, r3, 2 + ldr r3, =0x00000a88 + adds r1, r3 + adds r1, r2 + str r0, [r1] + b _080CB0C0 + .pool +_080CB0B0: + ldr r0, =0x02039d08 + ldr r0, [r0] + mov r2, r8 + lsls r1, r2, 2 + ldr r3, =0x00000a88 + adds r0, r3 + adds r0, r1 + str r4, [r0] +_080CB0C0: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + mov r0, r8 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x5 + bls _080CB048 + mov r1, r10 + lsls r0, r1, 16 + lsrs r7, r0, 16 + cmp r7, 0x4 + bls _080CB042 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080CB126 + movs r6, 0 + movs r2, 0xD + negs r2, r2 + adds r4, r2, 0 +_080CB0F6: + mov r0, r9 + adds r1, r6, 0 + movs r2, 0xC + bl get_pokemon_data_from_any_box + cmp r0, 0 + bne _080CB11C + ldr r0, =0x02039d08 + ldr r0, [r0] + lsls r1, r6, 2 + ldr r3, =0x00000a88 + adds r0, r3 + adds r0, r1 + ldr r2, [r0] + ldrb r0, [r2, 0x1] + ands r0, r4 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x1] +_080CB11C: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x1D + bls _080CB0F6 +_080CB126: + 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_80CB028 + + thumb_func_start sub_80CB140 +sub_80CB140: @ 80CB140 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r7, 0 + movs r1, 0x41 + bl get_pokemon_data_from_selected_box + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r0, 0 + beq _080CB1DA + adds r0, r7, 0 + movs r1, 0x6 + bl __umodsi3 + adds r6, r0, 0 + lsls r0, r6, 24 + lsrs r0, 24 + lsls r5, r0, 1 + adds r5, r0 + lsls r5, 19 + movs r0, 0xC8 + lsls r0, 15 + adds r5, r0 + lsrs r5, 16 + adds r0, r7, 0 + movs r1, 0x6 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 1 + adds r4, r0 + lsls r4, 19 + movs r0, 0xB0 + lsls r0, 14 + adds r4, r0 + lsrs r4, 16 + adds r0, r7, 0 + movs r1, 0 + bl get_pokemon_data_from_selected_box + adds r1, r0, 0 + movs r0, 0x2 + str r0, [sp] + movs r0, 0x13 + subs r0, r6 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + mov r0, r8 + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80CC230 + adds r3, r0, 0 + ldr r0, =0x02039d08 + ldr r2, [r0] + lsls r1, r7, 2 + ldr r4, =0x00000a88 + adds r0, r2, r4 + adds r0, r1 + str r3, [r0] + ldrb r0, [r2, 0x1] + cmp r0, 0x3 + bne _080CB1DA + ldrb r0, [r3, 0x1] + movs r1, 0xD + negs r1, r1 + ands r1, r0 + movs r0, 0x4 + orrs r1, r0 + strb r1, [r3, 0x1] +_080CB1DA: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CB140 + + thumb_func_start sub_80CB1F0 +sub_80CB1F0: @ 80CB1F0 + push {r4-r7,lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r7, =0x02039d08 + ldr r6, =0x00000a88 + movs r5, 0x1 + ldr r4, =sub_80CB278 +_080CB200: + ldr r0, [r7] + lsls r1, r2, 2 + adds r0, r6 + adds r1, r0, r1 + ldr r0, [r1] + cmp r0, 0 + beq _080CB218 + strh r3, [r0, 0x32] + ldr r0, [r1] + strh r5, [r0, 0x36] + ldr r0, [r1] + str r4, [r0, 0x1C] +_080CB218: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x1D + bls _080CB200 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CB1F0 + + thumb_func_start sub_80CB234 +sub_80CB234: @ 80CB234 + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x30] + movs r3, 0x30 + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _080CB250 + subs r0, r1, 0x1 + strh r0, [r2, 0x30] + ldrh r0, [r2, 0x32] + ldrh r1, [r2, 0x20] + adds r0, r1 + strh r0, [r2, 0x20] + b _080CB266 +_080CB250: + ldr r0, =0x02039d08 + ldr r1, [r0] + ldr r3, =0x00000c66 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + ldrh r0, [r2, 0x34] + strh r0, [r2, 0x20] + ldr r0, =DummyObjectCallback + str r0, [r2, 0x1C] +_080CB266: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CB234 + + thumb_func_start sub_80CB278 +sub_80CB278: @ 80CB278 + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x36] + movs r3, 0x36 + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _080CB28C + subs r0, r1, 0x1 + strh r0, [r2, 0x36] + b _080CB2A8 +_080CB28C: + ldrh r0, [r2, 0x32] + ldrh r1, [r2, 0x20] + adds r0, r1 + strh r0, [r2, 0x20] + ldrh r1, [r2, 0x24] + adds r0, r1 + strh r0, [r2, 0x38] + subs r0, 0x45 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xB6 + bls _080CB2A8 + ldr r0, =DummyObjectCallback + str r0, [r2, 0x1C] +_080CB2A8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CB278 + + thumb_func_start sub_80CB2B0 +sub_80CB2B0: @ 80CB2B0 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0 + ldr r7, =0x02039d08 +_080CB2BA: + ldr r0, [r7] + lsls r4, r5, 2 + ldr r1, =0x00000a88 + adds r0, r1 + adds r0, r4 + ldr r0, [r0] + cmp r0, 0 + beq _080CB2DA + bl sub_80CC314 + ldr r0, [r7] + ldr r1, =0x00000a88 + adds r0, r1 + adds r0, r4 + movs r1, 0 + str r1, [r0] +_080CB2DA: + adds r0, r5, 0x6 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x4 + bls _080CB2BA + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CB2B0 + + thumb_func_start sub_80CB2F8 +sub_80CB2F8: @ 80CB2F8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x8] + lsls r2, 16 + movs r1, 0x2C + mov r8, r1 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 19 + movs r3, 0xC8 + lsls r3, 15 + adds r1, r3 + lsrs r1, 16 + str r1, [sp, 0x10] + ldr r1, [sp, 0x8] + adds r1, 0x1 + lsrs r6, r2, 16 + str r6, [sp, 0xC] + asrs r2, 16 + muls r1, r2 + ldr r2, [sp, 0x10] + subs r1, r2, r1 + lsls r1, 16 + lsrs r2, r1, 16 + movs r1, 0x13 + subs r1, r0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x14] + movs r3, 0 + mov r9, r3 + adds r5, r0, 0 + ldr r1, =0x02039d08 + ldr r0, [r1] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + beq _080CB3F0 + movs r7, 0x4 + lsls r2, 16 + mov r10, r2 +_080CB358: + ldr r6, =0x02039d08 + ldr r2, [r6] + lsls r0, r5, 1 + ldr r3, =0x00000ba8 + adds r1, r2, r3 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _080CB3C2 + lsls r4, r5, 2 + ldr r6, =0x00000be4 + adds r1, r2, r6 + adds r1, r4 + ldr r1, [r1] + mov r2, r8 + lsls r3, r2, 16 + asrs r3, 16 + movs r2, 0x2 + str r2, [sp] + ldr r6, [sp, 0x14] + str r6, [sp, 0x4] + mov r6, r10 + asrs r2, r6, 16 + bl sub_80CC230 + adds r2, r0, 0 + ldr r1, =0x02039d08 + ldr r0, [r1] + ldr r3, =0x00000a88 + adds r0, r3 + adds r1, r0, r4 + str r2, [r1] + cmp r2, 0 + beq _080CB3C2 + mov r6, sp + ldrh r6, [r6, 0x8] + strh r6, [r2, 0x30] + ldr r0, [r1] + mov r2, sp + ldrh r2, [r2, 0xC] + strh r2, [r0, 0x32] + ldr r0, [r1] + mov r3, sp + ldrh r3, [r3, 0x10] + strh r3, [r0, 0x34] + ldr r1, [r1] + ldr r0, =sub_80CB234 + str r0, [r1, 0x1C] + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080CB3C2: + adds r0, r5, 0x6 + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, r8 + adds r0, 0x18 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + subs r7, 0x1 + cmp r7, 0 + bge _080CB358 + b _080CB4A6 + .pool +_080CB3F0: + mov r10, r1 + movs r7, 0x4 + lsls r2, 16 + str r2, [sp, 0x18] +_080CB3F8: + mov r6, r10 + ldr r2, [r6] + lsls r0, r5, 1 + ldr r3, =0x00000ba8 + adds r1, r2, r3 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _080CB490 + lsls r4, r5, 2 + ldr r6, =0x00000be4 + adds r1, r2, r6 + adds r1, r4 + ldr r1, [r1] + mov r2, r8 + lsls r3, r2, 16 + asrs r3, 16 + movs r2, 0x2 + str r2, [sp] + ldr r6, [sp, 0x14] + str r6, [sp, 0x4] + ldr r6, [sp, 0x18] + asrs r2, r6, 16 + bl sub_80CC230 + adds r2, r0, 0 + mov r0, r10 + ldr r3, [r0] + ldr r1, =0x00000a88 + adds r0, r3, r1 + adds r1, r0, r4 + str r2, [r1] + cmp r2, 0 + beq _080CB490 + mov r6, sp + ldrh r6, [r6, 0x8] + strh r6, [r2, 0x30] + ldr r0, [r1] + mov r2, sp + ldrh r2, [r2, 0xC] + strh r2, [r0, 0x32] + ldr r0, [r1] + mov r6, sp + ldrh r6, [r6, 0x10] + strh r6, [r0, 0x34] + ldr r1, [r1] + ldr r0, =sub_80CB234 + str r0, [r1, 0x1C] + ldr r1, =0x00000c5c + adds r0, r3, r1 + ldrb r0, [r0] + adds r1, r5, 0 + movs r2, 0xC + bl get_pokemon_data_from_any_box + cmp r0, 0 + bne _080CB486 + mov r2, r10 + ldr r0, [r2] + ldr r3, =0x00000a88 + adds r0, r3 + adds r0, r4 + ldr r2, [r0] + ldrb r1, [r2, 0x1] + movs r6, 0xD + negs r6, r6 + adds r0, r6, 0 + ands r1, r0 + movs r0, 0x4 + orrs r1, r0 + strb r1, [r2, 0x1] +_080CB486: + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080CB490: + adds r0, r5, 0x6 + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, r8 + adds r0, 0x18 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + subs r7, 0x1 + cmp r7, 0 + bge _080CB3F8 +_080CB4A6: + mov r0, r9 + 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_80CB2F8 + + thumb_func_start sub_80CB4CC +sub_80CB4CC: @ 80CB4CC + push {r4-r7,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r6, =0x02039d08 + ldr r1, [r6] + ldr r2, =0x00000c6a + adds r1, r2 + movs r5, 0 + strb r5, [r1] + ldr r1, [r6] + ldr r3, =0x00000c6b + adds r1, r3 + strb r0, [r1] + ldr r1, [r6] + ldr r7, =0x00000c69 + adds r1, r7 + strb r4, [r1] + ldr r3, [r6] + movs r1, 0xC6 + lsls r1, 4 + adds r2, r3, r1 + movs r1, 0x20 + strh r1, [r2] + lsls r4, 24 + asrs r4, 24 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 1 + negs r1, r1 + subs r7, 0x5 + adds r2, r3, r7 + strh r1, [r2] + ldr r1, =0x00000c66 + adds r3, r1 + strh r5, [r3] + bl sub_80CB6F0 + cmp r4, 0 + ble _080CB544 + ldr r0, [r6] + ldr r2, =0x00000c68 + adds r0, r2 + movs r1, 0 + b _080CB54C + .pool +_080CB544: + ldr r0, [r6] + ldr r3, =0x00000c68 + adds r0, r3 + movs r1, 0x5 +_080CB54C: + strb r1, [r0] + ldr r0, =0x02039d08 + ldr r2, [r0] + ldr r7, =0x00000c68 + adds r0, r2, r7 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, 0x64 + ldr r3, =0x00000c62 + adds r1, r2, r3 + strh r0, [r1] + subs r7, 0x4 + adds r2, r7 + movs r1, 0 + ldrsh r0, [r2, r1] + bl sub_80CB1F0 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CB4CC + + thumb_func_start sub_80CB584 +sub_80CB584: @ 80CB584 + push {r4-r6,lr} + ldr r5, =0x02039d08 + ldr r0, [r5] + movs r4, 0xC6 + lsls r4, 4 + adds r1, r0, r4 + ldrh r0, [r1] + cmp r0, 0 + beq _080CB59A + subs r0, 0x1 + strh r0, [r1] +_080CB59A: + ldr r3, [r5] + ldr r6, =0x00000c6a + adds r0, r3, r6 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080CB61C + cmp r0, 0x1 + bgt _080CB5B8 + cmp r0, 0 + beq _080CB5C0 + b _080CB6DE + .pool +_080CB5B8: + cmp r0, 0x2 + bne _080CB5BE + b _080CB6CC +_080CB5BE: + b _080CB6DE +_080CB5C0: + ldr r0, =0x00000c62 + adds r1, r3, r0 + ldr r2, =0x00000c64 + adds r0, r3, r2 + ldrh r0, [r0] + ldrh r2, [r1] + adds r0, r2 + strh r0, [r1] + subs r0, 0x41 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xBA + bhi _080CB5DC + b _080CB6E8 +_080CB5DC: + ldr r1, =0x00000c68 + adds r0, r3, r1 + ldrb r0, [r0] + bl sub_80CB2B0 + ldr r2, [r5] + ldr r0, =0x00000c62 + adds r3, r2, r0 + ldr r1, =0x00000c69 + adds r0, r2, r1 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + ldrh r1, [r3] + adds r0, r1 + strh r0, [r3] + adds r2, r6 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + b _080CB6E8 + .pool +_080CB61C: + ldr r2, =0x00000c62 + adds r1, r3, r2 + ldr r6, =0x00000c64 + adds r2, r3, r6 + ldrh r0, [r2] + ldrh r6, [r1] + adds r0, r6 + strh r0, [r1] + ldr r6, =0x00000c68 + adds r0, r3, r6 + ldrb r0, [r0] + adds r1, r3, r4 + ldrh r1, [r1] + movs r3, 0 + ldrsh r2, [r2, r3] + bl sub_80CB2F8 + ldr r2, [r5] + ldr r3, =0x00000c66 + adds r1, r2, r3 + lsls r0, 24 + lsrs r0, 24 + ldrh r3, [r1] + adds r0, r3 + strh r0, [r1] + ldr r1, =0x00000c69 + adds r0, r2, r1 + movs r1, 0 + ldrsb r1, [r0, r1] + cmp r1, 0 + ble _080CB662 + adds r0, r2, r6 + ldrb r0, [r0] + cmp r0, 0x5 + beq _080CB66E +_080CB662: + cmp r1, 0 + bge _080CB69C + adds r0, r2, r6 + ldrb r0, [r0] + cmp r0, 0 + bne _080CB69C +_080CB66E: + ldr r0, =0x02039d08 + ldr r1, [r0] + ldr r2, =0x00000c6a + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080CB6E8 + .pool +_080CB69C: + ldr r3, =0x02039d08 + ldr r0, [r3] + ldr r6, =0x00000c68 + adds r1, r0, r6 + ldr r2, =0x00000c69 + adds r0, r2 + ldrb r0, [r0] + ldrb r6, [r1] + adds r0, r6 + movs r2, 0 + strb r0, [r1] + ldr r0, [r3] + ldr r1, =0x00000c6a + adds r0, r1 + strb r2, [r0] + b _080CB6E8 + .pool +_080CB6CC: + ldr r2, =0x00000c66 + adds r0, r3, r2 + ldrh r0, [r0] + cmp r0, 0 + bne _080CB6E8 + adds r1, r3, r4 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_080CB6DE: + movs r0, 0 + b _080CB6EA + .pool +_080CB6E8: + movs r0, 0x1 +_080CB6EA: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80CB584 + + thumb_func_start sub_80CB6F0 +sub_80CB6F0: @ 80CB6F0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + movs r0, 0 + ldr r1, =0x02039d08 + mov r9, r1 +_080CB704: + adds r0, 0x1 + mov r8, r0 + movs r7, 0x5 +_080CB70A: + lsls r0, r5, 24 + lsrs r4, r0, 24 + adds r0, r6, 0 + adds r1, r4, 0 + movs r2, 0x41 + bl get_pokemon_data_from_any_box + mov r2, r9 + ldr r1, [r2] + lsls r2, r5, 1 + ldr r3, =0x00000ba8 + adds r1, r3 + adds r1, r2 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + beq _080CB744 + adds r0, r6, 0 + adds r1, r4, 0 + movs r2, 0 + bl get_pokemon_data_from_any_box + mov r2, r9 + ldr r1, [r2] + lsls r2, r5, 2 + ldr r3, =0x00000be4 + adds r1, r3 + adds r1, r2 + str r0, [r1] +_080CB744: + adds r5, 0x1 + subs r7, 0x1 + cmp r7, 0 + bge _080CB70A + mov r0, r8 + cmp r0, 0x4 + ble _080CB704 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x00000c5c + adds r0, r1 + strb r6, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CB6F0 + + thumb_func_start sub_80CB778 +sub_80CB778: @ 80CB778 + push {r4,r5,lr} + lsls r0, 24 + ldr r5, =0x02039d08 + ldr r1, [r5] + lsrs r4, r0, 22 + ldr r0, =0x00000a88 + adds r1, r0 + adds r1, r4 + ldr r0, [r1] + cmp r0, 0 + beq _080CB79E + bl sub_80CC314 + ldr r0, [r5] + ldr r1, =0x00000a88 + adds r0, r1 + adds r0, r4 + movs r1, 0 + str r1, [r0] +_080CB79E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CB778 + + thumb_func_start sub_80CB7AC +sub_80CB7AC: @ 80CB7AC + push {lr} + lsls r0, 24 + lsls r1, 24 + lsrs r2, r1, 24 + ldr r1, =0x02039d08 + ldr r1, [r1] + lsrs r0, 22 + ldr r3, =0x00000a88 + adds r1, r3 + adds r1, r0 + ldr r3, [r1] + cmp r3, 0 + beq _080CB7DA + movs r0, 0x3 + adds r1, r2, 0 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x1] +_080CB7DA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CB7AC + + thumb_func_start sub_80CB7E8 +sub_80CB7E8: @ 80CB7E8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r4, =0x020244ec + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + adds r1, r0, 0 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xC + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r2, 0x68 + movs r3, 0x40 + bl sub_80CC230 + ldr r1, =0x02039d08 + ldr r1, [r1] + movs r2, 0xA7 + lsls r2, 4 + adds r1, r2 + str r0, [r1] + movs r7, 0x1 + movs r6, 0x1 +_080CB830: + movs r0, 0x64 + adds r1, r6, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + beq _080CB894 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + adds r1, r0, 0 + subs r0, r6, 0x1 + lsls r3, r0, 1 + adds r3, r0 + lsls r3, 19 + movs r0, 0x80 + lsls r0, 13 + adds r3, r0 + asrs r3, 16 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xC + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r2, 0x98 + bl sub_80CC230 + ldr r1, =0x02039d08 + ldr r1, [r1] + lsls r2, r6, 2 + movs r3, 0xA7 + lsls r3, 4 + adds r1, r3 + adds r1, r2 + str r0, [r1] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + b _080CB8A4 + .pool +_080CB894: + ldr r0, =0x02039d08 + ldr r0, [r0] + lsls r1, r6, 2 + movs r2, 0xA7 + lsls r2, 4 + adds r0, r2 + adds r0, r1 + str r5, [r0] +_080CB8A4: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x5 + bls _080CB830 + ldr r3, =0x02039d08 + mov r0, r8 + cmp r0, 0 + bne _080CB8EA + movs r6, 0 + cmp r6, r7 + bcs _080CB8EA + mov r12, r3 + movs r5, 0xA7 + lsls r5, 4 + movs r4, 0x4 +_080CB8C4: + mov r2, r12 + ldr r1, [r2] + lsls r0, r6, 2 + adds r1, r5 + adds r1, r0 + ldr r2, [r1] + ldrh r0, [r2, 0x22] + subs r0, 0xA0 + strh r0, [r2, 0x22] + ldr r1, [r1] + adds r1, 0x3E + ldrb r0, [r1] + orrs r0, r4 + strb r0, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, r7 + bcc _080CB8C4 +_080CB8EA: + ldr r0, [r3] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080CB93C + movs r6, 0 + adds r7, r3, 0 + movs r5, 0xA7 + lsls r5, 4 +_080CB8FA: + ldr r0, [r7] + lsls r4, r6, 2 + adds r0, r5 + adds r0, r4 + ldr r0, [r0] + cmp r0, 0 + beq _080CB932 + movs r0, 0x64 + muls r0, r6 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xC + bl pokemon_getattr + cmp r0, 0 + bne _080CB932 + ldr r0, [r7] + adds r0, r5 + adds r0, r4 + ldr r2, [r0] + ldrb r1, [r2, 0x1] + movs r3, 0xD + negs r3, r3 + adds r0, r3, 0 + ands r1, r0 + movs r0, 0x4 + orrs r1, r0 + strb r1, [r2, 0x1] +_080CB932: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x5 + bls _080CB8FA +_080CB93C: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CB7E8 + + thumb_func_start sub_80CB950 +sub_80CB950: @ 80CB950 + push {r4-r7,lr} + sub sp, 0x4 + ldr r0, =0x02039d08 + ldr r1, [r0] + ldr r2, =0x00000c5e + adds r1, r2 + movs r2, 0 + strb r2, [r1] + movs r5, 0 + movs r6, 0 + adds r3, r0, 0 + movs r7, 0xA7 + lsls r7, 4 +_080CB96A: + ldr r0, [r3] + lsls r4, r5, 2 + adds r0, r7 + adds r0, r4 + ldr r0, [r0] + cmp r0, 0 + beq _080CB9A0 + cmp r5, r6 + beq _080CB99A + adds r1, r6, 0 + str r3, [sp] + bl sub_80CB9D0 + ldr r3, [sp] + ldr r2, [r3] + adds r0, r2, r7 + adds r0, r4 + movs r1, 0 + str r1, [r0] + ldr r0, =0x00000c5e + adds r2, r0 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] +_080CB99A: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_080CB9A0: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x5 + bls _080CB96A + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CB950 + + thumb_func_start sub_80CB9BC +sub_80CB9BC: @ 80CB9BC + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x00000c5e + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80CB9BC + + thumb_func_start sub_80CB9D0 +sub_80CB9D0: @ 80CB9D0 + push {r4,lr} + adds r2, r0, 0 + lsls r1, 16 + lsrs r1, 16 + strh r1, [r2, 0x30] + cmp r1, 0 + bne _080CB9E4 + movs r3, 0x68 + movs r4, 0x40 + b _080CB9F6 +_080CB9E4: + movs r3, 0x98 + subs r1, 0x1 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 19 + movs r1, 0x80 + lsls r1, 13 + adds r0, r1 + lsrs r4, r0, 16 +_080CB9F6: + ldrh r0, [r2, 0x20] + lsls r0, 3 + strh r0, [r2, 0x32] + ldrh r0, [r2, 0x22] + lsls r0, 3 + strh r0, [r2, 0x34] + lsls r1, r3, 3 + movs r3, 0x32 + ldrsh r0, [r2, r3] + subs r0, r1, r0 + cmp r0, 0 + bge _080CBA10 + adds r0, 0x7 +_080CBA10: + asrs r0, 3 + strh r0, [r2, 0x36] + lsls r0, r4, 16 + asrs r0, 13 + movs r3, 0x34 + ldrsh r1, [r2, r3] + subs r0, r1 + cmp r0, 0 + bge _080CBA24 + adds r0, 0x7 +_080CBA24: + asrs r0, 3 + strh r0, [r2, 0x38] + movs r0, 0x8 + strh r0, [r2, 0x3A] + ldr r0, =sub_80CBA3C + str r0, [r2, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CB9D0 + + thumb_func_start sub_80CBA3C +sub_80CBA3C: @ 80CBA3C + push {r4,lr} + adds r3, r0, 0 + ldrh r2, [r3, 0x3A] + movs r1, 0x3A + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _080CBA6C + ldrh r0, [r3, 0x36] + ldrh r4, [r3, 0x32] + adds r0, r4 + strh r0, [r3, 0x32] + ldrh r1, [r3, 0x38] + ldrh r4, [r3, 0x34] + adds r1, r4 + strh r1, [r3, 0x34] + lsls r0, 16 + asrs r0, 19 + strh r0, [r3, 0x20] + lsls r1, 16 + asrs r1, 19 + strh r1, [r3, 0x22] + subs r0, r2, 0x1 + strh r0, [r3, 0x3A] + b _080CBAB2 +_080CBA6C: + movs r1, 0x30 + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _080CBA7C + movs r0, 0x68 + strh r0, [r3, 0x20] + movs r0, 0x40 + b _080CBA8E +_080CBA7C: + movs r0, 0x98 + strh r0, [r3, 0x20] + movs r4, 0x30 + ldrsh r1, [r3, r4] + subs r1, 0x1 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, 0x10 +_080CBA8E: + strh r0, [r3, 0x22] + ldr r0, =DummyObjectCallback + str r0, [r3, 0x1C] + ldr r0, =0x02039d08 + ldr r2, [r0] + movs r0, 0x30 + ldrsh r1, [r3, r0] + lsls r1, 2 + movs r4, 0xA7 + lsls r4, 4 + adds r0, r2, r4 + adds r0, r1 + str r3, [r0] + ldr r0, =0x00000c5e + adds r2, r0 + ldrb r0, [r2] + subs r0, 0x1 + strb r0, [r2] +_080CBAB2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CBA3C + + thumb_func_start sub_80CBAC4 +sub_80CBAC4: @ 80CBAC4 + push {r4,lr} + ldr r4, =0x02039d08 + ldr r0, [r4] + ldr r1, =0x00000a6c + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _080CBAE2 + bl sub_80CC314 + ldr r0, [r4] + ldr r1, =0x00000a6c + adds r0, r1 + movs r1, 0 + str r1, [r0] +_080CBAE2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CBAC4 + + thumb_func_start sub_80CBAF0 +sub_80CBAF0: @ 80CBAF0 + push {r4-r6,lr} + movs r3, 0 + ldr r6, =0x02039d08 + lsls r0, 16 + asrs r4, r0, 16 + movs r5, 0x5 + negs r5, r5 +_080CBAFE: + ldr r0, [r6] + lsls r1, r3, 2 + movs r2, 0xA7 + lsls r2, 4 + adds r0, r2 + adds r2, r0, r1 + ldr r1, [r2] + cmp r1, 0 + beq _080CBB56 + ldrh r0, [r1, 0x22] + adds r0, r4, r0 + strh r0, [r1, 0x22] + ldr r2, [r2] + ldrh r1, [r2, 0x26] + ldrh r0, [r2, 0x22] + adds r1, r0 + adds r0, r2, 0 + adds r0, 0x29 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + adds r0, r1 + lsls r0, 16 + movs r1, 0x80 + lsls r1, 13 + adds r0, r1 + lsrs r0, 16 + cmp r0, 0xC0 + bls _080CBB4C + adds r0, r2, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _080CBB56 + .pool +_080CBB4C: + adds r2, 0x3E + ldrb r1, [r2] + adds r0, r5, 0 + ands r0, r1 + strb r0, [r2] +_080CBB56: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x5 + bls _080CBAFE + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80CBAF0 + + thumb_func_start sub_80CBB68 +sub_80CBB68: @ 80CBB68 + push {r4,r5,lr} + lsls r0, 24 + ldr r5, =0x02039d08 + ldr r1, [r5] + lsrs r4, r0, 22 + movs r0, 0xA7 + lsls r0, 4 + adds r1, r0 + adds r1, r4 + ldr r0, [r1] + cmp r0, 0 + beq _080CBB92 + bl sub_80CC314 + ldr r0, [r5] + movs r1, 0xA7 + lsls r1, 4 + adds r0, r1 + adds r0, r4 + movs r1, 0 + str r1, [r0] +_080CBB92: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CBB68 + + thumb_func_start sub_80CBB9C +sub_80CBB9C: @ 80CBB9C + push {r4-r6,lr} + movs r5, 0 + ldr r6, =0x02039d08 +_080CBBA2: + ldr r0, [r6] + lsls r4, r5, 2 + movs r1, 0xA7 + lsls r1, 4 + adds r0, r1 + adds r0, r4 + ldr r0, [r0] + cmp r0, 0 + beq _080CBBC6 + bl sub_80CC314 + ldr r0, [r6] + movs r1, 0xA7 + lsls r1, 4 + adds r0, r1 + adds r0, r4 + movs r1, 0 + str r1, [r0] +_080CBBC6: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x5 + bls _080CBBA2 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CBB9C + + thumb_func_start sub_80CBBDC +sub_80CBBDC: @ 80CBBDC + push {lr} + lsls r0, 24 + lsls r1, 24 + lsrs r2, r1, 24 + ldr r1, =0x02039d08 + ldr r1, [r1] + lsrs r0, 22 + movs r3, 0xA7 + lsls r3, 4 + adds r1, r3 + adds r1, r0 + ldr r3, [r1] + cmp r3, 0 + beq _080CBC0C + movs r0, 0x3 + adds r1, r2, 0 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x1] +_080CBC0C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CBBDC + + thumb_func_start sub_80CBC14 +sub_80CBC14: @ 80CBC14 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + adds r5, r1, 0 + cmp r4, 0 + bne _080CBC44 + ldr r3, =0x02039d08 + ldr r0, [r3] + ldr r5, =0x00000a6c + adds r2, r0, r5 + lsls r1, 2 + adds r5, 0x4 + adds r0, r5 + adds r0, r1 + ldr r1, [r0] + str r1, [r2] + str r4, [r0] + b _080CBC60 + .pool +_080CBC44: + cmp r4, 0x1 + bne _080CBC96 + ldr r3, =0x02039d08 + ldr r0, [r3] + ldr r1, =0x00000a6c + adds r2, r0, r1 + lsls r1, r5, 2 + ldr r4, =0x00000a88 + adds r0, r4 + adds r0, r1 + ldr r1, [r0] + str r1, [r2] + movs r1, 0 + str r1, [r0] +_080CBC60: + adds r5, r3, 0 + ldr r0, [r5] + ldr r4, =0x00000a6c + adds r0, r4 + ldr r1, [r0] + ldr r0, =sub_80CC100 + str r0, [r1, 0x1C] + bl sub_80CAFAC + ldr r1, [r5] + adds r1, r4 + ldr r3, [r1] + movs r1, 0x3 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x5] + ldr r0, [r5] + adds r0, r4 + ldr r0, [r0] + adds r0, 0x43 + movs r1, 0x7 + strb r1, [r0] +_080CBC96: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CBC14 + + thumb_func_start sub_80CBCAC +sub_80CBCAC: @ 80CBCAC + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + cmp r0, 0xE + bne _080CBCF8 + ldr r3, =0x02039d08 + ldr r1, [r3] + lsls r5, r6, 2 + movs r4, 0xA7 + lsls r4, 4 + adds r0, r1, r4 + adds r0, r5 + ldr r2, =0x00000a6c + adds r1, r2 + ldr r2, [r1] + str r2, [r0] + ldrb r1, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, [r3] + adds r0, r4 + adds r0, r5 + ldr r0, [r0] + adds r0, 0x43 + movs r1, 0xC + strb r1, [r0] + b _080CBD34 + .pool +_080CBCF8: + ldr r5, =0x02039d08 + ldr r1, [r5] + lsls r4, r6, 2 + ldr r3, =0x00000a88 + adds r0, r1, r3 + adds r0, r4 + ldr r2, =0x00000a6c + adds r1, r2 + ldr r2, [r1] + str r2, [r0] + ldrb r1, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, [r5] + adds r0, r3 + adds r0, r4 + ldr r4, [r0] + adds r0, r6, 0 + movs r1, 0x6 + bl __umodsi3 + movs r1, 0x13 + subs r1, r0 + adds r4, 0x43 + strb r1, [r4] + adds r3, r5, 0 +_080CBD34: + ldr r1, [r3] + ldr r0, =0x00000a6c + adds r1, r0 + ldr r2, [r1] + ldr r0, =DummyObjectCallback + str r0, [r2, 0x1C] + movs r0, 0 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CBCAC + + thumb_func_start sub_80CBD5C +sub_80CBD5C: @ 80CBD5C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r0, 0xE + bne _080CBD80 + ldr r3, =0x02039d08 + ldr r1, [r3] + movs r0, 0xB0 + lsls r0, 4 + adds r2, r1, r0 + lsls r0, r4, 2 + movs r4, 0xA7 + lsls r4, 4 + b _080CBD8E + .pool +_080CBD80: + ldr r3, =0x02039d08 + ldr r1, [r3] + movs r0, 0xB0 + lsls r0, 4 + adds r2, r1, r0 + lsls r0, r4, 2 + ldr r4, =0x00000a88 +_080CBD8E: + adds r0, r4 + adds r1, r0 + str r1, [r2] + ldr r1, [r3] + ldr r2, =0x00000a6c + adds r0, r1, r2 + ldr r2, [r0] + ldr r0, =DummyObjectCallback + str r0, [r2, 0x1C] + ldr r4, =0x00000c5d + adds r1, r4 + movs r0, 0 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CBD5C + + thumb_func_start sub_80CBDC4 +sub_80CBDC4: @ 80CBDC4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r6, =0x02039d08 + ldr r0, [r6] + ldr r1, =0x00000c5d + mov r9, r1 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0x10 + bne _080CBDE8 + movs r0, 0 + b _080CBEF4 + .pool +_080CBDE8: + adds r0, 0x1 + strb r0, [r1] + ldr r2, [r6] + ldr r5, =0x00000c5d + adds r0, r2, r5 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080CBE18 + movs r1, 0xB0 + lsls r1, 4 + adds r0, r2, r1 + ldr r0, [r0] + ldr r1, [r0] + ldrh r0, [r1, 0x22] + subs r0, 0x1 + strh r0, [r1, 0x22] + ldr r5, =0x00000a6c + adds r0, r2, r5 + ldr r1, [r0] + ldrh r0, [r1, 0x22] + adds r0, 0x1 + strh r0, [r1, 0x22] +_080CBE18: + ldr r3, [r6] + movs r7, 0xB0 + lsls r7, 4 + adds r4, r3, r7 + ldr r0, [r4] + ldr r0, [r0] + mov r8, r0 + ldr r5, =gUnknown_08329F40 + mov r0, r9 + adds r1, r3, r0 + ldrb r0, [r1] + lsls r0, 4 + adds r0, r5 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bge _080CBE3C + adds r0, 0xF +_080CBE3C: + asrs r0, 4 + mov r2, r8 + strh r0, [r2, 0x24] + ldr r0, =0x00000a6c + mov r8, r0 + add r3, r8 + ldr r2, [r3] + ldrb r0, [r1] + lsls r0, 4 + adds r0, r5 + movs r5, 0 + ldrsh r0, [r0, r5] + cmp r0, 0 + bge _080CBE5A + adds r0, 0xF +_080CBE5A: + asrs r0, 4 + negs r0, r0 + strh r0, [r2, 0x24] + ldrb r0, [r1] + cmp r0, 0x8 + bne _080CBEBE + ldr r3, [r3] + ldr r0, [r4] + ldr r0, [r0] + ldrb r0, [r0, 0x5] + movs r5, 0x3 + movs r1, 0xC + ands r1, r0 + ldrb r2, [r3, 0x5] + movs r4, 0xD + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x5] + ldr r0, [r6] + mov r2, r8 + adds r1, r0, r2 + ldr r1, [r1] + adds r0, r7 + ldr r0, [r0] + ldr r0, [r0] + adds r0, 0x43 + ldrb r0, [r0] + adds r1, 0x43 + strb r0, [r1] + bl sub_80CAFAC + ldr r1, [r6] + adds r1, r7 + ldr r1, [r1] + ldr r1, [r1] + ands r5, r0 + lsls r5, 2 + ldrb r0, [r1, 0x5] + ands r4, r0 + orrs r4, r5 + strb r4, [r1, 0x5] + ldr r0, [r6] + adds r0, r7 + ldr r0, [r0] + ldr r0, [r0] + adds r0, 0x43 + movs r1, 0x7 + strb r1, [r0] +_080CBEBE: + ldr r1, [r6] + mov r5, r9 + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0x10 + bne _080CBEF2 + mov r0, r8 + adds r2, r1, r0 + ldr r3, [r2] + adds r1, r7 + ldr r0, [r1] + ldr r0, [r0] + str r0, [r2] + ldr r0, [r1] + str r3, [r0] + ldr r1, [r6] + mov r2, r8 + adds r0, r1, r2 + ldr r2, [r0] + ldr r0, =sub_80CC100 + str r0, [r2, 0x1C] + adds r1, r7 + ldr r0, [r1] + ldr r1, [r0] + ldr r0, =DummyObjectCallback + str r0, [r1, 0x1C] +_080CBEF2: + movs r0, 0x1 +_080CBEF4: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80CBDC4 + + thumb_func_start sub_80CBF14 +sub_80CBF14: @ 80CBF14 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r0, 0x1 + beq _080CBF4C + cmp r0, 0x1 + bgt _080CBF2E + cmp r0, 0 + beq _080CBF34 + b _080CBFC0 +_080CBF2E: + cmp r2, 0x2 + beq _080CBF70 + b _080CBFC0 +_080CBF34: + ldr r3, =0x02039d08 + ldr r1, [r3] + ldr r0, =0x00000b04 + adds r2, r1, r0 + lsls r0, r4, 2 + movs r4, 0xA7 + lsls r4, 4 + b _080CBF58 + .pool +_080CBF4C: + ldr r3, =0x02039d08 + ldr r1, [r3] + ldr r0, =0x00000b04 + adds r2, r1, r0 + lsls r0, r4, 2 + ldr r4, =0x00000a88 +_080CBF58: + adds r0, r4 + adds r1, r0 + str r1, [r2] + adds r4, r3, 0 + b _080CBF80 + .pool +_080CBF70: + ldr r0, =0x02039d08 + ldr r1, [r0] + ldr r3, =0x00000b04 + adds r2, r1, r3 + ldr r4, =0x00000a6c + adds r1, r4 + str r1, [r2] + adds r4, r0, 0 +_080CBF80: + ldr r0, [r4] + ldr r1, =0x00000b04 + adds r0, r1 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0 + beq _080CBFC0 + bl obj_alloc_rotscale_entry + ldr r0, [r4] + ldr r3, =0x00000b04 + adds r0, r3 + ldr r0, [r0] + ldr r2, [r0] + ldrb r1, [r2, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x1] + ldr r1, [r4] + adds r1, r3 + ldr r0, [r1] + ldr r2, [r0] + ldr r0, =gUnknown_0857291C + str r0, [r2, 0x10] + ldr r0, [r1] + ldr r0, [r0] + movs r1, 0 + bl StartObjectRotScalAnim +_080CBFC0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CBF14 + + thumb_func_start sub_80CBFD8 +sub_80CBFD8: @ 80CBFD8 + push {lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x00000b04 + adds r0, r1 + ldr r0, [r0] + ldr r1, [r0] + cmp r1, 0 + beq _080CBFF8 + adds r3, r1, 0 + adds r3, 0x3E + ldrb r2, [r3] + movs r0, 0x4 + ands r0, r2 + cmp r0, 0 + beq _080CC004 +_080CBFF8: + movs r0, 0 + b _080CC01A + .pool +_080CC004: + adds r0, r1, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080CC018 + movs r0, 0x4 + orrs r0, r2 + strb r0, [r3] +_080CC018: + movs r0, 0x1 +_080CC01A: + pop {r1} + bx r1 + thumb_func_end sub_80CBFD8 + + thumb_func_start sub_80CC020 +sub_80CC020: @ 80CC020 + push {r4,lr} + ldr r4, =0x02039d08 + ldr r0, [r4] + ldr r1, =0x00000b04 + adds r0, r1 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0 + beq _080CC056 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldr r0, [r4] + ldr r1, =0x00000b04 + adds r0, r1 + ldr r0, [r0] + ldr r0, [r0] + bl sub_80CC314 + ldr r0, [r4] + ldr r1, =0x00000b04 + adds r0, r1 + ldr r1, [r0] + movs r0, 0 + str r0, [r1] +_080CC056: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CC020 + + thumb_func_start sub_80CC064 +sub_80CC064: @ 80CC064 + push {lr} + ldr r3, =0x02039d08 + ldr r0, [r3] + ldr r1, =0x00000b04 + adds r0, r1 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0 + beq _080CC094 + adds r2, r0, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, [r3] + ldr r1, =0x00000b04 + adds r0, r1 + ldr r0, [r0] + ldr r0, [r0] + movs r1, 0x1 + bl StartObjectRotScalAnim +_080CC094: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CC064 + + thumb_func_start sub_80CC0A0 +sub_80CC0A0: @ 80CC0A0 + push {lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x00000b04 + adds r2, r0, r1 + ldr r0, [r2] + cmp r0, 0 + bne _080CC0BC + movs r0, 0 + b _080CC0D0 + .pool +_080CC0BC: + ldr r0, [r0] + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080CC0CE + movs r0, 0 + str r0, [r2] +_080CC0CE: + movs r0, 0x1 +_080CC0D0: + pop {r1} + bx r1 + thumb_func_end sub_80CC0A0 + + thumb_func_start sub_80CC0D4 +sub_80CC0D4: @ 80CC0D4 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02039d08 + ldr r1, [r1] + ldr r2, =0x00000a6c + adds r1, r2 + ldr r3, [r1] + movs r1, 0x3 + ands r0, r1 + lsls r0, 2 + ldrb r2, [r3, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x5] + bx lr + .pool + thumb_func_end sub_80CC0D4 + + thumb_func_start sub_80CC100 +sub_80CC100: @ 80CC100 + ldr r1, =0x02039d08 + ldr r1, [r1] + ldr r2, =0x00000cb4 + adds r1, r2 + ldr r2, [r1] + ldrh r2, [r2, 0x20] + strh r2, [r0, 0x20] + ldr r2, [r1] + ldrh r1, [r2, 0x26] + ldrh r2, [r2, 0x22] + adds r1, r2 + adds r1, 0x4 + strh r1, [r0, 0x22] + bx lr + .pool + thumb_func_end sub_80CC100 + + thumb_func_start sub_80CC124 +sub_80CC124: @ 80CC124 + push {r4-r6,lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r4, 0 + ldr r1, =0x02039d08 + ldr r0, [r1] + ldr r2, =0x00000b58 + adds r0, r2 + ldrh r0, [r0] + adds r2, r1, 0 + cmp r0, r3 + beq _080CC158 + adds r6, r2, 0 + ldr r5, =0x00000b58 +_080CC140: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x27 + bhi _080CC158 + ldr r0, [r6] + lsls r1, r4, 1 + adds r0, r5 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r3 + bne _080CC140 +_080CC158: + cmp r4, 0x28 + bne _080CC198 + movs r4, 0 + ldr r0, [r2] + ldr r5, =0x00000b58 + adds r0, r5 + ldrh r0, [r0] + cmp r0, 0 + beq _080CC184 + adds r6, r2, 0 +_080CC16C: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x27 + bhi _080CC184 + ldr r0, [r6] + lsls r1, r4, 1 + adds r0, r5 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _080CC16C +_080CC184: + cmp r4, 0x28 + bne _080CC198 + ldr r0, =0x0000ffff + b _080CC1CA + .pool +_080CC198: + ldr r1, [r2] + lsls r2, r4, 1 + ldr r5, =0x00000b58 + adds r0, r1, r5 + adds r0, r2 + strh r3, [r0] + ldr r0, =0x00000b08 + adds r1, r0 + adds r1, r2 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r4, 20 + lsrs r4, 16 + adds r0, r3, 0 + movs r1, 0x1 + bl GetMonIconTiles + lsls r1, r4, 5 + ldr r2, =0x06010000 + adds r1, r2 + ldr r2, =0x04000080 + bl CpuSet + adds r0, r4, 0 +_080CC1CA: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80CC124 + + thumb_func_start sub_80CC1E0 +sub_80CC1E0: @ 80CC1E0 + push {r4-r6,lr} + lsls r0, 16 + lsrs r5, r0, 16 + movs r3, 0 + ldr r6, =0x02039d08 +_080CC1EA: + ldr r1, [r6] + lsls r2, r3, 1 + ldr r4, =0x00000b58 + adds r0, r1, r4 + adds r4, r0, r2 + ldrh r0, [r4] + cmp r0, r5 + bne _080CC220 + ldr r0, =0x00000b08 + adds r1, r0 + adds r1, r2 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _080CC22A + strh r0, [r4] + b _080CC22A + .pool +_080CC220: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x27 + bls _080CC1EA +_080CC22A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80CC1E0 + + thumb_func_start sub_80CC230 +sub_80CC230: @ 80CC230 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + ldr r4, [sp, 0x3C] + ldr r5, [sp, 0x40] + lsls r0, 16 + lsrs r6, r0, 16 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0x18] + lsls r3, 16 + lsrs r3, 16 + mov r8, r3 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + mov r9, r5 + mov r2, sp + ldr r0, =gUnknown_085728D4 + ldm r0!, {r3,r5,r7} + stm r2!, {r3,r5,r7} + ldm r0!, {r3,r5,r7} + stm r2!, {r3,r5,r7} + adds r0, r6, 0 + bl mon_icon_convert_unown_species_id + mov r10, r0 + mov r6, r10 + mov r2, sp + ldr r1, =gMonIconPaletteIndices + adds r1, r6, r1 + ldr r3, =0x0000dac0 + adds r0, r3, 0 + ldrb r1, [r1] + adds r0, r1 + strh r0, [r2, 0x2] + adds r0, r6, 0 + bl sub_80CC124 + lsls r0, 16 + lsrs r0, 16 + adds r5, r0, 0 + ldr r0, =0x0000ffff + cmp r5, r0 + beq _080CC302 + ldr r7, [sp, 0x18] + lsls r1, r7, 16 + asrs r1, 16 + mov r0, r8 + lsls r2, r0, 16 + asrs r2, 16 + mov r0, sp + mov r3, r9 + bl AddObjectToFront + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _080CC2FC + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldr r2, =0x000003ff + ands r2, r5 + ldrh r3, [r0, 0x4] + ldr r1, =0xfffffc00 + ands r1, r3 + orrs r1, r2 + strh r1, [r0, 0x4] + movs r1, 0x3 + ands r4, r1 + lsls r3, r4, 2 + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + orrs r1, r3 + strb r1, [r0, 0x5] + mov r1, r10 + strh r1, [r0, 0x2E] + b _080CC304 + .pool +_080CC2FC: + adds r0, r6, 0 + bl sub_80CC1E0 +_080CC302: + movs r0, 0 +_080CC304: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80CC230 + + thumb_func_start sub_80CC314 +sub_80CC314: @ 80CC314 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + bl sub_80CC1E0 + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80CC314 + + thumb_func_start sub_80CC32C +sub_80CC32C: @ 80CC32C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =sub_80CC370 + movs r1, 0x2 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0xC] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CC32C + + thumb_func_start sub_80CC35C +sub_80CC35C: @ 80CC35C + push {lr} + ldr r0, =sub_80CC370 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80CC35C + + thumb_func_start sub_80CC370 +sub_80CC370: @ 80CC370 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bhi _080CC454 + lsls r0, 2 + ldr r1, =_080CC39C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080CC39C: + .4byte _080CC3B0 + .4byte _080CC3E8 + .4byte _080CC41C + .4byte _080CC426 + .4byte _080CC44C +_080CC3B0: + ldr r1, =0x02039d08 + ldr r0, [r1] + ldr r2, =0x000002d2 + adds r0, r2 + movs r2, 0 + strb r2, [r0] + ldr r1, [r1] + movs r3, 0xB3 + lsls r3, 2 + adds r0, r1, r3 + strh r2, [r0] + ldr r0, =0x00004ac4 + adds r1, r0 + movs r2, 0x80 + lsls r2, 5 + movs r0, 0 + movs r3, 0x1 + bl RequestDma3Fill + strh r0, [r4, 0xA] + b _080CC458 + .pool +_080CC3E8: + movs r1, 0xA + ldrsh r0, [r4, r1] + bl CheckForSpaceForDma3Request + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080CC45E + ldr r0, =0x02039d08 + ldr r1, [r0] + ldr r2, =0x00004ac4 + adds r1, r2 + movs r0, 0x2 + bl SetBgTilemapBuffer + movs r0, 0x2 + bl ShowBg + b _080CC458 + .pool +_080CC41C: + ldrb r0, [r4, 0xC] + movs r1, 0 + bl sub_80CC7A0 + b _080CC458 +_080CC426: + bl sub_80CCA00 + cmp r0, 0 + beq _080CC45E + ldrb r0, [r4, 0xC] + bl sub_80CCB50 + bl sub_80CD02C + ldrb r0, [r4, 0xC] + bl sub_80CB028 + ldr r1, =0x00005b0a + movs r0, 0xC + bl SetGpuReg + b _080CC458 + .pool +_080CC44C: + adds r0, r2, 0 + bl DestroyTask + b _080CC458 +_080CC454: + movs r0, 0 + b _080CC45C +_080CC458: + ldrh r0, [r4, 0x8] + adds r0, 0x1 +_080CC45C: + strh r0, [r4, 0x8] +_080CC45E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80CC370 + + thumb_func_start sub_80CC464 +sub_80CC464: @ 80CC464 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r4, r0, 24 + mov r8, r4 + adds r0, r4, 0 + bl sub_80CC644 + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r5, =0x02039d08 + ldr r2, [r5] + lsls r0, r6, 24 + asrs r3, r0, 24 + movs r0, 0x6 + negs r0, r0 + adds r1, r0, 0 + cmp r3, 0 + ble _080CC490 + movs r1, 0x6 +_080CC490: + ldr r7, =0x000002ce + adds r0, r2, r7 + strh r1, [r0] + movs r1, 0x2 + cmp r3, 0 + ble _080CC49E + movs r1, 0x1 +_080CC49E: + ldr r7, =0x000002d3 + adds r0, r2, r7 + strb r1, [r0] + ldr r2, [r5] + movs r0, 0xB4 + lsls r0, 2 + adds r1, r2, r0 + movs r0, 0x20 + strh r0, [r1] + movs r1, 0xB5 + lsls r1, 2 + adds r0, r2, r1 + strb r4, [r0] + ldr r2, [r5] + movs r1, 0 + cmp r3, 0 + bgt _080CC4C2 + movs r1, 0x5 +_080CC4C2: + ldr r4, =0x000002d6 + adds r0, r2, r4 + strh r1, [r0] + movs r7, 0xB6 + lsls r7, 2 + adds r0, r2, r7 + strh r3, [r0] + movs r1, 0x38 + cmp r3, 0 + ble _080CC4DC + movs r0, 0x84 + lsls r0, 1 + adds r1, r0, 0 +_080CC4DC: + ldr r4, =0x000002da + adds r0, r2, r4 + strh r1, [r0] + movs r1, 0 + cmp r3, 0 + bgt _080CC4EA + movs r1, 0x5 +_080CC4EA: + movs r7, 0xB7 + lsls r7, 2 + adds r0, r2, r7 + strh r1, [r0] + ldr r0, =0x000002de + adds r1, r2, r0 + movs r0, 0 + strh r0, [r1] + movs r3, 0xB8 + lsls r3, 2 + adds r1, r2, r3 + movs r0, 0x2 + strh r0, [r1] + ldr r4, =0x00000a64 + adds r0, r2, r4 + mov r7, r8 + strb r7, [r0] + ldr r0, [r5] + ldr r1, =0x00000a65 + adds r0, r1 + strb r6, [r0] + ldr r0, [r5] + ldr r3, =0x00000a63 + adds r0, r3 + movs r1, 0 + strb r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CC464 + + thumb_func_start sub_80CC54C +sub_80CC54C: @ 80CC54C + push {r4-r6,lr} + ldr r4, =0x02039d08 + ldr r1, [r4] + ldr r5, =0x00000a63 + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080CC594 + cmp r0, 0x1 + bgt _080CC570 + cmp r0, 0 + beq _080CC576 + b _080CC624 + .pool +_080CC570: + cmp r0, 0x2 + beq _080CC5E4 + b _080CC624 +_080CC576: + ldr r2, =0x00000a64 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + bl sub_80CC7A0 + ldr r1, [r4] + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080CC594: + bl sub_80CCA00 + cmp r0, 0 + beq _080CC632 + ldr r6, =0x02039d08 + ldr r1, [r6] + ldr r4, =0x00000a64 + adds r0, r1, r4 + ldrb r0, [r0] + ldr r5, =0x00000a65 + adds r1, r5 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + bl sub_80CB4CC + ldr r1, [r6] + adds r4, r1, r4 + ldrb r0, [r4] + adds r1, r5 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + bl sub_80CCCFC + ldr r0, [r6] + adds r0, r5 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + bl sub_80CD0B8 + b _080CC624 + .pool +_080CC5E4: + bl sub_80CB584 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, [r4] + movs r4, 0xB4 + lsls r4, 2 + adds r3, r2, r4 + ldrh r0, [r3] + cmp r0, 0 + beq _080CC620 + movs r0, 0xB3 + lsls r0, 2 + adds r1, r2, r0 + subs r4, 0x2 + adds r0, r2, r4 + ldrh r0, [r0] + ldrh r2, [r1] + adds r0, r2 + strh r0, [r1] + ldrh r0, [r3] + subs r0, 0x1 + strh r0, [r3] + lsls r0, 16 + cmp r0, 0 + bne _080CC632 + bl sub_80CCEE0 + bl sub_80CD158 +_080CC620: + adds r0, r5, 0 + b _080CC634 +_080CC624: + ldr r0, =0x02039d08 + ldr r1, [r0] + ldr r4, =0x00000a63 + adds r1, r4 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080CC632: + movs r0, 0x1 +_080CC634: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80CC54C + + thumb_func_start sub_80CC644 +sub_80CC644: @ 80CC644 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl get_preferred_box + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0 + cmp r1, r4 + beq _080CC66E +_080CC658: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xD + bls _080CC664 + movs r1, 0 +_080CC664: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r1, r4 + bne _080CC658 +_080CC66E: + movs r0, 0x1 + negs r0, r0 + cmp r2, 0x6 + bhi _080CC678 + movs r0, 0x1 +_080CC678: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80CC644 + + thumb_func_start sub_80CC680 +sub_80CC680: @ 80CC680 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl sub_80D2120 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x00000a62 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CC680 + + thumb_func_start sub_80CC6B0 +sub_80CC6B0: @ 80CC6B0 + push {r4,lr} + sub sp, 0x4 + ldr r1, =0x02039d08 + ldr r0, [r1] + ldr r2, =0x00000a62 + adds r0, r2 + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0x4 + bhi _080CC794 + lsls r0, 2 + ldr r1, =_080CC6DC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080CC6DC: + .4byte _080CC6F0 + .4byte _080CC718 + .4byte _080CC732 + .4byte _080CC76C + .4byte _080CC790 +_080CC6F0: + ldr r0, [r4] + movs r1, 0xE7 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x0000ffff + str r1, [sp] + movs r1, 0x1 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, [r4] + ldr r2, =0x00000a62 + adds r1, r2 + b _080CC77E + .pool +_080CC718: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080CC794 + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_80CC7A0 + b _080CC776 +_080CC732: + bl sub_80CCA00 + cmp r0, 0x1 + bne _080CC794 + bl sub_80CCF9C + ldr r4, =0x02039d08 + ldr r0, [r4] + movs r1, 0xE7 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + ldr r1, =0x0000ffff + str r1, [sp] + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r1, [r4] + ldr r2, =0x00000a62 + adds r1, r2 + b _080CC77E + .pool +_080CC76C: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080CC794 +_080CC776: + ldr r0, =0x02039d08 + ldr r1, [r0] + ldr r0, =0x00000a62 + adds r1, r0 +_080CC77E: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080CC794 + .pool +_080CC790: + movs r0, 0 + b _080CC796 +_080CC794: + movs r0, 0x1 +_080CC796: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80CC6B0 + + thumb_func_start sub_80CC7A0 +sub_80CC7A0: @ 80CC7A0 + push {r4-r7,lr} + sub sp, 0x8 + ldr r4, =0x02039d08 + ldr r2, [r4] + ldr r3, =0x000006f9 + adds r2, r3 + movs r3, 0 + strb r3, [r2] + ldr r2, [r4] + ldr r3, =0x000006fa + adds r2, r3 + strb r0, [r2] + ldr r0, [r4] + ldr r2, =0x000006fb + adds r0, r2 + strb r1, [r0] + ldr r1, [r4] + adds r2, r1, r2 + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r0, 0 + beq _080CC7E6 + movs r3, 0 + ldr r0, =0x000002d2 + adds r2, r1, r0 + ldrb r0, [r2] + cmp r0, 0 + bne _080CC7DA + movs r3, 0x1 +_080CC7DA: + strb r3, [r2] + ldr r0, [r4] + ldr r1, =0x00004ac4 + adds r0, r1 + bl sub_80CCAE0 +_080CC7E6: + ldr r7, =0x02039d08 + ldr r0, [r7] + ldr r2, =0x000006fa + adds r0, r2 + ldrb r0, [r0] + bl sub_80D20F8 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x10 + beq _080CC8C4 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_085775B8 + adds r6, r0, r1 + ldr r0, [r6, 0x4] + ldr r1, [r7] + ldr r5, =0x00000792 + adds r1, r5 + bl LZ77UnCompWram + ldr r0, [r7] + adds r5, r0, r5 + ldr r4, =0x000006fb + adds r1, r0, r4 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + ldr r3, =0x000002d2 + adds r0, r3 + ldrb r2, [r0] + adds r0, r5, 0 + bl sub_80CCA3C + ldr r1, [r7] + adds r4, r1, r4 + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + beq _080CC874 + ldr r0, [r6, 0x8] + ldr r2, =0x000002d2 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 21 + movs r3, 0x80 + lsls r3, 15 + adds r1, r3 + lsrs r1, 16 + movs r2, 0x40 + bl gpu_pal_apply + b _080CC888 + .pool +_080CC874: + ldr r0, [r6, 0x8] + ldr r2, =0x000002d2 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 6 + ldr r2, =0x02037794 + adds r1, r2 + movs r2, 0x20 + bl CpuSet +_080CC888: + ldr r0, [r6] + mov r1, sp + bl malloc_and_decompress + adds r1, r0, 0 + ldr r0, =0x02039d08 + ldr r3, [r0] + ldr r2, =0x00000a68 + adds r0, r3, r2 + str r1, [r0] + ldr r2, [sp] + lsls r2, 16 + lsrs r2, 16 + ldr r0, =0x000002d2 + adds r3, r0 + ldrb r3, [r3] + lsls r3, 8 + movs r0, 0x2 + bl LoadBgTiles + b _080CC9DA + .pool +_080CC8C4: + bl sub_80D24A8 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + ldr r0, =gUnknown_0857AF44 + adds r6, r1, r0 + ldr r0, [r6, 0x4] + ldr r1, [r7] + ldr r4, =0x00000792 + adds r1, r4 + bl LZ77UnCompWram + ldr r2, [r7] + adds r0, r2, r4 + ldr r5, =0x000006fb + adds r1, r2, r5 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + ldr r3, =0x000002d2 + adds r2, r3 + ldrb r2, [r2] + bl sub_80CCA3C + ldr r0, [r6, 0x8] + ldr r1, [r7] + adds r1, r4 + movs r2, 0x20 + bl CpuSet + bl sub_80D2510 + ldr r1, [r7] + ldr r2, =0x00000794 + adds r1, r2 + movs r2, 0x2 + bl CpuSet + bl sub_80D2510 + ldr r1, [r7] + ldr r3, =0x000007b4 + adds r1, r3 + movs r2, 0x2 + bl CpuSet + ldr r1, [r7] + adds r5, r1, r5 + movs r0, 0 + ldrsb r0, [r5, r0] + cmp r0, 0 + beq _080CC960 + adds r0, r1, r4 + ldr r2, =0x000002d2 + adds r1, r2 + ldrb r1, [r1] + lsls r1, 21 + movs r3, 0x80 + lsls r3, 15 + adds r1, r3 + lsrs r1, 16 + movs r2, 0x40 + bl gpu_pal_apply + b _080CC976 + .pool +_080CC960: + ldr r2, =0x00000792 + adds r0, r1, r2 + ldr r3, =0x000002d2 + adds r1, r3 + ldrb r1, [r1] + lsls r1, 6 + ldr r2, =0x02037794 + adds r1, r2 + movs r2, 0x20 + bl CpuSet +_080CC976: + ldr r0, [r6] + mov r1, sp + bl malloc_and_decompress + ldr r6, =0x02039d08 + ldr r1, [r6] + ldr r5, =0x00000a68 + adds r1, r5 + str r0, [r1] + ldr r4, =gUnknown_0857B004 + bl sub_80D24DC + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + add r1, sp, 0x4 + bl malloc_and_decompress + adds r4, r0, 0 + ldr r0, [r6] + adds r0, r5 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 4 + adds r1, r0 + ldr r2, [sp, 0x4] + lsls r2, 9 + lsrs r2, 11 + movs r0, 0x80 + lsls r0, 19 + orrs r2, r0 + adds r0, r4, 0 + bl CpuSet + adds r0, r4, 0 + bl Free + ldr r0, [r6] + adds r5, r0, r5 + ldr r1, [r5] + ldr r2, [sp] + lsls r2, 16 + lsrs r2, 16 + ldr r3, =0x000002d2 + adds r0, r3 + ldrb r3, [r0] + lsls r3, 8 + movs r0, 0x2 + bl LoadBgTiles +_080CC9DA: + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CC7A0 + + thumb_func_start sub_80CCA00 +sub_80CCA00: @ 80CCA00 + push {r4,r5,lr} + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _080CCA12 + movs r0, 0 + b _080CCA2E +_080CCA12: + ldr r5, =0x02039d08 + ldr r0, [r5] + ldr r1, =0x00000a68 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _080CCA2C + bl Free + ldr r0, [r5] + ldr r1, =0x00000a68 + adds r0, r1 + str r4, [r0] +_080CCA2C: + movs r0, 0x1 +_080CCA2E: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80CCA00 + + thumb_func_start sub_80CCA3C +sub_80CCA3C: @ 80CCA3C + push {r4-r7,lr} + sub sp, 0x24 + adds r5, r0, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r4, r2, 17 + ldr r0, =0x02039d08 + ldr r0, [r0] + movs r3, 0xB3 + lsls r3, 2 + adds r0, r3 + ldrh r3, [r0] + lsrs r3, 3 + adds r3, 0xA + lsls r1, 24 + asrs r7, r1, 24 + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 3 + adds r6, r3, r0 + movs r0, 0x3F + ands r6, r0 + movs r3, 0x14 + str r3, [sp] + movs r1, 0x12 + str r1, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0x2 + str r0, [sp, 0xC] + str r3, [sp, 0x10] + str r1, [sp, 0x14] + movs r0, 0x11 + str r0, [sp, 0x18] + lsls r2, 24 + asrs r2, 16 + str r2, [sp, 0x1C] + movs r0, 0xC0 + lsls r0, 10 + adds r4, r0 + asrs r4, 16 + str r4, [sp, 0x20] + movs r0, 0x2 + adds r1, r5, 0 + movs r2, 0 + movs r3, 0 + bl CopyRectToBgTilemapBufferRect + cmp r7, 0 + beq _080CCAD2 + cmp r7, 0 + ble _080CCAB0 + lsls r0, r6, 16 + movs r1, 0xA0 + lsls r1, 13 + adds r0, r1 + b _080CCAB6 + .pool +_080CCAB0: + lsls r0, r6, 16 + ldr r3, =0xfffc0000 + adds r0, r3 +_080CCAB6: + lsrs r6, r0, 16 + lsls r2, r6, 24 + lsrs r2, 24 + movs r0, 0x4 + str r0, [sp] + movs r0, 0x12 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0 + movs r3, 0x2 + bl FillBgTilemapBufferRect +_080CCAD2: + add sp, 0x24 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CCA3C + + thumb_func_start sub_80CCAE0 +sub_80CCAE0: @ 80CCAE0 + push {r4-r6,lr} + adds r2, r0, 0 + ldr r0, =0x02039d08 + ldr r0, [r0] + movs r1, 0xB3 + lsls r1, 2 + adds r0, r1 + ldrh r0, [r0] + lsrs r0, 3 + adds r3, r0, 0 + adds r3, 0x1E + movs r0, 0x3F + ands r3, r0 + adds r0, r3, 0 + cmp r0, 0x1F + bgt _080CCB10 + lsls r0, 1 + movs r6, 0x98 + lsls r6, 3 + adds r0, r6 + b _080CCB18 + .pool +_080CCB10: + lsls r0, 1 + movs r1, 0xC8 + lsls r1, 4 + adds r0, r1 +_080CCB18: + adds r2, r0 + movs r0, 0 + movs r5, 0 + movs r4, 0x3F +_080CCB20: + strh r5, [r2] + adds r2, 0x2 + adds r3, 0x1 + ands r3, r4 + adds r1, r3, 0 + cmp r1, 0 + bne _080CCB32 + ldr r6, =0xfffff7c0 + adds r2, r6 +_080CCB32: + cmp r1, 0x20 + bne _080CCB3C + movs r1, 0xF8 + lsls r1, 3 + adds r2, r1 +_080CCB3C: + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2B + bls _080CCB20 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CCAE0 + + thumb_func_start sub_80CCB50 +sub_80CCB50: @ 80CCB50 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + mov r8, r0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =0x02039d08 + mov r10, r1 + ldr r1, [r1] + movs r2, 0xBE + lsls r2, 2 + adds r0, r1, r2 + str r0, [sp, 0x24] + mov r3, sp + adds r3, 0x24 + str r3, [sp, 0x2C] + ldr r0, =0x00030200 + str r0, [r3, 0x4] + ldr r4, =0x000006fc + adds r1, r4 + str r1, [sp, 0x14] + add r0, sp, 0x18 + ldr r7, =0x0000dac9 + strh r7, [r0] + add r0, sp, 0x1C + movs r1, 0 + movs r2, 0x8 + bl memset + add r1, sp, 0x14 + add r0, sp, 0x4 + movs r2, 0x10 + bl memcpy + mov r0, r8 + bl sub_80D20F8 + lsls r0, 24 + mov r5, r10 + ldr r4, [r5] + ldr r2, =gUnknown_08577574 + lsrs r0, 22 + adds r1, r0, r2 + ldrh r3, [r1] + movs r5, 0xE3 + lsls r5, 3 + adds r1, r4, r5 + strh r3, [r1] + adds r2, 0x2 + adds r0, r2 + ldrh r0, [r0] + ldr r1, =0x0000071a + adds r4, r1 + strh r0, [r4] + add r0, sp, 0x4 + bl LoadTaggedObjectPalettes + mov r2, r10 + ldr r0, [r2] + movs r6, 0xE7 + lsls r6, 3 + adds r0, r6 + movs r1, 0xFC + lsls r1, 2 + str r1, [r0] + adds r0, r7, 0 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + mov r4, r10 + ldr r3, [r4] + lsls r1, r0, 4 + movs r5, 0x87 + lsls r5, 1 + mov r9, r5 + add r1, r9 + ldr r4, =0x0000071c + adds r2, r3, r4 + strh r1, [r2] + adds r3, r6 + movs r5, 0x80 + lsls r5, 9 + adds r1, r5, 0 + lsls r1, r0 + ldr r0, [r3] + orrs r0, r1 + str r0, [r3] + adds r0, r7, 0 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + mov r1, r10 + ldr r4, [r1] + lsls r1, r0, 4 + add r1, r9 + ldr r3, =0x0000071e + adds r2, r4, r3 + strh r1, [r2] + adds r6, r4, r6 + lsls r5, r0 + ldr r0, [r6] + orrs r0, r5 + str r0, [r6] + ldr r5, =0x000021b8 + adds r4, r5 + mov r0, r8 + bl sav3_get_box_name + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x8 + bl CopyStringPadded + mov r4, r10 + ldr r1, [r4] + adds r5, r1, r5 + movs r0, 0xBE + lsls r0, 2 + adds r1, r0 + movs r0, 0x2 + str r0, [sp] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0 + bl sub_80C6D80 + ldr r0, [sp, 0x2C] + bl LoadObjectPic + mov r0, r8 + bl sav3_get_box_name + bl sub_80CD00C + movs r4, 0 + lsls r0, 16 + asrs r6, r0, 16 +_080CCC70: + lsls r1, r4, 5 + adds r1, r6, r1 + lsls r1, 16 + asrs r1, 16 + ldr r0, =gUnknown_0857B0A8 + movs r2, 0x1C + movs r3, 0x18 + bl AddObjectToFront + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r5, =0x02039d08 + ldr r2, [r5] + lsls r0, r4, 2 + movs r3, 0xE4 + lsls r3, 3 + adds r2, r3 + adds r2, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + str r0, [r2] + lsls r1, r4, 24 + lsrs r1, 24 + bl StartObjectImageAnim + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1 + bls _080CCC70 + ldr r0, [r5] + movs r4, 0xDF + lsls r4, 3 + adds r0, r4 + movs r1, 0 + strb r1, [r0] + 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_80CCB50 + + thumb_func_start sub_80CCCFC +sub_80CCCFC: @ 80CCCFC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x28] + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + ldr r4, =0x02039d08 + ldr r2, [r4] + movs r1, 0xBE + lsls r1, 2 + adds r0, r2, r1 + str r0, [sp, 0x1C] + add r3, sp, 0x1C + ldr r5, =0x0000ffff + mov r12, r5 + movs r6, 0xC0 + lsls r6, 10 + mov r9, r6 + ldr r0, =0x00030200 + str r0, [r3, 0x4] + add r1, sp, 0x4 + ldr r0, =gUnknown_0857B0A8 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + movs r1, 0 + movs r5, 0xDF + lsls r5, 3 + adds r2, r5 + ldrb r0, [r2] + mov r8, r4 + adds r6, r3, 0 + cmp r0, 0 + bne _080CCD50 + movs r1, 0x1 +_080CCD50: + strb r1, [r2] + mov r7, r8 + ldr r0, [r7] + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _080CCD8C + ldr r0, [r6, 0x4] + mov r1, r12 + ands r0, r1 + mov r3, r9 + orrs r0, r3 + str r0, [r6, 0x4] + ldr r0, [r7] + ldr r5, =0x0000071c + adds r0, r5 + ldrh r0, [r0] + mov r9, r0 + b _080CCDB0 + .pool +_080CCD8C: + ldr r0, [r6, 0x4] + mov r7, r12 + ands r0, r7 + movs r1, 0x80 + lsls r1, 11 + orrs r0, r1 + str r0, [r6, 0x4] + mov r1, r8 + ldr r0, [r1] + ldr r3, =0x0000071c + adds r0, r3 + ldrh r0, [r0] + mov r9, r0 + add r1, sp, 0x4 + movs r0, 0x4 + strh r0, [r1] + ldr r0, =0x0000dac9 + strh r0, [r1, 0x2] +_080CCDB0: + mov r5, r8 + ldr r4, [r5] + ldr r5, =0x000021b8 + adds r4, r5 + ldr r0, [sp, 0x28] + bl sav3_get_box_name + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x8 + bl CopyStringPadded + mov r7, r8 + ldr r1, [r7] + adds r5, r1, r5 + movs r0, 0xBE + lsls r0, 2 + adds r1, r0 + movs r0, 0x2 + str r0, [sp] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0 + bl sub_80C6D80 + adds r0, r6, 0 + bl LoadObjectPic + ldr r0, [sp, 0x28] + bl sub_80D20F8 + lsls r0, 24 + lsrs r0, 22 + ldr r1, =gUnknown_08577574 + adds r0, r1 + mov r1, r9 + movs r2, 0x4 + bl gpu_pal_apply + ldr r0, [sp, 0x28] + bl sav3_get_box_name + bl sub_80CD00C + lsls r0, 16 + mov r1, r10 + lsls r2, r1, 24 + asrs r2, 24 + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 6 + lsrs r3, r0, 16 + str r3, [sp, 0x24] + asrs r0, 16 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + movs r7, 0 + mov r9, r8 + negs r2, r2 + mov r8, r2 +_080CCE2E: + lsls r6, r7, 5 + mov r5, r10 + lsls r1, r5, 16 + asrs r1, 16 + adds r1, r6 + lsls r1, 16 + asrs r1, 16 + add r0, sp, 0x4 + movs r2, 0x1C + movs r3, 0x18 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + mov r1, r9 + ldr r2, [r1] + lsls r5, r7, 2 + movs r3, 0xE5 + lsls r3, 3 + adds r2, r3 + adds r2, r5 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + str r1, [r2] + mov r0, r8 + lsls r4, r0, 1 + add r4, r8 + lsls r4, 1 + strh r4, [r1, 0x2E] + ldr r1, [r2] + ldr r3, [sp, 0x24] + lsls r0, r3, 16 + asrs r0, 16 + adds r0, r6 + strh r0, [r1, 0x30] + ldr r0, [r2] + movs r6, 0 + strh r6, [r0, 0x32] + ldr r0, [r2] + ldr r1, =sub_80CCF30 + str r1, [r0, 0x1C] + lsls r1, r7, 24 + lsrs r1, 24 + bl StartObjectImageAnim + mov r1, r9 + ldr r0, [r1] + movs r3, 0xE4 + lsls r3, 3 + adds r0, r3 + adds r0, r5 + ldr r1, [r0] + strh r4, [r1, 0x2E] + ldr r2, [r0] + movs r1, 0x1 + strh r1, [r2, 0x30] + ldr r1, [r0] + ldr r0, =sub_80CCF64 + str r0, [r1, 0x1C] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0x1 + bls _080CCE2E + 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_80CCCFC + + thumb_func_start sub_80CCEE0 +sub_80CCEE0: @ 80CCEE0 + push {lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + movs r1, 0xDF + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080CCF00 + movs r0, 0x4 + bl FreeObjectTilesByTag + b _080CCF06 + .pool +_080CCF00: + movs r0, 0x3 + bl FreeObjectTilesByTag +_080CCF06: + ldr r0, =0x02039d08 + ldr r0, [r0] + movs r3, 0xE4 + lsls r3, 3 + adds r2, r0, r3 + adds r3, 0x8 + adds r1, r0, r3 + ldr r1, [r1] + str r1, [r2] + ldr r2, =0x00000724 + adds r1, r0, r2 + adds r3, 0x4 + adds r0, r3 + ldr r0, [r0] + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CCEE0 + + thumb_func_start sub_80CCF30 +sub_80CCF30: @ 80CCF30 + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x32] + movs r3, 0x32 + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _080CCF44 + subs r0, r1, 0x1 + strh r0, [r2, 0x32] + b _080CCF5C +_080CCF44: + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x20] + adds r0, r1 + strh r0, [r2, 0x20] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x30 + ldrsh r1, [r2, r3] + cmp r0, r1 + bne _080CCF5C + ldr r0, =DummyObjectCallback + str r0, [r2, 0x1C] +_080CCF5C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CCF30 + + thumb_func_start sub_80CCF64 +sub_80CCF64: @ 80CCF64 + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x30] + movs r3, 0x30 + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _080CCF78 + subs r0, r1, 0x1 + strh r0, [r2, 0x30] + b _080CCF96 +_080CCF78: + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x20] + adds r0, r1 + strh r0, [r2, 0x20] + ldrh r1, [r2, 0x24] + adds r0, r1 + strh r0, [r2, 0x32] + subs r0, 0x40 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xC0 + bls _080CCF96 + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles +_080CCF96: + pop {r0} + bx r0 + thumb_func_end sub_80CCF64 + + thumb_func_start sub_80CCF9C +sub_80CCF9C: @ 80CCF9C + push {lr} + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + bl sub_80D20F8 + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, =0x02039d08 + ldr r2, [r0] + movs r3, 0xDF + lsls r3, 3 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _080CCFE4 + lsls r0, r1, 2 + ldr r1, =gUnknown_08577574 + adds r0, r1 + adds r3, 0x24 + adds r1, r2, r3 + ldrh r1, [r1] + lsls r1, 1 + ldr r2, =0x02037714 + adds r1, r2 + movs r2, 0x2 + bl CpuSet + b _080CCFFC + .pool +_080CCFE4: + lsls r0, r1, 2 + ldr r1, =gUnknown_08577574 + adds r0, r1 + ldr r3, =0x0000071e + adds r1, r2, r3 + ldrh r1, [r1] + lsls r1, 1 + ldr r2, =0x02037714 + adds r1, r2 + movs r2, 0x2 + bl CpuSet +_080CCFFC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CCF9C + + thumb_func_start sub_80CD00C +sub_80CD00C: @ 80CD00C + push {lr} + adds r1, r0, 0 + movs r0, 0x1 + movs r2, 0 + bl GetStringWidth + adds r1, r0, 0 + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + movs r0, 0xB0 + subs r0, r1 + lsls r0, 16 + asrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_80CD00C + + thumb_func_start sub_80CD02C +sub_80CD02C: @ 80CD02C + push {r4,r5,lr} + ldr r0, =gUnknown_0857B080 + bl LoadObjectPic + movs r5, 0 +_080CD036: + lsls r1, r5, 4 + adds r1, r5 + lsls r1, 19 + movs r0, 0xB8 + lsls r0, 15 + adds r1, r0 + asrs r1, 16 + ldr r0, =gUnknown_0857B0E0 + movs r2, 0x1C + movs r3, 0x16 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _080CD088 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r4, r0, r1 + lsls r1, r5, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + movs r0, 0x1 + cmp r5, 0 + bne _080CD076 + movs r1, 0x1 + negs r1, r1 + adds r0, r1, 0 +_080CD076: + strh r0, [r4, 0x34] + ldr r0, =0x02039d08 + ldr r0, [r0] + lsls r1, r5, 2 + movs r2, 0xE6 + lsls r2, 3 + adds r0, r2 + adds r0, r1 + str r4, [r0] +_080CD088: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x1 + bls _080CD036 + bl sub_80CEADC + lsls r0, 24 + cmp r0, 0 + beq _080CD0A2 + movs r0, 0x1 + bl sub_80CD1A8 +_080CD0A2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CD02C + + thumb_func_start sub_80CD0B8 +sub_80CD0B8: @ 80CD0B8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r2, 0 + ldr r7, =0x02039d08 + mov r12, r7 + movs r6, 0xE6 + lsls r6, 3 + movs r4, 0 + movs r3, 0x2 +_080CD0CC: + mov r0, r12 + ldr r1, [r0] + lsls r0, r2, 2 + adds r1, r6 + adds r1, r0 + ldr r0, [r1] + strh r4, [r0, 0x24] + ldr r0, [r1] + strh r3, [r0, 0x2E] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x1 + bls _080CD0CC + lsls r0, r5, 24 + cmp r0, 0 + bge _080CD114 + ldr r1, [r7] + movs r2, 0xE6 + lsls r2, 3 + adds r3, r1, r2 + ldr r2, [r3] + movs r0, 0x1D + strh r0, [r2, 0x30] + ldr r0, =0x00000734 + adds r1, r0 + ldr r2, [r1] + movs r0, 0x5 + strh r0, [r2, 0x30] + ldr r0, [r3] + movs r2, 0x48 + b _080CD130 + .pool +_080CD114: + ldr r1, [r7] + movs r2, 0xE6 + lsls r2, 3 + adds r3, r1, r2 + ldr r2, [r3] + movs r0, 0x5 + strh r0, [r2, 0x30] + ldr r0, =0x00000734 + adds r1, r0 + ldr r2, [r1] + movs r0, 0x1D + strh r0, [r2, 0x30] + ldr r0, [r3] + movs r2, 0xF8 +_080CD130: + strh r2, [r0, 0x32] + ldr r0, [r1] + strh r2, [r0, 0x32] + ldr r1, [r7] + movs r2, 0xE6 + lsls r2, 3 + adds r0, r1, r2 + ldr r2, [r0] + movs r0, 0 + strh r0, [r2, 0x3C] + ldr r0, =0x00000734 + adds r1, r0 + ldr r1, [r1] + movs r0, 0x1 + strh r0, [r1, 0x3C] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CD0B8 + + thumb_func_start sub_80CD158 +sub_80CD158: @ 80CD158 + push {r4-r6,lr} + movs r3, 0 + movs r5, 0 + movs r6, 0x5 + negs r6, r6 + ldr r4, =0x02039d08 +_080CD164: + ldr r1, [r4] + lsls r0, r3, 2 + movs r2, 0xE6 + lsls r2, 3 + adds r1, r2 + adds r1, r0 + ldr r2, [r1] + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 3 + adds r0, 0x5C + strh r0, [r2, 0x20] + ldr r0, [r1] + strh r5, [r0, 0x24] + ldr r1, [r1] + adds r1, 0x3E + ldrb r2, [r1] + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x1 + bls _080CD164 + movs r0, 0x1 + bl sub_80CD1A8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CD158 + + thumb_func_start sub_80CD1A8 +sub_80CD1A8: @ 80CD1A8 + push {r4-r6,lr} + lsls r0, 24 + cmp r0, 0 + beq _080CD1E4 + movs r2, 0 + ldr r6, =0x02039d08 + movs r5, 0xE6 + lsls r5, 3 + movs r3, 0 + movs r4, 0x1 +_080CD1BC: + ldr r1, [r6] + lsls r0, r2, 2 + adds r1, r5 + adds r1, r0 + ldr r0, [r1] + strh r4, [r0, 0x2E] + ldr r0, [r1] + strh r3, [r0, 0x30] + ldr r0, [r1] + strh r3, [r0, 0x32] + ldr r0, [r1] + strh r3, [r0, 0x36] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x1 + bls _080CD1BC + b _080CD204 + .pool +_080CD1E4: + movs r2, 0 + ldr r5, =0x02039d08 + movs r4, 0xE6 + lsls r4, 3 + movs r3, 0 +_080CD1EE: + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r4 + adds r0, r1 + ldr r0, [r0] + strh r3, [r0, 0x2E] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x1 + bls _080CD1EE +_080CD204: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CD1A8 + + thumb_func_start sub_80CD210 +sub_80CD210: @ 80CD210 + push {lr} + adds r2, r0, 0 + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0x4 + bhi _080CD2DC + lsls r0, 2 + ldr r1, =_080CD22C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080CD22C: + .4byte _080CD240 + .4byte _080CD246 + .4byte _080CD274 + .4byte _080CD27A + .4byte _080CD2CC +_080CD240: + movs r0, 0 + strh r0, [r2, 0x24] + b _080CD2DC +_080CD246: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + movs r1, 0 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _080CD2DC + strh r1, [r2, 0x30] + ldrh r0, [r2, 0x34] + ldrh r3, [r2, 0x24] + adds r0, r3 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x32] + adds r0, 0x1 + strh r0, [r2, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _080CD2DC + strh r1, [r2, 0x32] + strh r1, [r2, 0x24] + b _080CD2DC +_080CD274: + movs r0, 0x3 + strh r0, [r2, 0x2E] + b _080CD2DC +_080CD27A: + ldr r0, =0x02039d08 + ldr r1, [r0] + ldr r0, =0x000002ce + adds r1, r0 + ldrh r0, [r2, 0x20] + ldrh r1, [r1] + subs r0, r1 + strh r0, [r2, 0x20] + subs r0, 0x49 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xAE + bls _080CD2A0 + adds r3, r2, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r3] +_080CD2A0: + ldrh r0, [r2, 0x30] + subs r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + cmp r0, 0 + bne _080CD2DC + ldrh r0, [r2, 0x32] + strh r0, [r2, 0x20] + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + movs r0, 0x4 + strh r0, [r2, 0x2E] + b _080CD2DC + .pool +_080CD2CC: + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x000002ce + adds r0, r1 + ldrh r1, [r2, 0x20] + ldrh r0, [r0] + subs r1, r0 + strh r1, [r2, 0x20] +_080CD2DC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CD210 + + thumb_func_start sub_80CD2E8 +sub_80CD2E8: @ 80CD2E8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + adds r6, r1, 0 + ldr r4, [sp, 0x18] + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0857B0E0 + lsls r5, 16 + asrs r5, 16 + lsls r6, 16 + asrs r6, 16 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r4, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _080CD360 + movs r1, 0x1 + ands r1, r7 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r5, =0x02020630 + adds r6, r4, r5 + adds r0, r6, 0 + bl StartObjectImageAnim + movs r0, 0x3 + mov r1, r8 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r6, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r6, 0x5] + adds r5, 0x1C + adds r4, r5 + ldr r0, =DummyObjectCallback + str r0, [r4] + adds r0, r6, 0 + b _080CD362 + .pool +_080CD360: + movs r0, 0 +_080CD362: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80CD2E8 + + thumb_func_start sub_80CD36C +sub_80CD36C: @ 80CD36C + push {lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r1, [r0, 0x1] + cmp r1, 0x1 + beq _080CD388 + ldr r1, =0x02039d78 + movs r0, 0 + strb r0, [r1] + b _080CD38C + .pool +_080CD388: + ldr r0, =0x02039d78 + strb r1, [r0] +_080CD38C: + ldr r0, =0x02039d79 + movs r1, 0 + strb r1, [r0] + ldr r0, =0x02039d7a + strb r1, [r0] + ldr r0, =0x02039d7b + strb r1, [r0] + ldr r0, =0x02039d7c + strb r1, [r0] + ldr r0, =0x02039d7d + strb r1, [r0] + bl sub_80CDC0C + bl sub_80CFC14 + ldr r2, =0x02039d08 + ldr r0, [r2] + ldr r1, =0x00000cd6 + adds r0, r1 + movs r3, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r2] + ldr r1, =0x000021ff + adds r0, r1 + strb r3, [r0] + bl sub_80CEB40 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CD36C + + thumb_func_start sub_80CD3EC +sub_80CD3EC: @ 80CD3EC + push {lr} + bl sub_80CFC14 + bl sub_80CEBDC + ldr r3, =0x02039d08 + ldr r0, [r3] + ldr r1, =0x00000cd6 + adds r0, r1 + movs r2, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r3] + ldr r1, =0x000021ff + adds r0, r1 + strb r2, [r0] + ldr r0, =0x02039d7a + ldrb r0, [r0] + cmp r0, 0 + beq _080CD426 + ldr r0, [r3] + ldr r1, =0x000020a4 + adds r0, r1 + ldr r1, =0x02039d14 + movs r2, 0x64 + bl memcpy + bl sub_80CAFC4 +_080CD426: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CD3EC + + thumb_func_start sub_80CD444 +sub_80CD444: @ 80CD444 + push {r4-r6,lr} + adds r4, r2, 0 + adds r6, r3, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + cmp r0, 0x4 + bhi _080CD4FC + lsls r0, 2 + ldr r1, =_080CD464 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080CD464: + .4byte _080CD478 + .4byte _080CD4A6 + .4byte _080CD4CE + .4byte _080CD4D6 + .4byte _080CD4F4 +_080CD478: + adds r0, r5, 0 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, 0x64 + strh r1, [r4] + adds r0, r5, 0 + movs r1, 0x6 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, 0x20 + strh r1, [r6] + b _080CD4FC +_080CD4A6: + cmp r5, 0 + bne _080CD4B2 + movs r0, 0x68 + strh r0, [r4] + movs r0, 0x34 + b _080CD4FA +_080CD4B2: + cmp r5, 0x6 + bne _080CD4BE + movs r0, 0x98 + strh r0, [r4] + movs r0, 0x84 + b _080CD4FA +_080CD4BE: + movs r0, 0x98 + strh r0, [r4] + subs r1, r5, 0x1 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, 0x4 + b _080CD4FA +_080CD4CE: + movs r0, 0xA2 + strh r0, [r4] + movs r0, 0xC + b _080CD4FA +_080CD4D6: + ldr r0, =0x02039d7a + ldrb r0, [r0] + movs r1, 0xE + cmp r0, 0 + beq _080CD4E2 + movs r1, 0x8 +_080CD4E2: + strh r1, [r6] + movs r0, 0x58 + muls r0, r5 + adds r0, 0x78 + strh r0, [r4] + b _080CD4FC + .pool +_080CD4F4: + movs r0, 0xA0 + strh r0, [r4] + movs r0, 0x60 +_080CD4FA: + strh r0, [r6] +_080CD4FC: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80CD444 + + thumb_func_start sub_80CD504 +sub_80CD504: @ 80CD504 + push {lr} + ldr r0, =0x02039d78 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + beq _080CD538 + cmp r0, 0x1 + bne _080CD54C + ldr r0, =0x02039d79 + movs r1, 0 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + b _080CD542 + .pool +_080CD538: + ldr r0, =0x02039d79 + ldrb r0, [r0] + movs r1, 0xB + bl get_pokemon_data_from_selected_box +_080CD542: + lsls r0, 16 + lsrs r0, 16 + b _080CD54E + .pool +_080CD54C: + movs r0, 0 +_080CD54E: + pop {r1} + bx r1 + thumb_func_end sub_80CD504 + + thumb_func_start sub_80CD554 +sub_80CD554: @ 80CD554 + push {r4-r7,lr} + ldr r7, =0x02039d08 + ldr r5, [r7] + movs r0, 0xCD + lsls r0, 4 + adds r1, r5, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _080CD57E + ldrb r0, [r5, 0x1] + cmp r0, 0x3 + beq _080CD574 + movs r0, 0 + b _080CD69A + .pool +_080CD574: + bl sub_80D1218 + lsls r0, 24 + lsrs r0, 24 + b _080CD69A +_080CD57E: + subs r0, 0x1 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + beq _080CD67C + ldr r1, =0x00000cbc + adds r4, r5, r1 + ldr r2, =0x00000cc4 + adds r1, r5, r2 + ldr r0, [r4] + ldr r1, [r1] + adds r0, r1 + str r0, [r4] + movs r0, 0xCC + lsls r0, 4 + adds r3, r5, r0 + adds r2, 0x4 + adds r1, r5, r2 + ldr r0, [r3] + ldr r1, [r1] + adds r0, r1 + str r0, [r3] + ldr r6, =0x00000cb4 + adds r1, r5, r6 + ldr r2, [r1] + ldr r0, [r4] + asrs r0, 8 + strh r0, [r2, 0x20] + ldr r2, [r1] + ldr r0, [r3] + asrs r0, 8 + strh r0, [r2, 0x22] + ldr r1, [r1] + ldrh r2, [r1, 0x20] + movs r3, 0x20 + ldrsh r0, [r1, r3] + movs r3, 0x80 + lsls r3, 1 + cmp r0, r3 + ble _080CD5DA + ldr r4, =0xffffff00 + adds r0, r2, r4 + lsls r0, 16 + asrs r0, 16 + adds r0, 0x40 + strh r0, [r1, 0x20] +_080CD5DA: + ldr r0, [r7] + adds r0, r6 + ldr r1, [r0] + ldrh r2, [r1, 0x20] + movs r4, 0x20 + ldrsh r0, [r1, r4] + cmp r0, 0x3F + bgt _080CD5F6 + movs r0, 0x40 + subs r0, r2 + lsls r0, 16 + asrs r0, 16 + subs r0, r3, r0 + strh r0, [r1, 0x20] +_080CD5F6: + ldr r0, [r7] + adds r0, r6 + ldr r1, [r0] + ldrh r2, [r1, 0x22] + movs r3, 0x22 + ldrsh r0, [r1, r3] + cmp r0, 0xB0 + ble _080CD612 + adds r0, r2, 0 + subs r0, 0xB0 + lsls r0, 16 + asrs r0, 16 + subs r0, 0x10 + strh r0, [r1, 0x22] +_080CD612: + ldr r0, [r7] + adds r0, r6 + ldr r2, [r0] + ldrh r3, [r2, 0x22] + movs r4, 0x22 + ldrsh r0, [r2, r4] + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bge _080CD632 + subs r0, r1, r3 + movs r1, 0xB0 + lsls r0, 16 + asrs r0, 16 + subs r1, r0 + strh r1, [r2, 0x22] +_080CD632: + ldr r0, [r7] + ldr r2, =0x00000cd7 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _080CD698 + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _080CD698 + ldr r0, [r7] + adds r0, r6 + ldr r2, [r0] + adds r2, 0x3F + ldrb r3, [r2] + lsrs r1, r3, 1 + movs r0, 0x1 + eors r1, r0 + ands r1, r0 + lsls r1, 1 + movs r0, 0x3 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + b _080CD698 + .pool +_080CD67C: + ldr r3, =0x00000cb4 + adds r2, r5, r3 + ldr r1, [r2] + ldr r4, =0x00000ccc + adds r0, r5, r4 + ldrh r0, [r0] + strh r0, [r1, 0x20] + ldr r1, [r2] + ldr r2, =0x00000cce + adds r0, r5, r2 + ldrh r0, [r0] + strh r0, [r1, 0x22] + bl sub_80CDA68 +_080CD698: + movs r0, 0x1 +_080CD69A: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80CD554 + + thumb_func_start sub_80CD6AC +sub_80CD6AC: @ 80CD6AC + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + mov r6, sp + adds r6, 0x2 + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + adds r3, r6, 0 + bl sub_80CD444 + ldr r1, =0x02039d08 + ldr r0, [r1] + ldr r2, =0x00000cd4 + adds r0, r2 + strb r4, [r0] + ldr r0, [r1] + ldr r3, =0x00000cd5 + adds r0, r3 + strb r5, [r0] + ldr r1, [r1] + mov r0, sp + ldrh r2, [r0] + subs r3, 0x9 + adds r0, r1, r3 + strh r2, [r0] + ldrh r0, [r6] + ldr r2, =0x00000cce + adds r1, r2 + strh r0, [r1] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CD6AC + + thumb_func_start sub_80CD70C +sub_80CD70C: @ 80CD70C + push {r4-r7,lr} + ldr r0, =0x02039d08 + ldr r2, [r0] + ldr r3, =0x00000cd2 + adds r1, r2, r3 + ldrh r1, [r1] + adds r4, r0, 0 + cmp r1, 0 + beq _080CD730 + movs r0, 0xCD + lsls r0, 4 + adds r1, r2, r0 + movs r0, 0xC + b _080CD738 + .pool +_080CD730: + movs r3, 0xCD + lsls r3, 4 + adds r1, r2, r3 + movs r0, 0x6 +_080CD738: + strh r0, [r1] + ldr r1, [r4] + ldr r0, =0x00000cd7 + adds r2, r1, r0 + ldrb r0, [r2] + cmp r0, 0 + beq _080CD752 + movs r3, 0xCD + lsls r3, 4 + adds r0, r1, r3 + ldrh r0, [r0] + lsrs r0, 1 + strb r0, [r2] +_080CD752: + ldr r2, [r4] + ldr r1, =0x00000cd2 + adds r0, r2, r1 + movs r1, 0 + ldrsb r1, [r0, r1] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080CD78C + cmp r1, 0x1 + beq _080CD7AC + ldr r3, =0x00000cce + adds r0, r2, r3 + movs r3, 0 + ldrsh r1, [r0, r3] + ldr r3, =0x00000cb4 + adds r0, r2, r3 + ldr r0, [r0] + movs r2, 0x22 + ldrsh r0, [r0, r2] + b _080CD7C0 + .pool +_080CD78C: + ldr r3, =0x00000cce + adds r0, r2, r3 + movs r3, 0 + ldrsh r1, [r0, r3] + ldr r3, =0x00000cb4 + adds r0, r2, r3 + ldr r0, [r0] + movs r2, 0x22 + ldrsh r0, [r0, r2] + adds r0, 0xC0 + b _080CD7C0 + .pool +_080CD7AC: + ldr r3, =0x00000cce + adds r0, r2, r3 + movs r3, 0 + ldrsh r1, [r0, r3] + ldr r3, =0x00000cb4 + adds r0, r2, r3 + ldr r0, [r0] + movs r2, 0x22 + ldrsh r0, [r0, r2] + subs r0, 0xC0 +_080CD7C0: + subs r7, r1, r0 + ldr r2, [r4] + ldr r3, =0x00000cd3 + adds r0, r2, r3 + movs r1, 0 + ldrsb r1, [r0, r1] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080CD7FC + cmp r1, 0x1 + beq _080CD81C + ldr r1, =0x00000ccc + adds r0, r2, r1 + movs r3, 0 + ldrsh r1, [r0, r3] + ldr r3, =0x00000cb4 + adds r0, r2, r3 + ldr r0, [r0] + movs r2, 0x20 + ldrsh r0, [r0, r2] + b _080CD830 + .pool +_080CD7FC: + ldr r3, =0x00000ccc + adds r0, r2, r3 + movs r3, 0 + ldrsh r1, [r0, r3] + ldr r3, =0x00000cb4 + adds r0, r2, r3 + ldr r0, [r0] + movs r2, 0x20 + ldrsh r0, [r0, r2] + adds r0, 0xC0 + b _080CD830 + .pool +_080CD81C: + ldr r3, =0x00000ccc + adds r0, r2, r3 + movs r3, 0 + ldrsh r1, [r0, r3] + ldr r3, =0x00000cb4 + adds r0, r2, r3 + ldr r0, [r0] + movs r2, 0x20 + ldrsh r0, [r0, r2] + subs r0, 0xC0 +_080CD830: + subs r0, r1, r0 + lsls r7, 8 + lsls r0, 8 + ldr r4, [r4] + ldr r3, =0x00000cc4 + adds r6, r4, r3 + movs r1, 0xCD + lsls r1, 4 + adds r5, r4, r1 + ldrh r1, [r5] + bl __divsi3 + str r0, [r6] + ldr r2, =0x00000cc8 + adds r6, r4, r2 + ldrh r1, [r5] + adds r0, r7, 0 + bl __divsi3 + str r0, [r6] + ldr r3, =0x00000cbc + adds r2, r4, r3 + ldr r0, =0x00000cb4 + adds r1, r4, r0 + ldr r0, [r1] + movs r3, 0x20 + ldrsh r0, [r0, r3] + lsls r0, 8 + str r0, [r2] + movs r0, 0xCC + lsls r0, 4 + adds r4, r0 + ldr r0, [r1] + movs r1, 0x22 + ldrsh r0, [r0, r1] + lsls r0, 8 + str r0, [r4] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CD70C + + thumb_func_start sub_80CD894 +sub_80CD894: @ 80CD894 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80CD6AC + bl sub_80CD70C + ldr r5, =0x02039d08 + ldr r1, [r5] + ldrb r0, [r1, 0x1] + cmp r0, 0x3 + beq _080CD8E4 + ldr r2, =0x000021ff + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080CD8FC + ldr r0, =0x02039d7a + ldrb r0, [r0] + cmp r0, 0 + bne _080CD8FC + ldr r2, =0x00000cb4 + adds r0, r1, r2 + ldr r0, [r0] + movs r1, 0x1 + bl StartObjectImageAnim + b _080CD8FC + .pool +_080CD8E4: + bl sub_80D127C + lsls r0, 24 + cmp r0, 0 + bne _080CD8FC + ldr r0, [r5] + ldr r1, =0x00000cb4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x1 + bl StartObjectImageAnim +_080CD8FC: + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080CD95C + ldr r0, =0x02039d78 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bne _080CD930 + ldr r0, =0x02039d79 + ldrb r1, [r0] + movs r0, 0 + bl sub_80D0E50 + b _080CD93E + .pool +_080CD930: + cmp r0, 0x1 + bne _080CD93E + ldr r0, =0x02039d79 + ldrb r1, [r0] + movs r0, 0x1 + bl sub_80D0E50 +_080CD93E: + cmp r4, 0 + bne _080CD950 + movs r0, 0 + adds r1, r6, 0 + bl sub_80D0D8C + b _080CD95C + .pool +_080CD950: + cmp r4, 0x1 + bne _080CD988 + movs r0, 0x1 + adds r1, r6, 0 + bl sub_80D0D8C +_080CD95C: + cmp r4, 0x1 + bne _080CD988 + ldr r0, =0x02039d78 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + beq _080CD988 + ldr r1, =0x02039d08 + ldr r0, [r1] + ldr r2, =0x00000cd6 + adds r0, r2 + strb r4, [r0] + ldr r0, [r1] + ldr r1, =0x00000cb8 + adds r0, r1 + ldr r1, [r0] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] +_080CD988: + cmp r4, 0 + beq _080CD9E4 + cmp r4, 0 + blt _080CDA56 + cmp r4, 0x3 + bgt _080CDA56 + ldr r5, =0x02039d08 + ldr r0, [r5] + ldr r2, =0x00000cb4 + adds r0, r2 + ldr r4, [r0] + ldrb r1, [r4, 0x5] + movs r2, 0xD + negs r2, r2 + adds r0, r2, 0 + ands r0, r1 + movs r3, 0x4 + orrs r0, r3 + strb r0, [r4, 0x5] + ldr r0, [r5] + ldr r4, =0x00000cb8 + adds r0, r4 + ldr r1, [r0] + adds r1, 0x3E + ldrb r0, [r1] + orrs r0, r3 + strb r0, [r1] + ldr r0, [r5] + adds r0, r4 + ldr r1, [r0] + ldrb r0, [r1, 0x5] + ands r2, r0 + orrs r2, r3 + strb r2, [r1, 0x5] + b _080CDA56 + .pool +_080CD9E4: + ldr r3, =0x02039d08 + ldr r1, [r3] + ldr r2, =0x000021ff + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080CDA28 + ldr r2, =0x00000cb4 + adds r0, r1, r2 + ldr r2, [r0] + ldrb r1, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x5] + ldr r0, [r3] + ldr r1, =0x00000cb8 + adds r0, r1 + ldr r1, [r0] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + b _080CDA56 + .pool +_080CDA28: + ldr r2, =0x00000cb4 + adds r0, r1, r2 + ldr r2, [r0] + ldrb r1, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, =0x02039d78 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bne _080CDA56 + ldr r0, =0x02039d7a + ldrb r0, [r0] + cmp r0, 0 + beq _080CDA56 + movs r0, 0x2 + bl sub_80CC0D4 +_080CDA56: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CD894 + + thumb_func_start sub_80CDA68 +sub_80CDA68: @ 80CDA68 + push {r4,lr} + ldr r1, =0x02039d78 + ldr r4, =0x02039d08 + ldr r2, [r4] + ldr r3, =0x00000cd4 + adds r0, r2, r3 + ldrb r0, [r0] + strb r0, [r1] + ldr r1, =0x02039d79 + adds r3, 0x1 + adds r0, r2, r3 + ldrb r0, [r0] + strb r0, [r1] + ldrb r0, [r2, 0x1] + cmp r0, 0x3 + beq _080CDAC0 + ldr r1, =0x000021ff + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080CDAD8 + ldr r0, =0x02039d7a + ldrb r0, [r0] + cmp r0, 0 + bne _080CDAD8 + subs r3, 0x21 + adds r0, r2, r3 + ldr r0, [r0] + movs r1, 0 + bl StartObjectImageAnim + b _080CDAD8 + .pool +_080CDAC0: + bl sub_80D127C + lsls r0, 24 + cmp r0, 0 + bne _080CDAD8 + ldr r0, [r4] + ldr r1, =0x00000cb4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + bl StartObjectImageAnim +_080CDAD8: + bl sub_80CEB40 + ldr r0, =0x02039d78 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + beq _080CDB0E + cmp r0, 0x1 + bgt _080CDAFC + cmp r0, 0 + beq _080CDB30 + b _080CDB8A + .pool +_080CDAFC: + cmp r0, 0x2 + beq _080CDB06 + cmp r0, 0x3 + bne _080CDB8A + b _080CDB1E +_080CDB06: + movs r0, 0x1 + bl sub_80CD1A8 + b _080CDB8A +_080CDB0E: + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r2, =0x00000cb8 + adds r0, r2 + ldr r0, [r0] + adds r0, 0x43 + movs r1, 0xD + strb r1, [r0] +_080CDB1E: + movs r0, 0x1 + bl sub_80CC0D4 + b _080CDB8A + .pool +_080CDB30: + ldr r4, =0x02039d08 + ldr r1, [r4] + ldr r3, =0x000021ff + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _080CDB8A + ldr r2, =0x00000cb4 + adds r0, r1, r2 + ldr r3, [r0] + ldrb r1, [r3, 0x5] + movs r2, 0xD + negs r2, r2 + adds r0, r2, 0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r3, 0x5] + ldr r0, [r4] + ldr r3, =0x00000cb8 + adds r0, r3 + ldr r1, [r0] + ldrb r0, [r1, 0x5] + ands r2, r0 + movs r0, 0x8 + orrs r2, r0 + strb r2, [r1, 0x5] + ldr r0, [r4] + adds r0, r3 + ldr r0, [r0] + adds r0, 0x43 + movs r1, 0x15 + strb r1, [r0] + ldr r0, [r4] + adds r0, r3 + ldr r1, [r0] + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + movs r0, 0x2 + bl sub_80CC0D4 +_080CDB8A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CDA68 + + thumb_func_start sub_80CDBA0 +sub_80CDBA0: @ 80CDBA0 + push {lr} + ldr r0, =0x02039d7a + ldrb r0, [r0] + cmp r0, 0 + bne _080CDBB4 + movs r3, 0 + b _080CDBC2 + .pool +_080CDBB4: + bl calc_player_party_count + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x5 + bls _080CDBC2 + movs r3, 0x5 +_080CDBC2: + ldr r0, =0x02039d08 + ldr r2, [r0] + ldr r1, =0x00000cb4 + adds r0, r2, r1 + ldr r0, [r0] + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080CDBE0 + ldr r0, =0x00000cd7 + adds r1, r2, r0 + movs r0, 0x1 + strb r0, [r1] +_080CDBE0: + movs r0, 0x1 + adds r1, r3, 0 + bl sub_80CD894 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CDBA0 + + thumb_func_start sub_80CDBF8 +sub_80CDBF8: @ 80CDBF8 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_80CD894 + pop {r0} + bx r0 + thumb_func_end sub_80CDBF8 + + thumb_func_start sub_80CDC0C +sub_80CDC0C: @ 80CDC0C + ldr r1, =0x02039d7e + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_80CDC0C + + thumb_func_start sub_80CDC18 +sub_80CDC18: @ 80CDC18 + ldr r0, =0x02039d7e + ldr r1, =0x02039d79 + ldrb r1, [r1] + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_80CDC18 + + thumb_func_start sub_80CDC2C +sub_80CDC2C: @ 80CDC2C + ldr r0, =0x02039d7e + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80CDC2C + + thumb_func_start sub_80CDC38 +sub_80CDC38: @ 80CDC38 + lsls r0, 24 + ldr r1, =0x02039d08 + ldr r1, [r1] + ldr r2, =0x00000d8c + adds r3, r1, r2 + ldr r2, =gUnknown_0857B998 + lsrs r0, 22 + adds r0, r2 + ldr r0, [r0] + str r0, [r3] + movs r0, 0xD9 + lsls r0, 4 + adds r1, r0 + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_80CDC38 + + thumb_func_start sub_80CDC64 +sub_80CDC64: @ 80CDC64 + push {lr} + lsls r0, 24 + cmp r0, 0 + bne _080CDC84 + ldr r0, =0x02039d08 + ldr r1, [r0] + ldr r2, =0x00000d8c + adds r1, r2 + ldr r2, =sub_80CDEB4 + b _080CDC8E + .pool +_080CDC84: + ldr r0, =0x02039d08 + ldr r1, [r0] + ldr r2, =0x00000d8c + adds r1, r2 + ldr r2, =sub_80CDEC4 +_080CDC8E: + str r2, [r1] + ldr r0, [r0] + movs r1, 0xD9 + lsls r1, 4 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CDC64 + + thumb_func_start sub_80CDCAC +sub_80CDCAC: @ 80CDCAC + push {lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x00000d8c + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80CDCAC + + thumb_func_start sub_80CDCCC +sub_80CDCCC: @ 80CDCCC + push {r4,r5,lr} + ldr r4, =0x02039d08 + ldr r1, [r4] + movs r5, 0xD9 + lsls r5, 4 + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080CDD1C + cmp r0, 0x1 + bgt _080CDCEC + cmp r0, 0 + beq _080CDCF6 + b _080CDD54 + .pool +_080CDCEC: + cmp r0, 0x2 + beq _080CDD40 + cmp r0, 0x3 + beq _080CDCFE + b _080CDD54 +_080CDCF6: + ldr r0, =0x02039d7a + ldrb r0, [r0] + cmp r0, 0 + beq _080CDD08 +_080CDCFE: + movs r0, 0 + b _080CDD56 + .pool +_080CDD08: + ldr r2, =0x00000cb4 + adds r0, r1, r2 + ldr r0, [r0] + movs r1, 0x2 + bl StartObjectImageAnim + b _080CDD4A + .pool +_080CDD1C: + bl sub_80CDED4 + lsls r0, 24 + cmp r0, 0 + bne _080CDD54 + ldr r0, [r4] + ldr r1, =0x00000cb4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x3 + bl StartObjectImageAnim + bl sub_80CDF38 + b _080CDD4A + .pool +_080CDD40: + bl sub_80CDF08 + lsls r0, 24 + cmp r0, 0 + bne _080CDD54 +_080CDD4A: + ldr r1, [r4] + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080CDD54: + movs r0, 0x1 +_080CDD56: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80CDCCC + + thumb_func_start sub_80CDD5C +sub_80CDD5C: @ 80CDD5C + push {r4,r5,lr} + ldr r4, =0x02039d08 + ldr r0, [r4] + movs r5, 0xD9 + lsls r5, 4 + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080CDDA4 + cmp r0, 0x1 + bgt _080CDD7C + cmp r0, 0 + beq _080CDD82 + b _080CDDD0 + .pool +_080CDD7C: + cmp r0, 0x2 + beq _080CDDCC + b _080CDDD0 +_080CDD82: + bl sub_80CDED4 + lsls r0, 24 + cmp r0, 0 + bne _080CDDD0 + ldr r0, [r4] + ldr r1, =0x00000cb4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x2 + bl StartObjectImageAnim + bl sub_80CDFAC + b _080CDDBC + .pool +_080CDDA4: + bl sub_80CDF08 + lsls r0, 24 + cmp r0, 0 + bne _080CDDD0 + ldr r0, [r4] + ldr r1, =0x00000cb4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + bl StartObjectImageAnim +_080CDDBC: + ldr r1, [r4] + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080CDDD0 + .pool +_080CDDCC: + movs r0, 0 + b _080CDDD2 +_080CDDD0: + movs r0, 0x1 +_080CDDD2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80CDD5C + + thumb_func_start sub_80CDDD8 +sub_80CDDD8: @ 80CDDD8 + push {r4,r5,lr} + ldr r4, =0x02039d08 + ldr r1, [r4] + movs r5, 0xD9 + lsls r5, 4 + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080CDE68 + cmp r0, 0x1 + bgt _080CDDF8 + cmp r0, 0 + beq _080CDDFE + b _080CDEAC + .pool +_080CDDF8: + cmp r0, 0x2 + beq _080CDEA8 + b _080CDEAC +_080CDDFE: + ldr r0, =0x02039d78 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + beq _080CDE20 + cmp r0, 0x1 + bne _080CDEA8 + ldr r0, =0x00000d91 + adds r1, r0 + movs r0, 0xE + b _080CDE2A + .pool +_080CDE20: + bl get_preferred_box + ldr r1, [r4] + ldr r2, =0x00000d91 + adds r1, r2 +_080CDE2A: + strb r0, [r1] + ldr r4, =0x02039d08 + ldr r0, [r4] + ldr r1, =0x00000cb4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x2 + bl StartObjectImageAnim + ldr r0, [r4] + ldr r2, =0x00000d91 + adds r0, r2 + ldrb r0, [r0] + ldr r1, =0x02039d79 + ldrb r1, [r1] + bl sub_80CBD5C + ldr r1, [r4] + movs r0, 0xD9 + lsls r0, 4 + adds r1, r0 + b _080CDE94 + .pool +_080CDE68: + bl sub_80CBDC4 + lsls r0, 24 + cmp r0, 0 + bne _080CDEAC + ldr r0, [r4] + ldr r1, =0x00000cb4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x3 + bl StartObjectImageAnim + ldr r0, [r4] + ldr r2, =0x00000d91 + adds r0, r2 + ldrb r0, [r0] + ldr r1, =0x02039d79 + ldrb r1, [r1] + bl diegohint1 + ldr r1, [r4] + adds r1, r5 +_080CDE94: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080CDEAC + .pool +_080CDEA8: + movs r0, 0 + b _080CDEAE +_080CDEAC: + movs r0, 0x1 +_080CDEAE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80CDDD8 + + thumb_func_start sub_80CDEB4 +sub_80CDEB4: @ 80CDEB4 + push {lr} + bl sub_80CDED4 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80CDEB4 + + thumb_func_start sub_80CDEC4 +sub_80CDEC4: @ 80CDEC4 + push {lr} + bl sub_80CDF08 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80CDEC4 + + thumb_func_start sub_80CDED4 +sub_80CDED4: @ 80CDED4 + push {lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x00000cb4 + adds r0, r1 + ldr r1, [r0] + movs r2, 0x26 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _080CDEEC + cmp r0, 0x8 + beq _080CDEFC +_080CDEEC: + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _080CDF00 + .pool +_080CDEFC: + movs r0, 0 + b _080CDF02 +_080CDF00: + movs r0, 0x1 +_080CDF02: + pop {r1} + bx r1 + thumb_func_end sub_80CDED4 + + thumb_func_start sub_80CDF08 +sub_80CDF08: @ 80CDF08 + push {lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x00000cb4 + adds r0, r1 + ldr r1, [r0] + movs r2, 0x26 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _080CDF30 + ldrh r0, [r1, 0x26] + subs r0, 0x1 + strh r0, [r1, 0x26] + movs r0, 0x1 + b _080CDF32 + .pool +_080CDF30: + movs r0, 0 +_080CDF32: + pop {r1} + bx r1 + thumb_func_end sub_80CDF08 + + thumb_func_start sub_80CDF38 +sub_80CDF38: @ 80CDF38 + push {r4,lr} + ldr r0, =0x02039d78 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + beq _080CDF68 + cmp r0, 0x1 + bne _080CDF94 + ldr r4, =0x02039d79 + ldrb r1, [r4] + movs r0, 0xE + bl sub_80CE018 + ldrb r1, [r4] + movs r0, 0 + bl sub_80CBC14 + b _080CDF8E + .pool +_080CDF68: + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x000021ff + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080CDF8E + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x02039d79 + ldrb r1, [r4] + bl sub_80CE018 + ldrb r1, [r4] + movs r0, 0x1 + bl sub_80CBC14 +_080CDF8E: + ldr r1, =0x02039d7a + movs r0, 0x1 + strb r0, [r1] +_080CDF94: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CDF38 + + thumb_func_start sub_80CDFAC +sub_80CDFAC: @ 80CDFAC + push {r4,r5,lr} + ldr r0, =0x02039d78 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + beq _080CDFDC + cmp r0, 0x1 + bne _080CDFFE + ldr r4, =0x02039d79 + ldrb r1, [r4] + movs r0, 0xE + bl diegohint2 + ldrb r1, [r4] + movs r0, 0xE + bl sub_80CBCAC + b _080CDFF8 + .pool +_080CDFDC: + bl get_preferred_box + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =0x02039d79 + ldrb r1, [r5] + adds r0, r4, 0 + bl diegohint2 + ldrb r1, [r5] + adds r0, r4, 0 + bl sub_80CBCAC +_080CDFF8: + ldr r1, =0x02039d7a + movs r0, 0 + strb r0, [r1] +_080CDFFE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CDFAC + + thumb_func_start sub_80CE00C +sub_80CE00C: @ 80CE00C + push {lr} + bl sub_80CEB40 + pop {r0} + bx r0 + thumb_func_end sub_80CE00C + + thumb_func_start sub_80CE018 +sub_80CE018: @ 80CE018 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + cmp r4, 0xE + bne _080CE054 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x000020a4 + adds r0, r1 + ldr r3, =0x020244ec + ldr r1, =0x02039d79 + movs r2, 0 + ldrsb r2, [r1, r2] + movs r1, 0x64 + muls r1, r2 + adds r1, r3 + movs r2, 0x64 + bl memcpy + b _080CE064 + .pool +_080CE054: + ldr r0, =0x02039d08 + ldr r2, [r0] + ldr r0, =0x000020a4 + adds r2, r0 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80D2054 +_080CE064: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80CE0E8 + ldr r0, =0x02039d7b + strb r4, [r0] + ldr r0, =0x02039d7c + strb r5, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CE018 + + thumb_func_start diegohint2 +diegohint2: @ 80CE08C + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + cmp r6, 0xE + bne _080CE0C0 + ldr r1, =0x020244ec + movs r0, 0x64 + muls r0, r7 + adds r0, r1 + ldr r1, =0x02039d08 + ldr r1, [r1] + ldr r2, =0x000020a4 + adds r1, r2 + movs r2, 0x64 + bl memcpy + b _080CE0D8 + .pool +_080CE0C0: + ldr r5, =0x02039d08 + ldr r0, [r5] + ldr r4, =0x000020a4 + adds r0, r4 + bl pokemon_restore_pp + ldr r2, [r5] + adds r2, r4 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_80D1F18 +_080CE0D8: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end diegohint2 + + thumb_func_start sub_80CE0E8 +sub_80CE0E8: @ 80CE0E8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r0, 0xE + bne _080CE108 + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + bl zero_pokemon_struct + b _080CE10C + .pool +_080CE108: + bl sub_80D2018 +_080CE10C: + pop {r0} + bx r0 + thumb_func_end sub_80CE0E8 + + thumb_func_start diegohint1 +diegohint1: @ 80CE110 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + cmp r6, 0xE + bne _080CE144 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x00002108 + adds r0, r1 + ldr r2, =0x020244ec + movs r1, 0x64 + muls r1, r7 + adds r1, r2 + movs r2, 0x64 + bl memcpy + b _080CE154 + .pool +_080CE144: + ldr r0, =0x02039d08 + ldr r2, [r0] + ldr r0, =0x00002108 + adds r2, r0 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_80D2054 +_080CE154: + adds r0, r6, 0 + adds r1, r7, 0 + bl diegohint2 + ldr r5, =0x02039d08 + ldr r1, [r5] + ldr r4, =0x000020a4 + adds r0, r1, r4 + ldr r2, =0x00002108 + adds r1, r2 + movs r2, 0x64 + bl memcpy + ldr r0, [r5] + adds r0, r4 + movs r1, 0 + bl sub_80CEC00 + ldr r0, =0x02039d7b + strb r6, [r0] + ldr r0, =0x02039d7c + strb r7, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end diegohint1 + + thumb_func_start sub_80CE19C +sub_80CE19C: @ 80CE19C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r6, 0 + bl sub_80C6FD4 + lsls r0, 16 + lsrs r4, r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _080CE1BA + movs r0, 0 + b _080CE21A +_080CE1BA: + ldr r5, =0x02039d7a + ldrb r0, [r5] + cmp r0, 0 + beq _080CE1DC + lsls r4, 24 + lsrs r1, r4, 24 + adds r0, r6, 0 + bl diegohint2 + bl sub_80CBAC4 + movs r0, 0 + strb r0, [r5] + b _080CE1F6 + .pool +_080CE1DC: + ldr r5, =0x02039d79 + ldrb r1, [r5] + movs r0, 0xE + bl sub_80CE018 + lsls r4, 24 + lsrs r1, r4, 24 + adds r0, r6, 0 + bl diegohint2 + ldrb r0, [r5] + bl sub_80CBB68 +_080CE1F6: + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + bne _080CE208 + lsrs r0, r4, 24 + bl sub_80CB140 +_080CE208: + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x00000cb4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x1 + bl StartObjectImageAnim + movs r0, 0x1 +_080CE21A: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80CE19C + + thumb_func_start sub_80CE22C +sub_80CE22C: @ 80CE22C + push {lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x00000cb4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + bl StartObjectImageAnim + bl sub_80CEB40 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CE22C + + thumb_func_start sub_80CE250 +sub_80CE250: @ 80CE250 + push {lr} + ldr r0, =0x02039d7a + ldrb r0, [r0] + cmp r0, 0 + beq _080CE264 + movs r2, 0x2 + b _080CE274 + .pool +_080CE264: + ldr r0, =0x02039d78 + movs r1, 0 + ldrsb r1, [r0, r1] + movs r2, 0x1 + eors r1, r2 + negs r0, r1 + orrs r0, r1 + lsrs r2, r0, 31 +_080CE274: + ldr r0, =0x02039d79 + ldrb r1, [r0] + adds r0, r2, 0 + bl sub_80CBF14 + ldr r0, =0x02039d08 + ldr r1, [r0] + ldr r2, =0x000021e0 + adds r0, r1, r2 + ldr r2, =0x00000cee + adds r1, r2 + bl CopyString + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CE250 + + thumb_func_start sub_80CE2A8 +sub_80CE2A8: @ 80CE2A8 + push {lr} + bl sub_80CBFD8 + lsls r0, 24 + cmp r0, 0 + beq _080CE2B8 + movs r0, 0x1 + b _080CE2CA +_080CE2B8: + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x00000cb4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + bl StartObjectImageAnim + movs r0, 0 +_080CE2CA: + pop {r1} + bx r1 + .pool + thumb_func_end sub_80CE2A8 + + thumb_func_start sub_80CE2D8 +sub_80CE2D8: @ 80CE2D8 + push {lr} + bl sub_80CC020 + ldr r1, =0x02039d7a + ldrb r0, [r1] + cmp r0, 0 + beq _080CE2F0 + movs r0, 0 + strb r0, [r1] + b _080CE316 + .pool +_080CE2F0: + ldr r0, =0x02039d78 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + bne _080CE304 + movs r2, 0xE + b _080CE30C + .pool +_080CE304: + bl get_preferred_box + lsls r0, 24 + lsrs r2, r0, 24 +_080CE30C: + ldr r0, =0x02039d79 + ldrb r1, [r0] + adds r0, r2, 0 + bl sub_80CE0E8 +_080CE316: + bl sub_80CEB40 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CE2D8 + + thumb_func_start sub_80CE324 +sub_80CE324: @ 80CE324 + push {lr} + ldr r0, =0x02039d7a + ldrb r0, [r0] + cmp r0, 0 + beq _080CE33E + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x00000cb4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x3 + bl StartObjectImageAnim +_080CE33E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CE324 + + thumb_func_start sub_80CE350 +sub_80CE350: @ 80CE350 + push {r4,r5,lr} + adds r3, r0, 0 + movs r5, 0 + ldr r4, =gUnknown_0857B9A4 +_080CE358: + movs r1, 0 + ldrsb r1, [r4, r1] + cmp r1, 0x22 + beq _080CE378 + ldr r0, =0x03005d8c + ldr r2, [r0] + movs r0, 0x4 + ldrsb r0, [r2, r0] + cmp r1, r0 + bne _080CE37E + movs r1, 0x1 + ldrsb r1, [r4, r1] + movs r0, 0x5 + ldrsb r0, [r2, r0] + cmp r1, r0 + bne _080CE37E +_080CE378: + ldrh r0, [r4, 0x2] + strh r0, [r3] + adds r3, 0x2 +_080CE37E: + adds r4, 0x4 + adds r5, 0x1 + cmp r5, 0x5 + bls _080CE358 + ldr r1, =0x00000163 + adds r0, r1, 0 + strh r0, [r3] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CE350 + + thumb_func_start sub_80CE3A0 +sub_80CE3A0: @ 80CE3A0 + push {r4,r5,lr} + bl sub_80CE51C + adds r3, r0, 0 + cmp r3, 0 + bne _080CE3D0 + ldr r2, =0x02039d08 + ldr r0, [r2] + ldr r1, =0x0000216d + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r2] + ldr r2, =0x0000216c + adds r0, r2 + strb r3, [r0] + b _080CE504 + .pool +_080CE3D0: + ldr r0, =0x02039d7a + ldrb r0, [r0] + cmp r0, 0 + beq _080CE418 + ldr r4, =0x02039d08 + ldr r1, [r4] + ldr r3, =0x00002108 + adds r0, r1, r3 + ldr r2, =0x000020a4 + adds r1, r2 + movs r2, 0x64 + bl memcpy + ldr r0, [r4] + ldr r3, =0x00002170 + adds r0, r3 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r4] + ldr r1, =0x00002171 + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + b _080CE494 + .pool +_080CE418: + ldr r0, =0x02039d78 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + bne _080CE464 + ldr r4, =0x02039d08 + ldr r0, [r4] + ldr r2, =0x00002108 + adds r0, r2 + ldr r3, =0x020244ec + ldr r1, =0x02039d79 + movs r2, 0 + ldrsb r2, [r1, r2] + movs r1, 0x64 + muls r1, r2 + adds r1, r3 + movs r2, 0x64 + bl memcpy + ldr r0, [r4] + ldr r3, =0x00002170 + adds r0, r3 + movs r1, 0xE + strb r1, [r0] + b _080CE488 + .pool +_080CE464: + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02039d79 + ldrb r1, [r1] + ldr r4, =0x02039d08 + ldr r2, [r4] + ldr r3, =0x00002108 + adds r2, r3 + bl sub_80D2054 + bl get_preferred_box + ldr r1, [r4] + ldr r2, =0x00002170 + adds r1, r2 + strb r0, [r1] +_080CE488: + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x02039d79 + ldrb r1, [r1] + ldr r3, =0x00002171 + adds r0, r3 +_080CE494: + strb r1, [r0] + ldr r5, =0x02039d08 + ldr r0, [r5] + ldr r4, =0x00002176 + adds r0, r4 + bl sub_80CE350 + ldr r2, [r5] + ldr r1, =0x00002108 + adds r0, r2, r1 + adds r2, r4 + movs r1, 0x51 + bl pokemon_getattr + ldr r2, [r5] + ldr r3, =0x00002174 + adds r1, r2, r3 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + beq _080CE4E8 + ldr r0, =0x0000216d + adds r1, r2, r0 + movs r0, 0 + strb r0, [r1] + b _080CE4F8 + .pool +_080CE4E8: + ldr r1, =0x0000216d + adds r0, r2, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r5] + ldr r2, =0x0000216c + adds r0, r2 + strb r1, [r0] +_080CE4F8: + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r3, =0x00002172 + adds r0, r3 + movs r1, 0 + strh r1, [r0] +_080CE504: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CE3A0 + + thumb_func_start sub_80CE51C +sub_80CE51C: @ 80CE51C + push {r4-r6,lr} + ldr r0, =0x02039d7a + ldrb r1, [r0] + negs r0, r1 + orrs r0, r1 + lsrs r5, r0, 31 + movs r4, 0 +_080CE52A: + movs r0, 0x64 + muls r0, r4 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x5 + bl pokemon_getattr + cmp r0, 0 + beq _080CE53E + adds r5, 0x1 +_080CE53E: + adds r4, 0x1 + cmp r4, 0x5 + ble _080CE52A + cmp r5, 0x2 + ble _080CE554 +_080CE548: + movs r0, 0x1 + b _080CE578 + .pool +_080CE554: + movs r6, 0 +_080CE556: + movs r4, 0 +_080CE558: + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80D2270 + cmp r0, 0 + beq _080CE56A + adds r5, 0x1 + cmp r5, 0x2 + bgt _080CE548 +_080CE56A: + adds r4, 0x1 + cmp r4, 0x1D + ble _080CE558 + adds r6, 0x1 + cmp r6, 0xD + ble _080CE556 + movs r0, 0 +_080CE578: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80CE51C + + thumb_func_start sub_80CE580 +sub_80CE580: @ 80CE580 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x02039d08 + ldr r2, [r0] + ldr r3, =0x0000216d + adds r1, r2, r3 + ldrb r1, [r1] + adds r5, r0, 0 + cmp r1, 0 + beq _080CE5B0 + ldr r1, =0x0000216c + adds r0, r2, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + b _080CE736 + .pool +_080CE5B0: + ldr r3, =0x00002172 + adds r0, r2, r3 + ldrh r0, [r0] + cmp r0, 0 + beq _080CE5C4 + cmp r0, 0x1 + beq _080CE690 + b _080CE732 + .pool +_080CE5C4: + movs r6, 0 +_080CE5C6: + ldr r2, [r5] + ldr r1, =0x00002170 + adds r0, r2, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0xE + bne _080CE5E4 + ldr r3, =0x00002171 + adds r0, r2, r3 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, r6 + beq _080CE606 +_080CE5E4: + movs r0, 0x64 + muls r0, r6 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x00002176 + adds r2, r1 + movs r1, 0x51 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + ldr r1, [r5] + ldr r2, =0x00002174 + adds r1, r2 + ldrh r0, [r1] + bics r0, r4 + strh r0, [r1] +_080CE606: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x5 + bls _080CE5C6 + ldr r2, =0x02039d08 + ldr r1, [r2] + ldr r3, =0x00002174 + adds r0, r1, r3 + ldrh r0, [r0] + cmp r0, 0 + bne _080CE64C + subs r3, 0x7 + adds r0, r1, r3 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r2] + ldr r2, =0x0000216c + adds r0, r2 + strb r1, [r0] + b _080CE732 + .pool +_080CE64C: + ldr r3, =0x0000216e + adds r0, r1, r3 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r3, 0x1 + adds r0, r3 + strb r1, [r0] + ldr r1, [r2] + ldr r0, =0x00002172 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _080CE732 + .pool +_080CE674: + ldr r1, =0x0000216d + adds r0, r5, r1 + movs r1, 0x1 + strb r1, [r0] + mov r2, r8 + ldr r0, [r2] + ldr r3, =0x0000216c + adds r0, r3 + strb r1, [r0] + b _080CE732 + .pool +_080CE690: + movs r6, 0 + mov r8, r5 + ldr r7, =0x0000ffff +_080CE696: + mov r0, r8 + ldr r3, [r0] + ldr r1, =0x0000216e + adds r0, r3, r1 + ldrb r0, [r0] + ldr r2, =0x0000216f + adds r1, r3, r2 + ldrb r1, [r1] + adds r2, 0x7 + adds r3, r2 + movs r2, 0x51 + bl sub_80D1ED0 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _080CE6E0 + ldr r5, [r5] + ldr r3, =0x00002170 + adds r0, r5, r3 + ldrh r2, [r0] + ldr r1, =0x0000216e + adds r0, r5, r1 + ldrh r3, [r0] + adds r1, r7, 0 + ands r1, r2 + adds r0, r7, 0 + ands r0, r3 + cmp r1, r0 + beq _080CE6E0 + ldr r2, =0x00002174 + adds r1, r5, r2 + ldrh r0, [r1] + bics r0, r4 + strh r0, [r1] + cmp r0, 0 + beq _080CE674 +_080CE6E0: + ldr r2, =0x02039d08 + ldr r1, [r2] + ldr r3, =0x0000216f + adds r1, r3 + ldrb r0, [r1] + adds r0, 0x1 + movs r3, 0 + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + adds r5, r2, 0 + cmp r0, 0x1D + ble _080CE728 + ldr r0, [r2] + ldr r1, =0x0000216f + adds r0, r1 + strb r3, [r0] + ldr r1, [r2] + ldr r0, =0x0000216e + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0xD + ble _080CE728 + ldr r0, [r2] + ldr r1, =0x0000216d + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r2] + ldr r2, =0x0000216c + adds r0, r2 + strb r3, [r0] +_080CE728: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x1D + bls _080CE696 +_080CE732: + movs r0, 0x1 + negs r0, r0 +_080CE736: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80CE580 + + thumb_func_start sub_80CE760 +sub_80CE760: @ 80CE760 + push {lr} + ldr r0, =0x02039d7a + ldrb r0, [r0] + cmp r0, 0 + beq _080CE77A + ldr r0, =0x02039d14 + ldr r1, =0x02039d08 + ldr r1, [r1] + ldr r2, =0x000020a4 + adds r1, r2 + movs r2, 0x64 + bl memcpy +_080CE77A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CE760 + + thumb_func_start sub_80CE790 +sub_80CE790: @ 80CE790 + push {lr} + ldr r0, =0x02039d7a + ldrb r0, [r0] + cmp r0, 0 + beq _080CE7D8 + ldr r0, =0x02039d7b + ldrb r0, [r0] + cmp r0, 0xE + bne _080CE7C8 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x000020a4 + adds r0, r1 + ldr r1, =0x02039d14 + movs r2, 0x64 + bl memcpy + b _080CE7D8 + .pool +_080CE7C8: + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x000020a4 + adds r0, r1 + ldr r1, =0x02039d14 + movs r2, 0x50 + bl memcpy +_080CE7D8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CE790 + + thumb_func_start sub_80CE7E8 +sub_80CE7E8: @ 80CE7E8 + push {r4,r5,lr} + ldr r0, =0x02039d7a + ldrb r5, [r0] + cmp r5, 0 + beq _080CE838 + bl sub_80CE760 + ldr r3, =0x02039d08 + ldr r1, [r3] + ldr r0, =0x0000218c + adds r2, r1, r0 + ldr r0, =0x02039d14 + str r0, [r2] + ldr r2, =0x00002187 + adds r1, r2 + movs r2, 0 + strb r2, [r1] + ldr r0, [r3] + ldr r4, =0x00002186 + adds r0, r4 + strb r2, [r0] + ldr r0, [r3] + ldr r1, =0x00002188 + adds r0, r1 + strb r2, [r0] + b _080CE8CA + .pool +_080CE838: + ldr r0, =0x02039d78 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + bne _080CE894 + ldr r4, =0x02039d08 + ldr r1, [r4] + ldr r0, =0x0000218c + adds r2, r1, r0 + ldr r0, =0x020244ec + str r0, [r2] + ldr r0, =0x02039d79 + ldrb r0, [r0] + ldr r2, =0x00002187 + adds r1, r2 + strb r0, [r1] + bl sub_80C70C4 + ldr r1, [r4] + subs r0, 0x1 + ldr r2, =0x00002186 + adds r1, r2 + strb r0, [r1] + ldr r0, [r4] + ldr r4, =0x00002188 + adds r0, r4 + strb r5, [r0] + b _080CE8CA + .pool +_080CE894: + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl get_pokemon_by_box_and_pos + ldr r3, =0x02039d08 + ldr r2, [r3] + ldr r4, =0x0000218c + adds r1, r2, r4 + str r0, [r1] + ldr r0, =0x02039d79 + ldrb r0, [r0] + ldr r1, =0x00002187 + adds r2, r1 + strb r0, [r2] + ldr r0, [r3] + ldr r2, =0x00002186 + adds r0, r2 + movs r1, 0x1D + strb r1, [r0] + ldr r0, [r3] + subs r4, 0x4 + adds r0, r4 + movs r1, 0x2 + strb r1, [r0] +_080CE8CA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CE7E8 + + thumb_func_start sub_80CE8E4 +sub_80CE8E4: @ 80CE8E4 + push {lr} + ldr r0, =0x02039d7a + ldrb r0, [r0] + cmp r0, 0 + beq _080CE8F8 + bl sub_80CE790 + b _080CE900 + .pool +_080CE8F8: + ldr r0, =0x02039d79 + ldr r1, =0x0203cf20 + ldrb r1, [r1] + strb r1, [r0] +_080CE900: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CE8E4 + + thumb_func_start party_compaction +party_compaction: @ 80CE90C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r7, =0x0000ffff + movs r6, 0 + movs r5, 0 + movs r0, 0x64 + mov r9, r0 + ldr r1, =0x020244ec + mov r8, r1 + subs r0, 0x65 + mov r10, r0 +_080CE928: + mov r0, r9 + muls r0, r6 + mov r1, r8 + adds r4, r0, r1 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + cmp r0, 0 + beq _080CE960 + cmp r6, r5 + beq _080CE950 + mov r0, r9 + muls r0, r5 + add r0, r8 + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy +_080CE950: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + b _080CE96A + .pool +_080CE960: + lsls r0, r7, 16 + asrs r0, 16 + cmp r0, r10 + bne _080CE96A + adds r7, r6, 0 +_080CE96A: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x5 + bls _080CE928 + lsls r7, 16 + cmp r5, 0x5 + bhi _080CE992 + movs r6, 0x64 + ldr r4, =0x020244ec +_080CE97E: + adds r0, r5, 0 + muls r0, r6 + adds r0, r4 + bl zero_pokemon_struct + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x5 + bls _080CE97E +_080CE992: + asrs r0, r7, 16 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end party_compaction + + thumb_func_start sub_80CE9A8 +sub_80CE9A8: @ 80CE9A8 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + strb r0, [r1] + ldr r2, =0x02039d08 + ldr r1, [r2] + ldr r3, =0x00000ceb + adds r1, r3 + strb r0, [r1] + ldr r0, =0x02039d7a + ldrb r0, [r0] + cmp r0, 0 + beq _080CE9E8 + ldr r0, [r2] + ldr r1, =0x000020a4 + adds r0, r1 + movs r1, 0x8 + mov r2, sp + bl pokemon_setattr + b _080CEA1C + .pool +_080CE9E8: + ldr r4, =0x02039d78 + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x1 + bne _080CEA08 + ldr r0, =0x02039d79 + movs r1, 0 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x8 + mov r2, sp + bl pokemon_setattr +_080CEA08: + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + bne _080CEA1C + ldr r0, =0x02039d79 + ldrb r0, [r0] + movs r1, 0x8 + mov r2, sp + bl set_pokemon_data_from_selected_box +_080CEA1C: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CE9A8 + + thumb_func_start sub_80CEA30 +sub_80CEA30: @ 80CEA30 + push {lr} + ldr r0, =0x02039d78 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + bne _080CEA64 + ldr r0, =0x02039d7a + ldrb r0, [r0] + cmp r0, 0 + bne _080CEA64 + ldr r0, =0x02039d79 + ldrb r0, [r0] + bl sub_80C7050 + lsls r0, 24 + cmp r0, 0 + bne _080CEA64 + movs r0, 0x1 + b _080CEA66 + .pool +_080CEA64: + movs r0, 0 +_080CEA66: + pop {r1} + bx r1 + thumb_func_end sub_80CEA30 + + thumb_func_start sub_80CEA6C +sub_80CEA6C: @ 80CEA6C + push {lr} + ldr r0, =0x02039d7a + ldrb r0, [r0] + cmp r0, 0 + beq _080CEAC8 + ldr r0, =0x02039d78 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + bne _080CEAAC + ldr r0, =0x02039d79 + ldrb r0, [r0] + bl sub_80C7050 + lsls r0, 24 + cmp r0, 0 + bne _080CEAAC + ldr r0, =0x02039d08 + ldr r1, [r0] + ldr r2, =0x00000ced + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080CEAC8 + ldr r2, =0x000020a4 + adds r0, r1, r2 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _080CEAC8 +_080CEAAC: + movs r0, 0x1 + b _080CEACA + .pool +_080CEAC8: + movs r0, 0 +_080CEACA: + pop {r1} + bx r1 + thumb_func_end sub_80CEA6C + + thumb_func_start sub_80CEAD0 +sub_80CEAD0: @ 80CEAD0 + ldr r0, =0x02039d7a + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80CEAD0 + + thumb_func_start sub_80CEADC +sub_80CEADC: @ 80CEADC + push {lr} + movs r1, 0 + ldr r0, =0x02039d78 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x2 + bne _080CEAEE + movs r1, 0x1 +_080CEAEE: + adds r0, r1, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80CEADC + + thumb_func_start sub_80CEAF8 +sub_80CEAF8: @ 80CEAF8 + push {lr} + movs r1, 0 + ldr r0, =0x02039d78 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x3 + bne _080CEB16 + ldr r0, =0x02039d79 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + bne _080CEB16 + movs r1, 0x1 +_080CEB16: + adds r0, r1, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80CEAF8 + + thumb_func_start sub_80CEB24 +sub_80CEB24: @ 80CEB24 + push {lr} + movs r1, 0 + ldr r0, =0x02039d78 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bne _080CEB36 + movs r1, 0x1 +_080CEB36: + adds r0, r1, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80CEB24 + + thumb_func_start sub_80CEB40 +sub_80CEB40: @ 80CEB40 + push {r4,lr} + ldr r0, =0x02039d08 + ldr r1, [r0] + movs r2, 0 + ldr r3, =0x02039d7a + ldrb r0, [r3] + cmp r0, 0 + bne _080CEB52 + movs r2, 0x1 +_080CEB52: + ldr r4, =0x00000cea + adds r0, r1, r4 + strb r2, [r0] + ldrb r0, [r3] + cmp r0, 0 + bne _080CEBD0 + ldr r0, =0x02039d78 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + beq _080CEB8A + cmp r0, 0x1 + bgt _080CEB84 + cmp r0, 0 + beq _080CEBBA + b _080CEBD0 + .pool +_080CEB84: + cmp r0, 0x3 + bgt _080CEBD0 + b _080CEBB0 +_080CEB8A: + ldr r1, =0x02039d79 + movs r0, 0 + ldrsb r0, [r1, r0] + cmp r0, 0x5 + bgt _080CEBB0 + adds r1, r0, 0 + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0 + bl sub_80CEC00 + b _080CEBD0 + .pool +_080CEBB0: + movs r0, 0 + movs r1, 0x2 + bl sub_80CEC00 + b _080CEBD0 +_080CEBBA: + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02039d79 + ldrb r1, [r1] + bl get_pokemon_by_box_and_pos + movs r1, 0x1 + bl sub_80CEC00 +_080CEBD0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CEB40 + + thumb_func_start sub_80CEBDC +sub_80CEBDC: @ 80CEBDC + push {lr} + ldr r0, =0x02039d7a + ldrb r0, [r0] + cmp r0, 0 + beq _080CEBF8 + ldr r0, =0x02039d14 + movs r1, 0 + bl sub_80CEC00 + b _080CEBFC + .pool +_080CEBF8: + bl sub_80CEB40 +_080CEBFC: + pop {r0} + bx r0 + thumb_func_end sub_80CEBDC + + thumb_func_start sub_80CEC00 +sub_80CEC00: @ 80CEC00 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r5, r1, 0 + ldr r0, =0x02039d08 + mov r8, r0 + ldr r1, [r0] + ldr r3, =0x00000ce6 + adds r2, r1, r3 + movs r0, 0 + strh r0, [r2] + mov r9, r0 + mov r10, r0 + cmp r5, 0 + bne _080CED18 + adds r6, r4, 0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + mov r2, r8 + ldr r1, [r2] + ldr r3, =0x00000ce4 + adds r1, r3 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + bne _080CEC44 + b _080CEE34 +_080CEC44: + adds r0, r4, 0 + movs r1, 0x4 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + cmp r0, 0 + beq _080CEC74 + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x00000ced + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] + b _080CEC86 + .pool +_080CEC74: + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + mov r3, r8 + ldr r1, [r3] + ldr r2, =0x00000ced + adds r1, r2 + strb r0, [r1] +_080CEC86: + ldr r4, =0x02039d08 + ldr r2, [r4] + ldr r5, =0x00000cee + adds r2, r5 + adds r0, r6, 0 + movs r1, 0x2 + bl pokemon_getattr + ldr r0, [r4] + adds r0, r5 + bl GetStringEnd_Limit7 + adds r0, r6, 0 + movs r1, 0x38 + bl pokemon_getattr + ldr r1, [r4] + ldr r3, =0x00000cec + adds r1, r3 + strb r0, [r1] + adds r0, r6, 0 + movs r1, 0x8 + bl pokemon_getattr + ldr r1, [r4] + ldr r2, =0x00000ceb + adds r1, r2 + strb r0, [r1] + adds r0, r6, 0 + movs r1, 0 + bl pokemon_getattr + ldr r1, [r4] + movs r3, 0xCE + lsls r3, 4 + adds r1, r3 + str r0, [r1] + adds r0, r6, 0 + bl pokemon_get_pal + ldr r1, [r4] + ldr r2, =0x00000cdc + adds r1, r2 + str r0, [r1] + adds r0, r6, 0 + bl pokemon_get_gender + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + adds r0, r6, 0 + movs r1, 0xC + bl pokemon_getattr + ldr r1, [r4] + ldr r3, =0x00000ce6 + adds r1, r3 + strh r0, [r1] + b _080CEE26 + .pool +_080CED18: + cmp r5, 0x1 + beq _080CED1E + b _080CEE1C +_080CED1E: + adds r7, r4, 0 + adds r0, r7, 0 + movs r1, 0x41 + bl pokemon_getattr_encrypted + mov r2, r8 + ldr r1, [r2] + ldr r3, =0x00000ce4 + adds r1, r3 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + bne _080CED3A + b _080CEE34 +_080CED3A: + adds r0, r7, 0 + movs r1, 0x1 + bl pokemon_getattr_encrypted + mov r9, r0 + adds r0, r7, 0 + movs r1, 0x4 + bl pokemon_getattr_encrypted + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + cmp r0, 0 + beq _080CED6C + mov r1, r8 + ldr r0, [r1] + ldr r2, =0x00000ced + adds r0, r2 + strb r5, [r0] + b _080CED7E + .pool +_080CED6C: + adds r0, r7, 0 + movs r1, 0x2D + bl pokemon_getattr_encrypted + mov r3, r8 + ldr r1, [r3] + ldr r2, =0x00000ced + adds r1, r2 + strb r0, [r1] +_080CED7E: + ldr r5, =0x02039d08 + ldr r2, [r5] + ldr r4, =0x00000cee + adds r2, r4 + adds r0, r7, 0 + movs r1, 0x2 + bl pokemon_getattr_encrypted + ldr r0, [r5] + adds r0, r4 + bl GetStringEnd_Limit7 + adds r0, r7, 0 + bl sub_80690C0 + ldr r1, [r5] + ldr r3, =0x00000cec + adds r1, r3 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0x8 + bl pokemon_getattr_encrypted + ldr r1, [r5] + ldr r2, =0x00000ceb + adds r1, r2 + strb r0, [r1] + adds r0, r7, 0 + movs r1, 0 + bl pokemon_getattr_encrypted + adds r2, r0, 0 + ldr r1, [r5] + movs r6, 0xCE + lsls r6, 4 + adds r0, r1, r6 + str r2, [r0] + subs r4, 0xA + adds r1, r4 + ldrh r0, [r1] + mov r1, r9 + bl species_and_otid_get_pal + ldr r1, [r5] + ldr r3, =0x00000cdc + adds r2, r1, r3 + str r0, [r2] + adds r4, r1, r4 + ldrh r0, [r4] + adds r1, r6 + ldr r1, [r1] + bl pokemon_species_get_gender_info + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + adds r0, r7, 0 + movs r1, 0xC + bl pokemon_getattr_encrypted + ldr r1, [r5] + ldr r2, =0x00000ce6 + adds r1, r2 + strh r0, [r1] + b _080CEE26 + .pool +_080CEE1C: + ldr r3, =0x00000ce4 + adds r0, r1, r3 + mov r1, r9 + strh r1, [r0] + strh r1, [r2] +_080CEE26: + ldr r0, =0x02039d08 + ldr r1, [r0] + ldr r2, =0x00000ce4 + adds r0, r1, r2 + ldrh r2, [r0] + cmp r2, 0 + bne _080CEE94 +_080CEE34: + ldr r4, =0x02039d08 + ldr r0, [r4] + ldr r3, =0x00000cee + adds r0, r3 + movs r1, 0 + movs r2, 0x5 + bl RepeatChar + ldr r0, [r4] + ldr r1, =0x00000cf9 + adds r0, r1 + movs r1, 0 + movs r2, 0x8 + bl RepeatChar + ldr r0, [r4] + ldr r2, =0x00000d1d + adds r0, r2 + movs r1, 0 + movs r2, 0x8 + bl RepeatChar + ldr r0, [r4] + ldr r3, =0x00000d41 + adds r0, r3 + movs r1, 0 + movs r2, 0x8 + bl RepeatChar + ldr r0, [r4] + ldr r1, =0x00000d65 + adds r0, r1 + b _080CEEF2 + .pool +_080CEE94: + ldr r3, =0x00000ced + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _080CEF14 + mov r0, r10 + cmp r0, 0 + beq _080CEEC0 + ldr r2, =0x00000cf9 + adds r0, r1, r2 + adds r3, 0x1 + adds r1, r3 + movs r2, 0 + movs r3, 0x5 + bl CopyStringPadded + b _080CEECE + .pool +_080CEEC0: + ldr r2, =0x00000cf9 + adds r0, r1, r2 + ldr r1, =gUnknown_085E8264 + movs r2, 0 + movs r3, 0x8 + bl CopyStringPadded +_080CEECE: + ldr r4, =0x02039d08 + ldr r0, [r4] + ldr r3, =0x00000d1d + adds r0, r3 + movs r1, 0 + movs r2, 0x8 + bl RepeatChar + ldr r0, [r4] + ldr r1, =0x00000d41 + adds r0, r1 + movs r1, 0 + movs r2, 0x8 + bl RepeatChar + ldr r0, [r4] + ldr r2, =0x00000d65 + adds r0, r2 +_080CEEF2: + movs r1, 0 + movs r2, 0x8 + bl RepeatChar + b _080CF0B8 + .pool +_080CEF14: + cmp r2, 0x1D + beq _080CEF1C + cmp r2, 0x20 + bne _080CEF20 +_080CEF1C: + movs r3, 0xFF + mov r9, r3 +_080CEF20: + ldr r4, =0x02039d08 + ldr r1, [r4] + ldr r2, =0x00000cf9 + adds r0, r1, r2 + ldr r3, =0x00000cee + adds r1, r3 + movs r2, 0 + movs r3, 0x5 + bl CopyStringPadded + ldr r1, [r4] + ldr r0, =0x00000d1d + adds r2, r1, r0 + movs r0, 0xBA + strb r0, [r2] + ldr r3, =0x00000d1e + adds r2, r1, r3 + ldr r0, [r4] + ldr r1, =0x00000ce4 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r2, 0 + movs r2, 0 + movs r3, 0x5 + bl CopyStringPadded + ldr r4, [r4] + ldr r3, =0x00000d41 + adds r2, r4, r3 + movs r0, 0xFC + strb r0, [r2] + ldr r0, =0x00000d42 + adds r2, r4, r0 + movs r0, 0x4 + strb r0, [r2] + ldr r1, =0x00000d43 + adds r2, r4, r1 + mov r3, r9 + cmp r3, 0 + beq _080CEFD4 + cmp r3, 0xFE + beq _080CF000 + movs r0, 0x2 + strb r0, [r2] + ldr r0, =0x00000d44 + adds r2, r4, r0 + movs r0, 0x1 + strb r0, [r2] + adds r1, 0x2 + adds r2, r4, r1 + movs r0, 0x3 + strb r0, [r2] + ldr r3, =0x00000d46 + adds r2, r4, r3 + movs r0, 0x77 + strb r0, [r2] + ldr r0, =0x00000d47 + adds r2, r4, r0 + b _080CF020 + .pool +_080CEFD4: + strb r0, [r2] + ldr r1, =0x00000d44 + adds r2, r4, r1 + movs r0, 0x1 + strb r0, [r2] + ldr r3, =0x00000d45 + adds r2, r4, r3 + movs r0, 0x5 + strb r0, [r2] + ldr r0, =0x00000d46 + adds r2, r4, r0 + movs r0, 0xB5 + strb r0, [r2] + adds r1, 0x3 + adds r2, r4, r1 + b _080CF020 + .pool +_080CF000: + movs r0, 0x6 + strb r0, [r2] + ldr r3, =0x00000d44 + adds r2, r4, r3 + movs r0, 0x1 + strb r0, [r2] + ldr r0, =0x00000d45 + adds r2, r4, r0 + movs r0, 0x7 + strb r0, [r2] + ldr r1, =0x00000d46 + adds r2, r4, r1 + movs r0, 0xB6 + strb r0, [r2] + adds r3, 0x3 + adds r2, r4, r3 +_080CF020: + movs r0, 0xFC + strb r0, [r2] + adds r2, 0x1 + movs r0, 0x4 + strb r0, [r2] + adds r2, 0x1 + movs r0, 0x2 + strb r0, [r2] + adds r2, 0x1 + movs r0, 0x1 + strb r0, [r2] + adds r2, 0x1 + movs r0, 0x3 + strb r0, [r2] + adds r2, 0x1 + movs r5, 0 + strb r5, [r2] + adds r2, 0x1 + movs r0, 0xF9 + strb r0, [r2] + adds r2, 0x1 + movs r0, 0x5 + strb r0, [r2] + adds r2, 0x1 + ldr r4, =0x02039d08 + ldr r0, [r4] + ldr r1, =0x00000cec + adds r0, r1 + ldrb r1, [r0] + adds r0, r2, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + adds r2, r0, 0 + strb r5, [r2] + movs r0, 0xFF + strb r0, [r2, 0x1] + ldr r4, [r4] + ldr r2, =0x00000ce6 + adds r1, r4, r2 + ldrh r0, [r1] + cmp r0, 0 + beq _080CF0AC + ldr r3, =0x00000d65 + adds r4, r3 + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x8 + bl CopyStringPadded + b _080CF0B8 + .pool +_080CF0AC: + ldr r1, =0x00000d65 + adds r0, r4, r1 + movs r1, 0 + movs r2, 0x8 + bl RepeatChar +_080CF0B8: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CEC00 + + thumb_func_start sub_80CF0CC +sub_80CF0CC: @ 80CF0CC + push {lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x000021ff + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080CF0F4 + cmp r0, 0x1 + ble _080CF0E4 + cmp r0, 0x2 + beq _080CF0FA +_080CF0E4: + bl sub_80CF108 + b _080CF0FE + .pool +_080CF0F4: + bl sub_80CF374 + b _080CF0FE +_080CF0FA: + bl sub_80CF4B0 +_080CF0FE: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80CF0CC + + thumb_func_start sub_80CF108 +sub_80CF108: @ 80CF108 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x02039d78 + ldrb r0, [r0] + mov r8, r0 + ldr r2, =0x02039d79 + ldrb r4, [r2] + ldr r5, =0x02039d08 + ldr r0, [r5] + ldr r1, =0x00000cd2 + mov r10, r1 + add r0, r10 + movs r1, 0 + strb r1, [r0] + ldr r0, [r5] + ldr r7, =0x00000cd3 + adds r0, r7 + strb r1, [r0] + ldr r0, [r5] + ldr r3, =0x00000cd7 + mov r9, r3 + add r0, r9 + strb r1, [r0] + ldr r6, =0x030022c0 + ldrh r1, [r6, 0x30] + movs r0, 0x40 + ands r0, r1 + adds r3, r2, 0 + cmp r0, 0 + beq _080CF14C + b _080CF33C +_080CF14C: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080CF1A8 + movs r6, 0x1 + lsls r0, r4, 24 + movs r1, 0xC0 + lsls r1, 19 + adds r0, r1 + lsrs r4, r0, 24 + asrs r0, 24 + cmp r0, 0x1D + bgt _080CF168 + b _080CF358 +_080CF168: + movs r2, 0x3 + mov r8, r2 + subs r0, 0x1E + lsls r0, 24 + asrs r0, 24 + movs r1, 0x3 + bl __divsi3 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, [r5] + add r0, r10 + strb r6, [r0] + ldr r0, [r5] + add r0, r9 + strb r6, [r0] + b _080CF358 + .pool +_080CF1A8: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080CF1DE + movs r6, 0x1 + movs r0, 0 + ldrsb r0, [r3, r0] + movs r1, 0x6 + bl __modsi3 + lsls r0, 24 + cmp r0, 0 + beq _080CF1CA + lsls r0, r4, 24 + movs r3, 0xFF + lsls r3, 24 + b _080CF34C +_080CF1CA: + ldr r0, [r5] + adds r0, r7 + movs r1, 0xFF + strb r1, [r0] + lsls r0, r4, 24 + movs r1, 0xA0 + lsls r1, 19 + adds r0, r1 + lsrs r4, r0, 24 + b _080CF358 +_080CF1DE: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080CF212 + movs r6, 0x1 + movs r0, 0 + ldrsb r0, [r3, r0] + adds r0, 0x1 + movs r1, 0x6 + bl __modsi3 + cmp r0, 0 + beq _080CF204 + lsls r0, r4, 24 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r4, r0, 24 + b _080CF358 +_080CF204: + ldr r0, [r5] + adds r0, r7 + strb r6, [r0] + lsls r0, r4, 24 + movs r3, 0xFB + lsls r3, 24 + b _080CF34C +_080CF212: + ldrh r1, [r6, 0x2E] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080CF220 + movs r6, 0x1 + b _080CF352 +_080CF220: + movs r4, 0x1 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080CF2E4 + bl sub_80CFA5C + lsls r0, 24 + cmp r0, 0 + beq _080CF2E4 + ldr r0, =0x02039d7d + ldrb r0, [r0] + cmp r0, 0 + bne _080CF244 + movs r0, 0x8 + b _080CF366 + .pool +_080CF244: + ldr r1, [r5] + ldrb r0, [r1, 0x1] + cmp r0, 0x2 + bne _080CF254 + ldr r0, =0x02039d7a + ldrb r0, [r0] + cmp r0, 0x1 + bne _080CF2D4 +_080CF254: + movs r0, 0 + bl sub_80CFF98 + subs r0, 0x1 + lsls r0, 24 + asrs r0, 24 + cmp r0, 0xE + bhi _080CF2E4 + lsls r0, 2 + ldr r1, =_080CF278 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080CF278: + .4byte _080CF2B4 + .4byte _080CF2B8 + .4byte _080CF2BC + .4byte _080CF2C0 + .4byte _080CF2C4 + .4byte _080CF2E4 + .4byte _080CF2E4 + .4byte _080CF2E4 + .4byte _080CF2E4 + .4byte _080CF2E4 + .4byte _080CF2E4 + .4byte _080CF2C8 + .4byte _080CF2CC + .4byte _080CF2E4 + .4byte _080CF2D0 +_080CF2B4: + movs r0, 0xB + b _080CF366 +_080CF2B8: + movs r0, 0xC + b _080CF366 +_080CF2BC: + movs r0, 0xD + b _080CF366 +_080CF2C0: + movs r0, 0xE + b _080CF366 +_080CF2C4: + movs r0, 0xF + b _080CF366 +_080CF2C8: + movs r0, 0x10 + b _080CF366 +_080CF2CC: + movs r0, 0x11 + b _080CF366 +_080CF2D0: + movs r0, 0x12 + b _080CF366 +_080CF2D4: + ldr r2, =0x000021ff + adds r0, r1, r2 + strb r4, [r0] + movs r0, 0x14 + b _080CF366 + .pool +_080CF2E4: + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080CF2F8 + movs r0, 0x13 + b _080CF366 + .pool +_080CF2F8: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x1 + bne _080CF326 + ldrh r1, [r2, 0x2C] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _080CF318 + movs r0, 0xA + b _080CF366 + .pool +_080CF318: + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _080CF326 + movs r0, 0x9 + b _080CF366 +_080CF326: + ldrh r1, [r2, 0x2E] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080CF338 + bl sub_80CFDC4 + movs r0, 0 + b _080CF366 +_080CF338: + movs r6, 0 + b _080CF364 +_080CF33C: + movs r6, 0x1 + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r0, 0x5 + ble _080CF352 + lsls r0, r4, 24 + movs r3, 0xFA + lsls r3, 24 +_080CF34C: + adds r0, r3 + lsrs r4, r0, 24 + b _080CF358 +_080CF352: + movs r0, 0x2 + mov r8, r0 + movs r4, 0 +_080CF358: + cmp r6, 0 + beq _080CF364 + mov r0, r8 + adds r1, r4, 0 + bl sub_80CD894 +_080CF364: + adds r0, r6, 0 +_080CF366: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80CF108 + + thumb_func_start sub_80CF374 +sub_80CF374: @ 80CF374 + push {r4,lr} + ldr r1, =0x030022c0 + ldrh r0, [r1, 0x2C] + movs r4, 0x1 + ands r4, r0 + cmp r4, 0 + beq _080CF428 + ldrh r1, [r1, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080CF3AC + ldr r4, =0x02039d79 + movs r0, 0 + ldrsb r0, [r4, r0] + movs r1, 0x6 + bl __divsi3 + lsls r0, 24 + cmp r0, 0 + beq _080CF420 + ldrb r1, [r4] + subs r1, 0x6 + b _080CF40E + .pool +_080CF3AC: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080CF3CC + ldr r1, =0x02039d79 + movs r0, 0 + ldrsb r0, [r1, r0] + adds r0, 0x6 + cmp r0, 0x1D + bgt _080CF420 + ldrb r1, [r1] + adds r1, 0x6 + b _080CF40E + .pool +_080CF3CC: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080CF3F0 + ldr r4, =0x02039d79 + movs r0, 0 + ldrsb r0, [r4, r0] + movs r1, 0x6 + bl __modsi3 + lsls r0, 24 + cmp r0, 0 + beq _080CF420 + ldrb r1, [r4] + subs r1, 0x1 + b _080CF40E + .pool +_080CF3F0: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080CF424 + ldr r4, =0x02039d79 + movs r0, 0 + ldrsb r0, [r4, r0] + adds r0, 0x1 + movs r1, 0x6 + bl __modsi3 + cmp r0, 0 + beq _080CF420 + ldrb r1, [r4] + adds r1, 0x1 +_080CF40E: + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_80CD894 + movs r0, 0x15 + b _080CF49C + .pool +_080CF420: + movs r0, 0x18 + b _080CF49C +_080CF424: + movs r0, 0 + b _080CF49C +_080CF428: + bl sub_80D0BA4 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02039d79 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + cmp r0, r1 + beq _080CF47C + ldr r2, =0x02039d7a + ldr r0, =0x02039d08 + ldr r1, [r0] + ldr r3, =0x00000ce4 + adds r0, r1, r3 + ldrh r0, [r0] + negs r0, r0 + lsrs r0, 31 + strb r0, [r2] + ldr r0, =0x000021ff + adds r1, r0 + movs r0, 0x2 + strb r0, [r1] + bl get_preferred_box + ldr r1, =0x02039d7b + strb r0, [r1] + movs r0, 0x17 + b _080CF49C + .pool +_080CF47C: + ldr r1, =0x02039d08 + ldr r0, [r1] + ldr r2, =0x000021ff + adds r0, r2 + strb r4, [r0] + ldr r0, [r1] + ldr r3, =0x00000cb8 + adds r0, r3 + ldr r1, [r0] + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + movs r0, 0x16 +_080CF49C: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80CF374 + + thumb_func_start sub_80CF4B0 +sub_80CF4B0: @ 80CF4B0 + push {r4,lr} + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080CF4DC + movs r0, 0 + bl sub_80D0580 + lsls r0, 24 + cmp r0, 0 + beq _080CF588 + ldr r0, =0x02039d79 + ldrb r1, [r0] + subs r1, 0x6 + b _080CF53A + .pool +_080CF4DC: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080CF4FC + movs r0, 0x1 + bl sub_80D0580 + lsls r0, 24 + cmp r0, 0 + beq _080CF588 + ldr r0, =0x02039d79 + ldrb r1, [r0] + adds r1, 0x6 + b _080CF53A + .pool +_080CF4FC: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080CF51C + movs r0, 0x2 + bl sub_80D0580 + lsls r0, 24 + cmp r0, 0 + beq _080CF5A2 + ldr r0, =0x02039d79 + ldrb r1, [r0] + subs r1, 0x1 + b _080CF53A + .pool +_080CF51C: + movs r0, 0x10 + ands r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _080CF54C + movs r0, 0x3 + bl sub_80D0580 + lsls r0, 24 + cmp r0, 0 + beq _080CF5B6 + ldr r0, =0x02039d79 + ldrb r1, [r0] + adds r1, 0x1 +_080CF53A: + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_80CD894 + movs r0, 0x19 + b _080CF5BC + .pool +_080CF54C: + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080CF580 + bl sub_80D0BC0 + lsls r0, 24 + cmp r0, 0 + beq _080CF588 + ldr r0, =0x02039d7a + strb r4, [r0] + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x000021ff + adds r0, r1 + strb r4, [r0] + movs r0, 0x1A + b _080CF5BC + .pool +_080CF580: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080CF58C +_080CF588: + movs r0, 0x18 + b _080CF5BC +_080CF58C: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x1 + bne _080CF5BA + ldrh r1, [r2, 0x2C] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _080CF5AC +_080CF5A2: + movs r0, 0xA + b _080CF5BC + .pool +_080CF5AC: + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _080CF5BA +_080CF5B6: + movs r0, 0x9 + b _080CF5BC +_080CF5BA: + movs r0, 0 +_080CF5BC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80CF4B0 + + thumb_func_start sub_80CF5C4 +sub_80CF5C4: @ 80CF5C4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =0x02039d78 + ldrb r0, [r0] + mov r9, r0 + ldr r6, =0x02039d79 + ldrb r4, [r6] + ldr r2, =0x02039d08 + ldr r0, [r2] + ldr r1, =0x00000cd3 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + ldr r3, =0x00000cd2 + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + adds r3, 0x5 + adds r0, r3 + strb r1, [r0] + mov r8, r1 + movs r7, 0 + ldr r1, =0x030022c0 + ldrh r3, [r1, 0x30] + movs r0, 0x40 + ands r0, r3 + adds r5, r6, 0 + mov r12, r1 + cmp r0, 0 + beq _080CF608 + b _080CF7A8 +_080CF608: + movs r0, 0x80 + ands r0, r3 + cmp r0, 0 + beq _080CF64C + lsls r0, r4, 24 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r4, r0, 24 + asrs r0, 24 + cmp r0, 0x6 + ble _080CF622 + movs r4, 0 +_080CF622: + lsls r0, r4, 24 + asrs r0, 24 + movs r1, 0 + ldrsb r1, [r5, r1] + cmp r0, r1 + bne _080CF630 + b _080CF7C6 +_080CF630: + movs r7, 0x1 + b _080CF7CA + .pool +_080CF64C: + movs r0, 0x20 + ands r0, r3 + cmp r0, 0 + beq _080CF670 + ldrb r1, [r5] + movs r0, 0 + ldrsb r0, [r5, r0] + cmp r0, 0 + beq _080CF670 + movs r7, 0x1 + ldr r0, [r2] + ldr r2, =0x00000cd6 + adds r0, r2 + strb r1, [r0] + movs r4, 0 + b _080CF7C6 + .pool +_080CF670: + mov r3, r12 + ldrh r1, [r3, 0x30] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080CF69E + movs r0, 0 + ldrsb r0, [r5, r0] + cmp r0, 0 + bne _080CF694 + movs r7, 0x1 + ldr r0, [r2] + ldr r1, =0x00000cd6 + adds r0, r1 + ldrb r4, [r0] + b _080CF7C6 + .pool +_080CF694: + movs r7, 0x6 + movs r2, 0 + mov r9, r2 + movs r4, 0 + b _080CF7C6 +_080CF69E: + mov r3, r12 + ldrh r1, [r3, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080CF75C + movs r0, 0 + ldrsb r0, [r5, r0] + cmp r0, 0x6 + bne _080CF6C4 + ldr r0, [r2] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bne _080CF6BE + movs r0, 0x4 + b _080CF7D8 +_080CF6BE: + movs r0, 0x1 + mov r8, r0 + b _080CF75C +_080CF6C4: + bl sub_80CFA5C + lsls r0, 24 + cmp r0, 0 + beq _080CF75C + ldr r0, =0x02039d7d + ldrb r0, [r0] + cmp r0, 0 + bne _080CF6E0 + movs r0, 0x8 + b _080CF7D8 + .pool +_080CF6E0: + movs r0, 0 + bl sub_80CFF98 + subs r0, 0x1 + lsls r0, 24 + asrs r0, 24 + cmp r0, 0xE + bhi _080CF75C + lsls r0, 2 + ldr r1, =_080CF700 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080CF700: + .4byte _080CF73C + .4byte _080CF740 + .4byte _080CF744 + .4byte _080CF748 + .4byte _080CF74C + .4byte _080CF75C + .4byte _080CF75C + .4byte _080CF75C + .4byte _080CF75C + .4byte _080CF75C + .4byte _080CF75C + .4byte _080CF750 + .4byte _080CF754 + .4byte _080CF75C + .4byte _080CF758 +_080CF73C: + movs r0, 0xB + b _080CF7D8 +_080CF740: + movs r0, 0xC + b _080CF7D8 +_080CF744: + movs r0, 0xD + b _080CF7D8 +_080CF748: + movs r0, 0xE + b _080CF7D8 +_080CF74C: + movs r0, 0xF + b _080CF7D8 +_080CF750: + movs r0, 0x10 + b _080CF7D8 +_080CF754: + movs r0, 0x11 + b _080CF7D8 +_080CF758: + movs r0, 0x12 + b _080CF7D8 +_080CF75C: + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2E] + movs r0, 0x2 + ands r0, r1 + mov r12, r2 + cmp r0, 0 + beq _080CF784 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bne _080CF780 + movs r0, 0x13 + b _080CF7D8 + .pool +_080CF780: + movs r1, 0x1 + mov r8, r1 +_080CF784: + mov r2, r8 + cmp r2, 0 + beq _080CF794 + movs r7, 0x6 + movs r3, 0 + mov r9, r3 + movs r4, 0 + b _080CF7C6 +_080CF794: + mov r0, r12 + ldrh r1, [r0, 0x2E] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080CF7C6 + bl sub_80CFDC4 + movs r0, 0 + b _080CF7D8 +_080CF7A8: + lsls r0, r4, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r4, r0, 24 + cmp r0, 0 + bge _080CF7B8 + movs r4, 0x6 +_080CF7B8: + lsls r0, r4, 24 + asrs r0, 24 + movs r1, 0 + ldrsb r1, [r6, r1] + cmp r0, r1 + beq _080CF7C6 + movs r7, 0x1 +_080CF7C6: + cmp r7, 0 + beq _080CF7D6 +_080CF7CA: + cmp r7, 0x6 + beq _080CF7D6 + mov r0, r9 + adds r1, r4, 0 + bl sub_80CD894 +_080CF7D6: + adds r0, r7, 0 +_080CF7D8: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80CF5C4 + + thumb_func_start sub_80CF7E4 +sub_80CF7E4: @ 80CF7E4 + push {r4-r6,lr} + ldr r3, =0x02039d08 + ldr r0, [r3] + ldr r1, =0x00000cd3 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r3] + ldr r2, =0x00000cd2 + adds r0, r2 + strb r1, [r0] + ldr r0, [r3] + ldr r5, =0x00000cd7 + adds r0, r5 + strb r1, [r0] + ldr r1, =0x030022c0 + ldrh r2, [r1, 0x30] + movs r0, 0x40 + ands r0, r2 + cmp r0, 0 + bne _080CF8AA + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _080CF834 + movs r4, 0x1 + movs r1, 0 + movs r6, 0x2 + b _080CF8B6 + .pool +_080CF834: + ldrh r2, [r1, 0x2C] + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + bne _080CF85A + movs r0, 0x10 + ands r0, r2 + cmp r0, 0 + bne _080CF86E + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x13] + cmp r0, 0x1 + bne _080CF872 + movs r0, 0x80 + lsls r0, 2 + ands r0, r2 + cmp r0, 0 + beq _080CF864 +_080CF85A: + movs r0, 0xA + b _080CF8D2 + .pool +_080CF864: + movs r0, 0x80 + lsls r0, 1 + ands r0, r2 + cmp r0, 0 + beq _080CF872 +_080CF86E: + movs r0, 0x9 + b _080CF8D2 +_080CF872: + ldrh r1, [r1, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080CF88A + movs r0, 0 + bl sub_80CD1A8 + bl sub_80CFA38 + movs r0, 0x7 + b _080CF8D2 +_080CF88A: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080CF896 + movs r0, 0x13 + b _080CF8D2 +_080CF896: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080CF8A6 + bl sub_80CFDC4 + movs r0, 0 + b _080CF8D2 +_080CF8A6: + movs r4, 0 + b _080CF8D0 +_080CF8AA: + movs r4, 0x1 + movs r1, 0x3 + movs r6, 0 + ldr r0, [r3] + adds r0, r5 + strb r4, [r0] +_080CF8B6: + cmp r4, 0 + beq _080CF8D0 + lsls r5, r1, 24 + cmp r1, 0x2 + beq _080CF8C6 + movs r0, 0 + bl sub_80CD1A8 +_080CF8C6: + lsrs r0, r5, 24 + lsls r1, r6, 24 + lsrs r1, 24 + bl sub_80CD894 +_080CF8D0: + adds r0, r4, 0 +_080CF8D2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80CF7E4 + + thumb_func_start sub_80CF8D8 +sub_80CF8D8: @ 80CF8D8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x02039d78 + ldrb r0, [r0] + mov r8, r0 + ldr r0, =0x02039d79 + mov r12, r0 + ldrb r2, [r0] + ldr r3, =0x02039d08 + ldr r0, [r3] + ldr r1, =0x00000cd3 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r3] + ldr r6, =0x00000cd2 + adds r0, r6 + strb r1, [r0] + ldr r0, [r3] + ldr r5, =0x00000cd7 + adds r0, r5 + strb r1, [r0] + ldr r7, =0x030022c0 + ldrh r1, [r7, 0x30] + movs r0, 0x40 + ands r0, r1 + adds r4, r3, 0 + cmp r0, 0 + bne _080CF9B2 + movs r0, 0x88 + ands r0, r1 + cmp r0, 0 + beq _080CF944 + movs r7, 0x1 + movs r0, 0x2 + mov r8, r0 + movs r2, 0 + ldr r0, [r4] + b _080CF9D0 + .pool +_080CF944: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080CF960 + movs r7, 0x1 + lsls r0, r2, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r2, r0, 24 + cmp r0, 0 + bge _080CF9D4 + movs r2, 0x1 + b _080CF9D4 +_080CF960: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080CF97E + movs r7, 0x1 + lsls r0, r2, 24 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r2, r0, 24 + asrs r0, 24 + cmp r0, 0x1 + ble _080CF9D4 + movs r2, 0 + b _080CF9D4 +_080CF97E: + ldrh r1, [r7, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080CF992 + movs r0, 0x4 + cmp r2, 0 + bne _080CF9E2 + movs r0, 0x5 + b _080CF9E2 +_080CF992: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080CF99E + movs r0, 0x13 + b _080CF9E2 +_080CF99E: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080CF9AE + bl sub_80CFDC4 + movs r0, 0 + b _080CF9E2 +_080CF9AE: + movs r7, 0 + b _080CF9E0 +_080CF9B2: + movs r7, 0x1 + movs r0, 0 + mov r8, r0 + ldr r0, [r3] + adds r0, r6 + movs r1, 0xFF + strb r1, [r0] + mov r1, r12 + movs r0, 0 + ldrsb r0, [r1, r0] + movs r2, 0x1D + cmp r0, 0 + bne _080CF9CE + movs r2, 0x18 +_080CF9CE: + ldr r0, [r3] +_080CF9D0: + adds r0, r5 + strb r7, [r0] +_080CF9D4: + cmp r7, 0 + beq _080CF9E0 + mov r0, r8 + adds r1, r2, 0 + bl sub_80CD894 +_080CF9E0: + adds r0, r7, 0 +_080CF9E2: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80CF8D8 + + thumb_func_start sub_80CF9EC +sub_80CF9EC: @ 80CF9EC + push {r4,r5,lr} + movs r3, 0 + ldr r0, =gUnknown_0857B9BC + ldr r1, [r0] + adds r4, r0, 0 + cmp r1, 0 + beq _080CFA30 + ldr r5, =0x02039d78 +_080CF9FC: + lsls r0, r3, 3 + adds r2, r0, r4 + movs r1, 0x4 + ldrsb r1, [r2, r1] + movs r0, 0 + ldrsb r0, [r5, r0] + cmp r1, r0 + bne _080CFA20 + ldr r0, [r2] + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + b _080CFA32 + .pool +_080CFA20: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + lsls r0, r3, 3 + adds r0, r4 + ldr r0, [r0] + cmp r0, 0 + bne _080CF9FC +_080CFA30: + movs r0, 0 +_080CFA32: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80CF9EC + + thumb_func_start sub_80CFA38 +sub_80CFA38: @ 80CFA38 + push {lr} + bl sub_80CFEF0 + movs r0, 0x9 + bl sub_80CFF34 + movs r0, 0xA + bl sub_80CFF34 + movs r0, 0xB + bl sub_80CFF34 + movs r0, 0 + bl sub_80CFF34 + pop {r0} + bx r0 + thumb_func_end sub_80CFA38 + + thumb_func_start sub_80CFA5C +sub_80CFA5C: @ 80CFA5C + push {lr} + bl sub_80CFEF0 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080CFA78 + bl sub_80CFB44 + b _080CFA7C + .pool +_080CFA78: + bl sub_80CFA84 +_080CFA7C: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80CFA5C + + thumb_func_start sub_80CFA84 +sub_80CFA84: @ 80CFA84 + push {lr} + bl sub_80CD504 + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + beq _080CFAAE + cmp r0, 0x1 + bgt _080CFAA8 + cmp r0, 0 + beq _080CFABA + b _080CFAF4 + .pool +_080CFAA8: + cmp r0, 0x2 + beq _080CFAC6 + b _080CFAF4 +_080CFAAE: + cmp r1, 0 + beq _080CFAF4 + movs r0, 0x1 + bl sub_80CFF34 + b _080CFAF8 +_080CFABA: + cmp r1, 0 + beq _080CFAF4 + movs r0, 0x2 + bl sub_80CFF34 + b _080CFAF8 +_080CFAC6: + ldr r0, =0x02039d7a + ldrb r0, [r0] + cmp r0, 0 + beq _080CFAE8 + cmp r1, 0 + beq _080CFAE0 + movs r0, 0x4 + bl sub_80CFF34 + b _080CFAF8 + .pool +_080CFAE0: + movs r0, 0x5 + bl sub_80CFF34 + b _080CFAF8 +_080CFAE8: + cmp r1, 0 + beq _080CFAF4 + movs r0, 0x3 + bl sub_80CFF34 + b _080CFAF8 +_080CFAF4: + movs r0, 0 + b _080CFB3E +_080CFAF8: + movs r0, 0x6 + bl sub_80CFF34 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x2 + bne _080CFB2A + ldr r0, =0x02039d78 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bne _080CFB24 + movs r0, 0x2 + bl sub_80CFF34 + b _080CFB2A + .pool +_080CFB24: + movs r0, 0x1 + bl sub_80CFF34 +_080CFB2A: + movs r0, 0x8 + bl sub_80CFF34 + movs r0, 0x7 + bl sub_80CFF34 + movs r0, 0 + bl sub_80CFF34 + movs r0, 0x1 +_080CFB3E: + pop {r1} + bx r1 + thumb_func_end sub_80CFA84 + + thumb_func_start sub_80CFB44 +sub_80CFB44: @ 80CFB44 + push {r4,r5,lr} + ldr r4, =0x02039d08 + ldr r0, [r4] + ldr r5, =0x00000ce4 + adds r0, r5 + ldrh r1, [r0] + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + beq _080CFBDA + bl sub_80D127C + lsls r0, 24 + cmp r0, 0 + bne _080CFBAC + ldr r2, [r4] + ldr r0, =0x00000ce6 + adds r1, r2, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _080CFB8C + adds r0, r2, r5 + ldrh r0, [r0] + cmp r0, 0 + beq _080CFBDA + movs r0, 0xE + bl sub_80CFF34 + b _080CFBE4 + .pool +_080CFB8C: + ldrh r0, [r1] + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + bne _080CFBA4 + movs r0, 0xC + bl sub_80CFF34 + movs r0, 0x10 + bl sub_80CFF34 +_080CFBA4: + movs r0, 0x11 + bl sub_80CFF34 + b _080CFBE4 +_080CFBAC: + ldr r2, [r4] + ldr r0, =0x00000ce6 + adds r1, r2, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _080CFBCC + adds r0, r2, r5 + ldrh r0, [r0] + cmp r0, 0 + beq _080CFBDA + movs r0, 0xD + bl sub_80CFF34 + b _080CFBE4 + .pool +_080CFBCC: + ldrh r0, [r1] + bl itemid_is_mail + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080CFBDE +_080CFBDA: + movs r0, 0 + b _080CFBEC +_080CFBDE: + movs r0, 0xF + bl sub_80CFF34 +_080CFBE4: + movs r0, 0 + bl sub_80CFF34 + movs r0, 0x1 +_080CFBEC: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80CFB44 + + thumb_func_start sub_80CFBF4 +sub_80CFBF4: @ 80CFBF4 + ldr r1, =0x02039d08 + ldr r1, [r1] + ldr r2, =0x00000cb4 + adds r1, r2 + ldr r2, [r1] + ldrh r2, [r2, 0x20] + strh r2, [r0, 0x20] + ldr r1, [r1] + ldrh r1, [r1, 0x22] + adds r1, 0x14 + strh r1, [r0, 0x22] + bx lr + .pool + thumb_func_end sub_80CFBF4 + + thumb_func_start sub_80CFC14 +sub_80CFC14: @ 80CFC14 + push {r4-r6,lr} + sub sp, 0x2C + mov r1, sp + ldr r0, =gUnknown_0857B9E4 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + add r4, sp, 0x18 + adds r1, r4, 0 + ldr r0, =gUnknown_0857B9FC + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldr r0, [r0] + str r0, [r1] + mov r0, sp + bl LoadObjectPics + adds r0, r4, 0 + bl LoadTaggedObjectPalettes + ldr r0, =0x0000daca + bl IndexOfObjectPaletteTag + ldr r6, =0x02039d08 + ldr r1, [r6] + ldr r4, =0x00000cd8 + adds r1, r4 + strb r0, [r1] + ldr r0, =0x0000dac7 + bl IndexOfObjectPaletteTag + ldr r1, [r6] + ldr r5, =0x00000cd9 + adds r1, r5 + strb r0, [r1] + ldr r0, =0x02039d78 + ldrb r0, [r0] + ldr r1, =0x02039d79 + ldrb r1, [r1] + add r4, sp, 0x28 + mov r5, sp + adds r5, 0x2A + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80CD444 + ldr r0, =gUnknown_0857BA50 + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0 + ldrsh r2, [r5, r3] + movs r3, 0x6 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _080CFD18 + ldr r2, [r6] + ldr r4, =0x00000cb4 + adds r3, r2, r4 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + str r1, [r3] + ldr r0, =0x02039d7d + ldr r5, =0x00000cd8 + adds r2, r5 + ldrb r0, [r0] + adds r2, r0 + ldrb r2, [r2] + lsls r2, 4 + ldrb r3, [r1, 0x5] + movs r0, 0xF + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r0, [r6] + adds r0, r4 + ldr r2, [r0] + ldrb r1, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x5] + ldr r0, =0x02039d7a + ldrb r0, [r0] + cmp r0, 0 + beq _080CFD22 + ldr r0, [r6] + adds r0, r4 + ldr r0, [r0] + movs r1, 0x3 + bl StartObjectImageAnim + b _080CFD22 + .pool +_080CFD18: + ldr r0, [r6] + ldr r1, =0x00000cb4 + adds r0, r1 + movs r1, 0 + str r1, [r0] +_080CFD22: + ldr r0, =0x02039d78 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + bne _080CFD3C + movs r3, 0xD + movs r4, 0x1 + b _080CFD40 + .pool +_080CFD3C: + movs r3, 0x15 + movs r4, 0x2 +_080CFD40: + ldr r0, =gUnknown_0857BA68 + movs r1, 0 + movs r2, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _080CFDA8 + ldr r5, =0x02039d08 + ldr r2, [r5] + ldr r3, =0x00000cb8 + adds r2, r3 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + str r1, [r2] + lsls r3, r4, 2 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x5] + ldr r0, =0x02039d78 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + beq _080CFDB4 + ldr r0, [r5] + ldr r4, =0x00000cb8 + adds r0, r4 + ldr r1, [r0] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + b _080CFDB4 + .pool +_080CFDA8: + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r5, =0x00000cb8 + adds r0, r5 + movs r1, 0 + str r1, [r0] +_080CFDB4: + add sp, 0x2C + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CFC14 + + thumb_func_start sub_80CFDC4 +sub_80CFDC4: @ 80CFDC4 + push {lr} + ldr r2, =0x02039d7d + movs r1, 0 + ldrb r0, [r2] + cmp r0, 0 + bne _080CFDD2 + movs r1, 0x1 +_080CFDD2: + strb r1, [r2] + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r3, =0x00000cb4 + adds r1, r0, r3 + ldr r3, [r1] + ldr r1, =0x00000cd8 + adds r0, r1 + ldrb r2, [r2] + adds r0, r2 + ldrb r1, [r0] + lsls r1, 4 + ldrb r2, [r3, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x5] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CFDC4 + + thumb_func_start sub_80CFE08 +sub_80CFE08: @ 80CFE08 + ldr r0, =0x02039d79 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80CFE08 + + thumb_func_start sub_80CFE14 +sub_80CFE14: @ 80CFE14 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + ldr r0, =0x02039d78 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bne _080CFE48 + ldr r4, =0x02039d79 + movs r0, 0 + ldrsb r0, [r4, r0] + movs r1, 0x6 + bl __modsi3 + strb r0, [r5] + movs r0, 0 + ldrsb r0, [r4, r0] + movs r1, 0x6 + bl __divsi3 + b _080CFE4C + .pool +_080CFE48: + movs r0, 0 + strb r0, [r5] +_080CFE4C: + strb r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80CFE14 + + thumb_func_start sub_80CFE54 +sub_80CFE54: @ 80CFE54 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r2, =0x00000cb4 + adds r0, r2 + ldr r0, [r0] + bl StartObjectImageAnim + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CFE54 + + thumb_func_start sub_80CFE78 +sub_80CFE78: @ 80CFE78 + ldr r0, =0x02039d7b + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80CFE78 + + thumb_func_start sub_80CFE84 +sub_80CFE84: @ 80CFE84 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x00000cb4 + adds r0, r1 + ldr r2, [r0] + ldrb r1, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x5] + bx lr + .pool + thumb_func_end sub_80CFE84 + + thumb_func_start sub_80CFEA8 +sub_80CFEA8: @ 80CFEA8 + push {lr} + ldr r0, =0x02039d78 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bne _080CFEC0 + ldr r0, =0x02039d79 + ldrb r1, [r0] + movs r0, 0 + bl sub_80D0E50 +_080CFEC0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CFEA8 + + thumb_func_start sub_80CFECC +sub_80CFECC: @ 80CFECC + push {lr} + ldr r0, =0x02039d78 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bne _080CFEE4 + ldr r0, =0x02039d79 + ldrb r1, [r0] + movs r0, 0 + bl sub_80D0D8C +_080CFEE4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CFECC + + thumb_func_start sub_80CFEF0 +sub_80CFEF0: @ 80CFEF0 + ldr r2, =0x02039d08 + ldr r0, [r2] + ldr r1, =0x00000cac + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + ldr r3, =0x00000cad + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + subs r3, 0x41 + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + ldr r1, =0x00000c71 + adds r0, r1 + movs r1, 0xF + strb r1, [r0] + ldr r0, [r2] + adds r3, 0x6 + adds r0, r3 + movs r1, 0x5C + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_80CFEF0 + + thumb_func_start sub_80CFF34 +sub_80CFF34: @ 80CFF34 + push {r4,r5,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r4, =0x02039d08 + ldr r2, [r4] + ldr r5, =0x00000cac + adds r1, r2, r5 + ldrb r0, [r1] + cmp r0, 0x6 + bhi _080CFF7E + adds r1, r0, 0 + lsls r1, 3 + ldr r0, =0x00000c74 + adds r1, r0 + adds r1, r2, r1 + ldr r2, =gUnknown_0857BA80 + lsls r0, r3, 2 + adds r0, r2 + ldr r0, [r0] + str r0, [r1] + str r3, [r1, 0x4] + bl GetStringLength + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, [r4] + ldr r2, =0x00000cad + adds r0, r2 + ldrb r2, [r0] + cmp r1, r2 + bls _080CFF74 + strb r1, [r0] +_080CFF74: + ldr r1, [r4] + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080CFF7E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CFF34 + + thumb_func_start sub_80CFF98 +sub_80CFF98: @ 80CFF98 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02039d08 + ldr r1, [r0] + ldr r3, =0x00000cac + adds r0, r1, r3 + ldrb r0, [r0] + cmp r2, r0 + bcs _080CFFC8 + lsls r0, r2, 3 + ldr r2, =0x00000c78 + adds r1, r2 + adds r1, r0 + movs r0, 0 + ldrsb r0, [r1, r0] + b _080CFFCC + .pool +_080CFFC8: + movs r0, 0x1 + negs r0, r0 +_080CFFCC: + pop {r1} + bx r1 + thumb_func_end sub_80CFF98 + + thumb_func_start sub_80CFFD0 +sub_80CFFD0: @ 80CFFD0 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r5, =0x02039d08 + ldr r1, [r5] + ldr r2, =0x00000cad + adds r0, r1, r2 + ldrb r0, [r0] + adds r0, 0x2 + subs r2, 0x3E + adds r1, r2 + strb r0, [r1] + ldr r1, [r5] + ldr r6, =0x00000cac + adds r0, r1, r6 + ldrb r0, [r0] + lsls r0, 1 + movs r3, 0xC7 + lsls r3, 4 + adds r1, r3 + strb r0, [r1] + ldr r1, [r5] + adds r2, r1, r2 + ldrb r2, [r2] + movs r0, 0x1D + subs r0, r2 + ldr r2, =0x00000c6d + adds r1, r2 + strb r0, [r1] + ldr r1, [r5] + adds r3, r1, r3 + ldrb r2, [r3] + movs r0, 0xF + subs r0, r2 + ldr r3, =0x00000c6e + adds r1, r3 + strb r0, [r1] + ldr r0, [r5] + ldr r1, =0x00000c6c + adds r0, r1 + bl AddWindow + ldr r1, [r5] + movs r4, 0xCB + lsls r4, 4 + adds r1, r4 + movs r2, 0 + mov r8, r2 + strh r0, [r1] + lsls r0, 24 + lsrs r0, 24 + bl ClearWindowTilemap + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + movs r1, 0 + movs r2, 0xB + movs r3, 0xE + bl SetWindowBorderStyle + ldr r2, [r5] + adds r0, r2, r4 + ldrb r0, [r0] + adds r1, r2, r6 + ldrb r1, [r1] + ldr r3, =0x00000c74 + adds r2, r3 + bl PrintMenuTable + ldr r1, [r5] + adds r4, r1, r4 + ldrb r0, [r4] + adds r1, r6 + ldrb r1, [r1] + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, [r5] + ldr r1, =0x00000cae + adds r0, r1 + mov r2, r8 + strb r2, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80CFFD0 + + thumb_func_start sub_80D00A8 +sub_80D00A8: @ 80D00A8 + movs r0, 0 + bx lr + thumb_func_end sub_80D00A8 + + thumb_func_start sub_80D00AC +sub_80D00AC: @ 80D00AC + push {r4,r5,lr} + movs r5, 0x2 + negs r5, r5 + ldr r4, =0x030022c0 + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080D0102 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080D00CE + movs r0, 0x5 + bl audio_play + adds r5, 0x1 +_080D00CE: + ldrh r1, [r4, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080D00EC + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + negs r0, r0 + bl MoveMenuCursor + b _080D010A + .pool +_080D00EC: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080D010A + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + bl MoveMenuCursor + b _080D010A +_080D0102: + bl GetMenuCursorPos + lsls r0, 24 + lsrs r5, r0, 24 +_080D010A: + movs r0, 0x2 + negs r0, r0 + cmp r5, r0 + beq _080D0116 + bl sub_80D013C +_080D0116: + cmp r5, 0 + blt _080D0128 + ldr r0, =0x02039d08 + ldr r0, [r0] + lsls r1, r5, 3 + ldr r2, =0x00000c78 + adds r0, r2 + adds r0, r1 + ldr r5, [r0] +_080D0128: + lsls r0, r5, 16 + asrs r0, 16 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D00AC + + thumb_func_start sub_80D013C +sub_80D013C: @ 80D013C + push {r4,r5,lr} + ldr r5, =0x02039d08 + ldr r0, [r5] + movs r4, 0xCB + lsls r4, 4 + adds r0, r4 + ldrb r0, [r0] + movs r1, 0x1 + bl sub_8198070 + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + bl RemoveWindow + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D013C + + thumb_func_start sub_80D0164 +sub_80D0164: @ 80D0164 + push {r4,lr} + ldr r4, =0x02039d80 + ldr r0, =0x00000974 + bl Alloc + str r0, [r4] + cmp r0, 0 + beq _080D01B0 + ldr r0, =gUnknown_0857BB1C + bl AddWindow8Bit + adds r1, r0, 0 + ldr r0, =0x02039d08 + ldr r0, [r0] + movs r2, 0x88 + lsls r2, 6 + adds r0, r2 + strh r1, [r0] + lsls r0, r1, 16 + lsrs r0, 16 + cmp r0, 0xFF + beq _080D01B0 + lsls r0, r1, 24 + lsrs r0, 24 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + b _080D01B2 + .pool +_080D01B0: + movs r0, 0 +_080D01B2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80D0164 + + thumb_func_start sub_80D01B8 +sub_80D01B8: @ 80D01B8 + push {lr} + ldr r0, =0x02039d80 + ldr r0, [r0] + cmp r0, 0 + beq _080D01C6 + bl Free +_080D01C6: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D01B8 + + thumb_func_start sub_80D01D0 +sub_80D01D0: @ 80D01D0 + ldr r2, =0x02039d80 + ldr r1, [r2] + movs r3, 0 + strb r0, [r1] + ldr r0, [r2] + strb r3, [r0, 0x1] + bx lr + .pool + thumb_func_end sub_80D01D0 + + thumb_func_start sub_80D01E4 +sub_80D01E4: @ 80D01E4 + push {lr} + ldr r0, =0x02039d80 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x5 + bhi _080D0244 + lsls r0, 2 + ldr r1, =_080D0204 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080D0204: + .4byte _080D021C + .4byte _080D0222 + .4byte _080D0228 + .4byte _080D022E + .4byte _080D0234 + .4byte _080D023A +_080D021C: + bl sub_80D024C + b _080D023E +_080D0222: + bl sub_80D0344 + b _080D023E +_080D0228: + bl sub_80D03B0 + b _080D023E +_080D022E: + bl sub_80D0420 + b _080D023E +_080D0234: + bl sub_80D04A0 + b _080D023E +_080D023A: + bl sub_80D04C8 +_080D023E: + lsls r0, 24 + lsrs r0, 24 + b _080D0246 +_080D0244: + movs r0, 0 +_080D0246: + pop {r1} + bx r1 + thumb_func_end sub_80D01E4 + + thumb_func_start sub_80D024C +sub_80D024C: @ 80D024C + push {r4-r6,lr} + sub sp, 0x8 + ldr r6, =0x02039d80 + ldr r1, [r6] + ldrb r0, [r1, 0x1] + cmp r0, 0x1 + beq _080D027C + cmp r0, 0x1 + bgt _080D0268 + cmp r0, 0 + beq _080D026E + b _080D0338 + .pool +_080D0268: + cmp r0, 0x2 + beq _080D0324 + b _080D0338 +_080D026E: + movs r0, 0 + bl HideBg + movs r0, 0x80 + bl sub_80D304C + b _080D030E +_080D027C: + adds r0, r1, 0x2 + adds r1, 0x3 + bl sub_80CFE14 + ldr r1, [r6] + ldrb r0, [r1, 0x2] + strb r0, [r1, 0x4] + ldr r1, [r6] + ldrb r0, [r1, 0x3] + strb r0, [r1, 0x5] + ldr r4, =0xfffffc00 + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + ldr r5, =0x02039d08 + ldr r0, [r5] + movs r4, 0x88 + lsls r4, 6 + adds r0, r4 + ldrb r0, [r0] + movs r1, 0 + bl FillWindowPixelBuffer8Bit + ldr r1, [r6] + ldrb r0, [r1, 0x2] + ldrb r1, [r1, 0x3] + bl sub_80D07B0 + movs r0, 0 + movs r1, 0x4 + movs r2, 0x1 + bl SetBgAttribute + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + bl PutWindowTilemap + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + movs r1, 0x3 + bl CopyWindowToVram8Bit + movs r0, 0xFC + lsls r0, 6 + ldr r2, =0x00007fff + movs r1, 0x8 + bl sub_80A2A20 + movs r0, 0x2 + bl sub_80CFE54 + movs r0, 0x8 + movs r1, 0x80 + bl SetGpuRegBits +_080D030E: + ldr r1, [r6] + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] + b _080D0338 + .pool +_080D0324: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _080D0338 + movs r0, 0 + bl ShowBg + movs r0, 0 + b _080D033A +_080D0338: + movs r0, 0x1 +_080D033A: + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80D024C + + thumb_func_start sub_80D0344 +sub_80D0344: @ 80D0344 + push {r4,lr} + ldr r4, =0x02039d80 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + beq _080D036E + cmp r0, 0x1 + bgt _080D0360 + cmp r0, 0 + beq _080D0366 + b _080D03A8 + .pool +_080D0360: + cmp r0, 0x2 + beq _080D0382 + b _080D03A8 +_080D0366: + movs r0, 0 + bl HideBg + b _080D0378 +_080D036E: + bl sub_80D0B5C + movs r0, 0 + bl sub_80CFE54 +_080D0378: + ldr r1, [r4] + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] + b _080D03A8 +_080D0382: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _080D03A8 + bl sub_80CFE84 + movs r0, 0x3 + bl stdpal_get + movs r1, 0xD0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0 + bl ShowBg + movs r0, 0 + b _080D03AA +_080D03A8: + movs r0, 0x1 +_080D03AA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80D0344 + + thumb_func_start sub_80D03B0 +sub_80D03B0: @ 80D03B0 + push {r4,lr} + ldr r4, =0x02039d80 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _080D03C8 + cmp r0, 0x1 + beq _080D040C + b _080D0416 + .pool +_080D03C8: + bl sub_80CD554 + lsls r0, 24 + cmp r0, 0 + bne _080D0416 + ldr r1, [r4] + adds r0, r1, 0x6 + adds r1, 0x7 + bl sub_80CFE14 + bl sub_80D062C + ldr r1, [r4] + ldrb r0, [r1, 0x6] + strb r0, [r1, 0x4] + ldr r1, [r4] + ldrb r0, [r1, 0x7] + strb r0, [r1, 0x5] + ldr r0, =0x02039d08 + ldr r0, [r0] + movs r1, 0x88 + lsls r1, 6 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x2 + bl CopyWindowToVram8Bit + ldr r1, [r4] + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] + b _080D0416 + .pool +_080D040C: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + b _080D0418 +_080D0416: + movs r0, 0x1 +_080D0418: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80D03B0 + + thumb_func_start sub_80D0420 +sub_80D0420: @ 80D0420 + push {r4,lr} + ldr r4, =0x02039d80 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + beq _080D044E + cmp r0, 0x1 + bgt _080D043C + cmp r0, 0 + beq _080D0442 + b _080D0498 + .pool +_080D043C: + cmp r0, 0x2 + beq _080D047A + b _080D0498 +_080D0442: + bl sub_80D08CC + bl sub_80D09A4 + movs r0, 0 + b _080D046C +_080D044E: + bl sub_80CDCAC + lsls r0, 24 + cmp r0, 0 + bne _080D0498 + movs r0, 0x3 + bl sub_80CFE54 + movs r1, 0x80 + lsls r1, 1 + movs r0, 0 + movs r2, 0x8 + bl sub_80D0884 + movs r0, 0x1 +_080D046C: + bl sub_80CDC64 + ldr r1, [r4] + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] + b _080D0498 +_080D047A: + bl sub_80D0894 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_80CDCAC + lsls r0, 24 + lsrs r0, 24 + cmp r4, 0 + bne _080D0498 + cmp r0, 0 + bne _080D0498 + movs r0, 0 + b _080D049A +_080D0498: + movs r0, 0x1 +_080D049A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80D0420 + + thumb_func_start sub_80D04A0 +sub_80D04A0: @ 80D04A0 + push {r4,lr} + bl sub_80CD554 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_80D0894 + lsls r0, 24 + lsrs r0, 24 + cmp r4, 0 + bne _080D04C0 + cmp r0, 0 + bne _080D04C0 + movs r0, 0 + b _080D04C2 +_080D04C0: + movs r0, 0x1 +_080D04C2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80D04A0 + + thumb_func_start sub_80D04C8 +sub_80D04C8: @ 80D04C8 + push {r4,lr} + ldr r4, =0x02039d80 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + beq _080D0506 + cmp r0, 0x1 + bgt _080D04E4 + cmp r0, 0 + beq _080D04EE + b _080D0576 + .pool +_080D04E4: + cmp r0, 0x2 + beq _080D0532 + cmp r0, 0x3 + beq _080D0550 + b _080D0576 +_080D04EE: + bl sub_80D0AAC + movs r1, 0xFF + lsls r1, 8 + movs r0, 0 + movs r2, 0x8 + bl sub_80D0884 + movs r0, 0 + bl sub_80CDC64 + b _080D0546 +_080D0506: + bl sub_80CDCAC + lsls r0, 24 + cmp r0, 0 + bne _080D0576 + bl sub_80D0894 + lsls r0, 24 + cmp r0, 0 + bne _080D0576 + bl sub_80D0A1C + movs r0, 0x2 + bl sub_80CFE54 + movs r0, 0x1 + bl sub_80CDC64 + movs r0, 0 + bl HideBg + b _080D0546 +_080D0532: + bl sub_80CDCAC + lsls r0, 24 + cmp r0, 0 + bne _080D0576 + movs r0, 0 + bl sub_80CFE54 + bl sub_80D0B5C +_080D0546: + ldr r1, [r4] + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] + b _080D0576 +_080D0550: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + bne _080D0576 + movs r0, 0x3 + bl stdpal_get + movs r1, 0xD0 + movs r2, 0x20 + bl gpu_pal_apply + bl sub_80CFE84 + movs r0, 0 + bl ShowBg + movs r0, 0 + b _080D0578 +_080D0576: + movs r0, 0x1 +_080D0578: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80D04C8 + + thumb_func_start sub_80D0580 +sub_80D0580: @ 80D0580 + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x1 + beq _080D05BC + cmp r0, 0x1 + bgt _080D0596 + cmp r0, 0 + beq _080D05A0 + b _080D0624 +_080D0596: + cmp r1, 0x2 + beq _080D05DC + cmp r1, 0x3 + beq _080D05FC + b _080D0624 +_080D05A0: + ldr r0, =0x02039d80 + ldr r1, [r0] + ldrb r0, [r1, 0x9] + cmp r0, 0 + beq _080D060A + subs r0, 0x1 + strb r0, [r1, 0x9] + movs r1, 0x80 + lsls r1, 3 + movs r0, 0 + b _080D05F0 + .pool +_080D05BC: + ldr r0, =0x02039d80 + ldr r1, [r0] + ldrb r2, [r1, 0x9] + ldrb r0, [r1, 0xB] + adds r0, r2, r0 + cmp r0, 0x4 + bgt _080D060A + adds r0, r2, 0x1 + strb r0, [r1, 0x9] + movs r1, 0xFC + lsls r1, 8 + movs r0, 0 + b _080D05F0 + .pool +_080D05DC: + ldr r0, =0x02039d80 + ldr r1, [r0] + ldrb r0, [r1, 0x8] + cmp r0, 0 + beq _080D060A + subs r0, 0x1 + strb r0, [r1, 0x8] + movs r0, 0x80 + lsls r0, 3 + movs r1, 0 +_080D05F0: + movs r2, 0x6 + bl sub_80D0884 + b _080D0624 + .pool +_080D05FC: + ldr r0, =0x02039d80 + ldr r1, [r0] + ldrb r2, [r1, 0x8] + ldrb r0, [r1, 0xA] + adds r0, r2, r0 + cmp r0, 0x5 + ble _080D0614 +_080D060A: + movs r0, 0 + b _080D0626 + .pool +_080D0614: + adds r0, r2, 0x1 + strb r0, [r1, 0x8] + movs r0, 0xFC + lsls r0, 8 + movs r1, 0 + movs r2, 0x6 + bl sub_80D0884 +_080D0624: + movs r0, 0x1 +_080D0626: + pop {r1} + bx r1 + thumb_func_end sub_80D0580 + + thumb_func_start sub_80D062C +sub_80D062C: @ 80D062C + push {r4-r7,lr} + ldr r6, =0x02039d80 + ldr r2, [r6] + ldrb r3, [r2, 0x2] + ldrb r5, [r2, 0x6] + subs r1, r3, r5 + cmp r1, 0 + bge _080D063E + negs r1, r1 +_080D063E: + ldrb r0, [r2, 0x4] + subs r0, r3, r0 + cmp r0, 0 + bge _080D0648 + negs r0, r0 +_080D0648: + subs r0, r1, r0 + lsls r0, 16 + lsrs r4, r0, 16 + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x7] + subs r3, r1, r0 + cmp r3, 0 + bge _080D065A + negs r3, r3 +_080D065A: + ldrb r2, [r2, 0x5] + subs r0, r1, r2 + cmp r0, 0 + bge _080D0664 + negs r0, r0 +_080D0664: + subs r0, r3, r0 + lsls r0, 16 + lsrs r7, r0, 16 + lsls r0, r4, 16 + asrs r4, r0, 16 + cmp r4, 0 + ble _080D0678 + adds r0, r5, 0 + bl sub_80D06D0 +_080D0678: + cmp r4, 0 + bge _080D0694 + ldr r2, [r6] + ldrb r0, [r2, 0x4] + ldrb r1, [r2, 0x3] + ldrb r2, [r2, 0x5] + bl sub_80D0740 + ldr r2, [r6] + ldrb r0, [r2, 0x6] + ldrb r1, [r2, 0x3] + ldrb r2, [r2, 0x5] + bl sub_80D06D0 +_080D0694: + lsls r0, r7, 16 + asrs r4, r0, 16 + cmp r4, 0 + ble _080D06A8 + ldr r2, [r6] + ldrb r0, [r2, 0x7] + ldrb r1, [r2, 0x2] + ldrb r2, [r2, 0x4] + bl sub_80D0708 +_080D06A8: + cmp r4, 0 + bge _080D06C4 + ldr r2, [r6] + ldrb r0, [r2, 0x5] + ldrb r1, [r2, 0x2] + ldrb r2, [r2, 0x4] + bl sub_80D0778 + ldr r2, [r6] + ldrb r0, [r2, 0x7] + ldrb r1, [r2, 0x2] + ldrb r2, [r2, 0x4] + bl sub_80D0708 +_080D06C4: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D062C + + thumb_func_start sub_80D06D0 +sub_80D06D0: @ 80D06D0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + adds r1, r4, 0 + lsls r2, 24 + lsrs r5, r2, 24 + adds r0, r5, 0 + cmp r4, r5 + bls _080D06EE + adds r4, r5, 0 + adds r5, r1, 0 + cmp r0, r5 + bhi _080D0700 +_080D06EE: + adds r1, r4, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r6, 0 + bl sub_80D07B0 + cmp r4, r5 + bls _080D06EE +_080D0700: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80D06D0 + + thumb_func_start sub_80D0708 +sub_80D0708: @ 80D0708 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + adds r1, r4, 0 + lsls r2, 24 + lsrs r5, r2, 24 + adds r0, r5, 0 + cmp r4, r5 + bls _080D0726 + adds r4, r5, 0 + adds r5, r1, 0 + cmp r0, r5 + bhi _080D0738 +_080D0726: + adds r0, r4, 0 + adds r1, r0, 0x1 + lsls r1, 24 + lsrs r4, r1, 24 + adds r1, r6, 0 + bl sub_80D07B0 + cmp r4, r5 + bls _080D0726 +_080D0738: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80D0708 + + thumb_func_start sub_80D0740 +sub_80D0740: @ 80D0740 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + adds r1, r4, 0 + lsls r2, 24 + lsrs r5, r2, 24 + adds r0, r5, 0 + cmp r4, r5 + bls _080D075E + adds r4, r5, 0 + adds r5, r1, 0 + cmp r0, r5 + bhi _080D0770 +_080D075E: + adds r1, r4, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r6, 0 + bl sub_80D0834 + cmp r4, r5 + bls _080D075E +_080D0770: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80D0740 + + thumb_func_start sub_80D0778 +sub_80D0778: @ 80D0778 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + adds r1, r4, 0 + lsls r2, 24 + lsrs r5, r2, 24 + adds r0, r5, 0 + cmp r4, r5 + bls _080D0796 + adds r4, r5, 0 + adds r5, r1, 0 + cmp r0, r5 + bhi _080D07A8 +_080D0796: + adds r0, r4, 0 + adds r1, r0, 0x1 + lsls r1, 24 + lsrs r4, r1, 24 + adds r1, r6, 0 + bl sub_80D0834 + cmp r4, r5 + bls _080D0796 +_080D07A8: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80D0778 + + thumb_func_start sub_80D07B0 +sub_80D07B0: @ 80D07B0 + push {r4-r7,lr} + sub sp, 0x1C + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 1 + adds r7, r0, r1 + lsls r4, r7, 1 + adds r4, r6, r4 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x41 + bl get_pokemon_data_from_selected_box + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0 + bl get_pokemon_data_from_selected_box + adds r1, r0, 0 + cmp r5, 0 + beq _080D0828 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_80D2EDC + adds r4, r0, 0 + adds r0, r5, 0 + bl sub_80D3080 + adds r0, 0x8 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02039d08 + ldr r1, [r1] + movs r2, 0x88 + lsls r2, 6 + adds r1, r2 + ldrb r3, [r1] + movs r2, 0x20 + str r2, [sp] + str r2, [sp, 0x4] + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 3 + str r1, [sp, 0x8] + lsls r1, r7, 3 + str r1, [sp, 0xC] + str r2, [sp, 0x10] + str r2, [sp, 0x14] + str r0, [sp, 0x18] + adds r0, r3, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl BlitBitmapRectToWindow4BitTo8Bit +_080D0828: + add sp, 0x1C + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D07B0 + + thumb_func_start sub_80D0834 +sub_80D0834: @ 80D0834 + push {r4,r5,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 1 + adds r5, r0, r1 + lsls r0, r5, 1 + adds r0, r4, r0 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x41 + bl get_pokemon_data_from_selected_box + lsls r0, 16 + cmp r0, 0 + beq _080D0878 + ldr r0, =0x02039d08 + ldr r0, [r0] + movs r1, 0x88 + lsls r1, 6 + adds r0, r1 + ldrb r0, [r0] + lsls r2, r4, 1 + adds r2, r4 + lsls r2, 3 + lsls r3, r5, 3 + movs r1, 0x20 + str r1, [sp] + str r1, [sp, 0x4] + movs r1, 0 + bl FillWindowPixelRect8Bit +_080D0878: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D0834 + + thumb_func_start sub_80D0884 +sub_80D0884: @ 80D0884 + ldr r3, =0x02039d80 + ldr r3, [r3] + strh r0, [r3, 0xC] + strh r1, [r3, 0xE] + strh r2, [r3, 0x10] + bx lr + .pool + thumb_func_end sub_80D0884 + + thumb_func_start sub_80D0894 +sub_80D0894: @ 80D0894 + push {r4,lr} + ldr r4, =0x02039d80 + ldr r1, [r4] + ldrh r0, [r1, 0x10] + cmp r0, 0 + beq _080D08BE + ldrh r1, [r1, 0xC] + movs r0, 0 + movs r2, 0x1 + bl ChangeBgX + ldr r0, [r4] + ldrh r1, [r0, 0xE] + movs r0, 0 + movs r2, 0x1 + bl ChangeBgY + ldr r1, [r4] + ldrh r0, [r1, 0x10] + subs r0, 0x1 + strh r0, [r1, 0x10] +_080D08BE: + ldr r0, [r4] + ldrb r0, [r0, 0x10] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D0894 + + thumb_func_start sub_80D08CC +sub_80D08CC: @ 80D08CC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, =0x02039d80 + ldr r1, [r4] + ldrb r0, [r1, 0x4] + ldrb r2, [r1, 0x2] + cmp r0, r2 + bls _080D08E4 + adds r0, r2, 0 +_080D08E4: + strb r0, [r1, 0x8] + ldr r1, [r4] + ldrb r0, [r1, 0x5] + ldrb r2, [r1, 0x3] + cmp r0, r2 + bls _080D08F2 + adds r0, r2, 0 +_080D08F2: + strb r0, [r1, 0x9] + ldr r2, [r4] + ldrb r1, [r2, 0x2] + ldrb r0, [r2, 0x4] + subs r0, r1, r0 + cmp r0, 0 + bge _080D0902 + negs r0, r0 +_080D0902: + adds r0, 0x1 + strb r0, [r2, 0xA] + ldr r2, [r4] + ldrb r1, [r2, 0x3] + ldrb r0, [r2, 0x5] + subs r0, r1, r0 + cmp r0, 0 + bge _080D0914 + negs r0, r0 +_080D0914: + adds r0, 0x1 + strb r0, [r2, 0xB] + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + movs r6, 0 + ldr r0, [r4] + ldrb r2, [r0, 0x8] + ldrb r1, [r0, 0xA] + adds r2, r1 + mov r8, r2 + ldrb r1, [r0, 0x9] + ldrb r0, [r0, 0xB] + adds r0, r1 + mov r9, r0 + adds r2, r1, 0 + cmp r2, r9 + bge _080D0990 +_080D093C: + lsls r0, r2, 1 + adds r0, r2 + ldr r3, =0x02039d80 + ldr r1, [r3] + lsls r0, 1 + ldrb r3, [r1, 0x8] + adds r0, r3 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r4, [r1, 0x8] + adds r7, r2, 0x1 + cmp r4, r8 + bge _080D098A + mov r0, r8 + subs r4, r0, r4 +_080D095A: + mov r0, r10 + adds r1, r5, 0 + bl get_pokemon_by_box_and_pos + adds r1, r0, 0 + ldr r2, =0x02039d80 + ldr r0, [r2] + lsls r2, r6, 2 + adds r2, r6 + lsls r2, 4 + adds r0, r2 + adds r0, 0x14 + movs r2, 0x50 + bl memcpy + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + subs r4, 0x1 + cmp r4, 0 + bne _080D095A +_080D098A: + adds r2, r7, 0 + cmp r2, r9 + blt _080D093C +_080D0990: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D08CC + + thumb_func_start sub_80D09A4 +sub_80D09A4: @ 80D09A4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r4, =0x02039d80 + ldr r0, [r4] + ldrb r2, [r0, 0x8] + ldrb r1, [r0, 0xA] + adds r7, r2, r1 + ldrb r1, [r0, 0x9] + ldrb r0, [r0, 0xB] + adds r1, r0 + mov r9, r1 + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, [r4] + ldrb r2, [r0, 0x9] + cmp r2, r9 + bge _080D0A0C +_080D09D0: + lsls r0, r2, 1 + adds r0, r2 + ldr r1, =0x02039d80 + ldr r1, [r1] + lsls r0, 1 + ldrb r3, [r1, 0x8] + adds r0, r3 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r4, [r1, 0x8] + adds r6, r2, 0x1 + cmp r4, r7 + bge _080D0A06 + subs r4, r7, r4 +_080D09EC: + adds r0, r5, 0 + bl sub_80CB778 + mov r0, r8 + adds r1, r5, 0 + bl sub_80D2018 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + subs r4, 0x1 + cmp r4, 0 + bne _080D09EC +_080D0A06: + adds r2, r6, 0 + cmp r2, r9 + blt _080D09D0 +_080D0A0C: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D09A4 + + thumb_func_start sub_80D0A1C +sub_80D0A1C: @ 80D0A1C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x02039d80 + ldr r0, [r0] + ldrb r2, [r0, 0x8] + ldrb r1, [r0, 0xA] + adds r2, r1 + mov r8, r2 + ldrb r1, [r0, 0x9] + ldrb r0, [r0, 0xB] + adds r0, r1 + mov r10, r0 + movs r6, 0 + adds r2, r1, 0 + cmp r2, r10 + bge _080D0A98 +_080D0A42: + lsls r0, r2, 1 + adds r0, r2 + ldr r3, =0x02039d80 + ldr r1, [r3] + lsls r0, 1 + ldrb r4, [r1, 0x8] + adds r0, r4 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r4, [r1, 0x8] + adds r7, r2, 0x1 + cmp r4, r8 + bge _080D0A92 + mov r9, r3 + mov r0, r8 + subs r4, r0, r4 +_080D0A62: + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 4 + adds r1, 0x14 + mov r2, r9 + ldr r0, [r2] + adds r0, r1 + movs r1, 0x5 + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080D0A80 + adds r0, r5, 0 + bl sub_80CB140 +_080D0A80: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + subs r4, 0x1 + cmp r4, 0 + bne _080D0A62 +_080D0A92: + adds r2, r7, 0 + cmp r2, r10 + blt _080D0A42 +_080D0A98: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D0A1C + + thumb_func_start sub_80D0AAC +sub_80D0AAC: @ 80D0AAC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r4, =0x02039d80 + ldr r0, [r4] + ldrb r2, [r0, 0x8] + ldrb r1, [r0, 0xA] + adds r2, r1 + mov r10, r2 + ldrb r1, [r0, 0x9] + ldrb r0, [r0, 0xB] + adds r1, r0 + str r1, [sp] + bl get_preferred_box + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + movs r7, 0 + ldr r0, [r4] + ldrb r3, [r0, 0x9] + ldr r0, [sp] + cmp r3, r0 + bge _080D0B46 +_080D0AE2: + lsls r0, r3, 1 + adds r0, r3 + ldr r2, =0x02039d80 + ldr r1, [r2] + lsls r0, 1 + ldrb r4, [r1, 0x8] + adds r0, r4 + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r5, [r1, 0x8] + adds r3, 0x1 + mov r9, r3 + cmp r5, r10 + bge _080D0B3E + mov r8, r2 + mov r0, r10 + subs r5, r0, r5 +_080D0B04: + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 4 + adds r4, r0, 0 + adds r4, 0x14 + mov r1, r8 + ldr r0, [r1] + adds r0, r4 + movs r1, 0x5 + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080D0B2C + mov r0, r8 + ldr r2, [r0] + adds r2, r4 + ldr r0, [sp, 0x4] + adds r1, r6, 0 + bl sub_80D1F18 +_080D0B2C: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + subs r5, 0x1 + cmp r5, 0 + bne _080D0B04 +_080D0B3E: + mov r3, r9 + ldr r1, [sp] + cmp r3, r1 + blt _080D0AE2 +_080D0B46: + 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_80D0AAC + + thumb_func_start sub_80D0B5C +sub_80D0B5C: @ 80D0B5C + push {lr} + sub sp, 0x8 + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r0, 0 + movs r1, 0x4 + movs r2, 0 + bl SetBgAttribute + movs r0, 0x8 + movs r1, 0x80 + bl ClearGpuRegBits + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_80D0B5C + + thumb_func_start sub_80D0BA4 +sub_80D0BA4: @ 80D0BA4 + ldr r0, =0x02039d80 + ldr r2, [r0] + ldrb r1, [r2, 0x3] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + ldrb r2, [r2, 0x2] + adds r0, r2 + lsls r0, 24 + lsrs r0, 24 + bx lr + .pool + thumb_func_end sub_80D0BA4 + + thumb_func_start sub_80D0BC0 +sub_80D0BC0: @ 80D0BC0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r0, =0x02039d80 + ldr r0, [r0] + ldrb r2, [r0, 0x8] + ldrb r1, [r0, 0xA] + adds r2, r1 + mov r9, r2 + ldrb r1, [r0, 0x9] + ldrb r0, [r0, 0xB] + adds r0, r1, r0 + str r0, [sp] + movs r7, 0 + adds r6, r1, 0 + cmp r6, r0 + bge _080D0C4E + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 1 + mov r8, r0 +_080D0BF0: + ldr r2, =0x02039d80 + ldr r1, [r2] + ldrb r0, [r1, 0x8] + add r0, r8 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r4, [r1, 0x8] + cmp r4, r9 + bge _080D0C42 + mov r10, r2 +_080D0C04: + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 4 + adds r1, 0x14 + mov r2, r10 + ldr r0, [r2] + adds r0, r1 + movs r1, 0x5 + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080D0C30 + adds r0, r5, 0 + movs r1, 0x5 + bl get_pokemon_data_from_selected_box + cmp r0, 0 + beq _080D0C30 + movs r0, 0 + b _080D0C50 + .pool +_080D0C30: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x1 + cmp r4, r9 + blt _080D0C04 +_080D0C42: + movs r0, 0x6 + add r8, r0 + adds r6, 0x1 + ldr r2, [sp] + cmp r6, r2 + blt _080D0BF0 +_080D0C4E: + movs r0, 0x1 +_080D0C50: + 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_80D0BC0 + + thumb_func_start sub_80D0C60 +sub_80D0C60: @ 80D0C60 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + ldr r3, =0x02039d08 + ldr r0, [r3] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080D0D3E + ldr r0, =0x03000f78 + str r0, [sp, 0x18] + ldr r1, =0xffff0000 + add r2, sp, 0x18 + ldr r0, [r2, 0x4] + ands r0, r1 + movs r1, 0x80 + lsls r1, 2 + orrs r0, r1 + str r0, [r2, 0x4] + mov r1, sp + ldr r0, =gUnknown_0857BC70 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + movs r7, 0 + mov r9, r2 + mov r8, r3 + movs r0, 0 + mov r10, r0 +_080D0CA0: + adds r6, r7, 0x7 + lsls r1, r6, 16 + mov r2, r9 + ldrh r0, [r2, 0x4] + orrs r0, r1 + str r0, [r2, 0x4] + mov r0, r9 + bl LoadCompressedObjectPic + mov r4, r9 + ldrh r0, [r4, 0x6] + bl GetObjectTileRangeStartByTag + mov r5, r8 + ldr r1, [r5] + lsls r5, r7, 4 + ldr r2, =0x00002208 + adds r1, r2 + adds r1, r5 + lsls r0, 16 + lsrs r0, 11 + ldr r4, =0x06010000 + adds r0, r4 + str r0, [r1] + ldr r0, =0xffffdacb + adds r4, r7, r0 + lsls r0, r4, 16 + lsrs r0, 16 + bl AllocObjectPalette + mov r2, r8 + ldr r1, [r2] + adds r1, r5 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x0000220c + adds r1, r2 + strh r0, [r1] + ldrh r0, [r1] + lsls r0, 4 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2 + strh r0, [r1] + mov r0, sp + strh r6, [r0] + strh r4, [r0, 0x2] + movs r1, 0 + movs r2, 0 + movs r3, 0xB + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + mov r4, r8 + ldr r2, [r4] + ldr r6, =0x00002204 + adds r2, r6 + adds r2, r5 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + str r1, [r2] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + ldr r0, [r4] + adds r0, r5 + ldr r1, =0x00002210 + adds r0, r1 + mov r2, r10 + strb r2, [r0] + adds r7, 0x1 + cmp r7, 0x2 + ble _080D0CA0 +_080D0D3E: + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r4, =0x00002234 + adds r0, r4 + movs r1, 0 + strh r1, [r0] + 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_80D0C60 + + thumb_func_start sub_80D0D8C +sub_80D0D8C: @ 80D0D8C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080D0E42 + mov r0, r8 + adds r1, r7, 0 + bl sub_80D1324 + cmp r0, 0 + bne _080D0E42 + mov r0, r8 + cmp r0, 0 + beq _080D0DC4 + cmp r0, 0x1 + beq _080D0DDA + b _080D0E42 + .pool +_080D0DC4: + adds r0, r7, 0 + movs r1, 0x5 + bl get_pokemon_data_from_selected_box + cmp r0, 0 + beq _080D0E42 + adds r0, r7, 0 + movs r1, 0xC + bl get_pokemon_data_from_selected_box + b _080D0DFC +_080D0DDA: + cmp r7, 0x5 + bhi _080D0E42 + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x5 + bl pokemon_getattr + cmp r0, 0 + beq _080D0E42 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr +_080D0DFC: + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _080D0E42 + adds r0, r4, 0 + bl GetItemIconPic + adds r6, r0, 0 + adds r0, r4, 0 + bl GetItemIconPalette + adds r5, r0, 0 + bl sub_80D12E8 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + mov r1, r8 + adds r2, r7, 0 + bl sub_80D140C + adds r0, r4, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_80D1524 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80D15D4 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80D1740 +_080D0E42: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D0D8C + + thumb_func_start sub_80D0E50 +sub_80D0E50: @ 80D0E50 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080D0E86 + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80D1370 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80D15D4 + adds r0, r4, 0 + movs r1, 0 + adds r2, r6, 0 + adds r3, r5, 0 + bl sub_80D1604 +_080D0E86: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D0E50 + + thumb_func_start sub_80D0E90 +sub_80D0E90: @ 80D0E90 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + adds r7, r5, 0 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080D0F20 + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80D1370 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r1, 0 + mov r0, sp + strh r1, [r0] + adds r0, r4, 0 + movs r1, 0x3 + bl sub_80D15D4 + adds r0, r4, 0 + movs r1, 0x1 + adds r2, r6, 0 + adds r3, r5, 0 + bl sub_80D1604 + adds r0, r4, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_80D140C + cmp r6, 0 + bne _080D0EF8 + adds r0, r5, 0 + movs r1, 0xC + mov r2, sp + bl set_pokemon_data_from_selected_box + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80CB7AC + b _080D0F10 + .pool +_080D0EF8: + movs r0, 0x64 + muls r0, r7 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x1 + bl sub_80CBBDC +_080D0F10: + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r2, =0x00000ce6 + adds r1, r0, r2 + ldrh r1, [r1] + ldr r2, =0x00002234 + adds r0, r2 + strh r1, [r0] +_080D0F20: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D0E90 + + thumb_func_start sub_80D0F38 +sub_80D0F38: @ 80D0F38 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r5, 0 + bl GetItemIconPic + mov r8, r0 + adds r0, r5, 0 + bl GetItemIconPalette + adds r6, r0, 0 + bl sub_80D12E8 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + mov r1, r8 + adds r2, r6, 0 + bl sub_80D1524 + adds r0, r4, 0 + movs r1, 0x6 + bl sub_80D15D4 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + movs r3, 0 + bl sub_80D1604 + adds r0, r4, 0 + movs r1, 0x2 + movs r2, 0 + bl sub_80D140C + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80D1740 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x00002234 + adds r0, r1 + strh r5, [r0] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D0F38 + + thumb_func_start sub_80D0FAC +sub_80D0FAC: @ 80D0FAC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r0, =0x02039d08 + mov r8, r0 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080D106A + mov r0, r9 + adds r1, r7, 0 + bl sub_80D1370 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + movs r1, 0x3 + bl sub_80D15D4 + adds r0, r4, 0 + movs r1, 0x3 + movs r2, 0x2 + movs r3, 0 + bl sub_80D1604 + mov r1, r9 + cmp r1, 0 + bne _080D101C + adds r0, r7, 0 + movs r1, 0xC + bl get_pokemon_data_from_selected_box + lsls r0, 16 + lsrs r6, r0, 16 + mov r0, r8 + ldr r2, [r0] + ldr r4, =0x00002234 + adds r2, r4 + adds r0, r7, 0 + movs r1, 0xC + bl set_pokemon_data_from_selected_box + mov r1, r8 + ldr r0, [r1] + adds r0, r4 + b _080D1048 + .pool +_080D101C: + movs r0, 0x64 + adds r4, r7, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + mov r0, r8 + ldr r2, [r0] + ldr r5, =0x00002234 + adds r2, r5 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + mov r1, r8 + ldr r0, [r1] + adds r0, r5 +_080D1048: + strh r6, [r0] + movs r0, 0x2 + movs r1, 0 + bl sub_80D1370 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + movs r1, 0x4 + bl sub_80D15D4 + adds r0, r4, 0 + movs r1, 0x4 + mov r2, r9 + adds r3, r7, 0 + bl sub_80D1604 +_080D106A: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D0FAC + + thumb_func_start sub_80D1080 +sub_80D1080: @ 80D1080 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + mov r8, r5 + ldr r6, =0x02039d08 + ldr r0, [r6] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080D1100 + movs r0, 0x2 + movs r1, 0 + bl sub_80D1370 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x4 + bl sub_80D15D4 + adds r0, r4, 0 + movs r1, 0x2 + adds r2, r7, 0 + adds r3, r5, 0 + bl sub_80D1604 + cmp r7, 0 + bne _080D10E0 + ldr r2, [r6] + ldr r0, =0x00002234 + adds r2, r0 + adds r0, r5, 0 + movs r1, 0xC + bl set_pokemon_data_from_selected_box + adds r0, r5, 0 + movs r1, 0 + bl sub_80CB7AC + b _080D1100 + .pool +_080D10E0: + movs r0, 0x64 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r1, =0x020244ec + adds r0, r1 + ldr r2, [r6] + ldr r1, =0x00002234 + adds r2, r1 + movs r1, 0xC + bl pokemon_setattr + mov r0, r8 + movs r1, 0 + bl sub_80CBBDC +_080D1100: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D1080 + + thumb_func_start sub_80D1114 +sub_80D1114: @ 80D1114 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + adds r7, r5, 0 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080D1188 + movs r1, 0 + mov r0, sp + strh r1, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80D1370 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80D15D4 + adds r0, r4, 0 + movs r1, 0 + adds r2, r6, 0 + adds r3, r5, 0 + bl sub_80D1604 + cmp r6, 0 + bne _080D1170 + adds r0, r5, 0 + movs r1, 0xC + mov r2, sp + bl set_pokemon_data_from_selected_box + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80CB7AC + b _080D1188 + .pool +_080D1170: + movs r0, 0x64 + muls r0, r7 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr + adds r0, r7, 0 + movs r1, 0x1 + bl sub_80CBBDC +_080D1188: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D1114 + + thumb_func_start sub_80D1194 +sub_80D1194: @ 80D1194 + push {r4,lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080D11C2 + movs r0, 0x2 + movs r1, 0 + bl sub_80D1370 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0x5 + bl sub_80D15D4 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x2 + movs r3, 0 + bl sub_80D1604 +_080D11C2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D1194 + + thumb_func_start sub_80D11CC +sub_80D11CC: @ 80D11CC + push {r4,lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0x3 + bne _080D120A + movs r4, 0 +_080D11DA: + ldr r0, =0x02039d08 + ldr r1, [r0] + lsls r0, r4, 4 + adds r1, r0 + ldr r2, =0x00002210 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080D1204 + subs r2, 0x2 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080D1204 + lsls r0, r4, 24 + lsrs r0, 24 + movs r1, 0x7 + movs r2, 0x2 + movs r3, 0 + bl sub_80D1604 +_080D1204: + adds r4, 0x1 + cmp r4, 0x2 + ble _080D11DA +_080D120A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D11CC + + thumb_func_start sub_80D1218 +sub_80D1218: @ 80D1218 + push {r4,r5,lr} + movs r5, 0 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x00002204 + adds r4, r0, r1 + adds r3, r0, 0 +_080D1226: + ldr r1, =0x00002210 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080D1268 + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x28 + ands r0, r1 + cmp r0, 0x8 + beq _080D124E + ldr r1, [r2, 0x1C] + ldr r0, =DummyObjectCallback + cmp r1, r0 + beq _080D1268 + ldr r0, =sub_80D1AD8 + cmp r1, r0 + beq _080D1268 +_080D124E: + movs r0, 0x1 + b _080D1274 + .pool +_080D1268: + adds r4, 0x10 + adds r3, 0x10 + adds r5, 0x1 + cmp r5, 0x2 + ble _080D1226 + movs r0, 0 +_080D1274: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80D1218 + + thumb_func_start sub_80D127C +sub_80D127C: @ 80D127C + push {lr} + ldr r0, =0x02039d08 + ldr r1, [r0] + ldrb r0, [r1, 0x1] + cmp r0, 0x3 + bne _080D12B0 + movs r2, 0 + ldr r0, =0x0000220e + adds r1, r0 +_080D128E: + ldrb r0, [r1, 0x2] + cmp r0, 0 + beq _080D12A8 + ldrb r0, [r1] + cmp r0, 0x2 + bne _080D12A8 + movs r0, 0x1 + b _080D12B2 + .pool +_080D12A8: + adds r1, 0x10 + adds r2, 0x1 + cmp r2, 0x2 + ble _080D128E +_080D12B0: + movs r0, 0 +_080D12B2: + pop {r1} + bx r1 + thumb_func_end sub_80D127C + + thumb_func_start sub_80D12B8 +sub_80D12B8: @ 80D12B8 + push {lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x00002234 + adds r0, r1 + ldrh r0, [r0] + bl itemid_get_item + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D12B8 + + thumb_func_start sub_80D12D4 +sub_80D12D4: @ 80D12D4 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x00002234 + adds r0, r1 + ldrh r0, [r0] + bx lr + .pool + thumb_func_end sub_80D12D4 + + thumb_func_start sub_80D12E8 +sub_80D12E8: @ 80D12E8 + push {r4,r5,lr} + movs r2, 0 + ldr r5, =0x02039d08 + ldr r3, =0x00002210 + movs r4, 0x1 +_080D12F2: + ldr r0, [r5] + lsls r1, r2, 4 + adds r0, r1 + adds r1, r0, r3 + ldrb r0, [r1] + cmp r0, 0 + bne _080D1310 + strb r4, [r1] + adds r0, r2, 0 + b _080D131C + .pool +_080D1310: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _080D12F2 + movs r0, 0x3 +_080D131C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80D12E8 + + thumb_func_start sub_80D1324 +sub_80D1324: @ 80D1324 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r3, 0 + ldr r0, =0x02039d08 + ldr r2, [r0] +_080D1334: + ldr r5, =0x00002210 + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, 0 + beq _080D1360 + subs r5, 0x2 + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, r4 + bne _080D1360 + adds r5, 0x1 + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, r1 + bne _080D1360 + movs r0, 0x1 + b _080D136A + .pool +_080D1360: + adds r2, 0x10 + adds r3, 0x1 + cmp r3, 0x2 + ble _080D1334 + movs r0, 0 +_080D136A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80D1324 + + thumb_func_start sub_80D1370 +sub_80D1370: @ 80D1370 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + movs r3, 0 + ldr r0, =0x02039d08 + ldr r1, [r0] +_080D1380: + lsls r0, r3, 4 + adds r2, r1, r0 + ldr r6, =0x00002210 + adds r0, r2, r6 + ldrb r0, [r0] + cmp r0, 0 + beq _080D13B0 + subs r6, 0x2 + adds r0, r2, r6 + ldrb r0, [r0] + cmp r0, r5 + bne _080D13B0 + adds r6, 0x1 + adds r0, r2, r6 + ldrb r0, [r0] + cmp r0, r4 + bne _080D13B0 + adds r0, r3, 0 + b _080D13BC + .pool +_080D13B0: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x2 + bls _080D1380 + movs r0, 0x3 +_080D13BC: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80D1370 + + thumb_func_start sub_80D13C4 +sub_80D13C4: @ 80D13C4 + push {r4-r6,lr} + adds r5, r0, 0 + movs r2, 0 + ldr r0, =0x02039d08 + ldr r3, [r0] + ldr r0, =0x00002204 + adds r4, r3, r0 + ldr r6, =0x00002210 +_080D13D4: + lsls r1, r2, 4 + adds r0, r3, r1 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0 + beq _080D13F8 + adds r0, r4, r1 + ldr r0, [r0] + cmp r0, r5 + bne _080D13F8 + adds r0, r2, 0 + b _080D1404 + .pool +_080D13F8: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _080D13D4 + movs r0, 0x3 +_080D1404: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80D13C4 + + thumb_func_start sub_80D140C +sub_80D140C: @ 80D140C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r2, 24 + lsrs r7, r2, 24 + cmp r5, 0x2 + bhi _080D150A + cmp r1, 0 + beq _080D1438 + cmp r1, 0x1 + beq _080D1494 + ldr r4, =0x02039d08 + lsls r3, r5, 4 + b _080D14F4 + .pool +_080D1438: + adds r0, r7, 0 + movs r1, 0x6 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r7, 0 + movs r1, 0x6 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + ldr r6, =0x02039d08 + ldr r2, [r6] + lsls r5, 4 + ldr r1, =0x00002204 + adds r2, r1 + adds r2, r5 + ldr r3, [r2] + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 3 + adds r1, 0x70 + strh r1, [r3, 0x20] + ldr r3, [r2] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, 0x38 + strh r1, [r3, 0x22] + ldr r2, [r2] + ldrb r1, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r2, 0x5] + adds r4, r6, 0 + adds r3, r5, 0 + b _080D14F4 + .pool +_080D1494: + cmp r7, 0 + bne _080D14BC + ldr r4, =0x02039d08 + ldr r0, [r4] + lsls r3, r5, 4 + ldr r1, =0x00002204 + adds r0, r1 + adds r0, r3 + ldr r2, [r0] + movs r1, 0x74 + strh r1, [r2, 0x20] + ldr r1, [r0] + movs r0, 0x4C + strh r0, [r1, 0x22] + b _080D14DC + .pool +_080D14BC: + ldr r4, =0x02039d08 + ldr r0, [r4] + lsls r3, r5, 4 + ldr r1, =0x00002204 + adds r0, r1 + adds r0, r3 + ldr r2, [r0] + movs r1, 0xA4 + strh r1, [r2, 0x20] + ldr r2, [r0] + subs r1, r7, 0x1 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, 0x1C + strh r0, [r2, 0x22] +_080D14DC: + ldr r0, [r4] + ldr r1, =0x00002204 + adds r0, r1 + adds r0, r3 + ldr r2, [r0] + ldrb r1, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x5] +_080D14F4: + ldr r0, [r4] + adds r0, r3 + ldr r1, =0x0000220e + adds r0, r1 + mov r1, r8 + strb r1, [r0] + ldr r0, [r4] + adds r0, r3 + ldr r1, =0x0000220f + adds r0, r1 + strb r7, [r0] +_080D150A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D140C + + thumb_func_start sub_80D1524 +sub_80D1524: @ 80D1524 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + mov r8, r1 + mov r9, r2 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x2 + bhi _080D15AC + movs r0, 0 + str r0, [sp] + ldr r4, =0x02039d08 + ldr r1, [r4] + ldr r6, =0x000042c4 + adds r1, r6 + ldr r2, =0x01000080 + mov r0, sp + bl CpuFastSet + ldr r1, [r4] + ldr r5, =0x000022c4 + adds r1, r5 + mov r0, r8 + bl LZ77UnCompWram + lsls r7, 4 + mov r8, r7 + adds r7, r4, 0 + movs r4, 0x2 +_080D1562: + ldr r1, [r7] + adds r0, r1, r5 + adds r1, r6 + movs r2, 0x18 + bl CpuFastSet + adds r6, 0x80 + adds r5, 0x60 + subs r4, 0x1 + cmp r4, 0 + bge _080D1562 + ldr r5, =0x02039d08 + ldr r1, [r5] + ldr r4, =0x000042c4 + adds r0, r1, r4 + ldr r2, =0x00002208 + adds r1, r2 + add r1, r8 + ldr r1, [r1] + movs r2, 0x80 + bl CpuFastSet + ldr r1, [r5] + adds r1, r4 + mov r0, r9 + bl LZ77UnCompWram + ldr r0, [r5] + adds r4, r0, r4 + add r0, r8 + ldr r1, =0x0000220c + adds r0, r1 + ldrh r1, [r0] + adds r0, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply +_080D15AC: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D1524 + + thumb_func_start sub_80D15D4 +sub_80D15D4: @ 80D15D4 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + cmp r2, 0x2 + bhi _080D15F6 + ldr r0, =0x02039d08 + ldr r0, [r0] + lsls r1, r2, 4 + ldr r2, =0x00002204 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + adds r1, r3, 0 + bl StartObjectRotScalAnim +_080D15F6: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D15D4 + + thumb_func_start sub_80D1604 +sub_80D1604: @ 80D1604 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r0, r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + lsls r3, 24 + lsrs r3, 24 + cmp r4, 0x2 + bls _080D161C + b _080D172E +_080D161C: + cmp r0, 0x7 + bls _080D1622 + b _080D172E +_080D1622: + lsls r0, 2 + ldr r1, =_080D1630 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080D1630: + .4byte _080D1650 + .4byte _080D1674 + .4byte _080D1698 + .4byte _080D16C4 + .4byte _080D16F0 + .4byte _080D172E + .4byte _080D172E + .4byte _080D171C +_080D1650: + ldr r0, =0x02039d08 + ldr r0, [r0] + lsls r1, r4, 4 + ldr r2, =0x00002204 + adds r0, r2 + adds r0, r1 + ldr r1, [r0] + strh r4, [r1, 0x2E] + ldr r1, [r0] + ldr r0, =sub_80D1A48 + b _080D172C + .pool +_080D1674: + ldr r0, =0x02039d08 + ldr r0, [r0] + lsls r1, r4, 4 + ldr r2, =0x00002204 + adds r0, r2 + adds r0, r1 + ldr r2, [r0] + movs r1, 0 + strh r1, [r2, 0x2E] + ldr r1, [r0] + ldr r0, =sub_80D1A74 + b _080D172C + .pool +_080D1698: + ldr r0, =0x02039d08 + ldr r0, [r0] + lsls r1, r4, 4 + ldr r2, =0x00002204 + adds r0, r2 + adds r0, r1 + ldr r2, [r0] + movs r1, 0 + strh r1, [r2, 0x2E] + ldr r1, [r0] + strh r5, [r1, 0x3A] + ldr r1, [r0] + strh r3, [r1, 0x3C] + ldr r1, [r0] + ldr r0, =sub_80D1B14 + b _080D172C + .pool +_080D16C4: + ldr r0, =0x02039d08 + ldr r0, [r0] + lsls r1, r4, 4 + ldr r2, =0x00002204 + adds r0, r2 + adds r0, r1 + ldr r2, [r0] + movs r1, 0 + strh r1, [r2, 0x2E] + ldr r2, [r0] + ldr r1, =sub_80D1B94 + str r1, [r2, 0x1C] + strh r5, [r2, 0x3A] + ldr r0, [r0] + strh r3, [r0, 0x3C] + b _080D172E + .pool +_080D16F0: + ldr r0, =0x02039d08 + ldr r0, [r0] + lsls r1, r4, 4 + ldr r2, =0x00002204 + adds r0, r2 + adds r0, r1 + ldr r2, [r0] + movs r1, 0 + strh r1, [r2, 0x2E] + ldr r1, [r0] + strh r5, [r1, 0x3A] + ldr r1, [r0] + strh r3, [r1, 0x3C] + ldr r1, [r0] + ldr r0, =sub_80D1C30 + b _080D172C + .pool +_080D171C: + ldr r0, =0x02039d08 + ldr r0, [r0] + lsls r1, r4, 4 + ldr r2, =0x00002204 + adds r0, r2 + adds r0, r1 + ldr r1, [r0] + ldr r0, =sub_80D1CCC +_080D172C: + str r0, [r1, 0x1C] +_080D172E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D1604 + + thumb_func_start sub_80D1740 +sub_80D1740: @ 80D1740 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r2, 0x2 + bhi _080D1780 + ldr r1, =0x02039d08 + ldr r0, [r1] + lsls r2, 4 + adds r0, r2 + ldr r3, =0x00002210 + adds r0, r3 + strb r4, [r0] + ldr r0, [r1] + ldr r1, =0x00002204 + adds r0, r1 + adds r0, r2 + ldr r0, [r0] + movs r3, 0 + cmp r4, 0 + bne _080D176E + movs r3, 0x1 +_080D176E: + adds r2, r0, 0 + adds r2, 0x3E + lsls r3, 2 + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + orrs r0, r3 + strb r0, [r2] +_080D1780: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D1740 + + thumb_func_start GetItemIconPic +GetItemIconPic: @ 80D1794 + push {lr} + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl GetItemIconPicOrPalette + pop {r1} + bx r1 + thumb_func_end GetItemIconPic + + thumb_func_start GetItemIconPalette +GetItemIconPalette: @ 80D17A4 + push {lr} + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + bl GetItemIconPicOrPalette + pop {r1} + bx r1 + thumb_func_end GetItemIconPalette + + thumb_func_start sub_80D17B4 +sub_80D17B4: @ 80D17B4 + push {r4,lr} + sub sp, 0x14 + bl sub_80D127C + lsls r0, 24 + cmp r0, 0 + beq _080D17D4 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x00002234 + b _080D17DA + .pool +_080D17D4: + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x00000ce6 +_080D17DA: + adds r0, r1 + ldrh r0, [r0] + bl itemid_get_description + adds r4, r0, 0 + movs r0, 0x2 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + movs r0, 0x1 + str r0, [sp, 0x10] + movs r0, 0x2 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0x4 + bl sub_8199F74 + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D17B4 + + thumb_func_start sub_80D1818 +sub_80D1818: @ 80D1818 + push {lr} + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x00002236 + adds r0, r1 + movs r1, 0x15 + strh r1, [r0] + ldr r1, =gUnknown_0857BB24 + movs r3, 0x9D + lsls r3, 1 + movs r0, 0 + movs r2, 0x80 + bl LoadBgTiles + movs r0, 0 + bl sub_80D19B4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D1818 + + thumb_func_start sub_80D184C +sub_80D184C: @ 80D184C + push {r4,r5,lr} + sub sp, 0x10 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r2, =0x00002236 + adds r1, r0, r2 + ldrh r0, [r1] + cmp r0, 0 + bne _080D186C + movs r0, 0 + b _080D18D2 + .pool +_080D186C: + subs r0, 0x1 + strh r0, [r1] + ldrh r1, [r1] + movs r0, 0x15 + subs r5, r0, r1 + movs r4, 0 + cmp r4, r5 + bge _080D18BC +_080D187C: + movs r0, 0 + movs r1, 0xA + bl GetBgAttribute + adds r1, r0, 0 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r2, =0x00002236 + adds r0, r2 + adds r1, 0x14 + ldrh r0, [r0] + adds r1, r0 + adds r1, r4 + lsls r1, 16 + lsrs r1, 16 + lsls r2, r4, 24 + lsrs r2, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0x15 + str r0, [sp, 0xC] + movs r0, 0 + movs r3, 0xD + bl WriteSequenceToBgTilemapBuffer + adds r4, 0x1 + cmp r4, r5 + blt _080D187C +_080D18BC: + adds r0, r5, 0 + bl sub_80D19B4 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r1, =0x00002236 + adds r0, r1 + ldrh r1, [r0] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 +_080D18D2: + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D184C + + thumb_func_start sub_80D18E4 +sub_80D18E4: @ 80D18E4 + push {r4,r5,lr} + sub sp, 0x10 + ldr r5, =0x02039d08 + ldr r0, [r5] + ldr r4, =0x00002236 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0x16 + bne _080D1904 + movs r0, 0 + b _080D19A4 + .pool +_080D1904: + cmp r0, 0 + bne _080D1920 + movs r0, 0x1 + str r0, [sp] + movs r0, 0x9 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0x15 + movs r3, 0xC + bl FillBgTilemapBufferRect +_080D1920: + ldr r1, [r5] + adds r1, r4 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + ldrh r1, [r1] + movs r0, 0x15 + subs r5, r0, r1 + movs r4, 0 + cmp r4, r5 + bge _080D1976 +_080D1936: + movs r0, 0 + movs r1, 0xA + bl GetBgAttribute + adds r1, r0, 0 + ldr r0, =0x02039d08 + ldr r0, [r0] + ldr r2, =0x00002236 + adds r0, r2 + adds r1, 0x14 + ldrh r0, [r0] + adds r1, r0 + adds r1, r4 + lsls r1, 16 + lsrs r1, 16 + lsls r2, r4, 24 + lsrs r2, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0x15 + str r0, [sp, 0xC] + movs r0, 0 + movs r3, 0xD + bl WriteSequenceToBgTilemapBuffer + adds r4, 0x1 + cmp r4, r5 + blt _080D1936 +_080D1976: + cmp r5, 0 + blt _080D1980 + adds r0, r5, 0 + bl sub_80D19B4 +_080D1980: + adds r2, r5, 0x1 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0x9 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r3, 0xC + bl FillBgTilemapBufferRect + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 +_080D19A4: + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D18E4 + + thumb_func_start sub_80D19B4 +sub_80D19B4: @ 80D19B4 + push {r4-r7,lr} + sub sp, 0xC + adds r7, r0, 0 + cmp r7, 0 + beq _080D19EC + movs r1, 0x9D + lsls r1, 1 + lsls r4, r7, 24 + lsrs r4, 24 + str r4, [sp] + movs r6, 0x1 + str r6, [sp, 0x4] + movs r5, 0xF + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0 + movs r3, 0xC + bl FillBgTilemapBufferRect + ldr r1, =0x0000093a + str r4, [sp] + str r6, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r2, 0 + movs r3, 0x14 + bl FillBgTilemapBufferRect +_080D19EC: + ldr r1, =0x0000013b + lsls r5, r7, 24 + lsrs r5, 24 + movs r4, 0x1 + str r4, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r6, 0xF + str r6, [sp, 0x8] + movs r0, 0 + adds r2, r5, 0 + movs r3, 0xD + bl FillBgTilemapBufferRect + movs r1, 0x9E + lsls r1, 1 + str r4, [sp] + str r4, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0 + adds r2, r5, 0 + movs r3, 0xC + bl FillBgTilemapBufferRect + ldr r1, =0x0000013d + str r4, [sp] + str r4, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0 + adds r2, r5, 0 + movs r3, 0x14 + bl FillBgTilemapBufferRect + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D19B4 + + thumb_func_start sub_80D1A48 +sub_80D1A48: @ 80D1A48 + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080D1A68 + ldrh r0, [r4, 0x2E] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_80D1740 + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] +_080D1A68: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D1A48 + + thumb_func_start sub_80D1A74 +sub_80D1A74: @ 80D1A74 + push {lr} + adds r3, r0, 0 + movs r0, 0x2E + ldrsh r1, [r3, r0] + cmp r1, 0 + beq _080D1A86 + cmp r1, 0x1 + beq _080D1AA2 + b _080D1AD0 +_080D1A86: + ldrh r0, [r3, 0x20] + lsls r0, 4 + strh r0, [r3, 0x30] + ldrh r0, [r3, 0x22] + lsls r0, 4 + strh r0, [r3, 0x32] + movs r0, 0xA + strh r0, [r3, 0x34] + movs r0, 0x15 + strh r0, [r3, 0x36] + strh r1, [r3, 0x38] + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] +_080D1AA2: + ldrh r1, [r3, 0x30] + ldrh r0, [r3, 0x34] + subs r1, r0 + strh r1, [r3, 0x30] + ldrh r0, [r3, 0x32] + ldrh r2, [r3, 0x36] + subs r0, r2 + strh r0, [r3, 0x32] + lsls r1, 16 + asrs r1, 20 + strh r1, [r3, 0x20] + lsls r0, 16 + asrs r0, 20 + strh r0, [r3, 0x22] + ldrh r0, [r3, 0x38] + adds r0, 0x1 + strh r0, [r3, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + ble _080D1AD0 + ldr r0, =sub_80D1AD8 + str r0, [r3, 0x1C] +_080D1AD0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D1A74 + + thumb_func_start sub_80D1AD8 +sub_80D1AD8: @ 80D1AD8 + ldr r1, =0x02039d08 + ldr r3, [r1] + ldr r1, =0x00000cb4 + adds r3, r1 + ldr r1, [r3] + ldrh r1, [r1, 0x20] + adds r1, 0x4 + strh r1, [r0, 0x20] + ldr r2, [r3] + ldrh r1, [r2, 0x26] + ldrh r2, [r2, 0x22] + adds r1, r2 + adds r1, 0x8 + strh r1, [r0, 0x22] + ldr r1, [r3] + ldrb r1, [r1, 0x5] + movs r2, 0xC + ands r2, r1 + ldrb r3, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0, 0x5] + bx lr + .pool + thumb_func_end sub_80D1AD8 + + thumb_func_start sub_80D1B14 +sub_80D1B14: @ 80D1B14 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x2E + ldrsh r1, [r4, r0] + cmp r1, 0 + beq _080D1B26 + cmp r1, 0x1 + beq _080D1B42 + b _080D1B8A +_080D1B26: + ldrh r0, [r4, 0x20] + lsls r0, 4 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x22] + lsls r0, 4 + strh r0, [r4, 0x32] + movs r0, 0xA + strh r0, [r4, 0x34] + movs r0, 0x15 + strh r0, [r4, 0x36] + strh r1, [r4, 0x38] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_080D1B42: + ldrh r0, [r4, 0x34] + ldrh r1, [r4, 0x30] + adds r0, r1 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x36] + ldrh r2, [r4, 0x32] + adds r1, r2 + strh r1, [r4, 0x32] + lsls r0, 16 + asrs r0, 20 + strh r0, [r4, 0x20] + lsls r1, 16 + asrs r1, 20 + strh r1, [r4, 0x22] + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + ble _080D1B8A + adds r0, r4, 0 + bl sub_80D13C4 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x3A] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r4, 0x3C] + lsls r2, 24 + lsrs r2, 24 + bl sub_80D140C + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] +_080D1B8A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D1B14 + + thumb_func_start sub_80D1B94 +sub_80D1B94: @ 80D1B94 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x2E + ldrsh r1, [r4, r0] + cmp r1, 0 + beq _080D1BA6 + cmp r1, 0x1 + beq _080D1BC2 + b _080D1C20 +_080D1BA6: + ldrh r0, [r4, 0x20] + lsls r0, 4 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x22] + lsls r0, 4 + strh r0, [r4, 0x32] + movs r0, 0xA + strh r0, [r4, 0x34] + movs r0, 0x15 + strh r0, [r4, 0x36] + strh r1, [r4, 0x38] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_080D1BC2: + ldrh r1, [r4, 0x30] + ldrh r0, [r4, 0x34] + subs r1, r0 + strh r1, [r4, 0x30] + ldrh r0, [r4, 0x32] + ldrh r2, [r4, 0x36] + subs r0, r2 + strh r0, [r4, 0x32] + lsls r1, 16 + asrs r1, 20 + strh r1, [r4, 0x20] + lsls r0, 16 + asrs r0, 20 + strh r0, [r4, 0x22] + ldr r1, =gUnknown_08329F40 + movs r2, 0x38 + ldrsh r0, [r4, r2] + lsls r0, 4 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 20 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + ble _080D1C20 + adds r0, r4, 0 + bl sub_80D13C4 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x3A] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r4, 0x3C] + lsls r2, 24 + lsrs r2, 24 + bl sub_80D140C + movs r0, 0 + strh r0, [r4, 0x24] + ldr r0, =sub_80D1AD8 + str r0, [r4, 0x1C] +_080D1C20: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D1B94 + + thumb_func_start sub_80D1C30 +sub_80D1C30: @ 80D1C30 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x2E + ldrsh r1, [r4, r0] + cmp r1, 0 + beq _080D1C42 + cmp r1, 0x1 + beq _080D1C5E + b _080D1CBE +_080D1C42: + ldrh r0, [r4, 0x20] + lsls r0, 4 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x22] + lsls r0, 4 + strh r0, [r4, 0x32] + movs r0, 0xA + strh r0, [r4, 0x34] + movs r0, 0x15 + strh r0, [r4, 0x36] + strh r1, [r4, 0x38] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_080D1C5E: + ldrh r0, [r4, 0x34] + ldrh r1, [r4, 0x30] + adds r0, r1 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x36] + ldrh r2, [r4, 0x32] + adds r1, r2 + strh r1, [r4, 0x32] + lsls r0, 16 + asrs r0, 20 + strh r0, [r4, 0x20] + lsls r1, 16 + asrs r1, 20 + strh r1, [r4, 0x22] + ldr r1, =gUnknown_08329F40 + movs r2, 0x38 + ldrsh r0, [r4, r2] + lsls r0, 4 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 20 + negs r0, r0 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + ble _080D1CBE + adds r0, r4, 0 + bl sub_80D13C4 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x3A] + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r4, 0x3C] + lsls r2, 24 + lsrs r2, 24 + bl sub_80D140C + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x24] +_080D1CBE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D1C30 + + thumb_func_start sub_80D1CCC +sub_80D1CCC: @ 80D1CCC + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x22] + subs r0, 0x8 + strh r0, [r2, 0x22] + movs r1, 0x22 + ldrsh r0, [r2, r1] + movs r3, 0x26 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bge _080D1CFC + ldr r0, =DummyObjectCallback + str r0, [r2, 0x1C] + adds r0, r2, 0 + bl sub_80D13C4 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_80D1740 +_080D1CFC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D1CCC + + thumb_func_start TaskDummy0 +TaskDummy0: @ 80D1D04 + bx lr + thumb_func_end TaskDummy0 + + thumb_func_start nullsub_98 +nullsub_98: @ 80D1D08 + bx lr + thumb_func_end nullsub_98 + + thumb_func_start get_preferred_box +@ char get_preferred_box() +get_preferred_box: @ 80D1D0C + ldr r0, =0x03005d94 + ldr r0, [r0] + ldrb r0, [r0] + bx lr + .pool + thumb_func_end get_preferred_box + + thumb_func_start sub_80D1D18 +sub_80D1D18: @ 80D1D18 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xD + bhi _080D1D28 + ldr r0, =0x03005d94 + ldr r0, [r0] + strb r1, [r0] +_080D1D28: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D1D18 + + thumb_func_start get_pokemon_data_from_any_box +get_pokemon_data_from_any_box: @ 80D1D30 + push {r4,r5,lr} + adds r5, r2, 0 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r3, 0xD + bhi _080D1D6C + cmp r4, 0x1D + bhi _080D1D6C + ldr r2, =0x03005d94 + lsls r0, r3, 2 + adds r0, r3 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 5 + adds r1, 0x4 + ldr r0, [r2] + adds r0, r1 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 4 + adds r0, r1 + adds r1, r5, 0 + bl pokemon_getattr_encrypted + b _080D1D6E + .pool +_080D1D6C: + movs r0, 0 +_080D1D6E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end get_pokemon_data_from_any_box + + thumb_func_start set_pokemon_data_from_any_box +set_pokemon_data_from_any_box: @ 80D1D74 + push {r4-r6,lr} + adds r5, r2, 0 + adds r6, r3, 0 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r3, 0xD + bhi _080D1DAC + cmp r4, 0x1D + bhi _080D1DAC + ldr r2, =0x03005d94 + lsls r0, r3, 2 + adds r0, r3 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 5 + adds r1, 0x4 + ldr r0, [r2] + adds r0, r1 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 4 + adds r0, r1 + adds r1, r5, 0 + adds r2, r6, 0 + bl pokemon_setattr_encrypted +_080D1DAC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end set_pokemon_data_from_any_box + + thumb_func_start get_pokemon_data_from_selected_box +get_pokemon_data_from_selected_box: @ 80D1DB8 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =0x03005d94 + ldr r0, [r0] + ldrb r0, [r0] + adds r1, r3, 0 + bl get_pokemon_data_from_any_box + pop {r1} + bx r1 + .pool + thumb_func_end get_pokemon_data_from_selected_box + + thumb_func_start set_pokemon_data_from_selected_box +set_pokemon_data_from_selected_box: @ 80D1DD8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r3, r2, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x03005d94 + ldr r0, [r0] + ldrb r0, [r0] + adds r1, r4, 0 + adds r2, r5, 0 + bl set_pokemon_data_from_any_box + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end set_pokemon_data_from_selected_box + + thumb_func_start sub_80D1DFC +sub_80D1DFC: @ 80D1DFC + push {r4,r5,lr} + adds r5, r2, 0 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r3, 0xD + bhi _080D1E38 + cmp r4, 0x1D + bhi _080D1E38 + ldr r2, =0x03005d94 + lsls r0, r3, 2 + adds r0, r3 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 5 + adds r1, 0x4 + ldr r0, [r2] + adds r0, r1 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 4 + adds r0, r1 + movs r1, 0x2 + adds r2, r5, 0 + bl pokemon_getattr_encrypted + b _080D1E3C + .pool +_080D1E38: + movs r0, 0xFF + strb r0, [r5] +_080D1E3C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80D1DFC + + thumb_func_start sub_80D1E44 +sub_80D1E44: @ 80D1E44 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r2, r1, 24 + cmp r0, 0xD + bhi _080D1E84 + cmp r2, 0x1D + bhi _080D1E84 + ldr r6, =0x03005d94 + lsls r1, r0, 2 + adds r1, r0 + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 5 + adds r5, r0, 0x4 + ldr r0, [r6] + adds r0, r5 + lsls r1, r2, 2 + adds r1, r2 + lsls r4, r1, 4 + adds r0, r4 + movs r1, 0x5 + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080D1E84 + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + bl sub_80690C0 +_080D1E84: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D1E44 + + thumb_func_start sub_80D1E90 +sub_80D1E90: @ 80D1E90 + push {r4,r5,lr} + adds r5, r2, 0 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r3, 0xD + bhi _080D1EC6 + cmp r4, 0x1D + bhi _080D1EC6 + ldr r2, =0x03005d94 + lsls r0, r3, 2 + adds r0, r3 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 5 + adds r1, 0x4 + ldr r0, [r2] + adds r0, r1 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 4 + adds r0, r1 + movs r1, 0x2 + adds r2, r5, 0 + bl pokemon_setattr_encrypted +_080D1EC6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D1E90 + + thumb_func_start sub_80D1ED0 +sub_80D1ED0: @ 80D1ED0 + push {r4-r6,lr} + adds r5, r2, 0 + adds r6, r3, 0 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r3, 0xD + bhi _080D1F10 + cmp r4, 0x1D + bhi _080D1F10 + ldr r2, =0x03005d94 + lsls r0, r3, 2 + adds r0, r3 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 5 + adds r1, 0x4 + ldr r0, [r2] + adds r0, r1 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 4 + adds r0, r1 + adds r1, r5, 0 + adds r2, r6, 0 + bl pokemon_getattr_encrypted + b _080D1F12 + .pool +_080D1F10: + movs r0, 0 +_080D1F12: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80D1ED0 + + thumb_func_start sub_80D1F18 +sub_80D1F18: @ 80D1F18 + push {r4,r5,lr} + adds r5, r2, 0 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r4, 0xD + bhi _080D1F4E + cmp r1, 0x1D + bhi _080D1F4E + ldr r0, =0x03005d94 + ldr r0, [r0] + lsls r3, r1, 2 + adds r3, r1 + lsls r3, 4 + lsls r2, r4, 2 + adds r2, r4 + lsls r1, r2, 4 + subs r1, r2 + lsls r1, 5 + adds r3, r1 + adds r0, r3 + adds r0, 0x4 + adds r1, r5, 0 + movs r2, 0x50 + bl memcpy +_080D1F4E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D1F18 + + thumb_func_start sub_80D1F58 +sub_80D1F58: @ 80D1F58 + push {r4,r5,lr} + adds r5, r2, 0 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r2, r1, 24 + cmp r4, 0xD + bhi _080D1F8E + cmp r2, 0x1D + bhi _080D1F8E + ldr r0, =0x03005d94 + ldr r1, [r0] + lsls r3, r2, 2 + adds r3, r2 + lsls r3, 4 + lsls r2, r4, 2 + adds r2, r4 + lsls r0, r2, 4 + subs r0, r2 + lsls r0, 5 + adds r3, r0 + adds r1, r3 + adds r1, 0x4 + adds r0, r5, 0 + movs r2, 0x50 + bl memcpy +_080D1F8E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D1F58 + + thumb_func_start sub_80D1F98 +sub_80D1F98: @ 80D1F98 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + ldr r4, [sp, 0x30] + ldr r5, [sp, 0x34] + ldr r6, [sp, 0x3C] + mov r12, r6 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 16 + lsrs r2, 16 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + mov r0, r12 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r7, 0xD + bhi _080D2004 + cmp r6, 0x1D + bhi _080D2004 + ldr r2, =0x03005d94 + lsls r0, r7, 2 + adds r0, r7 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 5 + adds r1, 0x4 + ldr r0, [r2] + adds r0, r1 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 4 + adds r0, r1 + str r5, [sp] + ldr r1, [sp, 0x38] + str r1, [sp, 0x4] + str r3, [sp, 0x8] + ldr r1, [sp, 0x40] + str r1, [sp, 0xC] + mov r1, r9 + mov r2, r8 + adds r3, r4, 0 + bl create_pokemon +_080D2004: + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D1F98 + + thumb_func_start sub_80D2018 +sub_80D2018: @ 80D2018 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r3, 0xD + bhi _080D2048 + cmp r4, 0x1D + bhi _080D2048 + ldr r2, =0x03005d94 + lsls r0, r3, 2 + adds r0, r3 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 5 + adds r1, 0x4 + ldr r0, [r2] + adds r0, r1 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 4 + adds r0, r1 + bl zero_pokemon_boxed_data +_080D2048: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D2018 + + thumb_func_start sub_80D2054 +sub_80D2054: @ 80D2054 + push {r4,r5,lr} + adds r5, r2, 0 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r3, 0xD + bhi _080D2088 + cmp r4, 0x1D + bhi _080D2088 + ldr r2, =0x03005d94 + lsls r0, r3, 2 + adds r0, r3 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 5 + adds r1, 0x4 + ldr r0, [r2] + adds r0, r1 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 4 + adds r0, r1 + adds r1, r5, 0 + bl sub_8069004 +_080D2088: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D2054 + + thumb_func_start get_pokemon_by_box_and_pos +@ pokemon *get_pokemon_by_box_and_pos(u8 box_id, u8 pos) +get_pokemon_by_box_and_pos: @ 80D2094 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r3, 0xD + bhi _080D20C8 + cmp r4, 0x1D + bhi _080D20C8 + ldr r2, =0x03005d94 + lsls r0, r3, 2 + adds r0, r3 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 5 + adds r1, 0x4 + ldr r0, [r2] + adds r0, r1 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 4 + adds r0, r1 + b _080D20CA + .pool +_080D20C8: + movs r0, 0 +_080D20CA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end get_pokemon_by_box_and_pos + + thumb_func_start sav3_get_box_name +sav3_get_box_name: @ 80D20D0 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xD + bls _080D20DE + movs r0, 0 + b _080D20EC +_080D20DE: + ldr r0, =0x03005d94 + lsls r1, r2, 3 + adds r1, r2 + ldr r2, =0x00008344 + adds r1, r2 + ldr r0, [r0] + adds r0, r1 +_080D20EC: + pop {r1} + bx r1 + .pool + thumb_func_end sav3_get_box_name + + thumb_func_start sub_80D20F8 +sub_80D20F8: @ 80D20F8 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xD + bls _080D2106 + movs r0, 0 + b _080D2112 +_080D2106: + ldr r0, =0x03005d94 + ldr r0, [r0] + ldr r2, =0x000083c2 + adds r0, r2 + adds r0, r1 + ldrb r0, [r0] +_080D2112: + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D20F8 + + thumb_func_start sub_80D2120 +sub_80D2120: @ 80D2120 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r2, 0xD + bhi _080D213E + cmp r1, 0x10 + bhi _080D213E + ldr r0, =0x03005d94 + ldr r0, [r0] + ldr r3, =0x000083c2 + adds r0, r3 + adds r0, r2 + strb r1, [r0] +_080D213E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D2120 + + thumb_func_start sub_80D214C +sub_80D214C: @ 80D214C + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + lsls r1, 24 + lsrs r0, r1, 24 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r3, 24 + adds r4, r3, 0 + ldr r2, =0x0000ffff + cmp r3, 0x1 + bhi _080D216E + movs r2, 0x1 + cmp r3, 0x1 + beq _080D2172 +_080D216E: + cmp r4, 0x3 + bne _080D21BC +_080D2172: + lsls r0, 24 + asrs r0, 24 + lsls r2, 16 + asrs r1, r2, 16 + adds r1, r0 + lsls r0, r1, 16 + asrs r1, r0, 16 + adds r6, r2, 0 + cmp r1, 0 + blt _080D2208 + cmp r1, r7 + bgt _080D2208 +_080D218A: + asrs r4, r0, 16 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 4 + add r0, r8 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _080D21B4 + asrs r0, r6, 16 + adds r0, r4, r0 + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + blt _080D2208 + cmp r2, r7 + ble _080D218A + b _080D2208 + .pool +_080D21B4: + adds r0, r4, 0 + b _080D220C +_080D21B8: + adds r0, r5, 0 + b _080D220C +_080D21BC: + lsls r0, 24 + asrs r0, 24 + lsls r2, 16 + asrs r1, r2, 16 + adds r1, r0 + lsls r0, r1, 16 + asrs r1, r0, 16 + adds r6, r2, 0 + cmp r1, 0 + blt _080D2208 + cmp r1, r7 + bgt _080D2208 +_080D21D4: + asrs r5, r0, 16 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 4 + mov r1, r8 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080D21F8 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080D21B8 +_080D21F8: + asrs r0, r6, 16 + adds r0, r5, r0 + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + blt _080D2208 + cmp r2, r7 + ble _080D21D4 +_080D2208: + movs r0, 0x1 + negs r0, r0 +_080D220C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D214C + + thumb_func_start sub_80D2218 +sub_80D2218: @ 80D2218 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + movs r2, 0 + ldr r0, =0x03005d94 + mov r8, r0 + movs r7, 0x4 +_080D2228: + movs r5, 0 + adds r6, r7, 0 + movs r4, 0 +_080D222E: + mov r1, r8 + ldr r0, [r1] + adds r0, r6 + adds r0, r4 + movs r1, 0x5 + str r2, [sp] + bl pokemon_getattr_encrypted + ldr r2, [sp] + cmp r0, 0 + bne _080D224C + movs r0, 0x1 + b _080D2262 + .pool +_080D224C: + adds r4, 0x50 + adds r5, 0x1 + cmp r5, 0x1D + ble _080D222E + movs r0, 0x96 + lsls r0, 4 + adds r7, r0 + adds r2, 0x1 + cmp r2, 0xD + ble _080D2228 + movs r0, 0 +_080D2262: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D2218 + + thumb_func_start sub_80D2270 +sub_80D2270: @ 80D2270 + push {r4-r6,lr} + adds r2, r1, 0 + cmp r0, 0xD + bhi _080D22C8 + cmp r2, 0x1D + bhi _080D22C8 + ldr r6, =0x03005d94 + lsls r1, r0, 2 + adds r1, r0 + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 5 + adds r5, r0, 0x4 + ldr r0, [r6] + adds r0, r5 + lsls r1, r2, 2 + adds r1, r2 + lsls r4, r1, 4 + adds r0, r4 + movs r1, 0x5 + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080D22C8 + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + movs r1, 0x6 + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _080D22C8 + ldr r0, [r6] + adds r0, r5 + adds r0, r4 + movs r1, 0x4 + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _080D22C8 + movs r0, 0x1 + b _080D22CA + .pool +_080D22C8: + movs r0, 0 +_080D22CA: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80D2270 + + thumb_func_start sub_80D22D0 +sub_80D22D0: @ 80D22D0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r7, 0 + movs r0, 0 + ldr r1, =0x03005d94 + mov r9, r1 +_080D22E0: + lsls r1, r0, 2 + adds r2, r0, 0x1 + mov r8, r2 + adds r1, r0 + movs r5, 0 + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 5 + adds r4, r0, 0x4 + movs r6, 0x1D +_080D22F4: + mov r1, r9 + ldr r0, [r1] + adds r0, r4 + adds r0, r5 + movs r1, 0x5 + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080D231A + mov r2, r9 + ldr r0, [r2] + adds r0, r4 + adds r0, r5 + movs r1, 0x6 + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _080D231A + adds r7, 0x1 +_080D231A: + adds r5, 0x50 + subs r6, 0x1 + cmp r6, 0 + bge _080D22F4 + mov r0, r8 + cmp r0, 0xD + ble _080D22E0 + adds r0, r7, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D22D0 + + thumb_func_start sub_80D233C +sub_80D233C: @ 80D233C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r7, 0 + movs r0, 0 + ldr r1, =0x03005d94 + mov r9, r1 +_080D234C: + lsls r1, r0, 2 + adds r2, r0, 0x1 + mov r8, r2 + adds r1, r0 + movs r5, 0 + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 5 + adds r4, r0, 0x4 + movs r6, 0x1D +_080D2360: + mov r1, r9 + ldr r0, [r1] + adds r0, r4 + adds r0, r5 + movs r1, 0x5 + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _080D2384 + mov r2, r9 + ldr r0, [r2] + adds r0, r4 + adds r0, r5 + movs r1, 0x6 + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080D2386 +_080D2384: + adds r7, 0x1 +_080D2386: + adds r5, 0x50 + subs r6, 0x1 + cmp r6, 0 + bge _080D2360 + mov r0, r8 + cmp r0, 0xD + ble _080D234C + adds r0, r7, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D233C + + thumb_func_start sub_80D23A8 +sub_80D23A8: @ 80D23A8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + mov r1, sp + strh r0, [r1] + ldr r0, =0x00000163 + strh r0, [r1, 0x2] + movs r0, 0 + mov r8, r0 + ldr r7, =0x03005d94 + movs r5, 0x4 +_080D23C0: + movs r6, 0 + movs r4, 0 +_080D23C4: + ldr r0, [r7] + adds r0, r5 + adds r0, r4 + movs r1, 0x5 + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080D2404 + ldr r0, [r7] + adds r0, r5 + adds r0, r4 + movs r1, 0x6 + bl pokemon_getattr_encrypted + cmp r0, 0 + bne _080D2404 + ldr r0, [r7] + adds r0, r5 + adds r0, r4 + movs r1, 0x51 + mov r2, sp + bl pokemon_getattr_encrypted + cmp r0, 0 + beq _080D2404 + movs r0, 0x1 + b _080D241E + .pool +_080D2404: + adds r4, 0x50 + adds r6, 0x1 + cmp r6, 0x1D + ble _080D23C4 + movs r0, 0x96 + lsls r0, 4 + adds r5, r0 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0xD + ble _080D23C0 + movs r0, 0 +_080D241E: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D23A8 + + thumb_func_start sub_80D242C +sub_80D242C: @ 80D242C + ldr r2, =0x03005d8c + ldr r0, [r2] + ldr r1, =0x00003d84 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + ldr r3, =0x00003d85 + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + adds r3, 0x1 + adds r0, r3 + strb r1, [r0] + ldr r1, [r2] + ldr r0, =0x00003d70 + adds r2, r1, r0 + ldr r0, =0x00007b35 + strh r0, [r2] + subs r3, 0x14 + adds r2, r1, r3 + ldr r0, =0x00006186 + strh r0, [r2] + ldr r0, =0x00003d74 + adds r1, r0 + movs r0, 0xFF + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_80D242C + + thumb_func_start sub_80D2480 +sub_80D2480: @ 80D2480 + ldr r1, =0x03005d8c + ldr r1, [r1] + ldr r2, =0x00003d86 + adds r1, r2 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_80D2480 + + thumb_func_start sub_80D2494 +sub_80D2494: @ 80D2494 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003d86 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80D2494 + + thumb_func_start sub_80D24A8 +sub_80D24A8: @ 80D24A8 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003d85 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80D24A8 + + thumb_func_start sub_80D24BC +sub_80D24BC: @ 80D24BC + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bhi _080D24D0 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00003d85 + adds r0, r2 + strb r1, [r0] +_080D24D0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D24BC + + thumb_func_start sub_80D24DC +sub_80D24DC: @ 80D24DC + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003d84 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80D24DC + + thumb_func_start sub_80D24F0 +sub_80D24F0: @ 80D24F0 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1D + bhi _080D2504 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00003d84 + adds r0, r2 + strb r1, [r0] +_080D2504: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D24F0 + + thumb_func_start sub_80D2510 +sub_80D2510: @ 80D2510 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003d70 + adds r0, r1 + bx lr + .pool + thumb_func_end sub_80D2510 + + thumb_func_start sub_80D2524 +sub_80D2524: @ 80D2524 + push {r4,lr} + ldr r2, =0x03005d8c + ldr r2, [r2] + ldr r4, =0x00003d70 + adds r3, r2, r4 + strh r0, [r3] + ldr r0, =0x00003d72 + adds r2, r0 + strh r1, [r2] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D2524 + + thumb_func_start sub_80D2548 +sub_80D2548: @ 80D2548 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003d74 + adds r0, r1 + bx lr + .pool + thumb_func_end sub_80D2548 + + thumb_func_start sub_80D255C +sub_80D255C: @ 80D255C + push {lr} + adds r1, r0, 0 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00003d74 + adds r0, r2 + bl CopyString + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D255C + + thumb_func_start sub_80D2578 +sub_80D2578: @ 80D2578 + push {lr} + movs r1, 0 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00003d74 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080D258C + movs r1, 0x1 +_080D258C: + adds r0, r1, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D2578 + + thumb_func_start sub_80D259C +sub_80D259C: @ 80D259C + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r6, =0x02039d84 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 4 + bl Alloc + str r0, [r6] + ldr r5, =0x02039d88 + movs r1, 0 + cmp r0, 0 + beq _080D25BA + adds r1, r4, 0 +_080D25BA: + strh r1, [r5] + movs r2, 0 + cmp r2, r1 + bcs _080D25E2 + movs r3, 0 + adds r4, r5, 0 +_080D25C6: + ldr r0, [r6] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 4 + adds r1, r0 + str r3, [r1, 0x18] + adds r1, 0x2C + strb r3, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r0, [r4] + cmp r2, r0 + bcc _080D25C6 +_080D25E2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D259C + + thumb_func_start sub_80D25F0 +sub_80D25F0: @ 80D25F0 + push {lr} + ldr r0, =0x02039d84 + ldr r0, [r0] + bl Free + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D25F0 + + thumb_func_start sub_80D2604 +sub_80D2604: @ 80D2604 + push {r4,r5,lr} + movs r4, 0 + ldr r0, =0x02039d88 + ldrh r0, [r0] + cmp r4, r0 + bge _080D2634 + movs r5, 0 +_080D2612: + ldr r0, =0x02039d84 + ldr r0, [r0] + adds r0, r5, r0 + adds r0, 0x2C + ldrb r0, [r0] + cmp r0, 0x1 + bne _080D2628 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80D2918 +_080D2628: + adds r5, 0x30 + adds r4, 0x1 + ldr r0, =0x02039d88 + ldrh r0, [r0] + cmp r4, r0 + blt _080D2612 +_080D2634: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D2604 + + thumb_func_start sub_80D2644 +sub_80D2644: @ 80D2644 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r4, r2, 0 + ldr r2, [sp, 0x24] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r3, 16 + lsrs r3, 16 + mov r10, r3 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp] + ldr r0, =0x02039d88 + ldrh r0, [r0] + cmp r6, r0 + bcs _080D272C + ldr r0, =0x02039d84 + mov r9, r0 + ldr r0, [r0] + lsls r1, r6, 1 + mov r8, r1 + adds r5, r1, r6 + lsls r5, 4 + adds r0, r5, r0 + movs r1, 0 + str r1, [r0, 0x18] + str r4, [r0, 0x1C] + adds r0, 0x2B + strb r7, [r0] + mov r2, r9 + ldr r0, [r2] + adds r0, r5, r0 + mov r3, r10 + strh r3, [r0, 0x24] + mov r1, sp + ldrh r1, [r1] + strh r1, [r0, 0x26] + adds r0, r7, 0 + movs r1, 0x3 + bl GetBgAttribute + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r7, 0 + movs r1, 0x9 + bl GetBgAttribute + lsls r0, 16 + lsrs r0, 16 + mov r2, r9 + ldr r1, [r2] + adds r5, r1 + ldr r2, =gUnknown_0857BC88 + lsls r4, 2 + lsls r1, r0, 4 + adds r4, r1 + adds r4, r2 + ldrh r1, [r4] + strh r1, [r5, 0x20] + ldrh r1, [r4, 0x2] + strh r1, [r5, 0x22] + mov r2, r8 + cmp r0, 0 + beq _080D26E8 + adds r1, r5, 0 + adds r1, 0x2A + movs r0, 0x1 + b _080D26EE + .pool +_080D26E8: + adds r1, r5, 0 + adds r1, 0x2A + movs r0, 0x2 +_080D26EE: + strb r0, [r1] + ldr r4, =0x02039d84 + ldr r1, [r4] + adds r2, r6 + lsls r2, 4 + adds r1, r2, r1 + adds r0, r1, 0 + adds r0, 0x2A + ldrb r0, [r0] + mov r3, r10 + muls r3, r0 + movs r0, 0 + strh r3, [r1, 0x28] + mov r3, r10 + strh r3, [r1, 0x10] + mov r5, sp + ldrh r5, [r5] + strh r5, [r1, 0x12] + strh r0, [r1, 0xC] + strh r0, [r1, 0xE] + strh r0, [r1, 0x14] + strh r0, [r1, 0x16] + adds r0, r1, 0 + adds r0, 0xC + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + ldr r0, [r4] + adds r2, r0 + adds r2, 0x2C + movs r0, 0x1 + strb r0, [r2] +_080D272C: + 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_80D2644 + + thumb_func_start sub_80D2740 +sub_80D2740: @ 80D2740 + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02039d88 + ldrh r0, [r0] + cmp r2, r0 + bcs _080D2764 + ldr r0, =0x02039d84 + ldr r1, [r0] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 4 + adds r0, r1 + str r3, [r0, 0x18] + adds r0, 0x2C + movs r1, 0x1 + strb r1, [r0] +_080D2764: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D2740 + + thumb_func_start sub_80D2770 +sub_80D2770: @ 80D2770 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 16 + lsrs r2, 16 + ldr r0, =0x02039d88 + ldrh r0, [r0] + cmp r3, r0 + bcs _080D279C + ldr r0, =0x02039d84 + ldr r1, [r0] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 4 + adds r0, r1 + strh r4, [r0, 0x14] + strh r2, [r0, 0x16] + adds r0, 0x2C + movs r1, 0x1 + strb r1, [r0] +_080D279C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D2770 + + thumb_func_start sub_80D27AC +sub_80D27AC: @ 80D27AC + push {r4-r6,lr} + ldr r4, [sp, 0x10] + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =0x02039d88 + ldrh r0, [r0] + cmp r5, r0 + bcs _080D27E6 + ldr r0, =0x02039d84 + ldr r1, [r0] + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 4 + adds r0, r1 + strh r6, [r0, 0xC] + strh r2, [r0, 0xE] + strh r3, [r0, 0x10] + strh r4, [r0, 0x12] + adds r0, 0x2C + movs r1, 0x1 + strb r1, [r0] +_080D27E6: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D27AC + + thumb_func_start sub_80D27F4 +sub_80D27F4: @ 80D27F4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r0, =0x02039d88 + ldrh r0, [r0] + cmp r5, r0 + bcc _080D280C + b _080D290E +_080D280C: + ldr r4, =0x02039d84 + lsls r2, r5, 1 + cmp r1, 0x5 + bls _080D2816 + b _080D2900 +_080D2816: + lsls r0, r1, 2 + ldr r1, =_080D282C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080D282C: + .4byte _080D2844 + .4byte _080D2864 + .4byte _080D2888 + .4byte _080D28A8 + .4byte _080D28CC + .4byte _080D28E8 +_080D2844: + ldr r4, =0x02039d84 + ldr r0, [r4] + lsls r3, r5, 1 + adds r1, r3, r5 + lsls r1, 4 + adds r1, r0 + lsls r2, r6, 24 + asrs r2, 24 + ldrh r0, [r1, 0x14] + adds r0, r2 + strh r0, [r1, 0x14] + ldrh r0, [r1, 0x10] + subs r0, r2 + b _080D287E + .pool +_080D2864: + ldr r4, =0x02039d84 + ldr r0, [r4] + lsls r3, r5, 1 + adds r1, r3, r5 + lsls r1, 4 + adds r1, r0 + lsls r2, r6, 24 + asrs r2, 24 + ldrh r0, [r1, 0xC] + adds r0, r2 + strh r0, [r1, 0xC] + ldrh r0, [r1, 0x10] + adds r0, r2 +_080D287E: + strh r0, [r1, 0x10] + adds r2, r3, 0 + b _080D2900 + .pool +_080D2888: + ldr r4, =0x02039d84 + ldr r0, [r4] + lsls r3, r5, 1 + adds r1, r3, r5 + lsls r1, 4 + adds r1, r0 + lsls r2, r6, 24 + asrs r2, 24 + ldrh r0, [r1, 0x16] + adds r0, r2 + strh r0, [r1, 0x16] + ldrh r0, [r1, 0x12] + subs r0, r2 + b _080D28C2 + .pool +_080D28A8: + ldr r4, =0x02039d84 + ldr r0, [r4] + lsls r3, r5, 1 + adds r1, r3, r5 + lsls r1, 4 + adds r1, r0 + lsls r2, r6, 24 + asrs r2, 24 + ldrh r0, [r1, 0xE] + subs r0, r2 + strh r0, [r1, 0xE] + ldrh r0, [r1, 0x12] + adds r0, r2 +_080D28C2: + strh r0, [r1, 0x12] + adds r2, r3, 0 + b _080D2900 + .pool +_080D28CC: + ldr r3, =0x02039d84 + ldr r0, [r3] + lsls r2, r5, 1 + adds r1, r2, r5 + lsls r1, 4 + adds r1, r0 + lsls r0, r6, 24 + asrs r0, 24 + ldrh r4, [r1, 0x14] + adds r0, r4 + strh r0, [r1, 0x14] + b _080D28FE + .pool +_080D28E8: + ldr r3, =0x02039d84 + ldr r0, [r3] + lsls r2, r5, 1 + adds r1, r2, r5 + lsls r1, 4 + adds r1, r0 + lsls r0, r6, 24 + asrs r0, 24 + ldrh r4, [r1, 0x16] + adds r0, r4 + strh r0, [r1, 0x16] +_080D28FE: + adds r4, r3, 0 +_080D2900: + ldr r0, [r4] + adds r1, r2, r5 + lsls r1, 4 + adds r1, r0 + adds r1, 0x2C + movs r0, 0x1 + strb r0, [r1] +_080D290E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D27F4 + + thumb_func_start sub_80D2918 +sub_80D2918: @ 80D2918 + push {r4-r6,lr} + lsls r0, 24 + lsrs r2, r0, 24 + adds r6, r2, 0 + ldr r0, =0x02039d88 + ldrh r0, [r0] + cmp r2, r0 + bcs _080D2952 + ldr r5, =0x02039d84 + ldr r0, [r5] + lsls r1, r2, 1 + adds r1, r2 + lsls r4, r1, 4 + adds r0, r4, r0 + ldr r0, [r0, 0x18] + cmp r0, 0 + beq _080D2940 + adds r0, r2, 0 + bl sub_80D2960 +_080D2940: + adds r0, r6, 0 + bl sub_80D29F8 + ldr r1, [r5] + adds r1, r4, r1 + adds r0, r1, 0 + adds r0, 0xC + ldm r0!, {r2-r4} + stm r1!, {r2-r4} +_080D2952: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D2918 + + thumb_func_start sub_80D2960 +sub_80D2960: @ 80D2960 + 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 + ldr r4, =0x02039d84 + ldr r1, [r4] + lsls r5, r0, 1 + adds r0, r5, r0 + lsls r0, 4 + adds r0, r1 + adds r1, r0, 0 + adds r1, 0x2A + ldrb r3, [r1] + ldrh r1, [r0, 0x20] + adds r2, r3, 0 + muls r2, r1 + mov r9, r2 + movs r6, 0xA + ldrsh r1, [r0, r6] + mov r2, r9 + muls r2, r1 + ldr r1, [r0, 0x18] + adds r1, r2 + movs r6, 0x8 + ldrsh r2, [r0, r6] + muls r2, r3 + adds r7, r1, r2 + movs r6, 0 + ldrh r0, [r0, 0x6] + cmp r6, r0 + bge _080D29E4 + mov r10, r4 +_080D29AA: + mov r0, r10 + ldr r1, [r0] + mov r2, r8 + adds r4, r5, r2 + lsls r4, 4 + adds r1, r4, r1 + adds r0, r1, 0 + adds r0, 0x2B + ldrb r0, [r0] + ldrb r2, [r1, 0x8] + ldrb r3, [r1, 0xA] + adds r3, r6 + lsls r3, 24 + lsrs r3, 24 + ldrb r1, [r1, 0x4] + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + adds r1, r7, 0 + bl CopyToBgTilemapBufferRect + add r7, r9 + adds r6, 0x1 + mov r1, r10 + ldr r0, [r1] + adds r4, r0 + ldrh r4, [r4, 0x6] + cmp r6, r4 + blt _080D29AA +_080D29E4: + 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_80D2960 + + thumb_func_start sub_80D29F8 +sub_80D29F8: @ 80D29F8 + 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 + ldr r4, =0x02039d84 + ldr r1, [r4] + lsls r5, r0, 1 + adds r0, r5, r0 + lsls r0, 4 + adds r0, r1 + adds r1, r0, 0 + adds r1, 0x2A + ldrb r3, [r1] + ldrh r1, [r0, 0x24] + adds r2, r3, 0 + muls r2, r1 + mov r9, r2 + movs r6, 0xE + ldrsh r1, [r0, r6] + mov r2, r9 + muls r2, r1 + ldr r1, [r0, 0x1C] + adds r1, r2 + movs r6, 0xC + ldrsh r2, [r0, r6] + muls r2, r3 + adds r7, r1, r2 + movs r6, 0 + ldrh r0, [r0, 0x12] + cmp r6, r0 + bge _080D2A7C + mov r10, r4 +_080D2A42: + mov r0, r10 + ldr r1, [r0] + mov r2, r8 + adds r4, r5, r2 + lsls r4, 4 + adds r1, r4, r1 + adds r0, r1, 0 + adds r0, 0x2B + ldrb r0, [r0] + ldrb r2, [r1, 0x14] + ldrb r3, [r1, 0x16] + adds r3, r6 + lsls r3, 24 + lsrs r3, 24 + ldrb r1, [r1, 0x10] + str r1, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + adds r1, r7, 0 + bl CopyToBgTilemapBufferRect + add r7, r9 + adds r6, 0x1 + mov r1, r10 + ldr r0, [r1] + adds r4, r0 + ldrh r4, [r4, 0x12] + cmp r6, r4 + blt _080D2A42 +_080D2A7C: + 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_80D29F8 + + thumb_func_start sub_80D2A90 +sub_80D2A90: @ 80D2A90 + ldr r3, =0x02039d8c + str r0, [r3] + str r1, [r0] + movs r1, 0 + strb r2, [r0, 0x5] + strb r1, [r0, 0x4] + bx lr + .pool + thumb_func_end sub_80D2A90 + + thumb_func_start sub_80D2AA4 +sub_80D2AA4: @ 80D2AA4 + push {r4,r5,lr} + ldr r2, =0x02039d8c + ldr r1, [r2] + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _080D2AE2 + movs r4, 0 + ldrb r1, [r1, 0x4] + cmp r4, r1 + bcs _080D2ADA + adds r5, r2, 0 +_080D2ABA: + ldr r0, [r5] + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 2 + ldr r0, [r0] + adds r0, r1 + ldr r1, [r0, 0x10] + bl _call_via_r1 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, [r5] + ldrb r0, [r0, 0x4] + cmp r4, r0 + bcc _080D2ABA +_080D2ADA: + ldr r0, =0x02039d8c + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x4] +_080D2AE2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D2AA4 + + thumb_func_start sub_80D2AEC +sub_80D2AEC: @ 80D2AEC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r9, r0 + mov r10, r3 + ldr r0, [sp, 0x24] + ldr r3, [sp, 0x28] + ldr r4, [sp, 0x2C] + ldr r5, [sp, 0x30] + ldr r6, [sp, 0x34] + lsls r1, 16 + lsrs r1, 16 + mov r12, r1 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp] + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r3, 16 + lsrs r3, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 16 + lsrs r6, 16 + ldr r0, =0x02039d8c + ldr r2, [r0] + ldrb r0, [r2, 0x4] + adds r1, r0, 0 + ldrb r7, [r2, 0x5] + cmp r1, r7 + bcs _080D2B74 + adds r0, 0x1 + strb r0, [r2, 0x4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r1, r0 + lsls r0, r4, 1 + strh r0, [r1, 0x8] + ldr r2, [sp] + lsls r0, r2, 5 + add r0, r12 + lsls r0, 1 + add r0, r9 + str r0, [r1, 0x4] + adds r0, r3, 0 + muls r0, r6 + add r0, r8 + lsls r0, 1 + add r0, r10 + str r0, [r1] + strh r5, [r1, 0xC] + strh r6, [r1, 0xA] + ldr r0, =sub_80D2B88 + str r0, [r1, 0x10] + movs r0, 0x1 + b _080D2B76 + .pool +_080D2B74: + movs r0, 0 +_080D2B76: + 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_80D2AEC + + thumb_func_start sub_80D2B88 +sub_80D2B88: @ 80D2B88 + push {r4,r5,lr} + adds r4, r0, 0 + movs r5, 0 + b _080D2BB2 +_080D2B90: + ldr r0, [r4] + ldr r1, [r4, 0x4] + ldrh r2, [r4, 0x8] + lsrs r2, 1 + bl CpuSet + ldr r0, [r4, 0x4] + adds r0, 0x40 + str r0, [r4, 0x4] + ldrh r1, [r4, 0xA] + lsls r1, 1 + ldr r0, [r4] + adds r0, r1 + str r0, [r4] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_080D2BB2: + ldrh r0, [r4, 0xC] + cmp r5, r0 + bcc _080D2B90 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80D2B88 + + thumb_func_start sub_80D2BC0 +sub_80D2BC0: @ 80D2BC0 + push {r4-r7,lr} + mov r12, r0 + ldr r0, [sp, 0x14] + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 16 + lsrs r4, r2, 16 + lsls r3, 16 + lsrs r3, 16 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =0x02039d8c + ldr r2, [r0] + ldrb r0, [r2, 0x4] + adds r1, r0, 0 + ldrb r7, [r2, 0x5] + cmp r1, r7 + bcs _080D2C14 + adds r0, 0x1 + strb r0, [r2, 0x4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r1, r0 + lsls r0, r3, 1 + strh r0, [r1, 0x8] + lsls r0, r4, 5 + adds r0, r6 + lsls r0, 1 + add r0, r12 + str r0, [r1, 0x4] + strh r5, [r1, 0xC] + ldr r0, =sub_80D2C1C + str r0, [r1, 0x10] + movs r0, 0x1 + b _080D2C16 + .pool +_080D2C14: + movs r0, 0 +_080D2C16: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D2BC0 + + thumb_func_start sub_80D2C1C +sub_80D2C1C: @ 80D2C1C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r6, r0, 0 + movs r0, 0 + ldrh r1, [r6, 0xC] + cmp r0, r1 + bcs _080D2CAA + movs r7, 0x80 + lsls r7, 5 + mov r5, sp + ldr r2, =0x040000d4 + mov r8, r2 + movs r1, 0x81 + lsls r1, 24 + mov r10, r1 +_080D2C42: + ldr r2, [r6, 0x4] + ldrh r3, [r6, 0x8] + mov r12, r2 + adds r0, 0x1 + mov r9, r0 + cmp r3, r7 + bhi _080D2C6C + movs r0, 0 + strh r0, [r5] + mov r2, sp + mov r0, r8 + str r2, [r0] + mov r1, r12 + str r1, [r0, 0x4] + lsrs r0, r3, 1 + mov r2, r10 + orrs r0, r2 + mov r1, r8 + b _080D2C94 + .pool +_080D2C6C: + movs r4, 0 + strh r4, [r5] + ldr r1, =0x040000d4 + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + ldr r0, =0x81000800 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r2, r7 + subs r3, r7 + cmp r3, r7 + bhi _080D2C6C + strh r4, [r5] + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + lsrs r0, r3, 1 + mov r2, r10 + orrs r0, r2 +_080D2C94: + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + mov r0, r12 + adds r0, 0x40 + str r0, [r6, 0x4] + mov r1, r9 + lsls r0, r1, 16 + lsrs r0, 16 + ldrh r2, [r6, 0xC] + cmp r0, r2 + bcc _080D2C42 +_080D2CAA: + 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_80D2C1C + + thumb_func_start sub_80D2CC4 +@ int sub_80D2CC4(u16 speciesId, int a2, u16 a3, u16 a4, u8 a5, u32 personality, int a7) +sub_80D2CC4: @ 80D2CC4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x30 + adds r4, r0, 0 + adds r6, r1, 0 + ldr r0, [sp, 0x4C] + ldr r1, [sp, 0x50] + ldr r5, [sp, 0x54] + lsls r4, 16 + lsrs r4, 16 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + lsls r3, 16 + lsrs r7, r3, 16 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r0, =gUnknown_0857C570 + str r0, [sp, 0x18] + adds r0, r4, 0 + adds r2, r5, 0 + bl sub_80D2EDC + str r0, [sp, 0x1C] + ldr r0, =gUnknown_0857C5B4 + str r0, [sp, 0x20] + ldr r0, =gUnknown_0857C5E8 + str r0, [sp, 0x24] + str r6, [sp, 0x28] + ldr r0, =gMonIconPaletteIndices + adds r0, r4, r0 + ldr r1, =0x0000dac0 + adds r5, r1, 0 + ldrb r0, [r0] + adds r1, r5, r0 + add r0, sp, 0x2C + strh r1, [r0] + add r1, sp, 0x18 + mov r0, sp + movs r2, 0x18 + bl memcpy + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + bls _080D2D2A + mov r0, sp + strh r5, [r0, 0x14] +_080D2D2A: + mov r0, r8 + lsls r1, r0, 16 + asrs r1, 16 + lsls r2, r7, 16 + asrs r2, 16 + mov r0, sp + mov r3, r9 + bl sub_80D31B4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl sub_80D30DC + adds r0, r4, 0 + add sp, 0x30 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D2CC4 + + thumb_func_start sub_80D2D78 +sub_80D2D78: @ 80D2D78 + push {r4-r7,lr} + sub sp, 0x18 + adds r4, r2, 0 + adds r5, r3, 0 + ldr r6, [sp, 0x2C] + lsls r0, 16 + lsrs r0, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 24 + lsrs r6, 24 + mov r3, sp + ldr r2, =gUnknown_0857C570 + str r2, [sp] + movs r2, 0 + str r2, [sp, 0x4] + ldr r2, =gUnknown_0857C5B4 + str r2, [sp, 0x8] + ldr r2, =gUnknown_0857C5E8 + str r2, [sp, 0xC] + str r1, [sp, 0x10] + ldr r2, =gMonIconPaletteIndices + adds r2, r0, r2 + ldr r7, =0x0000dac0 + adds r1, r7, 0 + ldrb r2, [r2] + adds r1, r2 + strh r1, [r3, 0x14] + ldr r1, [sp, 0x30] + bl GetMonIconTiles + str r0, [sp, 0x4] + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + mov r0, sp + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_80D31B4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl sub_80D30DC + adds r0, r4, 0 + add sp, 0x18 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D2D78 + + thumb_func_start mon_icon_convert_unown_species_id +@ u16 mon_icon_convert_unown_species_id(u16 speciesId, u32 personality) +mon_icon_convert_unown_species_id: @ 80D2E08 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0xC9 + bne _080D2E32 + adds r0, r1, 0 + bl mon_icon_personality_to_unown_id + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + bne _080D2E24 + movs r0, 0xC9 + b _080D2E2E +_080D2E24: + movs r1, 0xCE + lsls r1, 1 + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 +_080D2E2E: + adds r1, r0, 0 + b _080D2E40 +_080D2E32: + movs r0, 0xCE + lsls r0, 1 + adds r1, r2, 0 + cmp r1, r0 + bls _080D2E40 + movs r1, 0x82 + lsls r1, 1 +_080D2E40: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end mon_icon_convert_unown_species_id + + thumb_func_start mon_icon_personality_to_unown_id +mon_icon_personality_to_unown_id: @ 80D2E48 + push {lr} + adds r2, r0, 0 + cmp r2, 0 + beq _080D2E7E + movs r0, 0xC0 + lsls r0, 18 + ands r0, r2 + lsrs r0, 18 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r2 + lsrs r1, 12 + orrs r0, r1 + movs r1, 0xC0 + lsls r1, 2 + ands r1, r2 + lsrs r1, 6 + orrs r0, r1 + movs r1, 0x3 + ands r1, r2 + orrs r0, r1 + movs r1, 0x1C + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + b _080D2E80 +_080D2E7E: + movs r0, 0 +_080D2E80: + pop {r1} + bx r1 + thumb_func_end mon_icon_personality_to_unown_id + + thumb_func_start sub_80D2E84 +sub_80D2E84: @ 80D2E84 + push {r4,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + mov r1, sp + bl sub_80D45E8 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xC9 + bne _080D2EBA + mov r0, sp + ldrh r0, [r0] + cmp r0, 0 + bne _080D2EAA + mov r1, sp + adds r0, 0xC9 + b _080D2EB2 +_080D2EAA: + mov r1, sp + movs r2, 0xCE + lsls r2, 1 + adds r0, r2 +_080D2EB2: + strh r0, [r1] + mov r0, sp + ldrh r0, [r0] + b _080D2ED2 +_080D2EBA: + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + bls _080D2EC6 + movs r4, 0x82 + lsls r4, 1 +_080D2EC6: + adds r0, r4, 0 + movs r1, 0 + bl mon_icon_convert_unown_species_id + lsls r0, 16 + lsrs r0, 16 +_080D2ED2: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80D2E84 + + thumb_func_start sub_80D2EDC +@ void *sub_80D2EDC(u16 speciesId, u32 personality, bool32) +sub_80D2EDC: @ 80D2EDC + push {r4,lr} + adds r4, r2, 0 + lsls r0, 16 + lsrs r0, 16 + bl mon_icon_convert_unown_species_id + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl GetMonIconTiles + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80D2EDC + + thumb_func_start sub_80D2EF8 +sub_80D2EF8: @ 80D2EF8 + push {lr} + bl sub_80D328C + pop {r0} + bx r0 + thumb_func_end sub_80D2EF8 + + thumb_func_start sub_80D2F04 +sub_80D2F04: @ 80D2F04 + push {r4,r5,lr} + movs r4, 0 + ldr r5, =gMonIconPaletteTable +_080D2F0A: + lsls r0, r4, 3 + adds r0, r5 + bl LoadTaggedObjectPalette + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _080D2F0A + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D2F04 + + thumb_func_start sub_80D2F28 +sub_80D2F28: @ 80D2F28 + push {r4,lr} + lsls r0, 16 + lsrs r1, r0, 16 + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + bls _080D2F3A + movs r1, 0x82 + lsls r1, 1 +_080D2F3A: + ldr r0, =gMonIconPaletteIndices + adds r0, r1, r0 + ldrb r0, [r0] + ldr r1, =gMonIconPaletteTable + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x4] + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _080D2F5A + adds r0, r4, 0 + bl LoadTaggedObjectPalette +_080D2F5A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D2F28 + + thumb_func_start sub_80D2F68 +sub_80D2F68: @ 80D2F68 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gMonIconPaletteIndices + adds r0, r1 + ldrb r0, [r0] + ldr r1, =gMonIconPaletteTable + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x4] + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _080D2F8E + adds r0, r4, 0 + bl LoadTaggedObjectPalette +_080D2F8E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D2F68 + + thumb_func_start sub_80D2F9C +sub_80D2F9C: @ 80D2F9C + push {r4,r5,lr} + movs r4, 0 + ldr r5, =gMonIconPaletteTable +_080D2FA2: + lsls r0, r4, 3 + adds r0, r5 + ldrh r0, [r0, 0x4] + bl FreeObjectPaletteByTag + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _080D2FA2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D2F9C + + thumb_func_start sub_80D2FC0 +sub_80D2FC0: @ 80D2FC0 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + bls _080D2FD2 + movs r1, 0x82 + lsls r1, 1 +_080D2FD2: + ldr r0, =gMonIconPaletteIndices + adds r0, r1, r0 + ldrb r0, [r0] + ldr r1, =gMonIconPaletteTable + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x4] + bl FreeObjectPaletteByTag + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D2FC0 + + thumb_func_start sub_80D2FF0 +sub_80D2FF0: @ 80D2FF0 + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gMonIconPaletteIndices + adds r0, r1 + ldrb r0, [r0] + ldr r1, =gMonIconPaletteTable + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x4] + bl FreeObjectPaletteByTag + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D2FF0 + + thumb_func_start sub_80D3014 +sub_80D3014: @ 80D3014 + push {lr} + bl sub_80D30DC + pop {r0} + bx r0 + thumb_func_end sub_80D3014 + + thumb_func_start GetMonIconTiles +@ void *GetMonIconTiles(u16 speciesId, bool32) +GetMonIconTiles: @ 80D3020 + push {lr} + adds r3, r1, 0 + lsls r0, 16 + lsrs r0, 16 + ldr r2, =gMonIconTable + lsls r1, r0, 2 + adds r1, r2 + ldr r2, [r1] + movs r1, 0xCD + lsls r1, 1 + cmp r0, r1 + bne _080D3042 + cmp r3, 0x1 + bne _080D3042 + movs r0, 0x80 + lsls r0, 3 + adds r2, r0 +_080D3042: + adds r0, r2, 0 + pop {r1} + bx r1 + .pool + thumb_func_end GetMonIconTiles + + thumb_func_start sub_80D304C +sub_80D304C: @ 80D304C + push {r4-r6,lr} + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0xA0 + bhi _080D3074 + ldr r6, =gMonIconPaletteTable + movs r5, 0x5 +_080D305A: + ldr r0, [r6] + adds r1, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + adds r0, r4, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r4, r0, 16 + adds r6, 0x8 + subs r5, 0x1 + cmp r5, 0 + bge _080D305A +_080D3074: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D304C + + thumb_func_start sub_80D3080 +sub_80D3080: @ 80D3080 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + bls _080D3092 + movs r1, 0x82 + lsls r1, 1 +_080D3092: + ldr r0, =gMonIconPaletteIndices + adds r0, r1, r0 + ldrb r0, [r0] + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D3080 + + thumb_func_start sub_80D30A0 +sub_80D30A0: @ 80D30A0 + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gMonIconPaletteIndices + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80D30A0 + + thumb_func_start sub_80D30B0 +sub_80D30B0: @ 80D30B0 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + movs r0, 0xCE + lsls r0, 1 + cmp r2, r0 + bls _080D30C2 + movs r2, 0x82 + lsls r2, 1 +_080D30C2: + ldr r1, =gMonIconPaletteTable + ldr r0, =gMonIconPaletteIndices + adds r0, r2, r0 + ldrb r0, [r0] + lsls r0, 3 + adds r0, r1 + ldr r0, [r0] + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D30B0 + + thumb_func_start sub_80D30DC +sub_80D30DC: @ 80D30DC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r4, r0, 0 + movs r7, 0 + adds r6, r4, 0 + adds r6, 0x2C + ldrb r2, [r6] + movs r0, 0x3F + mov r9, r0 + ands r0, r2 + cmp r0, 0 + bne _080D3190 + movs r1, 0x2A + adds r1, r4 + mov r8, r1 + ldrb r1, [r1] + ldr r0, [r4, 0x8] + lsls r1, 2 + adds r1, r0 + adds r5, r4, 0 + adds r5, 0x2B + ldrb r0, [r5] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + movs r1, 0 + ldrsh r3, [r0, r1] + movs r0, 0x2 + negs r0, r0 + cmp r3, r0 + beq _080D3126 + adds r0, 0x1 + cmp r3, r0 + bne _080D312A + b _080D31A4 +_080D3126: + strb r7, [r5] + b _080D31A4 +_080D312A: + ldr r2, =gUnknown_0857C5F0 + ldrb r1, [r4, 0x3] + lsrs r1, 6 + lsls r1, 1 + ldrb r0, [r4, 0x1] + lsrs r0, 6 + lsls r0, 3 + adds r1, r0 + adds r1, r2 + ldrh r2, [r1] + adds r1, r2, 0 + muls r1, r3 + ldr r0, [r4, 0xC] + adds r0, r1 + ldrh r1, [r4, 0x4] + lsls r1, 22 + lsrs r1, 17 + ldr r3, =0x06010000 + adds r1, r3 + bl AddTilesToObjectCopyRequests + mov r0, r8 + ldrb r1, [r0] + ldr r0, [r4, 0x8] + lsls r1, 2 + adds r1, r0 + ldrb r0, [r5] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + lsls r0, 10 + lsrs r0, 26 + mov r1, r9 + ands r1, r0 + ldrb r2, [r6] + movs r0, 0x40 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r6] + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + ldrb r7, [r5] + b _080D31A4 + .pool +_080D3190: + lsls r0, r2, 26 + lsrs r0, 26 + subs r0, 0x1 + movs r1, 0x3F + ands r0, r1 + movs r1, 0x40 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r6] +_080D31A4: + adds r0, r7, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D30DC + + thumb_func_start sub_80D31B4 +sub_80D31B4: @ 80D31B4 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x38 + mov r9, r0 + adds r4, r1, 0 + adds r5, r2, 0 + mov r8, r3 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0 + str r0, [sp, 0x30] + ldr r2, =gUnknown_0857C5F0 + mov r0, r9 + ldr r6, [r0] + ldrb r1, [r6, 0x3] + lsrs r1, 6 + lsls r1, 1 + ldrb r0, [r6, 0x1] + lsrs r0, 6 + lsls r0, 3 + adds r1, r0 + adds r1, r2 + ldrh r2, [r1] + ldr r1, =0xffff0000 + add r3, sp, 0x30 + ldr r0, [r3, 0x4] + ands r0, r1 + orrs r0, r2 + str r0, [r3, 0x4] + add r1, sp, 0x18 + ldr r0, =0x0000ffff + strh r0, [r1] + mov r0, r9 + ldrh r2, [r0, 0x14] + mov r0, sp + adds r0, 0x1A + strh r2, [r0] + str r6, [sp, 0x1C] + mov r2, r9 + ldr r0, [r2, 0x8] + str r0, [sp, 0x20] + str r3, [sp, 0x24] + ldr r0, [r2, 0xC] + str r0, [sp, 0x28] + ldr r0, [r2, 0x10] + str r0, [sp, 0x2C] + mov r0, sp + movs r2, 0x18 + bl memcpy + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + mov r0, sp + adds r1, r4, 0 + adds r2, r5, 0 + mov r3, r8 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r6, =0x02020630 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r4, r3, r6 + adds r5, r4, 0 + adds r5, 0x2C + ldrb r1, [r5] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r5] + adds r4, 0x3F + ldrb r2, [r4] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r4] + adds r6, 0xC + adds r3, r6 + mov r2, r9 + ldr r1, [r2, 0x4] + str r1, [r3] + add sp, 0x38 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D31B4 + + thumb_func_start sub_80D328C +sub_80D328C: @ 80D328C + push {lr} + sub sp, 0x8 + movs r1, 0 + str r1, [sp] + ldr r3, =gUnknown_0857C5F0 + ldrb r2, [r0, 0x3] + lsrs r2, 6 + lsls r2, 1 + ldrb r1, [r0, 0x1] + lsrs r1, 6 + lsls r1, 3 + adds r2, r1 + adds r2, r3 + ldrh r3, [r2] + ldr r2, =0xffff0000 + ldr r1, [sp, 0x4] + ands r1, r2 + orrs r1, r3 + str r1, [sp, 0x4] + mov r1, sp + str r1, [r0, 0xC] + bl RemoveObjectAndFreeTiles + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D328C + + thumb_func_start sub_80D32C8 +sub_80D32C8: @ 80D32C8 + mov r12, r0 + adds r0, 0x2A + movs r3, 0 + strb r1, [r0] + mov r2, r12 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x40 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + mov r0, r12 + adds r0, 0x2B + strb r3, [r0] + bx lr + thumb_func_end sub_80D32C8 + + thumb_func_start exec_movement +exec_movement: @ 80D32E8 + push {r4,lr} + sub sp, 0x4 + adds r4, r3, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + beq _080D330A + movs r0, 0x1 + b _080D3332 +_080D330A: + ldr r0, =sub_80D3660 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + bne _080D331C + movs r0, 0x32 + bl sub_80D33AC +_080D331C: + bl sub_80D33F4 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + ldrb r1, [r1] + adds r2, r4, 0 + bl sub_80D3408 + lsls r0, 24 + lsrs r0, 24 +_080D3332: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end exec_movement + + thumb_func_start sub_80D3340 +sub_80D3340: @ 80D3340 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r3, sp + bl TryGetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + cmp r0, 0 + bne _080D3382 + bl sub_80D33F4 + lsls r0, 24 + lsrs r4, r0, 24 + mov r0, sp + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_80D3474 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x10 + beq _080D3382 + adds r0, r4, 0 + bl sub_80D3584 + lsls r0, 24 + lsrs r0, 24 + b _080D3384 +_080D3382: + movs r0, 0x1 +_080D3384: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80D3340 + + thumb_func_start sub_80D338C +sub_80D338C: @ 80D338C + push {r4,lr} + bl sub_80D33F4 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xFF + beq _080D33A6 + adds r0, r4, 0 + bl sub_80D361C + adds r0, r4, 0 + bl DestroyTask +_080D33A6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80D338C + + thumb_func_start sub_80D33AC +sub_80D33AC: @ 80D33AC + push {r4,r5,lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =sub_80D3660 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x1 + lsls r1, r0, 2 + adds r1, r0 + lsls r3, r1, 3 + ldr r5, =0x03005e08 + ldr r0, =0x0000ffff + adds r4, r0, 0 +_080D33CC: + lsls r0, r2, 1 + adds r0, r3 + adds r0, r5 + ldrh r1, [r0] + orrs r1, r4 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _080D33CC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D33AC + + thumb_func_start sub_80D33F4 +sub_80D33F4: @ 80D33F4 + push {lr} + ldr r0, =sub_80D3660 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D33F4 + + thumb_func_start sub_80D3408 +sub_80D3408: @ 80D3408 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r2 + lsls r0, 24 + lsrs r5, r0, 24 + adds r7, r5, 0 + lsls r1, 24 + lsrs r6, r1, 24 + mov r8, r6 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_80D3474 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x10 + beq _080D3444 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80D3584 + lsls r0, 24 + cmp r0, 0 + beq _080D3464 + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r6, 0 + b _080D345A +_080D3444: + adds r0, r7, 0 + movs r1, 0xFF + bl sub_80D3474 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x10 + beq _080D3464 + adds r0, r7, 0 + adds r1, r4, 0 + mov r2, r8 +_080D345A: + mov r3, r9 + bl sub_80D35DC + movs r0, 0 + b _080D3466 +_080D3464: + movs r0, 0x1 +_080D3466: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D3408 + + thumb_func_start sub_80D3474 +sub_80D3474: @ 80D3474 + 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, =0x03005e08 + adds r1, r0 + adds r1, 0x2 + movs r2, 0 +_080D348C: + ldrb r0, [r1] + cmp r0, r3 + bne _080D349C + adds r0, r2, 0 + b _080D34AA + .pool +_080D349C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r1, 0x1 + cmp r2, 0xF + bls _080D348C + movs r0, 0x10 +_080D34AA: + pop {r1} + bx r1 + thumb_func_end sub_80D3474 + + thumb_func_start sub_80D34B0 +sub_80D34B0: @ 80D34B0 + 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, =0x03005e08 + adds r1, r0 + adds r1, 0x2 + str r1, [r2] + movs r0, 0 + cmp r0, r3 + bcs _080D34DC +_080D34CE: + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + adds r1, 0x1 + cmp r0, r3 + bcc _080D34CE + str r1, [r2] +_080D34DC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D34B0 + + thumb_func_start sub_80D34E4 +sub_80D34E4: @ 80D34E4 + push {r4,lr} + sub sp, 0x4 + adds r4, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r4, 24 + lsrs r4, 24 + mov r2, sp + bl sub_80D34B0 + ldr r0, [sp] + strb r4, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80D34E4 + + thumb_func_start sub_80D3508 +sub_80D3508: @ 80D3508 + push {r4,lr} + sub sp, 0x4 + adds r4, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r2, sp + bl sub_80D34B0 + ldr r0, [sp] + ldrb r0, [r0] + strb r0, [r4] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80D3508 + + thumb_func_start sub_80D352C +sub_80D352C: @ 80D352C + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + ldr r2, =gUnknown_0832A328 + lsrs r1, 22 + adds r1, r2 + ldr r2, [r1] + mvns r2, r2 + lsls r2, 16 + lsrs r2, 16 + ldr r3, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r3 + ldrh r0, [r1, 0x8] + ands r2, r0 + strh r2, [r1, 0x8] + bx lr + .pool + thumb_func_end sub_80D352C + + thumb_func_start sub_80D355C +sub_80D355C: @ 80D355C + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + ldr r3, =0x03005e00 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r3 + ldr r0, =gUnknown_0832A328 + lsrs r1, 22 + adds r1, r0 + ldr r0, [r1] + ldrh r1, [r2, 0x8] + orrs r0, r1 + strh r0, [r2, 0x8] + bx lr + .pool + thumb_func_end sub_80D355C + + thumb_func_start sub_80D3584 +sub_80D3584: @ 80D3584 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + ldr r3, =0x03005e00 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r3 + ldr r0, =gUnknown_0832A328 + lsrs r1, 22 + adds r1, r0 + ldr r0, [r1] + ldrh r1, [r2, 0x8] + ands r0, r1 + cmp r0, 0 + bne _080D35B4 + movs r0, 0 + b _080D35B6 + .pool +_080D35B4: + movs r0, 0x1 +_080D35B6: + pop {r1} + bx r1 + thumb_func_end sub_80D3584 + + thumb_func_start npc_obj_offscreen_culling_and_flag_update +npc_obj_offscreen_culling_and_flag_update: @ 80D35BC + lsls r0, 24 + ldr r2, =0x02039d90 + lsrs r0, 22 + adds r0, r2 + str r1, [r0] + bx lr + .pool + thumb_func_end npc_obj_offscreen_culling_and_flag_update + + thumb_func_start sub_80D35CC +sub_80D35CC: @ 80D35CC + lsls r0, 24 + ldr r1, =0x02039d90 + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bx lr + .pool + thumb_func_end sub_80D35CC + + thumb_func_start sub_80D35DC +sub_80D35DC: @ 80D35DC + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r5, r0, 0 + adds r4, r1, 0 + adds r6, r2, 0 + mov r8, r3 + lsls r5, 24 + lsrs r5, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r6, 24 + lsrs r6, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80D352C + adds r0, r4, 0 + mov r1, r8 + bl npc_obj_offscreen_culling_and_flag_update + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_80D34E4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80D35DC + + thumb_func_start sub_80D361C +sub_80D361C: @ 80D361C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r1, r0 + adds r4, r1, 0x2 + movs r5, 0 +_080D3630: + ldrb r0, [r4] + cmp r0, 0xFF + beq _080D3646 + adds r1, r0, 0 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + bl npc_sync_anim_pause_bits +_080D3646: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x1 + cmp r5, 0xF + bls _080D3630 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D361C + + thumb_func_start sub_80D3660 +sub_80D3660: @ 80D3660 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + movs r5, 0 + mov r6, sp +_080D366C: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, sp + bl sub_80D3508 + ldrb r0, [r6] + cmp r0, 0xFF + beq _080D3690 + adds r4, r0, 0 + adds r0, r5, 0 + bl sub_80D35CC + adds r3, r0, 0 + adds r0, r7, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_80D36A4 +_080D3690: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xF + bls _080D366C + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80D3660 + + thumb_func_start sub_80D36A4 +sub_80D36A4: @ 80D36A4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r3, 0 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + mov r8, r6 + lsls r2, 24 + lsrs r2, 24 + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + adds r0, r4, 0 + bl FieldObjectIsSpecialAnimActive + lsls r0, 24 + cmp r0, 0 + beq _080D36DC + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080D370E +_080D36DC: + ldrb r1, [r5] + cmp r1, 0xFE + bne _080D36F8 + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_80D355C + adds r0, r4, 0 + bl sub_8097404 + b _080D370E + .pool +_080D36F8: + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + lsls r0, 24 + cmp r0, 0 + bne _080D370E + adds r5, 0x1 + mov r0, r8 + adds r1, r5, 0 + bl npc_obj_offscreen_culling_and_flag_update +_080D370E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80D36A4 + + thumb_func_start sub_80D3718 +sub_80D3718: @ 80D3718 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + movs r0, 0x52 + bl npc_before_player_of_type + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D3754 + ldr r1, =0x03005db0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =0x0203ceec + ldr r0, =sub_80D3A9C + str r0, [r1] + movs r0, 0x1 + b _080D3A2C + .pool +_080D3754: + ldr r0, =0x0203ab40 + adds r1, r0, 0x2 + bl PlayerGetDestCoords + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0xC] + cmp r0, 0x34 + bne _080D3798 + ldr r1, =0x03001100 + movs r0, 0x5 + strb r0, [r1] + ldr r0, =0x03001101 + movs r1, 0x2 + b _080D37A2 + .pool +_080D3798: + ldr r1, =0x03001100 + movs r0, 0x3 + strb r0, [r1] + ldr r0, =0x03001101 + movs r1, 0x1 +_080D37A2: + strb r1, [r0] + ldr r0, =0x03001102 + strb r1, [r0] + movs r6, 0 + movs r1, 0 +_080D37AC: + mov r2, sp + adds r0, r2, r6 + strb r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x8 + bls _080D37AC + movs r6, 0 + ldr r2, =0x03001108 + movs r1, 0 +_080D37C2: + adds r0, r6, r2 + strb r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x18 + bls _080D37C2 + movs r3, 0 + str r3, [sp, 0x10] + movs r6, 0 +_080D37D6: + ldr r4, =0x0000ffff + adds r0, r6, r4 + ldr r1, =0x0203ab40 + ldrh r1, [r1, 0x2] + adds r0, r1 + movs r5, 0 + adds r2, r6, 0x1 + str r2, [sp, 0x18] + lsls r7, r6, 1 + lsls r0, 16 + str r0, [sp, 0x14] + asrs r0, 16 + mov r10, r0 + lsls r0, r6, 2 + adds r0, r6 + mov r9, r0 +_080D37F6: + ldr r3, =0x0000ffff + adds r0, r5, r3 + ldr r4, =0x0203ab40 + ldrh r4, [r4] + adds r0, r4 + lsls r0, 16 + lsrs r1, r0, 16 + mov r8, r1 + asrs r4, r0, 16 + adds r0, r4, 0 + mov r1, r10 + bl MapGridGetZCoordAt + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x0203ab40 + movs r1, 0x4 + ldrsb r1, [r2, r1] + cmp r0, r1 + bne _080D38BC + adds r0, r4, 0 + mov r1, r10 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8088E64 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080D3846 + adds r0, r4, 0 + bl MetatileBehavior_IsAsh + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D3856 +_080D3846: + adds r0, r5, 0x6 + add r0, r9 + ldr r3, =0x03001108 + adds r0, r3 + movs r1, 0x1 + strb r1, [r0] + movs r0, 0x1 + str r0, [sp, 0x10] +_080D3856: + mov r1, r8 + lsls r0, r1, 16 + asrs r0, 16 + ldr r2, [sp, 0x14] + asrs r1, r2, 16 + bl MapGridIsImpassableAt + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D3890 + adds r0, r7, r6 + adds r0, r5 + mov r3, sp + adds r1, r3, r0 + b _080D38C4 + .pool +_080D3890: + adds r0, r7, r6 + adds r0, r5 + mov r2, sp + adds r1, r2, r0 + movs r0, 0x1 + strb r0, [r1] + adds r0, r4, 0 + bl sub_80899F8 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + bne _080D38C8 + adds r0, r5, 0x6 + add r0, r9 + ldr r3, =0x03001108 + adds r0, r3 + strb r1, [r0] + b _080D38C8 + .pool +_080D38BC: + adds r0, r7, r6 + adds r0, r5 + mov r4, sp + adds r1, r4, r0 +_080D38C4: + movs r0, 0 + strb r0, [r1] +_080D38C8: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _080D37F6 + ldr r1, [sp, 0x18] + lsls r0, r1, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bhi _080D38DE + b _080D37D6 +_080D38DE: + ldr r2, [sp, 0xC] + cmp r2, 0x34 + beq _080D38EE + ldr r3, [sp, 0x10] + cmp r3, 0x1 + beq _080D38EC + b _080D3A2A +_080D38EC: + b _080D3A1E +_080D38EE: + movs r6, 0 + ldr r4, =0x0203ab40 + mov r9, r4 + ldr r0, =gUnknown_0857C608 + mov r10, r0 +_080D38F8: + lsls r2, r6, 2 + mov r3, r10 + adds r1, r2, r3 + movs r0, 0 + ldrsb r0, [r1, r0] + mov r4, r9 + ldrh r4, [r4] + adds r0, r4 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + movs r0, 0x1 + ldrsb r0, [r1, r0] + mov r1, r9 + ldrh r1, [r1, 0x2] + adds r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + movs r7, 0x1 + movs r5, 0 + ldr r3, =gUnknown_0857C60A + adds r0, r2, r3 + ldrb r0, [r0] + adds r6, 0x1 + str r6, [sp, 0x18] + adds r6, r2, 0 + cmp r0, 0 + beq _080D395A +_080D3930: + adds r1, r2, 0 + adds r0, r5, r2 + adds r0, r3 + ldrb r0, [r0] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + add r0, sp + ldrb r0, [r0] + cmp r0, 0 + beq _080D39F4 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bhi _080D395A + adds r0, r5, r1 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _080D3930 +_080D395A: + cmp r7, 0x1 + bne _080D3A0C + mov r1, r8 + lsls r0, r1, 16 + asrs r5, r0, 16 + lsls r0, r4, 16 + asrs r4, r0, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetZCoordAt + lsls r0, 24 + lsrs r0, 24 + mov r2, r9 + movs r1, 0x4 + ldrsb r1, [r2, r1] + cmp r0, r1 + bne _080D3A0C + mov r3, r10 + adds r2, r6, r3 + movs r1, 0x1 + ldrsb r1, [r2, r1] + lsls r0, r1, 2 + adds r0, r1 + adds r0, 0xC + ldrb r2, [r2] + adds r0, r2 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8088E64 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080D39BC + adds r0, r4, 0 + bl MetatileBehavior_IsAsh + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D39F8 +_080D39BC: + ldr r1, =0x03005db0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =0x0203ceec + ldr r0, =hm2_ruin_valley + str r0, [r1] + ldr r0, =0x03001108 + adds r0, r6, r0 + strb r7, [r0] + movs r4, 0x1 + str r4, [sp, 0x10] + b _080D3A0C + .pool +_080D39F4: + movs r7, 0 + b _080D395A +_080D39F8: + adds r0, r4, 0 + bl sub_80899F8 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + bne _080D3A0C + ldr r0, =0x03001108 + adds r0, r6, r0 + strb r1, [r0] +_080D3A0C: + ldr r1, [sp, 0x18] + lsls r0, r1, 24 + lsrs r6, r0, 24 + cmp r6, 0xF + bhi _080D3A18 + b _080D38F8 +_080D3A18: + ldr r2, [sp, 0x10] + cmp r2, 0x1 + bne _080D3A2A +_080D3A1E: + ldr r1, =0x03005db0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =0x0203ceec + ldr r0, =hm2_ruin_valley + str r0, [r1] +_080D3A2A: + ldr r0, [sp, 0x10] +_080D3A2C: + 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_80D3718 + + thumb_func_start hm2_ruin_valley +hm2_ruin_valley: @ 80D3A50 + push {lr} + movs r0, 0x1 + bl FieldEffectStart + bl brm_get_pokemon_selection + ldr r1, =0x02038c08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end hm2_ruin_valley + + thumb_func_start sub_80D3A6C +sub_80D3A6C: @ 80D3A6C + push {lr} + bl oei_task_add + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =sub_80D3AEC + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + movs r0, 0x12 + bl sav12_xor_increment + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D3A6C + + thumb_func_start sub_80D3A9C +sub_80D3A9C: @ 80D3A9C + push {lr} + bl brm_get_pokemon_selection + ldr r1, =0x02038c08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + ldr r0, =gUnknown_08290705 + bl script_env_1_execute_new_script + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D3A9C + + thumb_func_start sub_80D3ABC +sub_80D3ABC: @ 80D3ABC + push {lr} + bl oei_task_add + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =sub_80D4354 + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + movs r0, 0x12 + bl sav12_xor_increment + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D3ABC + + thumb_func_start sub_80D3AEC +sub_80D3AEC: @ 80D3AEC + push {lr} + movs r0, 0x1 + bl FieldEffectActiveListRemove + movs r0, 0x3A + bl FieldEffectStart + pop {r0} + bx r0 + thumb_func_end sub_80D3AEC + + thumb_func_start sub_80D3B00 +sub_80D3B00: @ 80D3B00 + push {r4-r7,lr} + movs r6, 0 + movs r0, 0x80 + bl audio_play + ldr r4, =0x0203ab40 + adds r1, r4, 0x2 + adds r0, r4, 0 + bl PlayerGetDestCoords + adds r7, r4, 0 +_080D3B16: + ldr r0, =0x03001108 + adds r0, r6, r0 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080D3B64 + adds r0, r6, 0 + movs r1, 0x5 + bl __umodsi3 + adds r4, r0, 0 + subs r4, 0x2 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + movs r1, 0x5 + bl __udivsi3 + adds r5, r0, 0 + subs r5, 0x2 + lsls r4, 24 + asrs r4, 24 + ldrh r0, [r7] + adds r4, r0 + lsls r5, 24 + asrs r5, 24 + ldrh r2, [r7, 0x2] + adds r5, r2 + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80D3C10 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_808E75C +_080D3B64: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x18 + bls _080D3B16 + ldr r2, =0x0203ab40 + ldr r0, =0x03001101 + ldrb r1, [r0] + ldrh r0, [r2] + subs r0, r1 + lsls r0, 16 + asrs r0, 16 + ldr r1, =0x03001102 + ldrb r1, [r1] + mvns r1, r1 + ldrh r2, [r2, 0x2] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + bl sub_80D3D5C + bl DrawWholeMapView + ldr r4, =0x02039dd0 + movs r0, 0x8 + bl AllocZeroed + str r0, [r4] + movs r6, 0 + ldr r5, =0x02020630 +_080D3BA0: + ldr r0, =0x02037590 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r0, 0x2] + lsls r1, 23 + lsrs r1, 7 + movs r2, 0x80 + lsls r2, 12 + adds r1, r2 + asrs r1, 16 + ldrb r2, [r0] + adds r2, 0x14 + ldr r0, =gUnknown_0857C66C + movs r3, 0 + bl AddObjectToFront + ldr r1, [r4] + adds r1, r6 + strb r0, [r1] + ldr r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + lsls r1, r6, 5 + strh r1, [r0, 0x32] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x7 + bls _080D3BA0 + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D3B00 + + thumb_func_start sub_80D3C10 +sub_80D3C10: @ 80D3C10 + push {r4-r7,lr} + lsls r0, 16 + lsls r1, 16 + lsrs r6, r0, 16 + asrs r4, r0, 16 + lsrs r7, r1, 16 + asrs r5, r1, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridGetMetatileIdAt + adds r1, r0, 0 + ldr r0, =0x00000207 + cmp r1, r0 + bgt _080D3C5C + subs r0, 0x1 + cmp r1, r0 + bge _080D3CD4 + cmp r1, 0x25 + beq _080D3CF6 + cmp r1, 0x25 + bgt _080D3C4C + cmp r1, 0xD + beq _080D3C9C + cmp r1, 0x15 + beq _080D3C9C + b _080D3D00 + .pool +_080D3C4C: + movs r0, 0xE3 + lsls r0, 1 + cmp r1, r0 + beq _080D3CAC + adds r0, 0x1 + cmp r1, r0 + beq _080D3CB2 + b _080D3D00 +_080D3C5C: + ldr r0, =0x00000212 + cmp r1, r0 + beq _080D3CE4 + cmp r1, r0 + bgt _080D3C78 + subs r0, 0xA + cmp r1, r0 + beq _080D3C9C + adds r0, 0x2 + cmp r1, r0 + beq _080D3CE4 + b _080D3D00 + .pool +_080D3C78: + ldr r0, =0x00000282 + cmp r1, r0 + beq _080D3CC4 + cmp r1, r0 + bgt _080D3C90 + subs r0, 0x1 + cmp r1, r0 + beq _080D3CBC + b _080D3D00 + .pool +_080D3C90: + ldr r0, =0x00000283 + cmp r1, r0 + beq _080D3CCC + b _080D3D00 + .pool +_080D3C9C: + lsls r0, r6, 16 + asrs r0, 16 + lsls r1, r7, 16 + asrs r1, 16 + movs r2, 0x1 + bl MapGridSetMetatileIdAt + b _080D3D00 +_080D3CAC: + movs r2, 0xE7 + lsls r2, 1 + b _080D3CD6 +_080D3CB2: + ldr r2, =0x000001cf + b _080D3CD6 + .pool +_080D3CBC: + ldr r2, =0x00000279 + b _080D3CD6 + .pool +_080D3CC4: + ldr r2, =0x0000027a + b _080D3CD6 + .pool +_080D3CCC: + ldr r2, =0x0000027b + b _080D3CD6 + .pool +_080D3CD4: + ldr r2, =0x00000271 +_080D3CD6: + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridSetMetatileIdAt + b _080D3D00 + .pool +_080D3CE4: + lsls r0, r6, 16 + asrs r0, 16 + lsls r1, r7, 16 + asrs r1, 16 + movs r2, 0x86 + lsls r2, 2 + bl MapGridSetMetatileIdAt + b _080D3D00 +_080D3CF6: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0xE + bl MapGridSetMetatileIdAt +_080D3D00: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80D3C10 + + thumb_func_start sub_80D3D08 +sub_80D3D08: @ 80D3D08 + push {lr} + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl MapGridGetMetatileIdAt + lsls r0, 16 + lsrs r1, r0, 16 + adds r2, r1, 0 + cmp r1, 0x1 + bne _080D3D24 + movs r0, 0x1 + b _080D3D56 +_080D3D24: + ldr r0, =0x00000279 + cmp r1, r0 + bne _080D3D34 + movs r0, 0x2 + b _080D3D56 + .pool +_080D3D34: + ldr r0, =0x0000027a + cmp r1, r0 + bne _080D3D44 + movs r0, 0x3 + b _080D3D56 + .pool +_080D3D44: + ldr r0, =0x0000027b + cmp r2, r0 + beq _080D3D54 + movs r0, 0 + b _080D3D56 + .pool +_080D3D54: + movs r0, 0x4 +_080D3D56: + pop {r1} + bx r1 + thumb_func_end sub_80D3D08 + + thumb_func_start sub_80D3D5C +sub_80D3D5C: @ 80D3D5C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + ldr r1, =0x03001100 + ldrb r2, [r1] + mov r3, r10 + adds r0, r2, r3 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + movs r4, 0 + cmp r4, r2 + blt _080D3D8A + b _080D3EA0 +_080D3D8A: + lsls r0, r3, 16 + asrs r7, r0, 16 +_080D3D8E: + mov r1, r9 + lsls r0, r1, 16 + asrs r0, 16 + lsls r4, 16 + asrs r1, r4, 16 + adds r0, r1 + lsls r0, 16 + lsrs r6, r0, 16 + asrs r5, r0, 16 + adds r0, r5, 0 + adds r1, r7, 0 + bl MapGridGetMetatileIdAt + mov r8, r4 + cmp r0, 0x15 + bne _080D3E12 + adds r4, r7, 0x1 + lsls r1, r4, 16 + asrs r1, 16 + adds r0, r5, 0 + bl sub_80D3D08 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _080D3DE8 + cmp r0, 0x2 + bgt _080D3DD0 + cmp r0, 0x1 + beq _080D3DDA + b _080D3E12 + .pool +_080D3DD0: + cmp r0, 0x3 + beq _080D3DF8 + cmp r0, 0x4 + beq _080D3E08 + b _080D3E12 +_080D3DDA: + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x82 + lsls r2, 2 + bl MapGridSetMetatileIdAt + b _080D3E12 +_080D3DE8: + adds r0, r5, 0 + adds r1, r4, 0 + ldr r2, =0x00000281 + bl MapGridSetMetatileIdAt + b _080D3E12 + .pool +_080D3DF8: + adds r0, r5, 0 + adds r1, r4, 0 + ldr r2, =0x00000282 + bl MapGridSetMetatileIdAt + b _080D3E12 + .pool +_080D3E08: + adds r0, r5, 0 + adds r1, r4, 0 + ldr r2, =0x00000283 + bl MapGridSetMetatileIdAt +_080D3E12: + lsls r0, r6, 16 + asrs r5, r0, 16 + ldr r3, [sp] + lsls r0, r3, 16 + asrs r4, r0, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + cmp r0, 0x1 + bne _080D3E8C + adds r4, 0x1 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + movs r1, 0x82 + lsls r1, 2 + cmp r0, r1 + bne _080D3E44 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl MapGridSetMetatileIdAt +_080D3E44: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + ldr r1, =0x00000281 + cmp r0, r1 + bne _080D3E5C + adds r0, r5, 0 + adds r1, r4, 0 + ldr r2, =0x00000279 + bl MapGridSetMetatileIdAt +_080D3E5C: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + ldr r1, =0x00000282 + cmp r0, r1 + bne _080D3E74 + adds r0, r5, 0 + adds r1, r4, 0 + ldr r2, =0x0000027a + bl MapGridSetMetatileIdAt +_080D3E74: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + ldr r1, =0x00000283 + cmp r0, r1 + bne _080D3E8C + adds r0, r5, 0 + adds r1, r4, 0 + ldr r2, =0x0000027b + bl MapGridSetMetatileIdAt +_080D3E8C: + movs r1, 0x80 + lsls r1, 9 + add r1, r8 + lsrs r4, r1, 16 + asrs r1, 16 + ldr r0, =0x03001100 + ldrb r0, [r0] + cmp r1, r0 + bge _080D3EA0 + b _080D3D8E +_080D3EA0: + ldr r1, =0x03001100 + ldrb r0, [r1] + cmp r0, 0x5 + bne _080D3EC8 + mov r3, r9 + lsls r5, r3, 16 + asrs r5, 16 + mov r0, r10 + lsls r4, r0, 16 + asrs r4, 16 + movs r0, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_80D3EF4 + movs r0, 0x1 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_80D3EF4 +_080D3EC8: + 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_80D3D5C + + thumb_func_start sub_80D3EF4 +sub_80D3EF4: @ 80D3EF4 + 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 + lsls r1, 16 + lsrs r5, r1, 16 + adds r3, r5, 0 + lsls r2, 16 + lsrs r2, 16 + mov r10, r2 + cmp r0, 0 + bne _080D3F2C + mov r2, sp + ldr r1, =0x03001108 + ldrb r0, [r1, 0x5] + strb r0, [r2] + ldrb r0, [r1, 0xA] + strb r0, [r2, 0x1] + ldrb r0, [r1, 0xF] + strb r0, [r2, 0x2] + mov r8, r5 + b _080D3F4E + .pool +_080D3F2C: + cmp r0, 0x1 + beq _080D3F32 + b _080D414A +_080D3F32: + mov r2, sp + ldr r1, =0x03001108 + ldrb r0, [r1, 0x9] + strb r0, [r2] + ldrb r0, [r1, 0xE] + strb r0, [r2, 0x1] + ldrb r0, [r1, 0x13] + strb r0, [r2, 0x2] + lsls r0, r3, 16 + movs r1, 0x80 + lsls r1, 11 + adds r0, r1 + lsrs r0, 16 + mov r8, r0 +_080D3F4E: + mov r0, sp + ldrb r0, [r0] + cmp r0, 0x1 + bne _080D3FC6 + mov r1, r8 + lsls r0, r1, 16 + asrs r5, r0, 16 + mov r1, r10 + lsls r0, r1, 16 + asrs r0, 16 + adds r4, r0, 0x3 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + movs r1, 0x82 + lsls r1, 2 + cmp r0, r1 + bne _080D3F7E + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl MapGridSetMetatileIdAt +_080D3F7E: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + ldr r1, =0x00000281 + cmp r0, r1 + bne _080D3F96 + ldr r2, =0x00000279 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt +_080D3F96: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + ldr r1, =0x00000282 + cmp r0, r1 + bne _080D3FAE + ldr r2, =0x0000027a + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt +_080D3FAE: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + ldr r1, =0x00000283 + cmp r0, r1 + bne _080D3FC6 + ldr r2, =0x0000027b + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt +_080D3FC6: + mov r0, sp + ldrb r0, [r0, 0x1] + cmp r0, 0x1 + bne _080D40C0 + mov r0, r8 + lsls r5, r0, 16 + asrs r6, r5, 16 + mov r1, r10 + lsls r4, r1, 16 + asrs r7, r4, 16 + adds r1, r7, 0x2 + adds r0, r6, 0 + bl MapGridGetMetatileIdAt + mov r9, r4 + cmp r0, 0x15 + bne _080D4056 + adds r4, r7, 0x3 + lsls r1, r4, 16 + asrs r1, 16 + adds r0, r6, 0 + bl sub_80D3D08 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _080D4034 + cmp r0, 0x2 + bgt _080D4024 + cmp r0, 0x1 + beq _080D402E + b _080D4056 + .pool +_080D4024: + cmp r0, 0x3 + beq _080D403C + cmp r0, 0x4 + beq _080D404C + b _080D4056 +_080D402E: + movs r2, 0x82 + lsls r2, 2 + b _080D403E +_080D4034: + ldr r2, =0x00000281 + b _080D403E + .pool +_080D403C: + ldr r2, =0x00000282 +_080D403E: + adds r0, r6, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt + b _080D4056 + .pool +_080D404C: + ldr r2, =0x00000283 + adds r0, r6, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt +_080D4056: + asrs r5, 16 + mov r1, r9 + asrs r0, r1, 16 + adds r4, r0, 0x4 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + movs r1, 0x82 + lsls r1, 2 + cmp r0, r1 + bne _080D4078 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl MapGridSetMetatileIdAt +_080D4078: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + ldr r1, =0x00000281 + cmp r0, r1 + bne _080D4090 + ldr r2, =0x00000279 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt +_080D4090: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + ldr r1, =0x00000282 + cmp r0, r1 + bne _080D40A8 + ldr r2, =0x0000027a + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt +_080D40A8: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileIdAt + ldr r1, =0x00000283 + cmp r0, r1 + bne _080D40C0 + ldr r2, =0x0000027b + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt +_080D40C0: + mov r0, sp + ldrb r0, [r0, 0x2] + cmp r0, 0x1 + bne _080D414A + mov r1, r8 + lsls r0, r1, 16 + asrs r5, r0, 16 + mov r1, r10 + lsls r0, r1, 16 + asrs r4, r0, 16 + adds r1, r4, 0x3 + adds r0, r5, 0 + bl MapGridGetMetatileIdAt + cmp r0, 0x15 + bne _080D414A + adds r4, 0x4 + lsls r1, r4, 16 + asrs r1, 16 + adds r0, r5, 0 + bl sub_80D3D08 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _080D4128 + cmp r0, 0x2 + bgt _080D4118 + cmp r0, 0x1 + beq _080D4122 + b _080D414A + .pool +_080D4118: + cmp r0, 0x3 + beq _080D4130 + cmp r0, 0x4 + beq _080D4140 + b _080D414A +_080D4122: + movs r2, 0x82 + lsls r2, 2 + b _080D4132 +_080D4128: + ldr r2, =0x00000281 + b _080D4132 + .pool +_080D4130: + ldr r2, =0x00000282 +_080D4132: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt + b _080D414A + .pool +_080D4140: + ldr r2, =0x00000283 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt +_080D414A: + 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_80D3EF4 + + thumb_func_start objc_8097BA8 +objc_8097BA8: @ 80D4160 + movs r2, 0 + movs r1, 0x8 + strh r1, [r0, 0x2E] + strh r2, [r0, 0x30] + strh r2, [r0, 0x34] + ldr r1, =objc_8097BBC + str r1, [r0, 0x1C] + bx lr + .pool + thumb_func_end objc_8097BA8 + + thumb_func_start objc_8097BBC +objc_8097BBC: @ 80D4174 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r2, 0x2E + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r2, 0x2E + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x8 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x32] + ldrh r1, [r4, 0x2E] + adds r1, 0x1 + ldrh r2, [r4, 0x34] + lsls r0, r2, 16 + asrs r0, 18 + adds r1, r0 + strh r1, [r4, 0x2E] + adds r2, 0x1 + strh r2, [r4, 0x34] + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0x1C + beq _080D41C0 + adds r0, r1, 0x1 + strh r0, [r4, 0x30] + b _080D41C4 +_080D41C0: + ldr r0, =sub_80D41D0 + str r0, [r4, 0x1C] +_080D41C4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end objc_8097BBC + + thumb_func_start sub_80D41D0 +sub_80D41D0: @ 80D41D0 + push {r4-r6,lr} + movs r4, 0x1 +_080D41D4: + ldr r6, =0x02039dd0 + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =0x02020630 + adds r0, r5 + bl RemoveObjectAndFreeTiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _080D41D4 + ldr r0, [r6] + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x3A + bl FieldEffectStop + ldr r0, [r6] + bl Free + movs r0, 0 + str r0, [r6] + bl sub_80984F4 + bl script_env_2_disable + bl unown_chamber_related + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080D422A + ldr r0, =gUnknown_08267EDB + bl script_env_1_execute_new_script +_080D422A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D41D0 + + thumb_func_start sub_80D423C +sub_80D423C: @ 80D423C + push {r4,r5,lr} + lsls r0, 16 + asrs r5, r0, 16 + lsls r1, 16 + asrs r4, r1, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsLongGrass2 + lsls r0, 24 + cmp r0, 0 + beq _080D42AE + adds r4, 0x1 + lsls r1, r4, 16 + asrs r1, 16 + adds r0, r5, 0 + bl sub_80D3D08 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _080D428A + cmp r0, 0x2 + bgt _080D427A + cmp r0, 0x1 + beq _080D4284 + b _080D42AE +_080D427A: + cmp r0, 0x3 + beq _080D4294 + cmp r0, 0x4 + beq _080D42A4 + b _080D42AE +_080D4284: + movs r2, 0x82 + lsls r2, 2 + b _080D4296 +_080D428A: + ldr r2, =0x00000281 + b _080D4296 + .pool +_080D4294: + ldr r2, =0x00000282 +_080D4296: + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt + b _080D42AE + .pool +_080D42A4: + ldr r2, =0x00000283 + adds r0, r5, 0 + adds r1, r4, 0 + bl MapGridSetMetatileIdAt +_080D42AE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D423C + + thumb_func_start sub_80D42B8 +sub_80D42B8: @ 80D42B8 + push {r4,r5,lr} + lsls r0, 16 + asrs r4, r0, 16 + lsls r1, 16 + asrs r5, r1, 16 + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridGetMetatileIdAt + cmp r0, 0x1 + bne _080D434A + adds r5, 0x1 + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl MetatileBehavior_IsLongGrassSouthEdge + lsls r0, 24 + cmp r0, 0 + beq _080D434A + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridGetMetatileIdAt + adds r1, r0, 0 + ldr r0, =0x00000281 + cmp r1, r0 + beq _080D4328 + cmp r1, r0 + bgt _080D4308 + subs r0, 0x79 + cmp r1, r0 + beq _080D431C + b _080D434A + .pool +_080D4308: + ldr r0, =0x00000282 + cmp r1, r0 + beq _080D4330 + adds r0, 0x1 + cmp r1, r0 + beq _080D4340 + b _080D434A + .pool +_080D431C: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl MapGridSetMetatileIdAt + b _080D434A +_080D4328: + ldr r2, =0x00000279 + b _080D4332 + .pool +_080D4330: + ldr r2, =0x0000027a +_080D4332: + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridSetMetatileIdAt + b _080D434A + .pool +_080D4340: + ldr r2, =0x0000027b + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridSetMetatileIdAt +_080D434A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D42B8 + + thumb_func_start sub_80D4354 +sub_80D4354: @ 80D4354 + push {lr} + movs r0, 0x80 + bl audio_play + movs r0, 0x2 + bl FieldEffectActiveListRemove + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_80D4354 + + thumb_func_start sub_80D436C +sub_80D436C: @ 80D436C + push {r4,r5,lr} + movs r4, 0 + ldr r5, =0x03005d8c +_080D4372: + lsls r1, r4, 3 + adds r1, r4 + lsls r1, 2 + ldr r0, =0x00002be0 + adds r1, r0 + ldr r0, [r5] + adds r0, r1 + bl sub_80D439C + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _080D4372 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D436C + + thumb_func_start sub_80D439C +sub_80D439C: @ 80D439C + push {r4-r6,lr} + adds r3, r0, 0 + ldr r0, =0x0000ffff + adds r4, r0, 0 + adds r1, r3, 0 + movs r2, 0x8 +_080D43A8: + ldrh r0, [r1] + orrs r0, r4 + strh r0, [r1] + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _080D43A8 + movs r2, 0 + adds r6, r3, 0 + adds r6, 0x1A + adds r4, r3, 0 + adds r4, 0x12 + movs r5, 0xFF +_080D43C2: + adds r1, r4, r2 + ldrb r0, [r1] + orrs r0, r5 + strb r0, [r1] + adds r2, 0x1 + cmp r2, 0x7 + ble _080D43C2 + adds r1, r6, 0 + movs r2, 0 + adds r0, r1, 0x3 +_080D43D6: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _080D43D6 + movs r1, 0 + movs r0, 0x1 + strh r0, [r3, 0x1E] + strh r1, [r3, 0x20] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D439C + + thumb_func_start sub_80D43F0 +sub_80D43F0: @ 80D43F0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _080D4418 + adds r0, r4, 0 + movs r1, 0x40 + bl pokemon_getattr + cmp r0, 0xFF + beq _080D4418 + movs r0, 0x1 + b _080D441A +_080D4418: + movs r0, 0 +_080D441A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80D43F0 + + thumb_func_start sub_80D4420 +sub_80D4420: @ 80D4420 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r8, r0 + lsls r1, 16 + lsrs r0, r1, 16 + str r0, [sp, 0x8] + mov r0, sp + movs r2, 0 + ldrb r3, [r0, 0x8] + strb r3, [r0] + lsrs r1, 24 + strb r1, [r0, 0x1] + add r3, sp, 0x4 + strb r2, [r3] + ldr r4, =0x03005d8c + mov r10, r4 + mov r9, r3 + adds r4, r3, 0 +_080D444C: + mov r1, r10 + ldr r0, [r1] + ldrb r2, [r4] + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r0, r1 + movs r1, 0xB0 + lsls r1, 6 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _080D4468 + b _080D45A8 +_080D4468: + movs r4, 0 + ldr r2, =0x03005d90 + mov r12, r2 + ldr r7, =0x03005d8c + add r5, sp, 0x4 + ldr r3, =0x0000ffff + adds r6, r3, 0 +_080D4476: + ldr r2, [r7] + lsls r3, r4, 1 + ldrb r1, [r5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r3, r0 + ldr r0, =0x00002be0 + adds r2, r0 + adds r2, r3 + ldrh r0, [r2] + orrs r0, r6 + strh r0, [r2] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x8 + bls _080D4476 + movs r4, 0 + ldr r5, =0x03005d8c + add r3, sp, 0x4 +_080D44A0: + ldr r2, [r5] + ldrb r1, [r3] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4, r0 + ldr r1, =0x00002bf2 + adds r2, r1 + adds r2, r0 + mov r1, r12 + ldr r0, [r1] + adds r0, r4 + ldrb r0, [r0] + strb r0, [r2] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _080D44A0 + mov r3, r10 + ldr r2, [r3] + mov r0, r9 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4, r0 + ldr r1, =0x00002bf2 + adds r2, r1 + adds r2, r0 + movs r0, 0xFF + strb r0, [r2] + mov r2, r9 + ldrb r1, [r2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, [r3] + adds r0, r1 + ldr r3, =0x00002bf2 + adds r0, r3 + movs r1, 0 + bl sub_81DB4DC + movs r4, 0 + ldr r6, =0x03005d8c + add r3, sp, 0x4 + ldr r5, =0x03005d90 +_080D4500: + ldr r2, [r6] + ldrb r1, [r3] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4, r0 + ldr r1, =0x00002bfa + adds r2, r1 + adds r2, r0 + ldr r0, [r5] + adds r0, 0xA + adds r0, r4 + ldrb r0, [r0] + strb r0, [r2] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _080D4500 + mov r0, r8 + movs r1, 0xB + bl pokemon_getattr_encrypted + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + mov r0, r8 + movs r1, 0 + bl pokemon_getattr_encrypted + adds r1, r0, 0 + adds r0, r4, 0 + bl sub_80D45C8 + mov r2, r10 + ldr r3, [r2] + mov r4, r9 + ldrb r2, [r4] + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r1, r3, r1 + ldr r2, =0x00002bfe + adds r1, r2 + strh r0, [r1] + ldrb r1, [r4] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r3, r0 + movs r4, 0xB0 + lsls r4, 6 + adds r3, r4 + mov r0, sp + ldrh r0, [r0, 0x8] + strh r0, [r3] + mov r0, r8 + movs r1, 0x40 + mov r2, r9 + bl pokemon_setattr + mov r0, r8 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr + mov r1, r9 + ldrb r0, [r1] + b _080D45B6 + .pool +_080D45A8: + adds r0, r2, 0x1 + strb r0, [r3] + ldrb r0, [r4] + cmp r0, 0x5 + bhi _080D45B4 + b _080D444C +_080D45B4: + movs r0, 0xFF +_080D45B6: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D4420 + + thumb_func_start sub_80D45C8 +sub_80D45C8: @ 80D45C8 + push {lr} + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xC9 + bne _080D45E0 + adds r0, r1, 0 + bl mon_icon_personality_to_unown_id + lsls r0, 16 + ldr r1, =0x75300000 + adds r0, r1 + lsrs r0, 16 +_080D45E0: + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D45C8 + + thumb_func_start sub_80D45E8 +sub_80D45E8: @ 80D45E8 + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, =0xffff8ad0 + adds r2, r3, r0 + lsls r0, r2, 16 + lsrs r0, 16 + cmp r0, 0x1B + bhi _080D4604 + movs r0, 0xC9 + strh r2, [r1] + b _080D4606 + .pool +_080D4604: + adds r0, r3, 0 +_080D4606: + pop {r1} + bx r1 + thumb_func_end sub_80D45E8 + + thumb_func_start sub_80D460C +sub_80D460C: @ 80D460C + push {r4-r7,lr} + sub sp, 0x8 + adds r6, r0, 0 + adds r7, r1, 0 + ldrh r5, [r7, 0x20] + adds r1, r5, 0 + bl sub_80D4420 + add r4, sp, 0x4 + strb r0, [r4] + ldrb r2, [r4] + cmp r2, 0xFF + beq _080D4670 + ldr r0, =0x03005d8c + ldr r1, [r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + ldr r0, =0x00002be0 + adds r1, r0 + adds r0, r7, 0 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + adds r0, r6, 0 + movs r1, 0x40 + adds r2, r4, 0 + bl pokemon_setattr + mov r0, sp + strb r5, [r0] + mov r1, sp + lsrs r0, r5, 8 + strb r0, [r1, 0x1] + adds r0, r6, 0 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr + ldrb r0, [r4] + b _080D4672 + .pool +_080D4670: + movs r0, 0xFF +_080D4672: + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D460C + + thumb_func_start sub_80D467C +sub_80D467C: @ 80D467C + movs r0, 0 + bx lr + thumb_func_end sub_80D467C + + thumb_func_start sub_80D4680 +sub_80D4680: @ 80D4680 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + bl sub_80D43F0 + lsls r0, 24 + cmp r0, 0 + beq _080D46D2 + adds r0, r4, 0 + movs r1, 0x40 + bl pokemon_getattr + add r2, sp, 0x4 + strb r0, [r2] + ldr r0, =0x03005d8c + ldr r3, [r0] + ldrb r1, [r2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r3, r0 + movs r0, 0xB0 + lsls r0, 6 + adds r3, r0 + movs r1, 0 + movs r0, 0 + strh r0, [r3] + movs r0, 0xFF + strb r0, [r2] + mov r0, sp + strb r1, [r0] + strb r1, [r0, 0x1] + adds r0, r4, 0 + movs r1, 0x40 + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr +_080D46D2: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D4680 + + thumb_func_start sub_80D46E0 +sub_80D46E0: @ 80D46E0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005d8c + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r2, r1 + movs r0, 0xB0 + lsls r0, 6 + adds r2, r0 + movs r0, 0 + strh r0, [r2] + bx lr + .pool + thumb_func_end sub_80D46E0 + + thumb_func_start sub_80D4700 +sub_80D4700: @ 80D4700 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + adds r5, r0, 0 + mov r0, sp + movs r1, 0 + strb r1, [r0] + strb r1, [r0, 0x1] + add r1, sp, 0x4 + movs r0, 0xFF + strb r0, [r1] + movs r7, 0x6 + mov r9, r1 + ldr r0, =0x03005d8c + mov r8, r0 + ldr r3, =0x00002be0 +_080D4724: + mov r1, r8 + ldr r0, [r1] + lsls r1, r7, 3 + adds r1, r7 + lsls r1, 2 + adds r4, r0, r1 + movs r2, 0xB0 + lsls r2, 6 + adds r0, r4, r2 + ldrh r6, [r0] + cmp r6, 0 + bne _080D47A0 + adds r4, r3 + adds r0, r5, 0 + movs r1, 0x40 + str r3, [sp, 0x8] + bl pokemon_getattr + mov r1, r8 + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldr r3, [sp, 0x8] + adds r1, r3 + ldm r1!, {r0,r2,r3} + stm r4!, {r0,r2,r3} + ldm r1!, {r0,r2,r3} + stm r4!, {r0,r2,r3} + ldm r1!, {r0,r2,r3} + stm r4!, {r0,r2,r3} + adds r0, r5, 0 + movs r1, 0x40 + bl pokemon_getattr + mov r1, r8 + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r2, r1 + movs r3, 0xB0 + lsls r3, 6 + adds r2, r3 + strh r6, [r2] + adds r0, r5, 0 + movs r1, 0x40 + mov r2, r9 + bl pokemon_setattr + adds r0, r5, 0 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr + adds r0, r7, 0 + b _080D47AC + .pool +_080D47A0: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0xF + bls _080D4724 + movs r0, 0xFF +_080D47AC: + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80D4700 + + thumb_func_start itemid_is_mail +itemid_is_mail: @ 80D47BC + push {lr} + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x84 + bgt _080D47CE + cmp r0, 0x79 + blt _080D47CE + movs r0, 0x1 + b _080D47D0 +_080D47CE: + movs r0, 0 +_080D47D0: + pop {r1} + bx r1 + thumb_func_end itemid_is_mail + + thumb_func_start sub_80D47D4 +sub_80D47D4: @ 80D47D4 + push {lr} + bl sub_80A0934 + bl AddMapNamePopUpWindowTask + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_80D47D4 + + thumb_func_start AddMapNamePopUpWindowTask +AddMapNamePopUpWindowTask: @ 80D47E4 + push {r4,lr} + movs r0, 0x80 + lsls r0, 7 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080D486C + ldr r4, =Task_MapNamePopUpWindow + adds r0, r4, 0 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + bne _080D4844 + adds r0, r4, 0 + movs r1, 0x5A + bl CreateTask + ldr r4, =0x02039dd4 + strb r0, [r4] + movs r0, 0x12 + movs r1, 0x28 + bl SetGpuReg + ldr r2, =0x03005e00 + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x6 + strh r1, [r0, 0x8] + ldrb r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x28 + strh r1, [r0, 0xC] + b _080D486C + .pool +_080D4844: + ldr r3, =0x03005e00 + ldr r2, =0x02039dd4 + ldrb r0, [r2] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r3 + movs r4, 0x8 + ldrsh r0, [r1, r4] + cmp r0, 0x2 + beq _080D485E + movs r0, 0x2 + strh r0, [r1, 0x8] +_080D485E: + ldrb r0, [r2] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r3 + movs r0, 0x1 + strh r0, [r1, 0xE] +_080D486C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end AddMapNamePopUpWindowTask + + thumb_func_start Task_MapNamePopUpWindow +Task_MapNamePopUpWindow: @ 80D487C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r4, r1, r0 + movs r2, 0x8 + ldrsh r1, [r4, r2] + adds r3, r0, 0 + cmp r1, 0x6 + bhi _080D4966 + lsls r0, r1, 2 + ldr r1, =_080D48A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080D48A8: + .4byte _080D48DE + .4byte _080D4908 + .4byte _080D4920 + .4byte _080D4966 + .4byte _080D494C + .4byte _080D4960 + .4byte _080D48C4 +_080D48C4: + ldrh r0, [r4, 0x10] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1E + ble _080D4966 + strh r1, [r4, 0x8] + strh r1, [r4, 0x10] + bl ShowMapNamePopUpWindow + b _080D4966 +_080D48DE: + ldrh r0, [r4, 0xC] + subs r0, 0x2 + movs r2, 0 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bgt _080D4966 + strh r2, [r4, 0xC] + movs r0, 0x1 + strh r0, [r4, 0x8] + ldr r0, =0x02039dd4 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r3 + strh r2, [r0, 0xA] + b _080D4966 + .pool +_080D4908: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x78 + ble _080D4966 + movs r0, 0 + strh r0, [r4, 0xA] + movs r0, 0x2 + strh r0, [r4, 0x8] + b _080D4966 +_080D4920: + ldrh r0, [r4, 0xC] + adds r0, 0x2 + movs r1, 0 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x27 + ble _080D4966 + movs r0, 0x28 + strh r0, [r4, 0xC] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080D4946 + movs r0, 0x6 + strh r0, [r4, 0x8] + strh r1, [r4, 0x10] + strh r1, [r4, 0xE] + b _080D4966 +_080D4946: + movs r0, 0x4 + strh r0, [r4, 0x8] + b _080D496E +_080D494C: + bl GetMapNamePopUpWindowId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_819746C + movs r0, 0x5 + strh r0, [r4, 0x8] + b _080D4966 +_080D4960: + bl HideMapNamePopUpWindow + b _080D496E +_080D4966: + ldrh r1, [r4, 0xC] + movs r0, 0x12 + bl SetGpuReg +_080D496E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end Task_MapNamePopUpWindow + + thumb_func_start HideMapNamePopUpWindow +HideMapNamePopUpWindow: @ 80D4974 + push {lr} + ldr r0, =Task_MapNamePopUpWindow + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + beq _080D49A4 + bl GetMapNamePopUpWindowId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_819746C + bl RemoveMapNamePopUpWindow + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg_ForcedBlank + ldr r0, =0x02039dd4 + ldrb r0, [r0] + bl DestroyTask +_080D49A4: + pop {r0} + bx r0 + .pool + thumb_func_end HideMapNamePopUpWindow + + thumb_func_start ShowMapNamePopUpWindow +ShowMapNamePopUpWindow: @ 80D49B0 + push {r4,r5,lr} + sub sp, 0x24 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _080D4A08 + ldr r0, =0x02037318 + ldrh r1, [r0, 0x12] + movs r0, 0xBD + lsls r0, 1 + cmp r1, r0 + bne _080D49DC + mov r4, sp + adds r4, 0xF + ldr r0, =gUnknown_0857F544 + ldr r1, [r0, 0x1C] + b _080D49F2 + .pool +_080D49DC: + mov r4, sp + adds r4, 0xF + ldr r1, =gUnknown_0857F544 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r2, =0x00000cb2 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] +_080D49F2: + adds r0, r4, 0 + bl CopyString + b _080D4A18 + .pool +_080D4A08: + mov r4, sp + adds r4, 0xF + ldr r0, =0x02037318 + ldrb r1, [r0, 0x14] + adds r0, r4, 0 + movs r2, 0 + bl GetMapName +_080D4A18: + bl AddMapNamePopUpWindow + bl LoadMapNamePopUpWindowBg + movs r0, 0x7 + adds r1, r4, 0 + movs r2, 0x50 + bl GetStringCenterAlignXOffset + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + add r1, sp, 0xC + movs r5, 0 + movs r0, 0xFC + strb r0, [r1] + movs r0, 0x2 + strb r0, [r1, 0x1] + adds r0, r1, 0 + strb r5, [r0, 0x2] + bl GetMapNamePopUpWindowId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + str r5, [sp, 0x8] + movs r1, 0x7 + add r2, sp, 0xC + adds r3, r4, 0 + bl Print + bl GetMapNamePopUpWindowId + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0x24 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ShowMapNamePopUpWindow + + thumb_func_start sub_80D4A78 +sub_80D4A78: @ 80D4A78 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + ldr r4, [sp, 0x3C] + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x10] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x14] + movs r5, 0 + lsls r0, r1, 24 + asrs r1, r0, 24 + lsrs r3, r2, 24 + str r3, [sp, 0xC] + movs r6, 0xFF + lsls r6, 24 + adds r6, r2 + mov r8, r6 + str r0, [sp, 0x18] + subs r4, r1, 0x1 +_080D4AB4: + ldr r0, =0x0000021d + adds r1, r5, r0 + lsls r1, 16 + lsrs r1, 16 + lsls r2, r4, 24 + lsrs r2, 24 + movs r3, 0x1 + str r3, [sp] + str r3, [sp, 0x4] + movs r6, 0xE + mov r9, r6 + str r6, [sp, 0x8] + adds r0, r7, 0 + mov r6, r8 + lsrs r3, r6, 24 + bl FillBgTilemapBufferRect + adds r4, 0x1 + adds r5, 0x1 + cmp r5, 0xB + ble _080D4AB4 + ldr r1, =0x00000229 + movs r0, 0x1 + negs r0, r0 + add r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r5, 0x1 + str r5, [sp] + str r5, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r7, 0 + mov r2, r8 + ldr r3, [sp, 0xC] + bl FillBgTilemapBufferRect + ldr r1, =0x0000022a + ldr r6, [sp, 0x10] + add r6, r10 + lsls r6, 24 + lsrs r6, 24 + str r5, [sp] + str r5, [sp, 0x4] + mov r3, r9 + str r3, [sp, 0x8] + adds r0, r7, 0 + adds r2, r6, 0 + ldr r3, [sp, 0xC] + bl FillBgTilemapBufferRect + ldr r1, =0x0000022b + ldr r4, [sp, 0xC] + adds r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + str r5, [sp] + str r5, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + adds r0, r7, 0 + mov r2, r8 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + movs r1, 0x8B + lsls r1, 2 + str r5, [sp] + str r5, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + adds r0, r7, 0 + adds r2, r6, 0 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + ldr r1, =0x0000022d + ldr r4, [sp, 0xC] + adds r4, 0x2 + lsls r4, 24 + lsrs r4, 24 + str r5, [sp] + str r5, [sp, 0x4] + mov r3, r9 + str r3, [sp, 0x8] + adds r0, r7, 0 + mov r2, r8 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + ldr r1, =0x0000022e + str r5, [sp] + str r5, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + adds r0, r7, 0 + adds r2, r6, 0 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + movs r5, 0 + ldr r1, [sp, 0xC] + ldr r2, [sp, 0x14] + adds r0, r1, r2 + lsls r4, r0, 24 + movs r6, 0x1 +_080D4B8A: + ldr r3, =0x0000022f + adds r1, r5, r3 + lsls r1, 16 + lsrs r1, 16 + subs r0, r5, 0x1 + ldr r3, [sp, 0x18] + asrs r2, r3, 24 + adds r2, r0 + lsls r2, 24 + lsrs r2, 24 + str r6, [sp] + str r6, [sp, 0x4] + movs r0, 0xE + str r0, [sp, 0x8] + adds r0, r7, 0 + lsrs r3, r4, 24 + bl FillBgTilemapBufferRect + adds r5, 0x1 + cmp r5, 0xB + ble _080D4B8A + 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_80D4A78 + + thumb_func_start LoadMapNamePopUpWindowBg +LoadMapNamePopUpWindowBg: @ 80D4BE0 + push {r4,r5,lr} + sub sp, 0x8 + bl GetMapNamePopUpWindowId + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02037318 + ldrb r1, [r0, 0x14] + cmp r1, 0x57 + bls _080D4C0A + cmp r1, 0xC4 + bls _080D4C08 + adds r0, r1, 0 + subs r0, 0x6D + lsls r0, 16 + lsrs r1, r0, 16 + b _080D4C0A + .pool +_080D4C08: + movs r1, 0 +_080D4C0A: + ldr r0, =gUnknown_0857F464 + adds r0, r1, r0 + ldrb r4, [r0] + adds r0, r5, 0 + movs r1, 0 + bl GetWindowAttribute + lsls r0, 24 + lsrs r0, 24 + lsls r1, r4, 4 + subs r1, r4 + lsls r1, 6 + ldr r2, =gUnknown_0857DD04 + adds r1, r2 + movs r2, 0x80 + lsls r2, 3 + ldr r3, =0x0000021d + bl LoadBgTiles + ldr r1, =sub_80D4A78 + adds r0, r5, 0 + bl CallWindowFunction + adds r0, r5, 0 + bl PutWindowTilemap + ldr r0, =0x02037318 + ldrb r0, [r0, 0x16] + cmp r0, 0xE + bne _080D4C6C + ldr r0, =gUnknown_0857F444 + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply + b _080D4C7A + .pool +_080D4C6C: + lsls r0, r4, 5 + ldr r1, =gUnknown_0857F384 + adds r0, r1 + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply +_080D4C7A: + lsls r1, r4, 4 + subs r1, r4 + lsls r1, 6 + ldr r0, =gUnknown_0857C684 + adds r1, r0 + movs r0, 0x50 + str r0, [sp] + movs r0, 0x18 + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0 + bl BlitBitmapToWindow + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end LoadMapNamePopUpWindowBg + + thumb_func_start RemoveBagObject +@ void RemoveBagObject(u8 a1) +RemoveBagObject: @ 80D4CA8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0203ce54 + ldr r2, =0x00000804 + adds r1, r4, r2 + ldr r0, [r0] + adds r5, r0, r1 + ldrb r0, [r5] + cmp r0, 0xFF + beq _080D4CEE + adds r4, 0x64 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + movs r0, 0xFF + strb r0, [r5] +_080D4CEE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end RemoveBagObject + + thumb_func_start AddBagVisualObject +@ void AddBagVisualObject(u8 bagPocketId) +AddBagVisualObject: @ 80D4D00 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =0x0203ce54 + ldr r4, [r0] + ldr r0, =0x00000804 + adds r4, r0 + ldr r0, =gUnknown_0857FB4C + movs r1, 0x44 + movs r2, 0x42 + movs r3, 0 + bl AddObjectToFront + strb r0, [r4] + adds r0, r5, 0 + movs r1, 0 + bl SetBagVisualPocketId + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end AddBagVisualObject + + thumb_func_start SetBagVisualPocketId +@ void SetBagVisualPocketId(u8 bagPocketId, bool8 isSwitchingPockets) +SetBagVisualPocketId: @ 80D4D38 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + ldr r0, =0x0203ce54 + ldr r0, [r0] + ldr r2, =0x00000804 + adds r0, r2 + ldrb r2, [r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + ldr r2, =0x02020630 + adds r2, r0, r2 + cmp r1, 0 + beq _080D4D84 + ldr r0, =0x0000fffb + strh r0, [r2, 0x26] + ldr r0, =ObjectCB_BagVisualSwitchingPockets + str r0, [r2, 0x1C] + adds r0, r3, 0x1 + strh r0, [r2, 0x2E] + adds r0, r2, 0 + movs r1, 0 + bl StartObjectImageAnim + b _080D4D90 + .pool +_080D4D84: + adds r1, r3, 0x1 + lsls r1, 24 + lsrs r1, 24 + adds r0, r2, 0 + bl StartObjectImageAnim +_080D4D90: + pop {r0} + bx r0 + thumb_func_end SetBagVisualPocketId + + thumb_func_start ObjectCB_BagVisualSwitchingPockets +@ void ObjectCB_BagVisualSwitchingPockets(struct obj *object) +ObjectCB_BagVisualSwitchingPockets: @ 80D4D94 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x26] + movs r2, 0x26 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080D4DA8 + adds r0, r1, 0x1 + strh r0, [r4, 0x26] + b _080D4DB8 +_080D4DA8: + ldrh r1, [r4, 0x2E] + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] +_080D4DB8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ObjectCB_BagVisualSwitchingPockets + + thumb_func_start ShakeBagVisual +@ void ShakeBagVisual() +ShakeBagVisual: @ 80D4DC4 + push {r4,lr} + ldr r0, =0x0203ce54 + ldr r0, [r0] + ldr r1, =0x00000804 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r4, r0, r1 + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080D4DF4 + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + ldr r0, =ObjectCB_ShakeBagVisual + str r0, [r4, 0x1C] +_080D4DF4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ShakeBagVisual + + thumb_func_start ObjectCB_ShakeBagVisual +@ void ObjectCB_ShakeBagVisual(struct obj *object) +ObjectCB_ShakeBagVisual: @ 80D4E0C + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080D4E28 + adds r0, r4, 0 + movs r1, 0 + bl StartObjectRotScalAnim + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] +_080D4E28: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ObjectCB_ShakeBagVisual + + thumb_func_start AddSwitchPocketRotatingBallObject +@ void AddSwitchPocketRotatingBallObject(u16 rotationDirection) +AddSwitchPocketRotatingBallObject: @ 80D4E34 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + ldr r0, =0x0203ce54 + ldr r4, [r0] + ldr r0, =0x00000805 + adds r4, r0 + ldr r0, =gUnknown_0857FBA0 + bl LoadObjectPic + ldr r0, =gUnknown_0857FBA8 + bl LoadTaggedObjectPalette + ldr r0, =gUnknown_0857FBB0 + movs r1, 0x10 + movs r2, 0x10 + movs r3, 0 + bl AddObjectToFront + strb r0, [r4] + ldr r2, =0x02020630 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x2E] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end AddSwitchPocketRotatingBallObject + + thumb_func_start update_switch_pocket_rotating_ball_coords +@ void update_switch_pocket_rotating_ball_coords(struct obj *object) +update_switch_pocket_rotating_ball_coords: @ 80D4E8C + ldrh r2, [r0, 0x30] + ldrh r1, [r0, 0x34] + adds r1, 0x1 + movs r3, 0x1 + ands r1, r3 + subs r2, r1 + adds r1, r0, 0 + adds r1, 0x28 + strb r2, [r1] + ldrh r2, [r0, 0x30] + ldrh r1, [r0, 0x34] + adds r1, 0x1 + ands r1, r3 + subs r2, r1 + adds r0, 0x29 + strb r2, [r0] + bx lr + thumb_func_end update_switch_pocket_rotating_ball_coords + + thumb_func_start ObjectCB_SwitchPocketRotatingBallInit +@ void ObjectCB_SwitchPocketRotatingBallInit(struct obj *object) +ObjectCB_SwitchPocketRotatingBallInit: @ 80D4EB0 + push {r4,lr} + adds r4, r0, 0 + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4, 0x1] + movs r0, 0x2E + ldrsh r1, [r4, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080D4ED8 + ldr r0, =gUnknown_0857FB98 + b _080D4EDA + .pool +_080D4ED8: + ldr r0, =gUnknown_0857FB9C +_080D4EDA: + str r0, [r4, 0x10] + adds r0, r4, 0 + bl obj_alloc_rotscale_entry + adds r0, r4, 0 + adds r0, 0x28 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + strh r0, [r4, 0x30] + adds r0, r4, 0 + adds r0, 0x29 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + strh r0, [r4, 0x30] + adds r0, r4, 0 + bl update_switch_pocket_rotating_ball_coords + ldr r0, =ObjectCB_SwitchPocketRotatingBallContinue + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ObjectCB_SwitchPocketRotatingBallInit + + thumb_func_start ObjectCB_SwitchPocketRotatingBallContinue +@ void ObjectCB_SwitchPocketRotatingBallContinue(struct obj *object) +ObjectCB_SwitchPocketRotatingBallContinue: @ 80D4F14 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + adds r0, r4, 0 + bl update_switch_pocket_rotating_ball_coords + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _080D4F32 + movs r0, 0x1 + bl RemoveBagObject +_080D4F32: + pop {r4} + pop {r0} + bx r0 + thumb_func_end ObjectCB_SwitchPocketRotatingBallContinue + + thumb_func_start AddBagItemIconObject +@ void AddBagItemIconObject(u16 itemId, u8 a2) +AddBagItemIconObject: @ 80D4F38 + push {r4-r6,lr} + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r0, =0x0203ce54 + ldr r2, =0x00000806 + adds r1, r4, r2 + ldr r0, [r0] + adds r5, r0, r1 + ldrb r0, [r5] + cmp r0, 0xFF + bne _080D4F86 + adds r4, 0x66 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r6, 0 + bl AddItemIconObject + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _080D4F86 + strb r2, [r5] + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0x18 + strh r1, [r0, 0x24] + movs r1, 0x58 + strh r1, [r0, 0x26] +_080D4F86: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end AddBagItemIconObject + + thumb_func_start RemoveBagItemIconObject +@ void RemoveBagItemIconObject(u8 a1) +RemoveBagItemIconObject: @ 80D4F98 + push {lr} + lsls r0, 24 + movs r1, 0x80 + lsls r1, 18 + adds r0, r1 + lsrs r0, 24 + bl RemoveBagObject + pop {r0} + bx r0 + thumb_func_end RemoveBagItemIconObject + + thumb_func_start sub_80D4FAC +sub_80D4FAC: @ 80D4FAC + push {lr} + ldr r0, =0x0203ce54 + ldr r0, [r0] + ldr r1, =0x00000808 + adds r0, r1 + movs r1, 0x8 + bl sub_8122344 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D4FAC + + thumb_func_start sub_80D4FC8 +sub_80D4FC8: @ 80D4FC8 + push {lr} + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =0x0203ce54 + ldr r0, [r0] + ldr r1, =0x00000808 + adds r0, r1 + movs r1, 0x8 + bl sub_81223FC + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D4FC8 + + thumb_func_start sub_80D4FEC +sub_80D4FEC: @ 80D4FEC + push {lr} + adds r3, r0, 0 + lsls r3, 24 + ldr r0, =0x0203ce54 + ldr r0, [r0] + ldr r1, =0x00000808 + adds r0, r1 + lsrs r3, 4 + movs r1, 0x80 + lsls r1, 13 + adds r3, r1 + lsrs r3, 16 + movs r1, 0x88 + movs r2, 0x78 + bl sub_8122448 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D4FEC + + thumb_func_start sub_80D5018 +sub_80D5018: @ 80D5018 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r4, r1, 0 + movs r2, 0x80 + lsls r2, 4 + adds r0, r4, 0 + movs r1, 0 + bl memset + movs r0, 0x80 + lsls r0, 1 + adds r4, r0 + movs r7, 0 +_080D5036: + adds r4, 0x20 + movs r5, 0 + adds r1, r7, 0x1 + mov r8, r1 +_080D503E: + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x20 + bl memcpy + adds r4, 0x20 + adds r6, 0x20 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _080D503E + cmp r7, 0x5 + beq _080D505C + adds r4, 0x20 +_080D505C: + mov r1, r8 + lsls r0, r1, 24 + lsrs r7, r0, 24 + cmp r7, 0x5 + bls _080D5036 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80D5018 + + thumb_func_start sub_80D5070 +sub_80D5070: @ 80D5070 + push {r4,r5,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + cmp r4, 0x2A + bne _080D5082 + bl sub_80E162C +_080D5082: + ldr r5, =gBerryPicTable + lsls r4, 3 + adds r0, r5, 0x4 + adds r0, r4, r0 + ldr r0, [r0] + str r0, [sp] + ldr r1, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r1 + ldr r1, =0x00007544 + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl LoadCompressedObjectPalette + adds r4, r5 + ldr r0, [r4] + ldr r4, =0x0201d000 + adds r1, r4, 0 + bl LZDecompressWram + ldr r0, =0xfffff000 + adds r1, r4, r0 + adds r0, r4, 0 + bl sub_80D5018 + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5070 + + thumb_func_start sub_80D50D4 +sub_80D50D4: @ 80D50D4 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 16 + lsrs r5, 16 + bl sub_80D5070 + ldr r0, =gUnknown_0857FBEC + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D50D4 + + thumb_func_start sub_80D510C +sub_80D510C: @ 80D510C + push {lr} + ldr r0, =0x00007544 + bl FreeObjectPaletteByTag + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D510C + + thumb_func_start sub_80D511C +sub_80D511C: @ 80D511C + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + mov r8, r3 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =0x00007544 + bl FreeObjectPaletteByTag + adds r0, r4, 0 + bl sub_80D5070 + ldr r0, =gUnknown_0857FC7C + adds r1, r5, 0 + adds r2, r6, 0 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + adds r4, r1, 0 + mov r0, r8 + cmp r0, 0x1 + bne _080D5172 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0x1 + bl StartObjectRotScalAnim +_080D5172: + adds r0, r4, 0 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D511C + + thumb_func_start sub_80D518C +sub_80D518C: @ 80D518C + push {lr} + adds r1, r0, 0 + ldr r0, =gUnknown_0857FE10 + lsls r1, 16 + asrs r1, 16 + movs r2, 0x74 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80D518C + + thumb_func_start sub_80D51AC +sub_80D51AC: @ 80D51AC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x0203841e + ldrb r0, [r4] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + bne _080D51D0 + adds r0, r5, 0 + bl move_anim_task_del + b _080D520C + .pool +_080D51D0: + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r4, 0x2] + strh r1, [r0, 0x24] + ldrh r1, [r4, 0x4] + strh r1, [r0, 0x26] + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r2, [r0, 0x8] + ldrh r1, [r4, 0x6] + strh r1, [r0, 0xA] + ldrh r1, [r4, 0x8] + strh r1, [r0, 0xC] + ldrh r1, [r4, 0x8] + strh r1, [r0, 0xE] + ldrh r1, [r4, 0x2] + strh r1, [r0, 0x10] + ldrh r1, [r4, 0x4] + strh r1, [r0, 0x12] + ldr r1, =sub_80D5220 + str r1, [r0] + adds r0, r5, 0 + bl _call_via_r1 +_080D520C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D51AC + + thumb_func_start sub_80D5220 +sub_80D5220: @ 80D5220 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r3, r0, r1 + ldrh r0, [r3, 0xE] + movs r2, 0xE + ldrsh r5, [r3, r2] + adds r7, r1, 0 + cmp r5, 0 + bne _080D52C6 + ldr r2, =0x02020630 + movs r6, 0x8 + ldrsh r1, [r3, r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + movs r6, 0x24 + ldrsh r0, [r1, r6] + adds r6, r2, 0 + cmp r0, 0 + bne _080D5264 + ldrh r0, [r3, 0x10] + strh r0, [r1, 0x24] + b _080D5266 + .pool +_080D5264: + strh r5, [r1, 0x24] +_080D5266: + lsls r2, r4, 2 + adds r0, r2, r4 + lsls r0, 3 + adds r3, r0, r7 + movs r0, 0x8 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r6 + movs r5, 0x26 + ldrsh r0, [r1, r5] + cmp r0, 0 + bne _080D5286 + ldrh r0, [r3, 0x12] + b _080D5288 +_080D5286: + movs r0, 0 +_080D5288: + strh r0, [r1, 0x26] + adds r0, r2, r4 + lsls r0, 3 + adds r2, r0, r7 + ldrh r0, [r2, 0xC] + strh r0, [r2, 0xE] + ldrh r0, [r2, 0xA] + subs r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + asrs r3, r0, 16 + cmp r3, 0 + bne _080D52CA + movs r0, 0x8 + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r3, [r0, 0x24] + movs r5, 0x8 + ldrsh r1, [r2, r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r3, [r0, 0x26] + adds r0, r4, 0 + bl move_anim_task_del + b _080D52CA +_080D52C6: + subs r0, 0x1 + strh r0, [r3, 0xE] +_080D52CA: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80D5220 + + thumb_func_start sub_80D52D0 +sub_80D52D0: @ 80D52D0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0 + ldr r2, =0x0203841e + ldrh r0, [r2] + movs r3, 0 + ldrsh r1, [r2, r3] + cmp r1, 0x3 + bgt _080D52FC + lsls r0, 24 + lsrs r0, 24 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xFF + bne _080D5352 + b _080D5356 + .pool +_080D52FC: + cmp r1, 0x8 + beq _080D5348 + movs r1, 0 + ldrsh r0, [r2, r1] + cmp r0, 0x5 + beq _080D531C + cmp r0, 0x5 + bgt _080D5312 + cmp r0, 0x4 + beq _080D5318 + b _080D5324 +_080D5312: + cmp r0, 0x6 + beq _080D5320 + b _080D5324 +_080D5318: + movs r0, 0 + b _080D5326 +_080D531C: + movs r0, 0x2 + b _080D5326 +_080D5320: + movs r0, 0x1 + b _080D5326 +_080D5324: + movs r0, 0x3 +_080D5326: + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + bne _080D533C + movs r6, 0x1 +_080D533C: + ldr r0, =0x020241e4 + adds r0, r4, r0 + b _080D5350 + .pool +_080D5348: + ldr r1, =0x020241e4 + ldr r0, =0x02038436 + ldrb r0, [r0] + adds r0, r1 +_080D5350: + ldrb r3, [r0] +_080D5352: + cmp r6, 0 + beq _080D5368 +_080D5356: + adds r0, r5, 0 + bl move_anim_task_del + b _080D53A6 + .pool +_080D5368: + ldr r1, =0x02020630 + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + adds r0, r1 + ldr r2, =0x0203841e + ldrh r1, [r2, 0x2] + strh r1, [r0, 0x24] + ldrh r1, [r2, 0x4] + strh r1, [r0, 0x26] + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r3, [r0, 0x8] + ldrh r1, [r2, 0x6] + strh r1, [r0, 0xA] + ldrh r1, [r2, 0x8] + strh r1, [r0, 0xC] + ldrh r1, [r2, 0x8] + strh r1, [r0, 0xE] + ldrh r1, [r2, 0x2] + strh r1, [r0, 0x10] + ldrh r1, [r2, 0x4] + strh r1, [r0, 0x12] + ldr r1, =sub_80D53BC + str r1, [r0] + adds r0, r5, 0 + bl _call_via_r1 +_080D53A6: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D52D0 + + thumb_func_start sub_80D53BC +sub_80D53BC: @ 80D53BC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r3, r0, r1 + ldrh r2, [r3, 0xE] + movs r4, 0xE + ldrsh r0, [r3, r4] + mov r12, r1 + cmp r0, 0 + bne _080D5474 + ldr r2, =0x02020630 + movs r7, 0x8 + ldrsh r1, [r3, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r2 + movs r0, 0x24 + ldrsh r1, [r4, r0] + ldrh r5, [r3, 0x10] + movs r7, 0x10 + ldrsh r0, [r3, r7] + adds r7, r2, 0 + cmp r1, r0 + bne _080D5408 + negs r0, r5 + strh r0, [r4, 0x24] + b _080D540A + .pool +_080D5408: + strh r5, [r4, 0x24] +_080D540A: + lsls r3, r6, 2 + adds r1, r3, r6 + lsls r1, 3 + add r1, r12 + movs r0, 0x8 + ldrsh r2, [r1, r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r4, r0, r7 + movs r0, 0x26 + ldrsh r2, [r4, r0] + mov r8, r2 + ldrh r5, [r1, 0x12] + movs r2, 0x12 + ldrsh r0, [r1, r2] + cmp r8, r0 + bne _080D5434 + negs r0, r5 + strh r0, [r4, 0x26] + b _080D5436 +_080D5434: + strh r5, [r4, 0x26] +_080D5436: + adds r0, r3, r6 + lsls r0, 3 + mov r4, r12 + adds r3, r0, r4 + ldrh r0, [r3, 0xC] + strh r0, [r3, 0xE] + ldrh r0, [r3, 0xA] + subs r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + bne _080D5478 + movs r0, 0x8 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x24] + movs r4, 0x8 + ldrsh r1, [r3, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + strh r2, [r0, 0x26] + adds r0, r6, 0 + bl move_anim_task_del + b _080D5478 +_080D5474: + subs r0, r2, 0x1 + strh r0, [r3, 0xE] +_080D5478: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80D53BC + + thumb_func_start sub_80D5484 +sub_80D5484: @ 80D5484 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x0203841e + ldrb r0, [r4] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xFF + bne _080D54A8 + adds r0, r5, 0 + bl move_anim_task_del + b _080D54F6 + .pool +_080D54A8: + ldr r0, =0x02020630 + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r4, 0x2] + ldrh r2, [r1, 0x24] + adds r0, r2 + movs r2, 0 + strh r0, [r1, 0x24] + ldrh r0, [r4, 0x4] + ldrh r6, [r1, 0x26] + adds r0, r6 + strh r0, [r1, 0x26] + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + strh r3, [r1, 0x8] + strh r2, [r1, 0xA] + ldrh r0, [r4, 0x6] + strh r0, [r1, 0xC] + strh r2, [r1, 0xE] + ldrh r0, [r4, 0x8] + strh r0, [r1, 0x10] + movs r2, 0x2 + ldrsh r0, [r4, r2] + lsls r0, 1 + strh r0, [r1, 0x12] + movs r6, 0x4 + ldrsh r0, [r4, r6] + lsls r0, 1 + strh r0, [r1, 0x14] + ldr r2, =sub_80D5508 + str r2, [r1] + adds r0, r5, 0 + bl _call_via_r2 +_080D54F6: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5484 + + thumb_func_start sub_80D5508 +sub_80D5508: @ 80D5508 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r2, [r4, 0xE] + movs r3, 0xE + ldrsh r0, [r4, r3] + adds r6, r1, 0 + cmp r0, 0 + beq _080D5526 + b _080D5638 +_080D5526: + ldrh r1, [r4, 0xA] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080D5568 + ldr r2, =0x02020630 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x12] + ldrh r3, [r0, 0x24] + adds r1, r3 + strh r1, [r0, 0x24] + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x14] + ldrh r3, [r0, 0x26] + adds r1, r3 + strh r1, [r0, 0x26] + adds r3, r2, 0 + b _080D5592 + .pool +_080D5568: + ldr r3, =0x02020630 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x24] + ldrh r2, [r4, 0x12] + subs r1, r2 + strh r1, [r0, 0x24] + movs r2, 0x8 + ldrsh r1, [r4, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x26] + ldrh r2, [r4, 0x14] + subs r1, r2 + strh r1, [r0, 0x26] +_080D5592: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r6 + ldrh r0, [r4, 0x10] + strh r0, [r4, 0xE] + ldrh r0, [r4, 0xA] + adds r2, r0, 0x1 + strh r2, [r4, 0xA] + lsls r0, r2, 16 + asrs r0, 16 + movs r6, 0xC + ldrsh r1, [r4, r6] + cmp r0, r1 + blt _080D563C + movs r0, 0x1 + ands r2, r0 + cmp r2, 0 + beq _080D55F8 + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + movs r2, 0x12 + ldrsh r0, [r4, r2] + lsrs r2, r0, 31 + adds r0, r2 + asrs r0, 1 + ldrh r6, [r1, 0x24] + adds r0, r6 + strh r0, [r1, 0x24] + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + movs r2, 0x14 + ldrsh r0, [r4, r2] + lsrs r2, r0, 31 + adds r0, r2 + asrs r0, 1 + ldrh r3, [r1, 0x26] + adds r0, r3 + strh r0, [r1, 0x26] + b _080D5630 + .pool +_080D55F8: + movs r6, 0x8 + ldrsh r0, [r4, r6] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r3 + movs r3, 0x14 + ldrsh r1, [r4, r3] + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + ldrh r0, [r2, 0x26] + subs r0, r1 + strh r0, [r2, 0x26] +_080D5630: + adds r0, r5, 0 + bl move_anim_task_del + b _080D563C +_080D5638: + subs r0, r2, 0x1 + strh r0, [r4, 0xE] +_080D563C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80D5508 + + thumb_func_start sub_80D5644 +sub_80D5644: @ 80D5644 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =0x0203841e + ldrb r0, [r5] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrh r2, [r5, 0x2] + strh r2, [r1, 0x24] + ldr r2, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r2 + strh r0, [r1, 0x8] + ldrh r0, [r5, 0x2] + strh r0, [r1, 0xA] + ldrh r0, [r5, 0x4] + strh r0, [r1, 0xC] + ldrh r0, [r5, 0x6] + strh r0, [r1, 0xE] + ldrh r0, [r5, 0x8] + strh r0, [r1, 0x10] + ldr r2, =sub_80D56A4 + str r2, [r1] + adds r0, r4, 0 + bl _call_via_r2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5644 + + thumb_func_start sub_80D56A4 +sub_80D56A4: @ 80D56A4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r3, r0, r2 + ldrb r5, [r3, 0x8] + ldrh r4, [r3, 0xA] + ldrh r1, [r3, 0x18] + adds r0, r1, 0x1 + strh r0, [r3, 0x18] + movs r7, 0xC + ldrsh r0, [r3, r7] + lsls r1, 16 + asrs r1, 16 + mov r12, r2 + ldr r7, =0x02020630 + cmp r0, r1 + bne _080D56F6 + movs r0, 0 + strh r0, [r3, 0x18] + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r1, r0, r7 + ldrh r3, [r1, 0x24] + movs r0, 0x24 + ldrsh r2, [r1, r0] + lsls r0, r4, 16 + asrs r0, 16 + cmp r2, r0 + bne _080D56EE + negs r0, r2 + lsls r0, 16 + lsrs r4, r0, 16 +_080D56EE: + lsls r0, r4, 16 + asrs r0, 16 + adds r0, r3 + strh r0, [r1, 0x24] +_080D56F6: + lsls r2, r6, 2 + adds r2, r6 + lsls r2, 3 + add r2, r12 + strh r4, [r2, 0xA] + ldrh r1, [r2, 0xE] + ldrh r0, [r2, 0x1A] + adds r1, r0 + strh r1, [r2, 0x1A] + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r0, r7 + lsls r1, 16 + asrs r1, 24 + strh r1, [r0, 0x26] + ldrh r0, [r2, 0x10] + subs r0, 0x1 + strh r0, [r2, 0x10] + lsls r0, 16 + cmp r0, 0 + bne _080D5728 + adds r0, r6, 0 + bl move_anim_task_del +_080D5728: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D56A4 + + thumb_func_start sub_80D5738 +sub_80D5738: @ 80D5738 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0x1 + ldr r4, =0x0203841e + ldrb r0, [r4] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r7, r0, 24 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x5 + ble _080D575C + movs r0, 0x5 + strh r0, [r4, 0x8] +_080D575C: + movs r1, 0 + movs r2, 0x8 + ldrsh r0, [r4, r2] + adds r3, r4, 0 + ldr r2, =0x03005e00 + mov r12, r2 + lsls r4, r5, 2 + ldr r2, =sub_80D57B8 + mov r8, r2 + cmp r1, r0 + bge _080D5782 + adds r2, r0, 0 +_080D5774: + lsls r0, r6, 25 + lsrs r6, r0, 24 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, r2 + blt _080D5774 +_080D5782: + adds r0, r4, r5 + lsls r0, 3 + add r0, r12 + strh r7, [r0, 0x8] + ldrh r1, [r3, 0x2] + strh r1, [r0, 0xA] + ldrh r1, [r3, 0x4] + strh r1, [r0, 0xC] + ldrh r1, [r3, 0x6] + strh r1, [r0, 0xE] + strh r6, [r0, 0x10] + mov r1, r8 + str r1, [r0] + adds r0, r5, 0 + bl _call_via_r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5738 + + thumb_func_start sub_80D57B8 +sub_80D57B8: @ 80D57B8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + ldrb r4, [r5, 0x8] + movs r1, 0x12 + ldrsh r0, [r5, r1] + movs r2, 0xA + ldrsh r1, [r5, r2] + bl sine + ldr r2, =0x02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r4, r1, r2 + strh r0, [r4, 0x24] + movs r1, 0x12 + ldrsh r0, [r5, r1] + movs r2, 0xC + ldrsh r1, [r5, r2] + bl cosine + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r1, [r5, 0xC] + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r5, 0x10] + ldrh r1, [r5, 0x12] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x12] + cmp r0, 0 + bne _080D5810 + ldrh r0, [r5, 0xE] + subs r0, 0x1 + strh r0, [r5, 0xE] +_080D5810: + movs r2, 0xE + ldrsh r0, [r5, r2] + cmp r0, 0 + bne _080D5822 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + adds r0, r6, 0 + bl move_anim_task_del +_080D5822: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D57B8 + + thumb_func_start sub_80D5830 +sub_80D5830: @ 80D5830 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080D584C + ldr r1, =0x0203841e + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] +_080D584C: + adds r0, r4, 0 + bl sub_80D5738 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5830 + + thumb_func_start sub_80D5860 +sub_80D5860: @ 80D5860 + push {r4,lr} + adds r4, r0, 0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080D5890 + ldr r1, =0x0203841e + ldrh r0, [r1, 0x2] + negs r0, r0 + b _080D5894 + .pool +_080D5890: + ldr r1, =0x0203841e + ldrh r0, [r1, 0x2] +_080D5894: + strh r0, [r4, 0x30] + ldrh r2, [r1] + movs r0, 0 + strh r2, [r4, 0x2E] + strh r0, [r4, 0x32] + ldr r1, =0x020241e4 + ldr r0, =0x02038436 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strh r0, [r4, 0x34] + strh r2, [r4, 0x36] + ldr r1, =sub_80D58D4 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A6630 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5860 + + thumb_func_start sub_80D58D4 +sub_80D58D4: @ 80D58D4 + push {lr} + ldrh r1, [r0, 0x36] + strh r1, [r0, 0x2E] + ldrh r1, [r0, 0x30] + negs r1, r1 + strh r1, [r0, 0x30] + ldr r1, =sub_80A6630 + str r1, [r0, 0x1C] + ldr r1, =move_anim_8072740 + bl oamt_set_x3A_32 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D58D4 + + thumb_func_start sub_80D58F8 +sub_80D58F8: @ 80D58F8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r5, =0x0203841e + ldrb r0, [r5, 0x4] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + ldrh r2, [r5] + movs r1, 0 + strh r2, [r4, 0x2E] + strh r1, [r4, 0x30] + ldrh r1, [r5, 0x2] + strh r1, [r4, 0x32] + strh r0, [r4, 0x34] + strh r2, [r4, 0x36] + ldr r1, =sub_80D5944 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A6630 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D58F8 + + thumb_func_start sub_80D5944 +sub_80D5944: @ 80D5944 + push {lr} + ldrh r1, [r0, 0x36] + strh r1, [r0, 0x2E] + ldrh r1, [r0, 0x32] + negs r1, r1 + strh r1, [r0, 0x32] + ldr r1, =sub_80A6630 + str r1, [r0, 0x1C] + ldr r1, =move_anim_8072740 + bl oamt_set_x3A_32 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5944 + + thumb_func_start sub_80D5968 +sub_80D5968: @ 80D5968 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _080D598C + ldr r1, =0x020241e4 + ldr r0, =0x02038436 + b _080D5990 + .pool +_080D598C: + ldr r1, =0x020241e4 + ldr r0, =0x02038437 +_080D5990: + ldrb r0, [r0] + adds r0, r1 + ldrb r7, [r0] + ldr r5, =0x0203841e + ldrh r0, [r5, 0x4] + movs r3, 0 + strh r0, [r6, 0x2E] + ldr r0, =0x02020630 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + adds r4, r0 + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r6, 0x30] + ldrh r0, [r4, 0x20] + strh r0, [r6, 0x32] + ldrh r0, [r4, 0x26] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r6, 0x34] + ldrh r0, [r4, 0x22] + strh r0, [r6, 0x36] + adds r0, r6, 0 + str r3, [sp] + bl sub_80A6E14 + ldr r3, [sp] + strh r3, [r6, 0x34] + strh r3, [r6, 0x36] + ldrh r0, [r4, 0x24] + strh r0, [r6, 0x38] + ldrh r0, [r4, 0x26] + strh r0, [r6, 0x3A] + adds r2, r6, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + movs r1, 0x2 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _080D5A00 + strh r3, [r6, 0x32] + b _080D5A06 + .pool +_080D5A00: + cmp r0, 0x2 + bne _080D5A06 + strh r3, [r6, 0x30] +_080D5A06: + ldr r0, =0x0203841e + ldrh r1, [r0, 0x2] + lsls r0, r7, 8 + orrs r0, r1 + strh r0, [r6, 0x3C] + ldr r0, =sub_80D5A24 + str r0, [r6, 0x1C] + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5968 + + thumb_func_start sub_80D5A24 +sub_80D5A24: @ 80D5A24 + push {r4-r6,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x3C] + lsls r1, r0, 24 + lsrs r4, r1, 24 + adds r5, r4, 0 + lsls r0, 16 + asrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r3, r1, r0 + ldrh r0, [r2, 0x2E] + movs r6, 0x2E + ldrsh r1, [r2, r6] + cmp r1, 0 + bne _080D5A64 + cmp r4, 0x1 + bhi _080D5A4E + strh r1, [r3, 0x24] +_080D5A4E: + cmp r5, 0x2 + beq _080D5A56 + cmp r5, 0 + bne _080D5A58 +_080D5A56: + strh r1, [r3, 0x26] +_080D5A58: + adds r0, r2, 0 + bl move_anim_8072740 + b _080D5A8E + .pool +_080D5A64: + subs r0, 0x1 + strh r0, [r2, 0x2E] + ldrh r1, [r2, 0x30] + ldrh r0, [r2, 0x34] + adds r1, r0 + strh r1, [r2, 0x34] + ldrh r0, [r2, 0x32] + ldrh r4, [r2, 0x36] + adds r0, r4 + strh r0, [r2, 0x36] + lsls r1, 16 + asrs r1, 24 + ldrh r6, [r2, 0x38] + adds r1, r6 + strh r1, [r3, 0x24] + ldrh r0, [r2, 0x36] + lsls r0, 16 + asrs r0, 24 + ldrh r2, [r2, 0x3A] + adds r0, r2 + strh r0, [r3, 0x26] +_080D5A8E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80D5A24 + + thumb_func_start sub_80D5A94 +sub_80D5A94: @ 80D5A94 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _080D5AB0 + ldr r0, =0x02038436 + b _080D5AB2 + .pool +_080D5AB0: + ldr r0, =0x02038437 +_080D5AB2: + ldrb r2, [r0] + ldr r0, =0x020241e4 + adds r0, r2, r0 + ldrb r6, [r0] + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080D5ADC + ldr r1, =0x0203841e + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] + movs r2, 0x6 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _080D5ADC + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_080D5ADC: + ldr r2, =0x0203841e + ldrh r0, [r2, 0x8] + movs r4, 0 + strh r0, [r5, 0x2E] + ldr r0, =0x02020630 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x20] + strh r0, [r5, 0x30] + ldrh r0, [r2, 0x2] + ldrh r3, [r1, 0x20] + adds r0, r3 + strh r0, [r5, 0x32] + ldrh r0, [r1, 0x22] + strh r0, [r5, 0x34] + ldrh r0, [r2, 0x4] + ldrh r1, [r1, 0x22] + adds r0, r1 + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl sub_80A6E14 + strh r4, [r5, 0x34] + strh r4, [r5, 0x36] + strh r6, [r5, 0x38] + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r1, =move_anim_8072740 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A6680 + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5A94 + + thumb_func_start sub_80D5B48 +sub_80D5B48: @ 80D5B48 + push {r4-r7,lr} + adds r6, r0, 0 + adds r2, r6, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _080D5B70 + ldr r0, =0x02038436 + b _080D5B72 + .pool +_080D5B70: + ldr r0, =0x02038437 +_080D5B72: + ldrb r1, [r0] + ldr r0, =0x020241e4 + adds r0, r1, r0 + ldrb r7, [r0] + adds r0, r1, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080D5B9C + ldr r1, =0x0203841e + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] + movs r2, 0x6 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _080D5B9C + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_080D5B9C: + ldr r5, =0x0203841e + ldrh r0, [r5, 0x8] + strh r0, [r6, 0x2E] + ldr r0, =0x02020630 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + adds r4, r0 + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r6, 0x30] + ldrh r1, [r5, 0x2] + adds r0, r1 + strh r0, [r6, 0x32] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r6, 0x34] + ldrh r1, [r5, 0x4] + adds r0, r1 + strh r0, [r6, 0x36] + adds r0, r6, 0 + bl sub_80A6E14 + ldrh r0, [r4, 0x24] + lsls r0, 8 + strh r0, [r6, 0x34] + ldrh r0, [r4, 0x26] + lsls r0, 8 + strh r0, [r6, 0x36] + strh r7, [r6, 0x38] + ldrh r0, [r5, 0xA] + strh r0, [r6, 0x3A] + lsls r0, 16 + cmp r0, 0 + bne _080D5C04 + ldr r1, =move_anim_8072740 + adds r0, r6, 0 + bl oamt_set_x3A_32 + b _080D5C0C + .pool +_080D5C04: + ldr r1, =sub_80D5C20 + adds r0, r6, 0 + bl oamt_set_x3A_32 +_080D5C0C: + ldr r0, =sub_80A6680 + str r0, [r6, 0x1C] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5B48 + + thumb_func_start sub_80D5C20 +sub_80D5C20: @ 80D5C20 + push {r4,lr} + ldr r4, =0x02020630 + movs r1, 0x38 + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + movs r3, 0 + strh r3, [r1, 0x24] + movs r1, 0x38 + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + strh r3, [r1, 0x26] + bl move_anim_8072740 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5C20 + + thumb_func_start sub_80D5C50 +sub_80D5C50: @ 80D5C50 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, =0x0203841e + movs r0, 0x6 + ldrsh r1, [r5, r0] + movs r0, 0x80 + lsls r0, 8 + bl __divsi3 + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080D5C82 + ldrh r0, [r5, 0x2] + negs r0, r0 + strh r0, [r5, 0x2] + ldrh r0, [r5, 0xA] + negs r0, r0 + strh r0, [r5, 0xA] +_080D5C82: + ldrb r0, [r5] + bl obj_id_for_side_relative_to_move + ldr r1, =0x03005e00 + lsls r4, r6, 2 + adds r4, r6 + lsls r4, 3 + adds r4, r1 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x8] + movs r1, 0x2 + ldrsh r0, [r5, r1] + lsls r0, 8 + movs r2, 0x6 + ldrsh r1, [r5, r2] + bl __divsi3 + strh r0, [r4, 0xA] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0xC] + ldrh r0, [r5, 0x6] + strh r0, [r4, 0xE] + ldrh r0, [r5, 0x8] + strh r0, [r4, 0x10] + movs r1, 0xA + ldrsh r0, [r5, r1] + lsls r0, 8 + movs r2, 0xC + ldrsh r1, [r5, r2] + bl __divsi3 + strh r0, [r4, 0x12] + ldrh r0, [r5, 0xC] + strh r0, [r4, 0x14] + strh r7, [r4, 0x16] + ldr r0, =sub_80D5CE4 + str r0, [r4] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5C50 + + thumb_func_start sub_80D5CE4 +sub_80D5CE4: @ 80D5CE4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r5, r1, r2 + ldrb r1, [r5, 0x8] + ldrh r0, [r5, 0xA] + ldrh r2, [r5, 0x1E] + adds r0, r2 + strh r0, [r5, 0x1E] + ldr r2, =0x02020630 + lsls r4, r1, 4 + adds r4, r1 + lsls r4, 2 + adds r4, r2 + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + ldrh r0, [r5, 0x1C] + lsrs r0, 8 + movs r2, 0xC + ldrsh r1, [r5, r2] + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r5, 0x16] + ldrh r1, [r5, 0x1C] + adds r0, r1 + strh r0, [r5, 0x1C] + ldrh r0, [r5, 0xE] + subs r0, 0x1 + strh r0, [r5, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _080D5D34 + ldr r0, =sub_80D5D48 + str r0, [r5] +_080D5D34: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5CE4 + + thumb_func_start sub_80D5D48 +sub_80D5D48: @ 80D5D48 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r1, [r4, 0x10] + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _080D5D70 + subs r0, r1, 0x1 + strh r0, [r4, 0x10] + b _080D5DA4 + .pool +_080D5D70: + ldrb r0, [r4, 0x8] + ldrh r2, [r4, 0x12] + ldrh r1, [r4, 0x20] + adds r2, r1 + strh r2, [r4, 0x20] + ldr r3, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + lsls r2, 16 + asrs r2, 24 + ldrh r0, [r4, 0x1E] + lsls r0, 16 + asrs r0, 24 + adds r2, r0 + strh r2, [r1, 0x24] + ldrh r0, [r4, 0x14] + subs r0, 0x1 + strh r0, [r4, 0x14] + lsls r0, 16 + cmp r0, 0 + bne _080D5DA4 + adds r0, r5, 0 + bl move_anim_task_del +_080D5DA4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5D48 + + thumb_func_start sub_80D5DB0 +sub_80D5DB0: @ 80D5DB0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x0203841e + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0x2 + beq _080D5DDE + cmp r0, 0x2 + bgt _080D5DD8 + cmp r0, 0 + blt _080D5E10 + ldrb r0, [r1] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r2, r0, 24 + b _080D5E18 + .pool +_080D5DD8: + cmp r0, 0x3 + beq _080D5DE8 + b _080D5E10 +_080D5DDE: + ldr r5, =0x02038436 + b _080D5DEA + .pool +_080D5DE8: + ldr r5, =0x02038437 +_080D5DEA: + ldrb r0, [r5] + movs r4, 0x2 + eors r0, r4 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080D5E10 + ldr r1, =0x020241e4 + ldrb r0, [r5] + eors r0, r4 + adds r0, r1 + ldrb r2, [r0] + b _080D5E18 + .pool +_080D5E10: + adds r0, r6, 0 + bl move_anim_task_del + b _080D5E58 +_080D5E18: + ldr r1, =0x03005e00 + lsls r4, r6, 2 + adds r0, r4, r6 + lsls r0, 3 + adds r5, r0, r1 + strh r2, [r5, 0x8] + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080D5E44 + ldr r0, =0x0203841e + ldrh r0, [r0, 0x2] + b _080D5E4A + .pool +_080D5E44: + ldr r0, =0x0203841e + ldrh r0, [r0, 0x2] + negs r0, r0 +_080D5E4A: + strh r0, [r5, 0xA] + ldr r0, =0x03005e00 + adds r1, r4, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80D5E6C + str r0, [r1] +_080D5E58: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5DB0 + + thumb_func_start sub_80D5E6C +sub_80D5E6C: @ 80D5E6C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrb r2, [r1, 0x8] + ldr r3, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r1, 0xA] + ldrh r2, [r0, 0x24] + adds r1, r2 + strh r1, [r0, 0x24] + movs r2, 0x24 + ldrsh r1, [r0, r2] + movs r2, 0x20 + ldrsh r0, [r0, r2] + adds r1, r0 + adds r1, 0x20 + movs r0, 0x98 + lsls r0, 1 + cmp r1, r0 + bls _080D5EAA + adds r0, r4, 0 + bl move_anim_task_del +_080D5EAA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5E6C + + thumb_func_start sub_80D5EB8 +sub_80D5EB8: @ 80D5EB8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, =0x02038436 + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080D5ED4 + ldr r1, =0x0203841e + ldrh r0, [r1, 0x2] + negs r0, r0 + strh r0, [r1, 0x2] +_080D5ED4: + ldr r4, =0x0203841e + ldrb r0, [r4, 0x8] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r3, r5, 2 + adds r1, r3, r5 + lsls r1, 3 + adds r2, r1, r2 + ldrh r1, [r4] + strh r1, [r2, 0x8] + ldrh r1, [r4, 0x2] + strh r1, [r2, 0xA] + ldrh r1, [r4, 0x4] + strh r1, [r2, 0xC] + ldrh r1, [r4, 0x6] + strh r1, [r2, 0xE] + strh r0, [r2, 0x10] + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080D5F14 + ldrb r0, [r6] + b _080D5F18 + .pool +_080D5F14: + ldr r0, =0x02038437 + ldrb r0, [r0] +_080D5F18: + strh r0, [r2, 0x12] + ldr r1, =0x03005e00 + adds r0, r3, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x20] + ldr r1, =sub_80D5F3C + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5EB8 + + thumb_func_start sub_80D5F3C +sub_80D5F3C: @ 80D5F3C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + ldrb r7, [r4, 0x10] + ldrh r0, [r4, 0xC] + ldrh r1, [r4, 0x1C] + adds r0, r1 + lsls r1, r0, 16 + strh r0, [r4, 0x1C] + lsrs r1, 24 + mov r8, r1 + mov r0, r8 + movs r2, 0xA + ldrsh r1, [r4, r2] + bl sine + lsls r0, 16 + lsrs r5, r0, 16 + mov r9, r5 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080D5F94 + ldr r0, =0x02020630 + lsls r2, r7, 4 + adds r1, r2, r7 + lsls r1, 2 + adds r1, r0 + strh r5, [r1, 0x24] + mov r9, r0 + adds r4, r2, 0 + b _080D5FDA + .pool +_080D5F94: + ldrb r0, [r4, 0x12] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080D5FBC + ldr r1, =0x02020630 + lsls r2, r7, 4 + adds r0, r2, r7 + lsls r0, 2 + adds r3, r0, r1 + lsls r0, r5, 16 + asrs r0, 16 + mov r9, r1 + adds r4, r2, 0 + cmp r0, 0 + bge _080D5FD8 + b _080D5FD6 + .pool +_080D5FBC: + ldr r1, =0x02020630 + lsls r2, r7, 4 + adds r0, r2, r7 + lsls r0, 2 + adds r3, r0, r1 + mov r4, r9 + lsls r0, r4, 16 + asrs r0, 16 + mov r9, r1 + adds r4, r2, 0 + cmp r0, 0 + bge _080D5FD6 + negs r0, r0 +_080D5FD6: + negs r0, r0 +_080D5FD8: + strh r0, [r3, 0x26] +_080D5FDA: + mov r5, r8 + cmp r5, 0x7F + bls _080D5FFC + ldr r1, =0x03005e00 + lsls r2, r6, 2 + adds r0, r2, r6 + lsls r0, 3 + adds r3, r0, r1 + movs r5, 0x1E + ldrsh r0, [r3, r5] + adds r5, r1, 0 + cmp r0, 0 + bne _080D5FFC + movs r1, 0x20 + ldrsh r0, [r3, r1] + cmp r0, 0x1 + beq _080D601E +_080D5FFC: + mov r2, r8 + cmp r2, 0x7E + bhi _080D6050 + ldr r1, =0x03005e00 + lsls r2, r6, 2 + adds r0, r2, r6 + lsls r0, 3 + adds r3, r0, r1 + movs r5, 0x1E + ldrsh r0, [r3, r5] + adds r5, r1, 0 + cmp r0, 0x1 + bne _080D6050 + movs r1, 0x20 + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _080D6050 +_080D601E: + adds r1, r2, r6 + lsls r1, 3 + adds r1, r5 + ldrh r0, [r1, 0x1E] + movs r2, 0x1 + eors r0, r2 + strh r0, [r1, 0x1E] + ldrh r0, [r1, 0x20] + eors r0, r2 + strh r0, [r1, 0x20] + ldrh r0, [r1, 0xE] + subs r0, 0x1 + strh r0, [r1, 0xE] + lsls r0, 16 + asrs r3, r0, 16 + cmp r3, 0 + bne _080D6050 + adds r0, r4, r7 + lsls r0, 2 + add r0, r9 + strh r3, [r0, 0x24] + strh r3, [r0, 0x26] + adds r0, r6, 0 + bl move_anim_task_del +_080D6050: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D5F3C + + thumb_func_start sub_80D6064 +sub_80D6064: @ 80D6064 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r6, =0x0203841e + ldrb r0, [r6, 0x6] + bl obj_id_for_side_relative_to_move + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldrb r1, [r6, 0x8] + adds r0, r5, 0 + bl sub_80A7270 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r6] + strh r1, [r0, 0x8] + ldrh r1, [r6, 0x2] + strh r1, [r0, 0xA] + ldrh r1, [r6, 0x4] + strh r1, [r0, 0xC] + ldrh r1, [r6, 0x4] + strh r1, [r0, 0xE] + strh r5, [r0, 0x10] + movs r1, 0x80 + lsls r1, 1 + strh r1, [r0, 0x1C] + strh r1, [r0, 0x1E] + ldr r1, =sub_80D60BC + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D6064 + + thumb_func_start sub_80D60BC +sub_80D60BC: @ 80D60BC + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x8] + ldrh r1, [r4, 0x1C] + adds r0, r1 + strh r0, [r4, 0x1C] + ldrh r0, [r4, 0xA] + ldrh r3, [r4, 0x1E] + adds r0, r3 + strh r0, [r4, 0x1E] + ldrb r0, [r4, 0x10] + adds r6, r0, 0 + movs r0, 0x1C + ldrsh r1, [r4, r0] + movs r3, 0x1E + ldrsh r2, [r4, r3] + adds r0, r6, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrh r0, [r4, 0xC] + subs r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + bne _080D612C + ldrh r2, [r4, 0xE] + movs r3, 0xE + ldrsh r0, [r4, r3] + cmp r0, 0 + ble _080D6120 + ldrh r0, [r4, 0x8] + negs r0, r0 + strh r0, [r4, 0x8] + ldrh r0, [r4, 0xA] + negs r0, r0 + strh r0, [r4, 0xA] + strh r2, [r4, 0xC] + strh r1, [r4, 0xE] + b _080D612C + .pool +_080D6120: + adds r0, r6, 0 + bl sub_80A7344 + adds r0, r5, 0 + bl move_anim_task_del +_080D612C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80D60BC + + thumb_func_start sub_80D6134 +sub_80D6134: @ 80D6134 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, =0x0203841e + ldrb r0, [r4, 0x4] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r1, 0 + bl sub_80A7270 + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r2, r0, r1 + movs r1, 0 + strh r1, [r2, 0xA] + ldrh r0, [r4] + strh r0, [r2, 0xC] + movs r3, 0x6 + ldrsh r0, [r4, r3] + cmp r0, 0x1 + beq _080D6178 + strh r1, [r2, 0xE] + b _080D6184 + .pool +_080D6178: + ldrh r0, [r4] + ldrh r1, [r4, 0x2] + adds r3, r0, 0 + muls r3, r1 + adds r0, r3, 0 + strh r0, [r2, 0xE] +_080D6184: + ldr r1, =0x03005e00 + lsls r4, r7, 2 + adds r0, r4, r7 + lsls r0, 3 + adds r5, r0, r1 + ldr r6, =0x0203841e + ldrh r0, [r6, 0x2] + strh r0, [r5, 0x10] + mov r0, r8 + strh r0, [r5, 0x12] + ldrh r0, [r6, 0x6] + strh r0, [r5, 0x14] + bl sub_80A4DF0 + lsls r0, 24 + mov r8, r4 + cmp r0, 0 + beq _080D61B8 + movs r0, 0x1 + strh r0, [r5, 0x16] + b _080D61DC + .pool +_080D61B8: + movs r1, 0x4 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _080D61C8 + ldr r0, =0x02038436 + b _080D61CA + .pool +_080D61C8: + ldr r0, =0x02038437 +_080D61CA: + ldrb r0, [r0] + bl battle_side_get_owner + movs r1, 0 + lsls r0, 24 + cmp r0, 0 + bne _080D61DA + movs r1, 0x1 +_080D61DA: + strh r1, [r5, 0x16] +_080D61DC: + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r4, r1, r0 + movs r3, 0x16 + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _080D6208 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080D6208 + movs r1, 0xE + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0xE] + movs r2, 0x10 + ldrsh r0, [r4, r2] + negs r0, r0 + strh r0, [r4, 0x10] +_080D6208: + ldr r0, =0x03005e00 + mov r3, r8 + adds r1, r3, r7 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_80D6308 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D6134 + + thumb_func_start sub_80D622C +sub_80D622C: @ 80D622C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x0203841e + ldrb r0, [r4, 0x4] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r1, 0 + bl sub_80A7270 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xA] + ldrh r1, [r4] + strh r1, [r0, 0xC] + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080D6274 + ldr r0, =0x02038436 + b _080D6276 + .pool +_080D6274: + ldr r0, =0x02038437 +_080D6276: + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080D6288 + ldrh r0, [r4, 0x2] + negs r0, r0 + strh r0, [r4, 0x2] +_080D6288: + ldr r0, =0x0203841e + movs r2, 0x6 + ldrsh r1, [r0, r2] + adds r6, r0, 0 + cmp r1, 0x1 + beq _080D62B0 + ldr r2, =0x03005e00 + lsls r3, r5, 2 + adds r0, r3, r5 + lsls r0, 3 + adds r0, r2 + movs r1, 0 + strh r1, [r0, 0xE] + b _080D62CA + .pool +_080D62B0: + ldr r3, =0x03005e00 + lsls r4, r5, 2 + adds r0, r4, r5 + lsls r0, 3 + adds r0, r3 + ldrh r2, [r6] + ldrh r1, [r6, 0x2] + adds r7, r2, 0 + muls r7, r1 + adds r1, r7, 0 + strh r1, [r0, 0xE] + adds r2, r3, 0 + adds r3, r4, 0 +_080D62CA: + adds r1, r3, r5 + lsls r1, 3 + adds r1, r2 + ldrh r0, [r6, 0x2] + strh r0, [r1, 0x10] + mov r0, r8 + strh r0, [r1, 0x12] + ldrh r0, [r6, 0x6] + strh r0, [r1, 0x14] + movs r0, 0x1 + strh r0, [r1, 0x16] + movs r2, 0xE + ldrsh r0, [r1, r2] + negs r0, r0 + strh r0, [r1, 0xE] + movs r7, 0x10 + ldrsh r0, [r1, r7] + negs r0, r0 + strh r0, [r1, 0x10] + ldr r0, =sub_80D6308 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D622C + + thumb_func_start sub_80D6308 +sub_80D6308: @ 80D6308 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x10] + ldrh r1, [r4, 0xE] + adds r0, r1 + strh r0, [r4, 0xE] + ldrb r0, [r4, 0x12] + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0xE] + adds r1, r2, 0 + bl obj_id_set_rotscale + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _080D633C + ldrb r0, [r4, 0x12] + bl sub_80A73A0 +_080D633C: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + movs r2, 0xC + ldrsh r1, [r4, r2] + cmp r0, r1 + blt _080D6382 + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080D6364 + cmp r0, 0x1 + ble _080D636A + cmp r0, 0x2 + beq _080D6372 + b _080D636A + .pool +_080D6364: + ldrb r0, [r4, 0x12] + bl sub_80A7344 +_080D636A: + adds r0, r5, 0 + bl move_anim_task_del + b _080D6382 +_080D6372: + movs r0, 0 + strh r0, [r4, 0xA] + movs r2, 0x10 + ldrsh r0, [r4, r2] + negs r0, r0 + strh r0, [r4, 0x10] + movs r0, 0x1 + strh r0, [r4, 0x14] +_080D6382: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80D6308 + + thumb_func_start sub_80D6388 +sub_80D6388: @ 80D6388 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x0203841e + movs r2, 0 + ldrsh r1, [r0, r2] + mov r8, r0 + cmp r1, 0 + bne _080D63C0 + ldr r4, =0x03005e00 + lsls r5, r7, 2 + adds r0, r5, r7 + lsls r0, 3 + adds r6, r0, r4 + ldr r0, =0x02038408 + ldrh r0, [r0] + movs r1, 0xC + bl __udivsi3 + b _080D63D4 + .pool +_080D63C0: + ldr r4, =0x03005e00 + lsls r5, r7, 2 + adds r0, r5, r7 + lsls r0, 3 + adds r6, r0, r4 + ldr r0, =0x02038404 + ldr r0, [r0] + movs r1, 0xC + bl __divsi3 +_080D63D4: + strh r0, [r6, 0x26] + lsls r0, 16 + adds r1, r4, 0 + cmp r0, 0 + bgt _080D63E2 + movs r0, 0x1 + strh r0, [r6, 0x26] +_080D63E2: + movs r2, 0x26 + ldrsh r0, [r6, r2] + cmp r0, 0x10 + ble _080D63EE + movs r0, 0x10 + strh r0, [r6, 0x26] +_080D63EE: + adds r4, r5, r7 + lsls r4, 3 + adds r4, r1 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + movs r5, 0 + strh r1, [r4, 0x24] + ldrh r2, [r4, 0x26] + movs r0, 0x1 + ands r0, r2 + adds r1, r0 + strh r1, [r4, 0x22] + strh r5, [r4, 0x20] + mov r1, r8 + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x1C] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x1E] + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x16] + ldr r2, =0x02020630 + movs r0, 0x16 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x24] + strh r0, [r4, 0x18] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x26] + strh r0, [r4, 0x1A] + strh r5, [r4, 0x8] + mov r1, r8 + ldrh r0, [r1, 0x2] + strh r0, [r4, 0xA] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0xC] + ldr r0, =sub_80D646C + str r0, [r4] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D6388 + + thumb_func_start sub_80D646C +sub_80D646C: @ 80D646C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r3, r0, r1 + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] + lsls r0, 16 + asrs r0, 16 + movs r2, 0xA + ldrsh r1, [r3, r2] + cmp r0, r1 + ble _080D654A + movs r0, 0 + strh r0, [r3, 0x8] + ldrh r0, [r3, 0x20] + adds r1, r0, 0x1 + movs r0, 0x1 + ands r1, r0 + strh r1, [r3, 0x20] + movs r2, 0x1C + ldrsh r0, [r3, r2] + cmp r0, 0 + beq _080D64DE + cmp r1, 0 + beq _080D64C8 + ldr r2, =0x02020630 + movs r0, 0x16 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0x22] + ldrh r2, [r3, 0x18] + adds r1, r2 + b _080D64DC + .pool +_080D64C8: + ldr r2, =0x02020630 + movs r0, 0x16 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0x18] + ldrh r2, [r3, 0x24] + subs r1, r2 +_080D64DC: + strh r1, [r0, 0x24] +_080D64DE: + movs r1, 0x1E + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _080D6518 + movs r2, 0x20 + ldrsh r4, [r3, r2] + cmp r4, 0 + beq _080D6508 + ldr r2, =0x02020630 + movs r0, 0x16 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0x26] + strh r1, [r0, 0x26] + b _080D6518 + .pool +_080D6508: + ldr r2, =0x02020630 + movs r0, 0x16 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r4, [r0, 0x26] +_080D6518: + ldrh r0, [r3, 0xC] + subs r0, 0x1 + strh r0, [r3, 0xC] + lsls r0, 16 + asrs r4, r0, 16 + cmp r4, 0 + bne _080D654A + ldr r2, =0x02020630 + movs r0, 0x16 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r4, [r0, 0x24] + movs r0, 0x16 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r4, [r0, 0x26] + adds r0, r5, 0 + bl move_anim_task_del +_080D654A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80D646C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_813C5BC.s b/asm/rom_813C5BC.s new file mode 100644 index 000000000..c6f1eb4db --- /dev/null +++ b/asm/rom_813C5BC.s @@ -0,0 +1,530 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_813C5BC +sub_813C5BC: @ 813C5BC + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0813C5DC + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_813C5EC + str r0, [r1] +_0813C5DC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_813C5BC + + thumb_func_start sub_813C5EC +sub_813C5EC: @ 813C5EC + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r4, r1, r0 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0813C610 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0813C61A +_0813C610: + movs r0, 0x5 + bl audio_play + ldr r0, =sub_813C62C + str r0, [r4] +_0813C61A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813C5EC + + thumb_func_start sub_813C62C +sub_813C62C: @ 813C62C + 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 pal_fade_maybe + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_813C664 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813C62C + + thumb_func_start sub_813C664 +sub_813C664: @ 813C664 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0813C694 + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + ldr r0, =0x0203ab78 + ldr r0, [r0] + bl Free + movs r0, 0 + bl sub_813C6A8 + bl FreeAllWindowBuffers + adds r0, r4, 0 + bl DestroyTask +_0813C694: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813C664 + + thumb_func_start sub_813C6A8 +sub_813C6A8: @ 813C6A8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0 + bl ClearWindowTilemap + adds r0, r4, 0 + movs r1, 0x2 + bl CopyWindowToVram + adds r0, r4, 0 + bl RemoveWindow + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_813C6A8 + + thumb_func_start sub_813C6D4 +sub_813C6D4: @ 813C6D4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + movs r3, 0xC0 + lsls r3, 19 + movs r4, 0xC0 + lsls r4, 9 + add r0, sp, 0x4 + mov r8, r0 + mov r2, sp + movs r6, 0 + ldr r1, =0x040000d4 + movs r5, 0x80 + lsls r5, 5 + ldr r7, =0x81000800 + movs r0, 0x81 + lsls r0, 24 + mov r12, r0 +_0813C6FA: + strh r6, [r2] + mov r0, sp + str r0, [r1] + str r3, [r1, 0x4] + str r7, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r3, r5 + subs r4, r5 + cmp r4, r5 + bhi _0813C6FA + strh r6, [r2] + mov r2, sp + str r2, [r1] + str r3, [r1, 0x4] + lsrs r0, r4, 1 + mov r2, r12 + orrs r0, r2 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r0, 0xE0 + lsls r0, 19 + movs r3, 0x80 + lsls r3, 3 + movs r4, 0 + str r4, [sp, 0x4] + ldr r2, =0x040000d4 + mov r1, r8 + str r1, [r2] + str r0, [r2, 0x4] + lsrs r0, r3, 2 + movs r1, 0x85 + lsls r1, 24 + orrs r0, r1 + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + movs r1, 0xA0 + lsls r1, 19 + mov r0, sp + strh r4, [r0] + str r0, [r2] + str r1, [r2, 0x4] + lsrs r3, 1 + movs r0, 0x81 + lsls r0, 24 + orrs r3, r0 + str r3, [r2, 0x8] + ldr r0, [r2, 0x8] + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0x8 + movs r1, 0 + bl SetGpuReg + movs r0, 0x10 + movs r1, 0 + bl SetGpuReg + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + movs r0, 0xA + movs r1, 0 + bl SetGpuReg + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + movs r0, 0x16 + movs r1, 0 + bl SetGpuReg + movs r0, 0xC + movs r1, 0 + bl SetGpuReg + movs r0, 0x18 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg + movs r0, 0xE + movs r1, 0 + bl SetGpuReg + movs r0, 0x1C + movs r1, 0 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0 + bl SetGpuReg + movs r0, 0x40 + movs r1, 0 + bl SetGpuReg + movs r0, 0x44 + movs r1, 0 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813C6D4 + + thumb_func_start sub_813C80C +sub_813C80C: @ 813C80C + push {lr} + bl remove_some_task + bl ResetTasks + bl ResetAllObjectData + bl sub_80A1A74 + bl ResetObjectPaletteAllocator + pop {r0} + bx r0 + thumb_func_end sub_813C80C + + thumb_func_start sub_813C828 +sub_813C828: @ 813C828 + push {lr} + 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 + pop {r0} + bx r0 + thumb_func_end sub_813C828 + + thumb_func_start sub_813C880 +sub_813C880: @ 813C880 + push {lr} + movs r1, 0x94 + lsls r1, 4 + movs r0, 0 + bl SetGpuReg + pop {r0} + bx r0 + thumb_func_end sub_813C880 + + thumb_func_start sub_813C890 +sub_813C890: @ 813C890 + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =gUnknown_085B3484 + adds r0, r4, 0 + movs r2, 0xC0 + movs r3, 0 + bl LoadBgTiles + ldr r1, =gUnknown_085B3564 + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBufferRect + ldr r0, =gUnknown_085B3544 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813C890 + + thumb_func_start sub_813C8D8 +sub_813C8D8: @ 813C8D8 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_813C8D8 + + thumb_func_start sub_813C8EC +sub_813C8EC: @ 813C8EC + push {lr} + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_813C8EC + + thumb_func_start sub_813C904 +sub_813C904: @ 813C904 + push {lr} + movs r0, 0 + bl SetVBlankCallback + ldr r0, =sub_813C91C + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_813C904 + + thumb_func_start sub_813C91C +sub_813C91C: @ 813C91C + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x7 + bls _0813C930 + b _0813CA3C +_0813C930: + lsls r0, 2 + ldr r1, =_0813C944 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0813C944: + .4byte _0813C964 + .4byte _0813C970 + .4byte _0813C976 + .4byte _0813C9A8 + .4byte _0813C9BE + .4byte _0813C9DE + .4byte _0813C9F0 + .4byte _0813CA14 +_0813C964: + movs r0, 0 + bl SetVBlankCallback + bl sub_813C6D4 + b _0813CA00 +_0813C970: + bl sub_813C80C + b _0813CA00 +_0813C976: + ldr r4, =0x0203ab78 + movs r0, 0x80 + lsls r0, 4 + bl AllocZeroed + str r0, [r4] + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085B3D64 + movs r0, 0 + movs r2, 0x2 + bl InitBgsFromTemplates + ldr r1, [r4] + movs r0, 0x3 + bl SetBgTilemapBuffer + bl sub_813C828 + b _0813CA00 + .pool +_0813C9A8: + movs r0, 0x3 + bl sub_813C890 + movs r0, 0 + bl stdpal_get + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + b _0813CA00 +_0813C9BE: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0813CA3C + movs r0, 0 + bl ShowBg + movs r0, 0x3 + bl ShowBg + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + b _0813CA00 +_0813C9DE: + ldr r0, =gUnknown_085B3D6C + bl InitWindows + bl DeactivateAllTextPrinters + b _0813CA00 + .pool +_0813C9F0: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe +_0813CA00: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0813CA3C + .pool +_0813CA14: + bl sub_813C880 + ldr r0, =sub_813C8D8 + bl SetVBlankCallback + bl sub_81D5C8C + ldr r0, =sub_813C5BC + movs r1, 0x8 + bl CreateTask + ldr r0, =sub_813C8EC + bl SetMainCallback2 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_0813CA3C: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813C91C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_8145E84.s b/asm/rom_8145E84.s new file mode 100644 index 000000000..c410a0c54 --- /dev/null +++ b/asm/rom_8145E84.s @@ -0,0 +1,60 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8145E84 +sub_8145E84: @ 8145E84 + push {r4,lr} + ldr r4, =0x0300120b + ldrb r0, [r4] + cmp r0, 0 + beq _08145E98 + cmp r0, 0x1 + beq _08145EAC + b _08145EC0 + .pool +_08145E98: + ldr r0, =0x0300120a + ldrb r0, [r0] + bl sub_8145F6C + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + b _08145EC0 + .pool +_08145EAC: + bl sub_8145F20 + lsls r0, 24 + cmp r0, 0 + beq _08145EC0 + movs r0, 0 + strb r0, [r4] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 +_08145EC0: + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8145E84 + + thumb_func_start sub_8145EDC +sub_8145EDC: @ 8145EDC + push {lr} + ldr r1, =0x0300120a + strb r0, [r1] + ldr r0, =sub_8145E84 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8145EDC + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_8151534.s b/asm/rom_8151534.s new file mode 100644 index 000000000..906706d61 --- /dev/null +++ b/asm/rom_8151534.s @@ -0,0 +1,202 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8151534 +sub_8151534: @ 8151534 + push {lr} + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + muls r0, r1 + adds r1, r0, 0 + cmp r0, 0 + bge _08151548 + adds r1, 0xFF +_08151548: + lsls r0, r1, 8 + asrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_8151534 + + thumb_func_start sub_8151550 +sub_8151550: @ 8151550 + push {lr} + adds r3, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r3, 16 + asrs r3, 16 + lsls r2, 16 + asrs r2, 16 + muls r3, r2 + movs r1, 0x1 + lsls r1, r0 + adds r0, r3, 0 + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_8151550 + + thumb_func_start sub_8151574 +sub_8151574: @ 8151574 + push {r4-r7,lr} + adds r2, r1, 0 + adds r4, r0, 0 + asrs r5, r0, 31 + asrs r3, r2, 31 + adds r1, r5, 0 + adds r0, r4, 0 + bl __muldi3 + adds r5, r1, 0 + adds r4, r0, 0 + adds r7, r5, 0 + adds r6, r4, 0 + cmp r5, 0 + bge _0815159A + movs r6, 0xFF + movs r7, 0 + adds r6, r4 + adcs r7, r5 +_0815159A: + lsls r3, r7, 24 + lsrs r2, r6, 8 + adds r0, r3, 0 + orrs r0, r2 + asrs r1, r7, 8 + adds r5, r1, 0 + adds r4, r0, 0 + adds r0, r4, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8151574 + + thumb_func_start sub_81515B0 +sub_81515B0: @ 81515B0 + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + asrs r1, 16 + cmp r1, 0 + beq _081515CC + lsls r0, 16 + asrs r0, 8 + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + b _081515CE +_081515CC: + movs r0, 0 +_081515CE: + pop {r1} + bx r1 + thumb_func_end sub_81515B0 + + thumb_func_start sub_81515D4 +sub_81515D4: @ 81515D4 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 16 + lsrs r0, r1, 16 + lsls r2, 16 + asrs r1, r2, 16 + cmp r1, 0 + beq _081515F6 + lsls r0, 16 + asrs r0, 16 + lsls r0, r3 + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + b _081515F8 +_081515F6: + movs r0, 0 +_081515F8: + pop {r1} + bx r1 + thumb_func_end sub_81515D4 + + thumb_func_start sub_81515FC +sub_81515FC: @ 81515FC + push {r4-r6,lr} + adds r6, r1, 0 + cmp r6, 0 + beq _0815161C + adds r2, r0, 0 + asrs r3, r0, 31 + lsrs r5, r2, 24 + lsls r4, r3, 8 + adds r1, r5, 0 + orrs r1, r4 + lsls r0, r2, 8 + adds r2, r6, 0 + asrs r3, r6, 31 + bl __divdi3 + b _0815161E +_0815161C: + movs r0, 0 +_0815161E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81515FC + + thumb_func_start sub_8151624 +sub_8151624: @ 8151624 + push {lr} + adds r1, r0, 0 + movs r0, 0x80 + lsls r0, 9 + lsls r1, 16 + asrs r1, 16 + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_8151624 + + thumb_func_start sub_815163C +sub_815163C: @ 815163C + push {lr} + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + lsls r2, r0 + lsls r1, 16 + asrs r1, 16 + adds r0, r2, 0 + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_815163C + + thumb_func_start sub_815165C +sub_815165C: @ 815165C + push {lr} + adds r2, r0, 0 + ldr r1, _08151674 + ldr r0, _08151670 + asrs r3, r2, 31 + bl __divdi3 + pop {r1} + bx r1 + .align 2, 0 +_08151670: .4byte 0x00010000 +_08151674: .4byte 0x00000000 + thumb_func_end sub_815165C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_8158B30.s b/asm/rom_8158B30.s new file mode 100644 index 000000000..823b3d73d --- /dev/null +++ b/asm/rom_8158B30.s @@ -0,0 +1,34346 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8158B30 +sub_8158B30: @ 8158B30 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r6, r0, 2 + adds r6, r0 + lsls r6, 3 + adds r6, r1 + ldr r1, =0x0203841e + ldrh r0, [r1] + strh r0, [r6, 0x8] + ldrh r0, [r1, 0x2] + strh r0, [r6, 0xA] + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x3F + bl sub_80A5178 + adds r5, r0, 0 + lsls r4, 24 + asrs r4, 24 + lsls r5, 24 + asrs r5, 24 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + bl sub_80A5314 + strh r4, [r6, 0xC] + strh r5, [r6, 0xE] + lsls r0, 24 + asrs r0, 24 + strh r0, [r6, 0x10] + movs r0, 0xA + strh r0, [r6, 0x1C] + ldr r0, =sub_8158B98 + str r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8158B30 + + thumb_func_start sub_8158B98 +sub_8158B98: @ 8158B98 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r5, [r4, 0xC] + ldrb r6, [r4, 0x10] + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6F + bne _08158BD0 + movs r0, 0x5 + strh r0, [r4, 0x1C] + strh r1, [r4, 0x1E] + ldr r0, =sub_8158C04 + str r0, [r4] + b _08158BFE + .pool +_08158BD0: + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + bne _08158BEA + strh r1, [r4, 0x1C] + ldrh r0, [r4, 0x8] + lsls r1, r5, 24 + asrs r1, 24 + bl audio_play_and_stuff +_08158BEA: + lsls r1, r6, 24 + asrs r1, 24 + lsls r0, r5, 16 + asrs r0, 16 + adds r0, r1 + lsls r0, 16 + asrs r0, 16 + bl sub_80A52EC + strh r0, [r4, 0xC] +_08158BFE: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8158B98 + + thumb_func_start sub_8158C04 +sub_8158C04: @ 8158C04 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bne _08158C4C + movs r0, 0 + strh r0, [r4, 0x1C] + movs r0, 0x3F + bl sub_80A5178 + adds r1, r0, 0 + ldrh r0, [r4, 0xA] + lsls r1, 24 + asrs r1, 24 + bl audio_play_and_stuff + ldrh r0, [r4, 0x1E] + adds r0, 0x1 + strh r0, [r4, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _08158C4C + adds r0, r5, 0 + bl move_anim_related_task_del +_08158C4C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8158C04 + + thumb_func_start mas_80DCF38 +mas_80DCF38: @ 8158C58 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =0x0203841e + ldrh r1, [r0] + str r1, [sp] + ldrb r5, [r0, 0x4] + ldrb r6, [r0, 0x6] + ldrb r3, [r0, 0x8] + mov r10, r3 + ldrb r7, [r0, 0xA] + ldrb r1, [r0, 0xC] + mov r9, r1 + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + bl sub_80A5178 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + asrs r5, 24 + adds r0, r5, 0 + bl sub_80A5178 + adds r5, r0, 0 + lsls r4, 24 + asrs r4, 24 + lsls r5, 24 + asrs r5, 24 + lsls r6, 24 + asrs r6, 24 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_80A5314 + ldr r2, =0x03005e00 + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + mov r6, sp + ldrh r6, [r6] + strh r6, [r1, 0x8] + strh r4, [r1, 0xA] + strh r5, [r1, 0xC] + lsls r0, 24 + asrs r0, 24 + strh r0, [r1, 0xE] + mov r0, r10 + strh r0, [r1, 0x10] + strh r7, [r1, 0x12] + mov r3, r9 + strh r3, [r1, 0x14] + strh r2, [r1, 0x1C] + strh r4, [r1, 0x1E] + strh r3, [r1, 0x20] + ldr r2, =sub_8158D08 + str r2, [r1] + mov r0, r8 + bl _call_via_r2 + 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 mas_80DCF38 + + thumb_func_start sub_8158D08 +sub_8158D08: @ 8158D08 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x20] + adds r1, r0, 0x1 + strh r1, [r4, 0x20] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x14 + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _08158D50 + movs r0, 0 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x8] + movs r1, 0x1E + ldrsb r1, [r4, r1] + bl audio_play_and_stuff + ldrh r0, [r4, 0x10] + subs r0, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + cmp r0, 0 + bne _08158D50 + adds r0, r5, 0 + bl move_anim_related_task_del + b _08158D82 + .pool +_08158D50: + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x1C] + adds r1, r0, 0x1 + strh r1, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x12 + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _08158D82 + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r0, [r4, 0xE] + ldrh r1, [r4, 0x1E] + adds r0, r1 + strh r0, [r4, 0x1E] + movs r2, 0x1E + ldrsh r0, [r4, r2] + bl sub_80A52EC + strh r0, [r4, 0x1E] +_08158D82: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8158D08 + + thumb_func_start sub_8158D8C +sub_8158D8C: @ 8158D8C + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08158DD0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08158DC8 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r4, [r0] + b _08158E76 + .pool +_08158DC8: + adds r0, r5, 0 + bl move_anim_task_del + b _08158E76 +_08158DD0: + ldr r0, =0x0203841e + movs r2, 0 + ldrsh r1, [r0, r2] + adds r2, r0, 0 + cmp r1, 0 + bne _08158DEC + ldr r0, =0x02038436 + ldrb r4, [r0] + b _08158E12 + .pool +_08158DEC: + cmp r1, 0x1 + bne _08158DFC + ldr r0, =0x02038437 + ldrb r4, [r0] + b _08158E12 + .pool +_08158DFC: + cmp r1, 0x2 + bne _08158E08 + ldr r0, =0x02038436 + b _08158E0A + .pool +_08158E08: + ldr r0, =0x02038437 +_08158E0A: + ldrb r1, [r0] + movs r0, 0x2 + adds r4, r0, 0 + eors r4, r1 +_08158E12: + movs r1, 0 + ldrsh r0, [r2, r1] + cmp r0, 0x1 + beq _08158E1E + cmp r0, 0x3 + bne _08158E38 +_08158E1E: + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + bne _08158E38 + adds r0, r5, 0 + bl move_anim_task_del + b _08158E8C + .pool +_08158E38: + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08158E5C + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + b _08158E6A + .pool +_08158E5C: + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec +_08158E6A: + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 +_08158E76: + cmp r4, 0 + beq _08158E86 + lsls r1, r6, 24 + asrs r1, 24 + adds r0, r4, 0 + movs r2, 0x3 + bl sub_80A32E4 +_08158E86: + adds r0, r5, 0 + bl move_anim_task_del +_08158E8C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8158D8C + + thumb_func_start sub_8158E9C +sub_8158E9C: @ 8158E9C + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _08158EE0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08158ED8 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r4, [r0] + b _08158F86 + .pool +_08158ED8: + adds r0, r6, 0 + bl move_anim_task_del + b _08158F86 +_08158EE0: + ldr r0, =0x0203841e + movs r2, 0 + ldrsh r1, [r0, r2] + adds r2, r0, 0 + cmp r1, 0 + bne _08158EFC + ldr r0, =0x02038436 + ldrb r4, [r0] + b _08158F22 + .pool +_08158EFC: + cmp r1, 0x1 + bne _08158F0C + ldr r0, =0x02038437 + ldrb r4, [r0] + b _08158F22 + .pool +_08158F0C: + cmp r1, 0x2 + bne _08158F18 + ldr r0, =0x02038436 + b _08158F1A + .pool +_08158F18: + ldr r0, =0x02038437 +_08158F1A: + ldrb r1, [r0] + movs r0, 0x2 + adds r4, r0, 0 + eors r4, r1 +_08158F22: + movs r1, 0 + ldrsh r0, [r2, r1] + cmp r0, 0x1 + beq _08158F2E + cmp r0, 0x3 + bne _08158F48 +_08158F2E: + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + bne _08158F48 + adds r0, r6, 0 + bl move_anim_task_del + b _08158FEE + .pool +_08158F48: + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08158F6C + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + b _08158F7A + .pool +_08158F6C: + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec +_08158F7A: + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 +_08158F86: + ldr r1, =0x03005e00 + lsls r2, r6, 2 + adds r0, r2, r6 + lsls r0, 3 + adds r0, r1 + ldr r3, =0x0203841e + ldrh r1, [r3, 0x2] + strh r1, [r0, 0x8] + strh r4, [r0, 0xA] + lsls r1, r5, 24 + asrs r1, 24 + strh r1, [r0, 0xC] + adds r5, r2, 0 + cmp r4, 0 + beq _08158FE8 + movs r2, 0x2 + ldrsh r0, [r3, r2] + cmp r0, 0xFF + bne _08158FC8 + adds r0, r4, 0 + movs r2, 0x9 + bl sub_80A32E4 + b _08158FD0 + .pool +_08158FC8: + adds r0, r4, 0 + movs r2, 0x7 + bl sub_80A32E4 +_08158FD0: + ldr r0, =0x03005e00 + adds r1, r5, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8158FF4 + str r0, [r1] + b _08158FEE + .pool +_08158FE8: + adds r0, r6, 0 + bl move_anim_task_del +_08158FEE: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8158E9C + + thumb_func_start sub_8158FF4 +sub_8158FF4: @ 8158FF4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r4, r0, 24 + mov r9, r4 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + ldrh r6, [r1, 0xA] + mov r8, r6 + ldrb r5, [r1, 0xC] + adds r7, r5, 0 + ldrh r2, [r1, 0x1A] + movs r3, 0x1A + ldrsh r0, [r1, r3] + cmp r0, 0x1 + bgt _08159028 + adds r0, r2, 0x1 + strh r0, [r1, 0x1A] + b _0815906A + .pool +_08159028: + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0xFF + bne _0815904E + bl sub_80A36EC + lsls r0, 24 + cmp r0, 0 + bne _0815906A + lsls r1, r5, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0xA + bl sub_80A32E4 + adds r0, r4, 0 + bl move_anim_task_del + b _0815906A +_0815904E: + bl sub_80A36EC + lsls r0, 24 + cmp r0, 0 + bne _0815906A + lsls r1, r7, 24 + asrs r1, 24 + mov r0, r8 + movs r2, 0x8 + bl sub_80A32E4 + mov r0, r9 + bl move_anim_task_del +_0815906A: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8158FF4 + + thumb_func_start sub_8159078 +sub_8159078: @ 8159078 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0x1A] + movs r3, 0x1A + ldrsh r0, [r1, r3] + cmp r0, 0x1 + bgt _081590A0 + adds r0, r2, 0x1 + strh r0, [r1, 0x1A] + b _081590B0 + .pool +_081590A0: + bl sub_80A36EC + lsls r0, 24 + cmp r0, 0 + bne _081590B0 + adds r0, r4, 0 + bl move_anim_task_del +_081590B0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8159078 + + thumb_func_start sub_81590B8 +sub_81590B8: @ 81590B8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =0x0203841e + ldrh r1, [r1] + strh r1, [r0, 0x1C] + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _081590F8 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x18] + b _08159102 + .pool +_081590F8: + ldr r1, =0x02038438 + ldr r0, =0x02038436 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 +_08159102: + ldrh r2, [r0] + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + strh r2, [r1, 0xA] + lsls r0, r5, 24 + asrs r0, 24 + strh r0, [r1, 0xC] + cmp r2, 0 + beq _08159130 + ldr r0, =sub_815913C + str r0, [r1] + b _08159136 + .pool +_08159130: + adds r0, r4, 0 + bl move_anim_task_del +_08159136: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81590B8 + + thumb_func_start sub_815913C +sub_815913C: @ 815913C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r6, [r0, 0xA] + mov r8, r6 + ldrb r3, [r0, 0xC] + adds r5, r3, 0 + movs r7, 0x1A + ldrsh r2, [r0, r7] + mov r12, r1 + cmp r2, 0x5 + bhi _081591DC + lsls r0, r2, 2 + ldr r1, =_08159174 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08159174: + .4byte _081591C2 + .4byte _081591A8 + .4byte _0815918C + .4byte _081591A8 + .4byte _081591A8 + .4byte _081591B8 +_0815918C: + lsls r1, r5, 24 + asrs r1, 24 + mov r0, r8 + movs r2, 0x4 + bl play_cry_maybe + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + b _081591B0 + .pool +_081591A8: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + add r0, r12 +_081591B0: + ldrh r1, [r0, 0x1A] + adds r1, 0x1 + strh r1, [r0, 0x1A] + b _08159204 +_081591B8: + bl sub_80A36EC + lsls r0, 24 + cmp r0, 0 + bne _08159204 +_081591C2: + bl sub_80A369C + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x1A] + adds r0, 0x1 + strh r0, [r1, 0x1A] + b _08159204 + .pool +_081591DC: + movs r1, 0x1C + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _081591F2 + lsls r1, r3, 24 + asrs r1, 24 + adds r0, r6, 0 + movs r2, 0x6 + bl play_cry_maybe + b _081591FE +_081591F2: + lsls r1, r5, 24 + asrs r1, 24 + mov r0, r8 + movs r2, 0x6 + bl sub_80A32E4 +_081591FE: + adds r0, r4, 0 + bl move_anim_task_del +_08159204: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_815913C + + thumb_func_start sub_8159210 +sub_8159210: @ 8159210 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x0203841e + ldrh r5, [r0] + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + adds r0, r5, 0 + bl sub_80A3808 + adds r0, r4, 0 + bl move_anim_task_del + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159210 + + thumb_func_start sub_8159244 +sub_8159244: @ 8159244 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x0203841e + ldrh r5, [r0] + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + adds r0, r5, 0 + bl sub_80A383C + adds r0, r4, 0 + bl move_anim_task_del + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159244 + + thumb_func_start sub_8159278 +sub_8159278: @ 8159278 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + mov r8, r0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =0x0203841e + ldrb r5, [r0, 0x2] + ldrb r6, [r0, 0x4] + ldrh r1, [r0, 0x6] + mov r9, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + bl sub_80A5178 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + asrs r5, 24 + adds r0, r5, 0 + bl sub_80A5178 + adds r5, r0, 0 + lsls r4, 24 + asrs r4, 24 + lsls r5, 24 + asrs r5, 24 + lsls r6, 24 + asrs r6, 24 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_80A5314 + ldr r2, =0x03005e00 + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + strh r4, [r1, 0xA] + strh r5, [r1, 0xC] + lsls r0, 24 + asrs r0, 24 + strh r0, [r1, 0xE] + mov r0, r9 + strh r0, [r1, 0x12] + strh r2, [r1, 0x1C] + strh r4, [r1, 0x1E] + ldr r2, =sub_8159308 + str r2, [r1] + mov r0, r8 + bl _call_via_r2 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159278 + + thumb_func_start sub_8159308 +sub_8159308: @ 8159308 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r2, [r4, 0xE] + ldrh r0, [r4, 0x1C] + adds r1, r0, 0x1 + strh r1, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x12 + ldrsh r1, [r4, r3] + cmp r0, r1 + bne _08159342 + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + adds r0, r2, r1 + strh r0, [r4, 0x1E] + movs r2, 0x1E + ldrsh r0, [r4, r2] + bl sub_80A52EC + strh r0, [r4, 0x1E] +_08159342: + ldr r1, =0x02038440 + ldrh r0, [r4, 0x1E] + strb r0, [r1] + movs r3, 0x1E + ldrsh r1, [r4, r3] + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _0815935A + adds r0, r5, 0 + bl move_anim_task_del +_0815935A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159308 + + thumb_func_start nullsub_114 +nullsub_114: @ 8159368 + bx lr + thumb_func_end nullsub_114 + + thumb_func_start sub_815936C +sub_815936C: @ 815936C + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_exec_buffer_A_ch0_tbl6 + str r1, [r0] + bx lr + .pool + thumb_func_end sub_815936C + + thumb_func_start bx_exec_buffer_A_ch0_tbl6 +bx_exec_buffer_A_ch0_tbl6: @ 8159388 + push {lr} + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldr r0, =0x02024064 + ldrb r3, [r0] + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _081593D4 + ldr r0, =0x02023064 + lsls r1, r3, 9 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x38 + bhi _081593D0 + ldr r0, =gUnknown_085CDF20 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + b _081593D4 + .pool +_081593D0: + bl dp01_tbl6_exec_completed +_081593D4: + pop {r0} + bx r0 + thumb_func_end bx_exec_buffer_A_ch0_tbl6 + + thumb_func_start bx_battle_menu_t6_2 +bx_battle_menu_t6_2: @ 81593D8 + push {r4,r5,lr} + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _08159446 + movs r0, 0x5 + bl audio_play + ldr r1, =0x020244ac + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08159424 + cmp r0, 0x1 + bgt _08159414 + cmp r0, 0 + beq _0815941E + b _08159440 + .pool +_08159414: + cmp r0, 0x2 + beq _0815942A + cmp r0, 0x3 + beq _08159436 + b _08159440 +_0815941E: + movs r0, 0x1 + movs r1, 0x5 + b _0815942E +_08159424: + movs r0, 0x1 + movs r1, 0x6 + b _0815942E +_0815942A: + movs r0, 0x1 + movs r1, 0x7 +_0815942E: + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + b _08159440 +_08159436: + movs r0, 0x1 + movs r1, 0x8 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb +_08159440: + bl dp01_tbl6_exec_completed + b _0815954E +_08159446: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08159484 + ldr r5, =0x020244ac + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0815954E + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl sub_8059CF8 + ldrb r1, [r4] + adds r1, r5 + ldrb r0, [r1] + movs r2, 0x1 + b _081594F2 + .pool +_08159484: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081594C0 + ldr r5, =0x020244ac + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _0815954E + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl sub_8059CF8 + ldrb r1, [r4] + adds r1, r5 + ldrb r0, [r1] + movs r2, 0x1 + b _081594F2 + .pool +_081594C0: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0815950C + ldr r5, =0x020244ac + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0815954E + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl sub_8059CF8 + ldrb r1, [r4] + adds r1, r5 + ldrb r0, [r1] + movs r2, 0x2 +_081594F2: + eors r0, r2 + strb r0, [r1] + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl sub_8059CB4 + b _0815954E + .pool +_0815950C: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0815954E + ldr r5, =0x020244ac + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0815954E + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl sub_8059CF8 + ldrb r1, [r4] + adds r1, r5 + ldrb r0, [r1] + movs r2, 0x2 + eors r0, r2 + strb r0, [r1] + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl sub_8059CB4 +_0815954E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end bx_battle_menu_t6_2 + + thumb_func_start sub_815955C +sub_815955C: @ 815955C + push {lr} + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + 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, =DummyObjectCallback + cmp r1, r0 + bne _08159580 + bl dp01_tbl6_exec_completed +_08159580: + pop {r0} + bx r0 + .pool + thumb_func_end sub_815955C + + thumb_func_start bx_t6_button_a +bx_t6_button_a: @ 8159594 + push {lr} + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _081595A6 + bl dp01_tbl6_exec_completed +_081595A6: + pop {r0} + bx r0 + thumb_func_end bx_t6_button_a + + thumb_func_start sub_81595AC +sub_81595AC: @ 81595AC + push {lr} + ldr r2, =0x02020630 + ldr r1, =0x03005d70 + ldr r0, =0x02024064 + 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, =DummyObjectCallback + cmp r1, r0 + bne _081595D0 + bl dp01_tbl6_exec_completed +_081595D0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81595AC + + thumb_func_start sub_81595E4 +sub_81595E4: @ 81595E4 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0815960E + ldr r2, =0x030022c0 + ldr r0, =0x00000439 + adds r3, r2, r0 + ldrb r1, [r3] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + ldr r0, =0x03005d00 + ldr r0, [r0] + str r0, [r2] + ldr r0, [r2, 0x8] + bl SetMainCallback2 +_0815960E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81595E4 + + thumb_func_start bx_wait_t6 +bx_wait_t6: @ 8159624 + push {lr} + ldr r0, =0x020244b9 + ldrb r0, [r0] + cmp r0, 0 + beq _0815964A + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0815964E +_0815964A: + bl dp01_tbl6_exec_completed +_0815964E: + pop {r0} + bx r0 + .pool + thumb_func_end bx_wait_t6 + + thumb_func_start sub_8159660 +sub_8159660: @ 8159660 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08159684 + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8159698 + str r1, [r0] + bl FreeAllWindowBuffers + bl sub_81358F4 +_08159684: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159660 + + thumb_func_start sub_8159698 +sub_8159698: @ 8159698 + push {lr} + ldr r0, =0x030022c0 + ldr r1, [r0, 0x4] + ldr r0, =sub_8038420 + cmp r1, r0 + bne _081596BE + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081596BE + ldr r0, =0x0203ce7c + ldrh r1, [r0] + movs r0, 0x1 + bl dp01_build_cmdbuf_x23_aa_0 + bl dp01_tbl6_exec_completed +_081596BE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159698 + + thumb_func_start sub_81596D4 +sub_81596D4: @ 81596D4 + push {lr} + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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 _081596F6 + bl dp01_tbl6_exec_completed +_081596F6: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81596D4 + + thumb_func_start dp01_tbl6_exec_completed +dp01_tbl6_exec_completed: @ 8159704 + push {r4,lr} + sub sp, 0x4 + ldr r1, =0x03005d60 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_exec_buffer_A_ch0_tbl6 + str r1, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08159758 + bl link_get_multiplayer_id + mov r1, sp + strb r0, [r1] + movs r0, 0x2 + movs r1, 0x4 + mov r2, sp + bl dp01_prepare_buffer_wireless_probably + ldr r1, =0x02023064 + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _0815976A + .pool +_08159758: + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, [r2] + bics r0, r1 + str r0, [r2] +_0815976A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_tbl6_exec_completed + + thumb_func_start bx_80364D0 +bx_80364D0: @ 815977C + push {lr} + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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 _0815979E + bl dp01_tbl6_exec_completed +_0815979E: + pop {r0} + bx r0 + .pool + thumb_func_end bx_80364D0 + + thumb_func_start sub_81597AC +sub_81597AC: @ 81597AC + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81597AC + + thumb_func_start sub_81597B8 +sub_81597B8: @ 81597B8 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81597B8 + + thumb_func_start sub_81597C4 +sub_81597C4: @ 81597C4 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81597C4 + + thumb_func_start sub_81597D0 +sub_81597D0: @ 81597D0 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81597D0 + + thumb_func_start sub_81597DC +sub_81597DC: @ 81597DC + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81597DC + + thumb_func_start sub_81597E8 +sub_81597E8: @ 81597E8 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81597E8 + + thumb_func_start sub_81597F4 +sub_81597F4: @ 81597F4 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81597F4 + + thumb_func_start sub_8159800 +sub_8159800: @ 8159800 + push {r4-r6,lr} + ldr r4, =0x03005d90 + ldr r0, [r4] + ldrb r0, [r0, 0x8] + ldr r5, =0x02024064 + ldrb r1, [r5] + bl sub_805DF84 + ldr r0, [r4] + ldrb r6, [r0, 0x8] + ldrb r0, [r5] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl template_build_for_pokemon_or_trainer + ldr r0, =0x0202499c + ldr r2, =gUnknown_08305D2C + ldr r1, [r4] + ldrb r1, [r1, 0x8] + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1] + movs r2, 0x8 + subs r2, r1 + lsls r2, 18 + movs r1, 0xA0 + lsls r1, 15 + adds r2, r1 + asrs r2, 16 + movs r1, 0x50 + movs r3, 0x1E + bl AddObjectToFront + ldr r6, =0x020241e4 + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, =0x02020630 + 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] + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_815955C + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159800 + + thumb_func_start sub_81598E0 +sub_81598E0: @ 81598E0 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81598E0 + + thumb_func_start sub_81598EC +sub_81598EC: @ 81598EC + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81598EC + + thumb_func_start sub_81598F8 +sub_81598F8: @ 81598F8 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81598F8 + + thumb_func_start sub_8159904 +sub_8159904: @ 8159904 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159904 + + thumb_func_start sub_8159910 +sub_8159910: @ 8159910 + push {r4,r5,lr} + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0x8] + movs r0, 0x4 + strb r0, [r1, 0x8] + ldr r1, =0x020244b9 + movs r0, 0x1 + strb r0, [r1] + ldr r5, =0x02024064 + ldrb r4, [r5] + movs r0, 0x1 + bl battle_get_side_with_given_state + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r4, 0 + movs r3, 0x4 + bl move_anim_start_t4 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_wait_t6 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159910 + + thumb_func_start sub_8159964 +sub_8159964: @ 8159964 + push {r4,r5,lr} + ldr r1, =0x02023064 + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r1, [r0] + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + strb r1, [r0, 0x8] + ldr r1, =0x020244b9 + movs r0, 0x1 + strb r0, [r1] + ldrb r4, [r5] + movs r0, 0x1 + bl battle_get_side_with_given_state + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r4, 0 + movs r3, 0x4 + bl move_anim_start_t4 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_wait_t6 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159964 + + thumb_func_start sub_81599C4 +sub_81599C4: @ 81599C4 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81599C4 + + thumb_func_start sub_81599D0 +sub_81599D0: @ 81599D0 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_81599D0 + + thumb_func_start dp01t_10_6_message +dp01t_10_6_message: @ 81599DC + push {r4,lr} + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 9 + ldr r1, =0x02023066 + adds r0, r1 + ldrh r0, [r0] + bl battle_pick_message + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_t6_button_a + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_10_6_message + + thumb_func_start dp01t_11_6_message_for_player_only +dp01t_11_6_message_for_player_only: @ 8159A30 + push {lr} + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08159A4C + bl dp01t_10_6_message + b _08159A50 + .pool +_08159A4C: + bl dp01_tbl6_exec_completed +_08159A50: + pop {r0} + bx r0 + thumb_func_end dp01t_11_6_message_for_player_only + + thumb_func_start sub_8159A54 +sub_8159A54: @ 8159A54 + push {lr} + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08159A7A + ldr r0, =0x02022e14 + strh r1, [r0] + ldr r1, =0x02022e16 + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_battle_menu_t6_2 + str r1, [r0] +_08159A7A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159A54 + + thumb_func_start sub_8159A94 +sub_8159A94: @ 8159A94 + push {r4,lr} + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8159A54 + str r1, [r0] + ldr r0, =gUnknown_085CCA54 + movs r1, 0x2 + bl battle_show_message_maybe + movs r4, 0 +_08159AAE: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8059CF8 + adds r4, 0x1 + cmp r4, 0x3 + ble _08159AAE + ldr r1, =0x020244ac + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_8059CB4 + ldr r0, =gUnknown_085CCA04 + bl get_battle_strings_ + ldr r0, =0x02022e2c + movs r1, 0x1 + bl battle_show_message_maybe + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159A94 + + thumb_func_start sub_8159AFC +sub_8159AFC: @ 8159AFC + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159AFC + + thumb_func_start sub_8159B08 +sub_8159B08: @ 8159B08 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159B08 + + thumb_func_start sub_8159B14 +sub_8159B14: @ 8159B14 + push {lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x03005d60 + ldr r2, =0x02024064 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8159660 + str r1, [r0] + ldr r1, =0x020244b8 + ldrb r0, [r2] + strb r0, [r1] + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159B14 + + thumb_func_start sub_8159B54 +sub_8159B54: @ 8159B54 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159B54 + + thumb_func_start sub_8159B60 +sub_8159B60: @ 8159B60 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159B60 + + thumb_func_start sub_8159B6C +sub_8159B6C: @ 8159B6C + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159B6C + + thumb_func_start sub_8159B78 +sub_8159B78: @ 8159B78 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159B78 + + thumb_func_start sub_8159B84 +sub_8159B84: @ 8159B84 + push {lr} + ldr r0, =0x03005d70 + ldr r1, =0x02024064 + ldrb r1, [r1] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0xB + bl healthbar_draw_field_maybe + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159B84 + + thumb_func_start sub_8159BC0 +sub_8159BC0: @ 8159BC0 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159BC0 + + thumb_func_start sub_8159BCC +sub_8159BCC: @ 8159BCC + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159BCC + + thumb_func_start sub_8159BD8 +sub_8159BD8: @ 8159BD8 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159BD8 + + thumb_func_start sub_8159BE4 +sub_8159BE4: @ 8159BE4 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159BE4 + + thumb_func_start sub_8159BF0 +sub_8159BF0: @ 8159BF0 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159BF0 + + thumb_func_start sub_8159BFC +sub_8159BFC: @ 8159BFC + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159BFC + + thumb_func_start sub_8159C08 +sub_8159C08: @ 8159C08 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159C08 + + thumb_func_start sub_8159C14 +sub_8159C14: @ 8159C14 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159C14 + + thumb_func_start sub_8159C20 +sub_8159C20: @ 8159C20 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159C20 + + thumb_func_start sub_8159C2C +sub_8159C2C: @ 8159C2C + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159C2C + + thumb_func_start sub_8159C38 +sub_8159C38: @ 8159C38 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159C38 + + thumb_func_start sub_8159C44 +sub_8159C44: @ 8159C44 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159C44 + + thumb_func_start sub_8159C50 +sub_8159C50: @ 8159C50 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159C50 + + thumb_func_start sub_8159C5C +sub_8159C5C: @ 8159C5C + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159C5C + + thumb_func_start sub_8159C68 +sub_8159C68: @ 8159C68 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159C68 + + thumb_func_start sub_8159C74 +sub_8159C74: @ 8159C74 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159C74 + + thumb_func_start sub_8159C80 +sub_8159C80: @ 8159C80 + push {r4,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + movs r3, 0x3F + cmp r0, 0 + bne _08159C94 + movs r3, 0xC0 +_08159C94: + ldr r2, =0x02023064 + 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 audio_play_and_stuff + bl dp01_tbl6_exec_completed + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159C80 + + thumb_func_start dp01t_34_6_move_anim_start_t3 +dp01t_34_6_move_anim_start_t3: @ 8159CC4 + push {r4,r5,lr} + ldr r4, =0x02023064 + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r3, r0, 9 + adds r0, r4, 0x3 + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _08159D00 + 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 song_play_for_text + b _08159D14 + .pool +_08159D00: + 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 fanfare_play +_08159D14: + bl dp01_tbl6_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end dp01t_34_6_move_anim_start_t3 + + thumb_func_start sub_8159D20 +sub_8159D20: @ 8159D20 + push {lr} + ldr r1, =0x0202406e + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x19 + bl cry_related + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159D20 + + thumb_func_start dp01t_2E_6_battle_intro +dp01t_2E_6_battle_intro: @ 8159D5C + push {lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, =0x020243fc + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_2E_6_battle_intro + + thumb_func_start sub_8159D90 +sub_8159D90: @ 8159D90 + push {r4,r5,lr} + ldr r5, =0x03005d70 + ldr r4, =0x02024064 + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0xA + bl healthbar_draw_field_maybe + ldrb r0, [r4] + bl sub_8076918 + ldrb r0, [r4] + adds r0, r5 + ldrb r0, [r0] + bl sub_80729D0 + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_81595AC + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159D90 + + thumb_func_start sub_8159DEC +sub_8159DEC: @ 8159DEC + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159DEC + + thumb_func_start sub_8159DF8 +sub_8159DF8: @ 8159DF8 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159DF8 + + thumb_func_start sub_8159E04 +sub_8159E04: @ 8159E04 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159E04 + + thumb_func_start sub_8159E10 +sub_8159E10: @ 8159E10 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159E10 + + thumb_func_start sub_8159E1C +sub_8159E1C: @ 8159E1C + push {r4-r6,lr} + sub sp, 0x4 + ldr r5, =0x02023064 + ldr r6, =0x02024064 + 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 _08159E5C + bl dp01_tbl6_exec_completed + b _08159E68 + .pool +_08159E5C: + ldr r0, =0x03005d60 + ldrb r1, [r6] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_81596D4 + str r0, [r1] +_08159E68: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159E1C + + thumb_func_start sub_8159E78 +sub_8159E78: @ 8159E78 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159E78 + + thumb_func_start sub_8159E84 +sub_8159E84: @ 8159E84 + push {lr} + bl dp01_tbl6_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8159E84 + + thumb_func_start sub_8159E90 +sub_8159E90: @ 8159E90 + push {r4,lr} + ldr r2, =0x0202433a + ldr r1, =0x02023064 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + movs r0, 0x5 + bl sub_80A2F50 + movs r0, 0x3 + bl sub_80A2390 + bl dp01_tbl6_exec_completed + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x6 + ands r0, r1 + cmp r0, 0x2 + bne _08159ECC + ldr r0, =0x03005d60 + ldrb r1, [r4] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_81595E4 + str r0, [r1] +_08159ECC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159E90 + + thumb_func_start nullsub_115 +nullsub_115: @ 8159EEC + bx lr + thumb_func_end nullsub_115 + + thumb_func_start sub_8159EF0 +sub_8159EF0: @ 8159EF0 + ldr r1, =0x03005db0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =0x0203ceec + ldr r0, =hm2_sweet_scent + str r0, [r1] + movs r0, 0x1 + bx lr + .pool + thumb_func_end sub_8159EF0 + + thumb_func_start hm2_sweet_scent +hm2_sweet_scent: @ 8159F10 + push {lr} + movs r0, 0x33 + bl FieldEffectStart + bl brm_get_pokemon_selection + ldr r1, =0x02038c08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end hm2_sweet_scent + + thumb_func_start sub_8159F2C +sub_8159F2C: @ 8159F2C + push {lr} + bl sub_80AC3D0 + bl oei_task_add + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =sub_8159F5C + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8159F2C + + thumb_func_start sub_8159F5C +sub_8159F5C: @ 8159F5C + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0xEC + bl audio_play + ldr r5, =0x02037714 + ldr r1, =0x02037fe8 + movs r4, 0x80 + lsls r4, 1 + adds r0, r5, 0 + adds r2, r4, 0 + bl CpuFastSet + ldr r0, =0x02037b14 + adds r1, r5, 0 + adds r2, r4, 0 + bl CpuFastSet + bl GetPlayerAvatarObjectId + ldr r2, =0x02020630 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x5] + lsrs r1, 4 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + mvns r0, r0 + movs r1, 0x1F + str r1, [sp] + movs r1, 0x4 + movs r2, 0 + movs r3, 0x8 + bl pal_fade_maybe + ldr r0, =sub_8159FEC + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x8] + movs r0, 0x33 + bl FieldEffectActiveListRemove + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8159F5C + + thumb_func_start sub_8159FEC +sub_8159FEC: @ 8159FEC + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _0815A088 + bl sub_81BE72C + movs r0, 0x40 + movs r1, 0x8 + movs r2, 0x1F + bl sub_80A2A20 + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r4, r1, r0 + ldrh r1, [r4, 0x8] + movs r2, 0x8 + ldrsh r0, [r4, r2] + cmp r0, 0x40 + bne _0815A084 + strh r6, [r4, 0x8] + bl sub_80B5578 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815A044 + adds r0, r5, 0 + bl DestroyTask + b _0815A088 + .pool +_0815A044: + ldr r0, =sub_815A090 + str r0, [r4] + bl GetPlayerAvatarObjectId + ldr r2, =0x02020630 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x5] + lsrs r1, 4 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + mvns r0, r0 + movs r1, 0x1F + str r1, [sp] + movs r1, 0x4 + movs r2, 0x8 + movs r3, 0 + bl pal_fade_maybe + bl sub_81BE6B8 + b _0815A088 + .pool +_0815A084: + adds r0, r1, 0x1 + strh r0, [r4, 0x8] +_0815A088: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8159FEC + + thumb_func_start sub_815A090 +sub_815A090: @ 815A090 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0815A0BE + ldr r0, =0x02037fe8 + ldr r1, =0x02037714 + movs r2, 0x80 + lsls r2, 1 + bl CpuFastSet + bl sub_80AC3E4 + ldr r0, =gUnknown_08290CAE + bl script_env_1_execute_new_script + adds r0, r4, 0 + bl DestroyTask +_0815A0BE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A090 + + thumb_func_start sub_815A0D4 +sub_815A0D4: @ 815A0D4 + push {lr} + adds r2, r0, 0 + ldr r1, =0x0203841e + ldrh r0, [r1] + ldrh r3, [r2, 0x20] + adds r0, r3 + strh r0, [r2, 0x20] + ldrh r0, [r1, 0x2] + ldrh r3, [r2, 0x22] + adds r0, r3 + strh r0, [r2, 0x22] + movs r3, 0x6 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _0815A0FC + ldrh r0, [r1, 0x4] + b _0815A100 + .pool +_0815A0FC: + ldrh r0, [r1, 0x4] + negs r0, r0 +_0815A100: + strh r0, [r2, 0x2E] + ldrh r0, [r1, 0x8] + strh r0, [r2, 0x30] + ldr r0, =sub_815A114 + str r0, [r2, 0x1C] + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A0D4 + + thumb_func_start sub_815A114 +sub_815A114: @ 815A114 + push {lr} + adds r3, r0, 0 + movs r1, 0x30 + ldrsh r0, [r3, r1] + cmp r0, 0 + ble _0815A154 + ldrh r1, [r3, 0x32] + lsls r0, r1, 16 + asrs r0, 24 + strh r0, [r3, 0x24] + ldrh r0, [r3, 0x2E] + adds r1, r0 + strh r1, [r3, 0x32] + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r2, [r0] + 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 + mov r1, r12 + strb r0, [r1] + ldrh r0, [r3, 0x30] + subs r0, 0x1 + strh r0, [r3, 0x30] + b _0815A15A +_0815A154: + adds r0, r3, 0 + bl move_anim_8072740 +_0815A15A: + pop {r0} + bx r0 + thumb_func_end sub_815A114 + + thumb_func_start sub_815A160 +sub_815A160: @ 815A160 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r6, =0x02038437 + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 8 + movs r0, 0x80 + lsls r0, 12 + adds r4, r0 + asrs r4, 16 + ldrb r0, [r6] + movs r1, 0x3 + bl sub_80A5C6C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 8 + movs r0, 0x80 + lsls r0, 12 + adds r1, r0 + asrs r1, 16 + adds r0, r4, 0 + movs r2, 0 + bl sub_807521C + adds r0, r5, 0 + bl move_anim_task_del + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A160 + + thumb_func_start sub_815A1B0 +sub_815A1B0: @ 815A1B0 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x5A + strh r0, [r4, 0x2E] + ldr r0, =sub_80A64B0 + str r0, [r4, 0x1C] + movs r0, 0x7 + strh r0, [r4, 0x30] + ldr r1, =sub_815A1F4 + adds r0, r4, 0 + bl oamt_set_x3A_32 + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + ldrh r0, [r4, 0x30] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A1B0 + + thumb_func_start sub_815A1F4 +sub_815A1F4: @ 815A1F4 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + ldrh r0, [r4, 0x30] + subs r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + cmp r0, 0 + bge _0815A228 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_815A234 + str r0, [r4, 0x1C] +_0815A228: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A1F4 + + thumb_func_start sub_815A234 +sub_815A234: @ 815A234 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r4, 0 + bl move_anim_8072740 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815A234 + + thumb_func_start sub_815A254 +sub_815A254: @ 815A254 + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80A6980 + ldrh r0, [r5, 0x20] + subs r0, r7 + lsls r0, 16 + asrs r0, 16 + ldrh r1, [r5, 0x22] + subs r1, r6 + lsls r1, 16 + asrs r1, 16 + bl sub_80A74F4 + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 23 + adds r0, r1 + lsrs r4, r0, 16 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0815A2B2 + movs r1, 0x80 + lsls r1, 7 + adds r0, r4, r1 + lsls r0, 16 + lsrs r4, r0, 16 +_0815A2B2: + movs r3, 0x80 + lsls r3, 1 + str r4, [sp] + adds r0, r5, 0 + movs r1, 0 + adds r2, r3, 0 + bl sub_80A73E0 + ldr r0, =0x0203841e + ldrh r0, [r0, 0x4] + strh r0, [r5, 0x2E] + strh r7, [r5, 0x32] + strh r6, [r5, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r5, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r5, 0 + bl oamt_set_x3A_32 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A254 + + thumb_func_start sub_815A2F0 +sub_815A2F0: @ 815A2F0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x4 + strh r0, [r4, 0x2E] + ldr r0, =sub_815A31C + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A2F0 + + thumb_func_start sub_815A31C +sub_815A31C: @ 815A31C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815A342 + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + b _0815A346 +_0815A342: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 +_0815A346: + strh r0, [r4, 0x2E] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0xF + beq _0815A354 + cmp r0, 0x4 + bne _0815A35C +_0815A354: + ldrh r0, [r4, 0x30] + movs r1, 0x1 + eors r0, r1 + strh r0, [r4, 0x30] +_0815A35C: + ldrh r0, [r4, 0x32] + adds r1, r0, 0x1 + strh r1, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x46 + ble _0815A3A0 + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + movs r0, 0 + strh r0, [r4, 0x32] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + subs r2, 0x12 + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_815A3AC + str r0, [r4, 0x1C] +_0815A3A0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A31C + + thumb_func_start sub_815A3AC +sub_815A3AC: @ 815A3AC + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x32] + adds r1, r0, 0x1 + strh r1, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + ble _0815A3E8 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + subs r2, 0x12 + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + adds r0, r3, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0815A3E8 + ldr r0, =sub_815A3F0 + str r0, [r3, 0x1C] +_0815A3E8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A3AC + + thumb_func_start sub_815A3F0 +sub_815A3F0: @ 815A3F0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0x6 + bhi _0815A448 + lsls r0, 2 + ldr r1, =_0815A40C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815A40C: + .4byte _0815A428 + .4byte _0815A428 + .4byte _0815A432 + .4byte _0815A432 + .4byte _0815A440 + .4byte _0815A440 + .4byte _0815A448 +_0815A428: + movs r1, 0 + movs r0, 0x1 + strh r0, [r4, 0x24] + strh r1, [r4, 0x26] + b _0815A450 +_0815A432: + ldr r0, =0x0000ffff + strh r0, [r4, 0x24] + movs r0, 0 + b _0815A44E + .pool +_0815A440: + movs r0, 0 + strh r0, [r4, 0x24] + movs r0, 0x1 + b _0815A44E +_0815A448: + movs r0, 0 + strh r0, [r4, 0x24] + ldr r0, =0x0000ffff +_0815A44E: + strh r0, [r4, 0x26] +_0815A450: + ldrh r0, [r4, 0x34] + adds r0, 0x1 + movs r2, 0 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _0815A462 + strh r2, [r4, 0x34] +_0815A462: + ldrh r0, [r4, 0x36] + adds r1, r0, 0x1 + strh r1, [r4, 0x36] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + ble _0815A48C + movs r0, 0x10 + strh r0, [r4, 0x2E] + strh r2, [r4, 0x30] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + ldrh r1, [r4, 0x2E] + movs r0, 0x52 + bl SetGpuReg + ldr r0, =sub_815A49C + str r0, [r4, 0x1C] +_0815A48C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A3F0 + + thumb_func_start sub_815A49C +sub_815A49C: @ 815A49C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + ldrh r0, [r4, 0x30] + adds r1, r0, 0x1 + strh r1, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815A4CC + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x2E] + strh r1, [r4, 0x30] +_0815A4CC: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815A4E0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_0815A4E0: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _0815A4FE + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r4, 0 + bl move_anim_8072740 +_0815A4FE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815A49C + + thumb_func_start sub_815A504 +sub_815A504: @ 815A504 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =sub_815A52C + str r0, [r1] + ldr r1, =0x020383fe + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_815A504 + + thumb_func_start sub_815A52C +sub_815A52C: @ 815A52C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A6D94 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, =0x03005e00 + lsls r5, r4, 2 + adds r1, r5, r4 + lsls r1, 3 + adds r1, r7 + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _0815A59C + ldr r0, =0x02037b14 + lsls r2, r6, 4 + adds r1, r2, 0 + adds r1, 0xB + lsls r1, 1 + adds r1, r0 + ldrh r3, [r1] + mov r8, r3 + movs r3, 0xA + mov r9, r7 + adds r7, r5, 0 + mov r12, r0 + adds r5, r2, 0 + lsls r0, r6, 5 + add r0, r12 + adds r2, r0, 0 + adds r2, 0x14 +_0815A57A: + ldrh r0, [r2] + strh r0, [r1] + subs r2, 0x2 + subs r1, 0x2 + subs r3, 0x1 + cmp r3, 0 + bgt _0815A57A + adds r0, r5, 0x1 + lsls r0, 1 + add r0, r12 + movs r1, 0 + mov r2, r8 + strh r2, [r0] + adds r0, r7, r4 + lsls r0, 3 + add r0, r9 + strh r1, [r0, 0x12] +_0815A59C: + ldr r0, =0x0203841e + ldrh r1, [r0, 0xE] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _0815A5AC + adds r0, r4, 0 + bl DestroyTask +_0815A5AC: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A52C + + thumb_func_start c3_80DE6F0 +c3_80DE6F0: @ 815A5C8 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =sub_815A5F0 + str r0, [r1] + ldr r1, =0x020383fe + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + bx lr + .pool + thumb_func_end c3_80DE6F0 + + thumb_func_start sub_815A5F0 +sub_815A5F0: @ 815A5F0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + bl sub_80A6D94 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r5, =0x03005e00 + mov r0, r8 + lsls r3, r0, 2 + adds r1, r3, r0 + lsls r1, 3 + adds r1, r5 + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _0815A692 + ldr r0, =0x02037b14 + lsls r2, r7, 4 + adds r1, r2, 0 + adds r1, 0xB + lsls r1, 1 + adds r1, r0 + ldrh r6, [r1] + movs r4, 0xA + mov r10, r3 + mov r9, r0 + adds r5, r2, 0 + ldr r2, =0x02037714 + mov r12, r2 + lsls r0, r7, 5 + add r0, r9 + adds r3, r0, 0 + adds r3, 0x14 +_0815A644: + ldrh r0, [r3] + strh r0, [r1] + subs r3, 0x2 + subs r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bgt _0815A644 + adds r0, r5, 0x1 + lsls r0, 1 + add r0, r9 + strh r6, [r0] + adds r1, r5, 0 + adds r1, 0xB + lsls r1, 1 + add r1, r12 + ldrh r6, [r1] + movs r4, 0xA + lsls r0, r7, 5 + add r0, r12 + adds r2, r0, 0 + adds r2, 0x14 +_0815A66E: + ldrh r0, [r2] + strh r0, [r1] + subs r2, 0x2 + subs r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bgt _0815A66E + adds r0, r5, 0x1 + lsls r0, 1 + add r0, r12 + movs r1, 0 + strh r6, [r0] + mov r0, r10 + add r0, r8 + lsls r0, 3 + ldr r2, =0x03005e00 + adds r0, r2 + strh r1, [r0, 0x12] +_0815A692: + ldr r0, =0x0203841e + ldrh r1, [r0, 0xE] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _0815A6A2 + mov r0, r8 + bl DestroyTask +_0815A6A2: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A5F0 + + thumb_func_start sub_815A6C4 +sub_815A6C4: @ 815A6C4 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, =0x02038437 + ldrb r0, [r0] + mov r5, sp + adds r5, 0x2 + movs r1, 0 + mov r2, sp + adds r3, r5, 0 + bl sub_80A8924 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0815A6F8 + ldr r1, =0x0203841e + ldrh r0, [r1, 0x4] + negs r0, r0 + strh r0, [r1, 0x4] +_0815A6F8: + ldr r1, =0x0203841e + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x2E] + mov r2, sp + ldrh r0, [r1, 0x4] + ldrh r2, [r2] + adds r0, r2 + strh r0, [r4, 0x32] + ldrh r0, [r1, 0x6] + ldrh r5, [r5] + adds r0, r5 + strh r0, [r4, 0x36] + ldr r0, =0x0000ffce + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl sub_80A68D4 + ldr r0, =sub_815A73C + str r0, [r4, 0x1C] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A6C4 + + thumb_func_start sub_815A73C +sub_815A73C: @ 815A73C + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _0815A75E + movs r1, 0 + movs r0, 0x1E + strh r0, [r4, 0x2E] + strh r1, [r4, 0x30] + ldr r0, =sub_80A64B0 + str r0, [r4, 0x1C] + ldr r1, =sub_815A76C + adds r0, r4, 0 + bl oamt_set_x3A_32 +_0815A75E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A73C + + thumb_func_start sub_815A76C +sub_815A76C: @ 815A76C + push {lr} + adds r3, r0, 0 + ldrh r1, [r3, 0x30] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0815A798 + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r2, [r0] + 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 + mov r1, r12 + strb r0, [r1] +_0815A798: + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + bne _0815A7AC + adds r0, r3, 0 + bl move_anim_8072740 +_0815A7AC: + pop {r0} + bx r0 + thumb_func_end sub_815A76C + + thumb_func_start sub_815A7B0 +sub_815A7B0: @ 815A7B0 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_80A6838 + ldr r5, =0x0203841e + movs r0, 0 + ldrsh r1, [r5, r0] + adds r0, r4, 0 + bl sub_80A6864 + ldrh r0, [r5, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r0, =sub_80A67D8 + str r0, [r4, 0x1C] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A7B0 + + thumb_func_start sub_815A7EC +sub_815A7EC: @ 815A7EC + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815A84C + adds r0, r4, 0 + bl sub_80A6838 + ldr r5, =0x0203841e + movs r2, 0 + ldrsh r1, [r5, r2] + adds r0, r4, 0 + bl sub_80A6864 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0815A840 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0815A830 + ldrh r0, [r5, 0x4] + b _0815A846 + .pool +_0815A830: + movs r1, 0x4 + ldrsh r0, [r5, r1] + negs r0, r0 + strh r0, [r4, 0x30] + movs r2, 0x6 + ldrsh r0, [r5, r2] + negs r0, r0 + b _0815A84A +_0815A840: + movs r1, 0x4 + ldrsh r0, [r5, r1] + negs r0, r0 +_0815A846: + strh r0, [r4, 0x30] + ldrh r0, [r5, 0x6] +_0815A84A: + strh r0, [r4, 0x32] +_0815A84C: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r2, 0x2E + ldrsh r1, [r4, r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + movs r3, 0xFF + ldrh r1, [r4, 0x30] + ldrh r2, [r4, 0x34] + adds r1, r2 + strh r1, [r4, 0x34] + ldrh r1, [r4, 0x32] + ldrh r2, [r4, 0x36] + adds r1, r2 + strh r1, [r4, 0x36] + movs r2, 0x34 + ldrsh r1, [r4, r2] + lsrs r2, r1, 31 + adds r1, r2 + asrs r1, 1 + strh r1, [r4, 0x24] + ands r0, r3 + movs r1, 0x5 + bl sine + movs r2, 0x36 + ldrsh r1, [r4, r2] + lsrs r2, r1, 31 + adds r1, r2 + asrs r1, 1 + adds r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xF0 + bls _0815A8A4 + adds r0, r4, 0 + bl move_anim_8072740 +_0815A8A4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815A7EC + + thumb_func_start sub_815A8AC +sub_815A8AC: @ 815A8AC + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0815A8C2 + adds r0, r2, 0 + bl move_anim_8072740 +_0815A8C2: + pop {r0} + bx r0 + thumb_func_end sub_815A8AC + + thumb_func_start sub_815A8C8 +sub_815A8C8: @ 815A8C8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815A8EC + ldr r1, =0x0203841e + movs r0, 0 + b _0815A8F0 + .pool +_0815A8EC: + ldr r1, =0x0203841e + movs r0, 0x1 +_0815A8F0: + strh r0, [r1, 0xE] + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A8C8 + + thumb_func_start sub_815A904 +sub_815A904: @ 815A904 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02038404 + ldr r0, [r0] + cmp r0, 0 + ble _0815A920 + ldr r1, =0x0203841e + movs r0, 0 + b _0815A924 + .pool +_0815A920: + ldr r1, =0x0203841e + movs r0, 0x1 +_0815A924: + strh r0, [r1, 0xE] + adds r0, r2, 0 + bl move_anim_task_del + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A904 + + thumb_func_start sub_815A934 +sub_815A934: @ 815A934 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r1, =0x00001f3f + movs r0, 0x4A + bl SetGpuReg + movs r1, 0x80 + lsls r1, 8 + movs r0, 0 + bl SetGpuRegBits + ldr r0, =0x02022e24 + movs r1, 0 + strh r1, [r0] + ldr r4, =0x02022e26 + strh r1, [r4] + movs r0, 0x40 + movs r1, 0 + bl SetGpuReg + ldrh r1, [r4] + movs r0, 0x44 + bl SetGpuReg + adds r0, r5, 0 + movs r1, 0 + bl sub_80A6980 + ldrb r1, [r5, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r5, 0x1] + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_815A9A0 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A934 + + thumb_func_start sub_815A9A0 +sub_815A9A0: @ 815A9A0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x5 + bhi _0815AA60 + lsls r0, 2 + ldr r1, =_0815A9BC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815A9BC: + .4byte _0815A9D4 + .4byte _0815A9F2 + .4byte _0815AA12 + .4byte _0815A9F2 + .4byte _0815AA32 + .4byte _0815AA42 +_0815A9D4: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0815AA60 + b _0815AA3A +_0815A9F2: + ldrh r0, [r4, 0x30] + adds r0, 0x75 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x15 + bne _0815AA60 + movs r0, 0 + strh r0, [r4, 0x32] + b _0815AA3A +_0815AA12: + ldrh r0, [r4, 0x30] + subs r0, 0x75 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 24 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x29 + bne _0815AA60 + movs r0, 0 + strh r0, [r4, 0x32] + b _0815AA3A +_0815AA32: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80082B8 +_0815AA3A: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0815AA60 +_0815AA42: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0815AA60 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_815AA6C + str r0, [r4, 0x1C] +_0815AA60: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815A9A0 + + thumb_func_start sub_815AA6C +sub_815AA6C: @ 815AA6C + push {r4,lr} + adds r4, r0, 0 + ldr r1, =0x00003f3f + movs r0, 0x4A + bl SetGpuReg + movs r0, 0 + bl GetGpuReg + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 8 + adds r0, r2, 0 + eors r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0 + bl SetGpuReg + adds r0, r4, 0 + bl move_anim_8072740 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815AA6C + + thumb_func_start sub_815AAA4 +sub_815AAA4: @ 815AAA4 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, =0x0203841e + movs r1, 0x6 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0815AAD0 + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] +_0815AAD0: + ldrh r0, [r6] + ldrh r2, [r5, 0x20] + adds r0, r2 + movs r3, 0 + strh r0, [r5, 0x20] + ldrh r0, [r6, 0x2] + ldrh r4, [r5, 0x22] + adds r0, r4 + strh r0, [r5, 0x22] + ldrh r2, [r5, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x10 + ldr r4, =0x000003ff + adds r0, r4, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + movs r1, 0x4 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0815AB2C + ldrb r1, [r5, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r5, 0x3] + ldr r0, =0x0000fff4 + strh r0, [r5, 0x24] + movs r0, 0x2 + b _0815AB32 + .pool +_0815AB2C: + movs r0, 0xC + strh r0, [r5, 0x24] + ldr r0, =0x0000fffe +_0815AB32: + strh r0, [r5, 0x30] + ldr r1, =0x0203841e + ldrh r0, [r1, 0x8] + strh r0, [r5, 0x2E] + movs r2, 0x34 + ldrsh r0, [r5, r2] + cmp r0, 0xFF + beq _0815AB46 + ldrh r0, [r1, 0x4] + strh r0, [r5, 0x34] +_0815AB46: + ldr r0, =sub_815AB5C + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815AAA4 + + thumb_func_start sub_815AB5C +sub_815AB5C: @ 815AB5C + push {r4,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x32] + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815AB9A + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + lsls r0, 16 + cmp r0, 0 + bne _0815ABBA + adds r0, r2, 0x1 + strh r0, [r4, 0x32] + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815ABBA + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xDE + bl sub_80A3808 + b _0815ABBA +_0815AB9A: + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x30] + subs r0, r1 + strh r0, [r4, 0x24] + movs r1, 0x24 + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _0815ABAC + negs r0, r0 +_0815ABAC: + cmp r0, 0xC + bne _0815ABBA + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + subs r0, r2, 0x1 + strh r0, [r4, 0x32] +_0815ABBA: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815ABC8 + adds r0, r4, 0 + bl move_anim_8072740 +_0815ABC8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815AB5C + + thumb_func_start sub_815ABD0 +sub_815ABD0: @ 815ABD0 + push {lr} + ldrb r2, [r0, 0x1] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0, 0x1] + movs r1, 0xFF + strh r1, [r0, 0x34] + bl sub_815AAA4 + pop {r0} + bx r0 + thumb_func_end sub_815ABD0 + + thumb_func_start sub_815ABEC +sub_815ABEC: @ 815ABEC + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0815AC40 + ldr r1, =0x00001f3f + movs r0, 0x48 + bl SetGpuReg + ldr r1, =0x02022e28 + ldr r2, =0x000098f0 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, =0x02022e2a + movs r0, 0xA0 + strh r0, [r1] + ldr r0, =0x02022e24 + ldrh r1, [r0] + movs r0, 0x42 + bl SetGpuReg + ldr r0, =0x02022e26 + ldrh r1, [r0] + movs r0, 0x46 + bl SetGpuReg + b _0815AC70 + .pool +_0815AC40: + ldr r1, =0x00001f3f + movs r0, 0x48 + bl SetGpuReg + ldr r1, =0x02022e28 + movs r0, 0xF0 + strh r0, [r1] + ldr r4, =0x02022e2a + ldr r1, =0x000078a0 + adds r0, r1, 0 + strh r0, [r4] + movs r0, 0x42 + movs r1, 0xF0 + bl SetGpuReg + ldrh r1, [r4] + movs r0, 0x46 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 7 + movs r0, 0 + bl SetGpuRegBits +_0815AC70: + adds r0, r5, 0 + bl move_anim_task_del + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815ABEC + + thumb_func_start sub_815AC8C +sub_815AC8C: @ 815AC8C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + ldr r0, =0x02022e28 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e2a + strh r1, [r0] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0815ACB8 + movs r1, 0x80 + lsls r1, 7 + movs r0, 0 + bl ClearGpuRegBits +_0815ACB8: + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815AC8C + + thumb_func_start sub_815ACD0 +sub_815ACD0: @ 815ACD0 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, =0x0203841e + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0815ACEC + ldr r4, =0x02038436 + b _0815ACEE + .pool +_0815ACEC: + ldr r4, =0x02038437 +_0815ACEE: + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r6, [r6, 0x2] + adds r0, r6 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + ldr r2, =0x0203841e + ldrh r0, [r2, 0x4] + strh r0, [r5, 0x26] + movs r3, 0 + lsls r0, 16 + asrs r0, 16 + ldrh r4, [r2, 0x6] + movs r6, 0x6 + ldrsh r1, [r2, r6] + cmp r0, r1 + ble _0815AD26 + movs r3, 0x1 +_0815AD26: + strh r3, [r5, 0x2E] + movs r0, 0 + strh r0, [r5, 0x30] + ldrh r0, [r2, 0x8] + strh r0, [r5, 0x32] + ldrh r0, [r2, 0xA] + strh r0, [r5, 0x34] + strh r4, [r5, 0x36] + ldr r0, =sub_815AD4C + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815ACD0 + + thumb_func_start sub_815AD4C +sub_815AD4C: @ 815AD4C + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x32] + ldrh r1, [r2, 0x30] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r2, 0x30] + ldr r1, =gUnknown_08329F40 + movs r3, 0x30 + ldrsh r0, [r2, r3] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 20 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x34] + ldrh r3, [r2, 0x26] + adds r1, r0, r3 + strh r1, [r2, 0x26] + movs r3, 0x2E + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _0815AD98 + lsls r0, r1, 16 + asrs r0, 16 + movs r3, 0x36 + ldrsh r1, [r2, r3] + cmp r0, r1 + bge _0815ADAA + adds r0, r2, 0 + bl move_anim_8072740 + b _0815ADAA + .pool +_0815AD98: + lsls r0, r1, 16 + asrs r0, 16 + movs r3, 0x36 + ldrsh r1, [r2, r3] + cmp r0, r1 + ble _0815ADAA + adds r0, r2, 0 + bl move_anim_8072740 +_0815ADAA: + pop {r0} + bx r0 + thumb_func_end sub_815AD4C + + thumb_func_start sub_815ADB0 +sub_815ADB0: @ 815ADB0 + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r5, r1, r0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0815ADDC + ldr r4, =0x02038436 + b _0815ADDE + .pool +_0815ADDC: + ldr r4, =0x02038437 +_0815ADDE: + ldrb r0, [r4] + bl sub_80A6190 + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r0, [r4] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r6, 0 + adds r1, r0, 0 + adds r1, 0x24 + movs r2, 0 + strh r1, [r5, 0x8] + strh r1, [r5, 0xA] + subs r0, 0x21 + strh r0, [r5, 0xC] + cmp r0, 0 + bge _0815AE08 + strh r2, [r5, 0xC] +_0815AE08: + ldrh r0, [r5, 0x8] + strh r0, [r5, 0xE] + movs r0, 0x8 + strh r0, [r5, 0x10] + ldr r1, =0x0203841e + ldrh r0, [r1, 0x2] + strh r0, [r5, 0x12] + strh r2, [r5, 0x14] + strh r2, [r5, 0x16] + cmp r7, 0x1 + bne _0815AE30 + ldr r0, =0x02022e18 + b _0815AE32 + .pool +_0815AE30: + ldr r0, =0x02022e1c +_0815AE32: + ldrh r2, [r0] + strh r2, [r5, 0x18] + adds r3, r2, 0 + adds r3, 0xF0 + strh r3, [r5, 0x1A] + ldrh r0, [r1, 0x4] + strh r0, [r5, 0x1C] + movs r4, 0x4 + ldrsh r0, [r1, r4] + cmp r0, 0 + bne _0815AE54 + strh r3, [r5, 0x1E] + ldrh r3, [r5, 0x18] + b _0815AE58 + .pool +_0815AE54: + strh r2, [r5, 0x1E] + ldrh r3, [r5, 0x1A] +_0815AE58: + movs r0, 0 + strh r0, [r5, 0x26] + ldrh r1, [r5, 0xC] + lsls r2, r1, 16 + asrs r1, r2, 16 + movs r6, 0xE + ldrsh r0, [r5, r6] + cmp r1, r0 + bgt _0815AE8E + ldr r4, =0x02038c28 + movs r0, 0xF0 + lsls r0, 3 + adds r0, r4 + mov r12, r0 +_0815AE74: + asrs r2, 16 + lsls r1, r2, 1 + adds r0, r1, r4 + strh r3, [r0] + add r1, r12 + strh r3, [r1] + adds r2, 0x1 + lsls r2, 16 + asrs r1, r2, 16 + movs r6, 0xE + ldrsh r0, [r5, r6] + cmp r1, r0 + ble _0815AE74 +_0815AE8E: + cmp r7, 0x1 + bne _0815AEA0 + ldr r0, =0x04000014 + b _0815AEA2 + .pool +_0815AEA0: + ldr r0, =0x04000018 +_0815AEA2: + str r0, [sp] + ldr r0, =0xa2600001 + str r0, [sp, 0x4] + mov r1, sp + movs r2, 0 + movs r0, 0x1 + strb r0, [r1, 0x8] + mov r0, sp + strb r2, [r0, 0x9] + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + ldr r0, =sub_815AED8 + str r0, [r5] + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815ADB0 + + thumb_func_start sub_815AED8 +sub_815AED8: @ 815AED8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + ldrh r0, [r4, 0x8] + ldrh r1, [r4, 0x12] + subs r0, r1 + strh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + ldrh r2, [r4, 0xC] + movs r3, 0xC + ldrsh r1, [r4, r3] + cmp r0, r1 + bge _0815AF00 + strh r2, [r4, 0x8] +_0815AF00: + ldrh r1, [r4, 0x10] + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0815AF2C + ldrh r0, [r4, 0xA] + ldrh r1, [r4, 0x12] + subs r0, r1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + ldrh r2, [r4, 0xC] + movs r3, 0xC + ldrsh r1, [r4, r3] + cmp r0, r1 + bge _0815AF30 + strh r2, [r4, 0xA] + movs r0, 0x1 + strh r0, [r4, 0x26] + b _0815AF30 + .pool +_0815AF2C: + subs r0, r1, 0x1 + strh r0, [r4, 0x10] +_0815AF30: + ldrh r0, [r4, 0x14] + adds r0, 0x1 + strh r0, [r4, 0x14] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815AF5C + movs r0, 0 + strh r0, [r4, 0x14] + movs r1, 0 + movs r2, 0x16 + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0815AF4E + movs r1, 0x1 +_0815AF4E: + strh r1, [r4, 0x16] + cmp r1, 0 + beq _0815AF58 + ldrh r0, [r4, 0x18] + b _0815AF5A +_0815AF58: + ldrh r0, [r4, 0x1A] +_0815AF5A: + strh r0, [r4, 0x20] +_0815AF5C: + ldrh r1, [r4, 0x8] + lsls r3, r1, 16 + asrs r1, r3, 16 + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r1, r0 + bge _0815AF90 + ldr r5, =0x02038c28 + movs r0, 0xF0 + lsls r0, 3 + adds r6, r5, r0 +_0815AF72: + asrs r3, 16 + lsls r1, r3, 1 + adds r2, r1, r5 + ldrh r0, [r4, 0x20] + strh r0, [r2] + adds r1, r6 + ldrh r0, [r4, 0x20] + strh r0, [r1] + adds r3, 0x1 + lsls r3, 16 + asrs r1, r3, 16 + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r1, r0 + blt _0815AF72 +_0815AF90: + ldrh r1, [r4, 0xA] + lsls r3, r1, 16 + asrs r1, r3, 16 + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r1, r0 + bgt _0815AFC4 + ldr r5, =0x02038c28 + movs r0, 0xF0 + lsls r0, 3 + adds r6, r5, r0 +_0815AFA6: + asrs r3, 16 + lsls r1, r3, 1 + adds r2, r1, r5 + ldrh r0, [r4, 0x1E] + strh r0, [r2] + adds r1, r6 + ldrh r0, [r4, 0x1E] + strh r0, [r1] + adds r3, 0x1 + lsls r3, 16 + asrs r1, r3, 16 + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r1, r0 + ble _0815AFA6 +_0815AFC4: + movs r3, 0x26 + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _0815AFE0 + movs r1, 0x1C + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815AFDA + ldr r1, =0x02039b28 + movs r0, 0x3 + strb r0, [r1, 0x15] +_0815AFDA: + adds r0, r7, 0 + bl move_anim_task_del +_0815AFE0: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815AED8 + + thumb_func_start sub_815AFF0 +sub_815AFF0: @ 815AFF0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + movs r5, 0 + strh r5, [r4, 0x8] + strh r5, [r4, 0xA] + ldr r6, =0x02038436 + ldrb r0, [r6] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xC] + ldrb r0, [r6] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xE] + movs r0, 0x20 + strh r0, [r4, 0x10] + ldr r0, =0x0000ffec + strh r0, [r4, 0x12] + strh r5, [r4, 0x14] + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + ldr r0, =sub_815B054 + str r0, [r4] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815AFF0 + + thumb_func_start sub_815B054 +sub_815B054: @ 815B054 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r6, r0, r1 + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0x5 + bls _0815B074 + b _0815B22E +_0815B074: + lsls r0, 2 + ldr r1, =_0815B088 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815B088: + .4byte _0815B0A0 + .4byte _0815B160 + .4byte _0815B18E + .4byte _0815B1A2 + .4byte _0815B1B8 + .4byte _0815B220 +_0815B0A0: + movs r0, 0xC + ldrsh r2, [r6, r0] + ldrh r1, [r6, 0xA] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0815B0B6 + movs r1, 0x10 + ldrsh r0, [r6, r1] + subs r0, r2, r0 + b _0815B0BC +_0815B0B6: + movs r1, 0x10 + ldrsh r0, [r6, r1] + adds r0, r2, r0 +_0815B0BC: + lsls r0, 16 + lsrs r1, r0, 16 + ldrh r2, [r6, 0x12] + ldrh r0, [r6, 0xE] + adds r2, r0 + ldr r0, =gUnknown_08593114 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + ldrb r4, [r6, 0xA] + movs r3, 0x6 + subs r3, r4 + lsls r3, 24 + lsrs r3, 24 + bl AddObjectToFront + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xBA + bl audio_play_and_stuff + cmp r4, 0x40 + beq _0815B120 + ldr r5, =0x02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r3, r1, r5 + ldrh r0, [r6, 0xA] + movs r2, 0x1 + ands r2, r0 + adds r3, 0x3F + ldrb r4, [r3] + movs r0, 0x2 + negs r0, r0 + ands r0, r4 + orrs r0, r2 + strb r0, [r3] + adds r5, 0x1C + adds r1, r5 + ldr r0, =DummyObjectCallback + str r0, [r1] +_0815B120: + ldrh r1, [r6, 0xA] + movs r4, 0x1 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0815B138 + ldrh r0, [r6, 0x10] + subs r0, 0x6 + strh r0, [r6, 0x10] + ldrh r0, [r6, 0x12] + subs r0, 0x6 + strh r0, [r6, 0x12] +_0815B138: + ldrh r1, [r6, 0x26] + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_085CE2A0 + adds r0, r6, 0 + bl sub_80A7CFC + ldrh r0, [r6, 0xA] + adds r0, 0x1 + strh r0, [r6, 0xA] + strh r4, [r6, 0x8] + b _0815B22E + .pool +_0815B160: + adds r0, r6, 0 + bl sub_80A7D34 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0815B22E + movs r2, 0xA + ldrsh r1, [r6, r2] + cmp r1, 0x6 + bne _0815B180 + movs r0, 0x8 + strh r0, [r6, 0x14] + movs r0, 0x3 + strh r0, [r6, 0x8] + b _0815B22E +_0815B180: + cmp r1, 0x2 + bgt _0815B186 + movs r0, 0xA +_0815B186: + strh r0, [r6, 0x14] + movs r0, 0x2 + strh r0, [r6, 0x8] + b _0815B22E +_0815B18E: + ldrh r0, [r6, 0x14] + movs r2, 0x14 + ldrsh r1, [r6, r2] + cmp r1, 0 + beq _0815B19E + subs r0, 0x1 + strh r0, [r6, 0x14] + b _0815B22E +_0815B19E: + strh r1, [r6, 0x8] + b _0815B22E +_0815B1A2: + ldrh r1, [r6, 0x14] + movs r2, 0x14 + ldrsh r0, [r6, r2] + cmp r0, 0 + beq _0815B1B2 + subs r0, r1, 0x1 + strh r0, [r6, 0x14] + b _0815B22E +_0815B1B2: + movs r0, 0x4 + strh r0, [r6, 0x8] + b _0815B22E +_0815B1B8: + movs r5, 0 + movs r7, 0 + ldr r3, =0x02020630 + movs r0, 0x1C + adds r0, r3 + mov r8, r0 +_0815B1C4: + lsls r0, r5, 4 + adds r0, r5 + lsls r4, r0, 2 + adds r0, r3, 0 + adds r0, 0x14 + adds r0, r4, r0 + ldr r1, [r0] + ldr r0, =gUnknown_08593114 + cmp r1, r0 + bne _0815B200 + adds r0, r4, r3 + strh r2, [r0, 0x2E] + movs r1, 0x6 + strh r1, [r0, 0x30] + movs r1, 0x2 + str r2, [sp] + str r3, [sp, 0x4] + bl StartObjectImageAnim + mov r0, r8 + adds r1, r4, r0 + ldr r0, =sub_815B23C + str r0, [r1] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + ldr r2, [sp] + ldr r3, [sp, 0x4] + cmp r7, 0x6 + beq _0815B20A +_0815B200: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x3F + bls _0815B1C4 +_0815B20A: + strh r7, [r6, 0x14] + movs r0, 0x5 + strh r0, [r6, 0x8] + b _0815B22E + .pool +_0815B220: + movs r1, 0x14 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0815B22E + adds r0, r2, 0 + bl move_anim_task_del +_0815B22E: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_815B054 + + thumb_func_start sub_815B23C +sub_815B23C: @ 815B23C + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0815B270 + ldr r3, =0x03005e00 + movs r0, 0x30 + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x2E + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0815B270: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815B23C + + thumb_func_start sub_815B27C +sub_815B27C: @ 815B27C + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0815B290 + adds r0, r5, 0 + movs r1, 0 + bl sub_80A69CC +_0815B290: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x27 + bgt _0815B2C2 + ldrh r0, [r5, 0x2E] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0815B2B4 + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + b _0815B2C0 +_0815B2B4: + adds r2, r5, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 +_0815B2C0: + strb r0, [r2] +_0815B2C2: + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0x1E + ble _0815B2D8 + adds r2, r5, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_0815B2D8: + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x3D + bne _0815B324 + ldr r1, =move_anim_8072740 + adds r0, r5, 0 + bl oamt_set_x3A_32 + ldrh r0, [r5, 0x24] + ldrh r2, [r5, 0x20] + adds r0, r2 + movs r1, 0 + strh r0, [r5, 0x20] + ldrh r0, [r5, 0x26] + ldrh r2, [r5, 0x22] + adds r0, r2 + strh r0, [r5, 0x22] + strh r1, [r5, 0x24] + strh r1, [r5, 0x26] + movs r0, 0x14 + strh r0, [r5, 0x2E] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x32] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x36] + ldr r0, =sub_80A6EEC + str r0, [r5, 0x1C] +_0815B324: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815B27C + + thumb_func_start sub_815B338 +sub_815B338: @ 815B338 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815B35C + cmp r0, 0x1 + beq _0815B37C + b _0815B38E + .pool +_0815B35C: + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_085CE350 + adds r0, r4, 0 + bl sub_80A7CFC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815B38E + .pool +_0815B37C: + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _0815B38E + adds r0, r5, 0 + bl move_anim_task_del +_0815B38E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815B338 + + thumb_func_start sub_815B394 +sub_815B394: @ 815B394 + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r6, r0, 24 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _0815B3F4 + cmp r0, 0x1 + bgt _0815B3B4 + cmp r0, 0 + beq _0815B3BE + b _0815B496 +_0815B3B4: + cmp r0, 0x2 + beq _0815B424 + cmp r0, 0x3 + beq _0815B478 + b _0815B496 +_0815B3BE: + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + adds r0, r6, 0 + movs r1, 0 + bl sub_80A7270 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r5, 0x30] + strh r0, [r5, 0x32] + b _0815B46C + .pool +_0815B3F4: + ldrh r0, [r5, 0x30] + adds r0, 0x60 + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x32] + subs r0, 0x1A + strh r0, [r5, 0x32] + movs r2, 0x30 + ldrsh r1, [r5, r2] + movs r0, 0x32 + ldrsh r2, [r5, r0] + adds r0, r6, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrh r0, [r5, 0x34] + adds r0, 0x1 + strh r0, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _0815B424 + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] +_0815B424: + ldrh r0, [r5, 0x30] + adds r0, 0x60 + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x32] + adds r0, 0x30 + strh r0, [r5, 0x32] + movs r2, 0x30 + ldrsh r1, [r5, r2] + movs r0, 0x32 + ldrsh r2, [r5, r0] + adds r0, r6, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrh r0, [r5, 0x34] + adds r0, 0x1 + strh r0, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + bne _0815B496 + movs r0, 0 + strh r0, [r5, 0x34] + ldr r1, =0x02020630 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + adds r0, r6, 0 + bl sub_80A7344 +_0815B46C: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + b _0815B496 + .pool +_0815B478: + ldrh r0, [r5, 0x26] + subs r0, 0x6 + strh r0, [r5, 0x26] + movs r1, 0x22 + ldrsh r0, [r5, r1] + movs r2, 0x26 + ldrsh r1, [r5, r2] + adds r0, r1 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + bge _0815B496 + adds r0, r5, 0 + bl move_anim_8072740 +_0815B496: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_815B394 + + thumb_func_start sub_815B49C +sub_815B49C: @ 815B49C + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0815B4BC + ldr r0, =0x0000fff0 + b _0815B4C0 + .pool +_0815B4BC: + movs r0, 0x80 + lsls r0, 1 +_0815B4C0: + strh r0, [r4, 0x20] + movs r0, 0 + strh r0, [r4, 0x22] + ldr r0, =sub_815B4D4 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815B49C + + thumb_func_start sub_815B4D4 +sub_815B4D4: @ 815B4D4 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x48 + strh r0, [r4, 0x2E] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0815B4F8 + ldrh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 20 + b _0815B500 + .pool +_0815B4F8: + ldrh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 20 + negs r0, r0 +_0815B500: + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x30] + adds r0, 0x10 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r4, 0x26] + adds r5, r0, r1 + strh r5, [r4, 0x26] + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x3 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _0815B54C + ldr r0, =gUnknown_085CE3A0 + ldrh r1, [r4, 0x24] + ldrh r2, [r4, 0x20] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r4, 0x22] + adds r2, r5 + lsls r2, 16 + asrs r2, 16 + adds r3, r4, 0 + adds r3, 0x43 + ldrb r3, [r3] + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + bl AddObjectAndAnimateForOneFrame +_0815B54C: + movs r1, 0x20 + ldrsh r0, [r4, r1] + movs r2, 0x24 + ldrsh r1, [r4, r2] + adds r0, r1 + adds r0, 0x20 + movs r1, 0x98 + lsls r1, 1 + cmp r0, r1 + bls _0815B566 + adds r0, r4, 0 + bl move_anim_8072740 +_0815B566: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815B4D4 + + thumb_func_start sub_815B570 +sub_815B570: @ 815B570 + push {r4,lr} + adds r4, r0, 0 + bl GenerateRandomNumber2 + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0815B58A + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x4 + b _0815B592 +_0815B58A: + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x5 +_0815B592: + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + bl GenerateRandomNumber2 + movs r1, 0x7 + ands r0, r1 + adds r1, r0, 0 + cmp r1, 0x3 + ble _0815B5B4 + negs r0, r1 + lsls r0, 24 + lsrs r0, 24 +_0815B5B4: + lsls r0, 24 + asrs r0, 24 + strh r0, [r4, 0x26] + ldr r0, =sub_815B5D0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815B570 + + thumb_func_start sub_815B5D0 +sub_815B5D0: @ 815B5D0 + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1D + bgt _0815B612 + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _0815B646 + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r2, [r0] + 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 + mov r1, r12 + strb r0, [r1] + movs r0, 0 + b _0815B644 +_0815B612: + movs r1, 0x30 + ldrsh r0, [r3, r1] + cmp r0, 0x2 + bne _0815B628 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_0815B628: + movs r1, 0x30 + ldrsh r0, [r3, r1] + cmp r0, 0x3 + bne _0815B640 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =0x0000ffff + strh r0, [r3, 0x30] +_0815B640: + ldrh r0, [r3, 0x30] + adds r0, 0x1 +_0815B644: + strh r0, [r3, 0x30] +_0815B646: + movs r1, 0x2E + ldrsh r0, [r3, r1] + cmp r0, 0x3C + ble _0815B654 + adds r0, r3, 0 + bl RemoveObjectAndFreeTiles +_0815B654: + pop {r0} + bx r0 + .pool + thumb_func_end sub_815B5D0 + + thumb_func_start sub_815B65C +sub_815B65C: @ 815B65C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815B69C + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_085CE3B8 + adds r0, r4, 0 + bl sub_80A7CFC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815B6AE + .pool +_0815B69C: + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _0815B6AE + adds r0, r5, 0 + bl move_anim_task_del +_0815B6AE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815B65C + + thumb_func_start sub_815B6B4 +sub_815B6B4: @ 815B6B4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815B6F4 + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_085CE3E0 + adds r0, r4, 0 + bl sub_80A7CFC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815B706 + .pool +_0815B6F4: + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _0815B706 + adds r0, r5, 0 + bl move_anim_task_del +_0815B706: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815B6B4 + + thumb_func_start sub_815B70C +sub_815B70C: @ 815B70C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815B71E + cmp r0, 0x1 + beq _0815B748 + b _0815B770 +_0815B71E: + adds r0, r4, 0 + movs r1, 0 + bl sub_80A69CC + movs r0, 0x90 + lsls r0, 4 + strh r0, [r4, 0x30] + ldr r0, =0x02038436 + ldrb r0, [r0] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0815B770 + .pool +_0815B748: + ldrh r2, [r4, 0x30] + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r4, 0x26] + subs r0, r1 + strh r0, [r4, 0x26] + subs r2, 0x60 + strh r2, [r4, 0x30] + movs r2, 0x22 + ldrsh r0, [r4, r2] + movs r2, 0x26 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r2, 0x32 + ldrsh r1, [r4, r2] + cmp r0, r1 + ble _0815B770 + adds r0, r4, 0 + bl move_anim_8072740 +_0815B770: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815B70C + + thumb_func_start sub_815B778 +sub_815B778: @ 815B778 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815B7B8 + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_085CE430 + adds r0, r4, 0 + bl sub_80A7CFC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815B7CA + .pool +_0815B7B8: + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _0815B7CA + adds r0, r5, 0 + bl move_anim_task_del +_0815B7CA: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815B778 + + thumb_func_start sub_815B7D0 +sub_815B7D0: @ 815B7D0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =0x03005e00 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r3, r1, 0 + cmp r0, 0x4 + bls _0815B7F6 + b _0815BAFC +_0815B7F6: + lsls r0, 2 + ldr r1, =_0815B808 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815B808: + .4byte _0815B81C + .4byte _0815B86C + .4byte _0815B8A8 + .4byte _0815BA44 + .4byte _0815BA82 +_0815B81C: + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815B844 + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0x1 + bl lcd_bg_operations + b _0815B84E + .pool +_0815B844: + movs r0, 0x2 + movs r1, 0x2 + movs r2, 0x1 + bl lcd_bg_operations +_0815B84E: + ldr r0, =0x03005e00 + mov r6, r8 + lsls r1, r6, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + ldr r0, =0x0203841e + ldrh r0, [r0] + strh r0, [r1, 0x1C] + b _0815BA26 + .pool +_0815B86C: + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r0, 3 + adds r4, r0, r3 + ldrh r0, [r4, 0xC] + adds r1, r0, 0x1 + strh r1, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bgt _0815B886 + b _0815BAFC +_0815B886: + movs r0, 0 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + ldrh r5, [r4, 0xA] + lsls r1, r5, 4 + orrs r1, r5 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x4C + bl SetGpuReg + cmp r5, 0xF + beq _0815B8A6 + b _0815BAFC +_0815B8A6: + b _0815BA7A +_0815B8A8: + ldr r5, =0x02038436 + ldrb r0, [r5] + ldr r1, =0x02038437 + ldrb r1, [r1] + mov r2, r8 + lsls r4, r2, 2 + adds r2, r4, r2 + lsls r2, 3 + adds r2, r3 + ldrb r2, [r2, 0x1C] + bl sub_805E448 + ldrb r1, [r5] + mov r0, sp + bl sub_80A6BFC + bl sub_80A4DF0 + lsls r0, 24 + mov r9, r4 + cmp r0, 0 + beq _0815B8E0 + movs r1, 0 + b _0815B8EA + .pool +_0815B8E0: + ldrb r0, [r5] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r1, r0, 24 +_0815B8EA: + ldr r0, =0x020244d4 + ldr r2, [r0] + lsls r0, r1, 2 + adds r2, 0x4 + adds r2, r0 + ldr r1, =0x020244e4 + ldr r0, =0x02038436 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r1, 11 + ldr r0, [r2] + adds r0, r1 + ldr r1, [sp] + ldr r2, =0x04000200 + bl CpuSet + ldr r1, [sp] + movs r2, 0x80 + lsls r2, 4 + mov r0, sp + ldrh r3, [r0, 0xA] + movs r0, 0x1 + bl LoadBgTiles + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0815BA1C + ldr r5, =0x02039f34 + ldr r0, [r5] + ldr r0, [r0, 0x18] + ldrh r0, [r0] + bl sub_80DB2A8 + adds r4, r0, 0 + ldr r0, [r5] + ldr r0, [r0, 0x18] + ldrh r0, [r0, 0x2] + bl sub_80DB2A8 + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _0815B99C + ldr r6, [sp, 0x4] + movs r5, 0 + movs r0, 0x7 + mov r12, r0 + movs r7, 0 +_0815B950: + movs r4, 0 + adds r3, r7, r6 + mov r1, r12 + lsls r0, r1, 1 + adds r2, r0, r6 +_0815B95A: + ldrh r1, [r3] + ldrh r0, [r2] + strh r0, [r3] + strh r1, [r2] + adds r3, 0x2 + subs r2, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _0815B95A + movs r2, 0x20 + add r12, r2 + adds r7, 0x40 + adds r5, 0x1 + cmp r5, 0x7 + ble _0815B950 + movs r5, 0 + movs r0, 0x80 + lsls r0, 3 + adds r3, r0, 0 +_0815B980: + adds r2, r5, 0x1 + lsls r0, r5, 6 + adds r1, r0, r6 + movs r4, 0x7 +_0815B988: + ldrh r0, [r1] + eors r0, r3 + strh r0, [r1] + adds r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _0815B988 + adds r5, r2, 0 + cmp r5, 0x7 + ble _0815B980 +_0815B99C: + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r0, [r0, 0x2] + bl sub_80DB2A8 + lsls r0, 24 + cmp r0, 0 + beq _0815B9EC + ldr r3, =0x02020630 + ldr r4, =0x020241e4 + ldr r2, =0x02038436 + ldrb r0, [r2] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x10 + adds r0, r1 + ldr r1, =gUnknown_082FF6C0 + b _0815BA06 + .pool +_0815B9EC: + ldr r3, =0x02020630 + ldr r4, =0x020241e4 + ldr r2, =0x02038436 + ldrb r0, [r2] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x10 + adds r0, r1 + ldr r1, =gUnknown_082FF694 +_0815BA06: + str r1, [r0] + ldrb r0, [r2] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0 + bl StartObjectRotScalAnim +_0815BA1C: + ldr r0, =0x03005e00 + mov r1, r9 + add r1, r8 + lsls r1, 3 + adds r1, r0 +_0815BA26: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0815BAFC + .pool +_0815BA44: + mov r1, r8 + lsls r0, r1, 2 + add r0, r8 + lsls r0, 3 + adds r4, r0, r3 + ldrh r0, [r4, 0xC] + adds r1, r0, 0x1 + strh r1, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815BAFC + movs r0, 0 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + ldrh r5, [r4, 0xA] + lsls r1, r5, 4 + orrs r1, r5 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x4C + bl SetGpuReg + cmp r5, 0 + bne _0815BAFC +_0815BA7A: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815BAFC +_0815BA82: + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815BAAC + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0 + bl lcd_bg_operations + b _0815BAB6 + .pool +_0815BAAC: + movs r0, 0x2 + movs r1, 0x2 + movs r2, 0 + bl lcd_bg_operations +_0815BAB6: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0815BAF6 + ldr r4, =0x02038436 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815BAF6 + ldr r0, =0x03005e00 + mov r2, r8 + lsls r1, r2, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r6, 0x1C + ldrsh r0, [r1, r6] + cmp r0, 0 + bne _0815BAF6 + ldrb r0, [r4] + ldr r1, =0x020244d0 + ldr r1, [r1] + ldr r2, [r1] + lsls r1, r0, 2 + adds r1, r2 + ldrh r1, [r1, 0x2] + bl sub_805EE54 +_0815BAF6: + mov r0, r8 + bl move_anim_task_del +_0815BAFC: + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815B7D0 + + thumb_func_start c3_80DFBE4 +c3_80DFBE4: @ 815BB18 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x0203841e + ldr r3, =0x02020630 + ldr r2, =0x020241e4 + ldr r1, =0x02038436 + ldrb r1, [r1] + adds r1, r2 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r3 + adds r1, 0x3E + ldrb r1, [r1] + lsls r1, 29 + lsrs r1, 31 + strh r1, [r4, 0xE] + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end c3_80DFBE4 + + thumb_func_start sub_815BB58 +sub_815BB58: @ 815BB58 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x02038436 + ldrb r0, [r0] + ldr r1, =0x02038437 + ldrb r1, [r1] + movs r2, 0x1 + bl sub_805E448 + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815BB58 + + thumb_func_start sub_815BB84 +sub_815BB84: @ 815BB84 + push {r4,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + 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 _0815BBA2 + b _0815BDF2 +_0815BBA2: + lsls r0, 2 + ldr r1, =_0815BBB4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815BBB4: + .4byte _0815BBC8 + .4byte _0815BCB8 + .4byte _0815BD08 + .4byte _0815BD72 + .4byte _0815BDA6 +_0815BBC8: + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0815BC02 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations +_0815BC02: + mov r0, sp + bl sub_80A6B30 + ldr r1, =gUnknown_08C2A6EC + mov r0, sp + movs r2, 0 + bl sub_80A6D60 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0815BC34 + ldr r1, =0x02022e18 + ldr r3, =0x0000ffc8 + b _0815BC5C + .pool +_0815BC34: + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0815BC58 + ldr r1, =0x02022e18 + ldr r2, =0x0000ff79 + adds r0, r2, 0 + b _0815BC5E + .pool +_0815BC58: + ldr r1, =0x02022e18 + ldr r3, =0x0000fff6 +_0815BC5C: + adds r0, r3, 0 +_0815BC5E: + strh r0, [r1] + ldr r1, =0x02022e1a + movs r0, 0 + strh r0, [r1] + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, =gUnknown_08C2A634 + mov r2, sp + ldrh r2, [r2, 0xA] + bl sub_80A6CC0 + ldr r0, =gUnknown_08C2A6D4 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl decompress_palette + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =0x02022e18 + ldrh r0, [r0] + strh r0, [r1, 0x1C] + ldr r0, =0x02022e1a + ldrh r0, [r0] + strh r0, [r1, 0x1E] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + b _0815BD8E + .pool +_0815BCB8: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0x10] + adds r1, r0, 0x1 + strh r1, [r4, 0x10] + lsls r0, 16 + cmp r0, 0 + bgt _0815BCCE + b _0815BDF2 +_0815BCCE: + movs r0, 0 + strh r0, [r4, 0x10] + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + ble _0815BCE4 + movs r0, 0xC + strh r0, [r4, 0xA] +_0815BCE4: + ldrh r0, [r4, 0xA] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0xC + bne _0815BDF2 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815BDF2 +_0815BD08: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r2 + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bge _0815BD20 + movs r0, 0 + strh r0, [r4, 0xA] +_0815BD20: + ldrh r0, [r4, 0xA] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0815BDF2 + ldr r2, =0x02022e18 + ldr r1, =gUnknown_085CE460 + movs r3, 0xC + ldrsh r0, [r4, r3] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r1, [r4, 0x1C] + adds r0, r1 + strh r0, [r2] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _0815BD6C + strh r0, [r4, 0x8] + b _0815BDF2 + .pool +_0815BD6C: + movs r0, 0x3 + strh r0, [r4, 0x8] + b _0815BDF2 +_0815BD72: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r2 + ldrh r0, [r1, 0xE] + adds r0, 0x1 + strh r0, [r1, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _0815BDF2 + movs r0, 0 + strh r0, [r1, 0xE] + movs r0, 0x1 +_0815BD8E: + strh r0, [r1, 0x8] + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xE4 + bl audio_play_and_stuff + b _0815BDF2 +_0815BDA6: + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + bl sub_80A6C68 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0815BDC8 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_0815BDC8: + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + ldr r0, =0x02022e18 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e1a + strh r1, [r0] + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r4, 0 + bl move_anim_task_del +_0815BDF2: + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815BB84 + + thumb_func_start sub_815BE04 +sub_815BE04: @ 815BE04 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r7, r0, 0 + bl GenerateRandomNumber2 + lsls r0, 16 + movs r1, 0xFC + lsls r1, 14 + ands r1, r0 + lsrs r5, r1, 16 + adds r1, r5, 0 + cmp r1, 0x1F + ble _0815BE2E + movs r0, 0x20 + subs r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 +_0815BE2E: + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, r5 + strh r0, [r7, 0x20] + ldrb r0, [r4] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x20 + strh r0, [r7, 0x22] + ldr r1, =0x0203841e + ldrh r0, [r1] + strh r0, [r7, 0x30] + ldrh r0, [r1, 0x2] + strh r0, [r7, 0x32] + ldr r4, =gUnknown_085CE48C + movs r0, 0x20 + ldrsh r1, [r7, r0] + movs r0, 0x22 + ldrsh r2, [r7, r0] + adds r5, r7, 0 + adds r5, 0x43 + ldrb r3, [r5] + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + bl AddObjectToFront + mov r9, r0 + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + movs r0, 0x20 + ldrsh r1, [r7, r0] + movs r0, 0x22 + ldrsh r2, [r7, r0] + ldrb r3, [r5] + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + bl AddObjectToFront + mov r8, r0 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + mov r0, r9 + lsls r2, r0, 4 + add r2, r9 + lsls r2, 2 + ldr r1, =0x02020630 + mov r10, r1 + adds r5, r2, r1 + adds r0, r5, 0 + movs r1, 0x1 + str r2, [sp] + bl StartObjectImageAnim + mov r0, r8 + lsls r6, r0, 4 + add r6, r8 + lsls r6, 2 + mov r1, r10 + adds r4, r6, r1 + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectImageAnim + ldr r1, =0x0203841e + ldrh r0, [r1] + strh r0, [r5, 0x30] + ldrh r0, [r1, 0x2] + strh r0, [r5, 0x32] + ldrh r0, [r1] + strh r0, [r4, 0x30] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x32] + ldr r0, =0x0000ffff + strh r0, [r5, 0x3C] + movs r0, 0x1 + negs r0, r0 + strh r0, [r4, 0x3C] + adds r5, 0x3E + ldrb r0, [r5] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r5] + adds r4, 0x3E + ldrb r0, [r4] + orrs r0, r1 + strb r0, [r4] + movs r0, 0x1C + add r10, r0 + ldr r2, [sp] + add r2, r10 + ldr r0, =sub_815C050 + str r0, [r2] + add r6, r10 + str r0, [r6] + mov r1, r9 + strh r1, [r7, 0x3A] + mov r0, r8 + strh r0, [r7, 0x3C] + ldr r0, =sub_815BF44 + str r0, [r7, 0x1C] + 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_815BE04 + + thumb_func_start sub_815BF44 +sub_815BF44: @ 815BF44 + push {lr} + adds r3, r0, 0 + ldrh r2, [r3, 0x32] + ldrh r0, [r3, 0x34] + adds r2, r0 + lsls r0, r2, 16 + asrs r0, 24 + ldrh r1, [r3, 0x26] + subs r1, r0 + strh r1, [r3, 0x26] + movs r0, 0xFF + ands r2, r0 + strh r2, [r3, 0x34] + movs r2, 0x36 + ldrsh r0, [r3, r2] + cmp r0, 0 + bne _0815BF92 + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x8 + negs r1, r1 + cmp r0, r1 + bge _0815BF92 + ldr r2, =0x02020630 + movs r0, 0x3A + ldrsh r1, [r3, r0] + 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] + ldrh r0, [r3, 0x36] + adds r0, 0x1 + strh r0, [r3, 0x36] +_0815BF92: + movs r1, 0x36 + ldrsh r0, [r3, r1] + cmp r0, 0x1 + bne _0815BFC6 + movs r2, 0x26 + ldrsh r1, [r3, r2] + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + bge _0815BFC6 + ldr r2, =0x02020630 + movs r0, 0x3C + ldrsh r1, [r3, r0] + 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] + ldrh r0, [r3, 0x36] + adds r0, 0x1 + strh r0, [r3, 0x36] +_0815BFC6: + ldrh r0, [r3, 0x30] + subs r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0815BFE8 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_815BFF4 + str r0, [r3, 0x1C] +_0815BFE8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_815BF44 + + thumb_func_start sub_815BFF4 +sub_815BFF4: @ 815BFF4 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r5, =0x02020630 + movs r0, 0x3A + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r3, r0, 2 + adds r6, r5, 0 + adds r6, 0x1C + adds r0, r3, r6 + ldr r2, [r0] + ldr r0, =DummyObjectCallback + cmp r2, r0 + bne _0815C040 + movs r1, 0x3C + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldr r0, [r1] + cmp r0, r2 + bne _0815C040 + adds r0, r3, r5 + bl RemoveObjectAndFreeTiles + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + adds r0, r4, 0 + bl move_anim_8072740 +_0815C040: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815BFF4 + + thumb_func_start sub_815C050 +sub_815C050: @ 815C050 + push {lr} + adds r3, r0, 0 + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _0815C09C + ldrh r2, [r3, 0x32] + ldrh r1, [r3, 0x34] + adds r2, r1 + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r3, 0x26] + subs r0, r1 + strh r0, [r3, 0x26] + movs r0, 0xFF + ands r2, r0 + strh r2, [r3, 0x34] + ldrh r0, [r3, 0x30] + subs r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0815C09C + mov r1, r12 + ldrb r0, [r1] + movs r1, 0x4 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + ldr r0, =DummyObjectCallback + str r0, [r3, 0x1C] +_0815C09C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_815C050 + + thumb_func_start sub_815C0A4 +sub_815C0A4: @ 815C0A4 + push {r4-r6,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r4, r1, 0 + cmp r0, 0x5 + bls _0815C0C2 + b _0815C396 +_0815C0C2: + lsls r0, 2 + ldr r1, =_0815C0D4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815C0D4: + .4byte _0815C0EC + .4byte _0815C224 + .4byte _0815C2AC + .4byte _0815C2E2 + .4byte _0815C310 + .4byte _0815C34A +_0815C0EC: + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x00000d03 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0815C124 + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations +_0815C124: + mov r0, sp + bl sub_80A6B30 + ldr r1, =gUnknown_08C2A6EC + mov r0, sp + movs r2, 0 + bl sub_80A6D60 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0815C15C + ldr r1, =0x02022e18 + ldr r3, =0x0000ffc8 + adds r0, r3, 0 + b _0815C1CA + .pool +_0815C15C: + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r4, r0, 24 + bl battle_type_is_double + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815C1B4 + cmp r4, 0x1 + bne _0815C180 + ldr r1, =0x02022e18 + ldr r2, =0x0000ff65 + adds r0, r2, 0 + strh r0, [r1] +_0815C180: + cmp r4, 0x3 + bne _0815C18C + ldr r1, =0x02022e18 + ldr r3, =0x0000ff8d + adds r0, r3, 0 + strh r0, [r1] +_0815C18C: + cmp r4, 0 + bne _0815C196 + ldr r1, =0x02022e18 + movs r0, 0xE + strh r0, [r1] +_0815C196: + cmp r4, 0x2 + bne _0815C1CC + ldr r1, =0x02022e18 + ldr r2, =0x0000ffec + b _0815C1C8 + .pool +_0815C1B4: + cmp r4, 0x1 + bne _0815C1C0 + ldr r1, =0x02022e18 + ldr r3, =0x0000ff79 + adds r0, r3, 0 + strh r0, [r1] +_0815C1C0: + cmp r4, 0 + bne _0815C1CC + ldr r1, =0x02022e18 + ldr r2, =0x0000fff6 +_0815C1C8: + adds r0, r2, 0 +_0815C1CA: + strh r0, [r1] +_0815C1CC: + ldr r1, =0x02022e1a + movs r0, 0 + strh r0, [r1] + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, =gUnknown_08C2A634 + mov r2, sp + ldrh r2, [r2, 0xA] + bl sub_80A6CC0 + ldr r0, =gUnknown_08C2A6D4 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl decompress_palette + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =0x02022e18 + ldrh r0, [r0] + strh r0, [r1, 0x1C] + ldr r0, =0x02022e1a + ldrh r0, [r0] + strh r0, [r1, 0x1E] + b _0815C2A4 + .pool +_0815C224: + ldr r1, =0x03005e00 + lsls r4, r6, 2 + adds r0, r4, r6 + lsls r0, 3 + adds r5, r0, r1 + movs r0, 0 + strh r0, [r5, 0xE] + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815C268 + ldr r2, =0x02022e18 + ldr r1, =gUnknown_085CE4A4 + movs r3, 0xC + ldrsh r0, [r5, r3] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r5, [r5, 0x1C] + adds r0, r5 + b _0815C27A + .pool +_0815C268: + ldr r2, =0x02022e18 + ldr r1, =gUnknown_085CE4A4 + movs r3, 0xC + ldrsh r0, [r5, r3] + adds r0, r1 + movs r1, 0 + ldrsb r1, [r0, r1] + ldrh r0, [r5, 0x1C] + subs r0, r1 +_0815C27A: + strh r0, [r2] + ldr r0, =0x03005e00 + adds r1, r4, r6 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0xC] + adds r0, 0x1 + strh r0, [r1, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _0815C2A4 + strh r0, [r1, 0x8] + b _0815C396 + .pool +_0815C2A4: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0815C396 +_0815C2AC: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r4 + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bgt _0815C2C6 + movs r0, 0x5 + strh r0, [r4, 0xA] +_0815C2C6: + ldrh r1, [r4, 0xA] + lsls r1, 8 + movs r0, 0x3 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x5 + bne _0815C396 + b _0815C302 +_0815C2E2: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r4 + ldrh r1, [r4, 0xE] + adds r1, 0x1 + strh r1, [r4, 0xE] + lsls r1, 16 + asrs r1, 16 + ldr r2, =gUnknown_085CE4A8 + movs r3, 0xC + ldrsh r0, [r4, r3] + adds r0, r2 + ldrb r0, [r0] + cmp r1, r0 + ble _0815C396 +_0815C302: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815C396 + .pool +_0815C310: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r4 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD + ble _0815C32A + movs r0, 0xD + strh r0, [r4, 0xA] +_0815C32A: + ldrh r1, [r4, 0xA] + lsls r1, 8 + movs r0, 0x3 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0xD + bne _0815C396 + movs r0, 0x1 + strh r0, [r4, 0x8] + b _0815C396 +_0815C34A: + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + bl sub_80A6C68 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0815C36C + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_0815C36C: + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + ldr r0, =0x02022e18 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e1a + strh r1, [r0] + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + adds r0, r6, 0 + bl move_anim_task_del +_0815C396: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815C0A4 + + thumb_func_start sub_815C3A8 +sub_815C3A8: @ 815C3A8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815C3E8 + movs r0, 0 + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_085CE4B0 + adds r0, r4, 0 + bl sub_80A7CFC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815C3FA + .pool +_0815C3E8: + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _0815C3FA + adds r0, r5, 0 + bl move_anim_task_del +_0815C3FA: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815C3A8 + + thumb_func_start sub_815C400 +sub_815C400: @ 815C400 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + movs r2, 0x2E + ldrsh r1, [r4, r2] + cmp r1, 0 + bne _0815C41E + adds r0, r4, 0 + movs r1, 0 + bl sub_80A69CC + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0815C472 +_0815C41E: + adds r0, 0x1 + strh r0, [r4, 0x2E] + cmp r1, 0x14 + ble _0815C472 + ldrh r0, [r4, 0x30] + adds r0, 0xA0 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x32] + adds r0, 0x80 + strh r0, [r4, 0x32] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0815C450 + ldrh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 24 + negs r0, r0 + b _0815C456 + .pool +_0815C450: + ldrh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 24 +_0815C456: + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + ble _0815C472 + adds r0, r4, 0 + bl move_anim_8072740 +_0815C472: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815C400 + + thumb_func_start sub_815C478 +sub_815C478: @ 815C478 + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + ldr r5, =0x0203841e + movs r1, 0x2 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0815C4A4 + adds r0, r2, 0 + bl move_anim_task_del + b _0815C538 + .pool +_0815C4A4: + movs r1, 0x4 + ldrsh r0, [r5, r1] + cmp r0, 0 + bge _0815C4B0 + movs r0, 0 + strh r0, [r5, 0x4] +_0815C4B0: + movs r1, 0x4 + ldrsh r0, [r5, r1] + cmp r0, 0x2 + ble _0815C4BC + movs r0, 0x2 + strh r0, [r5, 0x4] +_0815C4BC: + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0xA] + strh r0, [r4, 0xC] + movs r0, 0x4 + ldrsh r1, [r5, r0] + lsls r1, 1 + movs r0, 0x8 + subs r0, r1 + strh r0, [r4, 0xE] + movs r1, 0x4 + ldrsh r0, [r5, r1] + lsls r0, 7 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r0, [r4, 0x10] + ldrh r0, [r5, 0x4] + adds r0, 0x2 + strh r0, [r4, 0x12] + ldrh r0, [r5, 0x2] + subs r0, 0x1 + strh r0, [r4, 0x14] + ldrb r0, [r5] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0815C508 + ldr r0, =0x02038436 + b _0815C50A + .pool +_0815C508: + ldr r0, =0x02038437 +_0815C50A: + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815C528 + movs r1, 0x10 + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0x10] + movs r1, 0x12 + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0x12] +_0815C528: + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_80A7270 + ldr r0, =sub_815C548 + str r0, [r4] +_0815C538: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815C478 + + thumb_func_start sub_815C548 +sub_815C548: @ 815C548 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r6, [r4, r0] + cmp r6, 0x1 + beq _0815C5D0 + cmp r6, 0x1 + bgt _0815C570 + cmp r6, 0 + beq _0815C57C + b _0815C6A8 + .pool +_0815C570: + cmp r6, 0x2 + beq _0815C628 + cmp r6, 0x3 + bne _0815C57A + b _0815C698 +_0815C57A: + b _0815C6A8 +_0815C57C: + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x12] + ldrh r2, [r0, 0x24] + adds r1, r2 + strh r1, [r0, 0x24] + ldrh r0, [r4, 0xC] + ldrh r1, [r4, 0x10] + subs r0, r1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0xC] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A73A0 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + movs r2, 0xE + ldrsh r1, [r4, r2] + cmp r0, r1 + blt _0815C6A8 + strh r6, [r4, 0xA] + b _0815C690 + .pool +_0815C5D0: + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x24] + ldrh r2, [r4, 0x12] + subs r1, r2 + strh r1, [r0, 0x24] + ldrh r0, [r4, 0x10] + ldrh r1, [r4, 0xC] + adds r0, r1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0xC] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A73A0 + ldrh r1, [r4, 0xA] + adds r1, 0x1 + strh r1, [r4, 0xA] + lsls r1, 16 + asrs r1, 16 + movs r2, 0xE + ldrsh r0, [r4, r2] + lsls r0, 1 + cmp r1, r0 + blt _0815C6A8 + movs r0, 0 + strh r0, [r4, 0xA] + b _0815C690 + .pool +_0815C628: + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r4, 0x12] + ldrh r2, [r0, 0x24] + adds r1, r2 + movs r5, 0 + strh r1, [r0, 0x24] + ldrh r0, [r4, 0xC] + ldrh r1, [r4, 0x10] + subs r0, r1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r4, 0xC] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A73A0 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + movs r2, 0xE + ldrsh r1, [r4, r2] + cmp r0, r1 + blt _0815C6A8 + ldrh r1, [r4, 0x14] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0815C690 + subs r0, r1, 0x1 + strh r0, [r4, 0x14] + strh r5, [r4, 0xA] + strh r5, [r4, 0x8] + b _0815C6A8 + .pool +_0815C690: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815C6A8 +_0815C698: + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A7344 + adds r0, r5, 0 + bl move_anim_task_del +_0815C6A8: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_815C548 + + thumb_func_start sub_815C6B0 +sub_815C6B0: @ 815C6B0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0815C6D4 + strh r0, [r4, 0x20] + ldr r1, =0x0203841e + ldrh r0, [r1] + b _0815C6DE + .pool +_0815C6D4: + movs r0, 0xF0 + strh r0, [r4, 0x20] + ldr r1, =0x0203841e + ldrh r0, [r1] + subs r0, 0x1E +_0815C6DE: + strh r0, [r4, 0x22] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x32] + ldrb r1, [r1, 0x2] + adds r0, r4, 0 + bl StartObjectImageAnim + ldr r0, =sub_815C700 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815C6B0 + + thumb_func_start sub_815C700 +sub_815C700: @ 815C700 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x3 + strh r0, [r4, 0x2E] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0815C744 + ldrh r1, [r4, 0x20] + adds r1, 0x5 + strh r1, [r4, 0x20] + ldrh r0, [r4, 0x22] + subs r0, 0x1 + strh r0, [r4, 0x22] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0xF0 + ble _0815C732 + adds r0, r4, 0 + bl move_anim_8072740 +_0815C732: + ldrh r1, [r4, 0x2E] + movs r0, 0xFF + ands r0, r1 + movs r1, 0x10 + bl sine + b _0815C768 + .pool +_0815C744: + ldrh r1, [r4, 0x20] + subs r1, 0x5 + strh r1, [r4, 0x20] + ldrh r0, [r4, 0x22] + adds r0, 0x1 + strh r0, [r4, 0x22] + lsls r1, 16 + cmp r1, 0 + bge _0815C75C + adds r0, r4, 0 + bl move_anim_8072740 +_0815C75C: + ldrh r1, [r4, 0x2E] + movs r0, 0xFF + ands r0, r1 + movs r1, 0x10 + bl cosine +_0815C768: + strh r0, [r4, 0x26] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815C700 + + thumb_func_start sub_815C770 +sub_815C770: @ 815C770 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0xA] + strh r0, [r4, 0xC] + strh r0, [r4, 0xE] + movs r0, 0x20 + strh r0, [r4, 0x20] + movs r0, 0x40 + strh r0, [r4, 0x22] + movs r0, 0x80 + lsls r0, 4 + strh r0, [r4, 0x24] + ldr r0, =0x0203841e + ldrb r0, [r0] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + movs r1, 0 + bl sub_80A7270 + ldr r0, =sub_815C7C4 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815C770 + + thumb_func_start sub_815C7C4 +sub_815C7C4: @ 815C7C4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r7, r0, r1 + movs r1, 0x8 + ldrsh r0, [r7, r1] + mov r8, r0 + cmp r0, 0x1 + beq _0815C860 + cmp r0, 0x1 + bgt _0815C7F4 + cmp r0, 0 + beq _0815C7FC + b _0815C8DA + .pool +_0815C7F4: + mov r2, r8 + cmp r2, 0x2 + beq _0815C8C8 + b _0815C8DA +_0815C7FC: + movs r3, 0x80 + lsls r3, 2 + adds r0, r3, 0 + ldrh r1, [r7, 0xC] + adds r2, r0, r1 + strh r2, [r7, 0xC] + lsls r0, r2, 16 + asrs r0, 16 + ldrh r3, [r7, 0x24] + mov r8, r3 + movs r3, 0x24 + ldrsh r1, [r7, r3] + cmp r0, r1 + blt _0815C8DA + mov r0, r8 + subs r5, r0, r2 + lsls r5, 16 + asrs r5, 16 + adds r6, r1, 0 + lsls r6, 1 + adds r0, r5, 0 + adds r1, r6, 0 + bl __divsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + adds r1, r6, 0 + bl __modsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 16 + asrs r4, 16 + movs r1, 0x1 + ands r4, r1 + cmp r4, 0 + bne _0815C854 + lsls r0, 16 + asrs r0, 16 + mov r2, r8 + subs r0, r2, r0 + b _0815C8B2 +_0815C854: + lsls r0, 16 + asrs r0, 16 + mov r3, r8 + subs r0, r3 + strh r0, [r7, 0xC] + b _0815C8DA +_0815C860: + ldr r1, =0xfffffe00 + adds r0, r1, 0 + ldrh r2, [r7, 0xC] + adds r1, r0, r2 + strh r1, [r7, 0xC] + movs r3, 0xC + ldrsh r0, [r7, r3] + movs r2, 0x24 + ldrsh r6, [r7, r2] + cmn r0, r6 + bgt _0815C8DA + ldrh r3, [r7, 0x24] + mov r9, r3 + mov r0, r9 + subs r4, r0, r1 + lsls r4, 16 + asrs r4, 16 + lsls r6, 1 + adds r0, r4, 0 + adds r1, r6, 0 + bl __divsi3 + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + adds r1, r6, 0 + bl __modsi3 + lsls r0, 16 + lsrs r2, r0, 16 + mov r1, r8 + ands r1, r5 + lsls r0, r1, 16 + asrs r1, r0, 16 + cmp r1, 0 + bne _0815C8BC + lsls r0, r2, 16 + asrs r0, 16 + mov r2, r9 + subs r0, r2 +_0815C8B2: + strh r0, [r7, 0xC] + strh r1, [r7, 0x8] + b _0815C8DA + .pool +_0815C8BC: + lsls r0, r2, 16 + asrs r0, 16 + mov r3, r9 + subs r0, r3, r0 + strh r0, [r7, 0xC] + b _0815C8DA +_0815C8C8: + ldrh r0, [r7, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A7344 + adds r0, r4, 0 + bl move_anim_task_del + b _0815C950 +_0815C8DA: + ldrh r0, [r7, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + ldrh r3, [r7, 0xC] + adds r1, r2, 0 + bl obj_id_set_rotscale + ldrh r0, [r7, 0x26] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A73A0 + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + movs r2, 0xC + ldrsh r0, [r7, r2] + cmp r0, 0 + bge _0815C90E + adds r0, 0x3F +_0815C90E: + asrs r0, 6 + negs r0, r0 + strh r0, [r1, 0x24] + ldrh r0, [r7, 0xA] + adds r0, 0x1 + strh r0, [r7, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _0815C950 + ldrh r1, [r7, 0x20] + movs r3, 0x20 + ldrsh r0, [r7, r3] + cmp r0, 0 + beq _0815C94C + subs r0, r1, 0x1 + strh r0, [r7, 0x20] + ldrh r0, [r7, 0x24] + ldrh r1, [r7, 0x22] + subs r0, r1 + strh r0, [r7, 0x24] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + bgt _0815C950 + movs r0, 0x10 + strh r0, [r7, 0x24] + b _0815C950 + .pool +_0815C94C: + movs r0, 0x2 + strh r0, [r7, 0x8] +_0815C950: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_815C7C4 + + thumb_func_start sub_815C95C +sub_815C95C: @ 815C95C + push {r4-r6,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0815C9BC + ldr r6, =0x0203841e + movs r2, 0x4 + ldrsh r0, [r6, r2] + cmp r0, 0 + bne _0815C990 + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] +_0815C990: + ldrh r0, [r6] + ldrh r1, [r5, 0x20] + adds r0, r1 + strh r0, [r5, 0x20] + ldrh r1, [r6, 0x2] + ldrh r2, [r5, 0x22] + adds r0, r1, r2 + strh r0, [r5, 0x22] + movs r0, 0x80 + strh r0, [r5, 0x30] + movs r0, 0xC0 + lsls r0, 2 + strh r0, [r5, 0x32] + strh r1, [r5, 0x34] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + b _0815CA1A + .pool +_0815C9BC: + ldrh r1, [r5, 0x30] + lsls r0, r1, 16 + asrs r0, 24 + strh r0, [r5, 0x24] + ldrh r0, [r5, 0x32] + lsls r0, 16 + asrs r0, 24 + ldrh r2, [r5, 0x26] + adds r0, r2 + strh r0, [r5, 0x26] + movs r2, 0x36 + ldrsh r0, [r5, r2] + adds r4, r1, 0 + cmp r0, 0 + bne _0815C9FA + movs r0, 0x26 + ldrsh r1, [r5, r0] + movs r2, 0x34 + ldrsh r0, [r5, r2] + cmn r1, r0 + ble _0815C9FA + movs r0, 0x1 + strh r0, [r5, 0x36] + movs r1, 0x32 + ldrsh r0, [r5, r1] + negs r0, r0 + movs r1, 0x3 + bl __divsi3 + lsls r0, 1 + strh r0, [r5, 0x32] +_0815C9FA: + adds r0, r4, 0 + adds r0, 0xC0 + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x32] + adds r0, 0x80 + strh r0, [r5, 0x32] + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0815CA1A + adds r0, r5, 0 + bl move_anim_8072740 +_0815CA1A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_815C95C + + thumb_func_start sub_815CA20 +sub_815CA20: @ 815CA20 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r2, r0, r1 + movs r1, 0x8 + ldrsh r0, [r2, r1] + cmp r0, 0 + bne _0815CB2C + ldr r0, =0x0203841e + movs r3, 0 + ldrsh r1, [r0, r3] + mov r8, r0 + cmp r1, 0 + bne _0815CA5C + ldr r0, =0x02038436 + b _0815CA5E + .pool +_0815CA5C: + ldr r0, =0x02038437 +_0815CA5E: + ldrb r0, [r0] + strh r0, [r2, 0x1E] + mov r1, r8 + ldrb r0, [r1] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r4, r7, 2 + adds r0, r4, r7 + lsls r0, 3 + adds r6, r0, r1 + strh r5, [r6, 0x1C] + adds r0, r5, 0 + movs r1, 0 + bl sub_80A7270 + mov r2, r8 + movs r3, 0x2 + ldrsh r0, [r2, r3] + cmp r0, 0x1 + beq _0815CAC0 + cmp r0, 0x1 + bgt _0815CAA0 + cmp r0, 0 + beq _0815CAA8 + lsls r2, r5, 4 + b _0815CB08 + .pool +_0815CAA0: + cmp r0, 0x2 + beq _0815CACA + lsls r2, r5, 4 + b _0815CB08 +_0815CAA8: + movs r2, 0xA0 + lsls r2, 1 + adds r0, r5, 0 + movs r1, 0xE0 + movs r3, 0 + bl obj_id_set_rotscale + adds r0, r5, 0 + bl sub_80A7E6C + lsls r2, r5, 4 + b _0815CB08 +_0815CAC0: + movs r2, 0x98 + lsls r2, 1 + movs r3, 0xF0 + lsls r3, 4 + b _0815CAD2 +_0815CACA: + movs r2, 0x98 + lsls r2, 1 + movs r3, 0xF1 + lsls r3, 8 +_0815CAD2: + adds r0, r5, 0 + movs r1, 0xD0 + bl obj_id_set_rotscale + adds r0, r5, 0 + bl sub_80A7E6C + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0815CAF8 + ldrb r0, [r6, 0x1E] + bl battle_side_get_owner + lsls r0, 24 + lsls r2, r5, 4 + cmp r0, 0 + bne _0815CB08 +_0815CAF8: + ldr r0, =0x02020630 + lsls r2, r5, 4 + adds r1, r2, r5 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x26] + adds r0, 0x10 + strh r0, [r1, 0x26] +_0815CB08: + ldr r1, =0x02020630 + adds r0, r2, r5 + lsls r0, 2 + adds r0, r1 + movs r1, 0x2 + strh r1, [r0, 0x24] + ldr r0, =0x03005e00 + adds r1, r4, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0815CB78 + .pool +_0815CB2C: + ldrb r5, [r2, 0x1C] + ldrh r0, [r2, 0xC] + adds r0, 0x1 + movs r4, 0 + strh r0, [r2, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _0815CB50 + strh r4, [r2, 0xC] + ldr r0, =0x02020630 + lsls r1, r5, 4 + adds r1, r5 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x24] + negs r0, r0 + strh r0, [r1, 0x24] +_0815CB50: + ldrh r0, [r2, 0xA] + adds r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD + bne _0815CB78 + adds r0, r5, 0 + bl sub_80A7344 + ldr r1, =0x02020630 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + strh r4, [r0, 0x24] + strh r4, [r0, 0x26] + adds r0, r7, 0 + bl move_anim_task_del +_0815CB78: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815CA20 + + thumb_func_start sub_815CB88 +sub_815CB88: @ 815CB88 + push {r4,r5,lr} + adds r4, r0, 0 + bl GenerateRandomNumber2 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xC + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, r0 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + bl GenerateRandomNumber2 + ldr r5, =0x000001ff + ands r5, r0 + bl GenerateRandomNumber2 + movs r1, 0xFF + ands r1, r0 + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + beq _0815CBE0 + movs r2, 0xBC + lsls r2, 3 + adds r0, r5, r2 + b _0815CBE8 + .pool +_0815CBE0: + movs r3, 0xBC + lsls r3, 3 + adds r0, r3, 0 + subs r0, r5 +_0815CBE8: + strh r0, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0815CBFA + movs r2, 0x90 + lsls r2, 3 + adds r0, r1, r2 + b _0815CC02 +_0815CBFA: + movs r3, 0x90 + lsls r3, 3 + adds r0, r3, 0 + subs r0, r1 +_0815CC02: + strh r0, [r4, 0x30] + ldr r0, =0x0203841e + ldrh r0, [r0] + strh r0, [r4, 0x32] + lsls r0, 16 + cmp r0, 0 + bne _0815CC1C + ldr r0, =0x0000fff8 + b _0815CC1E + .pool +_0815CC1C: + movs r0, 0xF8 +_0815CC1E: + strh r0, [r4, 0x20] + movs r0, 0x68 + strh r0, [r4, 0x22] + ldr r0, =sub_815CC34 + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815CB88 + + thumb_func_start sub_815CC34 +sub_815CC34: @ 815CC34 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815CC4C + ldrh r3, [r4, 0x2E] + lsls r0, r3, 16 + asrs r0, 24 + ldrh r1, [r4, 0x24] + adds r0, r1 + b _0815CC56 +_0815CC4C: + ldrh r3, [r4, 0x2E] + lsls r1, r3, 16 + asrs r1, 24 + ldrh r0, [r4, 0x24] + subs r0, r1 +_0815CC56: + strh r0, [r4, 0x24] + ldrh r2, [r4, 0x30] + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r4, 0x26] + subs r0, r1 + strh r0, [r4, 0x26] + adds r0, r3, 0 + subs r0, 0x16 + strh r0, [r4, 0x2E] + adds r1, r2, 0 + subs r1, 0x30 + strh r1, [r4, 0x30] + lsls r0, 16 + cmp r0, 0 + bge _0815CC7A + movs r0, 0 + strh r0, [r4, 0x2E] +_0815CC7A: + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _0815CC8E + adds r0, r4, 0 + bl move_anim_8072740 +_0815CC8E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815CC34 + + thumb_func_start sub_815CC94 +sub_815CC94: @ 815CC94 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r1, =0x00001f3f + movs r0, 0x4A + bl SetGpuReg + movs r1, 0x80 + lsls r1, 8 + movs r0, 0 + bl SetGpuRegBits + ldr r0, =0x02022e24 + movs r1, 0 + strh r1, [r0] + ldr r4, =0x02022e26 + strh r1, [r4] + movs r0, 0x40 + movs r1, 0 + bl SetGpuReg + ldrh r1, [r4] + movs r0, 0x44 + bl SetGpuReg + ldr r0, =0x0203841e + ldrh r0, [r0, 0x4] + strh r0, [r5, 0x2E] + adds r0, r5, 0 + movs r1, 0 + bl sub_80A6980 + ldrb r1, [r5, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r5, 0x1] + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_815CD0C + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815CC94 + + thumb_func_start sub_815CD0C +sub_815CD0C: @ 815CD0C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0815CD4A + cmp r0, 0x1 + bgt _0815CD22 + cmp r0, 0 + beq _0815CD2C + b _0815CDAA +_0815CD22: + cmp r0, 0x2 + beq _0815CD60 + cmp r0, 0x3 + beq _0815CD82 + b _0815CDAA +_0815CD2C: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0815CDAA + b _0815CD7A +_0815CD4A: + ldrh r0, [r4, 0x2E] + subs r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + bne _0815CDAA + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80082B8 + b _0815CD7A +_0815CD60: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0815CDAA + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_0815CD7A: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + b _0815CDAA +_0815CD82: + ldr r1, =0x00003f3f + movs r0, 0x4A + bl SetGpuReg + movs r0, 0 + bl GetGpuReg + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 8 + adds r0, r2, 0 + eors r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0 + bl SetGpuReg + adds r0, r4, 0 + bl move_anim_8072740 +_0815CDAA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815CD0C + + thumb_func_start sub_815CDB4 +sub_815CDB4: @ 815CDB4 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x02038436 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x20] + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + ldr r1, =0x0203841e + ldrh r0, [r1] + strh r0, [r4, 0x2E] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x30] + ldr r1, =sub_815CDFC + str r1, [r4, 0x1C] + adds r0, r4, 0 + bl _call_via_r1 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815CDB4 + + thumb_func_start sub_815CDFC +sub_815CDFC: @ 815CDFC + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x30 + ldrsh r0, [r4, r1] + ldrh r1, [r4, 0x32] + lsls r1, 16 + asrs r1, 24 + bl sine + strh r0, [r4, 0x24] + movs r2, 0x30 + ldrsh r0, [r4, r2] + ldrh r1, [r4, 0x34] + lsls r1, 16 + asrs r1, 24 + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x9 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + lsls r1, r0, 16 + cmp r0, 0x3F + bls _0815CE36 + asrs r0, r1, 16 + cmp r0, 0xC3 + ble _0815CE48 +_0815CE36: + ldr r0, =0x02038436 + ldrb r0, [r0] + bl sub_80A82E4 + subs r0, 0x1 + b _0815CE52 + .pool +_0815CE48: + ldr r0, =0x02038436 + ldrb r0, [r0] + bl sub_80A82E4 + adds r0, 0x1 +_0815CE52: + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + movs r3, 0x38 + ldrsh r2, [r4, r3] + cmp r2, 0 + bne _0815CE98 + movs r1, 0x80 + lsls r1, 3 + adds r0, r1, 0 + ldrh r3, [r4, 0x32] + adds r0, r3 + strh r0, [r4, 0x32] + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + ldrh r3, [r4, 0x34] + adds r0, r3 + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x2E + ldrsh r1, [r4, r3] + cmp r0, r1 + bne _0815CEC8 + strh r2, [r4, 0x36] + movs r0, 0x1 + strh r0, [r4, 0x38] + b _0815CEC8 + .pool +_0815CE98: + cmp r2, 0x1 + bne _0815CEC8 + ldr r1, =0xfffffc00 + adds r0, r1, 0 + ldrh r2, [r4, 0x32] + adds r0, r2 + strh r0, [r4, 0x32] + ldr r3, =0xffffff00 + adds r0, r3, 0 + ldrh r1, [r4, 0x34] + adds r0, r1 + strh r0, [r4, 0x34] + ldrh r0, [r4, 0x36] + adds r0, 0x1 + strh r0, [r4, 0x36] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x2E + ldrsh r1, [r4, r2] + cmp r0, r1 + bne _0815CEC8 + adds r0, r4, 0 + bl move_anim_8072740 +_0815CEC8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815CDFC + + thumb_func_start sub_815CED8 +sub_815CED8: @ 815CED8 + 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, 0x18] + movs r0, 0 + bl obj_id_for_side_relative_to_move + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0815CF18 + movs r0, 0x1 + str r0, [sp, 0x1C] + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldr r1, [r0, 0x10] + mov r9, r1 + ldr r2, [r0, 0xC] + mov r8, r2 + ldrh r6, [r0, 0x2] + movs r3, 0x14 + b _0815D058 + .pool +_0815CF18: + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0815CFC4 + movs r0, 0 + str r0, [sp, 0x1C] + ldr r6, =0x0202406e + ldr r4, =0x02038437 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r7, =0x020244ec + adds r0, r7 + movs r1, 0 + bl pokemon_getattr + mov r9, r0 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + adds r0, r7 + movs r1, 0x1 + bl pokemon_getattr + mov r8, r0 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldrb r2, [r4] + ldr r1, [r0] + lsls r0, r2, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _0815CFBC + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0815CF9C + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + adds r0, r7 + b _0815CFAA + .pool +_0815CF9C: + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 +_0815CFAA: + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + b _0815CFBE + .pool +_0815CFBC: + ldrh r6, [r1, 0x2] +_0815CFBE: + movs r1, 0x14 + mov r10, r1 + b _0815D05A +_0815CFC4: + movs r2, 0x1 + str r2, [sp, 0x1C] + ldr r6, =0x0202406e + ldr r4, =0x02038437 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r7, =0x02024744 + adds r0, r7 + movs r1, 0 + bl pokemon_getattr + mov r9, r0 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + adds r0, r7 + movs r1, 0x1 + bl pokemon_getattr + mov r8, r0 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldrb r2, [r4] + ldr r1, [r0] + lsls r0, r2, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _0815D054 + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0815D03C + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + b _0815D048 + .pool +_0815D03C: + ldrb r0, [r4] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + muls r0, r5 + adds r0, r7 +_0815D048: + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + b _0815D056 +_0815D054: + ldrh r6, [r1, 0x2] +_0815D056: + ldr r3, =0x0000ffec +_0815D058: + mov r10, r3 +_0815D05A: + ldr r0, =0x02038436 + ldrb r0, [r0] + bl sub_80A8328 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r5, =0x02038436 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + mov r2, r10 + lsls r1, r2, 16 + asrs r1, 16 + adds r4, r1 + lsls r4, 16 + asrs r4, 16 + lsrs r0, 24 + str r0, [sp] + movs r0, 0x5 + str r0, [sp, 0x4] + mov r3, r9 + str r3, [sp, 0x8] + mov r0, r8 + str r0, [sp, 0xC] + ldr r0, =0x02038437 + ldrb r0, [r0] + str r0, [sp, 0x10] + movs r0, 0x1 + str r0, [sp, 0x14] + adds r0, r6, 0 + ldr r1, [sp, 0x1C] + movs r2, 0 + adds r3, r4, 0 + bl sub_80A8394 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =0x02020630 + lsls r5, r6, 4 + adds r5, r6 + lsls r5, 2 + adds r5, r0 + movs r0, 0x3 + ands r7, r0 + lsls r7, 2 + mov r8, r7 + ldrb r0, [r5, 0x5] + movs r4, 0xD + negs r4, r4 + adds r1, r4, 0 + ands r1, r0 + mov r2, r8 + orrs r1, r2 + strb r1, [r5, 0x5] + ldrb r2, [r5, 0x1] + adds r0, r4, 0 + ands r0, r2 + movs r2, 0x4 + orrs r0, r2 + strb r0, [r5, 0x1] + ldr r0, =0x00007fff + lsrs r1, 4 + lsls r1, 4 + movs r3, 0x80 + lsls r3, 1 + adds r2, r3, 0 + orrs r1, r2 + movs r2, 0x20 + bl rboxid_80040B8 + ldrb r0, [r5, 0x5] + ands r4, r0 + mov r0, r8 + orrs r4, r0 + strb r4, [r5, 0x5] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + ldr r0, =0x03005e00 + ldr r1, [sp, 0x18] + lsls r4, r1, 2 + adds r4, r1 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r4, 0xA] + movs r1, 0x10 + subs r1, r0 + lsls r1, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + strh r6, [r4, 0x8] + ldr r0, =sub_815D160 + 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_815CED8 + + thumb_func_start sub_815D160 +sub_815D160: @ 815D160 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x1C] + adds r1, r0, 0x1 + strh r1, [r4, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815D1AE + movs r0, 0 + strh r0, [r4, 0x1C] + ldrh r1, [r4, 0xA] + adds r1, 0x1 + strh r1, [r4, 0xA] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0xA + bne _0815D1AE + movs r0, 0x80 + lsls r0, 1 + strh r0, [r4, 0x1C] + strh r0, [r4, 0x1E] + ldr r0, =sub_815D1BC + str r0, [r4] +_0815D1AE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815D160 + + thumb_func_start sub_815D1BC +sub_815D1BC: @ 815D1BC + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r5, r1, r2 + ldrb r2, [r5, 0x8] + ldrh r0, [r5, 0x1C] + subs r0, 0x10 + movs r4, 0 + strh r0, [r5, 0x1C] + ldrh r0, [r5, 0x1E] + adds r0, 0x80 + strh r0, [r5, 0x1E] + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r6, r0, r1 + ldrb r2, [r6, 0x1] + lsls r1, r2, 30 + lsrs r1, 30 + movs r0, 0x2 + orrs r1, r0 + subs r0, 0x6 + ands r0, r2 + orrs r0, r1 + strb r0, [r6, 0x1] + movs r0, 0x1C + ldrsh r2, [r5, r0] + movs r0, 0x1E + ldrsh r3, [r5, r0] + str r4, [sp] + adds r0, r6, 0 + movs r1, 0x1 + bl sub_80A73E0 + ldrh r0, [r5, 0x20] + adds r0, 0x1 + strh r0, [r5, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + bne _0815D22A + adds r0, r6, 0 + bl sub_80A749C + adds r0, r6, 0 + bl sub_80A8610 + ldr r0, =sub_80A6814 + str r0, [r5] +_0815D22A: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815D1BC + + thumb_func_start sub_815D240 +sub_815D240: @ 815D240 + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r4, r1, r0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0815D26C + ldr r0, =0x02038436 + b _0815D26E + .pool +_0815D26C: + ldr r0, =0x02038437 +_0815D26E: + ldrb r5, [r0] + movs r6, 0 + strh r6, [r4, 0x8] + strh r6, [r4, 0xA] + strh r6, [r4, 0xC] + movs r0, 0x10 + strh r0, [r4, 0xE] + strh r6, [r4, 0x10] + strh r5, [r4, 0x12] + movs r0, 0x20 + strh r0, [r4, 0x14] + strh r6, [r4, 0x16] + movs r0, 0x18 + strh r0, [r4, 0x18] + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815D2A0 + movs r1, 0x18 + ldrsh r0, [r4, r1] + negs r0, r0 + strh r0, [r4, 0x18] +_0815D2A0: + adds r0, r5, 0 + bl sub_80A6190 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x22 + strh r0, [r4, 0x22] + cmp r0, 0 + bge _0815D2B4 + strh r6, [r4, 0x22] +_0815D2B4: + ldrh r0, [r4, 0x22] + adds r0, 0x42 + strh r0, [r4, 0x24] + ldr r0, =0x0203841e + ldrb r0, [r0] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x26] + adds r0, r5, 0 + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815D304 + ldr r0, =0x04000014 + str r0, [sp] + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + ldr r0, =0x02022e18 + ldrh r5, [r0] + ldr r0, =0x02022e1a + b _0815D316 + .pool +_0815D304: + ldr r0, =0x04000018 + str r0, [sp] + ldr r1, =0x00003f44 + movs r0, 0x50 + bl SetGpuReg + ldr r0, =0x02022e1c + ldrh r5, [r0] + ldr r0, =0x02022e1e +_0815D316: + ldrh r3, [r0] + movs r7, 0 + movs r2, 0 + ldr r6, =0x02038c28 + movs r0, 0xF0 + lsls r0, 3 + adds r0, r6 + mov r12, r0 +_0815D326: + lsls r2, 16 + asrs r2, 16 + lsls r1, r2, 1 + adds r0, r1, r6 + strh r5, [r0] + add r1, r12 + strh r5, [r1] + adds r0, r2, 0x1 + lsls r0, 1 + adds r1, r0, r6 + strh r3, [r1] + add r0, r12 + strh r3, [r0] + lsls r0, r7, 16 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + adds r2, 0x2 + lsls r2, 16 + lsrs r2, 16 + lsrs r7, r0, 16 + asrs r0, 16 + cmp r0, 0x9F + ble _0815D326 + ldr r0, =0xa6600001 + str r0, [sp, 0x4] + mov r1, sp + movs r2, 0 + movs r0, 0x1 + strb r0, [r1, 0x8] + mov r0, sp + strb r2, [r0, 0x9] + ldr r0, [sp] + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + bl sub_80BA038 + ldr r0, =sub_815D398 + str r0, [r4] + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815D240 + + thumb_func_start sub_815D398 +sub_815D398: @ 815D398 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r6, r0, r1 + ldrb r0, [r6, 0x12] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815D3D8 + ldr r0, =0x02022e18 + ldrh r0, [r0] + str r0, [sp, 0x4] + ldr r0, =0x02022e1a + b _0815D3E0 + .pool +_0815D3D8: + ldr r0, =0x02022e1c + ldrh r0, [r0] + str r0, [sp, 0x4] + ldr r0, =0x02022e1e +_0815D3E0: + ldrh r0, [r0] + str r0, [sp, 0x8] + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0x1 + bne _0815D3EE + b _0815D5CC +_0815D3EE: + cmp r0, 0x1 + bgt _0815D400 + cmp r0, 0 + beq _0815D40E + b _0815D63C + .pool +_0815D400: + cmp r0, 0x2 + bne _0815D406 + b _0815D5EC +_0815D406: + cmp r0, 0x3 + bne _0815D40C + b _0815D636 +_0815D40C: + b _0815D63C +_0815D40E: + movs r2, 0x24 + ldrsh r0, [r6, r2] + lsls r0, 17 + lsrs r5, r0, 16 + movs r3, 0 + str r3, [sp] + mov r9, r3 + movs r4, 0 + ldrh r0, [r6, 0xA] + adds r0, 0x2 + movs r1, 0xFF + ands r0, r1 + strh r0, [r6, 0xA] + ldrh r7, [r6, 0xA] + mov r8, r7 + movs r0, 0x14 + ldrsh r1, [r6, r0] + movs r0, 0xFC + lsls r0, 3 + bl __divsi3 + strh r0, [r6, 0x1A] + movs r1, 0x16 + ldrsh r0, [r6, r1] + lsls r0, 1 + movs r2, 0x1A + ldrsh r1, [r6, r2] + bl __divsi3 + negs r0, r0 + strh r0, [r6, 0x1C] + ldrh r0, [r6, 0x16] + strh r0, [r6, 0x1E] + lsls r0, 16 + asrs r0, 21 + lsls r0, 16 + lsrs r7, r0, 16 + strh r7, [r6, 0x20] + ldrh r2, [r6, 0x24] + lsls r3, r2, 16 + mov r12, r3 + asrs r1, r3, 16 + movs r3, 0x22 + ldrsh r0, [r6, r3] + cmp r1, r0 + ble _0815D52E + ldr r0, =0x02039b28 + mov r10, r0 + ldr r1, [sp, 0x4] + lsls r0, r1, 16 + asrs r0, 16 + str r0, [sp, 0x10] + ldr r2, [sp, 0x8] + lsls r0, r2, 16 + asrs r0, 16 + str r0, [sp, 0xC] +_0815D47E: + lsls r5, 16 + asrs r5, 16 + adds r2, r5, 0x1 + lsls r2, 1 + mov r3, r10 + ldrb r1, [r3, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r2, r0 + ldr r0, =0x02038c28 + adds r2, r0 + lsls r4, 16 + asrs r4, 16 + mov r1, r9 + lsls r0, r1, 16 + asrs r0, 16 + subs r0, r4, r0 + ldr r3, [sp, 0xC] + adds r0, r3, r0 + strh r0, [r2] + lsls r3, r5, 1 + mov r0, r10 + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + adds r3, r0 + ldr r1, =0x02038c28 + adds r3, r1 + lsls r1, r7, 16 + asrs r1, 16 + ldr r2, [sp, 0x10] + adds r1, r2, r1 + mov r7, r8 + lsls r2, r7, 16 + asrs r2, 16 + lsls r0, r2, 1 + ldr r7, =gUnknown_08329F40 + adds r0, r7 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 21 + adds r1, r0 + strh r1, [r3] + adds r2, 0xA + mov r8, r2 + movs r0, 0xFF + mov r1, r8 + ands r1, r0 + mov r8, r1 + ldrh r0, [r6, 0x1C] + ldrh r2, [r6, 0x1E] + adds r0, r2 + strh r0, [r6, 0x1E] + lsls r0, 16 + asrs r0, 21 + lsls r0, 16 + lsrs r7, r0, 16 + strh r7, [r6, 0x20] + adds r4, 0x1 + lsls r4, 16 + lsrs r4, 16 + subs r5, 0x2 + lsls r5, 16 + lsrs r5, 16 + ldr r3, [sp] + lsls r0, r3, 16 + asrs r0, 16 + ldrh r1, [r6, 0x14] + adds r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + str r2, [sp] + asrs r0, 21 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + ldr r0, =0xffff0000 + add r0, r12 + lsrs r2, r0, 16 + lsls r3, r2, 16 + mov r12, r3 + asrs r1, r3, 16 + movs r3, 0x22 + ldrsh r0, [r6, r3] + cmp r1, r0 + bgt _0815D47E +_0815D52E: + lsls r1, r2, 17 + cmp r1, 0 + blt _0815D55A + ldr r4, =0x02038c28 + ldr r7, [sp, 0x4] + lsls r0, r7, 16 + asrs r0, 16 + adds r3, r0, 0 + adds r3, 0xF0 + movs r0, 0xF0 + lsls r0, 3 + adds r5, r4, r0 +_0815D546: + asrs r2, r1, 16 + lsls r1, r2, 1 + adds r0, r1, r4 + strh r3, [r0] + adds r1, r5 + strh r3, [r1] + subs r2, 0x2 + lsls r1, r2, 16 + cmp r1, 0 + bge _0815D546 +_0815D55A: + ldrh r0, [r6, 0x14] + adds r0, 0x1 + strh r0, [r6, 0x14] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3F + ble _0815D5C2 + movs r0, 0x40 + strh r0, [r6, 0x14] + ldrh r0, [r6, 0xC] + adds r0, 0x1 + strh r0, [r6, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0815D594 + ldrh r0, [r6, 0xE] + subs r0, 0x1 + strh r0, [r6, 0xE] + b _0815D59A + .pool +_0815D594: + ldrh r0, [r6, 0x10] + adds r0, 0x1 + strh r0, [r6, 0x10] +_0815D59A: + ldrh r1, [r6, 0x10] + lsls r1, 8 + ldrh r0, [r6, 0xE] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r2, 0xE + ldrsh r1, [r6, r2] + cmp r1, 0 + bne _0815D63C + movs r3, 0x10 + ldrsh r0, [r6, r3] + cmp r0, 0x10 + bne _0815D63C + strh r1, [r6, 0xC] + strh r1, [r6, 0xE] + b _0815D62E +_0815D5C2: + ldrh r0, [r6, 0x18] + ldrh r7, [r6, 0x16] + adds r0, r7 + strh r0, [r6, 0x16] + b _0815D63C +_0815D5CC: + ldrh r0, [r6, 0xC] + adds r0, 0x1 + strh r0, [r6, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + ble _0815D63C + ldr r1, =0x02039b28 + movs r0, 0x3 + strb r0, [r1, 0x15] + movs r0, 0 + strh r0, [r6, 0xC] + b _0815D62E + .pool +_0815D5EC: + ldrh r0, [r6, 0xC] + adds r0, 0x1 + strh r0, [r6, 0xC] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0815D602 + ldrh r0, [r6, 0xE] + adds r0, 0x1 + strh r0, [r6, 0xE] + b _0815D608 +_0815D602: + ldrh r0, [r6, 0x10] + subs r0, 0x1 + strh r0, [r6, 0x10] +_0815D608: + ldrh r1, [r6, 0x10] + lsls r1, 8 + ldrh r0, [r6, 0xE] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0xE + ldrsh r0, [r6, r1] + cmp r0, 0x10 + bne _0815D63C + movs r2, 0x10 + ldrsh r0, [r6, r2] + cmp r0, 0 + bne _0815D63C + strh r0, [r6, 0xC] + strh r0, [r6, 0xE] +_0815D62E: + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + b _0815D63C +_0815D636: + adds r0, r4, 0 + bl move_anim_task_del +_0815D63C: + 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_815D398 + + thumb_func_start sub_815D64C +sub_815D64C: @ 815D64C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + movs r0, 0 + strh r0, [r4, 0x8] + ldr r0, =0x0203841e + ldrb r0, [r0] + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + strh r1, [r4, 0x26] + ldr r2, =gUnknown_085CE5F0 + adds r0, r4, 0 + bl sub_80A7CFC + ldr r0, =sub_815D694 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815D64C + + thumb_func_start sub_815D694 +sub_815D694: @ 815D694 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r2, =0x03005e00 + adds r3, r0, r2 + ldrh r0, [r3, 0x8] + adds r1, r0, 0x1 + movs r5, 0 + strh r1, [r3, 0x8] + subs r0, 0x14 + lsls r0, 16 + lsrs r0, 16 + adds r6, r2, 0 + cmp r0, 0x16 + bhi _0815D6F8 + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815D708 + strh r5, [r3, 0xA] + ldrh r0, [r3, 0xC] + adds r0, 0x1 + strh r0, [r3, 0xC] + movs r5, 0x1 + ands r0, r5 + cmp r0, 0 + bne _0815D6F8 + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000ffff + strh r1, [r0, 0x24] + b _0815D708 + .pool +_0815D6F8: + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x24] +_0815D708: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r6 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _0815D720 + adds r0, r4, 0 + bl move_anim_task_del +_0815D720: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815D694 + + thumb_func_start sub_815D72C +sub_815D72C: @ 815D72C + push {r4-r6,lr} + mov r6, r8 + push {r6} + mov r8, r0 + adds r5, r2, 0 + adds r0, r3, 0 + ldr r4, [sp, 0x14] + ldr r6, [sp, 0x18] + lsls r1, 16 + lsrs r1, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r4, 16 + lsrs r4, 16 + lsls r6, 16 + lsrs r6, 16 + mov r2, r8 + strh r1, [r2, 0x20] + strh r5, [r2, 0x22] + lsls r1, 16 + asrs r1, 16 + lsls r2, r1, 4 + mov r3, r8 + strh r2, [r3, 0x36] + lsls r5, 16 + asrs r5, 16 + lsls r2, r5, 4 + strh r2, [r3, 0x38] + lsls r0, 16 + asrs r0, 16 + subs r0, r1 + lsls r0, 4 + adds r1, r6, 0 + bl __divsi3 + mov r1, r8 + strh r0, [r1, 0x3A] + lsls r4, 16 + asrs r4, 16 + subs r4, r5 + lsls r4, 4 + adds r0, r4, 0 + adds r1, r6, 0 + bl __divsi3 + mov r2, r8 + strh r0, [r2, 0x3C] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_815D72C + + thumb_func_start sub_815D794 +sub_815D794: @ 815D794 + ldrh r1, [r0, 0x3A] + ldrh r2, [r0, 0x36] + adds r1, r2 + strh r1, [r0, 0x36] + ldrh r2, [r0, 0x3C] + ldrh r3, [r0, 0x38] + adds r2, r3 + strh r2, [r0, 0x38] + lsls r1, 16 + asrs r1, 20 + strh r1, [r0, 0x20] + lsls r2, 16 + asrs r2, 20 + strh r2, [r0, 0x22] + bx lr + thumb_func_end sub_815D794 + + thumb_func_start sub_815D7B4 +sub_815D7B4: @ 815D7B4 + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldrh r6, [r4, 0x20] + ldrh r5, [r4, 0x22] + bl sub_80A6838 + ldr r0, =0x0203841e + ldrb r1, [r0] + adds r0, r4, 0 + bl StartObjectRotScalAnim + movs r0, 0x20 + ldrsh r1, [r4, r0] + movs r0, 0x22 + ldrsh r2, [r4, r0] + lsls r6, 16 + asrs r6, 16 + lsls r5, 16 + asrs r5, 16 + str r5, [sp] + movs r0, 0x40 + str r0, [sp, 0x4] + adds r0, r4, 0 + adds r3, r6, 0 + bl sub_815D72C + movs r0, 0 + strh r0, [r4, 0x2E] + ldr r0, =sub_815D804 + str r0, [r4, 0x1C] + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815D7B4 + + thumb_func_start sub_815D804 +sub_815D804: @ 815D804 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + movs r0, 0x2E + ldrsh r4, [r5, r0] + lsls r4, 3 + movs r0, 0xFF + ands r4, r0 + adds r0, r5, 0 + bl sub_815D794 + adds r0, r4, 0 + movs r1, 0x8 + bl sine + strh r0, [r5, 0x26] + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x3A + ble _0815D86A + ldrh r0, [r5, 0x30] + adds r0, 0x1 + strh r0, [r5, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815D86A + movs r0, 0 + strh r0, [r5, 0x30] + ldrh r1, [r5, 0x32] + adds r1, 0x1 + strh r1, [r5, 0x32] + movs r0, 0x1 + ands r1, r0 + adds r3, r5, 0 + adds r3, 0x3E + lsls r1, 2 + ldrb r2, [r3] + subs r0, 0x6 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + movs r1, 0x32 + ldrsh r0, [r5, r1] + cmp r0, 0x3 + ble _0815D86A + adds r0, r5, 0 + bl move_anim_8074EE0 +_0815D86A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815D804 + + thumb_func_start sub_815D870 +sub_815D870: @ 815D870 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, =0x0203841e + ldrh r0, [r6, 0x6] + strh r0, [r5, 0x2E] + ldrb r1, [r6] + adds r0, r5, 0 + bl StartObjectRotScalAnim + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0815D896 + ldrh r0, [r6, 0x2] + negs r0, r0 + strh r0, [r6, 0x2] +_0815D896: + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r6, 0x2] + adds r0, r1 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r6, [r6, 0x4] + adds r0, r6 + strh r0, [r5, 0x22] + ldr r0, =sub_810E2C8 + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815D870 + + thumb_func_start sub_815D8D8 +sub_815D8D8: @ 815D8D8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + movs r7, 0 + ldr r2, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r3, r0, r2 + ldrh r0, [r3, 0x8] + subs r0, 0x1 + strh r0, [r3, 0x8] + movs r1, 0x14 + ldrsh r0, [r3, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + mov r8, r2 + cmp r0, 0 + beq _0815D95A + ldrh r0, [r3, 0xA] + subs r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0815D95A + movs r2, 0x1A + ldrsh r0, [r3, r2] + cmp r0, 0 + bne _0815D92C + ldrh r0, [r3, 0x10] + strh r0, [r3, 0x1A] + negs r0, r0 + strh r0, [r3, 0x10] + b _0815D92E + .pool +_0815D92C: + strh r7, [r3, 0x1A] +_0815D92E: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + mov r2, r8 + adds r1, r0, r2 + movs r2, 0x1C + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0815D94A + ldrh r0, [r1, 0x12] + strh r0, [r1, 0x1C] + negs r0, r0 + strh r0, [r1, 0x12] + b _0815D94E +_0815D94A: + movs r0, 0 + strh r0, [r1, 0x1C] +_0815D94E: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + add r0, r8 + ldrh r1, [r0, 0x22] + strh r1, [r0, 0xA] +_0815D95A: + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 3 + mov r1, r8 + adds r4, r0, r1 + ldrh r6, [r4, 0x16] + ldrh r7, [r4, 0x18] + movs r1, 0xC + ldrsh r0, [r4, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + mov r12, r2 + cmp r0, 0 + beq _0815D998 + ldr r3, =0x02020630 + movs r2, 0x26 + ldrsh r0, [r4, r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + lsrs r2, r6, 8 + ldrh r0, [r4, 0x1A] + subs r0, r2 + strh r0, [r1, 0x24] + adds r2, r3, 0 + b _0815D9AE + .pool +_0815D998: + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + lsrs r1, r6, 8 + ldrh r4, [r4, 0x1A] + adds r1, r4 + strh r1, [r0, 0x24] +_0815D9AE: + mov r1, r12 + adds r0, r1, r5 + lsls r0, 3 + mov r1, r8 + adds r4, r0, r1 + movs r1, 0xE + ldrsh r0, [r4, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0815D9E0 + movs r1, 0x26 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + lsrs r2, r7, 8 + ldrh r0, [r4, 0x1C] + subs r0, r2 + b _0815D9F2 + .pool +_0815D9E0: + movs r1, 0x26 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + lsrs r0, r7, 8 + ldrh r4, [r4, 0x1C] + adds r0, r4 +_0815D9F2: + strh r0, [r1, 0x26] + mov r2, r12 + adds r0, r2, r5 + lsls r0, 3 + add r0, r8 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0 + bgt _0815DA12 + adds r0, r5, 0 + bl DestroyTask + ldr r1, =0x020383fe + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_0815DA12: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815D8D8 + + thumb_func_start sub_815DA20 +sub_815DA20: @ 815DA20 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + movs r7, 0 + ldr r2, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r3, r0, r2 + ldrh r0, [r3, 0x8] + subs r0, 0x1 + strh r0, [r3, 0x8] + movs r1, 0x14 + ldrsh r0, [r3, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + mov r8, r2 + cmp r0, 0 + beq _0815DAA6 + ldrh r0, [r3, 0xA] + subs r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0815DAA6 + movs r2, 0x1A + ldrsh r0, [r3, r2] + cmp r0, 0 + bne _0815DA78 + ldrh r0, [r3, 0x10] + strh r0, [r3, 0x1A] + negs r0, r0 + strh r0, [r3, 0x10] + b _0815DA7A + .pool +_0815DA78: + strh r7, [r3, 0x1A] +_0815DA7A: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + mov r2, r8 + adds r1, r0, r2 + movs r2, 0x1C + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0815DA96 + ldrh r0, [r1, 0x12] + strh r0, [r1, 0x1C] + negs r0, r0 + strh r0, [r1, 0x12] + b _0815DA9A +_0815DA96: + movs r0, 0 + strh r0, [r1, 0x1C] +_0815DA9A: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + add r0, r8 + ldrh r1, [r0, 0x22] + strh r1, [r0, 0xA] +_0815DAA6: + lsls r3, r6, 2 + adds r0, r3, r6 + lsls r0, 3 + mov r1, r8 + adds r4, r0, r1 + ldrh r2, [r4, 0xC] + ldr r1, =0x00007fff + adds r0, r1, 0 + ands r0, r2 + ldrh r2, [r4, 0x16] + adds r0, r2 + lsls r5, r0, 16 + lsrs r0, r5, 16 + mov r9, r0 + ldrh r0, [r4, 0xE] + ands r1, r0 + ldrh r2, [r4, 0x18] + adds r1, r2 + lsls r1, 16 + lsrs r7, r1, 16 + movs r1, 0xC + ldrsh r0, [r4, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + mov r12, r3 + cmp r0, 0 + beq _0815DB00 + ldr r3, =0x02020630 + movs r2, 0x26 + ldrsh r0, [r4, r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + lsrs r2, r5, 24 + ldrh r0, [r4, 0x1A] + subs r0, r2 + strh r0, [r1, 0x24] + adds r2, r3, 0 + b _0815DB16 + .pool +_0815DB00: + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + lsrs r1, r5, 24 + ldrh r4, [r4, 0x1A] + adds r1, r4 + strh r1, [r0, 0x24] +_0815DB16: + mov r1, r12 + adds r0, r1, r6 + lsls r0, 3 + mov r1, r8 + adds r4, r0, r1 + movs r1, 0xE + ldrsh r0, [r4, r1] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0815DB48 + movs r1, 0x26 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + lsrs r2, r7, 8 + ldrh r0, [r4, 0x1C] + subs r0, r2 + b _0815DB5A + .pool +_0815DB48: + movs r1, 0x26 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + lsrs r0, r7, 8 + ldrh r4, [r4, 0x1C] + adds r0, r4 +_0815DB5A: + strh r0, [r1, 0x26] + mov r2, r12 + adds r0, r2, r6 + lsls r0, 3 + mov r1, r8 + adds r2, r0, r1 + mov r0, r9 + strh r0, [r2, 0x16] + strh r7, [r2, 0x18] + movs r1, 0x8 + ldrsh r0, [r2, r1] + cmp r0, 0 + bgt _0815DB80 + movs r0, 0x1E + strh r0, [r2, 0x8] + movs r0, 0 + strh r0, [r2, 0x22] + ldr r0, =sub_815D8D8 + str r0, [r2] +_0815DB80: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815DA20 + + thumb_func_start sub_815DB90 +sub_815DB90: @ 815DB90 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x03005e00 + mov r8, r0 + lsls r7, r6, 2 + adds r0, r7, r6 + lsls r0, 3 + mov r1, r8 + adds r4, r0, r1 + ldr r1, =0x020241e4 + ldr r2, =0x02038436 + ldrb r0, [r2] + adds r0, r1 + ldrb r0, [r0] + strh r0, [r4, 0x26] + ldr r5, =0x0203841e + ldrh r0, [r5] + strh r0, [r4, 0x24] + ldrh r0, [r5] + strh r0, [r4, 0x8] + ldrh r0, [r5, 0xC] + strh r0, [r4, 0x22] + movs r3, 0x6 + ldrsh r0, [r5, r3] + cmp r0, 0 + beq _0815DBD4 + ldrh r0, [r4, 0x14] + ldr r3, =0xffff8000 + adds r1, r3, 0 + orrs r0, r1 + strh r0, [r4, 0x14] +_0815DBD4: + ldrb r0, [r2] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0815DC04 + ldrh r0, [r5, 0x2] + strh r0, [r4, 0xC] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0xE] + mov r3, r8 + adds r4, r7, 0 + b _0815DC74 + .pool +_0815DC04: + movs r7, 0x2 + ldrsh r0, [r5, r7] + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0815DC20 + ldrh r1, [r5, 0x2] + ldr r0, =0x00007fff + ands r0, r1 + b _0815DC28 + .pool +_0815DC20: + ldrh r0, [r5, 0x2] + ldr r2, =0xffff8000 + adds r1, r2, 0 + orrs r0, r1 +_0815DC28: + strh r0, [r4, 0xC] + ldr r0, =0x0203841e + movs r3, 0x4 + ldrsh r1, [r0, r3] + movs r2, 0x80 + lsls r2, 8 + ands r1, r2 + adds r5, r0, 0 + cmp r1, 0 + beq _0815DC60 + ldr r3, =0x03005e00 + lsls r4, r6, 2 + adds r1, r4, r6 + lsls r1, 3 + adds r1, r3 + ldrh r2, [r5, 0x4] + ldr r0, =0x00007fff + ands r0, r2 + b _0815DC72 + .pool +_0815DC60: + ldr r3, =0x03005e00 + lsls r4, r6, 2 + adds r1, r4, r6 + lsls r1, 3 + adds r1, r3 + ldrh r2, [r5, 0x4] + ldr r7, =0xffff8000 + adds r0, r7, 0 + orrs r0, r2 +_0815DC72: + strh r0, [r1, 0xE] +_0815DC74: + adds r0, r4, r6 + lsls r0, 3 + adds r0, r3 + movs r1, 0 + strh r1, [r0, 0x18] + strh r1, [r0, 0x16] + ldrh r1, [r5, 0x8] + strh r1, [r0, 0x10] + ldrh r1, [r5, 0xA] + strh r1, [r0, 0x12] + ldr r1, =sub_815DA20 + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815DB90 + + thumb_func_start sub_815DCA4 +sub_815DCA4: @ 815DCA4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r5, r0, r1 + ldr r4, =0x0203841e + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815DCC4 + adds r0, r2, 0 + bl move_anim_task_del +_0815DCC4: + movs r0, 0 + strh r0, [r5, 0x8] + strh r0, [r5, 0xA] + strh r0, [r5, 0xC] + ldrh r0, [r4, 0x2] + strh r0, [r5, 0xE] + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815DCE8 + ldr r0, =0x02038436 + b _0815DCEA + .pool +_0815DCE8: + ldr r0, =0x02038437 +_0815DCEA: + ldrb r4, [r0] + adds r0, r4, 0 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x10] + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x12] + adds r0, r4, 0 + bl sub_80A82E4 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x14] + ldr r0, =0x0203841e + ldrb r0, [r0] + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + strh r1, [r5, 0x26] + ldr r2, =gUnknown_085CE74C + adds r0, r5, 0 + bl sub_80A7CFC + ldr r0, =sub_815DD48 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815DCA4 + + thumb_func_start sub_815DD48 +sub_815DD48: @ 815DD48 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815DD6C + cmp r0, 0x1 + beq _0815DDCC + b _0815DDDA + .pool +_0815DD6C: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bne _0815DD82 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_815DDE0 +_0815DD82: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x12 + bne _0815DD92 + adds r0, r5, 0 + movs r1, 0 + bl sub_815DDE0 +_0815DD92: + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0815DDDA + ldrh r0, [r4, 0xE] + subs r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + cmp r0, 0 + bne _0815DDB4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815DDDA +_0815DDB4: + strh r1, [r4, 0xA] + ldrh r1, [r4, 0x26] + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_085CE74C + adds r0, r4, 0 + bl sub_80A7CFC + b _0815DDDA + .pool +_0815DDCC: + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815DDDA + adds r0, r5, 0 + bl move_anim_task_del +_0815DDDA: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815DD48 + + thumb_func_start sub_815DDE0 +sub_815DDE0: @ 815DDE0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r2, =0x03005e00 + adds r4, r0, r2 + cmp r1, 0 + bne _0815DE08 + movs r1, 0x12 + movs r3, 0xEC + b _0815DE0C + .pool +_0815DE08: + movs r1, 0x1E + movs r3, 0x14 +_0815DE0C: + mov r2, sp + ldrh r0, [r4, 0x10] + subs r0, r1 + strh r0, [r2] + ldrh r0, [r4, 0x10] + subs r0, r1 + subs r0, 0x4 + strh r0, [r2, 0x2] + ldrh r0, [r4, 0x10] + adds r0, r1 + strh r0, [r2, 0x4] + ldrh r0, [r4, 0x10] + adds r0, r1 + adds r0, 0x4 + strh r0, [r2, 0x6] + add r2, sp, 0x8 + lsls r1, r3, 24 + asrs r1, 24 + ldrh r0, [r4, 0x12] + adds r0, r1 + strh r0, [r2] + ldrh r0, [r4, 0x12] + adds r0, r1 + adds r0, 0x6 + strh r0, [r2, 0x2] + movs r5, 0 + mov r8, r2 + ldr r7, =0x02020630 +_0815DE44: + lsls r0, r5, 1 + add r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0x1 + ands r0, r5 + lsls r0, 1 + add r0, r8 + movs r3, 0 + ldrsh r2, [r0, r3] + ldrb r3, [r4, 0x14] + subs r3, 0x5 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =gUnknown_085CE76C + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _0815DE98 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r7 + movs r0, 0 + strh r0, [r1, 0x2E] + movs r0, 0x2 + cmp r5, 0x1 + bhi _0815DE86 + movs r2, 0x2 + negs r2, r2 + adds r0, r2, 0 +_0815DE86: + strh r0, [r1, 0x30] + ldr r0, =0x0000ffff + strh r0, [r1, 0x32] + strh r6, [r1, 0x34] + movs r0, 0x2 + strh r0, [r1, 0x36] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] +_0815DE98: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _0815DE44 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815DDE0 + + thumb_func_start sub_815DEBC +sub_815DEBC: @ 815DEBC + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x32] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + ble _0815DF02 + ldr r3, =0x03005e00 + movs r0, 0x36 + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x34 + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0815DF02: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815DEBC + + thumb_func_start sub_815DF0C +sub_815DF0C: @ 815DF0C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r0, 0 + strh r0, [r4, 0x8] + ldr r1, =0x0203841e + ldrh r0, [r1, 0x2] + strh r0, [r4, 0xA] + ldrb r0, [r1] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + adds r0, r1 + strh r0, [r4, 0xC] + ldr r0, =sub_815DF64 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815DF0C + + thumb_func_start sub_815DF64 +sub_815DF64: @ 815DF64 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815DFB4 + ldrh r0, [r4, 0xC] + ldr r2, =gUnknown_085CE784 + movs r3, 0x8 + ldrsh r1, [r4, r3] + lsls r1, 1 + adds r1, r2 + ldrh r3, [r1] + movs r1, 0x10 + movs r2, 0x8 + bl pal_fade_1 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x17 + ble _0815DFA4 + movs r0, 0 + strh r0, [r4, 0x8] +_0815DFA4: + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + b _0815DFC6 + .pool +_0815DFB4: + ldrh r0, [r4, 0xC] + movs r1, 0x10 + movs r2, 0 + movs r3, 0 + bl pal_fade_1 + adds r0, r5, 0 + bl move_anim_task_del +_0815DFC6: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815DF64 + + thumb_func_start sub_815DFCC +sub_815DFCC: @ 815DFCC + push {lr} + sub sp, 0x1C + lsls r0, 24 + lsrs r0, 24 + movs r2, 0xD0 + lsls r2, 1 + ldr r1, =0x02038436 + ldrb r3, [r1] + ldr r1, =0x0203841e + ldrb r1, [r1] + str r1, [sp] + movs r1, 0xA + str r1, [sp, 0x4] + movs r1, 0x2 + str r1, [sp, 0x8] + movs r1, 0x1E + str r1, [sp, 0xC] + ldr r1, =gUnknown_08C2DC68 + str r1, [sp, 0x10] + ldr r1, =gUnknown_08C2DDC4 + str r1, [sp, 0x14] + ldr r1, =gUnknown_08C2DDA4 + str r1, [sp, 0x18] + movs r1, 0 + bl sub_8117854 + add sp, 0x1C + pop {r0} + bx r0 + .pool + thumb_func_end sub_815DFCC + + thumb_func_start sub_815E01C +sub_815E01C: @ 815E01C + push {r4-r6,lr} + adds r5, r0, 0 + ldr r6, =0x02038436 + ldrb r0, [r6] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815E038 + ldr r1, =0x0203841e + ldrh r0, [r1] + negs r0, r0 + strh r0, [r1] +_0815E038: + ldrb r0, [r6] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + ldr r4, =0x0203841e + lsrs r0, 24 + ldrh r1, [r4] + adds r0, r1 + strh r0, [r5, 0x20] + ldrb r0, [r6] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x2] + adds r0, r1 + strh r0, [r5, 0x22] + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815E080 + movs r0, 0xA0 + lsls r0, 2 + strh r0, [r5, 0x2E] + ldr r0, =0x0000fd80 + strh r0, [r5, 0x30] + b _0815E0A8 + .pool +_0815E080: + cmp r0, 0x1 + bne _0815E09A + adds r2, r5, 0 + adds r2, 0x3F + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + movs r0, 0xA0 + lsls r0, 2 + strh r0, [r5, 0x2E] + strh r0, [r5, 0x30] + b _0815E0A8 +_0815E09A: + adds r0, r5, 0 + movs r1, 0x1 + bl StartObjectImageAnim + movs r0, 0xA0 + lsls r0, 2 + strh r0, [r5, 0x2E] +_0815E0A8: + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0815E0C8 + ldrh r0, [r5, 0x2E] + negs r0, r0 + strh r0, [r5, 0x2E] + adds r2, r5, 0 + adds r2, 0x3F + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] +_0815E0C8: + ldr r0, =sub_815E0DC + str r0, [r5, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815E01C + + thumb_func_start sub_815E0DC +sub_815E0DC: @ 815E0DC + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + ldrh r1, [r2, 0x3A] + adds r0, r1 + strh r0, [r2, 0x3A] + ldrh r1, [r2, 0x30] + ldrh r3, [r2, 0x3C] + adds r1, r3 + strh r1, [r2, 0x3C] + lsls r0, 16 + asrs r0, 24 + strh r0, [r2, 0x24] + lsls r1, 16 + asrs r1, 24 + strh r1, [r2, 0x26] + ldrh r0, [r2, 0x38] + adds r0, 0x1 + strh r0, [r2, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xE + bne _0815E110 + adds r0, r2, 0 + bl move_anim_8072740 +_0815E110: + pop {r0} + bx r0 + thumb_func_end sub_815E0DC + + thumb_func_start sub_815E114 +sub_815E114: @ 815E114 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r6, r1, r0 + bl sub_80A4DF0 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _0815E144 + movs r0, 0x8 + strh r0, [r6, 0x12] + movs r0, 0x3 + strh r0, [r6, 0x14] + movs r0, 0x1 + strh r0, [r6, 0x16] + b _0815E14E + .pool +_0815E144: + movs r0, 0xC + strh r0, [r6, 0x12] + movs r0, 0x3 + strh r0, [r6, 0x14] + strh r1, [r6, 0x16] +_0815E14E: + ldr r5, =0x02038436 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0815E188 + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A861C + lsls r4, 24 + lsrs r4, 24 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0815E17C + adds r0, 0x3 +_0815E17C: + asrs r0, 2 + adds r0, r4, r0 + b _0815E1AC + .pool +_0815E188: + ldrb r0, [r5] + movs r1, 0x2 + bl sub_80A5C6C + adds r4, r0, 0 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A861C + lsls r4, 24 + lsrs r4, 24 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0815E1A8 + adds r0, 0x3 +_0815E1A8: + asrs r0, 2 + subs r0, r4, r0 +_0815E1AC: + strh r0, [r6, 0x1E] + ldr r5, =0x02038436 + ldrb r0, [r5] + movs r1, 0x3 + bl sub_80A5C6C + adds r4, r0, 0 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A861C + lsls r4, 24 + lsrs r4, 24 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0815E1D0 + adds r0, 0x3 +_0815E1D0: + asrs r0, 2 + subs r0, r4, r0 + strh r0, [r6, 0x20] + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x22] + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x24] + ldr r0, =sub_815E20C + str r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815E114 + + thumb_func_start sub_815E20C +sub_815E20C: @ 815E20C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r5, r0, r1 + movs r0, 0x8 + ldrsh r1, [r5, r0] + cmp r1, 0 + beq _0815E238 + cmp r1, 0x1 + bne _0815E230 + b _0815E330 +_0815E230: + b _0815E33E + .pool +_0815E238: + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _0815E33E + strh r1, [r5, 0xA] + movs r1, 0x1E + ldrsh r0, [r5, r1] + movs r2, 0x20 + ldrsh r1, [r5, r2] + movs r3, 0x22 + ldrsh r2, [r5, r3] + movs r4, 0x24 + ldrsh r3, [r5, r4] + ldrb r4, [r5, 0x12] + str r4, [sp] + ldrb r4, [r5, 0xC] + str r4, [sp, 0x4] + add r4, sp, 0x10 + str r4, [sp, 0x8] + adds r4, 0x2 + str r4, [sp, 0xC] + bl sub_815E34C + movs r6, 0 + mov r8, r4 + ldr r4, =0x02020630 +_0815E272: + add r0, sp, 0x10 + movs r2, 0 + ldrsh r1, [r0, r2] + mov r3, r8 + movs r0, 0 + ldrsh r2, [r3, r0] + ldr r0, =gUnknown_085CE7EC + movs r3, 0x23 + bl AddObjectToFront + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _0815E306 + movs r1, 0x16 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0815E2C6 + cmp r6, 0 + bne _0815E2B4 + lsls r2, r3, 4 + adds r1, r2, r3 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r5, 0x14] + negs r0, r0 + strh r0, [r1, 0x26] + strh r0, [r1, 0x24] + b _0815E2EE + .pool +_0815E2B4: + lsls r2, r3, 4 + adds r1, r2, r3 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r5, 0x14] + strh r0, [r1, 0x26] + ldrh r0, [r5, 0x14] + strh r0, [r1, 0x24] + b _0815E2EE +_0815E2C6: + cmp r6, 0 + bne _0815E2DC + lsls r2, r3, 4 + adds r1, r2, r3 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r5, 0x14] + negs r0, r0 + strh r0, [r1, 0x24] + ldrh r0, [r5, 0x14] + b _0815E2EC +_0815E2DC: + lsls r2, r3, 4 + adds r1, r2, r3 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r5, 0x14] + strh r0, [r1, 0x24] + ldrh r0, [r5, 0x14] + negs r0, r0 +_0815E2EC: + strh r0, [r1, 0x26] +_0815E2EE: + ldr r1, =0x02020630 + adds r0, r2, r3 + lsls r0, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x2E] + strh r7, [r0, 0x30] + movs r1, 0xA + strh r1, [r0, 0x32] + ldrh r0, [r5, 0x1C] + adds r0, 0x1 + strh r0, [r5, 0x1C] +_0815E306: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x1 + bls _0815E272 + ldrh r2, [r5, 0xC] + movs r3, 0xC + ldrsh r1, [r5, r3] + movs r4, 0x12 + ldrsh r0, [r5, r4] + cmp r1, r0 + bne _0815E324 + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_0815E324: + adds r0, r2, 0x1 + strh r0, [r5, 0xC] + b _0815E33E + .pool +_0815E330: + movs r1, 0x1C + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0815E33E + adds r0, r7, 0 + bl move_anim_task_del +_0815E33E: + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_815E20C + + thumb_func_start sub_815E34C +sub_815E34C: @ 815E34C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r4, [sp, 0x28] + ldr r5, [sp, 0x2C] + ldr r6, [sp, 0x30] + mov r9, r6 + ldr r6, [sp, 0x34] + mov r10, r6 + lsls r0, 16 + lsrs r0, 16 + mov r12, r0 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + lsls r2, 16 + lsrs r2, 16 + adds r7, r2, 0 + lsls r3, 16 + lsrs r3, 16 + str r3, [sp, 0x4] + lsls r4, 24 + lsrs r6, r4, 24 + lsls r5, 24 + lsrs r5, 24 + mov r8, r5 + cmp r5, 0 + bne _0815E394 + mov r2, r9 + strh r0, [r2] + mov r6, r10 + strh r1, [r6] + b _0815E3F2 +_0815E394: + cmp r5, r6 + bcc _0815E3A2 + mov r0, r9 + strh r2, [r0] + mov r1, r10 + strh r3, [r1] + b _0815E3F2 +_0815E3A2: + subs r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + mov r2, r12 + lsls r1, r2, 16 + asrs r1, 16 + lsls r5, r1, 8 + lsls r0, r7, 16 + asrs r0, 16 + subs r0, r1 + lsls r0, 8 + adds r1, r6, 0 + bl __divsi3 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r5, r0 + ldr r2, [sp] + lsls r1, r2, 16 + asrs r1, 16 + lsls r4, r1, 8 + ldr r2, [sp, 0x4] + lsls r0, r2, 16 + asrs r0, 16 + subs r0, r1 + lsls r0, 8 + adds r1, r6, 0 + bl __divsi3 + mov r6, r8 + muls r6, r0 + adds r0, r6, 0 + adds r4, r0 + asrs r5, 8 + mov r0, r9 + strh r5, [r0] + asrs r4, 8 + mov r1, r10 + strh r4, [r1] +_0815E3F2: + 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 sub_815E34C + + thumb_func_start sub_815E404 +sub_815E404: @ 815E404 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x24 + ble _0815E43A + ldr r3, =0x03005e00 + movs r0, 0x32 + ldrsh r1, [r4, r0] + lsls r1, 1 + movs r0, 0x30 + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0815E43A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815E404 + + thumb_func_start sub_815E444 +sub_815E444: @ 815E444 + push {r4,lr} + adds r4, r0, 0 + ldr r1, =0x0203841e + ldrh r0, [r1] + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x22] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x32] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x36] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x2E] + ldr r1, =move_anim_8072740 + adds r0, r4, 0 + bl oamt_set_x3A_32 + ldr r0, =sub_80A70C0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815E444 + + thumb_func_start sub_815E47C +sub_815E47C: @ 815E47C + 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 + lsls r0, 2 + add r0, r9 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r7, r0, r1 + ldr r0, =0x02038436 + mov r10, r0 + ldrb r0, [r0] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x1E] + mov r1, r10 + ldrb r0, [r1] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x20] + ldr r0, =0x02038437 + mov r8, r0 + ldrb r0, [r0] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x22] + mov r1, r8 + ldrb r0, [r1] + movs r1, 0x3 + bl sub_80A5C6C + adds r4, r0, 0 + mov r1, r8 + ldrb r0, [r1] + movs r1, 0 + bl sub_80A861C + lsls r4, 24 + lsrs r4, 24 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0815E4EE + adds r0, 0x3 +_0815E4EE: + asrs r0, 2 + adds r0, r4, r0 + strh r0, [r7, 0x24] + ldr r4, =gUnknown_085CE84C + movs r0, 0x1E + ldrsh r5, [r7, r0] + movs r1, 0x20 + ldrsh r6, [r7, r1] + mov r1, r8 + ldrb r0, [r1] + bl sub_80A82E4 + adds r3, r0, 0 + subs r3, 0x5 + lsls r3, 24 + lsrs r3, 24 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + strh r0, [r7, 0x26] + cmp r0, 0x40 + beq _0815E5B8 + ldr r4, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x10 + strh r1, [r0, 0x2E] + movs r0, 0x26 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r7, 0x22] + strh r1, [r0, 0x32] + movs r0, 0x26 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r7, 0x24] + strh r1, [r0, 0x36] + movs r0, 0x26 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000ffe0 + strh r1, [r0, 0x38] + movs r0, 0x26 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl sub_80A68D4 + mov r1, r10 + ldrb r0, [r1] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815E596 + movs r0, 0x26 + ldrsh r1, [r7, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartObjectRotScalAnim +_0815E596: + ldr r0, =sub_815E5CC + str r0, [r7] + b _0815E5BE + .pool +_0815E5B8: + mov r0, r9 + bl move_anim_task_del +_0815E5BE: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_815E47C + + thumb_func_start sub_815E5CC +sub_815E5CC: @ 815E5CC + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _0815E634 + cmp r1, 0x1 + bgt _0815E5F4 + cmp r1, 0 + beq _0815E5FE + b _0815E6D2 + .pool +_0815E5F4: + cmp r1, 0x2 + beq _0815E658 + cmp r1, 0x3 + beq _0815E6CC + b _0815E6D2 +_0815E5FE: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815E6D2 + strh r1, [r4, 0xA] + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl sub_80A6900 + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _0815E6D2 + b _0815E6BE + .pool +_0815E634: + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _0815E6D2 + movs r0, 0 + strh r0, [r4, 0xA] + strh r0, [r4, 0xC] + b _0815E6BE + .pool +_0815E658: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815E6D2 + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r2, [r4, 0xC] + adds r2, 0x1 + strh r2, [r4, 0xC] + ldr r5, =0x02020630 + movs r1, 0x26 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + movs r0, 0x1 + ands r2, r0 + adds r1, 0x3E + lsls r2, 2 + ldrb r3, [r1] + subs r0, 0x6 + ands r0, r3 + orrs r0, r2 + strb r0, [r1] + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _0815E6D2 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles +_0815E6BE: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815E6D2 + .pool +_0815E6CC: + adds r0, r2, 0 + bl move_anim_task_del +_0815E6D2: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815E5CC + + thumb_func_start sub_815E6D8 +sub_815E6D8: @ 815E6D8 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r0, =0x0203841e + movs r2, 0 + ldrsh r1, [r0, r2] + adds r6, r0, 0 + cmp r1, 0 + bne _0815E6F4 + ldr r0, =0x02038436 + b _0815E6F6 + .pool +_0815E6F4: + ldr r0, =0x02038437 +_0815E6F6: + ldrb r5, [r0] + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x10 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + adds r1, r6, 0 + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x3A] + movs r2, 0x2 + ldrsh r0, [r1, r2] + movs r1, 0x1 + cmp r0, 0 + bne _0815E724 + movs r3, 0x1 + negs r3, r3 + adds r1, r3, 0 +_0815E724: + strh r1, [r4, 0x3C] + adds r0, r5, 0 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x22] + movs r1, 0x2 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0815E768 + ldrb r2, [r4, 0x3] + lsls r1, r2, 26 + lsrs r1, 27 + movs r0, 0x8 + orrs r1, r0 + lsls r1, 1 + subs r0, 0x47 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x3] + adds r0, r5, 0 + movs r1, 0x4 + bl sub_80A861C + subs r0, 0x8 + b _0815E772 + .pool +_0815E768: + adds r0, r5, 0 + movs r1, 0x5 + bl sub_80A861C + adds r0, 0x8 +_0815E772: + strh r0, [r4, 0x20] + ldr r0, =sub_815E784 + str r0, [r4, 0x1C] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815E6D8 + + thumb_func_start sub_815E784 +sub_815E784: @ 815E784 + push {lr} + adds r2, r0, 0 + movs r0, 0x2E + ldrsh r1, [r2, r0] + cmp r1, 0x1 + beq _0815E7CC + cmp r1, 0x1 + bgt _0815E79A + cmp r1, 0 + beq _0815E7A4 + b _0815E83C +_0815E79A: + cmp r1, 0x2 + beq _0815E7DC + cmp r1, 0x3 + beq _0815E802 + b _0815E83C +_0815E7A4: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815E83C + strh r1, [r2, 0x30] + ldrh r0, [r2, 0x3C] + ldrh r1, [r2, 0x24] + adds r0, r1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x32] + adds r0, 0x1 + strh r0, [r2, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + bne _0815E83C + b _0815E7FA +_0815E7CC: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + bne _0815E83C + b _0815E7F6 +_0815E7DC: + movs r0, 0x3C + ldrsh r1, [r2, r0] + lsls r1, 2 + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bne _0815E83C +_0815E7F6: + movs r0, 0 + strh r0, [r2, 0x30] +_0815E7FA: + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + b _0815E83C +_0815E802: + movs r0, 0x3C + ldrsh r1, [r2, r0] + lsls r0, r1, 1 + adds r0, r1 + ldrh r1, [r2, 0x24] + adds r0, r1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + bne _0815E83C + ldrh r0, [r2, 0x3A] + subs r0, 0x1 + strh r0, [r2, 0x3A] + lsls r0, 16 + cmp r0, 0 + beq _0815E836 + movs r0, 0 + strh r0, [r2, 0x30] + ldrh r0, [r2, 0x2E] + subs r0, 0x1 + strh r0, [r2, 0x2E] + b _0815E83C +_0815E836: + adds r0, r2, 0 + bl move_anim_8072740 +_0815E83C: + pop {r0} + bx r0 + thumb_func_end sub_815E784 + + thumb_func_start sub_815E840 +sub_815E840: @ 815E840 + push {r4,lr} + lsls r0, 24 + lsrs r1, r0, 24 + ldr r2, =0x0203841e + movs r3, 0 + ldrsh r0, [r2, r3] + cmp r0, 0 + bne _0815E85C + adds r0, r1, 0 + bl move_anim_task_del + b _0815E884 + .pool +_0815E85C: + ldr r0, =0x03005e00 + lsls r4, r1, 2 + adds r4, r1 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r2, 0x2] + strh r0, [r4, 0x8] + ldrb r0, [r2] + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + strh r1, [r4, 0x26] + ldr r2, =gUnknown_085CE87C + adds r0, r4, 0 + bl sub_80A7CFC + ldr r0, =sub_815E898 + str r0, [r4] +_0815E884: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815E840 + + thumb_func_start sub_815E898 +sub_815E898: @ 815E898 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815E8F2 + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r1, [r4, 0xC] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0815E8E0 + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x2 + b _0815E8F0 + .pool +_0815E8E0: + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000fffe +_0815E8F0: + strh r1, [r0, 0x24] +_0815E8F2: + adds r0, r4, 0 + bl sub_80A7D34 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0815E94E + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x24] + ldrh r0, [r4, 0x8] + subs r0, 0x1 + strh r0, [r4, 0x8] + lsls r0, 16 + cmp r0, 0 + beq _0815E948 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r0, r1 + ldrh r1, [r0, 0x26] + lsls r1, 24 + lsrs r1, 24 + ldr r2, =gUnknown_085CE87C + bl sub_80A7CFC + strh r5, [r4, 0xA] + strh r5, [r4, 0xC] + b _0815E94E + .pool +_0815E948: + adds r0, r6, 0 + bl move_anim_task_del +_0815E94E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_815E898 + + thumb_func_start sub_815E954 +sub_815E954: @ 815E954 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0815E970 + ldr r4, =0x02038436 + b _0815E972 + .pool +_0815E970: + ldr r4, =0x02038437 +_0815E972: + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A861C + strh r0, [r5, 0x22] + movs r1, 0x22 + ldrsh r0, [r5, r1] + cmp r0, 0x7 + bgt _0815E996 + movs r0, 0x8 + strh r0, [r5, 0x22] +_0815E996: + movs r2, 0 + strh r2, [r5, 0x2E] + ldr r1, =0x0203841e + ldrh r0, [r1, 0x2] + strh r0, [r5, 0x30] + strh r2, [r5, 0x32] + ldrh r0, [r1, 0x4] + strh r0, [r5, 0x34] + ldr r0, =sub_815E9BC + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815E954 + + thumb_func_start sub_815E9BC +sub_815E9BC: @ 815E9BC + push {lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x30 + ldrsh r1, [r3, r2] + cmp r0, r1 + blt _0815EA10 + movs r0, 0 + strh r0, [r3, 0x2E] + ldrh r1, [r3, 0x32] + adds r1, 0x1 + movs r0, 0x1 + ands r1, r0 + strh r1, [r3, 0x32] + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + lsls r1, 2 + ldrb r2, [r0] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + movs r2, 0x32 + ldrsh r0, [r3, r2] + cmp r0, 0 + beq _0815EA10 + ldrh r0, [r3, 0x34] + subs r0, 0x1 + strh r0, [r3, 0x34] + lsls r0, 16 + cmp r0, 0 + bne _0815EA10 + adds r0, r3, 0 + bl move_anim_8072740 +_0815EA10: + pop {r0} + bx r0 + thumb_func_end sub_815E9BC + + thumb_func_start sub_815EA14 +sub_815EA14: @ 815EA14 + push {lr} + adds r3, r0, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0815EA44 + ldrb r2, [r3, 0x3] + lsls r1, r2, 26 + lsrs r1, 27 + movs r0, 0x8 + orrs r1, r0 + lsls r1, 1 + subs r0, 0x47 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x3] + movs r0, 0x64 + strh r0, [r3, 0x20] + movs r0, 0x1 + b _0815EA4A + .pool +_0815EA44: + movs r0, 0x8C + strh r0, [r3, 0x20] + ldr r0, =0x0000ffff +_0815EA4A: + strh r0, [r3, 0x3C] + movs r0, 0x38 + strh r0, [r3, 0x22] + ldr r0, =sub_815EA60 + str r0, [r3, 0x1C] + pop {r0} + bx r0 + .pool + thumb_func_end sub_815EA14 + + thumb_func_start sub_815EA60 +sub_815EA60: @ 815EA60 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x8 + bls _0815EA6E + b _0815EC40 +_0815EA6E: + lsls r0, 2 + ldr r1, =_0815EA7C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815EA7C: + .4byte _0815EAA0 + .4byte _0815EAD2 + .4byte _0815EAE4 + .4byte _0815EB24 + .4byte _0815EB36 + .4byte _0815EB74 + .4byte _0815EBD8 + .4byte _0815EBF8 + .4byte _0815EC1E +_0815EAA0: + movs r3, 0x3C + ldrsh r0, [r4, r3] + lsls r0, 1 + ldrh r1, [r4, 0x22] + subs r1, r0 + strh r1, [r4, 0x22] + ldrh r2, [r4, 0x30] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _0815EAC2 + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r1, 1 + ldrh r0, [r4, 0x20] + subs r0, r1 + strh r0, [r4, 0x20] +_0815EAC2: + adds r0, r2, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + beq _0815EAD0 + b _0815EC40 +_0815EAD0: + b _0815EC12 +_0815EAD2: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + beq _0815EAE2 + b _0815EC40 +_0815EAE2: + b _0815EC12 +_0815EAE4: + ldrh r2, [r4, 0x30] + adds r2, 0x1 + strh r2, [r4, 0x30] + movs r3, 0x3C + ldrsh r1, [r4, r3] + lsls r0, r1, 1 + adds r0, r1 + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r3, =gUnknown_08329F40 + movs r0, 0x30 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 19 + ldrh r1, [r4, 0x3C] + muls r0, r1 + strh r0, [r4, 0x24] + lsls r2, 16 + asrs r2, 16 + cmp r2, 0xC + beq _0815EB1C + b _0815EC40 +_0815EB1C: + b _0815EC12 + .pool +_0815EB24: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + beq _0815EB34 + b _0815EC40 +_0815EB34: + b _0815EC12 +_0815EB36: + ldrh r2, [r4, 0x30] + adds r2, 0x1 + strh r2, [r4, 0x30] + movs r1, 0x3C + ldrsh r0, [r4, r1] + lsls r1, r0, 1 + adds r1, r0 + ldrh r0, [r4, 0x22] + subs r0, r1 + strh r0, [r4, 0x22] + ldr r3, =gUnknown_08329F40 + movs r0, 0x30 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 19 + ldrh r1, [r4, 0x3C] + muls r0, r1 + strh r0, [r4, 0x24] + lsls r2, 16 + asrs r2, 16 + cmp r2, 0xC + bne _0815EC40 + b _0815EC16 + .pool +_0815EB74: + ldrh r2, [r4, 0x30] + adds r2, 0x1 + strh r2, [r4, 0x30] + movs r3, 0x3C + ldrsh r1, [r4, r3] + lsls r0, r1, 1 + adds r0, r1 + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r3, =gUnknown_08329F40 + movs r0, 0x30 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 19 + ldrh r1, [r4, 0x3C] + muls r0, r1 + strh r0, [r4, 0x24] + lsls r2, 16 + asrs r2, 16 + cmp r2, 0xF + bne _0815EBC0 + ldrh r2, [r4, 0x4] + lsls r1, r2, 22 + lsrs r1, 22 + adds r1, 0x10 + ldr r3, =0x000003ff + adds r0, r3, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] +_0815EBC0: + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x12 + bne _0815EC40 + b _0815EC12 + .pool +_0815EBD8: + movs r3, 0x3C + ldrsh r0, [r4, r3] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 1 + ldrh r0, [r4, 0x20] + adds r1, r0 + strh r1, [r4, 0x20] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + bne _0815EC40 + b _0815EC12 +_0815EBF8: + movs r1, 0x3C + ldrsh r0, [r4, r1] + lsls r0, 1 + ldrh r3, [r4, 0x20] + adds r0, r3 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _0815EC40 +_0815EC12: + movs r0, 0 + strh r0, [r4, 0x30] +_0815EC16: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0815EC40 +_0815EC1E: + movs r1, 0x3C + ldrsh r0, [r4, r1] + lsls r1, r0, 1 + adds r1, r0 + ldrh r0, [r4, 0x20] + subs r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _0815EC40 + adds r0, r4, 0 + bl move_anim_8072740 +_0815EC40: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815EA60 + + thumb_func_start sub_815EC48 +sub_815EC48: @ 815EC48 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r6, r1, r0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x26] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0815ECD0 + bl battle_type_is_double + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x1 + bne _0815ECB4 + ldr r5, =0x02038436 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r1, [r5] + movs r0, 0x2 + eors r0, r1 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + ble _0815ECAC + strh r7, [r6, 0x24] + b _0815ECD4 + .pool +_0815ECAC: + ldr r0, =0x0000ffff + b _0815ECD2 + .pool +_0815ECB4: + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0815ECD0 + ldr r0, =0x0000ffff + b _0815ECD2 + .pool +_0815ECD0: + movs r0, 0x1 +_0815ECD2: + strh r0, [r6, 0x24] +_0815ECD4: + ldr r0, =sub_815ECE4 + str r0, [r6] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815EC48 + + thumb_func_start sub_815ECE4 +sub_815ECE4: @ 815ECE4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r3, r0, r1 + movs r1, 0x8 + ldrsh r0, [r3, r1] + cmp r0, 0x8 + bls _0815ECFE + b _0815EE78 +_0815ECFE: + lsls r0, 2 + ldr r1, =_0815ED10 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815ED10: + .4byte _0815ED34 + .4byte _0815ED46 + .4byte _0815ED78 + .4byte _0815EDA8 + .4byte _0815EDCE + .4byte _0815EDF8 + .4byte _0815EE08 + .4byte _0815EE28 + .4byte _0815EE60 +_0815ED34: + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD + beq _0815ED44 + b _0815EE78 +_0815ED44: + b _0815EE50 +_0815ED46: + ldr r2, =0x02020630 + movs r1, 0x26 + ldrsh r0, [r3, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r2, 0x24 + ldrsh r0, [r3, r2] + lsls r2, r0, 1 + adds r2, r0 + ldrh r0, [r1, 0x24] + subs r0, r2 + strh r0, [r1, 0x24] + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + beq _0815ED72 + b _0815EE78 +_0815ED72: + b _0815EE50 + .pool +_0815ED78: + ldr r2, =0x02020630 + movs r1, 0x26 + ldrsh r0, [r3, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x24 + ldrsh r2, [r3, r0] + lsls r0, r2, 1 + adds r0, r2 + ldrh r2, [r1, 0x24] + adds r0, r2 + strh r0, [r1, 0x24] + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bne _0815EE78 + b _0815EE50 + .pool +_0815EDA8: + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _0815EE78 + movs r0, 0 + strh r0, [r3, 0xA] + ldrh r1, [r3, 0xC] + movs r2, 0xC + ldrsh r0, [r3, r2] + cmp r0, 0 + bne _0815EE54 + adds r0, r1, 0x1 + strh r0, [r3, 0xC] + movs r0, 0x1 + strh r0, [r3, 0x8] + b _0815EE78 +_0815EDCE: + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r3, 0x24] + ldrh r2, [r0, 0x24] + adds r1, r2 + strh r1, [r0, 0x24] + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + bne _0815EE78 + b _0815EE50 + .pool +_0815EDF8: + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bne _0815EE78 + b _0815EE50 +_0815EE08: + ldr r2, =0x02020630 + movs r1, 0x26 + ldrsh r0, [r3, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r0, 0x24 + ldrsh r2, [r3, r0] + lsls r2, 2 + ldrh r0, [r1, 0x24] + subs r0, r2 + b _0815EE40 + .pool +_0815EE28: + ldr r2, =0x02020630 + movs r1, 0x26 + ldrsh r0, [r3, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r2, 0x24 + ldrsh r0, [r3, r2] + lsls r0, 2 + ldrh r2, [r1, 0x24] + adds r0, r2 +_0815EE40: + strh r0, [r1, 0x24] + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + bne _0815EE78 +_0815EE50: + movs r0, 0 + strh r0, [r3, 0xA] +_0815EE54: + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] + b _0815EE78 + .pool +_0815EE60: + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strh r1, [r0, 0x24] + adds r0, r4, 0 + bl move_anim_task_del +_0815EE78: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815ECE4 + + thumb_func_start sub_815EE84 +sub_815EE84: @ 815EE84 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0815EEA8 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80A69CC + ldr r0, =0x02038436 + b _0815EEAA + .pool +_0815EEA8: + ldr r0, =0x02038437 +_0815EEAA: + ldrb r0, [r0] + strh r0, [r4, 0x3C] + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815EECE + ldrb r0, [r4, 0x3] + movs r1, 0x3F + negs r1, r1 + ands r1, r0 + movs r0, 0x10 + orrs r1, r0 + strb r1, [r4, 0x3] +_0815EECE: + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + bl sub_80A8328 + movs r2, 0x3 + ands r2, r0 + lsls r2, 2 + ldrb r3, [r4, 0x5] + movs r1, 0xD + negs r1, r1 + adds r0, r1, 0 + ands r0, r3 + orrs r0, r2 + strb r0, [r4, 0x5] + ldrb r0, [r4, 0x1] + ands r1, r0 + movs r0, 0x4 + orrs r1, r0 + strb r1, [r4, 0x1] + ldr r0, =sub_815EF08 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815EE84 + + thumb_func_start sub_815EF08 +sub_815EF08: @ 815EF08 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bls _0815EF16 + b _0815F106 +_0815EF16: + lsls r0, 2 + ldr r1, =_0815EF24 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815EF24: + .4byte _0815EF38 + .4byte _0815F038 + .4byte _0815F0A0 + .4byte _0815F0B4 + .4byte _0815F100 +_0815EF38: + movs r2, 0x3A + ldrsh r0, [r4, r2] + cmp r0, 0x5 + bhi _0815EF68 + lsls r0, 2 + ldr r1, =_0815EF50 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815EF50: + .4byte _0815EF6C + .4byte _0815EF88 + .4byte _0815EFAA + .4byte _0815EFC6 + .4byte _0815EF6C + .4byte _0815EFEC +_0815EF68: + movs r0, 0 + strh r0, [r4, 0x3A] +_0815EF6C: + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x5 + bl sub_80A861C + subs r0, 0x4 + lsls r0, 16 + lsrs r5, r0, 16 + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + b _0815EFE0 +_0815EF88: + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x5 + bl sub_80A861C + subs r0, 0x4 + lsls r0, 16 + lsrs r5, r0, 16 + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl sub_80A861C + adds r0, 0x4 + b _0815EFE6 +_0815EFAA: + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x4 + bl sub_80A861C + adds r0, 0x4 + lsls r0, 16 + lsrs r5, r0, 16 + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + b _0815EFE0 +_0815EFC6: + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x4 + bl sub_80A861C + adds r0, 0x4 + lsls r0, 16 + lsrs r5, r0, 16 + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 +_0815EFE0: + bl sub_80A861C + subs r0, 0x4 +_0815EFE6: + lsls r0, 16 + lsrs r1, r0, 16 + b _0815F00C +_0815EFEC: + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r5, r0, 24 + ldrh r0, [r4, 0x3C] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r1, r0, 24 +_0815F00C: + movs r2, 0x3A + ldrsh r0, [r4, r2] + cmp r0, 0x4 + bne _0815F018 + movs r0, 0x18 + b _0815F022 +_0815F018: + cmp r0, 0x5 + bne _0815F020 + movs r0, 0x6 + b _0815F022 +_0815F020: + movs r0, 0xC +_0815F022: + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + strh r5, [r4, 0x32] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + strh r1, [r4, 0x36] + adds r0, r4, 0 + bl obj_translate_based_on_private_1_2_3_4 + b _0815F0F8 +_0815F038: + adds r0, r4, 0 + bl sub_80A6F3C + lsls r0, 24 + cmp r0, 0 + beq _0815F106 + movs r1, 0x3A + ldrsh r0, [r4, r1] + cmp r0, 0x4 + beq _0815F070 + cmp r0, 0x5 + beq _0815F090 + ldrh r0, [r4, 0x24] + ldrh r2, [r4, 0x20] + adds r0, r2 + movs r1, 0 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + strh r1, [r4, 0x26] + strh r1, [r4, 0x24] + strh r1, [r4, 0x2E] + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + b _0815F088 +_0815F070: + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + strh r1, [r4, 0x26] + strh r1, [r4, 0x24] + strh r1, [r4, 0x38] +_0815F088: + ldrh r0, [r4, 0x3A] + adds r0, 0x1 + strh r0, [r4, 0x3A] + b _0815F106 +_0815F090: + movs r0, 0 + strh r0, [r4, 0x2E] + movs r1, 0x10 + strh r1, [r4, 0x30] + strh r0, [r4, 0x32] + movs r0, 0x3 + strh r0, [r4, 0x38] + b _0815F106 +_0815F0A0: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bne _0815F106 + movs r0, 0 + strh r0, [r4, 0x38] + b _0815F106 +_0815F0B4: + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0815F0C6 + ldrh r0, [r4, 0x30] + subs r0, 0x1 + strh r0, [r4, 0x30] + b _0815F0CC +_0815F0C6: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] +_0815F0CC: + ldrh r1, [r4, 0x32] + lsls r1, 8 + ldrh r0, [r4, 0x30] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x20 + bne _0815F106 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_0815F0F8: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + b _0815F106 +_0815F100: + adds r0, r4, 0 + bl move_anim_8072740 +_0815F106: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815EF08 + + thumb_func_start sub_815F10C +sub_815F10C: @ 815F10C + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + movs r2, 0x2E + ldrsh r1, [r4, r2] + subs r0, r1 + movs r2, 0x38 + ldrsh r1, [r4, r2] + muls r0, r1 + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl __divsi3 + adds r5, r0, 0 + strh r5, [r4, 0x24] + movs r1, 0x34 + ldrsh r0, [r4, r1] + movs r2, 0x30 + ldrsh r1, [r4, r2] + subs r0, r1 + movs r2, 0x38 + ldrsh r1, [r4, r2] + muls r0, r1 + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl __divsi3 + adds r3, r0, 0 + strh r3, [r4, 0x26] + ldrh r1, [r4, 0x38] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0815F16A + ldr r0, =gUnknown_085CE3A0 + ldrh r1, [r4, 0x20] + adds r1, r5 + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r4, 0x22] + adds r2, r3 + lsls r2, 16 + asrs r2, 16 + movs r3, 0x5 + bl AddObjectToFront +_0815F16A: + movs r0, 0x38 + ldrsh r1, [r4, r0] + movs r2, 0x36 + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _0815F17C + adds r0, r4, 0 + bl move_anim_8072740 +_0815F17C: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815F10C + + thumb_func_start sub_815F18C +sub_815F18C: @ 815F18C + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x02038437 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + ldrb r0, [r4] + movs r1, 0x3 + bl sub_80A5C6C + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _0815F1B8 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0815F1D0 +_0815F1B8: + ldr r2, =0x0203841e + ldrh r1, [r5, 0x20] + ldrh r0, [r2] + subs r0, r1, r0 + strh r0, [r5, 0x2E] + ldrh r0, [r2, 0x4] + subs r1, r0 + b _0815F1DE + .pool +_0815F1D0: + ldr r2, =0x0203841e + ldrh r1, [r5, 0x20] + ldrh r0, [r2] + adds r0, r1, r0 + strh r0, [r5, 0x2E] + ldrh r0, [r2, 0x4] + adds r1, r0 +_0815F1DE: + strh r1, [r5, 0x32] + adds r3, r2, 0 + ldrh r1, [r5, 0x22] + ldrh r2, [r3, 0x2] + adds r2, r1, r2 + strh r2, [r5, 0x30] + ldrh r0, [r3, 0x6] + adds r1, r0 + strh r1, [r5, 0x34] + ldrh r0, [r3, 0x8] + strh r0, [r5, 0x36] + ldrh r0, [r5, 0x2E] + strh r0, [r5, 0x20] + strh r2, [r5, 0x22] + ldr r0, =sub_815F10C + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815F18C + + thumb_func_start sub_815F20C +sub_815F20C: @ 815F20C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r5, r0, 24 + adds r2, r5, 0 + ldr r0, =0x03005e00 + mov r9, r0 + lsls r7, r6, 2 + adds r0, r7, r6 + lsls r0, 3 + mov r8, r0 + mov r4, r8 + add r4, r9 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815F254 + adds r0, r5, 0 + movs r1, 0 + bl sub_80A7270 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r4, 0xA] + strh r0, [r4, 0xC] + b _0815F2A0 + .pool +_0815F254: + cmp r0, 0x1 + bne _0815F2AC + ldrh r0, [r4, 0xA] + adds r0, 0x60 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + subs r0, 0xD + strh r0, [r4, 0xC] + movs r2, 0xA + ldrsh r1, [r4, r2] + movs r0, 0xC + ldrsh r2, [r4, r0] + adds r0, r5, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrh r0, [r4, 0xE] + adds r0, 0x1 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + bne _0815F310 + movs r0, 0 + strh r0, [r4, 0xE] + adds r0, r5, 0 + bl sub_80A7344 + ldr r1, =0x02020630 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_0815F2A0: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815F310 + .pool +_0815F2AC: + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0 + bl refresh_graphics_maybe + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0815F2EE + ldr r3, =0x02020630 + ldr r2, =0x020241e4 + ldrb r0, [r4] + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x10 + adds r0, r1 + ldr r1, =gUnknown_082FF6C0 + str r1, [r0] + 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 + bl StartObjectRotScalAnim +_0815F2EE: + mov r4, r9 + adds r3, r7, 0 + ldr r5, =sub_815F330 + movs r1, 0xF + mov r2, r8 + adds r0, r4, r2 + adds r0, 0x26 + movs r2, 0 +_0815F2FE: + strh r2, [r0] + subs r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _0815F2FE + adds r0, r3, r6 + lsls r0, 3 + adds r0, r4 + str r5, [r0] +_0815F310: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815F20C + + thumb_func_start sub_815F330 +sub_815F330: @ 815F330 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r5, [r4, r0] + cmp r5, 0x1 + beq _0815F394 + cmp r5, 0x1 + bgt _0815F360 + cmp r5, 0 + beq _0815F36A + b _0815F482 + .pool +_0815F360: + cmp r5, 0x2 + beq _0815F400 + cmp r5, 0x3 + beq _0815F43C + b _0815F482 +_0815F36A: + ldr r0, =0x02020630 + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r1, r0 + ldr r0, =0x0000ff38 + strh r0, [r1, 0x26] + movs r0, 0xC8 + strh r0, [r1, 0x24] + adds r1, 0x3E + ldrb r2, [r1] + subs r0, 0xCD + ands r0, r2 + strb r0, [r1] + strh r5, [r4, 0x1C] + b _0815F42E + .pool +_0815F394: + ldrh r1, [r4, 0x1C] + adds r1, 0x70 + movs r5, 0 + strh r1, [r4, 0x1C] + ldr r2, =0x02020630 + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + adds r2, r0, r2 + lsls r1, 16 + asrs r1, 24 + ldrh r3, [r2, 0x26] + adds r1, r3 + strh r1, [r2, 0x26] + movs r1, 0x22 + ldrsh r0, [r2, r1] + movs r3, 0x26 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r1, 0x20 + negs r1, r1 + cmp r0, r1 + blt _0815F3C4 + strh r5, [r2, 0x24] +_0815F3C4: + movs r1, 0x26 + ldrsh r0, [r2, r1] + cmp r0, 0 + ble _0815F3CE + strh r5, [r2, 0x26] +_0815F3CE: + movs r3, 0x26 + ldrsh r0, [r2, r3] + cmp r0, 0 + bne _0815F482 + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x7D + bl audio_play_and_stuff + ldr r1, =0xfffff800 + adds r0, r1, 0 + ldrh r2, [r4, 0x1C] + adds r0, r2 + strh r0, [r4, 0x1C] + b _0815F42E + .pool +_0815F400: + ldrh r0, [r4, 0x1C] + subs r0, 0x70 + strh r0, [r4, 0x1C] + lsls r0, 16 + cmp r0, 0 + bge _0815F410 + movs r0, 0 + strh r0, [r4, 0x1C] +_0815F410: + ldr r0, =0x02020630 + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r1, r0 + ldrh r2, [r4, 0x1C] + lsls r2, 16 + asrs r2, 24 + ldrh r0, [r1, 0x26] + subs r0, r2 + strh r0, [r1, 0x26] + movs r3, 0x1C + ldrsh r0, [r4, r3] + cmp r0, 0 + bne _0815F482 +_0815F42E: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815F482 + .pool +_0815F43C: + ldrh r0, [r4, 0x1C] + adds r0, 0x70 + strh r0, [r4, 0x1C] + ldr r2, =0x02020630 + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r1, r2 + lsls r0, 16 + asrs r0, 24 + ldrh r2, [r1, 0x26] + adds r0, r2 + strh r0, [r1, 0x26] + lsls r0, 16 + cmp r0, 0 + ble _0815F460 + movs r0, 0 + strh r0, [r1, 0x26] +_0815F460: + movs r3, 0x26 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _0815F482 + movs r0, 0x40 + negs r0, r0 + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x7D + bl audio_play_and_stuff + adds r0, r6, 0 + bl move_anim_task_del +_0815F482: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815F330 + + thumb_func_start sub_815F48C +sub_815F48C: @ 815F48C + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x02038437 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0815F4B8 + ldrb r0, [r4] + bl sub_80A82E4 + subs r0, 0x2 + adds r1, r5, 0 + adds r1, 0x43 + strb r0, [r1] + ldr r4, =0x0000ff70 + b _0815F4C8 + .pool +_0815F4B8: + ldrb r0, [r4] + bl sub_80A82E4 + adds r0, 0x2 + adds r1, r5, 0 + adds r1, 0x43 + strb r0, [r1] + ldr r4, =0x0000ffa0 +_0815F4C8: + ldr r0, =0x02038437 + ldrb r0, [r0] + movs r1, 0x3 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x22] + strh r4, [r5, 0x26] + ldr r0, =sub_815F4F0 + str r0, [r5, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815F48C + + thumb_func_start sub_815F4F0 +sub_815F4F0: @ 815F4F0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bls _0815F4FE + b _0815F61A +_0815F4FE: + lsls r0, 2 + ldr r1, =_0815F50C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815F50C: + .4byte _0815F520 + .4byte _0815F544 + .4byte _0815F584 + .4byte _0815F5B4 + .4byte _0815F5E0 +_0815F520: + ldrh r0, [r4, 0x26] + adds r0, 0xA + strh r0, [r4, 0x26] + lsls r0, 16 + cmp r0, 0 + blt _0815F61A + movs r0, 0x3F + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xCD + bl audio_play_and_stuff + movs r0, 0 + strh r0, [r4, 0x26] + b _0815F5D8 +_0815F544: + ldrh r1, [r4, 0x30] + adds r1, 0x4 + movs r5, 0 + strh r1, [r4, 0x30] + ldr r2, =gUnknown_08329F40 + movs r3, 0x30 + ldrsh r0, [r4, r3] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 19 + negs r0, r0 + strh r0, [r4, 0x26] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x7F + ble _0815F61A + movs r0, 0x3F + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xCD + bl audio_play_and_stuff + strh r5, [r4, 0x30] + strh r5, [r4, 0x26] + b _0815F5D8 + .pool +_0815F584: + ldrh r1, [r4, 0x30] + adds r1, 0x6 + movs r3, 0 + strh r1, [r4, 0x30] + ldr r2, =gUnknown_08329F40 + movs r5, 0x30 + ldrsh r0, [r4, r5] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 20 + negs r0, r0 + strh r0, [r4, 0x26] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x7F + ble _0815F61A + strh r3, [r4, 0x30] + strh r3, [r4, 0x26] + b _0815F5D8 + .pool +_0815F5B4: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _0815F61A + movs r0, 0x3F + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0xC0 + bl audio_play_and_stuff + movs r0, 0 + strh r0, [r4, 0x30] +_0815F5D8: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0815F61A +_0815F5E0: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _0815F61A + movs r0, 0 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x32] + adds r1, 0x1 + strh r1, [r4, 0x32] + movs r0, 0x1 + ands r1, r0 + adds r3, r4, 0 + adds r3, 0x3E + lsls r1, 2 + ldrb r2, [r3] + subs r0, 0x6 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x7 + bne _0815F61A + adds r0, r4, 0 + bl move_anim_8072740 +_0815F61A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_815F4F0 + + thumb_func_start sub_815F620 +sub_815F620: @ 815F620 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + bl sub_80A4DF0 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0 + bne _0815F66E + movs r0, 0x1 + bl duplicate_obj_of_side_rel2move_in_transparent_mode + lsls r0, 16 + lsrs r1, r0, 16 + mov r10, r1 + asrs r6, r0, 16 + cmp r6, 0 + blt _0815F66E + movs r0, 0x1 + bl duplicate_obj_of_side_rel2move_in_transparent_mode + lsls r0, 16 + lsrs r1, r0, 16 + mov r9, r1 + asrs r1, r0, 16 + cmp r1, 0 + bge _0815F67C + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl obj_delete_but_dont_free_vram +_0815F66E: + mov r0, r8 + bl move_anim_task_del + b _0815F780 + .pool +_0815F67C: + ldr r4, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r5, r0, r4 + ldrh r0, [r5, 0x24] + adds r0, 0x18 + strh r0, [r5, 0x24] + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + adds r6, r0, r4 + ldrh r0, [r6, 0x24] + subs r0, 0x18 + strh r0, [r6, 0x24] + strh r7, [r5, 0x2E] + strh r7, [r6, 0x2E] + strh r7, [r5, 0x30] + strh r7, [r6, 0x30] + strh r7, [r5, 0x32] + strh r7, [r6, 0x32] + movs r0, 0x10 + strh r0, [r5, 0x34] + ldr r0, =0x0000fff0 + strh r0, [r6, 0x34] + strh r7, [r5, 0x36] + movs r0, 0x80 + strh r0, [r6, 0x36] + movs r0, 0x18 + strh r0, [r5, 0x38] + strh r0, [r6, 0x38] + mov r0, r8 + strh r0, [r5, 0x3A] + strh r0, [r6, 0x3A] + strh r7, [r5, 0x3C] + strh r7, [r6, 0x3C] + ldr r2, =0x03005e00 + mov r1, r8 + lsls r3, r1, 2 + adds r0, r3, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x2 + strh r1, [r0, 0x8] + ldr r0, =0x020244d0 + ldr r1, [r0] + ldr r0, =0x02038437 + ldrb r0, [r0] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + adds r7, r4, 0 + mov r12, r3 + cmp r0, 0 + bne _0815F720 + adds r2, r5, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r2, r6, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + b _0815F736 + .pool +_0815F720: + adds r1, r5, 0 + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + adds r1, r6, 0 + adds r1, 0x3E + ldrb r0, [r1] + orrs r0, r2 + strb r0, [r1] +_0815F736: + mov r1, r9 + lsls r0, r1, 16 + asrs r0, 16 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r4, r2, r7 + ldrb r1, [r4, 0x1] + movs r3, 0xD + negs r3, r3 + adds r0, r3, 0 + ands r0, r1 + strb r0, [r4, 0x1] + mov r1, r10 + lsls r0, r1, 16 + asrs r0, 16 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r4, r1, r7 + ldrb r0, [r4, 0x1] + ands r3, r0 + strb r3, [r4, 0x1] + adds r3, r7, 0 + adds r3, 0x1C + adds r2, r3 + ldr r0, =sub_815F7C4 + str r0, [r2] + adds r1, r3 + str r0, [r1] + mov r0, r12 + add r0, r8 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r0, r1 + ldr r1, =sub_815F79C + str r1, [r0] +_0815F780: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815F620 + + thumb_func_start sub_815F79C +sub_815F79C: @ 815F79C + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0815F7BA + adds r0, r2, 0 + bl move_anim_task_del +_0815F7BA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_815F79C + + thumb_func_start sub_815F7C4 +sub_815F7C4: @ 815F7C4 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0815F80E + movs r0, 0 + strh r0, [r4, 0x30] + ldr r0, =0x020244d0 + ldr r1, [r0] + ldr r0, =0x02038437 + ldrb r0, [r0] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0815F80E + adds r3, r4, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsls r1, r2, 29 + lsrs r1, 31 + movs r0, 0x1 + eors r1, r0 + ands r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_0815F80E: + ldrh r0, [r4, 0x34] + ldrh r1, [r4, 0x36] + adds r0, r1 + movs r5, 0 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x36] + movs r2, 0x36 + ldrsh r0, [r4, r2] + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815F840 + cmp r0, 0x1 + beq _0815F858 + b _0815F896 + .pool +_0815F840: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + bne _0815F896 + strh r5, [r4, 0x32] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0815F896 +_0815F858: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + lsls r0, 16 + cmp r0, 0 + ble _0815F896 + strh r5, [r4, 0x32] + ldrh r0, [r4, 0x38] + subs r0, 0x2 + strh r0, [r4, 0x38] + lsls r0, 16 + cmp r0, 0 + bge _0815F896 + ldr r3, =0x03005e00 + movs r2, 0x3C + ldrsh r1, [r4, r2] + lsls r1, 1 + movs r0, 0x3A + ldrsh r2, [r4, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r3, 0x8 + adds r1, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + adds r0, r4, 0 + bl obj_delete_but_dont_free_vram +_0815F896: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815F7C4 + + thumb_func_start sub_815F8A0 +sub_815F8A0: @ 815F8A0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, =0x0203841e + movs r2, 0 + strh r2, [r3, 0xE] + ldr r1, =0x0203841a + ldrb r0, [r1] + ldrb r1, [r1] + adds r0, r1, 0 + subs r0, 0x3D + lsls r0, 24 + lsrs r0, 24 + adds r2, r1, 0 + cmp r0, 0x1E + bhi _0815F8C4 + movs r0, 0x1 + strh r0, [r3, 0xE] +_0815F8C4: + adds r0, r2, 0 + subs r0, 0x5C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6C + bhi _0815F8D4 + movs r0, 0x2 + strh r0, [r3, 0xE] +_0815F8D4: + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, 0xC8 + bls _0815F8E0 + movs r0, 0x3 + strh r0, [r3, 0xE] +_0815F8E0: + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815F8A0 + + thumb_func_start sub_815F8F4 +sub_815F8F4: @ 815F8F4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =0x03005e00 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0x4 + bls _0815F91A + b _0815FE68 +_0815F91A: + lsls r0, 2 + ldr r1, =_0815F92C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815F92C: + .4byte _0815F940 + .4byte _0815F9F4 + .4byte _0815FBE8 + .4byte _0815FD08 + .4byte _0815FD8C +_0815F940: + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x03005e00 + mov r2, r8 + lsls r4, r2, 2 + adds r0, r4, r2 + lsls r0, 3 + adds r6, r0, r1 + movs r3, 0x80 + lsls r3, 4 + adds r0, r3, 0 + ldrh r1, [r6, 0xA] + adds r0, r1 + strh r0, [r6, 0xA] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + mov r9, r4 + cmp r0, 0 + bne _0815F998 + ldr r2, =0x02020630 + lsls r3, r7, 4 + adds r1, r3, r7 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r6, 0xA] + lsls r0, 16 + asrs r0, 24 + ldrh r4, [r1, 0x24] + adds r0, r4 + strh r0, [r1, 0x24] + b _0815F9B2 + .pool +_0815F998: + ldr r3, =0x02020630 + lsls r4, r7, 4 + adds r2, r4, r7 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r6, 0xA] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + adds r2, r3, 0 + adds r3, r4, 0 +_0815F9B2: + ldr r1, =0x03005e00 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r4, r0, r1 + ldrb r0, [r4, 0xA] + strh r0, [r4, 0xA] + adds r1, r3, r7 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x24] + ldrh r1, [r1, 0x20] + adds r0, r1 + lsls r0, 16 + movs r1, 0x80 + lsls r1, 14 + adds r0, r1 + movs r1, 0x98 + lsls r1, 17 + cmp r0, r1 + bhi _0815F9DE + b _0815FE68 +_0815F9DE: + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815FE68 + .pool +_0815F9F4: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _0815FA28 + ldr r0, =0x02039f34 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldr r2, [r0, 0x8] + mov r10, r2 + ldr r3, [r0, 0xC] + mov r9, r3 + ldrh r6, [r0] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl sub_80A82E4 + lsls r0, 24 + lsrs r4, r0, 24 + movs r7, 0 + b _0815FB4E + .pool +_0815FA28: + ldr r4, =0x02038436 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0815FAC8 + ldr r7, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + movs r1, 0 + bl pokemon_getattr + mov r10, r0 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0x1 + bl pokemon_getattr + mov r9, r0 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldrb r2, [r4] + ldr r1, [r0] + lsls r0, r2, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _0815FA9C + lsls r0, r2, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + b _0815FA9E + .pool +_0815FA9C: + ldrh r6, [r1, 0x2] +_0815FA9E: + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + ldr r2, =0x02020630 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x43 + ldrb r0, [r1] + adds r0, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + movs r7, 0 + movs r5, 0x88 + lsls r5, 1 + b _0815FB50 + .pool +_0815FAC8: + ldr r7, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x02024744 + adds r0, r5 + movs r1, 0 + bl pokemon_getattr + mov r10, r0 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0x1 + bl pokemon_getattr + mov r9, r0 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldrb r2, [r4] + ldr r1, [r0] + lsls r0, r2, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _0815FB2C + lsls r0, r2, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + b _0815FB2E + .pool +_0815FB2C: + ldrh r6, [r1, 0x2] +_0815FB2E: + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + ldr r2, =0x02020630 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x43 + ldrb r0, [r1] + subs r0, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + movs r7, 0x1 +_0815FB4E: + ldr r5, =0x0000ffe0 +_0815FB50: + ldr r0, =0x02038437 + ldrb r0, [r0] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + lsls r3, r5, 16 + asrs r3, 16 + str r0, [sp] + str r4, [sp, 0x4] + mov r4, r10 + str r4, [sp, 0x8] + mov r0, r9 + str r0, [sp, 0xC] + ldr r4, =0x02038436 + ldrb r0, [r4] + str r0, [sp, 0x10] + movs r0, 0 + str r0, [sp, 0x14] + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0 + bl sub_80A8394 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x020244d0 + ldr r1, [r0] + ldrb r0, [r4] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x2] + cmp r0, 0 + beq _0815FBBA + ldr r1, =0x02020630 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + orrs r0, r1 + ldr r3, =0x00007fff + movs r1, 0x10 + movs r2, 0x6 + bl pal_fade_1 +_0815FBBA: + ldr r0, =0x03005e00 + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + strh r5, [r1, 0x26] + b _0815FD7E + .pool +_0815FBE8: + ldr r1, =0x03005e00 + mov r0, r8 + lsls r4, r0, 2 + adds r0, r4, r0 + lsls r0, 3 + adds r6, r0, r1 + ldrh r0, [r6, 0x26] + lsls r0, 24 + lsrs r5, r0, 24 + movs r1, 0x80 + lsls r1, 4 + adds r0, r1, 0 + ldrh r2, [r6, 0xA] + adds r0, r2 + strh r0, [r6, 0xA] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + mov r9, r4 + cmp r0, 0 + bne _0815FC40 + ldr r3, =0x02020630 + lsls r4, r5, 4 + adds r2, r4, r5 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r6, 0xA] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + adds r2, r3, 0 + adds r3, r4, 0 + b _0815FC56 + .pool +_0815FC40: + ldr r2, =0x02020630 + lsls r3, r5, 4 + adds r1, r3, r5 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r6, 0xA] + lsls r0, 16 + asrs r0, 24 + ldrh r4, [r1, 0x24] + adds r0, r4 + strh r0, [r1, 0x24] +_0815FC56: + ldr r1, =0x03005e00 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r6, r0, r1 + ldrb r0, [r6, 0xA] + strh r0, [r6, 0xA] + adds r1, r3, r5 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x24] + ldrh r1, [r1, 0x20] + adds r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 + movs r1, 0x24 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0815FCD6 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0815FCB4 + lsls r4, r5, 16 + asrs r4, 16 + ldr r0, =0x02038437 + ldrb r0, [r0] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bge _0815FCD6 + b _0815FCCA + .pool +_0815FCB4: + lsls r4, r5, 16 + asrs r4, 16 + ldr r0, =0x02038437 + ldrb r0, [r0] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + ble _0815FCD6 +_0815FCCA: + ldrh r0, [r6, 0x24] + adds r0, 0x1 + strh r0, [r6, 0x24] + ldr r1, =0x0203841e + ldr r0, =0x0000ffff + strh r0, [r1, 0xE] +_0815FCD6: + lsls r0, r5, 16 + movs r2, 0x80 + lsls r2, 14 + adds r0, r2 + movs r1, 0x98 + lsls r1, 17 + cmp r0, r1 + bhi _0815FCE8 + b _0815FE68 +_0815FCE8: + ldr r0, =0x03005e00 + mov r1, r9 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0 + strh r0, [r1, 0xA] + b _0815FD7E + .pool +_0815FD08: + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x03005e00 + mov r3, r8 + lsls r4, r3, 2 + adds r0, r4, r3 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x26] + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r5, =0x02020630 + adds r0, r5 + bl sub_80A8610 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + mov r9, r4 + cmp r0, 0 + bne _0815FD60 + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + adds r1, r5 + ldrh r0, [r1, 0x20] + negs r0, r0 + subs r0, 0x20 + strh r0, [r1, 0x24] + b _0815FD74 + .pool +_0815FD60: + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r0, r5 + ldrh r2, [r0, 0x20] + movs r4, 0x88 + lsls r4, 1 + adds r1, r4, 0 + subs r1, r2 + strh r1, [r0, 0x24] +_0815FD74: + ldr r0, =0x03005e00 + mov r1, r9 + add r1, r8 + lsls r1, 3 + adds r1, r0 +_0815FD7E: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0815FE68 + .pool +_0815FD8C: + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x03005e00 + mov r0, r8 + lsls r4, r0, 2 + adds r0, r4, r0 + lsls r0, 3 + adds r2, r0, r1 + movs r1, 0x80 + lsls r1, 4 + adds r0, r1, 0 + ldrh r3, [r2, 0xA] + adds r0, r3 + strh r0, [r2, 0xA] + ldr r0, =0x02038436 + mov r10, r0 + ldrb r0, [r0] + str r2, [sp, 0x18] + bl battle_side_get_owner + lsls r0, 24 + mov r9, r4 + ldr r2, [sp, 0x18] + cmp r0, 0 + bne _0815FE0C + ldr r1, =0x02020630 + lsls r5, r7, 4 + adds r0, r5, r7 + lsls r0, 2 + adds r6, r0, r1 + ldrh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r6, 0x24] + adds r0, r1 + strh r0, [r6, 0x24] + movs r2, 0x24 + ldrsh r4, [r6, r2] + movs r3, 0x20 + ldrsh r0, [r6, r3] + adds r4, r0 + mov r1, r10 + ldrb r0, [r1] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r3, r5, 0 + cmp r4, r0 + blt _0815FE44 + movs r2, 0 + strh r2, [r6, 0x24] + b _0815FE44 + .pool +_0815FE0C: + ldr r1, =0x02020630 + lsls r5, r7, 4 + adds r0, r5, r7 + lsls r0, 2 + adds r6, r0, r1 + ldrh r1, [r2, 0xA] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r6, 0x24] + subs r0, r1 + strh r0, [r6, 0x24] + movs r3, 0x24 + ldrsh r4, [r6, r3] + movs r1, 0x20 + ldrsh r0, [r6, r1] + adds r4, r0 + mov r2, r10 + ldrb r0, [r2] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r3, r5, 0 + cmp r4, r0 + bgt _0815FE44 + movs r4, 0 + strh r4, [r6, 0x24] +_0815FE44: + ldr r1, =0x03005e00 + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xA] + strh r1, [r0, 0xA] + ldr r1, =0x02020630 + adds r0, r3, r7 + lsls r0, 2 + adds r0, r1 + movs r1, 0x24 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0815FE68 + mov r0, r8 + bl move_anim_task_del +_0815FE68: + 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_815F8F4 + + thumb_func_start sub_815FE80 +sub_815FE80: @ 815FE80 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815FE92 + cmp r0, 0x1 + beq _0815FF3A + b _0815FFBC +_0815FE92: + ldr r0, =0x0203841e + movs r2, 0xE + ldrsh r1, [r0, r2] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _0815FF2C + movs r0, 0x3F + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x7A + bl audio_play_and_stuff + ldr r0, =0x02038437 + ldrb r0, [r0] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x10 + strh r0, [r4, 0x22] + ldr r0, =0x0000ffe0 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815FFBC + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0815FFBC + movs r0, 0x1 + bl obj_id_for_side_relative_to_move + ldr r2, =0x02020630 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x43 + ldrb r0, [r1] + subs r0, 0x1 + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + b _0815FFBC + .pool +_0815FF2C: + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _0815FFBC +_0815FF3A: + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r2, 0x2E + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x26] + ldrh r2, [r4, 0x30] + adds r0, r2, 0x5 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7F + ble _0815FF6E + movs r1, 0x2E + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + adds r0, r2, 0 + subs r0, 0x7A + strh r0, [r4, 0x30] +_0815FF6E: + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0815FF9C + ldrh r2, [r4, 0x32] + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r4, 0x24] + subs r0, r1 + strh r0, [r4, 0x24] + adds r1, r2, 0 + b _0815FFA8 + .pool +_0815FF9C: + ldrh r1, [r4, 0x32] + lsls r0, r1, 16 + asrs r0, 24 + ldrh r2, [r4, 0x24] + adds r0, r2 + strh r0, [r4, 0x24] +_0815FFA8: + movs r0, 0xFF + ands r0, r1 + strh r0, [r4, 0x32] + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0x2 + bne _0815FFBC + adds r0, r4, 0 + bl move_anim_8072740 +_0815FFBC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815FE80 + + thumb_func_start sub_815FFC4 +sub_815FFC4: @ 815FFC4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x26 + ldrsh r0, [r0, r2] + adds r3, r1, 0 + cmp r0, 0x4 + bls _0815FFE0 + b _08160132 +_0815FFE0: + lsls r0, 2 + ldr r1, =_0815FFF4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815FFF4: + .4byte _08160008 + .4byte _08160058 + .4byte _081600B4 + .4byte _081600CC + .4byte _08160132 +_08160008: + ldr r0, =0x02038436 + ldrb r0, [r0] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r0, =0x02038437 + ldrb r0, [r0] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + movs r0, 0x6 + strh r0, [r1, 0x8] + cmp r5, r2 + ble _0816003E + negs r0, r0 + strh r0, [r1, 0x8] +_0816003E: + strh r5, [r1, 0xA] + strh r2, [r1, 0xC] + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _08160150 + .pool +_08160058: + ldr r1, =0x020241e4 + ldr r0, =0x02038436 + ldrb r0, [r0] + adds r0, r1 + ldrb r2, [r0] + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r1 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r3 + ldrh r0, [r2, 0x8] + ldrh r3, [r1, 0x24] + adds r0, r3 + strh r0, [r1, 0x24] + movs r3, 0x8 + ldrsh r0, [r2, r3] + cmp r0, 0 + ble _081600A0 + movs r3, 0x20 + ldrsh r0, [r1, r3] + movs r3, 0x24 + ldrsh r1, [r1, r3] + adds r0, r1 + movs r3, 0xC + ldrsh r1, [r2, r3] + b _08160126 + .pool +_081600A0: + movs r3, 0x20 + ldrsh r0, [r1, r3] + movs r3, 0x24 + ldrsh r1, [r1, r3] + adds r0, r1 + movs r3, 0xC + ldrsh r1, [r2, r3] + cmp r0, r1 + bgt _08160150 + b _0816012A +_081600B4: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + movs r2, 0x8 + ldrsh r1, [r0, r2] + negs r1, r1 + strh r1, [r0, 0x8] + ldrh r1, [r0, 0x26] + adds r1, 0x1 + strh r1, [r0, 0x26] + b _08160150 +_081600CC: + ldr r1, =0x020241e4 + ldr r0, =0x02038436 + ldrb r0, [r0] + adds r0, r1 + ldrb r2, [r0] + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r1 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r3 + ldrh r0, [r2, 0x8] + ldrh r3, [r1, 0x24] + adds r0, r3 + strh r0, [r1, 0x24] + movs r3, 0x8 + ldrsh r0, [r2, r3] + cmp r0, 0 + bge _08160118 + movs r3, 0x20 + ldrsh r0, [r1, r3] + movs r3, 0x24 + ldrsh r1, [r1, r3] + adds r0, r1 + movs r3, 0xA + ldrsh r1, [r2, r3] + cmp r0, r1 + bgt _08160150 + b _0816012A + .pool +_08160118: + movs r3, 0x20 + ldrsh r0, [r1, r3] + movs r3, 0x24 + ldrsh r1, [r1, r3] + adds r0, r1 + movs r3, 0xA + ldrsh r1, [r2, r3] +_08160126: + cmp r0, r1 + blt _08160150 +_0816012A: + ldrh r0, [r2, 0x26] + adds r0, 0x1 + strh r0, [r2, 0x26] + b _08160150 +_08160132: + ldr r1, =0x020241e4 + ldr r0, =0x02038436 + ldrb r0, [r0] + adds r0, r1 + ldrb r2, [r0] + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x24] + adds r0, r4, 0 + bl move_anim_task_del +_08160150: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815FFC4 + + thumb_func_start sub_8160164 +sub_8160164: @ 8160164 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r4, r1, r0 + movs r0, 0 + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r4, 0xE] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + movs r2, 0x1 + negs r2, r2 + adds r1, r2, 0 + cmp r0, 0 + bne _08160198 + movs r1, 0x1 +_08160198: + strh r1, [r4, 0x10] + ldr r2, =0x02020630 + movs r0, 0xE + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x22] + strh r0, [r4, 0x14] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x20] + strh r0, [r4, 0x12] + strh r5, [r4, 0x1A] + strh r5, [r4, 0x1E] + movs r0, 0x1 + strh r0, [r4, 0x1C] + strh r5, [r4, 0x20] + ldr r0, =sub_81601DC + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160164 + + thumb_func_start sub_81601DC +sub_81601DC: @ 81601DC + push {r4-r6,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08160284 + cmp r0, 0x1 + bgt _08160204 + cmp r0, 0 + beq _0816020A + b _081602DA + .pool +_08160204: + cmp r0, 0x2 + beq _081602D4 + b _081602DA +_0816020A: + ldrh r0, [r4, 0x1E] + adds r0, 0x8 + movs r2, 0xFF + ands r0, r2 + strh r0, [r4, 0x1E] + ldr r5, =0x02020630 + movs r6, 0xE + ldrsh r0, [r4, r6] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldr r3, =gUnknown_08329F40 + movs r6, 0x1E + ldrsh r0, [r4, r6] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 21 + strh r0, [r1, 0x24] + ldrh r0, [r4, 0x1A] + adds r0, 0x2 + ands r0, r2 + strh r0, [r4, 0x1A] + movs r1, 0xE + ldrsh r0, [r4, r1] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r5 + movs r6, 0x1A + ldrsh r0, [r4, r6] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 19 + ldrh r1, [r4, 0x10] + muls r0, r1 + ldrh r1, [r4, 0x12] + adds r0, r1 + strh r0, [r2, 0x20] + movs r6, 0x1A + ldrsh r0, [r4, r6] + cmp r0, 0 + bne _081602DA + movs r0, 0xE + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r4, 0x12] + strh r1, [r0, 0x20] + b _081602C4 + .pool +_08160284: + ldrh r0, [r4, 0x1E] + adds r0, 0x8 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x1E] + ldr r3, =0x02020630 + movs r1, 0xE + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldr r2, =gUnknown_08329F40 + movs r5, 0x1E + ldrsh r0, [r4, r5] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 21 + strh r0, [r1, 0x24] + movs r6, 0x1E + ldrsh r2, [r4, r6] + cmp r2, 0 + bne _081602DA + movs r1, 0xE + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + strh r2, [r1, 0x24] +_081602C4: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _081602DA + .pool +_081602D4: + adds r0, r2, 0 + bl move_anim_task_del +_081602DA: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81601DC + + thumb_func_start sub_81602E0 +sub_81602E0: @ 81602E0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + ldrh r0, [r4, 0x2E] + ldrh r1, [r4, 0x30] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x14 + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x14 + bl sine + strh r0, [r4, 0x26] + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08160326 + adds r0, r4, 0 + bl move_anim_8072740 +_08160326: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81602E0 + + thumb_func_start sub_8160338 +sub_8160338: @ 8160338 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0816037C + ldr r2, =0x0203841e + ldrh r0, [r4, 0x20] + ldrh r1, [r2] + subs r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r2, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r0, =0x0000fff5 + strh r0, [r4, 0x2E] + movs r0, 0xC0 + strh r0, [r4, 0x30] + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + b _08160396 + .pool +_0816037C: + movs r0, 0xB + strh r0, [r4, 0x2E] + movs r0, 0xC0 + strh r0, [r4, 0x30] + ldr r1, =0x0203841e + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] +_08160396: + ldr r0, =sub_81602E0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160338 + + thumb_func_start sub_81603A8 +sub_81603A8: @ 81603A8 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x02038436 + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A861C + strh r0, [r5, 0x22] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + bgt _081603D2 + movs r0, 0x10 + strh r0, [r5, 0x22] +_081603D2: + movs r0, 0 + strh r0, [r5, 0x3A] + movs r1, 0x10 + strh r1, [r5, 0x3C] + ldr r0, =sub_81603F4 + str r0, [r5, 0x1C] + lsls r1, 8 + movs r0, 0x52 + bl SetGpuReg + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81603A8 + + thumb_func_start sub_81603F4 +sub_81603F4: @ 81603F4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _0816046C + cmp r1, 0x1 + bgt _0816040A + cmp r1, 0 + beq _08160414 + b _081604E8 +_0816040A: + cmp r1, 0x2 + beq _08160482 + cmp r1, 0x3 + beq _081604E2 + b _081604E8 +_08160414: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081604E8 + strh r1, [r4, 0x2E] + ldrh r1, [r4, 0x30] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0816043E + ldrh r2, [r4, 0x3A] + movs r3, 0x3A + ldrsh r0, [r4, r3] + cmp r0, 0xF + bgt _0816044C + adds r0, r2, 0x1 + strh r0, [r4, 0x3A] + b _0816044C +_0816043E: + ldrh r2, [r4, 0x3C] + movs r3, 0x3C + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _0816044C + subs r0, r2, 0x1 + strh r0, [r4, 0x3C] +_0816044C: + adds r0, r1, 0x1 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x3C] + lsls r1, 8 + ldrh r0, [r4, 0x3A] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081604E8 + b _081604DA +_0816046C: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _081604E8 + strh r1, [r4, 0x2E] + strh r1, [r4, 0x30] + b _081604DA +_08160482: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081604E8 + movs r0, 0 + strh r0, [r4, 0x2E] + ldrh r1, [r4, 0x30] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081604AE + ldrh r2, [r4, 0x3A] + movs r3, 0x3A + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _081604BC + subs r0, r2, 0x1 + strh r0, [r4, 0x3A] + b _081604BC +_081604AE: + ldrh r2, [r4, 0x3C] + movs r3, 0x3C + ldrsh r0, [r4, r3] + cmp r0, 0xF + bgt _081604BC + adds r0, r2, 0x1 + strh r0, [r4, 0x3C] +_081604BC: + adds r0, r1, 0x1 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x3C] + lsls r1, 8 + ldrh r0, [r4, 0x3A] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _081604E8 +_081604DA: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + b _081604E8 +_081604E2: + adds r0, r4, 0 + bl move_anim_8074EE0 +_081604E8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81603F4 + + thumb_func_start sub_81604F0 +sub_81604F0: @ 81604F0 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =0x0203841e + movs r0, 0 + strh r0, [r2, 0xE] + ldr r0, =0x0203841c + ldrh r1, [r0] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _08160514 + movs r0, 0x1 + b _08160536 + .pool +_08160514: + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08160520 + movs r0, 0x2 + b _08160536 +_08160520: + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + beq _0816052C + movs r0, 0x3 + b _08160536 +_0816052C: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08160538 + movs r0, 0x4 +_08160536: + strh r0, [r2, 0xE] +_08160538: + adds r0, r3, 0 + bl move_anim_task_del + pop {r0} + bx r0 + thumb_func_end sub_81604F0 + + thumb_func_start sub_8160544 +sub_8160544: @ 8160544 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + movs r0, 0 + strh r0, [r4, 0x8] + ldr r0, =0x0203841e + ldrb r0, [r0] + bl obj_id_for_side_relative_to_move + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + strh r1, [r4, 0x26] + ldr r2, =gUnknown_085CE9C8 + adds r0, r4, 0 + bl sub_80A7CFC + ldr r0, =sub_816058C + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160544 + + thumb_func_start sub_816058C +sub_816058C: @ 816058C + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r2, =0x03005e00 + adds r3, r0, r2 + ldrh r0, [r3, 0x8] + adds r1, r0, 0x1 + movs r5, 0 + strh r1, [r3, 0x8] + subs r0, 0x10 + lsls r0, 16 + lsrs r0, 16 + adds r6, r2, 0 + cmp r0, 0x16 + bhi _081605F0 + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _08160600 + strh r5, [r3, 0xA] + ldrh r0, [r3, 0xC] + adds r0, 0x1 + strh r0, [r3, 0xC] + movs r5, 0x1 + ands r0, r5 + cmp r0, 0 + bne _081605F0 + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000ffff + strh r1, [r0, 0x24] + b _08160600 + .pool +_081605F0: + ldr r2, =0x02020630 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x24] +_08160600: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r6 + bl sub_80A7D34 + lsls r0, 24 + cmp r0, 0 + bne _08160618 + adds r0, r4, 0 + bl move_anim_task_del +_08160618: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816058C + + thumb_func_start sub_8160624 +sub_8160624: @ 8160624 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8160624 + + thumb_func_start sub_8160638 +sub_8160638: @ 8160638 + push {lr} + sub sp, 0x4 + bl script_env_2_enable + ldr r0, =sub_8160664 + movs r1, 0xA + bl CreateTask + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160638 + + thumb_func_start sub_8160664 +sub_8160664: @ 8160664 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08160688 + ldr r0, =sub_81606A0 + bl SetMainCallback2 + ldr r1, =0x03005dac + ldr r0, =sub_80AF168 + str r0, [r1] + adds r0, r4, 0 + bl DestroyTask +_08160688: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160664 + + thumb_func_start sub_81606A0 +sub_81606A0: @ 81606A0 + push {r4-r6,lr} + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + bl ResetTasks + bl clear_scheduled_bg_copies_to_vram + ldr r6, =0x0203bc34 + movs r0, 0x8C + lsls r0, 1 + bl AllocZeroed + str r0, [r6] + ldr r1, =0x020375e0 + ldrh r1, [r1] + adds r0, 0x44 + movs r5, 0 + strb r1, [r0] + ldr r0, =sub_8160624 + bl SetVBlankCallback + bl sub_81607EC + movs r0, 0 + bl sub_81D2824 + ldr r4, =0x0203bc38 + movs r0, 0 + strh r5, [r4] + strh r5, [r4, 0x2] + strb r0, [r4, 0x4] + bl sub_8161280 + ldr r0, =gUnknown_085CEBB0 + bl LoadObjectPic + ldr r0, =gUnknown_085CEBB8 + bl LoadTaggedObjectPalette + bl sub_81610B8 + ldr r0, =0x03006310 + ldrh r1, [r4] + ldrh r2, [r4, 0x2] + bl ListMenuInit + ldr r1, [r6] + movs r2, 0x89 + lsls r2, 1 + adds r1, r2 + strb r0, [r1] + movs r0, 0 + movs r1, 0 + movs r2, 0x2 + bl rboxid_80040B8 + ldr r0, =sub_816082C + bl SetMainCallback2 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81606A0 + + thumb_func_start sub_8160740 +sub_8160740: @ 8160740 + push {r4,r5,lr} + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + bl ResetTasks + bl clear_scheduled_bg_copies_to_vram + ldr r5, =0x0203bc34 + movs r0, 0x8C + lsls r0, 1 + bl AllocZeroed + str r0, [r5] + movs r1, 0x1C + strb r1, [r0] + ldr r0, [r5] + ldr r1, =0x020375e0 + ldrh r1, [r1] + adds r0, 0x44 + strb r1, [r0] + ldr r0, [r5] + ldr r1, =0x020375e2 + ldrh r1, [r1] + adds r0, 0x45 + strb r1, [r0] + ldr r0, =sub_8160624 + bl SetVBlankCallback + bl sub_81607EC + ldr r4, =0x0203bc38 + ldrb r0, [r4, 0x4] + bl sub_81D2824 + bl sub_8161280 + ldr r0, =gUnknown_085CEBB0 + bl LoadObjectPic + ldr r0, =gUnknown_085CEBB8 + bl LoadTaggedObjectPalette + bl sub_81610B8 + ldr r0, =0x03006310 + ldrh r1, [r4] + ldrh r2, [r4, 0x2] + bl ListMenuInit + ldr r1, [r5] + movs r2, 0x89 + lsls r2, 1 + adds r1, r2 + strb r0, [r1] + movs r0, 0 + movs r1, 0 + movs r2, 0x2 + bl rboxid_80040B8 + ldr r0, =sub_816082C + bl SetMainCallback2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160740 + + thumb_func_start sub_81607EC +sub_81607EC: @ 81607EC + push {lr} + bl sub_8121DA0 + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085CEC28 + movs r0, 0 + movs r2, 0x2 + bl InitBgsFromTemplates + bl sub_8121E10 + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end sub_81607EC + + thumb_func_start sub_816082C +sub_816082C: @ 816082C + push {lr} + bl sub_8160868 + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl do_scheduled_bg_tilemap_copies_to_vram + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_816082C + + thumb_func_start sub_816084C +sub_816084C: @ 816084C + push {r4,lr} + adds r1, r0, 0 + ldr r4, =0x02021fc4 + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + bl sub_81D2BF4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816084C + + thumb_func_start sub_8160868 +sub_8160868: @ 8160868 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + ldr r1, =0x0203bc34 + ldr r0, [r1] + ldrb r0, [r0] + adds r7, r1, 0 + cmp r0, 0x21 + bls _0816087E + b _08160E8A +_0816087E: + lsls r0, 2 + ldr r1, =_08160890 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08160890: + .4byte _08160918 + .4byte _08160932 + .4byte _0816094C + .4byte _08160954 + .4byte _0816095C + .4byte _08160964 + .4byte _08160980 + .4byte _08160E8A + .4byte _08160988 + .4byte _081609A8 + .4byte _08160E8A + .4byte _08160E8A + .4byte _08160A44 + .4byte _08160A64 + .4byte _08160CB8 + .4byte _08160CD8 + .4byte _08160AB8 + .4byte _08160AD0 + .4byte _08160AEC + .4byte _08160C1C + .4byte _08160C48 + .4byte _08160C98 + .4byte _08160CA6 + .4byte _08160E8A + .4byte _08160B2C + .4byte _08160B60 + .4byte _08160B80 + .4byte _08160BDC + .4byte _08160CFC + .4byte _08160D48 + .4byte _08160E0C + .4byte _08160E38 + .4byte _08160E58 + .4byte _08160E70 +_08160918: + ldr r1, [r7] + ldrb r0, [r1] + adds r0, 0x1 + movs r4, 0 + strb r0, [r1] + movs r0, 0 + bl render_previous_quest_text + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + b _08160CAE +_08160932: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08160940 + b _08160E8A +_08160940: + ldr r1, [r7] + movs r0, 0x4 + b _08160E88 + .pool +_0816094C: + ldr r1, [r7] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 +_08160954: + movs r0, 0 + bl render_previous_quest_text + b _0816096A +_0816095C: + movs r0, 0 + bl sub_8160F50 + b _08160E8A +_08160964: + movs r0, 0 + bl sub_8161074 +_0816096A: + ldr r0, =0x0203bc34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bl sub_81611AC + b _08160E8A + .pool +_08160980: + movs r0, 0x1 + bl sub_8160F50 + b _08160E8A +_08160988: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160994 + b _08160E8A +_08160994: + bl sub_81D2C50 + ldr r0, =0x0203bc34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .pool +_081609A8: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + bne _08160A0A + ldr r5, =0x0203bc34 + ldr r0, [r5] + adds r0, 0x44 + ldrb r1, [r0] + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + bl sub_8161054 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl pokemon_moveset_pad_ + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + beq _08160A04 + ldr r0, =gUnknown_085EF8E4 + bl sub_816084C + ldr r1, =0x020375e0 + movs r0, 0x1 + strh r0, [r1] + ldr r1, [r5] + movs r0, 0x1F + b _08160E88 + .pool +_08160A04: + ldr r1, [r5] + movs r0, 0x10 + b _08160E88 +_08160A0A: + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08160A18 + cmp r1, 0x1 + beq _08160A18 + b _08160E8A +_08160A18: + ldr r0, =0x0203bc38 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08160A30 + ldr r0, =0x0203bc34 + ldr r1, [r0] + movs r0, 0x3 + b _08160E88 + .pool +_08160A30: + cmp r0, 0x1 + beq _08160A36 + b _08160E8A +_08160A36: + ldr r0, =0x0203bc34 + ldr r1, [r0] + movs r0, 0x5 + b _08160E88 + .pool +_08160A44: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160A50 + b _08160E8A +_08160A50: + bl sub_81D2C50 + ldr r0, =0x0203bc34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .pool +_08160A64: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + bne _08160A7C + ldr r0, =0x020375e0 + strh r1, [r0] + b _08160E82 + .pool +_08160A7C: + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08160A8A + cmp r1, 0x1 + beq _08160A8A + b _08160E8A +_08160A8A: + ldr r0, =0x0203bc38 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08160AA4 + ldr r0, =0x0203bc34 + ldr r1, [r0] + movs r0, 0x3 + b _08160E88 + .pool +_08160AA4: + cmp r0, 0x1 + beq _08160AAA + b _08160E8A +_08160AAA: + ldr r0, =0x0203bc34 + ldr r1, [r0] + movs r0, 0x5 + b _08160E88 + .pool +_08160AB8: + ldr r0, =gUnknown_085EF8F3 + bl sub_816084C + ldr r0, =0x0203bc34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .pool +_08160AD0: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160ADC + b _08160E8A +_08160ADC: + bl sub_81D2C50 + ldr r0, =0x0203bc34 + ldr r1, [r0] + movs r0, 0x12 + b _08160E88 + .pool +_08160AEC: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + bne _08160B10 + ldr r0, =gUnknown_085EFA10 + bl sub_816084C + ldr r0, =0x0203bc34 + ldr r1, [r0] + movs r0, 0x13 + b _08160E88 + .pool +_08160B10: + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08160B1E + cmp r1, 0x1 + beq _08160B1E + b _08160E8A +_08160B1E: + ldr r0, =0x0203bc34 + ldr r1, [r0] + movs r0, 0x18 + b _08160E88 + .pool +_08160B2C: + ldr r4, =0x02021dc4 + bl sub_8161054 + movs r1, 0xD + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + adds r0, r4, 0 + bl CopyString + ldr r0, =gUnknown_085EF960 + bl sub_816084C + ldr r0, =0x0203bc34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .pool +_08160B60: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160B6C + b _08160E8A +_08160B6C: + bl sub_81D2C50 + ldr r0, =0x0203bc34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .pool +_08160B80: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + bne _08160B98 + ldr r0, =0x0203bc34 + ldr r1, [r0] + movs r0, 0x1B + b _08160E88 + .pool +_08160B98: + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08160BA6 + cmp r1, 0x1 + beq _08160BA6 + b _08160E8A +_08160BA6: + ldr r0, =0x0203bc38 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08160BC4 + ldr r2, =0x0203bc34 + ldr r1, [r2] + movs r0, 0x3 + strb r0, [r1] + adds r7, r2, 0 + b _08160BD0 + .pool +_08160BC4: + ldr r7, =0x0203bc34 + cmp r0, 0x1 + bne _08160BD0 + ldr r1, [r7] + movs r0, 0x5 + strb r0, [r1] +_08160BD0: + ldr r1, [r7] + movs r0, 0x10 + b _08160E88 + .pool +_08160BDC: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160BE8 + b _08160E8A +_08160BE8: + movs r0, 0x3 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, =0x0203bc38 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08160C08 + ldr r0, =0x0203bc34 + ldr r1, [r0] + movs r0, 0x3 + b _08160E88 + .pool +_08160C08: + cmp r0, 0x1 + beq _08160C0E + b _08160E8A +_08160C0E: + ldr r0, =0x0203bc34 + ldr r1, [r0] + movs r0, 0x5 + b _08160E88 + .pool +_08160C1C: + bl sub_81D2C3C + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _08160C2A + b _08160E8A +_08160C2A: + ldr r0, =0x0203bc34 + ldr r1, [r0] + movs r0, 0x14 + strb r0, [r1] + subs r0, 0x15 + str r2, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _08160E8A + .pool +_08160C48: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08160C56 + b _08160E8A +_08160C56: + bl sub_8161054 + lsls r0, 16 + lsrs r0, 16 + ldr r4, =0x020244ec + ldr r1, =0x0203bc34 + ldr r1, [r1] + adds r1, 0x44 + ldrb r1, [r1] + ldr r2, =0x020244e9 + ldrb r2, [r2] + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldr r3, =sub_8160740 + str r0, [sp] + adds r0, r4, 0 + bl sub_81BFA38 + bl sub_8160EA0 + b _08160E8A + .pool +_08160C98: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + beq _08160CA4 + b _08160E8A +_08160CA4: + b _08160E82 +_08160CA6: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] +_08160CAE: + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + b _08160E8A +_08160CB8: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x0203bc34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + b _08160E88 + .pool +_08160CD8: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08160CE6 + b _08160E8A +_08160CE6: + bl sub_8160EA0 + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + b _08160E8A + .pool +_08160CFC: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =0x0203bc34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, =0x0203bc38 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08160D30 + movs r0, 0x1 + bl render_previous_quest_text + b _08160D3A + .pool +_08160D30: + cmp r0, 0x1 + bne _08160D3A + movs r0, 0x1 + bl sub_8161074 +_08160D3A: + bl sub_8161234 + movs r0, 0x3 + movs r1, 0x2 + bl CopyWindowToVram + b _08160E8A +_08160D48: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08160D56 + b _08160E8A +_08160D56: + ldr r1, [r7] + adds r2, r1, 0 + adds r2, 0x45 + ldrb r0, [r2] + cmp r0, 0x4 + bne _08160D6C + movs r0, 0x18 + b _08160E88 + .pool +_08160D6C: + adds r0, r1, 0 + adds r0, 0x44 + ldrb r0, [r0] + movs r4, 0x64 + muls r0, r4 + ldr r5, =0x020244ec + adds r0, r5 + ldrb r1, [r2] + adds r1, 0xD + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + ldr r2, =0x02021ec4 + movs r1, 0xD + mov r8, r1 + mov r1, r8 + muls r1, r0 + ldr r6, =gMoveNames + adds r1, r6 + adds r0, r2, 0 + bl CopyString + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0x44 + ldrb r0, [r0] + muls r0, r4 + adds r0, r5 + adds r1, 0x45 + ldrb r1, [r1] + bl sub_806B9A8 + ldr r0, [r7] + adds r0, 0x44 + ldrb r0, [r0] + muls r4, r0 + adds r4, r5 + bl sub_8161054 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [r7] + adds r0, 0x45 + ldrb r2, [r0] + adds r0, r4, 0 + bl sub_80691F4 + ldr r4, =0x02021dc4 + bl sub_8161054 + mov r1, r8 + muls r1, r0 + adds r1, r6 + adds r0, r4, 0 + bl CopyString + ldr r0, =gUnknown_085EF979 + bl sub_816084C + ldr r1, [r7] + movs r0, 0x1E + strb r0, [r1] + ldr r1, =0x020375e0 + movs r0, 0x1 + strh r0, [r1] + b _08160E8A + .pool +_08160E0C: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + bne _08160E8A + ldr r0, =gUnknown_085EF9A6 + bl sub_816084C + ldr r0, =0x0203bc34 + ldr r1, [r0] + movs r0, 0x1F + strb r0, [r1] + ldr r0, =0x0000016f + bl fanfare_play + b _08160E8A + .pool +_08160E38: + bl sub_81D2C3C + lsls r0, 16 + cmp r0, 0 + bne _08160E8A + ldr r0, =0x0000016f + bl fanfare_play + ldr r0, =0x0203bc34 + ldr r1, [r0] + movs r0, 0x20 + b _08160E88 + .pool +_08160E58: + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + beq _08160E8A + ldr r0, =0x0203bc34 + ldr r1, [r0] + movs r0, 0x21 + b _08160E88 + .pool +_08160E70: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08160E8A + movs r0, 0x5 + bl audio_play +_08160E82: + ldr r0, =0x0203bc34 + ldr r1, [r0] + movs r0, 0xE +_08160E88: + strb r0, [r1] +_08160E8A: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160868 + + thumb_func_start sub_8160EA0 +sub_8160EA0: @ 8160EA0 + push {r4,lr} + bl sub_8161234 + ldr r4, =0x0203bc34 + ldr r0, [r4] + movs r1, 0x89 + lsls r1, 1 + adds r0, r1 + ldrb r0, [r0] + ldr r1, =0x0203bc38 + adds r2, r1, 0x2 + bl sub_81AE6C8 + bl FreeAllWindowBuffers + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160EA0 + + thumb_func_start render_previous_quest_text +render_previous_quest_text: @ 8160EE0 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + movs r2, 0 + ldr r6, =0x02020630 + ldr r4, =0x0203bc34 + movs r3, 0x4 +_08160EF0: + ldr r0, [r4] + adds r0, 0x1 + 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] + adds r2, 0x1 + cmp r2, 0xF + ble _08160EF0 + cmp r5, 0 + bne _08160F38 + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EF8C2 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0x3 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl Print +_08160F38: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end render_previous_quest_text + + thumb_func_start sub_8160F50 +sub_8160F50: @ 8160F50 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r6, =0x0203bc34 + ldr r0, [r6] + movs r4, 0x89 + lsls r4, 1 + adds r0, r4 + ldrb r0, [r0] + bl ListMenuHandleInput + adds r5, r0, 0 + ldr r0, [r6] + adds r0, r4 + ldrb r0, [r0] + ldr r4, =0x0203bc38 + adds r2, r4, 0x2 + adds r1, r4, 0 + bl get_coro_args_x18_x1A + movs r0, 0x2 + negs r0, r0 + cmp r5, r0 + beq _08160FE4 + adds r0, 0x1 + cmp r5, r0 + bne _08161010 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0 + bne _08160F9C + bl GetLRKeysState + lsls r0, 24 + cmp r0, 0 + beq _0816103E +_08160F9C: + movs r0, 0x5 + bl audio_play + cmp r7, 0 + bne _08160FC4 + movs r0, 0x1 + bl PutWindowTilemap + ldr r0, [r6] + movs r1, 0x5 + strb r1, [r0] + movs r0, 0x1 + strb r0, [r4, 0x4] + b _08160FD4 + .pool +_08160FC4: + movs r0, 0 + bl PutWindowTilemap + ldr r0, [r6] + movs r2, 0 + movs r1, 0x3 + strb r1, [r0] + strb r2, [r4, 0x4] +_08160FD4: + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + bl sub_8161054 + bl sub_816137C + b _0816103E +_08160FE4: + movs r0, 0x5 + bl audio_play + bl sub_8161234 + ldr r1, [r6] + movs r0, 0xC + strb r0, [r1] + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EF9E6 + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + bl sub_81D2BF4 + b _0816103E + .pool +_08161010: + movs r0, 0x5 + bl audio_play + bl sub_8161234 + ldr r1, [r6] + movs r0, 0x8 + strb r0, [r1] + ldr r0, =0x02021dc4 + movs r1, 0xD + muls r1, r5 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EF8DA + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + bl sub_81D2BF4 +_0816103E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160F50 + + thumb_func_start sub_8161054 +sub_8161054: @ 8161054 + ldr r0, =0x0203bc34 + ldr r2, [r0] + ldr r1, =0x0203bc38 + ldrh r0, [r1, 0x2] + ldrh r1, [r1] + adds r0, r1 + lsls r0, 3 + adds r2, 0x4C + adds r2, r0 + ldr r0, [r2] + bx lr + .pool + thumb_func_end sub_8161054 + + thumb_func_start sub_8161074 +sub_8161074: @ 8161074 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081610A6 + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EF8C2 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0x3 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0x1 + str r0, [sp] + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl Print +_081610A6: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161074 + + thumb_func_start sub_81610B8 +sub_81610B8: @ 81610B8 + push {r4-r7,lr} + ldr r2, =0x0203bc34 + ldr r0, [r2] + movs r1, 0x8A + lsls r1, 1 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r2] + ldr r2, =0x00000113 + adds r1, r0, r2 + movs r0, 0x1 + negs r0, r0 + strb r0, [r1] + bl sub_81611AC + movs r4, 0 + ldr r5, =gUnknown_085CEC10 +_081610DC: + adds r2, r4, 0 + cmp r4, 0 + bge _081610E4 + adds r2, r4, 0x3 +_081610E4: + asrs r2, 2 + lsls r1, r2, 2 + subs r1, r4, r1 + lsls r1, 19 + movs r0, 0xD0 + lsls r0, 15 + adds r1, r0 + asrs r1, 16 + lsls r2, 19 + movs r0, 0x90 + lsls r0, 14 + adds r2, r0 + asrs r2, 16 + adds r0, r5, 0 + movs r3, 0 + bl AddObjectToFront + ldr r2, =0x0203bc34 + ldr r1, [r2] + adds r1, 0x1 + adds r1, r4 + strb r0, [r1] + adds r4, 0x1 + cmp r4, 0x7 + ble _081610DC + movs r4, 0 + ldr r7, =gUnknown_085CEC10 + adds r6, r2, 0 +_0816111C: + adds r2, r4, 0 + cmp r4, 0 + bge _08161124 + adds r2, r4, 0x3 +_08161124: + asrs r2, 2 + lsls r1, r2, 2 + subs r1, r4, r1 + lsls r1, 19 + movs r0, 0xD0 + lsls r0, 15 + adds r1, r0 + asrs r1, 16 + lsls r2, 19 + movs r0, 0xD0 + lsls r0, 14 + adds r2, r0 + asrs r2, 16 + adds r0, r7, 0 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r6] + adds r2, r4, 0 + adds r2, 0x8 + adds r1, 0x1 + adds r1, r2 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x1 + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =0x02020630 + adds r0, r5 + movs r1, 0x2 + bl StartObjectImageAnim + adds r4, 0x1 + cmp r4, 0x7 + ble _0816111C + movs r4, 0 + ldr r3, =0x0203bc34 + movs r2, 0x4 +_08161176: + ldr r0, [r3] + adds r0, 0x1 + adds r0, r4 + 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 r4, 0x1 + cmp r4, 0xF + ble _08161176 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81610B8 + + thumb_func_start sub_81611AC +sub_81611AC: @ 81611AC + push {r4-r6,lr} + ldr r4, =0x0203bc34 + ldr r1, [r4] + movs r2, 0x8A + lsls r2, 1 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081611D4 + ldr r0, =gUnknown_085CEBC0 + movs r3, 0x8B + lsls r3, 1 + adds r1, r3 + bl AddScrollIndicatorArrowPair + ldr r1, [r4] + movs r5, 0x8A + lsls r5, 1 + adds r1, r5 + strb r0, [r1] +_081611D4: + ldr r0, [r4] + ldr r6, =0x00000113 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0xFF + bne _08161210 + ldr r0, =0x0203ce8c + adds r2, r0, 0 + ldr r1, =gUnknown_085CEBD0 + ldm r1!, {r3,r5,r6} + stm r2!, {r3,r5,r6} + ldr r1, [r1] + str r1, [r2] + ldr r2, [r4] + movs r3, 0x88 + lsls r3, 1 + adds r1, r2, r3 + ldrb r1, [r1] + ldr r5, =0x00000111 + adds r2, r5 + ldrb r2, [r2] + subs r1, r2 + strh r1, [r0, 0x8] + ldr r1, =0x0203bc38 + bl AddScrollIndicatorArrowPair + ldr r1, [r4] + ldr r6, =0x00000113 + adds r1, r6 + strb r0, [r1] +_08161210: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81611AC + + thumb_func_start sub_8161234 +sub_8161234: @ 8161234 + push {r4,lr} + ldr r4, =0x0203bc34 + ldr r0, [r4] + movs r2, 0x8A + lsls r2, 1 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08161256 + bl RemoveScrollIndicatorArrowPair + ldr r0, [r4] + movs r1, 0x8A + lsls r1, 1 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] +_08161256: + ldr r0, [r4] + ldr r2, =0x00000113 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08161270 + bl RemoveScrollIndicatorArrowPair + ldr r0, [r4] + ldr r2, =0x00000113 + adds r1, r0, r2 + movs r0, 0xFF + strb r0, [r1] +_08161270: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161234 + + thumb_func_start sub_8161280 +sub_8161280: @ 8161280 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + ldr r4, =0x0203bc34 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x44 + ldrb r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + adds r0, r2 + adds r1, 0x12 + bl sub_806E0B4 + ldr r1, [r4] + movs r6, 0x88 + lsls r6, 1 + adds r1, r6 + strb r0, [r1] + movs r5, 0 + ldr r0, [r4] + adds r0, r6 + ldrb r0, [r0] + cmp r5, r0 + bge _081612F6 + mov r8, r4 + movs r0, 0xD + mov r12, r0 + ldr r2, =gMoveNames + mov r9, r2 +_081612C2: + mov r7, r8 + ldr r4, [r7] + lsls r3, r5, 3 + adds r2, r4, 0 + adds r2, 0x48 + adds r2, r3 + lsls r0, r5, 1 + adds r1, r4, 0 + adds r1, 0x12 + adds r1, r0 + ldrh r0, [r1] + mov r7, r12 + muls r7, r0 + adds r0, r7, 0 + add r0, r9 + str r0, [r2] + adds r0, r4, 0 + adds r0, 0x4C + adds r0, r3 + ldrh r1, [r1] + str r1, [r0] + adds r5, 0x1 + adds r0, r4, r6 + ldrb r0, [r0] + cmp r5, r0 + blt _081612C2 +_081612F6: + ldr r4, =0x0203bc34 + ldr r0, [r4] + adds r0, 0x44 + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + ldr r0, =0x02021cc4 + mov r1, sp + bl CopyString_Limit10 + ldr r2, [r4] + movs r5, 0x88 + lsls r5, 1 + adds r3, r2, r5 + ldrb r0, [r3] + lsls r0, 3 + adds r1, r2, 0 + adds r1, 0x48 + adds r1, r0 + ldr r0, =gUnknown_085E8CF0 + str r0, [r1] + ldrb r0, [r3] + lsls r0, 3 + adds r2, 0x4C + adds r2, r0 + movs r0, 0x2 + negs r0, r0 + str r0, [r2] + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x48 + adds r1, r5 + ldrb r1, [r1] + bl sub_81D28C8 + ldr r1, [r4] + ldr r2, =0x00000111 + adds r1, r2 + strb r0, [r1] + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161280 + + thumb_func_start sub_816137C +sub_816137C: @ 816137C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + ldr r0, =0x0203bc38 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _08161394 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + bne _081613CC +_08161394: + movs r5, 0 + ldr r4, =0x02020630 + ldr r3, =0x0203bc34 + movs r2, 0x4 +_0816139C: + ldr r0, [r3] + adds r0, 0x1 + adds r0, r5 + ldrb r1, [r0] + 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] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0xF + bls _0816139C + b _081614FE + .pool +_081613CC: + ldr r1, =gContestEffects + ldr r0, =gContestMoves + lsls r4, 3 + adds r0, r4, r0 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x1] + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r6, r0, 24 + mov r8, r4 + cmp r6, 0xFF + bne _081613EE + movs r6, 0 +_081613EE: + movs r5, 0 + ldr r7, =0x0203bc34 + ldr r4, =0x02020630 +_081613F4: + cmp r5, r6 + bcs _08161420 + ldr r0, [r7] + adds r0, 0x1 + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartObjectImageAnim + b _08161436 + .pool +_08161420: + ldr r0, [r7] + adds r0, 0x1 + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0 + bl StartObjectImageAnim +_08161436: + ldr r0, [r7] + adds r0, 0x1 + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + movs r3, 0x5 + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x7 + bls _081613F4 + ldr r1, =gContestEffects + ldr r0, =gContestMoves + add r0, r8 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x2] + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0xFF + bne _0816147C + movs r6, 0 +_0816147C: + movs r5, 0 + ldr r0, =0x0203bc34 + mov r8, r0 + ldr r7, =0x02020630 +_08161484: + cmp r5, r6 + bcs _081614B8 + mov r1, r8 + ldr r0, [r1] + adds r4, r5, 0 + adds r4, 0x8 + adds r0, 0x1 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + movs r1, 0x3 + bl StartObjectImageAnim + b _081614D4 + .pool +_081614B8: + mov r3, r8 + ldr r0, [r3] + adds r4, r5, 0 + adds r4, 0x8 + adds r0, 0x1 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + movs r1, 0x2 + bl StartObjectImageAnim +_081614D4: + mov r1, r8 + ldr r0, [r1] + adds r0, 0x1 + 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 r3, 0x5 + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x7 + bls _08161484 +_081614FE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_816137C + + thumb_func_start hm_prepare_dive_probably +hm_prepare_dive_probably: @ 8161508 + push {r4-r6,lr} + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + movs r6, 0x64 + muls r0, r6 + ldr r4, =0x020244ec + adds r0, r4 + movs r1, 0x3A + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + muls r0, r6 + adds r0, r4 + movs r1, 0x39 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x5 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r4, r0 + bhi _08161558 + movs r0, 0 + b _0816155A + .pool +_08161558: + movs r0, 0x1 +_0816155A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end hm_prepare_dive_probably + + thumb_func_start sub_8161560 +sub_8161560: @ 8161560 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x0203cec8 + movs r1, 0xA + strb r1, [r0, 0xB] + ldrb r1, [r0, 0x9] + strb r1, [r0, 0xA] + bl brm_get_pokemon_selection + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_81B0FCC + movs r0, 0x5 + bl display_pokemon_menu_message + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1370 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161560 + + thumb_func_start sub_81615A8 +sub_81615A8: @ 81615A8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + str r4, [sp, 0x4] + ldr r1, =0x0203cec8 + ldrb r7, [r1, 0x9] + mov r8, r7 + ldrb r0, [r1, 0xA] + adds r5, r0, 0 + cmp r5, 0x6 + bls _081615EC + movs r0, 0 + strb r0, [r1, 0xB] + bl display_pokemon_menu_message + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1370 + str r1, [r0] + b _08161658 + .pool +_081615EC: + movs r0, 0x64 + mov r10, r0 + mov r0, r10 + muls r0, r5 + ldr r1, =0x020244ec + mov r9, r1 + adds r6, r0, r1 + adds r0, r6, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _0816161A + cmp r7, r5 + beq _0816161A + adds r0, r6, 0 + movs r1, 0x3A + bl pokemon_getattr + cmp r0, r4 + bne _08161628 +_0816161A: + ldr r0, [sp, 0x4] + bl sub_81617B8 + b _08161658 + .pool +_08161628: + movs r0, 0x1 + bl audio_play + mov r1, r10 + mov r0, r8 + muls r0, r1 + add r0, r9 + movs r1, 0x3A + bl pokemon_getattr + movs r1, 0x5 + bl __udivsi3 + adds r3, r0, 0 + lsls r3, 16 + asrs r3, 16 + movs r2, 0x1 + negs r2, r2 + ldr r0, =sub_816166C + str r0, [sp] + ldr r0, [sp, 0x4] + mov r1, r8 + bl sub_81B1F18 +_08161658: + 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_81615A8 + + thumb_func_start sub_816166C +sub_816166C: @ 816166C + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl audio_play + ldr r5, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r5, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3A + bl pokemon_getattr + movs r1, 0x5 + bl __udivsi3 + adds r3, r0, 0 + lsls r3, 16 + asrs r3, 16 + ldrb r1, [r5, 0xA] + ldr r0, =sub_81616C0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x1 + bl sub_81B1F18 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816166C + + thumb_func_start sub_81616C0 +sub_81616C0: @ 81616C0 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =0x0203cec8 + movs r1, 0xA + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02021cc4 + bl GetMonNickname + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E9C17 + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8161724 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81616C0 + + thumb_func_start sub_8161724 +sub_8161724: @ 8161724 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08161772 + ldr r4, =0x0203cec8 + 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, 0x6 + movs r1, 0 + bl sub_8198070 + movs r0, 0x6 + bl ClearWindowTilemap + movs r0, 0 + bl display_pokemon_menu_message + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B1370 + str r1, [r0] +_08161772: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161724 + + thumb_func_start sub_8161784 +sub_8161784: @ 8161784 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081617AA + movs r0, 0x5 + bl display_pokemon_menu_message + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81B1370 + str r0, [r1] +_081617AA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161784 + + thumb_func_start sub_81617B8 +sub_81617B8: @ 81617B8 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x5 + bl audio_play + ldr r0, =gUnknown_085E9712 + movs r1, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8161784 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81617B8 + + thumb_func_start sub_81617F4 +sub_81617F4: @ 81617F4 + push {r4,lr} + ldr r0, =0x0203bc40 + mov r12, r0 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r2, =0x00002734 + adds r0, r1, r2 + mov r4, r12 + str r0, [r4] + movs r3, 0xA + strb r3, [r4, 0x4] + adds r2, 0xA + adds r0, r1, r2 + str r0, [r4, 0x8] + strb r3, [r4, 0xC] + ldr r4, =0x00002748 + adds r0, r1, r4 + mov r2, r12 + str r0, [r2, 0x10] + strb r3, [r2, 0x14] + adds r4, 0xA + adds r0, r1, r4 + str r0, [r2, 0x18] + movs r2, 0x1E + mov r0, r12 + strb r2, [r0, 0x1C] + adds r4, 0x1E + adds r0, r1, r4 + mov r4, r12 + str r0, [r4, 0x20] + mov r0, r12 + adds r0, 0x24 + strb r2, [r0] + ldr r2, =0x0000278e + adds r0, r1, r2 + str r0, [r4, 0x28] + mov r0, r12 + adds r0, 0x2C + strb r3, [r0] + ldr r4, =0x00002798 + adds r0, r1, r4 + mov r2, r12 + str r0, [r2, 0x30] + adds r2, 0x34 + movs r0, 0x28 + strb r0, [r2] + adds r4, 0x28 + adds r1, r4 + mov r0, r12 + str r1, [r0, 0x38] + adds r0, 0x3C + strb r3, [r0] + bl sub_8126968 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81617F4 + + thumb_func_start sub_8161880 +sub_8161880: @ 8161880 + push {r4,r5,lr} + lsls r0, 24 + movs r3, 0 + ldr r1, =0x0203bc40 + lsrs r2, r0, 21 + adds r0, r2, r1 + ldrb r0, [r0, 0x4] + cmp r3, r0 + bcs _081618AA + adds r5, r1, 0 + movs r4, 0 +_08161896: + adds r0, r2, r5 + ldr r1, [r0] + adds r1, r3 + strb r4, [r1] + adds r1, r3, 0x1 + lsls r1, 24 + lsrs r3, r1, 24 + ldrb r0, [r0, 0x4] + cmp r3, r0 + bcc _08161896 +_081618AA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161880 + + thumb_func_start sub_81618B4 +sub_81618B4: @ 81618B4 + push {r4,lr} + movs r4, 0 +_081618B8: + adds r0, r4, 0 + bl sub_8161880 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _081618B8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81618B4 + + thumb_func_start sub_81618D0 +sub_81618D0: @ 81618D0 + push {r4,lr} + lsls r0, 24 + movs r2, 0 + ldr r1, =0x0203bc40 + lsrs r0, 21 + adds r0, r1 + movs r1, 0x4 + ldrsb r1, [r0, r1] + cmp r2, r1 + bge _0816190C + adds r4, r0, 0 + adds r3, r1, 0 +_081618E8: + lsls r0, r2, 24 + asrs r1, r0, 24 + ldr r0, [r4] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08161900 + adds r0, r1, 0 + b _08161910 + .pool +_08161900: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + asrs r0, 24 + cmp r0, r3 + blt _081618E8 +_0816190C: + movs r0, 0x1 + negs r0, r0 +_08161910: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81618D0 + + thumb_func_start sub_8161918 +sub_8161918: @ 8161918 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, =gUnknown_085A5C08 + lsls r0, r3, 5 + adds r0, r1 + ldrb r0, [r0, 0x13] + movs r2, 0 + ldr r1, =0x0203bc40 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x4] + cmp r2, r1 + bcs _08161956 + ldr r4, [r0] +_08161936: + adds r0, r4, r2 + ldrb r0, [r0] + cmp r0, r3 + bne _0816194C + movs r0, 0x1 + b _08161958 + .pool +_0816194C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, r1 + bcc _08161936 +_08161956: + movs r0, 0 +_08161958: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8161918 + + thumb_func_start IsThereStorageSpaceForDecoration +IsThereStorageSpaceForDecoration: @ 8161960 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + cmp r4, 0 + beq _081619A0 + ldr r1, =gUnknown_085A5C08 + lsls r0, r4, 5 + adds r0, r1 + ldrb r5, [r0, 0x13] + adds r0, r5, 0 + bl sub_81618D0 + lsls r0, 24 + asrs r2, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _081619A0 + ldr r0, =0x0203bc40 + lsls r1, r5, 3 + adds r1, r0 + ldr r0, [r1] + adds r0, r2 + strb r4, [r0] + movs r0, 0x1 + b _081619A2 + .pool +_081619A0: + movs r0, 0 +_081619A2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end IsThereStorageSpaceForDecoration + + thumb_func_start sub_81619A8 +sub_81619A8: @ 81619A8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _081619D4 + ldr r1, =gUnknown_085A5C08 + lsls r0, 5 + adds r0, r1 + ldrb r0, [r0, 0x13] + bl sub_81618D0 + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _081619D4 + movs r0, 0x1 + b _081619D6 + .pool +_081619D4: + movs r0, 0 +_081619D6: + pop {r1} + bx r1 + thumb_func_end sub_81619A8 + + thumb_func_start sub_81619DC +sub_81619DC: @ 81619DC + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r3, 0 + cmp r5, 0 + bne _081619F8 + b _08161A26 +_081619EA: + movs r0, 0 + strb r0, [r1] + adds r0, r6, 0 + bl sub_8161A38 + movs r0, 0x1 + b _08161A28 +_081619F8: + ldr r2, =0x0203bc40 + ldr r1, =gUnknown_085A5C08 + lsls r0, r5, 5 + adds r0, r1 + ldrb r4, [r0, 0x13] + lsls r0, r4, 3 + adds r0, r2 + ldrb r1, [r0, 0x4] + cmp r3, r1 + bcs _08161A26 + adds r6, r4, 0 + adds r4, r0, 0 + adds r2, r1, 0 +_08161A12: + ldr r0, [r4] + adds r1, r0, r3 + ldrb r0, [r1] + cmp r0, r5 + beq _081619EA + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r2 + bcc _08161A12 +_08161A26: + movs r0, 0 +_08161A28: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81619DC + + thumb_func_start sub_8161A38 +sub_8161A38: @ 8161A38 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + movs r6, 0 + ldr r2, =0x0203bc40 + lsrs r0, 21 + adds r1, r0, r2 + ldrb r3, [r1, 0x4] + cmp r6, r3 + bcs _08161ABC + adds r7, r0, 0 + mov r10, r1 + mov r0, r10 + str r0, [sp] +_08161A5C: + adds r1, r6, 0x1 + lsls r0, r1, 24 + lsrs r3, r0, 24 + adds r2, r7, 0 + mov r12, r1 + mov r1, r10 + ldrb r1, [r1, 0x4] + cmp r3, r1 + bcs _08161AAE + ldr r0, =0x0203bc40 + mov r9, r0 + adds r1, r0, 0 + mov r8, r1 +_08161A76: + mov r0, r9 + adds r5, r2, r0 + ldr r1, [r5] + adds r0, r1, r3 + ldrb r4, [r0] + adds r2, r4, 0 + cmp r2, 0 + beq _08161A9C + adds r0, r1, r6 + ldrb r1, [r0] + cmp r1, 0 + beq _08161A92 + cmp r1, r2 + bls _08161A9C +_08161A92: + ldrb r1, [r0] + strb r4, [r0] + ldr r0, [r5] + adds r0, r3 + strb r1, [r0] +_08161A9C: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + adds r2, r7, 0 + mov r1, r8 + adds r0, r2, r1 + ldrb r0, [r0, 0x4] + cmp r3, r0 + bcc _08161A76 +_08161AAE: + mov r3, r12 + lsls r0, r3, 24 + lsrs r6, r0, 24 + ldr r0, [sp] + ldrb r0, [r0, 0x4] + cmp r6, r0 + bcc _08161A5C +_08161ABC: + 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_8161A38 + + thumb_func_start sub_8161AD0 +sub_8161AD0: @ 8161AD0 + push {r4,r5,lr} + lsls r0, 24 + movs r4, 0 + movs r3, 0 + ldr r2, =0x0203bc40 + lsrs r1, r0, 21 + adds r0, r1, r2 + ldrb r0, [r0, 0x4] + cmp r4, r0 + bcs _08161B04 + adds r5, r2, 0 +_08161AE6: + adds r2, r1, r5 + ldr r0, [r2] + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _08161AF8 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_08161AF8: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + ldrb r2, [r2, 0x4] + cmp r3, r2 + bcc _08161AE6 +_08161B04: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8161AD0 + + thumb_func_start sub_8161B10 +sub_8161B10: @ 8161B10 + push {r4,r5,lr} + movs r5, 0 + movs r4, 0 +_08161B16: + adds r0, r4, 0 + bl sub_8161AD0 + adds r0, r5, r0 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _08161B16 + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8161B10 + + thumb_func_start sub_8161B34 +sub_8161B34: @ 8161B34 + push {r4,r5,lr} + ldr r5, =0x03005d8c + ldr r0, [r5] + ldr r4, =0x000031dc + adds r0, r4 + movs r1, 0 + movs r2, 0x1C + bl memset + ldr r0, [r5] + adds r0, r4 + ldr r1, =0x00000197 + strh r1, [r0, 0x8] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161B34 + + thumb_func_start sub_8161B60 +sub_8161B60: @ 8161B60 + push {r4-r6,lr} + movs r2, 0 + ldr r6, =0x0203bc86 + ldr r4, =0x0203bc80 + movs r3, 0 + adds r5, r4, 0x1 +_08161B6C: + lsls r1, r2, 1 + adds r0, r1, r4 + strb r3, [r0] + adds r1, r5 + strb r3, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _08161B6C + movs r0, 0 + strb r0, [r6] + strb r0, [r6, 0x1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161B60 + + thumb_func_start sub_8161B94 +sub_8161B94: @ 8161B94 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + lsls r0, 16 + cmp r0, 0 + bne _08161BBC + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r2, =0x000031dc + adds r1, r2 + ldr r2, =0x00000197 + b _08161BC8 + .pool +_08161BBC: + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r2, =0x000031dc + adds r1, r2 + movs r2, 0xCC + lsls r2, 1 +_08161BC8: + strh r2, [r1, 0x8] + adds r7, r0, 0 + ldr r6, =0x02024744 + ldr r0, [r7] + ldr r5, =0x000031dc + adds r0, r5 + ldrh r1, [r0, 0x8] + movs r4, 0 + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + str r4, [sp, 0xC] + adds r0, r6, 0 + movs r2, 0x28 + movs r3, 0x20 + bl create_pokemon_set_level + ldr r0, [r7] + adds r0, r5 + movs r1, 0x28 + strb r1, [r0, 0xC] + ldr r0, [r7] + adds r0, r5 + strb r4, [r0, 0xD] + ldr r0, [r7] + adds r0, r5 + movs r1, 0x1 + strb r1, [r0, 0x13] + adds r0, r6, 0 + movs r1, 0x42 + bl pokemon_getattr + ldr r1, [r7] + adds r1, r5 + str r0, [r1] + adds r0, r6, 0 + movs r1, 0 + bl pokemon_getattr + ldr r1, [r7] + adds r1, r5 + str r0, [r1, 0x4] + adds r0, r6, 0 + movs r1, 0x3A + bl pokemon_getattr + ldr r1, [r7] + adds r1, r5 + movs r2, 0 + mov r8, r2 + strh r0, [r1, 0xA] + adds r0, r6, 0 + movs r1, 0x16 + bl pokemon_getattr + ldr r1, [r7] + adds r1, r5 + strb r0, [r1, 0xE] + adds r0, r6, 0 + movs r1, 0x17 + bl pokemon_getattr + ldr r1, [r7] + adds r1, r5 + strb r0, [r1, 0xF] + adds r0, r6, 0 + movs r1, 0x18 + bl pokemon_getattr + ldr r1, [r7] + adds r1, r5 + strb r0, [r1, 0x10] + adds r0, r6, 0 + movs r1, 0x21 + bl pokemon_getattr + ldr r1, [r7] + adds r1, r5 + strb r0, [r1, 0x11] + adds r0, r6, 0 + movs r1, 0x2F + bl pokemon_getattr + ldr r1, [r7] + adds r1, r5 + strb r0, [r1, 0x12] + ldr r4, =0x0203bc86 + mov r0, r8 + strb r0, [r4] + bl GenerateRandomNumber + ldr r5, =gUnknown_085CEC30 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x14 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 1 + adds r1, r5 + ldrb r0, [r1] + strb r0, [r4, 0x1] + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161B94 + + thumb_func_start sub_8161CBC +sub_8161CBC: @ 8161CBC + push {lr} + bl sub_8161B34 + bl sub_8161B60 + ldr r0, =0x020375e0 + ldrh r0, [r0] + bl sub_8161B94 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161CBC + + thumb_func_start mapnumbers_history_shift_sav1_0_2_4_out +mapnumbers_history_shift_sav1_0_2_4_out: @ 8161CD8 + ldr r0, =0x0203bc80 + ldrb r1, [r0, 0x2] + strb r1, [r0, 0x4] + ldrb r1, [r0, 0x3] + strb r1, [r0, 0x5] + ldrb r1, [r0] + strb r1, [r0, 0x2] + ldrb r1, [r0, 0x1] + strb r1, [r0, 0x3] + ldr r1, =0x03005d8c + ldr r2, [r1] + ldrb r1, [r2, 0x4] + strb r1, [r0] + ldrb r1, [r2, 0x5] + strb r1, [r0, 0x1] + bx lr + .pool + thumb_func_end mapnumbers_history_shift_sav1_0_2_4_out + + thumb_func_start sub_8161D00 +sub_8161D00: @ 8161D00 + push {r4,r5,lr} + movs r1, 0 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x000031dc + adds r0, r2 + ldrb r0, [r0, 0x13] + cmp r0, 0 + beq _08161D3E + ldr r0, =0x0203bc86 + strb r1, [r0] + ldr r5, =gUnknown_085CEC30 + adds r4, r0, 0 +_08161D1A: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x14 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 1 + adds r1, r5 + ldrb r1, [r1] + ldrb r0, [r4, 0x1] + cmp r0, r1 + beq _08161D1A + strb r1, [r4, 0x1] +_08161D3E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161D00 + + thumb_func_start sub_8161D54 +sub_8161D54: @ 8161D54 + push {r4-r7,lr} + movs r4, 0 + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xF0 + lsls r1, 12 + ands r1, r0 + cmp r1, 0 + bne _08161D6E + bl sub_8161D00 + b _08161DE2 +_08161D6E: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000031dc + adds r0, r1 + ldrb r0, [r0, 0x13] + cmp r0, 0 + beq _08161DE2 + ldr r7, =0x0203bc86 + ldr r3, =gUnknown_085CEC30 +_08161D80: + lsls r0, r4, 1 + adds r0, r4 + lsls r2, r0, 1 + adds r1, r2, r3 + ldrb r0, [r7, 0x1] + ldrb r1, [r1] + cmp r0, r1 + bne _08161DD8 + ldr r6, =gUnknown_085CEC30 + adds r5, r2, 0x1 + ldr r4, =0x0203bc80 +_08161D96: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x5 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + adds r0, r5 + adds r0, r6 + ldrb r1, [r0] + ldrb r0, [r4, 0x4] + cmp r0, 0 + bne _08161DBA + ldrb r0, [r4, 0x5] + cmp r0, r1 + beq _08161D96 +_08161DBA: + cmp r1, 0xFF + beq _08161D96 + strb r1, [r7, 0x1] + b _08161DE2 + .pool +_08161DD8: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x13 + bls _08161D80 +_08161DE2: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8161D54 + + thumb_func_start sub_8161DE8 +sub_8161DE8: @ 8161DE8 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r3, =0x000031dc + adds r0, r3 + ldrb r0, [r0, 0x13] + cmp r0, 0 + beq _08161E20 + ldr r0, =0x0203bc86 + ldrb r3, [r0] + cmp r2, r3 + bne _08161E20 + ldrb r0, [r0, 0x1] + cmp r1, r0 + bne _08161E20 + movs r0, 0x1 + b _08161E22 + .pool +_08161E20: + movs r0, 0 +_08161E22: + pop {r1} + bx r1 + thumb_func_end sub_8161DE8 + + thumb_func_start sub_8161E28 +sub_8161E28: @ 8161E28 + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, =0x02024744 + bl zero_enemy_party_data + ldr r4, =0x03005d8c + ldr r0, [r4] + ldr r1, =0x000031dc + adds r0, r1 + ldrh r1, [r0, 0x8] + ldrb r2, [r0, 0xC] + ldr r3, [r0] + ldr r0, [r0, 0x4] + str r0, [sp] + adds r0, r5, 0 + bl sub_8068060 + ldr r2, [r4] + ldr r0, =0x000031e9 + adds r2, r0 + adds r0, r5, 0 + movs r1, 0x37 + bl pokemon_setattr + ldr r2, [r4] + ldr r1, =0x000031e6 + adds r2, r1 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_setattr + ldr r2, [r4] + ldr r0, =0x000031ea + adds r2, r0 + adds r0, r5, 0 + movs r1, 0x16 + bl pokemon_setattr + ldr r2, [r4] + ldr r1, =0x000031eb + adds r2, r1 + adds r0, r5, 0 + movs r1, 0x17 + bl pokemon_setattr + ldr r2, [r4] + ldr r0, =0x000031ec + adds r2, r0 + adds r0, r5, 0 + movs r1, 0x18 + bl pokemon_setattr + ldr r2, [r4] + ldr r1, =0x000031ed + adds r2, r1 + adds r0, r5, 0 + movs r1, 0x21 + bl pokemon_setattr + ldr r2, [r4] + ldr r0, =0x000031ee + adds r2, r0 + adds r0, r5, 0 + movs r1, 0x2F + bl pokemon_setattr + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161E28 + + thumb_func_start sub_8161EDC +sub_8161EDC: @ 8161EDC + push {lr} + ldr r0, =0x03005d8c + ldr r1, [r0] + ldrb r0, [r1, 0x4] + ldrb r1, [r1, 0x5] + bl sub_8161DE8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08161F10 + bl GenerateRandomNumber + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + cmp r1, 0 + bne _08161F10 + bl sub_8161E28 + movs r0, 0x1 + b _08161F12 + .pool +_08161F10: + movs r0, 0 +_08161F12: + pop {r1} + bx r1 + thumb_func_end sub_8161EDC + + thumb_func_start sub_8161F18 +sub_8161F18: @ 8161F18 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x39 + bl pokemon_getattr + ldr r5, =0x03005d8c + ldr r1, [r5] + ldr r4, =0x000031dc + adds r1, r4 + strh r0, [r1, 0xA] + adds r0, r6, 0 + movs r1, 0x37 + bl pokemon_getattr + ldr r1, [r5] + adds r1, r4 + strb r0, [r1, 0xD] + bl sub_8161D00 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161F18 + + thumb_func_start sub_8161F4C +sub_8161F4C: @ 8161F4C + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000031dc + adds r0, r1 + movs r1, 0 + strb r1, [r0, 0x13] + bx lr + .pool + thumb_func_end sub_8161F4C + + thumb_func_start sub_8161F64 +sub_8161F64: @ 8161F64 + ldr r3, =0x0203bc86 + ldrb r2, [r3] + strb r2, [r0] + ldrb r0, [r3, 0x1] + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_8161F64 + + thumb_func_start sub_8161F74 +sub_8161F74: @ 8161F74 + push {lr} + ldr r1, =gUnknown_085DF96C + ldr r0, =0x020375e0 + 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_8161F74 + + thumb_func_start sub_8161F94 +sub_8161F94: @ 8161F94 + push {r4-r7,lr} + ldr r4, =0x03005d90 + 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 r6, r0, 16 + ldr r0, [r4] + ldr r2, =0x00000ca8 + adds r0, r2 + movs r7, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r1, [r4] + adds r2, 0xA + adds r0, r1, r2 + strh r7, [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] + bl sub_81A3ACC + ldr r4, [r4] + ldr r0, =0x00000cdc + adds r3, r4, r0 + ldr r2, =gUnknown_085DF9AC + lsls r1, r5, 2 + lsls r0, r6, 3 + adds r1, r0 + adds r1, r2 + ldr r0, [r3] + ldr r1, [r1] + ands r0, r1 + cmp r0, 0 + bne _0816200E + lsls r0, r5, 1 + lsls r1, r6, 2 + adds r0, r1 + movs r2, 0xCE + lsls r2, 4 + adds r1, r4, r2 + adds r1, r0 + strh r7, [r1] +_0816200E: + bl sub_8164ED8 + ldr r0, =0x03005d8c + 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, =0x02038bca + strh r7, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8161F94 + + thumb_func_start sub_8162054 +sub_8162054: @ 8162054 + push {r4-r6,lr} + ldr r5, =0x03005d90 + ldr r0, [r5] + ldr r4, =0x00000ca9 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 30 + lsrs r6, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =0x020375e2 + ldrh r0, [r0] + cmp r0, 0x1 + beq _08162094 + cmp r0, 0x1 + ble _081620E8 + cmp r0, 0x2 + beq _081620A8 + cmp r0, 0x3 + beq _081620D8 + b _081620E8 + .pool +_08162094: + adds r0, r6, 0 + lsls r1, 24 + lsrs r1, 24 + bl sub_8164FCC + ldr r1, =0x020375f0 + strh r0, [r1] + b _081620E8 + .pool +_081620A8: + ldr r4, =0x020375f0 + ldr r2, [r5] + ldr r0, =0x00000cdc + adds r2, r0 + ldr r3, =gUnknown_085DF9AC + lsls r0, r6, 2 + lsls r1, 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 _081620E8 + .pool +_081620D8: + ldr r1, [r5] + adds r0, r1, r4 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + ldr r2, =0x00000d07 + adds r1, r2 + strb r0, [r1] +_081620E8: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8162054 + + thumb_func_start sub_81620F4 +sub_81620F4: @ 81620F4 + push {r4-r7,lr} + ldr r6, =0x03005d90 + ldr r0, [r6] + ldr r7, =0x00000ca9 + adds r0, r7 + ldrb r0, [r0] + lsls r0, 30 + lsrs r5, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x020375e2 + ldrh r0, [r0] + cmp r0, 0x1 + beq _08162134 + cmp r0, 0x1 + ble _081621B4 + cmp r0, 0x2 + beq _08162150 + cmp r0, 0x3 + beq _081621A4 + b _081621B4 + .pool +_08162134: + ldr r2, [r6] + lsls r0, r5, 1 + lsls r1, r4, 2 + adds r0, r1 + movs r1, 0xCE + lsls r1, 4 + adds r2, r1 + adds r2, r0 + ldr r0, =0x020375e4 + ldrh r0, [r0] + strh r0, [r2] + b _081621B4 + .pool +_08162150: + ldr r0, =0x020375e4 + ldrh r0, [r0] + cmp r0, 0 + beq _08162180 + ldr r2, [r6] + ldr r0, =0x00000cdc + adds r2, r0 + ldr r3, =gUnknown_085DF9AC + 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 _081621B4 + .pool +_08162180: + ldr r2, [r6] + ldr r1, =0x00000cdc + adds r2, r1 + ldr r3, =gUnknown_085DF9CC + 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 _081621B4 + .pool +_081621A4: + ldr r1, [r6] + adds r0, r1, r7 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + ldr r2, =0x00000d07 + adds r1, r2 + strb r0, [r1] +_081621B4: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81620F4 + + thumb_func_start sub_81621C0 +sub_81621C0: @ 81621C0 + push {r4,r5,lr} + ldr r0, =0x02038bca + ldrh r1, [r0] + movs r0, 0xFA + lsls r0, 1 + cmp r1, r0 + bne _081621DA + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000bec + adds r0, r1 + bl sub_816534C +_081621DA: + ldr r5, =0x03005d90 + ldr r0, [r5] + ldr r1, =0x00000d04 + adds r2, r0, r1 + ldrh r1, [r2] + ldr r0, =0x0000270e + cmp r1, r0 + bhi _081621EE + adds r0, r1, 0x1 + strh r0, [r2] +_081621EE: + ldr r1, [r5] + ldr r4, =0x00000cb2 + adds r1, r4 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + bl sub_8163E90 + ldr r1, =0x020375f0 + ldr r0, [r5] + adds r0, r4 + ldrh r0, [r0] + strh r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81621C0 + + thumb_func_start sub_816222C +sub_816222C: @ 816222C + 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, 0x24] + ldr r4, =0x03005d90 + ldr r0, [r4] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + mov r10, r0 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x2C] + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _08162266 + b _0816239C +_08162266: + mov r0, r10 + ldr r1, [sp, 0x2C] + bl sub_8164FCC + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x28] + movs r7, 0 + mov r2, sp + str r2, [sp, 0x34] +_0816227A: + movs r3, 0xEC + adds r0, r7, 0 + muls r0, r3 + movs r4, 0xE7 + lsls r4, 3 + adds r0, r4 + ldr r5, =0x03005d90 + ldr r1, [r5] + movs r2, 0 + mov r8, r2 + mov r9, r2 + movs r5, 0 + adds r3, r7, 0x1 + str r3, [sp, 0x30] + adds r1, r0 +_08162298: + ldm r1!, {r0} + mov r4, r8 + orrs r4, r0 + mov r8, r4 + add r9, r0 + adds r5, 0x1 + cmp r5, 0x39 + bls _08162298 + movs r6, 0 + movs r5, 0 + movs r0, 0xEC + adds r2, r7, 0 + muls r2, r0 +_081622B2: + ldr r3, =0x03005d90 + ldr r1, [r3] + movs r0, 0x2C + muls r0, r5 + adds r0, r2 + adds r1, r0 + ldr r4, =0x0000076c + adds r0, r1, r4 + ldrh r0, [r0] + cmp r0, 0 + beq _081622E4 + movs r0, 0xEF + lsls r0, 3 + adds r4, r1, r0 + mov r0, r10 + str r2, [sp, 0x38] + bl sub_8165C90 + ldrb r1, [r4] + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x38] + cmp r1, r0 + bhi _081622E4 + adds r6, 0x1 +_081622E4: + adds r5, 0x1 + cmp r5, 0x3 + ble _081622B2 + ldr r0, =gUnknown_085DF9F6 + ldr r1, [sp, 0x2C] + adds r0, r1, r0 + ldrb r0, [r0] + cmp r6, r0 + blt _0816233E + ldr r3, =0x03005d90 + ldr r2, [r3] + movs r4, 0xEC + adds r3, r7, 0 + muls r3, r4 + adds r1, r2, r3 + ldr r5, =0x0000073a + adds r0, r1, r5 + ldrh r0, [r0] + ldr r4, [sp, 0x28] + cmp r0, r4 + bne _0816233E + subs r5, 0x2 + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, r10 + bne _0816233E + mov r0, r8 + cmp r0, 0 + beq _0816233E + movs r1, 0x82 + lsls r1, 4 + adds r0, r2, r1 + adds r0, r3 + ldr r0, [r0] + cmp r0, r9 + bne _0816233E + movs r2, 0x96 + lsls r2, 1 + adds r0, r7, r2 + ldr r3, [sp, 0x34] + stm r3!, {r0} + str r3, [sp, 0x34] + ldr r4, [sp, 0x24] + adds r4, 0x1 + str r4, [sp, 0x24] +_0816233E: + ldr r7, [sp, 0x30] + cmp r7, 0x4 + ble _0816227A + ldr r5, [sp, 0x2C] + cmp r5, 0 + bne _08162396 + bl sub_8165B20 + movs r7, 0 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r4, =gUnknown_085DF9EC + adds r2, r0, 0 + adds r2, 0xDC + ldr r1, [sp, 0x24] + lsls r0, r1, 2 + mov r5, sp + adds r3, r0, r5 +_08162362: + ldrb r0, [r2] + lsls r1, r0, 25 + lsrs r0, r1, 30 + cmp r0, 0 + beq _0816238E + ldrb r0, [r2, 0x1] + adds r0, r4 + ldrb r0, [r0] + ldr r5, [sp, 0x28] + cmp r0, r5 + bne _0816238E + lsrs r0, r1, 30 + subs r0, 0x1 + cmp r0, r10 + bne _0816238E + movs r1, 0xC8 + lsls r1, 1 + adds r0, r7, r1 + stm r3!, {r0} + ldr r5, [sp, 0x24] + adds r5, 0x1 + str r5, [sp, 0x24] +_0816238E: + adds r2, 0x44 + adds r7, 0x1 + cmp r7, 0x3 + ble _08162362 +_08162396: + ldr r0, [sp, 0x24] + cmp r0, 0 + bne _081623C0 +_0816239C: + movs r0, 0 + b _081623DA + .pool +_081623C0: + ldr r4, =0x02038bca + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ldr r1, [sp, 0x24] + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + strh r0, [r4] + movs r0, 0x1 +_081623DA: + add sp, 0x3C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_816222C + + thumb_func_start sub_81623F0 +sub_81623F0: @ 81623F0 + push {r4-r7,lr} + ldr r6, =0x03005d90 + ldr r0, [r6] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + cmp r0, 0x2 + bne _08162414 + bl sub_8165E18 + b _08162530 + .pool +_08162414: + ldr r0, =0x000040ce + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_81A39C4 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r5, r0, 16 + bl sub_8165C40 + subs r4, 0x2 + cmp r4, 0x1 + bhi _08162488 + ldr r1, [r6] + ldr r2, =0x00000cb2 + adds r0, r1, r2 + ldrh r3, [r0] + ldr r2, =0x02038bca + lsls r0, r3, 2 + ldr r4, =0x00000cb4 + adds r1, r4 + adds r0, r1, r0 + ldrh r0, [r0] + strh r0, [r2] + ldr r4, =0x02038bcc + lsls r0, r3, 1 + adds r0, 0x1 + lsls r0, 1 + adds r1, r0 + ldrh r0, [r1] + strh r0, [r4] + ldrh r0, [r2] + movs r1, 0 + bl sub_8162614 + ldrh r0, [r4] + movs r1, 0x1 + bl sub_8162614 + b _08162530 + .pool +_08162488: + bl sub_816222C + lsls r0, 24 + cmp r0, 0 + beq _081624B4 + ldr r4, =0x02038bca + ldrh r0, [r4] + movs r1, 0 + bl sub_8162614 + ldr r1, [r6] + ldr r2, =0x00000cb2 + adds r0, r1, r2 + ldrh r0, [r0] + lsls r0, 1 + adds r2, 0x2 + b _08162528 + .pool +_081624B4: + lsls r7, r5, 24 + adds r5, r6, 0 + ldr r6, =0x00000cb2 +_081624BA: + ldr r0, [r5] + adds r0, r6 + ldrb r1, [r0] + lsrs r0, r7, 24 + bl sub_8162548 + lsls r0, 16 + lsrs r3, r0, 16 + movs r4, 0 + ldr r1, [r5] + adds r0, r1, r6 + ldrh r0, [r0] + cmp r4, r0 + bge _081624FC + ldr r2, =0x00000cb4 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, r3 + beq _081624FC + ldr r0, =0x03005d90 + ldr r1, [r0] + subs r2, 0x2 + adds r0, r1, r2 + ldrh r2, [r0] + ldr r0, =0x00000cb4 + adds r1, r0 +_081624EE: + adds r1, 0x2 + adds r4, 0x1 + cmp r4, r2 + bge _081624FC + ldrh r0, [r1] + cmp r0, r3 + bne _081624EE +_081624FC: + ldr r0, [r5] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + cmp r4, r0 + bne _081624BA + ldr r4, =0x02038bca + strh r3, [r4] + ldrh r0, [r4] + movs r1, 0 + bl sub_8162614 + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r2, =0x00000cb2 + adds r0, r1, r2 + ldrh r2, [r0] + adds r0, r2, 0x1 + cmp r0, 0x6 + bgt _08162530 + lsls r0, r2, 1 + ldr r2, =0x00000cb4 +_08162528: + adds r1, r2 + adds r1, r0 + ldrh r0, [r4] + strh r0, [r1] +_08162530: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81623F0 + + thumb_func_start sub_8162548 +sub_8162548: @ 8162548 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + adds r3, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r0, 0x7 + bhi _08162584 + cmp r1, 0x6 + bne _08162570 + ldr r2, =gUnknown_085DFA1A + lsls r1, r0, 2 + adds r0, r2, 0x2 + adds r0, r1, r0 + adds r1, r2 + ldrh r0, [r0] + ldrh r4, [r1] + b _0816258A + .pool +_08162570: + ldr r2, =gUnknown_085DF9FA + lsls r1, r3, 2 + adds r0, r2, 0x2 + adds r0, r1, r0 + adds r1, r2 + ldrh r0, [r0] + ldrh r4, [r1] + b _0816258A + .pool +_08162584: + ldr r1, =gUnknown_085DF9FA + ldrh r0, [r1, 0x1E] + ldrh r4, [r1, 0x1C] +_0816258A: + subs r0, r4 + adds r0, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __umodsi3 + adds r4, r0 + lsls r4, 16 + lsrs r5, r4, 16 + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8162548 + + thumb_func_start sub_81625B4 +sub_81625B4: @ 81625B4 + push {r4,lr} + adds r4, r2, 0 + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r0, 0x7 + bhi _081625F4 + cmp r1, 0x6 + bne _081625D4 + ldr r1, =gUnknown_085DFA1A + lsls r2, r0, 2 + b _081625D8 + .pool +_081625D4: + ldr r1, =gUnknown_085DF9FA + lsls r2, 2 +_081625D8: + adds r0, r1, 0x2 + adds r0, r2, r0 + adds r2, r1 + ldrh r0, [r0] + ldrh r1, [r2] + subs r0, r1 + adds r0, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + ldrh r0, [r2] + b _08162604 + .pool +_081625F4: + ldr r0, =gUnknown_085DF9FA + ldrh r1, [r0, 0x1E] + ldrh r2, [r0, 0x1C] + subs r1, r2 + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + ldrh r0, [r0, 0x1C] +_08162604: + strh r0, [r4] + strb r1, [r3] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81625B4 + + thumb_func_start sub_8162614 +sub_8162614: @ 8162614 + push {r4-r6,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r6, r4, 0 + lsls r1, 24 + lsrs r5, r1, 24 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r4, r0 + bne _08162640 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000bed + adds r0, r1 + b _081626BA + .pool +_08162640: + ldr r0, =0x000003fe + cmp r4, r0 + bne _08162650 + bl sub_81A4DD8 + b _08162788 + .pool +_08162650: + ldr r0, =0x0000012b + cmp r4, r0 + bhi _0816266C + ldr r0, =0x0203bc88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r4 + adds r0, r1 + b _081626BA + .pool +_0816266C: + ldr r0, =0x0000018f + cmp r4, r0 + bhi _08162698 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0xfffffed4 + adds r2, r4, r1 + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + ldr r1, =0x00000739 + adds r0, r1 + b _081626BA + .pool +_08162698: + ldr r3, =gUnknown_08610970 + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r0, =0xfffffe70 + adds r2, r6, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + lsrs r0, 27 + movs r1, 0x58 + muls r0, r1 + adds r0, r3 + adds r0, 0x32 +_081626BA: + ldrb r2, [r0] + movs r1, 0 + ldr r3, =gUnknown_085DCEDC + ldrb r0, [r3] + cmp r0, r2 + beq _081626D4 +_081626C6: + adds r1, 0x1 + cmp r1, 0x1D + bhi _081626D4 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081626C6 +_081626D4: + cmp r1, 0x1E + beq _08162700 + ldr r0, =gUnknown_085DCF0E + adds r0, r1, r0 + ldrb r1, [r0] + cmp r5, 0x1 + beq _08162744 + cmp r5, 0x1 + ble _0816272E + cmp r5, 0xF + bne _0816272E + b _08162750 + .pool +_08162700: + movs r1, 0 + ldr r3, =gUnknown_085DCEFA + ldrb r0, [r3] + cmp r0, r2 + beq _08162718 +_0816270A: + adds r1, 0x1 + cmp r1, 0x13 + bhi _08162718 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _0816270A +_08162718: + cmp r1, 0x14 + beq _0816275C + ldr r0, =gUnknown_085DCF2C + adds r0, r1, r0 + ldrb r1, [r0] + cmp r5, 0x1 + beq _08162744 + cmp r5, 0x1 + ble _0816272E + cmp r5, 0xF + beq _08162750 +_0816272E: + ldr r0, =0x00004010 + bl VarSet + b _08162788 + .pool +_08162744: + ldr r0, =0x00004011 + bl VarSet + b _08162788 + .pool +_08162750: + ldr r0, =0x0000401e + bl VarSet + b _08162788 + .pool +_0816275C: + cmp r5, 0x1 + beq _08162770 + cmp r5, 0x1 + ble _08162768 + cmp r5, 0xF + beq _08162780 +_08162768: + ldr r0, =0x00004010 + b _08162772 + .pool +_08162770: + ldr r0, =0x00004011 +_08162772: + movs r1, 0x7 + bl VarSet + b _08162788 + .pool +_08162780: + ldr r0, =0x0000401e + movs r1, 0x7 + bl VarSet +_08162788: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8162614 + + thumb_func_start sub_8162794 +sub_8162794: @ 8162794 + push {lr} + movs r0, 0xFA + lsls r0, 1 + movs r1, 0 + bl sub_8162614 + pop {r0} + bx r0 + thumb_func_end sub_8162794 + + thumb_func_start sub_81627A4 +sub_81627A4: @ 81627A4 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r4, r0 + bne _081627CC + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000bed + adds r0, r1 + b _08162836 + .pool +_081627CC: + ldr r0, =0x0000012b + cmp r4, r0 + bhi _081627E8 + ldr r0, =0x0203bc88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r4 + adds r0, r1 + b _08162836 + .pool +_081627E8: + ldr r0, =0x0000018f + cmp r4, r0 + bhi _08162814 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0xfffffed4 + adds r2, r4, r1 + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + ldr r1, =0x00000739 + adds r0, r1 + b _08162836 + .pool +_08162814: + ldr r3, =gUnknown_08610970 + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r0, =0xfffffe70 + adds r2, r5, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + lsrs r0, 27 + movs r1, 0x58 + muls r0, r1 + adds r0, r3 + adds r0, 0x32 +_08162836: + ldrb r2, [r0] + movs r1, 0 + ldr r3, =gUnknown_085DCEDC + ldrb r0, [r3] + cmp r0, r2 + beq _08162850 +_08162842: + adds r1, 0x1 + cmp r1, 0x1D + bhi _08162850 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _08162842 +_08162850: + cmp r1, 0x1E + beq _0816286C + ldr r0, =gUnknown_085DCF0E + b _08162892 + .pool +_0816286C: + movs r1, 0 + ldr r3, =gUnknown_085DCEFA + ldrb r0, [r3] + cmp r0, r2 + beq _08162884 +_08162876: + adds r1, 0x1 + cmp r1, 0x13 + bhi _08162884 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _08162876 +_08162884: + cmp r1, 0x14 + bne _08162890 + movs r0, 0x7 + b _08162896 + .pool +_08162890: + ldr r0, =gUnknown_085DCF2C +_08162892: + adds r0, r1, r0 + ldrb r0, [r0] +_08162896: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81627A4 + + thumb_func_start sub_81628A0 +sub_81628A0: @ 81628A0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + movs r1, 0 + mov r8, r1 + mov r10, r0 + movs r5, 0 + ldr r2, =0x03005d90 + ldr r0, [r2] + mov r4, r10 + ldrb r4, [r4, 0xC] + str r4, [sp, 0x18] + mov r9, r5 + movs r7, 0x4 + str r7, [sp, 0x1C] + ldr r1, =0x00000744 + adds r1, r0 + mov r12, r1 +_081628CA: + movs r6, 0 + movs r3, 0 + mov r2, r12 + ldrb r0, [r2] + ldr r4, [sp, 0x18] + cmp r0, r4 + bne _081628FA + mov r4, r9 + mov r2, r10 + adds r2, 0xC +_081628DE: + adds r3, 0x1 + cmp r3, 0x3 + bgt _081628FA + ldr r7, =0x03005d90 + ldr r0, [r7] + adds r1, r3, r4 + ldr r7, =0x00000744 + adds r0, r7 + adds r0, r1 + adds r1, r2, r3 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + beq _081628DE +_081628FA: + cmp r3, 0x4 + bne _08162944 + movs r6, 0 + ldr r1, =0x03005d90 + ldr r0, [r1] + ldr r3, =0x0000073c + adds r0, r3 + ldr r2, [sp, 0x1C] + adds r0, r2 + ldrb r0, [r0] + mov r4, r10 + ldrb r4, [r4, 0x8] + cmp r0, r4 + bne _08162944 + adds r1, r0, 0 + mov r2, r9 + adds r2, 0x4 +_0816291C: + cmp r1, 0xFF + bne _08162930 + movs r6, 0x7 + b _08162944 + .pool +_08162930: + adds r6, 0x1 + cmp r6, 0x6 + bgt _08162944 + ldr r7, =0x03005d90 + ldr r0, [r7] + adds r0, r3 + adds r0, r2 + ldrb r0, [r0] + cmp r0, r1 + beq _0816291C +_08162944: + cmp r6, 0x7 + beq _0816295A + movs r0, 0xEC + add r9, r0 + ldr r1, [sp, 0x1C] + adds r1, 0xEC + str r1, [sp, 0x1C] + add r12, r0 + adds r5, 0x1 + cmp r5, 0x4 + ble _081628CA +_0816295A: + cmp r5, 0x4 + bgt _08162974 + ldr r2, =0x03005d90 + ldr r0, [r2] + movs r1, 0xEC + muls r1, r5 + adds r0, r1 + movs r4, 0xE7 + lsls r4, 3 + adds r0, r4 + b _081629B2 + .pool +_08162974: + movs r5, 0 + ldr r7, =0x03005d90 + ldr r0, [r7] + ldr r1, =0x0000073a + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _0816299E + adds r3, r7, 0 + adds r2, r1, 0 + movs r1, 0 +_0816298A: + adds r1, 0xEC + adds r5, 0x1 + cmp r5, 0x4 + bgt _081629C4 + ldr r0, [r3] + adds r0, r1 + adds r0, r2 + ldrh r0, [r0] + cmp r0, 0 + bne _0816298A +_0816299E: + cmp r5, 0x4 + bgt _081629C4 + ldr r1, =0x03005d90 + ldr r0, [r1] + movs r1, 0xEC + muls r1, r5 + adds r0, r1 + movs r2, 0xE7 + lsls r2, 3 + adds r0, r2 +_081629B2: + mov r1, r10 + movs r2, 0xEC + bl memcpy + b _08162A8A + .pool +_081629C4: + mov r2, sp + ldr r4, =0x03005d90 + ldr r0, [r4] + ldr r3, =0x0000073a + adds r0, r3 + ldrh r0, [r0] + movs r1, 0 + strh r0, [r2] + add r0, sp, 0xC + strh r1, [r0] + movs r7, 0x1 + add r8, r7 + movs r5, 0x1 + add r0, sp, 0xC + mov r9, r0 + mov r12, r3 +_081629E4: + movs r3, 0 + adds r7, r5, 0x1 + cmp r3, r8 + bge _08162A2E + ldr r1, =0x03005d90 + ldr r0, [r1] + movs r2, 0xEC + adds r1, r5, 0 + muls r1, r2 + adds r0, r1 + mov r1, r12 + adds r4, r0, r1 + mov r6, sp +_081629FE: + lsls r0, r3, 1 + add r0, sp + ldrh r2, [r4] + adds r1, r2, 0 + ldrh r0, [r0] + cmp r1, r0 + bcs _08162A24 + movs r3, 0 + movs r4, 0x1 + mov r8, r4 + strh r2, [r6] + mov r0, r9 + strh r5, [r0] + b _08162A2E + .pool +_08162A24: + cmp r1, r0 + bhi _08162A2E + adds r3, 0x1 + cmp r3, r8 + blt _081629FE +_08162A2E: + cmp r3, r8 + bne _08162A54 + mov r1, r8 + lsls r2, r1, 1 + mov r4, sp + adds r3, r4, r2 + ldr r1, =0x03005d90 + ldr r0, [r1] + movs r4, 0xEC + adds r1, r5, 0 + muls r1, r4 + adds r0, r1 + add r0, r12 + ldrh r0, [r0] + strh r0, [r3] + add r2, r9 + strh r5, [r2] + movs r0, 0x1 + add r8, r0 +_08162A54: + adds r5, r7, 0 + cmp r5, 0x4 + ble _081629E4 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + mov r1, r8 + bl __modsi3 + adds r5, r0, 0 + ldr r0, =0x03005d90 + ldr r0, [r0] + lsls r1, r5, 1 + add r1, sp + adds r1, 0xC + ldrh r2, [r1] + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + movs r1, 0xE7 + lsls r1, 3 + adds r0, r1 + mov r1, r10 + movs r2, 0xEC + bl memcpy +_08162A8A: + 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_81628A0 + + thumb_func_start sub_8162AA0 +sub_8162AA0: @ 8162AA0 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r4, r0 + bne _08162AD0 + ldr r1, =gTrainerPicIndices + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r2, =0x00000bed + adds r0, r2 + ldrb r0, [r0] + adds r0, r1 + b _08162BC8 + .pool +_08162AD0: + ldr r0, =0x000003fe + cmp r4, r0 + bne _08162AE4 + bl sub_81A4CB0 + lsls r0, 24 + lsrs r0, 24 + b _08162BCA + .pool +_08162AE4: + ldr r0, =0x0000012b + cmp r4, r0 + bhi _08162B08 + ldr r2, =gTrainerPicIndices + ldr r0, =0x0203bc88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r4 + adds r0, r1 + ldrb r0, [r0] + adds r0, r2 + b _08162BC8 + .pool +_08162B08: + ldr r0, =0x0000018f + cmp r4, r0 + bhi _08162B64 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08162B38 + ldr r4, =gTrainerPicIndices + bl sub_818649C + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + b _08162BC8 + .pool +_08162B38: + ldr r3, =gTrainerPicIndices + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0xfffffed4 + adds r2, r4, r1 + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + ldr r2, =0x00000739 + adds r0, r2 + ldrb r0, [r0] + adds r0, r3 + b _08162BC8 + .pool +_08162B64: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _08162BB0 + ldr r4, =gTrainerPicIndices + ldr r3, =gUnknown_08610970 + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r0, =0xfffffe70 + adds r2, r5, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + lsrs r0, 27 + movs r1, 0x58 + muls r0, r1 + adds r0, r3 + adds r0, 0x32 + ldrb r0, [r0] + adds r0, r4 + b _08162BC8 + .pool +_08162BB0: + ldr r5, =gTrainerPicIndices + ldr r4, =gUnknown_08610970 + bl sub_81864A8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x58 + muls r0, r1 + adds r0, r4 + adds r0, 0x32 + ldrb r0, [r0] + adds r0, r5 +_08162BC8: + ldrb r0, [r0] +_08162BCA: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8162AA0 + + thumb_func_start sub_8162BD8 +sub_8162BD8: @ 8162BD8 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r4, r0 + bne _08162C08 + ldr r1, =gTrainerClassNameIndices + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r2, =0x00000bed + adds r0, r2 + ldrb r0, [r0] + b _08162C26 + .pool +_08162C08: + ldr r0, =0x000003fe + cmp r4, r0 + bne _08162C1C + bl sub_81A4D00 + lsls r0, 24 + lsrs r0, 24 + b _08162D1E + .pool +_08162C1C: + ldr r0, =0x00000c03 + cmp r4, r0 + bne _08162C38 + ldr r0, =gTrainers + ldr r1, =0x00007da1 +_08162C26: + adds r0, r1 + ldrb r0, [r0] + b _08162D1E + .pool +_08162C38: + ldr r0, =0x0000012b + cmp r4, r0 + bhi _08162C60 + ldr r2, =gTrainerClassNameIndices + ldr r0, =0x0203bc88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r4 + adds r0, r1 + ldrb r0, [r0] + adds r0, r2 + ldrb r0, [r0] + b _08162D1E + .pool +_08162C60: + ldr r0, =0x0000018f + cmp r4, r0 + bhi _08162CBC + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08162C90 + ldr r4, =gTrainerClassNameIndices + bl sub_818649C + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r0, [r0] + b _08162D1E + .pool +_08162C90: + ldr r3, =gTrainerClassNameIndices + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0xfffffed4 + adds r2, r4, r1 + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + ldr r2, =0x00000739 + adds r0, r2 + ldrb r0, [r0] + adds r0, r3 + ldrb r0, [r0] + b _08162D1E + .pool +_08162CBC: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08162CF4 + ldr r5, =gTrainerClassNameIndices + ldr r4, =gUnknown_08610970 + bl sub_81864A8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x58 + muls r0, r1 + adds r0, r4 + adds r0, 0x32 + ldrb r0, [r0] + adds r0, r5 + ldrb r0, [r0] + b _08162D1E + .pool +_08162CF4: + ldr r4, =gTrainerClassNameIndices + ldr r3, =gUnknown_08610970 + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r0, =0xfffffe70 + adds r2, r5, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + lsrs r0, 27 + movs r1, 0x58 + muls r0, r1 + adds r0, r3 + adds r0, 0x32 + ldrb r0, [r0] + adds r0, r4 + ldrb r0, [r0] +_08162D1E: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8162BD8 + + thumb_func_start sub_8162D34 +sub_8162D34: @ 8162D34 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r4, r0 + bne _08162D5C + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000bed + adds r0, r1 + b _08162E0A + .pool +_08162D5C: + ldr r0, =0x0000012b + cmp r4, r0 + bhi _08162D78 + ldr r0, =0x0203bc88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r4 + adds r0, r1 + b _08162E0A + .pool +_08162D78: + ldr r0, =0x0000018f + cmp r4, r0 + bhi _08162DC0 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08162DA0 + bl sub_818649C + lsls r0, 24 + lsrs r0, 24 + b _08162E0C + .pool +_08162DA0: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0xfffffed4 + adds r2, r4, r1 + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + ldr r1, =0x00000739 + adds r0, r1 + b _08162E0A + .pool +_08162DC0: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08162DE8 + ldr r4, =gUnknown_08610970 + bl sub_81864A8 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x58 + muls r0, r1 + adds r0, r4 + b _08162E08 + .pool +_08162DE8: + ldr r3, =gUnknown_08610970 + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r0, =0xfffffe70 + adds r2, r5, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + lsrs r0, 27 + movs r1, 0x58 + muls r0, r1 + adds r0, r3 +_08162E08: + adds r0, 0x32 +_08162E0A: + ldrb r0, [r0] +_08162E0C: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8162D34 + + thumb_func_start sub_8162E20 +sub_8162E20: @ 8162E20 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + movs r4, 0 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r5, r0 + bne _08162E54 + ldr r0, =0x03005d90 + ldr r0, [r0] + movs r1, 0xBF + lsls r1, 4 + adds r2, r0, r1 +_08162E40: + adds r0, r6, r4 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x6 + ble _08162E40 + b _08162F5C + .pool +_08162E54: + ldr r0, =0x000003fe + cmp r5, r0 + bne _08162E68 + adds r0, r6, 0 + bl sub_81A4D50 + b _08162F62 + .pool +_08162E68: + ldr r0, =0x00000c03 + cmp r5, r0 + bne _08162E88 + ldr r2, =gTrainers + TRAINER_STEVEN * 0x28 + 0x4 @ Steven's name +_08162E70: + adds r0, r6, r4 + adds r1, r4, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x6 + ble _08162E70 + b _08162F5C + .pool +_08162E88: + ldr r0, =0x0000012b + cmp r5, r0 + bhi _08162EB4 + ldr r0, =0x0203bc88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r5 + adds r0, r1 + adds r2, r0, 0x4 +_08162E9A: + adds r0, r6, r4 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x6 + ble _08162E9A + b _08162F5C + .pool +_08162EB4: + ldr r0, =0x0000018f + cmp r5, r0 + bhi _08162F00 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08162ED8 + adds r0, r6, 0 + bl sub_8186468 + b _08162F62 + .pool +_08162ED8: + ldr r2, =0x03005d90 + movs r0, 0xEC + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0xfffef2a8 + adds r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r1, r0, 0x4 + adds r0, 0xE4 + ldrb r2, [r0] + adds r0, r6, 0 + bl sub_81DB5E8 + b _08162F62 + .pool +_08162F00: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08162F24 + bl sub_81864A8 + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_81864C0 + lsls r0, 24 + lsrs r4, r0, 24 + b _08162F3E + .pool +_08162F24: + ldr r1, =0x03005d90 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r2, =0xffff969c + adds r0, r2 + ldr r1, [r1] + adds r1, r0 + ldrb r0, [r1] + lsls r0, 27 + lsrs r5, r0, 27 + adds r1, 0x3F + ldrb r4, [r1] +_08162F3E: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_81A1650 + adds r1, r0, 0 + adds r0, r6, 0 + adds r2, r4, 0 + bl sub_81DB5E8 + b _08162F62 + .pool +_08162F5C: + adds r1, r6, r4 + movs r0, 0xFF + strb r0, [r1] +_08162F62: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8162E20 + + thumb_func_start sub_8162F68 +sub_8162F68: @ 8162F68 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r4, r0 + bne _08162F90 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000bed + adds r0, r1 + b _0816300E + .pool +_08162F90: + ldr r0, =0x000003fe + cmp r4, r0 + bne _08162FA4 + bl sub_81A4DB8 + lsls r0, 24 + lsrs r0, 24 + b _08163042 + .pool +_08162FA4: + ldr r0, =0x0000012b + cmp r4, r0 + bhi _08162FC0 + ldr r0, =0x0203bc88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r4 + adds r0, r1 + b _0816300E + .pool +_08162FC0: + ldr r0, =0x0000018f + cmp r4, r0 + bhi _08162FEC + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0xfffffed4 + adds r2, r4, r1 + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + ldr r1, =0x00000739 + adds r0, r1 + b _0816300E + .pool +_08162FEC: + ldr r3, =gUnknown_08610970 + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r0, =0xfffffe70 + adds r2, r5, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + lsrs r0, 27 + movs r1, 0x58 + muls r0, r1 + adds r0, r3 + adds r0, 0x32 +_0816300E: + ldrb r2, [r0] + movs r1, 0 + ldr r3, =gUnknown_085DCEFA + ldrb r0, [r3] + cmp r0, r2 + beq _08163028 +_0816301A: + adds r1, 0x1 + cmp r1, 0x13 + bhi _08163028 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _0816301A +_08163028: + cmp r1, 0x14 + bne _08163040 + movs r0, 0 + b _08163042 + .pool +_08163040: + movs r0, 0x1 +_08163042: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8162F68 + + thumb_func_start sub_8163048 +sub_8163048: @ 8163048 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl zero_enemy_party_data + ldr r0, =0x02038bca + ldrh r0, [r0] + movs r1, 0 + adds r2, r4, 0 + bl sub_81630C4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8163048 + + thumb_func_start sub_816306C +sub_816306C: @ 816306C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl zero_enemy_party_data + ldr r0, =0x02038bca + ldrh r0, [r0] + movs r1, 0 + adds r2, r4, 0 + bl sub_81630C4 + ldr r0, =0x02038bcc + ldrh r0, [r0] + movs r1, 0x3 + adds r2, r4, 0 + bl sub_81630C4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816306C + + thumb_func_start sub_81630A0 +sub_81630A0: @ 81630A0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl zero_enemy_party_data + ldr r0, =0x02038bca + ldrh r0, [r0] + movs r1, 0 + adds r2, r4, 0 + bl sub_8165EA4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81630A0 + + thumb_func_start sub_81630C4 +sub_81630C4: @ 81630C4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x18] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x1C] + add r4, sp, 0x14 + movs r0, 0xFF + strb r0, [r4] + bl sub_8165C40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x20] + ldr r0, =0x0000012b + cmp r5, r0 + bhi _08163138 + adds r0, r5, 0 + bl sub_8165D08 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x24] + ldr r0, =0x02038bca + ldrh r2, [r0] + ldr r0, =0x0203bc88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r2 + adds r0, r1 + ldr r0, [r0, 0x30] + str r0, [sp, 0x2C] + movs r0, 0 + str r0, [sp, 0x28] + ldr r2, [sp, 0x2C] + ldrh r1, [r2] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _08163124 + b _08163278 +_08163124: + b _08163260 + .pool +_08163138: + movs r0, 0xFA + lsls r0, 1 + cmp r5, r0 + bne _08163180 + ldr r7, [sp, 0x18] + adds r0, r7, 0x3 + cmp r7, r0 + blt _0816314A + b _08163426 +_0816314A: + ldr r4, =0x03005d90 +_0816314C: + movs r0, 0x64 + muls r0, r7 + ldr r1, =0x02024744 + adds r0, r1 + ldr r5, [sp, 0x18] + subs r2, r7, r5 + movs r1, 0x2C + muls r2, r1 + movs r6, 0xC2 + lsls r6, 4 + adds r2, r6 + ldr r1, [r4] + adds r1, r2 + bl sub_806819C + adds r7, 0x1 + adds r0, r5, 0 + adds r0, 0x3 + cmp r7, r0 + blt _0816314C + b _08163426 + .pool +_08163180: + ldr r0, =0x000003fe + cmp r5, r0 + bne _08163190 + bl sub_81A4E04 + b _08163426 + .pool +_08163190: + ldr r0, =0x0000018f + cmp r5, r0 + bhi _08163218 + movs r6, 0 + ldr r7, [sp, 0x18] + ldr r1, [sp, 0x1C] + adds r0, r7, r1 + cmp r7, r0 + blt _081631A4 + b _08163426 +_081631A4: + ldr r2, =0xfffffed4 + adds r1, r5, r2 + movs r0, 0xEC + adds r2, r1, 0 + muls r2, r0 + mov r8, r2 + muls r0, r5 + ldr r5, =0xfffef2a8 + adds r4, r0, r5 +_081631B6: + ldr r0, =0x03005d90 + ldr r3, [r0] + movs r0, 0x2C + adds r2, r6, 0 + muls r2, r0 + mov r1, r8 + adds r0, r2, r1 + adds r1, r3, r0 + ldr r5, =0x0000076c + adds r0, r1, r5 + ldrh r0, [r0] + cmp r0, 0 + beq _081631F0 + adds r5, 0xC + adds r0, r1, r5 + ldrb r0, [r0] + ldr r1, [sp, 0x20] + cmp r0, r1 + bhi _081631F0 + movs r0, 0x64 + muls r0, r7 + ldr r1, =0x02024744 + adds r0, r1 + adds r1, r3, r4 + adds r2, 0x34 + adds r1, r2 + movs r2, 0 + bl sub_8068338 +_081631F0: + adds r6, 0x1 + adds r7, 0x1 + ldr r2, [sp, 0x18] + ldr r5, [sp, 0x1C] + adds r0, r2, r5 + cmp r7, r0 + blt _081631B6 + b _08163426 + .pool +_08163218: + ldr r7, [sp, 0x18] + adds r0, r7, 0x3 + cmp r7, r0 + blt _08163222 + b _08163426 +_08163222: + ldr r6, =0x03005d90 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r1, =0xffff969c + adds r5, r0, r1 + movs r4, 0 +_08163230: + movs r0, 0x64 + muls r0, r7 + ldr r1, =0x02024744 + adds r0, r1 + ldr r1, [r6] + adds r1, r5 + lsrs r2, r4, 24 + bl sub_8068528 + movs r2, 0x80 + lsls r2, 17 + adds r4, r2 + adds r7, 0x1 + ldr r0, [sp, 0x18] + adds r0, 0x3 + cmp r7, r0 + blt _08163230 + b _08163426 + .pool +_08163260: + ldr r0, [sp, 0x28] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x28] + lsls r0, 1 + ldr r5, [sp, 0x2C] + adds r0, r5 + ldrh r1, [r0] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _08163260 +_08163278: + movs r7, 0 + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + str r4, [sp, 0x30] + ldr r6, [sp, 0x1C] + cmp r7, r6 + bne _08163296 + b _08163426 +_08163296: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ldr r1, [sp, 0x28] + bl __modsi3 + lsls r0, 1 + ldr r1, [sp, 0x2C] + adds r0, r1 + ldrh r4, [r0] + ldr r2, [sp, 0x20] + cmp r2, 0x32 + beq _081632B6 + cmp r2, 0x14 + bne _081632BE +_081632B6: + ldr r0, =0x00000351 + cmp r4, r0 + bls _081632BE + b _0816341E +_081632BE: + movs r6, 0 + ldr r5, [sp, 0x18] + adds r5, r7 + mov r8, r5 + b _081632D2 + .pool +_081632D0: + adds r6, 0x1 +_081632D2: + cmp r6, r8 + bge _081632F6 + movs r1, 0x64 + adds r0, r6, 0 + muls r0, r1 + ldr r2, =0x02024744 + adds r0, r2 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + ldr r1, =0x0203bc8c + ldr r2, [r1] + lsls r1, r4, 4 + adds r1, r2 + ldrh r1, [r1] + cmp r0, r1 + bne _081632D0 +_081632F6: + cmp r6, r8 + beq _081632FC + b _0816341E +_081632FC: + movs r6, 0 + cmp r6, r8 + bge _08163346 + ldr r5, =gBattleFrontierHeldItems + mov r9, r5 + movs r3, 0 +_08163308: + ldr r0, =0x02024744 + adds r5, r3, r0 + adds r0, r5, 0 + movs r1, 0xC + movs r2, 0 + str r3, [sp, 0x38] + bl pokemon_getattr + ldr r3, [sp, 0x38] + cmp r0, 0 + beq _0816333E + adds r0, r5, 0 + movs r1, 0xC + movs r2, 0 + bl pokemon_getattr + ldr r1, =0x0203bc8c + ldr r2, [r1] + lsls r1, r4, 4 + adds r1, r2 + ldrb r1, [r1, 0xA] + lsls r1, 1 + add r1, r9 + ldr r3, [sp, 0x38] + ldrh r1, [r1] + cmp r0, r1 + beq _08163346 +_0816333E: + adds r3, 0x64 + adds r6, 0x1 + cmp r6, r8 + blt _08163308 +_08163346: + cmp r6, r8 + bne _0816341E + movs r6, 0 + cmp r6, r7 + bge _08163368 + add r0, sp, 0xC + ldrh r0, [r0] + cmp r0, r4 + beq _08163368 + add r1, sp, 0xC +_0816335A: + adds r1, 0x2 + adds r6, 0x1 + cmp r6, r7 + bge _08163368 + ldrh r0, [r1] + cmp r0, r4 + bne _0816335A +_08163368: + cmp r6, r7 + bne _0816341E + lsls r0, r7, 1 + add r0, sp + adds r0, 0xC + strh r4, [r0] + movs r1, 0x64 + mov r0, r8 + muls r0, r1 + ldr r2, =0x02024744 + adds r0, r2 + ldr r5, =0x0203bc8c + ldr r2, [r5] + lsls r4, 4 + adds r2, r4, r2 + ldrh r1, [r2] + ldrb r3, [r2, 0xC] + ldr r6, [sp, 0x24] + str r6, [sp] + ldrb r2, [r2, 0xB] + str r2, [sp, 0x4] + ldr r2, [sp, 0x30] + str r2, [sp, 0x8] + ldr r2, [sp, 0x20] + bl sub_8068634 + movs r0, 0xFF + mov r6, sp + strb r0, [r6, 0x14] + movs r6, 0 + adds r0, r7, 0x1 + str r0, [sp, 0x34] + mov r9, r4 + movs r0, 0x64 + mov r3, r8 + muls r3, r0 + mov r1, r9 + str r1, [sp, 0x3C] + ldr r2, =0x02024744 + mov r10, r2 +_081633B8: + ldr r0, [r5] + ldr r7, [sp, 0x3C] + adds r0, r7, r0 + lsls r4, r6, 1 + adds r0, 0x2 + adds r0, r4 + ldrh r1, [r0] + lsls r2, r6, 24 + lsrs r2, 24 + mov r7, r10 + adds r0, r3, r7 + str r3, [sp, 0x38] + bl sub_80691F4 + ldr r0, [r5] + ldr r1, [sp, 0x3C] + adds r0, r1, r0 + adds r0, 0x2 + adds r0, r4 + ldrh r0, [r0] + ldr r3, [sp, 0x38] + cmp r0, 0xDA + bne _081633EC + movs r0, 0 + mov r2, sp + strb r0, [r2, 0x14] +_081633EC: + adds r6, 0x1 + cmp r6, 0x3 + ble _081633B8 + movs r5, 0x64 + mov r4, r8 + muls r4, r5 + ldr r6, =0x02024744 + adds r4, r6 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0x14 + bl pokemon_setattr + ldr r0, =0x0203bc8c + ldr r0, [r0] + add r0, r9 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, =gBattleFrontierHeldItems + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + ldr r7, [sp, 0x34] +_0816341E: + ldr r0, [sp, 0x1C] + cmp r7, r0 + beq _08163426 + b _08163296 +_08163426: + 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_81630C4 + + thumb_func_start sub_8163444 +sub_8163444: @ 8163444 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x8] + movs r1, 0xFF + add r0, sp, 0x4 + strb r1, [r0] + ldr r0, =0x03005d90 + ldr r2, [r0] + movs r0, 0xDC + adds r0, r2 + mov r10, r0 + ldrb r0, [r0, 0x1] + movs r1, 0x9 + str r1, [sp, 0x10] + cmp r0, 0x4 + bhi _08163474 + movs r0, 0x6 + str r0, [sp, 0x10] +_08163474: + ldr r1, =0x00000ca9 + adds r0, r2, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + movs r1, 0x32 + str r1, [sp, 0xC] + cmp r0, 0 + beq _0816348A + movs r0, 0x64 + str r0, [sp, 0xC] +_0816348A: + movs r7, 0 + adds r2, 0xE2 + str r2, [sp, 0x14] + add r1, sp, 0x4 + mov r9, r1 +_08163494: + ldr r2, [sp, 0x8] + adds r6, r2, r7 + movs r0, 0x64 + muls r0, r6 + ldr r1, =0x02024744 + adds r0, r1 + lsls r5, r7, 1 + adds r4, r5, r7 + lsls r4, 2 + mov r2, r10 + adds r1, r2, r4 + ldrh r1, [r1, 0x4] + movs r2, 0x8 + str r2, [sp] + ldr r2, [sp, 0xC] + ldr r3, [sp, 0x10] + bl pokemon_make_ev_something + movs r0, 0xFF + mov r1, r9 + strb r0, [r1] + adds r2, r7, 0x1 + mov r8, r2 + movs r1, 0x3 +_081634C4: + ldr r2, [sp, 0x14] + adds r0, r2, r4 + ldrh r0, [r0] + cmp r0, 0xDA + bne _081634D4 + movs r2, 0 + mov r0, r9 + strb r2, [r0] +_081634D4: + adds r4, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _081634C4 + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0x4 + bl pokemon_setattr + adds r2, r5, r7 + lsls r2, 2 + add r2, r10 + adds r2, 0xE + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + mov r7, r8 + cmp r7, 0x3 + bne _08163494 + 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_8163444 + + thumb_func_start sub_8163524 +sub_8163524: @ 8163524 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_8165C40 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x0203bc88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r4 + adds r0, r1 + ldr r5, [r0, 0x30] + movs r4, 0 + ldrh r1, [r5] + b _08163558 + .pool +_0816354C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 1 + adds r0, r5 + ldrh r1, [r0] +_08163558: + ldr r0, =0x0000ffff + cmp r1, r0 + bne _0816354C +_0816355E: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + cmp r6, 0x32 + beq _0816357A + cmp r6, 0x14 + bne _08163580 +_0816357A: + ldr r0, =0x00000351 + cmp r1, r0 + bhi _0816355E +_08163580: + adds r0, r1, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8163524 + + thumb_func_start sub_8163590 +sub_8163590: @ 8163590 + push {lr} + bl zero_enemy_party_data + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _081635C0 + ldr r0, =0x02038bca + ldrh r0, [r0] + movs r1, 0 + bl sub_81635D4 + b _081635CA + .pool +_081635C0: + ldr r0, =0x02038bca + ldrh r0, [r0] + movs r1, 0 + bl sub_816379C +_081635CA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8163590 + + thumb_func_start sub_81635D4 +sub_81635D4: @ 81635D4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + lsls r0, 16 + lsrs r2, r0, 16 + adds r3, r2, 0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x10] + ldr r0, =0x0000012b + cmp r2, r0 + bhi _0816364A + ldr r4, =0x03005d90 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 24 + ldr r4, [r4] + lsrs r0, 22 + movs r2, 0xCE + lsls r2, 4 + adds r1, r4, r2 + adds r1, r0 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 24 + lsrs r1, r0, 24 + ldr r3, =0x00000cb2 + adds r4, r3 + ldrh r0, [r4] + cmp r0, 0x5 + bhi _0816363C + adds r0, r1, 0 + movs r1, 0 + bl sub_81A6CA8 + lsls r0, 24 + lsrs r0, 24 + b _081636A6 + .pool +_0816363C: + adds r0, r1, 0 + movs r1, 0x1 + bl sub_81A6CA8 + lsls r0, 24 + lsrs r0, 24 + b _081636A6 +_0816364A: + movs r0, 0xFA + lsls r0, 1 + cmp r2, r0 + bne _08163694 + ldr r7, [sp, 0x10] + adds r0, r7, 0x3 + cmp r7, r0 + blt _0816365C + b _08163776 +_0816365C: + ldr r4, =0x03005d90 +_0816365E: + movs r0, 0x64 + muls r0, r7 + ldr r1, =0x02024744 + adds r0, r1 + ldr r1, [sp, 0x10] + subs r2, r7, r1 + movs r1, 0x2C + muls r2, r1 + movs r3, 0xC2 + lsls r3, 4 + adds r2, r3 + ldr r1, [r4] + adds r1, r2 + bl sub_806819C + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, [sp, 0x10] + adds r0, 0x3 + cmp r7, r0 + blt _0816365E + b _08163776 + .pool +_08163694: + ldr r0, =0x000003fe + cmp r3, r0 + bne _081636A4 + bl sub_81A6CD0 + b _08163776 + .pool +_081636A4: + movs r0, 0x1F +_081636A6: + str r0, [sp, 0x18] + bl sub_8165C40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + ldr r0, =0x03005d90 + ldr r1, [r0] + ldrb r2, [r1, 0xA] + ldrb r0, [r1, 0xB] + lsls r0, 8 + orrs r2, r0 + ldrb r0, [r1, 0xC] + lsls r0, 16 + orrs r2, r0 + ldrb r0, [r1, 0xD] + lsls r0, 24 + orrs r2, r0 + mov r8, r2 + movs r7, 0 +_081636CE: + ldr r1, =0x03006298 + lsls r0, r7, 1 + adds r0, r1 + ldrh r0, [r0] + mov r9, r0 + ldr r3, [sp, 0x10] + adds r5, r3, r7 + movs r0, 0x64 + adds r6, r5, 0 + muls r6, r0 + ldr r1, =0x02024744 + adds r0, r6, r1 + ldr r3, =0x0203bc8c + ldr r2, [r3] + mov r1, r9 + lsls r4, r1, 4 + adds r2, r4, r2 + ldrh r1, [r2] + ldrb r3, [r2, 0xC] + mov r10, r3 + ldr r3, [sp, 0x18] + str r3, [sp] + ldrb r2, [r2, 0xB] + str r2, [sp, 0x4] + mov r2, r8 + str r2, [sp, 0x8] + ldr r2, [sp, 0x14] + mov r3, r10 + bl sub_8068634 + movs r1, 0 + add r0, sp, 0xC + strb r1, [r0] + movs r3, 0 + adds r7, 0x1 + mov r10, r7 + adds r7, r4, 0 +_08163718: + ldr r0, =0x0203bc8c + ldr r1, [r0] + mov r2, r9 + lsls r0, r2, 4 + adds r0, r1 + lsls r1, r3, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r1, [r0] + ldr r2, =0x02024744 + adds r0, r6, r2 + adds r2, r3, 0 + str r3, [sp, 0x1C] + bl sub_81A7024 + ldr r3, [sp, 0x1C] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _08163718 + movs r3, 0x64 + adds r4, r5, 0 + muls r4, r3 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0xC + bl pokemon_setattr + ldr r1, =0x0203bc8c + 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 pokemon_setattr + mov r2, r10 + lsls r0, r2, 24 + lsrs r7, r0, 24 + cmp r7, 0x2 + bls _081636CE +_08163776: + 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_81635D4 + + thumb_func_start sub_816379C +sub_816379C: @ 816379C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x10] + ldr r0, =0x03005d90 + ldr r1, [r0] + 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 r7, 0 + mov r8, r7 +_081637D0: + ldr r1, =0x03006298 + mov r2, r8 + lsls r0, r2, 1 + adds r0, r1 + ldrh r4, [r0] + ldr r5, [sp, 0x10] + add r5, r8 + movs r7, 0x64 + adds r6, r5, 0 + muls r6, r7 + ldr r1, =0x02024744 + adds r0, r6, r1 + ldr r7, =0x0203bc8c + ldr r2, [r7] + lsls r4, 4 + adds r2, r4, r2 + ldrh r1, [r2] + ldrb r3, [r2, 0xC] + movs r7, 0 + str r7, [sp] + ldrb r2, [r2, 0xB] + str r2, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + movs r2, 0x1E + bl sub_8068634 + movs r1, 0 + add r0, sp, 0xC + strb r1, [r0] + mov r10, r5 + mov r0, r8 + adds r0, 0x1 + str r0, [sp, 0x14] + mov r8, r4 + mov r5, r8 +_08163818: + ldr r1, =0x0203bc8c + ldr r0, [r1] + adds r0, r5, r0 + lsls r4, r7, 1 + adds r0, 0x2 + adds r0, r4 + ldrh r1, [r0] + ldr r2, =0x02024744 + adds r0, r6, r2 + adds r2, r7, 0 + bl sub_81A7024 + ldr r1, =0x0203bc8c + ldr r0, [r1] + adds r0, r5, r0 + adds r0, 0x2 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0xDA + bne _08163846 + movs r1, 0 + add r0, sp, 0xC + strb r1, [r0] +_08163846: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x3 + bls _08163818 + movs r2, 0x64 + mov r4, r10 + muls r4, r2 + ldr r7, =0x02024744 + adds r4, r7 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0xC + bl pokemon_setattr + ldr r1, =0x0203bc8c + ldr r0, [r1] + add r0, r8 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, =gBattleFrontierHeldItems + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + ldr r2, [sp, 0x14] + lsls r0, r2, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x2 + bls _081637D0 + 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_816379C + + thumb_func_start ConvertBattleFrontierTrainerSpeechToString +ConvertBattleFrontierTrainerSpeechToString: @ 81638AC + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x02021fc4 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + movs r3, 0x2 + bl ConvertEasyChatWordsToString + movs r2, 0x1 + negs r2, r2 + movs r0, 0x1 + adds r1, r4, 0 + bl GetStringWidth + cmp r0, 0xCC + bls _0816390A + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + movs r3, 0x3 + bl ConvertEasyChatWordsToString + ldrb r0, [r4] + movs r1, 0x1 + cmp r0, 0xFE + beq _081638EE + adds r2, r4, 0 +_081638E4: + adds r0, r1, r2 + ldrb r0, [r0] + adds r1, 0x1 + cmp r0, 0xFE + bne _081638E4 +_081638EE: + ldr r2, =0x02021fc4 + adds r0, r1, r2 + ldrb r0, [r0] + adds r3, r2, 0 + cmp r0, 0xFE + beq _08163904 +_081638FA: + adds r1, 0x1 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xFE + bne _081638FA +_08163904: + adds r1, r3 + movs r0, 0xFA + strb r0, [r1] +_0816390A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ConvertBattleFrontierTrainerSpeechToString + + thumb_func_start sub_8163914 +sub_8163914: @ 8163914 + push {lr} + bl sub_8165C40 + ldr r0, =0x020375e2 + ldrh r0, [r0] + cmp r0, 0 + beq _08163930 + ldr r0, =0x02038bcc + b _08163932 + .pool +_08163930: + ldr r0, =0x02038bca +_08163932: + ldrh r3, [r0] + movs r0, 0xFA + lsls r0, 1 + cmp r3, r0 + bne _08163950 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000bfc + b _08163986 + .pool +_08163950: + ldr r0, =0x0000012b + cmp r3, r0 + bhi _08163974 + ldr r2, =0x0203bc88 + movs r0, 0x34 + adds r1, r3, 0 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xC + bl ConvertBattleFrontierTrainerSpeechToString + b _081639A8 + .pool +_08163974: + ldr r0, =0x0000018f + cmp r3, r0 + bhi _0816399C + ldr r1, =0x03005d90 + movs r0, 0xEC + muls r0, r3 + ldr r1, [r1] + adds r0, r1 + ldr r1, =0xfffef2b8 +_08163986: + adds r0, r1 + bl ConvertBattleFrontierTrainerSpeechToString + b _081639A8 + .pool +_0816399C: + adds r0, r3, 0 + adds r0, 0x70 + lsls r0, 24 + lsrs r0, 24 + bl sub_819F99C +_081639A8: + pop {r0} + bx r0 + thumb_func_end sub_8163914 + + thumb_func_start sub_81639AC +sub_81639AC: @ 81639AC + push {r4-r6,lr} + sub sp, 0x4 + bl sub_81864CC + ldr r0, =0x02024474 + adds r0, 0x26 + ldrb r0, [r0] + cmp r0, 0xA + bhi _08163A78 + lsls r0, 2 + ldr r1, =_081639D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081639D0: + .4byte _081639FC + .4byte _08163A38 + .4byte _08163A74 + .4byte _081639FC + .4byte _081639FC + .4byte _081639FC + .4byte _081639FC + .4byte _081639FC + .4byte _08163A78 + .4byte _081639FC + .4byte _081639FC +_081639FC: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r2, =0x00000ebc + adds r1, r0, r2 + ldr r2, [r1] + ldr r0, =0x00fffffe + cmp r2, r0 + bhi _08163A2C + adds r0, r2, 0x1 + str r0, [r1] + movs r1, 0x14 + bl __umodsi3 + cmp r0, 0 + bne _08163A78 + bl sub_81DA57C + b _08163A78 + .pool +_08163A2C: + ldr r0, =0x00ffffff + str r0, [r1] + b _08163A78 + .pool +_08163A38: + movs r5, 0 + ldr r6, =0x03005d8c +_08163A3C: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + movs r0, 0x8E + lsls r0, 2 + adds r1, r4, r0 + ldr r0, [r6] + adds r0, r1 + movs r1, 0xC + bl pokemon_getattr + mov r1, sp + strh r0, [r1] + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr + adds r5, 0x1 + cmp r5, 0x5 + ble _08163A3C + b _08163A78 + .pool +_08163A74: + bl sub_816537C +_08163A78: + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81639AC + + thumb_func_start sub_8163A8C +sub_8163A8C: @ 8163A8C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8145F20 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08163AB0 + ldr r0, =0x030022c0 + ldr r1, =sub_81639AC + str r1, [r0, 0x8] + ldr r0, =sub_8036760 + bl SetMainCallback2 + adds r0, r4, 0 + bl DestroyTask +_08163AB0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8163A8C + + thumb_func_start sub_8163AC4 +sub_8163AC4: @ 8163AC4 + push {r4-r6,lr} + sub sp, 0x4 + ldr r0, =0x02024474 + ldr r2, =0x020375e0 + ldrh r1, [r2] + adds r0, 0x26 + strb r1, [r0] + ldrh r0, [r2] + cmp r0, 0xA + bls _08163ADA + b _08163E68 +_08163ADA: + lsls r0, 2 + ldr r1, =_08163AF0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08163AF0: + .4byte _08163B1C + .4byte _08163BC0 + .4byte _08163C10 + .4byte _08163C70 + .4byte _08163CC4 + .4byte _08163D28 + .4byte _08163D74 + .4byte _08163DB4 + .4byte _08163E2C + .4byte _08163DF4 + .4byte _08163DC8 +_08163B1C: + ldr r5, =0x02022fec + movs r0, 0x84 + lsls r0, 1 + str r0, [r5] + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x1 + beq _08163B56 + cmp r4, 0x1 + bgt _08163B44 + cmp r4, 0 + beq _08163B4E + b _08163BA6 + .pool +_08163B44: + cmp r4, 0x2 + beq _08163B64 + cmp r4, 0x3 + beq _08163B98 + b _08163BA6 +_08163B4E: + movs r0, 0x3 + bl sub_8163048 + b _08163BA6 +_08163B56: + movs r0, 0x4 + bl sub_8163048 + ldr r0, [r5] + orrs r0, r4 + str r0, [r5] + b _08163BA6 +_08163B64: + movs r0, 0x2 + bl sub_816306C + ldr r1, =0x02038bce + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r2, =0x00000cd6 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + ldrh r0, [r1] + bl sub_8165404 + ldr r0, [r5] + ldr r1, =0x00408041 + orrs r0, r1 + str r0, [r5] + b _08163BA6 + .pool +_08163B98: + ldr r0, [r5] + ldr r1, =0x00800043 + orrs r0, r1 + str r0, [r5] + movs r0, 0x2 + bl sub_816306C +_08163BA6: + ldr r0, =sub_8163A8C + movs r1, 0x1 + bl CreateTask + movs r0, 0 + bl current_map_music_set__default_for_battle + movs r0, 0 + b _08163E10 + .pool +_08163BC0: + movs r5, 0 + ldr r6, =0x03005d8c +_08163BC4: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r0, r4, r0 + movs r1, 0xC + bl pokemon_getattr + mov r1, sp + strh r0, [r1] + movs r0, 0x8E + lsls r0, 2 + adds r4, r0 + ldr r0, [r6] + adds r0, r4 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr + adds r5, 0x1 + cmp r5, 0x5 + ble _08163BC4 + ldr r0, =sub_8163A8C + movs r1, 0x1 + bl CreateTask + movs r0, 0 + bl current_map_music_set__default_for_battle + movs r0, 0xC + b _08163E10 + .pool +_08163C10: + bl zero_enemy_party_data + movs r5, 0 + ldr r4, =0x03005d90 +_08163C18: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2C + adds r2, r5, 0 + muls r2, r1 + movs r1, 0xC2 + lsls r1, 4 + adds r2, r1 + ldr r1, [r4] + adds r1, r2 + bl sub_806819C + adds r5, 0x1 + cmp r5, 0x2 + ble _08163C18 + ldr r1, =0x02022fec + ldr r0, =0x00000808 + str r0, [r1] + ldr r1, =0x02038bca + movs r0, 0 + strh r0, [r1] + ldr r0, =sub_8163A8C + movs r1, 0x1 + bl CreateTask + movs r0, 0 + bl current_map_music_set__default_for_battle + movs r0, 0xD + b _08163E10 + .pool +_08163C70: + ldr r4, =0x02022fec + ldr r0, =0x00010008 + str r0, [r4] + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1 + bne _08163C8A + ldr r0, [r4] + orrs r0, r1 + str r0, [r4] +_08163C8A: + ldr r0, =0x02038bca + ldrh r1, [r0] + ldr r0, =0x000003fe + cmp r1, r0 + bne _08163C9A + movs r0, 0x2 + bl sub_8163048 +_08163C9A: + ldr r0, =sub_8163A8C + movs r1, 0x1 + bl CreateTask + movs r0, 0 + bl sub_806E694 + movs r0, 0x3 + b _08163E10 + .pool +_08163CC4: + ldr r4, =0x02022fec + ldr r0, =0x00020008 + str r0, [r4] + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1 + bne _08163CDE + ldr r0, [r4] + orrs r0, r1 + str r0, [r4] +_08163CDE: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _08163D0C + movs r0, 0x3 + bl sub_8163048 + b _08163D12 + .pool +_08163D0C: + movs r0, 0x3 + bl sub_81630A0 +_08163D12: + ldr r0, =sub_8163A8C + movs r1, 0x1 + bl CreateTask + movs r0, 0 + bl current_map_music_set__default_for_battle + movs r0, 0x4 + b _08163E10 + .pool +_08163D28: + ldr r1, =0x02022fec + ldr r0, =0x00040008 + str r0, [r1] + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _08163D58 + movs r0, 0x3 + bl sub_8163048 + b _08163D5E + .pool +_08163D58: + movs r0, 0x3 + bl sub_81630A0 +_08163D5E: + ldr r0, =sub_8163A8C + movs r1, 0x1 + bl CreateTask + movs r0, 0 + bl current_map_music_set__default_for_battle + movs r0, 0x5 + b _08163E10 + .pool +_08163D74: + ldr r4, =0x02022fec + ldr r0, =0x00080008 + str r0, [r4] + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x1 + bne _08163D8E + ldr r0, [r4] + orrs r0, r1 + str r0, [r4] +_08163D8E: + bl sub_8163590 + ldr r0, =sub_8163A8C + movs r1, 0x1 + bl CreateTask + movs r0, 0 + bl current_map_music_set__default_for_battle + movs r0, 0x6 + b _08163E10 + .pool +_08163DB4: + ldr r1, =0x02022fec + movs r0, 0x84 + lsls r0, 1 + str r0, [r1] + movs r0, 0x3 + bl sub_8163048 + b _08163E00 + .pool +_08163DC8: + ldr r1, =0x02022fec + ldr r0, =0x00200008 + str r0, [r1] + movs r0, 0x3 + bl sub_8163048 + ldr r0, =sub_8163A8C + movs r1, 0x1 + bl CreateTask + movs r0, 0 + bl current_map_music_set__default_for_battle + movs r0, 0xA + b _08163E10 + .pool +_08163DF4: + ldr r1, =0x02022fec + ldr r0, =0x00008109 + str r0, [r1] + movs r0, 0x1 + bl sub_816306C +_08163E00: + ldr r0, =sub_8163A8C + movs r1, 0x1 + bl CreateTask + movs r0, 0 + bl current_map_music_set__default_for_battle + movs r0, 0x7 +_08163E10: + bl sub_80B100C + lsls r0, 24 + lsrs r0, 24 + bl sub_8145EF4 + b _08163E68 + .pool +_08163E2C: + ldr r1, =0x02022fec + ldr r0, =0x00408049 + str r0, [r1] + ldr r5, =0x00000c03 + adds r0, r5, 0 + bl sub_8165404 + ldr r4, =0x02038bfc + movs r0, 0 + strb r0, [r4] + ldr r0, =gUnknown_08224158 + bl TrainerBattleConfigure + movs r0, 0x1 + strb r0, [r4] + ldr r0, =gUnknown_08224167 + bl TrainerBattleConfigure + ldr r0, =0x02038bce + strh r5, [r0] + ldr r0, =sub_8163A8C + movs r1, 0x1 + bl CreateTask + movs r0, 0 + bl current_map_music_set__default_for_battle + movs r0, 0x12 + bl sub_8145EF4 +_08163E68: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8163AC4 + + thumb_func_start sub_8163E90 +sub_8163E90: @ 8163E90 + push {r4-r6,lr} + ldr r6, =0x03005d90 + ldr r0, [r6] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r5, [r0] + lsls r5, 30 + lsrs r5, 30 + ldr r0, =0x000040ce + bl VarGet + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8164FCC + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, [r6] + lsls r5, 1 + lsls r4, 2 + adds r5, r4 + movs r1, 0xCE + lsls r1, 4 + adds r0, r1 + adds r1, r0, r5 + ldrh r0, [r1] + cmp r0, r2 + bcs _08163ED0 + strh r2, [r1] +_08163ED0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8163E90 + + thumb_func_start sub_8163EE4 +sub_8163EE4: @ 8163EE4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r4, =0x03005d90 + ldr r0, [r4] + ldr r1, =0x0000064c + adds r5, r0, r1 + adds r0, r5, 0 + bl sub_8164FB8 + ldr r0, [r4] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r6, r0, 30 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, [r4] + ldrb r0, [r2, 0x8] + cmp r0, 0 + beq _08163F40 + ldr r4, =gUnknown_085DCEFA + ldrb r0, [r2, 0xA] + ldrb r1, [r2, 0xB] + adds r0, r1 + ldrb r1, [r2, 0xC] + adds r0, r1 + ldrb r1, [r2, 0xD] + adds r0, r1 + movs r1, 0x14 + b _08163F52 + .pool +_08163F40: + ldr r4, =gUnknown_085DCEDC + ldrb r0, [r2, 0xA] + ldrb r1, [r2, 0xB] + adds r0, r1 + ldrb r1, [r2, 0xC] + adds r0, r1 + ldrb r1, [r2, 0xD] + adds r0, r1 + movs r1, 0x1E +_08163F52: + bl __umodsi3 + adds r0, r4 + ldrb r0, [r0] + strb r6, [r5] + strb r0, [r5, 0x1] + adds r0, r5, 0 + adds r0, 0xC + ldr r4, =0x03005d90 + ldr r1, [r4] + adds r1, 0xA + bl sub_80842F4 + adds r0, r5, 0x4 + ldr r1, [r4] + bl CopyString_Limit7 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_8164FCC + strh r0, [r5, 0x2] + movs r4, 0 + movs r2, 0x10 + adds r2, r5 + mov r12, r2 + movs r7, 0x1C + adds r7, r5 + mov r9, r7 + adds r6, r5, 0 + adds r6, 0x28 + movs r0, 0xE4 + adds r0, r5 + mov r8, r0 +_08163F96: + lsls r2, r4, 1 + mov r1, r12 + adds r3, r1, r2 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r7, =0x00002bbc + adds r0, r1, r7 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r3] + mov r0, r9 + adds r3, r0, r2 + adds r7, 0xC + adds r0, r1, r7 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r3] + adds r3, r6, r2 + ldr r0, =0x00002bd4 + adds r1, r0 + adds r1, r2 + ldrh r0, [r1] + strh r0, [r3] + adds r4, 0x1 + cmp r4, 0x5 + ble _08163F96 + movs r4, 0 +_08163FCC: + ldr r6, =0x03005d90 + ldr r0, [r6] + lsls r1, r4, 1 + ldr r2, =0x00000caa + adds r0, r2 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, 0 + beq _08163FF4 + adds r1, r0, 0 + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024488 + adds r0, r1 + movs r1, 0x2C + muls r1, r4 + adds r1, 0x34 + adds r1, r5, r1 + bl sub_80686FC +_08163FF4: + adds r4, 0x1 + cmp r4, 0x3 + ble _08163FCC + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + mov r7, r8 + strb r0, [r7] + ldr r0, [r6] + ldr r1, =0x0000064c + adds r0, r1 + bl sub_8164F70 + bl sub_8163E90 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8163EE4 + + thumb_func_start sub_8164040 +sub_8164040: @ 8164040 + push {r4,r5,lr} + ldr r5, =0x03005d90 + 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, 16 + ldr r5, [r5] + lsls r4, 1 + lsrs r0, 14 + adds r4, r0 + movs r2, 0xCE + lsls r2, 4 + adds r0, r5, r2 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =0x020375e2 + ldrh r0, [r0] + cmp r0, 0 + bne _0816408E + cmp r1, 0x1 + bgt _0816408A + ldr r1, =0x00000cb2 + adds r0, r5, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _0816408E +_0816408A: + bl sub_8163EE4 +_0816408E: + ldr r4, =0x03005d90 + ldr r0, [r4] + ldr r1, =0x020375e2 + 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,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8164040 + + thumb_func_start nullsub_61 +nullsub_61: @ 81640D8 + bx lr + thumb_func_end nullsub_61 + + thumb_func_start nullsub_116 +nullsub_116: @ 81640DC + bx lr + thumb_func_end nullsub_116 + + thumb_func_start sub_81640E0 +sub_81640E0: @ 81640E0 + push {r4-r7,lr} + sub sp, 0xC + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + ldr r4, =0x020244ec + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + adds r4, 0x64 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + movs r6, 0 + movs r2, 0 + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r0, =0xfffffe70 + adds r5, r0 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r1, 0xE0 + adds r0, r1 + mov r3, sp +_08164122: + ldrh r1, [r0] + cmp r1, r7 + beq _08164130 + cmp r1, r4 + beq _08164130 + stm r3!, {r2} + adds r6, 0x1 +_08164130: + adds r0, 0xC + adds r2, 0x1 + cmp r2, 0x2 + ble _08164122 + bl GenerateRandomNumber + ldr r4, =0x03006298 + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + strh r0, [r4] +_08164150: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + strh r0, [r4, 0x2] + ldrh r1, [r4] + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + beq _08164150 + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81640E0 + + thumb_func_start sub_8164188 +sub_8164188: @ 8164188 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + ldr r6, =0x03005d90 + ldr r0, [r6] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + str r0, [sp, 0xC] + ldr r4, =0x020244ec + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x10] + adds r4, 0x64 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x14] + movs r3, 0 + mov r8, r3 + movs r7, 0 + adds r2, r6, 0 + ldr r0, =0xfffffed4 + adds r5, r0 + ldr r6, =0x0000076c + mov r10, sp + movs r0, 0xEC + adds r1, r5, 0 + muls r1, r0 + mov r9, r1 +_081641E6: + ldr r1, [r2] + movs r0, 0x2C + muls r0, r7 + mov r3, r9 + adds r5, r0, r3 + adds r1, r5 + adds r0, r1, r6 + ldrh r0, [r0] + ldr r3, [sp, 0x10] + cmp r0, r3 + beq _0816423A + ldr r3, [sp, 0x14] + cmp r0, r3 + beq _0816423A + movs r0, 0xEF + lsls r0, 3 + adds r4, r1, r0 + ldr r1, [sp, 0xC] + lsls r0, r1, 24 + lsrs r0, 24 + str r2, [sp, 0x18] + bl sub_8165C90 + ldrb r1, [r4] + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x18] + cmp r1, r0 + bhi _0816423A + ldr r0, [r2] + adds r0, r5 + adds r0, r6 + ldrh r0, [r0] + cmp r0, 0 + beq _0816423A + mov r3, r10 + adds r3, 0x4 + mov r10, r3 + subs r3, 0x4 + stm r3!, {r7} + movs r0, 0x1 + add r8, r0 +_0816423A: + adds r7, 0x1 + cmp r7, 0x3 + ble _081641E6 + bl GenerateRandomNumber + ldr r4, =0x03006298 + lsls r0, 16 + lsrs r0, 16 + mov r1, r8 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + strh r0, [r4, 0x4] +_08164258: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + mov r1, r8 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + strh r0, [r4, 0x6] + ldrh r1, [r4, 0x4] + lsls r0, 16 + lsrs r0, 16 + cmp r1, r0 + beq _08164258 + 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_8164188 + + thumb_func_start sub_81642A0 +sub_81642A0: @ 81642A0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4C + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r1, r0, r1 + str r1, [sp, 0x24] + ldr r5, =0x03005d90 + ldr r0, [r5] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + str r0, [sp, 0x14] + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + ldr r1, [r5] + ldr r3, [sp, 0x14] + lsls r2, r3, 1 + lsrs r0, 14 + adds r2, r0 + movs r4, 0xCE + lsls r4, 4 + adds r1, r4 + adds r1, r2 + ldrh r0, [r1] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x18] + ldr r4, =0x020244ec + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x1C] + adds r4, 0x64 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + str r0, [sp, 0x20] + bl sub_8165C40 + movs r7, 0 + ldr r0, [sp, 0x18] + lsls r0, 24 + mov r10, r0 +_08164318: + lsls r6, r7, 1 +_0816431A: + mov r1, r10 + lsrs r0, r1, 24 + movs r1, 0 + bl sub_8162548 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + movs r2, 0 + mov r9, r2 + cmp r9, r7 + bge _08164368 + ldr r0, [r5] + ldr r3, =0x00000cb4 + adds r1, r0, r3 + ldrh r0, [r1] + cmp r0, r8 + beq _08164368 + ldr r0, =0x0203bc88 + ldr r2, [r0] + movs r4, 0x34 + mov r0, r8 + muls r0, r4 + adds r0, r2 + ldrb r3, [r0] +_0816434C: + ldrh r0, [r1] + muls r0, r4 + adds r0, r2 + ldrb r0, [r0] + cmp r0, r3 + beq _08164368 + adds r1, 0x2 + movs r0, 0x1 + add r9, r0 + cmp r9, r7 + bge _08164368 + ldrh r0, [r1] + cmp r0, r8 + bne _0816434C +_08164368: + cmp r9, r7 + bne _0816431A + ldr r0, [r5] + ldr r1, =0x00000cb4 + adds r0, r1 + adds r0, r6 + mov r2, r8 + strh r2, [r0] + mov r7, r9 + adds r7, 0x1 + cmp r7, 0x5 + ble _08164318 + movs r3, 0x8 + mov r10, r3 + movs r4, 0 + mov r9, r4 + ldr r0, [sp, 0x24] + str r0, [sp, 0x40] +_0816438C: + ldr r1, =0x03005d90 + ldr r0, [r1] + mov r2, r9 + lsls r1, r2, 1 + ldr r3, =0x00000cb4 + adds r0, r3 + adds r0, r1 + ldrh r0, [r0] + mov r8, r0 + bl sub_81627A4 + ldr r4, [sp, 0x40] + strb r0, [r4, 0x19] + movs r7, 0 +_081643A8: + adds r0, r7, 0x1 + str r0, [sp, 0x30] + mov r1, r10 + lsls r1, 1 + str r1, [sp, 0x38] + mov r2, r10 + adds r2, 0x1 + str r2, [sp, 0x34] + mov r0, r10 + subs r0, 0x1 + lsls r0, 1 + str r0, [sp, 0x28] +_081643C0: + mov r0, r8 + bl sub_8163524 + lsls r0, 16 + lsrs r6, r0, 16 + movs r0, 0x1 + ands r0, r7 + cmp r0, 0 + beq _081643F4 + ldr r3, =0x03005d90 + ldr r0, [r3] + ldr r4, =0x00000cb4 + adds r0, r4 + ldr r1, [sp, 0x28] + adds r0, r1 + ldrh r2, [r0] + ldr r0, =0x0203bc8c + ldr r0, [r0] + lsls r2, 4 + adds r2, r0 + lsls r1, r6, 4 + adds r1, r0 + ldrb r0, [r2, 0xA] + ldrb r1, [r1, 0xA] + cmp r0, r1 + beq _081643C0 +_081643F4: + movs r5, 0x8 + cmp r5, r10 + bge _08164430 + ldr r2, =0x03005d90 + ldr r0, [r2] + ldr r1, =0x0203bc8c + ldr r3, [r1] + lsls r1, r6, 4 + adds r1, r3 + ldr r4, =0x00000cc4 + adds r2, r0, r4 + ldrh r0, [r1] + mov r12, r0 +_0816440E: + ldrh r0, [r2] + lsls r0, 4 + adds r0, r3 + ldrh r0, [r0] + cmp r0, r12 + beq _08164430 + ldrh r0, [r1] + ldr r4, [sp, 0x1C] + cmp r4, r0 + beq _08164430 + ldr r4, [sp, 0x20] + cmp r4, r0 + beq _08164430 + adds r2, 0x2 + adds r5, 0x1 + cmp r5, r10 + blt _0816440E +_08164430: + cmp r5, r10 + bne _081643C0 + ldr r1, =0x03005d90 + ldr r0, [r1] + ldr r2, =0x00000cb4 + adds r0, r2 + ldr r3, [sp, 0x38] + adds r0, r3 + strh r6, [r0] + ldr r4, [sp, 0x34] + mov r10, r4 + ldr r7, [sp, 0x30] + cmp r7, 0x1 + ble _081643A8 + ldr r0, [sp, 0x40] + adds r0, 0x18 + str r0, [sp, 0x40] + movs r1, 0x1 + add r9, r1 + mov r2, r9 + cmp r2, 0x5 + ble _0816438C + movs r3, 0 + mov r10, r3 + bl sub_8165B20 + movs r4, 0 + mov r9, r4 + ldr r0, =0x03005d90 + ldr r0, [r0] + movs r2, 0 + adds r6, r0, 0 + adds r6, 0xDC + mov r8, sp +_08164474: + ldrb r0, [r6] + lsls r4, r0, 25 + lsrs r0, r4, 30 + cmp r0, 0 + beq _081644E0 + ldr r1, =gUnknown_085DF9EC + ldrb r0, [r6, 0x1] + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x7 + str r2, [sp, 0x44] + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x44] + ldr r1, [sp, 0x18] + cmp r0, r1 + bgt _081644E0 + lsrs r0, r4, 30 + subs r0, 0x1 + ldr r3, [sp, 0x14] + cmp r0, r3 + bne _081644E0 + movs r5, 0 + ldr r0, =0x03005d90 + ldr r0, [r0] + adds r0, 0xE0 + adds r1, r2, r0 + movs r7, 0x2 +_081644B0: + ldrh r0, [r1] + ldr r4, [sp, 0x1C] + cmp r4, r0 + beq _081644C0 + ldr r3, [sp, 0x20] + cmp r3, r0 + beq _081644C0 + adds r5, 0x1 +_081644C0: + adds r1, 0xC + subs r7, 0x1 + cmp r7, 0 + bge _081644B0 + cmp r5, 0x2 + ble _081644E0 + movs r0, 0xC8 + lsls r0, 1 + add r0, r9 + mov r4, r8 + adds r4, 0x4 + mov r8, r4 + subs r4, 0x4 + stm r4!, {r0} + movs r0, 0x1 + add r10, r0 +_081644E0: + adds r2, 0x44 + adds r6, 0x44 + movs r1, 0x1 + add r9, r1 + mov r3, r9 + cmp r3, 0x3 + ble _08164474 + mov r4, r10 + cmp r4, 0 + beq _08164532 + bl GenerateRandomNumber + ldr r6, =0x03005d90 + ldr r4, [r6] + lsls r0, 16 + lsrs r0, 16 + mov r1, r10 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + movs r5, 0xCC + lsls r5, 4 + adds r4, r5 + strh r0, [r4] + ldrh r0, [r4] + bl sub_81627A4 + ldr r1, [sp, 0x24] + adds r1, 0xA8 + strb r0, [r1, 0x1] + movs r0, 0xD8 + lsls r0, 2 + bl FlagReset + ldr r0, [r6] + adds r0, r5 + ldrh r0, [r0] + bl sub_81640E0 +_08164532: + movs r0, 0 + mov r10, r0 + mov r9, r0 + mov r1, sp + str r1, [sp, 0x3C] +_0816453C: + ldr r0, =0x03005d90 + movs r2, 0xEC + mov r1, r9 + muls r1, r2 + movs r3, 0xE7 + lsls r3, 3 + adds r1, r3 + ldr r0, [r0] + movs r2, 0 + movs r3, 0 + movs r7, 0 + mov r4, r9 + adds r4, 0x1 + str r4, [sp, 0x2C] + adds r1, r0, r1 +_0816455A: + ldm r1!, {r0} + orrs r2, r0 + adds r3, r0 + adds r7, 0x1 + cmp r7, 0x39 + bls _0816455A + ldr r0, =0x03005d90 + ldr r5, [r0] + movs r1, 0xEC + mov r6, r9 + muls r6, r1 + adds r4, r5, r6 + ldr r1, =0x0000073a + adds r0, r4, r1 + ldrh r0, [r0] + movs r1, 0x7 + str r2, [sp, 0x44] + str r3, [sp, 0x48] + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + ldr r2, [sp, 0x44] + ldr r3, [sp, 0x48] + ldr r1, [sp, 0x18] + cmp r0, r1 + bgt _08164656 + movs r1, 0xE7 + lsls r1, 3 + adds r0, r4, r1 + ldrb r0, [r0] + ldr r4, [sp, 0x14] + cmp r0, r4 + bne _08164656 + cmp r2, 0 + beq _08164656 + adds r1, 0xE8 + adds r0, r5, r1 + adds r0, r6 + ldr r0, [r0] + cmp r0, r3 + bne _08164656 + movs r5, 0 + movs r7, 0 + ldr r2, =0x03005d90 + mov r8, r2 + ldr r3, =0x0000076c +_081645B8: + mov r4, r8 + ldr r2, [r4] + movs r0, 0x2C + adds r1, r7, 0 + muls r1, r0 + movs r4, 0xEC + mov r0, r9 + muls r0, r4 + adds r6, r1, r0 + adds r2, r6 + adds r0, r2, r3 + ldrh r0, [r0] + ldr r1, [sp, 0x1C] + cmp r1, r0 + beq _0816463C + ldr r4, [sp, 0x20] + cmp r4, r0 + beq _0816463C + movs r0, 0xEF + lsls r0, 3 + adds r4, r2, r0 + ldr r1, [sp, 0x14] + lsls r0, r1, 24 + lsrs r0, 24 + str r3, [sp, 0x48] + bl sub_8165C90 + ldrb r1, [r4] + lsls r0, 24 + lsrs r0, 24 + ldr r3, [sp, 0x48] + cmp r1, r0 + bhi _0816463C + mov r2, r8 + ldr r0, [r2] + adds r0, r6 + adds r0, r3 + ldrh r0, [r0] + cmp r0, 0 + b _08164638 + .pool +_08164638: + beq _0816463C + adds r5, 0x1 +_0816463C: + adds r7, 0x1 + cmp r7, 0x3 + ble _081645B8 + cmp r5, 0x1 + ble _08164656 + movs r0, 0x96 + lsls r0, 1 + add r0, r9 + ldr r3, [sp, 0x3C] + stm r3!, {r0} + str r3, [sp, 0x3C] + movs r4, 0x1 + add r10, r4 +_08164656: + ldr r0, [sp, 0x2C] + mov r9, r0 + cmp r0, 0x4 + bgt _08164660 + b _0816453C +_08164660: + mov r1, r10 + cmp r1, 0 + beq _081646A0 + bl GenerateRandomNumber + ldr r6, =0x03005d90 + ldr r4, [r6] + lsls r0, 16 + lsrs r0, 16 + mov r1, r10 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + ldr r5, =0x00000cc2 + adds r4, r5 + strh r0, [r4] + ldrh r0, [r4] + bl sub_81627A4 + ldr r1, [sp, 0x24] + adds r1, 0xC0 + strb r0, [r1, 0x1] + ldr r0, =0x00000361 + bl FlagReset + ldr r0, [r6] + adds r0, r5 + ldrh r0, [r0] + bl sub_8164188 +_081646A0: + 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_81642A0 + + thumb_func_start sub_81646BC +sub_81646BC: @ 81646BC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + movs r0, 0 + mov r9, r0 + mov r10, r0 + bl sub_8165C40 + movs r0, 0xFA + lsls r0, 1 + cmp r5, r0 + beq _081647CE + subs r0, 0xC9 + cmp r5, r0 + bhi _081646FC + ldr r0, =0x0203bc8c + ldr r1, [r0] + lsls r0, r4, 4 + adds r0, r1 + ldrh r1, [r0, 0x2] + mov r9, r1 + ldrh r0, [r0] + mov r10, r0 + b _081647CE + .pool +_081646FC: + ldr r0, =0x0000018f + cmp r5, r0 + bhi _08164750 + ldr r0, =0x03005d90 + ldr r3, [r0] + ldr r1, =0x03006298 + ldr r0, =0x020375e2 + ldrh r0, [r0] + adds r0, 0x1 + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x2C + muls r1, r0 + ldr r0, =0xfffffed4 + adds r2, r5, r0 + movs r0, 0xEC + muls r0, r2 + adds r1, r0 + adds r3, r1 + movs r1, 0xEE + lsls r1, 3 + adds r0, r3, r1 + ldrh r0, [r0] + mov r9, r0 + ldr r2, =0x0000076c + adds r3, r2 + ldrh r3, [r3] + mov r10, r3 + b _081647CE + .pool +_08164750: + ldr r4, =0x03005d90 + ldr r3, [r4] + ldr r1, =0x03006298 + ldr r0, =0x020375e2 + ldrh r0, [r0] + subs r0, 0x1 + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r2, =0xfffffe70 + adds r1, r5, r2 + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + adds r0, r2 + adds r3, r0 + adds r0, r3, 0 + adds r0, 0xE2 + ldrh r0, [r0] + mov r9, r0 + adds r3, 0xE0 + ldrh r3, [r3] + mov r10, r3 + movs r3, 0 + ldr r7, =0x02021ec4 + mov r8, r7 + adds r0, r4, 0 + mov r12, r0 + adds r4, r2, 0 + movs r6, 0x8A + lsls r6, 1 +_08164794: + mov r1, r8 + adds r2, r3, r1 + mov r1, r12 + ldr r0, [r1] + adds r1, r3, r4 + adds r0, r6 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + adds r3, 0x1 + cmp r3, 0x6 + ble _08164794 + adds r1, r3, r7 + movs r0, 0xFF + strb r0, [r1] + ldr r0, =0x03005d90 + ldr r2, [r0] + ldr r0, =0xfffffe70 + adds r1, r5, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, r0 + ldr r1, =0x0000011b + adds r0, r2, r1 + ldrb r1, [r0] + adds r0, r7, 0 + bl StopMusicWhileStringIsPrinted +_081647CE: + ldr r0, =0x02021cc4 + movs r1, 0xD + mov r2, r9 + muls r2, r1 + adds r1, r2, 0 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021dc4 + movs r1, 0xB + mov r2, r10 + muls r2, r1 + adds r1, r2, 0 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81646BC + + thumb_func_start sub_8164828 +sub_8164828: @ 8164828 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + bl sub_8165C40 + bl sub_81A39C4 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, =0x020375f2 + ldrh r0, [r0] + subs r5, r0, 0x2 + ldr r0, =0x03005d90 + ldr r0, [r0] + lsls r1, r5, 1 + ldr r2, =0x00000cb4 + adds r0, r2 + adds r0, r1 + ldrh r7, [r0] + movs r3, 0 + str r3, [sp] + ldr r4, =gUnknown_085DD500 + lsls r6, r7, 16 + b _08164884 + .pool +_0816487C: + adds r4, 0x8 + ldr r0, [sp] + adds r0, 0x1 + str r0, [sp] +_08164884: + ldr r1, [sp] + cmp r1, 0x31 + bhi _0816489A + lsrs r0, r6, 16 + bl sub_8162D34 + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r4] + cmp r1, r0 + bne _0816487C +_0816489A: + ldr r0, =0x020375e2 + ldrh r0, [r0] + cmp r0, 0x4 + bls _081648A4 + b _08164AC2 +_081648A4: + lsls r0, 2 + ldr r1, =_081648B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081648B8: + .4byte _081648CC + .4byte _08164984 + .4byte _0816499C + .4byte _081649BC + .4byte _08164AC2 +_081648CC: + movs r0, 0xFA + lsls r0, 1 + cmp r7, r0 + bne _081648D6 + b _08164B54 +_081648D6: + subs r0, 0xC9 + cmp r7, r0 + ble _081648E2 + ldr r0, =0x0000018f + cmp r7, r0 + bgt _081648F4 +_081648E2: + ldr r0, =0x02021cc4 + adds r1, r7, 0 + bl sub_8162E20 + b _08164AC2 + .pool +_081648F4: + movs r3, 0 + lsls r2, r7, 16 + mov r10, r2 + ldr r6, =0x02021cc4 + mov r9, r6 + ldr r4, =0x03005d90 + mov r8, r4 + ldr r5, =0xfffffe70 + adds r1, r7, r5 + lsls r0, r1, 4 + adds r0, r1 + lsls r4, r0, 2 + movs r5, 0x8A + lsls r5, 1 +_08164910: + mov r0, r9 + adds r2, r3, r0 + mov r1, r8 + ldr r0, [r1] + adds r1, r3, r4 + adds r0, r5 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + adds r3, 0x1 + cmp r3, 0x6 + ble _08164910 + adds r1, r3, r6 + movs r0, 0xFF + strb r0, [r1] + ldr r2, =0x03005d90 + ldr r1, [r2] + ldr r3, =0xfffffe70 + adds r0, r7, r3 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r1, r4 + ldr r5, =0x0000011b + adds r0, r1, r5 + ldrb r1, [r0] + adds r0, r6, 0 + bl StopMusicWhileStringIsPrinted + ldr r0, =0x02021dc4 + ldr r2, =0x03005d90 + ldr r1, [r2] + adds r1, r4 + adds r1, 0xDE + ldrb r1, [r1] + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r0, =0x02021ec4 + mov r3, r10 + lsrs r1, r3, 16 + bl sub_8162E20 + b _08164AC2 + .pool +_08164984: + ldr r0, =0x03005d90 + ldr r1, [r0] + lsls r0, r5, 2 + adds r1, r0 + ldr r4, =0x00000cc4 + adds r1, r4 + b _081649A8 + .pool +_0816499C: + ldr r0, =0x03005d90 + ldr r1, [r0] + lsls r0, r5, 2 + adds r1, r0 + ldr r5, =0x00000cc6 + adds r1, r5 +_081649A8: + adds r0, r7, 0 + ldrh r1, [r1] + bl sub_81646BC + b _08164AC2 + .pool +_081649BC: + ldr r0, =0x02038bce + strh r7, [r0] + ldr r0, =0x0000012b + cmp r7, r0 + bgt _08164A08 + ldr r0, =0x03005d90 + ldr r4, [r0] + lsls r1, r5, 1 + adds r0, r1, 0 + adds r0, 0x8 + lsls r0, 1 + ldr r3, =0x00000cb4 + adds r2, r4, r3 + adds r0, r2, r0 + ldrh r3, [r0] + ldr r5, =0x00000cd8 + adds r0, r4, r5 + strh r3, [r0] + adds r1, 0x9 + lsls r1, 1 + adds r2, r1 + ldrh r0, [r2] + ldr r1, =0x00000cda + adds r4, r1 + strh r0, [r4] + b _08164A46 + .pool +_08164A08: + ldr r0, =0x0000018f + cmp r7, r0 + bgt _08164A30 + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r3, =0x03006298 + ldrh r2, [r3, 0x4] + ldr r4, =0x00000cd8 + adds r0, r1, r4 + strh r2, [r0] + ldrh r0, [r3, 0x6] + b _08164A40 + .pool +_08164A30: + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r3, =0x03006298 + ldrh r2, [r3] + ldr r4, =0x00000cd8 + adds r0, r1, r4 + strh r2, [r0] + ldrh r0, [r3, 0x2] +_08164A40: + ldr r5, =0x00000cda + adds r1, r5 + strh r0, [r1] +_08164A46: + movs r5, 0 + mov r0, r8 + lsls r0, 24 + str r0, [sp, 0x4] +_08164A4E: + lsls r1, r5, 1 + mov r10, r1 + adds r2, r5, 0x1 + mov r9, r2 + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r0, 1 + lsls r0, 24 + mov r8, r0 +_08164A60: + ldr r3, [sp, 0x4] + lsrs r0, r3, 24 + mov r4, r8 + lsrs r1, r4, 24 + bl sub_8162548 + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, =0x02038bce + ldrh r0, [r0] + cmp r0, r3 + beq _08164A60 + movs r2, 0 + cmp r2, r5 + bge _08164AA2 + ldr r1, =0x03005d90 + ldr r0, [r1] + ldr r4, =0x00000cb4 + adds r0, r4 + ldrh r0, [r0] + cmp r0, r3 + beq _08164AA2 + adds r6, r1, 0 +_08164A8E: + adds r2, 0x1 + cmp r2, r5 + bge _08164AA2 + ldr r0, [r6] + lsls r1, r2, 1 + adds r0, r4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r3 + bne _08164A8E +_08164AA2: + cmp r2, r5 + bne _08164A60 + ldr r5, =0x03005d90 + ldr r0, [r5] + ldr r1, =0x00000cb4 + adds r0, r1 + add r0, r10 + strh r3, [r0] + mov r5, r9 + cmp r5, 0xD + ble _08164A4E + ldr r2, =0x03005d90 + ldr r0, [r2] + ldr r3, =0x00000cd6 + adds r0, r3 + strh r7, [r0] +_08164AC2: + movs r0, 0xFA + lsls r0, 1 + cmp r7, r0 + beq _08164B54 + subs r0, 0xC9 + cmp r7, r0 + bgt _08164AF8 + ldr r0, =gUnknown_085DD500 + ldr r4, [sp] + lsls r1, r4, 3 + b _08164B04 + .pool +_08164AF8: + ldr r0, =0x0000018f + cmp r7, r0 + bgt _08164B28 + ldr r0, =gUnknown_085DD500 + ldr r5, [sp] + lsls r1, r5, 3 +_08164B04: + adds r0, 0x4 + adds r1, r0 + ldr r0, =0x020375e2 + ldrh r0, [r0] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl box_related_two__2 + b _08164B54 + .pool +_08164B28: + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r0, =0xfffffe70 + adds r2, r7, r0 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + adds r1, 0xDC + ldrb r0, [r1] + lsls r0, 27 + ldr r1, =gUnknown_085DD690 + lsrs r0, 25 + adds r0, r1 + ldr r1, =0x020375e2 + ldrh r1, [r1] + ldr r0, [r0] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 +_08164B54: + 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_8164828 + + thumb_func_start sub_8164B74 +sub_8164B74: @ 8164B74 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + ldr r4, =0x03005d90 + 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, 16 + lsrs r5, r0, 16 + ldr r0, [r4] + ldr r2, =0x00000cb2 + adds r0, r2 + ldrh r6, [r0] + bl link_get_multiplayer_id + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0x6 + bls _08164BAC + b _08164DB6 +_08164BAC: + lsls r0, 2 + ldr r1, =_08164BD0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08164BD0: + .4byte _08164BEC + .4byte _08164C3C + .4byte _08164CE0 + .4byte _08164D14 + .4byte _08164D98 + .4byte _08164DA8 + .4byte _08164DB6 +_08164BEC: + cmp r5, 0x3 + beq _08164BF2 + b _08164DB0 +_08164BF2: + ldr r0, =0x03005d90 + ldr r0, [r0] + lsls r1, r7, 1 + adds r0, r1 + ldr r3, =0x00000cec + adds r0, r3 + ldrh r0, [r0] + movs r1, 0x7 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08164C18 + b _08164DB6 +_08164C18: + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + movs r2, 0x4 + bl link_0800A448 + ldr r1, =0x020375f0 + movs r0, 0x1 + b _08164DB4 + .pool +_08164C3C: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + beq _08164C4A + b _08164DB6 +_08164C4A: + bl sub_800A5B4 + ldr r1, =0x020223c4 + movs r0, 0x80 + lsls r0, 1 + adds r2, r1, r0 + ldrh r0, [r1] + ldrh r3, [r2] + cmp r0, r3 + bhi _08164C60 + ldrh r0, [r2] +_08164C60: + str r0, [sp] + movs r4, 0 + ldr r0, =0x03005d90 + mov r9, r0 +_08164C68: + adds r1, r4, 0x1 + mov r8, r1 + lsrs r0, r4, 31 + adds r0, r4, r0 + asrs r0, 1 + lsls r7, r0, 24 +_08164C74: + ldr r0, [sp] + lsls r0, 24 + lsrs r0, 24 + lsrs r1, r7, 24 + bl sub_8162548 + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + cmp r2, r4 + bge _08164CB0 + mov r1, r9 + ldr r0, [r1] + ldr r1, =0x00000cb4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r3 + beq _08164CB0 + ldr r6, =0x03005d90 + adds r5, r1, 0 +_08164C9C: + adds r2, 0x1 + cmp r2, r4 + bge _08164CB0 + ldr r0, [r6] + lsls r1, r2, 1 + adds r0, r5 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r3 + bne _08164C9C +_08164CB0: + cmp r4, r2 + bne _08164C74 + mov r2, r9 + ldr r0, [r2] + lsls r1, r4, 1 + ldr r2, =0x00000cb4 + adds r0, r2 + adds r0, r1 + strh r3, [r0] + mov r4, r8 + cmp r4, 0xD + ble _08164C68 + ldr r1, =0x020375f0 + movs r0, 0x2 + b _08164DB4 + .pool +_08164CE0: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _08164DB6 + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005d90 + ldr r1, [r1] + ldr r3, =0x00000cb4 + adds r1, r3 + movs r2, 0x28 + bl link_0800A448 + ldr r1, =0x020375f0 + movs r0, 0x3 + b _08164DB4 + .pool +_08164D14: + bl sub_800A550 + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x3 + bne _08164DB6 + bl sub_800A5B4 + ldr r4, =0x03005d90 + ldr r0, [r4] + ldr r5, =0x00000cb4 + adds r0, r5 + ldr r1, =0x020223c4 + movs r2, 0x28 + bl memcpy + ldr r2, =0x02038bca + ldr r1, [r4] + lsls r0, r6, 2 + adds r1, r5 + adds r0, r1, r0 + ldrh r0, [r0] + strh r0, [r2] + ldr r4, =0x02038bcc + lsls r0, r6, 1 + adds r0, 0x1 + lsls r0, 1 + adds r1, r0 + ldrh r0, [r1] + strh r0, [r4] + ldrh r0, [r2] + movs r1, 0 + bl sub_8162614 + ldrh r0, [r4] + movs r1, 0x1 + bl sub_8162614 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _08164DB0 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _08164DB0 + ldr r1, =0x020375f0 + movs r0, 0x4 + b _08164DB4 + .pool +_08164D98: + bl sub_800AC34 + ldr r1, =0x020375f0 + movs r0, 0x5 + b _08164DB4 + .pool +_08164DA8: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _08164DB6 +_08164DB0: + ldr r1, =0x020375f0 + movs r0, 0x6 +_08164DB4: + strh r0, [r1] +_08164DB6: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8164B74 + + thumb_func_start sub_8164DCC +sub_8164DCC: @ 8164DCC + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08164DDA + bl sub_800AC34 +_08164DDA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8164DCC + + thumb_func_start sub_8164DE4 +sub_8164DE4: @ 8164DE4 + push {lr} + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000cd6 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0xF + bl sub_8162614 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8164DE4 + + thumb_func_start sub_8164E04 +sub_8164E04: @ 8164E04 + push {r4-r6,lr} + sub sp, 0x20 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 16 + cmp r0, 0 + bne _08164E9A + ldr r5, =0x02038bca + ldrh r1, [r5] + mov r0, sp + bl sub_8162E20 + mov r0, sp + bl StripExtendedControlCodes + ldr r4, =0x03005d90 + ldr r0, [r4] + ldr r1, =0x00000bd8 + adds r0, r1 + mov r1, sp + bl CopyString + ldr r0, [r4] + ldr r2, =0x00000beb + adds r0, r2 + ldrh r1, [r5] + bl sub_8165B88 + ldr r6, =0x0202406e + ldrh r0, [r6, 0x2] + movs r5, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + ldr r1, [r4] + ldr r2, =0x00000bd6 + adds r1, r2 + strh r0, [r1] + ldrh r0, [r6] + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + ldr r1, [r4] + ldr r2, =0x00000bd4 + adds r1, r2 + strh r0, [r1] + movs r2, 0 + movs r5, 0xBE + lsls r5, 4 + ldr r3, =0x020240b4 + adds r6, r4, 0 +_08164E7C: + ldr r0, [r4] + adds r0, r5 + adds r0, r2 + adds r1, r2, r3 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0xA + ble _08164E7C + ldr r0, [r6] + ldr r1, =0x0202433a + ldrb r1, [r1] + ldr r2, =0x00000d06 + adds r0, r2 + strb r1, [r0] +_08164E9A: + add sp, 0x20 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8164E04 + + thumb_func_start sub_8164ED8 +sub_8164ED8: @ 8164ED8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x03005d90 + ldr r0, [r0] + movs r3, 0 + movs r2, 0 + ldr r4, =0x0000064c + adds r1, r0, r4 +_08164EEA: + ldm r1!, {r0} + adds r3, r0 + adds r2, 0x1 + cmp r2, 0x39 + bls _08164EEA + ldr r5, =0x03005d90 + ldr r1, [r5] + ldr r2, =0x00000734 + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, r3 + beq _08164F0A + ldr r3, =0x0000064c + adds r0, r1, r3 + bl sub_8164FB8 +_08164F0A: + movs r4, 0 + adds r7, r5, 0 + movs r6, 0xEC + mov r8, r7 +_08164F12: + adds r0, r4, 0 + muls r0, r6 + movs r1, 0xE7 + lsls r1, 3 + adds r0, r1 + ldr r1, [r7] + movs r3, 0 + movs r2, 0 + adds r5, r4, 0x1 + adds r1, r0 +_08164F26: + ldm r1!, {r0} + adds r3, r0 + adds r2, 0x1 + cmp r2, 0x39 + bls _08164F26 + mov r0, r8 + ldr r2, [r0] + adds r1, r4, 0 + muls r1, r6 + movs r4, 0x82 + lsls r4, 4 + adds r0, r2, r4 + adds r0, r1 + ldr r0, [r0] + cmp r0, r3 + beq _08164F52 + movs r3, 0xE7 + lsls r3, 3 + adds r0, r1, r3 + adds r0, r2, r0 + bl sub_8164FB8 +_08164F52: + adds r4, r5, 0 + cmp r4, 0x4 + ble _08164F12 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8164ED8 + + thumb_func_start sub_8164F70 +sub_8164F70: @ 8164F70 + push {r4,lr} + adds r2, r0, 0 + adds r2, 0xE8 + movs r1, 0 + str r1, [r2] + movs r3, 0 + adds r4, r0, 0 +_08164F7E: + ldr r0, [r2] + ldm r4!, {r1} + adds r0, r1 + str r0, [r2] + adds r3, 0x1 + cmp r3, 0x39 + bls _08164F7E + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8164F70 + + thumb_func_start sub_8164F94 +sub_8164F94: @ 8164F94 + push {r4,lr} + adds r2, r0, 0 + adds r2, 0xA0 + movs r1, 0 + str r1, [r2] + movs r3, 0 + adds r4, r0, 0 +_08164FA2: + ldr r0, [r2] + ldm r4!, {r1} + adds r0, r1 + str r0, [r2] + adds r3, 0x1 + cmp r3, 0x27 + bls _08164FA2 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8164F94 + + thumb_func_start sub_8164FB8 +sub_8164FB8: @ 8164FB8 + push {lr} + movs r1, 0 + movs r2, 0 +_08164FBE: + stm r0!, {r2} + adds r1, 0x1 + cmp r1, 0x3A + bls _08164FBE + pop {r0} + bx r0 + thumb_func_end sub_8164FB8 + + thumb_func_start sub_8164FCC +sub_8164FCC: @ 8164FCC + push {lr} + lsls r0, 24 + lsls r1, 24 + ldr r2, =0x03005d90 + ldr r2, [r2] + lsrs r0, 23 + lsrs r1, 22 + adds r0, r1 + movs r1, 0xCE + lsls r1, 4 + adds r2, r1 + adds r2, r0 + ldrh r0, [r2] + ldr r1, =0x0000270f + cmp r0, r1 + bls _08164FEE + adds r0, r1, 0 +_08164FEE: + pop {r1} + bx r1 + .pool + thumb_func_end sub_8164FCC + + thumb_func_start sub_8164FFC +sub_8164FFC: @ 8164FFC + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_085DFA42 + mov r0, sp + movs r2, 0x4 + bl memcpy + cmp r4, 0x3 + bls _0816501C + movs r0, 0x3 + b _08165022 + .pool +_0816501C: + mov r1, sp + adds r0, r1, r4 + ldrb r0, [r0] +_08165022: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8164FFC + + thumb_func_start sub_816502C +sub_816502C: @ 816502C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + adds r5, r0, 0 + ldr r0, =0x000040ce + bl VarGet + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + bl sub_8164FFC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r2, 0x44 + mov r10, r2 + cmp r5, 0 + beq _0816506A + movs r0, 0x45 + mov r10, r0 +_0816506A: + ldr r1, =0x020375f0 + mov r9, r1 + movs r0, 0 + strh r0, [r1] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8164FCC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x37 + bls _081650DC + movs r6, 0 + cmp r6, r8 + bge _081650DC + ldr r7, =0x03005d8c + mov r5, sp +_0816508C: + ldr r0, =0x03005d90 + ldr r0, [r0] + lsls r1, r6, 1 + ldr r2, =0x00000caa + adds r0, r2 + adds r0, r1 + ldrh r1, [r0] + subs r1, 0x1 + movs r0, 0 + strb r1, [r5] + strb r0, [r5, 0x1] + movs r0, 0x64 + muls r0, r1 + movs r1, 0x8E + lsls r1, 2 + adds r4, r0, r1 + ldr r0, [r7] + adds r0, r4 + mov r1, r10 + bl pokemon_getattr + cmp r0, 0 + bne _081650D4 + movs r0, 0x1 + mov r2, r9 + strh r0, [r2] + ldr r0, [r7] + adds r0, r4 + mov r1, r10 + bl pokemon_setattr + ldr r0, [r7] + adds r0, r4 + bl sub_80EE5A4 + strb r0, [r5, 0x1] +_081650D4: + adds r5, 0x4 + adds r6, 0x1 + cmp r6, r8 + blt _0816508C +_081650DC: + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0 + beq _08165132 + movs r0, 0x2A + bl sav12_xor_increment + mov r0, r8 + cmp r0, 0x1 + ble _08165110 + mov r3, sp + add r2, sp, 0x4 + mov r6, r8 + subs r6, 0x1 +_081650F8: + ldrb r1, [r3, 0x1] + ldrb r0, [r2, 0x1] + cmp r0, r1 + bls _08165108 + ldr r1, [sp] + ldr r0, [r2] + str r0, [sp] + str r1, [r2] +_08165108: + adds r2, 0x4 + subs r6, 0x1 + cmp r6, 0 + bne _081650F8 +_08165110: + mov r0, sp + ldrb r0, [r0, 0x1] + cmp r0, 0x4 + bls _08165132 + ldr r2, =0x03005d8c + mov r0, sp + ldrb r1, [r0] + movs r0, 0x64 + muls r1, r0 + movs r0, 0x8E + lsls r0, 2 + adds r1, r0 + ldr r0, [r2] + adds r0, r1 + mov r1, r10 + bl sub_80EE4DC +_08165132: + 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_816502C + + thumb_func_start sub_816515C +sub_816515C: @ 816515C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r1, =0x03005d90 + ldr r2, [r1] + ldr r0, =0x00000bec + adds r7, r2, r0 + ldrb r0, [r2, 0x8] + adds r5, r1, 0 + cmp r0, 0 + beq _08165194 + ldr r4, =gUnknown_085DCEFA + ldrb r0, [r2, 0xA] + ldrb r1, [r2, 0xB] + adds r0, r1 + ldrb r1, [r2, 0xC] + adds r0, r1 + ldrb r1, [r2, 0xD] + adds r0, r1 + movs r1, 0x14 + b _081651A6 + .pool +_08165194: + ldr r4, =gUnknown_085DCEDC + ldrb r0, [r2, 0xA] + ldrb r1, [r2, 0xB] + adds r0, r1 + ldrb r1, [r2, 0xC] + adds r0, r1 + ldrb r1, [r2, 0xD] + adds r0, r1 + movs r1, 0x1E +_081651A6: + bl __umodsi3 + adds r0, r4 + ldrb r0, [r0] + strb r0, [r7, 0x1] + adds r0, r7, 0 + adds r0, 0xC + ldr r1, [r5] + adds r1, 0xA + bl sub_80842F4 + adds r0, r7, 0x4 + ldr r1, [r5] + bl CopyString_Limit7 + movs r0, 0x1 + strh r0, [r7, 0x2] + movs r6, 0x7 + movs r4, 0 + ldr r0, =0x03005d8c + mov r8, r0 + adds r5, r7, 0 + adds r5, 0x10 + ldr r1, =0x00002bbc + mov r12, r1 + adds r3, r7, 0 + adds r3, 0x28 + adds r2, r7, 0 + adds r2, 0x1C +_081651E0: + lsls r0, r4, 1 + mov r9, r0 + mov r1, r8 + ldr r0, [r1] + add r0, r12 + add r0, r9 + ldrh r0, [r0] + strh r0, [r5] + strh r6, [r2] + adds r0, r6, 0x6 + strh r0, [r3] + adds r6, 0x1 + adds r5, 0x2 + adds r3, 0x2 + adds r2, 0x2 + adds r4, 0x1 + cmp r4, 0x5 + ble _081651E0 + movs r4, 0 +_08165206: + movs r0, 0x64 + muls r0, r4 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2C + muls r1, r4 + adds r1, 0x34 + adds r1, r7, r1 + bl sub_80686FC + adds r4, 0x1 + cmp r4, 0x2 + ble _08165206 + adds r0, r7, 0 + bl sub_8165328 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816515C + + thumb_func_start sub_8165244 +sub_8165244: @ 8165244 + ldr r1, =gTrainerPicIndices + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r2, =0x00000bed + adds r0, r2 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8165244 + + thumb_func_start sub_8165264 +sub_8165264: @ 8165264 + ldr r1, =gTrainerClassNameIndices + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r2, =0x00000bed + adds r0, r2 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8165264 + + thumb_func_start sub_8165284 +sub_8165284: @ 8165284 + push {r4,lr} + adds r3, r0, 0 + movs r2, 0 + ldr r0, =0x03005d90 + ldr r0, [r0] + movs r1, 0xBF + lsls r1, 4 + adds r4, r0, r1 +_08165294: + adds r0, r3, r2 + adds r1, r4, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x4 + ble _08165294 + adds r1, r3, r2 + movs r0, 0xFF + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8165284 + + thumb_func_start sub_81652B4 +sub_81652B4: @ 81652B4 + push {r4-r6,lr} + ldr r2, =0x020375f0 + movs r0, 0 + strh r0, [r2] + ldr r1, =0x03005d90 + ldr r0, [r1] + ldr r3, =0x00000bec + adds r5, r0, r3 + movs r4, 0 + movs r3, 0 + adds r6, r1, 0 + adds r1, r5, 0 +_081652CC: + ldm r1!, {r0} + orrs r4, r0 + adds r3, 0x1 + cmp r3, 0x2D + bls _081652CC + cmp r4, 0 + bne _081652EC + movs r0, 0x1 + strh r0, [r2] + b _08165316 + .pool +_081652EC: + movs r4, 0 + movs r3, 0 + adds r2, r5, 0 +_081652F2: + ldm r2!, {r0} + adds r4, r0 + adds r3, 0x1 + cmp r3, 0x2D + bls _081652F2 + ldr r1, [r6] + ldr r2, =0x00000ca4 + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, r4 + beq _08165316 + ldr r3, =0x00000bec + adds r0, r1, r3 + bl sub_816534C + ldr r1, =0x020375f0 + movs r0, 0x1 + strh r0, [r1] +_08165316: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81652B4 + + thumb_func_start sub_8165328 +sub_8165328: @ 8165328 + push {r4,lr} + adds r2, r0, 0 + adds r2, 0xB8 + movs r1, 0 + str r1, [r2] + movs r3, 0 + adds r4, r0, 0 +_08165336: + ldr r0, [r2] + ldm r4!, {r1} + adds r0, r1 + str r0, [r2] + adds r3, 0x1 + cmp r3, 0x2D + bls _08165336 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8165328 + + thumb_func_start sub_816534C +sub_816534C: @ 816534C + push {lr} + movs r1, 0 + movs r2, 0 +_08165352: + stm r0!, {r2} + adds r1, 0x1 + cmp r1, 0x2E + bls _08165352 + pop {r0} + bx r0 + thumb_func_end sub_816534C + + thumb_func_start sub_8165360 +sub_8165360: @ 8165360 + push {lr} + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000bfc + adds r0, r1 + bl ConvertBattleFrontierTrainerSpeechToString + pop {r0} + bx r0 + .pool + thumb_func_end sub_8165360 + + thumb_func_start sub_816537C +sub_816537C: @ 816537C + push {lr} + ldr r0, =0x0202433a + ldrb r0, [r0] + cmp r0, 0x3 + bne _08165398 + ldr r1, =0x02021fc4 + movs r0, 0xFF + strb r0, [r1] + b _081653C0 + .pool +_08165398: + cmp r0, 0x1 + bne _081653B4 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000c14 + adds r0, r1 + bl ConvertBattleFrontierTrainerSpeechToString + b _081653C0 + .pool +_081653B4: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000c08 + adds r0, r1 + bl ConvertBattleFrontierTrainerSpeechToString +_081653C0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_816537C + + thumb_func_start sub_81653CC +sub_81653CC: @ 81653CC + push {lr} + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000ca8 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081653E0 + bl sub_80F01B8 +_081653E0: + movs r0, 0x77 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _081653F8 + bl sub_80F01B8 + movs r0, 0x77 + bl FlagReset +_081653F8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81653CC + + thumb_func_start sub_8165404 +sub_8165404: @ 8165404 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x70 + lsls r0, 16 + lsrs r7, r0, 16 + bl sub_8165C40 + ldr r0, =0x00000c03 + cmp r7, r0 + beq _08165420 + b _0816554C +_08165420: + movs r0, 0 + mov r10, r0 + mov r1, sp + adds r1, 0x44 + str r1, [sp, 0x64] +_0816542A: + mov r2, r10 + lsls r2, 2 + mov r9, r2 + mov r3, r10 + adds r3, 0x1 + str r3, [sp, 0x60] + mov r0, r9 + add r0, r10 + lsls r0, 2 + ldr r6, =gUnknown_085DD6D0 + adds r5, r0, r6 +_08165440: + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + str r4, [sp, 0x44] + ldr r0, =0x0000ef2a + adds r1, r4, 0 + bl sub_806EBD0 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0 + bne _08165440 + ldr r0, [sp, 0x44] + bl GetNatureFromPersonality + ldrb r1, [r5, 0x4] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + bne _08165440 + movs r0, 0x64 + mov r6, r10 + muls r6, r0 + ldr r1, =0x02024618 + mov r8, r1 + adds r0, r6, r1 + mov r5, r9 + add r5, r10 + lsls r5, 2 + ldr r2, =gUnknown_085DD6D0 + adds r3, r5, r2 + ldrh r1, [r3] + ldrb r2, [r3, 0x3] + ldrb r3, [r3, 0x2] + mov r12, r3 + movs r4, 0x1 + str r4, [sp] + mov r3, r10 + str r3, [sp, 0x4] + str r4, [sp, 0x8] + ldr r4, =0x0000ef2a + str r4, [sp, 0xC] + mov r3, r12 + bl create_pokemon_set_level + str r7, [sp, 0x44] + movs r3, 0 + mov r4, r8 + ldr r0, =gUnknown_085DD6D5 + adds r5, r0 +_081654B0: + adds r1, r3, 0 + adds r1, 0x1A + adds r2, r5, r3 + adds r0, r6, r4 + bl pokemon_setattr + ldr r0, [sp, 0x44] + adds r0, 0x1 + str r0, [sp, 0x44] + adds r3, r0, 0 + cmp r3, 0x5 + ble _081654B0 + movs r0, 0 + str r0, [sp, 0x44] + movs r1, 0 + movs r6, 0x64 + mov r4, r10 + muls r4, r6 + ldr r7, =gUnknown_085DD6DC + ldr r6, =0x02024618 + mov r0, r9 + add r0, r10 + lsls r5, r0, 2 +_081654DE: + lsls r0, r1, 1 + adds r0, r5 + adds r0, r7 + ldrh r1, [r0] + ldr r0, [sp, 0x64] + ldrb r2, [r0] + adds r0, r4, r6 + bl sub_80691F4 + ldr r0, [sp, 0x44] + adds r0, 0x1 + str r0, [sp, 0x44] + adds r1, r0, 0 + cmp r1, 0x3 + ble _081654DE + movs r1, 0x64 + mov r4, r10 + muls r4, r1 + ldr r0, =0x02024618 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x7 + ldr r2, =gTrainers + TRAINER_STEVEN * 0x28 + 0x4 @ Steven's name + bl pokemon_setattr + movs r0, 0 + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x31 + ldr r2, [sp, 0x64] + bl pokemon_setattr + adds r0, r4, 0 + bl pokemon_calc_effective_stats + ldr r2, [sp, 0x60] + mov r10, r2 + cmp r2, 0x2 + bgt _0816552E + b _0816542A +_0816552E: + b _0816585A + .pool +_0816554C: + movs r0, 0xFA + lsls r0, 1 + cmp r7, r0 + bne _08165564 + add r0, sp, 0x10 + ldr r1, =gUnknown_82E9531 + ldrb r1, [r1] + strb r1, [r0] + b _0816585A + .pool +_08165564: + ldr r0, =0x0000012b + cmp r7, r0 + bls _0816556C + b _081656E8 +_0816556C: + bl sub_8165C40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x50] + adds r0, r7, 0 + bl sub_8165D08 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4C] + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + str r4, [sp, 0x58] + movs r3, 0 + mov r10, r3 + mov r6, sp + adds r6, 0x44 + str r6, [sp, 0x64] + mov r0, sp + adds r0, 0x48 + str r0, [sp, 0x5C] +_081655A6: + ldr r0, =0x03005d90 + ldr r1, [r0] + mov r0, r10 + adds r0, 0x12 + lsls r0, 1 + ldr r2, =0x00000cb4 + adds r1, r2 + adds r1, r0 + ldrh r1, [r1] + str r1, [sp, 0x54] + movs r6, 0x64 + mov r3, r10 + muls r3, r6 + mov r8, r3 + ldr r0, =0x02024618 + mov r9, r0 + mov r0, r8 + add r0, r9 + ldr r6, =0x0203bc8c + ldr r4, [r6] + lsls r5, r1, 4 + adds r4, r5, r4 + ldrh r1, [r4] + ldr r3, [sp, 0x50] + lsls r2, r3, 24 + ldrb r3, [r4, 0xC] + mov r12, r3 + ldr r3, [sp, 0x4C] + str r3, [sp] + ldrb r4, [r4, 0xB] + str r4, [sp, 0x4] + ldr r3, [sp, 0x58] + str r3, [sp, 0x8] + lsrs r2, 24 + mov r3, r12 + bl sub_8068634 + movs r0, 0xFF + str r0, [sp, 0x48] + movs r0, 0 + str r0, [sp, 0x44] + movs r2, 0 + mov r0, r10 + adds r0, 0x1 + str r0, [sp, 0x60] + mov r4, r8 + mov r3, r9 +_08165604: + ldr r0, [r6] + adds r0, r5, r0 + lsls r1, r2, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r1, [r0] + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, r3 + str r3, [sp, 0x68] + bl sub_80691F4 + ldr r0, [r6] + adds r0, r5, r0 + ldr r2, [sp, 0x44] + lsls r1, r2, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r0, [r0] + ldr r3, [sp, 0x68] + cmp r0, 0xDA + bne _08165634 + movs r0, 0 + str r0, [sp, 0x48] +_08165634: + adds r0, r2, 0x1 + str r0, [sp, 0x44] + adds r2, r0, 0 + cmp r2, 0x3 + ble _08165604 + movs r1, 0x64 + mov r4, r10 + muls r4, r1 + ldr r0, =0x02024618 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + ldr r2, [sp, 0x5C] + bl pokemon_setattr + ldr r0, =0x0203bc8c + ldr r1, [r0] + ldr r2, [sp, 0x54] + lsls r0, r2, 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 pokemon_setattr + movs r0, 0 + str r0, [sp, 0x44] + movs r2, 0 + ldr r0, =0x0203bc88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r7 + adds r0, r1 + adds r3, r0, 0x4 +_0816567E: + mov r1, sp + adds r1, r2 + adds r1, 0x10 + adds r0, r3, r2 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, [sp, 0x44] + adds r0, 0x1 + str r0, [sp, 0x44] + adds r2, r0, 0 + cmp r2, 0x7 + ble _0816567E + movs r3, 0x64 + mov r4, r10 + muls r4, r3 + ldr r0, =0x02024618 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x7 + add r2, sp, 0x10 + bl pokemon_setattr + adds r0, r7, 0 + bl sub_8162F68 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x31 + ldr r2, [sp, 0x64] + bl pokemon_setattr + ldr r6, [sp, 0x60] + mov r10, r6 + cmp r6, 0x1 + bgt _081656CA + b _081655A6 +_081656CA: + b _0816585A + .pool +_081656E8: + ldr r0, =0x0000018f + cmp r7, r0 + bls _081656F0 + b _081657F0 +_081656F0: + ldr r1, =0xfffffed4 + adds r0, r7, r1 + lsls r0, 16 + lsrs r7, r0, 16 + movs r2, 0 + mov r10, r2 + mov r3, sp + adds r3, 0x44 + str r3, [sp, 0x64] + add r5, sp, 0x18 + ldr r6, =0x000015fc + mov r9, r6 + ldr r0, =0x0000ffff + mov r8, r0 + movs r1, 0x24 + str r1, [sp, 0x6C] +_08165710: + ldr r1, =0x03005d90 + movs r0, 0xEC + adds r4, r7, 0 + muls r4, r0 + movs r2, 0xE7 + lsls r2, 3 + adds r4, r2 + ldr r0, [r1] + adds r4, r0, r4 + ldr r3, =0x00000cb4 + adds r0, r3 + ldr r6, [sp, 0x6C] + adds r0, r6 + ldrh r1, [r0] + movs r0, 0x2C + muls r1, r0 + adds r1, r4, r1 + adds r0, r5, 0 + adds r1, 0x34 + ldm r1!, {r2,r3,r6} + stm r0!, {r2,r3,r6} + ldm r1!, {r2,r3,r6} + stm r0!, {r2,r3,r6} + ldm r1!, {r2,r3,r6} + stm r0!, {r2,r3,r6} + ldm r1!, {r2,r3} + stm r0!, {r2,r3} + adds r1, r4, 0x4 + add r0, sp, 0x10 + bl CopyString + adds r4, 0xE4 + ldrb r0, [r4] + cmp r0, 0x1 + bne _0816578C + ldrh r0, [r5, 0x20] + mov r6, r8 + ands r0, r6 + cmp r0, r9 + beq _0816579C + mov r1, sp + adds r1, 0x3D + movs r0, 0xFF + strb r0, [r1] + add r0, sp, 0x38 + movs r1, 0x1 + bl StopMusicWhileStringIsPrinted + b _0816579C + .pool +_0816578C: + ldrh r0, [r5, 0x20] + mov r1, r8 + ands r0, r1 + cmp r0, r9 + bne _0816579C + add r1, sp, 0x10 + movs r0, 0xFF + strb r0, [r1, 0x5] +_0816579C: + movs r0, 0x64 + mov r4, r10 + muls r4, r0 + ldr r0, =0x02024618 + adds r4, r0 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_8068338 + adds r0, r4, 0 + movs r1, 0x7 + add r2, sp, 0x10 + bl pokemon_setattr + movs r2, 0x96 + lsls r2, 1 + adds r0, r7, r2 + lsls r0, 16 + lsrs r0, 16 + bl sub_8162F68 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x31 + ldr r2, [sp, 0x64] + bl pokemon_setattr + ldr r3, [sp, 0x6C] + adds r3, 0x2 + str r3, [sp, 0x6C] + movs r6, 0x1 + add r10, r6 + mov r0, r10 + cmp r0, 0x1 + ble _08165710 + b _0816585A + .pool +_081657F0: + ldr r1, =0xfffffe70 + adds r0, r7, r1 + lsls r0, 16 + lsrs r7, r0, 16 + movs r2, 0 + mov r10, r2 + mov r3, sp + adds r3, 0x44 + str r3, [sp, 0x64] + ldr r6, =0x03005d90 + mov r8, r6 + movs r5, 0x24 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r6, r0, 0 + adds r6, 0xDC +_08165812: + movs r0, 0x64 + mov r4, r10 + muls r4, r0 + ldr r0, =0x02024618 + adds r4, r0 + mov r1, r8 + ldr r0, [r1] + adds r1, r0, r6 + ldr r2, =0x00000cb4 + adds r0, r2 + adds r0, r5 + ldrb r2, [r0] + adds r0, r4, 0 + bl sub_8068528 + movs r3, 0xC8 + lsls r3, 1 + adds r0, r7, r3 + lsls r0, 16 + lsrs r0, 16 + bl sub_8162F68 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x31 + ldr r2, [sp, 0x64] + bl pokemon_setattr + adds r5, 0x2 + movs r0, 0x1 + add r10, r0 + mov r1, r10 + cmp r1, 0x1 + ble _08165812 +_0816585A: + add sp, 0x70 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8165404 + + thumb_func_start sub_816587C +sub_816587C: @ 816587C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + adds r6, r0, 0 + adds r5, r1, 0 + movs r2, 0 + adds r1, r6, 0 + adds r3, r6, 0 + adds r3, 0x58 +_08165894: + ldrh r0, [r1, 0x1C] + cmp r0, 0 + beq _0816589C + adds r2, 0x1 +_0816589C: + adds r1, 0x2C + cmp r1, r3 + ble _08165894 + cmp r2, 0x3 + beq _081658B4 + adds r0, r5, 0 + movs r1, 0 + movs r2, 0xEC + bl memset + movs r0, 0 + b _081659BE +_081658B4: + ldrb r0, [r6] + strb r0, [r5] + ldrh r0, [r6, 0x2] + strh r0, [r5, 0x2] + movs r2, 0 + ldr r0, =gUnknown_085DCF40 + ldrb r1, [r0] + ldrb r3, [r6, 0x1] + mov r12, r0 + adds r4, r5, 0x4 + adds r7, r6, 0x4 + movs r0, 0xC + adds r0, r5 + mov r9, r0 + movs r0, 0xC + adds r0, r6 + mov r8, r0 + adds r0, r5, 0 + adds r0, 0x10 + str r0, [sp, 0x4] + movs r0, 0x10 + adds r0, r6 + mov r10, r0 + adds r0, r5, 0 + adds r0, 0x1C + str r0, [sp, 0x8] + adds r0, 0xC + str r0, [sp, 0xC] + adds r0, 0x90 + str r0, [sp, 0x10] + cmp r1, r3 + beq _08165904 + mov r1, r12 +_081658F6: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x51 + bgt _08165904 + ldrb r0, [r1] + cmp r0, r3 + bne _081658F6 +_08165904: + cmp r2, 0x52 + beq _08165918 + lsls r0, r2, 1 + mov r1, r12 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + b _0816591A + .pool +_08165918: + movs r0, 0x2B +_0816591A: + strb r0, [r5, 0x1] + movs r2, 0 + adds r3, r7, 0 +_08165920: + adds r0, r4, r2 + adds r1, r3, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x7 + ble _08165920 + movs r2, 0 + mov r4, r9 + mov r3, r8 +_08165934: + adds r0, r4, r2 + adds r1, r3, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x3 + ble _08165934 + mov r3, r10 + ldr r1, [sp, 0x4] + movs r2, 0x5 +_08165948: + ldrh r0, [r3] + strh r0, [r1] + adds r3, 0x2 + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08165948 + ldr r3, =gUnknown_085DFA46 + ldr r1, [sp, 0x8] + movs r2, 0x5 +_0816595C: + ldrh r0, [r3] + strh r0, [r1] + adds r3, 0x2 + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _0816595C + ldr r3, =gUnknown_085DFA52 + ldr r1, [sp, 0xC] + movs r2, 0x5 +_08165970: + ldrh r0, [r3] + strh r0, [r1] + adds r3, 0x2 + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08165970 + adds r2, r6, 0 + adds r3, r5, 0 + movs r4, 0x58 + adds r4, r2 + mov r8, r4 +_08165988: + adds r1, r3, 0 + adds r1, 0x34 + adds r0, r2, 0 + adds r0, 0x1C + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldm r0!, {r6,r7} + stm r1!, {r6,r7} + adds r2, 0x2C + adds r3, 0x2C + cmp r2, r8 + ble _08165988 + movs r0, 0 + str r0, [sp] + ldr r2, =0x0500000b + mov r0, sp + ldr r1, [sp, 0x10] + bl CpuSet + adds r0, r5, 0 + bl sub_8164F70 + movs r0, 0x1 +_081659BE: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_816587C + + thumb_func_start sub_81659DC +sub_81659DC: @ 81659DC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r6, r1, 0 + movs r2, 0 + adds r1, r4, 0 + adds r3, r4, 0 + adds r3, 0x58 +_081659F4: + ldrh r0, [r1, 0x34] + cmp r0, 0 + beq _081659FC + adds r2, 0x1 +_081659FC: + adds r1, 0x2C + cmp r1, r3 + ble _081659F4 + cmp r2, 0x3 + beq _08165A14 + adds r0, r6, 0 + movs r1, 0 + movs r2, 0xA4 + bl memset + movs r0, 0 + b _08165AD8 +_08165A14: + ldrb r0, [r4] + strb r0, [r6] + ldrh r0, [r4, 0x2] + strh r0, [r6, 0x2] + movs r2, 0 + ldr r0, =gUnknown_085DCF40 + ldrb r1, [r0, 0x1] + ldrb r3, [r4, 0x1] + mov r12, r0 + adds r5, r6, 0x4 + adds r7, r4, 0x4 + movs r0, 0xC + adds r0, r6 + mov r9, r0 + movs r0, 0xC + adds r0, r4 + mov r8, r0 + adds r0, r6, 0 + adds r0, 0x10 + str r0, [sp] + movs r0, 0x10 + adds r0, r4 + mov r10, r0 + cmp r1, r3 + beq _08165A58 + mov r1, r12 + adds r1, 0x1 +_08165A4A: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x51 + bgt _08165A58 + ldrb r0, [r1] + cmp r0, r3 + bne _08165A4A +_08165A58: + cmp r2, 0x52 + beq _08165A68 + lsls r0, r2, 1 + add r0, r12 + ldrb r0, [r0] + b _08165A6A + .pool +_08165A68: + movs r0, 0x24 +_08165A6A: + strb r0, [r6, 0x1] + movs r2, 0 + adds r3, r7, 0 +_08165A70: + adds r0, r5, r2 + adds r1, r3, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x7 + ble _08165A70 + movs r2, 0 + mov r5, r9 + mov r3, r8 +_08165A84: + adds r0, r5, r2 + adds r1, r3, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x3 + ble _08165A84 + mov r3, r10 + ldr r1, [sp] + movs r2, 0x5 +_08165A98: + ldrh r0, [r3] + strh r0, [r1] + adds r3, 0x2 + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08165A98 + adds r2, r4, 0 + adds r3, r6, 0 + movs r4, 0x58 + adds r4, r2 + mov r8, r4 +_08165AB0: + adds r1, r3, 0 + adds r1, 0x1C + adds r0, r2, 0 + adds r0, 0x34 + ldm r0!, {r4,r5,r7} + stm r1!, {r4,r5,r7} + ldm r0!, {r4,r5,r7} + stm r1!, {r4,r5,r7} + ldm r0!, {r4,r5,r7} + stm r1!, {r4,r5,r7} + ldm r0!, {r5,r7} + stm r1!, {r5,r7} + adds r2, 0x2C + adds r3, 0x2C + cmp r2, r8 + ble _08165AB0 + adds r0, r6, 0 + bl sub_8164F94 + movs r0, 0x1 +_08165AD8: + 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_81659DC + + thumb_func_start sub_8165AE8 +sub_8165AE8: @ 8165AE8 + push {r4,lr} + adds r2, r0, 0 + movs r0, 0 + str r0, [r2, 0x40] + movs r3, 0 + adds r4, r2, 0 +_08165AF4: + ldr r0, [r2, 0x40] + ldm r4!, {r1} + adds r0, r1 + str r0, [r2, 0x40] + adds r3, 0x1 + cmp r3, 0xF + bls _08165AF4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8165AE8 + + thumb_func_start sub_8165B08 +sub_8165B08: @ 8165B08 + push {lr} + movs r1, 0 + movs r3, 0 + adds r2, r0, 0 +_08165B10: + stm r2!, {r3} + adds r1, 0x1 + cmp r1, 0x10 + bls _08165B10 + bl sub_819FA5C + pop {r0} + bx r0 + thumb_func_end sub_8165B08 + + thumb_func_start sub_8165B20 +sub_8165B20: @ 8165B20 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r5, 0 + ldr r0, =0x03005d90 + mov r8, r0 + mov r9, r8 +_08165B30: + lsls r0, r5, 4 + adds r1, r0, r5 + lsls r1, 2 + adds r1, 0xDC + mov r3, r9 + ldr r2, [r3] + movs r4, 0 + movs r3, 0 + adds r6, r0, 0 + adds r7, r5, 0x1 + adds r2, r1 +_08165B46: + ldm r2!, {r0} + adds r4, r0 + adds r3, 0x1 + cmp r3, 0xF + bls _08165B46 + mov r0, r8 + ldr r2, [r0] + adds r0, r6, r5 + lsls r1, r0, 2 + movs r3, 0x8E + lsls r3, 1 + adds r0, r2, r3 + adds r0, r1 + ldr r0, [r0] + cmp r0, r4 + beq _08165B70 + adds r0, r1, 0 + adds r0, 0xDC + adds r0, r2, r0 + bl sub_8165B08 +_08165B70: + adds r5, r7, 0 + cmp r5, 0x3 + ble _08165B30 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8165B20 + + thumb_func_start sub_8165B88 +sub_8165B88: @ 8165B88 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r2, r1, 16 + adds r3, r2, 0 + movs r0, 0xFA + lsls r0, 1 + cmp r2, r0 + bne _08165BA4 + ldr r0, =gUnknown_82E9531 + b _08165C28 + .pool +_08165BA4: + ldr r0, =0x0000012b + cmp r2, r0 + bhi _08165BB8 + ldr r0, =gUnknown_82E9531 + b _08165C28 + .pool +_08165BB8: + ldr r0, =0x0000018f + cmp r2, r0 + bhi _08165BFC + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08165BDC + bl sub_81864B4 + b _08165C2A + .pool +_08165BDC: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0xfffffed4 + adds r2, r1 + movs r1, 0xEC + muls r1, r2 + adds r0, r1 + ldr r1, =0x0000081c + adds r0, r1 + b _08165C28 + .pool +_08165BFC: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + beq _08165C14 + bl sub_81864C0 + b _08165C2A + .pool +_08165C14: + ldr r0, =0x03005d90 + ldr r2, [r0] + ldr r0, =0xfffffe70 + adds r1, r3, r0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, r0 + ldr r1, =0x0000011b + adds r0, r2, r1 +_08165C28: + ldrb r0, [r0] +_08165C2A: + strb r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8165B88 + + thumb_func_start sub_8165C40 +sub_8165C40: @ 8165C40 + push {lr} + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000ca9 + adds r2, r0, r1 + ldrb r1, [r2] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _08165C84 + ldr r1, =0x0203bc88 + ldr r0, =gBattleFrontierTrainers + str r0, [r1] + ldr r1, =0x0203bc8c + ldr r0, =gBattleFrontierMons + str r0, [r1] + ldrb r0, [r2] + lsls r0, 30 + lsrs r0, 30 + bl sub_8165C90 + b _08165C88 + .pool +_08165C84: + bl sub_8165D78 +_08165C88: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8165C40 + + thumb_func_start sub_8165C90 +sub_8165C90: @ 8165C90 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08165C9E + cmp r0, 0x1 + beq _08165CA2 +_08165C9E: + movs r0, 0x32 + b _08165CB0 +_08165CA2: + bl sub_8165CB4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3B + bhi _08165CB0 + movs r0, 0x3C +_08165CB0: + pop {r1} + bx r1 + thumb_func_end sub_8165C90 + + thumb_func_start sub_8165CB4 +sub_8165CB4: @ 8165CB4 + push {r4-r6,lr} + movs r6, 0 + movs r5, 0 +_08165CBA: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _08165CF4 + adds r0, r4, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _08165CF4 + adds r0, r4, 0 + movs r1, 0x38 + movs r2, 0 + bl pokemon_getattr + cmp r0, r6 + ble _08165CF4 + adds r6, r0, 0 +_08165CF4: + adds r5, 0x1 + cmp r5, 0x5 + ble _08165CBA + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8165CB4 + + thumb_func_start sub_8165D08 +sub_8165D08: @ 8165D08 + push {lr} + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + cmp r0, 0x63 + bls _08165D3A + movs r1, 0x6 + cmp r0, 0x77 + bls _08165D3A + movs r1, 0x9 + cmp r0, 0x8B + bls _08165D3A + movs r1, 0xC + cmp r0, 0x9F + bls _08165D3A + movs r1, 0xF + cmp r0, 0xB3 + bls _08165D3A + movs r1, 0x12 + cmp r0, 0xC7 + bls _08165D3A + movs r1, 0x1F + cmp r0, 0xDB + bhi _08165D3A + movs r1, 0x15 +_08165D3A: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_8165D08 + + thumb_func_start sub_8165D40 +sub_8165D40: @ 8165D40 + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + beq _08165D58 + cmp r0, 0x3 + beq _08165D58 + cmp r0, 0x4 + bne _08165D70 +_08165D58: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1E + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + b _08165D72 + .pool +_08165D70: + movs r0, 0 +_08165D72: + pop {r1} + bx r1 + thumb_func_end sub_8165D40 + + thumb_func_start sub_8165D78 +sub_8165D78: @ 8165D78 + push {lr} + ldr r0, =0x000040cf + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4 + bne _08165DA8 + ldr r1, =0x0203bc88 + ldr r0, =gSlateportBattleTentTrainers + str r0, [r1] + ldr r1, =0x0203bc8c + ldr r0, =gSlateportBattleTentMons + b _08165DF2 + .pool +_08165DA8: + cmp r0, 0x2 + bne _08165DC8 + ldr r1, =0x0203bc88 + ldr r0, =gVerdanturfBattleTentTrainers + str r0, [r1] + ldr r1, =0x0203bc8c + ldr r0, =gVerdanturfBattleTentMons + b _08165DF2 + .pool +_08165DC8: + cmp r0, 0x3 + bne _08165DE8 + ldr r1, =0x0203bc88 + ldr r0, =gFallarborBattleTentTrainers + str r0, [r1] + ldr r1, =0x0203bc8c + ldr r0, =gFallarborBattleTentMons + b _08165DF2 + .pool +_08165DE8: + ldr r1, =0x0203bc88 + ldr r0, =gBattleFrontierTrainers + str r0, [r1] + ldr r1, =0x0203bc8c + ldr r0, =gBattleFrontierMons +_08165DF2: + str r0, [r1] + bl sub_8165CB4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1D + bhi _08165E02 + movs r0, 0x1E +_08165E02: + pop {r1} + bx r1 + .pool + thumb_func_end sub_8165D78 + + thumb_func_start sub_8165E18 +sub_8165E18: @ 8165E18 + push {r4,r5,lr} + ldr r5, =0x03005d90 +_08165E1C: + bl sub_8165D40 + 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 _08165E58 + adds r2, 0x2 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, r4 + beq _08165E58 + ldr r0, =0x03005d90 + ldr r1, [r0] + subs r2, 0x2 + adds r0, r1, r2 + ldrh r2, [r0] + ldr r0, =0x00000cb4 + adds r1, r0 +_08165E4A: + adds r1, 0x2 + adds r3, 0x1 + cmp r3, r2 + bge _08165E58 + ldrh r0, [r1] + cmp r0, r4 + bne _08165E4A +_08165E58: + ldr r0, [r5] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + cmp r3, r0 + bne _08165E1C + ldr r5, =0x02038bca + strh r4, [r5] + ldrh r0, [r5] + movs r1, 0 + bl sub_8162614 + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r2, =0x00000cb2 + adds r0, r1, r2 + ldrh r2, [r0] + adds r0, r2, 0x1 + cmp r0, 0x2 + bgt _08165E8C + lsls r0, r2, 1 + ldr r2, =0x00000cb4 + adds r1, r2 + adds r1, r0 + ldrh r0, [r5] + strh r0, [r1] +_08165E8C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8165E18 + + thumb_func_start sub_8165EA4 +sub_8165EA4: @ 8165EA4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x38 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x18] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x1C] + bl sub_8165D78 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x20] + ldr r0, =0x02038bca + ldrh r2, [r0] + ldr r0, =0x0203bc88 + ldr r1, [r0] + movs r0, 0x34 + muls r0, r2 + adds r0, r1 + ldr r0, [r0, 0x30] + str r0, [sp, 0x28] + movs r0, 0 + str r0, [sp, 0x24] + ldr r2, [sp, 0x28] + ldrh r1, [r2] + b _08165EFE + .pool +_08165EEC: + ldr r0, [sp, 0x24] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x24] + lsls r0, 1 + ldr r6, [sp, 0x28] + adds r0, r6 + ldrh r1, [r0] +_08165EFE: + ldr r0, =0x0000ffff + cmp r1, r0 + bne _08165EEC + movs r0, 0 + mov r8, r0 + bl GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + orrs r4, r0 + str r4, [sp, 0x2C] + b _08166092 + .pool +_08165F24: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ldr r1, [sp, 0x24] + bl __modsi3 + lsls r0, 1 + ldr r2, [sp, 0x28] + adds r0, r2 + ldrh r4, [r0] + movs r6, 0 + ldr r7, [sp, 0x18] + add r7, r8 + b _08165F44 +_08165F42: + adds r6, 0x1 +_08165F44: + cmp r6, r7 + bge _08165F68 + movs r1, 0x64 + adds r0, r6, 0 + muls r0, r1 + ldr r2, =0x02024744 + adds r0, r2 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + ldr r1, =0x0203bc8c + ldr r2, [r1] + lsls r1, r4, 4 + adds r1, r2 + ldrh r1, [r1] + cmp r0, r1 + bne _08165F42 +_08165F68: + cmp r6, r7 + beq _08165F6E + b _08166092 +_08165F6E: + movs r6, 0 + cmp r6, r7 + bge _08165FB8 + ldr r0, =gBattleFrontierHeldItems + mov r9, r0 + movs r3, 0 +_08165F7A: + ldr r1, =0x02024744 + adds r5, r3, r1 + adds r0, r5, 0 + movs r1, 0xC + movs r2, 0 + str r3, [sp, 0x34] + bl pokemon_getattr + ldr r3, [sp, 0x34] + cmp r0, 0 + beq _08165FB0 + adds r0, r5, 0 + movs r1, 0xC + movs r2, 0 + bl pokemon_getattr + ldr r1, =0x0203bc8c + ldr r2, [r1] + lsls r1, r4, 4 + adds r1, r2 + ldrb r1, [r1, 0xA] + lsls r1, 1 + add r1, r9 + ldr r3, [sp, 0x34] + ldrh r1, [r1] + cmp r0, r1 + beq _08165FB8 +_08165FB0: + adds r3, 0x64 + adds r6, 0x1 + cmp r6, r7 + blt _08165F7A +_08165FB8: + cmp r6, r7 + bne _08166092 + movs r6, 0 + cmp r6, r8 + bge _08165FDA + add r0, sp, 0xC + ldrh r0, [r0] + cmp r0, r4 + beq _08165FDA + add r1, sp, 0xC +_08165FCC: + adds r1, 0x2 + adds r6, 0x1 + cmp r6, r8 + bge _08165FDA + ldrh r0, [r1] + cmp r0, r4 + bne _08165FCC +_08165FDA: + cmp r6, r8 + bne _08166092 + mov r2, r8 + lsls r0, r2, 1 + add r0, sp + adds r0, 0xC + strh r4, [r0] + movs r6, 0x64 + adds r0, r7, 0 + muls r0, r6 + ldr r1, =0x02024744 + adds r0, r1 + ldr r5, =0x0203bc8c + ldr r2, [r5] + lsls r4, 4 + adds r2, r4, r2 + ldrh r1, [r2] + ldrb r3, [r2, 0xC] + movs r6, 0 + str r6, [sp] + ldrb r2, [r2, 0xB] + str r2, [sp, 0x4] + ldr r2, [sp, 0x2C] + str r2, [sp, 0x8] + ldr r2, [sp, 0x20] + bl sub_8068634 + add r1, sp, 0x14 + movs r0, 0xFF + strb r0, [r1] + mov r9, r4 + mov r0, r8 + adds r0, 0x1 + str r0, [sp, 0x30] + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + mov r8, r1 + adds r3, r5, 0 + mov r5, r9 + ldr r2, =0x02024744 + mov r10, r2 +_0816602E: + ldr r0, [r3] + adds r0, r5, r0 + lsls r4, r6, 1 + adds r0, 0x2 + adds r0, r4 + ldrh r1, [r0] + lsls r2, r6, 24 + lsrs r2, 24 + mov r0, r8 + add r0, r10 + str r3, [sp, 0x34] + bl sub_80691F4 + ldr r3, [sp, 0x34] + ldr r0, [r3] + adds r0, r5, r0 + adds r0, 0x2 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0xDA + bne _0816605E + movs r0, 0 + mov r1, sp + strb r0, [r1, 0x14] +_0816605E: + adds r6, 0x1 + cmp r6, 0x3 + ble _0816602E + movs r2, 0x64 + adds r4, r7, 0 + muls r4, r2 + ldr r6, =0x02024744 + adds r4, r6 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0x14 + bl pokemon_setattr + ldr r0, =0x0203bc8c + ldr r0, [r0] + add r0, r9 + ldrb r2, [r0, 0xA] + lsls r2, 1 + ldr r0, =gBattleFrontierHeldItems + adds r2, r0 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + ldr r0, [sp, 0x30] + mov r8, r0 +_08166092: + ldr r1, [sp, 0x1C] + cmp r8, r1 + beq _0816609A + b _08165F24 +_0816609A: + 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 sub_8165EA4 + + thumb_func_start sub_81660B8 +sub_81660B8: @ 81660B8 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r3, =gUnknown_085DCEDC + ldrb r0, [r3] + cmp r0, r2 + beq _081660DA +_081660C8: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1D + bhi _081660DA + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081660C8 +_081660DA: + cmp r1, 0x1E + beq _081660EC + ldr r0, =gUnknown_085DCF0E + b _08166116 + .pool +_081660EC: + movs r1, 0 + ldr r3, =gUnknown_085DCEFA + ldrb r0, [r3] + cmp r0, r2 + beq _08166108 +_081660F6: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x13 + bhi _08166108 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r2 + bne _081660F6 +_08166108: + cmp r1, 0x14 + bne _08166114 + movs r0, 0x7 + b _0816611A + .pool +_08166114: + ldr r0, =gUnknown_085DCF2C +_08166116: + adds r0, r1, r0 + ldrb r0, [r0] +_0816611A: + pop {r1} + bx r1 + .pool + thumb_func_end sub_81660B8 + + thumb_func_start sub_8166124 +sub_8166124: @ 8166124 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, =0x03005d90 + movs r0, 0xEC + muls r0, r6 + movs r1, 0xE7 + lsls r1, 3 + adds r0, r1 + ldr r1, [r2] + movs r5, 0 + movs r4, 0 + movs r3, 0 + adds r1, r0 +_08166140: + ldm r1!, {r0} + adds r5, r0 + orrs r4, r0 + adds r3, 0x1 + cmp r3, 0x39 + bls _08166140 + cmp r5, 0 + bne _08166154 + cmp r4, 0 + beq _08166180 +_08166154: + ldr r2, [r2] + movs r0, 0xEC + adds r1, r6, 0 + muls r1, r0 + movs r3, 0x82 + lsls r3, 4 + adds r0, r2, r3 + adds r0, r1 + ldr r0, [r0] + cmp r0, r5 + bne _08166174 + movs r0, 0x1 + b _08166182 + .pool +_08166174: + movs r3, 0xE7 + lsls r3, 3 + adds r0, r1, r3 + adds r0, r2, r0 + bl sub_8164FB8 +_08166180: + movs r0, 0 +_08166182: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8166124 + + thumb_func_start sub_8166188 +sub_8166188: @ 8166188 + push {r4-r7,lr} + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x02000002 + ands r0, r1 + cmp r0, 0 + beq _081661E8 + bl sub_8165C40 + lsls r0, 24 + movs r5, 0 + ldr r7, =gBaseStats + lsrs r0, 22 + ldr r1, =gExperienceTables + adds r6, r0, r1 +_081661A6: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x02024744 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + cmp r1, 0 + beq _081661E2 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r7 + ldrb r1, [r0, 0x13] + movs r0, 0xCA + lsls r0, 1 + adds r2, r1, 0 + muls r2, r0 + adds r2, r6 + adds r0, r4, 0 + movs r1, 0x19 + bl pokemon_setattr + adds r0, r4, 0 + bl pokemon_calc_effective_stats +_081661E2: + adds r5, 0x1 + cmp r5, 0x5 + ble _081661A6 +_081661E8: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166188 + + thumb_func_start sub_8166204 +sub_8166204: @ 8166204 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + ldr r4, =0x0203bcac + ldr r0, =0x0000806c + bl AllocZeroed + str r0, [r4] + ldr r1, =0x0203bc90 + ldr r2, =0x00007fd0 + adds r0, r2 + str r0, [r1] + str r5, [r0, 0x8] + str r6, [r0, 0x4] + ldr r0, =sub_8166380 + bl launch_c3_walk_stairs_and_run_once + ldr r0, =sub_816631C + bl SetMainCallback2 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166204 + + thumb_func_start sub_816624C +sub_816624C: @ 816624C + push {r4,r5,lr} + ldr r4, =0x0203bcac + ldr r0, =0x0000806c + bl AllocZeroed + str r0, [r4] + ldr r5, =0x0203bc90 + ldr r1, =0x00007fd0 + adds r0, r1 + str r0, [r5] + ldr r1, =0x0203bc98 + ldr r1, [r1] + str r1, [r0, 0x8] + ldr r1, =0x0203bc94 + ldr r1, [r1] + str r1, [r0, 0x4] + ldr r4, =0x0203bc9c + ldrb r0, [r4] + bl sub_81672E4 + strb r0, [r4] + ldr r5, [r5] + movs r1, 0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _08166284 + movs r1, 0x1 +_08166284: + adds r0, r5, 0 + adds r0, 0x56 + strb r1, [r0] + ldr r0, =sub_8166380 + bl launch_c3_walk_stairs_and_run_once + ldr r0, =sub_81662C0 + bl SetMainCallback2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816624C + + thumb_func_start sub_81662C0 +sub_81662C0: @ 81662C0 + push {r4,lr} + ldr r4, =0x0203bc90 + ldr r0, [r4] + ldr r0, [r0] + bl _call_via_r0 + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + ldr r4, [r4] + ldr r1, [r4] + ldr r0, =map_warp_consider_1_to_outside_or_stair_or_dive + cmp r1, r0 + bne _081662F0 + adds r0, r4, 0 + adds r0, 0x50 + movs r1, 0 + strb r1, [r0] + ldr r0, =sub_8166304 + bl SetMainCallback2 +_081662F0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81662C0 + + thumb_func_start sub_8166304 +sub_8166304: @ 8166304 + push {lr} + bl sub_81668F8 + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_8166304 + + thumb_func_start sub_816631C +sub_816631C: @ 816631C + push {lr} + ldr r0, =0x0203bc90 + ldr r0, [r0] + ldr r0, [r0] + bl _call_via_r0 + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + pop {r0} + bx r0 + .pool + thumb_func_end sub_816631C + + thumb_func_start sub_8166340 +sub_8166340: @ 8166340 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r1, =0x00007c58 + adds r0, r1 + bl sub_81D2108 + bl sub_80BA0A8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166340 + + thumb_func_start launch_c3_walk_stairs_and_run_once +launch_c3_walk_stairs_and_run_once: @ 816636C + ldr r1, =0x0203bc90 + ldr r1, [r1] + str r0, [r1] + adds r1, 0x50 + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end launch_c3_walk_stairs_and_run_once + + thumb_func_start sub_8166380 +sub_8166380: @ 8166380 + push {r4,r5,lr} + sub sp, 0x4 + ldr r1, =0x0203bc90 + ldr r0, [r1] + adds r0, 0x50 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0xF + bls _08166394 + b _08166556 +_08166394: + lsls r0, 2 + ldr r1, =_081663A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081663A8: + .4byte _081663E8 + .4byte _0816640C + .4byte _08166416 + .4byte _08166434 + .4byte _08166464 + .4byte _08166468 + .4byte _08166474 + .4byte _08166484 + .4byte _08166490 + .4byte _0816649C + .4byte _081664B8 + .4byte _081664BC + .4byte _081664E4 + .4byte _08166510 + .4byte _08166528 + .4byte _08166550 +_081663E8: + ldr r2, =0x0203bcac + ldr r0, [r2] + ldr r1, =0x00007b10 + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r2] + ldr r2, =0x00007c58 + adds r0, r2 + bl sub_81D1ED4 + b _0816653C + .pool +_0816640C: + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + b _0816653C +_08166416: + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + str r0, [sp] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + mov r0, sp + bl CpuSet + b _0816653C + .pool +_08166434: + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085DFCCC + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r0, =gUnknown_085DFCDC + bl InitWindows + bl DeactivateAllTextPrinters + movs r0, 0 + movs r1, 0x97 + movs r2, 0xE0 + bl sub_809882C + b _0816653C + .pool +_08166464: + ldr r1, [r2] + b _08166540 +_08166468: + bl sub_8168328 + lsls r0, 24 + cmp r0, 0 + bne _08166556 + b _0816653C +_08166474: + ldr r1, =0x030022b0 + movs r0, 0x14 + strh r0, [r1] + bl sub_8167420 + b _0816653C + .pool +_08166484: + bl sub_8167930 + lsls r0, 24 + cmp r0, 0 + bne _08166556 + b _0816653C +_08166490: + movs r0, 0 + bl sub_8167608 + bl sub_8167760 + b _0816653C +_0816649C: + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r1, =0x00007b0e + adds r0, r1 + bl sub_81D312C + lsls r0, 24 + cmp r0, 0 + bne _08166556 + b _0816653C + .pool +_081664B8: + ldr r1, [r2] + b _08166540 +_081664BC: + ldr r5, =0x0203bcac + ldr r1, [r5] + ldr r4, =0x00007c58 + adds r0, r1, r4 + ldr r2, =0x00007c6c + adds r1, r2 + bl sub_81D2754 + ldr r0, [r5] + adds r0, r4 + bl sub_81D20AC + b _0816653C + .pool +_081664E4: + ldr r4, =0x0203bcac + ldr r0, [r4] + ldr r1, =0x00007c58 + adds r0, r1 + bl sub_81D20BC + lsls r0, 24 + cmp r0, 0 + bne _08166556 + ldr r2, [r4] + ldr r1, =0x00007c58 + adds r0, r2, r1 + adds r1, 0x14 + adds r2, r1 + adds r1, r2, 0 + bl sub_81D1F84 + b _0816653C + .pool +_08166510: + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r2, =0x00007c58 + adds r0, r2 + bl sub_81D2230 + b _0816653C + .pool +_08166528: + movs r0, 0 + bl PutWindowTilemap + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x1 + bl sub_8167BA0 +_0816653C: + ldr r0, =0x0203bc90 + ldr r1, [r0] +_08166540: + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08166556 + .pool +_08166550: + ldr r0, =map_warp_consider_1_to_outside_or_stair_or_dive + bl launch_c3_walk_stairs_and_run_once +_08166556: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166380 + + thumb_func_start map_warp_consider_1_to_outside_or_stair_or_dive +map_warp_consider_1_to_outside_or_stair_or_dive: @ 8166564 + push {r4,lr} + sub sp, 0x4 + ldr r4, =0x0203bc90 + ldr r0, [r4] + adds r0, 0x50 + ldrb r1, [r0] + cmp r1, 0 + beq _08166580 + cmp r1, 0x1 + beq _081665C0 + b _08166610 + .pool +_08166580: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =sub_8166340 + bl SetVBlankCallback + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x3 + bl ShowBg + movs r0, 0x2 + bl ShowBg + ldr r1, [r4] + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08166610 + .pool +_081665C0: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08166610 + ldr r4, =0x0203bcac + ldr r0, [r4] + ldr r1, =0x00007b1c + adds r0, r1 + bl sub_81D3464 + ldr r4, [r4] + ldr r2, =0x00008041 + adds r0, r4, r2 + ldrb r1, [r0] + ldr r3, =0x00008040 + adds r0, r4, r3 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _0816660A + ldr r1, =0x00007fb3 + adds r0, r4, r1 + movs r1, 0 + ldrsb r1, [r0, r1] + subs r2, 0x91 + adds r0, r4, r2 + adds r0, r1 + ldrb r2, [r0] + ldr r3, =0x00007b1c + adds r0, r4, r3 + subs r3, 0xC + adds r1, r4, r3 + ldrb r1, [r1] + bl sub_81D3480 +_0816660A: + ldr r0, =sub_8166634 + bl launch_c3_walk_stairs_and_run_once +_08166610: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end map_warp_consider_1_to_outside_or_stair_or_dive + + thumb_func_start sub_8166634 +sub_8166634: @ 8166634 + push {lr} + ldr r0, =0x0203bc90 + ldr r0, [r0] + adds r0, 0x50 + ldrb r0, [r0] + cmp r0, 0x7 + bls _08166644 + b _0816680E +_08166644: + lsls r0, 2 + ldr r1, =_08166658 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08166658: + .4byte _08166678 + .4byte _0816675C + .4byte _0816680E + .4byte _08166788 + .4byte _0816680E + .4byte _08166794 + .4byte _081667AC + .4byte _081667F4 +_08166678: + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2C] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081666B8 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + bl sub_8167CA0 + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r1, =0x00007b1c + adds r0, r1 + bl sub_81D3520 + ldr r0, =0x0203bc90 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x1 + b _0816680C + .pool +_081666B8: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081666F0 + movs r0, 0x5 + bl audio_play + movs r0, 0 + bl sub_8167CA0 + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r2, =0x00007b1c + adds r0, r2 + bl sub_81D3520 + ldr r0, =0x0203bc90 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x1 + b _0816680C + .pool +_081666F0: + ldrh r1, [r2, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08166710 + movs r0, 0x5 + bl audio_play + ldr r0, =0x0203bc90 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x3 + b _0816680C + .pool +_08166710: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0816671A + b _0816680E +_0816671A: + movs r0, 0x5 + bl audio_play + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r2, =0x00008041 + adds r1, r0, r2 + ldrb r1, [r1] + subs r2, 0x1 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _0816674C + ldr r0, =0x0203bc90 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x3 + b _0816680C + .pool +_0816674C: + ldr r0, =0x0203bc90 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x5 + b _0816680C + .pool +_0816675C: + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r1, =0x00008044 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0816680E + ldr r0, =0x0203bc90 + ldr r0, [r0] + adds r0, 0x50 + b _0816680C + .pool +_08166788: + ldr r0, =sub_8166BEC + bl launch_c3_walk_stairs_and_run_once + b _0816680E + .pool +_08166794: + bl sub_8166D44 + ldr r0, =0x0203bc90 + ldr r1, [r0] + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0816680E + .pool +_081667AC: + bl sub_8166DE4 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _081667CC + cmp r1, 0 + bgt _081667C6 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08166804 + b _0816680E +_081667C6: + cmp r1, 0x1 + bne _0816680E + b _08166804 +_081667CC: + bl sub_8167268 + lsls r0, 24 + cmp r0, 0 + beq _081667E8 + bl sub_8166F50 + ldr r0, =0x0203bc90 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0x7 + b _0816680C + .pool +_081667E8: + ldr r0, =sub_816681C + bl launch_c3_walk_stairs_and_run_once + b _0816680E + .pool +_081667F4: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0816680E + bl sub_8166F94 +_08166804: + ldr r0, =0x0203bc90 + ldr r0, [r0] + adds r0, 0x50 + movs r1, 0 +_0816680C: + strb r1, [r0] +_0816680E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166634 + + thumb_func_start sub_816681C +sub_816681C: @ 816681C + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, =0x0203bc90 + ldr r0, [r5] + adds r0, 0x50 + ldrb r4, [r0] + cmp r4, 0 + beq _08166838 + cmp r4, 0x1 + beq _08166888 + b _081668D4 + .pool +_08166838: + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r1, =0x00008041 + adds r0, r1 + ldrb r0, [r0] + bl sub_81672A4 + ldr r1, =0x0203bc9c + strb r0, [r1] + ldr r1, =0x0203bc94 + ldr r2, [r5] + ldr r0, [r2, 0x4] + str r0, [r1] + ldr r1, =0x0203bc98 + ldr r0, [r2, 0x8] + str r0, [r1] + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, [r5] + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _081668D4 + .pool +_08166888: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081668D4 + movs r0, 0 + bl SetVBlankCallback + ldr r4, =0x0203bca0 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203bca4 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203bca8 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203bcac + ldr r0, [r4] + bl Free + str r5, [r4] + bl FreeAllWindowBuffers + ldr r1, =0x030022c0 + ldr r0, =sub_816624C + str r0, [r1, 0x8] + bl sub_8179D70 +_081668D4: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816681C + + thumb_func_start sub_81668F8 +sub_81668F8: @ 81668F8 + push {r4,lr} + sub sp, 0x4 + ldr r1, =0x0203bc90 + ldr r0, [r1] + adds r0, 0x50 + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0x6 + bls _0816690C + b _08166A18 +_0816690C: + lsls r0, 2 + ldr r1, =_08166920 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08166920: + .4byte _0816693C + .4byte _08166972 + .4byte _08166A18 + .4byte _081669A0 + .4byte _081669AE + .4byte _081669C8 + .4byte _081669F4 +_0816693C: + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r1, =0x00008041 + adds r0, r1 + ldr r1, =0x0203bc9c + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + beq _08166968 + ldr r0, [r4] + adds r0, 0x56 + ldrb r0, [r0] + bl sub_8167CA0 + ldr r1, [r4] + b _081669E2 + .pool +_08166968: + ldr r0, [r4] + adds r0, 0x50 + movs r1, 0x3 + strb r1, [r0] + b _08166A18 +_08166972: + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r1, =0x00008044 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08166A18 + ldr r0, =0x0203bc90 + ldr r0, [r0] + adds r0, 0x50 + strb r1, [r0] + b _08166A18 + .pool +_081669A0: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + b _081669DE +_081669AE: + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x3 + bl ShowBg + movs r0, 0x2 + bl ShowBg + b _081669DE +_081669C8: + ldr r0, =sub_8166340 + bl SetVBlankCallback + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe +_081669DE: + ldr r0, =0x0203bc90 + ldr r1, [r0] +_081669E2: + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08166A18 + .pool +_081669F4: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08166A18 + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r1, =0x00007b1c + adds r0, r1 + bl sub_81D3464 + ldr r0, =sub_8166A34 + bl launch_c3_walk_stairs_and_run_once + ldr r0, =sub_816631C + bl SetMainCallback2 +_08166A18: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81668F8 + + thumb_func_start sub_8166A34 +sub_8166A34: @ 8166A34 + push {r4-r6,lr} + ldr r1, =0x0203bc90 + ldr r0, [r1] + adds r0, 0x50 + ldrb r0, [r0] + adds r5, r1, 0 + cmp r0, 0x5 + bls _08166A46 + b _08166BDA +_08166A46: + lsls r0, 2 + ldr r1, =_08166A58 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08166A58: + .4byte _08166A70 + .4byte _08166AAC + .4byte _08166AC0 + .4byte _08166B14 + .4byte _08166B94 + .4byte _08166BB6 +_08166A70: + ldr r4, [r5] + ldr r3, =0x020244ec + str r3, [r4, 0xC] + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r2, =0x00008041 + adds r1, r0, r2 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0, r1 + subs r2, 0x88 + adds r1, r2 + ldrb r2, [r1] + movs r1, 0x64 + muls r1, r2 + adds r1, r3 + str r1, [r4, 0xC] + ldr r3, =0x00007b1c + adds r0, r3 + bl sub_81D3520 + b _08166BAA + .pool +_08166AAC: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08166ABA + b _08166BDA +_08166ABA: + b _08166BAA + .pool +_08166AC0: + bl sub_8167104 + ldr r6, =0x0203bc90 + ldr r0, [r6] + adds r0, 0x5C + ldr r4, =0x0203bcac + ldr r1, [r4] + ldr r5, =0x00007ca8 + adds r1, r5 + bl sub_81D2754 + ldr r2, [r4] + ldr r4, =0x00007c58 + adds r0, r2, r4 + ldr r3, =0x00007fb3 + adds r1, r2, r3 + movs r3, 0 + ldrsb r3, [r1, r3] + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 2 + adds r4, 0x14 + adds r1, r4 + adds r1, r2, r1 + adds r2, r5 + bl sub_81D1F84 + bl sub_8167338 + ldr r1, [r6] + b _08166BAC + .pool +_08166B14: + ldr r5, =0x0203bcac + ldr r0, [r5] + ldr r1, =0x00007c58 + adds r0, r1 + bl sub_81D2074 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _08166BDA + ldr r0, [r5] + ldr r4, =0x00008041 + adds r0, r4 + ldrb r0, [r0] + bl sub_81672A4 + lsls r0, 24 + lsrs r0, 24 + bl sub_81681F4 + ldr r3, [r5] + adds r4, r3, r4 + ldrb r1, [r4] + ldr r2, =0x00008040 + adds r0, r3, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _08166B6C + ldr r4, =0x00007fb3 + adds r0, r3, r4 + movs r1, 0 + ldrsb r1, [r0, r1] + subs r2, 0x90 + adds r0, r3, r2 + adds r0, r1 + ldrb r2, [r0] + ldr r4, =0x00007b1c + adds r0, r3, r4 + subs r4, 0xC + adds r1, r3, r4 + ldrb r1, [r1] + bl sub_81D3480 +_08166B6C: + ldr r1, =0x0203bc90 + ldr r0, [r1] + adds r0, 0x52 + strb r6, [r0] + ldr r1, [r1] + b _08166BAC + .pool +_08166B94: + ldr r1, [r5] + adds r1, 0x52 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + bls _08166BDA + bl sub_8166E24 +_08166BAA: + ldr r1, [r5] +_08166BAC: + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08166BDA +_08166BB6: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08166BDA + bl sub_8166EDC + lsls r0, 24 + cmp r0, 0 + bne _08166BDA + ldr r0, =0x0203ce7c + ldrb r0, [r0] + bl sub_8136F68 + ldr r0, =sub_8166BEC + bl launch_c3_walk_stairs_and_run_once +_08166BDA: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166A34 + + thumb_func_start sub_8166BEC +sub_8166BEC: @ 8166BEC + push {r4-r6,lr} + sub sp, 0x4 + ldr r4, =0x0203bc90 + ldr r0, [r4] + adds r2, r0, 0 + adds r2, 0x50 + ldrb r1, [r2] + cmp r1, 0x1 + beq _08166C28 + cmp r1, 0x1 + bgt _08166C0C + cmp r1, 0 + beq _08166C16 + b _08166D18 + .pool +_08166C0C: + cmp r1, 0x2 + beq _08166C40 + cmp r1, 0x3 + beq _08166C5C + b _08166D18 +_08166C16: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _08166C4A +_08166C28: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08166D18 + movs r0, 0x2 + strb r0, [r2] + b _08166D18 + .pool +_08166C40: + ldr r1, =0x02039b28 + movs r0, 0x3 + strb r0, [r1, 0x15] + bl sub_80BA0A8 +_08166C4A: + ldr r1, [r4] + adds r1, 0x50 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08166D18 + .pool +_08166C5C: + ldr r0, [r0, 0x4] + bl SetMainCallback2 + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r1, =0x00007b1c + adds r0, r1 + bl sub_81D354C + movs r4, 0 +_08166C70: + ldr r5, =0x0203bcac + ldr r0, [r5] + ldr r2, =0x00007b06 + adds r0, r2 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _08166C70 + movs r0, 0 + bl FreeObjectTilesByTag + movs r0, 0x1 + bl FreeObjectTilesByTag + movs r0, 0 + bl FreeObjectPaletteByTag + movs r0, 0x1 + bl FreeObjectPaletteByTag + movs r4, 0 +_08166CAE: + ldr r0, [r5] + lsls r1, r4, 2 + ldr r2, =0x00007b44 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + bl RemoveObjectAndFreeTiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _08166CAE + ldr r6, =0x0203bcac + ldr r0, [r6] + ldr r2, =0x00007b10 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _08166CE6 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles +_08166CE6: + movs r0, 0 + bl SetVBlankCallback + ldr r4, =0x0203bca0 + ldr r0, [r4] + bl Free + movs r5, 0 + str r5, [r4] + ldr r4, =0x0203bca4 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203bca8 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r0, [r6] + bl Free + str r5, [r6] + bl FreeAllWindowBuffers +_08166D18: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166BEC + + thumb_func_start sub_8166D44 +sub_8166D44: @ 8166D44 + push {r4,lr} + sub sp, 0x4C + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r1, =0x00008041 + adds r0, r1 + ldrb r0, [r0] + bl sub_81672A4 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + add r2, sp, 0xC + bl pokemon_getattr + add r0, sp, 0xC + bl GetStringEnd_Limit7 + ldr r1, =gUnknown_085EC7A0 + add r0, sp, 0xC + bl AppendString + ldr r4, =0x02021fc4 + adds r0, r4, 0 + add r1, sp, 0xC + bl CopyString + movs r0, 0x2 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0x2 + movs r1, 0x97 + movs r2, 0xE + bl sub_8098858 + movs r0, 0x1 + 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, 0 + bl Print + movs r0, 0x2 + bl PutWindowTilemap + movs r0, 0x2 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =gUnknown_085DFCFC + movs r1, 0x97 + movs r2, 0xE + movs r3, 0 + bl CreateYesNoMenu + add sp, 0x4C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166D44 + + thumb_func_start sub_8166DE4 +sub_8166DE4: @ 8166DE4 + push {r4,lr} + bl sub_8198C58 + lsls r0, 24 + lsrs r4, r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _08166E18 + cmp r1, 0 + bgt _08166E02 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08166E06 + b _08166E18 +_08166E02: + cmp r1, 0x1 + bne _08166E18 +_08166E06: + movs r0, 0x5 + bl audio_play + movs r0, 0x2 + bl rbox_fill_rectangle + movs r0, 0x2 + bl ClearWindowTilemap +_08166E18: + lsls r0, r4, 24 + asrs r0, 24 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8166DE4 + + thumb_func_start sub_8166E24 +sub_8166E24: @ 8166E24 + push {r4,lr} + movs r0, 0x2 + movs r1, 0x97 + movs r2, 0xE + bl sub_8098858 + movs r0, 0x2 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r3, =0x0203bc90 + ldr r0, [r3] + adds r0, 0x53 + movs r1, 0 + strb r1, [r0] + ldr r2, [r3] + adds r1, r2, 0 + adds r1, 0x53 + ldrb r0, [r1] + cmp r0, 0x4 + bhi _08166EA8 + adds r0, r2, 0 + adds r0, 0x61 + ldrb r1, [r1] + adds r0, r1 + ldrb r0, [r0] + adds r4, r3, 0 + cmp r0, 0 + bne _08166E84 + adds r2, r4, 0 +_08166E60: + ldr r0, [r2] + adds r0, 0x53 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r3, [r2] + adds r1, r3, 0 + adds r1, 0x53 + ldrb r0, [r1] + cmp r0, 0x4 + bhi _08166EA8 + adds r0, r3, 0 + adds r0, 0x61 + ldrb r1, [r1] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08166E60 +_08166E84: + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0x53 + ldrb r0, [r1] + cmp r0, 0x4 + bhi _08166EA8 + ldr r0, =0x02021fc4 + ldrb r1, [r1] + adds r2, 0x61 + adds r2, r1 + ldrb r2, [r2] + bl sub_8166FD4 + b _08166EB8 + .pool +_08166EA8: + ldr r0, =0x02021fc4 + ldr r1, =0x0203bc90 + ldr r1, [r1] + adds r1, 0x53 + ldrb r1, [r1] + movs r2, 0 + bl sub_8166FD4 +_08166EB8: + ldr r0, =0x02021fc4 + bl sub_8166FB0 + movs r0, 0x2 + bl PutWindowTilemap + movs r0, 0x2 + movs r1, 0x3 + bl CopyWindowToVram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166E24 + + thumb_func_start sub_8166EDC +sub_8166EDC: @ 8166EDC + push {r4,r5,lr} + movs r0, 0x2 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r5, =0x0203bc90 + adds r3, r5, 0 + movs r4, 0x5 +_08166EEC: + ldr r0, [r3] + adds r0, 0x53 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r2, [r3] + adds r1, r2, 0 + adds r1, 0x53 + ldrb r0, [r1] + cmp r0, 0x4 + bhi _08166F18 + adds r0, r2, 0 + adds r0, 0x61 + ldrb r1, [r1] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08166F1E + b _08166EEC + .pool +_08166F18: + strb r4, [r1] + movs r0, 0 + b _08166F44 +_08166F1E: + ldr r4, =0x02021fc4 + ldr r0, [r5] + adds r1, r0, 0 + adds r1, 0x53 + ldrb r1, [r1] + adds r0, 0x61 + adds r0, r1 + ldrb r2, [r0] + adds r0, r4, 0 + bl sub_8166FD4 + adds r0, r4, 0 + bl sub_8166FB0 + movs r0, 0x2 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x1 +_08166F44: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8166EDC + + thumb_func_start sub_8166F50 +sub_8166F50: @ 8166F50 + push {lr} + sub sp, 0xC + movs r0, 0x2 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0x2 + movs r1, 0x97 + movs r2, 0xE + bl sub_8098858 + ldr r2, =gUnknown_085EC800 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0x2 + bl PutWindowTilemap + movs r0, 0x2 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166F50 + + thumb_func_start sub_8166F94 +sub_8166F94: @ 8166F94 + push {lr} + movs r0, 0x2 + bl rbox_fill_rectangle + movs r0, 0x2 + bl ClearWindowTilemap + movs r0, 0x2 + movs r1, 0x3 + bl CopyWindowToVram + pop {r0} + bx r0 + thumb_func_end sub_8166F94 + + thumb_func_start sub_8166FB0 +sub_8166FB0: @ 8166FB0 + push {lr} + sub sp, 0xC + ldr r2, =0x02021fc4 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r3, 0 + bl Print + add sp, 0xC + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166FB0 + + thumb_func_start sub_8166FD4 +sub_8166FD4: @ 8166FD4 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r2, 16 + lsrs r0, r2, 16 + asrs r2, 16 + cmp r2, 0 + beq _08167010 + cmp r2, 0 + ble _08166FEC + movs r0, 0 +_08166FEC: + lsls r0, 16 + ldr r1, =gUnknown_085DFD04 + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl CopyString + ldr r1, =gUnknown_085EC7E1 + adds r0, r4, 0 + bl AppendString + b _08167018 + .pool +_08167010: + ldr r1, =gUnknown_085EC7EF + adds r0, r4, 0 + bl CopyString +_08167018: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8166FD4 + + thumb_func_start sub_8167024 +sub_8167024: @ 8167024 + push {r4-r7,lr} + adds r6, r0, 0 + adds r5, r1, 0 + movs r4, 0 + ldr r7, =gUnknown_085DFCB0 +_0816702E: + lsls r0, r4, 2 + adds r0, r7 + ldr r1, [r0] + adds r0, r6, 0 + bl pokemon_getattr + adds r1, r5, r4 + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _0816702E + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167024 + + thumb_func_start sub_8167054 +sub_8167054: @ 8167054 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + mov r8, r0 + adds r5, r1, 0 + adds r0, r5, 0 + movs r1, 0x30 + bl pokemon_getattr + cmp r0, 0xFF + beq _081670F0 + mov r0, r8 + adds r1, r5, 0 + bl sub_8167184 + movs r4, 0 + mov r7, sp +_08167078: + ldr r1, =gUnknown_085DFCB0 + lsls r0, r4, 2 + adds r0, r1 + ldr r6, [r0] + adds r0, r5, 0 + adds r1, r6, 0 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + strb r0, [r7] + ldr r1, =0x0203bc90 + ldr r1, [r1] + lsls r2, r4, 1 + adds r1, 0x66 + adds r1, r2 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r0, 0 + bge _081670A6 + movs r1, 0 +_081670A6: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _081670B0 + movs r1, 0xFF +_081670B0: + strb r1, [r7] + adds r0, r5, 0 + adds r1, r6, 0 + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _08167078 + adds r0, r5, 0 + movs r1, 0x30 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + mov r2, r8 + ldrb r2, [r2, 0x6] + adds r1, r0, r2 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _081670E2 + movs r1, 0xFF +_081670E2: + mov r0, sp + strb r1, [r0] + adds r0, r5, 0 + movs r1, 0x30 + mov r2, sp + bl pokemon_setattr +_081670F0: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167054 + + thumb_func_start sub_8167104 +sub_8167104: @ 8167104 + push {r4,r5,lr} + ldr r5, =0x020244ec + ldr r0, =0x0203bcac + ldr r1, [r0] + ldr r2, =0x00008041 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r1, r0 + ldr r0, =0x00007fb9 + adds r1, r0 + ldrb r1, [r1] + movs r0, 0x64 + muls r0, r1 + adds r5, r0, r5 + ldr r4, =0x0203bc90 + ldr r1, [r4] + adds r1, 0x57 + adds r0, r5, 0 + bl sub_8167024 + ldr r0, [r4] + ldr r0, [r0, 0x8] + adds r1, r5, 0 + bl sub_8167054 + ldr r1, [r4] + adds r1, 0x5C + adds r0, r5, 0 + bl sub_8167024 + movs r3, 0 +_08167144: + ldr r0, [r4] + adds r2, r0, 0 + adds r2, 0x61 + adds r2, r3 + adds r1, r0, 0 + adds r1, 0x5C + adds r1, r3 + adds r0, 0x57 + adds r0, r3 + ldrb r1, [r1] + ldrb r0, [r0] + subs r1, r0 + strb r1, [r2] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x4 + bls _08167144 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167104 + + thumb_func_start sub_8167184 +sub_8167184: @ 8167184 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r1 + ldr r1, =0x0203bc90 + ldr r3, [r1] + ldrb r1, [r0, 0x1] + adds r2, r3, 0 + adds r2, 0x66 + strh r1, [r2] + ldrb r2, [r0, 0x5] + adds r1, r3, 0 + adds r1, 0x68 + strh r2, [r1] + ldrb r1, [r0, 0x4] + adds r2, r3, 0 + adds r2, 0x6A + strh r1, [r2] + ldrb r2, [r0, 0x3] + adds r1, r3, 0 + adds r1, 0x6C + strh r2, [r1] + ldrb r1, [r0, 0x2] + adds r0, r3, 0 + adds r0, 0x6E + strh r1, [r0] + ldr r0, =0x0203bc9e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + ble _081671D4 + movs r0, 0x1 + b _081671DA + .pool +_081671D4: + cmp r0, 0 + bge _08167250 + movs r0, 0xFF +_081671DA: + movs r2, 0 + lsls r0, 24 + mov r9, r0 + ldr r0, =0x0203bc90 + mov r8, r0 +_081671E4: + mov r0, r8 + ldr r1, [r0] + lsls r0, r2, 24 + asrs r6, r0, 24 + lsls r7, r6, 1 + adds r1, 0x66 + adds r1, r7 + movs r2, 0 + ldrsh r4, [r1, r2] + adds r0, r4, 0 + movs r1, 0xA + bl __divsi3 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + movs r1, 0xA + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0816721C + lsls r0, r5, 24 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r5, r0, 24 +_0816721C: + ldr r0, =gUnknown_085DFCC4 + adds r0, r6, r0 + ldrb r1, [r0] + mov r0, r10 + bl sub_806E858 + lsls r0, 24 + asrs r2, r0, 24 + cmp r0, r9 + bne _08167244 + mov r1, r8 + ldr r0, [r1] + adds r0, 0x66 + adds r0, r7 + lsls r1, r5, 24 + asrs r1, 24 + muls r1, r2 + ldrh r2, [r0] + adds r1, r2 + strh r1, [r0] +_08167244: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + asrs r0, 24 + cmp r0, 0x4 + ble _081671E4 +_08167250: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167184 + + thumb_func_start sub_8167268 +sub_8167268: @ 8167268 + push {lr} + ldr r0, =0x0203bcac + ldr r1, [r0] + ldr r2, =0x00008041 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r1, r0 + subs r2, 0x89 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + movs r2, 0x30 + movs r3, 0 + bl sub_81D2C68 + cmp r0, 0xFF + beq _0816729C + movs r0, 0 + b _0816729E + .pool +_0816729C: + movs r0, 0x1 +_0816729E: + pop {r1} + bx r1 + thumb_func_end sub_8167268 + + thumb_func_start sub_81672A4 +sub_81672A4: @ 81672A4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 +_081672AC: + movs r0, 0x64 + muls r0, r4 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _081672D2 + cmp r5, 0 + bne _081672CC + adds r0, r4, 0 + b _081672DE + .pool +_081672CC: + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_081672D2: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _081672AC + movs r0, 0 +_081672DE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81672A4 + + thumb_func_start sub_81672E4 +sub_81672E4: @ 81672E4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + movs r6, 0 + cmp r6, r5 + bcs _08167314 +_081672F2: + movs r0, 0x64 + muls r0, r4 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + beq _0816730A + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0816730A: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r5 + bcc _081672F2 +_08167314: + subs r0, r5, r6 + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81672E4 + + thumb_func_start sub_8167324 +sub_8167324: @ 8167324 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_81672A4 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8167324 + + thumb_func_start sub_8167338 +sub_8167338: @ 8167338 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =gUnknown_085DFD18 + bl LoadObjectPic + ldr r0, =gUnknown_085DFD20 + bl LoadTaggedObjectPalette + ldr r2, =0x0203bc90 + ldr r0, [r2] + adds r0, 0x54 + movs r1, 0 + strb r1, [r0] + movs r4, 0 + adds r5, r2, 0 + ldr r6, =gUnknown_085DFD28 + adds r0, r6, 0x2 + mov r8, r0 + ldr r7, =0x0202064c +_08167360: + ldr r0, [r5] + adds r0, 0x61 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _081673AC + lsls r2, r4, 2 + adds r0, r2, r6 + movs r3, 0 + ldrsh r1, [r0, r3] + add r2, r8 + movs r0, 0 + ldrsh r2, [r2, r0] + ldr r0, =gUnknown_085DFD5C + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _081673AC + ldr r0, [r5] + adds r0, 0x61 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _081673A2 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, =sub_81673DC + str r1, [r0] +_081673A2: + ldr r1, [r5] + adds r1, 0x54 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081673AC: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _08167360 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167338 + + thumb_func_start sub_81673DC +sub_81673DC: @ 81673DC + push {lr} + adds r1, r0, 0 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0x5 + bgt _081673EE + ldrh r0, [r1, 0x26] + subs r0, 0x2 + b _081673F6 +_081673EE: + cmp r0, 0xB + bgt _081673F8 + ldrh r0, [r1, 0x26] + adds r0, 0x2 +_081673F6: + strh r0, [r1, 0x26] +_081673F8: + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + ble _08167418 + adds r0, r1, 0 + bl RemoveObjectAndFreeTiles + ldr r0, =0x0203bc90 + ldr r1, [r0] + adds r1, 0x54 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_08167418: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81673DC + + thumb_func_start sub_8167420 +sub_8167420: @ 8167420 + push {r4-r6,lr} + movs r4, 0 + movs r5, 0 + ldr r6, =0x0203bcac + b _08167472 + .pool +_08167430: + movs r0, 0x64 + muls r0, r4 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2D + bl pokemon_getattr + adds r3, r0, 0 + cmp r3, 0 + bne _0816746C + ldr r1, [r6] + lsls r2, r5, 2 + adds r1, r2 + ldr r0, =0x00007fb8 + adds r1, r0 + movs r0, 0xE + strb r0, [r1] + ldr r0, [r6] + adds r0, r2 + ldr r1, =0x00007fb9 + adds r0, r1 + strb r4, [r0] + ldr r0, [r6] + adds r0, r2 + ldr r2, =0x00007fba + adds r0, r2 + strh r3, [r0] + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_0816746C: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_08167472: + bl calc_player_party_count + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcc _08167430 + ldr r2, =0x0203bcac + ldr r0, [r2] + ldr r1, =0x00008041 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r1, r5, 0x1 + ldr r2, =0x00008040 + adds r0, r2 + strb r1, [r0] + bl sub_81674BC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167420 + + thumb_func_start sub_81674BC +sub_81674BC: @ 81674BC + push {r4,r5,lr} + ldr r4, =0x0203bcac + ldr r0, [r4] + ldr r5, =0x00008041 + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl sub_816753C + ldr r0, [r4] + ldr r1, =0x00007fb3 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + ldr r2, =0x00007fb4 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r4] + ldr r1, =0x00007fb5 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r4] + adds r5, r0, r5 + ldrb r3, [r5] + adds r1, r3, 0x1 + adds r2, 0x8C + adds r0, r2 + ldrb r2, [r0] + cmp r1, r2 + blt _08167500 + movs r1, 0 +_08167500: + subs r0, r3, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r0, 0 + bge _08167510 + subs r0, r2, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_08167510: + adds r0, r1, 0 + movs r1, 0x1 + bl sub_816753C + lsls r0, r4, 16 + asrs r0, 16 + movs r1, 0x2 + bl sub_816753C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81674BC + + thumb_func_start sub_816753C +sub_816753C: @ 816753C + 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, r1, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x0203bcac + mov r9, r0 + ldr r1, [r0] + lsls r5, 16 + asrs r0, r5, 14 + adds r0, r1, r0 + ldr r3, =0x00007fb8 + adds r2, r0, r3 + ldrb r7, [r2] + ldr r2, =0x00007fb9 + adds r0, r2 + ldrb r0, [r0] + mov r10, r0 + adds r3, 0x88 + adds r0, r1, r3 + ldrb r6, [r0] + movs r0, 0 + mov r8, r0 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + ldr r2, =0x00007b4d + adds r0, r2 + adds r0, r1, r0 + lsls r2, r4, 6 + ldr r3, =0x00007b95 + adds r2, r3 + adds r1, r2 + lsrs r5, 16 + str r5, [sp] + str r6, [sp, 0x4] + mov r2, r8 + str r2, [sp, 0x8] + adds r2, r7, 0 + mov r3, r10 + bl sub_81D2ED4 + mov r3, r9 + ldr r1, [r3] + ldr r2, =0x00007c58 + adds r0, r1, r2 + ldr r3, =0x00007fb0 + adds r1, r3 + str r5, [sp] + str r4, [sp, 0x4] + str r6, [sp, 0x8] + mov r2, r8 + str r2, [sp, 0xC] + adds r2, r7, 0 + mov r3, r10 + bl sub_81D2F78 + lsls r0, r4, 13 + movs r1, 0xC1 + lsls r1, 2 + adds r0, r1 + mov r3, r9 + ldr r1, [r3] + adds r0, r1, r0 + lsls r4, 7 + adds r4, 0x4 + adds r1, r4 + str r5, [sp] + str r6, [sp, 0x4] + mov r2, r8 + str r2, [sp, 0x8] + adds r2, r7, 0 + mov r3, r10 + bl sub_81D3094 + 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_816753C + + thumb_func_start sub_8167608 +sub_8167608: @ 8167608 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x28 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x0203bcac + ldr r3, [r1] + ldr r0, =0x00007b10 + mov r8, r0 + adds r0, r3, r0 + ldrb r0, [r0] + adds r7, r1, 0 + cmp r0, 0xFF + bne _08167714 + add r5, sp, 0x18 + add r4, sp, 0x20 + adds r0, r5, 0 + mov r1, sp + adds r2, r4, 0 + bl sub_81D31D0 + lsls r0, r6, 13 + movs r1, 0xC1 + lsls r1, 2 + adds r0, r1 + ldr r1, [r7] + adds r0, r1, r0 + str r0, [sp, 0x18] + lsls r0, r6, 7 + adds r0, 0x4 + adds r1, r0 + str r1, [sp, 0x20] + adds r0, r4, 0 + bl LoadTaggedObjectPalette + ldr r1, [r7] + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x00007b12 + adds r1, r2 + strh r0, [r1] + adds r0, r5, 0 + bl LoadObjectPic + ldr r1, [r7] + ldr r3, =0x00007b14 + adds r1, r3 + strh r0, [r1] + mov r0, sp + movs r1, 0x26 + movs r2, 0x68 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, [r7] + ldr r2, =0x00007b10 + adds r0, r2 + strb r1, [r0] + cmp r1, 0x40 + bne _081676AC + movs r0, 0x64 + bl FreeObjectTilesByTag + movs r0, 0x64 + bl FreeObjectPaletteByTag + ldr r0, [r7] + add r0, r8 + movs r1, 0xFF + strb r1, [r0] + b _08167742 + .pool +_081676AC: + ldr r0, [r7] + add r0, r8 + strb r1, [r0] + ldr r4, =0x02020630 + ldr r2, [r7] + mov r0, r8 + adds r3, r2, r0 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_8168168 + str r1, [r0] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x26] + subs r1, 0x22 + strh r1, [r0, 0x26] + ldr r3, =0x00007b18 + adds r1, r2, r3 + subs r3, 0x4 + adds r0, r2, r3 + ldrh r0, [r0] + lsls r0, 5 + ldr r3, =0x06010000 + adds r0, r3 + str r0, [r1] + ldr r0, =0x00007b12 + adds r2, r0 + ldrh r0, [r2] + lsls r0, 4 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r0, [r2] + b _08167742 + .pool +_08167714: + lsls r1, r6, 13 + movs r0, 0xC1 + lsls r0, 2 + adds r1, r0 + adds r1, r3, r1 + ldr r2, =0x00007b18 + adds r0, r3, r2 + ldr r2, [r0] + ldr r0, =0x040000d4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, =0x80000400 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + lsls r0, r6, 7 + adds r0, 0x4 + adds r0, r3, r0 + ldr r2, =0x00007b12 + adds r1, r3, r2 + ldrh r1, [r1] + movs r2, 0x20 + bl gpu_pal_apply +_08167742: + add sp, 0x28 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167608 + + thumb_func_start sub_8167760 +sub_8167760: @ 8167760 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x60 + add r5, sp, 0x20 + add r4, sp, 0x38 + mov r0, sp + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_81D321C + mov r0, sp + bl LoadObjectPics + adds r0, r4, 0 + bl LoadTaggedObjectPalettes + movs r4, 0 + ldr r1, =0x0203bcac + ldr r0, [r1] + ldr r2, =0x00008040 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x1 + adds r6, r5, 0 + add r2, sp, 0x50 + mov r9, r2 + add r2, sp, 0x58 + mov r10, r2 + cmp r4, r0 + bge _0816781C + adds r5, r1, 0 + ldr r7, =0x02020630 + movs r0, 0x1C + adds r0, r7 + mov r8, r0 +_081677AC: + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 18 + movs r1, 0x80 + lsls r1, 12 + adds r2, r1 + asrs r2, 16 + adds r0, r6, 0 + movs r1, 0xE2 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _081677FC + ldr r0, [r5] + ldr r2, =0x00007b06 + adds r0, r2 + adds r0, r4 + strb r3, [r0] + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + adds r1, r0, r7 + strh r4, [r1, 0x2E] + add r0, r8 + ldr r1, =sub_8168180 + str r1, [r0] + b _08167808 + .pool +_081677FC: + ldr r0, [r5] + ldr r1, =0x00007b06 + adds r0, r1 + adds r0, r4 + movs r1, 0xFF + strb r1, [r0] +_08167808: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, [r5] + ldr r2, =0x00008040 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r4, r0 + blt _081677AC +_0816781C: + movs r0, 0x67 + strh r0, [r6] + cmp r4, 0x5 + bhi _0816788A + ldr r5, =0x0203bcac + ldr r7, =0x02020630 +_08167828: + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 18 + movs r0, 0x80 + lsls r0, 12 + adds r2, r0 + asrs r2, 16 + adds r0, r6, 0 + movs r1, 0xE6 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _08167874 + ldr r0, [r5] + ldr r1, =0x00007b06 + adds r0, r1 + adds r0, r4 + strb r3, [r0] + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x3] + movs r0, 0x3F + ands r0, r2 + strb r0, [r1, 0x3] + b _08167880 + .pool +_08167874: + ldr r0, [r5] + ldr r2, =0x00007b06 + adds r0, r2 + adds r0, r4 + movs r1, 0xFF + strb r1, [r0] +_08167880: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x5 + bls _08167828 +_0816788A: + movs r0, 0x66 + strh r0, [r6] + ldr r0, =sub_81681B4 + str r0, [r6, 0x14] + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 18 + movs r0, 0x80 + lsls r0, 12 + adds r2, r0 + asrs r2, 16 + adds r0, r6, 0 + movs r1, 0xDE + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _081678F4 + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r1, =0x00007b06 + adds r0, r1 + adds r0, r4 + strb r3, [r0] + ldr r0, =0x02020630 + lsls r2, r3, 4 + adds r2, r3 + lsls r2, 2 + adds r2, r0 + ldrb r3, [r2, 0x1] + movs r1, 0x3F + adds r0, r1, 0 + ands r0, r3 + movs r3, 0x40 + orrs r0, r3 + strb r0, [r2, 0x1] + ldrb r0, [r2, 0x3] + ands r1, r0 + movs r0, 0x80 + orrs r1, r0 + strb r1, [r2, 0x3] + b _08167902 + .pool +_081678F4: + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r2, =0x00007b06 + adds r0, r2 + adds r0, r4 + movs r1, 0xFF + strb r1, [r0] +_08167902: + mov r0, r9 + mov r1, r10 + bl sub_81D32B0 + mov r0, r9 + bl LoadObjectPic + mov r0, r10 + bl LoadTaggedObjectPalette + add sp, 0x60 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167760 + + thumb_func_start sub_8167930 +sub_8167930: @ 8167930 + push {r4,r5,lr} + sub sp, 0x8 + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r2, =0x00008048 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xB + bls _08167944 + b _08167B78 +_08167944: + lsls r0, 2 + ldr r1, =_0816795C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0816795C: + .4byte _0816798C + .4byte _08167A04 + .4byte _08167A38 + .4byte _08167A48 + .4byte _08167A5C + .4byte _08167A74 + .4byte _08167A9C + .4byte _08167AB0 + .4byte _08167AD4 + .4byte _08167AEC + .4byte _08167B1C + .4byte _08167B38 +_0816798C: + 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 r1, 0x88 + lsls r1, 6 + movs r0, 0x3 + movs r2, 0 + bl ChangeBgY + ldr r1, =0x00007040 + movs r0, 0 + bl SetGpuReg + movs r1, 0x91 + lsls r1, 2 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x0000040b + movs r0, 0x52 + bl SetGpuReg + b _08167B7E + .pool +_08167A04: + ldr r4, =0x0203bca4 + movs r0, 0xD0 + lsls r0, 5 + bl Alloc + str r0, [r4] + ldr r5, =0x0203bca0 + movs r4, 0xA0 + lsls r4, 3 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + ldr r5, =0x0203bca8 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + b _08167B7E + .pool +_08167A38: + ldr r0, =gUnknown_085DFB60 + ldr r1, =0x0203bca8 + b _08167AA0 + .pool +_08167A48: + ldr r1, =gUnknown_085DFA80 + movs r0, 0x3 + movs r2, 0xE0 + movs r3, 0 + bl LoadBgTiles + b _08167B7E + .pool +_08167A5C: + ldr r0, =0x0203bca8 + ldr r1, [r0] + movs r2, 0xA0 + lsls r2, 3 + movs r0, 0x3 + movs r3, 0 + bl LoadBgTilemap + b _08167B7E + .pool +_08167A74: + ldr r0, =gUnknown_085DFA60 + movs r1, 0xD0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r1, =0x00007b0e + adds r0, r1 + ldr r1, =0x0000ffb0 + strh r1, [r0] + b _08167B7E + .pool +_08167A9C: + ldr r0, =gUnknown_08DCCF7C + ldr r1, =0x0203bca4 +_08167AA0: + ldr r1, [r1] + bl LZ77UnCompVram + b _08167B7E + .pool +_08167AB0: + ldr r0, =gUnknown_08DCD81C + ldr r1, =0x0203bca0 + ldr r1, [r1] + bl LZ77UnCompVram + ldr r0, =gUnknown_08DCCF5C + movs r1, 0x20 + movs r2, 0x20 + bl gpu_pal_apply + b _08167B7E + .pool +_08167AD4: + ldr r0, =0x0203bca4 + ldr r1, [r0] + movs r2, 0xD0 + lsls r2, 5 + movs r3, 0xA0 + lsls r3, 2 + movs r0, 0x1 + bl LoadBgTiles + b _08167B7E + .pool +_08167AEC: + ldr r0, =0x0203bca0 + ldr r1, [r0] + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, =gUnknown_08DCDA30 + movs r0, 0xC + str r0, [sp] + movs r0, 0x4 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r2, 0 + movs r3, 0xD + bl CopyToBgTilemapBufferRect + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + b _08167B7E + .pool +_08167B1C: + ldr r0, =gUnknown_085DFC0C + ldr r1, =0x0203bcac + ldr r1, [r1] + ldr r2, =0x00007304 + adds r1, r2 + bl LZ77UnCompVram + b _08167B7E + .pool +_08167B38: + ldr r0, =0x0203bcac + ldr r1, [r0] + ldr r0, =0x00007304 + adds r1, r0 + movs r2, 0xA0 + lsls r2, 3 + movs r0, 0x2 + movs r3, 0 + bl LoadBgTilemap + ldr r0, =gUnknown_086231E8 + movs r1, 0x30 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_08623208 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0x2 + bl sub_81D21DC + b _08167B7E + .pool +_08167B78: + movs r0, 0 + strb r0, [r1] + b _08167B8E +_08167B7E: + ldr r0, =0x0203bcac + ldr r1, [r0] + ldr r2, =0x00008048 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0x1 +_08167B8E: + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8167930 + + thumb_func_start sub_8167BA0 +sub_8167BA0: @ 8167BA0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r7, =0x0203bcac + ldr r3, [r7] + ldr r1, =0x00008041 + adds r0, r3, r1 + ldrb r1, [r0] + ldr r2, =0x00008040 + adds r0, r3, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _08167C46 + lsls r2, r4, 6 + ldr r0, =0x00007b95 + adds r2, r0 + adds r2, r3, r2 + movs r0, 0x1 + str r0, [sp] + movs r5, 0 + str r5, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl Print + ldr r0, [r7] + ldr r1, =0x00008041 + adds r0, r1 + ldrb r0, [r0] + bl sub_81672A4 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + bl GetNature + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, [r7] + ldr r6, =0x0000804a + adds r0, r6 + ldr r1, =gUnknown_085EBF8D + bl CopyString + ldr r1, =gNatureNamePointers + lsls r4, 2 + adds r4, r1 + ldr r1, [r4] + bl CopyString + ldr r0, =gUnknown_085DFCC9 + str r0, [sp] + str r5, [sp, 0x4] + ldr r0, [r7] + adds r0, r6 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x2 + movs r3, 0x1 + bl box_print +_08167C46: + mov r2, r8 + cmp r2, 0 + beq _08167C84 + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram + b _08167C94 + .pool +_08167C84: + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + movs r0, 0x1 + movs r1, 0x2 + bl CopyWindowToVram +_08167C94: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8167BA0 + + thumb_func_start sub_8167CA0 +sub_8167CA0: @ 8167CA0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0 + beq _08167CC0 + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r1, =0x00007fb5 + adds r0, r1 + b _08167CC8 + .pool +_08167CC0: + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r2, =0x00007fb4 + adds r0, r2 +_08167CC8: + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r5, =0x0203bcac + ldr r2, [r5] + ldr r3, =0x00007c58 + adds r0, r2, r3 + ldr r4, =0x00007fb3 + adds r1, r2, r4 + movs r3, 0 + ldrsb r3, [r1, r3] + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 2 + ldr r4, =0x00007c6c + adds r1, r4 + adds r1, r2, r1 + lsls r3, r6, 2 + adds r3, r6 + lsls r3, 2 + adds r3, r4 + adds r2, r3 + bl sub_81D1F84 + ldr r4, [r5] + ldr r1, =0x00008041 + adds r0, r4, r1 + ldrb r1, [r0] + ldr r2, =0x00008040 + mov r12, r2 + adds r0, r4, r2 + ldrb r0, [r0] + subs r0, 0x1 + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + mov r8, r0 + cmp r7, 0 + beq _08167D98 + ldr r3, =0x00007fb4 + adds r0, r4, r3 + ldrb r1, [r0] + subs r2, 0x8B + adds r0, r4, r2 + strb r1, [r0] + ldr r0, [r5] + ldr r4, =0x00007fb3 + adds r1, r0, r4 + ldrb r1, [r1] + adds r0, r3 + strb r1, [r0] + ldr r0, [r5] + adds r0, r4 + strb r6, [r0] + ldr r0, [r5] + adds r2, r0, r2 + ldrb r1, [r2] + ldr r2, =0x00007fb6 + adds r0, r2 + strb r1, [r0] + ldr r1, [r5] + adds r3, 0x8D + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _08167D58 + mov r4, r12 + adds r0, r1, r4 + ldrb r0, [r0] +_08167D58: + subs r2, r0, 0x1 + ldr r0, =0x00008041 + adds r1, r0 + strb r2, [r1] + ldr r1, =0x0203bcac + ldr r3, [r1] + adds r0, r3, r0 + ldrb r0, [r0] + adds r6, r1, 0 + cmp r0, 0 + bne _08167D74 + ldr r1, =0x00008040 + adds r0, r3, r1 + ldrb r0, [r0] +_08167D74: + subs r1, r0, 0x1 + b _08167E1E + .pool +_08167D98: + ldr r3, =0x00007fb5 + adds r0, r4, r3 + ldrb r1, [r0] + ldr r2, =0x00007fb4 + adds r0, r4, r2 + strb r1, [r0] + ldr r0, [r5] + ldr r4, =0x00007fb3 + adds r1, r0, r4 + ldrb r1, [r1] + adds r0, r3 + strb r1, [r0] + ldr r0, [r5] + adds r0, r4 + strb r6, [r0] + ldr r0, [r5] + adds r2, r0, r2 + ldrb r1, [r2] + ldr r2, =0x00007fb6 + adds r0, r2 + strb r1, [r0] + ldr r2, [r5] + adds r3, 0x8C + adds r0, r2, r3 + ldrb r1, [r0] + adds r4, 0x8D + adds r0, r2, r4 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bge _08167DEC + adds r3, r1, 0x1 + b _08167DEE + .pool +_08167DEC: + movs r3, 0 +_08167DEE: + ldr r1, =0x00008041 + adds r0, r2, r1 + strb r3, [r0] + ldr r2, =0x0203bcac + ldr r3, [r2] + adds r1, r3, r1 + ldrb r1, [r1] + ldr r4, =0x00008040 + adds r0, r3, r4 + ldrb r0, [r0] + subs r0, 0x1 + adds r6, r2, 0 + cmp r1, r0 + bge _08167E1C + adds r1, 0x1 + b _08167E1E + .pool +_08167E1C: + movs r1, 0 +_08167E1E: + ldr r2, =0x00007b4c + adds r0, r3, r2 + strb r1, [r0] + adds r5, r6, 0 + ldr r0, [r5] + ldr r3, =0x00008041 + adds r1, r0, r3 + ldrb r2, [r1] + ldr r4, =0x00008040 + adds r1, r0, r4 + ldrb r1, [r1] + subs r1, 0x1 + eors r2, r1 + negs r1, r2 + orrs r1, r2 + lsrs r4, r1, 31 + ldr r1, =0x00007b1c + adds r0, r1 + bl sub_81D3520 + mov r2, r8 + cmp r2, 0 + bne _08167E70 + ldr r0, [r5] + ldr r3, =0x00008044 + adds r0, r3 + ldr r1, =sub_8167EA4 + b _08167E90 + .pool +_08167E70: + cmp r4, 0 + bne _08167E88 + ldr r0, [r5] + ldr r4, =0x00008044 + adds r0, r4 + ldr r1, =sub_8167FA4 + b _08167E90 + .pool +_08167E88: + ldr r0, [r6] + ldr r1, =0x00008044 + adds r0, r1 + ldr r1, =sub_8168048 +_08167E90: + str r1, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8167CA0 + + thumb_func_start sub_8167EA4 +sub_8167EA4: @ 8167EA4 + push {r4-r6,lr} + ldr r4, =0x0203bcac + ldr r1, [r4] + ldr r5, =0x00008048 + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08167EE4 + cmp r0, 0x1 + bgt _08167EC8 + cmp r0, 0 + beq _08167ED2 + b _08167F9C + .pool +_08167EC8: + cmp r0, 0x2 + beq _08167F08 + cmp r0, 0x3 + beq _08167F48 + b _08167F9C +_08167ED2: + ldr r2, =0x00007fb3 + adds r0, r1, r2 + ldrb r0, [r0] + bl sub_8167608 + b _08167F2C + .pool +_08167EE4: + ldr r6, =0x00007fb3 + adds r0, r1, r6 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl sub_8167BA0 + ldr r1, [r4] + ldr r0, =0x00008048 + adds r1, r0 + b _08167F30 + .pool +_08167F08: + ldr r2, =0x00007c58 + adds r0, r1, r2 + ldr r6, =0x00007b0e + adds r1, r6 + bl sub_81D3178 + lsls r0, 24 + cmp r0, 0 + bne _08167F9C + ldr r1, [r4] + ldr r2, =0x00007b4c + adds r0, r1, r2 + ldrb r0, [r0] + ldr r6, =0x00007fb6 + adds r1, r6 + ldrb r1, [r1] + bl sub_816753C +_08167F2C: + ldr r1, [r4] + adds r1, r5 +_08167F30: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08167F9C + .pool +_08167F48: + ldr r2, =0x00007b1c + adds r0, r1, r2 + bl sub_81D3464 + ldr r3, [r4] + ldr r6, =0x00008041 + adds r0, r3, r6 + ldrb r1, [r0] + ldr r2, =0x00008040 + adds r0, r3, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _08167F82 + subs r6, 0x8E + adds r0, r3, r6 + movs r1, 0 + ldrsb r1, [r0, r1] + subs r2, 0x90 + adds r0, r3, r2 + adds r0, r1 + ldrb r2, [r0] + ldr r6, =0x00007b1c + adds r0, r3, r6 + subs r6, 0xC + adds r1, r3, r6 + ldrb r1, [r1] + bl sub_81D3480 +_08167F82: + ldr r0, [r4] + adds r0, r5 + movs r1, 0 + strb r1, [r0] + movs r0, 0 + b _08167F9E + .pool +_08167F9C: + movs r0, 0x1 +_08167F9E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8167EA4 + + thumb_func_start sub_8167FA4 +sub_8167FA4: @ 8167FA4 + push {r4,r5,lr} + ldr r4, =0x0203bcac + ldr r1, [r4] + ldr r5, =0x00008048 + adds r2, r1, r5 + ldrb r0, [r2] + cmp r0, 0x1 + beq _08167FF0 + cmp r0, 0x1 + bgt _08167FC8 + cmp r0, 0 + beq _08167FD2 + b _0816803E + .pool +_08167FC8: + cmp r0, 0x2 + beq _08168014 + cmp r0, 0x3 + beq _08168038 + b _0816803E +_08167FD2: + ldr r2, =0x00007c58 + adds r0, r1, r2 + ldr r2, =0x00007b0e + adds r1, r2 + bl sub_81D31A4 + lsls r0, 24 + cmp r0, 0 + bne _0816803E + b _08168024 + .pool +_08167FF0: + ldr r2, =0x00007fb3 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl sub_8167BA0 + ldr r1, [r4] + ldr r0, =0x00008048 + adds r1, r0 + b _08168028 + .pool +_08168014: + ldr r2, =0x00007b4c + adds r0, r1, r2 + ldrb r0, [r0] + ldr r2, =0x00007fb6 + adds r1, r2 + ldrb r1, [r1] + bl sub_816753C +_08168024: + ldr r1, [r4] + adds r1, r5 +_08168028: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0816803E + .pool +_08168038: + movs r0, 0 + strb r0, [r2] + b _08168040 +_0816803E: + movs r0, 0x1 +_08168040: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8167FA4 + + thumb_func_start sub_8168048 +sub_8168048: @ 8168048 + push {r4-r6,lr} + ldr r4, =0x0203bcac + ldr r1, [r4] + ldr r5, =0x00008048 + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0x1 + beq _081680A8 + cmp r0, 0x1 + bgt _0816806C + cmp r0, 0 + beq _08168076 + b _08168160 + .pool +_0816806C: + cmp r0, 0x2 + beq _081680CC + cmp r0, 0x3 + beq _0816810C + b _08168160 +_08168076: + ldr r2, =0x00007c58 + adds r0, r1, r2 + bl sub_81D2074 + ldr r0, [r4] + ldr r6, =0x00007b0e + adds r0, r6 + bl sub_81D3150 + lsls r0, 24 + cmp r0, 0 + bne _08168160 + ldr r0, [r4] + ldr r1, =0x00007fb3 + adds r0, r1 + ldrb r0, [r0] + bl sub_8167608 + b _081680F0 + .pool +_081680A8: + ldr r2, =0x00007fb3 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl sub_8167BA0 + ldr r1, [r4] + ldr r6, =0x00008048 + adds r1, r6 + b _081680F4 + .pool +_081680CC: + ldr r2, =0x00007c58 + adds r0, r1, r2 + ldr r6, =0x00007b0e + adds r1, r6 + bl sub_81D3178 + lsls r0, 24 + cmp r0, 0 + bne _08168160 + ldr r1, [r4] + ldr r2, =0x00007b4c + adds r0, r1, r2 + ldrb r0, [r0] + ldr r6, =0x00007fb6 + adds r1, r6 + ldrb r1, [r1] + bl sub_816753C +_081680F0: + ldr r1, [r4] + adds r1, r5 +_081680F4: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08168160 + .pool +_0816810C: + ldr r2, =0x00007b1c + adds r0, r1, r2 + bl sub_81D3464 + ldr r3, [r4] + ldr r6, =0x00008041 + adds r0, r3, r6 + ldrb r1, [r0] + ldr r2, =0x00008040 + adds r0, r3, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + beq _08168146 + subs r6, 0x8E + adds r0, r3, r6 + movs r1, 0 + ldrsb r1, [r0, r1] + subs r2, 0x90 + adds r0, r3, r2 + adds r0, r1 + ldrb r2, [r0] + ldr r6, =0x00007b1c + adds r0, r3, r6 + subs r6, 0xC + adds r1, r3, r6 + ldrb r1, [r1] + bl sub_81D3480 +_08168146: + ldr r0, [r4] + adds r0, r5 + movs r1, 0 + strb r1, [r0] + movs r0, 0 + b _08168162 + .pool +_08168160: + movs r0, 0x1 +_08168162: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8168048 + + thumb_func_start sub_8168168 +sub_8168168: @ 8168168 + ldr r1, =0x0203bcac + ldr r1, [r1] + ldr r2, =0x00007b0e + adds r1, r2 + ldrh r1, [r1] + adds r1, 0x26 + strh r1, [r0, 0x20] + bx lr + .pool + thumb_func_end sub_8168168 + + thumb_func_start sub_8168180 +sub_8168180: @ 8168180 + push {lr} + adds r2, r0, 0 + movs r0, 0x2E + ldrsh r1, [r2, r0] + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r3, =0x00008041 + adds r0, r3 + ldrb r0, [r0] + cmp r1, r0 + bne _081681A8 + adds r0, r2, 0 + movs r1, 0 + bl StartObjectImageAnim + b _081681B0 + .pool +_081681A8: + adds r0, r2, 0 + movs r1, 0x1 + bl StartObjectImageAnim +_081681B0: + pop {r0} + bx r0 + thumb_func_end sub_8168180 + + thumb_func_start sub_81681B4 +sub_81681B4: @ 81681B4 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r2, =0x00008041 + adds r1, r0, r2 + ldrb r1, [r1] + subs r2, 0x1 + adds r0, r2 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _081681DC + movs r0, 0x65 + b _081681DE + .pool +_081681DC: + movs r0, 0x66 +_081681DE: + bl IndexOfObjectPaletteTag + lsls r0, 4 + ldrb r2, [r4, 0x5] + movs r1, 0xF + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x5] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81681B4 + + thumb_func_start sub_81681F4 +sub_81681F4: @ 81681F4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x30 + bl pokemon_getattr + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r3, =0x00007fb3 + adds r1, r0, r3 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + subs r3, 0x3 + adds r0, r3 + adds r4, r0, r1 + cmp r2, 0xFF + beq _0816823C + adds r0, r2, 0 + movs r1, 0x1D + bl __udivsi3 + b _0816823E + .pool +_0816823C: + movs r0, 0x9 +_0816823E: + strb r0, [r4] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81681F4 + + thumb_func_start sub_8168248 +sub_8168248: @ 8168248 + push {lr} + sub sp, 0x10 + ldr r0, =gUnknown_085DFDB8 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x8] + str r1, [sp, 0xC] + ldr r0, =gUnknown_08DCCBB8 + str r0, [sp] + ldr r1, =0xffff0000 + ldr r0, [sp, 0x4] + ands r0, r1 + movs r1, 0x80 + lsls r1, 4 + orrs r0, r1 + ldr r1, =0x0000ffff + ands r0, r1 + adds r1, 0x1 + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl LoadCompressedObjectPic + add r0, sp, 0x8 + bl LoadTaggedObjectPalette + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8168248 + + thumb_func_start sub_8168294 +sub_8168294: @ 8168294 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x0203bcac + ldr r0, [r0] + ldr r1, =0x00007b44 + adds r7, r0, r1 + ldr r0, =gUnknown_085DFDA0 + mov r10, r0 + movs r6, 0 + movs r1, 0x40 + mov r9, r1 + movs r0, 0x60 + negs r0, r0 + mov r8, r0 +_081682B6: + mov r5, r9 + muls r5, r6 + mov r0, r8 + adds r1, r0, r5 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x11 + lsls r2, r0, 16 + mov r0, r10 + asrs r2, 16 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _081682FE + ldr r0, =0x02020630 + lsls r4, r1, 4 + adds r4, r1 + lsls r4, 2 + adds r4, r0 + movs r1, 0x8 + strh r1, [r4, 0x2E] + movs r0, 0x20 + orrs r5, r0 + strh r5, [r4, 0x30] + strh r6, [r4, 0x32] + lsls r1, r6, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + lsls r0, r6, 2 + adds r0, r7 + str r4, [r0] +_081682FE: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x1 + bls _081682B6 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8168294 + + thumb_func_start sub_8168328 +sub_8168328: @ 8168328 + push {r4,r5,lr} + ldr r4, =0x0203bcac + ldr r0, [r4] + ldr r5, =0x00008048 + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0 + beq _08168348 + cmp r0, 0x1 + beq _08168360 + b _0816836C + .pool +_08168348: + bl sub_8168248 + ldr r1, [r4] + ldr r0, =0x00008048 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0x1 + b _0816836E + .pool +_08168360: + bl sub_8168294 + ldr r0, [r4] + adds r0, r5 + movs r1, 0 + strb r1, [r0] +_0816836C: + movs r0, 0 +_0816836E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8168328 + + thumb_func_start sub_8168374 +sub_8168374: @ 8168374 + push {r4,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x20] + ldrh r1, [r2, 0x2E] + adds r3, r0, r1 + strh r3, [r2, 0x20] + lsls r0, 16 + asrs r4, r0, 16 + movs r0, 0x30 + ldrsh r1, [r2, r0] + cmp r4, r1 + bgt _08168398 + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, r1 + bge _081683A0 + cmp r4, r1 + blt _081683A8 +_08168398: + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, r1 + bgt _081683A8 +_081683A0: + ldrh r0, [r2, 0x30] + strh r0, [r2, 0x20] + ldr r0, =DummyObjectCallback + str r0, [r2, 0x1C] +_081683A8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8168374 + + thumb_func_start nullsub_117 +nullsub_117: @ 81683B4 + bx lr + thumb_func_end nullsub_117 + + thumb_func_start bx_goto_buffer_A_ch0_tbl3 +bx_goto_buffer_A_ch0_tbl3: @ 81683B8 + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_exec_buffer_A_ch0_tbl2 + str r1, [r0] + ldr r2, =0x0202449c + ldr r0, [r2] + adds r0, 0x94 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0x95 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0x96 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0x97 + strb r1, [r0] + bx lr + .pool + thumb_func_end bx_goto_buffer_A_ch0_tbl3 + + thumb_func_start bx_exec_buffer_A_ch0_tbl2 +bx_exec_buffer_A_ch0_tbl2: @ 81683F4 + push {lr} + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldr r0, =0x02024064 + ldrb r3, [r0] + lsls r0, r3, 2 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08168440 + ldr r0, =0x02023064 + lsls r1, r3, 9 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x38 + bhi _0816843C + ldr r0, =gUnknown_085DFDC0 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 + b _08168440 + .pool +_0816843C: + bl dp01_tbl5_exec_completed +_08168440: + pop {r0} + bx r0 + thumb_func_end bx_exec_buffer_A_ch0_tbl2 + + thumb_func_start sub_8168444 +sub_8168444: @ 8168444 + push {r4,r5,lr} + ldr r1, =0x0202449c + ldr r0, [r1] + adds r0, 0x94 + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0x5 + bls _08168456 + b _08168564 +_08168456: + lsls r0, 2 + ldr r1, =_08168468 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08168468: + .4byte _08168480 + .4byte _08168492 + .4byte _081684B0 + .4byte _081684CE + .4byte _08168508 + .4byte _08168540 +_08168480: + ldr r0, [r4] + adds r0, 0x96 + movs r1, 0x40 + strb r1, [r0] + ldr r1, [r4] + adds r1, 0x94 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08168492: + ldr r1, [r4] + adds r1, 0x96 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _08168564 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + movs r1, 0 + b _081684E4 +_081684B0: + ldr r1, [r4] + adds r1, 0x96 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _08168564 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + movs r1, 0 + b _081684E4 +_081684CE: + ldr r1, [r4] + adds r1, 0x96 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _08168564 + movs r0, 0x1 + movs r1, 0x9 +_081684E4: + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + bl dp01_tbl5_exec_completed + ldr r1, [r4] + adds r1, 0x94 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0x95 + strb r5, [r0] + ldr r0, [r4] + adds r0, 0x96 + movs r1, 0x40 + strb r1, [r0] + b _08168564 +_08168508: + ldr r1, [r4] + adds r1, 0x96 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _08168564 + movs r0, 0x5 + bl audio_play + movs r0, 0 + bl sub_8059CF8 + movs r0, 0x1 + movs r1, 0 + bl sub_8059CB4 + ldr r0, [r4] + adds r0, 0x96 + movs r1, 0x40 + strb r1, [r0] + ldr r1, [r4] + adds r1, 0x94 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08168564 +_08168540: + ldr r1, [r4] + adds r1, 0x96 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _08168564 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl dp01_build_cmdbuf_x21_a_bb + bl dp01_tbl5_exec_completed +_08168564: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8168444 + + thumb_func_start sub_816856C +sub_816856C: @ 816856C + push {lr} + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + 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, =DummyObjectCallback + cmp r1, r0 + bne _08168590 + bl dp01_tbl5_exec_completed +_08168590: + pop {r0} + bx r0 + .pool + thumb_func_end sub_816856C + + thumb_func_start sub_81685A4 +sub_81685A4: @ 81685A4 + push {lr} + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _081685B6 + bl dp01_tbl5_exec_completed +_081685B6: + pop {r0} + bx r0 + thumb_func_end sub_81685A4 + + thumb_func_start bx_wait_t5 +bx_wait_t5: @ 81685BC + push {lr} + ldr r0, =0x020244b9 + ldrb r0, [r0] + cmp r0, 0 + bne _081685CA + bl dp01_tbl5_exec_completed +_081685CA: + pop {r0} + bx r0 + .pool + thumb_func_end bx_wait_t5 + + thumb_func_start sub_81685D4 +sub_81685D4: @ 81685D4 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081685FC + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8168610 + str r1, [r0] + bl nullsub_35 + bl FreeAllWindowBuffers + bl DoWallyTutorialBagMenu +_081685FC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81685D4 + + thumb_func_start sub_8168610 +sub_8168610: @ 8168610 + push {lr} + ldr r0, =0x030022c0 + ldr r1, [r0, 0x4] + ldr r0, =sub_8038420 + cmp r1, r0 + bne _08168636 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08168636 + ldr r0, =0x0203ce7c + ldrh r1, [r0] + movs r0, 0x1 + bl dp01_build_cmdbuf_x23_aa_0 + bl dp01_tbl5_exec_completed +_08168636: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8168610 + + thumb_func_start sub_816864C +sub_816864C: @ 816864C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r5, =0x02024064 + 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 r7, 0x88 + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + bne _08168684 + ldr r0, =0x0202406e + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_08168684: + ldr r1, [r4] + ldrb r0, [r5] + 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, r7, 0 + ands r0, r1 + cmp r0, 0 + bne _081686B6 + ldr r0, =0x0202406e + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_081686B6: + ldr r0, [r4] + ldrb r2, [r5] + ldr r3, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0] + movs r4, 0x8 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _081686D2 + b _081687DC +_081686D2: + adds r1, r2, 0 + eors r1, r6 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r1, [r0] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _081687DC + ldr r0, =0x02020630 + mov r8, r0 + ldr r7, =0x03005d7c + adds r0, r2, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + mov r4, r8 + adds r4, 0x1C + adds r0, r4 + ldr r3, [r0] + ldr r0, =DummyObjectCallback + cmp r3, r0 + bne _081687DC + ldr r0, =0x020241e4 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + cmp r0, r3 + bne _081687DC + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _0816877A + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0816877A + ldrb r0, [r5] + eors r0, r6 + adds r0, r7 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + bl RemoveObjectAndFreeTiles + ldr r4, =0x03005d70 + ldrb r0, [r5] + adds r1, r6, 0 + eors r1, r0 + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0 + bl healthbar_draw_field_maybe + ldrb r0, [r5] + eors r0, r6 + bl sub_8076918 + ldrb r0, [r5] + eors r0, r6 + adds r0, r4 + ldrb r0, [r0] + bl sub_80729D0 +_0816877A: + ldr r1, =0x03005d7c + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + ldr r5, =0x03005d70 + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + 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 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r2, [r0, 0x8] + ldrb r1, [r2, 0x9] + movs r0, 0x2 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x9] + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8168818 + str r1, [r0] +_081687DC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816864C + + thumb_func_start sub_8168818 +sub_8168818: @ 8168818 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r4, 0 + ldr r2, =0x02020630 + ldr r0, =0x03005d70 + ldr r1, =0x02024064 + mov r8, r1 + ldrb r3, [r1] + 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, =DummyObjectCallback + cmp r1, r0 + bne _08168842 + movs r4, 0x1 +_08168842: + cmp r4, 0 + beq _08168904 + ldr r7, =0x020244d0 + ldr r0, [r7] + ldr r4, [r0, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r2, r0, r4 + ldrb r1, [r2, 0x1] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08168904 + movs r6, 0x2 + adds r1, r6, 0 + eors r1, r3 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x1] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08168904 + ldrb r1, [r2] + movs r3, 0x7F + adds r0, r3, 0 + ands r0, r1 + strb r0, [r2] + ldr r0, [r7] + mov r1, r8 + ldrb r2, [r1] + 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] + ldr r2, [r7] + mov r1, r8 + ldrb r0, [r1] + adds r1, r6, 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] + ldr r2, [r7] + mov r1, r8 + ldrb r0, [r1] + adds r1, r6, 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 FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + ldr r0, =c3_0802FDF4 + movs r1, 0xA + bl CreateTask + ldr r2, =0x0202406e + mov r0, r8 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + adds r0, r2 + bl sub_805E990 + bl dp01_tbl5_exec_completed +_08168904: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8168818 + + thumb_func_start sub_8168934 +sub_8168934: @ 8168934 + push {r4-r6,lr} + ldr r5, =0x02024064 + ldrb r0, [r5] + ldr r6, =0x03005d70 + 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 _0816897C + ldrb r0, [r5] + adds r0, r6 + ldrb r0, [r0] + movs r2, 0 + bl heathbar_draw_hp + b _08168996 + .pool +_0816897C: + ldr r2, =0x0202406e + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + adds r0, r2 + bl sub_805E990 + bl dp01_tbl5_exec_completed +_08168996: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8168934 + + thumb_func_start bx_blink_t5 +bx_blink_t5: @ 81689A4 + push {r4,lr} + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + ldr r2, =0x02020630 + 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 _081689F0 + 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, =0x020244b9 + strb r3, [r0] + bl dp01_tbl5_exec_completed + b _08168A1A + .pool +_081689F0: + ldrh r0, [r4, 0x30] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08168A14 + 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] +_08168A14: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] +_08168A1A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end bx_blink_t5 + + thumb_func_start sub_8168A20 +sub_8168A20: @ 8168A20 + push {r4-r6,lr} + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r6, =0x02024064 + 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 _08168A74 + ldr r5, =0x020241e4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r1, =0x03005d70 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl5_exec_completed +_08168A74: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8168A20 + + thumb_func_start sub_8168A90 +sub_8168A90: @ 8168A90 + push {lr} + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + 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, =DummyObjectCallback + cmp r1, r0 + bne _08168AB4 + bl dp01_tbl5_exec_completed +_08168AB4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8168A90 + + thumb_func_start sub_8168AC8 +sub_8168AC8: @ 8168AC8 + push {lr} + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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 _08168AEA + bl dp01_tbl5_exec_completed +_08168AEA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8168AC8 + + thumb_func_start dp01_tbl5_exec_completed +dp01_tbl5_exec_completed: @ 8168AF8 + push {r4,lr} + sub sp, 0x4 + ldr r1, =0x03005d60 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_exec_buffer_A_ch0_tbl2 + str r1, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08168B4C + bl link_get_multiplayer_id + mov r1, sp + strb r0, [r1] + movs r0, 0x2 + movs r1, 0x4 + mov r2, sp + bl dp01_prepare_buffer_wireless_probably + ldr r1, =0x02023064 + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _08168B5E + .pool +_08168B4C: + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, [r2] + bics r0, r1 + str r0, [r2] +_08168B5E: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01_tbl5_exec_completed + + thumb_func_start sub_8168B70 +sub_8168B70: @ 8168B70 + push {lr} + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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 _08168B92 + bl dp01_tbl5_exec_completed +_08168B92: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8168B70 + + thumb_func_start dp01t_00_5_getattr +dp01t_00_5_getattr: @ 8168BA0 + push {r4-r6,lr} + sub sp, 0x100 + movs r6, 0 + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _08168BD8 + ldr r0, =0x0202406e + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + mov r1, sp + bl sub_8168C14 + adds r6, r0, 0 + b _08168BFA + .pool +_08168BD8: + ldrb r4, [r1] + movs r5, 0 +_08168BDC: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _08168BF2 + lsls r0, r5, 24 + lsrs r0, 24 + mov r2, sp + adds r1, r2, r6 + bl sub_8168C14 + adds r6, r0 +_08168BF2: + lsrs r4, 1 + adds r5, 0x1 + cmp r5, 0x5 + ble _08168BDC +_08168BFA: + lsls r1, r6, 16 + lsrs r1, 16 + movs r0, 0x1 + mov r2, sp + bl dp01_build_cmdbuf_x1D_1D_numargs_varargs + bl dp01_tbl5_exec_completed + add sp, 0x100 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end dp01t_00_5_getattr + + thumb_func_start sub_8168C14 +sub_8168C14: @ 8168C14 + 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, =0x02023064 + ldr r3, =0x02024064 + ldrb r0, [r3] + lsls r0, 9 + adds r1, r2, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3B + bls _08168C3E + bl _081693AA +_08168C3E: + lsls r0, 2 + ldr r1, =_08168C54 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08168C54: + .4byte _08168D44 + .4byte _08168F68 + .4byte _08168F78 + .4byte _08168F88 + .4byte _08168FF0 + .4byte _08168FF0 + .4byte _08168FF0 + .4byte _08168FF0 + .4byte _0816900C + .4byte _08169048 + .4byte _08169048 + .4byte _08169048 + .4byte _08169048 + .4byte _081693AA + .4byte _081693AA + .4byte _081693AA + .4byte _081693AA + .4byte _08169064 + .4byte _08169074 + .4byte _081690A4 + .4byte _081690B4 + .4byte _081690C4 + .4byte _081690D4 + .4byte _081690E4 + .4byte _081690F4 + .4byte _08169104 + .4byte _08169114 + .4byte _08169124 + .4byte _08169134 + .4byte _08169144 + .4byte _08169154 + .4byte _08169164 + .4byte _081691B4 + .4byte _081691C4 + .4byte _081691D4 + .4byte _081691E4 + .4byte _081691F4 + .4byte _08169204 + .4byte _08169214 + .4byte _08169224 + .4byte _08169234 + .4byte _08169268 + .4byte _08169278 + .4byte _08169288 + .4byte _08169298 + .4byte _081692A8 + .4byte _081692B8 + .4byte _081692C8 + .4byte _081692D8 + .4byte _081692F8 + .4byte _08169308 + .4byte _08169318 + .4byte _08169328 + .4byte _08169338 + .4byte _08169348 + .4byte _08169358 + .4byte _08169368 + .4byte _08169378 + .4byte _08169388 + .4byte _08169398 +_08168D44: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + mov r1, sp + strh r0, [r1] + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + 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 +_08168D90: + adds r1, r6, 0 + adds r1, 0xD + mov r0, r8 + bl pokemon_getattr + strh r0, [r4] + adds r1, r6, 0 + adds r1, 0x11 + mov r0, r8 + bl pokemon_getattr + mov r2, r9 + adds r1, r2, r6 + strb r0, [r1] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _08168D90 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r10 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + ldr r2, [sp, 0x80] + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x19 + bl pokemon_getattr + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + str r0, [sp, 0x48] + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + str r0, [sp, 0x4C] + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + ldr r1, [sp, 0x7C] + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x28] + adds r0, r4, 0 + movs r1, 0x3A + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2C] + adds r0, r4, 0 + movs r1, 0x3B + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2] + adds r0, r4, 0 + movs r1, 0x3C + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x4] + adds r0, r4, 0 + movs r1, 0x3D + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x6] + adds r0, r4, 0 + movs r1, 0x3E + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x8] + adds r0, r4, 0 + movs r1, 0x3F + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0xA] + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + str r0, [sp, 0x54] + adds r0, r4, 0 + movs r1, 0x2 + ldr r2, [sp, 0x8C] + bl pokemon_getattr + ldr r0, [sp, 0x84] + ldr r1, [sp, 0x8C] + bl CopyString_Limit10 + adds r0, r4, 0 + movs r1, 0x7 + ldr r2, [sp, 0x88] + bl pokemon_getattr + mov r2, sp + movs r6, 0 +_08168F48: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0x57 + bls _08168F48 + b _081693AA + .pool +_08168F68: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + b _081692E2 + .pool +_08168F78: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xC + b _081692E2 + .pool +_08168F88: + 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, =0x020244ec + adds r4, r1, r0 + mov r8, r9 +_08168F9E: + adds r1, r6, 0 + adds r1, 0xD + adds r0, r4, 0 + bl pokemon_getattr + mov r1, r8 + strh r0, [r1] + adds r1, r6, 0 + adds r1, 0x11 + adds r0, r4, 0 + bl pokemon_getattr + mov r2, r10 + adds r1, r2, r6 + strb r0, [r1] + movs r0, 0x2 + add r8, r0 + adds r6, 0x1 + cmp r6, 0x3 + ble _08168F9E + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r9 + strb r0, [r1, 0xC] + mov r2, r9 + movs r6, 0 +_08168FDC: + adds r0, r7, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0xF + bls _08168FDC + b _081693AA + .pool +_08168FF0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x9 + b _081692E2 + .pool +_0816900C: + movs r6, 0 + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r2, =0x020244ec + mov r8, r2 +_08169018: + adds r1, r6, 0 + adds r1, 0x11 + mov r2, r8 + adds r0, r4, r2 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + cmp r6, 0x3 + ble _08169018 + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + b _081693AA + .pool +_08169048: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldrb r1, [r3] + lsls r1, 9 + adds r2, 0x1 + adds r1, r2 + ldrb r1, [r1] + adds r1, 0x8 + b _081693A2 + .pool +_08169064: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1 + b _0816907E + .pool +_08169074: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x19 +_0816907E: + bl pokemon_getattr + 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 _081693AA + .pool +_081690A4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1A + b _081693A2 + .pool +_081690B4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1B + b _081693A2 + .pool +_081690C4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1C + b _081693A2 + .pool +_081690D4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1D + b _081693A2 + .pool +_081690E4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1E + b _081693A2 + .pool +_081690F4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1F + b _081693A2 + .pool +_08169104: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x20 + b _081693A2 + .pool +_08169114: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x22 + b _081693A2 + .pool +_08169124: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x23 + b _081693A2 + .pool +_08169134: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x24 + b _081693A2 + .pool +_08169144: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x25 + b _081693A2 + .pool +_08169154: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x26 + b _081693A2 + .pool +_08169164: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_getattr + strb r0, [r7] + adds r0, r4, 0 + movs r1, 0x28 + bl pokemon_getattr + strb r0, [r7, 0x1] + adds r0, r4, 0 + movs r1, 0x29 + bl pokemon_getattr + strb r0, [r7, 0x2] + adds r0, r4, 0 + movs r1, 0x2A + bl pokemon_getattr + strb r0, [r7, 0x3] + adds r0, r4, 0 + movs r1, 0x2B + bl pokemon_getattr + strb r0, [r7, 0x4] + adds r0, r4, 0 + movs r1, 0x2C + bl pokemon_getattr + strb r0, [r7, 0x5] + movs r6, 0x6 + b _081693AA + .pool +_081691B4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x27 + b _081693A2 + .pool +_081691C4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x28 + b _081693A2 + .pool +_081691D4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x29 + b _081693A2 + .pool +_081691E4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2A + b _081693A2 + .pool +_081691F4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2B + b _081693A2 + .pool +_08169204: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2C + b _081693A2 + .pool +_08169214: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0 + b _0816923E + .pool +_08169224: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x9 + b _081692E2 + .pool +_08169234: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x37 +_0816923E: + bl pokemon_getattr + 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 _081693AA + .pool +_08169268: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x38 + b _081693A2 + .pool +_08169278: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x39 + b _081692E2 + .pool +_08169288: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3A + b _081692E2 + .pool +_08169298: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3B + b _081692E2 + .pool +_081692A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3C + b _081692E2 + .pool +_081692B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3D + b _081692E2 + .pool +_081692C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3E + b _081692E2 + .pool +_081692D8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3F +_081692E2: + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + strb r0, [r7] + lsrs r0, 8 + strb r0, [r7, 0x1] + movs r6, 0x2 + b _081693AA + .pool +_081692F8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x16 + b _081693A2 + .pool +_08169308: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x17 + b _081693A2 + .pool +_08169318: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x18 + b _081693A2 + .pool +_08169328: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x21 + b _081693A2 + .pool +_08169338: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2F + b _081693A2 + .pool +_08169348: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x30 + b _081693A2 + .pool +_08169358: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x32 + b _081693A2 + .pool +_08169368: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x33 + b _081693A2 + .pool +_08169378: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x34 + b _081693A2 + .pool +_08169388: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x35 + b _081693A2 + .pool +_08169398: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x36 +_081693A2: + bl pokemon_getattr + strb r0, [r7] + movs r6, 0x1 +_081693AA: + 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_8168C14 + + thumb_func_start sub_81693C0 +sub_81693C0: @ 81693C0 + push {lr} + bl sub_805A614 + pop {r0} + bx r0 + thumb_func_end sub_81693C0 + + thumb_func_start sub_81693CC +sub_81693CC: @ 81693CC + push {r4,r5,lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _081693FC + ldr r0, =0x0202406e + lsls r1, r2, 1 + adds r1, r0 + ldrb r0, [r1] + bl sub_8169424 + b _0816941A + .pool +_081693FC: + ldrb r4, [r1] + movs r5, 0 +_08169400: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0816940E + adds r0, r5, 0 + bl sub_8169424 +_0816940E: + lsrs r4, 1 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _08169400 +_0816941A: + bl dp01_tbl5_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81693CC + + thumb_func_start sub_8169424 +sub_8169424: @ 8169424 + 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, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + ldr r2, =0x02023067 + 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 _08169450 + bl _08169DEA +_08169450: + lsls r0, 2 + ldr r1, =_08169468 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08169468: + .4byte _08169558 + .4byte _081696F0 + .4byte _08169710 + .4byte _08169730 + .4byte _08169788 + .4byte _08169788 + .4byte _08169788 + .4byte _08169788 + .4byte _081697B0 + .4byte _08169814 + .4byte _08169814 + .4byte _08169814 + .4byte _08169814 + .4byte _08169DEA + .4byte _08169DEA + .4byte _08169DEA + .4byte _08169DEA + .4byte _08169844 + .4byte _08169864 + .4byte _08169884 + .4byte _081698A4 + .4byte _081698C4 + .4byte _081698E4 + .4byte _08169904 + .4byte _08169924 + .4byte _08169944 + .4byte _08169964 + .4byte _08169984 + .4byte _081699A4 + .4byte _081699C4 + .4byte _081699E4 + .4byte _08169A04 + .4byte _08169A74 + .4byte _08169A94 + .4byte _08169AB4 + .4byte _08169AD4 + .4byte _08169AF4 + .4byte _08169B14 + .4byte _08169B34 + .4byte _08169B54 + .4byte _08169B74 + .4byte _08169B94 + .4byte _08169BB4 + .4byte _08169BD4 + .4byte _08169BF4 + .4byte _08169C14 + .4byte _08169C34 + .4byte _08169C54 + .4byte _08169C74 + .4byte _08169C94 + .4byte _08169CB4 + .4byte _08169CD4 + .4byte _08169CF4 + .4byte _08169D14 + .4byte _08169D34 + .4byte _08169D54 + .4byte _08169D74 + .4byte _08169D94 + .4byte _08169DB4 + .4byte _08169DD4 +_08169558: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + adds r2, r6, 0 + bl pokemon_setattr + adds r2, r6, 0 + adds r2, 0x2E + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + 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 +_081695BE: + mov r1, r8 + adds r1, 0xD + mov r0, r9 + adds r2, r4, 0 + bl pokemon_setattr + mov r1, r8 + adds r1, 0x11 + mov r0, r9 + adds r2, r7, 0 + bl pokemon_setattr + adds r7, 0x1 + adds r4, 0x2 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x3 + ble _081695BE + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + mov r2, r10 + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x20 + ldr r2, [sp, 0x20] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x19 + ldr r2, [sp, 0x28] + bl pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + adds r0, r4, 0 + movs r1, 0 + ldr r2, [sp, 0x2C] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x37 + ldr r2, [sp, 0x30] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x38 + ldr r2, [sp, 0x1C] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x39 + ldr r2, [sp, 0x18] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3A + ldr r2, [sp, 0x24] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3B + ldr r2, [sp, 0x4] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3C + ldr r2, [sp, 0x8] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3D + ldr r2, [sp, 0xC] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3E + ldr r2, [sp, 0x10] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3F + ldr r2, [sp, 0x14] + bl pokemon_setattr + b _08169DEA + .pool +_081696F0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xB + bl pokemon_setattr + b _08169DEA + .pool +_08169710: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xC + bl pokemon_setattr + b _08169DEA + .pool +_08169730: + 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, =0x020244ec + adds r7, r1, r0 + adds r6, r3, 0 + adds r6, 0x8 + adds r4, r3, 0 +_0816974A: + mov r1, r8 + adds r1, 0xD + adds r0, r7, 0 + adds r2, r4, 0 + bl pokemon_setattr + mov r1, r8 + adds r1, 0x11 + adds r0, r7, 0 + adds r2, r6, 0 + bl pokemon_setattr + adds r6, 0x1 + adds r4, 0x2 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x3 + ble _0816974A + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x15 + mov r2, r9 + bl pokemon_setattr + b _08169DEA + .pool +_08169788: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r3, =0x02023064 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x9 + b _0816982C + .pool +_081697B0: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + ldr r5, =0x02024064 + ldrb r2, [r5] + lsls r2, 9 + adds r2, r7 + adds r0, r4, 0 + movs r1, 0x11 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x12 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x2 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x13 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x3 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x14 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x4 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x15 + bl pokemon_setattr + b _08169DEA + .pool +_08169814: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r3, =0x02023064 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r1, r3, 0x1 + adds r1, r2, r1 + ldrb r1, [r1] + adds r1, 0x8 +_0816982C: + adds r3, 0x3 + adds r2, r3 + bl pokemon_setattr + b _08169DEA + .pool +_08169844: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1 + bl pokemon_setattr + b _08169DEA + .pool +_08169864: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x19 + bl pokemon_setattr + b _08169DEA + .pool +_08169884: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1A + bl pokemon_setattr + b _08169DEA + .pool +_081698A4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1B + bl pokemon_setattr + b _08169DEA + .pool +_081698C4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1C + bl pokemon_setattr + b _08169DEA + .pool +_081698E4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1D + bl pokemon_setattr + b _08169DEA + .pool +_08169904: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1E + bl pokemon_setattr + b _08169DEA + .pool +_08169924: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1F + bl pokemon_setattr + b _08169DEA + .pool +_08169944: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x20 + bl pokemon_setattr + b _08169DEA + .pool +_08169964: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x22 + bl pokemon_setattr + b _08169DEA + .pool +_08169984: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x23 + bl pokemon_setattr + b _08169DEA + .pool +_081699A4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x24 + bl pokemon_setattr + b _08169DEA + .pool +_081699C4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x25 + bl pokemon_setattr + b _08169DEA + .pool +_081699E4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x26 + bl pokemon_setattr + b _08169DEA + .pool +_08169A04: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + ldr r5, =0x02024064 + ldrb r2, [r5] + lsls r2, 9 + adds r2, r7 + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x28 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x2 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x29 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x3 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2A + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x4 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2B + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x5 + adds r2, r0 + adds r0, r4, 0 + b _08169B24 + .pool +_08169A74: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x27 + bl pokemon_setattr + b _08169DEA + .pool +_08169A94: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x28 + bl pokemon_setattr + b _08169DEA + .pool +_08169AB4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x29 + bl pokemon_setattr + b _08169DEA + .pool +_08169AD4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2A + bl pokemon_setattr + b _08169DEA + .pool +_08169AF4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2B + bl pokemon_setattr + b _08169DEA + .pool +_08169B14: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 +_08169B24: + movs r1, 0x2C + bl pokemon_setattr + b _08169DEA + .pool +_08169B34: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0 + bl pokemon_setattr + b _08169DEA + .pool +_08169B54: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x9 + bl pokemon_setattr + b _08169DEA + .pool +_08169B74: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x37 + bl pokemon_setattr + b _08169DEA + .pool +_08169B94: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x38 + bl pokemon_setattr + b _08169DEA + .pool +_08169BB4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x39 + bl pokemon_setattr + b _08169DEA + .pool +_08169BD4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3A + bl pokemon_setattr + b _08169DEA + .pool +_08169BF4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3B + bl pokemon_setattr + b _08169DEA + .pool +_08169C14: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3C + bl pokemon_setattr + b _08169DEA + .pool +_08169C34: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3D + bl pokemon_setattr + b _08169DEA + .pool +_08169C54: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3E + bl pokemon_setattr + b _08169DEA + .pool +_08169C74: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3F + bl pokemon_setattr + b _08169DEA + .pool +_08169C94: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x16 + bl pokemon_setattr + b _08169DEA + .pool +_08169CB4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x17 + bl pokemon_setattr + b _08169DEA + .pool +_08169CD4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x18 + bl pokemon_setattr + b _08169DEA + .pool +_08169CF4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x21 + bl pokemon_setattr + b _08169DEA + .pool +_08169D14: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2F + bl pokemon_setattr + b _08169DEA + .pool +_08169D34: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x30 + bl pokemon_setattr + b _08169DEA + .pool +_08169D54: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x32 + bl pokemon_setattr + b _08169DEA + .pool +_08169D74: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x33 + bl pokemon_setattr + b _08169DEA + .pool +_08169D94: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x34 + bl pokemon_setattr + b _08169DEA + .pool +_08169DB4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x35 + bl pokemon_setattr + b _08169DEA + .pool +_08169DD4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x36 + bl pokemon_setattr +_08169DEA: + ldr r2, =0x0202406e + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + 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_8169424 + + thumb_func_start sub_8169E20 +sub_8169E20: @ 8169E20 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8169E20 + + thumb_func_start sub_8169E2C +sub_8169E2C: @ 8169E2C + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8169E2C + + thumb_func_start sub_8169E38 +sub_8169E38: @ 8169E38 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_8169E38 + + thumb_func_start sub_8169E44 +sub_8169E44: @ 8169E44 + push {r4-r6,lr} + ldr r0, =0x02023064 + ldr r6, =0x02024064 + ldrb r2, [r6] + lsls r1, r2, 9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + bne _08169E80 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x1 + bl move_anim_start_t4 + ldr r0, =0x03005d60 + ldrb r1, [r6] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_8168A20 + str r0, [r1] + b _08169EB6 + .pool +_08169E80: + ldr r5, =0x020241e4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r1, =0x03005d70 + ldrb r0, [r6] + adds r0, r1 + ldrb r0, [r0] + bl sub_8072984 + bl dp01_tbl5_exec_completed +_08169EB6: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8169E44 + + thumb_func_start sub_8169EC8 +sub_8169EC8: @ 8169EC8 + push {r4-r6,lr} + ldr r4, =0x02024064 + ldrb r1, [r4] + movs r0, 0x6 + bl sub_805DF84 + ldrb r0, [r4] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x6 + bl template_build_for_pokemon_or_trainer + ldr r0, =0x0202499c + ldr r1, =gUnknown_08305D2C + ldrb r1, [r1, 0x18] + movs r2, 0x8 + subs r2, r1 + lsls r2, 18 + movs r1, 0xA0 + lsls r1, 15 + adds r2, r1 + asrs r2, 16 + movs r1, 0x50 + movs r3, 0x1E + bl AddObjectToFront + ldr r6, =0x020241e4 + ldrb r1, [r4] + adds r1, r6 + strb r0, [r1] + ldr r5, =0x02020630 + ldrb r3, [r4] + adds r0, r3, r6 + 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 r0, [r4] + adds r0, r6 + 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, [r4] + adds r0, r6 + 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, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r5, 0x1C + adds r0, r5 + ldr r1, =sub_805D7AC + str r1, [r0] + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_816856C + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8169EC8 + + thumb_func_start dp01t_07_6_ +dp01t_07_6_: @ 8169F94 + push {r4-r6,lr} + ldr r4, =0x02024064 + ldrb r1, [r4] + movs r0, 0x6 + bl sub_805DF84 + ldrb r0, [r4] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x6 + bl template_build_for_pokemon_or_trainer + ldr r0, =0x0202499c + ldr r1, =gUnknown_08305D2C + ldrb r1, [r1, 0x18] + movs r2, 0x8 + subs r2, r1 + lsls r2, 18 + movs r1, 0xA0 + lsls r1, 15 + adds r2, r1 + asrs r2, 16 + movs r1, 0x50 + movs r3, 0x1E + bl AddObjectToFront + ldr r6, =0x020241e4 + ldrb r1, [r4] + adds r1, r6 + strb r0, [r1] + ldr r5, =0x02020630 + ldrb r3, [r4] + adds r0, r3, r6 + 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 r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x0000ffa0 + strh r1, [r0, 0x24] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x2 + strh r1, [r0, 0x2E] + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r5, 0x1C + adds r0, r5 + ldr r1, =sub_805D7AC + str r1, [r0] + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8168A90 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_07_6_ + + thumb_func_start sub_816A060 +sub_816A060: @ 816A060 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A060 + + thumb_func_start sub_816A06C +sub_816A06C: @ 816A06C + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A06C + + thumb_func_start sub_816A078 +sub_816A078: @ 816A078 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A078 + + thumb_func_start sub_816A084 +sub_816A084: @ 816A084 + push {r4,r5,lr} + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0x8] + movs r0, 0x4 + strb r0, [r1, 0x8] + ldr r1, =0x020244b9 + movs r0, 0x1 + strb r0, [r1] + ldr r5, =0x02024064 + ldrb r4, [r5] + movs r0, 0x1 + bl battle_get_side_with_given_state + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r4, 0 + movs r3, 0x4 + bl move_anim_start_t4 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_wait_t5 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816A084 + + thumb_func_start sub_816A0D8 +sub_816A0D8: @ 816A0D8 + push {r4,r5,lr} + ldr r1, =0x02023064 + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r1, [r0] + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + strb r1, [r0, 0x8] + ldr r1, =0x020244b9 + movs r0, 0x1 + strb r0, [r1] + ldrb r4, [r5] + movs r0, 0x1 + bl battle_get_side_with_given_state + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r4, 0 + movs r3, 0x4 + bl move_anim_start_t4 + ldr r1, =0x03005d60 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_wait_t5 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816A0D8 + + thumb_func_start sub_816A138 +sub_816A138: @ 816A138 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A138 + + thumb_func_start sub_816A144 +sub_816A144: @ 816A144 + push {r4-r6,lr} + ldr r0, =0x02023064 + mov r12, r0 + ldr r6, =0x02024064 + 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, =0x02038432 + mov r1, r12 + adds r1, 0x3 + adds r2, r1 + ldrb r1, [r2] + strb r1, [r5] + ldr r4, =0x02038408 + 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, =0x02038404 + 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, =0x0203841a + ldrb r1, [r6] + lsls r1, 9 + mov r2, r12 + adds r2, 0xA + adds r1, r2 + ldrb r1, [r1] + strb r1, [r3] + ldr r4, =0x0203841c + 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, =0x02038400 + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0x10 + adds r2, r1 + str r2, [r3] + ldr r3, =0x020244bc + 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 _0816A23C + bl dp01_tbl5_exec_completed + b _0816A25A + .pool +_0816A23C: + ldr r0, =0x020244d0 + 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, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_move_anim_5 + str r1, [r0] +_0816A25A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816A144 + + thumb_func_start bx_move_anim_5 +bx_move_anim_5: @ 816A26C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r2, =0x02023064 + ldr r6, =0x02024064 + ldrb r3, [r6] + lsls r1, r3, 9 + adds r0, r2, 0x1 + mov r9, r0 + adds r0, r1, r0 + ldrb r4, [r0] + adds r2, 0x2 + mov r8, r2 + add r1, r8 + ldrb r0, [r1] + lsls r0, 8 + orrs r4, r0 + ldr r7, =0x020244d0 + 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 _0816A2F6 + cmp r2, 0x1 + bgt _0816A2BC + cmp r2, 0 + beq _0816A2C6 + b _0816A3AC + .pool +_0816A2BC: + cmp r2, 0x2 + beq _0816A320 + cmp r2, 0x3 + beq _0816A370 + b _0816A3AC +_0816A2C6: + ldr r1, [r5] + lsls r0, r3, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0816A2E2 + adds r0, r3, 0 + adds r1, r3, 0 + adds r2, r3, 0 + movs r3, 0x5 + bl move_anim_start_t4 +_0816A2E2: + 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 _0816A3AC +_0816A2F6: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _0816A3AC + 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 _0816A3AC +_0816A320: + ldr r0, =0x020383f8 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =0x020383fd + ldrb r0, [r0] + cmp r0, 0 + bne _0816A3AC + 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 _0816A354 + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x6 + bl move_anim_start_t4 +_0816A354: + 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, 0x3 + strb r1, [r0, 0x4] + b _0816A3AC + .pool +_0816A370: + ldrb r1, [r0] + movs r0, 0x40 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0816A3AC + bl sub_805E394 + ldrb r0, [r6] + lsls r2, r0, 9 + mov r3, r9 + adds r1, r2, r3 + ldrb r1, [r1] + add r2, r8 + 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 dp01_tbl5_exec_completed +_0816A3AC: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end bx_move_anim_5 + + thumb_func_start sub_816A3B8 +sub_816A3B8: @ 816A3B8 + push {r4,lr} + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 9 + ldr r1, =0x02023066 + adds r0, r1 + ldrh r0, [r0] + bl battle_pick_message + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_81685A4 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816A3B8 + + thumb_func_start dp01t_11_5_message_for_player_only +dp01t_11_5_message_for_player_only: @ 816A40C + push {lr} + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0816A428 + bl sub_816A3B8 + b _0816A42C + .pool +_0816A428: + bl dp01_tbl5_exec_completed +_0816A42C: + pop {r0} + bx r0 + thumb_func_end dp01t_11_5_message_for_player_only + + thumb_func_start sub_816A430 +sub_816A430: @ 816A430 + push {lr} + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0816A456 + ldr r0, =0x02022e14 + strh r1, [r0] + ldr r1, =0x02022e16 + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8168444 + str r1, [r0] +_0816A456: + pop {r0} + bx r0 + .pool + thumb_func_end sub_816A430 + + thumb_func_start dp01t_12_1_battle_menu +dp01t_12_1_battle_menu: @ 816A470 + push {r4,lr} + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_816A430 + str r1, [r0] + ldr r0, =gUnknown_085CCA3A + movs r1, 0x2 + bl battle_show_message_maybe + movs r4, 0 +_0816A48A: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8059CF8 + adds r4, 0x1 + cmp r4, 0x3 + ble _0816A48A + ldr r1, =0x020244ac + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_8059CB4 + ldr r0, =gUnknown_085CCA15 + bl get_battle_strings_ + ldr r0, =0x02022e2c + movs r1, 0x1 + bl battle_show_message_maybe + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_12_1_battle_menu + + thumb_func_start sub_816A4D8 +sub_816A4D8: @ 816A4D8 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A4D8 + + thumb_func_start sub_816A4E4 +sub_816A4E4: @ 816A4E4 + push {r4,lr} + ldr r4, =0x0202449c + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x95 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0816A522 + cmp r0, 0x1 + bgt _0816A504 + cmp r0, 0 + beq _0816A50A + b _0816A574 + .pool +_0816A504: + cmp r0, 0x2 + beq _0816A550 + b _0816A574 +_0816A50A: + bl sub_805C210 + ldr r1, [r4] + adds r1, 0x95 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0x97 + movs r1, 0x50 + strb r1, [r0] + b _0816A574 +_0816A522: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0816A574 + ldr r0, =0x02022e14 + strh r1, [r0] + ldr r1, =0x02022e16 + movs r2, 0xA0 + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, [r4] + adds r1, 0x95 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0816A574 + .pool +_0816A550: + adds r1, 0x97 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + bne _0816A574 + movs r0, 0x5 + bl audio_play + movs r2, 0x80 + lsls r2, 1 + movs r0, 0x1 + movs r1, 0xA + bl dp01_build_cmdbuf_x21_a_bb + bl dp01_tbl5_exec_completed +_0816A574: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816A4E4 + + thumb_func_start sub_816A57C +sub_816A57C: @ 816A57C + push {lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x03005d60 + ldr r2, =0x02024064 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_81685D4 + str r1, [r0] + ldr r1, =0x020244b8 + ldrb r0, [r2] + strb r0, [r1] + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_816A57C + + thumb_func_start sub_816A5BC +sub_816A5BC: @ 816A5BC + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A5BC + + thumb_func_start sub_816A5C8 +sub_816A5C8: @ 816A5C8 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A5C8 + + thumb_func_start sub_816A5D4 +sub_816A5D4: @ 816A5D4 + 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, =0x02023064 + ldr r0, =0x02024064 + 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 _0816A664 + ldr r6, =0x0202406e + lsls r0, r4, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + movs r1, 0x3A + bl pokemon_getattr + 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 pokemon_getattr + adds r3, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, =0x03005d70 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + mov r2, r8 + bl sub_807294C + b _0816A69E + .pool +_0816A664: + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3A + bl pokemon_getattr + adds r2, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r4, =0x03005d70 + 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 +_0816A69E: + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8168934 + 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_816A5D4 + + thumb_func_start sub_816A6D4 +sub_816A6D4: @ 816A6D4 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A6D4 + + thumb_func_start sub_816A6E0 +sub_816A6E0: @ 816A6E0 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A6E0 + + thumb_func_start sub_816A6EC +sub_816A6EC: @ 816A6EC + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A6EC + + thumb_func_start sub_816A6F8 +sub_816A6F8: @ 816A6F8 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A6F8 + + thumb_func_start sub_816A704 +sub_816A704: @ 816A704 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A704 + + thumb_func_start sub_816A710 +sub_816A710: @ 816A710 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A710 + + thumb_func_start sub_816A71C +sub_816A71C: @ 816A71C + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A71C + + thumb_func_start sub_816A728 +sub_816A728: @ 816A728 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A728 + + thumb_func_start sub_816A734 +sub_816A734: @ 816A734 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A734 + + thumb_func_start sub_816A740 +sub_816A740: @ 816A740 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A740 + + thumb_func_start sub_816A74C +sub_816A74C: @ 816A74C + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A74C + + thumb_func_start sub_816A758 +sub_816A758: @ 816A758 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A758 + + thumb_func_start sub_816A764 +sub_816A764: @ 816A764 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A764 + + thumb_func_start sub_816A770 +sub_816A770: @ 816A770 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A770 + + thumb_func_start sub_816A77C +sub_816A77C: @ 816A77C + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A77C + + thumb_func_start sub_816A788 +sub_816A788: @ 816A788 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A788 + + thumb_func_start sub_816A794 +sub_816A794: @ 816A794 + push {r4,lr} + ldr r3, =0x02020630 + ldr r2, =0x020241e4 + ldr r4, =0x02024064 + 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 _0816A7C8 + bl dp01_tbl5_exec_completed + b _0816A7F2 + .pool +_0816A7C8: + ldr r1, =0x020244b9 + 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, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =bx_blink_t5 + str r1, [r0] +_0816A7F2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816A794 + + thumb_func_start sub_816A804 +sub_816A804: @ 816A804 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816A804 + + thumb_func_start sub_816A810 +sub_816A810: @ 816A810 + push {lr} + ldr r2, =0x02023064 + ldr r0, =0x02024064 + ldrb r1, [r0] + 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 + bl audio_play + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_816A810 + + thumb_func_start sub_816A840 +sub_816A840: @ 816A840 + push {r4,r5,lr} + ldr r4, =0x02023064 + ldr r5, =0x02024064 + ldrb r0, [r5] + lsls r3, r0, 9 + adds r0, r4, 0x3 + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _0816A87C + 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 song_play_for_text + b _0816A890 + .pool +_0816A87C: + 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 fanfare_play +_0816A890: + bl dp01_tbl5_exec_completed + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_816A840 + + thumb_func_start sub_816A89C +sub_816A89C: @ 816A89C + push {lr} + ldr r1, =0x0202406e + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x19 + bl cry_related + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end sub_816A89C + + thumb_func_start dp01t_2E_5_battle_intro +dp01t_2E_5_battle_intro: @ 816A8D8 + push {lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, =0x020243fc + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_2E_5_battle_intro + + thumb_func_start sub_816A90C +sub_816A90C: @ 816A90C + push {r4-r7,lr} + ldr r6, =0x020241e4 + ldr r7, =0x02024064 + ldrb r0, [r7] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =0x02020630 + adds r0, r5 + bl oamt_add_pos2_onto_pos1 + ldrb r0, [r7] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x32 + strh r1, [r0, 0x2E] + ldrb r0, [r7] + 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, [r7] + 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, [r7] + 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 r2, [r7] + adds r0, r2, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x38] + ldrb r0, [r7] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =sub_805CC00 + bl oamt_set_x3A_32 + ldrb r0, [r7] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x1 + bl StartObjectImageAnim + ldr r0, =0x0000d6f8 + bl AllocObjectPalette + adds r4, r0, 0 + lsls r4, 24 + ldr r0, =gTrainerBackPicPaletteTable + ldr r0, [r0, 0x30] + lsrs r4, 20 + movs r2, 0x80 + lsls r2, 1 + adds r1, r4, r2 + movs r2, 0x20 + bl decompress_palette + ldrb r0, [r7] + adds r0, r6 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r4 + strb r0, [r1, 0x5] + ldr r0, =sub_816AC04 + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + ldrb r0, [r7] + strh r0, [r1, 0x8] + ldr r3, =0x020244d0 + ldr r0, [r3] + ldrb r2, [r7] + 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 _0816AA24 + ldr r0, =0x020244b4 + 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] +_0816AA24: + ldr r0, [r3] + ldr r2, [r0, 0x8] + ldrb r0, [r2, 0x9] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x9] + ldr r1, =0x03005d60 + ldrb r0, [r7] + lsls r0, 2 + adds r0, r1 + ldr r1, =nullsub_21 + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816A90C + + thumb_func_start sub_816AA80 +sub_816AA80: @ 816AA80 + 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 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r6, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x2] + ldr r0, =0x0202406e + lsls r2, r6, 1 + adds r2, r0 + ldr r0, =0x02023064 + 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, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, =sub_805D714 + bl object_new_hidden_with_callback + ldr r1, =0x03005d7c + mov r9, r1 + add r9, r6 + mov r1, r9 + strb r0, [r1] + adds r0, r6, 0 + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl sub_806A068 + ldr r0, =0x0202499c + 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 AddObjectToFront + ldr r4, =0x020241e4 + adds r4, r6, r4 + strb r0, [r4] + ldr r5, =0x02020630 + 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, =0x020244e4 + adds r6, r1 + ldrb r1, [r6] + bl StartObjectImageAnim + 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, =DummyObjectCallback + 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_816AA80 + + thumb_func_start sub_816AC04 +sub_816AC04: @ 816AC04 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0xA] + movs r3, 0xA + ldrsh r0, [r1, r3] + cmp r0, 0x1E + bgt _0816AC28 + adds r0, r2, 0x1 + strh r0, [r1, 0xA] + b _0816AC5E + .pool +_0816AC28: + ldr r4, =0x02024064 + ldrb r5, [r4] + ldrh r0, [r1, 0x8] + strb r0, [r4] + ldr r0, =0x02023064 + ldrb r1, [r4] + lsls r2, r1, 9 + adds r0, 0x1 + adds r2, r0 + ldr r0, =0x0202406e + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + strb r0, [r2] + ldrb r0, [r4] + bl sub_816AA80 + ldr r1, =0x03005d60 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_816864C + str r1, [r0] + strb r5, [r4] + adds r0, r6, 0 + bl DestroyTask +_0816AC5E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816AC04 + + thumb_func_start sub_816AC78 +sub_816AC78: @ 816AC78 + push {r4,r5,lr} + ldr r1, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0816ACA8 + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0816ACA8 + bl dp01_tbl5_exec_completed + b _0816ACE6 + .pool +_0816ACA8: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r5, =0x02024064 + 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 r4, r0, 9 + ldr r3, =0x02023068 + adds r1, r4, r3 + subs r2, r3, 0x3 + adds r2, r4, r2 + ldrb r2, [r2] + subs r3, 0x2 + adds r4, r3 + ldrb r3, [r4] + bl sub_80735DC + ldr r2, =0x020244b4 + ldrb r1, [r5] + adds r1, r2 + strb r0, [r1] + bl dp01_tbl5_exec_completed +_0816ACE6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816AC78 + + thumb_func_start sub_816ACFC +sub_816ACFC: @ 816ACFC + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816ACFC + + thumb_func_start sub_816AD08 +sub_816AD08: @ 816AD08 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816AD08 + + thumb_func_start sub_816AD14 +sub_816AD14: @ 816AD14 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816AD14 + + thumb_func_start sub_816AD20 +sub_816AD20: @ 816AD20 + push {r4-r6,lr} + sub sp, 0x4 + ldr r5, =0x02023064 + ldr r6, =0x02024064 + 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 _0816AD60 + bl dp01_tbl5_exec_completed + b _0816AD6C + .pool +_0816AD60: + ldr r0, =0x03005d60 + ldrb r1, [r6] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_8168AC8 + str r0, [r1] +_0816AD6C: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816AD20 + + thumb_func_start sub_816AD7C +sub_816AD7C: @ 816AD7C + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816AD7C + + thumb_func_start sub_816AD88 +sub_816AD88: @ 816AD88 + push {lr} + bl dp01_tbl5_exec_completed + pop {r0} + bx r0 + thumb_func_end sub_816AD88 + + thumb_func_start sub_816AD94 +sub_816AD94: @ 816AD94 + push {r4,lr} + ldr r2, =0x0202433a + ldr r1, =0x02023064 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + movs r0, 0x5 + bl sub_80A2F50 + movs r0, 0x3 + bl sub_80A2390 + bl dp01_tbl5_exec_completed + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x6 + ands r0, r1 + cmp r0, 0x2 + bne _0816ADD0 + ldr r0, =0x03005d60 + ldrb r1, [r4] + lsls r1, 2 + adds r1, r0 + ldr r0, =sub_80587B0 + str r0, [r1] +_0816ADD0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816AD94 + + thumb_func_start nullsub_118 +nullsub_118: @ 816ADF0 + bx lr + thumb_func_end nullsub_118 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_816F318.s b/asm/rom_816F318.s new file mode 100644 index 000000000..bdb05aba5 --- /dev/null +++ b/asm/rom_816F318.s @@ -0,0 +1,15475 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_816F318 +sub_816F318: @ 816F318 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0xBF + ble _0816F394 + ldrh r1, [r4, 0x34] + movs r2, 0x34 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0816F336 + subs r0, r1, 0x1 + strh r0, [r4, 0x34] + b _0816F39A +_0816F336: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x30] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x32] + str r1, [sp] + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + movs r0, 0x32 + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 5 + subs r0, r1 + movs r1, 0x64 + bl __divsi3 + strh r0, [r4, 0x32] + movs r2, 0x32 + ldrsh r1, [r4, r2] + adds r0, r1, 0 + subs r0, 0xC0 + cmp r0, 0 + bge _0816F378 + adds r0, 0x7F +_0816F378: + asrs r0, 7 + adds r0, 0x9 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xF + bls _0816F386 + movs r0, 0xF +_0816F386: + lsls r2, r0, 4 + ldrb r1, [r4, 0x5] + movs r0, 0xF + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x5] + b _0816F39A +_0816F394: + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0816F39A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816F318 + + thumb_func_start sub_816F3A4 +sub_816F3A4: @ 816F3A4 + push {r4,lr} + adds r4, r0, 0 + ldr r2, =0x02020630 + movs r1, 0x3C + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + movs r3, 0x3C + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _0816F420 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r3, [r4, 0x22] + adds r0, r3 + strh r0, [r4, 0x22] + adds r0, r4, 0 + movs r1, 0x3 + bl StartObjectImageAnim + movs r0, 0x80 + lsls r0, 3 + strh r0, [r4, 0x32] + ldrh r1, [r4, 0x30] + movs r0, 0x3 + ands r0, r1 + lsls r0, 3 + strh r0, [r4, 0x34] + ldr r0, =sub_816F318 + str r0, [r4, 0x1C] + ldrb r1, [r4, 0x1] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x3] + movs r1, 0xC0 + orrs r0, r1 + strb r0, [r4, 0x3] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0x3 + movs r3, 0x2 + bl CalcVecFromObjectCenterToObjectUpperLeft + b _0816F44C + .pool +_0816F420: + ldrh r0, [r1, 0x24] + strh r0, [r4, 0x24] + movs r0, 0x3C + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x26] + strh r0, [r4, 0x26] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x20] + strh r0, [r4, 0x20] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x22] + strh r0, [r4, 0x22] +_0816F44C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816F3A4 + + thumb_func_start sub_816F454 +sub_816F454: @ 816F454 + push {lr} + adds r1, r0, 0 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _0816F464 + ldr r0, =sub_816F46C + str r0, [r1, 0x1C] +_0816F464: + pop {r0} + bx r0 + .pool + thumb_func_end sub_816F454 + + thumb_func_start sub_816F46C +sub_816F46C: @ 816F46C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r7, r0, 0 + ldrh r4, [r7, 0x20] + movs r1, 0x20 + ldrsh r0, [r7, r1] + cmp r0, 0x74 + bgt _0816F4AC + ldrh r0, [r7, 0x26] + ldrh r1, [r7, 0x22] + adds r0, r1 + movs r1, 0 + strh r0, [r7, 0x22] + strh r1, [r7, 0x26] + adds r0, r4, 0x4 + strh r0, [r7, 0x20] + ldr r0, =0x0000fffc + strh r0, [r7, 0x24] + movs r0, 0x80 + strh r0, [r7, 0x36] + ldr r0, =sub_816F5B4 + str r0, [r7, 0x1C] + b _0816F59E + .pool +_0816F4AC: + ldrh r1, [r7, 0x36] + ldr r5, =gUnknown_08329F40 + lsls r0, r1, 24 + lsrs r0, 23 + adds r0, r5 + ldrh r2, [r0] + adds r0, r1, 0 + adds r0, 0x40 + lsls r0, 24 + lsrs r0, 23 + adds r0, r5 + ldrh r3, [r0] + adds r1, 0x2 + strh r1, [r7, 0x36] + lsls r2, 16 + asrs r0, r2, 16 + cmp r0, 0 + bge _0816F4D2 + adds r0, 0x1F +_0816F4D2: + asrs r0, 5 + strh r0, [r7, 0x26] + subs r0, r4, 0x1 + strh r0, [r7, 0x20] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0816F4E8 + ldrh r0, [r7, 0x22] + adds r0, 0x1 + strh r0, [r7, 0x22] +_0816F4E8: + lsls r0, r3, 16 + asrs r0, 16 + negs r0, r0 + cmp r0, 0 + bge _0816F4F4 + adds r0, 0xF +_0816F4F4: + lsls r1, r0, 12 + lsrs r1, 16 + ldrh r4, [r7, 0x32] + ldrh r3, [r7, 0x34] + adds r0, r1, 0 + subs r0, 0x10 + lsls r0, 24 + lsrs r0, 23 + adds r0, r5 + ldrh r2, [r0] + adds r1, 0x30 + lsls r1, 24 + lsrs r1, 23 + adds r1, r5 + movs r0, 0 + ldrsh r1, [r1, r0] + adds r0, r1, 0 + muls r0, r4 + cmp r0, 0 + bge _0816F51E + adds r0, 0xFF +_0816F51E: + lsls r0, 8 + lsrs r0, 16 + mov r8, r0 + lsls r0, r2, 16 + asrs r2, r0, 16 + negs r0, r2 + muls r0, r3 + cmp r0, 0 + bge _0816F532 + adds r0, 0xFF +_0816F532: + lsls r0, 8 + lsrs r0, 16 + mov r10, r0 + adds r0, r2, 0 + muls r0, r4 + cmp r0, 0 + bge _0816F542 + adds r0, 0xFF +_0816F542: + lsls r0, 8 + lsrs r5, r0, 16 + adds r0, r1, 0 + muls r0, r3 + cmp r0, 0 + bge _0816F550 + adds r0, 0xFF +_0816F550: + lsls r6, r0, 8 + lsrs r6, 16 + ldrh r0, [r7, 0x30] + lsls r0, 24 + lsrs r0, 24 + str r3, [sp] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + ldrh r0, [r7, 0x30] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r5 + mov r1, r10 + lsls r5, r1, 16 + lsrs r3, r5, 16 + lsls r4, r6, 16 + str r6, [sp] + mov r1, r8 + mov r2, r9 + bl SetSpriteTransformationMatrix + ldrh r0, [r7, 0x30] + adds r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + lsls r5, 1 + lsrs r5, 16 + lsls r4, 1 + lsrs r4, 16 + str r4, [sp] + mov r1, r8 + mov r2, r9 + adds r3, r5, 0 + bl SetSpriteTransformationMatrix +_0816F59E: + 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_816F46C + + thumb_func_start sub_816F5B4 +sub_816F5B4: @ 816F5B4 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x3A] + adds r1, 0x40 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + ldrh r0, [r4, 0x30] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x3A] + adds r1, 0x40 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + ldrh r0, [r4, 0x30] + adds r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x3A] + adds r1, 0x40 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + ldrh r1, [r4, 0x36] + movs r2, 0x36 + ldrsh r0, [r4, r2] + cmp r0, 0x40 + beq _0816F64C + adds r0, r1, 0 + subs r0, 0x8 + strh r0, [r4, 0x36] + ldrh r0, [r4, 0x36] + adds r1, r0, 0 + ldr r2, =gUnknown_08329F40 + adds r0, 0x40 + lsls r0, 24 + lsrs r0, 23 + adds r0, r2 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0 + bge _0816F62E + adds r0, 0x3F +_0816F62E: + asrs r0, 6 + strh r0, [r4, 0x24] + lsls r0, r1, 24 + lsrs r0, 23 + adds r0, r2 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _0816F642 + adds r0, 0x3F +_0816F642: + asrs r0, 6 + strh r0, [r4, 0x26] + b _0816F654 + .pool +_0816F64C: + movs r0, 0 + strh r0, [r4, 0x36] + ldr r0, =sub_816F660 + str r0, [r4, 0x1C] +_0816F654: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816F5B4 + + thumb_func_start sub_816F660 +sub_816F660: @ 816F660 + push {r4,lr} + adds r1, r0, 0 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0x2 + beq _0816F6C0 + ldrh r0, [r1, 0x36] + adds r0, 0x8 + strh r0, [r1, 0x36] + ldr r3, =gUnknown_08329F40 + lsls r0, 24 + lsrs r0, 23 + adds r0, r3 + movs r4, 0 + ldrsh r0, [r0, r4] + cmp r0, 0 + bge _0816F684 + adds r0, 0xF +_0816F684: + asrs r0, 4 + adds r0, 0x40 + lsls r0, 16 + lsrs r2, r0, 16 + adds r0, r2, 0 + adds r0, 0x40 + lsls r0, 24 + lsrs r0, 23 + adds r0, r3 + movs r4, 0 + ldrsh r0, [r0, r4] + cmp r0, 0 + bge _0816F6A0 + adds r0, 0x3F +_0816F6A0: + asrs r0, 6 + strh r0, [r1, 0x24] + lsls r0, r2, 24 + lsrs r0, 23 + adds r0, r3 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bge _0816F6B4 + adds r0, 0x3F +_0816F6B4: + asrs r0, 6 + strh r0, [r1, 0x26] + b _0816F6C4 + .pool +_0816F6C0: + ldr r0, =sub_816F6D0 + str r0, [r1, 0x1C] +_0816F6C4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816F660 + + thumb_func_start sub_816F6D0 +sub_816F6D0: @ 816F6D0 + push {r4,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x22] + movs r0, 0x22 + ldrsh r1, [r4, r0] + movs r3, 0x38 + ldrsh r0, [r4, r3] + cmp r1, r0 + bge _0816F6E8 + adds r0, r2, 0x4 + strh r0, [r4, 0x22] + b _0816F744 +_0816F6E8: + movs r0, 0x1 + strh r0, [r4, 0x3C] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r3, [r4, 0x22] + adds r0, r3 + strh r0, [r4, 0x22] + adds r0, r4, 0 + movs r1, 0x3 + bl StartObjectImageAnim + movs r0, 0x80 + lsls r0, 3 + strh r0, [r4, 0x32] + ldrh r1, [r4, 0x30] + movs r0, 0x3 + ands r0, r1 + lsls r0, 3 + strh r0, [r4, 0x34] + ldr r0, =sub_816F318 + str r0, [r4, 0x1C] + ldrb r1, [r4, 0x1] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x3] + movs r1, 0xC0 + orrs r0, r1 + strb r0, [r4, 0x3] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0x3 + movs r3, 0x2 + bl CalcVecFromObjectCenterToObjectUpperLeft +_0816F744: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816F6D0 + + thumb_func_start sub_816F750 +sub_816F750: @ 816F750 + push {r4,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x22] + movs r0, 0x22 + ldrsh r1, [r4, r0] + movs r3, 0x38 + ldrsh r0, [r4, r3] + cmp r1, r0 + bge _0816F768 + adds r0, r2, 0x4 + strh r0, [r4, 0x22] + b _0816F7C4 +_0816F768: + movs r0, 0x1 + strh r0, [r4, 0x3C] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r3, [r4, 0x22] + adds r0, r3 + strh r0, [r4, 0x22] + adds r0, r4, 0 + movs r1, 0x3 + bl StartObjectImageAnim + movs r0, 0x80 + lsls r0, 3 + strh r0, [r4, 0x32] + ldrh r1, [r4, 0x30] + movs r0, 0x3 + ands r0, r1 + lsls r0, 3 + strh r0, [r4, 0x34] + ldr r0, =sub_816F318 + str r0, [r4, 0x1C] + ldrb r1, [r4, 0x1] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x3] + movs r1, 0xC0 + orrs r0, r1 + strb r0, [r4, 0x3] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0x3 + movs r3, 0x2 + bl CalcVecFromObjectCenterToObjectUpperLeft +_0816F7C4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816F750 + + thumb_func_start sub_816F7D0 +sub_816F7D0: @ 816F7D0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r6, [sp, 0x34] + ldr r0, [sp, 0x38] + mov r8, r0 + lsls r4, 16 + lsls r5, 16 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0x8] + lsls r3, 16 + lsrs r3, 16 + str r3, [sp, 0xC] + lsls r6, 16 + lsrs r6, 16 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + ldr r0, =gUnknown_085E4D64 + lsrs r2, r4, 16 + mov r10, r2 + asrs r4, 16 + lsrs r1, r5, 16 + str r1, [sp, 0x4] + asrs r5, 16 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, =0x02020630 + mov r9, r2 + lsls r0, r7, 4 + adds r0, r7 + lsls r5, r0, 2 + adds r4, r5, r2 + movs r0, 0 + strh r0, [r4, 0x2E] + strh r0, [r4, 0x3C] + mov r0, sp + ldrh r0, [r0, 0xC] + strh r0, [r4, 0x30] + mov r1, sp + ldrh r1, [r1, 0x8] + strh r1, [r4, 0x32] + mov r2, sp + ldrh r2, [r2, 0x8] + strh r2, [r4, 0x34] + strh r6, [r4, 0x38] + mov r0, sp + ldrh r0, [r0, 0x8] + strh r0, [r4, 0x3A] + ldrb r0, [r4, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r4, 0x1] + movs r0, 0x1F + ldr r1, [sp, 0xC] + ands r1, r0 + lsls r1, 1 + ldrb r2, [r4, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x3] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x2 + movs r3, 0x2 + bl CalcVecFromObjectCenterToObjectUpperLeft + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectImageAnim + mov r1, r8 + cmp r1, 0 + bne _0816F898 + mov r0, r9 + adds r0, 0x1C + adds r0, r5, r0 + ldr r1, =sub_816F454 + b _0816F8A0 + .pool +_0816F898: + mov r0, r9 + adds r0, 0x1C + adds r0, r5, r0 + ldr r1, =sub_816F750 +_0816F8A0: + str r1, [r0] + str r7, [sp, 0x10] + mov r2, r10 + lsls r2, 16 + asrs r2, 16 + mov r10, r2 + ldr r0, [sp, 0x4] + lsls r0, 16 + asrs r0, 16 + mov r8, r0 + ldr r0, =gUnknown_085E4D64 + mov r1, r10 + mov r2, r8 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + ldr r5, =0x02020630 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + adds r0, r4, r5 + mov r1, sp + ldrh r1, [r1, 0x10] + strh r1, [r0, 0x3C] + ldr r2, [sp, 0xC] + adds r2, 0x1 + mov r9, r2 + strh r2, [r0, 0x30] + ldrb r1, [r0, 0x1] + movs r2, 0x3 + orrs r1, r2 + strb r1, [r0, 0x1] + mov r2, r9 + movs r1, 0x1F + ands r2, r1 + lsls r2, 1 + ldrb r3, [r0, 0x3] + movs r6, 0x3F + negs r6, r6 + adds r1, r6, 0 + ands r1, r3 + orrs r1, r2 + strb r1, [r0, 0x3] + movs r1, 0 + movs r2, 0x2 + movs r3, 0x2 + bl CalcVecFromObjectCenterToObjectUpperLeft + ldr r2, =0x0202064c + adds r4, r2 + ldr r0, =sub_816F3A4 + str r0, [r4] + ldr r0, =gUnknown_085E4D64 + mov r1, r10 + mov r2, r8 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + adds r5, r4, r5 + mov r1, sp + ldrh r1, [r1, 0x10] + strh r1, [r5, 0x3C] + ldr r2, [sp, 0xC] + adds r2, 0x2 + mov r8, r2 + strh r2, [r5, 0x30] + adds r0, r5, 0 + movs r1, 0x1 + bl StartObjectImageAnim + ldrb r0, [r5, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r5, 0x1] + mov r0, r8 + movs r2, 0x1F + ands r0, r2 + lsls r0, 1 + ldrb r1, [r5, 0x3] + ands r6, r1 + orrs r6, r0 + strb r6, [r5, 0x3] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x2 + movs r3, 0x2 + bl CalcVecFromObjectCenterToObjectUpperLeft + ldr r0, =0x0202064c + adds r4, r0 + ldr r1, =sub_816F3A4 + str r1, [r4] + ldr r2, [sp, 0xC] + lsls r0, r2, 24 + lsrs r0, 24 + ldr r5, [sp, 0x8] + adds r5, 0x20 + lsls r4, r5, 16 + lsrs r4, 16 + str r4, [sp] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + mov r0, r9 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + str r4, [sp] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r5, 17 + lsrs r5, 16 + str r5, [sp] + mov r0, r8 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + ldr r0, [sp, 0x10] + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_816F7D0 + + thumb_func_start sub_816F9D4 +sub_816F9D4: @ 816F9D4 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bhi _0816FA62 + lsls r0, 2 + ldr r1, =_0816F9F0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0816F9F0: + .4byte _0816FA04 + .4byte _0816FA12 + .4byte _0816FA30 + .4byte _0816FA62 + .4byte _0816FA50 +_0816FA04: + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnimIfDifferent + ldrh r0, [r4, 0x20] + subs r0, 0x1 + b _0816FA60 +_0816FA12: + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnimIfDifferent + ldr r0, =0x030062a0 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0816FAAA + ldrh r0, [r4, 0x20] + adds r0, 0x1 + b _0816FA60 + .pool +_0816FA30: + ldrh r2, [r4, 0x20] + movs r1, 0x20 + ldrsh r0, [r4, r1] + cmp r0, 0x78 + ble _0816FA46 + ldr r0, =0x030062a0 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + beq _0816FA6E +_0816FA46: + adds r0, r2, 0x1 + b _0816FA60 + .pool +_0816FA50: + ldrh r2, [r4, 0x20] + movs r0, 0x20 + ldrsh r1, [r4, r0] + movs r0, 0x20 + negs r0, r0 + cmp r1, r0 + ble _0816FA62 + subs r0, r2, 0x2 +_0816FA60: + strh r0, [r4, 0x20] +_0816FA62: + ldr r0, =0x030062a0 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0816FAAA +_0816FA6E: + movs r1, 0x26 + ldrsh r5, [r4, r1] + cmp r5, 0 + beq _0816FA80 + movs r0, 0 + strh r0, [r4, 0x26] + b _0816FAAA + .pool +_0816FA80: + bl GenerateRandomNumber + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x1 + beq _0816FAA8 + cmp r1, 0x1 + bgt _0816FA96 + cmp r1, 0 + beq _0816FA9E + b _0816FAAA +_0816FA96: + cmp r1, 0x3 + bgt _0816FAAA + strh r5, [r4, 0x26] + b _0816FAAA +_0816FA9E: + ldr r0, =0x0000ffff + strh r0, [r4, 0x26] + b _0816FAAA + .pool +_0816FAA8: + strh r1, [r4, 0x26] +_0816FAAA: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_816F9D4 + + thumb_func_start sub_816FAB0 +sub_816FAB0: @ 816FAB0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0816FACA + cmp r0, 0x1 + ble _0816FB12 + cmp r0, 0x2 + beq _0816FAEA + cmp r0, 0x3 + beq _0816FB04 + b _0816FB12 +_0816FACA: + movs r2, 0x24 + ldrsh r0, [r4, r2] + movs r2, 0x20 + ldrsh r1, [r4, r2] + adds r0, r1 + ldr r1, =0x0000012f + cmp r0, r1 + bgt _0816FAE4 + ldrh r0, [r4, 0x24] + adds r0, 0x8 + b _0816FB10 + .pool +_0816FAE4: + movs r0, 0x2 + strh r0, [r4, 0x2E] + b _0816FB12 +_0816FAEA: + movs r1, 0x24 + ldrsh r0, [r4, r1] + movs r2, 0x20 + ldrsh r1, [r4, r2] + adds r0, r1 + cmp r0, 0x78 + ble _0816FAFE + ldrh r0, [r4, 0x24] + subs r0, 0x1 + b _0816FB10 +_0816FAFE: + movs r0, 0x3 + strh r0, [r4, 0x2E] + b _0816FB12 +_0816FB04: + ldrh r1, [r4, 0x24] + movs r2, 0x24 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _0816FB12 + subs r0, r1, 0x2 +_0816FB10: + strh r0, [r4, 0x24] +_0816FB12: + ldrh r0, [r4, 0x30] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x8 + bl sine + ldr r1, =0x0203bccc + ldrh r1, [r1] + subs r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x4 + strh r0, [r4, 0x30] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816FAB0 + + thumb_func_start sub_816FB38 +sub_816FB38: @ 816FB38 + push {r4-r6,lr} + adds r6, r0, 0 + movs r1, 0x2E + ldrsh r0, [r6, r1] + cmp r0, 0x5 + bls _0816FB46 + b _0816FD38 +_0816FB46: + lsls r0, 2 + ldr r1, =_0816FB54 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0816FB54: + .4byte _0816FB6C + .4byte _0816FB94 + .4byte _0816FBB4 + .4byte _0816FC5C + .4byte _0816FCC4 + .4byte _0816FCF4 +_0816FB6C: + ldrh r1, [r6, 0x30] + movs r2, 0x30 + ldrsh r0, [r6, r2] + cmp r0, 0 + beq _0816FB7C + subs r0, r1, 0x1 + strh r0, [r6, 0x30] + b _0816FD38 +_0816FB7C: + adds r2, r6, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x5 + negs r1, r1 + ands r1, r0 + strb r1, [r2] + adds r0, r6, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + b _0816FCE6 +_0816FB94: + ldr r0, =0x030062a0 + ldr r0, [r0] + cmp r0, 0x90 + beq _0816FB9E + b _0816FD38 +_0816FB9E: + ldrh r0, [r6, 0x2E] + adds r0, 0x1 + strh r0, [r6, 0x2E] + movs r0, 0x9 + strh r0, [r6, 0x30] + movs r0, 0x2 + strh r0, [r6, 0x34] + b _0816FD38 + .pool +_0816FBB4: + ldrh r1, [r6, 0x34] + movs r2, 0x34 + ldrsh r0, [r6, r2] + cmp r0, 0 + bne _0816FC66 + movs r0, 0x2 + strh r0, [r6, 0x34] + movs r1, 0x30 + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _0816FC14 + lsls r0, 1 + ldr r4, =gUnknown_08D85C50 + adds r0, r4 + ldr r5, =0x02037d52 + adds r1, r5, 0 + movs r2, 0x1 + bl CpuSet + movs r1, 0x30 + ldrsh r0, [r6, r1] + lsls r0, 1 + adds r1, r4, 0 + adds r1, 0x20 + adds r0, r1 + adds r1, r5, 0 + subs r1, 0x16 + movs r2, 0x1 + bl CpuSet + movs r2, 0x30 + ldrsh r0, [r6, r2] + lsls r0, 1 + adds r4, 0x40 + adds r0, r4 + subs r5, 0xA + adds r1, r5, 0 + movs r2, 0x1 + bl CpuSet + ldrh r0, [r6, 0x30] + subs r0, 0x1 + strh r0, [r6, 0x30] + b _0816FD38 + .pool +_0816FC14: + movs r1, 0x30 + ldrsh r0, [r6, r1] + lsls r0, 1 + ldr r4, =gUnknown_08D85C50 + adds r0, r4 + ldr r5, =0x02037d52 + adds r1, r5, 0 + movs r2, 0x1 + bl CpuSet + movs r2, 0x30 + ldrsh r0, [r6, r2] + lsls r0, 1 + adds r1, r4, 0 + adds r1, 0x20 + adds r0, r1 + adds r1, r5, 0 + subs r1, 0x16 + movs r2, 0x1 + bl CpuSet + movs r1, 0x30 + ldrsh r0, [r6, r1] + lsls r0, 1 + adds r4, 0x40 + adds r0, r4 + subs r5, 0xA + adds r1, r5, 0 + movs r2, 0x1 + bl CpuSet + b _0816FCE6 + .pool +_0816FC5C: + ldrh r1, [r6, 0x34] + movs r2, 0x34 + ldrsh r0, [r6, r2] + cmp r0, 0 + beq _0816FC6C +_0816FC66: + subs r0, r1, 0x1 + strh r0, [r6, 0x34] + b _0816FD38 +_0816FC6C: + movs r0, 0x2 + strh r0, [r6, 0x34] + movs r1, 0x30 + ldrsh r0, [r6, r1] + cmp r0, 0x9 + bgt _0816FCE6 + lsls r0, 1 + ldr r4, =gUnknown_08D85C50 + adds r0, r4 + ldr r5, =0x02037d52 + adds r1, r5, 0 + movs r2, 0x1 + bl CpuSet + movs r1, 0x30 + ldrsh r0, [r6, r1] + lsls r0, 1 + adds r1, r4, 0 + adds r1, 0x20 + adds r0, r1 + adds r1, r5, 0 + subs r1, 0x16 + movs r2, 0x1 + bl CpuSet + movs r2, 0x30 + ldrsh r0, [r6, r2] + lsls r0, 1 + adds r4, 0x40 + adds r0, r4 + subs r5, 0xA + adds r1, r5, 0 + movs r2, 0x1 + bl CpuSet + ldrh r0, [r6, 0x30] + adds r0, 0x1 + strh r0, [r6, 0x30] + b _0816FD38 + .pool +_0816FCC4: + ldr r0, =0x030062a0 + ldr r1, [r0] + movs r0, 0x88 + lsls r0, 1 + cmp r1, r0 + bne _0816FD38 + adds r0, r6, 0 + movs r1, 0x2 + bl StartObjectRotScalAnim + ldrb r1, [r6, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r6, 0x1] +_0816FCE6: + ldrh r0, [r6, 0x2E] + adds r0, 0x1 + strh r0, [r6, 0x2E] + b _0816FD38 + .pool +_0816FCF4: + ldr r1, =gUnknown_085E4F48 + movs r2, 0x32 + ldrsh r0, [r6, r2] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + ldrh r1, [r6, 0x34] + adds r0, r1 + strh r0, [r6, 0x34] + movs r2, 0x34 + ldrsh r0, [r6, r2] + movs r1, 0xFF + lsls r1, 8 + ands r0, r1 + asrs r0, 8 + strh r0, [r6, 0x24] + movs r1, 0x32 + ldrsh r0, [r6, r1] + cmp r0, 0x3 + bgt _0816FD24 + movs r2, 0x24 + ldrsh r0, [r6, r2] + negs r0, r0 + strh r0, [r6, 0x24] +_0816FD24: + adds r0, r6, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0816FD38 + adds r0, r6, 0 + bl RemoveObjectAndFreeTiles +_0816FD38: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816FB38 + + thumb_func_start sub_816FD44 +sub_816FD44: @ 816FD44 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0816FD7C + cmp r0, 0x1 + bgt _0816FD5A + cmp r0, 0 + beq _0816FD60 + b _0816FDB0 +_0816FD5A: + cmp r0, 0x2 + beq _0816FD9C + b _0816FDB0 +_0816FD60: + ldr r0, =0x030062a0 + ldr r0, [r0] + cmp r0, 0x80 + bne _0816FDB0 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x5 + negs r1, r1 + ands r1, r0 + strb r1, [r2] + b _0816FD90 + .pool +_0816FD7C: + ldr r0, =0x030062a0 + ldr r1, [r0] + movs r0, 0x88 + lsls r0, 1 + cmp r1, r0 + bne _0816FDB0 + adds r0, r4, 0 + movs r1, 0x3 + bl StartObjectRotScalAnim +_0816FD90: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0816FDB0 + .pool +_0816FD9C: + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0816FDB0 + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0816FDB0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_816FD44 + + thumb_func_start sub_816FDB8 +sub_816FDB8: @ 816FDB8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x4] + movs r7, 0 +_0816FDD2: + lsls r5, r7, 2 + ldr r0, =gUnknown_085E4E94 + adds r0, 0x2 + adds r0, r5, r0 + ldr r2, [sp] + lsls r1, r2, 16 + asrs r1, 16 + ldrh r0, [r0] + adds r1, r0 + lsls r1, 16 + asrs r1, 16 + ldr r3, [sp, 0x4] + lsls r2, r3, 16 + asrs r0, r2, 16 + str r0, [sp, 0x8] + ldr r3, =0xfffc0000 + adds r2, r3 + ldr r0, =gUnknown_085E4F5C + asrs r2, 16 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + movs r1, 0 + strh r1, [r4, 0x2E] + ldr r0, =gUnknown_085E4FA4 + adds r0, r7, r0 + ldrb r0, [r0] + strh r0, [r4, 0x30] + strh r7, [r4, 0x32] + adds r1, r4, 0 + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + mov r10, r2 + mov r3, r10 + orrs r0, r3 + strb r0, [r1] + adds r1, r7, 0 + adds r1, 0xC + movs r0, 0x1F + mov r9, r0 + mov r2, r9 + ands r1, r2 + lsls r1, 1 + ldrb r0, [r4, 0x3] + movs r3, 0x3F + negs r3, r3 + mov r8, r3 + mov r2, r8 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x3] + ldr r3, =gUnknown_085E4E94 + adds r5, r3 + ldrb r1, [r5] + adds r0, r4, 0 + bl StartObjectImageAnim + adds r0, r4, 0 + movs r1, 0 + bl StartObjectRotScalAnim + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0x8 + bls _0816FDD2 + ldr r0, =gUnknown_085E4F8C + ldr r2, [sp, 0x8] + subs r2, 0x6 + lsls r2, 16 + asrs r2, 16 + movs r1, 0x78 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r2, 0 + strh r2, [r0, 0x2E] + adds r2, r0, 0 + adds r2, 0x3E + ldrb r1, [r2] + mov r3, r10 + orrs r1, r3 + strb r1, [r2] + adds r2, r7, 0 + adds r2, 0xC + mov r1, r9 + ands r2, r1 + lsls r2, 1 + ldrb r1, [r0, 0x3] + mov r3, r8 + ands r1, r3 + orrs r1, r2 + strb r1, [r0, 0x3] + movs r1, 0x1 + bl StartObjectRotScalAnim + adds r0, r6, 0 + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_816FDB8 + + thumb_func_start sub_816FEDC +sub_816FEDC: @ 816FEDC + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0816FF48 + ldr r2, =gUnknown_08329F40 + ldrh r1, [r4, 0x32] + lsls r0, r1, 24 + lsrs r0, 23 + adds r0, r2 + ldrh r3, [r0] + adds r1, 0x40 + lsls r1, 24 + lsrs r1, 23 + adds r1, r2 + movs r2, 0 + ldrsh r0, [r1, r2] + movs r1, 0x30 + ldrsh r2, [r4, r1] + adds r1, r0, 0 + muls r1, r2 + adds r0, r1, 0 + cmp r1, 0 + bge _0816FF18 + adds r0, 0xFF +_0816FF18: + lsls r0, 8 + lsrs r6, r0, 16 + lsls r0, r3, 16 + asrs r3, r0, 16 + negs r0, r3 + muls r0, r2 + cmp r0, 0 + bge _0816FF2A + adds r0, 0xFF +_0816FF2A: + lsls r0, 8 + lsrs r5, r0, 16 + adds r0, r3, 0 + muls r0, r2 + cmp r0, 0 + bge _0816FF38 + adds r0, 0xFF +_0816FF38: + lsls r0, 8 + lsrs r2, r0, 16 + adds r1, r6, 0 + adds r3, r5, 0 + str r1, [sp] + movs r0, 0x1 + bl SetSpriteTransformationMatrix +_0816FF48: + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0x1 + beq _0816FF9C + cmp r0, 0x1 + ble _0816FF58 + cmp r0, 0x2 + beq _0816FFFE +_0816FF58: + ldrb r0, [r4, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r1, [r4, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4, 0x3] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0x3 + movs r3, 0x3 + bl CalcVecFromObjectCenterToObjectUpperLeft + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + movs r1, 0 + movs r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0x80 + strh r0, [r4, 0x30] + strh r1, [r4, 0x32] + strh r1, [r4, 0x34] + b _08170038 + .pool +_0816FF9C: + ldrh r0, [r4, 0x34] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x8C + bl sine + negs r0, r0 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x34] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x78 + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x7 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x34] + adds r0, 0x3 + strh r0, [r4, 0x34] + movs r1, 0x20 + ldrsh r0, [r4, r1] + movs r2, 0x24 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bgt _08170038 + ldrb r0, [r4, 0x5] + movs r1, 0xC + orrs r0, r1 + strb r0, [r4, 0x5] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0x14 + strh r0, [r4, 0x20] + movs r0, 0x28 + strh r0, [r4, 0x22] + movs r0, 0x80 + lsls r0, 2 + strh r0, [r4, 0x30] + movs r0, 0 + strh r0, [r4, 0x32] + movs r0, 0x10 + b _08170036 +_0816FFFE: + ldrh r0, [r4, 0x34] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x22 + bl sine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x34] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3C + bl cosine + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x2 + strh r0, [r4, 0x30] + movs r1, 0x3C + ldrsh r0, [r4, r1] + movs r1, 0x5 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _08170038 + ldrh r0, [r4, 0x34] + adds r0, 0x1 +_08170036: + strh r0, [r4, 0x34] +_08170038: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_816FEDC + + thumb_func_start sub_8170040 +sub_8170040: @ 8170040 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08170056 + adds r4, r5, 0 + adds r4, 0x3E + cmp r0, 0x1 + beq _0817008E +_08170056: + adds r4, r5, 0 + adds r4, 0x3E + ldrb r1, [r4] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r4] + ldrb r0, [r5, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r5, 0x1] + ldrb r1, [r5, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x24 + orrs r0, r1 + strb r0, [r5, 0x3] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x3 + movs r3, 0x3 + bl CalcVecFromObjectCenterToObjectUpperLeft + movs r0, 0 + strh r0, [r5, 0x30] + movs r0, 0x1 + strh r0, [r5, 0x2E] +_0817008E: + ldrh r0, [r5, 0x3C] + adds r0, 0x1 + strh r0, [r5, 0x3C] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081700A6 + ldrb r0, [r4] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] + b _081700BE +_081700A6: + ldrb r0, [r4] + movs r1, 0x5 + negs r1, r1 + ands r1, r0 + strb r1, [r4] + ldrh r1, [r5, 0x30] + movs r2, 0x30 + ldrsh r0, [r5, r2] + cmp r0, 0x3F + bgt _081700BE + adds r0, r1, 0x1 + strh r0, [r5, 0x30] +_081700BE: + ldr r1, =gUnknown_08329F40 + ldrh r0, [r5, 0x30] + lsls r0, 24 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + subs r1, r0 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + movs r0, 0x12 + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170040 + + thumb_func_start sub_81700F8 +sub_81700F8: @ 81700F8 + push {r4,r5,lr} + ldr r5, =0x04000208 + ldrh r4, [r5] + movs r0, 0 + strh r0, [r5] + movs r0, 0x1 + bl RegisterRamReset + movs r0, 0 + movs r1, 0x80 + bl ClearGpuRegBits + strh r4, [r5] + ldr r1, =0x030022c0 + ldr r0, =0x00000439 + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + bl sub_815355C + lsls r0, 16 + lsrs r0, 16 + bl InitSaveBlockPointersWithRandomOffset + bl sub_808447C + bl sub_8152680 + movs r0, 0 + bl sub_81534D0 + ldr r0, =0x03006210 + ldrh r0, [r0] + cmp r0, 0 + beq _08170148 + cmp r0, 0x2 + bne _0817014C +_08170148: + bl init_sav2 +_0817014C: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + lsls r0, 31 + lsrs r0, 31 + bl sub_82E1810 + ldr r0, =0x02000000 + movs r1, 0xE0 + lsls r1, 9 + bl InitHeap + ldr r0, =sub_8086230 + bl SetMainCallback2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81700F8 + + thumb_func_start sub_817018C +sub_817018C: @ 817018C + push {r4,r5,lr} + adds r5, r0, 0 + movs r0, 0 + bl SetVBlankCallback + ldr r4, =0x0203bcd0 + movs r0, 0x89 + lsls r0, 4 + bl Alloc + str r0, [r4] + ldr r1, =0x0000088c + adds r2, r0, r1 + movs r1, 0 + strh r1, [r2] + str r5, [r0] + ldr r0, =sub_81701C4 + bl SetMainCallback2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817018C + + thumb_func_start sub_81701C4 +sub_81701C4: @ 81701C4 + push {lr} + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0x10 + movs r1, 0 + bl SetGpuReg + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + movs r0, 0x16 + movs r1, 0 + bl SetGpuReg + movs r0, 0x18 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg + movs r0, 0x1C + movs r1, 0 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0 + bl SetGpuReg + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085E5068 + movs r0, 0x1 + movs r2, 0x2 + bl InitBgsFromTemplates + ldr r0, =gUnknown_085E5070 + bl InitWindows + bl DeactivateAllTextPrinters + movs r0, 0 + movs r1, 0x27 + movs r2, 0xD0 + bl sub_809882C + bl clear_scheduled_bg_copies_to_vram + ldr r0, =sub_8170274 + bl SetMainCallback2 + ldr r0, =sub_8170260 + bl SetVBlankCallback + pop {r0} + bx r0 + .pool + thumb_func_end sub_81701C4 + + thumb_func_start sub_8170260 +sub_8170260: @ 8170260 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8170260 + + thumb_func_start sub_8170274 +sub_8170274: @ 8170274 + push {lr} + bl sub_8170290 + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + bl do_scheduled_bg_tilemap_copies_to_vram + pop {r0} + bx r0 + thumb_func_end sub_8170274 + + thumb_func_start sub_8170290 +sub_8170290: @ 8170290 + push {r4,r5,lr} + sub sp, 0xC + ldr r1, =0x0203bcd0 + ldr r0, [r1] + ldr r2, =0x0000088c + adds r0, r2 + ldrh r0, [r0] + adds r4, r1, 0 + cmp r0, 0x6 + bls _081702A6 + b _08170416 +_081702A6: + lsls r0, 2 + ldr r1, =_081702BC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081702BC: + .4byte _081702D8 + .4byte _08170300 + .4byte _08170358 + .4byte _08170380 + .4byte _08170394 + .4byte _081703C0 + .4byte _081703E8 +_081702D8: + ldr r0, [r4] + adds r0, 0x8 + movs r1, 0 + bl sub_8122CDC + movs r0, 0 + movs r1, 0 + bl sub_8124288 + movs r0, 0x1 + movs r1, 0x1 + bl sub_81240D4 + ldr r1, [r4] + ldr r0, =0x0000088c + adds r1, r0 + b _081703D8 + .pool +_08170300: + movs r0, 0x1 + movs r1, 0 + movs r2, 0x27 + movs r3, 0xD + bl SetWindowBorderStyle + ldr r5, =gUnknown_085EE8F1 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x38 + bl GetStringCenterAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x1 + str r0, [sp] + movs r4, 0 + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + bl Print + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0 + movs r1, 0 + movs r2, 0x27 + movs r3, 0xD + bl SetWindowBorderStyle + bl sub_8170428 + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + b _081703CC + .pool +_08170358: + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuRegBits + movs r0, 0 + bl ShowBg + movs r0, 0x2 + bl ShowBg + ldr r0, =0x0203bcd0 + ldr r1, [r0] + ldr r0, =0x0000088c + adds r1, r0 + b _081703D8 + .pool +_08170380: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08170416 + ldr r1, [r4] + b _081703D4 + .pool +_08170394: + bl sub_81230AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _081703A6 + bl sub_8170428 + b _08170416 +_081703A6: + cmp r0, 0x3 + blt _08170416 + cmp r0, 0x5 + bgt _08170416 + ldr r0, =0x0203bcd0 + ldr r1, [r0] + ldr r0, =0x0000088c + adds r1, r0 + b _081703D8 + .pool +_081703C0: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 +_081703CC: + bl pal_fade_maybe + ldr r0, =0x0203bcd0 + ldr r1, [r0] +_081703D4: + ldr r2, =0x0000088c + adds r1, r2 +_081703D8: + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _08170416 + .pool +_081703E8: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _08170416 + bl sub_812305C + ldr r4, =0x0203bcd0 + ldr r0, [r4] + ldr r0, [r0] + bl SetMainCallback2 + ldr r0, [r4] + cmp r0, 0 + beq _08170412 + bl Free + str r5, [r4] +_08170412: + bl FreeAllWindowBuffers +_08170416: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170290 + + thumb_func_start sub_8170428 +sub_8170428: @ 8170428 + push {r4,lr} + sub sp, 0xC + ldr r4, =0x0203bcd0 + ldr r0, [r4] + ldrb r0, [r0, 0xA] + cmp r0, 0 + beq _08170460 + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, [r4] + adds r2, 0xC + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + b _08170470 + .pool +_08170460: + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram +_08170470: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8170428 + + thumb_func_start sub_8170478 +sub_8170478: @ 8170478 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + ldr r0, =0x02038436 + ldrb r4, [r0] + ldr r0, =0x02022e24 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e26 + strh r1, [r0] + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + ldr r1, =0x00003f3d + movs r0, 0x4A + bl SetGpuReg + movs r1, 0x80 + lsls r1, 8 + movs r0, 0 + bl SetGpuRegBits + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0x80 + lsls r1, 5 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0x1 + bl lcd_bg_operations + ldr r0, =0x03005d70 + adds r4, r0 + ldrb r0, [r4] + ldr r1, =0x02020630 + mov r9, r1 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + add r4, r9 + ldrb r7, [r4, 0x6] + ldrh r6, [r4, 0x38] + lsls r6, 24 + lsrs r6, 24 + ldr r0, =DummyObjectCallback + bl object_new_hidden_with_callback + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + ldr r0, =DummyObjectCallback + bl object_new_hidden_with_callback + mov r10, r0 + mov r2, r10 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + ldrb r1, [r4, 0x5] + movs r3, 0xD + negs r3, r3 + adds r0, r3, 0 + ands r0, r1 + movs r1, 0x4 + mov r8, r1 + mov r2, r8 + orrs r0, r2 + strb r0, [r4, 0x5] + lsls r5, r7, 4 + adds r5, r7 + lsls r5, 2 + add r5, r9 + ldrb r1, [r5, 0x5] + adds r0, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + add r1, r9 + ldrb r2, [r1, 0x5] + adds r0, r3, 0 + ands r0, r2 + mov r2, r8 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r0, [sp, 0x14] + lsls r6, r0, 4 + adds r6, r0 + lsls r6, 2 + mov r1, r9 + adds r7, r6, r1 + adds r0, r7, 0 + adds r1, r4, 0 + movs r2, 0x44 + str r3, [sp, 0x18] + bl memcpy + mov r2, r10 + lsls r4, r2, 4 + add r4, r10 + lsls r4, 2 + adds r0, r4, 0 + add r0, r9 + mov r8, r0 + adds r1, r5, 0 + movs r2, 0x44 + bl memcpy + ldrb r1, [r7, 0x1] + ldr r3, [sp, 0x18] + adds r0, r3, 0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r7, 0x1] + mov r2, r8 + ldrb r0, [r2, 0x1] + ands r3, r0 + orrs r3, r1 + strb r3, [r2, 0x1] + movs r0, 0x1C + add r9, r0 + add r6, r9 + ldr r1, =DummyObjectCallback + str r1, [r6] + add r4, r9 + str r1, [r4] + mov r0, sp + bl sub_80A6B30 + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, =gUnknown_08C2EA9C + bl sub_80A6D48 + mov r0, sp + ldrb r0, [r0, 0x9] + ldr r1, =gUnknown_08C2EA50 + mov r2, sp + ldrh r2, [r2, 0xA] + bl sub_80A6CC0 + ldr r0, =gUnknown_08C2DDA4 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 4 + movs r2, 0x20 + bl decompress_palette + ldr r1, =0x02022e18 + ldrh r0, [r7, 0x20] + negs r0, r0 + adds r0, 0x20 + strh r0, [r1] + ldr r1, =0x02022e1a + ldrh r0, [r7, 0x22] + negs r0, r0 + subs r0, 0x20 + strh r0, [r1] + ldr r1, =0x03005e00 + ldr r2, [sp, 0x10] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r1, 0xA0 + lsls r1, 2 + strh r1, [r0, 0xA] + mov r1, sp + ldrh r1, [r1, 0x14] + strh r1, [r0, 0x8] + mov r2, r10 + strh r2, [r0, 0xC] + ldr r1, =sub_8170660 + str r1, [r0] + 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_8170478 + + thumb_func_start sub_8170660 +sub_8170660: @ 8170660 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02038436 + ldrb r0, [r0] + mov r8, r0 + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r5, r0, r1 + ldrh r1, [r5, 0xA] + ldrh r0, [r5, 0x22] + adds r1, r0 + movs r3, 0 + strh r1, [r5, 0x22] + ldr r2, =0x02022e1a + lsls r0, r1, 16 + lsrs r0, 24 + ldrh r4, [r2] + adds r0, r4 + strh r0, [r2] + movs r0, 0xFF + ands r1, r0 + strh r1, [r5, 0x22] + movs r1, 0x26 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _081706F0 + cmp r0, 0x1 + bgt _081706B4 + cmp r0, 0 + beq _081706BA + b _08170814 + .pool +_081706B4: + cmp r0, 0x2 + beq _08170708 + b _08170814 +_081706BA: + ldrh r0, [r5, 0x1E] + adds r1, r0, 0x1 + strh r1, [r5, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bgt _081706CA + b _08170814 +_081706CA: + strh r3, [r5, 0x1E] + ldrh r1, [r5, 0x20] + adds r1, 0x1 + strh r1, [r5, 0x20] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r2, 0x20 + ldrsh r0, [r5, r2] + cmp r0, 0x8 + beq _081706EE + b _08170814 +_081706EE: + b _08170700 +_081706F0: + ldrh r0, [r5, 0x1C] + adds r0, 0x1 + strh r0, [r5, 0x1C] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1E + beq _08170700 + b _08170814 +_08170700: + ldrh r0, [r5, 0x26] + adds r0, 0x1 + strh r0, [r5, 0x26] + b _08170814 +_08170708: + ldrh r0, [r5, 0x1E] + adds r1, r0, 0x1 + strh r1, [r5, 0x1E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08170814 + strh r3, [r5, 0x1E] + ldrh r1, [r5, 0x20] + subs r1, 0x1 + strh r1, [r5, 0x20] + movs r0, 0x10 + subs r0, r1 + lsls r0, 8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x20 + ldrsh r4, [r5, r0] + cmp r4, 0 + bne _08170814 + movs r0, 0 + bl sub_80A477C + ldr r0, =0x02022e24 + strh r4, [r0] + ldr r0, =0x02022e26 + strh r4, [r0] + ldr r4, =0x00003f3f + movs r0, 0x48 + adds r1, r4, 0 + bl SetGpuReg + movs r0, 0x4A + adds r1, r4, 0 + bl SetGpuReg + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _0817076C + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + bl lcd_bg_operations +_0817076C: + movs r0, 0 + bl GetGpuReg + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 8 + adds r0, r2, 0 + eors r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r4, 0x8 + ldrsh r1, [r5, r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r6, =0x02020630 + adds r0, r6 + bl RemoveObjectAndFreeTiles + movs r0, 0xC + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl RemoveObjectAndFreeTiles + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl lcd_bg_operations + ldr r0, =0x03005d70 + add r0, r8 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r2, [r1, 0x6] + mov r8, r2 + ldrh r4, [r1, 0x38] + lsls r4, 24 + lsrs r4, 24 + ldrb r3, [r1, 0x5] + movs r2, 0xD + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + movs r5, 0x4 + orrs r0, r5 + strb r0, [r1, 0x5] + mov r0, r8 + lsls r1, r0, 4 + add r1, r8 + lsls r1, 2 + adds r1, r6 + ldrb r3, [r1, 0x5] + adds r0, r2, 0 + ands r0, r3 + orrs r0, r5 + strb r0, [r1, 0x5] + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r0, 0x5] + ands r2, r1 + orrs r2, r5 + strb r2, [r0, 0x5] + adds r0, r7, 0 + bl move_anim_task_del +_08170814: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170660 + + thumb_func_start sub_8170834 +sub_8170834: @ 8170834 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r9, r0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =0x03005d70 + adds r2, r0 + ldrb r0, [r2] + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + ldr r0, =0x02020630 + adds r5, r0 + ldrb r1, [r5, 0x6] + mov r10, r1 + ldrh r4, [r5, 0x38] + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x0000d709 + bl AllocObjectPalette + mov r2, r9 + strb r0, [r2] + ldr r0, =0x0000d70a + bl AllocObjectPalette + strb r0, [r7] + ldrb r0, [r5, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r1, 0x80 + lsls r1, 1 + adds r3, r1, 0 + orrs r0, r3 + lsls r6, r4, 4 + adds r6, r4 + lsls r6, 2 + ldr r2, =0x02020630 + adds r6, r2 + ldrb r4, [r6, 0x5] + lsrs r4, 4 + lsls r4, 4 + orrs r4, r3 + lsls r0, 1 + ldr r1, =0x02037714 + mov r8, r1 + add r0, r8 + mov r2, r9 + ldrb r1, [r2] + lsls r1, 4 + adds r1, r3, r1 + movs r2, 0x20 + str r3, [sp] + bl gpu_pal_apply + lsls r4, 1 + add r4, r8 + ldrb r0, [r7] + lsls r0, 4 + ldr r3, [sp] + adds r3, r0 + adds r0, r4, 0 + adds r1, r3, 0 + movs r2, 0x20 + bl gpu_pal_apply + mov r0, r9 + ldrb r1, [r0] + lsls r1, 4 + ldrb r2, [r5, 0x5] + movs r3, 0xF + adds r0, r3, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + mov r2, r10 + lsls r1, r2, 4 + add r1, r10 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + mov r0, r9 + ldrb r2, [r0] + lsls r2, 4 + ldrb r4, [r1, 0x5] + adds r0, r3, 0 + ands r0, r4 + orrs r0, r2 + strb r0, [r1, 0x5] + ldrb r0, [r7] + lsls r0, 4 + ldrb r1, [r6, 0x5] + ands r3, r1 + orrs r3, r0 + strb r3, [r6, 0x5] + 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_8170834 + + thumb_func_start sub_8170920 +sub_8170920: @ 8170920 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r1, sp + adds r1, 0x1 + ldr r0, =0x02038436 + ldrb r2, [r0] + mov r0, sp + bl sub_8170834 + adds r0, r4, 0 + bl move_anim_task_del + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170920 + + thumb_func_start sub_817094C +sub_817094C: @ 817094C + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005d70 + adds r0, r1 + ldrb r0, [r0] + ldr r1, =0x02020630 + mov r8, r1 + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + add r5, r8 + ldrb r0, [r5, 0x6] + mov r9, r0 + ldrh r6, [r5, 0x38] + lsls r6, 24 + lsrs r6, 24 + ldr r0, =0x0000d709 + bl FreeObjectPaletteByTag + ldr r0, =0x0000d70a + bl FreeObjectPaletteByTag + ldr r0, =0x0000d6ff + bl IndexOfObjectPaletteTag + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x0000d704 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsls r4, 4 + ldrb r2, [r5, 0x5] + movs r3, 0xF + adds r1, r3, 0 + ands r1, r2 + orrs r1, r4 + strb r1, [r5, 0x5] + mov r1, r9 + lsls r2, r1, 4 + add r2, r9 + lsls r2, 2 + add r2, r8 + ldrb r5, [r2, 0x5] + adds r1, r3, 0 + ands r1, r5 + orrs r1, r4 + strb r1, [r2, 0x5] + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + add r1, r8 + lsrs r0, 20 + ldrb r2, [r1, 0x5] + ands r3, r2 + orrs r3, r0 + strb r3, [r1, 0x5] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817094C + + thumb_func_start sub_81709EC +sub_81709EC: @ 81709EC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x02038436 + ldrb r0, [r0] + bl sub_817094C + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81709EC + + thumb_func_start sub_8170A0C +sub_8170A0C: @ 8170A0C + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =0x0203841e + ldrh r0, [r2] + strh r0, [r1, 0x1C] + ldrh r0, [r2, 0x2] + strh r0, [r1, 0x1E] + ldr r0, =sub_8170A38 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8170A0C + + thumb_func_start sub_8170A38 +sub_8170A38: @ 8170A38 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + movs r6, 0 + adds r1, r0, 0x1 + strh r1, [r4, 0x8] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x1E + ldrsh r1, [r4, r2] + cmp r0, r1 + blt _08170AF8 + strh r6, [r4, 0x8] + ldr r0, =0x0000d709 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r2, r0, 24 + movs r3, 0x1C + ldrsh r0, [r4, r3] + movs r1, 0x2 + cmp r0, 0 + bne _08170A76 + movs r1, 0x6 +_08170A76: + movs r3, 0xA + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _08170A8C + cmp r0, 0x1 + beq _08170AC8 + b _08170AF8 + .pool +_08170A8C: + ldrh r0, [r4, 0xC] + adds r0, 0x2 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _08170A9E + movs r0, 0x10 + strh r0, [r4, 0xC] +_08170A9E: + lsls r0, r2, 4 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2 + orrs r0, r1 + ldrb r2, [r4, 0xC] + ldr r3, =0x00007f74 + movs r1, 0x1 + bl pal_fade_1 + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0x10 + bne _08170AF8 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + b _08170AF8 + .pool +_08170AC8: + ldrh r0, [r4, 0xC] + subs r0, 0x2 + strh r0, [r4, 0xC] + lsls r0, 16 + cmp r0, 0 + bge _08170AD6 + strh r6, [r4, 0xC] +_08170AD6: + lsls r0, r2, 4 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2 + orrs r0, r1 + ldrb r2, [r4, 0xC] + ldr r3, =0x00007f74 + movs r1, 0x1 + bl pal_fade_1 + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0 + bne _08170AF8 + adds r0, r5, 0 + bl move_anim_task_del +_08170AF8: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170A38 + + thumb_func_start sub_8170B04 +sub_8170B04: @ 8170B04 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x020241e4 + ldr r0, =0x02038436 + ldrb r0, [r0] + adds r0, r1 + ldrb r5, [r0] + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08170B52 + cmp r0, 0x1 + bgt _08170B3C + cmp r0, 0 + beq _08170B42 + b _08170BA4 + .pool +_08170B3C: + cmp r0, 0x2 + beq _08170B84 + b _08170BA4 +_08170B42: + adds r0, r5, 0 + movs r1, 0 + bl sub_80A7270 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r4, 0x1C] + b _08170B76 +_08170B52: + ldrh r0, [r4, 0x1C] + adds r0, 0x30 + strh r0, [r4, 0x1C] + movs r0, 0x1C + ldrsh r2, [r4, r0] + adds r0, r5, 0 + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + adds r0, r5, 0 + bl sub_80A7E6C + movs r0, 0x1C + ldrsh r1, [r4, r0] + ldr r0, =0x000002cf + cmp r1, r0 + ble _08170BA4 +_08170B76: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08170BA4 + .pool +_08170B84: + adds r0, r5, 0 + bl sub_80A7344 + ldr r1, =0x02020630 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + adds r0, r6, 0 + bl move_anim_task_del +_08170BA4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170B04 + + thumb_func_start sub_8170BB0 +sub_8170BB0: @ 8170BB0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x020241e4 + ldr r4, =0x02038436 + ldrb r0, [r4] + adds r1, r0, r1 + ldrb r1, [r1] + mov r9, r1 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08170BF8 + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + b _08170C08 + .pool +_08170BF8: + ldr r1, =0x0202406e + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 +_08170C08: + adds r0, r1 + movs r1, 0x26 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + bl ball_number_to_ball_processing_index + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r2, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r6, r0, r2 + movs r0, 0x8 + ldrsh r7, [r6, r0] + cmp r7, 0 + beq _08170C44 + cmp r7, 0x1 + beq _08170CC4 + b _08170CEE + .pool +_08170C44: + ldr r5, =0x02038436 + ldrb r0, [r5] + movs r1, 0 + bl sub_80A5C6C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r5] + movs r1, 0x1 + bl sub_80A5C6C + adds r1, r0, 0 + lsls r1, 24 + ldr r2, =0x02020630 + mov r3, r9 + lsls r0, r3, 4 + add r0, r9 + lsls r0, 2 + adds r0, r2 + ldrb r2, [r0, 0x5] + lsls r2, 28 + lsrs r2, 30 + adds r0, 0x43 + ldrb r3, [r0] + movs r0, 0x80 + lsls r0, 22 + adds r1, r0 + lsrs r1, 24 + mov r0, r8 + str r0, [sp] + adds r0, r4, 0 + bl sub_8171D98 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x1C] + str r7, [sp] + str r7, [sp, 0x4] + str r7, [sp, 0x8] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80A75AC + adds r2, r0, 0 + ldrb r1, [r5] + movs r0, 0 + mov r3, r8 + bl sub_81729E8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x1E] + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] + b _08170CEE + .pool +_08170CC4: + movs r1, 0x1C + ldrsh r0, [r6, r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x4] + cmp r0, 0 + bne _08170CEE + movs r3, 0x1E + ldrsh r0, [r6, r3] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x4] + cmp r0, 0 + bne _08170CEE + adds r0, r5, 0 + bl move_anim_task_del +_08170CEE: + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8170BB0 + + thumb_func_start sub_8170CFC +sub_8170CFC: @ 8170CFC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x02024208 + ldrh r0, [r0] + bl ball_number_to_ball_processing_index + lsls r0, 24 + lsrs r0, 24 + bl sub_8076A78 + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170CFC + + thumb_func_start sub_8170D24 +sub_8170D24: @ 8170D24 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x02024208 + ldrh r0, [r0] + bl ball_number_to_ball_processing_index + lsls r0, 24 + lsrs r0, 24 + bl sub_8076AE8 + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170D24 + + thumb_func_start sub_8170D4C +sub_8170D4C: @ 8170D4C + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x8] + cmp r0, 0x5 + bne _08170D70 + ldr r1, =0x0203841e + ldr r0, =0x0000ffff + b _08170D74 + .pool +_08170D70: + ldr r1, =0x0203841e + movs r0, 0 +_08170D74: + strh r0, [r1, 0xE] + adds r0, r2, 0 + bl move_anim_task_del + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170D4C + + thumb_func_start ball_number_to_ball_processing_index +ball_number_to_ball_processing_index: @ 8170D84 + push {lr} + lsls r0, 16 + lsrs r0, 16 + subs r0, 0x1 + cmp r0, 0xB + bhi _08170DFC + lsls r0, 2 + ldr r1, =_08170DA0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08170DA0: + .4byte _08170DD0 + .4byte _08170DD4 + .4byte _08170DD8 + .4byte _08170DFC + .4byte _08170DDC + .4byte _08170DE0 + .4byte _08170DE4 + .4byte _08170DE8 + .4byte _08170DEC + .4byte _08170DF0 + .4byte _08170DF4 + .4byte _08170DF8 +_08170DD0: + movs r0, 0x4 + b _08170DFE +_08170DD4: + movs r0, 0x3 + b _08170DFE +_08170DD8: + movs r0, 0x1 + b _08170DFE +_08170DDC: + movs r0, 0x2 + b _08170DFE +_08170DE0: + movs r0, 0x5 + b _08170DFE +_08170DE4: + movs r0, 0x6 + b _08170DFE +_08170DE8: + movs r0, 0x7 + b _08170DFE +_08170DEC: + movs r0, 0x8 + b _08170DFE +_08170DF0: + movs r0, 0x9 + b _08170DFE +_08170DF4: + movs r0, 0xA + b _08170DFE +_08170DF8: + movs r0, 0xB + b _08170DFE +_08170DFC: + movs r0, 0 +_08170DFE: + pop {r1} + bx r1 + thumb_func_end ball_number_to_ball_processing_index + + thumb_func_start sub_8170E04 +sub_8170E04: @ 8170E04 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + mov r10, r0 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r0, =0x02024208 + ldrh r0, [r0] + bl ball_number_to_ball_processing_index + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + ldr r1, =gUnknown_0832C588 + adds r0, r1 + movs r1, 0x20 + movs r2, 0x50 + movs r3, 0x1D + bl AddObjectToFront + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =0x02020630 + mov r9, r1 + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + adds r6, r4, r1 + movs r0, 0x22 + strh r0, [r6, 0x2E] + ldr r2, =0x02038437 + mov r8, r2 + ldrb r0, [r2] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x30] + mov r1, r8 + ldrb r0, [r1] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x10 + strh r0, [r6, 0x32] + mov r0, r9 + adds r0, 0x1C + adds r4, r0 + ldr r0, =sub_8171104 + str r0, [r4] + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r3, [r0, 0x8] + ldr r1, =0x020241e4 + mov r2, r8 + ldrb r0, [r2] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r1, [r0] + lsls r1, 29 + lsrs r1, 31 + lsls r1, 1 + ldrb r2, [r3, 0x9] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x9] + ldr r1, =0x03005e00 + mov r2, r10 + lsls r0, r2, 2 + add r0, r10 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x8] + ldr r1, =sub_8170EF0 + str r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170E04 + + thumb_func_start sub_8170EF0 +sub_8170EF0: @ 8170EF0 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x8] + ldr r2, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x2E] + ldr r0, =0x0000ffff + cmp r1, r0 + bne _08170F1A + adds r0, r3, 0 + bl move_anim_task_del +_08170F1A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170EF0 + + thumb_func_start sub_8170F2C +sub_8170F2C: @ 8170F2C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 2 + ands r0, r1 + cmp r0, 0 + beq _08170F50 + movs r6, 0x20 + movs r5, 0xB + b _08170F54 + .pool +_08170F50: + movs r6, 0x17 + movs r5, 0x5 +_08170F54: + ldr r0, =0x02024208 + ldrh r0, [r0] + bl ball_number_to_ball_processing_index + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + bl sub_80A82E4 + adds r3, r0, 0 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + ldr r1, =gUnknown_0832C588 + adds r0, r1 + adds r1, r6, 0 + adds r1, 0x20 + movs r2, 0x50 + orrs r5, r2 + adds r2, r5, 0 + bl AddObjectToFront + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =0x02020630 + mov r9, r0 + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + adds r6, r4, r0 + movs r0, 0x22 + strh r0, [r6, 0x2E] + ldr r1, =0x02038437 + mov r8, r1 + ldrb r0, [r1] + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0x30] + mov r1, r8 + ldrb r0, [r1] + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x10 + strh r0, [r6, 0x32] + movs r0, 0x1C + add r9, r0 + add r4, r9 + ldr r0, =DummyObjectCallback + str r0, [r4] + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, =0x020241e4 + lsls r0, 24 + lsrs r0, 24 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + ldr r1, =sub_8039E84 + str r1, [r0] + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x8] + ldr r1, =sub_8171030 + str r1, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8170F2C + + thumb_func_start sub_8171030 +sub_8171030: @ 8171030 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, =0x02020630 + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, =0x020241e4 + lsls r0, 24 + lsrs r0, 24 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0x1 + bne _0817108A + movs r0, 0x3D + movs r1, 0 + bl audio_play_and_stuff + ldr r0, =0x03005e00 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + movs r0, 0x8 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r6, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_8171104 + str r1, [r0] + ldr r0, =sub_81710A8 + movs r1, 0xA + bl CreateTask + ldr r0, =sub_8170EF0 + str r0, [r4] +_0817108A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8171030 + + thumb_func_start sub_81710A8 +sub_81710A8: @ 81710A8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, =0x02020630 + movs r0, 0 + bl battle_get_side_with_given_state + ldr r4, =0x020241e4 + lsls r0, 24 + lsrs r0, 24 + adds r0, 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 _081710F4 + movs r0, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0 + bl StartObjectImageAnim + adds r0, r5, 0 + bl DestroyTask +_081710F4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81710A8 + + thumb_func_start sub_8171104 +sub_8171104: @ 8171104 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x30] + ldrh r2, [r4, 0x32] + ldrh r0, [r4, 0x20] + strh r0, [r4, 0x30] + strh r1, [r4, 0x32] + ldrh r0, [r4, 0x22] + strh r0, [r4, 0x34] + strh r2, [r4, 0x36] + ldr r0, =0x0000ffd8 + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl sub_80A68D4 + ldr r0, =sub_8171134 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8171104 + + thumb_func_start sub_8171134 +sub_8171134: @ 8171134 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _081711D2 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x8] + cmp r0, 0x5 + bne _08171160 + ldr r0, =sub_8171CAC + str r0, [r4, 0x1C] + b _081711D2 + .pool +_08171160: + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnim + ldrh r0, [r4, 0x24] + ldrh r1, [r4, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x26] + ldrh r2, [r4, 0x22] + adds r0, r2 + strh r0, [r4, 0x22] + strh r1, [r4, 0x24] + strh r1, [r4, 0x26] + adds r1, r4, 0 + adds r1, 0x2E + movs r2, 0 + adds r0, r4, 0 + adds r0, 0x3C +_08171188: + strh r2, [r0] + subs r0, 0x2 + cmp r0, r1 + bge _08171188 + movs r0, 0 + strh r0, [r4, 0x38] + ldr r0, =sub_81711E8 + str r0, [r4, 0x1C] + ldr r0, =0x02024208 + ldrh r0, [r0] + bl ball_number_to_ball_processing_index + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xB + bgt _081711D2 + cmp r5, 0 + blt _081711D2 + ldrh r0, [r4, 0x20] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x22] + subs r1, 0x5 + lsls r1, 24 + lsrs r1, 24 + str r5, [sp] + movs r2, 0x1 + movs r3, 0x1C + bl sub_8171D98 + ldr r0, =0x02038437 + ldrb r1, [r0] + movs r0, 0 + movs r2, 0xE + adds r3, r5, 0 + bl sub_81729E8 +_081711D2: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8171134 + + thumb_func_start sub_81711E8 +sub_81711E8: @ 81711E8 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _08171224 + ldr r0, =TaskDummy + movs r1, 0x32 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x38] + ldr r0, =sub_8171240 + str r0, [r4, 0x1C] + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02038437 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strh r1, [r0, 0x30] +_08171224: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81711E8 + + thumb_func_start sub_8171240 +sub_8171240: @ 8171240 + push {r4-r7,lr} + adds r7, r0, 0 + ldr r1, =0x020241e4 + ldr r0, =0x02038437 + ldrb r0, [r0] + adds r0, r1 + ldrb r4, [r0] + ldrh r0, [r7, 0x38] + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + ldrh r0, [r5, 0xA] + adds r0, 0x1 + strh r0, [r5, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + bne _08171272 + movs r0, 0x3C + bl audio_play +_08171272: + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _081712E8 + cmp r0, 0x1 + bgt _08171290 + cmp r0, 0 + beq _08171296 + b _08171354 + .pool +_08171290: + cmp r0, 0x2 + beq _0817132C + b _08171354 +_08171296: + adds r0, r4, 0 + movs r1, 0 + bl sub_80A7270 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r5, 0x1C] + ldr r1, =0x030062dc + movs r0, 0x1C + str r0, [r1] + ldr r2, =0x030062e4 + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0, 0x26] + ldrh r0, [r0, 0x22] + adds r1, r0 + ldrh r0, [r7, 0x26] + ldrh r7, [r7, 0x22] + adds r0, r7 + subs r1, r0 + strh r1, [r2] + ldr r4, =0x030062e0 + ldrh r0, [r2] + lsls r0, 8 + movs r1, 0x1C + bl __udivsi3 + strh r0, [r4] + strh r0, [r5, 0xC] + b _08171346 + .pool +_081712E8: + ldrh r0, [r5, 0x1C] + adds r0, 0x20 + strh r0, [r5, 0x1C] + movs r0, 0x1C + ldrsh r2, [r5, r0] + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0 + bl obj_id_set_rotscale + ldrh r0, [r5, 0xC] + ldrh r1, [r5, 0xE] + adds r0, r1 + strh r0, [r5, 0xE] + ldr r0, =0x02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + movs r2, 0xE + ldrsh r0, [r5, r2] + negs r0, r0 + asrs r0, 8 + strh r0, [r1, 0x26] + movs r0, 0x1C + ldrsh r1, [r5, r0] + ldr r0, =0x0000047f + cmp r1, r0 + ble _0817137C + b _08171346 + .pool +_0817132C: + adds r0, r4, 0 + bl sub_80A7344 + ldr r1, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_08171346: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _0817137C + .pool +_08171354: + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + movs r2, 0xA + ldrsh r0, [r1, r2] + cmp r0, 0xA + ble _0817137C + adds r0, r6, 0 + bl DestroyTask + adds r0, r7, 0 + movs r1, 0x2 + bl StartObjectImageAnim + movs r0, 0 + strh r0, [r7, 0x38] + ldr r0, =sub_817138C + str r0, [r7, 0x1C] +_0817137C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8171240 + + thumb_func_start sub_817138C +sub_817138C: @ 817138C + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _081713C6 + movs r1, 0 + strh r1, [r4, 0x34] + movs r0, 0x28 + strh r0, [r4, 0x36] + strh r1, [r4, 0x38] + movs r0, 0 + movs r1, 0x28 + bl cosine + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + movs r0, 0x36 + ldrsh r1, [r4, r0] + movs r0, 0 + bl cosine + negs r0, r0 + strh r0, [r4, 0x26] + ldr r0, =sub_81713D0 + str r0, [r4, 0x1C] +_081713C6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817138C + + thumb_func_start sub_81713D0 +sub_81713D0: @ 81713D0 + push {r4,r5,lr} + adds r4, r0, 0 + movs r5, 0 + ldrh r0, [r4, 0x34] + movs r1, 0xFF + ands r1, r0 + cmp r1, 0 + beq _081713E6 + cmp r1, 0x1 + beq _0817145A + b _08171486 +_081713E6: + movs r1, 0x38 + ldrsh r0, [r4, r1] + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl cosine + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r1, [r4, 0x38] + adds r1, 0x4 + ldrh r2, [r4, 0x34] + lsls r0, r2, 16 + asrs r0, 24 + adds r1, r0 + strh r1, [r4, 0x38] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x3F + ble _08171486 + ldrh r0, [r4, 0x36] + subs r0, 0xA + strh r0, [r4, 0x36] + ldr r1, =0x00000101 + adds r0, r2, r1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 24 + cmp r0, 0x4 + bne _08171422 + movs r5, 0x1 +_08171422: + cmp r0, 0x2 + beq _08171442 + cmp r0, 0x2 + bgt _08171434 + cmp r0, 0x1 + beq _0817143A + b _08171452 + .pool +_08171434: + cmp r0, 0x3 + beq _0817144A + b _08171452 +_0817143A: + movs r0, 0x38 + bl audio_play + b _08171486 +_08171442: + movs r0, 0x39 + bl audio_play + b _08171486 +_0817144A: + movs r0, 0x3A + bl audio_play + b _08171486 +_08171452: + movs r0, 0x3B + bl audio_play + b _08171486 +_0817145A: + movs r2, 0x38 + ldrsh r0, [r4, r2] + movs r2, 0x36 + ldrsh r1, [r4, r2] + bl cosine + negs r0, r0 + strh r0, [r4, 0x26] + ldrh r1, [r4, 0x38] + subs r1, 0x4 + ldrh r2, [r4, 0x34] + lsls r0, r2, 16 + asrs r0, 24 + subs r1, r0 + strh r1, [r4, 0x38] + lsls r1, 16 + cmp r1, 0 + bgt _08171486 + strh r5, [r4, 0x38] + ldr r0, =0xffffff00 + ands r0, r2 + strh r0, [r4, 0x34] +_08171486: + cmp r5, 0 + beq _081714CA + movs r5, 0 + strh r5, [r4, 0x34] + movs r0, 0x40 + movs r1, 0x28 + bl cosine + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + strh r5, [r4, 0x26] + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _081714C0 + strh r5, [r4, 0x38] + ldr r0, =sub_81717B4 + str r0, [r4, 0x1C] + b _081714CA + .pool +_081714C0: + ldr r0, =sub_81714D4 + str r0, [r4, 0x1C] + movs r0, 0x1 + strh r0, [r4, 0x36] + strh r5, [r4, 0x38] +_081714CA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81713D0 + + thumb_func_start sub_81714D4 +sub_81714D4: @ 81714D4 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x34] + adds r0, 0x1 + movs r5, 0 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _08171510 + strh r5, [r4, 0x34] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + strh r5, [r0, 0xC] + ldr r0, =sub_8171520 + str r0, [r4, 0x1C] + movs r0, 0x17 + bl audio_play +_08171510: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81714D4 + + thumb_func_start sub_8171520 +sub_8171520: @ 8171520 + push {r4-r6,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x34] + movs r1, 0xFF + ands r1, r0 + cmp r1, 0x6 + bls _08171530 + b _08171768 +_08171530: + lsls r0, r1, 2 + ldr r1, =_08171540 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08171540: + .4byte _0817155C + .4byte _081715AE + .4byte _081715F4 + .4byte _08171654 + .4byte _081716A4 + .4byte _08171708 + .4byte _08171768 +_0817155C: + ldr r1, =0x020244d0 + ldr r5, [r1] + ldr r2, [r5, 0x8] + ldrh r3, [r2, 0xC] + movs r6, 0xC + ldrsh r0, [r2, r6] + adds r6, r1, 0 + cmp r0, 0xFF + ble _08171584 + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + ldr r1, [r5, 0x8] + ldrb r0, [r1, 0xC] + strh r0, [r1, 0xC] + b _0817158A + .pool +_08171584: + adds r0, r3, 0 + adds r0, 0xB0 + strh r0, [r2, 0xC] +_0817158A: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + movs r3, 0 + strh r0, [r4, 0x38] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x38] + adds r0, 0x7 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xE + bhi _081715AC + b _081717AE +_081715AC: + b _08171644 +_081715AE: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _08171660 + movs r0, 0 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x36] + negs r0, r0 + strh r0, [r4, 0x36] + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + movs r6, 0x36 + ldrsh r0, [r4, r6] + cmp r0, 0 + bge _081715EA + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80082B8 + b _081717AE +_081715EA: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80082B8 + b _081717AE +_081715F4: + ldr r1, =0x020244d0 + ldr r5, [r1] + ldr r2, [r5, 0x8] + ldrh r3, [r2, 0xC] + movs r6, 0xC + ldrsh r0, [r2, r6] + adds r6, r1, 0 + cmp r0, 0xFF + ble _0817161C + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + ldr r1, [r5, 0x8] + ldrb r0, [r1, 0xC] + strh r0, [r1, 0xC] + b _08171622 + .pool +_0817161C: + adds r0, r3, 0 + adds r0, 0xB0 + strh r0, [r2, 0xC] +_08171622: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + movs r3, 0 + strh r0, [r4, 0x38] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x38] + adds r0, 0xC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x18 + bhi _08171644 + b _081717AE +_08171644: + ldr r0, [r6] + ldr r0, [r0, 0x8] + strh r3, [r0, 0xC] + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + strh r3, [r4, 0x38] + b _081717AE +_08171654: + ldrh r0, [r4, 0x38] + adds r1, r0, 0x1 + strh r1, [r4, 0x38] + lsls r0, 16 + cmp r0, 0 + bge _0817166E +_08171660: + adds r0, r4, 0 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] + b _081717AE +_0817166E: + movs r0, 0 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x36] + negs r0, r0 + strh r0, [r4, 0x36] + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + movs r6, 0x36 + ldrsh r0, [r4, r6] + cmp r0, 0 + bge _0817169C + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80082B8 + b _081716A4 +_0817169C: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80082B8 +_081716A4: + ldr r1, =0x020244d0 + ldr r5, [r1] + ldr r2, [r5, 0x8] + ldrh r3, [r2, 0xC] + movs r6, 0xC + ldrsh r0, [r2, r6] + adds r6, r1, 0 + cmp r0, 0xFF + ble _081716CC + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x24] + adds r0, r1 + strh r0, [r4, 0x24] + ldr r1, [r5, 0x8] + ldrb r0, [r1, 0xC] + strh r0, [r1, 0xC] + b _081716D2 + .pool +_081716CC: + adds r0, r3, 0 + adds r0, 0xB0 + strh r0, [r2, 0xC] +_081716D2: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + movs r3, 0 + strh r0, [r4, 0x38] + adds r2, r4, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x38] + adds r0, 0x4 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + bls _081717AE + ldr r0, [r6] + ldr r0, [r0, 0x8] + strh r3, [r0, 0xC] + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + strh r3, [r4, 0x38] + ldrh r0, [r4, 0x36] + negs r0, r0 + strh r0, [r4, 0x36] + b _081717AE +_08171708: + movs r6, 0x80 + lsls r6, 1 + adds r0, r6, 0 + ldrh r1, [r4, 0x34] + adds r0, r1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r1, r0, 24 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x8] + cmp r1, r0 + bne _08171740 + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_81717B4 + str r0, [r4, 0x1C] + b _081717AE + .pool +_08171740: + cmp r0, 0x4 + bne _08171754 + cmp r1, 0x3 + bne _08171754 + ldr r0, =sub_81717D8 + str r0, [r4, 0x1C] + b _0817175A + .pool +_08171754: + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] +_0817175A: + adds r2, r4, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + b _081717AE +_08171768: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _081717AE + movs r0, 0 + strh r0, [r4, 0x38] + ldrh r1, [r4, 0x34] + ldr r0, =0xffffff00 + ands r0, r1 + strh r0, [r4, 0x34] + adds r0, r4, 0 + movs r1, 0x3 + bl StartObjectRotScalAnim + movs r6, 0x36 + ldrsh r0, [r4, r6] + cmp r0, 0 + bge _081717A0 + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectRotScalAnim + b _081717A8 + .pool +_081717A0: + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim +_081717A8: + movs r0, 0x17 + bl audio_play +_081717AE: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8171520 + + thumb_func_start sub_81717B4 +sub_81717B4: @ 81717B4 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x38] + adds r0, 0x1 + strh r0, [r1, 0x38] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1F + bne _081717CE + movs r0, 0 + strh r0, [r1, 0x38] + ldr r0, =sub_8171AE4 + str r0, [r1, 0x1C] +_081717CE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81717B4 + + thumb_func_start sub_81717D8 +sub_81717D8: @ 81717D8 + adds r3, r0, 0 + adds r3, 0x2C + ldrb r1, [r3] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r3] + ldr r1, =sub_81717F8 + str r1, [r0, 0x1C] + movs r1, 0 + strh r1, [r0, 0x34] + strh r1, [r0, 0x36] + strh r1, [r0, 0x38] + bx lr + .pool + thumb_func_end sub_81717D8 + + thumb_func_start sub_81717F8 +sub_81717F8: @ 81717F8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r6, r0, 0 + ldr r7, =0x02038437 + ldrh r0, [r6, 0x36] + adds r0, 0x1 + movs r1, 0 + mov r8, r1 + strh r0, [r6, 0x36] + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0x28 + bne _0817183C + movs r0, 0xFE + bl audio_play + ldrb r1, [r6, 0x5] + lsrs r1, 4 + movs r0, 0x80 + lsls r0, 9 + lsls r0, r1 + movs r1, 0x6 + movs r2, 0 + bl sub_80A2A20 + adds r0, r6, 0 + bl sub_81719EC + b _081718BC + .pool +_0817183C: + cmp r1, 0x3C + bne _0817185A + ldrb r1, [r6, 0x5] + lsrs r1, 4 + movs r0, 0x80 + lsls r0, 9 + lsls r0, r1 + mov r1, r8 + str r1, [sp] + movs r1, 0x2 + movs r2, 0x6 + movs r3, 0 + bl pal_fade_maybe + b _081718BC +_0817185A: + cmp r1, 0x5F + bne _08171880 + ldr r0, =0x020244b9 + movs r1, 0 + strb r1, [r0] + movs r0, 0x1 + bl sub_8072A88 + bl m4aMPlayAllStop + ldr r0, =0x00000213 + bl audio_play + b _081718BC + .pool +_08171880: + ldr r0, =0x0000013b + cmp r1, r0 + bne _081718BC + ldr r5, =0x02020630 + ldr r4, =0x020241e4 + ldrb r0, [r7] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldrb r0, [r7] + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + mov r0, r8 + strh r0, [r6, 0x2E] + ldr r0, =sub_81718D8 + str r0, [r6, 0x1C] +_081718BC: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81717F8 + + thumb_func_start sub_81718D8 +sub_81718D8: @ 81718D8 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08171944 + cmp r0, 0x1 + bgt _081718F0 + cmp r0, 0 + beq _081718F6 + b _0817198A +_081718F0: + cmp r0, 0x2 + beq _08171976 + b _0817198A +_081718F6: + strh r0, [r4, 0x30] + strh r0, [r4, 0x32] + ldrb r1, [r4, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4, 0x1] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0x10 + bl SetGpuReg + ldr r0, [r4, 0x14] + ldrh r0, [r0, 0x2] + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x10 + movs r1, 0x1 + lsls r1, r0 + ldr r0, =0x00007fff + str r0, [sp] + adds r0, r1, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _08171982 + .pool +_08171944: + ldrh r0, [r4, 0x30] + adds r1, r0, 0x1 + strh r1, [r4, 0x30] + lsls r0, 16 + cmp r0, 0 + ble _081719B0 + movs r0, 0 + strh r0, [r4, 0x30] + ldrh r2, [r4, 0x32] + adds r2, 0x1 + strh r2, [r4, 0x32] + lsls r1, r2, 8 + movs r0, 0x10 + subs r0, r2 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _081719B0 + b _08171982 +_08171976: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_08171982: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _081719B0 +_0817198A: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081719B0 + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + strh r5, [r4, 0x2E] + ldr r0, =sub_81719C0 + str r0, [r4, 0x1C] +_081719B0: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81718D8 + + thumb_func_start sub_81719C0 +sub_81719C0: @ 81719C0 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _081719D8 + ldr r0, =0x0000ffff + strh r0, [r4, 0x2E] + b _081719E4 + .pool +_081719D8: + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_081719E4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81719C0 + + thumb_func_start sub_81719EC +sub_81719EC: @ 81719EC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r6, r0, 0 + adds r1, r6, 0 + adds r1, 0x43 + ldrb r0, [r1] + cmp r0, 0 + beq _08171A0C + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + b _08171A14 +_08171A0C: + movs r0, 0 + mov r8, r0 + movs r0, 0x1 + strb r0, [r1] +_08171A14: + movs r0, 0x4 + bl sub_8171D60 + movs r7, 0 + ldr r2, =0x02020630 + mov r9, r2 + movs r0, 0x1C + add r0, r9 + mov r10, r0 +_08171A26: + movs r2, 0x20 + ldrsh r1, [r6, r2] + movs r0, 0x22 + ldrsh r2, [r6, r0] + ldr r0, =gUnknown_085E5250 + mov r3, r8 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _08171A82 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + mov r2, r9 + adds r5, r4, r2 + movs r0, 0x18 + strh r0, [r5, 0x2E] + ldr r0, =gUnknown_085E5088 + lsls r1, r7, 2 + adds r1, r0 + movs r0, 0 + ldrsb r0, [r1, r0] + ldrh r2, [r6, 0x20] + adds r0, r2 + strh r0, [r5, 0x32] + movs r0, 0x1 + ldrsb r0, [r1, r0] + ldrh r2, [r6, 0x22] + adds r0, r2 + strh r0, [r5, 0x36] + movs r0, 0x2 + ldrsb r0, [r1, r0] + strh r0, [r5, 0x38] + adds r0, r5, 0 + bl sub_80A68D4 + add r4, r10 + ldr r0, =sub_8171AAC + str r0, [r4] + ldr r0, =gUnknown_085E51B4 + ldrb r1, [r0, 0x4] + adds r0, r5, 0 + bl StartObjectImageAnim +_08171A82: + adds r7, 0x1 + cmp r7, 0x2 + bls _08171A26 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81719EC + + thumb_func_start sub_8171AAC +sub_8171AAC: @ 8171AAC + push {r4,lr} + adds r4, r0, 0 + adds r3, r4, 0 + adds r3, 0x3E + ldrb r2, [r3] + lsrs r1, r2, 2 + movs r0, 0x1 + eors r1, r0 + ands r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + adds r0, r4, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _08171ADC + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_08171ADC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8171AAC + + thumb_func_start sub_8171AE4 +sub_8171AE4: @ 8171AE4 + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r1, 0x1 + bl StartObjectImageAnim + adds r0, r4, 0 + movs r1, 0 + bl StartObjectRotScalAnim + ldr r0, =sub_8171BAC + str r0, [r4, 0x1C] + ldr r0, =0x02024208 + ldrh r0, [r0] + bl ball_number_to_ball_processing_index + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xB + bgt _08171B36 + cmp r5, 0 + blt _08171B36 + ldrh r0, [r4, 0x20] + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r4, 0x22] + subs r1, 0x5 + lsls r1, 24 + lsrs r1, 24 + str r5, [sp] + movs r2, 0x1 + movs r3, 0x1C + bl sub_8171D98 + ldr r0, =0x02038437 + ldrb r1, [r0] + movs r0, 0x1 + movs r2, 0xE + adds r3, r5, 0 + bl sub_81729E8 +_08171B36: + ldr r6, =0x02020630 + ldr r5, =0x020241e4 + ldr r4, =0x02038437 + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x1 + bl StartObjectRotScalAnim + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl AnimateObject + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r1, 0x80 + lsls r1, 5 + strh r1, [r0, 0x30] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8171AE4 + + thumb_func_start sub_8171BAC +sub_8171BAC: @ 8171BAC + push {r4-r7,lr} + adds r7, r0, 0 + movs r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08171BCA + adds r2, r7, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_08171BCA: + ldr r4, =0x02020630 + ldr r3, =0x020241e4 + ldr r2, =0x02038437 + ldrb r0, [r2] + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r4 + adds r0, r1, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _08171C04 + adds r0, r1, 0 + movs r1, 0 + bl StartObjectRotScalAnim + movs r5, 0x1 + b _08171C24 + .pool +_08171C04: + ldr r6, =0xfffffee0 + adds r0, r6, 0 + ldrh r6, [r1, 0x30] + adds r0, r6 + strh r0, [r1, 0x30] + ldrb r0, [r2] + adds r0, r3 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 24 + strh r0, [r1, 0x26] +_08171C24: + adds r0, r7, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08171C8A + cmp r5, 0 + beq _08171C8A + ldr r4, =0x02020630 + ldr r3, =0x020241e4 + ldr r2, =0x02038437 + ldrb r0, [r2] + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r6, 0 + movs r5, 0 + strh r5, [r0, 0x26] + ldrb r0, [r2] + adds r0, r3 + ldrb r0, [r0] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r4 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r1, [r0, 0x9] + lsls r1, 30 + adds r2, 0x3E + lsrs r1, 31 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + strh r5, [r7, 0x2E] + ldr r0, =sub_81719C0 + str r0, [r7, 0x1C] + ldr r0, =0x020244b9 + strb r6, [r0] + movs r0, 0x1 + bl sub_8072A88 +_08171C8A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8171BAC + + thumb_func_start sub_8171CAC +sub_8171CAC: @ 8171CAC + push {r4,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x24] + ldrh r1, [r2, 0x20] + adds r0, r1 + movs r1, 0 + strh r0, [r2, 0x20] + ldrh r0, [r2, 0x26] + ldrh r3, [r2, 0x22] + adds r0, r3 + strh r0, [r2, 0x22] + strh r1, [r2, 0x26] + strh r1, [r2, 0x24] + ldr r4, =sub_8171CE8 + movs r3, 0 + movs r1, 0x5 + adds r0, r2, 0 + adds r0, 0x38 +_08171CD0: + strh r3, [r0] + subs r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08171CD0 + str r4, [r2, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8171CAC + + thumb_func_start sub_8171CE8 +sub_8171CE8: @ 8171CE8 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x80 + lsls r0, 4 + adds r2, r0, 0 + ldrh r1, [r4, 0x2E] + adds r2, r1 + movs r0, 0xD0 + lsls r0, 3 + adds r3, r0, 0 + ldrh r1, [r4, 0x30] + adds r3, r1 + lsls r1, r3, 16 + asrs r1, 24 + ldrh r0, [r4, 0x24] + subs r0, r1 + strh r0, [r4, 0x24] + lsls r0, r2, 16 + asrs r0, 24 + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + movs r0, 0xFF + ands r2, r0 + strh r2, [r4, 0x2E] + ands r3, r0 + strh r3, [r4, 0x30] + movs r2, 0x22 + ldrsh r0, [r4, r2] + movs r2, 0x26 + ldrsh r1, [r4, r2] + adds r0, r1 + cmp r0, 0xA0 + bgt _08171D3E + movs r1, 0x20 + ldrsh r0, [r4, r1] + movs r2, 0x24 + ldrsh r1, [r4, r2] + adds r0, r1 + movs r1, 0x8 + negs r1, r1 + cmp r0, r1 + bge _08171D52 +_08171D3E: + movs r0, 0 + strh r0, [r4, 0x2E] + ldr r0, =sub_81719C0 + str r0, [r4, 0x1C] + ldr r1, =0x020244b9 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + bl sub_8072A88 +_08171D52: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8171CE8 + + thumb_func_start sub_8171D60 +sub_8171D60: @ 8171D60 + push {r4,r5,lr} + lsls r0, 24 + ldr r1, =gUnknown_085E5094 + lsrs r5, r0, 21 + adds r4, r5, r1 + ldrh r0, [r4, 0x6] + bl GetObjectTileRangeStartByTag + lsls r0, 16 + ldr r1, =0xffff0000 + cmp r0, r1 + bne _08171D86 + adds r0, r4, 0 + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_085E50F4 + adds r0, r5, r0 + bl LoadCompressedObjectPaletteUsingHeap +_08171D86: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8171D60 + + thumb_func_start sub_8171D98 +sub_8171D98: @ 8171D98 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + adds r6, r0, 0 + mov r8, r1 + mov r9, r2 + mov r10, r3 + ldr r5, [sp, 0x1C] + lsls r6, 24 + lsrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r1, r9 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r5, 0 + bl sub_8171D60 + ldr r1, =gUnknown_085E51C0 + lsls r0, r5, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x5 + bl CreateTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0xA] + mov r1, r8 + strh r1, [r0, 0xC] + mov r1, r9 + strh r1, [r0, 0xE] + mov r1, r10 + strh r1, [r0, 0x10] + strh r5, [r0, 0x26] + movs r0, 0xF + bl audio_play + adds r0, r4, 0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8171D98 + + thumb_func_start sub_8171E20 +sub_8171E20: @ 8171E20 + push {lr} + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08171E3E + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0x8] + ldrb r0, [r1, 0xA] + adds r0, 0x1 + strb r0, [r1, 0xA] +_08171E3E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8171E20 + + thumb_func_start sub_8171E50 +sub_8171E50: @ 8171E50 + 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, =0x03005e00 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r6, r0, r1 + ldrh r0, [r6, 0x26] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r2, 0x8 + ldrsh r0, [r6, r2] + adds r2, r1, 0 + cmp r0, 0xF + bgt _08171F48 + ldrb r1, [r6, 0xA] + ldrb r2, [r6, 0xC] + ldrb r4, [r6, 0xE] + mov r9, r4 + ldrb r3, [r6, 0x10] + ldr r4, [sp] + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + ldr r4, =gUnknown_085E51F0 + adds r0, r4 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + cmp r0, 0x40 + beq _08171EEC + bl sub_8171E20 + mov r0, r10 + lsls r4, r0, 4 + add r4, r10 + lsls r4, 2 + ldr r5, =0x02020630 + adds r7, r4, r5 + ldr r0, =gUnknown_085E51B4 + ldr r1, [sp] + adds r0, r1, r0 + ldrb r1, [r0] + adds r0, r7, 0 + bl StartObjectImageAnim + adds r5, 0x1C + adds r4, r5 + ldr r0, =sub_8171F68 + str r0, [r4] + movs r0, 0x3 + mov r2, r9 + ands r2, r0 + lsls r2, 2 + ldrb r1, [r7, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + orrs r0, r2 + strb r0, [r7, 0x5] + ldrb r0, [r6, 0x8] + cmp r0, 0x7 + bls _08171EE8 + subs r0, 0x8 + lsls r0, 24 + lsrs r0, 24 +_08171EE8: + lsls r0, 5 + strh r0, [r7, 0x2E] +_08171EEC: + ldr r0, =0x03005e00 + mov r4, r8 + lsls r1, r4, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r2, 0x8 + ldrsh r1, [r1, r2] + adds r2, r0, 0 + cmp r1, 0xF + bne _08171F48 + ldr r0, =0x030022c0 + ldr r4, =0x00000439 + adds r0, r4 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08171F22 + ldr r0, =0x02020630 + mov r2, r10 + lsls r1, r2, 4 + add r1, r10 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_08171F22: + mov r0, r8 + bl DestroyTask + b _08171F58 + .pool +_08171F48: + mov r4, r8 + lsls r0, r4, 2 + add r0, r8 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] +_08171F58: + 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_8171E50 + + thumb_func_start sub_8171F68 +sub_8171F68: @ 8171F68 + push {lr} + adds r1, r0, 0 + ldrh r2, [r1, 0x30] + movs r3, 0x30 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _08171F80 + ldr r0, =sub_8171F88 + str r0, [r1, 0x1C] + b _08171F84 + .pool +_08171F80: + subs r0, r2, 0x1 + strh r0, [r1, 0x30] +_08171F84: + pop {r0} + bx r0 + thumb_func_end sub_8171F68 + + thumb_func_start sub_8171F88 +sub_8171F88: @ 8171F88 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r2, 0x30 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r2, 0x30 + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0x2 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x32 + bne _08171FBC + adds r0, r4, 0 + bl sub_8172944 +_08171FBC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8171F88 + + thumb_func_start sub_8171FC4 +sub_8171FC4: @ 8171FC4 + 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 r9, r0 + ldr r0, =0x03005e00 + mov r2, r9 + lsls r1, r2, 2 + add r1, r9 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrb r3, [r1, 0xA] + str r3, [sp] + ldrb r0, [r1, 0xC] + str r0, [sp, 0x4] + ldrb r2, [r1, 0xE] + str r2, [sp, 0x8] + ldrb r1, [r1, 0x10] + str r1, [sp, 0xC] + movs r7, 0 + ldr r3, =0x02020630 + mov r10, r3 + mov r1, r8 + lsls r0, r1, 1 + add r0, r8 + lsls r0, 3 + str r0, [sp, 0x10] +_0817200A: + ldr r0, =gUnknown_085E51F0 + ldr r2, [sp, 0x10] + adds r0, r2, r0 + ldr r1, [sp] + ldr r2, [sp, 0x4] + ldr r3, [sp, 0xC] + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _0817206A + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + mov r3, r10 + adds r5, r4, r3 + ldr r0, =gUnknown_085E51B4 + add r0, r8 + ldrb r1, [r0] + adds r0, r5, 0 + bl StartObjectImageAnim + ldr r0, =0x0202064c + adds r4, r0 + ldr r0, =sub_8172508 + str r0, [r4] + movs r0, 0x3 + ldr r2, [sp, 0x8] + ands r2, r0 + lsls r2, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r0, r7, 5 + strh r0, [r5, 0x2E] + movs r0, 0xA + strh r0, [r5, 0x36] + movs r0, 0x2 + strh r0, [r5, 0x38] + movs r0, 0x1 + strh r0, [r5, 0x3A] +_0817206A: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x7 + bls _0817200A + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08172092 + ldr r0, =0x02020630 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_08172092: + mov r0, r9 + bl DestroyTask + 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_8171FC4 + + thumb_func_start sub_81720C8 +sub_81720C8: @ 81720C8 + 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 r9, r0 + ldr r0, =0x03005e00 + mov r2, r9 + lsls r1, r2, 2 + add r1, r9 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrb r3, [r1, 0xA] + str r3, [sp] + ldrb r0, [r1, 0xC] + str r0, [sp, 0x4] + ldrb r2, [r1, 0xE] + str r2, [sp, 0x8] + ldrb r1, [r1, 0x10] + str r1, [sp, 0xC] + movs r7, 0 + ldr r3, =0x02020630 + mov r10, r3 + mov r1, r8 + lsls r0, r1, 1 + add r0, r8 + lsls r0, 3 + str r0, [sp, 0x10] +_0817210E: + ldr r0, =gUnknown_085E51F0 + ldr r2, [sp, 0x10] + adds r0, r2, r0 + ldr r1, [sp] + ldr r2, [sp, 0x4] + ldr r3, [sp, 0xC] + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _0817216E + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + mov r3, r10 + adds r5, r4, r3 + ldr r0, =gUnknown_085E51B4 + add r0, r8 + ldrb r1, [r0] + adds r0, r5, 0 + bl StartObjectImageAnim + ldr r0, =0x0202064c + adds r4, r0 + ldr r0, =sub_8172508 + str r0, [r4] + movs r0, 0x3 + ldr r2, [sp, 0x8] + ands r2, r0 + lsls r2, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r0, r7, 5 + strh r0, [r5, 0x2E] + movs r0, 0xA + strh r0, [r5, 0x36] + movs r0, 0x1 + strh r0, [r5, 0x38] + movs r0, 0x2 + strh r0, [r5, 0x3A] +_0817216E: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x7 + bls _0817210E + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08172196 + ldr r0, =0x02020630 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_08172196: + mov r0, r9 + bl DestroyTask + 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_81720C8 + + thumb_func_start sub_81721CC +sub_81721CC: @ 81721CC + 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 r9, r0 + ldr r1, =0x03005e00 + lsls r0, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x26] + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r0, 0xA] + str r2, [sp] + ldrb r3, [r0, 0xC] + str r3, [sp, 0x4] + ldrb r2, [r0, 0xE] + str r2, [sp, 0x8] + ldrb r0, [r0, 0x10] + str r0, [sp, 0xC] + movs r7, 0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + str r0, [sp, 0x10] + ldr r3, =0x02020630 + mov r8, r3 + ldr r0, =gUnknown_085E51B4 + adds r1, r0 + mov r10, r1 +_08172212: + ldr r0, =gUnknown_085E51F0 + ldr r1, [sp, 0x10] + adds r0, r1, r0 + ldr r1, [sp] + ldr r2, [sp, 0x4] + ldr r3, [sp, 0xC] + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _0817226E + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + mov r2, r8 + adds r5, r4, r2 + mov r3, r10 + ldrb r1, [r3] + adds r0, r5, 0 + bl StartObjectImageAnim + ldr r0, =0x0202064c + adds r4, r0 + ldr r0, =sub_8172508 + str r0, [r4] + movs r0, 0x3 + ldr r2, [sp, 0x8] + ands r2, r0 + lsls r2, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r0, r7, 5 + strh r0, [r5, 0x2E] + movs r0, 0x4 + strh r0, [r5, 0x36] + movs r0, 0x1 + strh r0, [r5, 0x38] + strh r0, [r5, 0x3A] +_0817226E: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x7 + bls _08172212 + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08172296 + ldr r0, =0x02020630 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_08172296: + mov r0, r9 + bl DestroyTask + 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_81721CC + + thumb_func_start sub_81722CC +sub_81722CC: @ 81722CC + 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 r9, r0 + ldr r0, =0x03005e00 + mov r2, r9 + lsls r1, r2, 2 + add r1, r9 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldrb r3, [r1, 0xA] + str r3, [sp] + ldrb r0, [r1, 0xC] + str r0, [sp, 0x4] + ldrb r2, [r1, 0xE] + str r2, [sp, 0x8] + ldrb r1, [r1, 0x10] + str r1, [sp, 0xC] + movs r7, 0 + ldr r3, =0x02020630 + mov r10, r3 + mov r1, r8 + lsls r0, r1, 1 + add r0, r8 + lsls r0, 3 + str r0, [sp, 0x10] +_08172312: + ldr r0, =gUnknown_085E51F0 + ldr r2, [sp, 0x10] + adds r0, r2, r0 + ldr r1, [sp] + ldr r2, [sp, 0x4] + ldr r3, [sp, 0xC] + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _08172376 + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + mov r3, r10 + adds r5, r4, r3 + ldr r0, =gUnknown_085E51B4 + add r0, r8 + ldrb r1, [r0] + adds r0, r5, 0 + bl StartObjectImageAnim + ldr r0, =0x0202064c + adds r4, r0 + ldr r0, =sub_8172508 + str r0, [r4] + movs r0, 0x3 + ldr r2, [sp, 0x8] + ands r2, r0 + lsls r2, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 3 + adds r0, r7 + strh r0, [r5, 0x2E] + movs r0, 0x5 + strh r0, [r5, 0x36] + movs r0, 0x1 + strh r0, [r5, 0x38] + strh r0, [r5, 0x3A] +_08172376: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x9 + bls _08172312 + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0817239E + ldr r0, =0x02020630 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_0817239E: + mov r0, r9 + bl DestroyTask + 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_81722CC + + thumb_func_start sub_81723D4 +sub_81723D4: @ 81723D4 + 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 + mov r8, r0 + ldr r1, =0x03005e00 + lsls r2, r0, 2 + adds r0, r2, r0 + lsls r0, 3 + adds r3, r0, r1 + ldrh r1, [r3, 0x16] + movs r4, 0x16 + ldrsh r0, [r3, r4] + cmp r0, 0 + beq _08172404 + subs r0, r1, 0x1 + strh r0, [r3, 0x16] + b _081724D6 + .pool +_08172404: + ldrh r0, [r3, 0x26] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r3, 0xA] + str r1, [sp] + ldrb r4, [r3, 0xC] + str r4, [sp, 0x4] + ldrb r1, [r3, 0xE] + str r1, [sp, 0x8] + ldrb r3, [r3, 0x10] + str r3, [sp, 0xC] + movs r7, 0 + str r2, [sp, 0x14] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + str r1, [sp, 0x10] + ldr r3, =0x02020630 + mov r9, r3 + ldr r1, =gUnknown_085E51B4 + adds r0, r1 + mov r10, r0 +_08172430: + ldr r0, =gUnknown_085E51F0 + ldr r4, [sp, 0x10] + adds r0, r4, r0 + ldr r1, [sp] + ldr r2, [sp, 0x4] + ldr r3, [sp, 0xC] + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _0817248C + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + mov r0, r9 + adds r5, r4, r0 + mov r3, r10 + ldrb r1, [r3] + adds r0, r5, 0 + bl StartObjectImageAnim + ldr r0, =0x0202064c + adds r4, r0 + ldr r0, =sub_8172508 + str r0, [r4] + movs r0, 0x3 + ldr r2, [sp, 0x8] + ands r2, r0 + lsls r2, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r0, r7, 5 + strh r0, [r5, 0x2E] + movs r0, 0x8 + strh r0, [r5, 0x36] + movs r0, 0x2 + strh r0, [r5, 0x38] + strh r0, [r5, 0x3A] +_0817248C: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x7 + bls _08172430 + ldr r0, =0x03005e00 + ldr r1, [sp, 0x14] + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0x8 + strh r0, [r1, 0x16] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0x2 + bne _081724D6 + ldr r0, =0x030022c0 + ldr r4, =0x00000439 + adds r0, r4 + ldrb r1, [r0] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _081724D0 + ldr r0, =0x02020630 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_081724D0: + mov r0, r8 + bl DestroyTask +_081724D6: + 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_81723D4 + + thumb_func_start sub_8172508 +sub_8172508: @ 8172508 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r2, 0x30 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r2, 0x32 + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x36] + ldrh r1, [r4, 0x2E] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x38] + ldrh r2, [r4, 0x30] + adds r0, r2 + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x3A] + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x33 + bne _08172558 + adds r0, r4, 0 + bl sub_8172944 +_08172558: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8172508 + + thumb_func_start sub_8172560 +sub_8172560: @ 8172560 + 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 r9, r0 + ldr r1, =0x03005e00 + lsls r0, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x26] + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r0, 0xA] + str r2, [sp] + ldrb r3, [r0, 0xC] + str r3, [sp, 0x4] + ldrb r2, [r0, 0xE] + str r2, [sp, 0x8] + ldrb r0, [r0, 0x10] + str r0, [sp, 0xC] + movs r7, 0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + str r0, [sp, 0x10] + ldr r3, =0x02020630 + mov r8, r3 + ldr r0, =gUnknown_085E51B4 + adds r1, r0 + mov r10, r1 +_081725A6: + ldr r0, =gUnknown_085E51F0 + ldr r1, [sp, 0x10] + adds r0, r1, r0 + ldr r1, [sp] + ldr r2, [sp, 0x4] + ldr r3, [sp, 0xC] + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _081725FE + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + mov r2, r8 + adds r5, r4, r2 + mov r3, r10 + ldrb r1, [r3] + adds r0, r5, 0 + bl StartObjectImageAnim + ldr r0, =0x0202064c + adds r4, r0 + ldr r0, =sub_817265C + str r0, [r4] + movs r0, 0x3 + ldr r2, [sp, 0x8] + ands r2, r0 + lsls r2, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 2 + adds r0, r7 + strh r0, [r5, 0x2E] +_081725FE: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0xB + bls _081725A6 + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08172626 + ldr r0, =0x02020630 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_08172626: + mov r0, r9 + bl DestroyTask + 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_8172560 + + thumb_func_start sub_817265C +sub_817265C: @ 817265C + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + movs r2, 0x30 + ldrsh r1, [r5, r2] + bl sine + strh r0, [r5, 0x24] + movs r0, 0x2E + ldrsh r4, [r5, r0] + movs r2, 0x32 + ldrsh r1, [r5, r2] + adds r0, r4, 0 + bl sine + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl cosine + strh r0, [r5, 0x26] + ldrh r0, [r5, 0x2E] + adds r0, 0x6 + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x30] + adds r0, 0x1 + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x34] + adds r0, 0x1 + strh r0, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x33 + bne _081726B4 + adds r0, r5, 0 + bl sub_8172944 +_081726B4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_817265C + + thumb_func_start sub_81726BC +sub_81726BC: @ 81726BC + 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] + ldr r0, =0x03005e00 + ldr r2, [sp] + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldrb r3, [r1, 0xA] + str r3, [sp, 0x4] + ldrb r0, [r1, 0xC] + str r0, [sp, 0x8] + ldrb r2, [r1, 0xE] + str r2, [sp, 0xC] + ldrb r1, [r1, 0x10] + str r1, [sp, 0x10] + movs r3, 0 + mov r8, r3 + mov r1, r9 + lsls r0, r1, 1 + add r0, r9 + lsls r0, 3 + str r0, [sp, 0x14] +_08172700: + movs r7, 0 + movs r2, 0x1 + add r2, r8 + mov r10, r2 +_08172708: + ldr r0, =gUnknown_085E51F0 + ldr r3, [sp, 0x14] + adds r0, r3, r0 + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + ldr r3, [sp, 0x10] + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _08172790 + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + ldr r0, =0x02020630 + adds r5, r4, r0 + ldr r0, =gUnknown_085E51B4 + add r0, r9 + ldrb r1, [r0] + adds r0, r5, 0 + bl StartObjectImageAnim + ldr r1, =0x0202064c + adds r4, r1 + ldr r0, =sub_8172508 + str r0, [r4] + movs r0, 0x3 + ldr r1, [sp, 0xC] + ands r1, r0 + lsls r1, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r2, r3, 0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x5] + lsls r0, r7, 5 + strh r0, [r5, 0x2E] + movs r0, 0x8 + strh r0, [r5, 0x36] + mov r0, r8 + cmp r0, 0 + bne _08172788 + movs r0, 0x2 + strh r0, [r5, 0x38] + movs r0, 0x1 + b _0817278E + .pool +_08172788: + movs r0, 0x1 + strh r0, [r5, 0x38] + movs r0, 0x2 +_0817278E: + strh r0, [r5, 0x3A] +_08172790: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x7 + bls _08172708 + mov r1, r10 + lsls r0, r1, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x1 + bls _08172700 + ldr r0, =0x030022c0 + ldr r2, =0x00000439 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _081727C4 + ldr r0, =0x02020630 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_081727C4: + ldr r0, [sp] + bl DestroyTask + 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_81726BC + + thumb_func_start sub_81727E8 +sub_81727E8: @ 81727E8 + 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 r9, r0 + ldr r1, =0x03005e00 + lsls r0, 2 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x26] + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r0, 0xA] + str r2, [sp] + ldrb r3, [r0, 0xC] + str r3, [sp, 0x4] + ldrb r2, [r0, 0xE] + str r2, [sp, 0x8] + ldrb r0, [r0, 0x10] + str r0, [sp, 0xC] + movs r7, 0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + str r0, [sp, 0x10] + ldr r3, =0x02020630 + mov r8, r3 + ldr r0, =gUnknown_085E51B4 + adds r1, r0 + mov r10, r1 +_0817282E: + ldr r0, =gUnknown_085E51F0 + ldr r1, [sp, 0x10] + adds r0, r1, r0 + ldr r1, [sp] + ldr r2, [sp, 0x4] + ldr r3, [sp, 0xC] + bl AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x40 + beq _08172880 + bl sub_8171E20 + lsls r4, r6, 4 + adds r4, r6 + lsls r4, 2 + mov r2, r8 + adds r5, r4, r2 + mov r3, r10 + ldrb r1, [r3] + adds r0, r5, 0 + bl StartObjectImageAnim + ldr r0, =0x0202064c + adds r4, r0 + ldr r0, =sub_81728E0 + str r0, [r4] + movs r0, 0x3 + ldr r2, [sp, 0x8] + ands r2, r0 + lsls r2, 2 + ldrb r0, [r5, 0x5] + movs r3, 0xD + negs r3, r3 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + strb r0, [r5, 0x5] + lsls r0, r7, 5 + strh r0, [r5, 0x2E] +_08172880: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x7 + bls _0817282E + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _081728A8 + ldr r0, =0x02020630 + lsls r1, r6, 4 + adds r1, r6 + lsls r1, 2 + adds r1, r0 + movs r0, 0x1 + strh r0, [r1, 0x3C] +_081728A8: + mov r0, r9 + bl DestroyTask + 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_81727E8 + + thumb_func_start sub_81728E0 +sub_81728E0: @ 81728E0 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + movs r2, 0x30 + ldrsh r1, [r5, r2] + bl sine + strh r0, [r5, 0x24] + movs r0, 0x2E + ldrsh r4, [r5, r0] + ldrh r1, [r5, 0x2E] + movs r0, 0x3F + ands r0, r1 + movs r2, 0x32 + ldrsh r1, [r5, r2] + bl sine + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl cosine + strh r0, [r5, 0x26] + ldrh r0, [r5, 0x2E] + adds r0, 0xA + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x30] + adds r0, 0x1 + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x34] + adds r0, 0x1 + strh r0, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x33 + bne _0817293C + adds r0, r5, 0 + bl sub_8172944 +_0817293C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81728E0 + + thumb_func_start sub_8172944 +sub_8172944: @ 8172944 + push {r4-r7,lr} + adds r7, r0, 0 + ldr r0, =0x030022c0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08172970 + movs r1, 0x3C + ldrsh r0, [r7, r1] + cmp r0, 0x1 + bne _081729CA + adds r0, r7, 0 + bl RemoveObjectAndFreeResources + b _081729E2 + .pool +_08172970: + ldr r2, =0x020244d0 + ldr r0, [r2] + ldr r1, [r0, 0x8] + ldrb r0, [r1, 0xA] + subs r0, 0x1 + strb r0, [r1, 0xA] + ldr r0, [r2] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0xA] + cmp r0, 0 + bne _081729DC + movs r4, 0 + ldr r5, =gUnknown_085E51C0 + b _08172998 + .pool +_08172994: + adds r5, 0x4 + adds r4, 0x1 +_08172998: + cmp r4, 0xB + bgt _081729AA + ldr r0, [r5] + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08172994 +_081729AA: + cmp r4, 0xC + bne _081729CA + movs r6, 0 + ldr r5, =gUnknown_085E5094 + ldr r4, =gUnknown_085E50F4 +_081729B4: + ldrh r0, [r5, 0x6] + bl FreeObjectTilesByTag + ldrh r0, [r4, 0x4] + bl FreeObjectPaletteByTag + adds r5, 0x8 + adds r4, 0x8 + adds r6, 0x1 + cmp r6, 0xB + ble _081729B4 +_081729CA: + adds r0, r7, 0 + bl RemoveObjectAndFreeTiles + b _081729E2 + .pool +_081729DC: + adds r0, r7, 0 + bl RemoveObjectAndFreeTiles +_081729E2: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8172944 + + thumb_func_start sub_81729E8 +sub_81729E8: @ 81729E8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r4, r0, 0 + mov r9, r2 + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r3, 24 + lsrs r7, r3, 24 + ldr r0, =sub_8172AB0 + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =0x03005e00 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r5, r0, r1 + strh r7, [r5, 0x26] + strh r6, [r5, 0xE] + mov r0, r9 + strh r0, [r5, 0x1C] + mov r1, r9 + lsrs r0, r1, 16 + strh r0, [r5, 0x1E] + cmp r4, 0 + bne _08172A58 + lsls r0, r6, 20 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r0, 16 + ldr r2, =gUnknown_085E5310 + lsls r1, r7, 1 + adds r1, r2 + ldrh r3, [r1] + movs r1, 0x10 + movs r2, 0 + bl pal_fade_1 + movs r0, 0x1 + strh r0, [r5, 0xA] + b _08172A7E + .pool +_08172A58: + lsls r0, r6, 20 + movs r1, 0x80 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + ldr r2, =gUnknown_085E5310 + lsls r1, r7, 1 + adds r1, r2 + ldrh r3, [r1] + movs r1, 0x10 + movs r2, 0x10 + bl pal_fade_1 + movs r0, 0x10 + strh r0, [r5, 0x8] + ldr r0, =0x0000ffff + strh r0, [r5, 0xA] + ldr r0, =sub_8172B40 + str r0, [r5] +_08172A7E: + ldr r0, =0x00007fff + str r0, [sp] + mov r0, r9 + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + mov r0, r8 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81729E8 + + thumb_func_start sub_8172AB0 +sub_8172AB0: @ 8172AB0 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0x10 + bgt _08172B08 + movs r2, 0xE + ldrsh r0, [r4, r2] + lsls r0, 20 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r0, 16 + ldrb r2, [r4, 0x8] + ldr r3, =gUnknown_085E5310 + lsls r1, 1 + adds r1, r3 + ldrh r3, [r1] + movs r1, 0x10 + bl pal_fade_1 + ldrh r0, [r4, 0xA] + ldrh r1, [r4, 0x8] + adds r0, r1 + strh r0, [r4, 0x8] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + b _08172B30 + .pool +_08172B08: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08172B30 + ldrh r0, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + lsls r1, 16 + orrs r0, r1 + ldr r1, =0x00007fff + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + adds r0, r5, 0 + bl DestroyTask +_08172B30: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8172AB0 + + thumb_func_start sub_8172B40 +sub_8172B40: @ 8172B40 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08172B78 + ldr r0, =0x03005e00 + lsls r4, r2, 2 + adds r4, r2 + lsls r4, 3 + adds r4, r0 + ldrh r0, [r4, 0x1C] + ldrh r1, [r4, 0x1E] + lsls r1, 16 + orrs r0, r1 + ldr r1, =0x00007fff + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =sub_8172B90 + str r0, [r4] +_08172B78: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8172B40 + + thumb_func_start sub_8172B90 +sub_8172B90: @ 8172B90 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r1, r0, 24 + movs r3, 0xC + ldrsh r0, [r4, r3] + cmp r0, 0x10 + bgt _08172BE4 + movs r2, 0xE + ldrsh r0, [r4, r2] + lsls r0, 20 + movs r3, 0x80 + lsls r3, 17 + adds r0, r3 + lsrs r0, 16 + ldrb r2, [r4, 0x8] + ldr r3, =gUnknown_085E5310 + lsls r1, 1 + adds r1, r3 + ldrh r3, [r1] + movs r1, 0x10 + bl pal_fade_1 + ldrh r0, [r4, 0xA] + ldrh r1, [r4, 0x8] + adds r0, r1 + strh r0, [r4, 0x8] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + b _08172BEA + .pool +_08172BE4: + adds r0, r2, 0 + bl DestroyTask +_08172BEA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8172B90 + + thumb_func_start sub_8172BF0 +sub_8172BF0: @ 8172BF0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0 + mov r8, r0 + ldr r0, =0x020241e4 + ldr r3, =0x02038436 + ldrb r2, [r3] + adds r0, r2, r0 + ldrb r6, [r0] + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0x1C + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _08172CC8 + cmp r0, 0x1 + bgt _08172C30 + cmp r0, 0 + beq _08172C36 + b _08172D8A + .pool +_08172C30: + cmp r0, 0x2 + beq _08172CDA + b _08172D8A +_08172C36: + ldr r0, =0x0203841e + ldrh r0, [r0] + strh r0, [r5, 0x1E] + movs r2, 0xA0 + lsls r2, 3 + adds r0, r2, 0 + ldrh r4, [r5, 0x8] + adds r0, r4 + strh r0, [r5, 0x8] + ldrb r0, [r3] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08172C78 + ldr r2, =0x02020630 + lsls r3, r6, 4 + adds r1, r3, r6 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r5, 0x8] + lsls r0, 16 + asrs r0, 24 + ldrh r4, [r1, 0x24] + adds r0, r4 + strh r0, [r1, 0x24] + adds r4, r3, 0 + b _08172C90 + .pool +_08172C78: + ldr r3, =0x02020630 + lsls r4, r6, 4 + adds r2, r4, r6 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r5, 0x8] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + adds r2, r3, 0 +_08172C90: + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r3, r0, r1 + ldrb r0, [r3, 0x8] + strh r0, [r3, 0x8] + adds r0, r4, r6 + lsls r0, 2 + adds r0, r2 + movs r2, 0x20 + ldrsh r1, [r0, r2] + movs r4, 0x24 + ldrsh r0, [r0, r4] + adds r1, r0 + adds r1, 0x20 + movs r0, 0x98 + lsls r0, 1 + cmp r1, r0 + bls _08172D8A + ldrh r0, [r3, 0x1C] + adds r0, 0x1 + strh r0, [r3, 0x1C] + b _08172D8A + .pool +_08172CC8: + ldrb r1, [r5, 0x1E] + adds r0, r2, 0 + adds r2, r6, 0 + bl refresh_graphics_maybe + ldrh r0, [r5, 0x1C] + adds r0, 0x1 + strh r0, [r5, 0x1C] + b _08172D8A +_08172CDA: + movs r1, 0xA0 + lsls r1, 3 + adds r0, r1, 0 + ldrh r2, [r5, 0x8] + adds r0, r2 + strh r0, [r5, 0x8] + ldrb r0, [r3] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _08172D10 + ldr r0, =0x02020630 + lsls r3, r6, 4 + adds r2, r3, r6 + lsls r2, 2 + adds r2, r0 + ldrh r1, [r5, 0x8] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + adds r4, r3, 0 + b _08172D28 + .pool +_08172D10: + ldr r0, =0x02020630 + lsls r2, r6, 4 + adds r1, r2, r6 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r5, 0x8] + lsls r0, 16 + asrs r0, 24 + ldrh r3, [r1, 0x24] + adds r0, r3 + strh r0, [r1, 0x24] + adds r4, r2, 0 +_08172D28: + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x8] + strh r1, [r0, 0x8] + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _08172D68 + ldr r0, =0x02020630 + adds r1, r4, r6 + lsls r1, 2 + adds r1, r0 + movs r4, 0x24 + ldrsh r0, [r1, r4] + cmp r0, 0 + bgt _08172D7E + movs r0, 0 + strh r0, [r1, 0x24] + b _08172D84 + .pool +_08172D68: + ldr r0, =0x02020630 + adds r1, r4, r6 + lsls r1, 2 + adds r1, r0 + movs r3, 0x24 + ldrsh r0, [r1, r3] + cmp r0, 0 + blt _08172D7E + strh r2, [r1, 0x24] + movs r4, 0x1 + mov r8, r4 +_08172D7E: + mov r0, r8 + cmp r0, 0 + beq _08172D8A +_08172D84: + adds r0, r7, 0 + bl move_anim_task_del +_08172D8A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8172BF0 + + thumb_func_start sub_8172D98 +sub_8172D98: @ 8172D98 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x26 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08172E14 + cmp r0, 0x1 + bgt _08172DC0 + cmp r0, 0 + beq _08172DC6 + b _08172E84 + .pool +_08172DC0: + cmp r0, 0x2 + beq _08172E4E + b _08172E84 +_08172DC6: + ldr r0, =0x02038436 + ldrb r0, [r0] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08172DE8 + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + b _08172DF0 + .pool +_08172DE8: + ldr r1, =0x00003f44 + movs r0, 0x50 + bl SetGpuReg +_08172DF0: + movs r0, 0x52 + movs r1, 0x10 + bl SetGpuReg + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _08172E84 + .pool +_08172E14: + ldrh r0, [r4, 0xA] + adds r1, r0, 0x1 + strh r1, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _08172E84 + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r2, [r4, 0x8] + adds r2, 0x1 + strh r2, [r4, 0x8] + lsls r1, r2, 8 + movs r0, 0x10 + subs r0, r2 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _08172E84 + ldrh r0, [r4, 0x26] + adds r0, 0x1 + strh r0, [r4, 0x26] + b _08172E84 +_08172E4E: + ldr r1, =0x020241e4 + ldr r4, =0x02038436 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + ldr r2, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x4] + lsls r1, 22 + lsrs r1, 17 + ldr r0, =0x06010000 + adds r1, r0 + movs r2, 0x80 + lsls r2, 4 + movs r0, 0 + movs r3, 0x1 + bl RequestDma3Fill + ldrb r0, [r4] + bl sub_805E974 + adds r0, r5, 0 + bl move_anim_task_del +_08172E84: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8172D98 + + thumb_func_start sub_8172E9C +sub_8172E9C: @ 8172E9C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x0203841e + ldr r1, =0x020244d0 + ldr r2, [r1] + ldr r1, =0x02038436 + ldrb r1, [r1] + ldr r2, [r2] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + lsls r1, 29 + lsrs r1, 31 + strh r1, [r3, 0xE] + bl move_anim_task_del + pop {r0} + bx r0 + .pool + thumb_func_end sub_8172E9C + + thumb_func_start sub_8172ED0 +sub_8172ED0: @ 8172ED0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02038437 + ldr r1, =0x0202420e + ldrb r1, [r1] + strb r1, [r2] + bl move_anim_task_del + pop {r0} + bx r0 + .pool + thumb_func_end sub_8172ED0 + + thumb_func_start sub_8172EF0 +sub_8172EF0: @ 8172EF0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r1, 0 + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0 + mov r8, r0 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] + adds r0, r4, 0 + movs r1, 0x1 + bl pokemon_getattr + adds r5, r0, 0 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + adds r4, r0, 0 + adds r0, r6, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _08172FC8 + lsrs r0, r5, 16 + ldr r7, =0x0000ffff + ands r5, r7 + eors r0, r5 + lsrs r1, r4, 16 + eors r0, r1 + ands r4, r7 + eors r0, r4 + cmp r0, 0x7 + bhi _08172F4E + movs r0, 0x1 + mov r8, r0 +_08172F4E: + mov r0, r8 + cmp r0, 0 + beq _08172FC8 + ldr r0, =0x000027f9 + bl GetObjectTileRangeStartByTag + lsls r0, 16 + lsrs r0, 16 + cmp r0, r7 + bne _08172F6E + ldr r0, =gUnknown_0852528C + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_08525B94 + bl LoadCompressedObjectPaletteUsingHeap +_08172F6E: + ldr r5, =sub_8172FEC + adds r0, r5, 0 + movs r1, 0xA + bl CreateTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0xA + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x03005e00 + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 3 + adds r2, r3 + movs r4, 0 + strh r6, [r2, 0x8] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r3 + strh r6, [r1, 0x8] + strh r4, [r2, 0xA] + movs r0, 0x1 + strh r0, [r1, 0xA] + b _08172FDE + .pool +_08172FC8: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0, 0x1] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0, 0x1] +_08172FDE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8172EF0 + + thumb_func_start sub_8172FEC +sub_8172FEC: @ 8172FEC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r4, r0, r1 + ldrh r1, [r4, 0x22] + movs r2, 0x22 + ldrsh r0, [r4, r2] + cmp r0, 0x3B + bgt _08173018 + adds r0, r1, 0x1 + strh r0, [r4, 0x22] + b _08173190 + .pool +_08173018: + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0xA] + cmp r0, 0 + beq _08173026 + b _08173190 +_08173026: + ldrh r0, [r4, 0x1C] + adds r1, r0, 0x1 + strh r1, [r4, 0x1C] + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + cmp r1, 0 + beq _0817303A + b _08173190 +_0817303A: + ldrb r0, [r4, 0x8] + mov r8, r0 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, r8 + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08173074 + ldr r0, =gUnknown_085CE388 + adds r1, r5, 0 + movs r3, 0x5 + bl AddObjectToFront + lsls r0, 24 + lsrs r5, r0, 24 + b _081730D6 + .pool +_08173074: + cmp r0, 0 + blt _081730A8 + cmp r0, 0x3 + bgt _081730A8 + ldr r0, =gUnknown_085CE3A0 + adds r1, r5, 0 + movs r3, 0x5 + bl AddObjectToFront + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02020630 + lsls r2, r5, 4 + adds r2, r5 + lsls r2, 2 + adds r2, r0 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x4 + b _081730C8 + .pool +_081730A8: + ldr r0, =gUnknown_085CE3A0 + adds r1, r5, 0 + movs r3, 0x5 + bl AddObjectToFront + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02020630 + lsls r2, r5, 4 + adds r2, r5 + lsls r2, 2 + adds r2, r0 + ldrh r3, [r2, 0x4] + lsls r1, r3, 22 + lsrs r1, 22 + adds r1, 0x5 +_081730C8: + ldr r4, =0x000003ff + adds r0, r4, 0 + ands r1, r0 + ldr r0, =0xfffffc00 + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x4] +_081730D6: + ldr r2, =0x03005e00 + lsls r1, r7, 2 + adds r0, r1, r7 + lsls r0, 3 + adds r6, r0, r2 + movs r2, 0xA + ldrsh r0, [r6, r2] + mov r9, r1 + cmp r0, 0 + bne _08173118 + ldr r1, =0x02020630 + lsls r2, r5, 4 + adds r0, r2, r5 + lsls r0, 2 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_81731FC + str r1, [r0] + adds r4, r2, 0 + b _08173160 + .pool +_08173118: + ldr r3, =0x02020630 + lsls r4, r5, 4 + adds r1, r4, r5 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x1C + adds r0, r1, r0 + ldr r2, =sub_8173250 + str r2, [r0] + adds r1, r3 + ldr r0, =0x0000ffe0 + strh r0, [r1, 0x24] + movs r0, 0x20 + strh r0, [r1, 0x26] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + movs r1, 0x1E + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _08173160 + mov r0, r8 + bl battle_side_get_owner + lsls r0, 24 + movs r1, 0x3F + cmp r0, 0 + bne _08173156 + movs r1, 0xC0 +_08173156: + lsls r1, 24 + asrs r1, 24 + movs r0, 0x66 + bl audio_play_and_stuff +_08173160: + ldr r1, =0x02020630 + adds r0, r4, r5 + lsls r0, 2 + adds r0, r1 + strh r7, [r0, 0x2E] + ldr r1, =0x03005e00 + mov r2, r9 + adds r0, r2, r7 + lsls r0, 3 + adds r1, r0, r1 + ldrh r0, [r1, 0x1E] + adds r0, 0x1 + strh r0, [r1, 0x1E] + cmp r5, 0x40 + beq _08173184 + ldrh r0, [r1, 0x20] + adds r0, 0x1 + strh r0, [r1, 0x20] +_08173184: + movs r4, 0x1E + ldrsh r0, [r1, r4] + cmp r0, 0x5 + bne _08173190 + ldr r0, =sub_81731B0 + str r0, [r1] +_08173190: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8172FEC + + thumb_func_start sub_81731B0 +sub_81731B0: @ 81731B0 + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r3, r0, 0 + ldr r1, =0x03005e00 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r1, r0, r1 + movs r2, 0x20 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _081731F0 + movs r2, 0xA + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _081731EA + ldrb r1, [r1, 0x8] + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r2, [r0, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x1] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0, 0x1] +_081731EA: + adds r0, r3, 0 + bl DestroyTask +_081731F0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81731B0 + + thumb_func_start sub_81731FC +sub_81731FC: @ 81731FC + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x18 + bl sine + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x18 + bl cosine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + adds r0, 0xC + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _08173246 + ldr r2, =0x03005e00 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0x20] + subs r1, 0x1 + strh r1, [r0, 0x20] + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_08173246: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81731FC + + thumb_func_start sub_8173250 +sub_8173250: @ 8173250 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0x3 + bgt _08173264 + adds r0, r1, 0x1 + strh r0, [r4, 0x30] + b _081732A6 +_08173264: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldrh r1, [r4, 0x24] + adds r1, 0x5 + strh r1, [r4, 0x24] + ldrh r0, [r4, 0x26] + subs r0, 0x5 + strh r0, [r4, 0x26] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x20 + ble _081732A6 + ldr r2, =0x03005e00 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0x20] + subs r1, 0x1 + strh r1, [r0, 0x20] + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_081732A6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8173250 + + thumb_func_start sub_81732B0 +sub_81732B0: @ 81732B0 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_085253AC + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_08525CB4 + bl LoadCompressedObjectPaletteUsingHeap + ldr r0, =0x0000281d + bl IndexOfObjectPaletteTag + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81732B0 + + thumb_func_start sub_81732E4 +sub_81732E4: @ 81732E4 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =0x0000281d + adds r0, r5, 0 + bl FreeObjectTilesByTag + adds r0, r5, 0 + bl FreeObjectPaletteByTag + adds r0, r4, 0 + bl move_anim_task_del + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81732E4 + + thumb_func_start sub_817330C +sub_817330C: @ 817330C + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0 + bl sub_80A69CC + movs r0, 0x1E + strh r0, [r4, 0x2E] + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_80A5C6C + lsls r0, 24 + ldr r5, =0x0203841e + lsrs r0, 24 + ldrh r1, [r5, 0x4] + adds r0, r1 + strh r0, [r4, 0x32] + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_80A5C6C + lsls r0, 24 + lsrs r0, 24 + ldrh r5, [r5, 0x6] + adds r0, r5 + strh r0, [r4, 0x36] + ldr r0, =0x0000ffe0 + strh r0, [r4, 0x38] + adds r0, r4, 0 + bl sub_80A68D4 + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02038436 + 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, =sub_8039E84 + str r1, [r0] + ldr r0, =sub_817339C + str r0, [r4, 0x1C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817330C + + thumb_func_start sub_817339C +sub_817339C: @ 817339C + push {lr} + adds r3, r0, 0 + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02038436 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0x1 + bne _081733C0 + ldr r0, =sub_81733D4 + str r0, [r3, 0x1C] +_081733C0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_817339C + + thumb_func_start sub_81733D4 +sub_81733D4: @ 81733D4 + push {r4,lr} + adds r4, r0, 0 + bl sub_80A6900 + lsls r0, 24 + cmp r0, 0 + beq _081733F6 + movs r0, 0 + strh r0, [r4, 0x2E] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_8173400 + str r0, [r4, 0x1C] +_081733F6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81733D4 + + thumb_func_start sub_8173400 +sub_8173400: @ 8173400 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x02020630 + ldr r3, =0x020241e4 + ldr r2, =0x02038436 + ldrb r0, [r2] + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 27 + cmp r0, 0 + bge _08173448 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + ble _08173448 + ldrb r0, [r2] + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0 + bl StartObjectImageAnim + adds r0, r4, 0 + bl move_anim_8072740 +_08173448: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8173400 + + thumb_func_start sub_817345C +sub_817345C: @ 817345C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0203841e + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08173478 + cmp r0, 0x1 + beq _0817348C + b _081734A0 + .pool +_08173478: + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, =0x02038436 + strb r0, [r1] + movs r0, 0x1 + b _08173498 + .pool +_0817348C: + movs r0, 0x1 + bl battle_get_side_with_given_state + ldr r1, =0x02038436 + strb r0, [r1] + movs r0, 0 +_08173498: + bl battle_get_side_with_given_state + ldr r1, =0x02038437 + strb r0, [r1] +_081734A0: + adds r0, r4, 0 + bl move_anim_task_del + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817345C + + thumb_func_start sub_81734B4 +sub_81734B4: @ 81734B4 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrh r1, [r0] + cmp r1, 0x53 + bne _081734D4 + ldr r1, =0x0203841e + movs r0, 0x1 + b _0817350C + .pool +_081734D4: + cmp r1, 0xFA + bne _081734E4 + ldr r1, =0x0203841e + movs r0, 0x2 + b _0817350C + .pool +_081734E4: + cmp r1, 0x80 + bne _081734F4 + ldr r1, =0x0203841e + movs r0, 0x3 + b _0817350C + .pool +_081734F4: + movs r0, 0xA4 + lsls r0, 1 + cmp r1, r0 + bne _08173508 + ldr r1, =0x0203841e + movs r0, 0x4 + b _0817350C + .pool +_08173508: + ldr r1, =0x0203841e + movs r0, 0 +_0817350C: + strh r0, [r1] + adds r0, r2, 0 + bl move_anim_task_del + pop {r0} + bx r0 + .pool + thumb_func_end sub_81734B4 + + thumb_func_start sub_817351C +sub_817351C: @ 817351C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x02038436 + ldr r1, =0x020244d0 + ldr r2, [r1] + ldr r1, [r2, 0x8] + ldrh r1, [r1] + strb r1, [r3] + ldr r3, =0x02038437 + ldr r1, [r2, 0x8] + ldrh r1, [r1] + lsrs r1, 8 + strb r1, [r3] + bl move_anim_task_del + pop {r0} + bx r0 + .pool + thumb_func_end sub_817351C + + thumb_func_start sub_817354C +sub_817354C: @ 817354C + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_817354C + + thumb_func_start sub_8173560 +sub_8173560: @ 8173560 + push {lr} + bl RunTasks + bl RunTextPrinters + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_8173560 + + thumb_func_start sub_817357C +sub_817357C: @ 817357C + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x4 + bls _08173590 + b _08173688 +_08173590: + lsls r0, 2 + ldr r1, =_081735A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081735A4: + .4byte _081735B8 + .4byte _081735E8 + .4byte _081735EE + .4byte _08173620 + .4byte _0817365C +_081735B8: + movs r0, 0 + bl SetVBlankCallback + bl sub_8174EC4 + ldr r4, =0x0203bcdc + ldr r0, =0x00002014 + bl AllocZeroed + str r0, [r4] + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + b _08173688 + .pool +_081735E8: + bl sub_8174F70 + b _08173642 +_081735EE: + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0xE2 + lsls r1, 3 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + bl sub_8174FAC + ldr r0, =0x0203bcdc + ldr r1, [r0] + movs r0, 0 + strh r0, [r1] + b _08173642 + .pool +_08173620: + bl sub_8175024 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _08173688 + ldr r0, =sub_817354C + bl SetVBlankCallback + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe +_08173642: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08173688 + .pool +_0817365C: + bl fade_and_return_progress_probably + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08173688 + ldr r0, =sub_8173560 + bl SetMainCallback2 + movs r0, 0xDA + lsls r0, 1 + bl song_play_for_text + movs r0, 0 + b _0817368A + .pool +_08173688: + movs r0, 0x1 +_0817368A: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_817357C + + thumb_func_start sub_8173694 +sub_8173694: @ 8173694 + push {r4,lr} + bl sub_817357C + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _081736C4 + ldr r0, =sub_817371C + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + ldr r4, =0x0203bcd8 + movs r0, 0x78 + bl AllocZeroed + str r0, [r4] +_081736C4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8173694 + + thumb_func_start sub_81736D8 +sub_81736D8: @ 81736D8 + push {r4,lr} + bl sub_817357C + lsls r0, 24 + cmp r0, 0 + bne _08173708 + ldr r0, =sub_817371C + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x1 + strh r0, [r1, 0x8] + ldr r4, =0x0203bcd8 + movs r0, 0x78 + bl AllocZeroed + str r0, [r4] +_08173708: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81736D8 + + thumb_func_start sub_817371C +sub_817371C: @ 817371C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =0x03005e00 + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xC] + movs r7, 0 + ldr r0, =0x0203bcd8 + mov r9, r0 +_08173740: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r6, r1, r0 + adds r0, r6, 0 + movs r1, 0xB + bl pokemon_getattr + adds r5, r0, 0 + cmp r5, 0 + beq _0817380C + adds r0, r6, 0 + movs r1, 0x41 + bl pokemon_getattr + mov r1, r9 + ldr r3, [r1] + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 2 + adds r3, r4 + ldr r2, =0x000001ff + adds r1, r2, 0 + ands r0, r1 + ldrh r1, [r3, 0x8] + ldr r5, =0xfffffe00 + adds r2, r5, 0 + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x8] + adds r0, r6, 0 + movs r1, 0x1 + bl pokemon_getattr + mov r2, r9 + ldr r1, [r2] + adds r1, r4 + str r0, [r1] + adds r0, r6, 0 + movs r1, 0 + bl pokemon_getattr + mov r5, r9 + ldr r1, [r5] + adds r1, 0x4 + adds r1, r4 + str r0, [r1] + adds r0, r6, 0 + movs r1, 0x38 + bl pokemon_getattr + ldr r2, [r5] + adds r2, r4 + lsls r0, 1 + ldrb r3, [r2, 0x9] + movs r1, 0x1 + ands r1, r3 + orrs r1, r0 + strb r1, [r2, 0x9] + adds r0, r6, 0 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + movs r2, 0 + mov r6, r8 + lsls r5, r6, 2 + ldr r3, =0x0203bcd8 +_081737CA: + ldr r0, [r3] + adds r1, r2, r4 + adds r0, 0xA + adds r0, r1 + mov r6, sp + adds r1, r6, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x9 + bls _081737CA + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r5, r2 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0xC] + adds r0, 0x1 + strh r0, [r1, 0xC] + b _08173840 + .pool +_0817380C: + mov r6, r9 + ldr r3, [r6] + lsls r2, r7, 2 + adds r2, r7 + lsls r2, 2 + adds r4, r3, r2 + ldrh r0, [r4, 0x8] + ldr r6, =0xfffffe00 + adds r1, r6, 0 + ands r0, r1 + strh r0, [r4, 0x8] + str r5, [r4] + adds r3, 0x4 + adds r3, r2 + str r5, [r3] + ldrb r1, [r4, 0x9] + movs r0, 0x1 + ands r0, r1 + strb r0, [r4, 0x9] + mov r1, r9 + ldr r0, [r1] + adds r0, r2 + movs r1, 0xFF + strb r1, [r0, 0xA] + mov r2, r8 + lsls r5, r2, 2 +_08173840: + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0x5 + bhi _0817384C + b _08173740 +_0817384C: + ldr r0, =0x0203bcd4 + movs r3, 0 + str r3, [r0] + ldr r4, =0x03005e00 + mov r6, r8 + adds r1, r5, r6 + lsls r1, 3 + adds r2, r1, r4 + strh r3, [r2, 0xA] + movs r0, 0xFF + strh r0, [r2, 0x10] + movs r7, 0 + adds r3, r4, 0 + adds r3, 0x8 + movs r2, 0xFF +_0817386A: + adds r0, r7, 0x5 + lsls r0, 1 + adds r0, r1 + adds r0, r3 + strh r2, [r0] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0x5 + bls _0817386A + mov r1, r8 + adds r0, r5, r1 + lsls r0, 3 + adds r1, r0, r4 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _081738A4 + ldr r0, =sub_8173A8C + b _081738A6 + .pool +_081738A4: + ldr r0, =sub_81738BC +_081738A6: + str r0, [r1] + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817371C + + thumb_func_start sub_81738BC +sub_81738BC: @ 81738BC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r7, =0x0201c000 + ldr r0, =0x0203bce4 + ldrb r0, [r0] + cmp r0, 0 + bne _081738EC + movs r2, 0x80 + lsls r2, 6 + adds r0, r7, 0 + movs r1, 0 + bl memset + b _08173906 + .pool +_081738EC: + movs r0, 0x3 + bl sub_81534D0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08173906 + movs r2, 0x80 + lsls r2, 6 + adds r0, r7, 0 + movs r1, 0 + bl memset +_08173906: + movs r5, 0 + ldrh r1, [r7, 0x8] + ldr r2, =0x000001ff + adds r0, r2, 0 + ands r0, r1 + mov r1, r9 + lsls r1, 2 + mov r8, r1 + cmp r0, 0 + beq _08173930 +_0817391A: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r7, 0x78 + cmp r5, 0x31 + bhi _08173934 + ldrh r1, [r7, 0x8] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _0817391A +_08173930: + cmp r5, 0x31 + bls _08173956 +_08173934: + ldr r4, =0x0201c000 + adds r6, r4, 0 + adds r4, 0x78 + movs r5, 0 + subs r7, 0x78 +_0817393E: + adds r0, r6, 0 + adds r1, r4, 0 + movs r2, 0x78 + bl memcpy + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r6, 0x78 + adds r4, 0x78 + cmp r5, 0x30 + bls _0817393E +_08173956: + ldr r0, =0x0203bcd8 + ldr r1, [r0] + adds r0, r7, 0 + movs r2, 0x78 + bl memcpy + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + ldr r2, =gUnknown_082C8959 + 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, 0 + movs r1, 0x1 + movs r3, 0 + bl AddTextPrinterParametrized + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r1, =0x03005e00 + mov r0, r8 + add r0, r9 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81739C4 + str r1, [r0] + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81738BC + + thumb_func_start sub_81739C4 +sub_81739C4: @ 81739C4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03006214 + ldr r0, =sub_81736D8 + str r0, [r1] + movs r0, 0x3 + bl save_game_when_memory_present + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _08173A34 + ldr r0, =0x030061fc + ldr r0, [r0] + cmp r0, 0 + beq _08173A34 + movs r0, 0x1 + bl UnsetBgTilemapBuffer + movs r0, 0x3 + bl UnsetBgTilemapBuffer + bl FreeAllWindowBuffers + ldr r5, =0x0203bcdc + ldr r0, [r5] + cmp r0, 0 + beq _08173A06 + bl Free + movs r0, 0 + str r0, [r5] +_08173A06: + ldr r5, =0x0203bcd8 + ldr r0, [r5] + cmp r0, 0 + beq _08173A16 + bl Free + movs r0, 0 + str r0, [r5] +_08173A16: + adds r0, r4, 0 + bl DestroyTask + b _08173A4C + .pool +_08173A34: + movs r0, 0x37 + bl audio_play + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8173A5C + str r1, [r0] + movs r1, 0x20 + strh r1, [r0, 0xE] +_08173A4C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81739C4 + + thumb_func_start sub_8173A5C +sub_8173A5C: @ 8173A5C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r2, [r1, 0xE] + movs r3, 0xE + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _08173A80 + subs r0, r2, 0x1 + strh r0, [r1, 0xE] + b _08173A84 + .pool +_08173A80: + ldr r0, =sub_8173A8C + str r0, [r1] +_08173A84: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8173A5C + + thumb_func_start sub_8173A8C +sub_8173A8C: @ 8173A8C + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =sub_8173AA8 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8173A8C + + thumb_func_start sub_8173AA8 +sub_8173AA8: @ 8173AA8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =0x03005e00 + mov r2, r8 + lsls r1, r2, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + ldrh r6, [r1, 0xA] + ldr r2, =0x0203bcd8 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 2 + ldr r2, [r2] + adds r7, r2, r0 + movs r2, 0xC + ldrsh r0, [r1, r2] + cmp r0, 0x3 + ble _08173AEC + ldr r1, =gUnknown_085E53B4 + b _08173AEE + .pool +_08173AEC: + ldr r1, =gUnknown_085E53E4 +_08173AEE: + lsls r2, r6, 3 + adds r0, r2, r1 + ldrh r3, [r0] + adds r0, r1, 0x2 + adds r0, r2, r0 + ldrh r4, [r0] + adds r0, r1, 0x4 + adds r0, r2, r0 + ldrh r0, [r0] + mov r9, r0 + adds r1, 0x6 + adds r2, r1 + ldrh r5, [r2] + ldrh r2, [r7, 0x8] + ldr r0, =0x000001ff + ands r0, r2 + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _08173B20 + lsls r0, r5, 16 + movs r1, 0xA0 + lsls r1, 12 + adds r0, r1 + lsrs r5, r0, 16 +_08173B20: + lsls r0, r2, 23 + lsrs r0, 23 + ldr r1, [r7] + ldr r2, [r7, 0x4] + lsls r3, 16 + asrs r3, 16 + str r3, [sp] + lsls r3, r4, 16 + asrs r3, 16 + str r3, [sp, 0x4] + lsls r3, r6, 24 + lsrs r3, 24 + str r3, [sp, 0x8] + ldr r3, =0x0000ffff + str r3, [sp, 0xC] + movs r3, 0x1 + bl sub_818D3E4 + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r3, r2, r4 + movs r1, 0 + mov r12, r1 + mov r1, r9 + strh r1, [r3, 0x30] + strh r5, [r3, 0x32] + mov r1, r12 + strh r1, [r3, 0x2E] + ldrh r1, [r7, 0x8] + lsls r1, 23 + lsrs r1, 23 + strh r1, [r3, 0x3C] + adds r4, 0x1C + adds r2, r4 + ldr r1, =sub_8175120 + str r1, [r2] + ldr r5, =0x03005e00 + adds r1, r6, 0x5 + lsls r1, 1 + mov r2, r8 + lsls r4, r2, 2 + add r4, r8 + lsls r4, 3 + adds r1, r4 + adds r2, r5, 0 + adds r2, 0x8 + adds r1, r2 + strh r0, [r1] + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + adds r4, r5 + ldr r0, =sub_8173BC0 + str r0, [r4] + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8173AA8 + + thumb_func_start sub_8173BC0 +sub_8173BC0: @ 8173BC0 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x03005e00 + lsls r3, r0, 2 + adds r3, r0 + lsls r3, 3 + adds r5, r3, r4 + ldrh r0, [r5, 0xA] + ldr r2, =0x0203bcd8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + ldr r2, [r2] + adds r2, r1 + adds r0, 0x5 + lsls r0, 1 + adds r0, r3 + adds r4, 0x8 + adds r0, r4 + movs r3, 0 + ldrsh r1, [r0, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r3, r0, r1 + ldr r1, [r3, 0x1C] + ldr r0, =DummyObjectCallback + cmp r1, r0 + bne _08173C1A + ldrb r1, [r3, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + strb r0, [r3, 0x1] + adds r0, r2, 0 + movs r1, 0 + movs r2, 0xE + bl sub_8174A88 + movs r0, 0x78 + strh r0, [r5, 0xE] + ldr r0, =sub_8173C34 + str r0, [r5] +_08173C1A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8173BC0 + + thumb_func_start sub_8173C34 +sub_8173C34: @ 8173C34 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r6, r0, 3 + adds r4, r6, r2 + ldrh r3, [r4, 0xA] + ldr r1, =0x0203bcd8 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 2 + ldr r1, [r1] + adds r1, r0 + mov r9, r1 + ldrh r1, [r4, 0xE] + movs r7, 0xE + ldrsh r0, [r4, r7] + mov r12, r2 + cmp r0, 0 + beq _08173C78 + subs r0, r1, 0x1 + strh r0, [r4, 0xE] + b _08173D10 + .pool +_08173C78: + ldr r2, =0x0203bcd4 + ldr r0, =0x02020630 + mov r8, r0 + adds r0, r3, 0x5 + lsls r0, 1 + adds r0, r6 + mov r1, r12 + adds r1, 0x8 + adds r6, r0, r1 + movs r7, 0 + ldrsh r1, [r6, r7] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + movs r1, 0x80 + lsls r1, 9 + lsls r1, r0 + ldr r3, [r2] + orrs r3, r1 + str r3, [r2] + ldrh r2, [r4, 0xA] + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bgt _08173D04 + mov r7, r9 + ldrh r1, [r7, 0x1C] + ldr r0, =0x000001ff + ands r0, r1 + cmp r0, 0 + beq _08173D04 + adds r0, r2, 0x1 + strh r0, [r4, 0xA] + ldr r0, =0x000063b0 + str r0, [sp] + adds r0, r3, 0 + movs r1, 0 + movs r2, 0xC + movs r3, 0xC + bl pal_fade_maybe + movs r0, 0 + ldrsh r1, [r6, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0, 0x5] + ldr r0, =sub_8173AA8 + str r0, [r4] + b _08173D10 + .pool +_08173D04: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + add r0, r12 + ldr r1, =sub_8173D24 + str r1, [r0] +_08173D10: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8173C34 + + thumb_func_start sub_8173D24 +sub_8173D24: @ 8173D24 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0xffff0000 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0 + bl pal_fade_maybe + movs r3, 0 + lsls r1, r4, 2 + adds r0, r1, r4 + lsls r5, r0, 3 + ldr r0, =0x03005e08 + mov r12, r0 + mov r8, r1 + ldr r6, =0x02020630 + movs r7, 0xD + negs r7, r7 +_08173D52: + adds r0, r3, 0x5 + lsls r0, 1 + adds r0, r5 + mov r2, r12 + adds r1, r0, r2 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0xFF + beq _08173D74 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r2, [r1, 0x5] + adds r0, r7, 0 + ands r0, r2 + strb r0, [r1, 0x5] +_08173D74: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x5 + bls _08173D52 + movs r0, 0 + movs r1, 0xF + bl sub_8174A38 + movs r0, 0x69 + bl audio_play + ldr r1, =0x03005e00 + mov r2, r8 + adds r0, r2, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0xC8 + lsls r1, 1 + strh r1, [r0, 0xE] + ldr r1, =sub_8173DC0 + str r1, [r0] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8173D24 + + thumb_func_start sub_8173DC0 +sub_8173DC0: @ 8173DC0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, =0x03005e00 + lsls r4, r6, 2 + adds r0, r4, r6 + lsls r5, r0, 3 + adds r1, r5, r7 + ldrh r2, [r1, 0xE] + movs r3, 0xE + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _08173E04 + subs r2, 0x1 + strh r2, [r1, 0xE] + movs r0, 0x3 + ands r0, r2 + cmp r0, 0 + bne _08173E7E + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x6E + ble _08173E7E + bl sub_81751FC + b _08173E7E + .pool +_08173E04: + movs r3, 0 + mov r9, r4 + ldr r0, =0x0203bcd4 + mov r10, r0 + adds r4, r5, 0 + adds r7, 0x8 + mov r8, r7 + ldr r7, =0x02020630 + movs r1, 0xD + negs r1, r1 + mov r12, r1 + movs r5, 0x4 +_08173E1C: + adds r0, r3, 0x5 + lsls r0, 1 + adds r0, r4 + mov r2, r8 + adds r1, r0, r2 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0xFF + beq _08173E40 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + ldrb r2, [r1, 0x5] + mov r0, r12 + ands r0, r2 + orrs r0, r5 + strb r0, [r1, 0x5] +_08173E40: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x5 + bls _08173E1C + mov r3, r10 + ldr r0, [r3] + ldr r1, =0x000063b0 + str r1, [sp] + movs r1, 0 + movs r2, 0xC + movs r3, 0xC + bl pal_fade_maybe + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r1, =0x03005e00 + mov r2, r9 + adds r0, r2, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0x7 + strh r1, [r0, 0xE] + ldr r1, =sub_8173EA4 + str r1, [r0] +_08173E7E: + 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_8173DC0 + + thumb_func_start sub_8173EA4 +sub_8173EA4: @ 8173EA4 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r2, [r1, 0xE] + movs r3, 0xE + ldrsh r0, [r1, r3] + cmp r0, 0xF + ble _08173ECC + ldr r0, =sub_8173EE4 + str r0, [r1] + b _08173EDE + .pool +_08173ECC: + adds r0, r2, 0x1 + strh r0, [r1, 0xE] + movs r0, 0xE + ldrsh r1, [r1, r0] + lsls r1, 24 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg +_08173EDE: + pop {r0} + bx r0 + thumb_func_end sub_8173EA4 + + thumb_func_start sub_8173EE4 +sub_8173EE4: @ 8173EE4 + push {r4-r6,lr} + sub sp, 0x8 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x3 + bl ShowBg + ldr r6, =0x03005d90 + ldr r0, [r6] + ldrb r0, [r0, 0x8] + movs r1, 0x1 + bl sub_818D97C + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + str r1, [sp] + ldr r1, =0x0000ffff + str r1, [sp, 0x4] + movs r1, 0x1 + movs r2, 0x78 + movs r3, 0x48 + bl sub_818D8AC + ldr r1, =0x03005e00 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r1 + strh r0, [r4, 0x10] + ldr r0, =gUnknown_085E5380 + bl AddWindow + ldr r0, [r6] + ldrb r1, [r0, 0x14] + lsrs r1, 3 + ldr r2, =0x0000021d + movs r0, 0x1 + movs r3, 0xD0 + bl sub_80987D4 + movs r0, 0x1 + bl stdpal_get + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0x78 + strh r0, [r4, 0xE] + ldr r0, =sub_8173F84 + str r0, [r4] + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8173EE4 + + thumb_func_start sub_8173F84 +sub_8173F84: @ 8173F84 + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0xE] + movs r1, 0xE + ldrsh r5, [r4, r1] + cmp r5, 0 + beq _08173FAC + subs r0, 0x1 + strh r0, [r4, 0xE] + b _08174018 + .pool +_08173FAC: + ldr r2, =0x02020630 + movs r3, 0x10 + ldrsh r1, [r4, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + ldrh r2, [r1, 0x20] + movs r3, 0x20 + ldrsh r0, [r1, r3] + cmp r0, 0xC0 + beq _08173FD0 + adds r0, r2, 0x1 + strh r0, [r1, 0x20] + b _08174018 + .pool +_08173FD0: + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0x1 + movs r1, 0x2 + bl sub_8174C98 + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + ldr r2, =gUnknown_085E8C14 + str r5, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + movs r3, 0 + bl AddTextPrinterParametrized + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =sub_8174028 + str r0, [r4] +_08174018: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8173F84 + + thumb_func_start sub_8174028 +sub_8174028: @ 8174028 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0817404E + movs r0, 0x4 + bl play_sound_effect + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8174060 + str r0, [r1] +_0817404E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174028 + + thumb_func_start sub_8174060 +sub_8174060: @ 8174060 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x02037b14 + ldr r1, =0x02037714 + movs r2, 0x80 + lsls r2, 2 + bl CpuSet + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r1, 0x8 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81740B0 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174060 + + thumb_func_start sub_81740B0 +sub_81740B0: @ 81740B0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08174164 + lsls r0, r7, 2 + mov r8, r0 + ldr r1, =0x03005e00 + adds r0, r7 + lsls r0, 3 + adds r1, 0x12 + adds r5, r0, r1 + ldr r2, =0x02020630 + mov r9, r2 + movs r6, 0x5 +_081740DC: + ldrb r4, [r5] + cmp r4, 0xFF + beq _081740FA + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + add r0, r9 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl sub_818D820 +_081740FA: + adds r5, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _081740DC + ldr r0, =0x03005e00 + mov r2, r8 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x10] + bl sub_818D8F0 + movs r0, 0 + bl HideBg + movs r0, 0x1 + bl HideBg + movs r0, 0x3 + bl HideBg + bl FreeAllWindowBuffers + movs r0, 0x1 + bl UnsetBgTilemapBuffer + movs r0, 0x3 + bl UnsetBgTilemapBuffer + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + adds r0, r7, 0 + bl DestroyTask + ldr r4, =0x0203bcdc + ldr r0, [r4] + cmp r0, 0 + beq _08174150 + bl Free + movs r0, 0 + str r0, [r4] +_08174150: + ldr r4, =0x0203bcd8 + ldr r0, [r4] + cmp r0, 0 + beq _08174160 + bl Free + movs r0, 0 + str r0, [r4] +_08174160: + bl sub_8174184 +_08174164: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81740B0 + + thumb_func_start sub_8174184 +sub_8174184: @ 8174184 + push {lr} + ldr r0, =sub_8175620 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174184 + + thumb_func_start sub_8174194 +sub_8174194: @ 8174194 + push {r4,lr} + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x5 + bhi _081741D0 + lsls r0, 2 + ldr r1, =_081741B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081741B8: + .4byte _081741D0 + .4byte _08174200 + .4byte _08174214 + .4byte _08174240 + .4byte _08174280 + .4byte _081742B0 +_081741D0: + movs r0, 0 + bl SetVBlankCallback + bl sub_8174EC4 + ldr r4, =0x0203bcdc + ldr r0, =0x00002014 + bl AllocZeroed + str r0, [r4] + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] + b _08174308 + .pool +_08174200: + bl sub_8174F70 + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _081742A2 + .pool +_08174214: + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + bl sub_8174FAC + ldr r1, =0x030022c0 + movs r4, 0x87 + lsls r4, 3 + adds r1, r4 + b _081742A2 + .pool +_08174240: + bl sub_8175024 + lsls r0, 24 + cmp r0, 0 + bne _08174308 + ldr r1, =0x0201c000 + ldr r0, =gUnknown_085E56D4 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r3} + stm r1!, {r2,r3} + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl sub_80F9BCC + ldr r0, =sub_817354C + bl SetVBlankCallback + ldr r1, =0x030022c0 + movs r4, 0x87 + lsls r4, 3 + adds r1, r4 + b _081742A2 + .pool +_08174280: + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + bl sub_80F9C1C + lsls r0, 24 + cmp r0, 0 + bne _08174308 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_081742A2: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08174308 + .pool +_081742B0: + ldr r1, =0x00003f42 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0xE2 + lsls r1, 3 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + ldr r0, =sub_8174324 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + movs r2, 0 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r4, =0x03005e08 + movs r3, 0xFF +_081742E2: + adds r0, r2, 0x5 + lsls r0, 1 + adds r0, r1 + adds r0, r4 + strh r3, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _081742E2 + ldr r4, =0x0203bcd8 + movs r0, 0x80 + lsls r0, 6 + bl AllocZeroed + str r0, [r4] + ldr r0, =sub_8173560 + bl SetMainCallback2 +_08174308: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174194 + + thumb_func_start sub_8174324 +sub_8174324: @ 8174324 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x00000226 + str r0, [sp] + movs r0, 0 + movs r1, 0x1E + movs r2, 0 + movs r3, 0xC + bl sub_81980F0 + movs r0, 0x3 + bl sub_81534D0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08174364 + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81749A0 + b _081743DA + .pool +_08174364: + ldr r0, =0x0201c000 + ldr r4, =0x0203bcd8 + ldr r1, [r4] + movs r2, 0x80 + lsls r2, 5 + bl CpuSet + ldr r4, [r4] + movs r2, 0 + ldrh r1, [r4, 0x8] + ldr r3, =0x000001ff + adds r0, r3, 0 + ands r0, r1 + lsls r5, r6, 2 + cmp r0, 0 + beq _0817439A +_08174384: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + adds r4, 0x78 + cmp r2, 0x31 + bhi _081743BC + ldrh r1, [r4, 0x8] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _08174384 +_0817439A: + cmp r2, 0x31 + bhi _081743BC + ldr r0, =0x03005e00 + adds r1, r5, r6 + lsls r1, 3 + adds r1, r0 + subs r0, r2, 0x1 + b _081743C6 + .pool +_081743BC: + ldr r0, =0x03005e00 + adds r1, r5, r6 + lsls r1, 3 + adds r1, r0 + movs r0, 0x31 +_081743C6: + strh r0, [r1, 0x8] + movs r0, 0xA + bl sub_80847F8 + ldr r2, =0x03005e00 + adds r1, r5, r6 + lsls r1, 3 + adds r1, r2 + strh r0, [r1, 0xA] + ldr r0, =sub_81743EC +_081743DA: + str r0, [r1] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174324 + + thumb_func_start sub_81743EC +sub_81743EC: @ 81743EC + 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 + mov r8, r0 + ldr r0, =0x0203bcd8 + ldr r3, [r0] + movs r5, 0 + ldr r1, =0x03005e00 + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r4, 0x8 + ldrsh r0, [r0, r4] + adds r4, r1, 0 + ldr r2, =0x0203bcd4 + cmp r5, r0 + bge _0817442A + adds r1, r0, 0 +_0817441E: + adds r3, 0x78 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r1 + blt _0817441E +_0817442A: + adds r6, r3, 0 + movs r0, 0 + str r0, [r2] + mov r5, r8 + lsls r2, r5, 2 + adds r1, r2, r5 + lsls r1, 3 + adds r1, r4 + strh r0, [r1, 0xC] + strh r0, [r1, 0x10] + movs r5, 0 + str r2, [sp, 0x14] + ldr r4, =0x000001ff + adds r2, r1, 0 +_08174446: + ldrh r1, [r6, 0x8] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _08174456 + ldrh r0, [r2, 0x10] + adds r0, 0x1 + strh r0, [r2, 0x10] +_08174456: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r6, 0x14 + cmp r5, 0x5 + bls _08174446 + adds r6, r3, 0 + movs r5, 0 + ldr r1, =0x03005e00 + ldr r0, [sp, 0x14] + add r0, r8 + lsls r0, 3 + mov r9, r0 + adds r0, r1 + str r0, [sp, 0x10] + ldr r1, =0x000001ff + mov r10, r1 +_08174478: + ldrh r0, [r6, 0x8] + mov r1, r10 + ands r1, r0 + adds r7, r0, 0 + cmp r1, 0 + beq _08174540 + ldr r2, [sp, 0x10] + movs r4, 0x10 + ldrsh r0, [r2, r4] + cmp r0, 0x3 + ble _081744B8 + lsls r1, r5, 3 + ldr r0, =gUnknown_085E53B4 + adds r0, 0x4 + adds r0, r1, r0 + ldrh r3, [r0] + ldr r0, =gUnknown_085E53BA + adds r1, r0 + ldrh r4, [r1] + b _081744C8 + .pool +_081744B8: + ldr r0, =gUnknown_085E53E4 + lsls r2, r5, 3 + adds r1, r0, 0x4 + adds r1, r2, r1 + ldrh r3, [r1] + adds r0, 0x6 + adds r2, r0 + ldrh r4, [r2] +_081744C8: + mov r1, r10 + ands r1, r7 + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + bne _081744DE + lsls r0, r4, 16 + movs r1, 0xA0 + lsls r1, 12 + adds r0, r1 + lsrs r4, r0, 16 +_081744DE: + lsls r0, r7, 23 + lsrs r0, 23 + ldr r1, [r6] + ldr r2, [r6, 0x4] + lsls r3, 16 + asrs r3, 16 + str r3, [sp] + lsls r3, r4, 16 + asrs r3, 16 + str r3, [sp, 0x4] + lsls r3, r5, 24 + lsrs r3, 24 + str r3, [sp, 0x8] + ldr r3, =0x0000ffff + str r3, [sp, 0xC] + movs r3, 0x1 + bl sub_818D7D8 + lsls r0, 16 + lsrs r0, 16 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r3, [r1, 0x5] + movs r4, 0xD + negs r4, r4 + adds r2, r4, 0 + ands r3, r2 + movs r2, 0x4 + orrs r3, r2 + strb r3, [r1, 0x5] + adds r1, r5, 0x5 + lsls r1, 1 + add r1, r9 + ldr r2, =0x03005e08 + adds r1, r2 + strh r0, [r1] + b _0817454E + .pool +_08174540: + adds r0, r5, 0x5 + lsls r0, 1 + add r0, r9 + ldr r4, =0x03005e08 + adds r0, r4 + movs r1, 0xFF + strh r1, [r0] +_0817454E: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + adds r6, 0x14 + cmp r5, 0x5 + bls _08174478 + ldr r0, =0xffff0000 + ldr r2, =0x000063b0 + movs r1, 0xC + bl sub_80A2A20 + ldr r0, =0x02021cc4 + ldr r1, =0x03005e00 + ldr r4, [sp, 0x14] + add r4, r8 + lsls r4, 3 + adds r4, r1 + movs r5, 0xA + ldrsh r1, [r4, r5] + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r5, =0x02021fc4 + ldr r1, =gUnknown_085E8C00 + adds r0, r5, 0 + bl ExpandStringRefs + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bgt _081745C0 + ldr r1, =gUnknown_085E8574 + movs r0, 0x1 + str r0, [sp] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0 + bl sub_8198204 + b _081745D0 + .pool +_081745C0: + ldr r1, =gUnknown_085E855C + movs r0, 0x1 + str r0, [sp] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0 + bl sub_8198204 +_081745D0: + ldr r0, =0x03005e00 + ldr r1, [sp, 0x14] + add r1, r8 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81745FC + str r0, [r1] + 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_81743EC + + thumb_func_start sub_81745FC +sub_81745FC: @ 81745FC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0203bcd8 + ldr r5, [r0] + movs r3, 0 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + cmp r3, r0 + bge _08174630 + adds r1, r0, 0 +_08174624: + adds r5, 0x78 + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r1 + blt _08174624 +_08174630: + movs r3, 0 + lsls r7, r4, 2 + adds r0, r7, r4 + lsls r6, r0, 3 + ldr r0, =0x03005e08 + mov r10, r0 + ldr r1, =0x02020630 + mov r8, r1 + movs r2, 0xD + negs r2, r2 + mov r9, r2 + movs r0, 0x4 + mov r12, r0 +_0817464A: + adds r0, r3, 0x5 + lsls r0, 1 + adds r0, r6 + add r0, r10 + ldrh r1, [r0] + cmp r1, 0xFF + beq _0817466C + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldrb r2, [r0, 0x5] + mov r1, r9 + ands r1, r2 + mov r2, r12 + orrs r1, r2 + strb r1, [r0, 0x5] +_0817466C: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x5 + bls _0817464A + adds r1, r7, r4 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r6, r1, r0 + movs r2, 0xC + ldrsh r0, [r6, r2] + adds r0, 0x5 + lsls r0, 1 + adds r0, r1 + ldr r1, =0x03005e00 + adds r1, 0x8 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + strb r1, [r0, 0x5] + lsrs r1, 4 + movs r0, 0x80 + lsls r0, 9 + lsls r0, r1 + ldr r1, =0xffff0000 + eors r0, r1 + ldr r2, =0x0203bcd4 + str r0, [r2] + ldr r2, =0x000063b0 + movs r1, 0xC + bl sub_80A2A5C + movs r0, 0xC + ldrsh r1, [r6, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r4, r5, r0 + ldrh r1, [r4, 0x8] + ldr r0, =0x000001ff + ands r0, r1 + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + beq _081746E6 + bl sub_80A369C + ldrh r0, [r4, 0x8] + lsls r0, 23 + lsrs r0, 23 + movs r1, 0 + bl cry_related +_081746E6: + adds r0, r4, 0 + movs r1, 0 + movs r2, 0xE + bl sub_8174A88 + ldr r0, =sub_8174728 + 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_81745FC + + thumb_func_start sub_8174728 +sub_8174728: @ 8174728 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x030022c0 + ldrh r2, [r1, 0x2E] + movs r0, 0x1 + ands r0, r2 + adds r3, r1, 0 + cmp r0, 0 + beq _081747E4 + ldr r0, =0x03005e00 + mov r12, r0 + lsls r0, r6, 2 + adds r1, r0, r6 + lsls r3, r1, 3 + mov r1, r12 + adds r4, r3, r1 + ldrh r2, [r4, 0x8] + movs r5, 0x8 + ldrsh r1, [r4, r5] + mov r9, r0 + cmp r1, 0 + beq _081747B8 + subs r0, r2, 0x1 + strh r0, [r4, 0x8] + movs r5, 0 + adds r7, r3, 0 + movs r0, 0x8 + add r0, r12 + mov r8, r0 +_0817476A: + adds r0, r5, 0x5 + lsls r0, 1 + adds r0, r7 + mov r1, r8 + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0xFF + beq _08174782 + bl sub_818D820 + movs r0, 0xFF + strh r0, [r4] +_08174782: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x5 + bls _0817476A + ldr r0, =0x03005e00 + mov r2, r9 + adds r1, r2, r6 + lsls r1, 3 + adds r1, r0 + ldrh r2, [r1, 0xA] + movs r3, 0xA + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _081747A4 + subs r0, r2, 0x1 + strh r0, [r1, 0xA] +_081747A4: + ldr r0, =sub_81743EC + str r0, [r1] + b _08174884 + .pool +_081747B8: + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + beq _081747D2 + bl sub_80A369C + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl +_081747D2: + ldr r0, =sub_8174898 + str r0, [r4] + b _08174884 + .pool +_081747E4: + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _08174828 + bl sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + beq _08174806 + bl sub_80A369C + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl +_08174806: + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8174898 + str r0, [r1] + b _08174884 + .pool +_08174828: + movs r0, 0x40 + ands r0, r2 + cmp r0, 0 + beq _08174858 + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldrh r2, [r1, 0xC] + movs r4, 0xC + ldrsh r0, [r1, r4] + cmp r0, 0 + beq _08174858 + subs r0, r2, 0x1 + strh r0, [r1, 0xC] + ldr r0, =sub_81745FC + str r0, [r1] + b _08174884 + .pool +_08174858: + ldrh r1, [r3, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08174884 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r2, r0, r1 + movs r5, 0xC + ldrsh r1, [r2, r5] + movs r3, 0x10 + ldrsh r0, [r2, r3] + subs r0, 0x1 + cmp r1, r0 + bge _08174884 + ldrh r0, [r2, 0xC] + adds r0, 0x1 + strh r0, [r2, 0xC] + ldr r0, =sub_81745FC + str r0, [r2] +_08174884: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174728 + + thumb_func_start sub_8174898 +sub_8174898: @ 8174898 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x02037b14 + ldr r1, =0x02037714 + movs r2, 0x80 + lsls r2, 2 + bl CpuSet + ldr r1, =0x0201c000 + ldr r0, =gUnknown_085E56D4 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3} + stm r1!, {r2,r3} + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl sub_80F9BF4 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81748F0 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174898 + + thumb_func_start sub_81748F0 +sub_81748F0: @ 81748F0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_80F9C30 + lsls r0, 24 + cmp r0, 0 + bne _08174988 + movs r5, 0 + lsls r0, r6, 2 + adds r0, r6 + lsls r7, r0, 3 + ldr r0, =0x03005e08 + mov r8, r0 +_08174910: + adds r0, r5, 0x5 + lsls r0, 1 + adds r0, r7 + mov r1, r8 + adds r4, r0, r1 + ldrh r0, [r4] + cmp r0, 0xFF + beq _08174928 + bl sub_818D820 + movs r0, 0xFF + strh r0, [r4] +_08174928: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _08174910 + movs r0, 0 + bl HideBg + movs r0, 0x1 + bl HideBg + movs r0, 0x3 + bl HideBg + bl sub_8198314 + bl FreeAllWindowBuffers + movs r0, 0x1 + bl UnsetBgTilemapBuffer + movs r0, 0x3 + bl UnsetBgTilemapBuffer + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + adds r0, r6, 0 + bl DestroyTask + ldr r4, =0x0203bcdc + ldr r0, [r4] + cmp r0, 0 + beq _08174974 + bl Free + movs r0, 0 + str r0, [r4] +_08174974: + ldr r4, =0x0203bcd8 + ldr r0, [r4] + cmp r0, 0 + beq _08174984 + bl Free + movs r0, 0 + str r0, [r4] +_08174984: + bl sub_8137C3C +_08174988: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81748F0 + + thumb_func_start sub_81749A0 +sub_81749A0: @ 81749A0 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_085E8588 + movs r1, 0x8 + movs r2, 0x1 + bl sub_8198180 + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + ldr r2, =gUnknown_085E8BDC + 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, 0 + movs r1, 0x1 + movs r3, 0 + bl AddTextPrinterParametrized + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8174A08 + str r1, [r0] + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81749A0 + + thumb_func_start sub_8174A08 +sub_8174A08: @ 8174A08 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08174A28 + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8174898 + str r0, [r1] +_08174A28: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174A08 + + thumb_func_start sub_8174A38 +sub_8174A38: @ 8174A38 + push {r4,lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0 + bl PutWindowTilemap + ldr r4, =gUnknown_085E8B3E + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xD0 + bl GetStringCenterAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_085E5388 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x1 + bl box_print + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174A38 + + thumb_func_start sub_8174A88 +sub_8174A88: @ 8174A88 + push {r4-r7,lr} + sub sp, 0x2C + adds r7, r0, 0 + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0 + bl PutWindowTilemap + ldrh r0, [r7, 0x8] + ldr r1, =0x000001ff + ands r1, r0 + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + beq _08174B30 + ldr r1, =gUnknown_085E8C36 + add r0, sp, 0xC + bl CopyString + adds r6, r0, 0 + ldrh r0, [r7, 0x8] + lsls r0, 23 + lsrs r0, 23 + bl sub_806E3C0 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x0000ffff + cmp r4, r0 + beq _08174B04 + adds r0, r4, 0 + movs r1, 0x64 + bl __divsi3 + subs r0, 0x5F + strb r0, [r6] + adds r6, 0x1 + adds r0, r4, 0 + movs r1, 0x64 + bl __modsi3 + adds r4, r0, 0 + movs r1, 0xA + bl __divsi3 + subs r0, 0x5F + strb r0, [r6] + adds r6, 0x1 + adds r0, r4, 0 + movs r1, 0xA + bl __modsi3 + subs r0, 0x5F + b _08174B0E + .pool +_08174B04: + movs r0, 0xAC + strb r0, [r6] + adds r6, 0x1 + strb r0, [r6] + adds r6, 0x1 +_08174B0E: + strb r0, [r6] + adds r6, 0x1 + movs r0, 0xFF + strb r0, [r6] + ldr r0, =gUnknown_085E5388 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0x1 + bl box_print +_08174B30: + adds r1, r7, 0 + adds r1, 0xA + add r0, sp, 0xC + movs r2, 0xA + bl memcpy + add r1, sp, 0xC + movs r0, 0xFF + strb r0, [r1, 0xA] + ldrh r1, [r7, 0x8] + ldr r4, =0x000001ff + adds r0, r4, 0 + ands r0, r1 + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _08174B8C + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0xD0 + bl GetStringCenterAlignXOffset + lsls r2, r0, 24 + lsrs r2, 24 + ldr r0, =gUnknown_085E5388 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + b _08174C82 + .pool +_08174B8C: + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x80 + bl GetStringRightAlignXOffset + lsls r2, r0, 24 + lsrs r2, 24 + ldr r0, =gUnknown_085E5388 + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + add r1, sp, 0xC + movs r0, 0xBA + strb r0, [r1] + mov r0, sp + adds r0, 0xD + ldrh r1, [r7, 0x8] + lsls r1, 23 + lsrs r1, 23 + movs r2, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + adds r6, r0, 0 + ldrh r1, [r7, 0x8] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0x20 + beq _08174C0A + cmp r0, 0x1D + beq _08174C0A + lsls r0, r1, 23 + lsrs r0, 23 + ldr r1, [r7, 0x4] + bl pokemon_species_get_gender_info + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08174C00 + cmp r0, 0xFE + beq _08174C04 + b _08174C0A + .pool +_08174C00: + movs r0, 0xB5 + b _08174C06 +_08174C04: + movs r0, 0xB6 +_08174C06: + strb r0, [r6] + adds r6, 0x1 +_08174C0A: + movs r0, 0xFF + strb r0, [r6] + ldr r5, =gUnknown_085E5388 + str r5, [sp] + movs r4, 0x1 + negs r4, r4 + str r4, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0x80 + movs r3, 0x1 + bl box_print + ldr r1, =gUnknown_085E8C3B + add r0, sp, 0xC + bl CopyString + adds r6, r0, 0 + ldrb r1, [r7, 0x9] + lsrs r1, 1 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + str r5, [sp] + str r4, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0x24 + movs r3, 0x11 + bl box_print + ldr r1, =gUnknown_085E8C4D + add r0, sp, 0xC + bl CopyString + adds r6, r0, 0 + ldrh r1, [r7] + movs r2, 0x2 + movs r3, 0x5 + bl ConvertIntToDecimalString + str r5, [sp] + str r4, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + movs r2, 0x68 + movs r3, 0x11 + bl box_print + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram +_08174C82: + add sp, 0x2C + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174A88 + + thumb_func_start sub_8174C98 +sub_8174C98: @ 8174C98 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + movs r0, 0x1 + movs r1, 0x11 + bl FillWindowPixelBuffer + movs r0, 0x1 + bl PutWindowTilemap + ldr r2, =0x0000021d + movs r0, 0x1 + movs r1, 0 + movs r3, 0xD + bl SetWindowBorderStyle + ldr r0, =gUnknown_085E538C + mov r8, r0 + str r0, [sp] + movs r1, 0x1 + negs r1, r1 + mov r9, r1 + str r1, [sp, 0x4] + ldr r0, =gUnknown_085E8C48 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl box_print + ldr r0, =0x03005d90 + mov r10, r0 + ldr r1, [r0] + movs r0, 0x1 + movs r2, 0x70 + bl GetStringRightAlignXOffset + lsls r2, r0, 24 + lsrs r2, 24 + mov r1, r8 + str r1, [sp] + mov r0, r9 + str r0, [sp, 0x4] + mov r1, r10 + ldr r0, [r1] + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x1 + bl box_print + mov r1, r10 + ldr r0, [r1] + ldrb r4, [r0, 0xA] + ldrb r0, [r0, 0xB] + lsls r0, 8 + orrs r4, r0 + mov r0, r8 + str r0, [sp] + movs r7, 0 + str r7, [sp, 0x4] + ldr r0, =gUnknown_085E8C4D + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x11 + bl box_print + add r6, sp, 0xC + ldr r1, =0x000186a0 + adds r0, r4, 0 + bl __modsi3 + ldr r5, =0x00002710 + adds r1, r5, 0 + bl __divsi3 + subs r0, 0x5F + strb r0, [r6] + add r6, sp, 0xC + adds r0, r4, 0 + adds r1, r5, 0 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r5, 0xFA + lsls r5, 2 + adds r1, r5, 0 + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r6, 0x1] + add r6, sp, 0xC + adds r0, r4, 0 + adds r1, r5, 0 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r6, 0x2] + add r5, sp, 0xC + adds r0, r4, 0 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r5, 0x3] + add r5, sp, 0xC + adds r0, r4, 0 + movs r1, 0xA + bl __umodsi3 + adds r0, 0xA1 + strb r0, [r5, 0x4] + add r1, sp, 0xC + movs r0, 0xFF + strb r0, [r1, 0x5] + movs r0, 0x1 + movs r2, 0x70 + bl GetStringRightAlignXOffset + lsls r2, r0, 24 + lsrs r2, 24 + mov r1, r8 + str r1, [sp] + mov r0, r9 + str r0, [sp, 0x4] + add r1, sp, 0xC + str r1, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x11 + bl box_print + mov r0, r8 + str r0, [sp] + mov r1, r9 + str r1, [sp, 0x4] + ldr r0, =gUnknown_085E84CE + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x21 + bl box_print + add r5, sp, 0xC + mov r0, r10 + ldr r4, [r0] + ldrh r0, [r4, 0xE] + movs r1, 0x64 + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r5] + add r5, sp, 0xC + ldrh r0, [r4, 0xE] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r5, 0x1] + add r5, sp, 0xC + ldrh r0, [r4, 0xE] + movs r1, 0xA + bl __umodsi3 + adds r0, 0xA1 + strb r0, [r5, 0x2] + add r0, sp, 0xC + ldrb r0, [r0] + cmp r0, 0xA1 + bne _08174E1E + add r0, sp, 0xC + strb r7, [r0] +_08174E1E: + add r0, sp, 0xC + ldrb r1, [r0] + cmp r1, 0 + bne _08174E30 + ldrb r0, [r0, 0x1] + cmp r0, 0xA1 + bne _08174E30 + add r0, sp, 0xC + strb r1, [r0, 0x8] +_08174E30: + add r1, sp, 0xC + movs r0, 0xF0 + strb r0, [r1, 0x3] + adds r4, r1, 0 + ldr r0, =0x03005d90 + ldr r5, [r0] + ldrb r0, [r5, 0x10] + movs r1, 0x64 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0xA + bl __udivsi3 + adds r0, 0xA1 + strb r0, [r4, 0x4] + add r4, sp, 0xC + ldrb r0, [r5, 0x10] + movs r1, 0xA + bl __umodsi3 + adds r0, 0xA1 + strb r0, [r4, 0x5] + add r1, sp, 0xC + movs r0, 0xFF + strb r0, [r1, 0x6] + movs r0, 0x1 + movs r2, 0x70 + bl GetStringRightAlignXOffset + lsls r2, r0, 24 + lsrs r2, 24 + ldr r0, =gUnknown_085E538C + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + add r1, sp, 0xC + str r1, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x21 + bl box_print + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram + 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_8174C98 + + thumb_func_start sub_8174EC4 +sub_8174EC4: @ 8174EC4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + movs r3, 0xC0 + lsls r3, 19 + movs r4, 0xC0 + lsls r4, 9 + add r0, sp, 0x4 + mov r8, r0 + mov r2, sp + movs r6, 0 + ldr r1, =0x040000d4 + movs r5, 0x80 + lsls r5, 5 + ldr r7, =0x81000800 + movs r0, 0x81 + lsls r0, 24 + mov r12, r0 +_08174EEA: + strh r6, [r2] + mov r0, sp + str r0, [r1] + str r3, [r1, 0x4] + str r7, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r3, r5 + subs r4, r5 + cmp r4, r5 + bhi _08174EEA + strh r6, [r2] + mov r2, sp + str r2, [r1] + str r3, [r1, 0x4] + lsrs r0, r4, 1 + mov r2, r12 + orrs r0, r2 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r0, 0xE0 + lsls r0, 19 + movs r3, 0x80 + lsls r3, 3 + movs r4, 0 + str r4, [sp, 0x4] + ldr r2, =0x040000d4 + mov r1, r8 + str r1, [r2] + str r0, [r2, 0x4] + lsrs r0, r3, 2 + movs r1, 0x85 + lsls r1, 24 + orrs r0, r1 + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + movs r1, 0xA0 + lsls r1, 19 + mov r0, sp + strh r4, [r0] + str r0, [r2] + str r1, [r2, 0x4] + lsrs r3, 1 + movs r0, 0x81 + lsls r0, 24 + orrs r3, r0 + str r3, [r2, 0x8] + ldr r0, [r2, 0x8] + bl sub_80A1A74 + ldr r0, =gUnknown_085E54E8 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174EC4 + + thumb_func_start sub_8174F70 +sub_8174F70: @ 8174F70 + push {lr} + bl remove_some_task + bl ResetTasks + bl ResetAllObjectData + bl reset_temp_tile_data_buffers + bl dp13_810BB8C + bl ResetObjectPaletteAllocator + ldr r1, =0x0300301c + movs r0, 0x8 + strb r0, [r1] + ldr r0, =gUnknown_085E5394 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085E53A4 + bl LoadCompressedObjectPalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174F70 + + thumb_func_start sub_8174FAC +sub_8174FAC: @ 8174FAC + push {r4,lr} + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085E5374 + movs r0, 0 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r4, =0x0203bcdc + ldr r1, [r4] + adds r1, 0x12 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00001012 + adds r1, r0 + movs r0, 0x3 + bl SetBgTilemapBuffer + 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 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8174FAC + + thumb_func_start sub_8175024 +sub_8175024: @ 8175024 + push {r4,lr} + sub sp, 0x8 + ldr r0, =0x0203bcdc + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0x4 + bhi _08175108 + lsls r0, 2 + ldr r1, =_08175044 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08175044: + .4byte _08175058 + .4byte _08175070 + .4byte _0817507C + .4byte _081750D2 + .4byte _081750DC +_08175058: + ldr r1, =gUnknown_085E5508 + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _08175108 + .pool +_08175070: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + beq _08175108 + b _08175112 +_0817507C: + movs r4, 0x20 + str r4, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r4, [sp] + movs r0, 0xB + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0x3 + bl FillBgTilemapBufferRect_Palette0 + str r4, [sp] + movs r0, 0x6 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + movs r3, 0xE + bl FillBgTilemapBufferRect_Palette0 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + movs r1, 0x2 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + b _08175108 +_081750D2: + bl sub_81971D0 + bl sub_8197200 + b _08175108 +_081750DC: + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x3 + bl ShowBg + ldr r0, =0x0203bcdc + ldr r1, [r0] + movs r0, 0 + strh r0, [r1] + b _08175114 + .pool +_08175108: + ldr r0, =0x0203bcdc + ldr r1, [r0] + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_08175112: + movs r0, 0x1 +_08175114: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8175024 + + thumb_func_start sub_8175120 +sub_8175120: @ 8175120 + push {r4,lr} + adds r2, r0, 0 + ldr r1, [r2, 0x20] + ldr r0, [r2, 0x30] + cmp r1, r0 + beq _08175176 + ldrh r3, [r2, 0x20] + movs r1, 0x20 + ldrsh r0, [r2, r1] + movs r4, 0x30 + ldrsh r1, [r2, r4] + cmp r0, r1 + bge _08175140 + adds r0, r3, 0 + adds r0, 0xF + strh r0, [r2, 0x20] +_08175140: + ldrh r3, [r2, 0x20] + movs r4, 0x20 + ldrsh r0, [r2, r4] + cmp r0, r1 + ble _08175150 + adds r0, r3, 0 + subs r0, 0xF + strh r0, [r2, 0x20] +_08175150: + ldrh r3, [r2, 0x22] + movs r1, 0x22 + ldrsh r0, [r2, r1] + movs r4, 0x32 + ldrsh r1, [r2, r4] + cmp r0, r1 + bge _08175164 + adds r0, r3, 0 + adds r0, 0xA + strh r0, [r2, 0x22] +_08175164: + ldrh r3, [r2, 0x22] + movs r4, 0x22 + ldrsh r0, [r2, r4] + cmp r0, r1 + ble _0817519C + adds r0, r3, 0 + subs r0, 0xA + strh r0, [r2, 0x22] + b _0817519C +_08175176: + ldrh r0, [r2, 0x3C] + lsls r1, r0, 16 + movs r0, 0xCE + lsls r0, 17 + cmp r1, r0 + bne _08175190 + lsrs r1, 16 + adds r0, r2, 0 + movs r2, 0x1 + movs r3, 0x3 + bl sub_806ED40 + b _0817519C +_08175190: + lsrs r1, 16 + adds r0, r2, 0 + movs r2, 0 + movs r3, 0x3 + bl sub_806ED40 +_0817519C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8175120 + + thumb_func_start sub_81751A4 +sub_81751A4: @ 81751A4 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r1, [r5, 0x26] + movs r2, 0x26 + ldrsh r0, [r5, r2] + cmp r0, 0x78 + ble _081751BA + adds r0, r5, 0 + bl RemoveObjectAndFreeTiles + b _081751F2 +_081751BA: + adds r0, r1, 0x1 + ldrh r1, [r5, 0x30] + adds r0, r1 + strh r0, [r5, 0x26] + ldrh r4, [r5, 0x2E] + lsls r4, 24 + lsrs r4, 24 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + ands r0, r1 + adds r0, 0x8 + ldr r1, =gUnknown_08329F40 + lsls r4, 1 + adds r4, r1 + movs r2, 0 + ldrsh r1, [r4, r2] + muls r0, r1 + cmp r0, 0 + bge _081751E8 + adds r0, 0xFF +_081751E8: + asrs r0, 8 + strh r0, [r5, 0x24] + ldrh r0, [r5, 0x2E] + adds r0, 0x4 + strh r0, [r5, 0x2E] +_081751F2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81751A4 + + thumb_func_start sub_81751FC +sub_81751FC: @ 81751FC + push {r4,lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF0 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl GenerateRandomNumber + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0x7 + ands r2, r0 + negs r2, r2 + ldr r0, =gUnknown_085E54D0 + lsls r4, 16 + asrs r4, 16 + lsls r2, 16 + asrs r2, 16 + adds r1, r4, 0 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r4, r1, r0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x11 + bl __umodsi3 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + bl GenerateRandomNumber + movs r1, 0x3 + ands r1, r0 + cmp r1, 0 + beq _08175274 + movs r0, 0 + b _08175276 + .pool +_08175274: + movs r0, 0x1 +_08175276: + strh r0, [r4, 0x30] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81751FC + + thumb_func_start sub_8175280 +sub_8175280: @ 8175280 + push {r4,lr} + ldr r4, =0x020375e0 + movs r0, 0xB4 + strh r0, [r4] + ldr r0, =sub_8175364 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _081752AA + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r4] + strh r1, [r0, 0xA] + ldr r0, =0x020375e2 + strh r2, [r0] +_081752AA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175280 + + thumb_func_start sub_81752C0 +sub_81752C0: @ 81752C0 + push {r4,lr} + ldr r0, =sub_8175364 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _081752D4 + bl DestroyTask +_081752D4: + bl sub_8152254 + ldr r4, =0x000003e9 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81752C0 + + thumb_func_start sub_81752F4 +sub_81752F4: @ 81752F4 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r1, [r5, 0xE] + movs r2, 0xE + ldrsh r0, [r5, r2] + cmp r0, 0x6E + ble _08175324 + ldr r2, =0x03005e00 + movs r0, 0x28 + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0x26] + subs r1, 0x1 + strh r1, [r0, 0x26] + ldrb r0, [r5, 0x16] + bl sub_81525D0 + b _08175358 + .pool +_08175324: + adds r0, r1, 0x1 + ldrh r1, [r5, 0x1C] + adds r0, r1 + strh r0, [r5, 0xE] + ldrb r4, [r5, 0x1A] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + ands r0, r1 + adds r0, 0x8 + ldr r1, =gUnknown_08329F40 + lsls r4, 1 + adds r4, r1 + movs r2, 0 + ldrsh r1, [r4, r2] + muls r0, r1 + cmp r0, 0 + bge _0817534E + adds r0, 0xFF +_0817534E: + asrs r0, 8 + strh r0, [r5, 0xC] + ldrh r0, [r5, 0x1A] + adds r0, 0x4 + strh r0, [r5, 0x1A] +_08175358: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81752F4 + + thumb_func_start sub_8175364 +sub_8175364: @ 8175364 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r4, r0, 24 + mov r8, r4 + movs r7, 0 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r6, r0, r1 + ldrh r0, [r6] + cmp r0, 0x1 + beq _081753E0 + cmp r0, 0x1 + bgt _08175394 + cmp r0, 0 + beq _0817539C + b _081754B0 + .pool +_08175394: + cmp r0, 0xFF + bne _0817539A + b _081754A0 +_0817539A: + b _081754B0 +_0817539C: + movs r0, 0x40 + bl sub_81521C0 + cmp r0, 0 + bne _081753B8 + adds r0, r4, 0 + bl DestroyTask + ldr r0, =0x020375e0 + strh r7, [r0] + ldr r1, =0x020375e2 + ldr r2, =0x0000ffff + adds r0, r2, 0 + strh r0, [r1] +_081753B8: + ldr r0, =gUnknown_085E5394 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085E53A4 + bl LoadCompressedObjectPalette + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] + b _081754B0 + .pool +_081753E0: + ldrh r0, [r6, 0x2] + cmp r0, 0 + beq _08175478 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _08175478 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF0 + bl __umodsi3 + adds r5, r0, 0 + lsls r5, 16 + asrs r5, 16 + bl GenerateRandomNumber + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x7 + ands r4, r0 + negs r4, r4 + lsls r4, 16 + asrs r4, 16 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x11 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_085E53FC + ldr r2, =0x000003e9 + str r4, [sp] + str r0, [sp, 0x4] + str r7, [sp, 0x8] + adds r0, r1, 0 + adds r1, r2, 0 + adds r3, r5, 0 + bl sub_81524C4 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0xFF + beq _08175478 + adds r4, r7, 0 + ldr r1, =sub_81752F4 + adds r0, r4, 0 + bl sub_8152438 + bl GenerateRandomNumber + movs r1, 0x3 + ands r1, r0 + cmp r1, 0 + bne _08175468 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_8152474 +_08175468: + adds r0, r4, 0 + movs r1, 0x7 + mov r2, r8 + bl sub_8152474 + ldrh r0, [r6, 0x1E] + adds r0, 0x1 + strh r0, [r6, 0x1E] +_08175478: + bl sub_81522D4 + ldrh r0, [r6, 0x2] + cmp r0, 0 + beq _08175494 + subs r0, 0x1 + strh r0, [r6, 0x2] + b _081754B0 + .pool +_08175494: + ldrh r0, [r6, 0x1E] + cmp r0, 0 + bne _081754B0 + movs r0, 0xFF + strh r0, [r6] + b _081754B0 +_081754A0: + bl sub_81752C0 + ldr r0, =0x020375e0 + strh r7, [r0] + ldr r1, =0x020375e2 + ldr r2, =0x0000ffff + adds r0, r2, 0 + strh r0, [r1] +_081754B0: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175364 + + thumb_func_start sub_81754C8 +sub_81754C8: @ 81754C8 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_81754C8 + + thumb_func_start sub_81754DC +sub_81754DC: @ 81754DC + push {lr} + bl RunTasks + bl CallObjectCallbacks + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2C] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08175522 + ldr r0, =0x0203bce4 + ldrb r0, [r0] + cmp r0, 0 + beq _08175522 + ldr r2, =0x03005e00 + ldr r0, =0x0203bce2 + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldr r1, [r0] + ldr r0, =sub_8175774 + cmp r1, r0 + bne _08175522 + bl sub_81754C8 + bl RunTasks + bl CallObjectCallbacks + ldr r1, =0x0203bce5 + movs r0, 0x1 + strb r0, [r1] +_08175522: + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r0} + bx r0 + .pool + thumb_func_end sub_81754DC + + thumb_func_start sub_8175548 +sub_8175548: @ 8175548 + push {lr} + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085E6F68 + movs r0, 0 + movs r2, 0x1 + bl InitBgsFromTemplates + movs r0, 0x80 + lsls r0, 4 + bl AllocZeroed + adds r1, r0, 0 + movs r0, 0 + bl SetBgTilemapBuffer + ldr r0, =gUnknown_085E56F0 + movs r1, 0x80 + movs r2, 0x40 + bl gpu_pal_apply + ldr r0, =gUnknown_085E6F6C + bl InitWindows + bl DeactivateAllTextPrinters + movs r0, 0 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0 + bl ShowBg + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175548 + + thumb_func_start sub_81755A4 +sub_81755A4: @ 81755A4 + push {lr} + bl FreeAllWindowBuffers + movs r0, 0 + bl GetBgTilemapBuffer + cmp r0, 0 + beq _081755B8 + bl Free +_081755B8: + pop {r0} + bx r0 + thumb_func_end sub_81755A4 + + thumb_func_start sub_81755BC +sub_81755BC: @ 81755BC + push {r4,r5,lr} + sub sp, 0x18 + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r2, 24 + add r1, sp, 0x14 + movs r0, 0 + strb r0, [r1] + cmp r2, 0x1 + bne _081755DC + movs r0, 0x3 + strb r0, [r1, 0x1] + movs r0, 0x4 + b _081755E4 +_081755DC: + add r1, sp, 0x14 + movs r0, 0x1 + strb r0, [r1, 0x1] + movs r0, 0x2 +_081755E4: + strb r0, [r1, 0x2] + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xF0 + movs r3, 0x1 + bl GetStringCenterAlignXOffsetWithLetterSpacing + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + add r0, sp, 0x14 + str r0, [sp, 0x8] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0xC] + str r4, [sp, 0x10] + movs r0, 0 + movs r1, 0x1 + adds r3, r5, 0 + bl AddTextPrinterParametrized2 + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_81755BC + + thumb_func_start sub_8175620 +sub_8175620: @ 8175620 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + bl sub_8175CE4 + movs r0, 0 + bl SetVBlankCallback + ldr r0, =0x02000000 + movs r1, 0xE0 + lsls r1, 9 + bl InitHeap + bl sub_80A1A74 + bl ResetTasks + bl sub_8175548 + ldr r0, =sub_8175744 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x10] + strh r1, [r0, 0x16] + strh r1, [r0, 0x1E] + movs r1, 0x1 + strh r1, [r0, 0x22] +_0817566A: + movs r0, 0 + adds r1, r7, 0 + bl sub_8176AB0 + lsls r0, 24 + cmp r0, 0 + beq _0817566A + ldr r5, =0x03005e00 + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r5 + movs r0, 0xA + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r1, 0 + mov r8, r1 + movs r6, 0 + movs r1, 0x28 + strh r1, [r0, 0x8] + ldr r1, =0x0000fffc + movs r0, 0x12 + bl SetGpuReg + ldr r0, =sub_8175DA0 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + strh r7, [r1, 0xA] + strh r0, [r4, 0x26] + movs r0, 0x1 + negs r0, r0 + str r6, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r0, 0x1 + bl EnableInterrupts + ldr r0, =sub_81754C8 + bl SetVBlankCallback + ldr r0, =0x000001c7 + bl m4aSongNumStart + ldr r0, =sub_81754DC + bl SetMainCallback2 + ldr r0, =0x0203bce5 + mov r1, r8 + strb r1, [r0] + ldr r4, =0x0203bce8 + movs r0, 0xEB + lsls r0, 2 + bl AllocZeroed + str r0, [r4] + bl sub_8177388 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x8E + strh r6, [r0] + adds r0, 0x2 + strh r6, [r0] + adds r0, 0x2 + strh r6, [r0] + ldr r0, =0x0203bce2 + strh r7, [r0] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175620 + + thumb_func_start sub_8175744 +sub_8175744: @ 8175744 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08175764 + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8175774 + str r0, [r1] +_08175764: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175744 + + thumb_func_start sub_8175774 +sub_8175774: @ 8175774 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + movs r0, 0x10 + ldrsh r1, [r4, r0] + cmp r1, 0 + beq _081757B0 + movs r3, 0xA + ldrsh r1, [r4, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x1E + strh r1, [r0, 0x8] + movs r0, 0x80 + lsls r0, 1 + strh r0, [r4, 0x20] + ldr r0, =sub_8175A9C + b _081757FA + .pool +_081757B0: + ldr r0, =0x0203bce0 + strh r1, [r0] + ldrh r2, [r4, 0x1E] + movs r3, 0x1E + ldrsh r0, [r4, r3] + cmp r0, 0x1 + bne _081757E0 + strh r2, [r4, 0x22] + strh r1, [r4, 0x1E] + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_8175808 + b _081757FA + .pool +_081757E0: + cmp r0, 0x2 + bne _081757FC + strh r2, [r4, 0x22] + strh r1, [r4, 0x1E] + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_81758A4 +_081757FA: + str r0, [r4] +_081757FC: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175774 + + thumb_func_start sub_8175808 +sub_8175808: @ 8175808 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08175836 + movs r0, 0 + movs r1, 0 + bl SetGpuReg + adds r0, r4, 0 + bl sub_8176CA0 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =c2_080C9BFC + str r0, [r1] +_08175836: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175808 + + thumb_func_start c2_080C9BFC +c2_080C9BFC: @ 8175848 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + bl SetVBlankCallback + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r5, r0, r1 + ldrb r0, [r5, 0x16] + adds r1, r4, 0 + bl sub_8176AB0 + lsls r0, 24 + cmp r0, 0 + beq _08175890 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r0, 0x1 + bl EnableInterrupts + ldr r0, =sub_81754C8 + bl SetVBlankCallback + ldr r0, =sub_8175744 + str r0, [r5] +_08175890: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end c2_080C9BFC + + thumb_func_start sub_81758A4 +sub_81758A4: @ 81758A4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081758D2 + movs r0, 0 + movs r1, 0 + bl SetGpuReg + adds r0, r4, 0 + bl sub_8176CA0 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_81758E4 + str r0, [r1] +_081758D2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81758A4 + + thumb_func_start sub_81758E4 +sub_81758E4: @ 81758E4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r1, r0 + mov r8, r1 + ldrb r7, [r1] + cmp r7, 0 + beq _08175906 + cmp r7, 0x1 + beq _081759F0 +_08175906: + bl ResetAllObjectData + bl dp13_810BB8C + bl ResetObjectPaletteAllocator + ldr r1, =0x0300301c + movs r0, 0x8 + strb r0, [r1] + ldr r0, =gUnknown_085B0E04 + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, =gUnknown_085B0C0C + ldr r1, =0x06003800 + bl LZ77UnCompVram + ldr r0, =gUnknown_085B0A02 + movs r1, 0x1 + movs r2, 0x3E + bl gpu_pal_apply + movs r1, 0 + ldr r4, =0x0201c000 + movs r3, 0x11 + ldr r2, =0x000007ff +_0817593C: + adds r0, r1, r4 + strb r3, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r2 + bls _0817593C + movs r1, 0 + ldr r2, =0x0201d800 + ldr r6, =gUnknown_085E701C + ldr r0, =0xfffff000 + adds r5, r2, r0 + movs r4, 0x22 + ldr r3, =0x000007ff +_08175958: + adds r0, r1, r5 + strb r4, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r3 + bls _08175958 + movs r1, 0 + ldr r5, =0x0201d000 + movs r4, 0x33 + ldr r3, =0x000007ff +_0817596E: + adds r0, r1, r5 + strb r4, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r3 + bls _0817596E + movs r0, 0 + strh r0, [r2] + ldr r1, =0x000053ff + adds r0, r1, 0 + strh r0, [r2, 0x2] + ldr r1, =0x0000529f + adds r0, r1, 0 + strh r0, [r2, 0x4] + ldr r1, =0x00007e94 + adds r0, r1, 0 + strh r0, [r2, 0x6] + adds r0, r6, 0 + bl LoadObjectPic + ldr r0, =gUnknown_085E702C + bl LoadTaggedObjectPalette + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08175A7A + .pool +_081759F0: + ldr r0, =sub_81760FC + movs r1, 0 + bl CreateTask + ldr r2, =0x03005e00 + lsls r4, r6, 2 + adds r4, r6 + lsls r4, 3 + adds r4, r2 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + mov r9, r1 + movs r5, 0 + strh r0, [r4, 0xE] + movs r0, 0xE + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + strh r7, [r0, 0x8] + movs r0, 0xE + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + strh r6, [r0, 0xA] + movs r0, 0xE + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r4, 0x16] + strh r1, [r0, 0xC] + movs r0, 0x1 + negs r0, r0 + str r5, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r0, 0x1C + movs r1, 0 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0x20 + bl SetGpuReg + ldr r1, =0x00000703 + movs r0, 0xE + bl SetGpuReg + movs r1, 0xCA + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + mov r0, r9 + mov r1, r8 + strb r0, [r1] + ldr r0, =0x0203bd28 + strh r5, [r0] + ldr r0, =sub_8175744 + str r0, [r4] +_08175A7A: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81758E4 + + thumb_func_start sub_8175A9C +sub_8175A9C: @ 8175A9C + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x20] + movs r2, 0x20 + ldrsh r1, [r4, r2] + cmp r1, 0 + beq _08175AC4 + subs r0, 0x1 + strh r0, [r4, 0x20] + b _08175AD8 + .pool +_08175AC4: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0xC + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_8175AE4 + str r0, [r4] +_08175AD8: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175A9C + + thumb_func_start sub_8175AE4 +sub_8175AE4: @ 8175AE4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08175B0A + adds r0, r4, 0 + bl sub_8176CA0 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8175B1C + str r0, [r1] +_08175B0A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175AE4 + + thumb_func_start sub_8175B1C +sub_8175B1C: @ 8175B1C + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8175CE4 + bl sub_80A1A74 + movs r1, 0xE0 + lsls r1, 6 + movs r0, 0 + movs r2, 0 + bl sub_8176D1C + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r1, 0x8 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r1, 0xE0 + lsls r1, 3 + movs r0, 0x8 + bl SetGpuReg + movs r0, 0x1 + bl EnableInterrupts + movs r1, 0xA0 + lsls r1, 1 + movs r0, 0 + bl SetGpuReg + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0xEB + strh r1, [r0, 0x8] + ldr r1, =sub_8175B90 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175B1C + + thumb_func_start sub_8175B90 +sub_8175B90: @ 8175B90 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0x8] + movs r2, 0x8 + ldrsh r1, [r4, r2] + cmp r1, 0 + beq _08175BB8 + subs r0, 0x1 + strh r0, [r4, 0x8] + b _08175BCC + .pool +_08175BB8: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0x6 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_8175BD8 + str r0, [r4] +_08175BCC: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175B90 + + thumb_func_start sub_8175BD8 +sub_8175BD8: @ 8175BD8 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _08175C1E + movs r0, 0xE0 + lsls r0, 6 + movs r1, 0 + bl sub_8176E40 + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl pal_fade_maybe + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0xE1 + lsls r1, 5 + strh r1, [r0, 0x8] + ldr r1, =sub_8175C34 + str r1, [r0] +_08175C1E: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175BD8 + + thumb_func_start sub_8175C34 +sub_8175C34: @ 8175C34 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08175CB8 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0 + beq _08175C62 + ldr r0, =0x030022c0 + ldrh r0, [r0, 0x2E] + cmp r0, 0 + beq _08175C94 +_08175C62: + movs r0, 0x4 + bl play_sound_effect + movs r0, 0x1 + negs r0, r0 + ldr r1, =0x0000ffff + str r1, [sp] + movs r1, 0x8 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_8175CC8 + str r0, [r4] + b _08175CB8 + .pool +_08175C94: + ldr r0, =0x00001be8 + cmp r1, r0 + bne _08175CA0 + movs r0, 0x8 + bl play_sound_effect +_08175CA0: + movs r0, 0x8 + ldrsh r1, [r4, r0] + ldr r0, =0x00001ab8 + cmp r1, r0 + bne _08175CB2 + movs r0, 0xE4 + lsls r0, 1 + bl m4aSongNumStart +_08175CB2: + ldrh r0, [r4, 0x8] + subs r0, 0x1 + strh r0, [r4, 0x8] +_08175CB8: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175C34 + + thumb_func_start sub_8175CC8 +sub_8175CC8: @ 8175CC8 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08175CDC + movs r0, 0xFF + bl SoftReset +_08175CDC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175CC8 + + thumb_func_start sub_8175CE4 +sub_8175CE4: @ 8175CE4 + push {lr} + sub sp, 0x8 + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1C + movs r1, 0 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0 + bl SetGpuReg + movs r0, 0x18 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + movs r0, 0x16 + movs r1, 0 + bl SetGpuReg + movs r0, 0x10 + movs r1, 0 + bl SetGpuReg + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, =0x040000d4 + mov r0, sp + str r0, [r1] + movs r0, 0xC0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, =0x8100c000 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r2, 0 + str r2, [sp, 0x4] + add r0, sp, 0x4 + str r0, [r1] + movs r0, 0xE0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, =0x85000100 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + mov r0, sp + strh r2, [r0] + str r0, [r1] + ldr r0, =0x05000002 + str r0, [r1, 0x4] + ldr r0, =0x810001ff + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175CE4 + + thumb_func_start sub_8175DA0 +sub_8175DA0: @ 8175DA0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r5, r1, 0 + cmp r0, 0xA + bhi _08175E00 + lsls r0, 2 + ldr r1, =_08175DD4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08175DD4: + .4byte _08175E00 + .4byte _08175E40 + .4byte _08175E60 + .4byte _08175F38 + .4byte _08175F5C + .4byte _08175FC8 + .4byte _08175E00 + .4byte _08175E00 + .4byte _08175E00 + .4byte _08175E00 + .4byte _08175FFC +_08175E00: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _08175E12 + b _0817602A +_08175E12: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r5 + movs r1, 0x1 + strh r1, [r0, 0x8] + movs r1, 0x48 + strh r1, [r0, 0xE] + movs r3, 0xA + ldrsh r1, [r0, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + strh r2, [r0, 0x24] + ldr r0, =0x0203bce0 + strh r2, [r0] + b _0817602A + .pool +_08175E40: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r5 + ldrh r2, [r1, 0xE] + movs r3, 0xE + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _08175E58 + subs r0, r2, 0x1 + strh r0, [r1, 0xE] + b _0817602A +_08175E58: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0817602A +_08175E60: + lsls r2, r4, 2 + adds r0, r2, r4 + lsls r0, 3 + adds r3, r0, r5 + movs r0, 0xA + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r5, r0, r5 + ldr r1, [r5] + ldr r0, =sub_8175774 + mov r9, r2 + cmp r1, r0 + bne _08175F32 + movs r1, 0xC + ldrsh r0, [r3, r1] + cmp r0, 0x38 + bgt _08175F2C + movs r5, 0 + ldr r2, =gUnknown_085E6AF4 + mov r8, r2 + adds r7, r3, 0 + movs r6, 0xA0 + lsls r6, 19 +_08175E92: + movs r3, 0xC + ldrsh r1, [r7, r3] + lsls r0, r1, 2 + adds r0, r1 + adds r0, r5 + lsls r0, 2 + add r0, r8 + ldr r2, [r0] + ldr r0, [r2, 0x4] + lsrs r1, r6, 24 + ldrb r2, [r2, 0x1] + bl sub_81755BC + movs r0, 0x80 + lsls r0, 21 + adds r6, r0 + adds r5, 0x1 + cmp r5, 0x4 + ble _08175E92 + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + ldr r3, =0x03005e00 + mov r2, r9 + adds r1, r2, r4 + lsls r1, 3 + adds r1, r3 + ldrh r0, [r1, 0xC] + adds r0, 0x1 + strh r0, [r1, 0xC] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + movs r0, 0xA + ldrsh r2, [r1, r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r3 + movs r2, 0x1 + strh r2, [r0, 0x24] + movs r2, 0xA + ldrsh r1, [r1, r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r3 + movs r3, 0x22 + ldrsh r0, [r0, r3] + cmp r0, 0x1 + bne _08175F14 + movs r0, 0xC0 + lsls r0, 2 + ldr r1, =0x0000328d + b _08175F1A + .pool +_08175F14: + movs r0, 0xC0 + lsls r0, 2 + ldr r1, =0x00001967 +_08175F1A: + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + b _0817602A + .pool +_08175F2C: + movs r0, 0xA + strh r0, [r3, 0x8] + b _0817602A +_08175F32: + movs r0, 0 + strh r0, [r5, 0x24] + b _0817602A +_08175F38: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0817602A + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r5 + movs r1, 0x73 + strh r1, [r0, 0xE] + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + b _0817602A + .pool +_08175F5C: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r4, r0, r5 + ldrh r1, [r4, 0xE] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08175F74 + subs r0, r1, 0x1 + strh r0, [r4, 0xE] + b _0817602A +_08175F74: + ldrb r0, [r4, 0xC] + ldrb r1, [r4, 0xA] + bl sub_817603C + lsls r0, 24 + cmp r0, 0 + beq _08175F8A + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0817602A +_08175F8A: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r3, 0xA + ldrsh r1, [r4, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r1, 0x22 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + bne _08175FB0 + movs r0, 0xC0 + lsls r0, 2 + ldr r1, =0x0000328d + b _08175FB6 + .pool +_08175FB0: + movs r0, 0xC0 + lsls r0, 2 + ldr r1, =0x00001967 +_08175FB6: + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _0817602A + .pool +_08175FC8: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0817602A + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0 + movs r1, 0x2 + bl CopyWindowToVram + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x2 + strh r0, [r1, 0x8] + b _0817602A + .pool +_08175FFC: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r5 + movs r2, 0xA + ldrsh r1, [r0, r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r5 + movs r5, 0 + movs r1, 0x1 + strh r1, [r0, 0x10] + adds r0, r4, 0 + bl DestroyTask + bl sub_81755A4 + ldr r4, =0x0203bce8 + ldr r0, [r4] + bl Free + str r5, [r4] +_0817602A: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8175DA0 + + thumb_func_start sub_817603C +sub_817603C: @ 817603C + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + adds r6, r3, 0 + lsls r1, 24 + lsrs r2, r1, 24 + adds r5, r2, 0 + ldr r4, =0x03005e00 + cmp r3, 0x6 + bne _0817605C + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x1E] +_0817605C: + cmp r3, 0xC + bne _0817606E + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x1 + strh r1, [r0, 0x16] + strh r1, [r0, 0x1E] +_0817606E: + cmp r3, 0x12 + bne _0817607E + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x1E] +_0817607E: + cmp r3, 0x18 + bne _08176092 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x16] + movs r1, 0x1 + strh r1, [r0, 0x1E] +_08176092: + cmp r3, 0x1E + bne _081760A2 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x1E] +_081760A2: + cmp r3, 0x24 + bne _081760B6 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x3 + strh r1, [r0, 0x16] + movs r1, 0x1 + strh r1, [r0, 0x1E] +_081760B6: + cmp r3, 0x2A + bne _081760C6 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0, 0x1E] +_081760C6: + cmp r6, 0x30 + bne _081760DA + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r4 + movs r1, 0x4 + strh r1, [r0, 0x16] + movs r1, 0x1 + strh r1, [r0, 0x1E] +_081760DA: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r4 + movs r1, 0x1E + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _081760F4 + movs r0, 0 + b _081760F6 + .pool +_081760F4: + movs r0, 0x1 +_081760F6: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_817603C + + thumb_func_start sub_81760FC +sub_81760FC: @ 81760FC + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r2, r0, r4 + movs r1, 0x8 + ldrsh r0, [r2, r1] + cmp r0, 0x1 + beq _0817612C + cmp r0, 0x1 + bgt _0817611A + b _08176244 +_0817611A: + cmp r0, 0x2 + beq _08176158 + cmp r0, 0x3 + bne _08176124 + b _08176230 +_08176124: + b _08176244 + .pool +_0817612C: + ldr r0, =0x0203bce8 + ldr r0, [r0] + adds r0, 0x90 + ldrh r0, [r0] + cmp r0, 0 + bne _0817614E + movs r3, 0xA + ldrsh r0, [r2, r3] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + movs r3, 0x24 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _0817614E + b _08176244 +_0817614E: + ldrh r0, [r2, 0x8] + adds r0, 0x1 + b _08176242 + .pool +_08176158: + ldr r6, =0x0203bce8 + ldr r3, [r6] + adds r0, r3, 0 + adds r0, 0x8E + ldrh r0, [r0] + cmp r0, 0x47 + beq _08176244 + movs r0, 0xA + ldrsh r1, [r2, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + ldr r1, [r0] + ldr r0, =sub_8175774 + cmp r1, r0 + bne _08176244 + adds r0, r3, 0 + adds r0, 0x92 + ldrh r0, [r0] + lsls r0, 1 + adds r0, r3, r0 + ldrh r0, [r0] + ldr r4, =gUnknown_085E6F7C + adds r1, r3, 0 + adds r1, 0x90 + ldrh r3, [r1] + lsls r2, r3, 1 + adds r1, r2, r4 + ldrb r1, [r1] + adds r4, 0x1 + adds r2, r4 + ldrb r2, [r2] + bl sub_8177224 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, [r6] + adds r1, r0, 0 + adds r1, 0x92 + ldrh r3, [r1] + adds r0, 0x94 + ldrh r0, [r0] + subs r0, 0x1 + cmp r3, r0 + bge _081761D8 + adds r0, r3, 0x1 + strh r0, [r1] + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0x32 + b _081761EA + .pool +_081761D8: + movs r0, 0 + strh r0, [r1] + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0x80 + lsls r1, 2 +_081761EA: + strh r1, [r0, 0x34] + ldr r0, =0x0203bce8 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x8E + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x90 + ldrh r0, [r1] + cmp r0, 0x2 + bne _08176210 + movs r0, 0 + b _08176212 + .pool +_08176210: + adds r0, 0x1 +_08176212: + strh r0, [r1] + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r0, 0x32 + strh r0, [r1, 0xE] + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _08176244 + .pool +_08176230: + ldrh r1, [r2, 0xE] + movs r3, 0xE + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _08176240 + subs r0, r1, 0x1 + strh r0, [r2, 0xE] + b _08176244 +_08176240: + movs r0, 0x1 +_08176242: + strh r0, [r2, 0x8] +_08176244: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81760FC + + thumb_func_start sub_817624C +sub_817624C: @ 817624C + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0x8 + ldrsh r0, [r0, r2] + adds r6, r1, 0 + cmp r0, 0x32 + bls _08176268 + b _08176514 +_08176268: + lsls r0, 2 + ldr r1, =_0817627C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0817627C: + .4byte _08176348 + .4byte _0817636C + .4byte _081763C0 + .4byte _081763D8 + .4byte _08176414 + .4byte _08176438 + .4byte _08176484 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176490 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _081764B0 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _081764D4 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176514 + .4byte _08176508 +_08176348: + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r6 + ldrh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 17 + movs r1, 0x7F + ands r0, r1 + movs r1, 0xC + bl sine + ldr r1, =0x0203bd26 + strh r0, [r1] + b _08176390 + .pool +_0817636C: + ldr r7, =0x0203bd26 + movs r3, 0 + ldrsh r4, [r7, r3] + cmp r4, 0 + beq _0817639C + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r6 + ldrh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 17 + movs r1, 0x7F + ands r0, r1 + movs r1, 0xC + bl sine + strh r0, [r7] +_08176390: + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + b _08176514 + .pool +_0817639C: + ldr r3, =0x02020630 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r6 + movs r0, 0xC + ldrsh r2, [r1, r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + movs r2, 0x2 + strh r2, [r0, 0x2E] + strh r4, [r1, 0x12] + b _08176430 + .pool +_081763C0: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r1, r0, r6 + ldrh r2, [r1, 0x12] + movs r3, 0x12 + ldrsh r0, [r1, r3] + cmp r0, 0x3F + bgt _08176430 + adds r0, r2, 0x1 + strh r0, [r1, 0x12] + b _0817644E +_081763D8: + ldr r3, =0x02020630 + lsls r2, r5, 2 + adds r2, r5 + lsls r2, 3 + adds r2, r6 + movs r0, 0xC + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x3 + strh r1, [r0, 0x2E] + movs r0, 0xE + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x1 + strh r1, [r0, 0x2E] + movs r0, 0x78 + strh r0, [r2, 0x10] + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] + b _08176514 + .pool +_08176414: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r1, r0, r6 + ldrh r2, [r1, 0x10] + movs r3, 0x10 + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _0817642C + subs r0, r2, 0x1 + strh r0, [r1, 0x10] + b _08176514 +_0817642C: + movs r0, 0x40 + strh r0, [r1, 0x12] +_08176430: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _08176514 +_08176438: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r6 + ldrh r1, [r4, 0x12] + movs r2, 0x12 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _08176464 + subs r0, r1, 0x1 + strh r0, [r4, 0x12] +_0817644E: + movs r1, 0x7F + ands r0, r1 + movs r1, 0x14 + bl sine + ldr r1, =0x0203bd26 + strh r0, [r1] + b _08176514 + .pool +_08176464: + ldr r2, =0x02020630 + movs r3, 0xC + ldrsh r1, [r4, r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x1 + strh r1, [r0, 0x2E] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _08176514 + .pool +_08176484: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r6 + movs r1, 0x32 + b _08176512 +_08176490: + ldr r3, =0x02020630 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r6 + movs r0, 0xE + ldrsh r2, [r1, r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + movs r2, 0x2 + b _081764C8 + .pool +_081764B0: + ldr r3, =0x02020630 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r6 + movs r0, 0xC + ldrsh r2, [r1, r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + movs r2, 0x4 +_081764C8: + strh r2, [r0, 0x2E] + movs r0, 0x32 + strh r0, [r1, 0x8] + b _08176514 + .pool +_081764D4: + ldr r3, =0x02020630 + lsls r2, r5, 2 + adds r2, r5 + lsls r2, 3 + adds r2, r6 + movs r0, 0xC + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x5 + strh r1, [r0, 0x2E] + movs r0, 0xE + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r1, 0x3 + strh r1, [r0, 0x2E] + movs r0, 0x32 + strh r0, [r2, 0x8] + b _08176514 + .pool +_08176508: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r6 + movs r1, 0 +_08176512: + strh r1, [r0, 0x8] +_08176514: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_817624C + + thumb_func_start sub_817651C +sub_817651C: @ 817651C + push {r4,r5,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r3, 0x8 + ldrsh r0, [r0, r3] + adds r4, r1, 0 + cmp r0, 0x4 + bhi _0817655C + lsls r0, 2 + ldr r1, =_08176548 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08176548: + .4byte _0817655C + .4byte _081765A0 + .4byte _081765AC + .4byte _081765F4 + .4byte _08176640 +_0817655C: + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r2, r0, r4 + movs r1, 0xA + ldrsh r0, [r2, r1] + ldr r5, =0x00007fff + cmp r0, r5 + beq _081765A0 + movs r3, 0xC + ldrsh r1, [r2, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r3, r0, r4 + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r1, 0xC + ldrsh r0, [r0, r1] + cmp r0, 0x2 + bne _081765A0 + movs r1, 0xA + ldrsh r0, [r3, r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + movs r0, 0x14 + strh r0, [r1, 0x8] + strh r5, [r2, 0xA] +_081765A0: + movs r0, 0 + bl sub_817B540 + b _08176646 + .pool +_081765AC: + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r2, r0, r4 + movs r3, 0xA + ldrsh r0, [r2, r3] + ldr r5, =0x00007fff + cmp r0, r5 + beq _08176638 + movs r0, 0xC + ldrsh r1, [r2, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r3, 0xA + ldrsh r1, [r0, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r3, r0, r4 + ldrh r1, [r3, 0x12] + movs r0, 0x80 + negs r0, r0 + ands r0, r1 + movs r1, 0xA0 + lsls r1, 2 + cmp r0, r1 + bne _08176638 + movs r0, 0x1 + strh r0, [r3, 0x8] + strh r5, [r2, 0xA] + b _08176638 + .pool +_081765F4: + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r2, r0, r4 + ldrh r3, [r2, 0xA] + movs r0, 0xA + ldrsh r1, [r2, r0] + ldr r5, =0x00007fff + cmp r1, r5 + beq _08176638 + movs r0, 0x92 + lsls r0, 2 + cmp r1, r0 + bne _08176634 + movs r3, 0xC + ldrsh r1, [r2, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r3, 0xA + ldrsh r1, [r0, r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r1, 0xA + strh r1, [r0, 0x8] + strh r5, [r2, 0xA] + b _08176638 + .pool +_08176634: + adds r0, r3, 0x1 + strh r0, [r2, 0xA] +_08176638: + movs r0, 0x1 + bl sub_817B540 + b _08176646 +_08176640: + movs r0, 0x2 + bl sub_817B540 +_08176646: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_817651C + + thumb_func_start sub_817664C +sub_817664C: @ 817664C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r7, r1, 24 + cmp r0, 0x4 + bls _08176662 + b _081769E0 +_08176662: + lsls r0, 2 + ldr r1, =_08176670 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08176670: + .4byte _08176684 + .4byte _0817672C + .4byte _081767D8 + .4byte _08176884 + .4byte _08176934 +_08176684: + ldr r5, =0x02020630 + ldr r0, =0x03005e00 + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r0 + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r3, 0 + movs r2, 0x88 + lsls r2, 1 + strh r2, [r0, 0x20] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x20] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r2, 0x2E + strh r2, [r0, 0x22] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x22] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + movs r2, 0x20 + b _081769D4 + .pool +_0817672C: + ldr r5, =0x02020630 + ldr r0, =0x03005e00 + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r0 + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r3, 0 + movs r1, 0x78 + strh r1, [r0, 0x20] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x88 + lsls r1, 1 + strh r1, [r0, 0x20] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r2, 0x2E + strh r2, [r0, 0x22] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x22] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + movs r2, 0x20 + b _081769D4 + .pool +_081767D8: + ldr r5, =0x02020630 + ldr r0, =0x03005e00 + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r0 + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r3, 0 + movs r1, 0x78 + strh r1, [r0, 0x20] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x88 + lsls r1, 1 + strh r1, [r0, 0x20] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r2, 0x2E + strh r2, [r0, 0x22] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x22] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r1, 0x80 + lsls r1, 6 + movs r2, 0x80 + lsls r2, 2 + movs r0, 0x1 + b _081769D4 + .pool +_08176884: + ldr r5, =0x02020630 + ldr r0, =0x03005e00 + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r0 + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r3, 0 + movs r1, 0x78 + strh r1, [r0, 0x20] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, =0x0000ffe0 + strh r1, [r0, 0x20] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r2, 0x2E + strh r2, [r0, 0x22] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x22] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r1, 0x80 + lsls r1, 6 + movs r2, 0x80 + lsls r2, 2 + movs r0, 0x1 + b _081769D4 + .pool +_08176934: + ldr r5, =0x02020630 + ldr r0, =0x03005e00 + lsls r4, r7, 2 + adds r4, r7 + lsls r4, 3 + adds r4, r0 + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + adds r0, r2, 0 + ands r0, r3 + strb r0, [r1] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + adds r0, 0x3E + ldrb r1, [r0] + ands r2, r1 + strb r2, [r0] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r3, 0 + movs r1, 0x58 + strh r1, [r0, 0x20] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x98 + strh r1, [r0, 0x20] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r2, 0x2E + strh r2, [r0, 0x22] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x22] + movs r0, 0x12 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r0, 0x14 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r3, [r0, 0x2E] + movs r1, 0x80 + lsls r1, 6 + movs r2, 0x80 + lsls r2, 2 + movs r0, 0x2 +_081769D4: + movs r3, 0x8 + bl sub_817B3DC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x8] +_081769E0: + ldr r0, =sub_817651C + movs r1, 0 + bl CreateTask + ldr r6, =0x03005e00 + lsls r1, r7, 2 + adds r1, r7 + lsls r1, 3 + adds r5, r1, r6 + lsls r0, 24 + lsrs r0, 24 + movs r4, 0 + strh r0, [r5, 0xC] + movs r0, 0xC + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + mov r1, r8 + strh r1, [r0, 0x8] + movs r0, 0xC + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + strh r4, [r0, 0xA] + movs r0, 0xC + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + strh r7, [r0, 0xC] + ldr r0, =sub_817624C + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xA] + movs r0, 0xA + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + strh r4, [r0, 0x8] + movs r0, 0xA + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + strh r7, [r0, 0xA] + movs r0, 0xA + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + ldrh r1, [r5, 0x12] + strh r1, [r0, 0xC] + movs r0, 0xA + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + ldrh r1, [r5, 0x14] + strh r1, [r0, 0xE] + movs r0, 0xA + ldrsh r1, [r5, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r6 + strh r4, [r0, 0x10] + mov r1, r8 + cmp r1, 0x2 + bne _08176A94 + movs r1, 0xA + ldrsh r0, [r5, r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r6 + movs r0, 0x45 + strh r0, [r1, 0x12] +_08176A94: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817664C + + thumb_func_start sub_8176AB0 +sub_8176AB0: @ 8176AB0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r6, r0, r1 + ldrb r0, [r6] + cmp r0, 0x1 + beq _08176B30 + cmp r0, 0x1 + ble _08176AD6 + cmp r0, 0x2 + beq _08176B54 + cmp r0, 0x3 + bne _08176AD6 + b _08176C80 +_08176AD6: + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1C + movs r1, 0x8 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0 + bl SetGpuReg + movs r0, 0x18 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + movs r0, 0x16 + movs r1, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + movs r0, 0x1 + strb r0, [r6] + b _08176C96 + .pool +_08176B30: + ldr r1, =0x0203bd24 + movs r0, 0x22 + strh r0, [r1] + ldr r1, =0x0203bd26 + movs r0, 0 + strh r0, [r1] + adds r0, r4, 0 + bl sub_817B1C8 + ldrb r0, [r6] + adds r0, 0x1 + strb r0, [r6] + b _08176C96 + .pool +_08176B54: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _08176BD8 + ldr r0, =gUnknown_085F5334 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085F53BC + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085F5354 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085F5384 + bl LoadTaggedObjectPalettes + movs r0, 0x78 + movs r1, 0x2E + bl sub_817B834 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x03005e00 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + strh r2, [r4, 0x12] + ldr r6, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r5, r6, 0 + adds r5, 0x1C + adds r2, r0, r5 + ldr r1, =sub_8176EE8 + str r1, [r2] + adds r6, 0x8 + adds r0, r6 + ldr r1, =gUnknown_085E6FD0 + str r1, [r0] + movs r0, 0x88 + lsls r0, 1 + movs r1, 0x2E + bl sub_817B88C + b _08176C2C + .pool +_08176BD8: + ldr r0, =gUnknown_085F5344 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085F53AC + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085F5354 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085F5384 + bl LoadTaggedObjectPalettes + movs r0, 0x78 + movs r1, 0x2E + bl sub_817B88C + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x03005e00 + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + strh r2, [r4, 0x12] + ldr r6, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r5, r6, 0 + adds r5, 0x1C + adds r2, r0, r5 + ldr r1, =sub_8176EE8 + str r1, [r2] + adds r6, 0x8 + adds r0, r6 + ldr r1, =gUnknown_085E6FD0 + str r1, [r0] + movs r0, 0x88 + lsls r0, 1 + movs r1, 0x2E + bl sub_817B834 +_08176C2C: + lsls r0, 24 + lsrs r2, r0, 24 + strh r2, [r4, 0x14] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r5, r0, r5 + ldr r1, =sub_8176F90 + str r1, [r5] + adds r0, r6 + ldr r1, =gUnknown_085E7010 + str r1, [r0] + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08176C96 + .pool +_08176C80: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_817664C + adds r0, r4, 0 + bl sub_817B3A8 + movs r0, 0 + strb r0, [r6] + movs r0, 0x1 + b _08176C98 +_08176C96: + movs r0, 0 +_08176C98: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8176AB0 + + thumb_func_start sub_8176CA0 +sub_8176CA0: @ 8176CA0 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r1, [r4, 0x8] + movs r2, 0x8 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08176CC6 + lsls r0, r1, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0 + strh r0, [r4, 0x8] +_08176CC6: + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08176CDC + lsls r0, r1, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0 + strh r0, [r4, 0xA] +_08176CDC: + ldrh r1, [r4, 0xC] + movs r2, 0xC + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08176CF2 + lsls r0, r1, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0 + strh r0, [r4, 0xC] +_08176CF2: + ldrh r1, [r4, 0xE] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08176D08 + lsls r0, r1, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0 + strh r0, [r4, 0xE] +_08176D08: + ldr r1, =0x0203bd28 + movs r0, 0x1 + strh r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8176CA0 + + thumb_func_start sub_8176D1C +sub_8176D1C: @ 8176D1C + push {r4-r7,lr} + adds r3, r0, 0 + adds r4, r2, 0 + lsls r3, 16 + lsrs r3, 16 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r4, 16 + lsrs r5, r4, 16 + ldr r0, =gUnknown_085E5770 + movs r6, 0xC0 + lsls r6, 19 + adds r3, r6 + adds r1, r3, 0 + bl LZ77UnCompVram + ldr r0, =gIntroCopyright_Pal + adds r1, r5, 0 + movs r2, 0x20 + bl gpu_pal_apply + lsrs r4, 20 + lsls r4, 28 + lsrs r4, 16 + movs r1, 0 + adds r4, 0x1 + ldr r2, =0x000003ff +_08176D52: + lsls r0, r1, 1 + adds r0, r7 + adds r0, r6 + strh r4, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r2 + bls _08176D52 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8176D1C + + thumb_func_start sub_8176D78 +sub_8176D78: @ 8176D78 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + adds r3, r2, 0 + movs r0, 0x3F + ands r0, r2 + adds r1, r0, 0 + adds r1, 0x50 + cmp r2, 0xFF + bne _08176D90 + movs r0, 0x1 + b _08176DB6 +_08176D90: + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _08176DA0 + movs r2, 0x80 + lsls r2, 4 + adds r0, r2, 0 + orrs r1, r0 +_08176DA0: + movs r0, 0x40 + ands r3, r0 + cmp r3, 0 + beq _08176DB4 + movs r2, 0x80 + lsls r2, 3 + adds r0, r2, 0 + orrs r1, r0 + lsls r0, r1, 16 + lsrs r1, r0, 16 +_08176DB4: + adds r0, r1, 0 +_08176DB6: + pop {r1} + bx r1 + thumb_func_end sub_8176D78 + + thumb_func_start sub_8176DBC +sub_8176DBC: @ 8176DBC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + str r0, [sp] + ldr r0, [sp, 0x2C] + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x4] + lsls r3, 16 + lsrs r3, 16 + str r3, [sp, 0x8] + lsls r0, 16 + lsrs r0, 20 + lsls r0, 28 + lsrs r0, 16 + mov r9, r0 + movs r5, 0 +_08176DEA: + movs r4, 0 + lsls r7, r5, 1 + ldr r1, [sp, 0x4] + adds r0, r1, r5 + adds r2, r5, 0x1 + mov r8, r2 + lsls r0, 6 + ldr r1, [sp, 0x8] + adds r6, r0, r1 +_08176DFC: + adds r0, r7, r5 + adds r0, r4 + ldr r2, [sp] + adds r0, r2, r0 + ldrb r0, [r0] + bl sub_8176D78 + mov r2, r10 + adds r1, r2, r4 + lsls r1, 1 + adds r1, r6 + movs r2, 0xC0 + lsls r2, 19 + adds r1, r2 + add r0, r9 + strh r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _08176DFC + mov r1, r8 + lsls r0, r1, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _08176DEA + 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_8176DBC + + thumb_func_start sub_8176E40 +sub_8176E40: @ 8176E40 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + lsrs r1, 20 + lsls r1, 28 + lsrs r1, 16 + movs r2, 0 + ldr r7, =gUnknown_085E5BAC + movs r4, 0xC0 + lsls r4, 19 + adds r1, 0x1 + ldr r3, =0x000003ff +_08176E5E: + lsls r0, r2, 1 + adds r0, r5 + adds r0, r4 + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, r3 + bls _08176E5E + str r6, [sp] + adds r0, r7, 0 + movs r1, 0x3 + movs r2, 0x7 + adds r3, r5, 0 + bl sub_8176DBC + ldr r0, =gUnknown_085E5BBB + str r6, [sp] + movs r1, 0x7 + movs r2, 0x7 + adds r3, r5, 0 + bl sub_8176DBC + ldr r4, =gUnknown_085E5BCA + str r6, [sp] + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0x7 + adds r3, r5, 0 + bl sub_8176DBC + str r6, [sp] + adds r0, r4, 0 + movs r1, 0x10 + movs r2, 0x7 + adds r3, r5, 0 + bl sub_8176DBC + ldr r0, =gUnknown_085E5BD9 + str r6, [sp] + movs r1, 0x14 + movs r2, 0x7 + adds r3, r5, 0 + bl sub_8176DBC + ldr r0, =gUnknown_085E5BE8 + str r6, [sp] + movs r1, 0x18 + movs r2, 0x7 + adds r3, r5, 0 + bl sub_8176DBC + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8176E40 + + thumb_func_start sub_8176EE8 +sub_8176EE8: @ 8176EE8 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0203bd28 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08176F04 + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + b _08176F88 + .pool +_08176F04: + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0x5 + bhi _08176F88 + lsls r0, 2 + ldr r1, =_08176F1C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08176F1C: + .4byte _08176F34 + .4byte _08176F3E + .4byte _08176F44 + .4byte _08176F4E + .4byte _08176F58 + .4byte _08176F6E +_08176F34: + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnimIfDifferent + b _08176F88 +_08176F3E: + adds r0, r4, 0 + movs r1, 0x1 + b _08176F72 +_08176F44: + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectImageAnimIfDifferent + b _08176F88 +_08176F4E: + adds r0, r4, 0 + movs r1, 0x3 + bl StartObjectImageAnimIfDifferent + b _08176F88 +_08176F58: + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnimIfDifferent + ldrh r1, [r4, 0x20] + movs r2, 0x20 + ldrsh r0, [r4, r2] + cmp r0, 0x78 + ble _08176F88 + subs r0, r1, 0x1 + b _08176F86 +_08176F6E: + adds r0, r4, 0 + movs r1, 0 +_08176F72: + bl StartObjectImageAnimIfDifferent + ldrh r2, [r4, 0x20] + movs r0, 0x20 + ldrsh r1, [r4, r0] + movs r0, 0x20 + negs r0, r0 + cmp r1, r0 + ble _08176F88 + subs r0, r2, 0x1 +_08176F86: + strh r0, [r4, 0x20] +_08176F88: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8176EE8 + + thumb_func_start sub_8176F90 +sub_8176F90: @ 8176F90 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0203bd28 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08176FAC + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + b _08177048 + .pool +_08176FAC: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08176FD4 + cmp r0, 0x1 + bgt _08176FBE + cmp r0, 0 + beq _08176FC8 + b _08177048 +_08176FBE: + cmp r0, 0x2 + beq _08177010 + cmp r0, 0x3 + beq _0817702E + b _08177048 +_08176FC8: + strh r0, [r4, 0x26] + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnimIfDifferent + b _08177048 +_08176FD4: + movs r1, 0x20 + ldrsh r0, [r4, r1] + cmp r0, 0xC8 + ble _08176FE6 + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnimIfDifferent + b _08176FEE +_08176FE6: + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectImageAnimIfDifferent +_08176FEE: + ldrh r2, [r4, 0x20] + movs r0, 0x20 + ldrsh r1, [r4, r0] + movs r0, 0x20 + negs r0, r0 + cmp r1, r0 + ble _08177000 + subs r0, r2, 0x2 + strh r0, [r4, 0x20] +_08177000: + ldr r0, =0x0203bd26 + ldrh r0, [r0] + negs r0, r0 + strh r0, [r4, 0x26] + b _08177048 + .pool +_08177010: + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnimIfDifferent + ldrh r1, [r4, 0x3C] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08177048 + ldrh r0, [r4, 0x20] + adds r0, 0x1 + b _08177046 +_0817702E: + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnimIfDifferent + ldrh r2, [r4, 0x20] + movs r0, 0x20 + ldrsh r1, [r4, r0] + movs r0, 0x20 + negs r0, r0 + cmp r1, r0 + ble _08177048 + subs r0, r2, 0x1 +_08177046: + strh r0, [r4, 0x20] +_08177048: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8176F90 + + thumb_func_start sub_8177050 +sub_8177050: @ 8177050 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, =0x0203bd28 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _0817706C + ldrh r0, [r5, 0x3A] + bl sub_818D820 + b _0817721C + .pool +_0817706C: + ldrh r0, [r5, 0x3C] + adds r0, 0x1 + strh r0, [r5, 0x3C] + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0xA + bhi _081770B4 + lsls r0, 2 + ldr r1, =_08177088 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08177088: + .4byte _081770B4 + .4byte _0817710E + .4byte _08177190 + .4byte _081771C6 + .4byte _081770B4 + .4byte _081770B4 + .4byte _081770B4 + .4byte _081770B4 + .4byte _081770B4 + .4byte _081771FE + .4byte _08177206 +_081770B4: + ldrb r1, [r5, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r5, 0x1] + movs r0, 0x30 + ldrsh r1, [r5, r0] + movs r0, 0x1F + ands r1, r0 + lsls r1, 1 + ldrb r2, [r5, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5, 0x3] + movs r0, 0x10 + strh r0, [r5, 0x32] + ldrh r4, [r5, 0x30] + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x80 + lsls r0, 9 + movs r1, 0x10 + bl __divsi3 + adds r1, r0, 0 + str r1, [sp] + adds r0, r4, 0 + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + adds r2, r5, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + movs r0, 0x1 + strh r0, [r5, 0x2E] + b _0817721C +_0817710E: + ldrh r1, [r5, 0x32] + movs r2, 0x32 + ldrsh r0, [r5, r2] + cmp r0, 0xFF + bgt _08177144 + adds r0, r1, 0 + adds r0, 0x8 + strh r0, [r5, 0x32] + ldrh r4, [r5, 0x30] + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x32 + ldrsh r1, [r5, r0] + movs r0, 0x80 + lsls r0, 9 + bl __divsi3 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + adds r0, r4, 0 + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + b _0817714A +_08177144: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] +_0817714A: + movs r2, 0x30 + ldrsh r1, [r5, r2] + cmp r1, 0x2 + beq _0817721C + cmp r1, 0x2 + bgt _0817715C + cmp r1, 0x1 + beq _08177162 + b _0817721C +_0817715C: + cmp r1, 0x3 + beq _0817717A + b _0817721C +_08177162: + ldrh r1, [r5, 0x3C] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08177172 + ldrh r0, [r5, 0x22] + adds r0, 0x1 + strh r0, [r5, 0x22] +_08177172: + ldrh r0, [r5, 0x20] + subs r0, 0x2 + strh r0, [r5, 0x20] + b _0817721C +_0817717A: + ldrh r0, [r5, 0x3C] + ands r1, r0 + cmp r1, 0 + bne _08177188 + ldrh r0, [r5, 0x22] + adds r0, 0x1 + strh r0, [r5, 0x22] +_08177188: + ldrh r0, [r5, 0x20] + adds r0, 0x2 + strh r0, [r5, 0x20] + b _0817721C +_08177190: + ldrh r1, [r5, 0x34] + movs r2, 0x34 + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _081771A0 + subs r0, r1, 0x1 + strh r0, [r5, 0x34] + b _0817721C +_081771A0: + movs r1, 0xF4 + lsls r1, 4 + movs r0, 0x50 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0x10 + bl SetGpuReg + ldrb r1, [r5, 0x1] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r5, 0x1] + movs r0, 0x10 + strh r0, [r5, 0x34] + b _081771FE +_081771C6: + ldrh r1, [r5, 0x34] + movs r2, 0x34 + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _081771EC + subs r1, 0x1 + strh r1, [r5, 0x34] + movs r0, 0x34 + ldrsh r2, [r5, r0] + movs r0, 0x10 + subs r0, r2 + lsls r0, 8 + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + b _0817721C +_081771EC: + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x9 + strh r0, [r5, 0x2E] + b _0817721C +_081771FE: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + b _0817721C +_08177206: + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + ldrh r0, [r5, 0x3A] + bl sub_818D820 +_0817721C: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8177050 + + thumb_func_start sub_8177224 +sub_8177224: @ 8177224 + push {r4-r7,lr} + adds r5, r3, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r5, 16 + lsrs r5, 16 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + adds r3, r5, 0 + bl sub_80C0E9C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r6, =0x02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r2, r1, r6 + ldrb r3, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r3 + movs r3, 0x4 + orrs r0, r3 + strb r0, [r2, 0x5] + adds r0, r5, 0x1 + strh r0, [r2, 0x30] + movs r0, 0x3E + adds r0, r2 + mov r12, r0 + ldrb r0, [r0] + orrs r0, r3 + mov r3, r12 + strb r0, [r3] + adds r0, r6, 0 + adds r0, 0x1C + adds r1, r0 + ldr r0, =sub_8177050 + str r0, [r1] + strh r4, [r2, 0x3A] + ldr r0, =gUnknown_085E7068 + movs r7, 0x20 + ldrsh r1, [r2, r7] + movs r3, 0x22 + ldrsh r2, [r2, r3] + movs r3, 0x1 + bl AddObjectToFront + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + strh r4, [r0, 0x2E] + lsls r5, 24 + lsrs r5, 24 + adds r1, r5, 0 + bl StartObjectImageAnimIfDifferent + adds r0, r4, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8177224 + + thumb_func_start sub_81772B8 +sub_81772B8: @ 81772B8 + push {r4,lr} + adds r3, r0, 0 + ldr r4, =0x02020630 + movs r1, 0x2E + ldrsh r0, [r3, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0xA + beq _081772DC + ldr r0, =0x0203bd28 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + beq _081772EC +_081772DC: + adds r0, r3, 0 + bl RemoveObjectAndFreeTiles + b _08177380 + .pool +_081772EC: + adds r0, r1, 0 + adds r0, 0x3E + ldrb r0, [r0] + movs r1, 0x3E + adds r1, r3 + mov r12, r1 + movs r1, 0x4 + ands r1, r0 + mov r0, r12 + ldrb r2, [r0] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + mov r1, r12 + strb r0, [r1] + movs r2, 0x2E + ldrsh r1, [r3, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x1] + movs r0, 0xC + ands r0, r1 + ldrb r2, [r3, 0x1] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x1] + movs r0, 0x2E + ldrsh r2, [r3, r0] + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x1] + lsls r0, 30 + lsrs r0, 30 + movs r2, 0x4 + negs r2, r2 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x1] + movs r2, 0x2E + ldrsh r1, [r3, r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x3] + movs r1, 0x3E + ands r1, r0 + ldrb r2, [r3, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x3] + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x20] + strh r0, [r3, 0x20] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x22] + strh r0, [r3, 0x22] +_08177380: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81772B8 + + thumb_func_start sub_8177388 +sub_8177388: @ 8177388 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x00004023 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + bl sub_8133EDC + lsls r0, 16 + lsrs r0, 16 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + movs r4, 0x1 + movs r6, 0 + ldr r5, =0x00000181 +_081773B4: + adds r0, r4, 0 + movs r1, 0x1 + bl pokedex_flag_operation + lsls r0, 24 + cmp r0, 0 + beq _081773D4 + ldr r0, =0x0203bce8 + ldr r0, [r0] + lsls r1, r6, 1 + adds r0, 0x96 + adds r0, r1 + strh r4, [r0] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_081773D4: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r5 + bls _081773B4 + adds r4, r6, 0 + ldr r0, =0x00000181 + ldr r1, =0x0203bce8 + mov r8, r1 + lsls r7, r4, 16 + cmp r4, r0 + bhi _08177406 + mov r5, r8 + movs r3, 0 + adds r2, r0, 0 +_081773F2: + ldr r0, [r5] + lsls r1, r4, 1 + adds r0, 0x96 + adds r0, r1 + strh r3, [r0] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r2 + bls _081773F2 +_08177406: + mov r2, r8 + ldr r1, [r2] + ldr r2, =0x0000039a + adds r0, r1, r2 + strh r6, [r0] + lsrs r0, r7, 16 + cmp r0, 0x46 + bhi _08177430 + adds r0, r1, 0 + adds r0, 0x94 + strh r6, [r0] + b _08177436 + .pool +_08177430: + adds r1, 0x94 + movs r0, 0x47 + strh r0, [r1] +_08177436: + movs r6, 0 + ldr r0, =0x0203bce8 + mov r9, r0 + ldr r1, =0x0000039a + mov r8, r1 + movs r7, 0 + b _08177450 + .pool +_0817744C: + cmp r6, 0x46 + bhi _081774AC +_08177450: + bl GenerateRandomNumber + mov r2, r9 + ldr r4, [r2] + mov r1, r8 + adds r5, r4, r1 + lsls r0, 16 + lsrs r0, 16 + ldrh r1, [r5] + bl __umodsi3 + lsls r0, 16 + lsrs r3, r0, 16 + lsls r1, r6, 1 + adds r1, r4, r1 + lsls r0, r3, 1 + adds r4, 0x96 + adds r2, r4, r0 + ldrh r0, [r2] + strh r0, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + strh r7, [r2] + ldrh r0, [r5] + subs r0, 0x1 + strh r0, [r5] + lsls r0, 16 + lsrs r0, 16 + cmp r3, r0 + beq _081774A0 + ldrh r0, [r5] + lsls r0, 1 + adds r0, r4, r0 + ldrh r0, [r0] + strh r0, [r2] + ldrh r0, [r5] + lsls r0, 1 + adds r0, r4, r0 + strh r7, [r0] +_081774A0: + mov r2, r9 + ldr r0, [r2] + add r0, r8 + ldrh r0, [r0] + cmp r0, 0 + bne _0817744C +_081774AC: + ldr r1, =0x0203bce8 + ldr r2, [r1] + adds r3, r2, 0 + adds r3, 0x94 + ldrh r0, [r3] + mov r8, r1 + cmp r0, 0x46 + bhi _081774F8 + adds r6, r0, 0 + movs r3, 0 + cmp r6, 0x46 + bhi _081774EE + mov r4, r8 +_081774C6: + ldr r2, [r4] + lsls r1, r6, 1 + adds r1, r2, r1 + lsls r0, r3, 1 + adds r0, r2, r0 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + adds r2, 0x94 + ldrh r2, [r2] + cmp r3, r2 + bne _081774E4 + movs r3, 0 +_081774E4: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x46 + bls _081774C6 +_081774EE: + mov r1, r8 + ldr r0, [r1] + b _08177538 + .pool +_081774F8: + movs r4, 0 + ldrh r0, [r2] + cmp r0, r10 + beq _08177516 + adds r1, r2, 0 +_08177502: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + lsls r0, r4, 1 + adds r0, r1, r0 + ldrh r0, [r0] + cmp r0, r10 + beq _08177516 + cmp r4, 0x46 + bls _08177502 +_08177516: + mov r0, r8 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x94 + ldrh r0, [r0] + subs r0, 0x1 + cmp r4, r0 + bge _08177536 + lsls r0, r4, 1 + adds r0, r2, r0 + adds r2, 0x8C + ldrh r1, [r2] + strh r1, [r0] + mov r1, r10 + strh r1, [r2] + b _0817753E +_08177536: + adds r0, r2, 0 +_08177538: + adds r0, 0x8C + mov r2, r10 + strh r2, [r0] +_0817753E: + mov r1, r8 + ldr r0, [r1] + adds r0, 0x94 + movs r1, 0x47 + strh r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8177388 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_81795E8.s b/asm/rom_81795E8.s new file mode 100644 index 000000000..d3d114770 --- /dev/null +++ b/asm/rom_81795E8.s @@ -0,0 +1,2492 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_81795E8 +sub_81795E8: @ 81795E8 + push {lr} + ldr r0, =0x000008af + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08179634 + ldr r0, =0x03005d8c + ldr r2, [r0] + ldrh r1, [r2, 0x4] + ldr r0, =0x00004718 + cmp r1, r0 + bne _08179634 + ldr r1, [r2] + ldr r0, =0x0003000a + cmp r1, r0 + beq _08179616 + ldr r0, =0x00030009 + cmp r1, r0 + beq _08179616 + ldr r0, =0x0003000b + cmp r1, r0 + bne _08179634 +_08179616: + movs r0, 0x1 + b _08179636 + .pool +_08179634: + movs r0, 0 +_08179636: + pop {r1} + bx r1 + thumb_func_end sub_81795E8 + + thumb_func_start sub_817963C +sub_817963C: @ 817963C + push {lr} + ldr r2, =0x0000022a + movs r0, 0x10 + movs r1, 0x8 + bl MapGridSetMetatileIdAt + ldr r2, =0x0000022b + movs r0, 0x11 + movs r1, 0x8 + bl MapGridSetMetatileIdAt + movs r2, 0x8B + lsls r2, 2 + movs r0, 0x12 + movs r1, 0x8 + bl MapGridSetMetatileIdAt + ldr r2, =0x00000e32 + movs r0, 0x10 + movs r1, 0x9 + bl MapGridSetMetatileIdAt + ldr r2, =0x00000233 + movs r0, 0x11 + movs r1, 0x9 + bl MapGridSetMetatileIdAt + ldr r2, =0x00000e34 + movs r0, 0x12 + movs r1, 0x9 + bl MapGridSetMetatileIdAt + bl DrawWholeMapView + movs r0, 0x14 + bl audio_play + ldr r0, =0x000008af + bl FlagSet + bl script_env_2_disable + pop {r0} + bx r0 + .pool + thumb_func_end sub_817963C + + thumb_func_start sub_81796AC +sub_81796AC: @ 81796AC + push {r4,lr} + ldr r4, =0x020244ec + adds r0, r4, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + movs r1, 0x9D + lsls r1, 1 + cmp r0, r1 + bne _081796F4 + bl calc_player_party_count + ldr r0, =0x020244e9 + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + adds r1, r4, 0 + subs r1, 0x64 + adds r0, r1 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + ldr r1, =0x0000017d + cmp r0, r1 + bne _081796F4 + movs r0, 0x1 + b _081796F6 + .pool +_081796F4: + movs r0, 0 +_081796F6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81796AC + + thumb_func_start nullsub_84 +nullsub_84: @ 81796FC + bx lr + thumb_func_end nullsub_84 + + thumb_func_start sub_8179700 +sub_8179700: @ 8179700 + push {lr} + ldr r0, =sub_8179778 + movs r1, 0x9 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0xA] + strh r0, [r1, 0xC] + movs r0, 0x2 + strh r0, [r1, 0x10] + movs r0, 0x5 + strh r0, [r1, 0x12] + movs r0, 0x32 + strh r0, [r1, 0x14] + movs r0, 0 + bl SetCameraPanningCallback + pop {r0} + bx r0 + .pool + thumb_func_end sub_8179700 + + thumb_func_start sub_817973C +sub_817973C: @ 817973C + push {lr} + ldr r0, =sub_8179778 + movs r1, 0x9 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0xA] + strh r0, [r1, 0xC] + movs r0, 0x3 + strh r0, [r1, 0x10] + movs r0, 0x5 + strh r0, [r1, 0x12] + movs r0, 0x2 + strh r0, [r1, 0x14] + movs r0, 0 + bl SetCameraPanningCallback + pop {r0} + bx r0 + .pool + thumb_func_end sub_817973C + + thumb_func_start sub_8179778 +sub_8179778: @ 8179778 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + movs r1, 0xA + ldrsh r0, [r4, r1] + movs r2, 0x12 + ldrsh r1, [r4, r2] + bl __modsi3 + cmp r0, 0 + bne _081797D0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x10] + negs r0, r0 + strh r0, [r4, 0x10] + movs r0, 0x10 + ldrsh r1, [r4, r0] + movs r0, 0 + bl SetCameraPanning + movs r2, 0xC + ldrsh r1, [r4, r2] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _081797D0 + adds r0, r5, 0 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running + bl InstallCameraPanAheadCallback +_081797D0: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8179778 + + thumb_func_start sub_81797DC +sub_81797DC: @ 81797DC + push {lr} + movs r0, 0x8B + lsls r0, 4 + bl FlagGet + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _0817982C + ldr r0, =0x03005d8c + ldr r3, [r0] + ldrh r1, [r3, 0x4] + movs r0, 0xC3 + lsls r0, 3 + cmp r1, r0 + bne _0817982C + ldr r1, [r3] + ldr r0, =0x00170006 + cmp r1, r0 + beq _08179810 + ldr r0, =0x00170005 + cmp r1, r0 + beq _08179810 + ldr r0, =0x00170007 + cmp r1, r0 + bne _0817982C +_08179810: + ldr r0, =0x0203bd14 + strb r2, [r0] + movs r0, 0x1 + b _0817982E + .pool +_0817982C: + movs r0, 0 +_0817982E: + pop {r1} + bx r1 + thumb_func_end sub_81797DC + + thumb_func_start sub_8179834 +sub_8179834: @ 8179834 + push {lr} + bl brm_get_pokemon_selection + ldr r1, =0x02038c08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + movs r0, 0x3C + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end sub_8179834 + + thumb_func_start sub_8179850 +sub_8179850: @ 8179850 + push {lr} + movs r0, 0x3C + bl FieldEffectActiveListRemove + bl sub_8179860 + pop {r0} + bx r0 + thumb_func_end sub_8179850 + + thumb_func_start sub_8179860 +sub_8179860: @ 8179860 + push {lr} + ldr r2, =0x0000022a + movs r0, 0xE + movs r1, 0x1A + bl MapGridSetMetatileIdAt + ldr r2, =0x0000022b + movs r0, 0xF + movs r1, 0x1A + bl MapGridSetMetatileIdAt + movs r2, 0x8B + lsls r2, 2 + movs r0, 0x10 + movs r1, 0x1A + bl MapGridSetMetatileIdAt + ldr r2, =0x00000e32 + movs r0, 0xE + movs r1, 0x1B + bl MapGridSetMetatileIdAt + ldr r2, =0x00000233 + movs r0, 0xF + movs r1, 0x1B + bl MapGridSetMetatileIdAt + ldr r2, =0x00000e34 + movs r0, 0x10 + movs r1, 0x1B + bl MapGridSetMetatileIdAt + bl DrawWholeMapView + movs r0, 0x14 + bl audio_play + movs r0, 0x8B + lsls r0, 4 + bl FlagSet + bl script_env_2_disable + pop {r0} + bx r0 + .pool + thumb_func_end sub_8179860 + + thumb_func_start sub_81798D0 +sub_81798D0: @ 81798D0 + push {lr} + ldr r0, =0x000008b2 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08179910 + ldr r0, =0x03005d8c + ldr r2, [r0] + ldrh r1, [r2, 0x4] + ldr r0, =0x00004418 + cmp r1, r0 + bne _08179910 + ldr r1, [r2] + ldr r0, =0x00190008 + cmp r1, r0 + bne _08179910 + ldr r1, =0x0203bd14 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x1 + b _08179912 + .pool +_08179910: + movs r0, 0 +_08179912: + pop {r1} + bx r1 + thumb_func_end sub_81798D0 + + thumb_func_start sub_8179918 +sub_8179918: @ 8179918 + push {lr} + bl brm_get_pokemon_selection + ldr r1, =0x02038c08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + movs r0, 0x3C + bl FieldEffectStart + pop {r0} + bx r0 + .pool + thumb_func_end sub_8179918 + + thumb_func_start sub_8179934 +sub_8179934: @ 8179934 + push {lr} + movs r0, 0x3C + bl FieldEffectActiveListRemove + bl sub_8179944 + pop {r0} + bx r0 + thumb_func_end sub_8179934 + + thumb_func_start sub_8179944 +sub_8179944: @ 8179944 + push {lr} + ldr r2, =0x0000022a + movs r0, 0xE + movs r1, 0x1A + bl MapGridSetMetatileIdAt + ldr r2, =0x0000022b + movs r0, 0xF + movs r1, 0x1A + bl MapGridSetMetatileIdAt + movs r2, 0x8B + lsls r2, 2 + movs r0, 0x10 + movs r1, 0x1A + bl MapGridSetMetatileIdAt + ldr r2, =0x00000e32 + movs r0, 0xE + movs r1, 0x1B + bl MapGridSetMetatileIdAt + ldr r2, =0x00000233 + movs r0, 0xF + movs r1, 0x1B + bl MapGridSetMetatileIdAt + ldr r2, =0x00000e34 + movs r0, 0x10 + movs r1, 0x1B + bl MapGridSetMetatileIdAt + bl DrawWholeMapView + movs r0, 0x14 + bl audio_play + ldr r0, =0x000008b2 + bl FlagSet + bl script_env_2_disable + pop {r0} + bx r0 + .pool + thumb_func_end sub_8179944 + + thumb_func_start nullsub_64 +nullsub_64: @ 81799B4 + bx lr + thumb_func_end nullsub_64 + + thumb_func_start sub_81799B8 +sub_81799B8: @ 81799B8 + push {lr} + bl oei_task_add + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x0203bd14 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081799E4 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + ldr r2, =sub_8179934 + b _081799F0 + .pool +_081799E4: + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + ldr r2, =sub_8179850 +_081799F0: + lsrs r1, r2, 16 + strh r1, [r0, 0x18] + strh r2, [r0, 0x1A] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81799B8 + + thumb_func_start sub_8179A04 +sub_8179A04: @ 8179A04 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r4, =0x03005d8c + ldr r0, [r4] + ldrh r1, [r0, 0x4] + ldr r0, =0x00004318 + cmp r1, r0 + beq _08179A1A + b _08179B5A +_08179A1A: + ldr r0, =0x000008b1 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _08179A28 + b _08179B5A +_08179A28: + movs r0, 0x2 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _08179A36 + b _08179B5A +_08179A36: + movs r0, 0x3 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08179A58 + b _08179B5A + .pool +_08179A54: + movs r0, 0x1 + b _08179B5C +_08179A58: + movs r5, 0 + mov r8, r4 + ldr r4, =gUnknown_085EFE74 + adds r0, r4, 0x1 + mov r12, r0 + ldr r6, =0x0000403b + ldr r1, =0x0000403c + mov r9, r1 +_08179A68: + lsls r0, r5, 1 + adds r1, r0, r4 + add r0, r12 + ldrb r3, [r0] + mov r7, r8 + ldr r2, [r7] + movs r7, 0 + ldrsh r0, [r2, r7] + ldrb r1, [r1] + cmp r0, r1 + bne _08179B44 + movs r1, 0x2 + ldrsh r0, [r2, r1] + cmp r0, r3 + bne _08179B44 + cmp r5, 0xF + bhi _08179AB0 + adds r0, r6, 0 + bl VarGet + lsls r0, 16 + movs r1, 0x80 + lsls r1, 9 + lsls r1, r5 + orrs r1, r0 + lsrs r1, 16 + adds r0, r6, 0 + bl VarSet + b _08179AF0 + .pool +_08179AB0: + cmp r5, 0x1F + bhi _08179AD2 + mov r0, r9 + bl VarGet + lsls r0, 16 + adds r2, r5, 0 + subs r2, 0x10 + movs r1, 0x80 + lsls r1, 9 + lsls r1, r2 + orrs r1, r0 + lsrs r1, 16 + mov r0, r9 + bl VarSet + b _08179AF0 +_08179AD2: + ldr r4, =0x0000403d + adds r0, r4, 0 + bl VarGet + lsls r0, 16 + adds r2, r5, 0 + subs r2, 0x20 + movs r1, 0x80 + lsls r1, 9 + lsls r1, r2 + orrs r1, r0 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet +_08179AF0: + ldr r0, =0x0000403b + bl VarGet + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x0000ffff + cmp r4, r0 + bne _08179B5A + ldr r0, =0x0000403c + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, r4 + bne _08179B5A + ldr r0, =0x0000403d + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xF + bne _08179B5A + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, [r0] + ldr r0, =0x00150008 + cmp r1, r0 + beq _08179A54 + b _08179B5A + .pool +_08179B44: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x23 + bls _08179A68 + movs r0, 0x3 + bl FlagSet + movs r0, 0x2 + bl FlagReset +_08179B5A: + movs r0, 0 +_08179B5C: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8179A04 + + thumb_func_start sub_8179B68 +sub_8179B68: @ 8179B68 + push {lr} + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl do_scheduled_bg_tilemap_copies_to_vram + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_8179B68 + + thumb_func_start sub_8179B84 +sub_8179B84: @ 8179B84 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8179B84 + + thumb_func_start sub_8179B98 +sub_8179B98: @ 8179B98 + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xD + bls _08179BAC + b _08179D4C +_08179BAC: + lsls r0, 2 + ldr r1, =_08179BC0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08179BC0: + .4byte _08179BF8 + .4byte _08179C20 + .4byte _08179C34 + .4byte _08179C48 + .4byte _08179C4E + .4byte _08179C60 + .4byte _08179C66 + .4byte _08179C78 + .4byte _08179C98 + .4byte _08179CB0 + .4byte _08179CDC + .4byte _08179CF8 + .4byte _08179CFE + .4byte _08179D18 +_08179BF8: + ldr r4, =0x0203bd18 + ldr r0, =0x00001084 + bl AllocZeroed + str r0, [r4] + bl SetVBlankHBlankCallbacksToNull + bl clear_scheduled_bg_copies_to_vram + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _08179D3A + .pool +_08179C20: + bl sub_80A1A74 + ldr r2, =0x02037fd4 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + b _08179D30 + .pool +_08179C34: + bl ResetAllObjectData + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _08179D3A + .pool +_08179C48: + bl ResetObjectPaletteAllocator + b _08179D32 +_08179C4E: + bl init_uns_table_pokemon_copy + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _08179D3A + .pool +_08179C60: + bl sub_8179D9C + b _08179D32 +_08179C66: + bl sub_8179FAC + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _08179D3A + .pool +_08179C78: + ldr r0, =0x0203bc9c + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + bl sub_8179DF4 + lsls r0, 24 + cmp r0, 0 + beq _08179D64 + b _08179D32 + .pool +_08179C98: + bl sub_817A4A4 + ldr r1, =0x0203bd18 + ldr r1, [r1] + ldr r2, =0x0000105e + adds r1, r2 + strb r0, [r1] + b _08179D32 + .pool +_08179CB0: + ldr r0, =0x0203bc9c + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + bl sub_817A358 + ldr r1, =0x0203bd18 + ldr r1, [r1] + ldr r2, =0x0000105d + adds r1, r2 + strb r0, [r1] + b _08179D32 + .pool +_08179CDC: + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + movs r3, 0xE + bl SetWindowBorderStyle + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _08179D3A + .pool +_08179CF8: + bl sub_817A168 + b _08179D32 +_08179CFE: + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _08179D3A + .pool +_08179D18: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 +_08179D30: + strb r0, [r2, 0x8] +_08179D32: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_08179D3A: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08179D64 + .pool +_08179D4C: + ldr r0, =sub_8179B84 + bl SetVBlankCallback + ldr r0, =sub_8179B68 + bl SetMainCallback2 + movs r0, 0x1 + b _08179D66 + .pool +_08179D64: + movs r0, 0 +_08179D66: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8179B98 + + thumb_func_start sub_8179D70 +sub_8179D70: @ 8179D70 + push {lr} +_08179D72: + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08179D96 + bl sub_8179B98 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08179D96 + bl sub_81221AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08179D72 +_08179D96: + pop {r0} + bx r0 + thumb_func_end sub_8179D70 + + thumb_func_start sub_8179D9C +sub_8179D9C: @ 8179D9C + push {lr} + bl sub_8121DA0 + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085F0550 + movs r0, 0 + movs r2, 0x2 + bl InitBgsFromTemplates + ldr r0, =0x0203bd18 + ldr r1, [r0] + adds r1, 0x48 + 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, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end sub_8179D9C + + thumb_func_start sub_8179DF4 +sub_8179DF4: @ 8179DF4 + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + ldr r0, =0x0203bd18 + ldr r0, [r0] + ldr r1, =0x0000107e + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x8 + bls _08179E0C + b _08179FA0 +_08179E0C: + lsls r0, 2 + ldr r1, =_08179E24 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08179E24: + .4byte _08179E48 + .4byte _08179E84 + .4byte _08179EC4 + .4byte _08179ED8 + .4byte _08179EEC + .4byte _08179F00 + .4byte _08179F20 + .4byte _08179F44 + .4byte _08179F78 +_08179E48: + adds r0, r6, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r6, 0 + movs r1, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r0, r5, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + ldr r1, [r1, 0x8] + adds r2, r5, 0 + adds r3, r4, 0 + bl DecompressMonPic_DetectFrontOrBack_2 + ldr r0, =0x0203bd18 + ldr r1, [r0] + b _08179F5E + .pool +_08179E84: + adds r0, r6, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r6, 0 + movs r1, 0 + bl pokemon_getattr + adds r4, r0, 0 + adds r0, r6, 0 + movs r1, 0x1 + bl pokemon_getattr + adds r1, r0, 0 + adds r0, r5, 0 + adds r2, r4, 0 + bl sub_806E7CC + adds r4, r0, 0 + bl LoadCompressedObjectPalette + ldrh r0, [r4, 0x4] + movs r1, 0x1 + bl sub_806A068 + ldr r0, =0x0203bd18 + ldr r1, [r0] + b _08179F5E + .pool +_08179EC4: + ldr r0, =gUnknown_085B26F4 + bl LoadCompressedObjectPic + ldr r0, =0x0203bd18 + ldr r1, [r0] + b _08179F5E + .pool +_08179ED8: + ldr r0, =gUnknown_085B26FC + bl LoadCompressedObjectPalette + ldr r0, =0x0203bd18 + ldr r1, [r0] + b _08179F5E + .pool +_08179EEC: + ldr r0, =gUnknown_085F06A0 + bl LoadCompressedObjectPic + ldr r0, =0x0203bd18 + ldr r1, [r0] + b _08179F5E + .pool +_08179F00: + ldr r0, =0x0203ce7c + ldrb r0, [r0] + bl sub_8179FEC + ldr r0, =0x0203bd1c + bl LoadCompressedObjectPalette + ldr r0, =0x0203bd18 + ldr r1, [r0] + b _08179F5E + .pool +_08179F20: + bl reset_temp_tile_data_buffers + ldr r1, =gUnknown_08D7C440 + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r0, =0x0203bd18 + ldr r1, [r0] + b _08179F5E + .pool +_08179F44: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08179FA0 + ldr r0, =gUnknown_08D9BA44 + ldr r4, =0x0203bd18 + ldr r1, [r4] + adds r1, 0x48 + bl LZDecompressWram + ldr r1, [r4] +_08179F5E: + ldr r0, =0x0000107e + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _08179FA0 + .pool +_08179F78: + ldr r0, =gUnknown_08D7C9EC + movs r1, 0x20 + movs r2, 0x60 + bl decompress_palette + ldr r0, =0x0203bd18 + ldr r0, [r0] + ldr r1, =0x0000107e + adds r0, r1 + movs r1, 0 + strh r1, [r0] + movs r0, 0x1 + b _08179FA2 + .pool +_08179FA0: + movs r0, 0 +_08179FA2: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8179DF4 + + thumb_func_start sub_8179FAC +sub_8179FAC: @ 8179FAC + push {lr} + ldr r0, =gUnknown_085F0558 + bl InitWindows + bl DeactivateAllTextPrinters + movs r0, 0 + movs r1, 0x1 + movs r2, 0xE0 + bl sub_809882C + ldr r0, =gUnknown_0860F074 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0 + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r0} + bx r0 + .pool + thumb_func_end sub_8179FAC + + thumb_func_start sub_8179FEC +sub_8179FEC: @ 8179FEC + push {lr} + lsls r0, 24 + ldr r1, =0x03005d8c + lsrs r0, 21 + ldr r2, =0x00000848 + adds r0, r2 + ldr r1, [r1] + adds r1, r0 + adds r0, r1, 0 + movs r1, 0 + bl sub_8136F9C + lsls r0, 24 + ldr r2, =0x0203bd1c + ldr r1, =gUnknown_085F0568 + lsrs r0, 22 + subs r0, 0x4 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + ldr r0, =0x000039e2 + strh r0, [r2, 0x4] + pop {r0} + bx r0 + .pool + thumb_func_end sub_8179FEC + + thumb_func_start sub_817A030 +sub_817A030: @ 817A030 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0817A044 + b _0817A154 +_0817A044: + ldr r0, =0x03005e00 + lsls r2, r4, 2 + adds r1, r2, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0x8 + ldrsh r3, [r1, r0] + ldr r0, =0x0000010d + adds r5, r2, 0 + cmp r3, r0 + beq _0817A0C8 + cmp r3, r0 + bgt _0817A074 + cmp r3, 0 + beq _0817A088 + cmp r3, 0xFF + beq _0817A0AC + b _0817A104 + .pool +_0817A074: + ldr r0, =0x00000119 + cmp r3, r0 + beq _0817A0E0 + adds r0, 0x10 + cmp r3, r0 + beq _0817A0F8 + b _0817A104 + .pool +_0817A088: + ldr r0, =0x0203bd18 + ldr r1, [r0] + ldr r2, =0x00001050 + adds r1, r2 + strb r3, [r1] + ldr r0, [r0] + ldr r1, =0x00001058 + adds r0, r1 + strh r3, [r0] + bl sub_817A5CC + b _0817A104 + .pool +_0817A0AC: + ldr r0, =0x0203bd18 + ldr r0, [r0] + ldr r2, =0x0000105e + adds r0, r2 + ldrb r0, [r0] + ldrb r1, [r1, 0xA] + bl sub_817A4F8 + b _0817A104 + .pool +_0817A0C8: + bl sub_817A56C + ldr r1, =0x0203bd18 + ldr r1, [r1] + ldr r2, =0x0000105f + adds r1, r2 + strb r0, [r1] + b _0817A104 + .pool +_0817A0E0: + ldr r0, =0x0203bd18 + ldr r0, [r0] + ldr r1, =0x0000105d + adds r0, r1 + ldrb r0, [r0] + bl sub_817A434 + b _0817A104 + .pool +_0817A0F8: + ldr r0, =sub_817A1C4 + str r0, [r1] + b _0817A154 + .pool +_0817A104: + ldr r0, =0x0203bd18 + ldr r0, [r0] + ldr r2, =0x00001058 + adds r1, r0, r2 + subs r2, 0x2 + adds r0, r2 + ldrh r1, [r1] + ldrh r0, [r0] + cmp r1, r0 + bcs _0817A128 + bl sub_817A634 + b _0817A138 + .pool +_0817A128: + cmp r1, r0 + bne _0817A138 + ldr r0, =0x03005e00 + adds r1, r5, r4 + lsls r1, 3 + adds r1, r0 + movs r0, 0xFE + strh r0, [r1, 0x8] +_0817A138: + ldr r0, =0x0203bd18 + ldr r1, [r0] + ldr r0, =0x00001058 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + ldr r0, =0x03005e00 + adds r1, r5, r4 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_0817A154: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817A030 + + thumb_func_start sub_817A168 +sub_817A168: @ 817A168 + push {lr} + ldr r0, =sub_817A030 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x8] + movs r0, 0x1 + strh r0, [r1, 0xA] + pop {r0} + bx r0 + .pool + thumb_func_end sub_817A168 + + thumb_func_start sub_817A194 +sub_817A194: @ 817A194 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0 + bl sub_8121F20 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + beq _0817A1B6 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_817A320 + str r0, [r1] +_0817A1B6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817A194 + + thumb_func_start sub_817A1C4 +sub_817A1C4: @ 817A1C4 + push {r4-r7,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x0203bc9c + ldrb r1, [r0] + movs r0, 0x64 + adds r5, r1, 0 + muls r5, r0 + ldr r0, =0x020244ec + adds r5, r0 + ldr r1, =0x03005d8c + ldr r0, =0x0203ce7c + ldrh r0, [r0] + lsls r0, 3 + ldr r2, =0x00000848 + adds r0, r2 + ldr r4, [r1] + adds r4, r0 + adds r0, r5, 0 + bl GetNature + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl sub_8136FE4 + ldr r6, =0x0203bc9e + strh r0, [r6] + ldr r1, =0x02021cc4 + adds r0, r5, 0 + bl GetMonNickname + ldr r1, =0x02021dc4 + adds r0, r4, 0 + bl sub_8137044 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0817A248 + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E937F + bl ExpandStringRefs + b _0817A268 + .pool +_0817A248: + cmp r0, 0 + ble _0817A260 + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E9390 + bl ExpandStringRefs + b _0817A268 + .pool +_0817A260: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E93A9 + bl ExpandStringRefs +_0817A268: + ldr r2, =0x03003014 + 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 + ldr r2, =0x02021fc4 + 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, 0 + movs r1, 0x1 + bl AddTextPrinterParametrized + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_817A194 + str r1, [r0] + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817A1C4 + + thumb_func_start sub_817A2C0 +sub_817A2C0: @ 817A2C0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0817A304 + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + ldr r0, =0x030022c0 + ldr r0, [r0, 0x8] + bl SetMainCallback2 + adds r0, r4, 0 + bl DestroyTask + bl FreeAllWindowBuffers + ldr r0, =0x0203bd18 + ldr r0, [r0] + bl Free + bl sub_805F094 +_0817A304: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817A2C0 + + thumb_func_start sub_817A320 +sub_817A320: @ 817A320 + 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 pal_fade_maybe + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_817A2C0 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817A320 + + thumb_func_start sub_817A358 +sub_817A358: @ 817A358 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r5, r0, 0 + movs r1, 0x41 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =0x0202499c + movs r1, 0x30 + movs r2, 0x50 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =0x0203bd18 + mov r9, r0 + ldr r0, [r0] + ldr r2, =0x00001054 + adds r1, r0, r2 + strh r4, [r1] + ldr r1, =0x0000105b + adds r0, r1 + mov r2, r8 + strb r2, [r0] + adds r0, r5, 0 + bl GetNature + mov r2, r9 + ldr r1, [r2] + ldr r2, =0x0000105a + adds r1, r2 + strb r0, [r1] + ldr r7, =0x02020630 + mov r1, r8 + lsls r0, r1, 4 + add r0, r8 + lsls r5, r0, 2 + adds r6, r5, r7 + strh r4, [r6, 0x32] + adds r0, r7, 0 + adds r0, 0x1C + adds r0, r5, r0 + ldr r1, =DummyObjectCallback + str r1, [r0] + mov r2, r9 + ldr r0, [r2] + ldr r1, =0x00001053 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + adds r0, r4, 0 + bl sub_806E840 + lsls r0, 24 + cmp r0, 0 + bne _0817A402 + adds r0, r7, 0 + adds r0, 0x10 + adds r0, r5, r0 + ldr r1, =gUnknown_085F05B0 + str r1, [r0] + ldrb r3, [r6, 0x1] + movs r0, 0x3 + orrs r3, r0 + strb r3, [r6, 0x1] + lsrs r1, r3, 6 + ldrb r2, [r6, 0x3] + lsrs r2, 6 + lsls r3, 30 + lsrs r3, 30 + adds r0, r6, 0 + bl CalcVecFromObjectCenterToObjectUpperLeft + mov r2, r9 + ldr r0, [r2] + ldr r1, =0x00001053 + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_0817A402: + mov r0, r8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817A358 + + thumb_func_start sub_817A434 +sub_817A434: @ 817A434 + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r2, r1, r3 + movs r0, 0x30 + strh r0, [r2, 0x20] + movs r0, 0x50 + strh r0, [r2, 0x22] + ldr r0, =0x0000fff8 + strh r0, [r2, 0x2E] + movs r0, 0x1 + strh r0, [r2, 0x30] + adds r3, 0x1C + adds r1, r3 + ldr r0, =sub_817A468 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_817A434 + + thumb_func_start sub_817A468 +sub_817A468: @ 817A468 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x20] + adds r0, 0x4 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x2E] + ldrh r2, [r4, 0x22] + adds r1, r0, r2 + strh r1, [r4, 0x22] + ldrh r1, [r4, 0x30] + adds r0, r1 + strh r0, [r4, 0x2E] + lsls r0, 16 + cmp r0, 0 + bne _0817A48E + ldrh r0, [r4, 0x32] + movs r1, 0 + bl cry_related +_0817A48E: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x9 + bne _0817A49A + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] +_0817A49A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817A468 + + thumb_func_start sub_817A4A4 +sub_817A4A4: @ 817A4A4 + push {r4,r5,lr} + movs r0, 0xBC + movs r1, 0x64 + movs r2, 0x2 + bl sub_8136444 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =0x02020630 + lsls r3, r4, 4 + adds r3, r4 + lsls r3, 2 + adds r0, r3, r5 + ldrb r2, [r0, 0x1] + movs r1, 0x4 + negs r1, r1 + ands r1, r2 + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0, 0x1] + adds r1, r5, 0 + adds r1, 0x10 + adds r1, r3, r1 + ldr r2, =gUnknown_085F0664 + str r2, [r1] + adds r5, 0x1C + adds r3, r5 + ldr r1, =DummyObjectCallback + str r1, [r3] + bl obj_alloc_rotscale_entry + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817A4A4 + + thumb_func_start sub_817A4F8 +sub_817A4F8: @ 817A4F8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r1, 0 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =0x02020630 + mov r8, r0 + lsls r0, r7, 4 + adds r0, r7 + lsls r6, r0, 2 + mov r0, r8 + adds r4, r6, r0 + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldrb r0, [r4, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r4, 0x1] + cmp r5, 0 + bne _0817A540 + mov r0, r8 + adds r0, 0x10 + adds r0, r6, r0 + ldr r1, =gUnknown_085F0668 + b _0817A548 + .pool +_0817A540: + mov r0, r8 + adds r0, 0x10 + adds r0, r6, r0 + ldr r1, =gUnknown_085F066C +_0817A548: + str r1, [r0] + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl obj_alloc_rotscale_entry + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817A4F8 + + thumb_func_start sub_817A56C +sub_817A56C: @ 817A56C + push {lr} + ldr r0, =gUnknown_085F06A8 + movs r1, 0xAE + movs r2, 0x54 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldr r2, =0x0000fff4 + strh r2, [r1, 0x2E] + movs r2, 0x1 + strh r2, [r1, 0x30] + pop {r1} + bx r1 + .pool + thumb_func_end sub_817A56C + + thumb_func_start sub_817A5A0 +sub_817A5A0: @ 817A5A0 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x20] + subs r0, 0x4 + strh r0, [r2, 0x20] + ldrh r0, [r2, 0x2E] + ldrh r3, [r2, 0x22] + adds r1, r0, r3 + strh r1, [r2, 0x22] + ldrh r1, [r2, 0x30] + adds r0, r1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _0817A5C6 + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles +_0817A5C6: + pop {r0} + bx r0 + thumb_func_end sub_817A5A0 + + thumb_func_start sub_817A5CC +sub_817A5CC: @ 817A5CC + push {r4-r7,lr} + ldr r0, =0x0203bd18 + ldr r1, [r0] + ldr r0, =0x00001056 + adds r3, r1, r0 + movs r0, 0x1 + strh r0, [r3] + ldr r2, =gUnknown_085EFEBC + ldr r7, =0x0000105a + adds r1, r7 + ldrb r0, [r1] + lsls r0, 1 + adds r0, r2 + ldrb r2, [r0] + movs r4, 0 + ldr r5, =gUnknown_085EFF00 + adds r6, r5, 0 + subs r6, 0xA +_0817A5F0: + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 2 + adds r0, r1, r6 + ldrh r0, [r0] + ldrh r7, [r3] + adds r0, r7 + strh r0, [r3] + adds r1, r5 + movs r7, 0 + ldrsh r0, [r1, r7] + cmp r0, 0x1 + beq _0817A61A + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r4, 0x7 + bls _0817A5F0 +_0817A61A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817A5CC + + thumb_func_start sub_817A634 +sub_817A634: @ 817A634 + push {r4,lr} + ldr r0, =0x0203bd18 + ldr r4, [r0] + ldr r1, =0x00001050 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0x5A + bls _0817A646 + b _0817A90E +_0817A646: + lsls r0, 2 + ldr r1, =_0817A65C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0817A65C: + .4byte _0817A7C8 + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A818 + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A858 + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A8A2 + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A8FC + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E + .4byte _0817A90E +_0817A7C8: + ldr r1, =gUnknown_085EFEBC + ldr r2, =0x0000105a + adds r0, r4, r2 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrb r1, [r0] + ldr r3, =0x00001051 + adds r0, r4, r3 + strb r1, [r0] + ldr r1, =0x0000105b + adds r0, r4, r1 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + adds r0, r4, 0 + stm r0!, {r1} + movs r2, 0x44 + bl memcpy + ldr r2, =0x00001050 + adds r1, r4, r2 + movs r0, 0xA + strb r0, [r1] + b _0817A90E + .pool +_0817A818: + bl sub_817A91C + ldr r1, =gUnknown_085EFEBC + ldr r3, =0x0000105a + adds r0, r4, r3 + ldrb r0, [r0] + lsls r0, 1 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0817A850 + ldr r2, [r4] + ldrb r0, [r2, 0x1] + movs r1, 0x3 + orrs r0, r1 + strb r0, [r2, 0x1] + ldr r2, [r4] + ldrb r1, [r2, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x3] + ldr r0, [r4] + ldr r1, =gUnknown_085F04FC + str r1, [r0, 0x10] + bl obj_alloc_rotscale_entry +_0817A850: + ldr r0, =0x00001050 + adds r1, r4, r0 + movs r0, 0x32 + strb r0, [r1] +_0817A858: + ldr r1, =gUnknown_085EFEBC + ldr r2, =0x0000105a + adds r0, r4, r2 + ldrb r0, [r0] + lsls r0, 1 + adds r1, 0x1 + adds r2, r0, r1 + ldrb r1, [r2] + cmp r1, 0 + beq _0817A8C8 + ldr r3, =0x00001053 + adds r0, r4, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _0817A898 + ldr r0, [r4] + adds r1, 0xA + lsls r1, 24 + lsrs r1, 24 + bl StartObjectRotScalAnim + b _0817A8C8 + .pool +_0817A898: + ldr r0, [r4] + ldrb r1, [r2] + bl StartObjectRotScalAnim + b _0817A8C8 +_0817A8A2: + bl sub_817A9E4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0817A90E + ldr r1, =0x00001072 + adds r0, r4, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _0817A8E0 + ldr r3, =0x00001051 + adds r1, r4, r3 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bl sub_817A91C +_0817A8C8: + ldr r0, =0x00001050 + adds r1, r4, r0 + movs r0, 0x3C + strb r0, [r1] + b _0817A90E + .pool +_0817A8E0: + ldr r0, [r4] + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldr r2, =0x00001050 + adds r1, r4, r2 + movs r0, 0x46 + strb r0, [r1] + b _0817A90E + .pool +_0817A8FC: + bl sub_817AA3C + ldr r3, =0x00001051 + adds r0, r4, r3 + movs r1, 0 + strb r1, [r0] + ldr r2, =0x00001050 + adds r0, r4, r2 + strb r1, [r0] +_0817A90E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817A634 + + thumb_func_start sub_817A91C +sub_817A91C: @ 817A91C + push {r4-r7,lr} + ldr r0, =0x0203bd18 + ldr r5, [r0] + movs r4, 0 + movs r0, 0x83 + lsls r0, 5 + adds r7, r5, r0 + ldr r1, =gUnknown_085EFEEE + mov r12, r1 + ldr r2, =0x00001051 + adds r6, r5, r2 +_0817A932: + lsls r2, r4, 1 + adds r3, r7, r2 + ldrb r1, [r6] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, r0 + add r2, r12 + ldrh r0, [r2] + strh r0, [r3] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x9 + bls _0817A932 + ldr r0, =0x00001068 + adds r6, r5, r0 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _0817A9DC + movs r2, 0x83 + lsls r2, 5 + adds r4, r5, r2 + movs r1, 0 + ldrsh r0, [r4, r1] + adds r2, 0x4 + adds r1, r5, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + bl sine + ldr r2, =0x00001074 + adds r1, r5, r2 + strh r0, [r1] + movs r1, 0 + ldrsh r0, [r4, r1] + subs r2, 0xE + adds r1, r5, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + bl cosine + ldr r2, =0x00001076 + adds r1, r5, r2 + strh r0, [r1] + ldrh r0, [r6] + ldr r1, =0x00001078 + adds r4, r5, r1 + strh r0, [r4] + ldr r0, [r5] + ldrh r1, [r0, 0x24] + adds r2, 0x4 + adds r0, r5, r2 + strh r1, [r0] + ldr r0, [r5] + ldrh r1, [r0, 0x26] + adds r2, 0x2 + adds r0, r5, r2 + strh r1, [r0] + bl sub_817AB68 + ldrh r0, [r4] + strh r0, [r6] + bl sub_817AA54 + ldrh r0, [r4] + strh r0, [r6] + movs r0, 0 + b _0817A9DE + .pool +_0817A9DC: + movs r0, 0x1 +_0817A9DE: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_817A91C + + thumb_func_start sub_817A9E4 +sub_817A9E4: @ 817A9E4 + push {r4,r5,lr} + ldr r0, =0x0203bd18 + ldr r2, [r0] + ldr r1, =0x00001078 + adds r0, r2, r1 + ldr r5, =0x00001068 + adds r4, r2, r5 + ldrh r1, [r0] + ldrh r0, [r4] + subs r1, r0 + lsls r1, 16 + ldr r3, [r2] + lsrs r1, 15 + movs r5, 0x85 + lsls r5, 4 + adds r0, r2, r5 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r3, 0x24] + ldr r3, [r2] + movs r0, 0xC5 + lsls r0, 4 + adds r2, r0 + adds r2, r1 + ldrh r0, [r2] + strh r0, [r3, 0x26] + ldrh r0, [r4] + subs r0, 0x1 + strh r0, [r4] + lsls r0, 16 + cmp r0, 0 + beq _0817AA34 + movs r0, 0 + b _0817AA36 + .pool +_0817AA34: + movs r0, 0x1 +_0817AA36: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_817A9E4 + + thumb_func_start sub_817AA3C +sub_817AA3C: @ 817AA3C + push {lr} + ldr r0, =0x0203bd18 + ldr r0, [r0] + ldr r0, [r0] + bl obj_free_rotscale_entry + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_817AA3C + + thumb_func_start sub_817AA54 +sub_817AA54: @ 817AA54 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + ldr r0, =0x0203bd18 + ldr r7, [r0] + ldr r1, =0x00001070 + adds r0, r7, r1 + ldrh r0, [r0] + mov r9, r0 + ldr r2, =0x00001078 + adds r0, r7, r2 + ldrh r0, [r0] + mov r3, r9 + subs r0, r3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r4, =0x0000107a + adds r1, r7, r4 + subs r2, 0xC + adds r0, r7, r2 + ldrh r0, [r0] + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + ldr r3, =0x0000107c + adds r1, r7, r3 + subs r4, 0xC + adds r0, r7, r4 + ldrh r0, [r0] + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x4] + movs r5, 0 + mov r0, r8 + subs r0, 0x1 + cmp r5, r0 + bge _0817AB20 + ldr r1, [sp] + lsls r0, r1, 16 + asrs r0, 16 + str r0, [sp, 0x8] + ldr r2, [sp, 0x4] + lsls r0, r2, 16 + asrs r0, 16 + mov r10, r0 +_0817AABE: + mov r3, r9 + adds r0, r3, r5 + lsls r0, 1 + movs r4, 0x85 + lsls r4, 4 + adds r2, r7, r4 + adds r2, r0 + ldrh r6, [r2] + ldr r3, [sp, 0x8] + subs r1, r6, r3 + movs r4, 0xC5 + lsls r4, 4 + adds r3, r7, r4 + adds r3, r0 + ldrh r4, [r3] + mov r0, r10 + subs r4, r0 + lsls r4, 16 + lsrs r4, 16 + lsls r1, 16 + asrs r1, 16 + adds r5, 0x1 + adds r0, r1, 0 + muls r0, r5 + mov r1, r8 + str r2, [sp, 0xC] + str r3, [sp, 0x10] + bl __divsi3 + subs r6, r0 + ldr r2, [sp, 0xC] + strh r6, [r2] + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + muls r0, r5 + mov r1, r8 + bl __divsi3 + ldr r3, [sp, 0x10] + ldrh r1, [r3] + subs r1, r0 + strh r1, [r3] + lsls r5, 16 + lsrs r5, 16 + mov r0, r8 + subs r0, 0x1 + cmp r5, r0 + blt _0817AABE +_0817AB20: + mov r0, r9 + add r0, r8 + subs r0, 0x1 + lsls r0, 1 + movs r2, 0x85 + lsls r2, 4 + adds r1, r7, r2 + adds r1, r0 + mov r3, sp + ldrh r3, [r3] + strh r3, [r1] + movs r4, 0xC5 + lsls r4, 4 + adds r1, r7, r4 + adds r1, r0 + mov r0, sp + ldrh r0, [r0, 0x4] + strh r0, [r1] + 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_817AA54 + + thumb_func_start sub_817AB68 +sub_817AB68: @ 817AB68 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r0, =0x0203bd18 + ldr r6, [r0] + movs r0, 0 + str r0, [sp] + ldr r1, =0x0000107a + adds r0, r6, r1 + ldr r2, =0x00001074 + adds r1, r6, r2 + ldrh r2, [r0] + ldrh r0, [r1] + subs r2, r0 + ldr r3, =0x0000107c + adds r0, r6, r3 + ldr r1, =0x00001076 + adds r3, r6, r1 + ldrh r1, [r0] + ldrh r0, [r3] + subs r1, r0 + ldr r3, =0x00001068 + adds r3, r6 + mov r9, r3 + movs r0, 0x83 + lsls r0, 5 + adds r0, r6 + mov r8, r0 + lsls r2, 16 + asrs r2, 16 + str r2, [sp, 0x4] + lsls r1, 16 + asrs r1, 16 + mov r10, r1 +_0817ABB2: + ldr r1, =0x0000106a + adds r0, r6, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bge _0817ABC0 + negs r0, r0 +_0817ABC0: + lsls r0, 16 + ldr r3, =0x00001066 + adds r7, r6, r3 + lsrs r0, 16 + ldrh r1, [r7] + adds r0, r1 + lsls r4, r0, 16 + strh r0, [r7] + ldr r2, =0x00001064 + adds r0, r6, r2 + ldrh r2, [r0] + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0 + bge _0817ABE2 + movs r0, 0x1 + str r0, [sp] +_0817ABE2: + ldr r1, =0x00001078 + adds r0, r6, r1 + ldrh r0, [r0] + mov r3, r9 + ldrh r1, [r3] + subs r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r1, 0 + beq _0817ACB8 + ldr r0, [sp] + cmp r0, 0 + bne _0817AC54 + mov r1, r8 + movs r3, 0 + ldrsh r0, [r1, r3] + lsrs r4, 24 + adds r1, r2, r4 + lsls r1, 16 + asrs r1, 16 + bl sine + lsls r5, 1 + movs r2, 0x85 + lsls r2, 4 + adds r1, r6, r2 + adds r1, r5 + ldr r3, [sp, 0x4] + adds r0, r3, r0 + strh r0, [r1] + mov r1, r8 + movs r2, 0 + ldrsh r0, [r1, r2] + ldrh r1, [r7] + adds r1, r4 + b _0817AC80 + .pool +_0817AC54: + mov r1, r8 + movs r3, 0 + ldrsh r0, [r1, r3] + lsrs r4, 24 + subs r1, r2, r4 + lsls r1, 16 + asrs r1, 16 + bl sine + lsls r5, 1 + movs r2, 0x85 + lsls r2, 4 + adds r1, r6, r2 + adds r1, r5 + ldr r3, [sp, 0x4] + adds r0, r3, r0 + strh r0, [r1] + mov r1, r8 + movs r2, 0 + ldrsh r0, [r1, r2] + ldrh r1, [r7] + subs r1, r4 +_0817AC80: + lsls r1, 16 + asrs r1, 16 + bl cosine + movs r3, 0xC5 + lsls r3, 4 + adds r1, r6, r3 + adds r1, r5 + add r0, r10 + strh r0, [r1] + ldr r1, =0x00001062 + adds r0, r6, r1 + ldrh r0, [r0] + mov r2, r8 + ldrh r2, [r2] + adds r0, r2 + movs r1, 0xFF + ands r0, r1 + mov r3, r8 + strh r0, [r3] + mov r1, r9 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + b _0817ABB2 + .pool +_0817ACB8: + 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 sub_817AB68 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_817B064.s b/asm/rom_817B064.s new file mode 100644 index 000000000..f9b5b6ca0 --- /dev/null +++ b/asm/rom_817B064.s @@ -0,0 +1,7994 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start load_intro_part2_graphics +load_intro_part2_graphics: @ 817B064 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_085F0740 + ldr r1, =0x06004000 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F0BC0 + ldr r1, =0x06007800 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F06E0 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + cmp r4, 0 + beq _0817B08C + cmp r4, 0x1 + beq _0817B0EC +_0817B08C: + ldr r0, =gUnknown_085F0DBC + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F1398 + ldr r1, =0x06003000 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F0CFC + movs r1, 0 + movs r2, 0x60 + bl gpu_pal_apply + ldr r0, =gUnknown_085F5064 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085F1668 + movs r1, 0x80 + lsls r1, 1 + movs r2, 0x20 + bl gpu_pal_apply + bl sub_817B76C + b _0817B11E + .pool +_0817B0EC: + ldr r0, =gUnknown_085F1824 + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F1EAC + ldr r1, =0x06003000 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F17E4 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_085F50EC + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085F21B0 + movs r1, 0x80 + lsls r1, 1 + movs r2, 0x20 + bl gpu_pal_apply + bl sub_817B788 +_0817B11E: + ldr r1, =0x0203bd28 + movs r0, 0 + strh r0, [r1] + ldr r1, =0x0300301c + movs r0, 0x8 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end load_intro_part2_graphics + + thumb_func_start sub_817B150 +sub_817B150: @ 817B150 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0817B162 + cmp r0, 0x1 + ble _0817B162 + cmp r0, 0x2 + beq _0817B194 +_0817B162: + ldr r1, =0x00000603 + movs r0, 0xE + bl SetGpuReg + ldr r1, =0x00000702 + movs r0, 0xC + bl SetGpuReg + ldr r1, =0x00000f05 + movs r0, 0xA + bl SetGpuReg + movs r1, 0xF2 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + b _0817B1B6 + .pool +_0817B194: + ldr r1, =0x00000603 + movs r0, 0xE + bl SetGpuReg + ldr r1, =0x00000702 + movs r0, 0xC + bl SetGpuReg + ldr r1, =0x00000f05 + movs r0, 0xA + bl SetGpuReg + movs r1, 0xF2 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg +_0817B1B6: + pop {r0} + bx r0 + .pool + thumb_func_end sub_817B150 + + thumb_func_start sub_817B1C8 +sub_817B1C8: @ 817B1C8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_085F0740 + ldr r1, =0x06004000 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F0BC0 + ldr r1, =0x06007800 + bl LZ77UnCompVram + cmp r4, 0x4 + bhi _0817B214 + lsls r0, r4, 2 + ldr r1, =_0817B200 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0817B200: + .4byte _0817B214 + .4byte _0817B270 + .4byte _0817B2DC + .4byte _0817B2DC + .4byte _0817B334 +_0817B214: + ldr r0, =gUnknown_085F06E0 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_085F0DBC + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F1398 + ldr r1, =0x06003000 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F0CFC + movs r1, 0 + movs r2, 0x60 + bl gpu_pal_apply + ldr r0, =gUnknown_085F5064 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085F16A8 + ldr r1, =0x06010000 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F1668 + b _0817B2A6 + .pool +_0817B270: + ldr r0, =gUnknown_085F0700 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_085F0DBC + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F1398 + ldr r1, =0x06003000 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F0D5C + movs r1, 0 + movs r2, 0x60 + bl gpu_pal_apply + ldr r0, =gUnknown_085F5064 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085F16A8 + ldr r1, =0x06010000 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F1688 +_0817B2A6: + movs r1, 0x80 + lsls r1, 1 + movs r2, 0x20 + bl gpu_pal_apply + bl sub_817B76C + b _0817B370 + .pool +_0817B2DC: + ldr r0, =gUnknown_085F0700 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_085F1824 + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F1EAC + ldr r1, =0x06003000 + bl LZ77UnCompVram + ldr r4, =gUnknown_085F1804 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_085F50EC + bl LoadCompressedObjectPic + movs r1, 0x80 + lsls r1, 1 + adds r0, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + bl sub_817B788 + b _0817B370 + .pool +_0817B334: + ldr r0, =gUnknown_085F0720 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_085F235C + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F2568 + ldr r1, =0x06003000 + bl LZ77UnCompVram + ldr r0, =gUnknown_085F231C + movs r1, 0 + movs r2, 0x40 + bl gpu_pal_apply + ldr r0, =gUnknown_085F5180 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085F2548 + movs r1, 0x80 + lsls r1, 1 + movs r2, 0x20 + bl gpu_pal_apply + bl sub_817B7A4 +_0817B370: + ldr r1, =0x0300301c + movs r0, 0x8 + strb r0, [r1] + ldr r1, =0x0203bd28 + movs r0, 0 + strh r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817B1C8 + + thumb_func_start sub_817B3A8 +sub_817B3A8: @ 817B3A8 + push {lr} + ldr r1, =0x00000603 + movs r0, 0xE + bl SetGpuReg + ldr r1, =0x00000702 + movs r0, 0xC + bl SetGpuReg + ldr r1, =0x00000f05 + movs r0, 0xA + bl SetGpuReg + movs r1, 0xFA + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end sub_817B3A8 + + thumb_func_start sub_817B3DC +sub_817B3DC: @ 817B3DC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + mov r8, r2 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 16 + lsrs r6, 16 + mov r0, r8 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r3, 16 + lsrs r3, 16 + ldr r1, =sub_817B458 + mov r9, r1 + mov r0, r9 + movs r1, 0 + str r3, [sp] + bl CreateTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + strh r5, [r0, 0x8] + strh r6, [r0, 0xA] + strh r2, [r0, 0xC] + strh r2, [r0, 0xE] + mov r1, r8 + strh r1, [r0, 0x10] + strh r2, [r0, 0x12] + strh r2, [r0, 0x14] + ldr r3, [sp] + strh r3, [r0, 0x16] + movs r1, 0x8 + strh r1, [r0, 0x18] + strh r2, [r0, 0x1A] + adds r0, r4, 0 + bl _call_via_r9 + adds r0, r4, 0 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817B3DC + + thumb_func_start sub_817B458 +sub_817B458: @ 817B458 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0xA] + lsls r2, r0, 16 + cmp r2, 0 + beq _0817B4A0 + movs r1, 0xC + ldrsh r0, [r4, r1] + lsls r0, 16 + ldrh r1, [r4, 0xE] + adds r1, r0, r1 + lsrs r0, r2, 12 + subs r1, r0 + asrs r0, r1, 16 + strh r0, [r4, 0xC] + strh r1, [r4, 0xE] + ldrh r1, [r4, 0xC] + movs r0, 0x14 + bl SetGpuReg + ldr r2, =0x0203bd24 + ldr r0, =0x0203bd26 + ldrh r1, [r0] + ldrh r2, [r2] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x16 + bl SetGpuReg +_0817B4A0: + ldrh r0, [r4, 0x10] + lsls r2, r0, 16 + cmp r2, 0 + beq _0817B4FA + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r0, 16 + ldrh r1, [r4, 0x14] + adds r1, r0, r1 + lsrs r0, r2, 12 + subs r1, r0 + asrs r0, r1, 16 + strh r0, [r4, 0x12] + strh r1, [r4, 0x14] + ldrh r1, [r4, 0x12] + movs r0, 0x18 + bl SetGpuReg + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0817B4F0 + ldr r2, =0x0203bd24 + ldr r0, =0x0203bd26 + ldrh r1, [r0] + ldrh r2, [r2] + adds r1, r2 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1A + bl SetGpuReg + b _0817B4FA + .pool +_0817B4F0: + ldr r0, =0x0203bd24 + ldrh r1, [r0] + movs r0, 0x1A + bl SetGpuReg +_0817B4FA: + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r2, r1, r0 + ldrh r0, [r2, 0x16] + lsls r3, r0, 16 + cmp r3, 0 + beq _0817B532 + movs r1, 0x18 + ldrsh r0, [r2, r1] + lsls r0, 16 + ldrh r1, [r2, 0x1A] + adds r1, r0, r1 + lsrs r0, r3, 12 + subs r1, r0 + asrs r0, r1, 16 + strh r0, [r2, 0x18] + strh r1, [r2, 0x1A] + ldrh r1, [r2, 0x18] + movs r0, 0x1C + bl SetGpuReg + ldr r0, =0x0203bd24 + ldrh r1, [r0] + movs r0, 0x1E + bl SetGpuReg +_0817B532: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817B458 + + thumb_func_start sub_817B540 +sub_817B540: @ 817B540 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0817B620 + cmp r0, 0x1 + ble _0817B554 + cmp r0, 0x2 + beq _0817B5B8 +_0817B554: + ldr r0, =0x030022c0 + ldr r2, [r0, 0x20] + movs r0, 0x3 + ands r0, r2 + cmp r0, 0 + bne _0817B620 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0817B620 + movs r0, 0x4 + ands r2, r0 + cmp r2, 0 + beq _0817B58C + ldr r2, =0x02037714 + ldrh r1, [r2, 0x12] + mov r0, sp + strh r1, [r0] + ldrh r1, [r2, 0x14] + b _0817B596 + .pool +_0817B58C: + ldr r2, =0x02037714 + ldrh r1, [r2, 0x14] + mov r0, sp + strh r1, [r0] + ldrh r1, [r2, 0x12] +_0817B596: + adds r0, 0x2 + strh r1, [r0] + adds r4, r0, 0 + mov r0, sp + movs r1, 0x9 + movs r2, 0x2 + bl gpu_pal_apply + adds r0, r4, 0 + movs r1, 0xA + movs r2, 0x2 + bl gpu_pal_apply + b _0817B620 + .pool +_0817B5B8: + ldr r0, =0x030022c0 + ldr r2, [r0, 0x20] + movs r0, 0x3 + ands r0, r2 + cmp r0, 0 + bne _0817B620 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0817B620 + movs r0, 0x4 + ands r2, r0 + cmp r2, 0 + beq _0817B5F8 + mov r1, sp + ldr r2, =0x00003d27 + adds r0, r2, 0 + strh r0, [r1] + adds r1, 0x2 + ldr r2, =0x00000295 + b _0817B606 + .pool +_0817B5F8: + mov r1, sp + movs r2, 0xC7 + lsls r2, 2 + adds r0, r2, 0 + strh r0, [r1] + adds r1, 0x2 + ldr r2, =0x00003d27 +_0817B606: + adds r0, r2, 0 + strh r0, [r1] + adds r4, r1, 0 + mov r0, sp + movs r1, 0xC + movs r2, 0x2 + bl gpu_pal_apply + adds r0, r4, 0 + movs r1, 0xD + movs r2, 0x2 + bl gpu_pal_apply +_0817B620: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817B540 + + thumb_func_start sub_817B62C +sub_817B62C: @ 817B62C + push {lr} + adds r2, r0, 0 + ldr r0, =0x0203bd28 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x2 + beq _0817B690 + cmp r0, 0 + beq _0817B64C + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles + b _0817B690 + .pool +_0817B64C: + movs r1, 0x20 + ldrsh r0, [r2, r1] + lsls r0, 16 + ldrh r1, [r2, 0x32] + orrs r0, r1 + ldrh r1, [r2, 0x30] + adds r0, r1 + asrs r1, r0, 16 + strh r1, [r2, 0x20] + strh r0, [r2, 0x32] + cmp r1, 0xFF + ble _0817B668 + ldr r0, =0x0000ffe0 + strh r0, [r2, 0x20] +_0817B668: + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0817B688 + ldr r1, =0x0203bd24 + ldr r0, =0x0203bd26 + ldrh r0, [r0] + ldrh r1, [r1] + adds r0, r1 + b _0817B68C + .pool +_0817B688: + ldr r0, =0x0203bd24 + ldrh r0, [r0] +_0817B68C: + negs r0, r0 + strh r0, [r2, 0x26] +_0817B690: + pop {r0} + bx r0 + .pool + thumb_func_end sub_817B62C + + thumb_func_start sub_817B698 +sub_817B698: @ 817B698 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + str r1, [sp, 0x4] + str r2, [sp, 0x8] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + movs r7, 0 + cmp r7, r8 + bcs _0817B74E + ldr r0, =0x02020630 + mov r10, r0 + movs r2, 0x3F + mov r9, r2 +_0817B6C2: + lsls r6, r7, 3 + ldr r0, [sp, 0x4] + adds r6, r0 + ldrb r1, [r6, 0x1] + ldrb r2, [r6, 0x2] + ldrb r3, [r6, 0x3] + ldr r0, =gUnknown_085F504C + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + mov r2, r10 + adds r4, r5, r2 + ldrb r2, [r6] + lsls r1, r2, 26 + lsrs r1, 30 + lsrs r2, 6 + adds r0, r4, 0 + movs r3, 0 + bl CalcVecFromObjectCenterToObjectUpperLeft + ldrb r3, [r4, 0x5] + movs r0, 0xC + orrs r3, r0 + strb r3, [r4, 0x5] + ldrb r1, [r6] + lsls r1, 26 + lsrs r1, 30 + lsls r1, 6 + ldrb r2, [r4, 0x1] + mov r0, r9 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r1, [r6] + lsrs r1, 6 + lsls r1, 6 + ldrb r2, [r4, 0x3] + mov r0, r9 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x3] + movs r0, 0xF + ands r3, r0 + strb r3, [r4, 0x5] + ldr r0, =0x02020638 + adds r5, r0 + ldr r2, [sp, 0x8] + str r2, [r5] + ldrb r1, [r6] + lsls r1, 28 + lsrs r1, 28 + adds r0, r4, 0 + bl StartObjectImageAnim + movs r1, 0 + mov r0, sp + ldrh r0, [r0] + strh r0, [r4, 0x2E] + ldrh r0, [r6, 0x4] + strh r0, [r4, 0x30] + strh r1, [r4, 0x32] + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, r8 + bcc _0817B6C2 +_0817B74E: + 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_817B698 + + thumb_func_start sub_817B76C +sub_817B76C: @ 817B76C + push {lr} + ldr r1, =gUnknown_085F50A4 + ldr r2, =gUnknown_085F5094 + movs r0, 0 + movs r3, 0x9 + bl sub_817B698 + pop {r0} + bx r0 + .pool + thumb_func_end sub_817B76C + + thumb_func_start sub_817B788 +sub_817B788: @ 817B788 + push {lr} + ldr r1, =gUnknown_085F5120 + ldr r2, =gUnknown_085F5114 + movs r0, 0x1 + movs r3, 0xC + bl sub_817B698 + pop {r0} + bx r0 + .pool + thumb_func_end sub_817B788 + + thumb_func_start sub_817B7A4 +sub_817B7A4: @ 817B7A4 + push {lr} + ldr r1, =gUnknown_085F519C + ldr r2, =gUnknown_085F5198 + movs r0, 0x1 + movs r3, 0x6 + bl sub_817B698 + pop {r0} + bx r0 + .pool + thumb_func_end sub_817B7A4 + + thumb_func_start nullsub_65 +nullsub_65: @ 817B7C0 + bx lr + thumb_func_end nullsub_65 + + thumb_func_start sub_817B7C4 +sub_817B7C4: @ 817B7C4 + push {r4,lr} + ldr r4, =0x02020630 + movs r1, 0x2E + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r1, [r1] + movs r2, 0x3E + adds r2, r0 + mov r12, r2 + movs r2, 0x4 + ands r2, r1 + mov r1, r12 + ldrb r3, [r1] + movs r1, 0x5 + negs r1, r1 + ands r1, r3 + orrs r1, r2 + mov r2, r12 + strb r1, [r2] + movs r1, 0x2E + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x20] + strh r1, [r0, 0x20] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x22] + adds r1, 0x8 + strh r1, [r0, 0x22] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x24] + strh r1, [r0, 0x24] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x26] + strh r1, [r0, 0x26] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817B7C4 + + thumb_func_start sub_817B834 +sub_817B834: @ 817B834 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldr r0, =gUnknown_085F51EC + lsls r5, 16 + asrs r5, 16 + lsls r4, 16 + asrs r4, 16 + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x2 + bl AddObjectToFront + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =gUnknown_085F523C + adds r4, 0x8 + lsls r4, 16 + asrs r4, 16 + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x3 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + strh r6, [r1, 0x2E] + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817B834 + + thumb_func_start sub_817B88C +sub_817B88C: @ 817B88C + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldr r0, =gUnknown_085F5204 + lsls r5, 16 + asrs r5, 16 + lsls r4, 16 + asrs r4, 16 + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x2 + bl AddObjectToFront + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =gUnknown_085F5254 + adds r4, 0x8 + lsls r4, 16 + asrs r4, 16 + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x3 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + strh r6, [r1, 0x2E] + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817B88C + + thumb_func_start nullsub_66 +nullsub_66: @ 817B8E4 + bx lr + thumb_func_end nullsub_66 + + thumb_func_start sub_817B8E8 +sub_817B8E8: @ 817B8E8 + push {r4,lr} + ldr r4, =0x02020630 + movs r1, 0x2E + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + adds r1, 0x3E + ldrb r1, [r1] + movs r2, 0x3E + adds r2, r0 + mov r12, r2 + movs r2, 0x4 + ands r2, r1 + mov r1, r12 + ldrb r3, [r1] + movs r1, 0x5 + negs r1, r1 + ands r1, r3 + orrs r1, r2 + mov r2, r12 + strb r1, [r2] + movs r1, 0x2E + ldrsh r2, [r0, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x22] + strh r1, [r0, 0x22] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x24] + strh r1, [r0, 0x24] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + ldrh r1, [r1, 0x26] + strh r1, [r0, 0x26] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817B8E8 + + thumb_func_start sub_817B948 +sub_817B948: @ 817B948 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r2, r0, 0 + adds r5, r1, 0 + ldr r0, =gUnknown_085F528C + mov r8, r0 + lsls r2, 16 + asrs r4, r2, 16 + ldr r0, =0xffe00000 + adds r2, r0 + asrs r2, 16 + lsls r5, 16 + asrs r5, 16 + mov r0, r8 + adds r1, r2, 0 + adds r2, r5, 0 + movs r3, 0x5 + bl AddObjectToFront + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + adds r4, 0x20 + lsls r4, 16 + asrs r4, 16 + mov r0, r8 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0x6 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r5, =0x02020630 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r0, r4, r5 + strh r6, [r0, 0x2E] + movs r1, 0x1 + bl StartObjectImageAnim + adds r5, 0x1C + adds r4, r5 + ldr r0, =sub_817B8E8 + str r0, [r4] + adds r0, r6, 0 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817B948 + + thumb_func_start sub_817B9C4 +sub_817B9C4: @ 817B9C4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r2, r0, 0 + adds r5, r1, 0 + ldr r0, =gUnknown_085F52A4 + mov r8, r0 + lsls r2, 16 + asrs r4, r2, 16 + ldr r0, =0xffe00000 + adds r2, r0 + asrs r2, 16 + lsls r5, 16 + asrs r5, 16 + mov r0, r8 + adds r1, r2, 0 + adds r2, r5, 0 + movs r3, 0x5 + bl AddObjectToFront + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + adds r4, 0x20 + lsls r4, 16 + asrs r4, 16 + mov r0, r8 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0x6 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r5, =0x02020630 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r0, r4, r5 + strh r6, [r0, 0x2E] + movs r1, 0x1 + bl StartObjectImageAnim + adds r5, 0x1C + adds r4, r5 + ldr r0, =sub_817B8E8 + str r0, [r4] + adds r0, r6, 0 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817B9C4 + + thumb_func_start nullsub_67 +nullsub_67: @ 817BA40 + bx lr + thumb_func_end nullsub_67 + + thumb_func_start sub_817BA44 +sub_817BA44: @ 817BA44 + push {r4,r5,lr} + sub sp, 0x4 + movs r4, 0 + ldr r5, =gUnknown_085F5458 +_0817BA4C: + adds r0, r4, 0 + adds r0, 0x14 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r4, 1 + adds r1, r5 + ldrh r1, [r1] + str r1, [sp] + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0xB + bls _0817BA4C + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817BA44 + + thumb_func_start sub_817BA7C +sub_817BA7C: @ 817BA7C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x22 + ldrsh r0, [r4, r1] + cmp r0, 0x8 + ble _0817BB2A + movs r2, 0x3C + ldrsh r0, [r4, r2] + adds r1, r0, 0 + muls r1, r0 + adds r0, r1, 0 + movs r1, 0x50 + bl __divsi3 + movs r1, 0x58 + subs r1, r0 + strh r1, [r4, 0x22] + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0817BAB6 + adds r0, 0x3 +_0817BAB6: + asrs r0, 2 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x3A] + adds r0, 0x4 + strh r0, [r4, 0x3A] + ldrh r1, [r4, 0x3C] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0817BAE0 + ldrh r0, [r4, 0x38] + subs r0, 0x1 + strh r0, [r4, 0x38] +_0817BAE0: + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + movs r1, 0x26 + ldrsh r0, [r4, r1] + cmp r0, 0 + ble _0817BAF6 + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1 + b _0817BAFC +_0817BAF6: + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x14 +_0817BAFC: + strb r0, [r1] + movs r2, 0x38 + ldrsh r0, [r4, r2] + cmp r0, 0 + bge _0817BB08 + adds r0, 0x3 +_0817BB08: + asrs r0, 2 + adds r0, 0x14 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x1F + bls _0817BB16 + movs r2, 0x1F +_0817BB16: + movs r0, 0x1F + ands r2, r0 + lsls r2, 1 + ldrb r1, [r4, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x3] + b _0817BB30 +_0817BB2A: + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0817BB30: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817BA7C + + thumb_func_start sub_817BB38 +sub_817BB38: @ 817BB38 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gUnknown_085F5440 + movs r1, 0x78 + movs r2, 0x58 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _0817BB82 + ldr r4, =0x02020630 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r2, r3, r4 + movs r1, 0 + movs r0, 0x30 + strh r0, [r2, 0x38] + strh r5, [r2, 0x3A] + strh r1, [r2, 0x3C] + ldrb r1, [r2, 0x1] + subs r0, 0x34 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x1] + ldrb r0, [r2, 0x3] + movs r1, 0x3E + orrs r0, r1 + strb r0, [r2, 0x3] + adds r4, 0x1C + adds r3, r4 + ldr r0, =sub_817BA7C + str r0, [r3] +_0817BB82: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817BB38 + + thumb_func_start sub_817BB94 +sub_817BB94: @ 817BB94 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x22 + ldrsh r0, [r4, r1] + cmp r0, 0x57 + bgt _0817BBFA + movs r2, 0x3C + ldrsh r0, [r4, r2] + adds r1, r0, 0 + muls r1, r0 + adds r0, r1, 0 + movs r1, 0x5 + bl __divsi3 + adds r0, 0x8 + strh r0, [r4, 0x22] + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0817BBCC + adds r0, 0x3 +_0817BBCC: + asrs r0, 2 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x3C + ldrsh r0, [r4, r1] + lsls r0, 26 + lsrs r0, 24 + movs r1, 0x28 + bl sine + adds r0, 0x8 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + b _0817BC00 +_0817BBFA: + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0817BC00: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817BB94 + + thumb_func_start sub_817BC08 +sub_817BC08: @ 817BC08 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gUnknown_085F5440 + movs r1, 0x78 + movs r2, 0x8 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _0817BC5E + ldr r4, =0x02020630 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r2, r3, r4 + movs r1, 0 + movs r0, 0x8 + strh r0, [r2, 0x38] + strh r5, [r2, 0x3A] + strh r1, [r2, 0x3C] + ldrb r1, [r2, 0x1] + subs r0, 0xC + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x1] + ldrb r1, [r2, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x32 + orrs r0, r1 + strb r0, [r2, 0x3] + adds r2, 0x43 + movs r0, 0x1 + strb r0, [r2] + adds r4, 0x1C + adds r3, r4 + ldr r0, =sub_817BB94 + str r0, [r3] +_0817BC5E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817BC08 + + thumb_func_start sub_817BC70 +sub_817BC70: @ 817BC70 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x38 + ldrsh r0, [r4, r1] + cmp r0, 0x8 + ble _0817BCAC + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x38] + ldrh r1, [r4, 0x34] + subs r0, r1 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x3A] + adds r0, 0x4 + strh r0, [r4, 0x3A] + b _0817BCB2 +_0817BCAC: + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0817BCB2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817BC70 + + thumb_func_start sub_817BCB8 +sub_817BCB8: @ 817BCB8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, =gUnknown_085F5440 + movs r1, 0x78 + movs r2, 0x38 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _0817BD0E + ldr r4, =0x02020630 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + adds r2, r3, r4 + movs r1, 0 + strh r5, [r2, 0x34] + movs r0, 0x78 + strh r0, [r2, 0x38] + strh r6, [r2, 0x3A] + strh r1, [r2, 0x3C] + ldrb r1, [r2, 0x1] + subs r0, 0x7C + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x1] + ldrb r0, [r2, 0x3] + movs r1, 0x3E + orrs r0, r1 + strb r0, [r2, 0x3] + adds r2, 0x43 + movs r0, 0x1 + strb r0, [r2] + adds r4, 0x1C + adds r3, r4 + ldr r0, =sub_817BC70 + str r0, [r3] +_0817BD0E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817BCB8 + + thumb_func_start sub_817BD20 +sub_817BD20: @ 817BD20 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x3C] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0817BD34 + ldrh r0, [r4, 0x22] + adds r0, 0x1 + strh r0, [r4, 0x22] +_0817BD34: + ldrh r1, [r4, 0x3A] + movs r2, 0x3A + ldrsh r0, [r4, r2] + cmp r0, 0x7F + bgt _0817BDE4 + lsls r0, r1, 24 + lsrs r0, 24 + movs r5, 0x38 + ldrsh r1, [r4, r5] + bl sine + negs r0, r0 + strh r0, [r4, 0x26] + movs r0, 0x34 + ldrsh r1, [r4, r0] + movs r2, 0x3C + ldrsh r0, [r4, r2] + muls r0, r1 + movs r1, 0x3 + bl __divsi3 + adds r0, 0x78 + strh r0, [r4, 0x20] + ldrh r0, [r4, 0x3A] + adds r3, r0, 0x1 + strh r3, [r4, 0x3A] + movs r5, 0x3A + ldrsh r1, [r4, r5] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + cmp r0, 0 + bge _0817BD78 + adds r0, 0x7F +_0817BD78: + asrs r0, 7 + movs r1, 0x1F + subs r1, r0 + lsls r1, 24 + lsrs r2, r1, 24 + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, 0x40 + ble _0817BD94 + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x1 + strb r0, [r1] + b _0817BDC4 +_0817BD94: + adds r3, r4, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x14 + strb r0, [r1] + ldrh r1, [r4, 0x3A] + movs r5, 0x3A + ldrsh r0, [r4, r5] + cmp r0, 0x70 + ble _0817BDC4 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0817BDC4 + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r3] +_0817BDC4: + cmp r2, 0x13 + bhi _0817BDCA + movs r2, 0x14 +_0817BDCA: + movs r0, 0x1F + ands r2, r0 + lsls r2, 1 + ldrb r1, [r4, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x3] + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + b _0817BDEA +_0817BDE4: + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_0817BDEA: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_817BD20 + + thumb_func_start sub_817BDF0 +sub_817BDF0: @ 817BDF0 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =gUnknown_085F5440 + movs r1, 0x78 + movs r2, 0x38 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x40 + beq _0817BE60 + bl GenerateRandomNumber + ldr r6, =0x02020630 + lsls r5, r4, 4 + adds r5, r4 + lsls r5, 2 + adds r4, r5, r6 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x7 + bl __umodsi3 + movs r1, 0x3 + subs r1, r0 + movs r0, 0 + mov r8, r0 + strh r1, [r4, 0x34] + bl GenerateRandomNumber + movs r1, 0x3F + ands r1, r0 + adds r1, 0x30 + strh r1, [r4, 0x38] + mov r0, r8 + strh r0, [r4, 0x3C] + ldrb r1, [r4, 0x1] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x3] + movs r1, 0x3E + orrs r0, r1 + strb r0, [r4, 0x3] + adds r4, 0x43 + movs r0, 0x14 + strb r0, [r4] + adds r6, 0x1C + adds r5, r6 + ldr r0, =sub_817BD20 + str r0, [r5] +_0817BE60: + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817BDF0 + + thumb_func_start sub_817BE78 +sub_817BE78: @ 817BE78 + push {lr} + ldr r0, =gUnknown_085F540C + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_085F541C + bl LoadTaggedObjectPalettes + pop {r0} + bx r0 + .pool + thumb_func_end sub_817BE78 + + thumb_func_start sub_817BE94 +sub_817BE94: @ 817BE94 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =sub_817BEC4 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0xA] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817BE94 + + thumb_func_start sub_817BEC4 +sub_817BEC4: @ 817BEC4 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_817BA44 + ldr r0, =0x03005e00 + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + adds r5, r0 + movs r0, 0 + strh r0, [r5, 0x26] + movs r0, 0xA + ldrsh r1, [r5, r0] + movs r0, 0x3 + lsls r0, r1 + ldr r1, =0x00007fff + str r1, [sp] + movs r1, 0xA + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_817BF14 + str r0, [r5] + movs r0, 0x8C + bl audio_play + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817BEC4 + + thumb_func_start sub_817BF14 +sub_817BF14: @ 817BF14 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r3, r5, 2 + adds r0, r3, r5 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0x26] + movs r4, 0x26 + ldrsh r0, [r1, r4] + cmp r0, 0x3F + bgt _0817BF70 + movs r0, 0x7 + ands r0, r2 + adds r7, r3, 0 + cmp r0, 0 + bne _0817BF5A + movs r4, 0 + adds r6, r1, 0 +_0817BF3C: + ldrh r1, [r6, 0x26] + movs r0, 0x78 + ands r0, r1 + lsls r0, 1 + lsls r1, r4, 6 + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl sub_817BB38 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _0817BF3C +_0817BF5A: + ldr r0, =0x03005e00 + adds r1, r7, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _0817BF78 + .pool +_0817BF70: + movs r0, 0x60 + strh r0, [r1, 0x26] + ldr r0, =sub_817BF84 + str r0, [r1] +_0817BF78: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817BF14 + + thumb_func_start sub_817BF84 +sub_817BF84: @ 817BF84 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r1 + ldrh r3, [r1, 0x26] + movs r4, 0x26 + ldrsh r0, [r1, r4] + cmp r0, 0 + beq _0817BFA8 + subs r0, r3, 0x1 + strh r0, [r1, 0x26] + b _0817BFAE + .pool +_0817BFA8: + adds r0, r2, 0 + bl DestroyTask +_0817BFAE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_817BF84 + + thumb_func_start sub_817BFB4 +sub_817BFB4: @ 817BFB4 + push {lr} + ldr r0, =sub_817BFCC + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_817BFB4 + + thumb_func_start sub_817BFCC +sub_817BFCC: @ 817BFCC + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_817BA44 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x26] + ldr r1, =sub_817C000 + str r1, [r0] + movs r0, 0xB7 + bl audio_play + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817BFCC + + thumb_func_start sub_817C000 +sub_817C000: @ 817C000 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 3 + adds r1, r0, r1 + movs r3, 0x26 + ldrsh r0, [r1, r3] + cmp r0, 0x5F + bgt _0817C048 + adds r6, r2, 0 + cmp r0, 0x5 + bgt _0817C032 + movs r4, 0 +_0817C020: + lsls r0, r4, 28 + lsrs r0, 24 + bl sub_817BC08 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x8 + bls _0817C020 +_0817C032: + ldr r0, =0x03005e00 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _0817C04C + .pool +_0817C048: + ldr r0, =sub_817C058 + str r0, [r1] +_0817C04C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C000 + + thumb_func_start sub_817C058 +sub_817C058: @ 817C058 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + pop {r0} + bx r0 + thumb_func_end sub_817C058 + + thumb_func_start sub_817C068 +sub_817C068: @ 817C068 + push {lr} + ldr r0, =sub_817C080 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_817C068 + + thumb_func_start sub_817C080 +sub_817C080: @ 817C080 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_817BA44 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x26] + ldr r1, =sub_817C0B4 + str r1, [r0] + movs r0, 0x66 + bl audio_play + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C080 + + thumb_func_start sub_817C0B4 +sub_817C0B4: @ 817C0B4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 3 + adds r1, r0, r1 + movs r3, 0x26 + ldrsh r0, [r1, r3] + cmp r0, 0x2F + bgt _0817C124 + adds r6, r2, 0 + cmp r0, 0 + bne _0817C0E8 + movs r4, 0 +_0817C0D4: + lsls r0, r4, 28 + lsrs r0, 24 + movs r1, 0x4 + bl sub_817BCB8 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _0817C0D4 +_0817C0E8: + ldr r0, =0x03005e00 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + movs r2, 0x26 + ldrsh r0, [r1, r2] + cmp r0, 0x20 + bne _0817C10E + movs r4, 0 +_0817C0FA: + lsls r0, r4, 28 + lsrs r0, 24 + movs r1, 0x8 + bl sub_817BCB8 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _0817C0FA +_0817C10E: + ldr r0, =0x03005e00 + adds r1, r6, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _0817C128 + .pool +_0817C124: + ldr r0, =sub_817C134 + str r0, [r1] +_0817C128: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C0B4 + + thumb_func_start sub_817C134 +sub_817C134: @ 817C134 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + pop {r0} + bx r0 + thumb_func_end sub_817C134 + + thumb_func_start sub_817C144 +sub_817C144: @ 817C144 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =sub_817C174 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0xC] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817C144 + + thumb_func_start sub_817C174 +sub_817C174: @ 817C174 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_817BA44 + ldr r0, =0x03005e00 + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + adds r5, r0 + movs r0, 0 + strh r0, [r5, 0x26] + ldr r0, =0x02037b54 + ldr r1, =0x02037754 + movs r2, 0x30 + bl CpuSet + ldr r0, =0xfff9041c + ldr r1, =0x00007fff + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_817C1D4 + str r0, [r5] + movs r0, 0xCA + bl audio_play + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C174 + + thumb_func_start sub_817C1D4 +sub_817C1D4: @ 817C1D4 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x03005e00 + lsls r5, r6, 2 + adds r0, r5, r6 + lsls r0, 3 + adds r1, r0, r1 + movs r0, 0x26 + ldrsh r2, [r1, r0] + cmp r2, 0x7F + bgt _0817C250 + adds r0, r2, 0 + cmp r0, 0 + beq _0817C210 + cmp r0, 0x20 + beq _0817C224 + cmp r2, 0x31 + bgt _0817C234 + bl GenerateRandomNumber + movs r1, 0x7 + ands r0, r1 + bl sub_817BDF0 + b _0817C234 + .pool +_0817C210: + movs r4, 0 +_0817C212: + adds r0, r4, 0 + bl sub_817BDF0 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _0817C212 + b _0817C234 +_0817C224: + ldr r0, =0xffff041c + ldr r1, =0x00007fff + str r1, [sp] + movs r1, 0x10 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe +_0817C234: + ldr r0, =0x03005e00 + adds r1, r5, r6 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _0817C254 + .pool +_0817C250: + ldr r0, =sub_817C260 + str r0, [r1] +_0817C254: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C1D4 + + thumb_func_start sub_817C260 +sub_817C260: @ 817C260 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0817C278 + adds r0, r2, 0 + bl DestroyTask +_0817C278: + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C260 + + thumb_func_start sub_817C280 +sub_817C280: @ 817C280 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =sub_817C2B0 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0xC] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817C280 + + thumb_func_start sub_817C2B0 +sub_817C2B0: @ 817C2B0 + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_817BA44 + ldr r0, =0x03005e00 + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + adds r5, r0 + movs r0, 0 + strh r0, [r5, 0x26] + ldr r0, =0x02037b54 + ldr r1, =0x02037754 + movs r2, 0x30 + bl CpuSet + ldr r0, =0xfff90400 + ldr r1, =0x00007fff + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_817C310 + str r0, [r5] + movs r0, 0xCA + bl audio_play + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C2B0 + + thumb_func_start sub_817C310 +sub_817C310: @ 817C310 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x03005e00 + lsls r5, r6, 2 + adds r0, r5, r6 + lsls r0, 3 + adds r1, r0, r1 + movs r0, 0x26 + ldrsh r2, [r1, r0] + cmp r2, 0x7F + bgt _0817C38C + adds r0, r2, 0 + cmp r0, 0 + beq _0817C34C + cmp r0, 0x20 + beq _0817C360 + cmp r2, 0x31 + bgt _0817C370 + bl GenerateRandomNumber + movs r1, 0x7 + ands r0, r1 + bl sub_817BDF0 + b _0817C370 + .pool +_0817C34C: + movs r4, 0 +_0817C34E: + adds r0, r4, 0 + bl sub_817BDF0 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _0817C34E + b _0817C370 +_0817C360: + ldr r0, =0xffff0400 + ldr r1, =0x00007fff + str r1, [sp] + movs r1, 0x10 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe +_0817C370: + ldr r0, =0x03005e00 + adds r1, r5, r6 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _0817C390 + .pool +_0817C38C: + ldr r0, =sub_817C260 + str r0, [r1] +_0817C390: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C310 + + thumb_func_start nullsub_68 +nullsub_68: @ 817C39C + bx lr + thumb_func_end nullsub_68 + + thumb_func_start sub_817C3A0 +sub_817C3A0: @ 817C3A0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + movs r1, 0 + ldr r3, =sub_817C4EC + ldr r2, =0x00007fff +_0817C3BA: + lsls r0, r1, 1 + add r0, sp + adds r0, 0x4 + strh r2, [r0] + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0xF + bls _0817C3BA + adds r0, r3, 0 + movs r1, 0 + bl CreateTask + mov r8, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =0x03005e00 + mov r1, r8 + lsls r6, r1, 2 + add r6, r8 + lsls r6, 3 + adds r6, r0 + strh r5, [r6, 0xA] + strh r7, [r6, 0xC] + movs r1, 0x80 + lsls r1, 1 + strh r1, [r6, 0xE] + movs r0, 0x10 + strh r0, [r6, 0x10] + movs r4, 0x80 + lsls r4, 9 + str r1, [sp] + movs r0, 0x1E + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + movs r0, 0x10 + ldrsh r1, [r6, r0] + adds r0, r4, 0 + bl __divsi3 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + movs r0, 0x1F + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + ldr r1, =0x02020630 + mov r9, r1 + lsls r2, r5, 4 + adds r2, r5 + lsls r2, 2 + mov r3, r9 + adds r3, 0x1C + adds r0, r2, r3 + ldr r1, =nullsub_68 + str r1, [r0] + add r2, r9 + ldrb r1, [r2, 0x1] + movs r4, 0x4 + negs r4, r4 + adds r0, r4, 0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x1] + ldrb r1, [r2, 0x3] + movs r0, 0x3F + negs r0, r0 + ands r0, r1 + movs r1, 0x3C + orrs r0, r1 + strb r0, [r2, 0x3] + movs r0, 0x3E + adds r0, r2 + mov r10, r0 + ldrb r1, [r0] + movs r5, 0x5 + negs r5, r5 + adds r0, r5, 0 + ands r0, r1 + mov r1, r10 + strb r0, [r1] + ldrb r1, [r2, 0x5] + lsrs r1, 4 + lsls r1, 5 + ldr r0, =0x02037d14 + mov r10, r0 + add r1, r10 + add r0, sp, 0x4 + movs r2, 0x10 + str r3, [sp, 0x24] + bl CpuSet + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + ldr r3, [sp, 0x24] + adds r3, r1, r3 + ldr r0, =nullsub_68 + str r0, [r3] + add r1, r9 + ldrb r0, [r1, 0x1] + ands r4, r0 + movs r0, 0x1 + orrs r4, r0 + strb r4, [r1, 0x1] + ldrb r0, [r1, 0x3] + movs r2, 0x3E + orrs r0, r2 + strb r0, [r1, 0x3] + adds r2, r1, 0 + adds r2, 0x3E + ldrb r0, [r2] + ands r5, r0 + strb r5, [r2] + ldrb r1, [r1, 0x5] + lsrs r1, 4 + lsls r1, 5 + add r1, r10 + add r0, sp, 0x4 + movs r2, 0x10 + bl CpuSet + movs r1, 0 + strh r1, [r6, 0x18] + mov r0, r8 + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817C3A0 + + thumb_func_start sub_817C4EC +sub_817C4EC: @ 817C4EC + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x12] + movs r0, 0x8 + strh r0, [r1, 0x14] + ldr r0, =sub_817C510 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_817C4EC + + thumb_func_start sub_817C510 +sub_817C510: @ 817C510 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r2, r0, r1 + movs r1, 0x18 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0817C534 + adds r0, r3, 0 + bl sub_817C72C + b _0817C556 + .pool +_0817C534: + ldrh r1, [r2, 0x14] + movs r4, 0x14 + ldrsh r0, [r2, r4] + cmp r0, 0x80 + bne _0817C546 + adds r0, r3, 0 + bl sub_817C67C + b _0817C556 +_0817C546: + adds r0, r1, 0x2 + strh r0, [r2, 0x14] + ldrh r0, [r2, 0x12] + movs r1, 0x1 + eors r0, r1 + strh r0, [r2, 0x12] + ldr r0, =sub_817C560 + str r0, [r2] +_0817C556: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C510 + + thumb_func_start sub_817C560 +sub_817C560: @ 817C560 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + movs r3, 0x18 + ldrsh r0, [r2, r3] + adds r5, r1, 0 + cmp r0, 0 + beq _0817C58C + ldr r0, =sub_817C72C + str r0, [r2] + b _0817C670 + .pool +_0817C58C: + movs r6, 0 + movs r7, 0x12 + ldrsh r0, [r2, r7] + cmp r0, 0 + bne _0817C5DC + movs r0, 0xE + ldrsh r1, [r2, r0] + movs r3, 0x14 + ldrsh r0, [r2, r3] + movs r3, 0x80 + lsls r3, 1 + subs r0, r3, r0 + cmp r1, r0 + bge _0817C5B2 + ldrh r0, [r2, 0x14] + ldrh r7, [r2, 0xE] + adds r0, r7 + strh r0, [r2, 0xE] + b _0817C5B6 +_0817C5B2: + strh r3, [r2, 0xE] + movs r6, 0x1 +_0817C5B6: + lsls r2, r4, 2 + adds r0, r2, r4 + lsls r0, 3 + adds r3, r0, r5 + movs r0, 0x10 + ldrsh r1, [r3, r0] + movs r7, 0x14 + ldrsh r0, [r3, r7] + adds r0, 0x10 + cmp r1, r0 + ble _0817C5D6 + ldrh r0, [r3, 0x10] + ldrh r1, [r3, 0x14] + subs r0, r1 + strh r0, [r3, 0x10] + b _0817C626 +_0817C5D6: + movs r0, 0x10 + strh r0, [r3, 0x10] + b _0817C620 +_0817C5DC: + movs r0, 0x10 + ldrsh r1, [r2, r0] + movs r3, 0x14 + ldrsh r0, [r2, r3] + movs r3, 0x80 + lsls r3, 1 + subs r0, r3, r0 + cmp r1, r0 + bge _0817C5F8 + ldrh r0, [r2, 0x14] + ldrh r7, [r2, 0x10] + adds r0, r7 + strh r0, [r2, 0x10] + b _0817C5FC +_0817C5F8: + strh r3, [r2, 0x10] + movs r6, 0x1 +_0817C5FC: + lsls r2, r4, 2 + adds r0, r2, r4 + lsls r0, 3 + adds r3, r0, r5 + movs r0, 0xE + ldrsh r1, [r3, r0] + movs r7, 0x14 + ldrsh r0, [r3, r7] + adds r0, 0x10 + cmp r1, r0 + ble _0817C61C + ldrh r0, [r3, 0xE] + ldrh r1, [r3, 0x14] + subs r0, r1 + strh r0, [r3, 0xE] + b _0817C626 +_0817C61C: + movs r0, 0x10 + strh r0, [r3, 0xE] +_0817C620: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0817C626: + adds r0, r2, r4 + lsls r0, 3 + adds r5, r0, r5 + movs r0, 0xE + ldrsh r1, [r5, r0] + movs r4, 0x80 + lsls r4, 9 + adds r0, r4, 0 + bl __divsi3 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + movs r0, 0x1E + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + movs r3, 0x10 + ldrsh r1, [r5, r3] + adds r0, r4, 0 + bl __divsi3 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + movs r0, 0x1F + movs r2, 0 + movs r3, 0 + bl SetSpriteTransformationMatrix + cmp r6, 0x2 + bne _0817C670 + ldr r0, =sub_817C510 + str r0, [r5] +_0817C670: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C560 + + thumb_func_start sub_817C67C +sub_817C67C: @ 817C67C + push {r4-r6,lr} + mov r6, r8 + push {r6} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02020630 + mov r8, r1 + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r2, 0xA + ldrsh r1, [r4, r2] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + add r2, r8 + ldrb r3, [r2, 0x1] + movs r6, 0x4 + negs r6, r6 + adds r1, r6, 0 + ands r1, r3 + strb r1, [r2, 0x1] + movs r2, 0xA + ldrsh r1, [r4, r2] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + add r2, r8 + ldrb r3, [r2, 0x3] + movs r5, 0x3F + negs r5, r5 + adds r1, r5, 0 + ands r1, r3 + strb r1, [r2, 0x3] + movs r1, 0xA + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + adds r1, 0x3E + ldrb r2, [r1] + movs r3, 0x4 + orrs r2, r3 + strb r2, [r1] + movs r1, 0xC + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x1] + ands r6, r2 + strb r6, [r1, 0x1] + movs r1, 0xC + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x3] + ands r5, r2 + strb r5, [r1, 0x3] + movs r1, 0xC + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + ands r2, r3 + strb r2, [r1] + bl DestroyTask + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C67C + + thumb_func_start sub_817C72C +sub_817C72C: @ 817C72C + push {r4-r6,lr} + mov r6, r8 + push {r6} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02020630 + mov r8, r1 + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r2, 0xA + ldrsh r1, [r4, r2] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + add r2, r8 + ldrb r3, [r2, 0x1] + movs r6, 0x4 + negs r6, r6 + adds r1, r6, 0 + ands r1, r3 + strb r1, [r2, 0x1] + movs r2, 0xA + ldrsh r1, [r4, r2] + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + add r2, r8 + ldrb r3, [r2, 0x3] + movs r5, 0x3F + negs r5, r5 + adds r1, r5, 0 + ands r1, r3 + strb r1, [r2, 0x3] + movs r1, 0xA + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + adds r1, 0x3E + ldrb r3, [r1] + movs r2, 0x5 + negs r2, r2 + ands r2, r3 + strb r2, [r1] + movs r1, 0xC + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x1] + ands r6, r2 + strb r6, [r1, 0x1] + movs r1, 0xC + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + ldrb r2, [r1, 0x3] + ands r5, r2 + strb r5, [r1, 0x3] + movs r1, 0xC + ldrsh r2, [r4, r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + add r1, r8 + adds r1, 0x3E + ldrb r2, [r1] + movs r3, 0x4 + orrs r2, r3 + strb r2, [r1] + bl DestroyTask + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C72C + + thumb_func_start sub_817C7DC +sub_817C7DC: @ 817C7DC + ldr r2, =gUnknown_0860A320 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + lsls r1, 1 + adds r1, r0 + movs r2, 0 + ldrsh r0, [r1, r2] + bx lr + .pool + thumb_func_end sub_817C7DC + + thumb_func_start sub_817C7F4 +sub_817C7F4: @ 817C7F4 + push {r4,r5,lr} + lsls r4, r0, 16 + lsrs r5, r4, 16 + adds r0, r5, 0 + bl sub_811EB10 + lsls r0, 24 + cmp r0, 0 + beq _0817C810 + ldr r0, =gUnknown_0860A3AC + b _0817C84E + .pool +_0817C810: + lsrs r0, r4, 25 + ldr r2, =0x000001ff + ands r2, r5 + cmp r0, 0x13 + bhi _0817C828 + cmp r0, 0x12 + bcs _0817C834 + cmp r0, 0 + beq _0817C82C + b _0817C83C + .pool +_0817C828: + cmp r0, 0x15 + bne _0817C83C +_0817C82C: + ldr r1, =gUnknown_085F5494 + b _0817C844 + .pool +_0817C834: + ldr r1, =gUnknown_085FA1D8 + b _0817C844 + .pool +_0817C83C: + ldr r1, =gUnknown_0860A168 + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] +_0817C844: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 4 + adds r1, r0 + adds r0, r1, 0 +_0817C84E: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_817C7F4 + + thumb_func_start sub_817C858 +sub_817C858: @ 817C858 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + lsls r1, 16 + lsrs r7, r1, 16 + movs r0, 0 + strh r0, [r5, 0x4] + movs r6, 0 + ldr r0, =gUnknown_0860A3DC + mov r8, r0 + adds r4, r5, 0 + adds r4, 0x18 +_0817C872: + lsls r0, r6, 3 + ldr r1, [r5, 0x30] + adds r2, r1, r0 + ldrb r0, [r2] + cmp r0, 0xFF + beq _0817C8A0 + movs r1, 0x1 + ldrsb r1, [r2, r1] + lsls r0, 2 + add r0, r8 + ldr r0, [r0] + adds r1, r0 + strh r1, [r4] + adds r0, r7, 0 + adds r0, 0x1E + adds r1, r6, 0 + bl sub_817C7DC + strh r0, [r4, 0x2] + ldrh r0, [r4] + ldrh r1, [r5, 0x4] + adds r0, r1 + strh r0, [r5, 0x4] +_0817C8A0: + adds r4, 0x4 + adds r6, 0x1 + cmp r6, 0x5 + ble _0817C872 + movs r0, 0 + strb r0, [r5, 0x1] + strh r0, [r5, 0xA] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817C858 + + thumb_func_start sub_817C8BC +sub_817C8BC: @ 817C8BC + push {lr} + ldr r0, =0x02037318 + ldrb r0, [r0, 0x17] + bl is_light_level_1_2_3_or_6 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0817C8D8 + movs r0, 0 + b _0817C8E6 + .pool +_0817C8D8: + ldr r1, =0x03005db0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =0x0203ceec + ldr r0, =hm_teleport_run_dp02scr + str r0, [r1] + movs r0, 0x1 +_0817C8E6: + pop {r1} + bx r1 + .pool + thumb_func_end sub_817C8BC + + thumb_func_start hm_teleport_run_dp02scr +hm_teleport_run_dp02scr: @ 817C8FC + push {lr} + bl sub_808469C + movs r0, 0x3F + bl FieldEffectStart + bl brm_get_pokemon_selection + ldr r1, =0x02038c08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end hm_teleport_run_dp02scr + + thumb_func_start sub_817C91C +sub_817C91C: @ 817C91C + push {lr} + bl oei_task_add + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =sub_817C94C + lsrs r0, r2, 16 + strh r0, [r1, 0x18] + strh r2, [r1, 0x1A] + movs r0, 0x1 + bl SetPlayerAvatarTransitionFlags + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_817C91C + + thumb_func_start sub_817C94C +sub_817C94C: @ 817C94C + push {lr} + movs r0, 0x3F + bl FieldEffectActiveListRemove + bl sub_80B7FC8 + pop {r0} + bx r0 + thumb_func_end sub_817C94C + + thumb_func_start sub_817C95C +sub_817C95C: @ 817C95C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0817C988 + ldr r0, [sp] + cmp r0, 0x1B + beq _0817C988 + cmp r0, 0xDD + beq _0817C988 + bl _0817E0A6 +_0817C988: + ldr r0, =0x0202449c + ldr r0, [r0] + movs r1, 0x81 + lsls r1, 2 + adds r7, r0, r1 + ldr r5, =0x0202420b + ldrb r0, [r5] + bl battle_side_get_owner + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0202420c + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x0202420e + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r0, =0x0203aba8 + ldr r0, [r0] + ldrb r0, [r0, 0x7] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + cmp r4, 0 + bne _0817CA00 + ldr r2, =0x0202406e + ldrb r0, [r5] + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + b _0817CA10 + .pool +_0817CA00: + ldr r2, =0x0202406e + ldrb r0, [r5] + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 +_0817CA10: + adds r1, r0 + str r1, [sp, 0x8] + cmp r6, 0 + bne _0817CA3C + ldr r0, =0x0202420c + ldrb r0, [r0] + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + b _0817CA4C + .pool +_0817CA3C: + ldr r0, =0x0202420c + ldrb r0, [r0] + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 +_0817CA4C: + adds r1, r0 + str r1, [sp, 0xC] + ldr r0, =0x0202420b + ldrb r0, [r0] + ldr r1, =0x0203aba8 + ldr r1, [r1] + ldrh r1, [r1] + bl sub_817F33C + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + cmp r0, 0x3 + bls _0817CA9C + ldr r0, [sp] + bl sub_817E0B8 + lsls r0, 24 + cmp r0, 0 + beq _0817CA9C + ldr r2, [sp] + cmp r2, 0xC + bls _0817CA9C + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r7, r0 + adds r0, 0x57 + ldrb r1, [r0] + movs r2, 0x1E + bl _0817E0A2 + .pool +_0817CA9C: + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 25 + mov r8, r0 + ldr r0, =0x0202420c + ldrb r0, [r0] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r5, r0, 25 + ldr r0, =0x0202420e + ldrb r0, [r0] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r3, r0, 25 + ldr r1, [sp] + subs r1, 0x2 + movs r0, 0xB0 + lsls r0, 1 + cmp r1, r0 + bls _0817CAD2 + bl _0817E0A6 +_0817CAD2: + lsls r0, r1, 2 + ldr r1, =_0817CAEC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0817CAEC: + .4byte _0817DD7A + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D070 + .4byte _0817DD74 + .4byte _0817DD80 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817DA68 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D7D8 + .4byte _0817E0A6 + .4byte _0817D8A4 + .4byte _0817E0A6 + .4byte _0817D838 + .4byte _0817E0A6 + .4byte _0817D704 + .4byte _0817E0A6 + .4byte _0817D76C + .4byte _0817DB24 + .4byte _0817E0A6 + .4byte _0817DB90 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D9C2 + .4byte _0817E0A6 + .4byte _0817DA24 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817DBD4 + .4byte _0817E0A6 + .4byte _0817D94C + .4byte _0817E0A6 + .4byte _0817D994 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E040 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817DE10 + .4byte _0817DDC8 + .4byte _0817DEDC + .4byte _0817DF24 + .4byte _0817DF4E + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D65E + .4byte _0817D65E + .4byte _0817D65E + .4byte _0817D65E + .4byte _0817D698 + .4byte _0817E0A6 + .4byte _0817E08E + .4byte _0817DF70 + .4byte _0817DFBC + .4byte _0817E0A6 + .4byte _0817E08E + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D53C + .4byte _0817E0A6 + .4byte _0817D584 + .4byte _0817DACC + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D3A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D296 + .4byte _0817D2E4 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D5CE + .4byte _0817D608 + .4byte _0817D498 + .4byte _0817D4E0 + .4byte _0817DC62 + .4byte _0817DC98 + .4byte _0817E0A6 + .4byte _0817D1B8 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817DCDC + .4byte _0817E0A6 + .4byte _0817D0DC + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D1E0 + .4byte _0817D314 + .4byte _0817D354 + .4byte _0817D372 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D216 + .4byte _0817D260 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D3C0 + .4byte _0817D3F2 + .4byte _0817D440 + .4byte _0817D45C + .4byte _0817D3B8 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D098 + .4byte _0817D0D4 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817DC20 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D16C + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817DD38 + .4byte _0817DCFC + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D65E + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817D124 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817E0A6 + .4byte _0817DE58 + .4byte _0817DDC8 + .4byte _0817DE10 + .4byte _0817DFE6 +_0817D070: + movs r0, 0x1 + mov r1, r10 + movs r2, 0x2 + movs r3, 0 + bl sub_817E684 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0817D08C + bl _0817E0A6 +_0817D08C: + bl sub_817EECC + bl _0817E0A6 + .pool +_0817D098: + movs r0, 0x1 + mov r1, r10 + movs r2, 0x1 + movs r3, 0 + bl sub_817E684 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0817D0B4 + bl _0817E0A6 +_0817D0B4: + ldr r0, [sp, 0xC] + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0817D0C6 + bl _0817E0A6 +_0817D0C6: + bl sub_817EECC + bl _0817E0A6 + .pool +_0817D0D4: + movs r0, 0x1 + mov r1, r10 + movs r2, 0 + b _0817D48E +_0817D0DC: + lsls r3, r4, 1 + adds r3, r4 + lsls r3, 2 + adds r3, r7, r3 + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + adds r0, 0x1 + movs r1, 0x7 + ands r0, r1 + lsls r0, 15 + ldr r1, [r3, 0x50] + ldr r2, =0xfffc7fff + ands r1, r2 + orrs r1, r0 + str r1, [r3, 0x50] + adds r3, 0x55 + movs r0, 0x3 + mov r1, r10 + ands r1, r0 + lsls r1, 2 + ldrb r2, [r3] + movs r0, 0xD + negs r0, r0 + bl _0817DC0C + .pool +_0817D124: + lsls r2, r4, 1 + adds r2, r4 + lsls r2, 2 + adds r2, r7, r2 + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x52 + movs r0, 0x7 + ands r1, r0 + lsls r1, 2 + ldrb r3, [r4] + movs r0, 0x1D + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r2, 0x55 + movs r0, 0x3 + mov r1, r10 + ands r1, r0 + lsls r1, 4 + ldrb r3, [r2] + movs r0, 0x31 + negs r0, r0 + bl _0817DFAA + .pool +_0817D16C: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r5, r7, r0 + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r3, r5, 0 + adds r3, 0x52 + lsls r1, 5 + ldrb r2, [r3] + movs r0, 0x1F + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + adds r4, r5, 0 + adds r4, 0x55 + mov r0, r10 + lsls r2, r0, 6 + ldrb r1, [r4] + movs r0, 0x3F + ands r0, r1 + orrs r0, r2 + strb r0, [r4] + adds r2, r5, 0 + adds r2, 0x58 + ldrb r0, [r2] + movs r1, 0x40 + bl _0817DFAC + .pool +_0817D1B8: + ldr r1, =0x02022f5c + ldrb r0, [r1] + cmp r0, 0 + beq _0817D1C4 + bl _0817E0A6 +_0817D1C4: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r7, r0 + adds r0, 0x57 + ldrb r2, [r0] + movs r1, 0x1F + negs r1, r1 + ands r1, r2 + movs r2, 0x14 + bl _0817E0A2 + .pool +_0817D1E0: + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r3, r7, r0 + adds r0, r3, 0 + adds r0, 0x53 + ldrb r0, [r0] + lsls r0, 29 + lsrs r0, 29 + cmp r0, 0 + bne _0817D1FA + bl _0817E0A6 +_0817D1FA: + adds r2, r6, 0 + subs r1, r0, 0x1 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x56 + ldrb r3, [r0] + lsls r3, 30 + lsrs r3, 30 + adds r3, r1 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x2 + bl _0817DB10 +_0817D216: + lsls r2, r4, 1 + adds r2, r4 + lsls r2, 2 + adds r2, r7, r2 + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x53 + movs r0, 0x7 + ands r1, r0 + lsls r1, 3 + ldrb r3, [r4] + movs r0, 0x39 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r2, 0x56 + movs r0, 0x3 + mov r1, r10 + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0xD + negs r0, r0 + bl _0817DFAA + .pool +_0817D260: + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r3, r7, r0 + adds r0, r3, 0 + adds r0, 0x53 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 29 + cmp r0, 0 + bne _0817D27A + bl _0817E0A6 +_0817D27A: + adds r2, r6, 0 + subs r1, r0, 0x1 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x56 + ldrb r3, [r0] + lsls r3, 28 + lsrs r3, 30 + adds r3, r1 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x2 + bl _0817DBC2 +_0817D296: + lsls r2, r4, 1 + adds r2, r4 + lsls r2, 2 + adds r2, r7, r2 + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r2, 0x56 + movs r0, 0x7 + ands r1, r0 + lsls r1, 4 + ldrb r3, [r2] + movs r0, 0x71 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x3 + mov r1, r10 + ands r1, r0 + lsls r1, 7 + ldrh r3, [r2] + ldr r0, =0xfffffe7f + ands r0, r3 + orrs r0, r1 + strh r0, [r2] + bl _0817E0A6 + .pool +_0817D2E4: + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r0, r7, r0 + adds r0, 0x56 + ldrb r0, [r0] + lsls r0, 25 + lsrs r0, 29 + cmp r0, 0 + bne _0817D2FC + bl _0817E0A6 +_0817D2FC: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r7, r0 + adds r0, 0x57 + ldrb r2, [r0] + movs r1, 0x1F + negs r1, r1 + ands r1, r2 + movs r2, 0x16 + bl _0817E0A2 +_0817D314: + mov r2, r8 + lsls r3, r2, 3 + lsls r0, r4, 4 + adds r3, r0 + adds r3, r7, r3 + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r3, 0x35 + movs r0, 0x7 + ands r1, r0 + ldrb r2, [r3] + movs r0, 0x8 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + movs r2, 0x3 + mov r1, r10 + ands r1, r2 + lsls r1, 3 + movs r2, 0x19 + negs r2, r2 + bl _0817DC0C + .pool +_0817D354: + mov r1, r8 + lsls r0, r1, 3 + lsls r1, r4, 4 + adds r0, r1 + adds r0, r7, r0 + adds r0, 0x35 + ldrb r1, [r0] + lsls r0, r1, 29 + lsrs r0, 29 + cmp r0, 0 + bne _0817D36E + bl _0817E0A6 +_0817D36E: + adds r2, r4, 0 + b _0817D38C +_0817D372: + lsls r0, r5, 3 + lsls r1, r6, 4 + adds r0, r1 + adds r0, r7, r0 + adds r0, 0x35 + ldrb r1, [r0] + lsls r0, r1, 29 + lsrs r0, 29 + cmp r0, 0 + bne _0817D38A + bl _0817E0A6 +_0817D38A: + adds r2, r6, 0 +_0817D38C: + subs r0, 0x1 + lsls r0, 2 + lsls r3, r1, 27 + lsrs r3, 30 + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x2 + movs r1, 0x6 + bl sub_817E684 + bl _0817E0A6 +_0817D3A6: + ldr r0, =0x0202449c + ldr r0, [r0] + adds r0, 0xB3 + movs r1, 0x1 + bl _0817E0A4 + .pool +_0817D3B8: + movs r0, 0x12 + mov r1, r10 + movs r2, 0 + b _0817D48E +_0817D3C0: + ldr r0, =0x02022f58 + ldrb r2, [r0, 0x2] + cmp r2, 0 + bne _0817D3CC + bl _0817E0A6 +_0817D3CC: + ldr r1, =0x02022f6a + ldrh r0, [r1] + cmp r0, 0xD1 + bne _0817D3E8 + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x17 + b _0817D48C + .pool +_0817D3E8: + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x16 + b _0817D48C +_0817D3F2: + ldr r0, =0x02022f58 + ldrb r2, [r0, 0x2] + cmp r2, 0 + bne _0817D3FE + bl _0817E0A6 +_0817D3FE: + ldr r0, =0x0202420b + ldr r1, =0x0202420c + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bne _0817D436 + ldr r1, =0x02022f6a + ldrh r0, [r1] + cmp r0, 0xD1 + bne _0817D42C + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x17 + b _0817D48C + .pool +_0817D42C: + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x16 + b _0817D48C +_0817D436: + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1B + b _0817D48C +_0817D440: + ldr r0, =0x02022f58 + ldrb r2, [r0, 0x2] + cmp r2, 0 + bne _0817D44C + bl _0817E0A6 +_0817D44C: + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x18 + b _0817D48C + .pool +_0817D45C: + ldr r0, =0x02022f58 + ldrb r2, [r0, 0x2] + cmp r2, 0 + bne _0817D468 + bl _0817E0A6 +_0817D468: + ldr r1, =0x02022f6a + ldrh r0, [r1] + cmp r0, 0xD3 + bne _0817D484 + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1A + b _0817D48C + .pool +_0817D484: + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x19 +_0817D48C: + mov r1, r10 +_0817D48E: + movs r3, 0 + bl sub_817E684 + bl _0817E0A6 +_0817D498: + lsls r2, r5, 3 + lsls r0, r6, 4 + adds r2, r0 + adds r2, r7, r2 + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x30 + movs r0, 0x7 + ands r1, r0 + ldrb r3, [r4] + movs r0, 0x8 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r2, 0x32 + movs r0, 0x3 + mov r1, r10 + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0xD + negs r0, r0 + bl _0817DFAA + .pool +_0817D4E0: + ldr r0, [sp, 0x8] + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0817D4F2 + bl _0817E0A6 +_0817D4F2: + mov r2, r8 + lsls r0, r2, 3 + lsls r1, r4, 4 + adds r0, r1 + adds r1, r7, r0 + adds r0, r1, 0 + adds r0, 0x30 + ldrb r0, [r0] + lsls r0, 29 + lsrs r0, 29 + cmp r0, 0 + bne _0817D50E + bl _0817E0A6 +_0817D50E: + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r0, r1, 0 + adds r0, 0x32 + ldrb r3, [r0] + lsls r3, 28 + lsrs r3, 30 + movs r0, 0x8 + movs r1, 0 + bl sub_817E684 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r1, r7, r1 + adds r1, 0x57 + ldrb r2, [r1] + movs r0, 0x1F + negs r0, r0 + ands r0, r2 + movs r2, 0x2 + b _0817D6F2 +_0817D53C: + lsls r2, r5, 3 + lsls r0, r6, 4 + adds r2, r0 + adds r2, r7, r2 + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x30 + movs r0, 0x7 + ands r1, r0 + lsls r1, 3 + ldrb r3, [r4] + movs r0, 0x39 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r2, 0x32 + movs r0, 0x3 + mov r1, r10 + ands r1, r0 + lsls r1, 4 + ldrb r3, [r2] + movs r0, 0x31 + negs r0, r0 + bl _0817DFAA + .pool +_0817D584: + mov r1, r8 + lsls r0, r1, 3 + lsls r1, r4, 4 + adds r0, r1 + adds r1, r7, r0 + adds r0, r1, 0 + adds r0, 0x30 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 29 + cmp r0, 0 + bne _0817D5A0 + bl _0817E0A6 +_0817D5A0: + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r0, r1, 0 + adds r0, 0x32 + ldrb r3, [r0] + lsls r3, 26 + lsrs r3, 30 + movs r0, 0x8 + movs r1, 0x1 + bl sub_817E684 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r1, r7, r1 + adds r1, 0x57 + ldrb r2, [r1] + movs r0, 0x1F + negs r0, r0 + ands r0, r2 + movs r2, 0x4 + b _0817D6F2 +_0817D5CE: + lsls r2, r5, 3 + lsls r0, r6, 4 + adds r2, r0 + adds r2, r7, r2 + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + movs r0, 0x7 + ands r1, r0 + lsls r1, 6 + ldrh r3, [r2, 0x30] + ldr r0, =0xfffffe3f + ands r0, r3 + orrs r0, r1 + strh r0, [r2, 0x30] + adds r2, 0x32 + bl _0817DF0A + .pool +_0817D608: + ldr r0, [sp, 0x8] + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0817D61A + bl _0817E0A6 +_0817D61A: + mov r1, r8 + lsls r0, r1, 3 + lsls r1, r4, 4 + adds r0, r1 + adds r1, r7, r0 + ldrh r0, [r1, 0x30] + lsls r0, 23 + lsrs r0, 29 + cmp r0, 0 + bne _0817D632 + bl _0817E0A6 +_0817D632: + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r0, r1, 0 + adds r0, 0x32 + ldrb r3, [r0] + lsrs r3, 6 + movs r0, 0x8 + movs r1, 0x5 + bl sub_817E684 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r1, r7, r1 + adds r1, 0x57 + ldrb r2, [r1] + movs r0, 0x1F + negs r0, r0 + ands r0, r2 + movs r2, 0xA + b _0817D6F2 +_0817D65E: + lsls r2, r5, 3 + lsls r0, r6, 4 + adds r2, r0 + adds r2, r7, r2 + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x31 + movs r0, 0x7 + ands r1, r0 + lsls r1, 1 + ldrb r3, [r4] + movs r0, 0xF + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r2, 0x33 + bl _0817DF9E + .pool +_0817D698: + ldr r0, [sp, 0x8] + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0817D6AA + bl _0817E0A6 +_0817D6AA: + mov r1, r8 + lsls r0, r1, 3 + lsls r1, r4, 4 + adds r0, r1 + adds r1, r7, r0 + adds r0, r1, 0 + adds r0, 0x31 + ldrb r0, [r0] + lsls r0, 28 + lsrs r0, 29 + cmp r0, 0 + bne _0817D6C6 + bl _0817E0A6 +_0817D6C6: + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r0, r1, 0 + adds r0, 0x33 + ldrb r3, [r0] + lsls r3, 30 + lsrs r3, 30 + movs r0, 0x8 + movs r1, 0x6 + bl sub_817E684 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r1, r7, r1 + adds r1, 0x57 + ldrb r2, [r1] + movs r0, 0x1F + negs r0, r0 + ands r0, r2 + movs r2, 0xC +_0817D6F2: + orrs r0, r2 + mov r2, r8 + lsls r3, r2, 5 + movs r2, 0x1F + ands r0, r2 + orrs r0, r3 + strb r0, [r1] + bl _0817E0A6 +_0817D704: + ldr r5, =0x0202406e + ldr r6, =0x0202420e + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r2, [r0] + lsls r2, 2 + mov r0, r9 + lsls r4, r0, 1 + add r4, r9 + lsls r4, 3 + adds r2, r4 + adds r2, r7, r2 + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + adds r1, 0x1 + movs r0, 0x7 + ands r1, r0 + lsls r1, 6 + ldrh r3, [r2] + ldr r0, =0xfffffe3f + ands r0, r3 + orrs r0, r1 + strh r0, [r2] + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + lsls r1, 2 + adds r1, r4 + adds r1, r7, r1 + mov r2, r10 + lsls r3, r2, 6 + ldrb r2, [r1, 0x2] + movs r0, 0x3F + ands r0, r2 + orrs r0, r3 + strb r0, [r1, 0x2] + bl _0817E0A6 + .pool +_0817D76C: + ldr r0, [sp, 0x8] + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0817D77E + bl _0817E0A6 +_0817D77E: + ldr r6, =0x0202406e + ldr r5, =0x0202420b + ldrb r0, [r5] + lsls r0, 1 + adds r0, r6 + ldrh r0, [r0] + lsls r0, 2 + lsls r1, r4, 1 + adds r4, r1, r4 + lsls r1, r4, 3 + adds r0, r1 + adds r1, r7, r0 + ldrh r0, [r1] + lsls r0, 23 + lsrs r0, 29 + cmp r0, 0 + beq _0817D7B2 + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r1, 0x2] + lsrs r3, 6 + movs r0, 0x8 + movs r1, 0x4 + bl sub_817E684 +_0817D7B2: + lsls r3, r4, 2 + adds r3, r7, r3 + adds r3, 0x57 + ldrb r0, [r3] + movs r1, 0x1F + negs r1, r1 + ands r1, r0 + movs r0, 0x8 + orrs r1, r0 + strb r1, [r3] + ldrb r0, [r5] + lsls r0, 1 + adds r0, r6 + b _0817D934 + .pool +_0817D7D8: + ldr r5, =0x0202406e + ldr r6, =0x0202420e + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r2, [r0] + lsls r2, 2 + mov r0, r9 + lsls r4, r0, 1 + add r4, r9 + lsls r4, 3 + adds r2, r4 + adds r2, r7, r2 + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + adds r1, 0x1 + movs r0, 0x7 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x8 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + lsls r1, 2 + adds r1, r4 + adds r1, r7, r1 + movs r0, 0x3 + mov r2, r10 + ands r2, r0 + lsls r2, 2 + ldrb r3, [r1, 0x2] + movs r0, 0xD + negs r0, r0 + b _0817D88C + .pool +_0817D838: + ldr r5, =0x0202406e + ldr r6, =0x0202420e + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r2, [r0] + lsls r2, 2 + mov r1, r9 + lsls r4, r1, 1 + add r4, r9 + lsls r4, 3 + adds r2, r4 + adds r2, r7, r2 + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + adds r1, 0x1 + movs r0, 0x7 + ands r1, r0 + lsls r1, 3 + ldrb r3, [r2] + movs r0, 0x39 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + lsls r1, 2 + adds r1, r4 + adds r1, r7, r1 + movs r0, 0x3 + mov r2, r10 + ands r2, r0 + lsls r2, 4 + ldrb r3, [r1, 0x2] + movs r0, 0x31 + negs r0, r0 +_0817D88C: + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x2] + bl _0817E0A6 + .pool +_0817D8A4: + ldr r0, [sp, 0x8] + movs r1, 0x39 + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0817D8B6 + bl _0817E0A6 +_0817D8B6: + ldr r2, =0x0202406e + mov r8, r2 + ldr r6, =0x0202420b + ldrb r0, [r6] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + lsls r0, 2 + lsls r1, r4, 1 + adds r5, r1, r4 + lsls r4, r5, 3 + adds r0, r4 + adds r1, r7, r0 + ldrb r0, [r1] + lsls r0, 29 + lsrs r0, 29 + cmp r0, 0 + beq _0817D8EE + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r1, 0x2] + lsls r3, 28 + lsrs r3, 30 + movs r0, 0x8 + movs r1, 0x2 + bl sub_817E684 +_0817D8EE: + ldrb r0, [r6] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r4 + adds r1, r7, r0 + ldrb r0, [r1] + lsls r0, 26 + lsrs r0, 29 + cmp r0, 0 + beq _0817D91A + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r1, 0x2] + lsls r3, 26 + lsrs r3, 30 + movs r0, 0x8 + movs r1, 0x3 + bl sub_817E684 +_0817D91A: + lsls r3, r5, 2 + adds r3, r7, r3 + adds r3, 0x57 + ldrb r0, [r3] + movs r1, 0x1F + negs r1, r1 + ands r1, r0 + movs r0, 0x6 + orrs r1, r0 + strb r1, [r3] + ldrb r0, [r6] + lsls r0, 1 + add r0, r8 +_0817D934: + ldrh r0, [r0] + lsls r0, 5 + movs r2, 0x1F + ands r1, r2 + orrs r1, r0 + strb r1, [r3] + b _0817E0A6 + .pool +_0817D94C: + lsls r2, r5, 3 + lsls r0, r6, 4 + adds r2, r0 + adds r2, r7, r2 + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x31 + movs r0, 0x7 + ands r1, r0 + lsls r1, 4 + ldrb r3, [r4] + movs r0, 0x71 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r2, 0x33 + movs r0, 0x3 + mov r1, r10 + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0xD + negs r0, r0 + b _0817DFAA + .pool +_0817D994: + mov r1, r8 + lsls r0, r1, 3 + lsls r1, r4, 4 + adds r0, r1 + adds r1, r7, r0 + adds r0, r1, 0 + adds r0, 0x31 + ldrb r0, [r0] + lsls r0, 25 + lsrs r0, 29 + cmp r0, 0 + bne _0817D9AE + b _0817E0A6 +_0817D9AE: + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r0, r1, 0 + adds r0, 0x33 + ldrb r3, [r0] + lsls r3, 28 + lsrs r3, 30 + movs r0, 0x9 + b _0817E086 +_0817D9C2: + ldr r5, =0x0202406e + ldr r6, =0x0202420e + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r2, [r0] + lsls r2, 2 + mov r0, r9 + lsls r4, r0, 1 + add r4, r9 + lsls r4, 3 + adds r2, r4 + adds r2, r7, r2 + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + adds r1, 0x1 + movs r0, 0x7 + ands r1, r0 + lsls r1, 1 + ldrb r3, [r2, 0x1] + movs r0, 0xF + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x1] + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + lsls r1, 2 + adds r1, r4 + adds r1, r7, r1 + movs r0, 0x3 + mov r2, r10 + ands r2, r0 + ldrb r3, [r1, 0x3] + movs r0, 0x4 + negs r0, r0 + b _0817DB76 + .pool +_0817DA24: + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 2 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + adds r1, r0 + adds r1, r7, r1 + ldrb r0, [r1, 0x1] + lsls r0, 28 + lsrs r0, 29 + cmp r0, 0 + bne _0817DA48 + b _0817E0A6 +_0817DA48: + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r1, 0x3] + lsls r3, 30 + lsrs r3, 30 + movs r0, 0x9 + movs r1, 0x2 + bl sub_817E684 + b _0817E0A6 + .pool +_0817DA68: + ldr r5, =0x0202406e + ldr r6, =0x0202420e + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r2, [r0] + lsls r2, 2 + mov r1, r9 + lsls r4, r1, 1 + add r4, r9 + lsls r4, 3 + adds r2, r4 + adds r2, r7, r2 + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + adds r1, 0x1 + movs r0, 0x7 + ands r1, r0 + lsls r1, 4 + ldrb r3, [r2, 0x1] + movs r0, 0x71 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x1] + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + lsls r1, 2 + adds r1, r4 + adds r1, r7, r1 + movs r0, 0x3 + mov r2, r10 + ands r2, r0 + lsls r2, 2 + ldrb r3, [r1, 0x3] + movs r0, 0xD + negs r0, r0 + b _0817DB76 + .pool +_0817DACC: + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 2 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + adds r1, r0 + adds r1, r7, r1 + ldrb r0, [r1, 0x1] + lsls r0, 25 + lsrs r2, r0, 29 + cmp r2, 0 + bne _0817DAF0 + b _0817E0A6 +_0817DAF0: + ldr r0, =0x0203aba8 + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0xAD + bne _0817DAFC + b _0817E0A6 +_0817DAFC: + cmp r0, 0xD6 + bne _0817DB02 + b _0817E0A6 +_0817DB02: + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r1, 0x3] + lsls r3, 28 + lsrs r3, 30 + movs r0, 0x9 +_0817DB10: + movs r1, 0x3 + bl sub_817E684 + b _0817E0A6 + .pool +_0817DB24: + ldr r5, =0x0202406e + ldr r6, =0x0202420e + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r3, [r0] + lsls r3, 2 + mov r2, r9 + lsls r4, r2, 1 + add r4, r9 + lsls r4, 3 + adds r3, r4 + adds r3, r7, r3 + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r5 + ldrh r0, [r0] + adds r0, 0x1 + movs r1, 0x7 + ands r0, r1 + lsls r0, 15 + ldr r1, [r3] + ldr r2, =0xfffc7fff + ands r1, r2 + orrs r1, r0 + str r1, [r3] + ldrb r0, [r6] + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + lsls r1, 2 + adds r1, r4 + adds r1, r7, r1 + movs r0, 0x3 + mov r2, r10 + ands r2, r0 + lsls r2, 4 + ldrb r3, [r1, 0x3] + movs r0, 0x31 + negs r0, r0 +_0817DB76: + ands r0, r3 + orrs r0, r2 + strb r0, [r1, 0x3] + b _0817E0A6 + .pool +_0817DB90: + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 2 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 3 + adds r1, r0 + adds r1, r7, r1 + ldr r0, [r1] + lsls r0, 14 + lsrs r0, 29 + cmp r0, 0 + bne _0817DBB4 + b _0817E0A6 +_0817DBB4: + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + ldrb r3, [r1, 0x3] + lsls r3, 26 + lsrs r3, 30 + movs r0, 0x9 +_0817DBC2: + movs r1, 0x4 + bl sub_817E684 + b _0817E0A6 + .pool +_0817DBD4: + lsls r3, 3 + mov r1, r9 + lsls r0, r1, 4 + adds r3, r0 + adds r3, r7, r3 + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + adds r0, 0x1 + movs r1, 0x7 + ands r0, r1 + lsls r0, 15 + ldr r1, [r3, 0x30] + ldr r2, =0xfffc7fff + ands r1, r2 + orrs r1, r0 + str r1, [r3, 0x30] + adds r3, 0x33 + movs r0, 0x3 + mov r1, r10 + ands r1, r0 + lsls r1, 4 + ldrb r2, [r3] + movs r0, 0x31 + negs r0, r0 +_0817DC0C: + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + b _0817E0A6 + .pool +_0817DC20: + mov r2, r8 + lsls r0, r2, 3 + lsls r1, r4, 4 + adds r0, r1 + adds r3, r7, r0 + ldr r0, [r3, 0x30] + lsls r0, 14 + lsrs r0, 29 + cmp r0, 0 + beq _0817DC4C + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r0, r3, 0 + adds r0, 0x33 + ldrb r3, [r0] + lsls r3, 26 + lsrs r3, 30 + movs r0, 0x9 + movs r1, 0x1 + bl sub_817E684 +_0817DC4C: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r7, r0 + adds r0, 0x57 + ldrb r2, [r0] + movs r1, 0x1F + negs r1, r1 + ands r1, r2 + movs r2, 0x18 + b _0817E0A2 +_0817DC62: + lsls r2, r6, 1 + adds r2, r6 + lsls r2, 2 + adds r2, r7, r2 + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x50 + movs r0, 0x7 + ands r1, r0 + ldrb r3, [r4] + movs r0, 0x8 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r2, 0x54 + b _0817DF9E + .pool +_0817DC98: + ldr r1, [sp, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r4, r7, r0 + adds r0, r4, 0 + adds r0, 0x50 + ldrb r0, [r0] + lsls r0, 29 + lsrs r2, r0, 29 + cmp r2, 0 + bne _0817DCB2 + b _0817E0A6 +_0817DCB2: + movs r0, 0x1 + eors r1, r0 + subs r2, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r0, 0x54 + ldrb r3, [r0] + lsls r3, 30 + lsrs r3, 30 + movs r0, 0xA + bl sub_817E684 + adds r2, r4, 0 + adds r2, 0x57 + ldrb r1, [r2] + movs r0, 0x1F + negs r0, r0 + ands r0, r1 + movs r1, 0xE + b _0817DFAC +_0817DCDC: + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r1, r7, r1 + adds r3, r1, 0 + adds r3, 0x50 + ldrb r2, [r3] + movs r0, 0x8 + negs r0, r0 + ands r0, r2 + strb r0, [r3] + adds r1, 0x54 + ldrb r2, [r1] + movs r0, 0x4 + negs r0, r0 + b _0817DF6A +_0817DCFC: + mov r0, r8 + lsls r2, r0, 3 + lsls r0, r4, 4 + adds r2, r0 + adds r2, r7, r2 + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x34 + movs r0, 0x7 + ands r1, r0 + ldrb r3, [r4] + movs r0, 0x8 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r2, 0x33 + mov r1, r10 + lsls r3, r1, 6 + b _0817DF0E + .pool +_0817DD38: + mov r0, r8 + lsls r2, r0, 3 + lsls r0, r4, 4 + adds r2, r0 + adds r2, r7, r2 + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r2, 0x34 + movs r0, 0x7 + ands r1, r0 + lsls r1, 3 + ldrb r3, [r2] + movs r0, 0x39 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + mov r1, r10 + lsls r3, r1, 6 + movs r1, 0x3F + b _0817DF12 + .pool +_0817DD74: + movs r0, 0 + bl sub_817EA80 +_0817DD7A: + mov r2, r8 + lsls r0, r2, 3 + b _0817DD88 +_0817DD80: + movs r0, 0x1 + bl sub_817EA80 + lsls r0, r5, 3 +_0817DD88: + lsls r1, r4, 4 + adds r0, r1 + adds r1, r7, r0 + adds r4, r1, 0 + adds r4, 0x34 + ldrb r5, [r4] + lsls r0, r5, 29 + cmp r0, 0 + beq _0817DDAE + movs r0, 0x8 + negs r0, r0 + ands r0, r5 + strb r0, [r4] + adds r2, r1, 0 + adds r2, 0x33 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2] +_0817DDAE: + ldrb r1, [r4] + lsls r0, r1, 26 + lsrs r0, 29 + cmp r0, 0 + bne _0817DDBA + b _0817E0A6 +_0817DDBA: + movs r0, 0x39 + negs r0, r0 + ands r0, r1 + movs r1, 0x3F + ands r0, r1 + strb r0, [r4] + b _0817E0A6 +_0817DDC8: + lsls r2, r4, 1 + adds r2, r4 + lsls r2, 2 + adds r2, r7, r2 + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x50 + movs r0, 0x7 + ands r1, r0 + lsls r1, 3 + ldrb r3, [r4] + movs r0, 0x39 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r2, 0x54 + movs r0, 0x3 + mov r1, r10 + ands r1, r0 + lsls r1, 2 + ldrb r3, [r2] + movs r0, 0xD + negs r0, r0 + b _0817DFAA + .pool +_0817DE10: + lsls r2, r4, 1 + adds r2, r4 + lsls r2, 2 + adds r2, r7, r2 + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x50 + movs r0, 0x7 + ands r1, r0 + lsls r1, 6 + ldrh r3, [r4] + ldr r0, =0xfffffe3f + ands r0, r3 + orrs r0, r1 + strh r0, [r4] + adds r2, 0x54 + movs r0, 0x3 + mov r1, r10 + ands r1, r0 + lsls r1, 4 + ldrb r3, [r2] + movs r0, 0x31 + negs r0, r0 + b _0817DFAA + .pool +_0817DE58: + ldr r1, =0x02022f5a + ldrh r0, [r1] + cmp r0, 0x73 + bne _0817DE82 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r1, r7, r1 + adds r3, r1, 0 + adds r3, 0x50 + ldrb r2, [r3] + movs r0, 0x39 + negs r0, r0 + ands r0, r2 + strb r0, [r3] + adds r1, 0x54 + ldrb r2, [r1] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1] +_0817DE82: + ldr r2, =0x02022f5a + ldrh r0, [r2] + cmp r0, 0x71 + bne _0817DEAA + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r1, r7, r1 + adds r3, r1, 0 + adds r3, 0x50 + ldrh r2, [r3] + ldr r0, =0xfffffe3f + ands r0, r2 + strh r0, [r3] + adds r1, 0x54 + ldrb r2, [r1] + movs r0, 0x31 + negs r0, r0 + ands r0, r2 + strb r0, [r1] +_0817DEAA: + ldr r1, =0x02022f5a + ldrh r0, [r1] + cmp r0, 0x36 + beq _0817DEB4 + b _0817E0A6 +_0817DEB4: + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r1, r7, r1 + adds r4, r1, 0 + adds r4, 0x51 + ldrb r2, [r4] + movs r0, 0x71 + negs r0, r0 + ands r0, r2 + strb r0, [r4] + adds r1, 0x55 + ldrb r2, [r1] + movs r0, 0x4 + negs r0, r0 + b _0817DF6A + .pool +_0817DEDC: + lsls r2, r4, 1 + adds r2, r4 + lsls r2, 2 + adds r2, r7, r2 + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x51 + movs r0, 0x7 + ands r1, r0 + lsls r1, 1 + ldrb r3, [r4] + movs r0, 0xF + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r2, 0x54 +_0817DF0A: + mov r0, r10 + lsls r3, r0, 6 +_0817DF0E: + ldrb r1, [r2] + movs r0, 0x3F +_0817DF12: + ands r0, r1 + orrs r0, r3 + strb r0, [r2] + b _0817E0A6 + .pool +_0817DF24: + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r1, r7, r0 + adds r0, r1, 0 + adds r0, 0x51 + ldrb r0, [r0] + lsls r0, 28 + lsrs r0, 29 + cmp r0, 0 + bne _0817DF3C + b _0817E0A6 +_0817DF3C: + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r0, r1, 0 + adds r0, 0x54 + ldrb r3, [r0] + lsrs r3, 6 + movs r0, 0xF + b _0817E086 +_0817DF4E: + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r1, r7, r1 + adds r4, r1, 0 + adds r4, 0x51 + ldrb r2, [r4] + movs r0, 0xF + negs r0, r0 + ands r0, r2 + strb r0, [r4] + adds r1, 0x54 + ldrb r2, [r1] + movs r0, 0x3F +_0817DF6A: + ands r0, r2 + strb r0, [r1] + b _0817E0A6 +_0817DF70: + lsls r2, r4, 1 + adds r2, r4 + lsls r2, 2 + adds r2, r7, r2 + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x51 + movs r0, 0x7 + ands r1, r0 + lsls r1, 4 + ldrb r3, [r4] + movs r0, 0x71 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r2, 0x55 +_0817DF9E: + movs r0, 0x3 + mov r1, r10 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x4 + negs r0, r0 +_0817DFAA: + ands r0, r3 +_0817DFAC: + orrs r0, r1 + strb r0, [r2] + b _0817E0A6 + .pool +_0817DFBC: + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r1, r7, r0 + adds r0, r1, 0 + adds r0, 0x51 + ldrb r0, [r0] + lsls r0, 25 + lsrs r0, 29 + cmp r0, 0 + beq _0817E0A6 + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r0, r1, 0 + adds r0, 0x55 + ldrb r3, [r0] + lsls r3, 30 + lsrs r3, 30 + movs r0, 0x10 + b _0817E086 +_0817DFE6: + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 2 + adds r1, r7, r1 + adds r3, r1, 0 + adds r3, 0x50 + ldrb r2, [r3] + movs r0, 0x39 + negs r0, r0 + ands r0, r2 + strb r0, [r3] + adds r1, 0x54 + ldrb r2, [r1] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldrh r2, [r3] + ldr r0, =0xfffffe3f + ands r0, r2 + strh r0, [r3] + ldrb r2, [r1] + movs r0, 0x31 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrb r2, [r0] + movs r0, 0x11 + movs r1, 0 + mov r3, r10 + bl sub_817E684 + b _0817E0A6 + .pool +_0817E040: + lsls r0, r4, 4 + adds r4, r7, r0 + adds r0, r4, 0 + adds r0, 0x35 + ldrb r0, [r0] + lsrs r0, 5 + cmp r0, 0 + beq _0817E068 + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r0, 0x36 + ldrb r3, [r0] + lsls r3, 30 + lsrs r3, 30 + movs r0, 0x15 + movs r1, 0 + bl sub_817E684 +_0817E068: + adds r0, r4, 0 + adds r0, 0x3D + ldrb r0, [r0] + lsrs r0, 5 + cmp r0, 0 + beq _0817E0A6 + subs r2, r0, 0x1 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r0, 0x3E + ldrb r3, [r0] + lsls r3, 30 + lsrs r3, 30 + movs r0, 0x15 +_0817E086: + movs r1, 0 + bl sub_817E684 + b _0817E0A6 +_0817E08E: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r7, r0 + adds r0, 0x57 + ldrb r2, [r0] + movs r1, 0x1F + negs r1, r1 + ands r1, r2 + movs r2, 0x1C +_0817E0A2: + orrs r1, r2 +_0817E0A4: + strb r1, [r0] +_0817E0A6: + 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_817C95C + + thumb_func_start sub_817E0B8 +sub_817E0B8: @ 817E0B8 + push {r4-r6,lr} + lsls r0, 16 + lsrs r5, r0, 16 + movs r3, 0 + ldr r4, =gUnknown_0860A8A4 + ldr r6, =0x0000ffff + adds r2, r4, 0 + adds r1, r4, 0 +_0817E0C8: + ldrh r0, [r1] + cmp r0, r5 + beq _0817E0DA + adds r2, 0x2 + adds r1, 0x2 + adds r3, 0x1 + ldrh r0, [r2] + cmp r0, r6 + bne _0817E0C8 +_0817E0DA: + lsls r0, r3, 1 + adds r0, r4 + ldrh r1, [r0] + ldr r0, =0x0000ffff + cmp r1, r0 + beq _0817E0F4 + movs r0, 0 + b _0817E0F6 + .pool +_0817E0F4: + movs r0, 0x1 +_0817E0F6: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_817E0B8 + + thumb_func_start sub_817E0FC +sub_817E0FC: @ 817E0FC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + str r2, [sp, 0x4] + lsls r0, 16 + lsrs r7, r0, 16 + lsls r1, 16 + lsrs r1, 16 + str r1, [sp] + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0817E122 + b _0817E310 +_0817E122: + ldr r0, =0x0202449c + ldr r0, [r0] + movs r1, 0x81 + lsls r1, 2 + adds r1, r0, r1 + str r1, [sp, 0x8] + ldr r2, =0x0202420b + mov r10, r2 + ldrb r0, [r2] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r0, =0x0202420c + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r4, r0, 24 + mov r1, r10 + ldrb r0, [r1] + adds r1, r7, 0 + bl sub_817F33C + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _0817E184 + mov r2, r9 + lsls r0, r2, 1 + add r0, r9 + lsls r0, 2 + ldr r1, [sp, 0x8] + adds r0, r1, r0 + adds r0, 0x57 + ldrb r1, [r0] + movs r2, 0x1E + orrs r1, r2 + strb r1, [r0] + b _0817E310 + .pool +_0817E184: + mov r2, r10 + ldrb r0, [r2] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 25 + lsls r0, 3 + lsls r4, 4 + adds r0, r4 + ldr r1, [sp, 0x8] + adds r0, r1, r0 + mov r2, r10 + ldrb r1, [r2] + lsls r1, 1 + ldr r2, =0x0202406e + adds r1, r2 + ldrh r2, [r1] + adds r2, 0x1 + adds r0, 0x35 + lsls r2, 5 + ldrb r3, [r0] + movs r1, 0x1F + ands r1, r3 + orrs r1, r2 + strb r1, [r0] + mov r1, r10 + ldrb r0, [r1] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 25 + lsls r0, 3 + adds r0, r4 + ldr r2, [sp, 0x8] + adds r0, r2, r0 + adds r0, 0x36 + movs r1, 0x3 + mov r8, r6 + mov r2, r8 + ands r2, r1 + mov r8, r2 + ldrb r2, [r0] + movs r1, 0x4 + negs r1, r1 + ands r1, r2 + mov r2, r8 + orrs r1, r2 + strb r1, [r0] + mov r1, r9 + lsls r0, r1, 1 + add r0, r9 + lsls r0, 2 + ldr r2, [sp, 0x8] + adds r0, r2, r0 + str r0, [sp, 0xC] + adds r5, r0, 0 + adds r5, 0x53 + lsls r2, r6, 6 + ldrb r1, [r5] + movs r0, 0x3F + ands r0, r1 + orrs r0, r2 + strb r0, [r5] + ldr r1, =gBattleMoves + lsls r4, r7, 1 + adds r0, r4, r7 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0] + movs r0, 0 + adds r1, r6, 0 + movs r3, 0 + bl sub_817E684 + ldr r0, [sp] + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_817F394 + ldr r0, [sp, 0x4] + ldrb r1, [r0, 0x12] + movs r0, 0xF + ands r0, r1 + str r4, [sp, 0x10] + cmp r0, 0 + beq _0817E23C + movs r0, 0x7 + adds r1, r7, 0 + adds r2, r6, 0 + movs r3, 0 + bl sub_817E684 +_0817E23C: + ldr r0, =0x00000111 + cmp r7, r0 + bne _0817E272 + mov r1, r10 + ldrb r0, [r1] + lsls r0, 1 + ldr r2, =0x0202406e + adds r0, r2 + ldrh r1, [r0] + adds r1, 0x1 + movs r0, 0x7 + ands r1, r0 + ldrb r2, [r5] + movs r0, 0x8 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r5] + ldr r2, [sp, 0xC] + adds r2, 0x56 + ldrb r1, [r2] + movs r0, 0x4 + negs r0, r0 + ands r0, r1 + mov r1, r8 + orrs r0, r1 + strb r0, [r2] +_0817E272: + cmp r7, 0x78 + beq _0817E27A + cmp r7, 0x99 + bne _0817E2D2 +_0817E27A: + movs r0, 0x1 + mov r2, r9 + eors r0, r2 + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 2 + ldr r0, [sp, 0x8] + adds r2, r0, r2 + mov r1, r10 + ldrb r0, [r1] + lsls r0, 1 + ldr r1, =0x0202406e + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x1 + adds r4, r2, 0 + adds r4, 0x58 + movs r0, 0x7 + ands r1, r0 + lsls r1, 3 + ldrb r3, [r4] + movs r0, 0x39 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + mov r1, r8 + lsls r3, r1, 1 + movs r1, 0x7 + negs r1, r1 + ands r0, r1 + orrs r0, r3 + strb r0, [r4] + adds r2, 0x57 + ldrb r1, [r2] + movs r0, 0x1F + negs r0, r0 + ands r0, r1 + movs r1, 0x1A + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r4] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4] +_0817E2D2: + ldr r1, =gBattleMoves + ldr r2, [sp, 0x10] + adds r0, r2, r7 + lsls r0, 2 + adds r0, r1 + ldrb r4, [r0, 0x2] + ldrb r5, [r0, 0x1] + movs r0, 0xD + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0 + bl sub_817E684 + movs r0, 0xE + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0 + bl sub_817E684 + movs r0, 0xB + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl sub_817E684 + movs r0, 0xC + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl sub_817E684 +_0817E310: + 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_817E0FC + + thumb_func_start sub_817E32C +sub_817E32C: @ 817E32C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0817E3EE + ldr r0, =0x0202449c + ldr r0, [r0] + movs r1, 0x81 + lsls r1, 2 + adds r4, r0, r1 + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r2, r0, 24 + cmp r5, 0x12 + beq _0817E36C + cmp r5, 0x13 + beq _0817E3AA + b _0817E3EE + .pool +_0817E36C: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r4, r0 + ldr r0, [r4, 0x50] + lsls r0, 14 + lsrs r0, 29 + cmp r0, 0 + beq _0817E3EE + subs r0, 0x1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x55 + ldrb r3, [r1] + lsls r3, 28 + lsrs r3, 30 + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x2 + movs r1, 0 + bl sub_817E684 + adds r2, r4, 0 + adds r2, 0x57 + ldrb r1, [r2] + movs r0, 0x1F + negs r0, r0 + ands r0, r1 + movs r1, 0x10 + b _0817E3EA +_0817E3AA: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r4, r0 + adds r0, r4, 0 + adds r0, 0x52 + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 29 + cmp r0, 0 + beq _0817E3EE + subs r0, 0x1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x55 + ldrb r3, [r1] + lsls r3, 26 + lsrs r3, 30 + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x2 + movs r1, 0x1 + bl sub_817E684 + adds r2, r4, 0 + adds r2, 0x57 + ldrb r1, [r2] + movs r0, 0x1F + negs r0, r0 + ands r0, r1 + movs r1, 0x12 +_0817E3EA: + orrs r0, r1 + strb r0, [r2] +_0817E3EE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_817E32C + + thumb_func_start sub_817E3F4 +sub_817E3F4: @ 817E3F4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + movs r0, 0 + str r0, [sp] + movs r1, 0 + str r1, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + ldr r3, =0x00007fff + str r3, [sp, 0xC] + movs r4, 0 + str r4, [sp, 0x10] + movs r7, 0 + str r7, [sp, 0x14] + mov r8, r0 + ldr r0, =0x0202449c + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xB3 + ldrb r0, [r0] + cmp r0, 0 + beq _0817E42A + b _0817E670 +_0817E42A: + movs r2, 0xD2 + lsls r2, 1 + adds r2, r1 + mov r10, r2 + movs r6, 0 +_0817E434: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r0, r4, r0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _0817E454 + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 +_0817E454: + ldr r5, =0x02024744 + adds r0, r4, r5 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + beq _0817E46A + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 +_0817E46A: + adds r6, 0x1 + cmp r6, 0x5 + ble _0817E434 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0817E47E + b _0817E670 +_0817E47E: + cmp r8, r7 + beq _0817E484 + b _0817E670 +_0817E484: + movs r6, 0 + lsls r3, r6, 1 + str r3, [sp, 0x18] + movs r4, 0x64 + mov r8, r4 +_0817E48E: + mov r1, r8 + muls r1, r6 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r6, 0x1 + mov r9, r0 + cmp r7, 0 + beq _0817E4EE + adds r0, r4, 0 + movs r1, 0x2D + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0817E4EE + movs r4, 0 + lsls r0, r6, 3 + mov r2, r10 + adds r1, r0, r2 + movs r3, 0x3 +_0817E4C4: + lsls r0, r4, 16 + asrs r0, 16 + ldrh r4, [r1] + adds r0, r4 + lsls r0, 16 + lsrs r4, r0, 16 + adds r1, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _0817E4C4 + ldr r1, [sp, 0x8] + lsls r0, r1, 16 + lsls r1, r4, 16 + cmp r0, r1 + bge _0817E4EE + lsls r0, r6, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + lsrs r1, 16 + str r1, [sp, 0x8] + str r7, [sp] +_0817E4EE: + mov r0, r8 + muls r0, r6 + ldr r2, =0x02024744 + adds r4, r0, r2 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + ldr r3, [sp, 0x8] + lsls r3, 16 + str r3, [sp, 0x1C] + cmp r7, 0 + beq _0817E5A0 + adds r0, r4, 0 + movs r1, 0x2D + movs r2, 0 + bl pokemon_getattr + cmp r0, 0 + bne _0817E5A0 + movs r4, 0 + ldr r0, [sp, 0xC] + lsls r2, r0, 16 + movs r3, 0x1 + lsls r1, r3, 1 + adds r1, 0x1 + lsls r1, 4 + lsls r0, r6, 3 + adds r0, r1 + mov r3, r10 + adds r1, r0, r3 + movs r3, 0x3 +_0817E534: + lsls r0, r4, 16 + asrs r0, 16 + ldrh r4, [r1] + adds r0, r4 + lsls r0, 16 + lsrs r4, r0, 16 + adds r1, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _0817E534 + asrs r1, r2, 16 + lsls r5, r4, 16 + asrs r0, r5, 16 + cmp r1, r0 + bne _0817E590 + mov r0, r8 + muls r0, r6 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x19 + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + ldr r2, [sp, 0x14] + mov r0, r8 + muls r0, r2 + ldr r3, =0x02024744 + adds r0, r3 + movs r1, 0x19 + movs r2, 0 + bl pokemon_getattr + cmp r4, r0 + bls _0817E5A0 + b _0817E594 + .pool +_0817E590: + cmp r1, r0 + ble _0817E5A0 +_0817E594: + lsls r0, r6, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + lsrs r5, 16 + str r5, [sp, 0xC] + str r7, [sp, 0x4] +_0817E5A0: + mov r6, r9 + cmp r6, 0x5 + bgt _0817E5A8 + b _0817E48E +_0817E5A8: + movs r4, 0 + movs r6, 0 + movs r3, 0 + ldr r5, =0x020244ec + ldr r7, [sp, 0x10] + lsls r0, r7, 3 + mov r1, r10 + adds r2, r0, r1 +_0817E5B8: + lsls r0, r4, 16 + asrs r0, 16 + movs r7, 0 + ldrsh r1, [r2, r7] + cmp r0, r1 + bge _0817E5C8 + ldrh r4, [r2] + adds r6, r3, 0 +_0817E5C8: + adds r2, 0x2 + adds r3, 0x1 + cmp r3, 0x3 + ble _0817E5B8 + movs r0, 0x64 + ldr r1, [sp, 0x10] + muls r0, r1 + adds r0, r5 + adds r1, r6, 0 + adds r1, 0xD + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + ldr r2, [sp, 0x1C] + cmp r2, 0 + beq _0817E670 + cmp r4, 0 + beq _0817E670 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0817E65C + ldr r3, [sp, 0x10] + cmp r3, 0x2 + bhi _0817E620 + ldr r0, =0x02024474 + adds r0, 0x25 + ldrb r0, [r0] + bl sub_806D82C + lsls r0, 16 + cmp r0, 0 + beq _0817E630 + b _0817E670 + .pool +_0817E620: + ldr r0, =0x02024474 + adds r0, 0x25 + ldrb r0, [r0] + bl sub_806D82C + lsls r0, 16 + cmp r0, 0 + beq _0817E670 +_0817E630: + movs r3, 0 + ldr r7, [sp, 0x14] + cmp r7, 0x2 + bls _0817E63A + movs r3, 0x1 +_0817E63A: + lsls r0, r3, 24 + lsrs r0, 24 + ldr r1, =0x02024474 + adds r1, 0x25 + ldrb r1, [r1] + bl sub_806EF84 + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + ldr r2, [sp] + ldr r3, [sp, 0x4] + bl sub_80ECB00 + b _0817E670 + .pool +_0817E65C: + ldr r0, =0x02024474 + adds r0, 0x25 + ldrb r1, [r0] + movs r0, 0x1 + eors r0, r1 + adds r1, r4, 0 + ldr r2, [sp] + ldr r3, [sp, 0x4] + bl sub_80ECB00 +_0817E670: + 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_817E3F4 + + thumb_func_start sub_817E684 +sub_817E684: @ 817E684 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 24 + lsrs r5, r2, 24 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + ldr r0, =0x0202449c + ldr r0, [r0] + movs r1, 0xD2 + lsls r1, 1 + adds r1, r0 + mov r8, r1 + movs r2, 0x81 + lsls r2, 2 + adds r7, r0, r2 + ldr r0, =0x0202420b + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0202420c + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r3, r0, 24 + mov r0, r10 + cmp r0, 0x1B + bls _0817E6D4 + b _0817EA6C +_0817E6D4: + lsls r0, 2 + ldr r1, =_0817E6F0 + adds r1, r0, r1 + ldr r1, [r1] + mov r12, r0 + mov pc, r1 + .pool + .align 2, 0 +_0817E6F0: + .4byte _0817E760 + .4byte _0817E760 + .4byte _0817E85C + .4byte _0817E79C + .4byte _0817E79C + .4byte _0817E79C + .4byte _0817E79C + .4byte _0817E79C + .4byte _0817E8A0 + .4byte _0817E8A0 + .4byte _0817E8CC + .4byte _0817E8F0 + .4byte _0817E978 + .4byte _0817E9E0 + .4byte _0817EA28 + .4byte _0817E8A0 + .4byte _0817E8A0 + .4byte _0817E880 + .4byte _0817E760 + .4byte _0817E80A + .4byte _0817E848 + .4byte _0817E8A0 + .4byte _0817E760 + .4byte _0817E760 + .4byte _0817E760 + .4byte _0817E760 + .4byte _0817E760 + .4byte _0817E760 +_0817E760: + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 2 + adds r1, r6 + lsls r1, 1 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 4 + adds r1, r0 + add r1, r8 + ldr r0, =gUnknown_0860A834 + add r0, r12 + ldr r2, [r0] + lsls r0, r5, 1 + adds r0, r2 + ldrh r0, [r0] + ldrh r2, [r1] + adds r0, r2 + b _0817EA6A + .pool +_0817E79C: + ldr r1, =gUnknown_0860A834 + add r1, r12 + ldr r7, =0x0202406e + lsls r0, r4, 1 + adds r0, r4 + lsls r2, r0, 4 + ldr r4, =0x0000ffff + ldr r1, [r1] + ldr r3, =0x0202420b + ldrh r0, [r1] + cmp r6, r0 + bne _0817E7E0 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r5 + lsls r0, 1 + adds r0, r2 + add r0, r8 + ldrh r1, [r1, 0x2] + ldrh r2, [r0] + adds r1, r2 + strh r1, [r0] + b _0817EA6C + .pool +_0817E7E0: + adds r1, 0x4 + ldrh r0, [r1] + cmp r0, r4 + bne _0817E7EA + b _0817EA6C +_0817E7EA: + cmp r6, r0 + bne _0817E7E0 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r5 + lsls r0, 1 + adds r0, r2 + add r0, r8 + ldrh r1, [r1, 0x2] + ldrh r5, [r0] + adds r1, r5 + strh r1, [r0] + b _0817EA6C +_0817E80A: + movs r0, 0x1 + adds r1, r5, 0 + eors r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r7, r0 + adds r0, 0x57 + ldrb r2, [r0] + movs r1, 0x1F + negs r1, r1 + ands r1, r2 + strb r1, [r0] + mov r0, r9 + lsls r1, r0, 1 + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 4 + adds r1, r0 + add r1, r8 + ldr r0, =gUnknown_0860A834 + add r0, r12 + ldr r2, [r0] + lsls r0, r6, 1 + adds r0, r2 + ldrh r0, [r0] + ldrh r2, [r1] + adds r0, r2 + b _0817EA6A + .pool +_0817E848: + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r7, r0 + adds r0, 0x57 + ldrb r2, [r0] + movs r1, 0x1F + negs r1, r1 + ands r1, r2 + strb r1, [r0] +_0817E85C: + mov r0, r9 + lsls r1, r0, 1 + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 4 + adds r1, r0 + add r1, r8 + ldr r0, =gUnknown_0860A834 + add r0, r12 + ldr r2, [r0] + lsls r0, r6, 1 + adds r0, r2 + ldrh r0, [r0] + ldrh r2, [r1] + adds r0, r2 + b _0817EA6A + .pool +_0817E880: + lsls r1, r5, 2 + add r1, r9 + lsls r1, 1 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 4 + adds r1, r0 + add r1, r8 + ldr r0, =gUnknown_0860A834 + add r0, r12 + ldr r2, [r0] + lsls r0, r6, 1 + adds r0, r2 + b _0817EA64 + .pool +_0817E8A0: + lsls r2, r5, 2 + add r2, r9 + lsls r2, 1 + movs r1, 0x1 + eors r1, r4 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 4 + adds r2, r0 + add r2, r8 + ldr r0, =gUnknown_0860A834 + add r0, r12 + ldr r1, [r0] + lsls r0, r6, 1 + adds r0, r1 + ldrh r0, [r0] + ldrh r1, [r2] + adds r0, r1 + strh r0, [r2] + b _0817EA6C + .pool +_0817E8CC: + lsls r1, r5, 2 + add r1, r9 + lsls r1, 1 + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 4 + adds r1, r0 + add r1, r8 + ldr r0, =gUnknown_0860A834 + add r0, r12 + ldr r0, [r0] + ldrh r0, [r0] + ldrh r2, [r1] + adds r0, r2 + b _0817EA6A + .pool +_0817E8F0: + lsls r0, r3, 4 + adds r2, r7, r0 + adds r0, r2, 0 + adds r0, 0x34 + ldrb r0, [r0] + lsls r0, 29 + lsrs r1, r0, 29 + adds r4, r2, 0 + adds r4, 0x3C + ldrb r0, [r4] + lsls r0, 29 + lsrs r0, 29 + cmn r1, r0 + bne _0817E90E + b _0817EA6C +_0817E90E: + cmp r6, 0xA + beq _0817E914 + b _0817EA6C +_0817E914: + cmp r1, 0 + beq _0817E940 + subs r1, 0x1 + lsls r1, 2 + adds r0, r2, 0 + adds r0, 0x33 + ldrb r0, [r0] + lsrs r0, 6 + adds r1, r0 + lsls r1, 1 + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 4 + adds r1, r0 + add r1, r8 + ldr r0, =gUnknown_0860A834 + add r0, r12 + ldr r0, [r0] + ldrh r0, [r0] + ldrh r5, [r1] + adds r0, r5 + strh r0, [r1] +_0817E940: + ldrb r0, [r4] + lsls r0, 29 + lsrs r0, 29 + cmp r0, 0 + bne _0817E94C + b _0817EA6C +_0817E94C: + subs r1, r0, 0x1 + lsls r1, 2 + adds r0, r2, 0 + adds r0, 0x3B + ldrb r0, [r0] + lsrs r0, 6 + adds r1, r0 + lsls r1, 1 + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 4 + adds r1, r0 + add r1, r8 + ldr r0, =gUnknown_0860A834 + add r0, r12 + ldr r0, [r0] + ldrh r0, [r0] + ldrh r2, [r1] + adds r0, r2 + b _0817EA6A + .pool +_0817E978: + lsls r1, r3, 4 + adds r1, r7, r1 + adds r0, r1, 0 + adds r0, 0x34 + ldrb r4, [r0] + lsls r0, r4, 26 + lsrs r2, r0, 29 + adds r5, r1, 0 + adds r5, 0x3C + ldrb r0, [r5] + lsls r0, 26 + lsrs r0, 29 + cmn r2, r0 + beq _0817EA6C + cmp r6, 0xD + bne _0817EA6C + cmp r2, 0 + beq _0817E9BE + subs r1, r2, 0x1 + lsls r1, 2 + lsrs r0, r4, 6 + adds r1, r0 + lsls r1, 1 + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 4 + adds r1, r0 + add r1, r8 + ldr r0, =gUnknown_0860A834 + add r0, r12 + ldr r0, [r0] + ldrh r0, [r0] + ldrh r2, [r1] + adds r0, r2 + strh r0, [r1] +_0817E9BE: + ldrb r2, [r5] + lsls r0, r2, 26 + lsrs r0, 29 + cmp r0, 0 + beq _0817EA6C + subs r1, r0, 0x1 + lsls r1, 2 + lsrs r0, r2, 6 + adds r1, r0 + lsls r1, 1 + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 4 + b _0817EA5A + .pool +_0817E9E0: + cmp r6, 0x8 + bhi _0817EA6C + cmp r5, 0 + beq _0817EA6C + lsls r0, r3, 1 + adds r3, r0, r3 + lsls r0, r3, 2 + adds r2, r7, r0 + adds r0, r2, 0 + adds r0, 0x50 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 29 + cmp r0, 0 + beq _0817EA6C + subs r1, r0, 0x1 + lsls r1, 2 + adds r0, r2, 0 + adds r0, 0x54 + ldrb r0, [r0] + lsls r0, 28 + lsrs r0, 30 + adds r1, r0 + lsls r1, 1 + lsls r0, r3, 4 + adds r1, r0 + add r1, r8 + ldr r0, =gUnknown_0860A834 + add r0, r12 + ldr r0, [r0] + ldrh r0, [r0] + ldrh r2, [r1] + adds r0, r2 + b _0817EA6A + .pool +_0817EA28: + cmp r6, 0x8 + bls _0817EA6C + cmp r5, 0 + beq _0817EA6C + lsls r0, r3, 1 + adds r3, r0, r3 + lsls r0, r3, 2 + adds r2, r7, r0 + adds r0, r2, 0 + adds r0, 0x50 + ldrh r0, [r0] + lsls r0, 23 + lsrs r0, 29 + cmp r0, 0 + beq _0817EA6C + subs r1, r0, 0x1 + lsls r1, 2 + adds r0, r2, 0 + adds r0, 0x54 + ldrb r0, [r0] + lsls r0, 26 + lsrs r0, 30 + adds r1, r0 + lsls r1, 1 + lsls r0, r3, 4 +_0817EA5A: + adds r1, r0 + add r1, r8 + ldr r0, =gUnknown_0860A834 + add r0, r12 + ldr r0, [r0] +_0817EA64: + ldrh r0, [r0] + ldrh r5, [r1] + adds r0, r5 +_0817EA6A: + strh r0, [r1] +_0817EA6C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817E684 + + thumb_func_start sub_817EA80 +sub_817EA80: @ 817EA80 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x0202449c + ldr r0, [r0] + movs r1, 0x81 + lsls r1, 2 + adds r5, r0, r1 + ldr r3, =0x0202420b + mov r8, r3 + ldrb r0, [r3] + bl battle_side_get_owner + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0202420c + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r6, r5, r0 + adds r0, r6, 0 + adds r0, 0x57 + ldrb r0, [r0] + lsrs r3, r0, 5 + lsls r0, 27 + lsrs r0, 28 + cmp r0, 0 + bne _0817EAC8 + b _0817EE50 +_0817EAC8: + subs r0, 0x1 + cmp r0, 0xE + bls _0817EAD0 + b _0817EEBC +_0817EAD0: + lsls r0, 2 + ldr r1, =_0817EAEC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0817EAEC: + .4byte _0817EB28 + .4byte _0817EB54 + .4byte _0817EB80 + .4byte _0817EBD4 + .4byte _0817EBFE + .4byte _0817EC26 + .4byte _0817EC4E + .4byte _0817EC6C + .4byte _0817EC9A + .4byte _0817ECCC + .4byte _0817ED54 + .4byte _0817ED82 + .4byte _0817EDC2 + .4byte _0817EE1C + .4byte _0817EEBC +_0817EB28: + lsls r0, r3, 3 + lsls r1, r4, 4 + adds r0, r1 + adds r3, r5, r0 + adds r0, r3, 0 + adds r0, 0x30 + ldrb r0, [r0] + lsls r0, 29 + lsrs r1, r0, 29 + cmp r1, 0 + bne _0817EB40 + b _0817EEBC +_0817EB40: + movs r0, 0x1 + adds r2, r4, 0 + eors r2, r0 + subs r1, 0x1 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x32 + ldrb r3, [r0] + lsls r3, 28 + b _0817EE84 +_0817EB54: + lsls r0, r3, 3 + lsls r1, r4, 4 + adds r0, r1 + adds r3, r5, r0 + adds r0, r3, 0 + adds r0, 0x30 + ldrb r0, [r0] + lsls r0, 26 + lsrs r1, r0, 29 + cmp r1, 0 + bne _0817EB6C + b _0817EEBC +_0817EB6C: + movs r0, 0x1 + adds r2, r4, 0 + eors r2, r0 + subs r1, 0x1 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x32 + ldrb r3, [r0] + lsls r3, 26 + b _0817EE84 +_0817EB80: + lsls r0, r3, 2 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 3 + adds r0, r1 + adds r5, r0 + ldrb r0, [r5] + lsls r0, 29 + lsrs r1, r0, 29 + cmp r1, 0 + beq _0817EBB4 + movs r0, 0x1 + adds r2, r4, 0 + eors r2, r0 + subs r0, r1, 0x1 + lsls r0, 2 + ldrb r3, [r5, 0x2] + lsls r3, 28 + lsrs r3, 30 + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x13 + movs r1, 0 + bl sub_817E684 +_0817EBB4: + ldrb r0, [r5] + lsls r0, 26 + lsrs r1, r0, 29 + cmp r1, 0 + bne _0817EBC0 + b _0817EEBC +_0817EBC0: + movs r0, 0x1 + adds r2, r4, 0 + eors r2, r0 + subs r0, r1, 0x1 + lsls r0, 2 + ldrb r3, [r5, 0x2] + lsls r3, 26 + lsrs r3, 30 + adds r3, r0 + b _0817EE88 +_0817EBD4: + lsls r0, r3, 2 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 3 + adds r0, r1 + adds r1, r5, r0 + ldrh r0, [r1] + lsls r0, 23 + lsrs r3, r0, 29 + cmp r3, 0 + bne _0817EBEC + b _0817EEBC +_0817EBEC: + movs r0, 0x1 + adds r2, r4, 0 + eors r2, r0 + subs r0, r3, 0x1 + lsls r0, 2 + ldrb r3, [r1, 0x2] + lsrs r3, 6 + adds r3, r0 + b _0817EE88 +_0817EBFE: + lsls r0, r3, 3 + lsls r1, r4, 4 + adds r0, r1 + adds r3, r5, r0 + ldrh r0, [r3, 0x30] + lsls r0, 23 + lsrs r1, r0, 29 + cmp r1, 0 + bne _0817EC12 + b _0817EEBC +_0817EC12: + movs r0, 0x1 + adds r2, r4, 0 + eors r2, r0 + subs r1, 0x1 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x32 + ldrb r3, [r0] + lsrs r3, 6 + b _0817EE86 +_0817EC26: + lsls r0, r3, 3 + lsls r1, r4, 4 + adds r0, r1 + adds r3, r5, r0 + adds r0, r3, 0 + adds r0, 0x31 + ldrb r0, [r0] + lsls r0, 28 + lsrs r1, r0, 29 + cmp r1, 0 + bne _0817EC3E + b _0817EEBC +_0817EC3E: + movs r0, 0x1 + adds r2, r4, 0 + eors r2, r0 + subs r1, 0x1 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x33 + b _0817EE80 +_0817EC4E: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r3, r5, r0 + adds r0, r3, 0 + adds r0, 0x50 + ldrb r0, [r0] + lsls r0, 29 + lsrs r1, r0, 29 + cmp r1, 0 + bne _0817EC66 + b _0817EEBC +_0817EC66: + movs r0, 0x1 + adds r2, r4, 0 + b _0817EE76 +_0817EC6C: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r3, r5, r0 + ldr r0, [r3, 0x50] + lsls r0, 14 + lsrs r0, 29 + cmp r0, 0 + bne _0817EC80 + b _0817EEBC +_0817EC80: + adds r2, r4, 0 + subs r1, r0, 0x1 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x55 + ldrb r3, [r0] + lsls r3, 28 + lsrs r3, 30 + adds r3, r1 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x14 + b _0817EE8E +_0817EC9A: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r3, r5, r0 + adds r0, r3, 0 + adds r0, 0x52 + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 29 + cmp r0, 0 + bne _0817ECB2 + b _0817EEBC +_0817ECB2: + adds r2, r4, 0 + subs r1, r0, 0x1 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x55 + ldrb r3, [r0] + lsls r3, 26 + lsrs r3, 30 + adds r3, r1 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x14 + b _0817EE8E +_0817ECCC: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r3, r5, r0 + adds r0, r3, 0 + adds r0, 0x58 + ldrb r0, [r0] + lsls r0, 25 + cmp r0, 0 + bge _0817ED14 + adds r0, r3, 0 + adds r0, 0x52 + ldrb r0, [r0] + lsrs r0, 5 + subs r6, r0, 0x1 + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r6, r0 + beq _0817ED14 + adds r2, r4, 0 + lsls r1, r6, 2 + adds r0, r3, 0 + adds r0, 0x55 + ldrb r3, [r0] + lsrs r3, 6 + adds r3, r1 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x13 + movs r1, 0 + bl sub_817E684 +_0817ED14: + movs r1, 0x1 + eors r1, r4 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r1, r5, r0 + adds r0, r1, 0 + adds r0, 0x58 + ldrb r0, [r0] + lsls r0, 25 + cmp r0, 0 + blt _0817ED2E + b _0817EEBC +_0817ED2E: + movs r0, 0x1 + adds r2, r4, 0 + eors r2, r0 + adds r0, r1, 0 + adds r0, 0x52 + ldrb r0, [r0] + lsrs r0, 5 + subs r0, 0x1 + lsls r0, 2 + adds r1, 0x55 + ldrb r3, [r1] + lsrs r3, 6 + adds r3, r0 + b _0817EE88 + .pool +_0817ED54: + movs r0, 0x1 + eors r0, r4 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r5, r1 + adds r1, 0x56 + ldrb r0, [r1] + lsls r0, 25 + lsrs r5, r0, 29 + cmp r5, 0 + bne _0817ED6E + b _0817EEBC +_0817ED6E: + movs r0, 0x1 + adds r2, r4, 0 + eors r2, r0 + subs r0, r5, 0x1 + lsls r0, 2 + ldrh r3, [r1] + lsls r3, 23 + lsrs r3, 30 + adds r3, r0 + b _0817EE88 +_0817ED82: + lsls r2, r4, 4 + movs r1, 0x1 + adds r0, r4, 0 + eors r0, r1 + lsls r6, r0, 24 + adds r0, r5, 0 + adds r0, 0x30 + adds r4, r2, r0 + movs r5, 0x1 +_0817ED94: + ldr r0, [r4] + lsls r0, 14 + lsrs r0, 29 + cmp r0, 0 + beq _0817EDB8 + subs r0, 0x1 + lsls r0, 2 + ldrb r3, [r4, 0x3] + lsls r3, 26 + lsrs r3, 30 + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x13 + movs r1, 0 + lsrs r2, r6, 24 + bl sub_817E684 +_0817EDB8: + adds r4, 0x8 + subs r5, 0x1 + cmp r5, 0 + bge _0817ED94 + b _0817EEBC +_0817EDC2: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r5, r0 + adds r0, 0x58 + ldrb r3, [r0] + lsls r0, r3, 31 + cmp r0, 0 + beq _0817EDF0 + adds r2, r4, 0 + lsls r0, r3, 26 + lsrs r0, 29 + subs r0, 0x1 + lsls r0, 2 + lsls r3, 29 + lsrs r3, 30 + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x13 + movs r1, 0 + bl sub_817E684 +_0817EDF0: + movs r0, 0x1 + eors r0, r4 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r5, r1 + adds r1, 0x58 + ldrb r1, [r1] + lsls r0, r1, 31 + cmp r0, 0 + beq _0817EEBC + movs r0, 0x1 + adds r2, r4, 0 + eors r2, r0 + lsls r0, r1, 26 + lsrs r0, 29 + subs r0, 0x1 + lsls r0, 2 + lsls r3, r1, 29 + lsrs r3, 30 + adds r3, r0 + b _0817EE88 +_0817EE1C: + cmp r7, 0x1 + bne _0817EEBC + adds r2, r4, 0 + ldr r1, =0x0202406e + ldr r0, =0x0202420b + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 2 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r5, r0 + adds r0, 0x53 + ldrb r3, [r0] + lsrs r3, 6 + adds r3, r1 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x14 + b _0817EE8E + .pool +_0817EE50: + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r3, r5, r0 + adds r0, r3, 0 + adds r0, 0x57 + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 28 + cmp r0, 0x7 + bne _0817EE96 + adds r0, r3, 0 + adds r0, 0x50 + ldrb r0, [r0] + lsls r0, 29 + lsrs r1, r0, 29 + cmp r1, 0 + beq _0817EEBC + movs r0, 0x1 +_0817EE76: + eors r2, r0 + subs r1, 0x1 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x54 +_0817EE80: + ldrb r3, [r0] + lsls r3, 30 +_0817EE84: + lsrs r3, 30 +_0817EE86: + adds r3, r1 +_0817EE88: + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x13 +_0817EE8E: + movs r1, 0 + bl sub_817E684 + b _0817EEBC +_0817EE96: + adds r2, r4, 0 + ldr r1, =0x0202406e + mov r3, r8 + ldrb r0, [r3] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 2 + adds r0, r6, 0 + adds r0, 0x53 + ldrb r3, [r0] + lsrs r3, 6 + adds r3, r1 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x14 + movs r1, 0 + bl sub_817E684 +_0817EEBC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817EA80 + + thumb_func_start sub_817EECC +sub_817EECC: @ 817EECC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + ldr r7, =0x02022fec + ldr r0, [r7] + ldr r1, =0x02000003 + ands r0, r1 + cmp r0, 0 + beq _0817EEE6 + b _0817F1FA +_0817EEE6: + ldr r4, =0x0202420b + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0817EEF8 + b _0817F1FA +_0817EEF8: + ldr r5, =0x02024084 + ldrb r4, [r4] + movs r1, 0x58 + adds r6, r4, 0 + muls r6, r1 + adds r0, r6, r5 + ldrb r0, [r0, 0x1E] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x5 + bgt _0817EF10 + b _0817F1FA +_0817EF10: + ldr r0, =0x0202420c + ldrb r0, [r0] + muls r0, r1 + adds r0, r5 + ldrb r0, [r0, 0x1F] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x6 + ble _0817EF24 + b _0817F1FA +_0817EF24: + ldr r0, =0x020241ea + ldrh r1, [r0] + cmp r1, 0xED + bne _0817EF2E + b _0817F1FA +_0817EF2E: + ldr r0, =0x00000137 + cmp r1, r0 + bne _0817EF36 + b _0817F1FA +_0817EF36: + ldr r0, [r7] + movs r1, 0xC8 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + beq _0817EF44 + b _0817F1FA +_0817EF44: + ldr r3, =gBattleMoves + ldr r2, =0x020244b0 + adds r0, r4, r2 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r6 + adds r1, r5, 0 + adds r1, 0xC + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x1] + adds r6, r2, 0 + cmp r0, 0 + bne _0817EF6A + b _0817F1FA +_0817EF6A: + movs r5, 0 + str r1, [sp, 0x24] + ldr r1, =gUnknown_0860A4AC + ldr r4, =0x0000ffff + adds r3, r1, 0 + adds r2, r1, 0 +_0817EF76: + ldr r0, [sp, 0x24] + ldrh r7, [r2] + cmp r0, r7 + beq _0817EF8A + adds r3, 0x2 + adds r2, 0x2 + adds r5, 0x1 + ldrh r0, [r3] + cmp r0, r4 + bne _0817EF76 +_0817EF8A: + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + ldr r0, =0x0000ffff + cmp r1, r0 + beq _0817EF98 + b _0817F1FA +_0817EF98: + ldr r2, =0x0202420b + ldrb r0, [r2] + adds r0, r6 + ldrb r0, [r0] + lsls r0, 2 + mov r1, sp + adds r1, r0 + adds r1, 0x10 + ldr r0, =0x020241f0 + ldr r0, [r0] + str r0, [r1] + ldr r0, =0x020241ea + ldrh r1, [r0] + str r1, [sp, 0x24] + movs r5, 0 + add r3, sp, 0x20 + mov r10, r3 + mov r8, r0 + add r7, sp, 0x10 + ldr r4, =0x0202420c + mov r9, r4 +_0817EFC2: + lsls r1, r5, 1 + ldr r6, =0x0202420b + ldrb r0, [r6] + movs r2, 0x58 + muls r0, r2 + adds r1, r0 + ldr r0, =0x02024084 + adds r0, 0xC + adds r1, r0 + ldrh r0, [r1] + mov r3, r8 + strh r0, [r3] + movs r6, 0 + mov r4, r10 + strh r6, [r4] + ldrh r0, [r3] + adds r1, r7, 0 + mov r2, r10 + bl sub_817F21C + lsls r0, 24 + cmp r0, 0 + beq _0817F0B4 + ldr r4, =0x0202428e + mov r1, r9 + ldrb r0, [r1] + bl battle_get_per_side_status + movs r1, 0x1 + ands r1, r0 + lsls r1, 1 + adds r1, r4 + ldrh r3, [r1] + ldr r2, =0x0202420b + ldrb r0, [r2] + movs r4, 0x58 + muls r0, r4 + ldr r6, =0x02024084 + adds r0, r6 + mov r2, r9 + ldrb r1, [r2] + muls r1, r4 + adds r1, r6 + mov r4, r8 + ldrh r2, [r4] + mov r6, r10 + ldrh r4, [r6] + str r4, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r6, =0x0202420b + ldrb r4, [r6] + str r4, [sp, 0x8] + mov r6, r9 + ldrb r4, [r6] + str r4, [sp, 0xC] + bl sub_806957C + adds r3, r0, 0 + ldr r4, =0x020241f0 + str r3, [r4] + ldr r1, =0x020242ac + ldr r2, =0x0202420b + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 2 + ands r0, r1 + cmp r0, 0 + beq _0817F06A + ldr r2, =gBattleMoves + mov r6, r8 + ldrh r1, [r6] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x2] + cmp r0, 0xD + bne _0817F06A + lsls r0, r3, 1 + str r0, [r4] +_0817F06A: + ldr r0, =0x0202433c + ldr r6, =0x0202420b + ldrb r1, [r6] + lsls r1, 4 + adds r1, r0 + ldrb r0, [r1] + lsls r0, 28 + cmp r0, 0 + bge _0817F08C + ldr r4, =0x020241f0 + ldr r1, [r4] + lsls r0, r1, 4 + subs r0, r1 + movs r1, 0xA + bl __divsi3 + str r0, [r4] +_0817F08C: + mov r1, r8 + ldrh r0, [r1] + ldrb r1, [r6] + mov r3, r9 + ldrb r2, [r3] + bl move_effectiveness_something + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, =0x020241f0 + ldr r0, [r0] + str r0, [r7] + cmp r0, 0 + bne _0817F0B4 + movs r0, 0x29 + ands r0, r1 + cmp r0, 0 + bne _0817F0B4 + movs r0, 0x1 + str r0, [r7] +_0817F0B4: + adds r7, 0x4 + adds r5, 0x1 + cmp r5, 0x3 + ble _0817EFC2 + movs r5, 0 + ldr r3, =0x0202420b + ldr r6, =0x020244b0 + ldr r4, =0x0202406e + mov r8, r4 + movs r7, 0x64 + mov r9, r7 + mov r10, r6 +_0817F0CC: + ldrb r0, [r3] + adds r0, r6 + ldrb r2, [r0] + cmp r5, r2 + bne _0817F0D8 + b _0817F1D4 +_0817F0D8: + lsls r0, r5, 2 + mov r1, sp + adds r1, r0 + adds r1, 0x10 + lsls r0, r2, 2 + add r0, sp + adds r0, 0x10 + ldr r1, [r1] + ldr r0, [r0] + cmp r1, r0 + ble _0817F1D4 + movs r7, 0x1 + cmp r2, 0 + beq _0817F0F6 + movs r7, 0 +_0817F0F6: + movs r5, 0 + ldr r4, =0x0202420c + ldr r6, =0x02024744 + ldr r0, =0x0202420b + ldrb r0, [r0] + add r0, r10 + ldrb r3, [r0] + add r2, sp, 0x10 +_0817F106: + cmp r5, r3 + beq _0817F11A + lsls r0, r7, 2 + add r0, sp + adds r0, 0x10 + ldr r1, [r2] + ldr r0, [r0] + cmp r1, r0 + ble _0817F11A + adds r7, r5, 0 +_0817F11A: + adds r2, 0x4 + adds r5, 0x1 + cmp r5, 0x3 + ble _0817F106 + ldrb r0, [r4] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r6, r0, 0 + lsls r6, 16 + lsrs r6, 16 + ldr r2, =0x0202420b + ldrb r0, [r2] + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + mov r3, r9 + muls r3, r0 + adds r0, r3, 0 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r4, =0x0202420b + ldrb r3, [r4] + mov r2, r10 + adds r0, r3, r2 + ldrb r2, [r0] + movs r0, 0x58 + adds r4, r3, 0 + muls r4, r0 + ldr r5, =0x02024090 + adds r3, r4, r5 + lsls r0, r7, 1 + adds r0, r4 + adds r0, r5 + ldrh r0, [r0] + str r0, [sp] + adds r0, r6, 0 + bl sub_80EE35C + b _0817F1DC + .pool +_0817F1D4: + adds r5, 0x1 + cmp r5, 0x3 + bgt _0817F1DC + b _0817F0CC +_0817F1DC: + ldr r2, =0x020241f0 + ldr r1, =0x020244b0 + ldr r0, =0x0202420b + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 2 + add r0, sp + adds r0, 0x10 + ldr r0, [r0] + str r0, [r2] + ldr r0, =0x020241ea + mov r3, sp + ldrh r3, [r3, 0x24] + strh r3, [r0] +_0817F1FA: + 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_817EECC + + thumb_func_start sub_817F21C +sub_817F21C: @ 817F21C + push {r4-r7,lr} + adds r6, r1, 0 + mov r12, r2 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, =gBattleMoves + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _0817F286 + movs r4, 0 + ldr r5, =gUnknown_0860A4AC + ldr r7, =0x0000ffff + adds r3, r5, 0 + adds r1, r5, 0 +_0817F240: + ldrh r0, [r1] + cmp r2, r0 + beq _0817F252 + adds r3, 0x2 + adds r1, 0x2 + adds r4, 0x1 + ldrh r0, [r3] + cmp r0, r7 + bne _0817F240 +_0817F252: + lsls r0, r4, 1 + adds r0, r5 + ldrh r1, [r0] + ldr r0, =0x0000ffff + cmp r1, r0 + beq _0817F270 + movs r0, 0 + str r0, [r6] + b _0817F2A0 + .pool +_0817F270: + cmp r2, 0x95 + bne _0817F294 + ldr r2, =0x02024084 + ldr r0, =0x0202420b + ldrb r1, [r0] + movs r0, 0x58 + muls r0, r1 + adds r0, r2 + adds r0, 0x2A + ldrb r0, [r0] + asrs r0, 1 +_0817F286: + str r0, [r6] + movs r0, 0 + b _0817F2A0 + .pool +_0817F294: + cmp r2, 0xDE + bne _0817F29E + movs r0, 0xA + mov r1, r12 + strh r0, [r1] +_0817F29E: + movs r0, 0x1 +_0817F2A0: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_817F21C + + thumb_func_start sub_817F2A8 +sub_817F2A8: @ 817F2A8 + push {r4,r5,lr} + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0817F324 + ldr r0, =0x0202449c + ldr r3, [r0] + ldr r0, =0x0000025b + adds r4, r3, r0 + ldrb r2, [r4] + subs r1, 0x21 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r4] + ldr r0, =0x00000267 + adds r2, r3, r0 + ldrb r0, [r2] + ands r1, r0 + strb r1, [r2] + ldrb r5, [r4] + movs r1, 0x1F + adds r0, r1, 0 + ands r0, r5 + strb r0, [r4] + ldrb r0, [r2] + ands r1, r0 + strb r1, [r2] + movs r0, 0x97 + lsls r0, 2 + adds r4, r3, r0 + ldrb r2, [r4] + movs r1, 0x39 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r4] + movs r0, 0x9A + lsls r0, 2 + adds r3, r0 + ldrb r0, [r3] + ands r1, r0 + strb r1, [r3] + ldrb r2, [r4] + movs r1, 0x7 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r4] + ldrb r0, [r3] + ands r1, r0 + strb r1, [r3] + ldrb r2, [r4] + movs r1, 0x2 + negs r1, r1 + adds r0, r1, 0 + ands r0, r2 + strb r0, [r4] + ldrb r0, [r3] + ands r1, r0 + strb r1, [r3] +_0817F324: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_817F2A8 + + thumb_func_start sub_817F33C +sub_817F33C: @ 817F33C + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 16 + lsrs r7, r1, 16 + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + ldr r6, =0x02024744 + cmp r0, 0 + bne _0817F356 + ldr r6, =0x020244ec +_0817F356: + movs r4, 0 + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r5, r0, r1 + b _0817F36E + .pool +_0817F36C: + adds r4, 0x1 +_0817F36E: + cmp r4, 0x3 + bgt _0817F388 + ldrh r1, [r5] + movs r0, 0x64 + muls r0, r1 + adds r0, r6, r0 + adds r1, r4, 0 + adds r1, 0xD + movs r2, 0 + bl pokemon_getattr + cmp r0, r7 + bne _0817F36C +_0817F388: + lsls r0, r4, 24 + lsrs r0, 24 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_817F33C + + thumb_func_start sub_817F394 +sub_817F394: @ 817F394 + push {r4-r6,lr} + lsls r0, 16 + lsrs r3, r0, 16 + adds r4, r3, 0 + lsls r1, 16 + lsrs r1, 16 + adds r6, r1, 0 + lsls r2, 24 + lsrs r2, 24 + adds r5, r2, 0 + movs r0, 0x7 + ands r0, r3 + cmp r0, 0 + beq _0817F3B4 + movs r0, 0x3 + b _0817F3CA +_0817F3B4: + movs r0, 0x60 + ands r0, r3 + cmp r0, 0 + beq _0817F3C0 + movs r0, 0x4 + b _0817F3CA +_0817F3C0: + movs r0, 0x18 + ands r0, r3 + cmp r0, 0 + beq _0817F3D2 + movs r0, 0x5 +_0817F3CA: + movs r3, 0 + bl sub_817E684 + b _0817F3E6 +_0817F3D2: + movs r0, 0x80 + ands r4, r0 + cmp r4, 0 + beq _0817F3E6 + movs r0, 0x6 + adds r1, r6, 0 + adds r2, r5, 0 + movs r3, 0 + bl sub_817E684 +_0817F3E6: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_817F394 + + thumb_func_start nullsub_69 +nullsub_69: @ 817F3EC + bx lr + thumb_func_end nullsub_69 + + thumb_func_start sub_817F3F0 +sub_817F3F0: @ 817F3F0 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + mov r9, r0 + mov r8, r1 + adds r5, r2, 0 + adds r4, r3, 0 + lsls r5, 16 + negs r5, r5 + lsls r4, 16 + negs r4, r4 + lsrs r4, 16 + mov r0, r8 + lsls r0, 16 + asrs r0, 16 + mov r8, r0 + asrs r5, 16 + adds r1, r5, 0 + bl cosine + adds r6, r0, 0 + lsls r4, 16 + asrs r4, 16 + mov r0, r8 + adds r1, r4, 0 + bl sine + subs r6, r0 + lsls r6, 16 + lsrs r6, 16 + mov r0, r8 + adds r1, r4, 0 + bl cosine + adds r2, r0, 0 + mov r0, r8 + adds r1, r5, 0 + str r2, [sp] + bl sine + ldr r2, [sp] + adds r2, r0 + negs r5, r5 + negs r4, r4 + lsls r6, 16 + asrs r6, 16 + lsls r5, 16 + asrs r5, 16 + adds r6, r5 + mov r0, r9 + strh r6, [r0, 0x24] + lsls r2, 16 + asrs r2, 16 + lsls r4, 16 + asrs r4, 16 + adds r2, r4 + strh r2, [r0, 0x26] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_817F3F0 + + thumb_func_start sub_817F474 +sub_817F474: @ 817F474 + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gUnknown_0860A8C8 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0817F48C + movs r0, 0 + b _0817F492 + .pool +_0817F48C: + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 +_0817F492: + pop {r1} + bx r1 + thumb_func_end sub_817F474 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_8184DA4.s b/asm/rom_8184DA4.s new file mode 100644 index 000000000..f82942aa3 --- /dev/null +++ b/asm/rom_8184DA4.s @@ -0,0 +1,101714 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8184DA4 +sub_8184DA4: @ 8184DA4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + ldr r0, =0x0203c7ac + mov r1, r12 + strb r1, [r0] + ldr r1, =0x0203ccd0 + movs r0, 0 + strb r0, [r1] + movs r2, 0 + movs r7, 0 + ldr r3, =0x0203c7bc + mov r10, r3 + ldr r6, =0x0203c794 + mov r9, r6 + ldr r0, =0x0203bd34 + mov r8, r0 +_08184DD0: + lsls r0, r2, 1 + mov r3, r9 + adds r1, r0, r3 + strh r7, [r1] + ldr r6, =0x0203c79c + adds r1, r0, r6 + strh r7, [r1] + ldr r1, =0x0203c7a4 + adds r0, r1 + strh r7, [r0] + adds r4, r2, 0x1 + mov r3, r12 + cmp r3, 0x1 + bne _08184E1C + ldr r5, =0x02022fec + movs r3, 0xFF + movs r1, 0xA6 + lsls r1, 2 + adds r0, r2, 0 + muls r0, r1 + mov r6, r8 + adds r2, r0, r6 +_08184DFC: + ldrb r0, [r2] + orrs r0, r3 + strb r0, [r2] + adds r2, 0x1 + subs r1, 0x1 + cmp r1, 0 + bne _08184DFC + ldr r0, [r5] + ldr r1, =0x0203c7b8 + str r0, [r1] + ldr r3, =0x020244a8 + ldr r0, [r3] + ldr r0, [r0, 0x14] + ldr r0, [r0, 0xC] + mov r6, r10 + str r0, [r6] +_08184E1C: + adds r2, r4, 0 + cmp r2, 0x3 + ble _08184DD0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8184DA4 + + thumb_func_start sub_8184E58 +sub_8184E58: @ 8184E58 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + ldr r0, =0x0203c7ac + ldrb r0, [r0] + cmp r0, 0x1 + bne _08184EA0 + ldr r1, =0x0203bd2c + ldr r0, =0x03005d80 + ldr r0, [r0] + str r0, [r1] + ldr r4, =0x0203c7ae + ldr r0, =0x000040cf + bl VarGet + strb r0, [r4] + ldr r4, =0x0203c7af + bl sub_81A513C + strb r0, [r4] + b _08184EAC + .pool +_08184EA0: + cmp r0, 0x2 + bne _08184EAC + ldr r0, =0x03005d80 + ldr r1, =0x0203bd2c + ldr r1, [r1] + str r1, [r0] +_08184EAC: + ldr r0, =0x02022fec + ldr r5, [r0] + movs r0, 0x2 + ands r5, r0 + cmp r5, 0 + beq _08184F64 + bl link_get_multiplayer_id + ldr r1, =0x0203c7b4 + strb r0, [r1] + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + movs r5, 0 + ldr r0, =0x0203cc80 + mov r9, r0 + ldr r6, =0x020229e8 + movs r0, 0x8 + adds r0, r6 + mov r8, r0 + mov r7, r9 + adds r7, 0x4 +_08184EDC: + lsls r0, r5, 2 + adds r0, r5 + lsls r4, r0, 2 + mov r0, r9 + adds r2, r4, r0 + lsls r0, r5, 3 + subs r0, r5 + lsls r3, r0, 2 + adds r0, r6, 0x4 + adds r0, r3, r0 + ldr r0, [r0] + str r0, [r2] + adds r1, r3, r6 + ldrb r0, [r1, 0x13] + strb r0, [r2, 0xC] + ldrh r0, [r1, 0x18] + strh r0, [r2, 0xE] + ldrh r0, [r1, 0x1A] + strh r0, [r2, 0x10] + cmp r5, r10 + bge _08184F3C + mov r0, r8 + adds r1, r3, r0 + mov r0, sp + bl CopyString + mov r0, sp + bl StripExtendedControlCodes + adds r0, r4, r7 + mov r1, sp + bl CopyString + adds r5, 0x1 + b _08184F56 + .pool +_08184F3C: + adds r5, 0x1 + ldr r0, =0x020229f0 + adds r1, r3, r0 + ldr r0, =0x0203cc84 + adds r2, r4, r0 + movs r3, 0x7 +_08184F48: + ldrb r0, [r1] + strb r0, [r2] + adds r1, 0x1 + adds r2, 0x1 + subs r3, 0x1 + cmp r3, 0 + bge _08184F48 +_08184F56: + cmp r5, 0x3 + ble _08184EDC + b _08184FA0 + .pool +_08184F64: + ldr r3, =0x0203cc80 + ldr r4, =0x03005d90 + ldr r2, [r4] + ldrb r1, [r2, 0xA] + ldrb r0, [r2, 0xB] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r2, 0xC] + lsls r0, 16 + orrs r1, r0 + ldrb r0, [r2, 0xD] + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + ldrb r0, [r2, 0x8] + strb r0, [r3, 0xC] + strh r5, [r3, 0xE] + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strh r0, [r3, 0x10] + movs r5, 0 + adds r3, 0x4 +_08184F90: + adds r0, r5, r3 + ldr r1, [r4] + adds r1, r5 + ldrb r1, [r1] + strb r1, [r0] + adds r5, 0x1 + cmp r5, 0x7 + ble _08184F90 +_08184FA0: + 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_8184E58 + + thumb_func_start sub_8184FBC +sub_8184FBC: @ 8184FBC + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + ldr r1, =0x0203c794 + lsls r0, r5, 1 + adds r4, r0, r1 + ldrh r2, [r4] + adds r3, r2, 0 + ldr r0, =0x00000297 + cmp r3, r0 + bhi _08184FF0 + ldr r0, =0x0203c7ac + ldrb r0, [r0] + cmp r0, 0x2 + beq _08184FF0 + ldr r1, =0x0203bd34 + adds r0, r2, 0x1 + strh r0, [r4] + movs r0, 0xA6 + lsls r0, 2 + muls r0, r5 + adds r0, r3, r0 + adds r0, r1 + strb r6, [r0] +_08184FF0: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8184FBC + + thumb_func_start sub_8185008 +sub_8185008: @ 8185008 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + movs r3, 0 + cmp r3, r4 + bge _08185046 + ldr r0, =0x0203c794 + lsls r1, r5, 1 + adds r2, r1, r0 + ldr r7, =0x0203bd34 + movs r0, 0xA6 + lsls r0, 2 + muls r5, r0 + movs r6, 0xFF +_08185028: + ldrh r0, [r2] + subs r0, 0x1 + strh r0, [r2] + ldrh r1, [r2] + adds r1, r5 + adds r1, r7 + ldrb r0, [r1] + orrs r0, r6 + strb r0, [r1] + ldrh r0, [r2] + cmp r0, 0 + beq _08185046 + adds r3, 0x1 + cmp r3, r4 + blt _08185028 +_08185046: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8185008 + + thumb_func_start sub_8185054 +sub_8185054: @ 8185054 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, =0x0203c794 + lsls r0, r3, 1 + adds r2, r0, r1 + ldrh r1, [r2] + ldr r0, =0x00000297 + cmp r1, r0 + bhi _0818507A + ldr r4, =0x0203bd34 + adds r0, 0x1 + muls r3, r0 + adds r0, r1, r3 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081850BC +_0818507A: + ldr r2, =0x020375f0 + ldr r1, =0x0202433a + movs r0, 0x5 + strb r0, [r1] + movs r0, 0x5 + strh r0, [r2] + bl pal_fade_control_reset_maybe + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_80384E4 + bl SetMainCallback2 + movs r0, 0xFF + b _081850C6 + .pool +_081850BC: + adds r0, r1, 0x1 + strh r0, [r2] + adds r0, r1, r3 + adds r0, r4 + ldrb r0, [r0] +_081850C6: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8185054 + + thumb_func_start sub_81850D0 +sub_81850D0: @ 81850D0 + ldr r0, =0x0203c7ac + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_81850D0 + + thumb_func_start sub_81850DC +sub_81850DC: @ 81850DC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r0 + movs r7, 0 + movs r0, 0 + mov r12, r0 +_081850F0: + mov r1, r12 + lsls r3, r1, 1 + ldr r0, =0x0203c794 + adds r5, r3, r0 + ldr r1, =0x0203c79c + adds r6, r3, r1 + ldrh r0, [r5] + mov r9, r3 + mov r1, r12 + adds r1, 0x1 + str r1, [sp] + ldrh r1, [r6] + cmp r0, r1 + beq _0818517E + adds r1, r7, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + adds r2, r7, 0 + add r1, r8 + mov r0, r12 + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + add r2, r8 + ldrb r0, [r5] + ldrb r1, [r6] + subs r0, r1 + strb r0, [r2] + movs r4, 0 + ldrh r0, [r5] + ldrh r1, [r6] + subs r0, r1 + cmp r4, r0 + bge _08185172 + ldr r1, =0x0203bd34 + mov r10, r1 + ldr r6, =0x0203c79c + movs r0, 0xA6 + lsls r0, 2 + mov r5, r12 + muls r5, r0 +_08185146: + adds r1, r7, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + add r1, r8 + adds r2, r3, r6 + ldrh r0, [r2] + adds r0, r4 + adds r0, r5 + add r0, r10 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x0203c794 + adds r0, r3, r1 + ldrh r1, [r0] + ldrh r0, [r2] + subs r1, r0 + cmp r4, r1 + blt _08185146 +_08185172: + ldr r0, =0x0203c79c + add r0, r9 + ldr r1, =0x0203c794 + add r1, r9 + ldrh r1, [r1] + strh r1, [r0] +_0818517E: + ldr r1, [sp] + lsls r0, r1, 24 + lsrs r0, 24 + mov r12, r0 + cmp r0, 0x3 + bls _081850F0 + adds r0, r7, 0 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81850DC + + thumb_func_start sub_81851A8 +sub_81851A8: @ 81851A8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r7, r0, 0 + movs r1, 0x2 + mov r0, sp + strb r1, [r0] + ldr r0, =0x02022fec + ldr r0, [r0] + ands r0, r1 + cmp r0, 0 + beq _0818525E + movs r5, 0 + ldr r4, =0x020229e8 + b _081851DA + .pool +_081851D0: + ldrb r0, [r4] + cmp r0, 0x3 + bne _0818525E + adds r4, 0x1C + adds r5, 0x1 +_081851DA: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + blt _081851D0 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + bne _0818525E + ldrb r0, [r7] + mov r4, sp + adds r4, 0x1 + strb r0, [r4] + ldrb r0, [r4] + mov r8, r4 + cmp r0, 0 + beq _0818525E +_08185202: + adds r0, r7, 0 + mov r1, sp + adds r2, r4, 0 + bl sub_8185278 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r7, 0 + mov r1, sp + adds r2, r4, 0 + bl sub_8185278 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _08185256 + ldr r3, =0x0203bd34 + ldr r0, =0x0203c7a4 + lsls r1, r6, 1 + adds r4, r1, r0 + adds r5, r2, 0 + movs r0, 0xA6 + lsls r0, 2 + muls r6, r0 +_08185232: + adds r0, r7, 0 + mov r1, sp + mov r2, r8 + str r3, [sp, 0x4] + bl sub_8185278 + ldrh r1, [r4] + adds r2, r1, 0x1 + strh r2, [r4] + lsls r1, 16 + lsrs r1, 16 + adds r1, r6 + ldr r3, [sp, 0x4] + adds r1, r3 + strb r0, [r1] + subs r5, 0x1 + cmp r5, 0 + bne _08185232 +_08185256: + mov r4, r8 + ldrb r0, [r4] + cmp r0, 0 + bne _08185202 +_0818525E: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81851A8 + + thumb_func_start sub_8185278 +sub_8185278: @ 8185278 + ldrb r3, [r2] + subs r3, 0x1 + strb r3, [r2] + ldrb r2, [r1] + adds r3, r2, 0x1 + strb r3, [r1] + lsls r2, 24 + lsrs r2, 24 + adds r0, r2 + ldrb r0, [r0] + bx lr + thumb_func_end sub_8185278 + + thumb_func_start sub_8185290 +sub_8185290: @ 8185290 + push {r4,r5,lr} + movs r0, 0xF8 + lsls r0, 4 + bl AllocZeroed + adds r4, r0, 0 + bl start_ov_to_battle_anim + adds r5, r0, 0 + adds r0, r4, 0 + bl Free + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8185290 + + thumb_func_start sub_81852B0 +sub_81852B0: @ 81852B0 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r1, =0x000004ec + adds r0, r5, r1 + ldr r1, [r0] + cmp r1, 0 + beq _081852E8 + ldr r0, =0x7d007e92 + ands r1, r0 + cmp r1, 0 + bne _081852E8 + ldr r4, =0x00000f7c + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_806F96C + adds r4, r5, r4 + ldr r1, [r4] + cmp r0, r1 + bne _081852E8 + movs r0, 0x1 + b _081852EA + .pool +_081852E8: + movs r0, 0 +_081852EA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81852B0 + + thumb_func_start sub_81852F0 +sub_81852F0: @ 81852F0 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x80 + lsls r2, 5 + adds r0, r5, 0 + movs r1, 0 + bl memset + movs r2, 0xF8 + lsls r2, 4 + adds r0, r5, 0 + adds r1, r4, 0 + bl memcpy + ldr r4, =0x00000f7c + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_806F96C + adds r4, r5, r4 + str r0, [r4] + movs r0, 0x1F + adds r1, r5, 0 + bl sub_8153634 + cmp r0, 0x1 + bne _08185330 + movs r0, 0x1 + b _08185332 + .pool +_08185330: + movs r0, 0 +_08185332: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81852F0 + + thumb_func_start sub_8185338 +sub_8185338: @ 8185338 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + movs r0, 0 + str r0, [sp, 0x4] + movs r0, 0xF8 + lsls r0, 4 + bl AllocZeroed + adds r7, r0, 0 + movs r0, 0x80 + lsls r0, 5 + bl AllocZeroed + str r0, [sp] + movs r6, 0 +_0818535E: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + adds r5, r7, r4 + ldr r1, =0x0203c7c0 + adds r1, r4, r1 + adds r0, r5, 0 + movs r2, 0x64 + bl memcpy + movs r1, 0x96 + lsls r1, 2 + adds r5, r1 + ldr r0, =0x0203ca18 + adds r4, r0 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy + adds r6, 0x1 + cmp r6, 0x5 + ble _0818535E + movs r6, 0 + ldr r2, =0x03005d90 + mov r9, r2 + movs r3, 0x9A + lsls r3, 3 + adds r3, r7, r3 + str r3, [sp, 0x8] + ldr r5, =0x0203cc80 + mov r8, r6 + mov r12, r6 + movs r4, 0x96 + lsls r4, 3 + adds r4, r7 + mov r10, r4 + ldr r0, =0x000004e4 + adds r4, r7, r0 +_081853AC: + lsls r1, r6, 3 + ldr r0, =0x0203cc80 + adds r0, 0x4 + mov r3, r8 + adds r2, r3, r0 + add r1, r10 + movs r3, 0x7 +_081853BA: + ldrb r0, [r2] + strb r0, [r1] + adds r2, 0x1 + adds r1, 0x1 + subs r3, 0x1 + cmp r3, 0 + bge _081853BA + ldr r0, [sp, 0x8] + adds r1, r0, r6 + ldrb r0, [r5, 0xC] + strb r0, [r1] + ldrh r0, [r5, 0x10] + strb r0, [r4] + ldrh r0, [r5, 0xE] + strb r0, [r4, 0xC] + ldr r1, =0x000004d4 + adds r0, r7, r1 + add r0, r12 + ldr r1, [r5] + str r1, [r0] + adds r5, 0x14 + movs r2, 0x14 + add r8, r2 + movs r3, 0x4 + add r12, r3 + adds r4, 0x1 + adds r6, 0x1 + cmp r6, 0x3 + ble _081853AC + movs r4, 0x9D + lsls r4, 3 + adds r1, r7, r4 + ldr r5, =0x0203bd2c + ldr r0, [r5] + str r0, [r1] + ldr r0, =0x0203c7b8 + ldr r2, [r0] + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _081854DC + ldr r1, =0x000004ec + adds r3, r7, r1 + movs r1, 0x23 + negs r1, r1 + ands r1, r2 + movs r0, 0x80 + lsls r0, 18 + orrs r1, r0 + str r1, [r3] + movs r0, 0x4 + ands r0, r2 + cmp r0, 0 + beq _08185454 + movs r0, 0x80 + lsls r0, 24 + orrs r1, r0 + str r1, [r3] + b _081854E2 + .pool +_08185454: + movs r0, 0x40 + ands r2, r0 + cmp r2, 0 + beq _081854E2 + ldr r2, =0x0203cc80 + ldrh r0, [r2, 0xE] + cmp r0, 0x1 + beq _081854A8 + cmp r0, 0x1 + bgt _08185474 + cmp r0, 0 + beq _0818547E + b _081854E2 + .pool +_08185474: + cmp r0, 0x2 + beq _0818547E + cmp r0, 0x3 + beq _081854A8 + b _081854E2 +_0818547E: + ldr r3, =0x0203c7b4 + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x0203cc80 + adds r0, r4 + ldrh r1, [r0, 0xE] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081854E2 + ldr r5, =0x000004ec + adds r0, r7, r5 + b _081854C4 + .pool +_081854A8: + ldr r0, =0x0203c7b4 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x0203cc80 + adds r0, r1 + ldrh r1, [r0, 0xE] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081854E2 + ldr r2, =0x000004ec + adds r0, r7, r2 +_081854C4: + ldr r1, [r0] + movs r2, 0x80 + lsls r2, 24 + orrs r1, r2 + str r1, [r0] + b _081854E2 + .pool +_081854DC: + ldr r3, =0x000004ec + adds r0, r7, r3 + str r2, [r0] +_081854E2: + ldr r4, =0x02038bca + ldrh r1, [r4] + ldr r5, =0x000004f4 + adds r0, r7, r5 + strh r1, [r0] + ldr r0, =0x02038bcc + ldrh r1, [r0] + ldr r2, =0x000004f6 + adds r0, r7, r2 + strh r1, [r0] + ldr r3, =0x02038bce + ldrh r1, [r3] + movs r4, 0x9F + lsls r4, 3 + adds r0, r7, r4 + strh r1, [r0] + ldr r5, =0x0203c7b4 + ldrb r1, [r5] + adds r2, 0x4 + adds r0, r7, r2 + strh r1, [r0] + mov r3, r9 + ldr r0, [r3] + ldr r4, =0x00000ca9 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + ldr r5, =0x000004fc + adds r1, r7, r5 + strb r0, [r1] + ldr r0, =0x0203c7ae + ldrb r1, [r0] + adds r2, 0x3 + adds r0, r7, r2 + strb r1, [r0] + ldr r3, =0x0203c7af + ldrb r1, [r3] + ldr r4, =0x000004fe + adds r0, r7, r4 + strb r1, [r0] + mov r5, r9 + ldr r0, [r5] + ldrb r1, [r0, 0x15] + lsls r1, 29 + ldr r0, =0x000004ff + adds r3, r7, r0 + lsrs r1, 31 + ldrb r2, [r3] + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + ldr r1, [r5] + ldrb r1, [r1, 0x14] + lsls r1, 29 + lsrs r1, 28 + movs r2, 0xF + negs r2, r2 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + movs r2, 0xA0 + lsls r2, 3 + adds r1, r7, r2 + ldr r3, =0x0203c7bc + ldr r0, [r3] + str r0, [r1] + ldr r4, =0xfffffed4 + adds r1, r4, 0 + ldr r5, =0x02038bca + ldrh r5, [r5] + adds r0, r1, r5 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x63 + bls _08185580 + b _081856C4 +_08185580: + movs r6, 0 + ldr r0, =0x00000504 + adds r3, r7, r0 + mov r10, r9 + ldr r1, =0x02038bca + mov r12, r1 + adds r2, r4, 0 + mov r8, r2 + ldr r4, =0x0000073c +_08185592: + adds r2, r3, r6 + mov r5, r10 + ldr r1, [r5] + mov r5, r12 + ldrh r0, [r5] + add r0, r8 + movs r5, 0xEC + muls r0, r5 + adds r0, r6, r0 + adds r1, r4 + adds r1, r0 + ldrb r0, [r1] + strb r0, [r2] + adds r6, 0x1 + cmp r6, 0x7 + ble _08185592 + mov r0, r9 + ldr r2, [r0] + ldr r1, =0x02038bca + ldrh r0, [r1] + ldr r3, =0xfffffed4 + adds r0, r3 + movs r1, 0xEC + muls r0, r1 + adds r2, r0 + ldr r4, =0x00000739 + adds r2, r4 + ldrb r1, [r2] + ldr r5, =0x0000050c + adds r0, r7, r5 + strb r1, [r0] + ldr r1, =0x0203cce8 + ldrb r0, [r1] + cmp r0, 0x1 + bne _08185664 + movs r6, 0 + ldr r2, =0x0000050e + adds r4, r7, r2 + mov r10, r9 + ldr r5, =0x02038bca + mov r8, r5 + adds r5, r3, 0 +_081855E6: + lsls r3, r6, 1 + mov r0, r10 + ldr r2, [r0] + mov r1, r8 + ldrh r0, [r1] + adds r0, r5 + movs r1, 0xEC + muls r0, r1 + adds r3, r0 + movs r0, 0xEC + lsls r0, 3 + adds r2, r0 + adds r2, r3 + ldrh r0, [r2] + strh r0, [r4] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x5 + ble _081855E6 + b _08185696 + .pool +_08185664: + movs r6, 0 + ldr r1, =0x0000050e + adds r4, r7, r1 + mov r10, r9 + ldr r2, =0x02038bca + mov r8, r2 + adds r5, r3, 0 +_08185672: + lsls r3, r6, 1 + mov r0, r10 + ldr r2, [r0] + mov r1, r8 + ldrh r0, [r1] + adds r0, r5 + movs r1, 0xEC + muls r0, r1 + adds r3, r0 + ldr r0, =0x00000754 + adds r2, r0 + adds r2, r3 + ldrh r0, [r2] + strh r0, [r4] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x5 + ble _08185672 +_08185696: + mov r1, r9 + ldr r2, [r1] + ldr r3, =0x02038bca + ldrh r0, [r3] + ldr r4, =0xfffffed4 + adds r0, r4 + movs r1, 0xEC + muls r0, r1 + adds r2, r0 + ldr r5, =0x0000081c + adds r2, r5 + ldrb r1, [r2] + b _08185856 + .pool +_081856C4: + ldr r3, =0x02038bcc + ldrh r3, [r3] + adds r0, r1, r3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x63 + bls _081856D4 + b _081857E4 +_081856D4: + movs r6, 0 + ldr r4, =0x00000504 + adds r3, r7, r4 + mov r10, r9 + ldr r5, =0x02038bcc + mov r12, r5 + ldr r0, =0xfffffed4 + mov r8, r0 + ldr r4, =0x0000073c +_081856E6: + adds r2, r3, r6 + mov r5, r10 + ldr r1, [r5] + mov r5, r12 + ldrh r0, [r5] + add r0, r8 + movs r5, 0xEC + muls r0, r5 + adds r0, r6, r0 + adds r1, r4 + adds r1, r0 + ldrb r0, [r1] + strb r0, [r2] + adds r6, 0x1 + cmp r6, 0x7 + ble _081856E6 + mov r0, r9 + ldr r2, [r0] + ldr r1, =0x02038bcc + ldrh r0, [r1] + ldr r3, =0xfffffed4 + adds r0, r3 + movs r1, 0xEC + muls r0, r1 + adds r2, r0 + ldr r4, =0x00000739 + adds r2, r4 + ldrb r1, [r2] + ldr r5, =0x0000050c + adds r0, r7, r5 + strb r1, [r0] + ldr r1, =0x0203cce8 + ldrb r0, [r1] + cmp r0, 0x1 + bne _08185784 + movs r6, 0 + ldr r2, =0x0000050e + adds r4, r7, r2 + mov r10, r9 + ldr r5, =0x02038bcc + mov r8, r5 + adds r5, r3, 0 +_0818573A: + lsls r3, r6, 1 + mov r0, r10 + ldr r2, [r0] + mov r1, r8 + ldrh r0, [r1] + adds r0, r5 + movs r1, 0xEC + muls r0, r1 + adds r3, r0 + movs r0, 0xEC + lsls r0, 3 + adds r2, r0 + adds r2, r3 + ldrh r0, [r2] + strh r0, [r4] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x5 + ble _0818573A + b _081857B6 + .pool +_08185784: + movs r6, 0 + ldr r1, =0x0000050e + adds r4, r7, r1 + mov r10, r9 + ldr r2, =0x02038bcc + mov r8, r2 + adds r5, r3, 0 +_08185792: + lsls r3, r6, 1 + mov r0, r10 + ldr r2, [r0] + mov r1, r8 + ldrh r0, [r1] + adds r0, r5 + movs r1, 0xEC + muls r0, r1 + adds r3, r0 + ldr r0, =0x00000754 + adds r2, r0 + adds r2, r3 + ldrh r0, [r2] + strh r0, [r4] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x5 + ble _08185792 +_081857B6: + mov r1, r9 + ldr r2, [r1] + ldr r3, =0x02038bcc + ldrh r0, [r3] + ldr r4, =0xfffffed4 + adds r0, r4 + movs r1, 0xEC + muls r0, r1 + adds r2, r0 + ldr r5, =0x0000081c + adds r2, r5 + ldrb r1, [r2] + b _08185856 + .pool +_081857E4: + ldr r3, =0x02038bce + ldrh r3, [r3] + adds r0, r1, r3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x63 + bhi _0818585C + movs r6, 0 + ldr r4, =0x00000504 + adds r3, r7, r4 + mov r10, r9 + ldr r5, =0x02038bce + mov r12, r5 + ldr r0, =0xfffffed4 + mov r8, r0 + ldr r4, =0x0000073c +_08185804: + adds r2, r3, r6 + mov r5, r10 + ldr r1, [r5] + mov r5, r12 + ldrh r0, [r5] + add r0, r8 + movs r5, 0xEC + muls r0, r5 + adds r0, r6, r0 + adds r1, r4 + adds r1, r0 + ldrb r0, [r1] + strb r0, [r2] + adds r6, 0x1 + cmp r6, 0x7 + ble _08185804 + mov r0, r9 + ldr r1, [r0] + ldr r2, =0x02038bce + ldrh r0, [r2] + ldr r3, =0xfffffed4 + adds r0, r3 + movs r2, 0xEC + muls r0, r2 + adds r1, r0 + ldr r4, =0x00000739 + adds r1, r4 + ldrb r1, [r1] + ldr r5, =0x0000050c + adds r0, r7, r5 + strb r1, [r0] + mov r0, r9 + ldr r1, [r0] + ldr r4, =0x02038bce + ldrh r0, [r4] + adds r0, r3 + muls r0, r2 + adds r1, r0 + ldr r5, =0x0000081c + adds r1, r5 + ldrb r1, [r1] +_08185856: + ldr r2, =0x0000051a + adds r0, r7, r2 + strb r1, [r0] +_0818585C: + ldr r3, =0x02038bca + ldrh r0, [r3] + ldr r1, =0x0000018f + cmp r0, r1 + bls _08185900 + mov r4, r9 + ldr r2, [r4] + adds r1, r0, 0 + ldr r3, =0xfffffe70 + adds r1, r3 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, r0 + adds r2, 0xDC + ldrb r0, [r2] + lsls r0, 27 + lsrs r0, 27 + ldr r5, =0x0000050d + adds r1, r7, r5 + strb r0, [r1] + movs r6, 0 + ldr r0, =0x0000050e + adds r4, r7, r0 + mov r10, r9 + ldr r1, =0x02038bca + mov r8, r1 + adds r5, r3, 0 +_08185894: + lsls r3, r6, 1 + mov r0, r10 + ldr r2, [r0] + mov r0, r8 + ldrh r1, [r0] + adds r1, r5 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, r0 + movs r1, 0x82 + lsls r1, 1 + adds r2, r1 + adds r2, r3 + ldrh r0, [r2] + strh r0, [r4] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x5 + ble _08185894 + mov r3, r9 + ldr r2, [r3] + ldr r4, =0x02038bca + ldrh r1, [r4] + ldr r5, =0xfffffe70 + adds r1, r5 + b _081859AC + .pool +_08185900: + ldr r3, =0x02038bcc + ldrh r0, [r3] + cmp r0, r1 + bls _0818597C + mov r4, r9 + ldr r2, [r4] + adds r1, r0, 0 + ldr r3, =0xfffffe70 + adds r1, r3 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, r0 + adds r2, 0xDC + ldrb r0, [r2] + lsls r0, 27 + lsrs r0, 27 + ldr r5, =0x0000050d + adds r1, r7, r5 + strb r0, [r1] + movs r6, 0 + ldr r0, =0x0000050e + adds r4, r7, r0 + mov r10, r9 + ldr r1, =0x02038bcc + mov r8, r1 + adds r5, r3, 0 +_08185936: + lsls r3, r6, 1 + mov r0, r10 + ldr r2, [r0] + mov r0, r8 + ldrh r1, [r0] + adds r1, r5 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, r0 + movs r1, 0x82 + lsls r1, 1 + adds r2, r1 + adds r2, r3 + ldrh r0, [r2] + strh r0, [r4] + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x5 + ble _08185936 + mov r3, r9 + ldr r2, [r3] + ldr r4, =0x02038bcc + ldrh r1, [r4] + ldr r5, =0xfffffe70 + adds r1, r5 + b _081859AC + .pool +_0818597C: + ldr r3, =0x02038bce + ldrh r0, [r3] + cmp r0, r1 + bls _081859C0 + mov r4, r9 + ldr r2, [r4] + adds r1, r0, 0 + ldr r3, =0xfffffe70 + adds r1, r3 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, r0 + adds r2, 0xDC + ldrb r0, [r2] + lsls r0, 27 + lsrs r0, 27 + ldr r5, =0x0000050d + adds r1, r7, r5 + strb r0, [r1] + ldr r2, [r4] + ldr r0, =0x02038bce + ldrh r1, [r0] + adds r1, r3 +_081859AC: + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, r0 + ldr r1, =0x0000011b + adds r0, r2, r1 + ldrb r1, [r0] + ldr r2, =0x0000051b + adds r0, r7, r2 + strb r1, [r0] +_081859C0: + movs r6, 0 + ldr r3, =0x00000297 + mov r10, r3 + ldr r4, =0x0203bd34 + mov r9, r4 + movs r5, 0xA6 + lsls r5, 2 + mov r8, r5 + ldr r0, =0x0000051c + adds r5, r7, r0 +_081859D4: + adds r4, r6, 0x1 + mov r0, r8 + muls r0, r6 + mov r1, r9 + adds r2, r0, r1 + adds r1, r0, r5 + mov r3, r10 + adds r3, 0x1 +_081859E4: + ldrb r0, [r2] + strb r0, [r1] + adds r2, 0x1 + adds r1, 0x1 + subs r3, 0x1 + cmp r3, 0 + bne _081859E4 + adds r6, r4, 0 + cmp r6, 0x3 + ble _081859D4 +_081859F8: + adds r0, r7, 0 + ldr r1, [sp] + bl sub_81852F0 + adds r4, r0, 0 + cmp r4, 0x1 + beq _08185A14 + ldr r0, [sp, 0x4] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + cmp r0, 0x2 + bls _081859F8 +_08185A14: + adds r0, r7, 0 + bl Free + ldr r0, [sp] + bl Free + adds r0, r4, 0 + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8185338 + + thumb_func_start sub_8185A54 +sub_8185A54: @ 8185A54 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r0, 0x1F + bl sub_81535DC + cmp r0, 0x1 + bne _08185A7E + movs r2, 0xF8 + lsls r2, 4 + adds r0, r5, 0 + adds r1, r4, 0 + bl memcpy + adds r0, r5, 0 + bl sub_81852B0 + cmp r0, 0 + beq _08185A7E + movs r0, 0x1 + b _08185A80 +_08185A7E: + movs r0, 0 +_08185A80: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8185A54 + + thumb_func_start start_ov_to_battle_anim +start_ov_to_battle_anim: @ 8185A88 + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x80 + lsls r0, 5 + bl AllocZeroed + adds r5, r0, 0 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8185A54 + adds r4, r0, 0 + adds r0, r5, 0 + bl Free + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end start_ov_to_battle_anim + + thumb_func_start sub_8185AB0 +sub_8185AB0: @ 8185AB0 + push {lr} + ldr r0, =0x03005d90 + ldr r2, [r0] + ldr r0, =0x0203c7ad + 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] + ldr r1, =0x0202433a + movs r0, 0 + strb r0, [r1] + ldr r0, =0x02022fec + movs r1, 0 + str r1, [r0] + ldr r0, =0x02038bca + strh r1, [r0] + ldr r0, =0x02038bcc + strh r1, [r0] + ldr r0, =0x02038bce + strh r1, [r0] + bl sub_8185EFC + ldr r0, =0x0203c7b0 + ldr r0, [r0] + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8185AB0 + + thumb_func_start sub_8185B1C +sub_8185B1C: @ 8185B1C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + subs r1, 0x1 + strh r1, [r0, 0x8] + lsls r1, 16 + cmp r1, 0 + bne _08185B4A + ldr r0, =0x030022c0 + ldr r1, =sub_8185AB0 + str r1, [r0, 0x8] + ldr r0, =sub_8036760 + bl SetMainCallback2 + adds r0, r4, 0 + bl DestroyTask +_08185B4A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8185B1C + + thumb_func_start sub_8185B60 +sub_8185B60: @ 8185B60 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r7, r0, 0 + bl zero_player_party_data + bl zero_enemy_party_data + movs r6, 0 + ldr r0, =0x020244ec + mov r8, r0 +_08185B7C: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + mov r1, r8 + adds r0, r4, r1 + adds r5, r7, r4 + adds r1, r5, 0 + movs r2, 0x64 + bl memcpy + ldr r0, =0x02024744 + adds r4, r0 + movs r2, 0x96 + lsls r2, 2 + adds r5, r2 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x64 + bl memcpy + adds r6, 0x1 + cmp r6, 0x5 + ble _08185B7C + movs r6, 0 + ldr r3, =0x020229e8 + mov r8, r3 + mov r0, r8 + adds r0, 0x8 + str r0, [sp] + mov r4, r8 + adds r4, 0x4 + mov r10, r6 + mov r9, r6 +_08185BBE: + movs r1, 0 + mov r12, r1 + lsls r5, r6, 2 + movs r2, 0x96 + lsls r2, 3 + adds r0, r7, r2 + mov r3, r9 + adds r2, r3, r0 + mov r0, r10 + lsls r1, r0, 2 + mov r0, r8 + adds r0, 0x8 + adds r1, r0 + movs r3, 0x7 +_08185BDA: + ldrb r0, [r2] + strb r0, [r1] + ldrb r0, [r2] + cmp r0, 0xFF + bne _08185BE8 + movs r0, 0x1 + mov r12, r0 +_08185BE8: + adds r2, 0x1 + adds r1, 0x1 + subs r3, 0x1 + cmp r3, 0 + bge _08185BDA + movs r1, 0x9A + lsls r1, 3 + adds r0, r7, r1 + adds r0, r6 + ldrb r0, [r0] + strb r0, [r4, 0xF] + ldr r2, =0x000004e4 + adds r0, r7, r2 + adds r0, r6 + ldrb r1, [r0] + strh r1, [r4, 0x16] + movs r3, 0x9E + lsls r3, 3 + adds r0, r7, r3 + adds r0, r6 + ldrb r0, [r0] + strh r0, [r4, 0x14] + subs r2, 0x10 + adds r0, r7, r2 + adds r0, r5 + ldr r0, [r0] + str r0, [r4] + mov r3, r12 + cmp r3, 0 + beq _08185C2A + ldr r0, [sp] + bl StopMusicWhileStringIsPrinted +_08185C2A: + ldr r0, [sp] + adds r0, 0x1C + str r0, [sp] + adds r4, 0x1C + movs r1, 0x7 + add r10, r1 + movs r2, 0x8 + add r9, r2 + adds r6, 0x1 + cmp r6, 0x3 + ble _08185BBE + ldr r1, =0x0203bd2c + movs r3, 0x9D + lsls r3, 3 + adds r0, r7, r3 + ldr r0, [r0] + str r0, [r1] + ldr r2, =0x02022fec + ldr r1, =0x000004ec + adds r0, r7, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + orrs r0, r1 + str r0, [r2] + ldr r1, =0x02038bca + ldr r2, =0x000004f4 + adds r0, r7, r2 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, =0x02038bcc + adds r3, 0xE + adds r0, r7, r3 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, =0x02038bce + adds r2, 0x4 + adds r0, r7, r2 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, =0x0203c7b4 + adds r3, 0x4 + adds r0, r7, r3 + ldrh r0, [r0] + strb r0, [r1] + ldr r1, =0x0203c7ad + ldr r3, =0x03005d90 + ldr r0, [r3] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r0, 30 + strb r0, [r1] + ldr r1, =0x0203c7ae + ldr r2, =0x000004fd + adds r0, r7, r2 + ldrb r0, [r0] + strb r0, [r1] + ldr r1, =0x0203c7af + adds r2, 0x1 + adds r0, r7, r2 + ldrb r0, [r0] + strb r0, [r1] + ldr r2, =0x0203c7b6 + ldr r1, =0x000004ff + adds r0, r7, r1 + ldrb r1, [r0] + lsls r0, r1, 31 + lsrs r0, 31 + strb r0, [r2] + ldr r0, =0x0203c7b7 + lsls r1, 28 + lsrs r1, 29 + strb r1, [r0] + ldr r1, =0x0203c7bc + movs r2, 0xA0 + lsls r2, 3 + adds r0, r7, r2 + ldr r0, [r0] + str r0, [r1] + movs r6, 0 + mov r10, r3 + ldr r2, =0x0203ccd9 + ldr r3, =0x0203ccda + ldr r0, =0x03001278 + mov r8, r0 + ldr r1, =0x03001279 + mov r9, r1 + ldr r5, =0x0203ccd1 + ldr r0, =0x00000504 + adds r4, r7, r0 +_08185CE2: + adds r0, r6, r5 + adds r1, r4, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0x7 + ble _08185CE2 + ldr r1, =0x0000050c + adds r0, r7, r1 + ldrb r0, [r0] + strb r0, [r2] + ldr r2, =0x0000050d + adds r0, r7, r2 + ldrb r0, [r0] + strb r0, [r3] + ldr r3, =0x0000051a + adds r0, r7, r3 + ldrb r0, [r0] + mov r1, r8 + strb r0, [r1] + adds r2, 0xE + adds r0, r7, r2 + ldrb r0, [r0] + mov r3, r9 + strb r0, [r3] + ldr r0, =0x0000050e + adds r1, r7, r0 + ldr r4, =0x0203ccdc + movs r6, 0x5 +_08185D1C: + ldrh r0, [r1] + strh r0, [r4] + adds r1, 0x2 + adds r4, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _08185D1C + mov r1, r10 + ldr r2, [r1] + ldr r3, =0x000004fc + adds r0, r7, r3 + 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] + movs r6, 0 + ldr r2, =0x00000297 + mov r10, r2 + ldr r3, =0x0203bd34 + mov r9, r3 + movs r0, 0xA6 + lsls r0, 2 + mov r8, r0 + ldr r1, =0x0000051c + adds r5, r7, r1 +_08185D5C: + adds r2, r6, 0x1 + mov r0, r8 + muls r0, r6 + adds r1, r0, r5 + mov r3, r9 + adds r4, r0, r3 + mov r3, r10 + adds r3, 0x1 +_08185D6C: + ldrb r0, [r1] + strb r0, [r4] + adds r1, 0x1 + adds r4, 0x1 + subs r3, 0x1 + cmp r3, 0 + bne _08185D6C + adds r6, r2, 0 + cmp r6, 0x3 + ble _08185D5C + 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_8185B60 + + thumb_func_start sub_8185E24 +sub_8185E24: @ 8185E24 + push {r4,r5,lr} + adds r5, r0, 0 + movs r0, 0xF8 + lsls r0, 4 + bl AllocZeroed + adds r4, r0, 0 + bl start_ov_to_battle_anim + cmp r0, 0x1 + bne _08185E6E + bl sub_8185EB8 + adds r0, r4, 0 + bl sub_8185B60 + ldr r0, =sub_8185B1C + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x80 + strh r0, [r1, 0x8] + ldr r0, =0x0203c7b0 + str r5, [r0] + movs r0, 0 + bl current_map_music_set__default_for_battle + ldr r0, =sub_8185E8C + bl SetMainCallback2 +_08185E6E: + adds r0, r4, 0 + bl Free + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8185E24 + + thumb_func_start sub_8185E8C +sub_8185E8C: @ 8185E8C + push {lr} + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTasks + pop {r0} + bx r0 + thumb_func_end sub_8185E8C + + thumb_func_start sub_8185EA0 +sub_8185EA0: @ 8185EA0 + ldr r0, =0x0203c7ae + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8185EA0 + + thumb_func_start sub_8185EAC +sub_8185EAC: @ 8185EAC + ldr r0, =0x0203c7af + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8185EAC + + thumb_func_start sub_8185EB8 +sub_8185EB8: @ 8185EB8 + push {r4-r6,lr} + movs r5, 0 + ldr r6, =0x0203c7c0 +_08185EBE: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + adds r0, r4, r6 + ldr r1, =0x020244ec + adds r1, r4, r1 + movs r2, 0x64 + bl memcpy + ldr r0, =0x0203ca18 + adds r0, r4, r0 + ldr r1, =0x02024744 + adds r4, r1 + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy + adds r5, 0x1 + cmp r5, 0x5 + ble _08185EBE + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8185EB8 + + thumb_func_start sub_8185EFC +sub_8185EFC: @ 8185EFC + push {r4-r6,lr} + movs r5, 0 + ldr r6, =0x020244ec +_08185F02: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + adds r0, r4, r6 + ldr r1, =0x0203c7c0 + adds r1, r4, r1 + movs r2, 0x64 + bl memcpy + ldr r0, =0x02024744 + adds r0, r4, r0 + ldr r1, =0x0203ca18 + adds r4, r1 + adds r1, r4, 0 + movs r2, 0x64 + bl memcpy + adds r5, 0x1 + cmp r5, 0x5 + ble _08185F02 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8185EFC + + thumb_func_start sub_8185F40 +sub_8185F40: @ 8185F40 + push {r4,r5,lr} + movs r2, 0 + ldr r0, =0x020229e8 + ldr r3, =0x02024064 + ldrh r1, [r0, 0x18] + adds r4, r0, 0 + ldrb r0, [r3] + cmp r1, r0 + beq _08185F64 + adds r1, r4, 0 +_08185F54: + adds r1, 0x1C + adds r2, 0x1 + cmp r2, 0x3 + bgt _08185F64 + ldrh r0, [r1, 0x18] + ldrb r5, [r3] + cmp r0, r5 + bne _08185F54 +_08185F64: + cmp r2, 0x4 + bne _08185F74 + movs r0, 0 + b _08185F7E + .pool +_08185F74: + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x13] +_08185F7E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8185F40 + + thumb_func_start sub_8185F84 +sub_8185F84: @ 8185F84 + ldr r1, =0x0203c7b5 + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_8185F84 + + thumb_func_start sub_8185F90 +sub_8185F90: @ 8185F90 + lsls r0, 16 + lsrs r0, 16 + ldr r2, =0x0203c7b5 + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + lsls r0, 16 + lsrs r0, 31 + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] + bx lr + .pool + thumb_func_end sub_8185F90 + + thumb_func_start sub_8185FAC +sub_8185FAC: @ 8185FAC + ldr r0, =0x0203c7b5 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8185FAC + + thumb_func_start sub_8185FB8 +sub_8185FB8: @ 8185FB8 + ldr r0, =0x0203c7b6 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8185FB8 + + thumb_func_start sub_8185FC4 +sub_8185FC4: @ 8185FC4 + ldr r0, =0x0203c7b7 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_8185FC4 + + thumb_func_start sub_8185FD0 +sub_8185FD0: @ 8185FD0 + push {r4-r7,lr} + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0818601C + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x02000002 + ands r0, r1 + cmp r0, 0 + bne _0818601C + ldr r0, =0x0203c7ac + ldrb r0, [r0] + cmp r0, 0x2 + beq _0818601C + movs r3, 0 + ldr r7, =0x0203cc70 + adds r6, r4, 0 + ldr r5, =0x02024090 + movs r4, 0x58 +_08186000: + lsls r2, r3, 1 + ldrb r1, [r6] + lsrs r0, r1, 1 + lsls r0, 3 + adds r0, r2, r0 + adds r0, r7 + muls r1, r4 + adds r2, r1 + adds r2, r5 + ldrh r1, [r2] + strh r1, [r0] + adds r3, 0x1 + cmp r3, 0x3 + ble _08186000 +_0818601C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8185FD0 + + thumb_func_start sub_818603C +sub_818603C: @ 818603C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x50 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x24] + ldr r0, =0x02022fec + ldr r0, [r0] + ldr r1, =0x02000002 + ands r0, r1 + cmp r0, 0 + beq _0818605C + b _081863FC +_0818605C: + movs r0, 0 + mov r10, r0 + b _081863F2 + .pool +_0818606C: + mov r1, r10 + lsls r4, r1, 24 + lsrs r5, r4, 24 + adds r0, r5, 0 + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + str r4, [sp, 0x4C] + mov r2, r10 + adds r2, 0x1 + str r2, [sp, 0x38] + cmp r0, 0x1 + bne _0818608A + b _081863EE +_0818608A: + ldr r3, [sp, 0x24] + cmp r3, 0x1 + bne _0818611E + movs r5, 0 + ldr r4, =0x0203cc70 + mov r0, r10 + asrs r6, r0, 31 + subs r0, r6 + asrs r0, 1 + lsls r0, 3 + adds r2, r0, r4 + movs r1, 0x58 + mov r0, r10 + muls r0, r1 + ldr r3, =0x02024090 + adds r1, r0, r3 +_081860AA: + ldrh r0, [r1] + ldrh r4, [r2] + cmp r0, r4 + bne _081860BC + adds r2, 0x2 + adds r1, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _081860AA +_081860BC: + cmp r5, 0x4 + bne _081860C2 + b _081863EE +_081860C2: + ldr r1, [sp, 0x4C] + lsrs r0, r1, 24 + movs r1, 0x6 + bl sub_8184FBC + movs r5, 0 + ldr r2, =0x0203cc70 + mov r8, r2 + movs r3, 0x58 + mov r7, r10 + muls r7, r3 + mov r4, r10 + subs r0, r4, r6 + asrs r4, r0, 1 +_081860DE: + movs r2, 0 + lsls r0, r5, 1 + adds r5, 0x1 + adds r0, r7 + ldr r1, =0x02024090 + adds r3, r0, r1 + lsls r0, r4, 3 + mov r6, r8 + adds r1, r0, r6 +_081860F0: + ldrh r0, [r3] + ldrh r6, [r1] + cmp r0, r6 + bne _08186110 + lsls r1, r2, 24 + lsrs r1, 24 + ldr r2, [sp, 0x4C] + lsrs r0, r2, 24 + bl sub_8184FBC + b _08186118 + .pool +_08186110: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x3 + ble _081860F0 +_08186118: + cmp r5, 0x3 + ble _081860DE + b _081863EE +_0818611E: + ldr r3, =0x0203bd34 + ldr r1, =0x0203c794 + mov r4, r10 + lsls r2, r4, 1 + adds r1, r2, r1 + movs r0, 0xA6 + lsls r0, 2 + mov r6, r10 + muls r6, r0 + adds r0, r6, 0 + ldrh r1, [r1] + adds r0, r1 + adds r0, r3 + ldrb r0, [r0] + str r2, [sp, 0x44] + cmp r0, 0x6 + beq _08186142 + b _081863EE +_08186142: + adds r0, r5, 0 + bl sub_8185054 + movs r5, 0 + mov r0, sp + adds r0, 0x4 + str r0, [sp, 0x28] + mov r1, sp + adds r1, 0xC + str r1, [sp, 0x30] + mov r2, sp + adds r2, 0x14 + str r2, [sp, 0x34] + mov r3, sp + adds r3, 0x18 + str r3, [sp, 0x3C] + mov r4, sp + adds r4, 0x8 + str r4, [sp, 0x2C] + mov r6, r10 + lsls r6, 3 + str r6, [sp, 0x48] + movs r1, 0x58 + mov r0, r10 + muls r0, r1 + ldr r2, =0x02024084 + adds r0, r2 + adds r6, r0, 0 + adds r6, 0x3B + movs r4, 0x3 +_0818617E: + mov r0, sp + adds r3, r0, r5 + ldrb r1, [r6] + lsls r2, r5, 1 + adds r0, r4, 0 + lsls r0, r2 + ands r1, r0 + asrs r1, r2 + strb r1, [r3] + adds r5, 0x1 + cmp r5, 0x3 + ble _0818617E + movs r5, 0 + ldr r1, =0x02024084 + mov r9, r1 + movs r2, 0x58 + mov r7, r10 + muls r7, r2 + ldr r4, [sp, 0x28] + ldr r6, [sp, 0x30] +_081861A6: + ldr r3, [sp, 0x4C] + lsrs r0, r3, 24 + bl sub_8185054 + strb r0, [r4] + ldrb r0, [r4] + lsls r0, 1 + adds r0, r7 + movs r1, 0xC + add r1, r9 + mov r8, r1 + add r0, r8 + ldrh r0, [r0] + strh r0, [r6] + ldr r2, [sp, 0x34] + adds r1, r2, r5 + ldrb r0, [r4] + adds r0, r7 + ldr r3, =0x020240a8 + adds r0, r3 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, [sp, 0x3C] + adds r1, r0, r5 + ldrb r0, [r4] + add r0, sp + ldrb r0, [r0] + strb r0, [r1] + ldr r1, [sp, 0x2C] + adds r3, r1, r5 + ldr r2, [sp, 0x48] + mov r1, r10 + subs r0, r2, r1 + lsls r0, 2 + ldr r2, =0x020242bc + adds r0, r2 + ldrb r1, [r0, 0x18] + lsrs r1, 4 + ldr r2, =gUnknown_0832A328 + lsls r0, r5, 2 + adds r0, r2 + ldr r0, [r0] + ands r1, r0 + lsrs r1, r5 + strb r1, [r3] + adds r4, 0x1 + adds r6, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _081861A6 + movs r5, 0 + movs r3, 0xC + negs r3, r3 + add r3, r8 + mov r12, r3 + ldr r4, =0x020242bc + mov r9, r4 + movs r6, 0x58 + mov r1, r10 + muls r1, r6 + mov r0, r8 + adds r0, 0x18 + adds r4, r1, r0 + adds r3, r1, 0 + mov r7, r8 + ldr r6, [sp, 0x34] + ldr r2, [sp, 0x30] +_0818622C: + adds r1, r3, r7 + ldrh r0, [r2] + strh r0, [r1] + adds r0, r6, r5 + ldrb r0, [r0] + strb r0, [r4] + adds r4, 0x1 + adds r3, 0x2 + adds r2, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _0818622C + movs r0, 0x58 + mov r4, r10 + muls r4, r0 + mov r1, r12 + adds r0, r4, r1 + adds r0, 0x3B + movs r1, 0 + strb r1, [r0] + ldr r2, [sp, 0x48] + mov r6, r10 + subs r3, r2, r6 + lsls r3, 2 + mov r0, r9 + adds r2, r3, r0 + ldrb r1, [r2, 0x18] + movs r0, 0xF + ands r0, r1 + strb r0, [r2, 0x18] + movs r5, 0 + ldr r1, =0x02024084 + adds r4, r1 + adds r4, 0x3B + ldr r0, =0x020242bc + adds r6, r3, r0 +_08186274: + ldr r2, [sp, 0x3C] + adds r0, r2, r5 + ldrb r0, [r0] + lsls r1, r5, 1 + lsls r0, r1 + ldrb r1, [r4] + orrs r0, r1 + strb r0, [r4] + ldrb r2, [r6, 0x18] + lsrs r3, r2, 4 + ldr r1, [sp, 0x2C] + adds r0, r1, r5 + ldrb r1, [r0] + lsls r1, r5 + orrs r1, r3 + lsls r1, 4 + movs r0, 0xF + ands r0, r2 + orrs r0, r1 + strb r0, [r6, 0x18] + adds r5, 0x1 + cmp r5, 0x3 + ble _08186274 + movs r2, 0x58 + mov r0, r10 + muls r0, r2 + mov r1, r12 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 14 + ands r0, r1 + cmp r0, 0 + beq _081862BC + b _081863CA +_081862BC: + movs r5, 0 + mov r3, sp + adds r3, 0x20 + str r3, [sp, 0x40] + ldr r0, =0x0202406e + ldr r4, [sp, 0x44] + adds r6, r4, r0 +_081862CA: + ldrh r1, [r6] + movs r0, 0x64 + muls r0, r1 + ldr r4, =0x020244ec + adds r0, r4 + movs r1, 0x15 + movs r2, 0 + bl pokemon_getattr + mov r1, sp + adds r3, r1, r5 + lsls r2, r5, 1 + movs r1, 0x3 + lsls r1, r2 + ands r0, r1 + lsrs r0, r2 + strb r0, [r3] + adds r5, 0x1 + cmp r5, 0x3 + ble _081862CA + movs r5, 0 + ldr r0, =0x0202406e + ldr r2, [sp, 0x44] + adds r7, r2, r0 + movs r3, 0x64 + mov r9, r3 + mov r8, r4 + ldr r4, [sp, 0x28] + ldr r6, [sp, 0x30] +_08186304: + ldrh r0, [r7] + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + add r0, r8 + ldrb r1, [r4] + adds r1, 0xD + movs r2, 0 + bl pokemon_getattr + strh r0, [r6] + ldrh r0, [r7] + mov r2, r9 + muls r2, r0 + adds r0, r2, 0 + add r0, r8 + ldrb r1, [r4] + adds r1, 0x11 + movs r2, 0 + bl pokemon_getattr + ldr r3, [sp, 0x34] + adds r1, r3, r5 + strb r0, [r1] + ldr r0, [sp, 0x3C] + adds r1, r0, r5 + ldrb r0, [r4] + add r0, sp + ldrb r0, [r0] + strb r0, [r1] + adds r4, 0x1 + adds r6, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _08186304 + movs r5, 0 + ldr r0, =0x0202406e + ldr r1, [sp, 0x44] + adds r7, r1, r0 + movs r2, 0x64 + mov r9, r2 + ldr r3, =0x020244ec + mov r8, r3 + ldr r6, [sp, 0x30] + adds r6, 0x8 + ldr r4, [sp, 0x30] +_08186360: + ldrh r0, [r7] + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + add r0, r8 + adds r1, r5, 0 + adds r1, 0xD + adds r2, r4, 0 + bl pokemon_setattr + ldrh r0, [r7] + mov r2, r9 + muls r2, r0 + adds r0, r2, 0 + add r0, r8 + adds r1, r5, 0 + adds r1, 0x11 + adds r2, r6, 0 + bl pokemon_setattr + adds r6, 0x1 + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x3 + ble _08186360 + movs r0, 0 + ldr r3, [sp, 0x40] + strb r0, [r3] + movs r5, 0 + ldr r4, =0x0202406e + ldr r6, =0x020244ec + ldr r3, [sp, 0x3C] + ldr r2, [sp, 0x40] +_081863A2: + adds r0, r3, r5 + ldrb r1, [r0] + lsls r0, r5, 1 + lsls r1, r0 + ldrb r0, [r2] + orrs r0, r1 + strb r0, [r2] + adds r5, 0x1 + cmp r5, 0x3 + ble _081863A2 + ldr r1, [sp, 0x44] + adds r0, r1, r4 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + adds r0, r6 + movs r1, 0x15 + ldr r2, [sp, 0x40] + bl pokemon_setattr +_081863CA: + ldr r2, =0x02024274 + ldr r3, [sp, 0x44] + adds r2, r3, r2 + ldr r0, =0x0202449c + ldr r0, [r0] + add r0, r10 + adds r0, 0x80 + ldrb r0, [r0] + lsls r0, 1 + movs r4, 0x58 + mov r1, r10 + muls r1, r4 + adds r0, r1 + ldr r1, =0x02024084 + adds r1, 0xC + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] +_081863EE: + ldr r6, [sp, 0x38] + mov r10, r6 +_081863F2: + ldr r0, =0x0202406c + ldrb r0, [r0] + cmp r10, r0 + bge _081863FC + b _0818606C +_081863FC: + add sp, 0x50 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818603C + + thumb_func_start sub_8186438 +sub_8186438: @ 8186438 + ldr r0, =0x0203c7bc + ldr r0, [r0] + bx lr + .pool + thumb_func_end sub_8186438 + + thumb_func_start sub_8186444 +sub_8186444: @ 8186444 + ldr r1, =0x0203ccd0 + movs r0, 0x1 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_8186444 + + thumb_func_start rfu_lacks_rfufunc +rfu_lacks_rfufunc: @ 8186450 + push {lr} + movs r1, 0 + ldr r0, =0x0203ccd0 + ldrb r0, [r0] + cmp r0, 0 + bne _0818645E + movs r1, 0x1 +_0818645E: + adds r0, r1, 0 + pop {r1} + bx r1 + .pool + thumb_func_end rfu_lacks_rfufunc + + thumb_func_start sub_8186468 +sub_8186468: @ 8186468 + push {r4,r5,lr} + adds r3, r0, 0 + movs r2, 0 + ldr r5, =0x03001278 + ldr r4, =0x0203ccd1 +_08186472: + adds r0, r3, r2 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x7 + ble _08186472 + movs r0, 0xFF + strb r0, [r3, 0x7] + ldrb r1, [r5] + adds r0, r3, 0 + bl StopMusicWhileStringIsPrinted + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8186468 + + thumb_func_start sub_818649C +sub_818649C: @ 818649C + ldr r0, =0x0203ccd9 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_818649C + + thumb_func_start sub_81864A8 +sub_81864A8: @ 81864A8 + ldr r0, =0x0203ccda + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_81864A8 + + thumb_func_start sub_81864B4 +sub_81864B4: @ 81864B4 + ldr r0, =0x03001278 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_81864B4 + + thumb_func_start sub_81864C0 +sub_81864C0: @ 81864C0 + ldr r0, =0x03001279 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_81864C0 + + thumb_func_start sub_81864CC +sub_81864CC: @ 81864CC + ldr r0, =0x0203cce8 + ldr r1, =0x0202433a + ldrb r1, [r1] + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_81864CC + + thumb_func_start sub_81864E0 +sub_81864E0: @ 81864E0 + ldr r0, =0x0203ccdc + bx lr + .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, =0x03005d60 + ldr r0, =0x02024064 + 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, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldr r0, =0x02024064 + 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, =0x02023064 + 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, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + 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, =DummyObjectCallback + 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, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + 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, =DummyObjectCallback + 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, =0x02020630 + ldr r6, =0x020241e4 + ldr r4, =0x02024064 + 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, =DummyObjectCallback + 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 obj_free_rotscale_entry + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + 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, =0x020244d0 + ldr r1, [r4] + ldr r3, =0x02024064 + 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, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081866F8 +_081866A4: + ldr r4, =0x02020630 + ldr r0, =0x03005d70 + ldr r2, =0x02024064 + 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, =DummyObjectCallback + mov r8, r2 + cmp r1, r0 + bne _08186764 + ldr r0, =0x020241e4 + 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, =0x02020630 + ldr r7, =0x03005d70 + ldr r2, =0x02024064 + 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, =DummyObjectCallback + 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, =0x020241e4 + 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 battle_get_per_side_status + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x1 + bne _08186816 + ldr r0, =0x020244d0 + 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 FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag +_08186816: + ldr r0, =0x020244d0 + 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, =0x03005d60 + 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, =0x020244d0 + ldr r0, [r4] + ldr r7, =0x02024064 + 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, =0x0202406e + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + 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, =0x0202406e + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + 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, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08186964 + ldr r4, =0x03005d70 + ldrb r0, [r7] + adds r1, r6, 0 + eors r1, r0 + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + 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, =0x03005d70 + ldr r4, =0x02024064 + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + 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, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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, =0x020244d0 + ldr r0, [r5] + ldr r4, =0x02024064 + 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 sub_80A36C8 + 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, =0x02022fec + ldr r0, [r0] + movs r1, 0x42 + ands r0, r1 + cmp r0, 0x42 + bne _08186A40 + adds r0, r2, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08186A4C + ldr r0, =0x03007420 + bl m4aMPlayContinue + b _08186A4C + .pool +_08186A40: + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl +_08186A4C: + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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, =0x02020630 + ldr r0, =0x03005d7c + ldr r1, =0x02024064 + 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, =DummyObjectCallback + cmp r3, r0 + bne _08186B26 + ldr r0, =0x020241e4 + 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, =0x02020630 + ldr r7, =0x03005d7c + ldr r0, =0x02024064 + 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, =DummyObjectCallback + cmp r4, r0 + bne _08186B26 + ldr r6, =0x020241e4 + 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, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08186B8A + ldr r1, =0x03005d7c + ldr r5, =0x02024064 + 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, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + ldrb r0, [r5] + eors r4, r0 + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_805EE54 +_08186B8A: + ldr r1, =0x03005d7c + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + ldrb r5, [r4] + ldr r1, =0x0202406e + lsls r0, r5, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl sub_805EE54 + ldr r3, =0x020244d0 + 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, =0x03005d60 + 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, =0x02020630 + ldr r0, =0x020241e4 + ldr r7, =0x02024064 + 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, =DummyObjectCallback + cmp r1, r0 + bne _08186CFA + adds r0, r2, r4 + movs r1, 0x24 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08186CFA + ldr r6, =0x020244d0 + 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, =0x0202406e + adds r0, r4, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + 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 FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + 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, =0x02024064 + ldrb r0, [r6] + ldr r5, =0x03005d70 + 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, =0x02020630 + ldr r0, =0x020241e4 + ldr r1, =0x02024064 + 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, =0x03005d70 + 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, =0x020244d0 + ldr r0, [r0] + ldr r6, =0x02024064 + 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, =0x020241e4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldrb r0, [r6] + bl sub_805EEE0 + ldr r1, =0x03005d70 + 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, =0x020241e4 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + ldr r2, =0x02020630 + 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, =0x020244b9 + 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, =0x02020630 + ldr r0, =0x03005d70 + ldr r4, =0x02024064 + 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, =DummyObjectCallback + cmp r1, r0 + bne _08186EF0 + ldr r0, =0x020244d0 + 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, =0x03005d60 + 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, =0x020244d0 + ldr r0, [r0] + ldr r4, =0x02024064 + 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 sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + bne _08186F6E + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + 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, =DummyObjectCallback + cmp r1, r0 + beq _08186F5E + ldr r0, =nullsub_18 + cmp r1, r0 + bne _08186F6E +_08186F5E: + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + 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, =0x020244d0 + ldr r0, [r4] + ldr r5, =0x02024064 + 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, =0x02020630 + ldr r6, =0x020241e4 + 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, =DummyObjectCallback + 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 FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + 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 StartObjectImageAnim + ldr r4, =0x03005d70 + ldrb r1, [r5] + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + 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, =0x03005d60 + 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, =0x020244d0 + ldr r0, [r6] + ldr r5, =0x02024064 + 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, =0x0202406e + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_081870B6: + ldr r4, =0x02020630 + ldr r0, =0x03005d7c + 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, =DummyObjectCallback + 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 RemoveObjectAndFreeTiles + ldrb r4, [r5] + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_805EE54 + ldr r1, =0x03005d60 + 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, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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, =0x03005d60 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8186508 + str r1, [r0] + ldr r0, =0x02022fec + 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 dp01_prepare_buffer_wireless_probably + ldr r1, =0x02023064 + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _08187212 + .pool +_08187200: + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + 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, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _0818725C + ldr r0, =0x0202406e + 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, =0x02023064 + ldr r3, =0x02024064 + 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, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + mov r1, sp + strh r0, [r1] + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + 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 pokemon_getattr + strh r0, [r4] + adds r1, r6, 0 + adds r1, 0x11 + mov r0, r8 + bl pokemon_getattr + 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, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r10 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + ldr r2, [sp, 0x80] + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x19 + bl pokemon_getattr + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + str r0, [sp, 0x48] + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + str r0, [sp, 0x4C] + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + ldr r1, [sp, 0x7C] + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x28] + adds r0, r4, 0 + movs r1, 0x3A + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2C] + adds r0, r4, 0 + movs r1, 0x3B + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2] + adds r0, r4, 0 + movs r1, 0x3C + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x4] + adds r0, r4, 0 + movs r1, 0x3D + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x6] + adds r0, r4, 0 + movs r1, 0x3E + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x8] + adds r0, r4, 0 + movs r1, 0x3F + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0xA] + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + str r0, [sp, 0x54] + adds r0, r4, 0 + movs r1, 0x2 + ldr r2, [sp, 0x8C] + bl pokemon_getattr + ldr r0, [sp, 0x84] + ldr r1, [sp, 0x8C] + bl CopyString_Limit10 + adds r0, r4, 0 + movs r1, 0x7 + ldr r2, [sp, 0x88] + bl pokemon_getattr + 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, =0x02024744 + adds r0, r1 + movs r1, 0xB + b _08187966 + .pool +_081875FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + 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, =0x02024744 + adds r4, r1, r0 + mov r8, r9 +_08187622: + adds r1, r6, 0 + adds r1, 0xD + adds r0, r4, 0 + bl pokemon_getattr + mov r1, r8 + strh r0, [r1] + adds r1, r6, 0 + adds r1, 0x11 + adds r0, r4, 0 + bl pokemon_getattr + 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, =0x02024744 + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + 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, =0x02024744 + 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, =0x02024744 + mov r8, r2 +_0818769C: + adds r1, r6, 0 + adds r1, 0x11 + mov r2, r8 + adds r0, r4, r2 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + cmp r6, 0x3 + ble _0818769C + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + b _08187A2E + .pool +_081876CC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + 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, =0x02024744 + adds r0, r1 + movs r1, 0x1 + b _08187702 + .pool +_081876F8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x19 +_08187702: + bl pokemon_getattr + 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, =0x02024744 + adds r0, r1 + movs r1, 0x1A + b _08187A26 + .pool +_08187738: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1B + b _08187A26 + .pool +_08187748: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1C + b _08187A26 + .pool +_08187758: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1D + b _08187A26 + .pool +_08187768: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1E + b _08187A26 + .pool +_08187778: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x1F + b _08187A26 + .pool +_08187788: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x20 + b _08187A26 + .pool +_08187798: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x22 + b _08187A26 + .pool +_081877A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x23 + b _08187A26 + .pool +_081877B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x24 + b _08187A26 + .pool +_081877C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x25 + b _08187A26 + .pool +_081877D8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x26 + b _08187A26 + .pool +_081877E8: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_getattr + strb r0, [r7] + adds r0, r4, 0 + movs r1, 0x28 + bl pokemon_getattr + strb r0, [r7, 0x1] + adds r0, r4, 0 + movs r1, 0x29 + bl pokemon_getattr + strb r0, [r7, 0x2] + adds r0, r4, 0 + movs r1, 0x2A + bl pokemon_getattr + strb r0, [r7, 0x3] + adds r0, r4, 0 + movs r1, 0x2B + bl pokemon_getattr + strb r0, [r7, 0x4] + adds r0, r4, 0 + movs r1, 0x2C + bl pokemon_getattr + strb r0, [r7, 0x5] + movs r6, 0x6 + b _08187A2E + .pool +_08187838: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x27 + b _08187A26 + .pool +_08187848: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x28 + b _08187A26 + .pool +_08187858: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x29 + b _08187A26 + .pool +_08187868: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2A + b _08187A26 + .pool +_08187878: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2B + b _08187A26 + .pool +_08187888: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2C + b _08187A26 + .pool +_08187898: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0 + b _081878C2 + .pool +_081878A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x9 + b _08187966 + .pool +_081878B8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x37 +_081878C2: + bl pokemon_getattr + 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, =0x02024744 + adds r0, r1 + movs r1, 0x38 + b _08187A26 + .pool +_081878FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x39 + b _08187966 + .pool +_0818790C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3A + b _08187966 + .pool +_0818791C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3B + b _08187966 + .pool +_0818792C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3C + b _08187966 + .pool +_0818793C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3D + b _08187966 + .pool +_0818794C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3E + b _08187966 + .pool +_0818795C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3F +_08187966: + bl pokemon_getattr + 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, =0x02024744 + adds r0, r1 + movs r1, 0x16 + b _08187A26 + .pool +_0818798C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x17 + b _08187A26 + .pool +_0818799C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x18 + b _08187A26 + .pool +_081879AC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x21 + b _08187A26 + .pool +_081879BC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2F + b _08187A26 + .pool +_081879CC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x30 + b _08187A26 + .pool +_081879DC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x32 + b _08187A26 + .pool +_081879EC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x33 + b _08187A26 + .pool +_081879FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x34 + b _08187A26 + .pool +_08187A0C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x35 + b _08187A26 + .pool +_08187A1C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x36 +_08187A26: + bl pokemon_getattr + 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, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _08187A80 + ldr r0, =0x0202406e + 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, =0x02024064 + ldrb r0, [r3] + lsls r0, 9 + ldr r2, =0x02023067 + 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, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + adds r2, r7, 0 + bl pokemon_setattr + adds r2, r7, 0 + adds r2, 0x2E + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + 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 pokemon_setattr + mov r1, r8 + adds r1, 0x11 + mov r0, r9 + adds r2, r6, 0 + bl pokemon_setattr + 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, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + mov r2, r10 + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x20 + ldr r2, [sp, 0x20] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x19 + ldr r2, [sp, 0x28] + bl pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + adds r0, r4, 0 + movs r1, 0 + ldr r2, [sp, 0x2C] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x37 + ldr r2, [sp, 0x30] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x38 + ldr r2, [sp, 0x1C] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x39 + ldr r2, [sp, 0x18] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3A + ldr r2, [sp, 0x24] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3B + ldr r2, [sp, 0x4] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3C + ldr r2, [sp, 0x8] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3D + ldr r2, [sp, 0xC] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3E + ldr r2, [sp, 0x10] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3F + ldr r2, [sp, 0x14] + bl pokemon_setattr + b _081883B4 + .pool +_08187D74: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0xB + bl pokemon_setattr + b _081883B4 + .pool +_08187D90: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0xC + bl pokemon_setattr + 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, =0x02024744 + 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 pokemon_setattr + mov r1, r8 + adds r1, 0x11 + adds r0, r7, 0 + adds r2, r6, 0 + bl pokemon_setattr + 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, =0x02024744 + adds r0, r1 + movs r1, 0x15 + mov r2, r9 + bl pokemon_setattr + b _081883B4 + .pool +_08187E00: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldr r3, =0x02023064 + 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, =0x02024744 + adds r4, r0 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + adds r0, r4, 0 + movs r1, 0x11 + str r3, [sp, 0x34] + bl pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + b _081883B4 + .pool +_08187E88: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldr r3, =0x02023064 + 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 pokemon_setattr + b _081883B4 + .pool +_08187EB0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1 + bl pokemon_setattr + b _081883B4 + .pool +_08187ECC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x19 + bl pokemon_setattr + b _081883B4 + .pool +_08187EE8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1A + bl pokemon_setattr + b _081883B4 + .pool +_08187F04: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1B + bl pokemon_setattr + b _081883B4 + .pool +_08187F20: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1C + bl pokemon_setattr + b _081883B4 + .pool +_08187F3C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1D + bl pokemon_setattr + b _081883B4 + .pool +_08187F58: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1E + bl pokemon_setattr + b _081883B4 + .pool +_08187F74: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x1F + bl pokemon_setattr + b _081883B4 + .pool +_08187F90: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x20 + bl pokemon_setattr + b _081883B4 + .pool +_08187FAC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x22 + bl pokemon_setattr + b _081883B4 + .pool +_08187FC8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x23 + bl pokemon_setattr + b _081883B4 + .pool +_08187FE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x24 + bl pokemon_setattr + b _081883B4 + .pool +_08188000: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x25 + bl pokemon_setattr + b _081883B4 + .pool +_0818801C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x26 + bl pokemon_setattr + b _081883B4 + .pool +_08188038: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + adds r0, r4, 0 + movs r1, 0x27 + str r3, [sp, 0x34] + bl pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x27 + bl pokemon_setattr + b _081883B4 + .pool +_081880C8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x28 + bl pokemon_setattr + b _081883B4 + .pool +_081880E4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x29 + bl pokemon_setattr + b _081883B4 + .pool +_08188100: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2A + bl pokemon_setattr + b _081883B4 + .pool +_0818811C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2B + bl pokemon_setattr + b _081883B4 + .pool +_08188138: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 +_08188146: + movs r1, 0x2C + bl pokemon_setattr + b _081883B4 + .pool +_08188154: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0 + bl pokemon_setattr + b _081883B4 + .pool +_08188170: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x9 + bl pokemon_setattr + b _081883B4 + .pool +_0818818C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x37 + bl pokemon_setattr + b _081883B4 + .pool +_081881A8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x38 + bl pokemon_setattr + b _081883B4 + .pool +_081881C4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x39 + bl pokemon_setattr + b _081883B4 + .pool +_081881E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3A + bl pokemon_setattr + b _081883B4 + .pool +_081881FC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3B + bl pokemon_setattr + b _081883B4 + .pool +_08188218: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3C + bl pokemon_setattr + b _081883B4 + .pool +_08188234: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3D + bl pokemon_setattr + b _081883B4 + .pool +_08188250: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3E + bl pokemon_setattr + b _081883B4 + .pool +_0818826C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x3F + bl pokemon_setattr + b _081883B4 + .pool +_08188288: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x16 + bl pokemon_setattr + b _081883B4 + .pool +_081882A4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x17 + bl pokemon_setattr + b _081883B4 + .pool +_081882C0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x18 + bl pokemon_setattr + b _081883B4 + .pool +_081882DC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x21 + bl pokemon_setattr + b _081883B4 + .pool +_081882F8: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x2F + bl pokemon_setattr + b _081883B4 + .pool +_08188314: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x30 + bl pokemon_setattr + b _081883B4 + .pool +_08188330: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x32 + bl pokemon_setattr + b _081883B4 + .pool +_0818834C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x33 + bl pokemon_setattr + b _081883B4 + .pool +_08188368: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x34 + bl pokemon_setattr + b _081883B4 + .pool +_08188384: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x35 + bl pokemon_setattr + b _081883B4 + .pool +_081883A0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 + adds r0, r1 + ldrb r2, [r6] + lsls r2, 9 + adds r2, r3 + movs r1, 0x36 + bl pokemon_setattr +_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, =0x0202406e + ldr r7, =0x02024064 + 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, =0x02023064 + lsls r2, 9 + adds r0, r4, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + ldr r1, =0x02024744 + 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, =0x0202406e + ldr r6, =0x02024064 + 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, =0x02024744 + mov r9, r1 + add r0, r9 + movs r1, 0xB + bl pokemon_getattr + 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 battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_806A068 + ldr r0, =0x0202499c + 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 AddObjectToFront + ldr r4, =0x020241e4 + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r5, =0x02020630 + 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, =0x020244e4 + adds r2, r1 + ldrb r1, [r2] + bl StartObjectImageAnim + 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 pokemon_getattr + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_805EE54 + ldr r1, =0x03005d60 + 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, =0x0202406e + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r2, r0, 1 + adds r2, r1 + ldr r3, =0x02023064 + 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, =0x03005d60 + 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, =0x0202406e + lsls r4, r6, 1 + adds r4, r0 + ldr r0, =0x02023064 + 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, =0x02024744 + adds r0, r5 + movs r1, 0xB + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, =sub_805D714 + bl object_new_hidden_with_callback + ldr r1, =0x03005d7c + 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 battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl sub_806A068 + ldr r0, =0x0202499c + 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 AddObjectToFront + ldr r4, =0x020241e4 + adds r4, r6, r4 + strb r0, [r4] + ldr r5, =0x02020630 + 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, =0x020244e4 + adds r6, r1 + ldrb r1, [r6] + bl StartObjectImageAnim + 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, =DummyObjectCallback + 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, =0x02023064 + ldr r6, =0x02024064 + ldrb r2, [r6] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r3, [r0] + cmp r3, 0 + bne _081887B0 + ldr r0, =0x020244d0 + 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, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8188800 + str r1, [r0] + b _081887EC + .pool +_081887B0: + ldr r5, =0x020241e4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldrb r0, [r6] + bl sub_805EEE0 + ldr r1, =0x03005d70 + 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, =0x020244d0 + ldr r4, [r6] + ldr r5, =0x02024064 + 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, =0x03005d60 + 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, =0x02022fec + ldr r0, [r5] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081888F6 + ldr r4, =0x02024064 + ldrb r0, [r4] + bl battle_get_per_side_status + 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, =0x02038bca + b _081888DA + .pool +_081888D8: + ldr r0, =0x02038bcc +_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, =0x02038bca + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 4 + cmp r1, r0 + bne _08188910 + bl sub_8068B48 + b _08188928 + .pool +_08188910: + ldr r2, =0x020229e8 + ldr r0, =0x0203c7b4 + 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, =0x02024064 + ldrb r1, [r5] + bl sub_805DF38 + ldrb r0, [r5] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl template_build_for_pokemon_or_trainer + ldr r6, =0x0202499c + 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 AddObjectToFront + ldr r6, =0x020241e4 + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, =0x02020630 + 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 IndexOfObjectPaletteTag + 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, =0x03005d60 + 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, =0x020241e4 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =0x02020630 + 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, =DummyObjectCallback + bl oamt_set_x3A_32 + ldr r1, =0x03005d60 + 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, =0x020244d0 + ldr r4, [r6] + ldr r5, =0x02024064 + 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 audio_play_and_stuff + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + 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, =0x03005d60 + 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, =0x02024064 + ldrb r0, [r6] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + beq _08188BE6 + b _08188CFA +_08188BE6: + ldr r0, =0x02023064 + 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, =0x02038432 + mov r1, r12 + adds r1, 0x3 + adds r2, r1 + ldrb r1, [r2] + strb r1, [r5] + ldr r4, =0x02038408 + 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, =0x02038404 + 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, =0x0203841a + ldrb r1, [r6] + lsls r1, 9 + mov r2, r12 + adds r2, 0xA + adds r1, r2 + ldrb r1, [r1] + strb r1, [r3] + ldr r4, =0x0203841c + 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, =0x02038400 + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0x10 + adds r2, r1 + str r2, [r3] + ldr r3, =0x020244bc + 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, =0x020244d0 + 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, =0x03005d60 + 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, =0x02023064 + ldr r6, =0x02024064 + 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, =0x020244d0 + 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, =0x020383f8 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =0x020383fd + 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, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 9 + ldr r1, =0x02023066 + adds r0, r1 + ldrh r0, [r0] + bl battle_pick_message + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =0x03005d60 + 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, =0x02024064 + 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, =0x02022fec + 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, =0x02024064 + 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, =0x02024064 + ldrb r0, [r4] + bl sub_8185054 + ldrb r1, [r4] + ldr r3, =0x0202449c + 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, =0x02023064 + ldr r0, =0x02024064 + 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, =0x0202406e + lsls r0, r4, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x02024744 + adds r0, r4 + movs r1, 0x3A + bl pokemon_getattr + 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 pokemon_getattr + adds r3, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, =0x03005d70 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + mov r2, r8 + bl sub_807294C + b _0818908A + .pool +_08189060: + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x3A + bl pokemon_getattr + adds r2, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, =0x03005d70 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + movs r3, 0 + bl sub_807294C +_0818908A: + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + 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, =0x02024064 + ldrb r0, [r4] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _08189120 + ldr r0, =0x03005d70 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x02024744 + adds r1, r2 + movs r2, 0x9 + bl healthbar_draw_field_maybe + ldrb r2, [r4] + ldr r0, =0x020244d0 + 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, =0x03005d60 + 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, =0x02024064 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _08189194 + ldr r4, =0x02023064 + 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, =0x03005d60 + 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, =0x02022d0c + 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, =0x02022d0c + ldr r1, =0x02023064 + ldr r0, =0x02024064 + 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, =0x02022d0c + 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, =0x02022d0c + 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, =0x02020630 + ldr r2, =0x020241e4 + ldr r4, =0x02024064 + 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, =0x020244b9 + 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, =0x03005d60 + 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, =0x02024064 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + movs r3, 0x3F + cmp r0, 0 + bne _0818933C + movs r3, 0xC0 +_0818933C: + ldr r2, =0x02023064 + 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 audio_play_and_stuff + 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, =0x02023064 + ldr r5, =0x02024064 + 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 song_play_for_text + 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 fanfare_play +_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, =0x0202406e + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x19 + movs r2, 0x5 + bl sub_80A32E4 + 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, =0x02023064 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, =0x020243fc + 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, =0x020241e4 + ldr r6, =0x02024064 + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + 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, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + ldrb r0, [r6] + strh r0, [r1, 0x8] + ldr r3, =0x020244d0 + 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, =0x020244b4 + 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, =0x03005d60 + 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, =0x02024064 + ldrb r0, [r7] + mov r9, r0 + ldr r1, =0x03005e00 + 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, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081895B4 +_08189582: + ldr r0, =0x02023064 + ldrb r1, [r7] + lsls r2, r1, 9 + adds r0, 0x1 + adds r2, r0 + ldr r0, =0x0202406e + 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, =0x02023064 + ldrb r0, [r7] + lsls r1, r0, 9 + adds r4, 0x1 + adds r1, r4 + ldr r6, =0x0202406e + 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, =0x03005d60 + ldr r2, =0x02024064 + 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 obj_free_rotscale_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + 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, =0x02023064 + ldr r0, =0x02024064 + 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 battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _08189678 + bl sub_81871AC + b _08189742 + .pool +_08189678: + ldr r4, =0x020244d0 + ldr r0, [r4] + ldr r3, =0x02024064 + 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, =0x02023064 + 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, =0x02023068 + 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, =0x020244b4 + ldrb r1, [r5] + adds r1, r2 + movs r3, 0 + strb r0, [r1] + ldr r6, =0x020244d0 + 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, =0x03005d60 + 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, =0x020244d0 + ldr r0, [r4] + ldr r3, =0x02024064 + 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, =0x020244d0 + ldr r1, [r0] + ldr r0, =0x02024064 + 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, =0x03005e00 + ldr r0, =0x020244b4 + 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, =0x02024064 + ldrb r0, [r4] + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _08189846 + ldr r3, =0x02020630 + ldr r0, =0x020241e4 + 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, =0x02023064 + 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, =0x02024064 + ldrb r0, [r6] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _081898B8 + ldr r5, =0x02023064 + 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, =0x03005d60 + 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, =0x02023064 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r2, [r0] + cmp r2, 0x3 + bne _08189908 + ldr r0, =0x0202433a + strb r2, [r0] + b _08189910 + .pool +_08189908: + ldr r0, =0x0202433a + movs r1, 0x3 + eors r1, r2 + strb r1, [r0] +_08189910: + movs r0, 0x5 + bl sub_80A2F50 + movs r0, 0x3 + bl sub_80A2390 + bl sub_81871AC + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + 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, =0x03005d60 + ldr r0, =0x02024064 + 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, =0x02024068 + ldr r1, =gUnknown_0832A328 + ldr r0, =0x02024064 + 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, =0x02023064 + 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, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + 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, =DummyObjectCallback + 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, =0x02020630 + ldr r5, =0x020241e4 + ldr r4, =0x02024064 + 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, =DummyObjectCallback + 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 obj_free_rotscale_entry + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl RemoveObjectAndFreeTiles + 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, =0x020244d0 + ldr r1, [r4] + ldr r3, =0x02024064 + 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, =0x02024064 + ldrb r0, [r4] + bl battle_get_per_side_status + 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, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08189B0C +_08189ADA: + ldr r2, =0x02020630 + ldr r1, =0x03005d70 + 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, =DummyObjectCallback + cmp r1, r0 + bne _08189B42 + b _08189B48 + .pool +_08189B0C: + ldr r2, =0x02020630 + ldr r5, =0x03005d70 + ldr r0, =0x02024064 + 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, =DummyObjectCallback + 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, =0x020244d0 + mov r9, r0 + ldr r0, [r0] + ldr r5, =0x02024064 + 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 FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + ldr r7, =0x0202406e + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r7 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r4, =0x020244ec + 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, =0x03005d60 + 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, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08189CB0 +_08189C80: + ldr r2, =0x02020630 + ldr r1, =0x03005d70 + 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, =DummyObjectCallback + cmp r1, r0 + bne _08189CE6 + b _08189CE4 + .pool +_08189CB0: + ldr r2, =0x02020630 + ldr r5, =0x03005d70 + ldr r0, =0x02024064 + 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, =DummyObjectCallback + 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 sub_80A36C8 + lsls r0, 24 + cmp r0, 0 + beq _08189CF2 + movs r6, 0 +_08189CF2: + cmp r6, 0 + beq _08189D18 + ldr r0, =0x020244d0 + ldr r0, [r0] + ldr r3, =0x02024064 + 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, =0x03005d60 + 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, =0x02024064 + ldrb r0, [r4] + bl battle_get_per_side_status + lsls r0, 24 + cmp r0, 0 + bne _08189DBE + ldr r5, =0x020244d0 + 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, =0x0202406e + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + 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, =0x0202406e + adds r0, r2, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r1, r0 + adds r0, r3, 0 + bl sub_8172EF0 +_08189DBE: + ldr r3, =0x020244d0 + ldr r0, [r3] + ldr r2, =0x02024064 + 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, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08189E54 + ldr r4, =0x03005d70 + mov r1, r9 + ldrb r0, [r1] + adds r1, r7, 0 + eors r1, r0 + adds r0, r1, r4 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + 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, =0x03005d70 + ldr r4, =0x02024064 + ldrb r1, [r4] + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + 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, =0x020244d0 + ldr r0, [r4] + ldr r3, =0x02024064 + 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 sub_80A36C8 + 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, =0x02022fec + ldr r0, [r0] + movs r1, 0x42 + ands r0, r1 + cmp r0, 0x42 + bne _08189F38 + adds r0, r2, 0 + bl battle_get_per_side_status + lsls r0, 24 + cmp r0, 0 + bne _08189F44 + ldr r0, =0x03007420 + bl m4aMPlayContinue + b _08189F44 + .pool +_08189F38: + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl +_08189F44: + ldr r0, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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, =0x02020630 + ldr r6, =0x03005d7c + ldr r5, =0x02024064 + 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, =DummyObjectCallback + cmp r2, r0 + bne _0818A02A + ldr r0, =0x020241e4 + 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, =0x02022fec + 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 RemoveObjectAndFreeTiles +_08189FC8: + ldr r1, =0x03005d7c + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + ldr r3, =0x020244d0 + 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, =0x03005d60 + 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, =0x02020630 + ldr r1, =0x020241e4 + ldr r0, =0x02024064 + 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, =0x02024064 + ldrb r0, [r5] + ldr r6, =0x03005d70 + 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, =0x0202406e + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + 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, =0x02020630 + ldr r5, =0x020241e4 + ldr r4, =0x02024064 + 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, =0x0202406e + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + 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 rotscale_free_entry + ldrb r0, [r4] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + bl RemoveObjectAndFreeTiles + ldr r1, =0x03005d70 + 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, =0x020244d0 + ldr r0, [r0] + ldr r6, =0x02024064 + 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, =0x020241e4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r1, =0x03005d70 + 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, =0x020241e4 + ldr r0, =0x02024064 + ldrb r0, [r0] + adds r0, r1 + ldrb r1, [r0] + ldr r2, =0x02020630 + 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, =0x020244b9 + 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, =0x02020630 + ldr r0, =0x03005d70 + ldr r4, =0x02024064 + 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, =DummyObjectCallback + cmp r1, r0 + bne _0818A306 + adds r0, r3, 0 + bl sub_805E408 + ldr r0, =0x020244d0 + 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, =0x03005d60 + 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, =0x020244d0 + ldr r1, [r0] + ldr r0, =0x02024064 + 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, =0x02020630 + ldr r0, =0x020241e4 + 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, =DummyObjectCallback + 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, =0x020244d0 + ldr r0, [r3] + ldr r7, =0x02024064 + 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 FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + ldr r0, =c3_0802FDF4 + movs r1, 0xA + bl CreateTask + ldr r0, =0x0202406e + mov r8, r0 + ldrb r1, [r7] + lsls r0, r1, 1 + add r0, r8 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + bl sub_805E990 + ldr r1, =0x020241e4 + ldrb r0, [r7] + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0 + bl StartObjectImageAnim + ldr r4, =0x03005d70 + 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, =0x03005d60 + 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, =0x020244d0 + ldr r0, [r6] + ldr r4, =0x02024064 + 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, =0x0202406e + adds r0, r3, r0 + ldrh r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r1, r0 + adds r0, r2, 0 + bl sub_8172EF0 +_0818A4A2: + ldr r5, =0x02020630 + ldr r0, =0x03005d7c + 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, =DummyObjectCallback + 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 RemoveObjectAndFreeTiles + ldr r1, =0x03005d60 + 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, =0x03005d60 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_8189968 + str r1, [r0] + ldr r0, =0x02022fec + 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 dp01_prepare_buffer_wireless_probably + ldr r1, =0x02023064 + ldrb r0, [r4] + lsls r0, 9 + adds r0, r1 + movs r1, 0x38 + strb r1, [r0] + b _0818A57A + .pool +_0818A568: + ldr r2, =0x02024068 + ldr r1, =gUnknown_0832A328 + 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, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _0818A624 + ldr r0, =0x0202406e + 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, =0x02023064 + ldr r3, =0x02024064 + 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, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + mov r1, sp + strh r0, [r1] + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + 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 pokemon_getattr + strh r0, [r4] + adds r1, r6, 0 + adds r1, 0x11 + mov r0, r8 + bl pokemon_getattr + 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, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + bl pokemon_getattr + mov r1, r10 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x20 + bl pokemon_getattr + ldr r2, [sp, 0x80] + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x19 + bl pokemon_getattr + str r0, [sp, 0x44] + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + str r0, [sp, 0x48] + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + str r0, [sp, 0x4C] + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + ldr r1, [sp, 0x7C] + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x28] + adds r0, r4, 0 + movs r1, 0x3A + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2C] + adds r0, r4, 0 + movs r1, 0x3B + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x2] + adds r0, r4, 0 + movs r1, 0x3C + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x4] + adds r0, r4, 0 + movs r1, 0x3D + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x6] + adds r0, r4, 0 + movs r1, 0x3E + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0x8] + adds r0, r4, 0 + movs r1, 0x3F + bl pokemon_getattr + mov r1, sp + strh r0, [r1, 0xA] + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + str r0, [sp, 0x54] + adds r0, r4, 0 + movs r1, 0x2 + ldr r2, [sp, 0x8C] + bl pokemon_getattr + ldr r0, [sp, 0x84] + ldr r1, [sp, 0x8C] + bl CopyString_Limit10 + adds r0, r4, 0 + movs r1, 0x7 + ldr r2, [sp, 0x88] + bl pokemon_getattr + 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, =0x020244ec + adds r0, r1 + movs r1, 0xB + b _0818AD2E + .pool +_0818A9C4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + 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, =0x020244ec + adds r4, r1, r0 + mov r8, r9 +_0818A9EA: + adds r1, r6, 0 + adds r1, 0xD + adds r0, r4, 0 + bl pokemon_getattr + mov r1, r8 + strh r0, [r1] + adds r1, r6, 0 + adds r1, 0x11 + adds r0, r4, 0 + bl pokemon_getattr + 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, =0x020244ec + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + 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, =0x020244ec + 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, =0x020244ec + mov r8, r2 +_0818AA64: + adds r1, r6, 0 + adds r1, 0x11 + mov r2, r8 + adds r0, r4, r2 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + cmp r6, 0x3 + ble _0818AA64 + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x15 + bl pokemon_getattr + adds r1, r7, r6 + strb r0, [r1] + adds r6, 0x1 + b _0818ADF6 + .pool +_0818AA94: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + 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, =0x020244ec + adds r0, r1 + movs r1, 0x1 + b _0818AACA + .pool +_0818AAC0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x19 +_0818AACA: + bl pokemon_getattr + 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, =0x020244ec + adds r0, r1 + movs r1, 0x1A + b _0818ADEE + .pool +_0818AB00: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1B + b _0818ADEE + .pool +_0818AB10: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1C + b _0818ADEE + .pool +_0818AB20: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1D + b _0818ADEE + .pool +_0818AB30: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1E + b _0818ADEE + .pool +_0818AB40: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1F + b _0818ADEE + .pool +_0818AB50: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x20 + b _0818ADEE + .pool +_0818AB60: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x22 + b _0818ADEE + .pool +_0818AB70: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x23 + b _0818ADEE + .pool +_0818AB80: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x24 + b _0818ADEE + .pool +_0818AB90: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x25 + b _0818ADEE + .pool +_0818ABA0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x26 + b _0818ADEE + .pool +_0818ABB0: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_getattr + strb r0, [r7] + adds r0, r4, 0 + movs r1, 0x28 + bl pokemon_getattr + strb r0, [r7, 0x1] + adds r0, r4, 0 + movs r1, 0x29 + bl pokemon_getattr + strb r0, [r7, 0x2] + adds r0, r4, 0 + movs r1, 0x2A + bl pokemon_getattr + strb r0, [r7, 0x3] + adds r0, r4, 0 + movs r1, 0x2B + bl pokemon_getattr + strb r0, [r7, 0x4] + adds r0, r4, 0 + movs r1, 0x2C + bl pokemon_getattr + strb r0, [r7, 0x5] + movs r6, 0x6 + b _0818ADF6 + .pool +_0818AC00: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x27 + b _0818ADEE + .pool +_0818AC10: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x28 + b _0818ADEE + .pool +_0818AC20: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x29 + b _0818ADEE + .pool +_0818AC30: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2A + b _0818ADEE + .pool +_0818AC40: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2B + b _0818ADEE + .pool +_0818AC50: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2C + b _0818ADEE + .pool +_0818AC60: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0 + b _0818AC8A + .pool +_0818AC70: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x9 + b _0818AD2E + .pool +_0818AC80: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x37 +_0818AC8A: + bl pokemon_getattr + 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, =0x020244ec + adds r0, r1 + movs r1, 0x38 + b _0818ADEE + .pool +_0818ACC4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x39 + b _0818AD2E + .pool +_0818ACD4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3A + b _0818AD2E + .pool +_0818ACE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3B + b _0818AD2E + .pool +_0818ACF4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3C + b _0818AD2E + .pool +_0818AD04: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3D + b _0818AD2E + .pool +_0818AD14: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3E + b _0818AD2E + .pool +_0818AD24: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3F +_0818AD2E: + bl pokemon_getattr + 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, =0x020244ec + adds r0, r1 + movs r1, 0x16 + b _0818ADEE + .pool +_0818AD54: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x17 + b _0818ADEE + .pool +_0818AD64: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x18 + b _0818ADEE + .pool +_0818AD74: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x21 + b _0818ADEE + .pool +_0818AD84: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2F + b _0818ADEE + .pool +_0818AD94: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x30 + b _0818ADEE + .pool +_0818ADA4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x32 + b _0818ADEE + .pool +_0818ADB4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x33 + b _0818ADEE + .pool +_0818ADC4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x34 + b _0818ADEE + .pool +_0818ADD4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x35 + b _0818ADEE + .pool +_0818ADE4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x36 +_0818ADEE: + bl pokemon_getattr + 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, =0x02023064 + ldr r0, =0x02024064 + ldrb r2, [r0] + lsls r0, r2, 9 + adds r1, 0x2 + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0 + bne _0818AE48 + ldr r0, =0x0202406e + 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, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + ldr r2, =0x02023067 + 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, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + adds r2, r6, 0 + bl pokemon_setattr + adds r2, r6, 0 + adds r2, 0x2E + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_setattr + 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 pokemon_setattr + mov r1, r8 + adds r1, 0x11 + mov r0, r9 + adds r2, r7, 0 + bl pokemon_setattr + 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, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x15 + mov r2, r10 + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x20 + ldr r2, [sp, 0x20] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x19 + ldr r2, [sp, 0x28] + bl pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 pokemon_setattr + adds r0, r4, 0 + movs r1, 0 + ldr r2, [sp, 0x2C] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x37 + ldr r2, [sp, 0x30] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x38 + ldr r2, [sp, 0x1C] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x39 + ldr r2, [sp, 0x18] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3A + ldr r2, [sp, 0x24] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3B + ldr r2, [sp, 0x4] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3C + ldr r2, [sp, 0x8] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3D + ldr r2, [sp, 0xC] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3E + ldr r2, [sp, 0x10] + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x3F + ldr r2, [sp, 0x14] + bl pokemon_setattr + b _0818B836 + .pool +_0818B13C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xB + bl pokemon_setattr + b _0818B836 + .pool +_0818B15C: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0xC + bl pokemon_setattr + 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, =0x020244ec + 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 pokemon_setattr + mov r1, r8 + adds r1, 0x11 + adds r0, r7, 0 + adds r2, r6, 0 + bl pokemon_setattr + 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, =0x020244ec + adds r0, r1 + movs r1, 0x15 + mov r2, r9 + bl pokemon_setattr + b _0818B836 + .pool +_0818B1D4: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r3, =0x02023064 + ldr r1, =0x02024064 + 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, =0x020244ec + adds r4, r0 + ldr r5, =0x02024064 + ldrb r2, [r5] + lsls r2, 9 + adds r2, r7 + adds r0, r4, 0 + movs r1, 0x11 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x12 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x2 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x13 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x3 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x14 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x4 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x15 + bl pokemon_setattr + b _0818B836 + .pool +_0818B260: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r3, =0x02023064 + ldr r1, =0x02024064 + 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 pokemon_setattr + b _0818B836 + .pool +_0818B290: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1 + bl pokemon_setattr + b _0818B836 + .pool +_0818B2B0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x19 + bl pokemon_setattr + b _0818B836 + .pool +_0818B2D0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1A + bl pokemon_setattr + b _0818B836 + .pool +_0818B2F0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1B + bl pokemon_setattr + b _0818B836 + .pool +_0818B310: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1C + bl pokemon_setattr + b _0818B836 + .pool +_0818B330: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1D + bl pokemon_setattr + b _0818B836 + .pool +_0818B350: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1E + bl pokemon_setattr + b _0818B836 + .pool +_0818B370: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x1F + bl pokemon_setattr + b _0818B836 + .pool +_0818B390: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x20 + bl pokemon_setattr + b _0818B836 + .pool +_0818B3B0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x22 + bl pokemon_setattr + b _0818B836 + .pool +_0818B3D0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x23 + bl pokemon_setattr + b _0818B836 + .pool +_0818B3F0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x24 + bl pokemon_setattr + b _0818B836 + .pool +_0818B410: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x25 + bl pokemon_setattr + b _0818B836 + .pool +_0818B430: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x26 + bl pokemon_setattr + b _0818B836 + .pool +_0818B450: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + ldr r5, =0x02024064 + ldrb r2, [r5] + lsls r2, 9 + adds r2, r7 + adds r0, r4, 0 + movs r1, 0x27 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x1 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x28 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x2 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x29 + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x3 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2A + bl pokemon_setattr + ldrb r2, [r5] + lsls r2, 9 + adds r0, r7, 0x4 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2B + bl pokemon_setattr + 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, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x27 + bl pokemon_setattr + b _0818B836 + .pool +_0818B4E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x28 + bl pokemon_setattr + b _0818B836 + .pool +_0818B500: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x29 + bl pokemon_setattr + b _0818B836 + .pool +_0818B520: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2A + bl pokemon_setattr + b _0818B836 + .pool +_0818B540: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2B + bl pokemon_setattr + b _0818B836 + .pool +_0818B560: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 +_0818B570: + movs r1, 0x2C + bl pokemon_setattr + b _0818B836 + .pool +_0818B580: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0 + bl pokemon_setattr + b _0818B836 + .pool +_0818B5A0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x9 + bl pokemon_setattr + b _0818B836 + .pool +_0818B5C0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x37 + bl pokemon_setattr + b _0818B836 + .pool +_0818B5E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x38 + bl pokemon_setattr + b _0818B836 + .pool +_0818B600: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x39 + bl pokemon_setattr + b _0818B836 + .pool +_0818B620: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3A + bl pokemon_setattr + b _0818B836 + .pool +_0818B640: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3B + bl pokemon_setattr + b _0818B836 + .pool +_0818B660: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3C + bl pokemon_setattr + b _0818B836 + .pool +_0818B680: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3D + bl pokemon_setattr + b _0818B836 + .pool +_0818B6A0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3E + bl pokemon_setattr + b _0818B836 + .pool +_0818B6C0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x3F + bl pokemon_setattr + b _0818B836 + .pool +_0818B6E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x16 + bl pokemon_setattr + b _0818B836 + .pool +_0818B700: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x17 + bl pokemon_setattr + b _0818B836 + .pool +_0818B720: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x18 + bl pokemon_setattr + b _0818B836 + .pool +_0818B740: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x21 + bl pokemon_setattr + b _0818B836 + .pool +_0818B760: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x2F + bl pokemon_setattr + b _0818B836 + .pool +_0818B780: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x30 + bl pokemon_setattr + b _0818B836 + .pool +_0818B7A0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x32 + bl pokemon_setattr + b _0818B836 + .pool +_0818B7C0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x33 + bl pokemon_setattr + b _0818B836 + .pool +_0818B7E0: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x34 + bl pokemon_setattr + b _0818B836 + .pool +_0818B800: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x35 + bl pokemon_setattr + b _0818B836 + .pool +_0818B820: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02024064 + ldrb r2, [r1] + lsls r2, 9 + adds r2, r7 + movs r1, 0x36 + bl pokemon_setattr +_0818B836: + ldr r2, =0x0202406e + ldr r0, =0x02024064 + ldrb r1, [r0] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + 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, =0x0202406e + ldr r7, =0x02024064 + 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, =0x02023064 + lsls r2, 9 + adds r0, r4, 0x1 + adds r0, r2, r0 + ldrb r0, [r0] + ldr r1, =0x020244ec + 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, =0x0202406e + mov r8, r0 + ldr r6, =0x02024064 + ldrb r1, [r6] + lsls r0, r1, 1 + add r0, r8 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + 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 pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrb r0, [r6] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_806A068 + ldr r0, =0x0202499c + 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 AddObjectToFront + ldr r4, =0x020241e4 + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r5, =0x02020630 + 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, =0x020244e4 + adds r2, r1 + ldrb r1, [r2] + bl StartObjectImageAnim + ldr r1, =0x03005d60 + 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, =0x02024064 + ldrb r0, [r5] + ldr r4, =0x02023064 + lsls r1, r0, 9 + adds r6, r4, 0x2 + adds r1, r6 + ldrb r1, [r1] + bl sub_805EF84 + ldr r2, =0x0202406e + 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, =0x020244ec + adds r0, r2 + bl sub_805DD7C + ldrb r0, [r5] + lsls r1, r0, 9 + adds r1, r6 + ldrb r1, [r1] + bl sub_818BA6C + ldr r1, =0x03005d60 + 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, =0x0202406e + lsls r2, r6, 1 + adds r2, r0 + ldr r0, =0x02023064 + 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, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, =sub_805D714 + bl object_new_hidden_with_callback + ldr r1, =0x03005d7c + mov r9, r1 + add r9, r6 + mov r1, r9 + strb r0, [r1] + adds r0, r6, 0 + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + bl sub_806A068 + ldr r0, =0x0202499c + 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 AddObjectToFront + ldr r4, =0x020241e4 + adds r4, r6, r4 + strb r0, [r4] + ldr r5, =0x02020630 + 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, =0x020244e4 + adds r6, r1 + ldrb r1, [r6] + bl StartObjectImageAnim + 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, =DummyObjectCallback + 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, =0x02023064 + ldr r6, =0x02024064 + ldrb r2, [r6] + lsls r0, r2, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r3, [r0] + cmp r3, 0 + bne _0818BC30 + ldr r0, =0x020244d0 + 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, =0x03005d60 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_818BC78 + str r1, [r0] + b _0818BC66 + .pool +_0818BC30: + ldr r5, =0x020241e4 + adds r0, r2, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl obj_free_rotscale_entry + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r1, =0x03005d70 + 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, =0x020244d0 + ldr r4, [r6] + ldr r5, =0x02024064 + 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, =0x03005d60 + 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, =0x02022fec + 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, =0x020229e8 + ldr r0, =0x0203c7b4 + ldrb r1, [r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + b _0818BD4A + .pool +_0818BD48: + ldr r0, =0x020229e8 +_0818BD4A: + ldrb r4, [r0, 0x13] +_0818BD4C: + ldr r0, =0x02022fec + ldr r1, [r0] + movs r2, 0x40 + ands r1, r2 + adds r5, r0, 0 + cmp r1, 0 + beq _0818BD98 + ldr r0, =0x02024064 + ldrb r0, [r0] + bl battle_get_per_side_status + 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, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + bl sub_806F000 + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + ldr r6, =0x02024064 + ldrb r1, [r6] + adds r0, r5, 0 + bl sub_805DF38 + ldrb r0, [r6] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_806A1C0 + ldr r0, =0x0202499c + 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 AddObjectToFront + ldr r4, =0x020241e4 + ldrb r1, [r6] + adds r1, r4 + strb r0, [r1] + ldr r0, =gTrainerFrontPicPaletteTable + lsls r5, 3 + adds r5, r0 + ldrh r0, [r5, 0x4] + bl IndexOfObjectPaletteTag + ldr r5, =0x02020630 + 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, =0x02024064 + ldrb r1, [r5] + adds r0, r4, 0 + bl sub_805DF84 + ldrb r0, [r5] + bl battle_get_per_side_status + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl template_build_for_pokemon_or_trainer + ldr r6, =0x0202499c + 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 AddObjectToFront + ldr r6, =0x020241e4 + ldrb r1, [r5] + adds r1, r6 + strb r0, [r1] + ldr r4, =0x02020630 + 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, =0x03005d60 + ldr r0, =0x02024064 + 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, =0x020241e4 + ldr r4, =0x02024064 + ldrb r0, [r4] + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =0x02020630 + 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, =DummyObjectCallback + bl oamt_set_x3A_32 + ldr r1, =0x03005d60 + 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, =0x020244d0 + ldr r4, [r6] + ldr r5, =0x02024064 + 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, =0x0202406e + ldrb r1, [r5] + lsls r0, r1, 1 + adds r0, r2 + ldrh r2, [r0] + movs r0, 0x64 + muls r0, r2 + ldr r2, =0x020244ec + adds r0, r2 + bl sub_805E990 + movs r1, 0x40 + negs r1, r1 + movs r0, 0x10 + bl audio_play_and_stuff + ldr r2, =0x02020630 + ldr r3, =0x020241e4 + 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, =0x03005d60 + 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, =0x02024064 + ldrb r0, [r6] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + beq _0818C192 + b _0818C2A6 +_0818C192: + ldr r0, =0x02023064 + 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, =0x02038432 + mov r1, r12 + adds r1, 0x3 + adds r2, r1 + ldrb r1, [r2] + strb r1, [r5] + ldr r4, =0x02038408 + 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, =0x02038404 + 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, =0x0203841a + ldrb r1, [r6] + lsls r1, 9 + mov r2, r12 + adds r2, 0xA + adds r1, r2 + ldrb r1, [r1] + strb r1, [r3] + ldr r4, =0x0203841c + 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, =0x02038400 + ldrb r2, [r6] + lsls r2, 9 + mov r1, r12 + adds r1, 0x10 + adds r2, r1 + str r2, [r3] + ldr r3, =0x020244bc + 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, =0x020244d0 + 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, =0x03005d60 + 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, =0x02023064 + ldr r6, =0x02024064 + 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, =0x020244d0 + 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, =0x020383f8 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =0x020383fd + 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, =0x020244d0 + ldr r2, [r0] + ldr r0, =0x02024064 + 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, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 9 + ldr r1, =0x02023066 + adds r0, r1 + ldrh r0, [r0] + bl battle_pick_message + ldr r0, =0x02022e2c + movs r1, 0 + bl battle_show_message_maybe + ldr r1, =0x03005d60 + 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, =0x02024332 + ldr r0, =0x0202406c + ldrb r0, [r0] + ldrb r1, [r1, 0x4] + lsrs r0, 1 + cmp r1, r0 + bcc _0818C4C6 + ldr r0, =0x02024064 + 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, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 10 + ands r0, r1 + cmp r0, 0 + beq _0818C508 + ldr r1, =0x03005d60 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r1, =sub_818C49C + str r1, [r0] + b _0818C522 + .pool +_0818C508: + ldr r0, =0x02024064 + 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, =0x02022fec + 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, =0x02024064 + 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, =0x02024064 + ldrb r0, [r4] + bl sub_8185054 + ldrb r1, [r4] + ldr r3, =0x0202449c + 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, =0x02023064 + ldr r0, =0x02024064 + 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, =0x0202406e + lsls r0, r4, 1 + adds r0, r6 + ldrh r0, [r0] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + movs r1, 0x3A + bl pokemon_getattr + 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 pokemon_getattr + adds r3, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r1, =0x03005d70 + adds r1, r0, r1 + ldrb r1, [r1] + str r7, [sp] + mov r2, r8 + bl sub_807294C + b _0818C6B2 + .pool +_0818C678: + ldr r1, =0x0202406e + lsls r0, r4, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x3A + bl pokemon_getattr + adds r2, r0, 0 + mov r1, r9 + ldrb r0, [r1] + ldr r4, =0x03005d70 + 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, =0x03005d60 + ldr r0, =0x02024064 + 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, =0x02024064 + ldrb r0, [r4] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0818C748 + ldr r0, =0x03005d70 + ldrb r1, [r4] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, =0x0202406e + lsls r1, 1 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0x64 + muls r1, r2 + ldr r2, =0x020244ec + adds r1, r2 + movs r2, 0x9 + bl healthbar_draw_field_maybe + ldrb r2, [r4] + ldr r0, =0x020244d0 + 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, =0x03005d60 + 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, =0x02024064 + ldrb r0, [r5] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0818C7BC + ldr r4, =0x02023064 + 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, =0x03005d60 + 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, =0x02022d0c + 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, =0x02022d0c + ldr r1, =0x02023064 + ldr r0, =0x02024064 + 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, =0x02022d0c + 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, =0x02022d0c + 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, =0x02020630 + ldr r2, =0x020241e4 + ldr r4, =0x02024064 + 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, =0x020244b9 + 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, =0x03005d60 + 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, =0x02024064 + ldrb r0, [r4] + bl battle_side_get_owner + lsls r0, 24 + movs r3, 0x3F + cmp r0, 0 + bne _0818C964 + movs r3, 0xC0 +_0818C964: + ldr r2, =0x02023064 + 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 audio_play_and_stuff + 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, =0x02023064 + ldr r5, =0x02024064 + 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 song_play_for_text + 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 fanfare_play +_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, =0x0202406e + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x19 + negs r1, r1 + movs r2, 0x5 + bl sub_80A32E4 + 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, =0x02023064 + ldr r0, =0x02024064 + ldrb r0, [r0] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + bl battle_intro_launch + ldr r2, =0x020243fc + 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, =0x020241e4 + ldr r6, =0x02024064 + ldrb r0, [r6] + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + 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 StartObjectImageAnim + ldr r0, =0x0000d6f9 + bl AllocObjectPalette + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 18 + ands r0, r1 + cmp r0, 0 + beq _0818CB54 + ldr r4, =0x020229e8 + 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, =0x03005d90 + 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 decompress_palette + ldr r2, =0x02020630 + ldr r1, =0x020241e4 + ldr r5, =0x02024064 + 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, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r4 + ldrb r0, [r5] + strh r0, [r1, 0x8] + ldr r3, =0x020244d0 + 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, =0x020244b4 + 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, =0x03005d60 + 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, =0x03005e00 + 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, =0x02024064 + 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, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0818CCA0 +_0818CC70: + ldr r0, =0x02023064 + ldrb r1, [r7] + lsls r2, r1, 9 + adds r0, 0x1 + adds r2, r0 + ldr r0, =0x0202406e + 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, =0x02023064 + ldrb r0, [r7] + lsls r1, r0, 9 + adds r4, 0x1 + adds r1, r4 + ldr r5, =0x0202406e + 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, =0x020244ec + 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, =0x03005d60 + ldr r2, =0x02024064 + 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, =0x02023064 + ldr r0, =0x02024064 + 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 battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _0818CD60 + bl sub_818A514 + b _0818CDD4 + .pool +_0818CD60: + ldr r6, =0x020244d0 + ldr r0, [r6] + ldr r5, =0x02024064 + 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, =0x02023068 + 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, =0x020244b4 + 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, =0x03005d60 + 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, =0x020244d0 + ldr r0, [r4] + ldr r3, =0x02024064 + 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, =0x020244d0 + ldr r1, [r0] + ldr r0, =0x02024064 + 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, =0x03005e00 + ldr r0, =0x020244b4 + 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, =0x02024064 + ldrb r0, [r4] + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _0818CEDE + ldr r3, =0x02020630 + ldr r0, =0x020241e4 + 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, =0x02023064 + 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, =0x02024064 + ldrb r0, [r6] + bl mplay_80342A4 + lsls r0, 24 + cmp r0, 0 + bne _0818CF50 + ldr r5, =0x02023064 + 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, =0x03005d60 + 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, =0x0202433a + ldr r1, =0x02023064 + ldr r4, =0x02024064 + ldrb r0, [r4] + lsls r0, 9 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r2] + movs r0, 0x5 + bl sub_80A2F50 + movs r0, 0x3 + bl sub_80A2390 + bl sub_818A514 + ldr r1, =0x03005d60 + 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, =0x0203cd04 + 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 DecompressMonPic + 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 DecompressMonPicWithoutDuplicatingDeoxysTiles + 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, =0x0203ccec + 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, =0x0203ccec + 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, =0x0203ccec + 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 decompress_palette + b _0818D16E + .pool +_0818D160: + ldr r0, =0x0203ccec + 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 decompress_palette + b _0818D1B4 +_0818D1A4: + ldr r1, =gTrainerFrontPicPaletteTable + lsls r0, 3 + adds r0, r1 + ldr r0, [r0] + lsls r1, r4, 4 + movs r2, 0x20 + bl decompress_palette +_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, =0x0203ccec + ldr r0, =gUnknown_082FF70C + str r0, [r1, 0x8] + b _0818D1E0 + .pool +_0818D1D8: + ldr r0, =0x0203ccec + 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, =0x0203cd04 + 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, =0x0203ccec + 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, =gDummyObjectRotScalAnimTable + 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 AddObjectToFront + lsls r0, 24 + lsrs r2, r0, 24 + adds r6, r2, 0 + ldr r0, =0x0000ffff + cmp r10, r0 + bne _0818D336 + ldr r0, =0x02020630 + 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, =0x0203cd04 + 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, =0x0203cd04 + 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, =0x0203ccec + 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, =gDummyObjectRotScalAnimTable + 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 AddObjectToFront + 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, =0x02020630 + 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, =0x0203cd04 + 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, =0x0203cd04 + 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, =0x02020630 + adds r0, r6, r4 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + bl GetObjectPaletteTagBySlot + lsls r0, 16 + lsrs r0, 16 + bl FreeObjectPaletteByTag +_0818D624: + adds r0, r6, r4 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + 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, =0x03005d8c + 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, =0x03005d8c + 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, =0x020375f0 + movs r0, 0x1 + b _0818DA24 + .pool +_0818DA20: + ldr r1, =0x020375f0 + 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, =0x03005d90 + 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 GenerateRandomNumber + 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, =0x020375f0 + 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 GenerateRandomNumber + ldr r5, =0x0203cd64 + 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 GenerateRandomNumber + 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, =0x0203cd64 + ldr r0, =0x03005d8c + 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, =gUnknown_82E9531 + 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, =0x0203cd64 + ldr r0, =0x03005d8c + 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, =0x0203cd64 + ldr r0, =0x03005d8c + 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, =0x0203cd64 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldr r4, =0x02021cc4 + ldrb r0, [r0, 0xC] + bl sub_818DC1C + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + 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, =0x0203cd64 + ldr r0, =0x03005d8c + 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, =0x02021ec4 + ldr r0, =0x00003b5c + adds r1, r0 + adds r0, r4, 0 + bl CopyString_Limit7 + ldr r0, [r5] + ldrb r1, [r0, 0x12] + adds r0, r4, 0 + bl StopMusicWhileStringIsPrinted + 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_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_818DCAC + + thumb_func_start sub_818DCC8 +sub_818DCC8: @ 818DCC8 + push {lr} + ldr r2, =0x0203cd64 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x00003b58 + adds r1, r0 + str r1, [r2] + ldr r0, =0x02021dc4 + 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 CopyString_Limit7 + 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, =0x0203cd64 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r1, r0, r2 + str r1, [r5] + ldr r1, =0x00003b5c + adds r0, r1 + ldr r4, =0x02021ec4 + adds r1, r4, 0 + bl sub_818DCF4 + ldr r0, [r5] + ldrb r1, [r0, 0x12] + adds r0, r4, 0 + bl StopMusicWhileStringIsPrinted + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818DD14 + + thumb_func_start sub_818DD54 +sub_818DD54: @ 818DD54 + ldr r1, =0x0203cd64 + ldr r0, =0x03005d8c + 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, =0x0203cd64 + ldr r0, =0x03005d8c + 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, =0x02021dc4 + adds r1, r5, 0 + bl sub_818DCAC + ldr r1, [r4] + strh r5, [r1, 0xE] + ldr r0, =0x03005d90 + ldr r0, [r0] + adds r1, 0x4 + bl sub_818DCF4 + ldr r1, [r4] + ldr r0, =gUnknown_82E9531 + 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, =0x0203ce7c + 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, =0x0203cd64 + ldr r0, =0x03005d8c + 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, =0x02021dc4 + 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, =0x0203cd64 + ldr r0, =0x03005d8c + 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, =0x0203cd64 + 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 GenerateRandomNumber + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0xF + ands r4, r0 + movs r3, 0 + ldr r5, =0x0203cd68 + 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, =0x0203cd68 + ldr r0, =0x03005d8c + 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, =gUnknown_82E9531 + 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, =0x0203cd68 + ldr r0, =0x03005d8c + 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, =0x0203cd68 + ldr r0, =0x03005d8c + 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, =0x03005d8c + 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, =0x0203cd68 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r2, =0x00003b58 + adds r0, r1, r2 + str r0, [r5] + ldrb r0, [r0, 0x18] + cmp r0, 0xFF + bne _0818E174 + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EEB7E + bl CopyString_Limit7 + movs r7, 0 + b _0818E1DC + .pool +_0818E174: + ldr r4, =0x02021cc4 + ldr r0, =0x00003b70 + adds r1, r0 + adds r0, r4, 0 + bl CopyString_Limit7 + ldr r0, [r5] + adds r0, 0x2D + ldrb r1, [r0] + adds r0, r4, 0 + bl StopMusicWhileStringIsPrinted + ldr r0, [r5] + adds r0, 0x18 + bl sub_818E258 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r6, =0x03005d90 + 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, =0x0203cd68 + ldr r1, [r0] + adds r1, 0x18 + adds r1, r2 + ldr r0, =0x03005d90 + 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, =0x0203cd68 + ldr r0, =0x03005d8c + 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, =0x03005d90 + 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, =0x02021cc4 + ldr r0, =0x0203cd68 + ldr r0, [r0] + ldrh r0, [r0, 0x28] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + 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, =0x0203cd68 + ldr r0, =0x03005d8c + 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, =gUnknown_82E9531 + 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, =0x0203cd68 + ldr r0, =0x03005d8c + 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, =0x0203cd68 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r5] + ldr r6, =0x02021cc4 + ldrh r1, [r0, 0x14] + adds r0, r6, 0 + bl CopyEasyChatWord + ldr r4, =0x02021dc4 + ldr r0, [r5] + ldrh r1, [r0, 0x16] + adds r0, r4, 0 + bl CopyEasyChatWord + adds r0, r6, 0 + adds r1, r4, 0 + bl CompareString + 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, =0x0203cd68 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldr r1, =0x020375e2 + 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, =0x0203cd68 + ldr r0, =0x03005d8c + 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, =0x0203cd68 + ldr r0, =0x03005d8c + 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, =0x0203cd68 + ldr r0, =0x03005d8c + 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, =0x0203cd68 + ldr r0, =0x03005d8c + 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, =0x0203cd68 + ldr r0, =0x03005d8c + 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, =0x020375e0 + 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, =0x0203ce7c + ldrh r0, [r0] + movs r1, 0x1 + bl remove_item + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E490 + + thumb_func_start sub_818E4A4 +sub_818E4A4: @ 818E4A4 + push {r4-r6,lr} + ldr r2, =0x0203cd68 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00003b58 + adds r0, r1 + str r0, [r2] + ldr r1, =0x0203ce7c + ldrh r1, [r1] + strh r1, [r0, 0x28] + movs r3, 0 + adds r4, r2, 0 + ldr r6, =0x03005d90 + 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 CopyString_Limit7 + ldr r0, [r4] + ldr r1, =gUnknown_82E9531 + 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, =0x0203cd68 + ldr r0, =0x03005d8c + 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, =0x0203cd68 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x00003b58 + adds r1, r0 + str r1, [r2] + ldr r0, =0x02021ec4 + 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, =0x0203cd68 + ldr r1, =0x03005d8c + 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 GenerateRandomNumber + 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, =0x0203cd68 + 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, =0x0203cd6c + 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 GenerateRandomNumber + 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, =0x0203cd6c + ldr r0, =0x03005d8c + 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, =gUnknown_82E9531 + 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, =0x0203cd6c + ldr r0, =0x03005d8c + 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, =0x0203cd6c + ldr r0, =0x03005d8c + 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, =0x03005d90 + adds r1, 0x4 + ldr r0, [r0] + ldm r0!, {r2,r3} + stm r1!, {r2,r3} + ldr r1, [r4] + ldr r0, =gUnknown_82E9531 + 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, =0x0203cd6c + ldr r0, =0x03005d8c + 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, =0x0203cd6c + 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, =0x0203cd6c + ldr r1, =0x03005d8c + 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 CopyString + 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 CopyString_Limit10 + 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, =0x0203cd6c + ldr r1, =0x03005d8c + 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 CopyString + 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, =0x0203cd6c + ldr r1, =0x03005d8c + ldr r1, [r1] + ldr r4, =0x00003b58 + adds r2, r1, r4 + str r2, [r3] + ldr r2, =0x00003b5c + adds r1, r2 + bl CopyString + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E81C + + thumb_func_start sub_818E848 +sub_818E848: @ 818E848 + ldr r2, =0x0203cd6c + ldr r1, =0x03005d8c + 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 CopyString + pop {r0} + bx r0 + .pool + thumb_func_end sub_818E868 + + thumb_func_start sub_818E880 +sub_818E880: @ 818E880 + push {lr} + ldr r1, =0x0203cd6c + ldr r0, =0x03005d8c + 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, =0x0203cd6c + ldr r0, =0x03005d8c + 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, =0x0203cd6c + ldr r0, =0x03005d8c + 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, =0x02021dc4 + ldr r1, =0x02021cc4 + 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, =0x0203cd6c + ldr r0, =0x03005d8c + 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, =0x0203cd6c + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00003b58 + adds r0, r2 + str r0, [r1] + ldr r2, =0x020375e2 + 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, =0x0203cd6c + ldr r0, =0x03005d8c + 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, =0x020375e0 + 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, =0x03005d90 + 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, =0x03005d8c + 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, =0x02038bca + 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, =0x03005d90 + 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, =0x020375e2 + 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, =0x020375f0 + ldr r0, =0x03005d90 + 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, =0x020375f0 + ldr r0, =0x03005d90 + 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, =0x020375f0 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 31 + b _0818ECBE + .pool +_0818EB64: + ldr r1, =0x020375f0 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r3, =0x00000d08 + adds r0, r3 + ldrb r0, [r0] + lsls r0, 30 + b _0818ECBE + .pool +_0818EB80: + ldr r1, =0x020375f0 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + b _0818ECBA + .pool +_0818EB98: + ldr r1, =0x020375f0 + ldr r0, =0x03005d90 + 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, =0x020375f0 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 26 + b _0818ECBE + .pool +_0818EBE8: + ldr r1, =0x020375f0 + ldr r0, =0x03005d90 + 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, =0x020375f0 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + b _0818ECBE + .pool +_0818EC24: + ldr r1, =0x020375f0 + ldr r0, =0x03005d90 + 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, =0x020375f0 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + ldrb r0, [r0] + lsrs r0, 7 + strh r0, [r1] + b _0818ED10 + .pool +_0818EC74: + ldr r1, =0x020375f0 + ldr r0, =0x03005d90 + 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, =0x020375f0 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r2, =0x00000d08 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 28 + b _0818ECBE + .pool +_0818ECB0: + ldr r1, =0x020375f0 + ldr r0, =0x03005d90 + 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, =0x0203cef8 + ldr r0, =0x03005d90 + 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, =0x020375f0 + ldr r0, =0x03005d90 + 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, =0x03005d90 + 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, =0x020375e2 + 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, =0x03005d90 + 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, =0x020375e4 + ldrh r0, [r0] + strh r0, [r2] + b _0818F01E + .pool +_0818EDB4: + ldr r0, =0x020375e4 + ldrh r0, [r0] + cmp r0, 0 + beq _0818EDE8 + ldr r0, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + ldr r2, [r0] + ldr r0, =0x020375e4 + 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, =0x03005d90 + ldr r3, [r0] + ldr r0, =0x020375e4 + 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, =0x03005d90 + ldr r3, [r0] + ldr r0, =0x020375e4 + ldrb r0, [r0] + ldr r1, =0x00000d08 + adds r3, r1 + b _0818EFE8 + .pool +_0818EE78: + ldr r0, =0x03005d90 + ldr r3, [r0] + ldr r0, =0x020375e4 + 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, =0x03005d90 + ldr r3, [r0] + ldr r0, =0x020375e4 + 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, =0x03005d90 + ldr r3, [r0] + ldr r0, =0x020375e4 + 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, =0x03005d90 + ldr r3, [r0] + ldr r0, =0x020375e4 + 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, =0x03005d90 + ldr r2, [r0] + ldr r0, =0x020375e4 + 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, =0x03005d90 + ldr r2, [r0] + ldr r0, =0x020375e4 + 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, =0x03005d90 + ldr r3, [r0] + ldr r0, =0x020375e4 + 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, =0x03005d90 + ldr r3, [r0] + ldr r0, =0x020375e4 + 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, =0x03005d90 + ldr r3, [r0] + ldr r0, =0x020375e4 + 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, =0x03005d90 + ldr r2, [r0] + ldr r0, =0x0203cef8 + 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, =0x03005d90 + 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, =0x02024488 + 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 pokemon_getattr + 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 pokemon_getattr + 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, =0x03005d90 +_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 pokemon_getattr + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x0203bc8c + 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, =0x03005d90 + 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, =0x0203bc8c + 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, =0x03005d90 + 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, =gUnknown_0832A328 + ldr r5, =gBaseStats +_0818F38A: + ldr r0, =0x03005d90 + 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, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x3B + movs r2, 0 + bl pokemon_getattr + ldr r2, [sp, 0x18] + ldrh r1, [r2] + adds r1, r0 + strh r1, [r2] + adds r0, r4, 0 + movs r1, 0x3C + movs r2, 0 + bl pokemon_getattr + ldr r3, [sp, 0x18] + ldrh r1, [r3] + adds r1, r0 + strh r1, [r3] + adds r0, r4, 0 + movs r1, 0x3E + movs r2, 0 + bl pokemon_getattr + ldr r2, [sp, 0x18] + ldrh r1, [r2] + adds r1, r0 + strh r1, [r2] + adds r0, r4, 0 + movs r1, 0x3F + movs r2, 0 + bl pokemon_getattr + ldr r3, [sp, 0x18] + ldrh r1, [r3] + adds r1, r0 + strh r1, [r3] + adds r0, r4, 0 + movs r1, 0x3D + movs r2, 0 + bl pokemon_getattr + ldr r2, [sp, 0x18] + ldrh r1, [r2] + adds r1, r0 + strh r1, [r2] + adds r0, r4, 0 + movs r1, 0x3A + movs r2, 0 + bl pokemon_getattr + ldr r3, [sp, 0x18] + ldrh r1, [r3] + adds r1, r0 + strh r1, [r3] + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + 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 pokemon_getattr + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x0203bc8c + 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, =0x03005d90 + ldr r0, [r3] + ldr r1, =0x00000d64 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + ldr r2, =0x0203bc8c + 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, =gUnknown_0832A328 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x02021cc4 + ldr r2, =gUnknown_085CCD20 + ldr r1, =0x03005d90 + ldr r1, [r1] + ldr r3, =0x00000cb2 + adds r1, r3 + ldrh r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl CopyString + pop {r0} + bx r0 + .pool + thumb_func_end sub_818F9B0 + + thumb_func_start sub_818F9E0 +sub_818F9E0: @ 818F9E0 + push {lr} + ldr r0, =0x02021cc4 + ldr r2, =gUnknown_085CCD20 + ldr r1, =0x03005d90 + ldr r1, [r1] + ldr r3, =0x00000cb2 + adds r1, r3 + ldrh r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl CopyString + ldr r0, =0x02021dc4 + ldr r1, =0x02038bca + 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, =0x0203cd70 + movs r0, 0 + str r0, [r1] + ldr r4, =0x020244ec + adds r0, r4, 0 + movs r1, 0x3A + movs r2, 0 + bl pokemon_getattr + ldr r5, =0x0203cd74 + str r0, [r5] + adds r4, 0x64 + adds r0, r4, 0 + movs r1, 0x3A + movs r2, 0 + bl pokemon_getattr + ldr r1, [r5] + adds r1, r0 + str r1, [r5] + bl calc_player_party_count + ldr r0, =0x02038bca + 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, =0x02024744 + adds r0, r3, r6 + ldr r7, =0x03005d90 + 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, =0x0203bc8c + 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, =0x0203bc8c + mov r4, r10 + str r4, [sp, 0x20] +_0818FB18: + ldr r7, =0x03005d90 + 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, =0x02024744 + adds r0, r7, r2 + mov r2, r12 + str r3, [sp, 0x24] + bl sub_80691F4 + ldr r7, =0x03005d90 + 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, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0xC + bl pokemon_setattr + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, [sp, 0x20] + add r1, r8 + ldr r2, =0x00000d64 + adds r0, r2 + adds r0, r1 + ldrh r0, [r0] + ldr r1, =0x0203bc8c + 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 pokemon_setattr + 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 GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r7, r4, 16 + lsls r0, 16 + orrs r7, r0 + bl GenerateRandomNumber + 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 GenerateRandomNumber + 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, =0x03005d90 + 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, =0x0203bc8c + 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, =0x020244ec + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + 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, =0x03005d90 + 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, =0x0203bc8c + 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, =0x020244ec + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + 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, =gUnknown_0832A328 +_0818FEF0: + str r3, [sp, 0x14] + bl GenerateRandomNumber + 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 GenerateRandomNumber + 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, =gUnknown_0832A328 + 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, =0x03005d90 + 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, =0x02038bca + 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, =0x03005d90 + 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, =0x02038bca + 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, =0x03005d90 + ldr r0, [r4] + ldr r1, =0x020375e2 + 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, =0x03005d90 + 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, =0x03005e00 + 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, =0x03005e00 + 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, =0x02022e14 + strh r4, [r0] + ldr r0, =0x02022e16 + strh r4, [r0] + ldr r0, =0x02022e18 + strh r4, [r0] + ldr r0, =0x02022e1a + strh r4, [r0] + ldr r0, =0x02022e20 + strh r4, [r0] + ldr r0, =0x02022e22 + strh r4, [r0] + mov r2, r9 + cmp r2, 0x2 + bne _081904DC + ldr r0, =0x02022e1c + strh r4, [r0] + ldr r0, =0x02022e1e + strh r4, [r0] + b _081904E6 + .pool +_081904DC: + ldr r0, =0x02022e1c + strh r4, [r0] + ldr r1, =0x02022e1e + movs r0, 0xA0 + strh r0, [r1] +_081904E6: + ldr r0, =0x03005e00 + 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 sub_80A1A74 + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + ldr r1, =0x0300301c + 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 decompress_palette + ldr r0, =gUnknown_08D85444 + movs r1, 0x80 + lsls r1, 1 + adds r2, r4, 0 + bl decompress_palette + ldr r0, =gUnknown_08D85600 + movs r1, 0xF0 + movs r2, 0x20 + bl decompress_palette + mov r0, r9 + cmp r0, 0x2 + bne _081905DE + ldr r0, =gUnknown_08D854C8 + movs r1, 0x50 + movs r2, 0x20 + bl decompress_palette +_081905DE: + str r7, [sp, 0x8] + add r0, sp, 0x8 + ldr r1, =0x02037b14 + 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, =0x0203cd78 + 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, =0x03005e00 + 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, =0x0203cd78 + 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 AddObjectToFront + lsls r0, 24 + lsrs r7, r0, 24 + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + ldr r1, =0x02020630 + mov r8, r1 + add r4, r8 + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnim + strh r6, [r4, 0x2E] + adds r0, r5, 0 + movs r1, 0x78 + movs r2, 0x9C + movs r3, 0 + bl AddObjectToFront + 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 StartObjectImageAnim + strh r6, [r4, 0x2E] + ldr r5, =gUnknown_0860D050 + adds r0, r5, 0 + movs r1, 0x6 + movs r2, 0x50 + movs r3, 0 + bl AddObjectToFront + 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 StartObjectImageAnim + 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 AddObjectToFront + 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 StartObjectImageAnim + 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, =DummyObjectCallback + str r0, [r2, 0x1C] + b _081907F0 + .pool +_081907D4: + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0xBF + ble _081907F0 + ldr r0, =0x0203cd78 + 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, =DummyObjectCallback + 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, =0x0203cd78 + 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, =DummyObjectCallback + str r0, [r2, 0x1C] + b _081908C0 + .pool +_081908A4: + lsls r1, 16 + ldr r0, =0x010f0000 + cmp r1, r0 + ble _081908C0 + ldr r0, =0x0203cd78 + 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, =DummyObjectCallback + 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, =0x0203cd78 + 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, =0x0203cd78 + 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, =0x0203cd78 + 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, =0x0203cd78 + 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, =0x0203cd78 + 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, =0x03005e00 + 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, =0x03005d90 + 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, =0x0203cd78 + 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, =0x0203cd78 + 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, =0x0203cd78 + 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, =0x0203cd78 + 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, =0x0203cd78 + 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, =0x03005e00 + 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, =0x0203cd78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _08190CA6 + b _08190CC0 + .pool +_08190C9C: + ldr r0, =0x0203cd78 + 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, =0x03005e00 + 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, =0x02037fd4 + 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 pal_fade_maybe + ldr r1, =0x03005e00 + 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, =0x02037fd4 + 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, =0x03005e00 + 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 pal_fade_maybe + ldr r1, =0x03005e00 + 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, =0x03005e00 + 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, =0x03005e00 + 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, =0x03005e00 + 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, =0x03005e00 + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _08190ED4 + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r0, =0x02022e18 + strh r1, [r0] + ldr r1, =0x02022e1a + movs r0, 0xA0 + strh r0, [r1] + b _08190EE6 + .pool +_08190ED4: + ldr r0, =0x02022e14 + strh r2, [r0] + ldr r1, =0x02022e16 + movs r0, 0xA0 + strh r0, [r1] + ldr r0, =0x02022e18 + strh r2, [r0] + ldr r0, =0x02022e1a + strh r2, [r0] +_08190EE6: + cmp r6, 0x1 + bne _08190F9C + ldr r5, =0x0203cd78 + ldr r0, [r5] + ldrb r1, [r0, 0x10] + cmp r1, 0 + bne _08190F50 + ldr r0, =0x02022e1c + strh r1, [r0] + ldr r1, =0x02022e1e + movs r6, 0xA0 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r1] + ldr r3, =gUnknown_0860D080 + ldr r2, =0x03005e00 + 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, =0x02022e1c + movs r6, 0x80 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r1] + ldr r0, =0x02022e1e + movs r4, 0 + strh r4, [r0] + ldr r3, =gUnknown_0860D080 + ldr r2, =0x03005e00 + 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, =0x0203cd78 + ldr r1, [r6] + ldrb r5, [r1, 0x10] + cmp r5, 0 + bne _08190FF8 + ldr r4, =0x03005e00 + 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, =0x02022e1c + strh r5, [r0] + ldr r1, =0x02022e1e + 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, =0x03005e00 + 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, =0x02022e1c + movs r0, 0 + strh r0, [r1] + ldr r1, =0x02022e1e + 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, =0x02022e1c + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + strh r0, [r1] + ldr r1, =0x02022e1e + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =0x03005e00 + 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, =0x0203cd78 + mov r10, r5 + ldr r3, =0x02020630 + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, =0x03005e00 + 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, =0x0203cd78 + mov r12, r2 + ldr r3, =0x02020630 + ldr r1, =0x03005e00 + 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, =0x03005e00 + adds r0, r3 + movs r2, 0 + movs r1, 0x4 + bl _08191FE8 + .pool +_08191234: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, =0x03005e00 + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _08191278 + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r0, =0x02022e18 + strh r1, [r0] + ldr r1, =0x02022e1a + ldr r2, =0x0000ff60 + adds r0, r2, 0 + strh r0, [r1] + b _0819128C + .pool +_08191278: + ldr r0, =0x02022e14 + strh r2, [r0] + ldr r1, =0x02022e16 + ldr r3, =0x0000ff60 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, =0x02022e18 + strh r2, [r0] + ldr r0, =0x02022e1a + strh r2, [r0] +_0819128C: + cmp r6, 0x2 + bne _0819133C + ldr r5, =0x0203cd78 + ldr r0, [r5] + ldrb r1, [r0, 0x10] + cmp r1, 0 + bne _081912F4 + ldr r0, =0x02022e1c + strh r1, [r0] + ldr r1, =0x02022e1e + movs r0, 0xA0 + strh r0, [r1] + ldr r3, =gUnknown_0860D080 + ldr r2, =0x03005e00 + 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, =0x02022e1c + movs r4, 0 + strh r4, [r0] + ldr r0, =0x02022e1e + strh r4, [r0] + ldr r3, =gUnknown_0860D080 + ldr r2, =0x03005e00 + 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, =0x0203cd78 + ldr r1, [r6] + ldrb r5, [r1, 0x10] + cmp r5, 0 + bne _08191394 + ldr r4, =0x03005e00 + 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, =0x02022e1c + strh r5, [r0] + ldr r1, =0x02022e1e + 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, =0x03005e00 + 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, =0x02022e1c + movs r0, 0 + strh r0, [r1] + ldr r1, =0x02022e1e + 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, =0x02022e1c + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + strh r0, [r1] + ldr r1, =0x02022e1e + movs r0, 0 + strh r0, [r1] + ldr r1, =0x03005e00 + 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, =0x0203cd78 + mov r10, r0 + ldr r3, =0x02020630 + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, =0x03005e00 + 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, =0x0203cd78 + mov r12, r2 + ldr r3, =0x02020630 + ldr r1, =0x03005e00 + 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, =0x03005e00 + adds r0, r3 + movs r2, 0 + movs r1, 0x5 + bl _08191FE8 + .pool +_081915CC: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, =0x03005e00 + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _0819160C + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r2, =0x02022e18 + movs r6, 0x80 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r2] + ldr r0, =0x02022e1a + strh r1, [r0] + b _08191622 + .pool +_0819160C: + ldr r1, =0x02022e14 + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, =0x02022e16 + strh r2, [r0] + ldr r0, =0x02022e18 + strh r2, [r0] + ldr r0, =0x02022e1a + strh r2, [r0] +_08191622: + ldr r0, =0x0203cd78 + ldr r4, [r0] + ldrb r0, [r4, 0x10] + cmp r0, 0 + bne _08191688 + ldr r1, =0x02022e1c + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + strh r0, [r1] + ldr r1, =0x02022e1e + movs r0, 0xA0 + strh r0, [r1] + ldr r3, =gUnknown_0860D080 + ldr r2, =0x03005e00 + 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, =0x02022e1c + movs r6, 0x80 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r1] + ldr r1, =0x02022e1e + movs r0, 0 + strh r0, [r1] + ldr r3, =gUnknown_0860D15C + ldr r2, =0x03005e00 + 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, =0x0203cd78 + mov r10, r0 + ldr r3, =0x02020630 + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, =0x03005e00 + 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, =0x0203cd78 + mov r12, r2 + ldr r3, =0x02020630 + ldr r1, =0x03005e00 + 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, =0x03005e00 + adds r0, r3 + movs r2, 0 + movs r1, 0x6 + b _08191FE8 + .pool +_0819187C: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, =0x03005e00 + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _081918BC + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r2, =0x02022e18 + movs r6, 0x80 + lsls r6, 1 + adds r0, r6, 0 + strh r0, [r2] + ldr r0, =0x02022e1a + strh r1, [r0] + b _081918D2 + .pool +_081918BC: + ldr r1, =0x02022e14 + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, =0x02022e16 + strh r2, [r0] + ldr r0, =0x02022e18 + strh r2, [r0] + ldr r0, =0x02022e1a + strh r2, [r0] +_081918D2: + ldr r0, =0x0203cd78 + ldr r2, [r0] + ldrb r0, [r2, 0x10] + cmp r0, 0 + bne _08191924 + ldr r1, =0x02022e1c + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + strh r0, [r1] + ldr r1, =0x02022e1e + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =0x03005e00 + 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, =0x02022e1c + movs r0, 0 + strh r0, [r1] + ldr r1, =0x02022e1e + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =0x03005e00 + 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, =0x0203cd78 + mov r10, r0 + ldr r3, =0x02020630 + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, =0x03005e00 + 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, =0x0203cd78 + mov r12, r2 + ldr r3, =0x02020630 + ldr r1, =0x03005e00 + 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, =0x03005e00 + adds r0, r3 + movs r2, 0 + movs r1, 0x6 + b _08191FE8 + .pool +_08191B08: + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r4, =0x03005e00 + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _08191B48 + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r2, =0x02022e18 + movs r6, 0xFF + lsls r6, 8 + adds r0, r6, 0 + strh r0, [r2] + ldr r0, =0x02022e1a + strh r1, [r0] + b _08191B5E + .pool +_08191B48: + ldr r1, =0x02022e14 + movs r3, 0xFF + lsls r3, 8 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, =0x02022e16 + strh r2, [r0] + ldr r0, =0x02022e18 + strh r2, [r0] + ldr r0, =0x02022e1a + strh r2, [r0] +_08191B5E: + ldr r0, =0x0203cd78 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + bne _08191B94 + ldr r1, =0x02022e1c + movs r0, 0 + strh r0, [r1] + ldr r1, =0x02022e1e + movs r0, 0xA0 + strh r0, [r1] + b _08191B9E + .pool +_08191B94: + ldr r0, =0x02022e1c + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e1e + strh r1, [r0] +_08191B9E: + ldr r4, =gUnknown_0860D15C + ldr r5, =0x0203cd78 + ldr r3, [r5] + ldr r2, =0x03005e00 + 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, =0x02020630 + 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, =0x0203cd78 + mov r12, r2 + ldr r3, =0x02020630 + ldr r1, =0x03005e00 + 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, =0x03005e00 + adds r0, r4 + movs r5, 0xC + ldrsh r2, [r0, r5] + cmp r2, 0 + beq _08191DA8 + ldr r0, =0x02022e14 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x02022e16 + strh r1, [r0] + ldr r2, =0x02022e18 + movs r6, 0xFF + lsls r6, 8 + adds r0, r6, 0 + strh r0, [r2] + ldr r0, =0x02022e1a + strh r1, [r0] + b _08191DBE + .pool +_08191DA8: + ldr r1, =0x02022e14 + movs r3, 0xFF + lsls r3, 8 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, =0x02022e16 + strh r2, [r0] + ldr r0, =0x02022e18 + strh r2, [r0] + ldr r0, =0x02022e1a + strh r2, [r0] +_08191DBE: + ldr r0, =0x0203cd78 + ldr r2, [r0] + ldrb r0, [r2, 0x10] + cmp r0, 0x2 + bne _08191E10 + ldr r1, =0x02022e1c + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + strh r0, [r1] + ldr r1, =0x02022e1e + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =0x03005e00 + 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, =0x02022e1c + movs r0, 0 + strh r0, [r1] + ldr r1, =0x02022e1e + movs r0, 0xA0 + strh r0, [r1] + ldr r1, =0x03005e00 + 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, =0x0203cd78 + mov r10, r0 + ldr r3, =0x02020630 + mov r0, r9 + add r0, r8 + lsls r0, 3 + ldr r1, =0x03005e00 + 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, =0x0203cd78 + mov r12, r2 + ldr r3, =0x02020630 + ldr r1, =0x03005e00 + 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, =0x03005e00 + 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, =0x03005e00 + 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, =0x02022e16 + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + ldr r1, =0x02022e1a + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + ldr r1, =0x02022e1e + b _081920A4 + .pool +_08192038: + mov r6, r8 + lsls r0, r6, 2 + add r0, r8 + lsls r0, 3 + ldr r2, =0x03005e00 + 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, =0x02022e16 + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + ldr r1, =0x02022e1a + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + ldr r1, =0x02022e1e + b _081920E8 + .pool +_08192078: + mov r3, r8 + lsls r0, r3, 2 + add r0, r8 + lsls r0, 3 + ldr r4, =0x03005e00 + 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, =0x02022e14 + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + ldr r1, =0x02022e18 + ldrh r0, [r1] + subs r0, 0x4 + strh r0, [r1] + ldr r1, =0x02022e1c +_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, =0x03005e00 + 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, =0x02022e14 + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + ldr r1, =0x02022e18 + ldrh r0, [r1] + adds r0, 0x4 + strh r0, [r1] + ldr r1, =0x02022e1c +_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, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08192202 + movs r6, 0 + ldr r4, =0x0203cd78 +_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, =0x02020630 + adds r0, r1 + bl sub_80D2EF8 +_0819214E: + adds r6, 0x1 + cmp r6, 0x7 + ble _08192116 + movs r6, 0x8 + ldr r4, =0x0203cd78 +_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, =0x02020630 + adds r0, r1 + bl sub_80D2EF8 +_0819218E: + adds r6, 0x1 + cmp r6, 0xF + ble _08192158 + bl sub_80D2F9C + ldr r4, =0x0203cd78 + 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, =0x03005e00 + 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, =0x03005e00 + 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, =0x03005d90 + ldr r0, [r3] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + mov r8, r0 + ldr r1, =0x030022c0 + 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, =0x0203cd78 + 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, =0x0203cd78 + 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, =0x0203cd78 + 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, =0x03005d90 + 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, =0x0203cd78 + 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, =0x03005d90 + 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, =0x0203cd78 + 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, =0x0203cd78 + ldr r3, [r0] + ldrb r0, [r3, 0x10] + cmp r0, 0 + beq _081923A0 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + ldr r2, =0x03005e00 + 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, =0x03005e00 + adds r0, r3 + b _0819249E + .pool +_081923B0: + movs r0, 0x40 + ands r0, r4 + cmp r0, 0 + beq _081923DE + ldr r0, =0x0203cd78 + 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, =0x0203cd78 + 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, =0x0203cd78 + 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, =0x0203cd78 + 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, =0x0203cd78 + ldr r0, [r0] + ldrb r1, [r0, 0x10] + cmp r1, 0 + bne _08192470 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + ldr r2, =0x03005e00 + 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, =0x03005e00 + 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, =0x03005e00 + adds r0, r1 +_0819249E: + strh r5, [r0, 0xA] +_081924A0: + cmp r7, 0 + beq _081924CC + cmp r7, 0x9 + beq _081924CC + movs r0, 0x5 + bl audio_play + ldr r1, =0x03005e00 + 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, =0x03005d90 + 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, =0x0203cd78 + 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, =0x02020630 + ldr r0, =0x0203cd78 + 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, =0x0203cd78 + ldr r2, =0x02020630 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + ldr r0, [r0] + ldr r3, =0x00000d64 + adds r0, r3 + adds r0, r5 + ldrh r1, [r0] + ldr r0, =0x0203bc8c + 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, =0x02021cc4 + 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, =0x02021cc4 + 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, =0x03005d90 + ldr r1, [r0] + adds r0, r5, 0 + bl AppendString + b _08192836 + .pool +_08192800: + ldr r0, =0x000003fe + ldr r3, [sp, 0x24] + cmp r3, r0 + bne _08192824 + ldr r4, =0x02021dc4 + adds r0, r4, 0 + bl sub_8195938 + adds r0, r5, 0 + adds r1, r4, 0 + bl AppendString + b _08192836 + .pool +_08192824: + ldr r4, =0x02021dc4 + ldr r1, [sp, 0x24] + adds r0, r4, 0 + bl sub_8195898 + adds r0, r5, 0 + adds r1, r4, 0 + bl AppendString +_08192836: + add r0, sp, 0xC + ldrb r0, [r0, 0x5] + ldr r4, =0x02021cc4 + 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, =0x03005d90 + 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, =0x03005d90 + ldr r1, [r0] + lsls r0, r7, 1 + add r0, r9 + ldr r2, =0x00000d64 + adds r1, r2 + b _081928FA + .pool +_081928E4: + ldr r4, =0x03005d90 + ldr r1, [r4] + lsls r0, r7, 1 + add r0, r9 + ldr r2, =0x00000d64 + adds r1, r2 + adds r1, r0 + ldrh r1, [r1] + ldr r0, =0x0203bc8c + 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, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000efc + adds r0, r1 + add r0, r9 + b _08192A48 + .pool +_08192A20: + ldr r0, =0x03005d90 + 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, =0x0203bc8c + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x0203bc8c + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x02021cc4 + adds r1, r2, 0 + bl CopyString + b _08192FB8 + .pool +_08192F9C: + lsrs r0, r1, 22 + cmp r0, r9 + bne _08192FB0 + ldr r0, =0x02021cc4 + bl sub_8195938 + b _08192FB8 + .pool +_08192FB0: + lsrs r1, 22 + ldr r0, =0x02021cc4 + 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, =0x03005d90 + 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, =0x02021dc4 + bl CopyString + 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, =0x02021cc4 + adds r1, r3, 0 + bl CopyString + b _08193100 + .pool +_081930E0: + ldr r0, =0xff800000 + cmp r1, r0 + bne _081930F8 + ldr r0, =0x02021cc4 + bl sub_8195938 + b _08193100 + .pool +_081930F8: + lsrs r1, 22 + ldr r0, =0x02021cc4 + 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, =0x0203cd78 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x0203cd78 + 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, =0x02020630 + ldr r0, =0x0203cd78 + 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, =0x02020630 + ldr r0, =0x0203cd78 + 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, =0x03005d90 + 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, =0x0203cd78 + 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, =0x02020630 + ldr r0, =0x0203cd78 + 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, =0x02020630 + ldr r0, =0x0203cd78 + 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, =0x0203cd78 + ldr r7, =0x02020630 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x0203bc8c + 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, =0x0203cd78 + ldr r7, =0x02020630 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x0203bc8c + 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, =0x02021fc4 + ldr r0, =gUnknown_0860D38C + ldr r7, [sp, 0x70] + adds r0, r7, r0 + ldr r1, [r0] + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x02021cc4 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + b _0819377E + .pool +_0819375C: + ldr r0, =0x000003fe + cmp r1, r0 + bne _08193774 + ldr r0, =0x02021cc4 + bl sub_8195938 + b _0819377E + .pool +_08193774: + ldr r0, =0x02021cc4 + 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, =0x02021cc4 + 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, =0x03005d90 + ldr r1, [r0] + adds r0, r5, 0 + bl CopyString + 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, =0x02021cc4 + 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, =0x03005e00 + 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, =0x03005d90 + 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, =0x03005e00 + 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, =0x03005e00 + 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, =0x02037fd4 + 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 pal_fade_maybe + ldr r1, =0x03005e00 + 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, =0x02020630 + adds r0, r1 + movs r1, 0x1 + bl StartObjectImageAnim + b _08193BC2 + .pool +_08193A00: + ldr r0, =0x02037fd4 + 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 pal_fade_maybe + ldr r1, =0x03005e00 + 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 pal_fade_maybe + ldr r1, =0x03005e00 + 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 pal_fade_maybe + ldr r1, =0x03005e00 + 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, =0x02037fd4 + 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, =0x0203cd7c + 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, =0x03005e00 + 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, =0x0203cd78 + ldr r0, [r0] + strb r3, [r0, 0x10] + b _08193BC2 + .pool +_08193B20: + ldr r0, =0x02037fd4 + 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, =0x0203cd7c + 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, =0x03005e00 + 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, =0x02037fd4 + 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, =0x0203cd7c + ldr r0, [r4] + bl Free + str r6, [r4] + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + ldr r1, =0x03005e00 + 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, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0xA + ldrsh r5, [r0, r1] + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r6, [r0] + ldr r0, =0x030022c0 + 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 audio_play + movs r0, 0 + mov r9, r0 + b _08193CDE + .pool +_08193C3C: + cmp r5, 0xF + bgt _08193C4C + movs r0, 0x5 + bl audio_play + movs r1, 0x2 + mov r9, r1 + b _08193CDE +_08193C4C: + movs r0, 0x5 + bl audio_play + 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 audio_play + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + movs r1, 0 + bl StartObjectImageAnim + 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 StartObjectImageAnim + ldr r1, =0x03005e00 + 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, =0x03005e00 + 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, =0x020375e2 + ldrh r0, [r7] + cmp r0, 0x1 + bne _08193E10 + ldr r5, =0x02038bca + ldrh r0, [r5] + bl sub_8195358 + ldr r4, =0x03005d90 + 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, =0x03005d10 + 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, =0x03005d90 + 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, =0x03005d10 + ldrh r0, [r0, 0x24] + strh r0, [r1] + ldr r0, =0x0202433a + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x0203bc8c + 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 GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r4, 16 + lsrs r5, r4, 16 + lsls r0, 16 + orrs r5, r0 + ldr r2, =0x03005d90 + ldr r0, [r2] + ldr r4, =0x00000d64 + adds r0, r4 + add r0, r8 + ldrh r4, [r0] + ldr r3, =0x0203bc8c + 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, =0x03005d90 + 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, =0x03005e00 + 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, =0x02022e14 + strh r4, [r0] + ldr r0, =0x02022e16 + strh r4, [r0] + ldr r0, =0x02022e18 + strh r4, [r0] + ldr r0, =0x02022e1a + 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, =0x03005e00 + 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 sub_80A1A74 + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + ldr r1, =0x03005e00 + mov r3, r8 + lsls r0, r3, 2 + b _0819443C + .pool +_0819438C: + ldr r4, =0x0203cd7c + 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 decompress_palette + ldr r0, =gUnknown_08D85444 + movs r1, 0x80 + lsls r1, 1 + adds r2, r4, 0 + bl decompress_palette + ldr r0, =gUnknown_08D85600 + movs r1, 0xF0 + movs r2, 0x20 + bl decompress_palette + str r6, [sp, 0x18] + add r0, sp, 0x18 + ldr r1, =0x02037b14 + 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, =0x03005e00 + 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 AddObjectToFront + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x1E + bls _08194492 + ldr r0, =0x03005e00 + 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 AddObjectToFront + b _081944E8 + .pool +_081944DC: + ldr r0, =gUnknown_0860CFD8 + movs r1, 0xDA + movs r2, 0xC + movs r3, 0 + bl AddObjectToFront +_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, =0x03005d90 + ldr r0, [r3] + adds r0, r7 + ldr r1, =0x00000d24 + adds r0, r1 + ldrh r1, [r0] + lsls r1, 22 + lsrs r1, 22 + ldr r0, =0x02022e2c + bl sub_8195898 + mov r2, r10 + cmp r2, 0x1 + bne _081945C4 + ldr r3, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005e00 + 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, =0x03005e00 + adds r0, r3 + movs r1, 0x10 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08194660 + ldr r2, =0x03005d90 + ldr r0, [r2] + ldr r3, =0x00000cb2 + adds r0, r3 + ldrh r3, [r0] + adds r6, r2, 0 + b _0819466E + .pool +_08194660: + ldr r1, =0x03005d90 + 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, =0x02022e2c + movs r2, 0x3D + bl GetStringWidthDifference + b _0819476A + .pool +_08194768: + movs r0, 0x3 +_0819476A: + strb r0, [r4, 0x8] + ldr r0, =0x02022e2c + 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, =0x03005e00 + 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, =0x03005e00 + 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, =0x03005e00 + b _0819486C + .pool +_0819485C: + ldr r1, =0x03005e00 + 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, =0x02038c28 + 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, =0x02038c28 + 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, =0x03005e00 + 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 pal_fade_maybe + ldr r1, =0x03005e00 + 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, =0x02037fd4 + 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, =0x02022e2c + mov r9, r0 + ldr r1, =0x03005d90 + 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, =0x030022c0 + 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 pal_fade_maybe + ldr r1, =0x03005e00 + 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, =0x02037fd4 + 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 CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + 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, =0x02022e14 + ldrh r1, [r0] + movs r0, 0x10 + bl SetGpuReg + ldr r0, =0x02022e16 + ldrh r1, [r0] + movs r0, 0x12 + bl SetGpuReg + ldr r0, =0x02022e18 + ldrh r1, [r0] + movs r0, 0x14 + bl SetGpuReg + ldr r0, =0x02022e1a + ldrh r1, [r0] + movs r0, 0x16 + bl SetGpuReg + ldr r0, =0x02022e1c + ldrh r1, [r0] + movs r0, 0x18 + bl SetGpuReg + ldr r0, =0x02022e1e + ldrh r1, [r0] + movs r0, 0x1A + bl SetGpuReg + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + 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, =0x02022e14 + ldrh r1, [r0] + movs r0, 0x10 + bl SetGpuReg + ldr r0, =0x02022e16 + ldrh r1, [r0] + movs r0, 0x12 + bl SetGpuReg + ldr r0, =0x02022e18 + ldrh r1, [r0] + movs r0, 0x14 + bl SetGpuReg + ldr r0, =0x02022e1a + 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 LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + bl sub_80BA0A8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8194CE4 + + thumb_func_start sub_8194D48 +sub_8194D48: @ 8194D48 + ldr r1, =0x0203bc8c + ldr r0, =gBattleFrontierMons + str r0, [r1] + ldr r1, =0x0203bc88 + 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, =0x03005d90 + ldr r1, [r0] + ldr r0, =0x0203cef8 + 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, =0x03005d8c + ldr r0, [r1] + add r0, r9 + adds r1, r5, 0 + adds r1, 0xD + movs r2, 0 + str r3, [sp, 0x4] + bl pokemon_getattr + adds r4, r0, 0 + adds r1, r6, 0 + adds r1, 0xD + ldr r2, =0x020244ec + adds r0, r7, r2 + movs r2, 0 + bl pokemon_getattr + ldr r3, [sp, 0x4] + cmp r4, r0 + bne _08194DBC +_08194DEA: + cmp r5, 0x4 + bne _08194E00 + lsls r2, r6, 24 + lsrs r2, 24 + ldr r1, =0x020244ec + 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, =0x03005d8c + 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, =0x020244ec + 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, =0x03005d8c + movs r6, 0x64 + movs r5, 0 +_08194E50: + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r0, =0x0203cef8 + 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 pokemon_getattr + mov r1, sp + strh r0, [r1] + ldr r0, =0x020244ec + adds r0, r5, r0 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr + 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, =0x02038bca + ldrh r0, [r0] + bl sub_8195358 + adds r4, r0, 0 + ldr r0, =0x000003ff + bl sub_8195358 + cmp r4, r0 + ble _08194EE8 + ldr r1, =0x020375f0 + movs r0, 0x1 + b _08194EEC + .pool +_08194EE8: + ldr r1, =0x020375f0 + 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, =0x03005d90 + 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, =0x02021cc4 + ldr r1, =0x03005d90 + 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, =0x03005d90 + 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 GenerateRandomNumber + 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 GenerateRandomNumber + 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 GenerateRandomNumber + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x0203bc8c + 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, =0x03005d90 + 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, =0x0203bc8c + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x0203bc8c + 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, =0x03005d90 + ldr r0, [r3] + ldr r1, =0x00000d64 + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + ldr r2, =0x0203bc8c + 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, =gUnknown_0832A328 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + ldr r1, [r2] + ldr r3, =0x00000d64 + adds r1, r3 + ldr r2, [sp, 0x38] + adds r0, r1, r2 + ldrh r0, [r0] + ldr r3, =0x0203bc8c + 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, =0x03005d90 + 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 GenerateRandomNumber + 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, =0x03005d90 + ldr r1, [r5] + ldr r0, =0x00000d64 + adds r1, r0 + mov r2, r8 + adds r0, r1, r2 + ldrh r0, [r0] + ldr r5, =0x0203bc8c + 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, =0x03005d90 + 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 GenerateRandomNumber + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + ldr r1, [r5] + movs r2, 0xEC + lsls r2, 4 + adds r1, r2 + ldr r3, [sp, 0x2C] + b _08195872 + .pool +_08195830: + ldr r5, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x0203bc88 + 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, =0x020375e0 + 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, =0x03005d90 + 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, =0x03005d8c + 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, =0x02038bca + 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, =0x03005d90 + 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, =0x020375e2 + 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, =0x020375f0 + ldr r1, [r5] + ldr r2, =0x00000dc6 + adds r1, r2 + ldrh r1, [r1] + strh r1, [r0] + b _08195AD0 + .pool +_08195A90: + ldr r3, =0x020375f0 + 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, =0x020375f0 + 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, =0x03005d90 + 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, =0x020375e2 + 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, =0x020375e4 + 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, =0x020375e4 + ldrh r0, [r0] + strh r0, [r2] + b _08195BA0 + .pool +_08195B5C: + ldr r0, =0x020375e4 + 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, =0x03005d90 + 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, =0x020375f0 + bl GenerateRandomNumber + 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, =0x020375f0 + movs r0, 0x3 + b _08195C14 + .pool +_08195C10: + ldr r1, =0x020375f0 + 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, =0x02038bca + bl GenerateRandomNumber + 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, =0x02038bca + ldrh r1, [r3] + ldr r0, =0x0000012b + cmp r1, r0 + bhi _08195C6C + ldr r2, =0x0203bc88 + 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, =0x03005d90 + 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, =0x03005d90 + ldr r0, [r4] + ldr r1, =0x020375e2 + 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, =0x03005d90 + 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 GenerateRandomNumber + 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 GenerateRandomNumber + 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, =0x03005d90 + ldr r0, [r4] + ldr r1, =0x00000dc6 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl bag_add_item + 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, =0x02021cc4 + bl itemid_get_name + ldr r0, [r4] + ldr r1, =0x00000dc6 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x020375f0 + strh r5, [r0] + b _08195E06 + .pool +_08195E00: + ldr r1, =0x020375f0 + 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 GameFreakRTC_CalcLocalDateTime + ldr r0, =0x03005cf8 + bl sub_8195E34 + ldr r1, =0x0203cd80 + 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 GameFreakRTC_CalcLocalDateTime + ldr r0, =0x03005cf8 + bl sub_8195E34 + adds r1, r0, 0 + ldr r2, =0x0203cd80 + 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, =0x020244ec + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + 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 GenerateRandomNumber + 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, =0x02037318 + 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, =0x02037318 + 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, =0x0203cd80 + 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 GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __umodsi3 + bl sub_8195FF8 + ldr r2, =0x0203cd80 + 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, =0x02037318 + 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, =0x0203cd80 + 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, =0x0203cd80 + 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 audio_play + 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, =0x03005e08 + 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, =0x03005e08 + 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 gpu_pal_apply + ldr r0, =gUnknown_0860EB6C + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + 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, =0x03005e08 + 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, =0x03005e08 + 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, =0x03005e08 + 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, =0x0203cd80 + ldrb r0, [r1, 0x7] + cmp r0, 0 + bne _0819630C + ldrh r0, [r1, 0x4] + ldr r1, =0x02021fc4 + bl sub_81967AC +_0819630C: + movs r1, 0x4 + ldrsh r0, [r4, r1] + ldr r1, =0x02021fc4 + 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, =0x03005e08 + adds r4, r1, r0 + movs r1, 0x4 + ldrsh r0, [r4, r1] + bl sub_8196648 + cmp r0, 0 + bne _08196388 + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _08196388 + ldr r0, =0x030022c0 + 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 audio_play + 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, =0x03005e08 + 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 mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _08196454 + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + ldr r0, =0x0203cd80 + 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, =0x02037350 + 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, =0x03003014 + 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, =0x030022c0 + ldrh r1, [r0, 0x2C] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0819666C + ldr r0, =0x03003014 + ldrb r1, [r0] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r0] + b _08196678 + .pool +_0819666C: + ldr r2, =0x03003014 + 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, =0x03005e08 + 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, =0x03005d8c + 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, =0x0203cd88 + strh r7, [r0] + adds r0, r5, 0 + bl sub_8196710 + cmp r0, 0 + beq _081967EC + adds r0, r5, 0 + bl sub_819672C + ldr r1, =0x02037318 + 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 GenerateRandomNumber + 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 GenerateRandomNumber + 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 DummyObjectCallback +_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 GenerateRandomNumber + 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 GenerateRandomNumber + 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, =0x0203cd88 + strh r0, [r1, 0x2] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _08196960 + cmp r5, 0 + bne _0819695E +_08196980: + ldr r0, =0x0203cd88 + 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 ExpandStringRefs + 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 CopyString + 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 CopyString +_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 GenerateRandomNumber + 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 GenerateRandomNumber + 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 GenerateRandomNumber + 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 CopyString + 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 GenerateRandomNumber + 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 CopyString + 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, =0x0203cd88 + ldrh r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl CopyString + 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, =0x0203cd88 + 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 ConvertIntToDecimalString + 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 GameFreakRTC_GetNumDays + adds r4, r0, 0 + ldr r0, =0x03005d90 + ldr r0, [r0] + adds r0, 0xA + bl sub_80842DC + adds r6, r0, 0 + ldr r0, =0x0000ffff + ands r6, r0 + ldr r0, =0x03005d8c + 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 sub_80847F8 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x02021cc4 + mov r10, r0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r1, =0x02021dc4 + mov r9, r1 + mov r0, r9 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + 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 CopyString + adds r5, r0, 0 + movs r6, 0xFB + strb r6, [r5] + adds r5, 0x1 + ldr r1, =gUnknown_082A5D2C + adds r0, r5, 0 + bl CopyString + 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 CopyString + mov r0, r8 + adds r1, r7, 0 + bl ExpandStringRefs + adds r5, r0, 0 + bl sub_809D42C + 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 ConvertIntToDecimalString + mov r0, r9 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r1, =gUnknown_082A633D + adds r0, r5, 0 + bl ExpandStringRefs +_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 gpu_pal_apply + 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, =0x0203cd8c + movs r1, 0xFF + strb r1, [r0] + ldr r0, =0x0203cd8d + 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, =0x03003014 + 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, =0x03003014 + 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, =0x02021fc4 + 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, =0x03003014 + 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, =0x02021fc4 + 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, =0x03003014 + 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, =0x02021fc4 + 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 gpu_pal_apply + 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 gpu_pal_apply + 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, =0x03003014 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _08197988 + ldr r0, =0x03005d90 + 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, =0x03005d90 + 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, =0x0203cd8c + 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, =0x0203cd8c + 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, =0x0203cd8c + 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, =0x0203cd8d + 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, =0x0203cd8d + ldrb r0, [r0] + bx lr + .pool + thumb_func_end GetMapNamePopUpWindowId + + thumb_func_start RemoveMapNamePopUpWindow +RemoveMapNamePopUpWindow: @ 8197A80 + push {r4,lr} + ldr r4, =0x0203cd8d + 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, =0x03003014 + 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, =0x02021fc4 + 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, =0x0203cd9c + strh r2, [r0] + ldr r0, =0x0203cd9e + 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, =0x0203cd9c + strh r2, [r0] + ldr r5, =0x0203cd9e + 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, =0x0203cd9c + 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, =0x0203cd9e + 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, =0x0203cd9c + 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, =0x0203cd9c + 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, =0x0203cd9c + 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, =0x0203cd9c + 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, =0x0203cd9c + 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, =0x0203cd9c + 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, =0x0203cd9c + 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, =0x0203cd9c + 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, =0x0203cd9c + 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, =0x0203cd9c + 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, =0x0203cd9c + 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, =0x0203cd9c + 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, =0x0203cd9c + strh r2, [r0] + ldr r0, =0x0203cd9e + 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, =0x0203cd9c + strh r2, [r0] + ldr r5, =0x0203cd9e + 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, =0x0203cd9c + 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, =0x0203cd9e + ldrb r0, [r7] + str r0, [sp, 0x8] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + ldr r2, =0x0203cd9c + 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, =0x0203cd9c + 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, =0x0203cd9c + 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, =0x0203cd9c + 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, =0x0203cd9c + 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, =0x0203cd9c + 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, =0x0203cd9c + 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, =0x0203cda0 + 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 gpu_pal_apply + ldr r0, =0x0203cda0 + 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, =0x0203cda0 + 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, =0x0203cda0 + 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, =0x0203cda0 + 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, =0x0203cda0 + 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, =0x0203cda0 + 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, =0x0203cd90 + 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, =0x0203cd90 + 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, =0x0203cd90 + 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, =0x0203cd90 + 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, =0x0203cd90 + 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, =0x0203cd90 + ldrb r0, [r0, 0x2] + bx lr + .pool + thumb_func_end GetMenuCursorPos + + thumb_func_start ProcessMenuInput +ProcessMenuInput: @ 819856C + push {r4,lr} + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08198598 + ldr r4, =0x0203cd90 + ldrb r0, [r4, 0xB] + cmp r0, 0 + bne _08198588 + movs r0, 0x5 + bl audio_play +_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 audio_play + movs r0, 0x1 + negs r0, r0 + b _081985CA +_081985BA: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081985CE + movs r0, 0x5 + bl audio_play + 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, =0x0203cd90 + ldrb r5, [r4, 0x2] + adds r6, r5, 0 + ldr r0, =0x030022c0 + 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 audio_play +_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 audio_play +_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, =0x030022c0 + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08198684 + ldr r4, =0x0203cd90 + ldrb r0, [r4, 0xB] + cmp r0, 0 + bne _08198674 + movs r0, 0x5 + bl audio_play +_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 audio_play + movs r0, 0x1 + negs r0, r0 + b _081986B4 +_081986A8: + cmp r1, 0x80 + bne _081986B8 + movs r0, 0x5 + bl audio_play + 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, =0x0203cd90 + ldrb r5, [r4, 0x2] + adds r6, r5, 0 + ldr r2, =0x030022c0 + 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 audio_play +_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 audio_play +_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, =0x0203cd9f + 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, =0x0203cd9f + 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, =0x0203cd90 + 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, =0x0203cd90 + 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, =0x0203cd90 + 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, =0x0203cd90 + 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, =0x0203cd90 + 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, =0x030022c0 + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081992AC + movs r0, 0x5 + bl audio_play + ldr r0, =0x0203cd90 + 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 audio_play + 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 audio_play + 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 audio_play + 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 audio_play + 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, =0x0203cd90 + ldrb r4, [r5, 0x2] + ldr r6, =0x030022c0 + ldrh r1, [r6, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0819935C + movs r0, 0x5 + bl audio_play + 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 audio_play +_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, =0x030022c0 + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08199400 + movs r0, 0x5 + bl audio_play + ldr r0, =0x0203cd90 + 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 audio_play + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + b _08199474 +_08199428: + cmp r1, 0x80 + bne _08199438 + movs r0, 0x5 + bl audio_play + 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 audio_play + 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 audio_play + 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, =0x0203cd90 + ldrb r4, [r6, 0x2] + ldr r5, =0x030022c0 + ldrh r1, [r5, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081994AC + movs r0, 0x5 + bl audio_play + 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 audio_play +_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, =0x0203cd90 + 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, =0x0203cd9f + 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, =0x0203cd90 + 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, =0x0203cd90 + 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, =0x0203cda4 + 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, =0x0203cda4 + 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, =0x0203cda4 + 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, =0x0203cda8 + ldr r1, =0x0203cdac + 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, =0x0203cda8 + ldrh r0, [r1] + cmp r0, 0 + beq _08199A7C + movs r4, 0 + ldrh r1, [r1] + cmp r4, r1 + bge _08199A76 + ldr r5, =0x0203cdac + movs r6, 0 +_08199A64: + ldr r0, [r5] + bl Free + stm r5!, {r6} + adds r4, 0x1 + ldr r0, =0x0203cda8 + ldrh r0, [r0] + cmp r4, r0 + blt _08199A64 +_08199A76: + ldr r1, =0x0203cda8 + 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, =0x0203cda8 + 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, =0x0203cdac + 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, =0x03005e00 + 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, =0x03005e00 + 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, =0x03005d90 + ldr r3, [r0] + ldrb r0, [r3] + ldr r6, =0x02021fc4 + 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 ExpandStringRefs + 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 gpu_pal_apply + 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 gpu_pal_apply + 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, =0x03005d90 + ldr r1, [r0] + adds r0, r5, 0 + bl CopyString + b _0819A43C + .pool +_0819A3A8: + bl sub_809D42C + 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 ConvertIntToDecimalString + adds r5, r0, 0 + movs r0, 0xFF + strb r0, [r5] + b _0819A43C +_0819A3D6: + ldr r4, =0x03005d90 + ldr r0, [r4] + ldrh r1, [r0, 0xE] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + 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 ConvertIntToDecimalString + b _0819A43C + .pool +_0819A404: + ldr r0, =0x02037318 + 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 IndexOfObjectPaletteTag + 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 GenerateRandomNumber + 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 StartObjectImageAnim + movs r0, 0x20 + strh r0, [r5, 0x2E] + b _0819A4C2 +_0819A4A6: + adds r0, r5, 0 + movs r1, 0x1 + bl StartObjectImageAnim + b _0819A4C2 +_0819A4B0: + adds r0, r5, 0 + movs r1, 0x1 + bl StartObjectImageAnimIfDifferent + b _0819A4C2 +_0819A4BA: + adds r0, r5, 0 + movs r1, 0 + bl StartObjectImageAnimIfDifferent +_0819A4C2: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_819A44C + + thumb_func_start sub_819A4C8 +sub_819A4C8: @ 819A4C8 + push {lr} + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + bl RunTasks + pop {r0} + bx r0 + thumb_func_end sub_819A4C8 + + thumb_func_start sub_819A4E4 +sub_819A4E4: @ 819A4E4 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_819A4E4 + + thumb_func_start sub_819A4F8 +sub_819A4F8: @ 819A4F8 + push {lr} + ldr r0, =0x0300127c + 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, =0x030022c0 + 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, =0x0203ce3c + 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, =0x0203ce2c + movs r4, 0x88 + lsls r4, 3 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + ldr r5, =0x0203ce30 + adds r0, r4, 0 + bl AllocZeroed + str r0, [r5] + ldr r5, =0x0203ce34 + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + ldr r5, =0x0203ce38 + 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, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _0819A8EE + .pool +_0819A69C: + bl sub_80A1A74 + bl ResetAllObjectData + bl ResetTasks + bl ResetObjectPaletteAllocator + ldr r0, =gUnknown_08DC0754 + ldr r5, =0x0203ce2c + ldr r1, [r5] + movs r2, 0x88 + lsls r2, 2 + bl CpuSet + ldr r0, =gUnknown_0861033C + ldr r4, =0x0203ce30 + 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, =0x0203ce34 + 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 gpu_pal_apply + ldr r4, =gUnknown_0861046C + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0x8 + bl gpu_pal_apply + adds r0, r4, 0 + movs r1, 0xE0 + movs r2, 0xA + bl gpu_pal_apply + ldr r0, =0x0300127c + ldr r1, [r0] + ldrb r0, [r1, 0x6] + cmp r0, 0x1 + bne _0819A738 + ldr r0, =0x02037714 + 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 gpu_pal_apply + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819A8EE + .pool +_0819A77C: + ldr r0, =0x0203ce38 + 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 LoadTaggedObjectPalettes + ldr r0, =gUnknown_086103BC + bl LoadObjectPics + 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 pal_fade_maybe + movs r1, 0x9A + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r0, =0x0300127c + 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, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _0819A8EE + .pool +_0819A868: + ldr r4, =0x0300127c + ldr r1, [r4] + ldrb r0, [r1, 0x6] + cmp r0, 0x1 + bne _0819A878 + ldr r0, =0x0203cf20 + 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, =0x030022c0 + 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, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _0819A8EE + .pool +_0819A8C4: + bl sub_819B9E8 + movs r0, 0x1 + bl PutWindowTilemap + ldr r1, =0x030022c0 + 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, =0x030022c0 + 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, =0x0300127c + 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, =0x03005e00 + 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, =0x03005e00 + 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, =0x0300127c + 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, =0x03005d90 + 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, =0x02020630 +_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 AddObjectToFront + ldr r6, =0x0300127c + 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, =0x02020630 + 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 AddObjectToFront + ldr r1, [r6] + movs r5, 0 + strb r0, [r1, 0x4] + ldr r0, =gUnknown_08610608 + movs r1, 0xB0 + movs r2, 0x70 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r6] + strb r0, [r1, 0x1] + ldr r0, =gUnknown_08610620 + movs r1, 0xB0 + movs r2, 0x90 + movs r3, 0 + bl AddObjectToFront + 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, =0x0300127c + 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, =0x02020630 + adds r0, r5 + bl RemoveObjectAndFreeTiles + 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 RemoveObjectAndFreeTiles + ldr r0, [r6] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + ldr r0, [r6] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + 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, =0x0300127c + 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, =0x0300127c + 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, =0x02020630 + 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, =0x0300127c + 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, =0x0300127c + 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, =0x02020630 + 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, =0x0300127c + 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, =0x0300127c + 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, =0x02020630 + 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, =0x0300127c + 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 IndexOfObjectPaletteTag + 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, =0x0300127c + ldr r1, [r0] + movs r0, 0x6C + muls r0, r2 + adds r1, r0 + movs r0, 0x1 + strb r0, [r1, 0x10] +_0819AD44: + ldr r2, =0x0300127c + 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 IndexOfObjectPaletteTag + 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, =0x02020630 + ldr r0, =0x0300127c + 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, =0x0300127c + 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 IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =0x02020630 + ldr r0, =0x0300127c + 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, =0x03005e00 + 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, =0x02037714 + ldr r0, =0x02037b14 + 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 pal_fade_maybe + movs r0, 0x7 + strh r0, [r6, 0x8] + b _0819AF50 + .pool +_0819AE64: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0819AF50 + ldr r4, =0x0300127c + 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, =0x0203ce2c + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ce30 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ce34 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ce38 + ldr r0, [r4] + bl Free + str r5, [r4] + bl FreeAllWindowBuffers + movs r0, 0x8 + strh r0, [r6, 0x8] + b _0819AF50 + .pool +_0819AEE8: + ldr r4, =0x0300127c + ldr r1, [r4] + ldr r0, =0x02037714 + 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, =0x0203ce3c + movs r0, 0x96 + lsls r0, 2 + bl AllocZeroed + str r0, [r4] + movs r4, 0 +_0819AF1A: + ldr r5, =0x0203ce3c + ldr r1, [r5] + movs r0, 0x64 + muls r0, r4 + adds r0, r1 + ldr r1, =0x0300127c + 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, =0x0300127c + ldr r0, [r7] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819B00E + ldr r1, =0x03005e00 + 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 pal_fade_maybe + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0819B00E +_0819AFB8: + bl fade_and_return_progress_probably + 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, =0x0203ce2c + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ce34 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ce38 + 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, =0x0300127c + ldr r0, [r7] + movs r1, 0xA8 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819B11A + ldr r1, =0x03005e00 + 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, =0x030022c0 + 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 audio_play + 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 audio_play +_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 audio_play + 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 audio_play + 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, =0x03005e00 + 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, =0x0300127c + 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, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r0, 0x9 + b _0819B36C + .pool +_0819B1BC: + ldr r4, =0x0300127c + 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, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + b _0819B344 + .pool +_0819B1EC: + ldr r2, =0x030022c0 + 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 audio_play + bl sub_819BC04 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x1 + bne _0819B228 + ldr r0, =0x0300127c + ldr r0, [r0] + ldr r2, =0x000002a2 + adds r0, r2 + b _0819B2AC + .pool +_0819B228: + cmp r0, 0x2 + bne _0819B248 + ldr r1, =0x03005e00 + 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, =0x03005e00 + 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, =0x03005e00 + 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 audio_play + ldr r4, =0x0300127c + 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, =0x03005e00 + 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 audio_play + 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 audio_play + movs r0, 0x1 + bl sub_819AC10 + b _0819B36E +_0819B300: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + bne _0819B36E + ldr r4, =0x0300127c + ldr r2, [r4] + ldrb r0, [r2, 0x6] + cmp r0, 0x1 + bne _0819B338 + ldr r1, =0x02037b14 + 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, =0x02037714 + 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, =0x03005e00 + 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, =0x0300127c + ldr r3, [r5] + movs r7, 0xA8 + lsls r7, 2 + adds r0, r3, r7 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819B476 + ldr r1, =0x03005e00 + 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, =0x02037fd4 + 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, =0x030022c0 + ldrh r0, [r2, 0x2E] + ands r1, r0 + cmp r1, 0 + beq _0819B40C + movs r0, 0x5 + bl audio_play + 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 audio_play + movs r0, 0x1 + negs r0, r0 + b _0819B432 +_0819B422: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0819B476 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 +_0819B432: + bl sub_819ABA8 + bl sub_819BCF8 + bl sub_819B9E8 + b _0819B476 +_0819B440: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0819B476 + movs r0, 0x5 + bl audio_play + 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, =0x03005d90 + 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, =0x0203bc8c + 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, =0x03005d90 + 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, =0x0300127c + 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, =0x0300127c + ldr r0, [r2] + adds r0, r4 + adds r0, 0x8 + ldr r1, =0x0203bc8c + 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, =0x0300127c +_0819B5B8: + ldr r0, [r3] + adds r0, r4 + adds r0, 0x8 + ldr r5, =0x0203bc8c + 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, =0x0300127c + ldr r0, [r1] + adds r0, r4 + adds r0, 0x8 + movs r1, 0x20 + add r2, sp, 0xC + bl pokemon_setattr + ldr r2, =0x0300127c + 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 pokemon_setattr + 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, =0x0203bc8c + ldr r0, =gSlateportBattleTentMons + str r0, [r2] + ldr r0, =0x03005d90 + 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, =0x03005d90 + 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, =0x0300127c + 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, =0x0203bc8c + 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, =0x0300127c + ldr r0, [r1] + adds r0, r4 + adds r0, 0x8 + ldr r3, =0x0203bc8c + 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, =0x0300127c + ldr r0, [r1] + adds r0, r4 + adds r0, 0x8 + movs r1, 0x20 + add r2, sp, 0xC + bl pokemon_setattr + ldr r2, =0x0300127c + ldr r0, [r2] + adds r0, r4 + adds r0, 0x8 + ldr r3, =0x0203bc8c + ldr r1, [r3] + adds r1, r5, r1 + ldrb r2, [r1, 0xA] + lsls r2, 1 + ldr r1, =gBattleFrontierHeldItems + adds r2, r1 + movs r1, 0xC + bl pokemon_setattr + 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, =0x0300127c + mov r10, r0 + ldr r1, =0x03005d90 + 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, =0x020244ec + 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 pokemon_getattr + 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, =0x0300127c + ldr r1, [r5] + ldrb r0, [r1, 0x6] + cmp r0, 0 + bne _0819B852 + strb r0, [r1] +_0819B852: + ldr r4, =0x02020630 + 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, =0x0300127c + ldr r1, [r5] + movs r0, 0 + strb r0, [r1, 0x7] + ldr r4, =0x02020630 + 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, =0x02020630 + ldr r3, =0x0300127c + 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, =0x0300127c + 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 pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + ldr r4, =0x02021fc4 + movs r1, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r4, 0 + bl CopyString + 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, =0x0300127c + 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, =0x0300127c + 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, =0x030062e8 + ldr r1, =gUnknown_0861041C + ldr r0, =0x0300127c + 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, =0x0300127c + 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, =0x0300127c + 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, =0x0300127c + 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, =0x0300127c + 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, =0x0300127c + 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 pokemon_getattr + 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, =0x0300127c + 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 pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + mov r8, r0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + 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, =0x02020630 + 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, =0x0300127c + 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 AddObjectToFront + ldr r6, =0x0300127c + 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, =0x02020630 + mov r8, r1 + add r0, r8 + movs r1, 0x2 + bl StartObjectRotScalAnim + 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 pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + mov r9, r0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + 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, =0x0300127c + 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 pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + adds r6, r0, 0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + 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, =0x02020630 + 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, =0x02020630 + 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, =0x0300127c + 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, =0x02020630 + ldr r6, =0x0300127c + 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, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r1, [r1] + bl _call_via_r1 + ldr r0, =DummyObjectCallback + 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, =0x02020630 + ldr r4, =0x0300127c + 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 rotscale_free_entry + 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 rotscale_free_entry + 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 rotscale_free_entry + 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 RemoveObjectAndFreeTiles + 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 RemoveObjectAndFreeTiles + adds r0, r5, 0 + bl RemoveObjectAndFreeTiles +_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, =0x03005e00 + 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, =0x03005e00 + 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, =0x02020630 + ldr r0, =0x0300127c + 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, =DummyObjectCallback + 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 StartObjectRotScalAnim + 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 StartObjectRotScalAnim + 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 StartObjectRotScalAnim + 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 AddObjectToFront + ldr r6, =0x0300127c + 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 AddObjectToFront + 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 AddObjectToFront + ldr r1, [r6] + ldr r4, =0x0000029d + adds r1, r4 + strb r0, [r1] + ldr r3, =0x02020630 + 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, =DummyObjectCallback + 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, =0x0300127c + 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, =0x03005e00 + 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, =0x0203bc8c + ldr r1, [r2] + lsrs r0, 12 + adds r0, r1 + ldrh r6, [r0] + ldr r0, =0x0300127c + 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, =0x03005e00 + 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, =0x0300127c + 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, =0x0300127c + 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 sub_80A2A20 + 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, =0x03005e00 + 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, =0x0300127c + 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 CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl RunTextPrinters + bl fade_and_return_progress_probably + bl RunTasks + pop {r0} + bx r0 + thumb_func_end sub_819C7E0 + + thumb_func_start sub_819C7FC +sub_819C7FC: @ 819C7FC + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + 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, =0x020244ec + ldr r5, =0x03001284 + ldr r1, [r5] + ldrb r0, [r1, 0x12] + movs r6, 0x64 + muls r0, r6 + adds r0, r4 + ldr r2, =0x02024744 + 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 pokemon_setattr + ldr r3, =0x03005d90 + 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 pokemon_getattr + 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, =0x03005e00 + 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 pal_fade_maybe + movs r0, 0x7 + strh r0, [r6, 0x8] + b _0819C9F0 +_0819C950: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0819C9F0 + ldr r4, =0x03001284 + 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, =0x0203ce40 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ce44 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ce48 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ce4c + 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, =0x03001284 + ldr r1, [r2] + movs r0, 0x1 + strb r0, [r1, 0x15] + ldr r2, [r2] + ldr r0, =0x02037714 + movs r1, 0xF4 + lsls r1, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2, 0x24] + ldr r1, =0x020244ec + 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, =0x03001284 + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819CAFE + ldr r1, =0x03005e00 + 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, =0x020375f0 + strh r1, [r0] + b _0819CAFE + .pool +_0819CA68: + movs r0, 0x2 + strh r0, [r4, 0x8] + ldr r1, =0x020375f0 + 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 pal_fade_maybe +_0819CA9C: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0819CAFE +_0819CAA4: + bl fade_and_return_progress_probably + 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, =0x0203ce40 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ce44 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ce48 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ce4c + 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, =0x03001284 + ldr r0, [r7] + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819CBD6 + ldr r1, =0x03005e00 + 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, =0x030022c0 + ldrh r1, [r2, 0x2E] + movs r6, 0x1 + adds r5, r6, 0 + ands r5, r1 + cmp r5, 0 + beq _0819CB86 + movs r0, 0x5 + bl audio_play + 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 audio_play + 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 audio_play + 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 audio_play + 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, =0x03005e00 + 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, =0x03005e00 + 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, =0x03001284 + 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, =0x03001284 + ldr r1, [r0] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F3F8 + ldr r1, =0x03005e00 + 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, =0x03005e00 + 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, =0x03001284 + 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, =0x03005e00 + 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, =0x03001284 + 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, =0x03001284 + 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, =0x03001284 + ldr r0, [r7] + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0819CE36 + ldr r2, =0x030022c0 + 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 audio_play + 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 audio_play + 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, =0x03005e00 + 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, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0819CF4C + ldr r0, =0x03001284 + ldr r0, [r0] + adds r0, 0x22 + movs r1, 0x1 + strb r1, [r0] + strh r1, [r4, 0x8] + b _0819CF4C + .pool +_0819CE88: + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2E] + adds r5, r1, 0 + ands r5, r0 + cmp r5, 0 + beq _0819CEBC + movs r0, 0x5 + bl audio_play + ldr r0, =0x03001284 + 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 audio_play + ldr r0, =0x03001284 + 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, =0x03005e00 + 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, =0x03001284 + 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, =0x03001284 + 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 sub_80A2A20 + 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, =0x03005e00 + 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, =0x03001284 + 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, =0x03005e00 + 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, =0x03001284 + ldr r0, [r0] + adds r0, 0x27 + strb r1, [r0] + strh r1, [r4, 0x10] + b _0819D0AE + .pool +_0819D0A4: + ldr r0, =0x020378f4 + movs r1, 0xE0 + movs r2, 0xA + bl gpu_pal_apply +_0819D0AE: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0819D118 + .pool +_0819D0BC: + ldr r2, =0x03001284 + 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, =0x02037714 + ldr r0, =0x02037b14 + 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 sub_80A2A20 +_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, =0x03005e00 + 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, =0x03005e00 + str r0, [sp, 0xC] +_0819D174: + lsls r0, r1, 24 + asrs r4, r0, 24 + mov r9, r0 + cmp r4, 0x2 + beq _0819D1F2 + ldr r2, =0x02020630 + ldr r3, =0x03001284 + 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, =0x03005e00 + 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, =0x02020630 + ldr r4, =0x03001284 + 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, =0x03005e00 + adds r1, 0x8 + adds r0, r1 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0x1 + bne _0819D26A + ldr r1, =0x03001284 + 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, =0x03001284 + 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 IndexOfObjectPaletteTag + 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 IndexOfObjectPaletteTag + ldr r2, =0x03001284 + 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, =0x03005e00 + 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, =0x02020630 + ldr r2, =0x03001284 + 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, =0x02020630 + ldr r6, =0x03001284 + 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, =0x02020630 +_0819D40E: + ldr r1, =0x03001284 + 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, =0x02020630 + ldr r0, =0x03001284 + 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, =0x02020630 + ldr r6, =0x03001284 + 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, =0x02020630 + ldr r0, =0x03001284 + 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, =0x03005e00 + 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 gpu_pal_apply + bl sub_819ED34 + movs r0, 0x5 + bl PutWindowTilemap + b _0819D622 + .pool +_0819D5F0: + movs r0, 0x3 + bl sub_819EA64 + ldr r0, =0x03005e00 + 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 pal_fade_maybe +_0819D622: + ldr r1, =0x03005e00 + 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, =0x02037fd4 + 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, =0x03001284 + 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, =0x03005e00 + 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, =0x03005e00 + 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, =0x03001284 + ldr r0, [r1] + adds r0, 0x30 + ldrb r0, [r0] + adds r3, r1, 0 + cmp r0, 0x1 + bne _0819D78C + b _0819D9D8 +_0819D78C: + ldr r0, =0x03005e00 + 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, =0x03005e00 + 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, =0x03005e00 + 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, =0x02037b14 + 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 pal_fade_maybe + b _0819D990 + .pool +_0819D910: + ldr r0, =0x02037fd4 + 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, =0x03001284 + 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, =0x03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x3] + cmp r0, 0x2 + bhi _0819D98C + ldr r2, =0x02020630 + 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, =0x03005e00 + 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, =0x03001284 + ldr r0, [r0] + adds r0, 0x22 + movs r1, 0x1 + strb r1, [r0] + ldr r1, =0x03005e00 + 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, =0x03001284 + ldr r0, [r0] + adds r0, 0x30 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0819DA00 + b _0819DBCA +_0819DA00: + ldr r0, =0x03005e00 + 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, =0x03005e00 + adds r1, r7, r6 + lsls r1, 3 + adds r1, r0 + b _0819DB96 + .pool +_0819DA58: + bl sub_819EADC + ldr r2, =0x02020630 + ldr r0, =0x03001284 + 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, =0x03005e00 + 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, =0x03005e00 + ldr r0, =0x03001284 + 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, =0x03005e00 + ldr r4, =0x03001284 + 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, =0x02020630 + 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, =0x02020630 + ldr r4, =0x03001284 + 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, =0x03005e00 + 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, =0x03001284 + 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, =0x03001284 + 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, =0x030022c0 + 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, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .pool +_0819DCD4: + ldr r5, =0x0203ce40 + movs r4, 0x88 + lsls r4, 3 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + ldr r5, =0x0203ce44 + adds r0, r4, 0 + bl AllocZeroed + str r0, [r5] + ldr r5, =0x0203ce48 + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + bl Alloc + str r0, [r5] + ldr r5, =0x0203ce4c + 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 sub_80A1A74 + bl ResetAllObjectData + bl ResetTasks + bl ResetObjectPaletteAllocator + bl dp13_810BB8C + ldr r0, =gUnknown_08DC0754 + ldr r5, =0x0203ce40 + ldr r1, [r5] + movs r2, 0x88 + lsls r2, 2 + bl CpuSet + ldr r0, =gUnknown_0861033C + ldr r4, =0x0203ce44 + 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, =0x0203ce48 + 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 gpu_pal_apply + ldr r4, =gUnknown_08610918 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0xA + bl gpu_pal_apply + adds r0, r4, 0 + movs r1, 0xE0 + movs r2, 0xA + bl gpu_pal_apply + ldr r0, =gUnknown_0861039C + movs r1, 0x20 + movs r2, 0x4 + bl gpu_pal_apply + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .pool +_0819DE68: + ldr r0, =0x0203ce4c + 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 LoadTaggedObjectPalettes + ldr r0, =gUnknown_08610650 + bl LoadObjectPics + ldr r0, =gUnknown_086106A0 + bl LoadCompressedObjectPic + ldr r0, =sub_819C7FC + bl SetVBlankCallback + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0819E00E + .pool +_0819DECC: + ldr r0, =0x03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x15] + cmp r0, 0x1 + bne _0819DEDC + ldr r0, =0x0203cf20 + 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, =0x03001284 + 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, =0x030022c0 + 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, =0x03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x15] + cmp r0, 0 + bne _0819DF4A + bl sub_819EB4C +_0819DF4A: + movs r0, 0x1 + bl PutWindowTilemap + ldr r1, =0x030022c0 + 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, =0x03001284 + 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, =0x030022c0 + 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 pal_fade_maybe + 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, =0x03001284 + 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, =0x030022c0 + 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, =0x03001284 + ldr r1, [r6] + adds r1, 0x21 + strb r0, [r1] + ldr r0, [r6] + ldrb r5, [r0, 0x15] + cmp r5, 0 + bne _0819E06C + ldr r4, =0x03005e00 + 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, =0x03005e00 + 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, =0x03001284 + movs r7, 0 + ldr r5, =0x02020630 +_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 AddObjectToFront + 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, =0x03001284 + 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, =0x02020630 + adds r0, r4 + movs r5, 0x20 + ldrsh r1, [r0, r5] + ldr r0, =gUnknown_0861084C + movs r2, 0x58 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + movs r4, 0 + strb r0, [r1, 0x4] + ldr r0, =gUnknown_08610864 + movs r1, 0xB0 + movs r2, 0x70 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + strb r0, [r1, 0x1] + ldr r0, =gUnknown_0861087C + movs r1, 0xB0 + movs r2, 0x90 + movs r3, 0 + bl AddObjectToFront + 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, =0x02020630 + 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 AddObjectToFront + 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 AddObjectToFront + 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 AddObjectToFront + 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 AddObjectToFront + 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 AddObjectToFront + 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 AddObjectToFront + 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 AddObjectToFront + 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 AddObjectToFront + 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 AddObjectToFront + 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 AddObjectToFront + ldr r1, [r7] + strb r0, [r1, 0x11] + movs r6, 0 + ldr r5, =0x02020630 + 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, =0x03001284 + mov r8, r3 + ldr r0, =0x02020630 + 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, =0x03001284 + ldr r0, [r6] + adds r0, 0x5 + adds r0, r5 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl RemoveObjectAndFreeTiles + 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 RemoveObjectAndFreeTiles + ldr r0, [r6] + ldrb r1, [r0, 0x1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r0, [r6] + ldrb r1, [r0, 0x2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + movs r5, 0 +_0819E590: + movs r4, 0 + lsls r6, r5, 1 +_0819E594: + ldr r0, =0x03001284 + 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, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + 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, =0x03001284 + 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, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + 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, =0x02020630 + ldr r5, =0x03001284 + 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, =0x02020630 + ldr r3, =0x03001284 + 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 audio_play + lsls r4, 24 + cmp r4, 0 + ble _0819E6C0 + ldr r1, =0x03001284 + 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, =0x03001284 + 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 audio_play + lsls r4, 24 + cmp r4, 0 + ble _0819E728 + ldr r0, =0x03001284 + 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, =0x03001284 + 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, =0x03001284 + 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, =0x03001284 + 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, =0x02020630 + 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 audio_play + lsls r4, 24 + cmp r4, 0 + ble _0819E7EC + ldr r0, =0x03001284 + 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, =0x03001284 + 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, =0x02020630 + 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, =0x02020630 + mov r12, r0 + ldr r7, =0x03001284 +_0819E856: + cmp r6, 0x2 + bne _0819E898 + ldr r5, =0x02020630 + ldr r3, =0x03001284 + 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, =0x02020630 + ldr r4, =0x03001284 + 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, =0x03001284 + 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, =0x02020630 + 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, =0x03001284 + ldr r1, [r5] + movs r0, 0 + strb r0, [r1, 0x16] + ldr r4, =0x02020630 + 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, =0x02020630 + ldr r3, =0x03001284 + 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, =0x03001284 + 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, =0x020244ec + b _0819EB8A + .pool +_0819EB84: + movs r0, 0x64 + muls r0, r2 + ldr r1, =0x02024744 +_0819EB8A: + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + ldr r4, =0x02021fc4 + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r4, 0 + bl CopyString + 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, =0x03001284 + 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, =0x03001284 + 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, =0x03001284 + 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, =0x03001284 + ldr r2, [r0] + ldrb r0, [r2, 0x15] + cmp r0, 0 + bne _0819EE3C + add r0, sp, 0xC + ldr r1, =0x02037b14 + 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 gpu_pal_apply + movs r0, 0x7 + bl PutWindowTilemap + movs r0, 0x7 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r0, =0x03001284 + 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, =0x020244ec + b _0819EE8E + .pool +_0819EE88: + movs r0, 0x64 + muls r0, r2 + ldr r1, =0x02024744 +_0819EE8E: + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + ldr r4, =0x02021fc4 + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r4, 0 + bl CopyString + 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 gpu_pal_apply + ldr r0, =0x020378f4 + ldr r1, =0x02037cd4 + movs r2, 0x5 + bl CpuSet + ldr r0, =0x03001284 + 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, =0x020244ec + b _0819EF46 + .pool +_0819EF40: + movs r0, 0x64 + muls r0, r2 + ldr r1, =0x02024744 +_0819EF46: + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + ldr r4, =0x02021fc4 + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r4, 0 + bl CopyString + 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, =0x03001284 + 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, =0x020244ec + b _0819EFF2 + .pool +_0819EFEC: + movs r0, 0x64 + muls r0, r5 + ldr r1, =0x02024744 +_0819EFF2: + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + 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, =0x03001284 + 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, =0x03001280 + ldr r2, =gUnknown_086108AC + ldr r1, =0x03001284 + 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, =0x03001284 + 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, =0x03005e00 + 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, =0x03005e00 + 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, =0x03001284 + ldr r1, [r0] + ldr r0, [r1, 0x2C] + adds r1, 0x30 + movs r2, 0x1 + bl sub_819F3F8 + movs r0, 0x3 + bl sub_819EA64 + ldr r1, =0x03005e00 + 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, =0x03001280 + ldr r1, =0x03001284 + 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, =0x03005e00 + 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, =0x03005e00 + 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, =0x03001284 + ldr r1, [r5] + ldrb r0, [r1, 0x14] + cmp r0, 0 + bne _0819F240 + ldr r3, =0x03005e00 + 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, =0x03005e00 + 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, =0x03005e00 + 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 AddObjectToFront + strb r0, [r4] + ldr r2, =0x02020630 + 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 AddObjectToFront + ldr r6, =0x03001284 + 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, =0x02020630 + mov r8, r1 + add r0, r8 + movs r1, 0x2 + bl StartObjectRotScalAnim + ldr r0, [r6] + ldrb r1, [r0, 0x3] + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + mov r9, r0 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + 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, =0x03005e00 + 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, =0x02020630 + 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 rotscale_free_entry + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + 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, =0x03001284 + ldr r0, [r1] + adds r0, 0x30 + ldrb r0, [r0] + adds r3, r1, 0 + cmp r0, 0x1 + beq _0819F58A + ldr r2, =0x03005e00 + 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, =0x03001284 + ldr r0, [r0] + adds r0, 0x20 + movs r1, 0 + strb r1, [r0] + b _0819F54E + .pool +_0819F4F8: + ldr r0, =0x030022c0 + 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 audio_play + ldr r0, =0x03001284 + 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, =0x03005e00 + 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, =0x03001284 + ldr r0, [r0] + adds r0, 0x22 + movs r1, 0x1 + strb r1, [r0] + ldr r1, =0x03005e00 + 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, =0x02024744 + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + movs r4, 0 +_0819F5B8: + ldr r0, =0x03001284 + ldr r0, [r0] + ldrb r0, [r0, 0x12] + cmp r4, r0 + beq _0819F5EC + movs r0, 0x64 + muls r0, r4 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + 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, =0x03005e00 + 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, =DummyObjectCallback + 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 rotscale_free_entry + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _0819F688 + ldr r0, =0x03001284 + 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 RemoveObjectAndFreeTiles +_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, =0x03005e00 + 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, =0x03005e00 + 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, =0x03005e00 + 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, =0x02020630 + 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 StartObjectRotScalAnim + 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, =0x03001284 + ldr r1, [r0] + ldrb r0, [r1, 0x14] + cmp r0, 0 + bne _0819F900 + ldrb r1, [r1, 0x3] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + b _0819F908 + .pool +_0819F900: + ldrb r1, [r1, 0x3] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x02024744 +_0819F908: + adds r6, r1, r0 + adds r0, r6, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r6, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + adds r5, r0, 0 + adds r0, r6, 0 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + 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, =0x03001284 + ldr r1, [r2] + adds r1, 0x2C + movs r3, 0 + strb r0, [r1] + ldr r4, =0x02020630 + 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, =0x03005d90 + 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, =0x02021cc4 + 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 CopyString_Limit7 + ldr r0, [r7] + adds r0, r4 + ldr r1, =0x0000011b + adds r0, r1 + ldrb r1, [r0] + mov r0, r8 + bl StopMusicWhileStringIsPrinted + ldr r0, =0x02021dc4 + ldr r1, [r7] + adds r1, r4 + adds r1, 0xDE + ldrb r1, [r1] + movs r2, 0x1 + adds r3, r6, 0 + bl ConvertIntToDecimalString + 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, =0x02021fc4 + bl ExpandStringRefs + 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, =0x03005d90 + 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, =0x03005d90 + 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, =gUnknown_82E9531 + 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, =0x03005d90 + 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, =0x03005d90 + ldr r0, [r2] + adds r0, 0xDE + ldrb r0, [r0] + cmp r0, 0 + bne _0819FC10 + adds r4, r2, 0 + ldr r5, =gUnknown_08611548 +_0819FBDA: + bl GenerateRandomNumber + 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 GenerateRandomNumber + 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, =0x03005d90 + 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 GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl GenerateRandomNumber + 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, =0x03005d90 + 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, =0x030062ec +_0819FD06: + bl GenerateRandomNumber + 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 GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r4, r0, 24 + bl GenerateRandomNumber + 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 GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r4, r0, 24 + bl GenerateRandomNumber + 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, =0x030062ec + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x030062ec + mov r9, r0 +_0819FED2: + bl GenerateRandomNumber + 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, =0x030062ec + 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, =0x03005d90 + 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, =0x030062ec + 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, =0x03005d90 + 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, =0x03005d90 +_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 GenerateRandomNumber + 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 GenerateRandomNumber + 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 GenerateRandomNumber + 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, =0x030062ec + 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, =0x030062ec + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 +_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, =0x03005d90 + 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, =0x03005d90 + 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, =0x030062f0 + 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, =0x030062f0 + 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, =0x03005e08 + 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 audio_play + ldr r1, =0x020375f0 + movs r0, 0x7F + strh r0, [r1] + b _081A0768 + .pool +_081A0764: + ldr r0, =0x020375f0 + 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, =0x03005e00 + 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, =0x03005e00 + 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, =0x020375e0 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x020375f0 + strh r1, [r0] + b _081A095A + .pool +_081A0954: + ldr r1, =0x020375f0 + 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, =0x020375e2 + 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, =0x03005d90 + 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, =0x020375f0 + ldr r0, =0x03005d90 + 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, =0x03005d90 + 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, =0x020375f0 + movs r0, 0 + strh r0, [r1] + b _081A0A1C + .pool +_081A09F4: + ldr r2, =0x020375f0 + 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, =0x020375e2 + 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, =0x020375e2 + 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, =0x020375e4 + ldrh r0, [r1] + cmp r0, 0x6 + bne _081A0A94 + ldr r1, =gUnknown_08610FF0 + ldr r0, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x02021fc4 + bl ExpandStringRefs + 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, =0x03005d90 + 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, =0x020375f0 + 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, =0x020375f0 + movs r0, 0x4 + b _081A0D34 + .pool +_081A0D18: + ldr r1, =0x020375f0 + movs r0, 0x3 + b _081A0D34 + .pool +_081A0D24: + ldr r1, =0x020375f0 + movs r0, 0x1 + b _081A0D34 + .pool +_081A0D30: + ldr r1, =0x020375f0 + 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, =0x020375e2 + ldrh r0, [r0] + cmp r0, 0 + beq _081A0D6E + ldr r4, =0x020375e4 + ldr r0, =0x03005d90 + 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, =0x03005d90 + 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, =0x020375e2 + 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, =0x03005d90 + ldr r0, [r1] + adds r0, 0xB8 + ldrb r0, [r0] + lsls r0, 30 + ldr r3, =0x030062f0 + 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, =0x020375e2 + ldrh r0, [r0] + cmp r0, 0x2 + bne _081A0E88 + ldr r0, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x030062f0 + 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, =0x020375e2 + 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, =0x02021cc4 + b _081A1032 + .pool +_081A1028: + ldr r5, =0x02021dc4 + b _081A1032 + .pool +_081A1030: + ldr r5, =0x02021ec4 +_081A1032: + ldr r0, =0x020375e4 + 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, =0x030062f0 + ldr r0, [r0] + ldrh r1, [r0] + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + b _081A1174 + .pool +_081A1094: + ldr r0, =0x030062f0 + 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, =0x030062f0 + ldr r0, [r0] + ldrh r1, [r0] + movs r0, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + b _081A1174 + .pool +_081A10C4: + ldr r0, =0x030062f0 + 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, =0x030062f0 + 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, =0x03005d90 + 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_get_item + adds r1, r0, 0 + b _081A1174 + .pool +_081A1118: + ldr r0, =0x03005d90 + 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 CopyString + b _081A11E6 + .pool +_081A1140: + ldr r0, =0x03005d90 + 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, =0x03005d90 + ldr r0, [r0] + movs r1, 0x82 + lsls r1, 1 + adds r0, r1 + bl ConvertBattleFrontierTrainerSpeechToString + ldr r1, =0x02021fc4 +_081A1174: + adds r0, r5, 0 + bl CopyString + b _081A11E6 + .pool +_081A1184: + ldr r0, =0x03005d90 + 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 CopyString +_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, =0x03005d90 + ldr r2, [r0] + ldr r0, =0x020375e2 + 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, =0x03005d90 + 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, =0x020375e2 + mov r12, r1 + ldr r1, =0x020375f0 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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 CopyString + ldr r1, [r5] + ldr r0, =gUnknown_82E9531 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x020375e0 + movs r0, 0x1 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_81A1638 + + thumb_func_start sub_81A1644 +sub_81A1644: @ 81A1644 + ldr r1, =0x020375e0 + 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, =0x030022c0 + 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, =0x030022c0 + 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, =0x030062f4 + ldr r1, =0x03005e00 + 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, =0x03005e00 + 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, =0x020375e0 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x020375e2 + 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, =0x020375f0 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r2, =0x00000ca8 + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1] + b _081A1956 + .pool +_081A18A8: + ldr r1, =0x020375f0 + ldr r0, =0x03005d90 + 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, =0x020375f0 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r2, =0x00000cb2 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + b _081A1956 + .pool +_081A18E4: + ldr r1, =0x020375f0 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 29 + b _081A1926 + .pool +_081A1900: + ldr r2, =0x020375f0 + ldr r1, =0x0202433a + ldrb r0, [r1] + strh r0, [r2] + movs r0, 0 + strb r0, [r1] + b _081A1956 + .pool +_081A1918: + ldr r1, =0x020375f0 + ldr r0, =0x03005d90 + 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, =0x020375f0 + ldr r0, =0x03005d90 + 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, =0x020375e2 + 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, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x020375e4 + ldrh r1, [r1] + ldr r2, =0x00000ca8 + adds r0, r2 + strb r1, [r0] + b _081A1AC4 + .pool +_081A19E0: + ldr r0, =0x03005d90 + ldr r2, [r0] + ldr r0, =0x020375e4 + 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, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x020375e4 + ldrh r1, [r1] + ldr r2, =0x00000cb2 + adds r0, r2 + strh r1, [r0] + b _081A1AC4 + .pool +_081A1A28: + ldr r0, =0x03005d90 + ldr r3, [r0] + ldr r0, =0x020375e4 + 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, =0x03005d90 + ldr r4, =0x00000caa + ldr r3, =0x0203cef8 +_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, =0x03005d90 + ldr r3, [r0] + ldr r0, =0x020375e4 + 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, =0x03005d90 + 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, =0x020375e2 + ldrh r0, [r4] + cmp r3, r0 + bge _081A1B00 + ldr r7, =0x0203cef8 + ldr r6, =0x03005d90 + 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 Reset + pop {r0} + bx r0 + thumb_func_end sub_81A1B1C + + thumb_func_start sub_81A1B28 +sub_81A1B28: @ 81A1B28 + ldr r1, =0x0203bc88 + 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, =0x03005d90 + 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, =0x03005d8c + 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, =0x020244ec + 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, =0x020375e4 + ldrh r1, [r0] + adds r2, r0, 0 + cmp r1, 0x3 + bls _081A1BA8 + movs r0, 0 + strh r0, [r2] +_081A1BA8: + ldr r0, =0x020375e2 + 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, =0x03005d90 + 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, =0x0203ab74 + 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, =0x0203ab74 + 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, =0x0203ab74 + 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, =0x02021cc4 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EE302 + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x0203ab74 + 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, =0x02021fc4 + ldr r1, =gUnknown_085EE158 + bl ExpandStringRefs + b _081A1F28 + .pool +_081A1EF0: + cmp r7, 0x1 + bne _081A1F08 + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085EE178 + bl ExpandStringRefs + b _081A1F28 + .pool +_081A1F08: + cmp r7, 0x2 + bne _081A1F20 + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085EE198 + bl ExpandStringRefs + b _081A1F28 + .pool +_081A1F20: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085EE1B7 + bl ExpandStringRefs +_081A1F28: + ldr r0, =0x02021fc4 + movs r1, 0x2 + bl sub_81A1C4C + ldr r6, =0x0203ab74 + 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, =0x03005d90 + 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, =0x0203ab74 + 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, =0x02021cc4 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + adds r0, r4, 0 + adds r1, r7, 0 + bl ExpandStringRefs + 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, =0x0203ab74 + 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, =0x02021fc4 + ldr r1, =gUnknown_085EE1DB + bl ExpandStringRefs + b _081A2184 + .pool +_081A217C: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085EE1FE + bl ExpandStringRefs +_081A2184: + ldr r0, =0x02021fc4 + movs r1, 0 + bl sub_81A1C4C + ldr r1, =0x0203ab74 + 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, =0x0203ab74 + 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, =0x03005d90 + 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, =0x0203ab74 + ldrb r0, [r1] + bl PutWindowTilemap + ldr r1, =0x0203ab74 + 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, =0x0203ab74 + 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, =0x02021cc4 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EE302 + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x0203ab74 + 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, =0x02021fc4 + ldr r1, =gUnknown_085EE221 + bl ExpandStringRefs + b _081A24B0 + .pool +_081A24A8: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085EE241 + bl ExpandStringRefs +_081A24B0: + ldr r0, =0x02021fc4 + movs r1, 0x2 + bl sub_81A1C4C + ldr r6, =0x0203ab74 + 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, =0x03005d90 + 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, =0x0203ab74 + 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, =0x02021cc4 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + adds r0, r4, 0 + adds r1, r7, 0 + bl ExpandStringRefs + 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, =0x0203ab74 + 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, =0x02021fc4 + ldr r1, =gUnknown_085EE261 + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x03005d90 + 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, =0x0203ab74 + 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, =0x02021cc4 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EE381 + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x0203ab74 + 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, =0x02021fc4 + ldr r1, =gUnknown_085EE27C + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x0203ab74 + 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, =0x02021cc4 + adds r0, r5, 0 + adds r1, r7, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EE302 + adds r0, r4, 0 + bl ExpandStringRefs + 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 ConvertIntToDecimalString + ldr r1, =gUnknown_085EE392 + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x0203ab74 + 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, =0x02021fc4 + ldr r1, =gUnknown_085EE298 + bl ExpandStringRefs + b _081A2CE0 + .pool +_081A2CD8: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085EE2B8 + bl ExpandStringRefs +_081A2CE0: + ldr r0, =0x02021fc4 + movs r1, 0 + bl sub_81A1C4C + ldr r0, =0x0203ab74 + 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, =0x0203ab74 + 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, =0x02021cc4 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EE39C + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x0203ab74 + 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, =0x02021fc4 + ldr r1, =gUnknown_085EE2D8 + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x0203ab74 + 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, =0x02021fc4 + mov r9, r0 + ldr r1, =gUnknown_085EDF86 + bl ExpandStringRefs + 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, =0x03005d90 + 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 ConvertIntToDecimalString + ldr r6, =0x0203ab74 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x02024474 + adds r6, 0x25 + ldrb r0, [r6] + movs r4, 0x1 + eors r0, r4 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r5, =0x020229f0 + adds r1, r5 + mov r0, sp + bl CopyString + mov r0, sp + bl StripExtendedControlCodes + lsls r1, r7, 3 + ldr r0, =0x00000ee1 + adds r1, r0 + mov r2, r9 + ldr r0, [r2] + adds r0, r1 + mov r1, sp + bl CopyString + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x020375f0 + 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, =0x03005d90 + 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, =0x0203bc88 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x0203bc88 + 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, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _081A387C + ldr r1, =0x03005d90 + movs r0, 0xEC + muls r0, r3 + ldr r1, [r1] + adds r0, r1 + ldr r1, =0xfffef2c4 + b _081A38C4 + .pool +_081A37EC: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 17 + ands r0, r1 + cmp r0, 0 + bne _081A387C + ldr r1, =0x03005d90 + 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, =0x03005d90 + 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, =0x0203bc88 + 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, =0x02022fec + 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, =0x03005d90 + movs r0, 0xEC + muls r0, r3 + ldr r1, [r1] + adds r0, r1 + ldr r1, =0xfffef2d0 + b _081A38C4 + .pool +_081A38A8: + ldr r0, =0x02022fec + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, =0x00000d0c + b _081A3AB4 + .pool +_081A3A54: + ldr r0, =0x03005d90 + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, =0x00000dc8 + b _081A3AB4 + .pool +_081A3A6C: + ldr r0, =0x03005d90 + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000dda + b _081A3AB4 + .pool +_081A3A80: + ldr r0, =0x03005d90 + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, =0x00000de2 + b _081A3AB4 + .pool +_081A3A98: + ldr r0, =0x03005d90 + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000e04 + b _081A3AB4 + .pool +_081A3AAC: + ldr r0, =0x03005d90 + 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, =0x03005d90 + 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, =0x02038bca + ldrh r1, [r0] + ldr r0, =0x000003fe + cmp r1, r0 + bne _081A3B20 + ldr r1, =0x020375f0 + movs r0, 0x1 + b _081A3B24 + .pool +_081A3B20: + ldr r1, =0x020375f0 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r6, 2 + adds r1, r2 + ldr r2, =0x00000dc8 + b _081A3C68 + .pool +_081A3C18: + ldr r0, =0x03005d90 + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000dda + b _081A3C68 + .pool +_081A3C2C: + ldr r0, =0x03005d90 + ldr r0, [r0] + lsls r1, r4, 1 + lsls r2, r6, 2 + adds r1, r2 + ldr r2, =0x00000de2 + b _081A3C68 + .pool +_081A3C44: + ldr r0, =0x03005d90 + 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, =0x03005d90 + 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, =0x02038bca + mov r9, r0 + ldrh r0, [r0] + ldr r1, =0x000003fe + mov r8, r1 + cmp r0, r8 + bne _081A3CA6 + adds r5, 0xA +_081A3CA6: + ldr r6, =0x03005d90 + ldr r1, [r6] + ldr r4, =0x00000eb8 + adds r1, r4 + ldrh r0, [r1] + adds r0, r5 + strh r0, [r1] + ldr r0, =0x02021cc4 + adds r1, r5, 0 + movs r2, 0 + movs r3, 0x2 + bl ConvertIntToDecimalString + 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, =0x020375f0 + 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, =0x02022fec + ldr r1, =0x020375e2 + ldrh r1, [r1] + ldr r2, [r0] + ands r2, r1 + cmp r2, 0 + beq _081A3DC4 + ldr r1, =0x020375f0 + movs r0, 0x1 + strh r0, [r1] + b _081A3DC8 + .pool +_081A3DC4: + ldr r0, =0x020375f0 + 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, =0x02021cc4 + ldr r1, =gUnknown_085CCB79 + bl AppendString + b _081A3EC8 + .pool +_081A3E50: + cmp r5, r4 + ble _081A3EC8 + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085CCB7F + bl AppendString + b _081A3EC8 + .pool +_081A3E68: + cmp r4, r5 + bne _081A3E80 + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085CCB79 + bl AppendString + b _081A3E88 + .pool +_081A3E80: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085CCB7F + bl AppendString +_081A3E88: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085CCB86 + bl AppendString + b _081A3EC8 + .pool +_081A3EA0: + cmp r4, r5 + bne _081A3EB8 + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085CCB79 + bl AppendString + b _081A3EC0 + .pool +_081A3EB8: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085CCB7F + bl AppendString +_081A3EC0: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085CCB84 + bl AppendString +_081A3EC8: + ldr r0, =0x02021cc4 + movs r1, 0xB + muls r1, r6 + ldr r2, =gSpeciesNames + adds r1, r2 + bl AppendString +_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, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + 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, =0x020375f0 + 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, =0x020375f0 + 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, =0x02021cc4 + movs r0, 0xFF + strb r0, [r1] + ldr r1, =0x020375e0 + 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, =0x02021cc4 + ldr r1, =gUnknown_085CCB82 + adds r0, r4, 0 + bl AppendString + ldr r1, =gUnknown_085CCB88 + adds r0, r4, 0 + bl AppendString + b _081A4202 + .pool +_081A41A4: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _081A41C0 + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085CCB84 + bl AppendString + b _081A41C8 + .pool +_081A41C0: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085CCB82 + bl AppendString +_081A41C8: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085CCB8C + bl AppendString + b _081A4202 + .pool +_081A41E0: + ldr r1, =0x020375e0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x03005d90 + ldr r2, [r0] + ldr r0, =0x020375f0 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000dda + adds r0, r2 + b _081A4386 + .pool +_081A434C: + ldr r0, =0x03005d90 + 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, =0x03005d90 + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00000e04 + adds r0, r2 + b _081A4386 + .pool +_081A437C: + ldr r0, =0x03005d90 + 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, =0x03005d8c + movs r5, 0x64 +_081A43B2: + ldr r0, =0x03005d90 + 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 pokemon_getattr + mov r1, sp + strh r0, [r1] + adds r0, r4, 0 + muls r0, r5 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xC + mov r2, sp + bl pokemon_setattr +_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, =0x020375f0 + bl sub_8185338 + strh r0, [r4] + ldr r0, =0x03005d90 + 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, =0x020375e2 + ldrh r0, [r0] + cmp r0, 0 + beq _081A4450 + cmp r0, 0x1 + beq _081A4464 + b _081A446E + .pool +_081A4450: + ldr r0, =0x02021cc4 + ldr r1, =0x02038bca + ldrh r1, [r1] + bl sub_8162E20 + b _081A446E + .pool +_081A4464: + ldr r0, =0x02021dc4 + ldr r1, =0x02038bca + 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, =0x03005d90 + 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, =0x020244ec + 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, =0x03005d90 + 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, =0x03005d8c + ldr r0, [r2] + adds r0, r1 + adds r1, r5, 0 + adds r1, 0xD + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + adds r0, r7, 0 + mov r1, r8 + movs r2, 0 + bl pokemon_getattr + 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, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x03005d90 + 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, =0x020244ec + 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, =0x0203ab74 + 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, =0x0203ab74 + 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, =0x02021dc4 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldr r5, =0x02021fc4 + 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 ExpandStringRefs + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xC8 + bl GetStringRightAlignXOffset + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r1, =0x0203ab74 + 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, =0x0203ab74 + 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, =0x0203ab74 + 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 CopyString +_081A473C: + ldr r2, =0x0203ab74 + 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, =0x02021dc4 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldr r5, =0x02021fc4 + ldr r0, =gUnknown_08611D08 + ldr r4, [r0, 0x24] + adds r0, r5, 0 + adds r1, r4, 0 + bl ExpandStringRefs + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x02021cc4 + ldr r4, =gUnknown_08611CB0 + lsls r5, r7, 3 + adds r1, r5, r4 + ldr r1, [r1] + bl CopyString + ldr r6, =0x02021fc4 + adds r4, 0x4 + adds r5, r4 + ldr r1, [r5] + adds r0, r6, 0 + bl ExpandStringRefs + ldr r0, =0x0203ab74 + 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, =0x03005d90 + 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, =0x0203ab74 + 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, =0x020375e2 + 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, =0x0203ab74 + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, =0x020375e2 + 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, =0x03005d90 +_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, =0x03005d90 + 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, =0x020244ec + 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, =0x020244e9 + ldrb r5, [r4] + bl copy_player_party_from_sav1 + bl sub_8076D5C + movs r0, 0x1 + bl save_game_when_memory_present + bl sav2_gender2_inplace_and_xFE + strb r5, [r4] + adds r4, r7, 0 + ldr r5, =0x020244ec + 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, =0x02022fec + 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, =0x02022fec + 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, =0x02022fec + 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 GenerateRandomNumber + adds r4, r0, 0 + bl GenerateRandomNumber + 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, =0x02024744 + 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 pokemon_setattr + movs r7, 0 + mov r6, r8 + ldr r3, =0x02024744 +_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 pokemon_setattr + 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, =0x02024744 + 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, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + add r2, sp, 0x10 + bl pokemon_setattr + 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, =0x02038bca + 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, =0x02022fec + 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, =0x02021fc4 + ldr r2, =gUnknown_08611DB0 + lsls r1, 2 + adds r1, r2 + ldr r2, [r1] + lsls r1, r4, 2 + adds r1, r2 + ldr r1, [r1] + bl CopyString + b _081A5228 + .pool +_081A5214: + ldr r0, =0x02021fc4 + ldr r2, =gUnknown_08611DB8 + lsls r1, 2 + adds r1, r2 + ldr r2, [r1] + lsls r1, r4, 2 + adds r1, r2 + ldr r1, [r1] + bl CopyString +_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, =0x020375e0 + 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 pal_fade_maybe + 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 decompress_palette + ldr r1, =0x02022e24 + movs r0, 0xFF + strh r0, [r1] + ldr r1, =0x02022e26 + movs r0, 0x70 + strh r0, [r1] + b _081A553E + .pool +_081A52F4: + ldr r0, =0x02037fd4 + 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, =0x02022f58 + movs r2, 0xA1 + strb r2, [r1] + movs r0, 0xFF + strb r0, [r1, 0x1] + ldr r1, =0x02022f68 + strb r2, [r1] + movs r0, 0x1 + negs r0, r0 + strb r0, [r1, 0x1] + ldr r0, =gUnknown_085CCDB2 + bl get_battle_strings_ + ldr r4, =0x02022e2c + 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 AddObjectToFront + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0x3 + bl StartObjectImageAnim + 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 audio_play + 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 audio_play + 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 audio_play + 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, =0x02022e2c + 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 audio_play + ldr r0, =0x02022f58 + ldr r1, =0x02022f68 + ldrb r2, [r0] + ldrb r0, [r1] + cmp r2, r0 + bls _081A54BC + movs r6, 0x2 + ldr r1, =0x02024474 + movs r0, 0 + strb r0, [r1, 0x17] + b _081A553E + .pool +_081A54BC: + cmp r2, r0 + bcs _081A54D0 + movs r6, 0x3 + ldr r1, =0x02024474 + 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, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + ldr r0, =0x7fffff1c + movs r1, 0 + str r1, [sp] + movs r1, 0x4 + movs r2, 0x8 + movs r3, 0 + bl pal_fade_maybe + b _081A553E + .pool +_081A5520: + ldr r0, =0x02037fd4 + 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 FreeObjectTilesByTag +_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, =0x0202449c + 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, =0x02024084 + 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, =0x02022f68 + b _081A562A + .pool +_081A5628: + ldr r1, =0x02022f58 +_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, =0x02022f68 + b _081A564E + .pool +_081A564C: + ldr r1, =0x02022f58 +_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 AddObjectToFront + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + adds r1, r4, 0 + bl StartObjectImageAnim + 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, =0x02024332 + ldrb r0, [r0] + cmp r0, 0x8 + bls _081A56AA + adds r0, r1, 0 + bl RemoveObjectAndFreeTiles +_081A56AA: + pop {r0} + bx r0 + .pool + thumb_func_end sub_81A5698 + + thumb_func_start sub_81A56B4 +sub_81A56B4: @ 81A56B4 + ldr r0, =0x0202449c + 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, =0x02024084 + 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, =0x0202449c + ldr r1, [r1] + movs r2, 0xA6 + lsls r2, 2 + adds r1, r2 + adds r1, r0 + ldr r2, =gBattleArenaMoveMindRatings + ldr r0, =0x020241ea + 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, =0x0202449c + ldr r2, [r0] + ldr r0, =0x0000029a + adds r5, r2, r0 + ldr r0, =0x02024280 + 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, =gUnknown_0832A328 + 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, =0x0202427c + 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, =0x02024332 + 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, =0x0202433c + 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, =0x0202449c + 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, =0x0202449c + ldr r3, [r1] + movs r1, 0xA7 + lsls r1, 2 + adds r3, r1 + lsls r2, r0, 1 + adds r2, r3 + ldr r5, =0x02024084 + 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, =0x03005d90 + 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, =0x03005d8c + 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, =0x02038bca + 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, =0x03005d90 + ldr r3, [r0] + ldr r1, =0x00000ca9 + adds r0, r3, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r1, r0, 30 + ldr r0, =0x020375e2 + 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, =0x020375f0 + ldr r2, =0x00000dd8 + adds r1, r3, r2 + ldrh r1, [r1] + strh r1, [r0] + b _081A59EE + .pool +_081A59B0: + ldr r2, =0x020375f0 + 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, =0x020375f0 + ldr r1, =0x00000cdc + adds r0, r3, r1 + ldr r0, [r0] + movs r1, 0x80 + b _081A59EA + .pool +_081A59E0: + ldr r2, =0x020375f0 + 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, =0x03005d90 + ldr r2, [r0] + ldr r1, =0x00000ca9 + adds r0, r2, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r1, r0, 30 + ldr r0, =0x020375e2 + 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, =0x020375e4 + 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, =0x020375e4 + ldrh r1, [r1] + strh r1, [r0] + b _081A5ABA + .pool +_081A5A60: + cmp r1, 0 + beq _081A5A90 + ldr r0, =0x020375e4 + 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, =0x020375e4 + 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, =0x03005d90 + ldr r0, [r4] + ldr r1, =0x020375e2 + 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, =0x03005d90 + 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 GenerateRandomNumber + 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 GenerateRandomNumber + 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, =0x03005d90 + ldr r0, [r4] + ldr r1, =0x00000dd8 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl bag_add_item + 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, =0x02021cc4 + bl itemid_get_name + ldr r0, [r4] + ldr r1, =0x00000dd8 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x020375f0 + strh r5, [r0] + b _081A5BD6 + .pool +_081A5BD0: + ldr r1, =0x020375f0 + 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, =0x02021cc4 + ldr r1, =0x02038bca + 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, =0x020375e0 + 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, =0x03005d90 + 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, =0x03001288 + movs r0, 0 + strb r0, [r1] + movs r2, 0 + ldr r6, =0x03005d8c + 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, =0x03006298 + 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, =0x02038bca + 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, =0x03005d90 + 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, =0x020375e2 + 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, =0x020375f0 + ldr r0, [r7] + lsls r1, r6, 1 + lsls r2, r5, 2 + adds r1, r2 + ldr r2, =0x00000de2 + b _081A603C + .pool +_081A6000: + ldr r4, =0x020375f0 + 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, =0x020375f0 + 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, =0x03005d90 + 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, =0x020375e2 + 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, =0x020375e4 + ldrh r0, [r0] + strh r0, [r2] + b _081A6128 + .pool +_081A60B4: + ldr r0, =0x020375e4 + 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, =0x03001288 + 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, =0x020375e4 + 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, =0x03005d90 + ldr r0, [r4] + ldr r1, =0x020375e2 + 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, =0x03001288 + 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, =0x03005d90 + 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, =0x0203bc88 + 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, =0x03005d90 + 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, =0x03005d90 + ldrh r0, [r0] + cmp r7, r0 + bne _081A61FA + ldr r0, =0x02038bca + 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, =0x0203bc8c + ldr r2, [r4] + lsls r1, r0, 4 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, 0xC9 + beq _081A636E + movs r3, 0 + ldr r6, =0x03005d90 + 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, =0x0203bc8c + 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, =0x0203bc8c + 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, =0x0203bc8c + 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, =0x03006298 + 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, =0x02038bca + 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, =0x03005d90 + 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, =0x0203bc8c + ldr r0, =gBattleFrontierMons + b _081A6400 + .pool +_081A63FC: + ldr r1, =0x0203bc8c + ldr r0, =gSlateportBattleTentMons +_081A6400: + str r0, [r1] + movs r7, 0 + ldr r2, =0x03005d90 + 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, =0x03006298 + 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, =0x02024744 + 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 pokemon_getattr + 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, =0x0203bc8c + 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 pokemon_setattr + 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, =0x03005d90 + 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, =0x0203bc8c + ldr r0, =gSlateportBattleTentMons + str r0, [r1] + movs r2, 0x1E + str r2, [sp, 0x14] + b _081A6518 + .pool +_081A6500: + ldr r1, =0x0203bc8c + 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, =0x020375e2 + 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, =0x0203bc8c + mov r9, r2 +_081A6534: + ldr r4, =0x03005d90 + 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, =0x020244ec + 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, =0x020244ec +_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 pokemon_setattr + 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, =0x020244ec + 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, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + ldr r2, [sp, 0x1C] + bl pokemon_setattr + 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 pokemon_setattr + mov r2, r10 + add r2, r8 + lsls r2, 2 + ldr r5, =0x03005d90 + ldr r0, [r5] + adds r2, r0 + ldr r0, =0x00000e79 + adds r2, r0 + adds r0, r4, 0 + movs r1, 0x2E + bl pokemon_setattr + ldr r1, [sp, 0x18] + mov r8, r1 + cmp r1, 0x2 + bgt _081A666C + b _081A6534 +_081A666C: + ldr r0, =0x020375e2 + ldrh r0, [r0] + cmp r0, 0 + beq _081A667A + cmp r0, 0x2 + beq _081A667A + b _081A67AE +_081A667A: + movs r2, 0 + mov r8, r2 + ldr r4, =0x0203bc8c + mov r9, r4 +_081A6682: + ldr r5, =0x03005d90 + 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, =0x02024744 + 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, =0x02024744 +_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 pokemon_setattr + 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, =0x02024744 + 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, =0x02024744 + 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 pokemon_setattr + mov r2, r10 + add r2, r8 + lsls r2, 2 + ldr r1, =0x03005d90 + ldr r0, [r1] + adds r2, r0 + ldr r5, =0x00000e9d + adds r2, r5 + adds r0, r4, 0 + movs r1, 0x2E + bl pokemon_setattr + 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, =0x0203bc88 + 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, =0x03005d90 + 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, =0x0203bc8c + 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, =0x0203bc8c + 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, =0x0203bc8c + 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, =0x03005d90 + 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, =0x0203bc8c + 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, =0x0203bc8c + ldr r0, =gBattleFrontierMons + str r0, [r1] + movs r4, 0 + add r5, sp, 0x14 + ldr r7, =0x020375f0 + 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, =0x03006298 + mov r8, r0 + ldr r0, =0x0203bc8c + 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, =0x0203bc8c + 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, =0x03006298 + lsls r0, r4, 1 + adds r0, r1 + ldrh r6, [r0] + movs r5, 0 +_081A6B18: + ldr r0, =0x0203bc8c + 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, =0x020375f0 + 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, =0x02037318 + 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, =0x03005d90 + 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, =0x0203bc8c + ldr r0, =gBattleFrontierMons + b _081A6C4C + .pool +_081A6C48: + ldr r1, =0x0203bc8c + ldr r0, =gSlateportBattleTentMons +_081A6C4C: + str r0, [r1] + movs r4, 0 +_081A6C50: + movs r0, 0x64 + muls r0, r4 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x03005d90 + 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, =0x0203bc8c + 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 pokemon_setattr + 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, =0x03005d90 + 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, =0x0203bc8c + 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, =0x03005d90 + 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, =0x0203bc8c + 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, =0x0203bc8c + 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, =0x0203bc8c + 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, =0x0203bc8c + 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, =0x02024744 + 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, =0x0203bc8c + 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, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x20 + mov r2, r10 + bl pokemon_setattr + ldr r2, =0x0203bc8c + 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 pokemon_setattr + 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 GenerateRandomNumber + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x02038bca + 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, =0x020375e0 + 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, =0x0300128c + 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, =0x0300128c + 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, =0x0300128d + 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, =0x03005d90 + ldr r0, [r1] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r2, r0, 30 + ldr r0, =0x020375e2 + 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, =0x020375f0 + ldr r1, [r3] + ldr r3, =0x00000e02 + adds r1, r3 + ldrh r1, [r1] + strh r1, [r0] + b _081A723A + .pool +_081A71A0: + ldr r2, =0x020375f0 + 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, =0x020375f0 + 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, =0x020375f0 + 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, =0x020375f0 + ldr r0, [r3] + ldr r1, =0x00000cdc + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 4 + b _081A7236 + .pool +_081A7228: + ldr r2, =0x020375f0 + 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, =0x03005d90 + ldr r0, [r1] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r3, r0, 30 + ldr r0, =0x020375e2 + 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, =0x020375e4 + ldrh r1, [r1] + ldr r5, =0x00000e02 + adds r0, r5 + strh r1, [r0] + b _081A73AA + .pool +_081A72AC: + ldr r0, =0x020375e4 + 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, =0x020375e4 + 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, =0x020375e4 + 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, =0x020375e4 + 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, =0x020375e4 + 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, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0xE + bls _081A73DC + ldr r1, =0x020375f0 + movs r0, 0x1 + b _081A73E0 + .pool +_081A73DC: + ldr r1, =0x020375f0 + 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, =0x020375f0 + ldr r1, =0x0300128c + ldrb r1, [r1] + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_81A73EC + + thumb_func_start sub_81A7400 +sub_81A7400: @ 81A7400 + ldr r1, =0x0300128e + movs r0, 0x1 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_81A7400 + + thumb_func_start sub_81A740C +sub_81A740C: @ 81A740C + ldr r1, =0x0300128e + 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, =0x03005d90 + ldr r0, [r4] + ldr r1, =0x020375e2 + 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 save_game_when_memory_present + 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, =0x03001290 + 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, =0x020375f0 + movs r0, 0 + b _081A74C0 + .pool +_081A7498: + ldr r1, =0x020375f0 + movs r0, 0x1 + b _081A74C0 + .pool +_081A74A4: + ldr r1, =0x020375f0 + movs r0, 0x2 + b _081A74C0 + .pool +_081A74B0: + ldr r1, =0x020375f0 + movs r0, 0x3 + b _081A74C0 + .pool +_081A74BC: + ldr r1, =0x020375f0 + 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, =0x020375f0 + ldr r1, =0x0300128d + 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 GenerateRandomNumber + 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, =0x020375f0 + 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, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0x4 + bhi _081A7538 + ldr r1, =gUnknown_0861231C + ldr r0, =0x03001294 + 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, =0x03001294 + ldrb r0, [r0] + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x3] + b _081A7560 + .pool +_081A7554: + ldr r1, =gUnknown_0861231C + ldr r0, =0x03001294 + 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 pokemon_getattr + 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 pokemon_setattr + adds r0, r5, 0 + movs r1, 0x15 + bl pokemon_getattr + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 +_081A75DA: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r5, 0 + bl pokemon_getattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r6, r0, 24 + bl GenerateRandomNumber + 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, =0x03005d90 + 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, =0x03001290 +_081A77AE: + movs r4, 0 + mov r9, r4 + bl GenerateRandomNumber + 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, =0x03001290 + 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, =0x020244ec + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x37 + bl pokemon_getattr + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + bne _081A7860 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + 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 pokemon_getattr + 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, =0x03001290 + 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, =0x0300128d + movs r0, 0x1 + b _081A78D4 + .pool +_081A78A4: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r1, r0, 16 + movs r2, 0x1 + ands r1, r2 + cmp r1, 0 + beq _081A78C0 + ldr r0, =0x0300128d + strb r2, [r0] + b _081A78D6 + .pool +_081A78C0: + ldr r0, =0x0300128d + strb r1, [r0] + b _081A78D6 + .pool +_081A78CC: + movs r0, 0 + b _081A7956 +_081A78D0: + ldr r1, =0x0300128d + 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, =0x020244ec + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x37 + bl pokemon_getattr + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + bne _081A7946 + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + 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 pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + ldr r7, =0x03001290 + 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 pokemon_setattr +_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, =0x03005d90 + 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, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + bne _081A79D4 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + 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, =0x03005d90 + 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, =0x020375e6 + 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, =0x03005d90 + 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 GenerateRandomNumber + 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, =0x03001294 + bl GenerateRandomNumber + 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, =0x0300128e + 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, =0x03005d90 + 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, =0x02024744 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + 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, =0x02024744 + 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 pokemon_setattr + 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 GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 +_081A7CA8: + str r0, [sp] + ldr r0, =0x02024744 + movs r1, 0x2E + mov r2, sp + bl pokemon_setattr + 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, =0x02024744 + bl sub_80691F4 + adds r4, 0x1 + cmp r4, 0x3 + ble _081A7CBA + ldr r0, =0x02024744 + 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, =0x03005d90 + 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, =0x03005e00 + 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 sub_80A2A20 +_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 sub_80A2A20 +_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, =0x03005e00 + 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, =0x03005e00 + 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 GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + bl GenerateRandomNumber + 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, =0x020244ec + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r7, 0 + movs r1, 0x3A + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + str r4, [sp, 0x8] + cmp r5, r6 + bcc _081A8044 + adds r0, r7, 0 + movs r1, 0x37 + bl pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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, =0x020244ec + 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, =0x020375f0 + 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, =0x02037318 + 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, =0x020375f0 + 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 GenerateRandomNumber + ldr r5, =0x03005d90 + 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 GenerateRandomNumber + ldr r7, =0x03005d90 + 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 GenerateRandomNumber + ldr r7, =0x03005d90 + 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, =0x03005d90 + 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, =0x020375f0 + ldr r0, =0x03005d90 + 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, =0x020375f0 + ldr r1, =gUnknown_0861266C + ldr r0, =0x03005d90 + 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, =0x03005d90 + 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, =0x02038bca + strh r4, [r5] + ldr r1, =0x0203bc88 + ldr r0, =gBattleFrontierTrainers + str r0, [r1] + ldrh r0, [r5] + movs r1, 0 + bl sub_8162614 + ldr r0, =0x03005d90 + 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, =0x03005d90 + 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, =0x0203bc88 + 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, =0x02038bca + strh r4, [r5] + ldrh r0, [r5] + movs r1, 0 + bl sub_8162614 + ldr r3, =0x03005d90 + 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, =0x03005d90 + 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, =0x02038bcc + strh r4, [r5] + ldrh r0, [r5] + movs r1, 0x1 + bl sub_8162614 + ldr r0, =0x03005d90 + 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, =0x03005d90 + 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, =0x020375e2 + ldrh r0, [r0] + cmp r0, 0 + bne _081A8524 + ldr r3, =0x02038bca + ldrh r1, [r3] + ldr r0, =0x0000012b + cmp r1, r0 + bhi _081A8542 + ldr r2, =0x0203bc88 + 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, =0x02038bcc + ldrh r1, [r3] + ldr r0, =0x0000012b + cmp r1, r0 + bhi _081A8542 + ldr r2, =0x0203bc88 + 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, =0x020244ec + movs r6, 0 + movs r4, 0 +_081A855C: + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + 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, =0x03005d90 + 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, =0x020375f0 + 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, =0x020375e6 + ldr r0, =0x03005d90 + 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, =0x020375f0 + 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, =0x03005d90 + ldr r2, [r0] + ldr r0, =0x020375e2 + 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, =0x020375f0 + 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, =0x020244ec + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r7, 0 + movs r1, 0x3A + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + cmp r4, r5 + bcc _081A8762 + adds r0, r7, 0 + movs r1, 0x37 + bl pokemon_getattr + bl pokemon_ailments_get_primary + lsls r0, 24 + cmp r0, 0 + bne _081A8762 + adds r0, r7, 0 + movs r1, 0x15 + bl pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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, =0x020375f0 + 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, =0x03005d8c + ldr r6, =0x03005d90 +_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 pokemon_getattr + 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, =0x03005d90 + 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, =0x02024488 + adds r0, r1 + ldr r1, =0x00000e12 + adds r3, r1 + adds r2, r3 + movs r1, 0xC + bl pokemon_setattr + 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, =0x03005d90 + 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, =0x02038bca + strh r4, [r0] + ldr r1, =0x0202433a + 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, =0x020244ec + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + 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 pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bls _081A8904 + subs r0, 0x5 + cmp r5, r0 + bgt _081A8904 + bl GenerateRandomNumber + 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, =0x0203ce50 + 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, =0x0203ce50 + 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, =0x02037350 + 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, =0x03005d8c + 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, =0x0203ce50 + 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, =0x03005d8c + 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, =0x0203ce50 + 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, =0x03005d8c + 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, =0x0203ce50 + 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, =0x03005d8c + 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, =0x02037350 + 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, =0x03005d8c + 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, =0x03005d8c + 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, =0x0203ce50 + 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, =0x03005d8c + 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, =0x0203ce50 + 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, =0x020375e0 + 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, =0x03005d90 + 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, =0x02038bca + movs r1, 0 + strh r1, [r0] + ldr r0, =0x0202433a + 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, =0x03005d90 + ldr r0, [r1] + ldr r2, =0x00000ca9 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 30 + lsrs r4, r0, 30 + ldr r0, =0x020375e2 + 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, =0x020375f0 + ldr r1, [r3] + ldr r3, =0x00000e18 + b _081A8FFE + .pool +_081A8F9C: + ldr r2, =0x020375f0 + 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, =0x020375f0 + ldr r0, [r3] + ldr r1, =0x00000cdc + adds r0, r1 + b _081A9030 + .pool +_081A8FCC: + ldr r2, =0x020375f0 + ldr r0, [r3] + ldr r3, =0x00000cdc + adds r0, r3 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + b _081A9036 + .pool +_081A8FE4: + ldr r0, =0x020375f0 + ldr r1, [r3] + ldr r2, =0x00000e1a + adds r1, r2 + b _081A9000 + .pool +_081A8FF8: + ldr r0, =0x020375f0 + ldr r1, [r3] + ldr r3, =0x00000e1c +_081A8FFE: + adds r1, r3 +_081A9000: + ldrh r1, [r1] + strh r1, [r0] + b _081A903A + .pool +_081A9010: + ldr r2, =0x020375f0 + ldr r0, [r3] + ldr r1, =0x00000cdc + adds r0, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + b _081A9036 + .pool +_081A9028: + ldr r2, =0x020375f0 + 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, =0x03005d90 + ldr r2, [r0] + ldr r1, =0x00000ca9 + adds r0, r2, r1 + ldrb r0, [r0] + lsls r0, 30 + lsrs r1, r0, 30 + ldr r0, =0x020375e2 + 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, =0x020375e4 + 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, =0x020375e4 + ldrh r1, [r1] + strh r1, [r0] + b _081A9126 + .pool +_081A90B0: + cmp r1, 0 + beq _081A90E4 + ldr r0, =0x020375e4 + 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, =0x020375e4 + 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, =0x020375e4 + 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, =0x03005d90 + ldr r0, [r4] + ldr r1, =0x020375e2 + 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 save_game_when_memory_present + 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, =0x03005d90 + 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 GenerateRandomNumber + 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 GenerateRandomNumber + 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, =0x03005d90 + ldr r0, [r4] + ldr r1, =0x00000e18 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl bag_add_item + 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, =0x02021cc4 + bl itemid_get_name + ldr r0, [r4] + ldr r1, =0x00000e18 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x020375f0 + strh r5, [r0] + b _081A924A + .pool +_081A9244: + ldr r1, =0x020375f0 + 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, =0x03005d90 +_081A925A: + bl GenerateRandomNumber + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x020375f2 + 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 GenerateRandomNumber2 + 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, =0x020375d8 + ldr r4, =0x020375da + 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, =0x03005d8c + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r3, r0, r1 + movs r2, 0 + ldr r4, =0x020375f2 + 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, =0x0203bc88 + 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, =0x03005d8c + ldr r0, [r0] + movs r1, 0xC7 + lsls r1, 4 + adds r1, r0 + mov r8, r1 + ldr r2, =0x02037350 + ldr r0, =0x03005df0 + 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, =0x0203bc88 + 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, =0x0203bc88 + 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, =0x02037350 + ldr r0, =0x03005df0 + 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, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000e2a + adds r0, r1 + ldrb r2, [r0] + ldr r1, =gUnknown_0832A328 + 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, =0x03005d90 + 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, =0x020375f0 + 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, =0x020375e4 + ldrh r0, [r0] + cmp r0, 0 + beq _081A9698 + cmp r0, 0x1 + beq _081A96B4 + b _081A9754 + .pool +_081A9698: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x020375e2 + ldrh r1, [r1] + ldr r2, =0x00000e68 + adds r0, r2 + strb r1, [r0] + b _081A9754 + .pool +_081A96B4: + ldr r4, =0x020375f0 + ldrh r0, [r4] + cmp r0, 0x1 + beq _081A9710 + cmp r0, 0x1 + bgt _081A9754 + cmp r0, 0 + bne _081A9754 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081A9754 + ldr r0, =0x03005d90 + 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, =0x020375e6 + ldrh r0, [r0] + bl audio_play +_081A96FC: + ldr r1, =0x020375f0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _081A9754 + .pool +_081A9710: + ldr r1, =0x020375e2 + ldrh r0, [r1] + cmp r0, 0 + beq _081A9750 + subs r0, 0x1 + strh r0, [r1] + ldr r3, =0x03005d90 + 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, =0x020244ec + mov r8, r1 +_081A9776: + movs r4, 0 + adds r7, r5, 0x1 + mov r6, r9 + muls r6, r5 +_081A977E: + ldr r0, =0x03005d90 + 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 pokemon_setattr +_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, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081A980C + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 5 + ldr r1, =gUnknown_08D856C8 + adds r0, r1 + ldr r1, =0x020377d4 + 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, =0x03005d90 + 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, =0x03005d8c + ldr r0, [r2] + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + ldr r3, =0x020244ec + ldr r1, [sp, 0x10] + adds r0, r1, r3 + movs r1, 0xB + movs r2, 0 + str r3, [sp, 0x14] + bl pokemon_getattr + 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, =0x03005d8c + ldr r0, [r1] + add r0, r9 + adds r1, r5, 0 + adds r1, 0xD + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + adds r1, r6, 0 + adds r1, 0xD + mov r2, r10 + adds r0, r7, r2 + movs r2, 0 + bl pokemon_getattr + 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, =0x03005d8c + ldr r0, [r1] + ldr r2, [sp, 0x8] + adds r0, r2 + movs r5, 0x8E + lsls r5, 2 + adds r0, r5 + ldr r1, =0x020244ec + ldr r2, [sp, 0x10] + adds r1, r2, r1 + movs r2, 0x64 + bl memcpy + ldr r0, =0x0203cef8 + 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, =0x03005d90 + ldr r3, =0x00000caa + ldr r2, =0x0203cef8 +_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, =0x03005dc0 + 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, =0x02037350 + 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, =0x03005df0 + 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, =0x03005d90 + 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, =0x03005d90 + ldr r2, [r1] + ldr r1, =0x00000e2a + adds r2, r1 + ldr r4, =gUnknown_0832A328 + ldr r3, =0x02037350 + 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, =0x02038bca + ldrh r0, [r0] + bl sub_81A9B44 + ldr r0, =0x02022fec + 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, =0x03005df0 + strb r0, [r1] + ldr r0, =0x02038bcc + 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, =0x02037350 + mov r12, r0 + ldr r6, =0x03005df0 + ldr r1, =0x03005d8c + mov r10, r1 + ldr r7, =0x03005d90 + mov r9, r7 + ldr r0, =0x00000cb4 + mov r8, r0 + ldr r4, =gUnknown_0832A328 +_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, =0x020375f2 + 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, =0x03005d90 + 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, =0x02024744 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + 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 pokemon_setattr + 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 pokemon_setattr + 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 GenerateRandomNumber + 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 GenerateRandomNumber + 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, =0x02024744 + 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 pokemon_setattr + 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, =0x02024744 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + movs r1, 0x1 + ands r1, r0 + str r1, [sp, 0xC] + add r2, sp, 0xC +_081A9D7C: + adds r0, r4, 0 + movs r1, 0x2E + bl pokemon_setattr + b _081A9D9C + .pool +_081A9D90: + str r0, [sp, 0xC] + ldr r0, =0x02024744 + add r2, sp, 0xC + movs r1, 0x2E + bl pokemon_setattr +_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, =0x02024744 + 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, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000e1a + adds r0, r1 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0x8B + bls _081A9E0C + bl GenerateRandomNumber + 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, =0x02024744 + add r2, sp, 0x10 + bl pokemon_setattr + ldr r0, [sp, 0xC] + adds r0, 0x1 + str r0, [sp, 0xC] + cmp r0, 0x5 + ble _081A9DF6 +_081A9E0C: + ldr r0, =0x02024744 + 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, =0x02037318 + 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, =0x02037318 + 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, =0x03005d90 + 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 Reset +_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, =0x0203bc88 + 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, =0x0203bc88 + 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, =0x0203bc88 + 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, =0x0203bc88 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005dc0 + 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, =0x03005d8c + 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, =0x03005d90 + 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, =0x03005d8c + 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, =0x03005d8c + 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, =0x03005d90 + 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, =0x03005d90 + 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, =gUnknown_0832A328 + mov r12, r0 + ldr r6, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d8c + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d8c + 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, =0x03005d90 + 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 sub_80D7204 + movs r0, 0x22 + movs r1, 0x1 + bl sub_80D7204 + 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, =0x03005d90 + 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 GenerateRandomNumber + 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, =0x0203ce58 + 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, =0x020375e2 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x020375f0 + 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, =0x020375f0 + 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, =0x020375f0 + 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, =0x0203ce54 + 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, =0x0203ce58 + 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 CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl do_scheduled_bg_tilemap_copies_to_vram + bl fade_and_return_progress_probably + 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 LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + 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, =0x030022c0 + 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, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAE50: + bl ResetObjectPaletteAllocator + b _081AB012 +_081AAE56: + bl sub_80A1A74 + ldr r2, =0x02037fd4 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAE78: + bl ResetAllObjectData + 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, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAEA4: + bl bag_menu_init_bgs + ldr r0, =0x0203ce54 + ldr r0, [r0] + ldr r1, =0x00000834 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r1, =0x030022c0 + 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, =0x030022c0 + 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, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAF0C: + ldr r0, =0x0203ce58 + ldrb r0, [r0, 0x5] + bl load_bag_item_list_buffers + b _081AB012 + .pool +_081AAF1C: + ldr r1, =gUnknown_085E91FC + ldr r4, =0x0203ce58 + 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, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _081AB01A + .pool +_081AAF54: + ldr r4, =0x0203ce58 + ldrb r0, [r4, 0x4] + bl sub_81AB1F0 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =0x03006310 + 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, =0x03005e00 + 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, =0x0203ce58 + ldrb r0, [r0, 0x5] + bl AddBagVisualObject + ldr r1, =0x030022c0 + 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, =0x030022c0 + 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 sub_80A2A20 + ldr r1, =0x030022c0 + 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 pal_fade_maybe + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] +_081AB012: + ldr r1, =0x030022c0 + 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, =0x0203ce54 + 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, =0x0203ce54 + 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, =0x0203ce54 + 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, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + beq _081AB164 + ldr r0, =gUnknown_08D9A5D4 + movs r1, 0 + movs r2, 0x40 + bl decompress_palette + b _081AB1AE + .pool +_081AB164: + ldr r0, =gUnknown_08D9A588 + movs r1, 0 + movs r2, 0x40 + bl decompress_palette + b _081AB1AE + .pool +_081AB174: + bl IsWallysBag + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AB18A + ldr r0, =0x03005d90 + 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, =0x0203ce54 + 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, =0x0203ce74 + movs r0, 0x82 + lsls r0, 2 + bl Alloc + str r0, [r4] + ldr r4, =0x0203ce78 + 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, =0x02039dd8 + adds r1, r0 + mov r8, r1 + ldr r0, =0x0203ce54 + 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, =0x0203ce78 +_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, =0x0203ce74 + 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, =0x0203ce54 + 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, =0x0203ce78 + lsls r4, r6, 1 + adds r4, r6 + lsls r4, 3 + ldr r0, [r5] + adds r0, r4 + ldr r1, =gUnknown_085E8DB4 + bl CopyString + ldr r0, =0x0203ce74 + 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, =0x0203ce78 +_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, =0x0203ce74 + 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, =0x0203ce54 + ldr r0, [r0] + ldr r3, =0x00000829 + adds r0, r3 + adds r0, r7 + ldrb r0, [r0] + cmp r6, r0 + bcc _081AB30C +_081AB34A: + ldr r2, =0x03006310 + 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, =0x0203ce54 + ldr r1, [r0] + ldr r4, =0x00000829 + adds r0, r1, r4 + adds r0, r7 + ldrb r0, [r0] + strh r0, [r2, 0xC] + ldr r0, =0x0203ce74 + 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, =0x0203ce58 + ldrb r0, [r0, 0x5] + cmp r0, 0x2 + beq _081AB3C0 + cmp r0, 0x3 + beq _081AB420 + adds r0, r5, 0 + adds r1, r6, 0 + bl itemid_get_name + b _081AB43E + .pool +_081AB3C0: + ldr r4, =0x02021dc4 + 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 CopyString + movs r0, 0xA9 + lsls r0, 1 + cmp r5, r0 + bls _081AB408 + ldr r0, =0x02021cc4 + ldr r2, =0xfffffeae + adds r1, r5, r2 + movs r2, 0x2 + movs r3, 0x1 + bl ConvertIntToDecimalString + ldr r1, =gUnknown_085E921A + b _081AB438 + .pool +_081AB408: + ldr r0, =0x02021cc4 + ldr r2, =0xfffffee0 + adds r1, r5, r2 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + b _081AB436 + .pool +_081AB420: + ldr r0, =0x02021cc4 + adds r1, r5, 0 + subs r1, 0x84 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r1, =0x02021dc4 + adds r0, r5, 0 + bl itemid_get_name +_081AB436: + ldr r1, =gUnknown_085E9210 +_081AB438: + adds r0, r6, 0 + bl ExpandStringRefs +_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 audio_play + bl ShakeBagVisual +_081AB466: + ldr r4, =0x0203ce54 + 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, =0x0203ce58 + ldrb r0, [r0, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r6, 16 + lsrs r1, 16 + bl bag_pocket_get_itemid + 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, =0x0203ce54 + 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, =0x0203ce54 + 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, =0x0203ce58 + ldrb r0, [r5, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 16 + lsrs r4, 16 + adds r1, r4, 0 + bl bag_pocket_get_itemid + 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 bag_pocket_get_item_quantity + 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, =0x02021cc4 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E8DA0 + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x02021cc4 + mov r1, r9 + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E8DA0 + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x03005d8c + 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, =0x0203ce58 + ldrb r0, [r0, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + bl bag_pocket_get_itemid + lsls r0, 16 + lsrs r0, 16 + bl itemid_get_description + adds r4, r0, 0 + b _081AB6FC + .pool +_081AB6E0: + ldr r0, =0x02021cc4 + ldr r2, =gUnknown_085E9180 + ldr r1, =0x0203ce58 + ldrb r1, [r1, 0x4] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl CopyString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E91C0 + adds r0, r4, 0 + bl ExpandStringRefs +_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, =0x0203ce54 + ldr r4, [r5] + ldr r1, =0x0000081e + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _081AB80A + ldr r2, =0x0203ce58 + 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, =0x0203ce54 + 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, =0x0203ce54 + 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, =0x0203ce5e + 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, =0x0203ce54 + 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, =0x0203ce78 + ldr r0, [r0] + bl Free + ldr r0, =0x0203ce74 + ldr r0, [r0] + bl Free + bl FreeAllWindowBuffers + ldr r0, =0x0203ce54 + 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 pal_fade_maybe + ldr r1, =0x03005e00 + 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, =0x03005e08 + adds r2, r0, r1 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081AB9A0 + ldrb r0, [r2] + ldr r4, =0x0203ce58 + 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, =0x0203ce54 + 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 ResetAllObjectData + bl ResetObjectPaletteAllocator + 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, =0x02039dd8 + 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, =0x0203ce54 + 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, =0x0203ce6a + adds r4, r1, r2 + subs r2, 0xA + adds r1, r2 + ldr r2, =0x0203ce54 + 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, =0x0203ce6a + adds r7, r6, 0 + subs r7, 0xA +_081ABAEC: + lsls r1, r5, 1 + adds r0, r1, r6 + adds r1, r7 + ldr r2, =0x0203ce54 + 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, =0x0203ce58 + 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, =0x03005e08 + 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, =0x03005e08 + adds r5, r0 + ldr r7, =0x0203ce58 + 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_remove_item_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, =0x03006310 + 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, =0x0203ce58 + ldrb r0, [r0, 0x5] + movs r3, 0x2 + cmp r0, 0x3 + bne _081ABC6C + movs r3, 0x3 +_081ABC6C: + ldr r0, =0x02021cc4 + lsls r1, 16 + asrs r1, 16 + movs r2, 0x2 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E8DA0 + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x0203ce58 + ldrb r0, [r0, 0x5] + movs r3, 0x2 + cmp r0, 0x3 + bne _081ABCD4 + movs r3, 0x3 +_081ABCD4: + ldr r0, =0x02021cc4 + movs r2, 0x2 + bl ConvertIntToDecimalString + ldr r6, =0x02021fc4 + ldr r1, =gUnknown_085E8DA0 + adds r0, r6, 0 + bl ExpandStringRefs + 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, =0x03005e08 + adds r6, r0, r1 + ldr r5, =0x0203ce58 + 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, =0x02037fd4 + 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, =0x030022c0 + 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, =0x0203ce54 + ldr r0, [r0] + ldr r1, =0x0203ce58 + 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 audio_play + 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 audio_play + b _081ABEB2 +_081ABE40: + movs r0, 0x5 + bl audio_play + ldr r0, =0x0203ce7c + mov r1, r10 + strh r1, [r0] + ldr r0, =0x03005e08 + 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 audio_play + 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 bag_pocket_get_item_quantity + strh r0, [r6, 0x4] + ldrb r0, [r5, 0x5] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl bag_pocket_get_itemid + ldr r1, =0x0203ce7c + 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, =0x03005e00 + 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, =0x0203ce54 + 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, =0x030022c0 + 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 audio_play + 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 audio_play + 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, =0x03005e08 + 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, =0x0203ce58 + 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, =0x02020630 + ldr r0, =0x0203ce54 + 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, =0x0203ce58 + 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, =0x0203ce58 + 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, =0x03005e00 + 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, =0x03005e08 + 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, =0x0203ce5d + 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, =0x0203ce5d + 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, =0x0203ce5d + 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, =0x03006310 + 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, =0x0203ce58 + 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, =0x03005e08 + mov r9, r0 + adds r6, r4, r0 + ldrb r0, [r6] + movs r1, 0x10 + movs r2, 0x1 + bl sub_81AF15C + ldr r3, =0x0203ce58 + 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, =0x0203ce54 + 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 bag_pocket_get_itemid + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x02021cc4 + bl itemid_get_name + ldr r0, =0x02021fc4 + mov r8, r0 + ldr r1, =gUnknown_085E8DFE + bl ExpandStringRefs + 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, =0x03005e08 + adds r4, r0, r1 + bl sub_81221EC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081AC48E + ldr r0, =0x030022c0 + mov r8, r0 + ldrh r1, [r0, 0x2E] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _081AC418 + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + ldr r3, =0x0203ce58 + 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, =0x0203ce58 + 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 audio_play + 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 audio_play + 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, =0x03005e08 + add r0, r10 + mov r9, r0 + ldr r5, =0x0203ce58 + ldrb r6, [r5, 0x5] + lsls r1, r6, 1 + adds r0, r5, 0 + adds r0, 0x12 + adds r0, r1 + mov r8, r0 + ldr r2, =0x0203ce60 + 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, =0x02039dd8 + lsls r0, r6, 3 + adds r0, r1 + ldr r0, [r0] + adds r1, r2, 0 + adds r2, r4, 0 + bl sub_80D702C + ldr r0, =0x0203ce54 + 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, =0x0203ce60 + 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, =0x03006310 + 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, =0x03005e08 + 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, =0x03005e08 + mov r10, r0 + mov r7, r9 + add r7, r10 + ldr r4, =0x0203ce58 + 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, =0x0203ce54 + 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, =0x03006310 + 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, =0x0203ce58 + 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, =0x0203ce7c + ldrh r0, [r0] + bl itemid_get_usage + lsls r0, 24 + cmp r0, 0 + beq _081AC6C4 + ldr r0, =0x0203ce54 + 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, =0x0203ce54 + 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, =0x0203ce54 + 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, =0x0203ce7c + 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, =0x0203ce54 + 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, =0x0203ce54 + 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, =0x0203ce7c + 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, =0x0203ce54 + 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, =0x0203ce54 + 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, =0x0203ce7c + 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, =0x0203ce54 + 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, =0x0203ce54 + 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, =0x0203ce58 + ldrb r0, [r0, 0x5] + cmp r0, 0x4 + beq _081AC856 + ldr r0, =0x0203ce7c + ldrh r0, [r0] + bl sub_8122148 + lsls r0, 24 + cmp r0, 0 + bne _081AC880 +_081AC856: + ldr r0, =0x0203ce54 + 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, =0x0203ce54 + 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, =0x0203ce58 + 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, =0x0203ce54 + 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, =0x0203ce7c + 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, =0x0203ce54 + 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, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00000496 + adds r0, r1 + ldr r2, =0x0203ce7c + 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, =0x0203ce54 + 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, =0x0203ce54 + 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, =0x0203ce54 + 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, =0x0203ce58 + ldrb r0, [r0, 0x5] + cmp r0, 0x2 + bne _081ACA50 + movs r0, 0x1 + bl ClearWindowTilemap + ldr r0, =0x0203ce7c + 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, =0x0203ce7c + ldrh r0, [r0] + ldr r1, =0x02021cc4 + bl itemid_get_name + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E8DBE + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x0203ce54 + 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, =0x0203ce54 + 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, =0x0203ce54 + 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, =0x0203ce54 + ldr r0, [r0] + ldr r1, =0x00000828 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + bhi _081ACBE8 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =Task_HandleInBattleItemMenuInput + b _081ACBF4 + .pool +_081ACBE8: + ldr r0, =0x03005e00 + 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 audio_play + ldr r0, =gUnknown_08613FB4 + ldr r1, [r0, 0x24] + adds r0, r5, 0 + bl _call_via_r1 + b _081ACC6A + .pool +_081ACC44: + movs r0, 0x5 + bl audio_play + ldr r1, =gUnknown_08613FB4 + ldr r0, =0x0203ce54 + 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, =0x030022c0 + 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 audio_play + 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, =0x0203ce54 + 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 audio_play + 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 audio_play + 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 audio_play + 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 audio_play + ldr r2, =gUnknown_08613FB4 + ldr r0, =0x0203ce54 + 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 audio_play + 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, =0x0203ce54 + 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, =0x0203ce54 + 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, =0x0203ce7c + ldrh r0, [r5] + bl itemid_get_overworld_function + 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_get_type + 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, =0x0203ce58 + ldrb r0, [r0, 0x5] + cmp r0, 0x3 + beq _081ACEE8 + ldr r0, =0x0203ce7c + ldrh r0, [r0] + bl itemid_get_overworld_function + 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, =0x03005e08 + 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, =0x0203ce7c + ldrh r0, [r0] + ldr r1, =0x02021cc4 + bl itemid_get_name + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E8EE0 + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x03005e08 + adds r4, r0 + ldr r0, =0x0203ce7c + ldrh r0, [r0] + ldr r1, =0x02021cc4 + bl itemid_get_name + ldr r0, =0x02021dc4 + movs r2, 0x10 + ldrsh r1, [r4, r2] + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E8F0E + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x03005e08 + 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, =0x03005e08 + 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, =0x0203ce54 + 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, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AD0AC + movs r0, 0x5 + bl audio_play + 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 audio_play + 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, =0x03005e08 + adds r6, r4, r5 + ldr r0, =0x0203ce7c + ldrh r0, [r0] + ldr r1, =0x02021cc4 + bl itemid_get_name + ldr r0, =0x02021dc4 + movs r2, 0x10 + ldrsh r1, [r6, r2] + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r6, =0x02021fc4 + ldr r1, =gUnknown_085E8EF9 + adds r0, r6, 0 + bl ExpandStringRefs + 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, =0x03005e08 + adds r5, r0, r1 + ldr r4, =0x0203ce58 + 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, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081AD1CE + movs r0, 0x5 + bl audio_play + ldr r0, =0x0203ce7c + ldrh r0, [r0] + ldrh r1, [r5, 0x10] + bl remove_item + 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, =0x03006310 + 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, =0x03005e08 + adds r7, r0, r1 + ldr r0, =0x0203ce58 + 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, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00000496 + adds r1, r0, r2 + ldr r0, =0x0203ce7c + 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, =0x0203ce58 + ldrb r0, [r0, 0x5] + bl load_bag_item_list_buffers + ldr r0, =0x03006310 + 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, =0x0203ce7c + 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, =0x0203ce54 + 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, =0x0203ce7c + ldrh r0, [r0] + ldr r1, =0x02021cc4 + bl itemid_get_name + ldr r5, =0x02021fc4 + ldr r1, =gUnknown_085E8E11 + adds r0, r5, 0 + bl ExpandStringRefs + 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, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AD36E + movs r0, 0x5 + bl audio_play + 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, =0x0203ce54 + 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, =0x03005e08 + 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, =0x0203ce7c + ldrh r0, [r4] + bl itemid_get_battle_function + cmp r0, 0 + beq _081AD400 + bl bag_menu_remove_some_window + ldrh r0, [r4] + bl itemid_get_battle_function + 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, =0x0203ce7c + 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, =0x02021cc4 + bl itemid_get_name + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E8E27 + adds r0, r4, 0 + bl ExpandStringRefs + ldr r3, =sub_81AD350 + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl DisplayItemMessage + b _081AD4AE + .pool +_081AD488: + ldr r0, =0x0203ce58 + 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, =0x0203ce7c + 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, =0x0203ce58 + 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, =0x03005e00 + 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, =0x03005d8c + ldr r0, [r4] + ldr r5, =0x00000496 + adds r1, r0, r5 + ldrh r0, [r1] + cmp r0, 0 + beq _081AD5CA + movs r1, 0x1 + bl sub_80D6724 + 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, =0x0203ce7c + ldr r0, [r4] + adds r0, r5 + ldrh r1, [r0] + strh r1, [r2] + ldrh r0, [r0] + bl itemid_get_overworld_function + movs r1, 0x8 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + 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, =0x03005e08 + adds r4, r0, r1 + ldr r6, =0x0203ce7c + ldrh r0, [r6] + bl itemid_get_market_price + lsls r0, 16 + cmp r0, 0 + bne _081AD634 + ldrh r0, [r6] + ldr r1, =0x02021dc4 + bl itemid_get_name + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E960F + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x02021dc4 + bl itemid_get_name + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E962F + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x03005e08 + adds r4, r0 + ldr r6, =0x02021cc4 + ldr r0, =0x0203ce7c + 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 ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E9654 + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x03005e08 + adds r4, r0 + bl bag_menu_remove_money_window + movs r0, 0x4 + bl bag_menu_remove_item_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, =0x03005e08 + 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, =0x0203ce7c + 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, =0x03005e08 + 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, =0x0203ce54 + ldr r0, [r0] + ldr r1, =0x00000818 + adds r0, r1 + ldrb r4, [r0] + movs r2, 0x10 + ldrsh r5, [r6, r2] + ldr r0, =0x0203ce7c + 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, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081AD818 + movs r0, 0x5 + bl audio_play + 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 audio_play + 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_remove_item_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, =0x03005e08 + adds r4, r0 + ldr r6, =0x0203ce7c + ldrh r0, [r6] + ldr r1, =0x02021dc4 + bl itemid_get_name + ldr r0, =0x02021cc4 + 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 ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E9677 + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x03005e08 + adds r0, r6 + mov r10, r0 + ldr r7, =0x0203ce58 + 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 audio_play + ldr r2, =0x0203ce7c + mov r8, r2 + ldrh r0, [r2] + mov r3, r10 + ldrh r1, [r3, 0x10] + bl remove_item + ldr r0, =0x03005d8c + 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, =0x03006310 + 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, =0x0203ce54 + ldr r0, [r0] + ldr r1, =0x00000819 + adds r0, r1 + ldrb r4, [r0] + ldr r2, =0x03005d8c + 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, =0x03005e08 + 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, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081AD9E2 + movs r0, 0x5 + bl audio_play + 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, =0x03005e08 + 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, =0x0203ce7c + ldrh r0, [r0] + ldr r1, =0x02021cc4 + bl itemid_get_name + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E8E42 + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x03005e08 + 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, =0x0203ce54 + 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, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081ADAE4 + movs r0, 0x5 + bl audio_play + 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 audio_play + 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, =0x03005e08 + mov r9, r0 + adds r2, r7, 0 + add r2, r9 + mov r8, r2 + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + ldr r4, =0x0203ce7c + 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, =0x02021cc4 + bl itemid_get_name + ldr r0, =0x02021dc4 + mov r2, r8 + movs r3, 0x10 + ldrsh r1, [r2, r3] + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E8E5A + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x03005e08 + adds r5, r0, r1 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081ADC44 + movs r0, 0x5 + bl audio_play + 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, =0x0203ce58 + 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, =0x0203ce80 + movs r0, 0xD0 + bl AllocZeroed + str r0, [r4] + ldr r5, =0x03005d8c + 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, =0x0203ce58 + 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, =0x03005d8c + ldr r0, [r4] + movs r1, 0xAC + lsls r1, 3 + adds r0, r1 + movs r1, 0x1E + bl sub_80D6C7C + ldr r0, [r4] + movs r2, 0xCA + lsls r2, 3 + adds r0, r2 + movs r1, 0x10 + bl sub_80D6C7C + 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, =0x03005d8c + ldr r0, [r5] + movs r1, 0xAC + lsls r1, 3 + adds r0, r1 + ldr r4, =0x0203ce80 + 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, =0x0203ce58 + 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 bag_add_item + movs r0, 0x4 + movs r1, 0x1 + bl bag_add_item + 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, =0x03005e08 + adds r4, r0, r1 + ldr r0, =0x02037fd4 + 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 audio_play + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0 + bl SwitchBagPocket + b _081ADE2C +_081ADDEC: + movs r0, 0x5 + bl audio_play + ldrb r0, [r4] + movs r1, 0x2 + bl bag_menu_print_cursor_ + ldr r1, =0x0203ce7c + movs r0, 0x4 + strh r0, [r1] + adds r0, r5, 0 + bl sub_81AC644 + b _081ADE2C + .pool +_081ADE0C: + movs r0, 0x5 + bl audio_play + 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, =0x020375e2 + ldr r0, =0x0203ce7c + ldrh r0, [r0] + strh r0, [r1] + ldr r1, =0x020375f0 + 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, =0x03005dac + 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, =0x0203ce7c + ldrh r0, [r0] + movs r1, 0x1 + bl remove_item + ldr r1, =0x020375f0 + 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, =0x03005dac + 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, =0x020375f0 + 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, =0x03005dac + 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, =0x0203ce54 + 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, =0x0203ce54 + 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 gpu_pal_apply + 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, =0x0203ce54 + 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, =0x0203ce54 + 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, =0x0203ce54 + 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, =0x0203ce54 + 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_remove_item_message_window +bag_menu_remove_item_message_window: @ 81AE1F8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0203ce54 + 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_remove_item_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, =0x03005d8c + 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, =0x02021cc4 + ldrb r1, [r5, 0x1] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + 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, =0x02021cc4 + ldrb r1, [r2, 0x3] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + 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, =0x02021cc4 + 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 ConvertIntToDecimalString + 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, =0x0203ce84 + 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, =0x03006310 + 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, =0x0203ce84 + 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, =0x030022c0 + 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, =0x0203ce84 + 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, =0x03005e08 + adds r3, r1, r0 + ldr r2, =0x030022c0 + 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, =0x03005e08 + 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, =0x03005e08 + 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, =0x03005e08 + 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, =0x03005e08 + 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, =0x03005e08 + 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, =0x03005e08 + 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, =0x03005e08 + 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, =0x03005e08 + 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, =0x03006300 + 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, =0x03006300 + 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, =0x03006300 + 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 audio_play +_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, =0x03005e08 + 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, =0x03005e08 + 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 StartObjectImageAnim + 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, =gUnknown_08329F40 + 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, =gUnknown_08329F40 + 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 AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02020630 + 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 gpu_pal_apply + 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 LoadTaggedObjectPalette +_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, =0x03005e08 + 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, =0x02020630 + 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, =0x0203ce8c + 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, =0x0203ce8c + 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, =0x03005e08 + 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, =0x02020630 + 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, =0x02020630 + 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, =0x03005e08 + adds r4, r1, r0 + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081AF5E8 + ldr r3, =0x02020630 + 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, =0x02020630 + 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, =0x03005e08 + adds r5, r0, r1 + ldrh r0, [r5, 0xE] + ldr r4, =0x0000ffff + cmp r0, r4 + beq _081AF63E + bl FreeObjectTilesByTag +_081AF63E: + ldrh r0, [r5, 0x10] + cmp r0, r4 + beq _081AF648 + bl FreeObjectPaletteByTag +_081AF648: + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldrb r1, [r5, 0xD] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + 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 gpu_pal_apply + 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 LoadTaggedObjectPalette +_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, =0x03005e08 + 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, =gUnknown_082EC6AC + 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 AddObjectToFront + strb r0, [r5, 0xC] + ldrb r1, [r5, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r7, =0x02020630 + adds r0, r7 + adds r1, r5, 0 + bl SetSpriteOamTables_NoPriorityFromTable + 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, =0x03005e08 + adds r3, r0 + ldr r5, =0x02020630 + 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, =0x03005e08 + adds r4, r0, r1 + ldr r0, [r4, 0x8] + bl Free + ldrh r0, [r4, 0xE] + ldr r6, =0x0000ffff + cmp r0, r6 + beq _081AF9FC + bl FreeObjectTilesByTag +_081AF9FC: + ldrh r0, [r4, 0x10] + cmp r0, r6 + beq _081AFA06 + bl FreeObjectPaletteByTag +_081AFA06: + ldrb r1, [r4, 0xC] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + 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, =gUnknown_08329F40 + 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 gpu_pal_apply + 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 LoadTaggedObjectPalette +_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, =0x03005e08 + 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 AddObjectToFront + strb r0, [r4] + ldr r3, =0x02020630 + 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, =0x03005e08 + adds r3, r0 + ldr r5, =0x02020630 + 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, =0x03005e08 + adds r4, r0, r1 + ldrh r0, [r4, 0x2] + ldr r6, =0x0000ffff + cmp r0, r6 + beq _081AFBBE + bl FreeObjectTilesByTag +_081AFBBE: + ldrh r0, [r4, 0x4] + cmp r0, r6 + beq _081AFBC8 + bl FreeObjectPaletteByTag +_081AFBC8: + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + 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, =0x0203ce9c + 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, =0x0203ce9c + 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, =0x0203ce9c +_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 CopyString + 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, =0x0203ce9c + 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, =0x03005d8c + 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, =0x03005d90 + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0xFD + ands r0, r1 + b _081AFD22 + .pool +_081AFD18: + ldr r0, =0x03005d90 + 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, =0x03005d90 + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0xFB + ands r0, r1 + b _081AFD52 + .pool +_081AFD48: + ldr r0, =0x03005d90 + 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, =0x03005d90 + ldr r2, [r0] + ldrb r1, [r2, 0x9] + movs r0, 0xF7 + ands r0, r1 + b _081AFD82 + .pool +_081AFD78: + ldr r0, =0x03005d90 + 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, =0x03005d90 + 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, =0x03005d90 + 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, =0x0203cebc + movs r0, 0x90 + lsls r0, 1 + bl Alloc + str r0, [r5] + cmp r0, 0 + beq _081AFE1A + ldr r4, =0x0203cec0 + 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, =0x0203cebc + ldr r0, [r0] + bl Free + ldr r0, =0x0203cec0 + 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, =0x0203cebc + ldr r1, [r4] + bl LZDecompressWram + ldr r0, [r4] + ldr r4, =0x0203cec0 + 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 LoadObjectPic + 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 AddObjectToFront + 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, =0x0203cebc + ldr r1, [r4] + bl LZDecompressWram + ldr r0, [r4] + ldr r4, =0x0203cec0 + 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 LoadObjectPic + 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 AddObjectToFront + 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, =0x0203cec4 + 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, =0x0203cec8 + 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, =0x0203cec4 + 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, =0x0203cec4 + 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, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + bne _081B017E +_081B017A: + movs r0, 0 + strb r0, [r6, 0x9] +_081B017E: + ldr r2, =0x03003014 + 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 CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl do_scheduled_bg_tilemap_copies_to_vram + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_81B01B0 + + thumb_func_start sub_81B01CC +sub_81B01CC: @ 81B01CC + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + 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, =0x030022c0 + 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, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B02AC: + bl remove_some_task + b _081B0484 +_081B02B2: + bl sub_80A1A74 + ldr r2, =0x02037fd4 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B02D4: + bl ResetAllObjectData + b _081B0484 +_081B02DA: + bl ResetObjectPaletteAllocator + ldr r1, =0x030022c0 + 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, =0x030022c0 + 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, =0x0203cec4 + 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, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B0354: + ldr r0, =0x0203cec8 + ldrb r0, [r0, 0x8] + lsls r0, 26 + lsrs r0, 30 + bl sub_81B239C + b _081B0484 + .pool +_081B0368: + ldr r0, =0x0203cec8 + ldrb r0, [r0, 0x8] + lsls r0, 26 + lsrs r0, 30 + bl sub_81B0740 + ldr r0, =0x0203cec4 + 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, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B03A0: + bl sub_81B6040 + b _081B0484 +_081B03A6: + bl sub_81B6160 + ldr r1, =0x030022c0 + 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, =0x0203cec4 + 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, =0x0203cec4 + 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, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _081B048C + .pool +_081B0414: + ldr r0, =0x0203cec4 + 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, =0x0203cec4 + 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 sub_80A2A20 + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + ldr r1, =0x030022c0 + 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 pal_fade_maybe +_081B0484: + ldr r1, =0x030022c0 + 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 pal_fade_maybe + 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, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B051C + ldr r0, =0x0203cec8 + 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, =0x0203cec4 + movs r1, 0 + str r1, [r0] + ldr r0, =0x0203cee4 + str r1, [r0] + ldr r0, =0x0203cedc + str r1, [r0] + ldr r0, =0x0203cee0 + 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, =0x0203cee4 + 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, =0x0203cec4 + 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, =0x0203cee0 + 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, =0x0203cee4 + ldr r1, [r1] + bl LZDecompressWram + b _081B069A + .pool +_081B0658: + ldr r0, =gUnknown_08D96AB4 + movs r2, 0xB0 + lsls r2, 1 + movs r1, 0 + bl decompress_palette + ldr r0, =0x02037714 + ldr r4, =0x0203cec4 + 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, =0x0203cec4 + 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, =0x02037774 + 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, =0x02037b14 + 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, =0x0203cec4 + ldr r0, [r0] + cmp r0, 0 + beq _081B0702 + bl Free +_081B0702: + ldr r0, =0x0203cee4 + ldr r0, [r0] + cmp r0, 0 + beq _081B070E + bl Free +_081B070E: + ldr r0, =0x0203cee0 + ldr r0, [r0] + cmp r0, 0 + beq _081B071A + bl Free +_081B071A: + ldr r0, =0x0203cedc + 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, =0x0203cedc + 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, =0x0203cec8 + 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, =0x02022ff8 + subs r1, r5, 0x3 + lsls r1, 5 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _081B0828 + ldr r0, =0x0203cedc + lsls r4, r5, 4 + ldr r0, [r0] + adds r0, r4 + movs r1, 0x40 + bl sub_81B2748 + b _081B0836 + .pool +_081B0828: + ldr r0, =0x0203cedc + lsls r4, r5, 4 + ldr r0, [r0] + adds r0, r4 + movs r1, 0x8 + bl sub_81B2748 +_081B0836: + adds r5, r4, 0 + ldr r4, =0x0203cedc + 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, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + bne _081B089C + ldr r4, =0x0203cedc + 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, =0x0203cec8 + 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, =0x0203cec8 + 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, =0x0203cedc + 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, =0x020244ec + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0x2D + bl pokemon_getattr + adds r2, r0, 0 + cmp r2, 0 + beq _081B09A0 + ldr r6, =0x0203cedc + 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, =0x0203cedc + 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, =0x020244ec + adds r6, r2, r1 + ldr r7, =0x0203cedc + 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 pokemon_getattr + 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, =0x020244ec + adds r0, r1 + ldr r6, =0x0203cef8 + 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, =0x020244ec + 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, =0x020244ec + 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, =0x020244ec + adds r0, r1 + movs r1, 0xC + bl pokemon_getattr + 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, =0x020244ec + adds r6, r1, r0 + ldr r0, =0x0203ce7c + ldrh r4, [r0] + ldr r0, =0x0203cec8 + ldrb r0, [r0, 0xB] + cmp r0, 0xC + bne _081B0C40 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x020375e2 + 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 pokemon_getattr + 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, =0x020244ec + 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, =0x0203cedc + lsls r2, r0, 4 + ldr r1, [r1] + adds r6, r1, r2 + subs r0, 0x3 + lsls r0, 24 + ldr r5, =0x02022ff8 + 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, =0x02021cc4 + adds r5, 0x4 + add r5, r8 + adds r0, r4, 0 + adds r1, r5, 0 + bl CopyString + adds r0, r4, 0 + bl GetStringEnd_Limit7 + 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, =0x0203cec4 + 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, =0x0203cee0 + 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, =0x0203cec8 + 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, =0x02022ff8 + 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, =0x0203cedc + 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, =0x02022ff8 + mov r2, r10 + lsls r0, r2, 5 + adds r0, r1 + ldrh r0, [r0] + ldr r1, =0x0203cedc + 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, =0x020244ec + adds r6, r1, r0 + adds r0, r6, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B0EDC + ldr r4, =0x0203cedc + 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, =0x0203cec4 + 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, =0x0203cec8 + 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, =0x0203cec4 + 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, =0x0203cec8 + 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, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B10E8 + ldr r6, =0x0203cedc + 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, =0x0203cec4 + ldr r0, [r0] + ldrh r0, [r0, 0x8] + lsls r0, 21 + b _081B10DA + .pool +_081B1074: + ldr r0, =0x0203cec4 + 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, =0x0203cec4 + 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, =0x020244ec + adds r0, r1 + movs r1, 0x39 + bl pokemon_getattr + 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, =0x0203cec8 + 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, =0x0203cec8 + 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, =0x02022fec + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 11 + ands r0, r1 + cmp r0, 0 + beq _081B11F6 + ldr r0, =0x030022c0 + 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, =0x0202449c + 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, =0x02022fec + ldr r0, [r0] + movs r1, 0x49 + ands r0, r1 + cmp r0, 0x49 + bne _081B1280 + ldr r0, =0x030022c0 + 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 pal_fade_maybe + ldr r1, =0x03005e00 + 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, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B134C + ldr r4, =0x0203cec8 + ldrb r1, [r4, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + bne _081B131A + bl sub_81B9080 +_081B131A: + ldr r0, =0x0203cec4 + 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 ResetAllObjectData + 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, =0x0203cec8 + ldrb r0, [r0, 0x9] + bx lr + .pool + thumb_func_end brm_get_pokemon_selection + + thumb_func_start sub_81B1360 +sub_81B1360: @ 81B1360 + ldr r0, =0x0203cec8 + 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, =0x02037fd4 + 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, =0x0203cec4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B13E0 + movs r0, 0x5 + bl audio_play + 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, =0x0203cec8 + 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, =0x0203cec8 + ldr r1, [r0, 0x4] + adds r0, r5, 0 + bl _call_via_r1 + b _081B159E + .pool +_081B142C: + ldr r0, =0x0203cec8 + 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, =0x0203cec4 + 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, =0x0203cec8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + ldr r2, =0x0203cec4 + 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, =0x03006328 + 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 audio_play + ldr r0, =0x0203cec4 + 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 audio_play + ldr r0, =0x0203cec4 + 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 audio_play + ldr r0, =0x0203cec4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + adds r0, r5, 0 + bl sub_81B7FAC + b _081B159E + .pool +_081B1560: + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_81B3938 + b _081B159E +_081B156E: + movs r0, 0x5 + bl audio_play + 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 audio_play + 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, =0x020244ec + adds r0, r1 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0x1 + beq _081B15C4 + movs r0, 0x1 + b _081B15CC + .pool +_081B15C4: + movs r0, 0x20 + bl audio_play + 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, =0x0203cec8 + 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 audio_play + b _081B1652 +_081B1602: + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl sub_81B407C + b _081B1652 +_081B1610: + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl sub_81B2210 + b _081B1652 +_081B161E: + movs r0, 0x5 + bl audio_play + 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, =0x020375e0 + movs r0, 0x7 + strh r0, [r1] +_081B1642: + ldr r0, =0x0203cee8 + 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, =0x0203cec8 + 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, =0x0203cec4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + ldr r4, =0x02021fc4 + adds r0, r4, 0 + adds r1, r5, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =0x03005e00 + 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, =0x03005e00 + 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, =0x0203cee8 + strb r1, [r0] + ldr r1, =0x0203cec8 + 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 audio_play +_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, =0x030022c0 + 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, =0x030022c0 +_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, =0x0203cec8 + 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 audio_play + 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, =0x020244e9 + ldrb r0, [r0] + subs r0, 0x1 + b _081B1950 + .pool +_081B1898: + cmp r1, 0x7 + bne _081B18BC + ldr r0, =0x0203cec4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 31 + cmp r0, 0 + beq _081B18B0 + movs r0, 0x6 + b _081B1950 + .pool +_081B18B0: + ldr r0, =0x020244e9 + 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, =0x020244e9 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bne _081B18F4 + ldr r0, =0x0203cec4 + 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, =0x020244e9 + ldrb r0, [r0] + cmp r0, 0x1 + beq _081B1952 + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0 + bne _081B1952 + ldr r0, =0x0203cec4 + 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, =0x0203cec4 + 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, =0x020244e9 + ldrb r0, [r0] + subs r0, 0x1 + b _081B1AF2 + .pool +_081B19A8: + cmp r0, 0x7 + bne _081B19C4 + ldr r0, =0x0203cec4 + 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, =0x0203cec4 + 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, =0x0203cec4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 28 + lsrs r6, r0, 29 + cmp r6, 0x3 + bne _081B1A54 + ldr r0, =0x02024618 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B1AF4 + strb r6, [r4] + b _081B1AF4 + .pool +_081B1A54: + ldr r0, =0x020245b4 + b _081B1A70 + .pool +_081B1A5C: + cmp r0, 0x1 + bne _081B1AF4 + ldr r0, =0x0203cec4 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + lsls r0, 28 + lsrs r5, r0, 29 + cmp r5, 0x5 + bne _081B1A88 + ldr r0, =0x020246e0 +_081B1A70: + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B1AF4 + strb r5, [r4] + b _081B1AF4 + .pool +_081B1A88: + ldr r0, =0x0202467c + movs r1, 0xB + bl pokemon_getattr + 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, =0x0203cec4 + 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, =0x0203cec4 + 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, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + 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 pokemon_getattr + adds r0, r4, 0 + bl GetStringEnd_Limit7 + 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, =0x03005e00 + 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, =0x03005e00 + 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, =0x03005e00 + 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, =0x03005e00 + 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, =0x03005e00 + 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, =0x02021cc4 + bl GetMonNickname + ldr r1, =0x02021dc4 + adds r0, r4, 0 + bl itemid_get_name + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E991B + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x02021cc4 + bl GetMonNickname + ldr r1, =0x02021dc4 + adds r0, r4, 0 + bl itemid_get_name + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E999D + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x02021cc4 + bl GetMonNickname + ldr r1, =0x02021dc4 + adds r0, r4, 0 + bl itemid_get_name + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E993A + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x02021cc4 + bl itemid_get_name + ldr r1, =0x02021dc4 + adds r0, r4, 0 + bl itemid_get_name + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E99DB + adds r0, r4, 0 + bl ExpandStringRefs + 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 pokemon_setattr +_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 pokemon_getattr + 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 bag_add_item + 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 pokemon_setattr + 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, =0x02021fc4 + ldr r1, =gUnknown_085E9A69 + bl ExpandStringRefs + 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, =0x03005e08 + 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, =0x020244ec + adds r0, r4 + movs r1, 0x39 + adds r2, r7, 0 + bl pokemon_setattr + movs r3, 0x8 + ldrsh r2, [r7, r3] + adds r0, r2, 0 + muls r0, r5 + adds r0, r4 + ldr r6, =0x0203cedc + 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, =0x02021dc4 + movs r3, 0xA + ldrsh r2, [r7, r3] + subs r1, r2 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString +_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, =0x020244ec + adds r6, r0 + mov r0, r8 + lsls r4, r0, 2 + add r4, r8 + lsls r4, 3 + ldr r0, =0x03005e08 + adds r4, r0 + adds r0, r6, 0 + movs r1, 0x39 + bl pokemon_getattr + strh r0, [r4] + adds r0, r6, 0 + movs r1, 0x3A + bl pokemon_getattr + 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, =0x03005e08 + 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 pokemon_getattr + cmp r0, 0 + bne _081B206E + movs r0, 0x7 + b _081B2096 +_081B206E: + adds r0, r4, 0 + movs r1, 0x37 + bl pokemon_getattr + 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, =0x0203cec8 + 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, =0x020375e2 + ldrh r0, [r0] + cmp r0, 0 + bne _081B20FC + movs r4, 0 + ldr r0, =0x020244e9 + ldrb r0, [r0] + cmp r4, r0 + bcs _081B2126 +_081B20C4: + movs r0, 0x64 + muls r0, r4 + ldr r1, =0x020244ec + 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, =0x020244e9 + 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, =0x020244ec + 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, =0x020244e9 + 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 pokemon_getattr + cmp r0, 0x1 + beq _081B215A + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + 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 pokemon_getattr + cmp r0, 0x1 + beq _081B2182 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + 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, =0x0203cec8 + 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 audio_play + ldr r0, =0x020375e0 + strh r5, [r0] + adds r0, r4, 0 + bl sub_81B12C0 + b _081B21FE + .pool +_081B21DC: + movs r0, 0x20 + bl audio_play + ldr r0, =gUnknown_085EA0EE + movs r1, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =0x03005e00 + 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, =0x03005e00 + 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, =0x03005e00 + 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, =0x020375e0 + movs r0, 0x7 + strh r0, [r1] + adds r0, r4, 0 + bl sub_81B12C0 + b _081B22C8 + .pool +_081B22B4: + movs r0, 0x5 + bl audio_play +_081B22BA: + ldr r0, =0x03005e00 + 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 pokemon_getattr + 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 pokemon_getattr + 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 gpu_pal_apply + ldr r0, =gUnknown_0860F074 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + 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, =0x0203cec8 + 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, =0x0203cec8 + 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, =0x0203cec4 + 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 gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + 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 gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + 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 gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + 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 gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + 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 gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + 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 gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + 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 gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + 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 gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r7 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r7 + movs r2, 0x2 + bl gpu_pal_apply + ldr r5, =gUnknown_08615AE2 + ldrb r0, [r5] + bl sub_81B2564 + ldr r4, =gUnknown_08615ABD + ldrb r1, [r4] + adds r1, r7 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r7 + movs r2, 0x2 + bl gpu_pal_apply + ldrb r0, [r5, 0x2] + bl sub_81B2564 + ldrb r1, [r4, 0x2] + adds r1, r7 + movs r2, 0x2 + bl gpu_pal_apply +_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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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, =0x02021dc4 + adds r0, r5, 0 + adds r1, r2, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r4, =0x02021cc4 + ldr r1, =gUnknown_085E8D4D + adds r0, r4, 0 + bl CopyString + adds r0, r4, 0 + adds r1, r5, 0 + bl AppendString + 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 pokemon_getattr + 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 CompareString + 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 gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + 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 gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r6 + movs r2, 0x2 + bl gpu_pal_apply + 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 pokemon_getattr + 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 pokemon_getattr + 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, =0x02021cc4 + adds r0, r5, 0 + adds r1, r2, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + 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 pokemon_getattr + 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 pokemon_getattr + 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, =0x02021dc4 + adds r0, r5, 0 + adds r1, r2, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r4, =0x02021cc4 + ldr r1, =gUnknown_085E8D3E + adds r0, r4, 0 + bl CopyString + adds r0, r4, 0 + adds r1, r5, 0 + bl AppendString + 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 pokemon_getattr + cmp r0, 0 + beq _081B2E5C + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x3A + bl pokemon_getattr + 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 gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r7 + movs r2, 0x2 + bl gpu_pal_apply + 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 gpu_pal_apply + ldrb r0, [r5, 0x1] + bl sub_81B2564 + ldrb r1, [r4, 0x1] + adds r1, r7 + movs r2, 0x2 + bl gpu_pal_apply +_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, =0x0203cec4 + 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, =0x0203cec4 + 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, =0x02021fc4 + ldr r1, =gUnknown_08615AF4 + lsls r0, r6, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x020244ec + movs r6, 0 + ldr r0, =0x0203cec8 + 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 pokemon_getattr + cmp r0, 0 + beq _081B319A + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _081B3194 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + 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, =0x0203cec4 + 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, =0x0203cec4 + 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, =0x0203cec4 + 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, =0x03003014 + 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, =0x0203cec4 + 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, =0x0203cec4 + 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, =0x0203cec4 + 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, =0x0203cec4 + 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 pokemon_getattr + lsls r1, r4, 1 + adds r1, r5 + ldrh r1, [r1] + cmp r0, r1 + bne _081B3490 + ldr r0, =0x0203cec4 + 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 pokemon_getattr + cmp r0, 0 + beq _081B34D2 + ldr r0, =0x0203cec4 + 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 pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _081B3508 + ldr r0, =0x0203cec4 + 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, =0x0203cec4 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xF + adds r1, 0x17 + movs r2, 0x3 + bl append_byte +_081B3518: + ldr r0, =0x0203cec4 + 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, =0x0203cec8 + 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 pokemon_getattr + 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 pokemon_getattr + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r4, r1] + movs r0, 0x64 + muls r0, r1 + ldr r7, =0x020244ec + adds r5, r0, r7 + ldr r1, =0x02021cc4 + adds r0, r5, 0 + bl GetMonNickname + ldr r0, =0x0203cec4 + 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 pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0 + bne _081B36C0 + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E9980 + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =0x03005e00 + 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, =0x02021dc4 + adds r0, r6, 0 + bl itemid_get_name + 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, =0x03005e00 + 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, =0x02037fd4 + 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, =0x03005e08 + adds r5, r0, r1 + ldr r0, =0x0203cec4 + 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 audio_play + ldr r4, =0x0203cec4 + 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, =0x0203cec4 + 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 audio_play + ldr r0, =0x0203cec4 + 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, =0x0203cec8 + ldrb r1, [r4, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + bne _081B3868 + bl pokemon_change_order + ldr r1, =0x020244ec + ldrb r2, [r4, 0x9] + ldr r0, =0x020244e9 + 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, =0x020244ec + ldrb r2, [r4, 0x9] + ldr r0, =0x020244e9 + 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, =0x02037fd4 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r3, =0x0203cec8 + ldr r0, =0x0203cf20 + 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 audio_play + ldr r5, =0x0203cec8 + movs r0, 0x8 + strb r0, [r5, 0xB] + ldr r4, =0x0203cec4 + 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, =0x03005e00 + 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, =0x03005e08 + adds r6, r0, r1 + ldr r3, =0x0203cec8 + 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, =0x0203cedc + 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, =0x0203cec8 + ldrb r0, [r0, 0xA] + lsls r0, 24 + asrs r0, 24 + ldr r1, =0x0203cedc + 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, =0x0203cef0 + 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, =0x0203cef4 + 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, =0x0203cec8 + 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, =0x03005e00 + 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, =0x02020630 + 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, =0x03005e08 + adds r4, r1, r0 + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _081B3C8E + ldr r2, =0x0203cedc + ldr r0, =0x0203cec8 + 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, =0x0203cedc + ldr r0, =0x0203cec8 + 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, =0x03005e08 + adds r5, r1, r0 + movs r1, 0x14 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _081B3D00 + ldr r0, =0x0203cef0 + 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, =0x0203cef4 + 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, =0x03005e08 + 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, =0x0203cec8 + ldrb r0, [r4, 0x9] + bl sub_81B0948 + ldrb r0, [r4, 0xA] + bl sub_81B0948 + movs r0, 0x9 + ldrsb r0, [r4, r0] + ldr r5, =0x0203cedc + 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, =0x0203cef0 + 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, =0x0203cef4 + 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, =0x03005e08 + 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, =0x0203cec8 + movs r0, 0x9 + ldrsb r0, [r5, r0] + ldr r4, =0x0203cedc + 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, =0x0203cef0 + ldr r0, [r0] + bl Free + ldr r0, =0x0203cef4 + 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, =0x02020630 + 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, =0x0203cedc + ldr r2, =0x0203cec8 + 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, =0x020244ec + 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, =0x0203cec4 + ldr r0, [r0] + adds r0, 0xD + bl sub_81B302C + ldr r4, =0x0203cec8 + 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, =0x03005e00 + 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 audio_play + ldr r4, =0x0203cec4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, =0x0203cec8 + 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, =0x03005e00 + 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 audio_play + ldr r4, =0x0203cec4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, =0x020244ec + ldr r1, =0x0203cec8 + 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, =0x03005e00 + 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 audio_play + ldr r0, =0x0203cec4 + 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, =0x0203ce7c + ldrh r0, [r6] + cmp r0, 0 + bne _081B4224 + ldr r3, =0x0203cec8 + 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, =0x0203cefc + ldr r5, =0x0203cec8 + 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, =0x020244ec + adds r0, r7 + movs r1, 0xC + bl pokemon_getattr + 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 remove_item + 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, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B432C + ldr r0, =0x0203ce7c + ldrh r4, [r0] + ldr r0, =0x0203cec8 + mov r8, r0 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + 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 remove_item + ldr r1, =0x03005e00 + 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, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B4388 + ldr r0, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x0203cefc + ldrh r1, [r1] + movs r2, 0x1 + bl sub_81B1D1C + ldr r1, =0x03005e00 + 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, =0x03005e00 + 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, =0x0203ce7c + ldrh r0, [r5] + movs r1, 0x1 + bl remove_item + ldr r6, =0x0203cefc + ldrh r0, [r6] + movs r1, 0x1 + bl bag_add_item + lsls r0, 24 + cmp r0, 0 + bne _081B4458 + ldrh r0, [r5] + movs r1, 0x1 + bl bag_add_item + ldrh r0, [r6] + bl pokemon_item_not_removed + ldr r0, =0x02021fc4 + movs r1, 0 + bl sub_81B1B5C + ldr r1, =0x03005e00 + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldrh r1, [r5] + bl sub_81B1DB8 + ldr r1, =0x03005e00 + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldrh r1, [r5] + bl sub_81B1DB8 + ldrh r0, [r5] + ldrh r1, [r6] + movs r2, 0x1 + bl sub_81B1D68 + ldr r1, =0x03005e00 + 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 audio_play +_081B44DE: + ldr r0, =0x03005e00 + 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, =0x0203cec4 + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x40 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005d8c + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + ldr r0, =0x020375f0 + ldrh r7, [r0] + cmp r7, 0 + bne _081B45F8 + adds r0, r5, 0 + bl sub_80D4680 + ldr r4, =0x0203cefc + adds r0, r5, 0 + movs r1, 0xC + adds r2, r4, 0 + bl pokemon_setattr + ldrh r0, [r4] + movs r1, 0x1 + bl remove_item + mov r0, r8 + movs r1, 0x1 + bl bag_add_item + 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, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B468A + ldr r1, =0x0203cefc + ldrh r0, [r1] + cmp r0, 0 + bne _081B4670 + ldr r0, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x0203ce7c + ldrh r1, [r1] + movs r2, 0 + movs r3, 0 + bl sub_81B1C84 + b _081B467C + .pool +_081B4670: + ldr r0, =0x0203ce7c + ldrh r0, [r0] + ldrh r1, [r1] + movs r2, 0 + bl sub_81B1D68 +_081B467C: + ldr r0, =0x03005e00 + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r4, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r6, r1, r0 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B471C + ldr r5, =0x0203cedc + 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 pokemon_getattr + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + movs r0, 0x5 + bl audio_play + ldr r4, =0x0203cec4 + 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, =0x02021cc4 + adds r0, r5, 0 + bl GetMonNickname + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E9980 + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + b _081B47B4 + .pool +_081B47AC: + adds r0, r6, 0 + bl pokemon_item_not_removed + ldr r0, =0x02021fc4 +_081B47B4: + movs r1, 0x1 + bl sub_81B1B5C +_081B47BA: + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =0x03005e00 + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + movs r0, 0x5 + bl audio_play + ldr r4, =0x0203cec4 + 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, =0x02021cc4 + adds r0, r7, 0 + bl GetMonNickname + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E9980 + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B469C + b _081B488A + .pool +_081B4864: + ldr r1, =0x02021cc4 + adds r0, r5, 0 + bl itemid_get_name + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E9E00 + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =0x03005e00 + 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, =0x03005e00 + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + 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 pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x02021cc4 + bl itemid_get_name + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E9E14 + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0 + bl sub_81B1B5C + ldr r1, =0x03005e00 + 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 audio_play +_081B496A: + ldr r0, =0x03005e00 + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + 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 pokemon_setattr + ldr r4, =0x0203cedc + 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, =0x03005e00 + 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 audio_play + ldr r4, =0x0203cec4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, =0x020244ec + ldr r1, =0x0203cec8 + 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, =0x03005e00 + 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 audio_play + ldr r0, =0x0203cec4 + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x40 + bl pokemon_getattr + ldr r2, =0x03005d8c + 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, =0x02037fd4 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r3, =0x0203cec8 + 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 audio_play + ldr r5, =0x0203cec4 + 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, =0x03005e00 + 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, =0x03005e00 + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + 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, =0x03005e00 + 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, =0x03005e00 + 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 audio_play +_081B4C36: + ldr r0, =gUnknown_085E98B4 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =0x03005e00 + 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, =0x03005e00 + 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, =0x0203cec8 + mov r8, r0 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + movs r7, 0x64 + muls r0, r7 + ldr r6, =0x020244ec + adds r0, r6 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + movs r1, 0x1 + bl bag_add_item + 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, =0x03005e00 + 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, =0x02021fc4 + movs r1, 0 + bl sub_81B1B5C + ldr r1, =0x03005e00 + 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 audio_play +_081B4D56: + ldr r0, =0x03005e00 + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r5, r1] + movs r0, 0x64 + muls r0, r1 + ldr r6, =0x020244ec + adds r7, r0, r6 + movs r0, 0x5 + bl audio_play + ldr r4, =0x0203cec4 + 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 pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x02021dc4 + bl itemid_get_name + movs r0, 0x1A + bl display_pokemon_menu_message +_081B4E02: + ldr r1, =0x03005e00 + 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 audio_play + ldr r5, =0x0203cec4 + 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, =0x02021fc4 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =0x03005e00 + 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, =0x0203cec4 + 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, =0x0203cec8 + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + mov r8, r0 +_081B4EC6: + ldr r0, =0x0203cef8 + adds r4, r5, r0 + ldrb r0, [r4] + cmp r0, 0 + bne _081B4F2C + movs r0, 0x5 + str r2, [sp] + bl audio_play + 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, =0x0203cedc + 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, =0x02021cc4 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E9830 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0x20 + bl audio_play + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =0x03005e00 + 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, =0x0203cec8 + 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 audio_play + ldr r4, =0x0203cec4 + 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, =0x0203cef8 + subs r2, r5, 0x1 + adds r7, r6, 0 + ldr r3, =0x0203cec8 +_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, =0x0203cedc + ldr r0, =0x0203cec8 + 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, =0x0203cef8 + 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, =0x03005e00 + 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 audio_play + 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, =0x0203cec8 + 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, =0x020244ec + adds r0, r4 + movs r1, 0x41 + bl pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 audio_play + adds r0, r7, 0 + bl sub_81B12C0 + b _081B51B0 + .pool +_081B515C: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085EA210 + bl ExpandStringRefs + b _081B5178 + .pool +_081B5170: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085EA234 + bl ExpandStringRefs +_081B5178: + movs r0, 0x20 + bl audio_play + ldr r4, =0x0203cec4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EA1CA + adds r0, r4, 0 + bl AppendString + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =0x03005e00 + 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, =0x0203cec8 + mov r8, r0 + ldrb r0, [r0, 0x9] + lsls r0, 24 + asrs r0, 24 + movs r6, 0x64 + muls r0, r6 + ldr r4, =0x020244ec + adds r0, r4 + movs r1, 0x41 + bl pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_800F7DC + ldr r0, [r0] + ldr r1, =0x02022c38 + ldr r1, [r1] + ldr r2, =0x02022c3c + ldrh r3, [r2] + ldr r2, =0x02022c3e + 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, =0x02021fc4 + ldr r1, =gUnknown_08615E0C + subs r0, 0x1 + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r5, 0 + bl ExpandStringRefs + movs r0, 0x20 + bl audio_play + ldr r4, =0x0203cec4 + 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 AppendString + adds r0, r5, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =0x03005e00 + 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 audio_play + 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, =0x0203cec4 + ldr r0, [r4] + adds r0, 0xC + bl sub_81B302C + ldr r0, [r4] + adds r0, 0xD + bl sub_81B302C + ldr r0, =0x020244ec + ldr r1, =0x0203cec8 + 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, =0x02021fc4 + ldr r1, =gUnknown_085EA1E8 + bl ExpandStringRefs + b _081B53C0 + .pool +_081B5340: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085EA210 + bl ExpandStringRefs + b _081B53C0 + .pool +_081B5354: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085EA234 + bl ExpandStringRefs + b _081B53C0 + .pool +_081B5368: + movs r0, 0x5 + bl audio_play + ldr r0, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02021cc4 + bl GetMonNickname + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EA1CD + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =0x03005e00 + 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 audio_play + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EA1CA + adds r0, r4, 0 + bl AppendString + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =0x03005e00 + 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, =0x03005e00 + 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 audio_play +_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, =0x0203cec4 + 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 audio_play + 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, =0x03005e00 + 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, =0x03005d8c + 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, =0x02021cc4 + ldrb r1, [r1, 0x14] + bl sub_81245DC + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085EA196 + b _081B55E8 + .pool +_081B55B8: + ldr r0, =0x03005d8c + 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, =0x02021cc4 + ldrb r1, [r1, 0x14] + bl sub_81245DC + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085EA16B +_081B55E8: + bl ExpandStringRefs + adds r0, r6, 0 + bl sub_81B5674 + ldr r0, =0x0203cec4 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + strh r4, [r0] + b _081B5664 + .pool +_081B5614: + ldr r1, =0x0203cec8 + ldr r0, =sub_8124690 + b _081B5628 + .pool +_081B5624: + ldr r1, =0x0203cec8 + 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, =0x03005e00 + 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, =0x02021fc4 + movs r1, 0x1 + bl sub_81B1B5C + ldr r1, =0x03005e00 + 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, =0x03005e00 + 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, =0x0203cec8 + 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 audio_play +_081B571A: + ldr r0, =0x03005db0 + movs r1, 0 + str r1, [r0] + ldr r0, =0x0203ceec + 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, =0x02038c08 + lsls r0, 16 + lsrs r0, 16 + str r0, [r1] + ldr r0, =0x0203ceec + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + 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, =0x030022c0 + 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, =0x02038c08 + 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, =0x03005db0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =0x0203ceec + 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, =0x02037318 + 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, =0x02038c08 + 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, =0x03005db0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =0x0203ceec + 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, =0x02038c08 + 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, =0x02038c08 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1, 0x4] + cmp r0, 0 + bne _081B5990 + movs r0, 0 + b _081B599E + .pool +_081B5990: + ldr r1, =0x03005db0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =0x0203ceec + 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, =0x030022c0 + 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 pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0 + bl pokemon_getattr + 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, =0x02020630 + 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, =0x02020630 + 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, =0x02020630 + 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, =0x02020630 + 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, =0x02020630 + 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, =0x02020630 + 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 pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r6, 0 + movs r1, 0x3A + bl pokemon_getattr + 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, =0x02020630 + 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 pokemon_getattr + 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 AddObjectToFront + 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 AddObjectToFront + strb r0, [r4, 0xA] + ldr r2, =0x02020630 + 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 pokemon_getattr + 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, =0x02020630 + 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, =0x02020630 + adds r0, r1 + movs r1, 0x1 + bl StartObjectImageAnim + b _081B5D0E + .pool +_081B5CFC: + ldrb r1, [r4, 0xA] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0 + bl StartObjectImageAnim +_081B5D0E: + ldr r2, =0x02020630 + 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 LoadObjectPic + ldr r0, =gUnknown_08615EB8 + bl LoadTaggedObjectPalette + 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, =0x020244ec + adds r0, r1 + movs r1, 0xC + bl pokemon_getattr + 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, =0x02024744 + adds r0, r1 + movs r1, 0xC + bl pokemon_getattr + 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, =0x02020630 + 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 AddObjectToFront + 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 StartObjectImageAnim + 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, =0x02020630 + 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 pokemon_getattr + 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 AddObjectToFront + 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 AddObjectToFront + strb r0, [r4, 0xB] + ldr r2, =0x02020630 + 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 AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + 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 AddObjectToFront + 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, =0x02020630 + adds r0, r2 + bl StartObjectImageAnim + 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, =0x02020630 + mov r8, r0 + add r4, r8 + adds r0, r4, 0 + movs r1, 0x2 + bl StartObjectImageAnim + lsls r5, r7, 4 + adds r5, r7 + lsls r5, 2 + add r5, r8 + adds r0, r5, 0 + movs r1, 0x4 + bl StartObjectImageAnim + strh r6, [r4, 0x26] + strh r6, [r5, 0x26] + b _081B602C + .pool +_081B6000: + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + ldr r0, =0x02020630 + mov r8, r0 + add r5, r8 + adds r0, r5, 0 + movs r1, 0x3 + bl StartObjectImageAnim + lsls r4, r7, 4 + adds r4, r7 + lsls r4, 2 + add r4, r8 + adds r0, r4, 0 + movs r1, 0x5 + bl StartObjectImageAnim + 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 pokemon_getattr + 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 AddObjectToFront + 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 AddObjectToFront + strb r0, [r4, 0xC] + adds r0, r5, 0 + adds r1, r4, 0 + bl party_menu_update_status_condition_object + ldr r2, =0x02020630 + 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, =0x02020630 + 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, =0x02020630 + adds r0, r4 + subs r1, r2, 0x1 + lsls r1, 24 + lsrs r1, 24 + bl StartObjectImageAnim + 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, =0x030022c0 + 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, =0x0203cec8 + strb r5, [r0, 0x9] + b _081B6204 + .pool +_081B61BC: + movs r7, 0 + movs r6, 0 +_081B61C0: + ldr r4, =0x0203ce7c + ldrh r0, [r4] + bl GetItemEffectType + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xA + bne _081B621C + ldr r1, =0x0203cec8 + movs r0, 0 + strb r0, [r1, 0x9] + movs r5, 0 +_081B61D8: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B61FA + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + 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 sub_80D6C68 + 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, =0x0203cf30 + 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, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B62B2 + ldr r0, =0x0203cec8 + ldrb r1, [r0, 0x8] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + bne _081B62A6 + ldr r0, =0x0203cec4 + ldr r1, [r0] + ldr r0, =sub_81B9140 + str r0, [r1, 0x4] +_081B62A6: + ldr r0, =0x03006328 + 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, =0x03005d8c + 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, =0x02021fc4 + ldr r1, =gUnknown_085E9C3E + bl ExpandStringRefs + b _081B64C4 + .pool +_081B6394: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E9C7C + bl ExpandStringRefs + b _081B64C4 + .pool +_081B63A8: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E9C8A + bl ExpandStringRefs + b _081B64C4 + .pool +_081B63BC: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E9CA2 + bl ExpandStringRefs + b _081B64C4 + .pool +_081B63D0: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E9C5F + bl ExpandStringRefs + b _081B64C4 + .pool +_081B63E4: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E9DBE + bl ExpandStringRefs + b _081B64C4 + .pool +_081B63F8: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E9DE1 + bl ExpandStringRefs + b _081B64C4 + .pool +_081B640C: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E9CE0 + bl ExpandStringRefs + b _081B64C4 + .pool +_081B6420: + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085E96E3 + b _081B6474 + .pool +_081B6430: + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085EA33C + b _081B6474 + .pool +_081B6440: + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085EA343 + b _081B6474 + .pool +_081B6450: + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085EA35B + b _081B6474 + .pool +_081B6460: + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085E96E6 + b _081B6474 + .pool +_081B6470: + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085E96EE +_081B6474: + bl CopyString + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E9D25 + bl ExpandStringRefs + b _081B64C4 + .pool +_081B6494: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E9CF5 + bl ExpandStringRefs + b _081B64C4 + .pool +_081B64A8: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E9CB7 + bl ExpandStringRefs + b _081B64C4 + .pool +_081B64BC: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E96F6 + bl ExpandStringRefs +_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 pokemon_getattr + 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, =0x030022c0 + 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, =0x020244ec + 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, =0x020244ec + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + ldr r0, =0x0203ce7c + 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 pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + adds r0, r5, 0 + movs r1, 0x3A + bl pokemon_getattr + cmp r10, r0 + bne _081B65EE + movs r1, 0 + mov r8, r1 +_081B65EE: + ldr r4, =0x0203cec8 + ldrb r0, [r4, 0x9] + adds r1, r6, 0 + movs r2, 0 + bl ExecuteTableBasedItemEffect__ + lsls r0, 24 + cmp r0, 0 + beq _081B6624 +_081B6600: + ldr r1, =0x0203cee8 + movs r0, 0 + strb r0, [r1] + movs r0, 0x5 + bl audio_play + ldr r0, =gUnknown_085E96F6 + b _081B66F4 + .pool +_081B6624: + ldr r1, =0x0203cee8 + movs r0, 0x1 + strb r0, [r1] + adds r0, r6, 0 + bl IsBlueYellowRedFlute + lsls r0, 24 + cmp r0, 0 + bne _081B6650 + movs r0, 0x1 + bl audio_play + ldrb r0, [r4, 0xB] + cmp r0, 0xE + beq _081B6656 + adds r0, r6, 0 + movs r1, 0x1 + bl remove_item + b _081B6656 + .pool +_081B6650: + movs r0, 0x75 + bl audio_play +_081B6656: + ldr r4, =0x0203cedc + ldr r7, =0x0203cec8 + 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, =0x02020630 + 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 pokemon_getattr + 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, =0x02021cc4 + adds r0, r5, 0 + bl GetMonNickname + adds r0, r6, 0 + bl GetMedicineItemEffectMessage + ldr r0, =0x02021fc4 +_081B66F4: + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =0x03005e00 + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02021cc4 + bl GetMonNickname + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E9C17 + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x03005e00 + 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, =0x0203cee8 + ldrb r1, [r0] + cmp r1, 0 + bne _081B67B4 + ldr r0, =0x0203cec4 + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r4, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + ldr r0, =0x0203ce7c + ldrh r6, [r0] + adds r0, r6, 0 + bl GetItemEffectType + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r5, 0 + movs r1, 0x20 + bl pokemon_getattr + 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 pokemon_getattr + 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, =0x0203cee8 + movs r0, 0 + strb r0, [r1] + movs r0, 0x5 + bl audio_play + ldr r0, =gUnknown_085E96F6 + b _081B68E2 + .pool +_081B6874: + ldr r1, =0x0203cee8 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x1 + bl audio_play + adds r0, r6, 0 + movs r1, 0x1 + bl remove_item + ldr r1, =0x02021cc4 + adds r0, r5, 0 + bl GetMonNickname + ldr r1, =0x02021dc4 + 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, =0x02021fc4 + ldr r1, =gUnknown_085E9D45 + bl ExpandStringRefs + b _081B68E0 + .pool +_081B68C4: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E9D90 + bl ExpandStringRefs + b _081B68E0 + .pool +_081B68D8: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E9D6D + bl ExpandStringRefs +_081B68E0: + ldr r0, =0x02021fc4 +_081B68E2: + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =0x03005e00 + 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 pokemon_getattr + 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 pokemon_getattr + 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 CopyString + b _081B6A08 + .pool +_081B6A00: + ldr r1, =gUnknown_085E96EE + adds r0, r2, 0 + bl CopyString +_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, =0x020244ec + mov r9, r0 +_081B6A40: + adds r1, r5, 0 + adds r1, 0xD + mov r0, r8 + add r0, r9 + bl pokemon_getattr + 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 audio_play + adds r0, r4, 0 + bl sub_81B6BB4 + b _081B6AF0 +_081B6AE0: + ldr r0, =0x0203cec4 + 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, =0x0203ce7c + ldrh r0, [r0] + cmp r0, 0xAF + bne _081B6B20 + ldr r0, =0x03005d8c + 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, =0x0203cec8 + strh r1, [r0, 0xE] + adds r0, r4, 0 + bl ether_effect_related + b _081B6B6E + .pool +_081B6B4C: + movs r0, 0x5 + bl audio_play + movs r0, 0x16 + bl display_pokemon_menu_message + ldr r0, =0x0203cec8 + ldrb r0, [r0, 0x9] + bl sub_81B6A10 + ldr r1, =0x03005e00 + 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, =0x0203cec4 + ldr r0, [r0] + adds r0, 0xC + bl sub_81B302C + bl GetMenuCursorPos + ldr r1, =0x0203cec8 + 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, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =sub_81B1370 + str r0, [r1] + ldr r0, =0x0203cec4 + 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, =0x0203ced6 + ldr r0, =0x0203ce7c + 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, =0x0203cee8 + strb r4, [r0] + movs r0, 0x5 + bl audio_play + ldr r0, =gUnknown_085E96F6 + b _081B6C7E + .pool +_081B6C34: + ldr r1, =0x0203cee8 + 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, =0x020244ec + adds r4, r0 + movs r0, 0x1 + bl audio_play + adds r0, r5, 0 + movs r1, 0x1 + bl remove_item + movs r0, 0 + ldrsh r1, [r7, r0] + adds r1, 0xD + adds r0, r4, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x02021cc4 + movs r1, 0xD + muls r1, r4 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + adds r0, r5, 0 + bl GetMedicineItemEffectMessage + ldr r0, =0x02021fc4 +_081B6C7E: + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =0x03005e00 + 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 audio_play + movs r0, 0x17 + bl display_pokemon_menu_message + ldr r0, =0x0203cec8 + ldrb r0, [r0, 0x9] + bl sub_81B6A10 + ldr r1, =0x03005e00 + 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 pokemon_getattr + 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, =0x02021fc4 + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x03005e00 + 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 audio_play + ldr r7, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r7, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + movs r0, 0xE + adds r0, r7 + mov r8, r0 + ldr r0, =0x0203ce7c + ldrh r4, [r0] + ldr r1, =0x02021cc4 + adds r0, r5, 0 + bl GetMonNickname + adds r0, r4, 0 + bl ItemIdToBattleMoveId + strh r0, [r7, 0xE] + ldr r0, =0x02021dc4 + movs r1, 0xE + ldrsh r2, [r7, r1] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + 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, =0x03005e00 + 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, =0x03005e00 + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r2, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + adds r6, r2, 0 + adds r6, 0xE + ldr r0, =0x0203ce7c + 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 remove_item +_081B6EF0: + ldr r1, =0x02021cc4 + adds r0, r5, 0 + bl GetMonNickname + ldr r0, =0x02021dc4 + movs r1, 0 + ldrsh r2, [r6, r1] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E9AA5 + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =0x03005e00 + 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 fanfare_play + ldr r1, =0x03005e00 + 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 task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + beq _081B6FEA + ldr r0, =0x030022c0 + 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, =0x0203cec8 + 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, =0x020375f0 + 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, =0x03005e00 + 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, =0x03005e00 + 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 audio_play +_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, =0x0203cec4 + 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, =0x020244ec + ldr r4, =0x0203cec8 + ldrb r1, [r4, 0x9] + ldr r2, =0x020244e9 + 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, =0x0203cec8 + 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, =0x02037fd4 + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + adds r5, r1, 0 + muls r5, r0 + ldr r0, =0x020244ec + adds r5, r0 + bl sub_81C1B94 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r1, 0xD + adds r0, r5, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r1, =0x02021cc4 + adds r0, r5, 0 + bl GetMonNickname + ldr r0, =0x02021dc4 + movs r1, 0xD + muls r1, r4 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + ldr r0, =gUnknown_085E9BB8 + bl sub_81B6D74 + ldr r1, =0x03005e00 + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r5, r1] + movs r0, 0x64 + adds r4, r1, 0 + muls r4, r0 + ldr r0, =0x020244ec + 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, =0x02021dc4 + ldr r1, =0x0203cec8 + movs r3, 0xE + ldrsh r2, [r1, r3] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E9B5D + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =0x03005e00 + 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, =0x03005e00 + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r7, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + 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, =0x02021cc4 + adds r0, r4, 0 + bl GetMonNickname + ldr r0, =0x02021dc4 + movs r1, 0xE + ldrsh r2, [r7, r1] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E9B76 + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r3, 0x10 + ldrsh r0, [r7, r3] + cmp r0, 0x1 + bne _081B7368 + ldr r0, =0x03005e00 + 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, =0x020375f0 + strh r5, [r0] +_081B7370: + ldr r0, =0x03005e00 + 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 audio_play +_081B7392: + ldr r1, =0x02021cc4 + adds r0, r4, 0 + bl GetMonNickname + ldr r0, =0x02021dc4 + ldr r1, =0x0203cec8 + movs r3, 0xE + ldrsh r2, [r1, r3] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + ldr r0, =gUnknown_085E9AE9 + bl sub_81B6D74 + ldr r1, =0x03005e00 + 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, =0x0203cec8 + mov r9, r0 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + ldr r0, =0x0203cec4 + ldr r6, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r4, r6, r1 + ldr r2, =0x0203ce7c + mov r8, r2 + adds r0, r5, 0 + movs r1, 0x38 + bl pokemon_getattr + 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 audio_play + cmp r4, 0 + beq _081B74B4 + ldr r1, =0x0203cee8 + 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, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + mov r1, r10 + b _081B7516 + .pool +_081B74B4: + ldr r1, =0x0203cee8 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0 + bl pause_music_for_sound_maybe + ldr r0, =0x0203cec8 + ldrb r0, [r0, 0x9] + adds r1, r5, 0 + bl sub_81B754C + ldr r0, =0x0203ce7c + ldrh r0, [r0] + movs r1, 0x1 + bl remove_item + ldr r1, =0x02021cc4 + adds r0, r5, 0 + bl GetMonNickname + ldr r4, =0x02021dc4 + adds r0, r5, 0 + movs r1, 0x38 + bl pokemon_getattr + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E9D0A + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0x1 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =0x03005e00 + 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, =0x0203cedc + 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, =0x02020630 + 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 ducking_tick + lsls r0, 24 + cmp r0, 0 + beq _081B7620 + bl sub_81B1BD4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _081B7620 + ldr r0, =0x030022c0 + 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 audio_play + adds r0, r4, 0 + bl sub_81B767C + ldr r0, =0x03005e00 + 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, =0x030022c0 + 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 audio_play + adds r0, r4, 0 + bl sub_81B76C8 + ldr r0, =0x03005e00 + 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, =0x0203cec4 + 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, =0x0203cec4 + 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 ducking_tick + lsls r0, 24 + cmp r0, 0 + beq _081B77A6 + ldr r0, =0x030022c0 + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r4, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + 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, =0x03005e00 + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + 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, =0x030061e8 + 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, =0x03005e00 + 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, =0x0203cec8 + mov r8, r0 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02021cc4 + bl GetMonNickname + ldr r0, =0x02021dc4 + ldr r6, =0x020244e2 + ldrh r2, [r6] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E9AE9 + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x03005e00 + 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, =0x0203cec8 + mov r8, r0 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02021cc4 + bl GetMonNickname + ldr r0, =0x02021dc4 + movs r1, 0xD + muls r1, r5 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E9AA5 + adds r0, r4, 0 + bl ExpandStringRefs + 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, =0x03005e00 + 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 pokemon_getattr + strh r0, [r5] + adds r0, r4, 0 + movs r1, 0x3B + bl pokemon_getattr + strh r0, [r5, 0x2] + adds r0, r4, 0 + movs r1, 0x3C + bl pokemon_getattr + strh r0, [r5, 0x4] + adds r0, r4, 0 + movs r1, 0x3E + bl pokemon_getattr + strh r0, [r5, 0x8] + adds r0, r4, 0 + movs r1, 0x3F + bl pokemon_getattr + strh r0, [r5, 0xA] + adds r0, r4, 0 + movs r1, 0x3D + bl pokemon_getattr + 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, =0x0203cec4 + 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, =0x0203cec8 + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B7A6E + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + ldrb r0, [r6, 0x9] + ldr r1, =0x0203ce7c + ldrh r1, [r1] + movs r2, 0 + bl ExecuteTableBasedItemEffect__ + lsls r0, 24 + cmp r0, 0 + beq _081B7A94 +_081B7A6E: + ldr r0, =0x03005e00 + 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 audio_play + ldr r4, =0x0203cedc + 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, =0x02020630 + 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, =0x0203cec4 + 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 pokemon_getattr + 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, =0x0203cec4 + ldr r2, [r5] + movs r0, 0x86 + lsls r0, 2 + adds r1, r2, r0 + movs r3, 0 + ldrsh r0, [r1, r3] + ldr r3, =0x0203cec8 + 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, =0x0203cee8 + 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, =0x0203cee8 + movs r0, 0x1 + strb r0, [r1] + ldr r0, =0x0203ce7c + ldrh r0, [r0] + movs r1, 0x1 + bl remove_item +_081B7BD8: + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81B6794 + str r1, [r0] + ldr r1, =0x0203cec8 + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x02021cc4 + bl GetMonNickname + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E9C17 + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r4, 0 + movs r1, 0 + bl sub_81B1B5C + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + ldr r1, =0x03005e00 + 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 audio_play + ldr r2, =0x030061e8 + ldr r1, =0x0203cec8 + ldr r0, [r1] + str r0, [r2] + ldrb r0, [r1, 0x9] + ldr r4, =0x0203ce7c + ldrh r1, [r4] + movs r2, 0 + bl ExecuteTableBasedItemEffect__ + lsls r0, 24 + cmp r0, 0 + beq _081B7CD8 + ldr r1, =0x0203cee8 + 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, =0x03005e00 + 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 remove_item + 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, =0x03005d8c + 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, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B7F1C + ldr r7, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r7, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + movs r0, 0xE + adds r0, r7 + mov r8, r0 + ldr r1, =0x02021cc4 + adds r0, r5, 0 + bl GetMonNickname + ldr r4, =0x020375e2 + ldrb r0, [r4] + bl sub_81B2360 + strh r0, [r7, 0xE] + ldr r0, =0x02021dc4 + movs r1, 0xE + ldrsh r2, [r7, r1] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + 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, =0x03005e00 + 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, =0x0203cec8 + ldr r0, =0x0203ce7c + 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, =0x0203cefc + ldr r0, =0x0203cec8 + 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, =0x020244ec + adds r0, r7 + movs r1, 0xC + bl pokemon_getattr + 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, =0x03005e00 + 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, =0x0203cec8 + 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, =0x0203cec4 + 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, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B80E4 + ldr r4, =0x0203cec8 + 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, =0x020244ec + 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, =0x03005e00 + 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, =0x0203cec8 + 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, =0x020244ec + adds r0, r1 + ldr r1, =0x0203cedc + 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, =0x0203cec8 + movs r0, 0x9 + ldrsb r0, [r4, r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + 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 pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005d8c + 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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r6, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0xC + bl pokemon_getattr + lsls r0, 16 + lsrs r7, r0, 16 + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0 + bne _081B8208 + adds r0, r5, 0 + bl sub_80D4680 + ldr r4, =0x0203cefc + adds r0, r5, 0 + movs r1, 0xC + adds r2, r4, 0 + bl pokemon_setattr + ldrh r0, [r4] + movs r1, 0x1 + bl remove_item + 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, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _081B828A + ldr r1, =0x0203cefc + ldrh r0, [r1] + cmp r0, 0 + beq _081B8264 + ldr r0, =0x0203cec8 + ldrh r0, [r0, 0xC] + ldrh r1, [r1] + movs r2, 0 + bl sub_81B1D68 + b _081B827C + .pool +_081B8264: + ldr r2, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r2, r1] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldrh r1, [r2, 0xC] + movs r2, 0 + movs r3, 0x1 + bl sub_81B1C84 +_081B827C: + ldr r0, =0x03005e00 + 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, =0x03005e00 + 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, =0x0203cec8 + ldrh r4, [r7, 0xC] + adds r0, r4, 0 + bl sub_81B83F0 + ldr r6, =0x0203cefc + ldrh r0, [r6] + movs r1, 0x1 + bl bag_add_item + 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, =0x02021fc4 + 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, =0x0203cec4 + 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, =0x020244ec + 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, =0x03005e00 + 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 audio_play +_081B839A: + ldr r0, =0x03005e00 + 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, =0x03005e00 + 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, =0x0203cec8 + 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 remove_item +_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, =0x0203cec8 + 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 bag_add_item +_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, =0x0203cec8 + movs r1, 0x9 + ldrsb r1, [r0, r1] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + ldr r1, =0x0203cee8 + movs r0, 0 + strb r0, [r1] + ldr r2, =0x03005d8c + ldr r0, =0x0203bcb8 + 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 pokemon_getattr + 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, =0x03005e00 + 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, =0x030022c0 + 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, =0x0203cec8 + 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, =0x0203cef8 + 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, =0x020244ec + 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 pokemon_getattr + cmp r0, 0 + bne _081B8608 + adds r0, r5, 0 + movs r1, 0x38 + bl pokemon_getattr + adds r4, r0, 0 + bl sub_81B8888 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bhi _081B8608 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, =0x0000191a + cmp r1, r0 + bne _081B85EA + adds r0, r5, 0 + movs r1, 0xC + bl pokemon_getattr + 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 pokemon_getattr + cmp r0, 0 + bne _081B864A +_081B8608: + movs r0, 0 + b _081B864C + .pool +_081B8618: + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + 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, =0x0203cef8 + 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, =0x02021cc4 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalString + 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, =0x0203cef8 + adds r4, r3, r5 + ldrb r0, [r4] + movs r1, 0x64 + muls r0, r1 + subs r0, 0x64 + ldr r3, =0x020244ec + adds r0, r3, r0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + ldrb r0, [r4] + movs r1, 0x64 + muls r0, r1 + subs r0, 0x64 + ldr r3, =0x020244ec + adds r0, r3, r0 + movs r1, 0xC + bl pokemon_getattr + 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, =0x0203cef8 + adds r5, r0, r4 + ldrb r0, [r5] + muls r0, r7 + subs r0, 0x64 + ldr r1, =0x020244ec + adds r0, r1, r0 + movs r1, 0xB + bl pokemon_getattr + cmp r10, r0 + beq _081B86B8 + cmp r6, 0 + beq _081B873E + ldrb r0, [r5] + muls r0, r7 + subs r0, 0x64 + ldr r3, =0x020244ec + adds r0, r3, r0 + movs r1, 0xC + bl pokemon_getattr + 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, =0x0203cef8 +_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 audio_play + adds r0, r4, 0 + bl display_pokemon_menu_message + ldr r0, =0x03005e00 + 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 audio_play + 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, =0x030022c0 + 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 audio_play + movs r0, 0 + bl display_pokemon_menu_message + ldr r0, =0x03005e00 + 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, =0x020375e2 + 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, =0x020375e2 + 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, =0x020375e0 + 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, =0x020375e2 + 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, =0x02024550 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _081B8A74 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _081B8A74 + ldr r0, =0x0203cec8 + ldrb r0, [r0, 0xB] + cmp r0, 0x1 + bne _081B8A5C + movs r0, 0x3 + b _081B8A76 + .pool +_081B8A5C: + ldr r0, =0x02022fec + 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, =0x02021cc4 + bl sub_806EBF8 + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E97B2 + b _081B8C42 + .pool +_081B8AC4: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + bne _081B8AF8 + ldr r1, =0x02021cc4 + adds r0, r4, 0 + bl GetMonNickname + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E978F + b _081B8C42 + .pool +_081B8AF8: + movs r4, 0 + b _081B8B24 +_081B8AFC: + adds r0, r4, 0 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _081B8B1E + adds r0, r5, 0 + bl sub_81B8F38 + lsls r0, 24 + ldr r2, =0x0202406e + 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, =0x0202406c + ldrb r0, [r0] + cmp r4, r0 + bcc _081B8AFC + movs r7, 0x64 + adds r0, r5, 0 + muls r0, r7 + ldr r1, =0x020244ec + mov r8, r1 + adds r6, r0, r1 + adds r0, r6, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + beq _081B8B60 + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E97E5 + b _081B8C42 + .pool +_081B8B60: + adds r0, r5, 0 + bl sub_81B8F38 + ldr r1, =0x0202449c + ldr r1, [r1] + adds r1, 0x8B + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bne _081B8B94 + ldr r1, =0x02021cc4 + adds r0, r6, 0 + bl GetMonNickname + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E976F + b _081B8C42 + .pool +_081B8B94: + ldr r0, =0x0203cec8 + 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, =0x0203cee9 + strb r0, [r1] + ldr r1, =0x0203cee8 + movs r0, 0x1 + strb r0, [r1] + ldr r1, =0x0202406e + ldr r0, =0x020244b8 + 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, =0x020244ec + adds r0, r1 + ldr r1, =0x02021cc4 + bl GetMonNickname + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E9754 + b _081B8C42 + .pool +_081B8C20: + ldr r0, =0x020244b8 + ldrb r0, [r0] + ldr r1, =0x0202406e + 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, =0x02021cc4 + bl GetMonNickname + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E9738 +_081B8C42: + bl ExpandStringRefs +_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, =0x0203cf00 + 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 battle_get_side_with_given_state + mov r2, sp + ldr r1, =0x0202406e + 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 battle_get_side_with_given_state + mov r1, sp + ldr r4, =0x0202406e + lsls r0, 24 + lsrs r0, 23 + adds r0, r4 + ldrh r0, [r0] + strb r0, [r1] + movs r0, 0x2 + bl battle_get_side_with_given_state + 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, =0x0202449c + 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 battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _081B8DB0 + movs r0, 0 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x2 + b _081B8DBC +_081B8DB0: + movs r0, 0x1 + bl battle_get_side_with_given_state + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x3 +_081B8DBC: + bl battle_get_side_with_given_state + 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, =0x0202406e + 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, =0x0202406e + 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, =0x0202449c + 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, =0x0203cf00 + adds r0, r2, r0 + ldrb r0, [r0] + movs r1, 0xF + ands r1, r0 + b _081B8F60 + .pool +_081B8F58: + ldr r0, =0x0203cf00 + 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, =0x0203cf00 + 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, =0x0203cf00 + 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, =0x0203cf00 +_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, =0x020244ec + 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, =0x020244ec + 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, =0x020244ec + 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, =0x020244ec + 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, =0x020244ec + 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 pokemon_getattr + cmp r0, 0 + beq _081B912C + adds r0, r5, 0 + movs r1, 0x39 + bl pokemon_getattr + 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, =0x030022c0 + 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, =0x03005e00 + 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, =0x03005e08 + adds r4, r0, r1 + ldr r0, =0x02037fd4 + 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, =0x02022ff8 +_081B91E8: + subs r0, r4, 0x3 + lsls r0, 5 + adds r0, r7 + ldrh r0, [r0] + cmp r0, 0 + beq _081B9204 + ldr r0, =0x0203cedc + 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 audio_play + ldr r0, =0x03005e00 + 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, =0x03005e08 + 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, =0x02020630 + 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, =0x03005e08 + adds r5, r1, r0 + movs r6, 0x3 + ldr r7, =0x0203cedc +_081B92A8: + ldr r0, =0x02022ff8 + 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, =0x03005db0 + 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, =0x020375e0 + 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, =0x03005db0 + 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, =0x02037fd4 + 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, =0x02039f24 + strb r0, [r2] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bls _081B9486 + movs r0, 0xFF + strb r0, [r2] +_081B9486: + ldr r1, =0x020375e0 + ldrb r0, [r2] + strh r0, [r1] + ldr r1, =0x03005db0 + 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, =0x02037fd4 + 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, =0x02037fd4 + 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, =0x020375e0 + 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, =0x020375e2 + ldrh r1, [r5] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + bl sub_806E25C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] +_081B95BA: + ldr r0, =0x03005db0 + 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, =0x020375f0 + 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, =0x020244ec + adds r0, r1 + movs r1, 0xC + bl pokemon_getattr + 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, =0x02037fd4 + 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, =0x020244ec + ldr r0, =0x020375e0 + ldrb r2, [r0] + ldr r0, =0x020244e9 + 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, =0x03005dac + 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, =0x020375f0 + movs r0, 0 + strh r0, [r1] + movs r4, 0 + adds r5, r1, 0 +_081B96DC: + ldr r0, =0x020375e0 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + adds r1, r4, 0 + adds r1, 0xD + bl pokemon_getattr + 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, =0x020375e0 + ldrh r1, [r0] + movs r0, 0x64 + adds r5, r1, 0 + muls r5, r0 + ldr r0, =0x020244ec + adds r5, r0 + ldr r0, =0x020375e2 + ldrh r1, [r0] + adds r1, 0xD + adds r0, r5, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r1, =0x02021cc4 + adds r0, r5, 0 + bl GetMonNickname + ldr r0, =0x02021dc4 + movs r1, 0xD + muls r1, r4 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + 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, =0x020375e0 + mov r8, r0 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + ldr r4, =0x020375e2 + 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, =0x020375e0 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + 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 pokemon_getattr + add r7, sp, 0x4 + mov r10, r7 + strb r0, [r7] + mov r0, r8 + movs r1, 0x15 + bl pokemon_getattr + 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 pokemon_setattr + mov r0, r8 + ldr r1, [sp, 0xC] + ldr r2, [sp, 0x14] + bl pokemon_setattr + mov r0, r8 + ldr r1, [sp, 0x10] + mov r2, r10 + bl pokemon_setattr + mov r0, r8 + ldr r1, [sp, 0x1C] + ldr r2, [sp, 0x18] + bl pokemon_setattr + mov r0, r8 + movs r1, 0x15 + adds r2, r6, 0 + bl pokemon_setattr + 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, =0x020375e0 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2D + bl pokemon_getattr + adds r1, r0, 0 + cmp r1, 0 + beq _081B990C + ldr r1, =0x020375f0 + movs r0, 0x1 + strh r0, [r1] + b _081B9910 + .pool +_081B990C: + ldr r0, =0x020375f0 + 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, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x020375e0 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =0x020375e2 + ldrh r1, [r1] + adds r1, 0xD + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r0, 0x39 + bne _081B999C + movs r6, 0 + b _081B9980 + .pool +_081B9958: + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r6, r0 + beq _081B997E + movs r4, 0 + movs r0, 0x64 + adds r5, r6, 0 + muls r5, r0 + ldr r7, =0x020244ec +_081B996A: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r5, r7 + bl pokemon_getattr + 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, =0x020375f0 + 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, =0x020375e0 + 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, =0x03005d90 + 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, =0x03005d8c + 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, =0x020375f0 + ldr r0, =0x03005d90 + 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, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x020375e4 + 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, =0x02038bca + bl GenerateRandomNumber + 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, =0x02038bca + ldrh r1, [r3] + ldr r0, =0x0000012b + cmp r1, r0 + bhi _081B9AAC + ldr r2, =0x0203bc88 + 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, =0x03005d90 + ldr r0, [r4] + ldr r1, =0x020375e2 + 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, =0x03005d90 + ldr r4, [r0] + ldr r5, =gUnknown_086160D4 + bl GenerateRandomNumber + 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, =0x03005d90 + ldr r0, [r4] + ldr r1, =0x00000e6a + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl bag_add_item + 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, =0x02021cc4 + bl itemid_get_name + ldr r0, [r4] + ldr r1, =0x00000e6a + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x020375f0 + strh r5, [r0] + b _081B9B76 + .pool +_081B9B70: + ldr r1, =0x020375f0 + 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, =0x020375e0 + 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, =0x03005d90 + 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, =0x03005d8c + 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, =0x020375f0 + ldr r0, =0x03005d90 + 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, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x020375e4 + 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, =0x03005d90 + ldr r0, [r4] + ldr r1, =0x020375e2 + 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, =0x03005d90 + ldr r4, [r0] + ldr r5, =gUnknown_086160F4 + bl GenerateRandomNumber + 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, =0x03005d90 + ldr r0, [r4] + ldr r1, =0x00000e6c + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl bag_add_item + 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, =0x02021cc4 + bl itemid_get_name + ldr r0, [r4] + ldr r1, =0x00000e6c + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x020375f0 + strh r5, [r0] + b _081B9CE6 + .pool +_081B9CE0: + ldr r1, =0x020375f0 + 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, =0x02021cc4 + ldr r1, =0x02038bca + 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, =0x020375e0 + 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, =0x03005d90 + 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, =0x03005d8c + 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, =0x020375f0 + ldr r0, =0x03005d90 + 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, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x020375e4 + 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, =0x03005d90 + ldr r0, [r4] + ldr r1, =0x020375e2 + 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, =0x03005d90 + ldr r4, [r0] + ldr r5, =gUnknown_08616120 + bl GenerateRandomNumber + 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, =0x03005d90 + ldr r0, [r4] + ldr r1, =0x00000e6e + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x1 + bl bag_add_item + 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, =0x02021cc4 + bl itemid_get_name + ldr r0, [r4] + ldr r1, =0x00000e6e + adds r0, r1 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x020375f0 + strh r5, [r0] + b _081B9E6E + .pool +_081B9E68: + ldr r1, =0x020375f0 + 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, =0x02037318 + 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, =0x0203bc88 + 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, =0x0203bc8c + 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 GenerateRandomNumber + 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, =0x0203bc8c + 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, =0x0203bc8c + 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, =0x03005d90 + 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, =0x0203bc8c + 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, =0x0203bc88 + ldr r0, =gSlateportBattleTentTrainers + str r0, [r1] + ldr r1, =0x0203bc8c + ldr r0, =gSlateportBattleTentMons + str r0, [r1] + ldr r7, =0x03005d90 + ldr r1, =0x0000ffff + mov r8, r1 +_081BA062: + mov r2, r10 + lsls r6, r2, 1 +_081BA066: + bl GenerateRandomNumber + 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, =0x03005d90 + 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, =0x02038bca + strh r3, [r2] + ldrh r3, [r2] + ldr r4, =0x0203bc88 + 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, =0x03005d90 + 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, =0x03001298 + mov r8, sp +_081BA13E: + bl GenerateRandomNumber + 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, =0x0203bc8c + ldr r3, [r4] + lsls r0, 4 + adds r0, r3 + ldr r1, =0x03005d90 + 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, =0x03001298 + ldr r3, =0x0203bc8c + 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, =0x03001298 + ldrh r0, [r1] + ldr r6, =0x0203bc8c + 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, =0x0203bc8c + 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, =0x03006298 + 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, =0x030022c0 + 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, =0x03003014 + 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, =0x03003014 + 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, =0x03002f80 + 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, =0x03002f90 + 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, =0x03002f80 + 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, =0x03005d90 + 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 mplay_has_finished_maybe + 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, =0x03002f90 + 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/rotating_gate.s b/asm/rotating_gate.s new file mode 100644 index 000000000..581ad7abf --- /dev/null +++ b/asm/rotating_gate.s @@ -0,0 +1,1152 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start GetCurrentMapRotatingGatePuzzleType +GetCurrentMapRotatingGatePuzzleType: @ 80FB7E8 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0x86 + lsls r0, 1 + cmp r1, r0 + bne _080FB800 + movs r0, 0x1 + b _080FB812 + .pool +_080FB800: + ldr r0, =0x0000081d + cmp r1, r0 + beq _080FB810 + movs r0, 0 + b _080FB812 + .pool +_080FB810: + movs r0, 0x2 +_080FB812: + pop {r1} + bx r1 + thumb_func_end GetCurrentMapRotatingGatePuzzleType + + thumb_func_start sub_80FB818 +sub_80FB818: @ 80FB818 + push {r4-r6,lr} + movs r0, 0x80 + lsls r0, 7 + bl GetVarPointer + adds r5, r0, 0 + movs r3, 0 + ldr r4, =0x0203a048 + ldrb r0, [r4] + cmp r3, r0 + bge _080FB844 + ldr r6, =0x0203a044 +_080FB830: + adds r2, r5, r3 + ldr r1, [r6] + lsls r0, r3, 3 + adds r0, r1 + ldrb r0, [r0, 0x5] + strb r0, [r2] + adds r3, 0x1 + ldrb r0, [r4] + cmp r3, r0 + blt _080FB830 +_080FB844: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FB818 + + thumb_func_start sub_80FB854 +sub_80FB854: @ 80FB854 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x80 + lsls r0, 7 + bl GetVarPointer + adds r0, r4 + ldrb r0, [r0] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80FB854 + + thumb_func_start sub_80FB870 +sub_80FB870: @ 80FB870 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x80 + lsls r0, 7 + bl GetVarPointer + adds r0, r4 + strb r5, [r0] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80FB870 + + thumb_func_start sub_80FB890 +sub_80FB890: @ 80FB890 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl sub_80FB854 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r4, 0x1 + bne _080FB8B4 + cmp r1, 0 + beq _080FB8B0 + subs r0, r1, 0x1 + lsls r0, 24 + b _080FB8BE +_080FB8B0: + movs r1, 0x3 + b _080FB8C0 +_080FB8B4: + adds r1, 0x1 + lsls r1, 24 + movs r0, 0xC0 + lsls r0, 18 + ands r0, r1 +_080FB8BE: + lsrs r1, r0, 24 +_080FB8C0: + adds r0, r5, 0 + bl sub_80FB870 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80FB890 + + thumb_func_start sub_80FB8CC +sub_80FB8CC: @ 80FB8CC + push {lr} + bl GetCurrentMapRotatingGatePuzzleType + cmp r0, 0x1 + beq _080FB8E0 + cmp r0, 0x1 + ble _080FB914 + cmp r0, 0x2 + beq _080FB8F8 + b _080FB914 +_080FB8E0: + ldr r1, =0x0203a044 + ldr r0, =gUnknown_0858E8B0 + str r0, [r1] + ldr r1, =0x0203a048 + movs r0, 0x8 + b _080FB902 + .pool +_080FB8F8: + ldr r1, =0x0203a044 + ldr r0, =gUnknown_0858E8F0 + str r0, [r1] + ldr r1, =0x0203a048 + movs r0, 0xB +_080FB902: + strb r0, [r1] + movs r1, 0 + ldr r3, =0x0203a038 + movs r2, 0x40 +_080FB90A: + adds r0, r1, r3 + strb r2, [r0] + adds r1, 0x1 + cmp r1, 0xA + bls _080FB90A +_080FB914: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FB8CC + + thumb_func_start sub_80FB928 +sub_80FB928: @ 80FB928 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + ldr r0, =0x03005d8c + ldr r2, [r0] + ldrh r1, [r2] + subs r0, r1, 0x2 + lsls r0, 16 + lsrs r3, r0, 16 + adds r1, 0x11 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + ldrh r1, [r2, 0x2] + subs r0, r1, 0x2 + lsls r0, 16 + lsrs r2, r0, 16 + adds r1, 0xE + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + movs r5, 0 + ldr r0, =0x0203a048 + ldrb r0, [r0] + cmp r5, r0 + bcs _080FB9DA + lsls r0, r2, 16 + asrs r7, r0, 16 + lsls r0, r3, 16 + asrs r6, r0, 16 +_080FB976: + ldr r0, =0x0203a044 + ldr r0, [r0] + lsls r1, r5, 3 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x7 + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r0, [r1, 0x2] + adds r0, 0x7 + lsls r0, 16 + asrs r1, r0, 16 + cmp r7, r1 + bgt _080FB9CC + mov r3, r8 + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, r1 + blt _080FB9CC + lsls r0, r2, 16 + asrs r1, r0, 16 + cmp r6, r1 + bgt _080FB9CC + mov r2, r9 + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, r1 + blt _080FB9CC + ldr r0, =0x0203a038 + adds r4, r5, r0 + ldrb r0, [r4] + cmp r0, 0x40 + bne _080FB9CC + ldr r3, [sp] + lsls r1, r3, 16 + mov r0, r10 + lsls r2, r0, 16 + adds r0, r5, 0 + asrs r1, 16 + asrs r2, 16 + bl sub_80FB9FC + strb r0, [r4] +_080FB9CC: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x0203a048 + ldrb r0, [r0] + cmp r5, r0 + bcc _080FB976 +_080FB9DA: + 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_80FB928 + + thumb_func_start sub_80FB9FC +sub_80FB9FC: @ 80FB9FC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + ldr r0, =0x0203a044 + lsls r1, r6, 3 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r0, [r4, 0x4] + cmp r0, 0 + beq _080FBA24 + cmp r0, 0x4 + bne _080FBA34 +_080FBA24: + mov r1, sp + ldr r0, =gUnknown_08591FE0 + b _080FBA38 + .pool +_080FBA34: + mov r1, sp + ldr r0, =gUnknown_08591FC8 +_080FBA38: + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + mov r2, sp + ldrb r0, [r4, 0x4] + movs r3, 0x98 + lsls r3, 5 + adds r1, r3, 0 + adds r0, r1 + strh r0, [r2] + mov r0, sp + movs r1, 0 + movs r2, 0 + movs r3, 0x94 + bl AddObjectToFront + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x40 + beq _080FBAD4 + ldrh r0, [r4] + adds r0, 0x7 + ldrh r1, [r4, 0x2] + adds r1, 0x7 + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + ldr r2, =0x02020630 + adds r4, r2 + strh r6, [r4, 0x2E] + movs r2, 0x3E + adds r2, r4 + mov r12, r2 + ldrb r2, [r2] + movs r3, 0x2 + orrs r2, r3 + mov r3, r12 + strb r2, [r3] + lsls r0, 16 + asrs r0, 16 + lsls r2, r7, 16 + asrs r2, 16 + adds r0, r2 + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + mov r3, r8 + lsls r2, r3, 16 + asrs r2, 16 + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + adds r2, r4, 0 + adds r2, 0x20 + adds r3, r4, 0 + adds r3, 0x22 + bl sub_8092FF0 + adds r0, r4, 0 + bl sub_80FBB64 + adds r0, r6, 0 + bl sub_80FB854 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectRotScalAnim + adds r0, r5, 0 + b _080FBAD6 + .pool +_080FBAD4: + movs r0, 0x40 +_080FBAD6: + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80FB9FC + + thumb_func_start sub_80FBAE4 +sub_80FBAE4: @ 80FBAE4 + push {r4-r7,lr} + adds r6, r0, 0 + ldrh r0, [r6, 0x30] + lsls r0, 24 + lsrs r5, r0, 24 + ldrh r0, [r6, 0x32] + lsls r0, 24 + lsrs r4, r0, 24 + adds r7, r4, 0 + adds r0, r6, 0 + bl sub_80FBB64 + cmp r5, 0x1 + bne _080FBB2A + adds r0, r4, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_811A138 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + beq _080FBB1A + adds r0, r4, 0 + adds r0, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 +_080FBB1A: + movs r0, 0x30 + bl audio_play + adds r0, r6, 0 + adds r1, r4, 0 + bl StartObjectRotScalAnim + b _080FBB58 +_080FBB2A: + cmp r5, 0x2 + bne _080FBB58 + adds r0, r7, 0 + adds r0, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_811A138 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + beq _080FBB4A + adds r0, r4, 0 + adds r0, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 +_080FBB4A: + movs r0, 0x30 + bl audio_play + adds r0, r6, 0 + adds r1, r4, 0 + bl StartObjectRotScalAnim +_080FBB58: + movs r0, 0 + strh r0, [r6, 0x30] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80FBAE4 + + thumb_func_start sub_80FBB64 +sub_80FBB64: @ 80FBB64 + push {r4-r6,lr} + mov r12, r0 + mov r4, r12 + adds r4, 0x3E + ldrb r0, [r4] + movs r5, 0x5 + negs r5, r5 + ands r5, r0 + strb r5, [r4] + mov r0, r12 + ldrh r1, [r0, 0x24] + ldrh r2, [r0, 0x20] + adds r1, r2 + adds r0, 0x28 + movs r2, 0 + ldrsb r2, [r0, r2] + ldr r0, =0x02021bbc + adds r2, r1 + ldrh r0, [r0] + adds r2, r0 + lsls r2, 16 + mov r3, r12 + ldrh r1, [r3, 0x26] + ldrh r0, [r3, 0x22] + adds r1, r0 + mov r0, r12 + adds r0, 0x29 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldr r3, =0x02021bbe + adds r0, r1 + ldrh r3, [r3] + adds r0, r3 + lsls r0, 16 + movs r3, 0x80 + lsls r3, 15 + adds r1, r2, r3 + lsrs r1, 16 + lsrs r6, r0, 16 + adds r0, r3 + lsrs r3, r0, 16 + asrs r2, 16 + cmp r2, 0xFF + bgt _080FBBCA + lsls r0, r1, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bge _080FBBD2 +_080FBBCA: + movs r1, 0x4 + adds r0, r5, 0 + orrs r0, r1 + strb r0, [r4] +_080FBBD2: + lsls r0, r6, 16 + asrs r0, 16 + cmp r0, 0xAF + bgt _080FBBE6 + lsls r0, r3, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bge _080FBBF2 +_080FBBE6: + mov r0, r12 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080FBBF2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FBB64 + + thumb_func_start LoadRotatingGatePics +@ void LoadRotatingGatePics() +LoadRotatingGatePics: @ 80FBC00 + push {lr} + ldr r0, =gUnknown_08591D58 + bl LoadObjectPics + pop {r0} + bx r0 + .pool + thumb_func_end LoadRotatingGatePics + + thumb_func_start sub_80FBC10 +sub_80FBC10: @ 80FBC10 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x03005d8c + ldr r2, [r0] + ldrh r1, [r2] + subs r0, r1, 0x2 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + adds r1, 0x11 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + ldrh r1, [r2, 0x2] + subs r0, r1, 0x2 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r1, 0xE + lsls r1, 16 + lsrs r7, r1, 16 + movs r6, 0 + b _080FBCB6 + .pool +_080FBC48: + ldr r0, =0x0203a044 + ldr r0, [r0] + lsls r1, r6, 3 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x7 + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r0, [r1, 0x2] + adds r0, 0x7 + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, =0x0203a038 + adds r0, r6, r0 + ldrb r0, [r0] + cmp r0, 0x40 + beq _080FBCB4 + lsls r0, r2, 16 + mov r2, r10 + lsls r1, r2, 16 + asrs r2, r0, 16 + cmp r0, r1 + blt _080FBC94 + mov r1, r9 + lsls r0, r1, 16 + asrs r0, 16 + cmp r2, r0 + bgt _080FBC94 + lsls r0, r3, 16 + mov r2, r8 + lsls r1, r2, 16 + asrs r2, r0, 16 + cmp r0, r1 + blt _080FBC94 + lsls r0, r7, 16 + asrs r0, 16 + cmp r2, r0 + ble _080FBCB4 +_080FBC94: + ldr r0, =0x0203a038 + adds r5, r6, r0 + ldrb r0, [r5] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + adds r0, r4, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + movs r0, 0x40 + strb r0, [r5] +_080FBCB4: + adds r6, 0x1 +_080FBCB6: + ldr r0, =0x0203a048 + ldrb r0, [r0] + cmp r6, r0 + blt _080FBC48 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FBC10 + + thumb_func_start sub_80FBCDC +sub_80FBCDC: @ 80FBCDC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r4, r0, 24 + cmp r1, 0x1 + bne _080FBCFC + ldr r0, =gUnknown_08592058 + mov r10, r0 + b _080FBD08 + .pool +_080FBCFC: + cmp r1, 0x2 + beq _080FBD04 +_080FBD00: + movs r0, 0 + b _080FBD98 +_080FBD04: + ldr r1, =gUnknown_08592038 + mov r10, r1 +_080FBD08: + adds r0, r4, 0 + bl sub_80FB854 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + ldr r0, =0x0203a044 + ldr r1, [r0] + lsls r0, r4, 3 + adds r0, r1 + ldrb r2, [r0, 0x4] + ldrh r1, [r0] + adds r1, 0x7 + ldrh r0, [r0, 0x2] + adds r0, 0x7 + movs r3, 0 + lsls r2, 3 + str r2, [sp, 0x4] + lsls r1, 16 + asrs r1, 16 + mov r9, r1 + lsls r0, 16 + asrs r0, 16 + mov r8, r0 +_080FBD38: + movs r6, 0 + ldr r2, [sp] + adds r7, r2, r3 + lsls r0, r3, 1 + adds r5, r7, 0 + ldr r1, [sp, 0x4] + adds r0, r1 + ldr r2, =gUnknown_08592078 + adds r4, r0, r2 +_080FBD4A: + adds r0, r5, 0 + cmp r5, 0 + bge _080FBD52 + adds r0, r7, 0x3 +_080FBD52: + asrs r0, 2 + lsls r0, 2 + subs r0, r5, r0 + lsls r0, 1 + adds r0, r6 + lsls r0, 24 + lsrs r1, r0, 24 + ldrb r0, [r4] + cmp r0, 0 + beq _080FBD88 + lsls r1, 2 + add r1, r10 + movs r0, 0 + ldrsb r0, [r1, r0] + add r0, r9 + ldrb r1, [r1, 0x1] + lsls r1, 24 + asrs r1, 24 + add r1, r8 + str r3, [sp, 0x8] + bl MapGridIsImpassableAt + lsls r0, 24 + lsrs r0, 24 + ldr r3, [sp, 0x8] + cmp r0, 0x1 + beq _080FBD00 +_080FBD88: + adds r4, 0x1 + adds r6, 0x1 + cmp r6, 0x1 + ble _080FBD4A + adds r3, 0x1 + cmp r3, 0x3 + ble _080FBD38 + movs r0, 0x1 +_080FBD98: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80FBCDC + + thumb_func_start sub_80FBDB4 +sub_80FBDB4: @ 80FBDB4 + push {r4-r6,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + adds r6, r0, 0 + lsls r4, 24 + lsrs r5, r4, 24 + lsrs r4, 25 + movs r0, 0x1 + ands r5, r0 + adds r0, r6, 0 + bl sub_80FB854 + subs r4, r0 + adds r1, r4, 0x4 + adds r0, r1, 0 + cmp r1, 0 + bge _080FBDDA + adds r0, r4, 0x7 +_080FBDDA: + asrs r0, 2 + lsls r0, 2 + subs r0, r1, r0 + ldr r1, =0x0203a044 + ldr r2, [r1] + lsls r1, r6, 3 + adds r1, r2 + ldrb r1, [r1, 0x4] + ldr r2, =gUnknown_08592078 + lsls r0, 24 + asrs r0, 23 + adds r0, r5 + lsls r1, 3 + adds r0, r1 + adds r0, r2 + ldrb r0, [r0] + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80FBDB4 + + thumb_func_start sub_80FBE08 +sub_80FBE08: @ 80FBE08 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, =0x0203a038 + adds r2, r3, r0 + ldrb r0, [r2] + cmp r0, 0x40 + beq _080FBE2C + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + strh r1, [r4, 0x30] + adds r0, r3, 0 + bl sub_80FB854 + strh r0, [r4, 0x32] +_080FBE2C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FBE08 + + thumb_func_start sub_80FBE3C +sub_80FBE3C: @ 80FBE3C + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r3, r0, 0 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 16 + lsrs r2, 16 + cmp r0, 0x2 + bne _080FBE58 + ldr r3, =gUnknown_08591FF8 + b _080FBE7A + .pool +_080FBE58: + cmp r0, 0x1 + bne _080FBE64 + ldr r3, =gUnknown_08592008 + b _080FBE7A + .pool +_080FBE64: + cmp r0, 0x3 + bne _080FBE70 + ldr r3, =gUnknown_08592018 + b _080FBE7A + .pool +_080FBE70: + cmp r3, 0x4 + beq _080FBE78 + movs r0, 0xFF + b _080FBE88 +_080FBE78: + ldr r3, =gUnknown_08592028 +_080FBE7A: + lsls r0, r2, 16 + lsls r1, 16 + asrs r1, 16 + asrs r0, 14 + adds r0, r1 + adds r0, r3, r0 + ldrb r0, [r0] +_080FBE88: + pop {r1} + bx r1 + .pool + thumb_func_end sub_80FBE3C + + thumb_func_start sub_80FBE90 +sub_80FBE90: @ 80FBE90 + push {lr} + bl GetCurrentMapRotatingGatePuzzleType + cmp r0, 0 + beq _080FBEA2 + bl sub_80FB8CC + bl sub_80FB818 +_080FBEA2: + pop {r0} + bx r0 + thumb_func_end sub_80FBE90 + + thumb_func_start RotatingGatePuzzleCameraUpdate +@ void RotatingGatePuzzleCameraUpdate(s32 deltaX, s32 deltaY) +RotatingGatePuzzleCameraUpdate: @ 80FBEA8 + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 16 + lsrs r5, r1, 16 + bl GetCurrentMapRotatingGatePuzzleType + cmp r0, 0 + beq _080FBECA + lsls r0, r4, 16 + asrs r0, 16 + lsls r1, r5, 16 + asrs r1, 16 + bl sub_80FB928 + bl sub_80FBC10 +_080FBECA: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end RotatingGatePuzzleCameraUpdate + + thumb_func_start sub_80FBED0 +sub_80FBED0: @ 80FBED0 + push {lr} + bl GetCurrentMapRotatingGatePuzzleType + cmp r0, 0 + beq _080FBEEA + bl LoadRotatingGatePics + bl sub_80FB8CC + movs r0, 0 + movs r1, 0 + bl sub_80FB928 +_080FBEEA: + pop {r0} + bx r0 + thumb_func_end sub_80FBED0 + + thumb_func_start CheckForRotatingGatePuzzleCollision +CheckForRotatingGatePuzzleCollision: @ 80FBEF0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + bl GetCurrentMapRotatingGatePuzzleType + cmp r0, 0 + bne _080FBF24 + b _080FBFC2 +_080FBF12: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80FBE08 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80FB890 + b _080FBFC2 +_080FBF24: + movs r6, 0 + ldr r0, =0x0203a048 + ldrb r0, [r0] + cmp r6, r0 + bge _080FBFC2 + lsls r0, r4, 16 + asrs r7, r0, 16 +_080FBF32: + ldr r0, =0x0203a044 + ldr r1, [r0] + lsls r0, r6, 3 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x7 + ldrh r0, [r0, 0x2] + adds r0, 0x7 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, 16 + asrs r4, r1, 16 + subs r0, r4, 0x2 + cmp r0, r7 + bgt _080FBFB8 + adds r0, r4, 0x1 + cmp r7, r0 + bgt _080FBFB8 + lsls r0, r2, 16 + asrs r3, r0, 16 + subs r1, r3, 0x2 + mov r2, r8 + lsls r0, r2, 16 + asrs r2, r0, 16 + cmp r1, r2 + bgt _080FBFB8 + adds r0, r3, 0x1 + cmp r2, r0 + bgt _080FBFB8 + subs r1, r7, r4 + adds r1, 0x2 + subs r2, r3 + adds r2, 0x2 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + mov r0, r9 + bl sub_80FBE3C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _080FBFB8 + lsrs r5, r0, 4 + movs r1, 0xF + ands r1, r0 + lsls r0, r6, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_80FBDB4 + cmp r0, 0 + beq _080FBFB8 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80FBCDC + cmp r0, 0 + bne _080FBF12 + movs r0, 0x1 + b _080FBFC4 + .pool +_080FBFB8: + adds r6, 0x1 + ldr r0, =0x0203a048 + ldrb r0, [r0] + cmp r6, r0 + blt _080FBF32 +_080FBFC2: + movs r0, 0 +_080FBFC4: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end CheckForRotatingGatePuzzleCollision + + thumb_func_start sub_80FBFD4 +sub_80FBFD4: @ 80FBFD4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 16 + lsrs r2, 16 + mov r8, r2 + bl GetCurrentMapRotatingGatePuzzleType + cmp r0, 0 + bne _080FBFFA + b _080FC08A +_080FBFF6: + movs r0, 0x1 + b _080FC08C +_080FBFFA: + movs r6, 0 + ldr r0, =0x0203a048 + ldrb r0, [r0] + cmp r6, r0 + bge _080FC08A + lsls r0, r4, 16 + asrs r7, r0, 16 +_080FC008: + ldr r0, =0x0203a044 + ldr r1, [r0] + lsls r0, r6, 3 + adds r0, r1 + ldrh r1, [r0] + adds r1, 0x7 + ldrh r0, [r0, 0x2] + adds r0, 0x7 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, 16 + asrs r4, r1, 16 + subs r0, r4, 0x2 + cmp r0, r7 + bgt _080FC080 + adds r0, r4, 0x1 + cmp r7, r0 + bgt _080FC080 + lsls r0, r2, 16 + asrs r3, r0, 16 + subs r1, r3, 0x2 + mov r2, r8 + lsls r0, r2, 16 + asrs r2, r0, 16 + cmp r1, r2 + bgt _080FC080 + adds r0, r3, 0x1 + cmp r2, r0 + bgt _080FC080 + subs r1, r7, r4 + adds r1, 0x2 + subs r2, r3 + adds r2, 0x2 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + mov r0, r9 + bl sub_80FBE3C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _080FC080 + lsrs r5, r0, 4 + movs r1, 0xF + ands r1, r0 + lsls r0, r6, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_80FBDB4 + cmp r0, 0 + beq _080FC080 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80FBCDC + cmp r0, 0 + beq _080FBFF6 +_080FC080: + adds r6, 0x1 + ldr r0, =0x0203a048 + ldrb r0, [r0] + cmp r6, r0 + blt _080FC008 +_080FC08A: + movs r0, 0 +_080FC08C: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80FBFD4 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/roulette.s b/asm/roulette.s new file mode 100644 index 000000000..b69d2afd8 --- /dev/null +++ b/asm/roulette.s @@ -0,0 +1,9543 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8140238 +sub_8140238: @ 8140238 + push {lr} + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + ldr r0, =0x0203ab88 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0xB8 + ldrb r0, [r1] + cmp r0, 0 + beq _0814025A + adds r0, r1, 0 + bl task_tutorial_controls_fadein +_0814025A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8140238 + + thumb_func_start sub_8140264 +sub_8140264: @ 8140264 + push {r4,lr} + sub sp, 0x4 + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + bl sub_8142814 + ldr r4, =0x0203ab88 + ldr r0, [r4] + ldrh r0, [r0, 0x26] + movs r2, 0x80 + lsls r2, 2 + adds r1, r2, 0 + subs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x14 + bl SetGpuReg + ldr r1, [r4] + ldrb r0, [r1, 0x1] + cmp r0, 0 + beq _081402A0 + ldrh r1, [r1, 0x34] + movs r0, 0x52 + bl SetGpuReg +_081402A0: + ldr r2, [r4] + movs r3, 0x2A + ldrsh r0, [r2, r3] + cmp r0, 0 + beq _081402C0 + ldr r1, =0x040000d4 + ldr r3, =0x0000133c + adds r0, r2, r3 + str r0, [r1] + ldr r0, =0x060021c0 + str r0, [r1, 0x4] + ldr r0, =0x800001a0 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r0, 0 + strh r0, [r2, 0x2A] +_081402C0: + ldr r0, [r4] + movs r2, 0x28 + ldrsh r1, [r0, r2] + cmp r1, 0x1 + beq _081402EC + cmp r1, 0x1 + ble _08140374 + cmp r1, 0x2 + beq _08140324 + cmp r1, 0xFF + beq _08140348 + b _08140374 + .pool +_081402EC: + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + bl SetBgAttribute + movs r0, 0 + bl ShowBg + ldr r1, =0x040000d4 + ldr r2, [r4] + movs r3, 0xCF + lsls r3, 2 + adds r0, r2, r3 + str r0, [r1] + ldr r0, =0x0600f9c0 + str r0, [r1, 0x4] + ldr r0, =0x800001a0 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r0, 0x2 + strh r0, [r2, 0x28] + b _08140374 + .pool +_08140324: + ldr r1, =0x040000d4 + movs r2, 0xCF + lsls r2, 2 + adds r0, r2 + str r0, [r1] + ldr r0, =0x0600f9c0 + str r0, [r1, 0x4] + ldr r0, =0x800001a0 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + b _08140374 + .pool +_08140348: + movs r0, 0 + movs r1, 0x1 + movs r2, 0x2 + bl SetBgAttribute + movs r0, 0 + bl ShowBg + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, =0x040000d4 + mov r3, sp + str r3, [r1] + ldr r0, =0x0600f9c0 + str r0, [r1, 0x4] + ldr r0, =0x810001a0 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + ldr r1, [r4] + movs r0, 0 + strh r0, [r1, 0x28] +_08140374: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8140264 + + thumb_func_start sub_8140388 +sub_8140388: @ 8140388 + push {r4,r5,lr} + sub sp, 0x4 + movs r5, 0 + str r5, [sp] + ldr r4, =0x0203ab88 + movs r0, 0xE6 + lsls r0, 6 + bl AllocZeroed + str r0, [r4] + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085B6140 + movs r0, 0x1 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r1, [r4] + movs r0, 0xBE + lsls r0, 1 + adds r1, r0 + movs r0, 0 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r2, =0x0000117c + adds r1, r2 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x0000317c + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + ldr r0, =gUnknown_085B614C + bl InitWindows + bl sub_8197200 + ldr r0, =0x0203ab8c + strb r5, [r0] + ldr r0, =gUnknown_085B5DFC + mov r1, sp + bl malloc_and_decompress + ldr r1, [r4] + ldr r2, =0x0000397c + adds r1, r2 + str r0, [r1] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8140388 + + thumb_func_start sub_8140418 +sub_8140418: @ 8140418 + push {r4,r5,lr} + ldr r5, =0x0203ab88 + ldr r0, [r5] + ldr r4, =0x0000397c + adds r0, r4 + ldr r0, [r0] + bl Free + ldr r0, [r5] + adds r0, r4 + movs r4, 0 + str r4, [r0] + bl FreeAllWindowBuffers + movs r0, 0 + bl UnsetBgTilemapBuffer + movs r0, 0x1 + bl UnsetBgTilemapBuffer + movs r0, 0x2 + bl UnsetBgTilemapBuffer + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r0, [r5] + movs r2, 0xE6 + lsls r2, 6 + movs r1, 0 + bl memset + ldr r0, [r5] + bl Free + str r4, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8140418 + + thumb_func_start sub_8140470 +sub_8140470: @ 8140470 + push {r4-r6,lr} + sub sp, 0x8 + ldr r1, =gUnknown_085B6418 + mov r0, sp + movs r2, 0x6 + bl memcpy + ldr r5, =0x0203ab88 + ldr r3, [r5] + ldr r4, =0x020375e0 + ldrb r0, [r4] + movs r1, 0x1 + ands r1, r0 + ldrb r2, [r3, 0x4] + movs r0, 0x4 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x4] + ldrh r1, [r4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _081404AA + ldr r0, [r5] + ldrb r1, [r0, 0x4] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0, 0x4] +_081404AA: + ldr r1, [r5] + ldr r2, =gUnknown_085B6348 + ldrb r0, [r1, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r2 + ldrb r0, [r0, 0x3] + adds r1, 0x22 + strb r0, [r1] + ldr r1, [r5] + ldrb r0, [r1, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r2 + ldrb r0, [r0, 0x4] + adds r1, 0x23 + strb r0, [r1] + ldr r2, [r5] + ldr r3, =gUnknown_085B6344 + ldrb r1, [r2, 0x4] + lsls r0, r1, 30 + lsrs r0, 30 + lsrs r1, 7 + lsls r1, 1 + adds r0, r1 + adds r0, r3 + ldrb r0, [r0] + strb r0, [r2, 0x19] + ldr r2, [r5] + ldrb r1, [r2, 0x1A] + movs r0, 0xF + ands r0, r1 + movs r1, 0x10 + orrs r0, r1 + strb r0, [r2, 0x1A] + ldr r0, [r5] + ldrb r0, [r0, 0x19] + cmp r0, 0x1 + bne _08140520 + ldr r4, =0x02037714 + ldr r3, =0x02037b14 + mov r0, sp + ldrh r2, [r0] + b _08140528 + .pool +_08140520: + ldr r4, =0x02037714 + ldr r3, =0x02037b14 + mov r0, sp + ldrh r2, [r0, 0x2] +_08140528: + adds r0, r3, 0 + adds r0, 0xA2 + strh r2, [r0] + ldr r1, =0x0000ffff + adds r0, r1, 0 + ands r0, r2 + strh r0, [r3] + ands r0, r1 + adds r2, r4, 0 + adds r2, 0xA2 + strh r0, [r2] + ands r0, r1 + strh r0, [r4] + ldr r0, =0x0203ab88 + ldr r0, [r0] + adds r0, 0xB8 + bl sub_8151678 + movs r4, 0 +_0814054E: + ldr r5, =0x0203ab88 + ldr r0, [r5] + adds r0, 0xB8 + lsls r2, r4, 3 + ldr r1, =gUnknown_085B6388 + adds r2, r1 + adds r1, r4, 0 + bl sub_815168C + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xC + bls _0814054E + movs r4, 0 +_0814056C: + movs r0, 0x64 + muls r0, r4 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x41 + bl pokemon_getattr + adds r1, r0, 0 + movs r0, 0x98 + lsls r0, 1 + cmp r1, r0 + beq _081405AC + adds r0, 0x2 + cmp r1, r0 + bne _081405B6 + ldr r0, [r5] + ldrb r1, [r0, 0x2] + movs r2, 0x1 + b _081405B2 + .pool +_081405AC: + ldr r0, [r5] + ldrb r1, [r0, 0x2] + movs r2, 0x2 +_081405B2: + orrs r1, r2 + strb r1, [r0, 0x2] +_081405B6: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _0814056C + bl GameFreakRTC_CalcLocalDateTime + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8140470 + + thumb_func_start sub_81405CC +sub_81405CC: @ 81405CC + push {r4,r5,lr} + sub sp, 0xC + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x8 + bls _081405E0 + b _081407F8 +_081405E0: + lsls r0, 2 + ldr r1, =_081405F4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081405F4: + .4byte _08140618 + .4byte _08140630 + .4byte _08140650 + .4byte _08140662 + .4byte _0814069C + .4byte _081406C0 + .4byte _081406E0 + .4byte _08140750 + .4byte _0814077A +_08140618: + movs r0, 0 + bl SetVBlankCallback + bl remove_some_task + bl SetVBlankHBlankCallbacksToNull + bl sub_8121DA0 + bl sub_8121E10 + b _081407F8 +_08140630: + bl sub_8140388 + bl DeactivateAllTextPrinters + movs r1, 0x90 + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x0000060a + movs r0, 0x52 + bl SetGpuReg + b _081407F8 + .pool +_08140650: + bl sub_80A1A74 + bl ResetAllObjectData + bl ResetTasks + bl reset_temp_tile_data_buffers + b _081407F8 +_08140662: + ldr r0, =gUnknown_085B5BFC + movs r2, 0xE0 + lsls r2, 1 + movs r1, 0 + bl gpu_pal_apply + ldr r1, =gUnknown_08DBC2E8 + movs r4, 0 + str r4, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, =gUnknown_08DBCA14 + str r4, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _081407F8 + .pool +_0814069C: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + beq _081406A8 + b _08140806 +_081406A8: + bl sub_8140470 + ldr r1, =gUnknown_085B5FA0 + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + b _081407F8 + .pool +_081406C0: + movs r0, 0 + bl sub_8142C0C + bl sub_81439C8 + bl sub_814391C + bl sub_8143314 + bl sub_8142CD0 + bl sub_8142F7C + bl sub_81431E4 + b _081407F8 +_081406E0: + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl GetCoins + lsls r0, 16 + lsrs r0, 16 + bl sub_8143514 + movs r0, 0x6 + bl sub_814372C + movs r0, 0 + bl sub_81436D0 + movs r0, 0 + bl sub_81424FC + ldr r4, =0x0203ab8c + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + ldr r2, =gUnknown_082A5B89 + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r5, 0 + str r5, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldrb r0, [r4] + movs r1, 0x3 + bl CopyWindowToVram + ldr r1, =0x02021bbc + movs r2, 0x3C + negs r2, r2 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, =0x02021bbe + strh r5, [r0] + b _081407F8 + .pool +_08140750: + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + b _081407F8 +_0814077A: + movs r0, 0x1 + bl EnableInterrupts + ldr r0, =sub_8140264 + bl SetVBlankCallback + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A27B0 + ldr r0, =sub_81408A8 + movs r1, 0 + bl CreateTask + ldr r5, =0x0203ab88 + ldr r1, [r5] + adds r1, 0xA4 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r0, 0x6 + strh r0, [r4, 0x14] + bl GetCoins + strh r0, [r4, 0x22] + bl GetCoins + lsls r0, 16 + lsrs r0, 16 + bl sub_80EDE84 + ldr r0, =sub_8140814 + movs r1, 0x1 + bl CreateTask + ldr r1, [r5] + adds r1, 0xA5 + strb r0, [r1] + ldr r0, =sub_8140238 + bl SetMainCallback2 + b _08140806 + .pool +_081407F8: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08140806: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81405CC + + thumb_func_start sub_8140814 +sub_8140814: @ 8140814 + push {r4-r6,lr} + ldr r3, =0x0203ab88 + ldr r0, [r3] + adds r0, 0x21 + ldrb r2, [r0] + adds r1, r2, 0x1 + strb r1, [r0] + ldr r1, [r3] + adds r0, r1, 0 + adds r0, 0x23 + lsls r2, 24 + lsrs r2, 24 + adds r6, r3, 0 + ldrb r0, [r0] + cmp r2, r0 + bne _0814085A + adds r1, 0x21 + movs r0, 0 + strb r0, [r1] + ldr r2, [r6] + adds r3, r2, 0 + adds r3, 0x22 + ldrb r1, [r3] + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + lsls r0, 16 + cmp r0, 0 + bge _0814085A + ldrb r1, [r3] + movs r3, 0xB4 + lsls r3, 1 + adds r0, r3, 0 + subs r0, r1 + strh r0, [r2, 0x24] +_0814085A: + adds r4, r6, 0 + ldr r0, [r4] + ldrh r0, [r0, 0x24] + bl sine2 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, [r4] + ldrh r0, [r0, 0x24] + bl cosine2 + lsls r0, 16 + lsrs r1, r0, 16 + lsls r0, r5, 16 + asrs r0, 16 + cmp r0, 0 + bge _0814087E + adds r0, 0xF +_0814087E: + lsls r0, 12 + lsrs r5, r0, 16 + ldr r3, [r6] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0 + bge _0814088E + adds r0, 0xF +_0814088E: + asrs r0, 4 + strh r0, [r3, 0x32] + strh r0, [r3, 0x2C] + strh r5, [r3, 0x2E] + lsls r0, r5, 16 + asrs r0, 16 + negs r0, r0 + strh r0, [r3, 0x30] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8140814 + + thumb_func_start sub_81408A8 +sub_81408A8: @ 81408A8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl fade_and_return_progress_probably + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _081408FE + movs r1, 0x90 + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x00000808 + movs r0, 0x52 + bl SetGpuReg + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0x14] + adds r0, r4, 0 + bl sub_8141FF4 + bl sub_8142070 + bl sub_8143A40 + movs r0, 0 + bl sub_81424FC + movs r0, 0x6 + bl sub_814372C + ldr r1, =sub_8140968 + ldr r2, =0x0000ffff + adds r0, r4, 0 + movs r3, 0x3 + bl sub_8141F7C +_081408FE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81408A8 + + thumb_func_start sub_8140914 +sub_8140914: @ 8140914 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8197930 + ldr r5, =0x0203ab8c + ldrb r0, [r5] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r5] + ldr r2, =gUnknown_082A5C13 + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldrb r0, [r5] + movs r1, 0x3 + bl CopyWindowToVram + ldr r1, =gUnknown_085B6410 + adds r0, r4, 0 + bl sub_8121F68 + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8140914 + + thumb_func_start sub_8140968 +sub_8140968: @ 8140968 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0x1 + bl sub_819746C + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8140BD0 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8140968 + + thumb_func_start sub_8140994 +sub_8140994: @ 8140994 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x0203ab88 + ldr r0, [r0] + adds r0, 0xA5 + ldrb r0, [r0] + bl DestroyTask + adds r0, r4, 0 + bl sub_8141DE4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8140994 + + thumb_func_start sub_81409B8 +sub_81409B8: @ 81409B8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _081409CA + b _08140AE8 +_081409CA: + lsls r0, r4, 2 + ldr r1, =_081409D8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081409D8: + .4byte _08140A18 + .4byte _08140A3C + .4byte _08140A3C + .4byte _08140A3C + .4byte _08140A3C + .4byte _08140A90 + .4byte _08140AE8 + .4byte _08140AE8 + .4byte _08140AE8 + .4byte _08140AE8 + .4byte _08140A90 + .4byte _08140AE8 + .4byte _08140AE8 + .4byte _08140AE8 + .4byte _08140AE8 + .4byte _08140A90 +_08140A18: + ldr r0, =0x0203ab88 + ldr r0, [r0] + movs r1, 0xBE + lsls r1, 1 + adds r0, r1 + movs r1, 0x10 + str r1, [sp] + movs r1, 0xD + str r1, [sp, 0x4] + movs r1, 0 + movs r2, 0xE + movs r3, 0x7 + bl sub_8152008 + b _08140B4E + .pool +_08140A3C: + lsls r0, r4, 1 + adds r0, r4 + adds r0, 0xE + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r5, =0x0203ab88 + ldr r0, [r5] + movs r4, 0xBE + lsls r4, 1 + adds r0, r4 + movs r1, 0x10 + str r1, [sp] + movs r6, 0xD + str r6, [sp, 0x4] + movs r1, 0 + movs r2, 0xE + movs r3, 0x7 + bl sub_8152008 + ldr r0, [r5] + adds r4, r0, r4 + ldr r1, =0x0000397c + adds r0, r1 + ldr r1, [r0] + ldr r0, =0x00000232 + adds r1, r0 + movs r0, 0x3 + str r0, [sp] + str r6, [sp, 0x4] + adds r0, r4, 0 + mov r2, r8 + movs r3, 0x7 + bl sub_8152058 + b _08140B4E + .pool +_08140A90: + subs r0, r4, 0x1 + movs r1, 0x5 + bl __divsi3 + lsls r1, r0, 1 + adds r1, r0 + adds r1, 0xA + lsls r1, 24 + lsrs r7, r1, 24 + ldr r5, =0x0203ab88 + ldr r0, [r5] + movs r4, 0xBE + lsls r4, 1 + adds r0, r4 + movs r6, 0x10 + str r6, [sp] + movs r1, 0xD + str r1, [sp, 0x4] + movs r1, 0 + movs r2, 0xE + movs r3, 0x7 + bl sub_8152008 + ldr r0, [r5] + adds r4, r0, r4 + ldr r1, =0x0000397c + adds r0, r1 + ldr r1, [r0] + movs r0, 0xA0 + lsls r0, 2 + adds r1, r0 + str r6, [sp] + movs r0, 0x3 + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r2, 0xE + adds r3, r7, 0 + bl sub_8152058 + b _08140B4E + .pool +_08140AE8: + adds r0, r4, 0 + movs r1, 0x5 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + adds r1, 0xE + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + subs r0, r4, 0x1 + movs r1, 0x5 + bl __divsi3 + lsls r1, r0, 1 + adds r1, r0 + adds r1, 0x7 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r5, =0x0203ab88 + ldr r0, [r5] + movs r4, 0xBE + lsls r4, 1 + adds r0, r4 + movs r1, 0x10 + str r1, [sp] + movs r1, 0xD + str r1, [sp, 0x4] + movs r1, 0 + movs r2, 0xE + movs r3, 0x7 + bl sub_8152008 + ldr r0, [r5] + adds r4, r0, r4 + ldr r1, =0x0000397c + adds r0, r1 + ldr r1, [r0] + movs r0, 0x88 + lsls r0, 2 + adds r1, r0 + movs r0, 0x3 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r4, 0 + mov r2, r8 + adds r3, r7, 0 + bl sub_8152058 +_08140B4E: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81409B8 + + thumb_func_start sub_8140B64 +sub_8140B64: @ 8140B64 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldrb r0, [r4, 0x10] + bl sub_81436D0 + ldrb r0, [r4, 0x10] + bl sub_81409B8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8140B64 + + thumb_func_start sub_8140B8C +sub_8140B8C: @ 8140B8C + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =0x0203ab88 + ldr r2, [r5] + movs r6, 0 + movs r1, 0x1 + strh r1, [r2, 0x28] + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldrb r0, [r4, 0x10] + bl sub_81409B8 + ldr r0, [r5] + adds r0, 0x23 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r5] + adds r0, 0x21 + strb r6, [r0] + ldr r0, =sub_8141040 + str r0, [r4] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8140B8C + + thumb_func_start sub_8140BD0 +sub_8140BD0: @ 8140BD0 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x0203ab88 + ldr r0, [r1] + ldr r2, [r0, 0x8] + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + beq _08140C30 + movs r3, 0xB + ldr r5, =gUnknown_085B6154 + adds r0, r5, 0 + adds r0, 0xE4 + ldr r0, [r0] + ands r2, r0 + ldr r0, =0x03005e00 + mov r12, r0 + lsls r7, r6, 2 + cmp r2, 0 + beq _08140C6E + adds r4, r1, 0 + adds r5, 0x8 +_08140BFE: + lsls r0, r3, 16 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + lsrs r3, r0, 16 + asrs r2, r0, 16 + cmp r2, 0xD + bgt _08140C6E + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + ldr r1, [r1, 0x8] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08140BFE + b _08140C6E + .pool +_08140C30: + movs r3, 0x6 + ldr r5, =gUnknown_085B6154 + adds r0, r5, 0 + adds r0, 0x80 + ldr r0, [r0] + ands r2, r0 + ldr r0, =0x03005e00 + mov r12, r0 + lsls r7, r6, 2 + cmp r2, 0 + beq _08140C6E + adds r4, r1, 0 + adds r5, 0x8 +_08140C4A: + lsls r0, r3, 16 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + lsrs r3, r0, 16 + asrs r2, r0, 16 + cmp r2, 0x9 + bgt _08140C6E + ldr r1, [r4] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 2 + adds r0, r5 + ldr r1, [r1, 0x8] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08140C4A +_08140C6E: + adds r4, r7, r6 + lsls r4, 3 + add r4, r12 + movs r5, 0 + strh r3, [r4, 0x10] + adds r0, r6, 0 + bl sub_8141FF4 + ldrb r0, [r4, 0x10] + bl sub_81424FC + ldrb r0, [r4, 0x10] + bl sub_81436D0 + ldrb r0, [r4, 0x10] + bl sub_8142284 + strh r5, [r4, 0xA] + ldr r0, =sub_8140B8C + str r0, [r4] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8140BD0 + + thumb_func_start sub_8140CA8 +sub_8140CA8: @ 8140CA8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + movs r6, 0 + movs r7, 0 + ldr r1, =gUnknown_085B641E + mov r0, sp + movs r2, 0x4 + bl memcpy + ldrb r0, [r4] + mov r8, r0 + cmp r5, 0 + blt _08140D1C + cmp r5, 0x1 + bgt _08140CF4 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0x5 + bl __modsi3 + lsls r0, 24 + lsrs r6, r0, 24 + movs r2, 0xF0 + lsls r2, 20 + adds r1, r0, r2 + lsrs r7, r1, 24 + cmp r0, 0 + bne _08140D1C + movs r6, 0x5 + b _08140D1C + .pool +_08140CF4: + cmp r5, 0x3 + bgt _08140D1C + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0x5 + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 24 + lsrs r6, r1, 24 + movs r2, 0x80 + lsls r2, 19 + adds r0, r1, r2 + lsrs r7, r0, 24 + cmp r1, 0 + bne _08140D1C + movs r6, 0x1 +_08140D1C: + mov r1, sp + adds r0, r1, r5 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r2, [r4] + adds r0, r2 + strh r0, [r4] + lsls r1, r6, 24 + asrs r3, r1, 24 + lsls r0, 16 + asrs r0, 16 + lsls r2, r7, 24 + cmp r0, r3 + bge _08140D3E + asrs r0, r2, 24 + strh r0, [r4] +_08140D3E: + movs r0, 0 + ldrsh r1, [r4, r0] + asrs r0, r2, 24 + cmp r1, r0 + ble _08140D4A + strh r3, [r4] +_08140D4A: + mov r1, r8 + lsls r0, r1, 24 + movs r2, 0 + ldrsh r1, [r4, r2] + asrs r0, 24 + cmp r1, r0 + bne _08140D5C + movs r0, 0 + b _08140D5E +_08140D5C: + movs r0, 0x1 +_08140D5E: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8140CA8 + + thumb_func_start sub_8140D6C +sub_8140D6C: @ 8140D6C + 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 r9, r0 + movs r5, 0 + ldr r4, =0x030022c0 + ldrh r1, [r4, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08140DA8 + movs r5, 0x1 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r0, r1 + adds r0, 0x8 + movs r1, 0 + bl sub_8140CA8 + lsls r0, 24 + cmp r0, 0 + bne _08140DA8 + b _08140F3A +_08140DA8: + ldrh r1, [r4, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08140DCE + movs r5, 0x1 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r0, r1 + adds r0, 0x8 + movs r1, 0x1 + bl sub_8140CA8 + lsls r0, 24 + cmp r0, 0 + bne _08140DCE + b _08140F3A +_08140DCE: + ldrh r1, [r4, 0x2E] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08140DF4 + movs r5, 0x1 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r0, r1 + adds r0, 0x8 + movs r1, 0x2 + bl sub_8140CA8 + lsls r0, 24 + cmp r0, 0 + bne _08140DF4 + b _08140F3A +_08140DF4: + ldrh r1, [r4, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08140E1A + movs r5, 0x1 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r0, r1 + adds r0, 0x8 + movs r1, 0x3 + bl sub_8140CA8 + lsls r0, 24 + cmp r0, 0 + bne _08140E1A + b _08140F3A +_08140E1A: + cmp r5, 0 + bne _08140E20 + b _08140F3A +_08140E20: + ldr r0, =0x03005e00 + lsls r6, r7, 2 + adds r4, r6, r7 + lsls r4, 3 + adds r4, r0 + ldrb r0, [r4, 0x10] + bl sub_81424FC + adds r0, r7, 0 + bl sub_8140B64 + mov r1, r9 + strh r1, [r4, 0xA] + movs r0, 0x5 + bl audio_play + ldr r5, =0x0203ab88 + ldr r0, [r5] + adds r0, 0xB8 + ldr r1, =0x0000ffff + bl sub_8151A9C + ldr r5, [r5] + movs r2, 0xB8 + lsls r2, 1 + adds r3, r5, r2 + ldrb r2, [r3] + movs r1, 0x7F + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3] + movs r0, 0xB2 + lsls r0, 1 + adds r3, r5, r0 + ldrb r2, [r3] + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3] + movs r0, 0xAC + lsls r0, 1 + adds r2, r5, r0 + ldrb r0, [r2] + ands r1, r0 + strb r1, [r2] + ldrb r0, [r4, 0x10] + bl sub_8142284 + movs r4, 0 + mov r9, r6 + ldr r1, =0x02020630 + mov r12, r1 + movs r2, 0x8 + add r2, r12 + mov r10, r2 +_08140E8C: + ldr r0, =0x0203ab88 + ldr r5, [r0] + adds r0, r4, 0 + adds r0, 0x29 + adds r6, r5, 0 + adds r6, 0x3C + adds r0, r6, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + mov r1, r12 + adds r3, r0, r1 + adds r2, r3, 0 + adds r2, 0x40 + add r0, r10 + ldr r0, [r0] + ldr r0, [r0] + ldrh r1, [r0] + ldrh r2, [r2] + adds r1, r2 + ldr r2, =0x000003ff + mov r8, r2 + mov r0, r8 + ands r1, r0 + ldrh r2, [r3, 0x4] + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x4] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _08140E8C + ldr r0, =0x03005e00 + mov r2, r9 + adds r1, r2, r7 + lsls r1, 3 + adds r1, r0 + ldrh r3, [r1, 0x10] + subs r0, r3, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3 + bhi _08140F3A + ldr r2, =gUnknown_085B6154 + movs r0, 0x10 + ldrsh r1, [r1, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x8 + adds r0, r2 + ldr r1, [r5, 0x8] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08140F3A + subs r0, r3, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + adds r0, 0x29 + adds r0, r6, r0 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r3, r0, r1 + adds r2, r3, 0 + adds r2, 0x40 + adds r1, 0x8 + adds r0, r1 + ldr r0, [r0] + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldrh r2, [r2] + adds r1, r2 + mov r2, r8 + ands r1, r2 + ldrh r2, [r3, 0x4] + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x4] +_08140F3A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8140D6C + + thumb_func_start sub_8140F6C +sub_8140F6C: @ 8140F6C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80EECA4 + ldr r0, =0x0203ab88 + ldr r1, [r0] + movs r0, 0xFF + strh r0, [r1, 0x28] + ldrb r2, [r1, 0x19] + cmp r2, 0x1 + bne _08140F90 + adds r0, r1, 0 + adds r0, 0x23 + strb r2, [r0] + b _08140F96 + .pool +_08140F90: + adds r1, 0x23 + movs r0, 0 + strb r0, [r1] +_08140F96: + ldr r0, =0x0203ab88 + ldr r0, [r0] + adds r0, 0x21 + movs r1, 0 + strb r1, [r0] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r1, 0x20 + strh r1, [r0, 0xA] + ldr r1, =sub_81410FC + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8140F6C + + thumb_func_start sub_8140FC4 +sub_8140FC4: @ 8140FC4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x0203ab88 + ldr r2, [r4] + ldrb r1, [r2, 0x1A] + lsls r1, 28 + lsrs r1, 28 + adds r2, 0x1B + adds r2, r1 + ldr r3, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r5, r1, r3 + ldrh r0, [r5, 0x10] + strb r0, [r2] + ldr r1, [r4] + ldrb r0, [r1, 0x1A] + lsls r0, 28 + lsrs r0, 28 + adds r1, 0x1B + adds r1, r0 + ldrb r0, [r1] + bl sub_8142758 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0xC] + ldr r1, [r4] + ldrb r0, [r1, 0x1A] + lsls r0, 28 + lsrs r0, 28 + adds r1, 0x1B + adds r1, r0 + ldrb r0, [r1] + bl sub_81436D0 + ldr r0, [r4] + ldrb r1, [r0, 0x19] + ldrh r0, [r5, 0x22] + subs r0, r1 + strh r0, [r5, 0x22] + lsls r0, 16 + cmp r0, 0 + bge _08141024 + movs r0, 0 + strh r0, [r5, 0x22] +_08141024: + ldrh r0, [r5, 0x22] + bl sub_8143514 + ldr r0, =sub_8140F6C + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8140FC4 + + thumb_func_start sub_8141040 +sub_8141040: @ 8141040 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl sub_8140D6C + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x1E + beq _08141076 + cmp r0, 0x1E + bgt _0814106C + cmp r0, 0 + beq _08141072 + b _0814108A + .pool +_0814106C: + cmp r0, 0x3B + beq _08141084 + b _0814108A +_08141072: + ldrb r0, [r4, 0x10] + b _08141078 +_08141076: + movs r0, 0 +_08141078: + bl sub_81409B8 + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + b _0814109A +_08141084: + movs r0, 0 + strh r0, [r4, 0xA] + b _0814109A +_0814108A: + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] +_0814109A: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081410F2 + ldr r0, =0x0203ab88 + ldr r3, [r0] + ldr r2, =gUnknown_085B6154 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x10 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, 0x8 + adds r0, r2 + ldr r1, [r3, 0x8] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _081410E8 + movs r0, 0x16 + bl audio_play + b _081410F2 + .pool +_081410E8: + movs r0, 0x5F + bl m4aSongNumStart + ldr r0, =sub_8140FC4 + str r0, [r4] +_081410F2: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8141040 + + thumb_func_start sub_81410FC +sub_81410FC: @ 81410FC + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 + ldrh r0, [r4, 0xA] + subs r1, r0, 0x1 + strh r1, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + ble _08141168 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _08141128 + ldr r1, =0x02021bbc + ldrh r0, [r1] + adds r0, 0x2 + strh r0, [r1] +_08141128: + ldr r0, =0x0203ab88 + ldr r1, [r0] + ldrh r0, [r1, 0x26] + adds r0, 0x4 + strh r0, [r1, 0x26] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x68 + bne _08141180 + ldr r2, =0x02020630 + adds r0, r1, 0 + adds r0, 0x55 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =DummyObjectCallback + str r1, [r0] + b _08141180 + .pool +_08141168: + movs r0, 0x1 + movs r1, 0xFF + bl sub_8142E70 + movs r0, 0x1 + movs r1, 0xFF + bl sub_8143038 + ldr r0, =sub_8141344 + str r0, [r4] + movs r0, 0 + strh r0, [r4, 0xA] +_08141180: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81410FC + + thumb_func_start sub_814118C +sub_814118C: @ 814118C + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =0x0203ab88 + ldr r3, [r0] + ldrb r2, [r3, 0x2] + adds r5, r0, 0 + cmp r2, 0x2 + bgt _081411AC + cmp r2, 0x1 + bge _081411B2 + b _08141280 + .pool +_081411AC: + cmp r2, 0x3 + beq _08141214 + b _08141280 +_081411B2: + ldr r0, =0x03005cf8 + ldrb r0, [r0, 0x2] + subs r0, 0x4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bhi _081411E4 + cmp r4, 0xB + bls _081411CC + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08141296 +_081411CC: + ldr r0, =gUnknown_085B6348 + ldrb r1, [r3, 0x4] + lsls r1, 30 + lsrs r1, 25 + adds r1, r0 + ldrb r0, [r1, 0x2] + lsrs r0, 1 + b _0814133A + .pool +_081411E4: + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08141200 + ldr r0, =gUnknown_085B6348 + ldrb r1, [r3, 0x4] + lsls r1, 30 + lsrs r1, 25 + adds r1, r0 + ldrb r0, [r1, 0x2] + lsrs r0, 1 + b _0814133A + .pool +_08141200: + ldr r0, =gUnknown_085B6348 + ldrb r1, [r3, 0x4] + lsls r1, 30 + lsrs r1, 25 + adds r1, r0 + ldrb r0, [r1, 0x2] + b _0814133A + .pool +_08141214: + ldr r0, =0x03005cf8 + ldrb r0, [r0, 0x2] + subs r0, 0x4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + bhi _08141248 + cmp r4, 0x5 + bls _0814122E + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08141296 +_0814122E: + ldr r0, =gUnknown_085B6348 + ldrb r1, [r3, 0x4] + lsls r1, 30 + lsrs r1, 25 + adds r1, r0 + ldrb r0, [r1, 0x2] + lsrs r0, 1 + b _0814133A + .pool +_08141248: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08141268 + cmp r4, 0x6 + bls _08141268 + ldr r0, =gUnknown_085B6348 + ldrb r1, [r3, 0x4] + lsls r1, 30 + lsrs r1, 25 + adds r1, r0 + ldrb r0, [r1, 0x2] + lsrs r0, 2 + b _0814133A + .pool +_08141268: + ldr r1, =gUnknown_085B6348 + ldr r0, [r5] + ldrb r0, [r0, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrb r0, [r0, 0x2] + lsrs r0, 1 + b _0814133A + .pool +_08141280: + ldr r0, =0x03005cf8 + ldrb r0, [r0, 0x2] + subs r0, 0x4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bhi _081412B8 + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081412A0 +_08141296: + movs r0, 0x1 + b _0814133A + .pool +_081412A0: + ldr r1, =gUnknown_085B6348 + ldr r0, [r5] + ldrb r0, [r0, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrb r0, [r0, 0x2] + lsrs r0, 1 + b _0814133A + .pool +_081412B8: + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _081412F0 + cmp r4, 0xC + bls _081412DC + ldr r1, =gUnknown_085B6348 + ldr r0, [r5] + ldrb r0, [r0, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrb r0, [r0, 0x2] + lsrs r0, 1 + b _0814133A + .pool +_081412DC: + ldr r1, =gUnknown_085B6348 + ldr r0, [r5] + ldrb r0, [r0, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrb r0, [r0, 0x2] + b _0814133A + .pool +_081412F0: + movs r0, 0x80 + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _08141328 + cmp r4, 0xC + bls _08141314 + ldr r1, =gUnknown_085B6348 + ldr r0, [r5] + ldrb r0, [r0, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrb r0, [r0, 0x2] + b _0814133A + .pool +_08141314: + ldr r1, =gUnknown_085B6348 + ldr r0, [r5] + ldrb r0, [r0, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrb r0, [r0, 0x1] + b _0814133A + .pool +_08141328: + ldr r1, =gUnknown_085B6348 + ldr r0, [r5] + ldrb r0, [r0, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrb r0, [r0, 0x1] + lsls r0, 25 + lsrs r0, 24 +_0814133A: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_814118C + + thumb_func_start sub_8141344 +sub_8141344: @ 8141344 + 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 r10, r0 + movs r4, 0 + ldr r1, =gUnknown_085B6422 + mov r0, sp + movs r2, 0x8 + bl memcpy + bl GenerateRandomNumber + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r7, 0 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r3, =0x0203ab88 + ldr r0, [r3] + ldr r2, =0x03005e00 + mov r5, r10 + lsls r1, r5, 2 + add r1, r10 + lsls r1, 3 + adds r1, r2 + ldrh r2, [r1, 0x14] + adds r0, 0x7C + strb r2, [r0] + ldr r0, [r3] + adds r2, r0, 0 + adds r2, 0x7F + strb r4, [r2] + subs r2, 0x1 + strb r4, [r2] + adds r0, 0x7D + strb r4, [r0] + ldrh r0, [r1, 0x18] + adds r1, r7, 0 + bl sub_814118C + adds r4, r0, 0 + lsls r4, 24 + lsrs r1, r4, 24 + adds r0, r7, 0 + bl __modsi3 + lsrs r4, 25 + subs r0, r4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x03005cf8 + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + movs r5, 0x1 + cmp r0, 0xC + bgt _081413C8 + movs r5, 0 +_081413C8: + cmp r6, 0x4F + bhi _081413E0 + lsls r0, r5, 25 + b _081413EA + .pool +_081413E0: + lsls r1, r5, 24 + asrs r1, 24 + movs r0, 0x1 + subs r0, r1 + lsls r0, 25 +_081413EA: + lsrs r5, r0, 24 + ldr r0, =0x0203ab88 + ldr r6, [r0] + ldrb r0, [r6, 0x4] + lsls r0, 30 + lsrs r0, 25 + ldr r1, =gUnknown_085B6348 + adds r0, r1 + lsls r4, 24 + asrs r4, 24 + ldrh r0, [r0, 0x1A] + adds r4, r0 + adds r0, r6, 0 + adds r0, 0x80 + strh r4, [r0] + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + bl __floatsisf + cmp r4, 0 + bge _0814141C + ldr r1, =0x47800000 + bl __addsf3 +_0814141C: + ldr r1, =0x40a00000 + bl __divsf3 + bl __fixunssfsi + lsls r0, 16 + lsrs r4, r0, 16 + lsls r0, r4, 1 + adds r0, r4 + movs r2, 0x82 + adds r2, r6 + mov r8, r2 + strh r0, [r2] + adds r0, r6, 0 + adds r0, 0x84 + strh r4, [r0] + adds r0, 0x2 + strh r4, [r0] + movs r0, 0x88 + adds r0, r6 + mov r9, r0 + movs r0, 0x1 + ands r0, r7 + lsls r1, r5, 24 + asrs r1, 24 + adds r0, r1 + lsls r0, 1 + add r0, sp + movs r1, 0 + ldrsh r4, [r0, r1] + adds r0, r4, 0 + bl __floatsisf + cmp r4, 0 + bge _08141468 + ldr r1, =0x47800000 + bl __addsf3 +_08141468: + mov r2, r9 + str r0, [r2] + adds r7, r6, 0 + adds r7, 0x8C + ldrb r0, [r6, 0x4] + lsls r0, 30 + lsrs r0, 25 + ldr r5, =gUnknown_085B6348 + adds r0, r5 + movs r1, 0x18 + ldrsh r4, [r0, r1] + adds r0, r4, 0 + bl __floatsisf + adds r5, r0, 0 + cmp r4, 0 + bge _08141492 + ldr r1, =0x47800000 + bl __addsf3 + adds r5, r0, 0 +_08141492: + str r5, [r7] + adds r7, r6, 0 + adds r7, 0x90 + ldr r1, =0x3f000000 + adds r0, r5, 0 + bl __mulsf3 + adds r1, r5, 0 + bl __subsf3 + adds r5, r0, 0 + mov r2, r8 + movs r0, 0 + ldrsh r4, [r2, r0] + adds r0, r4, 0 + bl __floatsisf + adds r2, r0, 0 + cmp r4, 0 + bge _081414C2 + ldr r1, =0x47800000 + bl __addsf3 + adds r2, r0, 0 +_081414C2: + adds r0, r5, 0 + adds r1, r2, 0 + bl __divsf3 + str r0, [r7] + adds r1, r6, 0 + adds r1, 0x94 + ldr r0, =0x42880000 + str r0, [r1] + adds r1, 0x8 + ldr r0, =0x00000000 + str r0, [r1] + adds r5, r6, 0 + adds r5, 0x98 + mov r1, r8 + movs r2, 0 + ldrsh r4, [r1, r2] + adds r0, r4, 0 + bl __floatsisf + adds r2, r0, 0 + cmp r4, 0 + bge _081414F8 + ldr r1, =0x47800000 + bl __addsf3 + adds r2, r0, 0 +_081414F8: + ldr r0, =0x41000000 + adds r1, r2, 0 + bl __divsf3 + bl __negsf2 + str r0, [r5] + adds r1, r6, 0 + adds r1, 0xA0 + ldr r0, =0x42100000 + str r0, [r1] + ldr r1, =0x03005e00 + mov r5, r10 + lsls r0, r5, 2 + add r0, r10 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_814155C + str r1, [r0] + 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_8141344 + + thumb_func_start sub_814155C +sub_814155C: @ 814155C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x0203ab88 + ldr r3, [r4] + ldrb r1, [r3, 0x3] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r3, 0x3] + ldr r3, [r4] + adds r2, r3, 0 + adds r2, 0x7C + adds r1, r3, 0 + adds r1, 0x3C + ldrb r2, [r2] + adds r1, r2 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + ldr r2, =0x02020630 + adds r1, r2 + str r1, [r3, 0x38] + ldr r2, =sub_81446AC + str r2, [r1, 0x1C] + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldrh r1, [r4, 0x14] + adds r1, 0x1 + strh r1, [r4, 0x14] + ldrh r0, [r4, 0x18] + adds r0, 0x1 + strh r0, [r4, 0x18] + movs r0, 0x6 + subs r0, r1 + lsls r0, 24 + lsrs r0, 24 + bl sub_814372C + movs r0, 0x5C + bl m4aSongNumStart + ldr r0, =sub_81415D4 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814155C + + thumb_func_start sub_81415D4 +sub_81415D4: @ 81415D4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r6, =0x0203ab88 + ldr r3, [r6] + adds r0, r3, 0 + adds r0, 0x7D + ldrb r0, [r0] + cmp r0, 0 + beq _081416C6 + ldrb r1, [r3, 0x3] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08141614 + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _081416C6 + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r3, 0x3] + ldr r2, [r6] + ldrb r1, [r2, 0x3] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x3] + b _081416C6 + .pool +_08141614: + ldr r2, =0x03005e00 + lsls r1, r4, 2 + adds r0, r1, r4 + lsls r0, 3 + adds r5, r0, r2 + movs r2, 0xA + ldrsh r0, [r5, r2] + adds r7, r1, 0 + cmp r0, 0 + bne _08141660 + adds r0, r3, 0 + adds r0, 0x7E + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_81420D0 + lsls r0, 24 + lsrs r0, 24 + ldr r2, [r6] + ldrb r1, [r2, 0x1A] + lsls r1, 28 + lsrs r1, 28 + adds r2, 0x1B + adds r2, r1 + ldrb r1, [r2] + bl sub_81421E8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x12] + cmp r0, 0x1 + bne _08141660 + ldr r0, [r6] + adds r0, 0xB8 + movs r1, 0x80 + lsls r1, 5 + bl sub_8151A48 +_08141660: + ldr r0, =0x03005e00 + adds r1, r7, r4 + lsls r1, 3 + adds r4, r1, r0 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x3C + bgt _08141690 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08141680 + movs r0, 0x3C + strh r0, [r4, 0xA] +_08141680: + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + b _081416C6 + .pool +_08141690: + ldr r0, =0x0203ab88 + ldr r1, [r0] + ldrb r0, [r1, 0x1A] + lsls r0, 28 + lsrs r0, 28 + adds r1, 0x1B + adds r1, r0 + ldrb r0, [r1] + bl sub_81424FC + ldrh r1, [r4, 0x20] + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_8142E70 + ldrb r1, [r4, 0x14] + subs r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_8143038 + movs r0, 0x20 + strh r0, [r4, 0xA] + ldr r0, =sub_81416D4 + str r0, [r4] +_081416C6: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81415D4 + + thumb_func_start sub_81416D4 +sub_81416D4: @ 81416D4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0xA] + subs r1, r0, 0x1 + strh r1, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + ble _08141740 + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _08141700 + ldr r1, =0x02021bbc + ldrh r0, [r1] + subs r0, 0x2 + strh r0, [r1] +_08141700: + ldr r0, =0x0203ab88 + ldr r1, [r0] + ldrh r0, [r1, 0x26] + subs r0, 0x4 + strh r0, [r1, 0x26] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x68 + bne _08141768 + ldr r2, =0x02020630 + adds r0, r1, 0 + adds r0, 0x55 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_814390C + str r1, [r0] + b _08141768 + .pool +_08141740: + ldrh r0, [r4, 0x20] + lsls r0, 24 + lsrs r0, 24 + bl sub_8143150 + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + bne _08141756 + movs r0, 0x79 + b _08141758 +_08141756: + movs r0, 0x3D +_08141758: + strh r0, [r4, 0xA] + ldr r0, =0x03005e00 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8141778 + str r0, [r1] +_08141768: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81416D4 + + thumb_func_start sub_8141778 +sub_8141778: @ 8141778 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + ldrh r0, [r4, 0xA] + subs r1, r0, 0x1 + strh r1, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081417E8 + movs r0, 0xA + ldrsh r1, [r4, r0] + adds r0, r1, 0 + cmp r1, 0 + bge _081417A2 + adds r0, 0xF +_081417A2: + asrs r0, 4 + lsls r0, 4 + subs r0, r1, r0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + beq _081417CC + cmp r0, 0x8 + bne _081417F4 + movs r0, 0 + movs r1, 0xFF + bl sub_8142E70 + movs r0, 0 + movs r1, 0xFF + bl sub_8143038 + b _081417F4 + .pool +_081417CC: + ldrh r1, [r4, 0x20] + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_8142E70 + ldrb r1, [r4, 0x14] + subs r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_8143038 + b _081417F4 +_081417E8: + ldr r1, =sub_814189C + adds r0, r2, 0 + movs r2, 0x1E + movs r3, 0 + bl sub_8141F7C +_081417F4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8141778 + + thumb_func_start sub_8141800 +sub_8141800: @ 8141800 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08141864 + cmp r0, 0 + blt _08141864 + cmp r0, 0x2 + bgt _08141864 + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + beq _08141888 + movs r0, 0x1D + bl sub_80847F8 + ldrh r1, [r4, 0x1E] + adds r1, 0x1 + strh r1, [r4, 0x1E] + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + bcs _08141848 + movs r0, 0x1E + ldrsh r1, [r4, r0] + movs r0, 0x1D + bl sav12_xor_set +_08141848: + ldr r1, =sub_8141A18 + ldr r2, =0x0000ffff + adds r0, r5, 0 + movs r3, 0x3 + bl sub_8141F7C + b _08141888 + .pool +_08141864: + bl mplay_has_finished_maybe + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _08141888 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r2, [r0, 0x1E] + ldr r1, =sub_8141AC0 + ldr r2, =0x0000ffff + adds r0, r5, 0 + movs r3, 0x3 + bl sub_8141F7C +_08141888: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8141800 + + thumb_func_start sub_814189C +sub_814189C: @ 814189C + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r2, 0x12 + ldrsh r1, [r0, r2] + cmp r1, 0 + beq _08141928 + cmp r1, 0 + blt _08141928 + cmp r1, 0x2 + bgt _08141928 + movs r1, 0xC + ldrsh r0, [r0, r1] + cmp r0, 0xC + bne _081418EC + ldr r0, =0x00000185 + bl fanfare_play + ldr r4, =0x0203ab8c + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + ldr r2, =gUnknown_082A5BD7 + b _08141902 + .pool +_081418EC: + movs r0, 0xC3 + lsls r0, 1 + bl fanfare_play + ldr r4, =0x0203ab8c + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + ldr r2, =gUnknown_082A5BCB +_08141902: + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldrb r0, [r4] + movs r1, 0x3 + bl CopyWindowToVram + b _08141958 + .pool +_08141928: + movs r0, 0x20 + bl m4aSongNumStart + ldr r4, =0x0203ab8c + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + ldr r2, =gUnknown_082A5BE0 + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldrb r0, [r4] + movs r1, 0x3 + bl CopyWindowToVram +_08141958: + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xA] + ldr r1, =sub_8141800 + str r1, [r0] + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814189C + + thumb_func_start sub_8141984 +sub_8141984: @ 8141984 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x16 + ldrsh r5, [r4, r0] + cmp r5, 0 + beq _081419AC + cmp r5, 0x3 + beq _081419DC + ldrh r0, [r4, 0x16] + adds r0, 0x1 + b _081419E4 + .pool +_081419AC: + ldrh r0, [r4, 0x22] + adds r0, 0x1 + strh r0, [r4, 0x22] + movs r0, 0x15 + bl m4aSongNumStart + ldrh r0, [r4, 0x22] + bl sub_8143514 + movs r2, 0x22 + ldrsh r1, [r4, r2] + ldr r0, =0x0000270e + cmp r1, r0 + ble _081419D0 + strh r5, [r4, 0xA] + b _081419E6 + .pool +_081419D0: + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x16] + adds r0, 0x1 + b _081419E4 +_081419DC: + movs r0, 0x15 + bl m4aSongNumStop + movs r0, 0 +_081419E4: + strh r0, [r4, 0x16] +_081419E6: + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + movs r2, 0xA + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08141A04 + ldr r1, =sub_8141AC0 + ldr r2, =0x0000ffff + adds r0, r6, 0 + movs r3, 0x3 + bl sub_8141F7C +_08141A04: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8141984 + + thumb_func_start sub_8141A18 +sub_8141A18: @ 8141A18 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x02021cc4 + ldr r1, =0x0203ab88 + mov r9, r1 + ldr r1, [r1] + ldrb r2, [r1, 0x19] + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r1, 0xC + ldrsh r0, [r4, r1] + adds r1, r2, 0 + muls r1, r0 + adds r0, r3, 0 + movs r2, 0 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r2, =0x02021fc4 + mov r8, r2 + ldr r1, =gUnknown_082A5BEF + mov r0, r8 + bl ExpandStringRefs + ldr r5, =0x0203ab8c + ldrb r0, [r5] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r5] + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r6, 0 + str r6, [sp, 0x8] + movs r1, 0x1 + mov r2, r8 + movs r3, 0 + bl Print + ldrb r0, [r5] + movs r1, 0x3 + bl CopyWindowToVram + mov r1, r9 + ldr r0, [r1] + ldrb r1, [r0, 0x19] + movs r2, 0xC + ldrsh r0, [r4, r2] + muls r0, r1 + strh r0, [r4, 0xA] + strh r6, [r4, 0x16] + ldr r0, =sub_8141984 + str r0, [r4] + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8141A18 + + thumb_func_start sub_8141AC0 +sub_8141AC0: @ 8141AC0 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =0x0203ab88 + ldr r0, [r5] + adds r0, 0xB8 + ldr r1, =0x0000ffff + bl sub_8151A9C + ldr r6, [r5] + movs r0, 0xB8 + lsls r0, 1 + adds r3, r6, r0 + ldrb r2, [r3] + movs r1, 0x7F + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3] + movs r0, 0xB2 + lsls r0, 1 + adds r3, r6, r0 + ldrb r2, [r3] + adds r0, r1, 0 + ands r0, r2 + strb r0, [r3] + movs r0, 0xAC + lsls r0, 1 + adds r2, r6, r0 + ldrb r0, [r2] + ands r1, r0 + strb r1, [r2] + ldr r6, =0x02020630 + ldr r2, [r5] + ldr r5, =gUnknown_085B6154 + ldr r0, =0x03005e00 + lsls r3, r4, 2 + adds r3, r4 + lsls r3, 3 + adds r3, r0 + movs r0, 0x20 + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0] + adds r2, r0 + adds r2, 0x43 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, =sub_8141B58 + str r0, [r3] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8141AC0 + + thumb_func_start sub_8141B58 +sub_8141B58: @ 8141B58 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + strh r5, [r0, 0x10] + ldr r4, =0x0203ab88 + ldr r1, [r4] + ldrb r0, [r1, 0x1A] + lsls r0, 28 + lsrs r0, 28 + adds r1, 0x1B + adds r1, r0 + strb r2, [r1] + movs r0, 0 + bl sub_81424FC + ldr r3, =0x02020630 + ldr r0, [r4] + adds r0, 0x6C + ldrb r1, [r0] + 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] + adds r7, r3, 0 + movs r0, 0x8 + adds r0, r7 + mov r12, r0 + ldr r1, =0xfffffc00 + mov r8, r1 +_08141BB0: + ldr r0, =0x0203ab88 + ldr r4, [r0] + adds r0, r4, r5 + adds r0, 0x65 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, r0, r7 + adds r2, r3, 0 + adds r2, 0x40 + add r0, r12 + ldr r0, [r0] + ldr r0, [r0] + ldrh r1, [r0] + ldrh r2, [r2] + adds r1, r2 + ldr r2, =0x000003ff + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r3, 0x4] + mov r0, r8 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x4] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _08141BB0 + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r2, r1, r0 + movs r1, 0x22 + ldrsh r0, [r2, r1] + ldrb r4, [r4, 0x19] + cmp r0, r4 + blt _08141CBC + movs r1, 0x14 + ldrsh r0, [r2, r1] + cmp r0, 0x6 + bne _08141C58 + ldr r4, =0x0203ab8c + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + ldr r2, =gUnknown_082A5C21 + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldrb r0, [r4] + movs r1, 0x3 + bl CopyWindowToVram + ldr r1, =dp01t_12_3_battle_menu + b _08141C8E + .pool +_08141C58: + movs r0, 0x22 + ldrsh r1, [r2, r0] + ldr r0, =0x0000270f + cmp r1, r0 + bne _08141CB0 + ldr r4, =0x0203ab8c + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + ldr r2, =gUnknown_082A5C61 + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldrb r0, [r4] + movs r1, 0x3 + bl CopyWindowToVram + ldr r1, =sub_8140914 +_08141C8E: + ldr r2, =0x0000ffff + adds r0, r6, 0 + movs r3, 0x3 + bl sub_8141F7C + b _08141CF2 + .pool +_08141CB0: + ldr r0, =sub_8140914 + str r0, [r2] + b _08141CF2 + .pool +_08141CBC: + ldr r4, =0x0203ab8c + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + ldr r2, =gUnknown_082A5C04 + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldrb r0, [r4] + movs r1, 0x3 + bl CopyWindowToVram + ldr r1, =sub_8140994 + adds r0, r6, 0 + movs r2, 0x3C + movs r3, 0x3 + bl sub_8141F7C +_08141CF2: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8141B58 + + thumb_func_start dp01t_12_3_battle_menu +dp01t_12_3_battle_menu: @ 8141D0C + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0x14] + adds r0, r5, 0 + bl sub_8141FF4 + bl sub_8142070 + bl sub_8143A40 + movs r0, 0 + bl sub_81424FC + movs r0, 0x6 + bl sub_814372C + ldr r7, =0x02020630 + ldr r3, =0x0203ab88 + movs r6, 0x5 + negs r6, r6 +_08141D44: + ldr r0, [r3] + adds r0, r4 + adds r0, 0x43 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + adds r1, 0x3E + ldrb r2, [r1] + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xB + bls _08141D44 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r2, r0, r1 + movs r0, 0x22 + ldrsh r1, [r2, r0] + ldr r0, =0x0000270f + cmp r1, r0 + bne _08141DD4 + ldr r4, =0x0203ab8c + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r4] + ldr r2, =gUnknown_082A5C61 + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + ldrb r0, [r4] + movs r1, 0x3 + bl CopyWindowToVram + ldr r1, =sub_8140914 + ldr r2, =0x0000ffff + adds r0, r5, 0 + movs r3, 0x3 + bl sub_8141F7C + b _08141DD8 + .pool +_08141DD4: + ldr r0, =sub_8140914 + str r0, [r2] +_08141DD8: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end dp01t_12_3_battle_menu + + thumb_func_start sub_8141DE4 +sub_8141DE4: @ 8141DE4 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x0203ab88 + ldr r0, [r4] + adds r0, 0xB8 + ldr r1, =0x0000ffff + bl sub_8151A9C + ldr r0, [r4] + adds r0, 0xB8 + bl sub_8151678 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x22] + bl SetCoins + bl GetCoins + ldr r1, [r4] + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1, 0x19] + cmp r0, r1 + bcs _08141E38 + ldr r1, =0x020375e0 + movs r0, 0x1 + b _08141E3C + .pool +_08141E38: + ldr r1, =0x020375e0 + movs r0, 0 +_08141E3C: + strh r0, [r1] + bl GetCoins + lsls r0, 16 + lsrs r0, 16 + bl sub_80EDD78 + movs r0, 0 + str r0, [sp] + movs r0, 0xFF + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A27B0 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8141E7C + str r1, [r0] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8141DE4 + + thumb_func_start sub_8141E7C +sub_8141E7C: @ 8141E7C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl fade_and_return_progress_probably + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _08141EDE + movs r0, 0 + bl SetVBlankCallback + ldr r1, =0x02021bbc + ldr r0, =0x02021bbe + strh r4, [r0] + strh r4, [r1] + bl sub_8121DA0 + bl sub_8121E10 + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + bl ResetObjectPaletteAllocator + bl sub_80A1A74 + bl ResetAllObjectData + bl sub_8140418 + ldr r1, =0x03005dac + ldr r0, =sub_80AF168 + str r0, [r1] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + adds r0, r5, 0 + bl DestroyTask +_08141EDE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8141E7C + + thumb_func_start sub_8141EF8 +sub_8141EF8: @ 8141EF8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x0203ab88 + ldr r3, [r1] + adds r0, r3, 0 + adds r0, 0xA8 + ldrh r0, [r0] + adds r5, r1, 0 + cmp r0, 0 + beq _08141F1E + ldr r0, =0x030022c0 + adds r2, r3, 0 + adds r2, 0xAA + ldrh r1, [r0, 0x2E] + ldrh r0, [r2] + ands r0, r1 + cmp r0, 0 + beq _08141F52 +_08141F1E: + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + adds r1, r3, 0 + adds r1, 0xAC + ldr r1, [r1] + str r1, [r0] + adds r0, r3, 0 + adds r0, 0xAA + ldrh r0, [r0] + cmp r0, 0 + beq _08141F40 + movs r0, 0x5 + bl audio_play +_08141F40: + ldr r2, [r5] + adds r0, r2, 0 + adds r0, 0xAC + movs r1, 0 + str r1, [r0] + subs r0, 0x2 + strh r1, [r0] + subs r0, 0x2 + strh r1, [r0] +_08141F52: + ldr r0, [r5] + adds r1, r0, 0 + adds r1, 0xA8 + ldrh r2, [r1] + ldr r0, =0x0000ffff + cmp r2, r0 + beq _08141F64 + subs r0, r2, 0x1 + strh r0, [r1] +_08141F64: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8141EF8 + + thumb_func_start sub_8141F7C +sub_8141F7C: @ 8141F7C + push {r4-r7,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r2, 16 + lsrs r4, r2, 16 + lsls r3, 16 + lsrs r7, r3, 16 + ldr r2, =0x0203ab88 + ldr r0, [r2] + mov r12, r0 + mov r3, r12 + adds r3, 0xB4 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r0, [r0] + str r0, [r3] + adds r3, r1, 0 + cmp r5, 0 + bne _08141FAC + adds r5, r0, 0 +_08141FAC: + mov r0, r12 + adds r0, 0xAC + str r5, [r0] + subs r0, 0x4 + strh r4, [r0] + ldr r0, =0x0000ffff + cmp r4, r0 + bne _08141FD8 + cmp r7, 0 + bne _08141FD8 + mov r1, r12 + adds r1, 0xAA + ldrh r0, [r1] + orrs r4, r0 + strh r4, [r1] + b _08141FDE + .pool +_08141FD8: + ldr r0, [r2] + adds r0, 0xAA + strh r7, [r0] +_08141FDE: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r3 + ldr r1, =sub_8141EF8 + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8141F7C + + thumb_func_start sub_8141FF4 +sub_8141FF4: @ 8141FF4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r3, =0x0203ab88 + ldr r0, [r3] + strb r4, [r0] + ldr r2, [r3] + ldrb r1, [r2, 0x3] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x3] + ldr r2, [r3] + ldrb r1, [r2, 0x3] + movs r0, 0x21 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x3] + ldr r2, [r3] + ldrb r1, [r2, 0x3] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x3] + ldr r2, [r3] + ldrb r1, [r2, 0x3] + movs r0, 0x20 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x3] + ldr r6, =0x03005e00 + adds r2, r3, 0 + movs r1, 0 +_08142036: + ldr r0, [r2] + adds r0, 0x1B + adds r0, r4 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _08142036 + ldr r2, [r3] + ldrb r1, [r2, 0x1A] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x1A] + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r6 + movs r1, 0 + strh r1, [r0, 0xA] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8141FF4 + + thumb_func_start sub_8142070 +sub_8142070: @ 8142070 + push {lr} + ldr r2, =0x0203ab88 + ldr r1, [r2] + movs r0, 0 + str r0, [r1, 0x8] + movs r1, 0 + movs r3, 0 +_0814207E: + ldr r0, [r2] + adds r0, 0xC + adds r0, r1 + strb r3, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x5 + bls _0814207E + movs r1, 0 + ldr r3, =0x0203ab88 + movs r2, 0 +_08142096: + ldr r0, [r3] + adds r0, 0x12 + adds r0, r1 + strb r2, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bls _08142096 + movs r1, 0 + ldr r3, =0x0203ab88 + movs r2, 0 +_081420AE: + ldr r0, [r3] + adds r0, 0x16 + adds r0, r1 + strb r2, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x2 + bls _081420AE + movs r0, 0x1 + movs r1, 0xFF + bl sub_8143038 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8142070 + + thumb_func_start sub_81420D0 +sub_81420D0: @ 81420D0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x1C + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + mov r1, sp + ldr r0, =gUnknown_085B642C + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldr r0, [r0] + str r0, [r1] + add r2, sp, 0x10 + adds r1, r2, 0 + ldr r0, =gUnknown_085B643C + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + mov r8, r2 + cmp r5, 0xB + bls _0814210C + movs r0, 0 + b _081421C8 + .pool +_0814210C: + ldr r6, =0x0203ab88 + ldr r3, [r6] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r7, 0x14 + ldrsh r1, [r0, r7] + adds r3, r1 + ldr r4, =gUnknown_085B62E4 + lsls r5, 3 + adds r2, r5, r4 + ldrb r1, [r2, 0x2] + strb r1, [r3, 0xB] + ldrb r1, [r2, 0x2] + strh r1, [r0, 0x20] + ldr r2, [r6] + adds r0, r4, 0x4 + adds r0, r5, r0 + ldr r1, [r2, 0x8] + ldr r0, [r0] + orrs r1, r0 + str r1, [r2, 0x8] + movs r3, 0 + mov r9, r4 + mov r12, r5 + adds r5, r0, 0 +_08142144: + lsls r0, r3, 2 + mov r1, sp + adds r4, r1, r0 + ldr r0, [r4] + ands r0, r5 + cmp r0, 0 + beq _0814215E + ldr r1, [r6] + adds r1, 0x12 + adds r1, r3 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0814215E: + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0x12 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0x2 + bls _08142174 + ldr r0, [r2, 0x8] + ldr r1, [r4] + orrs r0, r1 + str r0, [r2, 0x8] +_08142174: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + bls _08142144 + movs r6, 0 + ldr r0, =gUnknown_085B62E8 + add r0, r12 + ldr r7, [r0] + ldr r4, =0x0203ab88 + mov r5, r8 +_0814218A: + lsls r0, r6, 2 + adds r2, r5, r0 + ldr r0, [r2] + ands r0, r7 + cmp r0, 0 + beq _081421A2 + ldr r1, [r4] + adds r1, 0x16 + adds r1, r6 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_081421A2: + ldr r3, [r4] + adds r0, r3, 0 + adds r0, 0x16 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0x3 + bls _081421B8 + ldr r0, [r3, 0x8] + ldr r1, [r2] + orrs r0, r1 + str r0, [r3, 0x8] +_081421B8: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _0814218A + mov r0, r12 + add r0, r9 + ldrb r0, [r0, 0x2] +_081421C8: + add sp, 0x1C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81420D0 + + thumb_func_start sub_81421E8 +sub_81421E8: @ 81421E8 + push {lr} + lsls r0, 24 + lsls r1, 24 + lsrs r2, r1, 24 + lsrs r3, r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x12 + bhi _0814227C + cmp r2, 0xF + bhi _08142278 + lsls r0, r2, 2 + ldr r1, =_08142210 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08142210: + .4byte _08142250 + .4byte _08142254 + .4byte _08142254 + .4byte _08142254 + .4byte _08142254 + .4byte _08142268 + .4byte _08142278 + .4byte _08142278 + .4byte _08142278 + .4byte _08142278 + .4byte _08142268 + .4byte _08142278 + .4byte _08142278 + .4byte _08142278 + .4byte _08142278 + .4byte _08142268 +_08142250: + movs r0, 0x3 + b _0814227E +_08142254: + adds r0, r2, 0x5 + cmp r3, r0 + beq _08142274 + adds r0, 0x5 + cmp r3, r0 + beq _08142274 + adds r0, 0x5 + cmp r3, r0 + bne _0814227C + b _08142274 +_08142268: + adds r0, r2, 0x1 + cmp r3, r0 + blt _0814227C + adds r0, r2, 0x4 + cmp r3, r0 + bgt _0814227C +_08142274: + movs r0, 0x1 + b _0814227E +_08142278: + cmp r3, r2 + beq _08142274 +_0814227C: + movs r0, 0 +_0814227E: + pop {r1} + bx r1 + thumb_func_end sub_81421E8 + + thumb_func_start sub_8142284 +sub_8142284: @ 8142284 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + lsls r0, 24 + lsrs r7, r0, 24 + movs r0, 0 + str r0, [sp, 0x18] + cmp r7, 0xA + beq _081422AA + cmp r7, 0xA + bgt _081422A6 + cmp r7, 0x5 + beq _081422AA + b _0814230C +_081422A6: + cmp r7, 0xF + bne _0814230C +_081422AA: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r2, r7, 0x5 + ldr r1, =0x0203ab88 + mov r12, r1 + cmp r4, r2 + bge _081422E8 + ldr r0, [r1] + ldr r3, =gUnknown_085B6154 + ldr r5, [r0, 0x8] + adds r6, r3, 0 + adds r6, 0x8 +_081422C4: + lsls r0, r4, 2 + adds r0, r4 + lsls r1, r0, 2 + adds r0, r1, r6 + ldr r0, [r0] + ands r0, r5 + cmp r0, 0 + bne _081422DE + adds r0, r1, r3 + ldrh r0, [r0, 0x10] + ldr r1, [sp, 0x18] + orrs r1, r0 + str r1, [sp, 0x18] +_081422DE: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r2 + blt _081422C4 +_081422E8: + mov r2, r12 + ldr r0, [r2] + adds r0, 0xB8 + ldr r1, =0x0000dfff + ldr r3, [sp, 0x18] + ands r3, r1 + str r3, [sp, 0x18] + adds r1, r3, 0 + bl sub_8151A48 + b _081424E2 + .pool +_0814230C: + mov r0, sp + ldr r1, =gUnknown_085B63F0 + ldm r1!, {r2,r4,r5} + stm r0!, {r2,r4,r5} + ldm r1!, {r3-r5} + stm r0!, {r3-r5} + subs r0, r7, 0x1 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + mov r9, r1 + cmp r0, 0x3 + bhi _0814232A + movs r2, 0x3 + mov r9, r2 +_0814232A: + adds r0, r7, 0 + movs r1, 0x5 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 8 + ldr r3, =0xffff0000 + adds r0, r3 + lsrs r0, 16 + mov r8, r0 + adds r0, r7, 0 + movs r1, 0x5 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _08142390 + cmp r0, 0x2 + bgt _08142368 + cmp r0, 0x1 + beq _0814237C + ldr r4, =0x0203ab88 + mov r12, r4 + b _081423D4 + .pool +_08142368: + cmp r0, 0x3 + beq _081423A4 + cmp r0, 0x4 + beq _081423B8 + ldr r5, =0x0203ab88 + mov r12, r5 + b _081423D4 + .pool +_0814237C: + ldr r3, =0x02020630 + ldr r2, =0x0203ab88 + ldr r0, [r2] + adds r0, 0x43 + b _081423C0 + .pool +_08142390: + ldr r3, =0x02020630 + ldr r2, =0x0203ab88 + ldr r0, [r2] + adds r0, 0x44 + b _081423C0 + .pool +_081423A4: + ldr r3, =0x02020630 + ldr r2, =0x0203ab88 + ldr r0, [r2] + adds r0, 0x45 + b _081423C0 + .pool +_081423B8: + ldr r3, =0x02020630 + ldr r2, =0x0203ab88 + ldr r0, [r2] + adds r0, 0x46 +_081423C0: + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + lsls r0, 4 + mov r8, r0 + mov r12, r2 +_081423D4: + mov r0, r9 + cmp r0, 0x1 + bne _08142430 + mov r1, r12 + ldr r4, [r1] + ldr r1, =gUnknown_085B6154 + lsls r2, r7, 2 + adds r0, r2, r7 + lsls r0, 2 + adds r1, 0x8 + adds r0, r1 + ldr r1, [r4, 0x8] + ldr r0, [r0] + ands r1, r0 + str r2, [sp, 0x1C] + cmp r1, 0 + bne _081424E2 + adds r0, r7, 0 + movs r1, 0x5 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + subs r1, r0, 0x1 + lsls r1, 3 + mov r3, sp + adds r2, r3, r1 + ldrh r1, [r2, 0x2] + add r1, r8 + strh r1, [r2, 0x2] + adds r1, r4, 0 + adds r1, 0xB8 + lsls r0, 3 + subs r0, 0x8 + adds r2, r3, r0 + adds r0, r1, 0 + movs r1, 0xD + bl sub_815168C + b _081424C4 + .pool +_08142430: + movs r4, 0 + lsls r5, r7, 2 + str r5, [sp, 0x1C] + ldr r0, =gUnknown_085B6154 + mov r10, r0 +_0814243A: + lsls r0, r4, 2 + adds r0, r4 + adds r0, r7, r0 + adds r0, 0x5 + lsls r0, 24 + lsrs r3, r0, 24 + mov r1, r12 + ldr r5, [r1] + lsls r0, r3, 2 + adds r0, r3 + lsls r6, r0, 2 + mov r0, r10 + adds r0, 0x8 + adds r0, r6, r0 + ldr r1, [r5, 0x8] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _081424B0 + adds r0, r3, 0 + movs r1, 0x5 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + subs r1, r0, 0x1 + lsls r1, 3 + mov r3, sp + adds r2, r3, r1 + ldrh r1, [r2, 0x2] + add r1, r8 + strh r1, [r2, 0x2] + adds r3, r5, 0 + adds r3, 0xB8 + adds r1, r4, 0 + adds r1, 0xD + lsls r1, 24 + lsrs r1, 24 + lsls r0, 3 + subs r0, 0x8 + mov r5, sp + adds r2, r5, r0 + adds r0, r3, 0 + bl sub_815168C + mov r0, r9 + cmp r0, 0x3 + bne _081424A2 + mov r1, r10 + adds r0, r6, r1 + ldrh r0, [r0, 0x10] + str r0, [sp, 0x18] +_081424A2: + mov r0, r9 + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r2, =0x0203ab88 + mov r12, r2 +_081424B0: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _0814243A + mov r3, r9 + cmp r3, 0x2 + beq _081424C4 + movs r4, 0 + str r4, [sp, 0x18] +_081424C4: + ldr r0, =0x0203ab88 + ldr r0, [r0] + adds r0, 0xB8 + ldr r2, =gUnknown_085B6154 + ldr r5, [sp, 0x1C] + adds r1, r5, r7 + lsls r1, 2 + adds r1, r2 + ldrh r1, [r1, 0x10] + ldr r2, [sp, 0x18] + orrs r2, r1 + str r2, [sp, 0x18] + adds r1, r2, 0 + bl sub_8151A48 +_081424E2: + 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_8142284 + + thumb_func_start sub_81424FC +sub_81424FC: @ 81424FC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x0203ab88 + ldr r1, [r4] + movs r0, 0x1 + strh r0, [r1, 0x2A] + movs r0, 0 + movs r1, 0 + bl sub_8142E70 + ldr r1, [r4] + ldr r2, =0x0000117c + adds r0, r1, r2 + ldr r2, =0x0000397c + adds r1, r2 + ldr r1, [r1] + movs r2, 0x10 + str r2, [sp] + movs r2, 0xD + str r2, [sp, 0x4] + movs r2, 0xE + movs r3, 0x7 + bl sub_8152058 + cmp r5, 0xF + bhi _081425FC + lsls r0, r5, 2 + ldr r1, =_08142558 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08142558: + .4byte _08142738 + .4byte _08142598 + .4byte _08142598 + .4byte _08142598 + .4byte _08142598 + .4byte _081425CC + .4byte _081425FC + .4byte _081425FC + .4byte _081425FC + .4byte _081425FC + .4byte _081425CC + .4byte _081425FC + .4byte _081425FC + .4byte _081425FC + .4byte _081425FC + .4byte _081425CC +_08142598: + movs r0, 0x4 + str r0, [sp, 0x18] + add r1, sp, 0x8 + movs r0, 0 + strb r0, [r1] + adds r0, r1, 0 + ldrb r0, [r0] + cmp r0, 0x3 + bhi _08142604 + add r4, sp, 0x10 + adds r3, r1, 0 +_081425AE: + ldrb r2, [r3] + adds r2, r4 + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + adds r0, r5, r0 + strb r0, [r2] + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + ldrb r0, [r3] + ldr r1, [sp, 0x18] + cmp r0, r1 + bcc _081425AE + b _08142604 +_081425CC: + movs r2, 0x5 + str r2, [sp, 0x18] + add r1, sp, 0x8 + movs r0, 0 + strb r0, [r1] + adds r0, r1, 0 + ldrb r0, [r0] + cmp r0, 0x4 + bhi _08142604 + add r3, sp, 0x10 + adds r2, r1, 0 +_081425E2: + ldrb r1, [r2] + adds r1, r3 + ldrb r0, [r2] + adds r0, r5, r0 + strb r0, [r1] + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + ldrb r0, [r2] + ldr r1, [sp, 0x18] + cmp r0, r1 + bcc _081425E2 + b _08142604 +_081425FC: + movs r2, 0x1 + str r2, [sp, 0x18] + add r0, sp, 0x10 + strb r5, [r0] +_08142604: + add r1, sp, 0x8 + movs r0, 0 + strb r0, [r1] + adds r0, r1, 0 + ldrb r0, [r0] + ldr r1, [sp, 0x18] + cmp r0, r1 + bcc _08142616 + b _08142738 +_08142616: + mov r2, sp + adds r2, 0xE + str r2, [sp, 0x1C] + add r0, sp, 0x10 + mov r10, r0 + add r1, sp, 0x8 + mov r9, r1 + subs r2, 0x4 + str r2, [sp, 0x20] +_08142628: + mov r1, r9 + ldrb r0, [r1] + add r0, r10 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + ldr r2, =gUnknown_085B6154 + adds r0, r2 + ldrb r0, [r0, 0x6] + ldr r1, [sp, 0x1C] + strb r0, [r1] + mov r2, r9 + ldrb r0, [r2] + add r0, r10 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_085B6154 + adds r0, r1 + ldrb r0, [r0, 0x3] + ldr r2, [sp, 0x20] + strh r0, [r2] + mov r7, sp + adds r7, 0x9 + movs r0, 0 + strb r0, [r7] + ldrb r0, [r7] + cmp r0, 0x2 + bhi _08142726 + add r6, sp, 0xC + mov r8, r2 + ldr r0, [sp, 0x1C] + mov r12, r0 + ldr r1, =0x0203ab88 + str r1, [sp, 0x28] +_08142672: + mov r2, r9 + ldrb r0, [r2] + add r0, r10 + ldrb r0, [r0] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + ldr r0, =gUnknown_085B6154 + adds r1, r0 + str r7, [sp, 0x24] + ldrb r0, [r7] + ldrb r1, [r1, 0x4] + adds r0, r1 + lsls r0, 5 + strh r0, [r6] + ldr r1, [sp, 0x28] + ldr r4, [r1] + mov r2, r8 + ldrh r0, [r2] + ldrh r2, [r6] + adds r2, r0 + lsls r2, 1 + ldr r0, =0x0000117c + adds r5, r4, r0 + adds r2, r5, r2 + mov r1, r12 + ldrb r0, [r1] + ldrb r1, [r7] + adds r1, r0 + ldr r0, =0x0000397c + adds r4, r0 + ldr r3, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + adds r0, r3 + movs r1, 0xD0 + lsls r1, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + mov r2, r8 + ldrh r0, [r2] + ldrh r2, [r6] + adds r2, r0 + adds r2, 0x1 + lsls r2, 1 + adds r2, r5, r2 + mov r1, r12 + ldrb r0, [r1] + ldrb r1, [r7] + adds r1, r0 + ldr r3, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + adds r0, r3 + movs r1, 0xD1 + lsls r1, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + mov r2, r8 + ldrh r1, [r2] + ldrh r0, [r6] + adds r0, r1 + adds r0, 0x2 + lsls r0, 1 + adds r5, r0 + mov r1, r12 + ldrb r0, [r1] + ldrb r1, [r7] + adds r1, r0 + ldr r2, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + adds r0, r2 + movs r2, 0xD2 + lsls r2, 1 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r5] + ldrb r0, [r7] + adds r0, 0x1 + strb r0, [r7] + ldr r1, [sp, 0x24] + ldrb r0, [r1] + cmp r0, 0x2 + bls _08142672 +_08142726: + mov r2, r9 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + ldrb r0, [r2] + ldr r1, [sp, 0x18] + cmp r0, r1 + bcs _08142738 + b _08142628 +_08142738: + 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_81424FC + + thumb_func_start sub_8142758 +sub_8142758: @ 8142758 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_085B6448 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x13 + bls _08142770 + movs r4, 0 +_08142770: + ldr r3, =gUnknown_085B6154 + lsls r0, r4, 2 + adds r0, r4 + lsls r2, r0, 2 + adds r0, r2, r3 + ldrb r0, [r0, 0x1] + lsls r0, 28 + lsrs r0, 28 + cmp r0, 0x4 + beq _081427C4 + cmp r0, 0x4 + bgt _08142798 + cmp r0, 0x3 + beq _0814279E + b _08142808 + .pool +_08142798: + cmp r0, 0xC + beq _081427E8 + b _08142808 +_0814279E: + adds r0, r4, 0 + movs r1, 0x5 + bl __udivsi3 + subs r0, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0203ab88 + ldr r0, [r0] + adds r0, 0x16 + adds r1, r0, r4 + ldrb r0, [r1] + cmp r0, 0x3 + bhi _08142808 + ldrb r0, [r1] + adds r0, 0x1 + b _081427DC + .pool +_081427C4: + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0203ab88 + ldr r0, [r0] + adds r0, 0x12 + adds r1, r0, r4 + ldrb r0, [r1] + cmp r0, 0x2 + bhi _08142808 + ldrb r0, [r1] + adds r0, 0x2 +_081427DC: + add r0, sp + ldrb r0, [r0] + b _0814280A + .pool +_081427E8: + ldr r0, =0x0203ab88 + ldr r1, [r0] + adds r0, r3, 0 + adds r0, 0x8 + adds r0, r2, r0 + ldr r1, [r1, 0x8] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _08142808 + mov r0, sp + ldrb r0, [r0, 0x4] + b _0814280A + .pool +_08142808: + movs r0, 0 +_0814280A: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8142758 + + thumb_func_start sub_8142814 +sub_8142814: @ 8142814 + push {r4-r6,lr} + ldr r4, =0x0203ab88 + ldr r0, [r4] + ldrh r1, [r0, 0x2C] + movs r0, 0x20 + bl SetGpuReg + ldr r0, [r4] + ldrh r1, [r0, 0x2E] + movs r0, 0x22 + bl SetGpuReg + ldr r0, [r4] + ldrh r1, [r0, 0x30] + movs r0, 0x24 + bl SetGpuReg + ldr r0, [r4] + ldrh r1, [r0, 0x32] + movs r0, 0x26 + bl SetGpuReg + ldr r3, [r4] + movs r0, 0x2E + ldrsh r1, [r3, r0] + ldr r0, =0x02021bbe + movs r4, 0 + ldrsh r2, [r0, r4] + adds r2, 0x50 + adds r0, r1, 0 + muls r0, r2 + movs r4, 0xE8 + lsls r4, 7 + subs r4, r0 + movs r6, 0x2C + ldrsh r5, [r3, r6] + ldr r0, =0x02021bbc + movs r6, 0 + ldrsh r1, [r0, r6] + adds r1, 0x74 + adds r0, r5, 0 + muls r0, r1 + subs r4, r0 + movs r5, 0x32 + ldrsh r0, [r3, r5] + muls r0, r2 + movs r5, 0xA8 + lsls r5, 7 + subs r5, r0 + movs r6, 0x30 + ldrsh r0, [r3, r6] + muls r0, r1 + subs r5, r0 + lsls r1, r4, 16 + lsrs r1, 16 + movs r0, 0x28 + bl SetGpuReg + ldr r6, =0x0fff0000 + ands r4, r6 + lsrs r4, 16 + movs r0, 0x2A + adds r1, r4, 0 + bl SetGpuReg + lsls r1, r5, 16 + lsrs r1, 16 + movs r0, 0x2C + bl SetGpuReg + ands r5, r6 + lsrs r5, 16 + movs r0, 0x2E + adds r1, r5, 0 + bl SetGpuReg + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8142814 + + thumb_func_start sub_81428C4 +sub_81428C4: @ 81428C4 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8197930 + ldr r1, =gUnknown_085B6408 + adds r0, r4, 0 + bl sub_8121F68 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81428C4 + + thumb_func_start sub_81428E4 +sub_81428E4: @ 81428E4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08142908 + movs r0, 0 + bl SetVBlankCallback + ldr r0, =sub_81405CC + bl SetMainCallback2 + adds r0, r4, 0 + bl DestroyTask +_08142908: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81428E4 + + thumb_func_start sub_8142918 +sub_8142918: @ 8142918 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0x1 + bl sub_819746C + bl HideCoinsWindow + bl FreeAllWindowBuffers + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + lsls r1, 26 + lsrs r1, 26 + ldrb r3, [r2, 0x4] + movs r0, 0x40 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2, 0x4] + bl fade_and_return_progress_probably + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81428E4 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8142918 + + thumb_func_start sub_814297C +sub_814297C: @ 814297C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0 + bl sub_819746C + bl HideCoinsWindow + bl script_env_2_disable + adds r0, r4, 0 + bl DestroyTask + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_814297C + + thumb_func_start sub_81429A0 +sub_81429A0: @ 81429A0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081429DE + ldr r1, =0x020375e0 + movs r0, 0x1 + strh r0, [r1] + bl HideCoinsWindow + movs r0, 0 + movs r1, 0x1 + bl sub_819746C + bl script_env_2_disable + adds r0, r4, 0 + bl DestroyTask +_081429DE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81429A0 + + thumb_func_start sub_81429F0 +sub_81429F0: @ 81429F0 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08142A60 + ldr r2, =gUnknown_085B6344 + ldr r0, =0x020375e0 + ldrh r1, [r0] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + lsrs r1, 7 + lsls r1, 1 + adds r0, r1 + adds r0, r2 + ldrb r1, [r0] + ldr r0, =0x02021cc4 + movs r2, 0x2 + movs r3, 0x1 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_082A5B12 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + movs r1, 0 + bl sub_81973FC + str r5, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl Print + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81428C4 + str r1, [r0] +_08142A60: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81429F0 + + thumb_func_start sub_8142A88 +sub_8142A88: @ 8142A88 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r6, r0, r1 + movs r1, 0x22 + ldrsh r0, [r6, r1] + bl PrintCoinsString + ldr r2, =gUnknown_085B6344 + ldr r0, =0x020375e0 + mov r8, r0 + ldrh r1, [r0] + movs r7, 0x1 + adds r0, r7, 0 + ands r0, r1 + lsrs r1, 7 + lsls r1, 1 + adds r0, r1 + adds r0, r2 + ldrb r4, [r0] + ldr r0, =0x02021cc4 + adds r1, r4, 0 + movs r2, 0x2 + movs r3, 0x1 + bl ConvertIntToDecimalString + movs r1, 0x22 + ldrsh r0, [r6, r1] + cmp r0, r4 + blt _08142B78 + mov r0, r8 + ldrh r1, [r0] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08142B28 + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08142B28 + movs r0, 0 + movs r1, 0 + bl sub_81973FC + ldr r2, =gUnknown_082A5B6B + str r7, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =sub_81429F0 + str r0, [r6] + b _08142BB0 + .pool +_08142B28: + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_082A5B12 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + movs r1, 0 + bl sub_81973FC + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl Print + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_81428C4 + str r1, [r0] + b _08142BB0 + .pool +_08142B78: + ldr r5, =0x02021fc4 + ldr r1, =gUnknown_082A5B4E + adds r0, r5, 0 + bl ExpandStringRefs + movs r0, 0 + movs r1, 0 + bl sub_81973FC + str r7, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + movs r0, 0 + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0 + bl Print + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =sub_81429A0 + str r0, [r6] + strh r4, [r6, 0x22] + strh r4, [r6, 0x8] +_08142BB0: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8142A88 + + thumb_func_start sub_8142BC8 +sub_8142BC8: @ 8142BC8 + push {r4,lr} + bl script_env_2_enable + bl GetCoins + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + movs r2, 0x1 + bl ShowCoinsWindow + ldr r0, =sub_8142A88 + movs r1, 0 + bl CreateTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl GetCoins + ldr r2, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r2 + strh r0, [r1, 0x22] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8142BC8 + + thumb_func_start sub_8142C0C +sub_8142C0C: @ 8142C0C + push {lr} + lsls r0, 24 + cmp r0, 0 + bne _08142C44 + bl ResetObjectPaletteAllocator + ldr r0, =gUnknown_085B7384 + bl LoadTaggedObjectPalettes + ldr r0, =gUnknown_085B7864 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085B7978 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085B7A40 + bl LoadCompressedObjectPic + b _08142C5A + .pool +_08142C44: + movs r0, 0xE + bl FreeObjectTilesByTag + movs r0, 0xD + bl FreeObjectTilesByTag + movs r0, 0xC + bl FreeObjectTilesByTag + bl ResetObjectPaletteAllocator +_08142C5A: + pop {r0} + bx r0 + thumb_func_end sub_8142C0C + + thumb_func_start sub_8142C60 +sub_8142C60: @ 8142C60 + push {r4-r6,lr} + adds r4, r1, 0 + adds r6, r2, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, [r0, 0x4] + ldrb r3, [r1] + movs r1, 0x74 + movs r2, 0x50 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r0, =0x02020630 + lsls r1, r5, 4 + adds r1, r5 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r6] + strh r0, [r1, 0x2E] + strh r4, [r1, 0x30] + adds r3, r1, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r3] + adds r1, 0x2C + ldrb r0, [r1] + movs r2, 0x40 + orrs r0, r2 + movs r2, 0x80 + orrs r0, r2 + strb r0, [r1] + ldrh r2, [r6] + adds r0, r2, 0 + adds r0, 0x1E + strh r0, [r6] + lsls r0, 16 + ldr r1, =0x01670000 + cmp r0, r1 + bls _08142CBC + ldr r1, =0xfffffeb6 + adds r0, r2, r1 + strh r0, [r6] +_08142CBC: + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8142C60 + + thumb_func_start sub_8142CD0 +sub_8142CD0: @ 8142CD0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + ldr r4, =gUnknown_085B7488 + ldr r0, [r4] + ldr r5, =0x0201c000 + adds r1, r5, 0 + bl LZ77UnCompWram + str r5, [sp] + mov r6, sp + ldrh r1, [r4, 0x6] + lsls r1, 16 + ldrh r0, [r4, 0x4] + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl LoadObjectPic + ldr r4, =gUnknown_085B7490 + ldr r0, [r4] + adds r1, r5, 0 + bl LZ77UnCompWram + str r5, [sp] + ldrh r0, [r4, 0x4] + strh r0, [r6, 0x4] + ldrh r0, [r4, 0x6] + strh r0, [r6, 0x6] + mov r0, sp + bl LoadObjectPic + movs r6, 0 + ldr r0, =0x02020630 + mov r8, r0 +_08142D18: + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 27 + lsrs r4, r0, 24 + movs r5, 0 + lsls r7, r6, 2 +_08142D24: + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 3 + ldr r0, =gUnknown_085B75B0 + adds r0, r1, r0 + adds r1, 0x94 + adds r2, r4, 0 + adds r2, 0x5C + movs r3, 0x1E + bl AddObjectToFront + ldr r1, =0x0203ab88 + ldr r1, [r1] + adds r2, r5, 0 + adds r2, 0x1D + adds r2, r7, r2 + adds r1, 0x3C + adds r1, r2 + strb r0, [r1] + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + adds r0, r4, 0 + adds r0, 0x18 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x47 + bls _08142D6E + movs r4, 0 +_08142D6E: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _08142D24 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _08142D18 + movs r6, 0 + ldr r4, =0x02020630 +_08142D86: + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 3 + ldr r0, =gUnknown_085B7508 + adds r0, r1, r0 + adds r1, 0x94 + lsls r1, 16 + asrs r1, 16 + movs r2, 0x46 + movs r3, 0x1E + bl AddObjectToFront + ldr r1, =0x0203ab88 + ldr r1, [r1] + adds r1, r6 + adds r1, 0x65 + strb r0, [r1] + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _08142D86 + movs r6, 0 + ldr r4, =0x02020630 +_08142DCC: + lsls r2, r6, 1 + adds r2, r6 + lsls r2, 3 + ldr r0, =gUnknown_085B7568 + adds r0, r2, r0 + adds r2, 0x5C + lsls r2, 16 + asrs r2, 16 + movs r1, 0x7E + movs r3, 0x1E + bl AddObjectToFront + ldr r1, =0x0203ab88 + ldr r1, [r1] + adds r1, r6 + adds r1, 0x69 + strb r0, [r1] + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bls _08142DCC + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8142CD0 + + thumb_func_start sub_8142E3C +sub_8142E3C: @ 8142E3C + push {r4,lr} + movs r4, 0 +_08142E40: + ldr r0, =0x0203ab88 + ldr r0, [r0] + adds r0, r4 + adds r0, 0x59 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xB + bls _08142E40 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8142E3C + + thumb_func_start sub_8142E70 +sub_8142E70: @ 8142E70 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r12, r1 + cmp r0, 0 + beq _08142EC0 + cmp r0, 0x1 + bne _08142F66 + movs r4, 0 + ldr r5, =0x02020630 + ldr r3, =0x0203ab88 + movs r2, 0x4 +_08142E92: + ldr r0, [r3] + adds r0, r4 + adds r0, 0x59 + 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, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x12 + bls _08142E92 + b _08142F66 + .pool +_08142EC0: + movs r4, 0 + ldr r0, =0x0203ab88 + mov r9, r0 + ldr r7, =gUnknown_085B62E4 + adds r1, r7, 0x4 + mov r8, r1 + ldr r5, =0x02020630 + movs r6, 0x5 + negs r6, r6 +_08142ED2: + mov r0, r9 + ldr r2, [r0] + lsls r3, r4, 3 + mov r1, r8 + adds r0, r3, r1 + ldr r1, [r2, 0x8] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + beq _08142F14 + adds r0, r3, r7 + ldrb r0, [r0, 0x2] + cmp r0, r12 + beq _08142F14 + adds r0, r2, r4 + adds r0, 0x59 + ldrb r1, [r0] + 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] + b _08142F2C + .pool +_08142F14: + adds r0, r2, r4 + adds r0, 0x59 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r2, [r1] + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1] +_08142F2C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xB + bls _08142ED2 + cmp r4, 0x12 + bhi _08142F66 + ldr r6, =0x02020630 + ldr r3, =0x0203ab88 + movs r5, 0x5 + negs r5, r5 +_08142F42: + ldr r0, [r3] + adds r0, r4 + adds r0, 0x59 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + adds r1, 0x3E + ldrb r2, [r1] + adds r0, r5, 0 + ands r0, r2 + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x12 + bls _08142F42 +_08142F66: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8142E70 + + thumb_func_start sub_8142F7C +sub_8142F7C: @ 8142F7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r5, 0 + ldr r6, =0x0203ab88 + ldr r4, =0x02020630 + movs r0, 0x4 + mov r8, r0 +_08142F8C: + ldr r0, =gUnknown_085B7928 + movs r1, 0x74 + movs r2, 0x14 + movs r3, 0xA + bl AddObjectToFront + ldr r1, [r6] + adds r3, r5, 0 + adds r3, 0x31 + adds r1, 0x3C + adds r1, r3 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x3C + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x3E + ldrb r1, [r0] + mov r2, r8 + orrs r1, r2 + strb r1, [r0] + ldr r2, [r6] + adds r2, 0x3C + adds r2, r3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + strh r1, [r0, 0x2E] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_814390C + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x5] + movs r7, 0xD + negs r7, r7 + adds r2, r7, 0 + ands r1, r2 + mov r2, r8 + orrs r1, r2 + strb r1, [r0, 0x5] + ldr r0, [r6] + adds r0, 0x3C + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x8 + bl StartObjectImageAnim + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _08142F8C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8142F7C + + thumb_func_start sub_8143038 +sub_8143038: @ 8143038 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + movs r6, 0 + cmp r0, 0 + beq _08143084 + ldr r4, =0x02020630 + ldr r3, =0x0203ab88 + movs r2, 0x4 +_08143056: + ldr r0, [r3] + adds r0, r6 + adds r0, 0x6D + ldrb r1, [r0] + 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] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x5 + bls _08143056 + b _08143142 + .pool +_08143084: + ldr r0, =0x0203ab88 + mov r8, r0 + ldr r7, =0x02020630 + ldr r0, =gUnknown_085B6154 + mov r12, r0 + movs r0, 0x5 + negs r0, r0 + mov r10, r0 +_08143094: + mov r0, r8 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xC + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0 + beq _081430A8 + cmp r6, r9 + bne _081430D0 +_081430A8: + adds r0, r1, r6 + adds r0, 0x6D + 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] + b _08143138 + .pool +_081430D0: + adds r5, r6, 0 + adds r5, 0x31 + adds r0, r1, 0 + adds r0, 0x3C + adds r0, r5 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + adds r1, 0x3E + ldrb r2, [r1] + mov r0, r10 + ands r0, r2 + strb r0, [r1] + mov r0, r8 + ldr r3, [r0] + adds r4, r3, 0 + adds r4, 0x3C + adds r4, r5 + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r7 + adds r3, 0xC + adds r3, r6 + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + add r0, r12 + ldrb r0, [r0, 0x3] + adds r0, 0x1 + lsls r0, 3 + adds r0, 0x4 + strh r0, [r2, 0x20] + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r7 + ldrb r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + add r0, r12 + ldrb r0, [r0, 0x4] + adds r0, 0x1 + lsls r0, 3 + adds r0, 0x3 + strh r0, [r2, 0x22] +_08143138: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x5 + bls _08143094 +_08143142: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8143038 + + thumb_func_start sub_8143150 +sub_8143150: @ 8143150 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _08143180 + ldr r2, =0x02020630 + ldr r0, =0x0203ab88 + ldr r0, [r0] + adds r0, 0x6C + 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] + b _081431D0 + .pool +_08143180: + ldr r4, =0x02020630 + ldr r3, =0x0203ab88 + ldr r0, [r3] + adds r0, 0x6C + ldrb r1, [r0] + 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] + ldr r3, [r3] + adds r3, 0x6C + ldrb r0, [r3] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldr r0, =gUnknown_085B6154 + lsls r2, r5, 2 + adds r2, r5 + lsls r2, 2 + adds r2, r0 + ldrb r0, [r2, 0x3] + adds r0, 0x2 + lsls r0, 3 + strh r0, [r1, 0x20] + ldrb r0, [r3] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r0, [r2, 0x4] + adds r0, 0x2 + lsls r0, 3 + strh r0, [r1, 0x22] +_081431D0: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8143150 + + thumb_func_start sub_81431E4 +sub_81431E4: @ 81431E4 + push {r4-r7,lr} + sub sp, 0xC + ldr r4, =gUnknown_085B741C + ldr r0, [r4] + ldr r5, =0x0201c000 + adds r1, r5, 0 + bl LZ77UnCompWram + str r5, [sp, 0x4] + add r0, sp, 0x4 + ldrh r2, [r4, 0x6] + lsls r2, 16 + ldrh r1, [r4, 0x4] + orrs r1, r2 + str r1, [r0, 0x4] + bl LoadObjectPic + movs r1, 0xF + mov r0, sp + strh r1, [r0] + movs r0, 0 + ldr r7, =0x02020630 +_08143210: + movs r4, 0 + adds r6, r0, 0x1 + lsls r5, r0, 2 +_08143216: + adds r1, r5, r4 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + ldr r1, =gUnknown_085B7610 + adds r0, r1 + movs r1, 0x28 + mov r2, sp + bl sub_8142C60 + ldr r1, =0x0203ab88 + ldr r1, [r1] + adds r2, r4, 0x7 + adds r2, r5, r2 + adds r1, 0x3C + adds r1, r2 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r7 + adds r1, 0x2C + ldrb r0, [r1] + movs r2, 0x40 + orrs r0, r2 + movs r2, 0x80 + orrs r0, r2 + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _08143216 + lsls r0, r6, 24 + lsrs r0, 24 + cmp r0, 0x2 + bls _08143210 + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81431E4 + + thumb_func_start sub_8143280 +sub_8143280: @ 8143280 + push {r4-r6,lr} + adds r6, r0, 0 + ldr r0, =0x0203ab88 + ldr r1, [r0] + ldrh r0, [r6, 0x2E] + ldrh r1, [r1, 0x24] + adds r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + asrs r1, r0, 16 + ldr r0, =0x00000167 + cmp r1, r0 + ble _081432A2 + ldr r2, =0xfffffe98 + adds r0, r1, r2 + lsls r0, 16 + lsrs r4, r0, 16 +_081432A2: + adds r0, r4, 0 + bl sine2 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + bl cosine2 + lsls r2, r5, 16 + asrs r2, 16 + movs r3, 0x30 + ldrsh r1, [r6, r3] + muls r1, r2 + asrs r1, 12 + strh r1, [r6, 0x24] + lsls r0, 16 + asrs r4, r0, 16 + negs r1, r4 + movs r3, 0x30 + ldrsh r0, [r6, r3] + muls r0, r1 + asrs r0, 12 + strh r0, [r6, 0x26] + ldrb r0, [r6, 0x3] + lsls r0, 26 + lsrs r3, r0, 27 + cmp r2, 0 + bge _081432DC + adds r2, 0xF +_081432DC: + lsls r0, r2, 12 + lsrs r5, r0, 16 + ldr r1, =0x02021bc0 + lsls r0, r3, 3 + adds r1, r0, r1 + adds r0, r4, 0 + cmp r0, 0 + bge _081432EE + adds r0, 0xF +_081432EE: + asrs r0, 4 + strh r0, [r1, 0x6] + strh r0, [r1] + strh r5, [r1, 0x2] + lsls r0, r5, 16 + asrs r0, 16 + negs r0, r0 + strh r0, [r1, 0x4] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8143280 + + thumb_func_start sub_8143314 +sub_8143314: @ 8143314 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + movs r5, 0 + ldr r7, =0x0201c000 + mov r6, sp +_08143322: + ldr r0, =gUnknown_085B7750 + lsls r4, r5, 3 + adds r4, r0 + ldr r0, [r4] + adds r1, r7, 0 + bl LZ77UnCompWram + str r7, [sp] + ldrh r2, [r4, 0x4] + ldr r0, =0xffff0000 + ldr r1, [r6, 0x4] + ands r1, r0 + orrs r1, r2 + str r1, [r6, 0x4] + ldrh r2, [r4, 0x6] + lsls r2, 16 + ldr r0, =0x0000ffff + ands r0, r1 + orrs r0, r2 + str r0, [r6, 0x4] + mov r0, sp + bl LoadObjectPic + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _08143322 + ldr r0, =gUnknown_085B77E4 + movs r1, 0xD0 + movs r2, 0x10 + movs r3, 0x4 + bl AddObjectToFront + ldr r3, =0x0203ab88 + ldr r1, [r3] + adds r1, 0x50 + strb r0, [r1] + ldr r4, =0x02020630 + ldr r0, [r3] + adds r0, 0x50 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + movs r5, 0 + adds r7, r3, 0 +_0814338C: + lsls r1, r5, 19 + movs r0, 0xC4 + lsls r0, 16 + adds r1, r0 + asrs r1, 16 + ldr r0, =gUnknown_085B77FC + movs r2, 0x18 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + adds r3, r5, 0 + adds r3, 0x15 + adds r1, 0x3C + adds r1, r3 + strb r0, [r1] + ldr r0, [r7] + adds r0, 0x3C + adds r0, r3 + ldrb r1, [r0] + 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, [r7] + adds r0, 0x3C + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x2C + ldrb r1, [r0] + movs r6, 0x40 + orrs r1, r6 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _0814338C + ldr r0, =gUnknown_085B7814 + movs r1, 0x78 + movs r2, 0x44 + movs r3, 0x4 + bl AddObjectToFront + ldr r2, =0x0203ab88 + ldr r1, [r2] + adds r1, 0x55 + strb r0, [r1] + ldr r3, =0x02020630 + ldr r0, [r2] + adds r0, 0x55 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x2C + ldrb r1, [r0] + orrs r1, r6 + strb r1, [r0] + movs r5, 0 + adds r4, r2, 0 + adds r7, r3, 0 +_0814341C: + lsls r1, r5, 20 + movs r2, 0xC0 + lsls r2, 16 + adds r1, r2 + asrs r1, 16 + ldr r0, =gUnknown_085B782C + movs r2, 0x24 + movs r3, 0x4 + bl AddObjectToFront + ldr r1, [r4] + adds r2, r5, 0 + adds r2, 0x1A + adds r1, 0x3C + adds r1, r2 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0x3C + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + adds r0, 0x3E + ldrb r1, [r0] + movs r3, 0x4 + mov r8, r3 + mov r3, r8 + orrs r1, r3 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x3C + adds r0, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + adds r0, 0x2C + ldrb r1, [r0] + movs r6, 0x40 + orrs r1, r6 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _0814341C + ldr r0, =gUnknown_085B7844 + movs r1, 0x98 + movs r2, 0x60 + movs r3, 0x9 + bl AddObjectToFront + ldr r3, =0x0203ab88 + ldr r1, [r3] + adds r1, 0x6C + strb r0, [r1] + ldr r4, =0x02020630 + ldr r0, [r3] + adds r0, 0x6C + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + mov r2, r8 + orrs r0, r2 + strb r0, [r1, 0x5] + ldr r0, [r3] + adds r0, 0x6C + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x2C + ldrb r1, [r0] + orrs r1, r6 + strb r1, [r0] + ldr r0, [r3] + adds r0, 0x6C + ldrb r1, [r0] + 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] + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8143314 + + thumb_func_start sub_8143514 +sub_8143514: @ 8143514 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r7, r0, 16 + movs r0, 0xFA + lsls r0, 2 + mov r8, r0 + movs r4, 0 + movs r6, 0 + ldr r1, =0x02020630 + mov r9, r1 + ldr r0, =0x0203ab88 + mov r10, r0 +_08143534: + adds r0, r7, 0 + mov r1, r8 + bl __udivsi3 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x0203ab88 + ldr r0, [r1] + adds r3, r6, 0 + adds r3, 0x15 + adds r0, 0x3C + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + cmp r5, 0 + bne _0814356E + cmp r4, 0 + bne _0814356E + cmp r6, 0x3 + bne _081435CC +_0814356E: + mov r4, r10 + ldr r0, [r4] + adds r0, 0x3C + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r9 + adds r0, 0x3E + ldrb r1, [r0] + movs r4, 0x5 + negs r4, r4 + adds r2, r4, 0 + ands r1, r2 + strb r1, [r0] + mov r1, r10 + ldr r0, [r1] + adds r0, 0x3C + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + mov r4, r9 + adds r3, r0, r4 + adds r4, r3, 0 + adds r4, 0x40 + ldr r1, =0x02020638 + adds r0, r1 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r5, 2 + adds r0, r1 + ldrh r2, [r0] + ldrh r4, [r4] + adds r2, r4 + ldr r4, =0x000003ff + adds r0, r4, 0 + ands r2, r0 + ldrh r0, [r3, 0x4] + ldr r4, =0xfffffc00 + adds r1, r4, 0 + ands r0, r1 + orrs r0, r2 + strh r0, [r3, 0x4] + movs r4, 0x1 +_081435CC: + adds r0, r7, 0 + mov r1, r8 + bl __umodsi3 + lsls r0, 16 + lsrs r7, r0, 16 + mov r0, r8 + movs r1, 0xA + bl __udivsi3 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x3 + bls _08143534 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8143514 + + thumb_func_start sub_8143614 +sub_8143614: @ 8143614 + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_085B7B04 + mov r0, sp + movs r2, 0x5 + bl memcpy + cmp r4, 0x13 + bls _0814362C + movs r4, 0 +_0814362C: + ldr r3, =gUnknown_085B6154 + lsls r0, r4, 2 + adds r0, r4 + lsls r2, r0, 2 + adds r0, r2, r3 + ldrb r0, [r0, 0x1] + lsls r0, 28 + lsrs r0, 28 + cmp r0, 0x4 + beq _08143680 + cmp r0, 0x4 + bgt _08143654 + cmp r0, 0x3 + beq _0814365A + b _081436C4 + .pool +_08143654: + cmp r0, 0xC + beq _081436A4 + b _081436C4 +_0814365A: + adds r0, r4, 0 + movs r1, 0x5 + bl __udivsi3 + subs r0, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0203ab88 + ldr r0, [r0] + adds r0, 0x16 + adds r1, r0, r4 + ldrb r0, [r1] + cmp r0, 0x3 + bhi _081436C4 + ldrb r0, [r1] + adds r0, 0x1 + b _08143698 + .pool +_08143680: + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0203ab88 + ldr r0, [r0] + adds r0, 0x12 + adds r1, r0, r4 + ldrb r0, [r1] + cmp r0, 0x2 + bhi _081436C4 + ldrb r0, [r1] + adds r0, 0x2 +_08143698: + add r0, sp + ldrb r0, [r0] + b _081436C6 + .pool +_081436A4: + ldr r0, =0x0203ab88 + ldr r1, [r0] + adds r0, r3, 0 + adds r0, 0x8 + adds r0, r2, r0 + ldr r1, [r1, 0x8] + ldr r0, [r0] + ands r1, r0 + cmp r1, 0 + bne _081436C4 + mov r0, sp + ldrb r0, [r0, 0x4] + b _081436C6 + .pool +_081436C4: + movs r0, 0 +_081436C6: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8143614 + + thumb_func_start sub_81436D0 +sub_81436D0: @ 81436D0 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0203ab88 + ldr r1, [r1] + adds r1, 0x55 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + ldr r2, =0x02020630 + adds r4, r1, r2 + bl sub_8143614 + adds r3, r4, 0 + adds r3, 0x2B + strb r0, [r3] + adds r2, r4, 0 + adds r2, 0x40 + ldr r1, [r4, 0x8] + ldrb r0, [r3] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0] + ldrh r2, [r2] + adds r1, r2 + ldr r2, =0x000003ff + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r4, 0x4] + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81436D0 + + thumb_func_start sub_814372C +sub_814372C: @ 814372C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r2, r0, 24 + movs r6, 0 + ldr r1, =0x0203ab88 + ldr r0, [r1] + ldrb r0, [r0, 0x19] + adds r5, r1, 0 + cmp r0, 0x1 + bne _08143746 + movs r6, 0x2 +_08143746: + cmp r2, 0x6 + bls _0814374C + b _081438A8 +_0814374C: + lsls r0, r2, 2 + ldr r1, =_08143760 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08143760: + .4byte _081438A8 + .4byte _08143864 + .4byte _0814383C + .4byte _08143830 + .4byte _08143808 + .4byte _081437FC + .4byte _0814377C +_0814377C: + movs r4, 0 + ldr r5, =0x02020630 + ldr r6, =0x0203ab88 + movs r0, 0x5 + negs r0, r0 + mov r12, r0 + adds r7, r5, 0 + adds r7, 0x8 + ldr r2, =0xfffffc00 + mov r8, r2 +_08143790: + ldr r0, [r6] + adds r3, r4, 0 + adds r3, 0x1A + adds r0, 0x3C + adds r0, r3 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r1, 0x3E + ldrb r2, [r1] + mov r0, r12 + ands r0, r2 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x3C + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, r0, r5 + adds r2, r3, 0 + adds r2, 0x40 + adds r0, r7 + ldr r0, [r0] + ldr r0, [r0] + ldrh r1, [r0] + ldrh r2, [r2] + adds r1, r2 + ldr r2, =0x000003ff + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r3, 0x4] + mov r0, r8 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x4] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _08143790 + b _081438F4 + .pool +_081437FC: + ldr r2, =0x02020630 + ldr r0, [r5] + adds r0, 0x58 + b _0814386A + .pool +_08143808: + ldr r2, =0x02020630 + ldr r0, [r5] + adds r0, 0x58 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, r0, r2 + adds r4, r3, 0 + adds r4, 0x40 + adds r2, 0x8 + adds r0, r2 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r6, 2 + adds r0, r1 + ldrh r1, [r0, 0x8] + b _08143886 + .pool +_08143830: + ldr r2, =0x02020630 + ldr r0, [r5] + adds r0, 0x57 + b _0814386A + .pool +_0814383C: + ldr r2, =0x02020630 + ldr r0, [r5] + adds r0, 0x57 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, r0, r2 + adds r4, r3, 0 + adds r4, 0x40 + adds r2, 0x8 + adds r0, r2 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r6, 2 + adds r0, r1 + ldrh r1, [r0, 0x8] + b _08143886 + .pool +_08143864: + ldr r2, =0x02020630 + ldr r0, [r5] + adds r0, 0x56 +_0814386A: + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, r0, r2 + adds r4, r3, 0 + adds r4, 0x40 + adds r2, 0x8 + adds r0, r2 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r6, 2 + adds r0, r1 + ldrh r1, [r0, 0x4] +_08143886: + ldrh r4, [r4] + adds r1, r4 + ldr r2, =0x000003ff + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r3, 0x4] + ldr r0, =0xfffffc00 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x4] + b _081438F4 + .pool +_081438A8: + movs r4, 0 + lsls r7, r6, 2 + ldr r6, =0x02020630 + movs r0, 0x8 + adds r0, r6 + mov r12, r0 + ldr r2, =0xfffffc00 + mov r8, r2 +_081438B8: + ldr r0, [r5] + adds r0, r4 + adds r0, 0x56 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, r0, r6 + adds r2, r3, 0 + adds r2, 0x40 + add r0, r12 + ldr r0, [r0] + ldr r0, [r0] + adds r0, r7, r0 + ldrh r1, [r0, 0x8] + ldrh r2, [r2] + adds r1, r2 + ldr r2, =0x000003ff + adds r0, r2, 0 + ands r1, r0 + ldrh r2, [r3, 0x4] + mov r0, r8 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x4] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _081438B8 +_081438F4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814372C + + thumb_func_start sub_814390C +sub_814390C: @ 814390C + ldr r1, =0x0203ab88 + ldr r1, [r1] + ldrh r1, [r1, 0x26] + strh r1, [r0, 0x24] + bx lr + .pool + thumb_func_end sub_814390C + + thumb_func_start sub_814391C +sub_814391C: @ 814391C + push {r4,r5,lr} + sub sp, 0x8 + ldr r4, =gUnknown_085B7948 + ldr r0, [r4] + ldr r5, =0x0201c000 + adds r1, r5, 0 + bl LZ77UnCompWram + str r5, [sp] + ldrh r1, [r4, 0x6] + lsls r1, 16 + ldrh r0, [r4, 0x4] + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, sp + bl LoadObjectPic + ldr r0, =gUnknown_085B7950 + movs r1, 0x74 + movs r2, 0x50 + movs r3, 0x51 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldr r0, =0x0203ab88 + ldr r0, [r0] + ldrh r0, [r0, 0x24] + movs r2, 0 + strh r0, [r1, 0x2E] + strh r2, [r1, 0x30] + adds r3, r1, 0 + adds r3, 0x2C + ldrb r0, [r3] + movs r2, 0x40 + orrs r0, r2 + movs r2, 0x80 + orrs r0, r2 + strb r0, [r3] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r1] + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_814391C + + thumb_func_start sub_814399C +sub_814399C: @ 814399C + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + ldr r1, =0x02021bc0 + lsls r0, 3 + adds r0, r1 + ldr r1, =0x0203ab88 + ldr r2, [r1] + ldrh r1, [r2, 0x2C] + strh r1, [r0, 0x6] + ldrh r1, [r2, 0x2C] + strh r1, [r0] + ldrh r1, [r2, 0x2E] + strh r1, [r0, 0x2] + ldrh r1, [r2, 0x30] + strh r1, [r0, 0x4] + bx lr + .pool + thumb_func_end sub_814399C + + thumb_func_start sub_81439C8 +sub_81439C8: @ 81439C8 + push {r4-r6,lr} + movs r4, 0 + ldr r5, =0x0203ab88 + ldr r6, =0x02020630 +_081439D0: + movs r3, 0x39 + subs r3, r4 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =gUnknown_085B7928 + movs r1, 0x74 + movs r2, 0x50 + bl AddObjectToFront + ldr r1, [r5] + adds r1, 0x3C + adds r1, r4 + strb r0, [r1] + ldr r0, [r5] + adds r0, 0x3C + adds r1, r0, r4 + ldrb r0, [r1] + cmp r0, 0x40 + beq _08143A24 + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r5] + adds r0, 0x3C + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0] +_08143A24: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _081439D0 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81439C8 + + thumb_func_start sub_8143A40 +sub_8143A40: @ 8143A40 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =0x0203ab88 + ldr r0, [r0] + adds r0, 0x3C + ldrb r5, [r0] + movs r6, 0 + ldr r7, =0x02020630 + movs r0, 0x1C + adds r0, r7 + mov r10, r0 + movs r1, 0x2E + adds r1, r7 + mov r9, r1 + mov r8, r6 +_08143A64: + lsls r4, r5, 4 + adds r4, r5 + lsls r4, 2 + adds r0, r4, r7 + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r3] + mov r1, r10 + adds r2, r4, r1 + ldr r1, =DummyObjectCallback + str r1, [r2] + movs r1, 0 + bl StartObjectImageAnim + movs r1, 0 + adds r2, r5, 0x1 + adds r3, r6, 0x1 +_08143A8C: + lsls r0, r1, 1 + adds r0, r4 + add r0, r9 + mov r5, r8 + strh r5, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x7 + bls _08143A8C + lsls r0, r2, 24 + lsrs r5, r0, 24 + lsls r0, r3, 24 + lsrs r6, r0, 24 + cmp r6, 0x5 + bls _08143A64 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8143A40 + + thumb_func_start sub_8143AC8 +sub_8143AC8: @ 8143AC8 + push {r4,r5,lr} + adds r3, r0, 0 + ldr r0, =0x0203ab88 + ldr r0, [r0] + ldrh r4, [r0, 0x24] + movs r2, 0x24 + ldrsh r1, [r0, r2] + ldrh r2, [r3, 0x34] + movs r5, 0x34 + ldrsh r0, [r3, r5] + cmp r1, r0 + ble _08143B04 + movs r1, 0xB4 + lsls r1, 1 + adds r0, r2, r1 + subs r2, r0, r4 + strh r2, [r3, 0x3A] + lsls r1, r2, 16 + ldr r0, =0x01670000 + cmp r1, r0 + ble _08143B08 + ldr r5, =0xfffffe98 + adds r0, r2, r5 + b _08143B06 + .pool +_08143B04: + subs r0, r2, r4 +_08143B06: + strh r0, [r3, 0x3A] +_08143B08: + movs r1, 0x3A + ldrsh r0, [r3, r1] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8143AC8 + + thumb_func_start sub_8143B14 +sub_8143B14: @ 8143B14 + push {r4,r5,lr} + bl sub_8143AC8 + ldr r5, =0x0203ab88 + ldr r4, [r5] + lsls r0, 16 + asrs r0, 16 + bl __floatsisf + ldr r1, =0x41f00000 + bl __divsf3 + bl __fixunssfsi + adds r4, 0x7E + strb r0, [r4] + ldr r0, [r5] + adds r0, 0x7E + ldrb r0, [r0] + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8143B14 + + thumb_func_start sub_8143B48 +sub_8143B48: @ 8143B48 + push {r4,lr} + adds r4, r0, 0 + bl sub_8143AC8 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1E + bl __modsi3 + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0xE + bne _08143B68 + movs r0, 0 + strh r0, [r4, 0x32] + b _08143B7E +_08143B68: + cmp r1, 0xD + bgt _08143B70 + movs r0, 0xE + b _08143B72 +_08143B70: + movs r0, 0x2B +_08143B72: + subs r0, r1 + lsls r0, 16 + lsrs r0, 16 + strh r0, [r4, 0x32] + lsls r0, 16 + asrs r0, 16 +_08143B7E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8143B48 + + thumb_func_start sub_8143B84 +sub_8143B84: @ 8143B84 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + ldr r5, =0x0203ab88 + ldr r6, [r5] + adds r4, r6, 0 + adds r4, 0x8C + adds r1, r6, 0 + adds r1, 0x90 + ldr r0, [r4] + ldr r1, [r1] + bl __addsf3 + adds r1, r0, 0 + str r1, [r4] + subs r4, 0x4 + ldr r0, [r4] + bl __addsf3 + adds r6, r0, 0 + str r6, [r4] + ldr r0, =0x43b40000 + mov r8, r0 + adds r0, r6, 0 + mov r1, r8 + bl __gesf2 + cmp r0, 0 + blt _08143BD4 + adds r0, r6, 0 + mov r1, r8 + bl __subsf3 + b _08143BE8 + .pool +_08143BD4: + ldr r1, =0x00000000 + adds r0, r6, 0 + bl __ltsf2 + cmp r0, 0 + bge _08143BEA + adds r0, r6, 0 + mov r1, r8 + bl __addsf3 +_08143BE8: + str r0, [r4] +_08143BEA: + ldr r5, [r5] + adds r0, r5, 0 + adds r0, 0x88 + ldr r0, [r0] + bl __fixsfsi + strh r0, [r7, 0x34] + adds r4, r5, 0 + adds r4, 0x98 + adds r1, r5, 0 + adds r1, 0x9C + ldr r0, [r4] + ldr r1, [r1] + bl __addsf3 + adds r1, r0, 0 + str r1, [r4] + subs r4, 0x4 + ldr r0, [r4] + bl __addsf3 + str r0, [r4] + bl __fixsfsi + strh r0, [r7, 0x36] + ldrh r0, [r7, 0x34] + bl sine2 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrh r0, [r7, 0x34] + bl cosine2 + lsls r4, 16 + asrs r4, 16 + movs r2, 0x36 + ldrsh r1, [r7, r2] + muls r1, r4 + asrs r1, 12 + strh r1, [r7, 0x24] + lsls r0, 16 + asrs r0, 16 + negs r0, r0 + movs r2, 0x36 + ldrsh r1, [r7, r2] + muls r0, r1 + asrs r0, 12 + strh r0, [r7, 0x26] + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _08143C74 + ldr r0, =0x030075f0 + ldr r4, =0x0000ffff + ldrh r2, [r7, 0x24] + lsls r2, 24 + asrs r2, 24 + adds r1, r4, 0 + bl MPlayPanpotControl + ldr r0, =0x03007630 + ldrh r2, [r7, 0x24] + lsls r2, 24 + asrs r2, 24 + adds r1, r4, 0 + bl MPlayPanpotControl +_08143C74: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8143B84 + + thumb_func_start sub_8143C90 +sub_8143C90: @ 8143C90 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x0203ab88 + ldr r1, [r0] + ldrh r0, [r5, 0x3A] + ldrh r1, [r1, 0x24] + adds r2, r0, r1 + strh r2, [r5, 0x34] + lsls r1, r2, 16 + ldr r0, =0x01670000 + cmp r1, r0 + ble _08143CAE + ldr r1, =0xfffffe98 + adds r0, r2, r1 + strh r0, [r5, 0x34] +_08143CAE: + ldrh r0, [r5, 0x34] + bl sine2 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldrh r0, [r5, 0x34] + bl cosine2 + lsls r4, 16 + asrs r4, 16 + movs r2, 0x36 + ldrsh r1, [r5, r2] + muls r1, r4 + asrs r1, 12 + strh r1, [r5, 0x24] + lsls r0, 16 + asrs r0, 16 + negs r0, r0 + movs r2, 0x36 + ldrsh r1, [r5, r2] + muls r0, r1 + ldr r1, =0x02021bbe + asrs r0, 12 + ldrh r1, [r1] + adds r0, r1 + strh r0, [r5, 0x26] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8143C90 + + thumb_func_start sub_8143CFC +sub_8143CFC: @ 8143CFC + push {r4-r7,lr} + adds r5, r0, 0 + bl sub_8143B84 + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x36] + adds r0, 0x84 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xD4 + bls _08143D22 + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + b _08143D2E +_08143D22: + adds r2, r5, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 +_08143D2E: + strb r0, [r2] + movs r1, 0x32 + ldrsh r0, [r5, r1] + cmp r0, 0x1D + ble _08143DF8 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08143D6C + ldr r7, =0x0203ab88 + ldr r6, [r7] + adds r4, r6, 0 + adds r4, 0x94 + adds r0, r6, 0 + adds r0, 0xA0 + ldr r0, [r0] + ldr r1, =0x40000000 + bl __subsf3 + adds r1, r0, 0 + ldr r0, [r4] + bl __lesf2 + cmp r0, 0 + bgt _08143DF8 + b _08143D8C + .pool +_08143D6C: + ldr r7, =0x0203ab88 + ldr r6, [r7] + adds r4, r6, 0 + adds r4, 0x94 + adds r0, r6, 0 + adds r0, 0xA0 + ldr r0, [r0] + ldr r1, =0x40000000 + bl __subsf3 + adds r1, r0, 0 + ldr r0, [r4] + bl __gesf2 + cmp r0, 0 + blt _08143DF8 +_08143D8C: + adds r1, r6, 0 + adds r1, 0x7D + movs r0, 0xFF + strb r0, [r1] + ldr r2, [r7] + ldrb r1, [r2, 0x3] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x3] + adds r0, r5, 0 + adds r0, 0x2B + ldrb r1, [r0] + adds r1, 0x3 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl StartObjectImageAnim + adds r0, r5, 0 + bl sub_8143B14 + movs r0, 0x1E + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl sub_8143AC8 + movs r1, 0x3A + ldrsh r0, [r5, r1] + movs r1, 0x1E + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 1 + adds r1, 0xF + strh r1, [r5, 0x3A] + ldr r0, =sub_8143C90 + str r0, [r5, 0x1C] + movs r0, 0x47 + bl m4aSongNumStartOrChange + ldr r3, [r7] + adds r2, r3, 0 + adds r2, 0x9C + adds r1, r3, 0 + adds r1, 0x98 + ldr r0, =0x00000000 + str r0, [r1] + str r0, [r2] + subs r1, 0xC + ldr r0, =0xbf800000 + str r0, [r1] +_08143DF8: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8143CFC + + thumb_func_start sub_8143E14 +sub_8143E14: @ 8143E14 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r7, r0, 0 + bl sub_8143B84 + movs r1, 0x34 + ldrsh r0, [r7, r1] + cmp r0, 0 + beq _08143E32 + cmp r0, 0xB4 + beq _08143E9C + b _08143F80 +_08143E32: + movs r1, 0x2E + ldrsh r0, [r7, r1] + cmp r0, 0x1 + bne _08143E3C + b _08143F80 +_08143E3C: + movs r1, 0x3C + ldrsh r0, [r7, r1] + bl __floatsisf + mov r9, r0 + ldr r0, =gUnknown_085B6348 + mov r10, r0 + ldr r1, =0x0203ab88 + mov r8, r1 + ldr r0, [r1] + ldrb r4, [r0, 0x4] + lsls r4, 30 + lsrs r0, r4, 25 + add r0, r10 + ldrb r0, [r0, 0x1] + bl __floatsisf + adds r1, r0, 0 + mov r0, r9 + bl __mulsf3 + adds r6, r0, 0 + lsrs r0, r4, 25 + add r0, r10 + ldrb r0, [r0, 0x2] + subs r0, 0x1 + bl __floatsisf + adds r1, r0, 0 + adds r0, r6, 0 + bl __addsf3 + adds r5, r0, 0 + lsrs r4, 25 + add r4, r10 + ldrh r0, [r4, 0xC] + bl __floatsisf + adds r1, r0, 0 + mov r0, r9 + bl __divsf3 + b _08143EFC + .pool +_08143E9C: + movs r1, 0x2E + ldrsh r0, [r7, r1] + cmp r0, 0 + beq _08143F80 + movs r1, 0x3C + ldrsh r0, [r7, r1] + bl __floatsisf + mov r9, r0 + ldr r0, =gUnknown_085B6348 + mov r10, r0 + ldr r1, =0x0203ab88 + mov r8, r1 + ldr r0, [r1] + ldrb r4, [r0, 0x4] + lsls r4, 30 + lsrs r0, r4, 25 + add r0, r10 + ldrb r0, [r0, 0x1] + bl __floatsisf + adds r1, r0, 0 + mov r0, r9 + bl __mulsf3 + adds r6, r0, 0 + lsrs r0, r4, 25 + add r0, r10 + ldrb r0, [r0, 0x2] + subs r0, 0x1 + bl __floatsisf + adds r1, r0, 0 + adds r0, r6, 0 + bl __addsf3 + adds r5, r0, 0 + lsrs r4, 25 + add r4, r10 + ldrh r0, [r4, 0xC] + bl __floatsisf + adds r1, r0, 0 + mov r0, r9 + bl __divsf3 + bl __negsf2 +_08143EFC: + adds r2, r0, 0 + mov r0, r8 + ldr r6, [r0] + adds r1, r6, 0 + adds r1, 0xA0 + adds r0, r6, 0 + adds r0, 0x94 + ldr r0, [r0] + str r0, [r1] + adds r0, r6, 0 + adds r0, 0x98 + str r2, [r0] + movs r0, 0x9C + adds r0, r6 + mov r8, r0 + adds r0, r2, 0 + adds r1, r2, 0 + bl __addsf3 + adds r1, r5, 0 + bl __divsf3 + adds r4, r0, 0 + adds r0, r5, 0 + adds r1, r5, 0 + bl __mulsf3 + adds r1, r0, 0 + ldr r0, =0x40000000 + bl __divsf3 + adds r1, r0, 0 + adds r0, r4, 0 + bl __addsf3 + bl __negsf2 + mov r1, r8 + str r0, [r1] + adds r1, r6, 0 + adds r1, 0x8C + ldr r0, =0x00000000 + str r0, [r1] + adds r2, r7, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r0, r7, 0 + adds r0, 0x2A + movs r2, 0 + strb r2, [r0] + adds r3, r7, 0 + adds r3, 0x3F + ldrb r0, [r3] + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + strb r0, [r3] + ldr r0, =sub_8143CFC + str r0, [r7, 0x1C] + strh r2, [r7, 0x32] +_08143F80: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8143E14 + + thumb_func_start sub_8143FA4 +sub_8143FA4: @ 8143FA4 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x32 + ldrsh r0, [r5, r1] + bl __floatsisf + adds r4, r0, 0 + ldr r1, =0x3d4ccccd + bl __mulsf3 + adds r1, r4, 0 + bl __mulsf3 + bl __fixsfsi + adds r1, r0, 0 + subs r1, 0x2D + strh r1, [r5, 0x26] + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1D + ble _0814403E + lsls r0, r1, 16 + cmp r0, 0 + blt _0814403E + ldr r4, =0x0203ab88 + ldr r0, [r4] + adds r0, 0x7D + movs r1, 0xFF + strb r1, [r0] + ldr r2, [r4] + ldrb r1, [r2, 0x3] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x3] + adds r0, r5, 0 + adds r0, 0x2B + ldrb r1, [r0] + adds r1, 0x3 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl StartObjectImageAnim + adds r0, r5, 0 + bl sub_8143B14 + movs r0, 0x1E + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl sub_8143AC8 + movs r1, 0x3A + ldrsh r0, [r5, r1] + movs r1, 0x1E + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 1 + adds r1, 0xF + strh r1, [r5, 0x3A] + ldr r0, =sub_8143C90 + str r0, [r5, 0x1C] + movs r0, 0x47 + bl m4aSongNumStartOrChange + ldr r2, [r4] + ldrb r0, [r2, 0x3] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2, 0x3] +_0814403E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8143FA4 + + thumb_func_start sub_8144050 +sub_8144050: @ 8144050 + push {r4,lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x32] + adds r1, r0, 0x1 + strh r1, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2C + bgt _08144098 + ldrh r4, [r3, 0x26] + subs r0, r4, 0x1 + strh r0, [r3, 0x26] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x2D + bne _0814411E + ldr r2, =0x02020630 + ldr r0, =0x0203ab88 + ldr r0, [r0] + adds r0, 0x73 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0x1 + bne _0814411E + strh r4, [r3, 0x26] + b _0814411E + .pool +_08144098: + lsls r0, r1, 16 + asrs r0, 16 + movs r2, 0x3C + ldrsh r1, [r3, r2] + cmp r0, r1 + bge _081440E4 + ldr r2, =0x02020630 + ldr r0, =0x0203ab88 + ldr r0, [r0] + adds r0, 0x73 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r2 + adds r0, r1, 0 + adds r0, 0x2C + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bne _0814411E + adds r0, r1, 0 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0x1 + bne _081440DC + ldrh r0, [r3, 0x26] + adds r0, 0x1 + strh r0, [r3, 0x26] + b _0814411E + .pool +_081440DC: + ldrh r0, [r3, 0x26] + subs r0, 0x1 + strh r0, [r3, 0x26] + b _0814411E +_081440E4: + adds r2, r3, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r1, r3, 0 + adds r1, 0x2A + movs r2, 0 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x3F + adds r0, r3 + mov r12, r0 + ldrb r0, [r0] + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + mov r1, r12 + strb r0, [r1] + strh r2, [r3, 0x32] + ldr r0, =sub_8143FA4 + str r0, [r3, 0x1C] + movs r0, 0x3D + bl m4aSongNumStart +_0814411E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8144050 + + thumb_func_start sub_8144128 +sub_8144128: @ 8144128 + push {r4,lr} + adds r4, r0, 0 + bl sub_8143B84 + movs r0, 0x34 + ldrsh r1, [r4, r0] + cmp r1, 0x5A + beq _08144142 + movs r0, 0x87 + lsls r0, 1 + cmp r1, r0 + beq _0814414C + b _0814415C +_08144142: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0814415C + b _08144154 +_0814414C: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0814415C +_08144154: + ldr r0, =sub_8144050 + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x32] +_0814415C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8144128 + + thumb_func_start sub_8144168 +sub_8144168: @ 8144168 + push {r4,lr} + adds r4, r0, 0 + bl sub_8143B84 + ldr r0, =0x0203ab88 + ldr r0, [r0] + ldrb r0, [r0, 0x3] + lsls r0, 27 + lsrs r0, 27 + cmp r0, 0 + beq _08144182 + cmp r0, 0x1 + beq _08144194 +_08144182: + adds r0, r4, 0 + bl sub_81446DC + ldr r0, =sub_8143E14 + b _0814419C + .pool +_08144194: + adds r0, r4, 0 + bl sub_81448B8 + ldr r0, =sub_8144128 +_0814419C: + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8144168 + + thumb_func_start prev_quest_read_x24_hm_usage +prev_quest_read_x24_hm_usage: @ 81441A8 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_8143B84 + ldrh r0, [r5, 0x32] + subs r0, 0x1 + strh r0, [r5, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + bne _081441CE + ldr r0, =0x0203ab88 + ldr r4, [r0] + adds r4, 0x98 + ldr r0, [r4] + ldr r1, =0xbf800000 + bl __mulsf3 + str r0, [r4] +_081441CE: + movs r1, 0x32 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0814425C + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _08144244 + ldr r2, =0x0203ab88 + ldr r0, [r2] + adds r0, 0x7D + movs r1, 0xFF + strb r1, [r0] + ldr r2, [r2] + ldrb r1, [r2, 0x3] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x3] + adds r0, r5, 0 + adds r0, 0x2B + ldrb r1, [r0] + adds r1, 0x3 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl StartObjectImageAnim + adds r0, r5, 0 + bl sub_8143B14 + movs r0, 0x1E + strh r0, [r5, 0x36] + adds r0, r5, 0 + bl sub_8143AC8 + movs r1, 0x3A + ldrsh r0, [r5, r1] + movs r1, 0x1E + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 1 + adds r1, 0xF + strh r1, [r5, 0x3A] + ldr r0, =sub_8143C90 + str r0, [r5, 0x1C] + movs r0, 0x47 + bl m4aSongNumStartOrChange + b _0814425C + .pool +_08144244: + adds r0, r5, 0 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + movs r0, 0x38 + bl m4aSongNumStart + adds r0, r5, 0 + bl sub_8144A24 +_0814425C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end prev_quest_read_x24_hm_usage + + thumb_func_start sub_8144264 +sub_8144264: @ 8144264 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + bl sub_8143B84 + movs r0, 0 + strh r0, [r6, 0x32] + adds r0, r6, 0 + bl sub_8143B14 + ldr r1, =gUnknown_085B62E4 + ldr r4, =0x0203ab88 + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x7E + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + ldr r1, [r2, 0x8] + ands r0, r1 + cmp r0, 0 + bne _081442FC + adds r1, r2, 0 + adds r1, 0x7D + movs r0, 0xFF + strb r0, [r1] + ldr r2, [r4] + ldrb r1, [r2, 0x3] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x3] + adds r0, r6, 0 + adds r0, 0x2B + ldrb r1, [r0] + adds r1, 0x3 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl StartObjectImageAnim + adds r0, r6, 0 + bl sub_8143B14 + movs r0, 0x1E + strh r0, [r6, 0x36] + adds r0, r6, 0 + bl sub_8143AC8 + movs r1, 0x3A + ldrsh r0, [r6, r1] + movs r1, 0x1E + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 1 + adds r1, 0xF + strh r1, [r6, 0x3A] + ldr r0, =sub_8143C90 + str r0, [r6, 0x1C] + movs r0, 0x47 + bl m4aSongNumStartOrChange + b _081443F8 + .pool +_081442FC: + movs r0, 0x38 + bl m4aSongNumStart + bl GenerateRandomNumber + movs r1, 0x1 + mov r8, r1 + ands r1, r0 + mov r8, r1 + cmp r1, 0 + beq _08144340 + ldr r4, [r4] + adds r1, r4, 0 + adds r1, 0x8C + ldr r0, =0x00000000 + str r0, [r1] + adds r0, r4, 0 + adds r0, 0x7E + ldrb r0, [r0] + adds r0, 0x1 + movs r1, 0xC + bl __modsi3 + lsls r1, r0, 24 + lsrs r2, r1, 24 + adds r1, r4, 0 + adds r1, 0x7F + strb r0, [r1] + ldr r5, =gUnknown_085B6348 + b _08144378 + .pool +_08144340: + ldr r7, [r4] + adds r4, r7, 0 + adds r4, 0x8C + ldr r5, =gUnknown_085B6348 + ldrb r0, [r7, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, [r0] + adds r0, r1, 0 + bl __addsf3 + str r0, [r4] + adds r0, r7, 0 + adds r0, 0x7E + ldrb r4, [r0] + adds r0, r4, 0 + adds r0, 0xB + movs r1, 0xC + bl __modsi3 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r7, 0 + adds r0, 0x7F + strb r4, [r0] +_08144378: + ldr r0, =gUnknown_085B62E4 + lsls r1, r2, 3 + adds r0, 0x4 + adds r1, r0 + ldr r2, =0x0203ab88 + ldr r3, [r2] + ldr r1, [r1] + ldr r0, [r3, 0x8] + ands r1, r0 + cmp r1, 0 + beq _081443AC + movs r0, 0x1 + strh r0, [r6, 0x2E] + ldrb r0, [r3, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r5 + ldrb r0, [r0, 0x2] + strh r0, [r6, 0x32] + b _081443E8 + .pool +_081443AC: + strh r1, [r6, 0x2E] + ldrb r1, [r3, 0x4] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _081443C4 + lsls r0, r1, 30 + lsrs r0, 25 + adds r0, r5 + ldrb r0, [r0, 0x1] + strh r0, [r6, 0x32] + b _081443E8 +_081443C4: + lsls r0, r1, 30 + lsrs r0, 25 + adds r0, r5 + ldrb r0, [r0, 0x2] + strh r0, [r6, 0x32] + mov r0, r8 + cmp r0, 0 + beq _081443E0 + adds r1, r3, 0 + adds r1, 0x8C + ldr r0, =0x3f000000 + b _081443E6 + .pool +_081443E0: + adds r1, r3, 0 + adds r1, 0x8C + ldr r0, =0xbfc00000 +_081443E6: + str r0, [r1] +_081443E8: + ldr r0, [r2] + adds r0, 0x98 + ldr r1, =0x3dae147b + str r1, [r0] + ldr r0, =prev_quest_read_x24_hm_usage + str r0, [r6, 0x1C] + movs r0, 0x5 + strh r0, [r6, 0x30] +_081443F8: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8144264 + + thumb_func_start sub_8144410 +sub_8144410: @ 8144410 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + bl sub_8143B84 + ldr r4, =0x0203ab88 + ldr r0, [r4] + adds r0, 0x8C + ldr r0, [r0] + ldr r1, =0x3f000000 + bl __gtsf2 + cmp r0, 0 + bgt _081444FA + adds r0, r6, 0 + bl sub_8143B14 + adds r0, r6, 0 + bl sub_8143B48 + lsls r0, 16 + cmp r0, 0 + bne _081444BC + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0x90 + ldr r0, =0x00000000 + str r0, [r1] + movs r0, 0x8C + adds r0, r2 + mov r8, r0 + ldr r1, =gUnknown_085B6348 + mov r9, r1 + ldrb r0, [r2, 0x4] + lsls r7, r0, 30 + lsrs r0, r7, 25 + add r0, r9 + movs r4, 0x3 + ldrsb r4, [r0, r4] + adds r0, r4, 0 + bl __floatsisf + adds r5, r0, 0 + cmp r4, 0 + bge _08144476 + ldr r1, =0x43800000 + bl __addsf3 + adds r5, r0, 0 +_08144476: + lsrs r0, r7, 25 + add r0, r9 + ldrb r0, [r0, 0x4] + adds r0, 0x1 + bl __floatsisf + adds r1, r0, 0 + adds r0, r5, 0 + bl __divsf3 + adds r1, r0, 0 + mov r2, r8 + ldr r0, [r2] + bl __subsf3 + mov r1, r8 + str r0, [r1] + movs r0, 0x4 + strh r0, [r6, 0x30] + ldr r0, =sub_8144264 + str r0, [r6, 0x1C] + b _081444FA + .pool +_081444BC: + ldr r4, [r4] + adds r7, r4, 0 + adds r7, 0x90 + ldr r0, [r7] + ldr r6, =0x00000000 + adds r1, r6, 0 + bl __nesf2 + cmp r0, 0 + beq _081444FA + adds r5, r4, 0 + adds r5, 0x8C + ldr r0, [r5] + adds r1, r6, 0 + bl __ltsf2 + cmp r0, 0 + bge _081444FA + str r6, [r7] + str r6, [r5] + adds r4, 0x98 + ldr r0, [r4] + bl __extendsfdf2 + ldr r2, =0x3ff33333 + ldr r3, =0x33333333 + bl __divdf3 + bl __truncdfsf2 + str r0, [r4] +_081444FA: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8144410 + + thumb_func_start sub_8144514 +sub_8144514: @ 8144514 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + bl sub_8143B84 + ldr r0, =0x0203ab88 + ldr r5, [r0] + adds r0, r5, 0 + adds r0, 0x94 + ldr r0, [r0] + ldr r1, =0x42200000 + bl __gtsf2 + cmp r0, 0 + bgt _081445B8 + movs r0, 0x98 + adds r0, r5 + mov r8, r0 + adds r7, r5, 0 + adds r7, 0x86 + movs r1, 0 + ldrsh r4, [r7, r1] + adds r0, r4, 0 + bl __floatsisf + adds r2, r0, 0 + cmp r4, 0 + bge _08144556 + ldr r1, =0x47800000 + bl __addsf3 + adds r2, r0, 0 +_08144556: + ldr r0, =0x40800000 + adds r1, r2, 0 + bl __divsf3 + bl __negsf2 + mov r1, r8 + str r0, [r1] + movs r0, 0x90 + adds r0, r5 + mov r8, r0 + adds r5, 0x8C + movs r1, 0 + ldrsh r4, [r7, r1] + adds r0, r4, 0 + bl __floatsisf + adds r2, r0, 0 + cmp r4, 0 + bge _08144586 + ldr r1, =0x47800000 + bl __addsf3 + adds r2, r0, 0 +_08144586: + ldr r0, [r5] + adds r1, r2, 0 + bl __divsf3 + bl __negsf2 + mov r1, r8 + str r0, [r1] + adds r1, r6, 0 + adds r1, 0x2A + movs r0, 0x2 + strb r0, [r1] + adds r2, r6, 0 + adds r2, 0x3F + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + strb r0, [r2] + movs r0, 0x3 + strh r0, [r6, 0x30] + ldr r0, =sub_8144410 + str r0, [r6, 0x1C] +_081445B8: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8144514 + + thumb_func_start sub_81445D8 +sub_81445D8: @ 81445D8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + bl sub_8143B84 + ldr r4, =0x0203ab88 + ldr r0, [r4] + adds r0, 0x94 + ldr r0, [r0] + ldr r1, =0x42700000 + bl __gtsf2 + cmp r0, 0 + bgt _0814468A + movs r0, 0x5D + bl m4aSongNumStartOrChange + ldr r5, [r4] + movs r0, 0x98 + adds r0, r5 + mov r8, r0 + adds r7, r5, 0 + adds r7, 0x84 + movs r1, 0 + ldrsh r4, [r7, r1] + adds r0, r4, 0 + bl __floatsisf + adds r2, r0, 0 + cmp r4, 0 + bge _08144620 + ldr r1, =0x47800000 + bl __addsf3 + adds r2, r0, 0 +_08144620: + ldr r0, =0x41a00000 + adds r1, r2, 0 + bl __divsf3 + bl __negsf2 + mov r1, r8 + str r0, [r1] + movs r0, 0x90 + adds r0, r5 + mov r8, r0 + adds r0, r5, 0 + adds r0, 0x8C + ldr r1, [r0] + ldr r0, =0x3f800000 + bl __subsf3 + adds r5, r0, 0 + movs r1, 0 + ldrsh r4, [r7, r1] + adds r0, r4, 0 + bl __floatsisf + adds r2, r0, 0 + cmp r4, 0 + bge _0814465C + ldr r1, =0x47800000 + bl __addsf3 + adds r2, r0, 0 +_0814465C: + adds r0, r5, 0 + adds r1, r2, 0 + bl __divsf3 + mov r1, r8 + str r0, [r1] + adds r1, r6, 0 + adds r1, 0x2A + movs r0, 0x1 + strb r0, [r1] + adds r2, r6, 0 + adds r2, 0x3F + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + strb r0, [r2] + movs r0, 0x2 + strh r0, [r6, 0x30] + ldr r0, =sub_8144514 + str r0, [r6, 0x1C] +_0814468A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81445D8 + + thumb_func_start sub_81446AC +sub_81446AC: @ 81446AC + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + movs r0, 0x1 + strh r0, [r4, 0x30] + strh r1, [r4, 0x32] + adds r0, r4, 0 + bl sub_8143B84 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, =sub_81445D8 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81446AC + + thumb_func_start sub_81446DC +sub_81446DC: @ 81446DC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r8, r0 + ldr r1, =gUnknown_085B7B0A + mov r0, sp + movs r2, 0x8 + bl memcpy + mov r1, r8 + ldrh r0, [r1, 0x3C] + subs r0, 0x2 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + ldr r5, =0x0203ab88 + ldr r0, =gUnknown_085B79F8 + movs r2, 0xC + negs r2, r2 + movs r1, 0x24 + movs r3, 0x32 + bl AddObjectToFront + ldr r1, [r5] + adds r1, 0x73 + strb r0, [r1] + ldr r4, =gUnknown_085B7ABC + mov r3, r8 + movs r0, 0x2E + ldrsh r2, [r3, r0] + lsls r2, 2 + mov r1, sp + adds r0, r1, r2 + movs r3, 0 + ldrsh r1, [r0, r3] + mov r0, sp + adds r0, 0x2 + adds r0, r2 + movs r3, 0 + ldrsh r2, [r0, r3] + adds r0, r4, 0 + movs r3, 0x3B + bl AddObjectToFront + ldr r1, [r5] + adds r1, 0x74 + strb r0, [r1] + adds r4, 0x18 + adds r0, r4, 0 + movs r1, 0x24 + movs r2, 0x8C + movs r3, 0x33 + bl AddObjectToFront + ldr r1, [r5] + adds r1, 0x75 + strb r0, [r1] + ldr r3, =0x02020630 + ldr r0, [r5] + adds r0, 0x75 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrb r2, [r0, 0x1] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0, 0x1] + movs r7, 0 + adds r6, r3, 0 + ldr r0, =gUnknown_085B6348 + mov r12, r0 + mov r10, r5 +_0814477C: + ldr r0, [r5] + adds r3, r7, 0 + adds r3, 0x37 + adds r0, 0x3C + adds r0, r3 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x3 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r0, [r5] + adds r0, 0x3C + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r5] + adds r0, 0x3C + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r5] + adds r0, 0x3C + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] + ldr r4, [r5] + adds r2, r4, 0 + adds r2, 0x3C + adds r2, r3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r1, r4, 0 + adds r1, 0x73 + ldrb r1, [r1] + strh r1, [r0, 0x36] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r1, r4, 0 + adds r1, 0x74 + ldrb r1, [r1] + strh r1, [r0, 0x38] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r1, r4, 0 + adds r1, 0x75 + ldrb r1, [r1] + strh r1, [r0, 0x3A] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r1, r9 + strh r1, [r0, 0x32] + ldrb r0, [r2] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r6 + mov r0, r8 + movs r1, 0x3C + ldrsh r3, [r0, r1] + ldrb r1, [r4, 0x4] + lsls r1, 30 + lsrs r0, r1, 25 + add r0, r12 + ldrb r0, [r0, 0x1] + muls r3, r0 + lsrs r1, 25 + add r1, r12 + ldrb r0, [r1, 0x2] + ldr r1, =0x0000ffff + adds r0, r1 + adds r3, r0 + strh r3, [r2, 0x34] + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, =0x02020630 + cmp r7, 0x2 + bls _0814477C + mov r3, r10 + ldr r0, [r3] + adds r0, 0x74 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r3] + mov r1, r8 + str r1, [r0, 0x38] + 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_81446DC + + thumb_func_start sub_81448B8 +sub_81448B8: @ 81448B8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + adds r7, r0, 0 + movs r0, 0 + mov r8, r0 + ldr r1, =gUnknown_085B7B12 + mov r0, sp + movs r2, 0x8 + bl memcpy + ldrh r0, [r7, 0x3C] + subs r0, 0x2 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + ldr r0, =gUnknown_085B7A10 + movs r1, 0x2E + ldrsh r2, [r7, r1] + lsls r2, 2 + mov r3, sp + adds r1, r3, r2 + movs r3, 0 + ldrsh r1, [r1, r3] + mov r4, sp + adds r4, 0x2 + adds r2, r4, r2 + movs r3, 0 + ldrsh r2, [r2, r3] + movs r3, 0x32 + bl AddObjectToFront + ldr r5, =0x0203ab88 + ldr r1, [r5] + adds r1, 0x73 + strb r0, [r1] + ldr r0, [r5] + adds r0, 0x73 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r6, =0x02020630 + adds r0, r6 + ldrh r1, [r7, 0x2E] + lsls r1, 24 + lsrs r1, 24 + bl StartObjectImageAnim + ldr r0, =gUnknown_085B7AEC + movs r1, 0x2E + ldrsh r2, [r7, r1] + lsls r2, 2 + mov r3, sp + adds r1, r3, r2 + movs r3, 0 + ldrsh r1, [r1, r3] + adds r4, r2 + movs r3, 0 + ldrsh r2, [r4, r3] + movs r3, 0x33 + bl AddObjectToFront + ldr r1, [r5] + adds r1, 0x74 + strb r0, [r1] + ldr r0, [r5] + adds r0, 0x74 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x80 + orrs r1, r2 + strb r1, [r0] + ldr r0, [r5] + adds r0, 0x74 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r0, 0x2C + ldrb r1, [r0] + movs r2, 0x40 + orrs r1, r2 + strb r1, [r0] + mov r0, r9 + lsls r2, r0, 16 + asrs r2, 16 + ldr r3, =gUnknown_085B6348 + ldr r0, [r5] + ldrb r1, [r0, 0x4] + lsls r1, 30 + lsrs r0, r1, 25 + adds r0, r3 + ldrb r0, [r0, 0x1] + muls r2, r0 + lsrs r1, 25 + adds r1, r3 + ldrh r0, [r1, 0x10] + adds r0, 0x2D + adds r2, r0 + strh r2, [r7, 0x3C] +_08144992: + ldr r0, =0x0203ab88 + ldr r4, [r0] + mov r1, r8 + adds r2, r4, r1 + adds r2, 0x73 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r1, r4, 0 + adds r1, 0x73 + ldrb r1, [r1] + strh r1, [r0, 0x36] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + adds r3, r4, 0 + adds r3, 0x74 + ldrb r1, [r3] + strh r1, [r0, 0x38] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r1, [r3] + strh r1, [r0, 0x3A] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r3, r9 + strh r3, [r0, 0x32] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrh r0, [r7, 0x3C] + subs r0, 0x2D + strh r0, [r1, 0x34] + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0x1 + bls _08144992 + str r7, [r4, 0x38] + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81448B8 + + thumb_func_start sub_8144A24 +sub_8144A24: @ 8144A24 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + adds r7, r0, 0 + movs r0, 0 + mov r9, r0 + movs r1, 0x5 + mov r8, r1 + str r0, [sp, 0xC] + mov r0, sp + movs r1, 0 + movs r2, 0xA + bl memset + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x10] + ldr r3, =0x0203ab88 + ldr r0, [r3] + adds r0, 0x7D + movs r5, 0x1 + strb r5, [r0] + ldr r2, [r3] + ldrb r0, [r2, 0x3] + movs r1, 0x20 + orrs r0, r1 + strb r0, [r2, 0x3] + ldr r2, [r3] + ldrb r1, [r2, 0x3] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0x3] + ldr r0, [r3] + adds r0, 0x7E + movs r1, 0xFF + strb r1, [r0] + ldr r6, [r3] + adds r4, r6, 0 + adds r4, 0x88 + movs r1, 0x34 + ldrsh r0, [r7, r1] + bl __floatsisf + str r0, [r4] + adds r1, r6, 0 + adds r1, 0x98 + ldr r0, =0x00000000 + str r0, [r1] + adds r2, r6, 0 + adds r2, 0x8C + ldr r1, =gUnknown_085B6348 + ldrb r0, [r6, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r1, 0x1C + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + ldrb r0, [r6, 0x4] + lsls r0, 30 + lsrs r0, 30 + lsls r1, r0, 4 + subs r1, r0 + lsls r1, 1 + adds r1, 0x21 + ldrb r0, [r6, 0x3] + lsls r0, 27 + lsrs r0, 27 + subs r5, r0 + lsls r0, r5, 4 + subs r0, r5 + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + mov r5, r9 + movs r0, 0x34 + ldrsh r2, [r7, r0] +_08144ACA: + cmp r1, r2 + bge _08144AD6 + adds r0, r1, 0 + adds r0, 0x5A + cmp r2, r0 + ble _08144B38 +_08144AD6: + cmp r5, 0x3 + beq _08144B1C + adds r0, r1, 0 + adds r0, 0x5A + lsls r0, 16 + lsrs r1, r0, 16 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _08144ACA +_08144AEC: + ldr r0, =0x0203ab88 + ldr r0, [r0] + ldrb r1, [r0, 0x3] + movs r0, 0x1F + ands r0, r1 + cmp r0, 0 + beq _08144B64 + movs r1, 0x2E + ldrsh r0, [r7, r1] + cmp r0, 0 + beq _08144B58 + movs r0, 0x98 + lsls r0, 1 + movs r1, 0x3F + negs r1, r1 + bl cry_related + b _08144B70 + .pool +_08144B1C: + movs r0, 0x1 + strh r0, [r7, 0x2E] + ldr r0, =0x0203ab88 + ldr r2, [r0] + ldrb r1, [r2, 0x3] + movs r0, 0x20 + negs r0, r0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2, 0x3] + b _08144AEC + .pool +_08144B38: + lsrs r0, r5, 1 + strh r0, [r7, 0x2E] + ldr r0, =0x0203ab88 + ldr r3, [r0] + movs r1, 0x1 + ands r1, r5 + ldrb r2, [r3, 0x3] + movs r0, 0x20 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3, 0x3] + b _08144AEC + .pool +_08144B58: + movs r0, 0x98 + lsls r0, 1 + movs r1, 0x3F + bl cry_related + b _08144B70 +_08144B64: + movs r0, 0x99 + lsls r0, 1 + movs r1, 0x3F + negs r1, r1 + bl cry_related +_08144B70: + movs r0, 0x2 + mov r10, r0 + ldr r4, =0x0203ab88 + ldr r5, [r4] + adds r0, r5, 0 + adds r0, 0x7F + ldrb r0, [r0] + adds r0, 0x2 + movs r1, 0xC + bl __modsi3 + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r1, [r5, 0x3] + movs r0, 0x1F + ands r0, r1 + cmp r0, 0x1 + bne _08144BA8 + ldrb r1, [r5, 0x4] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _08144BA8 + mov r0, r8 + adds r0, 0x6 + b _08144BAC + .pool +_08144BA8: + mov r0, r8 + add r0, r10 +_08144BAC: + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r5, r10 + cmp r5, r8 + bcs _08144C18 + ldr r1, =gUnknown_085B6160 + mov r10, r1 +_08144BBC: + ldr r3, [r4] + lsls r0, r6, 3 + ldr r1, =gUnknown_085B62E8 + adds r0, r1 + ldr r1, [r3, 0x8] + ldr r2, [r0] + ands r1, r2 + cmp r1, 0 + bne _08144C02 + mov r0, r9 + adds r1, r0, 0x1 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + add r0, sp + strb r5, [r0] + ldr r0, [sp, 0xC] + cmp r0, 0 + bne _08144C02 + ldrb r1, [r3, 0x1A] + lsls r1, 28 + lsrs r1, 28 + adds r0, r3, 0 + adds r0, 0x1B + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldr r0, [r0] + ands r2, r0 + cmp r2, 0 + beq _08144C02 + str r5, [sp, 0xC] +_08144C02: + adds r0, r6, 0x1 + movs r1, 0xC + bl __modsi3 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r8 + bcc _08144BBC +_08144C18: + ldr r0, [r4] + ldrb r1, [r0, 0x3] + lsls r1, 27 + lsrs r1, 27 + adds r1, 0x1 + ldrb r0, [r0, 0x2] + ands r1, r0 + cmp r1, 0 + beq _08144C48 + ldr r1, [sp, 0xC] + cmp r1, 0 + beq _08144C48 + movs r0, 0xFF + ldr r1, [sp, 0x10] + ands r0, r1 + cmp r0, 0xBF + bhi _08144C48 + mov r0, sp + ldrh r0, [r0, 0xC] + b _08144C54 + .pool +_08144C48: + ldr r0, [sp, 0x10] + mov r1, r9 + bl __modsi3 + add r0, sp + ldrb r0, [r0] +_08144C54: + strh r0, [r7, 0x3C] + ldr r1, =sub_8144168 + str r1, [r7, 0x1C] + 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_8144A24 + + thumb_func_start sub_8144C70 +sub_8144C70: @ 8144C70 + push {r4,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x30] + adds r1, r0, 0x1 + strh r1, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x34 + ldrsh r1, [r2, r3] + cmp r0, r1 + blt _08144CC0 + ldrh r0, [r2, 0x20] + subs r0, 0x2 + strh r0, [r2, 0x20] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x10 + negs r1, r1 + cmp r0, r1 + bge _08144CC0 + ldr r4, =0x0203ab88 + ldr r3, [r4] + ldrb r1, [r3, 0x3] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08144CAC + movs r0, 0x40 + orrs r0, r1 + strb r0, [r3, 0x3] +_08144CAC: + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles + ldr r1, [r4] + movs r0, 0 + strb r0, [r1, 0x1] + ldr r1, [r4] + ldr r0, =gUnknown_085B7B1A + ldrh r0, [r0] + strh r0, [r1, 0x34] +_08144CC0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8144C70 + + thumb_func_start sub_8144CD0 +sub_8144CD0: @ 8144CD0 + push {r4,lr} + sub sp, 0x18 + adds r4, r0, 0 + ldr r1, =gUnknown_085B7B2E + mov r0, sp + movs r2, 0x18 + bl memcpy + ldrh r0, [r4, 0x30] + adds r2, r0, 0x1 + strh r2, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x34 + ldrsh r1, [r4, r3] + cmp r0, r1 + bge _08144D54 + movs r0, 0x1 + ands r2, r0 + cmp r2, 0 + beq _08144D2E + ldr r3, =0x02021bbe + movs r0, 0x3C + ldrsh r2, [r4, r0] + lsls r2, 1 + movs r1, 0x32 + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + lsls r0, 3 + adds r2, r0 + mov r1, sp + adds r0, r1, r2 + ldrh r0, [r0] + strh r0, [r3] + movs r3, 0x3C + ldrsh r2, [r4, r3] + adds r1, r2, 0x1 + adds r0, r1, 0 + cmp r1, 0 + bge _08144D26 + adds r0, r2, 0x4 +_08144D26: + asrs r0, 2 + lsls r0, 2 + subs r0, r1, r0 + strh r0, [r4, 0x3C] +_08144D2E: + 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] + b _08144D7E + .pool +_08144D54: + ldr r1, =0x02021bbe + movs r0, 0 + strh r0, [r1] + ldr r2, =0x02020630 + ldr r0, =0x0203ab88 + ldr r0, [r0] + adds r0, 0x73 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x2C + ldrb r2, [r0] + movs r1, 0x41 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_08144D7E: + add sp, 0x18 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8144CD0 + + thumb_func_start sub_8144D94 +sub_8144D94: @ 8144D94 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x30] + adds r0, 0x1 + strh r0, [r5, 0x30] + movs r1, 0x30 + ldrsh r0, [r5, r1] + bl __floatsisf + adds r4, r0, 0 + ldr r1, =0x3d1fbe77 + bl __mulsf3 + adds r1, r4, 0 + bl __mulsf3 + bl __fixsfsi + strh r0, [r5, 0x26] + ldr r0, =0x0203ab88 + ldr r3, [r0] + ldr r2, =gUnknown_085B7B1A + ldrb r0, [r3, 0x1] + subs r0, 0x1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r3, 0x34] + ldrb r0, [r3, 0x1] + cmp r0, 0x12 + bhi _08144DDC + adds r0, 0x1 + strb r0, [r3, 0x1] +_08144DDC: + movs r1, 0x30 + ldrsh r0, [r5, r1] + cmp r0, 0x3C + ble _08144E3E + movs r0, 0 + strh r0, [r5, 0x30] + ldr r3, =sub_8144C70 + str r3, [r5, 0x1C] + ldr r2, =0x02020630 + movs r0, 0x3A + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r2, 0 + adds r4, 0x1C + adds r0, r4 + str r3, [r0] + movs r0, 0x3A + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000fffe + strh r1, [r0, 0x30] + movs r0, 0x38 + ldrsh r1, [r5, r0] + 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] + movs r0, 0x38 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_8144CD0 + str r1, [r0] + movs r0, 0xD6 + bl m4aSongNumStart +_08144E3E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8144D94 + + thumb_func_start sub_8144E60 +sub_8144E60: @ 8144E60 + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08144EE4 + ldr r0, =0x0203ab88 + ldr r3, [r0] + ldr r1, [r3, 0x38] + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08144E94 + movs r0, 0x34 + ldrsh r2, [r1, r0] + ldr r1, =gUnknown_085B6348 + ldrb r0, [r3, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrh r0, [r0, 0x8] + b _08144EA6 + .pool +_08144E94: + movs r0, 0x34 + ldrsh r2, [r1, r0] + ldr r1, =gUnknown_085B6348 + ldrb r0, [r3, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrh r0, [r0, 0x8] + adds r0, 0xB4 +_08144EA6: + cmp r2, r0 + bne _08144F7C + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + movs r0, 0x2B + bl m4aSongNumStart + ldr r2, =0x0203ab88 + ldr r1, [r2] + movs r0, 0x1 + strb r0, [r1, 0x1] + ldr r1, [r2] + ldr r0, =gUnknown_085B7B1A + ldrh r0, [r0] + strh r0, [r1, 0x34] + b _08144F7C + .pool +_08144EE4: + ldr r5, =0x0203ab88 + ldr r3, [r5] + ldr r2, =gUnknown_085B7B1A + ldrb r0, [r3, 0x1] + subs r0, 0x1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r3, 0x34] + ldrb r0, [r3, 0x1] + cmp r0, 0x12 + bhi _08144F06 + adds r0, 0x1 + strb r0, [r3, 0x1] +_08144F06: + ldr r3, [r5] + ldr r1, [r3, 0x38] + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08144F30 + movs r0, 0x34 + ldrsh r2, [r1, r0] + ldr r1, =gUnknown_085B6348 + ldrb r0, [r3, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrh r0, [r0, 0xA] + b _08144F42 + .pool +_08144F30: + movs r0, 0x34 + ldrsh r2, [r1, r0] + ldr r1, =gUnknown_085B6348 + ldrb r0, [r3, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrh r0, [r0, 0xA] + adds r0, 0xB4 +_08144F42: + cmp r2, r0 + bne _08144F7C + ldr r2, =0x02020630 + movs r0, 0x36 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r2, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_8144D94 + str r1, [r0] + movs r0, 0x36 + ldrsh r1, [r4, r0] + 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] + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x3C] +_08144F7C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8144E60 + + thumb_func_start sub_8144F94 +sub_8144F94: @ 8144F94 + adds r0, 0x3E + ldrb r3, [r0] + lsls r1, r3, 29 + lsrs r1, 31 + movs r2, 0x1 + eors r2, r1 + lsls r2, 2 + movs r1, 0x5 + negs r1, r1 + ands r1, r3 + orrs r1, r2 + strb r1, [r0] + bx lr + thumb_func_end sub_8144F94 + + thumb_func_start sub_8144FB0 +sub_8144FB0: @ 8144FB0 + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x22] + movs r0, 0x22 + ldrsh r1, [r4, r0] + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + ble _08144FC8 + subs r0, r2, 0x1 + strh r0, [r4, 0x22] + b _0814501C +_08144FC8: + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + subs r2, 0x12 + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x5E + bl m4aSongNumStop + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + ldr r5, =0x02020630 + ldr r4, =0x0203ab88 + ldr r0, [r4] + adds r0, 0x74 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + ldr r0, [r4] + adds r0, 0x74 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles +_0814501C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8144FB0 + + thumb_func_start sub_8145030 +sub_8145030: @ 8145030 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0 + blt _0814505A + subs r1, 0x1 + strh r1, [r4, 0x30] + ldrh r0, [r4, 0x22] + subs r0, 0x1 + strh r0, [r4, 0x22] + lsls r1, 16 + cmp r1, 0 + bne _081450C6 + adds r0, r4, 0 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0x1 + bne _081450C6 + b _08145080 +_0814505A: + ldrh r1, [r4, 0x34] + movs r2, 0x34 + ldrsh r0, [r4, r2] + cmp r0, 0 + blt _08145090 + subs r0, r1, 0x1 + strh r0, [r4, 0x34] + adds r0, r4, 0 + adds r0, 0x2C + ldrb r1, [r0] + movs r0, 0x3F + ands r0, r1 + cmp r0, 0 + bne _081450C6 + adds r0, r4, 0 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0x1 + bne _08145088 +_08145080: + ldrh r0, [r4, 0x26] + adds r0, 0x1 + strh r0, [r4, 0x26] + b _081450C6 +_08145088: + ldrh r0, [r4, 0x26] + subs r0, 0x1 + strh r0, [r4, 0x26] + b _081450C6 +_08145090: + movs r0, 0x2B + bl m4aSongNumStart + ldr r0, =0x0203ab88 + ldr r0, [r0] + ldr r0, [r0, 0x38] + ldrh r1, [r0, 0x2E] + adds r1, 0x4 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + ldr r0, =sub_8144FB0 + str r0, [r4, 0x1C] + ldr r2, =0x02020630 + movs r0, 0x3A + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + adds r0, 0x2C + ldrb r2, [r0] + movs r1, 0x7F + ands r1, r2 + strb r1, [r0] +_081450C6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8145030 + + thumb_func_start sub_81450D8 +sub_81450D8: @ 81450D8 + push {r4,r5,lr} + sub sp, 0x14 + adds r4, r0, 0 + ldr r1, =gUnknown_085B7B46 + mov r0, sp + movs r2, 0x2 + bl memcpy + add r5, sp, 0x4 + ldr r1, =gUnknown_085B7B48 + adds r0, r5, 0 + movs r2, 0x10 + bl memcpy + ldrh r0, [r4, 0x30] + subs r1, r0, 0x1 + strh r1, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _0814516C + ldr r0, =0x0203ab88 + ldr r0, [r0] + ldr r0, [r0, 0x38] + movs r1, 0x2E + ldrsh r0, [r0, r1] + add r0, sp + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 1 + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _08145208 + movs r1, 0x20 + ldrsh r0, [r4, r1] + movs r4, 0x74 + subs r4, r0 + lsrs r0, r4, 31 + adds r4, r0 + asrs r4, 1 + negs r4, r4 + ldr r0, =0x030075f0 + ldr r5, =0x0000ffff + lsls r4, 24 + asrs r4, 24 + adds r1, r5, 0 + adds r2, r4, 0 + bl MPlayPanpotControl + ldr r0, =0x03007630 + adds r1, r5, 0 + adds r2, r4, 0 + bl MPlayPanpotControl + b _08145208 + .pool +_0814516C: + lsls r0, r1, 16 + cmp r0, 0 + blt _081451BC + ldr r0, =0x0203ab88 + ldr r0, [r0] + ldr r0, [r0, 0x38] + movs r2, 0x2E + ldrsh r0, [r0, r2] + add r0, sp + movs r2, 0 + ldrsb r2, [r0, r2] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x7 + subs r0, r1, r0 + lsls r0, 1 + adds r0, r5, r0 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + muls r0, r2 + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + movs r2, 0x30 + ldrsh r0, [r4, r2] + subs r1, r0 + lsls r1, 1 + mov r0, sp + adds r0, 0x5 + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + b _08145208 + .pool +_081451BC: + movs r0, 0x5E + bl m4aSongNumStartOrChange + ldr r0, =0x0203ab88 + ldr r0, [r0] + ldr r0, [r0, 0x38] + movs r2, 0x2E + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _081451E0 + movs r0, 0x98 + lsls r0, 1 + movs r1, 0x3F + bl cry_related + b _081451EC + .pool +_081451E0: + movs r0, 0x98 + lsls r0, 1 + movs r1, 0x3F + negs r1, r1 + bl cry_related +_081451EC: + ldr r0, =0x0203ab88 + ldr r0, [r0] + ldr r0, [r0, 0x38] + ldrh r1, [r0, 0x2E] + adds r1, 0x2 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + movs r0, 0x2D + strh r0, [r4, 0x30] + ldr r0, =sub_8145030 + str r0, [r4, 0x1C] +_08145208: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81450D8 + + thumb_func_start sub_8145218 +sub_8145218: @ 8145218 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r1, =gUnknown_085B7B46 + mov r0, sp + movs r2, 0x2 + bl memcpy + ldrh r0, [r4, 0x30] + subs r1, r0, 0x1 + strh r1, [r4, 0x30] + lsls r0, 16 + cmp r0, 0 + blt _08145284 + ldr r0, =0x0203ab88 + ldr r0, [r0] + ldr r0, [r0, 0x38] + movs r1, 0x2E + ldrsh r0, [r0, r1] + add r0, sp + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 1 + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + ldr r1, =0x02020630 + movs r2, 0x3A + ldrsh r0, [r4, r2] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + adds r2, 0x3E + ldrb r3, [r2] + lsls r0, r3, 29 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + lsls r1, 2 + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + b _08145288 + .pool +_08145284: + ldr r0, =sub_8144F94 + str r0, [r4, 0x1C] +_08145288: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8145218 + + thumb_func_start sub_8145294 +sub_8145294: @ 8145294 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0203ab88 + ldr r3, [r0] + ldr r1, [r3, 0x38] + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _081452DC + movs r0, 0x34 + ldrsh r2, [r1, r0] + ldr r1, =gUnknown_085B6348 + ldrb r0, [r3, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrh r0, [r0, 0x12] + adds r0, 0x5A + cmp r2, r0 + bne _0814533E + ldr r2, =0x02020630 + movs r0, 0x3A + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r3, 0x34 + b _08145306 + .pool +_081452DC: + movs r0, 0x34 + ldrsh r2, [r1, r0] + ldr r1, =gUnknown_085B6348 + ldrb r0, [r3, 0x4] + lsls r0, 30 + lsrs r0, 25 + adds r0, r1 + ldrh r0, [r0, 0x14] + movs r1, 0x87 + lsls r1, 1 + adds r0, r1 + cmp r2, r0 + bne _0814533E + ldr r2, =0x02020630 + movs r0, 0x3A + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r3, 0x2E +_08145306: + strh r3, [r0, 0x30] + movs r0, 0x36 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r3, [r0, 0x30] + movs r0, 0x3A + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_8145218 + str r1, [r0] + movs r0, 0x36 + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =sub_81450D8 + str r1, [r0] + movs r0, 0x2B + bl m4aSongNumStart +_0814533E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8145294 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/roulette_util.s b/asm/roulette_util.s new file mode 100644 index 000000000..04dc39a0c --- /dev/null +++ b/asm/roulette_util.s @@ -0,0 +1,1431 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8151678 +sub_8151678: @ 8151678 + push {lr} + movs r1, 0 + strb r1, [r0] + strh r1, [r0, 0x2] + adds r0, 0x4 + movs r2, 0xC0 + bl memset + pop {r0} + bx r0 + thumb_func_end sub_8151678 + + thumb_func_start sub_815168C +sub_815168C: @ 815168C + push {r4-r7,lr} + adds r3, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + cmp r6, 0xF + bhi _081516A8 + lsls r0, r6, 1 + adds r0, r6 + lsls r0, 2 + adds r5, r3, r0 + ldrb r7, [r5, 0x4] + lsrs r0, r7, 7 + cmp r0, 0 + beq _081516AC +_081516A8: + movs r0, 0xFF + b _0815170A +_081516AC: + ldrh r0, [r2] + movs r4, 0 + strh r0, [r5, 0x8] + ldrh r0, [r2, 0x2] + strh r0, [r5, 0xA] + ldrb r0, [r2, 0x4] + strb r0, [r5, 0xC] + ldrb r0, [r2, 0x5] + strb r0, [r5, 0xD] + ldrb r0, [r2, 0x6] + strb r0, [r5, 0xE] + ldrb r3, [r2, 0x7] + lsls r0, r3, 27 + lsrs r0, 27 + ldrb r2, [r5, 0xF] + movs r1, 0x20 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + movs r0, 0x60 + ands r0, r3 + movs r2, 0x61 + negs r2, r2 + ands r1, r2 + orrs r1, r0 + lsls r3, 24 + asrs r3, 31 + lsls r3, 7 + movs r0, 0x7F + ands r1, r0 + orrs r1, r3 + strb r1, [r5, 0xF] + subs r0, 0xFF + ands r0, r7 + movs r2, 0x80 + orrs r0, r2 + strb r0, [r5, 0x4] + strb r4, [r5, 0x6] + strb r4, [r5, 0x5] + lsls r1, 24 + cmp r1, 0 + bge _08151704 + movs r0, 0xFF + b _08151706 +_08151704: + movs r0, 0x1 +_08151706: + strb r0, [r5, 0x7] + adds r0, r6, 0 +_0815170A: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_815168C + + thumb_func_start sub_8151710 +sub_8151710: @ 8151710 + push {r4,lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r4, r1, 0 + cmp r4, 0xF + bhi _0815173C + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r1, r2, r0 + ldrb r0, [r1, 0x4] + lsrs r0, 7 + cmp r0, 0 + beq _0815173C + adds r0, r1, 0x4 + movs r1, 0 + movs r2, 0xC + bl memset + adds r0, r4, 0 + b _0815173E +_0815173C: + movs r0, 0xFF +_0815173E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8151710 + + thumb_func_start sub_8151744 +sub_8151744: @ 8151744 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r5, r0, 0 + movs r0, 0 + mov r12, r0 + ldrb r1, [r5, 0x8] + cmp r12, r1 + bcc _0815175C + b _081518F4 +_0815175C: + movs r7, 0x1F + ldr r0, =0xfffffc1f + mov r10, r0 + movs r1, 0x7D + negs r1, r1 + mov r9, r1 + movs r0, 0x1F + mov r8, r0 +_0815176C: + ldrh r0, [r5, 0x6] + add r0, r12 + lsls r0, 1 + ldr r1, =0x02037b14 + adds r3, r0, r1 + ldr r1, =0x02037714 + adds r6, r0, r1 + ldrb r0, [r5] + lsls r0, 25 + lsrs r0, 25 + cmp r0, 0x1 + beq _08151798 + cmp r0, 0x2 + beq _081517F6 + b _081518E2 + .pool +_08151798: + ldr r0, [r3] + lsls r2, r0, 27 + lsrs r0, r2, 27 + movs r1, 0x3 + ldrsb r1, [r5, r1] + adds r0, r1 + cmp r0, 0x1F + bhi _081517BA + lsrs r0, r2, 27 + adds r0, r1 + ands r0, r7 + ldrb r2, [r3] + movs r1, 0x20 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3] +_081517BA: + ldr r0, [r3] + lsls r2, r0, 22 + lsrs r0, r2, 27 + movs r1, 0x3 + ldrsb r1, [r5, r1] + adds r0, r1 + cmp r0, 0x1F + bhi _081517DE + lsrs r0, r2, 27 + adds r0, r1 + mov r1, r8 + ands r0, r1 + lsls r0, 5 + ldrh r2, [r3] + mov r1, r10 + ands r1, r2 + orrs r1, r0 + strh r1, [r3] +_081517DE: + ldr r0, [r3] + lsls r2, r0, 17 + lsrs r0, r2, 27 + movs r1, 0x3 + ldrsb r1, [r5, r1] + adds r0, r1 + cmp r0, 0x1F + bls _081517F0 + b _081518E2 +_081517F0: + lsrs r0, r2, 27 + adds r0, r1 + b _081518D4 +_081517F6: + movs r0, 0x3 + ldrsb r0, [r5, r0] + cmp r0, 0 + bge _08151868 + ldr r0, [r3] + lsls r4, r0, 27 + lsrs r1, r4, 27 + movs r2, 0x3 + ldrsb r2, [r5, r2] + adds r1, r2 + ldr r0, [r6] + lsls r0, 27 + lsrs r0, 27 + cmp r1, r0 + blt _08151826 + lsrs r0, r4, 27 + adds r0, r2 + ands r0, r7 + ldrb r2, [r3] + movs r1, 0x20 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3] +_08151826: + ldr r0, [r3] + lsls r4, r0, 22 + lsrs r1, r4, 27 + movs r2, 0x3 + ldrsb r2, [r5, r2] + adds r1, r2 + ldr r0, [r6] + lsls r0, 22 + lsrs r0, 27 + cmp r1, r0 + blt _08151850 + lsrs r0, r4, 27 + adds r0, r2 + mov r1, r8 + ands r0, r1 + lsls r0, 5 + ldrh r2, [r3] + mov r1, r10 + ands r1, r2 + orrs r1, r0 + strh r1, [r3] +_08151850: + ldr r0, [r3] + lsls r4, r0, 17 + lsrs r1, r4, 27 + movs r2, 0x3 + ldrsb r2, [r5, r2] + adds r1, r2 + ldr r0, [r6] + lsls r0, 17 + lsrs r0, 27 + cmp r1, r0 + blt _081518E2 + b _081518D0 +_08151868: + ldr r0, [r3] + lsls r4, r0, 27 + lsrs r1, r4, 27 + movs r2, 0x3 + ldrsb r2, [r5, r2] + adds r1, r2 + ldr r0, [r6] + lsls r0, 27 + lsrs r0, 27 + cmp r1, r0 + bgt _08151890 + lsrs r0, r4, 27 + adds r0, r2 + ands r0, r7 + ldrb r2, [r3] + movs r1, 0x20 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3] +_08151890: + ldr r0, [r3] + lsls r4, r0, 22 + lsrs r1, r4, 27 + movs r2, 0x3 + ldrsb r2, [r5, r2] + adds r1, r2 + ldr r0, [r6] + lsls r0, 22 + lsrs r0, 27 + cmp r1, r0 + bgt _081518BA + lsrs r0, r4, 27 + adds r0, r2 + mov r1, r8 + ands r0, r1 + lsls r0, 5 + ldrh r2, [r3] + mov r1, r10 + ands r1, r2 + orrs r1, r0 + strh r1, [r3] +_081518BA: + ldr r0, [r3] + lsls r4, r0, 17 + lsrs r1, r4, 27 + movs r2, 0x3 + ldrsb r2, [r5, r2] + adds r1, r2 + ldr r0, [r6] + lsls r0, 17 + lsrs r0, 27 + cmp r1, r0 + bgt _081518E2 +_081518D0: + lsrs r0, r4, 27 + adds r0, r2 +_081518D4: + ands r0, r7 + lsls r0, 2 + ldrb r2, [r3, 0x1] + mov r1, r9 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0x1] +_081518E2: + mov r0, r12 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + ldrb r0, [r5, 0x8] + cmp r12, r0 + bcs _081518F4 + b _0815176C +_081518F4: + ldrb r1, [r5, 0x2] + adds r0, r1, 0x1 + strb r0, [r5, 0x2] + ldrb r0, [r5, 0xB] + lsls r0, 27 + lsls r1, 24 + asrs r0, 3 + cmp r1, r0 + beq _0815190A + movs r0, 0 + b _0815193E +_0815190A: + movs r0, 0 + strb r0, [r5, 0x2] + movs r0, 0x3 + ldrsb r0, [r5, r0] + negs r0, r0 + strb r0, [r5, 0x3] + ldrb r2, [r5] + movs r1, 0x7F + movs r0, 0x7F + ands r0, r2 + cmp r0, 0x1 + bne _0815192A + lsls r0, r2, 25 + lsrs r0, 25 + adds r0, 0x1 + b _08151930 +_0815192A: + lsls r0, r2, 25 + lsrs r0, 25 + subs r0, 0x1 +_08151930: + ands r0, r1 + movs r1, 0x80 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r5] + movs r0, 0x1 +_0815193E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8151744 + + thumb_func_start sub_815194C +sub_815194C: @ 815194C + push {r4,r5,lr} + adds r3, r0, 0 + movs r2, 0 + ldrb r0, [r3] + lsls r0, 25 + lsrs r0, 25 + cmp r0, 0x1 + beq _08151962 + cmp r0, 0x2 + beq _08151990 + b _081519CA +_08151962: + ldrb r0, [r3, 0x8] + cmp r2, r0 + bcs _08151982 + ldr r4, =0x02037b14 +_0815196A: + ldrh r0, [r3, 0x6] + adds r0, r2 + lsls r0, 1 + adds r0, r4 + ldrh r1, [r3, 0x4] + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + ldrb r0, [r3, 0x8] + cmp r2, r0 + bcc _0815196A +_08151982: + ldrb r2, [r3] + lsls r1, r2, 25 + lsrs r1, 25 + adds r1, 0x1 + b _081519BC + .pool +_08151990: + ldrb r0, [r3, 0x8] + cmp r2, r0 + bcs _081519B4 + ldr r5, =0x02037b14 + ldr r4, =0x02037714 +_0815199A: + ldrh r0, [r3, 0x6] + adds r0, r2 + lsls r0, 1 + adds r1, r0, r5 + adds r0, r4 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + ldrb r0, [r3, 0x8] + cmp r2, r0 + bcc _0815199A +_081519B4: + ldrb r2, [r3] + lsls r1, r2, 25 + lsrs r1, 25 + subs r1, 0x1 +_081519BC: + movs r0, 0x7F + ands r1, r0 + movs r0, 0x80 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] +_081519CA: + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_815194C + + thumb_func_start task_tutorial_controls_fadein +task_tutorial_controls_fadein: @ 81519DC + push {r4-r6,lr} + adds r4, r0, 0 + movs r5, 0 + ldrb r0, [r4] + cmp r0, 0 + beq _08151A40 +_081519E8: + ldrh r0, [r4, 0x2] + asrs r0, r5 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08151A36 + lsls r1, r5, 1 + adds r0, r1, r5 + lsls r3, r0, 2 + adds r2, r4, r3 + ldrb r0, [r2, 0x5] + subs r0, 0x1 + strb r0, [r2, 0x5] + lsls r0, 24 + lsrs r0, 24 + adds r6, r1, 0 + cmp r0, 0xFF + bne _08151A36 + ldrh r0, [r2, 0x8] + movs r2, 0x80 + lsls r2, 8 + adds r1, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _08151A24 + adds r0, r3, 0x4 + adds r0, r4, r0 + bl sub_8151744 + b _08151A2C +_08151A24: + adds r0, r3, 0x4 + adds r0, r4, r0 + bl sub_815194C +_08151A2C: + adds r0, r6, r5 + lsls r0, 2 + adds r0, r4, r0 + ldrb r1, [r0, 0xD] + strb r1, [r0, 0x5] +_08151A36: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xF + bls _081519E8 +_08151A40: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end task_tutorial_controls_fadein + + thumb_func_start sub_8151A48 +sub_8151A48: @ 8151A48 + push {r4-r7,lr} + adds r3, r0, 0 + lsls r1, 16 + lsrs r6, r1, 16 + movs r4, 0 + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] + movs r5, 0x1 + movs r7, 0x80 + negs r7, r7 +_08151A5E: + adds r0, r6, 0 + asrs r0, r4 + ands r0, r5 + cmp r0, 0 + beq _08151A8C + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r2, r3, r0 + ldrb r0, [r2, 0x4] + lsrs r0, 7 + cmp r0, 0 + beq _08151A8C + adds r0, r5, 0 + lsls r0, r4 + ldrh r1, [r3, 0x2] + orrs r0, r1 + strh r0, [r3, 0x2] + ldrb r1, [r2, 0x4] + adds r0, r7, 0 + ands r0, r1 + orrs r0, r5 + strb r0, [r2, 0x4] +_08151A8C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _08151A5E + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8151A48 + + thumb_func_start sub_8151A9C +sub_8151A9C: @ 8151A9C + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + lsls r1, 16 + lsrs r7, r1, 16 + movs r5, 0 + movs r3, 0x1 +_08151AAA: + ldrh r0, [r6, 0x2] + asrs r0, r5 + ands r0, r3 + cmp r0, 0 + beq _08151B12 + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r4, r6, r0 + ldrb r0, [r4, 0x4] + lsrs r0, 7 + cmp r0, 0 + beq _08151B12 + adds r0, r7, 0 + asrs r0, r5 + ands r0, r3 + cmp r0, 0 + beq _08151B12 + ldrh r1, [r4, 0xA] + lsls r1, 1 + ldr r0, =0x02037b14 + adds r0, r1, r0 + ldr r2, =0x02037714 + adds r1, r2 + ldrb r2, [r4, 0xC] + lsls r2, 1 + str r3, [sp] + bl memcpy + ldrb r0, [r4, 0x4] + movs r2, 0x80 + negs r2, r2 + adds r1, r2, 0 + ands r0, r1 + strb r0, [r4, 0x4] + movs r0, 0 + strb r0, [r4, 0x6] + strb r0, [r4, 0x5] + ldrb r0, [r4, 0xF] + lsls r0, 24 + ldr r3, [sp] + cmp r0, 0 + bge _08151B10 + movs r0, 0xFF + strb r0, [r4, 0x7] + b _08151B12 + .pool +_08151B10: + strb r3, [r4, 0x7] +_08151B12: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xF + bls _08151AAA + ldr r0, =0x0000ffff + cmp r7, r0 + bne _08151B2C + movs r0, 0 + strb r0, [r6] + b _08151B30 + .pool +_08151B2C: + ldrh r0, [r6, 0x2] + bics r0, r7 +_08151B30: + strh r0, [r6, 0x2] + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8151A9C + + thumb_func_start sub_8151B3C +sub_8151B3C: @ 8151B3C + push {r4,r5,lr} + adds r5, r0, 0 + movs r4, 0 + strh r4, [r5] + adds r0, r5, 0x4 + movs r1, 0 + movs r2, 0xC0 + bl memset +_08151B4E: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r5, r0 + strb r4, [r0, 0x4] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _08151B4E + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8151B3C + + thumb_func_start sub_8151B68 +sub_8151B68: @ 8151B68 + push {r4,r5,lr} + adds r2, r0, 0 + adds r5, r1, 0 + movs r3, 0 + movs r4, 0 + ldrb r0, [r2, 0x5] + lsrs r0, 7 + cmp r0, 0 + bne _08151B7E + adds r4, r2, 0x4 + b _08151B9C +_08151B7E: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xF + bhi _08151B9C + lsls r0, r3, 1 + adds r0, r3 + lsls r1, r0, 2 + adds r0, r2, r1 + ldrb r0, [r0, 0x5] + lsrs r0, 7 + cmp r0, 0 + bne _08151B7E + adds r0, r1, 0x4 + adds r4, r2, r0 +_08151B9C: + cmp r4, 0 + beq _08151BCA + ldrb r1, [r4, 0x1] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r4, 0x1] + movs r0, 0 + strb r0, [r4, 0x2] + strb r0, [r4, 0x3] + adds r1, r4, 0x4 + adds r0, r5, 0 + ldm r0!, {r2,r4} + stm r1!, {r2,r4} + adds r0, r3, 0 + b _08151BCC +_08151BCA: + movs r0, 0xFF +_08151BCC: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8151B68 + + thumb_func_start sub_8151BD4 +sub_8151BD4: @ 8151BD4 + push {r4,r5,lr} + adds r4, r0, 0 + ldrb r1, [r4, 0x1] + movs r2, 0x40 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08151C16 + ldrb r1, [r4, 0xB] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _08151C16 + ldrh r2, [r4, 0x6] + ldrb r0, [r4, 0x8] + adds r0, r2, r0 + cmp r2, r0 + bge _08151C16 + ldr r5, =0x02037b14 + ldr r3, =0x02037714 +_08151BFC: + lsls r0, r2, 1 + adds r1, r0, r5 + adds r0, r3 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r0, [r4, 0x6] + ldrb r1, [r4, 0x8] + adds r0, r1 + cmp r2, r0 + blt _08151BFC +_08151C16: + adds r0, r4, 0x4 + movs r1, 0 + movs r2, 0x8 + bl memset + ldrb r1, [r4, 0x1] + movs r0, 0x10 + negs r0, r0 + ands r0, r1 + movs r1, 0x11 + negs r1, r1 + ands r0, r1 + subs r1, 0x10 + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + movs r1, 0x7F + ands r0, r1 + strb r0, [r4, 0x1] + movs r0, 0 + strb r0, [r4, 0x3] + strb r0, [r4, 0x2] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8151BD4 + + thumb_func_start sub_8151C50 +sub_8151C50: @ 8151C50 + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 24 + movs r5, 0 + cmp r2, 0 + bne _08151C74 + movs r1, 0xF + ands r1, r4 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, 0x4 + adds r0, r6, r0 + bl sub_8151BD4 + b _08151CA0 +_08151C74: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _08151C94 + lsls r0, r5, 1 + adds r0, r5 + lsls r1, r0, 2 + adds r0, r6, r1 + ldrb r0, [r0, 0x5] + lsrs r0, 7 + cmp r0, 0 + beq _08151C94 + adds r0, r1, 0x4 + adds r0, r6, r0 + bl sub_8151BD4 +_08151C94: + lsrs r4, 1 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0xF + bls _08151C74 +_08151CA0: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8151C50 + + thumb_func_start sub_8151CA8 +sub_8151CA8: @ 8151CA8 + push {r4-r7,lr} + adds r5, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 24 + movs r3, 0 + cmp r2, 0 + bne _08151CDC + movs r0, 0xF + adds r3, r0, 0 + ands r3, r4 + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r1, r5, r1 + ldrb r2, [r1, 0x5] + movs r0, 0x41 + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] + movs r0, 0x1 + lsls r0, r3 + ldrh r1, [r5] + orrs r0, r1 + strh r0, [r5] + b _08151D20 +_08151CDC: + movs r6, 0x1 + movs r7, 0x41 + negs r7, r7 +_08151CE2: + adds r0, r4, 0 + ands r0, r6 + cmp r0, 0 + beq _08151D00 + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r2, r5, r0 + ldrb r1, [r2, 0x5] + lsrs r0, r1, 7 + cmp r0, 0 + beq _08151D00 + lsls r0, r1, 25 + cmp r0, 0 + blt _08151D06 +_08151D00: + lsls r0, r4, 17 + lsrs r4, r0, 16 + b _08151D16 +_08151D06: + adds r0, r7, 0 + ands r0, r1 + strb r0, [r2, 0x5] + adds r0, r6, 0 + lsls r0, r3 + ldrh r1, [r5] + orrs r0, r1 + strh r0, [r5] +_08151D16: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xF + bls _08151CE2 +_08151D20: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8151CA8 + + thumb_func_start sub_8151D28 +sub_8151D28: @ 8151D28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r8, r0 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 24 + movs r0, 0 + mov r12, r0 + cmp r2, 0 + bne _08151DB0 + movs r1, 0xF + ands r1, r7 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, 0x4 + mov r1, r8 + adds r3, r1, r0 + ldrb r1, [r3, 0x1] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0x80 + bne _08151E3A + ldrb r1, [r3, 0xB] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08151D8E + ldrh r2, [r3, 0x6] + ldrb r0, [r3, 0x8] + adds r0, r2, r0 + cmp r2, r0 + bge _08151D8E + ldr r5, =0x02037b14 + ldr r4, =0x02037714 +_08151D74: + lsls r0, r2, 1 + adds r1, r0, r5 + adds r0, r4 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r0, [r3, 0x6] + ldrb r1, [r3, 0x8] + adds r0, r1 + cmp r2, r0 + blt _08151D74 +_08151D8E: + ldrb r0, [r3, 0x1] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r3, 0x1] + movs r1, 0x1 + mov r2, r12 + lsls r1, r2 + mov r2, r8 + ldrh r0, [r2] + bics r0, r1 + strh r0, [r2] + b _08151E3A + .pool +_08151DB0: + movs r0, 0x1 + mov r9, r0 + movs r1, 0x40 + mov r10, r1 +_08151DB8: + mov r2, r12 + lsls r0, r2, 1 + add r0, r12 + lsls r0, 2 + adds r0, 0x4 + mov r1, r8 + adds r3, r1, r0 + adds r0, r7, 0 + mov r2, r9 + ands r0, r2 + cmp r0, 0 + beq _08151DDA + ldrb r1, [r3, 0x1] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0x80 + beq _08151DE4 +_08151DDA: + lsls r0, r7, 17 + lsrs r7, r0, 16 + mov r5, r12 + adds r5, 0x1 + b _08151E30 +_08151DE4: + ldrb r1, [r3, 0xB] + mov r0, r10 + ands r0, r1 + mov r5, r12 + adds r5, 0x1 + cmp r0, 0 + beq _08151E1A + ldrh r2, [r3, 0x6] + ldrb r0, [r3, 0x8] + adds r0, r2, r0 + cmp r2, r0 + bge _08151E1A + ldr r6, =0x02037b14 + ldr r4, =0x02037714 +_08151E00: + lsls r0, r2, 1 + adds r1, r0, r6 + adds r0, r4 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r0, [r3, 0x6] + ldrb r1, [r3, 0x8] + adds r0, r1 + cmp r2, r0 + blt _08151E00 +_08151E1A: + ldrb r1, [r3, 0x1] + mov r0, r10 + orrs r0, r1 + strb r0, [r3, 0x1] + mov r1, r9 + mov r0, r12 + lsls r1, r0 + mov r2, r8 + ldrh r0, [r2] + bics r0, r1 + strh r0, [r2] +_08151E30: + lsls r0, r5, 24 + lsrs r0, 24 + mov r12, r0 + cmp r0, 0xF + bls _08151DB8 +_08151E3A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8151D28 + + thumb_func_start sub_8151E50 +sub_8151E50: @ 8151E50 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + str r0, [sp] + movs r0, 0 + mov r10, r0 + ldr r1, [sp] + ldrh r0, [r1] + cmp r0, 0 + bne _08151E6C + b _08151FF6 +_08151E6C: + movs r2, 0xF + mov r9, r2 + movs r3, 0x10 + negs r3, r3 + mov r8, r3 + movs r7, 0x1 +_08151E78: + mov r5, r10 + lsls r0, r5, 1 + add r0, r10 + lsls r0, 2 + adds r0, 0x4 + ldr r1, [sp] + adds r4, r1, r0 + ldrb r2, [r4, 0x1] + movs r3, 0xC0 + ands r3, r2 + cmp r3, 0x80 + beq _08151E92 + b _08151FE6 +_08151E92: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08151EA8 + ldrb r0, [r4, 0xB] + ands r3, r0 + cmp r3, 0 + beq _08151EA8 + b _08151FE6 +_08151EA8: + ldrb r0, [r4, 0x2] + subs r0, 0x1 + strb r0, [r4, 0x2] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _08151EB8 + b _08151FE6 +_08151EB8: + ldrb r0, [r4, 0x9] + strb r0, [r4, 0x2] + ldrh r0, [r4, 0x6] + ldrb r1, [r4, 0x8] + lsls r2, 28 + lsrs r2, 28 + ldrh r3, [r4, 0x4] + bl pal_fade_1 + ldrb r5, [r4, 0xB] + lsls r0, r5, 26 + asrs r0, 30 + cmp r0, 0x1 + beq _08151F16 + cmp r0, 0x1 + bgt _08151EE4 + cmp r0, 0 + beq _08151EEA + b _08151FD0 + .pool +_08151EE4: + cmp r0, 0x2 + beq _08151F92 + b _08151FD0 +_08151EEA: + ldrb r2, [r4, 0x1] + lsls r1, r2, 28 + lsrs r0, r1, 28 + adds r0, 0x1 + mov r3, r9 + ands r0, r3 + mov r6, r8 + adds r3, r6, 0 + ands r3, r2 + orrs r3, r0 + strb r3, [r4, 0x1] + lsrs r1, 28 + lsls r0, r5, 28 + asrs r0, 28 + cmp r1, r0 + bne _08151FD0 + ldrb r0, [r4, 0x3] + adds r0, 0x1 + strb r0, [r4, 0x3] + ands r3, r6 + strb r3, [r4, 0x1] + b _08151FD0 +_08151F16: + ldrb r3, [r4, 0x1] + movs r0, 0x10 + ands r0, r3 + cmp r0, 0 + beq _08151F54 + lsls r0, r3, 28 + lsrs r0, 28 + subs r0, 0x1 + mov r5, r9 + ands r0, r5 + mov r2, r8 + ands r2, r3 + orrs r2, r0 + strb r2, [r4, 0x1] + cmp r0, 0 + bne _08151FD0 + ldrb r0, [r4, 0x3] + adds r0, 0x1 + strb r0, [r4, 0x3] + lsls r0, r2, 27 + lsrs r0, 31 + eors r0, r7 + ands r0, r7 + lsls r0, 4 + movs r3, 0x11 + negs r3, r3 + adds r1, r3, 0 + ands r2, r1 + orrs r2, r0 + strb r2, [r4, 0x1] + b _08151FD0 +_08151F54: + lsls r0, r5, 28 + asrs r0, 28 + subs r0, 0x1 + mov r5, r9 + ands r0, r5 + lsls r2, r3, 28 + lsrs r1, r2, 28 + adds r1, 0x1 + ands r1, r5 + mov r5, r8 + ands r3, r5 + orrs r3, r1 + strb r3, [r4, 0x1] + lsrs r2, 28 + cmp r2, r0 + bne _08151FD0 + ldrb r0, [r4, 0x3] + adds r0, 0x1 + strb r0, [r4, 0x3] + lsls r0, r3, 27 + lsrs r0, 31 + eors r0, r7 + ands r0, r7 + lsls r0, 4 + movs r2, 0x11 + negs r2, r2 + adds r1, r2, 0 + ands r3, r1 + orrs r3, r0 + strb r3, [r4, 0x1] + b _08151FD0 +_08151F92: + ldrb r2, [r4, 0x1] + movs r0, 0x10 + ands r0, r2 + cmp r0, 0 + beq _08151FA2 + mov r0, r8 + ands r0, r2 + b _08151FB0 +_08151FA2: + lsls r1, r5, 28 + asrs r1, 28 + mov r3, r9 + ands r1, r3 + mov r0, r8 + ands r0, r2 + orrs r0, r1 +_08151FB0: + strb r0, [r4, 0x1] + ldrb r2, [r4, 0x1] + lsls r0, r2, 27 + lsrs r0, 31 + eors r0, r7 + ands r0, r7 + lsls r0, 4 + movs r5, 0x11 + negs r5, r5 + adds r1, r5, 0 + ands r2, r1 + orrs r2, r0 + strb r2, [r4, 0x1] + ldrb r0, [r4, 0x3] + adds r0, 0x1 + strb r0, [r4, 0x3] +_08151FD0: + ldrb r1, [r4, 0xA] + cmp r1, 0xFF + beq _08151FE6 + ldrb r0, [r4, 0x3] + cmp r0, r1 + bne _08151FE6 + ldrb r1, [r4] + ldr r0, [sp] + movs r2, 0 + bl sub_8151D28 +_08151FE6: + mov r0, r10 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + cmp r0, 0xF + bhi _08151FF6 + b _08151E78 +_08151FF6: + 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_8151E50 + + thumb_func_start sub_8152008 +sub_8152008: @ 8152008 + push {r4-r7,lr} + adds r6, r0, 0 + ldr r0, [sp, 0x14] + ldr r4, [sp, 0x18] + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r4, 24 + movs r1, 0 + lsrs r3, 19 + adds r3, r2 + lsls r3, 1 + adds r6, r3 + cmp r1, r4 + bcs _08152052 +_08152030: + lsls r0, r1, 6 + adds r2, r6, r0 + movs r0, 0 + adds r3, r1, 0x1 + cmp r0, r5 + bcs _0815204A +_0815203C: + strh r7, [r2] + adds r2, 0x2 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + bcc _0815203C +_0815204A: + lsls r0, r3, 24 + lsrs r1, r0, 24 + cmp r1, r4 + bcc _08152030 +_08152052: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8152008 + + thumb_func_start sub_8152058 +sub_8152058: @ 8152058 + push {r4-r7,lr} + adds r7, r0, 0 + ldr r0, [sp, 0x14] + ldr r4, [sp, 0x18] + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r4, 24 + lsrs r6, r4, 24 + movs r4, 0 + lsrs r3, 19 + adds r3, r2 + lsls r3, 1 + adds r7, r3 + cmp r4, r6 + bcs _081520A2 +_0815207C: + lsls r0, r4, 6 + adds r2, r7, r0 + movs r3, 0 + adds r4, 0x1 + cmp r3, r5 + bcs _0815209A +_08152088: + ldrh r0, [r1] + strh r0, [r2] + adds r1, 0x2 + adds r2, 0x2 + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r5 + bcc _08152088 +_0815209A: + lsls r0, r4, 24 + lsrs r4, r0, 24 + cmp r4, r6 + bcc _0815207C +_081520A2: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8152058 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rtc.s b/asm/rtc.s index c4a248dae..f68021958 100644 --- a/asm/rtc.s +++ b/asm/rtc.s @@ -1,4 +1,5 @@ .include "asm/macros.inc" + .include "constants/constants.inc" .syntax unified diff --git a/asm/safari_zone.s b/asm/safari_zone.s new file mode 100644 index 000000000..6205d10c5 --- /dev/null +++ b/asm/safari_zone.s @@ -0,0 +1,524 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start GetSafariZoneFlag +GetSafariZoneFlag: @ 80FC0A0 + push {lr} + ldr r0, =0x0000088c + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end GetSafariZoneFlag + + thumb_func_start SetSafariZoneFlag +SetSafariZoneFlag: @ 80FC0B4 + push {lr} + ldr r0, =0x0000088c + bl FlagSet + pop {r0} + bx r0 + .pool + thumb_func_end SetSafariZoneFlag + + thumb_func_start ResetSafariZoneFlag +ResetSafariZoneFlag: @ 80FC0C4 + push {lr} + ldr r0, =0x0000088c + bl FlagReset + pop {r0} + bx r0 + .pool + thumb_func_end ResetSafariZoneFlag + + thumb_func_start sub_80FC0D4 +sub_80FC0D4: @ 80FC0D4 + push {lr} + movs r0, 0x11 + bl sav12_xor_increment + bl SetSafariZoneFlag + bl sub_80FC244 + ldr r1, =0x0203a04c + movs r0, 0x1E + strb r0, [r1] + ldr r1, =0x0203a04e + movs r2, 0xFA + lsls r2, 1 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, =0x0203a050 + movs r1, 0 + strb r1, [r0] + ldr r0, =0x0203a051 + strb r1, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FC0D4 + + thumb_func_start sub_80FC114 +sub_80FC114: @ 80FC114 + push {lr} + ldr r0, =0x0203a050 + ldrb r0, [r0] + ldr r1, =0x0203a051 + ldrb r1, [r1] + bl sub_80EE44C + bl ResetSafariZoneFlag + bl sub_80FC244 + ldr r1, =0x0203a04c + movs r0, 0 + strb r0, [r1] + ldr r1, =0x0203a04e + movs r0, 0 + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FC114 + + thumb_func_start safari_step +safari_step: @ 80FC14C + push {lr} + bl GetSafariZoneFlag + cmp r0, 0 + beq _080FC168 + bl sub_80FC480 + ldr r1, =0x0203a04e + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + beq _080FC170 +_080FC168: + movs r0, 0 + b _080FC178 + .pool +_080FC170: + ldr r0, =gUnknown_082A4B8A + bl script_env_1_execute_new_script + movs r0, 0x1 +_080FC178: + pop {r1} + bx r1 + .pool + thumb_func_end safari_step + + thumb_func_start sub_80FC180 +sub_80FC180: @ 80FC180 + push {lr} + ldr r0, =gUnknown_082A4B6F + bl script_env_1_execute_new_script + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FC180 + + thumb_func_start sub_80FC190 +sub_80FC190: @ 80FC190 + push {lr} + ldr r1, =0x0203a051 + ldr r0, =0x03005d10 + ldrb r0, [r0, 0x1F] + ldrb r2, [r1] + adds r0, r2 + strb r0, [r1] + ldr r2, =0x0202433a + ldrb r0, [r2] + cmp r0, 0x7 + bne _080FC1AE + ldr r1, =0x0203a050 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080FC1AE: + ldr r0, =0x0203a04c + ldrb r0, [r0] + cmp r0, 0 + beq _080FC1D8 + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + b _080FC21C + .pool +_080FC1D8: + ldrb r0, [r2] + cmp r0, 0x8 + bne _080FC208 + ldr r0, =gUnknown_082A4B4C + bl script_env_2_execute_new_script + bl warp_in + ldr r1, =0x03005dac + ldr r0, =sub_80AF6F0 + str r0, [r1] + ldr r0, =c2_load_new_map + bl SetMainCallback2 + b _080FC21C + .pool +_080FC208: + cmp r0, 0x7 + bne _080FC21C + ldr r0, =gUnknown_082A4B9B + bl script_env_1_execute_new_script + bl script_env_2_set_ctx_paused + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 +_080FC21C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FC190 + + thumb_func_start sub_80FC228 +sub_80FC228: @ 80FC228 + push {lr} + lsls r0, 24 + lsrs r0, 20 + ldr r1, =0x0203a054 + adds r0, r1 + movs r1, 0 + movs r2, 0x10 + bl memset + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FC228 + + thumb_func_start sub_80FC244 +sub_80FC244: @ 80FC244 + push {lr} + ldr r0, =0x0203a054 + movs r1, 0 + movs r2, 0xA0 + bl memset + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FC244 + + thumb_func_start sub_80FC258 +sub_80FC258: @ 80FC258 + push {r4,r5,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl GetXYCoordsOneStepInFrontOfPlayer + movs r5, 0 +_080FC26A: + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r1, =0x0203a054 + lsls r0, r5, 4 + adds r3, r0, r1 + movs r1, 0x5 + ldrsb r1, [r2, r1] + movs r0, 0x4 + ldrsb r0, [r3, r0] + cmp r1, r0 + bne _080FC2C4 + mov r0, sp + movs r2, 0 + ldrsh r1, [r3, r2] + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r1, r0 + bne _080FC2C4 + movs r0, 0x2 + ldrsh r1, [r3, r0] + movs r2, 0 + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _080FC2C4 + ldr r0, =0x020375f0 + strh r5, [r0] + ldr r1, =gUnknown_085B262C + ldrb r0, [r3, 0x8] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, =0x02021cc4 + bl CopyString + b _080FC2D6 + .pool +_080FC2C4: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x9 + bls _080FC26A + ldr r1, =0x020375f0 + ldr r2, =0x0000ffff + adds r0, r2, 0 + strh r0, [r1] +_080FC2D6: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FC258 + + thumb_func_start sub_80FC2E8 +sub_80FC2E8: @ 80FC2E8 + push {r4-r7,lr} + sub sp, 0x4 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + movs r5, 0 + adds r6, r4, 0 + ldr r0, =0x03005d8c + ldr r7, [r0] + mov r4, sp + ldr r0, =0x0203a054 + mov r12, r0 +_080FC306: + lsls r0, r5, 4 + mov r1, r12 + adds r3, r0, r1 + movs r1, 0x5 + ldrsb r1, [r7, r1] + movs r0, 0x4 + ldrsb r0, [r3, r0] + cmp r1, r0 + bne _080FC364 + ldrh r0, [r4] + ldrh r1, [r3] + subs r0, r1 + strh r0, [r4] + adds r2, r6, 0 + ldrh r0, [r2] + ldrh r1, [r3, 0x2] + subs r0, r1 + strh r0, [r2] + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bge _080FC336 + negs r0, r0 + strh r0, [r4] +_080FC336: + movs r1, 0 + ldrsh r0, [r2, r1] + cmp r0, 0 + bge _080FC342 + negs r0, r0 + strh r0, [r2] +_080FC342: + movs r2, 0 + ldrsh r0, [r4, r2] + movs r2, 0 + ldrsh r1, [r6, r2] + adds r0, r1 + cmp r0, 0x5 + bgt _080FC364 + ldr r0, =0x020375f0 + strh r5, [r0] + b _080FC376 + .pool +_080FC364: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x9 + bls _080FC306 + ldr r1, =0x020375f0 + ldr r2, =0x0000ffff + adds r0, r2, 0 + strh r0, [r1] +_080FC376: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FC2E8 + + thumb_func_start sub_80FC388 +sub_80FC388: @ 80FC388 + push {lr} + bl sub_80FC258 + ldr r2, =0x020375f0 + ldrh r1, [r2] + ldr r0, =0x0000ffff + cmp r1, r0 + beq _080FC3B0 + adds r0, r1, 0 + lsls r0, 4 + ldr r1, =0x0203a05c + adds r0, r1 + b _080FC3B2 + .pool +_080FC3B0: + movs r0, 0 +_080FC3B2: + pop {r1} + bx r1 + thumb_func_end sub_80FC388 + + thumb_func_start sub_80FC3B8 +sub_80FC3B8: @ 80FC3B8 + push {lr} + bl sub_80FC2E8 + ldr r2, =0x020375f0 + ldrh r1, [r2] + ldr r0, =0x0000ffff + cmp r1, r0 + beq _080FC3E0 + adds r0, r1, 0 + lsls r0, 4 + ldr r1, =0x0203a05c + adds r0, r1 + b _080FC3E2 + .pool +_080FC3E0: + movs r0, 0 +_080FC3E2: + pop {r1} + bx r1 + thumb_func_end sub_80FC3B8 + + thumb_func_start sub_80FC3E8 +sub_80FC3E8: @ 80FC3E8 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r1, 0 + ldr r2, =0x0203a054 + mov r6, sp + adds r6, 0x2 + movs r0, 0x8 + adds r0, r2 + mov r9, r0 + ldr r7, =0x03005d8c +_080FC408: + lsls r5, r1, 4 + adds r4, r5, r2 + movs r0, 0x4 + ldrsb r0, [r4, r0] + cmp r0, 0 + bne _080FC468 + movs r3, 0 + ldrsh r0, [r4, r3] + cmp r0, 0 + bne _080FC468 + movs r3, 0x2 + ldrsh r0, [r4, r3] + cmp r0, 0 + bne _080FC468 + mov r0, sp + adds r1, r6, 0 + bl GetXYCoordsOneStepInFrontOfPlayer + ldr r0, [r7] + ldrb r0, [r0, 0x5] + strb r0, [r4, 0x4] + mov r0, r9 + adds r2, r5, r0 + ldr r0, [r7] + mov r3, r8 + lsls r1, r3, 3 + ldr r3, =0x00000848 + adds r0, r3 + adds r0, r1 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + movs r0, 0x64 + strb r0, [r4, 0x5] + mov r0, sp + ldrh r0, [r0] + strh r0, [r4] + ldrh r0, [r6] + strh r0, [r4, 0x2] + b _080FC472 + .pool +_080FC468: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x9 + bls _080FC408 +_080FC472: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80FC3E8 + + thumb_func_start sub_80FC480 +sub_80FC480: @ 80FC480 + push {r4,r5,lr} + movs r4, 0 + ldr r5, =0x0203a054 +_080FC486: + lsls r0, r4, 4 + adds r1, r0, r5 + ldrb r0, [r1, 0x5] + cmp r0, 0 + beq _080FC4A0 + subs r0, 0x1 + strb r0, [r1, 0x5] + lsls r0, 24 + cmp r0, 0 + bne _080FC4A0 + adds r0, r4, 0 + bl sub_80FC228 +_080FC4A0: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x9 + bls _080FC486 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FC480 + + thumb_func_start sub_80FC4B4 +sub_80FC4B4: @ 80FC4B4 + push {lr} + bl sub_80FC258 + ldr r3, =0x020375f0 + ldrh r1, [r3] + ldr r0, =0x0000ffff + cmp r1, r0 + beq _080FC4EC + ldr r0, =0x02021dc4 + ldr r2, =0x0203a054 + lsls r1, 4 + adds r1, r2 + ldrb r1, [r1, 0x5] + movs r2, 0x2 + movs r3, 0x3 + bl ConvertIntToDecimalString + movs r0, 0x1 + b _080FC4EE + .pool +_080FC4EC: + movs r0, 0 +_080FC4EE: + pop {r1} + bx r1 + thumb_func_end sub_80FC4B4 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/save.s b/asm/save.s new file mode 100644 index 000000000..0cc13bad5 --- /dev/null +++ b/asm/save.s @@ -0,0 +1,2048 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start calls_flash_erase_block +calls_flash_erase_block: @ 8152650 + push {r4,r5,lr} + movs r4, 0 + ldr r5, =0x03007860 +_08152656: + ldr r1, [r5] + adds r0, r4, 0 + bl _call_via_r1 + adds r0, r4, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r0, 16 + ldr r1, [r5] + bl _call_via_r1 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0xF + bls _08152656 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end calls_flash_erase_block + + thumb_func_start sub_8152680 +sub_8152680: @ 8152680 + ldr r0, =0x03006200 + movs r1, 0 + str r1, [r0] + ldr r0, =0x030061f0 + strh r1, [r0] + ldr r0, =0x030061fc + str r1, [r0] + bx lr + .pool + thumb_func_end sub_8152680 + + thumb_func_start sub_815269C +sub_815269C: @ 815269C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + movs r4, 0 + cmp r0, 0x1 + beq _081526D0 + cmp r0, 0x1 + bgt _081526B6 + cmp r0, 0 + beq _081526BC + b _081526F4 +_081526B6: + cmp r0, 0x2 + beq _081526E4 + b _081526F4 +_081526BC: + ldr r2, =0x030061fc + movs r1, 0x1 + lsls r1, r3 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + b _081526F4 + .pool +_081526D0: + ldr r2, =0x030061fc + adds r1, r0, 0 + lsls r1, r3 + ldr r0, [r2] + bics r0, r1 + str r0, [r2] + b _081526F4 + .pool +_081526E4: + ldr r0, =0x030061fc + movs r1, 0x1 + lsls r1, r3 + ldr r0, [r0] + ands r0, r1 + cmp r0, 0 + beq _081526F4 + movs r4, 0x1 +_081526F4: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_815269C + + thumb_func_start save_write_to_flash +save_write_to_flash: @ 8152700 + push {r4-r7,lr} + adds r7, r1, 0 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, =0x03006204 + ldr r0, =0x0203abbc + str r0, [r1] + ldr r0, =0x0000ffff + cmp r2, r0 + beq _08152730 + adds r0, r2, 0 + adds r1, r7, 0 + bl sub_81527A0 + lsls r0, 24 + lsrs r5, r0, 24 + b _08152782 + .pool +_08152730: + ldr r1, =0x030061f8 + ldr r5, =0x030061f0 + ldrh r0, [r5] + strh r0, [r1] + ldr r1, =0x030061f4 + ldr r6, =0x03006200 + ldr r4, [r6] + str r4, [r1] + adds r0, 0x1 + strh r0, [r5] + ldrh r0, [r5] + movs r1, 0xE + bl __umodsi3 + strh r0, [r5] + adds r4, 0x1 + str r4, [r6] + movs r5, 0x1 + movs r4, 0 +_08152756: + adds r0, r4, 0 + adds r1, r7, 0 + bl sub_81527A0 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0xD + bls _08152756 + ldr r0, =0x030061fc + ldr r0, [r0] + cmp r0, 0 + beq _08152782 + movs r5, 0xFF + ldr r1, =0x030061f0 + ldr r0, =0x030061f8 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, =0x03006200 + ldr r0, =0x030061f4 + ldr r0, [r0] + str r0, [r1] +_08152782: + adds r0, r5, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end save_write_to_flash + + thumb_func_start sub_81527A0 +sub_81527A0: @ 81527A0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r4, r1, 0 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =0x030061f0 + ldrh r0, [r0] + adds r0, r6, r0 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r5, 0 + movs r1, 0xE + bl __umodsi3 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r2, =0x03006200 + ldr r1, [r2] + movs r0, 0x1 + ands r1, r0 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 1 + adds r0, r5, r0 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r6, 3 + adds r0, r4 + ldr r1, [r0] + mov r10, r1 + ldrh r4, [r0, 0x4] + movs r3, 0 + mov r9, r2 + ldr r2, =0x03006204 + mov r12, r2 + mov r8, r12 + movs r2, 0 + ldr r1, =0x00000fff +_081527F2: + mov r7, r8 + ldr r0, [r7] + adds r0, r3 + strb r2, [r0] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r1 + bls _081527F2 + mov r0, r12 + ldr r1, [r0] + ldr r2, =0x00000ff4 + adds r0, r1, r2 + strh r6, [r0] + ldr r3, =0x00000ff8 + adds r2, r1, r3 + ldr r0, =0x08012025 + str r0, [r2] + ldr r6, =0x00000ffc + adds r1, r6 + mov r7, r9 + ldr r0, [r7] + str r0, [r1] + movs r3, 0 + lsls r5, 24 + cmp r3, r4 + bcs _08152840 + mov r2, r12 +_0815282A: + ldr r1, [r2] + adds r1, r3 + mov r6, r10 + adds r0, r6, r3 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r4 + bcc _0815282A +_08152840: + mov r0, r10 + adds r1, r4, 0 + bl sub_8153164 + ldr r1, =0x03006204 + ldr r1, [r1] + ldr r7, =0x00000ff6 + adds r2, r1, r7 + strh r0, [r2] + lsrs r0, r5, 24 + bl sub_8152908 + lsls r0, 24 + lsrs r0, 24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81527A0 + + thumb_func_start sub_8152890 +sub_8152890: @ 8152890 + push {r4-r7,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r2, 16 + lsrs r2, 16 + ldr r4, =0x0203abbc + movs r3, 0 + movs r6, 0 + ldr r1, =0x00000fff +_081528A4: + adds r0, r4, r3 + strb r6, [r0] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r1 + bls _081528A4 + ldr r0, =0x00000ff8 + adds r1, r4, r0 + ldr r0, =0x08012025 + str r0, [r1] + movs r3, 0 + cmp r3, r2 + bcs _081528D2 +_081528C0: + adds r1, r4, r3 + adds r0, r5, r3 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r2 + bcc _081528C0 +_081528D2: + adds r0, r5, 0 + adds r1, r2, 0 + bl sub_8153164 + ldr r2, =0x00000ff4 + adds r1, r4, r2 + strh r0, [r1] + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_8152908 + lsls r0, 24 + lsrs r0, 24 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8152890 + + thumb_func_start sub_8152908 +sub_8152908: @ 8152908 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl ProgramFlashSectorsAndVerify + cmp r0, 0 + bne _08152924 + movs r0, 0x1 + adds r1, r4, 0 + bl sub_815269C + movs r0, 0x1 + b _0815292E +_08152924: + movs r0, 0 + adds r1, r4, 0 + bl sub_815269C + movs r0, 0xFF +_0815292E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8152908 + + thumb_func_start sub_8152934 +sub_8152934: @ 8152934 + push {r4-r6,lr} + ldr r1, =0x03006204 + ldr r0, =0x0203abbc + str r0, [r1] + ldr r1, =0x030061f8 + ldr r5, =0x030061f0 + ldrh r0, [r5] + strh r0, [r1] + ldr r1, =0x030061f4 + ldr r6, =0x03006200 + ldr r4, [r6] + str r4, [r1] + adds r0, 0x1 + strh r0, [r5] + ldrh r0, [r5] + movs r1, 0xE + bl __umodsi3 + strh r0, [r5] + adds r4, 0x1 + str r4, [r6] + ldr r1, =0x03006208 + movs r0, 0 + strh r0, [r1] + ldr r1, =0x030061fc + movs r0, 0 + str r0, [r1] + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8152934 + + thumb_func_start sub_8152990 +sub_8152990: @ 8152990 + ldr r1, =0x03006204 + ldr r0, =0x0203abbc + str r0, [r1] + ldr r1, =0x030061f8 + ldr r0, =0x030061f0 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, =0x030061f4 + ldr r0, =0x03006200 + ldr r0, [r0] + str r0, [r1] + ldr r1, =0x03006208 + movs r0, 0 + strh r0, [r1] + ldr r1, =0x030061fc + movs r0, 0 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_8152990 + + thumb_func_start sub_81529D4 +sub_81529D4: @ 81529D4 + push {r4,r5,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, =0x03006208 + ldrh r2, [r4] + subs r0, 0x1 + cmp r2, r0 + bge _08152A28 + movs r5, 0x1 + adds r0, r2, 0 + bl sub_81527A0 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + ldr r0, =0x030061fc + ldr r0, [r0] + cmp r0, 0 + beq _08152A2A + movs r5, 0xFF + ldr r1, =0x030061f0 + ldr r0, =0x030061f8 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, =0x03006200 + ldr r0, =0x030061f4 + ldr r0, [r0] + str r0, [r1] + b _08152A2A + .pool +_08152A28: + movs r5, 0xFF +_08152A2A: + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_81529D4 + + thumb_func_start sub_8152A34 +sub_8152A34: @ 8152A34 + push {r4,lr} + lsls r0, 16 + movs r4, 0x1 + ldr r2, =0xffff0000 + adds r0, r2 + lsrs r0, 16 + bl calls_flash_erase_block_2 + ldr r0, =0x030061fc + ldr r0, [r0] + cmp r0, 0 + beq _08152A5E + movs r4, 0xFF + ldr r1, =0x030061f0 + ldr r0, =0x030061f8 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, =0x03006200 + ldr r0, =0x030061f4 + ldr r0, [r0] + str r0, [r1] +_08152A5E: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8152A34 + + thumb_func_start calls_flash_erase_block_2 +calls_flash_erase_block_2: @ 8152A80 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r4, r1, 0 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =0x030061f0 + ldrh r0, [r0] + adds r0, r6, r0 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r5, 0 + movs r1, 0xE + bl __umodsi3 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r2, =0x03006200 + ldr r1, [r2] + movs r0, 0x1 + ands r1, r0 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 1 + adds r0, r5, r0 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r0, r6, 3 + adds r0, r4 + ldr r1, [r0] + mov r10, r1 + ldrh r3, [r0, 0x4] + movs r4, 0 + mov r9, r2 + ldr r2, =0x03006204 + mov r12, r2 + mov r8, r12 + movs r2, 0 + ldr r1, =0x00000fff +_08152AD2: + mov r7, r8 + ldr r0, [r7] + adds r0, r4 + strb r2, [r0] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r1 + bls _08152AD2 + mov r0, r12 + ldr r1, [r0] + ldr r2, =0x00000ff4 + adds r0, r1, r2 + strh r6, [r0] + ldr r6, =0x00000ff8 + adds r2, r1, r6 + ldr r0, =0x08012025 + str r0, [r2] + ldr r7, =0x00000ffc + adds r1, r7 + mov r2, r9 + ldr r0, [r2] + str r0, [r1] + movs r4, 0 + lsls r6, r5, 24 + mov r8, r6 + cmp r4, r3 + bcs _08152B22 + mov r2, r12 +_08152B0C: + ldr r1, [r2] + adds r1, r4 + mov r7, r10 + adds r0, r7, r4 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r3 + bcc _08152B0C +_08152B22: + mov r0, r10 + adds r1, r3, 0 + bl sub_8153164 + ldr r1, =0x03006204 + ldr r1, [r1] + ldr r2, =0x00000ff6 + adds r1, r2 + strh r0, [r1] + ldr r0, =0x03007860 + ldr r1, [r0] + adds r0, r5, 0 + bl _call_via_r1 + movs r6, 0x1 + movs r4, 0 + ldr r7, =0x00000ff7 + mov r9, r7 + ldr r7, =0x03007854 + b _08152B82 + .pool +_08152B7C: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_08152B82: + cmp r4, r9 + bhi _08152BA0 + ldr r0, =0x03006204 + ldr r0, [r0] + adds r0, r4 + ldrb r2, [r0] + ldr r3, [r7] + adds r0, r5, 0 + adds r1, r4, 0 + bl _call_via_r3 + lsls r0, 16 + cmp r0, 0 + beq _08152B7C + movs r6, 0xFF +_08152BA0: + cmp r6, 0xFF + bne _08152BB0 + mov r0, r8 + lsrs r1, r0, 24 + b _08152C08 + .pool +_08152BB0: + movs r6, 0x1 + movs r4, 0 + ldr r1, =0x03007854 + mov r9, r1 + ldr r7, =0x00000ff9 + b _08152BCA + .pool +_08152BC4: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_08152BCA: + cmp r4, 0x6 + bhi _08152BEC + adds r1, r4, r7 + ldr r0, =0x03006204 + ldr r0, [r0] + adds r0, r4, r0 + adds r0, r7 + ldrb r2, [r0] + mov r0, r9 + ldr r3, [r0] + adds r0, r5, 0 + bl _call_via_r3 + lsls r0, 16 + cmp r0, 0 + beq _08152BC4 + movs r6, 0xFF +_08152BEC: + cmp r6, 0xFF + beq _08152C04 + mov r2, r8 + lsrs r1, r2, 24 + movs r0, 0x1 + bl sub_815269C + movs r0, 0x1 + b _08152C10 + .pool +_08152C04: + mov r6, r8 + lsrs r1, r6, 24 +_08152C08: + movs r0, 0 + bl sub_815269C + movs r0, 0xFF +_08152C10: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end calls_flash_erase_block_2 + + thumb_func_start sav12_xor_get +sav12_xor_get: @ 8152C20 + push {r4-r6,lr} + lsls r0, 16 + ldr r6, =0x030061f0 + lsrs r0, 16 + ldrh r1, [r6] + adds r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + movs r1, 0xE + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r5, =0x03006200 + ldr r1, [r5] + movs r0, 0x1 + ands r1, r0 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 1 + adds r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x03007854 + ldr r1, =0x00000ff8 + ldr r3, [r0] + adds r0, r4, 0 + movs r2, 0x25 + bl _call_via_r3 + lsls r0, 16 + cmp r0, 0 + bne _08152C84 + lsls r1, r4, 24 + lsrs r1, 24 + movs r0, 0x1 + bl sub_815269C + movs r0, 0x1 + b _08152C9C + .pool +_08152C84: + lsls r1, r4, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_815269C + ldr r0, =0x030061f8 + ldrh r0, [r0] + strh r0, [r6] + ldr r0, =0x030061f4 + ldr r0, [r0] + str r0, [r5] + movs r0, 0xFF +_08152C9C: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sav12_xor_get + + thumb_func_start sub_8152CAC +sub_8152CAC: @ 8152CAC + push {r4-r6,lr} + lsls r0, 16 + ldr r6, =0x030061f0 + lsrs r0, 16 + ldrh r1, [r6] + adds r0, r1 + subs r0, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + movs r1, 0xE + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r5, =0x03006200 + ldr r1, [r5] + movs r0, 0x1 + ands r1, r0 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 1 + adds r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r3, =0x03007854 + ldr r1, =0x00000ff8 + ldr r0, =0x03006204 + ldr r0, [r0] + adds r0, r1 + ldrb r2, [r0] + ldr r3, [r3] + adds r0, r4, 0 + bl _call_via_r3 + lsls r0, 16 + cmp r0, 0 + bne _08152D1C + lsls r1, r4, 24 + lsrs r1, 24 + movs r0, 0x1 + bl sub_815269C + movs r0, 0x1 + b _08152D34 + .pool +_08152D1C: + lsls r1, r4, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_815269C + ldr r0, =0x030061f8 + ldrh r0, [r0] + strh r0, [r6] + ldr r0, =0x030061f4 + ldr r0, [r0] + str r0, [r5] + movs r0, 0xFF +_08152D34: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8152CAC + + thumb_func_start sub_8152D44 +sub_8152D44: @ 8152D44 + push {r4-r6,lr} + lsls r0, 16 + ldr r6, =0x030061f0 + lsrs r0, 16 + ldrh r1, [r6] + adds r0, r1 + subs r0, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + movs r1, 0xE + bl __umodsi3 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r5, =0x03006200 + ldr r1, [r5] + movs r0, 0x1 + ands r1, r0 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 1 + adds r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x03007854 + ldr r1, =0x00000ff8 + ldr r3, [r0] + adds r0, r4, 0 + movs r2, 0x25 + bl _call_via_r3 + lsls r0, 16 + cmp r0, 0 + bne _08152DA8 + lsls r1, r4, 24 + lsrs r1, 24 + movs r0, 0x1 + bl sub_815269C + movs r0, 0x1 + b _08152DC0 + .pool +_08152DA8: + lsls r1, r4, 24 + lsrs r1, 24 + movs r0, 0 + bl sub_815269C + ldr r0, =0x030061f8 + ldrh r0, [r0] + strh r0, [r6] + ldr r0, =0x030061f4 + ldr r0, [r0] + str r0, [r5] + movs r0, 0xFF +_08152DC0: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8152D44 + + thumb_func_start sub_8152DD0 +sub_8152DD0: @ 8152DD0 + push {r4-r6,lr} + adds r6, r1, 0 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r1, =0x03006204 + ldr r0, =0x0203abbc + str r0, [r1] + ldr r0, =0x0000ffff + cmp r4, r0 + beq _08152DF4 + movs r5, 0xFF + b _08152E06 + .pool +_08152DF4: + adds r0, r6, 0 + bl sub_8152EC8 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_8152E10 +_08152E06: + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8152DD0 + + thumb_func_start sub_8152E10 +sub_8152E10: @ 8152E10 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r1 + ldr r0, =0x03006200 + ldr r1, [r0] + movs r0, 0x1 + ands r1, r0 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 17 + lsrs r7, r0, 16 + movs r5, 0 + ldr r6, =0x03006204 +_08152E2C: + adds r0, r5, r7 + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r6] + bl sub_815314C + ldr r0, [r6] + ldr r1, =0x00000ff4 + adds r0, r1 + ldrh r1, [r0] + cmp r1, 0 + bne _08152E48 + ldr r0, =0x030061f0 + strh r5, [r0] +_08152E48: + ldr r0, [r6] + lsls r1, 3 + mov r2, r8 + adds r4, r1, r2 + ldrh r1, [r4, 0x4] + bl sub_8153164 + lsls r0, 16 + lsrs r3, r0, 16 + ldr r2, [r6] + ldr r1, =0x00000ff8 + adds r0, r2, r1 + ldr r1, [r0] + ldr r0, =0x08012025 + adds r5, 0x1 + cmp r1, r0 + bne _08152E98 + ldr r1, =0x00000ff6 + adds r0, r2, r1 + ldrh r0, [r0] + cmp r0, r3 + bne _08152E98 + movs r2, 0 + ldrh r0, [r4, 0x4] + cmp r2, r0 + bcs _08152E98 + adds r3, r4, 0 + ldr r4, =0x03006204 +_08152E80: + ldr r1, [r3] + adds r1, r2 + ldr r0, [r4] + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r1, [r3, 0x4] + cmp r2, r1 + bcc _08152E80 +_08152E98: + lsls r0, r5, 16 + lsrs r5, r0, 16 + cmp r5, 0xD + bls _08152E2C + movs r0, 0x1 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8152E10 + + thumb_func_start sub_8152EC8 +sub_8152EC8: @ 8152EC8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r10, r0 + movs r0, 0 + mov r8, r0 + mov r9, r0 + movs r6, 0 + movs r5, 0 + movs r4, 0 + ldr r7, =0x03006204 +_08152EE4: + lsls r0, r4, 24 + lsrs r0, 24 + ldr r1, [r7] + bl sub_815314C + ldr r2, [r7] + ldr r1, =0x00000ff8 + adds r0, r2, r1 + ldr r1, [r0] + ldr r0, =0x08012025 + cmp r1, r0 + bne _08152F34 + movs r5, 0x1 + ldr r3, =0x00000ff4 + adds r0, r2, r3 + ldrh r0, [r0] + lsls r0, 3 + add r0, r10 + ldrh r1, [r0, 0x4] + adds r0, r2, 0 + bl sub_8153164 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, [r7] + ldr r3, =0x00000ff6 + adds r0, r1, r3 + ldrh r0, [r0] + cmp r0, r2 + bne _08152F34 + ldr r2, =0x00000ffc + adds r0, r1, r2 + ldr r0, [r0] + mov r8, r0 + subs r3, 0x2 + adds r1, r3 + adds r0, r5, 0 + ldrh r1, [r1] + lsls r0, r1 + orrs r6, r0 +_08152F34: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0xD + bls _08152EE4 + cmp r5, 0 + beq _08152F70 + ldr r0, =0x00003fff + movs r1, 0xFF + str r1, [sp] + cmp r6, r0 + bne _08152F74 + movs r2, 0x1 + str r2, [sp] + b _08152F74 + .pool +_08152F70: + movs r3, 0 + str r3, [sp] +_08152F74: + movs r6, 0 + movs r5, 0 + movs r4, 0 + ldr r7, =0x03006204 +_08152F7C: + adds r0, r4, 0 + adds r0, 0xE + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r7] + bl sub_815314C + ldr r2, [r7] + ldr r1, =0x00000ff8 + adds r0, r2, r1 + ldr r1, [r0] + ldr r0, =0x08012025 + cmp r1, r0 + bne _08152FD0 + movs r5, 0x1 + ldr r3, =0x00000ff4 + adds r0, r2, r3 + ldrh r0, [r0] + lsls r0, 3 + add r0, r10 + ldrh r1, [r0, 0x4] + adds r0, r2, 0 + bl sub_8153164 + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, [r7] + ldr r3, =0x00000ff6 + adds r0, r1, r3 + ldrh r0, [r0] + cmp r0, r2 + bne _08152FD0 + ldr r2, =0x00000ffc + adds r0, r1, r2 + ldr r0, [r0] + mov r9, r0 + subs r3, 0x2 + adds r1, r3 + adds r0, r5, 0 + ldrh r1, [r1] + lsls r0, r1 + orrs r6, r0 +_08152FD0: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0xD + bls _08152F7C + cmp r5, 0 + beq _08153008 + ldr r0, =0x00003fff + movs r1, 0xFF + cmp r6, r0 + bne _0815300A + movs r1, 0x1 + b _0815300A + .pool +_08153008: + movs r1, 0 +_0815300A: + ldr r0, [sp] + cmp r0, 0x1 + bne _0815307C + cmp r1, 0x1 + bne _0815306C + movs r0, 0x1 + negs r0, r0 + cmp r8, r0 + bne _08153022 + mov r1, r9 + cmp r1, 0 + beq _0815302C +_08153022: + mov r2, r8 + cmp r2, 0 + bne _08153050 + cmp r9, r0 + bne _08153050 +_0815302C: + mov r1, r8 + adds r1, 0x1 + mov r0, r9 + adds r0, 0x1 + cmp r1, r0 + bcs _08153044 + ldr r0, =0x03006200 + mov r3, r9 + b _08153064 + .pool +_08153044: + ldr r0, =0x03006200 + mov r1, r8 + str r1, [r0] + b _08153094 + .pool +_08153050: + cmp r8, r9 + bcs _08153060 + ldr r0, =0x03006200 + mov r2, r9 + str r2, [r0] + b _08153094 + .pool +_08153060: + ldr r0, =0x03006200 + mov r3, r8 +_08153064: + str r3, [r0] + b _08153094 + .pool +_0815306C: + ldr r0, =0x03006200 + mov r2, r8 + str r2, [r0] + cmp r1, 0xFF + beq _0815308C + b _08153094 + .pool +_0815307C: + cmp r1, 0x1 + bne _08153098 + ldr r0, =0x03006200 + mov r3, r9 + str r3, [r0] + ldr r0, [sp] + cmp r0, 0xFF + bne _08153094 +_0815308C: + movs r0, 0xFF + b _081530C4 + .pool +_08153094: + movs r0, 0x1 + b _081530C4 +_08153098: + ldr r2, [sp] + cmp r2, 0 + bne _081530B8 + cmp r1, 0 + bne _081530B8 + ldr r0, =0x03006200 + str r1, [r0] + ldr r0, =0x030061f0 + strh r1, [r0] + movs r0, 0 + b _081530C4 + .pool +_081530B8: + ldr r0, =0x03006200 + movs r1, 0 + str r1, [r0] + ldr r0, =0x030061f0 + strh r1, [r0] + movs r0, 0x2 +_081530C4: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8152EC8 + + thumb_func_start sub_81530DC +sub_81530DC: @ 81530DC + push {r4-r6,lr} + adds r6, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + lsrs r4, r2, 16 + ldr r5, =0x0203abbc + adds r1, r5, 0 + bl sub_815314C + ldr r1, =0x00000ff8 + adds r0, r5, r1 + ldr r1, [r0] + ldr r0, =0x08012025 + cmp r1, r0 + bne _08153144 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8153164 + lsls r0, 16 + lsrs r0, 16 + ldr r2, =0x00000ff4 + adds r1, r5, r2 + ldrh r1, [r1] + cmp r1, r0 + bne _08153140 + movs r2, 0 + cmp r2, r4 + bcs _0815312A +_08153118: + adds r1, r6, r2 + adds r0, r5, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, r4 + bcc _08153118 +_0815312A: + movs r0, 0x1 + b _08153146 + .pool +_08153140: + movs r0, 0x2 + b _08153146 +_08153144: + movs r0, 0 +_08153146: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81530DC + + thumb_func_start sub_815314C +sub_815314C: @ 815314C + push {lr} + adds r2, r1, 0 + lsls r0, 24 + lsrs r0, 24 + movs r3, 0x80 + lsls r3, 5 + movs r1, 0 + bl ReadFlash + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_815314C + + thumb_func_start sub_8153164 +sub_8153164: @ 8153164 + push {r4,lr} + adds r4, r0, 0 + lsls r1, 16 + movs r2, 0 + movs r3, 0 + lsrs r1, 18 + cmp r2, r1 + bcs _08153182 +_08153174: + ldm r4!, {r0} + adds r2, r0 + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, r1 + bcc _08153174 +_08153182: + lsrs r0, r2, 16 + adds r0, r2 + lsls r0, 16 + lsrs r0, 16 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8153164 + + thumb_func_start sub_8153190 +sub_8153190: @ 8153190 + push {r4,r5,lr} + ldr r3, =0x03006220 + ldr r0, =0x03005d90 + ldr r2, =gUnknown_085CDC00 + ldrh r1, [r2] + ldr r0, [r0] + adds r0, r1 + str r0, [r3] + ldrh r0, [r2, 0x2] + strh r0, [r3, 0x4] + ldr r5, =0x03005d8c + adds r3, 0x8 + adds r2, 0x4 + movs r4, 0x3 +_081531AC: + ldrh r0, [r2] + ldr r1, [r5] + adds r1, r0 + str r1, [r3] + ldrh r0, [r2, 0x2] + strh r0, [r3, 0x4] + adds r3, 0x8 + adds r2, 0x4 + subs r4, 0x1 + cmp r4, 0 + bge _081531AC + movs r4, 0x5 + ldr r1, =0x03006220 + ldr r5, =0x03005d94 + ldr r0, =gUnknown_085CDC00 + adds r3, r1, 0 + adds r3, 0x28 + adds r2, r0, 0 + adds r2, 0x14 +_081531D2: + ldrh r0, [r2] + ldr r1, [r5] + adds r1, r0 + str r1, [r3] + ldrh r0, [r2, 0x2] + strh r0, [r3, 0x4] + adds r3, 0x8 + adds r2, 0x4 + adds r4, 0x1 + cmp r4, 0xD + ble _081531D2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8153190 + + thumb_func_start calls_flash_erase_block_3 +calls_flash_erase_block_3: @ 8153204 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x0203cf5c + ldr r6, [r1] + movs r0, 0 + str r0, [r1] + bl sub_8153190 + cmp r4, 0x5 + bhi _081532AC + lsls r0, r4, 2 + ldr r1, =_0815322C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815322C: + .4byte _081532AC + .4byte _081532C4 + .4byte _081532C4 + .4byte _0815325A + .4byte _081532F8 + .4byte _08153244 +_08153244: + movs r4, 0x1C + ldr r5, =0x03007860 +_08153248: + ldr r1, [r5] + adds r0, r4, 0 + bl _call_via_r1 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1F + bls _08153248 +_0815325A: + movs r0, 0xA + bl sub_80847F8 + ldr r1, =0x000003e6 + cmp r0, r1 + bhi _0815326C + movs r0, 0xA + bl sav12_xor_increment +_0815326C: + bl save_serialize_game + ldr r0, =0x0000ffff + ldr r1, =0x03006220 + bl save_write_to_flash + ldr r4, =0x0201c000 + movs r5, 0xF8 + lsls r5, 4 + movs r0, 0x1C + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_8152890 + adds r4, r5 + movs r0, 0x1D + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_8152890 + b _0815331A + .pool +_081532AC: + bl save_serialize_game + ldr r0, =0x0000ffff + ldr r1, =0x03006220 + bl save_write_to_flash + b _0815331A + .pool +_081532C4: + bl save_serialize_game + movs r4, 0 +_081532CA: + adds r0, r4, 0 + ldr r1, =0x03006220 + bl calls_flash_erase_block_2 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _081532CA + movs r4, 0 +_081532DE: + adds r0, r4, 0 + ldr r1, =0x03006220 + bl sav12_xor_get + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _081532DE + b _0815331A + .pool +_081532F8: + movs r4, 0x1C + ldr r5, =0x03007860 +_081532FC: + ldr r1, [r5] + adds r0, r4, 0 + bl _call_via_r1 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1F + bls _081532FC + bl save_serialize_game + ldr r0, =0x0000ffff + ldr r1, =0x03006220 + bl save_write_to_flash +_0815331A: + ldr r0, =0x0203cf5c + str r6, [r0] + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end calls_flash_erase_block_3 + + thumb_func_start save_game_when_memory_present +save_game_when_memory_present: @ 8153338 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x03005d88 + ldr r4, [r0] + cmp r4, 0x1 + bne _0815335A + adds r0, r5, 0 + bl calls_flash_erase_block_3 + ldr r0, =0x030061fc + ldr r0, [r0] + cmp r0, 0 + beq _08153370 + adds r0, r5, 0 + bl fullscreen_save_activate +_0815335A: + ldr r1, =0x03006294 + movs r0, 0xFF + strh r0, [r1] + movs r0, 0xFF + b _08153376 + .pool +_08153370: + ldr r0, =0x03006294 + strh r4, [r0] + movs r0, 0x1 +_08153376: + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end save_game_when_memory_present + + thumb_func_start sub_8153380 +sub_8153380: @ 8153380 + push {lr} + ldr r0, =0x03005d88 + ldr r0, [r0] + cmp r0, 0x1 + bne _081533A4 + bl sub_8153190 + bl save_serialize_game + ldr r0, =0x03006220 + bl sub_8152934 + movs r0, 0 + b _081533A6 + .pool +_081533A4: + movs r0, 0x1 +_081533A6: + pop {r1} + bx r1 + thumb_func_end sub_8153380 + + thumb_func_start sub_81533AC +sub_81533AC: @ 81533AC + push {r4,lr} + ldr r1, =0x03006220 + movs r0, 0xE + bl sub_81529D4 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x030061fc + ldr r0, [r0] + cmp r0, 0 + beq _081533C8 + movs r0, 0 + bl fullscreen_save_activate +_081533C8: + cmp r4, 0xFF + beq _081533D8 + movs r0, 0 + b _081533DA + .pool +_081533D8: + movs r0, 0x1 +_081533DA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_81533AC + + thumb_func_start sub_81533E0 +sub_81533E0: @ 81533E0 + push {lr} + ldr r1, =0x03006220 + movs r0, 0xE + bl sub_8152A34 + ldr r0, =0x030061fc + ldr r0, [r0] + cmp r0, 0 + beq _081533F8 + movs r0, 0 + bl fullscreen_save_activate +_081533F8: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_81533E0 + + thumb_func_start sub_8153408 +sub_8153408: @ 8153408 + push {lr} + ldr r1, =0x03006220 + movs r0, 0xE + bl sub_8152CAC + ldr r0, =0x030061fc + ldr r0, [r0] + cmp r0, 0 + beq _08153420 + movs r0, 0 + bl fullscreen_save_activate +_08153420: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8153408 + + thumb_func_start sub_8153430 +sub_8153430: @ 8153430 + push {r4,lr} + ldr r0, =0x03005d88 + ldr r0, [r0] + cmp r0, 0x1 + bne _0815346C + bl sub_8153190 + bl save_serialize_game + ldr r4, =0x03006220 + adds r0, r4, 0 + bl sub_8152990 + ldr r0, =0x03006208 + ldrh r0, [r0] + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl sub_8152A34 + movs r0, 0 + b _0815346E + .pool +_0815346C: + movs r0, 0x1 +_0815346E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8153430 + + thumb_func_start sub_8153474 +sub_8153474: @ 8153474 + push {r4-r6,lr} + movs r6, 0 + ldr r0, =0x03006208 + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + lsls r0, r1, 16 + lsrs r5, r0, 16 + cmp r5, 0x4 + bhi _081534A8 + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r0, 16 + ldr r4, =0x03006220 + adds r1, r4, 0 + bl sub_8152A34 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8152D44 + b _081534B2 + .pool +_081534A8: + ldr r1, =0x03006220 + adds r0, r5, 0 + bl sub_8152D44 + movs r6, 0x1 +_081534B2: + ldr r0, =0x030061fc + ldr r0, [r0] + cmp r0, 0 + beq _081534C0 + movs r0, 0x1 + bl fullscreen_save_activate +_081534C0: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8153474 + + thumb_func_start sub_81534D0 +sub_81534D0: @ 81534D0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x03005d88 + ldr r0, [r0] + cmp r0, 0x1 + beq _081534F0 + ldr r1, =0x03006210 + movs r0, 0x4 + strh r0, [r1] + movs r0, 0xFF + b _08153550 + .pool +_081534F0: + bl sub_8153190 + cmp r4, 0 + beq _081534FC + cmp r4, 0x3 + beq _08153528 +_081534FC: + ldr r0, =0x0000ffff + ldr r1, =0x03006220 + bl sub_8152DD0 + lsls r0, 24 + lsrs r4, r0, 24 + bl save_deserialize_game + ldr r0, =0x03006210 + strh r4, [r0] + ldr r1, =0x03006214 + movs r0, 0 + str r0, [r1] + b _0815354E + .pool +_08153528: + ldr r5, =0x0201c000 + movs r6, 0xF8 + lsls r6, 4 + movs r0, 0x1C + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_81530DC + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bne _0815354E + adds r1, r5, r6 + movs r0, 0x1D + adds r2, r6, 0 + bl sub_81530DC + lsls r0, 24 + lsrs r4, r0, 24 +_0815354E: + adds r0, r4, 0 +_08153550: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81534D0 + + thumb_func_start sub_815355C +sub_815355C: @ 815355C + push {r4-r7,lr} + ldr r5, =0x03006204 + ldr r0, =0x0203abbc + str r0, [r5] + adds r7, r0, 0 + ldr r0, =0x03005d88 + ldr r4, [r0] + cmp r4, 0x1 + beq _0815358C + b _081535C8 + .pool +_0815357C: + ldrb r1, [r7, 0xA] + ldrb r0, [r7, 0xB] + adds r1, r0 + ldrb r0, [r7, 0xC] + adds r1, r0 + ldrb r0, [r7, 0xD] + adds r0, r1 + b _081535CA +_0815358C: + bl sub_8153190 + ldr r0, =0x03006220 + bl sub_8152EC8 + ldr r0, =0x03006200 + ldr r1, [r0] + ands r1, r4 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 17 + lsrs r6, r0, 16 + movs r4, 0 +_081535A6: + adds r0, r4, r6 + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r5] + bl sub_815314C + ldr r0, [r5] + ldr r1, =0x00000ff4 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _0815357C + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0xD + bls _081535A6 +_081535C8: + movs r0, 0 +_081535CA: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_815355C + + thumb_func_start sub_81535DC +sub_81535DC: @ 81535DC + push {r4-r6,lr} + adds r6, r1, 0 + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xE2 + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08153608 + ldr r4, =0x0203abbc + movs r3, 0x80 + lsls r3, 5 + adds r0, r1, 0 + movs r1, 0 + adds r2, r4, 0 + bl ReadFlash + ldr r1, [r4] + ldr r0, =0x0000b39d + cmp r1, r0 + beq _08153614 +_08153608: + movs r0, 0xFF + b _0815362A + .pool +_08153614: + movs r3, 0 + ldr r5, =0x00000ffb + adds r2, r4, 0x4 +_0815361A: + adds r0, r6, r3 + adds r1, r2, r3 + ldrb r1, [r1] + strb r1, [r0] + adds r3, 0x1 + cmp r3, r5 + ble _0815361A + movs r0, 0x1 +_0815362A: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_81535DC + + thumb_func_start sub_8153634 +sub_8153634: @ 8153634 + push {r4-r7,lr} + adds r5, r1, 0 + lsls r0, 24 + lsrs r6, r0, 24 + movs r1, 0xE2 + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08153680 + ldr r7, =0x0203abbc + ldr r0, =0x0000b39d + adds r3, r7, 0 + stm r3!, {r0} + movs r2, 0 + ldr r4, =0x00000ffb +_08153654: + adds r0, r3, r2 + adds r1, r5, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, r4 + ble _08153654 + adds r0, r6, 0 + adds r1, r7, 0 + bl ProgramFlashSectorsAndVerify + cmp r0, 0 + bne _08153680 + movs r0, 0x1 + b _08153682 + .pool +_08153680: + movs r0, 0xFF +_08153682: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8153634 + + thumb_func_start sub_8153688 +sub_8153688: @ 8153688 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0xB + bls _081536A2 + b _081537C2 +_081536A2: + lsls r0, 2 + ldr r1, =_081536B4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_081536B4: + .4byte _081536E4 + .4byte _081536F4 + .4byte _081536FE + .4byte _0815371A + .4byte _0815372C + .4byte _08153742 + .4byte _08153758 + .4byte _08153762 + .4byte _08153778 + .4byte _0815378C + .4byte _08153796 + .4byte _081537A8 +_081536E4: + ldr r0, =0x03002700 + movs r1, 0x1 + strb r1, [r0] + movs r0, 0x1 + strh r0, [r4] + b _081537C2 + .pool +_081536F4: + bl sub_800ADF8 + movs r0, 0x2 + strh r0, [r4] + b _081537C2 +_081536FE: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _081537C2 + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08153714 + bl save_serialize_map +_08153714: + movs r0, 0x3 + strh r0, [r4] + b _081537C2 +_0815371A: + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08153726 + bl sub_8076D5C +_08153726: + bl sub_8153380 + b _08153752 +_0815372C: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0x5 + bne _081537C2 + movs r0, 0 + strh r0, [r4, 0x2] + strh r1, [r4] + b _081537C2 +_08153742: + bl sub_81533AC + lsls r0, 24 + cmp r0, 0 + beq _08153752 + movs r0, 0x6 + strh r0, [r4] + b _081537C2 +_08153752: + movs r0, 0x4 + strh r0, [r4] + b _081537C2 +_08153758: + bl sub_81533E0 + movs r0, 0x7 + strh r0, [r4] + b _081537C2 +_08153762: + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0815376E + bl sav2_gender2_inplace_and_xFE +_0815376E: + bl sub_800ADF8 + movs r0, 0x8 + strh r0, [r4] + b _081537C2 +_08153778: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _081537C2 + bl sub_8153408 + movs r0, 0x9 + strh r0, [r4] + b _081537C2 +_0815378C: + bl sub_800ADF8 + movs r0, 0xA + strh r0, [r4] + b _081537C2 +_08153796: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _081537C2 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _081537C2 +_081537A8: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _081537C2 + ldr r1, =0x03002700 + movs r0, 0 + strb r0, [r1] + adds r0, r2, 0 + bl DestroyTask +_081537C2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8153688 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/save_failed_screen.s b/asm/save_failed_screen.s new file mode 100644 index 000000000..e8042a442 --- /dev/null +++ b/asm/save_failed_screen.s @@ -0,0 +1,707 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8178F44 +sub_8178F44: @ 8178F44 + push {r4,r5,lr} + sub sp, 0x18 + adds r5, r0, 0 + adds r4, r1, 0 + adds r3, r2, 0 + lsls r3, 24 + add r0, sp, 0x14 + movs r2, 0 + strb r2, [r0] + adds r1, r0, 0 + movs r0, 0xF + strb r0, [r1, 0x1] + movs r0, 0x3 + strb r0, [r1, 0x2] + ldr r0, =0x0203bd0e + ldrb r0, [r0] + lsls r4, 27 + lsrs r4, 24 + lsrs r3, 21 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + str r2, [sp] + str r2, [sp, 0x4] + str r1, [sp, 0x8] + str r2, [sp, 0xC] + str r5, [sp, 0x10] + movs r1, 0x1 + adds r2, r4, 0 + bl AddTextPrinterParametrized2 + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8178F44 + + thumb_func_start fullscreen_save_activate +fullscreen_save_activate: @ 8178F90 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =sub_8178FDC + bl SetMainCallback2 + ldr r0, =0x0203bcfc + strh r4, [r0] + ldr r1, =0x0203bcfe + movs r2, 0 + movs r0, 0 + strh r0, [r1] + strh r0, [r1, 0x2] + ldr r0, =0x0203bd0e + strb r2, [r0] + strb r2, [r0, 0x1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end fullscreen_save_activate + + thumb_func_start sub_8178FC8 +sub_8178FC8: @ 8178FC8 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8178FC8 + + thumb_func_start sub_8178FDC +sub_8178FDC: @ 8178FDC + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r7, r0, r1 + ldrb r0, [r7] + cmp r0, 0 + beq _08178FF8 + cmp r0, 0x1 + bne _08178FF8 + b _0817925C +_08178FF8: + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0xE + movs r1, 0 + bl SetGpuReg + movs r0, 0xC + movs r1, 0 + bl SetGpuReg + movs r0, 0xA + movs r1, 0 + bl SetGpuReg + movs r0, 0x8 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1C + movs r1, 0 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0 + bl SetGpuReg + movs r0, 0x18 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + movs r0, 0x16 + movs r1, 0 + bl SetGpuReg + movs r0, 0x10 + movs r1, 0 + bl SetGpuReg + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + add r1, sp, 0x4 + movs r0, 0 + strh r0, [r1] + ldr r2, =0x040000d4 + str r1, [r2] + movs r1, 0xC0 + lsls r1, 19 + str r1, [r2, 0x4] + ldr r0, =0x8100c000 + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + movs r3, 0 + mov r8, r3 + str r3, [sp, 0x8] + add r4, sp, 0x8 + str r4, [r2] + movs r0, 0xE0 + lsls r0, 19 + str r0, [r2, 0x4] + ldr r0, =0x85000100 + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + add r0, sp, 0x4 + mov r3, r8 + strh r3, [r0] + str r0, [r2] + movs r0, 0xA0 + lsls r0, 19 + str r0, [r2, 0x4] + ldr r0, =0x81000200 + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + ldr r0, =gUnknown_085B0E04 + bl LZ77UnCompVram + ldr r0, =gUnknown_085B0A80 + ldr r1, =0x06007000 + bl LZ77UnCompVram + ldr r0, =gUnknown_085B0C0C + ldr r1, =0x06007800 + bl LZ77UnCompVram + ldr r0, =gUnknown_085EFDE4 + ldr r1, =0x06010020 + bl LZ77UnCompVram + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085EFD88 + movs r0, 0 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r5, =0x0201e000 + movs r0, 0 + adds r1, r5, 0 + bl SetBgTilemapBuffer + mov r0, r8 + str r0, [sp, 0x8] + ldr r2, =0x05000200 + adds r0, r4, 0 + adds r1, r5, 0 + bl CpuSet + ldr r1, =gUnknown_0850E87C + movs r2, 0x90 + lsls r2, 1 + movs r6, 0x85 + lsls r6, 2 + movs r0, 0 + adds r3, r6, 0 + bl LoadBgTiles + ldr r0, =gUnknown_085EFD94 + bl InitWindows + ldr r0, =gUnknown_085EFD9C + bl AddWindowWithoutTileMap + ldr r4, =0x0203bd0e + strb r0, [r4] + ldrb r0, [r4] + movs r1, 0x80 + lsls r1, 4 + adds r2, r5, r1 + movs r1, 0x7 + bl SetWindowAttribute + ldr r0, =gUnknown_085EFDA4 + bl AddWindowWithoutTileMap + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x1] + movs r3, 0xE8 + lsls r3, 5 + adds r5, r3 + movs r1, 0x7 + adds r2, r5, 0 + bl SetWindowAttribute + bl DeactivateAllTextPrinters + bl ResetAllObjectData + bl ResetTasks + bl sub_80A1A74 + ldr r0, =gUnknown_085B0A00 + movs r1, 0 + movs r2, 0x40 + bl gpu_pal_apply + ldr r0, =gUnknown_085EFDC4 + movs r1, 0x80 + lsls r1, 1 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_0850FEFC + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_0860F074 + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldrb r0, [r4] + movs r1, 0 + adds r2, r6, 0 + movs r3, 0xE + bl SetWindowBorderStyle + ldrb r0, [r4, 0x1] + movs r1, 0 + adds r2, r6, 0 + movs r3, 0xE + bl SetWindowBorderStyle + ldrb r0, [r4, 0x1] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldrb r0, [r4, 0x1] + movs r1, 0x2 + bl CopyWindowToVram + ldrb r0, [r4] + movs r1, 0x1 + bl CopyWindowToVram + ldr r0, =gUnknown_085EC816 + movs r1, 0x1 + movs r2, 0 + bl sub_8178F44 + movs r0, 0x1 + negs r0, r0 + mov r1, r8 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r0, 0x1 + bl EnableInterrupts + ldr r0, =sub_8178FC8 + bl SetVBlankCallback + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + ldrb r0, [r7] + adds r0, 0x1 + strb r0, [r7] + b _08179272 + .pool +_0817925C: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _08179272 + ldr r0, =sub_8179288 + bl SetMainCallback2 + ldr r0, =sub_8179454 + bl SetVBlankCallback +_08179272: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8178FDC + + thumb_func_start sub_8179288 +sub_8179288: @ 8179288 + push {r4-r6,lr} + movs r5, 0 + ldr r0, =0x0203bcfe + movs r1, 0x1 + strh r1, [r0] + ldr r1, =0x030061fc + ldr r0, [r1] + cmp r0, 0 + beq _081792EC + adds r6, r1, 0 +_0817929C: + ldr r0, [r6] + bl sub_81795AC + lsls r0, 24 + cmp r0, 0 + bne _08179348 + ldr r4, =0x0203bd0e + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_085EC917 + movs r1, 0x1 + movs r2, 0 + bl sub_8178F44 + ldr r0, =0x0203bcfc + ldrb r0, [r0] + bl calls_flash_erase_block_3 + ldr r0, [r6] + cmp r0, 0 + beq _081792DC + ldrb r0, [r4] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_085EC816 + movs r1, 0x1 + movs r2, 0 + bl sub_8178F44 +_081792DC: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r6] + cmp r0, 0 + beq _081792EC + cmp r5, 0x2 + bls _0817929C +_081792EC: + cmp r5, 0x3 + bne _0817931C + ldr r0, =0x0203bd0e + ldrb r0, [r0] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_085EC86F + b _08179330 + .pool +_0817931C: + ldr r0, =0x0203bd0e + ldrb r0, [r0] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, =0x03006214 + ldr r0, [r0] + cmp r0, 0 + bne _08179370 + ldr r0, =gUnknown_085EC94F +_08179330: + movs r1, 0x1 + movs r2, 0 + bl sub_8178F44 + b _0817937A + .pool +_08179348: + ldr r0, =0x0203bd0e + ldrb r0, [r0] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_085EC86F + movs r1, 0x1 + movs r2, 0 + bl sub_8178F44 + ldr r0, =sub_8179390 + bl SetMainCallback2 + b _08179380 + .pool +_08179370: + ldr r0, =gUnknown_085EC9A2 + movs r1, 0x1 + movs r2, 0 + bl sub_8178F44 +_0817937A: + ldr r0, =sub_81793E0 + bl SetMainCallback2 +_08179380: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8179288 + + thumb_func_start sub_8179390 +sub_8179390: @ 8179390 + push {lr} + ldr r1, =0x0203bcfe + movs r0, 0 + strh r0, [r1] + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _081793C4 + ldr r0, =0x0203bd0e + ldrb r0, [r0] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_085EC8D4 + movs r1, 0x1 + movs r2, 0 + bl sub_8178F44 + ldr r0, =sub_8178FC8 + bl SetVBlankCallback + ldr r0, =sub_81793E0 + bl SetMainCallback2 +_081793C4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8179390 + + thumb_func_start sub_81793E0 +sub_81793E0: @ 81793E0 + push {lr} + sub sp, 0x4 + ldr r0, =0x0203bcfe + movs r2, 0 + strh r2, [r0] + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08179410 + movs r0, 0x1 + negs r0, r0 + str r2, [sp] + movs r1, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =sub_8178FC8 + bl SetVBlankCallback + ldr r0, =sub_8179428 + bl SetMainCallback2 +_08179410: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_81793E0 + + thumb_func_start sub_8179428 +sub_8179428: @ 8179428 + push {r4,r5,lr} + bl fade_and_return_progress_probably + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0817944E + ldr r5, =0x03006214 + ldr r0, [r5] + cmp r0, 0 + bne _08179448 + bl Reset + b _0817944E + .pool +_08179448: + bl SetMainCallback2 + str r4, [r5] +_0817944E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8179428 + + thumb_func_start sub_8179454 +sub_8179454: @ 8179454 + push {r4,r5,lr} + ldr r5, =0x030022c0 + ldr r0, [r5, 0x24] + lsrs r4, r0, 3 + movs r0, 0x7 + ands r4, r0 + ldr r0, =gUnknown_085EFD80 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r5, 0x38] + str r1, [r5, 0x3C] + ldrh r1, [r5, 0x3A] + ldr r0, =0xfffffe00 + ands r0, r1 + movs r1, 0x70 + orrs r0, r1 + strh r0, [r5, 0x3A] + adds r1, r5, 0 + adds r1, 0x38 + movs r0, 0x48 + strb r0, [r1] + ldr r0, =0x0203bcfe + ldrh r0, [r0] + cmp r0, 0 + beq _081794DC + ldr r3, =gUnknown_085EFDAC + lsls r2, r4, 1 + adds r2, r4 + adds r0, r2, r3 + ldrb r4, [r0] + ldrh r1, [r5, 0x3C] + ldr r0, =0xfffffc00 + ands r0, r1 + orrs r0, r4 + strh r0, [r5, 0x3C] + adds r0, r3, 0x2 + adds r0, r2, r0 + ldrb r1, [r0] + lsls r1, 4 + adds r3, 0x1 + adds r2, r3 + ldrb r0, [r2] + lsls r0, 3 + orrs r1, r0 + adds r3, r5, 0 + adds r3, 0x3B + movs r0, 0x1F + ands r1, r0 + lsls r1, 1 + ldrb r2, [r3] + movs r0, 0x3F + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + b _081794E8 + .pool +_081794DC: + ldrh r0, [r5, 0x3C] + ldr r1, =0xfffffc00 + ands r1, r0 + movs r0, 0x1 + orrs r1, r0 + strh r1, [r5, 0x3C] +_081794E8: + ldr r0, =0x030022f8 + movs r1, 0xE0 + lsls r1, 19 + movs r2, 0x1 + bl CpuFastSet + ldr r1, =0x0203bcfe + ldrh r0, [r1, 0x2] + cmp r0, 0 + beq _08179500 + subs r0, 0x1 + strh r0, [r1, 0x2] +_08179500: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8179454 + + thumb_func_start sub_8179514 +sub_8179514: @ 8179514 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, =0x0203abbc + movs r3, 0x80 + lsls r3, 5 + movs r1, 0 + adds r2, r4, 0 + bl ReadFlash + movs r1, 0 + ldr r2, =0x000003ff +_0817952C: + ldr r0, [r4] + cmp r0, 0 + beq _08179540 + movs r0, 0x1 + b _0817954E + .pool +_08179540: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + adds r4, 0x4 + cmp r1, r2 + bls _0817952C + movs r0, 0 +_0817954E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8179514 + + thumb_func_start sub_8179554 +sub_8179554: @ 8179554 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r6, r0, 16 + movs r0, 0 + ldr r1, =0x00000fff + mov r8, r1 + ldr r7, =0x03007854 +_08179566: + movs r4, 0 + adds r5, r0, 0x1 +_0817956A: + ldr r3, [r7] + adds r0, r6, 0 + adds r1, r4, 0 + movs r2, 0 + bl _call_via_r3 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r8 + bls _0817956A + adds r0, r6, 0 + bl sub_8179514 + lsls r0, 24 + lsrs r1, r0, 24 + lsls r0, r5, 16 + lsrs r0, 16 + cmp r1, 0 + beq _08179596 + cmp r0, 0x81 + bls _08179566 +_08179596: + adds r0, r1, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8179554 + + thumb_func_start sub_81795AC +sub_81795AC: @ 81795AC + push {r4-r6,lr} + adds r5, r0, 0 + movs r6, 0 +_081795B2: + movs r4, 0x1 + lsls r4, r6 + adds r0, r5, 0 + ands r0, r4 + cmp r0, 0 + beq _081795CC + adds r0, r6, 0 + bl sub_8179554 + lsls r0, 24 + cmp r0, 0 + bne _081795CC + bics r5, r4 +_081795CC: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x1F + bls _081795B2 + cmp r5, 0 + beq _081795DE + movs r0, 0x1 + b _081795E0 +_081795DE: + movs r0, 0 +_081795E0: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_81795AC + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/scrcmd.s b/asm/scrcmd.s new file mode 100644 index 000000000..89422de69 --- /dev/null +++ b/asm/scrcmd.s @@ -0,0 +1,5744 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start s00_nop +s00_nop: @ 80992CC + movs r0, 0 + bx lr + thumb_func_end s00_nop + + thumb_func_start s01_nop +s01_nop: @ 80992D0 + movs r0, 0 + bx lr + thumb_func_end s01_nop + + thumb_func_start s02_end +s02_end: @ 80992D4 + push {lr} + bl script_stop + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s02_end + + thumb_func_start s24_execute_ASM_2 +s24_execute_ASM_2: @ 80992E0 + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + adds r1, r0, 0 + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s24_execute_ASM_2 + + thumb_func_start s25_extended_cmd +s25_extended_cmd: @ 80992F8 + push {lr} + bl script_read_halfword + lsls r0, 16 + ldr r1, =gUnknown_081DBA64 + lsrs r0, 14 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end s25_extended_cmd + + thumb_func_start s26_extended_cmd_setvar +s26_extended_cmd_setvar: @ 8099318 + push {r4-r6,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + adds r6, r0, 0 + ldr r4, =gUnknown_081DBA64 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 14 + adds r0, r4 + ldr r0, [r0] + bl _call_via_r0 + strh r0, [r6] + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end s26_extended_cmd_setvar + + thumb_func_start s23_execute_ASM +s23_execute_ASM: @ 809934C + push {lr} + bl script_read_word + bl _call_via_r0 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s23_execute_ASM + + thumb_func_start s27_set_to_waitstate +s27_set_to_waitstate: @ 809935C + push {lr} + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end s27_set_to_waitstate + + thumb_func_start s05_goto +s05_goto: @ 8099368 + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + adds r1, r0, 0 + adds r0, r4, 0 + bl script_jump + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s05_goto + + thumb_func_start s03_return +s03_return: @ 8099380 + push {lr} + bl script_return + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s03_return + + thumb_func_start s04_call +s04_call: @ 809938C + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + adds r1, r0, 0 + adds r0, r4, 0 + bl script_call + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s04_call + + thumb_func_start s06_if_jump +@ int s06_if_jump(script_env *env) +s06_if_jump: @ 80993A4 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r4, [r0] + adds r0, 0x1 + str r0, [r5, 0x8] + adds r0, r5, 0 + bl script_read_word + adds r2, r0, 0 + ldr r1, =gUnknown_085102C0 + lsls r0, r4, 1 + adds r0, r4 + ldrb r3, [r5, 0x2] + adds r0, r3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080993D2 + adds r0, r5, 0 + adds r1, r2, 0 + bl script_jump +_080993D2: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end s06_if_jump + + thumb_func_start s07_if_call +s07_if_call: @ 80993E0 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r4, [r0] + adds r0, 0x1 + str r0, [r5, 0x8] + adds r0, r5, 0 + bl script_read_word + adds r2, r0, 0 + ldr r1, =gUnknown_085102C0 + lsls r0, r4, 1 + adds r0, r4 + ldrb r3, [r5, 0x2] + adds r0, r3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0809940E + adds r0, r5, 0 + adds r1, r2, 0 + bl script_call +_0809940E: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end s07_if_call + + thumb_func_start sB8_set_virtual_address +@ int sB8_set_virtual_address(script_env *env) +sB8_set_virtual_address: @ 809941C + push {r4,lr} + ldr r4, [r0, 0x8] + subs r4, 0x1 + bl script_read_word + ldr r1, =0x020375c4 + subs r0, r4 + str r0, [r1] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sB8_set_virtual_address + + thumb_func_start sB9_virtual_jump +@ int sB9_virtual_jump(script_env *env) +sB9_virtual_jump: @ 8099438 + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + adds r1, r0, 0 + ldr r0, =0x020375c4 + ldr r0, [r0] + subs r1, r0 + adds r0, r4, 0 + bl script_jump + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sB9_virtual_jump + + thumb_func_start sBA_virtual_call +sBA_virtual_call: @ 809945C + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + adds r1, r0, 0 + ldr r0, =0x020375c4 + ldr r0, [r0] + subs r1, r0 + adds r0, r4, 0 + bl script_call + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sBA_virtual_call + + thumb_func_start sBB_virtual_if_jump +sBB_virtual_if_jump: @ 8099480 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r4, [r0] + adds r0, 0x1 + str r0, [r5, 0x8] + adds r0, r5, 0 + bl script_read_word + ldr r1, =0x020375c4 + ldr r1, [r1] + subs r2, r0, r1 + ldr r1, =gUnknown_085102C0 + lsls r0, r4, 1 + adds r0, r4 + ldrb r3, [r5, 0x2] + adds r0, r3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080994B2 + adds r0, r5, 0 + adds r1, r2, 0 + bl script_jump +_080994B2: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sBB_virtual_if_jump + + thumb_func_start sBC_virtual_if_call +sBC_virtual_if_call: @ 80994C4 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r4, [r0] + adds r0, 0x1 + str r0, [r5, 0x8] + adds r0, r5, 0 + bl script_read_word + ldr r1, =0x020375c4 + ldr r1, [r1] + subs r2, r0, r1 + ldr r1, =gUnknown_085102C0 + lsls r0, r4, 1 + adds r0, r4 + ldrb r3, [r5, 0x2] + adds r0, r3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080994F6 + adds r0, r5, 0 + adds r1, r2, 0 + bl script_call +_080994F6: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sBC_virtual_if_call + + thumb_func_start s08_jumpstd +s08_jumpstd: @ 8099508 + push {lr} + adds r2, r0, 0 + ldr r0, [r2, 0x8] + ldrb r1, [r0] + adds r0, 0x1 + str r0, [r2, 0x8] + lsls r1, 2 + ldr r0, =gUnknown_081DC2A0 + adds r1, r0 + ldr r0, =gUnknown_081DC2CC + cmp r1, r0 + bcs _08099528 + ldr r1, [r1] + adds r0, r2, 0 + bl script_jump +_08099528: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end s08_jumpstd + + thumb_func_start s09_callstd +s09_callstd: @ 8099538 + push {lr} + adds r2, r0, 0 + ldr r0, [r2, 0x8] + ldrb r1, [r0] + adds r0, 0x1 + str r0, [r2, 0x8] + lsls r1, 2 + ldr r0, =gUnknown_081DC2A0 + adds r1, r0 + ldr r0, =gUnknown_081DC2CC + cmp r1, r0 + bcs _08099558 + ldr r1, [r1] + adds r0, r2, 0 + bl script_call +_08099558: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end s09_callstd + + thumb_func_start s0A_jumpstd_if +s0A_jumpstd_if: @ 8099568 + push {r4,lr} + adds r3, r0, 0 + ldr r0, [r3, 0x8] + ldrb r2, [r0] + adds r0, 0x1 + str r0, [r3, 0x8] + ldrb r4, [r0] + adds r0, 0x1 + str r0, [r3, 0x8] + ldr r1, =gUnknown_085102C0 + lsls r0, r2, 1 + adds r0, r2 + ldrb r2, [r3, 0x2] + adds r0, r2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080995A0 + lsls r0, r4, 2 + ldr r1, =gUnknown_081DC2A0 + adds r1, r0, r1 + ldr r0, =gUnknown_081DC2CC + cmp r1, r0 + bcs _080995A0 + ldr r1, [r1] + adds r0, r3, 0 + bl script_jump +_080995A0: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s0A_jumpstd_if + + thumb_func_start s0B_callstd_if +s0B_callstd_if: @ 80995B4 + push {r4,lr} + adds r3, r0, 0 + ldr r0, [r3, 0x8] + ldrb r2, [r0] + adds r0, 0x1 + str r0, [r3, 0x8] + ldrb r4, [r0] + adds r0, 0x1 + str r0, [r3, 0x8] + ldr r1, =gUnknown_085102C0 + lsls r0, r2, 1 + adds r0, r2 + ldrb r2, [r3, 0x2] + adds r0, r2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080995EC + lsls r0, r4, 2 + ldr r1, =gUnknown_081DC2A0 + adds r1, r0, r1 + ldr r0, =gUnknown_081DC2CC + cmp r1, r0 + bcs _080995EC + ldr r1, [r1] + adds r0, r3, 0 + bl script_call +_080995EC: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s0B_callstd_if + + thumb_func_start s0C_restore_execution_after_sCF +s0C_restore_execution_after_sCF: @ 8099600 + push {lr} + ldr r1, =0x020375c0 + ldr r1, [r1] + bl script_jump + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end s0C_restore_execution_after_sCF + + thumb_func_start s0D_endscript_killram +s0D_endscript_killram: @ 8099614 + push {r4,lr} + adds r4, r0, 0 + bl killram + adds r0, r4, 0 + bl script_stop + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s0D_endscript_killram + + thumb_func_start s0E_set_byte +s0E_set_byte: @ 809962C + push {lr} + ldr r1, [r0, 0x8] + ldrb r2, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + adds r0, r2, 0 + bl sub_81538C4 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s0E_set_byte + + thumb_func_start s0F_u32_var_to_const +@ int s0F_u32_var_to_const(script_env *env) +s0F_u32_var_to_const: @ 8099644 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x8] + ldrb r5, [r0] + adds r0, 0x1 + str r0, [r4, 0x8] + adds r0, r4, 0 + bl script_read_word + lsls r5, 2 + adds r4, 0x64 + adds r4, r5 + str r0, [r4] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s0F_u32_var_to_const + + thumb_func_start s12_u32_var_to_ptr +@ int s12_u32_var_to_ptr(script_env *env) +s12_u32_var_to_ptr: @ 8099668 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x8] + ldrb r5, [r0] + adds r0, 0x1 + str r0, [r4, 0x8] + adds r0, r4, 0 + bl script_read_word + lsls r5, 2 + adds r4, 0x64 + adds r4, r5 + ldrb r0, [r0] + str r0, [r4] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s12_u32_var_to_ptr + + thumb_func_start s11_u8_ptr_to_const +@ int s11_u8_ptr_to_const(script_env *env) +s11_u8_ptr_to_const: @ 809968C + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_word + strb r4, [r0] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s11_u8_ptr_to_const + + thumb_func_start s10_u8_var_to_const +@ int s10_u8_var_to_const(script_env *env) +s10_u8_var_to_const: @ 80996A4 + ldr r1, [r0, 0x8] + ldrb r3, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + lsls r3, 2 + adds r2, r0, 0 + adds r2, 0x64 + adds r2, r3 + ldrb r3, [r1] + str r3, [r2] + adds r1, 0x1 + str r1, [r0, 0x8] + movs r0, 0 + bx lr + thumb_func_end s10_u8_var_to_const + + thumb_func_start s13_u8_var_to_ptr +@ int s13_u8_var_to_ptr(script_env *env) +s13_u8_var_to_ptr: @ 80996C0 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x8] + ldrb r5, [r0] + adds r0, 0x1 + str r0, [r4, 0x8] + adds r0, r4, 0 + bl script_read_word + lsls r5, 2 + adds r4, 0x64 + adds r4, r5 + ldr r1, [r4] + strb r1, [r0] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s13_u8_var_to_ptr + + thumb_func_start s14_u32_var_to_var +s14_u32_var_to_var: @ 80996E4 + ldr r1, [r0, 0x8] + ldrb r3, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + ldrb r2, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + lsls r3, 2 + adds r0, 0x64 + adds r3, r0, r3 + lsls r2, 2 + adds r0, r2 + ldr r0, [r0] + str r0, [r3] + movs r0, 0 + bx lr + thumb_func_end s14_u32_var_to_var + + thumb_func_start s15_u8_ptr_to_ptr +s15_u8_ptr_to_ptr: @ 8099704 + push {r4,r5,lr} + adds r4, r0, 0 + bl script_read_word + adds r5, r0, 0 + adds r0, r4, 0 + bl script_read_word + ldrb r0, [r0] + strb r0, [r5] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s15_u8_ptr_to_ptr + + thumb_func_start s16_u16_gvar_to_const +s16_u16_gvar_to_const: @ 8099720 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + adds r4, r0, 0 + adds r0, r5, 0 + bl script_read_halfword + strh r0, [r4] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s16_u16_gvar_to_const + + thumb_func_start s19_u16_gvar_gvar +s19_u16_gvar_gvar: @ 8099744 + push {r4,r5,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + adds r5, r0, 0 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + ldrh r0, [r0] + strh r0, [r5] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s19_u16_gvar_gvar + + thumb_func_start s1A_u16_gvar_gvar +s1A_u16_gvar_gvar: @ 8099770 + push {r4,r5,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + adds r5, r0, 0 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + strh r0, [r5] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s1A_u16_gvar_gvar + + thumb_func_start compare_012 +compare_012: @ 809979C + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + cmp r0, r1 + bcs _080997AE + movs r0, 0 + b _080997B8 +_080997AE: + cmp r0, r1 + beq _080997B6 + movs r0, 0x2 + b _080997B8 +_080997B6: + movs r0, 0x1 +_080997B8: + pop {r1} + bx r1 + thumb_func_end compare_012 + + thumb_func_start s1B_cmp_u8_var_var +s1B_cmp_u8_var_var: @ 80997BC + push {r4,lr} + adds r4, r0, 0 + ldr r2, [r4, 0x8] + ldrb r0, [r2] + lsls r0, 2 + adds r3, r4, 0 + adds r3, 0x64 + adds r0, r3, r0 + ldrb r0, [r0] + adds r2, 0x1 + str r2, [r4, 0x8] + ldrb r1, [r2] + lsls r1, 2 + adds r3, r1 + ldrb r1, [r3] + adds r2, 0x1 + str r2, [r4, 0x8] + bl compare_012 + strb r0, [r4, 0x2] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s1B_cmp_u8_var_var + + thumb_func_start s1C_cmp_u8_var_const +s1C_cmp_u8_var_const: @ 80997EC + push {r4,lr} + adds r4, r0, 0 + ldr r2, [r4, 0x8] + ldrb r1, [r2] + lsls r1, 2 + adds r0, 0x64 + adds r0, r1 + ldrb r0, [r0] + adds r2, 0x1 + str r2, [r4, 0x8] + ldrb r1, [r2] + adds r2, 0x1 + str r2, [r4, 0x8] + bl compare_012 + strb r0, [r4, 0x2] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s1C_cmp_u8_var_const + + thumb_func_start s1D_cmp_u8_var_ptr +s1D_cmp_u8_var_ptr: @ 8099814 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r2, [r4, 0x8] + ldrb r1, [r2] + lsls r1, 2 + adds r0, 0x64 + adds r0, r1 + ldrb r5, [r0] + adds r2, 0x1 + str r2, [r4, 0x8] + adds r0, r4, 0 + bl script_read_word + ldrb r1, [r0] + adds r0, r5, 0 + bl compare_012 + strb r0, [r4, 0x2] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s1D_cmp_u8_var_ptr + + thumb_func_start s1E_cmp_u8_ptr_var +s1E_cmp_u8_ptr_var: @ 8099840 + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + ldrb r0, [r0] + ldr r3, [r4, 0x8] + ldrb r2, [r3] + lsls r2, 2 + adds r1, r4, 0 + adds r1, 0x64 + adds r1, r2 + ldrb r1, [r1] + adds r3, 0x1 + str r3, [r4, 0x8] + bl compare_012 + strb r0, [r4, 0x2] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s1E_cmp_u8_ptr_var + + thumb_func_start s1F_cmp_u8_ptr_const +s1F_cmp_u8_ptr_const: @ 809986C + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + ldrb r0, [r0] + ldr r2, [r4, 0x8] + ldrb r1, [r2] + adds r2, 0x1 + str r2, [r4, 0x8] + bl compare_012 + strb r0, [r4, 0x2] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s1F_cmp_u8_ptr_const + + thumb_func_start s20_cmp_u8_ptr_ptr +s20_cmp_u8_ptr_ptr: @ 809988C + push {r4,r5,lr} + adds r4, r0, 0 + bl script_read_word + ldrb r5, [r0] + adds r0, r4, 0 + bl script_read_word + ldrb r1, [r0] + adds r0, r5, 0 + bl compare_012 + strb r0, [r4, 0x2] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s20_cmp_u8_ptr_ptr + + thumb_func_start s21_cmp_u16_gvar_const +s21_cmp_u16_gvar_const: @ 80998B0 + push {r4,r5,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + ldrh r5, [r0] + adds r0, r4, 0 + bl script_read_halfword + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl compare_012 + strb r0, [r4, 0x2] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s21_cmp_u16_gvar_const + + thumb_func_start s22_cmp_u16_gvar_gvar +s22_cmp_u16_gvar_gvar: @ 80998E0 + push {r4,r5,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + adds r5, r0, 0 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + ldrh r2, [r5] + ldrh r1, [r0] + adds r0, r2, 0 + bl compare_012 + strb r0, [r4, 0x2] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s22_cmp_u16_gvar_gvar + + thumb_func_start s17_u16_gvar_add_const +s17_u16_gvar_add_const: @ 8099914 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + adds r4, r0, 0 + adds r0, r5, 0 + bl script_read_halfword + ldrh r1, [r4] + adds r0, r1 + strh r0, [r4] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s17_u16_gvar_add_const + + thumb_func_start sub_809993C +sub_809993C: @ 809993C + push {r4,r5,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + adds r5, r0, 0 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldrh r1, [r5] + subs r1, r0 + strh r1, [r5] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809993C + + thumb_func_start s8F_get_random_val +s8F_get_random_val: @ 809996C + push {r4,r5,lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r5, =0x020375f0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __umodsi3 + strh r0, [r5] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end s8F_get_random_val + + thumb_func_start sub_80999A0 +sub_80999A0: @ 80999A0 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + ldr r5, =0x020375f0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl bag_add_item + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80999A0 + + thumb_func_start sub_80999E4 +sub_80999E4: @ 80999E4 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + ldr r5, =0x020375f0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl remove_item + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80999E4 + + thumb_func_start sub_8099A28 +sub_8099A28: @ 8099A28 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + ldr r5, =0x020375f0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80D6800 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8099A28 + + thumb_func_start sub_8099A6C +sub_8099A6C: @ 8099A6C + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + ldr r5, =0x020375f0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80D6724 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8099A6C + + thumb_func_start s48_get_item_type +s48_get_item_type: @ 8099AB0 + push {r4,lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r4, =0x020375f0 + bl sub_80D6C68 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s48_get_item_type + + thumb_func_start sub_8099ADC +sub_8099ADC: @ 8099ADC + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r5, =0x020375f0 + adds r0, r4, 0 + bl sub_80D6D70 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8099ADC + + thumb_func_start sub_8099B20 +sub_8099B20: @ 8099B20 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r5, =0x020375f0 + adds r0, r4, 0 + bl sub_80D6D1C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8099B20 + + thumb_func_start sub_8099B64 +sub_8099B64: @ 8099B64 + push {r4,lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r4, =0x020375f0 + lsls r0, 24 + lsrs r0, 24 + bl IsThereStorageSpaceForDecoration + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8099B64 + + thumb_func_start sub_8099B90 +sub_8099B90: @ 8099B90 + push {r4,lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r4, =0x020375f0 + lsls r0, 24 + lsrs r0, 24 + bl sub_81619DC + lsls r0, 24 + asrs r0, 24 + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8099B90 + + thumb_func_start sub_8099BBC +sub_8099BBC: @ 8099BBC + push {r4,lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r4, =0x020375f0 + lsls r0, 24 + lsrs r0, 24 + bl sub_81619A8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8099BBC + + thumb_func_start sub_8099BE8 +sub_8099BE8: @ 8099BE8 + push {r4,lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r4, =0x020375f0 + lsls r0, 24 + lsrs r0, 24 + bl sub_8161918 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8099BE8 + + thumb_func_start s29_flag_set +@ int s29_flag_set(script_env *env) +s29_flag_set: @ 8099C14 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl FlagSet + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s29_flag_set + + thumb_func_start s2A_flag_clear +@ int s2A_flag_clear(script_env *env) +s2A_flag_clear: @ 8099C28 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl FlagReset + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s2A_flag_clear + + thumb_func_start s2B_flag_check +@ int s2B_flag_check(script_env *env) +s2B_flag_check: @ 8099C3C + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl FlagGet + strb r0, [r4, 0x2] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s2B_flag_check + + thumb_func_start sC3_unknown +@ int sC3_unknown(script_env *env) +sC3_unknown: @ 8099C58 + push {lr} + ldr r1, [r0, 0x8] + ldrb r2, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + adds r0, r2, 0 + bl sav12_xor_increment + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sC3_unknown + + thumb_func_start s9A_unknown +@ int s9A_unknown(script_env *env) +s9A_unknown: @ 8099C70 + push {lr} + ldr r1, [r0, 0x8] + ldrb r2, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + adds r0, r2, 0 + bl sub_80B009C + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end s9A_unknown + + thumb_func_start s99_unknown +@ int s99_unknown(script_env *env) +s99_unknown: @ 8099C8C + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + bl sub_80854EC + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s99_unknown + + thumb_func_start sub_8099CA8 +sub_8099CA8: @ 8099CA8 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08099CC0 + movs r0, 0 + b _08099CC2 + .pool +_08099CC0: + movs r0, 0x1 +_08099CC2: + pop {r1} + bx r1 + thumb_func_end sub_8099CA8 + + thumb_func_start s97_screen_special_effect +@ int s97_screen_special_effect(script_env *env) +s97_screen_special_effect: @ 8099CC8 + push {r4,lr} + adds r4, r0, 0 + ldr r1, [r4, 0x8] + ldrb r0, [r1] + adds r1, 0x1 + str r1, [r4, 0x8] + movs r1, 0 + bl fade_screen + ldr r1, =sub_8099CA8 + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s97_screen_special_effect + + thumb_func_start s98_refade_with_timer +@ int s98_refade_with_timer(script_env *env) +s98_refade_with_timer: @ 8099CF0 + push {r4,lr} + adds r4, r0, 0 + ldr r2, [r4, 0x8] + ldrb r0, [r2] + adds r2, 0x1 + str r2, [r4, 0x8] + ldrb r1, [r2] + adds r2, 0x1 + str r2, [r4, 0x8] + lsls r1, 24 + asrs r1, 24 + bl fade_screen + ldr r1, =sub_8099CA8 + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s98_refade_with_timer + + thumb_func_start sub_8099D20 +@ int sub_8099D20(script_env *env) +sub_8099D20: @ 8099D20 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r4, [r0] + adds r0, 0x1 + str r0, [r5, 0x8] + cmp r4, 0x1 + beq _08099D3E + cmp r4, 0x1 + bgt _08099D3A + cmp r4, 0 + beq _08099D60 + b _08099D3E +_08099D3A: + cmp r4, 0x2 + beq _08099D60 +_08099D3E: + ldr r0, =0x02037714 + ldr r1, =0x02037fe8 + ldr r2, =0x04000100 + bl CpuSet + adds r0, r4, 0 + movs r1, 0 + bl fade_screen + b _08099D72 + .pool +_08099D60: + ldr r0, =0x02037fe8 + ldr r1, =0x02037714 + ldr r2, =0x04000100 + bl CpuSet + adds r0, r4, 0 + movs r1, 0 + bl fade_screen +_08099D72: + ldr r1, =sub_8099CA8 + adds r0, r5, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8099D20 + + thumb_func_start s28_pause_asm +s28_pause_asm: @ 8099D94 + push {lr} + ldr r1, =0x020375c8 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + beq _08099DAC + movs r0, 0 + b _08099DAE + .pool +_08099DAC: + movs r0, 0x1 +_08099DAE: + pop {r1} + bx r1 + thumb_func_end s28_pause_asm + + thumb_func_start s28_pause +@ int s28_pause(script_env *env) +s28_pause: @ 8099DB4 + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + ldr r1, =0x020375c8 + strh r0, [r1] + ldr r1, =s28_pause_asm + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s28_pause + + thumb_func_start s2C_unknown +@ int s2C_unknown(script_env *env) +s2C_unknown: @ 8099DD8 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl GameFreakRTC_CalcRTCToLocalDelta_DayZero + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s2C_unknown + + thumb_func_start s2D_unknown +@ int s2D_unknown(script_env *env) +s2D_unknown: @ 8099E10 + push {lr} + bl sub_809E7B0 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s2D_unknown + + thumb_func_start s2E_unknown +@ int s2E_unknown(script_env *env) +s2E_unknown: @ 8099E1C + push {lr} + bl GameFreakRTC_CalcLocalDateTime + ldr r2, =0x020375d8 + ldr r1, =0x03005cf8 + movs r0, 0x2 + ldrsb r0, [r1, r0] + strh r0, [r2] + ldr r2, =0x020375da + movs r0, 0x3 + ldrsb r0, [r1, r0] + strh r0, [r2] + ldr r2, =0x020375dc + movs r0, 0x4 + ldrsb r0, [r1, r0] + strh r0, [r2] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end s2E_unknown + + thumb_func_start sA4_set_weather_data +@ int sA4_set_weather_data(script_env *env) +sA4_set_weather_data: @ 8099E54 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + bl sub_80AED7C + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sA4_set_weather_data + + thumb_func_start sA3_set_standard_weather_data +@ int sA3_set_standard_weather_data(script_env *env) +sA3_set_standard_weather_data: @ 8099E70 + push {lr} + bl sub_80AEDBC + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sA3_set_standard_weather_data + + thumb_func_start sub_8099E7C +@ int sub_8099E7C(script_env *env) +sub_8099E7C: @ 8099E7C + push {lr} + bl sub_80AEE20 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_8099E7C + + thumb_func_start sA6_activate_per_step_callback_eg_ash +@ int sA6_activate_per_step_callback_eg_ash(script_env *env) +sA6_activate_per_step_callback_eg_ash: @ 8099E88 + push {lr} + ldr r1, [r0, 0x8] + ldrb r2, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + adds r0, r2, 0 + bl activate_per_step_callback + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sA6_activate_per_step_callback_eg_ash + + thumb_func_start sA7_set_new_map_footer +@ int sA7_set_new_map_footer(script_env *env) +sA7_set_new_map_footer: @ 8099EA0 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + bl sub_8085524 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sA7_set_new_map_footer + + thumb_func_start s39_warp_sfx +@ int s39_warp_sfx(script_env *env) +s39_warp_sfx: @ 8099EBC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl warp1_set + bl sub_80AF734 + bl player_avatar_init_params_reset + movs r0, 0x1 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end s39_warp_sfx + + thumb_func_start s3A_warp_new_music +@ int s3A_warp_new_music(script_env *env) +s3A_warp_new_music: @ 8099F44 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl warp1_set + bl sp13E_warp_to_last_warp + bl player_avatar_init_params_reset + movs r0, 0x1 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end s3A_warp_new_music + + thumb_func_start s3B_warp_keep_music +@ int s3B_warp_keep_music(script_env *env) +s3B_warp_keep_music: @ 8099FCC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl warp1_set + bl sub_80AF7D0 + bl player_avatar_init_params_reset + movs r0, 0x1 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end s3B_warp_keep_music + + thumb_func_start sub_809A054 +sub_809A054: @ 809A054 + push {r4-r6,lr} + sub sp, 0x8 + ldr r1, [r0, 0x8] + ldrb r6, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + ldrb r5, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + mov r4, sp + adds r4, 0x6 + add r0, sp, 0x4 + adds r1, r4, 0 + bl PlayerGetDestCoords + cmp r6, 0xFF + bne _0809A092 + cmp r5, 0xFF + bne _0809A092 + add r0, sp, 0x4 + ldrh r0, [r0] + subs r0, 0x7 + lsls r0, 16 + asrs r0, 16 + ldrh r1, [r4] + subs r1, 0x7 + lsls r1, 16 + asrs r1, 16 + bl sub_8084EBC + b _0809A0B6 +_0809A092: + lsls r0, r6, 24 + asrs r0, 24 + lsls r1, r5, 24 + asrs r1, 24 + movs r2, 0x1 + negs r2, r2 + add r3, sp, 0x4 + ldrb r3, [r3] + subs r3, 0x7 + lsls r3, 24 + asrs r3, 24 + ldrb r4, [r4] + subs r4, 0x7 + lsls r4, 24 + asrs r4, 24 + str r4, [sp] + bl warp1_set +_0809A0B6: + bl sp13F_fall_to_last_warp + bl player_avatar_init_params_reset + movs r0, 0x1 + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_809A054 + + thumb_func_start s3D_warp_v4 +s3D_warp_v4: @ 809A0C8 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl warp1_set + bl sub_80AF848 + bl player_avatar_init_params_reset + movs r0, 0x1 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end s3D_warp_v4 + + thumb_func_start sub_809A150 +sub_809A150: @ 809A150 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl warp1_set + bl sub_80AF87C + bl player_avatar_init_params_reset + movs r0, 0x1 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_809A150 + + thumb_func_start s3E_set_new_map +s3E_set_new_map: @ 809A1D8 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl warp1_set + movs r0, 0 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end s3E_set_new_map + + thumb_func_start s3F_set_new_map_DMA +s3F_set_new_map_DMA: @ 809A258 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x8 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + str r4, [sp] + lsls r0, 24 + asrs r0, 24 + str r0, [sp, 0x4] + movs r0, 0 + mov r1, r9 + mov r2, r8 + adds r3, r6, 0 + bl saved_warp2_set_2 + movs r0, 0 + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end s3F_set_new_map_DMA + + thumb_func_start sub_809A2DC +sub_809A2DC: @ 809A2DC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl sub_8084E2C + movs r0, 0 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_809A2DC + + thumb_func_start sub_809A35C +sub_809A35C: @ 809A35C + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl sub_8084E80 + movs r0, 0 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_809A35C + + thumb_func_start sC4_unknown +sC4_unknown: @ 809A3DC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl sub_8084DD4 + movs r0, 0 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sC4_unknown + + thumb_func_start s42_get_map_camera_pos +@ int s42_get_map_camera_pos(script_env *env) +s42_get_map_camera_pos: @ 809A45C + push {r4,r5,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + adds r5, r0, 0 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + ldr r2, =0x03005d8c + ldr r1, [r2] + ldrh r1, [r1] + strh r1, [r5] + ldr r1, [r2] + ldrh r1, [r1, 0x2] + strh r1, [r0] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end s42_get_map_camera_pos + + thumb_func_start s43_get_player_party_count +s43_get_player_party_count: @ 809A498 + push {r4,lr} + ldr r4, =0x020375f0 + bl calc_player_party_count + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s43_get_player_party_count + + thumb_func_start s2F_music_play +s2F_music_play: @ 809A4B4 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl audio_play + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s2F_music_play + + thumb_func_start s30_music_check_asm +s30_music_check_asm: @ 809A4C8 + push {lr} + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _0809A4D8 + movs r0, 0 + b _0809A4DA +_0809A4D8: + movs r0, 0x1 +_0809A4DA: + pop {r1} + bx r1 + thumb_func_end s30_music_check_asm + + thumb_func_start s30_music_check +s30_music_check: @ 809A4E0 + push {lr} + ldr r1, =s30_music_check_asm + bl script_setup_asm_script + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end s30_music_check + + thumb_func_start s31_fanfare_play +s31_fanfare_play: @ 809A4F4 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl fanfare_play + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s31_fanfare_play + + thumb_func_start s32_fanfare_wait_asm +s32_fanfare_wait_asm: @ 809A508 + push {lr} + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end s32_fanfare_wait_asm + + thumb_func_start s32_fanfare_wait +s32_fanfare_wait: @ 809A518 + push {lr} + ldr r1, =s32_fanfare_wait_asm + bl script_setup_asm_script + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end s32_fanfare_wait + + thumb_func_start s33_play_music +@ int s33_play_music(script_env *env) +s33_play_music: @ 809A52C + push {r4,r5,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r2, r0, 16 + adds r5, r2, 0 + ldr r0, [r4, 0x8] + ldrb r1, [r0] + adds r0, 0x1 + str r0, [r4, 0x8] + cmp r1, 0x1 + bne _0809A54C + adds r0, r2, 0 + bl sav1_set_battle_music_maybe +_0809A54C: + adds r0, r5, 0 + bl current_map_music_set + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s33_play_music + + thumb_func_start s34_unknown +s34_unknown: @ 809A55C + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl sav1_set_battle_music_maybe + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s34_unknown + + thumb_func_start s35_fade_to_default +s35_fade_to_default: @ 809A570 + push {lr} + bl sub_8085898 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s35_fade_to_default + + thumb_func_start s36_fade_to_music +s36_fade_to_music: @ 809A57C + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl sub_80858C4 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s36_fade_to_music + + thumb_func_start s37_fadeout +s37_fadeout: @ 809A590 + push {r4,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x8] + ldrb r1, [r0] + adds r0, 0x1 + str r0, [r4, 0x8] + cmp r1, 0 + beq _0809A5AA + lsls r0, r1, 26 + lsrs r0, 24 + bl sub_80A31E8 + b _0809A5B0 +_0809A5AA: + movs r0, 0x4 + bl sub_80A31E8 +_0809A5B0: + ldr r1, =sub_80A3200 + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s37_fadeout + + thumb_func_start s38_fadein +s38_fadein: @ 809A5C4 + push {lr} + ldr r1, [r0, 0x8] + ldrb r2, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + cmp r2, 0 + beq _0809A5DC + lsls r0, r2, 26 + lsrs r0, 24 + bl sub_80A3228 + b _0809A5E2 +_0809A5DC: + movs r0, 0x4 + bl sub_80A3228 +_0809A5E2: + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s38_fadein + + thumb_func_start s4F_execute_movement +s4F_execute_movement: @ 809A5E8 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_word + adds r3, r0, 0 + lsls r0, r4, 24 + lsrs r0, 24 + ldr r1, =0x03005d8c + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl exec_movement + ldr r0, =0x020375ca + strh r4, [r0] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end s4F_execute_movement + + thumb_func_start s50_execute_movement_remote +s50_execute_movement_remote: @ 809A62C + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_word + adds r3, r0, 0 + ldr r0, [r5, 0x8] + ldrb r2, [r0] + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + adds r0, 0x1 + str r0, [r5, 0x8] + lsls r0, r4, 24 + lsrs r0, 24 + bl exec_movement + ldr r0, =0x020375ca + strh r4, [r0] + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end s50_execute_movement_remote + + thumb_func_start s51a_0806B288 +s51a_0806B288: @ 809A670 + push {lr} + ldr r0, =0x020375ca + ldrb r0, [r0] + ldr r1, =0x020375ce + ldrb r1, [r1] + ldr r2, =0x020375cc + ldrb r2, [r2] + bl sub_80D3340 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end s51a_0806B288 + + thumb_func_start s51_waitmove +s51_waitmove: @ 809A698 + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _0809A6B4 + ldr r0, =0x020375ca + strh r1, [r0] +_0809A6B4: + ldr r1, =0x020375cc + ldr r0, =0x03005d8c + ldr r2, [r0] + movs r0, 0x4 + ldrsb r0, [r2, r0] + strh r0, [r1] + ldr r1, =0x020375ce + movs r0, 0x5 + ldrsb r0, [r2, r0] + strh r0, [r1] + ldr r1, =s51a_0806B288 + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s51_waitmove + + thumb_func_start s52_waitmove_remote +s52_waitmove_remote: @ 809A6EC + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _0809A708 + ldr r0, =0x020375ca + strh r1, [r0] +_0809A708: + ldr r0, [r4, 0x8] + ldrb r2, [r0] + adds r0, 0x1 + str r0, [r4, 0x8] + ldrb r1, [r0] + adds r0, 0x1 + str r0, [r4, 0x8] + ldr r0, =0x020375cc + strh r2, [r0] + ldr r0, =0x020375ce + strh r1, [r0] + ldr r1, =s51a_0806B288 + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s52_waitmove_remote + + thumb_func_start s53_hide_sprite +s53_hide_sprite: @ 809A740 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005d8c + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl RemoveFieldObjectByLocalIdAndMap + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end s53_hide_sprite + + thumb_func_start s54_hide_sprite_set_coords +s54_hide_sprite_set_coords: @ 809A768 + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r3, [r4, 0x8] + ldrb r2, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + ldrb r1, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + bl RemoveFieldObjectByLocalIdAndMap + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s54_hide_sprite_set_coords + + thumb_func_start s55_show_sprite +s55_show_sprite: @ 809A798 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005d8c + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl show_sprite + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end s55_show_sprite + + thumb_func_start s56_show_sprite_set_coords +s56_show_sprite_set_coords: @ 809A7C0 + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r3, [r4, 0x8] + ldrb r2, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + ldrb r1, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + bl show_sprite + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s56_show_sprite_set_coords + + thumb_func_start s57_move_sprites +s57_move_sprites: @ 809A7F0 + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r6, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r6, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r5, 24 + lsrs r5, 24 + ldr r1, =0x03005d8c + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + lsls r4, 16 + asrs r4, 16 + lsls r0, 16 + asrs r0, 16 + str r0, [sp] + adds r0, r5, 0 + adds r3, r4, 0 + bl sub_808EBA8 + movs r0, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end s57_move_sprites + + thumb_func_start s63_new_sprite_location_permanent +s63_new_sprite_location_permanent: @ 809A858 + push {r4-r6,lr} + adds r6, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r6, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r6, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r2, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, 16 + asrs r4, 16 + lsls r2, 16 + asrs r2, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl update_saveblock1_field_object_coords + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end s63_new_sprite_location_permanent + + thumb_func_start s64_set_sprite_top_left_corner +s64_set_sprite_top_left_corner: @ 809A8B0 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005d8c + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl sub_808F254 + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end s64_set_sprite_top_left_corner + + thumb_func_start s58_npc_f1_clear_x20 +s58_npc_f1_clear_x20: @ 809A8D8 + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r3, [r4, 0x8] + ldrb r2, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + ldrb r1, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + movs r3, 0 + bl npc_by_local_id_and_map_set_field_1_bit_x20 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s58_npc_f1_clear_x20 + + thumb_func_start s59_npc_f1_set_x20 +s59_npc_f1_set_x20: @ 809A908 + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r3, [r4, 0x8] + ldrb r2, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + ldrb r1, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + movs r3, 0x1 + bl npc_by_local_id_and_map_set_field_1_bit_x20 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s59_npc_f1_set_x20 + + thumb_func_start sA8_unknown +sA8_unknown: @ 809A938 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r3, [r5, 0x8] + ldrb r2, [r3] + adds r3, 0x1 + str r3, [r5, 0x8] + ldrb r1, [r3] + adds r4, r3, 0x1 + str r4, [r5, 0x8] + ldrb r3, [r3, 0x1] + adds r4, 0x1 + str r4, [r5, 0x8] + lsls r0, 24 + lsrs r0, 24 + adds r3, 0x53 + lsls r3, 24 + lsrs r3, 24 + bl sub_808E78C + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sA8_unknown + + thumb_func_start sA9_unknown +sA9_unknown: @ 809A974 + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r3, [r4, 0x8] + ldrb r2, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + ldrb r1, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + bl sub_808E7E4 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sA9_unknown + + thumb_func_start s5A_face_player +s5A_face_player: @ 809A9A4 + push {r4,lr} + ldr r2, =0x02037350 + ldr r0, =0x03005df0 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r4, r0, r2 + ldrb r0, [r4] + lsls r0, 31 + cmp r0, 0 + beq _0809A9CC + bl player_get_direction_lower_nybble + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectFaceOppositeDirection +_0809A9CC: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s5A_face_player + + thumb_func_start s5B_npc_set_direction +s5B_npc_set_direction: @ 809A9DC + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r1, [r4, 0x8] + ldrb r3, [r1] + adds r1, 0x1 + str r1, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005d8c + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl FieldObjectTurnByLocalIdAndMap + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s5B_npc_set_direction + + thumb_func_start s65_set_sprite_behaviour +s65_set_sprite_behaviour: @ 809AA10 + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r2, [r4, 0x8] + ldrb r1, [r2] + adds r2, 0x1 + str r2, [r4, 0x8] + lsls r0, 24 + lsrs r0, 24 + bl update_saveblock1_field_object_movement_behavior + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s65_set_sprite_behaviour + + thumb_func_start sAA_create_new_sprite +sAA_create_new_sprite: @ 809AA38 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x8 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r6, [r0] + adds r0, 0x1 + str r0, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r3, r0, 0 + ldr r0, [r5, 0x8] + ldrb r2, [r0] + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + adds r0, 0x1 + str r0, [r5, 0x8] + lsls r4, 16 + asrs r4, 16 + lsls r3, 16 + asrs r3, 16 + str r2, [sp] + str r1, [sp, 0x4] + mov r0, r8 + adds r1, r6, 0 + adds r2, r4, 0 + bl sprite_new + movs r0, 0 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sAA_create_new_sprite + + thumb_func_start sAB_unknown +sAB_unknown: @ 809AAA8 + push {lr} + ldr r2, [r0, 0x8] + ldrb r3, [r2] + adds r2, 0x1 + str r2, [r0, 0x8] + ldrb r1, [r2] + adds r2, 0x1 + str r2, [r0, 0x8] + adds r0, r3, 0 + bl sub_8097B78 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sAB_unknown + + thumb_func_start sub_809AAC4 +sub_809AAC4: @ 809AAC4 + push {r4,lr} + adds r4, r0, 0 + bl is_c1_link_related_active + cmp r0, 0 + bne _0809AAE4 + bl sub_80983E8 + ldr r1, =sub_80983C4 + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + b _0809AAE6 + .pool +_0809AAE4: + movs r0, 0 +_0809AAE6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809AAC4 + + thumb_func_start sub_809AAEC +sub_809AAEC: @ 809AAEC + push {r4,lr} + adds r4, r0, 0 + bl is_c1_link_related_active + cmp r0, 0 + beq _0809AAFC + movs r0, 0 + b _0809AB3A +_0809AAFC: + ldr r2, =0x02037350 + ldr r0, =0x03005df0 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + beq _0809AB2C + bl sub_80984A0 + ldr r1, =sub_809847C + adds r0, r4, 0 + bl script_setup_asm_script + b _0809AB38 + .pool +_0809AB2C: + bl sub_80983E8 + ldr r1, =sub_80983C4 + adds r0, r4, 0 + bl script_setup_asm_script +_0809AB38: + movs r0, 0x1 +_0809AB3A: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809AAEC + + thumb_func_start s6B_release +s6B_release: @ 809AB44 + push {lr} + bl textbox_close + 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, =0x02037350 + adds r0, r1 + bl FieldObjectClearAnimIfSpecialAnimFinished + bl sub_80D338C + bl sub_809757C + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end s6B_release + + thumb_func_start s6C_release_2 +s6C_release_2: @ 809AB7C + push {r4,lr} + bl textbox_close + ldr r4, =0x02037350 + ldr r0, =0x03005df0 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r4 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + beq _0809AB9E + adds r0, r1, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished +_0809AB9E: + 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 + adds r0, r4 + bl FieldObjectClearAnimIfSpecialAnimFinished + bl sub_80D338C + bl sub_809757C + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s6C_release_2 + + thumb_func_start s67_execute_box +s67_execute_box: @ 809ABD4 + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + cmp r0, 0 + bne _0809ABE2 + ldr r0, [r4, 0x64] +_0809ABE2: + bl box_related_two__2 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s67_execute_box + + thumb_func_start sub_809ABF0 +sub_809ABF0: @ 809ABF0 + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + cmp r0, 0 + bne _0809ABFE + ldr r0, [r4, 0x64] +_0809ABFE: + bl sub_8098238 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809ABF0 + + thumb_func_start s9B_unknown +s9B_unknown: @ 809AC0C + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + adds r3, r0, 0 + cmp r3, 0 + bne _0809AC1C + ldr r3, [r4, 0x64] +_0809AC1C: + ldr r2, =0x03003014 + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r2] + adds r0, r3, 0 + bl box_related_two__3 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s9B_unknown + + thumb_func_start sub_809AC3C +sub_809AC3C: @ 809AC3C + push {r4,r5,lr} + sub sp, 0xC + adds r5, r0, 0 + bl script_read_word + adds r4, r0, 0 + cmp r4, 0 + bne _0809AC4E + ldr r4, [r5, 0x64] +_0809AC4E: + bl sub_81973A4 + movs r0, 0 + movs r1, 0x1 + bl sub_81973C4 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + adds r2, r4, 0 + movs r3, 0 + bl Print + movs r0, 0 + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809AC3C + + thumb_func_start sub_809AC78 +sub_809AC78: @ 809AC78 + push {lr} + ldr r1, =sub_809833C + bl script_setup_asm_script + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809AC78 + + thumb_func_start s68_close_box +s68_close_box: @ 809AC8C + push {lr} + bl textbox_close + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s68_close_box + + thumb_func_start sub_809AC98 +sub_809AC98: @ 809AC98 + push {lr} + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0809ACB8 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0809ACB8 + movs r0, 0 + b _0809ACBA + .pool +_0809ACB8: + movs r0, 0x1 +_0809ACBA: + pop {r1} + bx r1 + thumb_func_end sub_809AC98 + + thumb_func_start sub_809ACC0 +sub_809ACC0: @ 809ACC0 + push {lr} + ldr r1, =sub_809AC98 + bl script_setup_asm_script + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809ACC0 + + thumb_func_start s6E_yes_no +s6E_yes_no: @ 809ACD4 + push {lr} + ldr r2, [r0, 0x8] + ldrb r3, [r2] + adds r2, 0x1 + str r2, [r0, 0x8] + ldrb r1, [r2] + adds r2, 0x1 + str r2, [r0, 0x8] + adds r0, r3, 0 + bl yes_no_box + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809ACF6 + movs r0, 0 + b _0809ACFC +_0809ACF6: + bl script_env_2_set_ctx_paused + movs r0, 0x1 +_0809ACFC: + pop {r1} + bx r1 + thumb_func_end s6E_yes_no + + thumb_func_start s6F_multichoice +s6F_multichoice: @ 809AD00 + push {r4,r5,lr} + ldr r2, [r0, 0x8] + ldrb r5, [r2] + adds r2, 0x1 + str r2, [r0, 0x8] + ldrb r1, [r2] + adds r3, r2, 0x1 + str r3, [r0, 0x8] + ldrb r2, [r2, 0x1] + adds r4, r3, 0x1 + str r4, [r0, 0x8] + ldrb r3, [r3, 0x1] + adds r4, 0x1 + str r4, [r0, 0x8] + adds r0, r5, 0 + bl Multichoice + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809AD2E + movs r0, 0 + b _0809AD34 +_0809AD2E: + bl script_env_2_set_ctx_paused + movs r0, 0x1 +_0809AD34: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s6F_multichoice + + thumb_func_start sub_809AD3C +sub_809AD3C: @ 809AD3C + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + ldr r2, [r0, 0x8] + ldrb r1, [r2] + mov r8, r1 + adds r2, 0x1 + str r2, [r0, 0x8] + ldrb r1, [r2] + adds r3, r2, 0x1 + str r3, [r0, 0x8] + ldrb r2, [r2, 0x1] + adds r5, r3, 0x1 + str r5, [r0, 0x8] + ldrb r6, [r3, 0x1] + adds r4, r5, 0x1 + str r4, [r0, 0x8] + ldrb r3, [r5, 0x1] + adds r4, 0x1 + str r4, [r0, 0x8] + str r6, [sp] + mov r0, r8 + bl sub_80E1E58 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809AD7A + movs r0, 0 + b _0809AD80 +_0809AD7A: + bl script_env_2_set_ctx_paused + movs r0, 0x1 +_0809AD80: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_809AD3C + + thumb_func_start sub_809AD8C +sub_809AD8C: @ 809AD8C + movs r0, 0 + bx lr + thumb_func_end sub_809AD8C + + thumb_func_start sub_809AD90 +sub_809AD90: @ 809AD90 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + ldr r2, [r0, 0x8] + ldrb r1, [r2] + mov r8, r1 + adds r2, 0x1 + str r2, [r0, 0x8] + ldrb r1, [r2] + adds r3, r2, 0x1 + str r3, [r0, 0x8] + ldrb r2, [r2, 0x1] + adds r5, r3, 0x1 + str r5, [r0, 0x8] + ldrb r6, [r3, 0x1] + adds r4, r5, 0x1 + str r4, [r0, 0x8] + ldrb r3, [r5, 0x1] + adds r4, 0x1 + str r4, [r0, 0x8] + str r6, [sp] + mov r0, r8 + bl sub_80E21D0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809ADCE + movs r0, 0 + b _0809ADD4 +_0809ADCE: + bl script_env_2_set_ctx_paused + movs r0, 0x1 +_0809ADD4: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_809AD90 + + thumb_func_start s73_nop_skip_word +s73_nop_skip_word: @ 809ADE0 + ldr r1, [r0, 0x8] + adds r1, 0x4 + str r1, [r0, 0x8] + movs r0, 0 + bx lr + thumb_func_end s73_nop_skip_word + + thumb_func_start sub_809ADEC +sub_809ADEC: @ 809ADEC + ldr r1, [r0, 0x8] + adds r1, 0x4 + str r1, [r0, 0x8] + movs r0, 0 + bx lr + thumb_func_end sub_809ADEC + + thumb_func_start sub_809ADF8 +sub_809ADF8: @ 809ADF8 + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r3, [r4, 0x8] + ldrb r1, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + ldrb r2, [r3] + adds r3, 0x1 + str r3, [r4, 0x8] + bl sub_80E2900 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809ADF8 + + thumb_func_start s76_close_picture_box +s76_close_picture_box: @ 809AE28 + push {r4,lr} + adds r4, r0, 0 + bl picbox_close + adds r1, r0, 0 + cmp r1, 0 + beq _0809AE40 + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + b _0809AE42 +_0809AE40: + movs r0, 0 +_0809AE42: + pop {r4} + pop {r1} + bx r1 + thumb_func_end s76_close_picture_box + + thumb_func_start sub_809AE48 +sub_809AE48: @ 809AE48 + push {lr} + ldr r1, [r0, 0x8] + ldrb r2, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + cmp r2, 0 + beq _0809AE5C + adds r0, r2, 0 + bl sub_812FDA8 +_0809AE5C: + bl sub_80F8ADC + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_809AE48 + + thumb_func_start sub_809AE6C +sub_809AE6C: @ 809AE6C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x20 + bl script_read_word + adds r1, r0, 0 + ldr r4, =0x02021fc4 + adds r1, 0x6 + adds r0, r4, 0 + bl ExpandStringRefs + movs r2, 0x1 + negs r2, r2 + movs r0, 0x6 + adds r1, r4, 0 + bl GetStringWidth + lsrs r0, 3 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x1C + bls _0809AE9C + movs r7, 0x1C +_0809AE9C: + movs r5, 0x4 + ldrb r0, [r4] + adds r2, r7, 0x2 + add r1, sp, 0x18 + mov r8, r1 + cmp r0, 0xFF + beq _0809AEC0 + adds r1, r4, 0 +_0809AEAC: + ldrb r0, [r1] + adds r1, 0x1 + cmp r0, 0xFE + bne _0809AEBA + adds r0, r5, 0x3 + lsls r0, 24 + lsrs r5, r0, 24 +_0809AEBA: + ldrb r0, [r1] + cmp r0, 0xFF + bne _0809AEAC +_0809AEC0: + cmp r5, 0x12 + bls _0809AEC6 + movs r5, 0x12 +_0809AEC6: + lsls r0, r2, 24 + lsrs r0, 24 + movs r2, 0x1E + subs r2, r0 + lsrs r0, r2, 31 + adds r2, r0 + asrs r2, 1 + lsls r2, 24 + adds r0, r5, 0x2 + lsls r0, 24 + lsrs r0, 24 + movs r4, 0x14 + subs r4, r0 + lsrs r0, r4, 31 + adds r4, r0 + asrs r4, 1 + lsls r4, 24 + lsrs r6, r2, 24 + movs r0, 0x80 + lsls r0, 17 + adds r2, r0 + lsrs r2, 24 + lsrs r3, r4, 24 + movs r1, 0x80 + lsls r1, 18 + adds r4, r1 + lsrs r4, 24 + subs r6, r2, r6 + subs r6, 0x1 + lsls r6, 3 + adds r6, 0x3 + lsls r6, 24 + lsrs r6, 24 + subs r4, r3 + subs r4, 0x1 + lsls r4, 27 + lsrs r4, 24 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + str r7, [sp] + str r5, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0x1 + str r0, [sp, 0xC] + add r0, sp, 0x10 + movs r1, 0 + bl sub_8198A50 + ldr r0, [sp, 0x10] + ldr r1, [sp, 0x14] + str r0, [sp, 0x18] + str r1, [sp, 0x1C] + ldr r5, =0x03000f30 + mov r0, r8 + bl AddWindow + strb r0, [r5] + ldrb r0, [r5] + movs r1, 0x85 + lsls r1, 2 + movs r2, 0xE0 + bl sub_809882C + ldrb r0, [r5] + movs r1, 0 + bl sub_81973FC + ldrb r0, [r5] + bl PutWindowTilemap + ldrb r0, [r5] + movs r1, 0x11 + bl FillWindowPixelBuffer + ldrb r0, [r5] + ldr r2, =0x02021fc4 + str r4, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x6 + adds r3, r6, 0 + bl Print + ldrb r0, [r5] + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0 + add sp, 0x20 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809AE6C + + thumb_func_start sub_809AF94 +sub_809AF94: @ 809AF94 + push {lr} + bl sub_809BDB4 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_809AF94 + + thumb_func_start sBD_virtual_message +sBD_virtual_message: @ 809AFA0 + push {lr} + bl script_read_word + ldr r1, =0x020375c4 + ldr r1, [r1] + subs r0, r1 + bl box_related_two__2 + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sBD_virtual_message + + thumb_func_start s7D_load_pokename +s7D_load_pokename: @ 809AFBC + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r1 + ldr r2, [r4] + movs r1, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r2, 0 + bl CopyString + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s7D_load_pokename + + thumb_func_start s7E_load_first_pokenames +s7E_load_first_pokenames: @ 809AFFC + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r2, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + ldr r0, =gUnknown_085102D4 + lsls r2, 2 + adds r2, r0 + ldr r4, [r2] + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + movs r1, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r4, 0 + bl CopyString + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s7E_load_first_pokenames + + thumb_func_start s7F_load_pokename_team +s7F_load_pokename_team: @ 809B048 + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r1, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r1 + ldr r4, [r4] + movs r1, 0x2 + adds r2, r4, 0 + bl pokemon_getattr + adds r0, r4, 0 + bl GetStringEnd_Limit7 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s7F_load_pokename_team + + thumb_func_start s80_load_item_name +s80_load_item_name: @ 809B090 + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r1 + ldr r1, [r4] + bl itemid_get_name + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s80_load_item_name + + thumb_func_start sub_809B0C4 +sub_809B0C4: @ 809B0C4 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r6, [r0] + adds r0, 0x1 + str r0, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + ldr r0, =gUnknown_085102D4 + lsls r6, 2 + adds r6, r0 + ldr r1, [r6] + adds r0, r4, 0 + bl sub_80D6660 + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809B0C4 + + thumb_func_start sub_809B114 +sub_809B114: @ 809B114 + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + lsls r1, 16 + ldr r0, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + lsrs r1, 11 + ldr r2, =gUnknown_085A5C09 + adds r1, r2 + bl CopyString + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809B114 + + thumb_func_start s82_load_item_name +s82_load_item_name: @ 809B150 + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r1 + ldr r2, [r4] + movs r1, 0xD + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + adds r0, r2, 0 + bl CopyString + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s82_load_item_name + + thumb_func_start s83_load_textvar_var +s83_load_textvar_var: @ 809B190 + push {r4,r5,lr} + ldr r1, [r0, 0x8] + ldrb r5, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + bl sub_80EF370 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =gUnknown_085102D4 + lsls r5, 2 + adds r5, r0 + ldr r0, [r5] + adds r1, r4, 0 + movs r2, 0 + bl ConvertIntToDecimalString + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end s83_load_textvar_var + + thumb_func_start s84_load_textvar_std_expression +s84_load_textvar_std_expression: @ 809B1D4 + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + ldr r1, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r1 + ldr r2, [r4] + ldr r1, =gUnknown_0858BAF0 + lsrs r0, 14 + adds r0, r1 + ldr r1, [r0] + adds r0, r2, 0 + bl CopyString + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s84_load_textvar_std_expression + + thumb_func_start sub_809B214 +sub_809B214: @ 809B214 + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + ldr r0, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + lsls r1, 24 + lsrs r1, 24 + bl sub_818E868 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809B214 + + thumb_func_start s85_load_textvar_pointer +s85_load_textvar_pointer: @ 809B248 + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_word + adds r1, r0, 0 + ldr r0, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + bl CopyString + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s85_load_textvar_pointer + + thumb_func_start sBE_virtual_load_text +sBE_virtual_load_text: @ 809B270 + push {lr} + bl script_read_word + adds r1, r0, 0 + ldr r0, =0x020375c4 + ldr r0, [r0] + subs r1, r0 + ldr r0, =0x02021fc4 + bl ExpandStringRefs + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sBE_virtual_load_text + + thumb_func_start sBF_virtual_load_textbuffer +sBF_virtual_load_textbuffer: @ 809B294 + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_word + adds r1, r0, 0 + ldr r0, =0x020375c4 + ldr r0, [r0] + subs r1, r0 + ldr r0, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + bl CopyString + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sBF_virtual_load_textbuffer + + thumb_func_start sC6_load_textvar_box_label +sC6_load_textvar_box_label: @ 809B2C8 + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r1, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r1 + ldr r4, [r4] + lsls r0, 24 + lsrs r0, 24 + bl sav3_get_box_name + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sC6_load_textvar_box_label + + thumb_func_start s79_give_pokemon +s79_give_pokemon: @ 809B304 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x8 + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r6, r0, 0 + lsls r6, 16 + lsrs r6, 16 + ldr r0, [r4, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r4, 0x8] + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + bl script_read_word + mov r8, r0 + adds r0, r4, 0 + bl script_read_word + ldr r1, [r4, 0x8] + ldrb r2, [r1] + adds r1, 0x1 + str r1, [r4, 0x8] + ldr r4, =0x020375f0 + str r0, [sp] + str r2, [sp, 0x4] + adds r0, r6, 0 + mov r1, r9 + adds r2, r5, 0 + mov r3, r8 + bl sub_80F9244 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0 + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end s79_give_pokemon + + thumb_func_start s7A_create_egg +s7A_create_egg: @ 809B384 + push {r4,lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r4, =0x020375f0 + bl sub_80F92C8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s7A_create_egg + + thumb_func_start s7B_change_pokedata_AP +s7B_change_pokedata_AP: @ 809B3B0 + push {r4,r5,lr} + ldr r1, [r0, 0x8] + ldrb r5, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + adds r2, r4, 0 + bl sub_80F9400 + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end s7B_change_pokedata_AP + + thumb_func_start sub_809B3DC +sub_809B3DC: @ 809B3DC + push {r4-r7,lr} + bl script_read_halfword + lsls r0, 16 + lsrs r7, r0, 16 + ldr r1, =0x020375f0 + movs r0, 0x6 + strh r0, [r1] + movs r6, 0 + b _0809B42A + .pool +_0809B3F4: + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0809B424 + adds r0, r4, 0 + adds r1, r7, 0 + bl pokemon_has_move + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809B424 + ldr r0, =0x020375f0 + strh r6, [r0] + ldr r0, =0x020375e0 + strh r5, [r0] + b _0809B44A + .pool +_0809B424: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0809B42A: + cmp r6, 0x5 + bhi _0809B44A + movs r0, 0x64 + adds r1, r6, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + bne _0809B3F4 +_0809B44A: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809B3DC + + thumb_func_start s90_add_money +@ int s90_add_money(script_env *env) +s90_add_money: @ 809B458 + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + adds r2, r0, 0 + ldr r0, [r4, 0x8] + ldrb r1, [r0] + adds r0, 0x1 + str r0, [r4, 0x8] + cmp r1, 0 + bne _0809B47E + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + adds r1, r2, 0 + bl add_money +_0809B47E: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s90_add_money + + thumb_func_start s91_subtract_money +@ int s91_subtract_money(script_env *env) +s91_subtract_money: @ 809B48C + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + adds r2, r0, 0 + ldr r0, [r4, 0x8] + ldrb r1, [r0] + adds r0, 0x1 + str r0, [r4, 0x8] + cmp r1, 0 + bne _0809B4B2 + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + adds r1, r2, 0 + bl subtract_money +_0809B4B2: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s91_subtract_money + + thumb_func_start s92_check_money +@ int s92_check_money(script_env *env) +s92_check_money: @ 809B4C0 + push {r4,lr} + adds r4, r0, 0 + bl script_read_word + adds r2, r0, 0 + ldr r0, [r4, 0x8] + ldrb r1, [r0] + adds r0, 0x1 + str r0, [r4, 0x8] + cmp r1, 0 + bne _0809B4EE + ldr r4, =0x020375f0 + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + adds r1, r2, 0 + bl IsEnoughMoney + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] +_0809B4EE: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s92_check_money + + thumb_func_start s93_display_money +@ int s93_display_money(script_env *env) +s93_display_money: @ 809B500 + push {r4,r5,lr} + ldr r1, [r0, 0x8] + ldrb r5, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + ldrb r4, [r1] + adds r2, r1, 0x1 + str r2, [r0, 0x8] + ldrb r1, [r1, 0x1] + adds r2, 0x1 + str r2, [r0, 0x8] + cmp r1, 0 + bne _0809B530 + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + bl DecryptMoney + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_80E52EC +_0809B530: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end s93_display_money + + thumb_func_start s94_hide_money +s94_hide_money: @ 809B53C + push {lr} + bl sub_80E5384 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s94_hide_money + + thumb_func_start s95_update_money +@ int s95_update_money(script_env *env) +s95_update_money: @ 809B548 + push {lr} + ldr r1, [r0, 0x8] + adds r1, 0x1 + adds r2, r1, 0x1 + str r2, [r0, 0x8] + ldrb r1, [r1, 0x1] + adds r2, 0x1 + str r2, [r0, 0x8] + cmp r1, 0 + bne _0809B56E + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + bl DecryptMoney + bl sub_80E52D4 +_0809B56E: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end s95_update_money + + thumb_func_start sub_809B578 +sub_809B578: @ 809B578 + push {r4,r5,lr} + ldr r1, [r0, 0x8] + ldrb r5, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl GetCoins + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + adds r2, r4, 0 + bl ShowCoinsWindow + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809B578 + + thumb_func_start sC1_hide_coins +sC1_hide_coins: @ 809B5A0 + push {lr} + ldr r1, [r0, 0x8] + adds r1, 0x2 + str r1, [r0, 0x8] + bl HideCoinsWindow + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sC1_hide_coins + + thumb_func_start sC2_update_coins +sC2_update_coins: @ 809B5B4 + push {lr} + ldr r1, [r0, 0x8] + adds r1, 0x2 + str r1, [r0, 0x8] + bl GetCoins + lsls r0, 16 + lsrs r0, 16 + bl PrintCoinsString + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sC2_update_coins + + thumb_func_start s5C_trainer_battle_configure_and_start +s5C_trainer_battle_configure_and_start: @ 809B5D0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x8] + bl TrainerBattleConfigure + str r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s5C_trainer_battle_configure_and_start + + thumb_func_start sub_809B5E4 +sub_809B5E4: @ 809B5E4 + push {lr} + bl sub_80B17E0 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_809B5E4 + + thumb_func_start sub_809B5F0 +sub_809B5F0: @ 809B5F0 + push {r4,lr} + adds r4, r0, 0 + bl sub_80B1AF8 + str r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809B5F0 + + thumb_func_start sub_809B604 +@ bool8 sub_809B604(struct script_env *env) +sub_809B604: @ 809B604 + push {r4,lr} + adds r4, r0, 0 + bl sub_80B1B10 + str r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809B604 + + thumb_func_start s60_check_trainer_flag +s60_check_trainer_flag: @ 809B618 + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + bl trainer_flag_check + strb r0, [r4, 0x2] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end s60_check_trainer_flag + + thumb_func_start s61_set_trainer_flag +s61_set_trainer_flag: @ 809B63C + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + bl trainer_flag_set + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s61_set_trainer_flag + + thumb_func_start s62_unset_trainer_flag +s62_unset_trainer_flag: @ 809B658 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + bl trainer_flag_clear + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s62_unset_trainer_flag + + thumb_func_start sB6_load_battle +sB6_load_battle: @ 809B674 + push {r4-r6,lr} + adds r4, r0, 0 + bl script_read_halfword + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + ldr r0, [r4, 0x8] + ldrb r6, [r0] + adds r0, 0x1 + str r0, [r4, 0x8] + adds r0, r4, 0 + bl script_read_halfword + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_80F93A0 + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sB6_load_battle + + thumb_func_start sub_809B6A8 +sub_809B6A8: @ 809B6A8 + push {lr} + bl sub_80B08A8 + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_809B6A8 + + thumb_func_start s86_pokemart +s86_pokemart: @ 809B6B8 + push {lr} + bl script_read_word + bl CreatePokemartMenu + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end s86_pokemart + + thumb_func_start s87_pokemartdecor +s87_pokemartdecor: @ 809B6CC + push {lr} + bl script_read_word + bl CreateDecorationShop1Menu + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end s87_pokemartdecor + + thumb_func_start s88_pokemartbp +s88_pokemartbp: @ 809B6E0 + push {lr} + bl script_read_word + bl CreateDecorationShop2Menu + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end s88_pokemartbp + + thumb_func_start s89_open_casino_game1 +s89_open_casino_game1: @ 809B6F4 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + ldr r1, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl sub_812A540 + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end s89_open_casino_game1 + + thumb_func_start berry_script_cmd +@ bool8 berry_script_cmd(struct script_env *env) +berry_script_cmd: @ 809B71C + push {r4,r5,lr} + ldr r1, [r0, 0x8] + ldrb r5, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + ldrb r3, [r1] + adds r2, r1, 0x1 + str r2, [r0, 0x8] + ldrb r4, [r1, 0x1] + adds r2, 0x1 + str r2, [r0, 0x8] + cmp r3, 0 + bne _0809B744 + adds r0, r5, 0 + movs r1, 0 + adds r2, r4, 0 + movs r3, 0 + bl PlantBerryTree + b _0809B750 +_0809B744: + adds r0, r5, 0 + adds r1, r3, 0 + adds r2, r4, 0 + movs r3, 0 + bl PlantBerryTree +_0809B750: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end berry_script_cmd + + thumb_func_start sub_809B758 +sub_809B758: @ 809B758 + push {r4,lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r4, =0x020375f0 + lsls r0, 24 + lsrs r0, 24 + bl GetPriceReduction + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809B758 + + thumb_func_start sub_809B784 +sub_809B784: @ 809B784 + push {lr} + bl sub_81B9404 + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_809B784 + + thumb_func_start sub_809B794 +sub_809B794: @ 809B794 + push {lr} + bl sub_80F840C + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_809B794 + + thumb_func_start sub_809B7A4 +sub_809B7A4: @ 809B7A4 + push {lr} + bl sub_80F8484 + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_809B7A4 + + thumb_func_start sub_809B7B4 +sub_809B7B4: @ 809B7B4 + push {lr} + ldr r0, =0x02039f2c + ldrb r0, [r0] + bl sub_80F84C4 + bl script_env_2_set_ctx_paused + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809B7B4 + + thumb_func_start s9C_execute_HM +s9C_execute_HM: @ 809B7CC + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x020375d0 + strh r0, [r1] + lsls r0, 24 + lsrs r0, 24 + bl FieldEffectStart + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end s9C_execute_HM + + thumb_func_start s9D_set_HM_animation_data +s9D_set_HM_animation_data: @ 809B7F4 + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r1, =0x02038c08 + lsls r4, 2 + adds r4, r1 + lsls r0, 16 + asrs r0, 16 + str r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s9D_set_HM_animation_data + + thumb_func_start sub_809B824 +sub_809B824: @ 809B824 + push {lr} + ldr r0, =0x020375d0 + ldrb r0, [r0] + bl FieldEffectActiveListContains + lsls r0, 24 + cmp r0, 0 + beq _0809B83C + movs r0, 0 + b _0809B83E + .pool +_0809B83C: + movs r0, 0x1 +_0809B83E: + pop {r1} + bx r1 + thumb_func_end sub_809B824 + + thumb_func_start s9E_checkarray_HM_animation +s9E_checkarray_HM_animation: @ 809B844 + push {r4,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + ldr r1, =0x020375d0 + strh r0, [r1] + ldr r1, =sub_809B824 + adds r0, r4, 0 + bl script_setup_asm_script + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end s9E_checkarray_HM_animation + + thumb_func_start s9F_changeposition_fly +s9F_changeposition_fly: @ 809B870 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + bl sub_8084D1C + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end s9F_changeposition_fly + + thumb_func_start sA0_check_gender +sA0_check_gender: @ 809B88C + ldr r1, =0x020375f0 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + strh r0, [r1] + movs r0, 0 + bx lr + .pool + thumb_func_end sA0_check_gender + + thumb_func_start sA1_play_cry +sA1_play_cry: @ 809B8A4 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80A3404 + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sA1_play_cry + + thumb_func_start sub_809B8DC +sub_809B8DC: @ 809B8DC + push {lr} + ldr r1, =sub_80A3678 + bl script_setup_asm_script + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809B8DC + + thumb_func_start sA2_setmaptile +sA2_setmaptile: @ 809B8F0 + push {r4-r7,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r7, r0, 16 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + adds r1, r6, 0x7 + lsls r1, 16 + lsrs r6, r1, 16 + adds r1, r5, 0x7 + lsls r1, 16 + lsrs r5, r1, 16 + cmp r0, 0 + bne _0809B954 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r7, 0 + bl MapGridSetMetatileIdAt + b _0809B966 +_0809B954: + movs r1, 0xC0 + lsls r1, 4 + adds r0, r1, 0 + adds r2, r7, 0 + orrs r2, r0 + adds r0, r6, 0 + adds r1, r5, 0 + bl MapGridSetMetatileIdAt +_0809B966: + movs r0, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sA2_setmaptile + + thumb_func_start sAC_open_door +sAC_open_door: @ 809B970 + push {r4,r5,lr} + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + adds r5, 0x7 + lsls r5, 16 + lsrs r5, 16 + movs r0, 0xE0 + lsls r0, 11 + adds r4, r0 + lsrs r4, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl cur_mapdata_get_door_sound_at + lsls r0, 16 + lsrs r0, 16 + bl audio_play + adds r0, r5, 0 + adds r1, r4, 0 + bl task_overworld_door_add_if_role_69_for_opening_door_at + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sAC_open_door + + thumb_func_start sub_809B9C8 +sub_809B9C8: @ 809B9C8 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + lsls r1, 16 + adds r4, 0x7 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0xE0 + lsls r0, 11 + adds r1, r0 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_808A8AC + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809B9C8 + + thumb_func_start sub_809BA0C +sub_809BA0C: @ 809BA0C + push {lr} + bl sub_808A91C + lsls r0, 24 + cmp r0, 0 + beq _0809BA1C + movs r0, 0 + b _0809BA1E +_0809BA1C: + movs r0, 0x1 +_0809BA1E: + pop {r1} + bx r1 + thumb_func_end sub_809BA0C + + thumb_func_start sub_809BA24 +sub_809BA24: @ 809BA24 + push {lr} + ldr r1, =sub_809BA0C + bl script_setup_asm_script + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809BA24 + + thumb_func_start sub_809BA38 +sub_809BA38: @ 809BA38 + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + lsls r1, 16 + adds r4, 0x7 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0xE0 + lsls r0, 11 + adds r1, r0 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_808A854 + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809BA38 + + thumb_func_start sub_809BA7C +sub_809BA7C: @ 809BA7C + push {r4,r5,lr} + adds r5, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r1, r0, 0 + lsls r1, 16 + adds r4, 0x7 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0xE0 + lsls r0, 11 + adds r1, r0 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_808A880 + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809BA7C + + thumb_func_start sub_809BAC0 +sub_809BAC0: @ 809BAC0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x8] + adds r0, 0x1 + str r0, [r4, 0x8] + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r0, r4, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809BAC0 + + thumb_func_start sub_809BAFC +sub_809BAFC: @ 809BAFC + movs r0, 0 + bx lr + thumb_func_end sub_809BAFC + + thumb_func_start sB3_get_coin_amount +sB3_get_coin_amount: @ 809BB00 + push {r4,lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl GetVarPointer + adds r4, r0, 0 + bl GetCoins + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sB3_get_coin_amount + + thumb_func_start sub_809BB20 +sub_809BB20: @ 809BB20 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + bl AddCoins + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809BB48 + ldr r1, =0x020375f0 + movs r0, 0 + b _0809BB4C + .pool +_0809BB48: + ldr r1, =0x020375f0 + movs r0, 0x1 +_0809BB4C: + strh r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809BB20 + + thumb_func_start sub_809BB58 +sub_809BB58: @ 809BB58 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + bl SubtractCoins + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809BB80 + ldr r1, =0x020375f0 + movs r0, 0 + b _0809BB84 + .pool +_0809BB80: + ldr r1, =0x020375f0 + movs r0, 0x1 +_0809BB84: + strh r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809BB58 + + thumb_func_start sub_809BB90 +sub_809BB90: @ 809BB90 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + bl sub_81A89A0 + ldr r1, =0x020375ca + strh r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809BB90 + + thumb_func_start sub_809BBB4 +sub_809BBB4: @ 809BBB4 + push {lr} + bl sub_81A8AF8 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_809BBB4 + + thumb_func_start ScrCmd_MossdeepGymSwitch +ScrCmd_MossdeepGymSwitch: @ 809BBC0 + push {lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + bl sub_81A8934 + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end ScrCmd_MossdeepGymSwitch + + thumb_func_start sub_809BBDC +sub_809BBDC: @ 809BBDC + push {lr} + bl sub_81A895C + movs r0, 0 + pop {r1} + bx r1 + thumb_func_end sub_809BBDC + + thumb_func_start sub_809BBE8 +sub_809BBE8: @ 809BBE8 + push {lr} + bl sub_80B47BC + ldr r1, =0x03005df0 + strb r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809BBE8 + + thumb_func_start sub_809BBFC +sub_809BBFC: @ 809BBFC + push {r4,lr} + adds r4, r0, 0 + bl is_c1_link_related_active + cmp r0, 0 + beq _0809BC0C + movs r0, 0 + b _0809BC30 +_0809BC0C: + ldr r2, =0x02037350 + ldr r0, =0x03005df0 + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 31 + cmp r0, 0 + beq _0809BC2E + bl sub_8098630 + ldr r1, =sub_8098734 + adds r0, r4, 0 + bl script_setup_asm_script +_0809BC2E: + movs r0, 0x1 +_0809BC30: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809BBFC + + thumb_func_start sCD_set_obedient_bit +sCD_set_obedient_bit: @ 809BC44 + push {lr} + sub sp, 0x4 + movs r2, 0x1 + mov r1, sp + strb r2, [r1] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x50 + mov r2, sp + bl pokemon_setattr + movs r0, 0 + add sp, 0x4 + pop {r1} + bx r1 + .pool + thumb_func_end sCD_set_obedient_bit + + thumb_func_start sCE_check_obedient_bit +sCE_check_obedient_bit: @ 809BC7C + push {r4,lr} + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r4, =0x020375f0 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x50 + movs r2, 0 + bl pokemon_getattr + strh r0, [r4] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sCE_check_obedient_bit + + thumb_func_start sCF_execute_RAM_script_DMA +sCF_execute_RAM_script_DMA: @ 809BCB4 + push {r4,lr} + adds r4, r0, 0 + bl sub_8099244 + adds r2, r0, 0 + cmp r2, 0 + beq _0809BCD0 + ldr r1, =0x020375c0 + ldr r0, [r4, 0x8] + str r0, [r1] + adds r0, r4, 0 + adds r1, r2, 0 + bl script_jump +_0809BCD0: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sCF_execute_RAM_script_DMA + + thumb_func_start sD1_warp_v5 +sD1_warp_v5: @ 809BCDC + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl warp1_set + bl player_get_direction_lower_nybble + lsls r0, 24 + lsrs r0, 24 + bl sub_808D074 + bl sub_80B0244 + bl player_avatar_init_params_reset + movs r0, 0x1 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sD1_warp_v5 + + thumb_func_start sub_809BD70 +sub_809BD70: @ 809BD70 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, [r4, 0x8] + ldrb r2, [r0] + mov r1, sp + strb r2, [r1] + adds r0, 0x1 + str r0, [r4, 0x8] + cmp r3, 0x5 + bhi _0809BDA6 + movs r0, 0x64 + muls r0, r3 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x23 + mov r2, sp + bl pokemon_setattr +_0809BDA6: + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809BD70 + + thumb_func_start sub_809BDB4 +sub_809BDB4: @ 809BDB4 + push {r4,lr} + ldr r4, =0x03000f30 + ldrb r0, [r4] + movs r1, 0x1 + bl sub_819746C + ldrb r0, [r4] + bl RemoveWindow + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809BDB4 + + thumb_func_start sub_809BDD0 +sub_809BDD0: @ 809BDD0 + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r1 + ldr r4, [r4] + bl sub_806F07C + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809BDD0 + + thumb_func_start sub_809BE0C +sub_809BE0C: @ 809BE0C + push {r4,lr} + ldr r1, [r0, 0x8] + ldrb r4, [r1] + adds r1, 0x1 + str r1, [r0, 0x8] + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r1, =gUnknown_085102D4 + lsls r4, 2 + adds r4, r1 + ldr r4, [r4] + bl sub_806F0B0 + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_809BE0C + + thumb_func_start sub_809BE48 +sub_809BE48: @ 809BE48 + ldr r1, =0x020375ca + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_809BE48 + + thumb_func_start sub_809BE54 +sub_809BE54: @ 809BE54 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, [r5, 0x8] + ldrb r1, [r0] + mov r9, r1 + adds r0, 0x1 + str r0, [r5, 0x8] + ldrb r1, [r0] + mov r8, r1 + adds r1, r0, 0x1 + str r1, [r5, 0x8] + ldrb r6, [r0, 0x1] + adds r1, 0x1 + str r1, [r5, 0x8] + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + bl script_read_halfword + lsls r0, 16 + lsrs r0, 16 + bl VarGet + mov r1, r9 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + lsls r6, 24 + asrs r6, 24 + lsls r4, 24 + asrs r4, 24 + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + mov r0, r9 + adds r2, r6, 0 + adds r3, r4, 0 + bl warp1_set + bl sub_80AF79C + bl player_avatar_init_params_reset + movs r0, 0x1 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_809BE54 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/script.s b/asm/script.s new file mode 100644 index 000000000..8889510fd --- /dev/null +++ b/asm/script.s @@ -0,0 +1,879 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start script_env_init +@ void script_env_init(script_env *env, int a2, int a3) +script_env_init: @ 8098CB8 + push {lr} + adds r3, r0, 0 + movs r0, 0 + strb r0, [r3, 0x1] + str r0, [r3, 0x8] + strb r0, [r3] + str r0, [r3, 0x4] + str r1, [r3, 0x5C] + str r2, [r3, 0x60] + movs r2, 0 + movs r1, 0x3 + adds r0, r3, 0 + adds r0, 0x70 +_08098CD2: + str r2, [r0] + subs r0, 0x4 + subs r1, 0x1 + cmp r1, 0 + bge _08098CD2 + adds r1, r3, 0 + adds r1, 0xC + movs r2, 0 + adds r0, r3, 0 + adds r0, 0x58 +_08098CE6: + str r2, [r0] + subs r0, 0x4 + cmp r0, r1 + bge _08098CE6 + pop {r0} + bx r0 + thumb_func_end script_env_init + + thumb_func_start script_setup_bytecode_script +@ int script_setup_bytecode_script(script_env *env, void *script_ptr) +script_setup_bytecode_script: @ 8098CF4 + str r1, [r0, 0x8] + movs r1, 0x1 + strb r1, [r0, 0x1] + movs r0, 0x1 + bx lr + thumb_func_end script_setup_bytecode_script + + thumb_func_start script_setup_asm_script +script_setup_asm_script: @ 8098D00 + movs r2, 0x2 + strb r2, [r0, 0x1] + str r1, [r0, 0x4] + bx lr + thumb_func_end script_setup_asm_script + + thumb_func_start script_stop +@ void script_stop(script_env *env) +script_stop: @ 8098D08 + movs r1, 0 + strb r1, [r0, 0x1] + str r1, [r0, 0x8] + bx lr + thumb_func_end script_stop + + thumb_func_start script_main_handler +@ int script_main_handler(script_env *env) +script_main_handler: @ 8098D10 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x1] + cmp r0, 0 + bne _08098D1E +_08098D1A: + movs r0, 0 + b _08098D90 +_08098D1E: + ldrb r0, [r4, 0x1] + cmp r0, 0x1 + beq _08098D56 + cmp r0, 0x1 + bgt _08098D2E + cmp r0, 0 + beq _08098D1A + b _08098D8E +_08098D2E: + cmp r0, 0x2 + bne _08098D8E + ldr r0, [r4, 0x4] + cmp r0, 0 + beq _08098D52 + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08098D8E + strb r0, [r4, 0x1] + b _08098D8E +_08098D48: + strb r2, [r4, 0x1] + b _08098D1A +_08098D4C: + movs r0, 0 + strb r0, [r4, 0x1] + b _08098D90 +_08098D52: + movs r0, 0x1 + strb r0, [r4, 0x1] +_08098D56: + ldr r2, [r4, 0x8] + cmp r2, 0 + beq _08098D48 + ldr r0, =gUnknown_085102BC + ldr r0, [r0] + cmp r2, r0 + bne _08098D6C +_08098D64: + swi 0x2 + b _08098D64 + .pool +_08098D6C: + ldrb r1, [r2] + adds r0, r2, 0x1 + str r0, [r4, 0x8] + lsls r1, 2 + ldr r0, [r4, 0x5C] + adds r1, r0, r1 + ldr r0, [r4, 0x60] + cmp r1, r0 + bcs _08098D4C + ldr r1, [r1] + adds r0, r4, 0 + bl _call_via_r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08098D56 +_08098D8E: + movs r0, 0x1 +_08098D90: + pop {r4} + pop {r1} + bx r1 + thumb_func_end script_main_handler + + thumb_func_start script_stack_push +@ int script_stack_push(script_env *env, int value) +script_stack_push: @ 8098D98 + push {lr} + adds r2, r0, 0 + adds r3, r1, 0 + ldrb r1, [r2] + adds r0, r1, 0x1 + cmp r0, 0x13 + bgt _08098DBA + lsls r0, r1, 2 + adds r1, r2, 0 + adds r1, 0xC + adds r1, r0 + str r3, [r1] + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + movs r0, 0 + b _08098DBC +_08098DBA: + movs r0, 0x1 +_08098DBC: + pop {r1} + bx r1 + thumb_func_end script_stack_push + + thumb_func_start script_stack_pop +@ int script_stack_pop(script_env *env) +script_stack_pop: @ 8098DC0 + push {lr} + adds r2, r0, 0 + ldrb r0, [r2] + cmp r0, 0 + beq _08098DDC + subs r0, 0x1 + strb r0, [r2] + ldrb r1, [r2] + lsls r1, 2 + adds r0, r2, 0 + adds r0, 0xC + adds r0, r1 + ldr r0, [r0] + b _08098DDE +_08098DDC: + movs r0, 0 +_08098DDE: + pop {r1} + bx r1 + thumb_func_end script_stack_pop + + thumb_func_start script_jump +@ void script_jump(script_env *env, int address) +script_jump: @ 8098DE4 + str r1, [r0, 0x8] + bx lr + thumb_func_end script_jump + + thumb_func_start script_call +@ void script_call(script_env *env, int address) +script_call: @ 8098DE8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, [r4, 0x8] + bl script_stack_push + str r5, [r4, 0x8] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end script_call + + thumb_func_start script_return +@ void script_return(script_env *env) +script_return: @ 8098DFC + push {r4,lr} + adds r4, r0, 0 + bl script_stack_pop + str r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + thumb_func_end script_return + + thumb_func_start script_read_halfword +@ int script_read_halfword(script_env *env) +script_read_halfword: @ 8098E0C + adds r3, r0, 0 + ldr r2, [r3, 0x8] + ldrb r0, [r2] + adds r2, 0x1 + str r2, [r3, 0x8] + ldrb r1, [r2] + lsls r1, 8 + orrs r0, r1 + adds r2, 0x1 + str r2, [r3, 0x8] + bx lr + thumb_func_end script_read_halfword + + thumb_func_start script_read_word +@ int script_read_word(script_env *env) +script_read_word: @ 8098E24 + push {r4-r6,lr} + adds r3, r0, 0 + ldr r0, [r3, 0x8] + ldrb r6, [r0] + adds r0, 0x1 + str r0, [r3, 0x8] + ldrb r5, [r0] + adds r2, r0, 0x1 + str r2, [r3, 0x8] + ldrb r4, [r0, 0x1] + adds r1, r2, 0x1 + str r1, [r3, 0x8] + ldrb r0, [r2, 0x1] + adds r1, 0x1 + str r1, [r3, 0x8] + lsls r0, 8 + adds r0, r4 + lsls r0, 8 + adds r0, r5 + lsls r0, 8 + adds r0, r6 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end script_read_word + + thumb_func_start script_env_2_enable +script_env_2_enable: @ 8098E54 + ldr r1, =0x03000f2c + movs r0, 0x1 + strb r0, [r1] + bx lr + .pool + thumb_func_end script_env_2_enable + + thumb_func_start script_env_2_disable +@ void script_env_2_disable() +script_env_2_disable: @ 8098E60 + ldr r1, =0x03000f2c + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end script_env_2_disable + + thumb_func_start script_env_2_is_enabled +@ int script_env_2_is_enabled() +script_env_2_is_enabled: @ 8098E6C + ldr r0, =0x03000f2c + ldrb r0, [r0] + bx lr + .pool + thumb_func_end script_env_2_is_enabled + + thumb_func_start script_env_context_is_running +@ int script_env_context_is_running() +script_env_context_is_running: @ 8098E78 + push {lr} + ldr r0, =0x03000e38 + ldrb r0, [r0] + cmp r0, 0 + beq _08098E8C + movs r0, 0 + b _08098E8E + .pool +_08098E8C: + movs r0, 0x1 +_08098E8E: + pop {r1} + bx r1 + thumb_func_end script_env_context_is_running + + thumb_func_start script_env_1_init +script_env_1_init: @ 8098E94 + push {lr} + ldr r0, =0x03000e40 + ldr r1, =gEventScriptCommandFunctionTable + ldr r2, =gUnknown_081DBA08 + bl script_env_init + ldr r1, =0x03000e38 + movs r0, 0x2 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end script_env_1_init + + thumb_func_start script_env_2_run_current_script +script_env_2_run_current_script: @ 8098EBC + push {r4,lr} + ldr r4, =0x03000e38 + ldrb r0, [r4] + cmp r0, 0x2 + beq _08098EF0 + cmp r0, 0x1 + beq _08098EF0 + bl script_env_2_enable + ldr r0, =0x03000e40 + bl script_main_handler + lsls r0, 24 + cmp r0, 0 + beq _08098EE8 + movs r0, 0x1 + b _08098EF2 + .pool +_08098EE8: + movs r0, 0x2 + strb r0, [r4] + bl script_env_2_disable +_08098EF0: + movs r0, 0 +_08098EF2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end script_env_2_run_current_script + + thumb_func_start script_env_1_execute_new_script +script_env_1_execute_new_script: @ 8098EF8 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x03000e40 + ldr r1, =gEventScriptCommandFunctionTable + ldr r2, =gUnknown_081DBA08 + adds r0, r4, 0 + bl script_env_init + adds r0, r4, 0 + adds r1, r5, 0 + bl script_setup_bytecode_script + bl script_env_2_enable + ldr r1, =0x03000e38 + movs r0, 0 + strb r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end script_env_1_execute_new_script + + thumb_func_start script_env_2_set_ctx_paused +script_env_2_set_ctx_paused: @ 8098F30 + ldr r1, =0x03000e38 + movs r0, 0x1 + strb r0, [r1] + bx lr + .pool + thumb_func_end script_env_2_set_ctx_paused + + thumb_func_start script_env_2_enable_and_set_ctx_running +script_env_2_enable_and_set_ctx_running: @ 8098F3C + push {lr} + ldr r1, =0x03000e38 + movs r0, 0 + strb r0, [r1] + bl script_env_2_enable + pop {r0} + bx r0 + .pool + thumb_func_end script_env_2_enable_and_set_ctx_running + + thumb_func_start script_env_2_execute_new_script +@ void script_env_2_execute_new_script(void *script_ptr) +script_env_2_execute_new_script: @ 8098F50 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x03000eb8 + ldr r1, =gEventScriptCommandFunctionTable + ldr r2, =gUnknown_081DBA08 + adds r0, r4, 0 + bl script_env_init + adds r0, r4, 0 + adds r1, r5, 0 + bl script_setup_bytecode_script +_08098F68: + ldr r0, =0x03000eb8 + bl script_main_handler + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08098F68 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end script_env_2_execute_new_script + + thumb_func_start mapheader_get_tagged_pointer +mapheader_get_tagged_pointer: @ 8098F88 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, =0x02037318 + ldr r2, [r0, 0x8] + cmp r2, 0 + beq _08098F9C +_08098F96: + ldrb r0, [r2] + cmp r0, 0 + bne _08098FA4 +_08098F9C: + movs r0, 0 + b _08098FC2 + .pool +_08098FA4: + cmp r0, r1 + beq _08098FAC + adds r2, 0x5 + b _08098F96 +_08098FAC: + adds r2, 0x1 + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + lsls r1, 8 + adds r0, r1 + ldrb r1, [r2, 0x2] + lsls r1, 16 + adds r0, r1 + ldrb r1, [r2, 0x3] + lsls r1, 24 + adds r0, r1 +_08098FC2: + pop {r1} + bx r1 + thumb_func_end mapheader_get_tagged_pointer + + thumb_func_start mapheader_run_script_by_tag +mapheader_run_script_by_tag: @ 8098FC8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl mapheader_get_tagged_pointer + cmp r0, 0 + beq _08098FDA + bl script_env_2_execute_new_script +_08098FDA: + pop {r0} + bx r0 + thumb_func_end mapheader_run_script_by_tag + + thumb_func_start mapheader_get_first_match_from_tagged_ptr_list +@ int mapheader_get_first_match_from_tagged_ptr_list(int tag) +mapheader_get_first_match_from_tagged_ptr_list: @ 8098FE0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + bl mapheader_get_tagged_pointer + adds r6, r0, 0 + cmp r6, 0 + beq _08098FFC +_08098FF0: + ldrb r1, [r6] + ldrb r0, [r6, 0x1] + lsls r0, 8 + orrs r1, r0 + cmp r1, 0 + bne _08099000 +_08098FFC: + movs r0, 0 + b _0809903A +_08099000: + adds r6, 0x2 + ldrb r5, [r6] + ldrb r0, [r6, 0x1] + lsls r0, 8 + orrs r5, r0 + adds r6, 0x2 + adds r0, r1, 0 + bl VarGet + adds r4, r0, 0 + adds r0, r5, 0 + bl VarGet + lsls r4, 16 + lsls r0, 16 + cmp r4, r0 + beq _08099026 + adds r6, 0x4 + b _08098FF0 +_08099026: + ldrb r0, [r6] + ldrb r1, [r6, 0x1] + lsls r1, 8 + adds r0, r1 + ldrb r1, [r6, 0x2] + lsls r1, 16 + adds r0, r1 + ldrb r1, [r6, 0x3] + lsls r1, 24 + adds r0, r1 +_0809903A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end mapheader_get_first_match_from_tagged_ptr_list + + thumb_func_start mapheader_run_script_with_tag_x1 +mapheader_run_script_with_tag_x1: @ 8099040 + push {lr} + movs r0, 0x1 + bl mapheader_run_script_by_tag + pop {r0} + bx r0 + thumb_func_end mapheader_run_script_with_tag_x1 + + thumb_func_start mapheader_run_script_with_tag_x3 +mapheader_run_script_with_tag_x3: @ 809904C + push {lr} + movs r0, 0x3 + bl mapheader_run_script_by_tag + pop {r0} + bx r0 + thumb_func_end mapheader_run_script_with_tag_x3 + + thumb_func_start mapheader_run_script_with_tag_x5 +mapheader_run_script_with_tag_x5: @ 8099058 + push {lr} + movs r0, 0x5 + bl mapheader_run_script_by_tag + pop {r0} + bx r0 + thumb_func_end mapheader_run_script_with_tag_x5 + + thumb_func_start mapheader_run_script_with_tag_x7 +mapheader_run_script_with_tag_x7: @ 8099064 + push {lr} + movs r0, 0x7 + bl mapheader_run_script_by_tag + pop {r0} + bx r0 + thumb_func_end mapheader_run_script_with_tag_x7 + + thumb_func_start mapheader_run_script_with_tag_x6 +mapheader_run_script_with_tag_x6: @ 8099070 + push {lr} + movs r0, 0x6 + bl mapheader_run_script_by_tag + pop {r0} + bx r0 + thumb_func_end mapheader_run_script_with_tag_x6 + + thumb_func_start mapheader_run_first_tag2_script_list_match +@ int mapheader_run_first_tag2_script_list_match() +mapheader_run_first_tag2_script_list_match: @ 809907C + push {lr} + movs r0, 0x2 + bl mapheader_get_first_match_from_tagged_ptr_list + cmp r0, 0 + beq _08099090 + bl script_env_1_execute_new_script + movs r0, 0x1 + b _08099092 +_08099090: + movs r0, 0 +_08099092: + pop {r1} + bx r1 + thumb_func_end mapheader_run_first_tag2_script_list_match + + thumb_func_start mapheader_run_first_tag4_script_list_match +@ void mapheader_run_first_tag4_script_list_match() +mapheader_run_first_tag4_script_list_match: @ 8099098 + push {lr} + movs r0, 0x4 + bl mapheader_get_first_match_from_tagged_ptr_list + cmp r0, 0 + beq _080990A8 + bl script_env_2_execute_new_script +_080990A8: + pop {r0} + bx r0 + thumb_func_end mapheader_run_first_tag4_script_list_match + + thumb_func_start sub_80990AC +sub_80990AC: @ 80990AC + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x0000372c + adds r0, r1 + movs r1, 0xFA + lsls r1, 2 + bl sub_806F928 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80990AC + + thumb_func_start killram +killram: @ 80990D0 + push {lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x00003728 + adds r1, r0 + ldr r2, =0x050000fb + mov r0, sp + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end killram + + thumb_func_start sub_80990FC +sub_80990FC: @ 80990FC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + str r0, [sp] + ldr r0, [sp, 0x24] + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r7, r3, 24 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x03005d8c + mov r10, r0 + ldr r5, [r0] + ldr r1, =0x0000372c + adds r4, r5, r1 + bl killram + ldr r0, =0x000003e3 + cmp r8, r0 + bhi _08099174 + movs r0, 0x33 + strb r0, [r4] + mov r2, r9 + strb r2, [r4, 0x1] + strb r7, [r4, 0x2] + strb r6, [r4, 0x3] + ldr r1, =0x00003730 + adds r0, r5, r1 + ldr r1, [sp] + mov r2, r8 + bl memcpy + bl sub_80990AC + mov r2, r10 + ldr r1, [r2] + ldr r2, =0x00003728 + adds r1, r2 + str r0, [r1] + movs r0, 0x1 + b _08099176 + .pool +_08099174: + movs r0, 0 +_08099176: + 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_80990FC + + thumb_func_start sub_8099188 +@ u32 sub_8099188(u8 a1, u32 script) +sub_8099188: @ 8099188 + push {r4-r7,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r3, r0, 24 + ldr r6, =0x03005d8c + ldr r5, [r6] + ldr r0, =0x0000372c + adds r2, r5, r0 + ldr r7, =0x020375c0 + movs r0, 0 + str r0, [r7] + ldrb r0, [r2] + cmp r0, 0x33 + bne _080991F0 + ldrb r1, [r2, 0x1] + movs r0, 0x4 + ldrsb r0, [r5, r0] + cmp r1, r0 + bne _080991F0 + ldrb r1, [r2, 0x2] + movs r0, 0x5 + ldrsb r0, [r5, r0] + cmp r1, r0 + bne _080991F0 + ldrb r0, [r2, 0x3] + cmp r0, r3 + bne _080991F0 + bl sub_80990AC + ldr r1, [r6] + ldr r2, =0x00003728 + adds r1, r2 + ldr r1, [r1] + cmp r0, r1 + bne _080991EC + str r4, [r7] + ldr r1, =0x00003730 + adds r0, r5, r1 + b _080991F2 + .pool +_080991EC: + bl killram +_080991F0: + adds r0, r4, 0 +_080991F2: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8099188 + + thumb_func_start sub_80991F8 +sub_80991F8: @ 80991F8 + push {r4,lr} + ldr r4, =0x03005d8c + ldr r0, [r4] + ldr r2, =0x0000372c + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x33 + bne _0809923C + ldrb r0, [r1, 0x1] + cmp r0, 0xFF + bne _0809923C + ldrb r0, [r1, 0x2] + cmp r0, 0xFF + bne _0809923C + ldrb r0, [r1, 0x3] + cmp r0, 0xFF + bne _0809923C + bl sub_80990AC + ldr r1, [r4] + ldr r2, =0x00003728 + adds r1, r2 + ldr r1, [r1] + cmp r0, r1 + bne _0809923C + movs r0, 0x1 + b _0809923E + .pool +_0809923C: + movs r0, 0 +_0809923E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80991F8 + + thumb_func_start sub_8099244 +sub_8099244: @ 8099244 + push {r4-r6,lr} + ldr r6, =0x03005d8c + ldr r5, [r6] + ldr r0, =0x0000372c + adds r4, r5, r0 + bl sub_801B27C + cmp r0, 0 + beq _08099298 + ldrb r0, [r4] + cmp r0, 0x33 + bne _08099298 + ldrb r0, [r4, 0x1] + cmp r0, 0xFF + bne _08099298 + ldrb r0, [r4, 0x2] + cmp r0, 0xFF + bne _08099298 + ldrb r0, [r4, 0x3] + cmp r0, 0xFF + bne _08099298 + bl sub_80990AC + ldr r1, [r6] + ldr r2, =0x00003728 + adds r1, r2 + ldr r1, [r1] + cmp r0, r1 + bne _08099294 + ldr r1, =0x00003730 + adds r0, r5, r1 + b _0809929A + .pool +_08099294: + bl killram +_08099298: + movs r0, 0 +_0809929A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8099244 + + thumb_func_start sub_80992A0 +sub_80992A0: @ 80992A0 + push {lr} + sub sp, 0x4 + adds r2, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r0, =0x000003e3 + cmp r1, r0 + bls _080992B2 + adds r1, r0, 0 +_080992B2: + movs r0, 0xFF + str r0, [sp] + adds r0, r2, 0 + movs r2, 0xFF + movs r3, 0xFF + bl sub_80990FC + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80992A0 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/script_menu.s b/asm/script_menu.s new file mode 100644 index 000000000..370c5718d --- /dev/null +++ b/asm/script_menu.s @@ -0,0 +1,1883 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start Multichoice +@ bool8 Multichoice(u8 x, u8 y, u8 menuId, bool8 noCancelling) +Multichoice: @ 80E1E08 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + lsls r3, 24 + lsrs r4, r3, 24 + ldr r0, =sub_80E2058 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080E1E4C + ldr r0, =0x020375f0 + movs r1, 0xFF + strh r1, [r0] + movs r0, 0 + str r0, [sp] + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl DoMultichoice + movs r0, 0x1 + b _080E1E4E + .pool +_080E1E4C: + movs r0, 0 +_080E1E4E: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end Multichoice + + thumb_func_start sub_80E1E58 +sub_80E1E58: @ 80E1E58 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + ldr r4, [sp, 0x1C] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + lsls r3, 24 + lsrs r5, r3, 24 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =sub_80E2058 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080E1EA8 + ldr r1, =0x020375f0 + movs r0, 0xFF + strh r0, [r1] + str r4, [sp] + mov r0, r8 + adds r1, r7, 0 + adds r2, r6, 0 + adds r3, r5, 0 + bl DoMultichoice + movs r0, 0x1 + b _080E1EAA + .pool +_080E1EA8: + movs r0, 0 +_080E1EAA: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80E1E58 + + thumb_func_start sub_80E1EB8 +sub_80E1EB8: @ 80E1EB8 + push {r4,r5,lr} + adds r4, r0, 0 + movs r5, 0 + b _080E1EEC +_080E1EC0: + cmp r1, 0xFD + bne _080E1EE4 + adds r4, 0x1 + ldrb r0, [r4] + cmp r0, 0x1 + bne _080E1EEC + ldr r0, =0x03005d90 + ldr r0, [r0] + bl GetStringLength + adds r0, r5, r0 + lsls r0, 16 + lsrs r5, r0, 16 + adds r4, 0x1 + b _080E1EEC + .pool +_080E1EE4: + adds r4, 0x1 + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_080E1EEC: + ldrb r1, [r4] + adds r0, r1, 0 + cmp r0, 0xFF + bne _080E1EC0 + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80E1EB8 + + thumb_func_start DoMultichoice +@ void DoMultichoice(u8 x, u8 y, u8 menuId, bool8 noCancelling) +DoMultichoice: @ 80E1EFC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r4, [sp, 0x28] + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp] + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x4] + ldr r1, =gUnknown_0858B760 + lsls r0, r2, 3 + adds r0, r1 + ldrb r6, [r0, 0x4] + ldr r0, [r0] + mov r8, r0 + movs r1, 0 + cmp r1, r6 + bge _080E1F4C + mov r5, r8 + adds r4, r6, 0 +_080E1F3C: + ldr r0, [r5] + bl display_text_and_get_width + adds r1, r0, 0 + adds r5, 0x8 + subs r4, 0x1 + cmp r4, 0 + bne _080E1F3C +_080E1F4C: + adds r0, r1, 0 + bl convert_pixel_width_to_tile_width + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_80E2D5C + lsls r0, 24 + lsrs r7, r0, 24 + lsls r3, r6, 25 + lsrs r3, 24 + adds r0, r7, 0 + mov r1, r9 + adds r2, r4, 0 + bl CreateWindowFromRect + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl SetStandardWindowBorderStyle + adds r0, r4, 0 + adds r1, r6, 0 + mov r2, r8 + bl PrintMenuTable + adds r0, r4, 0 + adds r1, r6, 0 + ldr r2, [sp, 0x4] + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, [sp] + adds r1, r6, 0 + adds r2, r4, 0 + mov r3, r10 + bl sub_80E1FBC + 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 DoMultichoice + + thumb_func_start sub_80E1FBC +sub_80E1FBC: @ 80E1FBC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r4, r3, 24 + ldr r1, =0x02039f90 + movs r0, 0x2 + strb r0, [r1] + movs r2, 0 + ldr r6, =sub_80E2058 + ldr r5, =gUnknown_0858BB68 + movs r3, 0xC +_080E1FE6: + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, r4 + bne _080E1FF0 + strb r3, [r1] +_080E1FF0: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x5 + bls _080E1FE6 + adds r0, r6, 0 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r1 + mov r0, r8 + strh r0, [r1, 0x10] + cmp r7, 0x3 + bls _080E202C + movs r0, 0x1 + b _080E202E + .pool +_080E202C: + movs r0, 0 +_080E202E: + strh r0, [r1, 0x12] + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + mov r1, r9 + strh r1, [r0, 0x14] + strh r4, [r0, 0x16] + adds r0, r4, 0 + bl sub_80E2A94 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E1FBC + + thumb_func_start sub_80E2058 +sub_80E2058: @ 80E2058 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080E20FC + ldr r1, =0x02039f90 + ldrb r0, [r1] + cmp r0, 0 + beq _080E2090 + subs r0, 0x1 + strb r0, [r1] + b _080E20FC + .pool +_080E2090: + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _080E209E + bl ProcessMenuInputNoWrapAround + b _080E20A2 +_080E209E: + bl ProcessMenuInput +_080E20A2: + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0 + beq _080E20B8 + ldrb r0, [r5, 0xE] + bl sub_80E2A94 +_080E20B8: + lsls r0, r4, 24 + asrs r1, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _080E20FC + adds r0, 0x1 + cmp r1, r0 + bne _080E20E8 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _080E20FC + movs r0, 0x5 + bl audio_play + ldr r1, =0x020375f0 + movs r0, 0x7F + strh r0, [r1] + b _080E20EC + .pool +_080E20E8: + ldr r0, =0x020375f0 + strh r1, [r0] +_080E20EC: + ldrb r0, [r5, 0xC] + bl sub_80E2A78 + adds r0, r6, 0 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running +_080E20FC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E2058 + + thumb_func_start yes_no_box +yes_no_box: @ 80E2108 + push {r4,lr} + ldr r4, =task_yes_no_maybe + adds r0, r4, 0 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080E2138 + ldr r1, =0x020375f0 + movs r0, 0xFF + strh r0, [r1] + bl sub_8197930 + adds r0, r4, 0 + movs r1, 0x50 + bl CreateTask + movs r0, 0x1 + b _080E213A + .pool +_080E2138: + movs r0, 0 +_080E213A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end yes_no_box + + thumb_func_start sub_80E2140 +sub_80E2140: @ 80E2140 + push {lr} + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0xFF + beq _080E2154 + movs r0, 0x1 + b _080E2156 + .pool +_080E2154: + movs r0, 0 +_080E2156: + pop {r1} + bx r1 + thumb_func_end sub_80E2140 + + thumb_func_start task_yes_no_maybe +task_yes_no_maybe: @ 80E215C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + ldrh r2, [r1, 0xC] + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r0, 0x4 + bgt _080E2180 + adds r0, r2, 0x1 + strh r0, [r1, 0xC] + b _080E21C4 + .pool +_080E2180: + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080E21A4 + cmp r1, r0 + bgt _080E219C + subs r0, 0x1 + cmp r1, r0 + beq _080E21C4 + b _080E21BA +_080E219C: + cmp r1, 0 + beq _080E21B4 + cmp r1, 0x1 + bne _080E21BA +_080E21A4: + movs r0, 0x5 + bl audio_play + ldr r1, =0x020375f0 + movs r0, 0 + b _080E21B8 + .pool +_080E21B4: + ldr r1, =0x020375f0 + movs r0, 0x1 +_080E21B8: + strh r0, [r1] +_080E21BA: + adds r0, r4, 0 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running +_080E21C4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task_yes_no_maybe + + thumb_func_start sub_80E21D0 +sub_80E21D0: @ 80E21D0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + ldr r4, [sp, 0x30] + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x4] + lsls r2, 24 + lsrs r5, r2, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x8] + lsls r4, 24 + lsrs r4, 24 + mov r10, r4 + ldr r0, =sub_80E2308 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E2210 + movs r0, 0 + b _080E22E8 + .pool +_080E2210: + ldr r0, =0x020375f0 + movs r1, 0xFF + strh r1, [r0] + movs r2, 0 + movs r6, 0 + ldr r1, =gUnknown_0858B760 + lsls r5, 3 + adds r0, r5, r1 + str r5, [sp, 0xC] + ldrb r0, [r0, 0x4] + cmp r2, r0 + bge _080E2246 + mov r8, r1 +_080E222A: + mov r0, r8 + adds r4, r5, r0 + ldr r1, [r4] + lsls r0, r6, 3 + adds r0, r1 + ldr r0, [r0] + adds r1, r2, 0 + bl display_text_and_get_width + adds r2, r0, 0 + adds r6, 0x1 + ldrb r4, [r4, 0x4] + cmp r6, r4 + blt _080E222A +_080E2246: + adds r0, r2, 0 + bl convert_pixel_width_to_tile_width + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + mov r1, r10 + muls r1, r5 + mov r8, r1 + adds r0, r7, 0 + bl sub_80E2D5C + lsls r0, 24 + lsrs r7, r0, 24 + ldr r2, =gUnknown_0858B760 + mov r9, r2 + ldr r0, [sp, 0xC] + add r9, r0 + mov r1, r9 + ldrb r0, [r1, 0x4] + mov r1, r10 + bl __udivsi3 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r0, =sub_80E2308 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + mov r2, sp + ldrh r2, [r2, 0x8] + strh r2, [r4, 0x10] + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r3, r6, 25 + lsrs r3, 24 + adds r0, r7, 0 + ldr r1, [sp, 0x4] + mov r2, r8 + bl CreateWindowFromRect + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x14] + movs r1, 0 + bl SetStandardWindowBorderStyle + ldrb r0, [r4, 0x14] + lsls r5, 27 + lsrs r5, 24 + mov r2, r9 + ldr r1, [r2] + str r1, [sp] + adds r1, r5, 0 + mov r2, r10 + adds r3, r6, 0 + bl sub_81997AC + ldrb r0, [r4, 0x14] + movs r1, 0 + str r1, [sp] + adds r1, r5, 0 + mov r2, r10 + adds r3, r6, 0 + bl sub_8199944 + ldrb r0, [r4, 0x14] + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0x1 +_080E22E8: + 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_80E21D0 + + thumb_func_start sub_80E2308 +sub_80E2308: @ 80E2308 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + bl sub_8199334 + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _080E2360 + adds r0, 0x1 + cmp r1, r0 + bne _080E234C + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _080E2360 + movs r0, 0x5 + bl audio_play + ldr r1, =0x020375f0 + movs r0, 0x7F + strh r0, [r1] + b _080E2350 + .pool +_080E234C: + ldr r0, =0x020375f0 + strh r1, [r0] +_080E2350: + ldrb r0, [r5, 0xC] + bl sub_80E2A78 + adds r0, r4, 0 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running +_080E2360: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E2308 + + thumb_func_start sp109_CreatePCMenu +@ bool sp109_CreatePCMenu() +sp109_CreatePCMenu: @ 80E236C + push {lr} + ldr r0, =sub_80E2058 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080E2394 + ldr r1, =0x020375f0 + movs r0, 0xFF + strh r0, [r1] + bl CreatePCMenu + movs r0, 0x1 + b _080E2396 + .pool +_080E2394: + movs r0, 0 +_080E2396: + pop {r1} + bx r1 + thumb_func_end sp109_CreatePCMenu + + thumb_func_start CreatePCMenu +CreatePCMenu: @ 80E239C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + movs r7, 0x8 + movs r5, 0 + movs r4, 0 + ldr r6, =gUnknown_0858BB70 +_080E23AC: + ldm r6!, {r0} + adds r1, r5, 0 + bl display_text_and_get_width + adds r5, r0, 0 + adds r4, 0x1 + cmp r4, 0x3 + bls _080E23AC + ldr r6, =0x00000864 + adds r0, r6, 0 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _080E23D4 + ldr r0, =gUnknown_085EB18B + adds r1, r5, 0 + bl display_text_and_get_width + adds r5, r0, 0 +_080E23D4: + adds r0, r5, 0 + bl convert_pixel_width_to_tile_width + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r6, 0 + bl FlagGet + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _080E2448 + movs r0, 0x4 + mov r8, r0 + movs r0, 0 + movs r1, 0 + adds r2, r4, 0 + movs r3, 0x8 + bl CreateWindowFromRect + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r6, 0 + movs r1, 0 + bl SetStandardWindowBorderStyle + ldr r2, =gUnknown_085EB18B + movs r0, 0x21 + str r0, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r4, 0 + str r4, [sp, 0x8] + adds r0, r6, 0 + movs r1, 0x1 + adds r3, r7, 0 + bl Print + ldr r2, =gUnknown_085EB198 + movs r0, 0x31 + str r0, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + adds r0, r6, 0 + movs r1, 0x1 + adds r3, r7, 0 + bl Print + b _080E247A + .pool +_080E2448: + movs r0, 0x3 + mov r8, r0 + movs r0, 0 + movs r1, 0 + adds r2, r4, 0 + movs r3, 0x6 + bl CreateWindowFromRect + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r6, 0 + movs r1, 0 + bl SetStandardWindowBorderStyle + ldr r2, =gUnknown_085EB198 + movs r0, 0x21 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + str r5, [sp, 0x8] + adds r0, r6, 0 + movs r1, 0x1 + adds r3, r7, 0 + bl Print +_080E247A: + ldr r0, =0x000008ab + bl FlagGet + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _080E24B0 + ldr r2, =gUnknown_085EB176 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r6, 0 + movs r1, 0x1 + adds r3, r7, 0 + bl Print + b _080E24C6 + .pool +_080E24B0: + ldr r2, =gUnknown_085EB169 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + str r1, [sp, 0x8] + adds r0, r6, 0 + movs r1, 0x1 + adds r3, r7, 0 + bl Print +_080E24C6: + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EB183 + adds r0, r4, 0 + bl ExpandStringRefs + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r7, 0 + movs r3, 0x11 + bl sub_819A024 + adds r0, r6, 0 + mov r1, r8 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + adds r0, r6, 0 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0 + mov r1, r8 + adds r2, r6, 0 + movs r3, 0x1 + bl sub_80E1FBC + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end CreatePCMenu + + thumb_func_start sub_80E2514 +sub_80E2514: @ 80E2514 + push {lr} + sub sp, 0x10 + movs r0, 0 + movs r1, 0x1 + bl sub_819786C + ldr r2, =gUnknown_0827266F + 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, 0 + movs r1, 0x1 + movs r3, 0 + bl AddTextPrinterParametrized + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E2514 + + thumb_func_start sub_80E2548 +sub_80E2548: @ 80E2548 + push {lr} + ldr r0, =sub_80E2058 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080E2570 + ldr r1, =0x020375f0 + movs r0, 0xFF + strh r0, [r1] + bl sub_80E2578 + movs r0, 0x1 + b _080E2572 + .pool +_080E2570: + movs r0, 0 +_080E2572: + pop {r1} + bx r1 + thumb_func_end sub_80E2548 + + thumb_func_start sub_80E2578 +sub_80E2578: @ 80E2578 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + movs r5, 0 + movs r4, 0 + ldr r3, =0x03001124 + movs r2, 0xFF +_080E258A: + adds r0, r4, r3 + ldrb r1, [r0] + orrs r1, r2 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _080E258A + movs r0, 0x1 + movs r1, 0 + bl GetFontAttribute + ldr r0, =0x020375e0 + ldrh r1, [r0] + cmp r1, 0 + bne _080E25D2 + ldr r4, =0x03001124 + adds r0, r5, r4 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0xE8 + lsls r0, 1 + bl FlagGet + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + bne _080E25D2 + adds r0, r5, r4 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080E25D2: + ldr r0, =0x00000113 + movs r1, 0x1 + bl sub_80D6724 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E2630 + ldr r0, =0x000008b3 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E2630 + ldr r2, =0x020375e0 + ldrh r0, [r2] + cmp r0, 0 + bne _080E2606 + ldr r0, =0x03001124 + adds r0, r5, r0 + movs r1, 0x2 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080E2606: + ldrh r0, [r2] + cmp r0, 0x1 + bne _080E2630 + movs r4, 0xD7 + lsls r4, 1 + adds r0, r4, 0 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _080E2630 + ldr r0, =0x03001124 + adds r0, r5, r0 + movs r1, 0x2 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + bl FlagSet +_080E2630: + movs r0, 0xB9 + lsls r0, 1 + movs r1, 0x1 + bl sub_80D6724 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E2690 + movs r0, 0x8E + lsls r0, 4 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E2690 + ldr r2, =0x020375e0 + ldrh r0, [r2] + cmp r0, 0 + bne _080E2668 + ldr r0, =0x03001124 + adds r0, r5, r0 + movs r1, 0x3 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080E2668: + ldrh r0, [r2] + cmp r0, 0x1 + bne _080E2690 + ldr r4, =0x000001db + adds r0, r4, 0 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _080E2690 + ldr r0, =0x03001124 + adds r0, r5, r0 + movs r1, 0x3 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + bl FlagSet +_080E2690: + ldr r0, =0x00000173 + movs r1, 0x1 + bl sub_80D6724 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E26EC + ldr r0, =0x000008d5 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E26EC + ldr r2, =0x020375e0 + ldrh r0, [r2] + cmp r0, 0 + bne _080E26C4 + ldr r0, =0x03001124 + adds r0, r5, r0 + movs r1, 0x4 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080E26C4: + ldrh r0, [r2] + cmp r0, 0x1 + bne _080E26EC + ldr r4, =0x000001af + adds r0, r4, 0 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _080E26EC + ldr r0, =0x03001124 + adds r0, r5, r0 + movs r1, 0x4 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + bl FlagSet +_080E26EC: + movs r0, 0xBC + lsls r0, 1 + movs r1, 0x1 + bl sub_80D6724 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E274C + ldr r0, =0x000008d6 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E274C + ldr r2, =0x020375e0 + ldrh r0, [r2] + cmp r0, 0 + bne _080E2722 + ldr r0, =0x03001124 + adds r0, r5, r0 + movs r1, 0x5 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080E2722: + ldrh r0, [r2] + cmp r0, 0x1 + bne _080E274C + movs r4, 0xD8 + lsls r4, 1 + adds r0, r4, 0 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _080E274C + ldr r0, =0x03001124 + adds r0, r5, r0 + movs r1, 0x5 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + bl FlagSet +_080E274C: + ldr r0, =0x03001124 + adds r0, r5, r0 + movs r1, 0x6 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0 + bne _080E276E + movs r0, 0xE8 + lsls r0, 1 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 +_080E276E: + adds r7, r5, 0 + cmp r7, 0x7 + bne _080E27A4 + ldr r1, =0x020375e0 + movs r0, 0xB + strh r0, [r1] + bl sub_813A128 + b _080E2860 + .pool +_080E27A4: + movs r1, 0 + movs r4, 0 + lsls r6, r7, 25 + subs r0, r7, 0x1 + mov r9, r0 + ldr r5, =gUnknown_0858BB80 +_080E27B0: + ldr r0, =0x03001124 + adds r0, r4, r0 + ldrb r0, [r0] + cmp r0, 0xFF + beq _080E27C6 + lsls r0, 2 + adds r0, r5 + ldr r0, [r0] + bl display_text_and_get_width + adds r1, r0, 0 +_080E27C6: + adds r4, 0x1 + cmp r4, 0x6 + bls _080E27B0 + adds r0, r1, 0 + bl convert_pixel_width_to_tile_width + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x1C + subs r0, r2 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x6 + subs r1, r7 + lsls r1, 25 + lsrs r1, 24 + lsrs r3, r6, 24 + bl CreateWindowFromRect + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r6, 0 + movs r1, 0 + bl SetStandardWindowBorderStyle + movs r5, 0 + movs r4, 0 + ldr r0, =gUnknown_0858BB80 + mov r8, r0 +_080E2802: + ldr r0, =0x03001124 + adds r1, r4, r0 + ldrb r0, [r1] + cmp r0, 0xFF + beq _080E2834 + lsls r0, 2 + add r0, r8 + ldr 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 + movs r1, 0x1 + movs r3, 0x8 + bl Print + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080E2834: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _080E2802 + mov r0, r9 + lsls r2, r0, 24 + lsrs r2, 24 + adds r0, r6, 0 + adds r1, r7, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + adds r0, r6, 0 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0 + adds r1, r7, 0 + adds r2, r6, 0 + movs r3, 0x8 + bl sub_80E1FBC +_080E2860: + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E2578 + + thumb_func_start sub_80E2878 +sub_80E2878: @ 80E2878 + push {lr} + ldr r2, =0x020375f0 + ldrh r0, [r2] + cmp r0, 0x7F + beq _080E288C + ldr r0, =0x03001124 + ldrh r1, [r2] + adds r1, r0 + ldrb r0, [r1] + strh r0, [r2] +_080E288C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E2878 + + thumb_func_start task_picbox +task_picbox: @ 80E2898 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080E28F8 + cmp r0, 0x1 + bgt _080E28C0 + cmp r0, 0 + beq _080E28DE + b _080E28F8 + .pool +_080E28C0: + cmp r0, 0x2 + beq _080E28CA + cmp r0, 0x3 + beq _080E28EC + b _080E28F8 +_080E28CA: + movs r0, 0xC + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + ldrb r1, [r4, 0xC] + bl sub_80B6070 +_080E28DE: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080E28F8 + .pool +_080E28EC: + ldrb r0, [r4, 0x12] + bl sub_80E2A78 + adds r0, r5, 0 + bl DestroyTask +_080E28F8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task_picbox + + thumb_func_start sub_80E2900 +sub_80E2900: @ 80E2900 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r4, =task_picbox + adds r0, r4, 0 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _080E29B8 + lsls r1, r7, 19 + movs r0, 0xA0 + lsls r0, 14 + adds r1, r0 + asrs r1, 16 + lsls r2, r6, 19 + adds r2, r0 + asrs r2, 16 + mov r0, r8 + movs r3, 0 + bl sub_80B5F84 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r4, 0 + movs r1, 0x50 + bl CreateTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r7, 0 + adds r1, r6, 0 + movs r2, 0x8 + movs r3, 0x8 + bl CreateWindowFromRect + ldr r1, =0x03005e00 + lsls r3, r4, 2 + adds r3, r4 + lsls r3, 3 + adds r3, r1 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + strh r0, [r3, 0x12] + strh r1, [r3, 0x8] + mov r0, r8 + strh r0, [r3, 0xA] + strh r5, [r3, 0xC] + ldr r4, =0x02020630 + lsls r1, r5, 4 + adds r1, r5 + lsls r1, 2 + adds r0, r4, 0 + adds r0, 0x1C + adds r0, r1, r0 + ldr r2, =DummyObjectCallback + str r2, [r0] + adds r1, r4 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] + ldrb r0, [r3, 0x12] + movs r1, 0x1 + bl SetStandardWindowBorderStyle + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + b _080E29BA + .pool +_080E29B8: + movs r0, 0 +_080E29BA: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80E2900 + + thumb_func_start picbox_close +picbox_close: @ 80E29C4 + push {lr} + ldr r0, =task_picbox + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _080E29F4 + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + ldr r0, =sub_80E29FC + b _080E29F6 + .pool +_080E29F4: + movs r0, 0 +_080E29F6: + pop {r1} + bx r1 + thumb_func_end picbox_close + + thumb_func_start sub_80E29FC +sub_80E29FC: @ 80E29FC + push {lr} + ldr r0, =task_picbox + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _080E2A14 + movs r0, 0 + b _080E2A16 + .pool +_080E2A14: + movs r0, 0x1 +_080E2A16: + pop {r1} + bx r1 + thumb_func_end sub_80E29FC + + thumb_func_start CreateWindowFromRect +CreateWindowFromRect: @ 80E2A1C + 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 + add sp, 0x20 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end CreateWindowFromRect + + thumb_func_start sub_80E2A78 +sub_80E2A78: @ 80E2A78 + 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_80E2A78 + + thumb_func_start sub_80E2A94 +sub_80E2A94: @ 80E2A94 + push {r4,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x4A + cmp r0, 0x5 + bhi _080E2B70 + lsls r0, 2 + ldr r1, =_080E2AB0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080E2AB0: + .4byte _080E2B40 + .4byte _080E2B08 + .4byte _080E2AD8 + .4byte _080E2AC8 + .4byte _080E2AE8 + .4byte _080E2AF8 +_080E2AC8: + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r4, =gUnknown_0858BBAC + b _080E2B12 + .pool +_080E2AD8: + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r4, =gUnknown_0858BB9C + b _080E2B12 + .pool +_080E2AE8: + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r4, =gUnknown_0858BBBC + b _080E2B12 + .pool +_080E2AF8: + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r4, =gUnknown_0858BBCC + b _080E2B12 + .pool +_080E2B08: + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r4, =gUnknown_0858BBEC +_080E2B12: + bl GetMenuCursorPos + lsls r0, 24 + lsrs r0, 22 + adds r0, r4 + ldr r2, [r0] + 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, 0 + movs r1, 0x1 + movs r3, 0 + bl AddTextPrinterParametrized + b _080E2B70 + .pool +_080E2B40: + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r4, =gUnknown_0858BBE0 + bl GetMenuCursorPos + lsls r0, 24 + lsrs r0, 22 + adds r0, r4 + ldr r2, [r0] + 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, 0 + movs r1, 0x1 + movs r3, 0 + bl AddTextPrinterParametrized +_080E2B70: + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E2A94 + + thumb_func_start sp106_CreateStartMenu +sp106_CreateStartMenu: @ 80E2B7C + push {lr} + ldr r0, =sub_80E2058 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080E2BA4 + ldr r1, =0x020375f0 + movs r0, 0xFF + strh r0, [r1] + bl CreateStartMenu + movs r0, 0x1 + b _080E2BA6 + .pool +_080E2BA4: + movs r0, 0 +_080E2BA6: + pop {r1} + bx r1 + thumb_func_end sp106_CreateStartMenu + + thumb_func_start CreateStartMenu +CreateStartMenu: @ 80E2BAC + push {r4-r6,lr} + sub sp, 0xC + movs r0, 0x15 + movs r1, 0 + movs r2, 0x7 + movs r3, 0x12 + bl CreateWindowFromRect + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + movs r1, 0 + bl SetStandardWindowBorderStyle + ldr r2, =gUnknown_085EB25C + movs r0, 0x9 + str r0, [sp] + movs r5, 0xFF + str r5, [sp, 0x4] + movs r6, 0 + str r6, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldr r2, =gUnknown_085EB264 + movs r0, 0x19 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldr r2, =gUnknown_085EB26C + movs r0, 0x29 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldr r2, =gUnknown_085EB270 + movs r0, 0x39 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldr r0, =0x03005d90 + ldr r2, [r0] + movs r0, 0x49 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldr r2, =gUnknown_085EB279 + movs r0, 0x59 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldr r2, =gUnknown_085EB27E + movs r0, 0x69 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldr r2, =gUnknown_085EB285 + movs r0, 0x79 + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r3, 0x8 + bl Print + movs r0, 0x10 + str r0, [sp] + movs r0, 0x8 + str r0, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x9 + bl sub_81983AC + movs r0, 0 + movs r1, 0x8 + adds r2, r4, 0 + movs r3, 0x56 + bl sub_80E2CC4 + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end CreateStartMenu + + thumb_func_start sub_80E2CC4 +sub_80E2CC4: @ 80E2CC4 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r2, 0 + adds r6, r3, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + lsls r6, 24 + lsrs r6, 24 + ldr r1, =0x02039f90 + movs r0, 0x2 + strb r0, [r1] + ldr r0, =sub_80E2058 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r4, [r1, 0x10] + strh r0, [r1, 0x12] + strh r5, [r1, 0x14] + strh r6, [r1, 0x16] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E2CC4 + + thumb_func_start display_text_and_get_width_internal +display_text_and_get_width_internal: @ 80E2D10 + push {lr} + sub sp, 0x40 + adds r1, r0, 0 + mov r0, sp + bl ExpandStringRefs + movs r0, 0x1 + mov r1, sp + movs r2, 0 + bl GetStringWidth + add sp, 0x40 + pop {r1} + bx r1 + thumb_func_end display_text_and_get_width_internal + + thumb_func_start display_text_and_get_width +display_text_and_get_width: @ 80E2D2C + push {r4,lr} + adds r4, r1, 0 + bl display_text_and_get_width_internal + cmp r0, r4 + bge _080E2D3A + adds r0, r4, 0 +_080E2D3A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end display_text_and_get_width + + thumb_func_start convert_pixel_width_to_tile_width +convert_pixel_width_to_tile_width: @ 80E2D40 + push {lr} + adds r1, r0, 0 + adds r0, 0x9 + cmp r0, 0 + bge _080E2D4C + adds r0, 0x7 +_080E2D4C: + asrs r0, 3 + adds r0, 0x1 + cmp r0, 0x1C + ble _080E2D56 + movs r0, 0x1C +_080E2D56: + pop {r1} + bx r1 + thumb_func_end convert_pixel_width_to_tile_width + + thumb_func_start sub_80E2D5C +sub_80E2D5C: @ 80E2D5C + push {lr} + adds r2, r0, 0 + adds r0, r2, r1 + cmp r0, 0x1C + ble _080E2D70 + movs r0, 0x1C + subs r2, r0, r1 + cmp r2, 0 + bge _080E2D70 + movs r2, 0 +_080E2D70: + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_80E2D5C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/script_pokemon_util_80F87D8.s b/asm/script_pokemon_util_80F87D8.s new file mode 100644 index 000000000..54839ce3a --- /dev/null +++ b/asm/script_pokemon_util_80F87D8.s @@ -0,0 +1,1667 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80F87D8 +sub_80F87D8: @ 80F87D8 + push {r4,lr} + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r1, =0x02039e00 + ldrb r3, [r1, 0x15] + ldr r4, =0x000013bc + adds r0, r2, r4 + strh r3, [r0] + adds r0, r1, 0 + adds r0, 0x55 + ldrb r3, [r0] + adds r4, 0x2 + adds r0, r2, r4 + strh r3, [r0] + adds r1, 0x95 + ldrb r0, [r1] + movs r1, 0x9E + lsls r1, 5 + adds r2, r1 + strh r0, [r2] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F87D8 + + thumb_func_start sub_80F8814 +sub_80F8814: @ 80F8814 + push {lr} + ldr r0, =0x020375e2 + ldrb r0, [r0] + adds r1, r0, 0 + cmp r0, 0x1 + beq _080F883A + cmp r0, 0x1 + bgt _080F8830 + cmp r0, 0 + beq _080F8836 + b _080F8842 + .pool +_080F8830: + cmp r1, 0x2 + beq _080F883E + b _080F8842 +_080F8836: + movs r1, 0x3 + b _080F8844 +_080F883A: + movs r1, 0x4 + b _080F8844 +_080F883E: + movs r1, 0x5 + b _080F8844 +_080F8842: + movs r1, 0x64 +_080F8844: + ldr r0, =0x020375e0 + strh r1, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F8814 + + thumb_func_start sub_80F8850 +sub_80F8850: @ 80F8850 + push {lr} + bl sub_80F8264 + bl sub_80F8290 + bl sub_80F8438 + pop {r0} + bx r0 + thumb_func_end sub_80F8850 + + thumb_func_start sub_80F8864 +sub_80F8864: @ 80F8864 + push {lr} + ldr r0, =0x02039f2c + ldrh r0, [r0] + cmp r0, 0x4 + bhi _080F88A4 + lsls r0, 2 + ldr r1, =_080F8880 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F8880: + .4byte _080F8894 + .4byte _080F8898 + .4byte _080F889C + .4byte _080F88A0 + .4byte _080F88A4 +_080F8894: + movs r1, 0x8 + b _080F88A6 +_080F8898: + movs r1, 0x9 + b _080F88A6 +_080F889C: + movs r1, 0xA + b _080F88A6 +_080F88A0: + movs r1, 0xB + b _080F88A6 +_080F88A4: + movs r1, 0xC +_080F88A6: + ldr r0, =0x03005d8c + ldr r0, [r0] + lsls r1, 5 + adds r0, r1 + ldr r1, =0x00002e98 + adds r0, r1 + ldrh r1, [r0] + cmp r1, 0 + bne _080F88CC + ldr r0, =0x020375e0 + strh r1, [r0] + b _080F88D2 + .pool +_080F88CC: + ldr r1, =0x020375e0 + movs r0, 0x1 + strh r0, [r1] +_080F88D2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F8864 + + thumb_func_start sub_80F88DC +sub_80F88DC: @ 80F88DC + push {lr} + movs r0, 0xFF + bl sub_80DEDA8 + pop {r0} + bx r0 + thumb_func_end sub_80F88DC + + thumb_func_start sub_80F88E8 +sub_80F88E8: @ 80F88E8 + push {lr} + ldr r0, =0x02039f20 + ldr r1, =0x02039f25 + ldrb r2, [r1] + adds r0, r2, r0 + ldrb r0, [r0] + cmp r0, 0 + bne _080F8930 + ldr r0, =0x02039f2e + ldrh r0, [r0] + cmp r0, 0x3 + bne _080F8930 + ldr r1, =0x02039f08 + lsls r0, r2, 1 + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + ldr r0, =0x0000031f + cmp r1, r0 + ble _080F8930 + ldr r1, =0x020375e0 + movs r0, 0x1 + b _080F8934 + .pool +_080F8930: + ldr r1, =0x020375e0 + movs r0, 0 +_080F8934: + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F88E8 + + thumb_func_start sub_80F8940 +sub_80F8940: @ 80F8940 + push {lr} + movs r3, 0 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00002f98 + adds r1, r0, r2 + movs r2, 0x4 +_080F894E: + ldrh r0, [r1] + cmp r0, 0 + beq _080F895A + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 +_080F895A: + adds r1, 0x20 + subs r2, 0x1 + cmp r2, 0 + bge _080F894E + adds r0, r3, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80F8940 + + thumb_func_start sub_80F8970 +sub_80F8970: @ 80F8970 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r0, =0x02039f00 + mov r12, r0 + ldr r1, =0x020375e4 + mov r9, r1 + ldr r2, =0x02039e02 + mov r10, r2 + mov r2, r12 + mov r1, sp + movs r6, 0x3 +_080F898E: + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _080F898E + movs r6, 0 +_080F899E: + movs r1, 0x3 + cmp r1, r6 + ble _080F89C8 +_080F89A4: + subs r5, r1, 0x1 + lsls r0, r5, 1 + mov r4, sp + adds r3, r4, r0 + lsls r0, r1, 1 + adds r2, r4, r0 + ldrh r4, [r3] + movs r7, 0 + ldrsh r1, [r3, r7] + movs r7, 0 + ldrsh r0, [r2, r7] + cmp r1, r0 + bge _080F89C2 + strh r4, [r2] + strh r0, [r3] +_080F89C2: + adds r1, r5, 0 + cmp r1, r6 + bgt _080F89A4 +_080F89C8: + adds r6, 0x1 + cmp r6, 0x2 + ble _080F899E + mov r2, r9 + ldrh r0, [r2] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + movs r2, 0 + mov r8, r2 + movs r6, 0 + lsls r0, 16 + asrs r4, r0, 16 + adds r3, r0, 0 + mov r1, sp + mov r5, r9 +_080F89E8: + movs r7, 0 + ldrsh r0, [r1, r7] + cmp r0, r4 + bne _080F8A02 + lsls r0, r2, 24 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r2, r0, 24 + ldrh r7, [r5] + cmp r6, r7 + bne _080F8A02 + mov r8, r2 +_080F8A02: + adds r1, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _080F89E8 + movs r6, 0 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + asrs r1, r3, 16 + lsls r2, 24 + mov r9, r2 + cmp r0, r1 + beq _080F8A30 + adds r2, r1, 0 + mov r1, sp +_080F8A20: + adds r1, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + bgt _080F8A30 + movs r4, 0 + ldrsh r0, [r1, r4] + cmp r0, r2 + bne _080F8A20 +_080F8A30: + lsls r0, r6, 24 + lsrs r7, r0, 24 + mov r2, r8 + movs r6, 0 + asrs r1, r3, 16 + mov r5, r12 + movs r4, 0 + ldrsh r0, [r5, r4] + b _080F8A66 + .pool +_080F8A50: + subs r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_080F8A56: + adds r6, 0x1 + cmp r6, 0x3 + bgt _080F8A6E + lsls r0, r6, 1 + add r0, r12 + asrs r1, r3, 16 + movs r5, 0 + ldrsh r0, [r0, r5] +_080F8A66: + cmp r1, r0 + bne _080F8A56 + cmp r2, 0x1 + bne _080F8A50 +_080F8A6E: + lsls r4, r6, 6 + mov r0, r10 + adds r1, r4, r0 + ldr r0, =0x02021cc4 + bl CopyString + ldr r5, =0x02021dc4 + mov r0, r10 + adds r0, 0xB + adds r4, r0 + adds r0, r5, 0 + adds r1, r4, 0 + bl CopyString + adds r0, r5, 0 + bl sub_81DB5AC + mov r1, r9 + asrs r0, r1, 24 + cmp r0, 0x1 + beq _080F8A9C + cmp r8, r0 + bne _080F8AB0 +_080F8A9C: + ldr r0, =0x020375e4 + strh r7, [r0] + b _080F8AB6 + .pool +_080F8AB0: + ldr r1, =0x020375e4 + adds r0, r7, 0x4 + strh r0, [r1] +_080F8AB6: + 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_80F8970 + + thumb_func_start sub_80F8ACC +sub_80F8ACC: @ 80F8ACC + push {lr} + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F8ACC + + thumb_func_start sub_80F8ADC +sub_80F8ADC: @ 80F8ADC + push {lr} + ldr r0, =sub_812FDEC + bl SetMainCallback2 + ldr r1, =0x030022c0 + ldr r0, =sub_80F8ACC + str r0, [r1, 0x8] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F8ADC + + thumb_func_start sub_80F8AFC +sub_80F8AFC: @ 80F8AFC + push {r4,r5,lr} + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080F8B7C + movs r3, 0 + ldr r0, =0x02039f30 + adds r4, r0, 0 + ldr r5, =0x02039e00 + ldrb r0, [r4] + cmp r3, r0 + bge _080F8B50 + adds r2, r5, 0 + ldr r1, =0x020229e8 +_080F8B1C: + ldrb r0, [r1] + subs r0, 0x1 + cmp r0, 0x1 + bhi _080F8B44 + ldrb r0, [r1, 0x13] + cmp r0, 0 + bne _080F8B40 + movs r0, 0xEB + b _080F8B42 + .pool +_080F8B40: + movs r0, 0xEC +_080F8B42: + strb r0, [r2, 0x15] +_080F8B44: + adds r2, 0x40 + adds r1, 0x1C + adds r3, 0x1 + ldrb r0, [r4] + cmp r3, r0 + blt _080F8B1C +_080F8B50: + ldr r0, =0x00004010 + ldrb r1, [r5, 0x15] + bl VarSet + ldr r0, =0x00004011 + adds r1, r5, 0 + adds r1, 0x55 + ldrb r1, [r1] + bl VarSet + ldr r0, =0x00004012 + adds r1, r5, 0 + adds r1, 0x95 + ldrb r1, [r1] + bl VarSet + ldr r0, =0x00004013 + adds r1, r5, 0 + adds r1, 0xD5 + ldrb r1, [r1] + bl VarSet +_080F8B7C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F8AFC + + thumb_func_start sub_80F8B94 +sub_80F8B94: @ 80F8B94 + push {r4-r7,lr} + ldr r1, =0x0300301c + movs r0, 0xC + strb r0, [r1] + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080F8C6E + movs r5, 0 + ldr r0, =0x02039f30 + ldrb r0, [r0] + cmp r5, r0 + bge _080F8C6E + movs r7, 0 + movs r6, 0x60 + movs r4, 0xB0 + lsls r4, 17 +_080F8BBA: + ldr r0, =gUnknown_0858D8EC + adds r0, r5, r0 + ldrb r0, [r0] + ldr r1, =0x03005d8c + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl GetFieldObjectIdByLocalIdAndMap + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02037350 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + ldrb r2, [r1, 0x5] + movs r0, 0xF + ands r0, r2 + orrs r0, r6 + strb r0, [r1, 0x5] + ldr r0, =0x020229e8 + adds r1, r7, r0 + ldrb r0, [r1] + subs r0, 0x1 + cmp r0, 0x1 + bhi _080F8C38 + ldrb r0, [r1, 0x13] + cmp r0, 0 + bne _080F8C2C + lsrs r1, r4, 16 + ldr r0, =gFieldObjectPalette33 + b _080F8C42 + .pool +_080F8C2C: + lsrs r1, r4, 16 + ldr r0, =gFieldObjectPalette34 + b _080F8C42 + .pool +_080F8C38: + ldrb r0, [r1, 0x13] + cmp r0, 0 + bne _080F8C50 + lsrs r1, r4, 16 + ldr r0, =gFieldObjectPalette8 +_080F8C42: + movs r2, 0x20 + bl gpu_pal_apply + b _080F8C5A + .pool +_080F8C50: + lsrs r1, r4, 16 + ldr r0, =gFieldObjectPalette17 + movs r2, 0x20 + bl gpu_pal_apply +_080F8C5A: + movs r0, 0x80 + lsls r0, 13 + adds r4, r0 + adds r7, 0x1C + adds r6, 0x10 + adds r5, 0x1 + ldr r0, =0x02039f30 + ldrb r0, [r0] + cmp r5, r0 + blt _080F8BBA +_080F8C6E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F8B94 + + thumb_func_start sub_80F8C7C +sub_80F8C7C: @ 80F8C7C + push {r4-r6,lr} + sub sp, 0x4 + ldr r6, =0x02039f24 + ldrb r0, [r6] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + movs r1, 0x46 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + strb r0, [r1] + cmp r0, 0 + bne _080F8D18 + ldr r0, =0x02039f20 + ldr r1, =0x02039f25 + ldrb r2, [r1] + adds r0, r2, r0 + ldrb r0, [r0] + cmp r0, 0 + bne _080F8D18 + ldr r0, =0x02039f2e + ldrh r0, [r0] + cmp r0, 0x3 + bne _080F8D18 + ldr r1, =0x02039f08 + lsls r0, r2, 1 + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + ldr r0, =0x0000031f + cmp r1, r0 + ble _080F8D18 + movs r1, 0x1 + mov r0, sp + strb r1, [r0] + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0x46 + mov r2, sp + bl pokemon_setattr + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + bl sub_80EE5A4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bls _080F8CF6 + ldrb r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0x46 + bl sub_80EE4DC +_080F8CF6: + movs r0, 0x1 + b _080F8D1A + .pool +_080F8D18: + movs r0, 0 +_080F8D1A: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80F8C7C + + thumb_func_start sub_80F8D24 +sub_80F8D24: @ 80F8D24 + movs r0, 0 + bx lr + thumb_func_end sub_80F8D24 + + thumb_func_start sub_80F8D28 +sub_80F8D28: @ 80F8D28 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r7, =sub_80F8EE8 + adds r0, r7, 0 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _080F8D44 + b _080F8E9C +_080F8D44: + bl init_uns_table_pokemon_copy + movs r0, 0xA + mov r9, r0 + movs r1, 0x3 + mov r10, r1 + ldr r2, =0x02039e00 + ldr r4, =0x020375e4 + ldrh r1, [r4] + lsls r1, 6 + adds r0, r1, r2 + ldrh r6, [r0] + adds r0, r2, 0 + adds r0, 0x38 + adds r0, r1, r0 + ldr r5, [r0] + adds r2, 0x3C + adds r1, r2 + ldr r1, [r1] + mov r8, r1 + adds r0, r7, 0 + movs r1, 0x50 + bl CreateTask + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x8] + strh r6, [r0, 0xA] + ldr r1, =0x02039f25 + ldrh r0, [r4] + ldrb r1, [r1] + cmp r0, r1 + bne _080F8DC4 + lsls r0, r6, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + ldr r1, [r1, 0x8] + adds r2, r6, 0 + adds r3, r5, 0 + bl DecompressMonPic_DetectFrontOrBack_2 + b _080F8DD8 + .pool +_080F8DC4: + lsls r0, r6, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + ldr r1, [r1, 0x8] + adds r2, r6, 0 + adds r3, r5, 0 + bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack +_080F8DD8: + adds r0, r6, 0 + mov r1, r8 + adds r2, r5, 0 + bl sub_806E7CC + adds r4, r0, 0 + bl LoadCompressedObjectPalette + adds r0, r6, 0 + movs r1, 0x1 + bl sub_806A068 + ldr r0, =0x0202499c + ldrh r1, [r4, 0x4] + strh r1, [r0, 0x2] + mov r1, r9 + adds r1, 0x1 + lsls r1, 19 + movs r2, 0x80 + lsls r2, 14 + adds r1, r2 + asrs r1, 16 + mov r3, r10 + lsls r2, r3, 19 + movs r3, 0xA0 + lsls r3, 14 + adds r2, r3 + asrs r2, 16 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080F8E58 + movs r0, 0x4 + ands r0, r1 + lsls r4, r5, 4 + cmp r0, 0 + bne _080F8E6C + adds r0, r4, r5 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0 + bl sub_806ED40 + b _080F8E6C + .pool +_080F8E58: + lsls r4, r5, 4 + adds r0, r4, r5 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0 + bl sub_806ED40 +_080F8E6C: + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + strh r5, [r0, 0xC] + mov r1, r9 + strh r1, [r0, 0xE] + mov r2, r10 + strh r2, [r0, 0x10] + ldr r3, =0x02020630 + adds r1, r4, r5 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x1C + adds r0, r1, r0 + ldr r2, =DummyObjectCallback + str r2, [r0] + adds r1, r3 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] +_080F8E9C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F8D28 + + thumb_func_start sub_80F8EB8 +sub_80F8EB8: @ 80F8EB8 + push {lr} + ldr r0, =sub_80F8EE8 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _080F8EDC + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + bl sub_805F094 +_080F8EDC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F8EB8 + + thumb_func_start sub_80F8EE8 +sub_80F8EE8: @ 80F8EE8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r5, r0, r1 + movs r2, 0x8 + ldrsh r0, [r5, r2] + adds r2, r1, 0 + cmp r0, 0x4 + bhi _080F8F98 + lsls r0, 2 + ldr r1, =_080F8F14 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F8F14: + .4byte _080F8F78 + .4byte _080F8F28 + .4byte _080F8F98 + .4byte _080F8F42 + .4byte _080F8F84 +_080F8F28: + movs r0, 0xA + movs r1, 0x3 + movs r2, 0x8 + movs r3, 0x8 + bl CreateWindowFromRect + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x12] + movs r1, 0x1 + bl SetStandardWindowBorderStyle + b _080F8F78 +_080F8F42: + movs r0, 0xC + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r4, r0, r1 + ldrb r0, [r4, 0x5] + lsrs r0, 4 + bl GetObjectPaletteTagBySlot + lsls r0, 16 + lsrs r0, 16 + bl FreeObjectPaletteByTag + ldrb r0, [r4, 0x1] + lsls r0, 30 + cmp r0, 0 + beq _080F8F72 + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry +_080F8F72: + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles +_080F8F78: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + b _080F8F98 + .pool +_080F8F84: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x12] + bl sub_80E2A78 + adds r0, r4, 0 + bl DestroyTask +_080F8F98: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80F8EE8 + + thumb_func_start sub_80F8FA0 +sub_80F8FA0: @ 80F8FA0 + push {r4,lr} + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080F8FD8 + ldr r0, =0x02039f30 + ldrb r0, [r0] + cmp r0, 0x4 + bne _080F8FD8 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080F8FD8 + ldr r4, =0x020375f0 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + b _080F8FDE + .pool +_080F8FD8: + ldr r1, =0x020375f0 + movs r0, 0x4 + strh r0, [r1] +_080F8FDE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F8FA0 + + thumb_func_start sub_80F8FE8 +sub_80F8FE8: @ 80F8FE8 + push {r4,lr} + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080F9020 + ldr r2, =0x030060b8 + ldr r1, [r2] + ldr r0, =0x41c64e6d + muls r0, r1 + ldr r1, =0x00006073 + adds r0, r1 + str r0, [r2] + lsrs r0, 16 + ldr r4, =0x020375f0 + b _080F902A + .pool +_080F9020: + ldr r4, =0x020375f0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 +_080F902A: + ldrh r1, [r4] + bl __umodsi3 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F8FE8 + + thumb_func_start sub_80F903C +sub_80F903C: @ 80F903C + ldr r2, =0x030060b8 + ldr r1, [r2] + ldr r0, =0x41c64e6d + muls r0, r1 + ldr r1, =0x00006073 + adds r0, r1 + str r0, [r2] + lsrs r0, 16 + bx lr + .pool + thumb_func_end sub_80F903C + + thumb_func_start sub_80F905C +sub_80F905C: @ 80F905C + push {lr} + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080F9074 + movs r0, 0 + b _080F907E + .pool +_080F9074: + ldr r0, =sub_80F9088 + movs r1, 0x5 + bl CreateTask + movs r0, 0x1 +_080F907E: + pop {r1} + bx r1 + .pool + thumb_func_end sub_80F905C + + thumb_func_start sub_80F9088 +sub_80F9088: @ 80F9088 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080F90C0 + cmp r0, 0x1 + beq _080F90CE + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080F90D4 + bl script_env_2_enable_and_set_ctx_running + adds r0, r5, 0 + bl DestroyTask + b _080F90D4 + .pool +_080F90C0: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _080F90D4 + bl sub_800ADF8 +_080F90CE: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080F90D4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80F9088 + + thumb_func_start sub_80F90DC +sub_80F90DC: @ 80F90DC + push {lr} + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080F90FE + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _080F90FE + bl sub_800E0E8 + movs r0, 0x8 + movs r1, 0x8 + bl sub_800DFB4 +_080F90FE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F90DC + + thumb_func_start sub_80F910C +sub_80F910C: @ 80F910C + push {lr} + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080F9126 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _080F9126 + bl sub_800E084 +_080F9126: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F910C + + thumb_func_start sub_80F9134 +sub_80F9134: @ 80F9134 + push {lr} + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080F914C + movs r0, 0 + b _080F914E + .pool +_080F914C: + movs r0, 0x1 +_080F914E: + pop {r1} + bx r1 + thumb_func_end sub_80F9134 + + thumb_func_start sub_80F9154 +sub_80F9154: @ 80F9154 + ldr r1, =0x02039f2a + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_80F9154 + + thumb_func_start sub_80F9160 +sub_80F9160: @ 80F9160 + push {lr} + ldr r0, =0x02039f2a + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080F9178 + movs r0, 0 + b _080F917A + .pool +_080F9178: + movs r0, 0x1 +_080F917A: + pop {r1} + bx r1 + thumb_func_end sub_80F9160 + + thumb_func_start sp000_heal_pokemon +sp000_heal_pokemon: @ 80F9180 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r0, 0 + mov r8, r0 + ldr r0, =0x020244e9 + ldrb r0, [r0] + cmp r8, r0 + bcs _080F922C + ldr r1, =0x020244ec + mov r10, r1 + mov r6, sp +_080F919E: + movs r0, 0x64 + mov r4, r8 + muls r4, r0 + add r4, r10 + adds r0, r4, 0 + movs r1, 0x3A + bl pokemon_getattr + lsls r1, r0, 16 + strb r0, [r6] + lsrs r1, 24 + strb r1, [r6, 0x1] + adds r0, r4, 0 + movs r1, 0x39 + mov r2, sp + bl pokemon_setattr + adds r0, r4, 0 + movs r1, 0x15 + bl pokemon_getattr + lsls r0, 24 + lsrs r7, r0, 24 + movs r5, 0 + movs r1, 0x1 + add r1, r8 + mov r9, r1 +_080F91D4: + adds r1, r5, 0 + adds r1, 0xD + adds r0, r4, 0 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + adds r1, r7, 0 + adds r2, r5, 0 + bl CalcPPWithPPUps + strb r0, [r6] + adds r1, r5, 0 + adds r1, 0x11 + adds r0, r4, 0 + mov r2, sp + bl pokemon_setattr + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _080F91D4 + movs r0, 0 + strb r0, [r6] + strb r0, [r6, 0x1] + strb r0, [r6, 0x2] + strb r0, [r6, 0x3] + movs r1, 0x64 + mov r0, r8 + muls r0, r1 + add r0, r10 + movs r1, 0x37 + mov r2, sp + bl pokemon_setattr + mov r1, r9 + lsls r0, r1, 24 + lsrs r0, 24 + mov r8, r0 + ldr r0, =0x020244e9 + ldrb r0, [r0] + cmp r8, r0 + bcc _080F919E +_080F922C: + 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 sp000_heal_pokemon + + thumb_func_start sub_80F9244 +@ void sub_80F9244(s16 species_num, u8 level, int held_item) +sub_80F9244: @ 80F9244 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x78 + adds r5, r0, 0 + adds r3, r1, 0 + adds r4, r2, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r4, 16 + lsrs r0, r4, 16 + mov r8, r0 + add r6, sp, 0x14 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r3, 0 + movs r3, 0x20 + bl create_pokemon_set_level + add r0, sp, 0x10 + mov r1, r8 + strb r1, [r0] + lsrs r4, 24 + strb r4, [r0, 0x1] + adds r0, r6, 0 + movs r1, 0xC + add r2, sp, 0x10 + bl pokemon_setattr + adds r0, r6, 0 + bl pokemon_catch + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r5, 0 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r5, r0, 16 + cmp r4, 0x1 + bgt _080F92B8 + cmp r4, 0 + blt _080F92B8 + adds r0, r5, 0 + movs r1, 0x2 + bl pokedex_flag_operation + adds r0, r5, 0 + movs r1, 0x3 + bl pokedex_flag_operation +_080F92B8: + adds r0, r4, 0 + add sp, 0x78 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80F9244 + + thumb_func_start sub_80F92C8 +sub_80F92C8: @ 80F92C8 + push {lr} + sub sp, 0x68 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r0, sp + movs r2, 0x1 + bl sub_8070954 + add r2, sp, 0x64 + movs r0, 0x1 + strb r0, [r2] + mov r0, sp + movs r1, 0x2D + bl pokemon_setattr + mov r0, sp + bl pokemon_catch + lsls r0, 24 + lsrs r0, 24 + add sp, 0x68 + pop {r1} + bx r1 + thumb_func_end sub_80F92C8 + + thumb_func_start sub_80F92F8 +sub_80F92F8: @ 80F92F8 + push {lr} + bl sub_806B5C4 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + beq _080F9314 + cmp r1, 0x1 + bgt _080F9310 + cmp r1, 0 + beq _080F9314 + b _080F9318 +_080F9310: + cmp r1, 0x2 + bne _080F9318 +_080F9314: + ldr r0, =0x020375f0 + strh r1, [r0] +_080F9318: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F92F8 + + thumb_func_start sub_80F9320 +sub_80F9320: @ 80F9320 + push {r4-r7,lr} + lsls r0, 16 + lsrs r6, r0, 16 + movs r5, 0 + movs r7, 0xCE + lsls r7, 1 +_080F932C: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _080F9360 + cmp r0, r7 + beq _080F9360 + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + cmp r0, r6 + bne _080F9360 + movs r0, 0x1 + b _080F9368 + .pool +_080F9360: + adds r5, 0x1 + cmp r5, 0x5 + ble _080F932C + movs r0, 0 +_080F9368: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80F9320 + + thumb_func_start sub_80F9370 +sub_80F9370: @ 80F9370 + push {r4,lr} + movs r0, 0xAF + bl sub_80F9320 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + cmp r4, 0x1 + bne _080F9392 + movs r0, 0xAF + bl ItemIdToBerryType + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02021cc4 + bl GetBerryNameByBerryType +_080F9392: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80F9370 + + thumb_func_start sub_80F93A0 +sub_80F93A0: @ 80F93A0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + lsls r7, r2, 16 + lsrs r6, r7, 16 + bl zero_enemy_party_data + ldr r0, =0x02024744 + mov r8, r0 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + mov r0, r8 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0x20 + bl create_pokemon_set_level + cmp r6, 0 + beq _080F93EE + add r0, sp, 0x10 + strb r6, [r0] + adds r1, r0, 0 + lsrs r0, r7, 24 + strb r0, [r1, 0x1] + mov r0, r8 + movs r1, 0xC + add r2, sp, 0x10 + bl pokemon_setattr +_080F93EE: + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F93A0 + + thumb_func_start sub_80F9400 +sub_80F9400: @ 80F9400 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 24 + lsrs r2, 24 + cmp r3, 0x6 + bls _080F941C + ldr r0, =0x020244e9 + ldrb r0, [r0] + subs r0, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 +_080F941C: + movs r0, 0x64 + muls r0, r3 + ldr r1, =0x020244ec + adds r0, r1 + adds r1, r4, 0 + bl sub_80691F4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F9400 + + thumb_func_start sub_80F9438 +sub_80F9438: @ 80F9438 + push {lr} + ldr r0, =0x030022c0 + ldr r1, =sub_80F9460 + str r1, [r0, 0x8] + ldr r0, =0x000040cf + movs r1, 0x9 + bl VarSet + movs r0, 0 + bl sub_81B8518 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F9438 + + thumb_func_start sub_80F9460 +sub_80F9460: @ 80F9460 + push {lr} + ldr r0, =0x0203cef8 + ldrb r1, [r0] + cmp r1, 0 + bne _080F9478 + ldr r0, =0x020375f0 + strh r1, [r0] + b _080F947E + .pool +_080F9478: + ldr r1, =0x020375f0 + movs r0, 0x1 + strh r0, [r1] +_080F947E: + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F9460 + + thumb_func_start sub_80F9490 +sub_80F9490: @ 80F9490 + push {lr} + ldr r1, =0x030022c0 + ldr r0, =sub_80F94B8 + str r0, [r1, 0x8] + ldr r0, =0x020375e0 + ldrb r0, [r0] + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + bl sub_81B8518 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F9490 + + thumb_func_start sub_80F94B8 +sub_80F94B8: @ 80F94B8 + push {lr} + ldr r0, =0x0203cef8 + ldrb r1, [r0] + cmp r1, 0 + bne _080F94D0 + ldr r0, =0x020375f0 + strh r1, [r0] + b _080F94D6 + .pool +_080F94D0: + ldr r1, =0x020375f0 + movs r0, 0x1 + strh r0, [r1] +_080F94D6: + ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F94B8 + + thumb_func_start sub_80F94E8 +sub_80F94E8: @ 80F94E8 + push {r4-r7,lr} + sub sp, 0x198 + add r0, sp, 0x190 + movs r1, 0 + str r1, [r0] + ldr r2, =0x05000064 + mov r1, sp + bl CpuSet + movs r5, 0 + movs r7, 0x64 + ldr r6, =0x020244ec + mov r4, sp +_080F9502: + ldr r0, =0x0203cef8 + adds r1, r5, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _080F951C + subs r0, 0x1 + adds r1, r0, 0 + muls r1, r7 + adds r1, r6 + adds r0, r4, 0 + movs r2, 0x64 + bl memcpy +_080F951C: + adds r4, 0x64 + adds r5, 0x1 + cmp r5, 0x3 + ble _080F9502 + add r0, sp, 0x194 + movs r1, 0 + str r1, [r0] + ldr r4, =0x020244ec + ldr r2, =0x05000096 + adds r1, r4, 0 + bl CpuSet + mov r5, sp + add r6, sp, 0x12C +_080F9538: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x64 + bl memcpy + adds r5, 0x64 + adds r4, 0x64 + cmp r5, r6 + ble _080F9538 + bl calc_player_party_count + add sp, 0x198 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F94E8 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/secret_base.s b/asm/secret_base.s new file mode 100644 index 000000000..b005a3764 --- /dev/null +++ b/asm/secret_base.s @@ -0,0 +1,5872 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80E8AF0 +sub_80E8AF0: @ 80E8AF0 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r0, 0 + str r0, [sp] + ldr r2, =0x01000028 + mov r0, sp + adds r1, r4, 0 + bl CpuFastSet + movs r2, 0 + adds r4, 0x2 + movs r3, 0xFF +_080E8B0A: + adds r0, r4, r2 + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x6 + bls _080E8B0A + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E8AF0 + + thumb_func_start sub_80E8B28 +sub_80E8B28: @ 80E8B28 + push {r4,r5,lr} + movs r4, 0 + ldr r5, =0x03005d8c +_080E8B2E: + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 5 + ldr r0, =0x00001a9c + adds r1, r0 + ldr r0, [r5] + adds r0, r1 + bl sub_80E8AF0 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x13 + bls _080E8B2E + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E8B28 + + thumb_func_start sub_80E8B58 +sub_80E8B58: @ 80E8B58 + ldr r0, =0x0203a01c + ldr r1, =0x020375e0 + ldrh r1, [r1] + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_80E8B58 + + thumb_func_start sub_80E8B6C +sub_80E8B6C: @ 80E8B6C + push {r4,lr} + ldr r0, =0x020375f0 + movs r1, 0 + strh r1, [r0] + movs r3, 0 + adds r4, r0, 0 + b _080E8B86 + .pool +_080E8B80: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 +_080E8B86: + cmp r3, 0x13 + bhi _080E8BB0 + ldr r2, =0x0203a01c + ldr r0, =0x03005d8c + ldr r1, [r0] + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 5 + adds r1, r0 + ldr r0, =0x00001a9c + adds r1, r0 + ldrb r0, [r2] + ldrb r1, [r1] + cmp r0, r1 + bne _080E8B80 + movs r0, 0x1 + strh r0, [r4] + ldr r0, =0x00004054 + adds r1, r3, 0 + bl VarSet +_080E8BB0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E8B6C + + thumb_func_start sub_80E8BC8 +sub_80E8BC8: @ 80E8BC8 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00001a9c + adds r0, r1 + ldrb r1, [r0] + cmp r1, 0 + beq _080E8BEC + ldr r1, =0x020375f0 + movs r0, 0x1 + strh r0, [r1] + b _080E8BF0 + .pool +_080E8BEC: + ldr r0, =0x020375f0 + strh r1, [r0] +_080E8BF0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E8BC8 + + thumb_func_start sub_80E8BF8 +sub_80E8BF8: @ 80E8BF8 + 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 + adds r1, r0, 0 + ldr r2, =0x00000fff + adds r0, r2, 0 + ands r1, r0 + adds r0, r1, 0 + subs r0, 0x90 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _080E8C34 + movs r0, 0x1 + b _080E8C8E + .pool +_080E8C34: + adds r0, r1, 0 + subs r0, 0x92 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _080E8C44 + movs r0, 0x2 + b _080E8C8E +_080E8C44: + adds r0, r1, 0 + subs r0, 0x9A + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _080E8C54 + movs r0, 0x3 + b _080E8C8E +_080E8C54: + adds r0, r1, 0 + subs r0, 0x94 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _080E8C64 + movs r0, 0x4 + b _080E8C8E +_080E8C64: + adds r0, r1, 0 + subs r0, 0x96 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _080E8C78 + cmp r1, 0x9C + beq _080E8C78 + cmp r1, 0x9D + bne _080E8C7C +_080E8C78: + movs r0, 0x5 + b _080E8C8E +_080E8C7C: + adds r0, r1, 0 + subs r0, 0x98 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _080E8C8C + movs r0, 0 + b _080E8C8E +_080E8C8C: + movs r0, 0x6 +_080E8C8E: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80E8BF8 + + thumb_func_start sub_80E8C98 +sub_80E8C98: @ 80E8C98 + push {r4,lr} + ldr r4, =0x020375e6 + bl sub_80E8BF8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E8C98 + + thumb_func_start sub_80E8CB0 +sub_80E8CB0: @ 80E8CB0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + str r0, [sp] + str r1, [sp, 0x4] + lsls r2, 16 + lsrs r2, 16 + mov r10, r2 + ldr r0, =0x02037318 + ldr r0, [r0] + mov r8, r0 + movs r0, 0 + mov r12, r0 + mov r1, r8 + ldr r0, [r1, 0x4] + cmp r12, r0 + bge _080E8D3C + ldr r4, [r1] +_080E8CDA: + movs r2, 0 + mov r0, r12 + lsls r7, r0, 16 + cmp r2, r4 + bge _080E8D28 + asrs r0, r7, 16 + adds r6, r0, 0 + muls r6, r4 + mov r1, r8 + ldr r5, [r1, 0xC] + ldr r0, =0x000003ff + mov r9, r0 +_080E8CF2: + lsls r0, r2, 16 + asrs r3, r0, 16 + adds r0, r6, r3 + lsls r0, 1 + adds r0, r5 + ldrh r1, [r0] + mov r0, r9 + ands r0, r1 + cmp r0, r10 + bne _080E8D1C + ldr r1, [sp] + strh r2, [r1] + mov r0, r12 + ldr r2, [sp, 0x4] + strh r0, [r2] + b _080E8D3C + .pool +_080E8D1C: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + asrs r0, 16 + cmp r0, r4 + blt _080E8CF2 +_080E8D28: + movs r2, 0x80 + lsls r2, 9 + adds r1, r7, r2 + lsrs r0, r1, 16 + mov r12, r0 + asrs r1, 16 + mov r2, r8 + ldr r0, [r2, 0x4] + cmp r1, r0 + blt _080E8CDA +_080E8D3C: + 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 sub_80E8CB0 + + thumb_func_start sub_80E8D4C +sub_80E8D4C: @ 80E8D4C + push {r4-r7,lr} + mov r7, r8 + push {r7} + 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 MapGridGetMetatileIdAt + movs r5, 0 + mov r12, r4 + lsls r0, 16 + asrs r3, r0, 16 + ldr r1, =gUnknown_0858CFCC + mov r8, r1 + adds r7, r0, 0 + mov r4, sp + mov r6, r12 +_080E8D80: + ldr r0, =gUnknown_0858CFCC + lsls r1, r5, 2 + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, r3 + bne _080E8D9C + movs r3, 0 + ldrsh r0, [r4, r3] + movs r5, 0 + ldrsh r1, [r6, r5] + ldrh r3, [r2, 0x2] + b _080E8DC4 + .pool +_080E8D9C: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x6 + bls _080E8D80 + movs r5, 0 + mov r4, sp + mov r6, r12 +_080E8DAC: + lsls r0, r5, 2 + mov r1, r8 + adds r3, r0, r1 + ldrh r1, [r3, 0x2] + asrs r0, r7, 16 + cmp r1, r0 + bne _080E8DDE + movs r2, 0 + ldrsh r0, [r4, r2] + movs r5, 0 + ldrsh r1, [r6, r5] + ldrh r3, [r3] +_080E8DC4: + movs r5, 0xC0 + lsls r5, 4 + adds r2, r5, 0 + orrs r2, r3 + bl MapGridSetMetatileIdAt + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0 + ldrsh r1, [r6, r2] + bl CurrentMapDrawMetatileAt + b _080E8DE8 +_080E8DDE: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x6 + bls _080E8DAC +_080E8DE8: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E8D4C + + thumb_func_start sub_80E8DF4 +sub_80E8DF4: @ 80E8DF4 + push {lr} + adds r2, r0, 0 + movs r1, 0 +_080E8DFA: + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080E8E06 + adds r0, r1, 0 + b _080E8E12 +_080E8E06: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x6 + bls _080E8DFA + movs r0, 0x7 +_080E8E12: + pop {r1} + bx r1 + thumb_func_end sub_80E8DF4 + + thumb_func_start sub_80E8E18 +sub_80E8E18: @ 80E8E18 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r2, =0x03005d8c + ldr r0, [r2] + ldr r1, =0x0203a01c + ldrb r1, [r1] + ldr r3, =0x00001a9c + adds r0, r3 + strb r1, [r0] + movs r3, 0 + ldr r5, =0x00001aa5 + ldr r4, =0x03005d90 +_080E8E32: + ldr r1, [r2] + adds r1, r5 + adds r1, r3 + ldr r0, [r4] + adds r0, 0xA + adds r0, r3 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x3 + bls _080E8E32 + ldr r0, =0x00004054 + movs r1, 0 + bl VarSet + ldr r6, =0x03005d8c + ldr r4, [r6] + ldr r0, =0x00001a9e + adds r4, r0 + ldr r1, =0x03005d90 + mov r8, r1 + ldr r5, [r1] + adds r0, r5, 0 + bl sub_80E8DF4 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl CopyString_LimitN + ldr r3, [r6] + mov r1, r8 + ldr r0, [r1] + ldrb r0, [r0, 0x8] + ldr r1, =0x00001a9d + adds r3, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 4 + ldrb r2, [r3] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + ldr r0, [r6] + ldr r3, =0x00001aa9 + adds r0, r3 + movs r1, 0x2 + strb r1, [r0] + ldr r0, =0x00004026 + ldr r1, =0x02037318 + ldrb r1, [r1, 0x14] + bl VarSet + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E8E18 + + thumb_func_start sub_80E8EE0 +sub_80E8EE0: @ 80E8EE0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r0 + movs r5, 0 + b _080E8F8A +_080E8EEE: + mov r0, r8 + ldr r1, [r0, 0x10] + lsls r2, r5, 1 + adds r0, r2, r5 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x5] + adds r6, r1, 0 + adds r1, r5, 0x1 + mov r9, r1 + cmp r0, 0x8 + bne _080E8F82 + movs r4, 0 + ldr r7, =0x03005d8c +_080E8F0A: + ldr r1, [r7] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 5 + adds r1, r0 + ldr r0, =0x00001a9c + adds r1, r0 + ldrb r1, [r1] + adds r0, r2, r5 + lsls r0, 2 + adds r3, r0, r6 + ldr r0, [r3, 0x8] + cmp r1, r0 + bne _080E8F78 + ldrh r5, [r3] + adds r5, 0x7 + ldrh r4, [r3, 0x2] + adds r4, 0x7 + lsls r5, 16 + asrs r0, r5, 16 + lsls r4, 16 + asrs r1, r4, 16 + bl MapGridGetMetatileIdAt + movs r3, 0 + lsls r0, 16 + asrs r1, r0, 16 + ldr r6, =gUnknown_0858CFCC +_080E8F42: + lsls r0, r3, 2 + adds r2, r0, r6 + ldrh r0, [r2] + cmp r0, r1 + bne _080E8F6C + ldrh r0, [r2, 0x2] + movs r1, 0xC0 + lsls r1, 4 + adds r2, r1, 0 + orrs r2, r0 + asrs r0, r5, 16 + asrs r1, r4, 16 + bl MapGridSetMetatileIdAt + b _080E8F82 + .pool +_080E8F6C: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x6 + bls _080E8F42 + b _080E8F82 +_080E8F78: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x13 + bls _080E8F0A +_080E8F82: + mov r1, r9 + lsls r0, r1, 16 + lsrs r5, r0, 16 + mov r0, r8 +_080E8F8A: + ldrb r0, [r0, 0x3] + cmp r5, r0 + bcc _080E8EEE + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E8EE0 + + thumb_func_start sub_80E8F9C +sub_80E8F9C: @ 80E8F9C + push {lr} + ldr r0, =0x0203a01c + ldrb r0, [r0] + movs r1, 0xA + bl __udivsi3 + ldr r2, =gUnknown_0858CFE8 + lsls r0, 26 + asrs r0, 24 + adds r1, r0, r2 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + adds r0, 0x1 + adds r0, r2 + movs r2, 0 + ldrsb r2, [r0, r2] + movs r0, 0x19 + bl warp1_set_2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E8F9C + + thumb_func_start sub_80E8FD0 +sub_80E8FD0: @ 80E8FD0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + movs r1, 0x8 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _080E8FF4 + cmp r0, 0x1 + beq _080E900C + b _080E904A + .pool +_080E8FF4: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080E904A + movs r0, 0x1 + strh r0, [r2, 0x8] + b _080E904A + .pool +_080E900C: + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x03005d8c + ldr r2, [r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 5 + adds r2, r1 + ldr r0, =0x00001aac + adds r2, r0 + ldrb r0, [r2] + cmp r0, 0xFE + bhi _080E9030 + adds r0, 0x1 + strb r0, [r2] +_080E9030: + bl sub_80E8F9C + bl warp_in + ldr r0, =0x03005dac + ldr r1, =sub_80AF168 + str r1, [r0] + ldr r0, =c2_load_new_map + bl SetMainCallback2 + adds r0, r4, 0 + bl DestroyTask +_080E904A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E8FD0 + + thumb_func_start sub_80E9068 +sub_80E9068: @ 80E9068 + push {lr} + ldr r0, =sub_80E8FD0 + movs r1, 0 + bl CreateTask + movs r0, 0x1 + movs r1, 0 + bl fade_screen + ldr r0, =0x03005d8c + 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_80E9068 + + thumb_func_start sub_80E909C +sub_80E909C: @ 80E909C + push {lr} + ldr r0, =0x02037318 + ldrb r0, [r0, 0x17] + cmp r0, 0x9 + bne _080E90C0 + ldr r0, =0x00004097 + bl VarGet + lsls r0, 16 + cmp r0, 0 + bne _080E90C0 + movs r0, 0 + b _080E90C2 + .pool +_080E90C0: + movs r0, 0x1 +_080E90C2: + pop {r1} + bx r1 + thumb_func_end sub_80E909C + + thumb_func_start sub_80E90C8 +sub_80E90C8: @ 80E90C8 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + movs r1, 0x2 + bl FieldObjectTurn + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E90F8 + bl script_env_2_enable_and_set_ctx_running + adds r0, r4, 0 + bl DestroyTask +_080E90F8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E90C8 + + thumb_func_start sub_80E9108 +sub_80E9108: @ 80E9108 + push {r4,lr} + sub sp, 0x4 + bl script_env_2_enable + bl HideMapNamePopUpWindow + mov r4, sp + adds r4, 0x2 + movs r2, 0x88 + lsls r2, 2 + mov r0, sp + adds r1, r4, 0 + bl sub_80E8CB0 + mov r1, sp + mov r0, sp + ldrh r0, [r0] + adds r0, 0x7 + strh r0, [r1] + ldrh r0, [r4] + adds r0, 0x7 + strh r0, [r4] + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + movs r2, 0xE2 + lsls r2, 4 + bl MapGridSetMetatileIdAt + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl CurrentMapDrawMetatileAt + bl pal_fill_black + ldr r0, =sub_80E90C8 + movs r1, 0 + bl CreateTask + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E9108 + + thumb_func_start sub_80E916C +sub_80E916C: @ 80E916C + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080E91D4 + ldr r0, =0x0203a01c + ldrb r0, [r0] + movs r1, 0xA + bl __udivsi3 + ldr r1, =0x03005d8c + ldr r1, [r1] + movs r5, 0x4 + ldrsb r5, [r1, r5] + ldrb r1, [r1, 0x5] + lsls r1, 24 + asrs r1, 24 + movs r2, 0x1 + negs r2, r2 + ldr r4, =gUnknown_0858CFE8 + lsls r0, 26 + asrs r0, 24 + adds r3, r0, 0x2 + adds r3, r4 + ldrb r3, [r3] + lsls r3, 24 + asrs r3, 24 + adds r0, 0x3 + adds r0, r4 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + str r0, [sp] + adds r0, r5, 0 + bl warp1_set + bl warp_in + ldr r1, =0x03005dac + ldr r0, =sub_80E9108 + str r0, [r1] + ldr r0, =c2_load_new_map + bl SetMainCallback2 + adds r0, r6, 0 + bl DestroyTask +_080E91D4: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E916C + + thumb_func_start sub_80E91F8 +sub_80E91F8: @ 80E91F8 + push {lr} + ldr r0, =sub_80E916C + movs r1, 0 + bl CreateTask + movs r0, 0x1 + movs r1, 0 + bl fade_screen + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E91F8 + + thumb_func_start CurrentMapIsSecretBase +CurrentMapIsSecretBase: @ 80E9214 + push {lr} + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r0, 0x4 + ldrsb r0, [r1, r0] + cmp r0, 0x19 + bne _080E9230 + ldrb r0, [r1, 0x5] + cmp r0, 0x17 + bhi _080E9230 + movs r0, 0x1 + b _080E9232 + .pool +_080E9230: + movs r0, 0 +_080E9232: + pop {r1} + bx r1 + thumb_func_end CurrentMapIsSecretBase + + thumb_func_start sub_80E9238 +sub_80E9238: @ 80E9238 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + bl CurrentMapIsSecretBase + lsls r0, 24 + cmp r0, 0 + beq _080E9328 + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + lsrs r5, r0, 16 + ldr r1, =0x03005d8c + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 5 + ldr r2, =0x00001a9c + adds r0, r2 + ldr r1, [r1] + adds r1, r0 + adds r7, r1, 0 + adds r7, 0x12 + adds r6, r1, 0 + adds r6, 0x22 + movs r1, 0 + mov r0, sp + strh r1, [r0] + mov r4, sp +_080E927A: + ldrh r2, [r4] + adds r1, r7, r2 + ldrb r0, [r1] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x77 + bhi _080E92AC + ldr r0, =gUnknown_085A5C08 + ldrb r3, [r1] + lsls r1, r3, 5 + adds r1, r0 + ldrb r0, [r1, 0x11] + cmp r0, 0x4 + beq _080E92AC + adds r0, r6, r2 + ldrb r2, [r0] + lsrs r0, r2, 4 + adds r0, 0x7 + movs r1, 0xF + ands r1, r2 + adds r1, 0x7 + adds r2, r3, 0 + bl sub_8127D38 +_080E92AC: + ldrh r0, [r4] + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + strh r0, [r4] + cmp r0, 0xF + bls _080E927A + cmp r5, 0 + beq _080E92F4 + mov r4, sp + adds r4, 0x2 + movs r2, 0x88 + lsls r2, 2 + mov r0, sp + adds r1, r4, 0 + bl sub_80E8CB0 + mov r0, sp + ldrh r0, [r0] + adds r0, 0x7 + ldrh r1, [r4] + adds r1, 0x7 + ldr r2, =0x00000e21 + bl MapGridSetMetatileIdAt + b _080E9328 + .pool +_080E92F4: + mov r0, r8 + cmp r0, 0x1 + bne _080E9328 + ldr r0, =0x00004089 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _080E9328 + mov r4, sp + adds r4, 0x2 + movs r2, 0x88 + lsls r2, 2 + mov r0, sp + adds r1, r4, 0 + bl sub_80E8CB0 + mov r0, sp + ldrh r0, [r0] + adds r0, 0x7 + ldrh r1, [r4] + adds r1, 0x7 + ldr r2, =0x00000e0a + bl MapGridSetMetatileIdAt +_080E9328: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E9238 + + thumb_func_start sub_80E933C +sub_80E933C: @ 80E933C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + bl CurrentMapIsSecretBase + lsls r0, 24 + cmp r0, 0 + bne _080E9374 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x0000271c + adds r1, r0, r1 + str r1, [sp, 0x4] + ldr r2, =0x00002728 + adds r2, r0, r2 + str r2, [sp, 0x8] + movs r3, 0xC + str r3, [sp, 0x10] + b _080E939C + .pool +_080E9374: + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + ldr r2, =0x03005d8c + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 5 + ldr r4, =0x00001a9c + adds r1, r4 + ldr r0, [r2] + adds r0, r1 + adds r1, r0, 0 + adds r1, 0x12 + str r1, [sp, 0x4] + adds r0, 0x22 + str r0, [sp, 0x8] + movs r2, 0x10 + str r2, [sp, 0x10] +_080E939C: + movs r6, 0 + b _080E955A + .pool +_080E93AC: + ldr r4, [sp, 0x4] + adds r0, r4, r6 + ldrb r1, [r0] + mov r10, r0 + adds r0, r6, 0x1 + str r0, [sp, 0x14] + cmp r1, 0 + bne _080E93BE + b _080E9554 +_080E93BE: + mov r1, r10 + ldrb r0, [r1] + lsls r0, 5 + ldr r2, =gUnknown_085A5C08 + adds r0, r2 + ldrb r1, [r0, 0x11] + ldrb r0, [r0, 0x13] + str r0, [sp, 0xC] + cmp r1, 0x4 + beq _080E93D4 + b _080E9554 +_080E93D4: + movs r5, 0 + ldr r0, =0x02037318 + ldr r3, [r0, 0x4] + ldrb r4, [r3] + mov r9, r0 + cmp r5, r4 + bcs _080E9412 + ldr r0, [r3, 0x4] + ldrh r2, [r0, 0x14] + ldr r1, =0x020375e0 + ldrh r0, [r1] + adds r0, 0xAE + adds r7, r1, 0 + cmp r2, r0 + beq _080E9412 + adds r2, r4, 0 +_080E93F4: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, r2 + bcs _080E9412 + ldr r1, [r3, 0x4] + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x14] + ldrh r0, [r7] + adds r0, 0xAE + cmp r1, r0 + bne _080E93F4 +_080E9412: + mov r3, r9 + ldr r0, [r3, 0x4] + ldrb r0, [r0] + cmp r5, r0 + bne _080E941E + b _080E9554 +_080E941E: + ldr r4, =0x020375e4 + mov r8, r4 + ldr r0, [sp, 0x8] + adds r1, r0, r6 + ldrb r0, [r1] + lsrs r0, 4 + strh r0, [r4] + ldr r7, =0x020375e6 + ldrb r1, [r1] + movs r0, 0xF + ands r0, r1 + strh r0, [r7] + ldrh r0, [r4] + adds r0, 0x7 + ldrh r1, [r7] + adds r1, 0x7 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8089350 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080E9462 + adds r0, r4, 0 + bl sub_8089364 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E9554 +_080E9462: + ldr r6, =0x020375f0 + mov r1, r9 + ldr r0, [r1, 0x4] + ldr r1, [r0, 0x4] + lsls r4, r5, 1 + adds r4, r5 + lsls r4, 3 + adds r1, r4, r1 + ldr r2, =0x00003f20 + adds r0, r2, 0 + ldrb r1, [r1, 0x1] + adds r0, r1 + strh r0, [r6] + ldrh r0, [r6] + mov r3, r10 + ldrb r1, [r3] + lsls r1, 5 + ldr r2, =gUnknown_085A5C24 + adds r1, r2 + ldr r1, [r1] + ldrh r1, [r1] + bl VarSet + mov r3, r9 + ldr r0, [r3, 0x4] + ldr r0, [r0, 0x4] + adds r4, r0 + ldrb r0, [r4] + strh r0, [r6] + ldr r0, =0x020375e0 + ldrh r0, [r0] + adds r0, 0xAE + lsls r0, 16 + lsrs r0, 16 + bl FlagReset + ldrb r0, [r6] + ldr r5, =0x03005d8c + ldr r2, [r5] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl show_sprite + ldrb r0, [r6] + ldr r2, [r5] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + mov r4, r8 + movs r3, 0 + ldrsh r4, [r4, r3] + mov r8, r4 + movs r4, 0 + ldrsh r7, [r7, r4] + str r7, [sp] + mov r3, r8 + bl sub_808EBA8 + ldrb r0, [r6] + ldr r2, [r5] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl sub_808F254 + bl CurrentMapIsSecretBase + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E954C + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080E954C + ldr r0, [sp, 0xC] + cmp r0, 0x6 + bne _080E9538 + ldrb r0, [r6] + ldr r2, [r5] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + movs r3, 0x6 + bl sub_808F28C + b _080E954C + .pool +_080E9538: + ldr r1, [sp, 0xC] + cmp r1, 0x7 + bne _080E954C + ldrb r0, [r6] + ldr r2, [r5] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + movs r3, 0x7 + bl sub_808F28C +_080E954C: + ldr r1, =0x020375e0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_080E9554: + ldr r2, [sp, 0x14] + lsls r0, r2, 24 + lsrs r6, r0, 24 +_080E955A: + ldr r3, [sp, 0x10] + cmp r6, r3 + bcs _080E9562 + b _080E93AC +_080E9562: + 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_80E933C + + thumb_func_start sub_80E9578 +sub_80E9578: @ 80E9578 + push {r4-r6,lr} + movs r5, 0 + ldr r1, =0x02037318 + ldr r0, [r1, 0x4] + ldrb r0, [r0] + cmp r5, r0 + bcs _080E95C4 + adds r6, r1, 0 +_080E9588: + ldr r0, [r6, 0x4] + ldr r1, [r0, 0x4] + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 3 + adds r1, r0, r1 + ldrh r4, [r1, 0x14] + adds r0, r4, 0 + subs r0, 0xAE + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xD + bhi _080E95B6 + ldrb r0, [r1] + ldr r1, =0x03005d8c + ldr r2, [r1] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + bl RemoveFieldObjectByLocalIdAndMap + adds r0, r4, 0 + bl FlagSet +_080E95B6: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r6, 0x4] + ldrb r0, [r0] + cmp r5, r0 + bcc _080E9588 +_080E95C4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E9578 + + thumb_func_start sub_80E95D4 +sub_80E95D4: @ 80E95D4 + push {r4,r5,lr} + ldr r5, =0x0000401f + ldr r4, =gUnknown_0858D060 + ldr r0, =0x00004054 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + bl sub_80EA20C + lsls r0, 24 + lsrs r0, 24 + adds r0, r4 + ldrb r1, [r0] + adds r0, r5, 0 + bl VarSet + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E95D4 + + thumb_func_start sub_80E9608 +sub_80E9608: @ 80E9608 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r3, 0 + ldrb r0, [r4, 0x3] + cmp r3, r0 + bge _080E9660 + ldr r6, =0x0203a01c +_080E9618: + lsls r3, 16 + asrs r1, r3, 16 + ldr r2, [r4, 0x10] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2, 0x5] + cmp r0, 0x8 + bne _080E9650 + movs r0, 0 + ldrsh r1, [r5, r0] + ldrh r0, [r2] + adds r0, 0x7 + cmp r1, r0 + bne _080E9650 + movs r0, 0x2 + ldrsh r1, [r5, r0] + ldrh r0, [r2, 0x2] + adds r0, 0x7 + cmp r1, r0 + bne _080E9650 + ldr r0, [r2, 0x8] + strb r0, [r6] + b _080E9660 + .pool +_080E9650: + movs r1, 0x80 + lsls r1, 9 + adds r0, r3, r1 + lsrs r3, r0, 16 + asrs r0, 16 + ldrb r1, [r4, 0x3] + cmp r0, r1 + blt _080E9618 +_080E9660: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80E9608 + + thumb_func_start sub_80E9668 +sub_80E9668: @ 80E9668 + push {lr} + bl sub_80E9608 + bl sub_80E8B6C + ldr r0, =gUnknown_08275BB7 + bl script_env_1_execute_new_script + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E9668 + + thumb_func_start sub_80E9680 +sub_80E9680: @ 80E9680 + push {lr} + bl sub_80E8B58 + bl sub_80E8B6C + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0x1 + beq _080E969C + movs r0, 0x1 + b _080E969E + .pool +_080E969C: + movs r0, 0 +_080E969E: + pop {r1} + bx r1 + thumb_func_end sub_80E9680 + + thumb_func_start sub_80E96A4 +sub_80E96A4: @ 80E96A4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080E96DC + cmp r0, 0x1 + bgt _080E96CC + cmp r0, 0 + beq _080E96D2 + b _080E9714 + .pool +_080E96CC: + cmp r0, 0x2 + beq _080E96F4 + b _080E9714 +_080E96D2: + bl script_env_2_enable + movs r0, 0x1 + strh r0, [r4, 0x8] + b _080E9714 +_080E96DC: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080E9714 + movs r0, 0x2 + strh r0, [r4, 0x8] + b _080E9714 + .pool +_080E96F4: + movs r0, 0x7E + bl copy_saved_warp2_bank_and_enter_x_to_warp1 + bl warp_in + ldr r0, =0x03005dac + ldr r1, =mapldr_default + str r1, [r0] + ldr r0, =c2_load_new_map + bl SetMainCallback2 + bl script_env_2_disable + adds r0, r5, 0 + bl DestroyTask +_080E9714: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E96A4 + + thumb_func_start sub_80E9728 +sub_80E9728: @ 80E9728 + push {lr} + ldr r0, =sub_80E96A4 + movs r1, 0 + bl CreateTask + movs r0, 0x1 + movs r1, 0 + bl fade_screen + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E9728 + + thumb_func_start sub_80E9744 +sub_80E9744: @ 80E9744 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00001a9c + adds r0, r1 + ldr r1, =0x0203a01c + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + beq _080E9770 + ldr r1, =0x020375f0 + movs r0, 0x1 + b _080E9774 + .pool +_080E9770: + ldr r1, =0x020375f0 + movs r0, 0 +_080E9774: + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E9744 + + thumb_func_start sub_80E9780 +sub_80E9780: @ 80E9780 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =0x03005d8c + mov r8, r0 + lsls r5, r1, 2 + adds r5, r1 + lsls r5, 5 + ldr r4, [r0] + adds r4, r5, r4 + ldr r1, =0x00001a9e + adds r4, r1 + adds r0, r4, 0 + bl sub_80E8DF4 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r6, 0 + adds r1, r4, 0 + bl CopyString_LimitN + movs r1, 0xFF + strb r1, [r0] + mov r1, r8 + ldr r0, [r1] + adds r0, r5 + ldr r1, =0x00001aa9 + adds r0, r1 + ldrb r1, [r0] + adds r0, r6, 0 + bl StopMusicWhileStringIsPrinted + ldr r1, =gUnknown_085EA72F + adds r0, r6, 0 + bl AppendString + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E9780 + + thumb_func_start GetSecretBaseMapName +GetSecretBaseMapName: @ 80E97EC + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x00004054 + bl VarGet + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80E9780 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end GetSecretBaseMapName + + thumb_func_start sub_80E980C +sub_80E980C: @ 80E980C + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =0x00004054 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005d8c + mov r8, r1 + lsls r5, r0, 2 + adds r5, r0 + lsls r5, 5 + ldr r4, [r1] + adds r4, r5, r4 + ldr r0, =0x00001a9e + adds r4, r0 + ldr r6, =0x02021cc4 + adds r0, r4, 0 + bl sub_80E8DF4 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r6, 0 + adds r1, r4, 0 + bl CopyString_LimitN + movs r1, 0xFF + strb r1, [r0] + mov r1, r8 + ldr r0, [r1] + adds r0, r5 + ldr r1, =0x00001aa9 + adds r0, r1 + ldrb r1, [r0] + adds r0, r6, 0 + bl StopMusicWhileStringIsPrinted + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E980C + + thumb_func_start sub_80E9878 +sub_80E9878: @ 80E9878 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005d8c + ldr r2, [r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 5 + adds r2, r1 + ldr r0, =0x00001a9d + adds r2, r0 + ldrb r0, [r2] + lsrs r0, 6 + cmp r0, 0 + bne _080E98A4 + movs r0, 0 + b _080E98A6 + .pool +_080E98A4: + movs r0, 0x1 +_080E98A6: + pop {r1} + bx r1 + thumb_func_end sub_80E9878 + + thumb_func_start sub_80E98AC +sub_80E98AC: @ 80E98AC + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x1A + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x1B + bl pokemon_getattr + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x1C + bl pokemon_getattr + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x1D + bl pokemon_getattr + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x1E + bl pokemon_getattr + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0x1F + bl pokemon_getattr + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + movs r1, 0x6 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80E98AC + + thumb_func_start sub_80E9914 +sub_80E9914: @ 80E9914 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + movs r0, 0 + mov r10, r0 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r2, =0x00001ad0 + adds r2, r1, r2 + str r2, [sp] + ldr r3, =0x00001a9c + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _080E993A + b _080E9A60 +_080E993A: + movs r6, 0 + ldr r7, =0x00001ae8 + adds r7, r1, r7 + str r7, [sp, 0x14] + ldr r0, =0x00001b18 + adds r0, r1, r0 + str r0, [sp, 0xC] + ldr r2, =0x00001b24 + adds r2, r1, r2 + str r2, [sp, 0x10] + adds r3, 0x94 + adds r3, r1, r3 + str r3, [sp, 0x18] + ldr r7, =0x00001b36 + adds r7, r1, r7 + str r7, [sp, 0x1C] + mov r9, r6 +_080E995C: + movs r4, 0 + lsls r5, r6, 2 + lsls r3, r6, 1 + ldr r0, =0x020244ec + mov r8, r0 + adds r1, r6, 0x1 + str r1, [sp, 0x4] + adds r2, r5, 0 + ldr r1, [sp, 0x14] +_080E996E: + adds r0, r2, r4 + lsls r0, 1 + adds r0, r1, r0 + mov r7, r9 + strh r7, [r0] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _080E996E + ldr r1, [sp, 0xC] + adds r0, r1, r3 + mov r2, r9 + strh r2, [r0] + ldr r7, [sp, 0x10] + adds r0, r7, r3 + strh r2, [r0] + ldr r1, [sp, 0x18] + adds r0, r1, r6 + mov r2, r9 + strb r2, [r0] + ldr r3, [sp] + adds r0, r3, r5 + mov r7, r9 + str r7, [r0] + ldr r1, [sp, 0x1C] + adds r0, r1, r6 + strb r7, [r0] + movs r2, 0x64 + adds r5, r6, 0 + muls r5, r2 + mov r3, r8 + adds r4, r5, r3 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _080E9A54 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _080E9A54 + movs r4, 0 + mov r7, r10 + lsls r7, 2 + mov r8, r7 + mov r0, r10 + lsls r7, r0, 1 + adds r0, 0x1 + str r0, [sp, 0x8] + ldr r2, =0x020244ec +_080E99DA: + adds r1, r4, 0 + adds r1, 0xD + adds r0, r5, r2 + str r2, [sp, 0x20] + bl pokemon_getattr + mov r3, r8 + adds r1, r3, r4 + lsls r1, 1 + ldr r3, [sp, 0x14] + adds r1, r3, r1 + strh r0, [r1] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r2, [sp, 0x20] + cmp r4, 0x3 + bls _080E99DA + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + ldr r2, [sp, 0xC] + adds r1, r2, r7 + strh r0, [r1] + adds r0, r4, 0 + movs r1, 0xC + bl pokemon_getattr + ldr r3, [sp, 0x10] + adds r1, r3, r7 + strh r0, [r1] + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + ldr r1, [sp, 0x18] + add r1, r10 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + ldr r1, [sp] + add r1, r8 + str r0, [r1] + adds r0, r4, 0 + bl sub_80E98AC + ldr r1, [sp, 0x1C] + add r1, r10 + strb r0, [r1] + ldr r7, [sp, 0x8] + lsls r0, r7, 16 + lsrs r0, 16 + mov r10, r0 +_080E9A54: + ldr r1, [sp, 0x4] + lsls r0, r1, 16 + lsrs r6, r0, 16 + cmp r6, 0x5 + bhi _080E9A60 + b _080E995C +_080E9A60: + 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_80E9914 + + thumb_func_start sub_80E9A90 +sub_80E9A90: @ 80E9A90 + push {r4-r6,lr} + ldr r5, =0x03005d8c + ldr r0, [r5] + ldr r4, =0x00001aaa + adds r1, r0, r4 + ldrh r6, [r1] + ldr r1, =0x00001a9c + adds r0, r1 + bl sub_80E8AF0 + ldr r0, [r5] + adds r0, r4 + strh r6, [r0] + bl sub_80E9728 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E9A90 + + thumb_func_start sub_80E9AC0 +sub_80E9AC0: @ 80E9AC0 + push {lr} + movs r0, 0x14 + bl sav12_xor_increment + bl sub_80E9A90 + pop {r0} + bx r0 + thumb_func_end sub_80E9AC0 + + thumb_func_start sub_80E9AD0 +sub_80E9AD0: @ 80E9AD0 + push {r4-r7,lr} + ldr r0, =0x02037318 + ldr r4, [r0, 0x4] + movs r6, 0 + b _080E9B62 + .pool +_080E9AE0: + ldr r2, [r4, 0x10] + lsls r1, r6, 1 + adds r0, r1, r6 + lsls r0, 2 + adds r2, r0, r2 + ldrb r0, [r2, 0x5] + adds r7, r1, 0 + cmp r0, 0x8 + bne _080E9B5C + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00001a9c + adds r0, r1 + ldrb r1, [r0] + ldr r0, [r2, 0x8] + cmp r1, r0 + bne _080E9B5C + ldrh r0, [r2] + adds r0, 0x7 + ldrh r1, [r2, 0x2] + adds r1, 0x7 + bl MapGridGetMetatileIdAt + movs r1, 0 + ldr r5, =gUnknown_0858CFCC + lsls r0, 16 + asrs r2, r0, 16 +_080E9B16: + lsls r0, r1, 2 + adds r3, r0, r5 + ldrh r0, [r3, 0x2] + cmp r0, r2 + beq _080E9B3C + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x6 + bls _080E9B16 +_080E9B2A: + bl DrawWholeMapView + b _080E9B68 + .pool +_080E9B3C: + ldr r0, [r4, 0x10] + adds r1, r7, r6 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x7 + ldrh r1, [r1, 0x2] + adds r1, 0x7 + ldrh r3, [r3] + movs r4, 0xC0 + lsls r4, 4 + adds r2, r4, 0 + orrs r2, r3 + bl MapGridSetMetatileIdAt + b _080E9B2A +_080E9B5C: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_080E9B62: + ldrb r0, [r4, 0x3] + cmp r6, r0 + bcc _080E9AE0 +_080E9B68: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80E9AD0 + + thumb_func_start sub_80E9B70 +sub_80E9B70: @ 80E9B70 + push {r4-r6,lr} + bl sub_80E9AD0 + movs r0, 0x14 + bl sav12_xor_increment + ldr r5, =0x03005d8c + ldr r0, [r5] + ldr r4, =0x00001aaa + adds r1, r0, r4 + ldrh r6, [r1] + ldr r1, =0x00001a9c + adds r0, r1 + bl sub_80E8AF0 + ldr r0, [r5] + adds r0, r4 + strh r6, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E9B70 + + thumb_func_start sub_80E9BA8 +sub_80E9BA8: @ 80E9BA8 + push {r4,r5,lr} + movs r5, 0 + movs r4, 0x1 +_080E9BAE: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80E9878 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E9BC4 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080E9BC4: + lsls r0, r4, 16 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _080E9BAE + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80E9BA8 + + thumb_func_start sub_80E9BDC +sub_80E9BDC: @ 80E9BDC + push {lr} + ldr r0, =0x00004054 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + bl sub_80E9878 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + bne _080E9C04 + ldr r0, =0x020375f0 + strh r1, [r0] + b _080E9C22 + .pool +_080E9C04: + bl sub_80E9BA8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + bls _080E9C1C + ldr r1, =0x020375f0 + movs r0, 0x2 + b _080E9C20 + .pool +_080E9C1C: + ldr r1, =0x020375f0 + movs r0, 0 +_080E9C20: + strh r0, [r1] +_080E9C22: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E9BDC + + thumb_func_start sub_80E9C2C +sub_80E9C2C: @ 80E9C2C + push {lr} + ldr r0, =0x00004054 + bl VarGet + ldr r1, =0x03005d8c + ldr r2, [r1] + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 5 + adds r2, r1 + ldr r0, =0x00001a9d + adds r2, r0 + ldrb r3, [r2] + lsrs r1, r3, 6 + movs r0, 0x1 + eors r1, r0 + lsls r1, 6 + movs r0, 0x3F + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x86 + lsls r0, 1 + bl FlagSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E9C2C + + thumb_func_start sub_80E9C74 +sub_80E9C74: @ 80E9C74 + push {lr} + ldr r0, =sub_8126AD8 + movs r1, 0 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E9C74 + + thumb_func_start sub_80E9C88 +sub_80E9C88: @ 80E9C88 + push {lr} + ldr r0, =sub_80E9C9C + movs r1, 0 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E9C88 + + thumb_func_start sub_80E9C9C +sub_80E9C9C: @ 80E9C9C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r7, r0, 3 + ldr r0, =0x03005e08 + mov r8, r0 + adds r5, r7, r0 + bl script_env_2_enable + bl sub_80E9BA8 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5] + cmp r0, 0 + beq _080E9D10 + movs r0, 0 + strh r0, [r5, 0x2] + strh r0, [r5, 0x4] + movs r0, 0 + movs r1, 0 + bl sub_8197434 + ldr r4, =0x0203a020 + movs r0, 0xDC + lsls r0, 1 + bl AllocZeroed + str r0, [r4] + ldr r0, =gUnknown_0858D06C + bl AddWindow + strh r0, [r5, 0xC] + adds r0, r6, 0 + bl game_continue + adds r0, r6, 0 + bl sub_80E9E00 + mov r0, r8 + subs r0, 0x8 + adds r0, r7, r0 + ldr r1, =sub_80E9E90 + str r1, [r0] + b _080E9D1A + .pool +_080E9D10: + ldr r1, =gUnknown_085EA785 + ldr r2, =task_pc_turn_off + adds r0, r6, 0 + bl DisplayItemMessageOnField +_080E9D1A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E9C9C + + thumb_func_start game_continue +game_continue: @ 80E9D2C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r7, r1, r0 + movs r6, 0 + movs r5, 0x1 + ldr r0, =0x0203a020 + mov r8, r0 +_080E9D48: + adds r0, r5, 0 + bl sub_80E9878 + lsls r0, 24 + cmp r0, 0 + beq _080E9D7C + lsls r4, r6, 5 + adds r4, 0x58 + mov r1, r8 + ldr r0, [r1] + adds r0, r4 + adds r1, r5, 0 + bl sub_80E9780 + mov r3, r8 + ldr r0, [r3] + lsls r2, r6, 3 + adds r1, r0, r2 + adds r4, r0, r4 + str r4, [r1] + adds r0, 0x4 + adds r0, r2 + str r5, [r0] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_080E9D7C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x13 + bls _080E9D48 + ldr r4, =0x0203a020 + ldr r1, [r4] + lsls r3, r6, 3 + adds r2, r1, r3 + ldr r0, =gUnknown_085E8CF0 + str r0, [r2] + adds r1, 0x4 + adds r1, r3 + movs r0, 0x2 + negs r0, r0 + str r0, [r1] + adds r2, r6, 0x1 + strh r2, [r7] + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x7 + bgt _080E9DB8 + strh r2, [r7, 0x6] + b _080E9DBC + .pool +_080E9DB8: + movs r0, 0x8 + strh r0, [r7, 0x6] +_080E9DBC: + ldr r2, =0x03006310 + adds r1, r2, 0 + ldr r0, =gUnknown_0858D07C + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + ldrh r0, [r7, 0xC] + strb r0, [r2, 0x10] + ldrh r0, [r7] + strh r0, [r2, 0xC] + ldr r0, [r4] + str r0, [r2] + ldrh r0, [r7, 0x6] + strh r0, [r2, 0xE] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end game_continue + + thumb_func_start sub_80E9DEC +sub_80E9DEC: @ 80E9DEC + push {lr} + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + beq _080E9DFC + movs r0, 0x5 + bl audio_play +_080E9DFC: + pop {r0} + bx r0 + thumb_func_end sub_80E9DEC + + thumb_func_start sub_80E9E00 +sub_80E9E00: @ 80E9E00 + 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, =0x03005e08 + adds r4, r0 + ldrb r0, [r4, 0xC] + movs r1, 0 + bl SetStandardWindowBorderStyle + ldr r0, =0x03006310 + ldrh r1, [r4, 0x4] + ldrh r2, [r4, 0x2] + bl ListMenuInit + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xA] + adds r0, r5, 0 + bl sub_80E9E44 + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E9E00 + + thumb_func_start sub_80E9E44 +sub_80E9E44: @ 80E9E44 + push {r4,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e08 + adds r4, r0 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x6 + ldrsh r1, [r4, r2] + subs r0, r1 + str r0, [sp] + ldr r0, =0x000013f8 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + adds r0, r4, 0x4 + str r0, [sp, 0xC] + movs r0, 0x2 + movs r1, 0xBC + movs r2, 0xC + movs r3, 0x94 + bl AddScrollIndicatorArrowPairParametrized + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x10] + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E9E44 + + thumb_func_start sub_80E9E90 +sub_80E9E90: @ 80E9E90 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldrb r0, [r4, 0xA] + bl ListMenuHandleInput + adds r5, r0, 0 + ldrb r0, [r4, 0xA] + adds r1, r4, 0x4 + adds r2, r4, 0x2 + bl get_coro_args_x18_x1A + movs r0, 0x2 + negs r0, r0 + cmp r5, r0 + beq _080E9EC8 + adds r0, 0x1 + cmp r5, r0 + bne _080E9F0C + b _080E9F1A + .pool +_080E9EC8: + movs r0, 0x5 + bl audio_play + ldrb r0, [r4, 0xA] + movs r1, 0 + movs r2, 0 + bl sub_81AE6C8 + ldrb r0, [r4, 0x10] + bl RemoveScrollIndicatorArrowPair + ldrb r0, [r4, 0xC] + movs r1, 0 + bl sub_819746C + ldrb r0, [r4, 0xC] + bl ClearWindowTilemap + ldrb r0, [r4, 0xC] + bl RemoveWindow + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =0x0203a020 + ldr r0, [r0] + bl Free + adds r0, r6, 0 + bl task_pc_turn_off + b _080E9F1A + .pool +_080E9F0C: + movs r0, 0x5 + bl audio_play + strh r5, [r4, 0x8] + adds r0, r6, 0 + bl sub_80E9F20 +_080E9F1A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80E9E90 + + thumb_func_start sub_80E9F20 +sub_80E9F20: @ 80E9F20 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r6, =0x03005e08 + adds r5, r4, r6 + ldrb r0, [r5, 0x10] + bl RemoveScrollIndicatorArrowPair + ldr r0, =gUnknown_0858D06C + ldr r1, [r0, 0xC] + ldr r0, [r0, 0x8] + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, =gUnknown_0858D048 + mov r8, r0 + movs r1, 0x2 + bl GetMaxWidthInMenuTable + lsls r0, 24 + ldr r2, =0x00ffffff + ldr r1, [sp] + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + bl AddWindow + strh r0, [r5, 0xE] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl SetStandardWindowBorderStyle + ldrb r0, [r5, 0xE] + movs r1, 0x2 + mov r2, r8 + bl PrintMenuTable + ldrb r0, [r5, 0xE] + movs r1, 0x2 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + subs r6, 0x8 + adds r4, r6 + ldr r0, =sub_80E9FB0 + str r0, [r4] + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E9F20 + + thumb_func_start sub_80E9FB0 +sub_80E9FB0: @ 80E9FB0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + bl ProcessMenuInputNoWrapAround + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _080E9FF2 + adds r0, 0x1 + cmp r4, r0 + bne _080E9FDC + movs r0, 0x5 + bl audio_play + adds r0, r5, 0 + bl sub_80EA18C + b _080E9FF2 +_080E9FDC: + movs r0, 0x5 + bl audio_play + ldr r0, =gUnknown_0858D048 + lsls r1, r4, 3 + adds r0, 0x4 + adds r1, r0 + ldr r1, [r1] + adds r0, r6, 0 + bl _call_via_r1 +_080E9FF2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E9FB0 + + thumb_func_start sub_80E9FFC +sub_80E9FFC: @ 80E9FFC + 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, =0x03005e08 + adds r4, r0 + ldrb r0, [r4, 0xC] + movs r1, 0 + bl sub_819746C + ldrb r0, [r4, 0xE] + movs r1, 0 + bl sub_819746C + ldrb r0, [r4, 0xC] + bl ClearWindowTilemap + ldrb r0, [r4, 0xE] + bl ClearWindowTilemap + ldrb r0, [r4, 0xE] + bl RemoveWindow + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =0x02021cc4 + ldrb r1, [r4, 0x8] + bl sub_80E9780 + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EA737 + adds r0, r4, 0 + bl ExpandStringRefs + ldr r2, =sub_80EA06C + adds r0, r5, 0 + adds r1, r4, 0 + bl DisplayItemMessageOnField + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E9FFC + + thumb_func_start sub_80EA06C +sub_80EA06C: @ 80EA06C + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8197930 + ldr r1, =gUnknown_0858D058 + adds r0, r4, 0 + bl sub_8121F68 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EA06C + + thumb_func_start sub_80EA08C +sub_80EA08C: @ 80EA08C + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + ldr r0, =0x03005e08 + mov r8, r0 + adds r6, r5, r0 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + ldrb r0, [r6, 0xA] + adds r1, r6, 0x4 + mov r9, r1 + adds r1, r6, 0x2 + mov r10, r1 + mov r1, r9 + mov r2, r10 + bl sub_81AE6C8 + ldr r0, =0x03005d8c + ldr r2, [r0] + movs r0, 0x8 + ldrsh r1, [r6, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 5 + adds r2, r0 + ldr r1, =0x00001a9d + adds r2, r1 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + bl game_continue + ldrb r2, [r6, 0x6] + ldrb r3, [r6] + mov r0, r9 + mov r1, r10 + bl sub_812225C + adds r0, r4, 0 + bl sub_80E9E00 + movs r0, 0x8 + negs r0, r0 + add r8, r0 + add r5, r8 + ldr r0, =sub_80E9E90 + str r0, [r5] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EA08C + + thumb_func_start sub_80EA120 +sub_80EA120: @ 80EA120 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_085EA762 + ldr r2, =sub_80EA08C + bl DisplayItemMessageOnField + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EA120 + + thumb_func_start sub_80EA13C +sub_80EA13C: @ 80EA13C + 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, =0x03005e08 + mov r8, r0 + adds r6, r4, r0 + movs r0, 0 + movs r1, 0 + bl sub_8197434 + ldrb r0, [r6, 0xA] + adds r1, r6, 0x4 + adds r6, 0x2 + adds r2, r6, 0 + bl sub_81AE6C8 + adds r0, r5, 0 + bl sub_80E9E00 + movs r0, 0x8 + negs r0, r0 + add r8, r0 + add r4, r8 + ldr r0, =sub_80E9E90 + str r0, [r4] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EA13C + + thumb_func_start sub_80EA18C +sub_80EA18C: @ 80EA18C + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r6, =0x03005e08 + adds r5, r4, r6 + bl sub_80E9E44 + ldrb r0, [r5, 0xE] + movs r1, 0 + bl sub_819746C + ldrb r0, [r5, 0xE] + bl ClearWindowTilemap + ldrb r0, [r5, 0xE] + bl RemoveWindow + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + subs r6, 0x8 + adds r4, r6 + ldr r0, =sub_80E9E90 + str r0, [r4] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EA18C + + thumb_func_start task_pc_turn_off +task_pc_turn_off: @ 80EA1D0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + bne _080EA1F4 + ldr r0, =gUnknown_0823B4E8 + bl script_env_1_execute_new_script + b _080EA1FA + .pool +_080EA1F4: + ldr r0, =gUnknown_0823B5E9 + bl script_env_1_execute_new_script +_080EA1FA: + adds r0, r4, 0 + bl DestroyTask + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task_pc_turn_off + + thumb_func_start sub_80EA20C +sub_80EA20C: @ 80EA20C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005d8c + ldr r4, [r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 5 + adds r4, r1 + ldr r1, =0x00001aa5 + adds r0, r4, r1 + ldrb r0, [r0] + movs r1, 0x5 + bl __umodsi3 + ldr r1, =0x00001a9d + adds r4, r1 + ldrb r2, [r4] + lsls r2, 27 + lsrs r2, 31 + lsls r1, r2, 2 + adds r1, r2 + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80EA20C + + thumb_func_start sub_80EA250 +sub_80EA250: @ 80EA250 + push {lr} + ldr r0, =0x00004054 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + bl sub_80EA20C + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0 + bne _080EA278 + ldr r0, =gUnknown_08274966 + b _080EA2DA + .pool +_080EA278: + cmp r0, 0x1 + bne _080EA284 + ldr r0, =gUnknown_08274D13 + b _080EA2DA + .pool +_080EA284: + cmp r0, 0x2 + bne _080EA290 + ldr r0, =gUnknown_08274FFE + b _080EA2DA + .pool +_080EA290: + cmp r0, 0x3 + bne _080EA29C + ldr r0, =gUnknown_08275367 + b _080EA2DA + .pool +_080EA29C: + cmp r0, 0x4 + bne _080EA2A8 + ldr r0, =gUnknown_082756C7 + b _080EA2DA + .pool +_080EA2A8: + cmp r0, 0x5 + bne _080EA2B4 + ldr r0, =gUnknown_08274B24 + b _080EA2DA + .pool +_080EA2B4: + cmp r0, 0x6 + bne _080EA2C0 + ldr r0, =gUnknown_08274E75 + b _080EA2DA + .pool +_080EA2C0: + cmp r0, 0x7 + bne _080EA2CC + ldr r0, =gUnknown_082751E1 + b _080EA2DA + .pool +_080EA2CC: + cmp r1, 0x8 + beq _080EA2D8 + ldr r0, =gUnknown_082758CC + b _080EA2DA + .pool +_080EA2D8: + ldr r0, =gUnknown_082754F6 +_080EA2DA: + pop {r1} + bx r1 + .pool + thumb_func_end sub_80EA250 + + thumb_func_start sub_80EA2E4 +sub_80EA2E4: @ 80EA2E4 + push {lr} + movs r0, 0x1 + bl sub_813BADC + ldr r1, =0x02038bca + movs r2, 0x80 + lsls r2, 3 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, =0x02022fec + ldr r0, =0x08000008 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EA2E4 + + thumb_func_start sub_80EA30C +sub_80EA30C: @ 80EA30C + push {lr} + ldr r0, =0x00004054 + bl VarGet + ldr r1, =0x03005d8c + ldr r3, [r1] + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 5 + adds r3, r1 + ldr r0, =0x020375f0 + ldrb r0, [r0] + ldr r1, =0x00001a9d + adds r3, r1 + movs r1, 0x1 + ands r1, r0 + lsls r1, 5 + ldrb r2, [r3] + movs r0, 0x21 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EA30C + + thumb_func_start sub_80EA354 +sub_80EA354: @ 80EA354 + push {r4-r7,lr} + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =0x00000922 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _080EA39A + movs r3, 0 + ldr r7, =0x03005d8c + ldr r4, =0x00001a9d + movs r6, 0x21 + negs r6, r6 +_080EA376: + ldr r1, [r7] + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 5 + adds r1, r0 + adds r1, r4 + ldrb r2, [r1] + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x13 + bls _080EA376 + ldr r0, =0x00000922 + bl FlagSet +_080EA39A: + ldr r4, =0x020375e0 + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_80EA20C + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + ldr r2, =0x020375f0 + ldr r0, =0x03005d8c + ldr r1, [r0] + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 5 + adds r1, r0 + ldr r0, =0x00001a9d + adds r1, r0 + ldrb r0, [r1] + lsls r0, 26 + lsrs r0, 31 + strh r0, [r2] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EA354 + + thumb_func_start sub_80EA3E4 +sub_80EA3E4: @ 80EA3E4 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r5, r1, r0 + movs r1, 0x2 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _080EA448 + cmp r0, 0x1 + bgt _080EA40C + cmp r0, 0 + beq _080EA414 + b _080EA820 + .pool +_080EA40C: + cmp r0, 0x2 + bne _080EA412 + b _080EA810 +_080EA412: + b _080EA820 +_080EA414: + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _080EA434 + ldr r1, =0x0203a01d + movs r0, 0x1 + strb r0, [r1] + b _080EA438 + .pool +_080EA434: + ldr r0, =0x0203a01d + strb r1, [r0] +_080EA438: + adds r0, r5, 0x4 + adds r1, r5, 0x6 + bl PlayerGetDestCoords + b _080EA81C + .pool +_080EA448: + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + mov r0, sp + ldrh r2, [r0] + movs r3, 0 + ldrsh r1, [r0, r3] + movs r3, 0x4 + ldrsh r0, [r5, r3] + adds r6, r4, 0 + cmp r1, r0 + bne _080EA474 + movs r0, 0 + ldrsh r1, [r6, r0] + movs r3, 0x6 + ldrsh r0, [r5, r3] + cmp r1, r0 + bne _080EA474 + b _080EA820 +_080EA474: + strh r2, [r5, 0x4] + ldrh r0, [r6] + strh r0, [r5, 0x6] + ldr r4, =0x000040ec + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r6, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, sp + movs r3, 0 + ldrsh r0, [r0, r3] + movs r2, 0 + ldrsh r1, [r6, r2] + bl MapGridGetMetatileIdAt + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0x8D + lsls r0, 2 + cmp r4, r0 + beq _080EA4C2 + adds r0, 0x8 + cmp r4, r0 + bne _080EA4E8 +_080EA4C2: + ldr r0, =0x0203a01d + ldrb r0, [r0] + cmp r0, 0x1 + beq _080EA4CC + b _080EA820 +_080EA4CC: + ldr r4, =0x000040ef + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r0, 0x20 + b _080EA7FA + .pool +_080EA4E8: + ldr r3, =0xfffffd48 + adds r0, r4, r3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bls _080EA51A + movs r0, 0xB0 + lsls r0, 2 + cmp r4, r0 + beq _080EA51A + adds r0, 0x1 + cmp r4, r0 + beq _080EA51A + adds r0, 0x1 + cmp r4, r0 + beq _080EA51A + adds r0, 0x6 + cmp r4, r0 + beq _080EA51A + adds r0, 0x1 + cmp r4, r0 + beq _080EA51A + adds r0, 0x1 + cmp r4, r0 + bne _080EA540 +_080EA51A: + ldr r0, =0x0203a01d + ldrb r0, [r0] + cmp r0, 0x1 + beq _080EA524 + b _080EA820 +_080EA524: + ldr r4, =0x000040ee + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r0, 0x1 + b _080EA7FA + .pool +_080EA540: + ldr r0, =0x00000239 + cmp r4, r0 + beq _080EA558 + adds r0, 0x8 + cmp r4, r0 + beq _080EA558 + adds r0, 0x10 + cmp r4, r0 + beq _080EA558 + adds r0, 0x8 + cmp r4, r0 + bne _080EA57C +_080EA558: + ldr r0, =0x0203a01d + ldrb r0, [r0] + cmp r0, 0x1 + beq _080EA562 + b _080EA820 +_080EA562: + ldr r4, =0x000040ee + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r0, 0x4 + b _080EA7FA + .pool +_080EA57C: + cmp r5, 0x34 + bne _080EA586 + ldr r0, =0x0000026d + cmp r4, r0 + beq _080EA59E +_080EA586: + cmp r5, 0x35 + bne _080EA5CC + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r6, r2] + bl MapGridGetMetatileIdAt + ldr r1, =0x0000026a + cmp r0, r1 + bne _080EA5CC +_080EA59E: + ldr r0, =0x0203a01d + ldrb r0, [r0] + cmp r0, 0x1 + beq _080EA5A8 + b _080EA820 +_080EA5A8: + ldr r4, =0x000040ef + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r3, 0x80 + lsls r3, 2 + adds r0, r3, 0 + b _080EA7FA + .pool +_080EA5CC: + cmp r5, 0xC1 + bne _080EA618 + ldr r0, =0x0000023d + cmp r4, r0 + bne _080EA618 + ldr r0, =0x0203a01d + ldrb r0, [r0] + cmp r0, 0x1 + beq _080EA5E0 + b _080EA820 +_080EA5E0: + ldr r4, =0x000040ef + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 5 + adds r0, r2, 0 + eors r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r3, 0x80 + lsls r3, 6 + adds r0, r3, 0 + b _080EA7FA + .pool +_080EA618: + cmp r5, 0x47 + bne _080EA668 + ldr r0, =0x0000023e + cmp r4, r0 + bne _080EA668 + ldr r0, =0x0203a01d + ldrb r0, [r0] + cmp r0, 0x1 + beq _080EA62C + b _080EA820 +_080EA62C: + ldr r4, =0x000040ef + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 5 + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r3, 0x80 + lsls r3, 6 + adds r0, r3, 0 + eors r1, r0 + b _080EA7FC + .pool +_080EA668: + adds r0, r5, 0 + bl sub_80893C8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EA698 + ldr r0, =0x0203a01d + ldrb r0, [r0] + cmp r0, 0x1 + beq _080EA680 + b _080EA820 +_080EA680: + ldr r4, =0x000040ef + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r0, 0x80 + b _080EA7FA + .pool +_080EA698: + adds r0, r5, 0 + bl sub_808938C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EA72C + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r6, r2] + bl MapGridGetMetatileIdAt + lsls r0, 16 + asrs r0, 16 + mov r1, sp + movs r3, 0 + ldrsh r1, [r1, r3] + movs r3, 0 + ldrsh r2, [r6, r3] + bl sub_80FA5E4 + ldr r0, =0x0203a01d + ldrb r0, [r0] + cmp r0, 0x1 + beq _080EA6D0 + b _080EA820 +_080EA6D0: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r6, r2] + bl MapGridGetMetatileIdAt + adds r1, r0, 0 + movs r0, 0xCE + lsls r0, 2 + cmp r1, r0 + beq _080EA70C + cmp r1, r0 + bgt _080EA6FC + movs r0, 0x8A + lsls r0, 2 + cmp r1, r0 + beq _080EA714 + b _080EA820 + .pool +_080EA6FC: + movs r0, 0xCF + lsls r0, 2 + cmp r1, r0 + beq _080EA70C + adds r0, 0x4 + cmp r1, r0 + beq _080EA70C + b _080EA820 +_080EA70C: + ldr r4, =0x000040ee + b _080EA7F0 + .pool +_080EA714: + ldr r4, =0x000040ee + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + b _080EA7FA + .pool +_080EA72C: + adds r0, r5, 0 + bl sub_80893A0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EA778 + ldr r0, =0x0203a01d + ldrb r0, [r0] + cmp r0, 0x1 + bne _080EA75E + ldr r4, =0x000040ef + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 3 + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet +_080EA75E: + mov r0, sp + movs r3, 0 + ldrsh r0, [r0, r3] + movs r2, 0 + ldrsh r1, [r6, r2] + bl sub_80FA794 + b _080EA820 + .pool +_080EA778: + adds r0, r5, 0 + bl sub_80893B4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EA7A8 + ldr r0, =0x0203a01d + ldrb r0, [r0] + cmp r0, 0x1 + bne _080EA820 + ldr r4, =0x000040ee + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r3, 0x80 + lsls r3, 8 + adds r0, r3, 0 + b _080EA7FA + .pool +_080EA7A8: + adds r0, r5, 0 + bl MetatileBehavior_0xBB + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EA7D8 + ldr r0, =0x0203a01d + ldrb r0, [r0] + cmp r0, 0x1 + bne _080EA820 + ldr r4, =0x000040ef + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 7 + adds r0, r2, 0 + b _080EA7FA + .pool +_080EA7D8: + adds r0, r5, 0 + bl MetatileBehavior_0xBC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EA820 + ldr r0, =0x0203a01d + ldrb r0, [r0] + cmp r0, 0x1 + bne _080EA820 + ldr r4, =0x000040ef +_080EA7F0: + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r0, 0x2 +_080EA7FA: + orrs r1, r0 +_080EA7FC: + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet + b _080EA820 + .pool +_080EA810: + ldrb r0, [r5, 0x8] + bl FieldEffectActiveListContains + lsls r0, 24 + cmp r0, 0 + bne _080EA820 +_080EA81C: + movs r0, 0x1 + strh r0, [r5, 0x2] +_080EA820: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80EA3E4 + + thumb_func_start sub_80EA828 +sub_80EA828: @ 80EA828 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r2, 0 + mov r8, r3 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r6, =0x03005d8c + ldr r0, [r6] + lsls r2, r5, 2 + adds r2, r5 + lsls r4, r2, 5 + adds r0, r4 + ldr r2, =0x00001a9c + mov r9, r2 + add r0, r9 + movs r2, 0xA0 + bl memcpy + ldr r2, [r6] + adds r2, r4 + ldr r0, =0x00001a9d + adds r2, r0 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + subs r0, r7, 0x1 + cmp r0, 0x1 + bhi _080EA876 + ldr r0, [r6] + adds r0, r4 + ldr r1, =0x00001aa9 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] +_080EA876: + cmp r7, 0x3 + bne _080EA8B8 + mov r2, r8 + cmp r2, 0x1 + bne _080EA8B8 + mov r1, r9 + adds r0, r4, r1 + ldr r1, [r6] + adds r1, r0 + adds r2, r1, 0x2 + movs r3, 0 + ldrb r0, [r1, 0x2] + cmp r0, 0xFF + beq _080EA8A0 +_080EA892: + adds r3, 0x1 + cmp r3, 0x6 + bgt _080EA8A0 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080EA892 +_080EA8A0: + cmp r3, 0x5 + ble _080EA8B8 + ldr r0, =0x03005d8c + ldr r1, [r0] + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 5 + adds r1, r0 + ldr r2, =0x00001aa9 + adds r1, r2 + movs r0, 0x2 + strb r0, [r1] +_080EA8B8: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EA828 + + thumb_func_start sub_80EA8D4 +sub_80EA8D4: @ 80EA8D4 + push {r4,lr} + movs r2, 0 + adds r4, r0, 0 + adds r4, 0x9 + adds r3, r1, 0 + adds r3, 0x9 +_080EA8E0: + adds r0, r4, r2 + adds r1, r3, r2 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + beq _080EA8F0 + movs r0, 0 + b _080EA8FC +_080EA8F0: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _080EA8E0 + movs r0, 0x1 +_080EA8FC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80EA8D4 + + thumb_func_start sub_80EA904 +sub_80EA904: @ 80EA904 + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + movs r3, 0 + ldrb r0, [r6, 0x2] + cmp r0, 0xFF + bne _080EA918 + ldrb r0, [r5, 0x2] + cmp r0, 0xFF + beq _080EA946 +_080EA918: + adds r2, r6, 0x2 + adds r0, r2, r3 + adds r4, r5, 0x2 + adds r1, r4, r3 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + beq _080EA92C + movs r0, 0 + b _080EA948 +_080EA92C: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x6 + bhi _080EA946 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080EA918 + adds r0, r4, r3 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080EA918 +_080EA946: + movs r0, 0x1 +_080EA948: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80EA904 + + thumb_func_start sub_80EA950 +sub_80EA950: @ 80EA950 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r2, [r4, 0x1] + movs r0, 0x10 + adds r1, r0, 0 + ands r1, r2 + ldrb r2, [r5, 0x1] + ands r0, r2 + cmp r1, r0 + bne _080EA986 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80EA8D4 + lsls r0, 24 + cmp r0, 0 + beq _080EA986 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80EA904 + lsls r0, 24 + cmp r0, 0 + beq _080EA986 + movs r0, 0x1 + b _080EA988 +_080EA986: + movs r0, 0 +_080EA988: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80EA950 + + thumb_func_start sub_80EA990 +sub_80EA990: @ 80EA990 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + movs r1, 0 + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r4, =0x00001a9c +_080EA99E: + lsls r0, r1, 16 + asrs r1, r0, 16 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 5 + adds r0, r2, r0 + adds r0, r4 + ldrb r0, [r0] + cmp r0, r3 + bne _080EA9C0 + adds r0, r1, 0 + b _080EA9D0 + .pool +_080EA9C0: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _080EA99E + movs r0, 0x1 + negs r0, r0 +_080EA9D0: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80EA990 + + thumb_func_start sub_80EA9D8 +sub_80EA9D8: @ 80EA9D8 + push {r4,lr} + movs r2, 0x1 + ldr r0, =0x03005d8c + ldr r3, [r0] + ldr r4, =0x00001a9c +_080EA9E2: + lsls r0, r2, 16 + asrs r1, r0, 16 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 5 + adds r0, r3, r0 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _080EAA04 + lsls r0, r2, 24 + lsrs r0, 24 + b _080EAA12 + .pool +_080EAA04: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _080EA9E2 + movs r0, 0 +_080EAA12: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80EA9D8 + + thumb_func_start sub_80EAA18 +sub_80EAA18: @ 80EAA18 + push {r4,lr} + movs r3, 0x1 + ldr r0, =0x03005d8c + ldr r4, [r0] +_080EAA20: + lsls r2, r3, 16 + asrs r1, r2, 16 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 5 + adds r0, r4, r0 + ldr r1, =0x00001a9d + adds r0, r1 + ldrb r1, [r0] + lsrs r0, r1, 6 + cmp r0, 0 + bne _080EAA4C + lsls r0, r1, 28 + cmp r0, 0 + bne _080EAA4C + lsls r0, r3, 24 + lsrs r0, 24 + b _080EAA5C + .pool +_080EAA4C: + movs r1, 0x80 + lsls r1, 9 + adds r0, r2, r1 + lsrs r3, r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _080EAA20 + movs r0, 0 +_080EAA5C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80EAA18 + + thumb_func_start sub_80EAA64 +sub_80EAA64: @ 80EAA64 + push {r4-r7,lr} + adds r5, r0, 0 + adds r6, r1, 0 + adds r7, r2, 0 + ldrb r0, [r5] + cmp r0, 0 + beq _080EAAEC + ldrb r0, [r5] + bl sub_80EA990 + lsls r0, 16 + lsrs r4, r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + beq _080EAAEC + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _080EAAC4 + ldr r0, =0x03005d8c + ldr r1, [r0] + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 5 + adds r1, r0 + ldr r0, =0x00001a9d + adds r1, r0 + ldrb r1, [r1] + lsls r0, r1, 28 + lsrs r0, 28 + cmp r0, 0x1 + beq _080EAAEC + lsrs r0, r1, 6 + cmp r0, 0x2 + bne _080EAAB4 + ldrb r1, [r5, 0x1] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + bne _080EAAEC +_080EAAB4: + lsls r4, 24 + lsrs r4, 24 + b _080EAADC + .pool +_080EAAC4: + bl sub_80EA9D8 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080EAADC + bl sub_80EAA18 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _080EAAEC +_080EAADC: + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r7, 0 + bl sub_80EA828 + adds r0, r4, 0 + b _080EAAEE +_080EAAEC: + movs r0, 0 +_080EAAEE: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80EAA64 + + thumb_func_start sub_80EAAF4 +sub_80EAAF4: @ 80EAAF4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xA0 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00001a9c + adds r7, r0, r1 + movs r2, 0x1 +_080EAB08: + adds r1, r2, 0x1 + lsls r0, r1, 24 + lsrs r5, r0, 24 + mov r9, r1 + cmp r5, 0x13 + bhi _080EAB84 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 5 + adds r6, r0, r7 + movs r0, 0xC0 + mov r8, r0 +_080EAB20: + ldrb r0, [r6, 0x1] + mov r3, r8 + ands r3, r0 + cmp r3, 0 + bne _080EAB3E + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 5 + adds r0, r7 + ldrb r1, [r0, 0x1] + mov r0, r8 + ands r0, r1 + adds r4, r2, 0 + cmp r0, 0x40 + beq _080EAB56 +_080EAB3E: + cmp r3, 0x80 + bne _080EAB7A + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 5 + adds r0, r7 + ldrb r1, [r0, 0x1] + mov r0, r8 + ands r0, r1 + adds r4, r2, 0 + cmp r0, 0x80 + beq _080EAB7A +_080EAB56: + mov r0, sp + adds r1, r6, 0 + movs r2, 0xA0 + bl memcpy + adds r4, r5 + lsls r4, 5 + adds r4, r7 + adds r0, r6, 0 + adds r1, r4, 0 + movs r2, 0xA0 + bl memcpy + adds r0, r4, 0 + mov r1, sp + movs r2, 0xA0 + bl memcpy +_080EAB7A: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x13 + bls _080EAB20 +_080EAB84: + mov r1, r9 + lsls r0, r1, 24 + lsrs r2, r0, 24 + cmp r2, 0x12 + bls _080EAB08 + add sp, 0xA0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EAAF4 + + thumb_func_start sub_80EABA4 +sub_80EABA4: @ 80EABA4 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + movs r4, 0x1 +_080EABAE: + ldr r0, [r5] + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 5 + adds r3, r1, r0 + ldrb r0, [r3, 0x1] + lsrs r0, 6 + cmp r0, r6 + bne _080EABCA + ldr r1, [r5, 0x4] + ldr r2, [r5, 0x8] + adds r0, r3, 0 + bl sub_80EAA64 +_080EABCA: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x13 + bls _080EABAE + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80EABA4 + + thumb_func_start sub_80EABDC +sub_80EABDC: @ 80EABDC + push {r4-r6,lr} + adds r5, r0, 0 + ldrb r0, [r5] + cmp r0, 0 + beq _080EABF8 + ldrb r0, [r5, 0x1] + lsls r0, 27 + ldr r1, =0x03005d90 + ldr r3, [r1] + lsrs r0, 31 + adds r6, r1, 0 + ldrb r1, [r3, 0x8] + cmp r0, r1 + beq _080EAC00 +_080EABF8: + movs r0, 0 + b _080EAC56 + .pool +_080EAC00: + movs r2, 0 + adds r4, r5, 0 + adds r4, 0x9 + adds r3, 0xA +_080EAC08: + adds r0, r4, r2 + adds r1, r3, r2 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bne _080EABF8 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _080EAC08 + movs r2, 0 + ldrb r0, [r5, 0x2] + cmp r0, 0xFF + bne _080EAC2A + ldr r0, [r6] + b _080EAC4E +_080EAC2A: + adds r3, r5, 0x2 + adds r0, r3, r2 + ldr r4, [r6] + adds r1, r4, r2 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bne _080EABF8 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x6 + bhi _080EAC54 + adds r0, r3, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080EAC2A + adds r0, r4, r2 +_080EAC4E: + ldrb r0, [r0] + cmp r0, 0xFF + bne _080EAC2A +_080EAC54: + movs r0, 0x1 +_080EAC56: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80EABDC + + thumb_func_start sub_80EAC5C +sub_80EAC5C: @ 80EAC5C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r0 + mov r9, r1 + mov r8, r2 + movs r5, 0 + movs r6, 0 +_080EAC70: + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + bne _080EAC9A + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 5 + mov r1, r10 + adds r4, r1, r0 + adds r0, r4, 0 + bl sub_80EABDC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EAC9A + adds r0, r4, 0 + bl sub_80E8AF0 + movs r0, 0x1 + orrs r5, r0 +_080EAC9A: + movs r7, 0x2 + movs r0, 0x2 + ands r0, r5 + cmp r0, 0 + bne _080EACC8 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 5 + mov r1, r9 + adds r4, r1, r0 + adds r0, r4, 0 + bl sub_80EABDC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EACC8 + adds r0, r4, 0 + bl sub_80E8AF0 + orrs r5, r7 + lsls r0, r5, 24 + lsrs r5, r0, 24 +_080EACC8: + movs r7, 0x4 + movs r0, 0x4 + ands r0, r5 + cmp r0, 0 + bne _080EACF6 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 5 + mov r1, r8 + adds r4, r1, r0 + adds r0, r4, 0 + bl sub_80EABDC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EACF6 + adds r0, r4, 0 + bl sub_80E8AF0 + orrs r5, r7 + lsls r0, r5, 24 + lsrs r5, r0, 24 +_080EACF6: + cmp r5, 0x7 + beq _080EAD04 + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x13 + bls _080EAC70 +_080EAD04: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80EAC5C + + thumb_func_start sub_80EAD14 +sub_80EAD14: @ 80EAD14 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + mov r8, r1 + lsls r2, 24 + lsrs r7, r2, 24 + movs r5, 0 +_080EAD24: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 5 + mov r1, r8 + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0 + beq _080EAD7E + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80EA950 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EAD7E + cmp r7, 0 + bne _080EAD50 + adds r0, r4, 0 + bl sub_80E8AF0 + b _080EAD88 +_080EAD50: + ldrh r0, [r6, 0xE] + ldrh r3, [r4, 0xE] + cmp r0, r3 + bls _080EAD60 + adds r0, r4, 0 + bl sub_80E8AF0 + b _080EAD88 +_080EAD60: + ldrb r0, [r6, 0x1] + lsls r0, 28 + lsrs r0, 28 + ldrb r1, [r4, 0x1] + movs r3, 0x10 + negs r3, r3 + adds r2, r3, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x1] + adds r0, r6, 0 + bl sub_80E8AF0 + movs r0, 0x1 + b _080EAD8A +_080EAD7E: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x13 + bls _080EAD24 +_080EAD88: + movs r0, 0 +_080EAD8A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80EAD14 + + thumb_func_start sub_80EAD94 +sub_80EAD94: @ 80EAD94 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r0 + adds r7, r1, 0 + mov r8, r2 + adds r6, r3, 0 + movs r5, 0x1 +_080EADA6: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 5 + mov r1, r9 + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0 + beq _080EADF8 + ldrb r1, [r4, 0x1] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0x40 + bne _080EADCE + movs r2, 0x10 + negs r2, r2 + adds r0, r2, 0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4, 0x1] +_080EADCE: + adds r0, r4, 0 + adds r1, r7, 0 + adds r2, r5, 0 + bl sub_80EAD14 + lsls r0, 24 + cmp r0, 0 + bne _080EADF8 + adds r0, r4, 0 + mov r1, r8 + adds r2, r5, 0 + bl sub_80EAD14 + lsls r0, 24 + cmp r0, 0 + bne _080EADF8 + adds r0, r4, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_80EAD14 +_080EADF8: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x13 + bls _080EADA6 + movs r5, 0 +_080EAE04: + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 5 + adds r4, r0, r7 + ldrb r0, [r4] + cmp r0, 0 + beq _080EAE38 + ldrb r0, [r4, 0x1] + movs r2, 0x21 + negs r2, r2 + adds r1, r2, 0 + ands r0, r1 + strb r0, [r4, 0x1] + adds r0, r4, 0 + mov r1, r8 + adds r2, r5, 0 + bl sub_80EAD14 + lsls r0, 24 + cmp r0, 0 + bne _080EAE38 + adds r0, r4, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_80EAD14 +_080EAE38: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x13 + bls _080EAE04 + movs r5, 0 + movs r0, 0x21 + negs r0, r0 + adds r7, r0, 0 +_080EAE4A: + lsls r0, r5, 2 + adds r0, r5 + lsls r4, r0, 5 + mov r2, r8 + adds r1, r4, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _080EAE6A + ldrb r0, [r1, 0x1] + ands r0, r7 + strb r0, [r1, 0x1] + adds r0, r1, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_80EAD14 +_080EAE6A: + adds r1, r4, r6 + ldrb r0, [r1] + cmp r0, 0 + beq _080EAE78 + ldrb r0, [r1, 0x1] + ands r0, r7 + strb r0, [r1, 0x1] +_080EAE78: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x13 + bls _080EAE4A + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80EAD94 + + thumb_func_start sub_80EAE90 +sub_80EAE90: @ 80EAE90 + push {r4,lr} + adds r4, r0, 0 + adds r3, r1, 0 + ldrb r1, [r4, 0x1] + movs r0, 0xF + ands r0, r1 + cmp r0, 0x1 + bne _080EAEAE + adds r0, r4, 0 + adds r1, r3, 0 + bl sub_80EAA64 + adds r0, r4, 0 + bl sub_80E8AF0 +_080EAEAE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80EAE90 + + thumb_func_start sub_80EAEB4 +sub_80EAEB4: @ 80EAEB4 + push {r4-r6,lr} + adds r5, r0, 0 + movs r6, 0 +_080EAEBA: + lsls r4, r6, 2 + adds r4, r6 + lsls r4, 5 + ldr r0, [r5] + adds r0, r4 + ldr r1, [r5, 0x4] + ldr r2, [r5, 0x8] + bl sub_80EAE90 + ldr r0, [r5, 0xC] + adds r0, r4 + ldr r1, [r5, 0x10] + ldr r2, [r5, 0x14] + bl sub_80EAE90 + ldr r0, [r5, 0x18] + adds r0, r4 + ldr r1, [r5, 0x1C] + ldr r2, [r5, 0x20] + bl sub_80EAE90 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x13 + bls _080EAEBA + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80EAEB4 + + thumb_func_start sub_80EAEF4 +sub_80EAEF4: @ 80EAEF4 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r0, [r4] + ldr r1, [r4, 0xC] + ldr r2, [r4, 0x18] + bl sub_80EAC5C + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00001a9c + adds r0, r1 + ldr r1, [r4] + ldr r2, [r4, 0xC] + ldr r3, [r4, 0x18] + bl sub_80EAD94 + adds r0, r4, 0 + bl sub_80EAEB4 + ldr r0, [r4] + ldr r1, [r4, 0x4] + ldr r2, [r4, 0x8] + bl sub_80EAA64 + ldr r0, [r4, 0xC] + ldr r1, [r4, 0x10] + ldr r2, [r4, 0x14] + bl sub_80EAA64 + ldr r0, [r4, 0x18] + ldr r1, [r4, 0x1C] + ldr r2, [r4, 0x20] + bl sub_80EAA64 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80EABA4 + adds r6, r4, 0 + adds r6, 0xC + adds r0, r6, 0 + movs r1, 0x1 + bl sub_80EABA4 + adds r5, r4, 0 + adds r5, 0x18 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80EABA4 + adds r0, r4, 0 + movs r1, 0 + bl sub_80EABA4 + adds r0, r6, 0 + movs r1, 0 + bl sub_80EABA4 + adds r0, r5, 0 + movs r1, 0 + bl sub_80EABA4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EAEF4 + + thumb_func_start sub_80EAF80 +sub_80EAF80: @ 80EAF80 + push {r4-r7,lr} + sub sp, 0x24 + adds r6, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r7, r2, 24 + movs r0, 0x60 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _080EAF9A + b _080EB16A +_080EAF9A: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _080EAFAC + cmp r0, 0x3 + beq _080EAFC8 + b _080EAFD6 +_080EAFAC: + lsls r4, r5, 1 + adds r0, r6, r4 + movs r1, 0 + adds r2, r5, 0 + bl memset + adds r4, r5 + adds r4, r6, r4 + adds r0, r4, 0 + movs r1, 0 + adds r2, r5, 0 + bl memset + b _080EAFD6 +_080EAFC8: + lsls r0, r5, 1 + adds r0, r5 + adds r0, r6, r0 + movs r1, 0 + adds r2, r5, 0 + bl memset +_080EAFD6: + cmp r7, 0x1 + beq _080EB030 + cmp r7, 0x1 + bgt _080EAFE4 + cmp r7, 0 + beq _080EAFEE + b _080EB0D4 +_080EAFE4: + cmp r7, 0x2 + beq _080EB074 + cmp r7, 0x3 + beq _080EB0A8 + b _080EB0D4 +_080EAFEE: + adds r0, r6, r5 + str r0, [sp] + ldr r4, =0x020229e8 + movs r3, 0xFF + ldrb r0, [r4, 0x1C] + str r0, [sp, 0x4] + ldrh r0, [r4, 0x36] + str r0, [sp, 0x8] + lsls r1, r5, 1 + adds r0, r6, r1 + str r0, [sp, 0xC] + ldrh r2, [r4, 0x38] + adds r0, r3, 0 + ands r0, r2 + str r0, [sp, 0x10] + adds r0, r4, 0 + adds r0, 0x52 + ldrh r0, [r0] + str r0, [sp, 0x14] + adds r1, r5 + adds r1, r6, r1 + str r1, [sp, 0x18] + adds r0, r4, 0 + adds r0, 0x54 + ldrh r0, [r0] + ands r3, r0 + str r3, [sp, 0x1C] + adds r0, r4, 0 + adds r0, 0x6E + ldrh r0, [r0] + b _080EB0D2 + .pool +_080EB030: + lsls r2, r5, 1 + adds r0, r6, r2 + str r0, [sp] + ldr r4, =0x020229e8 + ldrh r3, [r4, 0x38] + movs r1, 0xFF + adds r0, r1, 0 + ands r0, r3 + str r0, [sp, 0x4] + adds r0, r4, 0 + adds r0, 0x52 + ldrh r0, [r0] + str r0, [sp, 0x8] + adds r2, r5 + adds r2, r6, r2 + str r2, [sp, 0xC] + adds r0, r4, 0 + adds r0, 0x54 + ldrh r2, [r0] + adds r0, r1, 0 + ands r0, r2 + str r0, [sp, 0x10] + adds r0, r4, 0 + adds r0, 0x6E + ldrh r0, [r0] + str r0, [sp, 0x14] + str r6, [sp, 0x18] + ldrh r0, [r4] + ands r1, r0 + str r1, [sp, 0x1C] + ldrh r0, [r4, 0x1A] + b _080EB0D2 + .pool +_080EB074: + lsls r0, r5, 1 + adds r0, r5 + adds r0, r6, r0 + str r0, [sp] + ldr r1, =0x020229e8 + adds r0, r1, 0 + adds r0, 0x54 + ldrb r0, [r0] + str r0, [sp, 0x4] + adds r0, r1, 0 + adds r0, 0x6E + ldrh r0, [r0] + str r0, [sp, 0x8] + str r6, [sp, 0xC] + ldrb r0, [r1] + str r0, [sp, 0x10] + ldrh r0, [r1, 0x1A] + str r0, [sp, 0x14] + adds r0, r6, r5 + str r0, [sp, 0x18] + ldrb r0, [r1, 0x1C] + str r0, [sp, 0x1C] + ldrh r0, [r1, 0x36] + b _080EB0D2 + .pool +_080EB0A8: + str r6, [sp] + ldr r1, =0x020229e8 + ldrb r0, [r1] + str r0, [sp, 0x4] + ldrh r0, [r1, 0x1A] + str r0, [sp, 0x8] + adds r0, r6, r5 + str r0, [sp, 0xC] + movs r2, 0xFF + ldrb r0, [r1, 0x1C] + str r0, [sp, 0x10] + ldrh r0, [r1, 0x36] + str r0, [sp, 0x14] + lsls r0, r5, 1 + adds r0, r6, r0 + str r0, [sp, 0x18] + ldrh r0, [r1, 0x38] + ands r2, r0 + str r2, [sp, 0x1C] + adds r1, 0x52 + ldrh r0, [r1] +_080EB0D2: + str r0, [sp, 0x20] +_080EB0D4: + mov r0, sp + bl sub_80EAEF4 + movs r3, 0x1 + ldr r6, =0x03005d8c + movs r7, 0x10 + negs r7, r7 +_080EB0E2: + ldr r0, [r6] + lsls r1, r3, 2 + adds r1, r3 + lsls r4, r1, 5 + adds r0, r4 + ldr r5, =0x00001a9d + adds r2, r0, r5 + ldrb r1, [r2] + lsls r0, r1, 28 + lsrs r0, 28 + cmp r0, 0x1 + bne _080EB112 + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + ldr r1, [r6] + adds r1, r4 + adds r1, r5 + ldrb r2, [r1] + adds r0, r7, 0 + ands r0, r2 + strb r0, [r1] +_080EB112: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x13 + bls _080EB0E2 + bl sub_80EAAF4 + movs r3, 0x1 + ldr r7, =0x03005d8c + adds r6, r7, 0 + adds r4, r5, 0 + movs r5, 0x3F +_080EB12A: + ldr r0, [r6] + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 5 + adds r0, r1 + adds r2, r0, r4 + ldrb r1, [r2] + lsrs r0, r1, 6 + cmp r0, 0x2 + bne _080EB144 + adds r0, r5, 0 + ands r0, r1 + strb r0, [r2] +_080EB144: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x13 + bls _080EB12A + ldr r1, [r7] + ldr r2, =0x00001a9c + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080EB16A + ldr r0, =0x00001aaa + adds r2, r1, r0 + ldrh r1, [r2] + ldr r0, =0x0000ffff + cmp r1, r0 + beq _080EB16A + adds r0, r1, 0x1 + strh r0, [r2] +_080EB16A: + add sp, 0x24 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EAF80 + + thumb_func_start sub_80EB18C +sub_80EB18C: @ 80EB18C + push {r4,r5,lr} + movs r5, 0 + adds r4, r0, 0 +_080EB192: + ldrb r0, [r4, 0xD] + cmp r0, 0x1 + bne _080EB19E + adds r0, r4, 0 + bl sub_80E8AF0 +_080EB19E: + adds r4, 0xA0 + adds r5, 0x1 + cmp r5, 0x13 + bls _080EB192 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80EB18C + + thumb_func_start sub_80EB1AC +sub_80EB1AC: @ 80EB1AC + push {lr} + ldr r0, =0x000040ec + movs r1, 0 + bl VarSet + ldr r0, =0x000040ed + movs r1, 0 + bl VarSet + ldr r0, =0x000040ee + movs r1, 0 + bl VarSet + ldr r0, =0x000040ef + movs r1, 0 + bl VarSet + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080EB1FC + ldr r0, =0x000040f0 + movs r1, 0x1 + bl VarSet + b _080EB204 + .pool +_080EB1FC: + ldr r0, =0x000040f0 + movs r1, 0 + bl VarSet +_080EB204: + ldr r1, =0x0203a01d + movs r0, 0 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EB1AC + + thumb_func_start sub_80EB218 +sub_80EB218: @ 80EB218 + push {r4-r6,lr} + ldr r5, =0x000040f0 + adds r0, r5, 0 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080EB272 + ldr r6, =0x0203a01d + ldrb r0, [r6] + cmp r0, 0x1 + bne _080EB272 + bl CurrentMapIsSecretBase + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080EB272 + adds r0, r5, 0 + movs r1, 0 + bl VarSet + strb r4, [r6] + bl sub_80EEA70 + ldr r0, =0x000040ec + movs r1, 0 + bl VarSet + ldr r0, =0x000040ed + movs r1, 0 + bl VarSet + ldr r0, =0x000040ee + movs r1, 0 + bl VarSet + ldr r0, =0x000040ef + movs r1, 0 + bl VarSet + adds r0, r5, 0 + movs r1, 0 + bl VarSet +_080EB272: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EB218 + + thumb_func_start sub_80EB290 +sub_80EB290: @ 80EB290 + push {r4,lr} + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080EB2BA + ldr r4, =0x000040ef + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 4 + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet +_080EB2BA: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EB290 + + thumb_func_start sub_80EB2C8 +sub_80EB2C8: @ 80EB2C8 + push {r4,lr} + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080EB2F2 + ldr r4, =0x000040ee + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 3 + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet +_080EB2F2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EB2C8 + + thumb_func_start sub_80EB300 +sub_80EB300: @ 80EB300 + push {r4,r5,lr} + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080EB34C + ldr r5, =0x000040ee + adds r0, r5, 0 + bl VarGet + ldr r1, =0x0000c7ff + ands r1, r0 + adds r0, r5, 0 + bl VarSet + ldr r4, =0x000040ef + adds r0, r4, 0 + bl VarGet + ldr r1, =0x0000fffe + ands r1, r0 + adds r0, r4, 0 + bl VarSet + adds r0, r5, 0 + bl VarGet + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 6 + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl VarSet +_080EB34C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EB300 + + thumb_func_start sub_80EB368 +sub_80EB368: @ 80EB368 + push {r4,r5,lr} + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080EB3B4 + ldr r5, =0x000040ee + adds r0, r5, 0 + bl VarGet + ldr r1, =0x0000c7ff + ands r1, r0 + adds r0, r5, 0 + bl VarSet + ldr r4, =0x000040ef + adds r0, r4, 0 + bl VarGet + ldr r1, =0x0000fffe + ands r1, r0 + adds r0, r4, 0 + bl VarSet + adds r0, r5, 0 + bl VarGet + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 4 + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl VarSet +_080EB3B4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EB368 + + thumb_func_start sub_80EB3D0 +sub_80EB3D0: @ 80EB3D0 + push {r4,r5,lr} + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080EB41C + ldr r5, =0x000040ee + adds r0, r5, 0 + bl VarGet + ldr r1, =0x0000c7ff + ands r1, r0 + adds r0, r5, 0 + bl VarSet + ldr r4, =0x000040ef + adds r0, r4, 0 + bl VarGet + ldr r1, =0x0000fffe + ands r1, r0 + adds r0, r4, 0 + bl VarSet + adds r0, r5, 0 + bl VarGet + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 5 + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl VarSet +_080EB41C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EB3D0 + + thumb_func_start sub_80EB438 +sub_80EB438: @ 80EB438 + push {r4,lr} + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080EB480 + ldr r4, =0x000040ee + adds r0, r4, 0 + bl VarGet + ldr r1, =0x0000c7ff + ands r1, r0 + adds r0, r4, 0 + bl VarSet + adds r4, 0x1 + adds r0, r4, 0 + bl VarGet + ldr r1, =0x0000fffe + ands r1, r0 + adds r0, r4, 0 + bl VarSet + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r0, 0x1 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet +_080EB480: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EB438 + + thumb_func_start sub_80EB498 +sub_80EB498: @ 80EB498 + 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 MapGridGetMetatileIdAt + ldr r1, =0xfffffce4 + adds r0, r1 + cmp r0, 0x18 + bhi _080EB55C + lsls r0, 2 + ldr r1, =_080EB4D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080EB4D0: + .4byte _080EB534 + .4byte _080EB534 + .4byte _080EB534 + .4byte _080EB534 + .4byte _080EB55C + .4byte _080EB55C + .4byte _080EB55C + .4byte _080EB55C + .4byte _080EB534 + .4byte _080EB534 + .4byte _080EB534 + .4byte _080EB534 + .4byte _080EB55C + .4byte _080EB55C + .4byte _080EB55C + .4byte _080EB55C + .4byte _080EB534 + .4byte _080EB534 + .4byte _080EB55C + .4byte _080EB55C + .4byte _080EB534 + .4byte _080EB534 + .4byte _080EB534 + .4byte _080EB534 + .4byte _080EB534 +_080EB534: + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080EB55C + ldr r4, =0x000040ee + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 7 + adds r0, r2, 0 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet +_080EB55C: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EB498 + + thumb_func_start sub_80EB56C +sub_80EB56C: @ 80EB56C + 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 MapGridGetMetatileIdAt + ldr r1, =0xfffffdd4 + adds r0, r1 + cmp r0, 0xCF + bls _080EB594 + b _080EB9D0 +_080EB594: + lsls r0, 2 + ldr r1, =_080EB5A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080EB5A8: + .4byte _080EB930 + .4byte _080EB97C + .4byte _080EB97C + .4byte _080EB97C + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB930 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9AC + .4byte _080EB954 + .4byte _080EB954 + .4byte _080EB8E8 + .4byte _080EB8E8 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9AC + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9AC + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9D0 + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9AC + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB9D0 + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C + .4byte _080EB90C +_080EB8E8: + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080EB9D0 + ldr r4, =0x000040ee + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r0, 0x40 + b _080EB994 + .pool +_080EB90C: + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080EB9D0 + ldr r4, =0x000040ee + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r0, 0x8 + b _080EB994 + .pool +_080EB930: + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080EB9D0 + ldr r4, =0x000040ef + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r0, 0x40 + b _080EB994 + .pool +_080EB954: + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080EB9D0 + ldr r4, =0x000040ef + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + b _080EB994 + .pool +_080EB97C: + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080EB9D0 + ldr r4, =0x000040ef + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r0, 0x10 +_080EB994: + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet + b _080EB9D0 + .pool +_080EB9AC: + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080EB9D0 + ldr r4, =0x000040ef + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r0, 0x8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet +_080EB9D0: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EB56C + + thumb_func_start sub_80EB9E0 +sub_80EB9E0: @ 80EB9E0 + 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 MapGridGetMetatileIdAt + ldr r1, =0xfffffd6f + adds r0, r1 + cmp r0, 0x35 + bls _080EBA08 + b _080EBB18 +_080EBA08: + lsls r0, 2 + ldr r1, =_080EBA1C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080EBA1C: + .4byte _080EBAF4 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBAF4 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBAF4 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBAF4 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBAF4 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBAF4 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBAF4 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBAF4 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBAF4 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBAF4 + .4byte _080EBB18 + .4byte _080EBB18 + .4byte _080EBAF4 +_080EBAF4: + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080EBB18 + ldr r4, =0x000040ef + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r0, 0x8 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet +_080EBB18: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EB9E0 + + thumb_func_start sub_80EBB28 +sub_80EBB28: @ 80EBB28 + 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 MapGridGetMetatileIdAt + ldr r1, =0xfffffddb + adds r0, r1 + cmp r0, 0xA2 + bls _080EBB50 + b _080EBE6C +_080EBB50: + lsls r0, 2 + ldr r1, =_080EBB64 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080EBB64: + .4byte _080EBE48 + .4byte _080EBE48 + .4byte _080EBE48 + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE14 + .4byte _080EBE14 + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBDF0 + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBDF0 + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBE6C + .4byte _080EBDF0 + .4byte _080EBDF0 + .4byte _080EBE6C + .4byte _080EBDF0 +_080EBDF0: + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080EBE6C + ldr r4, =0x000040ef + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r0, 0x8 + b _080EBE30 + .pool +_080EBE14: + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080EBE6C + ldr r4, =0x000040ef + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 +_080EBE30: + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet + b _080EBE6C + .pool +_080EBE48: + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080EBE6C + ldr r4, =0x000040ef + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r0, 0x10 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet +_080EBE6C: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EBB28 + + thumb_func_start sub_80EBE7C +sub_80EBE7C: @ 80EBE7C + 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 MapGridGetMetatileIdAt + adds r1, r0, 0 + ldr r0, =0x0000028e + cmp r1, r0 + bgt _080EBECC + subs r0, 0x1 + cmp r1, r0 + blt _080EBECC + ldr r0, =0x00004054 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080EBECC + ldr r4, =0x000040ef + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + movs r0, 0x4 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet +_080EBECC: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EBE7C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/shop.s b/asm/shop.s new file mode 100644 index 000000000..932d172b6 --- /dev/null +++ b/asm/shop.s @@ -0,0 +1,3219 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start CreateShopMenu +@ s8 CreateShopMenu(s8 type) +CreateShopMenu: @ 80DFA78 + push {r4,r5,lr} + sub sp, 0x10 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl script_env_2_enable + ldr r5, =0x02039f60 + strb r4, [r5, 0xF] + cmp r4, 0 + bne _080DFACC + ldr r0, =gUnknown_08589A38 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + ldr r4, =gUnknown_08589A10 + adds r0, r4, 0 + movs r1, 0x3 + bl GetMaxWidthInMenuTable + lsls r0, 24 + ldr r2, =0x00ffffff + ldr r1, [sp] + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + bl AddWindow + strb r0, [r5, 0xE] + str r4, [r5, 0x4] + movs r5, 0x3 + b _080DFAF8 + .pool +_080DFACC: + ldr r0, =gUnknown_08589A38 + ldr r1, [r0, 0xC] + ldr r0, [r0, 0x8] + str r0, [sp, 0x8] + str r1, [sp, 0xC] + ldr r4, =gUnknown_08589A28 + adds r0, r4, 0 + movs r1, 0x2 + bl GetMaxWidthInMenuTable + lsls r0, 24 + ldr r2, =0x00ffffff + ldr r1, [sp, 0x8] + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0x8] + add r0, sp, 0x8 + bl AddWindow + strb r0, [r5, 0xE] + str r4, [r5, 0x4] + movs r5, 0x2 +_080DFAF8: + ldr r4, =0x02039f60 + ldrb r0, [r4, 0xE] + movs r1, 0 + bl SetStandardWindowBorderStyle + ldrb r0, [r4, 0xE] + ldr r2, [r4, 0x4] + adds r1, r5, 0 + bl PrintMenuTable + ldrb r0, [r4, 0xE] + adds r1, r5, 0 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + ldrb r0, [r4, 0xE] + bl PutWindowTilemap + ldrb r0, [r4, 0xE] + movs r1, 0x1 + bl CopyWindowToVram + ldr r0, =Task_ShopMenu + movs r1, 0x8 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end CreateShopMenu + + thumb_func_start SetShopMenuCallback +@ void SetShopMenuCallback() +SetShopMenuCallback: @ 80DFB4C + ldr r1, =0x02039f60 + str r0, [r1] + bx lr + .pool + thumb_func_end SetShopMenuCallback + + thumb_func_start SetShopItemsForSale +@ int SetShopItemsForSale(s16 *itemsForSale) +SetShopItemsForSale: @ 80DFB58 + push {lr} + adds r1, r0, 0 + movs r2, 0 + ldr r3, =0x02039f60 + str r1, [r3, 0x8] + strh r2, [r3, 0xC] + ldrh r0, [r1] + cmp r0, 0 + beq _080DFB80 +_080DFB6A: + ldrh r0, [r3, 0xC] + adds r0, 0x1 + strh r0, [r3, 0xC] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r0, r2, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _080DFB6A +_080DFB80: + pop {r0} + bx r0 + .pool + thumb_func_end SetShopItemsForSale + + thumb_func_start Task_ShopMenu +@ void Task_ShopMenu(u8 taskId) +Task_ShopMenu: @ 80DFB88 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl ProcessMenuInputNoWrapAround + lsls r0, 24 + asrs r2, r0, 24 + movs r0, 0x2 + negs r0, r0 + cmp r2, r0 + beq _080DFBC4 + adds r0, 0x1 + cmp r2, r0 + bne _080DFBB4 + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl HandleShopMenuQuit + b _080DFBC4 +_080DFBB4: + ldr r0, =0x02039f60 + ldr r1, [r0, 0x4] + lsls r0, r2, 3 + adds r0, r1 + ldr r1, [r0, 0x4] + adds r0, r5, 0 + bl _call_via_r1 +_080DFBC4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end Task_ShopMenu + + thumb_func_start HandleShopMenuBuy +@ void HandleShopMenuBuy(u8 taskId) +HandleShopMenuBuy: @ 80DFBD0 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r2, =0x03005e08 + adds r4, r1, r2 + ldr r3, =CB2_InitBuyMenu + lsrs r0, r3, 16 + strh r0, [r4, 0x10] + strh r3, [r4, 0x12] + subs r2, 0x8 + adds r1, r2 + ldr r0, =Task_GoToBuyOrSellMenu + str r0, [r1] + movs r0, 0x1 + movs r1, 0 + bl fade_screen + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end HandleShopMenuBuy + + thumb_func_start HandleShopMenuSell +@ void HandleShopMenuSell(u8 taskId) +HandleShopMenuSell: @ 80DFC0C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r2, =0x03005e08 + adds r4, r1, r2 + ldr r3, =CB2_GoToSellMenu + lsrs r0, r3, 16 + strh r0, [r4, 0x10] + strh r3, [r4, 0x12] + subs r2, 0x8 + adds r1, r2 + ldr r0, =Task_GoToBuyOrSellMenu + str r0, [r1] + movs r0, 0x1 + movs r1, 0 + bl fade_screen + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end HandleShopMenuSell + + thumb_func_start CB2_ExitSellMenu +@ int CB2_ExitSellMenu() +CB2_ExitSellMenu: @ 80DFC48 + push {lr} + ldr r0, =0x03005dac + ldr r1, =MapPostLoadHook_ExitBuyOrSellMenu + str r1, [r0] + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end CB2_ExitSellMenu + + thumb_func_start HandleShopMenuQuit +@ void HandleShopMenuQuit(u8 taskId) +HandleShopMenuQuit: @ 80DFC68 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =0x02039f60 + ldrb r0, [r5, 0xE] + movs r1, 0x2 + bl sub_8198070 + ldrb r0, [r5, 0xE] + bl RemoveWindow + bl SaveRecordedItemPurchasesForTVShow + bl script_env_2_disable + adds r0, r4, 0 + bl DestroyTask + ldr r5, [r5] + cmp r5, 0 + beq _080DFC98 + bl _call_via_r5 +_080DFC98: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end HandleShopMenuQuit + + thumb_func_start Task_GoToBuyOrSellMenu +@ int Task_GoToBuyOrSellMenu(u8 taskId) +Task_GoToBuyOrSellMenu: @ 80DFCA4 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080DFCD2 + adds r0, r2, 0 + bl DestroyTask + ldrh r0, [r4, 0x10] + lsls r0, 16 + ldrh r1, [r4, 0x12] + orrs r0, r1 + bl SetMainCallback2 +_080DFCD2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end Task_GoToBuyOrSellMenu + + thumb_func_start MapPostLoadHook_ExitBuyOrSellMenu +@ void MapPostLoadHook_ExitBuyOrSellMenu() +MapPostLoadHook_ExitBuyOrSellMenu: @ 80DFCE0 + push {lr} + bl pal_fill_black + ldr r0, =Task_ExitSellMenu + movs r1, 0x8 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end MapPostLoadHook_ExitBuyOrSellMenu + + thumb_func_start Task_ExitSellMenu +@ void Task_ExitSellMenu(u8 taskId) +Task_ExitSellMenu: @ 80DFCF8 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl sub_80ABDFC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080DFD36 + ldr r0, =0x02039f60 + ldrb r0, [r0, 0xF] + cmp r0, 0x2 + bne _080DFD2C + ldr r1, =gUnknown_085E95C7 + ldr r2, =ReturnToShopMenuAfterExitingSellMenu + adds r0, r4, 0 + bl DisplayItemMessageOnField + b _080DFD36 + .pool +_080DFD2C: + ldr r1, =gUnknown_085E959B + ldr r2, =ReturnToShopMenuAfterExitingSellMenu + adds r0, r5, 0 + bl DisplayItemMessageOnField +_080DFD36: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end Task_ExitSellMenu + + thumb_func_start ReturnToShopMenuAfterExitingSellMenu +@ void ReturnToShopMenuAfterExitingSellMenu(u8 taskId) +ReturnToShopMenuAfterExitingSellMenu: @ 80DFD44 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x02039f60 + ldrb r0, [r0, 0xF] + bl CreateShopMenu + adds r0, r4, 0 + bl DestroyTask + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ReturnToShopMenuAfterExitingSellMenu + + thumb_func_start CB2_BuyMenu +@ void CB2_BuyMenu() +CB2_BuyMenu: @ 80DFD64 + push {lr} + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl do_scheduled_bg_tilemap_copies_to_vram + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end CB2_BuyMenu + + thumb_func_start VBlankCB_BuyMenu +@ void VBlankCB_BuyMenu() +VBlankCB_BuyMenu: @ 80DFD80 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end VBlankCB_BuyMenu + + thumb_func_start CB2_InitBuyMenu +@ void CB2_InitBuyMenu() +CB2_InitBuyMenu: @ 80DFD94 + push {r4,r5,lr} + sub sp, 0xC + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r5, r0, r1 + ldrb r4, [r5] + cmp r4, 0 + beq _080DFE20 + cmp r4, 0x1 + bne _080DFDAC + b _080DFEE4 +_080DFDAC: + bl BuyMenuDrawGraphics + bl BuyMenuAddScrollIndicatorArrows + ldr r0, =Task_BuyMenu + movs r1, 0x8 + bl CreateTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x03006310 + movs r1, 0 + movs r2, 0 + bl ListMenuInit + ldr r2, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r1, 0x16] + movs r4, 0x1 + negs r4, r4 + adds r0, r4, 0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + str r5, [sp] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =VBlankCB_BuyMenu + bl SetVBlankCallback + ldr r0, =CB2_BuyMenu + bl SetMainCallback2 + b _080DFEF4 + .pool +_080DFE20: + bl SetVBlankHBlankCallbacksToNull + str r4, [sp, 0x8] + movs r1, 0xE0 + lsls r1, 19 + ldr r2, =0x01000100 + add r0, sp, 0x8 + bl CpuFastSet + bl remove_some_task + bl reset_temp_tile_data_buffers + bl ResetObjectPaletteAllocator + bl sub_80A1A74 + bl ResetAllObjectData + bl ResetTasks + bl clear_scheduled_bg_copies_to_vram + ldr r4, =0x02039f70 + ldr r0, =0x000020b0 + bl AllocZeroed + str r0, [r4] + ldr r1, =0x0000200b + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + ldr r0, [r4] + ldr r1, =0x0000200d + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + ldr r0, [r4] + ldr r1, =0x0000200e + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + strb r1, [r0] + bl BuyMenuBuildListMenuTemplate + bl BuyMenuInitBgs + movs r4, 0x20 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + bl BuyMenuInitWindows + bl BuyMenuDecompressBgGraphics + b _080DFEEE + .pool +_080DFEE4: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _080DFEF4 +_080DFEEE: + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] +_080DFEF4: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end CB2_InitBuyMenu + + thumb_func_start BuyMenuFreeMemory +@ void BuyMenuFreeMemory() +BuyMenuFreeMemory: @ 80DFEFC + push {lr} + ldr r0, =0x02039f70 + ldr r0, [r0] + bl Free + ldr r0, =0x02039f74 + ldr r0, [r0] + bl Free + ldr r0, =0x02039f78 + ldr r0, [r0] + bl Free + bl FreeAllWindowBuffers + pop {r0} + bx r0 + .pool + thumb_func_end BuyMenuFreeMemory + + thumb_func_start BuyMenuBuildListMenuTemplate +@ void BuyMenuBuildListMenuTemplate() +BuyMenuBuildListMenuTemplate: @ 80DFF2C + push {r4-r7,lr} + ldr r7, =0x02039f74 + ldr r4, =0x02039f60 + ldrh r0, [r4, 0xC] + adds r0, 0x1 + lsls r0, 3 + bl Alloc + str r0, [r7] + ldr r5, =0x02039f78 + ldrh r0, [r4, 0xC] + adds r0, 0x1 + lsls r0, 4 + bl Alloc + str r0, [r5] + movs r6, 0 + ldrh r0, [r4, 0xC] + cmp r6, r0 + bcs _080DFF78 +_080DFF54: + lsls r1, r6, 3 + ldr r0, [r7] + adds r0, r1 + ldr r2, [r4, 0x8] + lsls r1, r6, 1 + adds r1, r2 + ldrh r1, [r1] + lsls r3, r6, 4 + ldr r2, [r5] + adds r2, r3 + bl BuyMenuSetListEntry + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldrh r2, [r4, 0xC] + cmp r6, r2 + bcc _080DFF54 +_080DFF78: + ldr r4, =0x02039f78 + lsls r5, r6, 4 + ldr r0, [r4] + adds r0, r5 + ldr r1, =gUnknown_085E8CF7 + bl CopyString + ldr r2, =0x02039f74 + ldr r0, [r2] + lsls r1, r6, 3 + adds r1, r0 + ldr r0, [r4] + adds r0, r5 + str r0, [r1] + movs r0, 0x2 + negs r0, r0 + str r0, [r1, 0x4] + ldr r3, =0x03006310 + adds r1, r3, 0 + ldr r0, =gUnknown_08589A48 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldr r0, [r2] + str r0, [r3] + ldr r0, =0x02039f60 + ldrh r0, [r0, 0xC] + adds r1, r0, 0x1 + strh r1, [r3, 0xC] + lsls r0, r1, 16 + lsrs r0, 16 + cmp r0, 0x8 + bls _080DFFDC + movs r0, 0x8 + strh r0, [r3, 0xE] + b _080DFFDE + .pool +_080DFFDC: + strh r1, [r3, 0xE] +_080DFFDE: + ldr r0, =0x02039f70 + ldr r0, [r0] + ldr r1, =0x03006310 + ldrh r1, [r1, 0xE] + ldr r2, =0x00002004 + adds r0, r2 + strh r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end BuyMenuBuildListMenuTemplate + + thumb_func_start BuyMenuSetListEntry +@ void BuyMenuSetListEntry(struct ListMenuEntry *entry, u16 code, u8 *str) +BuyMenuSetListEntry: @ 80E0000 + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r2, 0 + lsls r1, 16 + lsrs r4, r1, 16 + ldr r0, =0x02039f60 + ldrb r0, [r0, 0xF] + cmp r0, 0 + bne _080E0020 + adds r0, r4, 0 + adds r1, r5, 0 + bl itemid_get_name + b _080E002C + .pool +_080E0020: + lsls r1, r4, 5 + ldr r0, =gUnknown_085A5C09 + adds r1, r0 + adds r0, r5, 0 + bl CopyString +_080E002C: + str r5, [r6] + str r4, [r6, 0x4] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end BuyMenuSetListEntry + + thumb_func_start BuyMenuPrintItemDescriptionAndShowItemIcon +@ void BuyMenuPrintItemDescriptionAndShowItemIcon(s32 menuEntryCode, bool8 isInitialSelection, struct ListMenu *listMenu) +BuyMenuPrintItemDescriptionAndShowItemIcon: @ 80E003C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r7, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x1 + beq _080E0054 + movs r0, 0x5 + bl audio_play +_080E0054: + movs r0, 0x2 + negs r0, r0 + cmp r7, r0 + beq _080E0078 + lsls r4, r7, 16 + lsrs r0, r4, 16 + ldr r1, =0x02039f70 + ldr r1, [r1] + ldr r2, =0x0000200c + adds r1, r2 + ldrb r1, [r1] + bl BuyMenuAddItemIcon + b _080E008A + .pool +_080E0078: + ldr r0, =0x0000ffff + ldr r1, =0x02039f70 + ldr r1, [r1] + ldr r2, =0x0000200c + adds r1, r2 + ldrb r1, [r1] + bl BuyMenuAddItemIcon + lsls r4, r7, 16 +_080E008A: + lsrs r4, 16 + mov r8, r4 + ldr r6, =0x02039f70 + ldr r0, [r6] + ldr r5, =0x0000200c + adds r0, r5 + ldrb r0, [r0] + movs r4, 0x1 + adds r1, r4, 0 + eors r1, r0 + mov r0, r8 + bl BuyMenuRemoveItemIcon + ldr r1, [r6] + adds r1, r5 + ldrb r0, [r1] + eors r0, r4 + strb r0, [r1] + movs r0, 0x2 + negs r0, r0 + cmp r7, r0 + beq _080E00E8 + ldr r0, =0x02039f60 + ldrb r0, [r0, 0xF] + cmp r0, 0 + bne _080E00D8 + mov r0, r8 + bl itemid_get_description + adds r4, r0, 0 + b _080E00EA + .pool +_080E00D8: + ldr r0, =gUnknown_085A5C08 + lsls r1, r7, 5 + adds r0, 0x18 + adds r1, r0 + ldr r4, [r1] + b _080E00EA + .pool +_080E00E8: + ldr r4, =gUnknown_085E93E0 +_080E00EA: + movs r0, 0x2 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x2 + adds r1, r4, 0 + movs r2, 0x3 + movs r3, 0x1 + bl BuyMenuPrint + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end BuyMenuPrintItemDescriptionAndShowItemIcon + + thumb_func_start BuyMenuPrintPriceInList +@ void BuyMenuPrintPriceInList(u8 windowId, s32 menuEntryCode, u8 y) +BuyMenuPrintPriceInList: @ 80E0114 + push {r4-r7,lr} + sub sp, 0x14 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r2, 24 + lsrs r7, r2, 24 + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _080E01AC + ldr r0, =0x02039f60 + ldrb r0, [r0, 0xF] + cmp r0, 0 + bne _080E0164 + ldr r5, =0x02021cc4 + lsls r0, r1, 16 + lsrs r0, 16 + bl itemid_get_market_price + adds r4, r0, 0 + movs r0, 0x1 + bl GetPriceReduction + lsls r4, 16 + lsrs r4, 16 + lsls r0, 24 + lsrs r0, 24 + asrs r4, r0 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x5 + bl ConvertIntToDecimalString + b _080E0176 + .pool +_080E0164: + ldr r0, =0x02021cc4 + ldr r2, =gUnknown_085A5C08 + lsls r1, 5 + adds r1, r2 + ldrh r1, [r1, 0x14] + movs r2, 0 + movs r3, 0x5 + bl ConvertIntToDecimalString +_080E0176: + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E969C + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0x7 + adds r1, r4, 0 + movs r2, 0x78 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + ldr r0, =gUnknown_08589AB3 + str r0, [sp, 0x8] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0xC] + str r4, [sp, 0x10] + adds r0, r6, 0 + movs r1, 0x7 + adds r3, r7, 0 + bl AddTextPrinterParametrized2 +_080E01AC: + add sp, 0x14 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end BuyMenuPrintPriceInList + + thumb_func_start BuyMenuAddScrollIndicatorArrows +@ void BuyMenuAddScrollIndicatorArrows() +BuyMenuAddScrollIndicatorArrows: @ 80E01C8 + push {r4,r5,lr} + sub sp, 0x10 + ldr r5, =0x02039f70 + ldr r2, [r5] + ldr r4, =0x0000200b + adds r0, r2, r4 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080E0206 + ldr r0, =0x02039f60 + ldrh r1, [r0, 0xC] + adds r0, r1, 0x1 + cmp r0, 0x8 + ble _080E0206 + subs r0, r1, 0x7 + str r0, [sp] + ldr r0, =0x00000834 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + ldr r1, =0x00002008 + adds r0, r2, r1 + str r0, [sp, 0xC] + movs r0, 0x2 + movs r1, 0xAC + movs r2, 0xC + movs r3, 0x94 + bl AddScrollIndicatorArrowPairParametrized + ldr r1, [r5] + adds r1, r4 + strb r0, [r1] +_080E0206: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end BuyMenuAddScrollIndicatorArrows + + thumb_func_start BuyMenuRemoveScrollIndicatorArrows +@ void BuyMenuRemoveScrollIndicatorArrows() +BuyMenuRemoveScrollIndicatorArrows: @ 80E0224 + push {r4,lr} + ldr r4, =0x02039f70 + ldr r0, [r4] + ldr r2, =0x0000200b + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0xFF + beq _080E0242 + bl RemoveScrollIndicatorArrowPair + ldr r0, [r4] + ldr r1, =0x0000200b + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] +_080E0242: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end BuyMenuRemoveScrollIndicatorArrows + + thumb_func_start BuyMenuPrintCursor +@ void BuyMenuPrintCursor(u8 taskId, u8 colorSetId) +BuyMenuPrintCursor: @ 80E0250 + push {r4,lr} + sub sp, 0x8 + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + bl ListMenuGetYCoordForPrintingArrowCursor + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldr r1, =gUnknown_085E8D60 + movs r0, 0 + str r0, [sp] + str r4, [sp, 0x4] + movs r0, 0x1 + movs r2, 0 + bl BuyMenuPrint + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end BuyMenuPrintCursor + + thumb_func_start BuyMenuAddItemIcon +@ void BuyMenuAddItemIcon(u16 id, u8 iconSlot) +BuyMenuAddItemIcon: @ 80E0284 + push {r4,lr} + sub sp, 0x8 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, 24 + lsrs r3, r1, 24 + ldr r0, =0x02039f70 + ldr r4, =0x0000200d + adds r1, r3, r4 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _080E0310 + ldr r0, =0x02039f60 + ldrb r0, [r0, 0xF] + cmp r0, 0 + beq _080E02AE + ldr r0, =0x0000ffff + cmp r2, r0 + bne _080E02F0 +_080E02AE: + ldr r0, =0x0000083e + adds r1, r3, r0 + adds r0, r1, 0 + bl AddItemIconObject + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _080E0310 + strb r2, [r4] + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0x18 + strh r1, [r0, 0x24] + movs r1, 0x58 + strh r1, [r0, 0x26] + b _080E0310 + .pool +_080E02F0: + lsls r0, r2, 24 + lsrs r0, 24 + ldr r2, =0x0000083e + adds r1, r3, r2 + str r1, [sp] + str r1, [sp, 0x4] + movs r1, 0x14 + movs r2, 0x54 + movs r3, 0x1 + bl AddDecorationIconObject + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _080E0310 + strb r2, [r4] +_080E0310: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end BuyMenuAddItemIcon + + thumb_func_start BuyMenuRemoveItemIcon +@ void BuyMenuRemoveItemIcon(u16 id, u8 iconSlot) +BuyMenuRemoveItemIcon: @ 80E031C + push {r4,r5,lr} + lsls r1, 24 + lsrs r4, r1, 24 + ldr r0, =0x02039f70 + ldr r2, =0x0000200d + adds r1, r4, r2 + ldr r0, [r0] + adds r5, r0, r1 + ldrb r0, [r5] + cmp r0, 0xFF + beq _080E0356 + ldr r0, =0x0000083e + adds r4, r0 + adds r0, r4, 0 + bl FreeObjectTilesByTag + adds r0, r4, 0 + bl FreeObjectPaletteByTag + ldrb r1, [r5] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + movs r0, 0xFF + strb r0, [r5] +_080E0356: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end BuyMenuRemoveItemIcon + + thumb_func_start BuyMenuInitBgs +@ void BuyMenuInitBgs() +BuyMenuInitBgs: @ 80E036C + push {r4,lr} + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_08589A60 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r4, =0x02039f70 + ldr r1, [r4] + movs r0, 0x80 + lsls r0, 4 + adds r1, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + movs r0, 0xC0 + lsls r0, 5 + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + ldr r1, [r4] + movs r0, 0x80 + lsls r0, 5 + adds r1, r0 + movs r0, 0x3 + bl SetBgTilemapBuffer + movs r0, 0x10 + movs r1, 0 + bl SetGpuReg + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + movs r0, 0x16 + movs r1, 0 + bl SetGpuReg + movs r0, 0x18 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg + movs r0, 0x1C + movs r1, 0 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + 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, 0x3 + bl ShowBg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end BuyMenuInitBgs + + thumb_func_start BuyMenuDecompressBgGraphics +@ void BuyMenuDecompressBgGraphics() +BuyMenuDecompressBgGraphics: @ 80E0424 + push {lr} + sub sp, 0x4 + ldr r1, =gUnknown_08D9AFBC + movs r2, 0xE8 + lsls r2, 2 + ldr r3, =0x000003e3 + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + bl decompress_and_copy_tile_data_to_vram + ldr r0, =gUnknown_08D9B0F0 + ldr r1, =0x02039f70 + ldr r1, [r1] + bl LZDecompressWram + ldr r0, =gUnknown_08D9B0C8 + movs r1, 0xC0 + movs r2, 0x20 + bl decompress_palette + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end BuyMenuDecompressBgGraphics + + thumb_func_start BuyMenuInitWindows +@ void BuyMenuInitWindows() +BuyMenuInitWindows: @ 80E0468 + push {lr} + ldr r0, =gUnknown_08589A70 + bl InitWindows + bl DeactivateAllTextPrinters + movs r0, 0 + movs r1, 0x1 + movs r2, 0xD0 + bl sub_809882C + movs r0, 0 + movs r1, 0xA + movs r2, 0xE0 + bl copy_textbox_border_tile_patterns_to_vram + movs r0, 0 + bl PutWindowTilemap + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0x2 + bl PutWindowTilemap + pop {r0} + bx r0 + .pool + thumb_func_end BuyMenuInitWindows + + thumb_func_start BuyMenuPrint +@ void BuyMenuPrint(u8 windowId, u8 *str, u8 x, u8 y, u8 speed, u8 colorSetId) +BuyMenuPrint: @ 80E04A4 + push {r4-r6,lr} + sub sp, 0x14 + ldr r6, [sp, 0x24] + ldr r5, [sp, 0x28] + lsls r0, 24 + lsrs r0, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + lsls r5, 24 + lsrs r5, 24 + movs r4, 0 + str r4, [sp] + str r4, [sp, 0x4] + lsls r4, r5, 1 + adds r4, r5 + ldr r5, =gUnknown_08589AB0 + adds r4, r5 + str r4, [sp, 0x8] + lsls r6, 24 + asrs r6, 24 + str r6, [sp, 0xC] + str r1, [sp, 0x10] + movs r1, 0x1 + bl AddTextPrinterParametrized2 + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end BuyMenuPrint + + thumb_func_start BuyMenuDisplayMessage +@ void BuyMenuDisplayMessage(u8 taskId, u8 *str, void ( *callback)(u8 taskId)) +BuyMenuDisplayMessage: @ 80E04E8 + 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 sav2_get_text_speed + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + str r1, [sp] + str r0, [sp, 0x4] + str r5, [sp, 0x8] + str r6, [sp, 0xC] + adds r0, r4, 0 + movs r1, 0x5 + movs r2, 0xA + movs r3, 0xE + bl DisplayMessageAndContinueTask + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end BuyMenuDisplayMessage + + thumb_func_start BuyMenuDrawGraphics +@ void BuyMenuDrawGraphics() +BuyMenuDrawGraphics: @ 80E0524 + push {lr} + bl BuyMenuDrawMapGraphics + bl BuyMenuCopyMenuBgToBg1TilemapBuffer + movs r0, 0x13 + movs r1, 0xB + bl AddMoneyLabelObject + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + bl DecryptMoney + adds r3, r0, 0 + movs r0, 0 + movs r1, 0x1 + movs r2, 0xD + bl set_window_border_style_and_print_money_box + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x1 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + movs r0, 0x3 + bl schedule_bg_copy_tilemap_to_vram + pop {r0} + bx r0 + .pool + thumb_func_end BuyMenuDrawGraphics + + thumb_func_start BuyMenuDrawMapGraphics +@ void BuyMenuDrawMapGraphics() +BuyMenuDrawMapGraphics: @ 80E0570 + push {lr} + bl BuyMenuCollectFieldObjectData + bl BuyMenuDrawFieldObjects + bl BuyMenuDrawMapBg + pop {r0} + bx r0 + thumb_func_end BuyMenuDrawMapGraphics + + thumb_func_start BuyMenuDrawMapBg +@ void BuyMenuDrawMapBg() +BuyMenuDrawMapBg: @ 80E0584 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r0, =0x02037318 + ldr r0, [r0] + mov r9, r0 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl GetXYCoordsOneStepInFrontOfPlayer + mov r1, sp + mov r0, sp + ldrh r0, [r0] + subs r0, 0x4 + strh r0, [r1] + ldrh r0, [r4] + subs r0, 0x4 + strh r0, [r4] + movs r1, 0 + mov r10, r4 +_080E05B6: + movs r4, 0 + lsls r7, r1, 16 + asrs r0, r7, 16 + mov r8, r0 +_080E05BE: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + lsls r4, 16 + asrs r5, r4, 16 + adds r0, r5 + mov r2, r10 + movs r3, 0 + ldrsh r1, [r2, r3] + add r1, r8 + bl MapGridGetMetatileIdAt + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r5, 0 + mov r1, r8 + bl BuyMenuCheckForOverlapWithMenuBg + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E0608 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + adds r0, r5 + mov r2, r10 + movs r3, 0 + ldrsh r1, [r2, r3] + add r1, r8 + bl MapGridGetMetatileLayerTypeAt + lsls r0, 24 + lsrs r5, r0, 24 + b _080E060A + .pool +_080E0608: + movs r5, 0x1 +_080E060A: + ldr r0, =0x000001ff + cmp r6, r0 + bhi _080E062C + asrs r0, r4, 16 + mov r2, r9 + ldr r1, [r2, 0x10] + lsls r3, r6, 4 + ldr r2, [r1, 0xC] + adds r2, r3 + asrs r1, r7, 16 + adds r3, r5, 0 + bl BuyMenuDrawMapMetatile + b _080E0644 + .pool +_080E062C: + asrs r0, r4, 16 + mov r3, r9 + ldr r2, [r3, 0x14] + ldr r3, =0xfffffe00 + adds r1, r6, r3 + lsls r1, 4 + ldr r2, [r2, 0xC] + adds r2, r1 + asrs r1, r7, 16 + adds r3, r5, 0 + bl BuyMenuDrawMapMetatile +_080E0644: + movs r1, 0x80 + lsls r1, 9 + adds r0, r4, r1 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, 0xE + ble _080E05BE + adds r0, r7, r1 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, 0x9 + ble _080E05B6 + 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 BuyMenuDrawMapBg + + thumb_func_start BuyMenuDrawMapMetatile +@ void BuyMenuDrawMapMetatile(u16 x, u16 y, u16 *src, u8 metatileLayerType) +BuyMenuDrawMapMetatile: @ 80E0670 + push {r4-r7,lr} + adds r7, r2, 0 + lsls r3, 24 + lsrs r3, 24 + adds r2, r3, 0 + lsls r0, 17 + lsrs r5, r0, 16 + lsls r1, 22 + lsrs r1, 16 + cmp r3, 0x1 + beq _080E06C0 + cmp r3, 0x1 + bgt _080E0690 + cmp r3, 0 + beq _080E0696 + b _080E0728 +_080E0690: + cmp r2, 0x2 + beq _080E06F8 + b _080E0728 +_080E0696: + ldr r6, =0x02039f70 + ldr r0, [r6] + movs r2, 0xC0 + lsls r2, 5 + adds r0, r2 + lsls r5, 16 + asrs r5, 16 + lsls r4, r1, 16 + asrs r4, 16 + adds r1, r5, 0 + adds r2, r4, 0 + adds r3, r7, 0 + bl BuyMenuDrawMapMetatileLayer + ldr r0, [r6] + movs r1, 0x80 + lsls r1, 4 + b _080E06E2 + .pool +_080E06C0: + ldr r6, =0x02039f70 + ldr r0, [r6] + movs r2, 0x80 + lsls r2, 5 + adds r0, r2 + lsls r5, 16 + asrs r5, 16 + lsls r4, r1, 16 + asrs r4, 16 + adds r1, r5, 0 + adds r2, r4, 0 + adds r3, r7, 0 + bl BuyMenuDrawMapMetatileLayer + ldr r0, [r6] + movs r1, 0xC0 + lsls r1, 5 +_080E06E2: + adds r0, r1 + adds r3, r7, 0 + adds r3, 0x8 + adds r1, r5, 0 + adds r2, r4, 0 + bl BuyMenuDrawMapMetatileLayer + b _080E0728 + .pool +_080E06F8: + ldr r6, =0x02039f70 + ldr r0, [r6] + movs r2, 0x80 + lsls r2, 5 + adds r0, r2 + lsls r5, 16 + asrs r5, 16 + lsls r4, r1, 16 + asrs r4, 16 + adds r1, r5, 0 + adds r2, r4, 0 + adds r3, r7, 0 + bl BuyMenuDrawMapMetatileLayer + ldr r0, [r6] + movs r1, 0x80 + lsls r1, 4 + adds r0, r1 + adds r3, r7, 0 + adds r3, 0x8 + adds r1, r5, 0 + adds r2, r4, 0 + bl BuyMenuDrawMapMetatileLayer +_080E0728: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end BuyMenuDrawMapMetatile + + thumb_func_start BuyMenuDrawMapMetatileLayer +@ int BuyMenuDrawMapMetatileLayer(void *tilemapBuffer, s16 xOffset, s16 yOffset, u16 *src) +BuyMenuDrawMapMetatileLayer: @ 80E0734 + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + adds r1, r2 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r3] + strh r0, [r1] + ldrh r0, [r3, 0x2] + strh r0, [r1, 0x2] + adds r2, r1, 0 + adds r2, 0x40 + ldrh r0, [r3, 0x4] + strh r0, [r2] + adds r1, 0x42 + ldrh r0, [r3, 0x6] + strh r0, [r1] + bx lr + thumb_func_end BuyMenuDrawMapMetatileLayer + + thumb_func_start BuyMenuCollectFieldObjectData +@ void BuyMenuCollectFieldObjectData() +BuyMenuCollectFieldObjectData: @ 80E075C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + movs r0, 0 + mov r8, r0 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl GetXYCoordsOneStepInFrontOfPlayer + movs r7, 0 + ldr r5, =0x02039f70 + ldr r3, =0x00002010 + movs r2, 0x10 +_080E0780: + ldr r1, [r5] + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 1 + adds r1, r3 + adds r1, r0 + strh r2, [r1] + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0xF + bls _080E0780 + movs r7, 0 + str r4, [sp, 0x8] + ldr r1, =0x02039f70 + mov r9, r1 + mov r2, sp + str r2, [sp, 0x4] +_080E07A4: + movs r3, 0 + adds r4, r7, 0x1 + str r4, [sp, 0xC] +_080E07AA: + ldr r1, =0x0000fffc + adds r0, r3, r1 + ldr r2, [sp, 0x4] + ldrh r2, [r2] + adds r0, r2 + lsls r0, 16 + asrs r0, 16 + ldr r4, =0x0000fffe + adds r1, r7, r4 + ldr r2, [sp, 0x8] + ldrh r2, [r2] + adds r1, r2 + lsls r1, 16 + asrs r1, 16 + str r3, [sp, 0x10] + bl GetFieldObjectIdByXY + lsls r0, 24 + lsrs r6, r0, 24 + ldr r3, [sp, 0x10] + cmp r6, 0x10 + beq _080E08C2 + mov r4, r9 + ldr r1, [r4] + mov r0, r8 + lsls r4, r0, 2 + adds r0, r4, r0 + lsls r5, r0, 1 + ldr r2, =0x00002010 + adds r0, r1, r2 + adds r0, r5 + movs r2, 0 + mov r10, r2 + strh r6, [r0] + ldr r2, =0x00002012 + adds r0, r1, r2 + adds r0, r5 + strh r3, [r0] + ldr r0, =0x00002014 + adds r1, r0 + adds r1, r5 + strh r7, [r1] + ldr r1, [sp, 0x4] + movs r2, 0 + ldrsh r0, [r1, r2] + subs r1, r3, 0x4 + adds r0, r1 + ldr r1, [sp, 0x8] + movs r2, 0 + ldrsh r1, [r1, r2] + mov r12, r1 + subs r1, r7, 0x2 + add r1, r12 + str r3, [sp, 0x10] + bl MapGridGetMetatileLayerTypeAt + mov r1, r9 + ldr r2, [r1] + ldr r1, =0x00002018 + adds r1, r2 + mov r12, r1 + add r12, r5 + lsls r0, 24 + lsrs r0, 24 + mov r1, r12 + strh r0, [r1] + ldr r1, =0x02037350 + lsls r0, r6, 3 + adds r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x18] + lsls r0, 28 + lsrs r0, 28 + ldr r3, [sp, 0x10] + cmp r0, 0x2 + beq _080E0884 + cmp r0, 0x2 + bgt _080E0870 + cmp r0, 0x1 + beq _080E0876 + b _080E08A4 + .pool +_080E0870: + cmp r0, 0x3 + beq _080E0894 + b _080E08A4 +_080E0876: + ldr r4, =0x00002016 + adds r0, r2, r4 + adds r0, r5 + mov r1, r10 + b _080E08B6 + .pool +_080E0884: + ldr r4, =0x00002016 + adds r0, r2, r4 + adds r0, r5 + movs r1, 0x1 + b _080E08B6 + .pool +_080E0894: + ldr r1, =0x00002016 + adds r0, r2, r1 + adds r0, r5 + movs r1, 0x2 + b _080E08B6 + .pool +_080E08A4: + mov r2, r9 + ldr r0, [r2] + mov r2, r8 + adds r1, r4, r2 + lsls r1, 1 + ldr r4, =0x00002016 + adds r0, r4 + adds r0, r1 + movs r1, 0x3 +_080E08B6: + strh r1, [r0] + mov r0, r8 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 +_080E08C2: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x6 + bhi _080E08CE + b _080E07AA +_080E08CE: + ldr r1, [sp, 0xC] + lsls r0, r1, 24 + lsrs r7, r0, 24 + cmp r7, 0x4 + bhi _080E08DA + b _080E07A4 +_080E08DA: + 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 BuyMenuCollectFieldObjectData + + thumb_func_start BuyMenuDrawFieldObjects +@ void BuyMenuDrawFieldObjects() +BuyMenuDrawFieldObjects: @ 80E08F0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r7, 0 + ldr r0, =0x02039f70 + mov r8, r0 + ldr r1, =0x02037350 + mov r10, r1 + ldr r2, =0x02020630 + mov r9, r2 +_080E090A: + mov r3, r8 + ldr r0, [r3] + lsls r1, r7, 2 + adds r1, r7 + lsls r5, r1, 1 + ldr r4, =0x00002010 + adds r0, r4 + adds r1, r0, r5 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0x10 + beq _080E09D8 + adds r1, r0, 0 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r10 + ldrb r0, [r0, 0x5] + bl GetFieldObjectGraphicsInfo + mov r4, r8 + ldr r3, [r4] + ldr r2, =0x00002010 + adds r1, r3, r2 + adds r1, r5 + movs r4, 0 + ldrsh r2, [r1, r4] + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + add r1, r10 + ldrb r4, [r1, 0x5] + ldr r2, =0x00002012 + adds r1, r3, r2 + adds r1, r5 + ldrh r2, [r1] + lsls r2, 4 + adds r2, 0x8 + lsls r2, 16 + asrs r2, 16 + ldr r1, =0x00002014 + adds r3, r1 + adds r3, r5 + ldrh r3, [r3] + lsls r3, 4 + movs r1, 0xA + ldrsh r0, [r0, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + subs r0, 0x30 + subs r3, r0 + lsls r3, 16 + asrs r3, 16 + movs r0, 0x2 + str r0, [sp] + adds r0, r4, 0 + ldr r1, =DummyObjectCallback + bl AddPseudoFieldObject + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + ldr r2, =0x00002010 + adds r1, r5, r2 + mov r3, r8 + ldr r0, [r3] + adds r0, r1 + bl BuyMenuCheckIfFieldObjectOverlapsMenuBg + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E09C0 + lsls r2, r4, 4 + adds r2, r4 + lsls r2, 2 + add r2, r9 + adds r2, 0x42 + ldrb r0, [r2] + movs r4, 0x40 + negs r4, r4 + adds r1, r4, 0 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + movs r1, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] +_080E09C0: + lsls r0, r6, 4 + adds r0, r6 + lsls r0, 2 + add r0, r9 + mov r2, r8 + ldr r1, [r2] + ldr r3, =0x00002016 + adds r1, r3 + adds r1, r5 + ldrb r1, [r1] + bl StartObjectImageAnim +_080E09D8: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0xF + bls _080E090A + 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 BuyMenuDrawFieldObjects + + thumb_func_start BuyMenuCheckIfFieldObjectOverlapsMenuBg +BuyMenuCheckIfFieldObjectOverlapsMenuBg: @ 80E0A14 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2 + ldrsh r0, [r4, r1] + movs r2, 0x4 + ldrsh r1, [r4, r2] + adds r1, 0x2 + bl BuyMenuCheckForOverlapWithMenuBg + lsls r0, 24 + cmp r0, 0 + bne _080E0A38 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080E0A38 + movs r0, 0x1 + b _080E0A3A +_080E0A38: + movs r0, 0 +_080E0A3A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end BuyMenuCheckIfFieldObjectOverlapsMenuBg + + thumb_func_start BuyMenuCopyMenuBgToBg1TilemapBuffer +@ void BuyMenuCopyMenuBgToBg1TilemapBuffer() +BuyMenuCopyMenuBgToBg1TilemapBuffer: @ 80E0A40 + push {r4-r6,lr} + ldr r0, =0x02039f70 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 4 + adds r4, r0, r1 + adds r3, r0, 0 + movs r1, 0 + ldr r0, =0x0000c3e3 + adds r6, r0, 0 + ldr r5, =0x000003ff +_080E0A56: + lsls r0, r1, 16 + asrs r2, r0, 16 + lsls r1, r2, 1 + adds r0, r1, r3 + ldrh r0, [r0] + cmp r0, 0 + beq _080E0A6A + adds r1, r4 + adds r0, r6 + strh r0, [r1] +_080E0A6A: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, r5 + ble _080E0A56 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end BuyMenuCopyMenuBgToBg1TilemapBuffer + + thumb_func_start BuyMenuCheckForOverlapWithMenuBg +@ bool8 BuyMenuCheckForOverlapWithMenuBg(u16 x, u16 y) +BuyMenuCheckForOverlapWithMenuBg: @ 80E0A88 + push {lr} + ldr r2, =0x02039f70 + ldr r2, [r2] + lsls r0, 1 + lsls r1, 6 + adds r1, r0 + lsls r1, 1 + adds r1, r2 + ldrh r0, [r1] + cmp r0, 0 + bne _080E0AC0 + adds r0, r1, 0 + adds r0, 0x40 + ldrh r0, [r0] + cmp r0, 0 + bne _080E0AC0 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _080E0AC0 + adds r0, r1, 0 + adds r0, 0x42 + ldrh r0, [r0] + cmp r0, 0 + bne _080E0AC0 + movs r0, 0x1 + b _080E0AC2 + .pool +_080E0AC0: + movs r0, 0 +_080E0AC2: + pop {r1} + bx r1 + thumb_func_end BuyMenuCheckForOverlapWithMenuBg + + thumb_func_start Task_BuyMenu +@ void Task_BuyMenu(u8 taskId) +Task_BuyMenu: @ 80E0AC8 + 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, =0x03005e08 + adds r4, r0, r1 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080E0AEA + b _080E0C8E +_080E0AEA: + ldrb r0, [r4, 0xE] + bl ListMenuHandleInput + adds r5, r0, 0 + ldrb r0, [r4, 0xE] + ldr r7, =0x02039f70 + ldr r2, [r7] + ldr r3, =0x00002008 + adds r1, r2, r3 + subs r3, 0x2 + adds r2, r3 + bl get_coro_args_x18_x1A + movs r0, 0x2 + negs r0, r0 + cmp r5, r0 + beq _080E0B24 + adds r0, 0x1 + cmp r5, r0 + bne _080E0B32 + b _080E0C8E + .pool +_080E0B24: + movs r0, 0x5 + bl audio_play + adds r0, r6, 0 + bl ExitBuyMenu + b _080E0C8E +_080E0B32: + movs r0, 0x5 + bl audio_play + strh r5, [r4, 0xA] + movs r0, 0x2 + bl ClearWindowTilemap + bl BuyMenuRemoveScrollIndicatorArrows + ldrb r0, [r4, 0xE] + movs r1, 0x2 + bl BuyMenuPrintCursor + ldr r0, =0x02039f60 + ldrb r0, [r0, 0xF] + cmp r0, 0 + bne _080E0B80 + lsls r0, r5, 16 + lsrs r0, 16 + bl itemid_get_market_price + adds r4, r0, 0 + movs r0, 0x1 + bl GetPriceReduction + ldr r1, [r7] + movs r2, 0x80 + lsls r2, 6 + adds r1, r2 + lsls r4, 16 + lsrs r4, 16 + lsls r0, 24 + lsrs r0, 24 + asrs r4, r0 + str r4, [r1] + b _080E0B92 + .pool +_080E0B80: + ldr r1, [r7] + movs r3, 0x80 + lsls r3, 6 + adds r1, r3 + ldr r2, =gUnknown_085A5C08 + lsls r0, r5, 5 + adds r0, r2 + ldrh r0, [r0, 0x14] + str r0, [r1] +_080E0B92: + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + ldr r2, =0x02039f70 + mov r8, r2 + ldr r1, [r2] + movs r7, 0x80 + lsls r7, 6 + adds r1, r7 + ldr r1, [r1] + bl IsEnoughMoney + lsls r0, 24 + cmp r0, 0 + bne _080E0BD0 + ldr r1, =gUnknown_085E9539 + ldr r2, =BuyMenuReturnToItemList + b _080E0C28 + .pool +_080E0BD0: + ldr r4, =0x02039f60 + ldrb r0, [r4, 0xF] + cmp r0, 0 + bne _080E0C38 + lsls r0, r5, 16 + lsrs r5, r0, 16 + ldr r1, =0x02021cc4 + adds r0, r5, 0 + bl itemid_get_name + adds r0, r5, 0 + bl itemid_get_pocket_number + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _080E0C24 + ldr r4, =0x02021dc4 + 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 CopyString + ldr r1, =gUnknown_085E9417 + b _080E0C26 + .pool +_080E0C24: + ldr r1, =gUnknown_085E93EF +_080E0C26: + ldr r2, =Task_BuyHowManyDialogueInit +_080E0C28: + adds r0, r6, 0 + bl BuyMenuDisplayMessage + b _080E0C8E + .pool +_080E0C38: + ldr r0, =0x02021cc4 + lsls r1, r5, 5 + ldr r2, =gUnknown_085A5C09 + adds r1, r2 + bl CopyString + ldr r0, =0x02021dc4 + mov r3, r8 + ldr r1, [r3] + adds r1, r7 + ldr r1, [r1] + movs r2, 0 + movs r3, 0x6 + bl ConvertIntToDecimalString + ldrb r0, [r4, 0xF] + cmp r0, 0x1 + bne _080E0C7C + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E9468 + bl ExpandStringRefs + b _080E0C84 + .pool +_080E0C7C: + ldr r0, =0x02021fc4 + ldr r1, =gUnknown_085E9493 + bl ExpandStringRefs +_080E0C84: + ldr r1, =0x02021fc4 + ldr r2, =BuyMenuConfirmPurchase + adds r0, r6, 0 + bl BuyMenuDisplayMessage +_080E0C8E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end Task_BuyMenu + + thumb_func_start Task_BuyHowManyDialogueInit +@ void Task_BuyHowManyDialogueInit(u8 taskId) +Task_BuyHowManyDialogueInit: @ 80E0CA4 + push {r4-r6,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r5, r6, 2 + adds r5, r6 + lsls r5, 3 + ldr r0, =0x03005e08 + adds r5, r0 + ldrh r0, [r5, 0xA] + bl CountTotalItemQuantityInBag + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0x3 + movs r1, 0 + movs r2, 0x1 + movs r3, 0xD + bl SetWindowBorderStyle + ldr r0, =0x02021cc4 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E93D5 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x3 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl BuyMenuPrint + movs r0, 0x1 + strh r0, [r5, 0x2] + movs r0, 0x4 + movs r1, 0 + movs r2, 0x1 + movs r3, 0xD + bl SetWindowBorderStyle + adds r0, r6, 0 + bl BuyMenuPrintItemQuantityAndPrice + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =0x03005d8c + ldr r0, [r0] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + bl DecryptMoney + ldr r1, =0x02039f70 + ldr r4, [r1] + movs r2, 0x80 + lsls r2, 6 + adds r1, r4, r2 + ldr r1, [r1] + bl __udivsi3 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x63 + bls _080E0D60 + ldr r0, =0x0000200a + adds r1, r4, r0 + movs r0, 0x63 + strb r0, [r1] + b _080E0D66 + .pool +_080E0D60: + ldr r2, =0x0000200a + adds r0, r4, r2 + strb r1, [r0] +_080E0D66: + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =Task_BuyHowManyDialogueHandleInput + str r0, [r1] + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end Task_BuyHowManyDialogueInit + + thumb_func_start Task_BuyHowManyDialogueHandleInput +@ void Task_BuyHowManyDialogueHandleInput(u8 taskId) +Task_BuyHowManyDialogueHandleInput: @ 80E0D88 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + adds r4, r6, 0 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + adds r0, r5, 0x2 + ldr r7, =0x02039f70 + ldr r1, [r7] + ldr r2, =0x0000200a + adds r1, r2 + ldrb r1, [r1] + bl AdjustQuantityAccordingToDPadInput + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E0DF0 + ldrh r0, [r5, 0xA] + bl itemid_get_market_price + adds r4, r0, 0 + movs r0, 0x1 + bl GetPriceReduction + ldr r1, [r7] + movs r2, 0x80 + lsls r2, 6 + adds r1, r2 + lsls r4, 16 + lsrs r4, 16 + lsls r0, 24 + lsrs r0, 24 + asrs r4, r0 + movs r2, 0x2 + ldrsh r0, [r5, r2] + muls r0, r4 + str r0, [r1] + adds r0, r6, 0 + bl BuyMenuPrintItemQuantityAndPrice + b _080E0EA4 + .pool +_080E0DF0: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080E0E74 + movs r0, 0x5 + bl audio_play + movs r0, 0x4 + movs r1, 0 + bl sub_8198070 + movs r0, 0x3 + movs r1, 0 + bl sub_8198070 + movs r0, 0x4 + bl ClearWindowTilemap + movs r0, 0x3 + bl ClearWindowTilemap + movs r0, 0x1 + bl PutWindowTilemap + ldrh r0, [r5, 0xA] + ldr r1, =0x02021cc4 + bl itemid_get_name + ldr r0, =0x02021dc4 + movs r2, 0x2 + ldrsh r1, [r5, r2] + movs r2, 0 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r0, =0x02021ec4 + ldr r1, [r7] + movs r2, 0x80 + lsls r2, 6 + adds r1, r2 + ldr r1, [r1] + movs r2, 0 + movs r3, 0x6 + bl ConvertIntToDecimalString + ldr r1, =gUnknown_085E943F + ldr r2, =BuyMenuConfirmPurchase + adds r0, r6, 0 + bl BuyMenuDisplayMessage + b _080E0EA4 + .pool +_080E0E74: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080E0EA4 + movs r0, 0x5 + bl audio_play + movs r0, 0x4 + movs r1, 0 + bl sub_8198070 + movs r0, 0x3 + movs r1, 0 + bl sub_8198070 + movs r0, 0x4 + bl ClearWindowTilemap + movs r0, 0x3 + bl ClearWindowTilemap + adds r0, r4, 0 + bl BuyMenuReturnToItemList +_080E0EA4: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end Task_BuyHowManyDialogueHandleInput + + thumb_func_start BuyMenuConfirmPurchase +@ void BuyMenuConfirmPurchase(u8 taskId) +BuyMenuConfirmPurchase: @ 80E0EAC + push {lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_08589AA8 + movs r2, 0 + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0xD + str r2, [sp, 0x8] + ldr r2, =gUnknown_08589A08 + str r2, [sp, 0xC] + movs r2, 0x1 + movs r3, 0 + bl CreateYesNoMenuWithCallbacks + add sp, 0x10 + pop {r0} + bx r0 + .pool + thumb_func_end BuyMenuConfirmPurchase + + thumb_func_start BuyMenuTryMakePurchase +@ void BuyMenuTryMakePurchase(u8 taskId) +BuyMenuTryMakePurchase: @ 80E0EDC + 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, =0x03005e08 + adds r4, r0, r1 + movs r0, 0x1 + bl PutWindowTilemap + ldr r6, =0x02039f60 + ldrb r0, [r6, 0xF] + cmp r0, 0 + bne _080E0F40 + ldrh r0, [r4, 0xA] + ldrh r1, [r4, 0x2] + bl bag_add_item + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E0F30 + ldr r1, =gUnknown_085E94C5 + ldr r2, =BuyMenuSubtractMoney + adds r0, r5, 0 + bl BuyMenuDisplayMessage + adds r0, r5, 0 + bl RecordItemPurchase + b _080E0F7A + .pool +_080E0F30: + ldr r1, =gUnknown_085E9558 + ldr r2, =BuyMenuReturnToItemList + b _080E0F60 + .pool +_080E0F40: + ldrb r0, [r4, 0xA] + bl IsThereStorageSpaceForDecoration + lsls r0, 24 + cmp r0, 0 + beq _080E0F70 + ldrb r0, [r6, 0xF] + cmp r0, 0x1 + bne _080E0F5C + ldr r1, =gUnknown_085E94E7 + b _080E0F5E + .pool +_080E0F5C: + ldr r1, =gUnknown_085E9510 +_080E0F5E: + ldr r2, =BuyMenuSubtractMoney +_080E0F60: + adds r0, r5, 0 + bl BuyMenuDisplayMessage + b _080E0F7A + .pool +_080E0F70: + ldr r1, =gUnknown_085E957F + ldr r2, =BuyMenuReturnToItemList + adds r0, r7, 0 + bl BuyMenuDisplayMessage +_080E0F7A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end BuyMenuTryMakePurchase + + thumb_func_start BuyMenuSubtractMoney +@ void BuyMenuSubtractMoney(u8 taskId) +BuyMenuSubtractMoney: @ 80E0F88 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0x26 + bl sav12_xor_increment + ldr r5, =0x03005d8c + ldr r0, [r5] + movs r4, 0x92 + lsls r4, 3 + adds r0, r4 + ldr r1, =0x02039f70 + ldr r1, [r1] + movs r2, 0x80 + lsls r2, 6 + adds r1, r2 + ldr r1, [r1] + bl subtract_money + movs r0, 0x5F + bl audio_play + ldr r0, [r5] + adds r0, r4 + bl DecryptMoney + adds r1, r0, 0 + movs r0, 0 + movs r2, 0 + bl PrintMoneyAmountInMoneyBox + ldr r0, =0x02039f60 + ldrb r0, [r0, 0xF] + cmp r0, 0 + bne _080E0FF0 + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =Task_ReturnToItemListAfterItemPurchase + b _080E0FFC + .pool +_080E0FF0: + ldr r0, =0x03005e00 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + ldr r0, =Task_ReturnToItemListAfterDecorationPurchase +_080E0FFC: + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end BuyMenuSubtractMoney + + thumb_func_start Task_ReturnToItemListAfterItemPurchase +@ void Task_ReturnToItemListAfterItemPurchase(u8 taskId) +Task_ReturnToItemListAfterItemPurchase: @ 80E100C + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _080E1072 + movs r0, 0x5 + bl audio_play + movs r1, 0xA + ldrsh r0, [r5, r1] + cmp r0, 0x4 + bne _080E106C + movs r1, 0x2 + ldrsh r0, [r5, r1] + cmp r0, 0x9 + ble _080E106C + movs r0, 0xC + movs r1, 0x1 + bl bag_add_item + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080E106C + ldr r1, =gUnknown_085E95EA + ldr r2, =BuyMenuReturnToItemList + adds r0, r4, 0 + bl BuyMenuDisplayMessage + b _080E1072 + .pool +_080E106C: + adds r0, r4, 0 + bl BuyMenuReturnToItemList +_080E1072: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end Task_ReturnToItemListAfterItemPurchase + + thumb_func_start Task_ReturnToItemListAfterDecorationPurchase +@ void Task_ReturnToItemListAfterDecorationPurchase(u8 taskId) +Task_ReturnToItemListAfterDecorationPurchase: @ 80E1078 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _080E1096 + movs r0, 0x5 + bl audio_play + adds r0, r4, 0 + bl BuyMenuReturnToItemList +_080E1096: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end Task_ReturnToItemListAfterDecorationPurchase + + thumb_func_start BuyMenuReturnToItemList +@ void BuyMenuReturnToItemList(u8 taskId) +BuyMenuReturnToItemList: @ 80E10A0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r5, =0x03005e08 + adds r6, r4, r5 + movs r0, 0x5 + movs r1, 0 + bl sub_8197DF8 + ldrb r0, [r6, 0xE] + movs r1, 0x1 + bl BuyMenuPrintCursor + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0x2 + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + bl BuyMenuAddScrollIndicatorArrows + subs r5, 0x8 + adds r4, r5 + ldr r0, =Task_BuyMenu + str r0, [r4] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end BuyMenuReturnToItemList + + thumb_func_start BuyMenuPrintItemQuantityAndPrice +@ void BuyMenuPrintItemQuantityAndPrice(u8 taskId) +BuyMenuPrintItemQuantityAndPrice: @ 80E10EC + push {r4,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e08 + adds r4, r0 + movs r0, 0x4 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, =0x02039f70 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 6 + adds r0, r1 + ldr r3, [r0] + movs r0, 0xFF + str r0, [sp] + movs r0, 0x4 + movs r1, 0x26 + movs r2, 0x1 + bl PrintMoneyAmount + ldr r0, =0x02021cc4 + movs r2, 0x2 + ldrsh r1, [r4, r2] + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085E8DA0 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x4 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl BuyMenuPrint + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end BuyMenuPrintItemQuantityAndPrice + + thumb_func_start ExitBuyMenu +@ void ExitBuyMenu(u8 taskId) +ExitBuyMenu: @ 80E1168 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =0x03005dac + ldr r0, =MapPostLoadHook_ExitBuyOrSellMenu + str r0, [r1] + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =Task_ExitBuyMenu + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ExitBuyMenu + + thumb_func_start Task_ExitBuyMenu +@ void Task_ExitBuyMenu(u8 taskId) +Task_ExitBuyMenu: @ 80E11B0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080E11D6 + bl RemoveMoneyLabelObject + bl BuyMenuFreeMemory + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + adds r0, r4, 0 + bl DestroyTask +_080E11D6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end Task_ExitBuyMenu + + thumb_func_start ClearItemPurchases +@ void ClearItemPurchases() +ClearItemPurchases: @ 80E11E4 + push {lr} + ldr r0, =0x02039f7c + movs r1, 0 + strb r1, [r0] + ldr r0, =0x02039f80 + movs r1, 0 + movs r2, 0xC + bl memset + pop {r0} + bx r0 + .pool + thumb_func_end ClearItemPurchases + + thumb_func_start RecordItemPurchase +@ void RecordItemPurchase(u8 taskId) +RecordItemPurchase: @ 80E1204 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r4, r1, r0 + movs r3, 0 + ldr r5, =0x02039f80 + adds r6, r5, 0 +_080E121A: + lsls r0, r3, 2 + adds r2, r0, r6 + ldrh r1, [r2] + movs r7, 0xA + ldrsh r0, [r4, r7] + cmp r1, r0 + bne _080E1250 + ldrh r0, [r2, 0x2] + cmp r0, 0 + beq _080E1250 + adds r1, r0, 0 + movs r3, 0x2 + ldrsh r0, [r4, r3] + adds r0, r1, r0 + cmp r0, 0xFF + ble _080E1248 + movs r0, 0xFF + strh r0, [r2, 0x2] + b _080E127A + .pool +_080E1248: + ldrh r0, [r4, 0x2] + adds r0, r1, r0 + strh r0, [r2, 0x2] + b _080E127A +_080E1250: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x2 + bls _080E121A + ldr r2, =0x02039f7c + ldrb r0, [r2] + cmp r0, 0x2 + bhi _080E127A + lsls r0, 2 + adds r0, r5 + ldrh r1, [r4, 0xA] + strh r1, [r0] + ldrb r0, [r2] + lsls r0, 2 + adds r0, r5 + ldrh r1, [r4, 0x2] + strh r1, [r0, 0x2] + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] +_080E127A: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end RecordItemPurchase + + thumb_func_start CreatePokemartMenu +@ void CreatePokemartMenu(u16 *itemsForSale) +CreatePokemartMenu: @ 80E1284 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0 + bl CreateShopMenu + adds r0, r4, 0 + bl SetShopItemsForSale + bl ClearItemPurchases + ldr r0, =script_env_2_enable_and_set_ctx_running + bl SetShopMenuCallback + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end CreatePokemartMenu + + thumb_func_start CreateDecorationShop1Menu +@ void CreateDecorationShop1Menu(u16 *itemsForSale) +CreateDecorationShop1Menu: @ 80E12A8 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1 + bl CreateShopMenu + adds r0, r4, 0 + bl SetShopItemsForSale + ldr r0, =script_env_2_enable_and_set_ctx_running + bl SetShopMenuCallback + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end CreateDecorationShop1Menu + + thumb_func_start CreateDecorationShop2Menu +@ void CreateDecorationShop2Menu(u16 *itemsForSale) +CreateDecorationShop2Menu: @ 80E12C8 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x2 + bl CreateShopMenu + adds r0, r4, 0 + bl SetShopItemsForSale + ldr r0, =script_env_2_enable_and_set_ctx_running + bl SetShopMenuCallback + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end CreateDecorationShop2Menu + + thumb_func_start sub_80E12E8 +sub_80E12E8: @ 80E12E8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + mov r9, r1 + lsls r0, 24 + lsrs r0, 24 + lsls r2, 16 + lsrs r2, 16 + mov r10, r2 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r0, [r1, 0x10] + subs r0, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + ldrh r0, [r1, 0x12] + subs r0, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + ldrh r4, [r1, 0xA] + movs r2, 0xC + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _080E13AC + movs r2, 0 + lsls r5, 16 + str r5, [sp, 0xC] + lsls r0, r3, 16 + lsls r1, r4, 16 + asrs r0, 16 + str r0, [sp] + asrs r1, 16 + str r1, [sp, 0x4] + lsls r0, r1, 1 + mov r1, r9 + adds r7, r0, r1 +_080E133C: + movs r4, 0 + lsls r2, 16 + mov r8, r2 + asrs r0, r2, 16 + ldr r2, [sp] + adds r6, r2, r0 +_080E1348: + ldr r0, [sp, 0xC] + asrs r1, r0, 16 + lsls r4, 16 + asrs r0, r4, 16 + adds r5, r1, r0 + adds r0, r5, 0 + adds r1, r6, 0 + bl MapGridGetMetatileIdAt + movs r2, 0 + ldrsh r1, [r7, r2] + lsls r0, 16 + asrs r0, 16 + cmp r1, r0 + bne _080E1390 + ldr r0, [sp, 0x4] + cmp r0, 0x2 + beq _080E1380 + ldrh r0, [r7, 0x2] + mov r2, r10 + orrs r2, r0 + adds r0, r5, 0 + adds r1, r6, 0 + bl MapGridSetMetatileIdAt + b _080E1390 + .pool +_080E1380: + mov r1, r9 + ldrh r0, [r1] + mov r2, r10 + orrs r2, r0 + adds r0, r5, 0 + adds r1, r6, 0 + bl MapGridSetMetatileIdAt +_080E1390: + movs r2, 0x80 + lsls r2, 9 + adds r0, r4, r2 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _080E1348 + adds r0, r2, 0 + add r0, r8 + lsrs r2, r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _080E133C + b _080E1434 +_080E13AC: + movs r2, 0 + lsls r5, 16 + str r5, [sp, 0xC] + lsls r0, r3, 16 + lsls r1, r4, 16 + asrs r0, 16 + str r0, [sp, 0x8] + asrs r7, r1, 16 +_080E13BC: + movs r4, 0 + lsls r2, 16 + mov r8, r2 + asrs r0, r2, 16 + ldr r1, [sp, 0x8] + adds r6, r1, r0 +_080E13C8: + ldr r2, [sp, 0xC] + asrs r1, r2, 16 + lsls r4, 16 + asrs r0, r4, 16 + adds r5, r1, r0 + adds r0, r5, 0 + adds r1, r6, 0 + bl MapGridGetMetatileIdAt + movs r1, 0x2 + subs r1, r7 + lsls r1, 1 + add r1, r9 + movs r2, 0 + ldrsh r1, [r1, r2] + lsls r0, 16 + asrs r0, 16 + cmp r1, r0 + bne _080E141A + cmp r7, 0x2 + beq _080E140A + movs r0, 0x1 + subs r0, r7 + lsls r0, 1 + add r0, r9 + ldrh r0, [r0] + mov r2, r10 + orrs r2, r0 + adds r0, r5, 0 + adds r1, r6, 0 + bl MapGridSetMetatileIdAt + b _080E141A +_080E140A: + mov r1, r9 + ldrh r0, [r1, 0x4] + mov r2, r10 + orrs r2, r0 + adds r0, r5, 0 + adds r1, r6, 0 + bl MapGridSetMetatileIdAt +_080E141A: + movs r2, 0x80 + lsls r2, 9 + adds r0, r4, r2 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _080E13C8 + adds r0, r2, 0 + add r0, r8 + lsrs r2, r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _080E13BC +_080E1434: + 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_80E12E8 + + thumb_func_start sub_80E1444 +sub_80E1444: @ 80E1444 + push {r4,r5,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + movs r0, 0x1 + strh r0, [r4, 0x6] + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x6 + bhi _080E14DE + lsls r0, 2 + ldr r1, =_080E1474 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080E1474: + .4byte _080E1490 + .4byte _080E1498 + .4byte _080E14A0 + .4byte _080E14A8 + .4byte _080E14B0 + .4byte _080E14C4 + .4byte _080E14D4 +_080E1490: + ldr r1, =gUnknown_08589ABA + b _080E14C6 + .pool +_080E1498: + ldr r1, =gUnknown_08589AC0 + b _080E14C6 + .pool +_080E14A0: + ldr r1, =gUnknown_08589AC6 + b _080E14B2 + .pool +_080E14A8: + ldr r1, =gUnknown_08589ACC + b _080E14C6 + .pool +_080E14B0: + ldr r1, =gUnknown_08589AD2 +_080E14B2: + movs r2, 0xC0 + lsls r2, 4 + adds r0, r3, 0 + bl sub_80E12E8 + b _080E14DE + .pool +_080E14C4: + ldr r1, =gUnknown_08589AD8 +_080E14C6: + adds r0, r3, 0 + movs r2, 0 + bl sub_80E12E8 + b _080E14DE + .pool +_080E14D4: + ldr r1, =gUnknown_08589ADE + adds r0, r3, 0 + movs r2, 0 + bl sub_80E12E8 +_080E14DE: + ldrh r0, [r4] + adds r0, 0x1 + movs r1, 0x7 + ands r0, r1 + strh r0, [r4] + adds r5, r0, 0 + cmp r5, 0 + bne _080E1502 + bl DrawWholeMapView + movs r1, 0x2 + ldrsh r0, [r4, r1] + adds r0, 0x1 + movs r1, 0x3 + bl __modsi3 + strh r0, [r4, 0x2] + strh r5, [r4, 0x6] +_080E1502: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E1444 + + thumb_func_start sub_80E150C +sub_80E150C: @ 80E150C + push {r4-r7,lr} + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + ldr r6, =sub_80E1444 + adds r0, r6, 0 + movs r1, 0 + bl CreateTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r7, r0, r1 + adds r0, r7, 0 + adds r0, 0x8 + adds r1, r7, 0 + adds r1, 0xA + bl PlayerGetDestCoords + movs r0, 0 + strh r0, [r7] + strh r0, [r7, 0x2] + strh r5, [r7, 0x4] + adds r0, r4, 0 + bl _call_via_r6 + adds r0, r4, 0 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80E150C + + thumb_func_start sub_80E1558 +sub_80E1558: @ 80E1558 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_80E150C + ldr r1, =0x02039f8c + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E1558 + + thumb_func_start sub_80E1570 +sub_80E1570: @ 80E1570 + push {lr} + ldr r0, =0x02039f8c + ldrb r0, [r0] + bl DestroyTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80E1570 + + thumb_func_start sub_80E1584 +sub_80E1584: @ 80E1584 + push {lr} + ldr r2, =0x03005e00 + ldr r0, =0x02039f8c + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r1, r0, r2 + movs r2, 0xE + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _080E15B0 + movs r2, 0xA + ldrsh r0, [r1, r2] + cmp r0, 0x2 + bne _080E15B0 + movs r0, 0 + b _080E15B2 + .pool +_080E15B0: + movs r0, 0x1 +_080E15B2: + pop {r1} + bx r1 + thumb_func_end sub_80E1584 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/slot_machine.s b/asm/slot_machine.s new file mode 100644 index 000000000..1701b6571 --- /dev/null +++ b/asm/slot_machine.s @@ -0,0 +1,11223 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_812A4DC +sub_812A4DC: @ 812A4DC + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0 + beq _0812A500 + cmp r1, 0x1 + beq _0812A518 + b _0812A530 + .pool +_0812A500: + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0812A530 +_0812A518: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0812A530 + ldr r0, =sub_812A588 + bl SetMainCallback2 + adds r0, r5, 0 + bl DestroyTask +_0812A530: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A4DC + + thumb_func_start sub_812A540 +sub_812A540: @ 812A540 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =0x0203ab34 + movs r0, 0x68 + bl AllocZeroed + str r0, [r5] + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_812A6D4 + ldr r0, =sub_812A4DC + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0 + strh r0, [r1, 0x8] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A540 + + thumb_func_start sub_812A588 +sub_812A588: @ 812A588 + push {lr} + sub sp, 0x4 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xB + bhi _0812A666 + lsls r0, 2 + ldr r1, =_0812A5AC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0812A5AC: + .4byte _0812A5DC + .4byte _0812A5E6 + .4byte _0812A5EC + .4byte _0812A5F6 + .4byte _0812A5FC + .4byte _0812A602 + .4byte _0812A608 + .4byte _0812A60E + .4byte _0812A638 + .4byte _0812A63E + .4byte _0812A644 + .4byte _0812A660 +_0812A5DC: + bl sub_812A750 + bl sub_812A8C4 + b _0812A64C +_0812A5E6: + bl sub_812A7BC + b _0812A64C +_0812A5EC: + bl sub_812A810 + bl sub_812A834 + b _0812A64C +_0812A5F6: + bl sub_812A9AC + b _0812A64C +_0812A5FC: + bl sub_812A9CC + b _0812A64C +_0812A602: + bl sub_812AA48 + b _0812A64C +_0812A608: + bl sub_812A79C + b _0812A64C +_0812A60E: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + b _0812A64C +_0812A638: + bl sub_812FBC4 + b _0812A64C +_0812A63E: + bl sub_812FB14 + b _0812A64C +_0812A644: + bl sub_812AA78 + bl sub_812AA90 +_0812A64C: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0812A666 + .pool +_0812A660: + ldr r0, =sub_812A670 + bl SetMainCallback2 +_0812A666: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A588 + + thumb_func_start sub_812A670 +sub_812A670: @ 812A670 + push {lr} + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_812A670 + + thumb_func_start sub_812A688 +sub_812A688: @ 812A688 + push {r4,lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + ldr r4, =0x0203ab34 + ldr r0, [r4] + adds r0, 0x58 + ldrh r1, [r0] + movs r0, 0x40 + bl SetGpuReg + ldr r0, [r4] + adds r0, 0x5A + ldrh r1, [r0] + movs r0, 0x44 + bl SetGpuReg + ldr r0, [r4] + adds r0, 0x5C + ldrh r1, [r0] + movs r0, 0x48 + bl SetGpuReg + ldr r0, [r4] + adds r0, 0x5E + ldrh r1, [r0] + movs r0, 0x4A + bl SetGpuReg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A688 + + thumb_func_start sub_812A6D4 +sub_812A6D4: @ 812A6D4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =TaskDummy9 + movs r1, 0xFF + bl CreateTask + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r0, r1 + strh r4, [r0, 0x8] + adds r0, 0xA + adds r1, r5, 0 + bl sub_806F67C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A6D4 + + thumb_func_start sub_812A710 +sub_812A710: @ 812A710 + push {lr} + ldr r0, =TaskDummy9 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + ldr r0, =0x03005e00 + adds r2, r0 + ldr r3, =0x0203ab34 + ldr r1, [r3] + ldrh r0, [r2, 0x8] + strb r0, [r1, 0x1] + adds r2, 0xA + ldr r1, [r3] + adds r1, 0x64 + adds r0, r2, 0 + bl sub_806F684 + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A710 + + thumb_func_start TaskDummy9 +TaskDummy9: @ 812A74C + bx lr + thumb_func_end TaskDummy9 + + thumb_func_start sub_812A750 +sub_812A750: @ 812A750 + push {lr} + sub sp, 0x4 + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + str r0, [sp] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x05006000 + mov r0, sp + bl CpuSet + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085A7424 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r0, =gUnknown_085A7434 + bl InitWindows + bl DeactivateAllTextPrinters + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A750 + + thumb_func_start sub_812A79C +sub_812A79C: @ 812A79C + push {lr} + ldr r0, =sub_812A688 + bl SetVBlankCallback + movs r0, 0x1 + bl EnableInterrupts + movs r1, 0xC1 + lsls r1, 6 + movs r0, 0 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A79C + + thumb_func_start sub_812A7BC +sub_812A7BC: @ 812A7BC + push {r4-r7,lr} + sub sp, 0x4 + movs r2, 0xC0 + lsls r2, 19 + movs r3, 0x80 + lsls r3, 9 + mov r4, sp + movs r6, 0 + ldr r1, =0x040000d4 + movs r5, 0x80 + lsls r5, 5 + ldr r7, =0x81000800 + movs r0, 0x81 + lsls r0, 24 + mov r12, r0 +_0812A7DA: + strh r6, [r4] + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + str r7, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r2, r5 + subs r3, r5 + cmp r3, r5 + bhi _0812A7DA + strh r6, [r4] + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + lsrs r0, r3, 1 + mov r2, r12 + orrs r0, r2 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A7BC + + thumb_func_start sub_812A810 +sub_812A810: @ 812A810 + sub sp, 0x4 + movs r2, 0xE0 + lsls r2, 19 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r0, =0x040000d4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, =0x81000200 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + add sp, 0x4 + bx lr + .pool + thumb_func_end sub_812A810 + + thumb_func_start sub_812A834 +sub_812A834: @ 812A834 + push {lr} + movs r0, 0x8 + movs r1, 0 + bl SetGpuReg + movs r0, 0xA + movs r1, 0 + bl SetGpuReg + movs r0, 0xC + movs r1, 0 + bl SetGpuReg + movs r0, 0xE + movs r1, 0 + bl SetGpuReg + movs r0, 0x10 + movs r1, 0 + bl SetGpuReg + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + movs r0, 0x16 + movs r1, 0 + bl SetGpuReg + movs r0, 0x18 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg + movs r0, 0x1C + movs r1, 0 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x3F + bl SetGpuReg + ldr r1, =0x00001048 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x00000809 + movs r0, 0x52 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A834 + + thumb_func_start sub_812A8C4 +sub_812A8C4: @ 812A8C4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + bl sub_812A710 + ldr r5, =0x0203ab34 + ldr r0, [r5] + movs r4, 0 + strb r4, [r0] + ldr r0, [r5] + strb r4, [r0, 0x2] + bl GenerateRandomNumber + ldr r2, [r5] + movs r1, 0x1 + ands r1, r0 + strb r1, [r2, 0x3] + ldr r0, [r5] + strb r4, [r0, 0x4] + ldr r0, [r5] + movs r1, 0 + strh r4, [r0, 0x8] + strb r1, [r0, 0xA] + ldr r0, [r5] + strb r1, [r0, 0xB] + bl GetCoins + ldr r2, [r5] + strh r0, [r2, 0xC] + strh r4, [r2, 0xE] + strh r4, [r2, 0x10] + strh r4, [r2, 0x12] + strh r4, [r2, 0x18] + movs r0, 0x8 + strh r0, [r2, 0x1A] + adds r1, r2, 0 + adds r1, 0x58 + movs r0, 0xF0 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0xA0 + strh r0, [r1] + adds r0, r2, 0 + adds r0, 0x5C + movs r1, 0x3F + strh r1, [r0] + adds r0, 0x2 + strh r1, [r0] + bl current_map_music_get + ldr r1, [r5] + adds r1, 0x60 + strh r0, [r1] + movs r7, 0 + ldr r0, =gUnknown_085A76B4 + mov r8, r0 +_0812A934: + ldr r0, =0x0203ab34 + ldr r4, [r0] + lsls r6, r7, 1 + adds r0, r4, 0 + adds r0, 0x22 + adds r0, r6 + movs r1, 0 + strh r1, [r0] + adds r5, r4, 0 + adds r5, 0x28 + adds r5, r6 + ldrb r0, [r4, 0x3] + lsls r0, 1 + lsls r1, r7, 2 + adds r0, r1 + add r0, r8 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0x15 + bl __modsi3 + strh r0, [r5] + adds r4, 0x1C + adds r4, r6 + movs r2, 0 + ldrsh r0, [r5, r2] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + movs r2, 0xFC + lsls r2, 1 + adds r0, r2, 0 + subs r0, r1 + strh r0, [r4] + movs r1, 0 + ldrsh r0, [r4, r1] + adds r1, r2, 0 + bl __modsi3 + strh r0, [r4] + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x2 + bls _0812A934 + bl GetCoins + lsls r0, 16 + lsrs r0, 16 + bl sub_80EDE70 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A8C4 + + thumb_func_start sub_812A9AC +sub_812A9AC: @ 812A9AC + push {lr} + bl sub_80A1A74 + bl ResetAllObjectData + ldr r1, =0x02021b38 + movs r0, 0x80 + strb r0, [r1] + bl ResetObjectPaletteAllocator + bl ResetTasks + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A9AC + + thumb_func_start sub_812A9CC +sub_812A9CC: @ 812A9CC + push {r4,r5,lr} + ldr r4, =0x0203aacc + movs r0, 0x8 + bl Alloc + str r0, [r4] + ldr r4, =0x0203aad0 + movs r0, 0xE + bl AllocZeroed + str r0, [r4] + ldr r5, =0x0203aadc + movs r0, 0x8 + bl AllocZeroed + str r0, [r5] + ldr r1, [r4] + ldr r2, =0x00002051 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, [r4] + ldr r2, =0x00002851 + adds r0, r2, 0 + strh r0, [r1, 0x2] + ldr r2, =0x00002061 + adds r0, r2, 0 + strh r0, [r1, 0x4] + ldr r2, =0x00002861 + adds r0, r2, 0 + strh r0, [r1, 0x6] + ldr r2, =0x000020be + adds r0, r2, 0 + strh r0, [r1, 0x8] + ldr r2, =0x000028be + adds r0, r2, 0 + strh r0, [r1, 0xA] + ldr r2, =0x000020bf + adds r0, r2, 0 + strh r0, [r1, 0xC] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812A9CC + + thumb_func_start sub_812AA48 +sub_812AA48: @ 812AA48 + push {lr} + bl sub_812F908 + bl sub_812F958 + bl sub_812F7E4 + 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 + movs r0, 0 + bl PutWindowTilemap + pop {r0} + bx r0 + thumb_func_end sub_812AA48 + + thumb_func_start sub_812AA78 +sub_812AA78: @ 812AA78 + push {lr} + bl sub_812E0E4 + bl sub_812E1C8 + bl sub_812CEF4 + bl sub_812E300 + pop {r0} + bx r0 + thumb_func_end sub_812AA78 + + thumb_func_start sub_812AA90 +sub_812AA90: @ 812AA90 + push {lr} + bl sub_812D188 + bl sub_812BE5C + bl sub_812DE94 + bl sub_812AAA8 + pop {r0} + bx r0 + thumb_func_end sub_812AA90 + + thumb_func_start sub_812AAA8 +sub_812AAA8: @ 812AAA8 + push {r4,lr} + ldr r4, =sub_812AAC8 + adds r0, r4, 0 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812AAA8 + + thumb_func_start sub_812AAC8 +sub_812AAC8: @ 812AAC8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r6, =gUnknown_085A7450 + lsls r1, r0, 2 + adds r1, r0 + lsls r4, r1, 3 + ldr r5, =0x03005e00 +_0812AAD8: + ldr r0, =0x0203ab34 + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r6 + ldr r1, [r0] + adds r0, r4, r5 + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + bne _0812AAD8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812AAC8 + + thumb_func_start sub_812AB04 +sub_812AB04: @ 812AB04 + push {r4,lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r4, =0x0203ab34 + ldr r0, [r4] + ldrb r0, [r0, 0x2] + bl sub_812D3B4 + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812AB04 + + thumb_func_start sub_812AB38 +sub_812AB38: @ 812AB38 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0812AB50 + ldr r0, =0x0203ab34 + ldr r1, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0812AB50: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_812AB38 + + thumb_func_start sub_812AB60 +sub_812AB60: @ 812AB60 + push {lr} + ldr r3, =0x0203ab34 + ldr r1, [r3] + movs r0, 0 + strh r0, [r1, 0xE] + strh r0, [r1, 0x12] + strh r0, [r1, 0x18] + ldrb r2, [r1, 0x4] + movs r0, 0xC0 + ands r0, r2 + strb r0, [r1, 0x4] + ldr r1, [r3] + movs r0, 0x4 + strb r0, [r1] + ldr r3, [r3] + movs r1, 0xC + ldrsh r0, [r3, r1] + cmp r0, 0 + bgt _0812AB90 + movs r0, 0x19 + strb r0, [r3] + b _0812ABA0 + .pool +_0812AB90: + ldrb r0, [r3, 0xA] + cmp r0, 0 + beq _0812ABA0 + movs r0, 0x3 + strb r0, [r3] + movs r0, 0x4 + bl sub_812DEE4 +_0812ABA0: + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_812AB60 + + thumb_func_start sub_812ABA8 +sub_812ABA8: @ 812ABA8 + push {lr} + bl sub_812E054 + lsls r0, 24 + cmp r0, 0 + beq _0812ABBC + ldr r0, =0x0203ab34 + ldr r1, [r0] + movs r0, 0x4 + strb r0, [r1] +_0812ABBC: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_812ABA8 + + thumb_func_start sub_812ABC8 +sub_812ABC8: @ 812ABC8 + push {lr} + movs r0, 0 + bl sub_812DEE4 + ldr r2, =0x0203ab34 + ldr r1, [r2] + movs r0, 0x5 + strb r0, [r1] + ldr r2, [r2] + movs r0, 0xC + ldrsh r1, [r2, r0] + ldr r0, =0x0000270e + cmp r1, r0 + ble _0812ABE8 + movs r0, 0x17 + strb r0, [r2] +_0812ABE8: + movs r0, 0x1 + pop {r1} + bx r1 + .pool + thumb_func_end sub_812ABC8 + + thumb_func_start sub_812ABF8 +sub_812ABF8: @ 812ABF8 + push {r4,r5,lr} + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0812AC1C + movs r0, 0 + bl sub_812DC80 + ldr r0, =0x0203ab34 + ldr r1, [r0] + movs r0, 0x8 + b _0812ACE2 + .pool +_0812AC1C: + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _0812AC82 + ldr r0, =0x0203ab34 + ldr r2, [r0] + movs r1, 0xC + ldrsh r0, [r2, r1] + subs r0, 0x3 + movs r3, 0x12 + ldrsh r1, [r2, r3] + adds r0, r1 + cmp r0, 0 + blt _0812AC7C + ldrh r4, [r2, 0x12] + adds r0, r1, 0 + cmp r0, 0x2 + bgt _0812AC5A +_0812AC42: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_812CE7C + lsls r0, r4, 16 + movs r2, 0x80 + lsls r2, 9 + adds r0, r2 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _0812AC42 +_0812AC5A: + ldr r0, =0x0203ab34 + ldr r1, [r0] + ldrh r0, [r1, 0xC] + subs r0, 0x3 + ldrh r3, [r1, 0x12] + adds r0, r3 + strh r0, [r1, 0xC] + movs r0, 0x3 + strh r0, [r1, 0x12] + movs r0, 0x9 + strb r0, [r1] + movs r0, 0x5F + bl audio_play + b _0812ACE4 + .pool +_0812AC7C: + movs r0, 0x6 + strb r0, [r2] + b _0812ACE4 +_0812AC82: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0812ACB2 + ldr r4, =0x0203ab34 + ldr r0, [r4] + movs r1, 0xC + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _0812ACB2 + movs r0, 0x5F + bl audio_play + ldr r0, [r4] + ldrb r0, [r0, 0x12] + bl sub_812CE7C + ldr r1, [r4] + ldrh r0, [r1, 0xC] + subs r0, 0x1 + strh r0, [r1, 0xC] + ldrh r0, [r1, 0x12] + adds r0, 0x1 + strh r0, [r1, 0x12] +_0812ACB2: + ldr r0, =0x0203ab34 + ldr r3, [r0] + movs r1, 0x12 + ldrsh r2, [r3, r1] + ldr r4, =0x030022c0 + adds r5, r0, 0 + cmp r2, 0x2 + bgt _0812ACD0 + cmp r2, 0 + beq _0812ACD4 + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0812ACD4 +_0812ACD0: + movs r0, 0x9 + strb r0, [r3] +_0812ACD4: + ldrh r1, [r4, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0812ACE4 + ldr r1, [r5] + movs r0, 0x15 +_0812ACE2: + strb r0, [r1] +_0812ACE4: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812ABF8 + + thumb_func_start sub_812ACF4 +sub_812ACF4: @ 812ACF4 + push {lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + ldr r2, =gUnknown_085EF734 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =0x0203ab34 + ldr r1, [r0] + movs r0, 0x7 + strb r0, [r1] + movs r0, 0 + add sp, 0xC + pop {r1} + bx r1 + .pool + thumb_func_end sub_812ACF4 + + thumb_func_start sub_812AD34 +sub_812AD34: @ 812AD34 + push {lr} + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0812AD52 + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + ldr r0, =0x0203ab34 + ldr r1, [r0] + movs r0, 0x5 + strb r0, [r1] +_0812AD52: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_812AD34 + + thumb_func_start sub_812AD60 +sub_812AD60: @ 812AD60 + push {lr} + bl sub_812DCB4 + lsls r0, 24 + cmp r0, 0 + beq _0812AD74 + ldr r0, =0x0203ab34 + ldr r1, [r0] + movs r0, 0x5 + strb r0, [r1] +_0812AD74: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_812AD60 + + thumb_func_start sub_812AD80 +sub_812AD80: @ 812AD80 + push {r4,lr} + adds r4, r0, 0 + bl sub_812B4EC + bl sub_812DFDC + movs r0, 0 + bl sub_812BEA4 + movs r0, 0x1 + bl sub_812BEA4 + movs r0, 0x2 + bl sub_812BEA4 + bl sub_80EEC80 + movs r0, 0 + strh r0, [r4, 0x8] + ldr r4, =0x0203ab34 + ldr r0, [r4] + ldrb r1, [r0, 0x4] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0812ADC4 + bl sub_812D4AC + ldr r1, [r4] + movs r0, 0xA + b _0812ADCE + .pool +_0812ADC4: + movs r0, 0x1 + bl sub_812DEE4 + ldr r1, [r4] + movs r0, 0xB +_0812ADCE: + strb r0, [r1] + ldr r4, =0x0203ab34 + ldr r0, [r4] + movs r1, 0x8 + strh r1, [r0, 0x1A] + ldrb r0, [r0, 0xA] + cmp r0, 0 + beq _0812ADE6 + bl dp15_jump_random_unknown + ldr r1, [r4] + strh r0, [r1, 0x1A] +_0812ADE6: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812AD80 + + thumb_func_start sub_812ADF4 +sub_812ADF4: @ 812ADF4 + push {lr} + bl sub_812D4CC + lsls r0, 24 + cmp r0, 0 + beq _0812AE18 + movs r0, 0x1 + bl sub_812DEE4 + ldr r3, =0x0203ab34 + ldr r2, [r3] + ldrb r1, [r2, 0x4] + movs r0, 0xDF + ands r0, r1 + strb r0, [r2, 0x4] + ldr r1, [r3] + movs r0, 0xB + strb r0, [r1] +_0812AE18: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_812ADF4 + + thumb_func_start sub_812AE24 +sub_812AE24: @ 812AE24 + push {lr} + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x1D + ble _0812AE40 + bl sub_812B55C + ldr r0, =0x0203ab34 + ldr r1, [r0] + movs r0, 0xC + strb r0, [r1] +_0812AE40: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_812AE24 + + thumb_func_start sub_812AE4C +sub_812AE4C: @ 812AE4C + push {r4,lr} + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0812AE78 + movs r0, 0x18 + bl audio_play + ldr r4, =0x0203ab34 + ldr r0, [r4] + ldrb r0, [r0, 0x18] + bl sub_812BEDC + ldr r0, [r4] + ldrb r0, [r0, 0x18] + bl sub_812CD40 + ldr r1, [r4] + movs r0, 0xD + strb r0, [r1] +_0812AE78: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812AE4C + + thumb_func_start sub_812AE88 +sub_812AE88: @ 812AE88 + push {r4,lr} + ldr r4, =0x0203ab34 + ldr r0, [r4] + ldrb r0, [r0, 0x18] + bl sub_812BF04 + lsls r0, 24 + cmp r0, 0 + bne _0812AEBC + ldr r1, [r4] + ldrh r0, [r1, 0x18] + adds r0, 0x1 + strh r0, [r1, 0x18] + movs r0, 0xC + strb r0, [r1] + ldr r1, [r4] + movs r2, 0x18 + ldrsh r0, [r1, r2] + cmp r0, 0x2 + ble _0812AEB4 + movs r0, 0xE + strb r0, [r1] +_0812AEB4: + movs r0, 0x1 + b _0812AEBE + .pool +_0812AEBC: + movs r0, 0 +_0812AEBE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_812AE88 + + thumb_func_start sub_812AEC4 +sub_812AEC4: @ 812AEC4 + push {r4,lr} + ldr r4, =0x0203ab34 + ldr r2, [r4] + ldrb r1, [r2, 0x4] + movs r0, 0xC0 + ands r0, r1 + strb r0, [r2, 0x4] + bl sub_812B828 + ldr r1, [r4] + ldrb r0, [r1, 0xA] + cmp r0, 0 + beq _0812AEEA + subs r0, 0x1 + strb r0, [r1, 0xA] + ldr r1, [r4] + ldrb r0, [r1, 0xB] + adds r0, 0x1 + strb r0, [r1, 0xB] +_0812AEEA: + ldr r1, [r4] + ldrh r0, [r1, 0x8] + cmp r0, 0 + beq _0812AFCC + movs r0, 0xF + strb r0, [r1] + bl sub_812BABC + bl sub_812D0B0 + ldr r2, [r4] + ldrh r0, [r2, 0x10] + ldrh r1, [r2, 0xE] + subs r0, r1 + strh r0, [r2, 0x10] + lsls r0, 16 + cmp r0, 0 + bge _0812AF12 + movs r0, 0 + strh r0, [r2, 0x10] +_0812AF12: + ldr r0, [r4] + ldrh r1, [r0, 0x8] + movs r0, 0xC0 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _0812AF38 + ldr r0, =0x00000185 + bl fanfare_play + movs r0, 0x6 + bl sub_812DEE4 + b _0812AF62 + .pool +_0812AF38: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0812AF54 + ldr r0, =0x00000185 + bl fanfare_play + movs r0, 0x5 + bl sub_812DEE4 + b _0812AF62 + .pool +_0812AF54: + movs r0, 0xC3 + lsls r0, 1 + bl fanfare_play + movs r0, 0x2 + bl sub_812DEE4 +_0812AF62: + ldr r2, =0x0203ab34 + ldr r3, [r2] + ldrh r1, [r3, 0x8] + movs r0, 0xE0 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _0812AFA6 + ldrb r1, [r3, 0x4] + movs r0, 0x3F + ands r0, r1 + movs r4, 0 + strb r0, [r3, 0x4] + ldr r3, [r2] + ldrh r1, [r3, 0x8] + movs r0, 0xC0 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _0812AFA6 + strb r4, [r3, 0xA] + ldr r0, [r2] + strb r4, [r0, 0xB] + ldr r0, [r2] + strb r4, [r0, 0x3] + ldr r3, [r2] + ldrh r1, [r3, 0x8] + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _0812AFA6 + movs r0, 0x1 + strb r0, [r3, 0x3] +_0812AFA6: + ldr r3, [r2] + ldrh r1, [r3, 0x8] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0812AFEE + ldrb r0, [r3, 0x2] + cmp r0, 0xF + bhi _0812AFEE + adds r0, 0x1 + strb r0, [r3, 0x2] + ldr r0, [r2] + ldrb r0, [r0, 0x2] + bl sub_812D1A8 + b _0812AFEE + .pool +_0812AFCC: + movs r0, 0x3 + bl sub_812DEE4 + ldr r1, [r4] + movs r0, 0x14 + strb r0, [r1] + ldr r1, [r4] + ldrh r0, [r1, 0x12] + ldrh r2, [r1, 0x10] + adds r0, r2 + strh r0, [r1, 0x10] + lsls r0, 16 + asrs r0, 16 + ldr r2, =0x0000270f + cmp r0, r2 + ble _0812AFEE + strh r2, [r1, 0x10] +_0812AFEE: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812AEC4 + + thumb_func_start sub_812AFFC +sub_812AFFC: @ 812AFFC + push {lr} + bl sub_812BADC + lsls r0, 24 + cmp r0, 0 + beq _0812B010 + ldr r0, =0x0203ab34 + ldr r1, [r0] + movs r0, 0x10 + strb r0, [r1] +_0812B010: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_812AFFC + + thumb_func_start sub_812B01C +sub_812B01C: @ 812B01C + push {r4,lr} + bl sub_812D0E0 + lsls r0, 24 + cmp r0, 0 + beq _0812B088 + ldr r4, =0x0203ab34 + ldr r1, [r4] + movs r0, 0x13 + strb r0, [r1] + ldr r0, [r4] + ldrh r1, [r0, 0x8] + movs r0, 0xC0 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _0812B044 + movs r0, 0x1C + bl sav12_xor_increment +_0812B044: + ldr r2, [r4] + ldrh r1, [r2, 0x8] + movs r3, 0x4 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _0812B05A + movs r0, 0 + strh r0, [r2, 0x18] + movs r0, 0x9 + strb r0, [r2] +_0812B05A: + ldr r2, [r4] + ldrh r1, [r2, 0x8] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0812B06A + movs r0, 0x11 + strb r0, [r2] +_0812B06A: + ldr r1, [r4] + ldrb r0, [r1, 0xA] + cmp r0, 0 + beq _0812B088 + ldrh r1, [r1, 0x8] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _0812B088 + movs r0, 0x4 + bl sub_812DEE4 + ldr r1, [r4] + movs r0, 0x12 + strb r0, [r1] +_0812B088: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812B01C + + thumb_func_start sub_812B094 +sub_812B094: @ 812B094 + push {r4,lr} + bl sub_812D20C + lsls r0, 24 + cmp r0, 0 + bne _0812B0CC + ldr r4, =0x0203ab34 + ldr r1, [r4] + movs r0, 0x13 + strb r0, [r1] + ldr r2, [r4] + ldrh r1, [r2, 0x8] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0812B0CC + movs r0, 0x9 + strb r0, [r2] + ldr r0, [r4] + ldrb r0, [r0, 0xA] + cmp r0, 0 + beq _0812B0CC + movs r0, 0x4 + bl sub_812DEE4 + ldr r1, [r4] + movs r0, 0x12 + strb r0, [r1] +_0812B0CC: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812B094 + + thumb_func_start sub_812B0D8 +sub_812B0D8: @ 812B0D8 + push {lr} + bl sub_812E054 + lsls r0, 24 + cmp r0, 0 + beq _0812B0FC + ldr r2, =0x0203ab34 + ldr r1, [r2] + movs r0, 0x13 + strb r0, [r1] + ldr r2, [r2] + ldrh r1, [r2, 0x8] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0812B0FC + movs r0, 0x9 + strb r0, [r2] +_0812B0FC: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_812B0D8 + + thumb_func_start sub_812B108 +sub_812B108: @ 812B108 + push {lr} + movs r0, 0 + bl sub_812CEB8 + movs r0, 0x1 + bl sub_812CEB8 + movs r0, 0x2 + bl sub_812CEB8 + ldr r0, =0x0203ab34 + ldr r1, [r0] + movs r0, 0x2 + strb r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_812B108 + + thumb_func_start sub_812B130 +sub_812B130: @ 812B130 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x40 + ble _0812B14E + movs r0, 0 + strh r0, [r1, 0xA] + ldr r0, =0x0203ab34 + ldr r1, [r0] + movs r0, 0x13 + strb r0, [r1] +_0812B14E: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_812B130 + + thumb_func_start sub_812B158 +sub_812B158: @ 812B158 + push {lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + ldr r2, =gUnknown_085EF6E9 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + movs r2, 0x85 + lsls r2, 2 + movs r3, 0xC0 + lsls r3, 1 + movs r0, 0xE + str r0, [sp] + movs r0, 0xF + str r0, [sp, 0x4] + movs r0, 0x15 + movs r1, 0x7 + bl sub_80323CC + ldr r0, =0x0203ab34 + ldr r1, [r0] + movs r0, 0x16 + strb r0, [r1] + movs r0, 0 + add sp, 0xC + pop {r1} + bx r1 + .pool + thumb_func_end sub_812B158 + + thumb_func_start sub_812B1B0 +sub_812B1B0: @ 812B1B0 + push {lr} + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + bne _0812B1EC + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + movs r0, 0 + bl sub_812CEB8 + movs r0, 0x1 + bl sub_812CEB8 + movs r0, 0x2 + bl sub_812CEB8 + ldr r0, =0x0203ab34 + ldr r1, [r0] + ldrh r0, [r1, 0x12] + ldrh r2, [r1, 0xC] + adds r0, r2 + strh r0, [r1, 0xC] + movs r0, 0x1B + b _0812B206 + .pool +_0812B1EC: + cmp r1, 0x1 + beq _0812B1F8 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _0812B208 +_0812B1F8: + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + ldr r0, =0x0203ab34 + ldr r1, [r0] + movs r0, 0x5 +_0812B206: + strb r0, [r1] +_0812B208: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_812B1B0 + + thumb_func_start sub_812B214 +sub_812B214: @ 812B214 + push {lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + ldr r2, =gUnknown_085EF6F8 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =0x0203ab34 + ldr r1, [r0] + movs r0, 0x18 + strb r0, [r1] + movs r0, 0 + add sp, 0xC + pop {r1} + bx r1 + .pool + thumb_func_end sub_812B214 + + thumb_func_start sub_812B254 +sub_812B254: @ 812B254 + push {lr} + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0812B272 + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + ldr r0, =0x0203ab34 + ldr r1, [r0] + movs r0, 0x5 + strb r0, [r1] +_0812B272: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_812B254 + + thumb_func_start sub_812B280 +sub_812B280: @ 812B280 + push {lr} + sub sp, 0xC + movs r0, 0 + movs r1, 0 + bl sub_81973C4 + ldr r2, =gUnknown_085EF710 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =0x0203ab34 + ldr r1, [r0] + movs r0, 0x1A + strb r0, [r1] + movs r0, 0 + add sp, 0xC + pop {r1} + bx r1 + .pool + thumb_func_end sub_812B280 + + thumb_func_start sub_812B2C0 +sub_812B2C0: @ 812B2C0 + push {lr} + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0812B2DE + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + ldr r0, =0x0203ab34 + ldr r1, [r0] + movs r0, 0x1B + strb r0, [r1] +_0812B2DE: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_812B2C0 + + thumb_func_start sub_812B2EC +sub_812B2EC: @ 812B2EC + push {r4,lr} + sub sp, 0x4 + ldr r4, =0x0203ab34 + ldr r0, [r4] + ldrh r0, [r0, 0xC] + bl SetCoins + bl GetCoins + lsls r0, 16 + lsrs r0, 16 + bl sub_80EDD78 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, [r4] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812B2EC + + thumb_func_start sub_812B32C +sub_812B32C: @ 812B32C + push {r4-r6,lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _0812B340 + b _0812B470 +_0812B340: + ldr r6, =0x0203ab34 + ldr r0, [r6] + ldr r0, [r0, 0x64] + bl SetMainCallback2 + ldr r4, =0x0203aaf4 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203aaf8 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203aafc + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ab00 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ab04 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ab08 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ab0c + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ab10 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ab14 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ab18 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ab1c + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ab20 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ab24 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ab28 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203aae4 + ldr r0, [r4] + cmp r0, 0 + beq _0812B3E4 + bl Free + str r5, [r4] +_0812B3E4: + ldr r4, =0x0203aae8 + ldr r0, [r4] + cmp r0, 0 + beq _0812B3F2 + bl Free + str r5, [r4] +_0812B3F2: + ldr r4, =0x0203aaec + ldr r0, [r4] + cmp r0, 0 + beq _0812B400 + bl Free + str r5, [r4] +_0812B400: + ldr r4, =0x0203aaf0 + ldr r0, [r4] + cmp r0, 0 + beq _0812B40E + bl Free + str r5, [r4] +_0812B40E: + ldr r4, =0x0203aac8 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203aacc + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203aad0 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203aad4 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203aad8 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203aadc + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203aae0 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ab2c + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r4, =0x0203ab30 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r0, [r6] + bl Free + str r5, [r6] +_0812B470: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812B32C + + thumb_func_start sub_812B4EC +sub_812B4EC: @ 812B4EC + push {r4,lr} + ldr r4, =0x0203ab34 + ldr r1, [r4] + ldrb r0, [r1, 0xA] + cmp r0, 0 + bne _0812B54A + ldrb r1, [r1, 0x4] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0 + bne _0812B54A + bl sub_812B5B0 + lsls r0, 24 + cmp r0, 0 + beq _0812B52C + bl sub_812B5EC + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3 + beq _0812B52C + ldr r2, [r4] + ldr r1, =gUnknown_085A77FE + lsls r0, r3, 1 + adds r0, r1 + ldrb r1, [r0] + ldrb r0, [r2, 0x4] + orrs r0, r1 + strb r0, [r2, 0x4] + cmp r3, 0x1 + bne _0812B54A +_0812B52C: + bl sub_812B634 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x5 + beq _0812B54A + ldr r0, =0x0203ab34 + ldr r2, [r0] + ldr r1, =gUnknown_085A7804 + lsls r0, r3, 1 + adds r0, r1 + ldrb r1, [r0] + ldrb r0, [r2, 0x4] + orrs r0, r1 + strb r0, [r2, 0x4] +_0812B54A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812B4EC + + thumb_func_start sub_812B55C +sub_812B55C: @ 812B55C + push {lr} + ldr r2, =0x0203ab34 + ldr r1, [r2] + movs r0, 0 + strb r0, [r1, 0x6] + ldr r2, [r2] + ldrb r0, [r2, 0x4] + cmp r0, 0 + beq _0812B572 + movs r0, 0x1 + strb r0, [r2, 0x6] +_0812B572: + pop {r0} + bx r0 + .pool + thumb_func_end sub_812B55C + + thumb_func_start sub_812B57C +sub_812B57C: @ 812B57C + push {r4,lr} + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0 + movs r3, 0x1 + ldr r4, =gUnknown_085A77F6 +_0812B588: + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + beq _0812B59C + adds r0, r2, r4 + ldrb r0, [r0] + b _0812B5AA + .pool +_0812B59C: + lsrs r1, 1 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x7 + bls _0812B588 + movs r0, 0 +_0812B5AA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_812B57C + + thumb_func_start sub_812B5B0 +sub_812B5B0: @ 812B5B0 + push {r4,lr} + bl GenerateRandomNumber + lsls r0, 24 + lsrs r0, 24 + ldr r4, =gUnknown_085A76C0 + ldr r1, =0x0203ab34 + ldr r1, [r1] + movs r3, 0x12 + ldrsh r2, [r1, r3] + ldrb r3, [r1, 0x1] + lsls r1, r3, 1 + adds r1, r3 + subs r1, 0x1 + adds r2, r1 + adds r2, r4 + ldrb r1, [r2] + cmp r1, r0 + bhi _0812B5E4 + movs r0, 0 + b _0812B5E6 + .pool +_0812B5E4: + movs r0, 0x1 +_0812B5E6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_812B5B0 + + thumb_func_start sub_812B5EC +sub_812B5EC: @ 812B5EC + push {r4-r6,lr} + movs r5, 0 + ldr r6, =gUnknown_085A76D2 +_0812B5F2: + bl GenerateRandomNumber + movs r2, 0xFF + ldr r1, =0x0203ab34 + ldr r3, [r1] + lsls r1, r5, 16 + asrs r4, r1, 16 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 1 + ldrb r3, [r3, 0x1] + adds r1, r3 + adds r1, r6 + ldrb r1, [r1] + ands r2, r0 + cmp r1, r2 + bgt _0812B620 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _0812B5F2 +_0812B620: + lsls r0, r5, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812B5EC + + thumb_func_start sub_812B634 +sub_812B634: @ 812B634 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r6, 0 + ldr r0, =gUnknown_085A76E4 + mov r8, r0 + movs r7, 0x80 + lsls r7, 17 +_0812B644: + bl GenerateRandomNumber + movs r5, 0xFF + ands r5, r0 + ldr r0, =0x0203ab34 + ldr r4, [r0] + lsls r2, r6, 16 + asrs r1, r2, 16 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + ldrb r3, [r4, 0x1] + adds r0, r3 + add r0, r8 + ldrb r3, [r0] + cmp r1, 0 + bne _0812B680 + ldrb r0, [r4, 0x3] + cmp r0, 0x1 + bne _0812B680 + adds r3, 0xA + asrs r0, r7, 16 + cmp r3, r0 + ble _0812B69E + adds r3, r0, 0 + b _0812B69E + .pool +_0812B680: + asrs r0, r2, 16 + cmp r0, 0x4 + bne _0812B69E + ldr r0, =0x0203ab34 + ldr r0, [r0] + ldrb r0, [r0, 0x3] + cmp r0, 0x1 + bne _0812B69E + lsls r0, r3, 16 + ldr r1, =0xfff60000 + adds r0, r1 + lsrs r3, r0, 16 + cmp r0, 0 + bge _0812B69E + movs r3, 0 +_0812B69E: + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, r5 + bgt _0812B6B4 + movs r3, 0x80 + lsls r3, 9 + adds r0, r2, r3 + lsrs r6, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812B644 +_0812B6B4: + lsls r0, r6, 24 + lsrs r0, 24 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812B634 + + thumb_func_start sub_812B6CC +sub_812B6CC: @ 812B6CC + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, =0x0203ab34 + ldr r2, [r0] + ldrb r0, [r2, 0x3] + cmp r0, 0 + beq _0812B6E8 + ldr r0, =gUnknown_085A7768 + b _0812B6EA + .pool +_0812B6E8: + ldr r0, =gUnknown_085A7702 +_0812B6EA: + lsls r1, r3, 4 + adds r1, r3 + ldrb r2, [r2, 0x2] + adds r1, r2 + adds r1, r0 + ldrb r0, [r1] + pop {r1} + bx r1 + .pool + thumb_func_end sub_812B6CC + + thumb_func_start sub_812B700 +sub_812B700: @ 812B700 + push {r4-r6,lr} + ldr r0, =0x0203ab34 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x5] + bl GenerateRandomNumber + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0 + bl sub_812B6CC + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcc _0812B754 + movs r6, 0x5 + b _0812B72E + .pool +_0812B728: + subs r0, r5, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_0812B72E: + lsls r0, r6, 16 + asrs r5, r0, 16 + cmp r5, 0 + ble _0812B74E + bl GenerateRandomNumber + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r6, 24 + lsrs r0, 24 + bl sub_812B6CC + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcs _0812B728 +_0812B74E: + ldr r0, =0x0203ab34 + ldr r0, [r0] + strb r6, [r0, 0x5] +_0812B754: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812B700 + + thumb_func_start sub_812B760 +sub_812B760: @ 812B760 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl GenerateRandomNumber + movs r1, 0xFF + ands r1, r0 + ldr r0, =gUnknown_085A77CE + lsls r4, 1 + adds r4, r0 + ldrh r4, [r4] + cmp r1, r4 + bcc _0812B784 + movs r0, 0 + b _0812B786 + .pool +_0812B784: + movs r0, 0x1 +_0812B786: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_812B760 + + thumb_func_start dp15_jump_random_unknown +dp15_jump_random_unknown: @ 812B78C + push {r4,r5,lr} + movs r4, 0 + ldr r0, =0x0203ab34 + ldr r0, [r0] + movs r2, 0x10 + ldrsh r1, [r0, r2] + ldr r0, =0x0000012b + cmp r1, r0 + ble _0812B7AC + movs r4, 0x4 + b _0812B7C2 + .pool +_0812B7AC: + cmp r1, 0xF9 + ble _0812B7B4 + movs r4, 0x3 + b _0812B7C2 +_0812B7B4: + cmp r1, 0xC7 + ble _0812B7BC + movs r4, 0x2 + b _0812B7C2 +_0812B7BC: + cmp r1, 0x95 + ble _0812B7C2 + movs r4, 0x1 +_0812B7C2: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 24 + lsrs r1, r0, 24 + ldr r5, =gUnknown_085A77D8 + lsls r4, 2 + adds r0, r4, r5 + ldrb r0, [r0] + cmp r1, r0 + bcs _0812B7E8 + movs r0, 0x4 + b _0812B822 + .pool +_0812B7E8: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 24 + adds r2, r5, 0x2 + adds r2, r4, r2 + ldr r3, =gUnknown_085A77EC + ldr r1, =0x0203ab34 + ldr r1, [r1] + ldrb r1, [r1, 0xB] + lsls r1, 1 + adds r1, r3 + ldrb r1, [r1] + ldrb r2, [r2] + adds r1, r2 + lsls r1, 24 + cmp r0, r1 + bcc _0812B820 + movs r0, 0x8 + b _0812B822 + .pool +_0812B820: + movs r0, 0x2 +_0812B822: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end dp15_jump_random_unknown + + thumb_func_start sub_812B828 +sub_812B828: @ 812B828 + push {r4,lr} + ldr r4, =0x0203ab34 + ldr r1, [r4] + movs r0, 0 + strh r0, [r1, 0x8] + bl sub_812B85C + ldr r0, [r4] + movs r1, 0x12 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + ble _0812B844 + bl sub_812B8D0 +_0812B844: + ldr r0, [r4] + movs r1, 0x12 + ldrsh r0, [r0, r1] + cmp r0, 0x2 + ble _0812B852 + bl sub_812B9A0 +_0812B852: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812B828 + + thumb_func_start sub_812B85C +sub_812B85C: @ 812B85C + push {r4,r5,lr} + movs r0, 0 + movs r1, 0x2 + bl sub_812BC44 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x1 + movs r1, 0x2 + bl sub_812BC44 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x2 + movs r1, 0x2 + bl sub_812BC44 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_812BA6C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x9 + beq _0812B8BC + ldr r0, =0x0203ab34 + ldr r2, [r0] + ldr r0, =gUnknown_085A7828 + lsls r1, 1 + adds r0, r1, r0 + ldrh r0, [r0] + ldrh r3, [r2, 0xE] + adds r0, r3 + strh r0, [r2, 0xE] + ldr r0, =gUnknown_085A7816 + adds r1, r0 + ldrh r0, [r2, 0x8] + ldrh r1, [r1] + orrs r0, r1 + strh r0, [r2, 0x8] + movs r0, 0 + bl sub_812CF34 +_0812B8BC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812B85C + + thumb_func_start sub_812B8D0 +sub_812B8D0: @ 812B8D0 + push {r4,r5,lr} + movs r0, 0 + movs r1, 0x1 + bl sub_812BC44 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x1 + movs r1, 0x1 + bl sub_812BC44 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x2 + movs r1, 0x1 + bl sub_812BC44 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_812BA6C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x9 + beq _0812B930 + cmp r1, 0 + bne _0812B90C + movs r1, 0x1 +_0812B90C: + ldr r0, =0x0203ab34 + ldr r2, [r0] + ldr r0, =gUnknown_085A7828 + lsls r1, 1 + adds r0, r1, r0 + ldrh r0, [r0] + ldrh r3, [r2, 0xE] + adds r0, r3 + strh r0, [r2, 0xE] + ldr r0, =gUnknown_085A7816 + adds r1, r0 + ldrh r0, [r2, 0x8] + ldrh r1, [r1] + orrs r0, r1 + strh r0, [r2, 0x8] + movs r0, 0x1 + bl sub_812CF34 +_0812B930: + movs r0, 0 + movs r1, 0x3 + bl sub_812BC44 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x1 + movs r1, 0x3 + bl sub_812BC44 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x2 + movs r1, 0x3 + bl sub_812BC44 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_812BA6C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x9 + beq _0812B98E + cmp r1, 0 + bne _0812B96A + movs r1, 0x1 +_0812B96A: + ldr r0, =0x0203ab34 + ldr r2, [r0] + ldr r0, =gUnknown_085A7828 + lsls r1, 1 + adds r0, r1, r0 + ldrh r0, [r0] + ldrh r3, [r2, 0xE] + adds r0, r3 + strh r0, [r2, 0xE] + ldr r0, =gUnknown_085A7816 + adds r1, r0 + ldrh r0, [r2, 0x8] + ldrh r1, [r1] + orrs r0, r1 + strh r0, [r2, 0x8] + movs r0, 0x2 + bl sub_812CF34 +_0812B98E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812B8D0 + + thumb_func_start sub_812B9A0 +sub_812B9A0: @ 812B9A0 + push {r4,r5,lr} + movs r0, 0 + movs r1, 0x1 + bl sub_812BC44 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x1 + movs r1, 0x2 + bl sub_812BC44 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x2 + movs r1, 0x3 + bl sub_812BC44 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_812BA6C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x9 + beq _0812B9FE + cmp r1, 0 + beq _0812B9F8 + ldr r0, =0x0203ab34 + ldr r2, [r0] + ldr r0, =gUnknown_085A7828 + lsls r1, 1 + adds r0, r1, r0 + ldrh r0, [r0] + ldrh r3, [r2, 0xE] + adds r0, r3 + strh r0, [r2, 0xE] + ldr r0, =gUnknown_085A7816 + adds r1, r0 + ldrh r0, [r2, 0x8] + ldrh r1, [r1] + orrs r0, r1 + strh r0, [r2, 0x8] +_0812B9F8: + movs r0, 0x3 + bl sub_812CF34 +_0812B9FE: + movs r0, 0 + movs r1, 0x3 + bl sub_812BC44 + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x1 + movs r1, 0x2 + bl sub_812BC44 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x2 + movs r1, 0x1 + bl sub_812BC44 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_812BA6C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x9 + beq _0812BA5A + cmp r1, 0 + beq _0812BA54 + ldr r0, =0x0203ab34 + ldr r2, [r0] + ldr r0, =gUnknown_085A7828 + lsls r1, 1 + adds r0, r1, r0 + ldrh r0, [r0] + ldrh r3, [r2, 0xE] + adds r0, r3 + strh r0, [r2, 0xE] + ldr r0, =gUnknown_085A7816 + adds r1, r0 + ldrh r0, [r2, 0x8] + ldrh r1, [r1] + orrs r0, r1 + strh r0, [r2, 0x8] +_0812BA54: + movs r0, 0x4 + bl sub_812CF34 +_0812BA5A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812B9A0 + + thumb_func_start sub_812BA6C +sub_812BA6C: @ 812BA6C + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + cmp r3, r1 + bne _0812BA90 + cmp r3, r2 + bne _0812BA90 + ldr r0, =gUnknown_085A780E + adds r0, r3, r0 + ldrb r0, [r0] + b _0812BAB6 + .pool +_0812BA90: + cmp r3, 0 + bne _0812BA9C + cmp r1, 0 + bne _0812BA9C + cmp r2, 0x1 + beq _0812BAA8 +_0812BA9C: + cmp r3, 0x1 + bne _0812BAAC + cmp r1, 0x1 + bne _0812BAAC + cmp r2, 0 + bne _0812BAAC +_0812BAA8: + movs r0, 0x6 + b _0812BAB6 +_0812BAAC: + cmp r3, 0x4 + beq _0812BAB4 + movs r0, 0x9 + b _0812BAB6 +_0812BAB4: + movs r0, 0 +_0812BAB6: + pop {r1} + bx r1 + thumb_func_end sub_812BA6C + + thumb_func_start sub_812BABC +sub_812BABC: @ 812BABC + push {r4,lr} + ldr r4, =sub_812BAFC + adds r0, r4, 0 + movs r1, 0x4 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812BABC + + thumb_func_start sub_812BADC +sub_812BADC: @ 812BADC + push {lr} + ldr r0, =sub_812BAFC + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _0812BAF4 + movs r0, 0 + b _0812BAF6 + .pool +_0812BAF4: + movs r0, 0x1 +_0812BAF6: + pop {r1} + bx r1 + thumb_func_end sub_812BADC + + thumb_func_start sub_812BAFC +sub_812BAFC: @ 812BAFC + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085A74C4 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0812BB0E: + 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 _0812BB0E + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812BAFC + + thumb_func_start sub_812BB34 +sub_812BB34: @ 812BB34 + push {r4,lr} + adds r4, r0, 0 + bl sub_812CF6C + lsls r0, 24 + cmp r0, 0 + beq _0812BB60 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldr r0, =0x0203ab34 + ldr r0, [r0] + movs r1, 0xE + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0812BB60 + movs r0, 0x2 + strh r0, [r4, 0x8] + movs r0, 0x1 + b _0812BB62 + .pool +_0812BB60: + movs r0, 0 +_0812BB62: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_812BB34 + + thumb_func_start sub_812BB68 +sub_812BB68: @ 812BB68 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0812BBBC + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + beq _0812BB8E + movs r0, 0x15 + bl audio_play +_0812BB8E: + ldr r0, =0x0203ab34 + ldr r2, [r0] + ldrh r0, [r2, 0xE] + subs r0, 0x1 + strh r0, [r2, 0xE] + ldrh r3, [r2, 0xC] + movs r0, 0xC + ldrsh r1, [r2, r0] + ldr r0, =0x0000270e + cmp r1, r0 + bgt _0812BBA8 + adds r0, r3, 0x1 + strh r0, [r2, 0xC] +_0812BBA8: + movs r0, 0x8 + strh r0, [r4, 0xA] + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2C] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0812BBBC + movs r0, 0x4 + strh r0, [r4, 0xA] +_0812BBBC: + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + beq _0812BBF6 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0812BBF6 + movs r0, 0x15 + bl audio_play + ldr r1, =0x0203ab34 + ldr r2, [r1] + ldrh r0, [r2, 0xE] + ldrh r3, [r2, 0xC] + adds r0, r3 + strh r0, [r2, 0xC] + lsls r0, 16 + asrs r0, 16 + ldr r3, =0x0000270f + cmp r0, r3 + ble _0812BBF0 + strh r3, [r2, 0xC] +_0812BBF0: + ldr r1, [r1] + movs r0, 0 + strh r0, [r1, 0xE] +_0812BBF6: + ldr r0, =0x0203ab34 + ldr r0, [r0] + movs r1, 0xE + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0812BC08 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0812BC08: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812BB68 + + thumb_func_start sub_812BC20 +sub_812BC20: @ 812BC20 + push {lr} + bl sub_812CFB8 + lsls r0, 24 + cmp r0, 0 + beq _0812BC3A + ldr r0, =sub_812BAFC + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_0812BC3A: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_812BC20 + + thumb_func_start sub_812BC44 +sub_812BC44: @ 812BC44 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + ldr r0, =0x0203ab34 + ldr r0, [r0] + lsls r2, r4, 1 + adds r0, 0x28 + adds r0, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + lsls r1, 16 + asrs r1, 16 + adds r0, r1 + movs r1, 0x15 + bl __modsi3 + lsls r0, 16 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0812BC76 + adds r0, 0x15 + lsls r0, 16 + lsrs r1, r0, 16 +_0812BC76: + ldr r2, =gUnknown_085A766E + lsls r1, 16 + asrs r1, 16 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 2 + adds r0, r4 + adds r1, r0 + adds r1, r2 + ldrb r0, [r1] + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812BC44 + + thumb_func_start sub_812BC98 +sub_812BC98: @ 812BC98 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + lsls r1, 16 + lsrs r5, r1, 16 + movs r6, 0 + ldr r0, =0x0203ab34 + ldr r0, [r0] + lsls r1, r4, 1 + adds r0, 0x1C + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0x18 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + beq _0812BCC2 + ldr r6, =0x0000ffff +_0812BCC2: + lsls r1, r5, 16 + asrs r1, 16 + lsls r0, r6, 16 + asrs r0, 16 + adds r1, r0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_812BC44 + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812BC98 + + thumb_func_start sub_812BCE8 +sub_812BCE8: @ 812BCE8 + push {lr} + ldr r1, =0x0203ab34 + ldr r1, [r1] + movs r2, 0x16 + ldrsh r1, [r1, r2] + lsls r0, 16 + asrs r0, 16 + adds r1, r0 + adds r0, r1, 0 + movs r1, 0x6 + bl __modsi3 + lsls r0, 16 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0812BD10 + adds r0, 0x6 + lsls r0, 16 + lsrs r1, r0, 16 +_0812BD10: + ldr r0, =gUnknown_085A76AD + lsls r1, 16 + asrs r1, 16 + adds r1, r0 + ldrb r0, [r1] + pop {r1} + bx r1 + .pool + thumb_func_end sub_812BCE8 + + thumb_func_start sub_812BD28 +sub_812BD28: @ 812BD28 + push {r4-r6,lr} + adds r5, r0, 0 + lsls r5, 24 + ldr r0, =0x0203ab34 + ldr r6, [r0] + lsrs r5, 23 + adds r4, r6, 0 + adds r4, 0x1C + adds r4, r5 + lsls r1, 16 + asrs r1, 16 + ldrh r0, [r4] + adds r1, r0 + strh r1, [r4] + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0xFC + lsls r1, 1 + bl __modsi3 + strh r0, [r4] + adds r6, 0x28 + adds r6, r5 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0x18 + bl __divsi3 + movs r1, 0x15 + subs r1, r0 + strh r1, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812BD28 + + thumb_func_start sub_812BD70 +sub_812BD70: @ 812BD70 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + ldr r7, =0x0203ab34 + ldr r0, [r7] + lsls r6, r5, 1 + adds r0, 0x1C + adds r0, r6 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0x18 + bl __modsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r2, r0, 16 + asrs r1, r2, 16 + cmp r1, 0 + beq _0812BDC4 + lsls r0, r4, 16 + asrs r0, 16 + cmp r1, r0 + bge _0812BDA6 + lsrs r4, r2, 16 +_0812BDA6: + lsls r1, r4, 16 + asrs r1, 16 + adds r0, r5, 0 + bl sub_812BD28 + ldr r0, [r7] + adds r0, 0x1C + adds r0, r6 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0x18 + bl __modsi3 + lsls r0, 16 + lsrs r0, 16 +_0812BDC4: + lsls r0, 16 + asrs r0, 16 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812BD70 + + thumb_func_start sub_812BDD4 +sub_812BDD4: @ 812BDD4 + push {r4,lr} + ldr r1, =0x0203ab34 + ldr r4, [r1] + lsls r0, 16 + asrs r0, 16 + ldrh r1, [r4, 0x14] + adds r0, r1 + strh r0, [r4, 0x14] + movs r1, 0x14 + ldrsh r0, [r4, r1] + movs r1, 0x78 + bl __modsi3 + strh r0, [r4, 0x14] + movs r1, 0x14 + ldrsh r0, [r4, r1] + movs r1, 0x14 + bl __divsi3 + movs r1, 0x6 + subs r1, r0 + strh r1, [r4, 0x16] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812BDD4 + + thumb_func_start sub_812BE0C +sub_812BE0C: @ 812BE0C + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + ldr r5, =0x0203ab34 + ldr r0, [r5] + movs r1, 0x14 + ldrsh r0, [r0, r1] + movs r1, 0x14 + bl __modsi3 + lsls r0, 16 + lsrs r0, 16 + lsls r2, r0, 16 + asrs r1, r2, 16 + cmp r1, 0 + beq _0812BE4E + lsls r0, r4, 16 + asrs r0, 16 + cmp r1, r0 + bge _0812BE36 + lsrs r4, r2, 16 +_0812BE36: + lsls r0, r4, 16 + asrs r0, 16 + bl sub_812BDD4 + ldr r0, [r5] + movs r1, 0x14 + ldrsh r0, [r0, r1] + movs r1, 0x14 + bl __modsi3 + lsls r0, 16 + lsrs r0, 16 +_0812BE4E: + lsls r0, 16 + asrs r0, 16 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812BE0C + + thumb_func_start sub_812BE5C +sub_812BE5C: @ 812BE5C + push {r4-r6,lr} + movs r4, 0 + ldr r5, =sub_812BF2C + ldr r6, =0x03005e00 +_0812BE64: + adds r0, r5, 0 + movs r1, 0x2 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r6 + strh r4, [r1, 0x26] + ldr r1, =0x0203ab34 + ldr r1, [r1] + adds r1, 0x3A + adds r1, r4 + strb r0, [r1] + bl _call_via_r5 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _0812BE64 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812BE5C + + thumb_func_start sub_812BEA4 +sub_812BEA4: @ 812BEA4 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x03005e00 + ldr r1, =0x0203ab34 + ldr r2, [r1] + adds r2, 0x3A + adds r2, r0 + ldrb r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + movs r3, 0x1 + strh r3, [r0, 0x8] + ldrb r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r4 + strh r3, [r0, 0x24] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812BEA4 + + thumb_func_start sub_812BEDC +sub_812BEDC: @ 812BEDC + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + ldr r1, =0x0203ab34 + ldr r1, [r1] + adds r1, 0x3A + adds r1, r0 + ldrb r1, [r1] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x2 + strh r1, [r0, 0x8] + bx lr + .pool + thumb_func_end sub_812BEDC + + thumb_func_start sub_812BF04 +sub_812BF04: @ 812BF04 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + ldr r1, =0x0203ab34 + ldr r1, [r1] + adds r1, 0x3A + adds r1, r0 + ldrb r1, [r1] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r0, [r0, 0x24] + lsls r0, 24 + lsrs r0, 24 + bx lr + .pool + thumb_func_end sub_812BF04 + + thumb_func_start sub_812BF2C +sub_812BF2C: @ 812BF2C + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_085A74D0 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_0812BF3E: + 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 _0812BF3E + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812BF2C + + thumb_func_start sub_812BF64 +sub_812BF64: @ 812BF64 + movs r0, 0 + bx lr + thumb_func_end sub_812BF64 + + thumb_func_start sub_812BF68 +sub_812BF68: @ 812BF68 + push {lr} + ldrh r0, [r0, 0x26] + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0203ab34 + ldr r1, [r1] + movs r2, 0x1A + ldrsh r1, [r1, r2] + bl sub_812BD28 + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_812BF68 + + thumb_func_start sub_812BF88 +sub_812BF88: @ 812BF88 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + movs r2, 0 + strh r0, [r4, 0x8] + ldr r0, =0x0203ab34 + ldr r3, [r0] + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r1, 1 + adds r0, r3, 0 + adds r0, 0x34 + adds r0, r1 + strh r2, [r0] + movs r0, 0x26 + ldrsh r1, [r4, r0] + lsls r1, 1 + adds r0, r3, 0 + adds r0, 0x2E + adds r0, r1 + strh r2, [r0] + ldrb r0, [r3, 0xA] + cmp r0, 0 + bne _0812BFF4 + ldrb r0, [r3, 0x4] + cmp r0, 0 + beq _0812BFDC + ldrb r0, [r3, 0x6] + cmp r0, 0 + beq _0812BFDC + ldr r1, =gUnknown_085A74E4 + movs r2, 0x26 + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + lsls r0, 24 + cmp r0, 0 + bne _0812BFF4 +_0812BFDC: + ldr r0, =0x0203ab34 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x6] + ldr r1, =gUnknown_085A74F0 + movs r2, 0x26 + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 +_0812BFF4: + ldr r0, =0x0203ab34 + ldr r1, [r0] + movs r2, 0x26 + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r1, 0x2E + adds r1, r0 + ldrh r0, [r1] + strh r0, [r4, 0xA] + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812BF88 + + thumb_func_start sub_812C01C +sub_812C01C: @ 812C01C + push {r4-r7,lr} + sub sp, 0xC + adds r4, r0, 0 + ldr r1, =gUnknown_085A74FC + mov r0, sp + movs r2, 0xA + bl memcpy + ldr r7, =0x0203ab34 + ldr r5, [r7] + movs r1, 0x26 + ldrsh r0, [r4, r1] + lsls r6, r0, 1 + adds r0, r5, 0 + adds r0, 0x1C + adds r0, r6 + movs r2, 0 + ldrsh r0, [r0, r2] + movs r1, 0x18 + bl __modsi3 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r0, 0 + beq _0812C068 + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r6, 0x1A + ldrsh r1, [r5, r6] + bl sub_812BD70 + b _0812C0A0 + .pool +_0812C068: + adds r0, r5, 0 + adds r0, 0x2E + adds r1, r0, r6 + ldrh r3, [r1] + movs r6, 0 + ldrsh r0, [r1, r6] + cmp r0, 0 + beq _0812C0A4 + subs r0, r3, 0x1 + strh r0, [r1] + ldrh r0, [r4, 0x26] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x1A + ldrsh r1, [r5, r2] + bl sub_812BD28 + ldr r1, [r7] + movs r6, 0x26 + ldrsh r0, [r4, r6] + lsls r0, 1 + adds r1, 0x1C + adds r1, r0 + movs r2, 0 + ldrsh r0, [r1, r2] + movs r1, 0x18 + bl __modsi3 +_0812C0A0: + lsls r0, 16 + lsrs r2, r0, 16 +_0812C0A4: + cmp r2, 0 + bne _0812C0D2 + ldr r0, =0x0203ab34 + ldr r1, [r0] + movs r6, 0x26 + ldrsh r0, [r4, r6] + lsls r0, 1 + adds r1, 0x2E + adds r1, r0 + movs r0, 0 + ldrsh r1, [r1, r0] + cmp r1, 0 + bne _0812C0D2 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r2, 0xA + ldrsh r0, [r4, r2] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + strh r0, [r4, 0xA] + strh r1, [r4, 0xC] +_0812C0D2: + movs r0, 0 + add sp, 0xC + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812C01C + + thumb_func_start sub_812C0E0 +sub_812C0E0: @ 812C0E0 + push {r4,lr} + adds r2, r0, 0 + ldr r4, =0x0203ab34 + ldr r1, [r4] + movs r3, 0x26 + ldrsh r0, [r2, r3] + lsls r0, 1 + adds r1, 0x22 + adds r1, r0 + ldrh r0, [r2, 0xA] + strh r0, [r1] + ldrh r0, [r2, 0xA] + negs r3, r0 + strh r3, [r2, 0xA] + ldrh r0, [r2, 0xC] + adds r0, 0x1 + strh r0, [r2, 0xC] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0812C110 + lsls r0, r3, 16 + asrs r0, 17 + strh r0, [r2, 0xA] +_0812C110: + movs r0, 0xA + ldrsh r3, [r2, r0] + cmp r3, 0 + bne _0812C12A + strh r3, [r2, 0x8] + strh r3, [r2, 0x24] + ldr r1, [r4] + movs r4, 0x26 + ldrsh r0, [r2, r4] + lsls r0, 1 + adds r1, 0x22 + adds r1, r0 + strh r3, [r1] +_0812C12A: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812C0E0 + + thumb_func_start sub_812C138 +sub_812C138: @ 812C138 + push {r4,r5,lr} + ldr r4, =0x0203ab34 + ldr r0, [r4] + ldrb r0, [r0, 0x4] + bl sub_812B57C + lsls r0, 24 + lsrs r3, r0, 24 + adds r5, r3, 0 + ldr r4, [r4] + ldrb r1, [r4, 0x4] + movs r0, 0xC0 + ands r0, r1 + cmp r0, 0 + beq _0812C15A + movs r5, 0 + movs r3, 0x1 +_0812C15A: + ldr r1, =gUnknown_085A7508 + movs r2, 0x12 + ldrsh r0, [r4, r2] + subs r0, 0x1 + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r3, 0 + bl _call_via_r2 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812C138 + + thumb_func_start sub_812C184 +sub_812C184: @ 812C184 + push {r4,r5,lr} + adds r3, r0, 0 + adds r4, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r2, 24 + lsrs r5, r2, 24 + lsls r3, 16 + asrs r3, 16 + movs r0, 0 + adds r1, r3, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, r4 + beq _0812C1AC + cmp r0, r5 + bne _0812C1BC +_0812C1AC: + ldr r0, =0x0203ab34 + ldr r0, [r0] + strb r1, [r0, 0x7] + movs r0, 0x1 + b _0812C1BE + .pool +_0812C1BC: + movs r0, 0 +_0812C1BE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_812C184 + + thumb_func_start sub_812C1C4 +sub_812C1C4: @ 812C1C4 + push {r4,lr} + movs r1, 0x1 + lsls r0, 16 + asrs r4, r0, 16 + subs r1, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + beq _0812C20C + movs r1, 0x2 + subs r1, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + beq _0812C20C + movs r1, 0x3 + subs r1, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _0812C210 +_0812C20C: + movs r0, 0x1 + b _0812C212 +_0812C210: + movs r0, 0 +_0812C212: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_812C1C4 + + thumb_func_start sub_812C218 +sub_812C218: @ 812C218 + push {lr} + ldr r0, =0x0203ab34 + ldr r0, [r0] + ldrb r1, [r0, 0x4] + movs r0, 0xC2 + ands r0, r1 + cmp r0, 0 + bne _0812C230 + movs r0, 0 + b _0812C232 + .pool +_0812C230: + movs r0, 0x1 +_0812C232: + pop {r1} + bx r1 + thumb_func_end sub_812C218 + + thumb_func_start sub_812C238 +sub_812C238: @ 812C238 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + movs r5, 0 + movs r0, 0x2 + mov r8, r0 +_0812C24C: + lsls r0, r5, 16 + asrs r4, r0, 16 + mov r1, r8 + subs r0, r1, r4 + lsls r0, 16 + asrs r0, 16 + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_812C184 + lsls r0, 24 + cmp r0, 0 + beq _0812C278 + ldr r0, =0x0203ab34 + ldr r1, [r0] + movs r0, 0x2 + strh r0, [r1, 0x34] + strh r5, [r1, 0x2E] + movs r0, 0x1 + b _0812C286 + .pool +_0812C278: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812C24C + movs r0, 0 +_0812C286: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_812C238 + + thumb_func_start sub_812C290 +sub_812C290: @ 812C290 + 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 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + bl sub_812C218 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0812C2BE + movs r0, 0 + bl sub_812C1C4 + lsls r0, 24 + cmp r0, 0 + bne _0812C2F4 +_0812C2BE: + movs r7, 0x1 + movs r6, 0 +_0812C2C2: + lsls r0, r7, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + mov r1, r9 + mov r2, r8 + bl sub_812C184 + lsls r0, 24 + cmp r0, 0 + beq _0812C2E8 + ldr r0, =0x0203ab34 + ldr r0, [r0] + strh r7, [r0, 0x34] + strh r6, [r0, 0x2E] + movs r0, 0x1 + b _0812C390 + .pool +_0812C2E8: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _0812C2C2 +_0812C2F4: + movs r7, 0x1 + adds r6, r5, 0 + ldr r0, =0x0203ab34 + mov r10, r0 +_0812C2FC: + lsls r5, r7, 16 + cmp r6, 0 + bne _0812C30E + asrs r0, r5, 16 + bl sub_812C1C4 + lsls r0, 24 + cmp r0, 0 + bne _0812C380 +_0812C30E: + movs r0, 0x1 + asrs r4, r5, 16 + subs r0, r4 + lsls r0, 16 + asrs r0, 16 + mov r1, r9 + mov r2, r8 + bl sub_812C184 + lsls r0, 24 + cmp r0, 0 + beq _0812C380 + cmp r4, 0x1 + bne _0812C34C + cmp r6, 0 + bne _0812C33A + movs r0, 0x3 + bl sub_812C1C4 + lsls r0, 24 + cmp r0, 0 + bne _0812C34C +_0812C33A: + mov r0, r10 + ldr r1, [r0] + movs r0, 0x3 + strh r0, [r1, 0x34] + strh r0, [r1, 0x2E] + movs r0, 0x1 + b _0812C390 + .pool +_0812C34C: + asrs r0, r5, 16 + cmp r0, 0x3 + bgt _0812C374 + adds r4, r0, 0x1 + cmp r6, 0 + bne _0812C366 + lsls r0, r4, 16 + asrs r0, 16 + bl sub_812C1C4 + lsls r0, 24 + cmp r0, 0 + bne _0812C374 +_0812C366: + mov r0, r10 + ldr r1, [r0] + movs r0, 0x2 + strh r0, [r1, 0x34] + strh r4, [r1, 0x2E] + movs r0, 0x1 + b _0812C390 +_0812C374: + mov r0, r10 + ldr r1, [r0] + movs r0, 0x1 + strh r0, [r1, 0x34] + strh r7, [r1, 0x2E] + b _0812C390 +_0812C380: + movs r1, 0x80 + lsls r1, 9 + adds r0, r5, r1 + lsrs r7, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812C2FC + movs r0, 0 +_0812C390: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_812C290 + + thumb_func_start sub_812C3A0 +sub_812C3A0: @ 812C3A0 + push {lr} + ldr r1, =gUnknown_085A7514 + ldr r0, =0x0203ab34 + ldr r0, [r0] + movs r2, 0x12 + ldrsh r0, [r0, r2] + subs r0, 0x1 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end sub_812C3A0 + + thumb_func_start sub_812C3C8 +sub_812C3C8: @ 812C3C8 + push {r4-r7,lr} + ldr r0, =0x0203ab34 + ldr r0, [r0] + movs r5, 0 + ldrh r7, [r0, 0x34] + movs r1, 0x34 + ldrsh r6, [r0, r1] +_0812C3D6: + lsls r0, r5, 16 + asrs r4, r0, 16 + subs r1, r6, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + bl sub_812BC98 + ldr r1, =0x0203ab34 + ldr r1, [r1] + lsls r0, 24 + lsrs r0, 24 + ldrb r2, [r1, 0x7] + cmp r0, r2 + bne _0812C400 + strh r7, [r1, 0x36] + strh r5, [r1, 0x30] + movs r0, 0x1 + b _0812C40E + .pool +_0812C400: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812C3D6 + movs r0, 0 +_0812C40E: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_812C3C8 + + thumb_func_start sub_812C414 +sub_812C414: @ 812C414 + push {r4-r6,lr} + bl sub_812C3C8 + lsls r0, 24 + cmp r0, 0 + beq _0812C476 + ldr r0, =0x0203ab34 + ldr r1, [r0] + movs r2, 0x34 + ldrsh r0, [r1, r2] + cmp r0, 0x2 + beq _0812C472 + movs r2, 0x30 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + ble _0812C472 + cmp r0, 0x4 + beq _0812C472 + movs r5, 0 + movs r6, 0x2 +_0812C43C: + lsls r0, r5, 16 + asrs r4, r0, 16 + subs r1, r6, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + bl sub_812BC98 + ldr r1, =0x0203ab34 + ldr r1, [r1] + lsls r0, 24 + lsrs r0, 24 + ldrb r2, [r1, 0x7] + cmp r0, r2 + beq _0812C46C + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812C43C + b _0812C472 + .pool +_0812C46C: + movs r0, 0x2 + strh r0, [r1, 0x36] + strh r5, [r1, 0x30] +_0812C472: + movs r0, 0x1 + b _0812C4B2 +_0812C476: + ldr r0, =0x0203ab34 + ldr r0, [r0] + movs r1, 0x34 + ldrsh r0, [r0, r1] + cmp r0, 0x2 + beq _0812C4B0 + movs r5, 0 + movs r6, 0x2 +_0812C486: + lsls r0, r5, 16 + asrs r4, r0, 16 + subs r1, r6, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + bl sub_812BC98 + ldr r1, =0x0203ab34 + ldr r1, [r1] + lsls r0, 24 + lsrs r0, 24 + ldrb r2, [r1, 0x7] + cmp r0, r2 + beq _0812C46C + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812C486 +_0812C4B0: + movs r0, 0 +_0812C4B2: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812C414 + + thumb_func_start sub_812C4BC +sub_812C4BC: @ 812C4BC + push {r4,lr} + ldr r2, =0x0203ab34 + ldr r0, [r2] + ldrb r3, [r0, 0x7] + adds r4, r3, 0 + ldrb r1, [r0, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0812C4D8 + movs r3, 0 + cmp r4, 0 + bne _0812C4D8 + movs r3, 0x1 +_0812C4D8: + ldr r1, =gUnknown_085A7520 + ldr r0, [r2] + movs r2, 0x12 + ldrsh r0, [r0, r2] + subs r0, 0x1 + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r3, 0 + bl _call_via_r1 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812C4BC + + thumb_func_start sub_812C500 +sub_812C500: @ 812C500 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x0203ab34 + ldr r0, [r0] + movs r5, 0 + ldrh r1, [r0, 0x36] + mov r8, r1 + movs r1, 0x36 + ldrsh r6, [r0, r1] +_0812C518: + lsls r0, r5, 16 + asrs r4, r0, 16 + subs r1, r6, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x2 + bl sub_812BC98 + lsls r0, 24 + lsrs r0, 24 + cmp r0, r7 + bne _0812C544 + ldr r0, =0x0203ab34 + ldr r0, [r0] + mov r1, r8 + strh r1, [r0, 0x38] + strh r5, [r0, 0x32] + movs r0, 0x1 + b _0812C552 + .pool +_0812C544: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812C518 + movs r0, 0 +_0812C552: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_812C500 + + thumb_func_start sub_812C55C +sub_812C55C: @ 812C55C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x0203ab34 + ldr r0, [r0] + movs r2, 0x34 + ldrsh r1, [r0, r2] + movs r2, 0x36 + ldrsh r0, [r0, r2] + cmp r1, r0 + bne _0812C59C + adds r0, r6, 0 + bl sub_812C500 + lsls r0, 24 + lsrs r0, 24 + b _0812C5D2 + .pool +_0812C588: + ldr r0, =0x0203ab34 + ldr r0, [r0] + strh r5, [r0, 0x32] + mov r1, r8 + strh r1, [r0, 0x38] + movs r0, 0x1 + b _0812C5D2 + .pool +_0812C59C: + movs r2, 0x1 + mov r8, r2 + cmp r1, 0x1 + bne _0812C5A8 + movs r0, 0x3 + mov r8, r0 +_0812C5A8: + movs r5, 0 + mov r7, r8 +_0812C5AC: + lsls r0, r5, 16 + asrs r4, r0, 16 + subs r1, r7, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x2 + bl sub_812BC98 + lsls r0, 24 + lsrs r0, 24 + cmp r0, r6 + beq _0812C588 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812C5AC + movs r0, 0 +_0812C5D2: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_812C55C + + thumb_func_start sub_812C5DC +sub_812C5DC: @ 812C5DC + push {r4,r5,lr} + movs r5, 0 + b _0812C5E8 +_0812C5E2: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_0812C5E8: + lsls r0, r5, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + bl sub_812C1C4 + lsls r0, 24 + cmp r0, 0 + bne _0812C5E2 + ldr r0, =0x0203ab34 + ldr r0, [r0] + strh r5, [r0, 0x2E] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812C5DC + + thumb_func_start sub_812C608 +sub_812C608: @ 812C608 + push {lr} + adds r1, r0, 0 + ldrb r0, [r1] + cmp r0, 0 + bne _0812C616 + movs r0, 0x1 + b _0812C620 +_0812C616: + cmp r0, 0x1 + beq _0812C61E + movs r0, 0 + b _0812C624 +_0812C61E: + movs r0, 0 +_0812C620: + strb r0, [r1] + movs r0, 0x1 +_0812C624: + pop {r1} + bx r1 + thumb_func_end sub_812C608 + + thumb_func_start sub_812C628 +sub_812C628: @ 812C628 + push {lr} + ldr r1, =gUnknown_085A752C + ldr r0, =0x0203ab34 + ldr r0, [r0] + movs r2, 0x12 + ldrsh r0, [r0, r2] + subs r0, 0x1 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_812C628 + + thumb_func_start sub_812C64C +sub_812C64C: @ 812C64C + push {r4-r7,lr} + sub sp, 0x4 + ldr r0, =0x0203ab34 + ldr r2, [r0] + movs r1, 0x34 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0812C6C4 + ldrb r1, [r2, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0812C6C4 + ldrh r0, [r2, 0x2E] + movs r1, 0x2 + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + mov r1, sp + strb r0, [r1] + mov r0, sp + bl sub_812C608 + lsls r0, 24 + cmp r0, 0 + beq _0812C6C4 + movs r5, 0 + mov r6, sp + movs r7, 0x2 +_0812C68C: + lsls r0, r5, 16 + asrs r4, r0, 16 + subs r1, r7, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + bl sub_812BC98 + ldrb r1, [r6] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + bne _0812C6B8 + ldr r0, =0x0203ab34 + ldr r1, [r0] + movs r0, 0x2 + strh r0, [r1, 0x36] + strh r5, [r1, 0x30] + b _0812C6C4 + .pool +_0812C6B8: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812C68C +_0812C6C4: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_812C64C + + thumb_func_start j5_08111E84 +j5_08111E84: @ 812C6CC + push {r4-r7,lr} + sub sp, 0x4 + ldr r4, =0x0203ab34 + ldr r2, [r4] + ldrh r3, [r2, 0x34] + movs r1, 0x34 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0812C744 + ldrb r1, [r2, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0812C744 + ldrh r1, [r2, 0x2E] + subs r1, r3, r1 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + mov r1, sp + strb r0, [r1] + mov r0, sp + bl sub_812C608 + lsls r0, 24 + cmp r0, 0 + beq _0812C744 + movs r5, 0 + mov r7, sp + adds r6, r4, 0 +_0812C70C: + ldr r0, [r6] + ldrh r1, [r0, 0x34] + lsls r0, r5, 16 + asrs r4, r0, 16 + subs r1, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + bl sub_812BC98 + ldrb r1, [r7] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + bne _0812C738 + ldr r0, [r6] + ldrh r1, [r0, 0x34] + strh r1, [r0, 0x36] + strh r5, [r0, 0x30] + b _0812C744 + .pool +_0812C738: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812C70C +_0812C744: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end j5_08111E84 + + thumb_func_start sub_812C74C +sub_812C74C: @ 812C74C + push {r4-r7,lr} + sub sp, 0x4 + ldr r6, =0x0203ab34 + ldr r2, [r6] + ldrh r4, [r2, 0x34] + movs r0, 0x34 + ldrsh r3, [r2, r0] + cmp r3, 0 + beq _0812C84A + ldrb r1, [r2, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0812C84A + cmp r3, 0x2 + bne _0812C796 + bl j5_08111E84 + b _0812C84A + .pool +_0812C778: + ldr r0, =0x0203ab34 + ldr r0, [r0] + movs r1, 0 + strh r5, [r0, 0x36] + strh r1, [r0, 0x30] + b _0812C84A + .pool +_0812C788: + movs r0, 0x2 + strh r0, [r1, 0x36] + adds r0, r4, 0x1 + strh r0, [r1, 0x30] + b _0812C84A +_0812C792: + movs r0, 0x3 + b _0812C824 +_0812C796: + ldrh r1, [r2, 0x2E] + subs r1, r4, r1 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + mov r1, sp + strb r0, [r1] + mov r0, sp + bl sub_812C608 + lsls r0, 24 + cmp r0, 0 + beq _0812C84A + movs r5, 0x2 + ldr r0, [r6] + movs r1, 0x34 + ldrsh r0, [r0, r1] + cmp r0, 0x3 + bne _0812C7C2 + movs r5, 0x3 +_0812C7C2: + movs r6, 0 + mov r7, sp +_0812C7C6: + lsls r0, r5, 16 + asrs r4, r0, 16 + movs r0, 0x1 + adds r1, r4, 0 + bl sub_812BC98 + ldrb r1, [r7] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + beq _0812C778 + lsls r1, r6, 16 + movs r2, 0x80 + lsls r2, 9 + adds r1, r2 + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + lsrs r6, r1, 16 + asrs r1, 16 + cmp r1, 0x1 + ble _0812C7C6 + movs r5, 0x1 + mov r7, sp + ldr r6, =0x0203ab34 +_0812C7F8: + ldr r0, [r6] + ldrh r1, [r0, 0x34] + lsls r0, r5, 16 + asrs r4, r0, 16 + subs r1, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + bl sub_812BC98 + ldrb r1, [r7] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + bne _0812C83E + ldr r1, [r6] + movs r2, 0x34 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _0812C830 + cmp r4, 0x2 + ble _0812C788 +_0812C824: + strh r0, [r1, 0x36] + strh r5, [r1, 0x30] + b _0812C84A + .pool +_0812C830: + cmp r4, 0x2 + ble _0812C792 + movs r0, 0x2 + strh r0, [r1, 0x36] + subs r0, r4, 0x1 + strh r0, [r1, 0x30] + b _0812C84A +_0812C83E: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812C7F8 +_0812C84A: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_812C74C + + thumb_func_start sub_812C854 +sub_812C854: @ 812C854 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + adds r2, r1, 0 + cmp r0, 0 + bne _0812C868 + cmp r1, 0x1 + beq _0812C870 +_0812C868: + cmp r0, 0x1 + bne _0812C874 + cmp r2, 0 + bne _0812C874 +_0812C870: + movs r0, 0x1 + b _0812C876 +_0812C874: + movs r0, 0 +_0812C876: + pop {r1} + bx r1 + thumb_func_end sub_812C854 + + thumb_func_start sub_812C87C +sub_812C87C: @ 812C87C + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + cmp r0, 0 + bne _0812C896 + cmp r1, 0x1 + bne _0812C896 + cmp r2, 0 + beq _0812C8A2 +_0812C896: + cmp r0, 0x1 + bne _0812C8A6 + cmp r1, 0 + bne _0812C8A6 + cmp r2, 0x1 + bne _0812C8A6 +_0812C8A2: + movs r0, 0x1 + b _0812C8A8 +_0812C8A6: + movs r0, 0 +_0812C8A8: + pop {r1} + bx r1 + thumb_func_end sub_812C87C + + thumb_func_start sub_812C8AC +sub_812C8AC: @ 812C8AC + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + cmp r0, 0 + bne _0812C8C6 + cmp r1, 0x1 + bne _0812C8C6 + cmp r2, 0 + beq _0812C8F2 +_0812C8C6: + cmp r0, 0x1 + bne _0812C8D2 + cmp r1, 0 + bne _0812C8D2 + cmp r2, 0x1 + beq _0812C8F2 +_0812C8D2: + cmp r0, 0 + bne _0812C8DE + cmp r1, 0 + bne _0812C8DE + cmp r2, 0x1 + beq _0812C8F2 +_0812C8DE: + cmp r0, 0x1 + bne _0812C8EA + cmp r1, 0x1 + bne _0812C8EA + cmp r2, 0 + beq _0812C8F2 +_0812C8EA: + cmp r0, r1 + bne _0812C8F6 + cmp r0, r2 + bne _0812C8F6 +_0812C8F2: + movs r0, 0 + b _0812C8F8 +_0812C8F6: + movs r0, 0x1 +_0812C8F8: + pop {r1} + bx r1 + thumb_func_end sub_812C8AC + + thumb_func_start sub_812C8FC +sub_812C8FC: @ 812C8FC + push {lr} + ldr r1, =gUnknown_085A7538 + ldr r0, =0x0203ab34 + ldr r0, [r0] + movs r2, 0x12 + ldrsh r0, [r0, r2] + subs r0, 0x1 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_812C8FC + + thumb_func_start sub_812C920 +sub_812C920: @ 812C920 + push {r4-r7,lr} + movs r6, 0 + ldr r7, =0x0203ab34 + ldr r0, [r7] + ldrh r1, [r0, 0x2E] + movs r4, 0x2 + subs r1, r4, r1 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r7] + ldrh r0, [r0, 0x30] + subs r4, r0 + lsls r4, 16 + asrs r4, 16 + movs r0, 0x1 + adds r1, r4, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r5, r1 + bne _0812C994 + movs r4, 0x2 + b _0812C96A + .pool +_0812C960: + lsls r0, r6, 16 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + lsrs r6, r0, 16 +_0812C96A: + lsls r1, r6, 16 + asrs r1, 16 + subs r1, r4, r1 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x2 + bl sub_812BC98 + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + beq _0812C960 + cmp r5, 0 + bne _0812C98A + cmp r0, 0x1 + beq _0812C960 +_0812C98A: + cmp r5, 0x1 + bne _0812C9F6 + cmp r0, 0 + beq _0812C960 + b _0812C9F6 +_0812C994: + adds r0, r5, 0 + bl sub_812C854 + lsls r0, 24 + cmp r0, 0 + beq _0812C9F6 + ldr r0, [r7] + ldrb r1, [r0, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0812C9D2 + movs r7, 0x2 +_0812C9AE: + lsls r0, r6, 16 + asrs r4, r0, 16 + subs r1, r7, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x2 + bl sub_812BC98 + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + beq _0812C9F6 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812C9AE +_0812C9D2: + movs r6, 0 + movs r7, 0x2 + b _0812C9DE +_0812C9D8: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 +_0812C9DE: + lsls r0, r6, 16 + asrs r4, r0, 16 + subs r1, r7, r4 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x2 + bl sub_812BC98 + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + beq _0812C9D8 +_0812C9F6: + ldr r0, =0x0203ab34 + ldr r0, [r0] + strh r6, [r0, 0x32] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812C920 + + thumb_func_start sub_812CA08 +sub_812CA08: @ 812CA08 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + ldr r4, =0x0203ab34 + ldr r2, [r4] + movs r5, 0x36 + ldrsh r1, [r2, r5] + cmp r1, 0 + beq _0812CAA4 + ldrh r3, [r2, 0x34] + movs r5, 0x34 + ldrsh r0, [r2, r5] + cmp r0, r1 + bne _0812CAA4 + ldrb r1, [r2, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0812CAA4 + ldrh r1, [r2, 0x2E] + subs r1, r3, r1 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, [r4] + ldrh r1, [r0, 0x36] + ldrh r0, [r0, 0x30] + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + bl sub_812BC98 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_812C854 + lsls r0, 24 + cmp r0, 0 + beq _0812CAA4 + movs r5, 0 + b _0812CA7E + .pool +_0812CA78: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_0812CA7E: + lsls r6, r5, 16 + asrs r5, r6, 16 + cmp r5, 0x4 + bgt _0812CAA4 + ldr r0, =0x0203ab34 + ldr r0, [r0] + ldrh r1, [r0, 0x36] + subs r1, r5 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x2 + bl sub_812BC98 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r7, r4 + bne _0812CA78 + lsrs r6, 16 + str r6, [sp] +_0812CAA4: + ldr r0, =0x0203ab34 + mov r9, r0 +_0812CAA8: + movs r5, 0x1 + movs r1, 0 + mov r8, r1 + ldr r2, [sp] + lsls r2, 16 + mov r10, r2 +_0812CAB4: + mov r1, r9 + ldr r0, [r1] + ldrh r1, [r0, 0x2E] + lsls r5, 16 + asrs r4, r5, 16 + subs r1, r4, r1 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r7, r0, 24 + mov r2, r9 + ldr r0, [r2] + ldrh r1, [r0, 0x30] + subs r1, r4, r1 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + bl sub_812BC98 + lsls r0, 24 + lsrs r6, r0, 24 + mov r1, r10 + asrs r0, r1, 16 + subs r4, r0 + lsls r4, 16 + asrs r4, 16 + movs r0, 0x2 + adds r1, r4, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_812C8AC + lsls r0, 24 + cmp r0, 0 + bne _0812CB3C + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_812C87C + lsls r0, 24 + cmp r0, 0 + beq _0812CB28 + mov r2, r9 + ldr r0, [r2] + ldrb r1, [r0, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0812CB3C +_0812CB28: + mov r5, r8 + lsls r0, r5, 16 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + lsrs r0, 16 + mov r8, r0 + b _0812CB4A + .pool +_0812CB3C: + movs r2, 0x80 + lsls r2, 9 + adds r0, r5, r2 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _0812CAB4 +_0812CB4A: + mov r5, r8 + cmp r5, 0 + beq _0812CB60 + ldr r1, [sp] + lsls r0, r1, 16 + movs r2, 0x80 + lsls r2, 9 + adds r0, r2 + lsrs r0, 16 + str r0, [sp] + b _0812CAA8 +_0812CB60: + ldr r0, =0x0203ab34 + ldr r0, [r0] + mov r5, sp + ldrh r5, [r5] + strh r5, [r0, 0x32] + 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_812CA08 + + thumb_func_start sub_812CB80 +sub_812CB80: @ 812CB80 + push {r4-r7,lr} + mov r7, r8 + push {r7} + bl sub_812CA08 + ldr r4, =0x0203ab34 + ldr r2, [r4] + movs r0, 0x36 + ldrsh r1, [r2, r0] + cmp r1, 0 + beq _0812CC34 + ldrh r3, [r2, 0x34] + movs r5, 0x34 + ldrsh r0, [r2, r5] + cmp r0, r1 + beq _0812CC34 + ldrb r1, [r2, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0812CC34 + ldrh r1, [r2, 0x2E] + subs r1, r3, r1 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, [r4] + ldrh r1, [r0, 0x36] + ldrh r0, [r0, 0x30] + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + bl sub_812BC98 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_812C854 + lsls r0, 24 + cmp r0, 0 + beq _0812CC34 + movs r1, 0x1 + ldr r0, [r4] + movs r2, 0x34 + ldrsh r0, [r0, r2] + cmp r0, 0x1 + bne _0812CBEE + movs r1, 0x3 +_0812CBEE: + movs r3, 0 + lsls r1, 16 + mov r8, r1 + adds r7, r4, 0 +_0812CBF6: + ldr r0, [r7] + ldrh r2, [r0, 0x32] + lsls r0, r3, 16 + asrs r5, r0, 16 + adds r2, r5, r2 + mov r0, r8 + asrs r1, r0, 16 + subs r1, r2 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x2 + bl sub_812BC98 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r6, r4 + bne _0812CC28 + ldr r1, [r7] + ldrh r0, [r1, 0x32] + adds r0, r5, r0 + strh r0, [r1, 0x32] + b _0812CC34 + .pool +_0812CC28: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _0812CBF6 +_0812CC34: + ldr r7, =0x0203ab34 +_0812CC36: + ldr r0, [r7] + ldrh r0, [r0, 0x2E] + movs r1, 0x1 + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, [r7] + ldrh r0, [r0, 0x30] + movs r1, 0x2 + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + bl sub_812BC98 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r7] + ldrh r0, [r0, 0x32] + movs r1, 0x3 + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x2 + bl sub_812BC98 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_812C8AC + lsls r0, 24 + cmp r0, 0 + bne _0812CCB4 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_812C87C + lsls r0, 24 + cmp r0, 0 + beq _0812CCA4 + ldr r0, [r7] + ldrb r1, [r0, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0812CCB4 +_0812CCA4: + ldr r1, [r7] + ldrh r0, [r1, 0x32] + adds r0, 0x1 + strh r0, [r1, 0x32] + b _0812CC36 + .pool +_0812CCB4: + ldr r7, =0x0203ab34 +_0812CCB6: + ldr r0, [r7] + ldrh r0, [r0, 0x2E] + movs r1, 0x3 + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl sub_812BC98 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, [r7] + ldrh r0, [r0, 0x30] + movs r1, 0x2 + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x1 + bl sub_812BC98 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r7] + ldrh r0, [r0, 0x32] + movs r1, 0x1 + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + movs r0, 0x2 + bl sub_812BC98 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_812C8AC + lsls r0, 24 + cmp r0, 0 + bne _0812CD34 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_812C87C + lsls r0, 24 + cmp r0, 0 + beq _0812CD24 + ldr r0, [r7] + ldrb r1, [r0, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0812CD34 +_0812CD24: + ldr r1, [r7] + ldrh r0, [r1, 0x32] + adds r0, 0x1 + strh r0, [r1, 0x32] + b _0812CCB6 + .pool +_0812CD34: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_812CB80 + + thumb_func_start sub_812CD40 +sub_812CD40: @ 812CD40 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =sub_812CD74 + adds r0, r5, 0 + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x26] + bl _call_via_r5 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812CD40 + + thumb_func_start sub_812CD74 +sub_812CD74: @ 812CD74 + push {r4,lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_085A7544 + ldr r2, =0x03005e00 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r4, 0x8 + ldrsh r2, [r0, r4] + lsls r2, 2 + adds r2, r3 + ldr r2, [r2] + bl _call_via_r2 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812CD74 + + thumb_func_start sub_812CDA4 +sub_812CDA4: @ 812CDA4 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r1, =gUnknown_085A7550 + movs r2, 0x26 + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0x73 + str r1, [sp] + movs r1, 0x62 + movs r2, 0x63 + movs r3, 0x72 + bl sub_812FA78 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812CDA4 + + thumb_func_start sub_812CDD8 +sub_812CDD8: @ 812CDD8 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xB + ble _0812CDF0 + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] +_0812CDF0: + pop {r0} + bx r0 + thumb_func_end sub_812CDD8 + + thumb_func_start sub_812CDF4 +sub_812CDF4: @ 812CDF4 + push {r4,lr} + sub sp, 0x4 + lsls r4, r1, 24 + lsrs r4, 24 + ldr r1, =gUnknown_085A7550 + movs r2, 0x26 + ldrsh r0, [r0, r2] + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0x53 + str r1, [sp] + movs r1, 0x42 + movs r2, 0x43 + movs r3, 0x52 + bl sub_812FA78 + adds r0, r4, 0 + bl DestroyTask + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812CDF4 + + thumb_func_start sub_812CE2C +sub_812CE2C: @ 812CE2C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_085A8408 + lsls r1, r0, 2 + adds r1, r2 + ldr r2, [r1] + ldr r1, =gUnknown_085A8430 + adds r0, r1 + ldrb r1, [r0] + adds r0, r2, 0 + movs r2, 0x2 + bl gpu_pal_apply + pop {r0} + bx r0 + .pool + thumb_func_end sub_812CE2C + + thumb_func_start sub_812CE54 +sub_812CE54: @ 812CE54 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gUnknown_085A841C + lsls r1, r0, 2 + adds r1, r2 + ldr r2, [r1] + ldr r1, =gUnknown_085A8430 + adds r0, r1 + ldrb r1, [r0] + adds r0, r2, 0 + movs r2, 0x2 + bl gpu_pal_apply + pop {r0} + bx r0 + .pool + thumb_func_end sub_812CE54 + + thumb_func_start sub_812CE7C +sub_812CE7C: @ 812CE7C + push {r4-r7,lr} + lsls r0, 24 + lsrs r1, r0, 24 + movs r4, 0 + ldr r0, =gUnknown_085A843B + adds r0, r1, r0 + ldrb r0, [r0] + cmp r4, r0 + bcs _0812CEA8 + ldr r7, =gUnknown_085A8435 + adds r6, r0, 0 + lsls r5, r1, 1 +_0812CE94: + adds r0, r4, r5 + adds r0, r7 + ldrb r0, [r0] + bl sub_812CE2C + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r6 + bcc _0812CE94 +_0812CEA8: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812CE7C + + thumb_func_start sub_812CEB8 +sub_812CEB8: @ 812CEB8 + push {r4-r7,lr} + lsls r0, 24 + lsrs r1, r0, 24 + movs r4, 0 + ldr r0, =gUnknown_085A843B + adds r0, r1, r0 + ldrb r0, [r0] + cmp r4, r0 + bcs _0812CEE4 + ldr r7, =gUnknown_085A8435 + adds r6, r0, 0 + lsls r5, r1, 1 +_0812CED0: + adds r0, r4, r5 + adds r0, r7 + ldrb r0, [r0] + bl sub_812CE54 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r6 + bcc _0812CED0 +_0812CEE4: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812CEB8 + + thumb_func_start sub_812CEF4 +sub_812CEF4: @ 812CEF4 + push {r4,r5,lr} + movs r4, 0 + ldr r5, =0x02020630 +_0812CEFA: + ldr r0, =sub_812D024 + bl obj_add_empty_with_callback + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + strh r4, [r1, 0x2E] + ldr r1, =0x0203ab34 + ldr r1, [r1] + adds r1, 0x44 + adds r1, r4 + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _0812CEFA + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812CEF4 + + thumb_func_start sub_812CF34 +sub_812CF34: @ 812CF34 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x0203ab34 + ldr r1, [r1] + adds r1, 0x44 + adds r1, r0 + ldrb r1, [r1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r2, 0 + movs r1, 0x1 + strh r1, [r0, 0x30] + movs r1, 0x4 + strh r1, [r0, 0x32] + strh r2, [r0, 0x34] + strh r2, [r0, 0x36] + movs r1, 0x2 + strh r1, [r0, 0x38] + strh r2, [r0, 0x3C] + bx lr + .pool + thumb_func_end sub_812CF34 + + thumb_func_start sub_812CF6C +sub_812CF6C: @ 812CF6C + push {r4,r5,lr} + movs r2, 0 + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r3, r0, 0 + adds r3, 0x44 + ldr r4, =0x02020630 +_0812CF7A: + adds r0, r3, r2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r4 + movs r5, 0x30 + ldrsh r0, [r1, r5] + cmp r0, 0 + beq _0812CFA4 + movs r5, 0x32 + ldrsh r0, [r1, r5] + cmp r0, 0 + beq _0812CFA4 + movs r0, 0 + b _0812CFB0 + .pool +_0812CFA4: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x4 + bls _0812CF7A + movs r0, 0x1 +_0812CFB0: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_812CF6C + + thumb_func_start sub_812CFB8 +sub_812CFB8: @ 812CFB8 + push {r4,lr} + movs r4, 0 +_0812CFBC: + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x44 + adds r0, r4 + ldrb r0, [r0] + bl sub_812CFEC + lsls r0, 24 + cmp r0, 0 + bne _0812CFD8 + movs r0, 0 + b _0812CFE4 + .pool +_0812CFD8: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _0812CFBC + movs r0, 0x1 +_0812CFE4: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_812CFB8 + + thumb_func_start sub_812CFEC +sub_812CFEC: @ 812CFEC + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + movs r2, 0x30 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0812D00C + movs r0, 0x1 + b _0812D01E + .pool +_0812D00C: + ldrh r2, [r1, 0x3C] + movs r3, 0x3C + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _0812D01A + movs r0, 0 + strh r0, [r1, 0x30] +_0812D01A: + lsls r0, r2, 24 + lsrs r0, 24 +_0812D01E: + pop {r1} + bx r1 + thumb_func_end sub_812CFEC + + thumb_func_start sub_812D024 +sub_812D024: @ 812D024 + push {r4-r7,lr} + adds r2, r0, 0 + movs r1, 0x30 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0812D0A6 + ldrh r0, [r2, 0x34] + subs r0, 0x1 + strh r0, [r2, 0x34] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0812D08E + movs r0, 0 + strh r0, [r2, 0x3C] + movs r6, 0x1 + strh r6, [r2, 0x34] + ldrh r1, [r2, 0x38] + ldrh r3, [r2, 0x36] + adds r0, r1, r3 + strh r0, [r2, 0x36] + movs r4, 0x4 + ldrh r5, [r2, 0x32] + movs r7, 0x32 + ldrsh r3, [r2, r7] + cmp r3, 0 + beq _0812D060 + movs r4, 0x8 +_0812D060: + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bgt _0812D078 + strh r6, [r2, 0x3C] + negs r0, r1 + strh r0, [r2, 0x38] + cmp r3, 0 + beq _0812D08E + subs r0, r5, 0x1 + strh r0, [r2, 0x32] + b _0812D080 +_0812D078: + cmp r0, r4 + blt _0812D080 + negs r0, r1 + strh r0, [r2, 0x38] +_0812D080: + movs r1, 0x32 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0812D08E + ldrh r0, [r2, 0x34] + lsls r0, 1 + strh r0, [r2, 0x34] +_0812D08E: + ldr r1, =gUnknown_085A8430 + movs r3, 0x2E + ldrsh r0, [r2, r3] + adds r0, r1 + ldrb r0, [r0] + ldrh r3, [r2, 0x36] + lsls r3, 24 + lsrs r3, 24 + adds r1, r3, 0 + adds r2, r3, 0 + bl sub_80B6128 +_0812D0A6: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812D024 + + thumb_func_start sub_812D0B0 +sub_812D0B0: @ 812D0B0 + push {r4,lr} + ldr r4, =sub_812D128 + adds r0, r4, 0 + movs r1, 0x6 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x1 + strh r2, [r1, 0xE] + bl _call_via_r4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812D0B0 + + thumb_func_start sub_812D0E0 +sub_812D0E0: @ 812D0E0 + push {lr} + ldr r0, =sub_812D128 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r1, 0xC + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _0812D10C + movs r0, 0 + b _0812D120 + .pool +_0812D10C: + adds r0, r2, 0 + bl DestroyTask + ldr r0, =gUnknown_085A84AC + ldr r0, [r0] + movs r1, 0x10 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0x1 +_0812D120: + pop {r1} + bx r1 + .pool + thumb_func_end sub_812D0E0 + + thumb_func_start sub_812D128 +sub_812D128: @ 812D128 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r2, r1, r0 + ldrh r0, [r2, 0xA] + subs r0, 0x1 + strh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0812D166 + movs r0, 0x4 + strh r0, [r2, 0xA] + ldrh r1, [r2, 0xE] + ldrh r3, [r2, 0xC] + adds r0, r1, r3 + strh r0, [r2, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + beq _0812D162 + cmp r0, 0x2 + bne _0812D166 +_0812D162: + negs r0, r1 + strh r0, [r2, 0xE] +_0812D166: + ldr r0, =gUnknown_085A84A0 + movs r3, 0xC + ldrsh r1, [r2, r3] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + movs r1, 0x10 + movs r2, 0x20 + bl gpu_pal_apply + pop {r0} + bx r0 + .pool + thumb_func_end sub_812D128 + + thumb_func_start sub_812D188 +sub_812D188: @ 812D188 + push {lr} + ldr r0, =sub_812D230 + movs r1, 0x8 + bl CreateTask + ldr r1, =0x0203ab34 + ldr r1, [r1] + adds r1, 0x3E + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_812D188 + + thumb_func_start sub_812D1A8 +sub_812D1A8: @ 812D1A8 + push {r4,lr} + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x3E + ldrb r0, [r0] + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + adds r0, r4, 0 + bl sub_812D394 + movs r1, 0x1 + strh r1, [r4, 0x8] + ldrh r0, [r4, 0xA] + adds r0, 0x1 + strh r0, [r4, 0xA] + strh r1, [r4, 0x26] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812D1A8 + + thumb_func_start sub_812D1DC +sub_812D1DC: @ 812D1DC + push {r4,lr} + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x3E + ldrb r0, [r0] + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =0x03005e00 + adds r4, r0 + adds r0, r4, 0 + bl sub_812D394 + movs r0, 0x3 + strh r0, [r4, 0x8] + movs r0, 0x1 + strh r0, [r4, 0x26] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812D1DC + + thumb_func_start sub_812D20C +sub_812D20C: @ 812D20C + ldr r2, =0x03005e00 + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x3E + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r0, [r0, 0x26] + lsls r0, 24 + lsrs r0, 24 + bx lr + .pool + thumb_func_end sub_812D20C + + thumb_func_start sub_812D230 +sub_812D230: @ 812D230 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_085A7558 + ldr r2, =0x03005e00 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_812D230 + + thumb_func_start nullsub_50 +nullsub_50: @ 812D260 + bx lr + thumb_func_end nullsub_50 + + thumb_func_start sub_812D264 +sub_812D264: @ 812D264 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0xA] + lsls r0, 19 + movs r1, 0xA0 + lsls r1, 13 + adds r0, r1 + asrs r0, 16 + movs r1, 0x14 + bl sub_812EF00 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0xC] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812D264 + + thumb_func_start sub_812D28C +sub_812D28C: @ 812D28C + push {r4,r5,lr} + adds r4, r0, 0 + ldr r2, =0x02020630 + movs r0, 0xC + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x3C + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _0812D2FC + ldrh r1, [r4, 0xA] + adds r0, r1, 0x2 + lsls r0, 16 + lsrs r5, r0, 16 + movs r3, 0 + movs r2, 0 + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x1 + bne _0812D2C4 + movs r3, 0x1 + movs r2, 0x1 + b _0812D2CC + .pool +_0812D2C4: + cmp r1, 0x10 + bne _0812D2CC + movs r3, 0x2 + movs r2, 0x2 +_0812D2CC: + ldr r0, =0x0203aacc + ldr r0, [r0] + lsls r1, r2, 1 + adds r1, r0 + ldr r2, =gUnknown_085A7568 + lsls r0, r3, 2 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + lsls r3, r5, 16 + movs r0, 0x80 + lsls r0, 15 + adds r3, r0 + lsrs r3, 16 + movs r0, 0x2 + movs r2, 0x2 + bl LoadBgTilemap + ldrb r0, [r4, 0xC] + bl sub_812EF6C + movs r0, 0 + strh r0, [r4, 0x8] + strh r0, [r4, 0x26] +_0812D2FC: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812D28C + + thumb_func_start sub_812D30C +sub_812D30C: @ 812D30C + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0xA] + adds r0, r1, 0x2 + lsls r0, 16 + lsrs r5, r0, 16 + movs r3, 0 + movs r2, 0x3 + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x1 + bne _0812D32A + movs r3, 0x1 + movs r2, 0x1 + b _0812D332 +_0812D32A: + cmp r1, 0x10 + bne _0812D332 + movs r3, 0x2 + movs r2, 0x2 +_0812D332: + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0812D366 + ldr r0, =0x0203aacc + ldr r0, [r0] + lsls r1, r2, 1 + adds r1, r0 + ldr r0, =gUnknown_085A7568 + lsls r2, r3, 2 + adds r0, 0x2 + adds r2, r0 + ldrh r0, [r2] + strh r0, [r1] + lsls r3, r5, 16 + movs r0, 0x80 + lsls r0, 15 + adds r3, r0 + lsrs r3, 16 + movs r0, 0x2 + movs r2, 0x2 + bl LoadBgTilemap + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] +_0812D366: + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _0812D378 + movs r0, 0 + strh r0, [r4, 0xC] +_0812D378: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0812D384 + strh r0, [r4, 0x8] + strh r0, [r4, 0x26] +_0812D384: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812D30C + + thumb_func_start sub_812D394 +sub_812D394: @ 812D394 + push {lr} + movs r1, 0x2 + adds r2, r0, 0 + adds r2, 0x8 + movs r3, 0 +_0812D39E: + lsls r0, r1, 1 + adds r0, r2, r0 + strh r3, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bls _0812D39E + pop {r0} + bx r0 + thumb_func_end sub_812D394 + + thumb_func_start sub_812D3B4 +sub_812D3B4: @ 812D3B4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0x3 + movs r5, 0 + cmp r5, r6 + bge _0812D41E + ldr r7, =gUnknown_085A7568 +_0812D3C4: + movs r3, 0 + movs r1, 0 + lsls r0, r5, 16 + asrs r0, 16 + cmp r0, 0 + bne _0812D3DC + movs r3, 0x1 + movs r1, 0x1 + b _0812D3E4 + .pool +_0812D3DC: + cmp r0, 0xF + bne _0812D3E4 + movs r3, 0x2 + movs r1, 0x2 +_0812D3E4: + ldr r0, =0x0203aacc + ldr r0, [r0] + lsls r1, 1 + adds r1, r0 + lsls r0, r3, 2 + adds r0, r7 + ldrh r0, [r0] + strh r0, [r1] + lsls r3, r4, 16 + asrs r4, r3, 16 + movs r0, 0x80 + lsls r0, 15 + adds r3, r0 + lsrs r3, 16 + movs r0, 0x2 + movs r2, 0x2 + bl LoadBgTilemap + lsls r0, r5, 16 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + adds r4, 0x1 + lsls r4, 16 + lsrs r4, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, r6 + blt _0812D3C4 +_0812D41E: + lsls r2, r5, 16 + asrs r0, r2, 16 + cmp r0, 0xF + bgt _0812D484 + ldr r7, =gUnknown_085A756A +_0812D428: + movs r3, 0 + movs r1, 0x3 + asrs r0, r2, 16 + cmp r0, 0 + bne _0812D440 + movs r3, 0x1 + movs r1, 0x1 + b _0812D448 + .pool +_0812D440: + cmp r0, 0xF + bne _0812D448 + movs r3, 0x2 + movs r1, 0x2 +_0812D448: + ldr r0, =0x0203aacc + ldr r0, [r0] + lsls r1, 1 + adds r1, r0 + lsls r0, r3, 2 + adds r0, r7 + ldrh r0, [r0] + strh r0, [r1] + lsls r3, r4, 16 + asrs r4, r3, 16 + movs r0, 0x80 + lsls r0, 15 + adds r3, r0 + lsrs r3, 16 + movs r0, 0x2 + movs r2, 0x2 + bl LoadBgTilemap + lsls r0, r5, 16 + movs r1, 0x80 + lsls r1, 9 + adds r0, r1 + lsrs r5, r0, 16 + adds r4, 0x1 + lsls r4, 16 + lsrs r4, 16 + lsls r2, r5, 16 + asrs r0, r2, 16 + cmp r0, 0xF + ble _0812D428 +_0812D484: + ldr r2, =0x03005e00 + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x3E + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + strh r6, [r0, 0xA] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812D3B4 + + thumb_func_start sub_812D4AC +sub_812D4AC: @ 812D4AC + push {r4,lr} + ldr r4, =sub_812D4EC + adds r0, r4, 0 + movs r1, 0x7 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812D4AC + + thumb_func_start sub_812D4CC +sub_812D4CC: @ 812D4CC + push {lr} + ldr r0, =sub_812D4EC + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _0812D4E4 + movs r0, 0 + b _0812D4E6 + .pool +_0812D4E4: + movs r0, 0x1 +_0812D4E6: + pop {r1} + bx r1 + thumb_func_end sub_812D4CC + + thumb_func_start sub_812D4EC +sub_812D4EC: @ 812D4EC + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_085A7574 + ldr r2, =0x03005e00 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_812D4EC + + thumb_func_start sub_812D51C +sub_812D51C: @ 812D51C + push {lr} + ldr r3, =0x0203ab34 + ldr r1, [r3] + movs r2, 0 + strb r2, [r1, 0xA] + ldr r1, [r3] + strh r2, [r1, 0x14] + strh r2, [r1, 0x16] + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + strh r2, [r0, 0xA] + movs r1, 0x1E + strh r1, [r0, 0xC] + movs r1, 0xA0 + lsls r1, 3 + strh r1, [r0, 0x10] + ldr r0, =0x02021bbc + strh r2, [r0] + ldr r0, =0x02021bbe + strh r2, [r0] + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + movs r0, 0x16 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1E + movs r1, 0 + bl sub_812DC08 + bl sub_812E474 + bl sub_812E33C + bl sub_812E650 + bl sub_812E70C + bl sub_812E7CC + bl sub_812B700 + bl sub_80A2F30 + movs r0, 0xC4 + lsls r0, 1 + bl current_map_music_set + pop {r0} + bx r0 + .pool + thumb_func_end sub_812D51C + + thumb_func_start sub_812D594 +sub_812D594: @ 812D594 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r1, =0x02021bbc + ldrh r0, [r1] + subs r0, 0x8 + strh r0, [r1] + ldrh r1, [r4, 0xA] + adds r1, 0x8 + strh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + adds r0, 0xF0 + movs r2, 0xFF + ands r0, r2 + lsrs r5, r0, 3 + ldr r0, =0x000001ff + ands r1, r0 + movs r0, 0x14 + bl SetGpuReg + adds r2, r5, 0 + movs r1, 0xC + ldrsh r0, [r4, r1] + cmp r2, r0 + beq _0812D5E2 + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, 0x12 + bgt _0812D5E2 + strh r5, [r4, 0xC] + ldrh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 19 + strh r0, [r4, 0xE] + movs r0, 0xE + ldrsh r1, [r4, r0] + adds r0, r2, 0 + bl sub_812DC08 +_0812D5E2: + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0xC7 + ble _0812D5F4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x8] + strh r1, [r4, 0xE] +_0812D5F4: + ldrh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 24 + bl sub_812BDD4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812D594 + + thumb_func_start sub_812D60C +sub_812D60C: @ 812D60C + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 24 + bl sub_812BDD4 + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3B + ble _0812D636 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + bl sub_812E934 + bl sub_812EAB0 +_0812D636: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812D60C + + thumb_func_start sub_812D63C +sub_812D63C: @ 812D63C + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + adds r7, r0, 0 + ldr r1, =gUnknown_085A75C0 + mov r0, sp + movs r2, 0x4 + bl memcpy + add r0, sp, 0x4 + mov r8, r0 + ldr r1, =gUnknown_085A75C4 + movs r2, 0x8 + bl memcpy + add r6, sp, 0xC + ldr r1, =gUnknown_085A75CC + adds r0, r6, 0 + movs r2, 0x8 + bl memcpy + ldrh r0, [r7, 0x10] + lsls r0, 16 + asrs r0, 24 + bl sub_812BDD4 + ldrh r0, [r7, 0x10] + subs r0, 0x4 + strh r0, [r7, 0x10] + lsls r0, 16 + asrs r0, 24 + movs r5, 0x4 + subs r5, r0 + lsls r4, r5, 1 + add r8, r4 + mov r1, r8 + movs r2, 0 + ldrsh r0, [r1, r2] + bl sub_812EA44 + adds r6, r4 + movs r1, 0 + ldrsh r0, [r6, r1] + bl sub_812EBAC + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x3F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + mov r2, sp + adds r1, r2, r5 + ldrb r1, [r1] + bl StartObjectImageAnimIfDifferent + movs r1, 0x10 + ldrsh r0, [r7, r1] + movs r1, 0x80 + lsls r1, 1 + cmp r0, r1 + bgt _0812D6CC + ldrh r0, [r7, 0x8] + adds r0, 0x1 + strh r0, [r7, 0x8] + strh r1, [r7, 0x10] + movs r0, 0 + strh r0, [r7, 0x12] +_0812D6CC: + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812D63C + + thumb_func_start sub_812D6EC +sub_812D6EC: @ 812D6EC + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 24 + bl sub_812BDD4 + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4F + ble _0812D730 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + strh r0, [r4, 0x12] + movs r0, 0x2 + bl sub_812EBAC + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x3F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0x3 + bl StartObjectImageAnimIfDifferent +_0812D730: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812D6EC + + thumb_func_start sub_812D740 +sub_812D740: @ 812D740 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 24 + bl sub_812BDD4 + ldrb r0, [r4, 0x10] + adds r0, 0x80 + strh r0, [r4, 0x10] + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4F + ble _0812D76C + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + strh r0, [r4, 0x12] +_0812D76C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812D740 + + thumb_func_start sub_812D774 +sub_812D774: @ 812D774 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 24 + bl sub_812BDD4 + ldrb r0, [r4, 0x10] + adds r0, 0x40 + strh r0, [r4, 0x10] + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x27 + ble _0812D7DC + movs r0, 0 + strh r0, [r4, 0x12] + ldr r0, =0x0203ab34 + ldr r1, [r0] + ldrb r0, [r1, 0x5] + cmp r0, 0 + beq _0812D7B8 + ldrb r1, [r1, 0xA] + movs r2, 0x14 + ldrsh r0, [r4, r2] + cmp r1, r0 + bgt _0812D7D6 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + b _0812D7D4 + .pool +_0812D7B8: + movs r1, 0x14 + ldrsh r0, [r4, r1] + cmp r0, 0x3 + ble _0812D7C6 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + b _0812D7D4 +_0812D7C6: + ldrh r0, [r4, 0x14] + bl sub_812B760 + lsls r0, 24 + cmp r0, 0 + beq _0812D7D6 + movs r0, 0xE +_0812D7D4: + strh r0, [r4, 0x8] +_0812D7D6: + ldrh r0, [r4, 0x14] + adds r0, 0x1 + strh r0, [r4, 0x14] +_0812D7DC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812D774 + + thumb_func_start sub_812D7E4 +sub_812D7E4: @ 812D7E4 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r6, =0x0203ab34 + ldr r0, [r6] + movs r1, 0x14 + ldrsh r0, [r0, r1] + movs r1, 0x14 + bl __modsi3 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r0, 0 + beq _0812D810 + ldrh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 24 + bl sub_812BE0C + b _0812D838 + .pool +_0812D810: + movs r0, 0x1 + bl sub_812BCE8 + ldr r1, [r6] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1, 0x5] + cmp r0, r1 + beq _0812D842 + ldrh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 24 + bl sub_812BDD4 + ldr r0, [r6] + movs r1, 0x14 + ldrsh r0, [r0, r1] + movs r1, 0x14 + bl __modsi3 +_0812D838: + lsls r0, 16 + lsrs r5, r0, 16 + ldrb r0, [r4, 0x10] + adds r0, 0x40 + strh r0, [r4, 0x10] +_0812D842: + lsls r0, r5, 16 + asrs r5, r0, 16 + cmp r5, 0 + bne _0812D866 + movs r0, 0x1 + bl sub_812BCE8 + ldr r1, =0x0203ab34 + ldr r1, [r1] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1, 0x5] + cmp r0, r1 + bne _0812D866 + strh r5, [r4, 0x10] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0812D866: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812D7E4 + + thumb_func_start sub_812D870 +sub_812D870: @ 812D870 + push {r4-r6,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x10] + adds r0, 0x1 + movs r6, 0 + strh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3B + ble _0812D914 + bl sub_80A2F30 + bl sub_812EA7C + bl sub_812EBCC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldr r5, =0x0203ab34 + ldr r1, [r5] + ldrb r0, [r1, 0x5] + cmp r0, 0 + bne _0812D8D0 + movs r0, 0xA0 + strh r0, [r4, 0x10] + adds r0, r1, 0 + adds r0, 0x3F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0x5 + bl StartObjectImageAnimIfDifferent + ldr r0, =0x00000187 + bl fanfare_play + b _0812D914 + .pool +_0812D8D0: + movs r0, 0xC0 + strh r0, [r4, 0x10] + adds r0, r1, 0 + adds r0, 0x3F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + movs r1, 0x4 + bl StartObjectImageAnimIfDifferent + ldr r0, [r5] + adds r0, 0x3F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + adds r0, 0x2B + strb r6, [r0] + ldr r0, [r5] + ldrb r0, [r0, 0x2] + cmp r0, 0 + beq _0812D90C + bl sub_812D1DC + ldr r0, [r5] + strb r6, [r0, 0x2] +_0812D90C: + movs r0, 0xC3 + lsls r0, 1 + bl fanfare_play +_0812D914: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812D870 + + thumb_func_start sub_812D920 +sub_812D920: @ 812D920 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x10] + movs r2, 0x10 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0812D938 + subs r0, r1, 0x1 + strh r0, [r4, 0x10] + lsls r0, 16 + cmp r0, 0 + bne _0812D948 +_0812D938: + bl sub_812D20C + lsls r0, 24 + cmp r0, 0 + bne _0812D948 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0812D948: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812D920 + + thumb_func_start sub_812D950 +sub_812D950: @ 812D950 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r1, =0x02021bbc + ldrh r0, [r1] + subs r0, 0x8 + strh r0, [r1] + ldrh r1, [r4, 0xA] + adds r1, 0x8 + strh r1, [r4, 0xA] + ldrh r0, [r4, 0xE] + adds r0, 0x8 + strh r0, [r4, 0xE] + movs r2, 0xA + ldrsh r0, [r4, r2] + subs r0, 0x8 + movs r2, 0xFF + ands r0, r2 + lsrs r5, r0, 3 + ldr r0, =0x000001ff + ands r1, r0 + movs r0, 0x14 + bl SetGpuReg + ldrh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 19 + cmp r0, 0x19 + bgt _0812D998 + adds r0, r5, 0 + bl sub_812DC50 + b _0812D99E + .pool +_0812D998: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0812D99E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_812D950 + + thumb_func_start sub_812D9A4 +sub_812D9A4: @ 812D9A4 + push {r4-r6,lr} + adds r5, r0, 0 + ldr r4, =0x0203ab34 + ldr r0, [r4] + movs r6, 0 + strb r6, [r0, 0xB] + ldr r1, [r4] + ldrb r0, [r1, 0x5] + strb r0, [r1, 0xA] + ldr r0, =0x02021bbc + strh r6, [r0] + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + ldr r1, [r4] + movs r0, 0x8 + strh r0, [r1, 0x1A] + bl sub_812E3E8 + bl sub_812E82C + bl sub_812E8C4 + ldr r0, [r4] + adds r0, 0x60 + ldrh r0, [r0] + bl current_map_music_set + ldr r0, [r4] + ldrb r0, [r0, 0xA] + cmp r0, 0 + bne _0812DA04 + ldr r0, =sub_812D4EC + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + b _0812DA1A + .pool +_0812DA04: + movs r0, 0x4 + bl sub_812DEE4 + bl dp15_jump_random_unknown + strh r0, [r5, 0xA] + strh r6, [r5, 0xC] + strh r6, [r5, 0xE] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_0812DA1A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_812D9A4 + + thumb_func_start sub_812DA20 +sub_812DA20: @ 812DA20 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, =0x0203ab34 + ldr r5, [r0] + movs r0, 0x1A + ldrsh r1, [r5, r0] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _0812DA40 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0812DA66 + .pool +_0812DA40: + movs r1, 0x1C + ldrsh r0, [r5, r1] + movs r1, 0x18 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + bne _0812DA66 + ldrh r0, [r4, 0xC] + adds r0, 0x1 + strh r0, [r4, 0xC] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0812DA66 + ldrh r0, [r5, 0x1A] + lsls r0, 16 + asrs r0, 17 + strh r0, [r5, 0x1A] +_0812DA66: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_812DA20 + + thumb_func_start sub_812DA6C +sub_812DA6C: @ 812DA6C + push {lr} + bl sub_812E054 + lsls r0, 24 + cmp r0, 0 + beq _0812DA86 + ldr r0, =sub_812D4EC + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_0812DA86: + pop {r0} + bx r0 + .pool + thumb_func_end sub_812DA6C + + thumb_func_start sub_812DA90 +sub_812DA90: @ 812DA90 + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_812E82C + bl sub_812EA7C + bl sub_812EBCC + bl sub_812EC20 + ldr r5, =0x02020630 + ldr r3, =0x0203ab34 + ldr r0, [r3] + adds r0, 0x4E + ldrb r1, [r0] + 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] + adds r0, 0x3F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x5 + bl StartObjectImageAnimIfDifferent + ldrh r0, [r4, 0x8] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x8] + movs r0, 0x4 + strh r0, [r4, 0x10] + strh r1, [r4, 0x12] + bl sub_80A2F30 + ldr r0, =0x00000187 + bl fanfare_play + movs r0, 0xB2 + bl audio_play + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812DA90 + + thumb_func_start sub_812DB04 +sub_812DB04: @ 812DB04 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r1, =0x02021bbe + ldrh r0, [r4, 0x10] + strh r0, [r1] + ldrh r1, [r4, 0x10] + movs r0, 0x16 + bl SetGpuReg + ldrh r1, [r4, 0x12] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0812DB26 + ldrh r0, [r4, 0x10] + negs r0, r0 + strh r0, [r4, 0x10] +_0812DB26: + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + movs r1, 0x1F + ands r0, r1 + cmp r0, 0 + bne _0812DB3C + ldrh r0, [r4, 0x10] + lsls r0, 16 + asrs r0, 17 + strh r0, [r4, 0x10] +_0812DB3C: + movs r0, 0x10 + ldrsh r5, [r4, r0] + cmp r5, 0 + bne _0812DB7A + bl sub_812EC70 + bl sub_812EC94 + bl sub_812E5A8 + bl sub_812EDC0 + ldr r2, =0x02020630 + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x4E + ldrb r1, [r0] + 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] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + strh r5, [r4, 0x12] +_0812DB7A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812DB04 + + thumb_func_start sub_812DB8C +sub_812DB8C: @ 812DB8C + push {r4,lr} + adds r4, r0, 0 + ldr r1, =0x02021bbe + movs r0, 0 + strh r0, [r1] + movs r0, 0x16 + movs r1, 0 + bl SetGpuReg + bl sub_812EEA8 + lsls r0, 24 + cmp r0, 0 + beq _0812DBB2 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + bl sub_812EECC +_0812DBB2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812DB8C + + thumb_func_start sub_812DBBC +sub_812DBBC: @ 812DBBC + push {lr} + ldr r1, =0x02021bbc + movs r0, 0 + strh r0, [r1] + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x60 + ldrh r0, [r0] + bl current_map_music_set + bl sub_812E3E8 + bl sub_812E8F8 + bl sub_812E8C4 + bl sub_812ED8C + ldr r0, =sub_812D4EC + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_812DBBC + + thumb_func_start sub_812DC08 +sub_812DC08: @ 812DC08 + push {r4-r6,lr} + movs r2, 0x4 + lsls r1, 16 + asrs r6, r1, 16 + lsls r0, 16 + asrs r5, r0, 16 +_0812DC14: + lsls r4, r2, 16 + asrs r4, 16 + subs r0, r4, 0x4 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, r6, r1 + lsls r1, 1 + ldr r0, =gUnknown_085A96E0 + adds r1, r0 + lsls r3, r4, 5 + adds r3, r5, r3 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x1 + movs r2, 0x2 + bl LoadBgTilemap + adds r4, 0x1 + lsls r4, 16 + lsrs r2, r4, 16 + asrs r4, 16 + cmp r4, 0xE + ble _0812DC14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812DC08 + + thumb_func_start sub_812DC50 +sub_812DC50: @ 812DC50 + push {r4,r5,lr} + movs r4, 0x4 + lsls r0, 16 + asrs r5, r0, 16 +_0812DC58: + lsls r3, r4, 5 + adds r3, r5, r3 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x1 + ldr r1, =gUnknown_085A9898 + movs r2, 0x2 + bl LoadBgTilemap + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xE + bls _0812DC58 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812DC50 + + thumb_func_start sub_812DC80 +sub_812DC80: @ 812DC80 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =sub_812DCD4 + adds r0, r5, 0 + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0xA] + bl _call_via_r5 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812DC80 + + thumb_func_start sub_812DCB4 +sub_812DCB4: @ 812DCB4 + push {lr} + ldr r0, =sub_812DCD4 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _0812DCCC + movs r0, 0 + b _0812DCCE + .pool +_0812DCCC: + movs r0, 0x1 +_0812DCCE: + pop {r1} + bx r1 + thumb_func_end sub_812DCB4 + + thumb_func_start sub_812DCD4 +sub_812DCD4: @ 812DCD4 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_085A75D4 + ldr r2, =0x03005e00 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_812DCD4 + + thumb_func_start sub_812DD04 +sub_812DD04: @ 812DD04 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812DD04 + + thumb_func_start sub_812DD28 +sub_812DD28: @ 812DD28 + push {lr} + adds r2, r0, 0 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0812DD3E + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] +_0812DD3E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_812DD28 + + thumb_func_start sub_812DD48 +sub_812DD48: @ 812DD48 + push {r4,lr} + adds r4, r0, 0 + bl sub_812DFDC + bl sub_812FAF4 + ldr r0, =gUnknown_085A7444 + bl AddWindow + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812DD48 + + thumb_func_start sub_812DD78 +sub_812DD78: @ 812DD78 + push {r4,r5,lr} + sub sp, 0xC + adds r5, r0, 0 + ldr r0, =gUnknown_085A744C + str r0, [sp] + movs r4, 0 + str r4, [sp, 0x4] + ldr r0, =gUnknown_085EF750 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x2 + movs r3, 0x5 + bl box_print + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812DD78 + + thumb_func_start sub_812DDC4 +sub_812DDC4: @ 812DDC4 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x6 + ands r0, r1 + cmp r0, 0 + beq _0812DE08 + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x1 + bl ClearWindowTilemap + movs r0, 0x1 + movs r1, 0x1 + bl CopyWindowToVram + movs r0, 0x1 + bl RemoveWindow + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_0812DE08: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812DDC4 + + thumb_func_start sub_812DE14 +sub_812DE14: @ 812DE14 + push {r4,lr} + adds r4, r0, 0 + bl sub_812F968 + movs r0, 0x3 + bl ShowBg + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812DE14 + + thumb_func_start sub_812DE30 +sub_812DE30: @ 812DE30 + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0xA] + bl sub_812DEE4 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812DE30 + + thumb_func_start sub_812DE48 +sub_812DE48: @ 812DE48 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r0, =0x0203ab34 + ldr r0, [r0] + ldrb r0, [r0, 0x2] + bl sub_812D3B4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812DE48 + + thumb_func_start sub_812DE7C +sub_812DE7C: @ 812DE7C + push {lr} + ldr r0, =sub_812DCD4 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_812DE7C + + thumb_func_start sub_812DE94 +sub_812DE94: @ 812DE94 + push {lr} + ldr r0, =sub_812E0B0 + movs r1, 0x3 + bl CreateTask + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x3D + strb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r0, r1 + ldr r1, =0x0000ffff + strh r1, [r0, 0xA] + movs r1, 0x4 + adds r2, r0, 0 + adds r2, 0x8 + movs r3, 0x40 +_0812DEC0: + lsls r0, r1, 1 + adds r0, r2, r0 + strh r3, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bls _0812DEC0 + pop {r0} + bx r0 + .pool + thumb_func_end sub_812DE94 + + thumb_func_start sub_812DEE4 +sub_812DEE4: @ 812DEE4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_812DFDC + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x3D + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r7, r0, r1 + strh r4, [r7, 0xA] + movs r6, 0 + ldr r1, =gUnknown_085A7A04 + lsls r5, r4, 2 + adds r0, r5, r1 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0xFF + beq _0812DF52 + mov r8, r1 +_0812DF1A: + mov r0, r8 + adds r4, r5, r0 + ldr r0, [r4] + lsls r2, r6, 2 + adds r2, r0 + ldrb r0, [r2] + ldrb r1, [r2, 0x1] + movs r3, 0x2 + ldrsh r2, [r2, r3] + bl sub_812EF98 + lsls r0, 24 + lsrs r0, 24 + adds r2, r6, 0x4 + lsls r2, 1 + adds r1, r7, 0 + adds r1, 0x8 + adds r1, r2 + strh r0, [r1] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, [r4] + lsls r0, r6, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _0812DF1A +_0812DF52: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812DEE4 + + thumb_func_start sub_812DF68 +sub_812DF68: @ 812DF68 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + mov r8, r1 + ldr r4, [sp, 0x1C] + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x3D + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r0, r1 + mov r12, r0 + movs r5, 0x4 + lsls r4, 16 + asrs r6, r4, 16 + lsls r2, 16 + lsls r3, 16 +_0812DF96: + lsls r0, r5, 1 + mov r1, r12 + adds r1, 0x8 + adds r4, r1, r0 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x40 + bne _0812DFC4 + str r6, [sp] + adds r0, r7, 0 + mov r1, r8 + asrs r2, 16 + asrs r3, 16 + bl sub_812EFDC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4] + b _0812DFCE + .pool +_0812DFC4: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xF + bls _0812DF96 +_0812DFCE: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_812DF68 + + thumb_func_start sub_812DFDC +sub_812DFDC: @ 812DFDC + push {r4-r6,lr} + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x3D + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + ldrh r1, [r4, 0xA] + ldr r0, =0x0000ffff + cmp r1, r0 + beq _0812E008 + ldr r0, =gUnknown_085A7A20 + movs r2, 0xA + ldrsh r1, [r4, r2] + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 +_0812E008: + movs r5, 0x4 + adds r6, r4, 0 + adds r6, 0x8 +_0812E00E: + lsls r0, r5, 1 + adds r4, r6, r0 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x40 + beq _0812E02E + adds r1, r0, 0 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + movs r0, 0x40 + strh r0, [r4] +_0812E02E: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0xF + bls _0812E00E + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812DFDC + + thumb_func_start sub_812E054 +sub_812E054: @ 812E054 + push {r4,r5,lr} + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x3D + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r0, r1 + movs r2, 0x4 + adds r3, r0, 0 + adds r3, 0x8 + ldr r4, =0x02020630 +_0812E070: + lsls r0, r2, 1 + adds r1, r3, r0 + movs r5, 0 + ldrsh r0, [r1, r5] + cmp r0, 0x40 + beq _0812E09C + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + movs r5, 0x3C + ldrsh r0, [r1, r5] + cmp r0, 0 + beq _0812E09C + movs r0, 0 + b _0812E0A8 + .pool +_0812E09C: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _0812E070 + movs r0, 0x1 +_0812E0A8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_812E054 + + thumb_func_start sub_812E0B0 +sub_812E0B0: @ 812E0B0 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =gUnknown_085A7610 + ldr r2, =0x03005e00 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + lsls r1, 2 + adds r1, r3 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .pool + thumb_func_end sub_812E0B0 + + thumb_func_start nullsub_51 +nullsub_51: @ 812E0E0 + bx lr + thumb_func_end nullsub_51 + + thumb_func_start sub_812E0E4 +sub_812E0E4: @ 812E0E4 + push {r4-r7,lr} + movs r6, 0 + movs r0, 0x30 +_0812E0EA: + movs r4, 0 + lsls r5, r0, 16 + lsls r7, r6, 16 +_0812E0F0: + ldr r0, =gUnknown_085A7CE0 + asrs r1, r5, 16 + movs r2, 0 + movs r3, 0xE + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + ldrb r0, [r1, 0x5] + movs r2, 0xC + orrs r0, r2 + strb r0, [r1, 0x5] + strh r6, [r1, 0x2E] + strh r4, [r1, 0x30] + ldr r0, =0x0000ffff + strh r0, [r1, 0x34] + lsls r0, r4, 16 + movs r1, 0xC0 + lsls r1, 13 + adds r0, r1 + lsrs r4, r0, 16 + asrs r0, 16 + cmp r0, 0x77 + ble _0812E0F0 + movs r2, 0x80 + lsls r2, 9 + adds r1, r7, r2 + movs r2, 0xA0 + lsls r2, 14 + adds r0, r5, r2 + lsrs r0, 16 + lsrs r6, r1, 16 + asrs r1, 16 + cmp r1, 0x2 + ble _0812E0EA + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812E0E4 + + thumb_func_start sub_812E154 +sub_812E154: @ 812E154 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, =0x0203ab34 + ldr r4, [r0] + movs r1, 0x2E + ldrsh r0, [r5, r1] + lsls r0, 1 + adds r1, r4, 0 + adds r1, 0x1C + adds r1, r0 + ldrh r0, [r5, 0x30] + ldrh r1, [r1] + adds r0, r1 + strh r0, [r5, 0x32] + movs r2, 0x32 + ldrsh r0, [r5, r2] + movs r1, 0x78 + bl __modsi3 + strh r0, [r5, 0x32] + movs r2, 0x2E + ldrsh r1, [r5, r2] + lsls r1, 1 + adds r4, 0x22 + adds r4, r1 + ldrh r1, [r4] + adds r1, 0x1C + adds r0, r1 + strh r0, [r5, 0x22] + ldrh r4, [r5, 0x2E] + lsls r4, 24 + lsrs r4, 24 + movs r1, 0x32 + ldrsh r0, [r5, r1] + movs r1, 0x18 + bl __divsi3 + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_812BC44 + lsls r0, 24 + lsrs r0, 24 + bl GetObjectTileRangeStartByTag + adds r1, r5, 0 + adds r1, 0x40 + strh r0, [r1] + adds r0, r5, 0 + bl sub_8008324 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812E154 + + thumb_func_start sub_812E1C8 +sub_812E1C8: @ 812E1C8 + push {r4-r6,lr} + movs r4, 0xCB + movs r5, 0x1 + ldr r6, =0x0000270f +_0812E1D0: + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r0, r4, 0 + movs r1, 0x17 + movs r2, 0 + adds r3, r5, 0 + bl sub_812E230 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 17 + subs r4, 0x7 + lsls r4, 16 + lsrs r4, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, r6 + ble _0812E1D0 + movs r4, 0xEB + movs r5, 0x1 + ldr r6, =0x0000270f +_0812E1FE: + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + adds r0, r4, 0 + movs r1, 0x17 + movs r2, 0x1 + adds r3, r5, 0 + bl sub_812E230 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 17 + subs r4, 0x7 + lsls r4, 16 + lsrs r4, 16 + lsrs r5, r0, 16 + asrs r0, 16 + cmp r0, r6 + ble _0812E1FE + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812E1C8 + + thumb_func_start sub_812E230 +sub_812E230: @ 812E230 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r5, r0, 0 + adds r6, r1, 0 + mov r8, r2 + adds r4, r3, 0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r4, 16 + lsrs r4, 16 + ldr r0, =gUnknown_085A7CF8 + lsls r5, 16 + asrs r5, 16 + lsls r6, 16 + asrs r6, 16 + adds r1, r5, 0 + adds r2, r6, 0 + movs r3, 0xD + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x02020630 + adds r2, r0 + ldrb r1, [r2, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r1 + movs r1, 0x8 + orrs r0, r1 + strb r0, [r2, 0x5] + mov r0, r8 + strh r0, [r2, 0x2E] + strh r4, [r2, 0x30] + lsls r4, 16 + asrs r4, 16 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 1 + strh r0, [r2, 0x32] + ldr r0, =0x0000ffff + strh r0, [r2, 0x34] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812E230 + + thumb_func_start sub_812E2A8 +sub_812E2A8: @ 812E2A8 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0203ab34 + ldr r1, [r0] + ldrh r2, [r1, 0xC] + movs r3, 0x2E + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _0812E2BC + ldrh r2, [r1, 0xE] +_0812E2BC: + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, r2 + beq _0812E2F6 + strh r2, [r4, 0x34] + ldrh r1, [r4, 0x32] + adds r0, r2, 0 + bl __umodsi3 + lsls r0, 16 + lsrs r2, r0, 16 + ldrh r1, [r4, 0x30] + adds r0, r2, 0 + bl __udivsi3 + lsls r0, 16 + movs r3, 0xE0 + lsls r3, 11 + adds r0, r3 + lsrs r2, r0, 16 + adds r0, r2, 0 + bl GetObjectTileRangeStartByTag + adds r1, r4, 0 + adds r1, 0x40 + strh r0, [r1] + adds r0, r4, 0 + bl sub_8008324 +_0812E2F6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812E2A8 + + thumb_func_start sub_812E300 +sub_812E300: @ 812E300 + push {lr} + ldr r0, =gUnknown_085A7D10 + movs r1, 0x58 + movs r2, 0x48 + movs r3, 0xF + bl AddObjectToFront + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0x02020630 + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x5] + movs r2, 0xC + orrs r1, r2 + strb r1, [r0, 0x5] + ldr r1, =gUnknown_085A7FC0 + bl SetSpriteOamTables_NoPriorityFromTable + pop {r0} + bx r0 + .pool + thumb_func_end sub_812E300 + + thumb_func_start sub_812E33C +sub_812E33C: @ 812E33C + push {r4,r5,lr} + sub sp, 0x18 + ldr r4, =0x0203aae4 + ldr r0, [r4] + cmp r0, 0 + bne _0812E350 + movs r0, 0x28 + bl AllocZeroed + str r0, [r4] +_0812E350: + ldr r2, [r4] + ldr r0, =0x0203aad8 + ldr r1, [r0] + str r1, [r2] + movs r3, 0x80 + lsls r3, 4 + strh r3, [r2, 0x4] + adds r0, r1, r3 + str r0, [r2, 0x8] + strh r3, [r2, 0xC] + movs r4, 0x80 + lsls r4, 5 + adds r0, r1, r4 + str r0, [r2, 0x10] + strh r3, [r2, 0x14] + movs r5, 0xC0 + lsls r5, 5 + adds r0, r1, r5 + str r0, [r2, 0x18] + strh r3, [r2, 0x1C] + movs r0, 0x80 + lsls r0, 6 + adds r1, r0 + str r1, [r2, 0x20] + strh r3, [r2, 0x24] + mov r1, sp + ldr r0, =gUnknown_085A7D28 + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + str r2, [sp, 0xC] + movs r1, 0x8C + lsls r1, 1 + mov r0, sp + movs r2, 0x50 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + ldrb r3, [r2, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r3 + movs r3, 0x4 + orrs r1, r3 + strb r1, [r2, 0x5] + adds r2, 0x3E + ldrb r1, [r2] + movs r3, 0x2 + orrs r1, r3 + strb r1, [r2] + ldr r1, =0x0203ab34 + ldr r1, [r1] + adds r1, 0x3F + strb r0, [r1] + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812E33C + + thumb_func_start sub_812E3E8 +sub_812E3E8: @ 812E3E8 + push {r4,lr} + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x3F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + ldr r4, =0x0203aae4 + ldr r0, [r4] + cmp r0, 0 + beq _0812E410 + bl Free + movs r0, 0 + str r0, [r4] +_0812E410: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812E3E8 + + thumb_func_start sub_812E424 +sub_812E424: @ 812E424 + push {lr} + adds r2, r0, 0 + movs r0, 0 + strh r0, [r2, 0x24] + strh r0, [r2, 0x26] + adds r0, r2, 0 + adds r0, 0x2A + ldrb r0, [r0] + cmp r0, 0x4 + bne _0812E46A + movs r0, 0x8 + strh r0, [r2, 0x24] + strh r0, [r2, 0x26] + adds r0, r2, 0 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0 + beq _0812E458 + adds r0, r2, 0 + adds r0, 0x2C + ldrb r1, [r0] + movs r0, 0x3F + ands r0, r1 + cmp r0, 0 + bne _0812E466 + b _0812E46A +_0812E458: + adds r0, r2, 0 + adds r0, 0x2C + ldrb r1, [r0] + movs r0, 0x3F + ands r0, r1 + cmp r0, 0 + bne _0812E46A +_0812E466: + ldr r0, =0x0000fff8 + strh r0, [r2, 0x26] +_0812E46A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_812E424 + + thumb_func_start sub_812E474 +sub_812E474: @ 812E474 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + ldr r4, =0x0203aae8 + ldr r0, [r4] + cmp r0, 0 + bne _0812E490 + movs r0, 0x8 + bl AllocZeroed + str r0, [r4] +_0812E490: + ldr r2, [r4] + ldr r0, =0x0203aad8 + mov r10, r0 + ldr r0, [r0] + movs r1, 0xA0 + lsls r1, 6 + adds r0, r1 + str r0, [r2] + movs r0, 0xC0 + lsls r0, 2 + strh r0, [r2, 0x4] + mov r1, sp + ldr r0, =gUnknown_085A7D40 + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldm r0!, {r3,r4,r7} + stm r1!, {r3,r4,r7} + str r2, [sp, 0xC] + mov r0, sp + movs r1, 0xB8 + lsls r1, 1 + movs r2, 0x34 + movs r3, 0x7 + bl AddObjectToFront + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r5, =0x02020630 + mov r9, r5 + adds r2, r0, r5 + ldrb r1, [r2, 0x5] + movs r7, 0xD + negs r7, r7 + mov r8, r7 + mov r0, r8 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x5] + adds r1, r2, 0 + adds r1, 0x3E + ldrb r0, [r1] + movs r6, 0x2 + orrs r0, r6 + strb r0, [r1] + ldr r1, =gUnknown_085A7FE0 + adds r0, r2, 0 + bl SetSpriteOamTables_NoPriorityFromTable + ldr r5, =0x0203ab34 + ldr r0, [r5] + adds r0, 0x49 + strb r4, [r0] + ldr r4, =0x0203aaec + ldr r0, [r4] + cmp r0, 0 + bne _0812E510 + movs r0, 0x8 + bl AllocZeroed + str r0, [r4] +_0812E510: + ldr r2, [r4] + mov r3, r10 + ldr r0, [r3] + movs r4, 0xAC + lsls r4, 6 + adds r0, r4 + str r0, [r2] + movs r0, 0xA0 + lsls r0, 3 + strh r0, [r2, 0x4] + mov r1, sp + ldr r0, =gUnknown_085A7D58 + ldm r0!, {r3,r4,r7} + stm r1!, {r3,r4,r7} + ldm r0!, {r3,r4,r7} + stm r1!, {r3,r4,r7} + str r2, [sp, 0xC] + mov r0, sp + movs r1, 0xB8 + lsls r1, 1 + movs r2, 0x54 + movs r3, 0x7 + bl AddObjectToFront + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + mov r7, r9 + adds r2, r0, r7 + ldrb r1, [r2, 0x5] + mov r0, r8 + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2, 0x5] + adds r1, r2, 0 + adds r1, 0x3E + ldrb r0, [r1] + orrs r0, r6 + strb r0, [r1] + ldr r1, =gUnknown_085A7FF4 + adds r0, r2, 0 + bl SetSpriteOamTables_NoPriorityFromTable + ldr r0, [r5] + adds r0, 0x4A + strb r4, [r0] + 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_812E474 + + thumb_func_start sub_812E5A8 +sub_812E5A8: @ 812E5A8 + push {r4,r5,lr} + sub sp, 0x18 + ldr r4, =0x0203aaf0 + ldr r0, [r4] + cmp r0, 0 + bne _0812E5BC + movs r0, 0x8 + bl AllocZeroed + str r0, [r4] +_0812E5BC: + ldr r2, [r4] + ldr r0, =0x0203aad8 + ldr r0, [r0] + movs r1, 0xC0 + lsls r1, 6 + adds r0, r1 + str r0, [r2] + movs r0, 0xC0 + lsls r0, 3 + strh r0, [r2, 0x4] + mov r1, sp + ldr r0, =gUnknown_085A7D70 + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + str r2, [sp, 0xC] + ldr r0, =0x02021bbc + ldrh r0, [r0] + movs r1, 0xA8 + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + mov r0, sp + movs r2, 0x50 + movs r3, 0x7 + bl AddObjectToFront + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0, 0x5] + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r3] + ldr r1, =gUnknown_085A8010 + bl SetSpriteOamTables_NoPriorityFromTable + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x42 + strb r4, [r0] + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812E5A8 + + thumb_func_start sub_812E650 +sub_812E650: @ 812E650 + push {r4-r6,lr} + movs r4, 0 + movs r5, 0 +_0812E656: + ldr r0, =gUnknown_085A7D88 + movs r1, 0xB8 + lsls r1, 1 + movs r2, 0 + movs r3, 0xA + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + ldr r1, =0x02020630 + adds r3, r1 + ldrb r2, [r3, 0x5] + movs r6, 0xD + negs r6, r6 + adds r1, r6, 0 + ands r2, r1 + movs r1, 0x4 + orrs r2, r1 + strb r2, [r3, 0x5] + movs r1, 0x3E + adds r1, r3 + mov r12, r1 + ldrb r1, [r1] + movs r2, 0x2 + orrs r1, r2 + mov r2, r12 + strb r1, [r2] + strh r5, [r3, 0x3C] + ldr r1, =0x0203ab34 + ldr r1, [r1] + adds r1, 0x4B + adds r1, r4 + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r5, 16 + movs r6, 0xA0 + lsls r6, 13 + adds r0, r6 + lsrs r5, r0, 16 + cmp r4, 0x2 + bls _0812E656 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812E650 + + thumb_func_start sub_812E6C4 +sub_812E6C4: @ 812E6C4 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x0203ab34 + ldr r1, [r0] + ldrh r0, [r4, 0x3C] + ldrh r1, [r1, 0x14] + adds r0, r1 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x28 + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + adds r1, r0, 0 + adds r1, 0x3B + strh r1, [r4, 0x22] + movs r1, 0x14 + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + bl sub_812BCE8 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnimIfDifferent + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812E6C4 + + thumb_func_start sub_812E70C +sub_812E70C: @ 812E70C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r1, 0xB8 + lsls r1, 1 + ldr r0, =gUnknown_085A7DA0 + movs r2, 0x64 + movs r3, 0x9 + bl AddObjectToFront + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r7, =0x02020630 + adds r2, r0, r7 + adds r1, r2, 0 + adds r1, 0x3E + ldrb r0, [r1] + movs r3, 0x2 + mov r10, r3 + mov r3, r10 + orrs r0, r3 + strb r0, [r1] + ldrb r1, [r2, 0x5] + movs r5, 0xD + negs r5, r5 + adds r0, r5, 0 + ands r0, r1 + movs r1, 0x4 + mov r8, r1 + mov r3, r8 + orrs r0, r3 + strb r0, [r2, 0x5] + ldr r0, =gUnknown_085A8028 + mov r9, r0 + adds r0, r2, 0 + mov r1, r9 + bl SetSpriteOamTables_NoPriorityFromTable + ldr r6, =0x0203ab34 + ldr r0, [r6] + adds r0, 0x4E + strb r4, [r0] + movs r1, 0x90 + lsls r1, 1 + ldr r0, =gUnknown_085A7DA0 + movs r2, 0x68 + movs r3, 0x4 + bl AddObjectToFront + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r2, r0, r7 + adds r1, r2, 0 + adds r1, 0x3E + ldrb r0, [r1] + mov r3, r10 + orrs r0, r3 + strb r0, [r1] + ldrb r0, [r2, 0x5] + ands r5, r0 + mov r0, r8 + orrs r5, r0 + strb r5, [r2, 0x5] + adds r0, r2, 0 + mov r1, r9 + bl SetSpriteOamTables_NoPriorityFromTable + ldr r0, [r6] + adds r0, 0x4F + strb r4, [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_812E70C + + thumb_func_start sub_812E7CC +sub_812E7CC: @ 812E7CC + push {r4,lr} + ldr r0, =gUnknown_085A7DB8 + movs r1, 0xB8 + lsls r1, 1 + movs r2, 0x4C + movs r3, 0xB + bl AddObjectToFront + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + adds r3, r0, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r3] + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0, 0x5] + ldr r1, =gUnknown_085A803C + bl SetSpriteOamTables_NoPriorityFromTable + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x40 + strb r4, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812E7CC + + thumb_func_start sub_812E82C +sub_812E82C: @ 812E82C + push {r4,lr} + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x40 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + movs r4, 0 +_0812E846: + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x49 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0812E846 + ldr r4, =0x0203aae8 + ldr r0, [r4] + cmp r0, 0 + beq _0812E878 + bl Free + movs r0, 0 + str r0, [r4] +_0812E878: + ldr r4, =0x0203aaec + ldr r0, [r4] + cmp r0, 0 + beq _0812E888 + bl Free + movs r0, 0 + str r0, [r4] +_0812E888: + movs r4, 0 +_0812E88A: + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x4B + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _0812E88A + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812E82C + + thumb_func_start sub_812E8C4 +sub_812E8C4: @ 812E8C4 + push {r4,lr} + movs r4, 0 +_0812E8C8: + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x4E + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0812E8C8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812E8C4 + + thumb_func_start sub_812E8F8 +sub_812E8F8: @ 812E8F8 + push {r4,lr} + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x42 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + ldr r4, =0x0203aaf0 + ldr r0, [r4] + cmp r0, 0 + beq _0812E920 + bl Free + movs r0, 0 + str r0, [r4] +_0812E920: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812E8F8 + + thumb_func_start sub_812E934 +sub_812E934: @ 812E934 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + ldr r0, =gUnknown_085A7DD0 + mov r10, r0 + movs r1, 0x98 + movs r2, 0x20 + movs r3, 0x5 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r2, =0x02020630 + mov r9, r2 + adds r3, r1, r2 + ldrb r2, [r3, 0x5] + movs r4, 0xD + negs r4, r4 + adds r1, r4, 0 + ands r1, r2 + movs r2, 0x4 + mov r8, r2 + mov r2, r8 + orrs r1, r2 + strb r1, [r3, 0x5] + adds r5, r3, 0 + adds r5, 0x3F + ldrb r1, [r5] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r5] + ldr r6, =0x0203ab34 + ldr r1, [r6] + adds r1, 0x50 + strb r0, [r1] + movs r0, 0x8 + strh r0, [r3, 0x2E] + ldr r0, =0x0000ffff + strh r0, [r3, 0x30] + movs r0, 0x1 + negs r0, r0 + strh r0, [r3, 0x32] + movs r5, 0x20 + strh r5, [r3, 0x3C] + mov r0, r10 + movs r1, 0xB8 + movs r2, 0x20 + movs r3, 0x5 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + mov r2, r9 + adds r3, r1, r2 + ldrb r1, [r3, 0x5] + ands r4, r1 + mov r1, r8 + orrs r4, r1 + strb r4, [r3, 0x5] + ldr r1, [r6] + adds r1, 0x51 + strb r0, [r1] + movs r0, 0x1 + strh r0, [r3, 0x30] + subs r0, 0x2 + strh r0, [r3, 0x32] + strh r5, [r3, 0x3C] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812E934 + + thumb_func_start sub_812E9E8 +sub_812E9E8: @ 812E9E8 + push {r4,lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + movs r1, 0x2E + ldrsh r4, [r2, r1] + cmp r4, 0 + beq _0812EA0C + subs r0, 0x1 + movs r1, 0 + strh r0, [r2, 0x2E] + strh r1, [r2, 0x24] + strh r1, [r2, 0x26] + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + b _0812EA3E +_0812EA0C: + adds r3, r2, 0 + adds r3, 0x3E + ldrb r1, [r3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r3] + ldrh r0, [r2, 0x30] + ldrh r1, [r2, 0x24] + adds r0, r1 + strh r0, [r2, 0x24] + ldrh r0, [r2, 0x32] + ldrh r1, [r2, 0x26] + adds r0, r1 + strh r0, [r2, 0x26] + ldrh r0, [r2, 0x34] + adds r0, 0x1 + strh r0, [r2, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _0812EA3E + ldrh r0, [r2, 0x3C] + strh r0, [r2, 0x2E] + strh r4, [r2, 0x34] +_0812EA3E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812E9E8 + + thumb_func_start sub_812EA44 +sub_812EA44: @ 812EA44 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r4, =0x02020630 + ldr r1, =0x0203ab34 + ldr r3, [r1] + adds r1, r3, 0 + adds r1, 0x50 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + strh r0, [r1, 0x3C] + adds r3, 0x51 + ldrb r2, [r3] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + strh r0, [r1, 0x3C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812EA44 + + thumb_func_start sub_812EA7C +sub_812EA7C: @ 812EA7C + push {r4,lr} + movs r4, 0 +_0812EA80: + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x50 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0812EA80 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812EA7C + + thumb_func_start sub_812EAB0 +sub_812EAB0: @ 812EAB0 + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + ldr r0, =gUnknown_085A7DE8 + mov r8, r0 + movs r1, 0x48 + movs r2, 0x50 + movs r3, 0x3 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02020630 + mov r9, r1 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r9 + ldrb r3, [r2, 0x5] + movs r4, 0xD + negs r4, r4 + adds r1, r4, 0 + ands r1, r3 + movs r6, 0x4 + orrs r1, r6 + strb r1, [r2, 0x5] + movs r3, 0 + movs r1, 0x1 + strh r1, [r2, 0x2E] + strh r3, [r2, 0x38] + movs r1, 0x10 + strh r1, [r2, 0x3A] + movs r1, 0x8 + strh r1, [r2, 0x3C] + ldr r5, =0x0203ab34 + ldr r1, [r5] + adds r1, 0x52 + strb r0, [r1] + mov r0, r8 + movs r1, 0x68 + movs r2, 0x50 + movs r3, 0x3 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r9 + ldrb r2, [r1, 0x5] + ands r4, r2 + orrs r4, r6 + strb r4, [r1, 0x5] + adds r1, 0x3F + ldrb r2, [r1] + movs r3, 0x1 + orrs r2, r3 + strb r2, [r1] + ldr r1, [r5] + adds r1, 0x53 + strb r0, [r1] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812EAB0 + + thumb_func_start sub_812EB48 +sub_812EB48: @ 812EB48 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r1, =gUnknown_085A7614 + mov r0, sp + movs r2, 0x2 + bl memcpy + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0812EB9A + ldrh r0, [r4, 0x3A] + subs r0, 0x1 + strh r0, [r4, 0x3A] + lsls r0, 16 + cmp r0, 0 + bgt _0812EB9A + movs r0, 0x7 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 4 + ldr r2, =0x01030000 + adds r0, r2 + lsrs r0, 16 + movs r2, 0x38 + ldrsh r1, [r4, r2] + add r1, sp + ldrb r3, [r1] + adds r1, r3, 0 + adds r2, r3, 0 + bl sub_80B609C + ldrh r0, [r4, 0x38] + adds r0, 0x1 + movs r1, 0x1 + ands r0, r1 + strh r0, [r4, 0x38] + ldrh r0, [r4, 0x3C] + strh r0, [r4, 0x3A] +_0812EB9A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812EB48 + + thumb_func_start sub_812EBAC +sub_812EBAC: @ 812EBAC + ldr r3, =0x02020630 + ldr r1, =0x0203ab34 + ldr r1, [r1] + adds r1, 0x52 + ldrb r2, [r1] + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r3 + strh r0, [r1, 0x3C] + bx lr + .pool + thumb_func_end sub_812EBAC + + thumb_func_start sub_812EBCC +sub_812EBCC: @ 812EBCC + push {r4,lr} + movs r0, 0x7 + bl IndexOfObjectPaletteTag + lsls r0, 24 + lsrs r0, 4 + ldr r1, =0x01030000 + adds r0, r1 + lsrs r0, 16 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80B609C + movs r4, 0 +_0812EBEA: + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x52 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bls _0812EBEA + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812EBCC + + thumb_func_start sub_812EC20 +sub_812EC20: @ 812EC20 + push {lr} + ldr r0, =gUnknown_085A7E00 + movs r1, 0xA8 + movs r2, 0x50 + movs r3, 0x6 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02020630 + 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, 0x4 + orrs r2, r3 + strb r2, [r1, 0x5] + ldr r1, =0x0203ab34 + ldr r1, [r1] + adds r1, 0x41 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_812EC20 + + thumb_func_start sub_812EC64 +sub_812EC64: @ 812EC64 + ldr r1, =0x02021bbe + ldrh r1, [r1] + strh r1, [r0, 0x26] + bx lr + .pool + thumb_func_end sub_812EC64 + + thumb_func_start sub_812EC70 +sub_812EC70: @ 812EC70 + push {lr} + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x41 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + pop {r0} + bx r0 + .pool + thumb_func_end sub_812EC70 + + thumb_func_start sub_812EC94 +sub_812EC94: @ 812EC94 + push {r4,r5,lr} + sub sp, 0x8 + ldr r1, =gUnknown_085A7616 + mov r0, sp + movs r2, 0x8 + bl memcpy + movs r4, 0 +_0812ECA4: + ldr r0, =0x02021bbc + ldrh r0, [r0] + movs r1, 0x50 + subs r1, r0 + lsls r1, 16 + asrs r1, 16 + ldr r0, =gUnknown_085A7E18 + movs r2, 0x44 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r3, r0, 4 + adds r3, r0 + lsls r3, 2 + ldr r1, =0x02020630 + adds r3, r1 + ldrb r2, [r3, 0x5] + movs r5, 0xD + negs r5, r5 + adds r1, r5, 0 + ands r2, r1 + movs r1, 0x4 + orrs r2, r1 + strb r2, [r3, 0x5] + movs r1, 0x3E + adds r1, r3 + mov r12, r1 + ldrb r1, [r1] + movs r2, 0x2 + orrs r1, r2 + mov r2, r12 + strb r1, [r2] + lsls r1, r4, 1 + add r1, sp + ldrh r1, [r1] + strh r1, [r3, 0x2E] + ldr r1, =0x0203ab34 + ldr r1, [r1] + adds r1, 0x54 + adds r1, r4 + strb r0, [r1] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _0812ECA4 + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812EC94 + + thumb_func_start sub_812ED20 +sub_812ED20: @ 812ED20 + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x2E] + subs r0, 0x2 + movs r4, 0 + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x2E] + movs r1, 0x2E + ldrsh r0, [r5, r1] + movs r1, 0x14 + bl cosine + strh r0, [r5, 0x24] + movs r2, 0x2E + ldrsh r0, [r5, r2] + movs r1, 0x6 + bl sine + strh r0, [r5, 0x26] + adds r1, r5, 0 + adds r1, 0x43 + strb r4, [r1] + movs r2, 0x2E + ldrsh r0, [r5, r2] + cmp r0, 0x7F + ble _0812ED5A + movs r0, 0x2 + strb r0, [r1] +_0812ED5A: + ldrh r0, [r5, 0x30] + adds r0, 0x1 + strh r0, [r5, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + ble _0812ED84 + adds r3, r5, 0 + adds r3, 0x3F + ldrb r2, [r3] + lsls r0, r2, 31 + lsrs r0, 31 + movs r1, 0x1 + eors r1, r0 + movs r0, 0x2 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0 + strh r0, [r5, 0x30] +_0812ED84: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_812ED20 + + thumb_func_start sub_812ED8C +sub_812ED8C: @ 812ED8C + push {r4,lr} + movs r4, 0 +_0812ED90: + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x54 + adds r0, r4 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + bl RemoveObjectAndFreeTiles + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _0812ED90 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812ED8C + + thumb_func_start sub_812EDC0 +sub_812EDC0: @ 812EDC0 + push {r4,lr} + ldr r0, =gUnknown_085A7E30 + movs r1, 0xA8 + movs r2, 0x3C + movs r3, 0x8 + bl AddObjectToFront + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0, 0x5] + ldrb r1, [r0, 0x1] + movs r2, 0x3 + orrs r1, r2 + strb r1, [r0, 0x1] + bl obj_alloc_rotscale_entry + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x43 + strb r4, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812EDC0 + + thumb_func_start sub_812EE14 +sub_812EE14: @ 812EE14 + push {lr} + adds r3, r0, 0 + ldrh r2, [r3, 0x2E] + movs r1, 0x2E + ldrsh r0, [r3, r1] + cmp r0, 0 + bne _0812EE36 + adds r0, r3, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0812EE90 + adds r0, r2, 0x1 + strh r0, [r3, 0x2E] + b _0812EE90 +_0812EE36: + cmp r0, 0x1 + bne _0812EE72 + movs r0, 0x3E + adds r0, r3 + mov r12, r0 + ldrb r2, [r0] + 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 + mov r1, r12 + strb r0, [r1] + ldrh r0, [r3, 0x32] + adds r0, 0x1 + strh r0, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x17 + ble _0812EE90 + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + movs r0, 0 + strh r0, [r3, 0x32] + b _0812EE90 +_0812EE72: + adds r2, r3, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r3, 0x32] + adds r0, 0x1 + strh r0, [r3, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + ble _0812EE90 + movs r0, 0x1 + strh r0, [r3, 0x3C] +_0812EE90: + ldrh r0, [r3, 0x30] + movs r1, 0xFF + ands r1, r0 + adds r1, 0x10 + strh r1, [r3, 0x30] + lsrs r1, 8 + ldrh r0, [r3, 0x26] + subs r0, r1 + strh r0, [r3, 0x26] + pop {r0} + bx r0 + thumb_func_end sub_812EE14 + + thumb_func_start sub_812EEA8 +sub_812EEA8: @ 812EEA8 + ldr r2, =0x02020630 + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x43 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x3C] + lsls r0, 24 + lsrs r0, 24 + bx lr + .pool + thumb_func_end sub_812EEA8 + + thumb_func_start sub_812EECC +sub_812EECC: @ 812EECC + push {r4,lr} + ldr r0, =0x0203ab34 + ldr r0, [r0] + adds r0, 0x43 + ldrb r0, [r0] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812EECC + + thumb_func_start sub_812EF00 +sub_812EF00: @ 812EF00 + push {r4,lr} + adds r3, r0, 0 + adds r2, r1, 0 + ldr r0, =gUnknown_085A7F98 + lsls r3, 16 + asrs r3, 16 + lsls r2, 16 + asrs r2, 16 + adds r1, r3, 0 + movs r3, 0xC + bl AddObjectToFront + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0, 0x5] + ldrb r1, [r0, 0x1] + movs r2, 0x3 + orrs r1, r2 + strb r1, [r0, 0x1] + bl obj_alloc_rotscale_entry + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812EF00 + + thumb_func_start sub_812EF54 +sub_812EF54: @ 812EF54 + push {lr} + adds r2, r0, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0812EF68 + movs r0, 0x1 + strh r0, [r2, 0x3C] +_0812EF68: + pop {r0} + bx r0 + thumb_func_end sub_812EF54 + + thumb_func_start sub_812EF6C +sub_812EF6C: @ 812EF6C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812EF6C + + thumb_func_start sub_812EF98 +sub_812EF98: @ 812EF98 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + ldr r3, =gUnknown_085A78C8 + lsrs r1, 22 + adds r3, r1, r3 + ldr r5, [r3] + ldr r3, =gUnknown_085A783A + adds r4, r1, r3 + movs r6, 0 + ldrsh r4, [r4, r6] + adds r3, 0x2 + adds r1, r3 + movs r6, 0 + ldrsh r3, [r1, r6] + lsls r2, 16 + asrs r2, 16 + str r2, [sp] + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_812EFDC + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812EF98 + + thumb_func_start sub_812EFDC +sub_812EFDC: @ 812EFDC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + adds r4, r0, 0 + mov r8, r1 + adds r1, r2, 0 + adds r2, r3, 0 + ldr r5, [sp, 0x34] + lsls r4, 24 + lsls r5, 16 + lsrs r5, 16 + mov r9, r5 + ldr r0, =gUnknown_085A8264 + lsrs r4, 22 + adds r0, r4, r0 + mov r3, sp + ldr r0, [r0] + ldm r0!, {r5-r7} + stm r3!, {r5-r7} + ldm r0!, {r5-r7} + stm r3!, {r5-r7} + ldr r0, =0x03001188 + adds r0, r4, r0 + ldr r0, [r0] + str r0, [sp, 0xC] + lsls r1, 16 + asrs r1, 16 + lsls r2, 16 + asrs r2, 16 + mov r0, sp + movs r3, 0x10 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, =0x02020630 + adds r2, r0, r1 + ldrb r0, [r2, 0x5] + movs r1, 0xC + orrs r0, r1 + strb r0, [r2, 0x5] + mov r0, r8 + str r0, [r2, 0x1C] + mov r5, r9 + strh r5, [r2, 0x3A] + movs r0, 0x1 + strh r0, [r2, 0x3C] + ldr r0, =gUnknown_085A82CC + adds r4, r0 + ldr r1, [r4] + cmp r1, 0 + beq _0812F056 + adds r0, r2, 0 + bl SetSpriteOamTables_NoPriorityFromTable +_0812F056: + adds r0, r7, 0 + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_812EFDC + + thumb_func_start sub_812F078 +sub_812F078: @ 812F078 + movs r1, 0 + strh r1, [r0, 0x3C] + bx lr + thumb_func_end sub_812F078 + + thumb_func_start sub_812F080 +sub_812F080: @ 812F080 + push {r4,r5,lr} + sub sp, 0x10 + adds r4, r0, 0 + ldr r1, =gUnknown_085A761E + mov r0, sp + movs r2, 0x8 + bl memcpy + add r5, sp, 0x8 + ldr r1, =gUnknown_085A7626 + adds r0, r5, 0 + movs r2, 0x8 + bl memcpy + ldrh r0, [r4, 0x30] + adds r1, r0, 0x1 + strh r1, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + ble _0812F0C6 + adds r3, r4, 0 + adds r3, 0x42 + ldrb r2, [r3] + lsls r0, r2, 26 + lsrs r0, 26 + movs r1, 0x1 + eors r1, r0 + movs r0, 0x40 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r3] + movs r0, 0 + strh r0, [r4, 0x30] +_0812F0C6: + movs r0, 0 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + adds r0, r4, 0 + adds r0, 0x42 + ldrb r1, [r0] + movs r0, 0x3F + ands r0, r1 + cmp r0, 0 + beq _0812F0F2 + movs r1, 0x3A + ldrsh r0, [r4, r1] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + strh r0, [r4, 0x24] + movs r1, 0x3A + ldrsh r0, [r4, r1] + lsls r0, 1 + adds r0, r5, r0 + ldrh r0, [r0] + strh r0, [r4, 0x26] +_0812F0F2: + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812F080 + + thumb_func_start sub_812F104 +sub_812F104: @ 812F104 + push {lr} + adds r3, r0, 0 + adds r3, 0x3F + ldrb r1, [r3] + movs r2, 0x1 + orrs r1, r2 + strb r1, [r3] + bl sub_812F080 + pop {r0} + bx r0 + thumb_func_end sub_812F104 + + thumb_func_start sub_812F11C +sub_812F11C: @ 812F11C + push {lr} + adds r3, r0, 0 + adds r3, 0x3F + ldrb r1, [r3] + movs r2, 0x2 + orrs r1, r2 + strb r1, [r3] + bl sub_812F080 + pop {r0} + bx r0 + thumb_func_end sub_812F11C + + thumb_func_start sub_812F134 +sub_812F134: @ 812F134 + push {lr} + adds r3, r0, 0 + adds r3, 0x3F + ldrb r1, [r3] + movs r2, 0x1 + orrs r1, r2 + movs r2, 0x2 + orrs r1, r2 + strb r1, [r3] + bl sub_812F080 + pop {r0} + bx r0 + thumb_func_end sub_812F134 + + thumb_func_start sub_812F150 +sub_812F150: @ 812F150 + push {lr} + adds r2, r0, 0 + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0x1 + beq _0812F184 + cmp r0, 0x1 + bgt _0812F166 + cmp r0, 0 + beq _0812F170 + b _0812F1B4 +_0812F166: + cmp r0, 0x2 + beq _0812F194 + cmp r0, 0x3 + beq _0812F1B0 + b _0812F1B4 +_0812F170: + ldrh r0, [r2, 0x20] + adds r0, 0x4 + strh r0, [r2, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xCF + ble _0812F1B4 + movs r0, 0xD0 + strh r0, [r2, 0x20] + b _0812F1A2 +_0812F184: + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5A + ble _0812F1B4 + b _0812F1A2 +_0812F194: + ldrh r0, [r2, 0x20] + adds r0, 0x4 + strh r0, [r2, 0x20] + lsls r0, 16 + ldr r1, =0x010f0000 + cmp r0, r1 + ble _0812F1B4 +_0812F1A2: + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + b _0812F1B4 + .pool +_0812F1B0: + movs r0, 0 + strh r0, [r2, 0x3C] +_0812F1B4: + pop {r0} + bx r0 + thumb_func_end sub_812F150 + + thumb_func_start sub_812F1B8 +sub_812F1B8: @ 812F1B8 + push {lr} + adds r1, r0, 0 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0x1 + beq _0812F1EC + cmp r0, 0x1 + bgt _0812F1CE + cmp r0, 0 + beq _0812F1D8 + b _0812F216 +_0812F1CE: + cmp r0, 0x2 + beq _0812F1FC + cmp r0, 0x3 + beq _0812F212 + b _0812F216 +_0812F1D8: + ldrh r0, [r1, 0x20] + subs r0, 0x4 + strh r0, [r1, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD0 + bgt _0812F216 + movs r0, 0xD0 + strh r0, [r1, 0x20] + b _0812F20A +_0812F1EC: + ldrh r0, [r1, 0x30] + adds r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5A + ble _0812F216 + b _0812F20A +_0812F1FC: + ldrh r0, [r1, 0x20] + subs r0, 0x4 + strh r0, [r1, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x90 + bgt _0812F216 +_0812F20A: + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + b _0812F216 +_0812F212: + movs r0, 0 + strh r0, [r1, 0x3C] +_0812F216: + pop {r0} + bx r0 + thumb_func_end sub_812F1B8 + + thumb_func_start sub_812F21C +sub_812F21C: @ 812F21C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x5 + bhi _0812F2C6 + lsls r0, 2 + ldr r1, =_0812F238 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0812F238: + .4byte _0812F250 + .4byte _0812F268 + .4byte _0812F288 + .4byte _0812F29C + .4byte _0812F2AC + .4byte _0812F2C2 +_0812F250: + ldr r0, =0x0203ab34 + ldr r0, [r0] + ldrb r1, [r0, 0xA] + subs r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl StartObjectImageAnim + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_0812F268: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _0812F2C6 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0 + strh r0, [r4, 0x30] + b _0812F2C6 + .pool +_0812F288: + ldrh r0, [r4, 0x20] + adds r0, 0x4 + strh r0, [r4, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xCF + ble _0812F2C6 + movs r0, 0xD0 + strh r0, [r4, 0x20] + b _0812F2BA +_0812F29C: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5A + ble _0812F2C6 + b _0812F2BA +_0812F2AC: + ldrh r0, [r4, 0x20] + adds r0, 0x4 + strh r0, [r4, 0x20] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF7 + ble _0812F2C6 +_0812F2BA: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + b _0812F2C6 +_0812F2C2: + movs r0, 0 + strh r0, [r4, 0x3C] +_0812F2C6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812F21C + + thumb_func_start sub_812F2CC +sub_812F2CC: @ 812F2CC + push {lr} + adds r3, r0, 0 + movs r1, 0x2E + ldrsh r0, [r3, r1] + cmp r0, 0x1 + beq _0812F2FA + cmp r0, 0x1 + bgt _0812F2E2 + cmp r0, 0 + beq _0812F2E8 + b _0812F368 +_0812F2E2: + cmp r0, 0x2 + beq _0812F318 + b _0812F368 +_0812F2E8: + adds r2, r3, 0 + adds r2, 0x2C + ldrb r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] +_0812F2FA: + ldrh r0, [r3, 0x22] + adds r0, 0x8 + strh r0, [r3, 0x22] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6F + ble _0812F368 + movs r0, 0x70 + strh r0, [r3, 0x22] + movs r0, 0x10 + strh r0, [r3, 0x30] + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + b _0812F368 +_0812F318: + movs r0, 0x32 + ldrsh r2, [r3, r0] + cmp r2, 0 + bne _0812F35E + ldrh r0, [r3, 0x22] + ldrh r1, [r3, 0x30] + subs r0, r1 + strh r0, [r3, 0x22] + negs r1, r1 + strh r1, [r3, 0x30] + ldrh r0, [r3, 0x34] + adds r0, 0x1 + strh r0, [r3, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _0812F35E + lsls r0, r1, 16 + asrs r0, 18 + strh r0, [r3, 0x30] + strh r2, [r3, 0x34] + adds r1, r0, 0 + cmp r1, 0 + bne _0812F35E + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] + strh r1, [r3, 0x3C] + adds r2, r3, 0 + adds r2, 0x2C + ldrb r1, [r2] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_0812F35E: + ldrh r0, [r3, 0x32] + adds r0, 0x1 + movs r1, 0x7 + ands r0, r1 + strh r0, [r3, 0x32] +_0812F368: + pop {r0} + bx r0 + thumb_func_end sub_812F2CC + + thumb_func_start sub_812F36C +sub_812F36C: @ 812F36C + push {lr} + adds r1, r0, 0 + movs r2, 0x2E + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _0812F37E + cmp r0, 0x1 + beq _0812F394 + b _0812F3B0 +_0812F37E: + ldrh r0, [r1, 0x30] + adds r0, 0x1 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _0812F3B0 + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + b _0812F3B0 +_0812F394: + ldrh r0, [r1, 0x22] + adds r0, 0x2 + strh r0, [r1, 0x22] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2F + ble _0812F3B0 + movs r0, 0x30 + strh r0, [r1, 0x22] + ldrh r0, [r1, 0x2E] + adds r0, 0x1 + strh r0, [r1, 0x2E] + movs r0, 0 + strh r0, [r1, 0x3C] +_0812F3B0: + pop {r0} + bx r0 + thumb_func_end sub_812F36C + + thumb_func_start sub_812F3B4 +sub_812F3B4: @ 812F3B4 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0812F3C6 + cmp r0, 0x1 + beq _0812F416 + b _0812F468 +_0812F3C6: + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x20 + ble _0812F468 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0x5 + strh r0, [r4, 0x30] + ldrb r0, [r4, 0x1] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectImageAnim + ldrh r0, [r4, 0x30] + lsls r1, r0, 4 + orrs r1, r0 + lsls r1, 24 + lsrs r1, 16 + movs r0, 0x4C + bl SetGpuReg + b _0812F468 +_0812F416: + ldrh r1, [r4, 0x32] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r4, 0x30] + subs r0, r1 + strh r0, [r4, 0x30] + lsls r0, 16 + cmp r0, 0 + bge _0812F42C + movs r0, 0 + strh r0, [r4, 0x30] +_0812F42C: + ldrh r0, [r4, 0x30] + lsls r1, r0, 4 + orrs r1, r0 + lsls r1, 24 + lsrs r1, 16 + movs r0, 0x4C + bl SetGpuReg + ldrh r1, [r4, 0x32] + movs r0, 0xFF + ands r0, r1 + adds r0, 0x80 + strh r0, [r4, 0x32] + movs r0, 0x30 + ldrsh r1, [r4, r0] + cmp r1, 0 + bne _0812F468 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + strh r1, [r4, 0x3C] + ldrb r1, [r4, 0x1] + movs r0, 0x11 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x1] + adds r0, r4, 0 + movs r1, 0 + bl StartObjectImageAnim +_0812F468: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_812F3B4 + + thumb_func_start sub_812F470 +sub_812F470: @ 812F470 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x30 + ldrsh r0, [r5, r1] + cmp r0, 0x2 + bgt _0812F4C0 + ldr r1, =gUnknown_085A8510 + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + movs r0, 0x6 + bl IndexOfObjectPaletteTag + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 4 + movs r0, 0x80 + lsls r0, 17 + adds r1, r0 + lsrs r1, 16 + adds r0, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3 + ble _0812F4FC + ldrh r0, [r5, 0x30] + adds r0, 0x1 + strh r0, [r5, 0x30] + movs r0, 0 + strh r0, [r5, 0x32] + b _0812F4FC + .pool +_0812F4C0: + ldr r1, =gUnknown_085A8510 + movs r2, 0x30 + ldrsh r0, [r5, r2] + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + movs r0, 0x6 + bl IndexOfObjectPaletteTag + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 4 + movs r0, 0x80 + lsls r0, 17 + adds r1, r0 + lsrs r1, 16 + adds r0, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + ldrh r0, [r5, 0x32] + adds r0, 0x1 + movs r1, 0 + strh r0, [r5, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x18 + ble _0812F4FC + strh r1, [r5, 0x30] + strh r1, [r5, 0x32] +_0812F4FC: + adds r0, r5, 0 + movs r1, 0x1 + bl StartObjectImageAnimIfDifferent + movs r0, 0 + strh r0, [r5, 0x3C] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812F470 + + thumb_func_start sub_812F514 +sub_812F514: @ 812F514 + push {r4-r6,lr} + sub sp, 0x30 + adds r4, r0, 0 + ldr r1, =gUnknown_085A762E + mov r0, sp + movs r2, 0x10 + bl memcpy + add r6, sp, 0x10 + ldr r1, =gUnknown_085A763E + adds r0, r6, 0 + movs r2, 0x10 + bl memcpy + add r5, sp, 0x20 + ldr r1, =gUnknown_085A764E + adds r0, r5, 0 + movs r2, 0x10 + bl memcpy + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _0812F58C + cmp r0, 0x1 + bgt _0812F55C + cmp r0, 0 + beq _0812F562 + b _0812F5D8 + .pool +_0812F55C: + cmp r0, 0x2 + beq _0812F5A0 + b _0812F5D8 +_0812F562: + movs r2, 0x3A + ldrsh r0, [r4, r2] + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + strh r0, [r4, 0x24] + movs r1, 0x3A + ldrsh r0, [r4, r1] + lsls r0, 1 + adds r0, r6, r0 + ldrh r0, [r0] + strh r0, [r4, 0x26] + movs r2, 0x3A + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r5, r0 + ldrh r0, [r0] + strh r0, [r4, 0x30] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_0812F58C: + ldrh r0, [r4, 0x30] + subs r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0812F5D8 + b _0812F5D2 +_0812F5A0: + ldrh r0, [r4, 0x24] + movs r2, 0x24 + ldrsh r1, [r4, r2] + cmp r1, 0 + ble _0812F5AE + subs r0, 0x4 + b _0812F5B4 +_0812F5AE: + cmp r1, 0 + bge _0812F5B6 + adds r0, 0x4 +_0812F5B4: + strh r0, [r4, 0x24] +_0812F5B6: + ldrh r0, [r4, 0x26] + movs r2, 0x26 + ldrsh r1, [r4, r2] + cmp r1, 0 + ble _0812F5C4 + subs r0, 0x4 + b _0812F5CA +_0812F5C4: + cmp r1, 0 + bge _0812F5CC + adds r0, 0x4 +_0812F5CA: + strh r0, [r4, 0x26] +_0812F5CC: + ldr r0, [r4, 0x24] + cmp r0, 0 + bne _0812F5D8 +_0812F5D2: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] +_0812F5D8: + add sp, 0x30 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_812F514 + + thumb_func_start sub_812F5E0 +sub_812F5E0: @ 812F5E0 + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + ldr r1, =gUnknown_085A765E + mov r0, sp + movs r2, 0x10 + bl memcpy + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _0812F602 + adds r0, r1, 0x1 + strh r0, [r4, 0x2E] + movs r0, 0xC + strh r0, [r4, 0x30] +_0812F602: + movs r1, 0x3A + ldrsh r0, [r4, r1] + lsls r0, 1 + add r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0x30 + ldrsh r1, [r4, r2] + bl cosine + strh r0, [r4, 0x24] + movs r1, 0x3A + ldrsh r0, [r4, r1] + lsls r0, 1 + add r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0x30 + ldrsh r1, [r4, r2] + bl sine + strh r0, [r4, 0x26] + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0812F63C + subs r0, r1, 0x1 + strh r0, [r4, 0x30] +_0812F63C: + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812F5E0 + + thumb_func_start sub_812F648 +sub_812F648: @ 812F648 + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _0812F694 + cmp r0, 0x1 + bgt _0812F660 + cmp r0, 0 + beq _0812F66A + b _0812F76C +_0812F660: + cmp r0, 0x2 + beq _0812F6E0 + cmp r0, 0x3 + beq _0812F71C + b _0812F76C +_0812F66A: + ldr r0, =0x0203ab34 + ldr r2, [r0] + adds r1, r2, 0 + adds r1, 0x5C + movs r0, 0x2F + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x3F + strh r0, [r1] + subs r1, 0x4 + ldr r0, =0x00002088 + strh r0, [r1] + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] +_0812F694: + ldrh r0, [r5, 0x30] + adds r2, r0, 0x2 + strh r2, [r5, 0x30] + adds r0, 0xB2 + strh r0, [r5, 0x32] + movs r1, 0xF0 + subs r1, r2 + strh r1, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD0 + ble _0812F6B0 + movs r0, 0xD0 + strh r0, [r5, 0x32] +_0812F6B0: + movs r1, 0x34 + ldrsh r0, [r5, r1] + cmp r0, 0xCF + bgt _0812F6BC + movs r0, 0xD0 + strh r0, [r5, 0x34] +_0812F6BC: + ldr r0, =0x0203ab34 + ldr r2, [r0] + ldrh r0, [r5, 0x32] + lsls r0, 8 + ldrh r1, [r5, 0x34] + orrs r0, r1 + adds r1, r2, 0 + adds r1, 0x58 + strh r0, [r1] + movs r1, 0x30 + ldrsh r0, [r5, r1] + cmp r0, 0x33 + ble _0812F76C + b _0812F75E + .pool +_0812F6E0: + ldr r6, =0x0203ab34 + ldr r0, [r6] + movs r1, 0x12 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _0812F76C + ldr r1, =DummyObjectCallback + movs r4, 0 + str r4, [sp] + movs r0, 0x5 + movs r2, 0xD0 + movs r3, 0x74 + bl sub_812DF68 + ldr r2, [r6] + adds r1, r2, 0 + adds r1, 0x58 + ldr r0, =0x0000c0e0 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0xD1 + lsls r0, 7 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x2F + strh r0, [r1] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + strh r4, [r5, 0x30] +_0812F71C: + ldrh r0, [r5, 0x30] + adds r2, r0, 0x2 + strh r2, [r5, 0x30] + adds r0, 0xC2 + strh r0, [r5, 0x32] + movs r1, 0xE0 + subs r1, r2 + strh r1, [r5, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD0 + ble _0812F738 + movs r0, 0xD0 + strh r0, [r5, 0x32] +_0812F738: + movs r1, 0x34 + ldrsh r0, [r5, r1] + cmp r0, 0xCF + bgt _0812F744 + movs r0, 0xD0 + strh r0, [r5, 0x34] +_0812F744: + ldr r0, =0x0203ab34 + ldr r2, [r0] + ldrh r0, [r5, 0x32] + lsls r0, 8 + ldrh r1, [r5, 0x34] + orrs r0, r1 + adds r1, r2, 0 + adds r1, 0x58 + strh r0, [r1] + movs r1, 0x30 + ldrsh r0, [r5, r1] + cmp r0, 0xF + ble _0812F76C +_0812F75E: + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] + adds r1, r2, 0 + adds r1, 0x5C + movs r0, 0x3F + strh r0, [r1] +_0812F76C: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812F648 + + thumb_func_start nullsub_101 +nullsub_101: @ 812F780 + bx lr + thumb_func_end nullsub_101 + + thumb_func_start sub_812F784 +sub_812F784: @ 812F784 + push {lr} + movs r0, 0x4C + movs r1, 0 + bl SetGpuReg + pop {r0} + bx r0 + thumb_func_end sub_812F784 + + thumb_func_start sub_812F794 +sub_812F794: @ 812F794 + push {r4,lr} + ldr r0, =gUnknown_085A8520 + ldr r4, [r0] + movs r0, 0x6 + bl IndexOfObjectPaletteTag + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 4 + movs r0, 0x80 + lsls r0, 17 + adds r1, r0 + lsrs r1, 16 + adds r0, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812F794 + + thumb_func_start sub_812F7C0 +sub_812F7C0: @ 812F7C0 + ldr r0, =0x0203ab34 + ldr r2, [r0] + adds r1, r2, 0 + adds r1, 0x58 + movs r0, 0xF0 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0xA0 + strh r0, [r1] + adds r0, r2, 0 + adds r0, 0x5C + movs r1, 0x3F + strh r1, [r0] + adds r0, 0x2 + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_812F7C0 + + thumb_func_start sub_812F7E4 +sub_812F7E4: @ 812F7E4 + push {r4-r6,lr} + bl sub_812F8A0 + ldr r4, =0x0203aad4 + movs r0, 0xC8 + lsls r0, 6 + bl Alloc + adds r1, r0, 0 + str r1, [r4] + ldr r0, =gUnknown_08DD0050 + bl LZDecompressWram + ldr r4, =0x0203aad8 + movs r0, 0xD8 + lsls r0, 6 + bl Alloc + adds r1, r0, 0 + str r1, [r4] + ldr r0, =gUnknown_085A858C + bl LZDecompressWram + ldr r4, =0x0203ab30 + movs r0, 0xB0 + bl AllocZeroed + str r0, [r4] + movs r3, 0 + ldr r5, =gUnknown_085A8334 + adds r6, r4, 0 +_0812F822: + ldr r2, [r4] + lsls r1, r3, 3 + adds r2, r1, r2 + adds r1, r5 + ldr r0, [r1] + str r0, [r2] + ldrh r0, [r1, 0x4] + strh r0, [r2, 0x4] + ldrh r0, [r1, 0x6] + strh r0, [r2, 0x6] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x15 + bls _0812F822 + ldr r3, [r6] + adds r2, r3, 0 + adds r2, 0x88 + ldr r0, =0x0203aad4 + ldr r1, [r0] + movs r4, 0xA0 + lsls r4, 4 + adds r0, r1, r4 + str r0, [r2] + adds r2, 0x8 + movs r4, 0xA0 + lsls r4, 5 + adds r0, r1, r4 + str r0, [r2] + adds r2, 0x8 + movs r4, 0xB0 + lsls r4, 5 + adds r0, r1, r4 + str r0, [r2] + adds r0, r3, 0 + adds r0, 0xA0 + movs r2, 0xC8 + lsls r2, 5 + adds r1, r2 + str r1, [r0] + adds r0, r3, 0 + bl LoadObjectPics + ldr r0, =gUnknown_085A8544 + bl LoadTaggedObjectPalettes + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812F7E4 + + thumb_func_start sub_812F8A0 +sub_812F8A0: @ 812F8A0 + push {r4-r6,lr} + ldr r5, =0x0203ab2c + movs r0, 0x8 + bl AllocZeroed + str r0, [r5] + ldr r4, =0x0203aae0 + movs r0, 0x80 + lsls r0, 6 + bl AllocZeroed + str r0, [r4] + adds r3, r0, 0 + movs r1, 0 + adds r6, r4, 0 + ldr r0, =gUnknown_085A83E4 + ldr r4, [r0] +_0812F8C2: + movs r2, 0 + adds r1, 0x1 +_0812F8C6: + adds r0, r4, r2 + ldrb r0, [r0] + strb r0, [r3] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + adds r3, 0x1 + cmp r2, 0x1F + bls _0812F8C6 + lsls r0, r1, 24 + lsrs r1, r0, 24 + cmp r1, 0x3F + bls _0812F8C2 + ldr r0, [r5] + ldr r1, [r6] + str r1, [r0] + movs r1, 0x80 + lsls r1, 4 + strh r1, [r0, 0x4] + movs r1, 0x11 + strh r1, [r0, 0x6] + bl LoadObjectPic + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812F8A0 + + thumb_func_start sub_812F908 +sub_812F908: @ 812F908 + push {r4,r5,lr} + ldr r4, =0x0203aac8 + movs r5, 0x88 + lsls r5, 6 + adds r0, r5, 0 + bl Alloc + adds r1, r0, 0 + str r1, [r4] + ldr r0, =gUnknown_08DCDB30 + bl LZDecompressWram + ldr r1, [r4] + movs r0, 0x2 + adds r2, r5, 0 + movs r3, 0 + bl LoadBgTiles + ldr r0, =gUnknown_08DCDA90 + movs r1, 0 + movs r2, 0xA0 + bl gpu_pal_apply + ldr r0, =gUnknown_085A8524 + movs r1, 0xD0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812F908 + + thumb_func_start sub_812F958 +sub_812F958: @ 812F958 + push {lr} + bl sub_812F968 + bl sub_812F980 + pop {r0} + bx r0 + thumb_func_end sub_812F958 + + thumb_func_start sub_812F968 +sub_812F968: @ 812F968 + push {lr} + ldr r1, =gUnknown_08DCE770 + movs r2, 0xA0 + lsls r2, 3 + movs r0, 0x2 + movs r3, 0 + bl LoadBgTilemap + pop {r0} + bx r0 + .pool + thumb_func_end sub_812F968 + + thumb_func_start sub_812F980 +sub_812F980: @ 812F980 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r1, 0x4 + ldr r0, =0x0203aad0 + mov r8, r0 +_0812F98E: + movs r0, 0 + lsls r1, 16 + mov r9, r1 +_0812F994: + mov r2, r8 + ldr r1, [r2] + mov r2, r9 + asrs r6, r2, 16 + lsls r4, r0, 16 + asrs r4, 16 + adds r5, r6, r4 + adds r3, r5, 0 + adds r3, 0xA0 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x3 + movs r2, 0x2 + bl LoadBgTilemap + mov r0, r8 + ldr r1, [r0] + adds r1, 0x2 + movs r2, 0xD0 + lsls r2, 1 + adds r3, r5, r2 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x3 + movs r2, 0x2 + bl LoadBgTilemap + mov r0, r8 + ldr r1, [r0] + adds r1, 0x4 + adds r3, r5, 0 + adds r3, 0xC0 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x3 + movs r2, 0x2 + bl LoadBgTilemap + mov r2, r8 + ldr r1, [r2] + adds r1, 0x6 + movs r0, 0xC0 + lsls r0, 1 + adds r7, r0, 0 + adds r3, r5, r7 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x3 + movs r2, 0x2 + bl LoadBgTilemap + adds r4, 0x1 + lsls r4, 16 + lsrs r0, r4, 16 + asrs r4, 16 + cmp r4, 0x3 + ble _0812F994 + mov r2, r8 + ldr r1, [r2] + adds r1, 0x8 + adds r3, r6, 0 + adds r3, 0xC0 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x3 + movs r2, 0x2 + bl LoadBgTilemap + mov r0, r8 + ldr r1, [r0] + adds r1, 0xA + adds r3, r6, r7 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x3 + movs r2, 0x2 + bl LoadBgTilemap + movs r0, 0x7 +_0812FA32: + mov r2, r8 + ldr r1, [r2] + adds r1, 0xC + lsls r4, r0, 16 + asrs r4, 16 + lsls r3, r4, 5 + mov r0, r9 + asrs r5, r0, 16 + adds r3, r5, r3 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x3 + movs r2, 0x2 + bl LoadBgTilemap + adds r4, 0x1 + lsls r4, 16 + lsrs r0, r4, 16 + asrs r4, 16 + cmp r4, 0xB + ble _0812FA32 + adds r0, r5, 0x5 + lsls r0, 16 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, 0x11 + ble _0812F98E + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812F980 + + thumb_func_start sub_812FA78 +sub_812FA78: @ 812FA78 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r5, [sp, 0x10] + ldr r6, =0x0203aadc + ldr r0, [r6] + strh r1, [r0] + ldr r1, [r6] + strh r2, [r1, 0x2] + strh r3, [r1, 0x4] + strh r5, [r1, 0x6] + lsls r4, 16 + asrs r5, r4, 16 + movs r0, 0xF0 + lsls r0, 17 + adds r4, r0 + lsrs r4, 16 + movs r0, 0x2 + movs r2, 0x2 + adds r3, r4, 0 + bl LoadBgTilemap + ldr r1, [r6] + adds r1, 0x2 + ldr r0, =0x000001e1 + adds r3, r5, r0 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x2 + movs r2, 0x2 + bl LoadBgTilemap + ldr r1, [r6] + adds r1, 0x4 + movs r0, 0x80 + lsls r0, 2 + adds r3, r5, r0 + lsls r3, 16 + lsrs r3, 16 + movs r0, 0x2 + movs r2, 0x2 + bl LoadBgTilemap + ldr r1, [r6] + adds r1, 0x6 + ldr r0, =0x00000201 + adds r5, r0 + lsls r5, 16 + lsrs r5, 16 + movs r0, 0x2 + movs r2, 0x2 + adds r3, r5, 0 + bl LoadBgTilemap + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812FA78 + + thumb_func_start sub_812FAF4 +sub_812FAF4: @ 812FAF4 + push {lr} + ldr r1, =gUnknown_08DCEC70 + movs r2, 0xA0 + lsls r2, 3 + movs r0, 0x2 + movs r3, 0 + bl LoadBgTilemap + movs r0, 0x3 + bl HideBg + pop {r0} + bx r0 + .pool + thumb_func_end sub_812FAF4 + + thumb_func_start sub_812FB14 +sub_812FB14: @ 812FB14 + ldr r1, =0x03001188 + ldr r0, =0x0203aaf4 + ldr r0, [r0] + str r0, [r1] + ldr r0, =0x0203aaf8 + ldr r0, [r0] + str r0, [r1, 0x4] + ldr r0, =0x0203aafc + ldr r0, [r0] + str r0, [r1, 0x8] + ldr r0, =0x0203ab04 + ldr r0, [r0] + str r0, [r1, 0xC] + ldr r0, =0x0203ab08 + ldr r0, [r0] + str r0, [r1, 0x10] + ldr r0, =0x0203ab18 + ldr r0, [r0] + str r0, [r1, 0x14] + ldr r0, =0x0203ab1c + ldr r0, [r0] + str r0, [r1, 0x18] + ldr r0, =0x0203ab20 + ldr r0, [r0] + str r0, [r1, 0x1C] + ldr r0, =0x0203ab24 + ldr r0, [r0] + str r0, [r1, 0x20] + ldr r0, =0x0203ab28 + ldr r0, [r0] + str r0, [r1, 0x24] + ldr r0, =0x0203ab00 + ldr r0, [r0] + str r0, [r1, 0x28] + str r0, [r1, 0x2C] + str r0, [r1, 0x30] + str r0, [r1, 0x34] + ldr r0, =0x0203ab0c + ldr r0, [r0] + str r0, [r1, 0x38] + str r0, [r1, 0x3C] + str r0, [r1, 0x40] + str r0, [r1, 0x44] + str r0, [r1, 0x48] + ldr r0, =0x0203ab10 + ldr r0, [r0] + str r0, [r1, 0x4C] + str r0, [r1, 0x50] + str r0, [r1, 0x54] + ldr r0, =0x0203ab14 + ldr r0, [r0] + str r0, [r1, 0x58] + str r0, [r1, 0x5C] + str r0, [r1, 0x60] + movs r0, 0 + str r0, [r1, 0x64] + bx lr + .pool + thumb_func_end sub_812FB14 + + thumb_func_start sub_812FBC4 +sub_812FBC4: @ 812FBC4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r4, =0x0203aaf4 + movs r0, 0x8 + bl AllocZeroed + str r0, [r4] + ldr r6, =0x0203aad4 + ldr r1, [r6] + str r1, [r0] + movs r5, 0xC0 + lsls r5, 3 + strh r5, [r0, 0x4] + ldr r4, =0x0203aaf8 + movs r0, 0x8 + bl AllocZeroed + str r0, [r4] + ldr r1, [r6] + adds r1, r5 + str r1, [r0] + movs r1, 0x80 + lsls r1, 2 + mov r8, r1 + mov r2, r8 + strh r2, [r0, 0x4] + ldr r4, =0x0203aafc + movs r0, 0x8 + bl AllocZeroed + str r0, [r4] + ldr r1, [r6] + movs r3, 0x80 + lsls r3, 4 + adds r1, r3 + str r1, [r0] + mov r4, r8 + strh r4, [r0, 0x4] + ldr r4, =0x0203ab00 + movs r0, 0x8 + bl AllocZeroed + str r0, [r4] + ldr r1, [r6] + movs r2, 0xA0 + lsls r2, 4 + adds r1, r2 + str r1, [r0] + mov r3, r8 + strh r3, [r0, 0x4] + ldr r4, =0x0203ab04 + movs r0, 0x8 + bl AllocZeroed + str r0, [r4] + ldr r1, [r6] + movs r4, 0xC0 + lsls r4, 4 + adds r1, r4 + str r1, [r0] + movs r5, 0xC0 + lsls r5, 2 + strh r5, [r0, 0x4] + ldr r4, =0x0203ab08 + movs r0, 0x8 + bl AllocZeroed + str r0, [r4] + ldr r1, [r6] + movs r2, 0x80 + lsls r2, 5 + adds r1, r2 + str r1, [r0] + movs r1, 0x80 + lsls r1, 3 + strh r1, [r0, 0x4] + ldr r4, =0x0203ab0c + movs r0, 0x8 + bl AllocZeroed + str r0, [r4] + ldr r1, [r6] + movs r3, 0xA0 + lsls r3, 5 + adds r1, r3 + str r1, [r0] + mov r4, r8 + strh r4, [r0, 0x4] + ldr r4, =0x0203ab10 + movs r0, 0x8 + bl AllocZeroed + str r0, [r4] + ldr r1, [r6] + movs r2, 0xB0 + lsls r2, 5 + adds r1, r2 + str r1, [r0] + strh r5, [r0, 0x4] + ldr r4, =0x0203ab14 + movs r0, 0x8 + bl AllocZeroed + str r0, [r4] + ldr r1, [r6] + movs r3, 0xC8 + lsls r3, 5 + adds r1, r3 + str r1, [r0] + strh r5, [r0, 0x4] + ldr r4, =0x0203ab18 + movs r0, 0x10 + bl AllocZeroed + str r0, [r4] + ldr r1, [r6] + movs r4, 0xE0 + lsls r4, 5 + adds r2, r1, r4 + str r2, [r0] + mov r2, r8 + strh r2, [r0, 0x4] + movs r3, 0xF0 + lsls r3, 5 + adds r1, r3 + str r1, [r0, 0x8] + strh r2, [r0, 0xC] + ldr r4, =0x0203ab1c + movs r0, 0x8 + bl AllocZeroed + str r0, [r4] + ldr r1, [r6] + movs r4, 0x80 + lsls r4, 6 + adds r1, r4 + str r1, [r0] + movs r1, 0xA0 + lsls r1, 2 + strh r1, [r0, 0x4] + ldr r4, =0x0203ab20 + movs r0, 0x28 + bl AllocZeroed + str r0, [r4] + ldr r2, [r6] + movs r3, 0x8A + lsls r3, 6 + adds r1, r2, r3 + str r1, [r0] + movs r3, 0x80 + strh r3, [r0, 0x4] + movs r4, 0x8C + lsls r4, 6 + adds r1, r2, r4 + str r1, [r0, 0x8] + strh r3, [r0, 0xC] + adds r4, 0x80 + adds r1, r2, r4 + str r1, [r0, 0x10] + strh r3, [r0, 0x14] + adds r4, 0x80 + adds r1, r2, r4 + str r1, [r0, 0x18] + strh r3, [r0, 0x1C] + movs r1, 0x92 + lsls r1, 6 + adds r2, r1 + str r2, [r0, 0x20] + strh r3, [r0, 0x24] + ldr r4, =0x0203ab24 + movs r0, 0x10 + bl AllocZeroed + str r0, [r4] + ldr r2, [r6] + movs r3, 0x98 + lsls r3, 6 + adds r1, r2, r3 + str r1, [r0] + movs r1, 0x90 + lsls r1, 3 + strh r1, [r0, 0x4] + movs r4, 0xAA + lsls r4, 6 + adds r2, r4 + str r2, [r0, 0x8] + strh r1, [r0, 0xC] + ldr r4, =0x0203ab28 + movs r0, 0x10 + bl AllocZeroed + str r0, [r4] + ldr r2, [r6] + movs r3, 0xBC + lsls r3, 6 + adds r1, r2, r3 + str r1, [r0] + movs r1, 0xC0 + lsls r1, 1 + strh r1, [r0, 0x4] + movs r4, 0xC2 + lsls r4, 6 + adds r2, r4 + str r2, [r0, 0x8] + strh r1, [r0, 0xC] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_812FBC4 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/sound.s b/asm/sound.s new file mode 100644 index 000000000..0501293e2 --- /dev/null +++ b/asm/sound.s @@ -0,0 +1,1399 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sound_sources_off +sound_sources_off: @ 80A2DD4 + push {lr} + ldr r1, =0x03005df8 + movs r0, 0 + strb r0, [r1] + bl map_music_set_to_zero + pop {r0} + bx r0 + .pool + thumb_func_end sound_sources_off + + thumb_func_start sound_something +sound_something: @ 80A2DE8 + push {r4,r5,lr} + ldr r0, =0x03000f4c + ldrb r1, [r0] + adds r2, r0, 0 + cmp r1, 0x7 + bhi _080A2ECA + lsls r0, r1, 2 + ldr r1, =_080A2E08 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080A2E08: + .4byte _080A2ECA + .4byte _080A2E28 + .4byte _080A2ECA + .4byte _080A2ECA + .4byte _080A2ECA + .4byte _080A2E3C + .4byte _080A2E5C + .4byte _080A2E98 +_080A2E28: + movs r0, 0x2 + strb r0, [r2] + ldr r0, =0x03000f48 + ldrh r0, [r0] + bl song_play_for_text + b _080A2ECA + .pool +_080A2E3C: + bl sub_80A3258 + lsls r0, 24 + cmp r0, 0 + beq _080A2ECA + ldr r0, =0x03000f4a + movs r1, 0 + strh r1, [r0] + ldr r0, =0x03000f4c + strb r1, [r0] + b _080A2ECA + .pool +_080A2E5C: + bl sub_80A3258 + lsls r0, 24 + cmp r0, 0 + beq _080A2ECA + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + beq _080A2ECA + ldr r2, =0x03000f48 + ldr r1, =0x03000f4a + ldrh r0, [r1] + strh r0, [r2] + movs r0, 0 + strh r0, [r1] + ldr r1, =0x03000f4c + movs r0, 0x2 + strb r0, [r1] + ldrh r0, [r2] + bl song_play_for_text + b _080A2ECA + .pool +_080A2E98: + bl sub_80A3258 + lsls r0, 24 + cmp r0, 0 + beq _080A2ECA + bl task_is_not_running_overworld_fanfare + lsls r0, 24 + cmp r0, 0 + beq _080A2ECA + ldr r4, =0x03000f4a + ldrh r0, [r4] + ldr r5, =0x03000f4d + ldrb r1, [r5] + bl sub_80A3194 + ldr r1, =0x03000f48 + ldrh r0, [r4] + strh r0, [r1] + movs r2, 0 + strh r2, [r4] + ldr r1, =0x03000f4c + movs r0, 0x2 + strb r0, [r1] + strb r2, [r5] +_080A2ECA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sound_something + + thumb_func_start map_music_set_to_zero +map_music_set_to_zero: @ 80A2EE0 + ldr r0, =0x03000f48 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x03000f4a + strh r1, [r0] + ldr r0, =0x03000f4c + strb r1, [r0] + ldr r0, =0x03000f4d + strb r1, [r0] + bx lr + .pool + thumb_func_end map_music_set_to_zero + + thumb_func_start current_map_music_get +current_map_music_get: @ 80A2F04 + ldr r0, =0x03000f48 + ldrh r0, [r0] + bx lr + .pool + thumb_func_end current_map_music_get + + thumb_func_start current_map_music_set +current_map_music_set: @ 80A2F10 + ldr r1, =0x03000f48 + strh r0, [r1] + ldr r1, =0x03000f4a + movs r0, 0 + strh r0, [r1] + ldr r1, =0x03000f4c + movs r0, 0x1 + strb r0, [r1] + bx lr + .pool + thumb_func_end current_map_music_set + + thumb_func_start sub_80A2F30 +sub_80A2F30: @ 80A2F30 + ldr r0, =0x03000f48 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x03000f4a + strh r1, [r0] + ldr r1, =0x03000f4c + movs r0, 0x1 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_80A2F30 + + thumb_func_start sub_80A2F50 +sub_80A2F50: @ 80A2F50 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A303C + lsls r0, 24 + cmp r0, 0 + beq _080A2F66 + adds r0, r4, 0 + bl play_sound_effect +_080A2F66: + ldr r0, =0x03000f48 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x03000f4a + strh r1, [r0] + ldr r1, =0x03000f4c + movs r0, 0x5 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2F50 + + thumb_func_start sub_80A2F88 +sub_80A2F88: @ 80A2F88 + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r0, 24 + lsrs r0, 24 + bl sub_80A2F50 + ldr r1, =0x03000f48 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x03000f4a + strh r4, [r0] + ldr r1, =0x03000f4c + movs r0, 0x6 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2F88 + + thumb_func_start sub_80A2FBC +sub_80A2FBC: @ 80A2FBC + push {r4,r5,lr} + adds r4, r0, 0 + adds r0, r1, 0 + adds r5, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r0, 24 + lsrs r0, 24 + lsls r5, 24 + lsrs r5, 24 + bl sub_80A2F50 + ldr r1, =0x03000f48 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x03000f4a + strh r4, [r0] + ldr r1, =0x03000f4c + movs r0, 0x7 + strb r0, [r1] + ldr r0, =0x03000f4d + strb r5, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A2FBC + + thumb_func_start sub_80A3000 +sub_80A3000: @ 80A3000 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_80A3194 + ldr r0, =0x03000f48 + strh r4, [r0] + ldr r0, =0x03000f4a + movs r2, 0 + strh r2, [r0] + ldr r1, =0x03000f4c + movs r0, 0x2 + strb r0, [r1] + ldr r0, =0x03000f4d + strb r2, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3000 + + thumb_func_start sub_80A303C +sub_80A303C: @ 80A303C + push {lr} + ldr r0, =0x03000f4c + ldrb r0, [r0] + cmp r0, 0x6 + beq _080A3058 + cmp r0, 0x5 + beq _080A3058 + cmp r0, 0x7 + beq _080A3058 + movs r0, 0x1 + b _080A305A + .pool +_080A3058: + movs r0, 0 +_080A305A: + pop {r1} + bx r1 + thumb_func_end sub_80A303C + + thumb_func_start pause_music_for_sound_maybe +@ void pause_music_for_sound_maybe(u8 a1) +pause_music_for_sound_maybe: @ 80A3060 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x03007420 + bl MPlayStop_rev01 + ldr r0, =gUnknown_085248BC + lsls r4, 2 + adds r4, r0 + ldrh r0, [r4] + ldr r2, =0x03000f4e + ldrh r1, [r4, 0x2] + strh r1, [r2] + bl m4aSongNumStart + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end pause_music_for_sound_maybe + + thumb_func_start ducking_tick +ducking_tick: @ 80A3094 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + ldr r2, =0x03000f4e + ldrh r0, [r2] + cmp r0, 0 + beq _080A30B0 + subs r0, 0x1 + strh r0, [r2] + movs r0, 0 + b _080A30C8 + .pool +_080A30B0: + cmp r1, 0 + bne _080A30C0 + ldr r0, =0x03007420 + bl m4aMPlayContinue + b _080A30C6 + .pool +_080A30C0: + movs r0, 0 + bl m4aSongNumStart +_080A30C6: + movs r0, 0x1 +_080A30C8: + pop {r1} + bx r1 + thumb_func_end ducking_tick + + thumb_func_start sub_80A30CC +sub_80A30CC: @ 80A30CC + push {lr} + lsls r0, 24 + ldr r1, =gUnknown_085248BC + lsrs r0, 22 + adds r0, r1 + ldrh r0, [r0] + bl m4aSongNumStop + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A30CC + + thumb_func_start fanfare_play +@ void fanfare_play(u16 a1) +fanfare_play: @ 80A30E4 + push {lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r1, 0 + ldr r2, =gUnknown_085248BC +_080A30EE: + ldrh r0, [r2] + cmp r0, r3 + bne _080A3108 + lsls r0, r1, 24 + lsrs r0, 24 + bl pause_music_for_sound_maybe + bl task_add_50_overworld_fanfare_if_not_running + b _080A311A + .pool +_080A3108: + adds r2, 0x4 + adds r1, 0x1 + cmp r1, 0x11 + bls _080A30EE + movs r0, 0 + bl pause_music_for_sound_maybe + bl task_add_50_overworld_fanfare_if_not_running +_080A311A: + pop {r0} + bx r0 + thumb_func_end fanfare_play + + thumb_func_start task_is_not_running_overworld_fanfare +task_is_not_running_overworld_fanfare: @ 80A3120 + push {lr} + ldr r0, =task50_overworld_fanfare + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080A3138 + movs r0, 0x1 + b _080A313A + .pool +_080A3138: + movs r0, 0 +_080A313A: + pop {r1} + bx r1 + thumb_func_end task_is_not_running_overworld_fanfare + + thumb_func_start task50_overworld_fanfare +task50_overworld_fanfare: @ 80A3140 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x03000f4e + ldrh r0, [r1] + cmp r0, 0 + beq _080A3158 + subs r0, 0x1 + strh r0, [r1] + b _080A3164 + .pool +_080A3158: + ldr r0, =0x03007420 + bl m4aMPlayContinue + adds r0, r4, 0 + bl DestroyTask +_080A3164: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task50_overworld_fanfare + + thumb_func_start task_add_50_overworld_fanfare_if_not_running +@ void task_add_50_overworld_fanfare_if_not_running() +task_add_50_overworld_fanfare_if_not_running: @ 80A3170 + push {r4,lr} + ldr r4, =task50_overworld_fanfare + adds r0, r4, 0 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080A318A + adds r0, r4, 0 + movs r1, 0x50 + bl CreateTask +_080A318A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task_add_50_overworld_fanfare_if_not_running + + thumb_func_start sub_80A3194 +sub_80A3194: @ 80A3194 + push {r4-r7,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r0, =0x03005df8 + ldrb r0, [r0] + cmp r0, 0 + beq _080A31A8 + movs r5, 0 +_080A31A8: + ldr r6, =0x0000ffff + cmp r5, r6 + bne _080A31B0 + movs r5, 0 +_080A31B0: + adds r0, r5, 0 + bl m4aSongNumStart + ldr r4, =0x03007420 + adds r0, r4, 0 + bl m4aMPlayImmInit + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0 + bl MPlayVolumeControl + adds r0, r5, 0 + bl m4aSongNumStop + adds r0, r4, 0 + adds r1, r7, 0 + bl sub_82E0328 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3194 + + thumb_func_start sub_80A31E8 +sub_80A31E8: @ 80A31E8 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =0x03007420 + bl sub_82E0308 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A31E8 + + thumb_func_start sub_80A3200 +sub_80A3200: @ 80A3200 + push {lr} + ldr r0, =0x03007420 + ldr r1, [r0, 0x4] + cmp r1, 0 + blt _080A3220 + ldr r0, =0x0000ffff + ands r1, r0 + cmp r1, 0 + beq _080A3220 + movs r0, 0 + b _080A3222 + .pool +_080A3220: + movs r0, 0x1 +_080A3222: + pop {r1} + bx r1 + thumb_func_end sub_80A3200 + + thumb_func_start sub_80A3228 +sub_80A3228: @ 80A3228 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =0x03007420 + bl sub_82E0328 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3228 + + thumb_func_start play_sound_effect +@ void play_sound_effect(u8 a1) +play_sound_effect: @ 80A3240 + push {lr} + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, =0x03007420 + bl m4aMPlayFadeOut + pop {r0} + bx r0 + .pool + thumb_func_end play_sound_effect + + thumb_func_start sub_80A3258 +sub_80A3258: @ 80A3258 + push {lr} + ldr r0, =0x03007420 + ldrh r0, [r0, 0x4] + cmp r0, 0 + beq _080A326C + movs r0, 0 + b _080A326E + .pool +_080A326C: + movs r0, 0x1 +_080A326E: + pop {r1} + bx r1 + thumb_func_end sub_80A3258 + + thumb_func_start cry_related +cry_related: @ 80A3274 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r4, r1, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x55 + bl MPlayVolumeControl + lsls r4, 24 + asrs r4, 24 + movs r0, 0 + str r0, [sp] + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x78 + movs r3, 0xA + bl sub_80A344C + ldr r1, =0x020383ec + movs r0, 0x2 + strb r0, [r1] + bl sub_80A3754 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end cry_related + + thumb_func_start sub_80A32C0 +sub_80A32C0: @ 80A32C0 + push {r4,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r0, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r1, 24 + asrs r1, 24 + lsls r2, 24 + asrs r2, 24 + movs r4, 0 + str r4, [sp] + bl sub_80A344C + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A32C0 + + thumb_func_start sub_80A32E4 +sub_80A32E4: @ 80A32E4 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r4, r2, 24 + cmp r4, 0x1 + bne _080A330A + lsls r1, r5, 24 + asrs r1, 24 + str r4, [sp] + adds r0, r6, 0 + movs r2, 0x78 + movs r3, 0xA + bl sub_80A344C + b _080A332E +_080A330A: + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x55 + bl MPlayVolumeControl + lsls r1, r5, 24 + asrs r1, 24 + str r4, [sp] + adds r0, r6, 0 + movs r2, 0x78 + movs r3, 0xA + bl sub_80A344C + ldr r1, =0x020383ec + movs r0, 0x2 + strb r0, [r1] + bl sub_80A3754 +_080A332E: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A32E4 + + thumb_func_start sub_80A3344 +sub_80A3344: @ 80A3344 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r0, 16 + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r5, r1, 0 + lsls r2, 24 + lsrs r2, 24 + adds r4, r2, 0 + cmp r2, 0x1 + bne _080A336E + lsls r1, 24 + asrs r1, 24 + str r2, [sp] + movs r2, 0x78 + movs r3, 0xA + bl sub_80A344C + b _080A3394 +_080A336E: + ldr r0, =0x02022fec + ldr r0, [r0] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + bne _080A3384 + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x55 + bl MPlayVolumeControl +_080A3384: + lsls r1, r5, 24 + asrs r1, 24 + str r4, [sp] + adds r0, r6, 0 + movs r2, 0x78 + movs r3, 0xA + bl sub_80A344C +_080A3394: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3344 + + thumb_func_start play_cry_maybe +play_cry_maybe: @ 80A33A8 + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r4, r2, 24 + cmp r4, 0x1 + bne _080A33CE + lsls r1, r5, 24 + asrs r1, 24 + str r4, [sp] + adds r0, r6, 0 + movs r2, 0x78 + movs r3, 0xA + bl sub_80A344C + b _080A33EE +_080A33CE: + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x55 + bl MPlayVolumeControl + lsls r1, r5, 24 + asrs r1, 24 + str r4, [sp] + adds r0, r6, 0 + movs r2, 0x78 + movs r3, 0xA + bl sub_80A344C + ldr r1, =0x020383ec + movs r0, 0x2 + strb r0, [r1] +_080A33EE: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end play_cry_maybe + + thumb_func_start sub_80A3404 +sub_80A3404: @ 80A3404 + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r4, r1, 0 + lsls r5, 16 + lsrs r5, 16 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x55 + bl MPlayVolumeControl + str r4, [sp] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x78 + movs r3, 0xA + bl sub_80A344C + ldr r1, =0x020383ec + movs r0, 0x2 + strb r0, [r1] + bl sub_80A3754 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3404 + + thumb_func_start sub_80A344C +sub_80A344C: @ 80A344C + 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, 16 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp] + lsls r4, 24 + lsrs r1, r4, 24 + ldr r3, =0xffff0000 + adds r0, r3 + lsrs r7, r0, 16 + movs r6, 0x8C + movs r0, 0 + mov r9, r0 + movs r5, 0 + movs r4, 0xF0 + lsls r4, 6 + mov r8, r5 + cmp r1, 0xC + bhi _080A3562 + lsls r0, r1, 2 + ldr r1, =_080A349C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080A349C: + .4byte _080A3562 + .4byte _080A34D0 + .4byte _080A34D6 + .4byte _080A34E4 + .4byte _080A34F8 + .4byte _080A3510 + .4byte _080A351C + .4byte _080A352C + .4byte _080A3536 + .4byte _080A3540 + .4byte _080A3550 + .4byte _080A3560 + .4byte _080A355C +_080A34D0: + movs r6, 0x14 + movs r5, 0xE1 + b _080A3562 +_080A34D6: + movs r5, 0xE1 + ldr r4, =0x00003cf0 + movs r1, 0x14 + b _080A3504 + .pool +_080A34E4: + movs r6, 0x32 + movs r5, 0xC8 + ldr r4, =0x00003db8 + movs r3, 0x14 + mov r8, r3 + movs r2, 0x5A + b _080A3562 + .pool +_080A34F8: + movs r6, 0x19 + movs r0, 0x1 + mov r9, r0 + movs r5, 0x64 + ldr r4, =0x00003cf0 + movs r1, 0xC0 +_080A3504: + mov r8, r1 + movs r2, 0x5A + b _080A3562 + .pool +_080A3510: + movs r5, 0xC8 + ldr r4, =0x00003868 + b _080A3562 + .pool +_080A351C: + movs r5, 0xDC + ldr r4, =0x00003cc3 + movs r3, 0xC0 + mov r8, r3 + movs r2, 0x46 + b _080A3562 + .pool +_080A352C: + movs r6, 0xA + movs r5, 0x64 + movs r4, 0xE8 + lsls r4, 6 + b _080A3562 +_080A3536: + movs r6, 0x3C + movs r5, 0xE1 + movs r4, 0xF4 + lsls r4, 6 + b _080A3562 +_080A3540: + movs r6, 0xF + movs r0, 0x1 + mov r9, r0 + movs r5, 0x7D + ldr r4, =0x00003b60 + b _080A3562 + .pool +_080A3550: + movs r6, 0x64 + movs r5, 0xE1 + ldr r4, =0x00003b60 + b _080A3562 + .pool +_080A355C: + movs r6, 0x14 + movs r5, 0xE1 +_080A3560: + ldr r4, =0x00003a98 +_080A3562: + adds r0, r2, 0 + bl sub_82E1744 + mov r1, r10 + lsls r0, r1, 24 + asrs r0, 24 + bl sub_82E1758 + adds r0, r4, 0 + bl sub_82E1770 + adds r0, r6, 0 + bl sub_82E17A8 + movs r0, 0 + bl sub_82E17C0 + adds r0, r5, 0 + bl sub_82E17B4 + mov r3, r8 + lsls r0, r3, 24 + asrs r0, 24 + bl sub_82E17E4 + ldr r0, [sp] + bl sub_82E1850 + adds r0, r7, 0 + bl speciesid_conv + adds r7, r0, 0 + movs r1, 0x7F + ands r1, r7 + lsrs r0, r7, 7 + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + cmp r0, 0x1 + beq _080A35F0 + cmp r0, 0x1 + bgt _080A35C0 + cmp r0, 0 + beq _080A35CA + b _080A365E + .pool +_080A35C0: + cmp r2, 0x2 + beq _080A3614 + cmp r2, 0x3 + beq _080A3638 + b _080A365E +_080A35CA: + mov r0, r9 + cmp r0, 0 + beq _080A35E0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_0869EF24 + b _080A3654 + .pool +_080A35E0: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_0869DCF4 + b _080A3654 + .pool +_080A35F0: + mov r3, r9 + cmp r3, 0 + beq _080A3604 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_0869F524 + b _080A3654 + .pool +_080A3604: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_0869E2F4 + b _080A3654 + .pool +_080A3614: + mov r0, r9 + cmp r0, 0 + beq _080A3628 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_0869FB24 + b _080A3654 + .pool +_080A3628: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_0869E8F4 + b _080A3654 + .pool +_080A3638: + mov r3, r9 + cmp r3, 0 + beq _080A364C + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_086A0124 + b _080A3654 + .pool +_080A364C: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_0869EEF4 +_080A3654: + adds r0, r1 + bl sub_82E1674 + ldr r1, =0x020383e8 + str r0, [r1] +_080A365E: + 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_80A344C + + thumb_func_start sub_80A3678 +sub_80A3678: @ 80A3678 + push {lr} + ldr r0, =sub_80A370C + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080A3694 + bl sub_8000964 + movs r0, 0x1 + b _080A3696 + .pool +_080A3694: + movs r0, 0 +_080A3696: + pop {r1} + bx r1 + thumb_func_end sub_80A3678 + + thumb_func_start sub_80A369C +sub_80A369C: @ 80A369C + push {lr} + ldr r0, =0x020383e8 + ldr r0, [r0] + bl MPlayStop_rev01 + bl sub_8000964 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A369C + + thumb_func_start sub_80A36B4 +sub_80A36B4: @ 80A36B4 + push {lr} + ldr r0, =0x020383e8 + ldr r0, [r0] + bl MPlayStop_rev01 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A36B4 + + thumb_func_start sub_80A36C8 +sub_80A36C8: @ 80A36C8 + push {lr} + ldr r0, =0x020383e8 + ldr r0, [r0] + bl sub_82E17CC + cmp r0, 0 + bne _080A36E4 + bl sub_8000964 + movs r0, 0 + b _080A36E6 + .pool +_080A36E4: + movs r0, 0x1 +_080A36E6: + pop {r1} + bx r1 + thumb_func_end sub_80A36C8 + + thumb_func_start sub_80A36EC +sub_80A36EC: @ 80A36EC + push {lr} + ldr r0, =0x020383e8 + ldr r0, [r0] + bl sub_82E17CC + cmp r0, 0 + bne _080A3704 + movs r0, 0 + b _080A3706 + .pool +_080A3704: + movs r0, 0x1 +_080A3706: + pop {r1} + bx r1 + thumb_func_end sub_80A36EC + + thumb_func_start sub_80A370C +sub_80A370C: @ 80A370C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =0x020383ec + ldrb r0, [r1] + cmp r0, 0 + beq _080A3724 + subs r0, 0x1 + strb r0, [r1] + b _080A3742 + .pool +_080A3724: + ldr r0, =0x020383e8 + ldr r0, [r0] + bl sub_82E17CC + cmp r0, 0 + bne _080A3742 + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl MPlayVolumeControl + adds r0, r4, 0 + bl DestroyTask +_080A3742: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A370C + + thumb_func_start sub_80A3754 +sub_80A3754: @ 80A3754 + push {r4,lr} + ldr r4, =sub_80A370C + adds r0, r4, 0 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080A376E + adds r0, r4, 0 + movs r1, 0x50 + bl CreateTask +_080A376E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3754 + + thumb_func_start song_play_for_text +song_play_for_text: @ 80A3778 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, =0x03005df8 + ldrb r0, [r0] + cmp r0, 0 + beq _080A3788 + movs r1, 0 +_080A3788: + ldr r0, =0x0000ffff + cmp r1, r0 + bne _080A3790 + movs r1, 0 +_080A3790: + adds r0, r1, 0 + bl m4aSongNumStart + pop {r0} + bx r0 + .pool + thumb_func_end song_play_for_text + + thumb_func_start audio_play +audio_play: @ 80A37A4 + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl m4aSongNumStart + pop {r0} + bx r0 + thumb_func_end audio_play + + thumb_func_start audio_play_and_stuff +audio_play_and_stuff: @ 80A37B4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r4, r1, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 24 + lsrs r4, 24 + bl m4aSongNumStart + ldr r6, =0x030075f0 + adds r0, r6, 0 + bl m4aMPlayImmInit + ldr r0, =0x03007630 + mov r8, r0 + bl m4aMPlayImmInit + ldr r5, =0x0000ffff + lsls r4, 24 + asrs r4, 24 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl MPlayPanpotControl + mov r0, r8 + adds r1, r5, 0 + adds r2, r4, 0 + bl MPlayPanpotControl + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end audio_play_and_stuff + + thumb_func_start sub_80A3808 +sub_80A3808: @ 80A3808 + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 24 + lsrs r4, 24 + bl m4aSongNumStart + ldr r5, =0x030075f0 + adds r0, r5, 0 + bl m4aMPlayImmInit + ldr r1, =0x0000ffff + lsls r4, 24 + asrs r4, 24 + adds r0, r5, 0 + adds r2, r4, 0 + bl MPlayPanpotControl + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3808 + + thumb_func_start sub_80A383C +sub_80A383C: @ 80A383C + push {r4,r5,lr} + adds r4, r1, 0 + lsls r0, 16 + lsrs r0, 16 + lsls r4, 24 + lsrs r4, 24 + bl m4aSongNumStart + ldr r5, =0x03007630 + adds r0, r5, 0 + bl m4aMPlayImmInit + ldr r1, =0x0000ffff + lsls r4, 24 + asrs r4, 24 + adds r0, r5, 0 + adds r2, r4, 0 + bl MPlayPanpotControl + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A383C + + thumb_func_start sub_80A3870 +sub_80A3870: @ 80A3870 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, =0x030075f0 + ldr r5, =0x0000ffff + lsls r4, 24 + asrs r4, 24 + adds r1, r5, 0 + adds r2, r4, 0 + bl MPlayPanpotControl + ldr r0, =0x03007630 + adds r1, r5, 0 + adds r2, r4, 0 + bl MPlayPanpotControl + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3870 + + thumb_func_start mplay_has_finished_maybe +mplay_has_finished_maybe: @ 80A38A0 + push {lr} + ldr r0, =0x030075f0 + ldr r1, [r0, 0x4] + movs r2, 0x80 + lsls r2, 24 + adds r3, r0, 0 + cmp r1, 0 + bge _080A38BA + ldr r0, =0x03007630 + ldr r0, [r0, 0x4] + ands r0, r2 + cmp r0, 0 + bne _080A38CC +_080A38BA: + ldr r1, =0x0000ffff + ldrh r0, [r3, 0x4] + cmp r0, 0 + bne _080A38DC + ldr r0, =0x03007630 + ldr r0, [r0, 0x4] + ands r0, r1 + cmp r0, 0 + bne _080A38DC +_080A38CC: + movs r0, 0 + b _080A38DE + .pool +_080A38DC: + movs r0, 0x1 +_080A38DE: + pop {r1} + bx r1 + thumb_func_end mplay_has_finished_maybe + + thumb_func_start sub_80A38E4 +sub_80A38E4: @ 80A38E4 + push {lr} + ldr r0, =0x03007420 + ldr r1, [r0, 0x4] + cmp r1, 0 + blt _080A3904 + ldr r0, =0x0000ffff + ands r1, r0 + cmp r1, 0 + beq _080A3904 + movs r0, 0x1 + b _080A3906 + .pool +_080A3904: + movs r0, 0 +_080A3906: + pop {r1} + bx r1 + thumb_func_end sub_80A38E4 + + thumb_func_start sub_80A390C +sub_80A390C: @ 80A390C + push {lr} + ldr r0, =0x03007800 + ldr r1, [r0, 0x4] + cmp r1, 0 + blt _080A392C + ldr r0, =0x0000ffff + ands r1, r0 + cmp r1, 0 + beq _080A392C + movs r0, 0x1 + b _080A392E + .pool +_080A392C: + movs r0, 0 +_080A392E: + pop {r1} + bx r1 + thumb_func_end sub_80A390C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/gpu_obj.s b/asm/sprite.s similarity index 99% rename from asm/gpu_obj.s rename to asm/sprite.s index dad412f9f..c7159827d 100644 --- a/asm/gpu_obj.s +++ b/asm/sprite.s @@ -1,4 +1,5 @@ .include "asm/macros.inc" + .include "constants/constants.inc" .syntax unified diff --git a/asm/start_menu.s b/asm/start_menu.s new file mode 100644 index 000000000..ce5fea008 --- /dev/null +++ b/asm/start_menu.s @@ -0,0 +1,2481 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start BuildStartMenuActions +BuildStartMenuActions: @ 809F440 + push {lr} + ldr r0, =0x0203760f + movs r1, 0 + strb r1, [r0] + bl is_c1_link_related_active + cmp r0, 0x1 + bne _0809F45C + bl BuildStartMenuActions_LinkMode + b _0809F4AC + .pool +_0809F45C: + bl InUnionRoom + cmp r0, 0x1 + bne _0809F46A + bl BuildStartMenuActions_UnionRoom + b _0809F4AC +_0809F46A: + bl GetSafariZoneFlag + cmp r0, 0x1 + bne _0809F478 + bl BuildStartMenuActions_SafariZone + b _0809F4AC +_0809F478: + bl InBattlePike + lsls r0, 24 + cmp r0, 0 + beq _0809F488 + bl BuildStartMenuActions_BattlePike + b _0809F4AC +_0809F488: + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _0809F498 + bl BuildStartMenuActions_BattlePyramid + b _0809F4AC +_0809F498: + bl in_multi_battle_room_with_var_condition + lsls r0, 24 + cmp r0, 0 + beq _0809F4A8 + bl BuildStartMenuActions_MultiBattleRoom + b _0809F4AC +_0809F4A8: + bl BuildStartMenuActions_Normal +_0809F4AC: + pop {r0} + bx r0 + thumb_func_end BuildStartMenuActions + + thumb_func_start AddStartMenuAction +@ void AddStartMenuAction(u8 entry) +AddStartMenuAction: @ 809F4B0 + push {lr} + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =0x02037610 + ldr r1, =0x0203760f + bl append_byte + pop {r0} + bx r0 + .pool + thumb_func_end AddStartMenuAction + + thumb_func_start BuildStartMenuActions_Normal +BuildStartMenuActions_Normal: @ 809F4CC + push {lr} + ldr r0, =0x00000861 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809F4E2 + movs r0, 0 + bl AddStartMenuAction +_0809F4E2: + movs r0, 0x86 + lsls r0, 4 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809F4F8 + movs r0, 0x1 + bl AddStartMenuAction +_0809F4F8: + movs r0, 0x2 + bl AddStartMenuAction + ldr r0, =0x00000862 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809F512 + movs r0, 0x3 + bl AddStartMenuAction +_0809F512: + movs r0, 0x4 + bl AddStartMenuAction + movs r0, 0x5 + bl AddStartMenuAction + movs r0, 0x6 + bl AddStartMenuAction + movs r0, 0x7 + bl AddStartMenuAction + pop {r0} + bx r0 + .pool + thumb_func_end BuildStartMenuActions_Normal + + thumb_func_start BuildStartMenuActions_SafariZone +BuildStartMenuActions_SafariZone: @ 809F538 + push {lr} + movs r0, 0x8 + bl AddStartMenuAction + movs r0, 0 + bl AddStartMenuAction + movs r0, 0x1 + bl AddStartMenuAction + movs r0, 0x2 + bl AddStartMenuAction + movs r0, 0x4 + bl AddStartMenuAction + movs r0, 0x6 + bl AddStartMenuAction + movs r0, 0x7 + bl AddStartMenuAction + pop {r0} + bx r0 + thumb_func_end BuildStartMenuActions_SafariZone + + thumb_func_start BuildStartMenuActions_LinkMode +BuildStartMenuActions_LinkMode: @ 809F568 + push {lr} + movs r0, 0x1 + bl AddStartMenuAction + movs r0, 0x2 + bl AddStartMenuAction + ldr r0, =0x00000862 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809F58A + movs r0, 0x3 + bl AddStartMenuAction +_0809F58A: + movs r0, 0x9 + bl AddStartMenuAction + movs r0, 0x6 + bl AddStartMenuAction + movs r0, 0x7 + bl AddStartMenuAction + pop {r0} + bx r0 + .pool + thumb_func_end BuildStartMenuActions_LinkMode + + thumb_func_start BuildStartMenuActions_UnionRoom +BuildStartMenuActions_UnionRoom: @ 809F5A4 + push {lr} + movs r0, 0x1 + bl AddStartMenuAction + movs r0, 0x2 + bl AddStartMenuAction + ldr r0, =0x00000862 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809F5C6 + movs r0, 0x3 + bl AddStartMenuAction +_0809F5C6: + movs r0, 0x4 + bl AddStartMenuAction + movs r0, 0x6 + bl AddStartMenuAction + movs r0, 0x7 + bl AddStartMenuAction + pop {r0} + bx r0 + .pool + thumb_func_end BuildStartMenuActions_UnionRoom + + thumb_func_start BuildStartMenuActions_BattlePike +BuildStartMenuActions_BattlePike: @ 809F5E0 + push {lr} + movs r0, 0 + bl AddStartMenuAction + movs r0, 0x1 + bl AddStartMenuAction + movs r0, 0x4 + bl AddStartMenuAction + movs r0, 0x6 + bl AddStartMenuAction + movs r0, 0x7 + bl AddStartMenuAction + pop {r0} + bx r0 + thumb_func_end BuildStartMenuActions_BattlePike + + thumb_func_start BuildStartMenuActions_BattlePyramid +BuildStartMenuActions_BattlePyramid: @ 809F604 + push {lr} + movs r0, 0x1 + bl AddStartMenuAction + movs r0, 0xC + bl AddStartMenuAction + movs r0, 0x4 + bl AddStartMenuAction + movs r0, 0xA + bl AddStartMenuAction + movs r0, 0xB + bl AddStartMenuAction + movs r0, 0x6 + bl AddStartMenuAction + movs r0, 0x7 + bl AddStartMenuAction + pop {r0} + bx r0 + thumb_func_end BuildStartMenuActions_BattlePyramid + + thumb_func_start BuildStartMenuActions_MultiBattleRoom +BuildStartMenuActions_MultiBattleRoom: @ 809F634 + push {lr} + movs r0, 0x1 + bl AddStartMenuAction + movs r0, 0x4 + bl AddStartMenuAction + movs r0, 0x6 + bl AddStartMenuAction + movs r0, 0x7 + bl AddStartMenuAction + pop {r0} + bx r0 + thumb_func_end BuildStartMenuActions_MultiBattleRoom + + thumb_func_start sub_809F654 +sub_809F654: @ 809F654 + push {r4,r5,lr} + sub sp, 0xC + ldr r4, =0x0203760c + ldr r0, =gUnknown_08510508 + bl AddWindow + strb r0, [r4] + ldrb r0, [r4] + bl PutWindowTilemap + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldr r0, =0x02021cc4 + ldr r1, =0x0203a04c + ldrb r1, [r1] + movs r2, 0x1 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r5, =0x02021fc4 + ldr r1, =gUnknown_085EE6FF + adds r0, r5, 0 + bl ExpandStringRefs + ldrb r0, [r4] + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0 + bl Print + ldrb r0, [r4] + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809F654 + + thumb_func_start sub_809F6C8 +sub_809F6C8: @ 809F6C8 + push {r4,r5,lr} + sub sp, 0xC + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0x7 + bne _0809F6F0 + ldr r4, =0x0203760d + ldr r0, =gUnknown_08510538 + b _0809F6F4 + .pool +_0809F6F0: + ldr r4, =0x0203760d + ldr r0, =gUnknown_08510530 +_0809F6F4: + bl AddWindow + strb r0, [r4] + ldr r4, =0x0203760d + ldrb r0, [r4] + bl PutWindowTilemap + ldrb r0, [r4] + movs r1, 0 + bl sub_81973FC + ldr r0, =0x02021cc4 + ldr r2, =gUnknown_08510510 + ldr r1, =0x03005d90 + ldr r1, [r1] + ldr r3, =0x00000cb2 + adds r1, r3 + ldrh r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl CopyString + ldr r5, =0x02021fc4 + ldr r1, =gUnknown_085EE716 + adds r0, r5, 0 + bl ExpandStringRefs + ldrb r0, [r4] + movs r1, 0x1 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0 + bl Print + ldrb r0, [r4] + movs r1, 0x2 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809F6C8 + + thumb_func_start RemoveExtraStartMenuWindows +RemoveExtraStartMenuWindows: @ 809F774 + push {r4,lr} + bl GetSafariZoneFlag + cmp r0, 0 + beq _0809F796 + ldr r4, =0x0203760c + ldrb r0, [r4] + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + movs r1, 0x2 + bl CopyWindowToVram + ldrb r0, [r4] + bl RemoveWindow +_0809F796: + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _0809F7B0 + ldr r4, =0x0203760d + ldrb r0, [r4] + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4] + bl RemoveWindow +_0809F7B0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end RemoveExtraStartMenuWindows + + thumb_func_start PrintStartMenuActions +PrintStartMenuActions: @ 809F7C0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r8, r0 + adds r6, r1, 0 + ldrb r2, [r0] + ldr r0, =gUnknown_08510540 + mov r9, r0 + ldr r1, =0x02021fc4 + mov r10, r1 +_0809F7DA: + ldr r0, =0x02037610 + lsls r2, 24 + asrs r4, r2, 24 + adds r5, r4, r0 + ldrb r0, [r5] + lsls r3, r0, 3 + mov r0, r9 + adds r0, 0x4 + adds r0, r3, r0 + ldr r1, [r0] + ldr r0, =StartMenu_PlayerName + adds r7, r2, 0 + cmp r1, r0 + bne _0809F828 + bl get_start_menu_window_id_maybe + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r5] + lsls r1, 3 + add r1, r9 + ldr r1, [r1] + lsls r3, r4, 4 + adds r3, 0x9 + lsls r3, 16 + lsrs r3, 16 + movs r2, 0x8 + bl sub_819A024 + b _0809F858 + .pool +_0809F828: + mov r1, r9 + adds r0, r3, r1 + ldr r1, [r0] + mov r0, r10 + bl ExpandStringRefs + bl get_start_menu_window_id_maybe + lsls r0, 24 + lsrs r0, 24 + lsls r1, r4, 4 + adds r1, 0x9 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + mov r2, r10 + movs r3, 0x8 + bl Print +_0809F858: + movs r0, 0x80 + lsls r0, 17 + adds r1, r7, r0 + lsrs r2, r1, 24 + asrs r1, 24 + ldr r0, =0x0203760f + ldrb r0, [r0] + cmp r1, r0 + bge _0809F87C + subs r6, 0x1 + cmp r6, 0 + bne _0809F7DA + mov r1, r8 + strb r2, [r1] + movs r0, 0 + b _0809F882 + .pool +_0809F87C: + mov r0, r8 + strb r2, [r0] + movs r0, 0x1 +_0809F882: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end PrintStartMenuActions + + thumb_func_start sub_809F894 +sub_809F894: @ 809F894 + push {r4,lr} + sub sp, 0xC + ldr r0, =0x02037619 + movs r1, 0 + ldrsb r1, [r0, r1] + adds r2, r0, 0 + cmp r1, 0x5 + bhi _0809F98C + lsls r0, r1, 2 + ldr r1, =_0809F8B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0809F8B8: + .4byte _0809F8D0 + .4byte _0809F8D8 + .4byte _0809F8E4 + .4byte _0809F90C + .4byte _0809F930 + .4byte _0809F94C +_0809F8D0: + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + b _0809F98C +_0809F8D8: + bl BuildStartMenuActions + ldr r1, =0x02037619 + b _0809F940 + .pool +_0809F8E4: + bl sub_81973A4 + ldr r0, =0x0203760f + ldrb r0, [r0] + bl sub_81979C4 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_81973FC + ldr r1, =0x02037619 + movs r0, 0 + strb r0, [r1, 0x1] + b _0809F940 + .pool +_0809F90C: + bl GetSafariZoneFlag + cmp r0, 0 + beq _0809F918 + bl sub_809F654 +_0809F918: + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _0809F926 + bl sub_809F6C8 +_0809F926: + ldr r1, =0x02037619 + b _0809F940 + .pool +_0809F930: + ldr r4, =0x0203761a + adds r0, r4, 0 + movs r1, 0x2 + bl PrintStartMenuActions + cmp r0, 0 + beq _0809F98C + subs r1, r4, 0x1 +_0809F940: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0809F98C + .pool +_0809F94C: + bl get_start_menu_window_id_maybe + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x10 + str r1, [sp] + ldr r1, =0x0203760f + ldrb r1, [r1] + str r1, [sp, 0x4] + ldr r4, =0x0203760e + ldrb r1, [r4] + str r1, [sp, 0x8] + movs r1, 0x1 + movs r2, 0 + movs r3, 0x9 + bl sub_81983AC + strb r0, [r4] + bl get_start_menu_window_id_maybe + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl CopyWindowToVram + movs r0, 0x1 + b _0809F98E + .pool +_0809F98C: + movs r0, 0 +_0809F98E: + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809F894 + + thumb_func_start sub_809F998 +sub_809F998: @ 809F998 + push {lr} + ldr r1, =0x02037619 + movs r0, 0 + strb r0, [r1] + strb r0, [r1, 0x1] +_0809F9A2: + bl sub_809F894 + cmp r0, 0 + beq _0809F9A2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_809F998 + + thumb_func_start task50_startmenu +task50_startmenu: @ 809F9B4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_809F894 + cmp r0, 0x1 + bne _0809F9C8 + adds r0, r4, 0 + bl SwitchTaskToFollowupFunc +_0809F9C8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end task50_startmenu + + thumb_func_start sub_809F9D0 +sub_809F9D0: @ 809F9D0 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r1, =0x02037619 + movs r0, 0 + strb r0, [r1] + strb r0, [r1, 0x1] + ldr r4, =task50_startmenu + adds r0, r4, 0 + movs r1, 0x50 + 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_809F9D0 + + thumb_func_start sub_809FA00 +sub_809FA00: @ 809FA00 + push {lr} + bl sub_809F894 + cmp r0, 0 + beq _0809FA12 + bl sub_80AF688 + movs r0, 0x1 + b _0809FA14 +_0809FA12: + movs r0, 0 +_0809FA14: + pop {r1} + bx r1 + thumb_func_end sub_809FA00 + + thumb_func_start sub_809FA18 +sub_809FA18: @ 809FA18 + ldr r1, =0x02037619 + movs r0, 0 + strb r0, [r1] + strb r0, [r1, 0x1] + ldr r1, =0x03005db0 + ldr r0, =sub_809FA00 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_809FA18 + + thumb_func_start sub_809FA34 +sub_809FA34: @ 809FA34 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0809FA58 + cmp r0, 0x1 + beq _0809FA7C + b _0809FA92 + .pool +_0809FA58: + bl InUnionRoom + cmp r0, 0x1 + bne _0809FA64 + bl var_800D_set_xB +_0809FA64: + ldr r1, =0x03005df4 + ldr r0, =HandleStartMenuInput + str r0, [r1] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0809FA92 + .pool +_0809FA7C: + ldr r0, =0x03005df4 + ldr r0, [r0] + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0809FA92 + adds r0, r5, 0 + bl DestroyTask +_0809FA92: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809FA34 + + thumb_func_start sub_809FA9C +sub_809FA9C: @ 809FA9C + push {lr} + bl is_c1_link_related_active + cmp r0, 0 + bne _0809FAB2 + bl player_bitmagic + bl sub_808B864 + bl sub_808BCF4 +_0809FAB2: + ldr r0, =sub_809FA34 + bl sub_809F9D0 + bl script_env_2_enable + pop {r0} + bx r0 + .pool + thumb_func_end sub_809FA9C + + thumb_func_start HandleStartMenuInput +HandleStartMenuInput: @ 809FAC4 + push {r4,lr} + ldr r4, =0x030022c0 + ldrh r1, [r4, 0x2E] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0809FAE4 + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + negs r0, r0 + bl MoveMenuCursor + ldr r1, =0x0203760e + strb r0, [r1] +_0809FAE4: + ldrh r1, [r4, 0x2E] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809FAFE + movs r0, 0x5 + bl audio_play + movs r0, 0x1 + bl MoveMenuCursor + ldr r1, =0x0203760e + strb r0, [r1] +_0809FAFE: + ldrh r1, [r4, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0809FB98 + movs r0, 0x5 + bl audio_play + ldr r1, =gUnknown_08510540 + ldr r2, =0x02037610 + ldr r0, =0x0203760e + ldrb r0, [r0] + adds r0, r2 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r1, [r0] + ldr r0, =StartMenu_Pokedex + cmp r1, r0 + bne _0809FB34 + movs r0, 0 + bl pokedex_count + lsls r0, 16 + cmp r0, 0 + beq _0809FBA0 +_0809FB34: + ldr r3, =0x03005df4 + ldr r1, =gUnknown_08510540 + ldr r2, =0x02037610 + ldr r0, =0x0203760e + ldrb r0, [r0] + adds r0, r2 + ldrb r0, [r0] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r1, [r0] + str r1, [r3] + ldr r0, =StartMenu_Save + cmp r1, r0 + beq _0809FBA0 + ldr r0, =StartMenu_Exit + cmp r1, r0 + beq _0809FBA0 + ldr r0, =StartMenu_SafariZoneRetire + cmp r1, r0 + beq _0809FBA0 + ldr r0, =StartMenu_BattlePyramidRetire + cmp r1, r0 + beq _0809FBA0 + movs r0, 0x1 + movs r1, 0 + bl fade_screen + b _0809FBA0 + .pool +_0809FB98: + movs r0, 0xA + ands r0, r1 + cmp r0, 0 + bne _0809FBA4 +_0809FBA0: + movs r0, 0 + b _0809FBAE +_0809FBA4: + bl RemoveExtraStartMenuWindows + bl sub_80A0934 + movs r0, 0x1 +_0809FBAE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end HandleStartMenuInput + + thumb_func_start StartMenu_Pokedex +StartMenu_Pokedex: @ 809FBB4 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809FBCC + movs r0, 0 + b _0809FBE6 + .pool +_0809FBCC: + movs r0, 0x29 + bl sav12_xor_increment + bl play_some_sound + bl RemoveExtraStartMenuWindows + bl overworld_free_bg_tilemaps + ldr r0, =sub_80BB534 + bl SetMainCallback2 + movs r0, 0x1 +_0809FBE6: + pop {r1} + bx r1 + .pool + thumb_func_end StartMenu_Pokedex + + thumb_func_start StartMenu_Pokemon +StartMenu_Pokemon: @ 809FBF0 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809FC08 + movs r0, 0 + b _0809FC1C + .pool +_0809FC08: + bl play_some_sound + bl RemoveExtraStartMenuWindows + bl overworld_free_bg_tilemaps + ldr r0, =CB2_PartyMenuFromStartMenu + bl SetMainCallback2 + movs r0, 0x1 +_0809FC1C: + pop {r1} + bx r1 + .pool + thumb_func_end StartMenu_Pokemon + + thumb_func_start StartMenu_Bag +StartMenu_Bag: @ 809FC24 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809FC3C + movs r0, 0 + b _0809FC50 + .pool +_0809FC3C: + bl play_some_sound + bl RemoveExtraStartMenuWindows + bl overworld_free_bg_tilemaps + ldr r0, =CB2_BagMenuFromStartMenu + bl SetMainCallback2 + movs r0, 0x1 +_0809FC50: + pop {r1} + bx r1 + .pool + thumb_func_end StartMenu_Bag + + thumb_func_start StartMenu_PokeNav +StartMenu_PokeNav: @ 809FC58 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809FC70 + movs r0, 0 + b _0809FC84 + .pool +_0809FC70: + bl play_some_sound + bl RemoveExtraStartMenuWindows + bl overworld_free_bg_tilemaps + ldr r0, =CB2_PokeNav + bl SetMainCallback2 + movs r0, 0x1 +_0809FC84: + pop {r1} + bx r1 + .pool + thumb_func_end StartMenu_PokeNav + + thumb_func_start StartMenu_PlayerName +StartMenu_PlayerName: @ 809FC8C + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0809FCF4 + bl play_some_sound + bl RemoveExtraStartMenuWindows + bl overworld_free_bg_tilemaps + bl is_c1_link_related_active + cmp r0, 0 + bne _0809FCB6 + bl InUnionRoom + cmp r0, 0 + beq _0809FCC8 +_0809FCB6: + ldr r0, =sub_8086194 + bl sub_80C4DDC + b _0809FCEA + .pool +_0809FCC8: + ldr r0, =0x000008d2 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _0809FCE4 + ldr r0, =sub_8086194 + bl sub_80C51C4 + b _0809FCEA + .pool +_0809FCE4: + ldr r0, =sub_8086194 + bl sub_80C4DDC +_0809FCEA: + movs r0, 0x1 + b _0809FCF6 + .pool +_0809FCF4: + movs r0, 0 +_0809FCF6: + pop {r1} + bx r1 + thumb_func_end StartMenu_PlayerName + + thumb_func_start StartMenu_Save +StartMenu_Save: @ 809FCFC + push {lr} + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _0809FD0C + bl RemoveExtraStartMenuWindows +_0809FD0C: + ldr r1, =0x03005df4 + ldr r0, =sub_809FE28 + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end StartMenu_Save + + thumb_func_start StartMenu_Option +StartMenu_Option: @ 809FD20 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809FD38 + movs r0, 0 + b _0809FD52 + .pool +_0809FD38: + bl play_some_sound + bl RemoveExtraStartMenuWindows + bl overworld_free_bg_tilemaps + ldr r0, =CB2_OptionsMenu + bl SetMainCallback2 + ldr r1, =0x030022c0 + ldr r0, =sub_8086194 + str r0, [r1, 0x8] + movs r0, 0x1 +_0809FD52: + pop {r1} + bx r1 + .pool + thumb_func_end StartMenu_Option + + thumb_func_start StartMenu_Exit +StartMenu_Exit: @ 809FD64 + push {lr} + bl RemoveExtraStartMenuWindows + bl sub_80A0934 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end StartMenu_Exit + + thumb_func_start StartMenu_SafariZoneRetire +StartMenu_SafariZoneRetire: @ 809FD74 + push {lr} + bl RemoveExtraStartMenuWindows + bl sub_80A0934 + bl sub_80FC180 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end StartMenu_SafariZoneRetire + + thumb_func_start StartMenu_LinkModePlayerName +StartMenu_LinkModePlayerName: @ 809FD88 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809FDA0 + movs r0, 0 + b _0809FDB4 + .pool +_0809FDA0: + bl play_some_sound + bl overworld_free_bg_tilemaps + ldr r0, =0x03005db4 + ldrb r0, [r0] + ldr r1, =sub_8086194 + bl sub_80C4E74 + movs r0, 0x1 +_0809FDB4: + pop {r1} + bx r1 + .pool + thumb_func_end StartMenu_LinkModePlayerName + + thumb_func_start StartMenu_BattlePyramidRetire +StartMenu_BattlePyramidRetire: @ 809FDC0 + ldr r1, =0x03005df4 + ldr r0, =sub_809FE9C + str r0, [r1] + movs r0, 0 + bx lr + .pool + thumb_func_end StartMenu_BattlePyramidRetire + + thumb_func_start sub_809FDD4 +sub_809FDD4: @ 809FDD4 + push {lr} + movs r0, 0 + movs r1, 0 + bl sub_8197DF8 + bl sub_80984F4 + ldr r0, =sub_809FA34 + bl sub_809F9D0 + bl script_env_2_enable + pop {r0} + bx r0 + .pool + thumb_func_end sub_809FDD4 + + thumb_func_start StartMenu_BattlePyramidBag +StartMenu_BattlePyramidBag: @ 809FDF4 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809FE0C + movs r0, 0 + b _0809FE20 + .pool +_0809FE0C: + bl play_some_sound + bl RemoveExtraStartMenuWindows + bl overworld_free_bg_tilemaps + ldr r0, =sub_81C4EFC + bl SetMainCallback2 + movs r0, 0x1 +_0809FE20: + pop {r1} + bx r1 + .pool + thumb_func_end StartMenu_BattlePyramidBag + + thumb_func_start sub_809FE28 +sub_809FE28: @ 809FE28 + push {lr} + bl sub_809FF28 + ldr r1, =0x03005df4 + ldr r0, =sub_809FE44 + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809FE28 + + thumb_func_start sub_809FE44 +sub_809FE44: @ 809FE44 + push {lr} + bl sub_809FF4C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809FE7C + cmp r0, 0x1 + ble _0809FE94 + cmp r0, 0x2 + beq _0809FE60 + cmp r0, 0x3 + beq _0809FE7C + b _0809FE94 +_0809FE60: + movs r0, 0 + movs r1, 0 + bl sub_8197DF8 + bl sub_809F998 + ldr r1, =0x03005df4 + ldr r0, =HandleStartMenuInput + str r0, [r1] + b _0809FE94 + .pool +_0809FE7C: + movs r0, 0 + movs r1, 0x1 + bl sub_8197DF8 + bl sub_80984F4 + bl script_env_2_disable + bl sub_81A9EC8 + movs r0, 0x1 + b _0809FE96 +_0809FE94: + movs r0, 0 +_0809FE96: + pop {r1} + bx r1 + thumb_func_end sub_809FE44 + + thumb_func_start sub_809FE9C +sub_809FE9C: @ 809FE9C + push {lr} + bl sub_80A0340 + ldr r1, =0x03005df4 + ldr r0, =sub_809FED4 + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809FE9C + + thumb_func_start sub_809FEB8 +sub_809FEB8: @ 809FEB8 + push {lr} + bl sub_809F998 + ldr r1, =0x03005df4 + ldr r0, =HandleStartMenuInput + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_809FEB8 + + thumb_func_start sub_809FED4 +sub_809FED4: @ 809FED4 + push {lr} + bl sub_809FF4C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0809FEEC + cmp r0, 0x1 + ble _0809FF20 + cmp r0, 0x2 + beq _0809FF00 + b _0809FF20 +_0809FEEC: + bl RemoveExtraStartMenuWindows + ldr r1, =0x03005df4 + ldr r0, =sub_809FEB8 + str r0, [r1] + b _0809FF20 + .pool +_0809FF00: + movs r0, 0 + movs r1, 0x1 + bl sub_8197DF8 + bl sub_80984F4 + bl script_env_2_disable + ldr r0, =gUnknown_08252C88 + bl script_env_1_execute_new_script + movs r0, 0x1 + b _0809FF22 + .pool +_0809FF20: + movs r0, 0 +_0809FF22: + pop {r1} + bx r1 + thumb_func_end sub_809FED4 + + thumb_func_start sub_809FF28 +sub_809FF28: @ 809FF28 + push {lr} + bl save_serialize_map + ldr r1, =0x0203761c + ldr r0, =sub_80A00A0 + str r0, [r1] + ldr r1, =0x02037621 + movs r0, 0 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_809FF28 + + thumb_func_start sub_809FF4C +sub_809FF4C: @ 809FF4C + push {lr} + bl sub_8197224 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + beq _0809FF78 + ldr r1, =0x02037621 + movs r0, 0 + strb r0, [r1] + ldr r0, =0x0203761c + ldr r0, [r0] + bl _call_via_r0 + lsls r0, 24 + lsrs r0, 24 + b _0809FF7A + .pool +_0809FF78: + movs r0, 0 +_0809FF7A: + pop {r1} + bx r1 + thumb_func_end sub_809FF4C + + thumb_func_start sub_809FF80 +sub_809FF80: @ 809FF80 + push {lr} + bl sub_809FF28 + ldr r0, =task50_save_game + movs r1, 0x50 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_809FF80 + + thumb_func_start sub_809FF98 +sub_809FF98: @ 809FF98 + push {r4,lr} + adds r2, r0, 0 + adds r4, r1, 0 + ldr r0, =0x02021fc4 + adds r1, r2, 0 + bl ExpandStringRefs + movs r0, 0 + movs r1, 0x1 + bl sub_819786C + movs r0, 0x1 + bl AddTextPrinterForMessage_2 + ldr r1, =0x02037621 + movs r0, 0x1 + strb r0, [r1] + ldr r0, =0x0203761c + str r4, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809FF98 + + thumb_func_start task50_save_game +task50_save_game: @ 809FFD0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_809FF4C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + beq _0809FFFC + cmp r1, 0x1 + bgt _0809FFEC + cmp r1, 0 + beq _080A000A + b _080A0000 +_0809FFEC: + cmp r1, 0x3 + bgt _080A0000 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + b _080A0000 + .pool +_0809FFFC: + ldr r0, =0x020375f0 + strh r1, [r0] +_080A0000: + adds r0, r4, 0 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running +_080A000A: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end task50_save_game + + thumb_func_start sub_80A0014 +sub_80A0014: @ 80A0014 + push {lr} + movs r0, 0 + movs r1, 0x1 + bl sub_8197434 + pop {r0} + bx r0 + thumb_func_end sub_80A0014 + + thumb_func_start sub_80A0024 +sub_80A0024: @ 80A0024 + push {lr} + bl sub_80A0888 + pop {r0} + bx r0 + thumb_func_end sub_80A0024 + + thumb_func_start sub_80A0030 +sub_80A0030: @ 80A0030 + ldr r1, =0x02037620 + movs r0, 0x3C + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_80A0030 + + thumb_func_start sub_80A003C +sub_80A003C: @ 80A003C + push {lr} + ldr r1, =0x02037620 + ldrb r0, [r1] + subs r2, r0, 0x1 + strb r2, [r1] + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2C] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080A0064 + lsls r0, r2, 24 + cmp r0, 0 + beq _080A006A + movs r0, 0 + b _080A006C + .pool +_080A0064: + movs r0, 0x5 + bl audio_play +_080A006A: + movs r0, 0x1 +_080A006C: + pop {r1} + bx r1 + thumb_func_end sub_80A003C + + thumb_func_start sub_80A0070 +sub_80A0070: @ 80A0070 + push {lr} + ldr r1, =0x02037620 + ldrb r0, [r1] + cmp r0, 0 + bne _080A0094 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2C] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A0098 + movs r0, 0x1 + b _080A009A + .pool +_080A0094: + subs r0, 0x1 + strb r0, [r1] +_080A0098: + movs r0, 0 +_080A009A: + pop {r1} + bx r1 + thumb_func_end sub_80A0070 + + thumb_func_start sub_80A00A0 +sub_80A00A0: @ 80A00A0 + push {lr} + bl get_start_menu_window_id_maybe + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_819746C + bl remove_start_menu_window_maybe + bl sub_80A06B4 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _080A00D4 + ldr r0, =gUnknown_08252CA7 + ldr r1, =sub_80A00EC + bl sub_809FF98 + b _080A00DC + .pool +_080A00D4: + ldr r0, =gUnknown_082C87B4 + ldr r1, =sub_80A00EC + bl sub_809FF98 +_080A00DC: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A00A0 + + thumb_func_start sub_80A00EC +sub_80A00EC: @ 80A00EC + push {lr} + bl sub_8197930 + ldr r1, =0x0203761c + ldr r0, =sub_80A0108 + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A00EC + + thumb_func_start sub_80A0108 +sub_80A0108: @ 80A0108 + push {lr} + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _080A012A + cmp r1, 0 + bgt _080A0124 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080A0168 + b _080A0174 +_080A0124: + cmp r1, 0x1 + beq _080A0168 + b _080A0174 +_080A012A: + ldr r0, =0x03006210 + ldrh r0, [r0] + cmp r0, 0 + beq _080A0136 + cmp r0, 0x2 + bne _080A013E +_080A0136: + ldr r0, =0x020322d4 + ldrb r0, [r0] + cmp r0, 0 + bne _080A0158 +_080A013E: + ldr r1, =0x0203761c + ldr r0, =sub_80A017C + str r0, [r1] + b _080A0174 + .pool +_080A0158: + ldr r1, =0x0203761c + ldr r0, =sub_80A0234 + str r0, [r1] + b _080A0174 + .pool +_080A0168: + bl sub_80A0024 + bl sub_80A0014 + movs r0, 0x2 + b _080A0176 +_080A0174: + movs r0, 0 +_080A0176: + pop {r1} + bx r1 + thumb_func_end sub_80A0108 + + thumb_func_start sub_80A017C +sub_80A017C: @ 80A017C + push {lr} + ldr r0, =0x020322d4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080A019C + ldr r0, =gUnknown_082C8845 + ldr r1, =sub_80A01B4 + bl sub_809FF98 + b _080A01A4 + .pool +_080A019C: + ldr r0, =gUnknown_082C87D5 + ldr r1, =sub_80A01D0 + bl sub_809FF98 +_080A01A4: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A017C + + thumb_func_start sub_80A01B4 +sub_80A01B4: @ 80A01B4 + push {lr} + movs r0, 0x1 + bl sub_8197948 + ldr r1, =0x0203761c + ldr r0, =sub_80A01EC + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A01B4 + + thumb_func_start sub_80A01D0 +sub_80A01D0: @ 80A01D0 + push {lr} + bl sub_8197930 + ldr r1, =0x0203761c + ldr r0, =sub_80A01EC + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A01D0 + + thumb_func_start sub_80A01EC +sub_80A01EC: @ 80A01EC + push {lr} + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _080A020E + cmp r1, 0 + bgt _080A0208 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080A0220 + b _080A022C +_080A0208: + cmp r1, 0x1 + beq _080A0220 + b _080A022C +_080A020E: + ldr r1, =0x0203761c + ldr r0, =sub_80A0234 + str r0, [r1] + b _080A022C + .pool +_080A0220: + bl sub_80A0024 + bl sub_80A0014 + movs r0, 0x2 + b _080A022E +_080A022C: + movs r0, 0 +_080A022E: + pop {r1} + bx r1 + thumb_func_end sub_80A01EC + + thumb_func_start sub_80A0234 +sub_80A0234: @ 80A0234 + push {lr} + ldr r0, =gUnknown_082C8810 + ldr r1, =sub_80A024C + bl sub_809FF98 + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A0234 + + thumb_func_start sub_80A024C +sub_80A024C: @ 80A024C + push {r4,lr} + movs r0, 0 + bl sav12_xor_increment + bl sub_81A9E90 + ldr r4, =0x020322d4 + ldrb r0, [r4] + cmp r0, 0x1 + bne _080A0274 + movs r0, 0x4 + bl save_game_when_memory_present + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0 + strb r0, [r4] + b _080A027E + .pool +_080A0274: + movs r0, 0 + bl save_game_when_memory_present + lsls r0, 24 + lsrs r1, r0, 24 +_080A027E: + cmp r1, 0x1 + bne _080A0294 + ldr r0, =gUnknown_082C8832 + ldr r1, =sub_80A02B0 + bl sub_809FF98 + b _080A029C + .pool +_080A0294: + ldr r0, =gUnknown_082C892A + ldr r1, =sub_80A02FC + bl sub_809FF98 +_080A029C: + bl sub_80A0030 + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A024C + + thumb_func_start sub_80A02B0 +sub_80A02B0: @ 80A02B0 + push {lr} + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _080A02CA + movs r0, 0x37 + bl audio_play + ldr r1, =0x0203761c + ldr r0, =sub_80A02D8 + str r0, [r1] +_080A02CA: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A02B0 + + thumb_func_start sub_80A02D8 +sub_80A02D8: @ 80A02D8 + push {lr} + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _080A02F6 + bl sub_80A003C + lsls r0, 24 + cmp r0, 0 + beq _080A02F6 + bl sub_80A0024 + movs r0, 0x1 + b _080A02F8 +_080A02F6: + movs r0, 0 +_080A02F8: + pop {r1} + bx r1 + thumb_func_end sub_80A02D8 + + thumb_func_start sub_80A02FC +sub_80A02FC: @ 80A02FC + push {lr} + movs r0, 0 + bl IsTextPrinterActive + lsls r0, 16 + cmp r0, 0 + bne _080A0316 + movs r0, 0x16 + bl audio_play + ldr r1, =0x0203761c + ldr r0, =sub_80A0324 + str r0, [r1] +_080A0316: + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A02FC + + thumb_func_start sub_80A0324 +sub_80A0324: @ 80A0324 + push {lr} + bl sub_80A0070 + lsls r0, 24 + cmp r0, 0 + beq _080A0338 + bl sub_80A0024 + movs r0, 0x3 + b _080A033A +_080A0338: + movs r0, 0 +_080A033A: + pop {r1} + bx r1 + thumb_func_end sub_80A0324 + + thumb_func_start sub_80A0340 +sub_80A0340: @ 80A0340 + ldr r1, =0x0203761c + ldr r0, =sub_80A035C + str r0, [r1] + ldr r1, =0x02037621 + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_80A0340 + + thumb_func_start sub_80A035C +sub_80A035C: @ 80A035C + push {lr} + bl get_start_menu_window_id_maybe + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl sub_819746C + bl remove_start_menu_window_maybe + ldr r0, =gUnknown_08252CFB + ldr r1, =sub_80A0388 + bl sub_809FF98 + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A035C + + thumb_func_start sub_80A0388 +sub_80A0388: @ 80A0388 + push {lr} + movs r0, 0x1 + bl sub_8197948 + ldr r1, =0x0203761c + ldr r0, =sub_80A03A4 + str r0, [r1] + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A0388 + + thumb_func_start sub_80A03A4 +sub_80A03A4: @ 80A03A4 + push {lr} + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _080A03C6 + cmp r1, 0 + bgt _080A03C0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080A03CA + b _080A03D2 +_080A03C0: + cmp r1, 0x1 + beq _080A03CA + b _080A03D2 +_080A03C6: + movs r0, 0x2 + b _080A03D4 +_080A03CA: + bl sub_80A0014 + movs r0, 0x1 + b _080A03D4 +_080A03D2: + movs r0, 0 +_080A03D4: + pop {r1} + bx r1 + thumb_func_end sub_80A03A4 + + thumb_func_start sub_80A03D8 +sub_80A03D8: @ 80A03D8 + push {lr} + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_80A03D8 + + thumb_func_start sub_80A03E4 +sub_80A03E4: @ 80A03E4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + mov r8, r0 + ldrb r0, [r0] + cmp r0, 0x4 + bls _080A03F6 + b _080A04FC +_080A03F6: + lsls r0, 2 + ldr r1, =_080A0404 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080A0404: + .4byte _080A0418 + .4byte _080A0490 + .4byte _080A04A2 + .4byte _080A04D4 + .4byte _080A04F8 +_080A0418: + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0 + bl SetVBlankCallback + bl remove_some_task + movs r2, 0xA0 + lsls r2, 19 + mov r1, sp + movs r0, 0 + strh r0, [r1] + ldr r1, =0x040000d4 + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + ldr r0, =0x81000200 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r2, 0xC0 + lsls r2, 19 + movs r3, 0xC0 + lsls r3, 9 + mov r4, sp + movs r6, 0 + movs r5, 0x80 + lsls r5, 5 + ldr r7, =0x81000800 + movs r0, 0x81 + lsls r0, 24 + mov r12, r0 +_080A045A: + strh r6, [r4] + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + str r7, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r2, r5 + subs r3, r5 + cmp r3, r5 + bhi _080A045A + strh r6, [r4] + mov r0, sp + str r0, [r1] + str r2, [r1, 0x4] + lsrs r0, r3, 1 + mov r2, r12 + orrs r0, r2 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + b _080A04FC + .pool +_080A0490: + bl ResetAllObjectData + bl ResetTasks + bl sub_80A1A74 + bl dp12_8087EA4 + b _080A04FC +_080A04A2: + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085105A8 + movs r0, 0 + movs r2, 0x1 + bl InitBgsFromTemplates + ldr r0, =gUnknown_085105AC + bl InitWindows + movs r0, 0 + movs r1, 0x8 + movs r2, 0xE0 + bl box_border_load_tiles_and_pal + movs r0, 0xF0 + bl sub_81978B0 + b _080A04FC + .pool +_080A04D4: + movs r0, 0 + bl ShowBg + movs r0, 0x1 + negs r0, r0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + ldr r0, =sub_80A03D8 + bl SetVBlankCallback + movs r0, 0x1 + bl EnableInterrupts + b _080A04FC + .pool +_080A04F8: + movs r0, 0x1 + b _080A0506 +_080A04FC: + mov r1, r8 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0 +_080A0506: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A03E4 + + thumb_func_start sub_80A0514 +sub_80A0514: @ 80A0514 + push {lr} + ldr r0, =0x030026f8 + bl sub_80A03E4 + cmp r0, 0 + beq _080A052E + ldr r0, =sub_80A0550 + movs r1, 0x50 + bl CreateTask + ldr r0, =sub_80A0540 + bl SetMainCallback2 +_080A052E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A0514 + + thumb_func_start sub_80A0540 +sub_80A0540: @ 80A0540 + push {lr} + bl RunTasks + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_80A0540 + + thumb_func_start sub_80A0550 +sub_80A0550: @ 80A0550 + push {r4-r6,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r5, r0, r1 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080A0570 + b _080A06A8 +_080A0570: + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x6 + bls _080A057A + b _080A06A8 +_080A057A: + lsls r0, 2 + ldr r1, =_080A0590 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080A0590: + .4byte _080A05AC + .4byte _080A0630 + .4byte _080A063C + .4byte _080A065C + .4byte _080A0670 + .4byte _080A0688 + .4byte _080A0698 +_080A05AC: + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_082C8959 + movs r4, 0 + str r4, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r6, 0x1 + str r6, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0 + movs r1, 0x1 + movs r3, 0xFF + bl AddTextPrinterParametrized + movs r0, 0 + movs r1, 0x8 + movs r2, 0xE + bl sub_8098858 + movs r0, 0 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _080A0620 + bl InUnionRoom + cmp r0, 0 + beq _080A0620 + bl sub_800A07C + cmp r0, 0 + beq _080A061C + strh r6, [r5] + b _080A06A8 + .pool +_080A061C: + movs r0, 0x5 + b _080A06A6 +_080A0620: + ldr r0, =0x03002700 + movs r1, 0x1 + strb r1, [r0] + movs r0, 0x1 + b _080A06A6 + .pool +_080A0630: + bl sub_8076D5C + bl sub_8153430 + movs r0, 0x2 + b _080A06A6 +_080A063C: + bl sub_8153474 + lsls r0, 24 + cmp r0, 0 + beq _080A06A8 + bl sav2_gender2_inplace_and_xFE + movs r0, 0x3 + strh r0, [r5] + ldr r1, =0x03002700 + movs r0, 0 + strb r0, [r1] + b _080A06A8 + .pool +_080A065C: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + movs r0, 0x4 + b _080A06A6 +_080A0670: + bl FreeAllWindowBuffers + ldr r0, =0x030022c0 + ldr r0, [r0, 0x8] + bl SetMainCallback2 + adds r0, r4, 0 + bl DestroyTask + b _080A06A8 + .pool +_080A0688: + ldr r0, =sub_8153688 + movs r1, 0x5 + bl CreateTask + movs r0, 0x6 + b _080A06A6 + .pool +_080A0698: + ldr r0, =sub_8153688 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + bne _080A06A8 + movs r0, 0x3 +_080A06A6: + strh r0, [r5] +_080A06A8: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A0550 + + thumb_func_start sub_80A06B4 +sub_80A06B4: @ 80A06B4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + ldr r0, =gUnknown_085105BC + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0xC] + str r1, [sp, 0x10] + ldr r0, =0x00000861 + mov r10, r0 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _080A06EC + add r0, sp, 0xC + ldrb r1, [r0, 0x4] + subs r1, 0x2 + lsls r1, 24 + lsrs r1, 24 + ldr r2, =0xffffff00 + ldr r0, [sp, 0x10] + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x10] +_080A06EC: + ldr r6, =0x02037622 + add r0, sp, 0xC + bl AddWindow + strb r0, [r6] + ldrb r0, [r6] + movs r1, 0 + bl sub_81973FC + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + movs r1, 0x4 + mov r9, r1 + cmp r0, 0 + bne _080A0710 + movs r0, 0x8 + mov r9, r0 +_080A0710: + movs r4, 0x1 + ldr r5, =0x02021fc4 + movs r0, 0x3 + adds r1, r5, 0 + movs r2, 0x6 + bl sub_819A344 + ldrb r0, [r6] + str r4, [sp] + movs r1, 0xFF + mov r8, r1 + str r1, [sp, 0x4] + movs r7, 0 + str r7, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + movs r3, 0 + bl Print + movs r4, 0x11 + ldrb r0, [r6] + ldr r2, =gUnknown_085EED26 + str r4, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + adds r1, r5, 0 + mov r2, r9 + bl sub_819A344 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x70 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + ldrb r0, [r6] + lsls r2, 16 + lsrs r2, 16 + adds r1, r5, 0 + movs r3, 0x11 + bl sub_819A024 + movs r4, 0x21 + ldrb r0, [r6] + ldr r2, =gUnknown_085EED2D + str r4, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0x4 + adds r1, r5, 0 + mov r2, r9 + bl sub_819A344 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x70 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + ldrb r0, [r6] + lsls r3, r2, 24 + lsrs r3, 24 + str r4, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + bl Print + mov r0, r10 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080A0802 + movs r4, 0x31 + ldrb r0, [r6] + ldr r2, =gUnknown_085EED34 + str r4, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0x1 + adds r1, r5, 0 + mov r2, r9 + bl sub_819A344 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x70 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + ldrb r0, [r6] + lsls r3, r2, 24 + lsrs r3, 24 + str r4, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + bl Print +_080A0802: + adds r4, 0x10 + ldrb r0, [r6] + ldr r2, =gUnknown_085EED3C + lsls r4, 24 + lsrs r4, 24 + str r4, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0x2 + adds r1, r5, 0 + mov r2, r9 + bl sub_819A344 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x70 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + ldrb r0, [r6] + lsls r3, r2, 24 + lsrs r3, 24 + str r4, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r7, [sp, 0x8] + movs r1, 0x1 + adds r2, r5, 0 + bl Print + ldrb r0, [r6] + 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 + .pool + thumb_func_end sub_80A06B4 + + thumb_func_start sub_80A0888 +sub_80A0888: @ 80A0888 + push {r4,lr} + ldr r4, =0x02037622 + ldrb r0, [r4] + movs r1, 0 + bl sub_819746C + ldrb r0, [r4] + bl RemoveWindow + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A0888 + + thumb_func_start sub_80A08A4 +sub_80A08A4: @ 80A08A4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =sub_8153688 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + bne _080A08C0 + adds r0, r4, 0 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running +_080A08C0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A08A4 + + thumb_func_start sub_80A08CC +sub_80A08CC: @ 80A08CC + push {r4,r5,lr} + ldr r0, =sub_8153688 + movs r1, 0x5 + bl CreateTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r5 + movs r1, 0x1 + strh r1, [r0, 0xC] + ldr r0, =sub_80A08A4 + movs r1, 0x6 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r5 + strh r4, [r1, 0xA] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A08CC + + thumb_func_start sub_80A0914 +sub_80A0914: @ 80A0914 + push {lr} + bl get_start_menu_window_id_maybe + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + bl sub_819746C + bl remove_start_menu_window_maybe + bl sub_80984F4 + bl script_env_2_disable + pop {r0} + bx r0 + thumb_func_end sub_80A0914 + + thumb_func_start sub_80A0934 +sub_80A0934: @ 80A0934 + push {lr} + movs r0, 0x5 + bl audio_play + bl sub_80A0914 + pop {r0} + bx r0 + thumb_func_end sub_80A0934 + + thumb_func_start append_byte +append_byte: @ 80A0944 + ldrb r3, [r1] + adds r0, r3 + strb r2, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bx lr + thumb_func_end append_byte + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/starter_choose.s b/asm/starter_choose.s new file mode 100644 index 000000000..b510499ea --- /dev/null +++ b/asm/starter_choose.s @@ -0,0 +1,985 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8133EDC +sub_8133EDC: @ 8133EDC + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0x3 + bls _08133EE8 + movs r1, 0 +_08133EE8: + ldr r0, =gUnknown_085B1DF8 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + pop {r1} + bx r1 + .pool + thumb_func_end sub_8133EDC + + thumb_func_start sub_8133EF8 +sub_8133EF8: @ 8133EF8 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_8133EF8 + + thumb_func_start set_256color_bg_bg0 +set_256color_bg_bg0: @ 8133F0C + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0xC + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0xE + movs r1, 0 + bl SetGpuReg + movs r0, 0xC + movs r1, 0 + bl SetGpuReg + movs r0, 0xA + movs r1, 0 + bl SetGpuReg + movs r0, 0x8 + movs r1, 0 + bl SetGpuReg + 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 + add r1, sp, 0x4 + movs r0, 0 + strh r0, [r1] + ldr r2, =0x040000d4 + str r1, [r2] + movs r1, 0xC0 + lsls r1, 19 + str r1, [r2, 0x4] + ldr r0, =0x8100c000 + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + movs r0, 0 + mov r9, r0 + str r0, [sp, 0x8] + add r0, sp, 0x8 + str r0, [r2] + movs r0, 0xE0 + lsls r0, 19 + str r0, [r2, 0x4] + ldr r0, =0x85000100 + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + add r0, sp, 0x4 + mov r3, r9 + strh r3, [r0] + str r0, [r2] + movs r0, 0xA0 + lsls r0, 19 + str r0, [r2, 0x4] + ldr r0, =0x81000200 + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + ldr r0, =gUnknown_085B0E04 + bl LZ77UnCompVram + ldr r0, =gUnknown_085B0A80 + ldr r1, =0x06003000 + bl LZ77UnCompVram + ldr r0, =gUnknown_085B0C0C + ldr r1, =0x06003800 + bl LZ77UnCompVram + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085B1E00 + movs r0, 0 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r0, =gUnknown_085B1DCC + bl InitWindows + bl DeactivateAllTextPrinters + movs r1, 0xAA + lsls r1, 2 + movs r0, 0 + movs r2, 0xD0 + bl sub_809882C + bl clear_scheduled_bg_copies_to_vram + bl remove_some_task + bl ResetTasks + bl ResetAllObjectData + bl sub_80A1A74 + bl ResetObjectPaletteAllocator + bl dp13_810BB8C + bl sub_8098C64 + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_085B0A00 + movs r1, 0 + movs r2, 0x40 + bl gpu_pal_apply + ldr r0, =gUnknown_085B1ED8 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085B1EE8 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085B1EF8 + bl LoadTaggedObjectPalettes + movs r0, 0x1 + negs r0, r0 + mov r1, r9 + str r1, [sp] + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r0, 0x1 + bl EnableInterrupts + ldr r0, =sub_8133EF8 + bl SetVBlankCallback + ldr r0, =sub_81341E0 + bl SetMainCallback2 + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x1F + bl SetGpuReg + movs r0, 0x40 + movs r1, 0 + bl SetGpuReg + movs r0, 0x44 + movs r1, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0xFE + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0x7 + bl SetGpuReg + movs r1, 0xC1 + lsls r1, 6 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + ldr r0, =sub_81341FC + movs r1, 0 + bl CreateTask + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r3, 0x1 + mov r10, r3 + mov r1, r10 + strh r1, [r0, 0x8] + ldr r0, =gUnknown_085B1F10 + movs r1, 0x78 + movs r2, 0x38 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x02020630 + mov r8, r3 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + strh r4, [r1, 0x2E] + ldr r6, =gUnknown_085B1F28 + ldr r5, =gUnknown_085B1DEC + ldrb r1, [r5] + ldrb r2, [r5, 0x1] + adds r0, r6, 0 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + strh r4, [r1, 0x2E] + mov r0, r9 + strh r0, [r1, 0x30] + ldrb r1, [r5, 0x2] + ldrb r2, [r5, 0x3] + adds r0, r6, 0 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + strh r4, [r1, 0x2E] + mov r3, r10 + strh r3, [r1, 0x30] + ldrb r1, [r5, 0x4] + ldrb r2, [r5, 0x5] + adds r0, r6, 0 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + strh r4, [r1, 0x2E] + movs r0, 0x2 + strh r0, [r1, 0x30] + ldr r1, =0x030011f8 + movs r0, 0xFF + strh r0, [r1] + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end set_256color_bg_bg0 + + thumb_func_start sub_81341E0 +sub_81341E0: @ 81341E0 + push {lr} + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl do_scheduled_bg_tilemap_copies_to_vram + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_81341E0 + + thumb_func_start sub_81341FC +sub_81341FC: @ 81341FC + push {r4,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldrb r0, [r4, 0x8] + bl sub_81344C8 + movs r2, 0xAA + lsls r2, 2 + movs r0, 0 + movs r1, 0 + movs r3, 0xD + bl SetWindowBorderStyle + ldr r2, =gUnknown_085E8C53 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =sub_813425C + str r0, [r4] + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81341FC + + thumb_func_start sub_813425C +sub_813425C: @ 813425C + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r6, r0, r2 + ldrh r7, [r6, 0x8] + ldrb r4, [r6, 0x8] + ldr r1, =0x030022c0 + ldrh r3, [r1, 0x2E] + movs r0, 0x1 + ands r0, r3 + cmp r0, 0 + beq _081342F8 + bl sub_8134604 + ldr r0, =gUnknown_085B1F40 + ldr r1, =gUnknown_085B1DEC + lsls r2, r4, 1 + adds r3, r2, r1 + ldrb r5, [r3] + adds r1, 0x1 + adds r2, r1 + ldrb r4, [r2] + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + strh r0, [r6, 0xC] + ldrh r0, [r6, 0x8] + bl sub_8133EDC + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_8134690 + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r2, r4, 0 + adds r2, 0x10 + adds r2, r1, r2 + ldr r3, =gUnknown_085B1ED0 + str r3, [r2] + adds r4, 0x1C + adds r1, r4 + ldr r2, =sub_8134774 + str r2, [r1] + strh r0, [r6, 0xA] + ldr r0, =sub_8134340 + str r0, [r6] + b _08134334 + .pool +_081342F8: + movs r0, 0x20 + ands r0, r3 + cmp r0, 0 + beq _08134314 + cmp r4, 0 + beq _08134314 + subs r0, r7, 0x1 + strh r0, [r6, 0x8] + ldr r0, =sub_8134640 + str r0, [r6] + b _08134334 + .pool +_08134314: + ldrh r1, [r1, 0x2E] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08134334 + cmp r4, 0x1 + bhi _08134334 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r2 + ldrh r1, [r0, 0x8] + adds r1, 0x1 + strh r1, [r0, 0x8] + ldr r1, =sub_8134640 + str r1, [r0] +_08134334: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_813425C + + thumb_func_start sub_8134340 +sub_8134340: @ 8134340 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x02020630 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r2, r1, r2 + movs r0, 0xC + ldrsh r1, [r2, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r0, r3 + adds r0, r1, 0 + adds r0, 0x3F + ldrb r0, [r0] + lsls r0, 26 + cmp r0, 0 + bge _0813437E + movs r3, 0x20 + ldrsh r0, [r1, r3] + cmp r0, 0x78 + bne _0813437E + movs r3, 0x22 + ldrsh r0, [r1, r3] + cmp r0, 0x40 + bne _0813437E + ldr r0, =sub_8134390 + str r0, [r2] +_0813437E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8134340 + + thumb_func_start sub_8134390 +sub_8134390: @ 8134390 + push {r4,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldrh r0, [r4, 0x8] + bl sub_8133EDC + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl cry_related + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_085E8C90 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =gUnknown_085B1DDC + movs r1, 0xAA + lsls r1, 2 + movs r2, 0xD + movs r3, 0 + bl CreateYesNoMenu + ldr r0, =sub_8134400 + str r0, [r4] + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8134390 + + thumb_func_start sub_8134400 +sub_8134400: @ 8134400 + 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 _08134426 + cmp r1, 0 + bgt _08134420 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08134450 + b _0813449A +_08134420: + cmp r1, 0x1 + beq _08134450 + b _0813449A +_08134426: + ldr r2, =0x020375f0 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x8] + strh r0, [r2] + bl dp13_810BB8C + ldr r0, =0x030022c0 + ldr r0, [r0, 0x8] + bl SetMainCallback2 + b _0813449A + .pool +_08134450: + movs r0, 0x5 + bl audio_play + ldr r0, =0x03005e00 + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + adds r5, r0 + ldrb r4, [r5, 0xA] + ldr r6, =0x02020630 + lsls r0, r4, 4 + adds r0, r4 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl sub_818D820 + ldrb r0, [r5, 0xC] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + adds r4, r6 + ldrb r0, [r4, 0x3] + lsls r0, 26 + lsrs r0, 27 + bl rotscale_free_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + ldr r0, =sub_81344AC + str r0, [r5] +_0813449A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8134400 + + thumb_func_start sub_81344AC +sub_81344AC: @ 81344AC + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =sub_81341FC + str r0, [r1] + bx lr + .pool + thumb_func_end sub_81344AC + + thumb_func_start sub_81344C8 +sub_81344C8: @ 81344C8 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x34 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r5, 0 + bl sub_8133EDC + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + add r1, sp, 0xC + bl sub_81DB468 + movs r0, 0xB + adds r1, r4, 0 + muls r1, r0 + mov r9, r1 + ldr r0, =gSpeciesNames + add r9, r0 + ldr r0, =gUnknown_085B1DE4 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x2C] + str r1, [sp, 0x30] + ldr r3, =gUnknown_085B1DF2 + lsls r5, 1 + adds r2, r5, r3 + mov r10, r2 + ldrb r0, [r2] + lsls r0, 8 + ldr r1, =0xffff00ff + ldr r2, [sp, 0x2C] + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x2C] + adds r3, 0x1 + adds r5, r3 + ldrb r1, [r5] + lsls r1, 16 + ldr r0, =0xff00ffff + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x2C] + add r0, sp, 0x2C + bl AddWindow + ldr r4, =0x030011f8 + strh r0, [r4] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x7 + add r1, sp, 0xC + movs r2, 0x68 + bl GetStringCenterAlignXOffset + adds r2, r0, 0 + ldrb r0, [r4] + lsls r2, 24 + lsrs r2, 24 + ldr r1, =gUnknown_085B1E0C + mov r8, r1 + str r1, [sp] + movs r6, 0 + str r6, [sp, 0x4] + add r1, sp, 0xC + str r1, [sp, 0x8] + movs r1, 0x7 + movs r3, 0x1 + bl box_print + movs r0, 0x1 + mov r1, r9 + movs r2, 0x68 + bl GetStringCenterAlignXOffset + adds r2, r0, 0 + ldrb r0, [r4] + lsls r2, 24 + lsrs r2, 24 + mov r1, r8 + str r1, [sp] + str r6, [sp, 0x4] + mov r1, r9 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x11 + bl box_print + ldrb r0, [r4] + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + mov r2, r10 + ldrb r1, [r2] + lsls r0, r1, 27 + movs r2, 0xFC + lsls r2, 24 + adds r0, r2 + adds r1, 0xD + lsls r1, 3 + adds r1, 0x4 + lsls r1, 24 + ldrb r4, [r5] + lsls r5, r4, 27 + lsrs r5, 24 + adds r4, 0x4 + lsls r4, 27 + lsrs r4, 24 + lsrs r1, 8 + orrs r1, r0 + lsrs r1, 16 + movs r0, 0x40 + bl SetGpuReg + lsls r5, 8 + orrs r5, r4 + movs r0, 0x44 + adds r1, r5, 0 + bl SetGpuReg + add sp, 0x34 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81344C8 + + thumb_func_start sub_8134604 +sub_8134604: @ 8134604 + push {r4,lr} + ldr r4, =0x030011f8 + ldrb r0, [r4] + movs r1, 0 + bl FillWindowPixelBuffer + ldrb r0, [r4] + bl ClearWindowTilemap + ldrb r0, [r4] + bl RemoveWindow + movs r0, 0xFF + strh r0, [r4] + movs r0, 0x40 + movs r1, 0 + bl SetGpuReg + movs r0, 0x44 + movs r1, 0 + bl SetGpuReg + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8134604 + + thumb_func_start sub_8134640 +sub_8134640: @ 8134640 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8134604 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8134668 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8134640 + + thumb_func_start sub_8134668 +sub_8134668: @ 8134668 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + ldrb r0, [r4, 0x8] + bl sub_81344C8 + ldr r0, =sub_813425C + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8134668 + + thumb_func_start sub_8134690 +sub_8134690: @ 8134690 + push {lr} + sub sp, 0x10 + lsls r0, 16 + lsrs r0, 16 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + str r1, [sp] + str r2, [sp, 0x4] + movs r1, 0xE + str r1, [sp, 0x8] + ldr r1, =0x0000ffff + str r1, [sp, 0xC] + movs r1, 0x8 + movs r2, 0 + movs r3, 0x1 + bl sub_818D3E4 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02020630 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r1 + ldrb r3, [r2, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r3 + strb r1, [r2, 0x5] + add sp, 0x10 + pop {r1} + bx r1 + .pool + thumb_func_end sub_8134690 + + thumb_func_start sub_81346DC +sub_81346DC: @ 81346DC + push {r4,lr} + adds r4, r0, 0 + ldr r2, =gUnknown_085B1E28 + ldr r3, =0x03005e00 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r3 + movs r1, 0x8 + ldrsh r0, [r0, r1] + lsls r0, 1 + adds r0, r2 + ldrb r0, [r0] + strh r0, [r4, 0x20] + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r3 + movs r1, 0x8 + ldrsh r0, [r0, r1] + lsls r0, 1 + adds r2, 0x1 + adds r0, r2 + ldrb r0, [r0] + strh r0, [r4, 0x22] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x8 + bl sine + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x30] + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x4 + strh r0, [r4, 0x30] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81346DC + + thumb_func_start sub_813473C +sub_813473C: @ 813473C + push {lr} + adds r3, r0, 0 + ldr r2, =0x03005e00 + movs r0, 0x2E + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r2, 0x8 + ldrsh r1, [r0, r2] + movs r2, 0x30 + ldrsh r0, [r3, r2] + cmp r1, r0 + bne _08134768 + adds r0, r3, 0 + movs r1, 0x1 + bl StartObjectImageAnimIfDifferent + b _08134770 + .pool +_08134768: + adds r0, r3, 0 + movs r1, 0 + bl StartObjectImageAnimIfDifferent +_08134770: + pop {r0} + bx r0 + thumb_func_end sub_813473C + + thumb_func_start sub_8134774 +sub_8134774: @ 8134774 + push {lr} + adds r1, r0, 0 + ldrh r2, [r1, 0x20] + movs r3, 0x20 + ldrsh r0, [r1, r3] + cmp r0, 0x78 + ble _08134786 + subs r0, r2, 0x4 + strh r0, [r1, 0x20] +_08134786: + ldrh r2, [r1, 0x20] + movs r3, 0x20 + ldrsh r0, [r1, r3] + cmp r0, 0x77 + bgt _08134794 + adds r0, r2, 0x4 + strh r0, [r1, 0x20] +_08134794: + ldrh r2, [r1, 0x22] + movs r3, 0x22 + ldrsh r0, [r1, r3] + cmp r0, 0x40 + ble _081347A2 + subs r0, r2, 0x2 + strh r0, [r1, 0x22] +_081347A2: + ldrh r2, [r1, 0x22] + movs r3, 0x22 + ldrsh r0, [r1, r3] + cmp r0, 0x3F + bgt _081347B0 + adds r0, r2, 0x2 + strh r0, [r1, 0x22] +_081347B0: + pop {r0} + bx r0 + thumb_func_end sub_8134774 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/string_util.s b/asm/string_util.s index 47840c5a7..f3225dd8d 100644 --- a/asm/string_util.s +++ b/asm/string_util.s @@ -1,4 +1,5 @@ .include "asm/macros.inc" + .include "constants/constants.inc" .syntax unified diff --git a/asm/text_renderer.s b/asm/text.s similarity index 99% rename from asm/text_renderer.s rename to asm/text.s index 024a6cf4e..73d6e476d 100644 --- a/asm/text_renderer.s +++ b/asm/text.s @@ -1,4 +1,5 @@ .include "asm/macros.inc" + .include "constants/constants.inc" .syntax unified diff --git a/asm/text_window.s b/asm/text_window.s new file mode 100644 index 000000000..b50072f8f --- /dev/null +++ b/asm/text_window.s @@ -0,0 +1,686 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8098758 +sub_8098758: @ 8098758 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bhi _08098770 + lsls r0, 3 + ldr r1, =gUnknown_0851021C + adds r0, r1 + b _08098772 + .pool +_08098770: + ldr r0, =gUnknown_0851021C +_08098772: + pop {r1} + bx r1 + .pool + thumb_func_end sub_8098758 + + thumb_func_start copy_textbox_border_tile_patterns_to_vram +@ void copy_textbox_border_tile_patterns_to_vram(u8 rbox_id, u16 tile_pattern_dest_offset, u8 pal_dest_offset) +copy_textbox_border_tile_patterns_to_vram: @ 809877C + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 16 + lsrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + movs r1, 0 + bl GetWindowAttribute + lsls r0, 24 + lsrs r0, 24 + ldr r1, =gUnknown_08DDD748 + movs r2, 0xE0 + lsls r2, 1 + adds r3, r4, 0 + bl LoadBgTiles + bl sub_8098C64 + adds r1, r5, 0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end copy_textbox_border_tile_patterns_to_vram + + thumb_func_start box_border_load_tiles_and_pal +box_border_load_tiles_and_pal: @ 80987BC + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + lsrs r1, 16 + lsls r2, 24 + lsrs r2, 24 + bl sub_809882C + pop {r0} + bx r0 + thumb_func_end box_border_load_tiles_and_pal + + thumb_func_start sub_80987D4 +sub_80987D4: @ 80987D4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r4, r1, 0 + adds r6, r2, 0 + mov r8, r3 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + lsls r6, 16 + lsrs r6, 16 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + movs r1, 0 + bl GetWindowAttribute + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_0851021C + lsls r4, 3 + adds r1, r4, r5 + ldr r1, [r1] + movs r2, 0x90 + lsls r2, 1 + adds r3, r6, 0 + bl LoadBgTiles + adds r5, 0x4 + adds r4, r5 + ldr r0, [r4] + mov r1, r8 + movs r2, 0x20 + bl gpu_pal_apply + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80987D4 + + thumb_func_start sub_809882C +sub_809882C: @ 809882C + push {r4,lr} + adds r4, r1, 0 + adds r3, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 16 + lsrs r4, 16 + lsls r3, 24 + lsrs r3, 24 + ldr r1, =0x03005d90 + ldr r1, [r1] + ldrb r1, [r1, 0x14] + lsrs r1, 3 + adds r2, r4, 0 + bl sub_80987D4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_809882C + + thumb_func_start sub_8098858 +sub_8098858: @ 8098858 + 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 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 16 + lsrs r5, 16 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0xC] + adds r0, r4, 0 + movs r1, 0 + bl GetWindowAttribute + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r4, 0 + movs r1, 0x1 + bl GetWindowAttribute + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0x2 + bl GetWindowAttribute + adds r6, r0, 0 + lsls r6, 16 + lsrs r6, 16 + adds r0, r4, 0 + movs r1, 0x3 + bl GetWindowAttribute + mov r9, r0 + mov r2, r9 + lsls r2, 16 + lsrs r2, 16 + mov r9, r2 + adds r0, r4, 0 + movs r1, 0x4 + bl GetWindowAttribute + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x10] + mov r0, r8 + subs r0, 0x1 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x14] + subs r4, r6, 0x1 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + mov r10, r0 + str r0, [sp] + str r0, [sp, 0x4] + ldr r2, [sp, 0xC] + str r2, [sp, 0x8] + adds r0, r7, 0 + adds r1, r5, 0 + ldr r2, [sp, 0x14] + adds r3, r4, 0 + bl FillBgTilemapBufferRect + adds r1, r5, 0x1 + lsls r1, 16 + lsrs r1, 16 + mov r0, r8 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x18] + mov r2, r9 + lsls r0, r2, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + str r0, [sp] + mov r0, r10 + str r0, [sp, 0x4] + ldr r2, [sp, 0xC] + str r2, [sp, 0x8] + adds r0, r7, 0 + ldr r2, [sp, 0x18] + adds r3, r4, 0 + bl FillBgTilemapBufferRect + adds r1, r5, 0x2 + lsls r1, 16 + lsrs r1, 16 + add r8, r9 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r2, r10 + str r2, [sp] + str r2, [sp, 0x4] + ldr r0, [sp, 0xC] + str r0, [sp, 0x8] + adds r0, r7, 0 + mov r2, r8 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + adds r1, r5, 0x3 + lsls r1, 16 + lsrs r1, 16 + lsls r2, r6, 24 + lsrs r2, 24 + mov r9, r2 + mov r0, r10 + str r0, [sp] + ldr r2, [sp, 0x10] + lsls r4, r2, 24 + lsrs r4, 24 + str r4, [sp, 0x4] + ldr r0, [sp, 0xC] + str r0, [sp, 0x8] + adds r0, r7, 0 + ldr r2, [sp, 0x14] + mov r3, r9 + bl FillBgTilemapBufferRect + adds r1, r5, 0x5 + lsls r1, 16 + lsrs r1, 16 + mov r2, r10 + str r2, [sp] + str r4, [sp, 0x4] + ldr r0, [sp, 0xC] + str r0, [sp, 0x8] + adds r0, r7, 0 + mov r2, r8 + mov r3, r9 + bl FillBgTilemapBufferRect + adds r1, r5, 0x6 + lsls r1, 16 + lsrs r1, 16 + ldr r2, [sp, 0x10] + adds r6, r2 + lsls r6, 24 + lsrs r6, 24 + mov r0, r10 + str r0, [sp] + str r0, [sp, 0x4] + ldr r2, [sp, 0xC] + str r2, [sp, 0x8] + adds r0, r7, 0 + ldr r2, [sp, 0x14] + adds r3, r6, 0 + bl FillBgTilemapBufferRect + adds r1, r5, 0x7 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x1C] + str r0, [sp] + mov r2, r10 + str r2, [sp, 0x4] + ldr r0, [sp, 0xC] + str r0, [sp, 0x8] + adds r0, r7, 0 + ldr r2, [sp, 0x18] + adds r3, r6, 0 + bl FillBgTilemapBufferRect + adds r5, 0x8 + lsls r5, 16 + lsrs r5, 16 + mov r2, r10 + str r2, [sp] + str r2, [sp, 0x4] + ldr r0, [sp, 0xC] + str r0, [sp, 0x8] + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + adds r3, r6, 0 + bl FillBgTilemapBufferRect + 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_8098858 + + thumb_func_start sub_80989E0 +sub_80989E0: @ 80989E0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r4, r0, 0 + mov r9, r1 + lsls r4, 24 + lsrs r4, 24 + mov r0, r9 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + adds r0, r4, 0 + movs r1, 0 + bl GetWindowAttribute + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r4, 0 + movs r1, 0x1 + bl GetWindowAttribute + mov r8, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0x2 + bl GetWindowAttribute + adds r6, r0, 0 + lsls r6, 16 + lsrs r6, 16 + adds r0, r4, 0 + movs r1, 0x3 + bl GetWindowAttribute + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0x4 + bl GetWindowAttribute + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0xC] + mov r0, r8 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x10] + lsls r4, r6, 24 + lsrs r4, 24 + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + adds r0, r7, 0 + mov r1, r9 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + mov r1, r9 + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + mov r0, r8 + adds r0, 0x1 + lsls r2, r0, 24 + lsrs r2, 24 + str r2, [sp, 0x14] + subs r0, r5, 0x2 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x18] + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + adds r0, r7, 0 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + mov r1, r9 + adds r1, 0x2 + lsls r1, 16 + lsrs r1, 16 + add r8, r5 + movs r0, 0x1 + negs r0, r0 + add r8, r0 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + adds r0, r7, 0 + mov r2, r8 + adds r3, r4, 0 + bl FillBgTilemapBufferRect + mov r1, r9 + adds r1, 0x3 + lsls r1, 16 + lsrs r1, 16 + adds r5, r6, 0x1 + lsls r5, 24 + lsrs r5, 24 + movs r0, 0x1 + str r0, [sp] + ldr r4, [sp, 0xC] + subs r4, 0x2 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + adds r0, r7, 0 + ldr r2, [sp, 0x10] + adds r3, r5, 0 + bl FillBgTilemapBufferRect + mov r1, r9 + adds r1, 0x5 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x1 + str r0, [sp] + str r4, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + adds r0, r7, 0 + mov r2, r8 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + mov r1, r9 + adds r1, 0x6 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0xC] + adds r6, r0 + subs r6, 0x1 + lsls r6, 24 + lsrs r6, 24 + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + adds r0, r7, 0 + ldr r2, [sp, 0x10] + adds r3, r6, 0 + bl FillBgTilemapBufferRect + mov r1, r9 + adds r1, 0x7 + lsls r1, 16 + lsrs r1, 16 + ldr r0, [sp, 0x18] + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + adds r0, r7, 0 + ldr r2, [sp, 0x14] + adds r3, r6, 0 + bl FillBgTilemapBufferRect + movs r0, 0x8 + add r9, r0 + mov r0, r9 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + adds r0, r7, 0 + mov r1, r9 + mov r2, r8 + adds r3, r6, 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 + thumb_func_end sub_80989E0 + + thumb_func_start rbox_fill_rectangle +rbox_fill_rectangle: @ 8098B7C + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0xC + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + adds r0, r6, 0 + movs r1, 0 + bl GetWindowAttribute + mov r9, r0 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + adds r0, r6, 0 + movs r1, 0x1 + bl GetWindowAttribute + mov r8, r0 + mov r1, r8 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + adds r0, r6, 0 + movs r1, 0x2 + bl GetWindowAttribute + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r6, 0 + movs r1, 0x3 + bl GetWindowAttribute + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r6, 0 + movs r1, 0x4 + bl GetWindowAttribute + movs r1, 0x1 + negs r1, r1 + add r8, r1 + mov r1, r8 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + subs r5, 0x1 + lsls r5, 24 + lsrs r5, 24 + adds r4, 0x2 + lsls r4, 24 + lsrs r4, 24 + str r4, [sp] + lsls r0, 24 + movs r1, 0x80 + lsls r1, 18 + adds r0, r1 + lsrs r0, 24 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + mov r0, r9 + movs r1, 0 + mov r2, r8 + adds r3, r5, 0 + bl FillBgTilemapBufferRect + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end rbox_fill_rectangle + + thumb_func_start stdpal_get +stdpal_get: @ 8098C18 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _08098C54 + lsls r0, 2 + ldr r1, =_08098C30 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08098C30: + .4byte _08098C44 + .4byte _08098C48 + .4byte _08098C4C + .4byte _08098C50 + .4byte _08098C54 +_08098C44: + movs r0, 0 + b _08098C56 +_08098C48: + movs r0, 0x10 + b _08098C56 +_08098C4C: + movs r0, 0x20 + b _08098C56 +_08098C50: + movs r0, 0x30 + b _08098C56 +_08098C54: + movs r0, 0x40 +_08098C56: + lsls r0, 1 + ldr r1, =gUnknown_0851017C + adds r0, r1 + pop {r1} + bx r1 + .pool + thumb_func_end stdpal_get + + thumb_func_start sub_8098C64 +sub_8098C64: @ 8098C64 + ldr r0, =gUnknown_08DDD728 + bx lr + .pool + thumb_func_end sub_8098C64 + + thumb_func_start sub_8098C6C +sub_8098C6C: @ 8098C6C + push {r4,r5,lr} + adds r3, r1, 0 + adds r4, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r3, 16 + lsrs r3, 16 + lsls r4, 24 + lsrs r4, 24 + ldr r2, =gUnknown_0851021C + ldr r5, =0x03005d90 + ldr r1, [r5] + ldrb r1, [r1, 0x14] + lsrs r1, 3 + lsls r1, 3 + adds r1, r2 + ldr r1, [r1] + movs r2, 0x90 + lsls r2, 1 + bl LoadBgTiles + ldr r0, [r5] + ldrb r0, [r0, 0x14] + lsrs r0, 3 + bl sub_8098758 + ldr r0, [r0, 0x4] + adds r1, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8098C6C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/tileset_animation.s b/asm/tileset.s similarity index 95% rename from asm/tileset_animation.s rename to asm/tileset.s index b27eb059c..d198b5d9b 100644 --- a/asm/tileset_animation.s +++ b/asm/tileset.s @@ -1,4 +1,5 @@ .include "asm/macros.inc" + .include "constants/constants.inc" .syntax unified @@ -1789,92 +1790,4 @@ sub_80A17EC: @ 80A17EC .pool thumb_func_end sub_80A17EC - thumb_func_start sub_80A1818 -sub_80A1818: @ 80A1818 - push {lr} - lsls r0, 16 - ldr r2, =gUnknown_0852487C - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - lsrs r1, 14 - adds r1, r2 - ldr r0, [r1] - ldr r1, =0x02037814 - movs r2, 0x10 - bl CpuSet - ldr r0, =0x02037fd4 - ldrh r2, [r0, 0x4] - lsls r2, 21 - lsrs r2, 27 - ldrh r3, [r0, 0x6] - lsls r3, 17 - lsrs r3, 17 - movs r0, 0x80 - movs r1, 0x10 - bl pal_fade_1 - ldr r0, =sub_8149DFC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _080A1862 - ldr r1, =0x03000f44 - ldr r0, =sub_80A1670 - str r0, [r1] - ldr r1, =0x03000f3c - movs r0, 0x20 - strh r0, [r1] -_080A1862: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A1818 - - thumb_func_start sub_80A1884 -sub_80A1884: @ 80A1884 - push {lr} - lsls r0, 16 - ldr r2, =gUnknown_0852487C - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - lsrs r1, 14 - adds r1, r2 - ldr r0, [r1] - ldr r1, =0x02037814 - movs r2, 0x10 - bl CpuSet - ldr r0, =sub_8149DFC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _080A18D6 - ldr r0, =0x02037fd4 - ldrh r2, [r0, 0x4] - lsls r2, 21 - lsrs r2, 27 - ldrh r3, [r0, 0x6] - lsls r3, 17 - lsrs r3, 17 - movs r0, 0x80 - movs r1, 0x10 - bl pal_fade_1 - ldr r1, =0x03000f3c - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - bne _080A18D6 - ldr r0, =0x03000f44 - str r1, [r0] -_080A18D6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A1884 - .align 2, 0 @ Don't pad with nop. diff --git a/asm/title_screen.s b/asm/title_screen.s new file mode 100644 index 000000000..43910ace6 --- /dev/null +++ b/asm/title_screen.s @@ -0,0 +1,1321 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80AA40C +sub_80AA40C: @ 80AA40C + push {lr} + adds r3, r0, 0 + ldr r2, =0x03005e00 + movs r0, 0x30 + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0xA + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _080AA43C + ldrb r0, [r3, 0x1] + movs r1, 0xD + negs r1, r1 + ands r1, r0 + strb r1, [r3, 0x1] + movs r0, 0x42 + strh r0, [r3, 0x22] + b _080AA46A + .pool +_080AA43C: + ldrh r1, [r3, 0x22] + movs r2, 0x22 + ldrsh r0, [r3, r2] + cmp r0, 0x42 + beq _080AA44A + adds r0, r1, 0x1 + strh r0, [r3, 0x22] +_080AA44A: + ldrh r1, [r3, 0x2E] + movs r2, 0x2E + ldrsh r0, [r3, r2] + cmp r0, 0 + beq _080AA458 + subs r0, r1, 0x1 + strh r0, [r3, 0x2E] +_080AA458: + ldr r0, =gUnknown_0853FF70 + movs r2, 0x2E + ldrsh r1, [r3, r2] + lsls r1, 1 + adds r1, r0 + ldrh r1, [r1] + movs r0, 0x52 + bl SetGpuReg +_080AA46A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AA40C + + thumb_func_start sub_80AA474 +sub_80AA474: @ 80AA474 + push {lr} + adds r3, r0, 0 + ldr r2, =0x03005e00 + movs r0, 0x30 + ldrsh r1, [r3, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0xA + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _080AA4A0 + ldrb r0, [r3, 0x1] + movs r1, 0xD + negs r1, r1 + ands r1, r0 + strb r1, [r3, 0x1] + movs r0, 0x42 + b _080AA4AC + .pool +_080AA4A0: + ldrh r1, [r3, 0x22] + movs r2, 0x22 + ldrsh r0, [r3, r2] + cmp r0, 0x42 + beq _080AA4AE + adds r0, r1, 0x1 +_080AA4AC: + strh r0, [r3, 0x22] +_080AA4AE: + pop {r0} + bx r0 + thumb_func_end sub_80AA474 + + thumb_func_start sub_80AA4B4 +sub_80AA4B4: @ 80AA4B4 + push {lr} + adds r2, r0, 0 + movs r1, 0x2E + ldrsh r0, [r2, r1] + cmp r0, 0x1 + bne _080AA4DC + ldrh r0, [r2, 0x30] + adds r0, 0x1 + strh r0, [r2, 0x30] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + bne _080AA4DC + adds r0, r2, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _080AA4E8 +_080AA4DC: + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] +_080AA4E8: + pop {r0} + bx r0 + thumb_func_end sub_80AA4B4 + + thumb_func_start sub_80AA4EC +sub_80AA4EC: @ 80AA4EC + push {r4-r7,lr} + lsls r0, 16 + ldr r2, =0xffc00000 + adds r0, r2 + lsrs r0, 16 + movs r6, 0 + lsls r7, r1, 16 +_080AA4FA: + lsls r5, r0, 16 + asrs r5, 16 + ldr r0, =gUnknown_085400D8 + adds r1, r5, 0 + asrs r2, r7, 16 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + adds r0, r4, 0 + adds r1, r6, 0 + bl StartObjectImageAnim + movs r0, 0x1 + strh r0, [r4, 0x2E] + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + adds r5, 0x20 + lsls r5, 16 + lsrs r0, r5, 16 + cmp r6, 0x4 + bls _080AA4FA + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AA4EC + + thumb_func_start sub_80AA548 +sub_80AA548: @ 80AA548 + push {r4-r6,lr} + lsls r0, 16 + ldr r2, =0xffc00000 + adds r0, r2 + lsrs r0, 16 + movs r5, 0 + lsls r6, r1, 16 +_080AA556: + lsls r4, r0, 16 + asrs r4, 16 + ldr r0, =gUnknown_085400D8 + adds r1, r4, 0 + asrs r2, r6, 16 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =0x02020630 + adds r2, r0 + adds r1, r5, 0x5 + lsls r1, 24 + lsrs r1, 24 + adds r0, r2, 0 + bl StartObjectImageAnim + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r4, 0x20 + lsls r4, 16 + lsrs r0, r4, 16 + cmp r5, 0x4 + bls _080AA556 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AA548 + + thumb_func_start title_screen_logo_shine_obj_callback_type1 +@ void title_screen_logo_shine_obj_callback_type1(struct obj *obj) +title_screen_logo_shine_obj_callback_type1: @ 80AA5A4 + push {r4,lr} + adds r3, r0, 0 + ldrh r2, [r3, 0x20] + movs r0, 0x20 + ldrsh r1, [r3, r0] + ldr r0, =0x0000010f + cmp r1, r0 + bgt _080AA63C + movs r4, 0x2E + ldrsh r0, [r3, r4] + adds r4, r2, 0 + cmp r0, 0 + beq _080AA630 + cmp r1, 0x77 + bgt _080AA5E0 + ldrh r1, [r3, 0x30] + movs r2, 0x30 + ldrsh r0, [r3, r2] + cmp r0, 0x1E + bgt _080AA5F8 + adds r1, 0x1 + strh r1, [r3, 0x30] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x1E + bgt _080AA5F8 + adds r0, r1, 0x1 + b _080AA5F6 + .pool +_080AA5E0: + ldrh r1, [r3, 0x30] + movs r4, 0x30 + ldrsh r0, [r3, r4] + cmp r0, 0 + beq _080AA5F8 + subs r0, r1, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + cmp r0, 0 + beq _080AA5F8 + subs r0, r1, 0x2 +_080AA5F6: + strh r0, [r3, 0x30] +_080AA5F8: + ldrh r1, [r3, 0x30] + movs r0, 0x1F + ands r0, r1 + lsls r2, r0, 10 + lsls r1, r0, 5 + adds r2, r1 + orrs r2, r0 + movs r1, 0x20 + ldrsh r0, [r3, r1] + ldrh r4, [r3, 0x20] + cmp r0, 0x84 + beq _080AA61C + cmp r0, 0x88 + beq _080AA61C + cmp r0, 0x8C + beq _080AA61C + cmp r0, 0x90 + bne _080AA62C +_080AA61C: + ldr r1, =0x02037b14 + ldr r0, =0x000033f8 + strh r0, [r1] + b _080AA630 + .pool +_080AA62C: + ldr r0, =0x02037b14 + strh r2, [r0] +_080AA630: + adds r0, r4, 0x4 + strh r0, [r3, 0x20] + b _080AA648 + .pool +_080AA63C: + ldr r1, =0x02037b14 + movs r0, 0 + strh r0, [r1] + adds r0, r3, 0 + bl RemoveObjectAndFreeTiles +_080AA648: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end title_screen_logo_shine_obj_callback_type1 + + thumb_func_start title_screen_logo_shine_obj_callback_type2 +@ void title_screen_logo_shine_obj_callback_type2(struct obj *obj) +title_screen_logo_shine_obj_callback_type2: @ 80AA654 + push {lr} + adds r2, r0, 0 + ldrh r3, [r2, 0x20] + movs r0, 0x20 + ldrsh r1, [r2, r0] + ldr r0, =0x0000010f + cmp r1, r0 + bgt _080AA670 + adds r0, r3, 0 + adds r0, 0x8 + strh r0, [r2, 0x20] + b _080AA676 + .pool +_080AA670: + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles +_080AA676: + pop {r0} + bx r0 + thumb_func_end title_screen_logo_shine_obj_callback_type2 + + thumb_func_start title_screen_add_logo_shine_obj +@ void title_screen_add_logo_shine_obj(int a1) +title_screen_add_logo_shine_obj: @ 80AA67C + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + beq _080AA6D0 + cmp r5, 0x1 + bgt _080AA698 + cmp r5, 0 + beq _080AA69C + b _080AA766 +_080AA698: + cmp r5, 0x2 + bne _080AA766 +_080AA69C: + ldr r0, =gUnknown_08540124 + movs r1, 0 + movs r2, 0x44 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =0x02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r2, [r0, 0x1] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0, 0x1] + strh r5, [r0, 0x2E] + b _080AA766 + .pool +_080AA6D0: + ldr r0, =gUnknown_08540124 + mov r9, r0 + movs r1, 0 + movs r2, 0x44 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r2, r0, 24 + ldr r6, =0x02020630 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r6 + ldrb r2, [r1, 0x1] + movs r4, 0xD + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + movs r2, 0x8 + mov r8, r2 + mov r2, r8 + orrs r0, r2 + strb r0, [r1, 0x1] + strh r5, [r1, 0x2E] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] + mov r0, r9 + movs r1, 0 + movs r2, 0x44 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r5, r6, 0 + adds r5, 0x1C + adds r0, r1, r5 + ldr r2, =title_screen_logo_shine_obj_callback_type2 + mov r10, r2 + str r2, [r0] + adds r1, r6 + ldrb r2, [r1, 0x1] + adds r0, r4, 0 + ands r0, r2 + mov r2, r8 + orrs r0, r2 + strb r0, [r1, 0x1] + movs r1, 0x50 + negs r1, r1 + mov r0, r9 + movs r2, 0x44 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r5, r0, r5 + mov r1, r10 + str r1, [r5] + adds r0, r6 + ldrb r1, [r0, 0x1] + ands r4, r1 + mov r2, r8 + orrs r4, r2 + strb r4, [r0, 0x1] +_080AA766: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end title_screen_add_logo_shine_obj + + thumb_func_start title_screen_vblank_callback +@ void title_screen_vblank_callback() +title_screen_vblank_callback: @ 80AA780 + push {lr} + bl sub_80BA0A8 + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + ldr r0, =0x02022e1a + ldrh r1, [r0] + movs r0, 0x16 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end title_screen_vblank_callback + + thumb_func_start c2_title_screen_1 +@ void c2_title_screen_1() +c2_title_screen_1: @ 80AA7A4 + push {r4,lr} + sub sp, 0x14 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x5 + bhi _080AA7E0 + lsls r0, 2 + ldr r1, =_080AA7C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080AA7C8: + .4byte _080AA7E0 + .4byte _080AA8C4 + .4byte _080AA998 + .4byte _080AA9E0 + .4byte _080AAA14 + .4byte _080AAAF0 +_080AA7E0: + movs r0, 0 + bl SetVBlankCallback + 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 r1, 0xA0 + lsls r1, 19 + ldr r2, =0x00007fff + adds r0, r2, 0 + strh r0, [r1] + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0xC + movs r1, 0 + bl SetGpuReg + movs r0, 0xA + movs r1, 0 + bl SetGpuReg + movs r0, 0x8 + movs r1, 0 + bl SetGpuReg + movs r0, 0x18 + movs r1, 0 + bl SetGpuReg + movs r0, 0x1A + movs r1, 0 + bl SetGpuReg + movs r0, 0x14 + movs r1, 0 + bl SetGpuReg + movs r0, 0x16 + movs r1, 0 + bl SetGpuReg + movs r0, 0x10 + movs r1, 0 + bl SetGpuReg + movs r0, 0x12 + movs r1, 0 + bl SetGpuReg + add r1, sp, 0xC + movs r0, 0 + strh r0, [r1] + ldr r1, =0x040000d4 + add r0, sp, 0xC + str r0, [r1] + movs r0, 0xC0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, =0x8100c000 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r2, 0 + str r2, [sp, 0x10] + add r0, sp, 0x10 + str r0, [r1] + movs r0, 0xE0 + lsls r0, 19 + str r0, [r1, 0x4] + ldr r0, =0x85000100 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + add r0, sp, 0xC + strh r2, [r0] + str r0, [r1] + ldr r0, =0x05000002 + str r0, [r1, 0x4] + ldr r0, =0x810001ff + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + bl sub_80A1A74 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + b _080AAB1E + .pool +_080AA8C4: + ldr r0, =gTitleScreenPokemonLogoTiles + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, =gUnknown_08DE0644 + ldr r1, =0x06004800 + bl LZ77UnCompVram + ldr r0, =gTitleScreenBgPalettes + movs r2, 0xF0 + lsls r2, 1 + movs r1, 0 + bl gpu_pal_apply + ldr r0, =gTitleScreenRayquazaTiles + ldr r1, =0x06008000 + bl LZ77UnCompVram + ldr r0, =gUnknown_0853F83C + ldr r1, =0x0600d000 + bl LZ77UnCompVram + ldr r0, =gTitleScreenCloudsTiles + ldr r1, =0x0600c000 + bl LZ77UnCompVram + ldr r0, =gUnknown_08DDE458 + ldr r1, =0x0600d800 + bl LZ77UnCompVram + bl remove_some_task + bl ResetTasks + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + ldr r1, =0x0300301c + movs r0, 0x9 + strb r0, [r1] + ldr r0, =gUnknown_08540048 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085400F0 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_0854013C + bl LoadCompressedObjectPic + ldr r0, =gUnknown_08DDE438 + movs r1, 0x80 + lsls r1, 1 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_08540100 + bl LoadTaggedObjectPalette + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x2 + strb r1, [r0] + b _080AAB1E + .pool +_080AA998: + ldr r0, =task_title_screen_1 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r1, 0x8] + strh r2, [r1, 0xA] + ldr r0, =0x0000fff0 + strh r0, [r1, 0xC] + subs r0, 0x10 + strh r0, [r1, 0xE] + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x3 + strb r1, [r0] + b _080AAB1E + .pool +_080AA9E0: + movs r0, 0x1 + negs r0, r0 + ldr r1, =0x0000ffff + str r1, [sp] + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =title_screen_vblank_callback + bl SetVBlankCallback + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x4 + strb r1, [r0] + b _080AAB1E + .pool +_080AAA14: + movs r2, 0x80 + lsls r2, 1 + movs r0, 0x78 + movs r1, 0x50 + movs r3, 0 + bl sub_816F2A8 + movs r1, 0xE3 + lsls r1, 8 + movs r0, 0x28 + bl SetGpuReg + ldr r4, =0x0000ffff + movs r0, 0x2A + adds r1, r4, 0 + bl SetGpuReg + movs r1, 0xE0 + lsls r1, 8 + movs r0, 0x2C + bl SetGpuReg + movs r0, 0x2E + adds r1, r4, 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 + ldr r1, =0x00001f1f + movs r0, 0x48 + bl SetGpuReg + ldr r1, =0x00003f1f + movs r0, 0x4A + bl SetGpuReg + movs r0, 0x50 + movs r1, 0x84 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0xC + bl SetGpuReg + ldr r1, =0x00001a0b + movs r0, 0x8 + bl SetGpuReg + ldr r1, =0x00001b0e + movs r0, 0xA + bl SetGpuReg + ldr r1, =0x00004981 + movs r0, 0xC + bl SetGpuReg + movs r0, 0x1 + bl EnableInterrupts + ldr r1, =0x0000b441 + movs r0, 0 + bl SetGpuReg + ldr r0, =0x0000019d + bl m4aSongNumStart + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x5 + strb r1, [r0] + b _080AAB1E + .pool +_080AAAF0: + bl fade_and_return_progress_probably + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080AAB1E + movs r0, 0 + bl title_screen_add_logo_shine_obj + str r4, [sp] + movs r0, 0x4 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0xA0 + movs r2, 0x4 + movs r3, 0x4 + bl sub_80BA384 + ldr r0, =c2_title_screen_2 + bl SetMainCallback2 +_080AAB1E: + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end c2_title_screen_1 + + thumb_func_start c2_title_screen_2 +@ void c2_title_screen_2() +c2_title_screen_2: @ 80AAB2C + push {lr} + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end c2_title_screen_2 + + thumb_func_start task_title_screen_1 +@ void task_title_screen_1(int task_id) +task_title_screen_1: @ 80AAB44 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF + ands r0, r1 + ldr r6, =0x03005e00 + cmp r0, 0 + bne _080AAB6A + lsls r0, r5, 2 + adds r1, r0, r5 + lsls r1, 3 + adds r1, r6 + movs r2, 0xA + ldrsh r1, [r1, r2] + adds r4, r0, 0 + cmp r1, 0 + beq _080AAB7C +_080AAB6A: + lsls r3, r5, 2 + adds r0, r3, r5 + lsls r0, 3 + adds r0, r6 + movs r2, 0 + movs r1, 0x1 + strh r1, [r0, 0xA] + strh r2, [r0, 0x8] + adds r4, r3, 0 +_080AAB7C: + adds r0, r4, r5 + lsls r0, 3 + adds r6, r0, r6 + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _080AABC0 + ldrh r0, [r6, 0x8] + cmp r0, 0xB0 + bne _080AABA0 + movs r0, 0x1 + bl title_screen_add_logo_shine_obj + b _080AABAA + .pool +_080AABA0: + cmp r0, 0x40 + bne _080AABAA + movs r0, 0x2 + bl title_screen_add_logo_shine_obj +_080AABAA: + ldr r0, =0x03005e00 + adds r1, r4, r5 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1, 0x8] + subs r0, 0x1 + strh r0, [r1, 0x8] + b _080AAC32 + .pool +_080AABC0: + ldr r1, =0x00001441 + movs r0, 0 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0 + bl SetGpuReg + movs r0, 0x4A + movs r1, 0 + bl SetGpuReg + ldr r1, =0x00003f50 + movs r0, 0x50 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0x10 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + ldr r0, =gUnknown_08540018 + movs r1, 0x62 + movs r2, 0x2 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r4, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + movs r0, 0x40 + strh r0, [r1, 0x2E] + strh r5, [r1, 0x30] + ldr r0, =gUnknown_08540030 + movs r1, 0xA2 + movs r2, 0x2 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + strh r5, [r1, 0x30] + movs r0, 0x90 + strh r0, [r6, 0x8] + ldr r0, =task_title_screen_2 + str r0, [r6] +_080AAC32: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end task_title_screen_1 + + thumb_func_start task_title_screen_2 +@ void task_title_screen_2(int task_id) +task_title_screen_2: @ 80AAC50 + push {r4-r7,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0xF + ands r0, r1 + ldr r2, =0x03005e00 + cmp r0, 0 + bne _080AAC76 + lsls r0, r4, 2 + adds r1, r0, r4 + lsls r1, 3 + adds r1, r2 + movs r3, 0xA + ldrsh r1, [r1, r3] + adds r6, r0, 0 + cmp r1, 0 + beq _080AAC88 +_080AAC76: + lsls r3, r4, 2 + adds r0, r3, r4 + lsls r0, 3 + adds r0, r2 + movs r2, 0 + movs r1, 0x1 + strh r1, [r0, 0xA] + strh r2, [r0, 0x8] + adds r6, r3, 0 +_080AAC88: + ldr r1, =0x03005e00 + adds r0, r6, r4 + lsls r0, 3 + adds r5, r0, r1 + ldrh r0, [r5, 0x8] + movs r1, 0x8 + ldrsh r7, [r5, r1] + cmp r7, 0 + beq _080AACA8 + subs r0, 0x1 + strh r0, [r5, 0x8] + b _080AACE2 + .pool +_080AACA8: + movs r0, 0x1 + strh r0, [r5, 0xA] + ldr r1, =0x00002142 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x00000f06 + movs r0, 0x52 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + ldr r1, =0x00001741 + movs r0, 0 + bl SetGpuReg + movs r0, 0x80 + movs r1, 0x6C + bl sub_80AA4EC + movs r0, 0x80 + movs r1, 0x94 + bl sub_80AA548 + strh r7, [r5, 0x10] + ldr r0, =task_title_screen_3 + str r0, [r5] +_080AACE2: + ldr r2, =0x03005e00 + adds r0, r6, r4 + lsls r0, 3 + adds r3, r0, r2 + ldrh r1, [r3, 0x8] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080AAD02 + ldrh r1, [r3, 0xC] + movs r5, 0xC + ldrsh r0, [r3, r5] + cmp r0, 0 + beq _080AAD02 + adds r0, r1, 0x1 + strh r0, [r3, 0xC] +_080AAD02: + adds r0, r6, r4 + lsls r0, 3 + adds r3, r0, r2 + ldrh r1, [r3, 0x8] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080AAD20 + ldrh r1, [r3, 0xE] + movs r5, 0xE + ldrsh r0, [r3, r5] + cmp r0, 0 + beq _080AAD20 + adds r0, r1, 0x1 + strh r0, [r3, 0xE] +_080AAD20: + adds r4, r6, r4 + lsls r4, 3 + adds r4, r2 + movs r0, 0xE + ldrsh r1, [r4, r0] + lsls r5, r1, 8 + lsls r1, 24 + lsrs r1, 16 + movs r0, 0x2C + bl SetGpuReg + lsrs r5, 16 + movs r0, 0x2E + adds r1, r5, 0 + bl SetGpuReg + movs r0, 0xF + strh r0, [r4, 0x12] + movs r0, 0x6 + strh r0, [r4, 0x14] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end task_title_screen_2 + + thumb_func_start task_title_screen_3 +@ void task_title_screen_3(int task_id) +task_title_screen_3: @ 80AAD64 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080AAD84 + movs r0, 0x8 + ands r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _080AADB0 +_080AAD84: + movs r0, 0x4 + bl play_sound_effect + movs r0, 0x1 + negs r0, r0 + ldr r1, =0x0000ffff + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =Cb2_GoToMainMenu + bl SetMainCallback2 + b _080AAE98 + .pool +_080AADB0: + ldrh r1, [r2, 0x2C] + movs r0, 0x46 + ands r0, r1 + cmp r0, 0x46 + bne _080AADC8 + ldr r0, =c2_clear_save_data_screen_1 + bl SetMainCallback2 + b _080AAE98 + .pool +_080AADC8: + movs r0, 0x26 + ands r0, r1 + cmp r0, 0x26 + bne _080AADFC + bl sub_809D614 + cmp r0, 0x1 + bne _080AADFC + movs r0, 0x4 + bl play_sound_effect + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =c2_reset_rtc_screen_1 + bl SetMainCallback2 + b _080AAE98 + .pool +_080AADFC: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2C] + movs r0, 0x6 + ands r0, r1 + cmp r0, 0x6 + bne _080AAE30 + movs r0, 0x4 + bl play_sound_effect + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =c2_berry_program_update_screen_1 + bl SetMainCallback2 + b _080AAE98 + .pool +_080AAE30: + movs r0, 0x2C + movs r1, 0 + bl SetGpuReg + movs r0, 0x2E + movs r1, 0 + bl SetGpuReg + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r3, r0, r1 + ldrh r0, [r3, 0x8] + adds r0, 0x1 + strh r0, [r3, 0x8] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080AAE72 + ldrh r0, [r3, 0x10] + adds r0, 0x1 + strh r0, [r3, 0x10] + ldr r2, =0x02022e1a + movs r1, 0x10 + ldrsh r0, [r3, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r2] + ldr r1, =0x02022e18 + movs r0, 0 + strh r0, [r1] +_080AAE72: + ldrb r0, [r3, 0x8] + bl title_screen_update_rayquaza_ring_palette + ldr r0, =0x03007420 + ldr r1, =0x0000ffff + ldrh r0, [r0, 0x4] + cmp r0, 0 + bne _080AAE98 + movs r0, 0x1 + negs r0, r0 + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =c2_show_copyright_and_intro_again_1 + bl SetMainCallback2 +_080AAE98: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end task_title_screen_3 + + thumb_func_start Cb2_GoToMainMenu +Cb2_GoToMainMenu: @ 80AAEB8 + push {lr} + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080AAECA + ldr r0, =CB2_InitMainMenu + bl SetMainCallback2 +_080AAECA: + pop {r0} + bx r0 + .pool + thumb_func_end Cb2_GoToMainMenu + + thumb_func_start c2_show_copyright_and_intro_again_1 +c2_show_copyright_and_intro_again_1: @ 80AAED4 + push {lr} + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080AAEE6 + ldr r0, =c2_show_copyright_and_intro_again_2 + bl SetMainCallback2 +_080AAEE6: + pop {r0} + bx r0 + .pool + thumb_func_end c2_show_copyright_and_intro_again_1 + + thumb_func_start c2_clear_save_data_screen_1 +c2_clear_save_data_screen_1: @ 80AAEF0 + push {lr} + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080AAF02 + ldr r0, =c2_clear_save_data_screen_2 + bl SetMainCallback2 +_080AAF02: + pop {r0} + bx r0 + .pool + thumb_func_end c2_clear_save_data_screen_1 + + thumb_func_start c2_reset_rtc_screen_1 +c2_reset_rtc_screen_1: @ 80AAF0C + push {lr} + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080AAF1E + ldr r0, =sub_809EF88 + bl SetMainCallback2 +_080AAF1E: + pop {r0} + bx r0 + .pool + thumb_func_end c2_reset_rtc_screen_1 + + thumb_func_start c2_berry_program_update_screen_1 +c2_berry_program_update_screen_1: @ 80AAF28 + push {lr} + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080AAF3E + bl m4aMPlayAllStop + ldr r0, =sub_81BF384 + bl SetMainCallback2 +_080AAF3E: + pop {r0} + bx r0 + .pool + thumb_func_end c2_berry_program_update_screen_1 + + thumb_func_start title_screen_update_rayquaza_ring_palette +@ void title_screen_update_rayquaza_ring_palette(u8 a1) +title_screen_update_rayquaza_ring_palette: @ 80AAF48 + push {lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r1, r0, 24 + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080AAF9C + adds r0, r1, 0 + movs r1, 0x80 + bl cosine + lsls r0, 16 + asrs r0, 16 + adds r2, r0, 0 + adds r2, 0x80 + lsls r0, r2, 5 + subs r0, r2 + cmp r0, 0 + bge _080AAF72 + adds r0, 0xFF +_080AAF72: + asrs r0, 8 + movs r3, 0x1F + subs r1, r3, r0 + movs r0, 0x16 + muls r0, r2 + cmp r0, 0 + bge _080AAF82 + adds r0, 0xFF +_080AAF82: + asrs r0, 8 + subs r0, r3, r0 + lsls r0, 5 + orrs r1, r0 + movs r0, 0xC0 + lsls r0, 6 + orrs r1, r0 + mov r0, sp + strh r1, [r0] + movs r1, 0xEF + movs r2, 0x2 + bl gpu_pal_apply +_080AAF9C: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end title_screen_update_rayquaza_ring_palette + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/trade.s b/asm/trade.s new file mode 100644 index 000000000..3bb55822c --- /dev/null +++ b/asm/trade.s @@ -0,0 +1,14902 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_8077170 +sub_8077170: @ 8077170 + push {r4,lr} + adds r4, r0, 0 + adds r3, r1, 0 + ldr r0, =0x02022c2c + ldrb r0, [r0] + cmp r0, 0x1D + beq _08077194 + lsls r2, r3, 16 + lsrs r2, 16 + movs r0, 0 + adds r1, r4, 0 + bl link_0800A448 + lsls r0, 24 + lsrs r0, 24 + b _080771A2 + .pool +_08077194: + ldr r0, =0x03004140 + ldrb r0, [r0] + movs r1, 0x54 + adds r2, r4, 0 + bl rfu_NI_setSendData + movs r0, 0x1 +_080771A2: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8077170 + + thumb_func_start sub_80771AC +sub_80771AC: @ 80771AC + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_800A4D8 + pop {r0} + bx r0 + thumb_func_end sub_80771AC + + thumb_func_start sub_80771BC +sub_80771BC: @ 80771BC + push {r4,lr} + ldr r0, =0x02022c2c + ldrb r0, [r0] + cmp r0, 0x1D + bne _080771F0 + ldr r4, =0x03007880 + ldr r0, =0x03004140 + ldrb r0, [r0] + bl sub_800E87C + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + ldrh r0, [r0] + cmp r0, 0 + bne _080771EC + movs r0, 0x1 + b _080771F8 + .pool +_080771EC: + movs r0, 0 + b _080771F8 +_080771F0: + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 +_080771F8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80771BC + + thumb_func_start sub_8077200 +sub_8077200: @ 8077200 + push {lr} + bl sub_800A550 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8077200 + + thumb_func_start sub_8077210 +sub_8077210: @ 8077210 + push {lr} + bl sub_8077260 + cmp r0, 0 + beq _0807722C + ldr r0, =0x03004140 + ldrb r1, [r0] + movs r0, 0xC + bl rfu_clearSlot + b _08077230 + .pool +_0807722C: + bl sub_800A5B4 +_08077230: + pop {r0} + bx r0 + thumb_func_end sub_8077210 + + thumb_func_start sub_8077234 +sub_8077234: @ 8077234 + push {r4,lr} + adds r4, r0, 0 + bl sub_8077260 + cmp r0, 0 + beq _08077250 + ldr r0, =0x03004140 + ldrb r1, [r0] + movs r0, 0xC + bl rfu_clearSlot + b _08077258 + .pool +_08077250: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_800A5EC +_08077258: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8077234 + + thumb_func_start sub_8077260 +sub_8077260: @ 8077260 + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08077280 + ldr r0, =0x02022c2c + ldrb r0, [r0] + cmp r0, 0x1D + bne _08077280 + movs r0, 0x1 + b _08077282 + .pool +_08077280: + movs r0, 0 +_08077282: + pop {r1} + bx r1 + thumb_func_end sub_8077260 + + thumb_func_start sub_8077288 +sub_8077288: @ 8077288 + push {lr} + bl sub_800ADF8 + pop {r0} + bx r0 + thumb_func_end sub_8077288 + + thumb_func_start sub_8077294 +sub_8077294: @ 8077294 + push {lr} + bl sub_800A520 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8077294 + + thumb_func_start sub_80772A4 +sub_80772A4: @ 80772A4 + push {r4,r5,lr} + sub sp, 0xC + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + bl ResetTasks + bl sub_80A1A74 + ldr r2, =0x02037fd4 + ldrb r0, [r2, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x8] + ldr r0, =sub_807811C + bl SetVBlankCallback + ldr r4, =gUnknown_0860F074 + adds r0, r4, 0 + movs r1, 0xF0 + movs r2, 0x14 + bl gpu_pal_apply + adds r0, r4, 0 + movs r1, 0xD0 + movs r2, 0x14 + bl gpu_pal_apply + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0832DEE4 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + ldr r0, =0x0203229c + ldr r1, [r0] + movs r0, 0x8F + lsls r0, 4 + adds r1, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r0, =gUnknown_0832DEF4 + bl InitWindows + lsls r0, 16 + cmp r0, 0 + beq _0807738C + bl DeactivateAllTextPrinters + movs r5, 0 +_08077310: + lsls r4, r5, 24 + lsrs r4, 24 + adds r0, r4, 0 + bl ClearWindowTilemap + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r5, 0x1 + cmp r5, 0x11 + bls _08077310 + movs r0, 0x1E + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0xF + str r0, [sp, 0x8] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect + movs r0, 0 + movs r1, 0x14 + movs r2, 0xC0 + bl box_border_load_tiles_and_pal + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0xE0 + bl sub_809882C + bl sub_80D2F04 + ldr r2, =0x0203229c + ldr r0, [r2] + adds r0, 0x69 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0x6F + strb r1, [r0] + ldr r0, [r2] + adds r0, 0x70 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0x74 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0x75 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0x7A + strb r1, [r0] + ldr r0, [r2] + adds r0, 0x7B + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xA8 + strb r1, [r0] +_0807738C: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80772A4 + + thumb_func_start sub_80773AC +sub_80773AC: @ 80773AC + push {lr} + ldr r0, =sub_80773D0 + bl SetMainCallback2 + ldr r0, =0x030022c0 + movs r1, 0 + str r1, [r0] + ldr r0, =0x020244ea + strb r1, [r0] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80773AC + + thumb_func_start sub_80773D0 +sub_80773D0: @ 80773D0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x28 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r3, r1, 0 + cmp r0, 0x16 + bls _080773EA + b _08077B46 +_080773EA: + lsls r0, 2 + ldr r1, =_080773FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080773FC: + .4byte _08077458 + .4byte _080774A4 + .4byte _08077560 + .4byte _0807758C + .4byte _080775E8 + .4byte _08077648 + .4byte _08077688 + .4byte _080776A8 + .4byte _080777E8 + .4byte _08077810 + .4byte _08077834 + .4byte _080778BC + .4byte _080778CA + .4byte _08077970 + .4byte _08077A40 + .4byte _08077A80 + .4byte _08077A9A + .4byte _08077AA8 + .4byte _08077ABC + .4byte _08077ADC + .4byte _08077AFC + .4byte _08077B10 + .4byte _08077B30 +_08077458: + ldr r4, =0x0203229c + ldr r0, =0x000010f0 + bl AllocZeroed + str r0, [r4] + bl sub_80772A4 + ldr r4, =0x02032184 + movs r0, 0xE0 + lsls r0, 4 + bl AllocZeroed + str r0, [r4] + movs r6, 0 + ldr r2, =0x02032188 +_08077476: + lsls r1, r6, 8 + ldr r0, [r4] + adds r0, r1 + stm r2!, {r0} + adds r6, 0x1 + cmp r6, 0xD + ble _08077476 + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _08077B22 + .pool +_080774A4: + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + movs r6, 0 + movs r4, 0 +_080774B2: + movs r0, 0x64 + muls r0, r6 + ldr r1, =0x02024744 + adds r0, r1 + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + str r4, [sp, 0xC] + movs r1, 0 + movs r2, 0 + movs r3, 0x20 + bl create_pokemon_set_level + adds r6, 0x1 + cmp r6, 0x5 + ble _080774B2 + movs r0, 0 + bl sub_807A19C + movs r0, 0 + bl ShowBg + ldr r0, =0x03003124 + ldrb r2, [r0] + cmp r2, 0 + bne _0807754C + ldr r1, =0x020229c6 + ldr r5, =0x00001122 + adds r0, r5, 0 + strh r0, [r1] + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0xA8 + strb r2, [r0] + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08077528 + bl sub_800B488 + bl sub_8009734 + bl sub_8011BA4 + b _08077B46 + .pool +_08077528: + bl sub_8009734 + ldr r0, =0x030022c0 + movs r7, 0x87 + lsls r7, 3 + adds r0, r7 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + ldr r0, =task00_08081A90 + movs r1, 0x1 + bl CreateTask + b _08077B46 + .pool +_0807754C: + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x4 + strb r1, [r0] + b _08077B46 + .pool +_08077560: + ldr r2, =0x0203229c + ldr r1, [r2] + adds r1, 0xA8 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r2] + adds r1, r0, 0 + adds r1, 0xA8 + ldrb r0, [r1] + cmp r0, 0xB + bhi _0807757A + b _08077B46 +_0807757A: + movs r0, 0 + strb r0, [r1] + movs r2, 0x87 + lsls r2, 3 + adds r1, r3, r2 + b _08077B22 + .pool +_0807758C: + bl sub_800ABAC + adds r4, r0, 0 + bl sub_800AA48 + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bcs _080775A0 + b _08077B46 +_080775A0: + bl sub_800ABBC + lsls r0, 24 + cmp r0, 0 + beq _080775D8 + ldr r0, =0x0203229c + ldr r1, [r0] + adds r1, 0xA8 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1E + bhi _080775C0 + b _08077B46 +_080775C0: + bl sub_800A620 + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _08077B22 + .pool +_080775D8: + ldr r1, =0x030022c0 + movs r5, 0x87 + lsls r5, 3 + adds r1, r5 + b _08077B22 + .pool +_080775E8: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080775F2 + b _08077B46 +_080775F2: + bl sub_800A23C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08077600 + b _08077B46 +_08077600: + bl sub_8011BD0 + bl calc_player_party_count + ldr r1, =0x030022c0 + movs r7, 0x87 + lsls r7, 3 + adds r1, r7 + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0xA8 + strb r2, [r0] + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + bne _0807762A + b _08077B46 +_0807762A: + movs r0, 0x1 + bl sub_801048C + bl sub_800ADF8 + b _08077B46 + .pool +_08077648: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08077680 + bl sub_8010500 + lsls r0, 24 + cmp r0, 0 + bne _0807765C + b _08077B46 +_0807765C: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 + b _08077B46 + .pool +_08077680: + movs r2, 0x87 + lsls r2, 3 + adds r1, r3, r2 + b _08077B22 +_08077688: + bl shedinja_maker_maybe + lsls r0, 24 + cmp r0, 0 + bne _08077694 + b _08077B46 +_08077694: + bl sub_807A5B0 + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _08077B22 + .pool +_080776A8: + bl calc_enemy_party_count + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + ldr r2, =0x0203229c + ldr r0, [r2] + ldr r1, =0x020244e9 + ldrb r1, [r1] + adds r0, 0x36 + strb r1, [r0] + ldr r0, [r2] + ldr r1, =0x020244ea + ldrb r1, [r1] + adds r0, 0x37 + strb r1, [r0] + movs r6, 0 + ldr r0, [r2] + adds r0, 0x36 + ldrb r0, [r0] + cmp r6, r0 + bge _08077740 + mov r8, r2 + ldr r7, =gUnknown_0832DE24 +_080776E2: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + ldrb r2, [r7] + lsls r2, 19 + movs r1, 0xE0 + lsls r1, 12 + adds r2, r1 + asrs r2, 16 + ldrb r3, [r7, 0x1] + lsls r3, 19 + ldr r1, =0xfff40000 + adds r3, r1 + asrs r3, 16 + movs r1, 0x1 + str r1, [sp] + str r0, [sp, 0x4] + str r1, [sp, 0x8] + adds r0, r5, 0 + ldr r1, =sub_80D3014 + bl sub_80D2CC4 + mov r2, r8 + ldr r1, [r2] + adds r1, 0x28 + adds r1, r6 + strb r0, [r1] + adds r7, 0x2 + adds r6, 0x1 + ldr r0, [r2] + adds r0, 0x36 + ldrb r0, [r0] + cmp r6, r0 + blt _080776E2 +_08077740: + movs r6, 0 + ldr r1, =0x0203229c + ldr r0, [r1] + adds r0, 0x37 + ldrb r0, [r0] + cmp r6, r0 + bge _080777B8 + ldr r0, =gUnknown_0832DE24 + mov r8, r1 + adds r7, r0, 0 + adds r7, 0xC +_08077756: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + ldrb r2, [r7] + lsls r2, 19 + movs r3, 0xE0 + lsls r3, 12 + adds r2, r3 + asrs r2, 16 + ldrb r3, [r7, 0x1] + lsls r3, 19 + ldr r1, =0xfff40000 + adds r3, r1 + asrs r3, 16 + movs r1, 0x1 + str r1, [sp] + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r5, 0 + ldr r1, =sub_80D3014 + bl sub_80D2CC4 + mov r2, r8 + ldr r1, [r2] + adds r1, 0x2E + adds r1, r6 + strb r0, [r1] + adds r7, 0x2 + adds r6, 0x1 + ldr r0, [r2] + adds r0, 0x37 + ldrb r0, [r0] + cmp r6, r0 + blt _08077756 +_080777B8: + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _08077B22 + .pool +_080777E8: + bl sub_81B5D30 + ldr r0, =0x0203229c + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x36 + adds r1, 0x28 + movs r2, 0 + bl sub_81B5D4C + ldr r1, =0x030022c0 + movs r5, 0x87 + lsls r5, 3 + adds r1, r5 + b _08077B22 + .pool +_08077810: + ldr r0, =0x0203229c + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x36 + adds r1, 0x28 + movs r2, 0x1 + bl sub_81B5D4C + ldr r1, =0x030022c0 + movs r7, 0x87 + lsls r7, 3 + adds r1, r7 + b _08077B22 + .pool +_08077834: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r5, =0x02032188 + ldr r1, [r5] + movs r4, 0x3 + str r4, [sp] + movs r2, 0 + movs r3, 0 + bl sub_80C6D80 + bl link_get_multiplayer_id + lsls r0, 24 + movs r1, 0x80 + lsls r1, 17 + eors r1, r0 + lsrs r1, 24 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r1, =0x020229f0 + adds r0, r1 + ldr r1, [r5, 0xC] + str r4, [sp] + movs r2, 0 + movs r3, 0 + bl sub_80C6D80 + ldr r4, =gUnknown_0832DE94 + ldr r0, [r4] + ldr r1, [r5, 0x18] + movs r2, 0x2 + str r2, [sp] + movs r2, 0 + movs r3, 0 + bl sub_80C6D80 + ldr r0, [r4, 0x4] + ldr r1, [r5, 0x20] + movs r2, 0x18 + bl sub_807A308 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0xA8 + strb r2, [r0] + b _08077B46 + .pool +_080778BC: + bl sub_807A1F0 + lsls r0, 24 + cmp r0, 0 + bne _080778C8 + b _08077B46 +_080778C8: + b _08077B1A +_080778CA: + ldr r0, =0x03005d90 + ldr r1, [r0] + movs r0, 0x1 + movs r2, 0x78 + bl GetStringCenterAlignXOffset + movs r6, 0 + add r5, sp, 0x10 + adds r4, r0, 0 + adds r4, 0x10 +_080778DE: + add r1, sp, 0x10 + ldr r0, =gUnknown_0832DCAC + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldrh r0, [r5] + adds r0, r6 + strh r0, [r5] + lsls r1, r4, 16 + asrs r1, 16 + add r0, sp, 0x10 + movs r2, 0xA + movs r3, 0x1 + bl AddObjectToFront + adds r4, 0x20 + adds r6, 0x1 + cmp r6, 0x2 + ble _080778DE + bl link_get_multiplayer_id + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r0, =0x020229f0 + adds r1, r0 + movs r0, 0x1 + movs r2, 0x78 + bl GetStringCenterAlignXOffset + movs r6, 0 + add r5, sp, 0x10 + adds r4, r0, 0 + adds r4, 0x88 +_0807792C: + add r1, sp, 0x10 + ldr r0, =gUnknown_0832DCAC + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + adds r0, r6, 0x3 + ldrh r3, [r5] + adds r0, r3 + strh r0, [r5] + lsls r1, r4, 16 + asrs r1, 16 + add r0, sp, 0x10 + movs r2, 0xA + movs r3, 0x1 + bl AddObjectToFront + adds r4, 0x20 + adds r6, 0x1 + cmp r6, 0x2 + ble _0807792C + ldr r1, =0x030022c0 + movs r5, 0x87 + lsls r5, 3 + adds r1, r5 + b _08077B22 + .pool +_08077970: + ldr r4, =gUnknown_0832DCAC + add r1, sp, 0x10 + adds r0, r4, 0 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r5,r7} + stm r1!, {r2,r5,r7} + add r1, sp, 0x10 + adds r0, r1, 0 + ldrh r0, [r0] + adds r0, 0x6 + strh r0, [r1] + adds r0, r1, 0 + movs r1, 0xD7 + movs r2, 0x98 + movs r3, 0x1 + bl AddObjectToFront + add r0, sp, 0x10 + ldm r4!, {r3,r5,r7} + stm r0!, {r3,r5,r7} + ldm r4!, {r1-r3} + stm r0!, {r1-r3} + add r1, sp, 0x10 + adds r0, r1, 0 + ldrh r0, [r0] + adds r0, 0x7 + strh r0, [r1] + adds r0, r1, 0 + movs r1, 0xF7 + movs r2, 0x98 + movs r3, 0x1 + bl AddObjectToFront + movs r6, 0 + add r4, sp, 0x10 + movs r5, 0xC0 + lsls r5, 13 +_080779BC: + add r1, sp, 0x10 + ldr r0, =gUnknown_0832DCAC + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + adds r0, r6, 0 + adds r0, 0x8 + ldrh r7, [r4] + adds r0, r7 + strh r0, [r4] + asrs r1, r5, 16 + add r0, sp, 0x10 + movs r2, 0x96 + movs r3, 0x1 + bl AddObjectToFront + movs r0, 0x80 + lsls r0, 14 + adds r5, r0 + adds r6, 0x1 + cmp r6, 0x5 + ble _080779BC + ldr r0, =gUnknown_0832DC94 + ldr r2, =gUnknown_0832DE24 + ldrb r1, [r2] + lsls r1, 19 + movs r3, 0x80 + lsls r3, 14 + adds r1, r3 + asrs r1, 16 + ldrb r2, [r2, 0x1] + lsls r2, 3 + movs r3, 0x2 + bl AddObjectToFront + ldr r2, =0x0203229c + ldr r1, [r2] + adds r1, 0x34 + movs r3, 0 + strb r0, [r1] + ldr r0, [r2] + adds r0, 0x35 + strb r3, [r0] + ldr r1, =0x030022c0 + movs r5, 0x87 + lsls r5, 3 + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0 + bl rbox_fill_rectangle + b _08077B46 + .pool +_08077A40: + movs r0, 0 + bl sub_807A320 + movs r0, 0 + bl sub_8079BE0 + ldr r2, =0x0203229c + ldr r0, [r2] + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x1] + bl sub_8078388 + ldr r1, =0x030022c0 + movs r7, 0x87 + lsls r7, 3 + adds r1, r7 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, =0x000001b3 + bl song_play_for_text + b _08077B46 + .pool +_08077A80: + movs r0, 0x1 + bl sub_807A320 + movs r0, 0x1 + bl sub_8079BE0 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08077A9A: + movs r0, 0 + bl sub_80782B8 + b _08077B1A + .pool +_08077AA8: + movs r0, 0x1 + bl sub_80782B8 + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _08077B22 + .pool +_08077ABC: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r1, =0x030022c0 + movs r5, 0x87 + lsls r5, 3 + adds r1, r5 + b _08077B22 + .pool +_08077ADC: + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0x2 + bl sub_80782B8 + ldr r1, =0x030022c0 + movs r7, 0x87 + lsls r7, 3 + adds r1, r7 + b _08077B22 + .pool +_08077AFC: + movs r0, 0 + bl sub_807A468 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _08077B22 + .pool +_08077B10: + movs r0, 0x1 + bl sub_807A468 + bl sub_807A53C +_08077B1A: + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_08077B22: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _08077B46 + .pool +_08077B30: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08077B46 + ldr r0, =sub_8078C34 + str r0, [r3] + ldr r0, =sub_807825C + bl SetMainCallback2 +_08077B46: + bl RunTextPrinters + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + add sp, 0x28 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80773D0 + + thumb_func_start sub_8077B74 +sub_8077B74: @ 8077B74 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x24 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x16 + bls _08077B8E + b _080780F6 +_08077B8E: + lsls r0, 2 + ldr r1, =_08077BA0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08077BA0: + .4byte _08077BFC + .4byte _08077C10 + .4byte _08077C18 + .4byte _08077C20 + .4byte _08077C28 + .4byte _08077C3C + .4byte _08077C64 + .4byte _08077C6C + .4byte _08077DB0 + .4byte _08077DD8 + .4byte _08077DFC + .4byte _08077E84 + .4byte _08077EA0 + .4byte _08077F48 + .4byte _080780F6 + .4byte _080780F6 + .4byte _08078038 + .4byte _08078040 + .4byte _08078068 + .4byte _080780A4 + .4byte _080780C4 + .4byte _080780CC + .4byte _080780E4 +_08077BFC: + bl sub_80772A4 + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080780D8 + .pool +_08077C10: + movs r5, 0x87 + lsls r5, 3 + adds r1, r2, r5 + b _08077E58 +_08077C18: + movs r7, 0x87 + lsls r7, 3 + adds r1, r2, r7 + b _080780D8 +_08077C20: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _080780D8 +_08077C28: + bl calc_player_party_count + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _080780D8 + .pool +_08077C3C: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08077C50 + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 +_08077C50: + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080780D8 + .pool +_08077C64: + movs r5, 0x87 + lsls r5, 3 + adds r1, r2, r5 + b _080780D8 +_08077C6C: + bl calc_enemy_party_count + ldr r4, =0x0203229c + ldr r0, [r4] + ldr r1, =0x020244e9 + ldrb r1, [r1] + adds r0, 0x36 + strb r1, [r0] + ldr r0, [r4] + ldr r1, =0x020244ea + ldrb r1, [r1] + adds r0, 0x37 + strb r1, [r0] + movs r0, 0 + bl ClearWindowTilemap + movs r0, 0 + bl sub_8079BE0 + movs r0, 0x1 + bl sub_8079BE0 + movs r6, 0 + ldr r0, [r4] + adds r0, 0x36 + ldrb r0, [r0] + cmp r6, r0 + bge _08077D08 + mov r8, r4 + ldr r7, =gUnknown_0832DE24 +_08077CA8: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + ldrb r2, [r7] + lsls r2, 19 + movs r1, 0xE0 + lsls r1, 12 + adds r2, r1 + asrs r2, 16 + ldrb r3, [r7, 0x1] + lsls r3, 19 + ldr r1, =0xfff40000 + adds r3, r1 + asrs r3, 16 + movs r1, 0x1 + str r1, [sp] + str r0, [sp, 0x4] + str r1, [sp, 0x8] + adds r0, r5, 0 + ldr r1, =sub_80D3014 + bl sub_80D2CC4 + mov r2, r8 + ldr r1, [r2] + adds r1, 0x28 + adds r1, r6 + strb r0, [r1] + adds r7, 0x2 + adds r6, 0x1 + ldr r0, [r2] + adds r0, 0x36 + ldrb r0, [r0] + cmp r6, r0 + blt _08077CA8 +_08077D08: + movs r6, 0 + ldr r1, =0x0203229c + ldr r0, [r1] + adds r0, 0x37 + ldrb r0, [r0] + cmp r6, r0 + bge _08077D80 + ldr r0, =gUnknown_0832DE24 + mov r8, r1 + adds r7, r0, 0 + adds r7, 0xC +_08077D1E: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x41 + movs r2, 0 + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + ldrb r2, [r7] + lsls r2, 19 + movs r3, 0xE0 + lsls r3, 12 + adds r2, r3 + asrs r2, 16 + ldrb r3, [r7, 0x1] + lsls r3, 19 + ldr r1, =0xfff40000 + adds r3, r1 + asrs r3, 16 + movs r1, 0x1 + str r1, [sp] + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r5, 0 + ldr r1, =sub_80D3014 + bl sub_80D2CC4 + mov r2, r8 + ldr r1, [r2] + adds r1, 0x2E + adds r1, r6 + strb r0, [r1] + adds r7, 0x2 + adds r6, 0x1 + ldr r0, [r2] + adds r0, 0x37 + ldrb r0, [r0] + cmp r6, r0 + blt _08077D1E +_08077D80: + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080780D8 + .pool +_08077DB0: + bl sub_81B5D30 + ldr r0, =0x0203229c + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x36 + adds r1, 0x28 + movs r2, 0 + bl sub_81B5D4C + ldr r1, =0x030022c0 + movs r5, 0x87 + lsls r5, 3 + adds r1, r5 + b _080780D8 + .pool +_08077DD8: + ldr r0, =0x0203229c + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x36 + adds r1, 0x28 + movs r2, 0x1 + bl sub_81B5D4C + ldr r1, =0x030022c0 + movs r7, 0x87 + lsls r7, 3 + adds r1, r7 + b _080780D8 + .pool +_08077DFC: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r5, =0x02032188 + ldr r1, [r5] + movs r4, 0x3 + str r4, [sp] + movs r2, 0 + movs r3, 0 + bl sub_80C6D80 + bl link_get_multiplayer_id + lsls r0, 24 + movs r1, 0x80 + lsls r1, 17 + eors r1, r0 + lsrs r1, 24 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r1, =0x020229f0 + adds r0, r1 + ldr r1, [r5, 0xC] + str r4, [sp] + movs r2, 0 + movs r3, 0 + bl sub_80C6D80 + ldr r4, =gUnknown_0832DE94 + ldr r0, [r4] + ldr r1, [r5, 0x18] + movs r2, 0x2 + str r2, [sp] + movs r2, 0 + movs r3, 0 + bl sub_80C6D80 + ldr r0, [r4, 0x4] + ldr r1, [r5, 0x20] + movs r2, 0x18 + bl sub_807A308 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_08077E58: + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0xA8 + strb r2, [r0] + b _080780F6 + .pool +_08077E84: + bl sub_807A1F0 + lsls r0, 24 + cmp r0, 0 + bne _08077E90 + b _080780F6 +_08077E90: + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _080780D8 + .pool +_08077EA0: + ldr r0, =0x03005d90 + ldr r1, [r0] + movs r0, 0x1 + movs r2, 0x78 + bl GetStringCenterAlignXOffset + movs r6, 0 + add r5, sp, 0xC + adds r4, r0, 0 + adds r4, 0x10 +_08077EB4: + add r1, sp, 0xC + ldr r0, =gUnknown_0832DCAC + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldrh r0, [r5] + adds r0, r6 + strh r0, [r5] + lsls r1, r4, 16 + asrs r1, 16 + add r0, sp, 0xC + movs r2, 0xA + movs r3, 0x1 + bl AddObjectToFront + adds r4, 0x20 + adds r6, 0x1 + cmp r6, 0x2 + ble _08077EB4 + bl link_get_multiplayer_id + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r0, =0x020229f0 + adds r1, r0 + movs r0, 0x1 + movs r2, 0x78 + bl GetStringCenterAlignXOffset + movs r6, 0 + add r5, sp, 0xC + adds r4, r0, 0 + adds r4, 0x88 +_08077F02: + add r1, sp, 0xC + ldr r0, =gUnknown_0832DCAC + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + adds r0, r6, 0x3 + ldrh r3, [r5] + adds r0, r3 + strh r0, [r5] + lsls r1, r4, 16 + asrs r1, 16 + add r0, sp, 0xC + movs r2, 0xA + movs r3, 0x1 + bl AddObjectToFront + adds r4, 0x20 + adds r6, 0x1 + cmp r6, 0x2 + ble _08077F02 + ldr r1, =0x030022c0 + movs r5, 0x87 + lsls r5, 3 + adds r1, r5 + b _080780D8 + .pool +_08077F48: + ldr r4, =gUnknown_0832DCAC + add r1, sp, 0xC + adds r0, r4, 0 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r5,r7} + stm r1!, {r2,r5,r7} + add r1, sp, 0xC + adds r0, r1, 0 + ldrh r0, [r0] + adds r0, 0x6 + strh r0, [r1] + adds r0, r1, 0 + movs r1, 0xD7 + movs r2, 0x98 + movs r3, 0x1 + bl AddObjectToFront + add r0, sp, 0xC + ldm r4!, {r3,r5,r7} + stm r0!, {r3,r5,r7} + ldm r4!, {r1-r3} + stm r0!, {r1-r3} + add r1, sp, 0xC + adds r0, r1, 0 + ldrh r0, [r0] + adds r0, 0x7 + strh r0, [r1] + adds r0, r1, 0 + movs r1, 0xF7 + movs r2, 0x98 + movs r3, 0x1 + bl AddObjectToFront + movs r6, 0 + add r4, sp, 0xC + movs r5, 0xC0 + lsls r5, 13 +_08077F94: + add r1, sp, 0xC + ldr r0, =gUnknown_0832DCAC + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + adds r0, r6, 0 + adds r0, 0x8 + ldrh r7, [r4] + adds r0, r7 + strh r0, [r4] + asrs r1, r5, 16 + add r0, sp, 0xC + movs r2, 0x96 + movs r3, 0x1 + bl AddObjectToFront + movs r0, 0x80 + lsls r0, 14 + adds r5, r0 + adds r6, 0x1 + cmp r6, 0x5 + ble _08077F94 + ldr r0, =0x0203229c + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0x35 + ldrb r1, [r2] + adds r4, r0, 0 + cmp r1, 0x5 + bhi _08077FE4 + ldr r0, =0x0203cf20 + ldrb r0, [r0] + b _08077FEA + .pool +_08077FE4: + ldr r0, =0x0203cf20 + ldrb r0, [r0] + adds r0, 0x6 +_08077FEA: + strb r0, [r2] + ldr r0, =gUnknown_0832DC94 + ldr r3, =gUnknown_0832DE24 + ldr r1, [r4] + adds r1, 0x35 + ldrb r2, [r1] + lsls r2, 1 + adds r1, r2, r3 + ldrb r1, [r1] + lsls r1, 19 + movs r5, 0x80 + lsls r5, 14 + adds r1, r5 + asrs r1, 16 + adds r3, 0x1 + adds r2, r3 + ldrb r2, [r2] + lsls r2, 3 + movs r3, 0x2 + bl AddObjectToFront + ldr r1, [r4] + adds r1, 0x34 + strb r0, [r1] + ldr r0, =0x030022c0 + movs r7, 0x87 + lsls r7, 3 + adds r0, r7 + movs r1, 0x10 + strb r1, [r0] + b _080780F6 + .pool +_08078038: + movs r0, 0 + bl sub_80782B8 + b _080780D0 +_08078040: + movs r0, 0x1 + bl sub_80782B8 + ldr r2, =0x0203229c + ldr r0, [r2] + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + strb r1, [r0, 0x1] + bl sub_8078388 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _080780D8 + .pool +_08078068: + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + movs r4, 0x1 + negs r4, r4 + adds r0, r4, 0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r1, =0x030022c0 + movs r3, 0x87 + lsls r3, 3 + adds r1, r3 + b _080780D8 + .pool +_080780A4: + movs r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0x2 + bl sub_80782B8 + ldr r1, =0x030022c0 + movs r5, 0x87 + lsls r5, 3 + adds r1, r5 + b _080780D8 + .pool +_080780C4: + movs r7, 0x87 + lsls r7, 3 + adds r1, r2, r7 + b _080780D8 +_080780CC: + bl sub_807A53C +_080780D0: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_080780D8: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080780F6 + .pool +_080780E4: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080780F6 + ldr r0, =sub_807825C + bl SetMainCallback2 +_080780F6: + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + add sp, 0x24 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8077B74 + + thumb_func_start sub_807811C +sub_807811C: @ 807811C + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_807811C + + thumb_func_start sub_8078130 +sub_8078130: @ 8078130 + push {r4,lr} + sub sp, 0x4 + ldr r4, =0x0203229c + ldr r1, [r4] + adds r1, 0xA8 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xF + bls _08078160 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, [r4] + adds r0, 0x6F + movs r1, 0xA + strb r1, [r0] +_08078160: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8078130 + + thumb_func_start sub_807816C +sub_807816C: @ 807816C + push {r4,lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080781C2 + ldr r1, =0x02032298 + ldr r4, =0x0203229c + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x35 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r2, 0 + adds r0, 0x7E + ldrb r0, [r0] + strb r0, [r1, 0x1] + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _080781B4 + adds r1, r2, 0 + adds r1, 0x6F + movs r0, 0x10 + strb r0, [r1] + b _080781C2 + .pool +_080781B4: + movs r0, 0x20 + bl sub_800ABF4 + ldr r0, [r4] + adds r0, 0x6F + movs r1, 0xD + strb r1, [r0] +_080781C2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_807816C + + thumb_func_start sub_80781C8 +sub_80781C8: @ 80781C8 + push {r4,r5,lr} + ldr r5, =0x030022c0 + ldr r0, =sub_80773AC + str r0, [r5, 0x8] + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08078220 + bl sub_8010500 + lsls r0, 24 + cmp r0, 0 + beq _08078244 + ldr r0, =0x02032184 + ldr r0, [r0] + bl Free + bl FreeAllWindowBuffers + ldr r0, =0x0203229c + ldr r0, [r0] + bl Free + movs r0, 0 + str r0, [r5] + bl sub_800E084 + ldr r0, =sub_807AE50 + bl SetMainCallback2 + b _08078244 + .pool +_08078220: + ldr r0, =0x03003124 + ldrb r4, [r0] + cmp r4, 0 + bne _08078244 + ldr r0, =0x02032184 + ldr r0, [r0] + bl Free + bl FreeAllWindowBuffers + ldr r0, =0x0203229c + ldr r0, [r0] + bl Free + str r4, [r5] + ldr r0, =sub_807AE50 + bl SetMainCallback2 +_08078244: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80781C8 + + thumb_func_start sub_807825C +sub_807825C: @ 807825C + push {r4,lr} + bl sub_80795AC + bl sub_807A0C4 + movs r0, 0 + bl sub_80796B4 + movs r0, 0x1 + bl sub_80796B4 + ldr r4, =0x0203229c + ldr r2, [r4] + ldrb r1, [r2] + adds r0, r1, 0x1 + strb r0, [r2] + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x18 + bl SetGpuReg + ldr r2, [r4] + ldrb r1, [r2, 0x1] + adds r0, r1, 0 + adds r0, 0xFF + strb r0, [r2, 0x1] + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x1C + bl SetGpuReg + bl sub_8197224 + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807825C + + thumb_func_start sub_80782B8 +sub_80782B8: @ 80782B8 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + beq _08078324 + cmp r4, 0x1 + bgt _080782CE + cmp r4, 0 + beq _080782D4 + b _0807837E +_080782CE: + cmp r4, 0x2 + beq _0807834C + b _0807837E +_080782D4: + ldr r0, =gUnknown_08DDB3E4 + movs r1, 0 + movs r2, 0x60 + bl gpu_pal_apply + ldr r1, =gUnknown_08DDB464 + movs r2, 0x94 + lsls r2, 5 + movs r0, 0x1 + movs r3, 0 + bl LoadBgTiles + ldr r1, =gUnknown_08DDCF04 + movs r0, 0x20 + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBufferRect_ChangePalette + ldr r1, =gUnknown_0832CABC + movs r2, 0x80 + lsls r2, 4 + movs r0, 0x2 + movs r3, 0 + bl LoadBgTilemap + b _0807837E + .pool +_08078324: + ldr r1, =gUnknown_0832D2BC + movs r2, 0x80 + lsls r2, 4 + movs r0, 0x3 + movs r3, 0 + bl LoadBgTilemap + movs r0, 0 + bl sub_8079E44 + movs r0, 0x1 + bl sub_8079E44 + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + b _0807837E + .pool +_0807834C: + movs r5, 0x80 + lsls r5, 21 + movs r4, 0x3 +_08078352: + lsrs r0, r5, 24 + movs r1, 0 + bl SetGpuReg + movs r0, 0x80 + lsls r0, 18 + adds r5, r0 + subs r4, 0x1 + cmp r4, 0 + bge _08078352 + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg +_0807837E: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80782B8 + + thumb_func_start sub_8078388 +sub_8078388: @ 8078388 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r3, 0 + ldr r5, =0x0203229c + mov r8, r5 + ldr r0, =0x02020630 + mov r12, r0 + movs r1, 0x5 + negs r1, r1 + mov r9, r1 + movs r4, 0x6 + movs r7, 0x1 + movs r6, 0 +_080783A6: + mov r1, r8 + ldr r0, [r1] + adds r1, r0, 0 + adds r1, 0x36 + ldrb r1, [r1] + cmp r3, r1 + bge _080783E0 + adds r0, 0x28 + adds r0, r3 + 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] + ldr r0, [r5] + adds r0, 0x38 + adds r0, r3 + strb r7, [r0] + b _080783E6 + .pool +_080783E0: + adds r0, 0x38 + adds r0, r3 + strb r6, [r0] +_080783E6: + mov r1, r8 + ldr r0, [r1] + adds r1, r0, 0 + adds r1, 0x37 + ldrb r1, [r1] + cmp r3, r1 + bge _08078416 + adds r0, 0x2E + adds r0, r3 + 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] + ldr r0, [r5] + adds r0, 0x38 + adds r0, r4 + strb r7, [r0] + b _0807841C +_08078416: + adds r0, 0x38 + adds r0, r4 + strb r6, [r0] +_0807841C: + adds r4, 0x1 + adds r3, 0x1 + cmp r3, 0x5 + ble _080783A6 + ldr r0, [r5] + adds r0, 0x44 + movs r1, 0x1 + strb r1, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8078388 + + thumb_func_start sub_8078438 +sub_8078438: @ 8078438 + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r3, 0 + cmp r3, r2 + bcs _08078452 +_08078444: + adds r0, r5, r3 + adds r1, r4, r3 + ldrb r1, [r1] + strb r1, [r0] + adds r3, 0x1 + cmp r3, r2 + bcc _08078444 +_08078452: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8078438 + + thumb_func_start shedinja_maker_maybe +shedinja_maker_maybe: @ 8078458 + push {r4-r6,lr} + sub sp, 0xC + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x69 + ldrb r0, [r0] + cmp r0, 0x15 + bls _08078472 + b _080787AA +_08078472: + lsls r0, 2 + ldr r1, =_08078484 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08078484: + .4byte _080784DC + .4byte _08078508 + .4byte _08078784 + .4byte _08078534 + .4byte _08078548 + .4byte _0807857C + .4byte _08078784 + .4byte _08078598 + .4byte _080785AC + .4byte _080785E0 + .4byte _08078784 + .4byte _080785FC + .4byte _08078610 + .4byte _08078644 + .4byte _08078784 + .4byte _0807866C + .4byte _08078680 + .4byte _080786B4 + .4byte _08078784 + .4byte _080786DC + .4byte _080786F0 + .4byte _08078720 +_080784DC: + ldr r0, =0x020228c4 + ldr r1, =0x020244ec + movs r2, 0xC8 + bl sub_8078438 + ldr r3, =0x0203229c + ldr r1, [r3] + adds r1, 0x69 + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + ldr r0, [r3] + adds r0, 0xA8 + strb r2, [r0] + b _080787AA + .pool +_08078508: + bl sub_80771BC + cmp r0, 0 + bne _08078512 + b _080787AA +_08078512: + bl sub_8077200 + cmp r0, 0 + bne _08078524 + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_08078524: + bl sub_8077210 + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_08078534: + cmp r5, 0 + bne _0807853E + movs r0, 0x1 + bl sub_80771AC +_0807853E: + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_08078548: + bl sub_8077200 + cmp r0, 0x3 + beq _08078552 + b _080787AA +_08078552: + ldr r0, =0x02024744 + movs r2, 0x1 + adds r1, r5, 0 + eors r1, r2 + lsls r1, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0xC8 + bl sub_8078438 + bl sub_8077210 + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_0807857C: + ldr r0, =0x020228c4 + ldr r1, =0x020245b4 + movs r2, 0xC8 + bl sub_8078438 + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_08078598: + cmp r5, 0 + bne _080785A2 + movs r0, 0x1 + bl sub_80771AC +_080785A2: + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_080785AC: + bl sub_8077200 + cmp r0, 0x3 + beq _080785B6 + b _080787AA +_080785B6: + ldr r0, =0x0202480c + movs r2, 0x1 + adds r1, r5, 0 + eors r1, r2 + lsls r1, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0xC8 + bl sub_8078438 + bl sub_8077210 + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_080785E0: + ldr r0, =0x020228c4 + ldr r1, =0x0202467c + movs r2, 0xC8 + bl sub_8078438 + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_080785FC: + cmp r5, 0 + bne _08078606 + movs r0, 0x1 + bl sub_80771AC +_08078606: + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_08078610: + bl sub_8077200 + cmp r0, 0x3 + beq _0807861A + b _080787AA +_0807861A: + ldr r0, =0x020248d4 + movs r2, 0x1 + adds r1, r5, 0 + eors r1, r2 + lsls r1, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0xC8 + bl sub_8078438 + bl sub_8077210 + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_08078644: + ldr r0, =0x020228c4 + ldr r1, =0x03005d8c + ldr r1, [r1] + ldr r2, =0x00002be0 + adds r1, r2 + movs r2, 0xDC + bl sub_8078438 + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_0807866C: + cmp r5, 0 + bne _08078676 + movs r0, 0x3 + bl sub_80771AC +_08078676: + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_08078680: + bl sub_8077200 + cmp r0, 0x3 + beq _0807868A + b _080787AA +_0807868A: + ldr r0, =0x020321c0 + movs r2, 0x1 + adds r1, r5, 0 + eors r1, r2 + lsls r1, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0xD8 + bl sub_8078438 + bl sub_8077210 + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_080786B4: + ldr r0, =0x020228c4 + ldr r1, =0x03005d8c + ldr r1, [r1] + ldr r2, =0x000031a8 + adds r1, r2 + movs r2, 0xB + bl sub_8078438 + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_080786DC: + cmp r5, 0 + bne _080786E6 + movs r0, 0x4 + bl sub_80771AC +_080786E6: + ldr r0, =0x0203229c + ldr r1, [r0] + b _080787A2 + .pool +_080786F0: + bl sub_8077200 + cmp r0, 0x3 + bne _080787AA + ldr r4, =0x0203229c + ldr r0, [r4] + adds r0, 0xA9 + movs r2, 0x1 + adds r1, r5, 0 + eors r1, r2 + lsls r1, 8 + ldr r2, =0x020223c4 + adds r1, r2 + movs r2, 0xB + bl sub_8078438 + bl sub_8077210 + ldr r1, [r4] + b _080787A2 + .pool +_08078720: + ldr r4, =0x02024744 + ldr r6, =0x0000012f + movs r5, 0x5 +_08078726: + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _08078766 + cmp r0, r6 + bne _08078766 + adds r0, r4, 0 + movs r1, 0x3 + bl pokemon_getattr + cmp r0, 0x1 + beq _08078766 + adds r0, r4, 0 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + mov r0, sp + ldr r1, =gUnknown_0832DF94 + bl CompareStringWithoutExtendedControlCodes + cmp r0, 0 + bne _08078766 + adds r0, r4, 0 + movs r1, 0x2 + ldr r2, =gSpeciesNames + SPECIES_SHEDINJA * POKEMON_NAME_LENGTH + bl pokemon_setattr +_08078766: + adds r4, 0x64 + subs r5, 0x1 + cmp r5, 0 + bge _08078726 + movs r0, 0x1 + b _080787AC + .pool +_08078784: + ldr r2, =0x0203229c + ldr r1, [r2] + adds r1, 0xA8 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r2] + adds r1, r0, 0 + adds r1, 0xA8 + ldrb r0, [r1] + cmp r0, 0xA + bls _080787AA + movs r0, 0 + strb r0, [r1] + ldr r1, [r2] +_080787A2: + adds r1, 0x69 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080787AA: + movs r0, 0 +_080787AC: + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end shedinja_maker_maybe + + thumb_func_start sub_80787B8 +sub_80787B8: @ 80787B8 + push {lr} + ldr r0, =gUnknown_0832DAE5 + ldr r1, =0x0203229c + ldr r1, [r1] + adds r1, 0x72 + ldrh r1, [r1] + lsls r1, 5 + ldr r2, =0x06010000 + adds r1, r2 + movs r2, 0x18 + bl sub_807A308 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80787B8 + + thumb_func_start sub_80787E0 +sub_80787E0: @ 80787E0 + push {r4,lr} + lsls r1, 24 + lsrs r4, r1, 24 + movs r2, 0x1 + adds r0, r4, 0 + ands r0, r2 + cmp r0, 0 + beq _08078864 + ldr r0, =0x020223c4 + ldrh r1, [r0] + ldr r0, =0x0000bbbb + cmp r1, r0 + beq _08078844 + cmp r1, r0 + bgt _08078814 + ldr r0, =0x0000aabb + cmp r1, r0 + beq _08078834 + b _0807885E + .pool +_08078814: + ldr r0, =0x0000bbcc + cmp r1, r0 + beq _08078854 + ldr r0, =0x0000eeaa + cmp r1, r0 + bne _0807885E + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x78 + b _0807885A + .pool +_08078834: + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x78 + strb r2, [r0] + b _0807885E + .pool +_08078844: + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x7A + strb r2, [r0] + b _0807885E + .pool +_08078854: + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x7A +_0807885A: + movs r1, 0x2 + strb r1, [r0] +_0807885E: + movs r0, 0 + bl sub_8077234 +_08078864: + movs r2, 0x2 + adds r0, r4, 0 + ands r0, r2 + cmp r0, 0 + beq _080788F6 + ldr r3, =0x020223c4 + movs r1, 0x80 + lsls r1, 1 + adds r0, r3, r1 + ldrh r1, [r0] + ldr r0, =0x0000bbbb + cmp r1, r0 + beq _080788D8 + cmp r1, r0 + bgt _0807889C + ldr r0, =0x0000aabb + cmp r1, r0 + beq _080788BC + b _080788F0 + .pool +_0807889C: + ldr r0, =0x0000bbcc + cmp r1, r0 + beq _080788E8 + ldr r0, =0x0000eeaa + cmp r1, r0 + bne _080788F0 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x79 + b _080788EE + .pool +_080788BC: + ldr r2, =0x0203229c + ldr r1, [r2] + movs r4, 0x81 + lsls r4, 1 + adds r0, r3, r4 + ldrb r0, [r0] + adds r0, 0x6 + adds r1, 0x7E + strb r0, [r1] + ldr r0, [r2] + adds r0, 0x79 + b _080788DE + .pool +_080788D8: + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x7B +_080788DE: + movs r1, 0x1 + strb r1, [r0] + b _080788F0 + .pool +_080788E8: + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x7B +_080788EE: + strb r2, [r0] +_080788F0: + movs r0, 0x1 + bl sub_8077234 +_080788F6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80787E0 + + thumb_func_start sub_8078900 +sub_8078900: @ 8078900 + push {r4,r5,lr} + sub sp, 0x4 + lsls r1, 24 + lsrs r5, r1, 24 + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + beq _080789E2 + ldr r2, =0x020223c4 + ldrh r1, [r2] + ldr r0, =0x0000ddee + cmp r1, r0 + beq _080789CC + cmp r1, r0 + bgt _0807893C + ldr r0, =0x0000ccdd + cmp r1, r0 + beq _080789AC + ldr r0, =0x0000dddd + cmp r1, r0 + beq _08078978 + b _080789DC + .pool +_0807893C: + ldr r0, =0x0000eebb + cmp r1, r0 + beq _08078950 + adds r0, 0x11 + cmp r1, r0 + beq _08078974 + b _080789DC + .pool +_08078950: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + movs r0, 0x4 + bl sub_807A19C + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0xB + b _080789DA + .pool +_08078974: + movs r0, 0x5 + b _080789CE +_08078978: + ldr r4, =0x0203229c + ldr r1, [r4] + ldrb r0, [r2, 0x2] + adds r0, 0x6 + adds r1, 0x7E + strb r0, [r1] + movs r0, 0 + bl rbox_fill_rectangle + ldr r0, [r4] + adds r0, 0x35 + ldrb r0, [r0] + bl sub_807967C + ldr r0, [r4] + adds r0, 0x7E + ldrb r0, [r0] + bl sub_807967C + ldr r0, [r4] + adds r0, 0x6F + movs r1, 0x7 + b _080789DA + .pool +_080789AC: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0xA + b _080789DA + .pool +_080789CC: + movs r0, 0x1 +_080789CE: + bl sub_807A19C + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0x8 +_080789DA: + strb r1, [r0] +_080789DC: + movs r0, 0 + bl sub_8077234 +_080789E2: + movs r0, 0x2 + ands r0, r5 + cmp r0, 0 + beq _080789F0 + movs r0, 0x1 + bl sub_8077234 +_080789F0: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8078900 + + thumb_func_start sub_80789FC +sub_80789FC: @ 80789FC + push {r4-r6,lr} + sub sp, 0x4 + ldr r6, =0x0203229c + ldr r2, [r6] + adds r1, r2, 0 + adds r1, 0x78 + ldrb r0, [r1] + cmp r0, 0 + bne _08078A10 + b _08078B44 +_08078A10: + adds r0, r2, 0 + adds r0, 0x79 + ldrb r0, [r0] + cmp r0, 0 + bne _08078A1C + b _08078B44 +_08078A1C: + ldrh r1, [r1] + ldr r0, =0x00000101 + cmp r1, r0 + bne _08078A64 + adds r1, r2, 0 + adds r1, 0x6F + movs r0, 0x6 + strb r0, [r1] + ldr r2, [r6] + adds r1, r2, 0 + adds r1, 0x80 + movs r4, 0 + ldr r0, =0x0000dddd + strh r0, [r1] + adds r0, r2, 0 + adds r0, 0x35 + ldrb r1, [r0] + adds r0, 0x4D + strh r1, [r0] + movs r0, 0x5 + movs r1, 0 + bl sub_807A048 + ldr r0, [r6] + adds r2, r0, 0 + adds r2, 0x79 + strb r4, [r2] + adds r0, 0x78 + strb r4, [r0] + b _08078B44 + .pool +_08078A64: + ldr r0, =0x00000201 + cmp r1, r0 + bne _08078AB4 + movs r0, 0x1 + bl sub_807A19C + ldr r1, [r6] + adds r2, r1, 0 + adds r2, 0x80 + movs r4, 0 + movs r3, 0 + ldr r0, =0x0000eecc + strh r0, [r2] + adds r1, 0x82 + strh r3, [r1] + movs r0, 0x5 + movs r1, 0 + bl sub_807A048 + ldr r0, [r6] + adds r1, r0, 0 + adds r1, 0x7B + strb r4, [r1] + adds r0, 0x7A + strb r4, [r0] + ldr r0, [r6] + adds r1, r0, 0 + adds r1, 0x79 + strb r4, [r1] + adds r0, 0x78 + strb r4, [r0] + ldr r0, [r6] + adds r0, 0x6F + movs r1, 0x8 + b _08078B42 + .pool +_08078AB4: + movs r0, 0x81 + lsls r0, 1 + cmp r1, r0 + bne _08078B00 + movs r0, 0x5 + bl sub_807A19C + ldr r1, [r6] + adds r2, r1, 0 + adds r2, 0x80 + movs r4, 0 + movs r3, 0 + ldr r0, =0x0000ddee + strh r0, [r2] + adds r1, 0x82 + strh r3, [r1] + movs r0, 0x5 + movs r1, 0 + bl sub_807A048 + ldr r0, [r6] + adds r1, r0, 0 + adds r1, 0x7B + strb r4, [r1] + adds r0, 0x7A + strb r4, [r0] + ldr r0, [r6] + adds r1, r0, 0 + adds r1, 0x79 + strb r4, [r1] + adds r0, 0x78 + strb r4, [r0] + ldr r0, [r6] + adds r0, 0x6F + movs r1, 0x8 + b _08078B42 + .pool +_08078B00: + ldr r0, =0x00000202 + cmp r1, r0 + bne _08078B44 + adds r1, r2, 0 + adds r1, 0x80 + movs r5, 0 + movs r4, 0 + ldr r0, =0x0000eebb + strh r0, [r1] + adds r0, r2, 0 + adds r0, 0x82 + strh r4, [r0] + movs r0, 0x5 + movs r1, 0 + bl sub_807A048 + movs r0, 0x1 + negs r0, r0 + str r4, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, [r6] + adds r1, r0, 0 + adds r1, 0x79 + strb r5, [r1] + adds r0, 0x78 + strb r5, [r0] + ldr r0, [r6] + adds r0, 0x6F + movs r1, 0xB +_08078B42: + strb r1, [r0] +_08078B44: + ldr r5, =0x0203229c + ldr r3, [r5] + adds r1, r3, 0 + adds r1, 0x7A + ldrb r0, [r1] + cmp r0, 0 + beq _08078BDC + adds r0, r3, 0 + adds r0, 0x7B + ldrb r0, [r0] + cmp r0, 0 + beq _08078BDC + ldrh r1, [r1] + ldr r0, =0x00000101 + cmp r1, r0 + bne _08078B92 + adds r1, r3, 0 + adds r1, 0x80 + movs r4, 0 + movs r2, 0 + ldr r0, =0x0000ccdd + strh r0, [r1] + adds r0, r3, 0 + adds r0, 0x82 + strh r2, [r0] + movs r0, 0x5 + movs r1, 0 + bl sub_807A048 + ldr r0, [r5] + adds r0, 0x7A + strb r4, [r0] + ldr r0, [r5] + adds r0, 0x7B + strb r4, [r0] + ldr r0, [r5] + adds r0, 0x6F + movs r1, 0x9 + strb r1, [r0] +_08078B92: + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x7A + ldrb r0, [r0] + cmp r0, 0x2 + beq _08078BA8 + adds r0, r1, 0 + adds r0, 0x7B + ldrb r0, [r0] + cmp r0, 0x2 + bne _08078BDC +_08078BA8: + movs r0, 0x1 + bl sub_807A19C + ldr r1, [r5] + adds r2, r1, 0 + adds r2, 0x80 + movs r4, 0 + movs r3, 0 + ldr r0, =0x0000ddee + strh r0, [r2] + adds r1, 0x82 + strh r3, [r1] + movs r0, 0x5 + movs r1, 0 + bl sub_807A048 + ldr r0, [r5] + adds r0, 0x7A + strb r4, [r0] + ldr r0, [r5] + adds r0, 0x7B + strb r4, [r0] + ldr r0, [r5] + adds r0, 0x6F + movs r1, 0x8 + strb r1, [r0] +_08078BDC: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80789FC + + thumb_func_start sub_8078BFC +sub_8078BFC: @ 8078BFC + push {lr} + strh r1, [r0] + strh r2, [r0, 0x2] + movs r0, 0x5 + movs r1, 0 + bl sub_807A048 + pop {r0} + bx r0 + thumb_func_end sub_8078BFC + + thumb_func_start sub_8078C10 +sub_8078C10: @ 8078C10 + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + lsls r3, 16 + lsrs r3, 16 + lsls r2, 16 + lsrs r2, 16 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x80 + adds r1, r3, 0 + bl sub_8078BFC + pop {r0} + bx r0 + .pool + thumb_func_end sub_8078C10 + + thumb_func_start sub_8078C34 +sub_8078C34: @ 8078C34 + push {r4,lr} + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8077200 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08078C5C + cmp r4, 0 + bne _08078C56 + movs r0, 0 + bl sub_80787E0 + b _08078C5C +_08078C56: + adds r0, r4, 0 + bl sub_8078900 +_08078C5C: + cmp r4, 0 + bne _08078C64 + bl sub_80789FC +_08078C64: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8078C34 + + thumb_func_start sub_8078C6C +sub_8078C6C: @ 8078C6C + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + movs r6, 0 + movs r5, 0 + ldr r2, =0x0203229c + ldr r3, [r2] + ldr r4, =gUnknown_0832DCEC + lsls r2, r1, 1 + adds r2, r1 + lsls r2, 1 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r3, 0x38 + adds r2, r1 + adds r2, r4 +_08078C92: + ldrb r1, [r2] + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08078CA8 + adds r6, r1, 0 + b _08078CB0 + .pool +_08078CA8: + adds r2, 0x1 + adds r5, 0x1 + cmp r5, 0x5 + ble _08078C92 +_08078CB0: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8078C6C + + thumb_func_start sub_8078CB8 +sub_8078CB8: @ 8078CB8 + push {r4-r7,lr} + adds r7, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldrb r0, [r7] + bl sub_8078C6C + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0xC + bne _08078D10 + ldr r5, =0x0203229c + ldr r0, [r5] + adds r0, 0x34 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + movs r1, 0x1 + bl StartObjectImageAnim + ldr r2, [r5] + adds r2, 0x34 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xE0 + strh r1, [r0, 0x20] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xA0 + strh r1, [r0, 0x22] + b _08078D58 + .pool +_08078D10: + ldr r4, =0x0203229c + ldr r0, [r4] + adds r0, 0x34 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r5, =0x02020630 + adds r0, r5 + movs r1, 0 + bl StartObjectImageAnim + ldr r4, [r4] + adds r4, 0x34 + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldr r2, =gUnknown_0832DE24 + lsls r3, r6, 1 + adds r0, r3, r2 + ldrb r0, [r0] + lsls r0, 3 + adds r0, 0x20 + strh r0, [r1, 0x20] + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + adds r2, 0x1 + adds r3, r2 + ldrb r0, [r3] + lsls r0, 3 + strh r0, [r1, 0x22] +_08078D58: + ldrb r0, [r7] + cmp r0, r6 + beq _08078D64 + movs r0, 0x5 + bl audio_play +_08078D64: + strb r6, [r7] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8078CB8 + + thumb_func_start sub_8078D78 +sub_8078D78: @ 8078D78 + push {r4,lr} + movs r0, 0 + bl sub_807A19C + ldr r4, =0x0203229c + ldr r0, [r4] + adds r0, 0x6F + movs r1, 0x64 + strb r1, [r0] + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08078DAC + ldr r0, =0x0000aabb + ldr r1, [r4] + adds r1, 0x35 + ldrb r1, [r1] + bl sub_8078C10 + b _08078DB4 + .pool +_08078DAC: + ldr r0, [r4] + adds r0, 0x78 + movs r1, 0x1 + strb r1, [r0] +_08078DB4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8078D78 + + thumb_func_start sub_8078DBC +sub_8078DBC: @ 8078DBC + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x30] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08078DE4 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x35 + movs r1, 0 + bl sub_8078CB8 + b _08078E30 + .pool +_08078DE4: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08078E00 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x35 + movs r1, 0x1 + bl sub_8078CB8 + b _08078E30 + .pool +_08078E00: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08078E1C + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x35 + movs r1, 0x2 + bl sub_8078CB8 + b _08078E30 + .pool +_08078E1C: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08078E30 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x35 + movs r1, 0x3 + bl sub_8078CB8 +_08078E30: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08078EE4 + movs r0, 0x5 + bl audio_play + ldr r4, =0x0203229c + ldr r0, [r4] + adds r0, 0x35 + ldrb r0, [r0] + cmp r0, 0x5 + bhi _08078E98 + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0xE + bl sub_8098858 + movs r0, 0x1 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r2, =gUnknown_0832DEAC + movs r0, 0x1 + movs r1, 0x2 + bl PrintMenuTable + movs r0, 0x1 + movs r1, 0x2 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0x1 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, [r4] + adds r0, 0x6F + movs r1, 0x1 + strb r1, [r0] + b _08078EE4 + .pool +_08078E98: + cmp r0, 0xB + bhi _08078EB6 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, [r4] + adds r0, 0x6F + movs r1, 0x2 + strb r1, [r0] + b _08078EE4 +_08078EB6: + cmp r0, 0xC + bne _08078EE4 + ldr r0, =gUnknown_0832DF8C + movs r1, 0x1 + movs r2, 0xE + movs r3, 0 + bl CreateYesNoMenu + ldr r0, [r4] + adds r0, 0x6F + movs r1, 0x4 + strb r1, [r0] + ldr r0, =gUnknown_0832DE94 + ldr r0, [r0, 0x10] + ldr r1, [r4] + adds r1, 0x72 + ldrh r1, [r1] + lsls r1, 5 + ldr r2, =0x06010000 + adds r1, r2 + movs r2, 0x18 + bl sub_807A308 +_08078EE4: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8078DBC + + thumb_func_start sub_8078EF8 +sub_8078EF8: @ 8078EF8 + push {lr} + bl sub_8079F74 + ldr r3, =0x0203229c + ldr r0, [r3] + adds r0, 0x6F + movs r1, 0 + strb r1, [r0] + ldr r2, =0x02020630 + ldr r0, [r3] + adds r0, 0x34 + ldrb r1, [r0] + 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] + ldr r0, =gUnknown_0832DE94 + ldr r0, [r0, 0x4] + ldr r1, [r3] + adds r1, 0x72 + ldrh r1, [r1] + lsls r1, 5 + ldr r2, =0x06010000 + adds r1, r2 + movs r2, 0x18 + bl sub_807A308 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8078EF8 + + thumb_func_start sub_8078F50 +sub_8078F50: @ 8078F50 + push {lr} + sub sp, 0x4 + bl ProcessMenuInputNoWrapAround + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _08078F72 + cmp r0, r1 + ble _0807902A + cmp r0, 0 + beq _08078F7E + cmp r0, 0x1 + beq _08078F9C + b _0807902A +_08078F72: + movs r0, 0x5 + bl audio_play + bl sub_8078EF8 + b _0807902A +_08078F7E: + str r0, [sp] + adds r0, r1, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0x2 + b _08079028 + .pool +_08078F9C: + ldr r0, =0x020244ec + ldr r1, =0x020244e9 + ldrb r1, [r1] + ldr r2, =0x0203229c + ldr r2, [r2] + adds r2, 0x35 + ldrb r2, [r2] + bl sub_807A5F4 + cmp r0, 0x5 + bhi _0807902A + lsls r0, 2 + ldr r1, =_08078FCC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08078FCC: + .4byte _08078FE4 + .4byte _0807900C + .4byte _08079012 + .4byte _08079018 + .4byte _08079012 + .4byte _08079018 +_08078FE4: + bl sub_8078D78 + ldr r2, =0x02020630 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x34 + 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 + b _08079028 + .pool +_0807900C: + movs r0, 0x3 + movs r1, 0x3 + b _0807901C +_08079012: + movs r0, 0x3 + movs r1, 0x6 + b _0807901C +_08079018: + movs r0, 0x3 + movs r1, 0x7 +_0807901C: + bl sub_807A048 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0x8 +_08079028: + strb r1, [r0] +_0807902A: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8078F50 + + thumb_func_start sub_8079034 +sub_8079034: @ 8079034 + push {lr} + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0807904A + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08079054 +_0807904A: + movs r0, 0x5 + bl audio_play + bl sub_8078EF8 +_08079054: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079034 + + thumb_func_start sub_807905C +sub_807905C: @ 807905C + push {lr} + sub sp, 0x4 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080790C4 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r3, r0, 0 + adds r3, 0x35 + ldrb r2, [r3] + cmp r2, 0x5 + bhi _080790A4 + ldr r1, =0x020244ec + ldrb r2, [r3] + adds r0, 0x36 + ldrb r3, [r0] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =sub_8077B74 + str r0, [sp] + movs r0, 0x1 + bl sub_81BF8EC + b _080790C0 + .pool +_080790A4: + ldr r1, =0x02024744 + subs r2, 0x6 + lsls r2, 24 + lsrs r2, 24 + adds r0, 0x37 + ldrb r3, [r0] + subs r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =sub_8077B74 + str r0, [sp] + movs r0, 0x1 + bl sub_81BF8EC +_080790C0: + bl FreeAllWindowBuffers +_080790C4: + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_807905C + + thumb_func_start sub_80790D4 +sub_80790D4: @ 80790D4 + push {r4-r7,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r6, r3, 24 + movs r5, 0 + movs r3, 0 + ldr r7, =0x02024744 + cmp r5, r1 + bge _08079102 +_080790EE: + cmp r2, r3 + beq _080790FC + adds r0, r4, r3 + ldrb r0, [r0] + adds r0, r5, r0 + lsls r0, 24 + lsrs r5, r0, 24 +_080790FC: + adds r3, 0x1 + cmp r3, r1 + blt _080790EE +_08079102: + adds r0, r6, 0 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0x64 + muls r0, r6 + adds r7, r0, r7 + adds r0, r7, 0 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r4, r0, 16 + movs r0, 0xCD + lsls r0, 1 + cmp r4, r0 + beq _0807912C + cmp r4, 0x97 + bne _08079138 +_0807912C: + adds r0, r7, 0 + movs r1, 0x50 + bl pokemon_getattr + cmp r0, 0 + beq _08079158 +_08079138: + bl sub_809D42C + cmp r0, 0 + bne _08079164 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x57 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0 + bne _08079158 + adds r0, r4, 0 + bl sub_806E3F8 + cmp r0, 0 + bne _08079164 +_08079158: + movs r0, 0x2 + b _0807916C + .pool +_08079164: + cmp r5, 0 + beq _0807916A + movs r5, 0x1 +_0807916A: + adds r0, r5, 0 +_0807916C: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80790D4 + + thumb_func_start sub_8079174 +sub_8079174: @ 8079174 + push {r4,r5,lr} + sub sp, 0xC + movs r2, 0 + ldr r0, =0x0203229c + ldr r1, [r0] + adds r3, r1, 0 + adds r3, 0x36 + adds r5, r0, 0 + ldrb r0, [r3] + cmp r2, r0 + bge _080791A0 + adds r4, r1, 0 + adds r4, 0x45 +_0807918E: + mov r1, sp + adds r0, r1, r2 + adds r1, r4, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + ldrb r0, [r3] + cmp r2, r0 + blt _0807918E +_080791A0: + ldr r0, [r5] + adds r1, r0, 0 + adds r1, 0x36 + ldrb r1, [r1] + adds r2, r0, 0 + adds r2, 0x35 + ldrb r2, [r2] + adds r0, 0x7E + ldrb r3, [r0] + mov r0, sp + bl sub_80790D4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080791E8 + cmp r0, 0x1 + bgt _080791D0 + cmp r0, 0 + beq _080791D6 + b _0807920C + .pool +_080791D0: + cmp r0, 0x2 + beq _08079200 + b _0807920C +_080791D6: + movs r0, 0x3 + movs r1, 0x3 + bl sub_807A048 + ldr r0, =0x0000bbcc + b _080791F2 + .pool +_080791E8: + movs r0, 0x3 + movs r1, 0x1 + bl sub_807A048 + ldr r0, =0x0000bbbb +_080791F2: + movs r1, 0 + bl sub_8078C10 + b _0807920C + .pool +_08079200: + movs r0, 0x3 + movs r1, 0x8 + bl sub_807A048 + movs r0, 0x1 + b _0807920E +_0807920C: + movs r0, 0 +_0807920E: + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8079174 + + thumb_func_start sub_8079218 +sub_8079218: @ 8079218 + push {lr} + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _0807923A + cmp r1, 0 + bgt _08079234 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08079268 + b _08079290 +_08079234: + cmp r1, 0x1 + beq _08079268 + b _08079290 +_0807923A: + bl sub_8079174 + cmp r0, 0 + bne _08079250 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0x64 + b _08079258 + .pool +_08079250: + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0x11 +_08079258: + strb r1, [r0] + movs r0, 0x11 + bl PutWindowTilemap + b _08079290 + .pool +_08079268: + movs r0, 0x3 + movs r1, 0x1 + bl sub_807A048 + bl sub_80771BC + cmp r0, 0 + beq _08079280 + ldr r0, =0x0000bbcc + movs r1, 0 + bl sub_8078C10 +_08079280: + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0x64 + strb r1, [r0] + movs r0, 0x11 + bl PutWindowTilemap +_08079290: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079218 + + thumb_func_start sub_807929C +sub_807929C: @ 807929C + push {r4-r6,lr} + movs r5, 0 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x37 + ldrb r0, [r0] + subs r0, 0x4 + cmp r5, r0 + bge _080792D8 + movs r6, 0xC0 + lsls r6, 20 +_080792B2: + lsrs r4, r6, 24 + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x1 + bl CopyWindowToVram + movs r0, 0x80 + lsls r0, 17 + adds r6, r0 + adds r5, 0x1 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x37 + ldrb r0, [r0] + subs r0, 0x4 + cmp r5, r0 + blt _080792B2 +_080792D8: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807929C + + thumb_func_start sub_80792E4 +sub_80792E4: @ 80792E4 + push {lr} + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _08079306 + cmp r1, 0 + bgt _08079300 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0807934C + b _08079356 +_08079300: + cmp r1, 0x1 + beq _0807934C + b _08079356 +_08079306: + movs r0, 0x4 + bl sub_807A19C + ldr r0, =0x0000eeaa + movs r1, 0 + bl sub_8078C10 + ldr r2, =0x02020630 + ldr r3, =0x0203229c + ldr r0, [r3] + adds r0, 0x34 + 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] + ldr r0, [r3] + adds r0, 0x6F + movs r1, 0x64 + strb r1, [r0] + bl sub_807929C + b _08079356 + .pool +_0807934C: + movs r0, 0x5 + bl audio_play + bl sub_8078EF8 +_08079356: + pop {r0} + bx r0 + thumb_func_end sub_80792E4 + + thumb_func_start sub_807935C +sub_807935C: @ 807935C + push {r4,lr} + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _08079384 + movs r0, 0 + bl rbox_fill_rectangle + ldr r4, =0x0203229c + ldr r0, [r4] + adds r0, 0x35 + ldrb r0, [r0] + bl sub_807967C + ldr r0, [r4] + adds r0, 0x7E + ldrb r0, [r0] + bl sub_807967C +_08079384: + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0x7 + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807935C + + thumb_func_start sub_8079398 +sub_8079398: @ 8079398 + push {r4,lr} + ldr r4, =0x0203229c + ldr r0, [r4] + adds r0, 0x74 + ldrh r1, [r0] + ldr r0, =0x00000505 + cmp r1, r0 + bne _080793B4 + bl sub_80787B8 + ldr r0, [r4] + adds r0, 0x6F + movs r1, 0xE + strb r1, [r0] +_080793B4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079398 + + thumb_func_start sub_80793C4 +sub_80793C4: @ 80793C4 + push {r4,lr} + ldr r4, =0x0203229c + ldr r1, [r4] + adds r1, 0xA8 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0x78 + bls _080793F8 + ldr r0, =gUnknown_0832DF8C + movs r1, 0x1 + movs r2, 0xE + movs r3, 0 + bl CreateYesNoMenu + ldr r0, [r4] + adds r0, 0xA8 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x6F + movs r1, 0x3 + strb r1, [r0] +_080793F8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80793C4 + + thumb_func_start sub_8079408 +sub_8079408: @ 8079408 + push {r4-r6,lr} + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0807947C + movs r0, 0x5 + bl audio_play + movs r0, 0 + bl rbox_fill_rectangle + movs r0, 0x1 + bl rbox_fill_rectangle + movs r6, 0 + movs r5, 0xE0 + lsls r5, 20 +_0807942E: + lsrs r4, r5, 24 + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0 + bl rbox_fill_rectangle + movs r0, 0x80 + lsls r0, 17 + adds r5, r0 + adds r6, 0x1 + cmp r6, 0x3 + ble _0807942E + movs r0, 0 + bl sub_8079F88 + movs r0, 0x1 + bl sub_8079F88 + ldr r2, =0x0203229c + ldr r0, [r2] + adds r0, 0x6F + movs r1, 0 + strb r1, [r0] + ldr r3, =0x02020630 + ldr r0, [r2] + adds r0, 0x34 + ldrb r1, [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] +_0807947C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079408 + + thumb_func_start sub_8079490 +sub_8079490: @ 8079490 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080794C4 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _080794B4 + bl sub_800ADF8 + b _080794BA + .pool +_080794B4: + movs r0, 0xC + bl sub_800ABF4 +_080794BA: + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0xC + strb r1, [r0] +_080794C4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079490 + + thumb_func_start sub_80794CC +sub_80794CC: @ 80794CC + push {lr} + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _08079518 + bl sub_80771BC + cmp r0, 0 + beq _0807953A + bl sub_807A09C + cmp r0, 0 + bne _0807953A + ldr r0, =0x02032184 + ldr r0, [r0] + bl Free + ldr r0, =0x0203229c + ldr r0, [r0] + bl Free + bl FreeAllWindowBuffers + bl sub_800E084 + ldr r0, =c2_8056854 + bl SetMainCallback2 + b _0807953A + .pool +_08079518: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0807953A + ldr r0, =0x02032184 + ldr r0, [r0] + bl Free + ldr r0, =0x0203229c + ldr r0, [r0] + bl Free + bl FreeAllWindowBuffers + ldr r0, =c2_8056854 + bl SetMainCallback2 +_0807953A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80794CC + + thumb_func_start sub_8079550 +sub_8079550: @ 8079550 + push {lr} + movs r0, 0 + bl sub_801048C + lsls r0, 24 + cmp r0, 0 + bne _08079574 + bl sub_807A09C + cmp r0, 0 + bne _08079574 + bl sub_800ADF8 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0xD + strb r1, [r0] +_08079574: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079550 + + thumb_func_start sub_807957C +sub_807957C: @ 807957C + push {lr} + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0807959C + ldr r0, =0x0000bbcc + movs r1, 0 + bl sub_8078C10 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + movs r1, 0x64 + strb r1, [r0] +_0807959C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_807957C + + thumb_func_start sub_80795AC +sub_80795AC: @ 80795AC + push {lr} + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x6F + ldrb r0, [r0] + cmp r0, 0x11 + bhi _08079678 + lsls r0, 2 + ldr r1, =_080795CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080795CC: + .4byte _08079614 + .4byte _0807961A + .4byte _08079620 + .4byte _08079626 + .4byte _0807962C + .4byte _08079678 + .4byte _08079632 + .4byte _08079638 + .4byte _0807963E + .4byte _08079644 + .4byte _0807964A + .4byte _08079650 + .4byte _08079656 + .4byte _0807965C + .4byte _08079662 + .4byte _08079668 + .4byte _0807966E + .4byte _08079674 +_08079614: + bl sub_8078DBC + b _08079678 +_0807961A: + bl sub_8078F50 + b _08079678 +_08079620: + bl sub_807905C + b _08079678 +_08079626: + bl sub_8079218 + b _08079678 +_0807962C: + bl sub_80792E4 + b _08079678 +_08079632: + bl sub_807935C + b _08079678 +_08079638: + bl sub_8079398 + b _08079678 +_0807963E: + bl sub_8079408 + b _08079678 +_08079644: + bl sub_8078130 + b _08079678 +_0807964A: + bl sub_807816C + b _08079678 +_08079650: + bl sub_8079490 + b _08079678 +_08079656: + bl sub_80794CC + b _08079678 +_0807965C: + bl sub_80781C8 + b _08079678 +_08079662: + bl sub_80793C4 + b _08079678 +_08079668: + bl sub_8079034 + b _08079678 +_0807966E: + bl sub_8079550 + b _08079678 +_08079674: + bl sub_807957C +_08079678: + pop {r0} + bx r0 + thumb_func_end sub_80795AC + + thumb_func_start sub_807967C +sub_807967C: @ 807967C + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + movs r1, 0x6 + bl __udivsi3 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r3, =0x0203229c + ldr r0, [r3] + adds r0, 0x74 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + bne _080796A8 + movs r0, 0x1 + strb r0, [r1] + ldr r0, [r3] + adds r0, 0x76 + adds r0, r2 + strb r4, [r0] +_080796A8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807967C + + thumb_func_start sub_80796B4 +sub_80796B4: @ 80796B4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x68 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x0203229c + ldr r4, [r0] + adds r0, r4, 0 + adds r0, 0x76 + adds r0, r7 + ldrb r0, [r0] + movs r1, 0x1 + str r1, [sp, 0x60] + cmp r0, 0x5 + bhi _080796DC + movs r2, 0 + str r2, [sp, 0x60] +_080796DC: + movs r1, 0x6 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + movs r0, 0 + mov r8, r0 + adds r0, r4, 0 + adds r0, 0x74 + adds r3, r0, r7 + ldrb r0, [r3] + cmp r0, 0x2 + bne _080796FA + b _08079884 +_080796FA: + cmp r0, 0x2 + bgt _08079708 + cmp r0, 0x1 + beq _08079716 + b _08079A24 + .pool +_08079708: + cmp r0, 0x3 + bne _0807970E + b _080798BC +_0807970E: + cmp r0, 0x4 + bne _08079714 + b _080799EC +_08079714: + b _08079A24 +_08079716: + movs r5, 0 + adds r0, r4, 0 + adds r0, 0x36 + adds r0, r7 + ldr r1, [sp, 0x60] + lsls r1, 1 + mov r9, r1 + lsls r6, r7, 1 + lsls r2, r7, 4 + str r2, [sp, 0x64] + ldrb r0, [r0] + cmp r8, r0 + bcs _0807976A + ldr r0, =0x02020630 + mov r8, r0 + ldr r4, =0x0203229c + ldr r0, [sp, 0x60] + add r0, r9 + lsls r2, r0, 1 + movs r3, 0x4 +_0807973E: + ldr r0, [r4] + adds r1, r5, r2 + adds r0, 0x28 + adds r0, r1 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x3E + ldrb r1, [r0] + orrs r1, r3 + strb r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, [r4] + adds r0, 0x36 + adds r0, r7 + ldrb r0, [r0] + cmp r5, r0 + bcc _0807973E +_0807976A: + movs r5, 0 + adds r0, r6, r7 + lsls r0, 1 + adds r4, r0, 0x2 +_08079772: + lsls r0, r5, 24 + asrs r0, 24 + adds r0, r4 + lsls r0, 24 + lsrs r0, 24 + bl ClearWindowTilemap + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _08079772 + ldr r1, =0x02020630 + mov r8, r1 + ldr r2, =0x0203229c + ldr r0, [r2] + ldr r6, [sp, 0x60] + add r6, r9 + lsls r3, r6, 1 + add r10, r3 + adds r0, 0x28 + add r0, r10 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] + ldr r0, =0x0203229c + ldr r4, [r0] + adds r4, 0x28 + add r4, r10 + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + movs r1, 0x14 + strh r1, [r0, 0x2E] + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + add r2, r8 + ldr r5, =gUnknown_0832DE24 + lsls r6, 2 + adds r0, r6, r5 + ldrb r0, [r0] + adds r3, 0x1 + lsls r3, 1 + adds r3, r5 + ldrb r1, [r3] + adds r0, r1 + asrs r0, 1 + lsls r0, 3 + adds r0, 0xE + strh r0, [r2, 0x32] + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r8 + adds r5, 0x1 + adds r6, r5 + ldrb r0, [r6] + lsls r0, 3 + subs r0, 0xC + strh r0, [r1, 0x36] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldr r1, =sub_80D3014 + bl oamt_set_x3A_32 + ldr r2, =0x0203229c + ldr r1, [r2] + adds r1, 0x74 + adds r1, r7 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r2] + adds r0, 0x28 + add r0, r10 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + add r0, r8 + bl sub_80A6DEC + ldr r1, =gUnknown_0832C8BE + ldr r0, [sp, 0x64] + subs r2, r0, r7 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0xF + str r0, [sp] + movs r0, 0x11 + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r3, 0 + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r1, [sp, 0x60] + cmp r1, 0 + beq _08079868 + b _08079A24 +_08079868: + bl sub_8079F74 + b _08079A24 + .pool +_08079884: + ldr r2, =0x02020630 + ldr r1, [sp, 0x60] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + add r0, r10 + adds r1, r4, 0 + adds r1, 0x28 + adds r1, r0 + ldrb r1, [r1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =sub_80D3014 + cmp r1, r0 + beq _080798AC + b _08079A24 +_080798AC: + movs r0, 0x3 + strb r0, [r3] + b _08079A24 + .pool +_080798BC: + ldr r1, =gUnknown_0832C6C0 + ldr r0, [sp, 0x60] + lsls r2, r0, 4 + subs r2, r0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0xF + str r0, [sp] + movs r0, 0x11 + str r0, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r3, 0 + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + ldr r6, =0x02020630 + ldr r1, =0x0203229c + ldr r4, [r1] + ldr r2, [sp, 0x60] + lsls r3, r2, 1 + adds r3, r2 + lsls r1, r3, 1 + mov r2, r10 + adds r0, r2, r1 + adds r4, 0x28 + adds r4, r0 + ldrb r0, [r4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r6 + ldr r5, =gUnknown_0832DE24 + lsls r3, 2 + adds r0, r3, r5 + ldrb r0, [r0] + adds r1, 0x1 + lsls r1, 1 + adds r1, r5 + ldrb r1, [r1] + adds r0, r1 + asrs r0, 1 + lsls r0, 3 + adds r0, 0xE + strh r0, [r2, 0x20] + ldrb r0, [r4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + adds r5, 0x1 + adds r3, r5 + ldrb r0, [r3] + lsls r0, 3 + subs r0, 0xC + strh r0, [r1, 0x22] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r1, r8 + strh r1, [r0, 0x24] + ldrb r1, [r4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r2, r8 + strh r2, [r0, 0x26] + add r0, sp, 0x14 + ldr r1, [sp, 0x60] + mov r2, r10 + bl sub_8079A3C + lsls r4, r7, 1 + adds r5, r4, 0 + adds r5, 0xE + lsls r5, 24 + lsrs r5, 24 + lsls r0, 24 + asrs r0, 24 + movs r2, 0x50 + subs r2, r0 + lsrs r0, r2, 31 + adds r2, r0 + asrs r2, 1 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_0832DEE0 + mov r8, r0 + str r0, [sp] + movs r1, 0 + str r1, [sp, 0x4] + add r0, sp, 0x14 + str r0, [sp, 0x8] + adds r0, r5, 0 + movs r3, 0x4 + bl box_print + add r6, sp, 0x28 + adds r0, r6, 0 + ldr r1, [sp, 0x60] + mov r2, r10 + bl sub_8079AA4 + adds r4, 0xF + lsls r4, 24 + lsrs r4, 24 + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + mov r2, r8 + str r2, [sp, 0x8] + str r1, [sp, 0xC] + str r6, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + movs r3, 0 + bl AddTextPrinterParametrized2 + adds r0, r5, 0 + bl PutWindowTilemap + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =0x0203229c + ldr r1, [r0] + b _08079A1A + .pool +_080799EC: + ldr r0, =gUnknown_0832DF99 + lsls r1, r7, 1 + adds r4, r1, r0 + ldrb r2, [r4] + adds r2, 0x4 + lsls r2, 24 + lsrs r2, 24 + adds r0, 0x1 + adds r1, r0 + ldrb r3, [r1] + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldrb r0, [r4] + str r0, [sp] + ldrb r0, [r1] + str r0, [sp, 0x4] + adds r0, r7, 0 + mov r1, r10 + bl sub_8079C4C + ldr r2, =0x0203229c + ldr r1, [r2] +_08079A1A: + adds r1, 0x74 + adds r1, r7 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_08079A24: + add sp, 0x68 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80796B4 + + thumb_func_start sub_8079A3C +sub_8079A3C: @ 8079A3C + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r1, 24 + lsls r2, 24 + lsrs r2, 24 + cmp r1, 0 + bne _08079A64 + movs r0, 0x64 + muls r0, r2 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + b _08079A74 + .pool +_08079A64: + movs r0, 0x64 + muls r0, r2 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr +_08079A74: + adds r0, r4, 0 + mov r1, sp + bl CopyString_Limit10 + movs r0, 0 + movs r1, 0x2 + bl GetFontAttribute + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0 + adds r1, r4, 0 + bl GetStringWidth + lsls r0, 24 + lsrs r0, 24 + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_8079A3C + + thumb_func_start sub_8079AA4 +sub_8079AA4: @ 8079AA4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + adds r6, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =0x0203229c + ldr r1, [r0] + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 1 + adds r0, r2, r0 + adds r1, 0x51 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + bne _08079B5C + movs r4, 0 + movs r0, 0x64 + adds r5, r2, 0 + muls r5, r0 + ldr r0, =0x020244ec + mov r9, r0 + ldr r2, =0x02024744 + mov r8, r2 +_08079ADE: + cmp r7, 0 + bne _08079AF8 + adds r1, r4, 0 + adds r1, 0xD + mov r2, r9 + b _08079AFE + .pool +_08079AF8: + adds r1, r4, 0 + adds r1, 0xD + mov r2, r8 +_08079AFE: + adds r0, r5, r2 + movs r2, 0 + bl pokemon_getattr + lsls r1, r4, 1 + add r1, sp + strh r0, [r1] + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _08079ADE + ldr r1, =gUnknown_0832DABC + adds r0, r6, 0 + bl CopyString + movs r4, 0 +_08079B20: + lsls r0, r4, 1 + mov r2, sp + adds r1, r2, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _08079B3C + adds r1, r0, 0 + movs r0, 0xD + muls r1, r0 + ldr r0, =gMoveNames + adds r1, r0 + adds r0, r6, 0 + bl AppendString +_08079B3C: + adds r0, r6, 0 + ldr r1, =gUnknown_0832DAD2 + bl AppendString + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _08079B20 + b _08079B6C + .pool +_08079B5C: + ldr r1, =gUnknown_0832DABC + adds r0, r6, 0 + bl CopyString + ldr r1, =gUnknown_0832DADF + adds r0, r6, 0 + bl AppendString +_08079B6C: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079AA4 + + thumb_func_start sub_8079B84 +sub_8079B84: @ 8079B84 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 1 + adds r1, 0x2 + lsls r4, 24 + asrs r4, 24 + adds r4, r1 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + adds r1, r5, 0 + movs r2, 0x40 + bl GetStringCenterAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_0832DEE0 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r5, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0 + movs r3, 0x4 + bl box_print + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079B84 + + thumb_func_start sub_8079BE0 +sub_8079BE0: @ 8079BE0 + push {r4-r7,lr} + sub sp, 0x34 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, =0x02024744 + cmp r6, 0 + bne _08079BF0 + ldr r7, =0x020244ec +_08079BF0: + movs r4, 0 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x36 + adds r0, r6 + ldrb r0, [r0] + cmp r4, r0 + bcs _08079C36 + add r5, sp, 0x14 +_08079C02: + movs r0, 0x64 + muls r0, r4 + adds r0, r7, r0 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + adds r0, r5, 0 + mov r1, sp + bl CopyString_Limit10 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_8079B84 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x36 + adds r0, r6 + ldrb r0, [r0] + cmp r4, r0 + bcc _08079C02 +_08079C36: + add sp, 0x34 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079BE0 + + thumb_func_start sub_8079C4C +sub_8079C4C: @ 8079C4C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + ldr r4, [sp, 0x3C] + ldr r5, [sp, 0x40] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + mov r10, r3 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r1, =gUnknown_08DDD704 + movs r0, 0x6 + str r0, [sp] + movs r0, 0x3 + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r0, 0x1 + adds r2, r4, 0 + adds r3, r5, 0 + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + mov r0, r8 + cmp r0, 0 + bne _08079CB0 + movs r0, 0x64 + muls r0, r7 + ldr r1, =0x020244ec + b _08079CB6 + .pool +_08079CB0: + movs r0, 0x64 + muls r0, r7 + ldr r1, =0x02024744 +_08079CB6: + adds r0, r1 + movs r1, 0x38 + movs r2, 0 + bl pokemon_getattr + lsls r0, 24 + lsrs r6, r0, 24 + ldr r4, =0x0203229c + ldr r5, [r4] + mov r1, r8 + lsls r2, r1, 1 + adds r1, r2, r1 + lsls r1, 1 + adds r1, r7, r1 + adds r0, r5, 0 + adds r0, 0x51 + adds r0, r1 + ldrb r0, [r0] + str r2, [sp, 0x18] + cmp r0, 0 + bne _08079D34 + adds r0, r6, 0 + movs r1, 0xA + bl __udivsi3 + lsls r0, 24 + lsrs r2, r0, 24 + mov r0, r10 + lsls r3, r0, 5 + cmp r2, 0 + beq _08079D08 + mov r1, r9 + adds r0, r1, r3 + lsls r0, 1 + movs r1, 0x8F + lsls r1, 4 + adds r5, r1 + adds r1, r5, r0 + adds r0, r2, 0 + adds r0, 0x60 + strh r0, [r1] +_08079D08: + ldr r4, [r4] + mov r1, r9 + adds r0, r1, r3 + adds r0, 0x1 + lsls r0, 1 + movs r3, 0x8F + lsls r3, 4 + adds r4, r3 + adds r4, r0 + adds r0, r6, 0 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x70 + strh r0, [r4] + b _08079D72 + .pool +_08079D34: + mov r1, r10 + lsls r0, r1, 5 + mov r1, r9 + adds r3, r1, r0 + adds r1, r3, 0 + subs r1, 0x20 + lsls r1, 1 + movs r0, 0x8F + lsls r0, 4 + adds r2, r5, r0 + adds r1, r2, r1 + adds r0, r3, 0 + subs r0, 0x21 + lsls r0, 1 + adds r0, r2, r0 + ldrh r0, [r0] + strh r0, [r1] + adds r1, r3, 0 + subs r1, 0x1F + lsls r1, 1 + adds r1, r2, r1 + adds r0, r3, 0 + subs r0, 0x24 + lsls r0, 1 + adds r2, r0 + ldrh r2, [r2] + movs r3, 0x80 + lsls r3, 3 + adds r0, r3, 0 + orrs r0, r2 + strh r0, [r1] +_08079D72: + ldr r0, =0x0203229c + ldr r1, [r0] + ldr r0, [sp, 0x18] + add r0, r8 + lsls r0, 1 + adds r0, r7, r0 + adds r1, 0x51 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _08079D94 + movs r2, 0x90 + lsls r2, 3 + b _08079E16 + .pool +_08079D94: + mov r0, r8 + cmp r0, 0 + bne _08079DC0 + movs r0, 0x64 + adds r4, r7, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + bl pokemon_get_gender + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + movs r1, 0x2 + add r2, sp, 0xC + bl pokemon_getattr + b _08079DDE + .pool +_08079DC0: + movs r0, 0x64 + adds r4, r7, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + bl pokemon_get_gender + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + movs r1, 0x2 + add r2, sp, 0xC + bl pokemon_getattr +_08079DDE: + cmp r5, 0 + beq _08079DF0 + cmp r5, 0xFE + beq _08079E04 + movs r2, 0x83 + b _08079E16 + .pool +_08079DF0: + add r0, sp, 0xC + movs r1, 0 + bl sub_8070ECC + lsls r0, 24 + movs r2, 0x83 + cmp r0, 0 + bne _08079E16 + movs r2, 0x84 + b _08079E16 +_08079E04: + add r0, sp, 0xC + movs r1, 0xFE + bl sub_8070ECC + lsls r0, 24 + movs r2, 0x83 + cmp r0, 0 + bne _08079E16 + movs r2, 0x85 +_08079E16: + ldr r0, =0x0203229c + ldr r1, [r0] + mov r0, r10 + subs r0, 0x1 + lsls r0, 5 + add r0, r9 + adds r0, 0x1 + lsls r0, 1 + movs r3, 0x8F + lsls r3, 4 + adds r1, r3 + adds r1, r0 + strh r2, [r1] + 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_8079C4C + + thumb_func_start sub_8079E44 +sub_8079E44: @ 8079E44 + push {r4-r7,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r6, r0, 24 + movs r7, 0 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x36 + adds r0, r6 + ldrb r0, [r0] + cmp r7, r0 + bge _08079E94 + lsls r0, r6, 1 + adds r0, r6 + ldr r1, =gUnknown_0832DE3E + lsls r0, 2 + adds r5, r0, r1 + ldr r1, =gUnknown_0832DE56 + adds r4, r0, r1 +_08079E6A: + lsls r1, r7, 24 + lsrs r1, 24 + ldrb r2, [r5] + ldrb r3, [r5, 0x1] + ldrb r0, [r4] + str r0, [sp] + ldrb r0, [r4, 0x1] + str r0, [sp, 0x4] + adds r0, r6, 0 + bl sub_8079C4C + adds r5, 0x2 + adds r4, 0x2 + adds r7, 0x1 + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x36 + adds r0, r6 + ldrb r0, [r0] + cmp r7, r0 + blt _08079E6A +_08079E94: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079E44 + + thumb_func_start sub_8079EA8 +sub_8079EA8: @ 8079EA8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + movs r7, 0 + ldr r3, =0x0203229c + ldr r0, [r3] + adds r0, 0x36 + add r0, r12 + ldrb r0, [r0] + cmp r7, r0 + bge _08079F5A + ldr r6, =0x02020630 + mov r9, r3 + mov r1, r12 + lsls r0, r1, 1 + add r0, r12 + lsls r2, r0, 1 + mov r10, r2 + ldr r1, =gUnknown_0832DE24 + movs r2, 0 + mov r8, r2 + lsls r0, 2 + adds r5, r0, r1 +_08079EE0: + mov r1, r9 + ldr r0, [r1] + mov r2, r10 + adds r4, r7, r2 + adds r0, 0x28 + adds r0, r4 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + adds r1, 0x3E + ldrb r2, [r1] + movs r0, 0x5 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + mov r0, r9 + ldr r3, [r0] + adds r2, r3, 0 + adds r2, 0x28 + adds r2, r4 + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r5] + lsls r0, 3 + adds r0, 0xE + strh r0, [r1, 0x20] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + ldrb r0, [r5, 0x1] + lsls r0, 3 + subs r0, 0xC + strh r0, [r1, 0x22] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r1, r8 + strh r1, [r0, 0x24] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + mov r2, r8 + strh r2, [r0, 0x26] + adds r5, 0x2 + adds r7, 0x1 + adds r3, 0x36 + add r3, r12 + ldrb r3, [r3] + cmp r7, r3 + blt _08079EE0 +_08079F5A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079EA8 + + thumb_func_start sub_8079F74 +sub_8079F74: @ 8079F74 + push {lr} + movs r0, 0x1 + bl rbox_fill_rectangle + movs r0, 0x1 + bl sub_8079BE0 + pop {r0} + bx r0 + thumb_func_end sub_8079F74 + + thumb_func_start sub_8079F88 +sub_8079F88: @ 8079F88 + push {r4-r6,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, =gUnknown_0832C8BE + lsls r2, r4, 4 + subs r2, r4 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0xF + str r0, [sp] + movs r0, 0x11 + str r0, [sp, 0x4] + movs r6, 0 + str r6, [sp, 0x8] + movs r0, 0x1 + movs r3, 0 + bl CopyToBgTilemapBufferRect_ChangePalette + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + adds r0, r4, 0 + bl sub_8079E44 + adds r0, r4, 0 + bl sub_8079BE0 + adds r0, r4, 0 + bl sub_8079EA8 + ldr r0, =gUnknown_0832DE94 + ldr r0, [r0, 0x4] + ldr r5, =0x0203229c + ldr r1, [r5] + adds r1, 0x72 + ldrh r1, [r1] + lsls r1, 5 + ldr r2, =0x06010000 + adds r1, r2 + movs r2, 0x18 + bl sub_807A308 + ldr r0, [r5] + adds r0, 0x74 + adds r0, r4 + strb r6, [r0] + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8079F88 + + thumb_func_start sub_807A000 +sub_807A000: @ 807A000 + push {lr} + sub sp, 0x8 + movs r0, 0x1E + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_807A000 + + thumb_func_start sub_807A024 +sub_807A024: @ 807A024 + push {lr} + sub sp, 0x8 + movs r0, 0x1E + str r0, [sp] + movs r0, 0x14 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_807A024 + + thumb_func_start sub_807A048 +sub_807A048: @ 807A048 + push {r4-r7,lr} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 24 + lsrs r6, r1, 24 + movs r3, 0 + ldr r4, =0x0203229c + mov r12, r4 + movs r7, 0x8D + lsls r7, 4 +_0807A05C: + mov r1, r12 + ldr r0, [r1] + lsls r1, r3, 3 + adds r2, r0, r1 + adds r0, r2, r7 + ldrb r0, [r0] + cmp r0, 0 + bne _0807A090 + ldr r3, =0x000008d2 + adds r0, r2, r3 + strh r5, [r0] + adds r3, 0x2 + adds r0, r2, r3 + strb r6, [r0] + ldr r0, [r4] + adds r0, r1 + movs r1, 0x8D + lsls r1, 4 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + b _0807A096 + .pool +_0807A090: + adds r3, 0x1 + cmp r3, 0x3 + ble _0807A05C +_0807A096: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_807A048 + + thumb_func_start sub_807A09C +sub_807A09C: @ 807A09C + push {lr} + movs r3, 0 + ldr r0, =0x0203229c + ldr r0, [r0] + movs r2, 0x8D + lsls r2, 4 + adds r1, r0, r2 + movs r2, 0x3 +_0807A0AC: + ldrb r0, [r1] + adds r3, r0 + adds r1, 0x8 + subs r2, 0x1 + cmp r2, 0 + bge _0807A0AC + adds r0, r3, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_807A09C + + thumb_func_start sub_807A0C4 +sub_807A0C4: @ 807A0C4 + push {r4,r5,lr} + movs r4, 0 + ldr r3, =0x0203229c +_0807A0CA: + ldr r0, [r3] + lsls r1, r4, 3 + adds r2, r0, r1 + movs r5, 0x8D + lsls r5, 4 + adds r0, r2, r5 + ldrb r0, [r0] + adds r5, r1, 0 + cmp r0, 0 + beq _0807A18C + ldr r0, =0x000008d2 + adds r1, r2, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _0807A0F8 + subs r0, 0x1 + strh r0, [r1] + b _0807A18C + .pool +_0807A0F8: + ldr r1, =0x000008d4 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x8 + bhi _0807A17A + lsls r0, 2 + ldr r1, =_0807A114 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807A114: + .4byte _0807A138 + .4byte _0807A14C + .4byte _0807A154 + .4byte _0807A15C + .4byte _0807A15C + .4byte _0807A15C + .4byte _0807A164 + .4byte _0807A16C + .4byte _0807A174 +_0807A138: + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0x80 + movs r1, 0x14 + bl sub_8077170 + b _0807A17A + .pool +_0807A14C: + movs r0, 0 + bl sub_807A19C + b _0807A17A +_0807A154: + movs r0, 0x2 + bl sub_807A19C + b _0807A17A +_0807A15C: + movs r0, 0x3 + bl sub_807A19C + b _0807A17A +_0807A164: + movs r0, 0x6 + bl sub_807A19C + b _0807A17A +_0807A16C: + movs r0, 0x7 + bl sub_807A19C + b _0807A17A +_0807A174: + movs r0, 0x8 + bl sub_807A19C +_0807A17A: + ldr r0, =0x0203229c + ldr r1, [r0] + adds r1, r5 + movs r2, 0x8D + lsls r2, 4 + adds r1, r2 + movs r2, 0 + strb r2, [r1] + adds r3, r0, 0 +_0807A18C: + adds r4, 0x1 + cmp r4, 0x3 + ble _0807A0CA + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807A0C4 + + thumb_func_start sub_807A19C +sub_807A19C: @ 807A19C + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + movs r1, 0x11 + bl FillWindowPixelBuffer + ldr r0, =gUnknown_0832DEBC + lsls r4, 2 + adds r4, r0 + ldr r2, [r4] + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + movs r1, 0x14 + movs r2, 0xC + bl sub_8098858 + movs r0, 0 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807A19C + + thumb_func_start sub_807A1F0 +sub_807A1F0: @ 807A1F0 + push {r4,lr} + sub sp, 0x8 + ldr r0, =0x0203229c + ldr r1, [r0] + adds r3, r1, 0 + adds r3, 0xA8 + ldrb r1, [r3] + adds r4, r0, 0 + cmp r1, 0xD + bhi _0807A22C + ldr r1, =0x02032188 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [sp] + ldr r0, =0xffff0000 + ldr r2, [sp, 0x4] + ands r2, r0 + movs r0, 0x80 + lsls r0, 1 + orrs r2, r0 + str r2, [sp, 0x4] + ldrb r1, [r3] + adds r1, 0xC8 + lsls r1, 16 + ldr r0, =0x0000ffff + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x4] +_0807A22C: + ldr r0, [r4] + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0x11 + bhi _0807A2FC + lsls r0, 2 + ldr r1, =_0807A254 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807A254: + .4byte _0807A29C + .4byte _0807A29C + .4byte _0807A29C + .4byte _0807A29C + .4byte _0807A29C + .4byte _0807A29C + .4byte _0807A29C + .4byte _0807A29C + .4byte _0807A2A0 + .4byte _0807A2B8 + .4byte _0807A2B8 + .4byte _0807A2B8 + .4byte _0807A2B8 + .4byte _0807A2B8 + .4byte _0807A2BC + .4byte _0807A2C8 + .4byte _0807A2D4 + .4byte _0807A2F0 +_0807A29C: + mov r0, sp + b _0807A2D6 +_0807A2A0: + mov r0, sp + bl LoadObjectPic + ldr r1, =0x0203229c + ldr r1, [r1] + adds r2, r1, 0 + adds r2, 0x72 + strh r0, [r2] + b _0807A2DE + .pool +_0807A2B8: + mov r0, sp + b _0807A2D6 +_0807A2BC: + ldr r0, =gUnknown_0832DCE4 + bl LoadTaggedObjectPalette + b _0807A2DA + .pool +_0807A2C8: + ldr r0, =gUnknown_0832DC44 + bl LoadTaggedObjectPalette + b _0807A2DA + .pool +_0807A2D4: + ldr r0, =gUnknown_0832DC3C +_0807A2D6: + bl LoadObjectPic +_0807A2DA: + ldr r0, =0x0203229c + ldr r1, [r0] +_0807A2DE: + adds r1, 0xA8 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0807A2FC + .pool +_0807A2F0: + ldr r0, [r4] + adds r0, 0xA8 + movs r1, 0 + strb r1, [r0] + movs r0, 0x1 + b _0807A2FE +_0807A2FC: + movs r0, 0 +_0807A2FE: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_807A1F0 + + thumb_func_start sub_807A308 +sub_807A308: @ 807A308 + push {lr} + sub sp, 0x4 + movs r2, 0x6 + str r2, [sp] + movs r2, 0 + movs r3, 0 + bl sub_80C6D80 + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_807A308 + + thumb_func_start sub_807A320 +sub_807A320: @ 807A320 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0 + beq _0807A338 + cmp r0, 0x1 + beq _0807A3CC + b _0807A458 +_0807A338: + movs r7, 0 + ldr r1, =0x0203229c + ldr r0, [r1] + adds r0, 0x36 + ldrb r0, [r0] + cmp r7, r0 + blt _0807A348 + b _0807A458 +_0807A348: + adds r6, r1, 0 + movs r5, 0 + mov r9, r5 +_0807A34E: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + adds r1, r0, 0 + cmp r1, 0x1 + bne _0807A380 + ldr r0, [r6] + adds r0, 0x45 + adds r0, r5 + mov r2, r9 + strb r2, [r0] + ldr r0, [r6] + adds r0, 0x51 + adds r0, r5 + b _0807A3B0 + .pool +_0807A380: + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + adds r1, r0, 0 + cmp r1, 0 + bne _0807A39E + ldr r0, [r6] + adds r0, 0x45 + adds r0, r5 + strb r1, [r0] + ldr r0, [r6] + adds r0, 0x51 + adds r0, r5 + b _0807A3B0 +_0807A39E: + ldr r0, [r6] + adds r0, 0x45 + adds r0, r5 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r6] + adds r0, 0x51 + adds r0, r5 + mov r1, r9 +_0807A3B0: + strb r1, [r0] + ldr r0, =0x0203229c + adds r5, 0x1 + adds r7, 0x1 + ldr r0, [r0] + adds r0, 0x36 + add r0, r8 + ldrb r0, [r0] + cmp r7, r0 + blt _0807A34E + b _0807A458 + .pool +_0807A3CC: + movs r7, 0 + ldr r1, =0x0203229c + ldr r0, [r1] + adds r0, 0x37 + ldrb r0, [r0] + cmp r7, r0 + bge _0807A458 + adds r6, r1, 0 + movs r5, 0x6 + movs r2, 0 + mov r9, r2 +_0807A3E2: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =0x02024744 + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + adds r1, r0, 0 + cmp r1, 0x1 + bne _0807A414 + ldr r0, [r6] + adds r0, 0x45 + adds r0, r5 + mov r2, r9 + strb r2, [r0] + ldr r0, [r6] + adds r0, 0x51 + adds r0, r5 + b _0807A444 + .pool +_0807A414: + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + adds r1, r0, 0 + cmp r1, 0 + bne _0807A432 + ldr r0, [r6] + adds r0, 0x45 + adds r0, r5 + strb r1, [r0] + ldr r0, [r6] + adds r0, 0x51 + adds r0, r5 + b _0807A444 +_0807A432: + ldr r0, [r6] + adds r0, 0x45 + adds r0, r5 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r6] + adds r0, 0x51 + adds r0, r5 + mov r1, r9 +_0807A444: + strb r1, [r0] + ldr r0, =0x0203229c + adds r5, 0x1 + adds r7, 0x1 + ldr r0, [r0] + adds r0, 0x36 + add r0, r8 + ldrb r0, [r0] + cmp r7, r0 + blt _0807A3E2 +_0807A458: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807A320 + + thumb_func_start sub_807A468 +sub_807A468: @ 807A468 + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _0807A478 + cmp r0, 0x1 + beq _0807A4D8 + b _0807A52C +_0807A478: + movs r6, 0 + ldr r1, =0x0203229c + ldr r0, [r1] + adds r0, 0x36 + ldrb r0, [r0] + cmp r6, r0 + bcs _0807A52C + adds r7, r1, 0 +_0807A488: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, =0x020244ec + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0x3A + bl pokemon_getattr + adds r1, r0, 0 + lsls r0, r5, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl sub_8075060 + ldr r1, [r7] + adds r1, 0x5D + adds r1, r6 + strb r0, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, [r7] + adds r0, 0x36 + ldrb r0, [r0] + cmp r6, r0 + bcc _0807A488 + b _0807A52C + .pool +_0807A4D8: + movs r6, 0 + ldr r1, =0x0203229c + ldr r0, [r1] + adds r0, 0x37 + ldrb r0, [r0] + cmp r6, r0 + bcs _0807A52C + adds r7, r1, 0 +_0807A4E8: + movs r0, 0x64 + adds r4, r6, 0 + muls r4, r0 + ldr r0, =0x02024744 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r4, 0 + movs r1, 0x3A + bl pokemon_getattr + adds r1, r0, 0 + lsls r0, r5, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + bl sub_8075060 + ldr r1, [r7] + adds r1, 0x63 + adds r1, r6 + strb r0, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, [r7] + adds r0, 0x37 + ldrb r0, [r0] + cmp r6, r0 + bcc _0807A4E8 +_0807A52C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807A468 + + thumb_func_start sub_807A53C +sub_807A53C: @ 807A53C + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r5, 0 +_0807A544: + movs r4, 0 + ldr r2, =0x0203229c + ldr r0, [r2] + adds r0, 0x36 + adds r0, r5 + adds r1, r5, 0x1 + mov r8, r1 + ldrb r0, [r0] + cmp r4, r0 + bge _0807A596 + adds r6, r2, 0 + lsls r0, r5, 1 + adds r0, r5 + lsls r7, r0, 1 +_0807A560: + ldr r2, [r6] + adds r3, r4, r7 + adds r0, r2, 0 + adds r0, 0x28 + adds r0, r3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + adds r2, 0x5D + adds r2, r3 + ldrb r2, [r2] + movs r1, 0x4 + subs r1, r2 + lsls r1, 24 + lsrs r1, 24 + bl sub_80D32C8 + adds r4, 0x1 + ldr r0, [r6] + adds r0, 0x36 + adds r0, r5 + ldrb r0, [r0] + cmp r4, r0 + blt _0807A560 +_0807A596: + mov r5, r8 + cmp r5, 0x1 + ble _0807A544 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807A53C + + thumb_func_start sub_807A5B0 +sub_807A5B0: @ 807A5B0 + push {r4,r5,lr} + movs r3, 0 + ldr r5, =0x03005d8c + ldr r4, =0x000031a8 +_0807A5B8: + ldr r0, [r5] + adds r0, r4 + adds r2, r0, r3 + ldrb r0, [r2] + cmp r0, 0 + bne _0807A5DA + ldr r0, =0x0203229c + ldr r0, [r0] + adds r0, 0xA9 + adds r0, r3 + ldrb r0, [r0] + adds r1, r0, 0 + cmp r1, 0 + beq _0807A5DA + cmp r1, 0x3F + bhi _0807A5DA + strb r0, [r2] +_0807A5DA: + adds r3, 0x1 + cmp r3, 0xA + ble _0807A5B8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807A5B0 + + thumb_func_start sub_807A5F4 +sub_807A5F4: @ 807A5F4 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x30 + mov r8, r0 + adds r7, r1, 0 + mov r9, r2 + movs r5, 0 + cmp r5, r7 + bge _0807A62E + mov r6, sp +_0807A60C: + movs r0, 0x64 + adds r4, r5, 0 + muls r4, r0 + add r4, r8 + adds r0, r4, 0 + movs r1, 0x41 + bl pokemon_getattr + str r0, [r6, 0x18] + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + stm r6!, {r0} + adds r5, 0x1 + cmp r5, r7 + blt _0807A60C +_0807A62E: + bl sub_809D42C + mov r1, r9 + lsls r4, r1, 2 + cmp r0, 0 + bne _0807A65C + add r0, sp, 0x18 + adds r0, r4 + ldr r1, [r0] + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + bne _0807A64C + movs r0, 0x3 + b _0807A718 +_0807A64C: + lsls r0, r1, 16 + lsrs r0, 16 + bl sub_806E3F8 + cmp r0, 0 + bne _0807A65C + movs r0, 0x2 + b _0807A718 +_0807A65C: + bl link_get_multiplayer_id + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r0, =0x020229e8 + adds r1, r0 + ldrb r0, [r1] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _0807A6AC + ldrb r1, [r1, 0x12] + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + bne _0807A6AC + add r0, sp, 0x18 + adds r0, r4 + ldr r1, [r0] + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + bne _0807A6A0 + movs r0, 0x5 + b _0807A718 + .pool +_0807A6A0: + lsls r0, r1, 16 + lsrs r0, 16 + bl sub_806E3F8 + cmp r0, 0 + beq _0807A6D2 +_0807A6AC: + mov r1, sp + adds r0, r1, r4 + ldr r1, [r0] + movs r0, 0xCD + lsls r0, 1 + cmp r1, r0 + beq _0807A6BE + cmp r1, 0x97 + bne _0807A6D6 +_0807A6BE: + movs r0, 0x64 + mov r1, r9 + muls r1, r0 + adds r0, r1, 0 + add r0, r8 + movs r1, 0x50 + bl pokemon_getattr + cmp r0, 0 + bne _0807A6D6 +_0807A6D2: + movs r0, 0x4 + b _0807A718 +_0807A6D6: + cmp r7, 0 + ble _0807A6F4 + movs r3, 0xCE + lsls r3, 1 + movs r2, 0 + add r1, sp, 0x18 + adds r5, r7, 0 +_0807A6E4: + ldr r0, [r1] + cmp r0, r3 + bne _0807A6EC + str r2, [r1] +_0807A6EC: + adds r1, 0x4 + subs r5, 0x1 + cmp r5, 0 + bne _0807A6E4 +_0807A6F4: + movs r2, 0 + movs r5, 0 + cmp r2, r7 + bge _0807A70E + add r1, sp, 0x18 +_0807A6FE: + cmp r5, r9 + beq _0807A706 + ldr r0, [r1] + adds r2, r0 +_0807A706: + adds r1, 0x4 + adds r5, 0x1 + cmp r5, r7 + blt _0807A6FE +_0807A70E: + cmp r2, 0 + bne _0807A716 + movs r0, 0x1 + b _0807A718 +_0807A716: + movs r0, 0 +_0807A718: + add sp, 0x30 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_807A5F4 + + thumb_func_start sub_807A728 +sub_807A728: @ 807A728 + push {r4-r7,lr} + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _0807A7B4 + movs r4, 0 + bl link_get_multiplayer_id + ldr r5, =0x020229e8 + movs r7, 0x1 + eors r0, r7 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r1, [r1] + subs r0, r1, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bls _0807A7B4 + subs r0, r1, 0x4 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _0807A762 + movs r4, 0x2 +_0807A762: + cmp r4, 0 + ble _0807A7B4 + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r1, [r1, 0x12] + movs r6, 0xF0 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0807A7B0 + cmp r4, 0x2 + bne _0807A7B4 + bl link_get_multiplayer_id + eors r0, r7 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r1, r5 + ldrb r1, [r1, 0x12] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _0807A7B4 + movs r0, 0x2 + b _0807A7B6 + .pool +_0807A7B0: + movs r0, 0x1 + b _0807A7B6 +_0807A7B4: + movs r0, 0 +_0807A7B6: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_807A728 + + thumb_func_start sub_807A7BC +sub_807A7BC: @ 807A7BC + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0xCD + lsls r0, 1 + cmp r2, r0 + beq _0807A7D2 + cmp r2, 0x97 + bne _0807A7DA +_0807A7D2: + cmp r1, 0 + bne _0807A7DA + movs r0, 0x1 + b _0807A7DC +_0807A7DA: + movs r0, 0 +_0807A7DC: + pop {r1} + bx r1 + thumb_func_end sub_807A7BC + + thumb_func_start sub_807A7E0 +sub_807A7E0: @ 807A7E0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, [sp, 0x20] + ldr r5, [sp, 0x24] + ldr r6, [sp, 0x28] + lsls r2, 16 + lsrs r7, r2, 16 + lsls r3, 16 + lsrs r3, 16 + mov r8, r3 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 16 + lsrs r5, 16 + lsls r6, 24 + lsrs r6, 24 + lsls r2, r0, 23 + lsrs r2, 31 + mov r9, r2 + lsls r0, 24 + lsrs r2, r0, 31 + lsls r0, r1, 23 + lsrs r0, 31 + mov r10, r0 + lsls r0, r1, 24 + lsrs r0, 31 + lsls r1, 18 + lsrs r1, 28 + cmp r1, 0x3 + beq _0807A832 + cmp r2, 0 + bne _0807A82A + movs r0, 0x8 + b _0807A8C0 +_0807A82A: + cmp r0, 0 + bne _0807A832 + movs r0, 0x9 + b _0807A8C0 +_0807A832: + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_807A7BC + cmp r0, 0 + bne _0807A898 + movs r0, 0xCE + lsls r0, 1 + cmp r8, r0 + bne _0807A84E + cmp r7, r8 + beq _0807A86C + movs r0, 0x2 + b _0807A8C0 +_0807A84E: + ldr r0, =gBaseStats + lsls r1, r7, 3 + subs r1, r7 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x6] + cmp r0, r4 + beq _0807A86C + ldrb r0, [r1, 0x7] + cmp r0, r4 + beq _0807A86C + movs r0, 0x1 + b _0807A8C0 + .pool +_0807A86C: + movs r0, 0xCE + lsls r0, 1 + cmp r7, r0 + bne _0807A87C + cmp r7, r8 + beq _0807A87C + movs r0, 0x3 + b _0807A8C0 +_0807A87C: + mov r0, r9 + cmp r0, 0 + bne _0807A8AA + movs r0, 0xCE + lsls r0, 1 + cmp r7, r0 + bne _0807A88E + movs r0, 0x6 + b _0807A8C0 +_0807A88E: + adds r0, r7, 0 + bl sub_806E3F8 + cmp r0, 0 + bne _0807A89C +_0807A898: + movs r0, 0x4 + b _0807A8C0 +_0807A89C: + mov r0, r8 + bl sub_806E3F8 + cmp r0, 0 + bne _0807A8AA + movs r0, 0x5 + b _0807A8C0 +_0807A8AA: + mov r0, r10 + cmp r0, 0 + bne _0807A8BE + adds r0, r7, 0 + bl sub_806E3F8 + cmp r0, 0 + bne _0807A8BE + movs r0, 0x7 + b _0807A8C0 +_0807A8BE: + movs r0, 0 +_0807A8C0: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_807A7E0 + + thumb_func_start sub_807A8D0 +sub_807A8D0: @ 807A8D0 + push {r4-r6,lr} + lsls r1, 16 + lsrs r5, r1, 16 + adds r6, r5, 0 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 24 + lsrs r3, 24 + lsls r0, 23 + lsrs r4, r0, 31 + adds r0, r2, 0 + adds r1, r3, 0 + bl sub_807A7BC + cmp r0, 0 + bne _0807A90A + cmp r4, 0 + bne _0807A90E + movs r0, 0xCE + lsls r0, 1 + cmp r5, r0 + bne _0807A900 + movs r0, 0x2 + b _0807A910 +_0807A900: + adds r0, r6, 0 + bl sub_806E3F8 + cmp r0, 0 + bne _0807A90E +_0807A90A: + movs r0, 0x1 + b _0807A910 +_0807A90E: + movs r0, 0 +_0807A910: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_807A8D0 + + thumb_func_start sub_807A918 +sub_807A918: @ 807A918 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + adds r6, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + movs r5, 0 + ldr r0, =0x020244e9 + ldrb r0, [r0] + cmp r5, r0 + bge _0807A95A + mov r4, sp +_0807A934: + movs r0, 0x64 + muls r0, r5 + adds r0, r6, r0 + movs r1, 0x41 + bl pokemon_getattr + str r0, [r4] + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _0807A94E + movs r0, 0 + str r0, [r4] +_0807A94E: + adds r4, 0x4 + adds r5, 0x1 + ldr r0, =0x020244e9 + ldrb r0, [r0] + cmp r5, r0 + blt _0807A934 +_0807A95A: + movs r7, 0 + movs r6, 0x1 + movs r5, 0 + ldr r4, =0x020229e8 + b _0807A980 + .pool +_0807A96C: + ldrb r0, [r4] + subs r0, 0x4 + cmp r0, 0x1 + bhi _0807A978 + movs r7, 0 + b _0807A97C +_0807A978: + movs r0, 0x1 + orrs r7, r0 +_0807A97C: + adds r4, 0x1C + adds r5, 0x1 +_0807A980: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + blt _0807A96C + movs r5, 0 + movs r4, 0 + b _0807A9B4 +_0807A992: + ldr r0, =0x020229e8 + adds r2, r4, r0 + ldrb r1, [r2, 0x10] + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + bne _0807A9A2 + movs r6, 0 +_0807A9A2: + cmp r7, 0 + beq _0807A9B0 + ldrb r0, [r2, 0x10] + lsrs r0, 4 + cmp r0, 0 + beq _0807A9B0 + movs r6, 0 +_0807A9B0: + adds r4, 0x1C + adds r5, 0x1 +_0807A9B4: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r5, r0 + blt _0807A992 + cmp r6, 0 + bne _0807A9EA + mov r1, r8 + lsls r0, r1, 2 + mov r1, sp + adds r4, r1, r0 + ldrh r0, [r4] + bl sub_806E3F8 + cmp r0, 0 + bne _0807A9E0 + movs r0, 0x2 + b _0807AA1A + .pool +_0807A9E0: + ldr r0, [r4] + cmp r0, 0 + bne _0807A9EA + movs r0, 0x3 + b _0807AA1A +_0807A9EA: + movs r2, 0 + movs r5, 0 + ldr r0, =0x020244e9 + ldrb r0, [r0] + cmp r2, r0 + bge _0807AA0A + adds r3, r0, 0 + mov r1, sp +_0807A9FA: + cmp r8, r5 + beq _0807AA02 + ldr r0, [r1] + adds r2, r0 +_0807AA02: + adds r1, 0x4 + adds r5, 0x1 + cmp r5, r3 + blt _0807A9FA +_0807AA0A: + cmp r2, 0 + beq _0807AA18 + movs r0, 0 + b _0807AA1A + .pool +_0807AA18: + movs r0, 0x1 +_0807AA1A: + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_807A918 + + thumb_func_start sub_807AA28 +sub_807AA28: @ 807AA28 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _0807AA44 + movs r0, 0x17 + bl audio_play + movs r0, 0 + strh r0, [r4, 0x2E] +_0807AA44: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_807AA28 + + thumb_func_start sub_807AA4C +sub_807AA4C: @ 807AA4C + push {r4,r5,lr} + adds r4, r0, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0807AA76 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _0807AA76 + movs r0, 0xC2 + bl audio_play + strh r5, [r4, 0x2E] +_0807AA76: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_807AA4C + + thumb_func_start sub_807AA7C +sub_807AA7C: @ 807AA7C + push {lr} + adds r2, r0, 0 + movs r0, 0x30 + ldrsh r1, [r2, r0] + cmp r1, 0 + bne _0807AAB2 + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + strh r0, [r2, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + bne _0807AA98 + strh r1, [r2, 0x2E] +_0807AA98: + movs r1, 0x2E + ldrsh r0, [r2, r1] + lsls r0, 1 + ldr r1, =gUnknown_08338EA4 + adds r0, r1 + ldrb r1, [r2, 0x5] + lsrs r1, 4 + adds r1, 0x10 + lsls r1, 4 + adds r1, 0x4 + movs r2, 0x2 + bl gpu_pal_apply +_0807AAB2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_807AA7C + + thumb_func_start sub_807AABC +sub_807AABC: @ 807AABC + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x2E] + adds r1, 0x1 + strh r1, [r2, 0x2E] + ldrh r0, [r2, 0x26] + adds r0, 0x1 + strh r0, [r2, 0x26] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0xA + bne _0807AADA + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles +_0807AADA: + pop {r0} + bx r0 + thumb_func_end sub_807AABC + + thumb_func_start sub_807AAE0 +sub_807AAE0: @ 807AAE0 + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x2E] + adds r1, 0x1 + strh r1, [r2, 0x2E] + ldrh r0, [r2, 0x26] + subs r0, 0x1 + strh r0, [r2, 0x26] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0xA + bne _0807AAFE + adds r0, r2, 0 + bl RemoveObjectAndFreeTiles +_0807AAFE: + pop {r0} + bx r0 + thumb_func_end sub_807AAE0 + + thumb_func_start sub_807AB04 +sub_807AB04: @ 807AB04 + push {r4,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + bne _0807AB20 + movs r0, 0xCC + bl audio_play + movs r0, 0 + strh r0, [r4, 0x2E] +_0807AB20: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_807AB04 + + thumb_func_start sub_807AB28 +sub_807AB28: @ 807AB28 + push {r4,r5,lr} + sub sp, 0x20 + ldr r0, =0x020322a0 + ldr r0, [r0] + mov r12, r0 + adds r0, 0xD4 + ldrh r1, [r0] + lsls r1, 8 + adds r0, 0x2 + ldrh r2, [r0] + lsls r2, 8 + adds r0, 0x6 + movs r4, 0 + ldrsh r3, [r0, r4] + adds r0, 0x2 + movs r5, 0 + ldrsh r0, [r0, r5] + str r0, [sp] + mov r4, r12 + adds r4, 0xE8 + movs r5, 0 + ldrsh r0, [r4, r5] + str r0, [sp, 0x4] + movs r5, 0 + ldrsh r0, [r4, r5] + str r0, [sp, 0x8] + mov r0, r12 + adds r0, 0xEC + ldrh r0, [r0] + str r0, [sp, 0xC] + add r0, sp, 0x10 + bl sub_806F6C0 + add r0, sp, 0x10 + ldrh r1, [r0] + movs r0, 0x20 + bl SetGpuReg + add r0, sp, 0x10 + ldrh r1, [r0, 0x2] + movs r0, 0x22 + bl SetGpuReg + add r0, sp, 0x10 + ldrh r1, [r0, 0x4] + movs r0, 0x24 + bl SetGpuReg + add r0, sp, 0x10 + ldrh r1, [r0, 0x6] + movs r0, 0x26 + bl SetGpuReg + ldr r1, [sp, 0x18] + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x28 + bl SetGpuReg + ldr r1, [sp, 0x18] + lsrs r1, 16 + movs r0, 0x2A + bl SetGpuReg + ldr r1, [sp, 0x1C] + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x2C + bl SetGpuReg + ldr r1, [sp, 0x1C] + lsrs r1, 16 + movs r0, 0x2E + bl SetGpuReg + add sp, 0x20 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807AB28 + + thumb_func_start sub_807ABCC +sub_807ABCC: @ 807ABCC + push {r4,lr} + ldr r4, =0x020322a0 + ldr r0, [r4] + adds r0, 0xE0 + ldrh r1, [r0] + movs r0, 0x16 + bl SetGpuReg + ldr r0, [r4] + adds r0, 0xE2 + ldrh r1, [r0] + movs r0, 0x14 + bl SetGpuReg + movs r0, 0 + bl GetGpuReg + lsls r0, 16 + movs r1, 0xE0 + lsls r1, 11 + ands r1, r0 + cmp r1, 0 + bne _0807AC18 + ldr r0, [r4] + adds r0, 0xE4 + ldrh r1, [r0] + movs r0, 0x1A + bl SetGpuReg + ldr r0, [r4] + adds r0, 0xE6 + ldrh r1, [r0] + movs r0, 0x18 + bl SetGpuReg + b _0807AC1C + .pool +_0807AC18: + bl sub_807AB28 +_0807AC1C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_807ABCC + + thumb_func_start sub_807AC24 +sub_807AC24: @ 807AC24 + push {lr} + bl sub_807ABCC + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_807AC24 + + thumb_func_start sub_807AC3C +sub_807AC3C: @ 807AC3C + push {r4,lr} + ldr r3, =0x020322a0 + ldr r1, [r3] + movs r0, 0x8A + adds r0, r1 + mov r12, r0 + movs r2, 0 + movs r0, 0 + mov r4, r12 + strh r0, [r4] + adds r1, 0x88 + strb r2, [r1] + ldr r0, [r3] + adds r0, 0x89 + strb r2, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807AC3C + + thumb_func_start sub_807AC64 +sub_807AC64: @ 807AC64 + push {r4,r5,lr} + ldr r0, =0x020322a0 + ldr r2, [r0] + adds r1, r2, 0 + adds r1, 0x88 + adds r3, r2, 0 + adds r3, 0x89 + ldrb r1, [r1] + adds r5, r0, 0 + ldrb r3, [r3] + cmp r1, r3 + bne _0807AC8C + adds r1, r2, 0 + adds r1, 0x8A + ldrh r0, [r1] + adds r0, 0x1 + b _0807AC92 + .pool +_0807AC8C: + adds r1, r2, 0 + adds r1, 0x8A + movs r0, 0 +_0807AC92: + strh r0, [r1] + adds r4, r5, 0 + ldr r0, [r4] + adds r0, 0x8A + ldrh r1, [r0] + movs r0, 0x96 + lsls r0, 1 + cmp r1, r0 + bls _0807ACC4 + bl sub_80097E8 + ldr r0, =c2_800ACD4 + bl SetMainCallback2 + ldr r1, [r4] + adds r3, r1, 0 + adds r3, 0x8A + movs r2, 0 + movs r0, 0 + strh r0, [r3] + adds r1, 0x89 + strb r2, [r1] + ldr r0, [r4] + adds r0, 0x88 + strb r2, [r0] +_0807ACC4: + ldr r0, [r5] + adds r1, r0, 0 + adds r1, 0x88 + ldrb r1, [r1] + adds r0, 0x89 + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807AC64 + + thumb_func_start sub_807ACDC +sub_807ACDC: @ 807ACDC + push {lr} + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0807ACF0 + movs r0, 0 + b _0807ACF8 + .pool +_0807ACF0: + bl link_get_multiplayer_id + lsls r0, 24 + lsrs r0, 24 +_0807ACF8: + pop {r1} + bx r1 + thumb_func_end sub_807ACDC + + thumb_func_start sub_807ACFC +sub_807ACFC: @ 807ACFC + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + movs r4, 0 + mov r8, r4 + cmp r6, 0 + bne _0807AD22 + ldr r0, =0x02032298 + ldrb r1, [r0] + movs r0, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r1, r0 + mov r8, r1 + movs r4, 0x1 +_0807AD22: + cmp r6, 0x1 + bne _0807AD40 + ldr r0, =0x02032298 + ldrb r0, [r0, 0x1] + movs r1, 0x6 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r1, r0 + ldr r0, =0x02024744 + adds r1, r0 + mov r8, r1 + movs r4, 0x3 +_0807AD40: + cmp r5, 0 + beq _0807AD58 + cmp r5, 0x1 + beq _0807ADE0 + b _0807AE36 + .pool +_0807AD58: + mov r0, r8 + movs r1, 0x41 + bl pokemon_getattr + lsls r0, 16 + lsrs r5, r0, 16 + mov r0, r8 + movs r1, 0 + bl pokemon_getattr + adds r7, r0, 0 + cmp r6, 0 + bne _0807AD94 + lsls r0, r5, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + ldr r1, [r1, 0x8] + adds r2, r5, 0 + adds r3, r7, 0 + bl DecompressMonPic_DetectFrontOrBack_2 + movs r4, 0 + b _0807ADB2 + .pool +_0807AD94: + lsls r0, r5, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r2, [r1] + lsls r4, r6, 1 + adds r1, r4, 0x1 + lsls r1, 2 + adds r2, 0x4 + adds r2, r1 + ldr r1, [r2] + adds r2, r5, 0 + adds r3, r7, 0 + bl DecompressMonPicWithoutDuplicatingDeoxysTiles_DetectFrontOrBack +_0807ADB2: + mov r0, r8 + bl sub_806E794 + bl LoadCompressedObjectPalette + ldr r0, =0x020322a0 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xF0 + adds r0, r4 + strh r5, [r0] + lsls r0, r6, 2 + adds r1, 0x68 + adds r1, r0 + str r7, [r1] + b _0807AE36 + .pool +_0807ADE0: + mov r0, r8 + bl sub_806E794 + ldrh r0, [r0, 0x4] + adds r1, r4, 0 + bl sub_806A068 + ldr r0, =0x0202499c + movs r1, 0x78 + movs r2, 0x3C + movs r3, 0x6 + bl AddObjectToFront + ldr r4, =0x020322a0 + ldr r1, [r4] + adds r1, 0x8E + adds r1, r6 + strb r0, [r1] + ldr r3, =0x02020630 + ldr r0, [r4] + adds r0, 0x8E + adds r0, r6 + ldrb r1, [r0] + 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] + ldr r0, [r4] + adds r0, 0x8E + adds r0, r6 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, 0x1C + adds r0, r3 + ldr r1, =DummyObjectCallback + str r1, [r0] +_0807AE36: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807ACFC + + thumb_func_start sub_807AE50 +sub_807AE50: @ 807AE50 + push {r4,r5,lr} + sub sp, 0x4 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0xC + bls _0807AE66 + b _0807B116 +_0807AE66: + lsls r0, 2 + ldr r1, =_0807AE78 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807AE78: + .4byte _0807AEAC + .4byte _0807AF58 + .4byte _0807AF9C + .4byte _0807AFBC + .4byte _0807B006 + .4byte _0807B034 + .4byte _0807B058 + .4byte _0807B070 + .4byte _0807B07A + .4byte _0807B094 + .4byte _0807B0B0 + .4byte _0807B0D4 + .4byte _0807B0F0 +_0807AEAC: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _0807AEC0 + ldr r1, =0x020229c6 + ldr r2, =0x00001144 + adds r0, r2, 0 + strh r0, [r1] + bl sub_80097E8 +_0807AEC0: + ldr r4, =0x020322a0 + movs r5, 0x80 + lsls r5, 1 + adds r0, r5, 0 + bl AllocZeroed + str r0, [r4] + bl init_uns_table_pokemon_copy + bl ResetTasks + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + ldr r0, =sub_807AC24 + bl SetVBlankCallback + bl sub_807B170 + bl sub_807AC3C + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x8C + strh r2, [r0] + adds r0, 0x8 + strh r2, [r0] + adds r1, 0xEE + movs r0, 0x1 + strb r0, [r1] + ldr r3, [r4] + adds r0, r3, 0 + adds r0, 0xD4 + movs r1, 0x40 + strh r1, [r0] + adds r0, 0x2 + strh r1, [r0] + adds r0, 0x2 + strh r2, [r0] + adds r0, 0x2 + strh r2, [r0] + adds r1, r3, 0 + adds r1, 0xDC + movs r0, 0x78 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x50 + strh r0, [r1] + adds r0, r3, 0 + adds r0, 0xE8 + strh r5, [r0] + adds r0, 0x4 + strh r2, [r0] + b _0807B116 + .pool +_0807AF58: + ldr r0, =0x03003124 + ldrb r5, [r0] + cmp r5, 0 + bne _0807AF90 + ldr r4, =0x020322a0 + ldr r0, [r4] + adds r0, 0xFA + movs r1, 0x1 + strb r1, [r0] + bl sub_8009734 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r4] + str r5, [r0, 0x64] + b _0807B116 + .pool +_0807AF90: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + movs r0, 0x4 + strb r0, [r1] + b _0807B116 +_0807AF9C: + ldr r0, =0x020322a0 + ldr r1, [r0] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x3C + bhi _0807AFAC + b _0807B116 +_0807AFAC: + movs r0, 0 + str r0, [r1, 0x64] + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _0807B0E4 + .pool +_0807AFBC: + bl sub_800ABBC + lsls r0, 24 + cmp r0, 0 + bne _0807AFC8 + b _0807B0DC +_0807AFC8: + bl sub_800ABAC + adds r4, r0, 0 + bl sub_800AA48 + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bcc _0807B000 + ldr r0, =0x020322a0 + ldr r1, [r0] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x1E + bhi _0807AFEA + b _0807B116 +_0807AFEA: + bl sub_800A620 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _0807B0E4 + .pool +_0807B000: + bl sub_807AC64 + b _0807B116 +_0807B006: + bl sub_807AC64 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0807B014 + b _0807B116 +_0807B014: + bl sub_800A23C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0807B022 + b _0807B116 +_0807B022: + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _0807B0E4 + .pool +_0807B034: + ldr r2, =0x020322a0 + ldr r0, [r2] + adds r0, 0x72 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0x73 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0x93 + strb r1, [r0] + movs r0, 0 + bl sub_807ACFC + b _0807B0DC + .pool +_0807B058: + movs r0, 0 + movs r1, 0x1 + bl sub_807ACFC + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _0807B0E4 + .pool +_0807B070: + movs r0, 0x1 + movs r1, 0 + bl sub_807ACFC + b _0807B0DC +_0807B07A: + movs r0, 0x1 + movs r1, 0x1 + bl sub_807ACFC + bl sub_807B154 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _0807B0E4 + .pool +_0807B094: + bl sub_807BA94 + ldr r0, =gUnknown_08338D18 + bl LoadObjectPic + ldr r0, =gUnknown_08338D20 + bl LoadTaggedObjectPalette + b _0807B0DC + .pool +_0807B0B0: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r0, 0 + bl ShowBg + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + b _0807B0E4 + .pool +_0807B0D4: + bl sub_807B140 + bl sub_807BAD8 +_0807B0DC: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 +_0807B0E4: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0807B116 + .pool +_0807B0F0: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0807B116 + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _0807B110 + bl sub_800E0E8 + movs r0, 0 + movs r1, 0 + bl sub_800DFB4 +_0807B110: + ldr r0, =sub_807EA2C + bl SetMainCallback2 +_0807B116: + bl RunTasks + bl RunTextPrinters + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807AE50 + + thumb_func_start sub_807B140 +sub_807B140: @ 807B140 + push {lr} + movs r0, 0x5 + bl sub_807B62C + movs r0, 0 + bl sub_807B62C + pop {r0} + bx r0 + thumb_func_end sub_807B140 + + thumb_func_start sub_807B154 +sub_807B154: @ 807B154 + push {lr} + movs r0, 0 + movs r1, 0xFF + bl FillWindowPixelBuffer + movs r0, 0 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + pop {r0} + bx r0 + thumb_func_end sub_807B154 + + thumb_func_start sub_807B170 +sub_807B170: @ 807B170 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x4 + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_08339014 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgX + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl ChangeBgY + movs r5, 0x80 + lsls r5, 4 + adds r0, r5, 0 + bl Alloc + adds r1, r0, 0 + movs r0, 0 + bl SetBgTilemapBuffer + adds r0, r5, 0 + bl Alloc + adds r1, r0, 0 + movs r0, 0x1 + bl SetBgTilemapBuffer + adds r0, r5, 0 + bl Alloc + adds r1, r0, 0 + movs r0, 0x3 + bl SetBgTilemapBuffer + bl DeactivateAllTextPrinters + ldr r0, =gUnknown_08C00000 + mov r10, r0 + movs r0, 0 + mov r9, r0 + str r0, [sp] + mov r1, r10 + movs r2, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + ldr r0, =gUnknown_08C00524 + mov r8, r0 + ldr r4, =0x0201c000 + adds r1, r4, 0 + bl LZDecompressWram + movs r0, 0 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + ldr r6, =gUnknown_08C004E0 + adds r0, r6, 0 + movs r1, 0 + movs r2, 0x20 + bl decompress_palette + ldr r0, =gUnknown_08338FFC + bl InitWindows + mov r0, r9 + str r0, [sp] + movs r0, 0 + mov r1, r10 + movs r2, 0 + movs r3, 0 + bl copy_decompressed_tile_data_to_vram_autofree + mov r0, r8 + adds r1, r4, 0 + bl LZDecompressWram + movs r0, 0 + adds r1, r4, 0 + adds r2, r5, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + adds r0, r6, 0 + movs r1, 0 + movs r2, 0x20 + bl decompress_palette + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807B170 + + thumb_func_start sub_807B270 +sub_807B270: @ 807B270 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xC + bls _0807B288 + b _0807B43E +_0807B288: + lsls r0, 2 + ldr r1, =_0807B29C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807B29C: + .4byte _0807B2D0 + .4byte _0807B43E + .4byte _0807B43E + .4byte _0807B43E + .4byte _0807B43E + .4byte _0807B3AC + .4byte _0807B3B6 + .4byte _0807B3C0 + .4byte _0807B3D0 + .4byte _0807B3F0 + .4byte _0807B40C + .4byte _0807B414 + .4byte _0807B438 +_0807B2D0: + ldr r1, =0x02032298 + ldr r0, =0x020375e2 + ldrh r0, [r0] + movs r6, 0 + strb r0, [r1] + movs r0, 0x6 + strb r0, [r1, 0x1] + ldr r4, =0x020229f0 + ldr r0, =0x03005d90 + ldr r1, [r0] + adds r0, r4, 0 + bl CopyString + ldr r5, =0x02024744 + adds r0, r5, 0 + movs r1, 0x7 + mov r2, sp + bl pokemon_getattr + adds r0, r4, 0 + adds r0, 0x1C + mov r1, sp + bl CopyString + subs r4, 0x8 + movs r0, 0 + mov r8, r0 + movs r0, 0x2 + strh r0, [r4, 0x1A] + adds r0, r5, 0 + movs r1, 0x3 + bl pokemon_getattr + strh r0, [r4, 0x36] + ldr r4, =0x020322a0 + movs r5, 0x80 + lsls r5, 1 + adds r0, r5, 0 + bl AllocZeroed + str r0, [r4] + bl init_uns_table_pokemon_copy + bl ResetTasks + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + ldr r0, =sub_807AC24 + bl SetVBlankCallback + bl sub_807B170 + ldr r0, [r4] + adds r0, 0xEE + mov r1, r8 + strb r1, [r0] + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x8C + strh r6, [r0] + adds r0, 0x8 + strh r6, [r0] + adds r0, 0x40 + movs r1, 0x40 + strh r1, [r0] + adds r0, 0x2 + strh r1, [r0] + adds r0, 0x2 + strh r6, [r0] + adds r0, 0x2 + strh r6, [r0] + adds r1, r2, 0 + adds r1, 0xDC + movs r0, 0x78 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x50 + strh r0, [r1] + adds r0, r2, 0 + adds r0, 0xE8 + strh r5, [r0] + adds r0, 0x4 + strh r6, [r0] + str r6, [r2, 0x64] + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x5 + strb r1, [r0] + b _0807B43E + .pool +_0807B3AC: + movs r0, 0 + movs r1, 0 + bl sub_807ACFC + b _0807B424 +_0807B3B6: + movs r0, 0 + movs r1, 0x1 + bl sub_807ACFC + b _0807B424 +_0807B3C0: + movs r0, 0x1 + movs r1, 0 + bl sub_807ACFC + movs r0, 0 + bl ShowBg + b _0807B424 +_0807B3D0: + movs r0, 0x1 + movs r1, 0x1 + bl sub_807ACFC + movs r0, 0 + movs r1, 0xFF + bl FillWindowPixelBuffer + movs r0, 0 + bl PutWindowTilemap + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + b _0807B424 +_0807B3F0: + bl sub_807BA94 + ldr r0, =gUnknown_08338D18 + bl LoadObjectPic + ldr r0, =gUnknown_08338D20 + bl LoadTaggedObjectPalette + b _0807B424 + .pool +_0807B40C: + movs r0, 0 + bl ShowBg + b _0807B424 +_0807B414: + movs r0, 0x5 + bl sub_807B62C + movs r0, 0 + bl sub_807B62C + bl sub_807BAD8 +_0807B424: + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0807B43E + .pool +_0807B438: + ldr r0, =sub_807B60C + bl SetMainCallback2 +_0807B43E: + bl RunTasks + bl RunTextPrinters + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807B270 + + thumb_func_start sub_807B464 +sub_807B464: @ 807B464 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0807B4B8 + adds r0, r5, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + adds r5, r0, 0 + adds r0, r4, 0 + bl SpeciesToNationalPokedexNum + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + movs r1, 0x2 + bl pokedex_flag_operation + adds r0, r4, 0 + movs r1, 0x3 + adds r2, r5, 0 + bl SetPokedexFlag +_0807B4B8: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807B464 + + thumb_func_start sub_807B4C4 +sub_807B4C4: @ 807B4C4 + push {lr} + bl link_get_multiplayer_id + pop {r0} + bx r0 + thumb_func_end sub_807B4C4 + + thumb_func_start sub_807B4D0 +sub_807B4D0: @ 807B4D0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r4, 24 + lsrs r4, 24 + movs r5, 0x64 + mov r1, r9 + muls r1, r5 + ldr r0, =0x020244ec + adds r7, r1, r0 + adds r0, r7, 0 + movs r1, 0x40 + bl pokemon_getattr + lsls r0, 16 + lsrs r6, r0, 16 + adds r1, r4, 0 + muls r1, r5 + ldr r0, =0x02024744 + adds r5, r1, r0 + adds r0, r5, 0 + movs r1, 0x40 + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + cmp r6, 0xFF + beq _0807B52A + ldr r0, =0x03005d8c + lsls r1, r6, 3 + adds r1, r6 + lsls r1, 2 + ldr r2, =0x00002be0 + adds r1, r2 + ldr r0, [r0] + adds r0, r1 + bl sub_80D439C +_0807B52A: + ldr r4, =0x020322a0 + ldr r0, [r4] + adds r1, r7, 0 + movs r2, 0x64 + bl memcpy + adds r0, r7, 0 + adds r1, r5, 0 + movs r2, 0x64 + bl memcpy + ldr r1, [r4] + adds r0, r5, 0 + movs r2, 0x64 + bl memcpy + movs r1, 0x46 + mov r0, sp + strb r1, [r0] + adds r0, r7, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0807B566 + adds r0, r7, 0 + movs r1, 0x20 + mov r2, sp + bl pokemon_setattr +_0807B566: + mov r0, r8 + cmp r0, 0xFF + beq _0807B57C + lsls r1, r0, 3 + add r1, r8 + lsls r1, 2 + ldr r0, =0x020321c0 + adds r1, r0 + adds r0, r7, 0 + bl sub_80D460C +_0807B57C: + mov r0, r9 + bl sub_807B464 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _0807B58E + bl sub_807B4C4 +_0807B58E: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807B4D0 + + thumb_func_start sub_807B5B8 +sub_807B5B8: @ 807B5B8 + push {r4,lr} + ldr r4, =0x020322a0 + ldr r0, [r4] + adds r0, 0x93 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0807B5D0 + cmp r0, 0x2 + beq _0807B5F6 + b _0807B600 + .pool +_0807B5D0: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + beq _0807B5F6 + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r4] + adds r1, 0x74 + movs r2, 0x14 + bl link_0800A448 + ldr r1, [r4] + adds r1, 0x93 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_0807B5F6: + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x93 + movs r1, 0 + strb r1, [r0] +_0807B600: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807B5B8 + + thumb_func_start sub_807B60C +sub_807B60C: @ 807B60C + push {lr} + bl sub_807BBC8 + bl RunTasks + bl RunTextPrinters + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_807B60C + + thumb_func_start sub_807B62C +sub_807B62C: @ 807B62C + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x7 + bls _0807B638 + b _0807BA68 +_0807B638: + lsls r0, 2 + ldr r1, =_0807B648 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807B648: + .4byte _0807B668 + .4byte _0807B6DC + .4byte _0807B784 + .4byte _0807B7F8 + .4byte _0807B840 + .4byte _0807B90C + .4byte _0807B924 + .4byte _0807B9FC +_0807B668: + ldr r0, =0x020322a0 + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0xE4 + movs r0, 0 + strh r0, [r2] + adds r1, 0xE6 + movs r0, 0xB4 + strh r0, [r1] + movs r1, 0xAA + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r1, =0x00005206 + movs r0, 0xC + bl SetGpuReg + ldr r0, =gUnknown_08DD7300 + movs r1, 0x10 + movs r2, 0x60 + bl gpu_pal_apply + ldr r3, =gUnknown_08DD7360 + ldr r4, =0x06004000 + movs r5, 0xA1 + lsls r5, 5 + ldr r1, =0x040000d4 + ldr r6, =0x80000800 + movs r2, 0x80 + lsls r2, 5 + movs r7, 0x80 + lsls r7, 24 +_0807B6AA: + str r3, [r1] + str r4, [r1, 0x4] + str r6, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r3, r2 + adds r4, r2 + subs r5, r2 + cmp r5, r2 + bhi _0807B6AA + b _0807BA4C + .pool +_0807B6DC: + ldr r4, =0x020322a0 + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0xE2 + movs r0, 0 + strh r0, [r1] + adds r2, 0xE0 + movs r1, 0xAE + lsls r1, 1 + strh r1, [r2] + movs r0, 0x16 + bl SetGpuReg + ldr r1, =0x00008502 + movs r0, 0xA + bl SetGpuReg + ldr r1, =0x00009206 + movs r0, 0xC + bl SetGpuReg + ldr r0, [r4] + adds r0, 0xFA + ldrb r0, [r0] + cmp r0, 0 + beq _0807B724 + ldr r1, =gUnknown_083369A0 + b _0807B726 + .pool +_0807B724: + ldr r1, =gUnknown_083359A0 +_0807B726: + ldr r2, =0x06002800 + ldr r0, =0x040000d4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, =0x80000800 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + ldr r3, =gUnknown_08DD7360 + movs r4, 0xC0 + lsls r4, 19 + movs r5, 0xA1 + lsls r5, 5 + ldr r1, =0x040000d4 + ldr r6, =0x80000800 + movs r2, 0x80 + lsls r2, 5 + movs r7, 0x80 + lsls r7, 24 +_0807B74A: + str r3, [r1] + str r4, [r1, 0x4] + str r6, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r3, r2 + adds r4, r2 + subs r5, r2 + cmp r5, r2 + bhi _0807B74A + str r3, [r1] + str r4, [r1, 0x4] + lsrs r0, r5, 1 + orrs r0, r7 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r1, 0x92 + lsls r1, 5 + b _0807B820 + .pool +_0807B784: + ldr r0, =0x020322a0 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0xE0 + movs r1, 0 + strh r1, [r0] + adds r0, 0x2 + strh r1, [r0] + adds r0, 0x18 + ldrb r0, [r0] + cmp r0, 0 + bne _0807B7C0 + ldr r1, =0x00001241 + movs r0, 0 + bl SetGpuReg + ldr r0, =gUnknown_083379A0 + ldr r1, =0x06002800 + bl LZ77UnCompVram + movs r0, 0x8 + b _0807B7DA + .pool +_0807B7C0: + ldr r1, =0x00001241 + movs r0, 0 + bl SetGpuReg + ldr r1, =gUnknown_0832FFC0 + ldr r2, =0x06002800 + ldr r0, =0x040000d4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, =0x80000400 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + movs r0, 0x1 +_0807B7DA: + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + b _0807BA68 + .pool +_0807B7F8: + ldr r0, =gUnknown_08337EA0 + movs r1, 0x30 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_08337EC0 + ldr r1, =0x06004000 + bl LZ77UnCompVram + ldr r0, =gUnknown_08338550 + ldr r1, =0x06009000 + bl LZ77UnCompVram + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0xE4 + movs r1, 0x50 + strh r1, [r0] + movs r1, 0xB2 + lsls r1, 5 +_0807B820: + movs r0, 0 + bl SetGpuReg + b _0807BA68 + .pool +_0807B840: + ldr r1, =0x00001441 + movs r0, 0 + bl SetGpuReg + ldr r1, =0x00001287 + movs r0, 0xC + bl SetGpuReg + ldr r0, =0x020322a0 + ldr r3, [r0] + adds r1, r3, 0 + adds r1, 0xD4 + movs r2, 0 + movs r0, 0x40 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x5C + strh r0, [r1] + adds r1, 0x12 + movs r0, 0x20 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x80 + lsls r0, 3 + strh r0, [r1] + adds r0, r3, 0 + adds r0, 0xEC + strh r2, [r0] + ldr r3, =gUnknown_08332F60 + ldr r4, =0x06004000 + movs r5, 0xA1 + lsls r5, 6 + ldr r1, =0x040000d4 + ldr r6, =0x80000800 + movs r2, 0x80 + lsls r2, 5 + movs r7, 0x80 + lsls r7, 24 +_0807B88C: + str r3, [r1] + str r4, [r1, 0x4] + str r6, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r3, r2 + adds r4, r2 + subs r5, r2 + cmp r5, r2 + bhi _0807B88C + str r3, [r1] + str r4, [r1, 0x4] + lsrs r0, r5, 1 + orrs r0, r7 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0xFA + ldrb r0, [r0] + cmp r0, 0 + beq _0807B8EC + ldr r1, =gUnknown_083357A0 + ldr r2, =0x06009000 + ldr r0, =0x040000d4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, =0x80000080 + b _0807BA64 + .pool +_0807B8EC: + ldr r1, =gUnknown_083358A0 + ldr r2, =0x06009000 + ldr r0, =0x040000d4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, =0x80000080 + b _0807BA64 + .pool +_0807B90C: + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0xE0 + movs r2, 0 + strh r2, [r1] + adds r0, 0xE2 + strh r2, [r0] + b _0807BA68 + .pool +_0807B924: + ldr r1, =0x00001441 + movs r0, 0 + bl SetGpuReg + ldr r1, =0x00001287 + movs r0, 0xC + bl SetGpuReg + ldr r0, =0x020322a0 + ldr r3, [r0] + adds r1, r3, 0 + adds r1, 0xD4 + movs r2, 0 + movs r0, 0x40 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x5C + strh r0, [r1] + adds r1, 0x12 + adds r0, 0xA4 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x80 + strh r0, [r1] + subs r1, 0xE + movs r0, 0x78 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x50 + strh r0, [r1] + adds r0, r3, 0 + adds r0, 0xEC + strh r2, [r0] + ldr r3, =gUnknown_08332F60 + ldr r4, =0x06004000 + movs r5, 0xA1 + lsls r5, 6 + ldr r1, =0x040000d4 + ldr r6, =0x80000800 + movs r2, 0x80 + lsls r2, 5 + movs r7, 0x80 + lsls r7, 24 +_0807B97A: + str r3, [r1] + str r4, [r1, 0x4] + str r6, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r3, r2 + adds r4, r2 + subs r5, r2 + cmp r5, r2 + bhi _0807B97A + str r3, [r1] + str r4, [r1, 0x4] + lsrs r0, r5, 1 + orrs r0, r7 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0xFA + ldrb r0, [r0] + cmp r0, 0 + beq _0807B9DC + ldr r1, =gUnknown_083357A0 + ldr r2, =0x06009000 + ldr r0, =0x040000d4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, =0x80000080 + b _0807BA64 + .pool +_0807B9DC: + ldr r1, =gUnknown_083358A0 + ldr r2, =0x06009000 + ldr r0, =0x040000d4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, =0x80000080 + b _0807BA64 + .pool +_0807B9FC: + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0xE4 + movs r2, 0 + strh r2, [r1] + adds r0, 0xE6 + strh r2, [r0] + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + ldr r1, =0x00005206 + movs r0, 0xC + bl SetGpuReg + ldr r0, =gUnknown_08DD7300 + movs r1, 0x10 + movs r2, 0x60 + bl gpu_pal_apply + ldr r3, =gUnknown_08DD7360 + ldr r4, =0x06004000 + movs r5, 0xA1 + lsls r5, 5 + ldr r1, =0x040000d4 + ldr r6, =0x80000800 + movs r2, 0x80 + lsls r2, 5 + movs r7, 0x80 + lsls r7, 24 +_0807BA3A: + str r3, [r1] + str r4, [r1, 0x4] + str r6, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r3, r2 + adds r4, r2 + subs r5, r2 + cmp r5, r2 + bhi _0807BA3A +_0807BA4C: + str r3, [r1] + str r4, [r1, 0x4] + lsrs r0, r5, 1 + orrs r0, r7 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + ldr r1, =gUnknown_08331F60 + ldr r2, =0x06009000 + ldr r0, =0x040000d4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, =0x80000800 +_0807BA64: + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] +_0807BA68: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807B62C + + thumb_func_start sub_807BA94 +sub_807BA94: @ 807BA94 + push {lr} + ldr r0, =gUnknown_08338D70 + bl LoadObjectPic + ldr r0, =gUnknown_08338DC0 + bl LoadObjectPic + ldr r0, =gUnknown_08338DF4 + bl LoadObjectPic + ldr r0, =gUnknown_08338E6C + bl LoadObjectPic + ldr r0, =gUnknown_08338D78 + bl LoadTaggedObjectPalette + ldr r0, =gUnknown_08338D80 + bl LoadTaggedObjectPalette + pop {r0} + bx r0 + .pool + thumb_func_end sub_807BA94 + + thumb_func_start sub_807BAD8 +sub_807BAD8: @ 807BAD8 + push {r4,r5,lr} + sub sp, 0x14 + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0xEE + ldrb r0, [r0] + cmp r0, 0 + beq _0807BB68 + bl link_get_multiplayer_id + lsls r0, 24 + ldr r3, =0x02021cc4 + movs r2, 0x80 + lsls r2, 17 + eors r2, r0 + lsrs r2, 24 + lsls r1, r2, 3 + subs r1, r2 + lsls r1, 2 + ldr r0, =0x020229f0 + adds r1, r0 + adds r0, r3, 0 + bl CopyString + ldr r5, =0x02032298 + ldrb r0, [r5, 0x1] + movs r1, 0x6 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + movs r4, 0x64 + muls r0, r4 + ldr r1, =0x02024744 + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + ldr r0, =0x02021ec4 + mov r1, sp + bl CopyString_Limit10 + ldrb r0, [r5] + muls r0, r4 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + ldr r0, =0x02021dc4 + mov r1, sp + bl CopyString_Limit10 + b _0807BBA4 + .pool +_0807BB68: + ldr r0, =0x020375e0 + ldrh r0, [r0] + lsls r4, r0, 4 + subs r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_08338ED0 + adds r4, r0 + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x2B + bl CopyString + ldr r0, =0x02021ec4 + adds r1, r4, 0 + bl CopyString_Limit10 + ldr r0, =0x020375e2 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + ldr r0, =0x02021dc4 + mov r1, sp + bl CopyString_Limit10 +_0807BBA4: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807BAD8 + + thumb_func_start sub_807BBC8 +sub_807BBC8: @ 807BBC8 + push {lr} + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0xFA + ldrb r0, [r0] + cmp r0, 0 + bne _0807BBE0 + bl sub_807CFC8 + b _0807BBE4 + .pool +_0807BBE0: + bl sub_807BBEC +_0807BBE4: + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_807BBC8 + + thumb_func_start sub_807BBEC +sub_807BBEC: @ 807BBEC + push {r4-r7,lr} + sub sp, 0x14 + ldr r0, =0x020322a0 + ldr r1, [r0] + adds r1, 0x94 + ldrh r5, [r1] + ldr r1, =0x0000010b + adds r7, r0, 0 + cmp r5, r1 + bls _0807BC04 + bl _0807CFB4 +_0807BC04: + lsls r0, r5, 2 + ldr r1, =_0807BC1C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807BC1C: + .4byte _0807C04C + .4byte _0807C0C4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807C120 + .4byte _0807C168 + .4byte _0807C1DC + .4byte _0807CFB4 + .4byte _0807C248 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807C26C + .4byte _0807C29C + .4byte _0807C2AE + .4byte _0807C2D0 + .4byte _0807C318 + .4byte _0807C348 + .4byte _0807C390 + .4byte _0807C3E0 + .4byte _0807C434 + .4byte _0807C4B8 + .4byte _0807C4DC + .4byte _0807C528 + .4byte _0807C574 + .4byte _0807C5D0 + .4byte _0807C630 + .4byte _0807C644 + .4byte _0807C658 + .4byte _0807C66C + .4byte _0807C794 + .4byte _0807C864 + .4byte _0807C8EC + .4byte _0807C964 + .4byte _0807C974 + .4byte _0807C994 + .4byte _0807C9E4 + .4byte _0807CA02 + .4byte _0807CA40 + .4byte _0807CA50 + .4byte _0807CAC8 + .4byte _0807CFB4 + .4byte _0807CAF0 + .4byte _0807CB30 + .4byte _0807CB70 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CB90 + .4byte _0807CBB8 + .4byte _0807CBD4 + .4byte _0807CBF4 + .4byte _0807CC9C + .4byte _0807CCD0 + .4byte _0807CD1C + .4byte _0807CDDC + .4byte _0807CE54 + .4byte _0807CEA0 + .4byte _0807CEB0 + .4byte _0807CEB6 + .4byte _0807CEDC + .4byte _0807CF38 + .4byte _0807CF5C + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CE18 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807C460 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CFB4 + .4byte _0807CE38 +_0807C04C: + ldr r3, =0x02020630 + ldr r0, [r7] + adds r0, 0x8E + ldrb r1, [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] + ldr r4, [r7] + adds r2, r4, 0 + adds r2, 0x8E + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldr r1, =0x0000ff4c + strh r1, [r0, 0x24] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldr r2, =gUnknown_08300D38 + adds r0, r4, 0 + adds r0, 0xF0 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + strh r0, [r1, 0x26] + adds r1, r4, 0 + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + bl current_map_music_get + ldr r1, [r7] + adds r1, 0xF4 + strh r0, [r1] + ldr r0, =0x00000179 + bl current_map_music_set + bl _0807CFB4 + .pool +_0807C0C4: + ldr r5, [r7] + adds r6, r5, 0 + adds r6, 0xE6 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + ble _0807C0F8 + ldr r2, =0x02020630 + adds r0, r5, 0 + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x24] + adds r1, 0x3 + strh r1, [r0, 0x24] + ldrh r0, [r6] + subs r0, 0x3 + strh r0, [r6] + bl _0807CFB4 + .pool +_0807C0F8: + ldr r2, =0x02020630 + adds r0, r5, 0 + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strh r1, [r0, 0x24] + strh r1, [r6] + adds r1, r5, 0 + adds r1, 0x94 + movs r0, 0xA + strh r0, [r1] + bl _0807CFB4 + .pool +_0807C120: + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EE942 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + ldr r4, =0x020322a0 + ldr r0, [r4] + adds r2, r0, 0 + adds r2, 0xF0 + ldrh r1, [r2] + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + beq _0807C14E + adds r0, r1, 0 + movs r1, 0 + bl cry_related +_0807C14E: + ldr r3, [r4] + adds r1, r3, 0 + adds r1, 0x94 + movs r2, 0 + movs r0, 0xB + bl _0807CE06 + .pool +_0807C168: + ldr r1, [r7] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x50 + beq _0807C178 + bl _0807CFB4 +_0807C178: + adds r0, r1, 0 + adds r0, 0x8E + ldrb r0, [r0] + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x5] + lsrs r1, 4 + movs r2, 0x2 + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0x14 + str r2, [sp, 0x8] + ldr r2, =0x000fffff + str r2, [sp, 0xC] + movs r2, 0x78 + movs r3, 0x20 + bl sub_807671C + ldr r1, [r7] + adds r1, 0xD2 + strb r0, [r1] + ldr r1, [r7] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EE959 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + bl _0807CFB4 + .pool +_0807C1DC: + ldr r5, =0x02020630 + ldr r0, [r7] + adds r0, 0xD2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r5, 0 + adds r4, 0x1C + adds r0, r4 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + beq _0807C1FC + bl _0807CFB4 +_0807C1FC: + ldr r0, =gUnknown_08338D28 + movs r1, 0x78 + movs r2, 0x20 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0xD3 + strb r0, [r1] + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_807E5D8 + str r1, [r0] + adds r2, 0xD2 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + ldr r1, [r7] + bl _0807CF4C + .pool +_0807C248: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x14 + strh r1, [r0] + bl _0807CFB4 + .pool +_0807C26C: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807C27C + bl _0807CFB4 +_0807C27C: + movs r0, 0x4 + bl sub_807B62C + movs r0, 0 + movs r1, 0xFF + bl FillWindowPixelBuffer + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + bl _0807CF48 + .pool +_0807C29C: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0x10 + movs r3, 0 + bl _0807CF44 +_0807C2AE: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807C2BE + bl _0807CFB4 +_0807C2BE: + ldr r0, [r7] + adds r0, 0x94 + movs r1, 0x17 + strh r1, [r0] + bl _0807CFB4 + .pool +_0807C2D0: + ldr r4, =0x020322a0 + ldr r0, [r4] + adds r2, r0, 0 + adds r2, 0xEA + ldrh r1, [r2] + movs r0, 0x80 + lsls r0, 1 + cmp r1, r0 + bls _0807C2F0 + adds r0, r1, 0 + subs r0, 0x34 + strh r0, [r2] + b _0807C30C + .pool +_0807C2F0: + movs r0, 0x1 + bl sub_807B62C + ldr r3, [r4] + adds r1, r3, 0 + adds r1, 0xEA + movs r2, 0 + movs r0, 0x80 + strh r0, [r1] + subs r1, 0x56 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + str r2, [r3, 0x64] +_0807C30C: + ldr r0, =0x020322a0 + ldr r4, [r0] + bl _0807CB5C + .pool +_0807C318: + ldr r1, [r7] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x14 + bhi _0807C328 + bl _0807CFB4 +_0807C328: + bl sub_807AB28 + ldr r0, =gUnknown_08338E74 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0x91 + strb r0, [r1] + ldr r1, [r7] + bl _0807CF4C + .pool +_0807C348: + ldr r2, =0x02020630 + ldr r0, [r7] + adds r0, 0x91 + 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 + blt _0807C368 + bl _0807CFB4 +_0807C368: + adds r0, r1, 0 + bl RemoveObjectAndFreeTiles + movs r1, 0xC8 + lsls r1, 3 + movs r0, 0x50 + bl SetGpuReg + ldr r1, =0x0000040c + movs r0, 0x52 + bl SetGpuReg + ldr r1, [r7] + bl _0807CF4C + .pool +_0807C390: + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0xE0 + ldrh r1, [r0] + subs r1, 0x1 + strh r1, [r0] + lsls r1, 16 + movs r0, 0x9E + lsls r0, 17 + cmp r1, r0 + bne _0807C3B0 + adds r1, r2, 0 + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0807C3B0: + ldr r0, [r7] + adds r0, 0xE0 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0xA4 + lsls r0, 1 + cmp r1, r0 + beq _0807C3C4 + bl _0807CFB4 +_0807C3C4: + ldr r0, =gUnknown_08338DFC + movs r1, 0x80 + movs r2, 0x41 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0x92 + strb r0, [r1] + bl _0807CFB4 + .pool +_0807C3E0: + ldr r0, =gUnknown_08338D88 + movs r1, 0x80 + movs r2, 0x50 + movs r3, 0x3 + bl AddObjectToFront + ldr r4, =0x020322a0 + ldr r1, [r4] + adds r1, 0x90 + strb r0, [r1] + ldr r0, =gUnknown_08338DC8 + movs r1, 0x80 + movs r2, 0x50 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r4] + adds r1, 0x91 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0x1 + bl StartObjectImageAnim + ldr r1, [r4] + bl _0807CF4C + .pool +_0807C434: + ldr r2, [r7] + adds r1, r2, 0 + adds r1, 0xE0 + ldrh r0, [r1] + subs r0, 0x2 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA6 + bne _0807C44E + subs r1, 0x4C + movs r0, 0xC8 + strh r0, [r1] +_0807C44E: + ldr r1, =0x00001241 + movs r0, 0 + bl SetGpuReg + bl _0807CFB4 + .pool +_0807C460: + ldr r2, =0x02020630 + ldr r4, [r7] + adds r3, r4, 0 + adds r3, 0x90 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + subs r1, 0x2 + strh r1, [r0, 0x22] + adds r0, r4, 0 + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + subs r1, 0x2 + strh r1, [r0, 0x22] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r3, 0x22 + ldrsh r1, [r0, r3] + movs r0, 0x8 + negs r0, r0 + cmp r1, r0 + blt _0807C4A6 + bl _0807CFB4 +_0807C4A6: + adds r1, r4, 0 + adds r1, 0x94 + movs r0, 0x1D + strh r0, [r1] + bl _0807CFB4 + .pool +_0807C4B8: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x1E + strh r1, [r0] + bl _0807CFB4 + .pool +_0807C4DC: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807C4EC + bl _0807CFB4 +_0807C4EC: + ldr r0, [r7] + adds r0, 0x90 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + movs r0, 0x2 + bl sub_807B62C + ldr r1, [r7] + bl _0807CF4C + .pool +_0807C528: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r5, =gUnknown_08338DC8 + adds r0, r5, 0 + movs r1, 0x6F + movs r2, 0xAA + movs r3, 0 + bl AddObjectToFront + ldr r4, =0x020322a0 + ldr r1, [r4] + adds r1, 0x90 + strb r0, [r1] + movs r2, 0xA + negs r2, r2 + adds r0, r5, 0 + movs r1, 0x81 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r4] + adds r1, 0x91 + strb r0, [r1] + ldr r1, [r4] + bl _0807CF4C + .pool +_0807C574: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0807C592 + movs r0, 0x2E + bl audio_play + ldr r0, =0x020322a0 + ldr r1, [r0] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0807C592: + ldr r3, =0x02020630 + ldr r0, =0x020322a0 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x90 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x26] + subs r1, 0x3 + strh r1, [r0, 0x26] + adds r2, 0x91 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x26] + adds r1, 0x3 + strh r1, [r0, 0x26] + bl _0807CFB4 + .pool +_0807C5D0: + ldr r5, =0x02020630 + ldr r4, [r7] + adds r2, r4, 0 + adds r2, 0x90 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r0, 0x26] + subs r1, 0x3 + strh r1, [r0, 0x26] + adds r6, r4, 0 + adds r6, 0x91 + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r0, 0x26] + adds r1, 0x3 + strh r1, [r0, 0x26] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, r0, r5 + movs r0, 0x26 + ldrsh r1, [r3, r0] + movs r0, 0x5A + negs r0, r0 + cmp r1, r0 + ble _0807C616 + bl _0807CFB4 +_0807C616: + movs r2, 0x1 + strh r2, [r3, 0x30] + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x30] + adds r1, r4, 0 + bl _0807CF4C + .pool +_0807C630: + ldr r2, =0x0000ffff + movs r0, 0x1 + movs r1, 0x10 + bl sub_80A2A20 + bl _0807CF48 + .pool +_0807C644: + ldr r2, =0x0000ffff + movs r0, 0x1 + movs r1, 0 + bl sub_80A2A20 + bl _0807CF48 + .pool +_0807C658: + ldr r2, =0x0000ffff + movs r0, 0x1 + movs r1, 0x10 + bl sub_80A2A20 + bl _0807CF48 + .pool +_0807C66C: + ldr r5, =0x020322a0 + ldr r0, [r5] + adds r0, 0xF0 + ldrh r0, [r0] + bl sub_806E840 + lsls r0, 24 + cmp r0, 0 + bne _0807C6E4 + ldr r4, =0x02020630 + ldr r2, [r5] + adds r2, 0x8E + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x10 + adds r0, r1 + ldr r1, =gUnknown_08338ECC + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x1] + movs r2, 0x3 + orrs r1, r2 + strb r1, [r0, 0x1] + ldr r0, [r5] + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0 + movs r2, 0x3 + movs r3, 0x3 + bl CalcVecFromObjectCenterToObjectUpperLeft + ldr r0, [r5] + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0 + bl StartObjectRotScalAnim + b _0807C6FA + .pool +_0807C6E4: + ldr r0, [r5] + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0 + bl StartObjectRotScalAnim +_0807C6FA: + ldr r5, =0x020322a0 + ldr r0, [r5] + adds r0, 0x8F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + movs r1, 0 + bl StartObjectRotScalAnim + ldr r2, [r5] + adds r3, r2, 0 + adds r3, 0x8E + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x3C + strh r1, [r0, 0x20] + adds r2, 0x8F + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xB4 + strh r1, [r0, 0x20] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xC0 + strh r1, [r0, 0x22] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000ffe0 + strh r1, [r0, 0x22] + ldrb r0, [r3] + 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] + adds r0, 0x8F + ldrb r1, [r0] + 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] + ldr r1, [r5] + bl _0807CF4C + .pool +_0807C794: + ldr r4, =0x02020630 + ldr r2, [r7] + adds r3, r2, 0 + adds r3, 0x8E + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x26] + subs r1, 0x3 + movs r5, 0 + strh r1, [r0, 0x26] + adds r2, 0x8F + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x26] + adds r1, 0x3 + strh r1, [r0, 0x26] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x26] + adds r0, 0xA3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bhi _0807C7DC + movs r0, 0x2D + bl audio_play +_0807C7DC: + ldr r2, [r7] + adds r3, r2, 0 + adds r3, 0x8E + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r6, 0x26 + ldrsh r1, [r0, r6] + movs r0, 0xDE + negs r0, r0 + cmp r1, r0 + blt _0807C7FC + bl _0807CFB4 +_0807C7FC: + adds r0, r2, 0 + adds r0, 0x90 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r5, [r0, 0x30] + adds r0, r2, 0 + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r5, [r0, 0x30] + adds r1, r2, 0 + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + ldrb r1, [r3] + 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, [r7] + adds r0, 0x8F + ldrb r1, [r0] + 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 r2, =0x0000ffff + movs r0, 0x1 + movs r1, 0 + bl sub_80A2A20 + b _0807CFB4 + .pool +_0807C864: + ldr r4, =0x02020630 + ldr r2, [r7] + adds r3, r2, 0 + adds r3, 0x90 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x26] + subs r1, 0x3 + strh r1, [r0, 0x26] + adds r2, 0x91 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x26] + adds r1, 0x3 + strh r1, [r0, 0x26] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r2, 0x26 + ldrsh r1, [r0, r2] + movs r0, 0xDE + negs r0, r0 + cmp r1, r0 + ble _0807C8A6 + b _0807CFB4 +_0807C8A6: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, [r7] + adds r2, r1, 0 + adds r2, 0x94 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x90 + ldrb r1, [r1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + b _0807CFB4 + .pool +_0807C8EC: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807C8FA + b _0807CFB4 +_0807C8FA: + ldr r1, [r7] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + movs r0, 0x1 + bl sub_807B62C + ldr r0, [r7] + adds r0, 0xE0 + movs r1, 0xA6 + strh r1, [r0] + ldr r0, =gUnknown_08338D88 + movs r4, 0x14 + negs r4, r4 + movs r1, 0x80 + adds r2, r4, 0 + movs r3, 0x3 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0x90 + strb r0, [r1] + ldr r0, =gUnknown_08338DC8 + movs r1, 0x80 + adds r2, r4, 0 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0x91 + strb r0, [r1] + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0x1 + bl StartObjectImageAnim + b _0807CFB4 + .pool +_0807C964: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0x10 + movs r3, 0 + b _0807CF44 +_0807C974: + movs r1, 0x92 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807C98C + b _0807CFB4 +_0807C98C: + b _0807CF48 + .pool +_0807C994: + ldr r2, =0x02020630 + ldr r4, [r7] + adds r3, r4, 0 + adds r3, 0x90 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + adds r1, 0x3 + strh r1, [r0, 0x26] + adds r0, r4, 0 + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + adds r1, 0x3 + strh r1, [r0, 0x26] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r3, 0x26 + ldrsh r1, [r0, r3] + movs r6, 0x22 + ldrsh r0, [r0, r6] + adds r1, r0 + cmp r1, 0x40 + beq _0807C9DA + b _0807CFB4 +_0807C9DA: + adds r1, r4, 0 + b _0807CF4C + .pool +_0807C9E4: + ldr r1, [r7] + adds r5, r1, 0 + adds r5, 0xE0 + ldrh r0, [r5] + adds r0, 0x2 + strh r0, [r5] + lsls r0, 16 + asrs r0, 16 + movs r6, 0x9E + lsls r6, 1 + cmp r0, r6 + bgt _0807C9FE + b _0807CFB4 +_0807C9FE: + strh r6, [r5] + b _0807CF4C +_0807CA02: + ldr r0, [r7] + adds r0, 0x90 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r3, [r7] + adds r2, r3, 0 + adds r2, 0x94 + ldrh r0, [r2] + adds r0, 0x1 + movs r1, 0 + strh r0, [r2] + str r1, [r3, 0x64] + b _0807CFB4 + .pool +_0807CA40: + ldr r1, [r7] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0xA + beq _0807CA4E + b _0807CFB4 +_0807CA4E: + b _0807CF4C +_0807CA50: + ldr r1, [r7] + adds r2, r1, 0 + adds r2, 0xE0 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + lsls r0, 16 + asrs r0, 16 + movs r3, 0xAE + lsls r3, 1 + cmp r0, r3 + ble _0807CA72 + strh r3, [r2] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0807CA72: + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0xE0 + movs r3, 0 + ldrsh r1, [r0, r3] + movs r0, 0xA4 + lsls r0, 1 + cmp r1, r0 + beq _0807CA86 + b _0807CFB4 +_0807CA86: + adds r0, r2, 0 + adds r0, 0xFA + ldrb r0, [r0] + cmp r0, 0 + bne _0807CA92 + b _0807CFB4 +_0807CA92: + ldr r0, =gUnknown_08338DFC + movs r1, 0x80 + movs r2, 0x41 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0x92 + strb r0, [r1] + ldr r2, =0x02020630 + ldr r0, [r7] + adds r0, 0x92 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, =sub_807AAE0 + str r1, [r0] + b _0807CFB4 + .pool +_0807CAC8: + ldr r0, =gUnknown_08338E74 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0 + bl AddObjectToFront + ldr r2, =0x020322a0 + ldr r1, [r2] + adds r1, 0x91 + strb r0, [r1] + ldr r0, [r2] + adds r0, 0x94 + movs r1, 0x32 + strh r1, [r0] + b _0807CFB4 + .pool +_0807CAF0: + ldr r2, =0x02020630 + ldr r0, [r7] + adds r0, 0x91 + 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 + blt _0807CB0E + b _0807CFB4 +_0807CB0E: + adds r0, r1, 0 + bl RemoveObjectAndFreeTiles + movs r0, 0x6 + bl sub_807B62C + ldr r1, [r7] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + movs r0, 0x9F + bl audio_play + b _0807CFB4 + .pool +_0807CB30: + ldr r1, [r7] + adds r2, r1, 0 + adds r2, 0xEA + ldrh r3, [r2] + ldr r0, =0x000003ff + cmp r3, r0 + bhi _0807CB4C + adds r0, r3, 0 + adds r0, 0x34 + strh r0, [r2] + b _0807CB5A + .pool +_0807CB4C: + movs r0, 0x80 + lsls r0, 3 + strh r0, [r2] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0807CB5A: + ldr r4, [r7] +_0807CB5C: + adds r0, r4, 0 + adds r0, 0xEA + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 8 + bl __divsi3 + adds r4, 0xE8 + strh r0, [r4] + b _0807CFB4 +_0807CB70: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x3C + strh r1, [r0] + b _0807CFB4 + .pool +_0807CB90: + ldr r4, =0x02037fd4 + ldrb r1, [r4, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807CB9E + b _0807CFB4 +_0807CB9E: + movs r0, 0x5 + bl sub_807B62C + movs r0, 0x7 + bl sub_807B62C + ldrb r0, [r4, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r4, 0x8] + b _0807CF48 + .pool +_0807CBB8: + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + b _0807CF44 + .pool +_0807CBD4: + movs r1, 0xA2 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807CBEC + b _0807CFB4 +_0807CBEC: + b _0807CF48 + .pool +_0807CBF4: + ldr r0, =gUnknown_08338D28 + movs r2, 0x8 + negs r2, r2 + movs r1, 0x78 + movs r3, 0 + bl AddObjectToFront + ldr r5, =0x020322a0 + ldr r1, [r5] + adds r1, 0xD3 + movs r6, 0 + strb r0, [r1] + ldr r4, =0x02020630 + ldr r2, [r5] + adds r2, 0xD3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x4A + strh r1, [r0, 0x34] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_807E6AC + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartObjectImageAnim + ldr r0, [r5] + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x2 + bl StartObjectRotScalAnim + ldr r0, [r5] + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x5] + lsrs r1, 4 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + ldr r2, =0x0000ffff + movs r1, 0x10 + bl sub_80A2A20 + ldr r2, [r5] + adds r1, r2, 0 + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + str r6, [r2, 0x64] + b _0807CFB4 + .pool +_0807CC9C: + ldr r2, =0x02020630 + ldr r0, [r7] + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x5] + lsrs r1, 4 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + ldr r1, =0x0000ffff + str r1, [sp] + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r1, [r7] + b _0807CF4C + .pool +_0807CCD0: + ldr r2, =0x02020630 + ldr r3, [r7] + adds r0, r3, 0 + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + beq _0807CCEE + b _0807CFB4 +_0807CCEE: + adds r0, r3, 0 + adds r0, 0xF2 + ldrh r2, [r0] + lsls r0, r2, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + ldr r1, [r1, 0x10] + ldr r3, [r3, 0x6C] + bl DecompressMonPic_DetectFrontOrBack_2 + ldr r1, [r7] + b _0807CF4C + .pool +_0807CD1C: + ldr r4, =0x02020630 + ldr r2, [r7] + adds r6, r2, 0 + adds r6, 0x8F + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r5, 0 + movs r1, 0x78 + strh r1, [r0, 0x20] + ldrb r0, [r6] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldr r3, =gUnknown_08300D38 + adds r2, 0xF2 + ldrh r0, [r2] + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x1] + adds r0, 0x3C + strh r0, [r1, 0x22] + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r5, [r0, 0x24] + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r5, [r0, 0x26] + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0 + bl StartObjectImageAnim + ldr r3, [r7] + adds r0, r3, 0 + adds r0, 0x8F + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r1, [r1, 0x5] + lsrs r1, 4 + movs r2, 0x2 + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0x14 + str r2, [sp, 0x8] + ldr r2, =0x000fffff + str r2, [sp, 0xC] + adds r3, 0xF2 + ldrh r2, [r3] + str r2, [sp, 0x10] + movs r2, 0x78 + movs r3, 0x54 + bl sub_8076438 + ldr r0, [r7] + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_free_rotscale_entry + ldr r0, [r7] + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r1, [r7] + b _0807CF4C + .pool +_0807CDDC: + movs r1, 0xAA + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EE966 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + ldr r0, =0x020322a0 + ldr r3, [r0] + adds r1, r3, 0 + adds r1, 0x94 + movs r2, 0 + movs r0, 0xA7 +_0807CE06: + strh r0, [r1] + str r2, [r3, 0x64] + b _0807CFB4 + .pool +_0807CE18: + ldr r3, [r7] + ldr r0, [r3, 0x64] + adds r0, 0x1 + str r0, [r3, 0x64] + cmp r0, 0x3C + bhi _0807CE26 + b _0807CFB4 +_0807CE26: + adds r0, r3, 0 + adds r0, 0x94 + movs r2, 0 + ldr r1, =0x0000010b + strh r1, [r0] + str r2, [r3, 0x64] + b _0807CFB4 + .pool +_0807CE38: + bl sub_80A3678 + lsls r0, 24 + cmp r0, 0 + bne _0807CE44 + b _0807CFB4 +_0807CE44: + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x44 + strh r1, [r0] + b _0807CFB4 + .pool +_0807CE54: + ldr r1, [r7] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0xA + bne _0807CE66 + ldr r0, =0x00000173 + bl fanfare_play +_0807CE66: + ldr r1, [r7] + ldr r0, [r1, 0x64] + cmp r0, 0xFA + beq _0807CE70 + b _0807CFB4 +_0807CE70: + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + movs r5, 0 + strh r0, [r1] + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EE977 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + ldr r0, [r7] + str r5, [r0, 0x64] + b _0807CFB4 + .pool +_0807CEA0: + ldr r1, [r7] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x3C + beq _0807CEAE + b _0807CFB4 +_0807CEAE: + b _0807CF4C +_0807CEB0: + bl sub_807F14C + b _0807CF48 +_0807CEB6: + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0xEE + ldrb r0, [r0] + cmp r0, 0 + beq _0807CEC6 + movs r0, 0x1 + b _0807CFB6 +_0807CEC6: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0807CFB4 + adds r1, r2, 0 + b _0807CF4C + .pool +_0807CEDC: + ldr r0, =0x020375e2 + ldrb r0, [r0] + movs r1, 0 + bl sub_807B4D0 + ldr r1, =0x030061e8 + ldr r0, =sub_807B60C + str r0, [r1] + ldr r7, =0x02032298 + ldrb r0, [r7] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + movs r1, 0x1 + movs r2, 0 + bl GetEvolutionTargetSpecies + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _0807CF48 + ldrb r3, [r7] + adds r0, r3, 0 + muls r0, r6 + adds r0, r5 + ldr r1, =0x020322a0 + ldr r1, [r1] + adds r1, 0x8F + ldrb r2, [r1] + adds r1, r4, 0 + bl sub_813E1D4 + b _0807CF48 + .pool +_0807CF38: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 +_0807CF44: + bl pal_fade_maybe +_0807CF48: + ldr r0, =0x020322a0 + ldr r1, [r0] +_0807CF4C: + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0807CFB4 + .pool +_0807CF5C: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0807CFB4 + ldr r0, [r7] + adds r0, 0xF4 + ldrh r0, [r0] + bl current_map_music_set + ldr r0, [r7] + cmp r0, 0 + beq _0807CFAA + bl FreeAllWindowBuffers + movs r0, 0x3 + bl GetBgTilemapBuffer + bl Free + movs r0, 0x1 + bl GetBgTilemapBuffer + bl Free + movs r0, 0 + bl GetBgTilemapBuffer + bl Free + bl sub_805F094 + ldr r0, [r7] + bl Free + str r4, [r7] +_0807CFAA: + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + bl sub_807E784 +_0807CFB4: + movs r0, 0 +_0807CFB6: + add sp, 0x14 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_807BBEC + + thumb_func_start sub_807CFC8 +sub_807CFC8: @ 807CFC8 + push {r4-r7,lr} + sub sp, 0x14 + ldr r0, =0x020322a0 + ldr r1, [r0] + adds r1, 0x94 + ldrh r5, [r1] + ldr r1, =0x0000010b + adds r7, r0, 0 + cmp r5, r1 + bls _0807CFE0 + bl _0807E400 +_0807CFE0: + lsls r0, r5, 2 + ldr r1, =_0807CFF8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807CFF8: + .4byte _0807D428 + .4byte _0807D4A0 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807D4FC + .4byte _0807D544 + .4byte _0807D5B8 + .4byte _0807E400 + .4byte _0807D624 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807D648 + .4byte _0807D678 + .4byte _0807D68A + .4byte _0807D6AC + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807D7A4 + .4byte _0807D7C4 + .4byte _0807D830 + .4byte _0807D8B4 + .4byte _0807D8D8 + .4byte _0807D924 + .4byte _0807D970 + .4byte _0807D9CC + .4byte _0807DA38 + .4byte _0807DA4C + .4byte _0807DA60 + .4byte _0807DA74 + .4byte _0807DB9C + .4byte _0807DC6C + .4byte _0807DCF4 + .4byte _0807DD94 + .4byte _0807DDA4 + .4byte _0807DDC4 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807DEE8 + .4byte _0807DEF8 + .4byte _0807DF16 + .4byte _0807E400 + .4byte _0807DF3C + .4byte _0807DF7C + .4byte _0807DFBC + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807DFDC + .4byte _0807E004 + .4byte _0807E020 + .4byte _0807E040 + .4byte _0807E0E8 + .4byte _0807E11C + .4byte _0807E168 + .4byte _0807E228 + .4byte _0807E2A0 + .4byte _0807E2EC + .4byte _0807E2FC + .4byte _0807E302 + .4byte _0807E328 + .4byte _0807E384 + .4byte _0807E3A8 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807D6F4 + .4byte _0807D728 + .4byte _0807D77C + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807DE1C + .4byte _0807DE84 + .4byte _0807DEC0 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E264 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807D85C + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E400 + .4byte _0807E284 +_0807D428: + ldr r3, =0x02020630 + ldr r0, [r7] + adds r0, 0x8E + ldrb r1, [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] + ldr r4, [r7] + adds r2, r4, 0 + adds r2, 0x8E + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldr r1, =0x0000ff4c + strh r1, [r0, 0x24] + ldrb r0, [r2] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldr r2, =gUnknown_08300D38 + adds r0, r4, 0 + adds r0, 0xF0 + ldrh r0, [r0] + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x1] + strh r0, [r1, 0x26] + adds r1, r4, 0 + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + bl current_map_music_get + ldr r1, [r7] + adds r1, 0xF4 + strh r0, [r1] + ldr r0, =0x00000179 + bl current_map_music_set + bl _0807E400 + .pool +_0807D4A0: + ldr r5, [r7] + adds r6, r5, 0 + adds r6, 0xE6 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + ble _0807D4D4 + ldr r2, =0x02020630 + adds r0, r5, 0 + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x24] + adds r1, 0x3 + strh r1, [r0, 0x24] + ldrh r0, [r6] + subs r0, 0x3 + strh r0, [r6] + bl _0807E400 + .pool +_0807D4D4: + ldr r2, =0x02020630 + adds r0, r5, 0 + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0 + strh r1, [r0, 0x24] + strh r1, [r6] + adds r1, r5, 0 + adds r1, 0x94 + movs r0, 0xA + strh r0, [r1] + bl _0807E400 + .pool +_0807D4FC: + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EE942 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + ldr r4, =0x020322a0 + ldr r0, [r4] + adds r2, r0, 0 + adds r2, 0xF0 + ldrh r1, [r2] + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + beq _0807D52A + adds r0, r1, 0 + movs r1, 0 + bl cry_related +_0807D52A: + ldr r3, [r4] + adds r1, r3, 0 + adds r1, 0x94 + movs r2, 0 + movs r0, 0xB + bl _0807E252 + .pool +_0807D544: + ldr r1, [r7] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x50 + beq _0807D554 + bl _0807E400 +_0807D554: + adds r0, r1, 0 + adds r0, 0x8E + ldrb r0, [r0] + ldr r2, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r1, [r1, 0x5] + lsrs r1, 4 + movs r2, 0x2 + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0x14 + str r2, [sp, 0x8] + ldr r2, =0x000fffff + str r2, [sp, 0xC] + movs r2, 0x78 + movs r3, 0x20 + bl sub_807671C + ldr r1, [r7] + adds r1, 0xD2 + strb r0, [r1] + ldr r1, [r7] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EE959 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + bl _0807E400 + .pool +_0807D5B8: + ldr r5, =0x02020630 + ldr r0, [r7] + adds r0, 0xD2 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r4, r5, 0 + adds r4, 0x1C + adds r0, r4 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + beq _0807D5D8 + bl _0807E400 +_0807D5D8: + ldr r0, =gUnknown_08338D28 + movs r1, 0x78 + movs r2, 0x20 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0xD3 + strb r0, [r1] + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =sub_807E5D8 + str r1, [r0] + adds r2, 0xD2 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + bl RemoveObjectAndFreeTiles + ldr r1, [r7] + bl _0807E398 + .pool +_0807D624: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x14 + strh r1, [r0] + bl _0807E400 + .pool +_0807D648: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807D658 + bl _0807E400 +_0807D658: + movs r0, 0x4 + bl sub_807B62C + movs r0, 0 + movs r1, 0xFF + bl FillWindowPixelBuffer + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + bl _0807E394 + .pool +_0807D678: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0x10 + movs r3, 0 + bl _0807E390 +_0807D68A: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807D69A + bl _0807E400 +_0807D69A: + ldr r0, [r7] + adds r0, 0x94 + movs r1, 0x17 + strh r1, [r0] + bl _0807E400 + .pool +_0807D6AC: + ldr r4, =0x020322a0 + ldr r0, [r4] + adds r2, r0, 0 + adds r2, 0xEA + ldrh r1, [r2] + movs r0, 0x80 + lsls r0, 1 + cmp r1, r0 + bls _0807D6CC + adds r0, r1, 0 + subs r0, 0x34 + strh r0, [r2] + b _0807D6E6 + .pool +_0807D6CC: + movs r0, 0x1 + bl sub_807B62C + ldr r3, [r4] + adds r1, r3, 0 + adds r1, 0xEA + movs r2, 0 + movs r0, 0x80 + strh r0, [r1] + subs r1, 0x56 + movs r0, 0x7C + strh r0, [r1] + str r2, [r3, 0x64] +_0807D6E6: + ldr r0, =0x020322a0 + ldr r4, [r0] + bl _0807DFA8 + .pool +_0807D6F4: + ldr r1, [r7] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x14 + bhi _0807D704 + bl _0807E400 +_0807D704: + movs r0, 0x3 + bl sub_807B62C + ldr r0, =gUnknown_08338E8C + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0x91 + strb r0, [r1] + ldr r1, [r7] + bl _0807E398 + .pool +_0807D728: + ldr r2, =0x02020630 + ldr r0, [r7] + adds r0, 0x91 + 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 + blt _0807D748 + bl _0807E400 +_0807D748: + adds r0, r1, 0 + bl RemoveObjectAndFreeTiles + ldr r1, =0x00000452 + movs r0, 0x50 + bl SetGpuReg + movs r1, 0x82 + lsls r1, 3 + movs r0, 0x52 + bl SetGpuReg + ldr r0, =c3_08054588 + movs r1, 0x5 + bl CreateTask + ldr r1, [r7] + bl _0807E398 + .pool +_0807D77C: + ldr r0, =c3_08054588 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + beq _0807D78C + bl _0807E400 +_0807D78C: + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x1A + strh r1, [r0] + bl _0807E400 + .pool +_0807D7A4: + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0xE0 + ldrh r1, [r0] + subs r1, 0x1 + strh r1, [r0] + lsls r1, 16 + movs r0, 0x9E + lsls r0, 17 + cmp r1, r0 + beq _0807D7BE + bl _0807E400 +_0807D7BE: + adds r1, r2, 0 + bl _0807E398 +_0807D7C4: + ldr r0, =gUnknown_08338D88 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0x3 + bl AddObjectToFront + ldr r4, =0x020322a0 + ldr r1, [r4] + adds r1, 0x90 + strb r0, [r1] + ldr r5, =0x02020630 + ldr r0, [r4] + adds r0, 0x90 + 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_807AA4C + str r1, [r0] + ldr r0, =gUnknown_08338DC8 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r4] + adds r1, 0x91 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x1 + bl StartObjectImageAnim + ldr r1, [r4] + bl _0807E398 + .pool +_0807D830: + ldr r2, [r7] + adds r1, r2, 0 + adds r1, 0xE0 + ldrh r0, [r1] + subs r0, 0x3 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA6 + bne _0807D84A + subs r1, 0x4C + movs r0, 0xC8 + strh r0, [r1] +_0807D84A: + ldr r1, =0x00001241 + movs r0, 0 + bl SetGpuReg + bl _0807E400 + .pool +_0807D85C: + ldr r2, =0x02020630 + ldr r4, [r7] + adds r3, r4, 0 + adds r3, 0x90 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + subs r1, 0x2 + strh r1, [r0, 0x22] + adds r0, r4, 0 + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x22] + subs r1, 0x2 + strh r1, [r0, 0x22] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r2, 0x22 + ldrsh r1, [r0, r2] + movs r0, 0x8 + negs r0, r0 + cmp r1, r0 + blt _0807D8A2 + bl _0807E400 +_0807D8A2: + adds r1, r4, 0 + adds r1, 0x94 + movs r0, 0x1D + strh r0, [r1] + bl _0807E400 + .pool +_0807D8B4: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x1E + strh r1, [r0] + bl _0807E400 + .pool +_0807D8D8: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807D8E8 + bl _0807E400 +_0807D8E8: + ldr r0, [r7] + adds r0, 0x90 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + movs r0, 0x2 + bl sub_807B62C + ldr r1, [r7] + bl _0807E398 + .pool +_0807D924: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r5, =gUnknown_08338DC8 + adds r0, r5, 0 + movs r1, 0x6F + movs r2, 0xAA + movs r3, 0 + bl AddObjectToFront + ldr r4, =0x020322a0 + ldr r1, [r4] + adds r1, 0x90 + strb r0, [r1] + movs r2, 0xA + negs r2, r2 + adds r0, r5, 0 + movs r1, 0x81 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r4] + adds r1, 0x91 + strb r0, [r1] + ldr r1, [r4] + bl _0807E398 + .pool +_0807D970: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0807D98E + movs r0, 0x2E + bl audio_play + ldr r0, =0x020322a0 + ldr r1, [r0] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0807D98E: + ldr r3, =0x02020630 + ldr r0, =0x020322a0 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x90 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x26] + subs r1, 0x3 + strh r1, [r0, 0x26] + adds r2, 0x91 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0, 0x26] + adds r1, 0x3 + strh r1, [r0, 0x26] + bl _0807E400 + .pool +_0807D9CC: + ldr r5, =0x02020630 + ldr r4, [r7] + adds r2, r4, 0 + adds r2, 0x90 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r0, 0x26] + subs r1, 0x3 + strh r1, [r0, 0x26] + adds r6, r4, 0 + adds r6, 0x91 + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r0, 0x26] + adds r1, 0x3 + strh r1, [r0, 0x26] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r3, r0, r5 + movs r0, 0x26 + ldrsh r1, [r3, r0] + movs r0, 0x5A + negs r0, r0 + cmp r1, r0 + ble _0807DA12 + bl _0807E400 +_0807DA12: + movs r2, 0x1 + strh r2, [r3, 0x30] + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + strh r2, [r0, 0x30] + adds r1, r4, 0 + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + ldr r0, =c3_0805465C + b _0807DC5A + .pool +_0807DA38: + ldr r2, =0x0000ffff + movs r0, 0x8 + movs r1, 0x10 + bl sub_80A2A20 + bl _0807E394 + .pool +_0807DA4C: + ldr r2, =0x0000ffff + movs r0, 0x8 + movs r1, 0x10 + bl sub_80A2A20 + bl _0807E394 + .pool +_0807DA60: + ldr r2, =0x0000ffff + movs r0, 0x8 + movs r1, 0x10 + bl sub_80A2A20 + bl _0807E394 + .pool +_0807DA74: + ldr r5, =0x020322a0 + ldr r0, [r5] + adds r0, 0xF0 + ldrh r0, [r0] + bl sub_806E840 + lsls r0, 24 + cmp r0, 0 + bne _0807DAEC + ldr r4, =0x02020630 + ldr r2, [r5] + adds r2, 0x8E + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x10 + adds r0, r1 + ldr r1, =gUnknown_08338ECC + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x1] + movs r2, 0x3 + orrs r1, r2 + strb r1, [r0, 0x1] + ldr r0, [r5] + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0 + movs r2, 0x3 + movs r3, 0x3 + bl CalcVecFromObjectCenterToObjectUpperLeft + ldr r0, [r5] + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0 + bl StartObjectRotScalAnim + b _0807DB02 + .pool +_0807DAEC: + ldr r0, [r5] + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02020630 + adds r0, r1 + movs r1, 0 + bl StartObjectRotScalAnim +_0807DB02: + ldr r5, =0x020322a0 + ldr r0, [r5] + adds r0, 0x8F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + movs r1, 0 + bl StartObjectRotScalAnim + ldr r2, [r5] + adds r3, r2, 0 + adds r3, 0x8E + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x28 + strh r1, [r0, 0x20] + adds r2, 0x8F + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xC8 + strh r1, [r0, 0x20] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0xC0 + strh r1, [r0, 0x22] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldr r1, =0x0000ffe0 + strh r1, [r0, 0x22] + ldrb r0, [r3] + 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] + adds r0, 0x8F + ldrb r1, [r0] + 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] + ldr r1, [r5] + bl _0807E398 + .pool +_0807DB9C: + ldr r4, =0x02020630 + ldr r2, [r7] + adds r3, r2, 0 + adds r3, 0x8E + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x26] + subs r1, 0x3 + movs r5, 0 + strh r1, [r0, 0x26] + adds r2, 0x8F + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x26] + adds r1, 0x3 + strh r1, [r0, 0x26] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x26] + adds r0, 0xA3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bhi _0807DBE4 + movs r0, 0x2D + bl audio_play +_0807DBE4: + ldr r2, [r7] + adds r3, r2, 0 + adds r3, 0x8E + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r6, 0x26 + ldrsh r1, [r0, r6] + movs r0, 0xDE + negs r0, r0 + cmp r1, r0 + blt _0807DC04 + bl _0807E400 +_0807DC04: + adds r0, r2, 0 + adds r0, 0x90 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r5, [r0, 0x30] + adds r0, r2, 0 + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r5, [r0, 0x30] + adds r1, r2, 0 + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + ldrb r1, [r3] + 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, [r7] + adds r0, 0x8F + ldrb r1, [r0] + 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, =sub_807F39C +_0807DC5A: + movs r1, 0x5 + bl CreateTask + b _0807E400 + .pool +_0807DC6C: + ldr r4, =0x02020630 + ldr r2, [r7] + adds r3, r2, 0 + adds r3, 0x90 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x26] + subs r1, 0x3 + strh r1, [r0, 0x26] + adds r2, 0x91 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrh r1, [r0, 0x26] + adds r1, 0x3 + strh r1, [r0, 0x26] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r2, 0x26 + ldrsh r1, [r0, r2] + movs r0, 0xDE + negs r0, r0 + cmp r1, r0 + ble _0807DCAE + b _0807E400 +_0807DCAE: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, [r7] + adds r2, r1, 0 + adds r2, 0x94 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + adds r1, 0x90 + ldrb r1, [r1] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + b _0807E400 + .pool +_0807DCF4: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807DD02 + b _0807E400 +_0807DD02: + ldr r1, [r7] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + movs r0, 0x1 + bl sub_807B62C + ldr r0, [r7] + adds r0, 0xE0 + movs r1, 0xA6 + strh r1, [r0] + movs r0, 0x3 + bl sub_807B62C + ldr r0, [r7] + adds r0, 0xE4 + movs r1, 0xCE + lsls r1, 1 + strh r1, [r0] + ldr r0, =gUnknown_08338D88 + movs r4, 0x14 + negs r4, r4 + movs r1, 0x78 + adds r2, r4, 0 + movs r3, 0x3 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0x90 + strb r0, [r1] + ldr r5, =0x02020630 + ldr r0, [r7] + adds r0, 0x90 + 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_807AA4C + str r1, [r0] + ldr r0, =gUnknown_08338DC8 + movs r1, 0x78 + adds r2, r4, 0 + movs r3, 0 + bl AddObjectToFront + ldr r1, [r7] + adds r1, 0x91 + strb r0, [r1] + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + movs r1, 0x1 + bl StartObjectImageAnim + b _0807E400 + .pool +_0807DD94: + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + str r0, [sp] + adds r0, r1, 0 + movs r2, 0x10 + movs r3, 0 + b _0807E390 +_0807DDA4: + movs r1, 0x92 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807DDBC + b _0807E400 +_0807DDBC: + b _0807E394 + .pool +_0807DDC4: + ldr r2, =0x02020630 + ldr r4, [r7] + adds r3, r4, 0 + adds r3, 0x90 + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + adds r1, 0x4 + strh r1, [r0, 0x26] + adds r0, r4, 0 + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r1, [r0, 0x26] + adds r1, 0x4 + strh r1, [r0, 0x26] + ldrb r1, [r3] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r6, 0x26 + ldrsh r1, [r0, r6] + movs r2, 0x22 + ldrsh r0, [r0, r2] + adds r1, r0 + cmp r1, 0x40 + beq _0807DE0A + b _0807E400 +_0807DE0A: + adds r0, r4, 0 + adds r0, 0x94 + movs r1, 0x90 + strh r1, [r0] + movs r0, 0 + str r0, [r4, 0x64] + b _0807E400 + .pool +_0807DE1C: + movs r1, 0xB2 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r4, =0x020322a0 + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0xE0 + ldrh r0, [r1] + adds r0, 0x3 + strh r0, [r1] + adds r1, 0x4 + ldrh r0, [r1] + adds r0, 0x3 + strh r0, [r1] + ldr r0, [r2, 0x64] + adds r0, 0x1 + str r0, [r2, 0x64] + cmp r0, 0xA + bne _0807DE60 + ldr r0, =c3_08054588 + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x1 + strh r0, [r1, 0xC] +_0807DE60: + ldr r1, [r4] + adds r3, r1, 0 + adds r3, 0xE0 + movs r6, 0 + ldrsh r0, [r3, r6] + movs r2, 0x9E + lsls r2, 1 + cmp r0, r2 + bgt _0807DE74 + b _0807E400 +_0807DE74: + strh r2, [r3] + b _0807E398 + .pool +_0807DE84: + ldr r0, [r7] + adds r0, 0x90 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r0, [r7] + adds r0, 0x91 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r3, [r7] + adds r2, r3, 0 + adds r2, 0x94 + ldrh r0, [r2] + adds r0, 0x1 + movs r1, 0 + strh r0, [r2] + str r1, [r3, 0x64] + b _0807E400 + .pool +_0807DEC0: + ldr r0, =c3_08054588 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + beq _0807DED0 + b _0807E400 +_0807DED0: + ldr r0, =0x020322a0 + ldr r2, [r0] + adds r1, r2, 0 + adds r1, 0x94 + movs r0, 0x2E + strh r0, [r1] + str r3, [r2, 0x64] + b _0807E400 + .pool +_0807DEE8: + ldr r1, [r7] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0xA + beq _0807DEF6 + b _0807E400 +_0807DEF6: + b _0807E398 +_0807DEF8: + ldr r1, [r7] + adds r5, r1, 0 + adds r5, 0xE0 + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + lsls r0, 16 + asrs r0, 16 + movs r6, 0xAE + lsls r6, 1 + cmp r0, r6 + bgt _0807DF12 + b _0807E400 +_0807DF12: + strh r6, [r5] + b _0807E398 +_0807DF16: + ldr r0, =gUnknown_08338E74 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0 + bl AddObjectToFront + ldr r2, =0x020322a0 + ldr r1, [r2] + adds r1, 0x91 + strb r0, [r1] + ldr r0, [r2] + adds r0, 0x94 + movs r1, 0x32 + strh r1, [r0] + b _0807E400 + .pool +_0807DF3C: + ldr r2, =0x02020630 + ldr r0, [r7] + adds r0, 0x91 + 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 + blt _0807DF5A + b _0807E400 +_0807DF5A: + adds r0, r1, 0 + bl RemoveObjectAndFreeTiles + movs r0, 0x6 + bl sub_807B62C + ldr r1, [r7] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + movs r0, 0x9F + bl audio_play + b _0807E400 + .pool +_0807DF7C: + ldr r1, [r7] + adds r2, r1, 0 + adds r2, 0xEA + ldrh r3, [r2] + ldr r0, =0x000003ff + cmp r3, r0 + bhi _0807DF98 + adds r0, r3, 0 + adds r0, 0x34 + strh r0, [r2] + b _0807DFA6 + .pool +_0807DF98: + movs r0, 0x80 + lsls r0, 3 + strh r0, [r2] + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_0807DFA6: + ldr r4, [r7] +_0807DFA8: + adds r0, r4, 0 + adds r0, 0xEA + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 8 + bl __divsi3 + adds r4, 0xE8 + strh r0, [r4] + b _0807E400 +_0807DFBC: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x3C + strh r1, [r0] + b _0807E400 + .pool +_0807DFDC: + ldr r4, =0x02037fd4 + ldrb r1, [r4, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807DFEA + b _0807E400 +_0807DFEA: + movs r0, 0x5 + bl sub_807B62C + movs r0, 0x7 + bl sub_807B62C + ldrb r0, [r4, 0x8] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r4, 0x8] + b _0807E394 + .pool +_0807E004: + ldr r2, =0x02037fd4 + ldrb r1, [r2, 0x8] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2, 0x8] + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + b _0807E390 + .pool +_0807E020: + movs r1, 0xA2 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0807E038 + b _0807E400 +_0807E038: + b _0807E394 + .pool +_0807E040: + ldr r0, =gUnknown_08338D28 + movs r2, 0x8 + negs r2, r2 + movs r1, 0x78 + movs r3, 0 + bl AddObjectToFront + ldr r5, =0x020322a0 + ldr r1, [r5] + adds r1, 0xD3 + movs r6, 0 + strb r0, [r1] + ldr r4, =0x02020630 + ldr r2, [r5] + adds r2, 0xD3 + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x4A + strh r1, [r0, 0x34] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r1 + ldr r1, =sub_807E6AC + str r1, [r0] + ldrb r1, [r2] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x1 + bl StartObjectImageAnim + ldr r0, [r5] + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0x2 + bl StartObjectRotScalAnim + ldr r0, [r5] + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r1, [r0, 0x5] + lsrs r1, 4 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + ldr r2, =0x0000ffff + movs r1, 0x10 + bl sub_80A2A20 + ldr r2, [r5] + adds r1, r2, 0 + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + str r6, [r2, 0x64] + b _0807E400 + .pool +_0807E0E8: + ldr r2, =0x02020630 + ldr r0, [r7] + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r1, [r0, 0x5] + lsrs r1, 4 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + ldr r1, =0x0000ffff + str r1, [sp] + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r1, [r7] + b _0807E398 + .pool +_0807E11C: + ldr r2, =0x02020630 + ldr r3, [r7] + adds r0, r3, 0 + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r2, 0x1C + adds r0, r2 + ldr r1, [r0] + ldr r0, =DummyObjectCallback + cmp r1, r0 + beq _0807E13A + b _0807E400 +_0807E13A: + adds r0, r3, 0 + adds r0, 0xF2 + ldrh r2, [r0] + lsls r0, r2, 3 + ldr r1, =gMonFrontPicTable + adds r0, r1 + ldr r1, =0x020244d4 + ldr r1, [r1] + ldr r1, [r1, 0x10] + ldr r3, [r3, 0x6C] + bl DecompressMonPic_DetectFrontOrBack_2 + ldr r1, [r7] + b _0807E398 + .pool +_0807E168: + ldr r4, =0x02020630 + ldr r2, [r7] + adds r6, r2, 0 + adds r6, 0x8F + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r5, 0 + movs r1, 0x78 + strh r1, [r0, 0x20] + ldrb r0, [r6] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldr r3, =gUnknown_08300D38 + adds r2, 0xF2 + ldrh r0, [r2] + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x1] + adds r0, 0x3C + strh r0, [r1, 0x22] + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r5, [r0, 0x24] + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + strh r5, [r0, 0x26] + ldrb r1, [r6] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + movs r1, 0 + bl StartObjectImageAnim + ldr r3, [r7] + adds r0, r3, 0 + adds r0, 0x8F + ldrb r0, [r0] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r4 + ldrb r1, [r1, 0x5] + lsrs r1, 4 + movs r2, 0x2 + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0x14 + str r2, [sp, 0x8] + ldr r2, =0x000fffff + str r2, [sp, 0xC] + adds r3, 0xF2 + ldrh r2, [r3] + str r2, [sp, 0x10] + movs r2, 0x78 + movs r3, 0x54 + bl sub_8076438 + ldr r0, [r7] + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_free_rotscale_entry + ldr r0, [r7] + adds r0, 0xD3 + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r1, [r7] + b _0807E398 + .pool +_0807E228: + movs r1, 0xAA + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EE966 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + ldr r0, =0x020322a0 + ldr r3, [r0] + adds r1, r3, 0 + adds r1, 0x94 + movs r2, 0 + movs r0, 0xA7 +_0807E252: + strh r0, [r1] + str r2, [r3, 0x64] + b _0807E400 + .pool +_0807E264: + ldr r3, [r7] + ldr r0, [r3, 0x64] + adds r0, 0x1 + str r0, [r3, 0x64] + cmp r0, 0x3C + bhi _0807E272 + b _0807E400 +_0807E272: + adds r0, r3, 0 + adds r0, 0x94 + movs r2, 0 + ldr r1, =0x0000010b + strh r1, [r0] + str r2, [r3, 0x64] + b _0807E400 + .pool +_0807E284: + bl sub_80A3678 + lsls r0, 24 + cmp r0, 0 + bne _0807E290 + b _0807E400 +_0807E290: + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0x44 + strh r1, [r0] + b _0807E400 + .pool +_0807E2A0: + ldr r1, [r7] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0xA + bne _0807E2B2 + ldr r0, =0x00000173 + bl fanfare_play +_0807E2B2: + ldr r1, [r7] + ldr r0, [r1, 0x64] + cmp r0, 0xFA + beq _0807E2BC + b _0807E400 +_0807E2BC: + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + movs r5, 0 + strh r0, [r1] + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EE977 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + ldr r0, [r7] + str r5, [r0, 0x64] + b _0807E400 + .pool +_0807E2EC: + ldr r1, [r7] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x3C + beq _0807E2FA + b _0807E400 +_0807E2FA: + b _0807E398 +_0807E2FC: + bl sub_807F14C + b _0807E394 +_0807E302: + ldr r2, [r7] + adds r0, r2, 0 + adds r0, 0xEE + ldrb r0, [r0] + cmp r0, 0 + beq _0807E312 + movs r0, 0x1 + b _0807E402 +_0807E312: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0807E400 + adds r1, r2, 0 + b _0807E398 + .pool +_0807E328: + ldr r0, =0x020375e2 + ldrb r0, [r0] + movs r1, 0 + bl sub_807B4D0 + ldr r1, =0x030061e8 + ldr r0, =sub_807B60C + str r0, [r1] + ldr r7, =0x02032298 + ldrb r0, [r7] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + movs r1, 0x1 + movs r2, 0 + bl GetEvolutionTargetSpecies + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _0807E394 + ldrb r3, [r7] + adds r0, r3, 0 + muls r0, r6 + adds r0, r5 + ldr r1, =0x020322a0 + ldr r1, [r1] + adds r1, 0x8F + ldrb r2, [r1] + adds r1, r4, 0 + bl sub_813E1D4 + b _0807E394 + .pool +_0807E384: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 +_0807E390: + bl pal_fade_maybe +_0807E394: + ldr r0, =0x020322a0 + ldr r1, [r0] +_0807E398: + adds r1, 0x94 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _0807E400 + .pool +_0807E3A8: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0807E400 + ldr r0, [r7] + adds r0, 0xF4 + ldrh r0, [r0] + bl current_map_music_set + ldr r0, [r7] + cmp r0, 0 + beq _0807E3F6 + bl FreeAllWindowBuffers + movs r0, 0x3 + bl GetBgTilemapBuffer + bl Free + movs r0, 0x1 + bl GetBgTilemapBuffer + bl Free + movs r0, 0 + bl GetBgTilemapBuffer + bl Free + bl sub_805F094 + ldr r0, [r7] + bl Free + str r4, [r7] +_0807E3F6: + ldr r0, =c2_exit_to_overworld_2_switch + bl SetMainCallback2 + bl sub_807E784 +_0807E400: + movs r0, 0 +_0807E402: + add sp, 0x14 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_807CFC8 + + thumb_func_start c2_08053788 +c2_08053788: @ 807E414 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _0807E434 + cmp r0, 0x4 + beq _0807E444 + b _0807E4B4 + .pool +_0807E434: + movs r0, 0x4 + strb r0, [r1] + ldr r1, =0x03002700 + movs r0, 0x1 + b _0807E4B2 + .pool +_0807E444: + ldr r0, =0x030061e8 + ldr r1, =sub_807EB50 + mov r8, r1 + str r1, [r0] + ldr r7, =0x02032298 + ldrb r0, [r7] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + movs r1, 0x1 + movs r2, 0 + bl GetEvolutionTargetSpecies + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _0807E494 + ldrb r3, [r7] + adds r0, r3, 0 + muls r0, r6 + adds r0, r5 + ldr r1, =0x020322a0 + ldr r1, [r1] + adds r1, 0x8F + ldrb r2, [r1] + adds r1, r4, 0 + bl sub_813E1D4 + b _0807E4AE + .pool +_0807E494: + bl sub_8077260 + cmp r0, 0 + beq _0807E4A8 + ldr r0, =sub_807F464 + bl SetMainCallback2 + b _0807E4AE + .pool +_0807E4A8: + mov r0, r8 + bl SetMainCallback2 +_0807E4AE: + ldr r1, =0x02032298 + movs r0, 0xFF +_0807E4B2: + strb r0, [r1] +_0807E4B4: + bl sub_800B33C + lsls r0, 24 + cmp r0, 0 + bne _0807E4C2 + bl RunTasks +_0807E4C2: + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end c2_08053788 + + thumb_func_start sub_807E4DC +sub_807E4DC: @ 807E4DC + push {r4-r6,lr} + bl sub_807ACDC + bl sub_800A550 + lsls r0, 24 + lsrs r5, r0, 24 + movs r6, 0x1 + adds r0, r5, 0 + ands r0, r6 + cmp r0, 0 + beq _0807E51A + ldr r4, =0x020223c4 + ldrh r1, [r4] + ldr r0, =0x0000dcba + cmp r1, r0 + bne _0807E504 + ldr r0, =c2_08053788 + bl SetMainCallback2 +_0807E504: + ldrh r1, [r4] + ldr r0, =0x0000abcd + cmp r1, r0 + bne _0807E514 + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x72 + strb r6, [r0] +_0807E514: + movs r0, 0 + bl sub_800A5EC +_0807E51A: + movs r0, 0x2 + ands r0, r5 + cmp r0, 0 + beq _0807E542 + ldr r0, =0x020223c4 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + ldrh r1, [r0] + ldr r0, =0x0000abcd + cmp r1, r0 + bne _0807E53C + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x73 + movs r1, 0x1 + strb r1, [r0] +_0807E53C: + movs r0, 0x1 + bl sub_800A5EC +_0807E542: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807E4DC + + thumb_func_start sub_807E55C +sub_807E55C: @ 807E55C + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x2E + ldrsh r0, [r5, r1] + movs r1, 0xA + bl __divsi3 + ldrh r4, [r5, 0x22] + adds r4, r0 + strh r4, [r5, 0x22] + ldrh r0, [r5, 0x30] + ldrh r2, [r5, 0x38] + adds r0, r2 + strh r0, [r5, 0x38] + movs r1, 0x38 + ldrsh r0, [r5, r1] + movs r1, 0xA + bl __divsi3 + strh r0, [r5, 0x20] + lsls r4, 16 + asrs r4, 16 + cmp r4, 0x4C + ble _0807E5AA + movs r0, 0x4C + strh r0, [r5, 0x22] + movs r2, 0x2E + ldrsh r1, [r5, r2] + movs r2, 0x32 + ldrsh r0, [r5, r2] + muls r0, r1 + negs r0, r0 + movs r1, 0x64 + bl __divsi3 + strh r0, [r5, 0x2E] + ldrh r0, [r5, 0x34] + adds r0, 0x1 + strh r0, [r5, 0x34] +_0807E5AA: + movs r1, 0x20 + ldrsh r0, [r5, r1] + cmp r0, 0x78 + bne _0807E5B6 + movs r0, 0 + strh r0, [r5, 0x30] +_0807E5B6: + ldrh r0, [r5, 0x36] + ldrh r2, [r5, 0x2E] + adds r0, r2 + strh r0, [r5, 0x2E] + movs r1, 0x34 + ldrsh r0, [r5, r1] + cmp r0, 0x4 + bne _0807E5CE + movs r0, 0x1 + strh r0, [r5, 0x3C] + ldr r0, =DummyObjectCallback + str r0, [r5, 0x1C] +_0807E5CE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807E55C + + thumb_func_start sub_807E5D8 +sub_807E5D8: @ 807E5D8 + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r1, =gUnknown_08339024 + movs r2, 0x2E + ldrsh r0, [r4, r2] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r1, [r4, 0x26] + adds r0, r1 + strh r0, [r4, 0x26] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0x16 + bne _0807E600 + movs r0, 0x38 + bl audio_play +_0807E600: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2C + bne _0807E636 + movs r0, 0x8C + bl audio_play + ldr r0, =sub_807E64C + str r0, [r4, 0x1C] + movs r0, 0 + strh r0, [r4, 0x2E] + ldrb r1, [r4, 0x5] + lsrs r1, 4 + adds r1, 0x10 + movs r0, 0x1 + lsls r0, r1 + movs r1, 0x1 + negs r1, r1 + ldr r2, =0x0000ffff + str r2, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe +_0807E636: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807E5D8 + + thumb_func_start sub_807E64C +sub_807E64C: @ 807E64C + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x30 + ldrsh r0, [r4, r1] + cmp r0, 0x14 + bne _0807E660 + adds r0, r4, 0 + movs r1, 0x1 + bl StartObjectRotScalAnim +_0807E660: + ldrh r0, [r4, 0x30] + adds r0, 0x1 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x14 + ble _0807E69E + ldr r1, =gUnknown_08339024 + movs r2, 0x2E + ldrsh r0, [r4, r2] + adds r0, r1 + movs r1, 0 + ldrsb r1, [r0, r1] + ldrh r0, [r4, 0x26] + subs r0, r1 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x17 + bne _0807E69E + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + ldr r0, =0x020322a0 + ldr r0, [r0] + adds r0, 0x94 + movs r1, 0xE + strh r1, [r0] +_0807E69E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807E64C + + thumb_func_start sub_807E6AC +sub_807E6AC: @ 807E6AC + push {r4,lr} + adds r4, r0, 0 + ldrh r2, [r4, 0x32] + movs r1, 0x32 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0807E6DC + ldrh r0, [r4, 0x22] + adds r0, 0x4 + strh r0, [r4, 0x22] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x34 + ldrsh r1, [r4, r3] + cmp r0, r1 + ble _0807E72C + adds r0, r2, 0x1 + strh r0, [r4, 0x32] + movs r0, 0x16 + strh r0, [r4, 0x2E] + movs r0, 0x38 + bl audio_play + b _0807E72C +_0807E6DC: + movs r1, 0x2E + ldrsh r0, [r4, r1] + cmp r0, 0x42 + bne _0807E6EA + movs r0, 0x39 + bl audio_play +_0807E6EA: + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0x5C + bne _0807E6F8 + movs r0, 0x3A + bl audio_play +_0807E6F8: + movs r3, 0x2E + ldrsh r0, [r4, r3] + cmp r0, 0x6B + bne _0807E706 + movs r0, 0x3B + bl audio_play +_0807E706: + ldr r1, =gUnknown_08339024 + movs r2, 0x2E + ldrsh r0, [r4, r2] + adds r0, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r3, [r4, 0x26] + adds r0, r3 + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6C + bne _0807E72C + ldr r0, =DummyObjectCallback + str r0, [r4, 0x1C] +_0807E72C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807E6AC + + thumb_func_start sub_807E73C +sub_807E73C: @ 807E73C + push {r4-r6,lr} + ldr r0, =0x020375e0 + ldrh r0, [r0] + lsls r4, r0, 4 + subs r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_08338ED0 + adds r4, r0 + ldr r0, =0x02021cc4 + ldrh r1, [r4, 0x38] + movs r6, 0xB + muls r1, r6 + ldr r5, =gSpeciesNames + adds r1, r5 + bl CopyString + ldr r0, =0x02021dc4 + ldrh r1, [r4, 0xC] + muls r1, r6 + adds r1, r5 + bl CopyString + ldrh r0, [r4, 0x38] + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_807E73C + + thumb_func_start sub_807E784 +sub_807E784: @ 807E784 + push {r4,lr} + sub sp, 0x20 + ldr r0, =0x020375e0 + ldrh r0, [r0] + lsls r4, r0, 4 + subs r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_08338ED0 + adds r4, r0 + ldr r0, =0x020375e2 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x2 + mov r2, sp + bl pokemon_getattr + ldr r0, =0x02021cc4 + mov r1, sp + bl CopyString_Limit10 + ldr r0, =0x02021dc4 + ldrh r2, [r4, 0xC] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + add sp, 0x20 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807E784 + + thumb_func_start sub_807E7E8 +sub_807E7E8: @ 807E7E8 + push {r4-r7,lr} + sub sp, 0x38 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, r1, 4 + subs r2, r1 + lsls r2, 2 + ldr r1, =gUnknown_08338ED0 + adds r5, r2, r1 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x38 + bl pokemon_getattr + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + add r4, sp, 0x34 + movs r0, 0xFE + strb r0, [r4] + ldr r6, =0x02024744 + ldrh r1, [r5, 0xC] + movs r3, 0x1 + str r3, [sp] + ldr r0, [r5, 0x24] + str r0, [sp, 0x4] + str r3, [sp, 0x8] + ldr r0, [r5, 0x18] + str r0, [sp, 0xC] + adds r0, r6, 0 + movs r3, 0x20 + bl create_pokemon_set_level + adds r2, r5, 0 + adds r2, 0xE + adds r0, r6, 0 + movs r1, 0x27 + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0xF + adds r0, r6, 0 + movs r1, 0x28 + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x10 + adds r0, r6, 0 + movs r1, 0x29 + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x11 + adds r0, r6, 0 + movs r1, 0x2A + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x12 + adds r0, r6, 0 + movs r1, 0x2B + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x13 + adds r0, r6, 0 + movs r1, 0x2C + bl pokemon_setattr + adds r0, r6, 0 + movs r1, 0x2 + adds r2, r5, 0 + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x2B + adds r0, r6, 0 + movs r1, 0x7 + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x36 + adds r0, r6, 0 + movs r1, 0x31 + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x14 + adds r0, r6, 0 + movs r1, 0x2E + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x1D + adds r0, r6, 0 + movs r1, 0x17 + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x1E + adds r0, r6, 0 + movs r1, 0x18 + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x1C + adds r0, r6, 0 + movs r1, 0x16 + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x1F + adds r0, r6, 0 + movs r1, 0x21 + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x20 + adds r0, r6, 0 + movs r1, 0x2F + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x37 + adds r0, r6, 0 + movs r1, 0x30 + bl pokemon_setattr + adds r0, r6, 0 + movs r1, 0x23 + adds r2, r4, 0 + bl pokemon_setattr + mov r4, sp + adds r4, 0x35 + movs r0, 0 + strb r0, [r4] + ldrh r0, [r5, 0x28] + cmp r0, 0 + beq _0807E960 + bl itemid_is_mail + lsls r0, 24 + cmp r0, 0 + beq _0807E954 + add r0, sp, 0x10 + adds r1, r5, 0 + bl sub_807E974 + ldr r0, =0x020321c0 + add r1, sp, 0x10 + ldm r1!, {r2,r3,r7} + stm r0!, {r2,r3,r7} + ldm r1!, {r2,r3,r7} + stm r0!, {r2,r3,r7} + ldm r1!, {r2,r3,r7} + stm r0!, {r2,r3,r7} + adds r0, r6, 0 + movs r1, 0x40 + adds r2, r4, 0 + bl pokemon_setattr + adds r2, r5, 0 + adds r2, 0x28 + adds r0, r6, 0 + movs r1, 0xC + bl pokemon_setattr + b _0807E960 + .pool +_0807E954: + adds r2, r5, 0 + adds r2, 0x28 + adds r0, r6, 0 + movs r1, 0xC + bl pokemon_setattr +_0807E960: + ldr r0, =0x02024744 + bl pokemon_calc_effective_stats + add sp, 0x38 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807E7E8 + + thumb_func_start sub_807E974 +sub_807E974: @ 807E974 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + ldr r2, =gUnknown_08338FC0 + adds r0, r6, 0 + adds r0, 0x2A + ldrb r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r2, r0, r2 + adds r1, r5, 0 + movs r3, 0x8 +_0807E98E: + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _0807E98E + adds r4, r5, 0 + adds r4, 0x12 + adds r1, r6, 0 + adds r1, 0x2B + adds r0, r4, 0 + bl CopyString + adds r0, r4, 0 + movs r1, 0 + bl sub_81DB4DC + ldr r1, [r6, 0x18] + lsrs r0, r1, 24 + strb r0, [r5, 0x1A] + lsrs r0, r1, 16 + strb r0, [r5, 0x1B] + lsrs r0, r1, 8 + strb r0, [r5, 0x1C] + strb r1, [r5, 0x1D] + ldrh r0, [r6, 0xC] + strh r0, [r5, 0x1E] + ldrh r0, [r6, 0x28] + strh r0, [r5, 0x20] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807E974 + + thumb_func_start sub_807E9D4 +sub_807E9D4: @ 807E9D4 + push {r4-r6,lr} + ldr r6, =0x020375e2 + ldrh r0, [r6] + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _0807EA08 + ldrh r0, [r6] + muls r0, r5 + adds r0, r4 + movs r1, 0xB + bl pokemon_getattr + lsls r0, 16 + lsrs r0, 16 + b _0807EA0A + .pool +_0807EA08: + movs r0, 0 +_0807EA0A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_807E9D4 + + thumb_func_start sub_807EA10 +sub_807EA10: @ 807EA10 + push {lr} + ldr r0, =0x020375e2 + ldrb r0, [r0] + ldr r1, =0x020375e0 + ldrb r1, [r1] + bl sub_807E7E8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_807EA10 + + thumb_func_start sub_807EA2C +sub_807EA2C: @ 807EA2C + push {r4-r6,lr} + bl sub_807BBC8 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x1 + bne _0807EA96 + ldr r5, =0x020322a0 + ldr r0, [r5] + adds r0, 0x8E + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r4, =0x02020630 + adds r0, r4 + bl RemoveObjectAndFreeTiles + ldr r0, [r5] + adds r0, 0x8F + ldrb r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + bl obj_free_rotscale_entry + ldr r0, =0x02032298 + ldrb r4, [r0] + ldrb r0, [r0, 0x1] + movs r1, 0x6 + bl __umodsi3 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_807B4D0 + bl sub_8077260 + cmp r0, 0 + bne _0807EA90 + ldr r0, [r5] + adds r2, r0, 0 + adds r2, 0x74 + ldr r1, =0x0000abcd + strh r1, [r2] + adds r0, 0x93 + strb r6, [r0] +_0807EA90: + ldr r0, =sub_807EACC + bl SetMainCallback2 +_0807EA96: + bl sub_807B5B8 + bl sub_807E4DC + bl RunTasks + bl RunTextPrinters + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807EA2C + + thumb_func_start sub_807EACC +sub_807EACC: @ 807EACC + push {r4,lr} + bl sub_807ACDC + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8077260 + cmp r0, 0 + beq _0807EAEC + ldr r0, =c2_08053788 + bl SetMainCallback2 + b _0807EB2C + .pool +_0807EAEC: + bl sub_807E4DC + cmp r4, 0 + bne _0807EB2C + ldr r4, =0x020322a0 + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x72 + ldrh r1, [r0] + ldr r0, =0x00000101 + cmp r1, r0 + bne _0807EB2C + adds r1, r2, 0 + adds r1, 0x74 + ldr r0, =0x0000dcba + strh r0, [r1] + bl bitmask_all_link_players_but_self + lsls r0, 24 + lsrs r0, 24 + ldr r1, [r4] + adds r1, 0x74 + movs r2, 0x14 + bl link_0800A448 + ldr r0, [r4] + adds r0, 0x72 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x73 + strb r1, [r0] +_0807EB2C: + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807EACC + + thumb_func_start sub_807EB50 +sub_807EB50: @ 807EB50 + push {r4,lr} + sub sp, 0x4 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x65 + bls _0807EB66 + b _0807F03A +_0807EB66: + lsls r0, 2 + ldr r1, =_0807EB78 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807EB78: + .4byte _0807ED10 + .4byte _0807ED2C + .4byte _0807ED98 + .4byte _0807F03A + .4byte _0807EE78 + .4byte _0807EF3C + .4byte _0807EF64 + .4byte _0807EF7E + .4byte _0807EFA4 + .4byte _0807EFF0 + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807EE9C + .4byte _0807EEEC + .4byte _0807EF1A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807EDC0 + .4byte _0807EE1C + .4byte _0807EE38 + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807F03A + .4byte _0807ED44 + .4byte _0807ED7C +_0807ED10: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EF6D2 + b _0807EDA6 + .pool +_0807ED2C: + movs r0, 0 + bl sub_8077288 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x64 + b _0807EE88 + .pool +_0807ED44: + ldr r0, =0x020322a0 + ldr r3, [r0] + ldr r0, [r3, 0x64] + adds r0, 0x1 + str r0, [r3, 0x64] + cmp r0, 0xB4 + bls _0807ED60 + movs r1, 0x87 + lsls r1, 3 + adds r0, r2, r1 + movs r2, 0 + movs r1, 0x65 + strb r1, [r0] + str r2, [r3, 0x64] +_0807ED60: + bl sub_8077294 + cmp r0, 0 + bne _0807ED6A + b _0807F03A +_0807ED6A: + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + b _0807ED8E + .pool +_0807ED7C: + bl sub_8077294 + cmp r0, 0 + bne _0807ED86 + b _0807F03A +_0807ED86: + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 +_0807ED8E: + movs r1, 0x2 + strb r1, [r0] + b _0807F03A + .pool +_0807ED98: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + movs r0, 0x32 + strb r0, [r1] + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_082C8959 +_0807EDA6: + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + b _0807F03A + .pool +_0807EDC0: + bl InUnionRoom + cmp r0, 0 + bne _0807EDCE + movs r0, 0x15 + bl sav12_xor_increment +_0807EDCE: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _0807EDF6 + ldr r4, =0x020229e8 + bl link_get_multiplayer_id + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + adds r4, 0x4 + adds r1, r4 + ldr r1, [r1] + movs r0, 0x2 + bl sub_801B990 +_0807EDF6: + bl sub_8076D5C + bl sub_8153380 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 + ldrb r0, [r1] + adds r0, 0x1 + movs r2, 0 + strb r0, [r1] + b _0807EE8A + .pool +_0807EE1C: + ldr r0, =0x020322a0 + ldr r1, [r0] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x5 + beq _0807EE2C + b _0807F03A +_0807EE2C: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + b _0807EFE4 + .pool +_0807EE38: + bl sub_81533AC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _0807EE5C + bl sav2_gender2_inplace_and_xFE + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x4 + strb r1, [r0] + b _0807F03A + .pool +_0807EE5C: + ldr r0, =0x020322a0 + ldr r0, [r0] + str r1, [r0, 0x64] + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x33 + strb r1, [r0] + b _0807F03A + .pool +_0807EE78: + bl sub_81533E0 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x28 +_0807EE88: + strb r1, [r0] +_0807EE8A: + ldr r0, =0x020322a0 + ldr r0, [r0] + str r2, [r0, 0x64] + b _0807F03A + .pool +_0807EE9C: + ldr r4, =0x020322a0 + ldr r1, [r4] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x32 + bhi _0807EEAC + b _0807F03A +_0807EEAC: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _0807EED4 + bl GenerateRandomNumber + ldr r4, [r4] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1E + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + str r0, [r4, 0x64] + b _0807EEDA + .pool +_0807EED4: + ldr r1, [r4] + movs r0, 0 + str r0, [r1, 0x64] +_0807EEDA: + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x29 + strb r1, [r0] + b _0807F03A + .pool +_0807EEEC: + ldr r0, =0x020322a0 + ldr r1, [r0] + ldr r0, [r1, 0x64] + cmp r0, 0 + bne _0807EF14 + movs r0, 0x1 + bl sub_8077288 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x2A + strb r1, [r0] + b _0807F03A + .pool +_0807EF14: + subs r0, 0x1 + str r0, [r1, 0x64] + b _0807F03A +_0807EF1A: + bl sub_8077294 + cmp r0, 0 + bne _0807EF24 + b _0807F03A +_0807EF24: + bl sub_8153408 + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x5 + strb r1, [r0] + b _0807F03A + .pool +_0807EF3C: + ldr r0, =0x020322a0 + ldr r1, [r0] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x3C + bls _0807F03A + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0x2 + bl sub_8077288 + b _0807F03A + .pool +_0807EF64: + bl sub_8077294 + cmp r0, 0 + beq _0807F03A + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _0807EFDC +_0807EF7E: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0807F03A + movs r0, 0x3 + bl play_sound_effect + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _0807EFE4 + .pool +_0807EFA4: + bl sub_80A3258 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0807F03A + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _0807EFD8 + ldr r0, =0x030022c0 + ldr r1, [r0, 0x8] + ldr r0, =sub_80773AC + cmp r1, r0 + bne _0807EFD8 + movs r0, 0x3 + bl sub_8077288 + b _0807EFDC + .pool +_0807EFD8: + bl sub_800AC34 +_0807EFDC: + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_0807EFE4: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _0807F03A + .pool +_0807EFF0: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _0807F028 + ldr r1, [r2, 0x8] + ldr r0, =sub_80773AC + cmp r1, r0 + bne _0807F028 + bl sub_8077294 + cmp r0, 0 + beq _0807F03A + ldr r0, =0x03002700 + movs r1, 0 + strb r1, [r0] + ldr r0, =c2_080543C4 + bl SetMainCallback2 + b _0807F03A + .pool +_0807F028: + ldr r0, =0x03003124 + ldrb r1, [r0] + cmp r1, 0 + bne _0807F03A + ldr r0, =0x03002700 + strb r1, [r0] + ldr r0, =c2_080543C4 + bl SetMainCallback2 +_0807F03A: + bl sub_800B33C + lsls r0, 24 + cmp r0, 0 + bne _0807F048 + bl RunTasks +_0807F048: + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807EB50 + + thumb_func_start c2_080543C4 +c2_080543C4: @ 807F068 + push {r4,r5,lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0807F0BE + bl FreeAllWindowBuffers + movs r0, 0x3 + bl GetBgTilemapBuffer + bl Free + movs r0, 0x1 + bl GetBgTilemapBuffer + bl Free + movs r0, 0 + bl GetBgTilemapBuffer + bl Free + bl sub_805F094 + ldr r4, =0x020322a0 + ldr r0, [r4] + bl Free + str r5, [r4] + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0 + beq _0807F0B6 + bl sub_800E084 +_0807F0B6: + ldr r0, =0x030022c0 + ldr r0, [r0, 0x8] + bl SetMainCallback2 +_0807F0BE: + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end c2_080543C4 + + thumb_func_start sub_807F0E4 +sub_807F0E4: @ 807F0E4 + push {lr} + sub sp, 0x4 + bl script_env_2_enable + ldr r0, =sub_807F110 + movs r1, 0xA + bl CreateTask + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_807F0E4 + + thumb_func_start sub_807F110 +sub_807F110: @ 807F110 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0807F134 + ldr r0, =sub_807B270 + bl SetMainCallback2 + ldr r1, =0x03005dac + ldr r0, =sub_80AF168 + str r0, [r1] + adds r0, r4, 0 + bl DestroyTask +_0807F134: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807F110 + + thumb_func_start sub_807F14C +sub_807F14C: @ 807F14C + push {r4,r5,lr} + movs r5, 0 + movs r4, 0 +_0807F152: + ldr r0, =0x02032298 + ldrb r0, [r0, 0x1] + movs r1, 0x6 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x02024744 + adds r0, r1 + adds r1, r4, 0 + adds r1, 0x43 + bl pokemon_getattr + adds r0, r5, r0 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xB + bls _0807F152 + cmp r5, 0 + beq _0807F18A + ldr r0, =0x0000089b + bl FlagSet +_0807F18A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807F14C + + thumb_func_start sub_807F19C +sub_807F19C: @ 807F19C + push {lr} + bl sub_807B170 + pop {r0} + bx r0 + thumb_func_end sub_807F19C + + thumb_func_start sub_807F1A8 +sub_807F1A8: @ 807F1A8 + push {r4-r6,lr} + sub sp, 0x14 + adds r5, r0, 0 + adds r6, r1, 0 + adds r4, r2, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0xFF + bl FillWindowPixelBuffer + ldr r2, =0x020322a0 + ldr r0, [r2] + adds r0, 0xF6 + movs r3, 0 + movs r1, 0xF + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xF7 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xF8 + movs r1, 0x6 + strb r1, [r0] + str r3, [sp] + str r3, [sp, 0x4] + ldr r0, [r2] + adds r0, 0xF6 + str r0, [sp, 0x8] + lsls r4, 24 + asrs r4, 24 + str r4, [sp, 0xC] + str r6, [sp, 0x10] + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x2 + bl AddTextPrinterParametrized2 + adds r0, r5, 0 + movs r1, 0x3 + bl CopyWindowToVram + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807F1A8 + + thumb_func_start c3_08054588 +c3_08054588: @ 807F210 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + ldr r1, =gUnknown_08339090 + movs r2, 0 + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + ldrb r0, [r0] + lsls r1, r0, 4 + adds r2, r1, 0 + movs r3, 0x4 + ldrsh r0, [r4, r3] + cmp r0, 0 + bne _0807F254 + movs r0, 0x80 + lsls r0, 1 + cmp r1, r0 + beq _0807F25C + lsls r0, r1, 1 + ldr r1, =gUnknown_08337AA0 + adds r0, r1 + b _0807F25E + .pool +_0807F254: + movs r0, 0x80 + lsls r0, 1 + cmp r1, r0 + bne _0807F26C +_0807F25C: + ldr r0, =gUnknown_08337EA0 +_0807F25E: + movs r1, 0x30 + movs r2, 0x20 + bl gpu_pal_apply + b _0807F27A + .pool +_0807F26C: + lsls r0, r2, 1 + ldr r1, =gUnknown_08337CA0 + adds r0, r1 + movs r1, 0x30 + movs r2, 0x20 + bl gpu_pal_apply +_0807F27A: + ldr r0, =gUnknown_08339090 + movs r2, 0 + ldrsh r1, [r4, r2] + lsls r1, 1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + bne _0807F298 + movs r3, 0x2 + ldrsh r0, [r4, r3] + cmp r0, 0 + bne _0807F298 + movs r0, 0xC3 + bl audio_play +_0807F298: + movs r0, 0x2 + ldrsh r2, [r4, r0] + ldr r1, =gUnknown_08339090 + movs r3, 0 + ldrsh r0, [r4, r3] + lsls r0, 1 + adds r1, 0x1 + adds r0, r1 + ldrb r0, [r0] + cmp r2, r0 + bne _0807F2D8 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + movs r0, 0 + strh r0, [r4, 0x2] + movs r2, 0 + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _0807F2DE + adds r0, r5, 0 + bl DestroyTask + b _0807F2DE + .pool +_0807F2D8: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] +_0807F2DE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end c3_08054588 + + thumb_func_start c3_0805465C +c3_0805465C: @ 807F2E4 + 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, =0x03005e08 + adds r5, r0, r1 + movs r0, 0 + ldrsh r4, [r5, r0] + cmp r4, 0 + bne _0807F336 + ldr r2, =0x020322a0 + ldr r0, [r2] + adds r3, r0, 0 + adds r3, 0xFD + movs r1, 0x78 + strb r1, [r3] + adds r0, 0xFB + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xFC + strb r4, [r0] + ldr r0, [r2] + adds r0, 0xFE + movs r1, 0xA0 + strb r1, [r0] + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl SetGpuRegBits + movs r0, 0x4A + movs r1, 0x10 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x13 + bl SetGpuReg +_0807F336: + ldr r4, =0x020322a0 + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xFD + ldrb r1, [r1] + adds r0, 0xFB + ldrb r0, [r0] + lsls r0, 8 + orrs r1, r0 + movs r0, 0x40 + bl SetGpuReg + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xFE + ldrb r1, [r1] + adds r0, 0xFC + ldrb r0, [r0] + lsls r0, 8 + orrs r1, r0 + movs r0, 0x44 + bl SetGpuReg + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + ldr r1, [r4] + adds r1, 0xFB + ldrb r0, [r1] + subs r0, 0x5 + strb r0, [r1] + ldr r1, [r4] + adds r1, 0xFD + ldrb r0, [r1] + adds r0, 0x5 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0xFB + ldrb r0, [r0] + cmp r0, 0x4F + bhi _0807F38E + adds r0, r6, 0 + bl DestroyTask +_0807F38E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end c3_0805465C + + thumb_func_start sub_807F39C +sub_807F39C: @ 807F39C + 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, =0x03005e08 + adds r5, r0, r1 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _0807F3D8 + ldr r2, =0x020322a0 + ldr r0, [r2] + adds r0, 0xFB + movs r1, 0x50 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xFD + movs r1, 0xA0 + strb r1, [r0] + movs r0, 0x4A + movs r1, 0x10 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x13 + bl SetGpuReg +_0807F3D8: + ldr r4, =0x020322a0 + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xFD + ldrb r1, [r1] + adds r0, 0xFB + ldrb r0, [r0] + lsls r0, 8 + orrs r1, r0 + movs r0, 0x40 + bl SetGpuReg + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xFE + ldrb r1, [r1] + adds r0, 0xFC + ldrb r0, [r0] + lsls r0, 8 + orrs r1, r0 + movs r0, 0x44 + bl SetGpuReg + ldr r0, [r4] + adds r0, 0xFB + ldrb r0, [r0] + cmp r0, 0x78 + beq _0807F44C + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + ldr r1, [r4] + adds r1, 0xFB + ldrb r0, [r1] + adds r0, 0x5 + strb r0, [r1] + ldr r1, [r4] + adds r1, 0xFD + ldrb r0, [r1] + subs r0, 0x5 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0xFB + ldrb r0, [r0] + cmp r0, 0x73 + bls _0807F45C + ldr r2, =0x0000ffff + movs r0, 0x8 + movs r1, 0 + bl sub_80A2A20 + b _0807F45C + .pool +_0807F44C: + movs r1, 0x80 + lsls r1, 6 + movs r0, 0 + bl ClearGpuRegBits + adds r0, r6, 0 + bl DestroyTask +_0807F45C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_807F39C + + thumb_func_start sub_807F464 +sub_807F464: @ 807F464 + push {r4,r5,lr} + sub sp, 0x4 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0xC + bls _0807F47A + b _0807F70C +_0807F47A: + lsls r0, 2 + ldr r1, =_0807F48C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0807F48C: + .4byte _0807F4C0 + .4byte _0807F4E8 + .4byte _0807F500 + .4byte _0807F550 + .4byte _0807F570 + .4byte _0807F5AC + .4byte _0807F5D0 + .4byte _0807F620 + .4byte _0807F64E + .4byte _0807F66C + .4byte _0807F694 + .4byte _0807F6C4 + .4byte _0807F6F8 +_0807F4C0: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + movs r0, 0x1 + strb r0, [r1] + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085EF6D2 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + b _0807F70C + .pool +_0807F4E8: + movs r0, 0 + bl sub_8077288 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x2 + b _0807F5BC + .pool +_0807F500: + bl sub_8077294 + cmp r0, 0 + bne _0807F50A + b _0807F70C +_0807F50A: + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r5, 0 + movs r1, 0x3 + strb r1, [r0] + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_082C8959 + adds r0, r4, 0 + bl ExpandStringRefs + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807F1A8 + movs r0, 0x15 + bl sav12_xor_increment + bl sub_8153380 + ldr r0, =0x020322a0 + ldr r0, [r0] + str r5, [r0, 0x64] + b _0807F70C + .pool +_0807F550: + ldr r0, =0x020322a0 + ldr r1, [r0] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x5 + beq _0807F560 + b _0807F70C +_0807F560: + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + movs r0, 0x4 + strb r0, [r1] + b _0807F70C + .pool +_0807F570: + bl sub_81533AC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _0807F590 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x5 + strb r1, [r0] + b _0807F70C + .pool +_0807F590: + ldr r0, =0x020322a0 + ldr r0, [r0] + str r1, [r0, 0x64] + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x3 + strb r1, [r0] + b _0807F70C + .pool +_0807F5AC: + bl sub_81533E0 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x6 +_0807F5BC: + strb r1, [r0] + ldr r0, =0x020322a0 + ldr r0, [r0] + str r2, [r0, 0x64] + b _0807F70C + .pool +_0807F5D0: + ldr r4, =0x020322a0 + ldr r1, [r4] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0xA + bhi _0807F5E0 + b _0807F70C +_0807F5E0: + bl link_get_multiplayer_id + lsls r0, 24 + cmp r0, 0 + bne _0807F608 + bl GenerateRandomNumber + ldr r4, [r4] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1E + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + str r0, [r4, 0x64] + b _0807F60E + .pool +_0807F608: + ldr r1, [r4] + movs r0, 0 + str r0, [r1, 0x64] +_0807F60E: + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x7 + strb r1, [r0] + b _0807F70C + .pool +_0807F620: + ldr r0, =0x020322a0 + ldr r1, [r0] + ldr r0, [r1, 0x64] + cmp r0, 0 + bne _0807F648 + movs r0, 0x1 + bl sub_8077288 + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0x8 + strb r1, [r0] + b _0807F70C + .pool +_0807F648: + subs r0, 0x1 + str r0, [r1, 0x64] + b _0807F70C +_0807F64E: + bl sub_8077294 + cmp r0, 0 + beq _0807F70C + bl sub_8153408 + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x9 + strb r1, [r0] + b _0807F70C + .pool +_0807F66C: + ldr r0, =0x020322a0 + ldr r1, [r0] + ldr r0, [r1, 0x64] + adds r0, 0x1 + str r0, [r1, 0x64] + cmp r0, 0x3C + bls _0807F70C + movs r0, 0x87 + lsls r0, 3 + adds r1, r2, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r0, 0x2 + bl sub_8077288 + b _0807F70C + .pool +_0807F694: + bl sub_8077294 + cmp r0, 0 + beq _0807F70C + movs r0, 0x3 + bl play_sound_effect + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x030022c0 + movs r1, 0x87 + lsls r1, 3 + adds r0, r1 + movs r1, 0xB + strb r1, [r0] + b _0807F70C + .pool +_0807F6C4: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _0807F70C + bl sub_80A3258 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0807F70C + movs r0, 0x3 + bl sub_8077288 + ldr r0, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0xC + strb r1, [r0] + b _0807F70C + .pool +_0807F6F8: + bl sub_8077294 + cmp r0, 0 + beq _0807F70C + ldr r0, =0x03002700 + movs r1, 0 + strb r1, [r0] + ldr r0, =c2_080543C4 + bl SetMainCallback2 +_0807F70C: + bl sub_800B33C + lsls r0, 24 + cmp r0, 0 + bne _0807F71A + bl RunTasks +_0807F71A: + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_807F464 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/trader.s b/asm/trader.s new file mode 100644 index 000000000..87b0f2b1b --- /dev/null +++ b/asm/trader.s @@ -0,0 +1,558 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_81339F8 +sub_81339F8: @ 81339F8 + push {r4-r6,lr} + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x00002e28 + adds r5, r1, r0 + movs r2, 0 + movs r0, 0x2 + strb r0, [r5] + ldr r0, =0x00002e59 + adds r1, r0 + strb r2, [r1] + movs r4, 0 + ldr r6, =gUnknown_085B09E4 +_08133A12: + movs r0, 0xB + muls r0, r4 + adds r0, 0x5 + adds r0, r5, r0 + lsls r1, r4, 2 + adds r1, r6 + ldr r1, [r1] + bl CopyString + adds r1, r5, 0x1 + adds r1, r4 + ldr r0, =gUnknown_085B09F4 + adds r0, r4, r0 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r5, 0 + adds r0, 0x32 + adds r0, r4 + movs r1, 0x2 + strb r1, [r0] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _08133A12 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81339F8 + + thumb_func_start sub_8133A60 +sub_8133A60: @ 8133A60 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002e59 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_8133A60 + + thumb_func_start sub_8133A78 +sub_8133A78: @ 8133A78 + 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 r1, 3 + ldr r0, =0x03005e08 + adds r7, r1, r0 + ldr r0, =0x03005d8c + ldr r4, [r0] + ldr r0, =0x00002e28 + adds r0, r4 + mov r9, r0 + ldr r0, =gUnknown_085B09F8 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0xC] + str r1, [sp, 0x10] + ldr r1, =gUnknown_085EB7EA + movs r0, 0x1 + movs r2, 0 + bl GetStringWidth + adds r6, r0, 0 + ldr r1, =gUnknown_085E8D38 + movs r0, 0x1 + movs r2, 0 + bl GetStringWidth + mov r8, r0 + movs r5, 0 + ldr r0, =0x00002e29 + adds r4, r0 +_08133AC2: + mov r0, r9 + adds r0, 0x1 + adds r1, r0, r5 + ldrb r0, [r1] + cmp r0, 0x78 + bls _08133AF0 + mov r0, r8 + b _08133B00 + .pool +_08133AF0: + ldrb r1, [r1] + lsls r1, 5 + ldr r0, =gUnknown_085A5C09 + adds r1, r0 + movs r0, 0x1 + movs r2, 0 + bl GetStringWidth +_08133B00: + cmp r0, r6 + ble _08133B06 + adds r6, r0, 0 +_08133B06: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _08133AC2 + adds r0, r6, 0 + bl convert_pixel_width_to_tile_width + lsls r0, 24 + ldr r2, =0x00ffffff + ldr r1, [sp, 0xC] + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0xC] + add r0, sp, 0xC + bl AddWindow + strh r0, [r7, 0x6] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x85 + lsls r2, 2 + movs r1, 0 + movs r3, 0xE + bl SetWindowBorderStyle + movs r5, 0 +_08133B3C: + adds r1, r4, r5 + ldrb r0, [r1] + cmp r0, 0x78 + bls _08133B70 + ldrb r0, [r7, 0x6] + lsls r1, r5, 4 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + ldr r2, =gUnknown_085E8D38 + movs r3, 0x8 + bl Print + b _08133B94 + .pool +_08133B70: + ldrb r0, [r7, 0x6] + ldrb r2, [r1] + lsls r2, 5 + ldr r1, =gUnknown_085A5C09 + adds r2, r1 + lsls r1, r5, 4 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print +_08133B94: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _08133B3C + ldrb r0, [r7, 0x6] + ldr r2, =gUnknown_085EB7EA + lsls r1, r5, 4 + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + movs r1, 0xFF + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x8 + bl Print + ldrb r0, [r7, 0x6] + movs r1, 0x5 + movs r2, 0 + bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8133A78 + + thumb_func_start sub_8133BE4 +sub_8133BE4: @ 8133BE4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r2, r1, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + cmp r2, 0x78 + bls _08133C14 + ldr r1, =0x020375e0 + ldr r2, =0x0000ffff + adds r0, r2, 0 + strh r0, [r1] + b _08133C18 + .pool +_08133C14: + ldr r0, =0x020375e0 + strh r2, [r0] +_08133C18: + ldrb r0, [r4, 0x6] + movs r1, 0 + bl sub_8198070 + ldrb r0, [r4, 0x6] + bl ClearWindowTilemap + ldrb r0, [r4, 0x6] + bl RemoveWindow + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + adds r0, r5, 0 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8133BE4 + + thumb_func_start sub_8133C48 +sub_8133C48: @ 8133C48 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002e28 + adds r6, r0, r1 + bl ProcessMenuInput + lsls r0, 24 + lsrs r4, r0, 24 + asrs r1, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08133C80 + cmp r1, r0 + bgt _08133C7C + subs r0, 0x1 + cmp r1, r0 + beq _08133CCA + b _08133C90 + .pool +_08133C7C: + cmp r1, 0x4 + bne _08133C90 +_08133C80: + movs r0, 0x5 + bl audio_play + adds r0, r7, 0 + movs r1, 0 + bl sub_8133BE4 + b _08133CCA +_08133C90: + movs r0, 0x5 + bl audio_play + ldr r0, =0x020375e2 + lsls r4, 24 + asrs r4, 24 + strh r4, [r0] + ldr r5, =0x02021cc4 + movs r0, 0xB + adds r1, r4, 0 + muls r1, r0 + adds r1, 0x5 + adds r1, r6, r1 + adds r0, r5, 0 + bl CopyString + adds r0, r6, 0 + adds r0, 0x32 + adds r0, r4 + ldrb r1, [r0] + adds r0, r5, 0 + bl StopMusicWhileStringIsPrinted + adds r0, r6, 0x1 + adds r0, r4 + ldrb r1, [r0] + adds r0, r7, 0 + bl sub_8133BE4 +_08133CCA: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8133C48 + + thumb_func_start sub_8133CD8 +sub_8133CD8: @ 8133CD8 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x020375f0 + ldr r2, =0x00002e59 + adds r0, r2 + ldrb r0, [r0] + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_8133CD8 + + thumb_func_start sub_8133CF4 +sub_8133CF4: @ 8133CF4 + push {r4,r5,lr} + movs r4, 0 + ldr r5, =0x020375f0 +_08133CFA: + adds r0, r4, 0 + bl sub_8161AD0 + lsls r0, 24 + cmp r0, 0 + beq _08133D10 + movs r0, 0 + strh r0, [r5] + b _08133D20 + .pool +_08133D10: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x7 + bls _08133CFA + ldr r1, =0x020375f0 + movs r0, 0x1 + strh r0, [r1] +_08133D20: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8133CF4 + + thumb_func_start sub_8133D2C +sub_8133D2C: @ 8133D2C + push {r4-r6,lr} + ldr r6, =0x020375f0 + movs r0, 0 + strh r0, [r6] + ldr r4, =gUnknown_085A5C08 + ldr r5, =0x020375e0 + ldrh r0, [r5] + lsls r0, 5 + adds r2, r0, r4 + ldr r0, =0x020375e4 + ldrh r0, [r0] + lsls r0, 5 + adds r0, r4 + ldrb r1, [r2, 0x13] + ldrb r0, [r0, 0x13] + cmp r1, r0 + beq _08133D72 + adds r0, r1, 0 + bl sub_81618D0 + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _08133D72 + ldr r0, =0x02021dc4 + ldrh r1, [r5] + lsls r1, 5 + adds r1, r4 + ldrb r1, [r1, 0x13] + bl sub_8127250 + movs r0, 0x1 + strh r0, [r6] +_08133D72: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8133D2C + + thumb_func_start sub_8133D8C +sub_8133D8C: @ 8133D8C + push {lr} + ldr r0, =sub_8127208 + movs r1, 0 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_8133D8C + + thumb_func_start sub_8133DA0 +sub_8133DA0: @ 8133DA0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_81279C4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08133DFC + ldr r5, =0x020375e4 + ldr r0, =0x0203a172 + ldrb r1, [r0] + ldr r0, =0x0203a14c + ldr r0, [r0] + adds r0, r1 + ldrb r0, [r0] + strh r0, [r5] + ldr r0, =0x02021ec4 + ldr r1, =0x020375e0 + ldrh r1, [r1] + lsls r1, 5 + ldr r4, =gUnknown_085A5C09 + adds r1, r4 + bl CopyString + ldr r0, =0x02021dc4 + ldrh r1, [r5] + lsls r1, 5 + adds r1, r4 + bl CopyString + b _08133E04 + .pool +_08133DFC: + ldr r1, =0x020375e4 + ldr r2, =0x0000ffff + adds r0, r2, 0 + strh r0, [r1] +_08133E04: + adds r0, r6, 0 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8133DA0 + + thumb_func_start sub_8133E1C +sub_8133E1C: @ 8133E1C + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x020375e4 + movs r1, 0 + strh r1, [r2] + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + .pool + thumb_func_end sub_8133E1C + + thumb_func_start sub_8133E38 +sub_8133E38: @ 8133E38 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, =0x03005d8c + ldr r6, [r0] + ldr r0, =0x00002e28 + adds r5, r6, r0 + ldr r1, =0x020375e4 + mov r8, r1 + ldrb r0, [r1] + bl sub_81619DC + ldr r0, =0x020375e0 + ldrb r0, [r0] + bl IsThereStorageSpaceForDecoration + ldr r4, =0x020375e2 + ldrh r1, [r4] + movs r0, 0xB + muls r0, r1 + adds r0, 0x5 + adds r5, r0 + ldr r0, =0x03005d90 + ldr r1, [r0] + adds r0, r5, 0 + bl CopyString + ldr r2, =0x00002e29 + adds r0, r6, r2 + ldrh r1, [r4] + adds r0, r1 + mov r2, r8 + ldrh r1, [r2] + strb r1, [r0] + ldr r1, =0x00002e5a + adds r0, r6, r1 + ldrh r4, [r4] + adds r0, r4 + movs r1, 0x2 + strb r1, [r0] + ldr r2, =0x00002e59 + adds r6, r2 + movs r0, 0x1 + strb r0, [r6] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8133E38 + + thumb_func_start sub_8133EC0 +sub_8133EC0: @ 8133EC0 + push {lr} + ldr r0, =sub_8133C48 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + bl sub_8133A78 + pop {r0} + bx r0 + .pool + thumb_func_end sub_8133EC0 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/trainer_card.s b/asm/trainer_card.s new file mode 100644 index 000000000..4162a3ded --- /dev/null +++ b/asm/trainer_card.s @@ -0,0 +1,8438 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80C2690 +sub_80C2690: @ 80C2690 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + bl sub_80C48C8 + ldr r0, =0x02039ce8 + ldr r0, [r0] + ldrb r0, [r0, 0x9] + cmp r0, 0 + beq _080C26C0 + ldr r1, =0x040000d4 + ldr r0, =0x02038c28 + str r0, [r1] + movs r2, 0xF0 + lsls r2, 3 + adds r0, r2 + str r0, [r1, 0x4] + ldr r0, =0x800000a0 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] +_080C26C0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C2690 + + thumb_func_start sub_80C26D4 +sub_80C26D4: @ 80C26D4 + push {r4,lr} + ldr r4, =0x04000208 + ldrh r3, [r4] + movs r0, 0 + strh r0, [r4] + ldr r1, =0x02038c28 + ldr r0, =0x04000006 + ldrh r2, [r0] + movs r0, 0xFF + ands r0, r2 + lsls r0, 1 + movs r2, 0xF0 + lsls r2, 3 + adds r1, r2 + adds r0, r1 + ldrh r1, [r0] + ldr r0, =0x04000012 + strh r1, [r0] + strh r3, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C26D4 + + thumb_func_start sub_80C2710 +sub_80C2710: @ 80C2710 + push {lr} + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_80C2710 + + thumb_func_start sub_80C2728 +sub_80C2728: @ 80C2728 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =0x02039ce8 + ldr r0, [r5] + movs r1, 0xA6 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + bl SetMainCallback2 + bl FreeAllWindowBuffers + ldr r0, [r5] + bl Free + movs r0, 0 + str r0, [r5] + adds r0, r4, 0 + bl DestroyTask + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C2728 + + thumb_func_start sub_80C2760 +sub_80C2760: @ 80C2760 + push {r4-r6,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =0x02039ce8 + ldr r0, [r1] + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0x10 + bls _080C2776 + b _080C2ACA +_080C2776: + lsls r0, 2 + ldr r1, =_080C2788 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C2788: + .4byte _080C27CC + .4byte _080C27E2 + .4byte _080C27F0 + .4byte _080C27F8 + .4byte _080C280C + .4byte _080C2820 + .4byte _080C2830 + .4byte _080C2836 + .4byte _080C289C + .4byte _080C28C8 + .4byte _080C28E4 + .4byte _080C299C + .4byte _080C2970 + .4byte _080C2AAA + .4byte _080C2A98 + .4byte _080C2A2C + .4byte _080C2A68 +_080C27CC: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _080C27D8 + b _080C2ACA +_080C27D8: + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + b _080C28D4 +_080C27E2: + bl sub_80C3438 + lsls r0, 24 + cmp r0, 0 + bne _080C27EE + b _080C2ACA +_080C27EE: + b _080C28D4 +_080C27F0: + movs r0, 0x1 + bl sub_80C438C + b _080C28D4 +_080C27F8: + movs r0, 0x2 + movs r1, 0 + bl FillWindowPixelBuffer + bl sub_80C4FF0 + movs r0, 0x2 + bl sub_80C438C + b _080C28D4 +_080C280C: + ldr r0, [r4] + ldr r1, =0x00000ef8 + adds r0, r1 + bl sub_80C4550 + ldr r1, [r4] + b _080C28D8 + .pool +_080C2820: + ldr r0, [r4] + movs r2, 0xB3 + lsls r2, 3 + adds r0, r2 + bl sub_80C45C0 + ldr r1, [r4] + b _080C28D8 +_080C2830: + bl sub_80C4630 + b _080C28D4 +_080C2836: + ldr r0, =0x030030fc + ldrb r0, [r0] + cmp r0, 0x1 + bne _080C2852 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080C2852 + bl sub_800E0E8 + movs r0, 0xE6 + movs r1, 0x96 + bl sub_800DFB4 +_080C2852: + movs r6, 0x1 + negs r6, r6 + ldr r4, =0x02039ce8 + ldr r0, [r4] + ldr r5, =0x0000052c + adds r0, r5 + ldrh r2, [r0] + adds r0, r6, 0 + movs r1, 0x10 + bl sub_80A2A20 + ldr r0, [r4] + adds r0, r5 + ldrh r0, [r0] + str r0, [sp] + adds r0, r6, 0 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + ldr r0, =sub_80C2690 + bl SetVBlankCallback + ldr r1, [r4] + b _080C28D8 + .pool +_080C289C: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + beq _080C28A8 + b _080C2ACA +_080C28A8: + bl IsDma3ManagerBusyWithBgCopy + lsls r0, 24 + cmp r0, 0 + beq _080C28B4 + b _080C2ACA +_080C28B4: + movs r0, 0xFB + bl audio_play + ldr r0, =0x02039ce8 + ldr r1, [r0] + movs r0, 0xA + strb r0, [r1] + b _080C2ACA + .pool +_080C28C8: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _080C28D4 + b _080C2ACA +_080C28D4: + ldr r0, =0x02039ce8 + ldr r1, [r0] +_080C28D8: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C2ACA + .pool +_080C28E4: + ldr r0, =0x03003124 + ldrb r5, [r0] + cmp r5, 0 + bne _080C290A + ldr r0, [r4] + ldr r1, =0x00000529 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080C290A + bl sub_80C3880 + movs r0, 0x1 + bl sub_80C438C + ldr r0, [r4] + ldr r2, =0x00000529 + adds r0, r2 + strb r5, [r0] +_080C290A: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080C293C + bl sub_80C4918 + movs r0, 0xF9 + bl audio_play + ldr r0, =0x02039ce8 + ldr r1, [r0] + movs r0, 0xC + strb r0, [r1] + b _080C2ACA + .pool +_080C293C: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080C2946 + b _080C2ACA +_080C2946: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _080C2960 + ldr r4, =0x02039ce8 + ldr r0, [r4] + ldrb r0, [r0, 0x5] + cmp r0, 0 + beq _080C2960 + bl InUnionRoom + cmp r0, 0x1 + beq _080C2A14 +_080C2960: + movs r0, 0x1 + negs r0, r0 + ldr r4, =0x02039ce8 + b _080C2A74 + .pool +_080C2970: + bl sub_80C4940 + lsls r0, 24 + cmp r0, 0 + bne _080C297C + b _080C2ACA +_080C297C: + bl sub_8087598 + cmp r0, 0x1 + bne _080C2986 + b _080C2ACA +_080C2986: + movs r0, 0xFB + bl audio_play + ldr r0, =0x02039ce8 + ldr r1, [r0] + movs r0, 0xB + strb r0, [r1] + b _080C2ACA + .pool +_080C299C: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080C29F4 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _080C29DC + ldr r0, [r4] + ldrb r0, [r0, 0x5] + cmp r0, 0 + beq _080C29C0 + bl InUnionRoom + cmp r0, 0x1 + beq _080C2A14 +_080C29C0: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _080C29DC + movs r0, 0x1 + negs r0, r0 + ldr r4, =0x02039ce8 + b _080C2A74 + .pool +_080C29DC: + bl sub_80C4918 + ldr r0, =0x02039ce8 + ldr r1, [r0] + movs r0, 0xD + strb r0, [r1] + movs r0, 0xF9 + bl audio_play + b _080C2ACA + .pool +_080C29F4: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080C2ACA + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _080C2A20 + ldr r0, [r4] + ldrb r0, [r0, 0x5] + cmp r0, 0 + beq _080C2A20 + bl InUnionRoom + cmp r0, 0x1 + bne _080C2A20 +_080C2A14: + ldr r1, [r4] + movs r0, 0xF + strb r0, [r1] + b _080C2ACA + .pool +_080C2A20: + movs r0, 0x1 + negs r0, r0 + ldr r4, =0x02039ce8 + b _080C2A74 + .pool +_080C2A2C: + bl sub_800AC34 + movs r0, 0 + movs r1, 0x1 + bl sub_81973C4 + ldr r2, =gUnknown_085ED042 + movs r0, 0x1 + str r0, [sp] + movs r0, 0xFF + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + movs r1, 0x3 + bl CopyWindowToVram + ldr r0, =0x02039ce8 + ldr r1, [r0] + movs r0, 0x10 + strb r0, [r1] + b _080C2ACA + .pool +_080C2A68: + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + bne _080C2ACA + movs r0, 0x1 + negs r0, r0 +_080C2A74: + ldr r1, [r4] + ldr r2, =0x0000052c + adds r1, r2 + ldrh r1, [r1] + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r1, [r4] + movs r0, 0xE + strb r0, [r1] + b _080C2ACA + .pool +_080C2A98: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080C2ACA + adds r0, r5, 0 + bl sub_80C2728 + b _080C2ACA +_080C2AAA: + bl sub_80C4940 + lsls r0, 24 + cmp r0, 0 + beq _080C2ACA + bl sub_8087598 + cmp r0, 0x1 + beq _080C2ACA + ldr r0, =0x02039ce8 + ldr r1, [r0] + movs r0, 0xA + strb r0, [r1] + movs r0, 0xFB + bl audio_play +_080C2ACA: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C2760 + + thumb_func_start sub_80C2AD8 +sub_80C2AD8: @ 80C2AD8 + push {lr} + ldr r0, =0x02039ce8 + ldr r1, [r0] + ldrb r0, [r1, 0x2] + cmp r0, 0x5 + bls _080C2AE6 + b _080C2C64 +_080C2AE6: + lsls r0, 2 + ldr r1, =_080C2AF8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C2AF8: + .4byte _080C2B10 + .4byte _080C2B44 + .4byte _080C2B78 + .4byte _080C2BD0 + .4byte _080C2C04 + .4byte _080C2C38 +_080C2B10: + ldr r0, =0x02039ce8 + ldr r1, [r0] + ldr r2, =0x0000052a + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080C2B34 + ldr r0, =gUnknown_08DD1F78 + ldr r2, =0x00000ef8 + b _080C2C4A + .pool +_080C2B34: + ldr r0, =gUnknown_08DD2AE0 + ldr r2, =0x00000ef8 + b _080C2C4A + .pool +_080C2B44: + ldr r0, =0x02039ce8 + ldr r1, [r0] + ldr r2, =0x0000052a + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080C2B68 + ldr r0, =gUnknown_08DD21B0 + ldr r2, =0x00000a48 + b _080C2C4A + .pool +_080C2B68: + ldr r0, =gUnknown_08DD2D30 + ldr r2, =0x00000a48 + b _080C2C4A + .pool +_080C2B78: + ldr r0, =0x02039ce8 + ldr r1, [r0] + ldrb r0, [r1, 0x5] + cmp r0, 0 + bne _080C2BAC + ldr r2, =0x0000052a + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080C2BA0 + ldr r0, =gUnknown_08DD2010 + adds r2, 0x6E + b _080C2C4A + .pool +_080C2BA0: + ldr r0, =gUnknown_08DD2B78 + movs r2, 0xB3 + lsls r2, 3 + b _080C2C4A + .pool +_080C2BAC: + ldr r2, =0x0000052a + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080C2BC4 + ldr r0, =gUnknown_08DD228C + adds r2, 0x6E + b _080C2C4A + .pool +_080C2BC4: + ldr r0, =gUnknown_08DD2E5C + movs r2, 0xB3 + lsls r2, 3 + b _080C2C4A + .pool +_080C2BD0: + ldr r0, =0x02039ce8 + ldr r1, [r0] + ldr r2, =0x0000052a + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080C2BF4 + ldr r0, =gUnknown_0856F5CC + ldr r2, =0x000013a8 + b _080C2C4A + .pool +_080C2BF4: + ldr r0, =gUnknown_0856F814 + ldr r2, =0x000013a8 + b _080C2C4A + .pool +_080C2C04: + ldr r0, =0x02039ce8 + ldr r1, [r0] + ldr r2, =0x0000052a + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080C2C28 + ldr r0, =gUnknown_08DD1AB8 + ldr r2, =0x000019a8 + b _080C2C4A + .pool +_080C2C28: + ldr r0, =gUnknown_08DD246C + ldr r2, =0x000019a8 + b _080C2C4A + .pool +_080C2C38: + ldr r0, =0x02039ce8 + ldr r1, [r0] + ldr r2, =0x0000052a + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080C2C6C + ldr r0, =gUnknown_0856F018 + ldr r2, =0x000017a8 +_080C2C4A: + adds r1, r2 + bl LZ77UnCompWram + b _080C2C6C + .pool +_080C2C64: + movs r0, 0 + strb r0, [r1, 0x2] + movs r0, 0x1 + b _080C2C78 +_080C2C6C: + ldr r0, =0x02039ce8 + ldr r1, [r0] + ldrb r0, [r1, 0x2] + adds r0, 0x1 + strb r0, [r1, 0x2] + movs r0, 0 +_080C2C78: + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C2AD8 + + thumb_func_start sub_80C2C80 +sub_80C2C80: @ 80C2C80 + push {lr} + sub sp, 0x8 + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + adds r3, r1, 0 + cmp r0, 0xA + bls _080C2C96 + b _080C2DD8 +_080C2C96: + lsls r0, 2 + ldr r1, =_080C2CA8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C2CA8: + .4byte _080C2CD4 + .4byte _080C2CEC + .4byte _080C2D14 + .4byte _080C2D50 + .4byte _080C2D6A + .4byte _080C2D74 + .4byte _080C2D88 + .4byte _080C2D8E + .4byte _080C2DA0 + .4byte _080C2DA6 + .4byte _080C2DB8 +_080C2CD4: + bl sub_80C334C + bl sub_80C3414 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080C2DCC + .pool +_080C2CEC: + movs r1, 0xE0 + lsls r1, 19 + movs r0, 0 + str r0, [sp] + ldr r0, =0x040000d4 + mov r2, sp + str r2, [r0] + str r1, [r0, 0x4] + ldr r1, =0x85000100 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + movs r0, 0x87 + lsls r0, 3 + adds r1, r3, r0 + b _080C2DCC + .pool +_080C2D14: + ldr r0, =0x02039ce8 + ldr r0, [r0] + ldr r1, =0x0000052c + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _080C2D36 + movs r2, 0xA0 + lsls r2, 19 + add r1, sp, 0x4 + strh r0, [r1] + ldr r0, =0x040000d4 + str r1, [r0] + str r2, [r0, 0x4] + ldr r1, =0x81000200 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] +_080C2D36: + movs r2, 0x87 + lsls r2, 3 + adds r1, r3, r2 + b _080C2DCC + .pool +_080C2D50: + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + bl sub_80A1A74 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080C2D6A: + bl sub_80C3388 + b _080C2DC4 + .pool +_080C2D74: + bl sub_80C41D8 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080C2DCC + .pool +_080C2D88: + bl sub_80C2AD8 + b _080C2DBC +_080C2D8E: + bl sub_80C4330 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080C2DCC + .pool +_080C2DA0: + bl sub_80C3278 + b _080C2DC4 +_080C2DA6: + bl sub_80C3548 + ldr r1, =0x030022c0 + movs r0, 0x87 + lsls r0, 3 + adds r1, r0 + b _080C2DCC + .pool +_080C2DB8: + bl sub_80C43A8 +_080C2DBC: + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080C2DDC +_080C2DC4: + ldr r1, =0x030022c0 + movs r2, 0x87 + lsls r2, 3 + adds r1, r2 +_080C2DCC: + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + b _080C2DDC + .pool +_080C2DD8: + bl sub_80C3404 +_080C2DDC: + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_80C2C80 + + thumb_func_start sav12_xor_get_clamped_above +sav12_xor_get_clamped_above: @ 80C2DE4 + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + bl sub_80847F8 + cmp r0, r4 + bls _080C2DF6 + adds r0, r4, 0 +_080C2DF6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sav12_xor_get_clamped_above + + thumb_func_start sub_80C2DFC +sub_80C2DFC: @ 80C2DFC + push {r4,r5,lr} + movs r5, 0 +_080C2E00: + lsls r4, r5, 1 + ldr r1, =0x000008c4 + adds r0, r4, r1 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _080C2E1E + ldr r1, =0x000008c5 + adds r0, r4, r1 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + bne _080C2E2C +_080C2E1E: + movs r0, 0 + b _080C2E38 + .pool +_080C2E2C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x6 + bls _080C2E00 + movs r0, 0x1 +_080C2E38: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80C2DFC + + thumb_func_start sub_80C2E40 +sub_80C2E40: @ 80C2E40 + push {r4,lr} + movs r0, 0xA + bl sub_80847F8 + negs r1, r0 + orrs r1, r0 + lsrs r4, r1, 31 + bl sub_80C08E4 + lsls r0, 16 + cmp r0, 0 + beq _080C2E5A + adds r4, 0x1 +_080C2E5A: + bl sub_80F8940 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bls _080C2E6C + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_080C2E6C: + bl sub_80C2DFC + lsls r0, 24 + cmp r0, 0 + beq _080C2E7C + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_080C2E7C: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80C2E40 + + thumb_func_start sub_80C2E84 +sub_80C2E84: @ 80C2E84 + push {lr} + adds r1, r0, 0 + movs r2, 0 + ldrh r0, [r1, 0x6] + cmp r0, 0 + bne _080C2E96 + ldr r0, [r1, 0x8] + cmp r0, 0 + beq _080C2E98 +_080C2E96: + movs r2, 0x1 +_080C2E98: + ldrb r0, [r1, 0x3] + cmp r0, 0 + beq _080C2EA4 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_080C2EA4: + ldrh r0, [r1, 0x1A] + cmp r0, 0x31 + bls _080C2EB0 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_080C2EB0: + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _080C2EBC + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_080C2EBC: + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_80C2E84 + + thumb_func_start sub_80C2EC4 +sub_80C2EC4: @ 80C2EC4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + ldr r6, =0x03005d90 + ldr r1, [r6] + ldrb r0, [r1, 0x8] + strb r0, [r5] + ldrh r0, [r1, 0xE] + strh r0, [r5, 0x10] + ldrb r0, [r1, 0x10] + strh r0, [r5, 0x12] + movs r0, 0x1 + bl sub_80847F8 + adds r4, r0, 0 + movs r0, 0xA + bl sub_80847F8 + cmp r0, 0 + bne _080C2EF6 + movs r4, 0 +_080C2EF6: + lsrs r0, r4, 16 + strh r0, [r5, 0x6] + lsrs r1, r4, 8 + movs r2, 0xFF + ands r1, r2 + strh r1, [r5, 0x8] + ands r4, r2 + strh r4, [r5, 0xA] + ldr r1, =0x000003e7 + cmp r0, r1 + bls _080C2F14 + strh r1, [r5, 0x6] + movs r0, 0x3B + strh r0, [r5, 0x8] + strh r0, [r5, 0xA] +_080C2F14: + ldr r0, =0x00000861 + bl FlagGet + strb r0, [r5, 0x2] + bl sub_80C08E4 + strb r0, [r5, 0x3] + bl sub_80C376C + strh r0, [r5, 0xC] + ldr r0, [r6] + ldrb r1, [r0, 0xB] + lsls r1, 8 + ldrb r0, [r0, 0xA] + orrs r0, r1 + strh r0, [r5, 0xE] + ldr r4, =0x0000270f + movs r0, 0x17 + adds r1, r4, 0 + bl sav12_xor_get_clamped_above + strh r0, [r5, 0x14] + movs r0, 0x18 + adds r1, r4, 0 + bl sav12_xor_get_clamped_above + strh r0, [r5, 0x16] + ldr r1, =0x0000ffff + movs r0, 0x15 + bl sav12_xor_get_clamped_above + strh r0, [r5, 0x20] + ldr r4, =0x03005d8c + ldr r0, [r4] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + bl DecryptMoney + str r0, [r5, 0x24] + movs r2, 0 + adds r7, r5, 0 + adds r7, 0x30 + adds r6, r5, 0 + adds r6, 0x28 + ldr r0, [r4] + ldr r1, =0x00002bb0 + adds r3, r0, r1 +_080C2F74: + lsls r0, r2, 1 + adds r1, r6, r0 + adds r0, r3, r0 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _080C2F74 + ldr r0, =0x03005d90 + ldr r1, [r0] + adds r0, r7, 0 + bl CopyString + mov r0, r8 + cmp r0, 0x1 + beq _080C3004 + cmp r0, 0x1 + bgt _080C2FC0 + cmp r0, 0 + beq _080C2FCC + b _080C3014 + .pool +_080C2FC0: + mov r1, r8 + cmp r1, 0x2 + bne _080C3014 + movs r0, 0 + strh r0, [r5, 0x18] + strh r0, [r5, 0x1A] +_080C2FCC: + ldr r1, =0x000003e7 + movs r0, 0x23 + bl sav12_xor_get_clamped_above + strh r0, [r5, 0x1C] + ldr r1, =0x0000ffff + movs r0, 0x22 + bl sav12_xor_get_clamped_above + strh r0, [r5, 0x1E] + bl sub_80F8940 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bls _080C2FF0 + movs r0, 0x1 + strb r0, [r5, 0x4] +_080C2FF0: + adds r0, r5, 0 + bl sub_80C2E84 + strb r0, [r5, 0x1] + b _080C3014 + .pool +_080C3004: + movs r1, 0 + movs r0, 0 + strh r0, [r5, 0x18] + strh r0, [r5, 0x1A] + strh r0, [r5, 0x1C] + strh r0, [r5, 0x1E] + strb r1, [r5, 0x4] + strb r1, [r5, 0x1] +_080C3014: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80C2EC4 + + thumb_func_start sub_80C3020 +sub_80C3020: @ 80C3020 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + movs r2, 0x64 + bl memset + adds r1, r4, 0 + adds r1, 0x38 + movs r0, 0x3 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80C2EC4 + bl sub_80C2DFC + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + adds r1, 0x60 + strh r0, [r1] + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r2, =0x00000eba + adds r0, r2 + ldrh r0, [r0] + adds r2, r4, 0 + adds r2, 0x62 + strh r0, [r2] + ldrh r0, [r1] + cmp r0, 0 + beq _080C3066 + ldrb r0, [r4, 0x1] + adds r0, 0x1 + strb r0, [r4, 0x1] +_080C3066: + ldrb r0, [r4] + cmp r0, 0x1 + bne _080C3084 + ldr r2, =gUnknown_08329D54 + ldrh r0, [r4, 0xE] + movs r1, 0x7 + ands r0, r1 + adds r0, 0x8 + b _080C308C + .pool +_080C3084: + ldr r2, =gUnknown_08329D54 + ldrh r0, [r4, 0xE] + movs r1, 0x7 + ands r0, r1 +_080C308C: + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + adds r0, r4, 0 + adds r0, 0x4F + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3020 + + thumb_func_start sub_80C30A4 +sub_80C30A4: @ 80C30A4 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + movs r2, 0x60 + bl memset + adds r1, r4, 0 + adds r1, 0x38 + movs r0, 0x3 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0x2 + bl sub_80C2EC4 + bl sub_80C2DFC + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x3A] + ldr r1, =0x03005d90 + ldr r1, [r1] + ldr r2, =0x00000eba + adds r1, r2 + ldrh r1, [r1] + strh r1, [r4, 0x3C] + cmp r0, 0 + beq _080C30E0 + ldrb r0, [r4, 0x1] + adds r0, 0x1 + strb r0, [r4, 0x1] +_080C30E0: + ldrb r0, [r4] + cmp r0, 0x1 + bne _080C3100 + ldr r2, =gUnknown_08329D54 + ldrh r0, [r4, 0xE] + movs r1, 0x7 + ands r0, r1 + adds r0, 0x8 + b _080C3108 + .pool +_080C3100: + ldr r2, =gUnknown_08329D54 + ldrh r0, [r4, 0xE] + movs r1, 0x7 + ands r0, r1 +_080C3108: + lsls r0, 1 + adds r0, r2 + ldrh r1, [r0] + adds r0, r4, 0 + adds r0, 0x4F + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C30A4 + + thumb_func_start sub_80C3120 +sub_80C3120: @ 80C3120 + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + lsls r4, r2, 24 + lsrs r4, 24 + movs r1, 0 + movs r2, 0x64 + bl memset + adds r0, r5, 0 + adds r0, 0x38 + strb r4, [r0] + adds r0, r4, 0 + bl sub_80C4FCC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080C3162 + cmp r0, 0x1 + bgt _080C3150 + cmp r0, 0 + beq _080C3156 + b _080C318A +_080C3150: + cmp r0, 0x2 + beq _080C316E + b _080C318A +_080C3156: + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x60 + bl memcpy + b _080C318A +_080C3162: + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x38 + bl memcpy + b _080C318A +_080C316E: + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x60 + bl memcpy + movs r0, 0 + str r0, [r5, 0x3C] + ldrh r1, [r6, 0x3A] + adds r0, r5, 0 + adds r0, 0x60 + strh r1, [r0] + ldrh r1, [r6, 0x3C] + adds r0, 0x2 + strh r1, [r0] +_080C318A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80C3120 + + thumb_func_start sub_80C3190 +sub_80C3190: @ 80C3190 + push {r4,r5,lr} + ldr r4, =0x02039ce8 + ldr r0, [r4] + movs r1, 0 + strb r1, [r0, 0xA] + ldr r0, [r4] + strb r1, [r0, 0xB] + ldr r0, [r4] + strb r1, [r0, 0xC] + ldr r0, [r4] + strb r1, [r0, 0xD] + ldr r0, [r4] + strb r1, [r0, 0xE] + ldr r0, [r4] + strb r1, [r0, 0xF] + ldr r0, [r4] + strb r1, [r0, 0x10] + ldr r0, [r4] + adds r0, 0x11 + movs r2, 0x8 + bl memset + ldr r1, [r4] + ldr r2, =0x00000536 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080C31CE + ldrb r0, [r1, 0xA] + adds r0, 0x1 + strb r0, [r1, 0xA] +_080C31CE: + ldr r1, [r4] + ldr r3, =0x0000053a + adds r0, r1, r3 + ldrh r0, [r0] + cmp r0, 0 + bne _080C31E4 + ldr r2, =0x0000053c + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, 0 + beq _080C31EA +_080C31E4: + ldrb r0, [r1, 0xB] + adds r0, 0x1 + strb r0, [r1, 0xB] +_080C31EA: + ldr r2, =0x02039ce8 + ldr r1, [r2] + movs r3, 0xA9 + lsls r3, 3 + adds r0, r1, r3 + ldr r0, [r0] + cmp r0, 0 + beq _080C3200 + ldrb r0, [r1, 0xC] + adds r0, 0x1 + strb r0, [r1, 0xC] +_080C3200: + ldr r1, [r2] + ldr r3, =0x00000554 + adds r0, r1, r3 + ldrh r0, [r0] + cmp r0, 0 + beq _080C3212 + ldrb r0, [r1, 0x10] + adds r0, 0x1 + strb r0, [r1, 0x10] +_080C3212: + ldr r1, [r2] + ldr r2, =0x0000054c + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, 0 + beq _080C3224 + ldrb r0, [r1, 0xD] + adds r0, 0x1 + strb r0, [r1, 0xD] +_080C3224: + movs r5, 0 + ldr r4, =0x00000867 +_080C3228: + lsls r0, r4, 16 + lsrs r0, 16 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _080C3244 + ldr r0, =0x02039ce8 + ldr r1, [r0] + adds r1, 0x11 + adds r1, r5 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080C3244: + adds r4, 0x1 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x0000086e + cmp r4, r0 + bls _080C3228 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3190 + + thumb_func_start sub_80C3278 +sub_80C3278: @ 80C3278 + push {lr} + movs r1, 0xC1 + lsls r1, 6 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x1 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + movs r0, 0x50 + movs r1, 0xC1 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + movs r0, 0x48 + movs r1, 0x3F + bl SetGpuReg + movs r0, 0x4A + movs r1, 0x1E + bl SetGpuReg + movs r0, 0x44 + movs r1, 0xA0 + bl SetGpuReg + movs r0, 0x40 + movs r1, 0xF0 + bl SetGpuReg + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _080C32E0 + movs r0, 0xC7 + bl EnableInterrupts + b _080C32E6 + .pool +_080C32E0: + movs r0, 0x3 + bl EnableInterrupts +_080C32E6: + pop {r0} + bx r0 + thumb_func_end sub_80C3278 + + thumb_func_start sub_80C32EC +sub_80C32EC: @ 80C32EC + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + adds r0, 0x28 + movs r1, 0xA + bl __divsi3 + lsls r0, 24 + lsrs r2, r0, 24 + asrs r0, 24 + cmp r0, 0x4 + bgt _080C3306 + movs r2, 0 +_080C3306: + ldr r4, =0x02039ce8 + ldr r0, [r4] + movs r1, 0xA5 + lsls r1, 3 + adds r0, r1 + strb r2, [r0] + ldr r0, [r4] + adds r0, r1 + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x54 + bl SetGpuReg + ldr r0, [r4] + ldr r1, =0x00007ca8 + adds r0, r1 + ldrh r2, [r0] + lsls r1, r2, 8 + movs r0, 0xA0 + subs r0, r2 + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x44 + bl SetGpuReg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C32EC + + thumb_func_start sub_80C334C +sub_80C334C: @ 80C334C + push {lr} + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + bl SetHBlankCallback + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0x8 + movs r1, 0 + bl SetGpuReg + movs r0, 0xA + movs r1, 0 + bl SetGpuReg + movs r0, 0xC + movs r1, 0 + bl SetGpuReg + movs r0, 0xE + movs r1, 0 + bl SetGpuReg + pop {r0} + bx r0 + thumb_func_end sub_80C334C + + thumb_func_start sub_80C3388 +sub_80C3388: @ 80C3388 + push {lr} + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_0856FAB4 + movs r0, 0 + movs r2, 0x4 + bl InitBgsFromTemplates + 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 + ldr r0, =gUnknown_0856FAC4 + bl InitWindows + bl DeactivateAllTextPrinters + bl sub_81973A4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3388 + + thumb_func_start sub_80C3404 +sub_80C3404: @ 80C3404 + push {lr} + ldr r0, =sub_80C2710 + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3404 + + thumb_func_start sub_80C3414 +sub_80C3414: @ 80C3414 + push {lr} + bl ResetTasks + bl remove_some_task + ldr r0, =sub_80C2760 + movs r1, 0 + bl CreateTask + bl sub_80C4EE4 + bl sub_80C3190 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3414 + + thumb_func_start sub_80C3438 +sub_80C3438: @ 80C3438 + push {lr} + ldr r0, =0x02039ce8 + ldr r1, [r0] + ldrb r0, [r1, 0x1] + cmp r0, 0x5 + bhi _080C3494 + lsls r0, 2 + ldr r1, =_080C3458 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C3458: + .4byte _080C3470 + .4byte _080C3476 + .4byte _080C347C + .4byte _080C3482 + .4byte _080C3488 + .4byte _080C348E +_080C3470: + bl sub_80C3574 + b _080C349C +_080C3476: + bl sub_80C3608 + b _080C349C +_080C347C: + bl sub_80C3684 + b _080C349C +_080C3482: + bl sub_80C378C + b _080C349C +_080C3488: + bl sub_80C3880 + b _080C349C +_080C348E: + bl sub_80C3A18 + b _080C349C +_080C3494: + movs r0, 0 + strb r0, [r1, 0x1] + movs r0, 0x1 + b _080C34A8 +_080C349C: + ldr r0, =0x02039ce8 + ldr r1, [r0] + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] + movs r0, 0 +_080C34A8: + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C3438 + + thumb_func_start sub_80C34B0 +sub_80C34B0: @ 80C34B0 + push {lr} + ldr r0, =0x02039ce8 + ldr r1, [r0] + ldrb r0, [r1, 0x1] + cmp r0, 0x7 + bhi _080C352C + lsls r0, 2 + ldr r1, =_080C34D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C34D0: + .4byte _080C34F0 + .4byte _080C34F6 + .4byte _080C34FC + .4byte _080C3502 + .4byte _080C3508 + .4byte _080C3512 + .4byte _080C351C + .4byte _080C3526 +_080C34F0: + bl sub_80C3B50 + b _080C3534 +_080C34F6: + bl sub_80C3CCC + b _080C3534 +_080C34FC: + bl sub_80C3D60 + b _080C3534 +_080C3502: + bl sub_80C3DF0 + b _080C3534 +_080C3508: + bl sub_80C3E58 + bl sub_80C3F64 + b _080C3534 +_080C3512: + bl sub_80C3ED4 + bl sub_80C3FE0 + b _080C3534 +_080C351C: + bl sub_80C4140 + bl sub_80C40CC + b _080C3534 +_080C3526: + bl sub_80C42A4 + b _080C3534 +_080C352C: + movs r0, 0 + strb r0, [r1, 0x1] + movs r0, 0x1 + b _080C3540 +_080C3534: + ldr r0, =0x02039ce8 + ldr r1, [r0] + ldrb r0, [r1, 0x1] + adds r0, 0x1 + strb r0, [r1, 0x1] + movs r0, 0 +_080C3540: + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C34B0 + + thumb_func_start sub_80C3548 +sub_80C3548: @ 80C3548 + push {lr} + bl sub_80C3AF0 + bl sub_80C3BC4 + bl sub_80C3CF4 + bl sub_80C3DC0 + bl sub_80C3E20 + bl sub_80C3E98 + bl sub_80C3F14 + bl sub_80C3FA4 + bl sub_80C4020 + pop {r0} + bx r0 + thumb_func_end sub_80C3548 + + thumb_func_start sub_80C3574 +sub_80C3574: @ 80C3574 + push {r4,r5,lr} + sub sp, 0x2C + ldr r1, =gUnknown_085ECF71 + add r0, sp, 0xC + bl CopyString + adds r5, r0, 0 + ldr r4, =0x02039ce8 + ldr r1, [r4] + ldr r0, =0x00000564 + adds r1, r0 + adds r0, r5, 0 + bl CopyString + ldr r0, [r4] + ldr r1, =0x00007caa + adds r0, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl StopMusicWhileStringIsPrinted + ldr r0, [r4] + ldr r1, =0x0000052a + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C35E0 + ldr r0, =gUnknown_0856FB0C + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x14 + movs r3, 0x1C + bl box_print + b _080C35FA + .pool +_080C35E0: + ldr r0, =gUnknown_0856FB0C + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + add r1, sp, 0xC + str r1, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0x21 + bl box_print +_080C35FA: + add sp, 0x2C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3574 + + thumb_func_start sub_80C3608 +sub_80C3608: @ 80C3608 + push {r4,lr} + sub sp, 0x2C + ldr r1, =gUnknown_085ECF78 + add r0, sp, 0xC + bl CopyString + ldr r4, =0x02039ce8 + ldr r1, [r4] + ldr r2, =0x00000542 + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x2 + movs r3, 0x5 + bl ConvertIntToDecimalString + ldr r0, [r4] + ldr r1, =0x0000052a + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C3650 + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x50 + bl GetStringCenterAlignXOffset + adds r0, 0x84 + b _080C365C + .pool +_080C3650: + movs r0, 0x1 + add r1, sp, 0xC + movs r2, 0x60 + bl GetStringCenterAlignXOffset + adds r0, 0x78 +_080C365C: + movs r3, 0x9 + lsls r2, r0, 24 + lsrs r2, 24 + ldr r0, =gUnknown_0856FB0C + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + add r0, sp, 0xC + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + bl box_print + add sp, 0x2C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3608 + + thumb_func_start sub_80C3684 +sub_80C3684: @ 80C3684 + push {r4,r5,lr} + sub sp, 0xC + ldr r0, =0x02039ce8 + ldr r0, [r0] + ldr r1, =0x0000052b + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C36C4 + ldr r0, =gUnknown_0856FB0C + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + ldr r0, =gUnknown_085ECF7E + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x14 + movs r3, 0x38 + bl box_print + b _080C36DE + .pool +_080C36C4: + ldr r0, =gUnknown_0856FB0C + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + ldr r0, =gUnknown_085ECF7E + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0x39 + bl box_print +_080C36DE: + ldr r0, =0x02021cc4 + ldr r4, =0x02039ce8 + ldr r1, [r4] + movs r2, 0xAB + lsls r2, 3 + adds r1, r2 + ldr r1, [r1] + movs r2, 0 + movs r3, 0x6 + bl ConvertIntToDecimalString + ldr r5, =0x02021fc4 + ldr r1, =gUnknown_085E969C + adds r0, r5, 0 + bl ExpandStringRefs + ldr r0, [r4] + ldr r1, =0x0000052b + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C3734 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x90 + bl GetStringRightAlignXOffset + movs r3, 0x38 + b _080C3740 + .pool +_080C3734: + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x80 + bl GetStringRightAlignXOffset + movs r3, 0x39 +_080C3740: + lsls r2, r0, 24 + lsrs r2, 24 + ldr r0, =gUnknown_0856FB0C + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + ldr r0, =0x02021fc4 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + bl box_print + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3684 + + thumb_func_start sub_80C376C +sub_80C376C: @ 80C376C + push {lr} + bl sub_809D42C + cmp r0, 0 + bne _080C377E + movs r0, 0x1 + bl sub_80C0844 + b _080C3784 +_080C377E: + movs r0, 0x1 + bl pokedex_count +_080C3784: + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_80C376C + + thumb_func_start sub_80C378C +sub_80C378C: @ 80C378C + push {r4,r5,lr} + sub sp, 0xC + ldr r0, =0x00000861 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _080C386E + ldr r0, =0x02039ce8 + ldr r0, [r0] + ldr r1, =0x0000052b + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C37DC + ldr r0, =gUnknown_0856FB0C + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + ldr r0, =gUnknown_085ECF86 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x14 + movs r3, 0x48 + bl box_print + b _080C37F6 + .pool +_080C37DC: + ldr r0, =gUnknown_0856FB0C + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + ldr r0, =gUnknown_085ECF86 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0x49 + bl box_print +_080C37F6: + ldr r5, =0x02021fc4 + ldr r4, =0x02039ce8 + ldr r0, [r4] + movs r1, 0xA8 + lsls r1, 3 + adds r0, r1 + ldrh r1, [r0] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r1, =gUnknown_085ECF8E + bl CopyString + ldr r0, [r4] + ldr r1, =0x0000052b + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C3848 + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x90 + bl GetStringRightAlignXOffset + movs r3, 0x48 + b _080C3854 + .pool +_080C3848: + movs r0, 0x1 + adds r1, r5, 0 + movs r2, 0x80 + bl GetStringRightAlignXOffset + movs r3, 0x49 +_080C3854: + lsls r2, r0, 24 + lsrs r2, 24 + ldr r0, =gUnknown_0856FB0C + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + ldr r0, =0x02021fc4 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + bl box_print +_080C386E: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C378C + + thumb_func_start sub_80C3880 +sub_80C3880: @ 80C3880 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldr r0, =0x02039ce8 + ldr r0, [r0] + ldr r1, =0x0000052b + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C38C8 + ldr r0, =gUnknown_0856FB0C + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + ldr r0, =gUnknown_085ECF99 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x14 + movs r3, 0x58 + bl box_print + b _080C38E2 + .pool +_080C38C8: + ldr r0, =gUnknown_0856FB0C + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + ldr r0, =gUnknown_085ECF99 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x10 + movs r3, 0x59 + bl box_print +_080C38E2: + ldr r0, =0x02039ce8 + ldr r1, [r0] + ldrb r0, [r1, 0x5] + cmp r0, 0 + beq _080C390C + ldr r2, =0x00000544 + adds r0, r1, r2 + ldrh r5, [r0] + adds r2, 0x2 + adds r0, r1, r2 + ldrh r6, [r0] + b _080C3914 + .pool +_080C390C: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrh r5, [r0, 0xE] + ldrb r6, [r0, 0x10] +_080C3914: + ldr r0, =0x000003e7 + cmp r5, r0 + bls _080C391C + adds r5, r0, 0 +_080C391C: + cmp r6, 0x3B + bls _080C3922 + movs r6, 0x3B +_080C3922: + ldr r1, =gUnknown_085ECF8F + movs r0, 0x1 + movs r2, 0 + bl GetStringWidth + mov r10, r0 + ldr r0, =0x02039ce8 + ldr r0, [r0] + ldr r1, =0x0000052b + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C3958 + movs r7, 0x90 + movs r4, 0x58 + b _080C395C + .pool +_080C3958: + movs r7, 0x80 + movs r4, 0x59 +_080C395C: + mov r0, r10 + adds r0, 0x1E + subs r7, r0 + lsls r2, r7, 16 + lsrs r2, 16 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + movs r0, 0xF + str r0, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + adds r3, r4, 0 + bl FillWindowPixelRect + ldr r2, =0x02021fc4 + mov r9, r2 + mov r0, r9 + adds r1, r5, 0 + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + lsls r2, r7, 24 + lsrs r2, 24 + ldr r0, =gUnknown_0856FB0C + mov r8, r0 + str r0, [sp] + movs r5, 0x1 + negs r5, r5 + str r5, [sp, 0x4] + mov r1, r9 + str r1, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + adds r3, r4, 0 + bl box_print + adds r7, 0x12 + lsls r2, r7, 24 + lsrs r2, 24 + ldr r1, =gUnknown_0856FB40 + ldr r0, =0x02039ce8 + ldr r0, [r0] + ldrb r0, [r0, 0x7] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [sp] + str r5, [sp, 0x4] + ldr r0, =gUnknown_085ECF8F + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + adds r3, r4, 0 + bl box_print + add r7, r10 + mov r0, r9 + adds r1, r6, 0 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + lsls r2, r7, 24 + lsrs r2, 24 + mov r0, r8 + str r0, [sp] + str r5, [sp, 0x4] + mov r1, r9 + str r1, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + adds r3, r4, 0 + bl box_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_80C3880 + + thumb_func_start sub_80C3A18 +sub_80C3A18: @ 80C3A18 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + ldr r7, =0x02039ce8 + ldr r1, [r7] + ldrb r0, [r1, 0x5] + cmp r0, 0 + beq _080C3ACE + ldr r0, =gUnknown_0856FB48 + mov r8, r0 + ldr r4, =0x0000052b + adds r0, r1, r4 + ldrb r0, [r0] + add r0, r8 + ldrb r3, [r0] + ldr r6, =gUnknown_0856FB0C + str r6, [sp] + movs r5, 0x1 + negs r5, r5 + str r5, [sp, 0x4] + adds r0, r1, 0 + adds r0, 0x19 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x8 + bl box_print + ldr r1, [r7] + adds r1, 0x19 + movs r0, 0x1 + movs r2, 0 + bl GetStringWidth + adds r2, r0, 0 + adds r2, 0xE + lsls r2, 24 + lsrs r2, 24 + ldr r1, [r7] + adds r0, r1, r4 + ldrb r0, [r0] + add r0, r8 + ldrb r3, [r0] + str r6, [sp] + str r5, [sp, 0x4] + adds r1, 0x26 + str r1, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + bl box_print + ldr r0, =gUnknown_0856FB4A + mov r8, r0 + ldr r1, [r7] + adds r0, r1, r4 + ldrb r0, [r0] + add r0, r8 + ldrb r3, [r0] + str r6, [sp] + str r5, [sp, 0x4] + adds r1, 0x33 + str r1, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x8 + bl box_print + ldr r1, [r7] + adds r1, 0x33 + movs r0, 0x1 + movs r2, 0 + bl GetStringWidth + adds r2, r0, 0 + adds r2, 0xE + lsls r2, 24 + lsrs r2, 24 + ldr r1, [r7] + adds r4, r1, r4 + ldrb r0, [r4] + add r0, r8 + ldrb r3, [r0] + str r6, [sp] + str r5, [sp, 0x4] + adds r1, 0x40 + str r1, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + bl box_print +_080C3ACE: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3A18 + + thumb_func_start sub_80C3AF0 +sub_80C3AF0: @ 80C3AF0 + push {r4,lr} + ldr r4, =0x02039ce8 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x4D + ldr r2, =0x00000564 + adds r1, r2 + bl CopyString + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x4D + ldr r2, =0x00007caa + adds r1, r2 + ldrb r1, [r1] + bl StopMusicWhileStringIsPrinted + ldr r1, [r4] + ldr r2, =0x0000052a + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080C3B30 + ldr r0, =0x02021cc4 + adds r1, 0x4D + bl CopyString + ldr r0, [r4] + adds r0, 0x4D + ldr r1, =gUnknown_085ECFA6 + bl ExpandStringRefs +_080C3B30: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3AF0 + + thumb_func_start sub_80C3B50 +sub_80C3B50: @ 80C3B50 + push {r4,lr} + sub sp, 0xC + ldr r4, =0x02039ce8 + ldr r1, [r4] + ldr r2, =0x0000052b + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080C3B8C + ldr r0, =gUnknown_0856FB0C + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + adds r0, r1, 0 + adds r0, 0x4D + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x88 + movs r3, 0x9 + bl box_print + b _080C3BB6 + .pool +_080C3B8C: + adds r1, 0x4D + movs r0, 0x1 + movs r2, 0xD8 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, =gUnknown_0856FB0C + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x4] + ldr r0, [r4] + adds r0, 0x4D + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x9 + bl box_print +_080C3BB6: + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3B50 + + thumb_func_start sub_80C3BC4 +sub_80C3BC4: @ 80C3BC4 + push {r4,lr} + ldr r4, =0x02039ce8 + ldr r1, [r4] + ldrb r0, [r1, 0xB] + cmp r0, 0 + beq _080C3C0E + ldr r0, =0x02021cc4 + ldr r2, =0x0000053a + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x1 + movs r3, 0x3 + bl ConvertIntToDecimalString + ldr r0, =0x02021dc4 + ldr r1, [r4] + ldr r2, =0x0000053c + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r0, =0x02021ec4 + ldr r1, [r4] + ldr r2, =0x0000053e + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x2 + movs r3, 0x2 + bl ConvertIntToDecimalString + ldr r0, [r4] + adds r0, 0x93 + ldr r1, =gUnknown_0856FB4C + bl ExpandStringRefs +_080C3C0E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3BC4 + + thumb_func_start sub_80C3C34 +sub_80C3C34: @ 80C3C34 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0xC + adds r4, r0, 0 + mov r9, r2 + mov r10, r3 + ldr r2, =gUnknown_0856FB55 + ldr r6, =0x02039ce8 + ldr r0, [r6] + ldr r5, =0x0000052b + adds r0, r5 + ldrb r0, [r0] + adds r0, r2 + ldrb r2, [r0] + lsls r4, 28 + movs r0, 0x84 + lsls r0, 22 + adds r4, r0 + lsrs r4, 24 + ldr r0, =gUnknown_0856FB0C + str r0, [sp] + movs r0, 0x1 + negs r0, r0 + mov r8, r0 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + adds r3, r4, 0 + bl box_print + ldr r1, =gUnknown_0856FB57 + ldr r0, [r6] + adds r0, r5 + ldrb r0, [r0] + adds r0, r1 + ldrb r2, [r0] + movs r0, 0x1 + mov r1, r9 + bl GetStringRightAlignXOffset + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + mov r0, r10 + str r0, [sp] + mov r0, r8 + str r0, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + adds r3, r4, 0 + bl box_print + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3C34 + + thumb_func_start sub_80C3CCC +sub_80C3CCC: @ 80C3CCC + push {lr} + ldr r0, =0x02039ce8 + ldr r2, [r0] + ldrb r0, [r2, 0xB] + cmp r0, 0 + beq _080C3CE4 + ldr r1, =gUnknown_085ECFB8 + adds r2, 0x93 + ldr r3, =gUnknown_0856FB0F + movs r0, 0 + bl sub_80C3C34 +_080C3CE4: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3CCC + + thumb_func_start sub_80C3CF4 +sub_80C3CF4: @ 80C3CF4 + push {r4,lr} + ldr r4, =0x02039ce8 + ldr r1, [r4] + ldrb r0, [r1, 0xC] + cmp r0, 0 + beq _080C3D40 + adds r0, r1, 0 + adds r0, 0xD9 + ldr r2, =gUnknown_0856FB5C + ldr r3, =0x0000052a + adds r1, r3 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl CopyString + ldr r1, [r4] + ldr r2, =0x00000165 + adds r0, r1, r2 + movs r3, 0xA9 + lsls r3, 3 + adds r1, r3 + ldrh r1, [r1] + movs r2, 0 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldr r1, [r4] + ldr r2, =0x000001ab + adds r0, r1, r2 + ldr r3, =0x0000054a + adds r1, r3 + ldrh r1, [r1] + movs r2, 0 + movs r3, 0x4 + bl ConvertIntToDecimalString +_080C3D40: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3CF4 + + thumb_func_start sub_80C3D60 +sub_80C3D60: @ 80C3D60 + push {r4,r5,lr} + ldr r5, =0x02039ce8 + ldr r1, [r5] + ldrb r0, [r1, 0xC] + cmp r0, 0 + beq _080C3D9A + ldr r0, =0x02021cc4 + ldr r2, =0x00000165 + adds r1, r2 + bl CopyString + ldr r0, =0x02021dc4 + ldr r1, [r5] + ldr r2, =0x000001ab + adds r1, r2 + bl CopyString + ldr r4, =0x02021fc4 + ldr r1, =gUnknown_085ECFED + adds r0, r4, 0 + bl ExpandStringRefs + ldr r1, [r5] + adds r1, 0xD9 + ldr r3, =gUnknown_0856FB0C + movs r0, 0x1 + adds r2, r4, 0 + bl sub_80C3C34 +_080C3D9A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3D60 + + thumb_func_start sub_80C3DC0 +sub_80C3DC0: @ 80C3DC0 + push {lr} + ldr r0, =0x02039ce8 + ldr r1, [r0] + ldrb r0, [r1, 0x10] + cmp r0, 0 + beq _080C3DDE + ldr r2, =0x00000237 + adds r0, r1, r2 + ldr r2, =0x00000554 + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x1 + movs r3, 0x5 + bl ConvertIntToDecimalString +_080C3DDE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3DC0 + + thumb_func_start sub_80C3DF0 +sub_80C3DF0: @ 80C3DF0 + push {lr} + ldr r0, =0x02039ce8 + ldr r2, [r0] + ldrb r0, [r2, 0x10] + cmp r0, 0 + beq _080C3E0A + ldr r1, =gUnknown_085ED010 + ldr r0, =0x00000237 + adds r2, r0 + ldr r3, =gUnknown_0856FB0F + movs r0, 0x2 + bl sub_80C3C34 +_080C3E0A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3DF0 + + thumb_func_start sub_80C3E20 +sub_80C3E20: @ 80C3E20 + push {lr} + ldr r0, =0x02039ce8 + ldr r2, [r0] + ldr r1, =0x0000052a + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C3E48 + movs r3, 0xAE + lsls r3, 3 + adds r0, r2, r3 + ldr r1, [r0] + cmp r1, 0 + beq _080C3E48 + ldr r3, =0x000002c3 + adds r0, r2, r3 + movs r2, 0x1 + movs r3, 0x5 + bl ConvertIntToDecimalString +_080C3E48: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3E20 + + thumb_func_start sub_80C3E58 +sub_80C3E58: @ 80C3E58 + push {lr} + ldr r0, =0x02039ce8 + ldr r2, [r0] + ldr r1, =0x0000052a + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C3E80 + adds r1, 0x46 + adds r0, r2, r1 + ldr r0, [r0] + cmp r0, 0 + beq _080C3E80 + ldr r1, =gUnknown_085ED036 + ldr r0, =0x000002c3 + adds r2, r0 + ldr r3, =gUnknown_0856FB0F + movs r0, 0x4 + bl sub_80C3C34 +_080C3E80: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3E58 + + thumb_func_start sub_80C3E98 +sub_80C3E98: @ 80C3E98 + push {lr} + ldr r0, =0x02039ce8 + ldr r2, [r0] + ldr r1, =0x0000052a + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C3EBE + ldr r3, =0x00000574 + adds r0, r2, r3 + ldr r1, [r0] + cmp r1, 0 + beq _080C3EBE + ldr r3, =0x0000034f + adds r0, r2, r3 + movs r2, 0x1 + movs r3, 0x5 + bl ConvertIntToDecimalString +_080C3EBE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3E98 + + thumb_func_start sub_80C3ED4 +sub_80C3ED4: @ 80C3ED4 + push {lr} + ldr r0, =0x02039ce8 + ldr r2, [r0] + ldr r1, =0x0000052a + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080C3EFC + adds r1, 0x4A + adds r0, r2, r1 + ldr r0, [r0] + cmp r0, 0 + beq _080C3EFC + ldr r1, =gUnknown_085ED01F + ldr r0, =0x0000034f + adds r2, r0 + ldr r3, =gUnknown_0856FB0F + movs r0, 0x3 + bl sub_80C3C34 +_080C3EFC: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3ED4 + + thumb_func_start sub_80C3F14 +sub_80C3F14: @ 80C3F14 + push {r4,lr} + ldr r4, =0x02039ce8 + ldr r1, [r4] + ldr r2, =0x0000052a + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080C3F46 + ldr r0, =0x00000552 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _080C3F46 + ldr r0, =0x02021cc4 + ldrh r1, [r1] + movs r2, 0x1 + movs r3, 0x5 + bl ConvertIntToDecimalString + ldr r0, [r4] + ldr r1, =0x00000395 + adds r0, r1 + ldr r1, =gUnknown_085ED096 + bl ExpandStringRefs +_080C3F46: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3F14 + + thumb_func_start sub_80C3F64 +sub_80C3F64: @ 80C3F64 + push {lr} + ldr r0, =0x02039ce8 + ldr r2, [r0] + ldr r1, =0x0000052a + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080C3F8C + adds r1, 0x28 + adds r0, r2, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _080C3F8C + ldr r1, =gUnknown_085ED085 + ldr r0, =0x00000395 + adds r2, r0 + ldr r3, =gUnknown_0856FB0F + movs r0, 0x3 + bl sub_80C3C34 +_080C3F8C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3F64 + + thumb_func_start sub_80C3FA4 +sub_80C3FA4: @ 80C3FA4 + push {lr} + ldr r0, =0x02039ce8 + ldr r1, [r0] + ldr r2, =0x0000052a + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080C3FCE + movs r3, 0xAA + lsls r3, 3 + adds r2, r1, r3 + ldrh r0, [r2] + cmp r0, 0 + beq _080C3FCE + ldr r3, =0x000003db + adds r0, r1, r3 + ldrh r1, [r2] + movs r2, 0x1 + movs r3, 0x5 + bl ConvertIntToDecimalString +_080C3FCE: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3FA4 + + thumb_func_start sub_80C3FE0 +sub_80C3FE0: @ 80C3FE0 + push {lr} + ldr r0, =0x02039ce8 + ldr r2, [r0] + ldr r1, =0x0000052a + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080C4008 + adds r1, 0x26 + adds r0, r2, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _080C4008 + ldr r1, =gUnknown_085ED09F + ldr r0, =0x000003db + adds r2, r0 + ldr r3, =gUnknown_0856FB0F + movs r0, 0x4 + bl sub_80C3C34 +_080C4008: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C3FE0 + + thumb_func_start sub_80C4020 +sub_80C4020: @ 80C4020 + push {r4,lr} + ldr r4, =0x02039ce8 + ldr r1, [r4] + ldr r2, =0x0000052a + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080C4044 + cmp r0, 0x1 + ble _080C40B6 + cmp r0, 0x2 + beq _080C4094 + b _080C40B6 + .pool +_080C4044: + ldrb r0, [r1, 0xD] + cmp r0, 0 + beq _080C40B6 + ldr r0, =0x02021cc4 + ldr r2, =0x0000054c + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldr r0, =0x02021dc4 + ldr r1, [r4] + ldr r2, =0x0000054e + adds r1, r2 + ldrh r1, [r1] + movs r2, 0x1 + movs r3, 0x4 + bl ConvertIntToDecimalString + ldr r0, [r4] + ldr r1, =0x00000421 + adds r0, r1 + ldr r1, =gUnknown_085ED0E0 + bl ExpandStringRefs + b _080C40B6 + .pool +_080C4094: + ldr r2, =0x00000596 + adds r1, r2 + ldrh r0, [r1] + cmp r0, 0 + beq _080C40B6 + ldr r0, =0x02021cc4 + ldrh r1, [r1] + movs r2, 0x1 + movs r3, 0x5 + bl ConvertIntToDecimalString + ldr r0, [r4] + ldr r1, =0x00000421 + adds r0, r1 + ldr r1, =gUnknown_085ED0C8 + bl ExpandStringRefs +_080C40B6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C4020 + + thumb_func_start sub_80C40CC +sub_80C40CC: @ 80C40CC + push {lr} + ldr r0, =0x02039ce8 + ldr r2, [r0] + ldr r1, =0x0000052a + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080C40F0 + cmp r0, 0x1 + ble _080C412C + cmp r0, 0x2 + beq _080C4114 + b _080C412C + .pool +_080C40F0: + ldrb r0, [r2, 0xD] + cmp r0, 0 + beq _080C412C + ldr r1, =gUnknown_085ED0D3 + ldr r0, =0x00000421 + adds r2, r0 + ldr r3, =gUnknown_0856FB0C + movs r0, 0x5 + bl sub_80C3C34 + b _080C412C + .pool +_080C4114: + ldr r1, =0x00000596 + adds r0, r2, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _080C412C + ldr r1, =gUnknown_085ED0B6 + ldr r0, =0x00000421 + adds r2, r0 + ldr r3, =gUnknown_0856FB0F + movs r0, 0x5 + bl sub_80C3C34 +_080C412C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C40CC + + thumb_func_start sub_80C4140 +sub_80C4140: @ 80C4140 + push {r4,r5,lr} + sub sp, 0x20 + ldr r1, =gUnknown_0856FB68 + add r0, sp, 0x10 + movs r2, 0x6 + bl memcpy + add r4, sp, 0x18 + ldr r1, =gUnknown_0856FB6E + adds r0, r4, 0 + movs r2, 0x6 + bl memcpy + ldr r0, =0x02039ce8 + ldr r0, [r0] + ldr r1, =0x0000052a + adds r0, r1 + ldrb r0, [r0] + adds r5, r4, 0 + cmp r0, 0 + bne _080C41C0 + movs r4, 0 +_080C416C: + ldr r0, =0x02039ce8 + ldr r0, [r0] + lsls r1, r4, 1 + movs r2, 0xB1 + lsls r2, 3 + adds r0, r2 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, 0 + beq _080C41B6 + bl sub_80D30A0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r4, 20 + movs r2, 0xE0 + lsls r2, 16 + adds r1, r2 + lsrs r1, 16 + adds r2, r5, r4 + ldrb r2, [r2] + adds r2, 0x3 + lsls r2, 24 + lsrs r2, 24 + movs r3, 0x4 + str r3, [sp] + str r3, [sp, 0x4] + add r0, sp + adds r0, 0x10 + ldrb r0, [r0] + str r0, [sp, 0x8] + movs r0, 0x1 + str r0, [sp, 0xC] + movs r0, 0x3 + movs r3, 0xF + bl WriteSequenceToBgTilemapBuffer +_080C41B6: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _080C416C +_080C41C0: + add sp, 0x20 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C4140 + + thumb_func_start sub_80C41D8 +sub_80C41D8: @ 80C41D8 + push {r4,r5,lr} + sub sp, 0x4 + ldr r0, =gMonIconPalettes + ldr r4, =0x02039ce8 + ldr r1, [r4] + movs r5, 0x8D + lsls r5, 3 + adds r1, r5 + movs r2, 0x60 + bl CpuSet + ldr r4, [r4] + ldr r1, =0x00000582 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080C4214 + cmp r0, 0x1 + ble _080C424A + cmp r0, 0x2 + beq _080C422A + cmp r0, 0x3 + beq _080C4242 + b _080C424A + .pool +_080C4214: + movs r2, 0x8D + lsls r2, 3 + adds r0, r4, r2 + movs r1, 0 + str r1, [sp] + movs r1, 0x60 + movs r2, 0 + movs r3, 0 + bl sub_80A2BAC + b _080C424A +_080C422A: + adds r0, r4, r5 + movs r2, 0xFA + lsls r2, 1 + movs r3, 0xA5 + lsls r3, 1 + movs r1, 0x9B + lsls r1, 1 + str r1, [sp] + movs r1, 0x60 + bl sub_80A2BAC + b _080C424A +_080C4242: + adds r0, r4, r5 + movs r1, 0x60 + bl TintPalette_SepiaTone +_080C424A: + ldr r0, =0x02039ce8 + ldr r0, [r0] + movs r1, 0x8D + lsls r1, 3 + adds r0, r1 + movs r1, 0x50 + movs r2, 0xC0 + bl gpu_pal_apply + movs r4, 0 +_080C425E: + ldr r0, =0x02039ce8 + ldr r0, [r0] + lsls r1, r4, 1 + movs r2, 0xB1 + lsls r2, 3 + adds r0, r2 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, 0 + beq _080C428E + movs r1, 0 + bl GetMonIconTiles + adds r1, r0, 0 + lsls r3, r4, 20 + movs r0, 0x80 + lsls r0, 14 + adds r3, r0 + lsrs r3, 16 + movs r0, 0x3 + movs r2, 0x80 + lsls r2, 2 + bl LoadBgTiles +_080C428E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x5 + bls _080C425E + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C41D8 + + thumb_func_start sub_80C42A4 +sub_80C42A4: @ 80C42A4 + push {r4,lr} + sub sp, 0x14 + ldr r1, =gUnknown_0856FB74 + add r0, sp, 0x10 + movs r2, 0x4 + bl memcpy + ldr r0, =0x02039ce8 + ldr r1, [r0] + ldr r2, =0x0000052a + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080C4316 + adds r2, 0x56 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080C4316 + movs r4, 0 +_080C42CC: + ldr r0, =0x02039ce8 + ldr r0, [r0] + ldr r1, =0x00000584 + adds r0, r1 + adds r0, r4 + ldrb r3, [r0] + cmp r3, 0 + beq _080C430C + lsls r1, r4, 18 + movs r2, 0xA0 + lsls r2, 17 + adds r1, r2 + lsrs r1, 16 + lsls r2, r4, 1 + adds r2, r4 + adds r2, 0x2 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x2 + str r0, [sp] + str r0, [sp, 0x4] + subs r0, r3, 0x1 + add r0, sp + adds r0, 0x10 + ldrb r0, [r0] + str r0, [sp, 0x8] + movs r0, 0x1 + str r0, [sp, 0xC] + movs r0, 0x3 + movs r3, 0x2 + bl WriteSequenceToBgTilemapBuffer +_080C430C: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _080C42CC +_080C4316: + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C42A4 + + thumb_func_start sub_80C4330 +sub_80C4330: @ 80C4330 + push {lr} + ldr r0, =gUnknown_0856F54C + movs r1, 0xB0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_0856F56C + movs r1, 0xC0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_0856F58C + movs r1, 0xD0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_0856F5AC + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =0x02039ce8 + ldr r1, [r0] + ldr r0, =0x000017a8 + adds r1, r0 + movs r2, 0x80 + lsls r2, 3 + movs r0, 0x3 + movs r3, 0x80 + bl LoadBgTiles + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C4330 + + thumb_func_start sub_80C438C +sub_80C438C: @ 80C438C + push {r4,lr} + 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 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80C438C + + thumb_func_start sub_80C43A8 +sub_80C43A8: @ 80C43A8 + push {r4,lr} + sub sp, 0x8 + ldr r0, =0x02039ce8 + ldr r0, [r0] + ldrb r0, [r0, 0x3] + cmp r0, 0x4 + bls _080C43B8 + b _080C4532 +_080C43B8: + lsls r0, 2 + ldr r1, =_080C43CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C43CC: + .4byte _080C43E0 + .4byte _080C43F8 + .4byte _080C4418 + .4byte _080C44D8 + .4byte _080C4500 +_080C43E0: + ldr r0, =0x02039ce8 + ldr r1, [r0] + ldr r0, =0x000013a8 + adds r1, r0 + movs r2, 0x80 + lsls r2, 3 + movs r0, 0x3 + b _080C4406 + .pool +_080C43F8: + ldr r0, =0x02039ce8 + ldr r1, [r0] + ldr r3, =0x000019a8 + adds r1, r3 + movs r2, 0xC0 + lsls r2, 5 + movs r0, 0 +_080C4406: + movs r3, 0 + bl LoadBgTiles + b _080C4536 + .pool +_080C4418: + ldr r4, =0x02039ce8 + ldr r2, [r4] + ldr r1, =0x0000052a + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080C447C + ldr r1, =gUnknown_0856FAE4 + ldr r3, =0x00000535 + adds r0, r2, r3 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + movs r2, 0x60 + bl gpu_pal_apply + ldr r0, =gUnknown_0856F4EC + movs r1, 0x30 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, [r4] + ldr r1, =0x00000534 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080C44B2 + ldr r0, =gUnknown_0856F4AC + movs r1, 0x10 + movs r2, 0x20 + bl gpu_pal_apply + b _080C44B2 + .pool +_080C447C: + ldr r1, =gUnknown_0856FAF8 + ldr r3, =0x00000535 + adds r0, r2, r3 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + movs r2, 0x60 + bl gpu_pal_apply + ldr r0, =gUnknown_0856F50C + movs r1, 0x30 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, [r4] + ldr r1, =0x00000534 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080C44B2 + ldr r0, =gUnknown_0856F4CC + movs r1, 0x10 + movs r2, 0x20 + bl gpu_pal_apply +_080C44B2: + ldr r0, =gUnknown_0856F52C + movs r1, 0x40 + movs r2, 0x20 + bl gpu_pal_apply + b _080C4536 + .pool +_080C44D8: + ldr r4, =0x02039ce8 + ldr r1, [r4] + ldr r3, =0x00003ca8 + adds r1, r3 + movs r0, 0 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00005ca8 + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + b _080C4536 + .pool +_080C4500: + movs r4, 0x20 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 +_080C4532: + movs r0, 0x1 + b _080C4542 +_080C4536: + ldr r0, =0x02039ce8 + ldr r1, [r0] + ldrb r0, [r1, 0x3] + adds r0, 0x1 + strb r0, [r1, 0x3] + movs r0, 0 +_080C4542: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C43A8 + + thumb_func_start sub_80C4550 +sub_80C4550: @ 80C4550 + push {r4-r7,lr} + adds r7, r0, 0 + ldr r0, =0x02039ce8 + ldr r0, [r0] + ldr r1, =0x00005ca8 + adds r6, r0, r1 + movs r1, 0 +_080C455E: + movs r2, 0 + lsls r5, r1, 16 + asrs r1, r5, 16 + lsls r3, r1, 5 + lsls r0, r1, 4 + subs r0, r1 + lsls r4, r0, 1 +_080C456C: + lsls r0, r2, 16 + asrs r1, r0, 16 + adds r2, r0, 0 + cmp r1, 0x1D + bgt _080C4590 + adds r0, r3, r1 + lsls r0, 1 + adds r0, r6 + adds r1, r4, r1 + lsls r1, 1 + adds r1, r7 + ldrh r1, [r1] + b _080C4598 + .pool +_080C4590: + adds r0, r3, r1 + lsls r0, 1 + adds r0, r6 + ldrh r1, [r7] +_080C4598: + strh r1, [r0] + movs r1, 0x80 + lsls r1, 9 + adds r0, r2, r1 + lsrs r2, r0, 16 + asrs r0, 16 + cmp r0, 0x1F + ble _080C456C + adds r0, r5, r1 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _080C455E + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80C4550 + + thumb_func_start sub_80C45C0 +sub_80C45C0: @ 80C45C0 + push {r4-r7,lr} + adds r7, r0, 0 + ldr r0, =0x02039ce8 + ldr r0, [r0] + ldr r1, =0x00003ca8 + adds r6, r0, r1 + movs r1, 0 +_080C45CE: + movs r2, 0 + lsls r5, r1, 16 + asrs r1, r5, 16 + lsls r3, r1, 5 + lsls r0, r1, 4 + subs r0, r1 + lsls r4, r0, 1 +_080C45DC: + lsls r0, r2, 16 + asrs r1, r0, 16 + adds r2, r0, 0 + cmp r1, 0x1D + bgt _080C4600 + adds r0, r3, r1 + lsls r0, 1 + adds r0, r6 + adds r1, r4, r1 + lsls r1, 1 + adds r1, r7 + ldrh r1, [r1] + b _080C4608 + .pool +_080C4600: + adds r0, r3, r1 + lsls r0, 1 + adds r0, r6 + ldrh r1, [r7] +_080C4608: + strh r1, [r0] + movs r1, 0x80 + lsls r1, 9 + adds r0, r2, r1 + lsrs r2, r0, 16 + asrs r0, 16 + cmp r0, 0x1F + ble _080C45DC + adds r0, r5, r1 + lsrs r1, r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _080C45CE + movs r0, 0 + bl CopyBgTilemapBufferToVram + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80C45C0 + + thumb_func_start sub_80C4630 +sub_80C4630: @ 80C4630 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + movs r0, 0xC0 + mov r8, r0 + movs r2, 0x3 + mov r10, r2 + ldr r2, =gUnknown_0856FB78 + ldr r4, =0x02039ce8 + ldr r1, [r4] + ldr r3, =0x0000052b + adds r0, r1, r3 + ldrb r0, [r0] + adds r0, r2 + ldrb r3, [r0] + ldr r0, =0x00000535 + adds r1, r0 + ldrb r0, [r1] + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x4 + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x8F + movs r2, 0xF + bl FillBgTilemapBufferRect + ldr r0, [r4] + ldrb r0, [r0, 0x5] + cmp r0, 0 + bne _080C4724 + movs r2, 0x4 + mov r9, r2 + movs r2, 0 + movs r6, 0x1 +_080C467E: + ldr r0, =0x02039ce8 + ldr r1, [r0] + lsls r0, r2, 16 + asrs r7, r0, 16 + adds r1, 0x11 + adds r1, r7 + ldrb r0, [r1] + cmp r0, 0 + beq _080C4700 + mov r3, r9 + lsls r5, r3, 24 + lsrs r5, 24 + str r6, [sp] + str r6, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + movs r0, 0x3 + mov r1, r8 + adds r2, r5, 0 + movs r3, 0xF + bl FillBgTilemapBufferRect + mov r1, r8 + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + mov r4, r9 + adds r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + str r6, [sp] + str r6, [sp, 0x4] + mov r2, r10 + str r2, [sp, 0x8] + movs r0, 0x3 + adds r2, r4, 0 + movs r3, 0xF + bl FillBgTilemapBufferRect + mov r1, r8 + adds r1, 0x10 + lsls r1, 16 + lsrs r1, 16 + str r6, [sp] + str r6, [sp, 0x4] + mov r3, r10 + str r3, [sp, 0x8] + movs r0, 0x3 + adds r2, r5, 0 + movs r3, 0x10 + bl FillBgTilemapBufferRect + mov r1, r8 + adds r1, 0x11 + lsls r1, 16 + lsrs r1, 16 + str r6, [sp] + str r6, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] + movs r0, 0x3 + adds r2, r4, 0 + movs r3, 0x10 + bl FillBgTilemapBufferRect +_080C4700: + adds r0, r7, 0x1 + lsls r0, 16 + mov r1, r8 + adds r1, 0x2 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + mov r2, r9 + lsls r1, r2, 16 + movs r3, 0xC0 + lsls r3, 10 + adds r1, r3 + lsrs r1, 16 + mov r9, r1 + lsrs r2, r0, 16 + asrs r0, 16 + cmp r0, 0x7 + ble _080C467E +_080C4724: + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + 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_80C4630 + + thumb_func_start sub_80C474C +sub_80C474C: @ 80C474C + push {r4-r6,lr} + sub sp, 0xC + ldr r6, =0x02039ce8 + ldr r1, [r6] + ldr r2, =0x0000052a + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080C4800 + ldrb r0, [r1, 0x10] + cmp r0, 0 + beq _080C478A + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x8D + movs r2, 0x1B + movs r3, 0x9 + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x9D + movs r2, 0x1B + movs r3, 0xA + bl FillBgTilemapBufferRect +_080C478A: + ldr r0, [r6] + movs r1, 0xAE + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _080C47BE + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x8D + movs r2, 0x15 + movs r3, 0xD + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x9D + movs r2, 0x15 + movs r3, 0xE + bl FillBgTilemapBufferRect +_080C47BE: + ldr r0, [r6] + ldr r2, =0x00000574 + adds r0, r2 + ldr r0, [r0] + cmp r0, 0 + beq _080C48B8 + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x8D + movs r2, 0x1B + movs r3, 0xB + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x9D + movs r2, 0x1B + movs r3, 0xC + bl FillBgTilemapBufferRect + b _080C48B8 + .pool +_080C4800: + ldrb r0, [r1, 0x10] + cmp r0, 0 + beq _080C482E + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + movs r5, 0 + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x8D + movs r2, 0x1B + movs r3, 0x9 + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x9D + movs r2, 0x1B + movs r3, 0xA + bl FillBgTilemapBufferRect +_080C482E: + ldr r0, [r6] + movs r1, 0xAA + lsls r1, 3 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _080C4864 + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + movs r5, 0 + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x8D + movs r2, 0x1B + movs r3, 0xD + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x9D + movs r2, 0x1B + movs r3, 0xE + bl FillBgTilemapBufferRect +_080C4864: + ldr r0, [r6] + ldrb r0, [r0, 0xD] + cmp r0, 0 + beq _080C48B8 + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + movs r5, 0 + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x8D + movs r2, 0x11 + movs r3, 0xF + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x9D + movs r2, 0x11 + movs r3, 0x10 + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x8C + movs r2, 0x1B + movs r3, 0xF + bl FillBgTilemapBufferRect + str r4, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x9C + movs r2, 0x1B + movs r3, 0x10 + bl FillBgTilemapBufferRect +_080C48B8: + movs r0, 0x3 + bl CopyBgTilemapBufferToVram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80C474C + + thumb_func_start sub_80C48C8 +sub_80C48C8: @ 80C48C8 + push {lr} + ldr r3, =0x02039ce8 + ldr r1, [r3] + ldrb r0, [r1, 0x6] + adds r0, 0x1 + strb r0, [r1, 0x6] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3C + bls _080C48F6 + ldr r1, [r3] + movs r0, 0 + strb r0, [r1, 0x6] + ldr r2, [r3] + ldrb r0, [r2, 0x7] + movs r1, 0x1 + eors r0, r1 + strb r0, [r2, 0x7] + ldr r0, [r3] + ldr r1, =0x00000529 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] +_080C48F6: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C48C8 + + thumb_func_start sub_80C4904 +sub_80C4904: @ 80C4904 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x02039b58 + movs r1, 0x64 + muls r0, r1 + adds r0, r2 + ldrb r0, [r0, 0x1] + bx lr + .pool + thumb_func_end sub_80C4904 + + thumb_func_start sub_80C4918 +sub_80C4918: @ 80C4918 + push {r4,lr} + ldr r4, =sub_80C4960 + adds r0, r4, 0 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r4 + ldr r0, =sub_80C26D4 + bl SetHBlankCallback + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C4918 + + thumb_func_start sub_80C4940 +sub_80C4940: @ 80C4940 + push {lr} + ldr r0, =sub_80C4960 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + beq _080C4958 + movs r0, 0 + b _080C495A + .pool +_080C4958: + movs r0, 0x1 +_080C495A: + pop {r1} + bx r1 + thumb_func_end sub_80C4940 + + thumb_func_start sub_80C4960 +sub_80C4960: @ 80C4960 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, =gUnknown_0856FB28 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r4, r1, r2 +_080C4972: + 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 _080C4972 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C4960 + + thumb_func_start sub_80C4998 +sub_80C4998: @ 80C4998 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x1 + bl HideBg + movs r0, 0x3 + bl HideBg + bl remove_some_task + bl dp12_8087EA4 + movs r1, 0 + ldr r0, =0x02038c28 + movs r2, 0 + movs r3, 0xF0 + lsls r3, 3 + adds r0, r3 +_080C49BC: + strh r2, [r0] + adds r0, 0x2 + adds r1, 0x1 + cmp r1, 0x9F + bls _080C49BC + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C4998 + + thumb_func_start sub_80C49D8 +sub_80C49D8: @ 80C49D8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r0 + ldr r0, =0x02039ce8 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x9] + mov r0, r8 + ldrh r1, [r0, 0xA] + movs r2, 0xA + ldrsh r0, [r0, r2] + cmp r0, 0x4C + ble _080C4A08 + movs r0, 0x4D + mov r3, r8 + strh r0, [r3, 0xA] + b _080C4A0E + .pool +_080C4A08: + adds r0, r1, 0x7 + mov r4, r8 + strh r0, [r4, 0xA] +_080C4A0E: + ldr r0, =0x02039ce8 + ldr r0, [r0] + mov r2, r8 + ldrh r1, [r2, 0xA] + ldr r3, =0x00007ca8 + adds r0, r3 + strh r1, [r0] + ldrh r0, [r2, 0xA] + bl sub_80C32EC + mov r4, r8 + movs r0, 0xA + ldrsh r7, [r4, r0] + movs r0, 0xA0 + subs r0, r7 + mov r9, r0 + subs r4, r0, r7 + negs r0, r7 + lsls r6, r0, 16 + movs r0, 0xA0 + lsls r0, 16 + adds r1, r4, 0 + bl __udivsi3 + adds r5, r0, 0 + ldr r1, =0xffff0000 + adds r5, r1 + adds r0, r5, 0 + muls r0, r4 + adds r0, r6, r0 + str r0, [sp] + adds r0, r5, 0 + adds r1, r4, 0 + bl __udivsi3 + mov r10, r0 + lsls r5, 1 + movs r2, 0 + cmp r2, r7 + bcs _080C4A78 + ldr r3, =0x02038c28 +_080C4A60: + lsls r0, r2, 16 + asrs r0, 16 + lsls r1, r0, 1 + adds r1, r3 + negs r2, r0 + strh r2, [r1] + adds r0, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + asrs r0, 16 + cmp r0, r7 + bcc _080C4A60 +_080C4A78: + lsls r1, r2, 16 + mov r3, r9 + lsls r0, r3, 16 + asrs r3, r0, 16 + ldr r4, =0x02039ce8 + mov r9, r4 + ldr r4, [sp] + lsrs r7, r4, 16 + cmp r1, r0 + bge _080C4AB0 + ldr r0, =0x02038c28 + mov r12, r0 + adds r4, r3, 0 +_080C4A92: + lsrs r3, r6, 16 + adds r6, r5 + mov r2, r10 + subs r5, r2 + asrs r0, r1, 16 + lsls r1, r0, 1 + add r1, r12 + strh r3, [r1] + adds r0, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, r2, 16 + asrs r0, r1, 16 + cmp r0, r4 + blt _080C4A92 +_080C4AB0: + adds r3, r7, 0 + lsls r1, r2, 16 + asrs r0, r1, 16 + cmp r0, 0x9F + bgt _080C4ACE + ldr r2, =0x02038c28 +_080C4ABC: + asrs r0, r1, 16 + lsls r1, r0, 1 + adds r1, r2 + strh r3, [r1] + adds r0, 0x1 + lsls r1, r0, 16 + asrs r0, r1, 16 + cmp r0, 0x9F + ble _080C4ABC +_080C4ACE: + mov r3, r9 + ldr r0, [r3] + movs r1, 0x1 + strb r1, [r0, 0x9] + mov r4, r8 + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0x4C + ble _080C4AE6 + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080C4AE6: + movs r0, 0 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C49D8 + + thumb_func_start sub_80C4B08 +sub_80C4B08: @ 80C4B08 + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r0, 0 + ldr r4, =0x02039ce8 + ldr r1, [r4] + movs r0, 0 + strb r0, [r1, 0x9] + bl sub_8087598 + adds r2, r4, 0 + cmp r0, 0x1 + beq _080C4C08 +_080C4B20: + ldr r3, [r2] + ldrb r0, [r3, 0x4] + cmp r0, 0x4 + bhi _080C4BE4 + lsls r0, 2 + ldr r1, =_080C4B3C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C4B3C: + .4byte _080C4B50 + .4byte _080C4B6C + .4byte _080C4B8C + .4byte _080C4BB0 + .4byte _080C4BCE +_080C4B50: + movs r0, 0x1 + movs r1, 0 + bl FillWindowPixelBuffer + movs r0, 0x20 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + b _080C4BF6 +_080C4B6C: + ldr r0, [r2] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _080C4B80 + bl sub_80C34B0 + lsls r0, 24 + cmp r0, 0 + bne _080C4BF6 + b _080C4C08 +_080C4B80: + bl sub_80C3438 + lsls r0, 24 + cmp r0, 0 + bne _080C4BF6 + b _080C4C08 +_080C4B8C: + ldr r0, =0x02039ce8 + ldr r1, [r0] + ldrb r0, [r1, 0x8] + cmp r0, 0 + bne _080C4BA8 + ldr r2, =0x00000a48 + adds r0, r1, r2 + bl sub_80C45C0 + b _080C4BF6 + .pool +_080C4BA8: + movs r0, 0x1 + bl sub_80C438C + b _080C4BF6 +_080C4BB0: + ldr r0, =0x02039ce8 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _080C4BC4 + bl sub_80C474C + b _080C4BF6 + .pool +_080C4BC4: + movs r0, 0x2 + movs r1, 0 + bl FillWindowPixelBuffer + b _080C4BF6 +_080C4BCE: + ldr r0, =0x02039ce8 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + beq _080C4BF6 + bl sub_80C4FF0 + b _080C4BF6 + .pool +_080C4BE4: + ldrh r0, [r5, 0x8] + adds r0, 0x1 + movs r1, 0 + strh r0, [r5, 0x8] + movs r0, 0x1 + strb r0, [r3, 0x9] + ldr r0, [r2] + strb r1, [r0, 0x4] + b _080C4C08 +_080C4BF6: + ldr r2, =0x02039ce8 + ldr r1, [r2] + ldrb r0, [r1, 0x4] + adds r0, 0x1 + strb r0, [r1, 0x4] + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0 + beq _080C4B20 +_080C4C08: + movs r0, 0 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C4B08 + + thumb_func_start sub_80C4C1C +sub_80C4C1C: @ 80C4C1C + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x02039ce8 + ldr r1, [r4] + movs r0, 0 + strb r0, [r1, 0x9] + ldr r0, [r4] + ldrb r0, [r0, 0x8] + cmp r0, 0 + beq _080C4C50 + movs r0, 0x2 + bl sub_80C438C + ldr r0, [r4] + ldr r1, =0x00000ef8 + adds r0, r1 + bl sub_80C4550 + ldr r0, [r4] + movs r1, 0xB3 + lsls r1, 3 + adds r0, r1 + bl sub_80C45C0 + bl sub_80C4630 +_080C4C50: + movs r0, 0x1 + bl sub_80C438C + ldr r2, [r4] + ldrb r0, [r2, 0x8] + movs r1, 0x1 + eors r0, r1 + strb r0, [r2, 0x8] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x9] + movs r0, 0xFA + bl audio_play + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C4C1C + + thumb_func_start sub_80C4C84 +sub_80C4C84: @ 80C4C84 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r0 + ldr r0, =0x02039ce8 + ldr r0, [r0] + movs r2, 0 + strb r2, [r0, 0x9] + mov r0, r8 + ldrh r1, [r0, 0xA] + movs r3, 0xA + ldrsh r0, [r0, r3] + cmp r0, 0x5 + bgt _080C4CB0 + mov r4, r8 + strh r2, [r4, 0xA] + b _080C4CB6 + .pool +_080C4CB0: + subs r0, r1, 0x5 + mov r1, r8 + strh r0, [r1, 0xA] +_080C4CB6: + ldr r0, =0x02039ce8 + ldr r0, [r0] + mov r2, r8 + ldrh r1, [r2, 0xA] + ldr r3, =0x00007ca8 + adds r0, r3 + strh r1, [r0] + ldrh r0, [r2, 0xA] + bl sub_80C32EC + mov r4, r8 + movs r0, 0xA + ldrsh r7, [r4, r0] + movs r0, 0xA0 + subs r0, r7 + mov r9, r0 + subs r4, r0, r7 + negs r0, r7 + lsls r6, r0, 16 + movs r0, 0xA0 + lsls r0, 16 + adds r1, r4, 0 + bl __udivsi3 + adds r5, r0, 0 + ldr r1, =0xffff0000 + adds r5, r1 + adds r0, r5, 0 + muls r0, r4 + adds r0, r6, r0 + str r0, [sp] + adds r0, r5, 0 + adds r1, r4, 0 + bl __udivsi3 + mov r10, r0 + lsrs r5, 1 + movs r2, 0 + cmp r2, r7 + bcs _080C4D20 + ldr r3, =0x02038c28 +_080C4D08: + lsls r0, r2, 16 + asrs r0, 16 + lsls r1, r0, 1 + adds r1, r3 + negs r2, r0 + strh r2, [r1] + adds r0, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + asrs r0, 16 + cmp r0, r7 + bcc _080C4D08 +_080C4D20: + lsls r1, r2, 16 + mov r3, r9 + lsls r0, r3, 16 + asrs r3, r0, 16 + ldr r4, =0x02039ce8 + mov r9, r4 + ldr r4, [sp] + lsrs r7, r4, 16 + cmp r1, r0 + bge _080C4D56 + ldr r0, =0x02038c28 + mov r12, r0 + adds r4, r3, 0 +_080C4D3A: + lsrs r3, r6, 16 + adds r6, r5 + add r5, r10 + asrs r0, r1, 16 + lsls r1, r0, 1 + add r1, r12 + strh r3, [r1] + adds r0, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, r2, 16 + asrs r0, r1, 16 + cmp r0, r4 + blt _080C4D3A +_080C4D56: + adds r3, r7, 0 + lsls r1, r2, 16 + asrs r0, r1, 16 + cmp r0, 0x9F + bgt _080C4D74 + ldr r2, =0x02038c28 +_080C4D62: + asrs r0, r1, 16 + lsls r1, r0, 1 + adds r1, r2 + strh r3, [r1] + adds r0, 0x1 + lsls r1, r0, 16 + asrs r0, r1, 16 + cmp r0, 0x9F + ble _080C4D62 +_080C4D74: + mov r1, r9 + ldr r0, [r1] + movs r1, 0x1 + strb r1, [r0, 0x9] + mov r2, r8 + movs r3, 0xA + ldrsh r0, [r2, r3] + cmp r0, 0 + bgt _080C4D8C + ldrh r0, [r2, 0x8] + adds r0, 0x1 + strh r0, [r2, 0x8] +_080C4D8C: + movs r0, 0 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C4C84 + + thumb_func_start sub_80C4DB0 +sub_80C4DB0: @ 80C4DB0 + push {lr} + movs r0, 0x1 + bl ShowBg + movs r0, 0x3 + bl ShowBg + movs r0, 0 + bl SetHBlankCallback + ldr r0, =sub_80C4960 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + movs r0, 0 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C4DB0 + + thumb_func_start sub_80C4DDC +sub_80C4DDC: @ 80C4DDC + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =0x02039ce8 + ldr r0, =0x00007cac + bl AllocZeroed + adds r1, r0, 0 + str r1, [r4] + movs r2, 0xA6 + lsls r2, 3 + adds r0, r1, r2 + str r5, [r0] + ldr r0, =sub_80C5868 + cmp r5, r0 + bne _080C4E18 + ldr r0, =0x0000052c + adds r1, r0 + ldr r0, =0x00007fff + b _080C4E1E + .pool +_080C4E18: + ldr r2, =0x0000052c + adds r1, r2 + movs r0, 0 +_080C4E1E: + strh r0, [r1] + bl InUnionRoom + adds r3, r0, 0 + cmp r3, 0x1 + bne _080C4E3C + ldr r1, =0x02039ce8 + ldr r0, [r1] + strb r3, [r0, 0x5] + adds r2, r1, 0 + b _080C4E44 + .pool +_080C4E3C: + ldr r2, =0x02039ce8 + ldr r1, [r2] + movs r0, 0 + strb r0, [r1, 0x5] +_080C4E44: + ldr r0, [r2] + ldr r1, =0x00007caa + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + ldr r0, [r2] + ldr r2, =0x00000534 + adds r0, r2 + bl sub_80C3020 + ldr r0, =sub_80C2C80 + bl SetMainCallback2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C4DDC + + thumb_func_start sub_80C4E74 +sub_80C4E74: @ 80C4E74 + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, =0x02039ce8 + ldr r0, =0x00007cac + bl AllocZeroed + str r0, [r5] + movs r2, 0xA6 + lsls r2, 3 + adds r1, r0, r2 + str r6, [r1] + movs r1, 0x1 + strb r1, [r0, 0x5] + ldr r0, [r5] + ldr r1, =0x00000534 + adds r0, r1 + ldr r2, =0x02039b58 + movs r1, 0x64 + muls r1, r4 + adds r1, r2 + movs r2, 0x64 + bl memcpy + ldr r1, [r5] + ldr r2, =0x020229e8 + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x1A] + ldr r2, =0x00007caa + adds r1, r2 + strb r0, [r1] + ldr r0, =sub_80C2C80 + bl SetMainCallback2 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C4E74 + + thumb_func_start sub_80C4EE4 +sub_80C4EE4: @ 80C4EE4 + push {r4,r5,lr} + ldr r4, =0x02039ce8 + ldr r0, [r4] + movs r1, 0 + strb r1, [r0] + ldr r2, [r4] + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x12] + strb r0, [r2, 0x6] + ldr r0, [r4] + strb r1, [r0, 0x7] + ldr r0, [r4] + strb r1, [r0, 0x8] + ldr r0, [r4] + movs r2, 0xA5 + lsls r2, 3 + adds r0, r2 + strb r1, [r0] + bl sub_80C4F50 + ldr r1, [r4] + ldr r3, =0x0000052a + adds r1, r3 + strb r0, [r1] + movs r5, 0 +_080C4F18: + movs r0, 0xD + muls r0, r5 + adds r0, 0x19 + ldr r1, [r4] + adds r0, r1, r0 + lsls r2, r5, 1 + ldr r3, =0x0000055c + adds r1, r3 + adds r1, r2 + ldrh r1, [r1] + bl CopyEasyChatWord + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _080C4F18 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C4EE4 + + thumb_func_start sub_80C4F50 +sub_80C4F50: @ 80C4F50 + push {lr} + ldr r0, =0x02039ce8 + ldr r1, [r0] + cmp r1, 0 + bne _080C4F7C + ldr r0, =gUnknown_82E9530 + ldrb r1, [r0] + subs r0, r1, 0x4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _080C4F74 + movs r0, 0 + b _080C4FC2 + .pool +_080C4F74: + cmp r1, 0x3 + beq _080C4FC0 + movs r0, 0x1 + b _080C4FC2 +_080C4F7C: + ldr r2, =0x0000056c + adds r0, r1, r2 + ldrb r2, [r0] + subs r0, r2, 0x4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _080C4FA0 + ldr r0, =0x0000052b + adds r1, r0 + movs r0, 0 + strb r0, [r1] + b _080C4FC2 + .pool +_080C4FA0: + lsls r0, r2, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _080C4FB8 + ldr r2, =0x0000052b + adds r1, r2 + movs r0, 0x1 + strb r0, [r1] + b _080C4FC2 + .pool +_080C4FB8: + ldr r0, =0x0000052b + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] +_080C4FC0: + movs r0, 0x2 +_080C4FC2: + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C4F50 + + thumb_func_start sub_80C4FCC +sub_80C4FCC: @ 80C4FCC + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + movs r2, 0xFC + lsls r2, 24 + adds r0, r2 + lsrs r0, 24 + cmp r0, 0x1 + bhi _080C4FE2 + movs r0, 0 + b _080C4FEC +_080C4FE2: + cmp r1, 0x3 + beq _080C4FEA + movs r0, 0x1 + b _080C4FEC +_080C4FEA: + movs r0, 0x2 +_080C4FEC: + pop {r1} + bx r1 + thumb_func_end sub_80C4FCC + + thumb_func_start sub_80C4FF0 +sub_80C4FF0: @ 80C4FF0 + push {r4-r6,lr} + sub sp, 0x8 + bl InUnionRoom + cmp r0, 0x1 + bne _080C5060 + ldr r0, =0x03003124 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080C5060 + ldr r5, =0x02039ce8 + ldr r0, [r5] + ldr r1, =0x00000583 + adds r0, r1 + ldrb r0, [r0] + bl TrainerClassToTrainerPic + lsls r0, 16 + lsrs r0, 16 + ldr r4, =gUnknown_0856FB18 + ldr r1, [r5] + ldr r3, =0x00000534 + adds r2, r1, r3 + ldrb r3, [r2] + lsls r3, 1 + ldr r2, =0x0000052b + adds r1, r2 + ldrb r1, [r1] + lsls r1, 2 + adds r3, r1 + adds r1, r3, r4 + ldrb r2, [r1] + adds r4, 0x1 + adds r3, r4 + ldrb r3, [r3] + movs r1, 0x8 + str r1, [sp] + movs r1, 0x2 + str r1, [sp, 0x4] + movs r1, 0x1 + bl sub_818D938 + b _080C50AE + .pool +_080C5060: + ldr r2, =gUnknown_0856FB20 + ldr r6, =0x02039ce8 + ldr r0, [r6] + ldr r5, =0x00000534 + adds r1, r0, r5 + ldr r3, =0x0000052a + adds r0, r3 + ldrb r0, [r0] + lsls r0, 1 + ldrb r1, [r1] + adds r0, r1 + adds r0, r2 + ldrb r0, [r0] + bl TrainerClassToTrainerPic + lsls r0, 16 + lsrs r0, 16 + ldr r4, =gUnknown_0856FB18 + ldr r1, [r6] + adds r5, r1, r5 + ldrb r3, [r5] + lsls r3, 1 + ldr r2, =0x0000052b + adds r1, r2 + ldrb r1, [r1] + lsls r1, 2 + adds r3, r1 + adds r1, r3, r4 + ldrb r2, [r1] + adds r4, 0x1 + adds r3, r4 + ldrb r3, [r3] + movs r1, 0x8 + str r1, [sp] + movs r1, 0x2 + str r1, [sp, 0x4] + movs r1, 0x1 + bl sub_818D938 +_080C50AE: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C4FF0 + + thumb_func_start sub_80C50D0 +sub_80C50D0: @ 80C50D0 + push {lr} + sub sp, 0x8 + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0xE + movs r1, 0 + bl SetGpuReg + movs r0, 0xC + movs r1, 0 + bl SetGpuReg + movs r0, 0xA + movs r1, 0 + bl SetGpuReg + movs r0, 0x8 + movs r1, 0 + bl SetGpuReg + 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, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + 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 + mov r1, sp + movs r0, 0 + strh r0, [r1] + movs r1, 0xC0 + lsls r1, 19 + ldr r2, =0x0100c000 + mov r0, sp + bl CpuSet + movs r0, 0 + str r0, [sp, 0x4] + add r0, sp, 0x4 + movs r1, 0xE0 + lsls r1, 19 + ldr r2, =0x05000100 + bl CpuSet + add sp, 0x8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C50D0 + + thumb_func_start sub_80C51C4 +sub_80C51C4: @ 80C51C4 + push {lr} + bl sub_80C51F0 + ldr r0, =sub_80C544C + bl SetMainCallback2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C51C4 + + thumb_func_start sub_80C51D8 +sub_80C51D8: @ 80C51D8 + push {lr} + ldr r0, =0x02039cec + ldr r0, [r0] + ldr r0, [r0] + bl SetMainCallback2 + bl sub_80C52E4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C51D8 + + thumb_func_start sub_80C51F0 +sub_80C51F0: @ 80C51F0 + push {r4-r6,lr} + adds r4, r0, 0 + ldr r5, =0x02039cec + ldr r0, [r5] + cmp r0, 0 + beq _080C5204 + movs r0, 0x1 + b _080C52C8 + .pool +_080C5204: + movs r0, 0x18 + bl AllocZeroed + str r0, [r5] + cmp r0, 0 + bne _080C5214 + movs r0, 0x2 + b _080C52C8 +_080C5214: + str r4, [r0] + bl sav1_map_get_name + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3A + beq _080C5232 + cmp r4, 0xCA + beq _080C5232 + ldr r0, [r5] + movs r1, 0xB0 + strh r1, [r0, 0x8] + movs r1, 0x68 + strh r1, [r0, 0xA] + b _080C5240 +_080C5232: + ldr r2, =0x02039cec + ldr r1, [r2] + movs r0, 0xB0 + strh r0, [r1, 0x8] + movs r0, 0x30 + strh r0, [r1, 0xA] + adds r5, r2, 0 +_080C5240: + ldr r1, [r5] + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r2, =0x00000eb8 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1, 0x6] + bl sub_8185290 + ldr r3, [r5] + movs r1, 0x1 + ands r0, r1 + ldrb r2, [r3, 0xE] + movs r1, 0x2 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xE] + ldr r2, [r5] + ldrb r1, [r2, 0xE] + movs r0, 0xF + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0xE] + bl sub_80C2E40 + ldr r3, [r5] + lsls r0, 4 + ldrb r2, [r3, 0xE] + movs r1, 0xF + ands r1, r2 + orrs r1, r0 + strb r1, [r3, 0xE] + movs r4, 0 + adds r6, r5, 0 +_080C5286: + lsls r5, r4, 1 + ldr r1, =0x000008c4 + adds r0, r5, r1 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _080C52A2 + ldr r1, [r6] + adds r1, 0xF + adds r1, r4 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080C52A2: + ldr r2, =0x000008c5 + adds r0, r5, r2 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _080C52BC + ldr r1, [r6] + adds r1, 0xF + adds r1, r4 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080C52BC: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _080C5286 + movs r0, 0 +_080C52C8: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C51F0 + + thumb_func_start sub_80C52E4 +sub_80C52E4: @ 80C52E4 + push {r4,lr} + ldr r4, =0x02039cec + ldr r0, [r4] + cmp r0, 0 + beq _080C5308 + movs r1, 0 + movs r2, 0x18 + bl memset + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] + b _080C530A + .pool +_080C5308: + movs r0, 0x1 +_080C530A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80C52E4 + + thumb_func_start sub_80C5310 +sub_80C5310: @ 80C5310 + push {r4,lr} + ldr r4, =0x02039cf0 + ldr r0, [r4] + cmp r0, 0 + beq _080C5324 + movs r0, 0x1 + b _080C533A + .pool +_080C5324: + ldr r0, =0x00002434 + bl AllocZeroed + str r0, [r4] + cmp r0, 0 + beq _080C5338 + movs r0, 0 + b _080C533A + .pool +_080C5338: + movs r0, 0x2 +_080C533A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80C5310 + + thumb_func_start sub_80C5340 +sub_80C5340: @ 80C5340 + push {r4,lr} + bl FreeAllWindowBuffers + ldr r4, =0x02039cf0 + ldr r0, [r4] + cmp r0, 0 + bne _080C5358 + movs r0, 0x1 + b _080C53A0 + .pool +_080C5358: + ldr r0, [r0, 0x28] + cmp r0, 0 + beq _080C5368 + bl Free + ldr r1, [r4] + movs r0, 0 + str r0, [r1, 0x28] +_080C5368: + ldr r0, [r4] + ldr r0, [r0, 0x24] + cmp r0, 0 + beq _080C537A + bl Free + ldr r1, [r4] + movs r0, 0 + str r0, [r1, 0x24] +_080C537A: + ldr r0, [r4] + ldr r0, [r0, 0x20] + cmp r0, 0 + beq _080C538C + bl Free + ldr r1, [r4] + movs r0, 0 + str r0, [r1, 0x20] +_080C538C: + ldr r0, [r4] + ldr r2, =0x00002434 + movs r1, 0 + bl memset + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] +_080C53A0: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C5340 + + thumb_func_start pokemon_details +pokemon_details: @ 80C53AC + push {r4-r7,lr} + sub sp, 0x10 + ldr r0, =0x02039cf0 + ldr r6, [r0] + adds r0, r6, 0 + adds r0, 0x2C + ldrb r0, [r0] + cmp r0, 0 + beq _080C5416 + ldr r3, =gUnknown_085713E0 + ldr r0, =0x02039cec + ldr r0, [r0] + ldrb r4, [r0, 0xE] + lsls r4, 28 + lsrs r0, r4, 29 + subs r0, 0x1 + lsls r0, 2 + adds r0, r3 + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r1, 8 + lsrs r0, r4, 29 + subs r0, 0x1 + lsls r0, 2 + adds r5, r3, 0x2 + adds r0, r5 + movs r7, 0 + ldrsh r2, [r0, r7] + lsls r2, 8 + lsrs r0, r4, 29 + subs r0, 0x1 + lsls r0, 2 + adds r0, r3 + movs r7, 0 + ldrsh r3, [r0, r7] + lsrs r4, 29 + subs r4, 0x1 + lsls r4, 2 + adds r4, r5 + movs r5, 0 + ldrsh r0, [r4, r5] + str r0, [sp] + movs r7, 0x2E + ldrsh r0, [r6, r7] + str r0, [sp, 0x4] + movs r4, 0x30 + ldrsh r0, [r6, r4] + str r0, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + movs r0, 0x2 + bl SetBgAffine +_080C5416: + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end pokemon_details + + thumb_func_start sub_80C5438 +sub_80C5438: @ 80C5438 + push {lr} + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + pop {r0} + bx r0 + thumb_func_end sub_80C5438 + + thumb_func_start sub_80C544C +sub_80C544C: @ 80C544C + push {lr} + bl sub_80C5484 + cmp r0, 0 + beq _080C5464 + ldr r0, =sub_80C5A48 + movs r1, 0 + bl CreateTask + ldr r0, =sub_80C5438 + bl SetMainCallback2 +_080C5464: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C544C + + thumb_func_start sub_80C5470 +sub_80C5470: @ 80C5470 + push {lr} + bl sub_80C570C + cmp r0, 0 + beq _080C547E + bl sub_80C51D8 +_080C547E: + pop {r0} + bx r0 + thumb_func_end sub_80C5470 + + thumb_func_start sub_80C5484 +sub_80C5484: @ 80C5484 + push {r4,r5,lr} + sub sp, 0xC + movs r0, 0 + str r0, [sp, 0x8] + ldr r0, =0x02039cec + ldr r0, [r0] + ldrh r0, [r0, 0x4] + cmp r0, 0xA + bls _080C5498 + b _080C56F4 +_080C5498: + lsls r0, 2 + ldr r1, =_080C54AC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C54AC: + .4byte _080C54D8 + .4byte _080C54EE + .4byte _080C54F4 + .4byte _080C550A + .4byte _080C5510 + .4byte _080C5560 + .4byte _080C5570 + .4byte _080C55D0 + .4byte _080C5624 + .4byte _080C5684 + .4byte _080C56D0 +_080C54D8: + movs r0, 0 + bl SetVBlankCallback + bl remove_some_task + bl SetVBlankHBlankCallbacksToNull + movs r0, 0x2 + bl DisableInterrupts + b _080C56F4 +_080C54EE: + bl sub_80C50D0 + b _080C56F4 +_080C54F4: + bl ResetTasks + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + bl sub_80A1A74 + bl reset_temp_tile_data_buffers + b _080C56F4 +_080C550A: + bl sub_80C5310 + b _080C56F4 +_080C5510: + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085713E8 + movs r0, 0x1 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r4, =0x02039cf0 + ldr r1, [r4] + adds r1, 0x32 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00001032 + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00002032 + adds r1, r0 + movs r0, 0x3 + bl SetBgTilemapBuffer + movs r0, 0x2 + movs r1, 0x6 + movs r2, 0x1 + bl SetBgAttribute + b _080C56F4 + .pool +_080C5560: + ldr r0, =gUnknown_08571400 + bl InitWindows + bl DeactivateAllTextPrinters + b _080C56F4 + .pool +_080C5570: + ldr r0, =gUnknown_085712F8 + add r1, sp, 0x8 + bl malloc_and_decompress + ldr r4, =0x02039cf0 + ldr r1, [r4] + str r0, [r1, 0x20] + ldr r0, =gUnknown_08571060 + add r1, sp, 0x8 + bl malloc_and_decompress + ldr r1, [r4] + str r0, [r1, 0x24] + ldr r0, =gUnknown_085712C0 + add r1, sp, 0x8 + bl malloc_and_decompress + ldr r1, [r4] + str r0, [r1, 0x28] + ldr r1, =gUnknown_08DE08C8 + movs r4, 0 + str r4, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + ldr r1, =gUnknown_08DE2084 + str r4, [sp] + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _080C56F4 + .pool +_080C55D0: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + beq _080C55DC + b _080C56FE +_080C55DC: + movs r5, 0x1E + str r5, [sp] + movs r4, 0x14 + str r4, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + b _080C56F4 +_080C5624: + ldr r4, =gUnknown_08DE07C8 + movs r2, 0xD0 + lsls r2, 1 + adds r0, r4, 0 + movs r1, 0 + bl gpu_pal_apply + ldr r5, =0x02039cec + ldr r0, [r5] + ldrb r0, [r0, 0xE] + lsrs r0, 4 + lsls r0, 5 + adds r4, 0x20 + adds r0, r4 + movs r1, 0x10 + movs r2, 0x20 + bl gpu_pal_apply + movs r0, 0 + bl stdpal_get + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + bl sub_80C629C + ldr r1, [r5] + ldrb r0, [r1, 0xC] + ldrb r1, [r1, 0xD] + bl sub_80C6104 + ldr r5, [r5] + ldrb r0, [r5, 0xE] + movs r1, 0xE + ands r1, r0 + cmp r1, 0x2 + beq _080C5674 + cmp r1, 0x4 + bne _080C56F4 +_080C5674: + movs r0, 0 + strh r0, [r5, 0x4] + movs r0, 0x1 + b _080C5700 + .pool +_080C5684: + 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 + bl sub_80C62DC + ldr r0, =pokemon_details + bl SetVBlankCallback + movs r4, 0x1 + negs r4, r4 + adds r0, r4, 0 + movs r1, 0x10 + movs r2, 0 + bl sub_80A2A20 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + b _080C56F4 + .pool +_080C56D0: + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl fade_and_return_progress_probably + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080C56FE + ldr r0, =0x02039cec + ldr r0, [r0] + strh r1, [r0, 0x4] + movs r0, 0x1 + b _080C5700 + .pool +_080C56F4: + ldr r0, =0x02039cec + ldr r1, [r0] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] +_080C56FE: + movs r0, 0 +_080C5700: + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C5484 + + thumb_func_start sub_80C570C +sub_80C570C: @ 80C570C + push {lr} + sub sp, 0x4 + ldr r1, =0x02039cec + ldr r0, [r1] + ldrh r0, [r0, 0x4] + adds r2, r1, 0 + cmp r0, 0x5 + bhi _080C57E4 + lsls r0, 2 + ldr r1, =_080C5730 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C5730: + .4byte _080C5748 + .4byte _080C5770 + .4byte _080C577C + .4byte _080C57A6 + .4byte _080C57AC + .4byte _080C57BE +_080C5748: + ldr r0, [r2] + ldrb r0, [r0, 0xE] + movs r1, 0xE + ands r1, r0 + cmp r1, 0x2 + beq _080C576A + cmp r1, 0x4 + beq _080C576A + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _080C57E4 +_080C576A: + ldr r1, [r2] + movs r0, 0x2 + b _080C57EC +_080C5770: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + beq _080C57E4 + b _080C57EE +_080C577C: + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0 + bl HideBg + movs r0, 0x1 + bl HideBg + movs r0, 0x2 + bl HideBg + movs r0, 0 + bl SetVBlankCallback + bl remove_some_task + bl SetVBlankHBlankCallbacksToNull + b _080C57E4 +_080C57A6: + bl sub_80C63FC + b _080C57E4 +_080C57AC: + bl sub_80C50D0 + bl ResetTasks + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + b _080C57E4 +_080C57BE: + movs r0, 0 + bl UnsetBgTilemapBuffer + movs r0, 0x1 + bl UnsetBgTilemapBuffer + movs r0, 0x2 + bl UnsetBgTilemapBuffer + bl sub_80C5340 + ldr r0, =0x02039cec + ldr r1, [r0] + movs r0, 0 + strh r0, [r1, 0x4] + movs r0, 0x1 + b _080C57F0 + .pool +_080C57E4: + ldr r0, =0x02039cec + ldr r1, [r0] + ldrh r0, [r1, 0x4] + adds r0, 0x1 +_080C57EC: + strh r0, [r1, 0x4] +_080C57EE: + movs r0, 0 +_080C57F0: + add sp, 0x4 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C570C + + thumb_func_start sub_80C57FC +sub_80C57FC: @ 80C57FC + push {r4-r7,lr} + lsls r0, 16 + lsrs r6, r0, 16 + movs r4, 0 + ldr r7, =gUnknown_08571454 + lsls r1, 16 + asrs r5, r1, 16 +_080C580A: + lsls r0, r4, 3 + adds r3, r0, r7 + movs r1, 0 + ldrsh r0, [r3, r1] + cmp r0, r5 + bgt _080C5854 + movs r1, 0x2 + ldrsh r0, [r3, r1] + cmp r0, r5 + blt _080C5854 + movs r0, 0x4 + ldrsh r1, [r3, r0] + lsls r0, r6, 16 + asrs r2, r0, 16 + cmp r1, r2 + bgt _080C5854 + movs r1, 0x6 + ldrsh r0, [r3, r1] + cmp r0, r2 + blt _080C5854 + cmp r4, 0x5 + bls _080C5842 + ldr r0, =0x02039cec + ldr r0, [r0] + adds r0, r4 + ldrb r0, [r0, 0x9] + cmp r0, 0 + beq _080C585E +_080C5842: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r0, 24 + b _080C5860 + .pool +_080C5854: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xC + bls _080C580A +_080C585E: + movs r0, 0 +_080C5860: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80C57FC + + thumb_func_start sub_80C5868 +sub_80C5868: @ 80C5868 + push {lr} + bl sub_80C5484 + cmp r0, 0 + beq _080C58C6 + ldr r1, =0x02039cec + ldr r0, [r1] + ldrb r0, [r0, 0xE] + lsls r0, 28 + lsrs r0, 29 + cmp r0, 0x1 + blt _080C58AC + cmp r0, 0x2 + bgt _080C58AC + ldr r0, =sub_80C5BD8 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x1 + strh r0, [r1, 0x8] + b _080C58C0 + .pool +_080C58AC: + ldr r2, [r1] + ldrb r1, [r2, 0xE] + movs r0, 0xF + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0xE] + ldr r0, =sub_80C5A48 + movs r1, 0 + bl CreateTask +_080C58C0: + ldr r0, =sub_80C5438 + bl SetMainCallback2 +_080C58C6: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C5868 + + thumb_func_start sub_80C58D4 +sub_80C58D4: @ 80C58D4 + push {r4,lr} + ldr r4, =0x02039cf8 + ldr r0, [r4] + bl sub_80C51F0 + ldr r0, =0x02039cec + ldr r1, [r0] + ldrh r0, [r4, 0x4] + strh r0, [r1, 0x8] + ldrh r0, [r4, 0x6] + strh r0, [r1, 0xA] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x8 + bl memset + bl InBattlePyramid + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080C5914 + cmp r0, 0x2 + beq _080C591C + bl sub_8085784 + b _080C5924 + .pool +_080C5914: + ldr r0, =0x000001cd + b _080C5920 + .pool +_080C591C: + movs r0, 0xE7 + lsls r0, 1 +_080C5920: + bl song_play_for_text +_080C5924: + ldr r0, =sub_80C5868 + bl SetMainCallback2 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C58D4 + + thumb_func_start sub_80C5934 +sub_80C5934: @ 80C5934 + push {lr} + bl sub_80C570C + cmp r0, 0 + beq _080C599A + ldr r0, =0x02039cec + ldr r2, [r0] + ldrb r0, [r2, 0xE] + lsls r0, 28 + lsrs r0, 29 + cmp r0, 0x2 + beq _080C5994 + cmp r0, 0x2 + bgt _080C595C + cmp r0, 0x1 + beq _080C5962 + b _080C599A + .pool +_080C595C: + cmp r0, 0x3 + beq _080C5970 + b _080C599A +_080C5962: + ldr r0, =sub_80C5868 + bl sub_80C6454 + b _080C599A + .pool +_080C5970: + ldr r1, =0x02039cf8 + ldr r0, [r2] + str r0, [r1] + ldrh r0, [r2, 0x8] + strh r0, [r1, 0x4] + ldrh r0, [r2, 0xA] + strh r0, [r1, 0x6] + bl sub_80C52E4 + ldr r0, =sub_80C58D4 + bl sub_8185E24 + b _080C599A + .pool +_080C5994: + ldr r0, =sub_80C5868 + bl sub_80C4DDC +_080C599A: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C5934 + + thumb_func_start sub_80C59A4 +sub_80C59A4: @ 80C59A4 + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + adds r4, r3, 0 + lsls r1, 24 + lsrs r1, 24 + adds r2, r1, 0 + cmp r1, 0x1 + blt _080C59CC + cmp r1, 0x2 + ble _080C59F4 + cmp r1, 0x3 + bne _080C59CC + ldr r0, =0x02039cec + ldr r2, [r0] + ldrb r1, [r2, 0xE] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080C59D4 +_080C59CC: + movs r0, 0 + b _080C5A30 + .pool +_080C59D4: + movs r0, 0xF + negs r0, r0 + ands r0, r1 + movs r1, 0x6 + orrs r0, r1 + strb r0, [r2, 0xE] + adds r0, r3, 0 + bl DestroyTask + ldr r0, =sub_80C5934 + bl SetMainCallback2 + b _080C5A1A + .pool +_080C59F4: + ldr r0, =0x02039cec + ldr r3, [r0] + movs r0, 0x7 + ands r2, r0 + lsls r2, 1 + ldrb r1, [r3, 0xE] + subs r0, 0x16 + ands r0, r1 + orrs r0, r2 + strb r0, [r3, 0xE] + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80C5BD8 + str r1, [r0] + movs r1, 0 + strh r1, [r0, 0x8] +_080C5A1A: + ldr r0, =0x02039cec + ldr r2, [r0] + ldr r0, =0x02039cf0 + ldr r1, [r0] + ldr r0, [r1] + ldrh r0, [r0, 0x20] + strh r0, [r2, 0x8] + ldr r0, [r1] + ldrh r0, [r0, 0x22] + strh r0, [r2, 0xA] + movs r0, 0x1 +_080C5A30: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C59A4 + + thumb_func_start sub_80C5A48 +sub_80C5A48: @ 80C5A48 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + ldr r2, =0x030022c0 + ldrh r1, [r2, 0x2C] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080C5A80 + ldr r0, =0x02039cf0 + ldr r4, [r0] + ldr r1, [r4] + ldrh r3, [r1, 0x22] + movs r7, 0x22 + ldrsh r0, [r1, r7] + cmp r0, 0x8 + ble _080C5A80 + subs r0, r3, 0x2 + strh r0, [r1, 0x22] + ldr r1, [r4] + movs r3, 0x22 + ldrsh r0, [r1, r3] + cmp r0, 0x7 + bgt _080C5A7E + movs r0, 0x2 + strh r0, [r1, 0x22] +_080C5A7E: + movs r5, 0x1 +_080C5A80: + ldrh r1, [r2, 0x2C] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080C5AAE + ldr r0, =0x02039cf0 + ldr r4, [r0] + ldr r1, [r4] + ldrh r3, [r1, 0x22] + movs r7, 0x22 + ldrsh r0, [r1, r7] + cmp r0, 0x87 + bgt _080C5AAE + adds r0, r3, 0x2 + strh r0, [r1, 0x22] + ldr r1, [r4] + movs r3, 0x22 + ldrsh r0, [r1, r3] + cmp r0, 0x88 + ble _080C5AAC + movs r0, 0x88 + strh r0, [r1, 0x22] +_080C5AAC: + movs r5, 0x1 +_080C5AAE: + ldrh r1, [r2, 0x2C] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080C5ADC + ldr r0, =0x02039cf0 + ldr r4, [r0] + ldr r1, [r4] + ldrh r3, [r1, 0x20] + movs r7, 0x20 + ldrsh r0, [r1, r7] + cmp r0, 0x5 + ble _080C5ADC + subs r0, r3, 0x2 + strh r0, [r1, 0x20] + ldr r1, [r4] + movs r3, 0x20 + ldrsh r0, [r1, r3] + cmp r0, 0x4 + bgt _080C5ADA + movs r0, 0x5 + strh r0, [r1, 0x20] +_080C5ADA: + movs r5, 0x1 +_080C5ADC: + ldrh r1, [r2, 0x2C] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080C5B0A + ldr r0, =0x02039cf0 + ldr r4, [r0] + ldr r1, [r4] + ldrh r3, [r1, 0x20] + movs r7, 0x20 + ldrsh r0, [r1, r7] + cmp r0, 0xE7 + bgt _080C5B0A + adds r0, r3, 0x2 + strh r0, [r1, 0x20] + ldr r1, [r4] + movs r3, 0x20 + ldrsh r0, [r1, r3] + cmp r0, 0xE8 + ble _080C5B08 + movs r0, 0xE8 + strh r0, [r1, 0x20] +_080C5B08: + movs r5, 0x1 +_080C5B0A: + cmp r5, 0 + bne _080C5B88 + ldr r4, =0x02039cec + ldr r0, [r4] + ldrb r3, [r0, 0xC] + cmp r3, 0 + beq _080C5B5E + ldrh r1, [r2, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080C5B5E + cmp r3, 0x3 + bhi _080C5B48 + movs r0, 0x5 + bl audio_play + ldr r0, [r4] + ldrb r1, [r0, 0xC] + adds r0, r6, 0 + bl sub_80C59A4 + cmp r0, 0 + bne _080C5BCA + b _080C5B5E + .pool +_080C5B48: + cmp r3, 0x4 + bne _080C5B5E + movs r0, 0x3 + bl audio_play + ldr r0, =sub_80C5470 + bl SetMainCallback2 + adds r0, r6, 0 + bl DestroyTask +_080C5B5E: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080C5BCA + movs r0, 0x3 + bl audio_play + ldr r0, =sub_80C5470 + bl SetMainCallback2 + adds r0, r6, 0 + bl DestroyTask + b _080C5BCA + .pool +_080C5B88: + ldr r0, =0x02039cf0 + ldr r0, [r0] + ldr r1, [r0] + ldrh r0, [r1, 0x20] + subs r0, 0x5 + lsls r0, 16 + asrs r0, 16 + ldrh r1, [r1, 0x22] + adds r1, 0x5 + lsls r1, 16 + asrs r1, 16 + bl sub_80C57FC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x02039cec + ldr r0, [r4] + ldrb r0, [r0, 0xC] + cmp r0, r5 + beq _080C5BCA + adds r0, r5, 0 + bl sub_80C5ED0 + ldr r1, [r4] + ldrb r0, [r1, 0xC] + strb r0, [r1, 0xD] + ldr r0, [r4] + strb r5, [r0, 0xC] + ldr r1, [r4] + ldrb r0, [r1, 0xC] + ldrb r1, [r1, 0xD] + bl sub_80C6104 +_080C5BCA: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C5A48 + + thumb_func_start sub_80C5BD8 +sub_80C5BD8: @ 80C5BD8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r5, r0, 3 + ldr r0, =0x03005e08 + mov r8, r0 + adds r6, r5, r0 + ldr r7, =0x02039cec + ldr r0, [r7] + ldrh r0, [r0, 0x4] + cmp r0, 0x1 + beq _080C5CD4 + cmp r0, 0x1 + bgt _080C5C0C + cmp r0, 0 + beq _080C5C14 + b _080C5D9C + .pool +_080C5C0C: + cmp r0, 0x2 + bne _080C5C12 + b _080C5D2A +_080C5C12: + b _080C5D9C +_080C5C14: + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _080C5C4C + movs r0, 0x1 + movs r1, 0 + bl sub_80C5F58 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + strh r0, [r6, 0x2] + strh r0, [r6, 0x4] + movs r0, 0x15 + strh r0, [r6, 0x6] + strh r0, [r6, 0x8] + movs r0, 0x1 + negs r0, r0 + ldr r1, =0x00007fff + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _080C5CA4 + .pool +_080C5C4C: + movs r1, 0xFE + lsls r1, 1 + adds r0, r1, 0 + strh r0, [r6, 0x2] + strh r0, [r6, 0x4] + movs r1, 0x15 + negs r1, r1 + adds r0, r1, 0 + strh r0, [r6, 0x6] + strh r0, [r6, 0x8] + 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 + bl sub_80C62DC + ldr r0, =pokemon_details + bl SetVBlankCallback + movs r5, 0x1 + negs r5, r5 + ldr r4, =0x00007fff + adds r0, r5, 0 + movs r1, 0x10 + adds r2, r4, 0 + bl sub_80A2A20 + str r4, [sp] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe +_080C5CA4: + ldr r4, =0x02039cf0 + ldr r0, [r4] + adds r0, 0x2C + movs r1, 0x1 + strb r1, [r0] + movs r1, 0x2 + ldrsh r0, [r6, r1] + bl sub_8151624 + ldr r1, [r4] + strh r0, [r1, 0x2E] + movs r1, 0x4 + ldrsh r0, [r6, r1] + bl sub_8151624 + ldr r1, [r4] + strh r0, [r1, 0x30] + b _080C5D9C + .pool +_080C5CD4: + bl fade_and_return_progress_probably + ldrh r0, [r6, 0x6] + ldrh r1, [r6, 0x2] + adds r0, r1 + strh r0, [r6, 0x2] + ldrh r0, [r6, 0x8] + ldrh r1, [r6, 0x4] + adds r0, r1 + strh r0, [r6, 0x4] + movs r1, 0x2 + ldrsh r0, [r6, r1] + bl sub_8151624 + ldr r4, =0x02039cf0 + ldr r1, [r4] + strh r0, [r1, 0x2E] + movs r1, 0x4 + ldrsh r0, [r6, r1] + bl sub_8151624 + ldr r1, [r4] + strh r0, [r1, 0x30] + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _080C5D1C + movs r0, 0x2 + ldrsh r1, [r6, r0] + movs r0, 0xFE + lsls r0, 1 + cmp r1, r0 + ble _080C5DA6 + b _080C5D9C + .pool +_080C5D1C: + movs r0, 0x2 + ldrsh r1, [r6, r0] + movs r0, 0x80 + lsls r0, 1 + cmp r1, r0 + bne _080C5DA6 + b _080C5D9C +_080C5D2A: + ldr r0, =0x02039cf0 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x2C + ldrb r0, [r1] + cmp r0, 0 + beq _080C5D3C + movs r0, 0 + strb r0, [r1] +_080C5D3C: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080C5DA6 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _080C5D64 + adds r0, r4, 0 + bl DestroyTask + ldr r0, =sub_80C5934 + bl SetMainCallback2 + b _080C5D82 + .pool +_080C5D64: + movs r0, 0 + movs r1, 0 + bl sub_80C5F58 + ldr r2, [r7] + ldrb r1, [r2, 0xE] + movs r0, 0xF + negs r0, r0 + ands r0, r1 + strb r0, [r2, 0xE] + mov r0, r8 + subs r0, 0x8 + adds r0, r5, r0 + ldr r1, =sub_80C5A48 + str r1, [r0] +_080C5D82: + movs r0, 0x2 + movs r1, 0x6 + movs r2, 0 + bl SetBgAttribute + ldr r0, =0x02039cec + ldr r1, [r0] + movs r0, 0 + b _080C5DA4 + .pool +_080C5D9C: + ldr r0, =0x02039cec + ldr r1, [r0] + ldrh r0, [r1, 0x4] + adds r0, 0x1 +_080C5DA4: + strh r0, [r1, 0x4] +_080C5DA6: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C5BD8 + + thumb_func_start sub_80C5DB8 +sub_80C5DB8: @ 80C5DB8 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + movs r4, 0 +_080C5DC2: + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _080C5DC2 + ldr r4, =gUnknown_085ED8FF + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x60 + bl GetStringCenterAlignXOffset + lsls r2, r0, 24 + lsrs r2, 24 + ldr r6, =gUnknown_08571448 + str r6, [sp] + movs r0, 0 + mov r8, r0 + str r0, [sp, 0x4] + str r4, [sp, 0x8] + movs r1, 0x1 + movs r3, 0x5 + bl box_print + ldr r4, =gUnknown_085ED90E + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x60 + bl GetStringCenterAlignXOffset + lsls r2, r0, 24 + lsrs r2, 24 + str r6, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x1 + movs r3, 0x5 + bl box_print + str r6, [sp] + mov r0, r8 + str r0, [sp, 0x4] + ldr r0, =gUnknown_085ED91C + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x8 + movs r2, 0x5 + movs r3, 0x4 + bl box_print + ldr r4, =0x02021fc4 + ldr r5, =0x02039cec + ldr r0, [r5] + ldrh r1, [r0, 0x6] + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x5 + bl ConvertIntToDecimalString + movs r0, 0x8 + adds r1, r4, 0 + movs r2, 0x5B + bl GetStringRightAlignXOffset + lsls r2, r0, 24 + lsrs r2, 24 + str r6, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r4, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x8 + movs r3, 0x10 + bl box_print + ldr r1, [r5] + ldrh r0, [r1, 0x8] + subs r0, 0x5 + lsls r0, 16 + asrs r0, 16 + ldrh r1, [r1, 0xA] + adds r1, 0x5 + lsls r1, 16 + asrs r1, 16 + bl sub_80C57FC + ldr r1, [r5] + strb r0, [r1, 0xC] + ldr r0, [r5] + mov r1, r8 + strb r1, [r0, 0xD] + ldr r0, [r5] + ldrb r0, [r0, 0xC] + bl sub_80C5ED0 + movs r4, 0 +_080C5E92: + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x4 + bls _080C5E92 + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C5DB8 + + thumb_func_start sub_80C5ED0 +sub_80C5ED0: @ 80C5ED0 + push {r4,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x3 + movs r1, 0 + bl FillWindowPixelBuffer + cmp r4, 0x3 + bne _080C5F18 + ldr r0, =0x02039cec + ldr r0, [r0] + ldrb r0, [r0, 0xE] + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + bne _080C5F18 + ldr r0, =gUnknown_0857144B + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, =gUnknown_08571614 + ldr r0, [r0] + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x2 + movs r3, 0 + bl box_print + b _080C5F3A + .pool +_080C5F18: + cmp r4, 0 + beq _080C5F3A + ldr r0, =gUnknown_0857144B + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + ldr r1, =gUnknown_08571614 + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [sp, 0x8] + movs r0, 0x3 + movs r1, 0x1 + movs r2, 0x2 + movs r3, 0 + bl box_print +_080C5F3A: + movs r0, 0x3 + movs r1, 0x3 + bl CopyWindowToVram + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C5ED0 + + thumb_func_start sub_80C5F58 +sub_80C5F58: @ 80C5F58 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r0, =0x02039cec + ldr r0, [r0] + ldrb r0, [r0, 0xE] + lsls r0, 28 + lsrs r0, 29 + cmp r0, 0x1 + beq _080C5F80 + cmp r0, 0x2 + beq _080C5FC2 + b _080C60EE + .pool +_080C5F80: + cmp r2, 0 + beq _080C5FA8 + ldr r0, =0x02039cf0 + ldr r0, [r0] + ldr r1, [r0, 0x20] + movs r0, 0xC + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r0, 0x10 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r2, 0x10 + movs r3, 0x3 + bl CopyToBgTilemapBufferRect_ChangePalette + b _080C6004 + .pool +_080C5FA8: + movs r0, 0xC + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r0, 0x10 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0 + movs r2, 0x10 + movs r3, 0x3 + bl FillBgTilemapBufferRect + b _080C6004 +_080C5FC2: + cmp r2, 0 + beq _080C5FEC + ldr r0, =0x02039cf0 + ldr r0, [r0] + ldr r1, [r0, 0x20] + adds r1, 0x54 + movs r0, 0xC + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r0, 0x10 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r2, 0x10 + movs r3, 0xA + bl CopyToBgTilemapBufferRect_ChangePalette + b _080C6004 + .pool +_080C5FEC: + movs r0, 0xC + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r0, 0x10 + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0 + movs r2, 0x10 + movs r3, 0xA + bl FillBgTilemapBufferRect +_080C6004: + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + cmp r7, 0 + beq _080C6084 + movs r4, 0xFE + lsls r4, 1 + adds r0, r4, 0 + bl sub_8151624 + adds r6, r0, 0 + lsls r6, 16 + asrs r6, 16 + adds r0, r4, 0 + bl sub_8151624 + lsls r0, 16 + asrs r0, 16 + ldr r5, =gUnknown_085713E0 + ldr r1, =0x02039cec + ldr r1, [r1] + ldrb r4, [r1, 0xE] + lsls r4, 28 + lsrs r1, r4, 29 + subs r1, 0x1 + lsls r1, 2 + adds r1, r5 + movs r2, 0 + ldrsh r1, [r1, r2] + lsls r1, 8 + lsrs r2, r4, 29 + subs r2, 0x1 + lsls r2, 2 + adds r3, r5, 0x2 + mov r8, r3 + add r2, r8 + movs r3, 0 + ldrsh r2, [r2, r3] + lsls r2, 8 + lsrs r3, r4, 29 + subs r3, 0x1 + lsls r3, 2 + adds r3, r5 + movs r5, 0 + ldrsh r3, [r3, r5] + lsrs r4, 29 + subs r4, 0x1 + lsls r4, 2 + add r4, r8 + movs r5, 0 + ldrsh r4, [r4, r5] + str r4, [sp] + str r6, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + movs r0, 0x2 + bl SetBgAffine + b _080C60EE + .pool +_080C6084: + movs r4, 0x80 + lsls r4, 1 + adds r0, r4, 0 + bl sub_8151624 + adds r6, r0, 0 + lsls r6, 16 + asrs r6, 16 + adds r0, r4, 0 + bl sub_8151624 + lsls r0, 16 + asrs r0, 16 + ldr r5, =gUnknown_085713E0 + ldr r1, =0x02039cec + ldr r1, [r1] + ldrb r4, [r1, 0xE] + lsls r4, 28 + lsrs r1, r4, 29 + subs r1, 0x1 + lsls r1, 2 + adds r1, r5 + movs r2, 0 + ldrsh r1, [r1, r2] + lsls r1, 8 + lsrs r2, r4, 29 + subs r2, 0x1 + lsls r2, 2 + adds r3, r5, 0x2 + mov r8, r3 + add r2, r8 + movs r3, 0 + ldrsh r2, [r2, r3] + lsls r2, 8 + lsrs r3, r4, 29 + subs r3, 0x1 + lsls r3, 2 + adds r3, r5 + movs r5, 0 + ldrsh r3, [r3, r5] + lsrs r4, 29 + subs r4, 0x1 + lsls r4, 2 + add r4, r8 + movs r5, 0 + ldrsh r4, [r4, r5] + str r4, [sp] + str r6, [sp, 0x4] + str r0, [sp, 0x8] + str r7, [sp, 0xC] + movs r0, 0x2 + bl SetBgAffine +_080C60EE: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C5F58 + + thumb_func_start sub_80C6104 +sub_80C6104: @ 80C6104 + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + cmp r5, 0x2 + beq _080C614C + cmp r5, 0x2 + bgt _080C611E + cmp r5, 0x1 + beq _080C6128 + b _080C61C4 +_080C611E: + cmp r5, 0x3 + beq _080C6170 + cmp r5, 0x4 + beq _080C61A4 + b _080C61C4 +_080C6128: + ldr r0, =0x02039cf0 + ldr r0, [r0] + ldr r1, [r0, 0x24] + movs r0, 0xC + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x10 + movs r3, 0x3 + bl CopyToBgTilemapBufferRect_ChangePalette + b _080C61CE + .pool +_080C614C: + ldr r0, =0x02039cf0 + ldr r0, [r0] + ldr r1, [r0, 0x24] + movs r0, 0xA8 + lsls r0, 1 + adds r1, r0 + movs r0, 0xC + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x10 + b _080C6192 + .pool +_080C6170: + ldr r0, =0x02039cec + ldr r0, [r0] + ldrb r1, [r0, 0xE] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080C61C4 + ldr r0, =0x02039cf0 + ldr r0, [r0] + ldr r1, [r0, 0x28] + movs r0, 0xC + str r0, [sp] + str r5, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x2 +_080C6192: + movs r3, 0xA + bl CopyToBgTilemapBufferRect_ChangePalette + b _080C61CE + .pool +_080C61A4: + ldr r1, =gUnknown_08DE3350 + movs r0, 0x9 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x15 + movs r3, 0 + bl CopyToBgTilemapBufferRect_ChangePalette + b _080C61CE + .pool +_080C61C4: + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bhi _080C6294 +_080C61CE: + cmp r4, 0x2 + beq _080C620C + cmp r4, 0x2 + bgt _080C61DC + cmp r4, 0x1 + beq _080C61E6 + b _080C6284 +_080C61DC: + cmp r4, 0x3 + beq _080C6230 + cmp r4, 0x4 + beq _080C6264 + b _080C6284 +_080C61E6: + ldr r0, =0x02039cf0 + ldr r0, [r0] + ldr r1, [r0, 0x24] + adds r1, 0xA8 + movs r0, 0xC + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x10 + movs r3, 0x3 + bl CopyToBgTilemapBufferRect_ChangePalette + b _080C628E + .pool +_080C620C: + ldr r0, =0x02039cf0 + ldr r0, [r0] + ldr r1, [r0, 0x24] + movs r0, 0xFC + lsls r0, 1 + adds r1, r0 + movs r0, 0xC + str r0, [sp] + movs r0, 0x7 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x10 + b _080C6254 + .pool +_080C6230: + ldr r0, =0x02039cec + ldr r0, [r0] + ldrb r1, [r0, 0xE] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080C6294 + ldr r0, =0x02039cf0 + ldr r0, [r0] + ldr r1, [r0, 0x28] + adds r1, 0x48 + movs r0, 0xC + str r0, [sp] + str r4, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x2 +_080C6254: + movs r3, 0xA + bl CopyToBgTilemapBufferRect_ChangePalette + b _080C628E + .pool +_080C6264: + ldr r1, =gUnknown_08DE3374 + movs r0, 0x9 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x11 + str r0, [sp, 0x8] + movs r0, 0x1 + movs r2, 0x15 + movs r3, 0 + bl CopyToBgTilemapBufferRect_ChangePalette + b _080C628E + .pool +_080C6284: + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bhi _080C6294 +_080C628E: + movs r0, 0x1 + bl CopyBgTilemapBufferToVram +_080C6294: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80C6104 + + thumb_func_start sub_80C629C +sub_80C629C: @ 80C629C + push {r4,lr} + ldr r1, =gUnknown_08DE3060 + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer + ldr r4, =0x02039cec + ldr r1, [r4] + ldrb r0, [r1, 0xC] + ldrb r1, [r1, 0xD] + bl sub_80C6104 + ldr r0, [r4] + ldrb r1, [r0, 0xE] + lsls r1, 28 + lsrs r1, 29 + movs r0, 0x1 + bl sub_80C5F58 + bl sub_80C5DB8 + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C629C + + thumb_func_start sub_80C62DC +sub_80C62DC: @ 80C62DC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + movs r5, 0 + bl ResetObjectPaletteAllocator + bl rotscale_reset_all + ldr r0, =gUnknown_085714E4 + bl LoadTaggedObjectPalettes + ldr r4, =gUnknown_085714BC + adds r0, r4, 0 + bl LoadCompressedObjectPic + adds r4, 0x10 + adds r0, r4, 0 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085715B4 + ldr r1, =0x02039cec + ldr r2, [r1] + movs r3, 0x8 + ldrsh r1, [r2, r3] + movs r6, 0xA + ldrsh r2, [r2, r6] + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x02039cf0 + ldr r2, [r3] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + str r1, [r2] + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] + mov r8, sp + mov r9, r3 +_080C633C: + ldr r0, =0x02039cec + ldr r0, [r0] + adds r0, 0xF + adds r2, r0, r5 + ldrb r0, [r2] + adds r4, r5, 0x1 + cmp r0, 0 + beq _080C63C2 + mov r1, sp + ldr r0, =gUnknown_085715E4 + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + mov r7, r8 + ldrh r0, [r7, 0x2] + ldr r1, =0x0000ffff + adds r0, r1 + ldrb r2, [r2] + adds r0, r2 + strh r0, [r7, 0x2] + ldr r1, =gUnknown_08571454 + adds r0, r5, 0x6 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x4] + adds r1, 0x8 + lsls r1, 16 + asrs r1, 16 + ldrh r2, [r0] + adds r2, 0x6 + lsls r2, 16 + asrs r2, 16 + lsls r3, r4, 24 + lsrs r3, 24 + mov r0, sp + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + mov r3, r9 + ldr r2, [r3] + lsls r3, r5, 2 + adds r2, 0x4 + adds r2, r3 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + str r1, [r2] + ldrb r2, [r1, 0x5] + movs r6, 0xD + negs r6, r6 + adds r0, r6, 0 + ands r2, r0 + movs r0, 0x8 + orrs r2, r0 + strb r2, [r1, 0x5] + mov r7, r9 + ldr r0, [r7] + adds r0, 0x4 + adds r0, r3 + ldr r0, [r0] + adds r1, r5, 0 + bl StartObjectImageAnim +_080C63C2: + lsls r0, r4, 24 + lsrs r5, r0, 24 + cmp r5, 0x6 + bls _080C633C + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C62DC + + thumb_func_start sub_80C63FC +sub_80C63FC: @ 80C63FC + push {r4-r6,lr} + movs r5, 0 + ldr r4, =0x02039cf0 + ldr r0, [r4] + ldr r0, [r0] + bl RemoveObjectAndFreeTiles + ldr r0, [r4] + str r5, [r0] + adds r6, r4, 0 +_080C6410: + ldr r0, [r6] + lsls r4, r5, 2 + adds r0, 0x4 + adds r0, r4 + ldr r0, [r0] + cmp r0, 0 + beq _080C642C + bl RemoveObjectAndFreeTiles + ldr r0, [r6] + adds r0, 0x4 + adds r0, r4 + movs r1, 0 + str r1, [r0] +_080C642C: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x6 + bls _080C6410 + bl ResetObjectPaletteAllocator + movs r0, 0x2 + bl FreeObjectTilesByTag + movs r0, 0 + bl FreeObjectTilesByTag + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C63FC + + thumb_func_start nullsub_39 +nullsub_39: @ 80C6450 + bx lr + thumb_func_end nullsub_39 + + thumb_func_start sub_80C6454 +sub_80C6454: @ 80C6454 + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, =0x02039cf4 + ldr r0, [r5] + cmp r0, 0 + beq _080C6466 + adds r0, r4, 0 + bl SetMainCallback2 +_080C6466: + ldr r0, =0x00003014 + bl AllocZeroed + str r0, [r5] + str r4, [r0] + bl ResetTasks + ldr r0, =sub_80C67BC + movs r1, 0 + bl CreateTask + ldr r0, =sub_80C5438 + bl SetMainCallback2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C6454 + + thumb_func_start sub_80C6498 +sub_80C6498: @ 80C6498 + push {r4,lr} + bl ResetTasks + ldr r4, =0x02039cf4 + ldr r0, [r4] + ldr r0, [r0] + bl SetMainCallback2 + ldr r0, [r4] + ldr r2, =0x00003014 + movs r1, 0 + bl memset + ldr r0, [r4] + bl Free + movs r0, 0 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C6498 + + thumb_func_start sub_80C64CC +sub_80C64CC: @ 80C64CC + push {r4,r5,lr} + sub sp, 0x8 + ldr r0, =0x02039cec + ldr r0, [r0] + ldrh r0, [r0, 0x4] + cmp r0, 0x7 + bls _080C64DC + b _080C6694 +_080C64DC: + lsls r0, 2 + ldr r1, =_080C64F0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C64F0: + .4byte _080C6510 + .4byte _080C6520 + .4byte _080C6526 + .4byte _080C6538 + .4byte _080C65C0 + .4byte _080C65E8 + .4byte _080C6628 + .4byte _080C6678 +_080C6510: + movs r0, 0 + bl SetVBlankCallback + bl remove_some_task + bl SetVBlankHBlankCallbacksToNull + b _080C6694 +_080C6520: + bl sub_80C50D0 + b _080C6694 +_080C6526: + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + bl sub_80A1A74 + bl reset_temp_tile_data_buffers + b _080C6694 +_080C6538: + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085713F4 + movs r0, 0 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r4, =0x02039cf4 + ldr r1, [r4] + adds r1, 0x12 + movs r0, 0 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00001012 + adds r1, r0 + movs r0, 0x1 + bl SetBgTilemapBuffer + ldr r1, [r4] + ldr r0, =0x00002012 + adds r1, r0 + movs r0, 0x2 + bl SetBgTilemapBuffer + movs r5, 0x1E + str r5, [sp] + movs r4, 0x14 + str r4, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl FillBgTilemapBufferRect_Palette0 + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x1 + bl CopyBgTilemapBufferToVram + b _080C6618 + .pool +_080C65C0: + ldr r0, =gUnknown_08571428 + bl InitWindows + bl DeactivateAllTextPrinters + bl sub_80C6B94 + ldr r1, =gUnknown_0856FBBC + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + movs r2, 0 + movs r3, 0 + bl decompress_and_copy_tile_data_to_vram + b _080C6694 + .pool +_080C65E8: + bl free_temp_tile_data_buffers_if_possible + lsls r0, 24 + cmp r0, 0 + bne _080C669E + ldr r0, =gUnknown_08DE07C8 + movs r2, 0xD0 + lsls r2, 1 + movs r1, 0 + bl gpu_pal_apply + movs r0, 0 + bl stdpal_get + movs r1, 0xF0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =gUnknown_08570E00 + movs r0, 0x2 + movs r2, 0 + movs r3, 0 + bl CopyToBgTilemapBuffer +_080C6618: + movs r0, 0x2 + bl CopyBgTilemapBufferToVram + b _080C6694 + .pool +_080C6628: + 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 + bl sub_80C6974 + ldr r0, =pokemon_details + bl SetVBlankCallback + movs r5, 0x1 + negs r5, r5 + ldr r4, =0x00007fff + adds r0, r5, 0 + movs r1, 0x10 + adds r2, r4, 0 + bl sub_80A2A20 + str r4, [sp] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + b _080C6694 + .pool +_080C6678: + bl fade_and_return_progress_probably + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080C669E + ldr r0, =0x02039cec + ldr r0, [r0] + strh r1, [r0, 0x4] + movs r0, 0x1 + b _080C66A0 + .pool +_080C6694: + ldr r0, =0x02039cec + ldr r1, [r0] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] +_080C669E: + movs r0, 0 +_080C66A0: + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C64CC + + thumb_func_start sub_80C66AC +sub_80C66AC: @ 80C66AC + push {r4,lr} + sub sp, 0x4 + ldr r0, =0x02039cec + ldr r0, [r0] + ldrh r0, [r0, 0x4] + cmp r0, 0x5 + bhi _080C67A4 + lsls r0, 2 + ldr r1, =_080C66CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C66CC: + .4byte _080C66E4 + .4byte _080C66FC + .4byte _080C6722 + .4byte _080C6732 + .4byte _080C6774 + .4byte _080C6782 +_080C66E4: + movs r0, 0x1 + negs r0, r0 + ldr r1, =0x00007fff + str r1, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + b _080C67A4 + .pool +_080C66FC: + bl fade_and_return_progress_probably + lsls r0, 24 + cmp r0, 0 + bne _080C67AE + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0 + bl HideBg + movs r0, 0x1 + bl HideBg + movs r0, 0x2 + bl HideBg + b _080C67A4 +_080C6722: + movs r0, 0 + bl SetVBlankCallback + bl remove_some_task + bl SetVBlankHBlankCallbacksToNull + b _080C67A4 +_080C6732: + ldr r4, =0x02039cf4 + ldr r0, [r4] + ldr r0, [r0, 0x4] + cmp r0, 0 + beq _080C6746 + bl RemoveObjectAndFreeTiles + movs r0, 0 + bl FreeObjectTilesByTag +_080C6746: + ldr r0, [r4] + ldr r0, [r0, 0xC] + cmp r0, 0 + beq _080C6758 + bl RemoveObjectAndFreeTiles + movs r0, 0x1 + bl FreeObjectTilesByTag +_080C6758: + ldr r0, [r4] + ldr r0, [r0, 0x8] + cmp r0, 0 + beq _080C676A + bl RemoveObjectAndFreeTiles + movs r0, 0x4 + bl FreeObjectTilesByTag +_080C676A: + bl FreeAllWindowBuffers + b _080C67A4 + .pool +_080C6774: + bl sub_80C50D0 + bl ResetAllObjectData + bl ResetObjectPaletteAllocator + b _080C67A4 +_080C6782: + movs r0, 0 + bl UnsetBgTilemapBuffer + movs r0, 0x1 + bl UnsetBgTilemapBuffer + movs r0, 0x2 + bl UnsetBgTilemapBuffer + ldr r0, =0x02039cec + ldr r1, [r0] + movs r0, 0 + strh r0, [r1, 0x4] + movs r0, 0x1 + b _080C67B0 + .pool +_080C67A4: + ldr r0, =0x02039cec + ldr r1, [r0] + ldrh r0, [r1, 0x4] + adds r0, 0x1 + strh r0, [r1, 0x4] +_080C67AE: + movs r0, 0 +_080C67B0: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80C66AC + + thumb_func_start sub_80C67BC +sub_80C67BC: @ 80C67BC + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x5 + bls _080C67D6 + b _080C68DA +_080C67D6: + lsls r0, 2 + ldr r1, =_080C67E8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080C67E8: + .4byte _080C6800 + .4byte _080C6806 + .4byte _080C686C + .4byte _080C6894 + .4byte _080C68C4 + .4byte _080C68CE +_080C6800: + bl sub_80C64CC + b _080C68C8 +_080C6806: + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r2, 0x2 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _080C6824 + movs r0, 0x3 + bl audio_play + movs r0, 0x4 + b _080C68DE + .pool +_080C6824: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080C6848 + ldr r0, =0x02039cf4 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0x5 + bls _080C6844 + movs r0, 0 + bl sub_80C6C70 + b _080C68E0 + .pool +_080C6844: + strh r2, [r4] + b _080C68E0 +_080C6848: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080C68E0 + ldr r0, =0x02039cf4 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _080C6868 + movs r0, 0x1 + bl sub_80C6C70 + b _080C68E0 + .pool +_080C6868: + movs r0, 0x3 + b _080C68DE +_080C686C: + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, 0x3 + ble _080C6882 + movs r0, 0 + bl sub_80C6C70 + movs r0, 0 + strh r0, [r4, 0x2] + movs r0, 0x1 + b _080C68DE +_080C6882: + ldr r0, =0x02039cf4 + ldr r0, [r0] + ldr r1, [r0, 0x4] + ldrh r0, [r1, 0x22] + adds r0, 0x4 + b _080C68B4 + .pool +_080C6894: + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, 0x3 + ble _080C68AA + movs r0, 0x1 + bl sub_80C6C70 + movs r0, 0 + strh r0, [r4, 0x2] + movs r0, 0x1 + b _080C68DE +_080C68AA: + ldr r0, =0x02039cf4 + ldr r0, [r0] + ldr r1, [r0, 0x4] + ldrh r0, [r1, 0x22] + subs r0, 0x4 +_080C68B4: + strh r0, [r1, 0x22] + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + b _080C68E0 + .pool +_080C68C4: + bl sub_80C66AC +_080C68C8: + cmp r0, 0 + bne _080C68DA + b _080C68E0 +_080C68CE: + adds r0, r2, 0 + bl DestroyTask + bl sub_80C6498 + b _080C68E0 +_080C68DA: + ldrh r0, [r4] + adds r0, 0x1 +_080C68DE: + strh r0, [r4] +_080C68E0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80C67BC + + thumb_func_start sub_80C68E8 +sub_80C68E8: @ 80C68E8 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r2, =0xfffb0000 + adds r0, r2 + lsrs r0, 16 + cmp r0, 0x3 + bls _080C6904 + adds r0, r1, 0 + subs r0, 0xF + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bhi _080C690C +_080C6904: + movs r0, 0x1 + b _080C696E + .pool +_080C690C: + adds r0, r1, 0 + subs r0, 0x12 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3 + bhi _080C691C + movs r0, 0x2 + b _080C696E +_080C691C: + adds r0, r1, 0 + subs r0, 0x16 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bhi _080C692C + movs r0, 0x3 + b _080C696E +_080C692C: + adds r0, r1, 0 + subs r0, 0x1C + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bhi _080C693C + movs r0, 0x4 + b _080C696E +_080C693C: + adds r0, r1, 0 + subs r0, 0x1F + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bhi _080C694C + movs r0, 0x5 + b _080C696E +_080C694C: + adds r0, r1, 0 + subs r0, 0x22 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5 + bhi _080C695C + movs r0, 0x6 + b _080C696E +_080C695C: + adds r0, r1, 0 + subs r0, 0x19 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bls _080C696C + movs r0, 0 + b _080C696E +_080C696C: + movs r0, 0x7 +_080C696E: + pop {r1} + bx r1 + thumb_func_end sub_80C68E8 + + thumb_func_start sub_80C6974 +sub_80C6974: @ 80C6974 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + movs r7, 0 + bl ResetObjectPaletteAllocator + ldr r0, =gUnknown_085714E4 + bl LoadTaggedObjectPalettes + ldr r6, =gUnknown_085714BC + adds r0, r6, 0 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085715B4 + mov r8, r0 + ldr r4, =0x02039cf4 + ldr r0, [r4] + ldrb r2, [r0, 0x10] + lsls r2, 4 + adds r2, 0x8 + mov r0, r8 + movs r1, 0x9B + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, [r4] + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + ldr r2, =0x02020630 + mov r9, r2 + add r1, r9 + str r1, [r0, 0x4] + ldrb r2, [r1, 0x5] + movs r5, 0xD + negs r5, r5 + adds r0, r5, 0 + ands r0, r2 + strb r0, [r1, 0x5] + ldr r0, [r4] + ldr r1, [r0, 0x4] + adds r1, 0x3F + ldrb r0, [r1] + movs r2, 0x1 + orrs r0, r2 + strb r0, [r1] + ldr r0, [r4] + ldr r0, [r0, 0x4] + movs r1, 0x1 + bl StartObjectImageAnim + adds r6, 0x8 + adds r0, r6, 0 + bl LoadCompressedObjectPic + movs r3, 0x18 + add r8, r3 + ldr r6, =gUnknown_08571650 + ldr r0, [r4] + ldrb r0, [r0, 0x10] + lsls r0, 4 + adds r0, r6 + movs r2, 0x8 + ldrsh r1, [r0, r2] + movs r3, 0xA + ldrsh r2, [r0, r3] + mov r0, r8 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, [r4] + lsls r0, r3, 4 + adds r0, r3 + lsls r0, 2 + add r0, r9 + str r0, [r1, 0xC] + ldrb r1, [r0, 0x5] + ands r5, r1 + strb r5, [r0, 0x5] + ldr r1, [r4] + ldr r0, [r1, 0xC] + ldrb r1, [r1, 0x10] + lsls r1, 4 + adds r1, r6 + ldrb r1, [r1, 0xC] + bl StartObjectImageAnim + bl sav1_map_get_name + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3A + beq _080C6A40 + cmp r5, 0xCA + beq _080C6A40 + b _080C6B7A +_080C6A40: + ldr r4, =0x03005d8c + ldr r2, [r4] + movs r0, 0x5 + ldrsb r0, [r2, r0] + cmp r0, 0x4 + beq _080C6A52 + cmp r0, 0xE + bne _080C6A98 + movs r7, 0x37 +_080C6A52: + lsls r0, r7, 16 + asrs r0, 16 + ldrh r6, [r2] + adds r0, r6 + ldrh r4, [r2, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _080C6A66 + adds r0, 0x7 +_080C6A66: + lsls r0, 13 + lsrs r7, r0, 16 + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, 0 + bge _080C6A74 + adds r0, 0x7 +_080C6A74: + lsls r0, 13 + lsrs r4, r0, 16 + movs r5, 0 + b _080C6AF2 + .pool +_080C6A98: + lsls r0, 16 + lsrs r0, 16 + bl sub_80C68E8 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _080C6AB4 + subs r0, r5, 0x1 + lsls r0, 4 + adds r0, r6 + ldrh r7, [r0, 0x8] + ldrh r4, [r0, 0xA] + b _080C6AF2 +_080C6AB4: + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x25 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0xE + bne _080C6ACE + ldrh r0, [r1, 0x28] + adds r0, 0x37 + lsls r0, 16 + lsrs r7, r0, 16 + b _080C6AD0 +_080C6ACE: + ldrh r7, [r1, 0x28] +_080C6AD0: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r4, [r0, 0x2A] + lsls r0, r7, 16 + asrs r0, 16 + cmp r0, 0 + bge _080C6AE0 + adds r0, 0x7 +_080C6AE0: + lsls r0, 13 + lsrs r7, r0, 16 + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, 0 + bge _080C6AEE + adds r0, 0x7 +_080C6AEE: + lsls r0, 13 + lsrs r4, r0, 16 +_080C6AF2: + ldr r0, =gUnknown_085714D4 + bl LoadCompressedObjectPic + mov r1, sp + ldr r0, =gUnknown_085715FC + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + mov r1, sp + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + adds r0, 0x4 + strh r0, [r1, 0x2] + cmp r5, 0 + beq _080C6B2C + lsls r1, r7, 16 + asrs r1, 16 + lsls r2, r4, 16 + b _080C6B3E + .pool +_080C6B2C: + lsls r1, r7, 19 + lsls r2, r4, 19 + movs r0, 0xA0 + lsls r0, 13 + adds r1, r0 + asrs r1, 16 + movs r3, 0x90 + lsls r3, 14 + adds r2, r3 +_080C6B3E: + asrs r2, 16 + mov r0, sp + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r3, r0, 24 + ldr r4, =0x02039cf4 + ldr r2, [r4] + lsls r1, r3, 4 + adds r1, r3 + lsls r1, 2 + ldr r0, =0x02020630 + adds r1, r0 + str r1, [r2, 0x8] + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + strb r0, [r1, 0x5] + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + beq _080C6B7A + ldr r0, [r4] + ldr r0, [r0, 0x8] + movs r1, 0x1 + bl StartObjectImageAnim +_080C6B7A: + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C6974 + + thumb_func_start sub_80C6B94 +sub_80C6B94: @ 80C6B94 + push {r4-r6,lr} + sub sp, 0xC + movs r4, 0 +_080C6B9A: + adds r0, r4, 0 + bl PutWindowTilemap + adds r0, r4, 0 + movs r1, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _080C6B9A + movs r4, 0 + movs r6, 0 + ldr r5, =gUnknown_08571650 +_080C6BB8: + ldr r0, =0x02039cf4 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r4, r0 + bne _080C6BF0 + lsls r1, r4, 4 + adds r3, r1, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =gUnknown_0857144E + str r0, [sp] + str r6, [sp, 0x4] + adds r1, r5 + ldr r0, [r1] + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x4 + bl box_print + b _080C6C0E + .pool +_080C6BF0: + lsls r1, r4, 4 + adds r3, r1, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldr r0, =gUnknown_0857144B + str r0, [sp] + str r6, [sp, 0x4] + adds r1, r5 + ldr r0, [r1] + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x4 + bl box_print +_080C6C0E: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x6 + bls _080C6BB8 + ldr r0, =gUnknown_08571448 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + ldr r1, =gUnknown_08571650 + ldr r0, =0x02039cf4 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + lsls r0, 4 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0x4 + movs r3, 0 + bl box_print + movs r4, 0 +_080C6C40: + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _080C6C40 + movs r0, 0 + bl CopyBgTilemapBufferToVram + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C6B94 + + thumb_func_start sub_80C6C70 +sub_80C6C70: @ 80C6C70 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC + lsls r0, 24 + cmp r0, 0 + beq _080C6C8C + ldr r0, =0x02039cf4 + ldr r4, [r0] + ldrb r5, [r4, 0x10] + adds r0, r5, 0x6 + b _080C6C94 + .pool +_080C6C8C: + ldr r0, =0x02039cf4 + ldr r4, [r0] + ldrb r5, [r4, 0x10] + adds r0, r5, 0x1 +_080C6C94: + movs r1, 0x7 + bl __modsi3 + strb r0, [r4, 0x10] + lsls r0, r5, 4 + adds r3, r0, 0x1 + lsls r3, 24 + lsrs r3, 24 + ldr r6, =gUnknown_0857144B + str r6, [sp] + movs r1, 0 + mov r8, r1 + str r1, [sp, 0x4] + ldr r4, =gUnknown_08571650 + adds r0, r4 + ldr r0, [r0] + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x4 + bl box_print + ldr r5, =0x02039cf4 + ldr r1, [r5] + ldrb r3, [r1, 0x10] + lsls r3, 4 + adds r3, 0x1 + lsls r3, 24 + lsrs r3, 24 + adds r0, r6, 0x3 + str r0, [sp] + mov r0, r8 + str r0, [sp, 0x4] + ldrb r0, [r1, 0x10] + lsls r0, 4 + adds r0, r4 + ldr r0, [r0] + str r0, [sp, 0x8] + movs r0, 0x1 + movs r1, 0x7 + movs r2, 0x4 + bl box_print + ldr r1, [r5] + ldr r2, [r1, 0x4] + ldrb r0, [r1, 0x10] + lsls r0, 4 + adds r0, 0x8 + strh r0, [r2, 0x22] + ldr r0, [r1, 0xC] + ldrb r1, [r1, 0x10] + lsls r1, 4 + adds r1, r4 + ldrb r1, [r1, 0xC] + bl StartObjectImageAnim + ldr r1, [r5] + ldr r2, [r1, 0xC] + ldrb r0, [r1, 0x10] + lsls r0, 4 + adds r0, r4 + ldrh r0, [r0, 0x8] + strh r0, [r2, 0x20] + ldr r2, [r1, 0xC] + ldrb r0, [r1, 0x10] + lsls r0, 4 + adds r0, r4 + ldrh r0, [r0, 0xA] + strh r0, [r2, 0x22] + movs r0, 0x2 + movs r1, 0 + bl FillWindowPixelBuffer + subs r6, 0x3 + str r6, [sp] + mov r1, r8 + str r1, [sp, 0x4] + ldr r0, [r5] + ldrb r0, [r0, 0x10] + lsls r0, 4 + adds r4, 0x4 + adds r0, r4 + ldr r0, [r0] + str r0, [sp, 0x8] + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0x4 + movs r3, 0 + bl box_print + movs r4, 0 +_080C6D4A: + adds r0, r4, 0 + movs r1, 0x3 + bl CopyWindowToVram + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _080C6D4A + movs r0, 0 + bl CopyBgTilemapBufferToVram + movs r0, 0x6C + bl audio_play + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80C6C70 + + thumb_func_start sub_80C6D80 +sub_80C6D80: @ 80C6D80 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + str r0, [sp, 0x24] + adds r7, r1, 0 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x28] + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + movs r0, 0 + movs r1, 0 + str r0, [sp, 0x1C] + str r1, [sp, 0x20] + ldr r1, =0x00ffffff + ldr r0, [sp, 0x1C] + ands r0, r1 + movs r1, 0xC0 + lsls r1, 21 + orrs r0, r1 + str r0, [sp, 0x1C] + ldr r1, =0xffffff00 + add r5, sp, 0x1C + ldr r0, [r5, 0x4] + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + str r0, [r5, 0x4] + adds r0, r5, 0 + bl AddWindow + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + lsls r4, r0, 24 + lsrs r4, 24 + mov r0, r9 + lsls r1, r0, 4 + orrs r1, r0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0 + movs r1, 0x7 + bl GetWindowAttribute + adds r6, r0, 0 + ldrb r0, [r5, 0x3] + lsls r0, 5 + adds r0, r6 + mov r8, r0 + ldr r1, [sp, 0x28] + cmp r1, 0 + bne _080C6E04 + add r0, sp, 0x14 + b _080C6E08 + .pool +_080C6E04: + add r0, sp, 0x14 + mov r1, r9 +_080C6E08: + strb r1, [r0] + add r1, sp, 0x14 + movs r2, 0 + movs r0, 0xF + strb r0, [r1, 0x1] + movs r0, 0xE + strb r0, [r1, 0x2] + mov r0, r10 + lsls r4, r0, 24 + lsrs r0, r4, 24 + str r2, [sp] + str r2, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + negs r1, r1 + str r1, [sp, 0xC] + ldr r1, [sp, 0x24] + str r1, [sp, 0x10] + movs r1, 0x1 + movs r3, 0x1 + bl AddTextPrinterParametrized2 + ldr r0, [sp, 0x4C] + mov r10, r4 + cmp r0, 0x6 + bls _080C6E3E + movs r0, 0x6 +_080C6E3E: + ldr r4, [sp, 0x4C] + subs r4, 0x6 + cmp r0, 0 + ble _080C6E70 + adds r5, r0, 0 +_080C6E48: + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0x40 + bl CpuSet + adds r1, r7, 0 + adds r1, 0x80 + mov r0, r8 + movs r2, 0x40 + bl CpuSet + adds r6, 0x80 + movs r2, 0x80 + add r8, r2 + movs r0, 0x80 + lsls r0, 1 + adds r7, r0 + subs r5, 0x1 + cmp r5, 0 + bne _080C6E48 +_080C6E70: + cmp r4, 0 + ble _080C6E90 + add r0, sp, 0x18 + mov r2, r9 + lsls r1, r2, 4 + orrs r1, r2 + strh r1, [r0] + lsls r2, r4, 7 + ldr r1, =0x001fffff + ands r2, r1 + movs r1, 0x80 + lsls r1, 17 + orrs r2, r1 + adds r1, r7, 0 + bl CpuSet +_080C6E90: + mov r1, r10 + lsrs r0, r1, 24 + bl RemoveWindow + 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_80C6D80 + + thumb_func_start sub_80C6EAC +sub_80C6EAC: @ 80C6EAC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + str r0, [sp, 0x20] + str r1, [sp, 0x24] + adds r6, r3, 0 + ldr r0, [sp, 0x4C] + mov r9, r0 + ldr r1, [sp, 0x50] + mov r10, r1 + lsls r2, 16 + lsrs r2, 16 + str r2, [sp, 0x28] + lsls r6, 24 + lsrs r6, 24 + mov r2, r9 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + mov r0, r10 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + movs r0, 0 + movs r1, 0 + str r0, [sp, 0x18] + str r1, [sp, 0x1C] + ldr r0, [sp, 0x20] + bl GetStringLength_Multibyte + lsls r0, 24 + ldr r2, =0x00ffffff + ldr r1, [sp, 0x18] + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0x18] + ldr r1, =0xffffff00 + add r2, sp, 0x18 + mov r8, r2 + ldr r0, [r2, 0x4] + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + str r0, [r2, 0x4] + ldr r5, [sp, 0x18] + lsrs r5, 24 + lsls r5, 5 + mov r0, r8 + bl AddWindow + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r1, r6, 4 + orrs r1, r6 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FillWindowPixelBuffer + adds r0, r4, 0 + movs r1, 0x7 + bl GetWindowAttribute + adds r7, r0, 0 + mov r0, r8 + ldrb r0, [r0, 0x3] + lsls r0, 5 + mov r8, r0 + add r8, r7 + add r0, sp, 0x14 + movs r1, 0 + strb r6, [r0] + mov r2, r9 + strb r2, [r0, 0x1] + mov r2, r10 + strb r2, [r0, 0x2] + str r1, [sp] + str r1, [sp, 0x4] + str r0, [sp, 0x8] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0xC] + ldr r0, [sp, 0x20] + str r0, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x2 + bl AddTextPrinterParametrized2 + lsrs r5, 1 + adds r0, r7, 0 + ldr r1, [sp, 0x24] + adds r2, r5, 0 + bl CpuSet + ldr r2, [sp, 0x24] + ldr r0, [sp, 0x28] + adds r1, r2, r0 + mov r0, r8 + adds r2, r5, 0 + bl CpuSet + adds r0, r4, 0 + bl RemoveWindow + 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_80C6EAC + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/trainer_see.s b/asm/trainer_see.s new file mode 100644 index 000000000..a8ad4630b --- /dev/null +++ b/asm/trainer_see.s @@ -0,0 +1,1325 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start CheckForTrainersWantingBattle +@ bool8 CheckForTrainersWantingBattle() +CheckForTrainersWantingBattle: @ 80B3BE8 + push {r4-r7,lr} + ldr r0, =0x030060a8 + movs r1, 0 + strb r1, [r0] + ldr r0, =0x02038bfc + strb r1, [r0] + movs r4, 0 + ldr r6, =0x02037350 +_080B3BF8: + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + adds r1, r0, r6 + ldrb r0, [r1] + lsls r0, 31 + cmp r0, 0 + beq _080B3C38 + ldrb r0, [r1, 0x7] + cmp r0, 0x1 + beq _080B3C12 + cmp r0, 0x3 + bne _080B3C38 +_080B3C12: + adds r0, r4, 0 + bl CheckIfTrainerWantsBattle + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _080B3C42 + cmp r0, 0 + beq _080B3C38 + ldr r0, =0x030060a8 + ldrb r1, [r0] + adds r5, r0, 0 + cmp r1, 0x1 + bhi _080B3C88 + bl CheckPlayerPartySize + lsls r0, 24 + cmp r0, 0 + bne _080B3C42 +_080B3C38: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _080B3BF8 +_080B3C42: + ldr r0, =0x030060a8 + ldrb r4, [r0] + adds r5, r0, 0 + cmp r4, 0x1 + bne _080B3C88 + bl ResetTrainerOpponentIds + ldr r2, =0x03006090 + ldrb r0, [r5] + subs r0, 0x1 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r0, r1, r2 + ldrb r0, [r0] + adds r2, 0x4 + adds r1, r2 + ldr r1, [r1] + bl SingleTrainerWantsBattle + ldr r0, =0x030060ac + strb r4, [r0] + movs r0, 0x1 + b _080B3CF4 + .pool +_080B3C88: + ldrb r0, [r5] + cmp r0, 0x2 + bne _080B3CEC + bl ResetTrainerOpponentIds + movs r4, 0 + ldrb r5, [r5] + cmp r4, r5 + bcs _080B3CC6 + ldr r6, =0x03006090 + adds r7, r6, 0x4 + ldr r5, =0x02038bfc +_080B3CA0: + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + adds r0, r1, r6 + ldrb r0, [r0] + adds r1, r7 + ldr r1, [r1] + bl TwoTrainersWantBattle + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r0, [r5] + adds r0, 0x1 + strb r0, [r5] + ldr r0, =0x030060a8 + ldrb r0, [r0] + cmp r4, r0 + bcc _080B3CA0 +_080B3CC6: + bl TwoTrainersWantBattleExecuteScript + ldr r1, =0x02038bfc + movs r0, 0 + strb r0, [r1] + ldr r1, =0x030060ac + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x1 + b _080B3CF4 + .pool +_080B3CEC: + ldr r1, =0x030060ac + movs r0, 0 + strb r0, [r1] + movs r0, 0 +_080B3CF4: + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end CheckForTrainersWantingBattle + + thumb_func_start CheckIfTrainerWantsBattle +@ u8 CheckIfTrainerWantsBattle(u8 trainerFieldObjectId) +CheckIfTrainerWantsBattle: @ 80B3D00 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x1 + mov r9, r0 + bl InTrainerHill + cmp r0, 0x1 + bne _080B3D1E + bl sub_81D62AC + b _080B3D24 +_080B3D1E: + adds r0, r5, 0 + bl GetFieldObjectScriptPointerByFieldObjectId +_080B3D24: + adds r7, r0, 0 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + beq _080B3D3E + adds r0, r5, 0 + bl GetBattlePyramidTrainerFlag +_080B3D36: + lsls r0, 24 +_080B3D38: + cmp r0, 0 + beq _080B3D56 + b _080B3DE0 +_080B3D3E: + bl InTrainerHill + cmp r0, 0x1 + bne _080B3D4E + adds r0, r5, 0 + bl GetTrainerHillTrainerFlag + b _080B3D36 +_080B3D4E: + adds r0, r7, 0 + bl GetTrainerFlagFromScriptPointer + b _080B3D38 +_080B3D56: + lsls r4, r5, 3 + adds r0, r4, r5 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + bl CheckIfTrainerCanApproachPlayer + lsls r0, 24 + lsrs r6, r0, 24 + mov r8, r4 + cmp r6, 0 + beq _080B3DE0 + ldrb r0, [r7, 0x1] + cmp r0, 0x4 + beq _080B3D7C + cmp r0, 0x7 + beq _080B3D7C + cmp r0, 0x6 + bne _080B3D8A +_080B3D7C: + bl CheckPlayerPartySize + lsls r0, 24 + cmp r0, 0 + bne _080B3DE0 + movs r1, 0x2 + mov r9, r1 +_080B3D8A: + ldr r2, =0x03006090 + ldr r4, =0x030060a8 + ldrb r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r5, [r0] + ldrb r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r1, r2, 0x4 + adds r0, r1 + str r7, [r0] + ldrb r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strb r6, [r0, 0x1] + mov r1, r8 + adds r0, r1, r5 + lsls r0, 2 + ldr r1, =0x02037350 + adds r0, r1 + subs r1, r6, 0x1 + lsls r1, 24 + lsrs r1, 24 + bl TrainerApproachPlayer + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + mov r0, r9 + b _080B3DE2 + .pool +_080B3DE0: + movs r0, 0 +_080B3DE2: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end CheckIfTrainerWantsBattle + + thumb_func_start CheckIfTrainerCanApproachPlayer +@ u8 CheckIfTrainerCanApproachPlayer(struct npc_state *trainerFieldObject) +CheckIfTrainerCanApproachPlayer: @ 80B3DF0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r7, r0, 0 + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl PlayerGetDestCoords + ldrb r0, [r7, 0x7] + mov r8, r4 + cmp r0, 0x1 + bne _080B3E50 + ldr r1, =gUnknown_0855072C + ldrb r0, [r7, 0x18] + lsls r0, 28 + lsrs r0, 26 + subs r0, 0x4 + adds r0, r1 + ldrb r1, [r7, 0x1D] + mov r2, sp + movs r3, 0 + ldrsh r2, [r2, r3] + movs r5, 0 + ldrsh r3, [r4, r5] + ldr r4, [r0] + adds r0, r7, 0 + bl _call_via_r4 + lsls r0, 24 + lsrs r6, r0, 24 + ldrb r2, [r7, 0x18] + lsls r2, 28 + lsrs r2, 28 + adds r0, r7, 0 + adds r1, r6, 0 + bl CheckPathBetweenTrainerAndPlayer + lsls r0, 24 + lsrs r0, 24 + b _080B3E90 + .pool +_080B3E4C: + adds r0, r6, 0 + b _080B3E90 +_080B3E50: + movs r5, 0 +_080B3E52: + ldr r0, =gUnknown_0855072C + lsls r4, r5, 2 + adds r4, r0 + ldrb r1, [r7, 0x1D] + mov r0, sp + movs r6, 0 + ldrsh r2, [r0, r6] + mov r0, r8 + movs r6, 0 + ldrsh r3, [r0, r6] + ldr r4, [r4] + adds r0, r7, 0 + bl _call_via_r4 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r4, 0 + bl CheckPathBetweenTrainerAndPlayer + lsls r0, 24 + cmp r0, 0 + bne _080B3E4C + adds r5, r4, 0 + cmp r5, 0x3 + bls _080B3E52 + movs r0, 0 +_080B3E90: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end CheckIfTrainerCanApproachPlayer + + thumb_func_start IsTrainerInRangeSouth +@ u8 IsTrainerInRangeSouth(struct npc_state *trainerFieldObject, u16 sightRange, u16 playerX, u16 playerY) +IsTrainerInRangeSouth: @ 80B3EA0 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r3, 16 + lsrs r5, r3, 16 + movs r1, 0x10 + ldrsh r0, [r4, r1] + lsls r2, 16 + asrs r2, 16 + cmp r0, r2 + bne _080B3EDA + lsls r0, r5, 16 + asrs r2, r0, 16 + ldrh r3, [r4, 0x12] + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r2, r0 + ble _080B3EDA + adds r1, r0, 0 + lsls r0, r6, 16 + asrs r0, 16 + adds r1, r0 + cmp r2, r1 + bgt _080B3EDA + subs r0, r5, r3 + lsls r0, 24 + lsrs r0, 24 + b _080B3EDC +_080B3EDA: + movs r0, 0 +_080B3EDC: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end IsTrainerInRangeSouth + + thumb_func_start IsTrainerInRangeNorth +@ u8 IsTrainerInRangeNorth(struct npc_state *trainerFieldObject, u16 sightRange, u16 playerX, u16 playerY) +IsTrainerInRangeNorth: @ 80B3EE4 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r3, 16 + lsrs r5, r3, 16 + movs r1, 0x10 + ldrsh r0, [r4, r1] + lsls r2, 16 + asrs r2, 16 + cmp r0, r2 + bne _080B3F1E + lsls r0, r5, 16 + asrs r2, r0, 16 + ldrh r3, [r4, 0x12] + movs r1, 0x12 + ldrsh r0, [r4, r1] + cmp r2, r0 + bge _080B3F1E + adds r1, r0, 0 + lsls r0, r6, 16 + asrs r0, 16 + subs r1, r0 + cmp r2, r1 + blt _080B3F1E + subs r0, r3, r5 + lsls r0, 24 + lsrs r0, 24 + b _080B3F20 +_080B3F1E: + movs r0, 0 +_080B3F20: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end IsTrainerInRangeNorth + + thumb_func_start IsTrainerInRangeWest +@ u8 IsTrainerInRangeWest(struct npc_state *trainerFieldObject, u16 sightRange, u16 playerX, u16 playerY) +IsTrainerInRangeWest: @ 80B3F28 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 16 + lsrs r5, r2, 16 + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r3, 16 + asrs r3, 16 + cmp r0, r3 + bne _080B3F62 + lsls r0, r5, 16 + asrs r3, r0, 16 + ldrh r2, [r4, 0x10] + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r3, r0 + bge _080B3F62 + adds r1, r0, 0 + lsls r0, r6, 16 + asrs r0, 16 + subs r1, r0 + cmp r3, r1 + blt _080B3F62 + subs r0, r2, r5 + lsls r0, 24 + lsrs r0, 24 + b _080B3F64 +_080B3F62: + movs r0, 0 +_080B3F64: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end IsTrainerInRangeWest + + thumb_func_start IsTrainerInRangeEast +@ u8 IsTrainerInRangeEast(struct npc_state *trainerFieldObject, u16 sightRange, u16 playerX, u16 playerY) +IsTrainerInRangeEast: @ 80B3F6C + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r2, 16 + lsrs r5, r2, 16 + movs r1, 0x12 + ldrsh r0, [r4, r1] + lsls r3, 16 + asrs r3, 16 + cmp r0, r3 + bne _080B3FA6 + lsls r0, r5, 16 + asrs r3, r0, 16 + ldrh r2, [r4, 0x10] + movs r1, 0x10 + ldrsh r0, [r4, r1] + cmp r3, r0 + ble _080B3FA6 + adds r1, r0, 0 + lsls r0, r6, 16 + asrs r0, 16 + adds r1, r0 + cmp r3, r1 + bgt _080B3FA6 + subs r0, r5, r2 + lsls r0, 24 + lsrs r0, 24 + b _080B3FA8 +_080B3FA6: + movs r0, 0 +_080B3FA8: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end IsTrainerInRangeEast + + thumb_func_start CheckPathBetweenTrainerAndPlayer +@ u8 CheckPathBetweenTrainerAndPlayer(struct npc_state *fieldObject, u8 a2, u8 direction) +CheckPathBetweenTrainerAndPlayer: @ 80B3FB0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r2, 24 + lsrs r7, r2, 24 + cmp r1, 0 + beq _080B4056 + ldrh r1, [r6, 0x10] + mov r0, sp + strh r1, [r0] + ldrh r0, [r6, 0x12] + mov r4, sp + adds r4, 0x2 + strh r0, [r4] + adds r0, r7, 0 + mov r1, sp + adds r2, r4, 0 + bl MoveCoords + movs r5, 0 + mov r8, r4 + mov r4, r9 + subs r4, 0x1 + cmp r5, r4 + bge _080B4028 +_080B3FEE: + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + mov r3, r8 + movs r0, 0 + ldrsh r2, [r3, r0] + adds r0, r6, 0 + adds r3, r7, 0 + bl sub_8092C8C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _080B4014 + movs r0, 0x2 + negs r0, r0 + ands r1, r0 + cmp r1, 0 + bne _080B4056 +_080B4014: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r7, 0 + mov r1, sp + mov r2, r8 + bl MoveCoords + cmp r5, r4 + blt _080B3FEE +_080B4028: + ldrb r4, [r6, 0x19] + lsls r5, r4, 28 + lsrs r5, 28 + lsrs r4, 4 + movs r0, 0 + strb r0, [r6, 0x19] + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + mov r3, r8 + movs r0, 0 + ldrsh r2, [r3, r0] + adds r0, r6, 0 + adds r3, r7, 0 + bl npc_block_way + lsls r0, 24 + lsrs r1, r0, 24 + lsls r4, 4 + orrs r5, r4 + strb r5, [r6, 0x19] + cmp r1, 0x4 + beq _080B405A +_080B4056: + movs r0, 0 + b _080B405C +_080B405A: + mov r0, r9 +_080B405C: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end CheckPathBetweenTrainerAndPlayer + + thumb_func_start TrainerApproachPlayer +@ void TrainerApproachPlayer(struct npc_state *trainerFieldObject, u8 distance) +TrainerApproachPlayer: @ 80B406C + push {r4,r5,lr} + lsls r5, r1, 24 + lsrs r5, 24 + ldr r0, =c3_8081EDC + movs r1, 0x50 + bl CreateTask + ldr r4, =0x03006090 + ldr r3, =0x030060a8 + ldrb r2, [r3] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 2 + adds r1, r4 + strb r0, [r1, 0x8] + ldrb r1, [r3] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x8] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e00 + adds r1, r0 + strh r5, [r1, 0xE] + ldrb r2, [r3] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0] + strh r0, [r1, 0x16] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end TrainerApproachPlayer + + thumb_func_start sub_80B40C8 +sub_80B40C8: @ 80B40C8 + push {r4,r5,lr} + adds r2, r0, 0 + ldr r0, =0x02038bfc + ldrb r0, [r0] + cmp r0, 0 + bne _080B40E4 + ldr r0, =0x03006090 + ldrb r5, [r0, 0x8] + b _080B40E8 + .pool +_080B40E4: + ldr r0, =0x03006090 + ldrb r5, [r0, 0x14] +_080B40E8: + ldr r4, =c3_8081EDC + adds r0, r5, 0 + adds r1, r4, 0 + bl SetTaskFuncWithFollowupFunc + ldr r1, =0x03005e00 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0, 0x8] + adds r0, r5, 0 + bl _call_via_r4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B40C8 + + thumb_func_start c3_8081EDC +c3_8081EDC: @ 80B4118 + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r0, 0x16 + ldrsh r1, [r4, r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r5, r0, r1 + ldrb r0, [r5] + lsls r0, 31 + cmp r0, 0 + bne _080B4150 + adds r0, r6, 0 + bl SwitchTaskToFollowupFunc + b _080B416C + .pool +_080B4150: + ldr r7, =gUnknown_0855073C +_080B4152: + movs r1, 0x8 + ldrsh r0, [r4, r1] + lsls r0, 2 + adds r0, r7 + ldr r3, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl _call_via_r3 + lsls r0, 24 + cmp r0, 0 + bne _080B4152 +_080B416C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end c3_8081EDC + + thumb_func_start sub_80B4178 +sub_80B4178: @ 80B4178 + movs r0, 0 + bx lr + thumb_func_end sub_80B4178 + + thumb_func_start sub_80B417C +sub_80B417C: @ 80B417C + push {r4,r5,lr} + adds r5, r1, 0 + adds r4, r2, 0 + ldr r1, =0x02038c08 + adds r2, r1, 0x4 + adds r3, r1, 0 + adds r3, 0x8 + adds r0, r4, 0 + bl FieldObjectGetLocalIdAndMap + movs r0, 0 + bl FieldEffectStart + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B417C + + thumb_func_start sub_80B41C0 +sub_80B41C0: @ 80B41C0 + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + movs r0, 0 + bl FieldEffectActiveListContains + lsls r0, 24 + cmp r0, 0 + beq _080B41D6 + movs r0, 0 + b _080B41F8 +_080B41D6: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + ldrb r0, [r5, 0x6] + subs r0, 0x39 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _080B41EC + movs r0, 0x6 + strh r0, [r4, 0x8] +_080B41EC: + ldrb r0, [r5, 0x6] + cmp r0, 0x3F + bne _080B41F6 + movs r0, 0x8 + strh r0, [r4, 0x8] +_080B41F6: + movs r0, 0x1 +_080B41F8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B41C0 + + thumb_func_start sub_80B4200 +sub_80B4200: @ 80B4200 + push {r4,r5,lr} + adds r5, r1, 0 + adds r4, r2, 0 + adds r0, r4, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _080B421E + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B4252 +_080B421E: + movs r1, 0xE + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _080B4244 + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetGoSpeed0AnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + ldrh r0, [r5, 0xE] + subs r0, 0x1 + strh r0, [r5, 0xE] + b _080B4252 +_080B4244: + adds r0, r4, 0 + movs r1, 0x3E + bl FieldObjectSetSpecialAnim + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_080B4252: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B4200 + + thumb_func_start sub_80B425C +sub_80B425C: @ 80B425C + push {r4-r6,lr} + adds r6, r1, 0 + adds r5, r2, 0 + adds r0, r5, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _080B427A + adds r0, r5, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B4308 +_080B427A: + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl npc_running_behaviour_by_direction + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl npc_set_running_behaviour_etc + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl npc_running_behaviour_by_direction + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_808F23C + adds r0, r5, 0 + bl sub_808F208 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + adds r0, r4, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _080B42D2 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B4308 +_080B42D2: + bl sub_808BCE8 + ldr r0, =0x02037590 + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02037350 + adds r4, r0 + ldrb r0, [r5, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl GetOppositeDirection + lsls r0, 24 + lsrs r0, 24 + bl GetFaceDirectionAnimId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + ldrh r0, [r6, 0x8] + adds r0, 0x1 + strh r0, [r6, 0x8] +_080B4308: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B425C + + thumb_func_start sub_80B4318 +sub_80B4318: @ 80B4318 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x02037350 + adds r4, r0, r1 + adds r0, r4, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _080B4344 + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B434A +_080B4344: + adds r0, r5, 0 + bl SwitchTaskToFollowupFunc +_080B434A: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B4318 + + thumb_func_start sub_80B435C +sub_80B435C: @ 80B435C + push {r4,r5,lr} + adds r5, r1, 0 + adds r4, r2, 0 + adds r0, r4, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _080B437A + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B4388 +_080B437A: + adds r0, r4, 0 + movs r1, 0x59 + bl FieldObjectSetSpecialAnim + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_080B4388: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B435C + + thumb_func_start sub_80B4390 +sub_80B4390: @ 80B4390 + push {r4,lr} + adds r4, r1, 0 + adds r0, r2, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B43A4 + movs r0, 0x3 + strh r0, [r4, 0x8] +_080B43A4: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B4390 + + thumb_func_start sub_80B43AC +sub_80B43AC: @ 80B43AC + push {r4,r5,lr} + adds r5, r1, 0 + adds r4, r2, 0 + adds r0, r4, 0 + bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive + lsls r0, 24 + cmp r0, 0 + beq _080B43CA + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + lsls r0, 24 + cmp r0, 0 + beq _080B43D8 +_080B43CA: + adds r0, r4, 0 + movs r1, 0x3E + bl FieldObjectSetSpecialAnim + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_080B43D8: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B43AC + + thumb_func_start sub_80B43E0 +sub_80B43E0: @ 80B43E0 + push {r4,r5,lr} + adds r5, r1, 0 + adds r4, r2, 0 + adds r0, r4, 0 + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive + lsls r0, 24 + cmp r0, 0 + beq _080B4426 + ldr r2, =0x02038c08 + movs r1, 0x10 + ldrsh r0, [r4, r1] + str r0, [r2] + movs r1, 0x12 + ldrsh r0, [r4, r1] + str r0, [r2, 0x4] + ldr r3, =0x02020630 + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + adds r0, 0x43 + ldrb r0, [r0] + subs r0, 0x1 + str r0, [r2, 0x8] + movs r0, 0x2 + str r0, [r2, 0xC] + movs r0, 0x31 + bl FieldEffectStart + strh r0, [r5, 0x10] + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_080B4426: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B43E0 + + thumb_func_start sub_80B4438 +sub_80B4438: @ 80B4438 + push {r4,r5,lr} + adds r5, r1, 0 + adds r4, r2, 0 + ldr r2, =0x02020630 + movs r1, 0x10 + ldrsh r0, [r5, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x2B + ldrb r0, [r1] + cmp r0, 0x2 + bne _080B44A0 + ldrb r1, [r4, 0x3] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r4, 0x3] + ldrb r0, [r4] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] + ldrb r1, [r4, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r2, [r0, 0x5] + movs r1, 0xD + negs r1, r1 + ands r1, r2 + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0, 0x5] + adds r0, r4, 0 + bl FieldObjectClearAnimIfSpecialAnimFinished + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl sub_80934BC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl FieldObjectSetSpecialAnim + ldrh r0, [r5, 0x8] + adds r0, 0x1 + strh r0, [r5, 0x8] +_080B44A0: + movs r0, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B4438 + + thumb_func_start sub_80B44AC +sub_80B44AC: @ 80B44AC + push {r4,lr} + adds r4, r1, 0 + movs r0, 0x31 + bl FieldEffectActiveListContains + lsls r0, 24 + cmp r0, 0 + bne _080B44C0 + movs r0, 0x3 + strh r0, [r4, 0x8] +_080B44C0: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B44AC + + thumb_func_start sub_80B44C8 +sub_80B44C8: @ 80B44C8 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + adds r0, r4, 0 + adds r0, 0xA + mov r1, sp + bl sub_806F684 + movs r1, 0x16 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B44FA + ldr r0, [sp] + bl FieldObjectClearAnim + ldrh r0, [r4, 0x16] + adds r0, 0x1 + strh r0, [r4, 0x16] +_080B44FA: + ldr r1, =gUnknown_0855076C + movs r2, 0x8 + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + ldr r2, [sp] + ldr r3, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl _call_via_r3 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x3 + bne _080B4564 + movs r0, 0x31 + bl FieldEffectActiveListContains + lsls r0, 24 + cmp r0, 0 + bne _080B4564 + ldr r4, [sp] + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl npc_running_behaviour_by_direction + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl npc_set_running_behaviour_etc + ldr r4, [sp] + ldrb r0, [r4, 0x18] + lsls r0, 28 + lsrs r0, 28 + bl npc_running_behaviour_by_direction + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_808F23C + adds r0, r5, 0 + bl DestroyTask + b _080B456E + .pool +_080B4564: + ldr r2, [sp] + ldrb r1, [r2] + movs r0, 0x7F + ands r0, r1 + strb r0, [r2] +_080B456E: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80B44C8 + + thumb_func_start sub_80B4578 +sub_80B4578: @ 80B4578 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =sub_80B44C8 + movs r1, 0 + bl CreateTask + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r0, r1 + adds r0, 0x2 + adds r1, r4, 0 + bl sub_806F67C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B4578 + + thumb_func_start sub_80B45AC +sub_80B45AC: @ 80B45AC + push {lr} + ldr r0, =sub_80B45BC + bl sub_80B40C8 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B45AC + + thumb_func_start sub_80B45BC +sub_80B45BC: @ 80B45BC + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + bl script_env_2_enable_and_set_ctx_running + pop {r0} + bx r0 + thumb_func_end sub_80B45BC + + thumb_func_start sub_80B45D0 +sub_80B45D0: @ 80B45D0 + push {lr} + ldr r0, =0x030060a8 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080B4610 + ldr r1, =0x02038bfc + ldrb r0, [r1] + cmp r0, 0 + bne _080B460C + adds r0, 0x1 + strb r0, [r1] + ldr r1, =0x020375f0 + movs r0, 0x1 + strh r0, [r1] + bl sub_809757C + ldr r0, =0x03006090 + ldrb r0, [r0, 0xC] + bl sub_80974D0 + b _080B4616 + .pool +_080B460C: + movs r0, 0 + strb r0, [r1] +_080B4610: + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] +_080B4616: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B45D0 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/trig.s b/asm/trig.s new file mode 100644 index 000000000..b20fa3fb2 --- /dev/null +++ b/asm/trig.s @@ -0,0 +1,98 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sine +@ s16 sine(s16 t, s16 amplitude) +sine: @ 806F534 + lsls r1, 16 + asrs r1, 16 + ldr r2, =gUnknown_08329F40 + lsls r0, 16 + asrs r0, 15 + adds r0, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + muls r0, r1 + lsls r0, 8 + asrs r0, 16 + bx lr + .pool + thumb_func_end sine + + thumb_func_start cosine +@ s16 cosine(s16 t, s16 amplitude) +cosine: @ 806F550 + lsls r1, 16 + asrs r1, 16 + ldr r2, =gUnknown_08329F40 + lsls r0, 16 + asrs r0, 15 + adds r0, 0x80 + adds r0, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + muls r0, r1 + lsls r0, 8 + asrs r0, 16 + bx lr + .pool + thumb_func_end cosine + + thumb_func_start sine2 +@ s16 sine2(u16 angle) +sine2: @ 806F570 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r5, 0 + movs r1, 0xB4 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0xB4 + bl __udivsi3 + movs r1, 0x1 + ands r0, r1 + ldr r1, =gUnknown_0832A1C0 + lsls r4, 1 + adds r4, r1 + ldrh r1, [r4] + cmp r0, 0 + bne _0806F5A8 + lsls r0, r1, 16 + b _0806F5AC + .pool +_0806F5A8: + lsls r0, r1, 16 + negs r0, r0 +_0806F5AC: + asrs r0, 16 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sine2 + + thumb_func_start cosine2 +@ s16 cosine2(u16 angle) +cosine2: @ 806F5B4 + push {lr} + lsls r0, 16 + movs r1, 0xB4 + lsls r1, 15 + adds r0, r1 + lsrs r0, 16 + bl sine2 + lsls r0, 16 + asrs r0, 16 + pop {r1} + bx r1 + thumb_func_end cosine2 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/truck_scene.s b/asm/truck_scene.s new file mode 100644 index 000000000..4869b1238 --- /dev/null +++ b/asm/truck_scene.s @@ -0,0 +1,589 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80FB0B0 +sub_80FB0B0: @ 80FB0B0 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x78 + bl __modsi3 + cmp r0, 0 + bne _080FB0C4 + movs r0, 0x1 + negs r0, r0 + b _080FB0D6 +_080FB0C4: + adds r0, r4, 0 + movs r1, 0xA + bl __modsi3 + cmp r0, 0x4 + ble _080FB0D4 + movs r0, 0 + b _080FB0D6 +_080FB0D4: + movs r0, 0x1 +_080FB0D6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80FB0B0 + + thumb_func_start sub_80FB0DC +sub_80FB0DC: @ 80FB0DC + push {lr} + adds r0, 0x78 + movs r1, 0xB4 + bl __modsi3 + cmp r0, 0 + beq _080FB0EE + movs r0, 0 + b _080FB0F2 +_080FB0EE: + movs r0, 0x1 + negs r0, r0 +_080FB0F2: + pop {r1} + bx r1 + thumb_func_end sub_80FB0DC + + thumb_func_start sub_80FB0F8 +sub_80FB0F8: @ 80FB0F8 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r5, r1, r0 + movs r1, 0 + ldrsh r0, [r5, r1] + adds r0, 0x1E + bl sub_80FB0DC + ldr r4, =0x03005d8c + ldr r2, [r4] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + lsls r0, 18 + movs r3, 0xC0 + lsls r3, 10 + orrs r0, r3 + asrs r0, 16 + str r0, [sp] + movs r0, 0x1 + movs r3, 0x3 + bl sub_808E82C + movs r3, 0 + ldrsh r0, [r5, r3] + bl sub_80FB0DC + ldr r2, [r4] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + lsls r0, 17 + ldr r3, =0xfffd0000 + adds r0, r3 + asrs r0, 16 + str r0, [sp] + movs r0, 0x2 + movs r3, 0 + bl sub_808E82C + movs r1, 0 + ldrsh r0, [r5, r1] + bl sub_80FB0DC + ldr r2, [r4] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + movs r4, 0 + movs r3, 0x3 + negs r3, r3 + lsls r0, 18 + asrs r0, 16 + str r0, [sp] + movs r0, 0x3 + bl sub_808E82C + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + lsls r0, 16 + ldr r1, =0x75300000 + cmp r0, r1 + bne _080FB180 + strh r4, [r5] +_080FB180: + movs r3, 0 + ldrsh r0, [r5, r3] + bl sub_80FB0B0 + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + movs r0, 0 + bl SetCameraPanning + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FB0F8 + + thumb_func_start sub_80FB1AC +sub_80FB1AC: @ 80FB1AC + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r3, r0, 3 + ldr r4, =0x03005e08 + adds r7, r3, r4 + ldrh r1, [r7] + adds r1, 0x1 + strh r1, [r7] + ldrh r0, [r7, 0x4] + adds r0, 0x1 + strh r0, [r7, 0x4] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0x5 + ble _080FB1DC + movs r0, 0 + strh r0, [r7] + ldrh r0, [r7, 0x2] + adds r0, 0x1 + strh r0, [r7, 0x2] +_080FB1DC: + ldrh r0, [r7, 0x2] + cmp r0, 0x13 + bne _080FB1F0 + adds r0, r2, 0 + bl DestroyTask + b _080FB2A8 + .pool +_080FB1F0: + ldr r2, =gUnknown_0858E898 + movs r1, 0x2 + ldrsh r0, [r7, r1] + adds r0, r2 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x2 + bne _080FB20C + adds r0, r4, 0 + subs r0, 0x8 + adds r0, r3, r0 + ldr r1, =sub_80FB2C0 + str r1, [r0] +_080FB20C: + movs r4, 0x2 + ldrsh r0, [r7, r4] + adds r0, r2 + movs r5, 0 + ldrsb r5, [r0, r5] + lsls r5, 16 + lsrs r5, 16 + movs r1, 0x4 + ldrsh r0, [r7, r1] + bl sub_80FB0B0 + adds r1, r0, 0 + lsls r5, 16 + asrs r5, 16 + lsls r1, 16 + asrs r1, 16 + adds r0, r5, 0 + bl SetCameraPanning + movs r4, 0x4 + ldrsh r0, [r7, r4] + adds r0, 0x1E + bl sub_80FB0DC + ldr r6, =0x03005d8c + ldr r2, [r6] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + movs r3, 0x3 + subs r3, r5 + lsls r3, 16 + asrs r3, 16 + lsls r0, 18 + movs r4, 0xC0 + lsls r4, 10 + orrs r0, r4 + asrs r0, 16 + str r0, [sp] + movs r0, 0x1 + bl sub_808E82C + movs r1, 0x4 + ldrsh r0, [r7, r1] + bl sub_80FB0DC + ldr r2, [r6] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + negs r3, r5 + lsls r3, 16 + asrs r3, 16 + lsls r0, 17 + ldr r4, =0xfffd0000 + adds r0, r4 + asrs r0, 16 + str r0, [sp] + movs r0, 0x2 + bl sub_808E82C + movs r1, 0x4 + ldrsh r0, [r7, r1] + bl sub_80FB0DC + ldr r2, [r6] + ldrb r1, [r2, 0x5] + ldrb r2, [r2, 0x4] + movs r4, 0x3 + negs r4, r4 + adds r3, r4, 0 + subs r3, r5 + lsls r3, 16 + asrs r3, 16 + lsls r0, 18 + asrs r0, 16 + str r0, [sp] + movs r0, 0x3 + bl sub_808E82C +_080FB2A8: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FB1AC + + thumb_func_start sub_80FB2C0 +sub_80FB2C0: @ 80FB2C0 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + adds r3, r0, 0 + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r2, r0, r1 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _080FB2F0 + movs r0, 0 + strh r0, [r2] + ldrh r0, [r2, 0x2] + adds r0, 0x1 + strh r0, [r2, 0x2] +_080FB2F0: + ldrh r0, [r2, 0x2] + cmp r0, 0x13 + bne _080FB304 + adds r0, r3, 0 + bl DestroyTask + b _080FB358 + .pool +_080FB304: + ldr r1, =gUnknown_0858E898 + movs r3, 0x2 + ldrsh r0, [r2, r3] + adds r0, r1 + movs r1, 0 + mov r8, r1 + movs r6, 0 + ldrsb r6, [r0, r6] + adds r0, r6, 0 + bl SetCameraPanning + ldr r5, =0x03005d8c + ldr r0, [r5] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + movs r3, 0x3 + subs r3, r6 + movs r0, 0x3 + str r0, [sp] + movs r0, 0x1 + bl sub_808E82C + ldr r0, [r5] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + negs r3, r6 + mov r4, r8 + subs r4, 0x3 + str r4, [sp] + movs r0, 0x2 + bl sub_808E82C + ldr r0, [r5] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + subs r4, r6 + mov r3, r8 + str r3, [sp] + movs r0, 0x3 + adds r3, r4, 0 + bl sub_808E82C +_080FB358: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FB2C0 + + thumb_func_start sub_80FB36C +sub_80FB36C: @ 80FB36C + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e08 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x5 + bls _080FB386 + b _080FB4D8 +_080FB386: + lsls r0, 2 + ldr r1, =_080FB398 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080FB398: + .4byte _080FB3B0 + .4byte _080FB3E8 + .4byte _080FB404 + .4byte _080FB450 + .4byte _080FB474 + .4byte _080FB492 +_080FB3B0: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5A + beq _080FB3C0 + b _080FB4D8 +_080FB3C0: + movs r0, 0 + bl SetCameraPanningCallback + movs r0, 0 + strh r0, [r4, 0x2] + ldr r0, =sub_80FB0F8 + movs r1, 0xA + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x4] + movs r0, 0x1 + strh r0, [r4] + movs r0, 0x31 + bl audio_play + b _080FB4D8 + .pool +_080FB3E8: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x96 + bne _080FB4D8 + bl pal_fill_black + movs r0, 0 + strh r0, [r4, 0x2] + movs r0, 0x2 + strh r0, [r4] + b _080FB4D8 +_080FB404: + ldrh r0, [r4, 0x2] + adds r3, r0, 0x1 + strh r3, [r4, 0x2] + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _080FB4D8 + lsls r1, r3, 16 + movs r0, 0x96 + lsls r0, 17 + cmp r1, r0 + ble _080FB4D8 + strh r2, [r4, 0x2] + ldrb r0, [r4, 0x4] + bl DestroyTask + ldr r0, =sub_80FB1AC + movs r1, 0xA + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x6] + movs r0, 0x3 + strh r0, [r4] + movs r0, 0x32 + bl audio_play + b _080FB4D8 + .pool +_080FB450: + ldr r2, =0x03005e00 + movs r0, 0x6 + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r5, [r0, 0x4] + cmp r5, 0 + bne _080FB4D8 + bl InstallCameraPanAheadCallback + strh r5, [r4, 0x2] + movs r0, 0x4 + strh r0, [r4] + b _080FB4D8 + .pool +_080FB474: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5A + bne _080FB4D8 + movs r0, 0x33 + bl audio_play + movs r0, 0 + strh r0, [r4, 0x2] + movs r0, 0x5 + strh r0, [r4] + b _080FB4D8 +_080FB492: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x78 + bne _080FB4D8 + movs r2, 0x82 + lsls r2, 2 + movs r0, 0xB + movs r1, 0x8 + bl MapGridSetMetatileIdAt + movs r2, 0x84 + lsls r2, 2 + movs r0, 0xB + movs r1, 0x9 + bl MapGridSetMetatileIdAt + movs r2, 0x86 + lsls r2, 2 + movs r0, 0xB + movs r1, 0xA + bl MapGridSetMetatileIdAt + bl DrawWholeMapView + movs r0, 0x34 + bl audio_play + adds r0, r5, 0 + bl DestroyTask + bl script_env_2_disable +_080FB4D8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80FB36C + + thumb_func_start sub_80FB4E0 +sub_80FB4E0: @ 80FB4E0 + push {lr} + sub sp, 0x4 + ldr r2, =0x0000020d + movs r0, 0xB + movs r1, 0x8 + bl MapGridSetMetatileIdAt + ldr r2, =0x00000215 + movs r0, 0xB + movs r1, 0x9 + bl MapGridSetMetatileIdAt + ldr r2, =0x0000021d + movs r0, 0xB + movs r1, 0xA + bl MapGridSetMetatileIdAt + bl DrawWholeMapView + bl script_env_2_enable + movs r0, 0 + str r0, [sp] + ldr r1, =0x02037b14 + ldr r2, =0x01000100 + mov r0, sp + bl CpuFastSet + ldr r0, =sub_80FB36C + movs r1, 0xA + bl CreateTask + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FB4E0 + + thumb_func_start sub_80FB540 +sub_80FB540: @ 80FB540 + push {r4-r6,lr} + sub sp, 0x4 + ldr r0, =sub_80FB36C + bl FuncIsActiveTask + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _080FB58A + ldr r4, =0x03005d8c + ldr r0, [r4] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + movs r0, 0x3 + str r0, [sp] + movs r0, 0x1 + movs r3, 0x3 + bl sub_808E82C + ldr r0, [r4] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + movs r5, 0x3 + negs r5, r5 + str r5, [sp] + movs r0, 0x2 + movs r3, 0 + bl sub_808E82C + ldr r0, [r4] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + str r6, [sp] + movs r0, 0x3 + adds r3, r5, 0 + bl sub_808E82C +_080FB58A: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80FB540 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/tv.s b/asm/tv.s new file mode 100644 index 000000000..98c37f5d2 --- /dev/null +++ b/asm/tv.s @@ -0,0 +1,16938 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80EBEE0 +sub_80EBEE0: @ 80EBEE0 + push {r4-r7,lr} + movs r3, 0 + ldr r6, =0x03005d8c + movs r5, 0 + ldr r7, =0x000027ce +_080EBEEA: + ldr r0, [r6] + lsls r1, r3, 3 + adds r1, r3 + lsls r1, 2 + adds r0, r1 + ldr r2, =0x000027cc + adds r0, r2 + strb r5, [r0] + ldr r0, [r6] + adds r0, r1 + adds r2, 0x1 + adds r0, r2 + strb r5, [r0] + movs r2, 0 + adds r4, r3, 0x1 + adds r3, r1, 0 +_080EBF0A: + ldr r0, [r6] + adds r1, r2, r3 + adds r0, r7 + adds r0, r1 + strb r5, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x21 + bls _080EBF0A + lsls r0, r4, 24 + lsrs r3, r0, 24 + cmp r3, 0x18 + bls _080EBEEA + bl sub_80EEE5C + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EBEE0 + + thumb_func_start special_0x44 +special_0x44: @ 80EBF3C + push {r4-r7,lr} + movs r4, 0x5 + ldr r1, =0x03005d8c + ldr r0, [r1] + movs r2, 0xA2 + lsls r2, 6 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080EBF70 + adds r3, r1, 0 + subs r2, 0xB4 +_080EBF54: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x17 + bhi _080EBF70 + ldr r0, [r3] + lsls r1, r4, 3 + adds r1, r4 + lsls r1, 2 + adds r0, r1 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080EBF54 +_080EBF70: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + lsls r0, 24 + lsrs r5, r0, 24 + adds r7, r5, 0 + ldr r6, =0x03005d8c +_080EBF86: + ldr r1, [r6] + lsls r0, r5, 3 + adds r0, r5 + lsls r4, r0, 2 + adds r1, r4 + ldr r0, =0x000027cc + adds r1, r0 + ldrb r0, [r1] + bl sub_80EFFE0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + beq _080EBFBC + ldr r0, [r6] + adds r0, r4 + ldr r1, =0x000027cd + adds r0, r1 + ldrb r0, [r0] + b _080EBFCC + .pool +_080EBFBC: + ldr r2, =0x000027cc + adds r0, r4, r2 + ldr r1, [r6] + adds r1, r0 + ldrh r0, [r1, 0x16] + cmp r0, 0 + bne _080EBFD8 + ldrb r0, [r1, 0x1] +_080EBFCC: + cmp r0, 0x1 + bne _080EBFD8 + adds r0, r5, 0 + b _080EBFEC + .pool +_080EBFD8: + cmp r5, 0 + bne _080EBFE0 + movs r5, 0x17 + b _080EBFE6 +_080EBFE0: + subs r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080EBFE6: + cmp r5, r7 + bne _080EBF86 + movs r0, 0xFF +_080EBFEC: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end special_0x44 + + thumb_func_start sub_80EBFF4 +sub_80EBFF4: @ 80EBFF4 + push {lr} + bl special_0x44 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xFF + bne _080EC006 + movs r0, 0xFF + b _080EC03E +_080EC006: + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r3, =0x00002b90 + adds r0, r2, r3 + ldrh r0, [r0] + cmp r0, 0 + beq _080EC03C + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2, r0 + ldr r2, =0x000027cc + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x29 + bne _080EC03C + bl sub_80EC18C + lsls r0, 24 + lsrs r0, 24 + b _080EC03E + .pool +_080EC03C: + adds r0, r1, 0 +_080EC03E: + pop {r1} + bx r1 + thumb_func_end sub_80EBFF4 + + thumb_func_start UpdateTVScreensOnMap +@ void UpdateTVScreensOnMap(s32 mapWidth, s32 mapHeight) +UpdateTVScreensOnMap: @ 80EC044 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, =0x00000891 + bl FlagSet + bl CheckForBigMovieOrEmergencyNewsOnTV + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EC06A + cmp r0, 0x2 + beq _080EC0BE + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r0, [r0, 0x4] + cmp r0, 0xD + bne _080EC080 +_080EC06A: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + bl SetTVMetatilesOnMap + b _080EC0BE + .pool +_080EC080: + ldr r0, =0x00000892 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _080EC0BE + bl sub_80EBFF4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _080EC0AE + bl sub_80EEF20 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _080EC0AE + bl IsTVShowInSearchOfTrainersAiring + lsls r0, 24 + cmp r0, 0 + beq _080EC0BE +_080EC0AE: + ldr r0, =0x00000891 + bl FlagReset + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + bl SetTVMetatilesOnMap +_080EC0BE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end UpdateTVScreensOnMap + + thumb_func_start SetTVMetatilesOnMap +@ void SetTVMetatilesOnMap(s32 mapWidth, s32 mapHeight, u16 metatileId) +SetTVMetatilesOnMap: @ 80EC0CC + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r0 + mov r10, r1 + lsls r2, 16 + lsrs r2, 16 + movs r5, 0 + cmp r5, r10 + bge _080EC120 + movs r1, 0xC0 + lsls r1, 4 + adds r0, r1, 0 + mov r8, r2 + mov r1, r8 + orrs r1, r0 + mov r8, r1 +_080EC0F2: + movs r4, 0 + adds r7, r5, 0x1 + cmp r4, r9 + bge _080EC11A + mov r0, r8 + lsls r6, r0, 16 +_080EC0FE: + adds r0, r4, 0 + adds r1, r5, 0 + bl MapGridGetMetatileBehaviorAt + cmp r0, 0x86 + bne _080EC114 + adds r0, r4, 0 + adds r1, r5, 0 + lsrs r2, r6, 16 + bl MapGridSetMetatileIdAt +_080EC114: + adds r4, 0x1 + cmp r4, r9 + blt _080EC0FE +_080EC11A: + adds r5, r7, 0 + cmp r5, r10 + blt _080EC0F2 +_080EC120: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end SetTVMetatilesOnMap + + thumb_func_start TurnOffTVScreen +TurnOffTVScreen: @ 80EC130 + push {lr} + ldr r1, =0x03005dc0 + ldr r0, [r1] + ldr r1, [r1, 0x4] + movs r2, 0x2 + bl SetTVMetatilesOnMap + bl DrawWholeMapView + pop {r0} + bx r0 + .pool + thumb_func_end TurnOffTVScreen + + thumb_func_start TurnOnTVScreen +TurnOnTVScreen: @ 80EC14C + push {lr} + ldr r1, =0x03005dc0 + ldr r0, [r1] + ldr r1, [r1, 0x4] + movs r2, 0x3 + bl SetTVMetatilesOnMap + bl DrawWholeMapView + pop {r0} + bx r0 + .pool + thumb_func_end TurnOnTVScreen + + thumb_func_start special_0x45 +special_0x45: @ 80EC168 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x020375e0 + ldrh r2, [r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r1, r0 + ldr r0, =0x000027cc + adds r1, r0 + ldrb r0, [r1] + bx lr + .pool + thumb_func_end special_0x45 + + thumb_func_start sub_80EC18C +sub_80EC18C: @ 80EC18C + push {r4,lr} + movs r2, 0 + ldr r0, =0x03005d8c + ldr r3, [r0] +_080EC194: + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r1, r3, r0 + ldr r4, =0x000027cc + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _080EC1C0 + cmp r0, 0x29 + beq _080EC1C0 + adds r4, 0x1 + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080EC1C0 + adds r0, r2, 0 + b _080EC1CC + .pool +_080EC1C0: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x17 + bls _080EC194 + movs r0, 0xFF +_080EC1CC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80EC18C + + thumb_func_start special_0x4a +special_0x4a: @ 80EC1D4 + push {lr} + ldr r3, =0x03005d8c + ldr r2, =0x020375e0 + ldrh r1, [r2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r3, [r3] + adds r0, r3, r0 + ldrb r0, [r0] + cmp r0, 0x29 + bne _080EC214 + ldr r1, =0x00002b90 + adds r0, r3, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _080EC214 + bl sub_80EC18C + lsls r0, 24 + lsrs r0, 24 + b _080EC216 + .pool +_080EC214: + ldrb r0, [r2] +_080EC216: + pop {r1} + bx r1 + thumb_func_end special_0x4a + + thumb_func_start GabbyAndTyNewGameInitData +GabbyAndTyNewGameInitData: @ 80EC21C + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + ldr r3, =0x03005d8c + ldr r2, [r3] + ldr r1, =0x00002ba4 + adds r0, r2, r1 + movs r4, 0 + mov r10, r4 + movs r1, 0 + strh r1, [r0] + ldr r4, =0x00002ba6 + adds r0, r2, r4 + strh r1, [r0] + adds r4, 0x2 + adds r0, r2, r4 + strh r1, [r0] + ldr r0, =0x00002baa + adds r1, r2, r0 + ldr r0, =0x0000ffff + strh r0, [r1] + adds r4, 0x6 + adds r2, r4 + ldrb r1, [r2] + movs r0, 0x2 + negs r0, r0 + mov r9, r0 + ands r0, r1 + strb r0, [r2] + ldr r1, [r3] + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x3 + negs r0, r0 + mov r8, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, r4 + ldrb r2, [r1] + movs r6, 0x5 + negs r6, r6 + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, r4 + ldrb r2, [r1] + movs r5, 0x9 + negs r5, r5 + adds r0, r5, 0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + ldr r1, [r3] + adds r1, r4 + ldrb r2, [r1] + movs r0, 0x1F + ands r0, r2 + strb r0, [r1] + ldr r0, [r3] + ldr r2, =0x00002baf + adds r0, r2 + ldrb r1, [r0] + mov r4, r9 + ands r4, r1 + strb r4, [r0] + ldr r0, [r3] + adds r0, r2 + ldrb r1, [r0] + mov r4, r8 + ands r4, r1 + strb r4, [r0] + ldr r0, [r3] + adds r0, r2 + ldrb r1, [r0] + ands r6, r1 + strb r6, [r0] + ldr r0, [r3] + adds r0, r2 + ldrb r1, [r0] + ands r5, r1 + strb r5, [r0] + ldr r1, [r3] + adds r1, r2 + ldrb r2, [r1] + movs r0, 0xF + ands r0, r2 + strb r0, [r1] + ldr r0, [r3] + ldr r1, =0x00002bac + adds r0, r1 + mov r4, r10 + strb r4, [r0] + ldr r0, [r3] + adds r1, 0x1 + adds r0, r1 + strb r4, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end GabbyAndTyNewGameInitData + + thumb_func_start GabbyAndTyBeforeInterview +GabbyAndTyBeforeInterview: @ 80EC31C + push {r4,lr} + ldr r3, =0x03005d8c + ldr r2, [r3] + ldr r0, =0x03005d10 + mov r12, r0 + ldrh r1, [r0, 0x6] + ldr r4, =0x00002ba4 + adds r0, r2, r4 + strh r1, [r0] + mov r0, r12 + ldrh r1, [r0, 0x26] + adds r4, 0x2 + adds r0, r2, r4 + strh r1, [r0] + mov r0, r12 + ldrh r1, [r0, 0x22] + adds r4, 0x2 + adds r0, r2, r4 + strh r1, [r0] + ldr r0, =0x00002bad + adds r2, r0 + ldrb r1, [r2] + adds r0, r1, 0 + adds r4, r3, 0 + cmp r0, 0xFF + beq _080EC354 + adds r0, r1, 0x1 + strb r0, [r2] +_080EC354: + ldr r2, [r4] + mov r0, r12 + ldrb r1, [r0, 0x5] + lsls r1, 31 + ldr r0, =0x00002bae + adds r2, r0 + lsrs r1, 31 + ldrb r3, [r2] + movs r0, 0x2 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + mov r1, r12 + ldrb r0, [r1] + cmp r0, 0 + beq _080EC398 + ldr r0, [r4] + ldr r1, =0x00002bae + adds r0, r1 + ldrb r1, [r0] + movs r2, 0x2 + orrs r1, r2 + b _080EC3A6 + .pool +_080EC398: + ldr r0, [r4] + ldr r1, =0x00002bae + adds r0, r1 + ldrb r2, [r0] + movs r1, 0x3 + negs r1, r1 + ands r1, r2 +_080EC3A6: + strb r1, [r0] + mov r1, r12 + ldrb r0, [r1, 0x3] + cmp r0, 0 + beq _080EC3C4 + ldr r0, [r4] + ldr r1, =0x00002bae + adds r0, r1 + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + b _080EC3D2 + .pool +_080EC3C4: + ldr r0, [r4] + ldr r1, =0x00002bae + adds r0, r1 + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 +_080EC3D2: + strb r1, [r0] + mov r0, r12 + ldrb r1, [r0, 0x5] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080EC410 + movs r1, 0 + mov r0, r12 + adds r0, 0x36 + ldrb r0, [r0] + cmp r0, 0 + bne _080EC410 +_080EC3EC: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xA + bhi _080EC41E + mov r0, r12 + adds r0, 0x36 + adds r0, r1, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _080EC3EC + ldr r0, [r4] + ldr r4, =0x00002bae + adds r0, r4 + b _080EC416 + .pool +_080EC410: + ldr r0, [r4] + ldr r1, =0x00002bae + adds r0, r1 +_080EC416: + ldrb r1, [r0] + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0] +_080EC41E: + bl TakeTVShowInSearchOfTrainersOffTheAir + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r4, =0x00002ba8 + adds r0, r4 + ldrh r0, [r0] + cmp r0, 0 + bne _080EC436 + movs r0, 0x1 + bl FlagSet +_080EC436: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end GabbyAndTyBeforeInterview + + thumb_func_start GabbyAndTyAfterInterview +GabbyAndTyAfterInterview: @ 80EC448 + push {r4-r6,lr} + ldr r5, =0x03005d8c + ldr r2, [r5] + ldr r6, =0x00002bae + adds r0, r2, r6 + ldrb r1, [r0] + lsls r1, 31 + ldr r4, =0x00002baf + adds r2, r4 + lsrs r1, 31 + ldrb r3, [r2] + movs r0, 0x2 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r2, [r5] + adds r0, r2, r6 + ldrb r0, [r0] + adds r2, r4 + movs r1, 0x2 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r2, [r5] + adds r0, r2, r6 + ldrb r0, [r0] + adds r2, r4 + movs r1, 0x4 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r2, [r5] + adds r0, r2, r6 + ldrb r0, [r0] + adds r2, r4 + movs r1, 0x8 + ands r1, r0 + ldrb r3, [r2] + movs r0, 0x9 + negs r0, r0 + ands r0, r3 + orrs r0, r1 + strb r0, [r2] + ldr r1, [r5] + adds r1, r6 + ldrb r0, [r1] + movs r2, 0x10 + orrs r0, r2 + strb r0, [r1] + ldr r0, [r5] + ldr r1, =0x02037318 + ldrb r1, [r1, 0x14] + ldr r2, =0x00002bac + adds r0, r2 + strb r1, [r0] + movs r0, 0x6 + bl sav12_xor_increment + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end GabbyAndTyAfterInterview + + thumb_func_start TakeTVShowInSearchOfTrainersOffTheAir +TakeTVShowInSearchOfTrainersOffTheAir: @ 80EC4E8 + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x00002bae + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x11 + negs r0, r0 + ands r0, r2 + strb r0, [r1] + bx lr + .pool + thumb_func_end TakeTVShowInSearchOfTrainersOffTheAir + + thumb_func_start GabbyAndTyGetBattleNum +GabbyAndTyGetBattleNum: @ 80EC504 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r2, =0x00002bad + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x5 + bls _080EC522 + ldrb r0, [r1] + movs r1, 0x3 + bl __umodsi3 + adds r0, 0x6 + lsls r0, 24 + lsrs r0, 24 +_080EC522: + pop {r1} + bx r1 + .pool + thumb_func_end GabbyAndTyGetBattleNum + + thumb_func_start IsTVShowInSearchOfTrainersAiring +IsTVShowInSearchOfTrainersAiring: @ 80EC530 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002bae + adds r0, r1 + ldrb r0, [r0] + lsls r0, 27 + lsrs r0, 31 + bx lr + .pool + thumb_func_end IsTVShowInSearchOfTrainersAiring + + thumb_func_start GabbyAndTyGetLastQuote +GabbyAndTyGetLastQuote: @ 80EC548 + push {r4,r5,lr} + ldr r5, =0x03005d8c + ldr r0, [r5] + ldr r2, =0x00002baa + adds r1, r0, r2 + ldrh r0, [r1] + ldr r4, =0x0000ffff + cmp r0, r4 + beq _080EC584 + ldr r0, =0x02021cc4 + ldrh r1, [r1] + bl CopyEasyChatWord + ldr r1, [r5] + ldr r0, =0x00002baa + adds r1, r0 + ldrh r2, [r1] + adds r0, r4, 0 + orrs r0, r2 + strh r0, [r1] + movs r0, 0x1 + b _080EC586 + .pool +_080EC584: + movs r0, 0 +_080EC586: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end GabbyAndTyGetLastQuote + + thumb_func_start GabbyAndTyGetLastBattleTrivia +GabbyAndTyGetLastBattleTrivia: @ 80EC58C + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002baf + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080EC5AC + movs r0, 0x1 + b _080EC5D2 + .pool +_080EC5AC: + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080EC5B8 + movs r0, 0x2 + b _080EC5D2 +_080EC5B8: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080EC5C4 + movs r0, 0x3 + b _080EC5D2 +_080EC5C4: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080EC5D0 + movs r0, 0 + b _080EC5D2 +_080EC5D0: + movs r0, 0x4 +_080EC5D2: + pop {r1} + bx r1 + thumb_func_end GabbyAndTyGetLastBattleTrivia + + thumb_func_start GabbyAndTySetScriptVarsToFieldObjectLocalIds +GabbyAndTySetScriptVarsToFieldObjectLocalIds: @ 80EC5D8 + push {lr} + bl GabbyAndTyGetBattleNum + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + cmp r0, 0x7 + bhi _080EC6B0 + lsls r0, 2 + ldr r1, =_080EC5F8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080EC5F8: + .4byte _080EC618 + .4byte _080EC62C + .4byte _080EC640 + .4byte _080EC654 + .4byte _080EC668 + .4byte _080EC67C + .4byte _080EC690 + .4byte _080EC6A4 +_080EC618: + ldr r1, =0x020375e0 + movs r0, 0xE + strh r0, [r1] + ldr r1, =0x020375e2 + movs r0, 0xD + b _080EC6AE + .pool +_080EC62C: + ldr r1, =0x020375e0 + movs r0, 0x5 + strh r0, [r1] + ldr r1, =0x020375e2 + movs r0, 0x6 + b _080EC6AE + .pool +_080EC640: + ldr r1, =0x020375e0 + movs r0, 0x12 + strh r0, [r1] + ldr r1, =0x020375e2 + movs r0, 0x11 + b _080EC6AE + .pool +_080EC654: + ldr r1, =0x020375e0 + movs r0, 0x15 + strh r0, [r1] + ldr r1, =0x020375e2 + movs r0, 0x16 + b _080EC6AE + .pool +_080EC668: + ldr r1, =0x020375e0 + movs r0, 0x8 + strh r0, [r1] + ldr r1, =0x020375e2 + movs r0, 0x9 + b _080EC6AE + .pool +_080EC67C: + ldr r1, =0x020375e0 + movs r0, 0x13 + strh r0, [r1] + ldr r1, =0x020375e2 + movs r0, 0x14 + b _080EC6AE + .pool +_080EC690: + ldr r1, =0x020375e0 + movs r0, 0x17 + strh r0, [r1] + ldr r1, =0x020375e2 + movs r0, 0x18 + b _080EC6AE + .pool +_080EC6A4: + ldr r1, =0x020375e0 + movs r0, 0xA + strh r0, [r1] + ldr r1, =0x020375e2 + movs r0, 0xB +_080EC6AE: + strh r0, [r1] +_080EC6B0: + pop {r0} + bx r0 + .pool + thumb_func_end GabbyAndTySetScriptVarsToFieldObjectLocalIds + + thumb_func_start InterviewAfter +InterviewAfter: @ 80EC6BC + push {lr} + ldr r0, =0x020375e2 + ldrh r0, [r0] + subs r0, 0x1 + cmp r0, 0x7 + bhi _080EC724 + lsls r0, 2 + ldr r1, =_080EC6DC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080EC6DC: + .4byte _080EC6FC + .4byte _080EC702 + .4byte _080EC708 + .4byte _080EC70E + .4byte _080EC724 + .4byte _080EC714 + .4byte _080EC71A + .4byte _080EC720 +_080EC6FC: + bl sub_80ED548 + b _080EC724 +_080EC702: + bl sub_80ED5B8 + b _080EC724 +_080EC708: + bl sub_80ED610 + b _080EC724 +_080EC70E: + bl TaskDummy5 + b _080EC724 +_080EC714: + bl sub_80ECF5C + b _080EC724 +_080EC71A: + bl sub_80ED164 + b _080EC724 +_080EC720: + bl sub_80ECA38 +_080EC724: + pop {r0} + bx r0 + thumb_func_end InterviewAfter + + thumb_func_start sub_80EC728 +sub_80EC728: @ 80EC728 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r4, 0 + bl sub_80EED88 + bl sub_80ED718 + ldr r5, =0x03005d10 + ldrh r0, [r5, 0x28] + cmp r0, 0 + bne _080EC74C + bl sub_80EC8FC + b _080EC888 + .pool +_080EC74C: + bl sub_80EC8A4 + ldr r0, =0x0000ffff + bl sub_80EFB38 + lsls r0, 24 + cmp r0, 0 + beq _080EC75E + b _080EC888 +_080EC75E: + ldrh r1, [r5, 0x28] + movs r0, 0xB + muls r0, r1 + ldr r1, =gSpeciesNames + adds r0, r1 + adds r1, r5, 0 + adds r1, 0x2A + bl CompareString + cmp r0, 0 + bne _080EC776 + b _080EC888 +_080EC776: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000027cc + adds r0, r1 + bl sub_80EFB08 + ldr r1, =0x030060bc + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EC888 + movs r0, 0x15 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EC888 + movs r2, 0 + adds r1, r5, 0 + adds r1, 0x36 +_080EC7A8: + adds r0, r2, r1 + ldrb r0, [r0] + adds r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xA + bls _080EC7A8 + cmp r4, 0 + bne _080EC7CA + ldrb r1, [r5, 0x5] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080EC888 +_080EC7CA: + movs r4, 0 + ldr r2, =0x03005d8c + ldr r0, =0x030060bc + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r6, r1, r0 + movs r0, 0x15 + strb r0, [r6] + strb r4, [r6, 0x1] + ldrb r1, [r5, 0x5] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080EC81C + movs r4, 0x1 + movs r0, 0x1 + adds r3, r6, 0 + adds r3, 0x13 + ldr r1, =0x03005d90 + mov r8, r1 + adds r7, r6, 0x4 + b _080EC84E + .pool +_080EC81C: + movs r2, 0 + ldr r0, =0x02024208 + mov r12, r0 + adds r3, r6, 0 + adds r3, 0x13 + ldr r1, =0x03005d90 + mov r8, r1 + adds r7, r6, 0x4 + adds r1, r5, 0 + adds r1, 0x36 +_080EC830: + adds r0, r2, r1 + ldrb r0, [r0] + adds r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xA + bls _080EC830 + cmp r4, 0xFF + bls _080EC84A + movs r4, 0xFF +_080EC84A: + mov r1, r12 + ldrh r0, [r1] +_080EC84E: + strb r4, [r6, 0x12] + strb r0, [r6, 0xF] + mov r0, r8 + ldr r1, [r0] + adds r0, r3, 0 + bl CopyString + ldr r4, =0x03005d3a + adds r0, r7, 0 + adds r1, r4, 0 + bl CopyString + adds r0, r7, 0 + bl sub_81DB604 + adds r5, r0, 0 + adds r0, r7, 0 + bl StripExtendedControlCodes + subs r4, 0x2A + ldrh r0, [r4, 0x28] + strh r0, [r6, 0x10] + adds r0, r6, 0 + bl sub_80EC9E8 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r6, 0x2] + strb r5, [r6, 0x3] +_080EC888: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EC728 + + thumb_func_start sub_80EC8A4 +sub_80EC8A4: @ 80EC8A4 + push {r4,lr} + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x00002b2c + adds r4, r1, r0 + ldrb r0, [r4] + cmp r0, 0x19 + beq _080EC8CA + ldr r2, =0x000027cc + adds r0, r1, r2 + movs r1, 0x18 + bl sub_80EF910 + movs r0, 0x5 + bl sub_80847F8 + strh r0, [r4, 0x6] + movs r0, 0x19 + strb r0, [r4] +_080EC8CA: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + ldr r1, =0x03005d10 + ldrh r0, [r1, 0x28] + strh r0, [r4, 0x4] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x8] + ldr r0, =0x02037318 + ldrb r0, [r0, 0x14] + strb r0, [r4, 0xA] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EC8A4 + + thumb_func_start sub_80EC8FC +sub_80EC8FC: @ 80EC8FC + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x0000ffff + bl sub_80EFB38 + lsls r0, 24 + cmp r0, 0 + bne _080EC9B4 + movs r1, 0 + movs r5, 0 + ldr r2, =0x03005d46 +_080EC914: + adds r0, r1, r2 + ldrb r0, [r0] + adds r0, r5, r0 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xA + bls _080EC914 + cmp r5, 0xFF + bls _080EC92E + movs r5, 0xFF +_080EC92E: + cmp r5, 0x2 + bls _080EC9B4 + ldr r0, =0x0202433a + mov r8, r0 + ldrb r0, [r0] + cmp r0, 0x6 + beq _080EC940 + cmp r0, 0x1 + bne _080EC9B4 +_080EC940: + ldr r7, =0x03005d8c + ldr r0, [r7] + ldr r6, =0x000027cc + adds r0, r6 + bl sub_80EFB08 + ldr r4, =0x030060bc + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EC9B4 + movs r0, 0x17 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EC9B4 + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldr r4, [r7] + adds r4, r0 + movs r1, 0 + movs r0, 0x17 + strb r0, [r4] + strb r1, [r4, 0x1] + ldr r1, =0x03005d10 + ldrh r0, [r1, 0x6] + strh r0, [r4, 0xC] + ldrh r0, [r1, 0x20] + strh r0, [r4, 0xE] + strb r5, [r4, 0x10] + mov r1, r8 + ldrb r0, [r1] + strb r0, [r4, 0x11] + ldr r0, =0x02037318 + ldrb r0, [r0, 0x14] + strb r0, [r4, 0x12] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r4, 0x2] +_080EC9B4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EC8FC + + thumb_func_start sub_80EC9E8 +sub_80EC9E8: @ 80EC9E8 + push {r4,lr} + adds r4, r0, 0 + bl sub_80F0020 + strb r0, [r4, 0x1E] + lsrs r2, r0, 8 + strb r2, [r4, 0x1F] + adds r1, r4, 0 + adds r1, 0x20 + strb r0, [r1] + adds r1, 0x1 + strb r2, [r1] + adds r1, 0x1 + strb r0, [r1] + adds r0, r4, 0 + adds r0, 0x23 + strb r2, [r0] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80EC9E8 + + thumb_func_start sub_80ECA10 +sub_80ECA10: @ 80ECA10 + push {r4,lr} + adds r4, r0, 0 + bl sub_80F0020 + adds r1, r4, 0 + adds r1, 0x20 + strb r0, [r1] + lsrs r1, r0, 8 + adds r2, r4, 0 + adds r2, 0x21 + strb r1, [r2] + adds r2, 0x1 + strb r0, [r2] + adds r0, r4, 0 + adds r0, 0x23 + strb r1, [r0] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80ECA10 + + thumb_func_start sub_80ECA38 +sub_80ECA38: @ 80ECA38 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, =0x03005d8c + mov r8, r0 + ldr r7, [r0] + ldr r1, =0x00002b2c + adds r6, r7, r1 + ldrb r1, [r6] + cmp r1, 0x8 + bne _080ECACE + ldr r0, =0x030060bc + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r5, =0x000027cc + adds r4, r5 + adds r4, r7, r4 + strb r1, [r4] + movs r0, 0x1 + strb r0, [r4, 0x1] + adds r0, r4, 0 + adds r0, 0x14 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + ldr r0, =0x02039f2c + ldrh r0, [r0] + strb r0, [r4, 0x1C] + ldr r0, =0x02039f24 + ldrb r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r4, 0x12] + ldrh r0, [r6, 0x2] + strh r0, [r4, 0x2] + ldrb r0, [r6, 0xC] + strb r0, [r4, 0xC] + ldrb r0, [r6, 0xD] + strb r0, [r4, 0xD] + ldrb r0, [r6, 0xE] + strb r0, [r4, 0xE] + ldrh r0, [r6, 0x10] + strh r0, [r4, 0x10] + ldrb r0, [r6, 0xF] + strb r0, [r4, 0xF] + adds r0, r4, 0x4 + ldr r2, =0x00002b30 + adds r1, r7, r2 + bl CopyString + adds r0, r4, 0 + bl sub_80ECA10 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r4, 0x1D] + ldrb r0, [r6, 0x1E] + strb r0, [r4, 0x1E] + mov r1, r8 + ldr r0, [r1] + adds r0, r5 + movs r1, 0x18 + bl sub_80EF910 +_080ECACE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ECA38 + + thumb_func_start sub_80ECB00 +sub_80ECB00: @ 80ECB00 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + lsls r2, 16 + lsrs r2, 16 + mov r9, r2 + lsls r3, 16 + lsrs r3, 16 + mov r8, r3 + ldr r6, =0x03005d8c + ldr r0, [r6] + ldr r5, =0x000027cc + adds r0, r5 + bl sub_80EFADC + ldr r4, =0x030060bc + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080ECBEC + movs r0, 0xA + bl sub_80EF550 + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0x1 + beq _080ECBEC + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, [r6] + adds r4, r1, r0 + movs r0, 0xA + strb r0, [r4] + movs r5, 0x1 + strb r5, [r4, 0x1] + adds r0, r4, 0x4 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + ldr r0, =0x02022fec + ldr r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _080ECBA0 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _080ECBA2 + strb r5, [r4, 0x18] + b _080ECBA4 + .pool +_080ECBA0: + movs r0, 0x2 +_080ECBA2: + strb r0, [r4, 0x18] +_080ECBA4: + mov r0, r10 + strh r0, [r4, 0x14] + mov r0, r9 + strh r0, [r4, 0x16] + mov r0, r8 + strh r0, [r4, 0x2] + lsls r0, r7, 3 + subs r0, r7 + lsls r5, r0, 2 + ldr r6, =0x020229f0 + adds r1, r5, r6 + mov r0, sp + bl CopyString + mov r0, sp + bl StripExtendedControlCodes + adds r0, r4, 0 + adds r0, 0xC + mov r1, sp + bl CopyString + adds r0, r4, 0 + bl sub_80ECA10 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r4, 0x19] + cmp r0, 0x1 + beq _080ECBE8 + adds r0, r6, r5 + ldrh r0, [r0, 0x12] + cmp r0, 0x1 + bne _080ECBEA +_080ECBE8: + movs r0, 0x1 +_080ECBEA: + strb r0, [r4, 0x1A] +_080ECBEC: + 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_80ECB00 + + thumb_func_start sub_80ECC04 +sub_80ECC04: @ 80ECC04 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + mov r10, r0 + ldr r0, [sp, 0x44] + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x20] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r0, =0x03005d8c + mov r8, r0 + ldr r0, [r0] + ldr r7, =0x000027cc + adds r0, r7 + bl sub_80EFADC + ldr r4, =0x030060bc + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080ECC54 + movs r0, 0x9 + bl sub_80EF550 + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0x1 + bne _080ECC68 +_080ECC54: + movs r0, 0 + b _080ECCEE + .pool +_080ECC68: + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + mov r2, r8 + ldr r1, [r2] + adds r4, r1, r0 + movs r0, 0x9 + strb r0, [r4] + movs r7, 0x1 + strb r7, [r4, 0x1] + adds r0, r4, 0 + adds r0, 0xC + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + mov r0, sp + mov r1, r10 + bl CopyString + mov r0, sp + bl StripExtendedControlCodes + adds r0, r4, 0x4 + mov r1, sp + bl CopyString + movs r0, 0x7 + ands r5, r0 + ldrb r1, [r4, 0x3] + subs r0, 0xF + ands r0, r1 + orrs r0, r5 + movs r1, 0x3 + ands r6, r1 + lsls r2, r6, 3 + subs r1, 0x1C + ands r0, r1 + orrs r0, r2 + strb r0, [r4, 0x3] + add r0, sp, 0x20 + ldrb r0, [r0] + strb r0, [r4, 0x2] + adds r0, r4, 0 + bl sub_80ECA10 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r4, 0x14] + cmp r0, 0x1 + beq _080ECCDA + mov r1, r9 + cmp r1, 0x1 + bne _080ECCE8 +_080ECCDA: + strb r7, [r4, 0x15] + b _080ECCEC + .pool +_080ECCE8: + mov r2, r9 + strb r2, [r4, 0x15] +_080ECCEC: + movs r0, 0x1 +_080ECCEE: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80ECC04 + + thumb_func_start sub_80ECD00 +sub_80ECD00: @ 80ECD00 + push {r4-r6,lr} + sub sp, 0x20 + ldr r6, =0x03005d8c + ldr r0, =0x020375e4 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r6] + adds r4, r1, r0 + ldr r0, =0x020375e2 + ldrh r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + strb r0, [r4, 0x16] + adds r0, r4, 0x2 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + movs r0, 0xB + strb r0, [r4] + movs r5, 0x1 + strb r5, [r4, 0x1] + bl sub_80F0020 + strb r0, [r4, 0xA] + lsrs r0, 8 + strb r0, [r4, 0xB] + ldr r1, =0x02021cc4 + mov r0, sp + bl CopyString + mov r0, sp + bl StripExtendedControlCodes + adds r0, r4, 0 + adds r0, 0xC + mov r1, sp + bl CopyString + adds r0, r4, 0 + bl sub_80ECA10 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r4, 0x17] + cmp r0, 0x1 + beq _080ECD74 + ldr r0, [r6] + ldr r1, =0x000031a0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080ECD98 +_080ECD74: + strb r5, [r4, 0x18] + b _080ECD9A + .pool +_080ECD98: + strb r0, [r4, 0x18] +_080ECD9A: + add sp, 0x20 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80ECD00 + + thumb_func_start sub_80ECDA4 +sub_80ECDA4: @ 80ECDA4 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r5, =0x03005d8c + ldr r0, [r5] + ldr r4, =0x000027cc + adds r0, r4 + movs r1, 0x18 + bl sub_80EF910 + ldr r0, [r5] + adds r0, r4 + bl sub_80EFADC + ldr r1, =0x030060bc + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080ECDDC + ldr r0, [r5] + ldr r1, =0x00002b2c + adds r0, r1 + strb r6, [r0, 0xD] + movs r1, 0x8 + strb r1, [r0] +_080ECDDC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ECDA4 + + thumb_func_start sub_80ECDF4 +sub_80ECDF4: @ 80ECDF4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002b2c + adds r4, r0, r1 + ldr r1, =0x000027cc + adds r0, r1 + bl sub_80EFADC + ldr r1, =0x030060bc + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080ECE1C + strb r5, [r4, 0xE] +_080ECE1C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ECDF4 + + thumb_func_start sub_80ECE34 +sub_80ECE34: @ 80ECE34 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002b2c + adds r4, r0, r1 + ldr r1, =0x000027cc + adds r0, r1 + bl sub_80EFADC + ldr r1, =0x030060bc + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080ECE5C + strb r5, [r4, 0xF] +_080ECE5C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ECE34 + + thumb_func_start sub_80ECE74 +sub_80ECE74: @ 80ECE74 + push {r4,r5,lr} + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002b2c + adds r4, r0, r1 + ldr r1, =0x000027cc + adds r0, r1 + bl sub_80EFADC + ldr r1, =0x030060bc + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080ECE9C + strh r5, [r4, 0x10] +_080ECE9C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ECE74 + + thumb_func_start sub_80ECEB4 +sub_80ECEB4: @ 80ECEB4 + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r6, r1, 24 + ldr r0, =0x03005d8c + ldr r4, [r0] + ldr r0, =0x00002b2c + adds r5, r4, r0 + ldr r1, =0x000027cc + adds r0, r4, r1 + bl sub_80EFADC + ldr r1, =0x030060bc + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080ECF4C + ldr r2, =0x02039e00 + lsls r1, r6, 6 + adds r0, r1, r2 + ldrh r0, [r0] + strh r0, [r5, 0x2] + ldr r0, =0x00002b30 + adds r4, r0 + adds r2, 0xD + adds r1, r2 + adds r0, r4, 0 + bl CopyString + adds r0, r4, 0 + bl StripExtendedControlCodes + strb r7, [r5, 0xC] + adds r1, r6, 0x1 + ldr r0, =0x02039f30 + ldrb r0, [r0] + cmp r1, r0 + ble _080ECF30 + ldr r0, =0x020229e8 + ldrh r0, [r0, 0x1A] + b _080ECF4A + .pool +_080ECF30: + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080ECF48 + ldr r1, =0x020229e8 + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x1A] + cmp r0, 0x1 + bne _080ECF4A +_080ECF48: + movs r0, 0x1 +_080ECF4A: + strb r0, [r5, 0x1E] +_080ECF4C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ECEB4 + + thumb_func_start sub_80ECF5C +sub_80ECF5C: @ 80ECF5C + push {r4-r7,lr} + ldr r0, =0x03005d8c + ldr r6, [r0] + ldr r0, =0x00002b2c + adds r5, r6, r0 + ldrb r2, [r5] + cmp r2, 0x6 + bne _080ED02C + ldr r0, =0x030060bc + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + adds r4, r6, r0 + strb r2, [r4] + movs r7, 0x1 + strb r7, [r4, 0x1] + ldrh r0, [r5, 0x2] + strh r0, [r4, 0x2] + adds r0, r4, 0 + adds r0, 0x16 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + adds r0, r4, 0 + adds r0, 0x8 + ldr r2, =0x00002b34 + adds r1, r6, r2 + bl CopyString + ldrb r0, [r5, 0x13] + lsls r0, 29 + lsrs r0, 29 + ldrb r2, [r4, 0x13] + movs r3, 0x8 + negs r3, r3 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + strb r1, [r4, 0x13] + ldrb r2, [r5, 0x13] + movs r0, 0x18 + ands r0, r2 + movs r2, 0x19 + negs r2, r2 + ands r2, r1 + orrs r2, r0 + strb r2, [r4, 0x13] + ldrh r0, [r5, 0x14] + strh r0, [r4, 0x14] + ldrb r0, [r5, 0x13] + movs r1, 0x60 + ands r1, r0 + movs r0, 0x61 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r4, 0x13] + ldrb r1, [r5, 0x13] + lsls r1, 29 + lsrs r1, 29 + ands r0, r3 + orrs r0, r1 + strb r0, [r4, 0x13] + adds r0, r4, 0 + bl sub_80ECA10 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r4, 0x1E] + cmp r0, 0x1 + beq _080ECFFA + ldrb r0, [r5, 0x1F] + cmp r0, 0x1 + bne _080ED01C +_080ECFFA: + strb r7, [r4, 0x1F] + b _080ED01E + .pool +_080ED01C: + strb r0, [r4, 0x1F] +_080ED01E: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000027cc + adds r0, r1 + movs r1, 0x18 + bl sub_80EF910 +_080ED02C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ECF5C + + thumb_func_start sub_80ED03C +sub_80ED03C: @ 80ED03C + push {r4-r6,lr} + lsls r0, 16 + lsrs r6, r0, 16 + ldr r4, =0x03005d8c + ldr r0, [r4] + ldr r1, =0x00002b2c + adds r5, r0, r1 + bl sub_80EF7B4 + ldr r0, [r4] + ldr r1, =0x000027cc + adds r0, r1 + bl sub_80EFADC + ldr r1, =0x030060bc + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080ED07A + ldr r0, [r4] + ldr r1, =0x000027cc + adds r0, r1 + movs r1, 0x18 + bl sub_80EF910 + strh r6, [r5, 0x14] + movs r0, 0x6 + strb r0, [r5] +_080ED07A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ED03C + + thumb_func_start sub_80ED090 +sub_80ED090: @ 80ED090 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =0x03005d8c + ldr r4, [r0] + ldr r0, =0x00002b2c + adds r7, r4, r0 + ldr r1, =0x000027cc + adds r0, r4, r1 + bl sub_80EFADC + ldr r1, =0x030060bc + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080ED134 + movs r3, 0x3 + adds r0, r5, 0 + ands r0, r3 + lsls r0, 5 + ldrb r1, [r7, 0x13] + movs r2, 0x61 + negs r2, r2 + ands r2, r1 + orrs r2, r0 + strb r2, [r7, 0x13] + ldr r0, =0x02039f2c + ldrb r0, [r0] + movs r1, 0x7 + ands r1, r0 + movs r0, 0x8 + negs r0, r0 + ands r0, r2 + orrs r0, r1 + strb r0, [r7, 0x13] + ldr r1, =0x02039f2e + ldrb r1, [r1] + ands r3, r1 + lsls r3, 3 + movs r1, 0x19 + negs r1, r1 + ands r0, r1 + orrs r0, r3 + strb r0, [r7, 0x13] + ldr r0, =0x02039f24 + mov r8, r0 + ldrb r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =0x020244ec + adds r0, r5 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x2] + mov r1, r8 + ldrb r0, [r1] + muls r0, r6 + adds r0, r5 + ldr r1, =0x00002b34 + adds r4, r1 + movs r1, 0x2 + adds r2, r4, 0 + bl pokemon_getattr + adds r0, r4, 0 + bl StripExtendedControlCodes + mov r1, r8 + ldrb r0, [r1] + muls r0, r6 + adds r0, r5 + movs r1, 0x3 + bl pokemon_getattr + strb r0, [r7, 0x1F] +_080ED134: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ED090 + + thumb_func_start sub_80ED164 +sub_80ED164: @ 80ED164 + push {r4-r6,lr} + ldr r2, =0x03005d8c + ldr r0, =0x030060bc + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r6, r1, r0 + movs r0, 0x7 + strb r0, [r6] + movs r0, 0x1 + strb r0, [r6, 0x1] + adds r0, r6, 0x2 + ldr r4, =0x03005d90 + ldr r1, [r4] + bl CopyString + adds r0, r6, 0 + adds r0, 0xC + ldr r1, [r4] + ldr r2, =0x00000bd8 + adds r1, r2 + bl CopyString + ldr r1, [r4] + ldr r2, =0x00000bd4 + adds r0, r1, r2 + ldrh r0, [r0] + strh r0, [r6, 0xA] + adds r2, 0x2 + adds r0, r1, r2 + ldrh r0, [r0] + strh r0, [r6, 0x14] + ldr r5, =0x00000d07 + adds r1, r5 + ldrb r0, [r1] + movs r1, 0 + bl sub_8164FCC + strh r0, [r6, 0x16] + ldr r0, [r4] + ldr r1, =0x00000d06 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r6, 0x1C] + ldr r0, [r4] + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _080ED1F4 + movs r0, 0x32 + b _080ED1F6 + .pool +_080ED1F4: + movs r0, 0x64 +_080ED1F6: + strb r0, [r6, 0x1A] + ldr r0, =0x020375e0 + ldrh r0, [r0] + strb r0, [r6, 0x1B] + adds r0, r6, 0 + bl sub_80ECA10 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r6, 0x1D] + cmp r0, 0x1 + beq _080ED21C + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r2, =0x00000beb + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080ED21E +_080ED21C: + movs r0, 0x1 +_080ED21E: + strb r0, [r6, 0x1E] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ED164 + + thumb_func_start SaveRecordedItemPurchasesForTVShow +@ void SaveRecordedItemPurchasesForTVShow() +SaveRecordedItemPurchasesForTVShow: @ 80ED238 + push {r4-r7,lr} + ldr r5, =0x03005d8c + ldr r0, [r5] + ldrh r1, [r0, 0x4] + ldr r0, =0x00003c1a + cmp r1, r0 + beq _080ED2F2 + ldr r0, =0x0000371a + cmp r1, r0 + beq _080ED2F2 + ldr r0, =0x00005555 + bl sub_80EFB38 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080ED2F2 + ldr r0, [r5] + ldr r7, =0x000027cc + adds r0, r7 + bl sub_80EFB08 + ldr r6, =0x030060bc + strb r0, [r6] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080ED2F2 + movs r0, 0x16 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080ED2F2 + bl sub_80EF500 + ldr r2, =0x02039f80 + ldrh r0, [r2, 0x2] + cmp r0, 0x13 + bls _080ED2F2 + movs r1, 0 + ldrsb r1, [r6, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r7 + ldr r1, [r5] + adds r5, r1, r0 + movs r0, 0x16 + strb r0, [r5] + strb r4, [r5, 0x1] + ldr r0, =0x02037318 + ldrb r0, [r0, 0x14] + strb r0, [r5, 0x12] + movs r4, 0 + adds r7, r5, 0x6 + mov r12, r2 + adds r6, r5, 0 + adds r6, 0xC +_080ED2B6: + lsls r2, r4, 1 + adds r3, r7, r2 + lsls r1, r4, 2 + add r1, r12 + ldrh r0, [r1] + strh r0, [r3] + adds r2, r6, r2 + ldrh r0, [r1, 0x2] + strh r0, [r2] + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x2 + bls _080ED2B6 + movs r0, 0x1 + bl GetPriceReduction + strb r0, [r5, 0x2] + adds r0, r5, 0 + adds r0, 0x13 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + adds r0, r5, 0 + bl sub_80EC9E8 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r5, 0x3] +_080ED2F2: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end SaveRecordedItemPurchasesForTVShow + + thumb_func_start sub_80ED320 +sub_80ED320: @ 80ED320 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + bl sub_80EF7A8 + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0x1 + beq _080ED400 + ldr r0, =0x020375e0 + mov r8, r0 + ldrh r0, [r0] + movs r7, 0x64 + muls r0, r7 + ldr r6, =0x020244ec + adds r0, r6 + ldr r4, =0x02021cc4 + movs r1, 0x2 + adds r2, r4, 0 + bl pokemon_getattr + ldr r1, =0x03005d90 + mov r9, r1 + ldr r0, [r1] + bl GetStringLength + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _080ED400 + adds r0, r4, 0 + bl GetStringLength + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _080ED400 + ldr r2, =0x03005d8c + ldr r0, =0x030060bc + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r4, [r2] + adds r4, r0 + movs r0, 0x5 + strb r0, [r4] + movs r5, 0x1 + strb r5, [r4, 0x1] + mov r2, r8 + ldrh r0, [r2] + muls r0, r7 + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r4, 0x2] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + strb r0, [r4, 0x1A] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ands r0, r5 + strb r0, [r4, 0x1B] + ldrh r0, [r4, 0x2] + bl sub_80EFA24 + strh r0, [r4, 0x1C] + adds r0, r4, 0 + adds r0, 0xF + mov r2, r9 + ldr r1, [r2] + bl CopyString + mov r1, r8 + ldrh r0, [r1] + muls r0, r7 + adds r0, r6 + adds r5, r4, 0x4 + movs r1, 0x2 + adds r2, r5, 0 + bl pokemon_getattr + adds r0, r5, 0 + bl StripExtendedControlCodes + adds r0, r4, 0 + bl sub_80ECA10 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r4, 0x1E] + mov r2, r8 + ldrh r0, [r2] + muls r0, r7 + adds r0, r6 + movs r1, 0x3 + bl pokemon_getattr + strb r0, [r4, 0x1F] +_080ED400: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ED320 + + thumb_func_start StartMassOutbreak +StartMassOutbreak: @ 80ED430 + push {r4,r5,lr} + ldr r4, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r0, [r0] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =0x000027cc + adds r1, r0 + ldr r2, [r4] + adds r1, r2, r1 + ldrh r3, [r1, 0xC] + ldr r5, =0x00002b90 + adds r0, r2, r5 + strh r3, [r0] + ldrb r0, [r1, 0x10] + ldr r3, =0x00002b92 + adds r2, r3 + strb r0, [r2] + ldr r0, [r4] + ldrb r2, [r1, 0x11] + adds r5, 0x3 + adds r0, r5 + strb r2, [r0] + ldr r0, [r4] + ldrb r2, [r1, 0x14] + adds r3, 0x2 + adds r0, r3 + strb r2, [r0] + ldr r0, [r4] + ldrb r2, [r1, 0x2] + adds r5, 0x2 + adds r0, r5 + strb r2, [r0] + ldr r2, [r4] + ldrh r3, [r1, 0xE] + adds r5, 0x1 + adds r0, r2, r5 + strh r3, [r0] + ldrh r3, [r1, 0x4] + adds r5, 0x2 + adds r0, r2, r5 + strh r3, [r0] + ldrh r3, [r1, 0x6] + adds r5, 0x2 + adds r0, r2, r5 + strh r3, [r0] + ldrh r3, [r1, 0x8] + adds r5, 0x2 + adds r0, r2, r5 + strh r3, [r0] + ldrh r3, [r1, 0xA] + adds r5, 0x2 + adds r0, r2, r5 + strh r3, [r0] + ldrb r0, [r1, 0x3] + ldr r3, =0x00002ba0 + adds r2, r3 + strb r0, [r2] + ldr r0, [r4] + ldrb r1, [r1, 0x13] + adds r5, 0x3 + adds r0, r5 + strb r1, [r0] + ldr r0, [r4] + ldr r1, =0x00002ba2 + adds r0, r1 + movs r1, 0x2 + strh r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end StartMassOutbreak + + thumb_func_start sub_80ED4DC +sub_80ED4DC: @ 80ED4DC + push {r4,lr} + bl sub_80EFA88 + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0x1 + beq _080ED532 + ldr r2, =0x03005d8c + ldr r0, =0x030060bc + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + adds r0, r4, 0 + adds r0, 0x17 + bl sub_818E848 + movs r0, 0x2 + strb r0, [r4, 0x18] + movs r0, 0xC + strb r0, [r4] + movs r0, 0x1 + strb r0, [r4, 0x1] + adds r0, r4, 0x2 + bl sub_818E81C + adds r0, r4, 0 + adds r0, 0xA + adds r1, r4, 0 + adds r1, 0xB + bl sub_818E7E0 + bl sub_818E880 + strb r0, [r4, 0x16] + adds r0, r4, 0 + bl sub_80ECA10 +_080ED532: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ED4DC + + thumb_func_start sub_80ED548 +sub_80ED548: @ 80ED548 + push {r4,lr} + ldr r2, =0x03005d8c + ldr r0, =0x030060bc + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r4, [r2] + adds r4, r0 + movs r0, 0x1 + strb r0, [r4] + strb r0, [r4, 0x1] + adds r0, r4, 0 + adds r0, 0x10 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r4, 0x2] + adds r0, r4, 0 + bl sub_80ECA10 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r4, 0x18] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ED548 + + thumb_func_start sub_80ED5B8 +sub_80ED5B8: @ 80ED5B8 + push {r4,r5,lr} + ldr r2, =0x03005d8c + ldr r0, =0x030060bc + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r4, [r2] + adds r4, r0 + movs r5, 0 + movs r0, 0x2 + strb r0, [r4] + movs r0, 0x1 + strb r0, [r4, 0x1] + adds r0, r4, 0 + adds r0, 0x10 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + strh r5, [r4, 0x2] + adds r0, r4, 0 + bl sub_80ECA10 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r4, 0x18] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ED5B8 + + thumb_func_start sub_80ED610 +sub_80ED610: @ 80ED610 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r2, =0x03005d8c + ldr r0, =0x030060bc + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r5, r1, r0 + movs r0, 0x3 + strb r0, [r5] + movs r0, 0x1 + mov r8, r0 + mov r1, r8 + strb r1, [r5, 0x1] + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r7, 0x64 + muls r0, r7 + ldr r6, =0x020244ec + adds r0, r6 + movs r1, 0x20 + movs r2, 0 + bl pokemon_getattr + lsrs r0, 4 + movs r1, 0xF + ands r0, r1 + ldrb r2, [r5, 0x4] + movs r1, 0x10 + negs r1, r1 + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0x4] + ldr r0, =0x020375e6 + ldrb r0, [r0] + lsls r0, 4 + movs r2, 0xF + ands r1, r2 + orrs r1, r0 + strb r1, [r5, 0x4] + adds r0, r5, 0x5 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + muls r0, r7 + adds r0, r6 + adds r4, r5, 0 + adds r4, 0x10 + movs r1, 0x2 + adds r2, r4, 0 + bl pokemon_getattr + adds r0, r4, 0 + bl StripExtendedControlCodes + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + muls r0, r7 + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r5, 0x2] + adds r0, r5, 0 + bl sub_80ECA10 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r5, 0xD] + cmp r0, 0x1 + beq _080ED6D4 + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + muls r0, r7 + adds r0, r6 + movs r1, 0x3 + bl pokemon_getattr + cmp r0, 0x1 + bne _080ED6F4 +_080ED6D4: + mov r0, r8 + b _080ED706 + .pool +_080ED6F4: + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + muls r0, r7 + adds r0, r6 + movs r1, 0x3 + bl pokemon_getattr +_080ED706: + strb r0, [r5, 0xE] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80ED610 + + thumb_func_start TaskDummy5 +TaskDummy5: @ 80ED714 + bx lr + thumb_func_end TaskDummy5 + + thumb_func_start sub_80ED718 +sub_80ED718: @ 80ED718 + push {r4-r6,lr} + ldr r0, =0x00000864 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _080ED7E4 + movs r1, 0 + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r3, =0x000027cc +_080ED72E: + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2, r0 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0x29 + beq _080ED7E4 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x17 + bls _080ED72E + ldr r0, =0x00000147 + bl sub_80EFB38 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _080ED7E4 + ldr r6, =0x03005d8c + ldr r0, [r6] + ldr r1, =0x000027cc + adds r0, r1 + bl sub_80EFADC + ldr r4, =0x030060bc + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080ED7E4 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x5 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + movs r2, 0 + ldrsb r2, [r4, r2] + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + ldr r2, =0x000027cc + adds r1, r2 + ldr r4, [r6] + adds r4, r1 + movs r1, 0x29 + strb r1, [r4] + movs r3, 0x1 + strb r3, [r4, 0x1] + ldr r2, =gUnknown_0858D094 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0xA] + strb r0, [r4, 0x14] + strb r5, [r4, 0x2] + strb r5, [r4, 0x3] + ldrh r0, [r1] + movs r2, 0 + strh r0, [r4, 0xC] + strh r5, [r4, 0xE] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x4] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0x6] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0x8] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0xA] + ldrb r0, [r1, 0xB] + strb r0, [r4, 0x10] + strb r2, [r4, 0x11] + strb r2, [r4, 0x12] + movs r0, 0x32 + strb r0, [r4, 0x13] + strb r2, [r4, 0x15] + strh r3, [r4, 0x16] + adds r0, r4, 0 + bl sub_80ECA10 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r4, 0x18] +_080ED7E4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ED718 + + thumb_func_start EndMassOutbreak +EndMassOutbreak: @ 80ED808 + push {r4,r5,lr} + ldr r3, =0x03005d8c + ldr r0, [r3] + ldr r2, =0x00002b90 + adds r1, r0, r2 + movs r4, 0 + movs r2, 0 + strh r2, [r1] + ldr r5, =0x00002b92 + adds r0, r5 + strb r4, [r0] + ldr r0, [r3] + ldr r1, =0x00002b93 + adds r0, r1 + strb r4, [r0] + ldr r0, [r3] + adds r5, 0x2 + adds r0, r5 + strb r4, [r0] + ldr r0, [r3] + adds r1, 0x2 + adds r0, r1 + strb r4, [r0] + ldr r0, [r3] + adds r5, 0x2 + adds r1, r0, r5 + strh r2, [r1] + adds r5, 0x2 + adds r1, r0, r5 + strh r2, [r1] + adds r5, 0x2 + adds r1, r0, r5 + strh r2, [r1] + adds r5, 0x2 + adds r1, r0, r5 + strh r2, [r1] + adds r5, 0x2 + adds r1, r0, r5 + strh r2, [r1] + ldr r1, =0x00002ba0 + adds r0, r1 + strb r4, [r0] + ldr r0, [r3] + adds r5, 0x3 + adds r0, r5 + strb r4, [r0] + ldr r0, [r3] + adds r1, 0x2 + adds r0, r1 + strh r2, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end EndMassOutbreak + + thumb_func_start sub_80ED888 +sub_80ED888: @ 80ED888 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + bl sub_80ED8B4 + adds r0, r4, 0 + bl UpdateMassOutbreakTimeLeft + adds r0, r4, 0 + bl sub_80EF120 + adds r0, r4, 0 + bl sub_80EDA48 + adds r0, r4, 0 + bl sub_80EEB98 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80ED888 + + thumb_func_start sub_80ED8B4 +sub_80ED8B4: @ 80ED8B4 + push {r4-r7,lr} + lsls r0, 16 + lsrs r5, r0, 16 + ldr r1, =0x03005d8c + ldr r0, [r1] + ldr r2, =0x00002b90 + adds r0, r2 + ldrh r0, [r0] + mov r12, r1 + cmp r0, 0 + bne _080ED91C + movs r1, 0 + ldr r6, =0x000027cc +_080ED8CE: + mov r7, r12 + ldr r4, [r7] + lsls r0, r1, 3 + adds r0, r1 + lsls r3, r0, 2 + adds r2, r4, r3 + adds r0, r2, r6 + ldrb r0, [r0] + cmp r0, 0x29 + bne _080ED912 + ldr r7, =0x000027cd + adds r0, r2, r7 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080ED912 + adds r0, r3, r6 + adds r1, r4, r0 + ldrh r0, [r1, 0x16] + cmp r0, r5 + bcs _080ED90C + movs r0, 0 + strh r0, [r1, 0x16] + b _080ED91C + .pool +_080ED90C: + subs r0, r5 + strh r0, [r1, 0x16] + b _080ED91C +_080ED912: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x17 + bls _080ED8CE +_080ED91C: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80ED8B4 + + thumb_func_start UpdateMassOutbreakTimeLeft +UpdateMassOutbreakTimeLeft: @ 80ED924 + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r3, =0x00002ba2 + adds r1, r0, r3 + ldrh r0, [r1] + cmp r0, r2 + bhi _080ED948 + bl EndMassOutbreak + b _080ED94C + .pool +_080ED948: + subs r0, r2 + strh r0, [r1] +_080ED94C: + pop {r0} + bx r0 + thumb_func_end UpdateMassOutbreakTimeLeft + + thumb_func_start sub_80ED950 +sub_80ED950: @ 80ED950 + push {r4,lr} + lsls r0, 24 + cmp r0, 0 + beq _080ED978 + ldr r4, =0x0203a026 + ldrh r0, [r4] + lsrs r0, 8 + cmp r0, 0x4 + bls _080ED966 + bl sub_80ED9A8 +_080ED966: + ldrb r0, [r4] + strh r0, [r4] + cmp r0, 0xFF + beq _080ED99C + adds r0, 0x1 + b _080ED99A + .pool +_080ED978: + ldr r4, =0x0203a026 + ldrb r0, [r4] + cmp r0, 0x4 + bls _080ED984 + bl sub_80ED9A8 +_080ED984: + ldrh r0, [r4] + movs r1, 0xFF + lsls r1, 8 + ands r1, r0 + strh r1, [r4] + lsrs r0, r1, 8 + cmp r0, 0xFF + beq _080ED99C + movs r2, 0x80 + lsls r2, 1 + adds r0, r1, r2 +_080ED99A: + strh r0, [r4] +_080ED99C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ED950 + + thumb_func_start sub_80ED9A8 +sub_80ED9A8: @ 80ED9A8 + push {r4-r6,lr} + ldr r6, =0x03005d8c + ldr r0, [r6] + ldr r5, =0x000027cc + adds r0, r5 + bl sub_80EFB08 + ldr r4, =0x030060bc + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EDA18 + movs r0, 0x18 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EDA18 + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r4, [r6] + adds r4, r0 + movs r1, 0 + movs r0, 0x18 + strb r0, [r4] + strb r1, [r4, 0x1] + ldr r1, =0x0203a026 + ldrh r0, [r1] + strb r0, [r4, 0x2] + ldrh r0, [r1] + lsrs r0, 8 + strb r0, [r4, 0x3] + ldr r0, =0x0203a024 + ldrh r0, [r0] + strh r0, [r4, 0x4] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r4, 0x6] +_080EDA18: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ED9A8 + + thumb_func_start sub_80EDA3C +sub_80EDA3C: @ 80EDA3C + ldr r1, =0x0203a024 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_80EDA3C + + thumb_func_start sub_80EDA48 +sub_80EDA48: @ 80EDA48 + push {r4,lr} + ldr r4, =0x03005d8c + ldr r0, [r4] + ldr r2, =0x00002b2c + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x19 + bne _080EDA6E + ldrh r0, [r1, 0x2] + cmp r0, 0x13 + bls _080EDA62 + bl sub_80EDA80 +_080EDA62: + ldr r0, [r4] + ldr r1, =0x000027cc + adds r0, r1 + movs r1, 0x18 + bl sub_80EF910 +_080EDA6E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EDA48 + + thumb_func_start sub_80EDA80 +sub_80EDA80: @ 80EDA80 + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r7, =0x03005d8c + ldr r0, [r7] + ldr r1, =0x00002b2c + adds r5, r0, r1 + ldr r0, =0x0000ffff + bl sub_80EFB38 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _080EDB1C + ldr r0, [r7] + ldr r1, =0x000027cc + mov r8, r1 + add r0, r8 + bl sub_80EFB08 + ldr r4, =0x030060bc + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EDB1C + movs r0, 0x19 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EDB1C + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + add r0, r8 + ldr r4, [r7] + adds r4, r0 + movs r0, 0x19 + strb r0, [r4] + strb r6, [r4, 0x1] + ldrh r0, [r5, 0x2] + strh r0, [r4, 0x2] + movs r0, 0x5 + bl sub_80847F8 + ldrh r1, [r5, 0x6] + subs r0, r1 + strh r0, [r4, 0x6] + ldrh r0, [r5, 0x4] + strh r0, [r4, 0x4] + ldrh r0, [r5, 0x8] + strh r0, [r4, 0x8] + ldrb r0, [r5, 0xA] + strb r0, [r4, 0xA] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r4, 0xB] + ldr r0, [r7] + add r0, r8 + movs r1, 0x18 + bl sub_80EF910 +_080EDB1C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EDA80 + + thumb_func_start sub_80EDB44 +sub_80EDB44: @ 80EDB44 + push {r4-r7,lr} + movs r0, 0x1A + movs r1, 0x1 + bl sub_80EF46C + ldr r4, =0x03005d8c + ldr r0, [r4] + ldr r1, =0x000027cc + adds r0, r1 + bl sub_80EFB08 + ldr r2, =0x030060bc + strb r0, [r2] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EDC40 + movs r1, 0 + ldrsb r1, [r2, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r2, =0x000027cc + adds r0, r2 + ldr r1, [r4] + adds r4, r1, r0 + movs r1, 0 + movs r0, 0x1A + strb r0, [r4] + strb r1, [r4, 0x1] + ldr r6, =0x00000867 + movs r5, 0 +_080EDB88: + lsls r0, r6, 16 + lsrs r0, 16 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _080EDB9C + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080EDB9C: + adds r6, 0x1 + ldr r0, =0x0000086e + cmp r6, r0 + bls _080EDB88 + strb r5, [r4, 0x4] + bl sub_809D42C + cmp r0, 0 + beq _080EDBCC + movs r0, 0x1 + bl pokedex_count + b _080EDBD2 + .pool +_080EDBCC: + movs r0, 0x1 + bl sub_80C0844 +_080EDBD2: + strh r0, [r4, 0x2] + ldr r1, =0x02037318 + ldrb r0, [r1, 0x14] + strb r0, [r4, 0x7] + ldrh r0, [r1, 0x12] + movs r1, 0 + strh r0, [r4, 0xA] + strb r1, [r4, 0x5] + strb r1, [r4, 0x6] + movs r6, 0 + adds r7, r4, 0 + adds r7, 0x13 +_080EDBEA: + ldr r0, =gUnknown_0858D0DE + lsls r5, r6, 1 + adds r0, r5, r0 + ldrh r0, [r0] + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EDC04 + ldrb r0, [r4, 0x5] + adds r0, 0x1 + strb r0, [r4, 0x5] +_080EDC04: + ldr r0, =gUnknown_0858D0D0 + adds r0, r5, r0 + ldrh r0, [r0] + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EDC1C + ldrb r0, [r4, 0x6] + adds r0, 0x1 + strb r0, [r4, 0x6] +_080EDC1C: + adds r6, 0x1 + cmp r6, 0x6 + bls _080EDBEA + ldr r0, =0x03005d90 + ldr r1, [r0] + ldr r2, =0x00000eb8 + adds r0, r1, r2 + ldrh r0, [r0] + strh r0, [r4, 0x8] + adds r0, r7, 0 + bl CopyString + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r4, 0xC] +_080EDC40: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EDB44 + + thumb_func_start sub_80EDC60 +sub_80EDC60: @ 80EDC60 + push {r4-r7,lr} + adds r5, r0, 0 + ldr r7, =0x03005d8c + ldr r0, [r7] + ldr r6, =0x000027cc + adds r0, r6 + bl sub_80EFB08 + ldr r4, =0x030060bc + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EDCCE + movs r0, 0x1B + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EDCCE + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldr r4, [r7] + adds r4, r0 + movs r1, 0 + movs r0, 0x1B + strb r0, [r4] + strb r1, [r4, 0x1] + ldr r1, =0x03005d90 + ldr r0, [r1] + ldrb r0, [r0, 0x8] + strb r0, [r4, 0x8] + ldrh r0, [r5] + strh r0, [r4, 0x4] + ldrh r0, [r5, 0x2] + strh r0, [r4, 0x6] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, [r1] + bl CopyString + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r4, 0x9] +_080EDCCE: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EDC60 + + thumb_func_start sub_80EDCE8 +sub_80EDCE8: @ 80EDCE8 + push {r4-r6,lr} + ldr r6, =0x03005d8c + ldr r0, [r6] + ldr r5, =0x000027cc + adds r0, r5 + bl sub_80EFB08 + ldr r4, =0x030060bc + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EDD56 + movs r0, 0x1C + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EDD56 + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r4, [r6] + adds r4, r0 + movs r1, 0 + movs r0, 0x1C + strb r0, [r4] + strb r1, [r4, 0x1] + ldr r0, =0x020375e2 + ldrh r0, [r0] + strh r0, [r4, 0x2] + ldr r1, =0x02037318 + ldrb r0, [r1, 0x14] + strb r0, [r4, 0x4] + ldrh r0, [r1, 0x12] + strh r0, [r4, 0x6] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r4, 0x5] +_080EDD56: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EDCE8 + + thumb_func_start sub_80EDD78 +sub_80EDD78: @ 80EDD78 + push {r4-r6,lr} + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000027cc + adds r0, r1 + bl sub_80EFB08 + ldr r1, =0x030060bc + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EDE54 + movs r0, 0x1D + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EDE54 + movs r5, 0 + ldr r0, =0x0203a02a + ldrb r1, [r0] + adds r6, r0, 0 + cmp r1, 0 + beq _080EDDCC + cmp r1, 0x1 + beq _080EDDEE + b _080EDE54 + .pool +_080EDDCC: + ldr r0, =0x0203a028 + ldrh r1, [r0] + adds r0, r1, 0 + adds r0, 0xC8 + cmp r4, r0 + blt _080EDDE4 + movs r5, 0x1 + subs r0, r4, r1 + b _080EDE12 + .pool +_080EDDE4: + cmp r1, 0x63 + bls _080EDE54 + adds r0, r1, 0 + subs r0, 0x64 + b _080EDE0C +_080EDDEE: + ldr r0, =0x0203a028 + ldrh r1, [r0] + adds r0, r1, 0 + adds r0, 0x32 + cmp r4, r0 + blt _080EDE04 + movs r5, 0x1 + subs r0, r4, r1 + b _080EDE12 + .pool +_080EDE04: + cmp r1, 0x31 + bls _080EDE54 + adds r0, r1, 0 + subs r0, 0x32 +_080EDE0C: + cmp r4, r0 + bgt _080EDE54 + subs r0, r1, r4 +_080EDE12: + lsls r0, 16 + lsrs r3, r0, 16 + ldr r2, =0x03005d8c + ldr r0, =0x030060bc + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r4, [r2] + adds r4, r0 + movs r1, 0 + movs r0, 0x1D + strb r0, [r4] + strb r1, [r4, 0x1] + strh r3, [r4, 0x4] + ldrb r0, [r6] + strb r0, [r4, 0x3] + strb r5, [r4, 0x2] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r4, 0x8] +_080EDE54: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EDD78 + + thumb_func_start sub_80EDE70 +sub_80EDE70: @ 80EDE70 + ldr r2, =0x0203a02a + movs r1, 0 + strb r1, [r2] + ldr r1, =0x0203a028 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_80EDE70 + + thumb_func_start sub_80EDE84 +sub_80EDE84: @ 80EDE84 + ldr r2, =0x0203a02a + movs r1, 0x1 + strb r1, [r2] + ldr r1, =0x0203a028 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_80EDE84 + + thumb_func_start sub_80EDE98 +sub_80EDE98: @ 80EDE98 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r0 + movs r3, 0 + ldr r6, =0x030060d0 + ldr r7, =0x03005d8c + adds r2, r6, 0 + movs r1, 0 +_080EDEAC: + adds r0, r3, r2 + strb r1, [r0] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xF + bls _080EDEAC + movs r3, 0 + movs r5, 0 +_080EDEBE: + ldr r0, [r7] + ldr r1, =0x00001aae + adds r0, r1 + adds r0, r3 + ldrb r4, [r0] + adds r3, 0x1 + cmp r4, 0 + beq _080EDF0A + movs r1, 0 + ldrb r0, [r6] + cmp r0, 0 + bne _080EDEE8 + strb r4, [r6] + b _080EDF04 + .pool +_080EDEE8: + adds r0, r1, r6 + ldrb r0, [r0] + cmp r0, r4 + beq _080EDF0A + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bhi _080EDF0A + adds r2, r1, r6 + ldrb r0, [r2] + cmp r0, 0 + bne _080EDEE8 + strb r4, [r2] +_080EDF04: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080EDF0A: + lsls r0, r3, 24 + lsrs r3, r0, 24 + cmp r3, 0xF + bls _080EDEBE + cmp r5, 0x4 + bls _080EDF1E + movs r0, 0x4 + mov r1, r8 + strb r0, [r1, 0x3] + b _080EDF22 +_080EDF1E: + mov r0, r8 + strb r5, [r0, 0x3] +_080EDF22: + mov r1, r8 + ldrb r0, [r1, 0x3] + cmp r0, 0 + beq _080EDFA4 + cmp r0, 0x1 + bne _080EDF34 + ldrb r0, [r6] + strb r0, [r1, 0x4] + b _080EDFA4 +_080EDF34: + movs r6, 0 + adds r7, r5, 0 + muls r7, r5 + cmp r6, r7 + bge _080EDF7E + ldr r0, =0x030060d0 + mov r9, r0 +_080EDF42: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __modsi3 + lsls r0, 24 + lsrs r4, r0, 24 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __modsi3 + lsls r0, 24 + lsrs r1, r0, 24 + mov r0, r9 + adds r2, r4, r0 + ldrb r3, [r2] + add r1, r9 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, r7 + blt _080EDF42 +_080EDF7E: + movs r3, 0 + mov r1, r8 + ldrb r1, [r1, 0x3] + cmp r3, r1 + bcs _080EDFA4 + mov r2, r8 + adds r2, 0x4 + ldr r4, =0x030060d0 +_080EDF8E: + adds r1, r2, r3 + adds r0, r3, r4 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + mov r0, r8 + ldrb r0, [r0, 0x3] + cmp r3, r0 + bcc _080EDF8E +_080EDFA4: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EDE98 + + thumb_func_start sub_80EDFB4 +sub_80EDFB4: @ 80EDFB4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r0 + movs r7, 0 + movs r0, 0 + mov r9, r0 + ldr r1, =0x030060c0 + mov r8, r1 +_080EDFCA: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + cmp r0, 0 + beq _080EE094 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _080EE094 + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + ldr r2, =0x030060e0 + mov r3, r9 + lsls r1, r3, 3 + adds r6, r1, r2 + strb r0, [r6] + adds r0, r4, 0 + movs r1, 0xB + bl pokemon_getattr + strh r0, [r6, 0x2] + movs r5, 0 + adds r0, r4, 0 + movs r1, 0xD + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _080EE020 + mov r0, r8 + strh r1, [r0] + movs r5, 0x1 +_080EE020: + adds r0, r4, 0 + movs r1, 0xE + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _080EE03C + lsls r0, r5, 1 + add r0, r8 + strh r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080EE03C: + adds r0, r4, 0 + movs r1, 0xF + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _080EE058 + lsls r0, r5, 1 + add r0, r8 + strh r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080EE058: + adds r0, r4, 0 + movs r1, 0x10 + bl pokemon_getattr + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _080EE074 + lsls r0, r5, 1 + add r0, r8 + strh r1, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080EE074: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r5, 0 + bl __modsi3 + lsls r0, 1 + add r0, r8 + ldrh r0, [r0] + strh r0, [r6, 0x4] + mov r0, r9 + adds r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 +_080EE094: + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0x5 + bls _080EDFCA + movs r7, 0 + movs r1, 0 + cmp r1, r9 + bcs _080EE0BE + ldr r2, =0x030060e0 +_080EE0A8: + lsls r0, r7, 3 + adds r0, r2 + ldrb r0, [r0] + adds r0, r1, r0 + lsls r0, 16 + lsrs r1, r0, 16 + adds r0, r7, 0x1 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, r9 + bcc _080EE0A8 +_080EE0BE: + adds r0, r1, 0 + mov r1, r9 + bl __divsi3 + mov r1, r10 + strb r0, [r1, 0x2] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + mov r1, r9 + bl __modsi3 + lsls r0, 16 + ldr r1, =0x030060e0 + lsrs r0, 13 + adds r0, r1 + ldrh r1, [r0, 0x2] + mov r2, r10 + strh r1, [r2, 0x8] + ldrh r0, [r0, 0x4] + strh r0, [r2, 0xA] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EDFB4 + + thumb_func_start sub_80EE104 +sub_80EE104: @ 80EE104 + push {r4,lr} + movs r0, 0x1F + movs r1, 0x1 + bl sub_80EF46C + ldr r4, =0x03005d8c + ldr r0, [r4] + ldr r1, =0x000027cc + adds r0, r1 + bl sub_80EFB08 + ldr r2, =0x030060bc + strb r0, [r2] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EE168 + movs r1, 0 + ldrsb r1, [r2, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r4, [r4] + adds r4, r0 + movs r1, 0 + movs r0, 0x1F + strb r0, [r4] + strb r1, [r4, 0x1] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + adds r0, r4, 0 + bl sub_80EDE98 + adds r0, r4, 0 + bl sub_80EDFB4 + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r4, 0xC] +_080EE168: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EE104 + + thumb_func_start sub_80EE184 +sub_80EE184: @ 80EE184 + push {r4-r7,lr} + ldr r6, =0x03005d8c + ldr r0, [r6] + ldr r5, =0x000027cc + adds r0, r5 + bl sub_80EFB08 + ldr r4, =0x030060bc + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _080EE1A4 + b _080EE2C2 +_080EE1A4: + movs r0, 0x1E + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EE1B6 + b _080EE2C2 +_080EE1B6: + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, [r6] + adds r4, r1, r0 + movs r1, 0 + movs r0, 0x1E + strb r0, [r4] + strb r1, [r4, 0x1] + movs r5, 0 + ldr r6, =0x03005d10 + ldr r3, =0x02037318 + ldr r7, =0x03005d90 + adds r2, r6, 0 + adds r2, 0x36 +_080EE1DA: + adds r0, r1, r2 + ldrb r0, [r0] + adds r0, r5, r0 + lsls r0, 16 + lsrs r5, r0, 16 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xA + bls _080EE1DA + ldrb r1, [r6, 0x5] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080EE1FE + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 +_080EE1FE: + ldrb r0, [r3, 0x14] + strb r0, [r4, 0x4] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, [r7] + bl CopyString + ldrh r0, [r6, 0x6] + strh r0, [r4, 0xA] + ldr r0, =0x0202433a + ldrb r0, [r0] + subs r0, 0x1 + cmp r0, 0x9 + bhi _080EE282 + lsls r0, 2 + ldr r1, =_080EE244 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080EE244: + .4byte _080EE276 + .4byte _080EE26C + .4byte _080EE26C + .4byte _080EE27A + .4byte _080EE27A + .4byte _080EE27E + .4byte _080EE272 + .4byte _080EE27A + .4byte _080EE282 + .4byte _080EE27E +_080EE26C: + movs r0, 0 + strb r0, [r4] + b _080EE2C2 +_080EE272: + movs r0, 0 + b _080EE280 +_080EE276: + movs r0, 0x1 + b _080EE280 +_080EE27A: + movs r0, 0x2 + b _080EE280 +_080EE27E: + movs r0, 0x3 +_080EE280: + strb r0, [r4, 0x5] +_080EE282: + ldr r1, =0x03005d10 + ldrh r0, [r1, 0x20] + strh r0, [r4, 0x2] + ldrb r0, [r4, 0x5] + cmp r0, 0x1 + beq _080EE2B2 + cmp r0, 0x1 + bgt _080EE2B6 + cmp r0, 0 + bne _080EE2B6 + ldrb r1, [r1, 0x5] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080EE2A8 + movs r0, 0x1 + b _080EE2AC + .pool +_080EE2A8: + lsls r0, r1, 26 + lsrs r0, 28 +_080EE2AC: + strh r0, [r4, 0x6] + strh r5, [r4, 0x8] + b _080EE2B6 +_080EE2B2: + ldrh r0, [r1, 0x22] + strh r0, [r4, 0xC] +_080EE2B6: + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r4, 0xE] +_080EE2C2: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EE184 + + thumb_func_start sub_80EE2CC +sub_80EE2CC: @ 80EE2CC + push {r4-r6,lr} + ldr r6, =0x03005d8c + ldr r0, [r6] + ldr r5, =0x000027cc + adds r0, r5 + bl sub_80EFB08 + ldr r4, =0x030060bc + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EE33A + movs r0, 0x20 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EE33A + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r4, [r6] + adds r4, r0 + movs r1, 0 + movs r0, 0x20 + strb r0, [r4] + strb r1, [r4, 0x1] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + ldr r0, =0x020375e0 + ldrb r1, [r0] + movs r0, 0x4 + subs r0, r1 + strb r0, [r4, 0x4] + ldr r0, =0x020375e2 + ldrh r0, [r0] + strh r0, [r4, 0x2] + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r4, 0x5] +_080EE33A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EE2CC + + thumb_func_start sub_80EE35C +sub_80EE35C: @ 80EE35C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r7, r3, 0 + ldr r3, [sp, 0x24] + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + lsls r2, 24 + lsrs r6, r2, 24 + lsls r3, 16 + lsrs r3, 16 + str r3, [sp] + ldr r0, =0x03005d8c + mov r8, r0 + ldr r0, [r0] + ldr r5, =0x000027cc + adds r0, r5 + bl sub_80EFB08 + ldr r4, =0x030060bc + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EE426 + movs r0, 0x21 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EE426 + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + mov r2, r8 + ldr r1, [r2] + adds r4, r1, r0 + movs r1, 0 + movs r0, 0x21 + strb r0, [r4] + strb r1, [r4, 0x1] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + mov r0, r10 + strh r0, [r4, 0x4] + mov r1, r9 + strh r1, [r4, 0x6] + lsls r0, r6, 1 + adds r0, r7 + ldrh r0, [r0] + strh r0, [r4, 0x2] + movs r2, 0 + movs r3, 0 + adds r5, r4, 0 + adds r5, 0x8 +_080EE3EE: + cmp r2, r6 + beq _080EE408 + lsls r0, r2, 1 + adds r0, r7 + ldrh r1, [r0] + cmp r1, 0 + beq _080EE408 + lsls r0, r3, 1 + adds r0, r5, r0 + strh r1, [r0] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 +_080EE408: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x3 + bls _080EE3EE + strb r3, [r4, 0x10] + mov r2, sp + ldrh r2, [r2] + strh r2, [r4, 0xE] + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r4, 0x11] +_080EE426: + 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_80EE35C + + thumb_func_start sub_80EE44C +sub_80EE44C: @ 80EE44C + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r6, =0x03005d8c + ldr r0, [r6] + ldr r5, =0x000027cc + adds r0, r5 + bl sub_80EFB08 + ldr r4, =0x030060bc + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EE4BE + movs r0, 0x27 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EE4BE + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r4, [r6] + adds r4, r0 + movs r1, 0 + movs r0, 0x27 + strb r0, [r4] + strb r1, [r4, 0x1] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + mov r0, r8 + strb r0, [r4, 0x2] + strb r7, [r4, 0x3] + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r4, 0x4] +_080EE4BE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EE44C + + thumb_func_start sub_80EE4DC +sub_80EE4DC: @ 80EE4DC + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + ldr r7, =0x03005d8c + ldr r0, [r7] + ldr r5, =0x000027cc + adds r0, r5 + bl sub_80EFB08 + ldr r4, =0x030060bc + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EE59A + movs r0, 0x23 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EE59A + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldr r1, [r7] + adds r5, r1, r0 + movs r1, 0 + movs r0, 0x23 + strb r0, [r5] + strb r1, [r5, 0x1] + adds r0, r5, 0 + adds r0, 0x13 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + adds r4, r5, 0x4 + adds r0, r6, 0 + movs r1, 0x2 + adds r2, r4, 0 + bl pokemon_getattr + adds r0, r4, 0 + bl StripExtendedControlCodes + adds r0, r6, 0 + bl sub_80EE5A4 + strb r0, [r5, 0x2] + mov r0, r8 + bl sub_80EE69C + strb r0, [r5, 0x3] + adds r0, r5, 0 + bl sub_80EC9E8 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r5, 0xF] + cmp r0, 0x1 + beq _080EE578 + adds r0, r6, 0 + movs r1, 0x3 + bl pokemon_getattr + cmp r0, 0x1 + bne _080EE590 +_080EE578: + movs r0, 0x1 + b _080EE598 + .pool +_080EE590: + adds r0, r6, 0 + movs r1, 0x3 + bl pokemon_getattr +_080EE598: + strb r0, [r5, 0x10] +_080EE59A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80EE4DC + + thumb_func_start sub_80EE5A4 +sub_80EE5A4: @ 80EE5A4 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x32 + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x33 + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x34 + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x35 + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x36 + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x43 + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x44 + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x45 + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x46 + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x47 + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x48 + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x49 + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x4A + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x4B + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x4C + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x4D + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x4E + bl pokemon_getattr + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80EE5A4 + + thumb_func_start sub_80EE69C +sub_80EE69C: @ 80EE69C + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x43 + beq _080EE722 + cmp r0, 0x32 + bne _080EE6AE + movs r0, 0x1 + b _080EE728 +_080EE6AE: + cmp r0, 0x33 + bne _080EE6B6 + movs r0, 0x5 + b _080EE728 +_080EE6B6: + cmp r0, 0x34 + bne _080EE6BE + movs r0, 0x9 + b _080EE728 +_080EE6BE: + cmp r0, 0x35 + bne _080EE6C6 + movs r0, 0xD + b _080EE728 +_080EE6C6: + cmp r0, 0x36 + bne _080EE6CE + movs r0, 0x11 + b _080EE728 +_080EE6CE: + cmp r0, 0x44 + bne _080EE6D6 + movs r0, 0x15 + b _080EE728 +_080EE6D6: + cmp r0, 0x45 + bne _080EE6DE + movs r0, 0x16 + b _080EE728 +_080EE6DE: + cmp r0, 0x46 + bne _080EE6E6 + movs r0, 0x17 + b _080EE728 +_080EE6E6: + cmp r0, 0x47 + bne _080EE6EE + movs r0, 0x18 + b _080EE728 +_080EE6EE: + cmp r0, 0x48 + bne _080EE6F6 + movs r0, 0x19 + b _080EE728 +_080EE6F6: + cmp r0, 0x49 + bne _080EE6FE + movs r0, 0x1A + b _080EE728 +_080EE6FE: + cmp r0, 0x4A + bne _080EE706 + movs r0, 0x1B + b _080EE728 +_080EE706: + cmp r0, 0x4B + bne _080EE70E + movs r0, 0x1C + b _080EE728 +_080EE70E: + cmp r0, 0x4C + bne _080EE716 + movs r0, 0x1D + b _080EE728 +_080EE716: + cmp r0, 0x4D + bne _080EE71E + movs r0, 0x1E + b _080EE728 +_080EE71E: + cmp r0, 0x4E + beq _080EE726 +_080EE722: + movs r0, 0 + b _080EE728 +_080EE726: + movs r0, 0x1F +_080EE728: + pop {r1} + bx r1 + thumb_func_end sub_80EE69C + + thumb_func_start sub_80EE72C +sub_80EE72C: @ 80EE72C + push {r4-r6,lr} + ldr r5, =0x03005d8c + ldr r0, [r5] + ldr r6, =0x000027cc + adds r0, r6 + bl sub_80EFB08 + ldr r4, =0x030060bc + strb r0, [r4] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EE79C + movs r0, 0x22 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EE79C + movs r1, 0 + ldrsb r1, [r4, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldr r4, [r5] + adds r4, r0 + movs r1, 0 + movs r0, 0x22 + strb r0, [r4] + strb r1, [r4, 0x1] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + ldr r0, [r5] + ldr r2, =0x00002bb0 + adds r1, r0, r2 + ldrh r1, [r1] + strh r1, [r4, 0x4] + ldr r1, =0x00002bb2 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r4, 0x6] + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r4, 0x8] +_080EE79C: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EE72C + + thumb_func_start sub_80EE7C0 +sub_80EE7C0: @ 80EE7C0 + push {r4,lr} + ldr r4, =0x03005d8c + ldr r0, [r4] + ldr r1, =0x000027cc + adds r0, r1 + bl sub_80EFADC + ldr r1, =0x030060bc + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EE810 + movs r0, 0xB + bl sub_80EF550 + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0x1 + beq _080EE810 + ldr r0, [r4] + ldr r1, =0x00003150 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0xFF + beq _080EE810 + movs r0, 0 + b _080EE812 + .pool +_080EE810: + movs r0, 0x1 +_080EE812: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80EE7C0 + + thumb_func_start sub_80EE818 +sub_80EE818: @ 80EE818 + push {r4-r7,lr} + movs r0, 0x24 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EE870 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000027cc + adds r7, r0, r1 + bl sub_80F0020 + adds r4, r0, 0 + movs r6, 0x5 + lsrs r5, r4, 8 +_080EE83C: + lsls r0, r6, 3 + adds r0, r6 + lsls r0, 2 + adds r1, r0, r7 + ldrb r0, [r1] + cmp r0, 0x24 + bne _080EE866 + movs r3, 0xFF + adds r0, r4, 0 + ands r0, r3 + adds r2, r1, 0 + adds r2, 0x22 + ldrb r2, [r2] + cmp r0, r2 + bne _080EE866 + adds r0, r5, 0 + ands r0, r3 + adds r1, 0x23 + ldrb r1, [r1] + cmp r0, r1 + beq _080EE89C +_080EE866: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x17 + bls _080EE83C +_080EE870: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000027cc + adds r0, r1 + bl sub_80EFB08 + ldr r1, =0x030060bc + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EE8C0 + movs r0, 0x1 + b _080EE8C2 + .pool +_080EE89C: + ldr r5, =0x03005d8c + ldr r0, [r5] + ldr r4, =0x000027cc + adds r0, r4 + adds r1, r6, 0 + bl sub_80EF910 + ldr r0, [r5] + adds r0, r4 + bl sub_80EF93C + movs r0, 0x1 + b _080EE8C2 + .pool +_080EE8C0: + movs r0, 0 +_080EE8C2: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80EE818 + + thumb_func_start sub_80EE8C8 +sub_80EE8C8: @ 80EE8C8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r5, =0x03005d8c + ldr r0, [r5] + ldr r1, =0x000027cc + adds r0, r1 + bl sub_80EFB08 + ldr r2, =0x030060bc + strb r0, [r2] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _080EE8F4 + b _080EEA52 +_080EE8F4: + movs r1, 0 + ldrsb r1, [r2, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r2, =0x000027cc + adds r0, r2 + ldr r1, [r5] + adds r7, r1, r0 + movs r1, 0 + movs r0, 0x24 + strb r0, [r7] + strb r1, [r7, 0x1] + adds r0, r7, 0 + adds r0, 0x13 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + strh r6, [r7, 0x2] + strb r4, [r7, 0xD] + subs r0, r4, 0x1 + cmp r0, 0xC + bls _080EE926 + b _080EEA46 +_080EE926: + lsls r0, 2 + ldr r1, =_080EE944 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080EE944: + .4byte _080EE978 + .4byte _080EE9A8 + .4byte _080EE9E8 + .4byte _080EEA00 + .4byte _080EE978 + .4byte _080EE978 + .4byte _080EE978 + .4byte _080EE978 + .4byte _080EE978 + .4byte _080EE978 + .4byte _080EE978 + .4byte _080EE978 + .4byte _080EE978 +_080EE978: + ldr r4, =0x020244ec + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x4] + adds r0, r4, 0 + adds r0, 0x64 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x6] + adds r4, 0xC8 + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x8] + b _080EEA46 + .pool +_080EE9A8: + ldr r4, =0x020244ec + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x4] + adds r0, r4, 0 + adds r0, 0x64 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x6] + adds r0, r4, 0 + adds r0, 0xC8 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x8] + movs r1, 0x96 + lsls r1, 1 + adds r0, r4, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0xA] + b _080EEA46 + .pool +_080EE9E8: + ldr r4, =0x020244ec + adds r0, r4, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x4] + adds r4, 0x64 + adds r0, r4, 0 + b _080EEA3C + .pool +_080EEA00: + ldr r2, =0x03005d8c + mov r8, r2 + ldr r6, =0x03005d90 + ldr r0, [r6] + ldr r1, =0x00000caa + adds r0, r1 + ldrh r0, [r0] + movs r5, 0x64 + adds r1, r0, 0 + muls r1, r5 + movs r4, 0xEA + lsls r4, 1 + adds r1, r4 + ldr r0, [r2] + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x4] + ldr r0, [r6] + ldr r2, =0x00000cac + adds r0, r2 + ldrh r0, [r0] + adds r1, r0, 0 + muls r1, r5 + adds r1, r4 + mov r2, r8 + ldr r0, [r2] + adds r0, r1 +_080EEA3C: + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + strh r0, [r7, 0x6] +_080EEA46: + adds r0, r7, 0 + bl sub_80EC9E8 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r7, 0xC] +_080EEA52: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EE8C8 + + thumb_func_start sub_80EEA70 +sub_80EEA70: @ 80EEA70 + push {r4-r7,lr} + sub sp, 0x20 + movs r0, 0x26 + movs r1, 0 + bl sub_80EF46C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080EEA86 + b _080EEB8C +_080EEA86: + ldr r7, =0x03005d8c + ldr r0, [r7] + ldr r1, =0x000027cc + adds r0, r1 + bl sub_80EFB08 + ldr r2, =0x030060bc + strb r0, [r2] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EEB8C + movs r1, 0 + ldrsb r1, [r2, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r7] + adds r5, r1, r0 + movs r1, 0 + movs r0, 0x26 + strb r0, [r5] + strb r1, [r5, 0x1] + adds r0, r5, 0 + adds r0, 0x13 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + ldr r0, =0x000040ec + bl VarGet + strh r0, [r5, 0x2] + bl sub_80E980C + ldr r1, =0x02021cc4 + mov r0, sp + bl CopyString + mov r0, sp + bl StripExtendedControlCodes + adds r0, r5, 0x4 + mov r1, sp + bl CopyString + ldr r0, =0x000040ed + bl VarGet + strh r0, [r5, 0x10] + ldr r0, =0x000040ee + bl VarGet + adds r4, r0, 0 + ldr r0, =0x000040ef + bl VarGet + lsls r4, 16 + lsrs r4, 16 + lsls r0, 16 + adds r4, r0 + str r4, [r5, 0xC] + adds r0, r5, 0 + bl sub_80EC9E8 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r5, 0x1B] + cmp r0, 0x1 + beq _080EEB3A + ldr r4, [r7] + ldr r6, =0x00004054 + adds r0, r6, 0 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 5 + adds r4, r1 + ldr r0, =0x00001aa9 + adds r4, r0 + ldrb r0, [r4] + cmp r0, 0x1 + bne _080EEB70 +_080EEB3A: + movs r0, 0x1 + b _080EEB8A + .pool +_080EEB70: + adds r0, r6, 0 + bl VarGet + ldr r2, [r7] + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 5 + adds r2, r1 + ldr r1, =0x00001aa9 + adds r2, r1 + ldrb r0, [r2] +_080EEB8A: + strb r0, [r5, 0x1C] +_080EEB8C: + add sp, 0x20 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EEA70 + + thumb_func_start sub_80EEB98 +sub_80EEB98: @ 80EEB98 + push {r4-r7,lr} + movs r5, 0 + ldr r6, =gUnknown_0858D0EC + adds r7, r6, 0x2 + b _080EEBAE + .pool +_080EEBA8: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080EEBAE: + cmp r5, 0x6 + bhi _080EEBCE + lsls r4, r5, 2 + adds r0, r4, r6 + ldrh r0, [r0] + bl VarGet + adds r4, r7 + lsls r0, 16 + lsrs r0, 16 + ldrh r4, [r4] + cmp r0, r4 + bcc _080EEBA8 + adds r0, r5, 0 + bl sub_80EEBF4 +_080EEBCE: + movs r5, 0 + ldr r4, =gUnknown_0858D0EC +_080EEBD2: + lsls r0, r5, 2 + adds r0, r4 + ldrh r0, [r0] + movs r1, 0 + bl VarSet + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x6 + bls _080EEBD2 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EEB98 + + thumb_func_start sub_80EEBF4 +sub_80EEBF4: @ 80EEBF4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0x25 + movs r1, 0x1 + bl sub_80EF46C + ldr r4, =0x03005d8c + ldr r0, [r4] + ldr r1, =0x000027cc + adds r0, r1 + bl sub_80EFB08 + ldr r2, =0x030060bc + strb r0, [r2] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EEC60 + movs r1, 0 + ldrsb r1, [r2, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r4, [r4] + adds r4, r0 + movs r1, 0 + movs r0, 0x25 + strb r0, [r4] + strb r1, [r4, 0x1] + adds r0, r4, 0 + adds r0, 0x13 + ldr r1, =0x03005d90 + ldr r1, [r1] + bl CopyString + strb r5, [r4, 0x4] + ldr r1, =gUnknown_0858D0EC + lsls r0, r5, 2 + adds r0, r1 + ldrh r0, [r0] + bl VarGet + strh r0, [r4, 0x2] + adds r0, r4, 0 + bl sub_80EC9E8 + ldr r0, =gUnknown_82E9531 + ldrb r0, [r0] + strb r0, [r4, 0x5] +_080EEC60: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EEBF4 + + thumb_func_start sub_80EEC80 +sub_80EEC80: @ 80EEC80 + push {r4,lr} + ldr r4, =0x000040e6 + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EEC80 + + thumb_func_start sub_80EECA4 +sub_80EECA4: @ 80EECA4 + push {r4,lr} + ldr r4, =0x000040eb + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EECA4 + + thumb_func_start sub_80EECC8 +sub_80EECC8: @ 80EECC8 + push {r4,lr} + ldr r4, =0x000040e7 + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EECC8 + + thumb_func_start sub_80EECEC +sub_80EECEC: @ 80EECEC + push {r4,lr} + ldr r4, =0x000040e8 + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EECEC + + thumb_func_start sub_80EED10 +sub_80EED10: @ 80EED10 + push {r4,lr} + ldr r4, =0x000040e9 + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + adds r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EED10 + + thumb_func_start sub_80EED34 +sub_80EED34: @ 80EED34 + push {r4,lr} + ldr r4, =0x000040ea + adds r0, r4, 0 + bl VarGet + adds r1, r0, 0 + ldr r0, =0x020375e4 + ldrh r0, [r0] + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl VarSet + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EED34 + + thumb_func_start sub_80EED60 +sub_80EED60: @ 80EED60 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r5, =0x000040f1 + adds r0, r5, 0 + bl VarGet + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl VarSet + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EED60 + + thumb_func_start sub_80EED88 +sub_80EED88: @ 80EED88 + push {r4-r7,lr} + ldr r0, =0x00000864 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _080EEE0C + ldr r6, =0x03005d8c + ldr r0, [r6] + ldr r7, =0x00002b50 + adds r0, r7 + bl sub_80EEE30 + ldr r5, =0x030060bc + strb r0, [r5] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080EEE0C + ldr r0, =0x0000028f + bl sub_80EFB38 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EEE0C + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + ands r0, r1 + adds r4, r0, 0x1 + adds r0, r4, 0 + bl sub_80EF0E4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EEE0C + ldr r1, [r6] + movs r0, 0 + ldrsb r0, [r5, r0] + lsls r0, 2 + adds r1, r0 + adds r1, r7 + strb r4, [r1] + ldr r2, [r6] + movs r0, 0 + ldrsb r0, [r5, r0] + lsls r0, 2 + adds r0, r2, r0 + ldr r1, =0x00002b52 + adds r0, r1 + movs r1, 0x4 + strh r1, [r0] + movs r0, 0 + ldrsb r0, [r5, r0] + lsls r0, 2 + adds r2, r0 + ldr r0, =0x00002b51 + adds r2, r0 + movs r0, 0x1 + strb r0, [r2] +_080EEE0C: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EED88 + + thumb_func_start sub_80EEE30 +sub_80EEE30: @ 80EEE30 + push {lr} + adds r2, r0, 0 + movs r1, 0 +_080EEE36: + lsls r0, r1, 24 + asrs r1, r0, 24 + lsls r0, r1, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080EEE48 + adds r0, r1, 0 + b _080EEE58 +_080EEE48: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + asrs r0, 24 + cmp r0, 0xF + ble _080EEE36 + movs r0, 0x1 + negs r0, r0 +_080EEE58: + pop {r1} + bx r1 + thumb_func_end sub_80EEE30 + + thumb_func_start sub_80EEE5C +sub_80EEE5C: @ 80EEE5C + push {r4,lr} + movs r4, 0 +_080EEE60: + adds r0, r4, 0 + bl sub_80EEE78 + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _080EEE60 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80EEE5C + + thumb_func_start sub_80EEE78 +sub_80EEE78: @ 80EEE78 + push {r4,lr} + lsls r0, 24 + ldr r3, =0x03005d8c + ldr r1, [r3] + lsrs r0, 22 + adds r1, r0 + ldr r2, =0x00002b50 + adds r1, r2 + movs r2, 0 + strb r2, [r1] + ldr r1, [r3] + adds r1, r0 + ldr r4, =0x00002b51 + adds r1, r4 + strb r2, [r1] + ldr r1, [r3] + adds r1, r0 + ldr r0, =0x00002b52 + adds r1, r0 + strh r2, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EEE78 + + thumb_func_start sub_80EEEB8 +sub_80EEEB8: @ 80EEEB8 + push {r4-r7,lr} + movs r2, 0 + ldr r6, =0x03005d8c +_080EEEBE: + ldr r0, =0x03005d8c + ldr r0, [r0] + lsls r1, r2, 2 + adds r0, r1 + ldr r3, =0x00002b50 + adds r0, r3 + ldrb r0, [r0] + adds r5, r2, 0x1 + cmp r0, 0 + bne _080EEF12 + lsls r0, r5, 24 + b _080EEF0C + .pool +_080EEEE0: + ldr r3, [r6] + lsls r4, r2, 2 + adds r0, r3, r4 + ldr r7, =0x00002b50 + adds r0, r7 + ldrb r0, [r0] + cmp r0, 0 + beq _080EEF08 + adds r0, r3, r7 + adds r1, r0, r1 + adds r0, r4 + ldr r0, [r0] + str r0, [r1] + adds r0, r2, 0 + bl sub_80EEE78 + b _080EEF12 + .pool +_080EEF08: + adds r0, r2, 0x1 + lsls r0, 24 +_080EEF0C: + lsrs r2, r0, 24 + cmp r2, 0xF + bls _080EEEE0 +_080EEF12: + lsls r0, r5, 24 + lsrs r2, r0, 24 + cmp r2, 0xE + bls _080EEEBE + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80EEEB8 + + thumb_func_start sub_80EEF20 +sub_80EEF20: @ 80EEF20 + push {r4,lr} + movs r2, 0 + ldr r0, =0x03005d8c + ldr r3, [r0] +_080EEF28: + lsls r0, r2, 2 + adds r1, r3, r0 + ldr r4, =0x00002b50 + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _080EEF58 + adds r4, 0x1 + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080EEF58 + adds r4, 0x1 + adds r0, r1, r4 + ldrh r0, [r0] + cmp r0, 0x2 + bhi _080EEF58 + adds r0, r2, 0 + b _080EEF64 + .pool +_080EEF58: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _080EEF28 + movs r0, 0xFF +_080EEF64: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80EEF20 + + thumb_func_start sub_80EEF6C +sub_80EEF6C: @ 80EEF6C + push {r4,r5,lr} + bl sub_80EEF20 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + bne _080EEF84 + ldr r1, =0x020375f0 + movs r0, 0 + b _080EF01A + .pool +_080EEF84: + ldr r5, =0x03005d8c + ldr r0, [r5] + lsls r4, r2, 2 + adds r1, r0, r4 + ldr r0, =0x00002b52 + adds r2, r1, r0 + ldrh r0, [r2] + cmp r0, 0 + bne _080EEFE8 + ldr r2, =0x00002b51 + adds r1, r2 + movs r0, 0x2 + strb r0, [r1] + ldr r0, =0x03005cf8 + ldrb r0, [r0, 0x2] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x13 + bgt _080EEFC8 + ldr r1, =gUnknown_0858D11C + ldr r0, [r5] + adds r0, r4 + subs r2, 0x1 + b _080EEFD0 + .pool +_080EEFC8: + ldr r1, =gUnknown_0858D130 + ldr r0, [r5] + adds r0, r4 + ldr r2, =0x00002b50 +_080EEFD0: + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl box_related_two__2 + b _080EF016 + .pool +_080EEFE8: + ldrh r1, [r2] + ldr r0, =0x02021cc4 + movs r2, 0 + movs r3, 0x1 + bl ConvertIntToDecimalString + ldr r0, [r5] + adds r0, r4 + ldr r1, =0x00002b51 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r1, =gUnknown_0858D108 + ldr r0, [r5] + adds r0, r4 + ldr r2, =0x00002b50 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl box_related_two__2 +_080EF016: + ldr r1, =0x020375f0 + movs r0, 0x1 +_080EF01A: + strh r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EEF6C + + thumb_func_start GetPriceReduction +GetPriceReduction: @ 80EF038 + push {r4,r5,lr} + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0 + bne _080EF048 + b _080EF08A +_080EF044: + movs r0, 0x1 + b _080EF08C +_080EF048: + movs r2, 0 + ldr r4, =0x03005d8c +_080EF04C: + ldr r1, [r4] + lsls r0, r2, 2 + adds r1, r0 + ldr r5, =0x00002b50 + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, r3 + bne _080EF080 + ldr r2, =0x00002b51 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080EF08A + adds r0, r3, 0 + bl IsPriceDiscounted + lsls r0, 24 + cmp r0, 0 + bne _080EF044 + b _080EF08A + .pool +_080EF080: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _080EF04C +_080EF08A: + movs r0, 0 +_080EF08C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end GetPriceReduction + + thumb_func_start IsPriceDiscounted +IsPriceDiscounted: @ 80EF094 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080EF0A6 + cmp r0, 0x3 + beq _080EF0C8 +_080EF0A2: + movs r0, 0x1 + b _080EF0D6 +_080EF0A6: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0x80 + lsls r0, 1 + cmp r1, r0 + bne _080EF0D4 + ldr r0, =0x020375f2 + ldrh r0, [r0] + cmp r0, 0x19 + beq _080EF0A2 + b _080EF0D4 + .pool +_080EF0C8: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + ldr r0, =0x0000150d + cmp r1, r0 + beq _080EF0A2 +_080EF0D4: + movs r0, 0 +_080EF0D6: + pop {r1} + bx r1 + .pool + thumb_func_end IsPriceDiscounted + + thumb_func_start sub_80EF0E4 +sub_80EF0E4: @ 80EF0E4 + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _080EF0F2 +_080EF0EE: + movs r0, 0x1 + b _080EF112 +_080EF0F2: + movs r1, 0 + ldr r0, =0x03005d8c + ldr r3, [r0] + ldr r4, =0x00002b50 +_080EF0FA: + lsls r0, r1, 2 + adds r0, r3, r0 + adds r0, r4 + ldrb r0, [r0] + cmp r0, r2 + beq _080EF0EE + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bls _080EF0FA + movs r0, 0 +_080EF112: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80EF0E4 + + thumb_func_start sub_80EF120 +sub_80EF120: @ 80EF120 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r7, r0, 16 + movs r6, 0 + ldr r0, =0x03005d8c + mov r8, r0 +_080EF130: + mov r1, r8 + ldr r0, [r1] + lsls r1, r6, 2 + adds r2, r0, r1 + ldr r3, =0x00002b50 + adds r0, r2, r3 + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0 + beq _080EF196 + ldr r1, =0x00002b52 + adds r0, r2, r1 + ldrh r0, [r0] + cmp r0, r7 + bcs _080EF164 + adds r0, r6, 0 + bl sub_80EEE78 + b _080EF196 + .pool +_080EF164: + ldr r5, =0x00002b51 + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _080EF186 + ldr r0, =0x00000864 + bl FlagGet + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + bne _080EF186 + mov r2, r8 + ldr r0, [r2] + adds r0, r4 + adds r0, r5 + strb r1, [r0] +_080EF186: + mov r3, r8 + ldr r1, [r3] + adds r1, r4 + ldr r0, =0x00002b52 + adds r1, r0 + ldrh r0, [r1] + subs r0, r7 + strh r0, [r1] +_080EF196: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0xF + bls _080EF130 + bl sub_80EEEB8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EF120 + + thumb_func_start sub_80EF1BC +sub_80EF1BC: @ 80EF1BC + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + adds r2, r1, 0 + cmp r1, 0x1 + beq _080EF1FC + cmp r1, 0x1 + bgt _080EF1D6 + cmp r1, 0 + beq _080EF1E0 + b _080EF244 +_080EF1D6: + cmp r2, 0x2 + beq _080EF218 + cmp r2, 0x3 + beq _080EF234 + b _080EF244 +_080EF1E0: + ldr r1, =gUnknown_0858D144 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, =gUnknown_0858BAF0 + ldr r1, [r1, 0x14] + bl CopyString + b _080EF244 + .pool +_080EF1FC: + ldr r1, =gUnknown_0858D144 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, =gUnknown_0858BAF0 + ldr r1, [r1, 0x18] + bl CopyString + b _080EF244 + .pool +_080EF218: + ldr r1, =gUnknown_0858D144 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, =gUnknown_0858BAF0 + ldr r1, [r1, 0x1C] + bl CopyString + b _080EF244 + .pool +_080EF234: + ldr r1, =gUnknown_0858D144 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, =gUnknown_0858BAF0 + ldr r1, [r1, 0x20] + bl CopyString +_080EF244: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EF1BC + + thumb_func_start CopyContestCategoryToStringVar +@ void CopyContestCategoryToStringVar(u8 stringVarIndex, u8 contestCategoryId) +CopyContestCategoryToStringVar: @ 80EF250 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r1, 24 + lsrs r0, r1, 24 + cmp r0, 0x4 + bhi _080EF300 + lsls r0, 2 + ldr r1, =_080EF26C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080EF26C: + .4byte _080EF280 + .4byte _080EF29C + .4byte _080EF2B8 + .4byte _080EF2D4 + .4byte _080EF2F0 +_080EF280: + ldr r1, =gUnknown_0858D144 + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, =gUnknown_0858BAF0 + ldr r1, [r1] + bl CopyString + b _080EF300 + .pool +_080EF29C: + ldr r1, =gUnknown_0858D144 + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, =gUnknown_0858BAF0 + ldr r1, [r1, 0x4] + bl CopyString + b _080EF300 + .pool +_080EF2B8: + ldr r1, =gUnknown_0858D144 + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, =gUnknown_0858BAF0 + ldr r1, [r1, 0x8] + bl CopyString + b _080EF300 + .pool +_080EF2D4: + ldr r1, =gUnknown_0858D144 + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, =gUnknown_0858BAF0 + ldr r1, [r1, 0xC] + bl CopyString + b _080EF300 + .pool +_080EF2F0: + ldr r1, =gUnknown_0858D144 + lsls r0, r2, 2 + adds r0, r1 + ldr r0, [r0] + ldr r1, =gUnknown_0858BAF0 + ldr r1, [r1, 0x10] + bl CopyString +_080EF300: + pop {r0} + bx r0 + .pool + thumb_func_end CopyContestCategoryToStringVar + + thumb_func_start SetContestCategoryStringVarForInterview +@ void SetContestCategoryStringVarForInterview() +SetContestCategoryStringVarForInterview: @ 80EF30C + push {lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r1, r0 + ldrb r1, [r1, 0x13] + lsls r1, 29 + lsrs r1, 29 + movs r0, 0x1 + bl CopyContestCategoryToStringVar + pop {r0} + bx r0 + .pool + thumb_func_end SetContestCategoryStringVarForInterview + + thumb_func_start sub_80EF340 +sub_80EF340: @ 80EF340 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + bl sub_80EF370 + adds r3, r0, 0 + ldr r0, =gUnknown_0858D144 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + lsls r3, 24 + lsrs r3, 24 + adds r1, r5, 0 + movs r2, 0 + bl ConvertIntToDecimalString + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EF340 + + thumb_func_start sub_80EF370 +sub_80EF370: @ 80EF370 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0xA + bl __divsi3 + cmp r0, 0 + beq _080EF3FC + adds r0, r4, 0 + movs r1, 0x64 + bl __divsi3 + cmp r0, 0 + bne _080EF38E + movs r0, 0x2 + b _080EF406 +_080EF38E: + movs r1, 0xFA + lsls r1, 2 + adds r0, r4, 0 + bl __divsi3 + cmp r0, 0 + bne _080EF3A0 + movs r0, 0x3 + b _080EF406 +_080EF3A0: + ldr r1, =0x00002710 + adds r0, r4, 0 + bl __divsi3 + cmp r0, 0 + bne _080EF3B4 + movs r0, 0x4 + b _080EF406 + .pool +_080EF3B4: + ldr r1, =0x000186a0 + adds r0, r4, 0 + bl __divsi3 + cmp r0, 0 + bne _080EF3C8 + movs r0, 0x5 + b _080EF406 + .pool +_080EF3C8: + ldr r1, =0x000f4240 + adds r0, r4, 0 + bl __divsi3 + cmp r0, 0 + bne _080EF3DC + movs r0, 0x6 + b _080EF406 + .pool +_080EF3DC: + ldr r1, =0x00989680 + adds r0, r4, 0 + bl __divsi3 + cmp r0, 0 + bne _080EF3F0 + movs r0, 0x7 + b _080EF406 + .pool +_080EF3F0: + ldr r1, =0x05f5e100 + adds r0, r4, 0 + bl __divsi3 + cmp r0, 0 + beq _080EF404 +_080EF3FC: + movs r0, 0x1 + b _080EF406 + .pool +_080EF404: + movs r0, 0x8 +_080EF406: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80EF370 + + thumb_func_start sub_80EF40C +sub_80EF40C: @ 80EF40C + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r1, 0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r7, 0 + movs r5, 0 +_080EF41E: + lsls r4, r5, 1 + adds r0, r6, 0x6 + adds r1, r0, r4 + ldrh r0, [r1] + cmp r0, 0 + beq _080EF43E + bl itemid_get_market_price + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + adds r1, 0xC + adds r1, r4 + ldrh r1, [r1] + muls r0, r1 + adds r7, r0 +_080EF43E: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _080EF41E + ldrb r0, [r6, 0x2] + cmp r0, 0x1 + bne _080EF458 + asrs r1, r7, 1 + mov r0, r8 + bl sub_80EF340 + b _080EF460 +_080EF458: + mov r0, r8 + adds r1, r7, 0 + bl sub_80EF340 +_080EF460: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80EF40C + + thumb_func_start sub_80EF46C +sub_80EF46C: @ 80EF46C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + ldr r5, =0x03005d8c + ldr r0, [r5] + ldr r4, =0x000027cc + adds r0, r4 + mov r8, r0 + bl sub_80F0020 + adds r7, r0, 0 + movs r6, 0x5 +_080EF494: + lsls r0, r6, 3 + adds r0, r6 + lsls r0, 2 + mov r2, r8 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, r10 + bne _080EF4E4 + movs r3, 0xFF + adds r0, r7, 0 + ands r0, r3 + adds r2, r1, 0 + adds r2, 0x22 + ldrb r2, [r2] + cmp r0, r2 + bne _080EF4E4 + lsrs r0, r7, 8 + ands r0, r3 + adds r1, 0x23 + ldrb r1, [r1] + cmp r0, r1 + bne _080EF4E4 + mov r0, r9 + cmp r0, 0x1 + bne _080EF4D8 + ldr r0, [r5] + adds r0, r4 + adds r1, r6, 0 + bl sub_80EF910 + ldr r0, [r5] + adds r0, r4 + bl sub_80EF93C +_080EF4D8: + movs r0, 0x1 + b _080EF4F0 + .pool +_080EF4E4: + adds r0, r6, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x17 + bls _080EF494 + movs r0, 0 +_080EF4F0: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80EF46C + + thumb_func_start sub_80EF500 +sub_80EF500: @ 80EF500 + push {r4-r7,lr} + movs r2, 0 +_080EF504: + adds r1, r2, 0x1 + lsls r0, r1, 24 + lsrs r5, r0, 24 + adds r7, r1, 0 + cmp r5, 0x2 + bhi _080EF53C + ldr r6, =0x02039f80 + lsls r0, r2, 2 + adds r4, r0, r6 +_080EF516: + lsls r0, r5, 2 + adds r3, r0, r6 + ldrh r0, [r4, 0x2] + ldrh r1, [r3, 0x2] + cmp r0, r1 + bcs _080EF532 + ldrh r1, [r4] + adds r2, r0, 0 + ldrh r0, [r3] + strh r0, [r4] + ldrh r0, [r3, 0x2] + strh r0, [r4, 0x2] + strh r1, [r3] + strh r2, [r3, 0x2] +_080EF532: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x2 + bls _080EF516 +_080EF53C: + lsls r0, r7, 24 + lsrs r2, r0, 24 + cmp r2, 0x1 + bls _080EF504 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EF500 + + thumb_func_start sub_80EF550 +sub_80EF550: @ 80EF550 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r1, 0 + ldr r5, =0x03005d8c + ldr r4, =0x000027cc +_080EF55C: + ldr r3, [r5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r2, r3, r0 + adds r0, r2, r4 + ldrb r0, [r0] + cmp r0, r6 + bne _080EF5A4 + ldr r6, =0x000027cd + adds r0, r2, r6 + ldrb r2, [r0] + cmp r2, 0x1 + bne _080EF590 + ldr r0, =0x020375f0 + strh r2, [r0] + b _080EF5B2 + .pool +_080EF590: + adds r0, r3, r4 + bl sub_80EF910 + ldr r0, [r5] + adds r0, r4 + bl sub_80EF93C + bl sub_80EFA88 + b _080EF5B2 +_080EF5A4: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x4 + bls _080EF55C + bl sub_80EFA88 +_080EF5B2: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80EF550 + + thumb_func_start InterviewBefore +InterviewBefore: @ 80EF5B8 + push {lr} + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x020375e2 + ldrh r0, [r0] + subs r0, 0x1 + cmp r0, 0xA + bhi _080EF646 + lsls r0, 2 + ldr r1, =_080EF5E0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080EF5E0: + .4byte _080EF60C + .4byte _080EF612 + .4byte _080EF618 + .4byte _080EF61E + .4byte _080EF624 + .4byte _080EF62A + .4byte _080EF630 + .4byte _080EF636 + .4byte _080EF63C + .4byte _080EF646 + .4byte _080EF642 +_080EF60C: + bl sub_80EF64C + b _080EF646 +_080EF612: + bl sub_80EF6C4 + b _080EF646 +_080EF618: + bl sub_80EF704 + b _080EF646 +_080EF61E: + bl sub_80EF79C + b _080EF646 +_080EF624: + bl sub_80EF7A8 + b _080EF646 +_080EF62A: + bl sub_80EF7B4 + b _080EF646 +_080EF630: + bl sub_80EF80C + b _080EF646 +_080EF636: + bl sub_80EF7F4 + b _080EF646 +_080EF63C: + bl sub_80EF800 + b _080EF646 +_080EF642: + bl sub_80EF84C +_080EF646: + pop {r0} + bx r0 + thumb_func_end InterviewBefore + + thumb_func_start sub_80EF64C +sub_80EF64C: @ 80EF64C + push {r4,lr} + movs r0, 0x1 + bl sub_80EF550 + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0 + bne _080EF6A0 + ldr r4, =0x02021cc4 + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + movs r1, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r4, 0 + bl CopyString + ldr r2, =0x03005d8c + ldr r0, =0x030060bc + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r0, r1 + ldr r1, =0x000027d0 + adds r0, r1 + movs r1, 0x6 + bl sub_811F88C +_080EF6A0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EF64C + + thumb_func_start sub_80EF6C4 +sub_80EF6C4: @ 80EF6C4 + push {lr} + movs r0, 0x2 + bl sub_80EF550 + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0 + bne _080EF6F0 + ldr r2, =0x03005d8c + ldr r0, =0x030060bc + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r0, r1 + ldr r1, =0x000027d0 + adds r0, r1 + movs r1, 0x6 + bl sub_811F88C +_080EF6F0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EF6C4 + + thumb_func_start sub_80EF704 +sub_80EF704: @ 80EF704 + push {r4-r6,lr} + movs r0, 0x3 + bl sub_80EF550 + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0 + bne _080EF774 + ldr r6, =0x02021cc4 + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + movs r5, 0x64 + muls r0, r5 + ldr r4, =0x020244ec + adds r0, r4 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + movs r1, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r6, 0 + bl CopyString + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + muls r0, r5 + adds r0, r4 + ldr r4, =0x02021dc4 + movs r1, 0x2 + adds r2, r4, 0 + bl pokemon_getattr + adds r0, r4, 0 + bl GetStringEnd_Limit7 + ldr r2, =0x03005d8c + ldr r0, =0x030060bc + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r0, r1 + ldr r1, =0x000027e8 + adds r0, r1 + movs r1, 0x2 + bl sub_811F88C +_080EF774: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EF704 + + thumb_func_start sub_80EF79C +sub_80EF79C: @ 80EF79C + ldr r1, =0x020375f0 + movs r0, 0x1 + strh r0, [r1] + bx lr + .pool + thumb_func_end sub_80EF79C + + thumb_func_start sub_80EF7A8 +sub_80EF7A8: @ 80EF7A8 + push {lr} + movs r0, 0x5 + bl sub_80EF550 + pop {r0} + bx r0 + thumb_func_end sub_80EF7A8 + + thumb_func_start sub_80EF7B4 +sub_80EF7B4: @ 80EF7B4 + push {lr} + movs r0, 0x6 + bl sub_80EF550 + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0 + bne _080EF7E0 + ldr r2, =0x03005d8c + ldr r0, =0x030060bc + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r0, r1 + ldr r1, =0x000027d0 + adds r0, r1 + movs r1, 0x2 + bl sub_811F88C +_080EF7E0: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EF7B4 + + thumb_func_start sub_80EF7F4 +sub_80EF7F4: @ 80EF7F4 + push {lr} + movs r0, 0x8 + bl sub_80EF550 + pop {r0} + bx r0 + thumb_func_end sub_80EF7F4 + + thumb_func_start sub_80EF800 +sub_80EF800: @ 80EF800 + push {lr} + movs r0, 0x9 + bl sub_80EF550 + pop {r0} + bx r0 + thumb_func_end sub_80EF800 + + thumb_func_start sub_80EF80C +sub_80EF80C: @ 80EF80C + push {lr} + movs r0, 0x7 + bl sub_80EF550 + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0 + bne _080EF838 + ldr r2, =0x03005d8c + ldr r0, =0x030060bc + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r0, r1 + ldr r1, =0x000027e4 + adds r0, r1 + movs r1, 0x1 + bl sub_811F88C +_080EF838: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EF80C + + thumb_func_start sub_80EF84C +sub_80EF84C: @ 80EF84C + push {lr} + movs r0, 0xB + bl sub_80EF550 + ldr r0, =0x020375f0 + ldrh r0, [r0] + cmp r0, 0 + bne _080EF878 + ldr r2, =0x03005d8c + ldr r0, =0x030060bc + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r0, r1 + ldr r1, =0x000027e0 + adds r0, r1 + movs r1, 0x1 + bl sub_811F88C +_080EF878: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EF84C + + thumb_func_start sub_80EF88C +sub_80EF88C: @ 80EF88C + push {r4-r6,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x64 + muls r1, r0 + ldr r0, =0x020244ec + adds r5, r1, r0 + ldr r6, =0x02021cc4 + adds r0, r5, 0 + movs r1, 0x2 + adds r2, r6, 0 + bl pokemon_getattr + mov r4, sp + adds r0, r5, 0 + movs r1, 0x3 + mov r2, sp + bl pokemon_getattr + strb r0, [r4] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _080EF8EC + adds r0, r5, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + movs r1, 0xB + muls r0, r1 + ldr r1, =gSpeciesNames + adds r0, r1 + adds r1, r6, 0 + bl CompareString + cmp r0, 0 + bne _080EF8EC + movs r0, 0 + b _080EF8EE + .pool +_080EF8EC: + movs r0, 0x1 +_080EF8EE: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80EF88C + + thumb_func_start sub_80EF8F8 +sub_80EF8F8: @ 80EF8F8 + push {lr} + bl sub_8139688 + lsls r0, 24 + lsrs r0, 24 + bl sub_80EF88C + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80EF8F8 + + thumb_func_start sub_80EF910 +sub_80EF910: @ 80EF910 + push {lr} + lsls r1, 24 + lsrs r1, 24 + lsls r2, r1, 3 + adds r2, r1 + lsls r2, 2 + adds r2, r0 + movs r0, 0 + strb r0, [r2] + strb r0, [r2, 0x1] + movs r1, 0 + adds r2, 0x2 + movs r3, 0 +_080EF92A: + adds r0, r2, r1 + strb r3, [r0] + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x21 + bls _080EF92A + pop {r0} + bx r0 + thumb_func_end sub_80EF910 + + thumb_func_start sub_80EF93C +sub_80EF93C: @ 80EF93C + push {r4-r7,lr} + adds r4, r0, 0 + movs r5, 0 +_080EF942: + lsls r0, r5, 3 + adds r0, r5 + lsls r1, r0, 2 + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _080EF986 + adds r0, r5, 0x1 + b _080EF97E +_080EF954: + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r3, r0, r4 + ldrb r0, [r3] + cmp r0, 0 + beq _080EF97C + adds r1, r4 + adds r0, r3, 0 + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_80EF910 + b _080EF986 +_080EF97C: + adds r0, r2, 0x1 +_080EF97E: + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x4 + bls _080EF954 +_080EF986: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3 + bls _080EF942 + movs r5, 0x5 +_080EF992: + lsls r0, r5, 3 + adds r0, r5 + lsls r1, r0, 2 + adds r0, r1, r4 + ldrb r0, [r0] + adds r5, 0x1 + cmp r0, 0 + bne _080EF9D8 + lsls r0, r5, 24 + b _080EF9D2 +_080EF9A6: + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r3, r0, r4 + ldrb r0, [r3] + cmp r0, 0 + beq _080EF9CE + adds r1, r4 + adds r0, r3, 0 + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_80EF910 + b _080EF9D8 +_080EF9CE: + adds r0, r2, 0x1 + lsls r0, 24 +_080EF9D2: + lsrs r2, r0, 24 + cmp r2, 0x17 + bls _080EF9A6 +_080EF9D8: + lsls r0, r5, 24 + lsrs r5, r0, 24 + cmp r5, 0x17 + bls _080EF992 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80EF93C + + thumb_func_start sub_80EF9E8 +sub_80EF9E8: @ 80EF9E8 + push {r4,r5,lr} + adds r4, r0, 0 + adds r0, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r0, 16 + lsrs r0, 16 + bl sub_80EFA24 + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + ldr r0, =gUnknown_0858D144 + lsls r4, 2 + adds r4, r0 + ldr r0, [r4] + movs r1, 0xB + muls r1, r5 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80EF9E8 + + thumb_func_start sub_80EFA24 +sub_80EFA24: @ 80EFA24 + push {r4-r6,lr} + lsls r0, 16 + lsrs r5, r0, 16 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x0000019b + bl __umodsi3 + adds r0, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + adds r6, r4, 0 + b _080EFA62 + .pool +_080EFA48: + cmp r4, 0x1 + bne _080EFA54 + ldr r4, =0x0000019b + b _080EFA5A + .pool +_080EFA54: + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_080EFA5A: + cmp r4, r6 + bne _080EFA62 + adds r4, r5, 0 + b _080EFA7E +_080EFA62: + adds r0, r4, 0 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl pokedex_flag_operation + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + bne _080EFA48 + cmp r4, r5 + beq _080EFA48 +_080EFA7E: + adds r0, r4, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80EFA24 + + thumb_func_start sub_80EFA88 +sub_80EFA88: @ 80EFA88 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000027cc + adds r0, r1 + bl sub_80EFADC + ldr r1, =0x030060bc + strb r0, [r1] + ldr r2, =0x020375e4 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + strh r1, [r2] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _080EFACC + ldr r1, =0x020375f0 + movs r0, 0x1 + b _080EFAD0 + .pool +_080EFACC: + ldr r1, =0x020375f0 + movs r0, 0 +_080EFAD0: + strh r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EFA88 + + thumb_func_start sub_80EFADC +sub_80EFADC: @ 80EFADC + push {lr} + adds r2, r0, 0 + movs r1, 0 +_080EFAE2: + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080EFAF6 + lsls r0, r1, 24 + asrs r0, 24 + b _080EFB04 +_080EFAF6: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x4 + bls _080EFAE2 + movs r0, 0x1 + negs r0, r0 +_080EFB04: + pop {r1} + bx r1 + thumb_func_end sub_80EFADC + + thumb_func_start sub_80EFB08 +sub_80EFB08: @ 80EFB08 + push {lr} + adds r2, r0, 0 + movs r1, 0x5 +_080EFB0E: + lsls r0, r1, 24 + asrs r1, r0, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080EFB24 + adds r0, r1, 0 + b _080EFB34 +_080EFB24: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + asrs r0, 24 + cmp r0, 0x17 + ble _080EFB0E + movs r0, 0x1 + negs r0, r0 +_080EFB34: + pop {r1} + bx r1 + thumb_func_end sub_80EFB08 + + thumb_func_start sub_80EFB38 +sub_80EFB38: @ 80EFB38 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + cmp r0, r4 + bls _080EFB50 + movs r0, 0x1 + b _080EFB52 +_080EFB50: + movs r0, 0 +_080EFB52: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80EFB38 + + thumb_func_start sub_80EFB58 +sub_80EFB58: @ 80EFB58 + push {r4-r6,lr} + adds r4, r0, 0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 24 + lsrs r2, r0, 24 + adds r5, r4, 0x4 + ldr r6, =0x0000ffff + b _080EFB7E + .pool +_080EFB78: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_080EFB7E: + cmp r2, 0x6 + bne _080EFB84 + movs r2, 0 +_080EFB84: + lsls r1, r2, 1 + adds r0, r5, r1 + ldrh r0, [r0] + adds r3, r4, 0x4 + cmp r0, r6 + beq _080EFB78 + ldr r0, =0x02021ec4 + adds r1, r3, r1 + ldrh r1, [r1] + bl CopyEasyChatWord + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EFB58 + + thumb_func_start sub_80EFBA4 +sub_80EFBA4: @ 80EFBA4 + push {lr} + adds r2, r0, 0 + movs r3, 0 + movs r1, 0 + ldrb r0, [r2, 0x4] + cmp r0, 0xFF + beq _080EFBD0 + adds r2, 0x4 +_080EFBB4: + adds r0, r2, r1 + ldrb r0, [r0] + adds r0, r3, r0 + lsls r0, 16 + lsrs r3, r0, 16 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xA + bhi _080EFBD0 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080EFBB4 +_080EFBD0: + movs r0, 0x7 + ands r3, r0 + adds r0, r3, 0 + pop {r1} + bx r1 + thumb_func_end sub_80EFBA4 + + thumb_func_start sub_80EFBDC +sub_80EFBDC: @ 80EFBDC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + ldr r4, [sp, 0x2C] + ldr r5, [sp, 0x30] + mov r8, r5 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + lsls r3, 16 + lsrs r3, 16 + lsls r4, 16 + lsrs r4, 16 + movs r2, 0 + movs r7, 0xFF +_080EFC06: + mov r1, sp + adds r0, r1, r2 + ldrb r1, [r0] + orrs r1, r7 + strb r1, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x2 + bls _080EFC06 + cmp r3, 0 + bne _080EFC72 + mov r4, r8 + adds r4, 0xF + adds r0, r4, 0 + bl GetStringLength + lsls r0, 16 + lsrs r2, r0, 16 + cmp r6, 0 + bne _080EFC36 + mov r0, sp + adds r1, r4, r5 + b _080EFC40 +_080EFC36: + cmp r6, 0x1 + bne _080EFC46 + mov r0, sp + subs r1, r2, r5 + adds r1, r4, r1 +_080EFC40: + ldrb r1, [r1] + strb r1, [r0] + b _080EFC6C +_080EFC46: + cmp r6, 0x2 + bne _080EFC56 + mov r1, sp + adds r0, r4, r5 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r5, 0x1 + b _080EFC66 +_080EFC56: + mov r1, sp + subs r0, r2, 0x2 + subs r0, r5 + adds r0, r4, r0 + ldrb r0, [r0] + strb r0, [r1] + subs r0, r2, 0x1 + subs r0, r5 +_080EFC66: + adds r0, r4, r0 + ldrb r0, [r0] + strb r0, [r1, 0x1] +_080EFC6C: + mov r2, r8 + ldrb r1, [r2, 0x1E] + b _080EFCC8 +_080EFC72: + cmp r3, 0x1 + bne _080EFCD0 + mov r4, r8 + adds r4, 0x4 + adds r0, r4, 0 + bl GetStringLength + lsls r0, 16 + lsrs r2, r0, 16 + cmp r6, 0 + bne _080EFC8E + mov r0, sp + adds r1, r4, r5 + b _080EFC98 +_080EFC8E: + cmp r6, 0x1 + bne _080EFC9E + mov r0, sp + subs r1, r2, r5 + adds r1, r4, r1 +_080EFC98: + ldrb r1, [r1] + strb r1, [r0] + b _080EFCC4 +_080EFC9E: + cmp r6, 0x2 + bne _080EFCAE + mov r1, sp + adds r0, r4, r5 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r5, 0x1 + b _080EFCBE +_080EFCAE: + mov r1, sp + subs r0, r2, 0x2 + subs r0, r5 + adds r0, r4, r0 + ldrb r0, [r0] + strb r0, [r1] + subs r0, r2, 0x1 + subs r0, r5 +_080EFCBE: + adds r0, r4, r0 + ldrb r0, [r0] + strb r0, [r1, 0x1] +_080EFCC4: + mov r5, r8 + ldrb r1, [r5, 0x1F] +_080EFCC8: + mov r0, sp + bl StopMusicWhileStringIsPrinted + b _080EFD30 +_080EFCD0: + movs r0, 0xB + muls r4, r0 + ldr r7, =gSpeciesNames + adds r0, r4, r7 + bl GetStringLength + lsls r0, 16 + lsrs r2, r0, 16 + cmp r6, 0 + bne _080EFCF0 + mov r0, sp + adds r1, r5, r4 + b _080EFCFA + .pool +_080EFCF0: + cmp r6, 0x1 + bne _080EFD02 + mov r0, sp + subs r1, r2, r5 + adds r1, r4 +_080EFCFA: + adds r1, r7 + ldrb r1, [r1] + strb r1, [r0] + b _080EFD30 +_080EFD02: + cmp r6, 0x2 + bne _080EFD16 + mov r1, sp + adds r0, r5, r4 + adds r0, r7 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r4, 0x1 + adds r0, r5, r0 + b _080EFD2A +_080EFD16: + mov r1, sp + subs r0, r2, 0x2 + subs r0, r5 + adds r0, r4 + adds r0, r7 + ldrb r0, [r0] + strb r0, [r1] + subs r0, r2, 0x1 + subs r0, r5 + adds r0, r4 +_080EFD2A: + adds r0, r7 + ldrb r0, [r0] + strb r0, [r1, 0x1] +_080EFD30: + ldr r0, =gUnknown_0858D144 + mov r2, r9 + lsls r1, r2, 2 + adds r1, r0 + ldr r0, [r1] + mov r1, sp + bl CopyString + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EFBDC + + thumb_func_start sub_80EFD54 +sub_80EFD54: @ 80EFD54 + push {r4,lr} + movs r1, 0 + ldr r0, =0x03005d8c + ldr r3, [r0] + ldr r0, =0x020375e0 + ldrh r2, [r0] + ldr r4, =0x000027cc +_080EFD62: + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r3, r0 + adds r0, r4 + ldrb r0, [r0] + cmp r0, r2 + bne _080EFD84 + movs r0, 0x1 + b _080EFD90 + .pool +_080EFD84: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x4 + bls _080EFD62 + movs r0, 0 +_080EFD90: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80EFD54 + + thumb_func_start sub_80EFD98 +sub_80EFD98: @ 80EFD98 + push {r4,lr} + ldr r0, =0x020375e0 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r4, =0x02021cc4 + movs r1, 0x2 + adds r2, r4, 0 + bl pokemon_getattr + ldr r0, =0x02021ec4 + adds r1, r4, 0 + bl CompareString + cmp r0, 0 + beq _080EFDD4 + bl sub_80ED320 + movs r0, 0x1 + b _080EFDD6 + .pool +_080EFDD4: + movs r0, 0 +_080EFDD6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80EFD98 + + thumb_func_start sub_80EFDDC +sub_80EFDDC: @ 80EFDDC + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x8 + ldr r0, =0x020375e0 + mov r9, r0 + ldrh r0, [r0] + movs r1, 0x64 + mov r8, r1 + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r6, =0x020244ec + adds r0, r6 + ldr r2, =0x02021ec4 + movs r1, 0x2 + bl pokemon_getattr + mov r1, r9 + ldrh r0, [r1] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r6 + ldr r1, =0x02021dc4 + mov r10, r1 + movs r1, 0x2 + mov r2, r10 + bl pokemon_getattr + mov r1, r9 + ldrh r0, [r1] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r6 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + mov r1, r9 + ldrh r0, [r1] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r6 + bl pokemon_get_gender + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r1, r9 + ldrh r0, [r1] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + adds r0, r6 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr + str r0, [sp] + ldr r0, =c2_080CC144 + str r0, [sp, 0x4] + movs r0, 0x3 + mov r1, r10 + adds r2, r5, 0 + adds r3, r4, 0 + bl do_choose_name_or_words_screen + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EFDDC + + thumb_func_start c2_080CC144 +c2_080CC144: @ 80EFE98 + push {lr} + ldr r0, =0x020375e0 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r2, =0x02021dc4 + movs r1, 0x2 + bl pokemon_setattr + bl c2_exit_to_overworld_1_continue_scripts_restart_music + pop {r0} + bx r0 + .pool + thumb_func_end c2_080CC144 + + thumb_func_start sub_80EFEC4 +sub_80EFEC4: @ 80EFEC4 + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x8 + ldr r0, =0x020375f6 + ldrb r0, [r0] + ldr r1, =0x020375f8 + ldrb r1, [r1] + bl get_pokemon_by_box_and_pos + adds r6, r0, 0 + ldr r2, =0x02021ec4 + movs r1, 0x2 + bl pokemon_getattr_encrypted + ldr r0, =0x02021dc4 + mov r8, r0 + adds r0, r6, 0 + movs r1, 0x2 + mov r2, r8 + bl pokemon_getattr_encrypted + adds r0, r6, 0 + movs r1, 0xB + movs r2, 0 + bl pokemon_getattr_encrypted + adds r5, r0, 0 + lsls r5, 16 + lsrs r5, 16 + adds r0, r6, 0 + bl pokemon_roll_gender + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + movs r1, 0 + movs r2, 0 + bl pokemon_getattr_encrypted + str r0, [sp] + ldr r0, =sub_80EFF48 + str r0, [sp, 0x4] + movs r0, 0x3 + mov r1, r8 + adds r2, r5, 0 + adds r3, r4, 0 + bl do_choose_name_or_words_screen + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EFEC4 + + thumb_func_start sub_80EFF48 +sub_80EFF48: @ 80EFF48 + push {lr} + ldr r0, =0x020375f6 + ldrb r0, [r0] + ldr r1, =0x020375f8 + ldrb r1, [r1] + ldr r2, =0x02021dc4 + bl sub_80D1E90 + bl c2_exit_to_overworld_1_continue_scripts_restart_music + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EFF48 + + thumb_func_start sub_80EFF6C +sub_80EFF6C: @ 80EFF6C + push {r4,lr} + ldr r0, =0x020375e0 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + ldr r4, =0x02021cc4 + movs r1, 0x2 + adds r2, r4, 0 + bl pokemon_getattr + adds r0, r4, 0 + bl GetStringEnd_Limit7 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EFF6C + + thumb_func_start sub_80EFF9C +sub_80EFF9C: @ 80EFF9C + push {r4,lr} + bl sub_80F0020 + adds r4, r0, 0 + ldr r0, =0x020375e0 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =0x020244ec + adds r0, r1 + movs r1, 0x1 + movs r2, 0 + bl pokemon_getattr + cmp r4, r0 + bne _080EFFD0 + ldr r1, =0x020375f0 + movs r0, 0 + b _080EFFD4 + .pool +_080EFFD0: + ldr r1, =0x020375f0 + movs r0, 0x1 +_080EFFD4: + strh r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80EFF9C + + thumb_func_start sub_80EFFE0 +sub_80EFFE0: @ 80EFFE0 + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + adds r2, r1, 0 + cmp r1, 0 + beq _080F0016 + subs r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bhi _080EFFFA + movs r0, 0x2 + b _080F001C +_080EFFFA: + adds r0, r1, 0 + subs r0, 0x15 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bhi _080F000A + movs r0, 0x3 + b _080F001C +_080F000A: + adds r0, r2, 0 + subs r0, 0x29 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bls _080F001A +_080F0016: + movs r0, 0 + b _080F001C +_080F001A: + movs r0, 0x4 +_080F001C: + pop {r1} + bx r1 + thumb_func_end sub_80EFFE0 + + thumb_func_start sub_80F0020 +sub_80F0020: @ 80F0020 + ldr r0, =0x03005d90 + ldr r2, [r0] + ldrb r0, [r2, 0xD] + lsls r0, 24 + ldrb r1, [r2, 0xC] + lsls r1, 16 + orrs r0, r1 + ldrb r1, [r2, 0xB] + lsls r1, 8 + orrs r0, r1 + ldrb r1, [r2, 0xA] + orrs r0, r1 + bx lr + .pool + thumb_func_end sub_80F0020 + + thumb_func_start CheckForBigMovieOrEmergencyNewsOnTV +CheckForBigMovieOrEmergencyNewsOnTV: @ 80F0040 + push {lr} + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r0, 0x4 + ldrsb r0, [r1, r0] + cmp r0, 0x1 + bne _080F0060 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _080F006C + movs r0, 0x5 + ldrsb r0, [r1, r0] + cmp r0, 0 + beq _080F0074 +_080F0060: + movs r0, 0 + b _080F009E + .pool +_080F006C: + movs r0, 0x5 + ldrsb r0, [r1, r0] + cmp r0, 0x2 + bne _080F0060 +_080F0074: + ldr r0, =0x000008bd + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080F0092 + movs r0, 0x89 + lsls r0, 4 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080F009C +_080F0092: + movs r0, 0x1 + b _080F009E + .pool +_080F009C: + movs r0, 0x2 +_080F009E: + pop {r1} + bx r1 + thumb_func_end CheckForBigMovieOrEmergencyNewsOnTV + + thumb_func_start GetMomOrDadStringForTVMessage +GetMomOrDadStringForTVMessage: @ 80F00A4 + push {r4,lr} + ldr r0, =0x03005d8c + ldr r1, [r0] + movs r0, 0x4 + ldrsb r0, [r1, r0] + cmp r0, 0x1 + bne _080F0104 + ldr r0, =0x03005d90 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _080F00EC + movs r0, 0x5 + ldrsb r0, [r1, r0] + cmp r0, 0 + bne _080F0104 + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EAD08 + bl CopyString + ldr r0, =0x00004003 + movs r1, 0x1 + bl VarSet + b _080F0104 + .pool +_080F00EC: + movs r0, 0x5 + ldrsb r0, [r1, r0] + cmp r0, 0x2 + bne _080F0104 + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EAD08 + bl CopyString + ldr r0, =0x00004003 + movs r1, 0x1 + bl VarSet +_080F0104: + ldr r4, =0x00004003 + adds r0, r4, 0 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + beq _080F0142 + adds r0, r4, 0 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + beq _080F0158 + adds r0, r4, 0 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bls _080F016C + adds r0, r4, 0 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080F0158 +_080F0142: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EAD08 + bl CopyString + b _080F01A8 + .pool +_080F0158: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EAD04 + bl CopyString + b _080F01A8 + .pool +_080F016C: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080F0198 + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EAD08 + bl CopyString + adds r0, r4, 0 + movs r1, 0x1 + bl VarSet + b _080F01A8 + .pool +_080F0198: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EAD04 + bl CopyString + adds r0, r4, 0 + movs r1, 0x2 + bl VarSet +_080F01A8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end GetMomOrDadStringForTVMessage + + thumb_func_start sub_80F01B8 +sub_80F01B8: @ 80F01B8 + push {lr} + ldr r0, =0x000040bc + movs r1, 0 + bl VarSet + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrb r1, [r0, 0x5] + ldrb r2, [r0, 0x4] + movs r0, 0x5 + bl RemoveFieldObjectByLocalIdAndMap + ldr r0, =0x00000396 + bl FlagSet + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F01B8 + + thumb_func_start sub_80F01E8 +sub_80F01E8: @ 80F01E8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r6, r2, 24 + movs r0, 0xE1 + lsls r0, 4 + bl Alloc + mov r8, r0 + cmp r0, 0 + bne _080F0206 + b _080F0344 +_080F0206: + movs r4, 0 +_080F0208: + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 5 + adds r0, r4 + lsls r0, 2 + add r0, r8 + adds r1, r4, 0 + muls r1, r5 + adds r1, r7, r1 + movs r2, 0xE1 + lsls r2, 2 + bl memcpy + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _080F0208 + mov r5, r8 + movs r4, 0 + ldr r7, =0x020229e8 + b _080F0276 + .pool +_080F0238: + lsls r0, r4, 3 + subs r2, r0, r4 + lsls r0, r2, 2 + adds r3, r0, r7 + ldrb r1, [r3] + subs r0, r1, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _080F025A + lsls r0, r2, 5 + adds r0, r4 + lsls r0, 2 + adds r0, r5, r0 + bl sub_80F1254 + b _080F0270 +_080F025A: + cmp r1, 0x3 + bne _080F0270 + ldrh r0, [r3, 0x1A] + cmp r0, 0x1 + bne _080F0270 + lsls r0, r2, 5 + adds r0, r4 + lsls r0, 2 + adds r0, r5, r0 + bl sub_80F12A4 +_080F0270: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_080F0276: + bl sub_8009FCC + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bcc _080F0238 + cmp r6, 0x1 + beq _080F02C4 + cmp r6, 0x1 + bgt _080F0290 + cmp r6, 0 + beq _080F029A + b _080F031E +_080F0290: + cmp r6, 0x2 + beq _080F02DC + cmp r6, 0x3 + beq _080F0304 + b _080F031E +_080F029A: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000027cc + adds r0, r1 + movs r2, 0xE1 + lsls r2, 2 + adds r1, r5, r2 + movs r3, 0xE1 + lsls r3, 3 + adds r2, r5, r3 + ldr r4, =0x00000a8c + adds r3, r5, r4 + bl sub_80F0358 + b _080F031E + .pool +_080F02C4: + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x000027cc + adds r1, r0 + movs r3, 0xE1 + lsls r3, 3 + adds r2, r5, r3 + b _080F02EA + .pool +_080F02DC: + movs r0, 0xE1 + lsls r0, 2 + adds r1, r5, r0 + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r3, =0x000027cc + adds r2, r3 +_080F02EA: + ldr r4, =0x00000a8c + adds r3, r5, r4 + adds r0, r5, 0 + bl sub_80F0358 + b _080F031E + .pool +_080F0304: + movs r0, 0xE1 + lsls r0, 2 + adds r1, r5, r0 + movs r3, 0xE1 + lsls r3, 3 + adds r2, r5, r3 + ldr r0, =0x03005d8c + ldr r3, [r0] + ldr r4, =0x000027cc + adds r3, r4 + adds r0, r5, 0 + bl sub_80F0358 +_080F031E: + ldr r5, =0x03005d8c + ldr r0, [r5] + ldr r4, =0x000027cc + adds r0, r4 + bl sub_80EF93C + bl sub_80F0C04 + ldr r0, [r5] + adds r0, r4 + bl sub_80EF93C + bl sub_80F0708 + bl sub_80F0B64 + mov r0, r8 + bl Free +_080F0344: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F01E8 + + thumb_func_start sub_80F0358 +sub_80F0358: @ 80F0358 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + str r0, [sp, 0x10] + str r1, [sp, 0x14] + str r2, [sp, 0x18] + str r3, [sp, 0x1C] + add r0, sp, 0x10 + str r0, [sp] + add r0, sp, 0x14 + str r0, [sp, 0x4] + add r0, sp, 0x18 + str r0, [sp, 0x8] + add r0, sp, 0x1C + str r0, [sp, 0xC] + bl sub_8009FCC + ldr r1, =0x03001174 + strb r0, [r1] +_080F0384: + movs r6, 0 + ldr r0, =0x03001174 + ldrb r1, [r0] + cmp r6, r1 + bcs _080F0384 + mov r10, r0 +_080F0390: + cmp r6, 0 + bne _080F0398 + ldr r2, =0x0203a02c + strb r6, [r2] +_080F0398: + lsls r4, r6, 2 + mov r3, sp + adds r0, r3, r4 + ldr r0, [r0] + ldr r0, [r0] + bl sub_80F06D0 + ldr r1, =0x03001176 + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + adds r7, r4, 0 + cmp r0, r1 + bne _080F03E0 + ldr r1, =0x0203a02c + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + mov r2, r10 + ldrb r2, [r2] + cmp r0, r2 + beq _080F048C + adds r6, 0x1 + mov r9, r6 + b _080F0470 + .pool +_080F03E0: + movs r5, 0 + mov r3, r10 + ldrb r0, [r3] + subs r0, 0x1 + adds r2, r6, 0x1 + mov r9, r2 + cmp r5, r0 + bge _080F0456 + ldr r3, =0x03001174 + mov r8, r3 +_080F03F4: + adds r0, r6, r5 + adds r4, r0, 0x1 + mov r0, r8 + ldrb r1, [r0] + adds r0, r4, 0 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + ldr r0, [r0] + bl sub_80EFB08 + ldr r1, =0x030060bc + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080F0446 + mov r2, r8 + ldrb r1, [r2] + adds r0, r4, 0 + bl __modsi3 + adds r2, r0, 0 + lsls r0, r2, 2 + add r0, sp + ldr r0, [r0] + mov r3, sp + adds r1, r3, r7 + ldr r1, [r1] + lsls r2, 24 + lsrs r2, 24 + bl sub_80F049C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080F0456 +_080F0446: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + mov r1, r8 + ldrb r0, [r1] + subs r0, 0x1 + cmp r5, r0 + blt _080F03F4 +_080F0456: + mov r2, r10 + ldrb r0, [r2] + subs r0, 0x1 + cmp r5, r0 + bne _080F0470 + mov r3, sp + adds r0, r3, r7 + ldr r0, [r0] + ldr r0, [r0] + ldr r1, =0x03001176 + ldrb r1, [r1] + bl sub_80EF910 +_080F0470: + mov r1, r9 + lsls r0, r1, 24 + lsrs r6, r0, 24 + mov r2, r10 + ldrb r2, [r2] + cmp r6, r2 + bcc _080F0390 + b _080F0384 + .pool +_080F048C: + 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_80F0358 + + thumb_func_start sub_80F049C +sub_80F049C: @ 80F049C + push {r4-r7,lr} + sub sp, 0x4 + lsls r2, 24 + lsrs r7, r2, 24 + ldr r4, [r0] + ldr r6, [r1] + movs r5, 0 + ldr r2, =0x03001176 + movs r1, 0 + ldrsb r1, [r2, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + ldrb r0, [r0] + str r2, [sp] + bl sub_80EFFE0 + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + ldr r2, [sp] + cmp r0, 0x3 + beq _080F050C + cmp r0, 0x3 + bgt _080F04DC + cmp r0, 0x2 + beq _080F04E2 + b _080F055A + .pool +_080F04DC: + cmp r1, 0x4 + beq _080F0534 + b _080F055A +_080F04E2: + ldr r0, =0x030060bc + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4, r0 + ldrb r2, [r2] + lsls r2, 24 + asrs r2, 24 + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r1, r6, r1 + adds r2, r7, 0 + bl sub_80F0580 + b _080F0556 + .pool +_080F050C: + ldr r0, =0x030060bc + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4, r0 + ldrb r2, [r2] + lsls r2, 24 + asrs r2, 24 + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r1, r6, r1 + adds r2, r7, 0 + bl sub_80F05E8 + b _080F0556 + .pool +_080F0534: + ldr r0, =0x030060bc + movs r1, 0 + ldrsb r1, [r0, r1] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4, r0 + ldrb r2, [r2] + lsls r2, 24 + asrs r2, 24 + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r1, r6, r1 + adds r2, r7, 0 + bl sub_80F0668 +_080F0556: + lsls r0, 24 + lsrs r5, r0, 24 +_080F055A: + cmp r5, 0x1 + beq _080F0568 + movs r0, 0 + b _080F0574 + .pool +_080F0568: + ldr r0, =0x03001176 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_80EF910 + movs r0, 0x1 +_080F0574: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80F049C + + thumb_func_start sub_80F0580 +sub_80F0580: @ 80F0580 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + lsls r0, r2, 24 + lsrs r0, 24 + bl sub_800A2A4 + adds r5, r0, 0 + movs r2, 0xFF + ands r0, r2 + adds r1, r4, 0 + adds r1, 0x22 + ldrb r1, [r1] + cmp r0, r1 + bne _080F05B0 + lsrs r0, r5, 8 + ands r0, r2 + adds r1, r4, 0 + adds r1, 0x23 + ldrb r1, [r1] + cmp r0, r1 + bne _080F05B0 + movs r0, 0 + b _080F05E0 +_080F05B0: + adds r1, r4, 0 + adds r1, 0x20 + ldrb r0, [r1] + adds r2, r4, 0 + adds r2, 0x22 + strb r0, [r2] + adds r3, r4, 0 + adds r3, 0x21 + ldrb r0, [r3] + adds r2, 0x1 + strb r0, [r2] + strb r5, [r1] + lsrs r0, r5, 8 + strb r0, [r3] + adds r1, r6, 0 + adds r0, r4, 0 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + movs r0, 0x1 + strb r0, [r6, 0x1] +_080F05E0: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80F0580 + + thumb_func_start sub_80F05E8 +sub_80F05E8: @ 80F05E8 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + lsls r0, r2, 24 + lsrs r0, 24 + bl sub_800A2A4 + adds r2, r0, 0 + movs r3, 0xFF + ands r0, r3 + adds r1, r4, 0 + adds r1, 0x20 + ldrb r1, [r1] + cmp r0, r1 + bne _080F0614 + lsrs r0, r2, 8 + ands r0, r3 + adds r1, r4, 0 + adds r1, 0x21 + ldrb r1, [r1] + cmp r0, r1 + beq _080F0634 +_080F0614: + movs r3, 0xFF + adds r0, r2, 0 + ands r0, r3 + adds r1, r4, 0 + adds r1, 0x22 + lsrs r5, r2, 8 + ldrb r1, [r1] + cmp r0, r1 + bne _080F0638 + adds r0, r5, 0 + ands r0, r3 + adds r1, r4, 0 + adds r1, 0x23 + ldrb r1, [r1] + cmp r0, r1 + bne _080F0638 +_080F0634: + movs r0, 0 + b _080F0660 +_080F0638: + ldrb r1, [r4, 0x1E] + adds r0, r4, 0 + adds r0, 0x20 + strb r1, [r0] + ldrb r0, [r4, 0x1F] + adds r1, r4, 0 + adds r1, 0x21 + strb r0, [r1] + strb r2, [r4, 0x1E] + strb r5, [r4, 0x1F] + adds r1, r6, 0 + adds r0, r4, 0 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + movs r0, 0x1 + strb r0, [r6, 0x1] +_080F0660: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80F05E8 + + thumb_func_start sub_80F0668 +sub_80F0668: @ 80F0668 + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + lsls r0, r2, 24 + lsrs r0, 24 + bl sub_800A2A4 + adds r5, r0, 0 + movs r2, 0xFF + ands r0, r2 + adds r1, r4, 0 + adds r1, 0x22 + ldrb r1, [r1] + cmp r0, r1 + bne _080F0698 + lsrs r0, r5, 8 + ands r0, r2 + adds r1, r4, 0 + adds r1, 0x23 + ldrb r1, [r1] + cmp r0, r1 + bne _080F0698 + movs r0, 0 + b _080F06CA +_080F0698: + adds r1, r4, 0 + adds r1, 0x20 + ldrb r0, [r1] + adds r2, r4, 0 + adds r2, 0x22 + strb r0, [r2] + adds r3, r4, 0 + adds r3, 0x21 + ldrb r0, [r3] + adds r2, 0x1 + strb r0, [r2] + strb r5, [r1] + lsrs r0, r5, 8 + strb r0, [r3] + adds r1, r6, 0 + adds r0, r4, 0 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + movs r0, 0x1 + strb r0, [r6, 0x1] + strh r0, [r6, 0x16] +_080F06CA: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80F0668 + + thumb_func_start sub_80F06D0 +sub_80F06D0: @ 80F06D0 + push {lr} + adds r3, r0, 0 + movs r2, 0 +_080F06D6: + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r3 + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _080F06F6 + ldrb r0, [r1] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3B + bhi _080F06F6 + lsls r0, r2, 24 + asrs r0, 24 + b _080F0704 +_080F06F6: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x17 + bls _080F06D6 + movs r0, 0x1 + negs r0, r0 +_080F0704: + pop {r1} + bx r1 + thumb_func_end sub_80F06D0 + + thumb_func_start sub_80F0708 +sub_80F0708: @ 80F0708 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + movs r0, 0 + mov r9, r0 +_080F0716: + ldr r3, =0x03005d8c + ldr r1, [r3] + mov r4, r9 + lsls r2, r4, 3 + adds r0, r2, r4 + lsls r0, 2 + adds r1, r0 + ldr r0, =0x000027cc + adds r1, r0 + ldrb r0, [r1] + adds r7, r2, 0 + cmp r0, 0x29 + bls _080F0732 + b _080F0AD8 +_080F0732: + lsls r0, 2 + ldr r1, =_080F0748 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F0748: + .4byte _080F0AE2 + .4byte _080F0848 + .4byte _080F0AE2 + .4byte _080F0860 + .4byte _080F0878 + .4byte _080F0890 + .4byte _080F08BC + .4byte _080F08D4 + .4byte _080F07F0 + .4byte _080F0AE2 + .4byte _080F081C + .4byte _080F0AE2 + .4byte _080F0AE2 + .4byte _080F0AD8 + .4byte _080F0AD8 + .4byte _080F0AD8 + .4byte _080F0AD8 + .4byte _080F0AD8 + .4byte _080F0AD8 + .4byte _080F0AD8 + .4byte _080F0AD8 + .4byte _080F0900 + .4byte _080F0AE2 + .4byte _080F0918 + .4byte _080F0944 + .4byte _080F095C + .4byte _080F0AE2 + .4byte _080F0AE2 + .4byte _080F0AE2 + .4byte _080F0AE2 + .4byte _080F0974 + .4byte _080F09A0 + .4byte _080F0AE2 + .4byte _080F09C0 + .4byte _080F0AE2 + .4byte _080F0AE2 + .4byte _080F09F4 + .4byte _080F0AE2 + .4byte _080F0AE2 + .4byte _080F0AE2 + .4byte _080F0AD8 + .4byte _080F0AE2 +_080F07F0: + ldr r0, [r3] + mov r1, r9 + adds r4, r7, r1 + lsls r4, 2 + adds r0, r4, r0 + ldr r6, =0x000027cc + adds r0, r6 + ldrh r0, [r0, 0x12] + lsls r5, r1, 24 + lsrs r5, 24 + adds r1, r5, 0 + str r3, [sp, 0x4] + bl sub_80F0B24 + ldr r3, [sp, 0x4] + ldr r0, [r3] + adds r4, r0 + adds r4, r6 + ldrh r0, [r4, 0x2] + b _080F09E6 + .pool +_080F081C: + ldr r0, [r3] + mov r2, r9 + adds r4, r7, r2 + lsls r4, 2 + adds r0, r4, r0 + ldr r6, =0x000027cc + adds r0, r6 + ldrh r0, [r0, 0x16] + lsls r5, r2, 24 + lsrs r5, 24 + adds r1, r5, 0 + str r3, [sp, 0x4] + bl sub_80F0B24 + ldr r3, [sp, 0x4] + ldr r0, [r3] + adds r4, r0 + adds r4, r6 + ldrh r0, [r4, 0x2] + b _080F09E6 + .pool +_080F0848: + ldr r0, [r3] + mov r4, r9 + adds r1, r7, r4 + lsls r1, 2 + adds r1, r0 + ldr r0, =0x000027cc + adds r1, r0 + ldrh r0, [r1, 0x2] + b _080F09B0 + .pool +_080F0860: + ldr r0, [r3] + mov r2, r9 + adds r1, r7, r2 + lsls r1, 2 + adds r1, r0 + ldr r4, =0x000027cc + adds r1, r4 + ldrh r0, [r1, 0x2] + lsls r1, r2, 24 + b _080F09B2 + .pool +_080F0878: + ldr r0, [r3] + mov r2, r9 + adds r1, r7, r2 + lsls r1, 2 + adds r1, r0 + ldr r4, =0x000027cc + adds r1, r4 + ldrh r0, [r1, 0x6] + lsls r1, r2, 24 + b _080F09B2 + .pool +_080F0890: + ldr r0, [r3] + mov r1, r9 + adds r4, r7, r1 + lsls r4, 2 + adds r0, r4, r0 + ldr r6, =0x000027cc + adds r0, r6 + ldrh r0, [r0, 0x2] + lsls r5, r1, 24 + lsrs r5, 24 + adds r1, r5, 0 + str r3, [sp, 0x4] + bl sub_80F0B24 + ldr r3, [sp, 0x4] + ldr r0, [r3] + adds r4, r0 + adds r4, r6 + ldrh r0, [r4, 0x1C] + b _080F09E6 + .pool +_080F08BC: + ldr r0, [r3] + mov r2, r9 + adds r1, r7, r2 + lsls r1, 2 + adds r1, r0 + ldr r4, =0x000027cc + adds r1, r4 + ldrh r0, [r1, 0x2] + lsls r1, r2, 24 + b _080F09B2 + .pool +_080F08D4: + ldr r0, [r3] + mov r1, r9 + adds r4, r7, r1 + lsls r4, 2 + adds r0, r4, r0 + ldr r6, =0x000027cc + adds r0, r6 + ldrh r0, [r0, 0xA] + lsls r5, r1, 24 + lsrs r5, 24 + adds r1, r5, 0 + str r3, [sp, 0x4] + bl sub_80F0B24 + ldr r3, [sp, 0x4] + ldr r0, [r3] + adds r4, r0 + adds r4, r6 + ldrh r0, [r4, 0x14] + b _080F09E6 + .pool +_080F0900: + ldr r0, [r3] + mov r2, r9 + adds r1, r7, r2 + lsls r1, 2 + adds r1, r0 + ldr r4, =0x000027cc + adds r1, r4 + ldrh r0, [r1, 0x10] + lsls r1, r2, 24 + b _080F09B2 + .pool +_080F0918: + ldr r0, [r3] + mov r1, r9 + adds r4, r7, r1 + lsls r4, 2 + adds r0, r4, r0 + ldr r6, =0x000027cc + adds r0, r6 + ldrh r0, [r0, 0xC] + lsls r5, r1, 24 + lsrs r5, 24 + adds r1, r5, 0 + str r3, [sp, 0x4] + bl sub_80F0B24 + ldr r3, [sp, 0x4] + ldr r0, [r3] + adds r4, r0 + adds r4, r6 + ldrh r0, [r4, 0xE] + b _080F09E6 + .pool +_080F0944: + ldr r0, [r3] + mov r2, r9 + adds r1, r7, r2 + lsls r1, 2 + adds r1, r0 + ldr r4, =0x000027cc + adds r1, r4 + ldrh r0, [r1, 0x4] + lsls r1, r2, 24 + b _080F09B2 + .pool +_080F095C: + ldr r0, [r3] + mov r1, r9 + adds r4, r7, r1 + lsls r4, 2 + adds r0, r4, r0 + ldr r6, =0x000027cc + adds r0, r6 + ldrh r0, [r0, 0x8] + b _080F09D0 + .pool +_080F0974: + ldr r0, [r3] + mov r2, r9 + adds r4, r7, r2 + lsls r4, 2 + adds r0, r4, r0 + ldr r6, =0x000027cc + adds r0, r6 + ldrh r0, [r0, 0x2] + lsls r5, r2, 24 + lsrs r5, 24 + adds r1, r5, 0 + str r3, [sp, 0x4] + bl sub_80F0B24 + ldr r3, [sp, 0x4] + ldr r0, [r3] + adds r4, r0 + adds r4, r6 + ldrh r0, [r4, 0xA] + b _080F09E6 + .pool +_080F09A0: + ldr r0, [r3] + mov r4, r9 + adds r1, r7, r4 + lsls r1, 2 + adds r1, r0 + ldr r0, =0x000027cc + adds r1, r0 + ldrh r0, [r1, 0x8] +_080F09B0: + lsls r1, r4, 24 +_080F09B2: + lsrs r1, 24 + bl sub_80F0B24 + b _080F0AE2 + .pool +_080F09C0: + ldr r0, [r3] + mov r1, r9 + adds r4, r7, r1 + lsls r4, 2 + adds r0, r4, r0 + ldr r6, =0x000027cc + adds r0, r6 + ldrh r0, [r0, 0x6] +_080F09D0: + lsls r5, r1, 24 + lsrs r5, 24 + adds r1, r5, 0 + str r3, [sp, 0x4] + bl sub_80F0B24 + ldr r3, [sp, 0x4] + ldr r0, [r3] + adds r4, r0 + adds r4, r6 + ldrh r0, [r4, 0x4] +_080F09E6: + adds r1, r5, 0 + bl sub_80F0B24 + b _080F0AE2 + .pool +_080F09F4: + ldr r0, [r3] + mov r2, r9 + adds r4, r7, r2 + lsls r4, 2 + adds r0, r4, r0 + ldr r5, =0x000027cc + adds r0, r5 + ldrh r0, [r0, 0x4] + lsls r2, 24 + mov r8, r2 + lsrs r6, r2, 24 + adds r1, r6, 0 + str r3, [sp, 0x4] + bl sub_80F0B24 + ldr r3, [sp, 0x4] + ldr r0, [r3] + adds r0, r4, r0 + adds r0, r5 + ldrh r0, [r0, 0x6] + adds r1, r6, 0 + bl sub_80F0B24 + ldr r3, [sp, 0x4] + ldr r0, [r3] + adds r4, r0 + adds r4, r5 + ldrb r0, [r4, 0xD] + subs r0, 0x1 + mov r6, r8 + cmp r0, 0xC + bhi _080F0AE2 + lsls r0, 2 + ldr r1, =_080F0A48 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F0A48: + .4byte _080F0A7C + .4byte _080F0AA0 + .4byte _080F0AE2 + .4byte _080F0AE2 + .4byte _080F0A7C + .4byte _080F0A7C + .4byte _080F0A7C + .4byte _080F0A7C + .4byte _080F0A7C + .4byte _080F0A7C + .4byte _080F0A7C + .4byte _080F0A7C + .4byte _080F0A7C +_080F0A7C: + ldr r0, =0x03005d8c + ldr r1, [r0] + mov r4, r9 + adds r0, r7, r4 + lsls r0, 2 + adds r0, r1 + ldr r1, =0x000027cc + adds r0, r1 + ldrh r0, [r0, 0x8] + lsrs r1, r6, 24 + bl sub_80F0B24 + b _080F0AE2 + .pool +_080F0AA0: + ldr r2, =0x03005d8c + ldr r0, [r2] + mov r1, r9 + adds r4, r7, r1 + lsls r4, 2 + adds r0, r4, r0 + ldr r5, =0x000027cc + adds r0, r5 + ldrh r0, [r0, 0x8] + lsrs r6, 24 + adds r1, r6, 0 + str r2, [sp] + bl sub_80F0B24 + ldr r2, [sp] + ldr r0, [r2] + adds r4, r0 + adds r4, r5 + ldrh r0, [r4, 0xA] + adds r1, r6, 0 + bl sub_80F0B24 + b _080F0AE2 + .pool +_080F0AD8: + mov r2, r9 + lsls r0, r2, 24 + lsrs r0, 24 + bl sub_80F0B00 +_080F0AE2: + mov r0, r9 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + cmp r0, 0x17 + bhi _080F0AF2 + b _080F0716 +_080F0AF2: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80F0708 + + thumb_func_start sub_80F0B00 +sub_80F0B00: @ 80F0B00 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005d8c + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r2, r1 + ldr r0, =0x000027cd + adds r2, r0 + movs r0, 0 + strb r0, [r2] + bx lr + .pool + thumb_func_end sub_80F0B00 + + thumb_func_start sub_80F0B24 +sub_80F0B24: @ 80F0B24 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 24 + lsrs r4, r1, 24 + bl SpeciesToNationalPokedexNum + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl pokedex_flag_operation + lsls r0, 24 + asrs r2, r0, 24 + cmp r2, 0 + bne _080F0B56 + ldr r0, =0x03005d8c + ldr r1, [r0] + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + adds r1, r0 + ldr r0, =0x000027cd + adds r1, r0 + strb r2, [r1] +_080F0B56: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F0B24 + + thumb_func_start sub_80F0B64 +sub_80F0B64: @ 80F0B64 + push {r4-r6,lr} + ldr r0, =0x00000864 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080F0BA2 + movs r2, 0 + ldr r4, =0x000027cd + movs r3, 0 + ldr r5, =0x03005d8c +_080F0B7C: + ldr r0, [r5] + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 2 + adds r1, r0, r1 + ldr r6, =0x000027cc + adds r0, r1, r6 + ldrb r0, [r0] + cmp r0, 0x7 + beq _080F0B94 + cmp r0, 0x29 + bne _080F0B98 +_080F0B94: + adds r0, r1, r4 + strb r3, [r0] +_080F0B98: + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0x17 + bls _080F0B7C +_080F0BA2: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F0B64 + + thumb_func_start sub_80F0BB8 +sub_80F0BB8: @ 80F0BB8 + push {r4-r6,lr} + movs r5, 0 + ldr r6, =0x03005d8c +_080F0BBE: + ldr r1, [r6] + lsls r0, r5, 3 + adds r0, r5 + lsls r4, r0, 2 + adds r1, r4 + ldr r0, =0x000027cc + adds r1, r0 + ldrb r0, [r1] + bl sub_80EFFE0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _080F0BE6 + ldr r0, [r6] + adds r0, r4 + ldr r1, =0x000027cd + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_080F0BE6: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x4 + bls _080F0BBE + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F0BB8 + + thumb_func_start sub_80F0C04 +sub_80F0C04: @ 80F0C04 + push {r4,r5,lr} + movs r3, 0 + movs r2, 0x5 + ldr r0, =0x03005d8c + ldr r4, [r0] + ldr r5, =0x000027cc +_080F0C10: + lsls r0, r2, 24 + asrs r1, r0, 24 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r4, r0 + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _080F0C2E + lsls r0, r3, 24 + movs r2, 0x80 + lsls r2, 17 + adds r0, r2 + lsrs r3, r0, 24 +_080F0C2E: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + asrs r0, 24 + cmp r0, 0x17 + ble _080F0C10 + movs r2, 0 + lsls r0, r3, 24 + asrs r0, 24 + movs r1, 0x5 + subs r0, r1, r0 + cmp r2, r0 + bge _080F0C6E + adds r5, r0, 0 +_080F0C4A: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000027cc + adds r0, r1 + lsls r1, r2, 24 + asrs r4, r1, 24 + movs r2, 0xA0 + lsls r2, 19 + adds r1, r2 + lsrs r1, 24 + bl sub_80EF910 + adds r4, 0x1 + lsls r4, 24 + lsrs r2, r4, 24 + asrs r4, 24 + cmp r4, r5 + blt _080F0C4A +_080F0C6E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F0C04 + + thumb_func_start sub_80F0C7C +sub_80F0C7C: @ 80F0C7C + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r6, r2, 24 + movs r0, 0x80 + lsls r0, 1 + bl Alloc + adds r5, r0, 0 + cmp r5, 0 + beq _080F0D4C + movs r4, 0 +_080F0C9A: + lsls r0, r4, 6 + adds r0, r5 + adds r1, r4, 0 + muls r1, r7 + add r1, r8 + movs r2, 0x40 + bl memcpy + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + bls _080F0C9A + cmp r6, 0x1 + beq _080F0CF0 + cmp r6, 0x1 + bgt _080F0CC2 + cmp r6, 0 + beq _080F0CCC + b _080F0D3E +_080F0CC2: + cmp r6, 0x2 + beq _080F0D08 + cmp r6, 0x3 + beq _080F0D28 + b _080F0D3E +_080F0CCC: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002b50 + adds r0, r1 + adds r1, r5, 0 + adds r1, 0x40 + adds r2, r5, 0 + adds r2, 0x80 + adds r3, r5, 0 + adds r3, 0xC0 + bl sub_80F0D60 + b _080F0D3E + .pool +_080F0CF0: + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r0, =0x00002b50 + adds r1, r0 + adds r2, r5, 0 + adds r2, 0x80 + b _080F0D14 + .pool +_080F0D08: + adds r1, r5, 0 + adds r1, 0x40 + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r0, =0x00002b50 + adds r2, r0 +_080F0D14: + adds r3, r5, 0 + adds r3, 0xC0 + adds r0, r5, 0 + bl sub_80F0D60 + b _080F0D3E + .pool +_080F0D28: + adds r1, r5, 0 + adds r1, 0x40 + adds r2, r5, 0 + adds r2, 0x80 + ldr r0, =0x03005d8c + ldr r3, [r0] + ldr r0, =0x00002b50 + adds r3, r0 + adds r0, r5, 0 + bl sub_80F0D60 +_080F0D3E: + bl sub_80F0EEC + bl sub_80F0F24 + adds r0, r5, 0 + bl Free +_080F0D4C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F0C7C + + thumb_func_start sub_80F0D60 +sub_80F0D60: @ 80F0D60 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + str r0, [sp, 0x10] + str r1, [sp, 0x14] + str r2, [sp, 0x18] + str r3, [sp, 0x1C] + add r0, sp, 0x10 + str r0, [sp] + add r0, sp, 0x14 + str r0, [sp, 0x4] + add r0, sp, 0x18 + str r0, [sp, 0x8] + add r0, sp, 0x1C + str r0, [sp, 0xC] + bl sub_8009FCC + ldr r1, =0x03001175 + strb r0, [r1] + movs r0, 0 + mov r10, r0 +_080F0D90: + movs r7, 0 + mov r1, r10 + adds r1, 0x1 + str r1, [sp, 0x20] + b _080F0E28 + .pool +_080F0DA0: + lsls r4, r7, 2 + mov r1, sp + adds r0, r1, r4 + ldr r0, [r0] + ldr r0, [r0] + mov r1, r10 + bl sub_80F0ECC + ldr r1, =0x03001176 + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + mov r8, r4 + adds r1, r7, 0x1 + mov r9, r1 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080F0E22 + movs r5, 0 + ldr r1, =0x03001175 + ldrb r0, [r1] + subs r0, 0x1 + cmp r5, r0 + bge _080F0E22 + adds r6, r1, 0 +_080F0DD4: + adds r0, r7, r5 + adds r4, r0, 0x1 + ldrb r1, [r6] + adds r0, r4, 0 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + ldr r0, [r0] + bl sub_80EEE30 + ldr r1, =0x030060bc + strb r0, [r1] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080F0E14 + ldrb r1, [r6] + adds r0, r4, 0 + bl __modsi3 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + mov r1, sp + add r1, r8 + ldr r1, [r1] + bl sub_80F0E58 +_080F0E14: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + ldrb r0, [r6] + subs r0, 0x1 + cmp r5, r0 + blt _080F0DD4 +_080F0E22: + mov r1, r9 + lsls r0, r1, 24 + lsrs r7, r0, 24 +_080F0E28: + ldr r0, =0x03001175 + ldrb r0, [r0] + cmp r7, r0 + bcc _080F0DA0 + ldr r1, [sp, 0x20] + lsls r0, r1, 24 + lsrs r0, 24 + mov r10, r0 + cmp r0, 0xF + bls _080F0D90 + 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_80F0D60 + + thumb_func_start sub_80F0E58 +sub_80F0E58: @ 80F0E58 + push {lr} + ldr r0, [r0] + ldr r1, [r1] + ldr r2, =0x03001176 + ldrb r2, [r2] + lsls r2, 24 + asrs r2, 24 + lsls r2, 2 + adds r1, r2 + ldr r2, =0x030060bc + ldrb r2, [r2] + lsls r2, 24 + asrs r2, 24 + bl sub_80F0E84 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F0E58 + + thumb_func_start sub_80F0E84 +sub_80F0E84: @ 80F0E84 + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r6, r2, 24 + ldrb r3, [r5] + adds r0, r3, 0 + cmp r0, 0 + bne _080F0E9A +_080F0E96: + movs r0, 0 + b _080F0EC6 +_080F0E9A: + movs r1, 0 + adds r2, r3, 0 + adds r3, r0, 0 +_080F0EA0: + lsls r0, r1, 2 + adds r0, r4 + ldrb r0, [r0] + cmp r0, r3 + beq _080F0E96 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0xF + bls _080F0EA0 + lsls r0, r6, 24 + asrs r0, 22 + adds r0, r4 + strb r2, [r0] + movs r1, 0x1 + strb r1, [r0, 0x1] + ldrh r1, [r5, 0x2] + strh r1, [r0, 0x2] + movs r0, 0x1 +_080F0EC6: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80F0E84 + + thumb_func_start sub_80F0ECC +sub_80F0ECC: @ 80F0ECC + push {lr} + lsls r1, 24 + lsrs r2, r1, 24 + lsls r1, r2, 2 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _080F0EE2 + lsls r0, r2, 24 + asrs r0, 24 + b _080F0EE6 +_080F0EE2: + movs r0, 0x1 + negs r0, r0 +_080F0EE6: + pop {r1} + bx r1 + thumb_func_end sub_80F0ECC + + thumb_func_start sub_80F0EEC +sub_80F0EEC: @ 80F0EEC + push {r4,lr} + movs r4, 0 +_080F0EF0: + ldr r0, =0x03005d8c + ldr r0, [r0] + lsls r1, r4, 2 + adds r0, r1 + ldr r1, =0x00002b50 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x4 + bls _080F0F08 + adds r0, r4, 0 + bl sub_80EEE78 +_080F0F08: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bls _080F0EF0 + bl sub_80EEEB8 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F0EEC + + thumb_func_start sub_80F0F24 +sub_80F0F24: @ 80F0F24 + push {r4,r5,lr} + ldr r0, =0x00000864 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080F0F50 + movs r2, 0 + ldr r5, =0x03005d8c + ldr r4, =0x00002b51 + movs r3, 0 +_080F0F3C: + ldr r0, [r5] + lsls r1, r2, 2 + adds r0, r1 + adds r0, r4 + strb r3, [r0] + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xF + bls _080F0F3C +_080F0F50: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80F0F24 + + thumb_func_start sub_80F0F64 +sub_80F0F64: @ 80F0F64 + push {r4-r7,lr} + adds r6, r0, 0 + adds r5, r1, 0 + movs r0, 0x2C + bl AllocZeroed + adds r4, r0, 0 + movs r7, 0 +_080F0F74: + lsls r0, r7, 3 + adds r1, r0, r7 + lsls r1, 2 + adds r1, r6 + ldrb r1, [r1] + subs r1, 0x1 + adds r2, r0, 0 + cmp r1, 0x28 + bls _080F0F88 + b _080F11F4 +_080F0F88: + lsls r0, r1, 2 + ldr r1, =_080F0F98 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F0F98: + .4byte _080F103C + .4byte _080F103C + .4byte _080F105A + .4byte _080F11F4 + .4byte _080F1152 + .4byte _080F111E + .4byte _080F10E6 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F1092 + .4byte _080F10C6 + .4byte _080F118A + .4byte _080F11AA + .4byte _080F11CA + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11F4 + .4byte _080F11EA +_080F103C: + adds r0, r2, r7 + lsls r0, 2 + adds r0, r6, r0 + str r0, [r4] + adds r0, 0x10 + bl sub_8009228 + cmp r0, 0 + beq _080F1056 + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x18] + b _080F11F4 +_080F1056: + ldr r0, [r4] + b _080F11F2 +_080F105A: + adds r0, r2, r7 + lsls r0, 2 + adds r0, r6, r0 + str r0, [r4, 0x4] + adds r0, 0x5 + bl sub_8009228 + cmp r0, 0 + beq _080F1074 + ldr r1, [r4, 0x4] + movs r0, 0x1 + strb r0, [r1, 0xD] + b _080F1078 +_080F1074: + ldr r0, [r4, 0x4] + strb r5, [r0, 0xD] +_080F1078: + ldr r0, [r4, 0x4] + adds r0, 0x10 + bl sub_8009228 + cmp r0, 0 + beq _080F108C + ldr r1, [r4, 0x4] + movs r0, 0x1 + strb r0, [r1, 0xE] + b _080F11F4 +_080F108C: + ldr r0, [r4, 0x4] + strb r5, [r0, 0xE] + b _080F11F4 +_080F1092: + adds r0, r2, r7 + lsls r0, 2 + adds r0, r6, r0 + str r0, [r4, 0x18] + adds r0, 0x13 + bl sub_8009228 + cmp r0, 0 + beq _080F10AC + ldr r1, [r4, 0x18] + movs r0, 0x1 + strb r0, [r1, 0x2] + b _080F10B0 +_080F10AC: + ldr r0, [r4, 0x18] + strb r5, [r0, 0x2] +_080F10B0: + ldr r0, [r4, 0x18] + adds r0, 0x4 + bl sub_8009228 + cmp r0, 0 + beq _080F10C0 + ldr r1, [r4, 0x18] + b _080F10DA +_080F10C0: + ldr r0, [r4, 0x18] + strb r5, [r0, 0x3] + b _080F11F4 +_080F10C6: + adds r0, r2, r7 + lsls r0, 2 + adds r0, r6, r0 + str r0, [r4, 0x1C] + adds r0, 0x13 + bl sub_8009228 + cmp r0, 0 + beq _080F10E0 + ldr r1, [r4, 0x1C] +_080F10DA: + movs r0, 0x1 + strb r0, [r1, 0x3] + b _080F11F4 +_080F10E0: + ldr r0, [r4, 0x1C] + strb r5, [r0, 0x3] + b _080F11F4 +_080F10E6: + adds r0, r2, r7 + lsls r0, 2 + adds r0, r6, r0 + str r0, [r4, 0x14] + adds r0, 0x2 + bl sub_8009228 + cmp r0, 0 + beq _080F1100 + ldr r1, [r4, 0x14] + movs r0, 0x1 + strb r0, [r1, 0x1D] + b _080F1104 +_080F1100: + ldr r0, [r4, 0x14] + strb r5, [r0, 0x1D] +_080F1104: + ldr r0, [r4, 0x14] + adds r0, 0xC + bl sub_8009228 + cmp r0, 0 + beq _080F1118 + ldr r1, [r4, 0x14] + movs r0, 0x1 + strb r0, [r1, 0x1E] + b _080F11F4 +_080F1118: + ldr r0, [r4, 0x14] + strb r5, [r0, 0x1E] + b _080F11F4 +_080F111E: + adds r0, r2, r7 + lsls r0, 2 + adds r0, r6, r0 + str r0, [r4, 0x10] + adds r0, 0x16 + bl sub_8009228 + cmp r0, 0 + beq _080F1138 + ldr r1, [r4, 0x10] + movs r0, 0x1 + strb r0, [r1, 0x1E] + b _080F113C +_080F1138: + ldr r0, [r4, 0x10] + strb r5, [r0, 0x1E] +_080F113C: + ldr r0, [r4, 0x10] + adds r0, 0x8 + bl sub_8009228 + cmp r0, 0 + beq _080F114C + ldr r1, [r4, 0x10] + b _080F117E +_080F114C: + ldr r0, [r4, 0x10] + strb r5, [r0, 0x1F] + b _080F11F4 +_080F1152: + adds r0, r2, r7 + lsls r0, 2 + adds r0, r6, r0 + str r0, [r4, 0xC] + adds r0, 0xF + bl sub_8009228 + cmp r0, 0 + beq _080F116C + ldr r1, [r4, 0xC] + movs r0, 0x1 + strb r0, [r1, 0x1E] + b _080F1170 +_080F116C: + ldr r0, [r4, 0xC] + strb r5, [r0, 0x1E] +_080F1170: + ldr r0, [r4, 0xC] + adds r0, 0x4 + bl sub_8009228 + cmp r0, 0 + beq _080F1184 + ldr r1, [r4, 0xC] +_080F117E: + movs r0, 0x1 + strb r0, [r1, 0x1F] + b _080F11F4 +_080F1184: + ldr r0, [r4, 0xC] + strb r5, [r0, 0x1F] + b _080F11F4 +_080F118A: + adds r0, r2, r7 + lsls r0, 2 + adds r0, r6, r0 + str r0, [r4, 0x8] + adds r0, 0x13 + bl sub_8009228 + cmp r0, 0 + beq _080F11A4 + ldr r1, [r4, 0x8] + movs r0, 0x1 + strb r0, [r1, 0x2] + b _080F11F4 +_080F11A4: + ldr r0, [r4, 0x8] + strb r5, [r0, 0x2] + b _080F11F4 +_080F11AA: + adds r0, r2, r7 + lsls r0, 2 + adds r0, r6, r0 + str r0, [r4, 0x20] + adds r0, 0x13 + bl sub_8009228 + cmp r0, 0 + beq _080F11C4 + ldr r1, [r4, 0x20] + movs r0, 0x1 + strb r0, [r1, 0x6] + b _080F11F4 +_080F11C4: + ldr r0, [r4, 0x20] + strb r5, [r0, 0x6] + b _080F11F4 +_080F11CA: + adds r0, r2, r7 + lsls r0, 2 + adds r0, r6, r0 + str r0, [r4, 0x24] + adds r0, 0x13 + bl sub_8009228 + cmp r0, 0 + beq _080F11E4 + ldr r1, [r4, 0x24] + movs r0, 0x1 + strb r0, [r1, 0xB] + b _080F11F4 +_080F11E4: + ldr r0, [r4, 0x24] + strb r5, [r0, 0xB] + b _080F11F4 +_080F11EA: + adds r0, r2, r7 + lsls r0, 2 + adds r0, r6, r0 + str r0, [r4, 0x28] +_080F11F2: + strb r5, [r0, 0x18] +_080F11F4: + adds r7, 0x1 + cmp r7, 0x17 + bgt _080F11FC + b _080F0F74 +_080F11FC: + adds r0, r4, 0 + bl Free + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80F0F64 + + thumb_func_start sub_80F1208 +sub_80F1208: @ 80F1208 + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_80F14F8 + adds r4, r5, 0 + movs r1, 0xD8 + lsls r1, 2 + adds r0, r4, r1 + cmp r4, r0 + bcs _080F124C +_080F121C: + ldrb r0, [r4] + cmp r0, 0x7 + bne _080F1240 + ldrb r0, [r4, 0x1D] + cmp r0, 0x1 + bne _080F1230 + ldrb r0, [r4, 0x1E] + cmp r0, 0x1 + bne _080F1236 + b _080F1240 +_080F1230: + ldrb r0, [r4, 0x1E] + cmp r0, 0x1 + bne _080F1240 +_080F1236: + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x24 + bl memset +_080F1240: + adds r4, 0x24 + movs r1, 0xD8 + lsls r1, 2 + adds r0, r5, r1 + cmp r4, r0 + bcc _080F121C +_080F124C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80F1208 + + thumb_func_start sub_80F1254 +sub_80F1254: @ 80F1254 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r4, 0 + movs r1, 0xD8 + lsls r1, 2 + adds r0, r4, r1 + cmp r4, r0 + bcs _080F128A +_080F1264: + ldrb r0, [r4] + cmp r0, 0x7 + bne _080F127E + adds r0, r4, 0 + adds r0, 0xC + bl sub_8009228 + cmp r0, 0 + beq _080F127A + movs r0, 0x1 + b _080F127C +_080F127A: + movs r0, 0x2 +_080F127C: + strb r0, [r4, 0x1E] +_080F127E: + adds r4, 0x24 + movs r1, 0xD8 + lsls r1, 2 + adds r0, r5, r1 + cmp r4, r0 + bcc _080F1264 +_080F128A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80F1254 + + thumb_func_start sub_80F1290 +sub_80F1290: @ 80F1290 + push {lr} + bl sub_8009228 + movs r1, 0x2 + cmp r0, 0 + beq _080F129E + movs r1, 0x1 +_080F129E: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_80F1290 + + thumb_func_start sub_80F12A4 +sub_80F12A4: @ 80F12A4 + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r4, 0 + movs r1, 0xD8 + lsls r1, 2 + adds r0, r4, r1 + cmp r4, r0 + bcc _080F12B6 + b _080F14F0 +_080F12B6: + ldrb r0, [r4] + subs r0, 0x1 + cmp r0, 0x28 + bls _080F12C0 + b _080F14E2 +_080F12C0: + lsls r0, 2 + ldr r1, =_080F12D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F12D0: + .4byte _080F1374 + .4byte _080F137A + .4byte _080F1380 + .4byte _080F138E + .4byte _080F139A + .4byte _080F13A8 + .4byte _080F13BE + .4byte _080F13CC + .4byte _080F13E0 + .4byte _080F13F4 + .4byte _080F1408 + .4byte _080F1416 + .4byte _080F14E2 + .4byte _080F14E2 + .4byte _080F14E2 + .4byte _080F14E2 + .4byte _080F14E2 + .4byte _080F14E2 + .4byte _080F14E2 + .4byte _080F14E2 + .4byte _080F142A + .4byte _080F1438 + .4byte _080F1444 + .4byte _080F1450 + .4byte _080F145C + .4byte _080F14AC + .4byte _080F1468 + .4byte _080F14B8 + .4byte _080F148C + .4byte _080F1474 + .4byte _080F14AC + .4byte _080F14B8 + .4byte _080F1480 + .4byte _080F148C + .4byte _080F1498 + .4byte _080F14AC + .4byte _080F14B8 + .4byte _080F14C4 + .4byte _080F14D8 + .4byte _080F14E2 + .4byte _080F14E2 +_080F1374: + adds r0, r4, 0 + adds r0, 0x10 + b _080F1422 +_080F137A: + adds r0, r4, 0 + adds r0, 0x10 + b _080F1422 +_080F1380: + adds r0, r4, 0x5 + bl sub_80F1290 + strb r0, [r4, 0xD] + adds r0, r4, 0 + adds r0, 0x10 + b _080F1478 +_080F138E: + adds r0, r4, 0 + adds r0, 0xB + bl sub_80F1290 + strb r0, [r4, 0x17] + b _080F14E2 +_080F139A: + adds r0, r4, 0 + adds r0, 0xF + bl sub_80F1290 + strb r0, [r4, 0x1E] + adds r0, r4, 0x4 + b _080F13B6 +_080F13A8: + adds r0, r4, 0 + adds r0, 0x16 + bl sub_80F1290 + strb r0, [r4, 0x1E] + adds r0, r4, 0 + adds r0, 0x8 +_080F13B6: + bl sub_80F1290 + strb r0, [r4, 0x1F] + b _080F14E2 +_080F13BE: + adds r0, r4, 0x2 + bl sub_80F1290 + strb r0, [r4, 0x1D] + adds r0, r4, 0 + adds r0, 0xC + b _080F13D8 +_080F13CC: + adds r0, r4, 0 + adds r0, 0x14 + bl sub_80F1290 + strb r0, [r4, 0x1D] + adds r0, r4, 0x4 +_080F13D8: + bl sub_80F1290 + strb r0, [r4, 0x1E] + b _080F14E2 +_080F13E0: + adds r0, r4, 0 + adds r0, 0xC + bl sub_80F1290 + strb r0, [r4, 0x14] + adds r0, r4, 0x4 + bl sub_80F1290 + strb r0, [r4, 0x15] + b _080F14E2 +_080F13F4: + adds r0, r4, 0x4 + bl sub_80F1290 + strb r0, [r4, 0x19] + adds r0, r4, 0 + adds r0, 0xC + bl sub_80F1290 + strb r0, [r4, 0x1A] + b _080F14E2 +_080F1408: + adds r0, r4, 0x2 + bl sub_80F1290 + strb r0, [r4, 0x17] + adds r0, r4, 0 + adds r0, 0xC + b _080F1422 +_080F1416: + adds r0, r4, 0x2 + bl sub_80F1290 + strb r0, [r4, 0x17] + adds r0, r4, 0 + adds r0, 0xB +_080F1422: + bl sub_80F1290 + strb r0, [r4, 0x18] + b _080F14E2 +_080F142A: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0x2] + adds r0, r4, 0x4 + b _080F143C +_080F1438: + adds r0, r4, 0 + adds r0, 0x13 +_080F143C: + bl sub_80F1290 + strb r0, [r4, 0x3] + b _080F14E2 +_080F1444: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0x2] + b _080F14E2 +_080F1450: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0x6] + b _080F14E2 +_080F145C: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0xB] + b _080F14E2 +_080F1468: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0x9] + b _080F14E2 +_080F1474: + adds r0, r4, 0 + adds r0, 0x13 +_080F1478: + bl sub_80F1290 + strb r0, [r4, 0xE] + b _080F14E2 +_080F1480: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0x11] + b _080F14E2 +_080F148C: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0x8] + b _080F14E2 +_080F1498: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0xF] + adds r0, r4, 0x4 + bl sub_80F1290 + strb r0, [r4, 0x10] + b _080F14E2 +_080F14AC: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0xC] + b _080F14E2 +_080F14B8: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0x5] + b _080F14E2 +_080F14C4: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0x1B] + adds r0, r4, 0x4 + bl sub_80F1290 + strb r0, [r4, 0x1C] + b _080F14E2 +_080F14D8: + adds r0, r4, 0 + adds r0, 0x13 + bl sub_80F1290 + strb r0, [r4, 0x4] +_080F14E2: + adds r4, 0x24 + movs r1, 0xD8 + lsls r1, 2 + adds r0, r5, r1 + cmp r4, r0 + bcs _080F14F0 + b _080F12B6 +_080F14F0: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80F12A4 + + thumb_func_start sub_80F14F8 +sub_80F14F8: @ 80F14F8 + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r5, 0 + movs r6, 0x17 +_080F1500: + ldrb r0, [r4] + cmp r0, 0x17 + beq _080F151C + cmp r0, 0x19 + bne _080F152C + ldrb r0, [r4, 0xA] + cmp r0, 0x58 + bls _080F152C + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x24 + bl memset + b _080F152C +_080F151C: + ldrb r0, [r4, 0x12] + cmp r0, 0x58 + bls _080F152C + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x24 + bl memset +_080F152C: + adds r4, 0x24 + adds r5, 0x24 + subs r6, 0x1 + cmp r6, 0 + bge _080F1500 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80F14F8 + + thumb_func_start sub_80F153C +sub_80F153C: @ 80F153C + push {lr} + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r2, r0 + ldr r1, =0x000027cd + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080F155A + b _080F16E6 +_080F155A: + subs r1, 0x1 + adds r0, r2, r1 + ldrb r0, [r0] + subs r0, 0x1 + cmp r0, 0x28 + bls _080F1568 + b _080F16E6 +_080F1568: + lsls r0, 2 + ldr r1, =_080F1584 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F1584: + .4byte _080F1628 + .4byte _080F162E + .4byte _080F1634 + .4byte _080F163A + .4byte _080F165E + .4byte _080F1646 + .4byte _080F164C + .4byte _080F1664 + .4byte _080F1670 + .4byte _080F166A + .4byte _080F16B8 + .4byte _080F16E2 + .4byte _080F16E6 + .4byte _080F16E6 + .4byte _080F16E6 + .4byte _080F16E6 + .4byte _080F16E6 + .4byte _080F16E6 + .4byte _080F16E6 + .4byte _080F16E6 + .4byte _080F1652 + .4byte _080F1658 + .4byte _080F1676 + .4byte _080F167C + .4byte _080F1682 + .4byte _080F1688 + .4byte _080F168E + .4byte _080F1694 + .4byte _080F169A + .4byte _080F16A0 + .4byte _080F16A6 + .4byte _080F16AC + .4byte _080F16B2 + .4byte _080F16BE + .4byte _080F16C4 + .4byte _080F16CA + .4byte _080F16D0 + .4byte _080F16D6 + .4byte _080F16DC + .4byte _080F16E6 + .4byte _080F1640 +_080F1628: + bl DoTVShowPokemonFanClubLetter + b _080F16E6 +_080F162E: + bl DoTVShowRecentHappenings + b _080F16E6 +_080F1634: + bl DoTVShowPokemonFanClubOpinions + b _080F16E6 +_080F163A: + bl DoTVShowDummiedOut + b _080F16E6 +_080F1640: + bl DoTVShowPokemonNewsMassOutbreak + b _080F16E6 +_080F1646: + bl DoTVShowBravoTrainerPokemonProfile + b _080F16E6 +_080F164C: + bl DoTVShowBravoTrainerBattleTower + b _080F16E6 +_080F1652: + bl DoTVShowPokemonTodaySuccessfulCapture + b _080F16E6 +_080F1658: + bl DoTVShowTodaysSmartShopper + b _080F16E6 +_080F165E: + bl DoTVShowTheNameRaterShow + b _080F16E6 +_080F1664: + bl DoTVShowPokemonContestLiveUpdates + b _080F16E6 +_080F166A: + bl DoTVShowPokemonBattleUpdate + b _080F16E6 +_080F1670: + bl DoTVShow3CheersForPokeblocks + b _080F16E6 +_080F1676: + bl DoTVShowPokemonTodayFailedCapture + b _080F16E6 +_080F167C: + bl DoTVShowPokemonAngler + b _080F16E6 +_080F1682: + bl DoTVShowTheWorldOfMasters + b _080F16E6 +_080F1688: + bl DoTVShowTodaysRivalTrainer + b _080F16E6 +_080F168E: + bl DoTVShowDewfordTrendWatcherNetwork + b _080F16E6 +_080F1694: + bl DoTVShowHoennTreasureInvestigators + b _080F16E6 +_080F169A: + bl DoTVShowFindThatGamer + b _080F16E6 +_080F16A0: + bl DoTVShowBreakingNewsTV + b _080F16E6 +_080F16A6: + bl DoTVShowSecretBaseVisit + b _080F16E6 +_080F16AC: + bl DoTVShowPokemonLotterWinnerFlashReport + b _080F16E6 +_080F16B2: + bl DoTVShowThePokemonBattleSeminar + b _080F16E6 +_080F16B8: + bl DoTVShowTrainerFanClubSpecial + b _080F16E6 +_080F16BE: + bl DoTVShowTrainerFanClub + b _080F16E6 +_080F16C4: + bl DoTVShowSpotTheCuties + b _080F16E6 +_080F16CA: + bl DoTVShowPokemonNewsBattleFrontier + b _080F16E6 +_080F16D0: + bl DoTVShowWhatsNo1InHoennToday + b _080F16E6 +_080F16D6: + bl DoTVShowSecretBaseSecrets + b _080F16E6 +_080F16DC: + bl DoTVShowSafariFanClub + b _080F16E6 +_080F16E2: + bl DoTVShowPokemonContestLiveUpdates2 +_080F16E6: + pop {r0} + bx r0 + thumb_func_end sub_80F153C + + thumb_func_start DoTVShowBravoTrainerPokemonProfile +DoTVShowBravoTrainerPokemonProfile: @ 80F16EC + push {r4,r5,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r5, [r0] + cmp r5, 0x8 + bls _080F1712 + b _080F1952 +_080F1712: + lsls r0, r5, 2 + ldr r1, =_080F1734 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F1734: + .4byte _080F1758 + .4byte _080F17B0 + .4byte _080F17E8 + .4byte _080F1818 + .4byte _080F184C + .4byte _080F1880 + .4byte _080F18C4 + .4byte _080F190C + .4byte _080F193C +_080F1758: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x16 + ldrb r2, [r4, 0x1E] + bl sub_81DB5E8 + ldrb r1, [r4, 0x13] + lsls r1, 29 + lsrs r1, 29 + movs r0, 0x1 + bl CopyContestCategoryToStringVar + ldrb r1, [r4, 0x13] + lsls r1, 27 + lsrs r1, 30 + movs r0, 0x2 + bl sub_80EF1BC + ldrh r1, [r4, 0x2] + movs r0, 0xB + muls r0, r1 + ldr r1, =gSpeciesNames + adds r0, r1 + adds r1, r4, 0 + adds r1, 0x8 + bl CompareString + cmp r0, 0 + bne _080F17A4 + ldr r1, =0x0203a030 + movs r0, 0x8 + b _080F1950 + .pool +_080F17A4: + ldr r1, =0x0203a030 + movs r0, 0x1 + b _080F1950 + .pool +_080F17B0: + ldr r0, =0x02021cc4 + ldrh r2, [r4, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021dc4 + adds r1, r4, 0 + adds r1, 0x8 + ldrb r2, [r4, 0x1F] + bl sub_81DB5E8 + ldrb r1, [r4, 0x13] + lsls r1, 29 + lsrs r1, 29 + movs r0, 0x2 + bl CopyContestCategoryToStringVar + b _080F194C + .pool +_080F17E8: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x16 + ldrb r2, [r4, 0x1E] + bl sub_81DB5E8 + ldrb r1, [r4, 0x13] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + bne _080F180C + ldr r1, =0x0203a030 + movs r0, 0x3 + b _080F1950 + .pool +_080F180C: + ldr r1, =0x0203a030 + movs r0, 0x4 + b _080F1950 + .pool +_080F1818: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x16 + ldrb r2, [r4, 0x1E] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r1, [r4, 0x4] + bl CopyEasyChatWord + ldrb r1, [r4, 0x13] + lsls r1, 25 + lsrs r1, 30 + adds r1, 0x1 + movs r0, 0x2 + bl sub_80EF340 + ldr r1, =0x0203a030 + movs r0, 0x5 + b _080F1950 + .pool +_080F184C: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x16 + ldrb r2, [r4, 0x1E] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r1, [r4, 0x4] + bl CopyEasyChatWord + ldrb r1, [r4, 0x13] + lsls r1, 25 + lsrs r1, 30 + adds r1, 0x1 + movs r0, 0x2 + bl sub_80EF340 + ldr r1, =0x0203a030 + movs r0, 0x5 + b _080F1950 + .pool +_080F1880: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x16 + ldrb r2, [r4, 0x1E] + bl sub_81DB5E8 + ldrb r1, [r4, 0x13] + lsls r1, 29 + lsrs r1, 29 + movs r0, 0x1 + bl CopyContestCategoryToStringVar + ldr r0, =0x02021ec4 + ldrh r1, [r4, 0x6] + bl CopyEasyChatWord + ldrh r0, [r4, 0x14] + cmp r0, 0 + beq _080F18B8 + ldr r1, =0x0203a030 + movs r0, 0x6 + b _080F1950 + .pool +_080F18B8: + ldr r1, =0x0203a030 + movs r0, 0x7 + b _080F1950 + .pool +_080F18C4: + ldr r0, =0x02021cc4 + ldrh r2, [r4, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021dc4 + ldrh r2, [r4, 0x14] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021ec4 + ldrh r1, [r4, 0x6] + bl CopyEasyChatWord + ldr r1, =0x0203a030 + movs r0, 0x7 + b _080F1950 + .pool +_080F190C: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x16 + ldrb r2, [r4, 0x1E] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r4, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + bl TVShowDone + b _080F1952 + .pool +_080F193C: + ldr r0, =0x02021cc4 + ldrh r2, [r4, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString +_080F194C: + ldr r1, =0x0203a030 + movs r0, 0x2 +_080F1950: + strb r0, [r1] +_080F1952: + ldr r0, =gUnknown_0858D204 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowBravoTrainerPokemonProfile + + thumb_func_start DoTVShowBravoTrainerBattleTower +DoTVShowBravoTrainerBattleTower: @ 80F1974 + push {r4,r5,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r5, [r0] + adds r2, r0, 0 + cmp r5, 0xE + bls _080F199C + b _080F1BEA +_080F199C: + lsls r0, r5, 2 + ldr r1, =_080F19C0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F19C0: + .4byte _080F19FC + .4byte _080F1A40 + .4byte _080F1A90 + .4byte _080F1AB4 + .4byte _080F1AE0 + .4byte _080F1B28 + .4byte _080F1B38 + .4byte _080F1B48 + .4byte _080F1B4E + .4byte _080F1B4E + .4byte _080F1B4E + .4byte _080F1B68 + .4byte _080F1B94 + .4byte _080F1B94 + .4byte _080F1BCC +_080F19FC: + ldr r0, =0x02021cc4 + adds r1, r4, 0x2 + ldrb r2, [r4, 0x1D] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r4, 0xA] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldrh r0, [r4, 0x16] + cmp r0, 0x6 + bls _080F1A34 + ldr r1, =0x0203a030 + movs r0, 0x1 + strb r0, [r1] + b _080F1BEA + .pool +_080F1A34: + ldr r1, =0x0203a030 + movs r0, 0x2 + strb r0, [r1] + b _080F1BEA + .pool +_080F1A40: + ldrb r0, [r4, 0x1A] + cmp r0, 0x32 + bne _080F1A58 + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EAEB1 + bl CopyString + b _080F1A60 + .pool +_080F1A58: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EAEB8 + bl CopyString +_080F1A60: + ldrh r1, [r4, 0x16] + movs r0, 0x1 + bl sub_80EF340 + ldrb r0, [r4, 0x1C] + cmp r0, 0x1 + bne _080F1A84 + ldr r1, =0x0203a030 + movs r0, 0x3 + strb r0, [r1] + b _080F1BEA + .pool +_080F1A84: + ldr r1, =0x0203a030 + movs r0, 0x4 + strb r0, [r1] + b _080F1BEA + .pool +_080F1A90: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x1E] + bl sub_81DB5E8 + ldrh r1, [r4, 0x16] + adds r1, 0x1 + movs r0, 0x1 + bl sub_80EF340 +_080F1AA6: + ldrb r0, [r4, 0x1B] + cmp r0, 0 + beq _080F1B02 + b _080F1B1C + .pool +_080F1AB4: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x1E] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r4, 0x14] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + b _080F1AA6 + .pool +_080F1AE0: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x1E] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r4, 0x14] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldrb r0, [r4, 0x1B] + cmp r0, 0 + bne _080F1B1C +_080F1B02: + ldr r1, =0x0203a030 + movs r0, 0x5 + strb r0, [r1] + b _080F1BEA + .pool +_080F1B1C: + ldr r1, =0x0203a030 + movs r0, 0x6 + strb r0, [r1] + b _080F1BEA + .pool +_080F1B28: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x1E] + b _080F1B54 + .pool +_080F1B38: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x1E] + b _080F1B54 + .pool +_080F1B48: + movs r0, 0xB + strb r0, [r2] + b _080F1BEA +_080F1B4E: + ldr r0, =0x02021cc4 + adds r1, r4, 0x2 + ldrb r2, [r4, 0x1D] +_080F1B54: + bl sub_81DB5E8 + ldr r1, =0x0203a030 + movs r0, 0xB + strb r0, [r1] + b _080F1BEA + .pool +_080F1B68: + ldr r0, =0x02021cc4 + ldrh r1, [r4, 0x18] + bl CopyEasyChatWord + ldrb r0, [r4, 0x1B] + cmp r0, 0 + bne _080F1B88 + ldr r1, =0x0203a030 + movs r0, 0xC + strb r0, [r1] + b _080F1BEA + .pool +_080F1B88: + ldr r1, =0x0203a030 + movs r0, 0xD + strb r0, [r1] + b _080F1BEA + .pool +_080F1B94: + ldr r0, =0x02021cc4 + ldrh r1, [r4, 0x18] + bl CopyEasyChatWord + ldr r0, =0x02021dc4 + adds r1, r4, 0x2 + ldrb r2, [r4, 0x1D] + bl sub_81DB5E8 + ldr r0, =0x02021ec4 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x1E] + bl sub_81DB5E8 + ldr r1, =0x0203a030 + movs r0, 0xE + strb r0, [r1] + b _080F1BEA + .pool +_080F1BCC: + ldr r0, =0x02021cc4 + adds r1, r4, 0x2 + ldrb r2, [r4, 0x1D] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r4, 0xA] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + bl TVShowDone +_080F1BEA: + ldr r0, =gUnknown_0858D240 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowBravoTrainerBattleTower + + thumb_func_start DoTVShowTodaysSmartShopper +DoTVShowTodaysSmartShopper: @ 80F1C0C + push {r4-r6,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r5, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r6, [r0] + adds r2, r0, 0 + cmp r6, 0xC + bls _080F1C34 + b _080F1E2C +_080F1C34: + lsls r0, r6, 2 + ldr r1, =_080F1C58 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F1C58: + .4byte _080F1C8C + .4byte _080F1CC8 + .4byte _080F1D10 + .4byte _080F1D22 + .4byte _080F1D10 + .4byte _080F1D10 + .4byte _080F1D4C + .4byte _080F1D7C + .4byte _080F1DAC + .4byte _080F1DB8 + .4byte _080F1DC6 + .4byte _080F1DD8 + .4byte _080F1E1C +_080F1C8C: + ldr r0, =0x02021cc4 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x3] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrb r1, [r5, 0x12] + movs r2, 0 + bl GetMapName + ldrh r0, [r5, 0xC] + cmp r0, 0xFE + bls _080F1CBC + ldr r1, =0x0203a030 + movs r0, 0xB + strb r0, [r1] + b _080F1E2C + .pool +_080F1CBC: + ldr r1, =0x0203a030 + movs r0, 0x1 + strb r0, [r1] + b _080F1E2C + .pool +_080F1CC8: + ldr r0, =0x02021cc4 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x3] + bl sub_81DB5E8 + ldr r4, =0x02021dc4 + ldrh r0, [r5, 0x6] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + ldrh r1, [r5, 0xC] + movs r0, 0x2 + bl sub_80EF340 + ldr r4, =0x0203a030 + bl GenerateRandomNumber + ldrb r2, [r4] + adds r2, 0x1 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + ands r0, r1 + adds r0, r2 + strb r0, [r4] + b _080F1E2C + .pool +_080F1D10: + ldrh r0, [r5, 0x8] + cmp r0, 0 + beq _080F1D1C + movs r0, 0x6 + strb r0, [r2] + b _080F1E2C +_080F1D1C: + movs r0, 0xA + strb r0, [r2] + b _080F1E2C +_080F1D22: + ldrh r1, [r5, 0xC] + adds r1, 0x1 + movs r0, 0x2 + bl sub_80EF340 + ldrh r0, [r5, 0x8] + cmp r0, 0 + beq _080F1D40 + ldr r1, =0x0203a030 + movs r0, 0x6 + strb r0, [r1] + b _080F1E2C + .pool +_080F1D40: + ldr r1, =0x0203a030 + movs r0, 0xA + strb r0, [r1] + b _080F1E2C + .pool +_080F1D4C: + ldr r4, =0x02021dc4 + ldrh r0, [r5, 0x8] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + ldrh r1, [r5, 0xE] + movs r0, 0x2 + bl sub_80EF340 + ldrh r0, [r5, 0xA] + cmp r0, 0 + beq _080F1D94 + ldr r1, =0x0203a030 + movs r0, 0x7 + strb r0, [r1] + b _080F1E2C + .pool +_080F1D7C: + ldr r4, =0x02021dc4 + ldrh r0, [r5, 0xA] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + ldrh r1, [r5, 0x10] + movs r0, 0x2 + bl sub_80EF340 +_080F1D94: + ldrb r0, [r5, 0x2] + cmp r0, 0x1 + beq _080F1DFA + ldr r1, =0x0203a030 + movs r0, 0x9 + strb r0, [r1] + b _080F1E2C + .pool +_080F1DAC: + ldrh r0, [r5, 0xC] + cmp r0, 0xFE + bls _080F1DD2 + movs r0, 0xC + strb r0, [r2] + b _080F1E2C +_080F1DB8: + movs r0, 0x1 + adds r1, r5, 0 + bl sub_80EF40C + bl TVShowDone + b _080F1E2C +_080F1DC6: + ldrb r0, [r5, 0x2] + cmp r0, 0x1 + bne _080F1DD2 + movs r0, 0x8 + strb r0, [r2] + b _080F1E2C +_080F1DD2: + movs r0, 0x9 + strb r0, [r2] + b _080F1E2C +_080F1DD8: + ldr r0, =0x02021cc4 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x3] + bl sub_81DB5E8 + ldr r4, =0x02021dc4 + ldrh r0, [r5, 0x6] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + ldrb r0, [r5, 0x2] + cmp r0, 0x1 + bne _080F1E10 +_080F1DFA: + ldr r1, =0x0203a030 + movs r0, 0x8 + strb r0, [r1] + b _080F1E2C + .pool +_080F1E10: + ldr r1, =0x0203a030 + movs r0, 0xC + strb r0, [r1] + b _080F1E2C + .pool +_080F1E1C: + ldr r0, =0x02021cc4 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x3] + bl sub_81DB5E8 + bl TVShowDone +_080F1E2C: + ldr r0, =gUnknown_0858D1D0 + lsls r1, r6, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowTodaysSmartShopper + + thumb_func_start DoTVShowTheNameRaterShow +DoTVShowTheNameRaterShow: @ 80F1E48 + push {r4-r6,lr} + sub sp, 0x8 + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r5, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r6, [r0] + adds r2, r0, 0 + cmp r6, 0x12 + bls _080F1E72 + b _080F20FE +_080F1E72: + lsls r0, r6, 2 + ldr r1, =_080F1E94 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F1E94: + .4byte _080F1EE0 + .4byte _080F1F28 + .4byte _080F1F4A + .4byte _080F1F28 + .4byte _080F1F28 + .4byte _080F1F28 + .4byte _080F1F28 + .4byte _080F1F28 + .4byte _080F1F28 + .4byte _080F1F90 + .4byte _080F1F90 + .4byte _080F1F90 + .4byte _080F20EC + .4byte _080F1FCC + .4byte _080F200C + .4byte _080F202C + .4byte _080F2074 + .4byte _080F20A4 + .4byte _080F20F0 +_080F1EE0: + ldr r0, =0x02021cc4 + adds r1, r5, 0 + adds r1, 0xF + ldrb r2, [r5, 0x1E] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r5, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021ec4 + adds r1, r5, 0x4 + ldrb r2, [r5, 0x1F] + bl sub_81DB5E8 + ldr r4, =0x0203a030 + adds r0, r5, 0 + bl sub_80EFBA4 + adds r0, 0x1 + strb r0, [r4] + b _080F20FE + .pool +_080F1F28: + ldrb r0, [r5, 0x1A] + cmp r0, 0 + bne _080F1F34 + movs r0, 0x9 + strb r0, [r2] + b _080F20FE +_080F1F34: + cmp r0, 0x1 + bne _080F1F3E + movs r0, 0xA + strb r0, [r2] + b _080F20FE +_080F1F3E: + cmp r0, 0x2 + beq _080F1F44 + b _080F20FE +_080F1F44: + movs r0, 0xB + strb r0, [r2] + b _080F20FE +_080F1F4A: + ldr r0, =0x02021cc4 + adds r1, r5, 0 + adds r1, 0xF + ldrb r2, [r5, 0x1E] + bl sub_81DB5E8 + ldrb r0, [r5, 0x1A] + cmp r0, 0 + bne _080F1F6C + ldr r1, =0x0203a030 + movs r0, 0x9 + strb r0, [r1] + b _080F20FE + .pool +_080F1F6C: + cmp r0, 0x1 + bne _080F1F7C + ldr r1, =0x0203a030 + movs r0, 0xA + strb r0, [r1] + b _080F20FE + .pool +_080F1F7C: + cmp r0, 0x2 + beq _080F1F82 + b _080F20FE +_080F1F82: + ldr r1, =0x0203a030 + movs r0, 0xB + strb r0, [r1] + b _080F20FE + .pool +_080F1F90: + ldr r0, =0x02021cc4 + adds r1, r5, 0x4 + ldrb r2, [r5, 0x1F] + bl sub_81DB5E8 + movs r4, 0 + str r4, [sp] + str r5, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_80EFBDC + str r4, [sp] + str r5, [sp, 0x4] + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + movs r3, 0x1 + bl sub_80EFBDC + ldr r1, =0x0203a030 + movs r0, 0xC + strb r0, [r1] + b _080F20FE + .pool +_080F1FCC: + ldr r0, =0x02021cc4 + adds r1, r5, 0 + adds r1, 0xF + ldrb r2, [r5, 0x1E] + bl sub_81DB5E8 + movs r4, 0 + str r4, [sp] + str r5, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0x2 + movs r3, 0 + bl sub_80EFBDC + str r4, [sp] + str r5, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0x3 + movs r3, 0x1 + bl sub_80EFBDC + ldr r1, =0x0203a030 + movs r0, 0xE + strb r0, [r1] + b _080F20FE + .pool +_080F200C: + movs r4, 0 + str r4, [sp] + str r5, [sp, 0x4] + movs r0, 0x1 + movs r1, 0 + movs r2, 0x2 + movs r3, 0x1 + bl sub_80EFBDC + str r4, [sp] + str r5, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0x3 + movs r3, 0 + b _080F20D2 +_080F202C: + movs r0, 0 + str r0, [sp] + str r5, [sp, 0x4] + movs r1, 0 + movs r2, 0x2 + movs r3, 0x1 + bl sub_80EFBDC + ldr r0, =0x02021dc4 + ldrh r2, [r5, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldrh r0, [r5, 0x2] + str r0, [sp] + str r5, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0x3 + movs r3, 0x2 + bl sub_80EFBDC + ldr r1, =0x0203a030 + movs r0, 0x10 + strb r0, [r1] + b _080F20FE + .pool +_080F2074: + ldrh r0, [r5, 0x2] + str r0, [sp] + str r5, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0x2 + movs r3, 0x2 + bl sub_80EFBDC + movs r0, 0 + str r0, [sp] + str r5, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0x3 + movs r3, 0x1 + bl sub_80EFBDC + ldr r1, =0x0203a030 + movs r0, 0x11 + strb r0, [r1] + b _080F20FE + .pool +_080F20A4: + movs r0, 0 + str r0, [sp] + str r5, [sp, 0x4] + movs r1, 0 + movs r2, 0x2 + movs r3, 0x1 + bl sub_80EFBDC + ldr r0, =0x02021dc4 + ldrh r2, [r5, 0x1C] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldrh r0, [r5, 0x1C] + str r0, [sp] + str r5, [sp, 0x4] + movs r0, 0x2 + movs r1, 0 + movs r2, 0x3 + movs r3, 0x2 +_080F20D2: + bl sub_80EFBDC + ldr r1, =0x0203a030 + movs r0, 0x12 + strb r0, [r1] + b _080F20FE + .pool +_080F20EC: + movs r6, 0x12 + strb r6, [r2] +_080F20F0: + ldr r0, =0x02021cc4 + adds r1, r5, 0x4 + ldrb r2, [r5, 0x1F] + bl sub_81DB5E8 + bl TVShowDone +_080F20FE: + ldr r0, =gUnknown_0858D338 + lsls r1, r6, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowTheNameRaterShow + + thumb_func_start DoTVShowPokemonTodaySuccessfulCapture +DoTVShowPokemonTodaySuccessfulCapture: @ 80F211C + push {r4-r6,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r5, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r6, [r0] + adds r2, r0, 0 + cmp r6, 0xB + bls _080F2144 + b _080F2358 +_080F2144: + lsls r0, r6, 2 + ldr r1, =_080F2168 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F2168: + .4byte _080F2198 + .4byte _080F21EC + .4byte _080F21F2 + .4byte _080F222C + .4byte _080F2264 + .4byte _080F226A + .4byte _080F22A0 + .4byte _080F22F4 + .4byte _080F22F4 + .4byte _080F2324 + .4byte _080F2324 + .4byte _080F2354 +_080F2198: + ldr r0, =0x02021cc4 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x2] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r5, 0x10] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021ec4 + adds r1, r5, 0x4 + ldrb r2, [r5, 0x3] + bl sub_81DB5E8 + ldrb r0, [r5, 0xF] + cmp r0, 0x1 + bne _080F21E0 + ldr r1, =0x0203a030 + movs r0, 0x5 + strb r0, [r1] + b _080F2358 + .pool +_080F21E0: + ldr r1, =0x0203a030 + movs r0, 0x1 + strb r0, [r1] + b _080F2358 + .pool +_080F21EC: + movs r0, 0x2 + strb r0, [r2] + b _080F2358 +_080F21F2: + ldr r4, =0x02021dc4 + ldrb r0, [r5, 0xF] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + ldrb r1, [r5, 0x12] + movs r0, 0x2 + bl sub_80EF340 + ldrb r0, [r5, 0x12] + cmp r0, 0x3 + bhi _080F2220 + ldr r1, =0x0203a030 + movs r0, 0x3 + strb r0, [r1] + b _080F2358 + .pool +_080F2220: + ldr r1, =0x0203a030 + movs r0, 0x4 + strb r0, [r1] + b _080F2358 + .pool +_080F222C: + ldr r0, =0x02021cc4 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x2] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r5, 0x10] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021ec4 + adds r1, r5, 0x4 + ldrb r2, [r5, 0x3] + bl sub_81DB5E8 + b _080F2286 + .pool +_080F2264: + movs r0, 0x6 + strb r0, [r2] + b _080F2358 +_080F226A: + ldr r0, =0x02021cc4 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x2] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r5, 0x10] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString +_080F2286: + ldr r1, =0x0203a030 + movs r0, 0x6 + strb r0, [r1] + b _080F2358 + .pool +_080F22A0: + ldr r0, =0x02021cc4 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x2] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r5, 0x10] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021ec4 + adds r1, r5, 0x4 + ldrb r2, [r5, 0x3] + bl sub_81DB5E8 + ldr r4, =0x0203a030 + bl GenerateRandomNumber + ldrb r2, [r4] + adds r2, 0x1 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + ands r0, r1 + adds r0, r2 + strb r0, [r4] + b _080F2358 + .pool +_080F22F4: + ldr r0, =0x02021cc4 + ldrh r1, [r5, 0x10] + movs r4, 0xB + muls r1, r4 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021dc4 + adds r1, r5, 0x4 + ldrb r2, [r5, 0x3] + bl sub_81DB5E8 + ldrh r1, [r5, 0x10] + movs r0, 0x2 + bl sub_80EF9E8 + b _080F233E + .pool +_080F2324: + ldr r0, =0x02021cc4 + ldrh r1, [r5, 0x10] + movs r4, 0xB + muls r1, r4 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021dc4 + adds r1, r5, 0x4 + ldrb r2, [r5, 0x3] + bl sub_81DB5E8 +_080F233E: + ldr r0, =0x0203a030 + strb r4, [r0] + b _080F2358 + .pool +_080F2354: + bl TVShowDone +_080F2358: + ldr r0, =gUnknown_0858D1A0 + lsls r1, r6, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowPokemonTodaySuccessfulCapture + + thumb_func_start DoTVShowPokemonTodayFailedCapture +DoTVShowPokemonTodayFailedCapture: @ 80F2370 + push {r4,r5,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r5, [r0] + cmp r5, 0x6 + bls _080F2396 + b _080F24C0 +_080F2396: + lsls r0, r5, 2 + ldr r1, =_080F23B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F23B8: + .4byte _080F23D4 + .4byte _080F2408 + .4byte _080F245C + .4byte _080F245C + .4byte _080F24A0 + .4byte _080F24A0 + .4byte _080F24BC +_080F23D4: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x2] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r4, 0xC] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r1, =0x0203a030 + movs r0, 0x1 + strb r0, [r1] + b _080F24C0 + .pool +_080F2408: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x2] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrb r1, [r4, 0x12] + movs r2, 0 + bl GetMapName + ldr r0, =0x02021ec4 + ldrh r2, [r4, 0xE] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldrb r0, [r4, 0x11] + cmp r0, 0x1 + bne _080F2450 + ldr r1, =0x0203a030 + movs r0, 0x3 + strb r0, [r1] + b _080F24C0 + .pool +_080F2450: + ldr r1, =0x0203a030 + movs r0, 0x2 + strb r0, [r1] + b _080F24C0 + .pool +_080F245C: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x2] + bl sub_81DB5E8 + ldrb r1, [r4, 0x10] + movs r0, 0x1 + bl sub_80EF340 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + bne _080F2494 + ldr r1, =0x0203a030 + movs r0, 0x5 + strb r0, [r1] + b _080F24C0 + .pool +_080F2494: + ldr r1, =0x0203a030 + movs r0, 0x4 + strb r0, [r1] + b _080F24C0 + .pool +_080F24A0: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x2] + bl sub_81DB5E8 + ldr r1, =0x0203a030 + movs r0, 0x6 + strb r0, [r1] + b _080F24C0 + .pool +_080F24BC: + bl TVShowDone +_080F24C0: + ldr r0, =gUnknown_0858D394 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowPokemonTodayFailedCapture + + thumb_func_start DoTVShowPokemonFanClubLetter +DoTVShowPokemonFanClubLetter: @ 80F24D8 + push {r4-r7,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r5, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r7, [r0] + adds r6, r0, 0 + cmp r7, 0x33 + bls _080F2500 + b _080F26F0 +_080F2500: + lsls r0, r7, 2 + ldr r1, =_080F2524 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F2524: + .4byte _080F25F4 + .4byte _080F2628 + .4byte _080F2654 + .4byte _080F265A + .4byte _080F2672 + .4byte _080F2672 + .4byte _080F2672 + .4byte _080F2684 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26F0 + .4byte _080F26A6 + .4byte _080F26CC +_080F25F4: + ldr r0, =0x02021cc4 + adds r1, r5, 0 + adds r1, 0x10 + ldrb r2, [r5, 0x18] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r5, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r1, =0x0203a030 + movs r0, 0x32 + strb r0, [r1] + b _080F26F0 + .pool +_080F2628: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + ands r0, r1 + adds r2, r0, 0x1 + cmp r2, 0x1 + bne _080F2648 + ldr r1, =0x0203a030 + movs r0, 0x2 + strb r0, [r1] + b _080F26F0 + .pool +_080F2648: + ldr r1, =0x0203a030 + adds r0, r2, 0x2 + strb r0, [r1] + b _080F26F0 + .pool +_080F2654: + movs r0, 0x33 + strb r0, [r6] + b _080F26F0 +_080F265A: + bl GenerateRandomNumber + ldrb r4, [r6] + adds r4, 0x1 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + adds r0, r4 + strb r0, [r6] + b _080F26F0 +_080F2672: + adds r0, r5, 0 + bl sub_80EFB58 + ldr r1, =0x0203a030 + movs r0, 0x7 + strb r0, [r1] + b _080F26F0 + .pool +_080F2684: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1F + bl __umodsi3 + adds r0, 0x46 + lsls r0, 16 + lsrs r2, r0, 16 + movs r0, 0x2 + adds r1, r2, 0 + bl sub_80EF340 + bl TVShowDone + b _080F26F0 +_080F26A6: + ldr r4, =0x02021fc4 + adds r1, r5, 0x4 + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertEasyChatWordsToString + adds r0, r4, 0 + bl box_related_two__2 + ldr r1, =0x0203a030 + movs r0, 0x1 + strb r0, [r1] + b _080F26FC + .pool +_080F26CC: + ldr r4, =0x02021fc4 + adds r1, r5, 0x4 + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertEasyChatWordsToString + adds r0, r4, 0 + bl box_related_two__2 + ldr r1, =0x0203a030 + movs r0, 0x3 + strb r0, [r1] + b _080F26FC + .pool +_080F26F0: + ldr r0, =gUnknown_0858D150 + lsls r1, r7, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 +_080F26FC: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowPokemonFanClubLetter + + thumb_func_start DoTVShowRecentHappenings +DoTVShowRecentHappenings: @ 80F2708 + push {r4-r7,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r5, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r6, [r0] + adds r7, r0, 0 + cmp r6, 0x32 + bls _080F2730 + b _080F288C +_080F2730: + lsls r0, r6, 2 + ldr r1, =_080F2754 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F2754: + .4byte _080F2820 + .4byte _080F2844 + .4byte _080F285C + .4byte _080F285C + .4byte _080F285C + .4byte _080F2862 + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F288C + .4byte _080F2868 +_080F2820: + ldr r0, =0x02021cc4 + adds r1, r5, 0 + adds r1, 0x10 + ldrb r2, [r5, 0x18] + bl sub_81DB5E8 + adds r0, r5, 0 + bl sub_80EFB58 + ldr r1, =0x0203a030 + movs r0, 0x32 + strb r0, [r1] + b _080F288C + .pool +_080F2844: + bl GenerateRandomNumber + ldrb r4, [r7] + adds r4, 0x1 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + adds r0, r4 + strb r0, [r7] + b _080F288C +_080F285C: + movs r0, 0x5 + strb r0, [r7] + b _080F288C +_080F2862: + bl TVShowDone + b _080F288C +_080F2868: + ldr r4, =0x02021fc4 + adds r1, r5, 0x4 + adds r0, r4, 0 + movs r2, 0x2 + movs r3, 0x2 + bl ConvertEasyChatWordsToString + adds r0, r4, 0 + bl box_related_two__2 + ldr r1, =0x0203a030 + movs r0, 0x1 + strb r0, [r1] + b _080F2898 + .pool +_080F288C: + ldr r0, =gUnknown_0858D170 + lsls r1, r6, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 +_080F2898: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowRecentHappenings + + thumb_func_start DoTVShowPokemonFanClubOpinions +DoTVShowPokemonFanClubOpinions: @ 80F28A4 + push {r4-r6,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r6, =0x0203a030 + ldrb r5, [r6] + cmp r5, 0x3 + bgt _080F28E8 + cmp r5, 0x1 + bge _080F2930 + cmp r5, 0 + beq _080F28EE + b _080F297E + .pool +_080F28E8: + cmp r5, 0x4 + beq _080F2968 + b _080F297E +_080F28EE: + ldr r0, =0x02021cc4 + adds r1, r4, 0x5 + ldrb r2, [r4, 0xD] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r4, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021ec4 + adds r1, r4, 0 + adds r1, 0x10 + ldrb r2, [r4, 0xE] + bl sub_81DB5E8 + ldrb r0, [r4, 0x4] + lsrs r0, 4 + adds r0, 0x1 + strb r0, [r6] + b _080F297E + .pool +_080F2930: + ldr r0, =0x02021cc4 + adds r1, r4, 0x5 + ldrb r2, [r4, 0xD] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r4, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021ec4 + ldrh r1, [r4, 0x1C] + bl CopyEasyChatWord + movs r0, 0x4 + strb r0, [r6] + b _080F297E + .pool +_080F2968: + ldr r0, =0x02021cc4 + adds r1, r4, 0x5 + ldrb r2, [r4, 0xD] + bl sub_81DB5E8 + ldr r0, =0x02021ec4 + ldrh r1, [r4, 0x1E] + bl CopyEasyChatWord + bl TVShowDone +_080F297E: + ldr r0, =gUnknown_0858D188 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowPokemonFanClubOpinions + + thumb_func_start DoTVShowDummiedOut +DoTVShowDummiedOut: @ 80F299C + bx lr + thumb_func_end DoTVShowDummiedOut + + thumb_func_start DoTVShowPokemonNewsMassOutbreak +DoTVShowPokemonNewsMassOutbreak: @ 80F29A0 + push {r4,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r4, [r2] + adds r4, r0 + ldr r0, =0x02021cc4 + ldrb r1, [r4, 0x10] + movs r2, 0 + bl GetMapName + ldr r0, =0x02021dc4 + ldrh r2, [r4, 0xC] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + bl TVShowDone + bl StartMassOutbreak + ldr r1, =gUnknown_0858D19C + ldr r0, =0x0203a030 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl box_related_two__2 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowPokemonNewsMassOutbreak + + thumb_func_start DoTVShowPokemonContestLiveUpdates +DoTVShowPokemonContestLiveUpdates: @ 80F2A10 + push {r4-r7,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r6, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r7, [r0] + adds r2, r0, 0 + cmp r7, 0x20 + bls _080F2A38 + b _080F311C +_080F2A38: + lsls r0, r7, 2 + ldr r1, =_080F2A5C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F2A5C: + .4byte _080F2AE0 + .4byte _080F2B54 + .4byte _080F2BA2 + .4byte _080F2BC8 + .4byte _080F2BF4 + .4byte _080F2D2C + .4byte _080F2D40 + .4byte _080F2D54 + .4byte _080F2D68 + .4byte _080F2DE8 + .4byte _080F2DFC + .4byte _080F2E10 + .4byte _080F2E24 + .4byte _080F2E38 + .4byte _080F2E4C + .4byte _080F2ECC + .4byte _080F2EE0 + .4byte _080F2EF4 + .4byte _080F2F08 + .4byte _080F2F1C + .4byte _080F2F30 + .4byte _080F2F44 + .4byte _080F2F58 + .4byte _080F2F94 + .4byte _080F3064 + .4byte _080F3080 + .4byte _080F30E0 + .4byte _080F30E0 + .4byte _080F30A8 + .4byte _080F30AE + .4byte _080F30E0 + .4byte _080F30E0 + .4byte _080F30FC +_080F2AE0: + ldr r0, =0x02021cc4 + ldrb r1, [r6, 0x1C] + bl sub_818E868 + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021ec4 + adds r1, r6, 0 + adds r1, 0x14 + ldrb r2, [r6, 0x1D] + bl sub_81DB5E8 + ldrb r0, [r6, 0xD] + ldrb r1, [r6, 0xE] + cmp r0, r1 + bne _080F2B38 + cmp r0, 0 + bne _080F2B2C + ldr r1, =0x0203a030 + movs r0, 0x1 + strb r0, [r1] + b _080F311C + .pool +_080F2B2C: + ldr r1, =0x0203a030 + movs r0, 0x3 + strb r0, [r1] + b _080F311C + .pool +_080F2B38: + cmp r0, r1 + bls _080F2B48 + ldr r1, =0x0203a030 + movs r0, 0x2 + strb r0, [r1] + b _080F311C + .pool +_080F2B48: + ldr r1, =0x0203a030 + movs r0, 0x4 + strb r0, [r1] + b _080F311C + .pool +_080F2B54: + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldrb r1, [r6, 0xF] + cmp r1, 0x8 + bne _080F2B6C + b _080F2CF0 +_080F2B6C: + cmp r1, 0x8 + bgt _080F2B88 +_080F2B70: + cmp r1, 0x2 + bne _080F2B76 + b _080F2CD8 +_080F2B76: + cmp r1, 0x2 + bgt _080F2B7C + b _080F2C96 +_080F2B7C: + b _080F2CAC + .pool +_080F2B88: + cmp r1, 0x20 + bne _080F2B8E + b _080F2D08 +_080F2B8E: + cmp r1, 0x20 + bgt _080F2B94 + b _080F2CBA +_080F2B94: + cmp r1, 0x40 + bne _080F2B9A + b _080F2D14 +_080F2B9A: + cmp r1, 0x80 + beq _080F2BA0 + b _080F311C +_080F2BA0: + b _080F2D20 +_080F2BA2: + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString +_080F2BB2: + ldrb r1, [r6, 0xF] + cmp r1, 0x8 + bne _080F2BBA + b _080F2CF0 +_080F2BBA: + cmp r1, 0x8 + ble _080F2B70 + b _080F2B88 + .pool +_080F2BC8: + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021ec4 + adds r1, r6, 0 + adds r1, 0x14 + ldrb r2, [r6, 0x1D] + bl sub_81DB5E8 + b _080F2BB2 + .pool +_080F2BF4: + ldrb r0, [r6, 0x1C] + cmp r0, 0x4 + bhi _080F2C74 + lsls r0, 2 + ldr r1, =_080F2C08 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F2C08: + .4byte _080F2C1C + .4byte _080F2C30 + .4byte _080F2C44 + .4byte _080F2C58 + .4byte _080F2C6C +_080F2C1C: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EB0E8 + bl CopyString + b _080F2C74 + .pool +_080F2C30: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EB0ED + bl CopyString + b _080F2C74 + .pool +_080F2C44: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EB0F4 + bl CopyString + b _080F2C74 + .pool +_080F2C58: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EB0F9 + bl CopyString + b _080F2C74 + .pool +_080F2C6C: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085EB0FF + bl CopyString +_080F2C74: + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldrb r1, [r6, 0xF] + cmp r1, 0x8 + beq _080F2CF0 + cmp r1, 0x8 + bgt _080F2CB2 + cmp r1, 0x2 + beq _080F2CD8 + cmp r1, 0x2 + bgt _080F2CAC +_080F2C96: + cmp r1, 0x1 + beq _080F2CCA + b _080F311C + .pool +_080F2CAC: + cmp r1, 0x4 + beq _080F2CE4 + b _080F311C +_080F2CB2: + cmp r1, 0x20 + beq _080F2D08 + cmp r1, 0x20 + bgt _080F2CC0 +_080F2CBA: + cmp r1, 0x10 + beq _080F2CFC + b _080F311C +_080F2CC0: + cmp r1, 0x40 + beq _080F2D14 + cmp r1, 0x80 + beq _080F2D20 + b _080F311C +_080F2CCA: + ldr r1, =0x0203a030 + movs r0, 0x8 + strb r0, [r1] + b _080F311C + .pool +_080F2CD8: + ldr r1, =0x0203a030 + movs r0, 0x5 + strb r0, [r1] + b _080F311C + .pool +_080F2CE4: + ldr r1, =0x0203a030 + movs r0, 0xE + strb r0, [r1] + b _080F311C + .pool +_080F2CF0: + ldr r1, =0x0203a030 + movs r0, 0x7 + strb r0, [r1] + b _080F311C + .pool +_080F2CFC: + ldr r1, =0x0203a030 + movs r0, 0x6 + strb r0, [r1] + b _080F311C + .pool +_080F2D08: + ldr r1, =0x0203a030 + movs r0, 0x14 + strb r0, [r1] + b _080F311C + .pool +_080F2D14: + ldr r1, =0x0203a030 + movs r0, 0x15 + strb r0, [r1] + b _080F311C + .pool +_080F2D20: + ldr r1, =0x0203a030 + movs r0, 0x16 + strb r0, [r1] + b _080F311C + .pool +_080F2D2C: + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + b _080F2F72 + .pool +_080F2D40: + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + b _080F2F72 + .pool +_080F2D54: + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + b _080F2F72 + .pool +_080F2D68: + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldrb r0, [r6, 0x1C] + cmp r0, 0x4 + bls _080F2D80 + b _080F311C +_080F2D80: + lsls r0, 2 + ldr r1, =_080F2D98 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F2D98: + .4byte _080F2DAC + .4byte _080F2DB8 + .4byte _080F2DC4 + .4byte _080F2DD0 + .4byte _080F2DDC +_080F2DAC: + ldr r1, =0x0203a030 + movs r0, 0x9 + strb r0, [r1] + b _080F311C + .pool +_080F2DB8: + ldr r1, =0x0203a030 + movs r0, 0xA + strb r0, [r1] + b _080F311C + .pool +_080F2DC4: + ldr r1, =0x0203a030 + movs r0, 0xB + strb r0, [r1] + b _080F311C + .pool +_080F2DD0: + ldr r1, =0x0203a030 + movs r0, 0xC + strb r0, [r1] + b _080F311C + .pool +_080F2DDC: + ldr r1, =0x0203a030 + movs r0, 0xD + strb r0, [r1] + b _080F311C + .pool +_080F2DE8: + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + b _080F2F72 + .pool +_080F2DFC: + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + b _080F2F72 + .pool +_080F2E10: + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + b _080F2F72 + .pool +_080F2E24: + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + b _080F2F72 + .pool +_080F2E38: + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + b _080F2F72 + .pool +_080F2E4C: + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldrb r0, [r6, 0x1C] + cmp r0, 0x4 + bls _080F2E64 + b _080F311C +_080F2E64: + lsls r0, 2 + ldr r1, =_080F2E7C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F2E7C: + .4byte _080F2E90 + .4byte _080F2E9C + .4byte _080F2EA8 + .4byte _080F2EB4 + .4byte _080F2EC0 +_080F2E90: + ldr r1, =0x0203a030 + movs r0, 0xF + strb r0, [r1] + b _080F311C + .pool +_080F2E9C: + ldr r1, =0x0203a030 + movs r0, 0x10 + strb r0, [r1] + b _080F311C + .pool +_080F2EA8: + ldr r1, =0x0203a030 + movs r0, 0x11 + strb r0, [r1] + b _080F311C + .pool +_080F2EB4: + ldr r1, =0x0203a030 + movs r0, 0x12 + strb r0, [r1] + b _080F311C + .pool +_080F2EC0: + ldr r1, =0x0203a030 + movs r0, 0x13 + strb r0, [r1] + b _080F311C + .pool +_080F2ECC: + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + b _080F2F72 + .pool +_080F2EE0: + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + b _080F2F72 + .pool +_080F2EF4: + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + b _080F2F72 + .pool +_080F2F08: + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + b _080F2F72 + .pool +_080F2F1C: + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + b _080F2F72 + .pool +_080F2F30: + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + b _080F2F72 + .pool +_080F2F44: + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + b _080F2F72 + .pool +_080F2F58: + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021ec4 + ldrh r2, [r6, 0x10] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames +_080F2F72: + adds r1, r2 + bl CopyString + ldr r1, =0x0203a030 + movs r0, 0x17 + strb r0, [r1] + b _080F311C + .pool +_080F2F94: + ldr r0, =0x02021cc4 + ldrh r1, [r6, 0x12] + movs r5, 0xB + muls r1, r5 + ldr r4, =gSpeciesNames + adds r1, r4 + bl CopyString + ldr r0, =0x02021dc4 + adds r1, r6, 0x4 + ldrb r2, [r6, 0x1E] + bl sub_81DB5E8 + ldr r0, =0x02021ec4 + ldrh r1, [r6, 0x2] + muls r1, r5 + adds r1, r4 + bl CopyString + ldrb r0, [r6, 0xC] + cmp r0, 0x8 + beq _080F3028 + cmp r0, 0x8 + bgt _080F2FEA + cmp r0, 0x2 + beq _080F3010 + cmp r0, 0x2 + bgt _080F2FE4 + cmp r0, 0x1 + beq _080F3002 + b _080F311C + .pool +_080F2FE4: + cmp r0, 0x4 + beq _080F301C + b _080F311C +_080F2FEA: + cmp r0, 0x20 + beq _080F3040 + cmp r0, 0x20 + bgt _080F2FF8 + cmp r0, 0x10 + beq _080F3034 + b _080F311C +_080F2FF8: + cmp r0, 0x40 + beq _080F304C + cmp r0, 0x80 + beq _080F3058 + b _080F311C +_080F3002: + ldr r1, =0x0203a030 + movs r0, 0x1F + strb r0, [r1] + b _080F311C + .pool +_080F3010: + ldr r1, =0x0203a030 + movs r0, 0x1E + strb r0, [r1] + b _080F311C + .pool +_080F301C: + ldr r1, =0x0203a030 + movs r0, 0x1D + strb r0, [r1] + b _080F311C + .pool +_080F3028: + ldr r1, =0x0203a030 + movs r0, 0x1C + strb r0, [r1] + b _080F311C + .pool +_080F3034: + ldr r1, =0x0203a030 + movs r0, 0x1B + strb r0, [r1] + b _080F311C + .pool +_080F3040: + ldr r1, =0x0203a030 + movs r0, 0x1A + strb r0, [r1] + b _080F311C + .pool +_080F304C: + ldr r1, =0x0203a030 + movs r0, 0x19 + strb r0, [r1] + b _080F311C + .pool +_080F3058: + ldr r1, =0x0203a030 + movs r0, 0x18 + strb r0, [r1] + b _080F311C + .pool +_080F3064: + ldr r0, =0x02021cc4 + ldrh r2, [r6, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + b _080F30EA + .pool +_080F3080: + ldr r0, =0x02021cc4 + adds r1, r6, 0x4 + ldrb r2, [r6, 0x1E] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + b _080F30EA + .pool +_080F30A8: + movs r0, 0x20 + strb r0, [r2] + b _080F311C +_080F30AE: + ldr r0, =0x02021cc4 + adds r1, r6, 0 + adds r1, 0x14 + ldrb r2, [r6, 0x1D] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021ec4 + b _080F30E2 + .pool +_080F30E0: + ldr r0, =0x02021cc4 +_080F30E2: + adds r1, r6, 0x4 + ldrb r2, [r6, 0x1E] + bl sub_81DB5E8 +_080F30EA: + ldr r1, =0x0203a030 + movs r0, 0x20 + strb r0, [r1] + b _080F311C + .pool +_080F30FC: + ldr r0, =0x02021cc4 + adds r1, r6, 0 + adds r1, 0x14 + ldrb r2, [r6, 0x1D] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x12] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + bl TVShowDone +_080F311C: + ldr r0, =gUnknown_0858D27C + lsls r1, r7, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowPokemonContestLiveUpdates + + thumb_func_start DoTVShowPokemonBattleUpdate +DoTVShowPokemonBattleUpdate: @ 80F3140 + push {r4,r5,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r5, [r0] + adds r2, r0, 0 + cmp r5, 0x7 + bls _080F3168 + b _080F3362 +_080F3168: + lsls r0, r5, 2 + ldr r1, =_080F318C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F318C: + .4byte _080F31AC + .4byte _080F31CA + .4byte _080F321C + .4byte _080F3268 + .4byte _080F329C + .4byte _080F32C0 + .4byte _080F32EC + .4byte _080F3338 +_080F31AC: + ldrb r1, [r4, 0x18] + cmp r1, 0 + bge _080F31B4 + b _080F3362 +_080F31B4: + cmp r1, 0x1 + ble _080F31BE + cmp r1, 0x2 + beq _080F31C4 + b _080F3362 +_080F31BE: + movs r0, 0x1 + strb r0, [r2] + b _080F3362 +_080F31C4: + movs r0, 0x5 + strb r0, [r2] + b _080F3362 +_080F31CA: + ldr r0, =0x02021cc4 + adds r1, r4, 0x4 + ldrb r2, [r4, 0x19] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x1A] + bl sub_81DB5E8 + ldrb r0, [r4, 0x18] + cmp r0, 0 + bne _080F3200 + ldr r0, =0x02021ec4 + ldr r1, =gUnknown_085ECB64 + bl CopyString + b _080F3208 + .pool +_080F3200: + ldr r0, =0x02021ec4 + ldr r1, =gUnknown_085ECB6B + bl CopyString +_080F3208: + ldr r1, =0x0203a030 + movs r0, 0x2 + strb r0, [r1] + b _080F3362 + .pool +_080F321C: + ldr r0, =0x02021cc4 + adds r1, r4, 0x4 + ldrb r2, [r4, 0x19] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r4, 0x16] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021ec4 + ldrh r2, [r4, 0x14] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + ldr r1, =0x0203a030 + movs r0, 0x3 + strb r0, [r1] + b _080F3362 + .pool +_080F3268: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x1A] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r4, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r1, =0x0203a030 + movs r0, 0x4 + strb r0, [r1] + b _080F3362 + .pool +_080F329C: + ldr r0, =0x02021cc4 + adds r1, r4, 0x4 + ldrb r2, [r4, 0x19] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x1A] + bl sub_81DB5E8 + bl TVShowDone + b _080F3362 + .pool +_080F32C0: + ldr r0, =0x02021cc4 + adds r1, r4, 0x4 + ldrb r2, [r4, 0x19] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x1A] + bl sub_81DB5E8 + ldr r1, =0x0203a030 + movs r0, 0x6 + strb r0, [r1] + b _080F3362 + .pool +_080F32EC: + ldr r0, =0x02021cc4 + adds r1, r4, 0x4 + ldrb r2, [r4, 0x19] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r4, 0x16] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021ec4 + ldrh r2, [r4, 0x14] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + ldr r1, =0x0203a030 + movs r0, 0x7 + strb r0, [r1] + b _080F3362 + .pool +_080F3338: + ldr r0, =0x02021cc4 + adds r1, r4, 0x4 + ldrb r2, [r4, 0x19] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x1A] + bl sub_81DB5E8 + ldr r0, =0x02021ec4 + ldrh r2, [r4, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + bl TVShowDone +_080F3362: + ldr r0, =gUnknown_0858D300 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowPokemonBattleUpdate + + thumb_func_start DoTVShow3CheersForPokeblocks +DoTVShow3CheersForPokeblocks: @ 80F3388 + push {r4,r5,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r5, [r0] + cmp r5, 0x5 + bls _080F33AE + b _080F3624 +_080F33AE: + lsls r0, r5, 2 + ldr r1, =_080F33D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F33D0: + .4byte _080F33E8 + .4byte _080F3418 + .4byte _080F3500 + .4byte _080F350C + .4byte _080F35F4 + .4byte _080F3620 +_080F33E8: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x14] + bl sub_81DB5E8 + ldrb r0, [r4, 0x2] + cmp r0, 0x14 + bls _080F340C + ldr r1, =0x0203a030 + movs r0, 0x1 + strb r0, [r1] + b _080F3624 + .pool +_080F340C: + ldr r1, =0x0203a030 + movs r0, 0x3 + strb r0, [r1] + b _080F3624 + .pool +_080F3418: + ldrb r0, [r4, 0x3] + lsls r0, 29 + lsrs r0, 29 + cmp r0, 0x4 + bhi _080F349C + lsls r0, 2 + ldr r1, =_080F3430 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F3430: + .4byte _080F3444 + .4byte _080F3458 + .4byte _080F346C + .4byte _080F3480 + .4byte _080F3494 +_080F3444: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085ECB48 + bl CopyString + b _080F349C + .pool +_080F3458: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085ECB4E + bl CopyString + b _080F349C + .pool +_080F346C: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085ECB52 + bl CopyString + b _080F349C + .pool +_080F3480: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085ECB58 + bl CopyString + b _080F349C + .pool +_080F3494: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085ECB5F + bl CopyString +_080F349C: + ldrb r0, [r4, 0x2] + cmp r0, 0x18 + bls _080F34BC + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085ECB2A + bl CopyString + b _080F34DC + .pool +_080F34BC: + cmp r0, 0x16 + bls _080F34D4 + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085ECB20 + bl CopyString + b _080F34DC + .pool +_080F34D4: + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085ECB1B + bl CopyString +_080F34DC: + ldr r0, =0x02021ec4 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x14] + bl sub_81DB5E8 + ldr r1, =0x0203a030 + movs r0, 0x2 + strb r0, [r1] + b _080F3624 + .pool +_080F3500: + ldr r0, =0x02021cc4 + adds r1, r4, 0x4 + ldrb r2, [r4, 0x15] + b _080F3606 + .pool +_080F350C: + ldrb r0, [r4, 0x3] + lsls r0, 29 + lsrs r0, 29 + cmp r0, 0x4 + bhi _080F3590 + lsls r0, 2 + ldr r1, =_080F3524 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F3524: + .4byte _080F3538 + .4byte _080F354C + .4byte _080F3560 + .4byte _080F3574 + .4byte _080F3588 +_080F3538: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085ECB48 + bl CopyString + b _080F3590 + .pool +_080F354C: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085ECB4E + bl CopyString + b _080F3590 + .pool +_080F3560: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085ECB52 + bl CopyString + b _080F3590 + .pool +_080F3574: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085ECB58 + bl CopyString + b _080F3590 + .pool +_080F3588: + ldr r0, =0x02021cc4 + ldr r1, =gUnknown_085ECB5F + bl CopyString +_080F3590: + ldrb r0, [r4, 0x2] + cmp r0, 0x10 + bls _080F35B0 + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085ECB34 + bl CopyString + b _080F35D0 + .pool +_080F35B0: + cmp r0, 0xD + bls _080F35C8 + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085ECB3A + bl CopyString + b _080F35D0 + .pool +_080F35C8: + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085ECB3E + bl CopyString +_080F35D0: + ldr r0, =0x02021ec4 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x14] + bl sub_81DB5E8 + ldr r1, =0x0203a030 + movs r0, 0x4 + strb r0, [r1] + b _080F3624 + .pool +_080F35F4: + ldr r0, =0x02021cc4 + adds r1, r4, 0x4 + ldrb r2, [r4, 0x15] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x14] +_080F3606: + bl sub_81DB5E8 + ldr r1, =0x0203a030 + movs r0, 0x5 + strb r0, [r1] + b _080F3624 + .pool +_080F3620: + bl TVShowDone +_080F3624: + ldr r0, =gUnknown_0858D228 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShow3CheersForPokeblocks + + thumb_func_start DoTVShowInSearchOfTrainers +DoTVShowInSearchOfTrainers: @ 80F363C + push {r4-r7,lr} + ldr r0, =0x020375f0 + movs r1, 0 + strh r1, [r0] + ldr r0, =0x0203a030 + ldrb r7, [r0] + adds r2, r0, 0 + cmp r7, 0x8 + bls _080F3650 + b _080F37EA +_080F3650: + lsls r0, r7, 2 + ldr r1, =_080F3668 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F3668: + .4byte _080F368C + .4byte _080F36D4 + .4byte _080F36DA + .4byte _080F372C + .4byte _080F379C + .4byte _080F379C + .4byte _080F379C + .4byte _080F379C + .4byte _080F37A2 +_080F368C: + ldr r0, =0x02021cc4 + ldr r4, =0x03005d8c + ldr r1, [r4] + ldr r2, =0x00002bac + adds r1, r2 + ldrb r1, [r1] + movs r2, 0 + bl GetMapName + ldr r0, [r4] + ldr r1, =0x00002bad + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bls _080F36C8 + ldr r1, =0x0203a030 + movs r0, 0x1 + strb r0, [r1] + b _080F37EA + .pool +_080F36C8: + ldr r1, =0x0203a030 + movs r0, 0x2 + strb r0, [r1] + b _080F37EA + .pool +_080F36D4: + movs r0, 0x2 + strb r0, [r2] + b _080F37EA +_080F36DA: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002bae + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080F36FC + movs r0, 0x4 + strb r0, [r2] + b _080F37EA + .pool +_080F36FC: + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080F370A + movs r0, 0x5 + strb r0, [r2] + b _080F37EA +_080F370A: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080F3718 + movs r0, 0x6 + strb r0, [r2] + b _080F37EA +_080F3718: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080F3726 + movs r0, 0x7 + strb r0, [r2] + b _080F37EA +_080F3726: + movs r0, 0x3 + strb r0, [r2] + b _080F37EA +_080F372C: + ldr r0, =0x02021cc4 + ldr r4, =0x03005d8c + ldr r1, [r4] + ldr r2, =0x00002ba4 + adds r1, r2 + ldrh r1, [r1] + movs r6, 0xB + muls r1, r6 + ldr r5, =gSpeciesNames + adds r1, r5 + bl CopyString + ldr r0, =0x02021dc4 + ldr r1, [r4] + ldr r2, =0x00002ba8 + adds r1, r2 + ldrh r2, [r1] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021ec4 + ldr r1, [r4] + ldr r2, =0x00002ba6 + adds r1, r2 + ldrh r1, [r1] + muls r1, r6 + adds r1, r5 + bl CopyString + ldr r1, =0x0203a030 + movs r0, 0x8 + strb r0, [r1] + b _080F37EA + .pool +_080F379C: + movs r0, 0x8 + strb r0, [r2] + b _080F37EA +_080F37A2: + ldr r0, =0x02021cc4 + ldr r4, =0x03005d8c + ldr r1, [r4] + ldr r2, =0x00002baa + adds r1, r2 + ldrh r1, [r1] + bl CopyEasyChatWord + ldr r0, =0x02021dc4 + ldr r1, [r4] + ldr r2, =0x00002ba4 + adds r1, r2 + ldrh r1, [r1] + movs r6, 0xB + muls r1, r6 + ldr r5, =gSpeciesNames + adds r1, r5 + bl CopyString + ldr r0, =0x02021ec4 + ldr r1, [r4] + ldr r2, =0x00002ba6 + adds r1, r2 + ldrh r1, [r1] + muls r1, r6 + adds r1, r5 + bl CopyString + ldr r1, =0x020375f0 + movs r0, 0x1 + strh r0, [r1] + ldr r1, =0x0203a030 + movs r0, 0 + strb r0, [r1] + bl TakeTVShowInSearchOfTrainersOffTheAir +_080F37EA: + ldr r0, =gUnknown_0858D66C + lsls r1, r7, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowInSearchOfTrainers + + thumb_func_start DoTVShowPokemonAngler +DoTVShowPokemonAngler: @ 80F3828 + push {r4,r5,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r0, =0x020375f0 + movs r1, 0 + strh r1, [r0] + ldrb r0, [r4, 0x2] + ldrb r2, [r4, 0x3] + cmp r0, r2 + bcs _080F3868 + ldr r0, =0x0203a030 + strb r1, [r0] + b _080F3870 + .pool +_080F3868: + ldr r1, =0x0203a030 + movs r0, 0x1 + strb r0, [r1] + adds r0, r1, 0 +_080F3870: + ldrb r5, [r0] + cmp r5, 0 + beq _080F3880 + cmp r5, 0x1 + beq _080F38B8 + b _080F38E0 + .pool +_080F3880: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x6] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r4, 0x4] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldrb r1, [r4, 0x3] + movs r0, 0x2 + bl sub_80EF340 + bl TVShowDone + b _080F38E0 + .pool +_080F38B8: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x6] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r4, 0x4] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldrb r1, [r4, 0x2] + movs r0, 0x2 + bl sub_80EF340 + bl TVShowDone +_080F38E0: + ldr r0, =gUnknown_0858D3B0 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowPokemonAngler + + thumb_func_start DoTVShowTheWorldOfMasters +DoTVShowTheWorldOfMasters: @ 80F3904 + push {r4-r6,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r6, =0x0203a030 + ldrb r5, [r6] + cmp r5, 0x1 + beq _080F3974 + cmp r5, 0x1 + bgt _080F3948 + cmp r5, 0 + beq _080F394E + b _080F39BE + .pool +_080F3948: + cmp r5, 0x2 + beq _080F3994 + b _080F39BE +_080F394E: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0xB] + bl sub_81DB5E8 + ldrh r1, [r4, 0x6] + movs r0, 0x1 + bl sub_80EF340 + ldrh r1, [r4, 0x2] + movs r0, 0x2 + bl sub_80EF340 + movs r0, 0x1 + strb r0, [r6] + b _080F39BE + .pool +_080F3974: + ldr r0, =0x02021cc4 + ldrh r2, [r4, 0x8] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + movs r0, 0x2 + strb r0, [r6] + b _080F39BE + .pool +_080F3994: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0xB] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrb r1, [r4, 0xA] + movs r2, 0 + bl GetMapName + ldr r0, =0x02021ec4 + ldrh r2, [r4, 0x4] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + bl TVShowDone +_080F39BE: + ldr r0, =gUnknown_0858D3B8 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowTheWorldOfMasters + + thumb_func_start DoTVShowTodaysRivalTrainer +DoTVShowTodaysRivalTrainer: @ 80F39E4 + push {r4,r5,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r5, [r0] + adds r2, r0, 0 + cmp r5, 0xA + bls _080F3A0C + b _080F3BE8 +_080F3A0C: + lsls r0, r5, 2 + ldr r1, =_080F3A30 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F3A30: + .4byte _080F3A5C + .4byte _080F3B30 + .4byte _080F3B58 + .4byte _080F3B90 + .4byte _080F3BA2 + .4byte _080F3BC4 + .4byte _080F3BD8 + .4byte _080F3A92 + .4byte _080F3AC0 + .4byte _080F3ADC + .4byte _080F3AF8 +_080F3A5C: + ldrb r0, [r4, 0x7] + cmp r0, 0x56 + beq _080F3A6C + cmp r0, 0x57 + beq _080F3A72 + movs r0, 0x7 + strb r0, [r2] + b _080F3BE8 +_080F3A6C: + movs r0, 0x8 + strb r0, [r2] + b _080F3BE8 +_080F3A72: + ldrh r1, [r4, 0xA] + ldr r0, =0x00000117 + cmp r1, r0 + bgt _080F3A8C + subs r0, 0x2 + cmp r1, r0 + blt _080F3A8C + movs r0, 0xA + strb r0, [r2] + b _080F3BE8 + .pool +_080F3A8C: + movs r0, 0x9 + strb r0, [r2] + b _080F3BE8 +_080F3A92: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0xC] + bl sub_81DB5E8 + ldrh r1, [r4, 0x2] + movs r0, 0x1 + bl sub_80EF340 + ldr r0, =0x02021ec4 + ldrb r1, [r4, 0x7] + movs r2, 0 + bl GetMapName +_080F3AB0: + ldrb r0, [r4, 0x4] + cmp r0, 0 + bne _080F3B12 + b _080F3B24 + .pool +_080F3AC0: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0xC] + bl sub_81DB5E8 + ldrh r1, [r4, 0x2] + movs r0, 0x1 + bl sub_80EF340 + b _080F3AB0 + .pool +_080F3ADC: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0xC] + bl sub_81DB5E8 + ldrh r1, [r4, 0x2] + movs r0, 0x1 + bl sub_80EF340 + b _080F3AB0 + .pool +_080F3AF8: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0xC] + bl sub_81DB5E8 + ldrh r1, [r4, 0x2] + movs r0, 0x1 + bl sub_80EF340 + ldrb r0, [r4, 0x4] + cmp r0, 0 + beq _080F3B24 +_080F3B12: + ldr r1, =0x0203a030 + movs r0, 0x1 + strb r0, [r1] + b _080F3BE8 + .pool +_080F3B24: + ldr r1, =0x0203a030 + movs r0, 0x2 + strb r0, [r1] + b _080F3BE8 + .pool +_080F3B30: + ldrb r1, [r4, 0x4] + movs r0, 0 + bl sub_80EF340 + ldr r0, =0x000008a8 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _080F3BCC + ldr r0, [r4, 0x4] + ldr r1, =0x00ffff00 + ands r0, r1 + cmp r0, 0 + bne _080F3B6E + b _080F3B84 + .pool +_080F3B58: + ldr r0, =0x000008a8 + bl FlagGet + lsls r0, 24 + cmp r0, 0 + beq _080F3BCC + ldr r0, [r4, 0x4] + ldr r1, =0x00ffff00 + ands r0, r1 + cmp r0, 0 + beq _080F3B84 +_080F3B6E: + ldr r1, =0x0203a030 + movs r0, 0x4 + strb r0, [r1] + b _080F3BE8 + .pool +_080F3B84: + ldr r1, =0x0203a030 + movs r0, 0x3 + strb r0, [r1] + b _080F3BE8 + .pool +_080F3B90: + ldrh r0, [r4, 0x8] + cmp r0, 0 + bne _080F3B9C + movs r0, 0x6 + strb r0, [r2] + b _080F3BE8 +_080F3B9C: + movs r0, 0x5 + strb r0, [r2] + b _080F3BE8 +_080F3BA2: + ldrb r1, [r4, 0x6] + movs r0, 0 + bl sub_80EF340 + ldrb r1, [r4, 0x5] + movs r0, 0x1 + bl sub_80EF340 + ldrh r0, [r4, 0x8] + cmp r0, 0 + beq _080F3BCC + ldr r1, =0x0203a030 + movs r0, 0x5 + strb r0, [r1] + b _080F3BE8 + .pool +_080F3BC4: + ldrh r1, [r4, 0x8] + movs r0, 0 + bl sub_80EF340 +_080F3BCC: + ldr r1, =0x0203a030 + movs r0, 0x6 + strb r0, [r1] + b _080F3BE8 + .pool +_080F3BD8: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0xC] + bl sub_81DB5E8 + bl TVShowDone +_080F3BE8: + ldr r0, =gUnknown_0858D3C4 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowTodaysRivalTrainer + + thumb_func_start DoTVShowDewfordTrendWatcherNetwork +DoTVShowDewfordTrendWatcherNetwork: @ 80F3C04 + push {r4,r5,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r5, [r0] + cmp r5, 0x6 + bls _080F3C2A + b _080F3D54 +_080F3C2A: + lsls r0, r5, 2 + ldr r1, =_080F3C4C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F3C4C: + .4byte _080F3C68 + .4byte _080F3CA0 + .4byte _080F3CA0 + .4byte _080F3CD4 + .4byte _080F3D0C + .4byte _080F3D0C + .4byte _080F3D40 +_080F3C68: + ldr r0, =0x02021cc4 + ldrh r1, [r4, 0x4] + bl CopyEasyChatWord + ldr r0, =0x02021dc4 + ldrh r1, [r4, 0x6] + bl CopyEasyChatWord + ldrb r0, [r4, 0x8] + cmp r0, 0 + bne _080F3C94 + ldr r1, =0x0203a030 + movs r0, 0x1 + strb r0, [r1] + b _080F3D54 + .pool +_080F3C94: + ldr r1, =0x0203a030 + movs r0, 0x2 + strb r0, [r1] + b _080F3D54 + .pool +_080F3CA0: + ldr r0, =0x02021cc4 + ldrh r1, [r4, 0x4] + bl CopyEasyChatWord + ldr r0, =0x02021dc4 + ldrh r1, [r4, 0x6] + bl CopyEasyChatWord + ldr r0, =0x02021ec4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x9] + bl sub_81DB5E8 + ldr r1, =0x0203a030 + movs r0, 0x3 + strb r0, [r1] + b _080F3D54 + .pool +_080F3CD4: + ldr r0, =0x02021cc4 + ldrh r1, [r4, 0x4] + bl CopyEasyChatWord + ldr r0, =0x02021dc4 + ldrh r1, [r4, 0x6] + bl CopyEasyChatWord + ldrb r0, [r4, 0x8] + cmp r0, 0 + bne _080F3D00 + ldr r1, =0x0203a030 + movs r0, 0x4 + strb r0, [r1] + b _080F3D54 + .pool +_080F3D00: + ldr r1, =0x0203a030 + movs r0, 0x5 + strb r0, [r1] + b _080F3D54 + .pool +_080F3D0C: + ldr r0, =0x02021cc4 + ldrh r1, [r4, 0x4] + bl CopyEasyChatWord + ldr r0, =0x02021dc4 + ldrh r1, [r4, 0x6] + bl CopyEasyChatWord + ldr r0, =0x02021ec4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x9] + bl sub_81DB5E8 + ldr r1, =0x0203a030 + movs r0, 0x6 + strb r0, [r1] + b _080F3D54 + .pool +_080F3D40: + ldr r0, =0x02021cc4 + ldrh r1, [r4, 0x4] + bl CopyEasyChatWord + ldr r0, =0x02021dc4 + ldrh r1, [r4, 0x6] + bl CopyEasyChatWord + bl TVShowDone +_080F3D54: + ldr r0, =gUnknown_0858D3F0 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowDewfordTrendWatcherNetwork + + thumb_func_start DoTVShowHoennTreasureInvestigators +DoTVShowHoennTreasureInvestigators: @ 80F3D74 + push {r4-r7,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r5, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r7, =0x0203a030 + ldrb r6, [r7] + cmp r6, 0x1 + beq _080F3E02 + cmp r6, 0x1 + bgt _080F3DB8 + cmp r6, 0 + beq _080F3DBE + b _080F3E5C + .pool +_080F3DB8: + cmp r6, 0x2 + beq _080F3E3C + b _080F3E5C +_080F3DBE: + ldr r4, =0x02021cc4 + ldrh r0, [r5, 0x2] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + ldrb r0, [r5, 0x4] + cmp r0, 0x57 + bne _080F3DFC + ldrh r1, [r5, 0x6] + ldr r0, =0x00000117 + cmp r1, r0 + bgt _080F3DF0 + subs r0, 0x2 + cmp r1, r0 + blt _080F3DF0 + movs r0, 0x2 + strb r0, [r7] + b _080F3E5C + .pool +_080F3DF0: + ldr r1, =0x0203a030 + movs r0, 0x1 + strb r0, [r1] + b _080F3E5C + .pool +_080F3DFC: + movs r0, 0x1 + strb r0, [r7] + b _080F3E5C +_080F3E02: + ldr r4, =0x02021cc4 + ldrh r0, [r5, 0x2] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + ldr r0, =0x02021dc4 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x5] + bl sub_81DB5E8 + ldr r0, =0x02021ec4 + ldrb r1, [r5, 0x4] + movs r2, 0 + bl GetMapName + bl TVShowDone + b _080F3E5C + .pool +_080F3E3C: + ldr r4, =0x02021cc4 + ldrh r0, [r5, 0x2] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + ldr r0, =0x02021dc4 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x5] + bl sub_81DB5E8 + bl TVShowDone +_080F3E5C: + ldr r0, =gUnknown_0858D40C + lsls r1, r6, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowHoennTreasureInvestigators + + thumb_func_start DoTVShowFindThatGamer +DoTVShowFindThatGamer: @ 80F3E7C + push {r4,r5,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r5, [r0] + cmp r5, 0x1 + beq _080F3F28 + cmp r5, 0x1 + bgt _080F3EC0 + cmp r5, 0 + beq _080F3ECC + b _080F4008 + .pool +_080F3EC0: + cmp r5, 0x2 + beq _080F3F78 + cmp r5, 0x3 + bne _080F3ECA + b _080F3FCC +_080F3ECA: + b _080F4008 +_080F3ECC: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x8] + bl sub_81DB5E8 + ldrb r0, [r4, 0x3] + cmp r0, 0 + beq _080F3EE8 + cmp r0, 0x1 + beq _080F3EFC + b _080F3F04 + .pool +_080F3EE8: + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085ECB0C + bl CopyString + b _080F3F04 + .pool +_080F3EFC: + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085ECB12 + bl CopyString +_080F3F04: + ldrb r1, [r4, 0x2] + cmp r1, 0x1 + bne _080F3F1C + ldr r0, =0x0203a030 + strb r1, [r0] + b _080F4008 + .pool +_080F3F1C: + ldr r1, =0x0203a030 + movs r0, 0x2 + strb r0, [r1] + b _080F4008 + .pool +_080F3F28: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x8] + bl sub_81DB5E8 + ldrb r0, [r4, 0x3] + cmp r0, 0 + beq _080F3F44 + cmp r0, 0x1 + beq _080F3F58 + b _080F3F60 + .pool +_080F3F44: + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085ECB0C + bl CopyString + b _080F3F60 + .pool +_080F3F58: + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085ECB12 + bl CopyString +_080F3F60: + ldrh r1, [r4, 0x4] + movs r0, 0x2 + bl sub_80EF340 + bl TVShowDone + b _080F4008 + .pool +_080F3F78: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x8] + bl sub_81DB5E8 + ldrb r0, [r4, 0x3] + cmp r0, 0 + beq _080F3F94 + cmp r0, 0x1 + beq _080F3FA8 + b _080F3FB0 + .pool +_080F3F94: + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085ECB0C + bl CopyString + b _080F3FB0 + .pool +_080F3FA8: + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085ECB12 + bl CopyString +_080F3FB0: + ldrh r1, [r4, 0x4] + movs r0, 0x2 + bl sub_80EF340 + ldr r1, =0x0203a030 + movs r0, 0x3 + strb r0, [r1] + b _080F4008 + .pool +_080F3FCC: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x8] + bl sub_81DB5E8 + ldrb r1, [r4, 0x3] + cmp r1, 0 + beq _080F3FE8 + cmp r1, 0x1 + beq _080F3FFC + b _080F4004 + .pool +_080F3FE8: + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085ECB12 + bl CopyString + b _080F4004 + .pool +_080F3FFC: + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085ECB0C + bl CopyString +_080F4004: + bl TVShowDone +_080F4008: + ldr r0, =gUnknown_0858D418 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowFindThatGamer + + thumb_func_start DoTVShowBreakingNewsTV +DoTVShowBreakingNewsTV: @ 80F4028 + push {r4-r7,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r6, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r7, [r0] + adds r2, r0, 0 + cmp r7, 0xC + bls _080F4050 + b _080F4344 +_080F4050: + lsls r0, r7, 2 + ldr r1, =_080F4074 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F4074: + .4byte _080F40A8 + .4byte _080F40BA + .4byte _080F40FC + .4byte _080F4140 + .4byte _080F4168 + .4byte _080F418C + .4byte _080F41D0 + .4byte _080F4254 + .4byte _080F42C8 + .4byte _080F42F4 + .4byte _080F42F4 + .4byte _080F4334 + .4byte _080F4284 +_080F40A8: + ldrb r0, [r6, 0x5] + cmp r0, 0 + bne _080F40B4 + movs r0, 0x1 + strb r0, [r2] + b _080F4344 +_080F40B4: + movs r0, 0x5 + strb r0, [r2] + b _080F4344 +_080F40BA: + ldr r0, =0x02021cc4 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xE] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021ec4 + ldrb r1, [r6, 0x4] + movs r2, 0 + bl GetMapName + ldr r1, =0x0203a030 + movs r0, 0x2 + strb r0, [r1] + b _080F4344 + .pool +_080F40FC: + ldr r0, =0x02021cc4 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xE] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r1, [r6, 0x2] + movs r5, 0xB + muls r1, r5 + ldr r4, =gSpeciesNames + adds r1, r4 + bl CopyString + ldr r0, =0x02021ec4 + ldrh r1, [r6, 0xA] + muls r1, r5 + adds r1, r4 + bl CopyString + ldr r1, =0x0203a030 + movs r0, 0x3 + strb r0, [r1] + b _080F4344 + .pool +_080F4140: + ldrh r1, [r6, 0x8] + movs r0, 0 + bl sub_80EF340 + ldr r4, =0x02021dc4 + ldrh r0, [r6, 0x6] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + ldr r1, =0x0203a030 + movs r0, 0x4 + strb r0, [r1] + b _080F4344 + .pool +_080F4168: + ldr r0, =0x02021cc4 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xE] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrb r1, [r6, 0x4] + movs r2, 0 + bl GetMapName + bl TVShowDone + b _080F4344 + .pool +_080F418C: + ldr r0, =0x02021cc4 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xE] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x2] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021ec4 + ldrb r1, [r6, 0x4] + movs r2, 0 + bl GetMapName + ldr r1, =0x0203a030 + movs r0, 0x6 + strb r0, [r1] + b _080F4344 + .pool +_080F41D0: + ldr r0, =0x02021cc4 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xE] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r1, [r6, 0x2] + movs r5, 0xB + muls r1, r5 + ldr r4, =gSpeciesNames + adds r1, r4 + bl CopyString + ldr r0, =0x02021ec4 + ldrh r1, [r6, 0xA] + muls r1, r5 + adds r1, r4 + bl CopyString + ldrb r0, [r6, 0x5] + cmp r0, 0x2 + beq _080F423C + cmp r0, 0x2 + bgt _080F4218 + cmp r0, 0x1 + beq _080F421E + b _080F4344 + .pool +_080F4218: + cmp r0, 0x3 + beq _080F4248 + b _080F4344 +_080F421E: + ldrh r0, [r6, 0xC] + cmp r0, 0 + bne _080F4230 + ldr r1, =0x0203a030 + movs r0, 0xC + strb r0, [r1] + b _080F4344 + .pool +_080F4230: + ldr r1, =0x0203a030 + movs r0, 0x7 + strb r0, [r1] + b _080F4344 + .pool +_080F423C: + ldr r1, =0x0203a030 + movs r0, 0x9 + strb r0, [r1] + b _080F4344 + .pool +_080F4248: + ldr r1, =0x0203a030 + movs r0, 0xA + strb r0, [r1] + b _080F4344 + .pool +_080F4254: + ldr r0, =0x02021cc4 + ldrh r2, [r6, 0xC] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0xA] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + b _080F42A8 + .pool +_080F4284: + ldr r0, =0x02021cc4 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xE] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r1, [r6, 0x2] + movs r5, 0xB + muls r1, r5 + ldr r4, =gSpeciesNames + adds r1, r4 + bl CopyString + ldr r0, =0x02021ec4 + ldrh r1, [r6, 0xA] + muls r1, r5 + adds r1, r4 +_080F42A8: + bl CopyString + ldr r1, =0x0203a030 + movs r0, 0x8 + strb r0, [r1] + b _080F4344 + .pool +_080F42C8: + ldr r0, =0x02021cc4 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xE] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrb r1, [r6, 0x4] + movs r2, 0 + bl GetMapName + ldr r1, =0x0203a030 + movs r0, 0xB + strb r0, [r1] + b _080F4344 + .pool +_080F42F4: + ldr r0, =0x02021cc4 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xE] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r1, [r6, 0x2] + movs r4, 0xB + muls r1, r4 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021ec4 + ldrb r1, [r6, 0x4] + movs r2, 0 + bl GetMapName + ldr r0, =0x0203a030 + strb r4, [r0] + b _080F4344 + .pool +_080F4334: + ldr r0, =0x02021cc4 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xE] + bl sub_81DB5E8 + bl TVShowDone +_080F4344: + ldr r0, =gUnknown_0858D428 + lsls r1, r7, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowBreakingNewsTV + + thumb_func_start DoTVShowSecretBaseVisit +DoTVShowSecretBaseVisit: @ 80F4360 + push {r4-r6,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r5, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r6, [r0] + adds r2, r0, 0 + cmp r6, 0xD + bls _080F4388 + b _080F4588 +_080F4388: + lsls r0, r6, 2 + ldr r1, =_080F43AC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F43AC: + .4byte _080F43E4 + .4byte _080F4414 + .4byte _080F44E4 + .4byte _080F4448 + .4byte _080F44E4 + .4byte _080F449C + .4byte _080F44C0 + .4byte _080F44E4 + .4byte _080F44EA + .4byte _080F4538 + .4byte _080F4538 + .4byte _080F4538 + .4byte _080F4538 + .4byte _080F4584 +_080F43E4: + ldr r0, =0x02021cc4 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0xC] + bl sub_81DB5E8 + ldrb r0, [r5, 0x3] + cmp r0, 0 + bne _080F4408 + ldr r1, =0x0203a030 + movs r0, 0x2 + strb r0, [r1] + b _080F4588 + .pool +_080F4408: + ldr r1, =0x0203a030 + movs r0, 0x1 + strb r0, [r1] + b _080F4588 + .pool +_080F4414: + ldr r0, =0x02021dc4 + ldrb r1, [r5, 0x4] + lsls r1, 5 + ldr r2, =gUnknown_085A5C09 + adds r1, r2 + bl CopyString + ldrb r0, [r5, 0x3] + cmp r0, 0x1 + bne _080F443C + ldr r1, =0x0203a030 + movs r0, 0x4 + strb r0, [r1] + b _080F4588 + .pool +_080F443C: + ldr r1, =0x0203a030 + movs r0, 0x3 + strb r0, [r1] + b _080F4588 + .pool +_080F4448: + ldr r0, =0x02021dc4 + ldrb r1, [r5, 0x5] + lsls r1, 5 + ldr r2, =gUnknown_085A5C09 + adds r1, r2 + bl CopyString + ldrb r1, [r5, 0x3] + cmp r1, 0x3 + beq _080F4484 + cmp r1, 0x3 + bgt _080F4470 + cmp r1, 0x2 + beq _080F4476 + b _080F4588 + .pool +_080F4470: + cmp r1, 0x4 + beq _080F4490 + b _080F4588 +_080F4476: + ldr r1, =0x0203a030 + movs r0, 0x7 + strb r0, [r1] + b _080F4588 + .pool +_080F4484: + ldr r1, =0x0203a030 + movs r0, 0x6 + strb r0, [r1] + b _080F4588 + .pool +_080F4490: + ldr r1, =0x0203a030 + movs r0, 0x5 + strb r0, [r1] + b _080F4588 + .pool +_080F449C: + ldr r0, =0x02021dc4 + ldrb r1, [r5, 0x6] + lsls r1, 5 + ldr r4, =gUnknown_085A5C09 + adds r1, r4 + bl CopyString + ldr r0, =0x02021ec4 + ldrb r1, [r5, 0x7] + lsls r1, 5 + adds r1, r4 + b _080F44CA + .pool +_080F44C0: + ldr r0, =0x02021dc4 + ldrb r1, [r5, 0x6] + lsls r1, 5 + ldr r2, =gUnknown_085A5C09 + adds r1, r2 +_080F44CA: + bl CopyString + ldr r1, =0x0203a030 + movs r0, 0x8 + strb r0, [r1] + b _080F4588 + .pool +_080F44E4: + movs r0, 0x8 + strb r0, [r2] + b _080F4588 +_080F44EA: + ldr r0, =0x02021cc4 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0xC] + bl sub_81DB5E8 + ldrb r1, [r5, 0x2] + cmp r1, 0x18 + bhi _080F450C + ldr r1, =0x0203a030 + movs r0, 0xC + strb r0, [r1] + b _080F4588 + .pool +_080F450C: + cmp r1, 0x31 + bhi _080F451C + ldr r1, =0x0203a030 + movs r0, 0xB + strb r0, [r1] + b _080F4588 + .pool +_080F451C: + cmp r1, 0x45 + bhi _080F452C + ldr r1, =0x0203a030 + movs r0, 0xA + strb r0, [r1] + b _080F4588 + .pool +_080F452C: + ldr r1, =0x0203a030 + movs r0, 0x9 + strb r0, [r1] + b _080F4588 + .pool +_080F4538: + ldr r0, =0x02021cc4 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0xC] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r5, 0x8] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021ec4 + ldrh r1, [r5, 0xA] + movs r4, 0xD + muls r1, r4 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + ldr r0, =0x0203a030 + strb r4, [r0] + b _080F4588 + .pool +_080F4584: + bl TVShowDone +_080F4588: + ldr r0, =gUnknown_0858D45C + lsls r1, r6, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowSecretBaseVisit + + thumb_func_start DoTVShowPokemonLotterWinnerFlashReport +DoTVShowPokemonLotterWinnerFlashReport: @ 80F45A0 + push {r4-r6,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r5, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r6, [r0] + ldr r0, =0x02021cc4 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x5] + bl sub_81DB5E8 + ldrb r0, [r5, 0x4] + cmp r0, 0 + bne _080F45FC + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085ECB72 + bl CopyString + b _080F4634 + .pool +_080F45FC: + cmp r0, 0x1 + bne _080F4614 + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085ECB7A + bl CopyString + b _080F4634 + .pool +_080F4614: + cmp r0, 0x2 + bne _080F462C + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085ECB80 + bl CopyString + b _080F4634 + .pool +_080F462C: + ldr r0, =0x02021dc4 + ldr r1, =gUnknown_085ECB87 + bl CopyString +_080F4634: + ldr r4, =0x02021ec4 + ldrh r0, [r5, 0x2] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + bl TVShowDone + ldr r1, =gUnknown_0858D494 + lsls r0, r6, 2 + adds r0, r1 + ldr r0, [r0] + bl box_related_two__2 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowPokemonLotterWinnerFlashReport + + thumb_func_start DoTVShowThePokemonBattleSeminar +DoTVShowThePokemonBattleSeminar: @ 80F466C + push {r4-r7,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r6, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r7, [r0] + cmp r7, 0x6 + bls _080F4692 + b _080F4858 +_080F4692: + lsls r0, r7, 2 + ldr r1, =_080F46B4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F46B4: + .4byte _080F46D0 + .4byte _080F4714 + .4byte _080F4760 + .4byte _080F47B4 + .4byte _080F47EC + .4byte _080F4814 + .4byte _080F4838 +_080F46D0: + ldr r0, =0x02021cc4 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0x11] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r1, [r6, 0x6] + movs r5, 0xB + muls r1, r5 + ldr r4, =gSpeciesNames + adds r1, r4 + bl CopyString + ldr r0, =0x02021ec4 + ldrh r1, [r6, 0x4] + muls r1, r5 + adds r1, r4 + bl CopyString + ldr r1, =0x0203a030 + movs r0, 0x1 + strb r0, [r1] + b _080F4858 + .pool +_080F4714: + ldr r0, =0x02021cc4 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0x11] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x4] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldr r0, =0x02021ec4 + ldrh r2, [r6, 0x2] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 + bl CopyString + ldr r1, =0x0203a030 + movs r0, 0x2 + strb r0, [r1] + b _080F4858 + .pool +_080F4760: + ldr r0, =0x02021cc4 + ldrh r2, [r6, 0x6] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 + bl CopyString + ldrb r1, [r6, 0x10] + cmp r1, 0x2 + beq _080F479C + cmp r1, 0x2 + bgt _080F4788 + cmp r1, 0x1 + beq _080F478E + b _080F4824 + .pool +_080F4788: + cmp r1, 0x3 + beq _080F47A8 + b _080F4824 +_080F478E: + ldr r1, =0x0203a030 + movs r0, 0x5 + strb r0, [r1] + b _080F4858 + .pool +_080F479C: + ldr r1, =0x0203a030 + movs r0, 0x4 + strb r0, [r1] + b _080F4858 + .pool +_080F47A8: + ldr r0, =0x0203a030 + strb r1, [r0] + b _080F4858 + .pool +_080F47B4: + ldr r0, =0x02021cc4 + ldrh r1, [r6, 0x8] + movs r5, 0xD + muls r1, r5 + ldr r4, =gMoveNames + adds r1, r4 + bl CopyString + ldr r0, =0x02021dc4 + ldrh r1, [r6, 0xA] + muls r1, r5 + adds r1, r4 + bl CopyString + ldr r0, =0x02021ec4 + ldrh r1, [r6, 0xC] + muls r1, r5 + adds r1, r4 + b _080F4820 + .pool +_080F47EC: + ldr r0, =0x02021cc4 + ldrh r1, [r6, 0x8] + movs r5, 0xD + muls r1, r5 + ldr r4, =gMoveNames + adds r1, r4 + bl CopyString + ldr r0, =0x02021dc4 + ldrh r1, [r6, 0xA] + muls r1, r5 + adds r1, r4 + b _080F4820 + .pool +_080F4814: + ldr r0, =0x02021dc4 + ldrh r2, [r6, 0x8] + movs r1, 0xD + muls r1, r2 + ldr r2, =gMoveNames + adds r1, r2 +_080F4820: + bl CopyString +_080F4824: + ldr r1, =0x0203a030 + movs r0, 0x6 + strb r0, [r1] + b _080F4858 + .pool +_080F4838: + ldr r0, =0x02021cc4 + ldrh r1, [r6, 0xE] + movs r5, 0xD + muls r1, r5 + ldr r4, =gMoveNames + adds r1, r4 + bl CopyString + ldr r0, =0x02021dc4 + ldrh r1, [r6, 0x2] + muls r1, r5 + adds r1, r4 + bl CopyString + bl TVShowDone +_080F4858: + ldr r0, =gUnknown_0858D498 + lsls r1, r7, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowThePokemonBattleSeminar + + thumb_func_start DoTVShowTrainerFanClubSpecial +DoTVShowTrainerFanClubSpecial: @ 80F487C + push {r4,r5,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r5, [r0] + cmp r5, 0x5 + bls _080F48A2 + b _080F499A +_080F48A2: + lsls r0, r5, 2 + ldr r1, =_080F48C4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F48C4: + .4byte _080F48DC + .4byte _080F4944 + .4byte _080F4944 + .4byte _080F4944 + .4byte _080F4944 + .4byte _080F4978 +_080F48DC: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x18] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + adds r1, r4, 0x2 + ldrb r2, [r4, 0x17] + bl sub_81DB5E8 + ldr r0, =0x02021ec4 + ldrh r1, [r4, 0x14] + bl CopyEasyChatWord + ldrb r1, [r4, 0x16] + cmp r1, 0x59 + bls _080F4918 + ldr r1, =0x0203a030 + movs r0, 0x1 + strb r0, [r1] + b _080F499A + .pool +_080F4918: + cmp r1, 0x45 + bls _080F4928 + ldr r1, =0x0203a030 + movs r0, 0x2 + strb r0, [r1] + b _080F499A + .pool +_080F4928: + cmp r1, 0x1D + bls _080F4938 + ldr r1, =0x0203a030 + movs r0, 0x3 + strb r0, [r1] + b _080F499A + .pool +_080F4938: + ldr r1, =0x0203a030 + movs r0, 0x4 + strb r0, [r1] + b _080F499A + .pool +_080F4944: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x18] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + adds r1, r4, 0x2 + ldrb r2, [r4, 0x17] + bl sub_81DB5E8 + ldrb r1, [r4, 0x16] + movs r0, 0x2 + bl sub_80EF340 + ldr r1, =0x0203a030 + movs r0, 0x5 + strb r0, [r1] + b _080F499A + .pool +_080F4978: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0xC + ldrb r2, [r4, 0x18] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + adds r1, r4, 0x2 + ldrb r2, [r4, 0x17] + bl sub_81DB5E8 + ldr r0, =0x02021ec4 + ldrh r1, [r4, 0x14] + bl CopyEasyChatWord + bl TVShowDone +_080F499A: + ldr r0, =gUnknown_0858D320 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowTrainerFanClubSpecial + + thumb_func_start DoTVShowTrainerFanClub +DoTVShowTrainerFanClub: @ 80F49BC + push {r4,r5,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r5, [r0] + adds r2, r0, 0 + cmp r5, 0xB + bls _080F49E4 + b _080F4B3A +_080F49E4: + lsls r0, r5, 2 + ldr r1, =_080F4A08 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F4A08: + .4byte _080F4A38 + .4byte _080F4B14 + .4byte _080F4B14 + .4byte _080F4B14 + .4byte _080F4B14 + .4byte _080F4B14 + .4byte _080F4B14 + .4byte _080F4B14 + .4byte _080F4B14 + .4byte _080F4B14 + .4byte _080F4B14 + .4byte _080F4B1A +_080F4A38: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x8] + bl sub_81DB5E8 + adds r0, r4, 0 + adds r0, 0x23 + ldrb r0, [r0] + lsls r0, 8 + adds r1, r4, 0 + adds r1, 0x22 + ldrb r1, [r1] + adds r0, r1 + movs r1, 0xA + bl __umodsi3 + cmp r0, 0x9 + bls _080F4A60 + b _080F4B3A +_080F4A60: + lsls r0, 2 + ldr r1, =_080F4A74 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F4A74: + .4byte _080F4A9C + .4byte _080F4AA8 + .4byte _080F4AB4 + .4byte _080F4AC0 + .4byte _080F4ACC + .4byte _080F4AD8 + .4byte _080F4AE4 + .4byte _080F4AF0 + .4byte _080F4AFC + .4byte _080F4B08 +_080F4A9C: + ldr r1, =0x0203a030 + movs r0, 0x1 + strb r0, [r1] + b _080F4B3A + .pool +_080F4AA8: + ldr r1, =0x0203a030 + movs r0, 0x2 + strb r0, [r1] + b _080F4B3A + .pool +_080F4AB4: + ldr r1, =0x0203a030 + movs r0, 0x3 + strb r0, [r1] + b _080F4B3A + .pool +_080F4AC0: + ldr r1, =0x0203a030 + movs r0, 0x4 + strb r0, [r1] + b _080F4B3A + .pool +_080F4ACC: + ldr r1, =0x0203a030 + movs r0, 0x5 + strb r0, [r1] + b _080F4B3A + .pool +_080F4AD8: + ldr r1, =0x0203a030 + movs r0, 0x6 + strb r0, [r1] + b _080F4B3A + .pool +_080F4AE4: + ldr r1, =0x0203a030 + movs r0, 0x7 + strb r0, [r1] + b _080F4B3A + .pool +_080F4AF0: + ldr r1, =0x0203a030 + movs r0, 0x8 + strb r0, [r1] + b _080F4B3A + .pool +_080F4AFC: + ldr r1, =0x0203a030 + movs r0, 0x9 + strb r0, [r1] + b _080F4B3A + .pool +_080F4B08: + ldr r1, =0x0203a030 + movs r0, 0xA + strb r0, [r1] + b _080F4B3A + .pool +_080F4B14: + movs r0, 0xB + strb r0, [r2] + b _080F4B3A +_080F4B1A: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x8] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + ldrh r1, [r4, 0x4] + bl CopyEasyChatWord + ldr r0, =0x02021ec4 + ldrh r1, [r4, 0x6] + bl CopyEasyChatWord + bl TVShowDone +_080F4B3A: + ldr r0, =gUnknown_0858D4B4 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowTrainerFanClub + + thumb_func_start DoTVShowSpotTheCuties +DoTVShowSpotTheCuties: @ 80F4B5C + push {r4,r5,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r5, [r0] + cmp r5, 0xF + bls _080F4B82 + b _080F4D84 +_080F4B82: + lsls r0, r5, 2 + ldr r1, =_080F4BA4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F4BA4: + .4byte _080F4BE4 + .4byte _080F4C30 + .4byte _080F4C30 + .4byte _080F4C30 + .4byte _080F4C64 + .4byte _080F4D64 + .4byte _080F4D64 + .4byte _080F4D64 + .4byte _080F4D64 + .4byte _080F4D64 + .4byte _080F4D64 + .4byte _080F4D64 + .4byte _080F4D64 + .4byte _080F4D64 + .4byte _080F4D64 + .4byte _080F4D80 +_080F4BE4: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0xF] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + adds r1, r4, 0x4 + ldrb r2, [r4, 0x10] + bl sub_81DB5E8 + ldrb r1, [r4, 0x2] + cmp r1, 0x9 + bhi _080F4C14 + ldr r1, =0x0203a030 + movs r0, 0x1 + strb r0, [r1] + b _080F4D84 + .pool +_080F4C14: + cmp r1, 0x13 + bhi _080F4C24 + ldr r1, =0x0203a030 + movs r0, 0x2 + strb r0, [r1] + b _080F4D84 + .pool +_080F4C24: + ldr r1, =0x0203a030 + movs r0, 0x3 + strb r0, [r1] + b _080F4D84 + .pool +_080F4C30: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0xF] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + adds r1, r4, 0x4 + ldrb r2, [r4, 0x10] + bl sub_81DB5E8 + ldrb r1, [r4, 0x2] + movs r0, 0x2 + bl sub_80EF340 + ldr r1, =0x0203a030 + movs r0, 0x4 + strb r0, [r1] + b _080F4D84 + .pool +_080F4C64: + ldr r0, =0x02021dc4 + adds r1, r4, 0x4 + ldrb r2, [r4, 0x10] + bl sub_81DB5E8 + ldrb r0, [r4, 0x3] + cmp r0, 0x18 + bls _080F4C76 + b _080F4D84 +_080F4C76: + lsls r0, 2 + ldr r1, =_080F4C88 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F4C88: + .4byte _080F4CEC + .4byte _080F4CF8 + .4byte _080F4CF8 + .4byte _080F4CF8 + .4byte _080F4CF8 + .4byte _080F4D04 + .4byte _080F4D04 + .4byte _080F4D04 + .4byte _080F4D04 + .4byte _080F4D10 + .4byte _080F4D10 + .4byte _080F4D10 + .4byte _080F4D10 + .4byte _080F4D1C + .4byte _080F4D1C + .4byte _080F4D1C + .4byte _080F4D1C + .4byte _080F4D28 + .4byte _080F4D28 + .4byte _080F4D28 + .4byte _080F4D28 + .4byte _080F4D34 + .4byte _080F4D40 + .4byte _080F4D4C + .4byte _080F4D58 +_080F4CEC: + ldr r1, =0x0203a030 + movs r0, 0x5 + strb r0, [r1] + b _080F4D84 + .pool +_080F4CF8: + ldr r1, =0x0203a030 + movs r0, 0x6 + strb r0, [r1] + b _080F4D84 + .pool +_080F4D04: + ldr r1, =0x0203a030 + movs r0, 0x7 + strb r0, [r1] + b _080F4D84 + .pool +_080F4D10: + ldr r1, =0x0203a030 + movs r0, 0x8 + strb r0, [r1] + b _080F4D84 + .pool +_080F4D1C: + ldr r1, =0x0203a030 + movs r0, 0x9 + strb r0, [r1] + b _080F4D84 + .pool +_080F4D28: + ldr r1, =0x0203a030 + movs r0, 0xA + strb r0, [r1] + b _080F4D84 + .pool +_080F4D34: + ldr r1, =0x0203a030 + movs r0, 0xB + strb r0, [r1] + b _080F4D84 + .pool +_080F4D40: + ldr r1, =0x0203a030 + movs r0, 0xC + strb r0, [r1] + b _080F4D84 + .pool +_080F4D4C: + ldr r1, =0x0203a030 + movs r0, 0xD + strb r0, [r1] + b _080F4D84 + .pool +_080F4D58: + ldr r1, =0x0203a030 + movs r0, 0xE + strb r0, [r1] + b _080F4D84 + .pool +_080F4D64: + ldr r0, =0x02021dc4 + adds r1, r4, 0x4 + ldrb r2, [r4, 0x10] + bl sub_81DB5E8 + ldr r1, =0x0203a030 + movs r0, 0xF + strb r0, [r1] + b _080F4D84 + .pool +_080F4D80: + bl TVShowDone +_080F4D84: + ldr r0, =gUnknown_0858D4E4 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowSpotTheCuties + + thumb_func_start DoTVShowPokemonNewsBattleFrontier +DoTVShowPokemonNewsBattleFrontier: @ 80F4D9C + push {r4-r7,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r6, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r7, [r0] + adds r2, r0, 0 + cmp r7, 0x12 + bls _080F4DC4 + b _080F5014 +_080F4DC4: + lsls r0, r7, 2 + ldr r1, =_080F4DE8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F4DE8: + .4byte _080F4E34 + .4byte _080F4F18 + .4byte _080F4ECE + .4byte _080F4EF4 + .4byte _080F4EF4 + .4byte _080F4F18 + .4byte _080F4F18 + .4byte _080F4F18 + .4byte _080F4F18 + .4byte _080F4F18 + .4byte _080F4F18 + .4byte _080F4F18 + .4byte _080F4F18 + .4byte _080F4F18 + .4byte _080F4F3C + .4byte _080F4F74 + .4byte _080F4F9C + .4byte _080F4FE0 + .4byte _080F5004 +_080F4E34: + ldrb r0, [r6, 0xD] + subs r0, 0x1 + cmp r0, 0xC + bls _080F4E3E + b _080F5014 +_080F4E3E: + lsls r0, 2 + ldr r1, =_080F4E4C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F4E4C: + .4byte _080F4E80 + .4byte _080F4E86 + .4byte _080F4E8C + .4byte _080F4E92 + .4byte _080F4E98 + .4byte _080F4E9E + .4byte _080F4EA4 + .4byte _080F4EAA + .4byte _080F4EB0 + .4byte _080F4EB6 + .4byte _080F4EBC + .4byte _080F4EC2 + .4byte _080F4EC8 +_080F4E80: + movs r0, 0x1 + strb r0, [r2] + b _080F5014 +_080F4E86: + movs r0, 0x2 + strb r0, [r2] + b _080F5014 +_080F4E8C: + movs r0, 0x3 + strb r0, [r2] + b _080F5014 +_080F4E92: + movs r0, 0x4 + strb r0, [r2] + b _080F5014 +_080F4E98: + movs r0, 0x5 + strb r0, [r2] + b _080F5014 +_080F4E9E: + movs r0, 0x6 + strb r0, [r2] + b _080F5014 +_080F4EA4: + movs r0, 0x7 + strb r0, [r2] + b _080F5014 +_080F4EAA: + movs r0, 0x8 + strb r0, [r2] + b _080F5014 +_080F4EB0: + movs r0, 0x9 + strb r0, [r2] + b _080F5014 +_080F4EB6: + movs r0, 0xA + strb r0, [r2] + b _080F5014 +_080F4EBC: + movs r0, 0xB + strb r0, [r2] + b _080F5014 +_080F4EC2: + movs r0, 0xC + strb r0, [r2] + b _080F5014 +_080F4EC8: + movs r0, 0xD + strb r0, [r2] + b _080F5014 +_080F4ECE: + ldr r0, =0x02021cc4 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xC] + bl sub_81DB5E8 + ldrh r1, [r6, 0x2] + movs r0, 0x1 + bl sub_80EF340 + ldr r1, =0x0203a030 + movs r0, 0x10 + strb r0, [r1] + b _080F5014 + .pool +_080F4EF4: + ldr r0, =0x02021cc4 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xC] + bl sub_81DB5E8 + ldrh r1, [r6, 0x2] + movs r0, 0x1 + bl sub_80EF340 + ldr r1, =0x0203a030 + movs r0, 0xF + strb r0, [r1] + b _080F5014 + .pool +_080F4F18: + ldr r0, =0x02021cc4 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xC] + bl sub_81DB5E8 + ldrh r1, [r6, 0x2] + movs r0, 0x1 + bl sub_80EF340 + ldr r1, =0x0203a030 + movs r0, 0xE + strb r0, [r1] + b _080F5014 + .pool +_080F4F3C: + ldr r0, =0x02021cc4 + ldrh r1, [r6, 0x4] + movs r5, 0xB + muls r1, r5 + ldr r4, =gSpeciesNames + adds r1, r4 + bl CopyString + ldr r0, =0x02021dc4 + ldrh r1, [r6, 0x6] + muls r1, r5 + adds r1, r4 + bl CopyString + ldr r0, =0x02021ec4 + ldrh r1, [r6, 0x8] + muls r1, r5 + adds r1, r4 + b _080F4FEC + .pool +_080F4F74: + ldr r0, =0x02021cc4 + ldrh r1, [r6, 0x4] + movs r5, 0xB + muls r1, r5 + ldr r4, =gSpeciesNames + adds r1, r4 + bl CopyString + ldr r0, =0x02021dc4 + ldrh r1, [r6, 0x6] + muls r1, r5 + adds r1, r4 + b _080F4FEC + .pool +_080F4F9C: + ldr r0, =0x02021cc4 + ldrh r1, [r6, 0x4] + movs r5, 0xB + muls r1, r5 + ldr r4, =gSpeciesNames + adds r1, r4 + bl CopyString + ldr r0, =0x02021dc4 + ldrh r1, [r6, 0x6] + muls r1, r5 + adds r1, r4 + bl CopyString + ldr r0, =0x02021ec4 + ldrh r1, [r6, 0x8] + muls r1, r5 + adds r1, r4 + bl CopyString + ldr r1, =0x0203a030 + movs r0, 0x11 + strb r0, [r1] + b _080F5014 + .pool +_080F4FE0: + ldr r0, =0x02021cc4 + ldrh r2, [r6, 0xA] + movs r1, 0xB + muls r1, r2 + ldr r2, =gSpeciesNames + adds r1, r2 +_080F4FEC: + bl CopyString + ldr r1, =0x0203a030 + movs r0, 0x12 + strb r0, [r1] + b _080F5014 + .pool +_080F5004: + ldr r0, =0x02021cc4 + adds r1, r6, 0 + adds r1, 0x13 + ldrb r2, [r6, 0xC] + bl sub_81DB5E8 + bl TVShowDone +_080F5014: + ldr r0, =gUnknown_0858D524 + lsls r1, r7, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowPokemonNewsBattleFrontier + + thumb_func_start DoTVShowWhatsNo1InHoennToday +DoTVShowWhatsNo1InHoennToday: @ 80F5030 + push {r4,r5,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r5, [r0] + cmp r5, 0x8 + bls _080F5056 + b _080F5164 +_080F5056: + lsls r0, r5, 2 + ldr r1, =_080F5078 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F5078: + .4byte _080F509C + .4byte _080F5130 + .4byte _080F5130 + .4byte _080F5130 + .4byte _080F5130 + .4byte _080F5130 + .4byte _080F5130 + .4byte _080F5130 + .4byte _080F5154 +_080F509C: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x5] + bl sub_81DB5E8 + ldrb r0, [r4, 0x4] + cmp r0, 0x6 + bhi _080F5164 + lsls r0, 2 + ldr r1, =_080F50C0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F50C0: + .4byte _080F50DC + .4byte _080F50E8 + .4byte _080F50F4 + .4byte _080F5100 + .4byte _080F510C + .4byte _080F5118 + .4byte _080F5124 +_080F50DC: + ldr r1, =0x0203a030 + movs r0, 0x1 + strb r0, [r1] + b _080F5164 + .pool +_080F50E8: + ldr r1, =0x0203a030 + movs r0, 0x2 + strb r0, [r1] + b _080F5164 + .pool +_080F50F4: + ldr r1, =0x0203a030 + movs r0, 0x3 + strb r0, [r1] + b _080F5164 + .pool +_080F5100: + ldr r1, =0x0203a030 + movs r0, 0x4 + strb r0, [r1] + b _080F5164 + .pool +_080F510C: + ldr r1, =0x0203a030 + movs r0, 0x5 + strb r0, [r1] + b _080F5164 + .pool +_080F5118: + ldr r1, =0x0203a030 + movs r0, 0x6 + strb r0, [r1] + b _080F5164 + .pool +_080F5124: + ldr r1, =0x0203a030 + movs r0, 0x7 + strb r0, [r1] + b _080F5164 + .pool +_080F5130: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x5] + bl sub_81DB5E8 + ldrh r1, [r4, 0x2] + movs r0, 0x1 + bl sub_80EF340 + ldr r1, =0x0203a030 + movs r0, 0x8 + strb r0, [r1] + b _080F5164 + .pool +_080F5154: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x5] + bl sub_81DB5E8 + bl TVShowDone +_080F5164: + ldr r0, =gUnknown_0858D570 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowWhatsNo1InHoennToday + + thumb_func_start sub_80F5180 +sub_80F5180: @ 80F5180 + push {r4,lr} + movs r1, 0 + movs r2, 0 + ldr r3, [r0, 0xC] + movs r4, 0x1 +_080F518A: + adds r0, r3, 0 + lsrs r0, r1 + ands r0, r4 + cmp r0, 0 + beq _080F519A + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 +_080F519A: + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1F + bls _080F518A + adds r0, r2, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80F5180 + + thumb_func_start sub_80F51AC +sub_80F51AC: @ 80F51AC + push {r4-r6,lr} + lsls r1, 24 + lsrs r4, r1, 24 + movs r2, 0 + movs r3, 0 + ldr r1, [r0, 0xC] + movs r5, 0x1 + ldr r6, =gUnknown_0858D690 +_080F51BC: + adds r0, r1, 0 + lsrs r0, r2 + ands r0, r5 + cmp r0, 0 + beq _080F51DA + cmp r3, r4 + bne _080F51D4 + adds r0, r2, r6 + ldrb r0, [r0] + b _080F51E6 + .pool +_080F51D4: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 +_080F51DA: + adds r0, r2, 0x1 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x1F + bls _080F51BC + movs r0, 0 +_080F51E6: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80F51AC + + thumb_func_start DoTVShowSecretBaseSecrets +DoTVShowSecretBaseSecrets: @ 80F51EC + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r5, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r2, [r0] + mov r9, r2 + adds r2, r0, 0 + mov r0, r9 + cmp r0, 0x2B + bls _080F521E + b _080F552A +_080F521E: + lsls r0, 2 + ldr r1, =_080F5240 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F5240: + .4byte _080F52F0 + .4byte _080F5348 + .4byte _080F53C4 + .4byte _080F5444 + .4byte _080F5498 + .4byte _080F5498 + .4byte _080F5498 + .4byte _080F54C4 + .4byte _080F54E8 + .4byte _080F54EC + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F54F0 + .4byte _080F5510 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 + .4byte _080F5526 +_080F52F0: + ldr r0, =0x02021cc4 + adds r1, r5, 0x4 + ldrb r2, [r5, 0x1C] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x1B] + bl sub_81DB5E8 + adds r0, r5, 0 + bl sub_80F5180 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _080F5328 + ldr r1, =0x0203a030 + movs r0, 0x8 + strb r0, [r1] + b _080F552A + .pool +_080F5328: + movs r0, 0x1 + strb r0, [r5, 0x12] + bl GenerateRandomNumber + ldr r4, =0x0203a031 + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + strb r0, [r4] + ldrb r1, [r4] + b _080F542A + .pool +_080F5348: + ldr r0, =0x02021dc4 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x1B] + bl sub_81DB5E8 + adds r0, r5, 0 + bl sub_80F5180 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x1 + beq _080F53DE + cmp r6, 0x2 + beq _080F5370 + movs r4, 0 + b _080F538A + .pool +_080F5370: + strb r6, [r5, 0x12] + ldr r0, =0x0203a031 + ldrb r0, [r0] + cmp r0, 0 + bne _080F5384 + adds r0, r5, 0 + movs r1, 0x1 + b _080F542C + .pool +_080F5384: + adds r0, r5, 0 + movs r1, 0 + b _080F542C +_080F538A: + bl GenerateRandomNumber + ldr r7, =0x0203a031 + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + strb r0, [r7, 0x1] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r7] + cmp r0, r1 + bne _080F53B2 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x0000fffe + cmp r4, r0 + bls _080F538A +_080F53B2: + movs r0, 0x2 + strb r0, [r5, 0x12] + ldrb r1, [r7, 0x1] + b _080F542A + .pool +_080F53C4: + ldr r0, =0x02021dc4 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x1B] + bl sub_81DB5E8 + adds r0, r5, 0 + bl sub_80F5180 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0x2 + bne _080F53F0 +_080F53DE: + ldr r1, =0x0203a030 + movs r0, 0x9 + strb r0, [r1] + b _080F552A + .pool +_080F53F0: + movs r4, 0 + ldr r7, =0x0203a031 + ldr r2, =0x0000fffe + mov r8, r2 +_080F53F8: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __modsi3 + strb r0, [r7, 0x2] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r7] + cmp r0, r1 + beq _080F5418 + ldrb r2, [r7, 0x1] + cmp r0, r2 + bne _080F5422 +_080F5418: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r8 + bls _080F53F8 +_080F5422: + movs r0, 0x3 + strb r0, [r5, 0x12] + ldr r0, =0x0203a031 + ldrb r1, [r0, 0x2] +_080F542A: + adds r0, r5, 0 +_080F542C: + bl sub_80F51AC + ldr r1, =0x0203a030 + strb r0, [r1] + b _080F552A + .pool +_080F5444: + ldr r0, =0x02021cc4 + adds r1, r5, 0x4 + ldrb r2, [r5, 0x1C] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x1B] + bl sub_81DB5E8 + ldrh r1, [r5, 0x2] + movs r0, 0x2 + bl sub_80EF340 + ldrh r0, [r5, 0x2] + cmp r0, 0x1E + bhi _080F547C + ldr r1, =0x0203a030 + movs r0, 0x4 + strb r0, [r1] + b _080F552A + .pool +_080F547C: + cmp r0, 0x64 + bhi _080F548C + ldr r1, =0x0203a030 + movs r0, 0x5 + strb r0, [r1] + b _080F552A + .pool +_080F548C: + ldr r1, =0x0203a030 + movs r0, 0x6 + strb r0, [r1] + b _080F552A + .pool +_080F5498: + ldr r0, =0x02021cc4 + adds r1, r5, 0x4 + ldrb r2, [r5, 0x1C] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x1B] + bl sub_81DB5E8 + ldr r1, =0x0203a030 + movs r0, 0x7 + strb r0, [r1] + b _080F552A + .pool +_080F54C4: + ldr r0, =0x02021cc4 + adds r1, r5, 0x4 + ldrb r2, [r5, 0x1C] + bl sub_81DB5E8 + ldr r0, =0x02021dc4 + adds r1, r5, 0 + adds r1, 0x13 + ldrb r2, [r5, 0x1B] + bl sub_81DB5E8 + bl TVShowDone + b _080F552A + .pool +_080F54E8: + movs r0, 0x3 + b _080F5528 +_080F54EC: + movs r0, 0x3 + b _080F5528 +_080F54F0: + ldr r4, =0x02021dc4 + ldrh r0, [r5, 0x10] + bl itemid_get_item + adds r1, r0, 0 + adds r0, r4, 0 + bl CopyString + ldr r1, =0x0203a030 + ldrb r0, [r5, 0x12] + strb r0, [r1] + b _080F552A + .pool +_080F5510: + adds r0, r5, 0 + adds r0, 0x22 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080F5522 + movs r0, 0x16 + b _080F5528 +_080F5522: + movs r0, 0x15 + b _080F5528 +_080F5526: + ldrb r0, [r5, 0x12] +_080F5528: + strb r0, [r2] +_080F552A: + ldr r0, =gUnknown_0858D594 + mov r2, r9 + lsls r1, r2, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowSecretBaseSecrets + + thumb_func_start DoTVShowSafariFanClub +DoTVShowSafariFanClub: @ 80F5548 + push {r4,r5,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r0, =0x0203a030 + ldrb r5, [r0] + adds r2, r0, 0 + cmp r5, 0xA + bls _080F5570 + b _080F56BC +_080F5570: + lsls r0, r5, 2 + ldr r1, =_080F5594 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080F5594: + .4byte _080F55C0 + .4byte _080F55DC + .4byte _080F5614 + .4byte _080F5628 + .4byte _080F569A + .4byte _080F562E + .4byte _080F5650 + .4byte _080F5680 + .4byte _080F5694 + .4byte _080F569A + .4byte _080F56B8 +_080F55C0: + ldrb r1, [r4, 0x2] + cmp r1, 0 + bne _080F55CC + movs r0, 0x6 + strb r0, [r2] + b _080F56BC +_080F55CC: + cmp r1, 0x3 + bhi _080F55D6 + movs r0, 0x5 + strb r0, [r2] + b _080F56BC +_080F55D6: + movs r0, 0x1 + strb r0, [r2] + b _080F56BC +_080F55DC: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x4] + bl sub_81DB5E8 + ldrb r1, [r4, 0x2] + movs r0, 0x1 + bl sub_80EF340 + ldrb r0, [r4, 0x3] + cmp r0, 0 + bne _080F5608 + ldr r1, =0x0203a030 + movs r0, 0x3 + strb r0, [r1] + b _080F56BC + .pool +_080F5608: + ldr r1, =0x0203a030 + movs r0, 0x2 + strb r0, [r1] + b _080F56BC + .pool +_080F5614: + ldrb r1, [r4, 0x3] + movs r0, 0x1 + bl sub_80EF340 + ldr r1, =0x0203a030 + movs r0, 0x4 + strb r0, [r1] + b _080F56BC + .pool +_080F5628: + movs r0, 0x4 + strb r0, [r2] + b _080F56BC +_080F562E: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x4] + bl sub_81DB5E8 + ldrb r1, [r4, 0x2] + movs r0, 0x1 + bl sub_80EF340 + ldrb r0, [r4, 0x3] + cmp r0, 0 + beq _080F5662 + b _080F5674 + .pool +_080F5650: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x4] + bl sub_81DB5E8 + ldrb r0, [r4, 0x3] + cmp r0, 0 + bne _080F5674 +_080F5662: + ldr r1, =0x0203a030 + movs r0, 0x8 + strb r0, [r1] + b _080F56BC + .pool +_080F5674: + ldr r1, =0x0203a030 + movs r0, 0x7 + strb r0, [r1] + b _080F56BC + .pool +_080F5680: + ldrb r1, [r4, 0x3] + movs r0, 0x1 + bl sub_80EF340 + ldr r1, =0x0203a030 + movs r0, 0x9 + strb r0, [r1] + b _080F56BC + .pool +_080F5694: + movs r0, 0x9 + strb r0, [r2] + b _080F56BC +_080F569A: + ldr r0, =0x02021cc4 + adds r1, r4, 0 + adds r1, 0x13 + ldrb r2, [r4, 0x4] + bl sub_81DB5E8 + ldr r1, =0x0203a030 + movs r0, 0xA + strb r0, [r1] + b _080F56BC + .pool +_080F56B8: + bl TVShowDone +_080F56BC: + ldr r0, =gUnknown_0858D640 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowSafariFanClub + + thumb_func_start DoTVShowPokemonContestLiveUpdates2 +DoTVShowPokemonContestLiveUpdates2: @ 80F56D4 + push {r4-r6,lr} + ldr r2, =0x03005d8c + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =0x000027cc + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] + ldr r6, =0x0203a030 + ldrb r5, [r6] + cmp r5, 0x2 + bgt _080F5718 + cmp r5, 0x1 + bge _080F5744 + cmp r5, 0 + beq _080F571E + b _080F575E + .pool +_080F5718: + cmp r5, 0x3 + beq _080F574E + b _080F575E +_080F571E: + ldr r0, =0x02021cc4 + ldrb r1, [r4, 0xA] + bl sub_818E868 + ldrb r1, [r4, 0x16] + cmp r1, 0x1 + bne _080F5734 + strb r1, [r6] + b _080F575E + .pool +_080F5734: + cmp r1, 0 + bne _080F573E + movs r0, 0x2 + strb r0, [r6] + b _080F575E +_080F573E: + movs r0, 0x3 + strb r0, [r6] + b _080F575E +_080F5744: + ldr r0, =0x02021ec4 + adds r1, r4, 0x2 + ldrb r2, [r4, 0x17] + bl sub_81DB5E8 +_080F574E: + ldr r0, =0x02021dc4 + adds r1, r4, 0 + adds r1, 0xB + ldrb r2, [r4, 0x18] + bl sub_81DB5E8 + bl TVShowDone +_080F575E: + ldr r0, =gUnknown_0858D384 + lsls r1, r5, 2 + adds r1, r0 + ldr r0, [r1] + bl box_related_two__2 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end DoTVShowPokemonContestLiveUpdates2 + + thumb_func_start TVShowDone +TVShowDone: @ 80F577C + ldr r1, =0x020375f0 + movs r0, 0x1 + strh r0, [r1] + ldr r1, =0x0203a030 + movs r0, 0 + strb r0, [r1] + ldr r0, =0x03005d8c + ldr r2, [r0] + ldr r0, =0x020375e0 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r2, r0 + ldr r0, =0x000027cd + adds r2, r0 + movs r0, 0 + strb r0, [r2] + bx lr + .pool + thumb_func_end TVShowDone + + thumb_func_start ResetTVShowState +ResetTVShowState: @ 80F57B8 + ldr r1, =0x0203a030 + movs r0, 0 + strb r0, [r1] + bx lr + .pool + thumb_func_end ResetTVShowState + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/var.s b/asm/var.s new file mode 100644 index 000000000..e976b683b --- /dev/null +++ b/asm/var.s @@ -0,0 +1,105 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start GetVarPointer +@ u16 *GetVarPointer(u16 varId) +GetVarPointer: @ 809D648 + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + adds r2, r1, 0 + ldr r0, =0x00003fff + cmp r1, r0 + bhi _0809D660 + movs r0, 0 + b _0809D688 + .pool +_0809D660: + lsls r0, r1, 16 + cmp r0, 0 + bge _0809D67C + ldr r0, =gUnknown_081DBA0C + ldr r2, =0xffff8000 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + b _0809D688 + .pool +_0809D67C: + ldr r0, =0x03005d8c + lsls r1, r2, 1 + ldr r2, =0xffff939c + adds r1, r2 + ldr r0, [r0] + adds r0, r1 +_0809D688: + pop {r1} + bx r1 + .pool + thumb_func_end GetVarPointer + + thumb_func_start VarGet +@ u16 VarGet(u16 varId) +VarGet: @ 809D694 + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl GetVarPointer + cmp r0, 0 + beq _0809D6A8 + ldrh r0, [r0] + b _0809D6AA +_0809D6A8: + adds r0, r4, 0 +_0809D6AA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end VarGet + + thumb_func_start VarSet +@ bool8 VarSet(u16 varId, u16 value) +VarSet: @ 809D6B0 + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r4, r1, 16 + bl GetVarPointer + cmp r0, 0 + beq _0809D6C8 + strh r4, [r0] + movs r0, 0x1 + b _0809D6CA +_0809D6C8: + movs r0, 0 +_0809D6CA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end VarSet + + thumb_func_start VarGetFieldObjectGraphicsId +@ u8 VarGetFieldObjectGraphicsId(u8 index) +VarGetFieldObjectGraphicsId: @ 809D6D0 + push {lr} + lsls r0, 24 + lsrs r0, 8 + ldr r1, =0x40100000 + adds r0, r1 + lsrs r0, 16 + bl VarGet + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .pool + thumb_func_end VarGetFieldObjectGraphicsId + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/wallclock.s b/asm/wallclock.s new file mode 100644 index 000000000..caf2e3007 --- /dev/null +++ b/asm/wallclock.s @@ -0,0 +1,1515 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_81347B4 +sub_81347B4: @ 81347B4 + push {lr} + bl LoadOamFromSprites + bl ProcessObjectCopyRequests + bl copy_pal_bg_faded_to_pal_ram + pop {r0} + bx r0 + thumb_func_end sub_81347B4 + + thumb_func_start LoadWallClockGraphics +LoadWallClockGraphics: @ 81347C8 + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + movs r0, 0 + bl SetVBlankCallback + movs r0, 0 + movs r1, 0 + bl SetGpuReg + movs r0, 0xE + movs r1, 0 + bl SetGpuReg + movs r0, 0xC + movs r1, 0 + bl SetGpuReg + movs r0, 0xA + movs r1, 0 + bl SetGpuReg + movs r0, 0x8 + movs r1, 0 + bl SetGpuReg + 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 r3, 0xC0 + lsls r3, 19 + movs r4, 0xC0 + lsls r4, 9 + add r0, sp, 0x4 + mov r8, r0 + mov r2, sp + movs r6, 0 + ldr r1, =0x040000d4 + movs r5, 0x80 + lsls r5, 5 + ldr r7, =0x81000800 + movs r0, 0x81 + lsls r0, 24 + mov r12, r0 +_0813486C: + strh r6, [r2] + mov r0, sp + str r0, [r1] + str r3, [r1, 0x4] + str r7, [r1, 0x8] + ldr r0, [r1, 0x8] + adds r3, r5 + subs r4, r5 + cmp r4, r5 + bhi _0813486C + strh r6, [r2] + mov r2, sp + str r2, [r1] + str r3, [r1, 0x4] + lsrs r0, r4, 1 + mov r2, r12 + orrs r0, r2 + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + movs r0, 0xE0 + lsls r0, 19 + movs r3, 0x80 + lsls r3, 3 + movs r4, 0 + str r4, [sp, 0x4] + ldr r2, =0x040000d4 + mov r1, r8 + str r1, [r2] + str r0, [r2, 0x4] + lsrs r0, r3, 2 + movs r1, 0x85 + lsls r1, 24 + orrs r0, r1 + str r0, [r2, 0x8] + ldr r0, [r2, 0x8] + movs r1, 0xA0 + lsls r1, 19 + mov r0, sp + strh r4, [r0] + str r0, [r2] + str r1, [r2, 0x4] + lsrs r3, 1 + movs r0, 0x81 + lsls r0, 24 + orrs r3, r0 + str r3, [r2, 0x8] + ldr r0, [r2, 0x8] + ldr r0, =gUnknown_08DCC05C + movs r1, 0xC0 + lsls r1, 19 + bl LZ77UnCompVram + ldr r0, =0x020375e0 + ldrh r0, [r0] + cmp r0, 0 + bne _081348FC + ldr r0, =gUnknown_08DCC01C + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply + b _08134906 + .pool +_081348FC: + ldr r0, =gUnknown_08DCC03C + movs r1, 0 + movs r2, 0x20 + bl gpu_pal_apply +_08134906: + bl sub_8098C64 + movs r1, 0xE0 + movs r2, 0x20 + bl gpu_pal_apply + ldr r0, =gUnknown_085B21D4 + movs r1, 0xC0 + movs r2, 0x8 + bl gpu_pal_apply + movs r0, 0 + bl ResetBgsAndClearDma3BusyFlags + ldr r1, =gUnknown_085B21FC + movs r0, 0 + movs r2, 0x3 + bl InitBgsFromTemplates + ldr r0, =gUnknown_085B21DC + bl InitWindows + bl DeactivateAllTextPrinters + movs r1, 0x94 + lsls r1, 2 + movs r0, 0 + movs r2, 0xD0 + bl sub_809882C + bl clear_scheduled_bg_copies_to_vram + bl remove_some_task + bl ResetTasks + bl ResetAllObjectData + bl sub_80A1A74 + bl ResetObjectPaletteAllocator + ldr r0, =gUnknown_085B2208 + bl LoadCompressedObjectPic + ldr r0, =gUnknown_085B2218 + bl LoadTaggedObjectPalettes + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end LoadWallClockGraphics + + thumb_func_start sub_813498C +sub_813498C: @ 813498C + push {lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe + movs r0, 0x1 + bl EnableInterrupts + ldr r0, =sub_81347B4 + bl SetVBlankCallback + ldr r0, =sub_8134C9C + bl SetMainCallback2 + 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 r1, 0x82 + lsls r1, 5 + movs r0, 0 + bl SetGpuReg + movs r0, 0 + bl ShowBg + movs r0, 0x2 + bl ShowBg + movs r0, 0x3 + bl ShowBg + add sp, 0x4 + pop {r0} + bx r0 + .pool + thumb_func_end sub_813498C + + thumb_func_start Cb2_StartWallClock +Cb2_StartWallClock: @ 81349F4 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0xC + bl LoadWallClockGraphics + ldr r0, =gUnknown_08DCC648 + ldr r1, =0x06003800 + bl LZ77UnCompVram + ldr r0, =sub_8134CB8 + movs r1, 0 + bl CreateTask + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + mov r8, r1 + movs r1, 0xA + strh r1, [r0, 0xC] + mov r2, r8 + strh r2, [r0, 0xE] + strh r2, [r0, 0x10] + strh r2, [r0, 0x12] + strh r2, [r0, 0x14] + strh r2, [r0, 0x8] + movs r1, 0x96 + lsls r1, 1 + strh r1, [r0, 0xA] + ldr r0, =gUnknown_085B2250 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02020630 + mov r9, r1 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r9 + strh r6, [r1, 0x2E] + ldrb r2, [r1, 0x1] + movs r5, 0x4 + negs r5, r5 + adds r0, r5, 0 + ands r0, r2 + movs r2, 0x1 + mov r10, r2 + mov r2, r10 + orrs r0, r2 + strb r0, [r1, 0x1] + ldrb r2, [r1, 0x3] + movs r4, 0x3F + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1, 0x3] + ldr r0, =gUnknown_085B2268 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r9 + strh r6, [r1, 0x2E] + ldrb r0, [r1, 0x1] + ands r5, r0 + mov r0, r10 + orrs r5, r0 + strb r5, [r1, 0x1] + ldrb r0, [r1, 0x3] + ands r4, r0 + movs r0, 0x2 + orrs r4, r0 + strb r4, [r1, 0x3] + ldr r0, =gUnknown_085B22A0 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r9 + strh r6, [r1, 0x2E] + movs r0, 0x2D + strh r0, [r1, 0x30] + ldr r0, =gUnknown_085B22B8 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + add r1, r9 + strh r6, [r1, 0x2E] + movs r0, 0x5A + strh r0, [r1, 0x30] + bl sub_813498C + ldr r2, =gUnknown_085EFAE0 + movs r0, 0x1 + str r0, [sp] + mov r1, r8 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0x1 + bl PutWindowTilemap + 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-r6} + pop {r0} + bx r0 + .pool + thumb_func_end Cb2_StartWallClock + + thumb_func_start Cb2_ViewWallClock +Cb2_ViewWallClock: @ 8134B44 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + bl LoadWallClockGraphics + ldr r0, =gUnknown_08DCC908 + ldr r1, =0x06003800 + bl LZ77UnCompVram + ldr r0, =sub_8134F10 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r7, 0 + bl sub_8135130 + ldr r1, =0x03005e00 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + movs r1, 0x12 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _08134B9C + movs r2, 0x2D + mov r10, r2 + movs r0, 0x5A + str r0, [sp, 0xC] + b _08134BA4 + .pool +_08134B9C: + movs r1, 0x5A + mov r10, r1 + movs r2, 0x87 + str r2, [sp, 0xC] +_08134BA4: + ldr r0, =gUnknown_085B2250 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0x1 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + ldr r6, =0x02020630 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + movs r0, 0 + mov r9, r0 + strh r7, [r1, 0x2E] + ldrb r2, [r1, 0x1] + movs r5, 0x4 + negs r5, r5 + adds r0, r5, 0 + ands r0, r2 + movs r2, 0x1 + mov r8, r2 + mov r2, r8 + orrs r0, r2 + strb r0, [r1, 0x1] + ldrb r2, [r1, 0x3] + movs r4, 0x3F + negs r4, r4 + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1, 0x3] + ldr r0, =gUnknown_085B2268 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + strh r7, [r1, 0x2E] + ldrb r0, [r1, 0x1] + ands r5, r0 + mov r0, r8 + orrs r5, r0 + strb r5, [r1, 0x1] + ldrb r0, [r1, 0x3] + ands r4, r0 + movs r0, 0x2 + orrs r4, r0 + strb r4, [r1, 0x3] + ldr r0, =gUnknown_085B22A0 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + strh r7, [r1, 0x2E] + mov r2, r10 + strh r2, [r1, 0x30] + ldr r0, =gUnknown_085B22B8 + movs r1, 0x78 + movs r2, 0x50 + movs r3, 0x2 + bl AddObjectToFront + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + strh r7, [r1, 0x2E] + mov r0, sp + ldrh r0, [r0, 0xC] + strh r0, [r1, 0x30] + bl sub_813498C + ldr r2, =gUnknown_085EFAE8 + movs r0, 0x1 + str r0, [sp] + mov r1, r9 + str r1, [sp, 0x4] + str r1, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0x1 + bl PutWindowTilemap + movs r0, 0x2 + bl schedule_bg_copy_tilemap_to_vram + 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 Cb2_ViewWallClock + + thumb_func_start sub_8134C9C +sub_8134C9C: @ 8134C9C + push {lr} + bl RunTasks + bl CallObjectCallbacks + bl PrepareSpritesForOamLoad + bl do_scheduled_bg_tilemap_copies_to_vram + bl fade_and_return_progress_probably + pop {r0} + bx r0 + thumb_func_end sub_8134C9C + + thumb_func_start sub_8134CB8 +sub_8134CB8: @ 8134CB8 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08134CD8 + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8134CE8 + str r0, [r1] +_08134CD8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8134CB8 + + thumb_func_start sub_8134CE8 +sub_8134CE8: @ 8134CE8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =0x03005e00 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r5, r0, r1 + movs r1, 0x8 + ldrsh r0, [r5, r1] + movs r1, 0x6 + bl __modsi3 + lsls r0, 16 + cmp r0, 0 + beq _08134D1C + ldrh r0, [r5, 0x8] + ldrb r1, [r5, 0x10] + ldrb r2, [r5, 0x14] + bl sub_8134FFC + strh r0, [r5, 0x8] + b _08134DBE + .pool +_08134D1C: + movs r2, 0xE + ldrsh r1, [r5, r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + strh r0, [r5, 0x8] + movs r3, 0xC + ldrsh r0, [r5, r3] + movs r1, 0xC + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + lsls r4, r0, 4 + subs r4, r0 + lsls r4, 1 + movs r1, 0xE + ldrsh r0, [r5, r1] + movs r1, 0xA + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + adds r4, r1 + strh r4, [r5, 0xA] + ldr r2, =0x030022c0 + ldrh r0, [r2, 0x2E] + movs r3, 0x1 + adds r1, r3, 0 + ands r1, r0 + cmp r1, 0 + beq _08134D70 + ldr r0, =sub_8134DC4 + str r0, [r5] + b _08134DBE + .pool +_08134D70: + strh r1, [r5, 0x10] + ldrh r1, [r2, 0x2C] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08134D7E + strh r3, [r5, 0x10] +_08134D7E: + ldrh r1, [r2, 0x2C] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08134D8C + movs r0, 0x2 + strh r0, [r5, 0x10] +_08134D8C: + ldrh r1, [r5, 0x10] + movs r2, 0x10 + ldrsh r0, [r5, r2] + cmp r0, 0 + beq _08134DBC + ldrh r2, [r5, 0x14] + movs r3, 0x14 + ldrsh r0, [r5, r3] + cmp r0, 0xFE + bgt _08134DA4 + adds r0, r2, 0x1 + strh r0, [r5, 0x14] +_08134DA4: + ldrh r0, [r5, 0x8] + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r5, 0x14] + bl sub_8134FFC + strh r0, [r5, 0x8] + ldrb r1, [r5, 0x10] + adds r0, r6, 0 + bl sub_813504C + b _08134DBE +_08134DBC: + strh r0, [r5, 0x14] +_08134DBE: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8134CE8 + + thumb_func_start sub_8134DC4 +sub_8134DC4: @ 8134DC4 + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r5, 0x94 + lsls r5, 2 + movs r0, 0 + movs r1, 0 + adds r2, r5, 0 + movs r3, 0xD + bl SetWindowBorderStyle + ldr r2, =gUnknown_085EFAC6 + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0x1 + movs r3, 0 + bl Print + movs r0, 0 + bl PutWindowTilemap + movs r0, 0 + bl schedule_bg_copy_tilemap_to_vram + ldr r0, =gUnknown_085B21F4 + adds r1, r5, 0 + movs r2, 0xD + movs r3, 0x1 + bl CreateYesNoMenu + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =c3_80BF560 + str r1, [r0] + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8134DC4 + + thumb_func_start c3_80BF560 +c3_80BF560: @ 8134E30 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8198C58 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _08134E56 + cmp r1, 0 + bgt _08134E50 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08134E74 + b _08134E96 +_08134E50: + cmp r1, 0x1 + beq _08134E74 + b _08134E96 +_08134E56: + movs r0, 0x5 + bl audio_play + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8134EA4 + b _08134E94 + .pool +_08134E74: + movs r0, 0x5 + bl audio_play + movs r0, 0 + movs r1, 0 + bl sub_8198070 + movs r0, 0 + bl ClearWindowTilemap + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8134CE8 +_08134E94: + str r0, [r1] +_08134E96: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end c3_80BF560 + + thumb_func_start sub_8134EA4 +sub_8134EA4: @ 8134EA4 + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x03005e00 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + adds r4, r1 + movs r1, 0xC + ldrsh r0, [r4, r1] + movs r2, 0xE + ldrsh r1, [r4, r2] + bl GameFreakRTC_CalcRTCToLocalDelta_DayZero + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =c2_080111BC + str r0, [r4] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8134EA4 + + thumb_func_start c2_080111BC +c2_080111BC: @ 8134EE8 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08134F02 + bl FreeAllWindowBuffers + ldr r0, =0x030022c0 + ldr r0, [r0, 0x8] + bl SetMainCallback2 +_08134F02: + pop {r0} + bx r0 + .pool + thumb_func_end c2_080111BC + + thumb_func_start sub_8134F10 +sub_8134F10: @ 8134F10 + push {lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08134F30 + ldr r0, =0x03005e00 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8134F40 + str r0, [r1] +_08134F30: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8134F10 + + thumb_func_start sub_8134F40 +sub_8134F40: @ 8134F40 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8135130 + ldr r0, =0x030022c0 + ldrh r1, [r0, 0x2E] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08134F66 + ldr r0, =0x03005e00 + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 3 + adds r1, r0 + ldr r0, =sub_8134F78 + str r0, [r1] +_08134F66: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8134F40 + + thumb_func_start sub_8134F78 +sub_8134F78: @ 8134F78 + 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 pal_fade_maybe + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_8134FB0 + str r1, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8134F78 + + thumb_func_start sub_8134FB0 +sub_8134FB0: @ 8134FB0 + push {lr} + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08134FC6 + ldr r0, =0x030022c0 + ldr r0, [r0, 0x8] + bl SetMainCallback2 +_08134FC6: + pop {r0} + bx r0 + .pool + thumb_func_end sub_8134FB0 + + thumb_func_start sub_8134FD4 +sub_8134FD4: @ 8134FD4 + push {lr} + lsls r0, 16 + lsrs r0, 16 + adds r1, r0, 0 + cmp r0, 0x3C + bls _08134FE4 + movs r0, 0x6 + b _08134FF6 +_08134FE4: + cmp r0, 0x1E + bls _08134FEC + movs r0, 0x3 + b _08134FF6 +_08134FEC: + cmp r1, 0xA + bhi _08134FF4 + movs r0, 0x1 + b _08134FF6 +_08134FF4: + movs r0, 0x2 +_08134FF6: + pop {r1} + bx r1 + thumb_func_end sub_8134FD4 + + thumb_func_start sub_8134FFC +sub_8134FFC: @ 8134FFC + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r2, 24 + adds r0, r2, 0 + bl sub_8134FD4 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r5, 0x1 + beq _0813501E + cmp r5, 0x2 + beq _08135030 + b _08135044 +_0813501E: + cmp r4, 0 + beq _08135026 + subs r0, r4, r1 + b _0813503C +_08135026: + movs r2, 0xB4 + lsls r2, 1 + adds r0, r2, 0 + subs r0, r1 + b _0813503C +_08135030: + movs r0, 0xB4 + lsls r0, 1 + subs r0, r1 + cmp r4, r0 + bge _08135042 + adds r0, r4, r1 +_0813503C: + lsls r0, 16 + lsrs r4, r0, 16 + b _08135044 +_08135042: + movs r4, 0 +_08135044: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8134FFC + + thumb_func_start sub_813504C +sub_813504C: @ 813504C + push {r4-r6,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + cmp r4, 0x1 + beq _08135060 + cmp r4, 0x2 + beq _081350A0 + b _081350DE +_08135060: + ldr r0, =0x03005e00 + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + ldrh r2, [r1, 0xE] + movs r5, 0xE + ldrsh r0, [r1, r5] + cmp r0, 0 + ble _08135080 + subs r0, r2, 0x1 + strh r0, [r1, 0xE] + b _081350DE + .pool +_08135080: + movs r0, 0x3B + strh r0, [r1, 0xE] + ldrh r2, [r1, 0xC] + movs r6, 0xC + ldrsh r0, [r1, r6] + cmp r0, 0 + ble _08135092 + subs r0, r2, 0x1 + b _08135094 +_08135092: + movs r0, 0x17 +_08135094: + strh r0, [r1, 0xC] + adds r0, r3, 0 + adds r1, r4, 0 + bl sub_81350E8 + b _081350DE +_081350A0: + ldr r0, =0x03005e00 + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 3 + adds r1, r0 + ldrh r2, [r1, 0xE] + movs r5, 0xE + ldrsh r0, [r1, r5] + cmp r0, 0x3A + bgt _081350C0 + adds r0, r2, 0x1 + strh r0, [r1, 0xE] + b _081350DE + .pool +_081350C0: + movs r5, 0 + strh r5, [r1, 0xE] + ldrh r2, [r1, 0xC] + movs r6, 0xC + ldrsh r0, [r1, r6] + cmp r0, 0x16 + bgt _081350D4 + adds r0, r2, 0x1 + strh r0, [r1, 0xC] + b _081350D6 +_081350D4: + strh r5, [r1, 0xC] +_081350D6: + adds r0, r3, 0 + adds r1, r4, 0 + bl sub_81350E8 +_081350DE: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_813504C + + thumb_func_start sub_81350E8 +sub_81350E8: @ 81350E8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r3, r1, 24 + ldr r2, =0x03005e00 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0xC] + cmp r3, 0x1 + beq _0813510C + cmp r3, 0x2 + beq _0813511E + b _0813512A + .pool +_0813510C: + cmp r0, 0xB + beq _08135116 + cmp r0, 0x17 + beq _0813511A + b _0813512A +_08135116: + movs r0, 0 + b _08135128 +_0813511A: + strh r3, [r1, 0x12] + b _0813512A +_0813511E: + cmp r0, 0 + beq _08135128 + cmp r0, 0xC + bne _0813512A + movs r0, 0x1 +_08135128: + strh r0, [r1, 0x12] +_0813512A: + pop {r0} + bx r0 + thumb_func_end sub_81350E8 + + thumb_func_start sub_8135130 +sub_8135130: @ 8135130 + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl GameFreakRTC_CalcLocalDateTime + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r6, r0, r1 + ldr r5, =0x03005cf8 + movs r0, 0x2 + ldrsb r0, [r5, r0] + strh r0, [r6, 0xC] + movs r0, 0x3 + ldrsb r0, [r5, r0] + strh r0, [r6, 0xE] + movs r0, 0xE + ldrsh r1, [r6, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 1 + strh r0, [r6, 0x8] + movs r1, 0xC + ldrsh r0, [r6, r1] + movs r1, 0xC + bl __modsi3 + lsls r0, 16 + asrs r0, 16 + lsls r4, r0, 4 + subs r4, r0 + lsls r4, 1 + movs r1, 0xE + ldrsh r0, [r6, r1] + movs r1, 0xA + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + adds r4, r1 + strh r4, [r6, 0xA] + movs r0, 0x2 + ldrsb r0, [r5, r0] + cmp r0, 0xB + bgt _081351A0 + movs r0, 0 + b _081351A2 + .pool +_081351A0: + movs r0, 0x1 +_081351A2: + strh r0, [r6, 0x12] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8135130 + + thumb_func_start sub_81351AC +sub_81351AC: @ 81351AC + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + ldr r2, =0x03005e00 + movs r0, 0x2E + ldrsh r1, [r6, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r4, [r0, 0x8] + adds r7, r4, 0 + adds r0, r4, 0 + bl sine2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _081351D4 + adds r0, 0xF +_081351D4: + lsls r0, 12 + lsrs r5, r0, 16 + adds r0, r4, 0 + bl cosine2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _081351E8 + adds r0, 0xF +_081351E8: + lsls r1, r0, 12 + lsrs r1, 16 + lsls r3, r5, 16 + lsrs r2, r3, 16 + negs r3, r3 + lsrs r3, 16 + str r1, [sp] + movs r0, 0 + bl SetSpriteTransformationMatrix + ldr r1, =gUnknown_085B22D0 + lsls r2, r7, 1 + adds r0, r2, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r3, r0, 16 + adds r1, 0x1 + adds r2, r1 + movs r0, 0 + ldrsb r0, [r2, r0] + lsls r0, 16 + lsrs r2, r0, 16 + cmp r3, 0x80 + bls _08135224 + movs r1, 0xFF + lsls r1, 8 + adds r0, r1, 0 + orrs r3, r0 +_08135224: + cmp r2, 0x80 + bls _08135230 + movs r1, 0xFF + lsls r1, 8 + adds r0, r1, 0 + orrs r2, r0 +_08135230: + strh r3, [r6, 0x24] + strh r2, [r6, 0x26] + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81351AC + + thumb_func_start sub_8135244 +sub_8135244: @ 8135244 + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + ldr r2, =0x03005e00 + movs r0, 0x2E + ldrsh r1, [r6, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrh r4, [r0, 0xA] + adds r7, r4, 0 + adds r0, r4, 0 + bl sine2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0813526C + adds r0, 0xF +_0813526C: + lsls r0, 12 + lsrs r5, r0, 16 + adds r0, r4, 0 + bl cosine2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _08135280 + adds r0, 0xF +_08135280: + lsls r1, r0, 12 + lsrs r1, 16 + lsls r3, r5, 16 + lsrs r2, r3, 16 + negs r3, r3 + lsrs r3, 16 + str r1, [sp] + movs r0, 0x1 + bl SetSpriteTransformationMatrix + ldr r1, =gUnknown_085B22D0 + lsls r2, r7, 1 + adds r0, r2, r1 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + lsls r0, 16 + lsrs r3, r0, 16 + adds r1, 0x1 + adds r2, r1 + movs r0, 0 + ldrsb r0, [r2, r0] + lsls r0, 16 + lsrs r2, r0, 16 + cmp r3, 0x80 + bls _081352BC + movs r1, 0xFF + lsls r1, 8 + adds r0, r1, 0 + orrs r3, r0 +_081352BC: + cmp r2, 0x80 + bls _081352C8 + movs r1, 0xFF + lsls r1, 8 + adds r0, r1, 0 + orrs r2, r0 +_081352C8: + strh r3, [r6, 0x24] + strh r2, [r6, 0x26] + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8135244 + + thumb_func_start sub_81352DC +sub_81352DC: @ 81352DC + push {r4,lr} + adds r4, r0, 0 + ldr r2, =0x03005e00 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x12 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _0813531C + ldrh r1, [r4, 0x30] + adds r0, r1, 0 + subs r0, 0x3C + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1D + bhi _08135308 + adds r0, r1, 0x5 + strh r0, [r4, 0x30] +_08135308: + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0x3B + bgt _0813533C + adds r0, r1, 0x1 + b _0813533A + .pool +_0813531C: + ldrh r1, [r4, 0x30] + adds r0, r1, 0 + subs r0, 0x2E + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1D + bhi _0813532E + subs r0, r1, 0x5 + strh r0, [r4, 0x30] +_0813532E: + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0x4B + ble _0813533C + subs r0, r1, 0x1 +_0813533A: + strh r0, [r4, 0x30] +_0813533C: + ldrh r0, [r4, 0x30] + bl cosine2 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 4 + subs r1, r0 + lsls r0, r1, 1 + cmp r0, 0 + bge _08135354 + ldr r1, =0x00000fff + adds r0, r1 +_08135354: + asrs r0, 12 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x30] + bl sine2 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 4 + subs r1, r0 + lsls r0, r1, 1 + cmp r0, 0 + bge _08135370 + ldr r2, =0x00000fff + adds r0, r2 +_08135370: + asrs r0, 12 + strh r0, [r4, 0x26] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81352DC + + thumb_func_start sub_8135380 +sub_8135380: @ 8135380 + push {r4,lr} + adds r4, r0, 0 + ldr r2, =0x03005e00 + movs r0, 0x2E + ldrsh r1, [r4, r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + movs r1, 0x12 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _081353C0 + ldrh r1, [r4, 0x30] + adds r0, r1, 0 + subs r0, 0x69 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1D + bhi _081353AC + adds r0, r1, 0x5 + strh r0, [r4, 0x30] +_081353AC: + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0x68 + bgt _081353E0 + adds r0, r1, 0x1 + b _081353DE + .pool +_081353C0: + ldrh r1, [r4, 0x30] + adds r0, r1, 0 + subs r0, 0x5B + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1D + bhi _081353D2 + subs r0, r1, 0x5 + strh r0, [r4, 0x30] +_081353D2: + ldrh r1, [r4, 0x30] + movs r2, 0x30 + ldrsh r0, [r4, r2] + cmp r0, 0x78 + ble _081353E0 + subs r0, r1, 0x1 +_081353DE: + strh r0, [r4, 0x30] +_081353E0: + ldrh r0, [r4, 0x30] + bl cosine2 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 4 + subs r1, r0 + lsls r0, r1, 1 + cmp r0, 0 + bge _081353F8 + ldr r1, =0x00000fff + adds r0, r1 +_081353F8: + asrs r0, 12 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x30] + bl sine2 + lsls r0, 16 + asrs r0, 16 + lsls r1, r0, 4 + subs r1, r0 + lsls r0, r1, 1 + cmp r0, 0 + bge _08135414 + ldr r2, =0x00000fff + adds r0, r2 +_08135414: + asrs r0, 12 + strh r0, [r4, 0x26] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8135380 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/weather.s b/asm/weather.s new file mode 100644 index 000000000..abd8ad81b --- /dev/null +++ b/asm/weather.s @@ -0,0 +1,7819 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80AAFA4 +@ void sub_80AAFA4() +sub_80AAFA4: @ 80AAFA4 + push {r4-r6,lr} + ldr r0, =sub_80AB1B0 + bl FuncIsActiveTask + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _080AB060 + movs r0, 0x90 + lsls r0, 5 + bl AllocObjectPalette + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, =gUnknown_0854C270 + lsls r1, r5, 5 + ldr r2, =0x02037914 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + bl sub_80AB294 + ldr r4, =0x02038454 + ldr r1, =0x000006d5 + adds r0, r4, r1 + strb r5, [r0] + ldr r0, =0x00001201 + bl AllocObjectPalette + ldr r2, =0x000006d4 + adds r1, r4, r2 + strb r0, [r1] + ldr r1, =0x000006da + adds r0, r4, r1 + strb r6, [r0] + adds r2, 0x4 + adds r0, r4, r2 + strb r6, [r0] + adds r1, 0x4 + adds r0, r4, r1 + strb r6, [r0] + adds r2, 0xC + adds r0, r4, r2 + strb r6, [r0] + adds r1, 0x22 + adds r0, r4, r1 + strb r6, [r0] + adds r2, 0x17 + adds r0, r4, r2 + strb r6, [r0] + adds r1, 0x24 + adds r0, r4, r1 + strb r6, [r0] + adds r2, 0x1B + adds r0, r4, r2 + strb r6, [r0] + subs r1, 0xD + adds r0, r4, r1 + strb r6, [r0] + adds r2, 0x18 + adds r0, r4, r2 + strb r6, [r0] + subs r1, 0x1D + adds r0, r4, r1 + strb r6, [r0] + movs r0, 0x10 + movs r1, 0 + bl sub_80AC124 + movs r2, 0xDA + lsls r2, 3 + adds r0, r4, r2 + strb r6, [r0] + ldr r0, =0x000006c6 + adds r1, r4, r0 + movs r0, 0x3 + strb r0, [r1] + movs r1, 0xD9 + lsls r1, 3 + adds r0, r4, r1 + strb r6, [r0] + adds r2, 0x3 + adds r1, r4, r2 + movs r0, 0x1 + strb r0, [r1] + ldr r0, =sub_80AB160 + movs r1, 0x50 + bl CreateTask + ldr r1, =0x000006c9 + adds r4, r1 + strb r0, [r4] +_080AB060: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AAFA4 + + thumb_func_start weather_set +weather_set: @ 80AB098 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + beq _080AB0AE + cmp r4, 0x5 + beq _080AB0AE + cmp r4, 0xD + beq _080AB0AE + bl play_some_sound +_080AB0AE: + ldr r1, =0x02038454 + ldr r2, =0x000006d1 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, r4 + beq _080AB0D2 + movs r3, 0xDA + lsls r3, 3 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, r4 + bne _080AB0D2 + ldr r0, =gUnknown_0854C150 + lsls r1, r4, 4 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 +_080AB0D2: + ldr r1, =0x02038454 + ldr r2, =0x000006d3 + adds r0, r1, r2 + movs r2, 0 + strb r2, [r0] + ldr r3, =0x000006d1 + adds r0, r1, r3 + strb r4, [r0] + ldr r0, =0x000006ce + adds r1, r0 + strh r2, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end weather_set + + thumb_func_start sub_80AB104 +sub_80AB104: @ 80AB104 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl play_some_sound + ldr r0, =0x02038454 + movs r2, 0xDA + lsls r2, 3 + adds r1, r0, r2 + strb r4, [r1] + ldr r1, =0x000006d1 + adds r0, r1 + strb r4, [r0] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AB104 + + thumb_func_start sub_80AB130 +sub_80AB130: @ 80AB130 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl play_some_sound + ldr r1, =0x02038454 + movs r2, 0xDA + lsls r2, 3 + adds r0, r1, r2 + strb r4, [r0] + adds r2, 0x1 + adds r0, r1, r2 + strb r4, [r0] + movs r0, 0xD9 + lsls r0, 3 + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AB130 + + thumb_func_start sub_80AB160 +sub_80AB160: @ 80AB160 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, =0x02038454 + movs r1, 0xD9 + lsls r1, 3 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080AB198 + ldr r1, =gUnknown_0854C150 + movs r3, 0xDA + lsls r3, 3 + adds r0, r2, r3 + ldrb r0, [r0] + lsls r0, 4 + adds r1, 0x8 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + ldr r1, =0x03005e00 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + ldr r1, =sub_80AB1B0 + str r1, [r0] +_080AB198: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AB160 + + thumb_func_start sub_80AB1B0 +sub_80AB1B0: @ 80AB1B0 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r5, =0x02038454 + movs r0, 0xDA + lsls r0, 3 + adds r6, r5, r0 + ldr r1, =0x000006d1 + adds r7, r5, r1 + ldrb r0, [r6] + ldrb r2, [r7] + cmp r0, r2 + beq _080AB22C + ldr r0, =gUnknown_0854C150 + mov r9, r0 + ldrb r0, [r6] + lsls r0, 4 + mov r1, r9 + adds r1, 0xC + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080AB23C + ldr r1, =0x000006c6 + adds r1, r5 + mov r8, r1 + ldrb r0, [r1] + cmp r0, 0x2 + beq _080AB23C + ldrb r0, [r7] + lsls r0, 4 + add r0, r9 + ldr r0, [r0] + bl _call_via_r0 + ldr r2, =0x000006c3 + adds r0, r5, r2 + strb r4, [r0] + mov r0, r8 + strb r4, [r0] + ldrb r0, [r7] + strb r0, [r6] + adds r2, 0x10 + adds r1, r5, r2 + movs r0, 0x1 + strb r0, [r1] + b _080AB23C + .pool +_080AB22C: + ldr r0, =gUnknown_0854C150 + ldrb r1, [r6] + lsls r1, 4 + adds r0, 0x4 + adds r1, r0 + ldr r0, [r1] + bl _call_via_r0 +_080AB23C: + ldr r1, =gUnknown_0854C240 + ldr r0, =0x02038454 + ldr r2, =0x000006c6 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bl _call_via_r0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AB1B0 + + thumb_func_start sub_80AB26C +sub_80AB26C: @ 80AB26C + ldr r0, =0x02038454 + ldr r2, =0x000006c1 + adds r1, r0, r2 + movs r2, 0 + strb r2, [r1] + ldr r1, =0x000006c2 + adds r0, r1 + strb r2, [r0] + bx lr + .pool + thumb_func_end sub_80AB26C + + thumb_func_start nullsub_36 +nullsub_36: @ 80AB28C + bx lr + thumb_func_end nullsub_36 + + thumb_func_start sub_80AB290 +sub_80AB290: @ 80AB290 + movs r0, 0 + bx lr + thumb_func_end sub_80AB290 + + thumb_func_start sub_80AB294 +sub_80AB294: @ 80AB294 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r1, =0x03000f50 + ldr r0, =gUnknown_0854C250 + str r0, [r1] + movs r0, 0 + mov r12, r0 + ldr r1, =0x020388b4 + mov r10, r1 +_080AB2AC: + mov r7, r10 + mov r0, r12 + cmp r0, 0 + bne _080AB2B8 + ldr r1, =0xfffffda0 + adds r7, r1 +_080AB2B8: + movs r5, 0 + movs r0, 0x1 + add r0, r12 + mov r9, r0 +_080AB2C0: + lsls r1, r5, 8 + lsls r0, r5, 24 + lsrs r2, r0, 16 + mov r0, r12 + cmp r0, 0 + bne _080AB2E4 + adds r0, r1, 0 + lsls r0, 12 + lsrs r4, r0, 16 + b _080AB2E6 + .pool +_080AB2E4: + movs r4, 0 +_080AB2E6: + movs r3, 0 + adds r1, r5, 0x1 + mov r8, r1 +_080AB2EC: + subs r1, r2, r4 + lsls r1, 16 + lsrs r2, r1, 16 + lsls r0, r3, 5 + adds r0, r7 + adds r0, r5 + lsrs r1, 24 + strb r1, [r0] + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x2 + bls _080AB2EC + adds r6, r2, 0 + movs r0, 0xF8 + lsls r0, 5 + subs r0, r2 + cmp r0, 0 + bge _080AB314 + adds r0, 0xF +_080AB314: + lsls r0, 12 + lsrs r4, r0, 16 + cmp r5, 0xB + bhi _080AB35E + cmp r3, 0x12 + bhi _080AB384 +_080AB320: + adds r0, r2, r4 + lsls r0, 16 + lsrs r2, r0, 16 + subs r0, r2, r6 + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + ble _080AB33C + lsrs r0, 31 + adds r0, r1, r0 + asrs r0, 1 + subs r0, r2, r0 + lsls r0, 16 + lsrs r2, r0, 16 +_080AB33C: + lsls r0, r3, 5 + adds r0, r7 + adds r1, r0, r5 + lsrs r0, r2, 8 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1F + bls _080AB352 + movs r0, 0x1F + strb r0, [r1] +_080AB352: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x12 + bls _080AB320 + b _080AB384 +_080AB35E: + cmp r3, 0x12 + bhi _080AB384 + movs r6, 0x1F +_080AB364: + adds r1, r2, r4 + lsls r1, 16 + lsrs r2, r1, 16 + lsls r0, r3, 5 + adds r0, r7 + adds r0, r5 + lsrs r1, 24 + strb r1, [r0] + cmp r1, 0x1F + bls _080AB37A + strb r6, [r0] +_080AB37A: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x12 + bls _080AB364 +_080AB384: + mov r1, r8 + lsls r0, r1, 16 + lsrs r5, r0, 16 + cmp r5, 0x1F + bls _080AB2C0 + mov r1, r9 + lsls r0, r1, 16 + lsrs r0, 16 + mov r12, r0 + cmp r0, 0x1 + bls _080AB2AC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80AB294 + + thumb_func_start sub_80AB3A8 +sub_80AB3A8: @ 80AB3A8 + push {r4-r7,lr} + ldr r0, =0x02038454 + ldr r1, =0x000006c6 + adds r2, r0, r1 + ldrb r1, [r2] + adds r3, r0, 0 + cmp r1, 0x2 + beq _080AB42C + movs r7, 0xD8 + lsls r7, 3 + adds r4, r3, r7 + ldr r1, =0x000006c1 + adds r0, r3, r1 + ldrb r7, [r4] + mov r12, r7 + movs r6, 0 + ldrsb r6, [r4, r6] + movs r5, 0 + ldrsb r5, [r0, r5] + cmp r6, r5 + bne _080AB3E4 + movs r0, 0x3 + strb r0, [r2] + b _080AB42C + .pool +_080AB3E4: + ldr r0, =0x000006c3 + adds r2, r3, r0 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + ldr r7, =0x000006c2 + adds r1, r3, r7 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bcc _080AB42C + movs r0, 0 + strb r0, [r2] + mov r0, r12 + cmp r6, r5 + bge _080AB414 + adds r0, 0x1 + b _080AB418 + .pool +_080AB414: + mov r0, r12 + subs r0, 0x1 +_080AB418: + strb r0, [r4] + movs r1, 0xD8 + lsls r1, 3 + adds r0, r3, r1 + movs r2, 0 + ldrsb r2, [r0, r2] + movs r0, 0 + movs r1, 0x20 + bl pal_fade_2 +_080AB42C: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80AB3A8 + + thumb_func_start sub_80AB434 +sub_80AB434: @ 80AB434 + push {lr} + ldr r2, =0x02038454 + ldr r0, =0x000006cb + adds r1, r2, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _080AB452 + ldr r3, =0x000006ca + adds r1, r2, r3 + movs r0, 0 + strb r0, [r1] +_080AB452: + movs r1, 0xDA + lsls r1, 3 + adds r0, r2, r1 + ldrb r0, [r0] + subs r0, 0x3 + cmp r0, 0xA + bhi _080AB51C + lsls r0, 2 + ldr r1, =_080AB47C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080AB47C: + .4byte _080AB4A8 + .4byte _080AB4A8 + .4byte _080AB4A8 + .4byte _080AB4F4 + .4byte _080AB51C + .4byte _080AB51C + .4byte _080AB51C + .4byte _080AB51C + .4byte _080AB4A8 + .4byte _080AB4D0 + .4byte _080AB4A8 +_080AB4A8: + bl sub_80AB54C + lsls r0, 24 + cmp r0, 0 + bne _080AB53C + ldr r0, =0x02038454 + movs r2, 0xD8 + lsls r2, 3 + adds r1, r0, r2 + movs r2, 0x3 + strb r2, [r1] + ldr r3, =0x000006c6 + adds r0, r3 + strb r2, [r0] + b _080AB53C + .pool +_080AB4D0: + bl sub_80AB5AC + lsls r0, 24 + cmp r0, 0 + bne _080AB53C + ldr r1, =0x02038454 + movs r0, 0xD8 + lsls r0, 3 + adds r2, r1, r0 + movs r0, 0xFA + strb r0, [r2] + ldr r2, =0x000006c6 + adds r1, r2 + b _080AB538 + .pool +_080AB4F4: + bl sub_80AB604 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _080AB53C + ldr r0, =0x02038454 + movs r3, 0xD8 + lsls r3, 3 + adds r1, r0, r3 + strb r2, [r1] + ldr r1, =0x000006c6 + adds r0, r1 + movs r1, 0x3 + strb r1, [r0] + b _080AB53C + .pool +_080AB51C: + ldr r0, =0x02037fd4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080AB53C + ldr r3, =0x000006c1 + adds r0, r2, r3 + ldrb r1, [r0] + subs r3, 0x1 + adds r0, r2, r3 + strb r1, [r0] + ldr r0, =0x000006c6 + adds r1, r2, r0 +_080AB538: + movs r0, 0x3 + strb r0, [r1] +_080AB53C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AB434 + + thumb_func_start sub_80AB54C +sub_80AB54C: @ 80AB54C + push {r4,lr} + sub sp, 0x4 + ldr r2, =0x02038454 + ldr r0, =0x000006c7 + adds r4, r2, r0 + ldrb r0, [r4] + cmp r0, 0x10 + beq _080AB5A2 + adds r1, r0, 0x1 + strb r1, [r4] + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, 0xF + bhi _080AB594 + movs r3, 0x10 + subs r3, r1 + lsls r3, 24 + lsrs r3, 24 + ldr r1, =0x000006c4 + adds r0, r2, r1 + ldrh r0, [r0] + str r0, [sp] + movs r0, 0 + movs r1, 0x20 + movs r2, 0x3 + bl sub_80AB848 + movs r0, 0x1 + b _080AB5A4 + .pool +_080AB594: + movs r0, 0 + movs r1, 0x20 + movs r2, 0x3 + bl pal_fade_2 + movs r0, 0x10 + strb r0, [r4] +_080AB5A2: + movs r0, 0 +_080AB5A4: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80AB54C + + thumb_func_start sub_80AB5AC +sub_80AB5AC: @ 80AB5AC + push {r4,lr} + ldr r2, =0x02038454 + ldr r0, =0x000006c7 + adds r4, r2, r0 + ldrb r0, [r4] + cmp r0, 0x10 + beq _080AB5FC + adds r3, r0, 0x1 + strb r3, [r4] + lsls r0, r3, 24 + lsrs r0, 24 + cmp r0, 0xF + bhi _080AB5EC + movs r0, 0x6 + negs r0, r0 + movs r1, 0x10 + subs r1, r3 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =0x000006c4 + adds r2, r3 + ldrh r2, [r2] + bl sub_80AB990 + movs r0, 0x1 + b _080AB5FE + .pool +_080AB5EC: + movs r2, 0x6 + negs r2, r2 + movs r0, 0 + movs r1, 0x20 + bl pal_fade_2 + movs r0, 0x10 + strb r0, [r4] +_080AB5FC: + movs r0, 0 +_080AB5FE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80AB5AC + + thumb_func_start sub_80AB604 +sub_80AB604: @ 80AB604 + push {lr} + ldr r2, =0x02038454 + ldr r1, =0x000006c7 + adds r0, r2, r1 + ldrb r1, [r0] + cmp r1, 0x10 + beq _080AB638 + adds r1, 0x1 + strb r1, [r0] + movs r0, 0x10 + subs r0, r1 + lsls r0, 24 + lsrs r0, 24 + ldr r3, =0x000006c4 + adds r1, r2, r3 + ldrh r1, [r1] + bl sub_80ABAB0 + movs r0, 0x1 + b _080AB63A + .pool +_080AB638: + movs r0, 0 +_080AB63A: + pop {r1} + bx r1 + thumb_func_end sub_80AB604 + + thumb_func_start nullsub_94 +nullsub_94: @ 80AB640 + bx lr + thumb_func_end nullsub_94 + + thumb_func_start pal_fade_2 +pal_fade_2: @ 80AB644 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 24 + lsrs r3, r0, 24 + adds r4, r3, 0 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r2, 24 + asrs r0, r2, 24 + cmp r0, 0 + ble _080AB754 + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r6, r3, 4 + adds r0, r1, r3 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + cmp r4, r9 + bcc _080AB67C + b _080AB82E +_080AB67C: + ldr r1, [sp] + lsls r0, r1, 24 + asrs r0, 19 + str r0, [sp, 0x4] +_080AB684: + ldr r0, =0x03000f50 + ldr r0, [r0] + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _080AB6C0 + lsls r1, r6, 1 + ldr r0, =0x02037714 + adds r0, r1, r0 + ldr r2, =0x02037b14 + adds r1, r2 + movs r2, 0x8 + bl CpuFastSet + adds r0, r6, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r6, r0, 16 + mov r2, r9 + lsls r2, 16 + mov r8, r2 + adds r4, 0x1 + mov r12, r4 + b _080AB73E + .pool +_080AB6C0: + cmp r0, 0x2 + beq _080AB6D4 + adds r1, r4, 0 + subs r1, 0x10 + ldr r2, =0x02038454 + ldr r3, =0x000006d5 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r1, r0 + bne _080AB6E4 +_080AB6D4: + ldr r0, =0x020388b4 + b _080AB6EA + .pool +_080AB6E4: + movs r3, 0x80 + lsls r3, 2 + adds r0, r2, r3 +_080AB6EA: + ldr r1, [sp, 0x4] + adds r5, r1, r0 + movs r7, 0 + mov r2, r9 + lsls r2, 16 + mov r8, r2 + adds r4, 0x1 + mov r12, r4 + ldr r3, =0x02037b14 + mov r10, r3 +_080AB6FE: + adds r2, r6, 0 + lsls r0, r2, 1 + ldr r1, =0x02037714 + adds r0, r1 + ldr r1, [r0] + lsls r0, r1, 27 + lsrs r0, 27 + adds r0, r5, r0 + ldrb r4, [r0] + lsls r0, r1, 22 + lsrs r0, 27 + adds r0, r5, r0 + ldrb r3, [r0] + lsls r1, 17 + lsrs r1, 27 + adds r1, r5, r1 + ldrb r1, [r1] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r2, 1 + add r2, r10 + lsls r1, 10 + lsls r3, 5 + orrs r1, r3 + orrs r1, r4 + strh r1, [r2] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0xF + bls _080AB6FE +_080AB73E: + mov r2, r12 + lsls r0, r2, 16 + lsrs r4, r0, 16 + cmp r0, r8 + bcc _080AB684 + b _080AB82E + .pool +_080AB754: + cmp r0, 0 + bge _080AB81C + mvns r0, r0 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r6, r3, 4 + adds r0, r1, r3 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + adds r4, r3, 0 + cmp r4, r9 + bcs _080AB82E +_080AB770: + ldr r0, =0x03000f50 + ldr r0, [r0] + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _080AB7AC + lsls r1, r6, 1 + ldr r0, =0x02037714 + adds r0, r1, r0 + ldr r2, =0x02037b14 + adds r1, r2 + movs r2, 0x8 + bl CpuFastSet + adds r0, r6, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r6, r0, 16 + mov r3, r9 + lsls r3, 16 + mov r8, r3 + adds r4, 0x1 + mov r12, r4 + b _080AB804 + .pool +_080AB7AC: + movs r7, 0 + mov r0, r9 + lsls r0, 16 + mov r8, r0 + adds r4, 0x1 + mov r12, r4 + ldr r1, =gUnknown_0854014C + mov r10, r1 + ldr r2, [sp] + lsls r0, r2, 24 + asrs r5, r0, 11 +_080AB7C2: + lsls r0, r6, 1 + ldr r3, =0x02037b14 + adds r4, r0, r3 + ldr r1, =0x02037714 + adds r0, r1 + ldrh r3, [r0] + lsls r3, 16 + lsrs r0, r3, 17 + movs r1, 0xF + ands r0, r1 + lsrs r1, r3, 18 + movs r2, 0xF0 + ands r1, r2 + orrs r0, r1 + lsrs r3, 19 + movs r2, 0xF0 + lsls r2, 4 + adds r1, r2, 0 + ands r3, r1 + orrs r0, r3 + lsls r0, 1 + adds r0, r5 + add r0, r10 + ldrh r0, [r0] + strh r0, [r4] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0xF + bls _080AB7C2 +_080AB804: + mov r3, r12 + lsls r0, r3, 16 + lsrs r4, r0, 16 + cmp r0, r8 + bcc _080AB770 + b _080AB82E + .pool +_080AB81C: + lsls r1, r4, 5 + ldr r0, =0x02037714 + adds r0, r1, r0 + ldr r2, =0x02037b14 + adds r1, r2 + mov r3, r9 + lsls r2, r3, 3 + bl CpuFastSet +_080AB82E: + 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 pal_fade_2 + + thumb_func_start sub_80AB848 +sub_80AB848: @ 80AB848 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + ldr r4, [sp, 0x34] + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + mov r1, sp + strh r4, [r1] + ldr r1, [sp] + lsls r3, r1, 27 + lsrs r3, 27 + str r3, [sp, 0x4] + lsls r3, r1, 22 + lsrs r3, 27 + str r3, [sp, 0x8] + lsls r1, 17 + lsrs r1, 27 + str r1, [sp, 0xC] + lsls r6, r0, 4 + mov r3, r10 + adds r1, r3, r0 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + movs r1, 0xFF + lsls r1, 24 + adds r2, r1 + lsrs r2, 24 + adds r4, r0, 0 + cmp r4, r10 + bcs _080AB974 + lsls r0, r2, 24 + asrs r0, 19 + str r0, [sp, 0x10] +_080AB8A0: + ldr r0, =0x03000f50 + ldr r0, [r0] + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _080AB8D4 + mov r0, sp + ldrh r3, [r0] + adds r0, r6, 0 + movs r1, 0x10 + mov r2, r8 + bl pal_fade_1 + adds r0, r6, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r6, r0, 16 + mov r3, r10 + lsls r3, 16 + mov r9, r3 + adds r4, 0x1 + mov r12, r4 + b _080AB96A + .pool +_080AB8D4: + cmp r0, 0x1 + bne _080AB8E4 + ldr r0, =0x02038654 + ldr r1, [sp, 0x10] + adds r5, r1, r0 + b _080AB8EA + .pool +_080AB8E4: + ldr r0, =0x020388b4 + ldr r3, [sp, 0x10] + adds r5, r3, r0 +_080AB8EA: + movs r7, 0 + mov r0, r10 + lsls r0, 16 + mov r9, r0 + adds r4, 0x1 + mov r12, r4 +_080AB8F6: + adds r4, r6, 0 + lsls r0, r4, 1 + ldr r1, =0x02037714 + adds r0, r1 + ldr r1, [r0] + lsls r0, r1, 27 + lsrs r0, 27 + adds r0, r5, r0 + ldrb r3, [r0] + lsls r0, r1, 22 + lsrs r0, 27 + adds r0, r5, r0 + ldrb r2, [r0] + lsls r1, 17 + lsrs r1, 27 + adds r1, r5, r1 + ldrb r1, [r1] + ldr r6, [sp, 0x4] + subs r0, r6, r3 + mov r6, r8 + muls r6, r0 + adds r0, r6, 0 + asrs r0, 4 + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + ldr r6, [sp, 0x8] + subs r0, r6, r2 + mov r6, r8 + muls r6, r0 + adds r0, r6, 0 + asrs r0, 4 + adds r2, r0 + lsls r2, 24 + ldr r6, [sp, 0xC] + subs r0, r6, r1 + mov r6, r8 + muls r6, r0 + adds r0, r6, 0 + asrs r0, 4 + adds r1, r0 + lsls r1, 24 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r4, 1 + ldr r0, =0x02037b14 + adds r4, r0 + lsrs r1, 14 + lsrs r2, 19 + orrs r1, r2 + orrs r1, r3 + strh r1, [r4] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0xF + bls _080AB8F6 +_080AB96A: + mov r1, r12 + lsls r0, r1, 16 + lsrs r4, r0, 16 + cmp r0, r9 + bcc _080AB8A0 +_080AB974: + 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_80AB848 + + thumb_func_start sub_80AB990 +sub_80AB990: @ 80AB990 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r1, 24 + lsrs r6, r1, 24 + mov r1, sp + strh r2, [r1] + lsls r0, 24 + movs r1, 0xFF + lsls r1, 24 + eors r0, r1 + lsrs r0, 24 + str r0, [sp, 0x4] + ldr r0, [sp] + lsls r1, r0, 27 + lsrs r1, 27 + str r1, [sp, 0x8] + lsls r1, r0, 22 + lsrs r1, 27 + str r1, [sp, 0xC] + lsls r0, 17 + lsrs r0, 27 + mov r10, r0 + movs r5, 0 + movs r4, 0 +_080AB9C8: + ldr r0, =0x03000f50 + ldr r0, [r0] + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _080AB9F4 + mov r0, sp + ldrh r3, [r0] + adds r0, r5, 0 + movs r1, 0x10 + adds r2, r6, 0 + bl pal_fade_1 + adds r0, r5, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r5, r0, 16 + adds r4, 0x1 + mov r8, r4 + b _080ABA8A + .pool +_080AB9F4: + movs r0, 0 + mov r12, r0 + ldr r1, [sp, 0x4] + lsls r0, r1, 24 + adds r4, 0x1 + mov r8, r4 + movs r7, 0x1E + asrs r0, 11 + mov r9, r0 +_080ABA06: + adds r4, r5, 0 + lsls r0, r4, 1 + ldr r5, =0x02037714 + adds r0, r5 + ldr r0, [r0] + lsls r2, r0, 27 + lsrs r2, 27 + lsls r1, r0, 22 + lsrs r1, 27 + lsls r0, 17 + lsrs r0, 27 + ands r0, r7 + lsls r0, 7 + ands r1, r7 + lsls r1, 3 + orrs r0, r1 + ands r2, r7 + lsls r0, 1 + orrs r0, r2 + add r0, r9 + ldr r1, =gUnknown_0854014C + adds r0, r1 + ldr r1, [r0] + lsls r3, r1, 27 + lsrs r3, 27 + lsls r2, r1, 22 + lsrs r2, 27 + lsls r1, 17 + lsrs r1, 27 + ldr r5, [sp, 0x8] + subs r0, r5, r3 + muls r0, r6 + asrs r0, 4 + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + ldr r5, [sp, 0xC] + subs r0, r5, r2 + muls r0, r6 + asrs r0, 4 + adds r2, r0 + lsls r2, 24 + mov r5, r10 + subs r0, r5, r1 + muls r0, r6 + asrs r0, 4 + adds r1, r0 + lsls r1, 24 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r4, 1 + ldr r0, =0x02037b14 + adds r4, r0 + lsrs r1, 14 + lsrs r2, 19 + orrs r1, r2 + orrs r1, r3 + strh r1, [r4] + mov r0, r12 + adds r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + mov r12, r0 + cmp r0, 0xF + bls _080ABA06 +_080ABA8A: + mov r1, r8 + lsls r0, r1, 16 + lsrs r4, r0, 16 + cmp r4, 0x1F + bls _080AB9C8 + 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_80AB990 + + thumb_func_start sub_80ABAB0 +sub_80ABAB0: @ 80ABAB0 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + adds r3, r1, 0 + lsls r0, 24 + lsrs r7, r0, 24 + lsls r3, 16 + lsrs r3, 16 + mov r0, sp + strh r3, [r0] + movs r1, 0x80 + lsls r1, 1 + movs r0, 0 + adds r2, r7, 0 + bl pal_fade_1 + ldr r0, [sp] + lsls r1, r0, 27 + lsrs r1, 27 + str r1, [sp, 0x4] + lsls r1, r0, 22 + lsrs r1, 27 + str r1, [sp, 0x8] + lsls r0, 17 + lsrs r0, 27 + mov r10, r0 + movs r4, 0x10 +_080ABAEC: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80ABC00 + lsls r0, 24 + cmp r0, 0 + beq _080ABB9C + adds r0, r4, 0x1 + lsls r1, r0, 20 + lsrs r1, 16 + mov r12, r1 + lsls r1, r4, 20 + lsrs r6, r1, 16 + mov r9, r0 + cmp r6, r12 + bcs _080ABBB0 + movs r0, 0x1C + mov r8, r0 +_080ABB10: + lsls r5, r6, 1 + ldr r0, =0x02037714 + adds r0, r5, r0 + ldr r2, [r0] + lsls r4, r2, 27 + lsrs r4, 27 + lsls r3, r2, 22 + lsrs r3, 27 + lsls r2, 17 + lsrs r2, 27 + mov r0, r8 + subs r1, r0, r4 + lsls r0, r1, 1 + adds r0, r1 + asrs r0, 2 + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + movs r1, 0x1F + subs r1, r3 + lsls r0, r1, 1 + adds r0, r1 + asrs r0, 2 + adds r3, r0 + lsls r3, 24 + lsrs r3, 24 + mov r0, r8 + subs r1, r0, r2 + lsls r0, r1, 1 + adds r0, r1 + asrs r0, 2 + adds r2, r0 + lsls r2, 24 + lsrs r2, 24 + ldr r1, [sp, 0x4] + subs r0, r1, r4 + muls r0, r7 + asrs r0, 4 + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + ldr r1, [sp, 0x8] + subs r0, r1, r3 + muls r0, r7 + asrs r0, 4 + adds r3, r0 + lsls r3, 24 + mov r1, r10 + subs r0, r1, r2 + muls r0, r7 + asrs r0, 4 + adds r2, r0 + lsls r2, 24 + ldr r0, =0x02037b14 + adds r5, r0 + lsrs r2, 14 + lsrs r3, 19 + orrs r2, r3 + orrs r2, r4 + strh r2, [r5] + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, r12 + bcc _080ABB10 + b _080ABBB0 + .pool +_080ABB9C: + lsls r0, r4, 20 + lsrs r0, 16 + mov r1, sp + ldrh r3, [r1] + movs r1, 0x10 + adds r2, r7, 0 + bl pal_fade_1 + adds r4, 0x1 + mov r9, r4 +_080ABBB0: + mov r1, r9 + lsls r0, r1, 16 + lsrs r4, r0, 16 + cmp r4, 0x1F + bls _080ABAEC + 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_80ABAB0 + + thumb_func_start sub_80ABBCC +sub_80ABBCC: @ 80ABBCC + push {r4,lr} + lsls r0, 24 + lsrs r2, r0, 24 + ldr r3, =0x02038454 + ldr r0, =0x000006fa + adds r1, r3, r0 + ldrb r0, [r1] + cmp r0, 0x5 + bhi _080ABBEE + ldr r4, =0x000006f4 + adds r0, r3, r4 + ldrb r3, [r1] + adds r0, r3 + strb r2, [r0] + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] +_080ABBEE: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ABBCC + + thumb_func_start sub_80ABC00 +sub_80ABC00: @ 80ABC00 + push {r4,r5,lr} + lsls r0, 24 + lsrs r3, r0, 24 + movs r1, 0 + ldr r2, =0x02038454 + ldr r4, =0x000006fa + adds r0, r2, r4 + ldrb r0, [r0] + cmp r1, r0 + bcs _080ABC3E + ldr r5, =0x000006f4 + adds r4, r2, r5 + adds r2, r0, 0 +_080ABC1A: + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, r3 + bne _080ABC34 + movs r0, 0x1 + b _080ABC40 + .pool +_080ABC34: + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, r2 + bcc _080ABC1A +_080ABC3E: + movs r0, 0 +_080ABC40: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80ABC00 + + thumb_func_start sub_80ABC48 +sub_80ABC48: @ 80ABC48 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =0x02038454 + ldr r1, =0x000006c6 + adds r0, r5, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _080ABC6E + lsls r2, r4, 24 + asrs r2, 24 + movs r0, 0 + movs r1, 0x20 + bl pal_fade_2 + movs r1, 0xD8 + lsls r1, 3 + adds r0, r5, r1 + strb r4, [r0] +_080ABC6E: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ABC48 + + thumb_func_start sub_80ABC7C +sub_80ABC7C: @ 80ABC7C + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r3, =0x02038454 + ldr r0, =0x000006c6 + adds r2, r3, r0 + ldrb r0, [r2] + cmp r0, 0x3 + bne _080ABCBC + movs r1, 0 + strb r1, [r2] + movs r2, 0xD8 + lsls r2, 3 + adds r0, r3, r2 + strb r4, [r0] + adds r2, 0x1 + adds r0, r3, r2 + strb r5, [r0] + adds r2, 0x2 + adds r0, r3, r2 + strb r1, [r0] + ldr r1, =0x000006c2 + adds r0, r3, r1 + strb r6, [r0] + lsls r0, r4, 24 + asrs r0, 24 + bl sub_80ABC48 +_080ABCBC: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ABC7C + + thumb_func_start fade_screen +fade_screen: @ 80ABCD0 + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + cmp r0, 0x1 + beq _080ABD08 + cmp r0, 0x1 + bgt _080ABCEC + cmp r0, 0 + beq _080ABCF6 + b _080ABDE4 +_080ABCEC: + cmp r2, 0x2 + beq _080ABCFC + cmp r2, 0x3 + beq _080ABD0C + b _080ABDE4 +_080ABCF6: + movs r4, 0 + movs r1, 0 + b _080ABD10 +_080ABCFC: + ldr r4, =0x0000ffff + movs r1, 0 + b _080ABD10 + .pool +_080ABD08: + movs r4, 0 + b _080ABD0E +_080ABD0C: + ldr r4, =0x0000ffff +_080ABD0E: + movs r1, 0x1 +_080ABD10: + ldr r0, =0x02038454 + movs r2, 0xDA + lsls r2, 3 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x3 + blt _080ABD38 + cmp r0, 0x6 + ble _080ABD2A + cmp r0, 0xD + bgt _080ABD38 + cmp r0, 0xB + blt _080ABD38 +_080ABD2A: + movs r2, 0x1 + b _080ABD3A + .pool +_080ABD38: + movs r2, 0 +_080ABD3A: + cmp r1, 0 + beq _080ABD7C + cmp r2, 0 + beq _080ABD4E + ldr r0, =0x02037b14 + ldr r1, =0x02037714 + movs r2, 0x80 + lsls r2, 1 + bl CpuFastSet +_080ABD4E: + movs r0, 0x1 + negs r0, r0 + lsls r1, r5, 24 + asrs r1, 24 + str r4, [sp] + movs r2, 0 + movs r3, 0x10 + bl pal_fade_maybe + ldr r0, =0x02038454 + ldr r3, =0x000006c6 + adds r0, r3 + movs r1, 0x2 + strb r1, [r0] + b _080ABDE4 + .pool +_080ABD7C: + ldr r1, =0x02038454 + ldr r3, =0x000006c4 + adds r0, r1, r3 + strh r4, [r0] + cmp r2, 0 + beq _080ABDA0 + ldr r0, =0x000006c7 + adds r1, r0 + movs r0, 0 + strb r0, [r1] + b _080ABDB2 + .pool +_080ABDA0: + movs r0, 0x1 + negs r0, r0 + lsls r1, r5, 24 + asrs r1, 24 + str r4, [sp] + movs r2, 0x10 + movs r3, 0 + bl pal_fade_maybe +_080ABDB2: + ldr r4, =0x02038454 + ldr r1, =0x000006c6 + adds r0, r4, r1 + movs r1, 0 + movs r5, 0x1 + strb r5, [r0] + ldr r2, =0x000006ca + adds r0, r4, r2 + strb r5, [r0] + ldr r3, =0x000006cb + adds r0, r4, r3 + strb r1, [r0] + movs r1, 0xE6 + lsls r1, 3 + adds r0, r4, r1 + ldrb r0, [r0] + adds r2, 0x68 + adds r1, r4, r2 + ldrb r1, [r1] + bl sub_80AC124 + movs r3, 0xD9 + lsls r3, 3 + adds r4, r3 + strb r5, [r4] +_080ABDE4: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end fade_screen + + thumb_func_start sub_80ABDFC +sub_80ABDFC: @ 80ABDFC + ldr r0, =0x02038454 + ldr r1, =0x000006c6 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + .pool + thumb_func_end sub_80ABDFC + + thumb_func_start sub_80ABE18 +@ void sub_80ABE18(u8 a1) +sub_80ABE18: @ 80ABE18 + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 8 + movs r1, 0x80 + lsls r1, 13 + adds r0, r1 + lsrs r4, r0, 16 + ldr r5, =0x02038454 + ldr r2, =0x000006c6 + adds r0, r5, r2 + ldrb r0, [r0] + adds r1, r5, 0 + cmp r0, 0x1 + beq _080ABE60 + cmp r0, 0x2 + beq _080ABEAC + adds r2, 0xA + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x6 + beq _080ABEE4 + lsls r0, r4, 24 + lsrs r0, 24 + subs r2, 0x10 + adds r1, r2 + movs r2, 0 + ldrsb r2, [r1, r2] + movs r1, 0x1 + bl pal_fade_2 + b _080ABEF4 + .pool +_080ABE60: + ldr r2, =0x000006ca + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080ABEF4 + adds r2, 0x6 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x6 + bne _080ABE7C + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80ABBCC +_080ABE7C: + lsls r0, r4, 20 + lsrs r4, r0, 16 + movs r2, 0 + ldr r6, =0x02037b14 + ldr r0, =0x000006c4 + adds r3, r5, r0 +_080ABE88: + adds r0, r4, r2 + lsls r0, 1 + adds r0, r6 + ldrh r1, [r3] + strh r1, [r0] + adds r0, r2, 0x1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0xF + bls _080ABE88 + b _080ABEF4 + .pool +_080ABEAC: + lsls r0, r4, 20 + lsrs r4, r0, 16 + lsls r1, r4, 1 + ldr r0, =0x02037b14 + adds r0, r1, r0 + ldr r2, =0x02037714 + adds r1, r2 + movs r2, 0x8 + bl CpuFastSet + ldr r0, =0x02037fd4 + ldrh r2, [r0, 0x4] + lsls r2, 21 + lsrs r2, 27 + ldrh r3, [r0, 0x6] + lsls r3, 17 + lsrs r3, 17 + adds r0, r4, 0 + movs r1, 0x10 + bl pal_fade_1 + b _080ABEF4 + .pool +_080ABEE4: + lsls r0, r4, 20 + lsrs r4, r0, 16 + ldr r3, =0x000073fc + adds r0, r4, 0 + movs r1, 0x10 + movs r2, 0xC + bl pal_fade_1 +_080ABEF4: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ABE18 + + thumb_func_start sub_80ABF00 +sub_80ABF00: @ 80ABF00 + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02038454 + movs r2, 0xD8 + lsls r2, 3 + adds r1, r2 + movs r2, 0 + ldrsb r2, [r1, r2] + movs r1, 0x1 + bl pal_fade_2 + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ABF00 + + thumb_func_start sub_80ABF20 +sub_80ABF20: @ 80ABF20 + push {lr} + ldr r1, =0x02038454 + ldr r2, =0x000006c6 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080ABF3C + movs r0, 0 + b _080ABF42 + .pool +_080ABF3C: + ldr r2, =0x000006ca + adds r0, r1, r2 + ldrb r0, [r0] +_080ABF42: + pop {r1} + bx r1 + .pool + thumb_func_end sub_80ABF20 + + thumb_func_start sub_80ABF4C +sub_80ABF4C: @ 80ABF4C + push {r4,lr} + ldr r4, =0x02038454 + ldr r1, =0x000006d4 + adds r4, r1 + ldrb r1, [r4] + lsls r1, 20 + movs r2, 0x80 + lsls r2, 17 + adds r1, r2 + lsrs r1, 16 + movs r2, 0x20 + bl gpu_pal_apply + ldrb r0, [r4] + bl sub_80ABE18 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ABF4C + + thumb_func_start sub_80ABF7C +sub_80ABF7C: @ 80ABF7C + movs r2, 0x20 + strb r2, [r0] + strb r2, [r1] + bx lr + thumb_func_end sub_80ABF7C + + thumb_func_start sub_80ABF84 +sub_80ABF84: @ 80ABF84 + ldr r0, =0x02038454 + ldr r2, =0x0000074d + adds r1, r0, r2 + movs r2, 0x1 + strb r2, [r1] + ldr r1, =0x0000074e + adds r0, r1 + strb r2, [r0] + bx lr + .pool + thumb_func_end sub_80ABF84 + + thumb_func_start sub_80ABFA4 +sub_80ABFA4: @ 80ABFA4 + push {r4,lr} + ldr r1, =0x02038454 + ldr r0, =0x0000074d + adds r4, r1, r0 + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x1F + bgt _080ABFD8 + ldr r0, =0x0000074e + adds r1, r0 + adds r0, r4, 0 + bl sub_80ABF7C + movs r0, 0 + ldrsb r0, [r4, r0] + cmp r0, 0x1F + bgt _080ABFD8 + movs r0, 0x1 + b _080ABFDA + .pool +_080ABFD8: + movs r0, 0 +_080ABFDA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80ABFA4 + + thumb_func_start sub_80ABFE0 +sub_80ABFE0: @ 80ABFE0 + push {lr} + lsls r0, 24 + asrs r0, 24 + mvns r0, r0 + bl sub_80ABC48 + pop {r0} + bx r0 + thumb_func_end sub_80ABFE0 + + thumb_func_start sub_80ABFF0 +sub_80ABFF0: @ 80ABFF0 + ldr r1, =0x02038454 + ldr r2, =0x0000073c + adds r0, r1, r2 + movs r2, 0 + strh r2, [r0] + movs r3, 0xE8 + lsls r3, 3 + adds r0, r1, r3 + strh r2, [r0] + adds r3, 0x2 + adds r0, r1, r3 + strh r2, [r0] + ldr r0, =0x0000073e + adds r1, r0 + strh r2, [r1] + bx lr + .pool + thumb_func_end sub_80ABFF0 + + thumb_func_start sub_80AC01C +sub_80AC01C: @ 80AC01C + push {r4-r7,lr} + ldr r5, =0x02038454 + ldr r0, =0x00000742 + adds r7, r5, r0 + movs r2, 0 + ldrsh r1, [r7, r2] + cmp r1, 0x1 + beq _080AC090 + cmp r1, 0x1 + bgt _080AC040 + cmp r1, 0 + beq _080AC046 + b _080AC118 + .pool +_080AC040: + cmp r1, 0x2 + beq _080AC0E4 + b _080AC118 +_080AC046: + movs r3, 0xE8 + lsls r3, 3 + adds r6, r5, r3 + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _080AC118 + strh r1, [r6] + ldr r0, =0x0000073c + adds r4, r5, r0 + ldrh r0, [r4] + adds r1, r0, 0x1 + strh r1, [r4] + lsls r0, 24 + asrs r0, 24 + bl sub_80ABFE0 + ldrh r1, [r4] + movs r2, 0 + ldrsh r0, [r4, r2] + cmp r0, 0x5 + ble _080AC118 + ldr r3, =0x0000073e + adds r0, r5, r3 + strh r1, [r0] + movs r0, 0x1 + strh r0, [r7] + movs r0, 0x3C + strh r0, [r6] + b _080AC118 + .pool +_080AC090: + movs r0, 0xE8 + lsls r0, 3 + adds r2, r5, r0 + ldrh r0, [r2] + adds r0, 0x3 + movs r1, 0x7F + ands r0, r1 + strh r0, [r2] + ldr r1, =gUnknown_08329F40 + movs r3, 0 + ldrsh r0, [r2, r3] + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + subs r0, 0x1 + asrs r0, 6 + adds r0, 0x2 + ldr r2, =0x0000073c + adds r6, r5, r2 + adds r2, r0, 0 + strh r0, [r6] + ldr r3, =0x0000073e + adds r4, r5, r3 + movs r3, 0 + ldrsh r1, [r4, r3] + cmp r0, r1 + beq _080AC0D0 + lsls r0, r2, 24 + asrs r0, 24 + bl sub_80ABFE0 +_080AC0D0: + ldrh r0, [r6] + strh r0, [r4] + b _080AC118 + .pool +_080AC0E4: + movs r0, 0xE8 + lsls r0, 3 + adds r1, r5, r0 + ldrh r0, [r1] + adds r0, 0x1 + movs r6, 0 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _080AC118 + strh r6, [r1] + ldr r1, =0x0000073c + adds r4, r5, r1 + ldrh r0, [r4] + subs r0, 0x1 + strh r0, [r4] + lsls r0, 24 + asrs r0, 24 + bl sub_80ABFE0 + movs r2, 0 + ldrsh r0, [r4, r2] + cmp r0, 0x3 + bne _080AC118 + strh r6, [r7] +_080AC118: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AC01C + + thumb_func_start sub_80AC124 +sub_80AC124: @ 80AC124 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =0x02038454 + movs r4, 0xE6 + lsls r4, 3 + adds r2, r3, r4 + strh r0, [r2] + adds r4, 0x2 + adds r2, r3, r4 + strh r1, [r2] + adds r4, 0x2 + adds r2, r3, r4 + strh r0, [r2] + ldr r2, =0x00000736 + adds r3, r2 + strh r1, [r3] + lsls r1, 8 + orrs r1, r0 + movs r0, 0x52 + bl SetGpuReg + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AC124 + + thumb_func_start sub_80AC164 +sub_80AC164: @ 80AC164 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r3, =0x02038454 + ldr r5, =0x00000734 + adds r4, r3, r5 + movs r5, 0 + strh r0, [r4] + ldr r4, =0x00000736 + adds r0, r3, r4 + strh r1, [r0] + ldr r1, =0x0000073a + adds r0, r3, r1 + strb r2, [r0] + adds r4, 0x3 + adds r0, r3, r4 + strb r5, [r0] + movs r0, 0xE7 + lsls r0, 3 + adds r3, r0 + strb r5, [r3] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AC164 + + thumb_func_start sub_80AC1A8 +sub_80AC1A8: @ 80AC1A8 + push {r4-r6,lr} + ldr r0, =0x02038454 + movs r1, 0xE6 + lsls r1, 3 + adds r3, r0, r1 + ldr r2, [r3] + ldr r6, =0x00000734 + adds r4, r0, r6 + ldr r1, [r4] + adds r5, r0, 0 + cmp r2, r1 + beq _080AC26C + ldr r0, =0x00000739 + adds r2, r5, r0 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + ldr r6, =0x0000073a + adds r1, r5, r6 + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r1] + cmp r0, r1 + bls _080AC238 + movs r0, 0 + strb r0, [r2] + movs r0, 0xE7 + lsls r0, 3 + adds r1, r5, r0 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080AC210 + ldrh r1, [r3] + adds r2, r1, 0 + ldrh r0, [r4] + cmp r2, r0 + bcs _080AC230 + adds r0, r1, 0x1 + b _080AC236 + .pool +_080AC210: + ldr r1, =0x00000732 + adds r3, r5, r1 + ldr r2, =0x00000736 + adds r0, r5, r2 + ldrh r1, [r3] + adds r2, r1, 0 + ldrh r0, [r0] + cmp r2, r0 + bcs _080AC230 + adds r0, r1, 0x1 + b _080AC236 + .pool +_080AC230: + cmp r2, r0 + bls _080AC238 + subs r0, r1, 0x1 +_080AC236: + strh r0, [r3] +_080AC238: + ldr r6, =0x00000732 + adds r0, r5, r6 + ldrh r1, [r0] + lsls r1, 8 + movs r0, 0xE6 + lsls r0, 3 + adds r4, r5, r0 + ldrh r0, [r4] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + ldr r1, [r4] + ldr r2, =0x00000734 + adds r0, r5, r2 + ldr r0, [r0] + cmp r1, r0 + beq _080AC26C + movs r0, 0 + b _080AC26E + .pool +_080AC26C: + movs r0, 0x1 +_080AC26E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80AC1A8 + + thumb_func_start sub_80AC274 +sub_80AC274: @ 80AC274 + push {lr} + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + cmp r0, 0x9 + bhi _080AC306 + lsls r0, 2 + ldr r1, =_080AC290 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080AC290: + .4byte _080AC2B8 + .4byte _080AC2C0 + .4byte _080AC2C8 + .4byte _080AC2D0 + .4byte _080AC2D8 + .4byte _080AC2E0 + .4byte _080AC2E8 + .4byte _080AC2F0 + .4byte _080AC2F8 + .4byte _080AC300 +_080AC2B8: + movs r0, 0x1 + bl sub_80AEDF0 + b _080AC306 +_080AC2C0: + movs r0, 0x2 + bl sub_80AEDF0 + b _080AC306 +_080AC2C8: + movs r0, 0x3 + bl sub_80AEDF0 + b _080AC306 +_080AC2D0: + movs r0, 0x4 + bl sub_80AEDF0 + b _080AC306 +_080AC2D8: + movs r0, 0x5 + bl sub_80AEDF0 + b _080AC306 +_080AC2E0: + movs r0, 0x6 + bl sub_80AEDF0 + b _080AC306 +_080AC2E8: + movs r0, 0x9 + bl sub_80AEDF0 + b _080AC306 +_080AC2F0: + movs r0, 0x7 + bl sub_80AEDF0 + b _080AC306 +_080AC2F8: + movs r0, 0x8 + bl sub_80AEDF0 + b _080AC306 +_080AC300: + movs r0, 0xB + bl sub_80AEDF0 +_080AC306: + pop {r0} + bx r0 + thumb_func_end sub_80AC274 + + thumb_func_start weather_get_current +weather_get_current: @ 80AC30C + ldr r0, =0x02038454 + movs r1, 0xDA + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end weather_get_current + + thumb_func_start sub_80AC31C +sub_80AC31C: @ 80AC31C + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r1, =0x02038454 + ldr r3, =0x000006c6 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0x2 + beq _080AC36E + cmp r2, 0x53 + beq _080AC354 + cmp r2, 0x53 + bgt _080AC344 + cmp r2, 0x51 + beq _080AC360 + b _080AC36E + .pool +_080AC344: + cmp r2, 0x55 + bne _080AC36E + ldr r0, =0x000006dd + adds r1, r0 + movs r0, 0 + b _080AC366 + .pool +_080AC354: + ldr r3, =0x000006dd + adds r1, r3 + movs r0, 0x1 + b _080AC366 + .pool +_080AC360: + ldr r0, =0x000006dd + adds r1, r0 + movs r0, 0x2 +_080AC366: + strb r0, [r1] + adds r0, r2, 0 + bl audio_play +_080AC36E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AC31C + + thumb_func_start play_some_sound +play_some_sound: @ 80AC378 + push {lr} + bl sub_80A390C + lsls r0, 24 + cmp r0, 0 + beq _080AC3B6 + ldr r0, =0x02038454 + ldr r1, =0x000006dd + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080AC3A8 + cmp r0, 0x1 + bgt _080AC3B0 + cmp r0, 0 + bne _080AC3B0 + movs r0, 0x56 + bl audio_play + b _080AC3B6 + .pool +_080AC3A8: + movs r0, 0x54 + bl audio_play + b _080AC3B6 +_080AC3B0: + movs r0, 0x52 + bl audio_play +_080AC3B6: + pop {r0} + bx r0 + thumb_func_end play_some_sound + + thumb_func_start sub_80AC3BC +sub_80AC3BC: @ 80AC3BC + ldr r0, =0x02038454 + ldr r1, =0x000006d3 + adds r0, r1 + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sub_80AC3BC + + thumb_func_start sub_80AC3D0 +sub_80AC3D0: @ 80AC3D0 + ldr r0, =0x02038454 + ldr r1, =0x000006c6 + adds r0, r1 + movs r1, 0x2 + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_80AC3D0 + + thumb_func_start sub_80AC3E4 +sub_80AC3E4: @ 80AC3E4 + ldr r0, =0x02038454 + ldr r1, =0x000006c6 + adds r0, r1 + movs r1, 0x3 + strb r1, [r0] + bx lr + .pool + thumb_func_end sub_80AC3E4 + + thumb_func_start sub_80AC3F8 +sub_80AC3F8: @ 80AC3F8 + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =gUnknown_0854C250 + ldr r5, =0x02038ba4 + adds r1, r5, 0 + movs r2, 0x10 + bl CpuSet + adds r4, r5 + movs r0, 0 + strb r0, [r4] + ldr r0, =0x03000f50 + str r5, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AC3F8 + + thumb_func_start sub_80AC428 +sub_80AC428: @ 80AC428 + ldr r1, =0x03000f50 + ldr r0, =gUnknown_0854C250 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_80AC428 + + thumb_func_start sub_80AC438 +sub_80AC438: @ 80AC438 + push {lr} + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r2, =0x000006c1 + adds r1, r0, r2 + movs r2, 0 + strb r2, [r1] + ldr r1, =0x000006c2 + adds r3, r0, r1 + movs r1, 0x14 + strb r1, [r3] + ldr r3, =0x000006d2 + adds r1, r0, r3 + strb r2, [r1] + subs r3, 0x6 + adds r1, r0, r3 + strh r2, [r1] + ldr r1, =0x000006de + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080AC46C + movs r0, 0 + movs r1, 0x10 + bl sub_80AC124 +_080AC46C: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AC438 + + thumb_func_start sub_80AC484 +sub_80AC484: @ 80AC484 + push {r4,lr} + bl sub_80AC438 + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x000006d2 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080AC4A4 + adds r4, r1, r2 +_080AC49A: + bl sub_80AC4B4 + ldrb r0, [r4] + cmp r0, 0 + beq _080AC49A +_080AC4A4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AC484 + + thumb_func_start sub_80AC4B4 +sub_80AC4B4: @ 80AC4B4 + push {r4,r5,lr} + ldr r0, =gUnknown_0854C14C + ldr r5, [r0] + ldr r0, =0x000006cc + adds r4, r5, r0 + ldrh r0, [r4] + cmp r0, 0x1 + beq _080AC4E4 + cmp r0, 0x1 + bgt _080AC4D8 + cmp r0, 0 + beq _080AC4DE + b _080AC508 + .pool +_080AC4D8: + cmp r0, 0x2 + beq _080AC4F0 + b _080AC508 +_080AC4DE: + bl sub_80AC594 + b _080AC502 +_080AC4E4: + movs r0, 0xC + movs r1, 0x8 + movs r2, 0x1 + bl sub_80AC164 + b _080AC502 +_080AC4F0: + bl sub_80AC1A8 + lsls r0, 24 + cmp r0, 0 + beq _080AC508 + ldr r0, =0x000006d2 + adds r1, r5, r0 + movs r0, 0x1 + strb r0, [r1] +_080AC502: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_080AC508: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AC4B4 + + thumb_func_start sub_80AC514 +sub_80AC514: @ 80AC514 + push {r4,lr} + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r1, =0x000006ce + adds r4, r0, r1 + ldrh r0, [r4] + cmp r0, 0 + beq _080AC534 + cmp r0, 0x1 + beq _080AC540 + movs r0, 0 + b _080AC556 + .pool +_080AC534: + movs r0, 0 + movs r1, 0x10 + movs r2, 0x1 + bl sub_80AC164 + b _080AC54E +_080AC540: + bl sub_80AC1A8 + lsls r0, 24 + cmp r0, 0 + beq _080AC554 + bl sub_80AC660 +_080AC54E: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_080AC554: + movs r0, 0x1 +_080AC556: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80AC514 + + thumb_func_start sub_80AC55C +sub_80AC55C: @ 80AC55C + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r0, =0x000006c1 + adds r2, r1, r0 + movs r0, 0 + strb r0, [r2] + ldr r0, =0x000006c2 + adds r1, r0 + movs r0, 0x14 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_80AC55C + + thumb_func_start sub_80AC580 +sub_80AC580: @ 80AC580 + push {lr} + bl sub_80AC55C + pop {r0} + bx r0 + thumb_func_end sub_80AC580 + + thumb_func_start nullsub_95 +nullsub_95: @ 80AC58C + bx lr + thumb_func_end nullsub_95 + + thumb_func_start sub_80AC590 +sub_80AC590: @ 80AC590 + movs r0, 0 + bx lr + thumb_func_end sub_80AC590 + + thumb_func_start sub_80AC594 +sub_80AC594: @ 80AC594 + push {r4,r5,lr} + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r1, =0x000006de + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080AC650 + ldr r0, =gUnknown_0854FB5C + bl LoadObjectPic + ldr r0, =gUnknown_0854C290 + bl sub_80ABF4C + movs r5, 0 +_080AC5B2: + ldr r0, =gUnknown_0854FB78 + movs r1, 0 + movs r2, 0 + movs r3, 0xFF + bl AddObjectToFront + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x40 + beq _080AC628 + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + lsls r2, r5, 2 + movs r0, 0xFA + lsls r0, 1 + adds r1, r0 + adds r1, r2 + lsls r4, r3, 4 + adds r4, r3 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + str r4, [r1] + ldr r0, =gUnknown_0854FB50 + adds r2, r0 + ldrh r0, [r2] + adds r0, 0x7 + lsls r0, 16 + asrs r0, 16 + ldrh r1, [r2, 0x2] + adds r1, 0x7 + lsls r1, 16 + asrs r1, 16 + adds r2, r4, 0 + adds r2, 0x20 + adds r3, r4, 0 + adds r3, 0x22 + bl sub_8093038 + adds r4, 0x3E + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + b _080AC63A + .pool +_080AC628: + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + lsls r0, r5, 2 + movs r2, 0xFA + lsls r2, 1 + adds r1, r2 + adds r1, r0 + movs r0, 0 + str r0, [r1] +_080AC63A: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x2 + bls _080AC5B2 + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r1, =0x000006de + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] +_080AC650: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AC594 + + thumb_func_start sub_80AC660 +sub_80AC660: @ 80AC660 + push {r4,r5,lr} + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x000006de + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080AC6A4 + movs r4, 0 + movs r0, 0xFA + lsls r0, 1 + adds r5, r1, r0 +_080AC678: + lsls r0, r4, 2 + adds r0, r5, r0 + ldr r0, [r0] + cmp r0, 0 + beq _080AC686 + bl RemoveObjectAndFreeTiles +_080AC686: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x2 + bls _080AC678 + movs r0, 0x90 + lsls r0, 5 + bl FreeObjectTilesByTag + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r1, =0x000006de + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_080AC6A4: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AC660 + + thumb_func_start sub_80AC6B4 +sub_80AC6B4: @ 80AC6B4 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x2E] + adds r0, 0x1 + movs r1, 0x1 + ands r0, r1 + strh r0, [r2, 0x2E] + cmp r0, 0 + beq _080AC6CC + ldrh r0, [r2, 0x20] + subs r0, 0x1 + strh r0, [r2, 0x20] +_080AC6CC: + pop {r0} + bx r0 + thumb_func_end sub_80AC6B4 + + thumb_func_start sub_80AC6D0 +sub_80AC6D0: @ 80AC6D0 + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r0, =0x000006cc + adds r3, r1, r0 + movs r2, 0 + movs r0, 0 + strh r0, [r3] + ldr r3, =0x000006d2 + adds r0, r1, r3 + strb r2, [r0] + subs r3, 0x11 + adds r0, r1, r3 + strb r2, [r0] + ldr r0, =0x000006c2 + adds r1, r0 + strb r2, [r1] + bx lr + .pool + thumb_func_end sub_80AC6D0 + + thumb_func_start sub_80AC704 +sub_80AC704: @ 80AC704 + push {r4,lr} + bl sub_80AC6D0 + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x000006d2 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080AC724 + adds r4, r1, r2 +_080AC71A: + bl sub_80AC734 + ldrb r0, [r4] + cmp r0, 0 + beq _080AC71A +_080AC724: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AC704 + + thumb_func_start sub_80AC734 +sub_80AC734: @ 80AC734 + push {lr} + ldr r1, =gUnknown_0854C14C + ldr r0, [r1] + ldr r2, =0x000006cc + adds r0, r2 + ldrh r0, [r0] + adds r2, r1, 0 + cmp r0, 0x4 + bhi _080AC810 + lsls r0, 2 + ldr r1, =_080AC75C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080AC75C: + .4byte _080AC770 + .4byte _080AC78C + .4byte _080AC7A4 + .4byte _080AC7C0 + .4byte _080AC7D8 +_080AC770: + ldr r1, [r2] + ldr r2, =0x000006c6 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080AC814 + ldr r0, =0x000006cc + adds r1, r0 + b _080AC7F8 + .pool +_080AC78C: + bl sub_80ABF84 + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x000006cc + adds r1, r2 + b _080AC7F8 + .pool +_080AC7A4: + bl sub_80ABFA4 + lsls r0, 24 + cmp r0, 0 + bne _080AC814 + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r0, =0x000006cc + adds r1, r0 + b _080AC7F8 + .pool +_080AC7C0: + bl sub_80ABFF0 + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x000006cc + adds r1, r2 + b _080AC7F8 + .pool +_080AC7D8: + bl sub_80AC01C + ldr r0, =gUnknown_0854C14C + ldr r2, [r0] + ldr r1, =0x0000073c + adds r0, r2, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x6 + bne _080AC814 + ldr r0, =0x000006d2 + adds r1, r2, r0 + movs r0, 0x1 + strb r0, [r1] + ldr r0, =0x000006cc + adds r1, r2, r0 +_080AC7F8: + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _080AC814 + .pool +_080AC810: + bl sub_80AC01C +_080AC814: + pop {r0} + bx r0 + thumb_func_end sub_80AC734 + + thumb_func_start sub_80AC818 +sub_80AC818: @ 80AC818 + movs r0, 0 + bx lr + thumb_func_end sub_80AC818 + + thumb_func_start sub_80AC81C +sub_80AC81C: @ 80AC81C + push {lr} + ldr r0, =task50_0807B6D4 + movs r1, 0x50 + bl CreateTask + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AC81C + + thumb_func_start task50_0807B6D4 +task50_0807B6D4: @ 80AC830 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + ldr r1, =0x03005e00 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x4 + bhi _080AC922 + lsls r0, 2 + ldr r1, =_080AC85C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080AC85C: + .4byte _080AC870 + .4byte _080AC89A + .4byte _080AC8C8 + .4byte _080AC8F8 + .4byte _080AC918 +_080AC870: + movs r0, 0 + strh r0, [r4, 0xA] + strh r0, [r4, 0xC] + ldr r0, =0x04000048 + ldrh r0, [r0] + strh r0, [r4, 0xE] + ldr r1, =0x00003f3f + movs r0, 0x48 + bl SetGpuReg + movs r0, 0x50 + movs r1, 0x9E + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080AC89A: + ldrh r0, [r4, 0xA] + adds r0, 0x3 + strh r0, [r4, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + ble _080AC8AC + movs r0, 0x10 + strh r0, [r4, 0xA] +_080AC8AC: + ldrh r1, [r4, 0xA] + movs r0, 0x54 + bl SetGpuReg + movs r1, 0xA + ldrsh r0, [r4, r1] + cmp r0, 0xF + ble _080AC922 + b _080AC910 + .pool +_080AC8C8: + ldrh r0, [r4, 0xC] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + ble _080AC922 + strh r1, [r4, 0xC] + ldrh r0, [r4, 0xA] + subs r0, 0x1 + strh r0, [r4, 0xA] + lsls r0, 16 + cmp r0, 0 + bgt _080AC8EE + strh r1, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] +_080AC8EE: + ldrh r1, [r4, 0xA] + movs r0, 0x54 + bl SetGpuReg + b _080AC922 +_080AC8F8: + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x54 + movs r1, 0 + bl SetGpuReg + ldrh r1, [r4, 0xE] + movs r0, 0x48 + bl SetGpuReg +_080AC910: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _080AC922 +_080AC918: + bl script_env_2_enable_and_set_ctx_running + adds r0, r5, 0 + bl DestroyTask +_080AC922: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end task50_0807B6D4 + + thumb_func_start sub_80AC928 +sub_80AC928: @ 80AC928 + push {r4,lr} + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x000006cc + adds r0, r1, r2 + movs r3, 0 + movs r2, 0 + strh r2, [r0] + ldr r4, =0x000006d2 + adds r0, r1, r4 + strb r3, [r0] + adds r4, 0x4 + adds r0, r1, r4 + strh r2, [r0] + ldr r0, =0x000006db + adds r2, r1, r0 + movs r0, 0x8 + strb r0, [r2] + ldr r2, =0x000006dc + adds r0, r1, r2 + strb r3, [r0] + adds r4, 0x3 + adds r2, r1, r4 + movs r0, 0xA + strb r0, [r2] + ldr r0, =0x000006c1 + adds r2, r1, r0 + movs r0, 0x3 + strb r0, [r2] + ldr r2, =0x000006c2 + adds r1, r2 + movs r0, 0x14 + strb r0, [r1] + movs r0, 0x55 + bl sub_80AC31C + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AC928 + + thumb_func_start sub_80AC994 +sub_80AC994: @ 80AC994 + push {r4,lr} + bl sub_80AC928 + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x000006d2 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080AC9B4 + adds r4, r1, r2 +_080AC9AA: + bl sub_80AC9C4 + ldrb r0, [r4] + cmp r0, 0 + beq _080AC9AA +_080AC9B4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AC994 + + thumb_func_start sub_80AC9C4 +sub_80AC9C4: @ 80AC9C4 + push {r4,r5,lr} + ldr r0, =gUnknown_0854C14C + ldr r5, [r0] + ldr r0, =0x000006cc + adds r4, r5, r0 + ldrh r0, [r4] + cmp r0, 0x1 + beq _080AC9F4 + cmp r0, 0x1 + bgt _080AC9E8 + cmp r0, 0 + beq _080AC9EE + b _080ACA18 + .pool +_080AC9E8: + cmp r0, 0x2 + beq _080ACA00 + b _080ACA18 +_080AC9EE: + bl sub_80ACD68 + b _080ACA12 +_080AC9F4: + bl sub_80ACD78 + lsls r0, 24 + cmp r0, 0 + bne _080ACA18 + b _080ACA12 +_080ACA00: + bl sub_80ACEAC + lsls r0, 24 + cmp r0, 0 + bne _080ACA18 + ldr r0, =0x000006d2 + adds r1, r5, r0 + movs r0, 0x1 + strb r0, [r1] +_080ACA12: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_080ACA18: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AC9C4 + + thumb_func_start sub_80ACA24 +sub_80ACA24: @ 80ACA24 + push {r4,r5,lr} + ldr r0, =gUnknown_0854C14C + ldr r2, [r0] + ldr r1, =0x000006ce + adds r3, r2, r1 + ldrh r1, [r3] + adds r4, r0, 0 + cmp r1, 0 + beq _080ACA48 + cmp r1, 0x1 + beq _080ACA7C + movs r0, 0 + b _080ACAAA + .pool +_080ACA48: + ldr r5, =0x000006d1 + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, 0x3 + beq _080ACA5A + cmp r0, 0x5 + beq _080ACA5A + cmp r0, 0xD + bne _080ACA70 +_080ACA5A: + ldr r0, [r4] + ldr r1, =0x000006ce + adds r0, r1 + movs r1, 0xFF + strh r1, [r0] + movs r0, 0 + b _080ACAAA + .pool +_080ACA70: + ldr r4, =0x000006d9 + adds r0, r2, r4 + strb r1, [r0] + ldrh r0, [r3] + adds r0, 0x1 + strh r0, [r3] +_080ACA7C: + bl sub_80ACEAC + lsls r0, 24 + cmp r0, 0 + bne _080ACAA8 + bl sub_80ACF38 + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r5, =0x000006ce + adds r1, r5 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + movs r0, 0 + b _080ACAAA + .pool +_080ACAA8: + movs r0, 0x1 +_080ACAAA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80ACA24 + + thumb_func_start sub_80ACAB0 +sub_80ACAB0: @ 80ACAB0 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + movs r1, 0x30 + ldrsh r0, [r7, r1] + cmp r0, 0 + bne _080ACAC4 + ldr r0, =0x00000169 + strh r0, [r7, 0x30] +_080ACAC4: + movs r2, 0x30 + ldrsh r1, [r7, r2] + ldr r0, =0x41c64e6d + muls r0, r1 + ldr r3, =0x00003039 + adds r0, r3 + lsls r0, 1 + lsrs r0, 17 + movs r1, 0x96 + lsls r1, 2 + bl __umodsi3 + movs r1, 0 + mov r8, r1 + strh r0, [r7, 0x30] + ldr r1, =gUnknown_0854FC4C + ldr r0, =gUnknown_0854C14C + ldr r5, [r0] + ldr r2, =0x000006dc + adds r5, r2 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldrh r6, [r0] + movs r3, 0x30 + ldrsh r0, [r7, r3] + movs r1, 0x1E + bl __modsi3 + adds r4, r0, 0 + lsls r4, 16 + asrs r4, 16 + lsls r0, r4, 3 + strh r0, [r7, 0x32] + movs r1, 0x30 + ldrsh r0, [r7, r1] + movs r1, 0x1E + bl __divsi3 + lsls r0, 16 + lsls r4, 7 + strh r4, [r7, 0x32] + asrs r0, 9 + strh r0, [r7, 0x34] + ldr r2, =gUnknown_0854FC44 + ldrb r1, [r5] + lsls r1, 2 + adds r1, r2 + movs r3, 0 + ldrsh r1, [r1, r3] + muls r1, r6 + subs r4, r1 + strh r4, [r7, 0x32] + ldrb r1, [r5] + lsls r1, 2 + adds r2, 0x2 + adds r1, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + muls r1, r6 + subs r0, r1 + strh r0, [r7, 0x34] + adds r0, r7, 0 + movs r1, 0 + bl StartObjectImageAnim + mov r3, r8 + strh r3, [r7, 0x36] + adds r2, r7, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x3 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + strh r6, [r7, 0x2E] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ACAB0 + + thumb_func_start sub_80ACB84 +sub_80ACB84: @ 80ACB84 + push {r4,r5,lr} + adds r5, r0, 0 + movs r1, 0x36 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _080ACC60 + ldr r3, =gUnknown_0854FC44 + ldr r4, =gUnknown_0854C14C + ldr r2, [r4] + ldr r0, =0x000006dc + adds r2, r0 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r3 + ldrh r1, [r0] + ldrh r0, [r5, 0x32] + adds r1, r0 + strh r1, [r5, 0x32] + ldrb r0, [r2] + lsls r0, 2 + adds r3, 0x2 + adds r0, r3 + ldrh r0, [r0] + ldrh r2, [r5, 0x34] + adds r0, r2 + strh r0, [r5, 0x34] + lsls r1, 16 + asrs r1, 20 + strh r1, [r5, 0x20] + lsls r0, 16 + asrs r2, r0, 20 + strh r2, [r5, 0x22] + movs r3, 0x38 + ldrsh r0, [r5, r3] + adds r3, r4, 0 + cmp r0, 0 + beq _080ACC04 + adds r0, r1, 0 + adds r0, 0x8 + lsls r0, 16 + movs r1, 0x80 + lsls r1, 17 + cmp r0, r1 + bhi _080ACC04 + adds r1, r2, 0 + movs r0, 0x10 + negs r0, r0 + cmp r1, r0 + blt _080ACC04 + cmp r1, 0xB0 + bgt _080ACC04 + adds r0, r5, 0 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + b _080ACC0E + .pool +_080ACC04: + adds r0, r5, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 +_080ACC0E: + strb r1, [r0] + adds r4, r0, 0 + ldrh r0, [r5, 0x2E] + subs r0, 0x1 + strh r0, [r5, 0x2E] + lsls r0, 16 + cmp r0, 0 + bne _080ACC80 + ldr r0, [r3] + ldr r1, =0x000006dc + adds r0, r1 + ldrb r1, [r0] + adds r1, 0x1 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl StartObjectImageAnim + movs r0, 0x1 + strh r0, [r5, 0x36] + ldr r1, =0x02021bbc + ldrh r0, [r5, 0x20] + ldrh r1, [r1] + subs r0, r1 + strh r0, [r5, 0x20] + ldr r1, =0x02021bbe + ldrh r0, [r5, 0x22] + ldrh r1, [r1] + subs r0, r1 + strh r0, [r5, 0x22] + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] + b _080ACC80 + .pool +_080ACC60: + adds r0, r5, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080ACC80 + adds r2, r5, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + adds r0, r5, 0 + bl sub_80ACAB0 +_080ACC80: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80ACB84 + + thumb_func_start sub_80ACC88 +sub_80ACC88: @ 80ACC88 + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4, 0x2E] + movs r2, 0x2E + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _080ACCA8 + adds r0, r4, 0 + bl sub_80ACAB0 + ldr r0, =sub_80ACB84 + str r0, [r4, 0x1C] + b _080ACCAC + .pool +_080ACCA8: + subs r0, r1, 0x1 + strh r0, [r4, 0x2E] +_080ACCAC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80ACC88 + + thumb_func_start sub_80ACCB4 +sub_80ACCB4: @ 80ACCB4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + lsls r5, r1, 16 + lsrs r5, 16 + ldr r2, =gUnknown_0854FC4C + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r1, =0x000006dc + adds r0, r1 + ldrb r0, [r0] + lsls r0, 2 + adds r1, r0, r2 + ldrh r1, [r1] + mov r8, r1 + adds r2, 0x2 + adds r0, r2 + ldrh r4, [r0] + add r4, r8 + adds r0, r5, 0 + adds r1, r4, 0 + bl __divsi3 + lsls r0, 16 + lsrs r6, r0, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl __modsi3 + lsls r0, 16 + lsrs r4, r0, 16 + subs r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =0x0000ffff + cmp r6, r0 + beq _080ACD12 + adds r5, r0, 0 +_080ACD02: + adds r0, r7, 0 + bl sub_80ACAB0 + subs r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, r5 + bne _080ACD02 +_080ACD12: + cmp r4, r8 + bcs _080ACD48 + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x0000ffff + cmp r4, r0 + beq _080ACD34 + adds r5, r0, 0 +_080ACD24: + adds r0, r7, 0 + bl sub_80ACB84 + subs r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, r5 + bne _080ACD24 +_080ACD34: + movs r0, 0 + b _080ACD5C + .pool +_080ACD48: + mov r1, r8 + subs r0, r4, r1 + strh r0, [r7, 0x2E] + adds r2, r7, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + movs r0, 0x1 +_080ACD5C: + strh r0, [r7, 0x3A] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80ACCB4 + + thumb_func_start sub_80ACD68 +sub_80ACD68: @ 80ACD68 + push {lr} + ldr r0, =gUnknown_0854FC54 + bl LoadObjectPic + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ACD68 + + thumb_func_start sub_80ACD78 +sub_80ACD78: @ 80ACD78 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =gUnknown_0854C14C + ldr r4, [r0] + ldr r0, =0x000006da + adds r2, r4, r0 + ldrb r0, [r2] + cmp r0, 0x18 + bne _080ACD92 + b _080ACE98 +_080ACD92: + ldrb r7, [r2] + ldr r0, =gUnknown_0854FC2C + ldr r2, =gUnknown_0854FB90 + lsls r6, r7, 2 + adds r2, r6, r2 + movs r3, 0 + ldrsh r1, [r2, r3] + movs r3, 0x2 + ldrsh r2, [r2, r3] + movs r3, 0x4E + bl AddObjectToBack + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x40 + beq _080ACE40 + ldr r3, =0x02020630 + lsls r4, r5, 4 + adds r1, r4, r5 + lsls r1, 2 + adds r1, r3 + movs r0, 0 + strh r0, [r1, 0x38] + lsls r2, r7, 3 + adds r0, r2, r7 + lsls r0, 4 + adds r0, r7 + strh r0, [r1, 0x30] + lsls r0, 16 + asrs r0, 16 + ldr r1, =0x00000257 + mov r10, r6 + mov r9, r3 + mov r12, r4 + mov r8, r2 + cmp r0, r1 + ble _080ACDF6 + adds r2, r1, 0 +_080ACDDE: + adds r0, r4, r5 + lsls r0, 2 + ldr r6, =0x02020630 + adds r0, r6 + ldr r3, =0xfffffda8 + ldrh r6, [r0, 0x30] + adds r1, r3, r6 + strh r1, [r0, 0x30] + lsls r1, 16 + asrs r1, 16 + cmp r1, r2 + bgt _080ACDDE +_080ACDF6: + mov r0, r12 + adds r4, r0, r5 + lsls r4, 2 + add r4, r9 + adds r0, r4, 0 + bl sub_80ACAB0 + mov r3, r8 + adds r1, r3, r7 + adds r0, r4, 0 + bl sub_80ACCB4 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + add r0, r10 + str r4, [r0] + b _080ACE46 + .pool +_080ACE40: + adds r1, r4, r6 + movs r0, 0 + str r0, [r1] +_080ACE46: + ldr r0, =gUnknown_0854C14C + ldr r2, [r0] + ldr r6, =0x000006da + adds r1, r2, r6 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x18 + bne _080ACE9C + movs r3, 0 + adds r1, r2, 0 + ldr r5, =sub_80ACB84 + ldr r4, =sub_80ACC88 +_080ACE64: + lsls r0, r3, 2 + adds r0, r1, r0 + ldr r2, [r0] + cmp r2, 0 + beq _080ACE8E + movs r6, 0x3A + ldrsh r0, [r2, r6] + cmp r0, 0 + bne _080ACE8C + str r5, [r2, 0x1C] + b _080ACE8E + .pool +_080ACE8C: + str r4, [r2, 0x1C] +_080ACE8E: + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0x17 + bls _080ACE64 +_080ACE98: + movs r0, 0 + b _080ACE9E +_080ACE9C: + movs r0, 0x1 +_080ACE9E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80ACD78 + + thumb_func_start sub_80ACEAC +sub_80ACEAC: @ 80ACEAC + push {r4-r7,lr} + ldr r0, =gUnknown_0854C14C + ldr r3, [r0] + movs r0, 0xDB + lsls r0, 3 + adds r4, r3, r0 + ldr r1, =0x000006d9 + adds r5, r3, r1 + ldrb r0, [r4] + ldrb r7, [r5] + cmp r0, r7 + bne _080ACED0 + movs r0, 0 + b _080ACF32 + .pool +_080ACED0: + ldr r0, =0x000006d6 + adds r2, r3, r0 + ldrh r0, [r2] + adds r0, 0x1 + movs r6, 0 + strh r0, [r2] + ldr r7, =0x000006db + adds r1, r3, r7 + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1] + cmp r0, r1 + bls _080ACF30 + strh r6, [r2] + ldrb r0, [r4] + adds r1, r0, 0 + ldrb r5, [r5] + cmp r1, r5 + bcs _080ACF10 + adds r0, 0x1 + strb r0, [r4] + lsls r0, r1, 2 + adds r0, r3, r0 + ldr r1, [r0] + movs r0, 0x1 + strh r0, [r1, 0x38] + b _080ACF30 + .pool +_080ACF10: + subs r0, 0x1 + strb r0, [r4] + ldrb r0, [r4] + lsls r0, 2 + adds r0, r3, r0 + ldr r0, [r0] + strh r6, [r0, 0x38] + ldrb r0, [r4] + lsls r0, 2 + adds r0, r3, r0 + ldr r1, [r0] + adds r1, 0x3E + ldrb r0, [r1] + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1] +_080ACF30: + movs r0, 0x1 +_080ACF32: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80ACEAC + + thumb_func_start sub_80ACF38 +sub_80ACF38: @ 80ACF38 + push {r4-r7,lr} + movs r4, 0 + ldr r0, =gUnknown_0854C14C + ldr r2, [r0] + ldr r3, =0x000006da + adds r1, r2, r3 + adds r7, r0, 0 + ldrb r1, [r1] + cmp r4, r1 + bcs _080ACF6A + adds r5, r2, 0 + adds r6, r5, r3 +_080ACF50: + lsls r0, r4, 2 + adds r0, r5, r0 + ldr r0, [r0] + cmp r0, 0 + beq _080ACF5E + bl RemoveObjectAndFreeTiles +_080ACF5E: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldrb r0, [r6] + cmp r4, r0 + bcc _080ACF50 +_080ACF6A: + ldr r0, [r7] + ldr r1, =0x000006da + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, =0x00001206 + bl FreeObjectTilesByTag + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ACF38 + + thumb_func_start sub_80ACF8C +sub_80ACF8C: @ 80ACF8C + push {r4,lr} + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x000006cc + adds r0, r1, r2 + movs r2, 0 + movs r3, 0 + strh r3, [r0] + ldr r4, =0x000006d2 + adds r0, r1, r4 + strb r2, [r0] + ldr r0, =0x000006c1 + adds r2, r1, r0 + movs r0, 0x3 + strb r0, [r2] + subs r4, 0x10 + adds r2, r1, r4 + movs r0, 0x14 + strb r0, [r2] + ldr r0, =0x000006e5 + adds r2, r1, r0 + movs r0, 0x10 + strb r0, [r2] + movs r2, 0xDC + lsls r2, 3 + adds r1, r2 + strh r3, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ACF8C + + thumb_func_start sub_80ACFDC +sub_80ACFDC: @ 80ACFDC + push {r4-r7,lr} + mov r7, r8 + push {r7} + bl sub_80ACF8C + ldr r2, =gUnknown_0854C14C + ldr r1, [r2] + ldr r3, =0x000006d2 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _080AD032 + mov r8, r2 + adds r7, r1, r3 +_080ACFF8: + bl snowflakes_progress2 + movs r4, 0 + mov r1, r8 + ldr r0, [r1] + ldr r3, =0x000006e4 + adds r0, r3 + ldrb r0, [r0] + cmp r4, r0 + bcs _080AD02C + ldr r0, =gUnknown_0854C14C + ldr r5, [r0] + adds r6, r5, r3 +_080AD012: + lsls r1, r4, 2 + adds r0, r5, 0 + adds r0, 0x60 + adds r0, r1 + ldr r0, [r0] + bl sub_80AD30C + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + ldrb r0, [r6] + cmp r4, r0 + bcc _080AD012 +_080AD02C: + ldrb r0, [r7] + cmp r0, 0 + beq _080ACFF8 +_080AD032: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ACFDC + + thumb_func_start snowflakes_progress2 +snowflakes_progress2: @ 80AD048 + push {r4,r5,lr} + ldr r0, =gUnknown_0854C14C + ldr r5, [r0] + ldr r0, =0x000006cc + adds r4, r5, r0 + ldrh r0, [r4] + cmp r0, 0 + bne _080AD070 + bl snowflakes_progress + lsls r0, 24 + cmp r0, 0 + bne _080AD070 + ldr r0, =0x000006d2 + adds r1, r5, r0 + movs r0, 0x1 + strb r0, [r1] + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_080AD070: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end snowflakes_progress2 + + thumb_func_start sub_80AD084 +sub_80AD084: @ 80AD084 + push {r4,lr} + ldr r0, =gUnknown_0854C14C + ldr r2, [r0] + ldr r0, =0x000006ce + adds r3, r2, r0 + ldrh r1, [r3] + cmp r1, 0 + beq _080AD0A4 + cmp r1, 0x1 + beq _080AD0B6 + movs r0, 0 + b _080AD0E2 + .pool +_080AD0A4: + ldr r4, =0x000006e5 + adds r0, r2, r4 + strb r1, [r0] + subs r4, 0x5 + adds r0, r2, r4 + strh r1, [r0] + ldrh r0, [r3] + adds r0, 0x1 + strh r0, [r3] +_080AD0B6: + bl snowflakes_progress + lsls r0, 24 + cmp r0, 0 + bne _080AD0E0 + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r0, =0x000006ce + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + movs r0, 0 + b _080AD0E2 + .pool +_080AD0E0: + movs r0, 0x1 +_080AD0E2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80AD084 + + thumb_func_start snowflakes_progress +snowflakes_progress: @ 80AD0E8 + push {r4,lr} + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r0, =0x000006e4 + adds r3, r1, r0 + ldr r4, =0x000006e5 + adds r2, r1, r4 + ldrb r0, [r3] + ldrb r4, [r2] + cmp r0, r4 + bne _080AD110 + movs r0, 0 + b _080AD152 + .pool +_080AD110: + movs r0, 0xDC + lsls r0, 3 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x24 + bls _080AD13A + movs r0, 0 + strh r0, [r1] + ldrb r0, [r3] + ldrb r2, [r2] + cmp r0, r2 + bcs _080AD136 + bl snowflake_add + b _080AD13A +_080AD136: + bl snowflake_remove +_080AD13A: + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r2, =0x000006e4 + adds r1, r0, r2 + ldr r4, =0x000006e5 + adds r0, r4 + ldrb r1, [r1] + ldrb r0, [r0] + eors r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 +_080AD152: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end snowflakes_progress + + thumb_func_start snowflake_add +snowflake_add: @ 80AD164 + push {r4-r6,lr} + ldr r0, =gUnknown_0854FC8C + movs r1, 0 + movs r2, 0 + movs r3, 0x4E + bl AddObjectToBack + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _080AD1C8 + ldr r0, =0x02020630 + lsls r4, r1, 4 + adds r4, r1 + lsls r4, 2 + adds r4, r0 + ldr r0, =gUnknown_0854C14C + ldr r5, [r0] + ldr r0, =0x000006e4 + adds r6, r5, r0 + ldrb r0, [r6] + strh r0, [r4, 0x36] + adds r0, r4, 0 + bl sub_80AD204 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + ldrb r0, [r6] + adds r1, r0, 0x1 + strb r1, [r6] + lsls r0, 24 + lsrs r0, 22 + adds r5, 0x60 + adds r5, r0 + str r4, [r5] + movs r0, 0x1 + b _080AD1CA + .pool +_080AD1C8: + movs r0, 0 +_080AD1CA: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end snowflake_add + + thumb_func_start snowflake_remove +snowflake_remove: @ 80AD1D0 + push {lr} + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r0, =0x000006e4 + adds r2, r1, r0 + ldrb r0, [r2] + cmp r0, 0 + bne _080AD1EC + movs r0, 0 + b _080AD200 + .pool +_080AD1EC: + subs r0, 0x1 + strb r0, [r2] + lsls r0, 24 + lsrs r0, 22 + adds r1, 0x60 + adds r1, r0 + ldr r0, [r1] + bl RemoveObjectAndFreeTiles + movs r0, 0x1 +_080AD200: + pop {r1} + bx r1 + thumb_func_end snowflake_remove + + thumb_func_start sub_80AD204 +sub_80AD204: @ 80AD204 + push {r4-r7,lr} + adds r5, r0, 0 + bl GenerateRandomNumber + movs r1, 0x36 + ldrsh r2, [r5, r1] + lsls r1, r2, 2 + adds r1, r2 + movs r2, 0x7 + ands r1, r2 + lsls r4, r1, 4 + subs r4, r1 + lsls r4, 1 + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1E + bl __umodsi3 + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + ldr r1, =0x02021bbe + adds r0, r5, 0 + adds r0, 0x29 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r1, [r1] + adds r0, r1 + movs r2, 0x3 + negs r2, r2 + adds r1, r2, 0 + subs r1, r0 + movs r7, 0 + strh r1, [r5, 0x22] + ldr r1, =0x02021bbc + adds r0, r5, 0 + adds r0, 0x28 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r1, [r1] + adds r0, r1 + subs r4, r0 + strh r4, [r5, 0x20] + movs r1, 0x22 + ldrsh r0, [r5, r1] + lsls r0, 7 + strh r0, [r5, 0x2E] + strh r7, [r5, 0x24] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r6, r0, 0 + movs r4, 0x3 + ands r4, r6 + lsls r0, r4, 2 + adds r0, r4 + adds r0, 0x40 + strh r0, [r5, 0x30] + strh r0, [r5, 0x3C] + movs r1, 0x1 + bics r1, r6 + adds r0, r5, 0 + bl StartObjectImageAnim + strh r7, [r5, 0x34] + movs r0, 0x1 + cmp r4, 0 + bne _080AD294 + movs r0, 0x2 +_080AD294: + strh r0, [r5, 0x32] + movs r0, 0x1F + ands r0, r6 + adds r0, 0xD2 + strh r0, [r5, 0x3A] + strh r7, [r5, 0x38] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AD204 + + thumb_func_start sub_80AD2B0 +sub_80AD2B0: @ 80AD2B0 + push {r4,lr} + adds r3, r0, 0 + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r1, =0x000006e2 + adds r4, r0, r1 + ldrh r0, [r4] + cmp r0, 0x12 + bls _080AD2F6 + adds r2, r3, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, =sub_80AD30C + str r0, [r3, 0x1C] + ldr r1, =0x02021bbe + adds r0, r3, 0 + adds r0, 0x29 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + ldrh r1, [r1] + adds r0, r1 + movs r1, 0xFA + subs r1, r0 + movs r2, 0 + strh r1, [r3, 0x22] + movs r1, 0x22 + ldrsh r0, [r3, r1] + lsls r0, 7 + strh r0, [r3, 0x2E] + strh r2, [r4] +_080AD2F6: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AD2B0 + + thumb_func_start sub_80AD30C +sub_80AD30C: @ 80AD30C + push {r4,r5,lr} + adds r4, r0, 0 + ldrh r0, [r4, 0x30] + ldrh r1, [r4, 0x2E] + adds r0, r1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 23 + strh r0, [r4, 0x22] + ldrh r0, [r4, 0x32] + ldrh r2, [r4, 0x34] + adds r0, r2 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x34] + ldr r1, =gUnknown_08329F40 + movs r3, 0x34 + ldrsh r0, [r4, r3] + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _080AD33E + adds r0, 0x3F +_080AD33E: + asrs r0, 6 + strh r0, [r4, 0x24] + adds r0, r4, 0 + adds r0, 0x28 + movs r5, 0 + ldrsb r5, [r0, r5] + ldrh r0, [r4, 0x20] + adds r0, r5 + ldr r1, =0x02021bbc + ldrh r1, [r1] + adds r3, r1, r0 + ldr r2, =0x000001ff + adds r0, r2, 0 + ands r3, r0 + adds r2, r3, 0 + movs r0, 0x80 + lsls r0, 1 + ands r0, r2 + cmp r0, 0 + beq _080AD370 + ldr r3, =0xffffff00 + adds r0, r3, 0 + orrs r2, r0 + lsls r0, r2, 16 + lsrs r3, r0, 16 +_080AD370: + lsls r0, r3, 16 + asrs r0, 16 + movs r2, 0x3 + negs r2, r2 + cmp r0, r2 + bge _080AD394 + adds r1, r5 + movs r0, 0xF2 + subs r0, r1 + b _080AD39C + .pool +_080AD394: + cmp r0, 0xF2 + ble _080AD39E + adds r0, r1, r5 + subs r0, r2, r0 +_080AD39C: + strh r0, [r4, 0x20] +_080AD39E: + adds r0, r4, 0 + adds r0, 0x29 + movs r3, 0 + ldrsb r3, [r0, r3] + ldrh r0, [r4, 0x22] + adds r0, r3 + ldr r1, =0x02021bbe + ldrh r1, [r1] + adds r2, r1, r0 + movs r0, 0xFF + ands r2, r0 + adds r0, r2, 0 + subs r0, 0xA4 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bhi _080AD3E0 + adds r1, r3 + movs r0, 0xFA + subs r0, r1 + movs r1, 0 + strh r0, [r4, 0x22] + movs r2, 0x22 + ldrsh r0, [r4, r2] + lsls r0, 7 + strh r0, [r4, 0x2E] + strh r1, [r4, 0x38] + movs r0, 0xDC + strh r0, [r4, 0x3A] + b _080AD40C + .pool +_080AD3E0: + adds r0, r2, 0 + subs r0, 0xF3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bhi _080AD40C + movs r1, 0 + movs r0, 0xA3 + strh r0, [r4, 0x22] + lsls r0, 7 + strh r0, [r4, 0x2E] + strh r1, [r4, 0x38] + movs r0, 0xDC + strh r0, [r4, 0x3A] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_80AD2B0 + str r0, [r4, 0x1C] +_080AD40C: + ldrh r0, [r4, 0x38] + adds r0, 0x1 + strh r0, [r4, 0x38] + lsls r0, 16 + asrs r0, 16 + movs r3, 0x3A + ldrsh r1, [r4, r3] + cmp r0, r1 + bne _080AD438 + adds r0, r4, 0 + bl sub_80AD204 + movs r0, 0xFA + strh r0, [r4, 0x22] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + ldr r0, =sub_80AD2B0 + str r0, [r4, 0x1C] +_080AD438: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AD30C + + thumb_func_start sub_80AD444 +sub_80AD444: @ 80AD444 + push {r4,r5,lr} + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x000006cc + adds r0, r1, r2 + movs r3, 0 + movs r2, 0 + strh r2, [r0] + ldr r5, =0x000006d2 + adds r4, r1, r5 + strb r3, [r4] + adds r5, 0x4 + adds r0, r1, r5 + strh r2, [r0] + ldr r0, =0x000006db + adds r2, r1, r0 + movs r0, 0x4 + strb r0, [r2] + ldr r2, =0x000006dc + adds r0, r1, r2 + strb r3, [r0] + adds r5, 0x3 + adds r2, r1, r5 + movs r0, 0x10 + strb r0, [r2] + ldr r0, =0x000006c1 + adds r2, r1, r0 + movs r0, 0x3 + strb r0, [r2] + subs r5, 0x17 + adds r2, r1, r5 + movs r0, 0x14 + strb r0, [r2] + strb r3, [r4] + ldr r0, =0x000006ed + adds r1, r0 + strb r3, [r1] + movs r0, 0x51 + bl sub_80AC31C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AD444 + + thumb_func_start sub_80AD4B8 +sub_80AD4B8: @ 80AD4B8 + push {r4,lr} + bl sub_80AD444 + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x000006d2 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080AD4D8 + adds r4, r1, r2 +_080AD4CE: + bl sub_80AD584 + ldrb r0, [r4] + cmp r0, 0 + beq _080AD4CE +_080AD4D8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AD4B8 + + thumb_func_start sub_80AD4E8 +sub_80AD4E8: @ 80AD4E8 + push {r4,r5,lr} + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x000006cc + adds r0, r1, r2 + movs r4, 0 + movs r2, 0 + strh r2, [r0] + ldr r5, =0x000006d2 + adds r3, r1, r5 + strb r4, [r3] + adds r5, 0x4 + adds r0, r1, r5 + strh r2, [r0] + ldr r0, =0x000006db + adds r2, r1, r0 + movs r0, 0x4 + strb r0, [r2] + adds r5, 0x6 + adds r2, r1, r5 + movs r0, 0x1 + strb r0, [r2] + ldr r0, =0x000006d9 + adds r2, r1, r0 + movs r0, 0x18 + strb r0, [r2] + subs r5, 0x1B + adds r2, r1, r5 + movs r0, 0x3 + strb r0, [r2] + ldr r0, =0x000006c2 + adds r1, r0 + movs r0, 0x14 + strb r0, [r1] + strb r4, [r3] + movs r0, 0x53 + bl sub_80AC31C + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AD4E8 + + thumb_func_start sub_80AD554 +sub_80AD554: @ 80AD554 + push {r4,lr} + bl sub_80AD4E8 + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x000006d2 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080AD574 + adds r4, r1, r2 +_080AD56A: + bl sub_80AD584 + ldrb r0, [r4] + cmp r0, 0 + beq _080AD56A +_080AD574: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AD554 + + thumb_func_start sub_80AD584 +sub_80AD584: @ 80AD584 + push {r4,r5,lr} + bl sub_80AD9F8 + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r1, =0x000006cc + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0xE + bls _080AD59A + b _080AD8FA +_080AD59A: + lsls r0, 2 + ldr r1, =_080AD5B0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080AD5B0: + .4byte _080AD5EC + .4byte _080AD608 + .4byte _080AD62C + .4byte _080AD65C + .4byte _080AD680 + .4byte _080AD6B0 + .4byte _080AD6E0 + .4byte _080AD70C + .4byte _080AD72A + .4byte _080AD788 + .4byte _080AD80C + .4byte _080AD834 + .4byte _080AD864 + .4byte _080AD8A8 + .4byte _080AD8DC +_080AD5EC: + bl sub_80ACD68 + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x000006cc + adds r1, r2 + ldrh r0, [r1] + adds r0, 0x1 + b _080AD8F8 + .pool +_080AD608: + bl sub_80ACD78 + lsls r0, 24 + cmp r0, 0 + beq _080AD614 + b _080AD8FA +_080AD614: + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r3, =0x000006cc + adds r1, r3 + ldrh r0, [r1] + adds r0, 0x1 + b _080AD8F8 + .pool +_080AD62C: + bl sub_80ACEAC + lsls r0, 24 + cmp r0, 0 + beq _080AD638 + b _080AD8FA +_080AD638: + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r0, =0x000006d2 + adds r2, r1, r0 + movs r0, 0x1 + strb r0, [r2] + ldr r2, =0x000006cc + adds r1, r2 + ldrh r0, [r1] + adds r0, 0x1 + b _080AD8F8 + .pool +_080AD65C: + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r3, =0x000006c6 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _080AD66C + b _080AD8FA +_080AD66C: + ldr r0, =0x000006cc + adds r1, r0 + movs r0, 0x6 + b _080AD8F8 + .pool +_080AD680: + ldr r0, =gUnknown_0854C14C + ldr r4, [r0] + ldr r2, =0x000006ea + adds r1, r4, r2 + movs r0, 0x1 + strb r0, [r1] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r5, 0xB4 + lsls r5, 1 + adds r1, r5, 0 + bl __umodsi3 + adds r0, r5 + ldr r3, =0x000006e6 + adds r1, r4, r3 + strh r0, [r1] + ldr r0, =0x000006cc + adds r4, r0 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_080AD6B0: + ldr r0, =gUnknown_0854C14C + ldr r2, [r0] + ldr r3, =0x000006e6 + adds r1, r2, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + beq _080AD6C6 + b _080AD8FA +_080AD6C6: + ldr r0, =0x000006cc + adds r1, r2, r0 + ldrh r0, [r1] + adds r0, 0x1 + b _080AD8F8 + .pool +_080AD6E0: + ldr r0, =gUnknown_0854C14C + ldr r4, [r0] + ldr r1, =0x000006ea + adds r0, r4, r1 + movs r5, 0x1 + strb r5, [r0] + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + ands r0, r5 + ldr r2, =0x000006eb + adds r1, r4, r2 + strb r0, [r1] + b _080AD768 + .pool +_080AD70C: + bl GenerateRandomNumber + ldr r1, =gUnknown_0854C14C + ldr r2, [r1] + movs r1, 0x1 + ands r1, r0 + adds r1, 0x1 + ldr r3, =0x000006ec + adds r0, r2, r3 + strb r1, [r0] + ldr r0, =0x000006cc + adds r2, r0 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] +_080AD72A: + movs r0, 0x13 + bl sub_80ABC48 + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x000006eb + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080AD74E + ldr r3, =0x000006ec + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080AD74E + movs r0, 0x14 + bl sub_80AD9BC +_080AD74E: + bl GenerateRandomNumber + ldr r1, =gUnknown_0854C14C + ldr r4, [r1] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + adds r0, 0x6 + ldr r2, =0x000006e6 + adds r1, r4, r2 + strh r0, [r1] +_080AD768: + ldr r3, =0x000006cc + adds r4, r3 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _080AD8FA + .pool +_080AD788: + ldr r0, =gUnknown_0854C14C + ldr r4, [r0] + ldr r0, =0x000006e6 + adds r5, r4, r0 + ldrh r0, [r5] + subs r0, 0x1 + strh r0, [r5] + lsls r0, 16 + cmp r0, 0 + beq _080AD79E + b _080AD8FA +_080AD79E: + movs r0, 0x3 + bl sub_80ABC48 + ldr r2, =0x000006ea + adds r1, r4, r2 + movs r0, 0x1 + strb r0, [r1] + ldr r3, =0x000006ec + adds r1, r4, r3 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + lsls r0, 24 + cmp r0, 0 + beq _080AD7E8 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF + ands r0, r1 + adds r0, 0x3C + strh r0, [r5] + ldr r0, =0x000006cc + adds r1, r4, r0 + movs r0, 0xA + b _080AD8F8 + .pool +_080AD7E8: + ldr r1, =0x000006eb + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080AD800 + ldr r2, =0x000006cc + adds r1, r4, r2 + b _080AD8F6 + .pool +_080AD800: + ldr r3, =0x000006cc + adds r1, r4, r3 + movs r0, 0xB + b _080AD8F8 + .pool +_080AD80C: + ldr r0, =gUnknown_0854C14C + ldr r2, [r0] + ldr r0, =0x000006e6 + adds r1, r2, r0 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + bne _080AD8FA + ldr r3, =0x000006cc + adds r1, r2, r3 + movs r0, 0x8 + b _080AD8F8 + .pool +_080AD834: + bl GenerateRandomNumber + ldr r1, =gUnknown_0854C14C + ldr r2, [r1] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF + ands r0, r1 + adds r0, 0x3C + ldr r3, =0x000006e6 + adds r1, r2, r3 + strh r0, [r1] + ldr r0, =0x000006cc + adds r2, r0 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + b _080AD8FA + .pool +_080AD864: + ldr r0, =gUnknown_0854C14C + ldr r5, [r0] + ldr r1, =0x000006e6 + adds r4, r5, r1 + ldrh r0, [r4] + subs r0, 0x1 + strh r0, [r4] + lsls r0, 16 + cmp r0, 0 + bne _080AD8FA + movs r0, 0x64 + bl sub_80AD9BC + movs r0, 0x13 + bl sub_80ABC48 + bl GenerateRandomNumber + movs r1, 0xF + ands r1, r0 + adds r1, 0x1E + strh r1, [r4] + ldr r2, =0x000006cc + adds r1, r5, r2 + ldrh r0, [r1] + adds r0, 0x1 + b _080AD8F8 + .pool +_080AD8A8: + ldr r0, =gUnknown_0854C14C + ldr r4, [r0] + ldr r3, =0x000006e6 + adds r1, r4, r3 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + lsls r0, 16 + cmp r0, 0 + bne _080AD8FA + movs r0, 0x13 + movs r1, 0x3 + movs r2, 0x5 + bl sub_80ABC7C + ldr r0, =0x000006cc + adds r1, r4, r0 + ldrh r0, [r1] + adds r0, 0x1 + b _080AD8F8 + .pool +_080AD8DC: + ldr r0, =gUnknown_0854C14C + ldr r2, [r0] + ldr r1, =0x000006c6 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x3 + bne _080AD8FA + ldr r3, =0x000006ea + adds r1, r2, r3 + movs r0, 0x1 + strb r0, [r1] + ldr r0, =0x000006cc + adds r1, r2, r0 +_080AD8F6: + movs r0, 0x4 +_080AD8F8: + strh r0, [r1] +_080AD8FA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AD584 + + thumb_func_start sub_80AD910 +sub_80AD910: @ 80AD910 + push {r4-r6,lr} + ldr r0, =gUnknown_0854C14C + ldr r6, [r0] + ldr r0, =0x000006ce + adds r5, r6, r0 + ldrh r1, [r5] + cmp r1, 0x1 + beq _080AD946 + cmp r1, 0x1 + bgt _080AD934 + cmp r1, 0 + beq _080AD93A + b _080AD9AC + .pool +_080AD934: + cmp r1, 0x2 + beq _080AD990 + b _080AD9AC +_080AD93A: + ldr r2, =0x000006ea + adds r0, r6, r2 + strb r1, [r0] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_080AD946: + bl sub_80AD584 + ldr r0, =gUnknown_0854C14C + ldr r2, [r0] + ldr r1, =0x000006ea + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080AD9B4 + subs r1, 0x19 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0x3 + beq _080AD9AC + cmp r0, 0x5 + beq _080AD9AC + cmp r0, 0xD + beq _080AD9AC + ldr r0, =0x000006d9 + adds r1, r2, r0 + movs r0, 0 + strb r0, [r1] + ldr r0, =0x000006ce + adds r1, r2, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _080AD9B4 + .pool +_080AD990: + bl sub_80ACEAC + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080AD9B4 + bl sub_80ACF38 + ldr r1, =0x000006ed + adds r0, r6, r1 + strb r4, [r0] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_080AD9AC: + movs r0, 0 + b _080AD9B6 + .pool +_080AD9B4: + movs r0, 0x1 +_080AD9B6: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80AD910 + + thumb_func_start sub_80AD9BC +sub_80AD9BC: @ 80AD9BC + push {r4-r6,lr} + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, =gUnknown_0854C14C + ldr r4, [r0] + ldr r0, =0x000006ed + adds r5, r4, r0 + ldrb r0, [r5] + cmp r0, 0 + bne _080AD9EA + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __umodsi3 + movs r2, 0xDD + lsls r2, 3 + adds r1, r4, r2 + strh r0, [r1] + movs r0, 0x1 + strb r0, [r5] +_080AD9EA: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AD9BC + + thumb_func_start sub_80AD9F8 +sub_80AD9F8: @ 80AD9F8 + push {r4,lr} + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x000006ed + adds r0, r1, r2 + ldrb r4, [r0] + cmp r4, 0x1 + bne _080ADA58 + movs r0, 0xDD + lsls r0, 3 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _080ADA54 + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + bne _080ADA58 + bl GenerateRandomNumber + ands r4, r0 + cmp r4, 0 + beq _080ADA38 + movs r0, 0x57 + bl audio_play + b _080ADA3E + .pool +_080ADA38: + movs r0, 0x58 + bl audio_play +_080ADA3E: + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r1, =0x000006ed + adds r0, r1 + movs r1, 0 + strb r1, [r0] + b _080ADA58 + .pool +_080ADA54: + subs r0, 0x1 + strh r0, [r1] +_080ADA58: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80AD9F8 + + thumb_func_start sub_80ADA60 +sub_80ADA60: @ 80ADA60 + push {lr} + ldr r0, =gUnknown_0854C14C + ldr r3, [r0] + ldr r0, =0x000006cc + adds r1, r3, r0 + movs r2, 0 + movs r0, 0 + strh r0, [r1] + ldr r1, =0x000006d2 + adds r0, r3, r1 + strb r2, [r0] + subs r1, 0x11 + adds r0, r3, r1 + strb r2, [r0] + ldr r2, =0x000006c2 + adds r1, r3, r2 + movs r0, 0x14 + strb r0, [r1] + ldr r1, =0x000006fb + adds r0, r3, r1 + ldrb r1, [r0] + cmp r1, 0 + bne _080ADAA8 + adds r2, 0x2E + adds r0, r3, r2 + strh r1, [r0] + adds r2, 0x2 + adds r0, r3, r2 + strh r1, [r0] + subs r2, 0x4 + adds r0, r3, r2 + strh r1, [r0] + movs r0, 0 + movs r1, 0x10 + bl sub_80AC124 +_080ADAA8: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ADA60 + + thumb_func_start sub_80ADAC0 +sub_80ADAC0: @ 80ADAC0 + push {r4,lr} + bl sub_80ADA60 + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x000006d2 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080ADAE0 + adds r4, r1, r2 +_080ADAD6: + bl sub_80ADAF0 + ldrb r0, [r4] + cmp r0, 0 + beq _080ADAD6 +_080ADAE0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ADAC0 + + thumb_func_start sub_80ADAF0 +sub_80ADAF0: @ 80ADAF0 + push {r4-r6,lr} + ldr r0, =gUnknown_0854C14C + ldr r6, [r0] + ldr r0, =0x02021bbc + ldr r1, =0x000006f2 + adds r2, r6, r1 + ldrh r0, [r0] + ldrh r1, [r2] + subs r0, r1 + movs r1, 0xFF + ands r0, r1 + ldr r3, =0x000006ee + adds r1, r6, r3 + strh r0, [r1] + movs r0, 0xDE + lsls r0, 3 + adds r1, r6, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3 + bls _080ADB2A + movs r0, 0 + strh r0, [r1] + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] +_080ADB2A: + ldr r1, =0x000006cc + adds r5, r6, r1 + ldrh r4, [r5] + cmp r4, 0 + beq _080ADB50 + cmp r4, 0x1 + beq _080ADB90 + b _080ADBA6 + .pool +_080ADB50: + bl sub_80ADCAC + movs r3, 0xDA + lsls r3, 3 + adds r0, r6, r3 + ldrb r0, [r0] + cmp r0, 0x6 + bne _080ADB6C + movs r0, 0xC + movs r1, 0x8 + movs r2, 0x3 + bl sub_80AC164 + b _080ADB76 +_080ADB6C: + movs r0, 0x4 + movs r1, 0x10 + movs r2, 0 + bl sub_80AC164 +_080ADB76: + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r0, =0x000006cc + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + b _080ADBA6 + .pool +_080ADB90: + bl sub_80AC1A8 + lsls r0, 24 + cmp r0, 0 + beq _080ADBA6 + ldr r1, =0x000006d2 + adds r0, r6, r1 + strb r4, [r0] + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] +_080ADBA6: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ADAF0 + + thumb_func_start sub_80ADBB0 +sub_80ADBB0: @ 80ADBB0 + push {r4,lr} + ldr r0, =gUnknown_0854C14C + ldr r2, [r0] + ldr r0, =0x02021bbc + ldr r1, =0x000006f2 + adds r3, r2, r1 + ldrh r0, [r0] + ldrh r1, [r3] + subs r0, r1 + movs r1, 0xFF + ands r0, r1 + ldr r4, =0x000006ee + adds r1, r2, r4 + strh r0, [r1] + movs r0, 0xDE + lsls r0, 3 + adds r1, r2, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3 + bls _080ADBEA + movs r0, 0 + strh r0, [r1] + ldrh r0, [r3] + adds r0, 0x1 + strh r0, [r3] +_080ADBEA: + ldr r1, =0x000006ce + adds r4, r2, r1 + ldrh r0, [r4] + cmp r0, 0x1 + beq _080ADC26 + cmp r0, 0x1 + bgt _080ADC14 + cmp r0, 0 + beq _080ADC1A + b _080ADC3E + .pool +_080ADC14: + cmp r0, 0x2 + beq _080ADC32 + b _080ADC3E +_080ADC1A: + movs r0, 0 + movs r1, 0x10 + movs r2, 0x3 + bl sub_80AC164 + b _080ADC36 +_080ADC26: + bl sub_80AC1A8 + lsls r0, 24 + cmp r0, 0 + beq _080ADC42 + b _080ADC36 +_080ADC32: + bl sub_80ADD68 +_080ADC36: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _080ADC42 +_080ADC3E: + movs r0, 0 + b _080ADC44 +_080ADC42: + movs r0, 0x1 +_080ADC44: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80ADBB0 + + thumb_func_start sub_80ADC4C +sub_80ADC4C: @ 80ADC4C + push {r4,lr} + adds r3, r0, 0 + ldr r0, =0x02021bbe + ldrb r0, [r0] + strh r0, [r3, 0x26] + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r1, =0x000006ee + adds r2, r0, r1 + ldrh r1, [r2] + adds r1, 0x20 + movs r4, 0x2E + ldrsh r0, [r3, r4] + lsls r0, 6 + adds r1, r0 + strh r1, [r3, 0x20] + lsls r1, 16 + ldr r0, =0x010f0000 + cmp r1, r0 + ble _080ADC90 + movs r0, 0xF0 + lsls r0, 1 + adds r1, r0, 0 + ldrh r2, [r2] + adds r1, r2 + movs r4, 0x2E + ldrsh r2, [r3, r4] + movs r0, 0x4 + subs r0, r2 + lsls r0, 6 + subs r1, r0 + ldr r0, =0x000001ff + ands r1, r0 + strh r1, [r3, 0x20] +_080ADC90: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ADC4C + + thumb_func_start sub_80ADCAC +sub_80ADCAC: @ 80ADCAC + push {r4,r5,lr} + sub sp, 0x8 + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r1, =0x000006fb + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080ADD56 + ldr r0, =gUnknown_0854FD30 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + mov r0, sp + bl LoadObjectPic + movs r5, 0 +_080ADCD0: + ldr r0, =gUnknown_0854FD18 + movs r1, 0 + movs r2, 0 + movs r3, 0xFF + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _080ADD34 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + adds r0, r5, 0 + movs r1, 0x5 + bl __umodsi3 + strh r0, [r4, 0x2E] + lsls r0, 16 + lsrs r0, 10 + adds r0, 0x20 + strh r0, [r4, 0x20] + adds r0, r5, 0 + movs r1, 0x5 + bl __udivsi3 + lsls r0, 16 + lsrs r0, 10 + adds r0, 0x20 + strh r0, [r4, 0x22] + ldr r2, =gUnknown_0854C14C + ldr r0, [r2] + lsls r1, r5, 2 + adds r0, 0xA0 + adds r0, r1 + str r4, [r0] + b _080ADD42 + .pool +_080ADD34: + ldr r2, =gUnknown_0854C14C + ldr r1, [r2] + lsls r0, r5, 2 + adds r1, 0xA0 + adds r1, r0 + movs r0, 0 + str r0, [r1] +_080ADD42: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0x13 + bls _080ADCD0 + ldr r0, [r2] + ldr r1, =0x000006fb + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] +_080ADD56: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ADCAC + + thumb_func_start sub_80ADD68 +sub_80ADD68: @ 80ADD68 + push {r4,r5,lr} + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x000006fb + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080ADDA8 + movs r4, 0 + adds r5, r1, 0 + adds r5, 0xA0 +_080ADD7E: + lsls r0, r4, 2 + adds r0, r5, r0 + ldr r0, [r0] + cmp r0, 0 + beq _080ADD8C + bl RemoveObjectAndFreeTiles +_080ADD8C: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x13 + bls _080ADD7E + ldr r0, =0x00001201 + bl FreeObjectTilesByTag + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r1, =0x000006fb + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_080ADDA8: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ADD68 + + thumb_func_start sub_80ADDBC +sub_80ADDBC: @ 80ADDBC + push {lr} + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r0, =0x000006cc + adds r2, r1, r0 + movs r3, 0 + movs r0, 0 + strh r0, [r2] + ldr r2, =0x000006d2 + adds r0, r1, r2 + strb r3, [r0] + subs r2, 0x11 + adds r0, r1, r2 + strb r3, [r0] + ldr r3, =0x000006c2 + adds r0, r1, r3 + movs r2, 0x14 + strb r2, [r0] + adds r3, 0x3C + adds r0, r1, r3 + strh r2, [r0] + movs r0, 0xE0 + lsls r0, 3 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + bne _080ADE04 + movs r0, 0 + movs r1, 0x10 + bl sub_80AC124 + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x52 + bl SetGpuReg +_080ADE04: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ADDBC + + thumb_func_start sub_80ADE18 +sub_80ADE18: @ 80ADE18 + push {r4,lr} + bl sub_80ADDBC + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x000006d2 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080ADE38 + adds r4, r1, r2 +_080ADE2E: + bl sub_80ADE48 + ldrb r0, [r4] + cmp r0, 0 + beq _080ADE2E +_080ADE38: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ADE18 + + thumb_func_start sub_80ADE48 +sub_80ADE48: @ 80ADE48 + push {r4,r5,lr} + ldr r2, =gUnknown_0854C14C + ldr r1, [r2] + ldr r0, =0x02021bbc + ldrh r0, [r0] + ldr r3, =0x000001ff + ands r3, r0 + ldr r0, =0x000006fc + adds r1, r0 + strh r3, [r1] + cmp r3, 0xEF + bls _080ADE74 + adds r4, r1, 0 + adds r1, r3, 0 +_080ADE64: + adds r3, r1, 0 + subs r3, 0xF0 + adds r1, r3, 0 + lsls r0, r3, 16 + lsrs r0, 16 + cmp r0, 0xEF + bhi _080ADE64 + strh r3, [r4] +_080ADE74: + ldr r5, [r2] + ldr r1, =0x000006cc + adds r4, r5, r1 + ldrh r0, [r4] + cmp r0, 0x1 + beq _080ADEAC + cmp r0, 0x1 + bgt _080ADEA0 + cmp r0, 0 + beq _080ADEA6 + b _080ADEE8 + .pool +_080ADEA0: + cmp r0, 0x2 + beq _080ADEC8 + b _080ADEE8 +_080ADEA6: + bl sub_80ADF5C + b _080ADEDA +_080ADEAC: + movs r1, 0xE0 + lsls r1, 3 + adds r0, r5, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080ADEBC + bl sub_80ADF6C +_080ADEBC: + movs r0, 0x10 + movs r1, 0 + movs r2, 0x1 + bl sub_80AC164 + b _080ADEDA +_080ADEC8: + bl sub_80AC1A8 + lsls r0, 24 + cmp r0, 0 + beq _080ADEEC + ldr r0, =0x000006d2 + adds r1, r5, r0 + movs r0, 0x1 + strb r0, [r1] +_080ADEDA: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _080ADEEC + .pool +_080ADEE8: + bl sub_80AC1A8 +_080ADEEC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80ADE48 + + thumb_func_start sub_80ADEF4 +sub_80ADEF4: @ 80ADEF4 + push {r4,lr} + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r1, =0x000006ce + adds r4, r0, r1 + ldrh r0, [r4] + cmp r0, 0x1 + beq _080ADF2A + cmp r0, 0x1 + bgt _080ADF18 + cmp r0, 0 + beq _080ADF1E + b _080ADF4E + .pool +_080ADF18: + cmp r0, 0x2 + beq _080ADF40 + b _080ADF4E +_080ADF1E: + movs r0, 0 + movs r1, 0x10 + movs r2, 0x1 + bl sub_80AC164 + b _080ADF38 +_080ADF2A: + bl sub_80AC1A8 + lsls r0, 24 + cmp r0, 0 + beq _080ADF52 + bl sub_80AE014 +_080ADF38: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _080ADF52 +_080ADF40: + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_080ADF4E: + movs r0, 0 + b _080ADF54 +_080ADF52: + movs r0, 0x1 +_080ADF54: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80ADEF4 + + thumb_func_start sub_80ADF5C +sub_80ADF5C: @ 80ADF5C + push {lr} + ldr r0, =gUnknown_0854FD38 + bl LoadObjectPic + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ADF5C + + thumb_func_start sub_80ADF6C +sub_80ADF6C: @ 80ADF6C + push {r4,r5,lr} + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + movs r1, 0xE0 + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080AE008 + movs r5, 0 +_080ADF80: + ldr r0, =gUnknown_0854FD58 + movs r1, 0 + movs r2, 0 + movs r3, 0x4E + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _080ADFE4 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + movs r0, 0 + strh r0, [r4, 0x30] + adds r0, r5, 0 + movs r1, 0x5 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x32] + adds r0, r5, 0 + movs r1, 0x5 + bl __udivsi3 + lsls r0, 24 + lsrs r0, 24 + strh r0, [r4, 0x34] + movs r1, 0x34 + ldrsh r0, [r4, r1] + lsls r0, 6 + adds r0, 0x20 + strh r0, [r4, 0x2E] + ldr r2, =gUnknown_0854C14C + ldr r0, [r2] + lsls r1, r5, 2 + adds r0, 0xF0 + adds r0, r1 + str r4, [r0] + b _080ADFF2 + .pool +_080ADFE4: + ldr r2, =gUnknown_0854C14C + ldr r1, [r2] + lsls r0, r5, 2 + adds r1, 0xF0 + adds r1, r0 + movs r0, 0 + str r0, [r1] +_080ADFF2: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x13 + bls _080ADF80 + ldr r0, [r2] + movs r1, 0xE0 + lsls r1, 3 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] +_080AE008: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80ADF6C + + thumb_func_start sub_80AE014 +sub_80AE014: @ 80AE014 + push {r4,r5,lr} + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + movs r2, 0xE0 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080AE058 + movs r4, 0 + adds r5, r1, 0 + adds r5, 0xF0 +_080AE02C: + lsls r0, r4, 2 + adds r0, r5, r0 + ldr r0, [r0] + cmp r0, 0 + beq _080AE03A + bl RemoveObjectAndFreeTiles +_080AE03A: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x13 + bls _080AE02C + ldr r0, =0x00001202 + bl FreeObjectTilesByTag + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + movs r1, 0xE0 + lsls r1, 3 + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_080AE058: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AE014 + + thumb_func_start sub_80AE068 +sub_80AE068: @ 80AE068 + push {r4,lr} + adds r3, r0, 0 + ldrh r0, [r3, 0x30] + adds r0, 0x1 + strh r0, [r3, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x5 + ble _080AE084 + movs r0, 0 + strh r0, [r3, 0x30] + ldrh r0, [r3, 0x2E] + adds r0, 0x1 + strh r0, [r3, 0x2E] +_080AE084: + ldr r1, =0x02021bbe + ldrh r0, [r3, 0x2E] + ldrh r1, [r1] + adds r0, r1 + strh r0, [r3, 0x22] + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r1, =0x000006fc + adds r2, r0, r1 + ldrh r1, [r2] + adds r1, 0x20 + movs r4, 0x32 + ldrsh r0, [r3, r4] + lsls r0, 6 + adds r1, r0 + strh r1, [r3, 0x20] + lsls r1, 16 + ldr r0, =0x010f0000 + cmp r1, r0 + ble _080AE0C8 + movs r0, 0xF0 + lsls r0, 1 + adds r1, r0, 0 + ldrh r2, [r2] + adds r1, r2 + movs r4, 0x32 + ldrsh r2, [r3, r4] + movs r0, 0x4 + subs r0, r2 + lsls r0, 6 + subs r1, r0 + ldr r0, =0x000001ff + ands r1, r0 + strh r1, [r3, 0x20] +_080AE0C8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AE068 + + thumb_func_start sub_80AE0E4 +sub_80AE0E4: @ 80AE0E4 + push {r4,lr} + ldr r0, =gUnknown_0854C14C + ldr r3, [r0] + ldr r1, =0x000006cc + adds r0, r3, r1 + movs r1, 0 + movs r2, 0 + strh r2, [r0] + ldr r4, =0x000006d2 + adds r0, r3, r4 + strb r1, [r0] + subs r4, 0x11 + adds r0, r3, r4 + strb r1, [r0] + ldr r0, =0x000006c2 + adds r1, r3, r0 + movs r0, 0x14 + strb r0, [r1] + movs r1, 0xDE + lsls r1, 3 + adds r0, r3, r1 + strh r2, [r0] + adds r4, 0x31 + adds r1, r3, r4 + movs r0, 0x1 + strh r0, [r1] + ldr r1, =0x00000724 + adds r0, r3, r1 + ldrb r2, [r0] + cmp r2, 0 + bne _080AE14E + adds r4, 0x2A + adds r0, r3, r4 + strh r2, [r0] + subs r1, 0x6 + adds r0, r3, r1 + strh r2, [r0] + adds r4, 0x4 + adds r0, r3, r4 + strh r2, [r0] + adds r1, 0x4 + adds r0, r3, r1 + strh r2, [r0] + subs r4, 0x8 + adds r0, r3, r4 + strh r2, [r0] + subs r1, 0x8 + adds r0, r3, r1 + strh r2, [r0] + movs r0, 0 + movs r1, 0x10 + bl sub_80AC124 +_080AE14E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AE0E4 + + thumb_func_start sub_80AE168 +sub_80AE168: @ 80AE168 + push {r4,lr} + bl sub_80AE0E4 + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x000006d2 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080AE188 + adds r4, r1, r2 +_080AE17E: + bl sub_80AE198 + ldrb r0, [r4] + cmp r0, 0 + beq _080AE17E +_080AE188: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AE168 + + thumb_func_start sub_80AE198 +sub_80AE198: @ 80AE198 + push {r4,r5,lr} + bl sub_80AE25C + ldr r0, =gUnknown_0854C14C + ldr r5, [r0] + ldr r0, =0x000006cc + adds r4, r5, r0 + ldrh r0, [r4] + cmp r0, 0x1 + beq _080AE1CC + cmp r0, 0x1 + bgt _080AE1C0 + cmp r0, 0 + beq _080AE1C6 + b _080AE1F0 + .pool +_080AE1C0: + cmp r0, 0x2 + beq _080AE1D8 + b _080AE1F0 +_080AE1C6: + bl sub_80AE2F0 + b _080AE1EA +_080AE1CC: + movs r0, 0xC + movs r1, 0x8 + movs r2, 0x8 + bl sub_80AC164 + b _080AE1EA +_080AE1D8: + bl sub_80AC1A8 + lsls r0, 24 + cmp r0, 0 + beq _080AE1F0 + ldr r0, =0x000006d2 + adds r1, r5, r0 + movs r0, 0x1 + strb r0, [r1] +_080AE1EA: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_080AE1F0: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AE198 + + thumb_func_start sub_80AE1FC +sub_80AE1FC: @ 80AE1FC + push {r4,lr} + bl sub_80AE25C + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r1, =0x000006ce + adds r4, r0, r1 + ldrh r0, [r4] + cmp r0, 0x1 + beq _080AE236 + cmp r0, 0x1 + bgt _080AE224 + cmp r0, 0 + beq _080AE22A + b _080AE24E + .pool +_080AE224: + cmp r0, 0x2 + beq _080AE242 + b _080AE24E +_080AE22A: + movs r0, 0 + movs r1, 0x10 + movs r2, 0x1 + bl sub_80AC164 + b _080AE246 +_080AE236: + bl sub_80AC1A8 + lsls r0, 24 + cmp r0, 0 + beq _080AE252 + b _080AE246 +_080AE242: + bl sub_80AE3A8 +_080AE246: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _080AE252 +_080AE24E: + movs r0, 0 + b _080AE254 +_080AE252: + movs r0, 0x1 +_080AE254: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80AE1FC + + thumb_func_start sub_80AE25C +sub_80AE25C: @ 80AE25C + push {r4,r5,lr} + ldr r0, =gUnknown_0854C14C + ldr r3, [r0] + ldr r0, =0x0000071c + adds r2, r3, r0 + ldrh r0, [r2] + adds r0, 0x1 + movs r5, 0 + strh r0, [r2] + ldr r1, =0x0000ffff + adds r4, r1, 0 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bls _080AE288 + movs r0, 0xE4 + lsls r0, 3 + adds r1, r3, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + strh r5, [r2] +_080AE288: + ldr r1, =0x0000071e + adds r2, r3, r1 + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] + ands r0, r4 + cmp r0, 0x4 + bls _080AE2A4 + ldr r0, =0x00000722 + adds r1, r3, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + strh r5, [r2] +_080AE2A4: + ldr r0, =0x02021bbc + movs r2, 0xE4 + lsls r2, 3 + adds r1, r3, r2 + ldrh r0, [r0] + ldrh r1, [r1] + subs r0, r1 + movs r1, 0xFF + ands r0, r1 + subs r2, 0x8 + adds r1, r3, r2 + strh r0, [r1] + ldr r1, =0x02021bbe + adds r2, 0xA + adds r0, r3, r2 + ldrh r0, [r0] + ldrh r1, [r1] + adds r0, r1 + subs r2, 0x8 + adds r1, r3, r2 + strh r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AE25C + + thumb_func_start sub_80AE2F0 +sub_80AE2F0: @ 80AE2F0 + push {r4-r6,lr} + sub sp, 0x8 + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r1, =0x00000724 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080AE396 + ldr r0, =gUnknown_0854FD70 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp] + str r1, [sp, 0x4] + mov r0, sp + bl LoadObjectPic + movs r6, 0 +_080AE314: + adds r0, r6, 0 + movs r1, 0x5 + bl __udivsi3 + adds r5, r0, 0 + lsls r2, r5, 22 + asrs r2, 16 + ldr r0, =gUnknown_0854FD8C + movs r1, 0 + movs r3, 0xFF + bl AddObjectToBack + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x40 + beq _080AE370 + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + adds r0, r6, 0 + movs r1, 0x5 + bl __umodsi3 + strh r0, [r4, 0x2E] + strh r5, [r4, 0x30] + ldr r2, =gUnknown_0854C14C + ldr r0, [r2] + lsls r1, r6, 2 + movs r3, 0xA0 + lsls r3, 1 + adds r0, r3 + adds r0, r1 + str r4, [r0] + b _080AE382 + .pool +_080AE370: + ldr r2, =gUnknown_0854C14C + ldr r1, [r2] + lsls r0, r6, 2 + movs r3, 0xA0 + lsls r3, 1 + adds r1, r3 + adds r1, r0 + movs r0, 0 + str r0, [r1] +_080AE382: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0x13 + bls _080AE314 + ldr r0, [r2] + ldr r1, =0x00000724 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] +_080AE396: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AE2F0 + + thumb_func_start sub_80AE3A8 +sub_80AE3A8: @ 80AE3A8 + push {r4,r5,lr} + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x00000724 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080AE3EA + movs r4, 0 + movs r0, 0xA0 + lsls r0, 1 + adds r5, r1, r0 +_080AE3C0: + lsls r0, r4, 2 + adds r0, r5, r0 + ldr r0, [r0] + cmp r0, 0 + beq _080AE3CE + bl RemoveObjectAndFreeTiles +_080AE3CE: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x13 + bls _080AE3C0 + ldr r0, =0x00001203 + bl FreeObjectTilesByTag + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r1, =0x00000724 + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_080AE3EA: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AE3A8 + + thumb_func_start sub_80AE3FC +sub_80AE3FC: @ 80AE3FC + push {r4,lr} + adds r3, r0, 0 + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x0000071a + adds r0, r1, r2 + ldrh r0, [r0] + strh r0, [r3, 0x26] + movs r4, 0xE3 + lsls r4, 3 + adds r2, r1, r4 + ldrh r1, [r2] + adds r1, 0x20 + movs r4, 0x2E + ldrsh r0, [r3, r4] + lsls r0, 6 + adds r1, r0 + strh r1, [r3, 0x20] + lsls r1, 16 + ldr r0, =0x010f0000 + cmp r1, r0 + ble _080AE444 + movs r0, 0xF0 + lsls r0, 1 + adds r1, r0, 0 + ldrh r2, [r2] + adds r1, r2 + movs r4, 0x2E + ldrsh r2, [r3, r4] + movs r0, 0x4 + subs r0, r2 + lsls r0, 6 + subs r1, r0 + ldr r0, =0x000001ff + ands r1, r0 + strh r1, [r3, 0x20] +_080AE444: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AE3FC + + thumb_func_start sub_80AE45C +sub_80AE45C: @ 80AE45C + push {r4,lr} + ldr r0, =gUnknown_0854C14C + ldr r3, [r0] + ldr r0, =0x000006cc + adds r1, r3, r0 + movs r2, 0 + movs r0, 0 + strh r0, [r1] + ldr r1, =0x000006d2 + adds r0, r3, r1 + strb r2, [r0] + ldr r4, =0x000006c1 + adds r0, r3, r4 + strb r2, [r0] + ldr r0, =0x000006c2 + adds r1, r3, r0 + movs r0, 0x14 + strb r0, [r1] + ldr r1, =0x00000716 + adds r0, r3, r1 + ldrb r2, [r0] + cmp r2, 0 + bne _080AE4B8 + adds r4, 0x43 + adds r1, r3, r4 + adds r4, 0x4 + adds r0, r3, r4 + str r2, [r0] + str r2, [r1] + ldr r0, =0x00000712 + adds r1, r3, r0 + movs r0, 0x8 + strh r0, [r1] + adds r4, 0xC + adds r0, r3, r4 + strh r2, [r0] + ldrh r2, [r1] + cmp r2, 0x5F + bls _080AE4B0 + movs r0, 0x80 + subs r0, r2 + strh r0, [r1] +_080AE4B0: + movs r0, 0 + movs r1, 0x10 + bl sub_80AC124 +_080AE4B8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AE45C + + thumb_func_start sub_80AE4DC +sub_80AE4DC: @ 80AE4DC + push {r4,lr} + bl sub_80AE45C + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x000006d2 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080AE4FC + adds r4, r1, r2 +_080AE4F2: + bl sub_80AE50C + ldrb r0, [r4] + cmp r0, 0 + beq _080AE4F2 +_080AE4FC: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AE4DC + + thumb_func_start sub_80AE50C +sub_80AE50C: @ 80AE50C + push {r4,r5,lr} + bl sub_80AE624 + bl sub_80AE5EC + ldr r0, =gUnknown_0854C14C + ldr r5, [r0] + ldr r0, =0x00000712 + adds r1, r5, r0 + ldrh r0, [r1] + cmp r0, 0x5F + bls _080AE528 + movs r0, 0x20 + strh r0, [r1] +_080AE528: + ldr r0, =0x000006cc + adds r4, r5, r0 + ldrh r0, [r4] + cmp r0, 0x1 + beq _080AE558 + cmp r0, 0x1 + bgt _080AE548 + cmp r0, 0 + beq _080AE54E + b _080AE57C + .pool +_080AE548: + cmp r0, 0x2 + beq _080AE564 + b _080AE57C +_080AE54E: + bl sub_80AE738 + bl sub_80AE7F8 + b _080AE576 +_080AE558: + movs r0, 0x10 + movs r1, 0 + movs r2, 0 + bl sub_80AC164 + b _080AE576 +_080AE564: + bl sub_80AC1A8 + lsls r0, 24 + cmp r0, 0 + beq _080AE57C + ldr r0, =0x000006d2 + adds r1, r5, r0 + movs r0, 0x1 + strb r0, [r1] +_080AE576: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] +_080AE57C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AE50C + + thumb_func_start sub_80AE588 +sub_80AE588: @ 80AE588 + push {r4,lr} + bl sub_80AE624 + bl sub_80AE5EC + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r1, =0x000006ce + adds r4, r0, r1 + ldrh r0, [r4] + cmp r0, 0x1 + beq _080AE5C6 + cmp r0, 0x1 + bgt _080AE5B4 + cmp r0, 0 + beq _080AE5BA + b _080AE5DE + .pool +_080AE5B4: + cmp r0, 0x2 + beq _080AE5D2 + b _080AE5DE +_080AE5BA: + movs r0, 0 + movs r1, 0x10 + movs r2, 0 + bl sub_80AC164 + b _080AE5D6 +_080AE5C6: + bl sub_80AC1A8 + lsls r0, 24 + cmp r0, 0 + beq _080AE5E2 + b _080AE5D6 +_080AE5D2: + bl sub_80AE6A4 +_080AE5D6: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _080AE5E2 +_080AE5DE: + movs r0, 0 + b _080AE5E4 +_080AE5E2: + movs r0, 0x1 +_080AE5E4: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80AE588 + + thumb_func_start sub_80AE5EC +sub_80AE5EC: @ 80AE5EC + push {lr} + ldr r0, =gUnknown_0854C14C + ldr r2, [r0] + ldr r0, =0x00000714 + adds r3, r2, r0 + ldrh r0, [r3] + adds r1, r0, 0x1 + strh r1, [r3] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4 + bls _080AE612 + ldr r1, =0x00000712 + adds r0, r2, r1 + ldrh r1, [r0] + adds r1, 0x1 + movs r2, 0 + strh r1, [r0] + strh r2, [r3] +_080AE612: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AE5EC + + thumb_func_start sub_80AE624 +sub_80AE624: @ 80AE624 + push {r4-r6,lr} + ldr r0, =gUnknown_0854C14C + ldr r2, [r0] + ldr r0, =0x00000704 + adds r4, r2, r0 + ldr r6, =gUnknown_08329F40 + ldr r1, =0x00000712 + adds r5, r2, r1 + ldrh r0, [r5] + lsls r0, 1 + adds r0, r6 + movs r3, 0 + ldrsh r1, [r0, r3] + lsls r1, 2 + ldr r0, [r4] + subs r0, r1 + str r0, [r4] + movs r0, 0xE1 + lsls r0, 3 + adds r3, r2, r0 + ldrh r0, [r5] + lsls r0, 1 + adds r0, r6 + movs r5, 0 + ldrsh r1, [r0, r5] + ldr r0, [r3] + subs r0, r1 + str r0, [r3] + ldr r1, =0x02021bbc + ldr r0, [r4] + lsrs r0, 8 + ldrh r1, [r1] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + ldr r4, =0x0000070e + adds r1, r2, r4 + strh r0, [r1] + ldr r1, =0x02021bbe + ldr r0, [r3] + lsrs r0, 8 + ldrh r1, [r1] + adds r0, r1 + movs r5, 0xE2 + lsls r5, 3 + adds r2, r5 + strh r0, [r2] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AE624 + + thumb_func_start sub_80AE6A4 +sub_80AE6A4: @ 80AE6A4 + push {r4,r5,lr} + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x00000716 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080AE6E6 + movs r4, 0 + movs r0, 0xC8 + lsls r0, 1 + adds r5, r1, r0 +_080AE6BC: + lsls r0, r4, 2 + adds r0, r5, r0 + ldr r0, [r0] + cmp r0, 0 + beq _080AE6CA + bl RemoveObjectAndFreeTiles +_080AE6CA: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x13 + bls _080AE6BC + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r1, =0x00000716 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, =0x00001204 + bl FreeObjectTilesByTag +_080AE6E6: + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x00000717 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080AE720 + movs r4, 0 + movs r0, 0xF0 + lsls r0, 1 + adds r5, r1, r0 +_080AE6FC: + lsls r0, r4, 2 + adds r0, r5, r0 + ldr r0, [r0] + cmp r0, 0 + beq _080AE70A + bl RemoveObjectAndFreeTiles +_080AE70A: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x4 + bls _080AE6FC + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r1, =0x00000717 + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_080AE720: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AE6A4 + + thumb_func_start sub_80AE738 +sub_80AE738: @ 80AE738 + push {r4-r7,lr} + sub sp, 0x4 + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r1, =0x00000716 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080AE7E6 + ldr r0, =gUnknown_0854FDDC + bl LoadObjectPic + ldr r0, =gUnknown_0854C2B0 + bl sub_80ABF4C + movs r7, 0 +_080AE758: + adds r0, r7, 0 + movs r1, 0x5 + bl __udivsi3 + adds r6, r0, 0 + lsls r2, r6, 22 + asrs r2, 16 + ldr r0, =gUnknown_0854FDC4 + movs r1, 0 + movs r3, 0x1 + bl AddObjectToBack + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _080AE7C0 + ldr r2, =gUnknown_0854C14C + ldr r5, [r2] + lsls r0, r7, 2 + movs r3, 0xC8 + lsls r3, 1 + adds r5, r3 + adds r5, r0 + lsls r4, r1, 4 + adds r4, r1 + lsls r4, 2 + ldr r0, =0x02020630 + adds r4, r0 + str r4, [r5] + adds r0, r7, 0 + movs r1, 0x5 + str r2, [sp] + bl __umodsi3 + strh r0, [r4, 0x2E] + ldr r0, [r5] + strh r6, [r0, 0x30] + ldr r2, [sp] + b _080AE7D2 + .pool +_080AE7C0: + ldr r2, =gUnknown_0854C14C + ldr r1, [r2] + lsls r0, r7, 2 + movs r3, 0xC8 + lsls r3, 1 + adds r1, r3 + adds r1, r0 + movs r0, 0 + str r0, [r1] +_080AE7D2: + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0x13 + bls _080AE758 + ldr r0, [r2] + ldr r1, =0x00000716 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] +_080AE7E6: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AE738 + + thumb_func_start sub_80AE7F8 +sub_80AE7F8: @ 80AE7F8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, =gUnknown_0854C14C + ldr r0, [r4] + ldr r1, =0x00000717 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080AE8E4 + movs r7, 0 + mov r9, r4 + movs r2, 0 + mov r10, r2 +_080AE818: + lsls r0, r7, 1 + mov r8, r0 + adds r6, r0, r7 + lsls r5, r6, 4 + adds r1, r5, 0 + adds r1, 0x18 + lsls r1, 16 + asrs r1, 16 + ldr r0, =gUnknown_0854FDC4 + movs r2, 0xD0 + movs r3, 0x1 + bl AddObjectToBack + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x40 + beq _080AE8BC + mov r2, r9 + ldr r4, [r2] + lsls r0, r7, 2 + movs r2, 0xF0 + lsls r2, 1 + adds r4, r2 + adds r4, r0 + lsls r2, r1, 4 + adds r2, r1 + lsls r2, 2 + ldr r0, =0x02020630 + adds r2, r0 + str r2, [r4] + ldrb r1, [r2, 0x3] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2, 0x3] + ldr r1, [r4] + adds r0, r6, r5 + strh r0, [r1, 0x30] + ldr r1, [r4] + movs r0, 0x8 + strh r0, [r1, 0x2E] + ldr r0, [r4] + mov r1, r10 + strh r1, [r0, 0x32] + ldr r1, [r4] + ldr r0, =0x00006730 + strh r0, [r1, 0x36] + ldr r1, [r4] + ldr r0, =gUnknown_0854FDE4 + add r0, r8 + ldrh r0, [r0] + strh r0, [r1, 0x34] + ldr r0, [r4] + movs r1, 0x1 + bl StartObjectImageAnim + ldr r0, [r4] + movs r1, 0 + movs r2, 0x2 + movs r3, 0 + bl CalcVecFromObjectCenterToObjectUpperLeft + ldr r1, [r4] + ldr r0, =sub_80AE958 + str r0, [r1, 0x1C] + b _080AE8CE + .pool +_080AE8BC: + mov r2, r9 + ldr r0, [r2] + lsls r1, r7, 2 + movs r2, 0xF0 + lsls r2, 1 + adds r0, r2 + adds r0, r1 + mov r1, r10 + str r1, [r0] +_080AE8CE: + mov r2, r9 + ldr r0, [r2] + ldr r1, =0x00000717 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + adds r0, r7, 0x1 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0x4 + bls _080AE818 +_080AE8E4: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AE7F8 + + thumb_func_start sub_80AE8F8 +sub_80AE8F8: @ 80AE8F8 + push {r4,lr} + adds r3, r0, 0 + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + movs r2, 0xE2 + lsls r2, 3 + adds r0, r1, r2 + ldrh r0, [r0] + strh r0, [r3, 0x26] + ldr r4, =0x0000070e + adds r2, r1, r4 + ldrh r1, [r2] + adds r1, 0x20 + movs r4, 0x2E + ldrsh r0, [r3, r4] + lsls r0, 6 + adds r1, r0 + strh r1, [r3, 0x20] + lsls r1, 16 + ldr r0, =0x010f0000 + cmp r1, r0 + ble _080AE940 + movs r0, 0xF0 + lsls r0, 1 + adds r1, r0, 0 + ldrh r2, [r2] + adds r1, r2 + movs r4, 0x2E + ldrsh r2, [r3, r4] + movs r0, 0x4 + subs r0, r2 + lsls r0, 6 + subs r1, r0 + ldr r0, =0x000001ff + ands r1, r0 + strh r1, [r3, 0x20] +_080AE940: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AE8F8 + + thumb_func_start sub_80AE958 +sub_80AE958: @ 80AE958 + push {lr} + adds r2, r0, 0 + ldrh r0, [r2, 0x34] + subs r0, 0x1 + strh r0, [r2, 0x34] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _080AE972 + ldr r0, =sub_80AE97C + str r0, [r2, 0x1C] +_080AE972: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AE958 + + thumb_func_start sub_80AE97C +sub_80AE97C: @ 80AE97C + push {r4,r5,lr} + adds r5, r0, 0 + ldrh r0, [r5, 0x22] + subs r0, 0x1 + strh r0, [r5, 0x22] + lsls r0, 16 + asrs r0, 16 + movs r1, 0x30 + negs r1, r1 + cmp r0, r1 + bge _080AE99A + movs r0, 0xD0 + strh r0, [r5, 0x22] + movs r0, 0x4 + strh r0, [r5, 0x2E] +_080AE99A: + movs r0, 0x2E + ldrsh r4, [r5, r0] + ldr r3, =gUnknown_08329F40 + movs r2, 0x30 + ldrsh r1, [r5, r2] + lsls r0, r1, 1 + adds r0, r3 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r2, r4, 0 + muls r2, r0 + adds r1, 0x40 + lsls r1, 1 + adds r1, r3 + movs r3, 0 + ldrsh r0, [r1, r3] + muls r0, r4 + lsrs r2, 8 + strh r2, [r5, 0x24] + lsrs r0, 8 + strh r0, [r5, 0x26] + ldrh r0, [r5, 0x30] + adds r0, 0xA + movs r1, 0xFF + ands r0, r1 + strh r0, [r5, 0x30] + ldrh r0, [r5, 0x32] + adds r0, 0x1 + strh r0, [r5, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _080AE9E6 + movs r0, 0 + strh r0, [r5, 0x32] + ldrh r0, [r5, 0x2E] + adds r0, 0x1 + strh r0, [r5, 0x2E] +_080AE9E6: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AE97C + + thumb_func_start sub_80AE9F0 +sub_80AE9F0: @ 80AE9F0 + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r0, =0x000006cc + adds r2, r1, r0 + movs r0, 0 + strh r0, [r2] + ldr r0, =0x000006c1 + adds r2, r1, r0 + movs r0, 0x3 + strb r0, [r2] + ldr r0, =0x000006c2 + adds r1, r0 + movs r0, 0x14 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_80AE9F0 + + thumb_func_start sub_80AEA20 +sub_80AEA20: @ 80AEA20 + push {lr} + bl sub_80AE9F0 + pop {r0} + bx r0 + thumb_func_end sub_80AEA20 + + thumb_func_start nullsub_96 +nullsub_96: @ 80AEA2C + bx lr + thumb_func_end nullsub_96 + + thumb_func_start sub_80AEA30 +sub_80AEA30: @ 80AEA30 + movs r0, 0 + bx lr + thumb_func_end sub_80AEA30 + + thumb_func_start sub_80AEA34 +sub_80AEA34: @ 80AEA34 + push {r4,r5,lr} + bl sub_80ADA60 + ldr r0, =gUnknown_0854C14C + ldr r4, [r0] + ldr r1, =0x0000072e + adds r0, r4, r1 + ldrb r5, [r0] + cmp r5, 0 + bne _080AEA6C + ldr r0, =gUnknown_0854FDF8 + bl LoadObjectPic + movs r2, 0xE5 + lsls r2, 3 + adds r0, r4, r2 + strh r5, [r0] + ldr r0, =gUnknown_0854FDF0 + ldrb r1, [r0] + subs r2, 0x2 + adds r0, r4, r2 + strh r1, [r0] + ldr r1, =0x0000072a + adds r0, r4, r1 + strh r5, [r0] + adds r2, 0x6 + adds r0, r4, r2 + strh r5, [r0] +_080AEA6C: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AEA34 + + thumb_func_start sub_80AEA88 +sub_80AEA88: @ 80AEA88 + push {r4,lr} + bl sub_80AEA34 + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r2, =0x000006d2 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080AEAA8 + adds r4, r1, r2 +_080AEA9E: + bl sub_80AEAB8 + ldrb r0, [r4] + cmp r0, 0 + beq _080AEA9E +_080AEAA8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AEA88 + + thumb_func_start sub_80AEAB8 +sub_80AEAB8: @ 80AEAB8 + push {r4-r7,lr} + bl sub_80ADAF0 + ldr r0, =gUnknown_0854C14C + ldr r5, [r0] + ldr r0, =0x00000726 + adds r4, r5, r0 + ldrh r0, [r4] + adds r0, 0x1 + movs r6, 0 + strh r0, [r4] + ldr r1, =0x0000ffff + adds r7, r1, 0 + ldr r2, =gUnknown_0854FDF0 + movs r1, 0xE5 + lsls r1, 3 + adds r3, r5, r1 + ldrh r1, [r3] + adds r1, r2 + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1] + cmp r0, r1 + bls _080AEB10 + strh r6, [r4] + ldrh r0, [r3] + adds r0, 0x1 + strh r0, [r3] + ands r0, r7 + cmp r0, 0x7 + bls _080AEAF8 + strh r6, [r3] +_080AEAF8: + ldr r0, =0x0000072a + adds r4, r5, r0 + ldrh r0, [r4] + bl sub_80AEB48 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + ands r0, r7 + cmp r0, 0xC + bls _080AEB10 + strh r6, [r4] +_080AEB10: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AEAB8 + + thumb_func_start sub_80AEB2C +sub_80AEB2C: @ 80AEB2C + push {lr} + bl sub_80ADBB0 + lsls r0, 24 + cmp r0, 0 + beq _080AEB3C + movs r0, 0x1 + b _080AEB42 +_080AEB3C: + bl sub_80AEBD0 + movs r0, 0 +_080AEB42: + pop {r1} + bx r1 + thumb_func_end sub_80AEB2C + + thumb_func_start sub_80AEB48 +sub_80AEB48: @ 80AEB48 + push {r4,lr} + lsls r0, 16 + ldr r1, =gUnknown_0854FE00 + lsrs r0, 14 + adds r3, r0, r1 + adds r1, 0x2 + adds r0, r1 + ldr r1, =0x02021bbe + ldrh r2, [r0] + ldrh r0, [r1] + subs r2, r0 + ldr r0, =gUnknown_0854FE44 + movs r4, 0 + ldrsh r1, [r3, r4] + lsls r2, 16 + asrs r2, 16 + movs r3, 0 + bl AddObjectToBack + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0x40 + beq _080AEBB0 + ldr r0, =0x02020630 + lsls r1, r2, 4 + adds r1, r2 + lsls r1, 2 + adds r1, r0 + ldrb r2, [r1, 0x5] + movs r0, 0xD + negs r0, r0 + ands r0, r2 + movs r2, 0x4 + orrs r0, r2 + strb r0, [r1, 0x5] + adds r3, r1, 0 + adds r3, 0x3E + ldrb r0, [r3] + movs r2, 0x2 + orrs r0, r2 + strb r0, [r3] + movs r0, 0 + strh r0, [r1, 0x2E] + strh r0, [r1, 0x30] + strh r0, [r1, 0x32] + ldr r0, =gUnknown_0854C14C + ldr r1, [r0] + ldr r0, =0x0000072c + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_080AEBB0: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AEB48 + + thumb_func_start sub_80AEBD0 +sub_80AEBD0: @ 80AEBD0 + push {r4,r5,lr} + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r1, =0x0000072c + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _080AEC1A + movs r4, 0 + ldr r5, =0x02020630 +_080AEBE4: + lsls r0, r4, 4 + adds r0, r4 + lsls r2, r0, 2 + adds r0, r5, 0 + adds r0, 0x14 + adds r0, r2, r0 + ldr r1, [r0] + ldr r0, =gUnknown_0854FE44 + cmp r1, r0 + bne _080AEBFE + adds r0, r2, r5 + bl RemoveObjectAndFreeTiles +_080AEBFE: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3F + bls _080AEBE4 + ldr r0, =0x00001205 + bl FreeObjectTilesByTag + ldr r0, =gUnknown_0854C14C + ldr r0, [r0] + ldr r1, =0x0000072c + adds r0, r1 + movs r1, 0 + strh r1, [r0] +_080AEC1A: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AEBD0 + + thumb_func_start unc_0807DAB4 +unc_0807DAB4: @ 80AEC34 + push {lr} + adds r1, r0, 0 + ldrh r0, [r1, 0x2E] + movs r2, 0 + adds r0, 0x2 + strh r0, [r1, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + ble _080AEC74 + strh r2, [r1, 0x2E] + movs r3, 0x30 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _080AEC66 + ldrh r0, [r1, 0x24] + adds r0, 0x1 + strh r0, [r1, 0x24] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + ble _080AEC74 + movs r0, 0x1 + strh r0, [r1, 0x30] + b _080AEC74 +_080AEC66: + ldrh r0, [r1, 0x24] + subs r0, 0x1 + strh r0, [r1, 0x24] + lsls r0, 16 + cmp r0, 0 + bgt _080AEC74 + strh r2, [r1, 0x30] +_080AEC74: + ldrh r0, [r1, 0x22] + subs r0, 0x3 + strh r0, [r1, 0x22] + ldrh r0, [r1, 0x32] + adds r0, 0x1 + strh r0, [r1, 0x32] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x77 + ble _080AEC8E + adds r0, r1, 0 + bl RemoveObjectAndFreeTiles +_080AEC8E: + pop {r0} + bx r0 + thumb_func_end unc_0807DAB4 + + thumb_func_start sub_80AEC94 +sub_80AEC94: @ 80AEC94 + ldr r2, =0x02038bc4 + strb r0, [r2] + ldr r0, =0x02038bc6 + strh r1, [r0] + bx lr + .pool + thumb_func_end sub_80AEC94 + + thumb_func_start sub_80AECA8 +sub_80AECA8: @ 80AECA8 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r4, r1, r0 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080AECCC + cmp r0, 0x1 + beq _080AECF8 + b _080AED1C + .pool +_080AECCC: + ldrh r0, [r4, 0x1E] + subs r1, r0, 0x1 + strh r1, [r4, 0x1E] + lsls r0, 16 + cmp r0, 0 + bgt _080AED1C + ldrb r0, [r4, 0x2] + bl weather_set + ldr r1, =0x02038bc4 + ldrh r0, [r4, 0x2] + strb r0, [r1] + movs r1, 0x96 + lsls r1, 2 + adds r0, r1, 0 + strh r0, [r4, 0x1E] + ldrh r0, [r4] + adds r0, 0x1 + b _080AED1A + .pool +_080AECF8: + ldrh r0, [r4, 0x1E] + subs r1, r0, 0x1 + strh r1, [r4, 0x1E] + lsls r0, 16 + cmp r0, 0 + bgt _080AED1C + ldrb r0, [r4, 0x4] + bl weather_set + ldr r1, =0x02038bc4 + ldrh r0, [r4, 0x4] + strb r0, [r1] + movs r1, 0x96 + lsls r1, 2 + adds r0, r1, 0 + strh r0, [r4, 0x1E] + movs r0, 0 +_080AED1A: + strh r0, [r4] +_080AED1C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AECA8 + + thumb_func_start bag_add_task0_by_acit +bag_add_task0_by_acit: @ 80AED28 + push {lr} + ldr r0, =sub_80AECA8 + movs r1, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =0x03005e08 + adds r1, r0 + movs r2, 0x96 + lsls r2, 2 + adds r0, r2, 0 + strh r0, [r1, 0x1E] + ldr r3, =0x02038bc4 + ldrb r2, [r3] + cmp r2, 0xD + bne _080AED60 + movs r0, 0xC + b _080AED66 + .pool +_080AED60: + cmp r2, 0xC + bne _080AED6C + movs r0, 0xD +_080AED66: + strh r0, [r1, 0x2] + strh r2, [r1, 0x4] + b _080AED78 +_080AED6C: + movs r0, 0xD + strb r0, [r3] + movs r0, 0xC + strh r0, [r1, 0x2] + movs r0, 0xD + strh r0, [r1, 0x4] +_080AED78: + pop {r0} + bx r0 + thumb_func_end bag_add_task0_by_acit + + thumb_func_start sub_80AED7C +sub_80AED7C: @ 80AED7C + push {r4,r5,lr} + ldr r4, =0x03005d8c + ldr r1, [r4] + adds r1, 0x2E + ldrb r5, [r1] + lsls r0, 24 + lsrs r0, 24 + bl sub_80AEEE8 + ldr r1, [r4] + adds r1, 0x2E + strb r0, [r1] + ldr r0, [r4] + adds r0, 0x2E + ldrb r0, [r0] + adds r1, r5, 0 + bl sub_80AEFDC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AED7C + + thumb_func_start sav1_get_weather_probably +sav1_get_weather_probably: @ 80AEDAC + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r0, 0x2E + ldrb r0, [r0] + bx lr + .pool + thumb_func_end sav1_get_weather_probably + + thumb_func_start sub_80AEDBC +sub_80AEDBC: @ 80AEDBC + push {r4,r5,lr} + ldr r4, =0x03005d8c + ldr r0, [r4] + adds r0, 0x2E + ldrb r5, [r0] + ldr r0, =0x02037318 + ldrb r0, [r0, 0x16] + bl sub_80AEEE8 + ldr r1, [r4] + adds r1, 0x2E + strb r0, [r1] + ldr r0, [r4] + adds r0, 0x2E + ldrb r0, [r0] + adds r1, r5, 0 + bl sub_80AEFDC + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AEDBC + + thumb_func_start sub_80AEDF0 +sub_80AEDF0: @ 80AEDF0 + push {lr} + bl sub_80AED7C + bl sav1_get_weather_probably + lsls r0, 24 + lsrs r0, 24 + bl weather_set + pop {r0} + bx r0 + thumb_func_end sub_80AEDF0 + + thumb_func_start sub_80AEE08 +sub_80AEE08: @ 80AEE08 + push {lr} + bl sub_80AED7C + bl sav1_get_weather_probably + lsls r0, 24 + lsrs r0, 24 + bl sub_80AB104 + pop {r0} + bx r0 + thumb_func_end sub_80AEE08 + + thumb_func_start sub_80AEE20 +sub_80AEE20: @ 80AEE20 + push {r4,r5,lr} + bl sav1_get_weather_probably + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bne _080AEE4C + ldr r0, =sub_80AECA8 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + bne _080AEE3E + bl bag_add_task0_by_acit +_080AEE3E: + ldr r0, =0x02038bc4 + ldrb r4, [r0] + b _080AEE6E + .pool +_080AEE4C: + ldr r5, =sub_80AECA8 + adds r0, r5, 0 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + beq _080AEE68 + adds r0, r5, 0 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080AEE68: + ldr r1, =0x02038bc4 + movs r0, 0xD + strb r0, [r1] +_080AEE6E: + adds r0, r4, 0 + bl weather_set + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AEE20 + + thumb_func_start sub_80AEE84 +sub_80AEE84: @ 80AEE84 + push {r4,r5,lr} + bl sav1_get_weather_probably + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xF + bne _080AEEB0 + ldr r0, =sub_80AECA8 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + bne _080AEEA2 + bl bag_add_task0_by_acit +_080AEEA2: + ldr r0, =0x02038bc4 + ldrb r4, [r0] + b _080AEED2 + .pool +_080AEEB0: + ldr r5, =sub_80AECA8 + adds r0, r5, 0 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + beq _080AEECC + adds r0, r5, 0 + bl FindTaskIdByFunc + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask +_080AEECC: + ldr r1, =0x02038bc4 + movs r0, 0xD + strb r0, [r1] +_080AEED2: + adds r0, r4, 0 + bl sub_80AB104 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80AEE84 + + thumb_func_start sub_80AEEE8 +sub_80AEEE8: @ 80AEEE8 + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x15 + bhi _080AEFB4 + lsls r0, 2 + ldr r1, =_080AEF00 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_080AEF00: + .4byte _080AEFB4 + .4byte _080AEF58 + .4byte _080AEF5C + .4byte _080AEF60 + .4byte _080AEF64 + .4byte _080AEF68 + .4byte _080AEF6C + .4byte _080AEF70 + .4byte _080AEF74 + .4byte _080AEF78 + .4byte _080AEF7C + .4byte _080AEF80 + .4byte _080AEF84 + .4byte _080AEF88 + .4byte _080AEF8C + .4byte _080AEF90 + .4byte _080AEFB4 + .4byte _080AEFB4 + .4byte _080AEFB4 + .4byte _080AEFB4 + .4byte _080AEF94 + .4byte _080AEF9C +_080AEF58: + movs r0, 0x1 + b _080AEFB6 +_080AEF5C: + movs r0, 0x2 + b _080AEFB6 +_080AEF60: + movs r0, 0x3 + b _080AEFB6 +_080AEF64: + movs r0, 0x4 + b _080AEFB6 +_080AEF68: + movs r0, 0x5 + b _080AEFB6 +_080AEF6C: + movs r0, 0x6 + b _080AEFB6 +_080AEF70: + movs r0, 0x7 + b _080AEFB6 +_080AEF74: + movs r0, 0x8 + b _080AEFB6 +_080AEF78: + movs r0, 0x9 + b _080AEFB6 +_080AEF7C: + movs r0, 0xA + b _080AEFB6 +_080AEF80: + movs r0, 0xB + b _080AEFB6 +_080AEF84: + movs r0, 0xC + b _080AEFB6 +_080AEF88: + movs r0, 0xD + b _080AEFB6 +_080AEF8C: + movs r0, 0xE + b _080AEFB6 +_080AEF90: + movs r0, 0xF + b _080AEFB6 +_080AEF94: + ldr r1, =gUnknown_0854FE5C + b _080AEF9E + .pool +_080AEF9C: + ldr r1, =gUnknown_0854FE60 +_080AEF9E: + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r0, 0x2F + ldrb r0, [r0] + adds r0, r1 + ldrb r0, [r0] + b _080AEFB6 + .pool +_080AEFB4: + movs r0, 0 +_080AEFB6: + pop {r1} + bx r1 + thumb_func_end sub_80AEEE8 + + thumb_func_start sub_80AEFBC +sub_80AEFBC: @ 80AEFBC + lsls r0, 16 + ldr r1, =0x03005d8c + ldr r2, [r1] + adds r2, 0x2F + lsrs r0, 16 + ldrb r1, [r2] + adds r0, r1 + lsls r0, 16 + movs r1, 0xC0 + lsls r1, 10 + ands r1, r0 + lsrs r1, 16 + strb r1, [r2] + bx lr + .pool + thumb_func_end sub_80AEFBC + + thumb_func_start sub_80AEFDC +sub_80AEFDC: @ 80AEFDC + push {lr} + lsls r0, 24 + lsls r1, 24 + lsrs r2, r0, 24 + cmp r0, r1 + beq _080AEFF6 + cmp r2, 0x3 + beq _080AEFF0 + cmp r2, 0x5 + bne _080AEFF6 +_080AEFF0: + movs r0, 0x28 + bl sav12_xor_increment +_080AEFF6: + pop {r0} + bx r0 + thumb_func_end sub_80AEFDC + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/wild_encounter.s b/asm/wild_encounter.s new file mode 100644 index 000000000..71b15f56c --- /dev/null +++ b/asm/wild_encounter.s @@ -0,0 +1,2353 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80B48B8 +sub_80B48B8: @ 80B48B8 + ldr r1, =0x02038c00 + strb r0, [r1] + bx lr + .pool + thumb_func_end sub_80B48B8 + + thumb_func_start sub_80B48C4 +sub_80B48C4: @ 80B48C4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + lsls r1, 16 + lsrs r1, 16 + str r1, [sp, 0x4] + lsls r2, 24 + lsrs r2, 24 + ldr r3, =gUnknown_08553A7C + lsls r1, r2, 1 + adds r1, r2 + lsls r2, r1, 1 + adds r2, r3 + adds r0, r1, 0x1 + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + mov r9, r0 + adds r1, 0x2 + lsls r1, 1 + adds r1, r3 + ldrh r6, [r1] + ldrh r5, [r2] + cmp r5, r9 + bhi _080B496E + ldr r0, =0x02037318 + mov r10, r0 +_080B4906: + movs r4, 0 + mov r1, r10 + ldr r0, [r1] + ldr r0, [r0] + cmp r4, r0 + bge _080B4964 + ldr r1, [sp] + lsls r0, r1, 16 + asrs r0, 16 + mov r8, r0 + ldr r1, [sp, 0x4] + lsls r0, r1, 16 + asrs r7, r0, 16 +_080B4920: + adds r0, r4, 0x7 + adds r1, r5, 0x7 + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl sub_8089660 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B4954 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r8, r4 + bne _080B4954 + cmp r7, r5 + bne _080B4954 + adds r0, r6, 0 + b _080B4974 + .pool +_080B4954: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + mov r1, r10 + ldr r0, [r1] + ldr r0, [r0] + cmp r4, r0 + blt _080B4920 +_080B4964: + adds r0, r5, 0x1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, r9 + bls _080B4906 +_080B496E: + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r0, 16 +_080B4974: + 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_80B48C4 + + thumb_func_start sub_80B4984 +sub_80B4984: @ 80B4984 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + movs r7, 0 + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0x88 + lsls r0, 6 + cmp r1, r0 + bne _080B4A7A + add r5, sp, 0xC + mov r4, sp + adds r4, 0xE + adds r0, r5, 0 + adds r1, r4, 0 + bl GetXYCoordsOneStepInFrontOfPlayer + ldrh r0, [r5] + subs r0, 0x7 + strh r0, [r5] + ldrh r0, [r4] + subs r0, 0x7 + strh r0, [r4] + movs r0, 0 + ldrsh r1, [r4, r0] + ldr r0, =gUnknown_08553A7C + mov r9, r5 + mov r8, r4 + ldrh r2, [r0, 0x6] + cmp r1, r2 + blt _080B49D0 + ldrh r3, [r0, 0x8] + cmp r1, r3 + bgt _080B49D0 + movs r7, 0x1 +_080B49D0: + mov r2, r8 + movs r3, 0 + ldrsh r1, [r2, r3] + ldrh r2, [r0, 0xC] + cmp r1, r2 + blt _080B49E4 + ldrh r0, [r0, 0xE] + cmp r1, r0 + bgt _080B49E4 + movs r7, 0x2 +_080B49E4: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x31 + bls _080B4A08 + b _080B4A7A + .pool +_080B4A04: + movs r0, 0x1 + b _080B4A7C +_080B4A08: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r3, =0x00002e6a + adds r0, r3 + ldrh r0, [r0] + bl sub_80B4AB8 + movs r5, 0 + ldr r6, =0x000001bf +_080B4A1A: + bl sub_80B4A98 + lsls r1, r5, 1 + mov r2, sp + adds r4, r2, r1 + lsls r0, 16 + lsrs r0, 16 + adds r1, r6, 0 + bl __umodsi3 + strh r0, [r4] + lsls r0, 16 + cmp r0, 0 + bne _080B4A38 + strh r6, [r4] +_080B4A38: + ldrh r0, [r4] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bls _080B4A4A + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 +_080B4A4A: + cmp r5, 0x6 + bne _080B4A1A + mov r3, r9 + movs r1, 0 + ldrsh r0, [r3, r1] + mov r2, r8 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r2, r7, 0 + bl sub_80B48C4 + lsls r0, 16 + lsrs r1, r0, 16 + movs r5, 0 +_080B4A66: + lsls r0, r5, 1 + add r0, sp + ldrh r0, [r0] + cmp r1, r0 + beq _080B4A04 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _080B4A66 +_080B4A7A: + movs r0, 0 +_080B4A7C: + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80B4984 + + thumb_func_start sub_80B4A98 +sub_80B4A98: @ 80B4A98 + ldr r2, =0x02038c04 + ldr r1, [r2] + ldr r0, =0x41c64e6d + muls r0, r1 + ldr r1, =0x00003039 + adds r0, r1 + str r0, [r2] + lsrs r0, 16 + bx lr + .pool + thumb_func_end sub_80B4A98 + + thumb_func_start sub_80B4AB8 +sub_80B4AB8: @ 80B4AB8 + lsls r0, 16 + lsrs r0, 16 + ldr r1, =0x02038c04 + str r0, [r1] + bx lr + .pool + thumb_func_end sub_80B4AB8 + + thumb_func_start wild_pokemon_rand_grass +wild_pokemon_rand_grass: @ 80B4AC8 + push {lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x13 + bhi _080B4AE4 + movs r0, 0 + b _080B4B7E +_080B4AE4: + adds r0, r1, 0 + subs r0, 0x14 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bhi _080B4AF4 + movs r0, 0x1 + b _080B4B7E +_080B4AF4: + adds r0, r1, 0 + subs r0, 0x28 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + bhi _080B4B04 + movs r0, 0x2 + b _080B4B7E +_080B4B04: + adds r0, r1, 0 + subs r0, 0x32 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + bhi _080B4B14 + movs r0, 0x3 + b _080B4B7E +_080B4B14: + adds r0, r1, 0 + subs r0, 0x3C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + bhi _080B4B24 + movs r0, 0x4 + b _080B4B7E +_080B4B24: + adds r0, r1, 0 + subs r0, 0x46 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + bhi _080B4B34 + movs r0, 0x5 + b _080B4B7E +_080B4B34: + adds r0, r1, 0 + subs r0, 0x50 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _080B4B44 + movs r0, 0x6 + b _080B4B7E +_080B4B44: + adds r0, r1, 0 + subs r0, 0x55 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _080B4B54 + movs r0, 0x7 + b _080B4B7E +_080B4B54: + adds r0, r1, 0 + subs r0, 0x5A + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bhi _080B4B64 + movs r0, 0x8 + b _080B4B7E +_080B4B64: + adds r0, r1, 0 + subs r0, 0x5E + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bhi _080B4B74 + movs r0, 0x9 + b _080B4B7E +_080B4B74: + cmp r1, 0x62 + beq _080B4B7C + movs r0, 0xB + b _080B4B7E +_080B4B7C: + movs r0, 0xA +_080B4B7E: + pop {r1} + bx r1 + thumb_func_end wild_pokemon_rand_grass + + thumb_func_start wild_pokemon_rand_water +wild_pokemon_rand_water: @ 80B4B84 + push {lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 24 + lsrs r1, r0, 24 + adds r2, r1, 0 + cmp r1, 0x3B + bhi _080B4BA2 + movs r0, 0 + b _080B4BD4 +_080B4BA2: + adds r0, r1, 0 + subs r0, 0x3C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1D + bhi _080B4BB2 + movs r0, 0x1 + b _080B4BD4 +_080B4BB2: + adds r0, r1, 0 + subs r0, 0x5A + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bhi _080B4BC2 + movs r0, 0x2 + b _080B4BD4 +_080B4BC2: + adds r0, r2, 0 + subs r0, 0x5F + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _080B4BD2 + movs r0, 0x4 + b _080B4BD4 +_080B4BD2: + movs r0, 0x3 +_080B4BD4: + pop {r1} + bx r1 + thumb_func_end wild_pokemon_rand_water + + thumb_func_start sub_80B4BD8 +sub_80B4BD8: @ 80B4BD8 + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, r4, 0 + movs r5, 0 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r4, 0x1 + beq _080B4C12 + cmp r4, 0x1 + bgt _080B4C02 + cmp r4, 0 + beq _080B4C08 + b _080B4C6C +_080B4C02: + cmp r6, 0x2 + beq _080B4C36 + b _080B4C6C +_080B4C08: + movs r5, 0x1 + cmp r1, 0x45 + bhi _080B4C6C + movs r5, 0 + b _080B4C6C +_080B4C12: + cmp r1, 0x3B + bhi _080B4C18 + movs r5, 0x2 +_080B4C18: + adds r0, r1, 0 + subs r0, 0x3C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bhi _080B4C26 + movs r5, 0x3 +_080B4C26: + adds r0, r1, 0 + subs r0, 0x50 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bhi _080B4C6C + movs r5, 0x4 + b _080B4C6C +_080B4C36: + cmp r1, 0x27 + bhi _080B4C3C + movs r5, 0x5 +_080B4C3C: + adds r0, r1, 0 + subs r0, 0x28 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x27 + bhi _080B4C4A + movs r5, 0x6 +_080B4C4A: + adds r0, r1, 0 + subs r0, 0x50 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xE + bhi _080B4C58 + movs r5, 0x7 +_080B4C58: + adds r0, r1, 0 + subs r0, 0x5F + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bhi _080B4C66 + movs r5, 0x8 +_080B4C66: + cmp r1, 0x63 + bne _080B4C6C + movs r5, 0x9 +_080B4C6C: + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B4BD8 + + thumb_func_start sub_80B4C74 +sub_80B4C74: @ 80B4C74 + push {r4-r7,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x1] + ldrb r1, [r4] + cmp r0, r1 + bcc _080B4C86 + ldrb r7, [r4] + adds r6, r0, 0 + b _080B4C8A +_080B4C86: + ldrb r7, [r4, 0x1] + ldrb r6, [r4] +_080B4C8A: + subs r4, r6, r7 + adds r4, 0x1 + lsls r4, 24 + lsrs r4, 24 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r5, =0x020244ec + adds r0, r5, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _080B4CEA + adds r0, r5, 0 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x37 + beq _080B4CC8 + cmp r0, 0x48 + beq _080B4CC8 + cmp r0, 0x2E + bne _080B4CEA +_080B4CC8: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080B4CE0 + adds r0, r6, 0 + b _080B4CF0 + .pool +_080B4CE0: + cmp r4, 0 + beq _080B4CEA + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 +_080B4CEA: + adds r0, r7, r4 + lsls r0, 24 + lsrs r0, 24 +_080B4CF0: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80B4C74 + + thumb_func_start get_wild_data_index_for_map +get_wild_data_index_for_map: @ 80B4CF8 + push {r4-r6,lr} + movs r4, 0 + ldr r0, =gWildMonHeaders + ldrb r1, [r0] + adds r5, r0, 0 + cmp r1, 0xFF + beq _080B4D6C + ldr r6, =0x00006a18 +_080B4D08: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 2 + adds r3, r0, r5 + ldrb r1, [r3] + ldr r0, =0x03005d8c + ldr r2, [r0] + movs r0, 0x4 + ldrsb r0, [r2, r0] + cmp r1, r0 + bne _080B4D58 + ldrb r1, [r3, 0x1] + movs r0, 0x5 + ldrsb r0, [r2, r0] + cmp r1, r0 + bne _080B4D58 + ldrh r0, [r2, 0x4] + cmp r0, r6 + bne _080B4D44 + ldr r0, =0x0000403e + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x8 + bls _080B4D3E + movs r0, 0 +_080B4D3E: + adds r0, r4, r0 + lsls r0, 16 + lsrs r4, r0, 16 +_080B4D44: + adds r0, r4, 0 + b _080B4D6E + .pool +_080B4D58: + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 2 + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0xFF + bne _080B4D08 +_080B4D6C: + ldr r0, =0x0000ffff +_080B4D6E: + pop {r4-r6} + pop {r1} + bx r1 + .pool + thumb_func_end get_wild_data_index_for_map + + thumb_func_start sub_80B4D78 +sub_80B4D78: @ 80B4D78 + push {r4-r7,lr} + sub sp, 0x1C + bl GetSafariZoneFlag + cmp r0, 0x1 + bne _080B4E0E + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4F + bhi _080B4E0E + bl sub_80FC3B8 + adds r7, r0, 0 + cmp r7, 0 + beq _080B4E0E + movs r5, 0 +_080B4DA6: + mov r1, sp + adds r0, r1, r5 + strb r5, [r0] + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x18 + bls _080B4DA6 + movs r5, 0 +_080B4DB8: + adds r1, r5, 0x1 + lsls r0, r1, 24 + lsrs r4, r0, 24 + adds r6, r1, 0 + cmp r4, 0x18 + bhi _080B4DE8 + add r5, sp +_080B4DC6: + bl GenerateRandomNumber + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _080B4DDE + ldrb r2, [r5] + mov r0, sp + adds r1, r0, r4 + ldrb r0, [r1] + strb r0, [r5] + strb r2, [r1] +_080B4DDE: + adds r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x18 + bls _080B4DC6 +_080B4DE8: + lsls r0, r6, 24 + lsrs r5, r0, 24 + cmp r5, 0x17 + bls _080B4DB8 + movs r5, 0 +_080B4DF2: + mov r1, sp + adds r4, r1, r5 + ldrb r0, [r4] + adds r1, r7, 0 + bl sub_8136FE4 + lsls r0, 16 + cmp r0, 0 + bgt _080B4E48 + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x18 + bls _080B4DF2 +_080B4E0E: + ldr r4, =0x020244ec + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _080B4E4C + adds r0, r4, 0 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1C + bne _080B4E4C + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080B4E4C + adds r0, r4, 0 + movs r1, 0 + bl pokemon_getattr + b _080B4E54 + .pool +_080B4E48: + ldrb r0, [r4] + b _080B4E5E +_080B4E4C: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 +_080B4E54: + movs r1, 0x19 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 24 +_080B4E5E: + add sp, 0x1C + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80B4D78 + + thumb_func_start sub_80B4E68 +sub_80B4E68: @ 80B4E68 + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 16 + lsrs r6, r0, 16 + lsls r1, 24 + lsrs r7, r1, 24 + bl zero_enemy_party_data + movs r2, 0x1 + ldr r1, =gBaseStats + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x10] + cmp r0, 0 + beq _080B4E96 + cmp r0, 0 + blt _080B4E98 + cmp r0, 0xFF + bgt _080B4E98 + cmp r0, 0xFE + blt _080B4E98 +_080B4E96: + movs r2, 0 +_080B4E98: + cmp r2, 0 + beq _080B4F28 + ldr r5, =0x020244ec + adds r0, r5, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _080B4F28 + adds r0, r5, 0 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x38 + bne _080B4F28 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x3 + bl __umodsi3 + lsls r0, 16 + cmp r0, 0 + beq _080B4F28 + adds r0, r5, 0 + movs r1, 0xB + bl pokemon_getattr + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + movs r1, 0 + bl pokemon_getattr + adds r1, r0, 0 + adds r0, r4, 0 + bl pokemon_species_get_gender_info + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xFE + bne _080B4F00 + movs r4, 0 + b _080B4F02 + .pool +_080B4F00: + movs r4, 0xFE +_080B4F02: + bl sub_80B4D78 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02024744 + str r4, [sp] + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + adds r0, r1, 0 + adds r1, r6, 0 + adds r2, r7, 0 + movs r3, 0x20 + bl sub_8067EF8 + b _080B4F40 + .pool +_080B4F28: + bl sub_80B4D78 + lsls r0, 24 + lsrs r0, 24 + ldr r1, =0x02024744 + str r0, [sp] + adds r0, r1, 0 + adds r1, r6, 0 + adds r2, r7, 0 + movs r3, 0x20 + bl pokemon_make_with_nature +_080B4F40: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B4E68 + + thumb_func_start sub_80B4F4C +sub_80B4F4C: @ 80B4F4C + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + lsls r1, 24 + lsrs r3, r1, 24 + adds r4, r3, 0 + lsls r2, 24 + lsrs r6, r2, 24 + movs r1, 0 + mov r0, sp + strb r1, [r0] + cmp r3, 0x1 + beq _080B4FA0 + cmp r3, 0x1 + bgt _080B4F70 + cmp r3, 0 + beq _080B4F76 + b _080B4FBA +_080B4F70: + cmp r4, 0x2 + beq _080B4FB2 + b _080B4FBA +_080B4F76: + ldr r0, [r5, 0x4] + movs r1, 0x8 + movs r2, 0x2A + mov r3, sp + bl TryGetAbilityInfluencedWildMonIndex + lsls r0, 24 + cmp r0, 0 + bne _080B4FBA + ldr r0, [r5, 0x4] + movs r1, 0xD + movs r2, 0x9 + mov r3, sp + bl TryGetAbilityInfluencedWildMonIndex + lsls r0, 24 + cmp r0, 0 + bne _080B4FBA + bl wild_pokemon_rand_grass + b _080B4FB6 +_080B4FA0: + ldr r0, [r5, 0x4] + movs r1, 0xD + movs r2, 0x9 + mov r3, sp + bl TryGetAbilityInfluencedWildMonIndex + lsls r0, 24 + cmp r0, 0 + bne _080B4FBA +_080B4FB2: + bl wild_pokemon_rand_water +_080B4FB6: + mov r1, sp + strb r0, [r1] +_080B4FBA: + mov r0, sp + ldrb r1, [r0] + lsls r1, 2 + ldr r0, [r5, 0x4] + adds r0, r1 + bl sub_80B4C74 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x1 + ands r0, r6 + cmp r0, 0 + beq _080B4FE0 + adds r0, r4, 0 + bl sub_80B58CC + lsls r0, 24 + cmp r0, 0 + beq _080B5000 +_080B4FE0: + ldr r0, =0x02037318 + ldrh r1, [r0, 0x12] + movs r0, 0xB3 + lsls r0, 1 + cmp r1, r0 + beq _080B5008 + movs r0, 0x2 + ands r0, r6 + cmp r0, 0 + beq _080B5008 + adds r0, r4, 0 + bl DoKeenEyeIntimidateWildEncounterTest + lsls r0, 24 + cmp r0, 0 + bne _080B5008 +_080B5000: + movs r0, 0 + b _080B501C + .pool +_080B5008: + mov r0, sp + ldrb r0, [r0] + ldr r1, [r5, 0x4] + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x2] + adds r1, r4, 0 + bl sub_80B4E68 + movs r0, 0x1 +_080B501C: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B4F4C + + thumb_func_start sub_80B5024 +sub_80B5024: @ 80B5024 + push {r4,r5,lr} + adds r5, r0, 0 + lsls r0, r1, 24 + lsrs r0, 24 + bl sub_80B4BD8 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 22 + ldr r0, [r5, 0x4] + adds r0, r4 + bl sub_80B4C74 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, [r5, 0x4] + adds r0, r4, r0 + ldrh r0, [r0, 0x2] + bl sub_80B4E68 + ldr r0, [r5, 0x4] + adds r4, r0 + ldrh r0, [r4, 0x2] + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B5024 + + thumb_func_start SetUpMassOutbreakEncounter +SetUpMassOutbreakEncounter: @ 80B505C + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B508C + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x00002b94 + adds r0, r1 + ldrb r0, [r0] + bl sub_80B58CC + lsls r0, 24 + cmp r0, 0 + bne _080B508C + movs r0, 0 + b _080B50C6 + .pool +_080B508C: + ldr r0, =0x03005d8c + ldr r1, [r0] + ldr r2, =0x00002b90 + adds r0, r1, r2 + ldrh r0, [r0] + adds r2, 0x4 + adds r1, r2 + ldrb r1, [r1] + bl sub_80B4E68 + movs r4, 0 +_080B50A2: + ldr r0, =0x03005d8c + ldr r0, [r0] + lsls r1, r4, 1 + ldr r2, =0x00002b98 + adds r0, r2 + adds r0, r1 + ldrh r1, [r0] + lsls r2, r4, 24 + lsrs r2, 24 + ldr r0, =0x02024744 + bl sub_80691F4 + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0x3 + bls _080B50A2 + movs r0, 0x1 +_080B50C6: + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end SetUpMassOutbreakEncounter + + thumb_func_start DoMassOutbreakEncounterTest +DoMassOutbreakEncounterTest: @ 80B50DC + push {r4,lr} + ldr r4, =0x03005d8c + ldr r2, [r4] + ldr r1, =0x00002b90 + adds r0, r2, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _080B513C + movs r1, 0x5 + ldrsb r1, [r2, r1] + ldr r3, =0x00002b92 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r1, r0 + bne _080B513C + movs r1, 0x4 + ldrsb r1, [r2, r1] + adds r3, 0x1 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r1, r0 + bne _080B513C + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + ldr r1, [r4] + ldr r2, =0x00002ba1 + adds r1, r2 + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r1] + cmp r0, r1 + bcs _080B513C + movs r0, 0x1 + b _080B513E + .pool +_080B513C: + movs r0, 0 +_080B513E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end DoMassOutbreakEncounterTest + + thumb_func_start DoWildEncounterRateDiceRoll +DoWildEncounterRateDiceRoll: @ 80B5144 + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xB4 + lsls r1, 4 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, r4 + bcc _080B5168 + movs r0, 0 + b _080B516A +_080B5168: + movs r0, 0x1 +_080B516A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end DoWildEncounterRateDiceRoll + + thumb_func_start DoWildEncounterRateTest +DoWildEncounterRateTest: @ 80B5170 + push {r4,lr} + sub sp, 0x4 + str r0, [sp] + lsls r1, 24 + lsrs r4, r1, 24 + lsls r0, 4 + str r0, [sp] + movs r0, 0x6 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _080B519A + ldr r1, [sp] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + movs r1, 0x64 + bl __udivsi3 + str r0, [sp] +_080B519A: + mov r0, sp + bl affects_encounter_rate_based_on_flags + mov r0, sp + bl ApplyCleanseTagWildEncounterRateReduction + cmp r4, 0 + bne _080B5216 + ldr r4, =0x020244ec + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _080B5216 + adds r0, r4, 0 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B51E8 + ldr r0, =0x02037318 + ldrh r1, [r0, 0x12] + ldr r0, =0x00000169 + cmp r1, r0 + bne _080B5210 + ldr r1, [sp] + lsls r0, r1, 1 + adds r0, r1 + lsrs r0, 2 + b _080B5214 + .pool +_080B51E8: + cmp r0, 0x23 + bne _080B51F2 + ldr r0, [sp] + lsls r0, 1 + b _080B5214 +_080B51F2: + cmp r0, 0x49 + beq _080B5210 + cmp r0, 0x47 + bne _080B5200 + ldr r0, [sp] + lsls r0, 1 + b _080B5214 +_080B5200: + cmp r0, 0x8 + bne _080B5216 + ldr r0, =0x03005d8c + ldr r0, [r0] + adds r0, 0x2E + ldrb r0, [r0] + cmp r0, 0x8 + bne _080B5216 +_080B5210: + ldr r0, [sp] + lsrs r0, 1 +_080B5214: + str r0, [sp] +_080B5216: + ldr r0, [sp] + movs r1, 0xB4 + lsls r1, 4 + cmp r0, r1 + bls _080B5222 + str r1, [sp] +_080B5222: + ldr r0, [sp] + lsls r0, 16 + lsrs r0, 16 + bl DoWildEncounterRateDiceRoll + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end DoWildEncounterRateTest + + thumb_func_start DoGlobalWildEncounterDiceRoll +DoGlobalWildEncounterDiceRoll: @ 80B523C + push {lr} + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3B + bhi _080B5258 + movs r0, 0x1 + b _080B525A +_080B5258: + movs r0, 0 +_080B525A: + pop {r1} + bx r1 + thumb_func_end DoGlobalWildEncounterDiceRoll + + thumb_func_start sub_80B5260 +sub_80B5260: @ 80B5260 + push {lr} + ldr r0, =0x03005d8c + ldr r0, [r0] + ldrh r1, [r0, 0x4] + movs r0, 0xE0 + lsls r0, 3 + cmp r1, r0 + bne _080B5280 + movs r0, 0x53 + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + b _080B5282 + .pool +_080B5280: + movs r0, 0 +_080B5282: + pop {r1} + bx r1 + thumb_func_end sub_80B5260 + + thumb_func_start is_it_battle_time_2 +is_it_battle_time_2: @ 80B5288 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 16 + lsrs r6, r0, 16 + mov r9, r6 + lsls r1, 16 + lsrs r7, r1, 16 + mov r8, r7 + ldr r0, =0x02038c00 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080B52A6 + b _080B54FE +_080B52A6: + bl get_wild_data_index_for_map + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, =0x0000ffff + cmp r5, r0 + bne _080B539C + ldr r0, =0x02037318 + ldrh r1, [r0, 0x12] + movs r0, 0xB3 + lsls r0, 1 + cmp r1, r0 + bne _080B5330 + bl sub_81A7D00 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r7, r6 + beq _080B52D8 + bl DoGlobalWildEncounterDiceRoll + lsls r0, 24 + cmp r0, 0 + bne _080B52D8 + b _080B54FE +_080B52D8: + ldr r1, =gUnknown_08553A14 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 2 + adds r1, 0x4 + adds r4, r0, r1 + ldr r0, [r4] + ldrb r0, [r0] + movs r1, 0 + bl DoWildEncounterRateTest + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B52F8 + b _080B54FE +_080B52F8: + ldr r0, [r4] + movs r1, 0 + movs r2, 0x2 + bl sub_80B4F4C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B530C + b _080B54FE +_080B530C: + movs r0, 0x1 + bl sub_81A7B90 + cmp r0, 0 + bne _080B5318 + b _080B54FE +_080B5318: + bl sub_80B06B0 + movs r0, 0x1 + b _080B5500 + .pool +_080B5330: + ldr r0, =0x00000169 + cmp r1, r0 + beq _080B5338 + b _080B54FE +_080B5338: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r5, [r0] + cmp r7, r6 + beq _080B5352 + bl DoGlobalWildEncounterDiceRoll + lsls r0, 24 + cmp r0, 0 + bne _080B5352 + b _080B54FE +_080B5352: + ldr r1, =gUnknown_08553894 + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 2 + adds r1, 0x4 + adds r4, r0, r1 + ldr r0, [r4] + ldrb r0, [r0] + movs r1, 0 + bl DoWildEncounterRateTest + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B5372 + b _080B54FE +_080B5372: + ldr r0, [r4] + movs r1, 0 + movs r2, 0x2 + bl sub_80B4F4C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B5386 + b _080B54FE +_080B5386: + bl sub_81A9C04 + b _080B54F6 + .pool +_080B539C: + lsls r0, r6, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_808952C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B543C + ldr r1, =gWildMonHeaders + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 2 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + adds r4, r2, 0 + cmp r0, 0 + bne _080B53C4 + b _080B54FE +_080B53C4: + cmp r7, r6 + beq _080B53D4 + bl DoGlobalWildEncounterDiceRoll + lsls r0, 24 + cmp r0, 0 + bne _080B53D4 + b _080B54FE +_080B53D4: + ldr r1, =gWildMonHeaders + adds r0, r4, r5 + lsls r0, 2 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + ldrb r0, [r0] + movs r1, 0 + bl DoWildEncounterRateTest + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B53F2 + b _080B54FE +_080B53F2: + bl sub_8161EDC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B54BA + bl DoMassOutbreakEncounterTest + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B5418 + movs r0, 0x3 + bl SetUpMassOutbreakEncounter + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B54F6 +_080B5418: + ldr r1, =gWildMonHeaders + adds r0, r4, r5 + lsls r0, 2 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + movs r2, 0x3 + bl sub_80B4F4C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B54F6 + b _080B54FE + .pool +_080B543C: + adds r0, r4, 0 + bl sub_8089558 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B5464 + movs r0, 0x8 + bl TestPlayerAvatarFlags + lsls r0, 24 + cmp r0, 0 + beq _080B54FE + adds r0, r4, 0 + bl sub_80894AC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B54FE +_080B5464: + bl sub_80B5260 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B54FE + ldr r1, =gWildMonHeaders + lsls r2, r5, 2 + adds r0, r2, r5 + lsls r0, 2 + adds r1, 0x8 + adds r0, r1 + ldr r0, [r0] + adds r4, r2, 0 + cmp r0, 0 + beq _080B54FE + cmp r8, r9 + beq _080B5492 + bl DoGlobalWildEncounterDiceRoll + lsls r0, 24 + cmp r0, 0 + beq _080B54FE +_080B5492: + ldr r1, =gWildMonHeaders + adds r0, r4, r5 + lsls r0, 2 + adds r1, 0x8 + adds r4, r0, r1 + ldr r0, [r4] + ldrb r0, [r0] + movs r1, 0 + bl DoWildEncounterRateTest + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B54FE + bl sub_8161EDC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B54E4 +_080B54BA: + ldr r0, =0x03005d8c + ldr r0, [r0] + ldr r1, =0x000031dc + adds r0, r1 + ldrb r0, [r0, 0xC] + bl sub_80B58CC + lsls r0, 24 + cmp r0, 0 + beq _080B54FE + bl sub_80B072C + movs r0, 0x1 + b _080B5500 + .pool +_080B54E4: + ldr r0, [r4] + movs r1, 0x1 + movs r2, 0x3 + bl sub_80B4F4C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B54FE +_080B54F6: + bl sub_80B0698 + movs r0, 0x1 + b _080B5500 +_080B54FE: + movs r0, 0 +_080B5500: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end is_it_battle_time_2 + + thumb_func_start rock_smash_wild_pokemon_encounter +rock_smash_wild_pokemon_encounter: @ 80B550C + push {r4,lr} + bl get_wild_data_index_for_map + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =0x0000ffff + cmp r2, r0 + beq _080B5568 + ldr r1, =gWildMonHeaders + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 2 + adds r1, 0xC + adds r0, r1 + ldr r4, [r0] + cmp r4, 0 + beq _080B5554 + ldrb r0, [r4] + movs r1, 0x1 + bl DoWildEncounterRateTest + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B5568 + adds r0, r4, 0 + movs r1, 0x2 + movs r2, 0x3 + bl sub_80B4F4C + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bne _080B5568 + bl sub_80B0698 +_080B5554: + ldr r0, =0x020375f0 + strh r4, [r0] + b _080B556E + .pool +_080B5568: + ldr r1, =0x020375f0 + movs r0, 0 + strh r0, [r1] +_080B556E: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end rock_smash_wild_pokemon_encounter + + thumb_func_start sub_80B5578 +sub_80B5578: @ 80B5578 + push {r4,r5,lr} + sub sp, 0x4 + mov r5, sp + adds r5, 0x2 + mov r0, sp + adds r1, r5, 0 + bl PlayerGetDestCoords + bl get_wild_data_index_for_map + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, =0x0000ffff + cmp r4, r0 + bne _080B562C + ldr r0, =0x02037318 + ldrh r1, [r0, 0x12] + movs r0, 0xB3 + lsls r0, 1 + cmp r1, r0 + bne _080B55E4 + bl sub_81A7D00 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gUnknown_08553A14 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 2 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + movs r2, 0 + bl sub_80B4F4C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B55CA + b _080B56F2 +_080B55CA: + movs r0, 0 + bl sub_81A7B90 + bl sub_80B06B0 + movs r0, 0x1 + b _080B56F4 + .pool +_080B55E4: + ldr r0, =0x00000169 + cmp r1, r0 + beq _080B55EC + b _080B56F2 +_080B55EC: + ldr r0, =0x03005d90 + ldr r0, [r0] + ldr r1, =0x00000cb2 + adds r0, r1 + ldrh r4, [r0] + ldr r1, =gUnknown_08553894 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 2 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + movs r2, 0 + bl sub_80B4F4C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B56F2 + bl sub_81A9C04 + b _080B56EA + .pool +_080B562C: + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl sub_808952C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B568C + ldr r1, =gWildMonHeaders + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 2 + adds r1, 0x4 + adds r0, r1 + ldr r4, [r0] + cmp r4, 0 + beq _080B56F2 + bl sub_8161EDC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B56D4 + bl DoMassOutbreakEncounterTest + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B5680 + movs r0, 0 + bl SetUpMassOutbreakEncounter + b _080B56EA + .pool +_080B5680: + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl sub_80B4F4C + b _080B56EA +_080B568C: + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + bl MapGridGetMetatileBehaviorAt + lsls r0, 24 + lsrs r0, 24 + bl sub_8089558 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B56F2 + bl sub_80B5260 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080B56F2 + ldr r1, =gWildMonHeaders + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 2 + adds r1, 0x8 + adds r0, r1 + ldr r4, [r0] + cmp r4, 0 + beq _080B56F2 + bl sub_8161EDC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B56E0 +_080B56D4: + bl sub_80B072C + movs r0, 0x1 + b _080B56F4 + .pool +_080B56E0: + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl sub_80B4F4C +_080B56EA: + bl sub_80B0698 + movs r0, 0x1 + b _080B56F4 +_080B56F2: + movs r0, 0 +_080B56F4: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B5578 + + thumb_func_start GetFishingWildMonListHeader +GetFishingWildMonListHeader: @ 80B56FC + push {lr} + bl get_wild_data_index_for_map + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =0x0000ffff + cmp r2, r0 + beq _080B572C + ldr r0, =gWildMonHeaders + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 2 + adds r0, 0x10 + adds r1, r0 + ldr r0, [r1] + cmp r0, 0 + beq _080B572C + movs r0, 0x1 + b _080B572E + .pool +_080B572C: + movs r0, 0 +_080B572E: + pop {r1} + bx r1 + thumb_func_end GetFishingWildMonListHeader + + thumb_func_start sub_80B5734 +sub_80B5734: @ 80B5734 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_80B4984 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B5764 + ldr r4, =gUnknown_08553A78 + adds r0, r4, 0 + bl sub_80B4C74 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldrh r4, [r4, 0x2] + adds r0, r4, 0 + bl sub_80B4E68 + b _080B5784 + .pool +_080B5764: + ldr r4, =gWildMonHeaders + bl get_wild_data_index_for_map + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r4, 0x10 + adds r1, r4 + ldr r0, [r1] + adds r1, r5, 0 + bl sub_80B5024 + lsls r0, 16 + lsrs r4, r0, 16 +_080B5784: + movs r0, 0xC + bl sav12_xor_increment + adds r0, r4, 0 + bl sub_80EDA3C + bl sub_80B0698 + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80B5734 + + thumb_func_start wild_pokemon_rand_for_map +wild_pokemon_rand_for_map: @ 80B57A0 + push {r4-r6,lr} + adds r6, r0, 0 + movs r0, 0 + strb r0, [r6] + bl get_wild_data_index_for_map + lsls r0, 16 + lsrs r3, r0, 16 + ldr r0, =0x0000ffff + cmp r3, r0 + beq _080B57D2 + ldr r2, =gWildMonHeaders + lsls r1, r3, 2 + adds r1, r3 + lsls r1, 2 + adds r0, r2, 0x4 + adds r0, r1, r0 + ldr r5, [r0] + adds r2, 0x8 + adds r1, r2 + ldr r4, [r1] + cmp r5, 0 + bne _080B57E0 + cmp r4, 0 + bne _080B57E6 +_080B57D2: + movs r0, 0 + b _080B5826 + .pool +_080B57E0: + cmp r4, 0 + bne _080B57F4 + b _080B5818 +_080B57E6: + movs r0, 0x1 + strb r0, [r6] + bl wild_pokemon_rand_water + lsls r0, 24 + ldr r1, [r4, 0x4] + b _080B5820 +_080B57F4: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x64 + bl __umodsi3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4F + bls _080B5818 + movs r0, 0x1 + strb r0, [r6] + bl wild_pokemon_rand_water + lsls r0, 24 + ldr r1, [r4, 0x4] + b _080B5820 +_080B5818: + bl wild_pokemon_rand_grass + lsls r0, 24 + ldr r1, [r5, 0x4] +_080B5820: + lsrs r0, 22 + adds r0, r1 + ldrh r0, [r0, 0x2] +_080B5826: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end wild_pokemon_rand_for_map + + thumb_func_start sub_80B582C +sub_80B582C: @ 80B582C + push {r4,lr} + bl get_wild_data_index_for_map + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, =0x0000ffff + cmp r2, r0 + beq _080B5868 + ldr r1, =gWildMonHeaders + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 2 + adds r1, 0x8 + adds r0, r1 + ldr r4, [r0] + cmp r4, 0 + beq _080B5868 + bl wild_pokemon_rand_water + lsls r0, 24 + ldr r1, [r4, 0x4] + lsrs r0, 22 + adds r0, r1 + ldrh r0, [r0, 0x2] + b _080B586A + .pool +_080B5868: + movs r0, 0 +_080B586A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80B582C + + thumb_func_start sub_80B5870 +sub_80B5870: @ 80B5870 + push {r4,r5,lr} + bl InBattlePike + lsls r0, 24 + cmp r0, 0 + bne _080B58C4 + bl InBattlePyramid + lsls r0, 24 + cmp r0, 0 + bne _080B58C4 + bl InUnionRoom + cmp r0, 0x1 + beq _080B58C4 + ldr r5, =0x00004021 + adds r0, r5, 0 + bl VarGet + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _080B58C4 + subs r4, r0, 0x1 + lsls r4, 16 + lsrs r4, 16 + adds r0, r5, 0 + adds r1, r4, 0 + bl VarSet + cmp r4, 0 + bne _080B58C4 + ldr r0, =gUnknown_082A4B2A + bl script_env_1_execute_new_script + movs r0, 0x1 + b _080B58C6 + .pool +_080B58C4: + movs r0, 0 +_080B58C6: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80B5870 + + thumb_func_start sub_80B58CC +sub_80B58CC: @ 80B58CC + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, =0x00004021 + bl VarGet + lsls r0, 16 + cmp r0, 0 + beq _080B5912 + movs r5, 0 +_080B58E0: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, =0x020244ec + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0x39 + bl pokemon_getattr + cmp r0, 0 + beq _080B5920 + adds r0, r4, 0 + movs r1, 0x2D + bl pokemon_getattr + cmp r0, 0 + bne _080B5920 + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + cmp r6, r0 + bcc _080B592A +_080B5912: + movs r0, 0x1 + b _080B592C + .pool +_080B5920: + adds r0, r5, 0x1 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x5 + bls _080B58E0 +_080B592A: + movs r0, 0 +_080B592C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80B58CC + + thumb_func_start DoKeenEyeIntimidateWildEncounterTest +@ _BOOL1 DoKeenEyeIntimidateWildEncounterTest(u8 wildMonLevel) +DoKeenEyeIntimidateWildEncounterTest: @ 80B5934 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, =0x020244ec + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _080B5988 + adds r0, r4, 0 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x33 + beq _080B595A + cmp r0, 0x16 + bne _080B5988 +_080B595A: + adds r0, r4, 0 + movs r1, 0x38 + bl pokemon_getattr + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bls _080B5988 + subs r0, 0x5 + cmp r5, r0 + bgt _080B5988 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080B5988 + movs r0, 0 + b _080B598A + .pool +_080B5988: + movs r0, 0x1 +_080B598A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end DoKeenEyeIntimidateWildEncounterTest + + thumb_func_start TryGetRandomWildMonIndexByType +@ _BOOL1 TryGetRandomWildMonIndexByType(WildMonEntry *mons, u8 type, u8 numMons, u8 *monIndex) +TryGetRandomWildMonIndexByType: @ 80B5990 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r7, sp + mov r12, r0 + mov r8, r3 + lsls r1, 24 + lsrs r1, 24 + str r1, [r7] + lsls r2, 24 + lsrs r2, 24 + mov r9, sp + adds r0, r2, 0x3 + lsrs r0, 2 + lsls r0, 2 + mov r1, sp + subs r1, r0 + mov sp, r1 + mov r5, sp + movs r3, 0 + cmp r3, r2 + bcs _080B59D2 + movs r1, 0 +_080B59C4: + adds r0, r5, r3 + strb r1, [r0] + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r2 + bcc _080B59C4 +_080B59D2: + movs r4, 0 + movs r3, 0 + cmp r4, r2 + bcs _080B5A12 + ldr r6, =gBaseStats + mov r10, r6 +_080B59DE: + lsls r0, r3, 2 + add r0, r12 + ldrh r1, [r0, 0x2] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + mov r6, r10 + adds r1, r0, r6 + ldrb r0, [r1, 0x6] + ldr r6, [r7] + cmp r0, r6 + beq _080B59FC + ldrb r0, [r1, 0x7] + cmp r0, r6 + bne _080B5A08 +_080B59FC: + adds r1, r4, 0 + adds r0, r1, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r1, r5, r1 + strb r3, [r1] +_080B5A08: + adds r0, r3, 0x1 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, r2 + bcc _080B59DE +_080B5A12: + cmp r4, 0 + beq _080B5A1A + cmp r4, r2 + bne _080B5A24 +_080B5A1A: + movs r0, 0 + b _080B5A3C + .pool +_080B5A24: + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + adds r1, r4, 0 + bl __modsi3 + adds r0, r5, r0 + ldrb r0, [r0] + mov r1, r8 + strb r0, [r1] + movs r0, 0x1 +_080B5A3C: + mov sp, r9 + 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 TryGetRandomWildMonIndexByType + + thumb_func_start TryGetAbilityInfluencedWildMonIndex +@ _BOOL1 TryGetAbilityInfluencedWildMonIndex(WildMonEntry *mons, u8 type, u8 abilityId, u8 *monIndex) +TryGetAbilityInfluencedWildMonIndex: @ 80B5A50 + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + mov r8, r3 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + ldr r4, =0x020244ec + adds r0, r4, 0 + movs r1, 0x6 + bl pokemon_getattr + cmp r0, 0 + bne _080B5AA4 + adds r0, r4, 0 + bl GetMonAbility + lsls r0, 24 + lsrs r0, 24 + cmp r0, r5 + bne _080B5AA4 + bl GenerateRandomNumber + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080B5AA4 + adds r0, r7, 0 + adds r1, r6, 0 + movs r2, 0xC + mov r3, r8 + bl TryGetRandomWildMonIndexByType + lsls r0, 24 + lsrs r0, 24 + b _080B5AA6 + .pool +_080B5AA4: + movs r0, 0 +_080B5AA6: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end TryGetAbilityInfluencedWildMonIndex + + thumb_func_start affects_encounter_rate_based_on_flags +@ void affects_encounter_rate_based_on_flags(u32 *val) +affects_encounter_rate_based_on_flags: @ 80B5AB0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x000008ad + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B5AD0 + ldr r0, [r4] + lsrs r1, r0, 1 + adds r0, r1 + b _080B5AE2 + .pool +_080B5AD0: + ldr r0, =0x000008ae + bl FlagGet + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080B5AE4 + ldr r0, [r4] + lsrs r0, 1 +_080B5AE2: + str r0, [r4] +_080B5AE4: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end affects_encounter_rate_based_on_flags + + thumb_func_start ApplyCleanseTagWildEncounterRateReduction +ApplyCleanseTagWildEncounterRateReduction: @ 80B5AF0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =0x020244ec + movs r1, 0xC + bl pokemon_getattr + cmp r0, 0xBE + bne _080B5B0C + ldr r0, [r4] + lsls r0, 1 + movs r1, 0x3 + bl __udivsi3 + str r0, [r4] +_080B5B0C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ApplyCleanseTagWildEncounterRateReduction + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/window.s b/asm/window.s index bd65b1e5e..79d162764 100644 --- a/asm/window.s +++ b/asm/window.s @@ -1,4 +1,5 @@ .include "asm/macros.inc" + .include "constants/constants.inc" .syntax unified diff --git a/ld_script.txt b/ld_script.txt index e9f36ffd7..6ff1860ff 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -31,20 +31,150 @@ SECTIONS { src/malloc.o(.text); asm/dma3_manager.o(.text); src/gpu_regs.o(.text); - asm/gpu_bg.o(.text); - asm/pixel_buffer.o(.text); + asm/bg.o(.text); + asm/blit.o(.text); asm/window.o(.text); - asm/text_renderer.o(.text); - asm/gpu_obj.o(.text); + asm/text.o(.text); + asm/sprite.o(.text); asm/string_util.o(.text); - asm/rom_80093CC.o(.text); + asm/link.o(.text); asm/rtc.o(.text); asm/main_menu.o(.text); - asm/rom_8032654.o(.text); - asm/tileset_animation.o(.text); - asm/rom_80A18F4.o(.text); + asm/rom3.o(.text); + asm/decompress.o(.text); + asm/rom_8034C54.o(.text); + asm/pokemon_1.o(.text); + asm/calculate_base_damage.o(.text); + asm/pokemon_2.o(.text); + asm/rom_806BD04.o(.text); + asm/trig.o(.text); + asm/rng.o(.text); + asm/rom_806F640.o(.text); + asm/blend_palette.o(.text); + asm/daycare.o(.text); + asm/egg_hatch.o(.text); + asm/rom_8072304.o(.text); + asm/load_save.o(.text); + asm/trade.o(.text); + asm/berry_blender.o(.text); + asm/play_time.o(.text); + asm/new_game.o(.text); + asm/rom4.o(.text); + asm/fieldmap.o(.text); + asm/metatile_behavior.o(.text); + asm/field_camera.o(.text); + asm/field_door.o(.text); + asm/field_player_avatar.o(.text); + asm/field_map_obj.o(.text); + asm/field_ground_effect.o(.text); + asm/map_obj_8097404.o(.text); + asm/field_message_box.o(.text); + asm/map_obj_lock.o(.text); + asm/text_window.o(.text); + asm/script.o(.text); + asm/scrcmd.o(.text); + asm/rom_809BEDC.o(.text); + asm/var.o(.text); + asm/flag.o(.text); + asm/rom_809D7BC.o(.text); + asm/reset_rtc_screen.o(.text); + asm/start_menu.o(.text); + asm/tileset.o(.text); + asm/palette.o(.text); + asm/sound.o(.text); + asm/rom_80A3934.o(.text); src/task.o(.text); - asm/rom_80A92F4.o(.text); + asm/rom5.o(.text); + asm/title_screen.o(.text); + asm/weather.o(.text); + asm/rom_80AEFFC.o(.text); + asm/battle_setup.o(.text); + asm/cable_club.o(.text); + asm/trainer_see.o(.text); + asm/fldeff_emotion.o(.text); + asm/wild_encounter.o(.text); + asm/field_effect.o(.text); + asm/rom_80B5E6C.o(.text); + asm/option_menu.o(.text); + asm/pokedex.o(.text); + asm/trainer_card.o(.text); + asm/rom_80C6FA0.o(.text); + asm/item.o(.text); + asm/contest.o(.text); + asm/shop.o(.text); + asm/berry.o(.text); + asm/script_menu.o(.text); + asm/naming_screen.o(.text); + asm/money.o(.text); + asm/contest_effect.o(.text); + asm/record_mixing.o(.text); + asm/secret_base.o(.text); + asm/tv.o(.text); + asm/contest_link_80F57C4.o(.text); + asm/script_pokemon_util_80F87D8.o(.text); + asm/field_poison.o(.text); + asm/big_shroomish_barboach.o(.text); + asm/fldeff_80F9BCC.o(.text); + asm/truck_scene.o(.text); + asm/porthole.o(.text); + asm/rotating_gate.o(.text); + asm/safari_zone.o(.text); + asm/contest_link_80FC4F4.o(.text); + asm/item_use.o(.text); + asm/battle_anim_80FE840.o(.text); + asm/bike.o(.text); + asm/easy_chat.o(.text); + asm/mon_markings.o(.text); + asm/mauville_old_man.o(.text); + asm/mail.o(.text); + asm/menu_helpers.o(.text); + asm/dewford_trend.o(.text); + asm/heal_location.o(.text); + asm/region_map.o(.text); + asm/cute_sketch.o(.text); + asm/decoration.o(.text); + asm/slot_machine.o(.text); + asm/contest_painting.o(.text); + asm/battle_ai.o(.text); + asm/trader.o(.text); + asm/starter_choose.o(.text); + asm/wallclock.o(.text); + asm/rom6.o(.text); + asm/battle_records.o(.text); + asm/rom_813C5BC.o(.text); + asm/pokedex_area_screen.o(.text); + asm/evolution_scene.o(.text); + asm/roulette.o(.text); + asm/pokedex_cry_screen.o(.text); + asm/coins.o(.text); + asm/landmark.o(.text); + asm/fldeff_strength.o(.text); + asm/rom_8145E84.o(.text); + asm/battle_transition.o(.text); + asm/battle_814AEAC.o(.text); + asm/battle_message.o(.text); + asm/cable_car.o(.text); + asm/rom_8151534.o(.text); + asm/roulette_util.o(.text); + asm/cable_car_util.o(.text); + asm/save.o(.text); + asm/mystery_event_script.o(.text); + asm/field_effect_helpers.o(.text); + asm/contest_ai.o(.text); + asm/rom_8158B30.o(.text); + asm/player_pc.o(.text); + asm/intro.o(.text); + asm/rom_816F318.o(.text); + asm/lottery_corner.o(.text); + asm/diploma.o(.text); + asm/berry_tag_screen.o(.text); + asm/mystery_event_menu.o(.text); + asm/save_failed_screen.o(.text); + asm/rom_81795E8.o(.text); + asm/clear_save_data_screen.o(.text); + asm/rom_817B064.o(.text); + asm/front_pic_anim.o(.text); + asm/rom_8184DA4.o(.text); asm/multiboot.o(.text); asm/rom_81BAD84.o(.text); } =0